summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
commit2ad50720237fdd19cf5ab45b8cb6bb21119c00b8 (patch)
treedb21eee69668a06abc3f310ebbd51f5dbadf2de7 /src
parentb72cf3c5702b749c7bf26383ff05a9ab55022d31 (diff)
BIG update.
Remove redundant machine items from address_space and device_t. Neither machine nor m_machine are directly accessible anymore. Instead a new getter machine() is available which returns a machine reference. So: space->machine->xxx ==> space->machine().xxx device->machine->yyy ==> device->machine().yyy Globally changed all running_machine pointers to running_machine references. Any function/method that takes a running_machine takes it as a required parameter (1 or 2 exceptions). Being consistent here gets rid of a lot of odd &machine or *machine, but it does mean a very large bulk change across the project. Structs which have a running_machine * now have that variable renamed to m_machine, and now have a shiny new machine() method that works like the space and device methods above. Since most of these are things that should eventually be devices anyway, consider this a step in that direction. 98% of the update was done with regex searches. The changes are architected such that the compiler will catch the remaining errors: // find things that use an embedded machine directly and replace // with a machine() getter call S: ->machine-> R: ->machine\(\)\. // do the same if via a reference S: \.machine-> R: \.machine\(\)\. // convert function parameters to running_machine & S: running_machine \*machine([^;]) R: running_machine \&machine\1 // replace machine-> with machine. S: machine-> R: machine\. // replace &machine() with machine() S: \&([()->a-z0-9_]+machine\(\)) R: \1 // sanity check: look for this used as a cast (running_machine &) // and change to this: *(running_machine *)
Diffstat (limited to 'src')
-rw-r--r--src/emu/audio/generic.c18
-rw-r--r--src/emu/audio/generic.h4
-rw-r--r--src/emu/cheat.c28
-rw-r--r--src/emu/config.c44
-rw-r--r--src/emu/config.h10
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c6
-rw-r--r--src/emu/cpu/alph8201/alph8201.c4
-rw-r--r--src/emu/cpu/am29000/am29000.c2
-rw-r--r--src/emu/cpu/asap/asap.c2
-rw-r--r--src/emu/cpu/cop400/cop400.c8
-rw-r--r--src/emu/cpu/cosmac/cosmac.c2
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c32
-rw-r--r--src/emu/cpu/drcbex64.c4
-rw-r--r--src/emu/cpu/drcbex86.c4
-rw-r--r--src/emu/cpu/drcfe.c8
-rw-r--r--src/emu/cpu/drcuml.c38
-rw-r--r--src/emu/cpu/dsp16/dsp16.c2
-rw-r--r--src/emu/cpu/dsp32/dsp32.c2
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c2
-rw-r--r--src/emu/cpu/e132xs/e132xs.c2
-rw-r--r--src/emu/cpu/esrip/esrip.c24
-rw-r--r--src/emu/cpu/esrip/esrip.h4
-rw-r--r--src/emu/cpu/g65816/g65816.c2
-rw-r--r--src/emu/cpu/h83002/h8_16.c2
-rw-r--r--src/emu/cpu/h83002/h8_8.c10
-rw-r--r--src/emu/cpu/h83002/h8periph.c16
-rw-r--r--src/emu/cpu/hd6309/hd6309.c2
-rw-r--r--src/emu/cpu/i386/i386.c6
-rw-r--r--src/emu/cpu/jaguar/jaguar.c2
-rw-r--r--src/emu/cpu/m37710/m37710.c4
-rw-r--r--src/emu/cpu/m6800/m6800.c8
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c8
-rw-r--r--src/emu/cpu/mb86233/mb86233.c6
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.c2
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c2
-rw-r--r--src/emu/cpu/mcs48/mcs48.c2
-rw-r--r--src/emu/cpu/mips/mips3com.c2
-rw-r--r--src/emu/cpu/mips/mips3drc.c16
-rw-r--r--src/emu/cpu/mips/psx.c6
-rw-r--r--src/emu/cpu/mips/r3000.c4
-rw-r--r--src/emu/cpu/mn10200/mn10200.c2
-rw-r--r--src/emu/cpu/nec/v25.c2
-rw-r--r--src/emu/cpu/powerpc/ppc.c4
-rw-r--r--src/emu/cpu/powerpc/ppccom.c18
-rw-r--r--src/emu/cpu/powerpc/ppcdrc.c16
-rw-r--r--src/emu/cpu/rsp/rsp.c4
-rw-r--r--src/emu/cpu/rsp/rspdrc.c18
-rw-r--r--src/emu/cpu/sc61860/sc61860.c2
-rw-r--r--src/emu/cpu/sh2/sh2comn.c8
-rw-r--r--src/emu/cpu/sh2/sh2drc.c16
-rw-r--r--src/emu/cpu/sh4/sh4.c14
-rw-r--r--src/emu/cpu/sh4/sh4comn.c12
-rw-r--r--src/emu/cpu/sharc/sharc.c2
-rw-r--r--src/emu/cpu/ssem/ssem.c2
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c4
-rw-r--r--src/emu/cpu/tms32025/tms32025.c2
-rw-r--r--src/emu/cpu/tms32031/32031ops.c4
-rw-r--r--src/emu/cpu/tms32031/tms32031.c6
-rw-r--r--src/emu/cpu/tms34010/34010gfx.c2
-rw-r--r--src/emu/cpu/tms34010/34010ops.c2
-rw-r--r--src/emu/cpu/tms34010/tms34010.c30
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h4
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.c6
-rw-r--r--src/emu/cpu/vtlb.c16
-rw-r--r--src/emu/cpu/z180/z180.c4
-rw-r--r--src/emu/cpu/z8/z8.c4
-rw-r--r--src/emu/cpu/z80/z80daisy.c2
-rw-r--r--src/emu/crsshair.c40
-rw-r--r--src/emu/crsshair.h10
-rw-r--r--src/emu/debug/debugcmd.c278
-rw-r--r--src/emu/debug/debugcmd.h8
-rw-r--r--src/emu/debug/debugcon.c36
-rw-r--r--src/emu/debug/debugcon.h14
-rw-r--r--src/emu/debug/debugcpu.c258
-rw-r--r--src/emu/debug/debugcpu.h20
-rw-r--r--src/emu/debug/debugvw.c30
-rw-r--r--src/emu/debug/dvdisasm.c14
-rw-r--r--src/emu/debug/dvmemory.c12
-rw-r--r--src/emu/debug/dvstate.c18
-rw-r--r--src/emu/debugger.c20
-rw-r--r--src/emu/debugger.h22
-rw-r--r--src/emu/debugint/debugint.c104
-rw-r--r--src/emu/debugint/debugint.h4
-rw-r--r--src/emu/devcb.c16
-rw-r--r--src/emu/devcb.h4
-rw-r--r--src/emu/devcpu.c2
-rw-r--r--src/emu/devcpu.h4
-rw-r--r--src/emu/devimage.c8
-rw-r--r--src/emu/devintrf.c21
-rw-r--r--src/emu/devintrf.h14
-rw-r--r--src/emu/devlegcy.c2
-rw-r--r--src/emu/diexec.c24
-rw-r--r--src/emu/diexec.h8
-rw-r--r--src/emu/diimage.c14
-rw-r--r--src/emu/disound.c24
-rw-r--r--src/emu/distate.c2
-rw-r--r--src/emu/drawgfx.c70
-rw-r--r--src/emu/drawgfx.h10
-rw-r--r--src/emu/driver.h6
-rw-r--r--src/emu/drivers/empty.c2
-rw-r--r--src/emu/emucore.h4
-rw-r--r--src/emu/emuopts.c2
-rw-r--r--src/emu/emupal.c143
-rw-r--r--src/emu/emupal.h36
-rw-r--r--src/emu/image.c58
-rw-r--r--src/emu/image.h8
-rw-r--r--src/emu/imagedev/bitbngr.c6
-rw-r--r--src/emu/imagedev/bitbngr.h2
-rw-r--r--src/emu/imagedev/cartslot.c14
-rw-r--r--src/emu/imagedev/cassette.c16
-rw-r--r--src/emu/imagedev/cassimg.c10
-rw-r--r--src/emu/imagedev/cassimg.h10
-rw-r--r--src/emu/imagedev/chd_cd.c2
-rw-r--r--src/emu/imagedev/flopdrv.c30
-rw-r--r--src/emu/imagedev/flopdrv.h6
-rw-r--r--src/emu/imagedev/snapquik.c10
-rw-r--r--src/emu/imagedev/snapquik.h4
-rw-r--r--src/emu/inptport.c482
-rw-r--r--src/emu/inptport.h65
-rw-r--r--src/emu/input.c148
-rw-r--r--src/emu/input.h30
-rw-r--r--src/emu/inputseq.c14
-rw-r--r--src/emu/inputseq.h14
-rw-r--r--src/emu/machine.c90
-rw-r--r--src/emu/machine.h32
-rw-r--r--src/emu/machine/53c810.c30
-rw-r--r--src/emu/machine/53c810.h10
-rw-r--r--src/emu/machine/6526cia.c2
-rw-r--r--src/emu/machine/6532riot.c2
-rw-r--r--src/emu/machine/6821pia.c2
-rw-r--r--src/emu/machine/68681.c22
-rw-r--r--src/emu/machine/74123.c2
-rw-r--r--src/emu/machine/74181.c4
-rw-r--r--src/emu/machine/74181.h2
-rw-r--r--src/emu/machine/7474.c2
-rw-r--r--src/emu/machine/8042kbdc.c46
-rw-r--r--src/emu/machine/8042kbdc.h8
-rw-r--r--src/emu/machine/adc083x.c38
-rw-r--r--src/emu/machine/am53cf96.c8
-rw-r--r--src/emu/machine/am53cf96.h4
-rw-r--r--src/emu/machine/at28c16.c24
-rw-r--r--src/emu/machine/cdp1852.c2
-rw-r--r--src/emu/machine/cr589.c2
-rw-r--r--src/emu/machine/devhelpr.h2
-rw-r--r--src/emu/machine/ds1302.c2
-rw-r--r--src/emu/machine/ds2401.c4
-rw-r--r--src/emu/machine/ds2404.c2
-rw-r--r--src/emu/machine/eeprom.c10
-rw-r--r--src/emu/machine/er2055.c2
-rw-r--r--src/emu/machine/f3853.c2
-rw-r--r--src/emu/machine/generic.c148
-rw-r--r--src/emu/machine/generic.h28
-rw-r--r--src/emu/machine/i2cmem.c14
-rw-r--r--src/emu/machine/i8155.c2
-rw-r--r--src/emu/machine/i8355.c2
-rw-r--r--src/emu/machine/idectrl.c49
-rw-r--r--src/emu/machine/ins8250.c2
-rw-r--r--src/emu/machine/k033906.c4
-rw-r--r--src/emu/machine/k056230.c2
-rw-r--r--src/emu/machine/latch8.c10
-rw-r--r--src/emu/machine/ldcore.c68
-rw-r--r--src/emu/machine/ldpr8210.c14
-rw-r--r--src/emu/machine/ldv1000.c14
-rw-r--r--src/emu/machine/ldvp931.c16
-rw-r--r--src/emu/machine/mb3773.c2
-rw-r--r--src/emu/machine/mb87078.c2
-rw-r--r--src/emu/machine/mb87078.h2
-rw-r--r--src/emu/machine/mc146818.c4
-rw-r--r--src/emu/machine/microtch.c4
-rw-r--r--src/emu/machine/microtch.h6
-rw-r--r--src/emu/machine/msm6242.c8
-rw-r--r--src/emu/machine/nmc9306.c2
-rw-r--r--src/emu/machine/nvram.c2
-rw-r--r--src/emu/machine/pc16552d.c28
-rw-r--r--src/emu/machine/pc16552d.h4
-rw-r--r--src/emu/machine/pci.c13
-rw-r--r--src/emu/machine/pci.h2
-rw-r--r--src/emu/machine/pckeybrd.h6
-rw-r--r--src/emu/machine/pcshare.h2
-rw-r--r--src/emu/machine/pd4990a.c2
-rw-r--r--src/emu/machine/pic8259.c2
-rw-r--r--src/emu/machine/pit8253.c10
-rw-r--r--src/emu/machine/ram.c4
-rw-r--r--src/emu/machine/rtc65271.c8
-rw-r--r--src/emu/machine/s3c2400.c10
-rw-r--r--src/emu/machine/s3c2410.c10
-rw-r--r--src/emu/machine/s3c2440.c10
-rw-r--r--src/emu/machine/s3c24xx.c294
-rw-r--r--src/emu/machine/scsi.c8
-rw-r--r--src/emu/machine/scsi.h10
-rw-r--r--src/emu/machine/scsicd.c26
-rw-r--r--src/emu/machine/scsidev.c12
-rw-r--r--src/emu/machine/scsihd.c6
-rw-r--r--src/emu/machine/smc91c9x.c5
-rw-r--r--src/emu/machine/timekpr.c6
-rw-r--r--src/emu/machine/tmp68301.c32
-rw-r--r--src/emu/machine/tmp68301.h6
-rw-r--r--src/emu/machine/wd33c93.c26
-rw-r--r--src/emu/machine/wd33c93.h4
-rw-r--r--src/emu/machine/x2212.c2
-rw-r--r--src/emu/machine/x76f041.c4
-rw-r--r--src/emu/machine/x76f100.c4
-rw-r--r--src/emu/machine/z80ctc.c4
-rw-r--r--src/emu/machine/z80dart.c2
-rw-r--r--src/emu/machine/z80dma.c2
-rw-r--r--src/emu/machine/z80pio.c2
-rw-r--r--src/emu/machine/z80sio.c8
-rw-r--r--src/emu/machine/z80sti.c2
-rw-r--r--src/emu/mame.c4
-rw-r--r--src/emu/mame.h2
-rw-r--r--src/emu/mconfig.h8
-rw-r--r--src/emu/memory.c217
-rw-r--r--src/emu/memory.h20
-rw-r--r--src/emu/output.c8
-rw-r--r--src/emu/output.h2
-rw-r--r--src/emu/render.c50
-rw-r--r--src/emu/render.h4
-rw-r--r--src/emu/rendfont.c40
-rw-r--r--src/emu/rendlay.c20
-rw-r--r--src/emu/romload.c118
-rw-r--r--src/emu/romload.h8
-rw-r--r--src/emu/schedule.c4
-rw-r--r--src/emu/schedule.h8
-rw-r--r--src/emu/screen.c74
-rw-r--r--src/emu/screen.h10
-rw-r--r--src/emu/softlist.c88
-rw-r--r--src/emu/softlist.h2
-rw-r--r--src/emu/sound.c58
-rw-r--r--src/emu/sound.h4
-rw-r--r--src/emu/sound/2151intf.c4
-rw-r--r--src/emu/sound/2203intf.c8
-rw-r--r--src/emu/sound/2413intf.c4
-rw-r--r--src/emu/sound/2608intf.c8
-rw-r--r--src/emu/sound/2610intf.c12
-rw-r--r--src/emu/sound/2612intf.c8
-rw-r--r--src/emu/sound/262intf.c6
-rw-r--r--src/emu/sound/3526intf.c6
-rw-r--r--src/emu/sound/3812intf.c6
-rw-r--r--src/emu/sound/8950intf.c6
-rw-r--r--src/emu/sound/aica.c14
-rw-r--r--src/emu/sound/aicalfo.c4
-rw-r--r--src/emu/sound/asc.c4
-rw-r--r--src/emu/sound/astrocde.c2
-rw-r--r--src/emu/sound/ay8910.c8
-rw-r--r--src/emu/sound/beep.c2
-rw-r--r--src/emu/sound/bsmt2000.c2
-rw-r--r--src/emu/sound/c140.c4
-rw-r--r--src/emu/sound/c352.c2
-rw-r--r--src/emu/sound/c6280.c8
-rw-r--r--src/emu/sound/cdda.c8
-rw-r--r--src/emu/sound/cdda.h2
-rw-r--r--src/emu/sound/cdp1863.c4
-rw-r--r--src/emu/sound/cdp1864.c26
-rw-r--r--src/emu/sound/cdp1869.c6
-rw-r--r--src/emu/sound/cem3394.c6
-rw-r--r--src/emu/sound/dac.c2
-rw-r--r--src/emu/sound/digitalk.c4
-rw-r--r--src/emu/sound/disc_inp.c8
-rw-r--r--src/emu/sound/disc_wav.c2
-rw-r--r--src/emu/sound/discrete.c16
-rw-r--r--src/emu/sound/discrete.h2
-rw-r--r--src/emu/sound/dmadac.c4
-rw-r--r--src/emu/sound/es5503.c4
-rw-r--r--src/emu/sound/es5506.c60
-rw-r--r--src/emu/sound/es8712.c2
-rw-r--r--src/emu/sound/filter.c2
-rw-r--r--src/emu/sound/flt_rc.c4
-rw-r--r--src/emu/sound/flt_vol.c2
-rw-r--r--src/emu/sound/fm.c30
-rw-r--r--src/emu/sound/fm.h2
-rw-r--r--src/emu/sound/fm2612.c8
-rw-r--r--src/emu/sound/fmopl.c8
-rw-r--r--src/emu/sound/gaelco.c8
-rw-r--r--src/emu/sound/hc55516.c2
-rw-r--r--src/emu/sound/ics2115.c6
-rw-r--r--src/emu/sound/iremga20.c2
-rw-r--r--src/emu/sound/k005289.c8
-rw-r--r--src/emu/sound/k007232.c2
-rw-r--r--src/emu/sound/k051649.c8
-rw-r--r--src/emu/sound/k053260.c10
-rw-r--r--src/emu/sound/k054539.c24
-rw-r--r--src/emu/sound/k056800.c4
-rw-r--r--src/emu/sound/k056800.h2
-rw-r--r--src/emu/sound/mas3507d.c2
-rw-r--r--src/emu/sound/mos6560.c48
-rw-r--r--src/emu/sound/mos6560.h12
-rw-r--r--src/emu/sound/msm5205.c6
-rw-r--r--src/emu/sound/msm5232.c4
-rw-r--r--src/emu/sound/multipcm.c2
-rw-r--r--src/emu/sound/n63701x.c2
-rw-r--r--src/emu/sound/namco.c10
-rw-r--r--src/emu/sound/nes_apu.c8
-rw-r--r--src/emu/sound/nile.c2
-rw-r--r--src/emu/sound/okim6258.c2
-rw-r--r--src/emu/sound/okim6295.c4
-rw-r--r--src/emu/sound/okim6376.c2
-rw-r--r--src/emu/sound/okim9810.c2
-rw-r--r--src/emu/sound/pokey.c24
-rw-r--r--src/emu/sound/qsound.c4
-rw-r--r--src/emu/sound/rf5c400.c12
-rw-r--r--src/emu/sound/rf5c68.c2
-rw-r--r--src/emu/sound/s14001a.c2
-rw-r--r--src/emu/sound/s2636.c4
-rw-r--r--src/emu/sound/saa1099.c8
-rw-r--r--src/emu/sound/samples.c22
-rw-r--r--src/emu/sound/samples.h2
-rw-r--r--src/emu/sound/scsp.c24
-rw-r--r--src/emu/sound/scsplfo.c4
-rw-r--r--src/emu/sound/segapcm.c4
-rw-r--r--src/emu/sound/sid.c10
-rw-r--r--src/emu/sound/sid.h2
-rw-r--r--src/emu/sound/sid6581.c6
-rw-r--r--src/emu/sound/sidvoice.c2
-rw-r--r--src/emu/sound/sidvoice.h2
-rw-r--r--src/emu/sound/sn76477.c10
-rw-r--r--src/emu/sound/sn76496.c2
-rw-r--r--src/emu/sound/snkwave.c2
-rw-r--r--src/emu/sound/sp0250.c6
-rw-r--r--src/emu/sound/sp0256.c4
-rw-r--r--src/emu/sound/speaker.c8
-rw-r--r--src/emu/sound/spu.c26
-rw-r--r--src/emu/sound/st0016.c2
-rw-r--r--src/emu/sound/t6w28.c2
-rw-r--r--src/emu/sound/tiaintf.c2
-rw-r--r--src/emu/sound/tms3615.c2
-rw-r--r--src/emu/sound/tms36xx.c2
-rw-r--r--src/emu/sound/tms5110.c8
-rw-r--r--src/emu/sound/tms5220.c6
-rw-r--r--src/emu/sound/upd7759.c6
-rw-r--r--src/emu/sound/vlm5030.c8
-rw-r--r--src/emu/sound/votrax.c6
-rw-r--r--src/emu/sound/vrender0.c2
-rw-r--r--src/emu/sound/wave.c12
-rw-r--r--src/emu/sound/x1_010.c8
-rw-r--r--src/emu/sound/ym2151.c20
-rw-r--r--src/emu/sound/ym2413.c6
-rw-r--r--src/emu/sound/ymf262.c6
-rw-r--r--src/emu/sound/ymf271.c10
-rw-r--r--src/emu/sound/ymf278b.c16
-rw-r--r--src/emu/sound/ymz280b.c10
-rw-r--r--src/emu/sound/zsg2.c4
-rw-r--r--src/emu/speaker.c4
-rw-r--r--src/emu/state.c15
-rw-r--r--src/emu/state.h32
-rw-r--r--src/emu/tilemap.c138
-rw-r--r--src/emu/tilemap.h28
-rw-r--r--src/emu/timer.c4
-rw-r--r--src/emu/ui.c332
-rw-r--r--src/emu/ui.h18
-rw-r--r--src/emu/uigfx.c154
-rw-r--r--src/emu/uigfx.h4
-rw-r--r--src/emu/uiimage.c66
-rw-r--r--src/emu/uiimage.h8
-rw-r--r--src/emu/uiinput.c36
-rw-r--r--src/emu/uiinput.h26
-rw-r--r--src/emu/uimenu.c322
-rw-r--r--src/emu/uimenu.h20
-rw-r--r--src/emu/video.c18
-rw-r--r--src/emu/video.h2
-rw-r--r--src/emu/video/crt9007.c4
-rw-r--r--src/emu/video/crt9021.c4
-rw-r--r--src/emu/video/crt9212.c2
-rw-r--r--src/emu/video/generic.c320
-rw-r--r--src/emu/video/generic.h20
-rw-r--r--src/emu/video/hd61830.c4
-rw-r--r--src/emu/video/hd63484.c8
-rw-r--r--src/emu/video/mc6845.c26
-rw-r--r--src/emu/video/msm6255.c4
-rw-r--r--src/emu/video/pc_vga.c46
-rw-r--r--src/emu/video/pc_vga.h8
-rw-r--r--src/emu/video/pc_video.c18
-rw-r--r--src/emu/video/pc_video.h4
-rw-r--r--src/emu/video/poly.c8
-rw-r--r--src/emu/video/poly.h2
-rw-r--r--src/emu/video/resnet.c2
-rw-r--r--src/emu/video/resnet.h2
-rw-r--r--src/emu/video/s2636.c10
-rw-r--r--src/emu/video/saa5050.c16
-rw-r--r--src/emu/video/tlc34076.c12
-rw-r--r--src/emu/video/tms34061.c26
-rw-r--r--src/emu/video/tms34061.h4
-rw-r--r--src/emu/video/tms9927.c6
-rw-r--r--src/emu/video/tms9928a.c50
-rw-r--r--src/emu/video/tms9928a.h6
-rw-r--r--src/emu/video/v9938.c42
-rw-r--r--src/emu/video/v9938.h4
-rw-r--r--src/emu/video/vector.c10
-rw-r--r--src/emu/video/vector.h2
-rw-r--r--src/emu/video/voodoo.c141
-rw-r--r--src/emu/watchdog.c34
-rw-r--r--src/emu/watchdog.h6
-rw-r--r--src/ldplayer/ldplayer.c32
-rw-r--r--src/mame/audio/8080bw.c84
-rw-r--r--src/mame/audio/amiga.c10
-rw-r--r--src/mame/audio/astrof.c10
-rw-r--r--src/mame/audio/atarijsa.c100
-rw-r--r--src/mame/audio/atarijsa.h2
-rw-r--r--src/mame/audio/aztarac.c14
-rw-r--r--src/mame/audio/beezer.c6
-rw-r--r--src/mame/audio/blockade.c2
-rw-r--r--src/mame/audio/bzone.c2
-rw-r--r--src/mame/audio/cage.c44
-rw-r--r--src/mame/audio/cage.h6
-rw-r--r--src/mame/audio/carnival.c6
-rw-r--r--src/mame/audio/cchasm.c38
-rw-r--r--src/mame/audio/cclimber.c16
-rw-r--r--src/mame/audio/cinemat.c130
-rw-r--r--src/mame/audio/circus.c6
-rw-r--r--src/mame/audio/copsnrob.c8
-rw-r--r--src/mame/audio/cps3.c4
-rw-r--r--src/mame/audio/cyberbal.c56
-rw-r--r--src/mame/audio/dcs.c166
-rw-r--r--src/mame/audio/dcs.h6
-rw-r--r--src/mame/audio/depthch.c2
-rw-r--r--src/mame/audio/dkong.c12
-rw-r--r--src/mame/audio/exidy.c32
-rw-r--r--src/mame/audio/exidy440.c24
-rw-r--r--src/mame/audio/exidy440.h2
-rw-r--r--src/mame/audio/firetrk.c2
-rw-r--r--src/mame/audio/flower.c12
-rw-r--r--src/mame/audio/geebee.c6
-rw-r--r--src/mame/audio/gomoku.c8
-rw-r--r--src/mame/audio/gorf.c4
-rw-r--r--src/mame/audio/gottlieb.c76
-rw-r--r--src/mame/audio/gotya.c2
-rw-r--r--src/mame/audio/gridlee.c8
-rw-r--r--src/mame/audio/harddriv.c66
-rw-r--r--src/mame/audio/hyprolyb.c6
-rw-r--r--src/mame/audio/invinco.c2
-rw-r--r--src/mame/audio/irem.c18
-rw-r--r--src/mame/audio/jaguar.c42
-rw-r--r--src/mame/audio/jedi.c26
-rw-r--r--src/mame/audio/laserbat.c4
-rw-r--r--src/mame/audio/leland.c74
-rw-r--r--src/mame/audio/m72.c14
-rw-r--r--src/mame/audio/mario.c34
-rw-r--r--src/mame/audio/mcr.c88
-rw-r--r--src/mame/audio/mcr.h14
-rw-r--r--src/mame/audio/meadows.c22
-rw-r--r--src/mame/audio/micro3d.c28
-rw-r--r--src/mame/audio/mw8080bw.c102
-rw-r--r--src/mame/audio/n8080.c104
-rw-r--r--src/mame/audio/namco52.c8
-rw-r--r--src/mame/audio/namco54.c6
-rw-r--r--src/mame/audio/namcoc7x.c6
-rw-r--r--src/mame/audio/namcoc7x.h2
-rw-r--r--src/mame/audio/phoenix.c10
-rw-r--r--src/mame/audio/pleiads.c8
-rw-r--r--src/mame/audio/polepos.c6
-rw-r--r--src/mame/audio/polyplay.c22
-rw-r--r--src/mame/audio/pulsar.c4
-rw-r--r--src/mame/audio/qix.c10
-rw-r--r--src/mame/audio/redalert.c30
-rw-r--r--src/mame/audio/redbaron.c4
-rw-r--r--src/mame/audio/scramble.c44
-rw-r--r--src/mame/audio/segag80r.c74
-rw-r--r--src/mame/audio/segag80v.c12
-rw-r--r--src/mame/audio/segasnd.c16
-rw-r--r--src/mame/audio/segasnd.h2
-rw-r--r--src/mame/audio/seibu.c46
-rw-r--r--src/mame/audio/seibu.h4
-rw-r--r--src/mame/audio/senjyo.c18
-rw-r--r--src/mame/audio/skyraid.c2
-rw-r--r--src/mame/audio/snes_snd.c18
-rw-r--r--src/mame/audio/snk6502.c42
-rw-r--r--src/mame/audio/spacefb.c12
-rw-r--r--src/mame/audio/starwars.c30
-rw-r--r--src/mame/audio/suna8.c14
-rw-r--r--src/mame/audio/t5182.c12
-rw-r--r--src/mame/audio/taito_en.c24
-rw-r--r--src/mame/audio/taitosnd.c4
-rw-r--r--src/mame/audio/targ.c18
-rw-r--r--src/mame/audio/tiamc1.c4
-rw-r--r--src/mame/audio/timeplt.c18
-rw-r--r--src/mame/audio/trackfld.c18
-rw-r--r--src/mame/audio/turbo.c38
-rw-r--r--src/mame/audio/tx1.c26
-rw-r--r--src/mame/audio/vicdual.c12
-rw-r--r--src/mame/audio/warpwarp.c8
-rw-r--r--src/mame/audio/williams.c60
-rw-r--r--src/mame/audio/williams.h8
-rw-r--r--src/mame/audio/wiping.c10
-rw-r--r--src/mame/audio/wow.c4
-rw-r--r--src/mame/audio/zaxxon.c20
-rw-r--r--src/mame/drivers/1942.c14
-rw-r--r--src/mame/drivers/1943.c6
-rw-r--r--src/mame/drivers/1945kiii.c22
-rw-r--r--src/mame/drivers/20pacgal.c38
-rw-r--r--src/mame/drivers/2mindril.c62
-rw-r--r--src/mame/drivers/39in1.c486
-rw-r--r--src/mame/drivers/40love.c62
-rw-r--r--src/mame/drivers/4enraya.c8
-rw-r--r--src/mame/drivers/5clown.c56
-rw-r--r--src/mame/drivers/8080bw.c14
-rw-r--r--src/mame/drivers/86lions.c20
-rw-r--r--src/mame/drivers/88games.c58
-rw-r--r--src/mame/drivers/ace.c52
-rw-r--r--src/mame/drivers/acefruit.c46
-rw-r--r--src/mame/drivers/acommand.c48
-rw-r--r--src/mame/drivers/actfancr.c36
-rw-r--r--src/mame/drivers/adp.c128
-rw-r--r--src/mame/drivers/aeroboto.c18
-rw-r--r--src/mame/drivers/aerofgt.c24
-rw-r--r--src/mame/drivers/airbustr.c62
-rw-r--r--src/mame/drivers/ajax.c2
-rw-r--r--src/mame/drivers/albazc.c22
-rw-r--r--src/mame/drivers/albazg.c50
-rw-r--r--src/mame/drivers/aleck64.c8
-rw-r--r--src/mame/drivers/alg.c70
-rw-r--r--src/mame/drivers/aliens.c42
-rw-r--r--src/mame/drivers/alpha68k.c178
-rw-r--r--src/mame/drivers/ambush.c6
-rw-r--r--src/mame/drivers/ampoker2.c8
-rw-r--r--src/mame/drivers/amspdwy.c22
-rw-r--r--src/mame/drivers/angelkds.c28
-rw-r--r--src/mame/drivers/appoooh.c16
-rw-r--r--src/mame/drivers/aquarium.c36
-rw-r--r--src/mame/drivers/arabian.c26
-rw-r--r--src/mame/drivers/arcadecl.c16
-rw-r--r--src/mame/drivers/arcadia.c36
-rw-r--r--src/mame/drivers/argus.c6
-rw-r--r--src/mame/drivers/aristmk4.c104
-rw-r--r--src/mame/drivers/aristmk5.c32
-rw-r--r--src/mame/drivers/arkanoid.c38
-rw-r--r--src/mame/drivers/armedf.c36
-rw-r--r--src/mame/drivers/artmagic.c72
-rw-r--r--src/mame/drivers/ashnojoe.c22
-rw-r--r--src/mame/drivers/asterix.c40
-rw-r--r--src/mame/drivers/asteroid.c10
-rw-r--r--src/mame/drivers/astinvad.c80
-rw-r--r--src/mame/drivers/astrocde.c106
-rw-r--r--src/mame/drivers/astrocorp.c72
-rw-r--r--src/mame/drivers/astrof.c134
-rw-r--r--src/mame/drivers/asuka.c36
-rw-r--r--src/mame/drivers/atarifb.c6
-rw-r--r--src/mame/drivers/atarig1.c44
-rw-r--r--src/mame/drivers/atarig42.c50
-rw-r--r--src/mame/drivers/atarigt.c56
-rw-r--r--src/mame/drivers/atarigx2.c38
-rw-r--r--src/mame/drivers/atarisy1.c86
-rw-r--r--src/mame/drivers/atarisy2.c138
-rw-r--r--src/mame/drivers/atarisy4.c74
-rw-r--r--src/mame/drivers/ataxx.c36
-rw-r--r--src/mame/drivers/atetris.c34
-rw-r--r--src/mame/drivers/attckufo.c16
-rw-r--r--src/mame/drivers/avalnche.c18
-rw-r--r--src/mame/drivers/avt.c12
-rw-r--r--src/mame/drivers/aztarac.c8
-rw-r--r--src/mame/drivers/backfire.c96
-rw-r--r--src/mame/drivers/badlands.c56
-rw-r--r--src/mame/drivers/bagman.c22
-rw-r--r--src/mame/drivers/balsente.c28
-rw-r--r--src/mame/drivers/bankp.c2
-rw-r--r--src/mame/drivers/baraduke.c34
-rw-r--r--src/mame/drivers/batman.c28
-rw-r--r--src/mame/drivers/battlane.c16
-rw-r--r--src/mame/drivers/battlera.c22
-rw-r--r--src/mame/drivers/battlex.c16
-rw-r--r--src/mame/drivers/battlnts.c24
-rw-r--r--src/mame/drivers/bbusters.c24
-rw-r--r--src/mame/drivers/beaminv.c32
-rw-r--r--src/mame/drivers/beathead.c22
-rw-r--r--src/mame/drivers/berzerk.c96
-rw-r--r--src/mame/drivers/bestleag.c34
-rw-r--r--src/mame/drivers/bfcobra.c136
-rw-r--r--src/mame/drivers/bfm_sc1.c74
-rw-r--r--src/mame/drivers/bfm_sc2.c182
-rw-r--r--src/mame/drivers/bfmsys85.c32
-rw-r--r--src/mame/drivers/big10.c16
-rw-r--r--src/mame/drivers/bigevglf.c70
-rw-r--r--src/mame/drivers/bigfghtr.c76
-rw-r--r--src/mame/drivers/bingoc.c12
-rw-r--r--src/mame/drivers/bingor.c16
-rw-r--r--src/mame/drivers/bionicc.c20
-rw-r--r--src/mame/drivers/bishi.c26
-rw-r--r--src/mame/drivers/bking.c38
-rw-r--r--src/mame/drivers/blackt96.c26
-rw-r--r--src/mame/drivers/bladestl.c32
-rw-r--r--src/mame/drivers/blitz.c30
-rw-r--r--src/mame/drivers/blitz68k.c228
-rw-r--r--src/mame/drivers/blktiger.c30
-rw-r--r--src/mame/drivers/blmbycar.c28
-rw-r--r--src/mame/drivers/blockade.c14
-rw-r--r--src/mame/drivers/blockhl.c38
-rw-r--r--src/mame/drivers/blockout.c10
-rw-r--r--src/mame/drivers/blstroid.c16
-rw-r--r--src/mame/drivers/blueprnt.c16
-rw-r--r--src/mame/drivers/bmcbowl.c30
-rw-r--r--src/mame/drivers/bnstars.c104
-rw-r--r--src/mame/drivers/bogeyman.c16
-rw-r--r--src/mame/drivers/bombjack.c10
-rw-r--r--src/mame/drivers/boogwing.c8
-rw-r--r--src/mame/drivers/bottom9.c52
-rw-r--r--src/mame/drivers/boxer.c54
-rw-r--r--src/mame/drivers/brkthru.c20
-rw-r--r--src/mame/drivers/bsktball.c30
-rw-r--r--src/mame/drivers/btime.c100
-rw-r--r--src/mame/drivers/btoads.c34
-rw-r--r--src/mame/drivers/bublbobl.c42
-rw-r--r--src/mame/drivers/buggychl.c20
-rw-r--r--src/mame/drivers/buster.c8
-rw-r--r--src/mame/drivers/bwidow.c20
-rw-r--r--src/mame/drivers/bwing.c54
-rw-r--r--src/mame/drivers/bzone.c24
-rw-r--r--src/mame/drivers/cabal.c36
-rw-r--r--src/mame/drivers/cabaret.c36
-rw-r--r--src/mame/drivers/calchase.c78
-rw-r--r--src/mame/drivers/calomega.c46
-rw-r--r--src/mame/drivers/calorie.c30
-rw-r--r--src/mame/drivers/canyon.c8
-rw-r--r--src/mame/drivers/capbowl.c38
-rw-r--r--src/mame/drivers/cardline.c22
-rw-r--r--src/mame/drivers/carjmbre.c2
-rw-r--r--src/mame/drivers/carpolo.c4
-rw-r--r--src/mame/drivers/carrera.c6
-rw-r--r--src/mame/drivers/caswin.c32
-rw-r--r--src/mame/drivers/cave.c308
-rw-r--r--src/mame/drivers/cb2001.c26
-rw-r--r--src/mame/drivers/cball.c24
-rw-r--r--src/mame/drivers/cbasebal.c24
-rw-r--r--src/mame/drivers/cbuster.c30
-rw-r--r--src/mame/drivers/ccastles.c44
-rw-r--r--src/mame/drivers/cchance.c14
-rw-r--r--src/mame/drivers/cchasm.c2
-rw-r--r--src/mame/drivers/cclimber.c20
-rw-r--r--src/mame/drivers/cd32.c104
-rw-r--r--src/mame/drivers/cdi.c42
-rw-r--r--src/mame/drivers/centiped.c56
-rw-r--r--src/mame/drivers/chaknpop.c10
-rw-r--r--src/mame/drivers/cham24.c44
-rw-r--r--src/mame/drivers/champbas.c38
-rw-r--r--src/mame/drivers/champbwl.c24
-rw-r--r--src/mame/drivers/chanbara.c58
-rw-r--r--src/mame/drivers/changela.c62
-rw-r--r--src/mame/drivers/cheekyms.c8
-rw-r--r--src/mame/drivers/chihiro.c8
-rw-r--r--src/mame/drivers/chinagat.c56
-rw-r--r--src/mame/drivers/chinsan.c54
-rw-r--r--src/mame/drivers/chqflag.c56
-rw-r--r--src/mame/drivers/chsuper.c24
-rw-r--r--src/mame/drivers/cidelsa.c20
-rw-r--r--src/mame/drivers/cinemat.c64
-rw-r--r--src/mame/drivers/circus.c22
-rw-r--r--src/mame/drivers/circusc.c22
-rw-r--r--src/mame/drivers/cischeat.c150
-rw-r--r--src/mame/drivers/citycon.c12
-rw-r--r--src/mame/drivers/clayshoo.c40
-rw-r--r--src/mame/drivers/cliffhgr.c28
-rw-r--r--src/mame/drivers/cloak.c10
-rw-r--r--src/mame/drivers/cloud9.c36
-rw-r--r--src/mame/drivers/clshroad.c10
-rw-r--r--src/mame/drivers/cmmb.c32
-rw-r--r--src/mame/drivers/cninja.c48
-rw-r--r--src/mame/drivers/cntsteer.c102
-rw-r--r--src/mame/drivers/coinmstr.c30
-rw-r--r--src/mame/drivers/coinmvga.c18
-rw-r--r--src/mame/drivers/cojag.c116
-rw-r--r--src/mame/drivers/combatsc.c60
-rw-r--r--src/mame/drivers/commando.c14
-rw-r--r--src/mame/drivers/compgolf.c22
-rw-r--r--src/mame/drivers/contra.c20
-rw-r--r--src/mame/drivers/coolpool.c116
-rw-r--r--src/mame/drivers/coolridr.c76
-rw-r--r--src/mame/drivers/cop01.c16
-rw-r--r--src/mame/drivers/copsnrob.c10
-rw-r--r--src/mame/drivers/corona.c30
-rw-r--r--src/mame/drivers/cosmic.c62
-rw-r--r--src/mame/drivers/cps1.c102
-rw-r--r--src/mame/drivers/cps2.c94
-rw-r--r--src/mame/drivers/cps3.c202
-rw-r--r--src/mame/drivers/crbaloon.c32
-rw-r--r--src/mame/drivers/crgolf.c42
-rw-r--r--src/mame/drivers/crimfght.c34
-rw-r--r--src/mame/drivers/crospang.c14
-rw-r--r--src/mame/drivers/crshrace.c26
-rw-r--r--src/mame/drivers/crystal.c112
-rw-r--r--src/mame/drivers/cshooter.c54
-rw-r--r--src/mame/drivers/csplayh5.c92
-rw-r--r--src/mame/drivers/cubeqst.c70
-rw-r--r--src/mame/drivers/cultures.c40
-rw-r--r--src/mame/drivers/cvs.c108
-rw-r--r--src/mame/drivers/cyberbal.c36
-rw-r--r--src/mame/drivers/cybertnk.c100
-rw-r--r--src/mame/drivers/cyclemb.c18
-rw-r--r--src/mame/drivers/d9final.c18
-rw-r--r--src/mame/drivers/dacholer.c56
-rw-r--r--src/mame/drivers/dai3wksi.c34
-rw-r--r--src/mame/drivers/dambustr.c8
-rw-r--r--src/mame/drivers/darius.c196
-rw-r--r--src/mame/drivers/darkhors.c56
-rw-r--r--src/mame/drivers/darkmist.c44
-rw-r--r--src/mame/drivers/darkseal.c12
-rw-r--r--src/mame/drivers/dassault.c44
-rw-r--r--src/mame/drivers/dblewing.c42
-rw-r--r--src/mame/drivers/dbz.c34
-rw-r--r--src/mame/drivers/dcheese.c36
-rw-r--r--src/mame/drivers/dcon.c2
-rw-r--r--src/mame/drivers/dday.c6
-rw-r--r--src/mame/drivers/ddayjlc.c56
-rw-r--r--src/mame/drivers/ddealer.c50
-rw-r--r--src/mame/drivers/ddenlovr.c732
-rw-r--r--src/mame/drivers/ddragon.c110
-rw-r--r--src/mame/drivers/ddragon3.c18
-rw-r--r--src/mame/drivers/ddribble.c36
-rw-r--r--src/mame/drivers/deadang.c8
-rw-r--r--src/mame/drivers/dec0.c60
-rw-r--r--src/mame/drivers/dec8.c150
-rw-r--r--src/mame/drivers/deco156.c46
-rw-r--r--src/mame/drivers/deco32.c164
-rw-r--r--src/mame/drivers/deco_ld.c22
-rw-r--r--src/mame/drivers/deco_mlc.c64
-rw-r--r--src/mame/drivers/decocass.c60
-rw-r--r--src/mame/drivers/deniam.c12
-rw-r--r--src/mame/drivers/deshoros.c28
-rw-r--r--src/mame/drivers/destroyr.c48
-rw-r--r--src/mame/drivers/dgpix.c46
-rw-r--r--src/mame/drivers/dietgo.c10
-rw-r--r--src/mame/drivers/discoboy.c60
-rw-r--r--src/mame/drivers/diverboy.c18
-rw-r--r--src/mame/drivers/djboy.c80
-rw-r--r--src/mame/drivers/djmain.c100
-rw-r--r--src/mame/drivers/dkong.c116
-rw-r--r--src/mame/drivers/dlair.c42
-rw-r--r--src/mame/drivers/dmndrby.c48
-rw-r--r--src/mame/drivers/docastle.c18
-rw-r--r--src/mame/drivers/dogfgt.c22
-rw-r--r--src/mame/drivers/dominob.c18
-rw-r--r--src/mame/drivers/dooyong.c18
-rw-r--r--src/mame/drivers/dorachan.c18
-rw-r--r--src/mame/drivers/dotrikun.c10
-rw-r--r--src/mame/drivers/dragrace.c34
-rw-r--r--src/mame/drivers/dreamwld.c46
-rw-r--r--src/mame/drivers/drgnmst.c34
-rw-r--r--src/mame/drivers/dribling.c38
-rw-r--r--src/mame/drivers/drmicro.c18
-rw-r--r--src/mame/drivers/drtomy.c26
-rw-r--r--src/mame/drivers/drw80pkr.c52
-rw-r--r--src/mame/drivers/dunhuang.c104
-rw-r--r--src/mame/drivers/dwarfd.c54
-rw-r--r--src/mame/drivers/dynadice.c24
-rw-r--r--src/mame/drivers/dynax.c422
-rw-r--r--src/mame/drivers/egghunt.c36
-rw-r--r--src/mame/drivers/embargo.c26
-rw-r--r--src/mame/drivers/enigma2.c66
-rw-r--r--src/mame/drivers/eolith.c36
-rw-r--r--src/mame/drivers/eolith16.c16
-rw-r--r--src/mame/drivers/eolithsp.c8
-rw-r--r--src/mame/drivers/epos.c14
-rw-r--r--src/mame/drivers/eprom.c36
-rw-r--r--src/mame/drivers/equites.c76
-rw-r--r--src/mame/drivers/ertictac.c14
-rw-r--r--src/mame/drivers/esd16.c24
-rw-r--r--src/mame/drivers/esh.c22
-rw-r--r--src/mame/drivers/espial.c18
-rw-r--r--src/mame/drivers/esripsys.c120
-rw-r--r--src/mame/drivers/ettrivia.c56
-rw-r--r--src/mame/drivers/exedexes.c4
-rw-r--r--src/mame/drivers/exerion.c32
-rw-r--r--src/mame/drivers/exidy.c26
-rw-r--r--src/mame/drivers/exidy440.c62
-rw-r--r--src/mame/drivers/expro02.c14
-rw-r--r--src/mame/drivers/exprraid.c34
-rw-r--r--src/mame/drivers/exterm.c44
-rw-r--r--src/mame/drivers/exzisus.c38
-rw-r--r--src/mame/drivers/f-32.c6
-rw-r--r--src/mame/drivers/f1gp.c34
-rw-r--r--src/mame/drivers/fantland.c78
-rw-r--r--src/mame/drivers/fastfred.c50
-rw-r--r--src/mame/drivers/fastlane.c20
-rw-r--r--src/mame/drivers/fcombat.c46
-rw-r--r--src/mame/drivers/fcrash.c108
-rw-r--r--src/mame/drivers/feversoc.c44
-rw-r--r--src/mame/drivers/fgoal.c46
-rw-r--r--src/mame/drivers/finalizr.c22
-rw-r--r--src/mame/drivers/firebeat.c204
-rw-r--r--src/mame/drivers/firefox.c110
-rw-r--r--src/mame/drivers/firetrap.c44
-rw-r--r--src/mame/drivers/firetrk.c104
-rw-r--r--src/mame/drivers/fitfight.c32
-rw-r--r--src/mame/drivers/flkatck.c32
-rw-r--r--src/mame/drivers/flower.c12
-rw-r--r--src/mame/drivers/flstory.c42
-rw-r--r--src/mame/drivers/flyball.c48
-rw-r--r--src/mame/drivers/foodf.c32
-rw-r--r--src/mame/drivers/forte2.c18
-rw-r--r--src/mame/drivers/fortecar.c8
-rw-r--r--src/mame/drivers/freekick.c48
-rw-r--r--src/mame/drivers/fromanc2.c76
-rw-r--r--src/mame/drivers/fromance.c44
-rw-r--r--src/mame/drivers/funkybee.c8
-rw-r--r--src/mame/drivers/funkyjet.c10
-rw-r--r--src/mame/drivers/funworld.c40
-rw-r--r--src/mame/drivers/funybubl.c12
-rw-r--r--src/mame/drivers/fuukifg2.c50
-rw-r--r--src/mame/drivers/fuukifg3.c60
-rw-r--r--src/mame/drivers/gaelco.c20
-rw-r--r--src/mame/drivers/gaelco2.c8
-rw-r--r--src/mame/drivers/gaelco3d.c90
-rw-r--r--src/mame/drivers/gaiden.c52
-rw-r--r--src/mame/drivers/gal3.c52
-rw-r--r--src/mame/drivers/galaga.c76
-rw-r--r--src/mame/drivers/galastrm.c34
-rw-r--r--src/mame/drivers/galaxi.c68
-rw-r--r--src/mame/drivers/galaxia.c16
-rw-r--r--src/mame/drivers/galaxian.c302
-rw-r--r--src/mame/drivers/galaxold.c22
-rw-r--r--src/mame/drivers/galdrvr.c2
-rw-r--r--src/mame/drivers/galivan.c40
-rw-r--r--src/mame/drivers/galpani2.c62
-rw-r--r--src/mame/drivers/galpani3.c120
-rw-r--r--src/mame/drivers/galpanic.c24
-rw-r--r--src/mame/drivers/galspnbl.c8
-rw-r--r--src/mame/drivers/gamecstl.c76
-rw-r--r--src/mame/drivers/gameplan.c32
-rw-r--r--src/mame/drivers/gaplus.c54
-rw-r--r--src/mame/drivers/gauntlet.c64
-rw-r--r--src/mame/drivers/gberet.c26
-rw-r--r--src/mame/drivers/gbusters.c48
-rw-r--r--src/mame/drivers/gcpinbal.c30
-rw-r--r--src/mame/drivers/gei.c106
-rw-r--r--src/mame/drivers/ghosteo.c34
-rw-r--r--src/mame/drivers/gijoe.c38
-rw-r--r--src/mame/drivers/ginganin.c20
-rw-r--r--src/mame/drivers/gladiatr.c66
-rw-r--r--src/mame/drivers/glass.c20
-rw-r--r--src/mame/drivers/gng.c14
-rw-r--r--src/mame/drivers/go2000.c24
-rw-r--r--src/mame/drivers/goal92.c28
-rw-r--r--src/mame/drivers/goindol.c26
-rw-r--r--src/mame/drivers/goldngam.c4
-rw-r--r--src/mame/drivers/goldnpkr.c66
-rw-r--r--src/mame/drivers/goldstar.c130
-rw-r--r--src/mame/drivers/gomoku.c2
-rw-r--r--src/mame/drivers/good.c12
-rw-r--r--src/mame/drivers/goodejan.c14
-rw-r--r--src/mame/drivers/gotcha.c8
-rw-r--r--src/mame/drivers/gottlieb.c78
-rw-r--r--src/mame/drivers/gotya.c6
-rw-r--r--src/mame/drivers/gpworld.c44
-rw-r--r--src/mame/drivers/gradius3.c44
-rw-r--r--src/mame/drivers/grchamp.c50
-rw-r--r--src/mame/drivers/gridlee.c50
-rw-r--r--src/mame/drivers/groundfx.c40
-rw-r--r--src/mame/drivers/gstream.c54
-rw-r--r--src/mame/drivers/gstriker.c50
-rw-r--r--src/mame/drivers/gsword.c38
-rw-r--r--src/mame/drivers/gticlub.c72
-rw-r--r--src/mame/drivers/guab.c44
-rw-r--r--src/mame/drivers/gunbustr.c38
-rw-r--r--src/mame/drivers/gundealr.c24
-rw-r--r--src/mame/drivers/gunpey.c22
-rw-r--r--src/mame/drivers/gunsmoke.c6
-rw-r--r--src/mame/drivers/gyruss.c14
-rw-r--r--src/mame/drivers/halleys.c98
-rw-r--r--src/mame/drivers/hanaawas.c16
-rw-r--r--src/mame/drivers/harddriv.c58
-rw-r--r--src/mame/drivers/hcastle.c22
-rw-r--r--src/mame/drivers/hexion.c6
-rw-r--r--src/mame/drivers/highvdeo.c58
-rw-r--r--src/mame/drivers/himesiki.c12
-rw-r--r--src/mame/drivers/hitme.c40
-rw-r--r--src/mame/drivers/hitpoker.c40
-rw-r--r--src/mame/drivers/hnayayoi.c18
-rw-r--r--src/mame/drivers/hng64.c140
-rw-r--r--src/mame/drivers/homedata.c116
-rw-r--r--src/mame/drivers/homerun.c14
-rw-r--r--src/mame/drivers/hornet.c146
-rw-r--r--src/mame/drivers/hotblock.c16
-rw-r--r--src/mame/drivers/hotstuff.c2
-rw-r--r--src/mame/drivers/hshavoc.c4
-rw-r--r--src/mame/drivers/hvyunit.c86
-rw-r--r--src/mame/drivers/hyperspt.c2
-rw-r--r--src/mame/drivers/hyprduel.c78
-rw-r--r--src/mame/drivers/igs009.c104
-rw-r--r--src/mame/drivers/igs011.c350
-rw-r--r--src/mame/drivers/igs017.c234
-rw-r--r--src/mame/drivers/igs_m027.c32
-rw-r--r--src/mame/drivers/igspoker.c80
-rw-r--r--src/mame/drivers/ikki.c8
-rw-r--r--src/mame/drivers/imolagp.c40
-rw-r--r--src/mame/drivers/intrscti.c10
-rw-r--r--src/mame/drivers/inufuku.c18
-rw-r--r--src/mame/drivers/iqblock.c32
-rw-r--r--src/mame/drivers/irobot.c6
-rw-r--r--src/mame/drivers/ironhors.c14
-rw-r--r--src/mame/drivers/istellar.c30
-rw-r--r--src/mame/drivers/itech32.c212
-rw-r--r--src/mame/drivers/itech8.c106
-rw-r--r--src/mame/drivers/itgambl2.c26
-rw-r--r--src/mame/drivers/itgambl3.c26
-rw-r--r--src/mame/drivers/jack.c48
-rw-r--r--src/mame/drivers/jackal.c46
-rw-r--r--src/mame/drivers/jackie.c66
-rw-r--r--src/mame/drivers/jackpool.c58
-rw-r--r--src/mame/drivers/jailbrek.c16
-rw-r--r--src/mame/drivers/jalmah.c168
-rw-r--r--src/mame/drivers/jangou.c102
-rw-r--r--src/mame/drivers/jantotsu.c46
-rw-r--r--src/mame/drivers/jchan.c72
-rw-r--r--src/mame/drivers/jedi.c36
-rw-r--r--src/mame/drivers/jokrwild.c14
-rw-r--r--src/mame/drivers/jollyjgr.c32
-rw-r--r--src/mame/drivers/jongkyo.c60
-rw-r--r--src/mame/drivers/jpmimpct.c58
-rw-r--r--src/mame/drivers/jpmsys5.c60
-rw-r--r--src/mame/drivers/jrpacman.c6
-rw-r--r--src/mame/drivers/jubilee.c10
-rw-r--r--src/mame/drivers/junofrst.c36
-rw-r--r--src/mame/drivers/kaneko16.c88
-rw-r--r--src/mame/drivers/kangaroo.c14
-rw-r--r--src/mame/drivers/karnov.c68
-rw-r--r--src/mame/drivers/kchamp.c40
-rw-r--r--src/mame/drivers/kickgoal.c26
-rw-r--r--src/mame/drivers/kingdrby.c50
-rw-r--r--src/mame/drivers/kingobox.c26
-rw-r--r--src/mame/drivers/kingpin.c8
-rw-r--r--src/mame/drivers/kinst.c36
-rw-r--r--src/mame/drivers/klax.c12
-rw-r--r--src/mame/drivers/kncljoe.c16
-rw-r--r--src/mame/drivers/koftball.c30
-rw-r--r--src/mame/drivers/koikoi.c28
-rw-r--r--src/mame/drivers/konamigq.c42
-rw-r--r--src/mame/drivers/konamigv.c82
-rw-r--r--src/mame/drivers/konamigx.c94
-rw-r--r--src/mame/drivers/konamim2.c54
-rw-r--r--src/mame/drivers/kongambl.c14
-rw-r--r--src/mame/drivers/kopunch.c20
-rw-r--r--src/mame/drivers/ksayakyu.c14
-rw-r--r--src/mame/drivers/ksys573.c326
-rw-r--r--src/mame/drivers/kungfur.c36
-rw-r--r--src/mame/drivers/kyugo.c22
-rw-r--r--src/mame/drivers/labyrunr.c14
-rw-r--r--src/mame/drivers/ladybug.c38
-rw-r--r--src/mame/drivers/ladyfrog.c22
-rw-r--r--src/mame/drivers/laserbas.c20
-rw-r--r--src/mame/drivers/laserbat.c62
-rw-r--r--src/mame/drivers/lasso.c24
-rw-r--r--src/mame/drivers/lastduel.c12
-rw-r--r--src/mame/drivers/lastfght.c64
-rw-r--r--src/mame/drivers/lazercmd.c34
-rw-r--r--src/mame/drivers/legionna.c10
-rw-r--r--src/mame/drivers/leland.c110
-rw-r--r--src/mame/drivers/lemmings.c30
-rw-r--r--src/mame/drivers/lethal.c48
-rw-r--r--src/mame/drivers/lethalj.c20
-rw-r--r--src/mame/drivers/lgp.c18
-rw-r--r--src/mame/drivers/liberate.c70
-rw-r--r--src/mame/drivers/liberatr.c12
-rw-r--r--src/mame/drivers/limenko.c106
-rw-r--r--src/mame/drivers/littlerb.c46
-rw-r--r--src/mame/drivers/lkage.c40
-rw-r--r--src/mame/drivers/lockon.c68
-rw-r--r--src/mame/drivers/looping.c62
-rw-r--r--src/mame/drivers/lordgun.c54
-rw-r--r--src/mame/drivers/lsasquad.c18
-rw-r--r--src/mame/drivers/ltcasino.c12
-rw-r--r--src/mame/drivers/luckgrln.c62
-rw-r--r--src/mame/drivers/lucky74.c20
-rw-r--r--src/mame/drivers/lvcards.c12
-rw-r--r--src/mame/drivers/lwings.c32
-rw-r--r--src/mame/drivers/m10.c70
-rw-r--r--src/mame/drivers/m107.c68
-rw-r--r--src/mame/drivers/m14.c28
-rw-r--r--src/mame/drivers/m52.c2
-rw-r--r--src/mame/drivers/m58.c2
-rw-r--r--src/mame/drivers/m62.c42
-rw-r--r--src/mame/drivers/m63.c86
-rw-r--r--src/mame/drivers/m72.c156
-rw-r--r--src/mame/drivers/m79amb.c20
-rw-r--r--src/mame/drivers/m90.c20
-rw-r--r--src/mame/drivers/m92.c98
-rw-r--r--src/mame/drivers/macrossp.c36
-rw-r--r--src/mame/drivers/macs.c64
-rw-r--r--src/mame/drivers/madalien.c18
-rw-r--r--src/mame/drivers/madmotor.c14
-rw-r--r--src/mame/drivers/magic10.c34
-rw-r--r--src/mame/drivers/magicard.c72
-rw-r--r--src/mame/drivers/magicfly.c36
-rw-r--r--src/mame/drivers/magmax.c32
-rw-r--r--src/mame/drivers/magtouch.c18
-rw-r--r--src/mame/drivers/mainevt.c50
-rw-r--r--src/mame/drivers/mainsnk.c8
-rw-r--r--src/mame/drivers/malzak.c28
-rw-r--r--src/mame/drivers/mappy.c138
-rw-r--r--src/mame/drivers/marineb.c12
-rw-r--r--src/mame/drivers/marinedt.c60
-rw-r--r--src/mame/drivers/mastboy.c60
-rw-r--r--src/mame/drivers/matmania.c18
-rw-r--r--src/mame/drivers/maxaflex.c52
-rw-r--r--src/mame/drivers/maygay1b.c34
-rw-r--r--src/mame/drivers/maygayv1.c54
-rw-r--r--src/mame/drivers/mayumi.c28
-rw-r--r--src/mame/drivers/mazerbla.c140
-rw-r--r--src/mame/drivers/mcatadv.c22
-rw-r--r--src/mame/drivers/mcr.c38
-rw-r--r--src/mame/drivers/mcr3.c122
-rw-r--r--src/mame/drivers/mcr68.c110
-rw-r--r--src/mame/drivers/meadows.c44
-rw-r--r--src/mame/drivers/mediagx.c142
-rw-r--r--src/mame/drivers/megadriv.c50
-rw-r--r--src/mame/drivers/megadrvb.c46
-rw-r--r--src/mame/drivers/megaplay.c52
-rw-r--r--src/mame/drivers/megasys1.c104
-rw-r--r--src/mame/drivers/megatech.c72
-rw-r--r--src/mame/drivers/megazone.c20
-rw-r--r--src/mame/drivers/meijinsn.c22
-rw-r--r--src/mame/drivers/merit.c94
-rw-r--r--src/mame/drivers/meritm.c106
-rw-r--r--src/mame/drivers/mermaid.c26
-rw-r--r--src/mame/drivers/metalmx.c38
-rw-r--r--src/mame/drivers/metlclsh.c24
-rw-r--r--src/mame/drivers/metro.c206
-rw-r--r--src/mame/drivers/mexico86.c16
-rw-r--r--src/mame/drivers/mgolf.c52
-rw-r--r--src/mame/drivers/mhavoc.c10
-rw-r--r--src/mame/drivers/midas.c40
-rw-r--r--src/mame/drivers/midvunit.c106
-rw-r--r--src/mame/drivers/midzeus.c64
-rw-r--r--src/mame/drivers/mikie.c14
-rw-r--r--src/mame/drivers/mil4000.c24
-rw-r--r--src/mame/drivers/miniboy7.c12
-rw-r--r--src/mame/drivers/minivadr.c2
-rw-r--r--src/mame/drivers/mirage.c36
-rw-r--r--src/mame/drivers/mirax.c32
-rw-r--r--src/mame/drivers/missb2.c40
-rw-r--r--src/mame/drivers/missile.c88
-rw-r--r--src/mame/drivers/mitchell.c118
-rw-r--r--src/mame/drivers/mjkjidai.c16
-rw-r--r--src/mame/drivers/mjsister.c70
-rw-r--r--src/mame/drivers/mlanding.c92
-rw-r--r--src/mame/drivers/model1.c56
-rw-r--r--src/mame/drivers/model2.c268
-rw-r--r--src/mame/drivers/model3.c374
-rw-r--r--src/mame/drivers/mogura.c24
-rw-r--r--src/mame/drivers/mole.c16
-rw-r--r--src/mame/drivers/momoko.c8
-rw-r--r--src/mame/drivers/monzagp.c22
-rw-r--r--src/mame/drivers/moo.c54
-rw-r--r--src/mame/drivers/mosaic.c12
-rw-r--r--src/mame/drivers/mouser.c26
-rw-r--r--src/mame/drivers/mpoker.c30
-rw-r--r--src/mame/drivers/mpu4.c222
-rw-r--r--src/mame/drivers/mpu4drvr.c176
-rw-r--r--src/mame/drivers/mquake.c20
-rw-r--r--src/mame/drivers/mrdo.c2
-rw-r--r--src/mame/drivers/mrflea.c26
-rw-r--r--src/mame/drivers/ms32.c112
-rw-r--r--src/mame/drivers/msisaac.c30
-rw-r--r--src/mame/drivers/mugsmash.c18
-rw-r--r--src/mame/drivers/multfish.c120
-rw-r--r--src/mame/drivers/multigam.c202
-rw-r--r--src/mame/drivers/munchmo.c20
-rw-r--r--src/mame/drivers/murogem.c4
-rw-r--r--src/mame/drivers/murogmbl.c4
-rw-r--r--src/mame/drivers/mustache.c14
-rw-r--r--src/mame/drivers/mw18w.c4
-rw-r--r--src/mame/drivers/mw8080bw.c146
-rw-r--r--src/mame/drivers/mwarr.c48
-rw-r--r--src/mame/drivers/mystston.c12
-rw-r--r--src/mame/drivers/mystwarr.c60
-rw-r--r--src/mame/drivers/n8080.c24
-rw-r--r--src/mame/drivers/namcofl.c72
-rw-r--r--src/mame/drivers/namcoic.c82
-rw-r--r--src/mame/drivers/namcona1.c92
-rw-r--r--src/mame/drivers/namconb1.c102
-rw-r--r--src/mame/drivers/namcond1.c8
-rw-r--r--src/mame/drivers/namcos1.c34
-rw-r--r--src/mame/drivers/namcos10.c40
-rw-r--r--src/mame/drivers/namcos11.c166
-rw-r--r--src/mame/drivers/namcos12.c146
-rw-r--r--src/mame/drivers/namcos2.c6
-rw-r--r--src/mame/drivers/namcos21.c52
-rw-r--r--src/mame/drivers/namcos22.c154
-rw-r--r--src/mame/drivers/namcos23.c132
-rw-r--r--src/mame/drivers/namcos86.c78
-rw-r--r--src/mame/drivers/naomi.c26
-rw-r--r--src/mame/drivers/naughtyb.c30
-rw-r--r--src/mame/drivers/nbmj8688.c20
-rw-r--r--src/mame/drivers/nbmj8891.c26
-rw-r--r--src/mame/drivers/nbmj8900.c8
-rw-r--r--src/mame/drivers/nbmj8991.c14
-rw-r--r--src/mame/drivers/nbmj9195.c208
-rw-r--r--src/mame/drivers/nemesis.c70
-rw-r--r--src/mame/drivers/neodrvr.c98
-rw-r--r--src/mame/drivers/neogeo.c234
-rw-r--r--src/mame/drivers/neoprint.c66
-rw-r--r--src/mame/drivers/neptunp2.c2
-rw-r--r--src/mame/drivers/news.c4
-rw-r--r--src/mame/drivers/nightgal.c114
-rw-r--r--src/mame/drivers/ninjakd2.c64
-rw-r--r--src/mame/drivers/ninjaw.c64
-rw-r--r--src/mame/drivers/niyanpai.c100
-rw-r--r--src/mame/drivers/nmg5.c78
-rw-r--r--src/mame/drivers/nmk16.c114
-rw-r--r--src/mame/drivers/norautp.c48
-rw-r--r--src/mame/drivers/nova2001.c14
-rw-r--r--src/mame/drivers/nsmpoker.c12
-rw-r--r--src/mame/drivers/nss.c20
-rw-r--r--src/mame/drivers/nwk-tr.c76
-rw-r--r--src/mame/drivers/nycaptor.c66
-rw-r--r--src/mame/drivers/nyny.c66
-rw-r--r--src/mame/drivers/offtwall.c42
-rw-r--r--src/mame/drivers/ohmygod.c18
-rw-r--r--src/mame/drivers/ojankohs.c84
-rw-r--r--src/mame/drivers/olibochu.c34
-rw-r--r--src/mame/drivers/omegrace.c22
-rw-r--r--src/mame/drivers/oneshot.c22
-rw-r--r--src/mame/drivers/onetwo.c40
-rw-r--r--src/mame/drivers/opwolf.c62
-rw-r--r--src/mame/drivers/orbit.c24
-rw-r--r--src/mame/drivers/othello.c52
-rw-r--r--src/mame/drivers/othldrby.c18
-rw-r--r--src/mame/drivers/othunder.c76
-rw-r--r--src/mame/drivers/overdriv.c46
-rw-r--r--src/mame/drivers/pachifev.c20
-rw-r--r--src/mame/drivers/pacland.c30
-rw-r--r--src/mame/drivers/pacman.c140
-rw-r--r--src/mame/drivers/pandoras.c36
-rw-r--r--src/mame/drivers/pangofun.c16
-rw-r--r--src/mame/drivers/panicr.c54
-rw-r--r--src/mame/drivers/paradise.c26
-rw-r--r--src/mame/drivers/parodius.c60
-rw-r--r--src/mame/drivers/pasha2.c32
-rw-r--r--src/mame/drivers/pastelg.c30
-rw-r--r--src/mame/drivers/pbaction.c16
-rw-r--r--src/mame/drivers/pcat_dyn.c16
-rw-r--r--src/mame/drivers/pcat_nit.c26
-rw-r--r--src/mame/drivers/pcktgal.c32
-rw-r--r--src/mame/drivers/pcxt.c138
-rw-r--r--src/mame/drivers/pengadvb.c78
-rw-r--r--src/mame/drivers/pengo.c6
-rw-r--r--src/mame/drivers/peplus.c102
-rw-r--r--src/mame/drivers/pgm.c312
-rw-r--r--src/mame/drivers/phoenix.c4
-rw-r--r--src/mame/drivers/photon.c14
-rw-r--r--src/mame/drivers/photon2.c20
-rw-r--r--src/mame/drivers/photoply.c56
-rw-r--r--src/mame/drivers/pingpong.c58
-rw-r--r--src/mame/drivers/pinkiri8.c56
-rw-r--r--src/mame/drivers/pipedrm.c38
-rw-r--r--src/mame/drivers/pipeline.c34
-rw-r--r--src/mame/drivers/pirates.c36
-rw-r--r--src/mame/drivers/pitnrun.c8
-rw-r--r--src/mame/drivers/pkscram.c44
-rw-r--r--src/mame/drivers/pktgaldx.c6
-rw-r--r--src/mame/drivers/playch10.c12
-rw-r--r--src/mame/drivers/playmark.c56
-rw-r--r--src/mame/drivers/plygonet.c72
-rw-r--r--src/mame/drivers/pntnpuzl.c54
-rw-r--r--src/mame/drivers/pokechmp.c30
-rw-r--r--src/mame/drivers/poker72.c22
-rw-r--r--src/mame/drivers/polepos.c64
-rw-r--r--src/mame/drivers/policetr.c42
-rw-r--r--src/mame/drivers/polyplay.c36
-rw-r--r--src/mame/drivers/poo.c12
-rw-r--r--src/mame/drivers/poolshrk.c20
-rw-r--r--src/mame/drivers/pooyan.c10
-rw-r--r--src/mame/drivers/popeye.c22
-rw-r--r--src/mame/drivers/popper.c24
-rw-r--r--src/mame/drivers/portrait.c14
-rw-r--r--src/mame/drivers/powerbal.c32
-rw-r--r--src/mame/drivers/powerins.c8
-rw-r--r--src/mame/drivers/ppmast93.c24
-rw-r--r--src/mame/drivers/prehisle.c4
-rw-r--r--src/mame/drivers/progolf.c46
-rw-r--r--src/mame/drivers/psikyo.c144
-rw-r--r--src/mame/drivers/psikyo4.c98
-rw-r--r--src/mame/drivers/psikyosh.c58
-rw-r--r--src/mame/drivers/psychic5.c26
-rw-r--r--src/mame/drivers/pturn.c46
-rw-r--r--src/mame/drivers/puckpkmn.c4
-rw-r--r--src/mame/drivers/punchout.c12
-rw-r--r--src/mame/drivers/pushman.c32
-rw-r--r--src/mame/drivers/pzletime.c32
-rw-r--r--src/mame/drivers/qdrmfgp.c68
-rw-r--r--src/mame/drivers/qix.c16
-rw-r--r--src/mame/drivers/quakeat.c12
-rw-r--r--src/mame/drivers/quantum.c14
-rw-r--r--src/mame/drivers/quasar.c24
-rw-r--r--src/mame/drivers/quizdna.c8
-rw-r--r--src/mame/drivers/quizo.c8
-rw-r--r--src/mame/drivers/quizpun2.c42
-rw-r--r--src/mame/drivers/r2dtank.c44
-rw-r--r--src/mame/drivers/r2dx_v33.c34
-rw-r--r--src/mame/drivers/rabbit.c96
-rw-r--r--src/mame/drivers/raiden.c12
-rw-r--r--src/mame/drivers/raiden2.c68
-rw-r--r--src/mame/drivers/rainbow.c28
-rw-r--r--src/mame/drivers/rallyx.c38
-rw-r--r--src/mame/drivers/rampart.c26
-rw-r--r--src/mame/drivers/rastan.c26
-rw-r--r--src/mame/drivers/rbmk.c22
-rw-r--r--src/mame/drivers/re900.c32
-rw-r--r--src/mame/drivers/realbrk.c66
-rw-r--r--src/mame/drivers/redalert.c12
-rw-r--r--src/mame/drivers/redclash.c18
-rw-r--r--src/mame/drivers/relief.c34
-rw-r--r--src/mame/drivers/renegade.c64
-rw-r--r--src/mame/drivers/retofinv.c26
-rw-r--r--src/mame/drivers/rgum.c6
-rw-r--r--src/mame/drivers/rmhaihai.c40
-rw-r--r--src/mame/drivers/rockrage.c22
-rw-r--r--src/mame/drivers/rocnrope.c2
-rw-r--r--src/mame/drivers/rohga.c12
-rw-r--r--src/mame/drivers/rollerg.c36
-rw-r--r--src/mame/drivers/rotaryf.c4
-rw-r--r--src/mame/drivers/roul.c12
-rw-r--r--src/mame/drivers/route16.c26
-rw-r--r--src/mame/drivers/royalmah.c320
-rw-r--r--src/mame/drivers/rpunch.c26
-rw-r--r--src/mame/drivers/runaway.c22
-rw-r--r--src/mame/drivers/rungun.c58
-rw-r--r--src/mame/drivers/safarir.c24
-rw-r--r--src/mame/drivers/sandscrp.c44
-rw-r--r--src/mame/drivers/sangho.c104
-rw-r--r--src/mame/drivers/sauro.c12
-rw-r--r--src/mame/drivers/sbasketb.c4
-rw-r--r--src/mame/drivers/sbowling.c36
-rw-r--r--src/mame/drivers/sbrkout.c78
-rw-r--r--src/mame/drivers/scobra.c6
-rw-r--r--src/mame/drivers/scotrsht.c8
-rw-r--r--src/mame/drivers/scramble.c2
-rw-r--r--src/mame/drivers/scregg.c8
-rw-r--r--src/mame/drivers/sderby.c14
-rw-r--r--src/mame/drivers/seattle.c264
-rw-r--r--src/mame/drivers/segac2.c114
-rw-r--r--src/mame/drivers/segae.c36
-rw-r--r--src/mame/drivers/segag80r.c96
-rw-r--r--src/mame/drivers/segag80v.c74
-rw-r--r--src/mame/drivers/segahang.c94
-rw-r--r--src/mame/drivers/segald.c42
-rw-r--r--src/mame/drivers/segaorun.c120
-rw-r--r--src/mame/drivers/segas16a.c218
-rw-r--r--src/mame/drivers/segas16b.c258
-rw-r--r--src/mame/drivers/segas18.c132
-rw-r--r--src/mame/drivers/segas24.c186
-rw-r--r--src/mame/drivers/segas32.c214
-rw-r--r--src/mame/drivers/segaxbd.c110
-rw-r--r--src/mame/drivers/segaybd.c62
-rw-r--r--src/mame/drivers/seibuspi.c192
-rw-r--r--src/mame/drivers/seicross.c14
-rw-r--r--src/mame/drivers/sengokmj.c28
-rw-r--r--src/mame/drivers/senjyo.c20
-rw-r--r--src/mame/drivers/seta.c246
-rw-r--r--src/mame/drivers/seta2.c152
-rw-r--r--src/mame/drivers/sf.c28
-rw-r--r--src/mame/drivers/sfbonus.c76
-rw-r--r--src/mame/drivers/sfkick.c86
-rw-r--r--src/mame/drivers/sg1000a.c6
-rw-r--r--src/mame/drivers/shadfrce.c38
-rw-r--r--src/mame/drivers/shangha3.c40
-rw-r--r--src/mame/drivers/shanghai.c8
-rw-r--r--src/mame/drivers/shangkid.c32
-rw-r--r--src/mame/drivers/shaolins.c2
-rw-r--r--src/mame/drivers/shisen.c12
-rw-r--r--src/mame/drivers/shootout.c24
-rw-r--r--src/mame/drivers/shougi.c24
-rw-r--r--src/mame/drivers/shuuz.c22
-rw-r--r--src/mame/drivers/sidearms.c20
-rw-r--r--src/mame/drivers/sidepckt.c22
-rw-r--r--src/mame/drivers/sigmab52.c24
-rw-r--r--src/mame/drivers/sigmab98.c290
-rw-r--r--src/mame/drivers/silkroad.c12
-rw-r--r--src/mame/drivers/simpl156.c56
-rw-r--r--src/mame/drivers/simpsons.c24
-rw-r--r--src/mame/drivers/skeetsht.c26
-rw-r--r--src/mame/drivers/skimaxx.c32
-rw-r--r--src/mame/drivers/skullxbo.c26
-rw-r--r--src/mame/drivers/skyarmy.c20
-rw-r--r--src/mame/drivers/skydiver.c6
-rw-r--r--src/mame/drivers/skyfox.c14
-rw-r--r--src/mame/drivers/skykid.c46
-rw-r--r--src/mame/drivers/skylncr.c76
-rw-r--r--src/mame/drivers/skyraid.c14
-rw-r--r--src/mame/drivers/slapfght.c30
-rw-r--r--src/mame/drivers/slapshot.c56
-rw-r--r--src/mame/drivers/sliver.c52
-rw-r--r--src/mame/drivers/slotcarn.c24
-rw-r--r--src/mame/drivers/sms.c34
-rw-r--r--src/mame/drivers/snesb.c68
-rw-r--r--src/mame/drivers/snk.c170
-rw-r--r--src/mame/drivers/snk6502.c20
-rw-r--r--src/mame/drivers/snk68.c28
-rw-r--r--src/mame/drivers/snookr10.c12
-rw-r--r--src/mame/drivers/snowbros.c82
-rw-r--r--src/mame/drivers/solomon.c2
-rw-r--r--src/mame/drivers/sonson.c12
-rw-r--r--src/mame/drivers/sothello.c44
-rw-r--r--src/mame/drivers/spacefb.c20
-rw-r--r--src/mame/drivers/spaceg.c10
-rw-r--r--src/mame/drivers/spbactn.c4
-rw-r--r--src/mame/drivers/spcforce.c22
-rw-r--r--src/mame/drivers/spdodgeb.c34
-rw-r--r--src/mame/drivers/speedatk.c20
-rw-r--r--src/mame/drivers/speedbal.c6
-rw-r--r--src/mame/drivers/speedspn.c6
-rw-r--r--src/mame/drivers/speglsht.c20
-rw-r--r--src/mame/drivers/spiders.c40
-rw-r--r--src/mame/drivers/splash.c80
-rw-r--r--src/mame/drivers/spoker.c70
-rw-r--r--src/mame/drivers/spool99.c72
-rw-r--r--src/mame/drivers/sprcros2.c20
-rw-r--r--src/mame/drivers/sprint2.c58
-rw-r--r--src/mame/drivers/sprint4.c34
-rw-r--r--src/mame/drivers/sprint8.c22
-rw-r--r--src/mame/drivers/spy.c54
-rw-r--r--src/mame/drivers/srmp2.c64
-rw-r--r--src/mame/drivers/srmp5.c56
-rw-r--r--src/mame/drivers/srmp6.c72
-rw-r--r--src/mame/drivers/srumbler.c10
-rw-r--r--src/mame/drivers/ssfindo.c76
-rw-r--r--src/mame/drivers/sshangha.c44
-rw-r--r--src/mame/drivers/ssingles.c22
-rw-r--r--src/mame/drivers/sslam.c30
-rw-r--r--src/mame/drivers/ssozumo.c4
-rw-r--r--src/mame/drivers/sspeedr.c8
-rw-r--r--src/mame/drivers/ssrj.c8
-rw-r--r--src/mame/drivers/sstrangr.c8
-rw-r--r--src/mame/drivers/ssv.c184
-rw-r--r--src/mame/drivers/st0016.c28
-rw-r--r--src/mame/drivers/stactics.c18
-rw-r--r--src/mame/drivers/stadhero.c10
-rw-r--r--src/mame/drivers/starfire.c26
-rw-r--r--src/mame/drivers/starshp1.c28
-rw-r--r--src/mame/drivers/starwars.c26
-rw-r--r--src/mame/drivers/statriv2.c48
-rw-r--r--src/mame/drivers/stepstag.c8
-rw-r--r--src/mame/drivers/stlforce.c4
-rw-r--r--src/mame/drivers/strnskil.c12
-rw-r--r--src/mame/drivers/stv.c224
-rw-r--r--src/mame/drivers/stvinit.c166
-rw-r--r--src/mame/drivers/sub.c24
-rw-r--r--src/mame/drivers/subsino.c86
-rw-r--r--src/mame/drivers/subsino2.c254
-rw-r--r--src/mame/drivers/suna16.c40
-rw-r--r--src/mame/drivers/suna8.c154
-rw-r--r--src/mame/drivers/supbtime.c18
-rw-r--r--src/mame/drivers/supdrapo.c14
-rw-r--r--src/mame/drivers/superchs.c52
-rw-r--r--src/mame/drivers/superdq.c34
-rw-r--r--src/mame/drivers/superqix.c150
-rw-r--r--src/mame/drivers/supertnk.c30
-rw-r--r--src/mame/drivers/suprgolf.c62
-rw-r--r--src/mame/drivers/suprloco.c6
-rw-r--r--src/mame/drivers/suprnova.c94
-rw-r--r--src/mame/drivers/suprridr.c20
-rw-r--r--src/mame/drivers/suprslam.c20
-rw-r--r--src/mame/drivers/surpratk.c42
-rw-r--r--src/mame/drivers/system1.c136
-rw-r--r--src/mame/drivers/system16.c218
-rw-r--r--src/mame/drivers/tagteam.c6
-rw-r--r--src/mame/drivers/tail2nos.c22
-rw-r--r--src/mame/drivers/taito_b.c114
-rw-r--r--src/mame/drivers/taito_f2.c140
-rw-r--r--src/mame/drivers/taito_f3.c146
-rw-r--r--src/mame/drivers/taito_h.c42
-rw-r--r--src/mame/drivers/taito_l.c176
-rw-r--r--src/mame/drivers/taito_o.c12
-rw-r--r--src/mame/drivers/taito_x.c48
-rw-r--r--src/mame/drivers/taito_z.c154
-rw-r--r--src/mame/drivers/taitoair.c52
-rw-r--r--src/mame/drivers/taitogn.c154
-rw-r--r--src/mame/drivers/taitojc.c80
-rw-r--r--src/mame/drivers/taitosj.c40
-rw-r--r--src/mame/drivers/taitowlf.c82
-rw-r--r--src/mame/drivers/tank8.c20
-rw-r--r--src/mame/drivers/tankbatt.c40
-rw-r--r--src/mame/drivers/tankbust.c24
-rw-r--r--src/mame/drivers/taotaido.c14
-rw-r--r--src/mame/drivers/targeth.c4
-rw-r--r--src/mame/drivers/tatsumi.c84
-rw-r--r--src/mame/drivers/tattack.c8
-rw-r--r--src/mame/drivers/taxidrvr.c26
-rw-r--r--src/mame/drivers/tbowl.c36
-rw-r--r--src/mame/drivers/tceptor.c32
-rw-r--r--src/mame/drivers/tcl.c6
-rw-r--r--src/mame/drivers/tecmo.c42
-rw-r--r--src/mame/drivers/tecmo16.c4
-rw-r--r--src/mame/drivers/tecmosys.c74
-rw-r--r--src/mame/drivers/tehkanwc.c42
-rw-r--r--src/mame/drivers/tempest.c32
-rw-r--r--src/mame/drivers/terracre.c16
-rw-r--r--src/mame/drivers/tetrisp2.c82
-rw-r--r--src/mame/drivers/tgtpanic.c6
-rw-r--r--src/mame/drivers/thayers.c78
-rw-r--r--src/mame/drivers/thedeep.c30
-rw-r--r--src/mame/drivers/thepit.c10
-rw-r--r--src/mame/drivers/thief.c18
-rw-r--r--src/mame/drivers/thoop2.c6
-rw-r--r--src/mame/drivers/thunderj.c26
-rw-r--r--src/mame/drivers/thunderx.c80
-rw-r--r--src/mame/drivers/tiamc1.c6
-rw-r--r--src/mame/drivers/tickee.c58
-rw-r--r--src/mame/drivers/tigeroad.c10
-rw-r--r--src/mame/drivers/timelimt.c8
-rw-r--r--src/mame/drivers/timeplt.c14
-rw-r--r--src/mame/drivers/timetrv.c8
-rw-r--r--src/mame/drivers/tmaster.c134
-rw-r--r--src/mame/drivers/tmmjprd.c96
-rw-r--r--src/mame/drivers/tmnt.c160
-rw-r--r--src/mame/drivers/tnzs.c28
-rw-r--r--src/mame/drivers/toaplan1.c2
-rw-r--r--src/mame/drivers/toaplan2.c160
-rw-r--r--src/mame/drivers/toki.c34
-rw-r--r--src/mame/drivers/tomcat.c48
-rw-r--r--src/mame/drivers/toobin.c16
-rw-r--r--src/mame/drivers/topspeed.c66
-rw-r--r--src/mame/drivers/toratora.c38
-rw-r--r--src/mame/drivers/tourtabl.c14
-rw-r--r--src/mame/drivers/toypop.c74
-rw-r--r--src/mame/drivers/tp84.c16
-rw-r--r--src/mame/drivers/trackfld.c32
-rw-r--r--src/mame/drivers/travrusa.c6
-rw-r--r--src/mame/drivers/triplhnt.c34
-rw-r--r--src/mame/drivers/truco.c6
-rw-r--r--src/mame/drivers/trucocl.c8
-rw-r--r--src/mame/drivers/trvmadns.c38
-rw-r--r--src/mame/drivers/trvquest.c18
-rw-r--r--src/mame/drivers/tryout.c12
-rw-r--r--src/mame/drivers/tsamurai.c44
-rw-r--r--src/mame/drivers/ttchamp.c20
-rw-r--r--src/mame/drivers/tubep.c68
-rw-r--r--src/mame/drivers/tugboat.c40
-rw-r--r--src/mame/drivers/tumbleb.c108
-rw-r--r--src/mame/drivers/tumblep.c22
-rw-r--r--src/mame/drivers/tunhunt.c20
-rw-r--r--src/mame/drivers/turbo.c94
-rw-r--r--src/mame/drivers/tutankhm.c18
-rw-r--r--src/mame/drivers/twin16.c82
-rw-r--r--src/mame/drivers/twincobr.c2
-rw-r--r--src/mame/drivers/twinkle.c54
-rw-r--r--src/mame/drivers/twins.c22
-rw-r--r--src/mame/drivers/tx1.c52
-rw-r--r--src/mame/drivers/uapce.c16
-rw-r--r--src/mame/drivers/ultraman.c18
-rw-r--r--src/mame/drivers/ultratnk.c32
-rw-r--r--src/mame/drivers/ultrsprt.c34
-rw-r--r--src/mame/drivers/undrfire.c60
-rw-r--r--src/mame/drivers/unico.c34
-rw-r--r--src/mame/drivers/upscope.c28
-rw-r--r--src/mame/drivers/usgames.c14
-rw-r--r--src/mame/drivers/vamphalf.c136
-rw-r--r--src/mame/drivers/vaportra.c28
-rw-r--r--src/mame/drivers/vastar.c10
-rw-r--r--src/mame/drivers/vball.c36
-rw-r--r--src/mame/drivers/vcombat.c62
-rw-r--r--src/mame/drivers/vega.c4
-rw-r--r--src/mame/drivers/vegaeo.c18
-rw-r--r--src/mame/drivers/vegas.c188
-rw-r--r--src/mame/drivers/vendetta.c70
-rw-r--r--src/mame/drivers/vicdual.c122
-rw-r--r--src/mame/drivers/victory.c8
-rw-r--r--src/mame/drivers/videopin.c38
-rw-r--r--src/mame/drivers/videopkr.c68
-rw-r--r--src/mame/drivers/vigilant.c12
-rw-r--r--src/mame/drivers/vindictr.c12
-rw-r--r--src/mame/drivers/viper.c64
-rw-r--r--src/mame/drivers/vmetal.c58
-rw-r--r--src/mame/drivers/volfied.c10
-rw-r--r--src/mame/drivers/vpoker.c12
-rw-r--r--src/mame/drivers/vroulet.c20
-rw-r--r--src/mame/drivers/vsnes.c12
-rw-r--r--src/mame/drivers/wallc.c16
-rw-r--r--src/mame/drivers/wardner.c22
-rw-r--r--src/mame/drivers/warpwarp.c72
-rw-r--r--src/mame/drivers/warriorb.c50
-rw-r--r--src/mame/drivers/wc90.c12
-rw-r--r--src/mame/drivers/wc90b.c22
-rw-r--r--src/mame/drivers/wecleman.c74
-rw-r--r--src/mame/drivers/welltris.c16
-rw-r--r--src/mame/drivers/wgp.c66
-rw-r--r--src/mame/drivers/wheelfir.c64
-rw-r--r--src/mame/drivers/williams.c70
-rw-r--r--src/mame/drivers/wink.c28
-rw-r--r--src/mame/drivers/wiping.c14
-rw-r--r--src/mame/drivers/witch.c74
-rw-r--r--src/mame/drivers/wiz.c20
-rw-r--r--src/mame/drivers/wldarrow.c6
-rw-r--r--src/mame/drivers/wolfpack.c18
-rw-r--r--src/mame/drivers/wrally.c4
-rw-r--r--src/mame/drivers/wwfsstar.c24
-rw-r--r--src/mame/drivers/wwfwfest.c30
-rw-r--r--src/mame/drivers/xain.c76
-rw-r--r--src/mame/drivers/xexex.c96
-rw-r--r--src/mame/drivers/xmen.c46
-rw-r--r--src/mame/drivers/xorworld.c2
-rw-r--r--src/mame/drivers/xtheball.c22
-rw-r--r--src/mame/drivers/xxmissio.c18
-rw-r--r--src/mame/drivers/xybots.c14
-rw-r--r--src/mame/drivers/xyonix.c24
-rw-r--r--src/mame/drivers/yiear.c6
-rw-r--r--src/mame/drivers/yunsun16.c14
-rw-r--r--src/mame/drivers/yunsung8.c22
-rw-r--r--src/mame/drivers/zaccaria.c48
-rw-r--r--src/mame/drivers/zaxxon.c46
-rw-r--r--src/mame/drivers/zerozone.c16
-rw-r--r--src/mame/drivers/zn.c346
-rw-r--r--src/mame/drivers/zodiack.c24
-rw-r--r--src/mame/drivers/zr107.c86
-rw-r--r--src/mame/includes/88games.h6
-rw-r--r--src/mame/includes/ajax.h6
-rw-r--r--src/mame/includes/aliens.h4
-rw-r--r--src/mame/includes/alpha68k.h4
-rw-r--r--src/mame/includes/amiga.h54
-rw-r--r--src/mame/includes/archimds.h20
-rw-r--r--src/mame/includes/artmagic.h2
-rw-r--r--src/mame/includes/asterix.h4
-rw-r--r--src/mame/includes/atari.h8
-rw-r--r--src/mame/includes/battlnts.h4
-rw-r--r--src/mame/includes/bishi.h2
-rw-r--r--src/mame/includes/bladestl.h4
-rw-r--r--src/mame/includes/blockhl.h4
-rw-r--r--src/mame/includes/bottom9.h6
-rw-r--r--src/mame/includes/carpolo.h10
-rw-r--r--src/mame/includes/cave.h8
-rw-r--r--src/mame/includes/cd32.h2
-rw-r--r--src/mame/includes/chqflag.h6
-rw-r--r--src/mame/includes/cinemat.h2
-rw-r--r--src/mame/includes/cosmic.h2
-rw-r--r--src/mame/includes/cps1.h38
-rw-r--r--src/mame/includes/crbaloon.h4
-rw-r--r--src/mame/includes/crimfght.h4
-rw-r--r--src/mame/includes/cvs.h2
-rw-r--r--src/mame/includes/cyberbal.h2
-rw-r--r--src/mame/includes/dbz.h4
-rw-r--r--src/mame/includes/dc.h4
-rw-r--r--src/mame/includes/dcheese.h2
-rw-r--r--src/mame/includes/dec0.h4
-rw-r--r--src/mame/includes/decocrpt.h10
-rw-r--r--src/mame/includes/decoprot.h2
-rw-r--r--src/mame/includes/djmain.h2
-rw-r--r--src/mame/includes/dynax.h10
-rw-r--r--src/mame/includes/eolithsp.h2
-rw-r--r--src/mame/includes/esripsys.h2
-rw-r--r--src/mame/includes/exidy.h2
-rw-r--r--src/mame/includes/exidy440.h2
-rw-r--r--src/mame/includes/fromanc2.h2
-rw-r--r--src/mame/includes/galaga.h2
-rw-r--r--src/mame/includes/galaxian.h28
-rw-r--r--src/mame/includes/galaxold.h6
-rw-r--r--src/mame/includes/gbusters.h4
-rw-r--r--src/mame/includes/genesis.h2
-rw-r--r--src/mame/includes/gijoe.h4
-rw-r--r--src/mame/includes/gradius3.h4
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/hng64.h2
-rw-r--r--src/mame/includes/irobot.h4
-rw-r--r--src/mame/includes/itech32.h2
-rw-r--r--src/mame/includes/itech8.h2
-rw-r--r--src/mame/includes/jackal.h2
-rw-r--r--src/mame/includes/jaguar.h10
-rw-r--r--src/mame/includes/kaneko16.h14
-rw-r--r--src/mame/includes/karnov.h2
-rw-r--r--src/mame/includes/konamigx.h6
-rw-r--r--src/mame/includes/ladybug.h8
-rw-r--r--src/mame/includes/legionna.h4
-rw-r--r--src/mame/includes/leland.h26
-rw-r--r--src/mame/includes/lethal.h4
-rw-r--r--src/mame/includes/lordgun.h2
-rw-r--r--src/mame/includes/m92.h2
-rw-r--r--src/mame/includes/mainevt.h8
-rw-r--r--src/mame/includes/meadows.h4
-rw-r--r--src/mame/includes/megadriv.h8
-rw-r--r--src/mame/includes/metro.h2
-rw-r--r--src/mame/includes/micro3d.h2
-rw-r--r--src/mame/includes/model1.h6
-rw-r--r--src/mame/includes/model2.h2
-rw-r--r--src/mame/includes/model3.h12
-rw-r--r--src/mame/includes/moo.h4
-rw-r--r--src/mame/includes/mw8080bw.h4
-rw-r--r--src/mame/includes/mystston.h2
-rw-r--r--src/mame/includes/n64.h6
-rw-r--r--src/mame/includes/n8080.h2
-rw-r--r--src/mame/includes/namcoic.h18
-rw-r--r--src/mame/includes/namcos1.h2
-rw-r--r--src/mame/includes/namcos2.h6
-rw-r--r--src/mame/includes/namcos22.h2
-rw-r--r--src/mame/includes/naomi.h2
-rw-r--r--src/mame/includes/neogeo.h158
-rw-r--r--src/mame/includes/opwolf.h2
-rw-r--r--src/mame/includes/overdriv.h6
-rw-r--r--src/mame/includes/pacman.h4
-rw-r--r--src/mame/includes/parodius.h4
-rw-r--r--src/mame/includes/pgm.h42
-rw-r--r--src/mame/includes/polyplay.h8
-rw-r--r--src/mame/includes/psikyo.h2
-rw-r--r--src/mame/includes/psx.h28
-rw-r--r--src/mame/includes/qdrmfgp.h4
-rw-r--r--src/mame/includes/raiden2.h8
-rw-r--r--src/mame/includes/rainbow.h2
-rw-r--r--src/mame/includes/rockrage.h4
-rw-r--r--src/mame/includes/rollerg.h4
-rw-r--r--src/mame/includes/rungun.h2
-rw-r--r--src/mame/includes/segamsys.h4
-rw-r--r--src/mame/includes/segas16.h12
-rw-r--r--src/mame/includes/segas24.h14
-rw-r--r--src/mame/includes/segas32.h4
-rw-r--r--src/mame/includes/seibuspi.h2
-rw-r--r--src/mame/includes/seta.h2
-rw-r--r--src/mame/includes/simpsons.h6
-rw-r--r--src/mame/includes/skullxbo.h2
-rw-r--r--src/mame/includes/slapstic.h2
-rw-r--r--src/mame/includes/snes.h6
-rw-r--r--src/mame/includes/snk6502.h6
-rw-r--r--src/mame/includes/sprint8.h2
-rw-r--r--src/mame/includes/spy.h4
-rw-r--r--src/mame/includes/ssv.h2
-rw-r--r--src/mame/includes/starwars.h4
-rw-r--r--src/mame/includes/stv.h8
-rw-r--r--src/mame/includes/suprnova.h2
-rw-r--r--src/mame/includes/suprridr.h2
-rw-r--r--src/mame/includes/surpratk.h4
-rw-r--r--src/mame/includes/system1.h2
-rw-r--r--src/mame/includes/tail2nos.h2
-rw-r--r--src/mame/includes/taito_l.h26
-rw-r--r--src/mame/includes/taitojc.h4
-rw-r--r--src/mame/includes/tank8.h2
-rw-r--r--src/mame/includes/tatsumi.h2
-rw-r--r--src/mame/includes/tecmosys.h2
-rw-r--r--src/mame/includes/thunderx.h4
-rw-r--r--src/mame/includes/tmnt.h24
-rw-r--r--src/mame/includes/toaplan1.h6
-rw-r--r--src/mame/includes/triplhnt.h2
-rw-r--r--src/mame/includes/tubep.h2
-rw-r--r--src/mame/includes/twin16.h4
-rw-r--r--src/mame/includes/twincobr.h8
-rw-r--r--src/mame/includes/ultraman.h8
-rw-r--r--src/mame/includes/vball.h6
-rw-r--r--src/mame/includes/vendetta.h6
-rw-r--r--src/mame/includes/vertigo.h10
-rw-r--r--src/mame/includes/vicdual.h2
-rw-r--r--src/mame/includes/volfied.h4
-rw-r--r--src/mame/includes/wecleman.h4
-rw-r--r--src/mame/includes/xexex.h4
-rw-r--r--src/mame/includes/xmen.h4
-rw-r--r--src/mame/machine/acitya.c32
-rw-r--r--src/mame/machine/ajax.c64
-rw-r--r--src/mame/machine/amiga.c180
-rw-r--r--src/mame/machine/archimds.c96
-rw-r--r--src/mame/machine/arkanoid.c38
-rw-r--r--src/mame/machine/asic65.c18
-rw-r--r--src/mame/machine/asic65.h4
-rw-r--r--src/mame/machine/asteroid.c44
-rw-r--r--src/mame/machine/atari.c46
-rw-r--r--src/mame/machine/atarifb.c82
-rw-r--r--src/mame/machine/atarigen.c236
-rw-r--r--src/mame/machine/atarigen.h20
-rw-r--r--src/mame/machine/bagman.c8
-rw-r--r--src/mame/machine/balsente.c174
-rw-r--r--src/mame/machine/beezer.c36
-rw-r--r--src/mame/machine/bigevglf.c24
-rw-r--r--src/mame/machine/bonzeadv.c34
-rw-r--r--src/mame/machine/bsktball.c24
-rw-r--r--src/mame/machine/btime.c8
-rw-r--r--src/mame/machine/bublbobl.c92
-rw-r--r--src/mame/machine/buggychl.c2
-rw-r--r--src/mame/machine/carpolo.c114
-rw-r--r--src/mame/machine/cchip.c14
-rw-r--r--src/mame/machine/cclimber.c14
-rw-r--r--src/mame/machine/cd32.c36
-rw-r--r--src/mame/machine/cdi070.c244
-rw-r--r--src/mame/machine/cdi070.h14
-rw-r--r--src/mame/machine/cdicdic.c130
-rw-r--r--src/mame/machine/cdislave.c68
-rw-r--r--src/mame/machine/chaknpop.c20
-rw-r--r--src/mame/machine/cps2crpt.c12
-rw-r--r--src/mame/machine/cx4fn.c4
-rw-r--r--src/mame/machine/cx4oam.c12
-rw-r--r--src/mame/machine/cx4ops.c14
-rw-r--r--src/mame/machine/dc.c118
-rw-r--r--src/mame/machine/dec0.c94
-rw-r--r--src/mame/machine/deco102.c10
-rw-r--r--src/mame/machine/deco156.c6
-rw-r--r--src/mame/machine/decocass.c291
-rw-r--r--src/mame/machine/decocass.h4
-rw-r--r--src/mame/machine/decocrpt.c12
-rw-r--r--src/mame/machine/decoprot.c100
-rw-r--r--src/mame/machine/docastle.c12
-rw-r--r--src/mame/machine/fd1089.c18
-rw-r--r--src/mame/machine/fd1089.h4
-rw-r--r--src/mame/machine/fddebug.c130
-rw-r--r--src/mame/machine/fddebug.h4
-rw-r--r--src/mame/machine/flstory.c32
-rw-r--r--src/mame/machine/gaelco2.c44
-rw-r--r--src/mame/machine/gaelco3d.c4
-rw-r--r--src/mame/machine/gaelcrpt.c2
-rw-r--r--src/mame/machine/galaxold.c86
-rw-r--r--src/mame/machine/gaplus.c8
-rw-r--r--src/mame/machine/gdcrypt.c6
-rw-r--r--src/mame/machine/harddriv.c224
-rw-r--r--src/mame/machine/irobot.c96
-rw-r--r--src/mame/machine/jalcrpt.c36
-rw-r--r--src/mame/machine/jalcrpt.h12
-rw-r--r--src/mame/machine/jumpshot.c4
-rw-r--r--src/mame/machine/kabuki.c46
-rw-r--r--src/mame/machine/kaneko16.c80
-rw-r--r--src/mame/machine/konami1.c8
-rw-r--r--src/mame/machine/konami1.h2
-rw-r--r--src/mame/machine/konamigx.c6
-rw-r--r--src/mame/machine/konppc.c44
-rw-r--r--src/mame/machine/konppc.h4
-rw-r--r--src/mame/machine/leland.c270
-rw-r--r--src/mame/machine/lkage.c24
-rw-r--r--src/mame/machine/lsasquad.c46
-rw-r--r--src/mame/machine/maniach.c24
-rw-r--r--src/mame/machine/mc8123.c8
-rw-r--r--src/mame/machine/mc8123.h2
-rw-r--r--src/mame/machine/mcr.c14
-rw-r--r--src/mame/machine/mcr68.c74
-rw-r--r--src/mame/machine/md_cart.c312
-rw-r--r--src/mame/machine/megadriv.c644
-rw-r--r--src/mame/machine/meters.c4
-rw-r--r--src/mame/machine/meters.h2
-rw-r--r--src/mame/machine/mexico86.c28
-rw-r--r--src/mame/machine/mhavoc.c84
-rw-r--r--src/mame/machine/micro3d.c92
-rw-r--r--src/mame/machine/midtunit.c56
-rw-r--r--src/mame/machine/midwayic.c100
-rw-r--r--src/mame/machine/midwayic.h14
-rw-r--r--src/mame/machine/midwunit.c44
-rw-r--r--src/mame/machine/midxunit.c44
-rw-r--r--src/mame/machine/midyunit.c84
-rw-r--r--src/mame/machine/model1.c262
-rw-r--r--src/mame/machine/model3.c22
-rw-r--r--src/mame/machine/mw8080bw.c38
-rw-r--r--src/mame/machine/n64.c106
-rw-r--r--src/mame/machine/namco06.c24
-rw-r--r--src/mame/machine/namco50.c6
-rw-r--r--src/mame/machine/namco51.c10
-rw-r--r--src/mame/machine/namco53.c2
-rw-r--r--src/mame/machine/namcond1.c14
-rw-r--r--src/mame/machine/namcos1.c124
-rw-r--r--src/mame/machine/namcos2.c106
-rw-r--r--src/mame/machine/naomi.c22
-rw-r--r--src/mame/machine/naomibd.c35
-rw-r--r--src/mame/machine/nb1413m3.c132
-rw-r--r--src/mame/machine/neoboot.c212
-rw-r--r--src/mame/machine/neocrypt.c158
-rw-r--r--src/mame/machine/neoprot.c92
-rw-r--r--src/mame/machine/nitedrvr.c50
-rw-r--r--src/mame/machine/nmk004.c20
-rw-r--r--src/mame/machine/nmk004.h2
-rw-r--r--src/mame/machine/nmk112.c10
-rw-r--r--src/mame/machine/nycaptor.c26
-rw-r--r--src/mame/machine/opwolf.c30
-rw-r--r--src/mame/machine/pacplus.c4
-rw-r--r--src/mame/machine/pcecommn.c8
-rw-r--r--src/mame/machine/pcecommn.h2
-rw-r--r--src/mame/machine/pckeybrd.c20
-rw-r--r--src/mame/machine/pcshare.c32
-rw-r--r--src/mame/machine/pgmcrypt.c84
-rw-r--r--src/mame/machine/pgmprot.c30
-rw-r--r--src/mame/machine/pitnrun.c36
-rw-r--r--src/mame/machine/playch10.c250
-rw-r--r--src/mame/machine/psx.c122
-rw-r--r--src/mame/machine/qix.c74
-rw-r--r--src/mame/machine/r2crypt.c6
-rw-r--r--src/mame/machine/rainbow.c28
-rw-r--r--src/mame/machine/retofinv.c28
-rw-r--r--src/mame/machine/s16fd.c40
-rw-r--r--src/mame/machine/s24fd.c36
-rw-r--r--src/mame/machine/scramble.c108
-rw-r--r--src/mame/machine/scudsp.c2
-rw-r--r--src/mame/machine/segacrp2.c24
-rw-r--r--src/mame/machine/segacrp2.h16
-rw-r--r--src/mame/machine/segacrpt.c76
-rw-r--r--src/mame/machine/segacrpt.h50
-rw-r--r--src/mame/machine/segaic16.c30
-rw-r--r--src/mame/machine/segaic16.h12
-rw-r--r--src/mame/machine/segamsys.c80
-rw-r--r--src/mame/machine/segas24.c20
-rw-r--r--src/mame/machine/segas32.c22
-rw-r--r--src/mame/machine/seicop.c70
-rw-r--r--src/mame/machine/simpsons.c48
-rw-r--r--src/mame/machine/slapfght.c88
-rw-r--r--src/mame/machine/slapstic.c14
-rw-r--r--src/mame/machine/slikshot.c32
-rw-r--r--src/mame/machine/snes.c224
-rw-r--r--src/mame/machine/snes7110.c40
-rw-r--r--src/mame/machine/snesbsx.c6
-rw-r--r--src/mame/machine/snescx4.c18
-rw-r--r--src/mame/machine/snesobc1.c2
-rw-r--r--src/mame/machine/snesrtc.c10
-rw-r--r--src/mame/machine/snessdd1.c76
-rw-r--r--src/mame/machine/starwars.c62
-rw-r--r--src/mame/machine/steppers.c4
-rw-r--r--src/mame/machine/steppers.h2
-rw-r--r--src/mame/machine/stfight.c36
-rw-r--r--src/mame/machine/stvcd.c92
-rw-r--r--src/mame/machine/stvcd.h2
-rw-r--r--src/mame/machine/stvprot.c48
-rw-r--r--src/mame/machine/stvprot.h16
-rw-r--r--src/mame/machine/subs.c32
-rw-r--r--src/mame/machine/tait8741.c50
-rw-r--r--src/mame/machine/tait8741.h2
-rw-r--r--src/mame/machine/taitoio.c30
-rw-r--r--src/mame/machine/taitosj.c62
-rw-r--r--src/mame/machine/tatsumi.c92
-rw-r--r--src/mame/machine/tecmosys.c10
-rw-r--r--src/mame/machine/theglobp.c32
-rw-r--r--src/mame/machine/ticket.c10
-rw-r--r--src/mame/machine/tnzs.c168
-rw-r--r--src/mame/machine/toaplan1.c124
-rw-r--r--src/mame/machine/twincobr.c104
-rw-r--r--src/mame/machine/tx1.c118
-rw-r--r--src/mame/machine/vertigo.c56
-rw-r--r--src/mame/machine/volfied.c36
-rw-r--r--src/mame/machine/vsnes.c248
-rw-r--r--src/mame/machine/williams.c186
-rw-r--r--src/mame/machine/wrally.c10
-rw-r--r--src/mame/machine/xevious.c34
-rw-r--r--src/mame/machine/zs01.c6
-rw-r--r--src/mame/video/1942.c30
-rw-r--r--src/mame/video/1943.c60
-rw-r--r--src/mame/video/20pacgal.c16
-rw-r--r--src/mame/video/40love.c82
-rw-r--r--src/mame/video/4enraya.c8
-rw-r--r--src/mame/video/8080bw.c90
-rw-r--r--src/mame/video/88games.c14
-rw-r--r--src/mame/video/actfancr.c14
-rw-r--r--src/mame/video/aeroboto.c24
-rw-r--r--src/mame/video/aerofgt.c248
-rw-r--r--src/mame/video/airbustr.c22
-rw-r--r--src/mame/video/ajax.c20
-rw-r--r--src/mame/video/aliens.c18
-rw-r--r--src/mame/video/alpha68k.c150
-rw-r--r--src/mame/video/ambush.c22
-rw-r--r--src/mame/video/amiga.c40
-rw-r--r--src/mame/video/amigaaga.c20
-rw-r--r--src/mame/video/ampoker2.c14
-rw-r--r--src/mame/video/amspdwy.c26
-rw-r--r--src/mame/video/angelkds.c42
-rw-r--r--src/mame/video/antic.c4
-rw-r--r--src/mame/video/appoooh.c52
-rw-r--r--src/mame/video/aquarium.c26
-rw-r--r--src/mame/video/arabian.c18
-rw-r--r--src/mame/video/arcadecl.c14
-rw-r--r--src/mame/video/archimds.c16
-rw-r--r--src/mame/video/argus.c198
-rw-r--r--src/mame/video/arkanoid.c60
-rw-r--r--src/mame/video/armedf.c66
-rw-r--r--src/mame/video/artmagic.c32
-rw-r--r--src/mame/video/ashnojoe.c38
-rw-r--r--src/mame/video/asterix.c20
-rw-r--r--src/mame/video/astrocde.c60
-rw-r--r--src/mame/video/asuka.c10
-rw-r--r--src/mame/video/atari.c52
-rw-r--r--src/mame/video/atarifb.c42
-rw-r--r--src/mame/video/atarig1.c18
-rw-r--r--src/mame/video/atarig42.c20
-rw-r--r--src/mame/video/atarigt.c22
-rw-r--r--src/mame/video/atarigx2.c20
-rw-r--r--src/mame/video/atarimo.c40
-rw-r--r--src/mame/video/atarimo.h2
-rw-r--r--src/mame/video/atarirle.c36
-rw-r--r--src/mame/video/atarisy1.c92
-rw-r--r--src/mame/video/atarisy2.c42
-rw-r--r--src/mame/video/atetris.c8
-rw-r--r--src/mame/video/avgdvg.c36
-rw-r--r--src/mame/video/aztarac.c14
-rw-r--r--src/mame/video/badlands.c10
-rw-r--r--src/mame/video/bagman.c28
-rw-r--r--src/mame/video/balsente.c44
-rw-r--r--src/mame/video/bankp.c40
-rw-r--r--src/mame/video/baraduke.c50
-rw-r--r--src/mame/video/batman.c14
-rw-r--r--src/mame/video/battlane.c38
-rw-r--r--src/mame/video/battlera.c68
-rw-r--r--src/mame/video/battlex.c30
-rw-r--r--src/mame/video/battlnts.c14
-rw-r--r--src/mame/video/bbusters.c40
-rw-r--r--src/mame/video/beathead.c18
-rw-r--r--src/mame/video/beezer.c10
-rw-r--r--src/mame/video/bfm_adr2.c10
-rw-r--r--src/mame/video/bfm_adr2.h2
-rw-r--r--src/mame/video/bfm_dm01.c12
-rw-r--r--src/mame/video/bfm_dm01.h4
-rw-r--r--src/mame/video/bigevglf.c32
-rw-r--r--src/mame/video/bigstrkb.c26
-rw-r--r--src/mame/video/bionicc.c46
-rw-r--r--src/mame/video/bishi.c12
-rw-r--r--src/mame/video/bking.c68
-rw-r--r--src/mame/video/bladestl.c26
-rw-r--r--src/mame/video/blktiger.c46
-rw-r--r--src/mame/video/blmbycar.c38
-rw-r--r--src/mame/video/blockade.c12
-rw-r--r--src/mame/video/blockhl.c18
-rw-r--r--src/mame/video/blockout.c26
-rw-r--r--src/mame/video/bloodbro.c48
-rw-r--r--src/mame/video/blstroid.c16
-rw-r--r--src/mame/video/blueprnt.c30
-rw-r--r--src/mame/video/bogeyman.c26
-rw-r--r--src/mame/video/bombjack.c30
-rw-r--r--src/mame/video/boogwing.c20
-rw-r--r--src/mame/video/bosco.c72
-rw-r--r--src/mame/video/bottom9.c16
-rw-r--r--src/mame/video/brkthru.c46
-rw-r--r--src/mame/video/bsktball.c16
-rw-r--r--src/mame/video/btime.c150
-rw-r--r--src/mame/video/btoads.c56
-rw-r--r--src/mame/video/bublbobl.c8
-rw-r--r--src/mame/video/buggychl.c56
-rw-r--r--src/mame/video/bwing.c66
-rw-r--r--src/mame/video/cabal.c24
-rw-r--r--src/mame/video/calomega.c12
-rw-r--r--src/mame/video/canyon.c24
-rw-r--r--src/mame/video/capbowl.c16
-rw-r--r--src/mame/video/carjmbre.c22
-rw-r--r--src/mame/video/carpolo.c88
-rw-r--r--src/mame/video/cave.c214
-rw-r--r--src/mame/video/cbasebal.c32
-rw-r--r--src/mame/video/cbuster.c32
-rw-r--r--src/mame/video/ccastles.c52
-rw-r--r--src/mame/video/cchasm.c14
-rw-r--r--src/mame/video/cclimber.c96
-rw-r--r--src/mame/video/centiped.c68
-rw-r--r--src/mame/video/chaknpop.c42
-rw-r--r--src/mame/video/champbas.c58
-rw-r--r--src/mame/video/changela.c72
-rw-r--r--src/mame/video/cheekyms.c24
-rw-r--r--src/mame/video/chqflag.c20
-rw-r--r--src/mame/video/cidelsa.c22
-rw-r--r--src/mame/video/cinemat.c26
-rw-r--r--src/mame/video/circus.c50
-rw-r--r--src/mame/video/circusc.c30
-rw-r--r--src/mame/video/cischeat.c264
-rw-r--r--src/mame/video/citycon.c32
-rw-r--r--src/mame/video/cloak.c44
-rw-r--r--src/mame/video/cloud9.c48
-rw-r--r--src/mame/video/clshroad.c38
-rw-r--r--src/mame/video/cninja.c68
-rw-r--r--src/mame/video/combatsc.c78
-rw-r--r--src/mame/video/commando.c40
-rw-r--r--src/mame/video/compgolf.c24
-rw-r--r--src/mame/video/contra.c52
-rw-r--r--src/mame/video/cop01.c38
-rw-r--r--src/mame/video/copsnrob.c16
-rw-r--r--src/mame/video/cosmic.c130
-rw-r--r--src/mame/video/cps1.c218
-rw-r--r--src/mame/video/crbaloon.c28
-rw-r--r--src/mame/video/crgolf.c14
-rw-r--r--src/mame/video/crimfght.c16
-rw-r--r--src/mame/video/crospang.c40
-rw-r--r--src/mame/video/crshrace.c54
-rw-r--r--src/mame/video/cvs.c64
-rw-r--r--src/mame/video/cyberbal.c36
-rw-r--r--src/mame/video/darius.c20
-rw-r--r--src/mame/video/darkmist.c38
-rw-r--r--src/mame/video/darkseal.c24
-rw-r--r--src/mame/video/dassault.c22
-rw-r--r--src/mame/video/dbz.c24
-rw-r--r--src/mame/video/dc.c72
-rw-r--r--src/mame/video/dcheese.c56
-rw-r--r--src/mame/video/dcon.c88
-rw-r--r--src/mame/video/dday.c196
-rw-r--r--src/mame/video/ddragon.c24
-rw-r--r--src/mame/video/ddragon3.c38
-rw-r--r--src/mame/video/ddribble.c38
-rw-r--r--src/mame/video/deadang.c34
-rw-r--r--src/mame/video/dec0.c150
-rw-r--r--src/mame/video/dec8.c148
-rw-r--r--src/mame/video/decbac06.c16
-rw-r--r--src/mame/video/decbac06.h6
-rw-r--r--src/mame/video/decmxc06.c8
-rw-r--r--src/mame/video/decmxc06.h2
-rw-r--r--src/mame/video/deco16ic.c26
-rw-r--r--src/mame/video/deco32.c156
-rw-r--r--src/mame/video/deco_mlc.c30
-rw-r--r--src/mame/video/decocass.c130
-rw-r--r--src/mame/video/decocomn.c34
-rw-r--r--src/mame/video/decospr.c48
-rw-r--r--src/mame/video/decospr.h6
-rw-r--r--src/mame/video/deniam.c82
-rw-r--r--src/mame/video/dietgo.c6
-rw-r--r--src/mame/video/digdug.c40
-rw-r--r--src/mame/video/djboy.c18
-rw-r--r--src/mame/video/djmain.c24
-rw-r--r--src/mame/video/dkong.c126
-rw-r--r--src/mame/video/docastle.c46
-rw-r--r--src/mame/video/dogfgt.c44
-rw-r--r--src/mame/video/dooyong.c202
-rw-r--r--src/mame/video/dragrace.c6
-rw-r--r--src/mame/video/drgnmst.c24
-rw-r--r--src/mame/video/dribling.c10
-rw-r--r--src/mame/video/drmicro.c20
-rw-r--r--src/mame/video/dynax.c220
-rw-r--r--src/mame/video/dynduke.c56
-rw-r--r--src/mame/video/eolith.c8
-rw-r--r--src/mame/video/epos.c18
-rw-r--r--src/mame/video/eprom.c30
-rw-r--r--src/mame/video/equites.c100
-rw-r--r--src/mame/video/esd16.c88
-rw-r--r--src/mame/video/espial.c44
-rw-r--r--src/mame/video/esripsys.c44
-rw-r--r--src/mame/video/exedexes.c60
-rw-r--r--src/mame/video/exerion.c44
-rw-r--r--src/mame/video/exidy.c64
-rw-r--r--src/mame/video/exidy440.c66
-rw-r--r--src/mame/video/exprraid.c36
-rw-r--r--src/mame/video/exterm.c12
-rw-r--r--src/mame/video/exzisus.c30
-rw-r--r--src/mame/video/f1gp.c102
-rw-r--r--src/mame/video/fantland.c10
-rw-r--r--src/mame/video/fastfred.c64
-rw-r--r--src/mame/video/fastlane.c30
-rw-r--r--src/mame/video/fcombat.c22
-rw-r--r--src/mame/video/fgoal.c24
-rw-r--r--src/mame/video/finalizr.c26
-rw-r--r--src/mame/video/firetrap.c54
-rw-r--r--src/mame/video/firetrk.c92
-rw-r--r--src/mame/video/fitfight.c46
-rw-r--r--src/mame/video/flkatck.c18
-rw-r--r--src/mame/video/flower.c34
-rw-r--r--src/mame/video/flstory.c90
-rw-r--r--src/mame/video/foodf.c18
-rw-r--r--src/mame/video/freekick.c36
-rw-r--r--src/mame/video/fromanc2.c110
-rw-r--r--src/mame/video/fromance.c70
-rw-r--r--src/mame/video/funkybee.c38
-rw-r--r--src/mame/video/funkyjet.c6
-rw-r--r--src/mame/video/funworld.c14
-rw-r--r--src/mame/video/funybubl.c20
-rw-r--r--src/mame/video/fuukifg2.c42
-rw-r--r--src/mame/video/fuukifg3.c54
-rw-r--r--src/mame/video/gaelco.c30
-rw-r--r--src/mame/video/gaelco2.c42
-rw-r--r--src/mame/video/gaelco3d.c62
-rw-r--r--src/mame/video/gaiden.c122
-rw-r--r--src/mame/video/galaga.c44
-rw-r--r--src/mame/video/galastrm.c70
-rw-r--r--src/mame/video/galaxian.c96
-rw-r--r--src/mame/video/galaxold.c168
-rw-r--r--src/mame/video/galivan.c68
-rw-r--r--src/mame/video/galpani2.c32
-rw-r--r--src/mame/video/galpanic.c40
-rw-r--r--src/mame/video/galspnbl.c22
-rw-r--r--src/mame/video/gameplan.c34
-rw-r--r--src/mame/video/gaplus.c62
-rw-r--r--src/mame/video/gatron.c8
-rw-r--r--src/mame/video/gauntlet.c16
-rw-r--r--src/mame/video/gberet.c48
-rw-r--r--src/mame/video/gbusters.c12
-rw-r--r--src/mame/video/gcpinbal.c34
-rw-r--r--src/mame/video/genesis.c100
-rw-r--r--src/mame/video/gijoe.c16
-rw-r--r--src/mame/video/ginganin.c46
-rw-r--r--src/mame/video/gladiatr.c58
-rw-r--r--src/mame/video/glass.c26
-rw-r--r--src/mame/video/gng.c30
-rw-r--r--src/mame/video/goal92.c40
-rw-r--r--src/mame/video/goindol.c24
-rw-r--r--src/mame/video/goldstar.c74
-rw-r--r--src/mame/video/gomoku.c32
-rw-r--r--src/mame/video/gotcha.c32
-rw-r--r--src/mame/video/gottlieb.c60
-rw-r--r--src/mame/video/gotya.c42
-rw-r--r--src/mame/video/gp9001.c28
-rw-r--r--src/mame/video/gp9001.h6
-rw-r--r--src/mame/video/gradius3.c28
-rw-r--r--src/mame/video/grchamp.c52
-rw-r--r--src/mame/video/gridlee.c22
-rw-r--r--src/mame/video/groundfx.c24
-rw-r--r--src/mame/video/gstriker.c60
-rw-r--r--src/mame/video/gsword.c42
-rw-r--r--src/mame/video/gtia.c16
-rw-r--r--src/mame/video/gtia.h2
-rw-r--r--src/mame/video/gticlub.c88
-rw-r--r--src/mame/video/gticlub.h6
-rw-r--r--src/mame/video/gumbo.c12
-rw-r--r--src/mame/video/gunbustr.c32
-rw-r--r--src/mame/video/gundealr.c24
-rw-r--r--src/mame/video/gunsmoke.c46
-rw-r--r--src/mame/video/gyruss.c30
-rw-r--r--src/mame/video/hanaawas.c24
-rw-r--r--src/mame/video/harddriv.c54
-rw-r--r--src/mame/video/hcastle.c54
-rw-r--r--src/mame/video/hexion.c28
-rw-r--r--src/mame/video/higemaru.c38
-rw-r--r--src/mame/video/himesiki.c24
-rw-r--r--src/mame/video/hnayayoi.c44
-rw-r--r--src/mame/video/hng64.c144
-rw-r--r--src/mame/video/holeland.c42
-rw-r--r--src/mame/video/homedata.c156
-rw-r--r--src/mame/video/homerun.c26
-rw-r--r--src/mame/video/hyhoo.c26
-rw-r--r--src/mame/video/hyperspt.c44
-rw-r--r--src/mame/video/hyprduel.c108
-rw-r--r--src/mame/video/ikki.c36
-rw-r--r--src/mame/video/inufuku.c34
-rw-r--r--src/mame/video/iqblock.c16
-rw-r--r--src/mame/video/irobot.c30
-rw-r--r--src/mame/video/ironhors.c76
-rw-r--r--src/mame/video/itech32.c106
-rw-r--r--src/mame/video/itech8.c66
-rw-r--r--src/mame/video/jack.c38
-rw-r--r--src/mame/video/jackal.c44
-rw-r--r--src/mame/video/jagblit.c6
-rw-r--r--src/mame/video/jagobj.c10
-rw-r--r--src/mame/video/jaguar.c90
-rw-r--r--src/mame/video/jailbrek.c28
-rw-r--r--src/mame/video/jalblend.c6
-rw-r--r--src/mame/video/jalblend.h2
-rw-r--r--src/mame/video/jedi.c26
-rw-r--r--src/mame/video/jpmimpct.c16
-rw-r--r--src/mame/video/kan_panb.c38
-rw-r--r--src/mame/video/kan_pand.c8
-rw-r--r--src/mame/video/kaneko16.c80
-rw-r--r--src/mame/video/kangaroo.c28
-rw-r--r--src/mame/video/karnov.c52
-rw-r--r--src/mame/video/kchamp.c36
-rw-r--r--src/mame/video/kickgoal.c42
-rw-r--r--src/mame/video/kingobox.c58
-rw-r--r--src/mame/video/klax.c6
-rw-r--r--src/mame/video/kncljoe.c40
-rw-r--r--src/mame/video/konamigx.c160
-rw-r--r--src/mame/video/konamiic.c420
-rw-r--r--src/mame/video/konamiic.h66
-rw-r--r--src/mame/video/konicdev.c426
-rw-r--r--src/mame/video/konicdev.h20
-rw-r--r--src/mame/video/kopunch.c20
-rw-r--r--src/mame/video/ksayakyu.c26
-rw-r--r--src/mame/video/kyugo.c36
-rw-r--r--src/mame/video/labyrunr.c38
-rw-r--r--src/mame/video/ladybug.c80
-rw-r--r--src/mame/video/ladyfrog.c52
-rw-r--r--src/mame/video/lasso.c82
-rw-r--r--src/mame/video/lastduel.c66
-rw-r--r--src/mame/video/lazercmd.c10
-rw-r--r--src/mame/video/legionna.c84
-rw-r--r--src/mame/video/leland.c62
-rw-r--r--src/mame/video/lemmings.c40
-rw-r--r--src/mame/video/lethal.c16
-rw-r--r--src/mame/video/lethalj.c22
-rw-r--r--src/mame/video/liberate.c86
-rw-r--r--src/mame/video/liberatr.c12
-rw-r--r--src/mame/video/lkage.c28
-rw-r--r--src/mame/video/lockon.c82
-rw-r--r--src/mame/video/lordgun.c60
-rw-r--r--src/mame/video/lsasquad.c44
-rw-r--r--src/mame/video/lucky74.c16
-rw-r--r--src/mame/video/lvcards.c46
-rw-r--r--src/mame/video/lwings.c58
-rw-r--r--src/mame/video/m10.c30
-rw-r--r--src/mame/video/m107.c52
-rw-r--r--src/mame/video/m52.c92
-rw-r--r--src/mame/video/m57.c40
-rw-r--r--src/mame/video/m58.c56
-rw-r--r--src/mame/video/m62.c168
-rw-r--r--src/mame/video/m72.c118
-rw-r--r--src/mame/video/m90.c78
-rw-r--r--src/mame/video/m92.c78
-rw-r--r--src/mame/video/macrossp.c64
-rw-r--r--src/mame/video/madalien.c58
-rw-r--r--src/mame/video/madmotor.c14
-rw-r--r--src/mame/video/magmax.c32
-rw-r--r--src/mame/video/mainevt.c26
-rw-r--r--src/mame/video/mainsnk.c26
-rw-r--r--src/mame/video/malzak.c6
-rw-r--r--src/mame/video/mappy.c84
-rw-r--r--src/mame/video/marineb.c80
-rw-r--r--src/mame/video/mario.c44
-rw-r--r--src/mame/video/markham.c30
-rw-r--r--src/mame/video/matmania.c32
-rw-r--r--src/mame/video/mcatadv.c34
-rw-r--r--src/mame/video/mcd212.c116
-rw-r--r--src/mame/video/mcd212.h4
-rw-r--r--src/mame/video/mcr.c62
-rw-r--r--src/mame/video/mcr3.c56
-rw-r--r--src/mame/video/mcr68.c78
-rw-r--r--src/mame/video/meadows.c22
-rw-r--r--src/mame/video/megasys1.c70
-rw-r--r--src/mame/video/megazone.c24
-rw-r--r--src/mame/video/mermaid.c112
-rw-r--r--src/mame/video/metlclsh.c30
-rw-r--r--src/mame/video/metro.c80
-rw-r--r--src/mame/video/mexico86.c16
-rw-r--r--src/mame/video/micro3d.c36
-rw-r--r--src/mame/video/midtunit.c14
-rw-r--r--src/mame/video/midvunit.c60
-rw-r--r--src/mame/video/midyunit.c58
-rw-r--r--src/mame/video/midzeus.c56
-rw-r--r--src/mame/video/midzeus2.c52
-rw-r--r--src/mame/video/mikie.c34
-rw-r--r--src/mame/video/mitchell.c66
-rw-r--r--src/mame/video/mjkjidai.c30
-rw-r--r--src/mame/video/model1.c82
-rw-r--r--src/mame/video/model2.c50
-rw-r--r--src/mame/video/model3.c156
-rw-r--r--src/mame/video/momoko.c48
-rw-r--r--src/mame/video/moo.c18
-rw-r--r--src/mame/video/mosaic.c12
-rw-r--r--src/mame/video/mouser.c28
-rw-r--r--src/mame/video/mrdo.c36
-rw-r--r--src/mame/video/mrflea.c24
-rw-r--r--src/mame/video/mrjong.c30
-rw-r--r--src/mame/video/ms32.c72
-rw-r--r--src/mame/video/msisaac.c40
-rw-r--r--src/mame/video/mugsmash.c22
-rw-r--r--src/mame/video/munchmo.c36
-rw-r--r--src/mame/video/mustache.c30
-rw-r--r--src/mame/video/mw8080bw.c12
-rw-r--r--src/mame/video/mystston.c40
-rw-r--r--src/mame/video/mystwarr.c100
-rw-r--r--src/mame/video/n64.c24
-rw-r--r--src/mame/video/n64.h4
-rw-r--r--src/mame/video/n8080.c50
-rw-r--r--src/mame/video/namcofl.c20
-rw-r--r--src/mame/video/namcona1.c86
-rw-r--r--src/mame/video/namconb1.c42
-rw-r--r--src/mame/video/namcos1.c70
-rw-r--r--src/mame/video/namcos2.c60
-rw-r--r--src/mame/video/namcos21.c30
-rw-r--r--src/mame/video/namcos22.c128
-rw-r--r--src/mame/video/namcos86.c72
-rw-r--r--src/mame/video/naughtyb.c30
-rw-r--r--src/mame/video/nbmj8688.c70
-rw-r--r--src/mame/video/nbmj8891.c114
-rw-r--r--src/mame/video/nbmj8900.c96
-rw-r--r--src/mame/video/nbmj8991.c94
-rw-r--r--src/mame/video/nbmj9195.c96
-rw-r--r--src/mame/video/nemesis.c78
-rw-r--r--src/mame/video/neogeo.c156
-rw-r--r--src/mame/video/news.c14
-rw-r--r--src/mame/video/ninjakd2.c90
-rw-r--r--src/mame/video/ninjaw.c16
-rw-r--r--src/mame/video/nitedrvr.c16
-rw-r--r--src/mame/video/niyanpai.c102
-rw-r--r--src/mame/video/nmk16.c218
-rw-r--r--src/mame/video/nova2001.c66
-rw-r--r--src/mame/video/nycaptor.c100
-rw-r--r--src/mame/video/offtwall.c6
-rw-r--r--src/mame/video/ohmygod.c22
-rw-r--r--src/mame/video/ojankohs.c62
-rw-r--r--src/mame/video/oneshot.c38
-rw-r--r--src/mame/video/opwolf.c6
-rw-r--r--src/mame/video/orbit.c18
-rw-r--r--src/mame/video/othldrby.c40
-rw-r--r--src/mame/video/othunder.c22
-rw-r--r--src/mame/video/overdriv.c16
-rw-r--r--src/mame/video/pacland.c84
-rw-r--r--src/mame/video/pacman.c104
-rw-r--r--src/mame/video/pandoras.c32
-rw-r--r--src/mame/video/paradise.c82
-rw-r--r--src/mame/video/parodius.c12
-rw-r--r--src/mame/video/pass.c12
-rw-r--r--src/mame/video/pastelg.c64
-rw-r--r--src/mame/video/pbaction.c30
-rw-r--r--src/mame/video/pcktgal.c26
-rw-r--r--src/mame/video/pgm.c36
-rw-r--r--src/mame/video/phoenix.c64
-rw-r--r--src/mame/video/pingpong.c28
-rw-r--r--src/mame/video/pirates.c24
-rw-r--r--src/mame/video/pitnrun.c66
-rw-r--r--src/mame/video/pktgaldx.c18
-rw-r--r--src/mame/video/playch10.c22
-rw-r--r--src/mame/video/playmark.c120
-rw-r--r--src/mame/video/plygonet.c26
-rw-r--r--src/mame/video/pokechmp.c22
-rw-r--r--src/mame/video/polepos.c88
-rw-r--r--src/mame/video/policetr.c40
-rw-r--r--src/mame/video/polyplay.c12
-rw-r--r--src/mame/video/poolshrk.c8
-rw-r--r--src/mame/video/pooyan.c30
-rw-r--r--src/mame/video/popeye.c52
-rw-r--r--src/mame/video/popper.c42
-rw-r--r--src/mame/video/portrait.c34
-rw-r--r--src/mame/video/powerins.c42
-rw-r--r--src/mame/video/ppu2c0x.c34
-rw-r--r--src/mame/video/ppu2c0x.h4
-rw-r--r--src/mame/video/prehisle.c44
-rw-r--r--src/mame/video/psikyo.c84
-rw-r--r--src/mame/video/psikyo4.c18
-rw-r--r--src/mame/video/psikyosh.c74
-rw-r--r--src/mame/video/psx.c88
-rw-r--r--src/mame/video/psychic5.c80
-rw-r--r--src/mame/video/punchout.c92
-rw-r--r--src/mame/video/pushman.c20
-rw-r--r--src/mame/video/qdrmfgp.c14
-rw-r--r--src/mame/video/qix.c40
-rw-r--r--src/mame/video/quasar.c32
-rw-r--r--src/mame/video/quizdna.c46
-rw-r--r--src/mame/video/quizpani.c14
-rw-r--r--src/mame/video/raiden.c38
-rw-r--r--src/mame/video/rainbow.c18
-rw-r--r--src/mame/video/rallyx.c158
-rw-r--r--src/mame/video/rampart.c8
-rw-r--r--src/mame/video/rastan.c14
-rw-r--r--src/mame/video/rdpblend.h2
-rw-r--r--src/mame/video/rdpspn16.c8
-rw-r--r--src/mame/video/rdpspn16.h2
-rw-r--r--src/mame/video/rdptpipe.c6
-rw-r--r--src/mame/video/rdptpipe.h2
-rw-r--r--src/mame/video/rdptri.h4
-rw-r--r--src/mame/video/realbrk.c88
-rw-r--r--src/mame/video/redalert.c26
-rw-r--r--src/mame/video/redclash.c88
-rw-r--r--src/mame/video/relief.c12
-rw-r--r--src/mame/video/renegade.c28
-rw-r--r--src/mame/video/retofinv.c36
-rw-r--r--src/mame/video/rockrage.c32
-rw-r--r--src/mame/video/rocnrope.c32
-rw-r--r--src/mame/video/rohga.c68
-rw-r--r--src/mame/video/rollerg.c14
-rw-r--r--src/mame/video/rollrace.c42
-rw-r--r--src/mame/video/route16.c24
-rw-r--r--src/mame/video/rpunch.c44
-rw-r--r--src/mame/video/runaway.c26
-rw-r--r--src/mame/video/rungun.c26
-rw-r--r--src/mame/video/sauro.c46
-rw-r--r--src/mame/video/sbasketb.c32
-rw-r--r--src/mame/video/sbugger.c16
-rw-r--r--src/mame/video/scotrsht.c34
-rw-r--r--src/mame/video/sderby.c34
-rw-r--r--src/mame/video/sega16sp.c118
-rw-r--r--src/mame/video/segag80r.c128
-rw-r--r--src/mame/video/segag80v.c14
-rw-r--r--src/mame/video/segahang.c4
-rw-r--r--src/mame/video/segaic16.c74
-rw-r--r--src/mame/video/segaic16.h56
-rw-r--r--src/mame/video/segaic24.c46
-rw-r--r--src/mame/video/segaic24.h10
-rw-r--r--src/mame/video/segaorun.c6
-rw-r--r--src/mame/video/segas16a.c4
-rw-r--r--src/mame/video/segas16b.c6
-rw-r--r--src/mame/video/segas18.c58
-rw-r--r--src/mame/video/segas24.c8
-rw-r--r--src/mame/video/segas32.c132
-rw-r--r--src/mame/video/segaxbd.c6
-rw-r--r--src/mame/video/segaybd.c8
-rw-r--r--src/mame/video/sei_crtc.c18
-rw-r--r--src/mame/video/seibuspi.c90
-rw-r--r--src/mame/video/seicross.c26
-rw-r--r--src/mame/video/senjyo.c58
-rw-r--r--src/mame/video/seta.c186
-rw-r--r--src/mame/video/seta2.c50
-rw-r--r--src/mame/video/sf.c36
-rw-r--r--src/mame/video/shadfrce.c46
-rw-r--r--src/mame/video/shangha3.c26
-rw-r--r--src/mame/video/shangkid.c48
-rw-r--r--src/mame/video/shaolins.c40
-rw-r--r--src/mame/video/shisen.c22
-rw-r--r--src/mame/video/shootout.c34
-rw-r--r--src/mame/video/shuuz.c6
-rw-r--r--src/mame/video/sidearms.c66
-rw-r--r--src/mame/video/sidepckt.c32
-rw-r--r--src/mame/video/silkroad.c30
-rw-r--r--src/mame/video/simpl156.c14
-rw-r--r--src/mame/video/simpsons.c28
-rw-r--r--src/mame/video/sknsspr.c10
-rw-r--r--src/mame/video/sknsspr.h4
-rw-r--r--src/mame/video/skullxbo.c30
-rw-r--r--src/mame/video/skydiver.c32
-rw-r--r--src/mame/video/skyfox.c24
-rw-r--r--src/mame/video/skykid.c46
-rw-r--r--src/mame/video/skyraid.c44
-rw-r--r--src/mame/video/slapfght.c60
-rw-r--r--src/mame/video/slapshot.c42
-rw-r--r--src/mame/video/snes.c72
-rw-r--r--src/mame/video/snk.c196
-rw-r--r--src/mame/video/snk6502.c68
-rw-r--r--src/mame/video/snk68.c58
-rw-r--r--src/mame/video/snookr10.c18
-rw-r--r--src/mame/video/solomon.c30
-rw-r--r--src/mame/video/sonson.c34
-rw-r--r--src/mame/video/spacefb.c40
-rw-r--r--src/mame/video/spbactn.c42
-rw-r--r--src/mame/video/spcforce.c8
-rw-r--r--src/mame/video/spdodgeb.c40
-rw-r--r--src/mame/video/speedatk.c20
-rw-r--r--src/mame/video/speedbal.c20
-rw-r--r--src/mame/video/speedspn.c26
-rw-r--r--src/mame/video/splash.c36
-rw-r--r--src/mame/video/sprcros2.c36
-rw-r--r--src/mame/video/sprint2.c78
-rw-r--r--src/mame/video/sprint4.c66
-rw-r--r--src/mame/video/sprint8.c46
-rw-r--r--src/mame/video/spy.c14
-rw-r--r--src/mame/video/srmp2.c58
-rw-r--r--src/mame/video/srumbler.c32
-rw-r--r--src/mame/video/sshangha.c28
-rw-r--r--src/mame/video/sslam.c44
-rw-r--r--src/mame/video/ssozumo.c32
-rw-r--r--src/mame/video/sspeedr.c52
-rw-r--r--src/mame/video/ssrj.c24
-rw-r--r--src/mame/video/ssv.c68
-rw-r--r--src/mame/video/st0016.c44
-rw-r--r--src/mame/video/stactics.c24
-rw-r--r--src/mame/video/stadhero.c16
-rw-r--r--src/mame/video/starcrus.c102
-rw-r--r--src/mame/video/starfire.c26
-rw-r--r--src/mame/video/starshp1.c70
-rw-r--r--src/mame/video/stfight.c52
-rw-r--r--src/mame/video/stlforce.c28
-rw-r--r--src/mame/video/strnskil.c34
-rw-r--r--src/mame/video/stvvdp1.c48
-rw-r--r--src/mame/video/stvvdp2.c304
-rw-r--r--src/mame/video/subs.c36
-rw-r--r--src/mame/video/suna16.c42
-rw-r--r--src/mame/video/suna8.c70
-rw-r--r--src/mame/video/supbtime.c6
-rw-r--r--src/mame/video/superchs.c32
-rw-r--r--src/mame/video/superqix.c56
-rw-r--r--src/mame/video/suprloco.c34
-rw-r--r--src/mame/video/suprnova.c24
-rw-r--r--src/mame/video/suprridr.c32
-rw-r--r--src/mame/video/suprslam.c26
-rw-r--r--src/mame/video/surpratk.c12
-rw-r--r--src/mame/video/system1.c76
-rw-r--r--src/mame/video/system16.c78
-rw-r--r--src/mame/video/tagteam.c34
-rw-r--r--src/mame/video/tail2nos.c34
-rw-r--r--src/mame/video/taito_b.c52
-rw-r--r--src/mame/video/taito_f2.c132
-rw-r--r--src/mame/video/taito_f3.c182
-rw-r--r--src/mame/video/taito_h.c66
-rw-r--r--src/mame/video/taito_l.c84
-rw-r--r--src/mame/video/taito_o.c12
-rw-r--r--src/mame/video/taito_z.c118
-rw-r--r--src/mame/video/taitoair.c24
-rw-r--r--src/mame/video/taitoic.c104
-rw-r--r--src/mame/video/taitojc.c60
-rw-r--r--src/mame/video/taitosj.c114
-rw-r--r--src/mame/video/tank8.c56
-rw-r--r--src/mame/video/tankbatt.c24
-rw-r--r--src/mame/video/tankbust.c32
-rw-r--r--src/mame/video/taotaido.c26
-rw-r--r--src/mame/video/targeth.c18
-rw-r--r--src/mame/video/tatsumi.c166
-rw-r--r--src/mame/video/taxidrvr.c12
-rw-r--r--src/mame/video/tbowl.c52
-rw-r--r--src/mame/video/tceptor.c94
-rw-r--r--src/mame/video/tecmo.c38
-rw-r--r--src/mame/video/tecmo16.c102
-rw-r--r--src/mame/video/tehkanwc.c40
-rw-r--r--src/mame/video/terracre.c44
-rw-r--r--src/mame/video/tetrisp2.c88
-rw-r--r--src/mame/video/thedeep.c22
-rw-r--r--src/mame/video/thepit.c36
-rw-r--r--src/mame/video/thief.c34
-rw-r--r--src/mame/video/thoop2.c32
-rw-r--r--src/mame/video/thunderj.c12
-rw-r--r--src/mame/video/thunderx.c14
-rw-r--r--src/mame/video/tia.c36
-rw-r--r--src/mame/video/tia.h2
-rw-r--r--src/mame/video/tiamc1.c44
-rw-r--r--src/mame/video/tigeroad.c44
-rw-r--r--src/mame/video/timelimt.c28
-rw-r--r--src/mame/video/timeplt.c26
-rw-r--r--src/mame/video/tmnt.c172
-rw-r--r--src/mame/video/tnzs.c26
-rw-r--r--src/mame/video/toaplan1.c148
-rw-r--r--src/mame/video/toaplan2.c80
-rw-r--r--src/mame/video/toki.c48
-rw-r--r--src/mame/video/toobin.c42
-rw-r--r--src/mame/video/topspeed.c24
-rw-r--r--src/mame/video/toypop.c46
-rw-r--r--src/mame/video/tp84.c34
-rw-r--r--src/mame/video/trackfld.c44
-rw-r--r--src/mame/video/travrusa.c56
-rw-r--r--src/mame/video/triplhnt.c20
-rw-r--r--src/mame/video/truco.c4
-rw-r--r--src/mame/video/trucocl.c10
-rw-r--r--src/mame/video/tryout.c40
-rw-r--r--src/mame/video/tsamurai.c46
-rw-r--r--src/mame/video/tubep.c52
-rw-r--r--src/mame/video/tumbleb.c170
-rw-r--r--src/mame/video/tumblep.c6
-rw-r--r--src/mame/video/tunhunt.c68
-rw-r--r--src/mame/video/turbo.c64
-rw-r--r--src/mame/video/tutankhm.c12
-rw-r--r--src/mame/video/twin16.c78
-rw-r--r--src/mame/video/twincobr.c86
-rw-r--r--src/mame/video/tx1.c172
-rw-r--r--src/mame/video/ultraman.c32
-rw-r--r--src/mame/video/ultratnk.c64
-rw-r--r--src/mame/video/undrfire.c78
-rw-r--r--src/mame/video/unico.c68
-rw-r--r--src/mame/video/usgames.c14
-rw-r--r--src/mame/video/vaportra.c34
-rw-r--r--src/mame/video/vastar.c36
-rw-r--r--src/mame/video/vball.c36
-rw-r--r--src/mame/video/vdc.c52
-rw-r--r--src/mame/video/vendetta.c16
-rw-r--r--src/mame/video/vertigo.c22
-rw-r--r--src/mame/video/vicdual.c12
-rw-r--r--src/mame/video/victory.c98
-rw-r--r--src/mame/video/videopin.c12
-rw-r--r--src/mame/video/vigilant.c84
-rw-r--r--src/mame/video/vindictr.c18
-rw-r--r--src/mame/video/volfied.c26
-rw-r--r--src/mame/video/vrender0.c2
-rw-r--r--src/mame/video/vsnes.c8
-rw-r--r--src/mame/video/vulgus.c54
-rw-r--r--src/mame/video/warpwarp.c24
-rw-r--r--src/mame/video/warriorb.c18
-rw-r--r--src/mame/video/wc90.c58
-rw-r--r--src/mame/video/wc90b.c26
-rw-r--r--src/mame/video/wecleman.c112
-rw-r--r--src/mame/video/welltris.c48
-rw-r--r--src/mame/video/wgp.c54
-rw-r--r--src/mame/video/williams.c80
-rw-r--r--src/mame/video/wiping.c20
-rw-r--r--src/mame/video/wiz.c78
-rw-r--r--src/mame/video/wolfpack.c104
-rw-r--r--src/mame/video/wrally.c20
-rw-r--r--src/mame/video/wwfsstar.c20
-rw-r--r--src/mame/video/wwfwfest.c32
-rw-r--r--src/mame/video/xain.c52
-rw-r--r--src/mame/video/xevious.c74
-rw-r--r--src/mame/video/xexex.c16
-rw-r--r--src/mame/video/xmen.c22
-rw-r--r--src/mame/video/xorworld.c34
-rw-r--r--src/mame/video/xxmissio.c26
-rw-r--r--src/mame/video/xybots.c8
-rw-r--r--src/mame/video/xyonix.c10
-rw-r--r--src/mame/video/ygv608.c66
-rw-r--r--src/mame/video/yiear.c30
-rw-r--r--src/mame/video/yunsun16.c26
-rw-r--r--src/mame/video/yunsung8.c24
-rw-r--r--src/mame/video/zac2650.c70
-rw-r--r--src/mame/video/zaccaria.c34
-rw-r--r--src/mame/video/zaxxon.c82
-rw-r--r--src/mame/video/zerozone.c10
-rw-r--r--src/mame/video/zodiack.c52
-rw-r--r--src/osd/sdl/debugosx.h28
-rw-r--r--src/osd/sdl/debugwin.c46
-rw-r--r--src/osd/sdl/debugwin.h2
-rw-r--r--src/osd/sdl/drawogl.c16
-rw-r--r--src/osd/sdl/dview.c4
-rw-r--r--src/osd/sdl/dview.h2
-rw-r--r--src/osd/sdl/input.c58
-rw-r--r--src/osd/sdl/input.h12
-rw-r--r--src/osd/sdl/osdsdl.h2
-rw-r--r--src/osd/sdl/output.c8
-rw-r--r--src/osd/sdl/output.h2
-rw-r--r--src/osd/sdl/sdlmain.c14
-rw-r--r--src/osd/sdl/sound.c26
-rw-r--r--src/osd/sdl/video.c36
-rw-r--r--src/osd/sdl/video.h2
-rw-r--r--src/osd/sdl/window.c69
-rw-r--r--src/osd/sdl/window.h13
-rw-r--r--src/osd/windows/debugwin.c122
-rw-r--r--src/osd/windows/debugwin.h2
-rw-r--r--src/osd/windows/drawd3d.c6
-rw-r--r--src/osd/windows/drawdd.c6
-rw-r--r--src/osd/windows/input.c78
-rw-r--r--src/osd/windows/input.h4
-rw-r--r--src/osd/windows/output.c14
-rw-r--r--src/osd/windows/output.h2
-rw-r--r--src/osd/windows/sound.c14
-rw-r--r--src/osd/windows/sound.h2
-rw-r--r--src/osd/windows/video.c28
-rw-r--r--src/osd/windows/video.h2
-rw-r--r--src/osd/windows/window.c84
-rw-r--r--src/osd/windows/window.h24
-rw-r--r--src/osd/windows/winmain.c12
-rw-r--r--src/osd/windows/winmenu.c2
2557 files changed, 54180 insertions, 54127 deletions
diff --git a/src/emu/audio/generic.c b/src/emu/audio/generic.c
index fc2919d9e54..a40474d9da2 100644
--- a/src/emu/audio/generic.c
+++ b/src/emu/audio/generic.c
@@ -35,11 +35,11 @@ struct _generic_audio_private
register for save states
-------------------------------------------------*/
-int generic_sound_init(running_machine *machine)
+int generic_sound_init(running_machine &machine)
{
generic_audio_private *state;
- state = machine->generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
+ state = machine.generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
/* register globals with the save state system */
state_save_register_global_array(machine, state->latched_value);
@@ -67,7 +67,7 @@ int generic_sound_init(running_machine *machine)
static TIMER_CALLBACK( latch_callback )
{
- generic_audio_private *state = machine->generic_audio_data;
+ generic_audio_private *state = machine.generic_audio_data;
UINT16 value = param >> 8;
int which = param & 0xff;
@@ -87,7 +87,7 @@ static TIMER_CALLBACK( latch_callback )
INLINE void latch_w(address_space *space, int which, UINT16 value)
{
- space->machine->scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
+ space->machine().scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
}
@@ -97,7 +97,7 @@ INLINE void latch_w(address_space *space, int which, UINT16 value)
INLINE UINT16 latch_r(address_space *space, int which)
{
- generic_audio_private *state = space->machine->generic_audio_data;
+ generic_audio_private *state = space->machine().generic_audio_data;
state->latch_read[which] = 1;
return state->latched_value[which];
}
@@ -109,7 +109,7 @@ INLINE UINT16 latch_r(address_space *space, int which)
INLINE void latch_clear(address_space *space, int which)
{
- generic_audio_private *state = space->machine->generic_audio_data;
+ generic_audio_private *state = space->machine().generic_audio_data;
state->latched_value[which] = state->latch_clear_value;
}
@@ -160,9 +160,9 @@ WRITE8_HANDLER( soundlatch4_clear_w ) { latch_clear(space, 3); }
value for all sound latches
-------------------------------------------------*/
-void soundlatch_setclearedvalue(running_machine *machine, int value)
+void soundlatch_setclearedvalue(running_machine &machine, int value)
{
- generic_audio_private *state = machine->generic_audio_data;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
+ generic_audio_private *state = machine.generic_audio_data;
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
state->latch_clear_value = value;
}
diff --git a/src/emu/audio/generic.h b/src/emu/audio/generic.h
index 319eb2d450f..d693e723d40 100644
--- a/src/emu/audio/generic.h
+++ b/src/emu/audio/generic.h
@@ -22,7 +22,7 @@
***************************************************************************/
-int generic_sound_init(running_machine *machine);
+int generic_sound_init(running_machine &machine);
/* latch readers */
READ8_HANDLER( soundlatch_r );
@@ -53,7 +53,7 @@ WRITE8_HANDLER( soundlatch4_clear_w );
/* If you're going to use soundlatchX_clear_w, and the cleared value is
something other than 0x00, use this function from machine_init. Note
that this one call effects all 4 latches */
-void soundlatch_setclearedvalue(running_machine *machine, int value);
+void soundlatch_setclearedvalue(running_machine &machine, int value);
#endif /* __SOUND_GENERIC_H__ */
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index 2391b8c53a8..e26b1ad0af6 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -190,7 +190,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols,
int format = xml_get_attribute_int_format(itemnode, "value");
// allocate and append a new item
- item &curitem = m_itemlist.append(*auto_alloc(&manager.machine(), item(itemnode->value, value, format)));
+ item &curitem = m_itemlist.append(*auto_alloc(manager.machine(), item(itemnode->value, value, format)));
// ensure the maximum expands to suit
m_maxval = MAX(m_maxval, curitem.value());
@@ -366,11 +366,11 @@ cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const
{
// handle action nodes
if (strcmp(entrynode->name, "action") == 0)
- m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
+ m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
// handle output nodes
else if (strcmp(entrynode->name, "output") == 0)
- m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
+ m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
// anything else is ignored
else
@@ -476,7 +476,7 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
int totalargs = 0;
for (xml_data_node *argnode = xml_get_sibling(entrynode.child, "argument"); argnode != NULL; argnode = xml_get_sibling(argnode->next, "argument"))
{
- output_argument &curarg = m_arglist.append(*auto_alloc(&manager.machine(), output_argument(manager, symbols, filename, *argnode)));
+ output_argument &curarg = m_arglist.append(*auto_alloc(manager.machine(), output_argument(manager, symbols, filename, *argnode)));
// verify we didn't overrun the argument count
totalargs += curarg.count();
@@ -766,7 +766,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
if (paramnode != NULL)
{
// load this parameter
- m_parameter = auto_alloc(&manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
+ m_parameter = auto_alloc(manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
// only one parameter allowed
paramnode = xml_get_sibling(paramnode->next, "parameter");
@@ -778,7 +778,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
for (xml_data_node *scriptnode = xml_get_sibling(cheatnode.child, "script"); scriptnode != NULL; scriptnode = xml_get_sibling(scriptnode->next, "script"))
{
// load this entry
- cheat_script *curscript = auto_alloc(&manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
+ cheat_script *curscript = auto_alloc(manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
// if we have a script already for this slot, it is an error
cheat_script *&slot = script_for_state(curscript->state());
@@ -803,11 +803,11 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
cheat_entry::~cheat_entry()
{
- auto_free(&m_manager.machine(), m_on_script);
- auto_free(&m_manager.machine(), m_off_script);
- auto_free(&m_manager.machine(), m_change_script);
- auto_free(&m_manager.machine(), m_run_script);
- auto_free(&m_manager.machine(), m_parameter);
+ auto_free(m_manager.machine(), m_on_script);
+ auto_free(m_manager.machine(), m_off_script);
+ auto_free(m_manager.machine(), m_change_script);
+ auto_free(m_manager.machine(), m_run_script);
+ auto_free(m_manager.machine(), m_parameter);
}
@@ -1107,7 +1107,7 @@ cheat_manager::cheat_manager(running_machine &machine)
// we rely on the debugger expression callbacks; if the debugger isn't
// enabled, we must jumpstart them manually
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
- debug_cpu_init(&machine);
+ debug_cpu_init(machine);
// configure for memory access (shared with debugger)
debug_cpu_configure_memory(machine, m_symtable);
@@ -1446,7 +1446,7 @@ void cheat_manager::load_cheats(const char *filename)
for (xml_data_node *cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat"))
{
// load this entry
- cheat_entry *curcheat = auto_alloc(&m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
+ cheat_entry *curcheat = auto_alloc(m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
// make sure we're not a duplicate
cheat_entry *scannode = NULL;
@@ -1462,7 +1462,7 @@ void cheat_manager::load_cheats(const char *filename)
if (scannode == NULL)
m_cheatlist.append(*curcheat);
else
- auto_free(&m_machine, curcheat);
+ auto_free(m_machine, curcheat);
}
// free the file and loop for the next one
diff --git a/src/emu/config.c b/src/emu/config.c
index af7ea10f395..3f1b7e18d93 100644
--- a/src/emu/config.c
+++ b/src/emu/config.c
@@ -46,8 +46,8 @@ static config_type *typelist;
FUNCTION PROTOTYPES
***************************************************************************/
-static int config_load_xml(running_machine *machine, emu_file &file, int type);
-static int config_save_xml(running_machine *machine, emu_file &file, int type);
+static int config_load_xml(running_machine &machine, emu_file &file, int type);
+static int config_save_xml(running_machine &machine, emu_file &file, int type);
@@ -61,7 +61,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int type);
*
*************************************/
-void config_init(running_machine *machine)
+void config_init(running_machine &machine)
{
typelist = NULL;
}
@@ -75,7 +75,7 @@ void config_init(running_machine *machine)
*
*************************************/
-void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save)
+void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save)
{
config_type *newtype;
config_type **ptype;
@@ -100,9 +100,9 @@ void config_register(running_machine *machine, const char *nodename, config_call
*
*************************************/
-int config_load_settings(running_machine *machine)
+int config_load_settings(running_machine &machine)
{
- const char *controller = machine->options().ctrlr();
+ const char *controller = machine.options().ctrlr();
config_type *type;
int loaded = 0;
@@ -114,7 +114,7 @@ int config_load_settings(running_machine *machine)
if (controller[0] != 0)
{
/* open the config file */
- emu_file file(machine->options().ctrlr_path(), OPEN_FLAG_READ);
+ emu_file file(machine.options().ctrlr_path(), OPEN_FLAG_READ);
file_error filerr = file.open(controller, ".cfg");
if (filerr != FILERR_NONE)
@@ -126,13 +126,13 @@ int config_load_settings(running_machine *machine)
}
/* next load the defaults file */
- emu_file file(machine->options().cfg_directory(), OPEN_FLAG_READ);
+ emu_file file(machine.options().cfg_directory(), OPEN_FLAG_READ);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_load_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, load the game-specific file */
- filerr = file.open(machine->basename(), ".cfg");
+ filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
loaded = config_load_xml(machine, file, CONFIG_TYPE_GAME);
@@ -146,7 +146,7 @@ int config_load_settings(running_machine *machine)
}
-void config_save_settings(running_machine *machine)
+void config_save_settings(running_machine &machine)
{
config_type *type;
@@ -155,13 +155,13 @@ void config_save_settings(running_machine *machine)
(*type->save)(machine, CONFIG_TYPE_INIT, NULL);
/* save the defaults file */
- emu_file file(machine->options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, save the game-specific file */
- filerr = file.open(machine->basename(), ".cfg");
+ filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_GAME);
@@ -178,7 +178,7 @@ void config_save_settings(running_machine *machine)
*
*************************************/
-static int config_load_xml(running_machine *machine, emu_file &file, int which_type)
+static int config_load_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root, *confignode, *systemnode;
config_type *type;
@@ -201,13 +201,13 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
goto error;
/* strip off all the path crap from the source filename */
- srcfile = strrchr(machine->system().source_file, '/');
+ srcfile = strrchr(machine.system().source_file, '/');
if (!srcfile)
- srcfile = strrchr(machine->system().source_file, '\\');
+ srcfile = strrchr(machine.system().source_file, '\\');
if (!srcfile)
- srcfile = strrchr(machine->system().source_file, ':');
+ srcfile = strrchr(machine.system().source_file, ':');
if (!srcfile)
- srcfile = machine->system().source_file;
+ srcfile = machine.system().source_file;
else
srcfile++;
@@ -223,7 +223,7 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
{
case CONFIG_TYPE_GAME:
/* only match on the specific game name */
- if (strcmp(name, machine->system().name) != 0)
+ if (strcmp(name, machine.system().name) != 0)
continue;
break;
@@ -238,9 +238,9 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
const game_driver *clone_of;
/* match on: default, game name, source file name, parent name, grandparent name */
if (strcmp(name, "default") != 0 &&
- strcmp(name, machine->system().name) != 0 &&
+ strcmp(name, machine.system().name) != 0 &&
strcmp(name, srcfile) != 0 &&
- ((clone_of = driver_get_clone(&machine->system())) == NULL || strcmp(name, clone_of->name) != 0) &&
+ ((clone_of = driver_get_clone(&machine.system())) == NULL || strcmp(name, clone_of->name) != 0) &&
(clone_of == NULL || ((clone_of = driver_get_clone(clone_of)) == NULL) || strcmp(name, clone_of->name) != 0))
continue;
break;
@@ -279,7 +279,7 @@ error:
*
*************************************/
-static int config_save_xml(running_machine *machine, emu_file &file, int which_type)
+static int config_save_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root = xml_file_create();
xml_data_node *confignode, *systemnode;
@@ -299,7 +299,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int which_t
systemnode = xml_add_child(confignode, "system", NULL);
if (!systemnode)
goto error;
- xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine->system().name);
+ xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine.system().name);
/* create the input node and write it out */
/* loop over all registrants and call their save function */
diff --git a/src/emu/config.h b/src/emu/config.h
index c34bb1bea6b..4dc13486b6c 100644
--- a/src/emu/config.h
+++ b/src/emu/config.h
@@ -43,7 +43,7 @@ enum
*
*************************************/
-typedef void (*config_callback_func)(running_machine *machine, int config_type, xml_data_node *parentnode);
+typedef void (*config_callback_func)(running_machine &machine, int config_type, xml_data_node *parentnode);
@@ -53,9 +53,9 @@ typedef void (*config_callback_func)(running_machine *machine, int config_type,
*
*************************************/
-void config_init(running_machine *machine);
-void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save);
-int config_load_settings(running_machine *machine);
-void config_save_settings(running_machine *machine);
+void config_init(running_machine &machine);
+void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save);
+int config_load_settings(running_machine &machine);
+void config_save_settings(running_machine &machine);
#endif /* __CONFIG_H__ */
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index 2b4804cd13e..fb38ee505da 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -211,17 +211,17 @@ device_config *adsp2181_device_config::static_alloc_device_config(const machine_
device_t *adsp2100_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2100_device(machine, *this));
+ return auto_alloc(machine, adsp2100_device(machine, *this));
}
device_t *adsp2101_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2101_device(machine, *this));
+ return auto_alloc(machine, adsp2101_device(machine, *this));
}
device_t *adsp2181_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2181_device(machine, *this));
+ return auto_alloc(machine, adsp2181_device(machine, *this));
}
diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c
index b947f79ac6f..fb95ddf6c10 100644
--- a/src/emu/cpu/alph8201/alph8201.c
+++ b/src/emu/cpu/alph8201/alph8201.c
@@ -298,7 +298,7 @@ INLINE void M_UNDEFINED(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x\n", cpustate->PC-1, M_RDMEM(cpustate->PC-1));
#endif
#if BREAK_ON_UNKNOWN_OPCODE
- debugger_break(cpustate->device->machine);
+ debugger_break(cpustate->device->machine());
#endif
}
@@ -311,7 +311,7 @@ INLINE void M_UNDEFINED2(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x,%02x\n", cpustate->PC-2, op,imm);
#endif
#if BREAK_ON_UNKNOWN_OPCODE
- debugger_break(cpustate->device->machine);
+ debugger_break(cpustate->device->machine());
#endif
}
diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c
index 6dc4efcae5c..cbaf9a238fb 100644
--- a/src/emu/cpu/am29000/am29000.c
+++ b/src/emu/cpu/am29000/am29000.c
@@ -388,7 +388,7 @@ INLINE void fetch_decode(am29000_state *am29000)
static CPU_EXECUTE( am29000 )
{
am29000_state *am29000 = get_safe_token(device);
- UINT32 call_debugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ UINT32 call_debugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
external_irq_check(am29000);
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index ee9f35ce217..adaed749d75 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -194,7 +194,7 @@ device_config *asap_device_config::static_alloc_device_config(const machine_conf
device_t *asap_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, asap_device(machine, *this));
+ return auto_alloc(machine, asap_device(machine, *this));
}
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index fc2240c8f96..3a0c74a10aa 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -886,14 +886,14 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
/* allocate serial timer */
- cpustate->serial_timer = device->machine->scheduler().timer_alloc(FUNC(serial_tick), cpustate);
+ cpustate->serial_timer = device->machine().scheduler().timer_alloc(FUNC(serial_tick), cpustate);
cpustate->serial_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
/* allocate counter timer */
if (has_counter)
{
- cpustate->counter_timer = device->machine->scheduler().timer_alloc(FUNC(counter_tick), cpustate);
+ cpustate->counter_timer = device->machine().scheduler().timer_alloc(FUNC(counter_tick), cpustate);
cpustate->counter_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4));
}
@@ -901,7 +901,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (has_inil)
{
- cpustate->inil_timer = device->machine->scheduler().timer_alloc(FUNC(inil_tick), cpustate);
+ cpustate->inil_timer = device->machine().scheduler().timer_alloc(FUNC(inil_tick), cpustate);
cpustate->inil_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
@@ -909,7 +909,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (cpustate->intf->microbus == COP400_MICROBUS_ENABLED)
{
- cpustate->microbus_timer = device->machine->scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
+ cpustate->microbus_timer = device->machine().scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
cpustate->microbus_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
diff --git a/src/emu/cpu/cosmac/cosmac.c b/src/emu/cpu/cosmac/cosmac.c
index fa65160de7b..b7cbbfc17d6 100644
--- a/src/emu/cpu/cosmac/cosmac.c
+++ b/src/emu/cpu/cosmac/cosmac.c
@@ -214,7 +214,7 @@ device_config *cosmac_device_config::static_alloc_device_config(const machine_co
device_t *cosmac_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cosmac_device(machine, *this));
+ return auto_alloc(machine, cosmac_device(machine, *this));
}
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index e4b5c8d2f16..963eaec21bb 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -275,7 +275,7 @@ static void cquestsnd_state_register(device_t *device)
device->save_item(NAME(cpustate->prev_ipram));
device->save_item(NAME(cpustate->prev_ipwrt));
- device->machine->state().register_postload(cquestsnd_postload, (void *)device);
+ device->machine().state().register_postload(cquestsnd_postload, (void *)device);
}
static CPU_INIT( cquestsnd )
@@ -286,14 +286,14 @@ static CPU_INIT( cquestsnd )
memset(cpustate, 0, sizeof(*cpustate));
cpustate->dac_w = _config->dac_w;
- cpustate->sound_data = (UINT16*)device->machine->region(_config->sound_data_region)->base();
+ cpustate->sound_data = (UINT16*)device->machine().region(_config->sound_data_region)->base();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Allocate RAM shared with 68000 */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096/2);
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096/2);
cquestsnd_state_register(device);
}
@@ -349,7 +349,7 @@ static void cquestrot_state_register(device_t *device)
device->save_pointer(NAME(cpustate->dram), 16384);
device->save_pointer(NAME(cpustate->sram), 2048);
- device->machine->state().register_postload(cquestrot_postload, (void *)device);
+ device->machine().state().register_postload(cquestrot_postload, (void *)device);
}
static CPU_INIT( cquestrot )
@@ -359,11 +359,11 @@ static CPU_INIT( cquestrot )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
- cpustate->dram = auto_alloc_array(device->machine, UINT16, 16384); /* Shared with 68000 */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */
+ cpustate->dram = auto_alloc_array(device->machine(), UINT16, 16384); /* Shared with 68000 */
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 2048); /* Private */
cpustate->device = device;
- cpustate->lindevice = device->machine->device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
+ cpustate->lindevice = device->machine().device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@@ -433,7 +433,7 @@ static void cquestlin_state_register(device_t *device)
device->save_pointer(NAME(cpustate->e_stack), 32768);
device->save_pointer(NAME(cpustate->o_stack), 32768);
- device->machine->state().register_postload(cquestlin_postload, (void *)device);
+ device->machine().state().register_postload(cquestlin_postload, (void *)device);
}
static CPU_INIT( cquestlin )
@@ -443,13 +443,13 @@ static CPU_INIT( cquestlin )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096); /* Shared with rotate CPU */
- cpustate->ptr_ram = auto_alloc_array(device->machine, UINT8, 1024); /* Pointer RAM */
- cpustate->e_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
- cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096); /* Shared with rotate CPU */
+ cpustate->ptr_ram = auto_alloc_array(device->machine(), UINT8, 1024); /* Pointer RAM */
+ cpustate->e_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
+ cpustate->o_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->device = device;
- cpustate->rotdevice = device->machine->device<legacy_cpu_device>(linconfig->rot_cpu_tag);
+ cpustate->rotdevice = device->machine().device<legacy_cpu_device>(linconfig->rot_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@@ -503,7 +503,7 @@ static int do_sndjmp(cquestsnd_state *cpustate, int jmp)
static CPU_EXECUTE( cquestsnd )
{
cquestsnd_state *cpustate = get_safe_token_snd(device);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@@ -764,7 +764,7 @@ static CPU_EXECUTE( cquestrot )
{
cquestrot_state *cpustate = get_safe_token_rot(device);
cquestlin_state *lincpustate = get_safe_token_lin(cpustate->lindevice);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@@ -1177,7 +1177,7 @@ static CPU_EXECUTE( cquestlin )
cquestlin_state *cpustate = get_safe_token_lin(device);
cquestrot_state *rotcpustate = get_safe_token_rot(cpustate->rotdevice);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
UINT32 *stack_ram;
UINT8 *ptr_ram;
diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c
index 54aa38f9526..cd72fbb6943 100644
--- a/src/emu/cpu/drcbex64.c
+++ b/src/emu/cpu/drcbex64.c
@@ -2781,13 +2781,13 @@ void drcbe_x64::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
- if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
- emit_mov_r64_imm(dst, REG_RAX, (FPTR)&m_device.machine->debug_flags); // mov rax,&debug_flags
+ emit_mov_r64_imm(dst, REG_RAX, (FPTR)m_device.machine().debug_flags); // mov rax,&debug_flags
emit_test_m32_imm(dst, MBD(REG_RAX, 0), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x64emit::COND_Z, skip); // jz skip
diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c
index 3419a988125..ad62f3c3338 100644
--- a/src/emu/cpu/drcbex86.c
+++ b/src/emu/cpu/drcbex86.c
@@ -3012,13 +3012,13 @@ void drcbe_x86::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
- if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
- emit_test_m32_imm(dst, MABS(&m_device.machine->debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
+ emit_test_m32_imm(dst, MABS(&m_device.machine().debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x86emit::COND_Z, skip); // jz skip
diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c
index 43b71385772..03000e151a9 100644
--- a/src/emu/cpu/drcfe.c
+++ b/src/emu/cpu/drcfe.c
@@ -84,9 +84,9 @@ drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end
m_cpudevice(downcast<cpu_device &>(cpu)),
m_program(m_cpudevice.space(AS_PROGRAM)),
m_pageshift(m_cpudevice.space_config(AS_PROGRAM)->m_page_shift),
- m_desc_live_list(cpu.machine->respool()),
- m_desc_allocator(cpu.machine->respool()),
- m_desc_array(auto_alloc_array_clear(cpu.machine, opcode_desc *, window_end + window_start + 2))
+ m_desc_live_list(cpu.machine().respool()),
+ m_desc_allocator(cpu.machine().respool()),
+ m_desc_array(auto_alloc_array_clear(cpu.machine(), opcode_desc *, window_end + window_start + 2))
{
}
@@ -101,7 +101,7 @@ drc_frontend::~drc_frontend()
release_descriptions();
// free the description array
- auto_free(m_cpudevice.machine, m_desc_array);
+ auto_free(m_cpudevice.machine(), m_desc_array);
}
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c
index 1f6e48fe0d9..b19ff71f555 100644
--- a/src/emu/cpu/drcuml.c
+++ b/src/emu/cpu/drcuml.c
@@ -151,11 +151,11 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
: m_device(device),
m_cache(cache),
m_beintf((flags & DRCUML_OPTION_USE_C) ?
- *static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
- *static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
+ *static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
+ *static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
m_umllog(NULL),
- m_blocklist(device.machine->respool()),
- m_symlist(device.machine->respool())
+ m_blocklist(device.machine().respool()),
+ m_symlist(device.machine().respool())
{
// if we're to log, create the logfile
if (flags & DRCUML_OPTION_LOG_UML)
@@ -170,7 +170,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
drcuml_state::~drcuml_state()
{
// free the back-end
- auto_free(m_device.machine, &m_beintf);
+ auto_free(m_device.machine(), &m_beintf);
// close any files
if (m_umllog != NULL)
@@ -230,7 +230,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
// if we failed to find one, allocate a new one
if (bestblock == NULL)
- bestblock = &m_blocklist.append(*auto_alloc(m_device.machine, drcuml_block(*this, maxinst * 3/2)));
+ bestblock = &m_blocklist.append(*auto_alloc(m_device.machine(), drcuml_block(*this, maxinst * 3/2)));
// start the block
bestblock->begin();
@@ -245,7 +245,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
code_handle *drcuml_state::handle_alloc(const char *name)
{
// allocate the handle, add it to our list, and return it
- return &m_handlelist.append(*auto_alloc(m_device.machine, code_handle(*this, name)));
+ return &m_handlelist.append(*auto_alloc(m_device.machine(), code_handle(*this, name)));
}
@@ -256,7 +256,7 @@ code_handle *drcuml_state::handle_alloc(const char *name)
void drcuml_state::symbol_add(void *base, UINT32 length, const char *name)
{
- m_symlist.append(*auto_alloc(m_device.machine, symbol(base, length, name)));
+ m_symlist.append(*auto_alloc(m_device.machine(), symbol(base, length, name)));
}
@@ -323,7 +323,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
m_next(NULL),
m_nextinst(0),
m_maxinst(maxinst * 3/2),
- m_inst(auto_alloc_array(drcuml.device().machine, instruction, m_maxinst)),
+ m_inst(auto_alloc_array(drcuml.device().machine(), instruction, m_maxinst)),
m_inuse(false)
{
}
@@ -336,7 +336,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
drcuml_block::~drcuml_block()
{
// free the instruction list
- auto_free(m_drcuml.device().machine, m_inst);
+ auto_free(m_drcuml.device().machine(), m_inst);
}
@@ -951,31 +951,31 @@ static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, cons
static void bevalidate_initialize_random_state(drcuml_state *drcuml, drcuml_block *block, drcuml_machine_state *state)
{
- running_machine *machine = drcuml->device->machine;
+ running_machine &machine = drcuml->device->machine();
int regnum;
// initialize core state to random values
- state->fmod = machine->rand() & 0x03;
- state->flags = machine->rand() & 0x1f;
- state->exp = machine->rand();
+ state->fmod = machine.rand() & 0x03;
+ state->flags = machine.rand() & 0x1f;
+ state->exp = machine.rand();
// initialize integer registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++)
{
- state->r[regnum].w.h = machine->rand();
- state->r[regnum].w.l = machine->rand();
+ state->r[regnum].w.h = machine.rand();
+ state->r[regnum].w.l = machine.rand();
}
// initialize float registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++)
{
- *(UINT32 *)&state->f[regnum].s.h = machine->rand();
- *(UINT32 *)&state->f[regnum].s.l = machine->rand();
+ *(UINT32 *)&state->f[regnum].s.h = machine.rand();
+ *(UINT32 *)&state->f[regnum].s.l = machine.rand();
}
// initialize map variables to random values
for (regnum = 0; regnum < MAPVAR_COUNT; regnum++)
- UML_MAPVAR(block, MVAR(regnum), machine->rand());
+ UML_MAPVAR(block, MVAR(regnum), machine.rand());
}
diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c
index f3dfa3d074a..5ee8f991faf 100644
--- a/src/emu/cpu/dsp16/dsp16.c
+++ b/src/emu/cpu/dsp16/dsp16.c
@@ -45,7 +45,7 @@ device_config *dsp16_device_config::static_alloc_device_config(const machine_con
device_t *dsp16_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, dsp16_device(machine, *this));
+ return auto_alloc(machine, dsp16_device(machine, *this));
}
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 19859c26586..8c61ac81546 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -202,7 +202,7 @@ device_config *dsp32c_device_config::static_alloc_device_config(const machine_co
device_t *dsp32c_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, dsp32c_device(machine, *this));
+ return auto_alloc(machine, dsp32c_device(machine, *this));
}
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 93ed7708691..f919578fb03 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -238,7 +238,7 @@ static CPU_INIT( dsp56k )
/* Setup the direct memory handler for this CPU */
/* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */
- const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, *device->machine));
+ const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, device->machine()));
}
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c
index 7cd6a29a443..d93620aba96 100644
--- a/src/emu/cpu/e132xs/e132xs.c
+++ b/src/emu/cpu/e132xs/e132xs.c
@@ -1546,7 +1546,7 @@ static void hyperstone_init(legacy_cpu_device *device, device_irq_callback irqca
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
cpustate->io = device->space(AS_IO);
- cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
+ cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
cpustate->clock_scale_mask = scale_mask;
}
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 9b983566760..a69939fa430 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -116,8 +116,8 @@ typedef struct
read16_device_func fdt_r;
write16_device_func fdt_w;
- UINT8 (*status_in)(running_machine *machine);
- int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
+ UINT8 (*status_in)(running_machine &machine);
+ int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
} esrip_state;
@@ -256,19 +256,19 @@ static CPU_INIT( esrip )
/* Register configuration structure callbacks */
cpustate->fdt_r = _config->fdt_r;
cpustate->fdt_w = _config->fdt_w;
- cpustate->lbrm = (UINT8*)device->machine->region(_config->lbrm_prom)->base();
+ cpustate->lbrm = (UINT8*)device->machine().region(_config->lbrm_prom)->base();
cpustate->status_in = _config->status_in;
cpustate->draw = _config->draw;
/* Allocate image pointer table RAM */
- cpustate->ipt_ram = auto_alloc_array(device->machine, UINT16, IPT_RAM_SIZE/2);
+ cpustate->ipt_ram = auto_alloc_array(device->machine(), UINT16, IPT_RAM_SIZE/2);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Create the instruction decode lookup table */
- cpustate->optable = auto_alloc_array(device->machine, UINT8, 65536);
+ cpustate->optable = auto_alloc_array(device->machine(), UINT8, 65536);
make_ops(cpustate);
/* Register stuff for state saving */
@@ -354,9 +354,9 @@ static CPU_EXIT( esrip )
PRIVATE FUNCTIONS
***************************************************************************/
-static int get_hblank(running_machine *machine)
+static int get_hblank(running_machine &machine)
{
- return machine->primary_screen->hblank();
+ return machine.primary_screen->hblank();
}
/* Return the state of the LBRM line (Y-scaling related) */
@@ -384,7 +384,7 @@ INLINE int check_jmp(esrip_state *cpustate, UINT8 jmp_ctrl)
/* T3 */ case 6: ret = BIT(cpustate->t, 2); break;
/* T4 */ case 1: ret = BIT(cpustate->t, 3); break;
/* /LBRM */ case 5: ret = !get_lbrm(cpustate); break;
- /* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine); break;
+ /* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine()); break;
/* JMP */ case 7: ret = 0; break;
}
@@ -1664,11 +1664,11 @@ INLINE void am29116_execute(esrip_state *cpustate, UINT16 inst, int _sre)
static CPU_EXECUTE( esrip )
{
esrip_state *cpustate = get_safe_token(device);
- int calldebugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ int calldebugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
UINT8 status;
/* I think we can get away with placing this outside of the loop */
- status = cpustate->status_in(device->machine);
+ status = cpustate->status_in(device->machine());
/* Core execution loop */
do
@@ -1811,7 +1811,7 @@ static CPU_EXECUTE( esrip )
cpustate->attr_latch = x_bus;
cpustate->fig = 1;
- cpustate->fig_cycles = cpustate->draw(device->machine, cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
+ cpustate->fig_cycles = cpustate->draw(device->machine(), cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
}
/* X-scale */
@@ -1943,7 +1943,7 @@ CPU_GET_INFO( esrip )
cpustate->status & 0x04 ? 'N' : '.',
cpustate->status & 0x02 ? 'C' : '.',
cpustate->status & 0x01 ? 'Z' : '.',
- get_hblank(device->machine) ? 'H' : '.'); break;
+ get_hblank(device->machine()) ? 'H' : '.'); break;
case CPUINFO_STR_REGISTER + ESRIP_PC: sprintf(info->s, "PC: %04X", RIP_PC); break;
case CPUINFO_STR_REGISTER + ESRIP_ACC: sprintf(info->s, "ACC: %04X", cpustate->acc); break;
diff --git a/src/emu/cpu/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h
index 8935136b689..7a06e88bea2 100644
--- a/src/emu/cpu/esrip/esrip.h
+++ b/src/emu/cpu/esrip/esrip.h
@@ -85,8 +85,8 @@ struct _esrip_config_
{
read16_device_func fdt_r;
write16_device_func fdt_w;
- UINT8 (*status_in)(running_machine *machine);
- int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
+ UINT8 (*status_in)(running_machine &machine);
+ int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
const char* const lbrm_prom;
};
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 30d58b3ddcc..3d7782dc9e5 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -365,7 +365,7 @@ static CPU_INIT( g65816 )
device->save_item(NAME(cpustate->irq_delay));
device->save_item(NAME(cpustate->stopped));
- device->machine->state().register_postload(g65816_restore_state, cpustate);
+ device->machine().state().register_postload(g65816_restore_state, cpustate);
}
/**************************************************************************
diff --git a/src/emu/cpu/h83002/h8_16.c b/src/emu/cpu/h83002/h8_16.c
index 9b5fb48ee47..d6fdcafc590 100644
--- a/src/emu/cpu/h83002/h8_16.c
+++ b/src/emu/cpu/h83002/h8_16.c
@@ -237,7 +237,7 @@ static CPU_INIT(h8)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
- device->machine->state().register_postload(h8_onstateload, h8);
+ device->machine().state().register_postload(h8_onstateload, h8);
h8_itu_init(h8);
}
diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c
index ce7cd1a4f63..e95d5602c5c 100644
--- a/src/emu/cpu/h83002/h8_8.c
+++ b/src/emu/cpu/h83002/h8_8.c
@@ -241,10 +241,10 @@ static CPU_INIT(h8bit)
h8->direct = &h8->program->direct();
h8->io = device->space(AS_IO);
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
- h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
+ h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
device->save_item(NAME(h8->h8err));
device->save_item(NAME(h8->regs));
@@ -259,7 +259,7 @@ static CPU_INIT(h8bit)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
- h8->device->machine->state().register_postload(h8_onstateload, h8);
+ h8->device->machine().state().register_postload(h8_onstateload, h8);
}
static CPU_RESET(h8bit)
diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c
index 50ff0143cb2..644471f94ea 100644
--- a/src/emu/cpu/h83002/h8periph.c
+++ b/src/emu/cpu/h83002/h8periph.c
@@ -766,20 +766,20 @@ void h8_3007_register1_write8(h83xx_state *h8, UINT32 address, UINT8 val)
void h8_3007_itu_init(h83xx_state *h8)
{
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
h8_itu_reset(h8);
}
void h8_itu_init(h83xx_state *h8)
{
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
- h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
- h8->timer[4] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
+ h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
+ h8->timer[4] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
h8_itu_reset(h8);
}
diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c
index d931748a568..87746628c6e 100644
--- a/src/emu/cpu/hd6309/hd6309.c
+++ b/src/emu/cpu/hd6309/hd6309.c
@@ -541,7 +541,7 @@ static CPU_INIT( hd6309 )
device->save_item(NAME(DP));
device->save_item(NAME(CC));
device->save_item(NAME(MD));
- device->machine->state().register_postload(hd6309_postload, (void *) device);
+ device->machine().state().register_postload(hd6309_postload, (void *) device);
device->save_item(NAME(m68_state->int_state));
device->save_item(NAME(m68_state->nmi_state));
device->save_item(NAME(m68_state->irq_state[0]));
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index 963cf8bf467..62a39490969 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -418,7 +418,7 @@ INLINE void CYCLES_RM(i386_state *cpustate,int modrm, int r, int m)
}
}
-static void build_cycle_table(running_machine *machine)
+static void build_cycle_table(running_machine &machine)
{
int i, j;
for (j=0; j < X86_NUM_CPUS; j++)
@@ -534,7 +534,7 @@ static CPU_INIT( i386 )
static const int regs32[8] = {EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI};
i386_state *cpustate = get_safe_token(device);
- build_cycle_table(device->machine);
+ build_cycle_table(device->machine());
for( i=0; i < 256; i++ ) {
int c=0;
@@ -614,7 +614,7 @@ static CPU_INIT( i386 )
device->save_item(NAME(cpustate->ldtr.flags));
device->save_item(NAME(cpustate->irq_state));
device->save_item(NAME(cpustate->performed_intersegment_jump));
- device->machine->state().register_postload(i386_postload, (void *)device);
+ device->machine().state().register_postload(i386_postload, (void *)device);
}
static void build_opcode_table(i386_state *cpustate, UINT32 features)
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index 5811cd8dc65..6d88c701e24 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -430,7 +430,7 @@ static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callbac
device->save_item(NAME(jaguar->a));
device->save_item(NAME(jaguar->ctrl));
device->save_item(NAME(jaguar->ppc));
- device->machine->state().register_postload(jaguar_postload, (void *)device);
+ device->machine().state().register_postload(jaguar_postload, (void *)device);
}
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index ad5ced6347c..d385094425b 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -906,7 +906,7 @@ static CPU_INIT( m37710 )
cpustate->destination = 0;
for (i = 0; i < 8; i++)
- cpustate->timers[i] = device->machine->scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
+ cpustate->timers[i] = device->machine().scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
device->save_item(NAME(cpustate->a));
device->save_item(NAME(cpustate->b));
@@ -949,7 +949,7 @@ static CPU_INIT( m37710 )
device->save_item(NAME(cpustate->reload[6]));
device->save_item(NAME(cpustate->reload[7]));
- device->machine->state().register_postload(m37710_restore_state, cpustate);
+ device->machine().state().register_postload(m37710_restore_state, cpustate);
}
/**************************************************************************
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 23e68c92d03..700fb0a633e 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1204,7 +1204,7 @@ static CPU_INIT( m6801 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6801");
@@ -1254,7 +1254,7 @@ static CPU_INIT( m6803 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6803");
@@ -1312,7 +1312,7 @@ static CPU_INIT( hd6301 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd6301");
}
@@ -1336,7 +1336,7 @@ static CPU_INIT( hd63701 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd63701");
}
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 94f3b4a2e41..1b900f5d7e8 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -538,7 +538,7 @@ static void set_irq_line(m68ki_cpu_core *m68k, int irqline, int state)
m68k->nmi_pending = TRUE;
}
-static void m68k_presave(running_machine *machine, void *param)
+static void m68k_presave(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68k->save_sr = m68ki_get_sr(m68k);
@@ -546,7 +546,7 @@ static void m68k_presave(running_machine *machine, void *param)
m68k->save_halted = (m68k->stopped & STOP_LEVEL_HALT) != 0;
}
-static void m68k_postload(running_machine *machine, void *param)
+static void m68k_postload(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68ki_set_sr_noint_nosp(m68k, m68k->save_sr);
@@ -762,8 +762,8 @@ static CPU_INIT( m68k )
device->save_item(NAME(m68k->save_halted));
device->save_item(NAME(m68k->pref_addr));
device->save_item(NAME(m68k->pref_data));
- device->machine->state().register_presave(m68k_presave, m68k);
- device->machine->state().register_postload(m68k_postload, m68k);
+ device->machine().state().register_presave(m68k_presave, m68k);
+ device->machine().state().register_postload(m68k_postload, m68k);
}
/* Pulse the RESET line on the CPU */
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index 64c0483995a..3150b447b48 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -121,13 +121,13 @@ static CPU_INIT( mb86233 )
cpustate->fifo_write_cb = _config->fifo_write_cb;
}
- cpustate->RAM = auto_alloc_array(device->machine, UINT32, 2 * 0x200); /* 2x 2KB */
+ cpustate->RAM = auto_alloc_array(device->machine(), UINT32, 2 * 0x200); /* 2x 2KB */
memset( cpustate->RAM, 0, 2 * 0x200 * sizeof(UINT32) );
cpustate->ARAM = &cpustate->RAM[0];
cpustate->BRAM = &cpustate->RAM[0x200];
- cpustate->Tables = (UINT32*) device->machine->region(_config->tablergn)->base();
+ cpustate->Tables = (UINT32*) device->machine().region(_config->tablergn)->base();
- state_save_register_global_pointer(device->machine, cpustate->RAM,2 * 0x200 * sizeof(UINT32));
+ state_save_register_global_pointer(device->machine(), cpustate->RAM,2 * 0x200 * sizeof(UINT32));
}
static CPU_RESET( mb86233 )
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index d14b6cf5b44..8c60ca444aa 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -149,7 +149,7 @@ static CPU_INIT( mb88 )
cpustate->data = device->space(AS_DATA);
cpustate->io = device->space(AS_IO);
- cpustate->serial = device->machine->scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
+ cpustate->serial = device->machine().scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
device->save_item(NAME(cpustate->PC));
device->save_item(NAME(cpustate->PA));
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index 7cd5d87d15e..4806a287fd3 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -410,7 +410,7 @@ static CPU_INIT( hc11 )
cpustate->internal_ram_size = 1280;
}
- cpustate->internal_ram = auto_alloc_array(device->machine, UINT8, cpustate->internal_ram_size);
+ cpustate->internal_ram = auto_alloc_array(device->machine(), UINT8, cpustate->internal_ram_size);
cpustate->reg_position = 0;
cpustate->ram_position = 0x100;
diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c
index bcedcf23008..4575a04fd9c 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -1215,7 +1215,7 @@ static TIMER_CALLBACK( master_callback )
void upi41_master_w(device_t *_device, UINT8 a0, UINT8 data)
{
legacy_cpu_device *device = downcast<legacy_cpu_device *>(_device);
- device->machine->scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
}
diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c
index 9e84e9d3780..21e67659249 100644
--- a/src/emu/cpu/mips/mips3com.c
+++ b/src/emu/cpu/mips/mips3com.c
@@ -105,7 +105,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy
mips->vtlb = vtlb_alloc(device, AS_PROGRAM, 2 * mips->tlbentries + 2, 0);
/* allocate a timer for the compare interrupt */
- mips->compare_int_timer = device->machine->scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
+ mips->compare_int_timer = device->machine().scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
/* reset the state */
mips3com_reset(mips);
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index 83f95669eff..f62c4d16c8b 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -396,7 +396,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*mips3)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*mips3)));
if (cache == NULL)
fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*mips3)));
@@ -419,7 +419,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- mips3->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ mips3->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
mips3->impstate->drcuml->symbol_add(&mips3->pc, sizeof(mips3->pc), "pc");
@@ -465,7 +465,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
mips3->impstate->drcuml->symbol_add(&mips3->impstate->fpmode, sizeof(mips3->impstate->fpmode), "fpmode");
/* initialize the front-end helper */
- mips3->impstate->drcfe = auto_alloc(device->machine, mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ mips3->impstate->drcfe = auto_alloc(device->machine(), mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* allocate memory for cache-local state and initialize it */
memcpy(mips3->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@@ -562,9 +562,9 @@ static CPU_EXIT( mips3 )
mips3com_exit(mips3);
/* clean up the DRC */
- auto_free(device->machine, mips3->impstate->drcfe);
- auto_free(device->machine, mips3->impstate->drcuml);
- auto_free(device->machine, mips3->impstate->cache);
+ auto_free(device->machine(), mips3->impstate->drcfe);
+ auto_free(device->machine(), mips3->impstate->drcuml);
+ auto_free(device->machine(), mips3->impstate->cache);
}
@@ -1275,7 +1275,7 @@ static void static_generate_memory_accessor(mips3_state *mips3, int mode, int si
UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z
UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000
- if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
for (ramnum = 0; ramnum < MIPS3_MAX_FASTRAM; ramnum++)
if (mips3->impstate->fastram[ramnum].base != NULL && (!iswrite || !mips3->impstate->fastram[ramnum].readonly))
{
@@ -1612,7 +1612,7 @@ static void generate_sequence_instruction(mips3_state *mips3, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
- if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&mips3->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(mips3, block);
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 72a5bde1bf0..2437f082721 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -232,7 +232,7 @@ void psxcpu_device::set_biu( UINT32 data, UINT32 mem_mask )
void psxcpu_device::stop()
{
- debugger_break( machine );
+ debugger_break( m_machine );
debugger_instruction_hook( this, m_pc );
}
@@ -1602,12 +1602,12 @@ device_config *cxd8661r_device_config::static_alloc_device_config(const machine_
device_t *psxcpu_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, psxcpu_device(machine, *this));
+ return auto_alloc(machine, psxcpu_device(machine, *this));
}
device_t *cxd8661r_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, psxcpu_device(machine, *this));
+ return auto_alloc(machine, psxcpu_device(machine, *this));
}
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index 1388fd9edf6..c0a6cbb2b9a 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -303,8 +303,8 @@ static CPU_INIT( r3000 )
r3000_state *r3000 = get_safe_token(device);
/* allocate memory */
- r3000->icache = auto_alloc_array(device->machine, UINT32, configdata->icache/4);
- r3000->dcache = auto_alloc_array(device->machine, UINT32, configdata->dcache/4);
+ r3000->icache = auto_alloc_array(device->machine(), UINT32, configdata->icache/4);
+ r3000->dcache = auto_alloc_array(device->machine(), UINT32, configdata->dcache/4);
r3000->icache_size = configdata->icache;
r3000->dcache_size = configdata->dcache;
diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c
index 9b37e6d194d..4ffb6ac3a88 100644
--- a/src/emu/cpu/mn10200/mn10200.c
+++ b/src/emu/cpu/mn10200/mn10200.c
@@ -295,7 +295,7 @@ static CPU_INIT(mn10200)
for (tmr = 0; tmr < NUM_TIMERS_8BIT; tmr++)
{
- cpustate->timer_timers[tmr] = device->machine->scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
+ cpustate->timer_timers[tmr] = device->machine().scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
}
diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c
index 8b8f27eef71..15c8ea5e666 100644
--- a/src/emu/cpu/nec/v25.c
+++ b/src/emu/cpu/nec/v25.c
@@ -430,7 +430,7 @@ static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback,
nec_state->config = config;
for (int i = 0; i < 4; i++)
- nec_state->timers[i] = device->machine->scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
+ nec_state->timers[i] = device->machine().scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
device->save_item(NAME(nec_state->ram.w));
device->save_item(NAME(nec_state->intp_state));
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index 296e1594ee0..a839bf2c51c 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -947,8 +947,8 @@ static CPU_INIT( ppc403 )
// !!! why is rfci here !!!
ppc.optable19[51] = ppc_rfci;
- ppc.spu.rx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
- ppc.spu.tx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
+ ppc.spu.rx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
+ ppc.spu.tx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
ppc.read8 = ppc403_read8;
ppc.read16 = ppc403_read16;
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index c99b2a50ebc..60d3855793d 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -328,14 +328,14 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di
/* allocate a timer for the compare interrupt */
if ((cap & PPCCAP_OEA) && (ppc->tb_divisor))
- ppc->decrementer_int_timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
+ ppc->decrementer_int_timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
/* and for the 4XX interrupts if needed */
if (cap & PPCCAP_4XX)
{
- ppc->fit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
- ppc->pit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
- ppc->spu.timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
+ ppc->fit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
+ ppc->pit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
+ ppc->spu.timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
}
/* register for save states */
@@ -403,7 +403,7 @@ void ppccom_reset(powerpc_state *ppc)
ppc->dec_zero_cycles = ppc->device->total_cycles();
if (ppc->tb_divisor)
{
- decrementer_int_callback(ppc->device->machine, ppc, 0);
+ decrementer_int_callback(ppc->device->machine(), ppc, 0);
}
}
@@ -676,7 +676,7 @@ void ppccom_execute_tlbl(powerpc_state *ppc)
int entrynum;
/* determine entry number; we use rand() for associativity */
- entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine->rand() & 0x20) | (isitlb ? 0x40 : 0);
+ entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine().rand() & 0x20) | (isitlb ? 0x40 : 0);
/* determine the flags */
flags = VTLB_FLAG_VALID | VTLB_READ_ALLOWED | VTLB_FETCH_ALLOWED;
@@ -946,9 +946,9 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_TCR:
ppc->spr[SPR4XX_TCR] = ppc->param1 | (oldval & PPC4XX_TCR_WRC_MASK);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_FIE)
- ppc4xx_fit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_fit_callback(ppc->device->machine(), ppc, FALSE);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_PIE)
- ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timer status register */
@@ -961,7 +961,7 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_PIT:
ppc->spr[SPR4XX_PIT] = ppc->param1;
ppc->pit_reload = ppc->param1;
- ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timebase */
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index 8aff8c0a62f..ce77712dd12 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -557,7 +557,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*ppc)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*ppc)));
/* allocate the core from the near cache */
*(powerpc_state **)device->token() = ppc = (powerpc_state *)cache->alloc_near(sizeof(*ppc));
@@ -578,7 +578,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- ppc->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ ppc->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
ppc->impstate->drcuml->symbol_add(&ppc->pc, sizeof(ppc->pc), "pc");
@@ -624,7 +624,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
ppc->impstate->drcuml->symbol_add(&ppc->impstate->fcmp_cr_table, sizeof(ppc->impstate->fcmp_cr_table), "fcmp_cr_table");
/* initialize the front-end helper */
- ppc->impstate->drcfe = auto_alloc(device->machine, ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ ppc->impstate->drcfe = auto_alloc(device->machine(), ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* initialize the implementation state tables */
memcpy(ppc->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@@ -716,9 +716,9 @@ static CPU_EXIT( ppcdrc )
ppccom_exit(ppc);
/* clean up the DRC */
- auto_free(device->machine, ppc->impstate->drcfe);
- auto_free(device->machine, ppc->impstate->drcuml);
- auto_free(device->machine, ppc->impstate->cache);
+ auto_free(device->machine(), ppc->impstate->drcfe);
+ auto_free(device->machine(), ppc->impstate->drcuml);
+ auto_free(device->machine(), ppc->impstate->cache);
}
@@ -1511,7 +1511,7 @@ static void static_generate_memory_accessor(powerpc_state *ppc, int mode, int si
UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff
UML_XOR(block, I0, I0, (mode & MODE_LITTLE_ENDIAN) ? (8 - size) : 0); // xor i0,i0,8-size
- if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++)
if (ppc->impstate->fastram[ramnum].base != NULL && (!iswrite || !ppc->impstate->fastram[ramnum].readonly))
{
@@ -2127,7 +2127,7 @@ static void generate_sequence_instruction(powerpc_state *ppc, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
- if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&ppc->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(ppc, block); // <save fastregs>
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index a756842f2f8..1a9bd158f6e 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -207,7 +207,7 @@ static void set_cop0_reg(rsp_state *rsp, int reg, UINT32 data)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -303,7 +303,7 @@ static CPU_INIT( rsp )
#endif
// ...except for the accumulators.
- // We're not calling machine->rand() because initializing something with machine->rand()
+ // We're not calling machine.rand() because initializing something with machine.rand()
// makes me retch uncontrollably.
for(accumIdx = 0; accumIdx < 8; accumIdx++ )
{
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index 9c7b2295355..f41d462b3a5 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -496,7 +496,7 @@ static void cfunc_unimplemented_opcode(void *param)
{
rsp_state *rsp = (rsp_state*)param;
int op = rsp->impstate->arg0;
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -508,7 +508,7 @@ static void cfunc_unimplemented_opcode(void *param)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -612,7 +612,7 @@ static CPU_INIT( rsp )
//int elnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*rsp)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*rsp)));
/* allocate the core memory */
*(rsp_state **)device->token() = rsp = (rsp_state *)cache->alloc_near(sizeof(*rsp));
@@ -638,7 +638,7 @@ static CPU_INIT( rsp )
{
flags |= DRCUML_OPTION_LOG_NATIVE;
}
- rsp->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ rsp->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
rsp->impstate->drcuml->symbol_add(&rsp->pc, sizeof(rsp->pc), "pc");
@@ -656,7 +656,7 @@ static CPU_INIT( rsp )
rsp->impstate->drcuml->symbol_add(&rsp->impstate->numcycles, sizeof(rsp->impstate->numcycles), "numcycles");
/* initialize the front-end helper */
- rsp->impstate->drcfe = auto_alloc(device->machine, rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ rsp->impstate->drcfe = auto_alloc(device->machine(), rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 32; regnum++)
@@ -696,9 +696,9 @@ static CPU_EXIT( rsp )
rsp_state *rsp = get_safe_token(device);
/* clean up the DRC */
- auto_free(device->machine, rsp->impstate->drcfe);
- auto_free(device->machine, rsp->impstate->drcuml);
- auto_free(device->machine, rsp->impstate->cache);
+ auto_free(device->machine(), rsp->impstate->drcfe);
+ auto_free(device->machine(), rsp->impstate->drcuml);
+ auto_free(device->machine(), rsp->impstate->cache);
}
@@ -3817,7 +3817,7 @@ static void generate_sequence_instruction(rsp_state *rsp, drcuml_block *block, c
UML_MAPVAR(block, MAPVAR_CYCLES, compiler->cycles); // mapvar CYCLES,compiler->cycles
/* if we are debugging, call the debugger */
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&rsp->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(rsp, block);
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index ce2e0951626..edf585abc8f 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -104,7 +104,7 @@ static CPU_INIT( sc61860 )
{
sc61860_state *cpustate = get_safe_token(device);
cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config();
- device->machine->scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 6cd5b690da1..4fcacce823d 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -923,17 +923,17 @@ void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callb
const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config();
int i;
- sh2->timer = device->machine->scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
+ sh2->timer = device->machine().scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
sh2->timer->adjust(attotime::never);
- sh2->dma_current_active_timer[0] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
+ sh2->dma_current_active_timer[0] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[0]->adjust(attotime::never);
- sh2->dma_current_active_timer[1] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
+ sh2->dma_current_active_timer[1] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[1]->adjust(attotime::never);
- sh2->m = auto_alloc_array(device->machine, UINT32, 0x200/4);
+ sh2->m = auto_alloc_array(device->machine(), UINT32, 0x200/4);
if(conf)
{
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index f1a44969ff4..41bcc49289e 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -8,7 +8,7 @@
Visit http://mamedev.org for licensing and usage restrictions.
ST-V status:
- colmns97 & stress crash due to SCSP stream->machine getting corrupted.
+ colmns97 & stress crash due to SCSP stream->machine() getting corrupted.
cottonbm w/US bios: run to 60323B4 on master, then MOV insn @ 602f5aa crashes?
actually crash on slave @ 6032b38 after above. reading wrong addr for jump vector.
@@ -683,7 +683,7 @@ static CPU_INIT( sh2 )
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(sh2_state)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(sh2_state)));
/* allocate the core memory */
*(sh2_state **)device->token() = sh2 = (sh2_state *)cache->alloc_near(sizeof(sh2_state));
@@ -705,7 +705,7 @@ static CPU_INIT( sh2 )
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- sh2->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 1, 32, 1));
+ sh2->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 1, 32, 1));
/* add symbols for our stuff */
sh2->drcuml->symbol_add(&sh2->pc, sizeof(sh2->pc), "pc");
@@ -724,7 +724,7 @@ static CPU_INIT( sh2 )
sh2->drcuml->symbol_add(&sh2->mach, sizeof(sh2->macl), "mach");
/* initialize the front-end helper */
- sh2->drcfe = auto_alloc(device->machine, sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ sh2->drcfe = auto_alloc(device->machine(), sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 16; regnum++)
@@ -764,9 +764,9 @@ static CPU_EXIT( sh2 )
sh2_state *sh2 = get_safe_token(device);
/* clean up the DRC */
- auto_free(device->machine, sh2->drcfe);
- auto_free(device->machine, sh2->drcuml);
- auto_free(device->machine, sh2->cache);
+ auto_free(device->machine(), sh2->drcfe);
+ auto_free(device->machine(), sh2->drcuml);
+ auto_free(device->machine(), sh2->cache);
}
@@ -1577,7 +1577,7 @@ static void generate_sequence_instruction(sh2_state *sh2, drcuml_block *block, c
}
/* if we are debugging, call the debugger */
- if ((sh2->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh2->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&sh2->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(sh2, block);
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index d928ae6d633..6d508d9b996 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -845,7 +845,7 @@ INLINE void LDCSR(sh4_state *sh4, UINT32 m)
UINT32 reg;
reg = sh4->r[m];
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->r[m] & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->r[m] & sRB ? 1 : 0);
@@ -873,7 +873,7 @@ UINT32 old;
old = sh4->sr;
sh4->ea = sh4->r[m];
sh4->sr = RL(sh4, sh4->ea ) & FLAGS;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (old & sRB) >> 29);
if ((old & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->sr & sRB ? 1 : 0);
@@ -1459,7 +1459,7 @@ INLINE void RTE(sh4_state *sh4)
{
sh4->delay = sh4->pc;
sh4->pc = sh4->ea = sh4->spc;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->ssr & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->ssr & sRB ? 1 : 0);
@@ -1750,7 +1750,7 @@ INLINE void TRAPA(sh4_state *sh4, UINT32 i)
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@@ -3196,7 +3196,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FRCHG(sh4);
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
} else {
@@ -3207,7 +3207,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
}
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
break;
@@ -3215,7 +3215,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FMAC(sh4, Rm,Rn);
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
}
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index f6df416911c..e24742e9f28 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -193,7 +193,7 @@ void sh4_exception(sh4_state *sh4, const char *message, int exception) // handle
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@@ -1160,24 +1160,24 @@ void sh4_common_init(device_t *device)
for (i=0; i<3; i++)
{
- sh4->timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
+ sh4->timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
sh4->timer[i]->adjust(attotime::never, i);
}
for (i=0; i<4; i++)
{
- sh4->dma_timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
+ sh4->dma_timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
sh4->dma_timer[i]->adjust(attotime::never, i);
}
- sh4->refresh_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
+ sh4->refresh_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
sh4->refresh_timer->adjust(attotime::never);
sh4->refresh_timer_base = 0;
- sh4->rtc_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
+ sh4->rtc_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
sh4->rtc_timer->adjust(attotime::never);
- sh4->m = auto_alloc_array(device->machine, UINT32, 16384);
+ sh4->m = auto_alloc_array(device->machine(), UINT32, 16384);
}
void sh4_dma_ddt(device_t *device, struct sh4_ddt_dma *s)
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 5d70fcc2f78..63bd604603f 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -430,7 +430,7 @@ static CPU_INIT( sharc )
build_opcode_table();
- cpustate->internal_ram = auto_alloc_array(device->machine, UINT16, 2 * 0x10000); // 2x 128KB
+ cpustate->internal_ram = auto_alloc_array(device->machine(), UINT16, 2 * 0x10000); // 2x 128KB
cpustate->internal_ram_block0 = &cpustate->internal_ram[0];
cpustate->internal_ram_block1 = &cpustate->internal_ram[0x20000/2];
diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c
index 18d4aa7ead5..22f18c12983 100644
--- a/src/emu/cpu/ssem/ssem.c
+++ b/src/emu/cpu/ssem/ssem.c
@@ -95,7 +95,7 @@ INLINE void WRITE32(ssem_state *cpustate, UINT32 address, UINT32 data)
static void unimplemented_opcode(ssem_state *cpustate, UINT32 op)
{
- if((cpustate->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if((cpustate->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
ssem_dasm_one(string, cpustate->pc-1, op);
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index aa38f2009ad..720112a8127 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2726,9 +2726,9 @@ static CPU_INIT( t90 )
// Timers
for (i = 0; i < 4; i++)
- cpustate->timer[i] = device->machine->scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
+ cpustate->timer[i] = device->machine().scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
- cpustate->timer[4] = device->machine->scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
+ cpustate->timer[4] = device->machine().scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
}
static ADDRESS_MAP_START(tmp90840_mem, AS_PROGRAM, 8)
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index 1c9aa0dd33a..fcaf214431b 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -1719,7 +1719,7 @@ static CPU_INIT( tms32025 )
{
tms32025_state *cpustate = get_safe_token(device);
- cpustate->intRAM = auto_alloc_array(device->machine, UINT16, 0x800);
+ cpustate->intRAM = auto_alloc_array(device->machine(), UINT16, 0x800);
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/tms32031/32031ops.c b/src/emu/cpu/tms32031/32031ops.c
index 9fae72f13cd..4a3654b5c03 100644
--- a/src/emu/cpu/tms32031/32031ops.c
+++ b/src/emu/cpu/tms32031/32031ops.c
@@ -103,7 +103,7 @@ void tms3203x_device::illegal(UINT32 op)
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
- debugger_break(machine);
+ debugger_break(m_machine);
}
}
@@ -120,7 +120,7 @@ inline void tms3203x_device::execute_one()
m_icount -= 2; // 2 clocks per cycle
m_pc++;
#if (TMS_3203X_LOG_OPCODE_USAGE)
- if (machine->primary_screen->frame_number() == 2003)
+ if (machine.primary_screen->frame_number() == 2003)
m_hits[op >> 21]++;
#endif
(this->*s_tms32031ops[op >> 21])(op);
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index 124a7d81e2a..32e37e8b874 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -178,12 +178,12 @@ device_config *tms32032_device_config::static_alloc_device_config(const machine_
device_t *tms32031_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, tms32031_device(machine, *this));
+ return auto_alloc(machine, tms32031_device(machine, *this));
}
device_t *tms32032_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, tms32032_device(machine, *this));
+ return auto_alloc(machine, tms32032_device(machine, *this));
}
@@ -854,7 +854,7 @@ void tms3203x_device::execute_run()
{
// watch for out-of-range stack pointers
if (IREG(TMR_SP) & 0xff000000)
- debugger_break(&m_machine);
+ debugger_break(m_machine);
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
if ((INT32)--IREG(TMR_RC) >= 0)
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c
index 2936d3961bd..73dd70ee972 100644
--- a/src/emu/cpu/tms34010/34010gfx.c
+++ b/src/emu/cpu/tms34010/34010gfx.c
@@ -11,7 +11,7 @@
#define LOG_GFX_OPS 0
-#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine, KEYCODE_L)) logerror x; } while (0)
+#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine(), KEYCODE_L)) logerror x; } while (0)
/* Graphics Instructions */
diff --git a/src/emu/cpu/tms34010/34010ops.c b/src/emu/cpu/tms34010/34010ops.c
index ab162bfd88c..66d5f8237b4 100644
--- a/src/emu/cpu/tms34010/34010ops.c
+++ b/src/emu/cpu/tms34010/34010ops.c
@@ -97,7 +97,7 @@ static void unimpl(tms34010_state *tms, UINT16 op)
if (tms->pc == 0 || opcode_table[tms->direct->read_decrypted_word(TOBYTE(tms->pc)) >> 4] == unimpl)
{
device_set_input_line(tms->device, INPUT_LINE_HALT, ASSERT_LINE);
- debugger_break(tms->device->machine);
+ debugger_break(tms->device->machine());
}
}
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index c89895c5066..65b3b9e9ab0 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -630,7 +630,7 @@ static CPU_INIT( tms34010 )
tms->device = device;
tms->program = device->space(AS_PROGRAM);
tms->direct = &tms->program->direct();
- tms->screen = downcast<screen_device *>(device->machine->device(configdata->screen_tag));
+ tms->screen = downcast<screen_device *>(device->machine().device(configdata->screen_tag));
/* set up the state table */
{
@@ -652,11 +652,11 @@ static CPU_INIT( tms34010 )
}
/* allocate a scanline timer and set it to go off at the start */
- tms->scantimer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), tms);
+ tms->scantimer = device->machine().scheduler().timer_alloc(FUNC(scanline_callback), tms);
tms->scantimer->adjust(attotime::zero);
/* allocate the shiftreg */
- tms->shiftreg = auto_alloc_array(device->machine, UINT16, SHIFTREG_SIZE/2);
+ tms->shiftreg = auto_alloc_array(device->machine(), UINT16, SHIFTREG_SIZE/2);
device->save_item(NAME(tms->pc));
device->save_item(NAME(tms->st));
@@ -669,7 +669,7 @@ static CPU_INIT( tms34010 )
device->save_item(NAME(tms->pixelshift));
device->save_item(NAME(tms->gfxcycles));
device->save_pointer(NAME(&tms->regs[0].reg), ARRAY_LENGTH(tms->regs));
- device->machine->state().register_postload(tms34010_state_postload, tms);
+ device->machine().state().register_postload(tms34010_state_postload, tms);
}
static CPU_RESET( tms34010 )
@@ -799,7 +799,7 @@ static CPU_EXECUTE( tms34010 )
/* check interrupts first */
tms->executing = TRUE;
check_interrupt(tms);
- if ((tms->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if ((tms->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
{
do
{
@@ -1080,14 +1080,14 @@ void tms34010_get_display_params(device_t *cpu, tms34010_display_params *params)
SCREEN_UPDATE( tms340x0 )
{
- pen_t blackpen = get_black_pen(screen->machine);
+ pen_t blackpen = get_black_pen(screen->machine());
tms34010_display_params params;
tms34010_state *tms = NULL;
device_t *cpu;
int x;
/* find the owning CPU */
- for (cpu = screen->machine->m_devicelist.first(); cpu != NULL; cpu = cpu->next())
+ for (cpu = screen->machine().m_devicelist.first(); cpu != NULL; cpu = cpu->next())
{
device_type type = cpu->type();
if (type == TMS34010 || type == TMS34020)
@@ -1200,7 +1200,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* NMI issued? */
if (data & 0x0100)
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG_HSTCTLL:
@@ -1235,7 +1235,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG_INTPEND) &= ~TMS34010_HI;
break;
@@ -1270,7 +1270,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
}
// if (LOG_CONTROL_REGS)
-// logerror("%s: %s = %04X (%d)\n", tms->device->machine->describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
+// logerror("%s: %s = %04X (%d)\n", tms->device->machine().describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
}
@@ -1307,7 +1307,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
IOREG(tms, offset) = data;
// if (LOG_CONTROL_REGS)
-// logerror("%s: %s = %04X (%d)\n", device->machine->describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
+// logerror("%s: %s = %04X (%d)\n", device->machine().describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
switch (offset)
{
@@ -1351,7 +1351,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* NMI issued? */
if (data & 0x0100)
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG020_HSTCTLL:
@@ -1386,7 +1386,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG020_INTPEND) &= ~TMS34010_HI;
break;
@@ -1466,7 +1466,7 @@ READ16_HANDLER( tms34010_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
-// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
+// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{
@@ -1509,7 +1509,7 @@ READ16_HANDLER( tms34020_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
-// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
+// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 31c953c68a1..df8a4714626 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -1298,7 +1298,7 @@ static CPU_INIT( tms99xx )
cpustate->io = device->space(AS_IO);
#if (TMS99XX_MODEL == TMS9995_ID)
- cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
+ cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
#endif
cpustate->idle_callback = param ? param->idle_callback : NULL;
@@ -1815,7 +1815,7 @@ static void tms99xx_set_irq_line(tms99xx_state *cpustate, int irqline, int state
{ /* decrement, then interrupt if reach 0 */
if ((-- cpustate->decrementer_count) == 0)
{
- decrementer_callback(cpustate->device->machine, cpustate, 0);
+ decrementer_callback(cpustate->device->machine(), cpustate, 0);
cpustate->decrementer_count = cpustate->decrementer_interval; /* reload */
}
}
diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c
index 5922099e680..5856bb50611 100755
--- a/src/emu/cpu/upd7725/upd7725.c
+++ b/src/emu/cpu/upd7725/upd7725.c
@@ -72,17 +72,17 @@ device_config *upd96050_device_config::static_alloc_device_config(const machine_
device_t *necdsp_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, necdsp_device(machine, *this));
+ return auto_alloc(machine, necdsp_device(machine, *this));
}
device_t *upd7725_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, upd7725_device(machine, *this));
+ return auto_alloc(machine, upd7725_device(machine, *this));
}
device_t *upd96050_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, upd96050_device(machine, *this));
+ return auto_alloc(machine, upd96050_device(machine, *this));
}
//-------------------------------------------------
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index 80a5b9109f7..7cec6b3a90e 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -59,7 +59,7 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
vtlb_state *vtlb;
/* allocate memory for the core structure */
- vtlb = auto_alloc_clear(cpu->machine, vtlb_state);
+ vtlb = auto_alloc_clear(cpu->machine(), vtlb_state);
/* fill in CPU information */
vtlb->cpudevice = downcast<cpu_device *>(cpu);
@@ -76,17 +76,17 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
assert(vtlb->addrwidth > vtlb->pageshift);
/* allocate the entry array */
- vtlb->live = auto_alloc_array_clear(cpu->machine, offs_t, fixed_entries + dynamic_entries);
+ vtlb->live = auto_alloc_array_clear(cpu->machine(), offs_t, fixed_entries + dynamic_entries);
cpu->save_pointer(NAME(vtlb->live), fixed_entries + dynamic_entries, space);
/* allocate the lookup table */
- vtlb->table = auto_alloc_array_clear(cpu->machine, vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
+ vtlb->table = auto_alloc_array_clear(cpu->machine(), vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
cpu->save_pointer(NAME(vtlb->table), 1 << (vtlb->addrwidth - vtlb->pageshift), space);
/* allocate the fixed page count array */
if (fixed_entries > 0)
{
- vtlb->fixedpages = auto_alloc_array_clear(cpu->machine, int, fixed_entries);
+ vtlb->fixedpages = auto_alloc_array_clear(cpu->machine(), int, fixed_entries);
cpu->save_pointer(NAME(vtlb->fixedpages), fixed_entries, space);
}
return vtlb;
@@ -101,16 +101,16 @@ void vtlb_free(vtlb_state *vtlb)
{
/* free the fixed pages if allocated */
if (vtlb->fixedpages != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->fixedpages);
+ auto_free(vtlb->cpudevice->machine(), vtlb->fixedpages);
/* free the table and array if they exist */
if (vtlb->live != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->live);
+ auto_free(vtlb->cpudevice->machine(), vtlb->live);
if (vtlb->table != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->table);
+ auto_free(vtlb->cpudevice->machine(), vtlb->table);
/* and then the VTLB object itself */
- auto_free(vtlb->cpudevice->machine, vtlb);
+ auto_free(vtlb->cpudevice->machine(), vtlb);
}
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index 5f9139ffc78..546cef949c0 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -1945,8 +1945,8 @@ static CPU_INIT( z180 )
cpustate->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config());
cpustate->irq_callback = irqcallback;
- SZHVC_add = auto_alloc_array(device->machine, UINT8, 2*256*256);
- SZHVC_sub = auto_alloc_array(device->machine, UINT8, 2*256*256);
+ SZHVC_add = auto_alloc_array(device->machine(), UINT8, 2*256*256);
+ SZHVC_sub = auto_alloc_array(device->machine(), UINT8, 2*256*256);
/* set up the state table */
{
diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c
index e25b8f3b24c..444f36b4af2 100644
--- a/src/emu/cpu/z8/z8.c
+++ b/src/emu/cpu/z8/z8.c
@@ -669,8 +669,8 @@ static CPU_INIT( z8 )
cpustate->io = device->space(AS_IO);
/* allocate timers */
- cpustate->t0_timer = device->machine->scheduler().timer_alloc(FUNC(t0_tick), cpustate);
- cpustate->t1_timer = device->machine->scheduler().timer_alloc(FUNC(t1_tick), cpustate);
+ cpustate->t0_timer = device->machine().scheduler().timer_alloc(FUNC(t0_tick), cpustate);
+ cpustate->t1_timer = device->machine().scheduler().timer_alloc(FUNC(t1_tick), cpustate);
/* register for state saving */
device->save_item(NAME(cpustate->pc));
diff --git a/src/emu/cpu/z80/z80daisy.c b/src/emu/cpu/z80/z80daisy.c
index 9b789d0e38d..4b50bd12118 100644
--- a/src/emu/cpu/z80/z80daisy.c
+++ b/src/emu/cpu/z80/z80daisy.c
@@ -95,7 +95,7 @@ void z80_daisy_chain::init(device_t *cpudevice, const z80_daisy_config *daisy)
fatalerror("Device '%s' does not implement the z80daisy interface!", daisy->devname);
// append to the end
- *tailptr = auto_alloc(cpudevice->machine, daisy_entry(target));
+ *tailptr = auto_alloc(cpudevice->machine(), daisy_entry(target));
tailptr = &(*tailptr)->m_next;
}
}
diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c
index c2ed06f4233..fbf9700ab83 100644
--- a/src/emu/crsshair.c
+++ b/src/emu/crsshair.c
@@ -132,8 +132,8 @@ static const rgb_t crosshair_colors[] =
***************************************************************************/
static void crosshair_exit(running_machine &machine);
-static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static void animate(screen_device &device, void *param, bool vblank_state);
@@ -148,7 +148,7 @@ static void animate(screen_device &device, void *param, bool vblank_state);
structures for the given player
-------------------------------------------------*/
-static void create_bitmap(running_machine *machine, int player)
+static void create_bitmap(running_machine &machine, int player)
{
int x, y;
char filename[20];
@@ -156,9 +156,9 @@ static void create_bitmap(running_machine *machine, int player)
/* if we have a bitmap and texture for this player, kill it */
global_free(global.bitmap[player]);
- machine->render().texture_free(global.texture[player]);
+ machine.render().texture_free(global.texture[player]);
- emu_file crossfile(machine->options().crosshair_path(), OPEN_FLAG_READ);
+ emu_file crossfile(machine.options().crosshair_path(), OPEN_FLAG_READ);
if (global.name[player][0] != 0)
{
/* look for user specified file */
@@ -169,7 +169,7 @@ static void create_bitmap(running_machine *machine, int player)
{
/* look for default cross?.png in crsshair\game dir */
sprintf(filename, "cross%d.png", player + 1);
- global.bitmap[player] = render_load_png(crossfile, machine->system().name, filename, NULL, NULL);
+ global.bitmap[player] = render_load_png(crossfile, machine.system().name, filename, NULL, NULL);
/* look for default cross?.png in crsshair dir */
if (global.bitmap[player] == NULL)
@@ -198,7 +198,7 @@ static void create_bitmap(running_machine *machine, int player)
}
/* create a texture to reference the bitmap */
- global.texture[player] = machine->render().texture_alloc(render_texture::hq_scale);
+ global.texture[player] = machine.render().texture_alloc(render_texture::hq_scale);
global.texture[player]->set_bitmap(global.bitmap[player], NULL, TEXFORMAT_ARGB32);
}
@@ -208,10 +208,10 @@ static void create_bitmap(running_machine *machine, int player)
bitmaps and such
-------------------------------------------------*/
-void crosshair_init(running_machine *machine)
+void crosshair_init(running_machine &machine)
{
/* request a callback upon exiting */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
/* clear all the globals */
memset(&global, 0, sizeof(global));
@@ -220,7 +220,7 @@ void crosshair_init(running_machine *machine)
global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
/* determine who needs crosshairs */
- for (const input_port_config *port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (const input_port_config *port = machine.m_portlist.first(); port != NULL; port = port->next())
for (const input_field_config *field = port->fieldlist; field != NULL; field = field->next)
if (field->crossaxis != CROSSHAIR_AXIS_NONE)
{
@@ -235,7 +235,7 @@ void crosshair_init(running_machine *machine)
global.visible[player] = (CROSSHAIR_VISIBILITY_DEFAULT == CROSSHAIR_VISIBILITY_OFF) ? FALSE : TRUE;
/* for now, use the main screen */
- global.screen[player] = machine->primary_screen;
+ global.screen[player] = machine.primary_screen;
create_bitmap(machine, player);
}
@@ -245,8 +245,8 @@ void crosshair_init(running_machine *machine)
config_register(machine, "crosshairs", crosshair_load, crosshair_save);
/* register the animation callback */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(animate, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(animate, NULL);
}
@@ -274,7 +274,7 @@ static void crosshair_exit(running_machine &machine)
if any crosshairs are used
-------------------------------------------------*/
-int crosshair_get_usage(running_machine *machine)
+int crosshair_get_usage(running_machine &machine)
{
return global.usage;
}
@@ -286,7 +286,7 @@ int crosshair_get_usage(running_machine *machine)
Note: auto_time is common for all players
-------------------------------------------------*/
-void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
+void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
settings->auto_time = global.auto_time;
settings->used = global.used[player];
@@ -301,7 +301,7 @@ void crosshair_get_user_settings(running_machine *machine, UINT8 player, crossha
Note: auto_time is common for all players
-------------------------------------------------*/
-void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
+void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
int changed = FALSE;
@@ -346,7 +346,7 @@ static void animate(screen_device &device, void *param, bool vblank_state)
{
/* read all the lightgun values */
if (global.used[player])
- input_port_get_crosshair_position(device.machine, player, &global.x[player], &global.y[player]);
+ input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]);
/* auto visibility */
if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
@@ -405,7 +405,7 @@ void crosshair_render(screen_device &screen)
given player's crosshair
-------------------------------------------------*/
-void crosshair_set_screen(running_machine *machine, int player, device_t *screen)
+void crosshair_set_screen(running_machine &machine, int player, device_t *screen)
{
global.screen[player] = screen;
}
@@ -416,7 +416,7 @@ void crosshair_set_screen(running_machine *machine, int player, device_t *screen
configuration file
-------------------------------------------------*/
-static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_load() is only registered if croshairs are used */
@@ -475,7 +475,7 @@ static void crosshair_load(running_machine *machine, int config_type, xml_data_n
configuration file
-------------------------------------------------*/
-static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_save() is only registered if crosshairs are used */
diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h
index 92285c7f2db..defbea703d1 100644
--- a/src/emu/crsshair.h
+++ b/src/emu/crsshair.h
@@ -59,22 +59,22 @@ struct _crosshair_user_settings
***************************************************************************/
/* initializes the crosshair system */
-void crosshair_init(running_machine *machine);
+void crosshair_init(running_machine &machine);
/* draws crosshair(s) in a given screen, if neccessary */
void crosshair_render(screen_device &screen);
/* sets the screen(s) for a given player's crosshair */
-void crosshair_set_screen(running_machine *machine, int player, device_t *screen);
+void crosshair_set_screen(running_machine &machine, int player, device_t *screen);
/* return TRUE if any crosshairs are used */
-int crosshair_get_usage(running_machine *machine);
+int crosshair_get_usage(running_machine &machine);
/* return the current crosshair settings for the given player */
-void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
+void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
/* modify the current crosshair settings for the given player */
-void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
+void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
#endif /* __CRSSHAIR_H__ */
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 2bd5196eaff..c3e76dd192b 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -99,56 +99,56 @@ static UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT6
static UINT64 global_get(symbol_table &table, void *ref);
static void global_set(symbol_table &table, void *ref, UINT64 value);
-static void execute_help(running_machine *machine, int ref, int params, const char **param);
-static void execute_print(running_machine *machine, int ref, int params, const char **param);
-static void execute_printf(running_machine *machine, int ref, int params, const char **param);
-static void execute_logerror(running_machine *machine, int ref, int params, const char **param);
-static void execute_tracelog(running_machine *machine, int ref, int params, const char **param);
-static void execute_quit(running_machine *machine, int ref, int params, const char **param);
-static void execute_do(running_machine *machine, int ref, int params, const char **param);
-static void execute_step(running_machine *machine, int ref, int params, const char **param);
-static void execute_over(running_machine *machine, int ref, int params, const char **param);
-static void execute_out(running_machine *machine, int ref, int params, const char **param);
-static void execute_go(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_vblank(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_interrupt(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_time(running_machine *machine, int ref, int params, const char *param[]);
-static void execute_focus(running_machine *machine, int ref, int params, const char **param);
-static void execute_ignore(running_machine *machine, int ref, int params, const char **param);
-static void execute_observe(running_machine *machine, int ref, int params, const char **param);
-static void execute_next(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment_del(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment_save(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpset(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpclear(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpdisenable(running_machine *machine, int ref, int params, const char **param);
-static void execute_bplist(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpset(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpclear(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpdisenable(running_machine *machine, int ref, int params, const char **param);
-static void execute_wplist(running_machine *machine, int ref, int params, const char **param);
-static void execute_hotspot(running_machine *machine, int ref, int params, const char **param);
-static void execute_save(running_machine *machine, int ref, int params, const char **param);
-static void execute_load(running_machine *machine, int ref, int params, const char **param);
-static void execute_dump(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatinit(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatnext(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatlist(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatundo(running_machine *machine, int ref, int params, const char **param);
-static void execute_dasm(running_machine *machine, int ref, int params, const char **param);
-static void execute_find(running_machine *machine, int ref, int params, const char **param);
-static void execute_trace(running_machine *machine, int ref, int params, const char **param);
-static void execute_traceover(running_machine *machine, int ref, int params, const char **param);
-static void execute_traceflush(running_machine *machine, int ref, int params, const char **param);
-static void execute_history(running_machine *machine, int ref, int params, const char **param);
-static void execute_snap(running_machine *machine, int ref, int params, const char **param);
-static void execute_source(running_machine *machine, int ref, int params, const char **param);
-static void execute_map(running_machine *machine, int ref, int params, const char **param);
-static void execute_memdump(running_machine *machine, int ref, int params, const char **param);
-static void execute_symlist(running_machine *machine, int ref, int params, const char **param);
-static void execute_softreset(running_machine *machine, int ref, int params, const char **param);
-static void execute_hardreset(running_machine *machine, int ref, int params, const char **param);
+static void execute_help(running_machine &machine, int ref, int params, const char **param);
+static void execute_print(running_machine &machine, int ref, int params, const char **param);
+static void execute_printf(running_machine &machine, int ref, int params, const char **param);
+static void execute_logerror(running_machine &machine, int ref, int params, const char **param);
+static void execute_tracelog(running_machine &machine, int ref, int params, const char **param);
+static void execute_quit(running_machine &machine, int ref, int params, const char **param);
+static void execute_do(running_machine &machine, int ref, int params, const char **param);
+static void execute_step(running_machine &machine, int ref, int params, const char **param);
+static void execute_over(running_machine &machine, int ref, int params, const char **param);
+static void execute_out(running_machine &machine, int ref, int params, const char **param);
+static void execute_go(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_vblank(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_interrupt(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_time(running_machine &machine, int ref, int params, const char *param[]);
+static void execute_focus(running_machine &machine, int ref, int params, const char **param);
+static void execute_ignore(running_machine &machine, int ref, int params, const char **param);
+static void execute_observe(running_machine &machine, int ref, int params, const char **param);
+static void execute_next(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment_del(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment_save(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpset(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpclear(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpdisenable(running_machine &machine, int ref, int params, const char **param);
+static void execute_bplist(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpset(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpclear(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpdisenable(running_machine &machine, int ref, int params, const char **param);
+static void execute_wplist(running_machine &machine, int ref, int params, const char **param);
+static void execute_hotspot(running_machine &machine, int ref, int params, const char **param);
+static void execute_save(running_machine &machine, int ref, int params, const char **param);
+static void execute_load(running_machine &machine, int ref, int params, const char **param);
+static void execute_dump(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatinit(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatnext(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatlist(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatundo(running_machine &machine, int ref, int params, const char **param);
+static void execute_dasm(running_machine &machine, int ref, int params, const char **param);
+static void execute_find(running_machine &machine, int ref, int params, const char **param);
+static void execute_trace(running_machine &machine, int ref, int params, const char **param);
+static void execute_traceover(running_machine &machine, int ref, int params, const char **param);
+static void execute_traceflush(running_machine &machine, int ref, int params, const char **param);
+static void execute_history(running_machine &machine, int ref, int params, const char **param);
+static void execute_snap(running_machine &machine, int ref, int params, const char **param);
+static void execute_source(running_machine &machine, int ref, int params, const char **param);
+static void execute_map(running_machine &machine, int ref, int params, const char **param);
+static void execute_memdump(running_machine &machine, int ref, int params, const char **param);
+static void execute_symlist(running_machine &machine, int ref, int params, const char **param);
+static void execute_softreset(running_machine &machine, int ref, int params, const char **param);
+static void execute_hardreset(running_machine &machine, int ref, int params, const char **param);
@@ -226,7 +226,7 @@ INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space *s
system
-------------------------------------------------*/
-void debug_command_init(running_machine *machine)
+void debug_command_init(running_machine &machine)
{
symbol_table *symtable = debug_cpu_get_global_symtable(machine);
const char *name;
@@ -244,7 +244,7 @@ void debug_command_init(running_machine *machine)
void *base;
/* stop when we run out of items */
- name = machine->state().indexed_item(itemnum, base, valsize, valcount);
+ name = machine.state().indexed_item(itemnum, base, valsize, valcount);
if (name == NULL)
break;
@@ -369,10 +369,10 @@ void debug_command_init(running_machine *machine)
debug_console_register_command(machine, "softreset", CMDFLAG_NONE, 0, 0, 1, execute_softreset);
debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
/* set up the initial debugscript if specified */
- name = machine->options().debug_script();
+ name = machine.options().debug_script();
if (name[0] != 0)
debug_cpu_source_script(machine, name);
}
@@ -389,7 +389,7 @@ static void debug_command_exit(running_machine &machine)
device->debug()->trace(NULL, 0, NULL);
if (cheat.length)
- auto_free(&machine, cheat.cheatmap);
+ auto_free(machine, cheat.cheatmap);
}
@@ -478,7 +478,7 @@ static void global_set(symbol_table &table, void *ref, UINT64 value)
number parameter
-------------------------------------------------*/
-int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result)
+int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@@ -506,7 +506,7 @@ int debug_command_parameter_number(running_machine *machine, const char *param,
parameter as a cpu
-------------------------------------------------*/
-int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result)
+int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result)
{
UINT64 cpunum;
@@ -523,7 +523,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
}
/* first look for a tag match */
- *result = machine->device(param);
+ *result = machine.device(param);
if (*result != NULL)
return TRUE;
@@ -540,7 +540,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
/* if we got a valid one, return */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
@@ -559,7 +559,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
address space
-------------------------------------------------*/
-int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result)
+int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result)
{
device_t *cpu;
@@ -583,7 +583,7 @@ int debug_command_parameter_cpu_space(running_machine *machine, const char *para
an expression parameter
-------------------------------------------------*/
-static int debug_command_parameter_expression(running_machine *machine, const char *param, parsed_expression &result)
+static int debug_command_parameter_expression(running_machine &machine, const char *param, parsed_expression &result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@@ -611,7 +611,7 @@ static int debug_command_parameter_expression(running_machine *machine, const ch
command parameter
-------------------------------------------------*/
-static int debug_command_parameter_command(running_machine *machine, const char *param)
+static int debug_command_parameter_command(running_machine &machine, const char *param)
{
CMDERR err;
@@ -641,7 +641,7 @@ static int debug_command_parameter_command(running_machine *machine, const char
execute_help - execute the help command
-------------------------------------------------*/
-static void execute_help(running_machine *machine, int ref, int params, const char *param[])
+static void execute_help(running_machine &machine, int ref, int params, const char *param[])
{
if (params == 0)
debug_console_printf_wrap(machine, 80, "%s\n", debug_get_help(""));
@@ -654,7 +654,7 @@ static void execute_help(running_machine *machine, int ref, int params, const ch
execute_print - execute the print command
-------------------------------------------------*/
-static void execute_print(running_machine *machine, int ref, int params, const char *param[])
+static void execute_print(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
int i;
@@ -675,7 +675,7 @@ static void execute_print(running_machine *machine, int ref, int params, const c
mini_printf - safe printf to a buffer
-------------------------------------------------*/
-static int mini_printf(running_machine *machine, char *buffer, const char *format, int params, UINT64 *param)
+static int mini_printf(running_machine &machine, char *buffer, const char *format, int params, UINT64 *param)
{
const char *f = format;
char *p = buffer;
@@ -769,7 +769,7 @@ static int mini_printf(running_machine *machine, char *buffer, const char *forma
execute_printf - execute the printf command
-------------------------------------------------*/
-static void execute_printf(running_machine *machine, int ref, int params, const char *param[])
+static void execute_printf(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -790,7 +790,7 @@ static void execute_printf(running_machine *machine, int ref, int params, const
execute_logerror - execute the logerror command
-------------------------------------------------*/
-static void execute_logerror(running_machine *machine, int ref, int params, const char *param[])
+static void execute_logerror(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -811,7 +811,7 @@ static void execute_logerror(running_machine *machine, int ref, int params, cons
execute_tracelog - execute the tracelog command
-------------------------------------------------*/
-static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[])
+static void execute_tracelog(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -832,10 +832,10 @@ static void execute_tracelog(running_machine *machine, int ref, int params, cons
execute_quit - execute the quit command
-------------------------------------------------*/
-static void execute_quit(running_machine *machine, int ref, int params, const char *param[])
+static void execute_quit(running_machine &machine, int ref, int params, const char *param[])
{
mame_printf_error("Exited via the debugger\n");
- machine->schedule_exit();
+ machine.schedule_exit();
}
@@ -843,7 +843,7 @@ static void execute_quit(running_machine *machine, int ref, int params, const ch
execute_do - execute the do command
-------------------------------------------------*/
-static void execute_do(running_machine *machine, int ref, int params, const char *param[])
+static void execute_do(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 dummy;
debug_command_parameter_number(machine, param[0], &dummy);
@@ -854,7 +854,7 @@ static void execute_do(running_machine *machine, int ref, int params, const char
execute_step - execute the step command
-------------------------------------------------*/
-static void execute_step(running_machine *machine, int ref, int params, const char *param[])
+static void execute_step(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@@ -870,7 +870,7 @@ static void execute_step(running_machine *machine, int ref, int params, const ch
execute_over - execute the over command
-------------------------------------------------*/
-static void execute_over(running_machine *machine, int ref, int params, const char *param[])
+static void execute_over(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@@ -886,7 +886,7 @@ static void execute_over(running_machine *machine, int ref, int params, const ch
execute_out - execute the out command
-------------------------------------------------*/
-static void execute_out(running_machine *machine, int ref, int params, const char *param[])
+static void execute_out(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->single_step_out();
}
@@ -896,7 +896,7 @@ static void execute_out(running_machine *machine, int ref, int params, const cha
execute_go - execute the go command
-------------------------------------------------*/
-static void execute_go(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 addr = ~0;
@@ -913,7 +913,7 @@ static void execute_go(running_machine *machine, int ref, int params, const char
command
-------------------------------------------------*/
-static void execute_go_vblank(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_vblank(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_vblank();
}
@@ -923,7 +923,7 @@ static void execute_go_vblank(running_machine *machine, int ref, int params, con
execute_go_interrupt - execute the goint command
-------------------------------------------------*/
-static void execute_go_interrupt(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_interrupt(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 irqline = -1;
@@ -939,7 +939,7 @@ static void execute_go_interrupt(running_machine *machine, int ref, int params,
execute_go_time - execute the gtime command
-------------------------------------------------*/
-static void execute_go_time(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_time(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 milliseconds = -1;
@@ -955,7 +955,7 @@ static void execute_go_time(running_machine *machine, int ref, int params, const
execute_next - execute the next command
-------------------------------------------------*/
-static void execute_next(running_machine *machine, int ref, int params, const char *param[])
+static void execute_next(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_next_device();
}
@@ -965,7 +965,7 @@ static void execute_next(running_machine *machine, int ref, int params, const ch
execute_focus - execute the focus command
-------------------------------------------------*/
-static void execute_focus(running_machine *machine, int ref, int params, const char *param[])
+static void execute_focus(running_machine &machine, int ref, int params, const char *param[])
{
/* validate params */
device_t *cpu;
@@ -977,7 +977,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
/* then loop over CPUs and set the ignore flags on all other CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != cpu)
exec->device().debug()->ignore(true);
debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag());
@@ -988,7 +988,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
execute_ignore - execute the ignore command
-------------------------------------------------*/
-static void execute_ignore(running_machine *machine, int ref, int params, const char *param[])
+static void execute_ignore(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@@ -997,7 +997,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (!exec->device().debug()->observing())
@@ -1030,7 +1030,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* make sure this isn't the last live CPU */
device_execute_interface *exec = NULL;
bool gotone;
- for (gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != devicelist[paramnum] && exec->device().debug()->observing())
break;
if (!gotone)
@@ -1050,7 +1050,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
execute_observe - execute the observe command
-------------------------------------------------*/
-static void execute_observe(running_machine *machine, int ref, int params, const char *param[])
+static void execute_observe(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@@ -1059,7 +1059,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (exec->device().debug()->observing())
@@ -1100,7 +1100,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
execute_comment - add a comment to a line
-------------------------------------------------*/
-static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@@ -1122,7 +1122,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
/* Now try adding the comment */
cpu->debug()->comment_add(address, param[1], 0x00ff0000);
- cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
+ cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@@ -1130,7 +1130,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
execute_comment_del - remove a comment from an addr
--------------------------------------------------------*/
-static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment_del(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@@ -1146,7 +1146,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
/* If it's a number, it must be an address */
/* The bankoff and cbn will be pulled from what's currently active */
cpu->debug()->comment_remove(address);
- cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
+ cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@@ -1154,7 +1154,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
execute_comment - add a comment to a line
-------------------------------------------------*/
-static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment_save(running_machine &machine, int ref, int params, const char *param[])
{
if (debug_comment_save(machine))
debug_console_printf(machine, "Comments successfully saved\n");
@@ -1166,7 +1166,7 @@ static void execute_comment_save(running_machine *machine, int ref, int params,
command
-------------------------------------------------*/
-static void execute_bpset(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpset(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
const char *action = NULL;
@@ -1201,14 +1201,14 @@ static void execute_bpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
-static void execute_bpclear(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_clear_all();
debug_console_printf(machine, "Cleared all breakpoints\n");
}
@@ -1219,7 +1219,7 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_clear(bpindex))
found = true;
if (found)
@@ -1235,14 +1235,14 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
-static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
@@ -1256,7 +1256,7 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
@@ -1272,13 +1272,13 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
-static void execute_bplist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_first() != NULL)
{
debug_console_printf(machine, "Device '%s' breakpoints:\n", device->tag());
@@ -1306,7 +1306,7 @@ static void execute_bplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
-static void execute_wpset(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpset(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
const char *action = NULL;
@@ -1359,14 +1359,14 @@ static void execute_wpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
-static void execute_wpclear(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_clear_all();
debug_console_printf(machine, "Cleared all watchpoints\n");
}
@@ -1377,7 +1377,7 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_clear(wpindex))
found = true;
if (found)
@@ -1393,14 +1393,14 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
-static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
@@ -1414,7 +1414,7 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
@@ -1430,13 +1430,13 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
-static void execute_wplist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
if (device->debug()->watchpoint_first(spacenum) != NULL)
{
@@ -1470,7 +1470,7 @@ static void execute_wplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
-static void execute_hotspot(running_machine *machine, int ref, int params, const char *param[])
+static void execute_hotspot(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, and there are live hotspots, clear them */
if (params == 0)
@@ -1478,7 +1478,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
bool cleared = false;
/* loop over CPUs and find live spots */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->hotspot_tracking_enabled())
{
device->debug()->hotspot_track(0, 0);
@@ -1512,7 +1512,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
execute_save - execute the save command
-------------------------------------------------*/
-static void execute_save(running_machine *machine, int ref, int params, const char *param[])
+static void execute_save(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -1556,7 +1556,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
execute_load - execute the load command
-------------------------------------------------*/
-static void execute_load(running_machine *machine, int ref, int params, const char *param[])
+static void execute_load(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -1606,7 +1606,7 @@ static void execute_load(running_machine *machine, int ref, int params, const ch
execute_dump - execute the dump command
-------------------------------------------------*/
-static void execute_dump(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dump(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length, width = 0, ascii = 1;
address_space *space;
@@ -1704,7 +1704,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
execute_cheatinit - initialize the cheat system
-------------------------------------------------*/
-static void execute_cheatinit(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatinit(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length = 0, real_length = 0;
address_space *space;
@@ -1867,7 +1867,7 @@ static void execute_cheatinit(running_machine *machine, int ref, int params, con
execute_cheatnext - execute the search
-------------------------------------------------*/
-static void execute_cheatnext(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatnext(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
UINT64 cheatindex;
@@ -2044,7 +2044,7 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
execute_cheatlist - show a list of active cheat
-------------------------------------------------*/
-static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatlist(running_machine &machine, int ref, int params, const char *param[])
{
char spaceletter, sizeletter;
address_space *space;
@@ -2110,7 +2110,7 @@ static void execute_cheatlist(running_machine *machine, int ref, int params, con
execute_cheatundo - undo the last search
-------------------------------------------------*/
-static void execute_cheatundo(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatundo(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 cheatindex;
UINT32 undo_count = 0;
@@ -2139,7 +2139,7 @@ static void execute_cheatundo(running_machine *machine, int ref, int params, con
execute_find - execute the find command
-------------------------------------------------*/
-static void execute_find(running_machine *machine, int ref, int params, const char *param[])
+static void execute_find(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -2238,7 +2238,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
execute_dasm - execute the dasm command
-------------------------------------------------*/
-static void execute_dasm(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dasm(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length, bytes = 1;
int minbytes, maxbytes, byteswidth;
@@ -2353,7 +2353,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
trace over and trace info
-------------------------------------------------*/
-static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
+static void execute_trace_internal(running_machine &machine, int ref, int params, const char *param[], int trace_over)
{
const char *action = NULL, *filename = param[0];
device_t *cpu;
@@ -2403,7 +2403,7 @@ static void execute_trace_internal(running_machine *machine, int ref, int params
execute_trace - execute the trace command
-------------------------------------------------*/
-static void execute_trace(running_machine *machine, int ref, int params, const char *param[])
+static void execute_trace(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 0);
}
@@ -2413,7 +2413,7 @@ static void execute_trace(running_machine *machine, int ref, int params, const c
execute_traceover - execute the trace over command
-------------------------------------------------*/
-static void execute_traceover(running_machine *machine, int ref, int params, const char *param[])
+static void execute_traceover(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 1);
}
@@ -2423,7 +2423,7 @@ static void execute_traceover(running_machine *machine, int ref, int params, con
execute_traceflush - execute the trace flush command
-------------------------------------------------*/
-static void execute_traceflush(running_machine *machine, int ref, int params, const char *param[])
+static void execute_traceflush(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_flush_traces(machine);
}
@@ -2433,7 +2433,7 @@ static void execute_traceflush(running_machine *machine, int ref, int params, co
execute_history - execute the history command
-------------------------------------------------*/
-static void execute_history(running_machine *machine, int ref, int params, const char *param[])
+static void execute_history(running_machine &machine, int ref, int params, const char *param[])
{
/* validate parameters */
address_space *space;
@@ -2477,12 +2477,12 @@ static void execute_history(running_machine *machine, int ref, int params, const
execute_snap - execute the snapshot command
-------------------------------------------------*/
-static void execute_snap(running_machine *machine, int ref, int params, const char *param[])
+static void execute_snap(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, use the default behavior */
if (params == 0)
{
- machine->video().save_active_screen_snapshots();
+ machine.video().save_active_screen_snapshots();
debug_console_printf(machine, "Saved snapshot\n");
}
@@ -2492,9 +2492,9 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
const char *filename = param[0];
int scrnum = (params > 1) ? atoi(param[1]) : 0;
- screen_device *screen = downcast<screen_device *>(machine->m_devicelist.find(SCREEN, scrnum));
+ screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, scrnum));
- if ((screen == NULL) || !machine->render().is_live(*screen))
+ if ((screen == NULL) || !machine.render().is_live(*screen))
{
debug_console_printf(machine, "Invalid screen number '%d'\n", scrnum);
return;
@@ -2503,7 +2503,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
astring fname(filename);
if (fname.find(0, ".png") == -1)
fname.cat(".png");
- emu_file file(machine->options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname);
if (filerr != FILERR_NONE)
@@ -2512,7 +2512,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
return;
}
- screen->machine->video().save_snapshot(screen, file);
+ screen->machine().video().save_snapshot(screen, file);
debug_console_printf(machine, "Saved screen #%d snapshot as '%s'\n", scrnum, filename);
}
}
@@ -2522,7 +2522,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
execute_source - execute the source command
-------------------------------------------------*/
-static void execute_source(running_machine *machine, int ref, int params, const char *param[])
+static void execute_source(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_source_script(machine, param[0]);
}
@@ -2532,7 +2532,7 @@ static void execute_source(running_machine *machine, int ref, int params, const
execute_map - execute the map command
-------------------------------------------------*/
-static void execute_map(running_machine *machine, int ref, int params, const char *param[])
+static void execute_map(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
offs_t taddress;
@@ -2567,7 +2567,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
execute_memdump - execute the memdump command
-------------------------------------------------*/
-static void execute_memdump(running_machine *machine, int ref, int params, const char **param)
+static void execute_memdump(running_machine &machine, int ref, int params, const char **param)
{
FILE *file;
const char *filename;
@@ -2596,7 +2596,7 @@ static int CLIB_DECL symbol_sort_compare(const void *item1, const void *item2)
return strcmp(str1, str2);
}
-static void execute_symlist(running_machine *machine, int ref, int params, const char **param)
+static void execute_symlist(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = NULL;
const char *namelist[1000];
@@ -2654,9 +2654,9 @@ static void execute_symlist(running_machine *machine, int ref, int params, const
execute_softreset - execute the softreset command
-------------------------------------------------*/
-static void execute_softreset(running_machine *machine, int ref, int params, const char **param)
+static void execute_softreset(running_machine &machine, int ref, int params, const char **param)
{
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -2664,7 +2664,7 @@ static void execute_softreset(running_machine *machine, int ref, int params, con
execute_hardreset - execute the hardreset command
-------------------------------------------------*/
-static void execute_hardreset(running_machine *machine, int ref, int params, const char **param)
+static void execute_hardreset(running_machine &machine, int ref, int params, const char **param)
{
- machine->schedule_hard_reset();
+ machine.schedule_hard_reset();
}
diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h
index 7e43b784786..0944df45f89 100644
--- a/src/emu/debug/debugcmd.h
+++ b/src/emu/debug/debugcmd.h
@@ -20,19 +20,19 @@
/* ----- initialization ----- */
/* initializes the command system */
-void debug_command_init(running_machine *machine);
+void debug_command_init(running_machine &machine);
/* ----- parameter validation ----- */
/* validates a number parameter */
-int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result);
+int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result);
/* validates a parameter as a cpu */
-int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result);
+int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result);
/* validates a parameter as a cpu and retrieves the given address space */
-int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result);
+int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result);
#endif
diff --git a/src/emu/debug/debugcon.c b/src/emu/debug/debugcon.c
index f09d3cce4fb..e73b463a99a 100644
--- a/src/emu/debug/debugcon.c
+++ b/src/emu/debug/debugcon.c
@@ -43,7 +43,7 @@ struct _debug_command
char command[32];
const char * params;
const char * help;
- void (*handler)(running_machine *machine, int ref, int params, const char **param);
+ void (*handler)(running_machine &machine, int ref, int params, const char **param);
void (*handler_ex)(int ref);
UINT32 flags;
int ref;
@@ -83,7 +83,7 @@ static void debug_console_exit(running_machine &machine);
system
-------------------------------------------------*/
-void debug_console_init(running_machine *machine)
+void debug_console_init(running_machine &machine)
{
/* allocate text buffers */
console_textbuf = text_buffer_alloc(CONSOLE_BUF_SIZE, CONSOLE_MAX_LINES);
@@ -96,10 +96,10 @@ void debug_console_init(running_machine *machine)
/* print the opening lines */
debug_console_printf(machine, "MAME new debugger version %s\n", build_version);
- debug_console_printf(machine, "Currently targeting %s (%s)\n", machine->system().name, machine->system().description);
+ debug_console_printf(machine, "Currently targeting %s (%s)\n", machine.system().name, machine.system().description);
/* request callback upon exiting */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
}
@@ -193,7 +193,7 @@ static void trim_parameter(char **paramptr, int keep_quotes)
command
-------------------------------------------------*/
-static CMDERR internal_execute_command(running_machine *machine, int execute, int params, char **param)
+static CMDERR internal_execute_command(running_machine &machine, int execute, int params, char **param)
{
debug_command *cmd, *found = NULL;
int i, foundcount = 0;
@@ -268,7 +268,7 @@ static CMDERR internal_execute_command(running_machine *machine, int execute, in
and either executes or just validates it
-------------------------------------------------*/
-static CMDERR internal_parse_command(running_machine *machine, const char *original_command, int execute)
+static CMDERR internal_parse_command(running_machine &machine, const char *original_command, int execute)
{
char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH];
char *params[MAX_COMMAND_PARAMS] = { 0 };
@@ -364,7 +364,7 @@ static CMDERR internal_parse_command(running_machine *machine, const char *origi
command string
-------------------------------------------------*/
-CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo)
+CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo)
{
CMDERR result;
@@ -387,7 +387,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
/* update all views */
if (echo)
{
- machine->debug_view().update_all();
+ machine.debug_view().update_all();
debugger_refresh_display(machine);
}
return result;
@@ -399,7 +399,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
command string
-------------------------------------------------*/
-CMDERR debug_console_validate_command(running_machine *machine, const char *command)
+CMDERR debug_console_validate_command(running_machine &machine, const char *command)
{
return internal_parse_command(machine, command, FALSE);
}
@@ -410,12 +410,12 @@ CMDERR debug_console_validate_command(running_machine *machine, const char *comm
command handler
-------------------------------------------------*/
-void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param))
+void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param))
{
debug_command *cmd;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
- assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
+ assert_always((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
cmd = auto_alloc_clear(machine, debug_command);
@@ -474,7 +474,7 @@ const char *debug_cmderr_to_string(CMDERR error)
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...)
+void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...)
{
astring buffer;
va_list arg;
@@ -486,7 +486,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
@@ -496,7 +496,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args)
+void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args)
{
astring buffer;
@@ -504,7 +504,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
@@ -514,7 +514,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...)
+void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...)
{
astring buffer;
va_list arg;
@@ -526,7 +526,7 @@ void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol,
text_buffer_print_wrap(console_textbuf, buffer, wrapcol);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h
index 3ff691c9dbd..9977a19b578 100644
--- a/src/emu/debug/debugcon.h
+++ b/src/emu/debug/debugcon.h
@@ -75,18 +75,18 @@ typedef UINT32 CMDERR;
***************************************************************************/
/* initialization */
-void debug_console_init(running_machine *machine);
+void debug_console_init(running_machine &machine);
/* command handling */
-CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo);
-CMDERR debug_console_validate_command(running_machine *machine, const char *command);
-void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param));
+CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo);
+CMDERR debug_console_validate_command(running_machine &machine, const char *command);
+void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param));
const char * debug_cmderr_to_string(CMDERR error);
/* console management */
-void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...) ATTR_PRINTF(2,3);
-void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args);
-void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
+void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...) ATTR_PRINTF(2,3);
+void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args);
+void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
text_buffer * debug_console_get_textbuf(void);
/* errorlog management */
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index d530745c6ed..e79bd70d9e0 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -115,15 +115,15 @@ struct _debugcpu_private
static void debug_cpu_exit(running_machine &machine);
static void on_vblank(screen_device &device, void *param, bool vblank_state);
static void reset_transient_flags(running_machine &machine);
-static void process_source_file(running_machine *machine);
+static void process_source_file(running_machine &machine);
/* expression handlers */
static UINT64 expression_read_memory(void *param, const char *name, expression_space space, UINT32 address, int size);
static UINT64 expression_read_program_direct(address_space *space, int opcode, offs_t address, int size);
-static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size);
+static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size);
static void expression_write_memory(void *param, const char *name, expression_space space, UINT32 address, int size, UINT64 data);
static void expression_write_program_direct(address_space *space, int opcode, offs_t address, int size, UINT64 data);
-static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data);
+static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data);
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
/* variable getters/setters */
@@ -143,23 +143,23 @@ static UINT64 get_frame(symbol_table &table, void *ref);
information for debugging
-------------------------------------------------*/
-void debug_cpu_init(running_machine *machine)
+void debug_cpu_init(running_machine &machine)
{
- screen_device *first_screen = machine->first_screen();
+ screen_device *first_screen = machine.first_screen();
debugcpu_private *global;
int regnum;
/* allocate and reset globals */
- machine->debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
+ machine.debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
global->execution_state = EXECUTION_STATE_STOPPED;
global->bpindex = 1;
global->wpindex = 1;
/* create a global symbol table */
- global->symtable = global_alloc(symbol_table(machine));
+ global->symtable = global_alloc(symbol_table(&machine));
// configure our base memory accessors
- debug_cpu_configure_memory(*machine, *global->symtable);
+ debug_cpu_configure_memory(machine, *global->symtable);
/* add "wpaddr", "wpdata", "cycles", "cpunum", "logunmap" to the global symbol table */
global->symtable->add("wpaddr", symbol_table::READ_ONLY, &global->wpaddr);
@@ -178,13 +178,13 @@ void debug_cpu_init(running_machine *machine)
}
/* first CPU is visible by default */
- global->visiblecpu = machine->firstcpu;
+ global->visiblecpu = machine.firstcpu;
/* add callback for breaking on VBLANK */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(on_vblank, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(on_vblank, NULL);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
}
@@ -200,11 +200,11 @@ void debug_cpu_configure_memory(running_machine &machine, symbol_table &table)
fatalerror
-------------------------------------------------*/
-void debug_cpu_flush_traces(running_machine *machine)
+void debug_cpu_flush_traces(running_machine &machine)
{
/* this can be called on exit even when no debugging is enabled, so
make sure the devdebug is valid before proceeding */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug() != NULL)
device->debug()->trace_flush();
}
@@ -220,9 +220,9 @@ void debug_cpu_flush_traces(running_machine *machine)
device (the one that commands should apply to)
-------------------------------------------------*/
-device_t *debug_cpu_get_visible_cpu(running_machine *machine)
+device_t *debug_cpu_get_visible_cpu(running_machine &machine)
{
- return machine->debugcpu_data->visiblecpu;
+ return machine.debugcpu_data->visiblecpu;
}
@@ -231,9 +231,9 @@ device_t *debug_cpu_get_visible_cpu(running_machine *machine)
the debugger is currently live
-------------------------------------------------*/
-int debug_cpu_within_instruction_hook(running_machine *machine)
+int debug_cpu_within_instruction_hook(running_machine &machine)
{
- return machine->debugcpu_data->within_instruction_hook;
+ return machine.debugcpu_data->within_instruction_hook;
}
@@ -242,9 +242,9 @@ int debug_cpu_within_instruction_hook(running_machine *machine)
current execution state is stopped
-------------------------------------------------*/
-int debug_cpu_is_stopped(running_machine *machine)
+int debug_cpu_is_stopped(running_machine &machine)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
return (global != NULL) ? (global->execution_state == EXECUTION_STATE_STOPPED) : false;
}
@@ -259,9 +259,9 @@ int debug_cpu_is_stopped(running_machine *machine)
global symbol table
-------------------------------------------------*/
-symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
+symbol_table *debug_cpu_get_global_symtable(running_machine &machine)
{
- return machine->debugcpu_data->symtable;
+ return machine.debugcpu_data->symtable;
}
@@ -270,9 +270,9 @@ symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
locally-visible symbol table
-------------------------------------------------*/
-symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
+symbol_table *debug_cpu_get_visible_symtable(running_machine &machine)
{
- return &machine->debugcpu_data->visiblecpu->debug()->symtable();
+ return &machine.debugcpu_data->visiblecpu->debug()->symtable();
}
@@ -281,9 +281,9 @@ symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
command script to execute
-------------------------------------------------*/
-void debug_cpu_source_script(running_machine *machine, const char *file)
+void debug_cpu_source_script(running_machine &machine, const char *file)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
/* close any existing source file */
if (global->source_file != NULL)
@@ -298,7 +298,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
global->source_file = fopen(file, "r");
if (!global->source_file)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (machine.phase() == MACHINE_PHASE_RUNNING)
debug_console_printf(machine, "Cannot open command file '%s'\n", file);
else
fatalerror("Cannot open command file '%s'", file);
@@ -317,7 +317,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
// the given machine
//-------------------------------------------------
-bool debug_comment_save(running_machine *machine)
+bool debug_comment_save(running_machine &machine)
{
// if we don't have a root, bail
xml_data_node *root = xml_file_create();
@@ -337,11 +337,11 @@ bool debug_comment_save(running_machine *machine)
xml_data_node *systemnode = xml_add_child(commentnode, "system", NULL);
if (systemnode == NULL)
throw emu_exception();
- xml_set_attribute(systemnode, "name", machine->system().name);
+ xml_set_attribute(systemnode, "name", machine.system().name);
// for each device
bool found_comments = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->comment_count() > 0)
{
// create a node for this device
@@ -359,8 +359,8 @@ bool debug_comment_save(running_machine *machine)
// flush the file
if (found_comments)
{
- emu_file file(machine->options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- file_error filerr = file.open(machine->basename(), ".cmt");
+ emu_file file(machine.options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ file_error filerr = file.open(machine.basename(), ".cmt");
if (filerr == FILERR_NONE)
xml_file_write(root, file);
}
@@ -382,11 +382,11 @@ bool debug_comment_save(running_machine *machine)
// the given machine
//-------------------------------------------------
-bool debug_comment_load(running_machine *machine)
+bool debug_comment_load(running_machine &machine)
{
// open the file
- emu_file file(machine->options().comment_directory(), OPEN_FLAG_READ);
- file_error filerr = file.open(machine->basename(), ".cmt");
+ emu_file file(machine.options().comment_directory(), OPEN_FLAG_READ);
+ file_error filerr = file.open(machine.basename(), ".cmt");
// if an error, just return false
if (filerr != FILERR_NONE)
@@ -413,13 +413,13 @@ bool debug_comment_load(running_machine *machine)
// check to make sure the file is applicable
xml_data_node *systemnode = xml_get_sibling(commentnode->child, "system");
const char *name = xml_get_attribute_string(systemnode, "name", "");
- if (strcmp(name, machine->system().name) != 0)
+ if (strcmp(name, machine.system().name) != 0)
throw emu_exception();
// iterate over devices
for (xml_data_node *cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu"))
{
- device_t *device = machine->device(xml_get_attribute_string(cpunode, "tag", ""));
+ device_t *device = machine.device(xml_get_attribute_string(cpunode, "tag", ""));
if (device != NULL)
if (!device->debug()->comment_import(*cpunode))
throw emu_exception();
@@ -471,7 +471,7 @@ int debug_cpu_translate(address_space *space, int intention, offs_t *address)
UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT64 custom;
UINT8 result;
@@ -507,7 +507,7 @@ UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translati
UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT16 result;
/* mask against the logical byte mask */
@@ -562,7 +562,7 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT32 result;
/* mask against the logical byte mask */
@@ -617,7 +617,7 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT64 result;
/* mask against the logical byte mask */
@@ -691,7 +691,7 @@ UINT64 debug_read_memory(address_space *space, offs_t address, int size, int app
void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -725,7 +725,7 @@ void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int app
void debug_write_word(address_space *_space, offs_t address, UINT16 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -778,7 +778,7 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -831,7 +831,7 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -902,7 +902,7 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
{
address_space *space = const_cast<address_space *>(_space);
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* keep in logical range */
address &= space->logbytemask();
@@ -1072,7 +1072,7 @@ static void on_vblank(screen_device &device, void *param, bool vblank_state)
{
/* just set a global flag to be consumed later */
if (vblank_state)
- device.machine->debugcpu_data->vblank_occurred = true;
+ device.machine().debugcpu_data->vblank_occurred = true;
}
@@ -1095,9 +1095,9 @@ static void reset_transient_flags(running_machine &machine)
a source file
-------------------------------------------------*/
-static void process_source_file(running_machine *machine)
+static void process_source_file(running_machine &machine)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
/* loop until the file is exhausted or until we are executing again */
while (global->source_file != NULL && global->execution_state == EXECUTION_STATE_STOPPED)
@@ -1145,11 +1145,11 @@ static void process_source_file(running_machine *machine)
based on a case insensitive tag search
-------------------------------------------------*/
-static device_t *expression_get_device(running_machine *machine, const char *tag)
+static device_t *expression_get_device(running_machine &machine, const char *tag)
{
device_t *device;
- for (device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (mame_stricmp(device->tag(), tag) == 0)
return device;
@@ -1165,7 +1165,7 @@ static device_t *expression_get_device(running_machine *machine, const char *tag
static UINT64 expression_read_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
device_t *device = NULL;
address_space *space;
@@ -1286,9 +1286,9 @@ static UINT64 expression_read_program_direct(address_space *_space, int opcode,
from a memory region
-------------------------------------------------*/
-static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size)
+static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size)
{
- const memory_region *region = machine->region(rgntag);
+ const memory_region *region = machine.region(rgntag);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
/* make sure we get a valid base before proceeding */
@@ -1337,7 +1337,7 @@ static UINT64 expression_read_memory_region(running_machine *machine, const char
static void expression_write_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size, UINT64 data)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
address_space *space;
@@ -1400,7 +1400,7 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
address_space *space = const_cast<address_space *>(_space);
if (space != NULL)
{
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT8 *base;
/* adjust the address into a byte address, but not if being called recursively */
@@ -1462,10 +1462,10 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
from a memory region
-------------------------------------------------*/
-static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data)
+static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data)
{
- debugcpu_private *global = machine->debugcpu_data;
- const memory_region *region = machine->region(rgntag);
+ debugcpu_private *global = machine.debugcpu_data;
+ const memory_region *region = machine.region(rgntag);
/* make sure we get a valid base before proceeding */
if (region != NULL)
@@ -1520,7 +1520,7 @@ static void expression_write_memory_region(running_machine *machine, const char
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
switch (space)
@@ -1574,7 +1574,7 @@ static expression_error::error_code expression_validate(void *param, const char
case EXPSPACE_REGION:
if (name == NULL)
return expression_error::MISSING_MEMORY_NAME;
- if (machine->region(name)->base() == NULL)
+ if (machine.region(name)->base() == NULL)
return expression_error::INVALID_MEMORY_NAME;
break;
@@ -1630,12 +1630,12 @@ static UINT64 get_frame(symbol_table &table, void *ref)
static UINT64 get_cpunum(symbol_table &table, void *ref)
{
- running_machine *machine = reinterpret_cast<running_machine *>(table.globalref());
- device_t *target = machine->debugcpu_data->visiblecpu;
+ running_machine &machine = *reinterpret_cast<running_machine *>(table.globalref());
+ device_t *target = machine.debugcpu_data->visiblecpu;
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
if (&exec->device() == target)
return index;
@@ -1661,7 +1661,7 @@ device_debug::device_debug(device_t &device)
m_state(NULL),
m_disasm(NULL),
m_flags(0),
- m_symtable(&device, debug_cpu_get_global_symtable(device.machine)),
+ m_symtable(&device, debug_cpu_get_global_symtable(device.machine())),
m_instrhook(NULL),
m_dasm_override(NULL),
m_opwidth(0),
@@ -1744,9 +1744,9 @@ device_debug::~device_debug()
void device_debug::start_hook(attotime endtime)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
- assert((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ assert((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
// stash a pointer to the current live CPU
assert(global->livecpu == NULL);
@@ -1757,7 +1757,7 @@ void device_debug::start_hook(attotime endtime)
{
global->m_stop_when_not_device = NULL;
global->execution_state = EXECUTION_STATE_STOPPED;
- reset_transient_flags(*m_device.machine);
+ reset_transient_flags(m_device.machine());
}
// update the target execution end time
@@ -1769,8 +1769,8 @@ void device_debug::start_hook(attotime endtime)
// check for periodic updates
if (&m_device == global->visiblecpu && osd_ticks() > global->last_periodic_update_time + osd_ticks_per_second()/4)
{
- m_device.machine->debug_view().update_all();
- m_device.machine->debug_view().flush_osd_updates();
+ m_device.machine().debug_view().update_all();
+ m_device.machine().debug_view().flush_osd_updates();
global->last_periodic_update_time = osd_ticks();
}
@@ -1790,11 +1790,11 @@ void device_debug::start_hook(attotime endtime)
if ((m_flags & DEBUG_FLAG_STOP_VBLANK) != 0)
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped at VBLANK\n");
+ debug_console_printf(m_device.machine(), "Stopped at VBLANK\n");
}
// check for debug keypresses
- else if (ui_input_pressed(m_device.machine, IPT_UI_DEBUG_BREAK))
+ else if (ui_input_pressed(m_device.machine(), IPT_UI_DEBUG_BREAK))
global->visiblecpu->debug()->halt_on_next_instruction("User-initiated break\n");
}
}
@@ -1811,7 +1811,7 @@ void device_debug::start_hook(attotime endtime)
void device_debug::stop_hook()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(global->livecpu == &m_device);
@@ -1827,13 +1827,13 @@ void device_debug::stop_hook()
void device_debug::interrupt_hook(int irqline)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_INTERRUPT) != 0 && (m_stopirq == -1 || m_stopirq == irqline))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
+ debug_console_printf(m_device.machine(), "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
compute_debug_flags();
}
}
@@ -1846,13 +1846,13 @@ void device_debug::interrupt_hook(int irqline)
void device_debug::exception_hook(int exception)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (m_stopexception == -1 || m_stopexception == exception))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
+ debug_console_printf(m_device.machine(), "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
compute_debug_flags();
}
}
@@ -1865,7 +1865,7 @@ void device_debug::exception_hook(int exception)
void device_debug::instruction_hook(offs_t curpc)
{
- running_machine &machine = *m_device.machine;
+ running_machine &machine = m_device.machine();
debugcpu_private *global = machine.debugcpu_data;
// note that we are in the debugger code
@@ -1901,7 +1901,7 @@ void device_debug::instruction_hook(offs_t curpc)
{
machine.debug_view().update_all();
machine.debug_view().flush_osd_updates();
- debugger_refresh_display(&machine);
+ debugger_refresh_display(machine);
}
}
}
@@ -1912,14 +1912,14 @@ void device_debug::instruction_hook(offs_t curpc)
// see if we hit a target time
if ((m_flags & DEBUG_FLAG_STOP_TIME) != 0 && machine.time() >= m_stoptime)
{
- debug_console_printf(&machine, "Stopped at time interval %.1g\n", machine.time().as_double());
+ debug_console_printf(machine, "Stopped at time interval %.1g\n", machine.time().as_double());
global->execution_state = EXECUTION_STATE_STOPPED;
}
// check the temp running breakpoint and break if we hit it
else if ((m_flags & DEBUG_FLAG_STOP_PC) != 0 && m_stopaddr == curpc)
{
- debug_console_printf(&machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
+ debug_console_printf(machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
global->execution_state = EXECUTION_STATE_STOPPED;
}
@@ -1936,12 +1936,12 @@ void device_debug::instruction_hook(offs_t curpc)
// load comments if we haven't yet
if (!global->comments_loaded)
{
- debug_comment_load(m_device.machine);
+ debug_comment_load(m_device.machine());
global->comments_loaded = true;
}
// reset any transient state
- reset_transient_flags(*m_device.machine);
+ reset_transient_flags(m_device.machine());
global->breakcpu = NULL;
// remember the last visible CPU in the debugger
@@ -1949,10 +1949,10 @@ void device_debug::instruction_hook(offs_t curpc)
// update all views
machine.debug_view().update_all();
- debugger_refresh_display(m_device.machine);
+ debugger_refresh_display(m_device.machine());
// wait for the debugger; during this time, disable sound output
- m_device.machine->sound().debugger_mute(true);
+ m_device.machine().sound().debugger_mute(true);
while (global->execution_state == EXECUTION_STATE_STOPPED)
{
// flush any pending updates before waiting again
@@ -1970,17 +1970,17 @@ void device_debug::instruction_hook(offs_t curpc)
if (global->memory_modified)
{
machine.debug_view().update_all(DVT_DISASSEMBLY);
- debugger_refresh_display(m_device.machine);
+ debugger_refresh_display(m_device.machine());
}
// check for commands in the source file
- process_source_file(m_device.machine);
+ process_source_file(m_device.machine());
// if an event got scheduled, resume
if (machine.scheduled_event_pending())
global->execution_state = EXECUTION_STATE_RUNNING;
}
- m_device.machine->sound().debugger_mute(false);
+ m_device.machine().sound().debugger_mute(false);
// remember the last visible CPU in the debugger
global->visiblecpu = &m_device;
@@ -2080,7 +2080,7 @@ if (m_memory != NULL && m_disasm != NULL)
void device_debug::ignore(bool ignore)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2101,7 +2101,7 @@ void device_debug::ignore(bool ignore)
void device_debug::single_step(int numsteps)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2119,7 +2119,7 @@ void device_debug::single_step(int numsteps)
void device_debug::single_step_over(int numsteps)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2137,7 +2137,7 @@ void device_debug::single_step_over(int numsteps)
void device_debug::single_step_out()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2155,7 +2155,7 @@ void device_debug::single_step_out()
void device_debug::go(offs_t targetpc)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2171,7 +2171,7 @@ void device_debug::go(offs_t targetpc)
void device_debug::go_vblank()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2188,7 +2188,7 @@ void device_debug::go_vblank()
void device_debug::go_interrupt(int irqline)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2205,7 +2205,7 @@ void device_debug::go_interrupt(int irqline)
void device_debug::go_exception(int exception)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2222,11 +2222,11 @@ void device_debug::go_exception(int exception)
void device_debug::go_milliseconds(UINT64 milliseconds)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
- m_stoptime = m_device.machine->time() + attotime::from_msec(milliseconds);
+ m_stoptime = m_device.machine().time() + attotime::from_msec(milliseconds);
m_flags |= DEBUG_FLAG_STOP_TIME;
global->execution_state = EXECUTION_STATE_RUNNING;
}
@@ -2239,7 +2239,7 @@ void device_debug::go_milliseconds(UINT64 milliseconds)
void device_debug::go_next_device()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2255,7 +2255,7 @@ void device_debug::go_next_device()
void device_debug::halt_on_next_instruction(const char *fmt, ...)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
va_list arg;
assert(m_exec != NULL);
@@ -2266,7 +2266,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
// output the message to the console
va_start(arg, fmt);
- debug_console_vprintf(m_device.machine, fmt, arg);
+ debug_console_vprintf(m_device.machine(), fmt, arg);
va_end(arg);
// if we are live, stop now, otherwise note that we want to break there
@@ -2289,7 +2289,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
int device_debug::breakpoint_set(offs_t address, const char *condition, const char *action)
{
// allocate a new one
- breakpoint *bp = auto_alloc(m_device.machine, breakpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, address, condition, action));
+ breakpoint *bp = auto_alloc(m_device.machine(), breakpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, address, condition, action));
// hook it into our list
bp->m_next = m_bplist;
@@ -2314,7 +2314,7 @@ bool device_debug::breakpoint_clear(int index)
{
breakpoint *deleteme = *bp;
*bp = deleteme->m_next;
- auto_free(m_device.machine, deleteme);
+ auto_free(m_device.machine(), deleteme);
breakpoint_update_flags();
return true;
}
@@ -2380,7 +2380,7 @@ int device_debug::watchpoint_set(address_space &space, int type, offs_t address,
assert(space.spacenum() < ARRAY_LENGTH(m_wplist));
// allocate a new one
- watchpoint *wp = auto_alloc(m_device.machine, watchpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, space, type, address, length, condition, action));
+ watchpoint *wp = auto_alloc(m_device.machine(), watchpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, space, type, address, length, condition, action));
// hook it into our list
wp->m_next = m_wplist[space.spacenum()];
@@ -2407,7 +2407,7 @@ bool device_debug::watchpoint_clear(int index)
watchpoint *deleteme = *wp;
address_space &space = deleteme->m_space;
*wp = deleteme->m_next;
- auto_free(m_device.machine, deleteme);
+ auto_free(m_device.machine(), deleteme);
watchpoint_update_flags(space);
return true;
}
@@ -2474,14 +2474,14 @@ void device_debug::watchpoint_enable_all(bool enable)
void device_debug::hotspot_track(int numspots, int threshhold)
{
// if we already have tracking enabled, kill it
- auto_free(m_device.machine, m_hotspots);
+ auto_free(m_device.machine(), m_hotspots);
m_hotspots = NULL;
// only start tracking if we have a non-zero count
if (numspots > 0)
{
// allocate memory for hotspots
- m_hotspots = auto_alloc_array(m_device.machine, hotspot_entry, numspots);
+ m_hotspots = auto_alloc_array(m_device.machine(), hotspot_entry, numspots);
memset(m_hotspots, 0xff, sizeof(*m_hotspots) * numspots);
// fill in the info
@@ -2519,7 +2519,7 @@ void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color)
{
// create a new item for the list
UINT32 crc = compute_opcode_crc32(addr);
- dasm_comment *newcomment = auto_alloc(m_device.machine, dasm_comment(comment, addr, color, crc));
+ dasm_comment *newcomment = auto_alloc(m_device.machine(), dasm_comment(comment, addr, color, crc));
// figure out where to insert it
dasm_comment *prev = NULL;
@@ -2646,7 +2646,7 @@ bool device_debug::comment_import(xml_data_node &cpunode)
sscanf(xml_get_attribute_string(datanode, "crc", 0), "%08X", &crc);
// add the new comment; we assume they were saved ordered
- m_comment_list.append(*auto_alloc(m_device.machine, dasm_comment(datanode->value, address, color, crc)));
+ m_comment_list.append(*auto_alloc(m_device.machine(), dasm_comment(datanode->value, address, color, crc)));
}
return true;
}
@@ -2723,12 +2723,12 @@ UINT32 device_debug::compute_opcode_crc32(offs_t address) const
void device_debug::trace(FILE *file, bool trace_over, const char *action)
{
// delete any existing tracers
- auto_free(m_device.machine, m_trace);
+ auto_free(m_device.machine(), m_trace);
m_trace = NULL;
// if we have a new file, make a new tracer
if (file != NULL)
- m_trace = auto_alloc(m_device.machine, tracer(*this, *file, trace_over, action));
+ m_trace = auto_alloc(m_device.machine(), tracer(*this, *file, trace_over, action));
}
@@ -2756,33 +2756,33 @@ void device_debug::trace_printf(const char *fmt, ...)
void device_debug::compute_debug_flags()
{
- running_machine *machine = m_device.machine;
- debugcpu_private *global = machine->debugcpu_data;
+ running_machine &machine = m_device.machine();
+ debugcpu_private *global = machine.debugcpu_data;
// clear out global flags by default, keep DEBUG_FLAG_OSD_ENABLED
- machine->debug_flags &= DEBUG_FLAG_OSD_ENABLED;
- machine->debug_flags |= DEBUG_FLAG_ENABLED;
+ machine.debug_flags &= DEBUG_FLAG_OSD_ENABLED;
+ machine.debug_flags |= DEBUG_FLAG_ENABLED;
// if we are ignoring this CPU, or if events are pending, we're done
- if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine->scheduled_event_pending() || machine->save_or_load_pending())
+ if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine.scheduled_event_pending() || machine.save_or_load_pending())
return;
// if we're stopped, keep calling the hook
if (global->execution_state == EXECUTION_STATE_STOPPED)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we're tracking history, or we're hooked, or stepping, or stopping at a breakpoint
// make sure we call the hook
if ((m_flags & (DEBUG_FLAG_HISTORY | DEBUG_FLAG_HOOKED | DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_LIVE_BP)) != 0)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// also call if we are tracing
if (m_trace != NULL)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we are stopping at a particular time and that time is within the current timeslice, we need to be called
if ((m_flags & DEBUG_FLAG_STOP_TIME) && m_endexectime <= m_stoptime)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
}
@@ -2837,7 +2837,7 @@ void device_debug::breakpoint_update_flags()
}
// push the flags out globally
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
if (global->livecpu != NULL)
global->livecpu->debug()->compute_debug_flags();
}
@@ -2855,16 +2855,16 @@ void device_debug::breakpoint_check(offs_t pc)
if (bp->hit(pc))
{
// halt in the debugger by default
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
global->execution_state = EXECUTION_STATE_STOPPED;
// if we hit, evaluate the action
if (bp->m_action)
- debug_console_execute_command(m_device.machine, bp->m_action, 0);
+ debug_console_execute_command(m_device.machine(), bp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
- debug_console_printf(m_device.machine, "Stopped at breakpoint %X\n", bp->m_index);
+ debug_console_printf(m_device.machine(), "Stopped at breakpoint %X\n", bp->m_index);
break;
}
}
@@ -2906,7 +2906,7 @@ void device_debug::watchpoint_update_flags(address_space &space)
void device_debug::watchpoint_check(address_space &space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask)
{
- debugcpu_private *global = space.machine->debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
// if we're within debugger code, don't stop
if (global->within_instruction_hook || global->debugger_access)
@@ -2953,7 +2953,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
// if we hit, evaluate the action
if (wp->m_action)
- debug_console_execute_command(space.machine, wp->m_action, 0);
+ debug_console_execute_command(space.machine(), wp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
@@ -2975,7 +2975,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
}
else
buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
- debug_console_printf(space.machine, "%s\n", buffer.cstr());
+ debug_console_printf(space.machine(), "%s\n", buffer.cstr());
space.cpu->debug()->compute_debug_flags();
}
break;
@@ -3006,7 +3006,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address)
// if the bottom of the list is over the threshhold, print it
hotspot_entry &spot = m_hotspots[m_hotspot_count - 1];
if (spot.m_count > m_hotspot_threshhold)
- debug_console_printf(space.machine, "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
+ debug_console_printf(space.machine(), "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
// move everything else down and insert this one at the top
memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * (m_hotspot_count - 1));
@@ -3307,7 +3307,7 @@ void device_debug::tracer::update(offs_t pc)
// execute any trace actions first
if (m_action)
- debug_console_execute_command(m_debug.m_device.machine, m_action, 0);
+ debug_console_execute_command(m_debug.m_device.machine(), m_action, 0);
// print the address
astring buffer;
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index 990cc7e5cf5..2c414b88fc8 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -370,51 +370,51 @@ private:
/* ----- initialization and cleanup ----- */
/* initialize the CPU tracking for the debugger */
-void debug_cpu_init(running_machine *machine);
+void debug_cpu_init(running_machine &machine);
void debug_cpu_configure_memory(running_machine &machine, symbol_table &table);
/* flushes all traces; this is useful if a trace is going on when we fatalerror */
-void debug_cpu_flush_traces(running_machine *machine);
+void debug_cpu_flush_traces(running_machine &machine);
/* ----- debugging status & information ----- */
/* return the visible CPU device (the one that commands should apply to) */
-device_t *debug_cpu_get_visible_cpu(running_machine *machine);
+device_t *debug_cpu_get_visible_cpu(running_machine &machine);
/* TRUE if the debugger is currently stopped within an instruction hook callback */
-int debug_cpu_within_instruction_hook(running_machine *machine);
+int debug_cpu_within_instruction_hook(running_machine &machine);
/* return TRUE if the current execution state is stopped */
-int debug_cpu_is_stopped(running_machine *machine);
+int debug_cpu_is_stopped(running_machine &machine);
/* ----- symbol table interfaces ----- */
/* return the global symbol table */
-symbol_table *debug_cpu_get_global_symtable(running_machine *machine);
+symbol_table *debug_cpu_get_global_symtable(running_machine &machine);
/* return the locally-visible symbol table */
-symbol_table *debug_cpu_get_visible_symtable(running_machine *machine);
+symbol_table *debug_cpu_get_visible_symtable(running_machine &machine);
/* ----- misc debugger functions ----- */
/* specifies a debug command script to execute */
-void debug_cpu_source_script(running_machine *machine, const char *file);
+void debug_cpu_source_script(running_machine &machine, const char *file);
/* ----- debugger comment helpers ----- */
// save all comments for a given machine
-bool debug_comment_save(running_machine *machine);
+bool debug_comment_save(running_machine &machine);
// load all comments for a given machine
-bool debug_comment_load(running_machine *machine);
+bool debug_comment_load(running_machine &machine);
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c
index 2454644c7ed..9d652f5078d 100644
--- a/src/emu/debug/debugvw.c
+++ b/src/emu/debug/debugvw.c
@@ -147,7 +147,7 @@ void debug_view_source_list::reset()
{
debug_view_source *source = m_head;
m_head = source->m_next;
- auto_free(&m_machine, source);
+ auto_free(m_machine, source);
}
// reset the tail pointer and index
@@ -222,7 +222,7 @@ debug_view::debug_view(running_machine &machine, debug_view_type type, debug_vie
{
// allocate memory for the buffer
m_viewdata_size = m_visible.y * m_visible.x;
- m_viewdata = auto_alloc_array(&machine, debug_view_char, m_viewdata_size);
+ m_viewdata = auto_alloc_array(machine, debug_view_char, m_viewdata_size);
}
@@ -256,8 +256,8 @@ void debug_view::end_update()
if (size > m_viewdata_size)
{
m_viewdata_size = size;
- auto_free(&m_machine, m_viewdata);
- m_viewdata = auto_alloc_array(&m_machine, debug_view_char, m_viewdata_size);
+ auto_free(m_machine, m_viewdata);
+ m_viewdata = auto_alloc_array(m_machine, debug_view_char, m_viewdata_size);
}
// update the view
@@ -450,7 +450,7 @@ debug_view_manager::~debug_view_manager()
{
debug_view *oldhead = m_viewlist;
m_viewlist = oldhead->m_next;
- auto_free(&m_machine, oldhead);
+ auto_free(m_machine, oldhead);
}
}
@@ -464,25 +464,25 @@ debug_view *debug_view_manager::alloc_view(debug_view_type type, debug_view_osd_
switch (type)
{
case DVT_CONSOLE:
- return append(auto_alloc(&m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
case DVT_STATE:
- return append(auto_alloc(&m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
case DVT_DISASSEMBLY:
- return append(auto_alloc(&m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
case DVT_MEMORY:
- return append(auto_alloc(&m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
case DVT_LOG:
- return append(auto_alloc(&m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
case DVT_TIMERS:
-// return append(auto_alloc(&m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
case DVT_ALLOCS:
-// return append(auto_alloc(&m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
default:
fatalerror("Attempt to create invalid debug view type %d\n", type);
@@ -502,7 +502,7 @@ void debug_view_manager::free_view(debug_view &view)
if (*viewptr == &view)
{
*viewptr = view.m_next;
- auto_free(&m_machine, &view);
+ auto_free(m_machine, &view);
break;
}
}
@@ -559,7 +559,7 @@ debug_view_expression::debug_view_expression(running_machine &machine)
: m_machine(machine),
m_dirty(true),
m_result(0),
- m_parsed(debug_cpu_get_global_symtable(&machine)),
+ m_parsed(debug_cpu_get_global_symtable(machine)),
m_string("0")
{
}
@@ -581,7 +581,7 @@ debug_view_expression::~debug_view_expression()
void debug_view_expression::set_context(symbol_table *context)
{
- m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(&m_machine));
+ m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(m_machine));
m_dirty = true;
}
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index c98682776b9..5275eea49db 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -116,8 +116,8 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up
debug_view_disasm::~debug_view_disasm()
{
- auto_free(&m_machine, m_byteaddress);
- auto_free(&m_machine, m_dasm);
+ auto_free(m_machine, m_byteaddress);
+ auto_free(m_machine, m_dasm);
}
@@ -137,7 +137,7 @@ void debug_view_disasm::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
{
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_disasm_source(name, dasm->device())));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_disasm_source(name, dasm->device())));
}
// reset the source to a known good entry
@@ -377,12 +377,12 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
m_allocated = m_total;
// allocate address array
- auto_free(&m_machine, m_byteaddress);
- m_byteaddress = auto_alloc_array(&m_machine, offs_t, m_allocated.y);
+ auto_free(m_machine, m_byteaddress);
+ m_byteaddress = auto_alloc_array(m_machine, offs_t, m_allocated.y);
// allocate disassembly buffer
- auto_free(&m_machine, m_dasm);
- m_dasm = auto_alloc_array(&m_machine, char, m_allocated.x * m_allocated.y);
+ auto_free(m_machine, m_dasm);
+ m_dasm = auto_alloc_array(m_machine, char, m_allocated.x * m_allocated.y);
}
// iterate over lines
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index 8d636999e49..0d2417fe0c1 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -160,7 +160,7 @@ void debug_view_memory::enumerate_sources()
if (space != NULL)
{
name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *space)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *space)));
}
}
@@ -168,7 +168,7 @@ void debug_view_memory::enumerate_sources()
for (const memory_region *region = m_machine.first_region(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *region)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *region)));
}
// finally add all global array symbols
@@ -185,7 +185,7 @@ void debug_view_memory::enumerate_sources()
if (valcount > 1 && strstr(itemname, "globals/"))
{
name.cpy(strrchr(itemname, '/') + 1);
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, base, valsize, valcount)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, base, valsize, valcount)));
}
}
@@ -707,10 +707,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
// hack for FD1094 editing
#ifdef FD1094_HACK
- if (source.m_base == *m_machine.region("user2"))
+ if (source.m_base == m_machine.region("user2"))
{
- extern void fd1094_regenerate_key(running_machine *machine);
- fd1094_regenerate_key(&m_machine);
+ extern void fd1094_regenerate_key(running_machine &machine);
+ fd1094_regenerate_key(m_machine);
}
#endif
}
diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c
index 01383a3ca2c..296dadc6c35 100644
--- a/src/emu/debug/dvstate.c
+++ b/src/emu/debug/dvstate.c
@@ -108,7 +108,7 @@ void debug_view_state::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(state); gotone; gotone = state->next(state))
{
name.printf("%s '%s'", state->device().name(), state->device().tag());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_state_source(name, state->device())));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_state_source(name, state->device())));
}
// reset the source to a known good entry
@@ -127,7 +127,7 @@ void debug_view_state::reset()
{
state_item *oldhead = m_state_list;
m_state_list = oldhead->m_next;
- auto_free(&m_machine, oldhead);
+ auto_free(m_machine, oldhead);
}
}
@@ -146,34 +146,34 @@ void debug_view_state::recompute()
// add a cycles entry: cycles:99999999
state_item **tailptr = &m_state_list;
- *tailptr = auto_alloc(&m_machine, state_item(REG_CYCLES, "cycles", 8));
+ *tailptr = auto_alloc(m_machine, state_item(REG_CYCLES, "cycles", 8));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamx:1234
- *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMX, "beamx", 4));
+ *tailptr = auto_alloc(m_machine, state_item(REG_BEAMX, "beamx", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamy:5678
- *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMY, "beamy", 4));
+ *tailptr = auto_alloc(m_machine, state_item(REG_BEAMY, "beamy", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: frame:123456
- *tailptr = auto_alloc(&m_machine, state_item(REG_FRAME, "frame", 6));
+ *tailptr = auto_alloc(m_machine, state_item(REG_FRAME, "frame", 6));
tailptr = &(*tailptr)->m_next;
// add a flags entry: flags:xxxxxxxx
- *tailptr = auto_alloc(&m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
+ *tailptr = auto_alloc(m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
tailptr = &(*tailptr)->m_next;
// add a divider entry
- *tailptr = auto_alloc(&m_machine, state_item(REG_DIVIDER, "", 0));
+ *tailptr = auto_alloc(m_machine, state_item(REG_DIVIDER, "", 0));
tailptr = &(*tailptr)->m_next;
// add all registers into it
for (const device_state_entry *entry = source.m_stateintf->state_first(); entry != NULL; entry = entry->next())
if (entry->visible())
{
- *tailptr = auto_alloc(&m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
+ *tailptr = auto_alloc(m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
tailptr = &(*tailptr)->m_next;
}
diff --git a/src/emu/debugger.c b/src/emu/debugger.c
index 519b08dcd1d..536740dd97b 100644
--- a/src/emu/debugger.c
+++ b/src/emu/debugger.c
@@ -60,15 +60,15 @@ static void debugger_exit(running_machine &machine);
debugger_init - start up all subsections
-------------------------------------------------*/
-void debugger_init(running_machine *machine)
+void debugger_init(running_machine &machine)
{
/* only if debugging is enabled */
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
machine_entry *entry;
/* initialize the submodules */
- machine->m_debug_view = auto_alloc(machine, debug_view_manager(*machine));
+ machine.m_debug_view = auto_alloc(machine, debug_view_manager(machine));
debug_cpu_init(machine);
debug_command_init(machine);
debug_console_init(machine);
@@ -77,10 +77,10 @@ void debugger_init(running_machine *machine)
debugint_init(machine);
/* allocate a new entry for our global list */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
entry = global_alloc(machine_entry);
entry->next = machine_list;
- entry->machine = machine;
+ entry->machine = &machine;
machine_list = entry;
/* register an atexit handler if we haven't yet */
@@ -89,10 +89,10 @@ void debugger_init(running_machine *machine)
atexit_registered = TRUE;
/* listen in on the errorlog */
- machine->add_logerror_callback(debug_errorlog_write_line);
+ machine.add_logerror_callback(debug_errorlog_write_line);
/* initialize osd debugger features */
- machine->osd().init_debugger();
+ machine.osd().init_debugger();
}
}
@@ -102,9 +102,9 @@ void debugger_init(running_machine *machine)
video display
-------------------------------------------------*/
-void debugger_refresh_display(running_machine *machine)
+void debugger_refresh_display(running_machine &machine)
{
- machine->video().frame_update(true);
+ machine.video().frame_update(true);
}
@@ -141,7 +141,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void)
while (machine_list != NULL)
{
machine_entry *deleteme = machine_list;
- debug_cpu_flush_traces(deleteme->machine);
+ debug_cpu_flush_traces(*deleteme->machine);
machine_list = deleteme->next;
global_free(deleteme);
}
diff --git a/src/emu/debugger.h b/src/emu/debugger.h
index 4b13c3fa615..6b2978974eb 100644
--- a/src/emu/debugger.h
+++ b/src/emu/debugger.h
@@ -24,10 +24,10 @@
/* ----- core debugger functions ----- */
/* initialize the debugger */
-void debugger_init(running_machine *machine);
+void debugger_init(running_machine &machine);
/* redraw the current video display */
-void debugger_refresh_display(running_machine *machine);
+void debugger_refresh_display(running_machine &machine);
/* OSD can call this to safely flush all traces in the event of a crash */
void debugger_flush_all_traces_on_abnormal_exit(void);
@@ -45,7 +45,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void);
INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
device->debug()->instruction_hook(curpc);
}
@@ -57,7 +57,7 @@ INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
INLINE void debugger_exception_hook(device_t *device, int exception)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->exception_hook(exception);
}
@@ -75,7 +75,7 @@ INLINE void debugger_exception_hook(device_t *device, int exception)
INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->start_hook(endtime);
}
@@ -88,7 +88,7 @@ INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
INLINE void debugger_stop_cpu_hook(device_t *device)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->stop_hook();
}
@@ -101,7 +101,7 @@ INLINE void debugger_stop_cpu_hook(device_t *device)
INLINE void debugger_interrupt_hook(device_t *device, int irqline)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->interrupt_hook(irqline);
}
@@ -116,9 +116,9 @@ INLINE void debugger_interrupt_hook(device_t *device, int irqline)
next opportunity
-------------------------------------------------*/
-INLINE void debugger_break(running_machine *machine)
+INLINE void debugger_break(running_machine &machine)
{
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
debug_cpu_get_visible_cpu(machine)->debug()->halt_on_next_instruction("Internal breakpoint\n");
}
@@ -129,9 +129,9 @@ INLINE void debugger_break(running_machine *machine)
halted within the instruction hook
-------------------------------------------------*/
-INLINE int debugger_within_instruction_hook(running_machine *machine)
+INLINE int debugger_within_instruction_hook(running_machine &machine)
{
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
return debug_cpu_within_instruction_hook(machine);
return FALSE;
}
diff --git a/src/emu/debugint/debugint.c b/src/emu/debugint/debugint.c
index a6fedf61500..82a393105f0 100644
--- a/src/emu/debugint/debugint.c
+++ b/src/emu/debugint/debugint.c
@@ -150,7 +150,7 @@ class DView
DISABLE_COPYING(DView);
public:
- DView(render_target *target, running_machine *machine, debug_view_type type, int flags)
+ DView(render_target *target, running_machine &machine, debug_view_type type, int flags)
: next(NULL),
type(0),
state(0),
@@ -160,9 +160,9 @@ public:
this->target = target;
//dv->container = render_target_get_component_container(target, name, &pos);
this->container = target->debug_alloc();
- this->view = machine->debug_view().alloc_view(type, dview_update, this);
+ this->view = machine.debug_view().alloc_view(type, dview_update, this);
this->type = type;
- this->machine = machine;
+ this->m_machine = &machine;
this->state = flags | VIEW_STATE_NEEDS_UPDATE;
// initial size
@@ -186,16 +186,18 @@ public:
~DView()
{
this->target->debug_free(*this->container);
- machine->debug_view().free_view(*this->view);
+ m_machine->debug_view().free_view(*this->view);
}
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
DView * next;
int type;
debug_view * view;
render_container * container;
render_target * target;
- running_machine * machine;
+ running_machine * m_machine;
int state;
// drawing
rectangle bounds;
@@ -299,7 +301,7 @@ static void set_focus_view(DView *dv)
}
}
-static DView *dview_alloc(render_target *target, running_machine *machine, debug_view_type type, int flags)
+static DView *dview_alloc(render_target *target, running_machine &machine, debug_view_type type, int flags)
{
DView *dv;
@@ -316,7 +318,7 @@ static void dview_free(DView *dv)
{
//astring_free(dv->title);
LIST_REMOVE(list, dv, DView);
- auto_free(dv->machine, dv);
+ auto_free(dv->machine(), dv);
}
static void dview_get_rect(DView *dv, int type, rectangle *rect)
@@ -895,11 +897,11 @@ static void debugint_exit(running_machine &machine)
}
-void debugint_init(running_machine *machine)
+void debugint_init(running_machine &machine)
{
unicode_char ch;
int chw;
- debug_font = machine->render().font_alloc("ui.bdf"); //ui_get_font(machine);
+ debug_font = machine.render().font_alloc("ui.bdf"); //ui_get_font(machine);
debug_font_width = 0;
debug_font_height = 15;
@@ -908,7 +910,7 @@ void debugint_init(running_machine *machine)
list = NULL;
focus_view = NULL;
- debug_font_aspect = machine->render().ui_aspect();
+ debug_font_aspect = machine.render().ui_aspect();
for (ch=0;ch<=127;ch++)
{
@@ -919,7 +921,7 @@ void debugint_init(running_machine *machine)
debug_font_width++;
/* FIXME: above does not really work */
debug_font_width = 10;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
}
#if 0
@@ -957,9 +959,9 @@ static void process_string(DView *dv, const char *str)
break;
case DVT_CONSOLE:
if(!dv->editor.str[(long)0])
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
else
- debug_console_execute_command(dv->machine, str, 1);
+ debug_console_execute_command(dv->machine(), str, 1);
break;
case DVT_MEMORY:
downcast<debug_view_memory *>(dv->view)->set_expression(str);
@@ -977,11 +979,11 @@ static void on_disassembly_window_activate(DView *dv, const ui_menu_event *event
render_target *target;
const debug_view_source *source;
- target = &dv->machine->render().ui_target();
+ target = &dv->machine().render().ui_target();
- ndv = dview_alloc(target, dv->machine, DVT_DISASSEMBLY, 0);
+ ndv = dview_alloc(target, dv->machine(), DVT_DISASSEMBLY, 0);
ndv->editor.active = TRUE;
- ndv->editor.container = &dv->machine->render().ui_container();
+ ndv->editor.container = &dv->machine().render().ui_container();
source = ndv->view->source();
dview_set_title(ndv, source->name());
set_focus_view(ndv);
@@ -1010,8 +1012,8 @@ static void on_log_window_activate(DView *dv, const ui_menu_event *event)
DView *ndv;
render_target *target;
- target = &dv->machine->render().ui_target();
- ndv = dview_alloc(target, dv->machine, DVT_LOG, 0);
+ target = &dv->machine().render().ui_target();
+ ndv = dview_alloc(target, dv->machine(), DVT_LOG, 0);
dview_set_title(ndv, "Log");
set_focus_view(ndv);
}
@@ -1025,63 +1027,63 @@ static void on_close_activate(DView *dv, const ui_menu_event *event)
static void on_run_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#if 0
void on_run_h_activate(DView *dv, const ui_menu_event *event)
{
debugwin_show(0);
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#endif
static void on_run_cpu_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_next_device();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_next_device();
}
static void on_run_irq_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_interrupt();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_interrupt();
}
static void on_run_vbl_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_vblank();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_vblank();
}
static void on_step_into_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
}
static void on_step_over_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_over();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_over();
}
#ifdef UNUSED_CODE
static void on_step_out_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_out();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_out();
}
#endif
static void on_hard_reset_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_hard_reset();
+ dv->machine().schedule_hard_reset();
}
static void on_soft_reset_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_soft_reset();
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ dv->machine().schedule_soft_reset();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
static void on_exit_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_exit();
+ dv->machine().schedule_exit();
}
static void on_view_opcodes_activate(DView *dv, const ui_menu_event *event)
@@ -1108,11 +1110,11 @@ static void on_run_to_cursor_activate(DView *dv, const ui_menu_event *event)
{
char command[64];
- if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine) == dv->view->source()->device())
+ if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine()) == dv->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(dv->view)->selected_address();
sprintf(command, "go %X", address);
- debug_console_execute_command(dv->machine, command, 1);
+ debug_console_execute_command(dv->machine(), command, 1);
}
}
@@ -1157,7 +1159,7 @@ static void render_editor(DView_edit *editor)
menu_main_populate - populate the main menu
-------------------------------------------------*/
-static void CreateMainMenu(running_machine *machine)
+static void CreateMainMenu(running_machine &machine)
{
const char *subtext = "";
int rc;
@@ -1165,7 +1167,7 @@ static void CreateMainMenu(running_machine *machine)
if (menu != NULL)
ui_menu_free(menu);
- menu = ui_menu_alloc(machine, &machine->render().ui_container(),NULL,NULL);
+ menu = ui_menu_alloc(machine, &machine.render().ui_container(),NULL,NULL);
switch (focus_view->type)
{
@@ -1258,7 +1260,7 @@ static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x,
return FALSE;
}
-static void handle_mouse(running_machine *machine)
+static void handle_mouse(running_machine &machine)
{
render_target * mouse_target;
INT32 x,y;
@@ -1288,7 +1290,7 @@ static void handle_mouse(running_machine *machine)
handle_editor - handle the editor
-------------------------------------------------*/
-static void handle_editor(running_machine *machine)
+static void handle_editor(running_machine &machine)
{
if (focus_view->editor.active)
{
@@ -1344,12 +1346,12 @@ static void handle_editor(running_machine *machine)
menu_main - handle the main menu
-------------------------------------------------*/
-static void handle_menus(running_machine *machine)
+static void handle_menus(running_machine &machine)
{
const ui_menu_event *event;
- machine->render().ui_container().empty();
- ui_input_frame_update(*machine);
+ machine.render().ui_container().empty();
+ ui_input_frame_update(machine);
if (menu != NULL)
{
/* process the menu */
@@ -1447,35 +1449,35 @@ void debugint_wait_for_debugger(device_t &device, bool firststop)
DView *dv;
render_target *target;
- target = &device.machine->render().ui_target();
+ target = &device.machine().render().ui_target();
//set_view_by_name(target, "Debug");
- dv = dview_alloc(target, device.machine, DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
+ dv = dview_alloc(target, device.machine(), DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
dv->editor.active = TRUE;
- dv->editor.container = &device.machine->render().ui_container();
- dv = dview_alloc(target, device.machine, DVT_STATE, VIEW_STATE_FOLLOW_CPU);
- dv = dview_alloc(target, device.machine, DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
+ dv->editor.container = &device.machine().render().ui_container();
+ dv = dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
+ dv = dview_alloc(target, device.machine(), DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
dview_set_title(dv, "Console");
dv->editor.active = TRUE;
- dv->editor.container = &device.machine->render().ui_container();
+ dv->editor.container = &device.machine().render().ui_container();
set_focus_view(dv);
}
followers_set_cpu(&device);
- //ui_update_and_render(device.machine, &device.machine->render().ui_container()());
+ //ui_update_and_render(device.machine(), device.machine().render().ui_container()());
update_views();
- device.machine->osd().update(false);
- handle_menus(device.machine);
- handle_mouse(device.machine);
+ device.machine().osd().update(false);
+ handle_menus(device.machine());
+ handle_mouse(device.machine());
//osd_sleep(osd_ticks_per_second()/60);
}
-void debugint_update_during_game(running_machine *machine)
+void debugint_update_during_game(running_machine &machine)
{
- if (!debug_cpu_is_stopped(machine) && machine->phase() == MACHINE_PHASE_RUNNING)
+ if (!debug_cpu_is_stopped(machine) && machine.phase() == MACHINE_PHASE_RUNNING)
{
update_views();
}
diff --git a/src/emu/debugint/debugint.h b/src/emu/debugint/debugint.h
index 4d057e17b15..850be46a547 100644
--- a/src/emu/debugint/debugint.h
+++ b/src/emu/debugint/debugint.h
@@ -36,12 +36,12 @@
***************************************************************************/
/* initialize the internal debugger */
-void debugint_init(running_machine *machine);
+void debugint_init(running_machine &machine);
/* process events for internal debugger */
void debugint_wait_for_debugger(device_t &device, bool firststop);
/* update the internal debugger during a game */
-void debugint_update_during_game(running_machine *machine);
+void debugint_update_during_game(running_machine &machine);
#endif
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index d70af9f9507..5907abc7a3f 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -41,7 +41,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(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->name(), device->tag());
resolved->read = trampoline_read_port_to_read_line;
@@ -74,7 +74,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -130,7 +130,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(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->name(), device->tag());
resolved->write = trampoline_write_port_to_write_line;
@@ -178,7 +178,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -228,7 +228,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(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->name(), device->tag());
resolved->read = trampoline_read_port_to_read8;
@@ -258,7 +258,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -307,7 +307,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(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->name(), device->tag());
resolved->write = trampoline_write_port_to_write8;
@@ -337,7 +337,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 6940923bed8..6641c2fdaf1 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -75,7 +75,7 @@ template<class _Class, UINT8 (_Class::*_Function)(address_space &, offs_t, UINT8
UINT8 devcb_stub(device_t *device, offs_t offset)
{
_Class *target = downcast<_Class *>(device);
- return (target->*_Function)(*memory_nonspecific_space(device->machine), offset, 0xff);
+ return (target->*_Function)(*memory_nonspecific_space(device->machine()), offset, 0xff);
}
// static template for a write_line stub function that calls through a given WRITE_LINE_MEMBER
@@ -91,7 +91,7 @@ template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT8,
void devcb_stub(device_t *device, offs_t offset, UINT8 data)
{
_Class *target = downcast<_Class *>(device);
- (target->*_Function)(*memory_nonspecific_space(device->machine), offset, data, 0xff);
+ (target->*_Function)(*memory_nonspecific_space(device->machine()), offset, data, 0xff);
}
#define DEVCB_NULL { DEVCB_TYPE_NULL }
diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c
index 9585949b348..4793308c966 100644
--- a/src/emu/devcpu.c
+++ b/src/emu/devcpu.c
@@ -236,7 +236,7 @@ legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_
throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag());
// allocate memory for the token
- m_token = auto_alloc_array_clear(&machine, UINT8, tokenbytes);
+ m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
}
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index aa40b5f78ea..e889321448f 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -286,8 +286,8 @@ const device_type name = basename##_device_config::static_alloc_device_config
#define INTERRUPT_GEN(func) void func(device_t *device)
// helpers for using machine/cputag instead of cpu objects
-#define cputag_set_input_line(mach, tag, line, state) device_execute((mach)->device(tag))->set_input_line(line, state)
-#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach)->device(tag))->set_input_line_and_vector(line, state, vec)
+#define cputag_set_input_line(mach, tag, line, state) device_execute((mach).device(tag))->set_input_line(line, state)
+#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach).device(tag))->set_input_line_and_vector(line, state, vec)
diff --git a/src/emu/devimage.c b/src/emu/devimage.c
index 0815a74df09..d2183f690ba 100644
--- a/src/emu/devimage.c
+++ b/src/emu/devimage.c
@@ -487,7 +487,7 @@ done:
if (m_err!=0) {
if (!m_init_phase)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path, error());
else
mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, error());
@@ -496,13 +496,13 @@ done:
}
else {
/* do we need to reset the CPU? only schedule it if load/create is successful */
- if (device().machine->time() > attotime::zero && m_image_config.is_reset_on_load())
- device().machine->schedule_hard_reset();
+ if (device().machine().time() > attotime::zero && m_image_config.is_reset_on_load())
+ device().machine().schedule_hard_reset();
else
{
if (!m_init_phase)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded");
else
mame_printf_info("Image '%s' was successfully %s.\n", path, is_create ? "created" : "loaded");
diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c
index 60c217b06af..094693f3114 100644
--- a/src/emu/devintrf.c
+++ b/src/emu/devintrf.c
@@ -189,7 +189,7 @@ void device_list::static_exit(running_machine &machine)
{
// first let the debugger save comments
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
- debug_comment_save(&machine);
+ debug_comment_save(machine);
// then nuke the devices
machine.m_devicelist.reset();
@@ -201,7 +201,7 @@ void device_list::static_exit(running_machine &machine)
// about to save
//-------------------------------------------------
-void device_list::static_pre_save(running_machine *machine, void *param)
+void device_list::static_pre_save(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@@ -214,7 +214,7 @@ void device_list::static_pre_save(running_machine *machine, void *param)
// completed a load
//-------------------------------------------------
-void device_list::static_post_load(running_machine *machine, void *param)
+void device_list::static_post_load(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@@ -545,8 +545,7 @@ void device_interface::interface_debug_setup()
//-------------------------------------------------
device_t::device_t(running_machine &_machine, const device_config &config)
- : machine(&_machine),
- m_machine(_machine),
+ : m_machine(_machine),
m_state_manager(_machine.state()),
m_debug(NULL),
m_execute(NULL),
@@ -573,7 +572,7 @@ device_t::device_t(running_machine &_machine, const device_config &config)
device_t::~device_t()
{
- auto_free(&m_machine, m_debug);
+ auto_free(m_machine, m_debug);
}
@@ -737,13 +736,13 @@ void device_t::start()
intf->interface_pre_start();
// remember the number of state registrations
- int state_registrations = machine->state().registration_count();
+ int state_registrations = m_machine.state().registration_count();
// start the device
device_start();
// complain if nothing was registered by the device
- state_registrations = machine->state().registration_count() - state_registrations;
+ state_registrations = m_machine.state().registration_count() - state_registrations;
device_execute_interface *exec;
device_sound_interface *sound;
if (state_registrations == 0 && (interface(exec) || interface(sound)))
@@ -763,7 +762,7 @@ void device_t::start()
// if we're debugging, create a device_debug object
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
- m_debug = auto_alloc(&m_machine, device_debug(*this));
+ m_debug = auto_alloc(m_machine, device_debug(*this));
debug_setup();
}
@@ -983,7 +982,7 @@ device_t *device_t::auto_finder_base::find_device(device_t &base, const char *ta
void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *tag)
{
- return memory_get_shared(*base.machine, tag);
+ return memory_get_shared(base.machine(), tag);
}
@@ -994,6 +993,6 @@ void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *ta
size_t device_t::auto_finder_base::find_shared_size(device_t &base, const char *tag)
{
size_t result = 0;
- memory_get_shared(*base.machine, tag, result);
+ memory_get_shared(base.machine(), tag, result);
return result;
}
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h
index 5b7106c2b66..1897daf9881 100644
--- a/src/emu/devintrf.h
+++ b/src/emu/devintrf.h
@@ -56,7 +56,7 @@
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
// shorthand for accessing devices by machine/type/tag
-#define devtag_reset(mach,tag) (mach)->device(tag)->reset()
+#define devtag_reset(mach,tag) (mach).device(tag)->reset()
// often derived devices need only a different name and a simple parameter to differentiate them
// these are provided as macros because you can't pass string literals to templates, annoyingly enough
@@ -89,7 +89,7 @@ device_config *_ConfigClass::static_alloc_device_config(const machine_config &mc
\
device_t *_ConfigClass::alloc_device(running_machine &machine) const \
{ \
- return auto_alloc(&machine, _DeviceClass(machine, *this)); \
+ return auto_alloc(machine, _DeviceClass(machine, *this)); \
} \
@@ -234,8 +234,8 @@ class device_list : public tagged_device_list<device_t>
static void static_reset(running_machine &machine);
static void static_exit(running_machine &machine);
- static void static_pre_save(running_machine *machine, void *param);
- static void static_post_load(running_machine *machine, void *param);
+ static void static_pre_save(running_machine &machine, void *param);
+ static void static_post_load(running_machine &machine, void *param);
public:
device_list(resource_pool &pool = global_resource_pool);
@@ -394,6 +394,9 @@ protected:
virtual ~device_t();
public:
+ // getters
+ running_machine &machine() const { return m_machine; }
+
// iteration helpers
device_t *next() const { return m_next; }
device_t *typenext() const;
@@ -467,9 +470,6 @@ public:
machine_config_constructor machine_config_additions() const { return m_baseconfig.machine_config_additions(); }
const input_port_token *input_ports() const { return m_baseconfig.input_ports(); }
-public:
- running_machine * machine;
-
protected:
// miscellaneous helpers
void find_interfaces();
diff --git a/src/emu/devlegcy.c b/src/emu/devlegcy.c
index 0479a2e87d5..638153683e6 100644
--- a/src/emu/devlegcy.c
+++ b/src/emu/devlegcy.c
@@ -217,7 +217,7 @@ legacy_device_base::legacy_device_base(running_machine &_machine, const device_c
{
int tokenbytes = m_config.get_legacy_config_int(DEVINFO_INT_TOKEN_BYTES);
if (tokenbytes != 0)
- m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
+ m_token = auto_alloc_array_clear(m_machine, UINT8, tokenbytes);
}
diff --git a/src/emu/diexec.c b/src/emu/diexec.c
index ae703b650be..d5c7b295d5c 100644
--- a/src/emu/diexec.c
+++ b/src/emu/diexec.c
@@ -314,7 +314,7 @@ device_execute_interface::~device_execute_interface()
bool device_execute_interface::executing() const
{
- return (this == device().machine->scheduler().currently_executing());
+ return (this == device().machine().scheduler().currently_executing());
}
@@ -372,7 +372,7 @@ void device_execute_interface::adjust_icount(int delta)
void device_execute_interface::abort_timeslice()
{
// ignore if not the executing device
- if (this != device().machine->scheduler().currently_executing())
+ if (this != device().machine().scheduler().currently_executing())
return;
// swallow the remaining cycles
@@ -442,7 +442,7 @@ void device_execute_interface::spin_until_time(attotime duration)
suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true);
// then set a timer for it
- device().machine->scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
+ device().machine().scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
timetrig = (timetrig + 1) % 256;
}
@@ -547,7 +547,7 @@ void device_execute_interface::execute_set_input(int linenum, int state)
void device_execute_interface::interface_pre_start()
{
// fill in the initial states
- int index = device().machine->m_devicelist.indexof(m_device);
+ int index = device().machine().m_devicelist.indexof(m_device);
m_suspend = SUSPEND_REASON_RESET;
m_profiler = profile_type(index + PROFILER_DEVICE_FIRST);
m_inttrigger = index + TRIGGER_INT;
@@ -558,9 +558,9 @@ void device_execute_interface::interface_pre_start()
// allocate timers if we need them
if (m_execute_config.m_vblank_interrupts_per_frame > 1)
- m_partial_frame_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
+ m_partial_frame_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
if (m_execute_config.m_timed_interrupt_period != attotime::zero)
- m_timedint_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
+ m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
// register for save states
m_device.save_item(NAME(m_suspend));
@@ -623,11 +623,11 @@ void device_execute_interface::interface_post_reset()
// new style - use screen tag directly
screen_device *screen;
if (m_execute_config.m_vblank_interrupt_screen != NULL)
- screen = downcast<screen_device *>(device().machine->device(m_execute_config.m_vblank_interrupt_screen));
+ screen = downcast<screen_device *>(device().machine().device(m_execute_config.m_vblank_interrupt_screen));
// old style 'hack' setup - use screen #0
else
- screen = device().machine->first_screen();
+ screen = device().machine().first_screen();
assert(screen != NULL);
screen->register_vblank_callback(static_on_vblank, NULL);
@@ -665,7 +665,7 @@ void device_execute_interface::interface_clock_changed()
m_divisor = attos;
// re-compute the perfect interleave factor
- device().machine->scheduler().compute_perfect_interleave();
+ device().machine().scheduler().compute_perfect_interleave();
}
@@ -709,7 +709,7 @@ void device_execute_interface::static_on_vblank(screen_device &screen, void *par
if (vblank_state)
{
device_execute_interface *exec = NULL;
- for (bool gotone = screen.machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = screen.machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
exec->on_vblank_start(screen);
}
}
@@ -740,7 +740,7 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
// if we have more than one interrupt per frame, start the timer now to trigger the rest of them
if (m_execute_config.m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
{
- m_partial_frame_period = device().machine->primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
+ m_partial_frame_period = device().machine().primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
m_partial_frame_timer->adjust(m_partial_frame_period);
}
}
@@ -916,7 +916,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_device->tag(), m_linenum, state,
// if this is the first one, set the timer
if (event_index == 0)
- m_execute->device().machine->scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
+ m_execute->device().machine().scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
}
}
diff --git a/src/emu/diexec.h b/src/emu/diexec.h
index 65b398a4640..db1fc83643f 100644
--- a/src/emu/diexec.h
+++ b/src/emu/diexec.h
@@ -300,7 +300,7 @@ protected:
int m_qindex; // index within the queue
private:
- static void static_empty_event_queue(running_machine *machine, void *ptr, int param);
+ static void static_empty_event_queue(running_machine &machine, void *ptr, int param);
void empty_event_queue();
};
@@ -344,15 +344,15 @@ protected:
private:
// callbacks
- static void static_timed_trigger_callback(running_machine *machine, void *ptr, int param);
+ static void static_timed_trigger_callback(running_machine &machine, void *ptr, int param);
static void static_on_vblank(screen_device &screen, void *param, bool vblank_state);
void on_vblank_start(screen_device &screen);
- static void static_trigger_partial_frame_interrupt(running_machine *machine, void *ptr, int param);
+ static void static_trigger_partial_frame_interrupt(running_machine &machine, void *ptr, int param);
void trigger_partial_frame_interrupt();
- static void static_trigger_periodic_interrupt(running_machine *machine, void *ptr, int param);
+ static void static_trigger_periodic_interrupt(running_machine &machine, void *ptr, int param);
void trigger_periodic_interrupt();
attoseconds_t minimum_quantum() const;
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index 6ef5203baec..7573fa8e6f3 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -394,7 +394,7 @@ void device_image_interface::setup_working_directory()
if (try_change_working_directory("software"))
{
/* now down to a directory for this computer */
- gamedrv = &device().machine->system();
+ gamedrv = &device().machine().system();
while(gamedrv && !try_change_working_directory(gamedrv->name))
{
gamedrv = driver_get_compatible(gamedrv);
@@ -431,7 +431,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag)
return NULL;
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine->region( full_tag )->base();
+ return device().machine().region( full_tag )->base();
}
@@ -444,7 +444,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag)
char full_tag[256];
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine->region( full_tag )->bytes();
+ return device().machine().region( full_tag )->bytes();
}
@@ -582,9 +582,9 @@ UINT32 device_image_interface::crc()
-------------------------------------------------*/
void device_image_interface::battery_load(void *buffer, int length, int fill)
{
- astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
+ astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
- image_battery_load_by_name(device().machine->options(), astring_c(fname), buffer, length, fill);
+ image_battery_load_by_name(device().machine().options(), astring_c(fname), buffer, length, fill);
astring_free(fname);
}
@@ -596,9 +596,9 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
-------------------------------------------------*/
void device_image_interface::battery_save(const void *buffer, int length)
{
- astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
+ astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
- image_battery_save_by_name(device().machine->options(), astring_c(fname), buffer, length);
+ image_battery_save_by_name(device().machine().options(), astring_c(fname), buffer, length);
astring_free(fname);
}
diff --git a/src/emu/disound.c b/src/emu/disound.c
index 4a1b31dc772..89fbd33ecb8 100644
--- a/src/emu/disound.c
+++ b/src/emu/disound.c
@@ -181,7 +181,7 @@ int device_sound_interface::inputs() const
{
// scan the list counting streams we own and summing their inputs
int inputs = 0;
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
inputs += stream->input_count();
return inputs;
@@ -197,7 +197,7 @@ int device_sound_interface::outputs() const
{
// scan the list counting streams we own and summing their outputs
int outputs = 0;
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
outputs += stream->output_count();
return outputs;
@@ -215,7 +215,7 @@ sound_stream *device_sound_interface::input_to_stream_input(int inputnum, int &s
assert(inputnum >= 0);
// scan the list looking for streams owned by this device
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
{
if (inputnum < stream->input_count())
@@ -242,7 +242,7 @@ sound_stream *device_sound_interface::output_to_stream_output(int outputnum, int
assert(outputnum >= 0);
// scan the list looking for streams owned by this device
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
{
if (outputnum < stream->output_count())
@@ -268,7 +268,7 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
// handle ALL_OUTPUTS as a special case
if (outputnum == ALL_OUTPUTS)
{
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
for (int outputnum = 0; outputnum < stream->output_count(); outputnum++)
stream->set_output_gain(outputnum, gain);
@@ -294,13 +294,13 @@ void device_sound_interface::interface_pre_start()
{
// scan all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route; if we are, make sure the source device is started
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && !sound->device().started())
throw device_missing_dependencies();
}
@@ -308,13 +308,13 @@ void device_sound_interface::interface_pre_start()
// now iterate through devices again and assign any auto-allocated inputs
m_auto_allocated_inputs = 0;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
{
const_cast<device_config_sound_interface::sound_route *>(route)->m_input = m_auto_allocated_inputs;
@@ -334,13 +334,13 @@ void device_sound_interface::interface_post_start()
{
// iterate over all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// if we are the target of this route, hook it up
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device)
{
// iterate over all outputs, matching any that apply
@@ -378,7 +378,7 @@ void device_sound_interface::interface_post_start()
void device_sound_interface::interface_pre_reset()
{
// update all streams on this device prior to reset
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
stream->update();
}
diff --git a/src/emu/distate.c b/src/emu/distate.c
index f4e01737ea6..4a095bc5457 100644
--- a/src/emu/distate.c
+++ b/src/emu/distate.c
@@ -579,7 +579,7 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
assert(symbol != NULL);
// allocate new entry
- device_state_entry *entry = auto_alloc(device().machine, device_state_entry(index, symbol, data, size));
+ device_state_entry *entry = auto_alloc(device().machine(), device_state_entry(index, symbol, data, size));
// append to the end of the list
m_state_list.append(*entry);
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index c5701def17e..cf5654394f1 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -79,9 +79,9 @@ INLINE INT32 normalize_yscroll(bitmap_t *bitmap, INT32 yscroll)
elements referenced by a machine
-------------------------------------------------*/
-void gfx_init(running_machine *machine)
+void gfx_init(running_machine &machine)
{
- const gfx_decode_entry *gfxdecodeinfo = machine->config().m_gfxdecodeinfo;
+ const gfx_decode_entry *gfxdecodeinfo = machine.config().m_gfxdecodeinfo;
int curgfx;
/* skip if nothing to do */
@@ -92,7 +92,7 @@ void gfx_init(running_machine *machine)
for (curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != NULL; curgfx++)
{
const gfx_decode_entry *gfxdecode = &gfxdecodeinfo[curgfx];
- const memory_region *region = (gfxdecode->memory_region != NULL) ? machine->region(gfxdecode->memory_region) : NULL;
+ const memory_region *region = (gfxdecode->memory_region != NULL) ? machine.region(gfxdecode->memory_region) : NULL;
UINT32 region_length = (region != NULL) ? (8 * region->bytes()) : 0;
const UINT8 *region_base = (region != NULL) ? region->base() : NULL;
UINT32 xscale = (gfxdecode->xscale == 0) ? 1 : gfxdecode->xscale;
@@ -206,7 +206,7 @@ void gfx_init(running_machine *machine)
glcopy.total = total;
/* allocate the graphics */
- machine->gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
+ machine.gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
}
}
@@ -217,7 +217,7 @@ void gfx_init(running_machine *machine)
based on a given layout
-------------------------------------------------*/
-gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
+gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
{
int israw = (gl->planeoffset[0] == GFX_RAW);
int planes = gl->planes;
@@ -243,7 +243,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
gfx->total_colors = total_colors;
gfx->srcdata = srcdata;
- gfx->machine = machine;
+ gfx->m_machine = &machine;
/* copy the layout */
gfx->layout = *gl;
@@ -338,12 +338,12 @@ void gfx_element_free(gfx_element *gfx)
return;
/* free our data */
- auto_free(gfx->machine, gfx->layout.extyoffs);
- auto_free(gfx->machine, gfx->layout.extxoffs);
- auto_free(gfx->machine, gfx->pen_usage);
- auto_free(gfx->machine, gfx->dirty);
- auto_free(gfx->machine, gfx->gfxdata);
- auto_free(gfx->machine, gfx);
+ auto_free(gfx->machine(), gfx->layout.extyoffs);
+ auto_free(gfx->machine(), gfx->layout.extxoffs);
+ auto_free(gfx->machine(), gfx->pen_usage);
+ auto_free(gfx->machine(), gfx->dirty);
+ auto_free(gfx->machine(), gfx->gfxdata);
+ auto_free(gfx->machine(), gfx);
}
@@ -352,7 +352,7 @@ void gfx_element_free(gfx_element *gfx)
temporary one-off gfx_element
-------------------------------------------------*/
-void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
+void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
{
static UINT8 not_dirty = 0;
@@ -369,7 +369,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->color_base = color_base;
gfx->color_depth = color_granularity;
gfx->color_granularity = color_granularity;
- gfx->total_colors = (machine->total_colors() - color_base) / color_granularity;
+ gfx->total_colors = (machine.total_colors() - color_base) / color_granularity;
gfx->pen_usage = NULL;
@@ -380,7 +380,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->dirty = &not_dirty;
gfx->dirtyseq = 0;
- gfx->machine = machine;
+ gfx->m_machine = &machine;
}
@@ -517,7 +517,7 @@ void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -553,7 +553,7 @@ void drawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_eleme
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -638,7 +638,7 @@ void drawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -686,7 +686,7 @@ void drawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -723,7 +723,7 @@ void drawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -768,7 +768,7 @@ void drawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -811,7 +811,7 @@ void drawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_e
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -910,7 +910,7 @@ void drawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -965,7 +965,7 @@ void drawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -1009,7 +1009,7 @@ void drawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -1047,7 +1047,7 @@ void pdrawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_elemen
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1086,7 +1086,7 @@ void pdrawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1174,7 +1174,7 @@ void pdrawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1225,7 +1225,7 @@ void pdrawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1265,7 +1265,7 @@ void pdrawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -1313,7 +1313,7 @@ void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1360,7 +1360,7 @@ void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1466,7 +1466,7 @@ void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1525,7 +1525,7 @@ void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gf
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1574,7 +1574,7 @@ void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index b5f15be9ecb..4a379f580ab 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -120,6 +120,8 @@ struct _gfx_layout
class gfx_element
{
public:
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
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 */
@@ -144,7 +146,7 @@ public:
UINT8 * dirty; /* dirty array for detecting tiles that need decoding */
UINT32 dirtyseq; /* sequence number; incremented each time a tile is dirtied */
- running_machine *machine; /* pointer to the owning machine */
+ running_machine *m_machine; /* pointer to the owning machine */
gfx_layout layout; /* copy of the original layout */
};
@@ -170,10 +172,10 @@ struct gfx_decode_entry
/* ----- graphics elements ----- */
/* allocate memory for the graphics elements referenced by a machine */
-void gfx_init(running_machine *machine);
+void gfx_init(running_machine &machine);
/* allocate a gfx_element structure based on a given layout */
-gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
+gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
/* update a single code in a gfx_element */
void gfx_element_decode(const gfx_element *gfx, UINT32 code);
@@ -182,7 +184,7 @@ void gfx_element_decode(const gfx_element *gfx, UINT32 code);
void gfx_element_free(gfx_element *gfx);
/* create a temporary one-off gfx_element */
-void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);
+void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);
diff --git a/src/emu/driver.h b/src/emu/driver.h
index fa38519c93f..47e64ef6564 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -60,7 +60,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*driver_init_func)(running_machine *machine);
+typedef void (*driver_init_func)(running_machine &machine);
struct game_driver
@@ -73,7 +73,7 @@ struct game_driver
const char * manufacturer; /* manufacturer of the game */
machine_config_constructor machine_config; /* machine driver tokens */
const input_port_token *ipt; /* pointer to array of input port tokens */
- void (*driver_init)(running_machine *machine); /* DRIVER_INIT callback */
+ void (*driver_init)(running_machine &machine); /* DRIVER_INIT callback */
const rom_entry * rom; /* pointer to list of ROMs for the game */
const char * compatible_with;
UINT32 flags; /* orientation and other flags; see defines below */
@@ -88,7 +88,7 @@ struct game_driver
#define DRIVER_INIT_NAME(name) driver_init_##name
-#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine *machine)
+#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
diff --git a/src/emu/drivers/empty.c b/src/emu/drivers/empty.c
index ad4511b44f3..bea3c2231ab 100644
--- a/src/emu/drivers/empty.c
+++ b/src/emu/drivers/empty.c
@@ -23,7 +23,7 @@
static MACHINE_START( empty )
{
/* force the UI to show the game select screen */
- ui_menu_force_game_select(machine, &machine->render().ui_container());
+ ui_menu_force_game_select(machine, &machine.render().ui_container());
}
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index b8801fc5159..68503d30887 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -373,7 +373,7 @@ inline _Dest crosscast(_Source *src)
//**************************************************************************
DECL_NORETURN void fatalerror(const char *format, ...) ATTR_PRINTF(1,2) ATTR_NORETURN;
-DECL_NORETURN void fatalerror_exitcode(running_machine *machine, int exitcode, const char *format, ...) ATTR_PRINTF(3,4) ATTR_NORETURN;
+DECL_NORETURN void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...) ATTR_PRINTF(3,4) ATTR_NORETURN;
inline void fatalerror(const char *format, ...)
{
@@ -383,7 +383,7 @@ inline void fatalerror(const char *format, ...)
va_end(ap);
}
-inline void fatalerror_exitcode(running_machine *machine, int exitcode, const char *format, ...)
+inline void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...)
{
va_list ap;
va_start(ap, format);
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index d3db7c45503..69cca4f8b87 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -401,7 +401,7 @@ void emu_options::set_system_name(const char *name)
const char *emu_options::device_option(device_image_interface &image)
{
- return image.device().machine->options().value(image.image_config().instance_name());
+ return image.device().machine().options().value(image.image_config().instance_name());
}
diff --git a/src/emu/emupal.c b/src/emu/emupal.c
index 819c1746283..061aa96dd90 100644
--- a/src/emu/emupal.c
+++ b/src/emu/emupal.c
@@ -62,7 +62,9 @@ struct _palette_private
class colortable_t
{
public:
- running_machine * machine; /* associated machine */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* associated machine */
UINT32 entries; /* number of entries */
UINT32 palentries; /* number of palette entries */
UINT16 * raw; /* raw data about each entry */
@@ -75,13 +77,13 @@ public:
FUNCTION PROTOTYPES
***************************************************************************/
-static void palette_presave(running_machine *machine, void *param);
-static void palette_postload(running_machine *machine, void *param);
+static void palette_presave(running_machine &machine, void *param);
+static void palette_postload(running_machine &machine, void *param);
static void palette_exit(running_machine &machine);
-static void allocate_palette(running_machine *machine, palette_private *palette);
-static void allocate_color_tables(running_machine *machine, palette_private *palette);
-static void allocate_shadow_tables(running_machine *machine, palette_private *palette);
-static void configure_rgb_shadows(running_machine *machine, int mode, float factor);
+static void allocate_palette(running_machine &machine, palette_private *palette);
+static void allocate_color_tables(running_machine &machine, palette_private *palette);
+static void allocate_shadow_tables(running_machine &machine, palette_private *palette);
+static void configure_rgb_shadows(running_machine &machine, int mode, float factor);
@@ -94,17 +96,17 @@ static void configure_rgb_shadows(running_machine *machine, int mode, float fact
takes place before the display is created
-------------------------------------------------*/
-void palette_init(running_machine *machine)
+void palette_init(running_machine &machine)
{
palette_private *palette = auto_alloc_clear(machine, palette_private);
- screen_device *device = machine->first_screen();
+ screen_device *device = machine.first_screen();
/* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */
bitmap_format format = (device != NULL) ? device->format() : BITMAP_FORMAT_INVALID;
/* request cleanup */
- machine->palette_data = palette;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, palette_exit);
+ machine.palette_data = palette;
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, palette_exit);
/* reset all our data */
palette->format = format;
@@ -120,7 +122,7 @@ void palette_init(running_machine *machine)
case BITMAP_FORMAT_INVALID:
/* invalid format means no palette - or at least it should */
- assert(machine->total_colors() == 0);
+ assert(machine.total_colors() == 0);
return;
default:
@@ -129,7 +131,7 @@ void palette_init(running_machine *machine)
}
/* allocate all the data structures */
- if (machine->total_colors() > 0)
+ if (machine.total_colors() > 0)
{
int numcolors;
@@ -138,13 +140,13 @@ void palette_init(running_machine *machine)
allocate_shadow_tables(machine, palette);
/* set up save/restore of the palette */
- numcolors = palette_get_num_colors(machine->palette);
+ numcolors = palette_get_num_colors(machine.palette);
palette->save_pen = auto_alloc_array(machine, pen_t, numcolors);
palette->save_bright = auto_alloc_array(machine, float, numcolors);
state_save_register_global_pointer(machine, palette->save_pen, numcolors);
state_save_register_global_pointer(machine, palette->save_bright, numcolors);
- machine->state().register_presave(palette_presave, palette);
- machine->state().register_postload(palette_postload, palette);
+ machine.state().register_presave(palette_presave, palette);
+ machine.state().register_postload(palette_postload, palette);
}
}
@@ -159,12 +161,12 @@ void palette_init(running_machine *machine)
shadow brightness factor
-------------------------------------------------*/
-void palette_set_shadow_factor(running_machine *machine, double factor)
+void palette_set_shadow_factor(running_machine &machine, double factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(palette->shadow_group != 0);
- palette_group_set_contrast(machine->palette, palette->shadow_group, factor);
+ palette_group_set_contrast(machine.palette, palette->shadow_group, factor);
}
@@ -173,12 +175,12 @@ void palette_set_shadow_factor(running_machine *machine, double factor)
highlight brightness factor
-------------------------------------------------*/
-void palette_set_highlight_factor(running_machine *machine, double factor)
+void palette_set_highlight_factor(running_machine &machine, double factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(palette->hilight_group != 0);
- palette_group_set_contrast(machine->palette, palette->hilight_group, factor);
+ palette_group_set_contrast(machine.palette, palette->hilight_group, factor);
}
@@ -238,11 +240,11 @@ void palette_set_highlight_factor(running_machine *machine, double factor)
different live shadow tables
-------------------------------------------------*/
-void palette_set_shadow_mode(running_machine *machine, int mode)
+void palette_set_shadow_mode(running_machine &machine, int mode)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(mode >= 0 && mode < MAX_SHADOW_PRESETS);
- machine->shadow_table = palette->shadow_table[mode].base;
+ machine.shadow_table = palette->shadow_table[mode].base;
}
@@ -251,9 +253,9 @@ void palette_set_shadow_mode(running_machine *machine, int mode)
RGB values for 1 of 4 shadow tables
-------------------------------------------------*/
-void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int dg, int db, int noclip)
+void palette_set_shadow_dRGB32(running_machine &machine, int mode, int dr, int dg, int db, int noclip)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
shadow_table_data *stable = &palette->shadow_table[mode];
int i;
@@ -313,20 +315,19 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d
with the given number of entries
-------------------------------------------------*/
-colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
+colortable_t *colortable_alloc(running_machine &machine, UINT32 palettesize)
{
colortable_t *ctable;
UINT32 index;
- assert(machine != NULL);
assert(palettesize > 0);
/* allocate the colortable */
ctable = auto_alloc_clear(machine, colortable_t);
/* fill in the basics */
- ctable->machine = machine;
- ctable->entries = machine->total_colors();
+ ctable->m_machine = &machine;
+ ctable->entries = machine.total_colors();
ctable->palentries = palettesize;
/* allocate the raw colortable */
@@ -361,7 +362,7 @@ void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value
if (ctable->raw[entry] != value)
{
ctable->raw[entry] = value;
- palette_set_color(ctable->machine, entry, ctable->palette[value]);
+ palette_set_color(ctable->machine(), entry, ctable->palette[value]);
}
}
@@ -403,7 +404,7 @@ void colortable_palette_set_color(colortable_t *ctable, UINT32 entry, rgb_t colo
/* update the palette for any colortable entries that reference it */
for (index = 0; index < ctable->entries; index++)
if (ctable->raw[index] == entry)
- palette_set_color(ctable->machine, index, color);
+ palette_set_color(ctable->machine(), index, color);
}
}
@@ -495,9 +496,9 @@ UINT32 colortable_palette_get_size(colortable_t *ctable)
black color
-------------------------------------------------*/
-pen_t get_black_pen(running_machine *machine)
+pen_t get_black_pen(running_machine &machine)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
return palette->black_pen;
}
@@ -507,9 +508,9 @@ pen_t get_black_pen(running_machine *machine)
white color
-------------------------------------------------*/
-pen_t get_white_pen(running_machine *machine)
+pen_t get_white_pen(running_machine &machine)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
return palette->white_pen;
}
@@ -524,17 +525,17 @@ pen_t get_white_pen(running_machine *machine)
for saving
-------------------------------------------------*/
-static void palette_presave(running_machine *machine, void *param)
+static void palette_presave(running_machine &machine, void *param)
{
- int numcolors = palette_get_num_colors(machine->palette);
+ int numcolors = palette_get_num_colors(machine.palette);
palette_private *palette = (palette_private *)param;
int index;
/* fill the save arrays with updated pen and brightness information */
for (index = 0; index < numcolors; index++)
{
- palette->save_pen[index] = palette_entry_get_color(machine->palette, index);
- palette->save_bright[index] = palette_entry_get_contrast(machine->palette, index);
+ palette->save_pen[index] = palette_entry_get_color(machine.palette, index);
+ palette->save_bright[index] = palette_entry_get_contrast(machine.palette, index);
}
}
@@ -544,17 +545,17 @@ static void palette_presave(running_machine *machine, void *param)
actually update the palette
-------------------------------------------------*/
-static void palette_postload(running_machine *machine, void *param)
+static void palette_postload(running_machine &machine, void *param)
{
- int numcolors = palette_get_num_colors(machine->palette);
+ int numcolors = palette_get_num_colors(machine.palette);
palette_private *palette = (palette_private *)param;
int index;
/* reset the pen and brightness for each entry */
for (index = 0; index < numcolors; index++)
{
- palette_entry_set_color(machine->palette, index, palette->save_pen[index]);
- palette_entry_set_contrast(machine->palette, index, palette->save_bright[index]);
+ palette_entry_set_color(machine.palette, index, palette->save_pen[index]);
+ palette_entry_set_contrast(machine.palette, index, palette->save_bright[index]);
}
}
@@ -576,39 +577,39 @@ static void palette_exit(running_machine &machine)
palette object itself
-------------------------------------------------*/
-static void allocate_palette(running_machine *machine, palette_private *palette)
+static void allocate_palette(running_machine &machine, palette_private *palette)
{
int numgroups, index;
/* determine the number of groups we need */
numgroups = 1;
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
palette->shadow_group = numgroups++;
- if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
palette->hilight_group = numgroups++;
- assert_always(machine->total_colors() * numgroups <= 65536, "Error: palette has more than 65536 colors.");
+ assert_always(machine.total_colors() * numgroups <= 65536, "Error: palette has more than 65536 colors.");
/* allocate a palette object containing all the colors and groups */
- machine->palette = palette_alloc(machine->total_colors(), numgroups);
- assert_always(machine->palette != NULL, "Failed to allocate system palette");
+ machine.palette = palette_alloc(machine.total_colors(), numgroups);
+ assert_always(machine.palette != NULL, "Failed to allocate system palette");
/* configure the groups */
if (palette->shadow_group != 0)
- palette_group_set_contrast(machine->palette, palette->shadow_group, (float)PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_group_set_contrast(machine.palette, palette->shadow_group, (float)PALETTE_DEFAULT_SHADOW_FACTOR);
if (palette->hilight_group != 0)
- palette_group_set_contrast(machine->palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR);
+ palette_group_set_contrast(machine.palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR);
/* set the initial colors to a standard rainbow */
- for (index = 0; index < machine->total_colors(); index++)
- palette_entry_set_color(machine->palette, index, MAKE_RGB(pal1bit(index >> 0), pal1bit(index >> 1), pal1bit(index >> 2)));
+ for (index = 0; index < machine.total_colors(); index++)
+ palette_entry_set_color(machine.palette, index, MAKE_RGB(pal1bit(index >> 0), pal1bit(index >> 1), pal1bit(index >> 2)));
/* switch off the color mode */
switch (palette->format)
{
/* 16-bit paletteized case */
case BITMAP_FORMAT_INDEXED16:
- palette->black_pen = palette_get_black_entry(machine->palette);
- palette->white_pen = palette_get_white_entry(machine->palette);
+ palette->black_pen = palette_get_black_entry(machine.palette);
+ palette->white_pen = palette_get_white_entry(machine.palette);
if (palette->black_pen >= 65536)
palette->black_pen = 0;
if (palette->white_pen >= 65536)
@@ -640,9 +641,9 @@ static void allocate_palette(running_machine *machine, palette_private *palette)
pen and color tables
-------------------------------------------------*/
-static void allocate_color_tables(running_machine *machine, palette_private *palette)
+static void allocate_color_tables(running_machine &machine, palette_private *palette)
{
- int total_colors = palette_get_num_colors(machine->palette) * palette_get_num_groups(machine->palette);
+ int total_colors = palette_get_num_colors(machine.palette) * palette_get_num_groups(machine.palette);
pen_t *pentable;
int i;
@@ -651,21 +652,21 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
{
case BITMAP_FORMAT_INDEXED16:
/* create a dummy 1:1 mapping */
- machine->pens = pentable = auto_alloc_array(machine, pen_t, total_colors + 2);
+ machine.pens = pentable = auto_alloc_array(machine, pen_t, total_colors + 2);
for (i = 0; i < total_colors + 2; i++)
pentable[i] = i;
break;
case BITMAP_FORMAT_RGB15:
- machine->pens = palette_entry_list_adjusted_rgb15(machine->palette);
+ machine.pens = palette_entry_list_adjusted_rgb15(machine.palette);
break;
case BITMAP_FORMAT_RGB32:
- machine->pens = palette_entry_list_adjusted(machine->palette);
+ machine.pens = palette_entry_list_adjusted(machine.palette);
break;
default:
- machine->pens = NULL;
+ machine.pens = NULL;
break;
}
}
@@ -676,10 +677,10 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
shadow tables
-------------------------------------------------*/
-static void allocate_shadow_tables(running_machine *machine, palette_private *palette)
+static void allocate_shadow_tables(running_machine &machine, palette_private *palette)
{
/* if we have shadows, allocate shadow tables */
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;
@@ -689,7 +690,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
{
palette->shadow_table[0].base = palette->shadow_table[2].base = table;
for (i = 0; i < 65536; i++)
- table[i] = (i < machine->total_colors()) ? (i + machine->total_colors()) : i;
+ table[i] = (i < machine.total_colors()) ? (i + machine.total_colors()) : i;
}
/* RGB mode gets two 32k tables in slots 0 and 2 */
@@ -702,7 +703,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
}
/* if we have hilights, allocate shadow tables */
- if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;
@@ -712,7 +713,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
{
palette->shadow_table[1].base = palette->shadow_table[3].base = table;
for (i = 0; i < 65536; i++)
- table[i] = (i < machine->total_colors()) ? (i + 2 * machine->total_colors()) : i;
+ table[i] = (i < machine.total_colors()) ? (i + 2 * machine.total_colors()) : i;
}
/* RGB mode gets two 32k tables in slots 1 and 3 */
@@ -725,7 +726,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
}
/* set the default table */
- machine->shadow_table = palette->shadow_table[0].base;
+ machine.shadow_table = palette->shadow_table[0].base;
}
@@ -734,9 +735,9 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
for the RGB tables
-------------------------------------------------*/
-static void configure_rgb_shadows(running_machine *machine, int mode, float factor)
+static void configure_rgb_shadows(running_machine &machine, int mode, float factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
shadow_table_data *stable = &palette->shadow_table[mode];
int ifactor = (int)(factor * 256.0f);
int i;
diff --git a/src/emu/emupal.h b/src/emu/emupal.h
index 9b590de8c46..1180cfdb25a 100644
--- a/src/emu/emupal.h
+++ b/src/emu/emupal.h
@@ -124,34 +124,34 @@ class colortable_t;
/* ----- initialization and configuration ----- */
/* palette initialization that takes place before the display is created */
-void palette_init(running_machine *machine);
+void palette_init(running_machine &machine);
/* ----- shadow/hilight configuration ----- */
/* set the global shadow brightness factor */
-void palette_set_shadow_factor(running_machine *machine, double factor);
+void palette_set_shadow_factor(running_machine &machine, double factor);
/* set the global highlight brightness factor */
-void palette_set_highlight_factor(running_machine *machine, double factor);
+void palette_set_highlight_factor(running_machine &machine, double factor);
/* ----- shadow table configuration ----- */
/* select 1 of 4 different live shadow tables */
-void palette_set_shadow_mode(running_machine *machine, int mode);
+void palette_set_shadow_mode(running_machine &machine, int mode);
/* configure delta RGB values for 1 of 4 shadow tables */
-void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int dg, int db, int noclip);
+void palette_set_shadow_dRGB32(running_machine &machine, int mode, int dr, int dg, int db, int noclip);
/* ----- colortable management ----- */
/* allocate a new colortable with the given number of entries */
-colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize);
+colortable_t *colortable_alloc(running_machine &machine, UINT32 palettesize);
/* set the value of a colortable entry */
void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value);
@@ -179,10 +179,10 @@ UINT32 colortable_palette_get_size(colortable_t *ctable);
/* ----- utilities ----- */
/* return the pen for a fixed black color */
-pen_t get_black_pen(running_machine *machine);
+pen_t get_black_pen(running_machine &machine);
/* return the pen for a fixed white color */
-pen_t get_white_pen(running_machine *machine);
+pen_t get_white_pen(running_machine &machine);
@@ -196,9 +196,9 @@ pen_t get_white_pen(running_machine *machine);
entry
-------------------------------------------------*/
-INLINE void palette_set_color(running_machine *machine, pen_t pen, rgb_t rgb)
+INLINE void palette_set_color(running_machine &machine, pen_t pen, rgb_t rgb)
{
- palette_entry_set_color(machine->palette, pen, rgb);
+ palette_entry_set_color(machine.palette, pen, rgb);
}
@@ -207,9 +207,9 @@ INLINE void palette_set_color(running_machine *machine, pen_t pen, rgb_t rgb)
entry with individual R,G,B components
-------------------------------------------------*/
-INLINE void palette_set_color_rgb(running_machine *machine, pen_t pen, UINT8 r, UINT8 g, UINT8 b)
+INLINE void palette_set_color_rgb(running_machine &machine, pen_t pen, UINT8 r, UINT8 g, UINT8 b)
{
- palette_entry_set_color(machine->palette, pen, MAKE_RGB(r, g, b));
+ palette_entry_set_color(machine.palette, pen, MAKE_RGB(r, g, b));
}
@@ -218,9 +218,9 @@ INLINE void palette_set_color_rgb(running_machine *machine, pen_t pen, UINT8 r,
entry
-------------------------------------------------*/
-INLINE rgb_t palette_get_color(running_machine *machine, pen_t pen)
+INLINE rgb_t palette_get_color(running_machine &machine, pen_t pen)
{
- return palette_entry_get_color(machine->palette, pen);
+ return palette_entry_get_color(machine.palette, pen);
}
@@ -229,9 +229,9 @@ INLINE rgb_t palette_get_color(running_machine *machine, pen_t pen)
contrast factor
-------------------------------------------------*/
-INLINE void palette_set_pen_contrast(running_machine *machine, pen_t pen, double bright)
+INLINE void palette_set_pen_contrast(running_machine &machine, pen_t pen, double bright)
{
- palette_entry_set_contrast(machine->palette, pen, bright);
+ palette_entry_set_contrast(machine.palette, pen, bright);
}
@@ -240,10 +240,10 @@ INLINE void palette_set_pen_contrast(running_machine *machine, pen_t pen, double
entries from an array of rgb_t values
-------------------------------------------------*/
-INLINE void palette_set_colors(running_machine *machine, pen_t color_base, const rgb_t *colors, int color_count)
+INLINE void palette_set_colors(running_machine &machine, pen_t color_base, const rgb_t *colors, int color_count)
{
while (color_count--)
- palette_entry_set_color(machine->palette, color_base++, *colors++);
+ palette_entry_set_color(machine.palette, color_base++, *colors++);
}
diff --git a/src/emu/image.c b/src/emu/image.c
index 03cfb34e339..e228f980a76 100644
--- a/src/emu/image.c
+++ b/src/emu/image.c
@@ -62,7 +62,7 @@ struct io_procs image_ioprocs =
configuration items
-------------------------------------------------*/
-static void image_dirs_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void image_dirs_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *node;
const char *dev_instance;
@@ -77,7 +77,7 @@ static void image_dirs_load(running_machine *machine, int config_type, xml_data_
if ((dev_instance != NULL) && (dev_instance[0] != '\0'))
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
if (!strcmp(dev_instance, image->image_config().instance_name())) {
working_directory = xml_get_attribute_string(node, "directory", NULL);
@@ -97,7 +97,7 @@ static void image_dirs_load(running_machine *machine, int config_type, xml_data_
directories to the configuration file
-------------------------------------------------*/
-static void image_dirs_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void image_dirs_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *node;
const char *dev_instance;
@@ -106,7 +106,7 @@ static void image_dirs_save(running_machine *machine, int config_type, xml_data_
/* only care about game-specific data */
if (config_type == CONFIG_TYPE_GAME)
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
dev_instance = image->image_config().instance_name();
@@ -153,21 +153,21 @@ static int write_config(emu_options &options, const char *filename, const game_d
out of core into the options
-------------------------------------------------*/
-static void image_options_extract(running_machine *machine)
+static void image_options_extract(running_machine &machine)
{
/* only extract the device options if we've added them */
-// if (machine->options().bool_value(OPTION_ADDED_DEVICE_OPTIONS))
+// if (machine.options().bool_value(OPTION_ADDED_DEVICE_OPTIONS))
{
int index = 0;
device_image_interface *image = NULL;
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
const char *filename = image->filename();
/* and set the option */
astring error;
- machine->options().set_value(image->image_config().instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
+ machine.options().set_value(image->image_config().instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
assert(!error);
index++;
@@ -175,8 +175,8 @@ static void image_options_extract(running_machine *machine)
}
/* write the config, if appropriate */
- if (machine->options().write_config())
- write_config(machine->options(), NULL, &machine->system());
+ if (machine.options().write_config())
+ write_config(machine.options(), NULL, &machine.system());
}
/*-------------------------------------------------
@@ -189,7 +189,7 @@ void image_unload_all(running_machine &machine)
device_image_interface *image = NULL;
// extract the options
- image_options_extract(&machine);
+ image_options_extract(machine);
for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
@@ -202,16 +202,16 @@ void image_unload_all(running_machine &machine)
running_machine
-------------------------------------------------*/
-void image_device_init(running_machine *machine)
+void image_device_init(running_machine &machine)
{
const char *image_name;
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
/* is an image specified for this image */
- image_name = machine->options().device_option(*image);
+ image_name = machine.options().device_option(*image);
if ((image_name != NULL) && (image_name[0] != '\0'))
{
@@ -229,7 +229,7 @@ void image_device_init(running_machine *machine)
astring image_basename(image_name);
/* unload all images */
- image_unload_all(*machine);
+ image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
image->image_config().devconfig().name(),
@@ -255,12 +255,12 @@ void image_device_init(running_machine *machine)
running_machine
-------------------------------------------------*/
-void image_postdevice_init(running_machine *machine)
+void image_postdevice_init(running_machine &machine)
{
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
int result = image->finish_load();
/* did the image load fail? */
@@ -270,7 +270,7 @@ void image_postdevice_init(running_machine *machine)
astring image_err = astring(image->error());
/* unload all images */
- image_unload_all(*machine);
+ image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
image->image_config().devconfig().name(),
@@ -279,7 +279,7 @@ void image_postdevice_init(running_machine *machine)
}
/* add a callback for when we shut down */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, image_unload_all);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, image_unload_all);
}
/***************************************************************************
INITIALIZATION
@@ -289,7 +289,7 @@ void image_postdevice_init(running_machine *machine)
image_init - start up the image system
-------------------------------------------------*/
-void image_init(running_machine *machine)
+void image_init(running_machine &machine)
{
image_device_init(machine);
config_register(machine, "image_directories", image_dirs_load, image_dirs_save);
@@ -364,11 +364,11 @@ static char *strip_extension(const char *filename)
string with the image info text
-------------------------------------------------*/
-astring *image_info_astring(running_machine *machine, astring *string)
+astring *image_info_astring(running_machine &machine, astring *string)
{
device_image_interface *image = NULL;
- astring_printf(string, "%s\n\n", machine->system().description);
+ astring_printf(string, "%s\n\n", machine.system().description);
#if 0
if (mess_ram_size > 0)
@@ -378,7 +378,7 @@ astring *image_info_astring(running_machine *machine, astring *string)
}
#endif
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
const char *name = image->filename();
if (name != NULL)
@@ -471,12 +471,12 @@ void image_battery_save_by_name(emu_options &options, const char *filename, cons
image_from_absolute_index - retreives index number
of image in device list
-------------------------------------------------*/
-device_image_interface *image_from_absolute_index(running_machine *machine, int absolute_index)
+device_image_interface *image_from_absolute_index(running_machine &machine, int absolute_index)
{
device_image_interface *image = NULL;
int cnt = 0;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
if (cnt==absolute_index) return image;
cnt++;
@@ -492,11 +492,11 @@ device_image_interface *image_from_absolute_index(running_machine *machine, int
void image_add_device_with_subdevices(device_t *owner, device_type type, const char *tag, UINT32 clock)
{
astring tempstring;
- device_list *device_list = &owner->machine->m_devicelist;
- machine_config &config = const_cast<machine_config &>(owner->machine->config());
+ device_list *device_list = &owner->machine().m_devicelist;
+ machine_config &config = const_cast<machine_config &>(owner->machine().config());
device_config *devconfig = type(config, owner->subtag(tempstring,tag), &owner->baseconfig(), clock);
- device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(*owner->machine));
+ device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(owner->machine()));
machine_config_constructor machconfig = device.machine_config_additions();
if (machconfig != NULL)
@@ -505,7 +505,7 @@ void image_add_device_with_subdevices(device_t *owner, device_type type, const c
for (const device_config *config_dev = config.m_devicelist.first(); config_dev != NULL; config_dev = config_dev->next())
{
if (config_dev->owner()==devconfig) {
- device_list->append(config_dev->tag(), *config_dev->alloc_device(*owner->machine));
+ device_list->append(config_dev->tag(), *config_dev->alloc_device(owner->machine()));
}
}
}
diff --git a/src/emu/image.h b/src/emu/image.h
index 3f082772104..659a43dacf6 100644
--- a/src/emu/image.h
+++ b/src/emu/image.h
@@ -20,17 +20,17 @@
#include "ioprocs.h"
-void image_init(running_machine *machine);
-void image_postdevice_init(running_machine *machine);
+void image_init(running_machine &machine);
+void image_postdevice_init(running_machine &machine);
extern struct io_procs image_ioprocs;
void image_battery_load_by_name(emu_options &options, const char *filename, void *buffer, int length, int fill);
void image_battery_save_by_name(emu_options &options, const char *filename, const void *buffer, int length);
-astring *image_info_astring(running_machine *machine, astring *string);
+astring *image_info_astring(running_machine &machine, astring *string);
-device_image_interface *image_from_absolute_index(running_machine *machine, int absolute_index);
+device_image_interface *image_from_absolute_index(running_machine &machine, int absolute_index);
void image_add_device_with_subdevices(device_t *owner, device_type type, const char *tag, UINT32 clock);
diff --git a/src/emu/imagedev/bitbngr.c b/src/emu/imagedev/bitbngr.c
index 591a38d1032..cb2dadac3ea 100644
--- a/src/emu/imagedev/bitbngr.c
+++ b/src/emu/imagedev/bitbngr.c
@@ -344,10 +344,10 @@ static DEVICE_START(bitbanger)
/* output config */
bi->build_count = 0;
- bi->bitbanger_output_timer = device->machine->scheduler().timer_alloc(FUNC(bitbanger_output_timer), (void *) device);
+ bi->bitbanger_output_timer = device->machine().scheduler().timer_alloc(FUNC(bitbanger_output_timer), (void *) device);
/* input config */
- bi->bitbanger_input_timer = device->machine->scheduler().timer_alloc(FUNC(bitbanger_input_timer), (void *) device );
+ bi->bitbanger_input_timer = device->machine().scheduler().timer_alloc(FUNC(bitbanger_input_timer), (void *) device );
bi->idle_delay = attotime::from_seconds(1);
bi->input_buffer_size = 0;
bi->input_buffer_cursor = 0;
@@ -453,7 +453,7 @@ void bitbanger_output(device_t *device, int value)
bi->bitbanger_output_timer->adjust(one_point_five_baud, 0, bi->current_baud);
}
- //fprintf(stderr,"%s, %d\n", device->machine->time().as_string(9), value);
+ //fprintf(stderr,"%s, %d\n", device->machine().time().as_string(9), value);
bi->output_value = value;
}
diff --git a/src/emu/imagedev/bitbngr.h b/src/emu/imagedev/bitbngr.h
index 85124ca2536..ac27e3817c0 100644
--- a/src/emu/imagedev/bitbngr.h
+++ b/src/emu/imagedev/bitbngr.h
@@ -70,7 +70,7 @@ typedef struct _bitbanger_config bitbanger_config;
struct _bitbanger_config
{
/* callback to driver */
- void (*input_callback)(running_machine *machine, UINT8 bit);
+ void (*input_callback)(running_machine &machine, UINT8 bit);
int default_mode; /* emulating a printer or modem */
int default_baud; /* output bits per second */
int default_tune; /* fine tune adjustment to the baud */
diff --git a/src/emu/imagedev/cartslot.c b/src/emu/imagedev/cartslot.c
index 60e1a25820c..112141dbbb0 100644
--- a/src/emu/imagedev/cartslot.c
+++ b/src/emu/imagedev/cartslot.c
@@ -72,7 +72,7 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
offset = ROM_GETOFFSET(roment);
length = ROM_GETLENGTH(roment);
flags = ROM_GETFLAGS(roment);
- ptr = ((UINT8 *) image->device().machine->region(region)->base()) + offset;
+ ptr = ((UINT8 *) image->device().machine().region(region)->base()) + offset;
if (mode == PROCESS_LOAD)
{
@@ -124,7 +124,7 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
/* if the region is inverted, do that now */
device_memory_interface *memory;
- cpu = image->device().machine->device(type);
+ cpu = image->device().machine().device(type);
if (cpu!=NULL && cpu->interface(memory))
{
datawidth = cpu->memory().space_config(AS_PROGRAM)->m_databus_width / 8;
@@ -169,7 +169,7 @@ static int process_cartridge(device_image_interface *image, process_mode mode)
const rom_entry *romrgn, *roment;
int result = 0;
- for (source = rom_first_source(image->device().machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(image->device().machine().config()); source != NULL; source = rom_next_source(*source))
{
for (romrgn = rom_first_region(*source); romrgn != NULL; romrgn = rom_next_region(romrgn))
{
@@ -303,7 +303,7 @@ static DEVICE_IMAGE_LOAD( cartslot )
return (*config->device_load)(image);
/* try opening this as if it were a multicart */
- multicart_open(device->machine->options(), image.filename(), device->machine->system().name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
+ multicart_open(device->machine().options(), image.filename(), device->machine().system().name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
if (cart->mc == NULL)
{
@@ -337,7 +337,7 @@ static DEVICE_IMAGE_UNLOAD( cartslot )
if (cart->mc != NULL)
{
- multicart_close(device->machine->options(), cart->mc);
+ multicart_close(device->machine().options(), cart->mc);
cart->mc = NULL;
}
@@ -360,12 +360,12 @@ static const cartslot_pcb_type *identify_pcb(device_image_interface &image)
if (image.software_entry() == NULL && image.exists())
{
/* try opening this as if it were a multicart */
- multicart_open_error me = multicart_open(image.device().machine->options(), image.filename(), image.device().machine->system().name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
+ multicart_open_error me = multicart_open(image.device().machine().options(), image.filename(), image.device().machine().system().name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
if (me == MCERR_NONE)
{
/* this was a multicart - read from it */
astring_cpyc(&pcb_name, mc->pcb_type);
- multicart_close(image.device().machine->options(), mc);
+ multicart_close(image.device().machine().options(), mc);
}
else
{
diff --git a/src/emu/imagedev/cassette.c b/src/emu/imagedev/cassette.c
index c62e9544d54..555196c890b 100644
--- a/src/emu/imagedev/cassette.c
+++ b/src/emu/imagedev/cassette.c
@@ -71,7 +71,7 @@ INLINE int cassette_is_motor_on(device_t *device)
static void cassette_update(device_t *device)
{
dev_cassette_t *cassette = get_safe_token( device );
- double cur_time = device->machine->time().as_double();
+ double cur_time = device->machine().time().as_double();
if (cassette_is_motor_on(device))
{
@@ -187,7 +187,7 @@ double cassette_get_position(device_t *device)
position = cassette->position;
if (cassette_is_motor_on(device))
- position += device->machine->time().as_double() - cassette->position_time;
+ position += device->machine().time().as_double() - cassette->position_time;
return position;
}
@@ -273,7 +273,7 @@ static DEVICE_IMAGE_LOAD( cassette )
{
/* creating an image */
create_opts = cassette->config->create_opts;
- err = cassette_create(device->machine, (void *) &image, &image_ioprocs, &wavfile_format, create_opts, CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT, &cassette->cassette);
+ err = cassette_create(device->machine(), (void *) &image, &image_ioprocs, &wavfile_format, create_opts, CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT, &cassette->cassette);
if (err)
goto error;
}
@@ -285,7 +285,7 @@ static DEVICE_IMAGE_LOAD( cassette )
is_writable = image.is_writable();
cassette_flags = is_writable ? (CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT) : CASSETTE_FLAG_READONLY;
extension = image.filetype();
- err = cassette_open_choices(device->machine,(void *) &image, &image_ioprocs, extension, formats, cassette_flags, &cassette->cassette);
+ err = cassette_open_choices(device->machine(),(void *) &image, &image_ioprocs, extension, formats, cassette_flags, &cassette->cassette);
/* this is kind of a hack */
if (err && is_writable)
@@ -302,7 +302,7 @@ static DEVICE_IMAGE_LOAD( cassette )
/* reset the position */
cassette->position = 0.0;
- cassette->position_time = device->machine->time().as_double();
+ cassette->position_time = device->machine().time().as_double();
return IMAGE_INIT_PASS;
@@ -360,7 +360,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
x = 0.2f;
y = 0.5f;
- dev = device->machine->m_devicelist.first(CASSETTE );
+ dev = device->machine().m_devicelist.first(CASSETTE );
while ( dev && strcmp( dev->tag(), device->tag() ) )
{
@@ -368,7 +368,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
dev = dev->typenext();
}
- y *= ui_get_line_height(*device->machine) + 2.0f * UI_BOX_TB_BORDER;
+ y *= ui_get_line_height(device->machine()) + 2.0f * UI_BOX_TB_BORDER;
/* choose which frame of the animation we are at */
n = ((int) position / ANIMATION_FPS) % ANIMATION_FRAMES;
/* Since you can have anything in a BDF file, we will use crude ascii characters instead */
@@ -393,7 +393,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
(int) length);
/* draw the cassette */
- ui_draw_text_box(&device->machine->render().ui_container(), buf, JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
+ ui_draw_text_box(&device->machine().render().ui_container(), buf, JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
}
/*-------------------------------------------------
diff --git a/src/emu/imagedev/cassimg.c b/src/emu/imagedev/cassimg.c
index f2e3c9b2eb7..b69196af57e 100644
--- a/src/emu/imagedev/cassimg.c
+++ b/src/emu/imagedev/cassimg.c
@@ -81,7 +81,7 @@ static INT16 interpolate16(INT32 value)
initialization and termination
*********************************************************************/
-static cassette_image *cassette_init(running_machine *machine,const struct CassetteFormat *format, void *file, const struct io_procs *procs, int flags)
+static cassette_image *cassette_init(running_machine &machine,const struct CassetteFormat *format, void *file, const struct io_procs *procs, int flags)
{
cassette_image *cassette;
@@ -95,7 +95,7 @@ static cassette_image *cassette_init(running_machine *machine,const struct Casse
cassette->io.procs = procs;
cassette->flags = flags;
cassette->pool = pool_alloc_lib(NULL);
- cassette->machine = machine;
+ cassette->m_machine = &machine;
return cassette;
}
@@ -125,7 +125,7 @@ static int good_format(const struct CassetteFormat *format, const char *extensio
-casserr_t cassette_open_choices(running_machine *machine,void *file, const struct io_procs *procs, const char *extension,
+casserr_t cassette_open_choices(running_machine &machine,void *file, const struct io_procs *procs, const char *extension,
const struct CassetteFormat *const *formats, int flags, cassette_image **outcassette)
{
casserr_t err;
@@ -190,7 +190,7 @@ done:
-casserr_t cassette_open(running_machine *machine, void *file, const struct io_procs *procs,
+casserr_t cassette_open(running_machine &machine, void *file, const struct io_procs *procs,
const struct CassetteFormat *format, int flags, cassette_image **outcassette)
{
const struct CassetteFormat *formats[2];
@@ -201,7 +201,7 @@ casserr_t cassette_open(running_machine *machine, void *file, const struct io_pr
-casserr_t cassette_create(running_machine *machine, void *file, const struct io_procs *procs, const struct CassetteFormat *format,
+casserr_t cassette_create(running_machine &machine, void *file, const struct io_procs *procs, const struct CassetteFormat *format,
const struct CassetteOptions *opts, int flags, cassette_image **outcassette)
{
casserr_t err;
diff --git a/src/emu/imagedev/cassimg.h b/src/emu/imagedev/cassimg.h
index 5128e5628d2..48b6a32f3c3 100644
--- a/src/emu/imagedev/cassimg.h
+++ b/src/emu/imagedev/cassimg.h
@@ -87,6 +87,8 @@ struct CassetteInfo
struct _cassette_image
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
const struct CassetteFormat *format;
struct io_generic io;
object_pool *pool;
@@ -99,7 +101,7 @@ struct _cassette_image
size_t block_count;
size_t sample_count;
- running_machine *machine;
+ running_machine *m_machine;
};
typedef struct _cassette_image cassette_image;
@@ -163,11 +165,11 @@ CASSETTE_FORMATLIST_EXTERN(cassette_default_formats);
***************************************************************************/
-casserr_t cassette_open(running_machine *machine,void *file, const struct io_procs *procs,
+casserr_t cassette_open(running_machine &machine,void *file, const struct io_procs *procs,
const struct CassetteFormat *format, int flags, cassette_image **outcassette);
-casserr_t cassette_open_choices(running_machine *machine,void *file, const struct io_procs *procs, const char *extension,
+casserr_t cassette_open_choices(running_machine &machine,void *file, const struct io_procs *procs, const char *extension,
const struct CassetteFormat *const *formats, int flags, cassette_image **outcassette);
-casserr_t cassette_create(running_machine *machine,void *file, const struct io_procs *procs, const struct CassetteFormat *format,
+casserr_t cassette_create(running_machine &machine,void *file, const struct io_procs *procs, const struct CassetteFormat *format,
const struct CassetteOptions *opts, int flags, cassette_image **outcassette);
casserr_t cassette_save(cassette_image *cassette);
void cassette_close(cassette_image *cassette);
diff --git a/src/emu/imagedev/chd_cd.c b/src/emu/imagedev/chd_cd.c
index 008fa87fb2b..df427a0507a 100644
--- a/src/emu/imagedev/chd_cd.c
+++ b/src/emu/imagedev/chd_cd.c
@@ -87,7 +87,7 @@ static DEVICE_IMAGE_LOAD(cdrom)
if ( err )
goto error;
} else {
- chd = get_disk_handle(image.device().machine, image.device().subtag(tempstring,"cdrom"));
+ chd = get_disk_handle(image.device().machine(), image.device().subtag(tempstring,"cdrom"));
}
/* open the CHD file */
diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c
index b31ae72358d..70b019cd9ce 100644
--- a/src/emu/imagedev/flopdrv.c
+++ b/src/emu/imagedev/flopdrv.c
@@ -214,7 +214,7 @@ static void floppy_drive_init(device_t *img)
pDrive->flags = 0;
pDrive->index_pulse_callback = NULL;
pDrive->ready_state_change_callback = NULL;
- pDrive->index_timer = img->machine->scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
+ pDrive->index_timer = img->machine().scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
pDrive->idx = 0;
floppy_drive_set_geometry(img, ((floppy_config*)img->baseconfig().static_config())->floppy_type);
@@ -674,7 +674,7 @@ DEVICE_IMAGE_LOAD( floppy )
else
next_wpt = CLEAR_LINE;
- image.device().machine->scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), next_wpt, flopimg);
+ image.device().machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), next_wpt, flopimg);
return retVal;
}
@@ -702,16 +702,16 @@ DEVICE_IMAGE_UNLOAD( floppy )
devcb_call_write_line(&flopimg->out_wpt_func, flopimg->wpt);
/* set timer for disk eject */
- image.device().machine->scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), ASSERT_LINE, flopimg);
+ image.device().machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), ASSERT_LINE, flopimg);
}
-device_t *floppy_get_device(running_machine *machine,int drive)
+device_t *floppy_get_device(running_machine &machine,int drive)
{
switch(drive) {
- case 0 : return machine->device(FLOPPY_0);
- case 1 : return machine->device(FLOPPY_1);
- case 2 : return machine->device(FLOPPY_2);
- case 3 : return machine->device(FLOPPY_3);
+ case 0 : return machine.device(FLOPPY_0);
+ case 1 : return machine.device(FLOPPY_1);
+ case 2 : return machine.device(FLOPPY_2);
+ case 3 : return machine.device(FLOPPY_3);
}
return NULL;
}
@@ -728,7 +728,7 @@ void floppy_set_type(device_t *image,int ftype)
flopimg->floppy_drive_type = ftype;
}
-device_t *floppy_get_device_by_type(running_machine *machine,int ftype,int drive)
+device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive)
{
int i;
int cnt = 0;
@@ -758,7 +758,7 @@ int floppy_get_drive_by_type(device_t *image,int ftype)
{
int i,drive =0;
for (i=0;i<4;i++) {
- device_t *disk = floppy_get_device(image->machine,i);
+ device_t *disk = floppy_get_device(image->machine(),i);
if (floppy_get_drive_type(disk)==ftype) {
if (image==disk) {
return drive;
@@ -769,13 +769,13 @@ int floppy_get_drive_by_type(device_t *image,int ftype)
return drive;
}
-int floppy_get_count(running_machine *machine)
+int floppy_get_count(running_machine &machine)
{
int cnt = 0;
- if (machine->device(FLOPPY_0)) cnt++;
- if (machine->device(FLOPPY_1)) cnt++;
- if (machine->device(FLOPPY_2)) cnt++;
- if (machine->device(FLOPPY_3)) cnt++;
+ if (machine.device(FLOPPY_0)) cnt++;
+ if (machine.device(FLOPPY_1)) cnt++;
+ if (machine.device(FLOPPY_2)) cnt++;
+ if (machine.device(FLOPPY_3)) cnt++;
return cnt;
}
diff --git a/src/emu/imagedev/flopdrv.h b/src/emu/imagedev/flopdrv.h
index 971b5ee1ac1..d9c8f2203e6 100644
--- a/src/emu/imagedev/flopdrv.h
+++ b/src/emu/imagedev/flopdrv.h
@@ -137,11 +137,11 @@ void floppy_install_unload_proc(device_t *image, void (*proc)(device_image_inter
void floppy_install_load_proc(device_t *image, void (*proc)(device_image_interface &image));
-device_t *floppy_get_device(running_machine *machine,int drive);
-device_t *floppy_get_device_by_type(running_machine *machine,int ftype,int drive);
+device_t *floppy_get_device(running_machine &machine,int drive);
+device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive);
int floppy_get_drive_type(device_t *image);
void floppy_set_type(device_t *image,int ftype);
-int floppy_get_count(running_machine *machine);
+int floppy_get_count(running_machine &machine);
int floppy_get_drive(device_t *image);
int floppy_get_drive_by_type(device_t *image,int ftype);
diff --git a/src/emu/imagedev/snapquik.c b/src/emu/imagedev/snapquik.c
index af56b4776ec..ba9ccaeaad3 100644
--- a/src/emu/imagedev/snapquik.c
+++ b/src/emu/imagedev/snapquik.c
@@ -132,7 +132,7 @@ static DEVICE_START( snapquick )
snapquick_token *token = get_token(device);
/* allocate a timer */
- token->timer = device->machine->scheduler().timer_alloc(FUNC(process_snapshot_or_quickload), (void *) dynamic_cast<device_image_interface *>(device));
+ token->timer = device->machine().scheduler().timer_alloc(FUNC(process_snapshot_or_quickload), (void *) dynamic_cast<device_image_interface *>(device));
}
@@ -298,7 +298,7 @@ static int z80bin_load_file(device_image_interface *image, const char *file_type
image->message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
return IMAGE_INIT_FAIL;
}
- image->device().machine->device("maincpu")->memory().space(AS_PROGRAM)->write_byte(j, data);
+ image->device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(j, data);
}
return IMAGE_INIT_PASS;
@@ -326,17 +326,17 @@ static QUICKLOAD_LOAD( z80bin )
config = (const z80bin_config *)downcast<const legacy_device_config_base &>(image.device().baseconfig()).inline_config();
/* check to see if autorun is on (I hate how this works) */
- autorun = input_port_read_safe(image.device().machine, "CONFIG", 0xFF) & 1;
+ autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
/* start program */
if (config->execute != NULL)
{
- (*config->execute)(image.device().machine, start_addr, end_addr, exec_addr, autorun);
+ (*config->execute)(image.device().machine(), start_addr, end_addr, exec_addr, autorun);
}
else
{
if (autorun)
- cpu_set_reg(image.device().machine->device("maincpu"), STATE_GENPC, exec_addr);
+ cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, exec_addr);
}
}
diff --git a/src/emu/imagedev/snapquik.h b/src/emu/imagedev/snapquik.h
index 37ccfa12a2c..126c47c8807 100644
--- a/src/emu/imagedev/snapquik.h
+++ b/src/emu/imagedev/snapquik.h
@@ -39,7 +39,7 @@ DECLARE_LEGACY_IMAGE_DEVICE(Z80BIN, z80bin);
#define QUICKLOAD_LOAD(name) int QUICKLOAD_LOAD_NAME(name)(device_image_interface &image, const char *file_type, int quickload_size)
#define Z80BIN_EXECUTE_NAME(name) z80bin_execute_##name
-#define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun)
+#define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(running_machine &machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun)
#define LOAD_REG(_cpu, _reg, _data) \
do { \
@@ -64,7 +64,7 @@ struct _snapquick_config
attoseconds_t delay_attoseconds; /* loading delay (attoseconds) */
};
-typedef void (*z80bin_execute_func)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun);
+typedef void (*z80bin_execute_func)(running_machine &machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun);
typedef struct _z80bin_config z80bin_config;
struct _z80bin_config
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 59d834634e2..22194da114e 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -297,9 +297,9 @@ struct _input_port_private
inputx_code *codes;
key_buffer *keybuffer;
emu_timer *inputx_timer;
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len);
- int (*accept_char)(running_machine *machine, unicode_char ch);
- int (*charqueue_empty)(running_machine *machine);
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len);
+ int (*accept_char)(running_machine &machine, unicode_char ch);
+ int (*charqueue_empty)(running_machine &machine);
attotime current_rate;
};
@@ -623,8 +623,8 @@ static TIMER_CALLBACK(inputx_timerproc);
/* Debugging commands and handlers. */
-static void execute_input(running_machine *machine, int ref, int params, const char *param[]);
-static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[]);
+static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
+static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
/***************************************************************************
COMMON SHARED STRINGS
@@ -774,17 +774,17 @@ static void input_port_exit(running_machine &machine);
static INT32 apply_analog_settings(INT32 current, analog_field_state *analog);
/* initialization helpers */
-static void init_port_types(running_machine *machine);
-static void init_port_state(running_machine *machine);
+static void init_port_types(running_machine &machine);
+static void init_port_state(running_machine &machine);
static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame);
static device_field_info *init_field_device_info(const input_field_config *field,const char *device_name);
static analog_field_state *init_field_analog_state(const input_field_config *field);
/* once-per-frame updates */
static void frame_update_callback(running_machine &machine);
-static void frame_update(running_machine *machine);
-static void frame_update_digital_joysticks(running_machine *machine);
-static void frame_update_analog_field(running_machine *machine, analog_field_state *analog);
+static void frame_update(running_machine &machine);
+static void frame_update_digital_joysticks(running_machine &machine);
+static void frame_update_analog_field(running_machine &machine, analog_field_state *analog);
static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
/* port configuration helpers */
@@ -798,33 +798,33 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
static void diplocation_free(input_field_diplocation **diplocptr);
/* tokenization helpers */
-static int token_to_input_field_type(running_machine *machine, const char *string, int *player);
-static const char *input_field_type_to_token(running_machine *machine, int type, int player);
+static int token_to_input_field_type(running_machine &machine, const char *string, int *player);
+static const char *input_field_type_to_token(running_machine &machine, int type, int player);
static int token_to_seq_type(const char *string);
/* settings load */
-static void load_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void load_remap_table(running_machine *machine, xml_data_node *parentnode);
-static int load_default_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
-static int load_game_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
+static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void load_remap_table(running_machine &machine, xml_data_node *parentnode);
+static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
+static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
/* settings save */
-static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq);
+static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq);
static int save_this_input_field_type(int type);
-static void save_default_inputs(running_machine *machine, xml_data_node *parentnode);
-static void save_game_inputs(running_machine *machine, xml_data_node *parentnode);
+static void save_default_inputs(running_machine &machine, xml_data_node *parentnode);
+static void save_game_inputs(running_machine &machine, xml_data_node *parentnode);
/* input playback */
-static time_t playback_init(running_machine *machine);
-static void playback_end(running_machine *machine, const char *message);
-static void playback_frame(running_machine *machine, attotime curtime);
+static time_t playback_init(running_machine &machine);
+static void playback_end(running_machine &machine, const char *message);
+static void playback_frame(running_machine &machine, attotime curtime);
static void playback_port(const input_port_config *port);
/* input recording */
-static void record_init(running_machine *machine);
-static void record_end(running_machine *machine, const char *message);
-static void record_frame(running_machine *machine, attotime curtime);
+static void record_init(running_machine &machine);
+static void record_end(running_machine &machine, const char *message);
+static void record_frame(running_machine &machine, attotime curtime);
static void record_port(const input_port_config *port);
@@ -890,7 +890,7 @@ INLINE const char *get_port_tag(const input_port_config *port, char *tempbuffer)
if (port->tag != NULL)
return port->tag;
- for (curport = port->machine->m_portlist.first(); curport != NULL; curport = curport->next())
+ for (curport = port->machine().m_portlist.first(); curport != NULL; curport = curport->next())
{
if (curport == port)
break;
@@ -973,19 +973,19 @@ static WRITE_LINE_DEVICE_HANDLER( changed_write_line_device )
system
-------------------------------------------------*/
-time_t input_port_init(running_machine *machine, const input_port_token *tokens, const device_config_list &devicelist)
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist)
{
//input_port_private *portdata;
char errorbuf[1024];
time_t basetime;
/* allocate memory for our data structure */
- machine->input_port_data = auto_alloc_clear(machine, input_port_private);
- //portdata = machine->input_port_data;
+ machine.input_port_data = auto_alloc_clear(machine, input_port_private);
+ //portdata = machine.input_port_data;
/* add an exit callback and a frame callback */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, input_port_exit);
- machine->add_notifier(MACHINE_NOTIFY_FRAME, frame_update_callback);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, input_port_exit);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, frame_update_callback);
/* initialize the default port info from the OSD */
init_port_types(machine);
@@ -993,7 +993,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
/* if we have a token list, proceed */
if (tokens != NULL)
{
- input_port_list_init(machine->m_portlist, tokens, errorbuf, sizeof(errorbuf), TRUE, NULL);
+ input_port_list_init(machine.m_portlist, tokens, errorbuf, sizeof(errorbuf), TRUE, NULL);
if (errorbuf[0] != 0)
mame_printf_error("Input port errors:\n%s", errorbuf);
}
@@ -1001,7 +1001,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
for (device_config *config = devicelist.first(); config != NULL; config = config->next())
{
if (config->input_ports()!=NULL) {
- input_port_list_init(machine->m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config);
+ input_port_list_init(machine.m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config);
if (errorbuf[0] != 0)
mame_printf_error("Input port errors:\n%s", errorbuf);
}
@@ -1027,8 +1027,8 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
static void input_port_exit(running_machine &machine)
{
/* close any playback or recording files */
- playback_end(&machine, NULL);
- record_end(&machine, NULL);
+ playback_end(machine, NULL);
+ record_end(machine, NULL);
}
@@ -1097,7 +1097,7 @@ const char *input_field_name(const input_field_config *field)
return field->name;
/* otherwise, return the name associated with the type */
- return input_type_name(field->port->machine, field->type, field->player);
+ return input_type_name(field->port->machine(), field->type, field->player);
}
@@ -1120,7 +1120,7 @@ const input_seq *input_field_seq(const input_field_config *field, input_seq_type
/* if the portseq is the special default code, return the expanded default value */
if (input_seq_get_1(portseq) == SEQCODE_DEFAULT)
- return input_type_seq(field->port->machine, field->type, field->player, seqtype);
+ return input_type_seq(field->port->machine(), field->type, field->player, seqtype);
/* otherwise, return the sequence as-is */
return portseq;
@@ -1171,7 +1171,7 @@ void input_field_set_user_settings(const input_field_config *field, const input_
/* copy the basics */
for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
{
- const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, (input_seq_type)seqtype);
+ const input_seq *defseq = input_type_seq(field->port->machine(), field->type, field->player, (input_seq_type)seqtype);
if (input_seq_cmp(defseq, &settings->seq[seqtype]) == 0)
field->state->seq[seqtype] = default_seq;
else
@@ -1207,7 +1207,7 @@ const char *input_field_setting_name(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
if (setting->value == field->state->value)
return setting->name;
@@ -1229,7 +1229,7 @@ int input_field_has_previous_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
return (setting->value != field->state->value);
return FALSE;
@@ -1253,7 +1253,7 @@ void input_field_select_previous_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
prevsetting = NULL;
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
{
if (setting->value == field->state->value)
{
@@ -1268,7 +1268,7 @@ void input_field_select_previous_setting(const input_field_config *field)
if (!found_match)
{
for (prevsetting = field->settinglist; prevsetting != NULL; prevsetting = prevsetting->next)
- if (input_condition_true(field->port->machine, &prevsetting->condition))
+ if (input_condition_true(field->port->machine(), &prevsetting->condition))
break;
}
@@ -1293,7 +1293,7 @@ int input_field_has_next_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
{
if (found)
return TRUE;
@@ -1321,20 +1321,20 @@ void input_field_select_next_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
nextsetting = NULL;
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
if (setting->value == field->state->value)
break;
/* if we found one, scan forward for the next valid one */
if (setting != NULL)
for (nextsetting = setting->next; nextsetting != NULL; nextsetting = nextsetting->next)
- if (input_condition_true(field->port->machine, &nextsetting->condition))
+ if (input_condition_true(field->port->machine(), &nextsetting->condition))
break;
/* if we hit the end, search from the beginning */
if (nextsetting == NULL)
for (nextsetting = field->settinglist; nextsetting != NULL; nextsetting = nextsetting->next)
- if (input_condition_true(field->port->machine, &nextsetting->condition))
+ if (input_condition_true(field->port->machine(), &nextsetting->condition))
break;
/* update the value to the previous one */
@@ -1364,12 +1364,12 @@ int input_type_is_analog(int type)
for the given type/player
-------------------------------------------------*/
-const char *input_type_name(running_machine *machine, int type, int player)
+const char *input_type_name(running_machine &machine, int type, int player)
{
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return typestate->typedesc.name;
@@ -1394,12 +1394,12 @@ const char *input_type_name(running_machine *machine, int type, int player)
for the given type/player
-------------------------------------------------*/
-int input_type_group(running_machine *machine, int type, int player)
+int input_type_group(running_machine &machine, int type, int player)
{
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return typestate->typedesc.group;
@@ -1424,7 +1424,7 @@ int input_type_group(running_machine *machine, int type, int player)
sequence for the given type/player
-------------------------------------------------*/
-const input_seq *input_type_seq(running_machine *machine, int type, int player, input_seq_type seqtype)
+const input_seq *input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype)
{
static const input_seq ip_none = SEQ_DEF_0;
@@ -1432,9 +1432,9 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
assert((player >= 0) && (player < MAX_PLAYERS));
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return &typestate->seq[seqtype];
@@ -1459,9 +1459,9 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
sequence for the given type/player
-------------------------------------------------*/
-void input_type_set_seq(running_machine *machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
+void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
typestate->seq[seqtype] = *newseq;
@@ -1474,7 +1474,7 @@ void input_type_set_seq(running_machine *machine, int type, int player, input_se
is pressed
-------------------------------------------------*/
-int input_type_pressed(running_machine *machine, int type, int player)
+int input_type_pressed(running_machine &machine, int type, int player)
{
return input_seq_pressed(machine, input_type_seq(machine, type, player, SEQ_TYPE_STANDARD));
}
@@ -1484,9 +1484,9 @@ int input_type_pressed(running_machine *machine, int type, int player)
input_type_list - return the list of types
-------------------------------------------------*/
-const input_type_desc *input_type_list(running_machine *machine)
+const input_type_desc *input_type_list(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
return &portdata->typestatelist->typedesc;
}
@@ -1502,9 +1502,9 @@ const input_type_desc *input_type_list(running_machine *machine)
port exists
-------------------------------------------------*/
-bool input_port_exists(running_machine *machine, const char *tag)
+bool input_port_exists(running_machine &machine, const char *tag)
{
- return machine->port(tag) != 0;
+ return machine.port(tag) != 0;
}
@@ -1514,9 +1514,9 @@ bool input_port_exists(running_machine *machine, const char *tag)
unused or unknown)
-------------------------------------------------*/
-input_port_value input_port_active(running_machine *machine, const char *tag)
+input_port_value input_port_active(running_machine &machine, const char *tag)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return port->active;
@@ -1530,9 +1530,9 @@ input_port_value input_port_active(running_machine *machine, const char *tag)
the port does not exist
-------------------------------------------------*/
-input_port_value input_port_active_safe(running_machine *machine, const char *tag, input_port_value defvalue)
+input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
return port == NULL ? defvalue : port->active;
}
@@ -1549,7 +1549,7 @@ input_port_value input_port_active_safe(running_machine *machine, const char *ta
input_port_value input_port_read_direct(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
analog_field_state *analog;
device_field_info *device_field;
input_port_value result;
@@ -1561,7 +1561,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* update custom values */
for (device_field = port->state->readdevicelist; device_field != NULL; device_field = device_field->next)
- if (input_condition_true(port->machine, &device_field->field->condition))
+ if (input_condition_true(port->machine(), &device_field->field->condition))
{
/* replace the bits with bits from the device */
input_port_value newval = (*device_field->field->read_line_device)(device_field->device);
@@ -1572,7 +1572,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* update VBLANK bits */
if (port->state->vblank != 0)
{
- if (port->machine->primary_screen->vblank())
+ if (port->machine().primary_screen->vblank())
result |= port->state->vblank;
else
result &= ~port->state->vblank;
@@ -1583,7 +1583,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* merge in analog portions */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
- if (input_condition_true(port->machine, &analog->field->condition))
+ if (input_condition_true(port->machine(), &analog->field->condition))
{
/* start with the raw value */
INT32 value = analog->accum;
@@ -1591,7 +1591,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* interpolate if appropriate and if time has passed since the last update */
if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata->last_delta_nsec != 0)
{
- attoseconds_t nsec_since_last = (port->machine->time() - portdata->last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ attoseconds_t nsec_since_last = (port->machine().time() - portdata->last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
value = analog->previous + ((INT64)(analog->accum - analog->previous) * nsec_since_last / portdata->last_delta_nsec);
}
@@ -1619,9 +1619,9 @@ input_port_value input_port_read_direct(const input_port_config *port)
an input port specified by tag
-------------------------------------------------*/
-input_port_value input_port_read(running_machine *machine, const char *tag)
+input_port_value input_port_read(running_machine &machine, const char *tag)
{
- const input_port_config *port = machine->port(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);
@@ -1636,7 +1636,7 @@ input_port_value input_port_read(running_machine *machine, const char *tag)
input_port_value input_port_read(device_t *device, const char *tag)
{
astring tempstring;
- const input_port_config *port = device->machine->port(device->baseconfig().subtag(tempstring, tag));
+ const input_port_config *port = device->machine().port(device->baseconfig().subtag(tempstring, tag));
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return input_port_read_direct(port);
@@ -1649,9 +1649,9 @@ input_port_value input_port_read(device_t *device, const char *tag)
value if the port does not exist
-------------------------------------------------*/
-input_port_value input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
+input_port_value input_port_read_safe(running_machine &machine, const char *tag, UINT32 defvalue)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
return (port == NULL) ? defvalue : input_port_read_direct(port);
}
@@ -1662,14 +1662,14 @@ input_port_value input_port_read_safe(running_machine *machine, const char *tag,
player
-------------------------------------------------*/
-int input_port_get_crosshair_position(running_machine *machine, int player, float *x, float *y)
+int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y)
{
const input_port_config *port;
const input_field_config *field;
int gotx = FALSE, goty = FALSE;
/* read all the lightgun values */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->player == player && field->crossaxis != CROSSHAIR_AXIS_NONE)
if (input_condition_true(machine, &field->condition))
@@ -1728,7 +1728,7 @@ int input_port_get_crosshair_position(running_machine *machine, int player, floa
conditions
-------------------------------------------------*/
-void input_port_update_defaults(running_machine *machine)
+void input_port_update_defaults(running_machine &machine)
{
int loopnum;
@@ -1738,7 +1738,7 @@ void input_port_update_defaults(running_machine *machine)
const input_port_config *port;
/* loop over all input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
const input_field_config *field;
@@ -1803,7 +1803,7 @@ void input_port_write_direct(const input_port_config *port, input_port_value dat
COMBINE_DATA(&port->state->outputvalue);
for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine, &device_field->field->condition))
+ if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition))
{
input_port_value newval = ( (port->state->outputvalue ^ device_field->field->defvalue ) & device_field->field->mask) >> device_field->shift;
@@ -1823,9 +1823,9 @@ void input_port_write_direct(const input_port_config *port, input_port_value dat
port specified by tag
-------------------------------------------------*/
-void input_port_write(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
+void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = machine->port(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);
@@ -1837,9 +1837,9 @@ void input_port_write(running_machine *machine, const char *tag, input_port_valu
a port, ignore if the port does not exist
-------------------------------------------------*/
-void input_port_write_safe(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
+void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port != NULL)
input_port_write_direct(port, value, mask);
}
@@ -1855,7 +1855,7 @@ void input_port_write_safe(running_machine *machine, const char *tag, input_port
if the given condition attached is true
-------------------------------------------------*/
-int input_condition_true(running_machine *machine, const input_condition *condition)
+int input_condition_true(running_machine &machine, const input_condition *condition)
{
input_port_value condvalue;
@@ -1926,9 +1926,9 @@ const char *input_port_string_from_token(const input_port_token token)
type list
-------------------------------------------------*/
-static void init_port_types(running_machine *machine)
+static void init_port_types(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state **stateptr;
input_type_state *curtype;
input_type_desc *lasttype = NULL;
@@ -1953,7 +1953,7 @@ static void init_port_types(running_machine *machine)
}
/* ask the OSD to customize the list */
- machine->osd().customize_input_type_list(&portdata->typestatelist->typedesc);
+ machine.osd().customize_input_type_list(&portdata->typestatelist->typedesc);
/* now iterate over the OSD-modified types */
for (curtype = portdata->typestatelist; curtype != NULL; curtype = curtype->next)
@@ -2080,15 +2080,15 @@ static astring *get_keyboard_key_name(const input_field_config *field)
states based on the tokens
-------------------------------------------------*/
-static void init_port_state(running_machine *machine)
+static void init_port_state(running_machine &machine)
{
- const char *joystick_map_default = machine->options().joystick_map();
- input_port_private *portdata = machine->input_port_data;
+ const char *joystick_map_default = machine.options().joystick_map();
+ input_port_private *portdata = machine.input_port_data;
const input_field_config *field;
const input_port_config *port;
/* allocate live structures to mirror the configuration */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
analog_field_state **analogstatetail;
device_field_info **readdevicetail;
@@ -2098,7 +2098,7 @@ static void init_port_state(running_machine *machine)
/* allocate a new input_port_info structure */
portstate = auto_alloc_clear(machine, input_port_state);
((input_port_config *)port)->state = portstate;
- ((input_port_config *)port)->machine = machine;
+ ((input_port_config *)port)->m_machine = &machine;
/* start with tail pointers to all the data */
analogstatetail = &portstate->analoglist;
@@ -2164,18 +2164,18 @@ static void init_port_state(running_machine *machine)
}
/* handle autoselection of devices */
- init_autoselect_devices(*machine, IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
- init_autoselect_devices(*machine, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
- init_autoselect_devices(*machine, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
- init_autoselect_devices(*machine, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
- init_autoselect_devices(*machine, IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
- init_autoselect_devices(*machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
- init_autoselect_devices(*machine, IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
- init_autoselect_devices(*machine, IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
+ init_autoselect_devices(machine, IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
+ init_autoselect_devices(machine, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
+ init_autoselect_devices(machine, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
+ init_autoselect_devices(machine, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
+ init_autoselect_devices(machine, IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
+ init_autoselect_devices(machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
+ init_autoselect_devices(machine, IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
+ init_autoselect_devices(machine, IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
/* look for 4-way joysticks and change the default map if we find any */
if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->state->joystick != NULL && field->way == 4)
{
@@ -2229,7 +2229,7 @@ static void init_autoselect_devices(running_machine &machine, int type1, int typ
mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
/* only scan the list if we haven't already enabled this class of control */
- if (portlist.first() != NULL && !input_device_class_enabled(portlist.first()->machine, autoenable))
+ if (portlist.first() != NULL && !input_device_class_enabled(portlist.first()->machine(), autoenable))
for (port = portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
@@ -2239,7 +2239,7 @@ static void init_autoselect_devices(running_machine &machine, int type1, int typ
(type3 != 0 && field->type == type3))
{
mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
- input_device_class_enable(port->machine, autoenable, TRUE);
+ input_device_class_enable(port->machine(), autoenable, TRUE);
break;
}
}
@@ -2256,7 +2256,7 @@ static device_field_info *init_field_device_info(const input_field_config *field
input_port_value mask;
/* allocate memory */
- info = auto_alloc_clear(field->port->machine, device_field_info);
+ info = auto_alloc_clear(field->port->machine(), device_field_info);
/* fill in the data */
info->field = field;
@@ -2264,7 +2264,7 @@ static device_field_info *init_field_device_info(const input_field_config *field
info->shift++;
if (device_name != NULL)
- info->device = field->port->machine->device(device_name);
+ info->device = field->port->machine().device(device_name);
else
info->device = (device_t *) info;
@@ -2284,7 +2284,7 @@ static analog_field_state *init_field_analog_state(const input_field_config *fie
input_port_value mask;
/* allocate memory */
- state = auto_alloc_clear(field->port->machine, analog_field_state);
+ state = auto_alloc_clear(field->port->machine(), analog_field_state);
/* compute the shift amount and number of bits */
for (mask = field->mask; !(mask & 1); mask >>= 1)
@@ -2459,12 +2459,12 @@ static void frame_update_callback(running_machine &machine)
return;
/* otherwise, use the common code */
- frame_update(&machine);
+ frame_update(machine);
}
-static key_buffer *get_buffer(running_machine *machine)
+static key_buffer *get_buffer(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
assert(inputx_can_post(machine));
return (key_buffer *)portdata->keybuffer;
}
@@ -2489,9 +2489,9 @@ static const inputx_code *find_code(inputx_code *codes, unicode_char ch)
called from core to allow for natural keyboard
-------------------------------------------------*/
-static void input_port_update_hook(running_machine *machine, const input_port_config *port, input_port_value *digital)
+static void input_port_update_hook(running_machine &machine, const input_port_config *port, input_port_value *digital)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const key_buffer *keybuf;
const inputx_code *code;
unicode_char ch;
@@ -2531,12 +2531,12 @@ static void input_port_update_hook(running_machine *machine, const input_port_co
port updating
-------------------------------------------------*/
-static void frame_update(running_machine *machine)
+static void frame_update(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const input_field_config *mouse_field = NULL;
int ui_visible = ui_is_menu_active();
- attotime curtime = machine->time();
+ attotime curtime = machine.time();
const input_port_config *port;
render_target *mouse_target;
INT32 mouse_target_x;
@@ -2567,11 +2567,11 @@ g_profiler.start(PROFILER_INPUT);
input_port_value mask;
float x, y;
if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
- mouse_field = input_field_by_tag_and_mask(machine->m_portlist, tag, mask);
+ mouse_field = input_field_by_tag_and_mask(machine.m_portlist, tag, mask);
}
/* loop over all input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
const input_field_config *field;
device_field_info *device_field;
@@ -2583,7 +2583,7 @@ g_profiler.start(PROFILER_INPUT);
/* now loop back and modify based on the inputs */
for (field = port->fieldlist; field != NULL; field = field->next)
- if (input_condition_true(port->machine, &field->condition))
+ if (input_condition_true(port->machine(), &field->condition))
{
/* accumulate VBLANK bits */
if (field->type == IPT_VBLANK)
@@ -2608,7 +2608,7 @@ g_profiler.start(PROFILER_INPUT);
/* call device line changed handlers */
newvalue = input_port_read_direct(port);
for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine, &device_field->field->condition))
+ if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition))
{
input_port_value newval = (newvalue & device_field->field->mask) >> device_field->shift;
@@ -2632,9 +2632,9 @@ g_profiler.stop();
accumulating the results in a port
-------------------------------------------------*/
-static void frame_update_digital_joysticks(running_machine *machine)
+static void frame_update_digital_joysticks(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int player, joyindex;
/* loop over all the joysticks */
@@ -2699,7 +2699,7 @@ static void frame_update_digital_joysticks(running_machine *machine)
if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
(joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
{
- if (machine->rand() & 1)
+ if (machine.rand() & 1)
joystick->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
else
joystick->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
@@ -2715,7 +2715,7 @@ static void frame_update_digital_joysticks(running_machine *machine)
internals of a single analog field
-------------------------------------------------*/
-static void frame_update_analog_field(running_machine *machine, analog_field_state *analog)
+static void frame_update_analog_field(running_machine &machine, analog_field_state *analog)
{
input_item_class itemclass;
int keypressed = FALSE;
@@ -2861,7 +2861,7 @@ static void frame_update_analog_field(running_machine *machine, analog_field_sta
static int frame_get_digital_field_state(const input_field_config *field, int mouse_down)
{
- int curstate = mouse_down || input_seq_pressed(field->port->machine, input_field_seq(field, SEQ_TYPE_STANDARD));
+ int curstate = mouse_down || input_seq_pressed(field->port->machine(), input_field_seq(field, SEQ_TYPE_STANDARD));
int changed = FALSE;
/* if the state changed, look for switch down/switch up */
@@ -2871,7 +2871,7 @@ static int frame_get_digital_field_state(const input_field_config *field, int mo
changed = TRUE;
}
- if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->port->machine))
+ if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->port->machine()))
return FALSE;
/* if this is a switch-down event, handle impulse and toggle */
@@ -2917,7 +2917,7 @@ static int frame_get_digital_field_state(const input_field_config *field, int mo
}
/* skip locked-out coin inputs */
- if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->port->machine, field->type - IPT_COIN1) && field->port->machine->options().coin_lockout())
+ if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->port->machine(), field->type - IPT_COIN1) && field->port->machine().options().coin_lockout())
{
ui_popup_time(3, "Coinlock disabled %s.", input_field_name(field));
return FALSE;
@@ -3645,7 +3645,7 @@ input_port_config::input_port_config(const char *_tag)
tag(_tag),
fieldlist(NULL),
state(NULL),
- machine(NULL),
+ m_machine(NULL),
owner(NULL),
active(0)
{
@@ -3941,9 +3941,9 @@ static void diplocation_free(input_field_diplocation **diplocptr)
token to an input field type and player
-------------------------------------------------*/
-static int token_to_input_field_type(running_machine *machine, const char *string, int *player)
+static int token_to_input_field_type(running_machine &machine, const char *string, int *player)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const input_type_desc *typedesc;
int ipnum;
@@ -3970,9 +3970,9 @@ static int token_to_input_field_type(running_machine *machine, const char *strin
field type and player to a string token
-------------------------------------------------*/
-static const char *input_field_type_to_token(running_machine *machine, int type, int player)
+static const char *input_field_type_to_token(running_machine &machine, int type, int player)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
static char tempbuf[32];
@@ -4015,9 +4015,9 @@ static int token_to_seq_type(const char *string)
configuration data from the XML nodes
-------------------------------------------------*/
-static void load_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
xml_data_node *portnode;
int seqtype;
@@ -4090,9 +4090,9 @@ static void load_config_callback(running_machine *machine, int config_type, xml_
global remapping table
-------------------------------------------------*/
-static void load_remap_table(running_machine *machine, xml_data_node *parentnode)
+static void load_remap_table(running_machine &machine, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_code *oldtable, *newtable;
xml_data_node *remapnode;
int count;
@@ -4157,9 +4157,9 @@ static void load_remap_table(running_machine *machine, xml_data_node *parentnode
data to the default mappings
-------------------------------------------------*/
-static int load_default_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
int seqtype;
@@ -4182,7 +4182,7 @@ static int load_default_config(running_machine *machine, xml_data_node *portnode
data to the current set of input ports
-------------------------------------------------*/
-static int load_game_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
input_port_value mask, defvalue;
const input_field_config *field;
@@ -4196,7 +4196,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
/* find the port we want; if no tag, search them all */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
if (tag == NULL || strcmp(get_port_tag(port, tempbuffer), tag) == 0)
for (field = port->fieldlist; field != NULL; field = field->next)
@@ -4246,7 +4246,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
saving input port configuration
-------------------------------------------------*/
-static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* if no parentnode, ignore */
if (parentnode == NULL)
@@ -4265,7 +4265,7 @@ static void save_config_callback(running_machine *machine, int config_type, xml_
sequence
-------------------------------------------------*/
-static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq)
+static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq)
{
astring seqstring;
xml_data_node *seqnode;
@@ -4308,9 +4308,9 @@ static int save_this_input_field_type(int type)
mappings that have changed
-------------------------------------------------*/
-static void save_default_inputs(running_machine *machine, xml_data_node *parentnode)
+static void save_default_inputs(running_machine &machine, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
/* iterate over ports */
@@ -4352,13 +4352,13 @@ static void save_default_inputs(running_machine *machine, xml_data_node *parentn
mappings that have changed
-------------------------------------------------*/
-static void save_game_inputs(running_machine *machine, xml_data_node *parentnode)
+static void save_game_inputs(running_machine &machine, xml_data_node *parentnode)
{
const input_field_config *field;
const input_port_config *port;
/* iterate over ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (save_this_input_field_type(field->type))
{
@@ -4437,9 +4437,9 @@ static void save_game_inputs(running_machine *machine, xml_data_node *parentnode
from the playback file
-------------------------------------------------*/
-static UINT8 playback_read_uint8(running_machine *machine)
+static UINT8 playback_read_uint8(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT8 result;
/* protect against NULL handles if previous reads fail */
@@ -4463,9 +4463,9 @@ static UINT8 playback_read_uint8(running_machine *machine)
from the playback file
-------------------------------------------------*/
-static UINT32 playback_read_uint32(running_machine *machine)
+static UINT32 playback_read_uint32(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT32 result;
/* protect against NULL handles if previous reads fail */
@@ -4489,9 +4489,9 @@ static UINT32 playback_read_uint32(running_machine *machine)
from the playback file
-------------------------------------------------*/
-static UINT64 playback_read_uint64(running_machine *machine)
+static UINT64 playback_read_uint64(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT64 result;
/* protect against NULL handles if previous reads fail */
@@ -4514,10 +4514,10 @@ static UINT64 playback_read_uint64(running_machine *machine)
playback_init - initialize INP playback
-------------------------------------------------*/
-static time_t playback_init(running_machine *machine)
+static time_t playback_init(running_machine &machine)
{
- const char *filename = machine->options().playback();
- input_port_private *portdata = machine->input_port_data;
+ const char *filename = machine.options().playback();
+ input_port_private *portdata = machine.input_port_data;
UINT8 header[INP_HEADER_SIZE];
time_t basetime;
@@ -4526,7 +4526,7 @@ static time_t playback_init(running_machine *machine)
return 0;
/* open the playback file */
- portdata->playback_file = auto_alloc(machine, emu_file(machine->options().input_directory(), OPEN_FLAG_READ));
+ portdata->playback_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_READ));
file_error filerr = portdata->playback_file->open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for playback");
@@ -4547,8 +4547,8 @@ static time_t playback_init(running_machine *machine)
mame_printf_info("Recorded using %s\n", header + 0x20);
/* verify the header against the current game */
- if (memcmp(machine->system().name, header + 0x14, strlen(machine->system().name) + 1) != 0)
- mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine->system().name);
+ if (memcmp(machine.system().name, header + 0x14, strlen(machine.system().name) + 1) != 0)
+ mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine.system().name);
/* enable compression */
portdata->playback_file->compress(FCOMPRESS_MEDIUM);
@@ -4561,9 +4561,9 @@ static time_t playback_init(running_machine *machine)
playback_end - end INP playback
-------------------------------------------------*/
-static void playback_end(running_machine *machine, const char *message)
+static void playback_end(running_machine &machine, const char *message)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* only applies if we have a live file */
if (portdata->playback_file != NULL)
@@ -4589,9 +4589,9 @@ static void playback_end(running_machine *machine, const char *message)
playback
-------------------------------------------------*/
-static void playback_frame(running_machine *machine, attotime curtime)
+static void playback_frame(running_machine &machine, attotime curtime)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* if playing back, fetch the information and verify */
if (portdata->playback_file != NULL)
@@ -4617,7 +4617,7 @@ static void playback_frame(running_machine *machine, attotime curtime)
static void playback_port(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
/* if playing back, fetch information about this port */
if (portdata->playback_file != NULL)
@@ -4625,19 +4625,19 @@ static void playback_port(const input_port_config *port)
analog_field_state *analog;
/* read the default value and the digital state */
- port->state->defvalue = playback_read_uint32(port->machine);
- port->state->digital = playback_read_uint32(port->machine);
+ port->state->defvalue = playback_read_uint32(port->machine());
+ port->state->digital = playback_read_uint32(port->machine());
/* loop over analog ports and save their data */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
{
/* read current and previous values */
- analog->accum = playback_read_uint32(port->machine);
- analog->previous = playback_read_uint32(port->machine);
+ analog->accum = playback_read_uint32(port->machine());
+ analog->previous = playback_read_uint32(port->machine());
/* read configuration information */
- analog->sensitivity = playback_read_uint32(port->machine);
- analog->reverse = playback_read_uint8(port->machine);
+ analog->sensitivity = playback_read_uint32(port->machine());
+ analog->reverse = playback_read_uint8(port->machine());
}
}
}
@@ -4653,9 +4653,9 @@ static void playback_port(const input_port_config *port)
to the record file
-------------------------------------------------*/
-static void record_write_uint8(running_machine *machine, UINT8 data)
+static void record_write_uint8(running_machine &machine, UINT8 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT8 result = data;
/* protect against NULL handles if previous reads fail */
@@ -4673,9 +4673,9 @@ static void record_write_uint8(running_machine *machine, UINT8 data)
to the record file
-------------------------------------------------*/
-static void record_write_uint32(running_machine *machine, UINT32 data)
+static void record_write_uint32(running_machine &machine, UINT32 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT32 result = LITTLE_ENDIANIZE_INT32(data);
/* protect against NULL handles if previous reads fail */
@@ -4693,9 +4693,9 @@ static void record_write_uint32(running_machine *machine, UINT32 data)
to the record file
-------------------------------------------------*/
-static void record_write_uint64(running_machine *machine, UINT64 data)
+static void record_write_uint64(running_machine &machine, UINT64 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT64 result = LITTLE_ENDIANIZE_INT64(data);
/* protect against NULL handles if previous reads fail */
@@ -4712,10 +4712,10 @@ static void record_write_uint64(running_machine *machine, UINT64 data)
record_init - initialize INP recording
-------------------------------------------------*/
-static void record_init(running_machine *machine)
+static void record_init(running_machine &machine)
{
- const char *filename = machine->options().record();
- input_port_private *portdata = machine->input_port_data;
+ const char *filename = machine.options().record();
+ input_port_private *portdata = machine.input_port_data;
UINT8 header[INP_HEADER_SIZE];
system_time systime;
@@ -4724,12 +4724,12 @@ static void record_init(running_machine *machine)
return;
/* open the record file */
- portdata->record_file = auto_alloc(machine, emu_file(machine->options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ portdata->record_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr = portdata->record_file->open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for recording");
/* get the base time */
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
/* fill in the header */
memset(header, 0, sizeof(header));
@@ -4744,7 +4744,7 @@ static void record_init(running_machine *machine)
header[0x0f] = systime.time >> 56;
header[0x10] = INP_HEADER_MAJVERSION;
header[0x11] = INP_HEADER_MINVERSION;
- strcpy((char *)header + 0x14, machine->system().name);
+ strcpy((char *)header + 0x14, machine.system().name);
sprintf((char *)header + 0x20, APPNAME " %s", build_version);
/* write it */
@@ -4759,9 +4759,9 @@ static void record_init(running_machine *machine)
record_end - end INP recording
-------------------------------------------------*/
-static void record_end(running_machine *machine, const char *message)
+static void record_end(running_machine &machine, const char *message)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* only applies if we have a live file */
if (portdata->record_file != NULL)
@@ -4782,9 +4782,9 @@ static void record_end(running_machine *machine, const char *message)
recording
-------------------------------------------------*/
-static void record_frame(running_machine *machine, attotime curtime)
+static void record_frame(running_machine &machine, attotime curtime)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* if recording, record information about the current frame */
if (portdata->record_file != NULL)
@@ -4794,7 +4794,7 @@ static void record_frame(running_machine *machine, attotime curtime)
record_write_uint64(machine, curtime.attoseconds);
/* then the current speed */
- record_write_uint32(machine, machine->video().speed_percent() * (double)(1 << 20));
+ record_write_uint32(machine, machine.video().speed_percent() * (double)(1 << 20));
}
}
@@ -4805,7 +4805,7 @@ static void record_frame(running_machine *machine, attotime curtime)
static void record_port(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
/* if recording, store information about this port */
if (portdata->record_file != NULL)
@@ -4813,29 +4813,29 @@ static void record_port(const input_port_config *port)
analog_field_state *analog;
/* store the default value and digital state */
- record_write_uint32(port->machine, port->state->defvalue);
- record_write_uint32(port->machine, port->state->digital);
+ record_write_uint32(port->machine(), port->state->defvalue);
+ record_write_uint32(port->machine(), port->state->digital);
/* loop over analog ports and save their data */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
{
/* store current and previous values */
- record_write_uint32(port->machine, analog->accum);
- record_write_uint32(port->machine, analog->previous);
+ record_write_uint32(port->machine(), analog->accum);
+ record_write_uint32(port->machine(), analog->previous);
/* store configuration information */
- record_write_uint32(port->machine, analog->sensitivity);
- record_write_uint8(port->machine, analog->reverse);
+ record_write_uint32(port->machine(), analog->sensitivity);
+ record_write_uint8(port->machine(), analog->reverse);
}
}
}
-int input_machine_has_keyboard(running_machine *machine)
+int input_machine_has_keyboard(running_machine &machine)
{
int have_keyboard = FALSE;
const input_field_config *field;
const input_port_config *port;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -4858,7 +4858,7 @@ int input_machine_has_keyboard(running_machine *machine)
given code; used for logging and debugging
-------------------------------------------------*/
-static const char *code_point_string(running_machine *machine, unicode_char ch)
+static const char *code_point_string(running_machine &machine, unicode_char ch)
{
static char buf[16];
const char *result = buf;
@@ -4905,7 +4905,7 @@ static const char *code_point_string(running_machine *machine, unicode_char ch)
sets up natural keyboard input mapping
-------------------------------------------------*/
-static int scan_keys(running_machine *machine, const input_port_config *portconfig, inputx_code *codes, const input_port_config * *ports, const input_field_config * *shift_ports, int keys, int shift)
+static int scan_keys(running_machine &machine, const input_port_config *portconfig, inputx_code *codes, const input_port_config * *ports, const input_field_config * *shift_ports, int keys, int shift)
{
int code_count = 0;
const input_port_config *port;
@@ -4967,7 +4967,7 @@ static int scan_keys(running_machine *machine, const input_port_config *portconf
chars
-------------------------------------------------*/
-static inputx_code *build_codes(running_machine *machine, const input_port_config *portconfig)
+static inputx_code *build_codes(running_machine &machine, const input_port_config *portconfig)
{
inputx_code *codes = NULL;
const input_port_config *ports[NUM_SIMUL_KEYS];
@@ -5045,19 +5045,19 @@ static void clear_keybuffer(running_machine &machine)
-static void setup_keybuffer(running_machine *machine)
+static void setup_keybuffer(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
- portdata->inputx_timer = machine->scheduler().timer_alloc(FUNC(inputx_timerproc));
+ input_port_private *portdata = machine.input_port_data;
+ portdata->inputx_timer = machine.scheduler().timer_alloc(FUNC(inputx_timerproc));
portdata->keybuffer = auto_alloc_clear(machine, key_buffer);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, clear_keybuffer);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, clear_keybuffer);
}
-void inputx_init(running_machine *machine)
+void inputx_init(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
portdata->codes = NULL;
portdata->inputx_timer = NULL;
portdata->queue_chars = NULL;
@@ -5065,7 +5065,7 @@ void inputx_init(running_machine *machine)
portdata->charqueue_empty = NULL;
portdata->keybuffer = NULL;
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
@@ -5074,7 +5074,7 @@ void inputx_init(running_machine *machine)
/* posting keys directly only makes sense for a computer */
if (input_machine_has_keyboard(machine))
{
- portdata->codes = build_codes(machine, machine->m_portlist.first());
+ portdata->codes = build_codes(machine, machine.m_portlist.first());
setup_keybuffer(machine);
}
}
@@ -5082,27 +5082,27 @@ void inputx_init(running_machine *machine)
void inputx_setup_natural_keyboard(
- running_machine *machine,
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine *machine, unicode_char ch),
- int (*charqueue_empty)(running_machine *machine))
+ running_machine &machine,
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
+ int (*accept_char)(running_machine &machine, unicode_char ch),
+ int (*charqueue_empty)(running_machine &machine))
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
portdata->queue_chars = queue_chars;
portdata->accept_char = accept_char;
portdata->charqueue_empty = charqueue_empty;
}
-int inputx_can_post(running_machine *machine)
+int inputx_can_post(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
return portdata->queue_chars || portdata->codes;
}
-static int can_post_key_directly(running_machine *machine, unicode_char ch)
+static int can_post_key_directly(running_machine &machine, unicode_char ch)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int rc = FALSE;
const inputx_code *code;
@@ -5121,7 +5121,7 @@ static int can_post_key_directly(running_machine *machine, unicode_char ch)
-static int can_post_key_alternate(running_machine *machine, unicode_char ch)
+static int can_post_key_alternate(running_machine &machine, unicode_char ch)
{
const char *s;
const char_info *ci;
@@ -5173,9 +5173,9 @@ static attotime choose_delay(input_port_private *portdata, unicode_char ch)
-static void internal_post_key(running_machine *machine, unicode_char ch)
+static void internal_post_key(running_machine &machine, unicode_char ch)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
key_buffer *keybuf;
keybuf = get_buffer(machine);
@@ -5193,7 +5193,7 @@ static void internal_post_key(running_machine *machine, unicode_char ch)
-static int buffer_full(running_machine *machine)
+static int buffer_full(running_machine &machine)
{
key_buffer *keybuf;
keybuf = get_buffer(machine);
@@ -5202,9 +5202,9 @@ static int buffer_full(running_machine *machine)
-static void inputx_postn_rate(running_machine *machine, const unicode_char *text, size_t text_len, attotime rate)
+static void inputx_postn_rate(running_machine &machine, const unicode_char *text, size_t text_len, attotime rate)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int last_cr = 0;
unicode_char ch;
const char *s;
@@ -5264,7 +5264,7 @@ static void inputx_postn_rate(running_machine *machine, const unicode_char *text
static TIMER_CALLBACK(inputx_timerproc)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
key_buffer *keybuf;
attotime delay;
@@ -5305,9 +5305,9 @@ static TIMER_CALLBACK(inputx_timerproc)
}
}
-int inputx_is_posting(running_machine *machine)
+int inputx_is_posting(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const key_buffer *keybuf;
keybuf = get_buffer(machine);
return (keybuf->begin_pos != keybuf->end_pos) || (portdata->charqueue_empty && !(*portdata->charqueue_empty)(machine));
@@ -5318,9 +5318,9 @@ int inputx_is_posting(running_machine *machine)
Coded input
***************************************************************************/
-static void inputx_postc_rate(running_machine *machine, unicode_char ch, attotime rate);
+static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate);
-static void inputx_postn_coded_rate(running_machine *machine, const char *text, size_t text_len, attotime rate)
+static void inputx_postn_coded_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
{
size_t i, j, key_len, increment;
unicode_char ch;
@@ -5397,17 +5397,17 @@ static void inputx_postn_coded_rate(running_machine *machine, const char *text,
***************************************************************************/
-static void inputx_postc_rate(running_machine *machine, unicode_char ch, attotime rate)
+static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate)
{
inputx_postn_rate(machine, &ch, 1, rate);
}
-void inputx_postc(running_machine *machine, unicode_char ch)
+void inputx_postc(running_machine &machine, unicode_char ch)
{
inputx_postc_rate(machine, ch, attotime::zero);
}
-static void inputx_postn_utf8_rate(running_machine *machine, const char *text, size_t text_len, attotime rate)
+static void inputx_postn_utf8_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
{
size_t len = 0;
unicode_char buf[256];
@@ -5435,12 +5435,12 @@ static void inputx_postn_utf8_rate(running_machine *machine, const char *text, s
inputx_postn_rate(machine, buf, len, rate);
}
-void inputx_post_utf8(running_machine *machine, const char *text)
+void inputx_post_utf8(running_machine &machine, const char *text)
{
inputx_postn_utf8_rate(machine, text, strlen(text), attotime::zero);
}
-void inputx_post_utf8_rate(running_machine *machine, const char *text, attotime rate)
+void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate)
{
inputx_postn_utf8_rate(machine, text, strlen(text), rate);
}
@@ -5538,12 +5538,12 @@ int input_player_number(const input_field_config *port)
particular input class is present
-------------------------------------------------*/
-int input_has_input_class(running_machine *machine, int inputclass)
+int input_has_input_class(running_machine &machine, int inputclass)
{
const input_port_config *port;
const input_field_config *field;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5561,14 +5561,14 @@ int input_has_input_class(running_machine *machine, int inputclass)
active players
-------------------------------------------------*/
-int input_count_players(running_machine *machine)
+int input_count_players(running_machine &machine)
{
const input_port_config *port;
const input_field_config *field;
int joystick_count;
joystick_count = 0;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5589,7 +5589,7 @@ int input_count_players(running_machine *machine)
specific category is active
-------------------------------------------------*/
-int input_category_active(running_machine *machine, int category)
+int input_category_active(running_machine &machine, int category)
{
const input_port_config *port;
const input_field_config *field = NULL;
@@ -5599,7 +5599,7 @@ int input_category_active(running_machine *machine, int category)
assert(category >= 1);
/* loop through the input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5632,7 +5632,7 @@ int input_category_active(running_machine *machine, int category)
natural keyboard input
-------------------------------------------------*/
-static void execute_input(running_machine *machine, int ref, int params, const char *param[])
+static void execute_input(running_machine &machine, int ref, int params, const char *param[])
{
inputx_postn_coded_rate(machine, param[0], strlen(param[0]), attotime::zero);
}
@@ -5644,9 +5644,9 @@ static void execute_input(running_machine *machine, int ref, int params, const c
keyboard codes
-------------------------------------------------*/
-static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
{
- inputx_code *codes = machine->input_port_data->codes;
+ inputx_code *codes = machine.input_port_data->codes;
const char *filename;
FILE *file = NULL;
const inputx_code *code;
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 31d566323fa..7f98c5092d2 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -741,6 +741,7 @@ public:
~input_port_config();
input_port_config *next() const { return m_next; }
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
input_port_config * m_next; /* pointer to next port */
const char * tag; /* pointer to this port's tag */
@@ -748,7 +749,7 @@ public:
/* these fields are only valid if the port is live */
input_port_state * state; /* live state of port (NULL if not live) */
- running_machine * machine; /* machine if port is live */
+ running_machine * m_machine; /* machine if port is live */
device_config * owner; /* associated device, when appropriate */
input_port_value active; /* mask of active bits in the port */
};
@@ -1081,7 +1082,7 @@ struct _inp_header
/* ----- core system management ----- */
/* initialize the input ports, processing the given token list */
-time_t input_port_init(running_machine *machine, const input_port_token *tokens, const device_config_list &devicelist);
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist);
@@ -1101,22 +1102,22 @@ const input_field_config *input_field_by_tag_and_mask(const ioport_list &portlis
int input_type_is_analog(int type);
/* return the name for the given type/player */
-const char *input_type_name(running_machine *machine, int type, int player);
+const char *input_type_name(running_machine &machine, int type, int player);
/* return the group for the given type/player */
-int input_type_group(running_machine *machine, int type, int player);
+int input_type_group(running_machine &machine, int type, int player);
/* return the global input mapping sequence for the given type/player */
-const input_seq *input_type_seq(running_machine *machine, int type, int player, input_seq_type seqtype);
+const input_seq *input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype);
/* change the global input sequence for the given type/player */
-void input_type_set_seq(running_machine *machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
+void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
/* return TRUE if the sequence for the given input type/player is pressed */
-int input_type_pressed(running_machine *machine, int type, int player);
+int input_type_pressed(running_machine &machine, int type, int player);
/* return the list of default mappings */
-const input_type_desc *input_type_list(running_machine *machine);
+const input_type_desc *input_type_list(running_machine &machine);
@@ -1153,13 +1154,13 @@ void input_field_select_next_setting(const input_field_config *field);
/* ----- port checking ----- */
/* return whether an input port exists */
-bool input_port_exists(running_machine *machine, const char *tag);
+bool input_port_exists(running_machine &machine, const char *tag);
/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown) */
-input_port_value input_port_active(running_machine *machine, const char *tag);
+input_port_value input_port_active(running_machine &machine, const char *tag);
/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown), or a default value if the port does not exist */
-input_port_value input_port_active_safe(running_machine *machine, const char *tag, input_port_value defvalue);
+input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue);
/* ----- port reading ----- */
@@ -1168,19 +1169,19 @@ input_port_value input_port_active_safe(running_machine *machine, const char *ta
input_port_value input_port_read_direct(const input_port_config *port);
/* return the value of an input port specified by tag */
-input_port_value input_port_read(running_machine *machine, const char *tag);
+input_port_value input_port_read(running_machine &machine, const char *tag);
/* return the value of a device input port specified by tag */
input_port_value input_port_read(device_t *device, const char *tag);
/* return the value of an input port specified by tag, or a default value if the port does not exist */
-input_port_value input_port_read_safe(running_machine *machine, const char *tag, input_port_value defvalue);
+input_port_value input_port_read_safe(running_machine &machine, const char *tag, input_port_value defvalue);
/* return the extracted crosshair values for the given player */
-int input_port_get_crosshair_position(running_machine *machine, int player, float *x, float *y);
+int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y);
/* force an update to the input port values based on current conditions */
-void input_port_update_defaults(running_machine *machine);
+void input_port_update_defaults(running_machine &machine);
@@ -1190,50 +1191,50 @@ void input_port_update_defaults(running_machine *machine);
void input_port_write_direct(const input_port_config *port, input_port_value value, input_port_value mask);
/* write a value to a port specified by tag */
-void input_port_write(running_machine *machine, const char *tag, input_port_value value, input_port_value mask);
+void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
/* write a value to a port, ignore if the port does not exist */
-void input_port_write_safe(running_machine *machine, const char *tag, input_port_value value, input_port_value mask);
+void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
/* ----- misc helper functions ----- */
/* return the TRUE if the given condition attached is true */
-int input_condition_true(running_machine *machine, const input_condition *condition);
+int input_condition_true(running_machine &machine, const input_condition *condition);
/* convert an input_port_token to a default string */
const char *input_port_string_from_token(const input_port_token token);
/* return TRUE if machine use full keyboard emulation */
-int input_machine_has_keyboard(running_machine *machine);
+int input_machine_has_keyboard(running_machine &machine);
/* these are called by the core; they should not be called from FEs */
-void inputx_init(running_machine *machine);
+void inputx_init(running_machine &machine);
/* called by drivers to setup natural keyboard support */
-void inputx_setup_natural_keyboard(running_machine *machine,
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine *machine, unicode_char ch),
- int (*charqueue_empty)(running_machine *machine));
+void inputx_setup_natural_keyboard(running_machine &machine,
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
+ int (*accept_char)(running_machine &machine, unicode_char ch),
+ int (*charqueue_empty)(running_machine &machine));
/* validity checks */
int validate_natural_keyboard_statics(void);
/* these can be called from FEs */
-int inputx_can_post(running_machine *machine);
+int inputx_can_post(running_machine &machine);
/* various posting functions; can be called from FEs */
-void inputx_postc(running_machine *machine, unicode_char ch);
-void inputx_post_utf8(running_machine *machine, const char *text);
-void inputx_post_utf8_rate(running_machine *machine, const char *text, attotime rate);
-int inputx_is_posting(running_machine *machine);
+void inputx_postc(running_machine &machine, unicode_char ch);
+void inputx_post_utf8(running_machine &machine, const char *text);
+void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate);
+int inputx_is_posting(running_machine &machine);
/* miscellaneous functions */
int input_classify_port(const input_field_config *field);
-int input_has_input_class(running_machine *machine, int inputclass);
+int input_has_input_class(running_machine &machine, int inputclass);
int input_player_number(const input_field_config *field);
-int input_count_players(running_machine *machine);
-int input_category_active(running_machine *machine, int category);
+int input_count_players(running_machine &machine);
+int input_category_active(running_machine &machine, int category);
#endif /* __INPTPORT_H__ */
diff --git a/src/emu/input.c b/src/emu/input.c
index 40d09320fda..bbe4ea7ad4b 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -80,7 +80,9 @@ struct _joystick_map
/* a single input device */
struct _input_device
{
- running_machine * machine; /* machine we are attached to */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* machine we are attached to */
astring name; /* string name of device */
input_device_class devclass; /* class of this device */
int devindex; /* device index of this device */
@@ -421,15 +423,15 @@ const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.
***************************************************************************/
static void input_frame(running_machine &machine);
-static input_device_item *input_code_item(running_machine *machine, input_code code);
-static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item);
+static input_device_item *input_code_item(running_machine &machine, input_code code);
+static INT32 convert_absolute_value(running_machine &machine, input_code code, input_device_item *item);
static INT32 convert_relative_value(input_code code, input_device_item *item);
-static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item);
-static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result);
+static INT32 convert_switch_value(running_machine &machine, input_code code, input_device_item *item);
+static INT32 apply_deadzone_and_saturation(running_machine &machine, input_code code, INT32 result);
static int joystick_map_parse(const char *mapstring, joystick_map *map);
static void joystick_map_print(const char *header, const char *origstring, const joystick_map *map);
-static void input_code_reset_axes(running_machine *machine);
-static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code);
+static void input_code_reset_axes(running_machine &machine);
+static int input_code_check_axis(running_machine &machine, input_device_item *item, input_code code);
@@ -442,13 +444,13 @@ static int input_code_check_axis(running_machine *machine, input_device_item *it
a pointer to the associated device
-------------------------------------------------*/
-INLINE input_device *input_code_device(running_machine *machine, input_code code)
+INLINE input_device *input_code_device(running_machine &machine, input_code code)
{
/* if the class is valid... */
input_device_class devclass = INPUT_CODE_DEVCLASS(code);
if (devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
/* ...and the index is valid for that class, return a pointer to the device */
int devindex = INPUT_CODE_DEVINDEX(code);
@@ -470,7 +472,7 @@ INLINE input_code device_item_to_code(input_device *device, input_item_id itemid
{
int devindex = device->devindex;
- assert(devindex < device->machine->input_data->device_list[device->devclass].count);
+ assert(devindex < device->machine().input_data->device_list[device->devclass].count);
assert(itemid < ITEM_ID_ABSOLUTE_MAXIMUM);
assert(device->item[itemid] != NULL);
@@ -504,9 +506,9 @@ INLINE input_item_class input_item_standard_class(input_device_class devclass, i
of an input item
-------------------------------------------------*/
-INLINE void input_item_update_value(running_machine *machine, input_device_item *item)
+INLINE void input_item_update_value(running_machine &machine, input_device_item *item)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
item->current = (*item->getstate)(device_list[item->devclass].list[item->devindex]->internal, item->internal);
}
@@ -517,9 +519,9 @@ INLINE void input_item_update_value(running_machine *machine, input_device_item
of memory for pressed switches
-------------------------------------------------*/
-INLINE void code_pressed_memory_reset(running_machine *machine)
+INLINE void code_pressed_memory_reset(running_machine &machine)
{
- input_code *code_pressed_memory = machine->input_data->code_pressed_memory;
+ input_code *code_pressed_memory = machine.input_data->code_pressed_memory;
int memnum;
for (memnum = 0; memnum < MAX_PRESSED_SWITCHES; memnum++)
@@ -570,45 +572,45 @@ INLINE const char *code_to_string(const code_string_table *table, UINT32 code)
input_init - initialize the input lists
-------------------------------------------------*/
-void input_init(running_machine *machine)
+void input_init(running_machine &machine)
{
joystick_map map;
input_private *state;
input_device_list *device_list;
/* remember this machine */
- stashed_machine = machine;
+ stashed_machine = &machine;
/* allocate private memory */
- machine->input_data = state = auto_alloc_clear(machine, input_private);
+ machine.input_data = state = auto_alloc_clear(machine, input_private);
device_list = state->device_list;
/* reset code memory */
code_pressed_memory_reset(machine);
/* request a per-frame callback for bookkeeping */
- machine->add_notifier(MACHINE_NOTIFY_FRAME, input_frame);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, input_frame);
/* read input enable options */
device_list[DEVICE_CLASS_KEYBOARD].enabled = TRUE;
- device_list[DEVICE_CLASS_MOUSE].enabled = machine->options().mouse();
- device_list[DEVICE_CLASS_LIGHTGUN].enabled = machine->options().lightgun();
- device_list[DEVICE_CLASS_JOYSTICK].enabled = machine->options().joystick();
+ device_list[DEVICE_CLASS_MOUSE].enabled = machine.options().mouse();
+ device_list[DEVICE_CLASS_LIGHTGUN].enabled = machine.options().lightgun();
+ device_list[DEVICE_CLASS_JOYSTICK].enabled = machine.options().joystick();
/* read input device multi options */
- device_list[DEVICE_CLASS_KEYBOARD].multi = machine->options().multi_keyboard();
- device_list[DEVICE_CLASS_MOUSE].multi = machine->options().multi_mouse();
+ device_list[DEVICE_CLASS_KEYBOARD].multi = machine.options().multi_keyboard();
+ device_list[DEVICE_CLASS_MOUSE].multi = machine.options().multi_mouse();
device_list[DEVICE_CLASS_LIGHTGUN].multi = TRUE;
device_list[DEVICE_CLASS_JOYSTICK].multi = TRUE;
/* read other input options */
- state->steadykey_enabled = machine->options().steadykey();
- state->lightgun_reload_button = machine->options().offscreen_reload();
- state->joystick_deadzone = (INT32)(machine->options().joystick_deadzone() * INPUT_ABSOLUTE_MAX);
- state->joystick_saturation = (INT32)(machine->options().joystick_saturation() * INPUT_ABSOLUTE_MAX);
+ state->steadykey_enabled = machine.options().steadykey();
+ state->lightgun_reload_button = machine.options().offscreen_reload();
+ state->joystick_deadzone = (INT32)(machine.options().joystick_deadzone() * INPUT_ABSOLUTE_MAX);
+ state->joystick_saturation = (INT32)(machine.options().joystick_saturation() * INPUT_ABSOLUTE_MAX);
/* get the default joystick map */
- state->joystick_map_default = machine->options().joystick_map();
+ state->joystick_map_default = machine.options().joystick_map();
if (state->joystick_map_default[0] == 0 || strcmp(state->joystick_map_default, "auto") == 0)
state->joystick_map_default = joystick_map_8way;
if (!joystick_map_parse(state->joystick_map_default, &map))
@@ -623,9 +625,9 @@ void input_init(running_machine *machine)
a device class
-------------------------------------------------*/
-void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable)
+void input_device_class_enable(running_machine &machine, input_device_class devclass, UINT8 enable)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
device_list[devclass].enabled = enable;
@@ -637,9 +639,9 @@ void input_device_class_enable(running_machine *machine, input_device_class devc
enabled?
-------------------------------------------------*/
-UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass)
+UINT8 input_device_class_enabled(running_machine &machine, input_device_class devclass)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
return device_list[devclass].enabled;
@@ -651,9 +653,9 @@ UINT8 input_device_class_enabled(running_machine *machine, input_device_class de
joystick map for a device
-------------------------------------------------*/
-int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring)
+int input_device_set_joystick_map(running_machine &machine, int devindex, const char *mapstring)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
int startindex = devindex;
int stopindex = devindex;
joystick_map map;
@@ -710,7 +712,7 @@ static void input_frame(running_machine &machine)
input_device_item *item = device->item[itemid];
if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
{
- input_item_update_value(&machine, item);
+ input_item_update_value(machine, item);
if ((item->current ^ item->oldkey) & 1)
{
changed = TRUE;
@@ -747,12 +749,12 @@ static void input_frame(running_machine &machine)
input_device_add - add a new input device
-------------------------------------------------*/
-input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal)
+input_device *input_device_add(running_machine &machine, input_device_class devclass, const char *name, void *internal)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
input_device_list *devlist = &state->device_list[devclass];
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call input_device_add at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call input_device_add at init time!");
assert(name != NULL);
assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
@@ -766,7 +768,7 @@ input_device *input_device_add(running_machine *machine, input_device_class devc
devlist->list[devlist->count++] = device;
/* fill in the data */
- device->machine = machine;
+ device->m_machine = &machine;
device->name.cpy(name);
device->devclass = devclass;
device->devindex = devlist->count - 1;
@@ -794,7 +796,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
input_device_item *item;
input_item_id itemid_std = itemid;
- assert_always(device->machine->phase() == MACHINE_PHASE_INIT, "Can only call input_device_item_add at init time!");
+ assert_always(device->machine().phase() == MACHINE_PHASE_INIT, "Can only call input_device_item_add at init time!");
assert(name != NULL);
assert(itemid > ITEM_ID_INVALID && itemid < ITEM_ID_MAXIMUM);
assert(getstate != NULL);
@@ -810,7 +812,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
assert(device->item[itemid] == NULL);
/* allocate a new item and copy data into it */
- item = auto_alloc_clear(device->machine, input_device_item);
+ item = auto_alloc_clear(device->machine(), input_device_item);
device->item[itemid] = item;
device->maxitem = MAX(device->maxitem, itemid);
@@ -848,9 +850,9 @@ void input_device_item_add(input_device *device, const char *name, void *interna
given input code
-------------------------------------------------*/
-INT32 input_code_value(running_machine *machine, input_code code)
+INT32 input_code_value(running_machine &machine, input_code code)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass = INPUT_CODE_DEVCLASS(code);
int startindex = INPUT_CODE_DEVINDEX(code);
int stopindex = startindex;
@@ -918,7 +920,7 @@ exit:
given input code has been pressed
-------------------------------------------------*/
-int input_code_pressed(running_machine *machine, input_code code)
+int input_code_pressed(running_machine &machine, input_code code)
{
return (input_code_value(machine, code) != 0);
}
@@ -930,9 +932,9 @@ int input_code_pressed(running_machine *machine, input_code code)
on since the last call
-------------------------------------------------*/
-int input_code_pressed_once(running_machine *machine, input_code code)
+int input_code_pressed_once(running_machine &machine, input_code code)
{
- input_code *code_pressed_memory = machine->input_data->code_pressed_memory;
+ input_code *code_pressed_memory = machine.input_data->code_pressed_memory;
int curvalue = input_code_pressed(machine, code);
int memnum, empty = -1;
@@ -972,9 +974,9 @@ int input_code_pressed_once(running_machine *machine, input_code code)
an input_item_id to an input_code
-------------------------------------------------*/
-input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid)
+input_code input_code_from_input_item_id(running_machine &machine, input_item_id itemid)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* iterate over device classes and devices */
@@ -999,9 +1001,9 @@ input_code input_code_from_input_item_id(running_machine *machine, input_item_id
input_code_poll_switches - poll for any input
-------------------------------------------------*/
-input_code input_code_poll_switches(running_machine *machine, int reset)
+input_code input_code_poll_switches(running_machine &machine, int reset)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* if resetting memory, do it now */
@@ -1094,9 +1096,9 @@ input_code input_code_poll_switches(running_machine *machine, int reset)
any keyboard-specific input
-------------------------------------------------*/
-input_code input_code_poll_keyboard_switches(running_machine *machine, int reset)
+input_code input_code_poll_keyboard_switches(running_machine &machine, int reset)
{
- input_device_list *devlist = &machine->input_data->device_list[DEVICE_CLASS_KEYBOARD];
+ input_device_list *devlist = &machine.input_data->device_list[DEVICE_CLASS_KEYBOARD];
int devnum;
/* if resetting memory, do it now */
@@ -1132,7 +1134,7 @@ input_code input_code_poll_keyboard_switches(running_machine *machine, int reset
move far enough
-------------------------------------------------*/
-static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code)
+static int input_code_check_axis(running_machine &machine, input_device_item *item, input_code code)
{
INT32 curval, diff;
@@ -1177,9 +1179,9 @@ static int input_code_check_axis(running_machine *machine, input_device_item *it
input_code_reset_axes - reset axes memory
-------------------------------------------------*/
-static void input_code_reset_axes(running_machine *machine)
+static void input_code_reset_axes(running_machine &machine)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* iterate over device classes and devices */
@@ -1219,9 +1221,9 @@ static void input_code_reset_axes(running_machine *machine)
input_code_poll_axes - poll for any input
-------------------------------------------------*/
-input_code input_code_poll_axes(running_machine *machine, int reset)
+input_code input_code_poll_axes(running_machine &machine, int reset)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* if resetting memory, do it now */
@@ -1275,9 +1277,9 @@ input_code input_code_poll_axes(running_machine *machine, int reset)
a friendly name
-------------------------------------------------*/
-astring &input_code_name(running_machine *machine, astring &string, input_code code)
+astring &input_code_name(running_machine &machine, astring &string, input_code code)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_item *item = input_code_item(machine, code);
const char *devclass;
const char *devcode;
@@ -1335,7 +1337,7 @@ astring &input_code_name(running_machine *machine, astring &string, input_code c
a given code
-------------------------------------------------*/
-astring &input_code_to_token(running_machine *machine, astring &string, input_code code)
+astring &input_code_to_token(running_machine &machine, astring &string, input_code code)
{
input_device_item *item = input_code_item(machine, code);
const char *devclass;
@@ -1390,7 +1392,7 @@ astring &input_code_to_token(running_machine *machine, astring &string, input_co
code from a token
-------------------------------------------------*/
-input_code input_code_from_token(running_machine *machine, const char *_token)
+input_code input_code_from_token(running_machine &machine, const char *_token)
{
UINT32 devclass, itemid, devindex, modifier, standard;
UINT32 itemclass = ITEM_CLASS_INVALID;
@@ -1438,7 +1440,7 @@ input_code input_code_from_token(running_machine *machine, const char *_token)
/* otherwise, keep parsing */
else
{
- input_device_list *device_list = (machine != NULL) ? machine->input_data->device_list : NULL;
+ input_device_list *device_list = machine.input_data->device_list;
input_device *device;
/* if this is an invalid device, we have nothing to look up */
@@ -1510,16 +1512,16 @@ exit:
INT32 debug_global_input_code_pressed(input_code code)
{
- if (!mame_is_valid_machine(stashed_machine))
+ if (!mame_is_valid_machine(*stashed_machine))
return 0;
- return input_code_pressed(stashed_machine, code);
+ return input_code_pressed(*stashed_machine, code);
}
INT32 debug_global_input_code_pressed_once(input_code code)
{
- if (!mame_is_valid_machine(stashed_machine))
+ if (!mame_is_valid_machine(*stashed_machine))
return 0;
- return input_code_pressed_once(stashed_machine, code);
+ return input_code_pressed_once(*stashed_machine, code);
}
/***************************************************************************
@@ -1531,7 +1533,7 @@ INT32 debug_global_input_code_pressed_once(input_code code)
from the code
-------------------------------------------------*/
-static input_device_item *input_code_item(running_machine *machine, input_code code)
+static input_device_item *input_code_item(running_machine &machine, input_code code)
{
input_device *device = input_code_device(machine, code);
input_item_id itemid;
@@ -1555,9 +1557,9 @@ static input_device_item *input_code_item(running_machine *machine, input_code c
value into the class specified by code
-------------------------------------------------*/
-static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item)
+static INT32 convert_absolute_value(running_machine &machine, input_code code, input_device_item *item)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
/* make sure values are valid */
assert(item->current >= INPUT_ABSOLUTE_MIN && item->current <= INPUT_ABSOLUTE_MAX);
@@ -1679,9 +1681,9 @@ static INT32 convert_relative_value(input_code code, input_device_item *item)
value into the class specified by code
-------------------------------------------------*/
-static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item)
+static INT32 convert_switch_value(running_machine &machine, input_code code, input_device_item *item)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
/* only a switch is supported */
if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_SWITCH)
@@ -1723,9 +1725,9 @@ static INT32 convert_switch_value(running_machine *machine, input_code code, inp
absolute value
-------------------------------------------------*/
-static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result)
+static INT32 apply_deadzone_and_saturation(running_machine &machine, input_code code, INT32 result)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
int negative = FALSE;
/* ignore if not a joystick */
diff --git a/src/emu/input.h b/src/emu/input.h
index b7af5498352..ecbd66d0d49 100644
--- a/src/emu/input.h
+++ b/src/emu/input.h
@@ -582,22 +582,22 @@ extern const char joystick_map_4way_diagonal[];
/* ----- initialization and configuration ----- */
/* core initialization, prior to calling osd_init() */
-void input_init(running_machine *machine);
+void input_init(running_machine &machine);
/* enable or disable a device class */
-void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable);
+void input_device_class_enable(running_machine &machine, input_device_class devclass, UINT8 enable);
/* is a device class enabled? */
-UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass);
+UINT8 input_device_class_enabled(running_machine &machine, input_device_class devclass);
/* configure default joystick maps */
-int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring);
+int input_device_set_joystick_map(running_machine &machine, int devindex, const char *mapstring);
/* ----- OSD configuration and access ----- */
/* add a new input device */
-input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal);
+input_device *input_device_add(running_machine &machine, input_device_class devclass, const char *name, void *internal);
/* add a new item to an input device */
void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
@@ -607,38 +607,38 @@ void input_device_item_add(input_device *device, const char *name, void *interna
/* ----- state queries ----- */
/* return the value of a particular input code */
-INT32 input_code_value(running_machine *machine, input_code code);
+INT32 input_code_value(running_machine &machine, input_code code);
/* return TRUE if the given input code has been pressed */
-INT32 input_code_pressed(running_machine *machine, input_code code);
+INT32 input_code_pressed(running_machine &machine, input_code code);
/* same as above, but returns TRUE only on the first call after an off->on transition */
-INT32 input_code_pressed_once(running_machine *machine, input_code code);
+INT32 input_code_pressed_once(running_machine &machine, input_code code);
/* translates an input_item_id to an input_code */
-input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid);
+input_code input_code_from_input_item_id(running_machine &machine, input_item_id itemid);
/* poll for any switch input, optionally resetting internal memory */
-input_code input_code_poll_switches(running_machine *machine, int reset);
+input_code input_code_poll_switches(running_machine &machine, int reset);
/* poll for any keyboard switch input, optionally resetting internal memory */
-input_code input_code_poll_keyboard_switches(running_machine *machine, int reset);
+input_code input_code_poll_keyboard_switches(running_machine &machine, int reset);
/* poll for any axis input, optionally resetting internal memory */
-input_code input_code_poll_axes(running_machine *machine, int reset);
+input_code input_code_poll_axes(running_machine &machine, int reset);
/* ----- strings and tokenization ----- */
/* generate the friendly name of an input code, returning the length (buffer can be NULL) */
-astring &input_code_name(running_machine *machine, astring &buffer, input_code code);
+astring &input_code_name(running_machine &machine, astring &buffer, input_code code);
/* convert an input code to a token, returning the length (buffer can be NULL) */
-astring &input_code_to_token(running_machine *machine, astring &buffer, input_code code);
+astring &input_code_to_token(running_machine &machine, astring &buffer, input_code code);
/* convert a token back to an input code */
-input_code input_code_from_token(running_machine *machine, const char *_token);
+input_code input_code_from_token(running_machine &machine, const char *_token);
diff --git a/src/emu/inputseq.c b/src/emu/inputseq.c
index 972e4c4f149..6b54596a983 100644
--- a/src/emu/inputseq.c
+++ b/src/emu/inputseq.c
@@ -132,7 +132,7 @@ INLINE void input_seq_backspace(input_seq *seq)
sequence of switch inputs is "pressed"
-------------------------------------------------*/
-int input_seq_pressed(running_machine *machine, const input_seq *seq)
+int input_seq_pressed(running_machine &machine, const input_seq *seq)
{
int result = FALSE;
int invert = FALSE;
@@ -187,7 +187,7 @@ int input_seq_pressed(running_machine *machine, const input_seq *seq)
axis defined in an input sequence
-------------------------------------------------*/
-INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr)
+INT32 input_seq_axis_value(running_machine &machine, const input_seq *seq, input_item_class *itemclass_ptr)
{
input_item_class itemclasszero = ITEM_CLASS_ABSOLUTE;
input_item_class itemclass = ITEM_CLASS_INVALID;
@@ -278,7 +278,7 @@ INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input
new sequence of the given itemclass
-------------------------------------------------*/
-void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq)
+void input_seq_poll_start(running_machine &machine, input_item_class itemclass, const input_seq *startseq)
{
input_code dummycode;
@@ -309,7 +309,7 @@ void input_seq_poll_start(running_machine *machine, input_item_class itemclass,
input_seq_poll - continue polling
-------------------------------------------------*/
-int input_seq_poll(running_machine *machine, input_seq *finalseq)
+int input_seq_poll(running_machine &machine, input_seq *finalseq)
{
input_code lastcode = input_seq_get_last(&record_seq);
int has_or = FALSE;
@@ -406,7 +406,7 @@ int input_seq_poll(running_machine *machine, input_seq *finalseq)
of a sequence
-------------------------------------------------*/
-astring &input_seq_name(running_machine *machine, astring &string, const input_seq *seq)
+astring &input_seq_name(running_machine &machine, astring &string, const input_seq *seq)
{
astring codestr;
int codenum, copycodenum;
@@ -464,7 +464,7 @@ astring &input_seq_name(running_machine *machine, astring &string, const input_s
form of a sequence
-------------------------------------------------*/
-astring &input_seq_to_tokens(running_machine *machine, astring &string, const input_seq *seq)
+astring &input_seq_to_tokens(running_machine &machine, astring &string, const input_seq *seq)
{
astring codestr;
int codenum;
@@ -503,7 +503,7 @@ astring &input_seq_to_tokens(running_machine *machine, astring &string, const in
form of a sequence
-------------------------------------------------*/
-int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq)
+int input_seq_from_tokens(running_machine &machine, const char *string, input_seq *seq)
{
char *strcopy = auto_alloc_array(machine, char, strlen(string) + 1);
char *str = strcopy;
diff --git a/src/emu/inputseq.h b/src/emu/inputseq.h
index aa1f65f841d..d0d344ee12d 100644
--- a/src/emu/inputseq.h
+++ b/src/emu/inputseq.h
@@ -71,33 +71,33 @@ struct _input_seq
/* ----- state queries ----- */
/* return TRUE if the given switch sequence has been pressed */
-int input_seq_pressed(running_machine *machine, const input_seq *seq);
+int input_seq_pressed(running_machine &machine, const input_seq *seq);
/* return the value of an axis sequence */
-INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr);
+INT32 input_seq_axis_value(running_machine &machine, const input_seq *seq, input_item_class *itemclass_ptr);
/* ----- sequence polling ----- */
/* begin polling for a new sequence of the given itemclass */
-void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq);
+void input_seq_poll_start(running_machine &machine, input_item_class itemclass, const input_seq *startseq);
/* continue polling for a sequence */
-int input_seq_poll(running_machine *machine, input_seq *finalseq);
+int input_seq_poll(running_machine &machine, input_seq *finalseq);
/* ----- strings and tokenization ----- */
/* generate the friendly name of an input sequence */
-astring &input_seq_name(running_machine *machine, astring &string, const input_seq *seq);
+astring &input_seq_name(running_machine &machine, astring &string, const input_seq *seq);
/* convert an input sequence to tokens, returning the length */
-astring &input_seq_to_tokens(running_machine *machine, astring &string, const input_seq *seq);
+astring &input_seq_to_tokens(running_machine &machine, astring &string, const input_seq *seq);
/* convert a set of tokens back to an input sequence */
-int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq);
+int input_seq_from_tokens(running_machine &machine, const char *string, input_seq *seq);
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 2ea6772b10a..31dcc31ca5c 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -258,13 +258,13 @@ const char *running_machine::describe_context()
void running_machine::start()
{
// initialize basic can't-fail systems here
- config_init(this);
- input_init(this);
- output_init(this);
- palette_init(this);
- m_render = auto_alloc(this, render_manager(*this));
- generic_machine_init(this);
- generic_sound_init(this);
+ config_init(*this);
+ input_init(*this);
+ output_init(*this);
+ palette_init(*this);
+ m_render = auto_alloc(*this, render_manager(*this));
+ generic_machine_init(*this);
+ generic_sound_init(*this);
// allocate a soft_reset timer
m_soft_reset_timer = m_scheduler.timer_alloc(MSTUB(timer_expired, running_machine, soft_reset), this);
@@ -273,8 +273,8 @@ void running_machine::start()
m_osd.init(*this);
// create the video manager
- m_video = auto_alloc(this, video_manager(*this));
- ui_init(this);
+ m_video = auto_alloc(*this, video_manager(*this));
+ ui_init(*this);
// initialize the base time (needed for doing record/playback)
::time(&m_base_time);
@@ -282,44 +282,44 @@ void running_machine::start()
// initialize the input system and input ports for the game
// this must be done before memory_init in order to allow specifying
// callbacks based on input port tags
- time_t newbase = input_port_init(this, m_system.ipt, m_config.m_devicelist);
+ time_t newbase = input_port_init(*this, m_system.ipt, m_config.m_devicelist);
if (newbase != 0)
m_base_time = newbase;
// intialize UI input
- ui_input_init(this);
+ ui_input_init(*this);
// initialize the streams engine before the sound devices start
- m_sound = auto_alloc(this, sound_manager(*this));
+ m_sound = auto_alloc(*this, sound_manager(*this));
// first load ROMs, then populate memory, and finally initialize CPUs
// these operations must proceed in this order
- rom_init(this);
- memory_init(this);
- watchdog_init(this);
+ rom_init(*this);
+ memory_init(*this);
+ watchdog_init(*this);
// must happen after memory_init because this relies on generic.spriteram
- generic_video_init(this);
+ generic_video_init(*this);
// allocate the gfx elements prior to device initialization
- gfx_init(this);
+ gfx_init(*this);
// initialize natural keyboard support
- inputx_init(this);
+ inputx_init(*this);
// initialize image devices
- image_init(this);
- tilemap_init(this);
- crosshair_init(this);
+ image_init(*this);
+ tilemap_init(*this);
+ crosshair_init(*this);
// initialize the debugger
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
- debugger_init(this);
+ debugger_init(*this);
// call the game driver's init function
// this is where decryption is done and memory maps are altered
// so this location in the init order is important
- ui_set_startup_text(this, "Initializing...", true);
+ ui_set_startup_text(*this, "Initializing...", true);
// start up the devices
m_devicelist.start_all();
@@ -334,7 +334,7 @@ void running_machine::start()
schedule_load("auto");
// set up the cheat engine
- m_cheat = auto_alloc(this, cheat_manager(*this));
+ m_cheat = auto_alloc(*this, cheat_manager(*this));
// disallow save state registrations starting here
m_state.allow_registration(false);
@@ -358,7 +358,7 @@ int running_machine::run(bool firstrun)
// if we have a logfile, set up the callback
if (options().log())
{
- m_logfile = auto_alloc(this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ m_logfile = auto_alloc(*this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr = m_logfile->open("error.log");
assert_always(filerr == FILERR_NONE, "unable to open log file");
add_logerror_callback(logfile_callback);
@@ -368,12 +368,12 @@ int running_machine::run(bool firstrun)
start();
// load the configuration settings and NVRAM
- bool settingsloaded = config_load_settings(this);
- nvram_load(this);
+ bool settingsloaded = config_load_settings(*this);
+ nvram_load(*this);
sound().ui_mute(false);
// display the startup screens
- ui_display_startup_screens(this, firstrun, !settingsloaded);
+ ui_display_startup_screens(*this, firstrun, !settingsloaded);
// perform a soft reset -- this takes us to the running phase
soft_reset(*this);
@@ -404,8 +404,8 @@ int running_machine::run(bool firstrun)
// save the NVRAM and configuration
sound().ui_mute(true);
- nvram_save(this);
- config_save_settings(this);
+ nvram_save(*this);
+ config_save_settings(*this);
}
catch (emu_fatalerror &fatal)
{
@@ -430,7 +430,7 @@ int running_machine::run(bool firstrun)
zip_file_cache_clear();
// close the logfile
- auto_free(this, m_logfile);
+ auto_free(*this, m_logfile);
return error;
}
@@ -445,7 +445,7 @@ void running_machine::schedule_exit()
if (m_exit_to_game_select && options().system_name()[0] != 0)
{
options().set_system_name("");
- ui_menu_force_game_select(this, &render().ui_container());
+ ui_menu_force_game_select(*this, &render().ui_container());
}
// otherwise, exit for real
@@ -610,7 +610,7 @@ memory_region *running_machine::region_alloc(const char *name, UINT32 length, UI
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
// allocate the region
- return &m_regionlist.append(name, *auto_alloc(this, memory_region(*this, name, length, width, endian)));
+ return &m_regionlist.append(name, *auto_alloc(*this, memory_region(*this, name, length, width, endian)));
}
@@ -651,7 +651,7 @@ void running_machine::add_notifier(machine_notification event, notify_callback c
void running_machine::add_logerror_callback(logerror_callback callback)
{
assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!");
- m_logerror_list.append(*auto_alloc(this, logerror_callback_item(callback)));
+ m_logerror_list.append(*auto_alloc(*this, logerror_callback_item(callback)));
}
@@ -877,7 +877,7 @@ memory_region::memory_region(running_machine &machine, const char *name, UINT32
m_endianness(endian)
{
assert(width == 1 || width == 2 || width == 4 || width == 8);
- m_base.u8 = auto_alloc_array(&machine, UINT8, length);
+ m_base.u8 = auto_alloc_array(machine, UINT8, length);
}
@@ -887,7 +887,7 @@ memory_region::memory_region(running_machine &machine, const char *name, UINT32
memory_region::~memory_region()
{
- auto_free(&m_machine, m_base.v);
+ auto_free(m_machine, m_base.v);
}
@@ -1026,7 +1026,7 @@ void driver_device::driver_start()
void driver_device::machine_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(m_machine);
}
@@ -1038,7 +1038,7 @@ void driver_device::machine_start()
void driver_device::sound_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(m_machine);
}
@@ -1050,7 +1050,7 @@ void driver_device::sound_start()
void driver_device::video_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(m_machine);
}
@@ -1072,7 +1072,7 @@ void driver_device::driver_reset()
void driver_device::machine_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(m_machine);
}
@@ -1084,7 +1084,7 @@ void driver_device::machine_reset()
void driver_device::sound_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(m_machine);
}
@@ -1096,7 +1096,7 @@ void driver_device::sound_reset()
void driver_device::video_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(m_machine);
}
@@ -1134,14 +1134,14 @@ void driver_device::device_start()
// call the game-specific init
if (m_config.m_system->driver_init != NULL)
- (*m_config.m_system->driver_init)(&m_machine);
+ (*m_config.m_system->driver_init)(m_machine);
// finish image devices init process
- image_postdevice_init(&m_machine);
+ image_postdevice_init(m_machine);
// call palette_init if present
if (m_config.m_palette_init != NULL)
- (*m_config.m_palette_init)(&m_machine, machine->region("proms")->base());
+ (*m_config.m_palette_init)(m_machine, m_machine.region("proms")->base());
// start the various pieces
driver_start();
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 775b416cf85..6caff360b51 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -112,31 +112,31 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// macros to wrap legacy callbacks
#define MACHINE_START_NAME(name) machine_start_##name
-#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
+#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(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(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(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(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(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(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)
@@ -153,11 +153,11 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// global allocation helpers
-#define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->respool(), t)
-#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->respool(), t)
-#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine *>(m)->respool(), t, c)
-#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine *>(m)->respool(), t, c)
-#define auto_free(m, v) pool_free(static_cast<running_machine *>(m)->respool(), v)
+#define auto_alloc(m, t) pool_alloc(static_cast<running_machine &>(m).respool(), t)
+#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine &>(m).respool(), t)
+#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine &>(m).respool(), t, c)
+#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine &>(m).respool(), t, c)
+#define auto_free(m, v) pool_free(static_cast<running_machine &>(m).respool(), v)
#define auto_bitmap_alloc(m, w, h, f) auto_alloc(m, bitmap_t(w, h, f))
#define auto_strdup(m, s) strcpy(auto_alloc_array(m, char, strlen(s) + 1), s)
@@ -197,8 +197,8 @@ typedef tagged_list<memory_region> region_list;
// legacy callback functions
-typedef void (*legacy_callback_func)(running_machine *machine);
-typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
+typedef void (*legacy_callback_func)(running_machine &machine);
+typedef void (*palette_init_func)(running_machine &machine, const UINT8 *color_prom);
@@ -315,7 +315,7 @@ class running_machine : public bindable_object
{
DISABLE_COPYING(running_machine);
- friend void debugger_init(running_machine *machine);
+ friend void debugger_init(running_machine &machine);
friend class sound_manager;
typedef void (*notify_callback)(running_machine &machine);
@@ -596,7 +596,7 @@ public:
{
// we clear here for historical reasons, as many existing driver states
// assume everything is NULL before starting
- return auto_alloc_clear(&machine, _DeviceClass(machine, *this));
+ return auto_alloc_clear(machine, _DeviceClass(machine, *this));
}
};
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index 2dcc0f938eb..caaf32460b5 100644
--- a/src/emu/machine/53c810.c
+++ b/src/emu/machine/53c810.c
@@ -42,15 +42,15 @@ static struct {
int halted;
int carry;
UINT32 (* fetch)(UINT32 dsp);
- void (* irq_callback)(running_machine *machine);
+ void (* irq_callback)(running_machine &machine);
void (* dma_callback)(UINT32, UINT32, int, int);
} lsi810;
-typedef void (*opcode_handler)(running_machine *machine);
-#define OPCODE_HANDLER(name) void name(running_machine *machine)
+typedef void (*opcode_handler)(running_machine &machine);
+#define OPCODE_HANDLER(name) void name(running_machine &machine)
static opcode_handler dma_opcode[256];
-INLINE UINT32 FETCH(running_machine *machine)
+INLINE UINT32 FETCH(running_machine &machine)
{
UINT32 r = intf->fetch(machine, lsi810.dsp);
lsi810.dsp += 4;
@@ -340,7 +340,7 @@ static int scripts_compute_branch(void)
return passed;
}
-static UINT32 scripts_get_jump_dest(running_machine *machine)
+static UINT32 scripts_get_jump_dest(running_machine &machine)
{
INT32 dsps;
UINT32 dest;
@@ -421,7 +421,7 @@ static OPCODE_HANDLER( dmaop_load )
-static void dma_exec(running_machine *machine)
+static void dma_exec(running_machine &machine)
{
lsi810.dma_icount = DMA_MAX_ICOUNT;
@@ -484,7 +484,7 @@ READ8_HANDLER( lsi53c810_reg_r )
// clear the interrupt on service
if(intf->irq_callback != NULL)
{
- intf->irq_callback(space->machine, 0);
+ intf->irq_callback(space->machine(), 0);
}
return lsi810.istat;
@@ -599,7 +599,7 @@ WRITE8_HANDLER( lsi53c810_reg_w )
lsi810.dsp |= data << 24;
lsi810.halted = 0;
if((lsi810.dmode & 0x1) == 0 && !lsi810.halted) {
- dma_exec(space->machine);
+ dma_exec(space->machine());
}
break;
case 0x34: /* SCRATCH A */
@@ -620,19 +620,19 @@ WRITE8_HANDLER( lsi53c810_reg_w )
if(lsi810.dcntl & 0x14 && !lsi810.halted) /* single-step & start DMA */
{
int op;
- lsi810.dcmd = FETCH(space->machine);
+ lsi810.dcmd = FETCH(space->machine());
op = (lsi810.dcmd >> 24) & 0xff;
- dma_opcode[op](space->machine);
+ dma_opcode[op](space->machine());
lsi810.istat |= 0x3; /* DMA interrupt pending */
lsi810.dstat |= 0x8; /* SSI (Single Step Interrupt) */
if(intf->irq_callback != NULL) {
- intf->irq_callback(space->machine, 1);
+ intf->irq_callback(space->machine(), 1);
}
}
else if(lsi810.dcntl & 0x04 && !lsi810.halted) /* manual start DMA */
{
- dma_exec(space->machine);
+ dma_exec(space->machine());
}
break;
case 0x40: /* SIEN0 */
@@ -672,7 +672,7 @@ static void add_opcode(UINT8 op, UINT8 mask, opcode_handler handler)
}
}
-void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface)
+void lsi53c810_init(running_machine &machine, const struct LSI53C810interface *interface)
{
int i;
@@ -766,12 +766,12 @@ void *lsi53c810_get_device(int id)
*
*************************************/
-static UINT32 lsi53c810_dasm_fetch(running_machine *machine, UINT32 pc)
+static UINT32 lsi53c810_dasm_fetch(running_machine &machine, UINT32 pc)
{
return intf->fetch(machine, pc);
}
-unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc)
+unsigned lsi53c810_dasm(running_machine &machine, char *buf, UINT32 pc)
{
unsigned result = 0;
const char *op_mnemonic = NULL;
diff --git a/src/emu/machine/53c810.h b/src/emu/machine/53c810.h
index 1d3b80772b3..3c49d8d0f15 100644
--- a/src/emu/machine/53c810.h
+++ b/src/emu/machine/53c810.h
@@ -6,12 +6,12 @@
struct LSI53C810interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine, int); /* IRQ callback */
- void (*dma_callback)(running_machine *machine, UINT32, UINT32, int, int); /* DMA callback */
- UINT32 (*fetch)(running_machine *machine, UINT32 dsp);
+ void (*irq_callback)(running_machine &machine, int); /* IRQ callback */
+ void (*dma_callback)(running_machine &machine, UINT32, UINT32, int, int); /* DMA callback */
+ UINT32 (*fetch)(running_machine &machine, UINT32 dsp);
};
-extern void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface);
+extern void lsi53c810_init(running_machine &machine, const struct LSI53C810interface *interface);
extern void lsi53c810_exit(const struct LSI53C810interface *interface);
extern void lsi53c810_read_data(int bytes, UINT8 *pData);
@@ -22,6 +22,6 @@ extern void *lsi53c810_get_device(int id);
READ8_HANDLER( lsi53c810_reg_r );
WRITE8_HANDLER( lsi53c810_reg_w );
-unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc);
+unsigned lsi53c810_dasm(running_machine &machine, char *buf, UINT32 pc);
#endif
diff --git a/src/emu/machine/6526cia.c b/src/emu/machine/6526cia.c
index a90652efded..00d74718e59 100644
--- a/src/emu/machine/6526cia.c
+++ b/src/emu/machine/6526cia.c
@@ -72,7 +72,7 @@ device_config *mos6526_device_config::static_alloc_device_config(const machine_c
device_t *mos6526_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mos6526_device(machine, *this));
+ return auto_alloc(machine, mos6526_device(machine, *this));
}
diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c
index 63437a2dfa5..426277e8e06 100644
--- a/src/emu/machine/6532riot.c
+++ b/src/emu/machine/6532riot.c
@@ -70,7 +70,7 @@ device_config *riot6532_device_config::static_alloc_device_config(const machine_
device_t *riot6532_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, riot6532_device(machine, *this));
+ return auto_alloc(machine, riot6532_device(machine, *this));
}
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index 03afe7986c2..94181f76459 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -66,7 +66,7 @@ device_config *pia6821_device_config::static_alloc_device_config(const machine_c
device_t *pia6821_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, pia6821_device(machine, *this));
+ return auto_alloc(machine, pia6821_device(machine, *this));
}
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c
index f12b48dc192..a053f1e432c 100644
--- a/src/emu/machine/68681.c
+++ b/src/emu/machine/68681.c
@@ -541,14 +541,14 @@ READ8_DEVICE_HANDLER(duart68681_r)
{
r = 0xff;
#if 0
- if (input_code_pressed(device->machine, KEYCODE_1)) r ^= 0x0001;
- if (input_code_pressed(device->machine, KEYCODE_2)) r ^= 0x0002;
- if (input_code_pressed(device->machine, KEYCODE_3)) r ^= 0x0004;
- if (input_code_pressed(device->machine, KEYCODE_4)) r ^= 0x0008;
- if (input_code_pressed(device->machine, KEYCODE_5)) r ^= 0x0010;
- if (input_code_pressed(device->machine, KEYCODE_6)) r ^= 0x0020;
- if (input_code_pressed(device->machine, KEYCODE_7)) r ^= 0x0040;
- if (input_code_pressed(device->machine, KEYCODE_8)) r ^= 0x0080;
+ if (input_code_pressed(device->machine(), KEYCODE_1)) r ^= 0x0001;
+ if (input_code_pressed(device->machine(), KEYCODE_2)) r ^= 0x0002;
+ if (input_code_pressed(device->machine(), KEYCODE_3)) r ^= 0x0004;
+ if (input_code_pressed(device->machine(), KEYCODE_4)) r ^= 0x0008;
+ if (input_code_pressed(device->machine(), KEYCODE_5)) r ^= 0x0010;
+ if (input_code_pressed(device->machine(), KEYCODE_6)) r ^= 0x0020;
+ if (input_code_pressed(device->machine(), KEYCODE_7)) r ^= 0x0040;
+ if (input_code_pressed(device->machine(), KEYCODE_8)) r ^= 0x0080;
#endif
}
break;
@@ -710,9 +710,9 @@ static DEVICE_START(duart68681)
duart68681->duart_config = (const duart68681_config *)device->baseconfig().static_config();
duart68681->device = device;
- duart68681->channel[0].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
- duart68681->channel[1].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
- duart68681->duart_timer = device->machine->scheduler().timer_alloc(FUNC(duart_timer_callback), (void*)device);
+ duart68681->channel[0].tx_timer = device->machine().scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
+ duart68681->channel[1].tx_timer = device->machine().scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
+ duart68681->duart_timer = device->machine().scheduler().timer_alloc(FUNC(duart_timer_callback), (void*)device);
device->save_item(NAME(duart68681->ACR));
device->save_item(NAME(duart68681->IMR));
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c
index 2ab8ff8619f..8a6338d7149 100644
--- a/src/emu/machine/74123.c
+++ b/src/emu/machine/74123.c
@@ -52,7 +52,7 @@ device_config *ttl74123_device_config::static_alloc_device_config(const machine_
device_t *ttl74123_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ttl74123_device(machine, *this));
+ return auto_alloc(machine, ttl74123_device(machine, *this));
}
diff --git a/src/emu/machine/74181.c b/src/emu/machine/74181.c
index 03c2478e490..dca07ad01fe 100644
--- a/src/emu/machine/74181.c
+++ b/src/emu/machine/74181.c
@@ -27,11 +27,11 @@ struct _TTL74181_state
static TTL74181_state chips[TTL74181_MAX_CHIPS];
-void TTL74181_config(running_machine *machine, int which, void *intf)
+void TTL74181_config(running_machine &machine, int which, void *intf)
{
TTL74181_state *c;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call at init time!");
assert_always(intf == 0, "Interface must be NULL");
assert_always((which >= 0) && (which < TTL74181_MAX_CHIPS), "Exceeded maximum number of 74181 chips");
diff --git a/src/emu/machine/74181.h b/src/emu/machine/74181.h
index e4f23dcd16e..5d15bdac9cf 100644
--- a/src/emu/machine/74181.h
+++ b/src/emu/machine/74181.h
@@ -33,7 +33,7 @@
#define TTL74181_OUTPUT_CN4 (7)
-void TTL74181_config(running_machine *machine, int chip, void *interface);
+void TTL74181_config(running_machine &machine, int chip, void *interface);
void TTL74181_reset(int chip);
void TTL74181_write(int chip, int startline, int lines, UINT8 data);
diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c
index 5e537210d89..3b92dab2463 100644
--- a/src/emu/machine/7474.c
+++ b/src/emu/machine/7474.c
@@ -80,7 +80,7 @@ device_config *ttl7474_device_config::static_alloc_device_config(const machine_c
device_t *ttl7474_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ttl7474_device(machine, *this));
+ return auto_alloc(machine, ttl7474_device(machine, *this));
}
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index 2bf3b3a8dfe..8d45e2005a8 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -204,9 +204,9 @@
static struct
{
kbdc8042_type_t type;
- void (*set_gate_a20)(running_machine *machine, int a20);
- void (*keyboard_interrupt)(running_machine *machine, int state);
- int (*get_out2)(running_machine *machine);
+ void (*set_gate_a20)(running_machine &machine, int a20);
+ void (*keyboard_interrupt)(running_machine &machine, int state);
+ int (*get_out2)(running_machine &machine);
UINT8 inport, outport, data, command;
@@ -234,7 +234,7 @@ static struct
static int poll_delay;
-static void at_8042_check_keyboard(running_machine *machine);
+static void at_8042_check_keyboard(running_machine &machine);
@@ -244,7 +244,7 @@ static void at_8042_check_keyboard(running_machine *machine);
***************************************************************************/
-static void at_8042_set_outport(running_machine *machine, UINT8 data, int initial)
+static void at_8042_set_outport(running_machine &machine, UINT8 data, int initial)
{
UINT8 change;
change = initial ? 0xFF : (kbdc8042.outport ^ data);
@@ -266,7 +266,7 @@ static TIMER_CALLBACK( kbdc8042_time )
-void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf)
+void kbdc8042_init(running_machine &machine, const struct kbdc8042_interface *intf)
{
poll_delay = 10;
memset(&kbdc8042, 0, sizeof(kbdc8042));
@@ -279,10 +279,10 @@ void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *in
kbdc8042.inport = 0xa0;
at_8042_set_outport(machine, 0xfe, 1);
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(kbdc8042_time));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(kbdc8042_time));
}
-static void at_8042_receive(running_machine *machine, UINT8 data)
+static void at_8042_receive(running_machine &machine, UINT8 data)
{
if (LOG_KEYBOARD)
logerror("at_8042_receive Received 0x%02x\n", data);
@@ -297,7 +297,7 @@ static void at_8042_receive(running_machine *machine, UINT8 data)
}
}
-static void at_8042_check_keyboard(running_machine *machine)
+static void at_8042_check_keyboard(running_machine &machine)
{
int data;
@@ -360,7 +360,7 @@ READ8_HANDLER(kbdc8042_8_r)
/* at386 self test doesn't like this */
at_8042_clear_keyboard_received();
}
- at_8042_check_keyboard(space->machine);
+ at_8042_check_keyboard(space->machine());
break;
case 1:
@@ -388,14 +388,14 @@ READ8_HANDLER(kbdc8042_8_r)
break;
case 2:
- if (kbdc8042.get_out2(space->machine))
+ if (kbdc8042.get_out2(space->machine()))
data |= 0x20;
else
data &= ~0x20;
break;
case 4:
- at_8042_check_keyboard(space->machine);
+ at_8042_check_keyboard(space->machine());
if (kbdc8042.keyboard.received || kbdc8042.mouse.received)
data |= 1;
@@ -441,7 +441,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
/* normal case */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine, data);
+ at_keyboard_write(space->machine(), data);
break;
case 1:
@@ -455,14 +455,14 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- keyboard clock (output)
* `------------ keyboard data (output)
*/
- at_8042_set_outport(space->machine, data, 0);
+ at_8042_set_outport(space->machine(), data, 0);
break;
case 2:
/* preceeded by writing 0xD2 to port 60h */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine, data);
+ at_keyboard_write(space->machine(), data);
break;
case 3:
@@ -506,13 +506,13 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.mouse.on = 1;
break;
case 0xa9: /* test mouse */
- at_8042_receive(space->machine, PS2_MOUSE_ON ? 0x00 : 0xff);
+ at_8042_receive(space->machine(), PS2_MOUSE_ON ? 0x00 : 0xff);
break;
case 0xaa: /* selftest */
- at_8042_receive(space->machine, 0x55);
+ at_8042_receive(space->machine(), 0x55);
break;
case 0xab: /* test keyboard */
- at_8042_receive(space->machine, KEYBOARD_ON ? 0x00 : 0xff);
+ at_8042_receive(space->machine(), KEYBOARD_ON ? 0x00 : 0xff);
break;
case 0xad: /* disable keyboard interface */
kbdc8042.keyboard.on = 0;
@@ -530,7 +530,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- 1=primary display is MDA, 0=CGA
* `------------ 1=keyboard not inhibited; 0=inhibited
*/
- at_8042_receive(space->machine, kbdc8042.inport);
+ at_8042_receive(space->machine(), kbdc8042.inport);
break;
case 0xc1: /* read input port 3..0 until write to 0x60 */
kbdc8042.status_read_mode = 1;
@@ -539,7 +539,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.status_read_mode = 2;
break;
case 0xd0: /* read output port */
- at_8042_receive(space->machine, kbdc8042.outport);
+ at_8042_receive(space->machine(), kbdc8042.outport);
break;
case 0xd1:
/* write output port; next byte written to port 60h is placed on
@@ -568,7 +568,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
break;
case 0xe0:
/* read test inputs; read T1/T0 test inputs into bit 1/0 */
- at_8042_receive(space->machine, 0x00);
+ at_8042_receive(space->machine(), 0x00);
break;
case 0xf0:
@@ -584,8 +584,8 @@ WRITE8_HANDLER(kbdc8042_8_w)
* the bits low set in the command byte. The only pulse that has
* an effect currently is bit 0, which pulses the CPU's reset line
*/
- device_set_input_line(space->machine->firstcpu, INPUT_LINE_RESET, PULSE_LINE);
- at_8042_set_outport(space->machine, kbdc8042.outport | 0x02, 0);
+ device_set_input_line(space->machine().firstcpu, INPUT_LINE_RESET, PULSE_LINE);
+ at_8042_set_outport(space->machine(), kbdc8042.outport | 0x02, 0);
break;
}
kbdc8042.sending = 1;
diff --git a/src/emu/machine/8042kbdc.h b/src/emu/machine/8042kbdc.h
index f6ec7b4c44c..35dc301d570 100644
--- a/src/emu/machine/8042kbdc.h
+++ b/src/emu/machine/8042kbdc.h
@@ -21,14 +21,14 @@ typedef enum
struct kbdc8042_interface
{
kbdc8042_type_t type;
- void (*set_gate_a20)(running_machine *machine, int a20);
- void (*keyboard_interrupt)(running_machine *machine, int state);
- int (*get_out2)(running_machine *machine);
+ void (*set_gate_a20)(running_machine &machine, int a20);
+ void (*keyboard_interrupt)(running_machine &machine, int state);
+ int (*get_out2)(running_machine &machine);
};
-void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf);
+void kbdc8042_init(running_machine &machine, const struct kbdc8042_interface *intf);
READ8_HANDLER(kbdc8042_8_r);
WRITE8_HANDLER(kbdc8042_8_w);
diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c
index 06ad3b4a3fc..6e14a262e32 100644
--- a/src/emu/machine/adc083x.c
+++ b/src/emu/machine/adc083x.c
@@ -11,7 +11,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine *machine, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine &machine, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -20,7 +20,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine *machin
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine ->describe_context( ), buf );
+ logerror( "%s: %s", machine.describe_context( ), buf );
}
}
@@ -116,7 +116,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(), state );
}
if( adc083x->cs == 0 && state != 0 )
@@ -234,7 +234,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(), state );
}
if( adc083x->cs == 0 )
@@ -246,7 +246,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() );
adc083x->state = STATE_SHIFT_MUX;
adc083x->sars = 0;
adc083x->sgl = 0;
@@ -257,7 +257,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() );
}
break;
@@ -269,7 +269,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(), adc083x->sgl );
break;
case 1:
@@ -277,7 +277,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(), adc083x->odd );
break;
case 2:
@@ -285,7 +285,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(), adc083x->sel1 );
break;
case 3:
@@ -293,7 +293,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(), adc083x->sel0 );
break;
}
@@ -309,11 +309,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() );
}
else
{
- verboselog( 1, device->machine, "adc083x %s got se\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s got se\n", device->tag() );
adc083x->state = STATE_OUTPUT_LSB_FIRST;
adc083x->bit = 1;
}
@@ -326,7 +326,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() );
adc083x->output = adc083x_conversion( device );
adc083x->state = STATE_OUTPUT_MSB_FIRST;
adc083x->bit = 7;
@@ -336,7 +336,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(), adc083x->bit, adc083x->_do );
adc083x->bit--;
if( adc083x->bit < 0 )
@@ -354,7 +354,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(), adc083x->bit, adc083x->_do );
adc083x->bit++;
if( adc083x->bit == 8 )
@@ -384,7 +384,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(), state );
}
adc083x->di = state;
@@ -400,7 +400,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(), state );
}
adc083x->se = state;
@@ -414,7 +414,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(), adc083x->sars );
return adc083x->sars;
}
@@ -426,7 +426,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(), adc083x->_do );
return adc083x->_do;
}
diff --git a/src/emu/machine/am53cf96.c b/src/emu/machine/am53cf96.c
index 1119175f14b..5d02656167f 100644
--- a/src/emu/machine/am53cf96.c
+++ b/src/emu/machine/am53cf96.c
@@ -159,10 +159,10 @@ WRITE32_HANDLER( am53cf96_w )
case 3: // reset SCSI bus
scsi_regs[REG_INTSTATE] = 4; // command sent OK
xfer_state = 0;
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
break;
case 0x42: // select with ATN steps
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
if ((fifo[1] == 0) || (fifo[1] == 0x48) || (fifo[1] == 0x4b))
{
scsi_regs[REG_INTSTATE] = 6;
@@ -192,7 +192,7 @@ WRITE32_HANDLER( am53cf96_w )
case 0x10: // information transfer (must not change xfer_state)
case 0x11: // second phase of information transfer
case 0x12: // message accepted
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
scsi_regs[REG_INTSTATE] = 6; // command sent OK
break;
default:
@@ -208,7 +208,7 @@ WRITE32_HANDLER( am53cf96_w )
}
}
-void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface )
+void am53cf96_init( running_machine &machine, const struct AM53CF96interface *interface )
{
int i;
diff --git a/src/emu/machine/am53cf96.h b/src/emu/machine/am53cf96.h
index 1eeb728bb63..df74b4a80aa 100644
--- a/src/emu/machine/am53cf96.h
+++ b/src/emu/machine/am53cf96.h
@@ -11,10 +11,10 @@
struct AM53CF96interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine); /* irq callback */
+ void (*irq_callback)(running_machine &machine); /* irq callback */
};
-extern void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface );
+extern void am53cf96_init( running_machine &machine, const struct AM53CF96interface *interface );
extern void am53cf96_exit( const struct AM53CF96interface *interface );
extern void am53cf96_read_data(int bytes, UINT8 *pData);
void am53cf96_write_data(int bytes, UINT8 *pData);
diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c
index f7418af244d..ff7bc172ddc 100644
--- a/src/emu/machine/at28c16.c
+++ b/src/emu/machine/at28c16.c
@@ -63,7 +63,7 @@ device_config *at28c16_device_config::static_alloc_device_config( const machine_
device_t *at28c16_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, at28c16_device( machine, *this ) );
+ return auto_alloc( machine, at28c16_device( machine, *this ) );
}
@@ -187,7 +187,7 @@ void at28c16_device::nvram_default()
void at28c16_device::nvram_read( emu_file &file )
{
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
file.read( buffer, AT28C16_TOTAL_BYTES );
@@ -196,7 +196,7 @@ void at28c16_device::nvram_read( emu_file &file )
m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
}
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
//-------------------------------------------------
@@ -206,7 +206,7 @@ void at28c16_device::nvram_read( emu_file &file )
void at28c16_device::nvram_write( emu_file &file )
{
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
{
@@ -215,7 +215,7 @@ void at28c16_device::nvram_write( emu_file &file )
file.write( buffer, AT28C16_TOTAL_BYTES );
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
@@ -233,11 +233,11 @@ void at28c16_device::write( offs_t offset, UINT8 data )
{
if( m_last_write >= 0 )
{
-// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine.describe_context(), offset, data );
}
else if( m_oe_12v )
{
-// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine.describe_context(), offset, data );
if( m_last_write < 0 )
{
for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
@@ -256,7 +256,7 @@ void at28c16_device::write( offs_t offset, UINT8 data )
offset += AT28C16_ID_BYTES;
}
-// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine.describe_context(), offset, data );
if( m_last_write < 0 && m_addrspace[ 0 ]->read_byte( offset ) != data )
{
m_addrspace[ 0 ]->write_byte( offset, data );
@@ -277,7 +277,7 @@ UINT8 at28c16_device::read( offs_t offset )
if( m_last_write >= 0 )
{
UINT8 data = m_last_write ^ 0x80;
-// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine.describe_context(), offset, data );
return data;
}
else
@@ -288,7 +288,7 @@ UINT8 at28c16_device::read( offs_t offset )
}
UINT8 data = m_addrspace[ 0 ]->read_byte( offset );
-// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine.describe_context(), offset, data );
return data;
}
}
@@ -304,7 +304,7 @@ void at28c16_device::set_a9_12v( int state )
state &= 1;
if( m_a9_12v != state )
{
-// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine->describe_context(), state );
+// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine.describe_context(), state );
m_a9_12v = state;
}
}
@@ -320,7 +320,7 @@ void at28c16_device::set_oe_12v( int state )
state &= 1;
if( m_oe_12v != state )
{
-// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine->describe_context(), state );
+// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine.describe_context(), state );
m_oe_12v = state;
}
}
diff --git a/src/emu/machine/cdp1852.c b/src/emu/machine/cdp1852.c
index fe98f13d53b..a5e4ea0783a 100644
--- a/src/emu/machine/cdp1852.c
+++ b/src/emu/machine/cdp1852.c
@@ -165,7 +165,7 @@ static DEVICE_START( cdp1852 )
if (device->clock() > 0)
{
/* create the scan timer */
- cdp1852->scan_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1852_scan_tick), (void *)device);
+ cdp1852->scan_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1852_scan_tick), (void *)device);
cdp1852->scan_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock()));
}
diff --git a/src/emu/machine/cr589.c b/src/emu/machine/cr589.c
index ed4a9ad00f1..1297b3a893a 100644
--- a/src/emu/machine/cr589.c
+++ b/src/emu/machine/cr589.c
@@ -110,7 +110,7 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0;
diff --git a/src/emu/machine/devhelpr.h b/src/emu/machine/devhelpr.h
index 8d35dc7a295..97ee11a08d4 100644
--- a/src/emu/machine/devhelpr.h
+++ b/src/emu/machine/devhelpr.h
@@ -47,7 +47,7 @@
{ return global_alloc(devname##_device_config(mconfig, tag, owner, clock)); } \
\
device_t *devname##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(&machine, devname##_device(machine, *this)); }
+ { return auto_alloc(machine, devname##_device(machine, *this)); }
#define GENERIC_DEVICE_DERIVED_CONFIG(basename, devname) \
class devname##_device_config : public basename##_device_config \
diff --git a/src/emu/machine/ds1302.c b/src/emu/machine/ds1302.c
index 6b59a0d6a09..63b732d446b 100644
--- a/src/emu/machine/ds1302.c
+++ b/src/emu/machine/ds1302.c
@@ -70,7 +70,7 @@ device_config *ds1302_device_config::static_alloc_device_config(const machine_co
device_t *ds1302_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds1302_device(machine, *this));
+ return auto_alloc(machine, ds1302_device(machine, *this));
}
diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c
index 412a78a483e..2902a033c03 100644
--- a/src/emu/machine/ds2401.c
+++ b/src/emu/machine/ds2401.c
@@ -20,7 +20,7 @@ inline void ATTR_PRINTF(3,4) ds2401_device::verboselog(int n_level, const char *
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("ds2401 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("ds2401 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -38,7 +38,7 @@ device_config *ds2401_device_config::static_alloc_device_config(const machine_co
device_t *ds2401_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds2401_device(machine, *this));
+ return auto_alloc(machine, ds2401_device(machine, *this));
}
ds2401_device::ds2401_device(running_machine &_machine, const ds2401_device_config &_config)
diff --git a/src/emu/machine/ds2404.c b/src/emu/machine/ds2404.c
index e834744d557..c16ca1b5ca7 100644
--- a/src/emu/machine/ds2404.c
+++ b/src/emu/machine/ds2404.c
@@ -47,7 +47,7 @@ device_config *ds2404_device_config::static_alloc_device_config(const machine_co
device_t *ds2404_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds2404_device(machine, *this));
+ return auto_alloc(machine, ds2404_device(machine, *this));
}
diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c
index 27c95819464..5c5a3bbe9e0 100644
--- a/src/emu/machine/eeprom.c
+++ b/src/emu/machine/eeprom.c
@@ -104,7 +104,7 @@ device_config *eeprom_device_config::static_alloc_device_config(const machine_co
device_t *eeprom_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, eeprom_device(machine, *this));
+ return auto_alloc(machine, eeprom_device(machine, *this));
}
@@ -302,11 +302,11 @@ void eeprom_device::nvram_read(emu_file &file)
UINT32 eeprom_length = 1 << m_config.m_address_bits;
UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
- UINT8 *buffer = auto_alloc_array(&m_machine, UINT8, eeprom_bytes);
+ UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
file.read(buffer, eeprom_bytes);
for (offs_t offs = 0; offs < eeprom_bytes; offs++)
m_addrspace[0]->write_byte(offs, buffer[offs]);
- auto_free(&m_machine, buffer);
+ auto_free(m_machine, buffer);
}
@@ -320,11 +320,11 @@ void eeprom_device::nvram_write(emu_file &file)
UINT32 eeprom_length = 1 << m_config.m_address_bits;
UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
- UINT8 *buffer = auto_alloc_array(&m_machine, UINT8, eeprom_bytes);
+ UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
for (offs_t offs = 0; offs < eeprom_bytes; offs++)
buffer[offs] = m_addrspace[0]->read_byte(offs);
file.write(buffer, eeprom_bytes);
- auto_free(&m_machine, buffer);
+ auto_free(m_machine, buffer);
}
diff --git a/src/emu/machine/er2055.c b/src/emu/machine/er2055.c
index ff7879a19ff..ddf735fe3a0 100644
--- a/src/emu/machine/er2055.c
+++ b/src/emu/machine/er2055.c
@@ -87,7 +87,7 @@ device_config *er2055_device_config::static_alloc_device_config(const machine_co
device_t *er2055_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, er2055_device(machine, *this));
+ return auto_alloc(machine, er2055_device(machine, *this));
}
diff --git a/src/emu/machine/f3853.c b/src/emu/machine/f3853.c
index 0cb2db9bb20..98040b3fd9d 100644
--- a/src/emu/machine/f3853.c
+++ b/src/emu/machine/f3853.c
@@ -68,7 +68,7 @@ device_config *f3853_device_config::static_alloc_device_config(const machine_con
device_t *f3853_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, f3853_device(machine, *this));
+ return auto_alloc(machine, f3853_device(machine, *this));
}
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 8d595230f07..c7a5a4a0c0e 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -19,8 +19,8 @@
FUNCTION PROTOTYPES
***************************************************************************/
-static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void counters_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void counters_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static void interrupt_reset(running_machine &machine);
@@ -58,7 +58,7 @@ struct _generic_machine_private
INLINE int interrupt_enabled(device_t *device)
{
- generic_machine_private *state = device->machine->generic_machine_data;
+ generic_machine_private *state = device->machine().generic_machine_data;
for (int index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++)
if (state->interrupt_device[index] == device)
return state->interrupt_enable[index];
@@ -76,14 +76,14 @@ INLINE int interrupt_enabled(device_t *device)
register for save states
-------------------------------------------------*/
-void generic_machine_init(running_machine *machine)
+void generic_machine_init(running_machine &machine)
{
generic_machine_private *state;
int counternum;
/* allocate our state */
- machine->generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
- state = machine->generic_machine_data;
+ machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
+ state = machine.generic_machine_data;
/* reset coin counters */
for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
@@ -96,29 +96,29 @@ void generic_machine_init(running_machine *machine)
memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine->m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
state->interrupt_device[index++] = &exec->device();
/* register coin save state */
- machine->state().save_item(NAME(state->coin_count));
- machine->state().save_item(NAME(state->coinlockedout));
- machine->state().save_item(NAME(state->lastcoin));
+ machine.state().save_item(NAME(state->coin_count));
+ machine.state().save_item(NAME(state->coinlockedout));
+ machine.state().save_item(NAME(state->lastcoin));
/* reset memory card info */
state->memcard_inserted = -1;
/* register a reset callback and save state for interrupt enable */
- machine->add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
- machine->state().save_item(NAME(state->interrupt_enable));
+ machine.add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
+ machine.state().save_item(NAME(state->interrupt_enable));
/* register for configuration */
config_register(machine, "counters", counters_load, counters_save);
/* for memory cards, request save state and an exit callback */
- if (machine->config().m_memcard_handler != NULL)
+ if (machine.config().m_memcard_handler != NULL)
{
state_save_register_global(machine, state->memcard_inserted);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
}
}
@@ -133,9 +133,9 @@ void generic_machine_init(running_machine *machine)
tickets dispensed
-------------------------------------------------*/
-int get_dispensed_tickets(running_machine *machine)
+int get_dispensed_tickets(running_machine &machine)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
return state->dispensed_tickets;
}
@@ -145,9 +145,9 @@ int get_dispensed_tickets(running_machine *machine)
number of dispensed tickets
-------------------------------------------------*/
-void increment_dispensed_tickets(running_machine *machine, int delta)
+void increment_dispensed_tickets(running_machine &machine, int delta)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
state->dispensed_tickets += delta;
}
@@ -162,9 +162,9 @@ void increment_dispensed_tickets(running_machine *machine, int delta)
and tickets
-------------------------------------------------*/
-static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void counters_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
xml_data_node *coinnode, *ticketnode;
/* on init, reset the counters */
@@ -202,9 +202,9 @@ static void counters_load(running_machine *machine, int config_type, xml_data_no
and tickets
-------------------------------------------------*/
-static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void counters_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
int i;
/* only care about game-specific data */
@@ -237,9 +237,9 @@ static void counters_save(running_machine *machine, int config_type, xml_data_no
coin_counter_w - sets input for coin counter
-------------------------------------------------*/
-void coin_counter_w(running_machine *machine, int num, int on)
+void coin_counter_w(running_machine &machine, int num, int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return;
@@ -255,9 +255,9 @@ void coin_counter_w(running_machine *machine, int num, int on)
for a given coin
-------------------------------------------------*/
-int coin_counter_get_count(running_machine *machine, int num)
+int coin_counter_get_count(running_machine &machine, int num)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return 0;
return state->coin_count[num];
@@ -268,9 +268,9 @@ int coin_counter_get_count(running_machine *machine, int num)
coin_lockout_w - locks out one coin input
-------------------------------------------------*/
-void coin_lockout_w(running_machine *machine, int num,int on)
+void coin_lockout_w(running_machine &machine, int num,int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return;
state->coinlockedout[num] = on;
@@ -282,9 +282,9 @@ void coin_lockout_w(running_machine *machine, int num,int on)
state for a particular coin
-------------------------------------------------*/
-int coin_lockout_get_state(running_machine *machine, int num)
+int coin_lockout_get_state(running_machine &machine, int num)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return FALSE;
return state->coinlockedout[num];
@@ -296,9 +296,9 @@ int coin_lockout_get_state(running_machine *machine, int num)
inputs
-------------------------------------------------*/
-void coin_lockout_global_w(running_machine *machine, int on)
+void coin_lockout_global_w(running_machine &machine, int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
int i;
for (i = 0; i < ARRAY_LENGTH(state->coinlockedout); i++)
@@ -315,20 +315,20 @@ void coin_lockout_global_w(running_machine *machine, int on)
nvram_load - load a system's NVRAM
-------------------------------------------------*/
-void nvram_load(running_machine *machine)
+void nvram_load(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
+ if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
- emu_file file(machine->options().nvram_directory(), OPEN_FLAG_READ);
- if (file.open(machine->basename(), ".nv") == FILERR_NONE)
+ emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ);
+ if (file.open(machine.basename(), ".nv") == FILERR_NONE)
{
// read data from general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, &file, FALSE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, &file, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -339,8 +339,8 @@ void nvram_load(running_machine *machine)
else
{
// initialize via the general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, NULL, FALSE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, NULL, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -353,20 +353,20 @@ void nvram_load(running_machine *machine)
nvram_save - save a system's NVRAM
-------------------------------------------------*/
-void nvram_save(running_machine *machine)
+void nvram_save(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
+ if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
- emu_file file(machine->options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- if (file.open(machine->basename(), ".nv") == FILERR_NONE)
+ emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open(machine.basename(), ".nv") == FILERR_NONE)
{
// write data via general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, &file, TRUE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, &file, TRUE);
// find all devices with NVRAM handlers, and tell them to write next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -396,7 +396,7 @@ INLINE void memcard_name(int index, char *buffer)
the given index
-------------------------------------------------*/
-int memcard_create(running_machine *machine, int index, int overwrite)
+int memcard_create(running_machine &machine, int index, int overwrite)
{
char name[16];
@@ -404,23 +404,23 @@ int memcard_create(running_machine *machine, int index, int overwrite)
memcard_name(index, name);
/* if we can't overwrite, fail if the file already exists */
- astring fname(machine->basename(), PATH_SEPARATOR, name);
+ astring fname(machine.basename(), PATH_SEPARATOR, name);
if (!overwrite)
{
- emu_file testfile(machine->options().memcard_directory(), OPEN_FLAG_READ);
+ emu_file testfile(machine.options().memcard_directory(), OPEN_FLAG_READ);
if (testfile.open(fname) == FILERR_NONE)
return 1;
}
/* create a new file */
- emu_file file(machine->options().memcard_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().memcard_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname);
if (filerr != FILERR_NONE)
return 1;
/* initialize and then save the card */
- if (machine->config().m_memcard_handler)
- (*machine->config().m_memcard_handler)(machine, file, MEMCARD_CREATE);
+ if (machine.config().m_memcard_handler)
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_CREATE);
/* close the file */
return 0;
@@ -432,28 +432,28 @@ int memcard_create(running_machine *machine, int index, int overwrite)
with the given index
-------------------------------------------------*/
-int memcard_insert(running_machine *machine, int index)
+int memcard_insert(running_machine &machine, int index)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
char name[16];
/* if a card is already inserted, eject it first */
if (state->memcard_inserted != -1)
- memcard_eject(*machine);
+ memcard_eject(machine);
assert(state->memcard_inserted == -1);
/* create a name */
memcard_name(index, name);
/* open the file; if we can't, it's an error */
- emu_file file(machine->options().memcard_directory(), OPEN_FLAG_READ);
- file_error filerr = file.open(machine->basename(), PATH_SEPARATOR, name);
+ emu_file file(machine.options().memcard_directory(), OPEN_FLAG_READ);
+ file_error filerr = file.open(machine.basename(), PATH_SEPARATOR, name);
if (filerr != FILERR_NONE)
return 1;
/* initialize and then load the card */
- if (machine->config().m_memcard_handler)
- (*machine->config().m_memcard_handler)(machine, file, MEMCARD_INSERT);
+ if (machine.config().m_memcard_handler)
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_INSERT);
/* close the file */
state->memcard_inserted = index;
@@ -486,7 +486,7 @@ void memcard_eject(running_machine &machine)
/* initialize and then load the card */
if (machine.config().m_memcard_handler)
- (*machine.config().m_memcard_handler)(&machine, file, MEMCARD_EJECT);
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_EJECT);
/* close the file */
state->memcard_inserted = -1;
@@ -498,9 +498,9 @@ void memcard_eject(running_machine &machine)
card index, or -1 if none
-------------------------------------------------*/
-int memcard_present(running_machine *machine)
+int memcard_present(running_machine &machine)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
return state->memcard_inserted;
}
@@ -514,7 +514,7 @@ int memcard_present(running_machine *machine)
set_led_status - set the state of a given LED
-------------------------------------------------*/
-void set_led_status(running_machine *machine, int num, int on)
+void set_led_status(running_machine &machine, int num, int on)
{
output_set_led_value(num, on);
}
@@ -585,7 +585,7 @@ void generic_pulse_irq_line(device_t *device, int irqline)
cpu_device *cpudevice = downcast<cpu_device *>(device);
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
- device->machine->scheduler().timer_set(target_time - device->machine->time(), FUNC(irq_pulse_clear), irqline, (void *)device);
+ device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device);
}
@@ -602,7 +602,7 @@ void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector
cpu_device *cpudevice = downcast<cpu_device *>(device);
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
- device->machine->scheduler().timer_set(target_time - device->machine->time(), FUNC(irq_pulse_clear), irqline, (void *)device);
+ device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device);
}
@@ -615,7 +615,7 @@ void cpu_interrupt_enable(device_t *device, int enabled)
{
cpu_device *cpudevice = downcast<cpu_device *>(device);
- generic_machine_private *state = device->machine->generic_machine_data;
+ generic_machine_private *state = device->machine().generic_machine_data;
int index;
for (index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++)
if (state->interrupt_device[index] == device)
@@ -628,7 +628,7 @@ void cpu_interrupt_enable(device_t *device, int enabled)
/* make sure there are no queued interrupts */
if (enabled == 0)
- device->machine->scheduler().synchronize(FUNC(clear_all_lines), 0, (void *)cpudevice);
+ device->machine().scheduler().synchronize(FUNC(clear_all_lines), 0, (void *)cpudevice);
}
@@ -713,24 +713,24 @@ INTERRUPT_GEN( irq7_line_assert ) { if (interrupt_enabled(device)) device_set_in
8-bit reset read/write handlers
-------------------------------------------------*/
-WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(space->machine); }
-READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(space->machine()); }
+READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(space->machine()); return space->unmap(); }
/*-------------------------------------------------
16-bit reset read/write handlers
-------------------------------------------------*/
-WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(space->machine); }
-READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(space->machine()); }
+READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(space->machine()); return space->unmap(); }
/*-------------------------------------------------
32-bit reset read/write handlers
-------------------------------------------------*/
-WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(space->machine); }
-READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(space->machine()); }
+READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine()); return space->unmap(); }
@@ -748,5 +748,5 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine); return sp
CUSTOM_INPUT( custom_port_read )
{
const char *tag = (const char *)param;
- return input_port_read(field->port->machine, tag);
+ return input_port_read(field->port->machine(), tag);
}
diff --git a/src/emu/machine/generic.h b/src/emu/machine/generic.h
index 565a14ff679..3cc006c5e5e 100644
--- a/src/emu/machine/generic.h
+++ b/src/emu/machine/generic.h
@@ -38,69 +38,69 @@
/* ----- initialization ----- */
/* set up all the common systems */
-void generic_machine_init(running_machine *machine);
+void generic_machine_init(running_machine &machine);
/* ----- tickets ----- */
/* return the number of tickets dispensed */
-int get_dispensed_tickets(running_machine *machine);
+int get_dispensed_tickets(running_machine &machine);
/* increment the number of dispensed tickets */
-void increment_dispensed_tickets(running_machine *machine, int delta);
+void increment_dispensed_tickets(running_machine &machine, int delta);
/* ----- coin counters ----- */
/* write to a particular coin counter (clocks on active high edge) */
-void coin_counter_w(running_machine *machine, int num, int on);
+void coin_counter_w(running_machine &machine, int num, int on);
/* return the coin count for a given coin */
-int coin_counter_get_count(running_machine *machine, int num);
+int coin_counter_get_count(running_machine &machine, int num);
/* enable/disable coin lockout for a particular coin */
-void coin_lockout_w(running_machine *machine, int num, int on);
+void coin_lockout_w(running_machine &machine, int num, int on);
/* return current lockout state for a particular coin */
-int coin_lockout_get_state(running_machine *machine, int num);
+int coin_lockout_get_state(running_machine &machine, int num);
/* enable/disable global coin lockout */
-void coin_lockout_global_w(running_machine *machine, int on);
+void coin_lockout_global_w(running_machine &machine, int on);
/* ----- NVRAM management ----- */
/* load NVRAM from a file */
-void nvram_load(running_machine *machine);
+void nvram_load(running_machine &machine);
/* save NVRAM to a file */
-void nvram_save(running_machine *machine);
+void nvram_save(running_machine &machine);
/* ----- memory card management ----- */
/* create a new memory card with the given index */
-int memcard_create(running_machine *machine, int index, int overwrite);
+int memcard_create(running_machine &machine, int index, int overwrite);
/* "insert" a memory card with the given index and load its data */
-int memcard_insert(running_machine *machine, int index);
+int memcard_insert(running_machine &machine, int index);
/* "eject" a memory card and save its data */
void memcard_eject(running_machine &machine);
/* returns the index of the current memory card, or -1 if none */
-int memcard_present(running_machine *machine);
+int memcard_present(running_machine &machine);
/* ----- miscellaneous bits & pieces ----- */
/* set the status of an LED */
-void set_led_status(running_machine *machine, int num, int value);
+void set_led_status(running_machine &machine, int num, int value);
diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c
index 88dd45e805f..063030d6b23 100644
--- a/src/emu/machine/i2cmem.c
+++ b/src/emu/machine/i2cmem.c
@@ -47,7 +47,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: I2CMEM(%s) %s", device->machine ->describe_context( ), device->tag(), buf );
+ logerror( "%s: I2CMEM(%s) %s", device->machine().describe_context( ), device->tag(), buf );
}
}
@@ -106,7 +106,7 @@ device_config *i2cmem_device_config::static_alloc_device_config( const machine_c
device_t *i2cmem_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, i2cmem_device( machine, *this ) );
+ return auto_alloc( machine, i2cmem_device( machine, *this ) );
}
@@ -182,7 +182,7 @@ i2cmem_device::i2cmem_device( running_machine &_machine, const i2cmem_device_con
{
if( m_config.m_page_size > 0 )
{
- m_page = auto_alloc_array( machine, UINT8, m_config.m_page_size );
+ m_page = auto_alloc_array( m_machine, UINT8, m_config.m_page_size );
}
}
@@ -262,7 +262,7 @@ void i2cmem_device::nvram_default()
void i2cmem_device::nvram_read( emu_file &file )
{
int i2cmem_bytes = m_config.m_data_size;
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, i2cmem_bytes );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
file.read( buffer, i2cmem_bytes );
@@ -271,7 +271,7 @@ void i2cmem_device::nvram_read( emu_file &file )
m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
}
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
//-------------------------------------------------
@@ -282,7 +282,7 @@ void i2cmem_device::nvram_read( emu_file &file )
void i2cmem_device::nvram_write( emu_file &file )
{
int i2cmem_bytes = m_config.m_data_size;
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, i2cmem_bytes );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
{
@@ -291,7 +291,7 @@ void i2cmem_device::nvram_write( emu_file &file )
file.write( buffer, i2cmem_bytes );
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
diff --git a/src/emu/machine/i8155.c b/src/emu/machine/i8155.c
index 8b6bcfa9cfd..3726e766029 100644
--- a/src/emu/machine/i8155.c
+++ b/src/emu/machine/i8155.c
@@ -138,7 +138,7 @@ device_config *i8155_device_config::static_alloc_device_config(const machine_con
device_t *i8155_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, i8155_device(machine, *this));
+ return auto_alloc(machine, i8155_device(machine, *this));
}
diff --git a/src/emu/machine/i8355.c b/src/emu/machine/i8355.c
index 6c305793710..10671198227 100644
--- a/src/emu/machine/i8355.c
+++ b/src/emu/machine/i8355.c
@@ -83,7 +83,7 @@ device_config *i8355_device_config::static_alloc_device_config(const machine_con
device_t *i8355_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, i8355_device(machine, *this));
+ return auto_alloc(machine, i8355_device(machine, *this));
}
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 91e5a710dc1..106c4bb5470 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -258,9 +258,9 @@ INLINE void signal_delayed_interrupt(ide_state *ide, attotime time, int buffer_r
/* set a timer */
if (buffer_ready)
- ide->device->machine->scheduler().timer_set(time, FUNC(delayed_interrupt_buffer_ready), 0, ide);
+ ide->device->machine().scheduler().timer_set(time, FUNC(delayed_interrupt_buffer_ready), 0, ide);
else
- ide->device->machine->scheduler().timer_set(time, FUNC(delayed_interrupt), 0, ide);
+ ide->device->machine().scheduler().timer_set(time, FUNC(delayed_interrupt), 0, ide);
}
@@ -625,7 +625,7 @@ static void security_error(ide_state *ide)
ide->status &= ~IDE_STATUS_DRIVE_READY;
/* just set a timer and mark ourselves error */
- ide->device->machine->scheduler().timer_set(TIME_SECURITY_ERROR, FUNC(security_error_done), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_SECURITY_ERROR, FUNC(security_error_done), 0, ide);
}
@@ -806,10 +806,10 @@ static void read_first_sector(ide_state *ide)
seek_time = TIME_SEEK_MULTISECTOR;
ide->cur_lba = new_lba;
- ide->device->machine->scheduler().timer_set(seek_time, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(seek_time, FUNC(read_sector_done_callback), 0, ide);
}
else
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
}
@@ -825,11 +825,11 @@ static void read_next_sector(ide_state *ide)
read_sector_done(ide);
else
/* just set a timer */
- ide->device->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(read_sector_done_callback), 0, ide);
}
else
/* just set a timer */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
}
@@ -862,13 +862,13 @@ static void continue_write(ide_state *ide)
else
{
/* set a timer to do the write */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
}
}
else
{
/* set a timer to do the write */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
}
}
@@ -1224,7 +1224,7 @@ static void handle_command(ide_state *ide, UINT8 command)
default:
LOGPRINT(("IDE unknown command (%02X)\n", command));
- debugger_break(ide->device->machine);
+ debugger_break(ide->device->machine());
break;
}
}
@@ -1244,7 +1244,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* logit */
// if (BANK(bank, offset) != IDE_BANK0_DATA && BANK(bank, offset) != IDE_BANK0_STATUS_COMMAND && BANK(bank, offset) != IDE_BANK1_STATUS_CONTROL)
- LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine->describe_context(), bank, offset, size));
+ LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine().describe_context(), bank, offset, size));
switch (BANK(bank, offset))
{
@@ -1279,7 +1279,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
- LOG(("%s:IDE completed PIO read\n", device->machine->describe_context()));
+ LOG(("%s:IDE completed PIO read\n", device->machine().describe_context()));
continue_read(ide);
}
}
@@ -1330,7 +1330,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* log anything else */
default:
- logerror("%s:unknown IDE read at %03X, size=%d\n", device->machine->describe_context(), offset, size);
+ logerror("%s:unknown IDE read at %03X, size=%d\n", device->machine().describe_context(), offset, size);
break;
}
@@ -1352,7 +1352,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* logit */
if (BANK(bank, offset) != IDE_BANK0_DATA)
- LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", device->machine->describe_context(), bank, offset, data, size));
+ LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", device->machine().describe_context(), bank, offset, data, size));
// fprintf(stderr, "ide write %03x %02x size=%d\n", offset, data, size);
switch (BANK(bank, offset))
{
@@ -1389,7 +1389,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
- LOG(("%s:IDE completed PIO write\n", device->machine->describe_context()));
+ LOG(("%s:IDE completed PIO write\n", device->machine().describe_context()));
if (ide->command == IDE_COMMAND_SECURITY_UNLOCK)
{
if (ide->user_password_enable && memcmp(ide->buffer, ide->user_password, 2 + 32) == 0)
@@ -1518,7 +1518,7 @@ static UINT32 ide_bus_master_read(device_t *device, offs_t offset, int size)
{
ide_state *ide = get_safe_token(device);
- LOG(("%s:ide_bus_master_read(%d, %d)\n", device->machine->describe_context(), offset, size));
+ LOG(("%s:ide_bus_master_read(%d, %d)\n", device->machine().describe_context(), offset, size));
/* command register */
if (offset == 0)
@@ -1547,7 +1547,7 @@ static void ide_bus_master_write(device_t *device, offs_t offset, int size, UINT
{
ide_state *ide = get_safe_token(device);
- LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", device->machine->describe_context(), offset, size, data));
+ LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", device->machine().describe_context(), offset, size, data));
/* command register */
if (offset == 0)
@@ -1792,21 +1792,20 @@ static DEVICE_START( ide_controller )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
ide->device = device;
/* set MAME harddisk handle */
config = (const ide_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
- 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());
ide->disk = hard_disk_open(ide->handle);
assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");
/* find the bus master space */
if (config->bmcpu != NULL)
{
- device_t *bmtarget = device->machine->device(config->bmcpu);
+ device_t *bmtarget = device->machine().device(config->bmcpu);
if (bmtarget == NULL)
throw emu_fatalerror("IDE controller '%s' bus master target '%s' doesn't exist!", device->tag(), config->bmcpu);
device_memory_interface *memory;
@@ -1835,8 +1834,8 @@ static DEVICE_START( ide_controller )
}
/* create a timer for timing status */
- ide->last_status_timer = device->machine->scheduler().timer_alloc(FUNC(NULL));
- ide->reset_timer = device->machine->scheduler().timer_alloc(FUNC(reset_callback), (void *)device);
+ ide->last_status_timer = device->machine().scheduler().timer_alloc(FUNC(NULL));
+ ide->reset_timer = device->machine().scheduler().timer_alloc(FUNC(reset_callback), (void *)device);
/* register ide states */
device->save_item(NAME(ide->adapter_control));
@@ -1910,14 +1909,14 @@ static DEVICE_RESET( ide_controller )
LOG(("IDE controller reset performed\n"));
- if (device->machine->device( "harddisk" )) {
+ if (device->machine().device( "harddisk" )) {
if (!ide->disk)
{
- ide->handle = hd_get_chd_file( device->machine->device( "harddisk" ) ); // should be config->master
+ ide->handle = hd_get_chd_file( device->machine().device( "harddisk" ) ); // should be config->master
if (ide->handle)
{
- ide->disk = hd_get_hard_disk_file( device->machine->device( "harddisk" ) ); // should be config->master
+ ide->disk = hd_get_hard_disk_file( device->machine().device( "harddisk" ) ); // should be config->master
if (ide->disk != NULL)
{
diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c
index a23c3ab4981..e44641922b3 100644
--- a/src/emu/machine/ins8250.c
+++ b/src/emu/machine/ins8250.c
@@ -437,7 +437,7 @@ READ8_DEVICE_HANDLER( ins8250_r )
case 5:
#if 0
- if (ins8250->send.active && (machine->time()-ins8250->send.time>uart_byte_time(n)))
+ if (ins8250->send.active && (machine.time()-ins8250->send.time>uart_byte_time(n)))
{
// currently polling is enough for pc1512
ins8250->lsr |= 0x40; /* set TSRE */
diff --git a/src/emu/machine/k033906.c b/src/emu/machine/k033906.c
index 30f8fa35baf..bea1fdd7c49 100644
--- a/src/emu/machine/k033906.c
+++ b/src/emu/machine/k033906.c
@@ -65,8 +65,8 @@ void k033906_device::device_start()
{
m_voodoo = m_machine.device(m_config.m_voodoo_tag);
- m_reg = auto_alloc_array(&m_machine, UINT32, 256);
- m_ram = auto_alloc_array(&m_machine, UINT32, 32768);
+ m_reg = auto_alloc_array(m_machine, UINT32, 256);
+ m_ram = auto_alloc_array(m_machine, UINT32, 32768);
m_reg_set = 0;
diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c
index 9d17ae4b734..54c944e1f03 100644
--- a/src/emu/machine/k056230.c
+++ b/src/emu/machine/k056230.c
@@ -74,7 +74,7 @@ void k056230_device::device_start()
m_is_thunderh = m_config.m_is_thunderh;
- m_ram = auto_alloc_array(&m_machine, UINT32, 0x2000);
+ m_ram = auto_alloc_array(m_machine, UINT32, 0x2000);
save_pointer(NAME(m_ram), 0x2000);
}
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index 289588f28e6..5ec709f1597 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -44,7 +44,7 @@ static void update(device_t *device, UINT8 new_val, UINT8 mask)
UINT8 changed = old_val ^ latch8->value;
for (i=0; i<8; i++)
if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
- discrete_sound_w(device->machine->device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
+ discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
}
}
@@ -83,7 +83,7 @@ READ8_DEVICE_HANDLER( latch8_r )
if (latch8->has_read)
{
/* temporary hack until all relevant systems are devices */
- address_space *space = device->machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
int i;
for (i=0; i<8; i++)
{
@@ -105,7 +105,7 @@ WRITE8_DEVICE_HANDLER( latch8_w )
assert(offset == 0);
if (latch8->intf->nosync != 0xff)
- device->machine->scheduler().synchronize(FUNC(latch8_timerproc), (0xFF << 8) | data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(latch8_timerproc), (0xFF << 8) | data, (void *)device);
else
update(device, data, 0xFF);
}
@@ -165,7 +165,7 @@ INLINE void latch8_bitx_w(device_t *device, int bit, offs_t offset, UINT8 data)
if (latch8->intf->nosync & mask)
update(device, masked_data, mask);
else
- device->machine->scheduler().synchronize(FUNC(latch8_timerproc), (mask << 8) | masked_data, (void *) device);
+ device->machine().scheduler().synchronize(FUNC(latch8_timerproc), (mask << 8) | masked_data, (void *) device);
}
WRITE8_DEVICE_HANDLER( latch8_bit0_w ) { latch8_bitx_w(device, 0, offset, data); }
@@ -206,7 +206,7 @@ static DEVICE_START( latch8 )
{
if (latch8->devices[i] != NULL)
fatalerror("Device %s: Bit %d already has a handler.\n", device->tag(), i);
- latch8->devices[i] = device->machine->device(latch8->intf->devread[i].tag);
+ latch8->devices[i] = device->machine().device(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);
latch8->has_devread = 1;
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index b7e540ca0ab..353fb68d130 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -146,8 +146,8 @@ static void read_track_data(laserdisc_state *ld);
static void process_track_data(device_t *device);
static DEVICE_START( laserdisc_sound );
static STREAM_UPDATE( custom_stream_callback );
-static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void configuration_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void configuration_save(running_machine &machine, int config_type, xml_data_node *parentnode);
@@ -292,7 +292,7 @@ static void vblank_state_changed(screen_device &screen, void *param, bool vblank
device_t *device = (device_t *)param;
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core;
- attotime curtime = screen.machine->time();
+ attotime curtime = screen.machine().time();
/* update current track based on slider speed */
update_slider_pos(ldcore, curtime);
@@ -305,7 +305,7 @@ static void vblank_state_changed(screen_device &screen, void *param, bool vblank
(*ldcore->intf.vsync)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime);
/* set a timer to begin fetching the next frame just before the VBI data would be fetched */
- screen.machine->scheduler().timer_set(screen.time_until_pos(16*2), FUNC(perform_player_update), 0, ld);
+ screen.machine().scheduler().timer_set(screen.time_until_pos(16*2), FUNC(perform_player_update), 0, ld);
}
}
@@ -319,7 +319,7 @@ static TIMER_CALLBACK( perform_player_update )
{
laserdisc_state *ld = (laserdisc_state *)ptr;
ldcore_data *ldcore = ld->core;
- attotime curtime = machine->time();
+ attotime curtime = machine.time();
/* wait for previous read and decode to finish */
process_track_data(ld->device);
@@ -554,7 +554,7 @@ void ldcore_set_slider_speed(laserdisc_state *ld, INT32 tracks_per_vsync)
ldcore_data *ldcore = ld->core;
attotime vsyncperiod = ld->screen->frame_period();
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
/* if 0, set the time to 0 */
if (tracks_per_vsync == 0)
@@ -582,7 +582,7 @@ void ldcore_advance_slider(laserdisc_state *ld, INT32 numtracks)
{
ldcore_data *ldcore = ld->core;
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
add_and_clamp_track(ldcore, numtracks);
if (LOG_SLIDER)
printf("Advance by %d\n", numtracks);
@@ -599,7 +599,7 @@ slider_position ldcore_get_slider_position(laserdisc_state *ld)
ldcore_data *ldcore = ld->core;
/* update the slider position first */
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
/* return the status */
if (ldcore->curtrack == 1)
@@ -964,7 +964,7 @@ static void process_track_data(device_t *device)
static DEVICE_START( laserdisc_sound )
{
sound_token *token = (sound_token *)downcast<legacy_device_base *>(device)->token();
- token->stream = device->machine->sound().stream_alloc(*device, 0, 2, 48000, token, custom_stream_callback);
+ token->stream = device->machine().sound().stream_alloc(*device, 0, 2, 48000, token, custom_stream_callback);
token->ld = NULL;
}
@@ -1072,7 +1072,7 @@ static STREAM_UPDATE( custom_stream_callback )
the configuration file
-------------------------------------------------*/
-static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *overnode;
xml_data_node *ldnode;
@@ -1089,7 +1089,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
for (ldnode = xml_get_sibling(parentnode->child, "device"); ldnode != NULL; ldnode = xml_get_sibling(ldnode->next, "device"))
{
const char *devtag = xml_get_attribute_string(ldnode, "tag", "");
- device_t *device = machine->device(devtag);
+ device_t *device = machine.device(devtag);
if (device != NULL)
{
laserdisc_state *ld = get_safe_token(device);
@@ -1115,7 +1115,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
configuration file
-------------------------------------------------*/
-static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
device_t *device;
@@ -1124,7 +1124,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da
return;
/* iterate over disc devices */
- for (device = machine->m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
+ for (device = machine.m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
{
laserdisc_config *origconfig = (laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
laserdisc_state *ld = get_safe_token(device);
@@ -1214,7 +1214,7 @@ void laserdisc_overlay_enable(device_t *device, int enable)
SCREEN_UPDATE( laserdisc )
{
- device_t *laserdisc = screen->machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = screen->machine().m_devicelist.first(LASERDISC);
if (laserdisc != NULL)
{
const rectangle &visarea = screen->visible_area();
@@ -1245,7 +1245,7 @@ SCREEN_UPDATE( laserdisc )
if (overbitmap != NULL)
{
if (overbitmap->format == BITMAP_FORMAT_INDEXED16)
- ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_PALETTEA16, laserdisc->machine->palette);
+ ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_PALETTEA16, laserdisc->machine().palette);
else if (overbitmap->format == BITMAP_FORMAT_RGB32)
ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_ARGB32);
}
@@ -1331,7 +1331,7 @@ static void init_disc(device_t *device)
if (config->getdisc != NULL)
ldcore->disc = (*config->getdisc)(device);
else
- ldcore->disc = get_disk_handle(device->machine, device->tag());
+ ldcore->disc = get_disk_handle(device->machine(), device->tag());
/* set default parameters */
ldcore->width = 720;
@@ -1372,7 +1372,7 @@ static void init_disc(device_t *device)
ldcore->chdtracks = totalhunks / 2;
/* allocate memory for the precomputed per-frame metadata */
- ldcore->vbidata = auto_alloc_array(device->machine, UINT8, totalhunks * VBI_PACKED_BYTES);
+ ldcore->vbidata = auto_alloc_array(device->machine(), UINT8, totalhunks * VBI_PACKED_BYTES);
err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL, NULL);
if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES)
fatalerror("Precomputed VBI metadata missing or incorrect size");
@@ -1401,23 +1401,23 @@ static void init_video(device_t *device)
frame_data *frame = &ldcore->frame[index];
/* first allocate a YUY16 bitmap at 2x the height */
- frame->bitmap = auto_alloc(device->machine, bitmap_t(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16));
+ frame->bitmap = auto_alloc(device->machine(), bitmap_t(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16));
fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
/* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
- frame->visbitmap = auto_alloc(device->machine, bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
+ frame->visbitmap = auto_alloc(device->machine(), bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
frame->bitmap->width - 2 * frame->bitmap->width * 8 / 720,
frame->bitmap->height - 44,
frame->bitmap->rowpixels, frame->bitmap->format));
}
/* allocate an empty frame of the same size */
- ldcore->emptyframe = auto_bitmap_alloc(device->machine, ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
+ ldcore->emptyframe = auto_bitmap_alloc(device->machine(), ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
fillbitmap_yuy16(ldcore->emptyframe, 0, 128, 128);
/* allocate texture for rendering */
ldcore->videoenable = TRUE;
- ldcore->videotex = device->machine->render().texture_alloc();
+ ldcore->videotex = device->machine().render().texture_alloc();
if (ldcore->videotex == NULL)
fatalerror("Out of memory allocating video texture");
@@ -1432,9 +1432,9 @@ static void init_video(device_t *device)
if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL)
{
ldcore->overenable = TRUE;
- ldcore->overbitmap[0] = auto_bitmap_alloc(device->machine, ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
- ldcore->overbitmap[1] = auto_bitmap_alloc(device->machine, ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
- ldcore->overtex = device->machine->render().texture_alloc();
+ ldcore->overbitmap[0] = auto_bitmap_alloc(device->machine(), ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
+ ldcore->overbitmap[1] = auto_bitmap_alloc(device->machine(), ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
+ ldcore->overtex = device->machine().render().texture_alloc();
if (ldcore->overtex == NULL)
fatalerror("Out of memory allocating overlay texture");
}
@@ -1452,13 +1452,13 @@ static void init_audio(device_t *device)
ldcore_data *ldcore = ld->core;
/* find the custom audio */
- ldcore->audiocustom = device->machine->device(ldcore->config.sound);
+ ldcore->audiocustom = device->machine().device(ldcore->config.sound);
/* allocate audio buffers */
ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
- ldcore->audiobuffer[0] = auto_alloc_array(device->machine, INT16, ldcore->audiobufsize);
- ldcore->audiobuffer[1] = auto_alloc_array(device->machine, INT16, ldcore->audiobufsize);
+ ldcore->audiobuffer[0] = auto_alloc_array(device->machine(), INT16, ldcore->audiobufsize);
+ ldcore->audiobuffer[1] = auto_alloc_array(device->machine(), INT16, ldcore->audiobufsize);
}
@@ -1480,7 +1480,7 @@ static DEVICE_START( laserdisc )
int index;
/* ensure that our screen is started first */
- ld->screen = downcast<screen_device *>(device->machine->device(config->screen));
+ ld->screen = downcast<screen_device *>(device->machine().device(config->screen));
assert(ld->screen != NULL);
if (!ld->screen->started())
throw device_missing_dependencies();
@@ -1489,14 +1489,14 @@ static DEVICE_START( laserdisc )
ld->device = device;
/* allocate memory for the core state */
- ld->core = auto_alloc_clear(device->machine, ldcore_data);
+ ld->core = auto_alloc_clear(device->machine(), ldcore_data);
ldcore = ld->core;
/* determine the maximum player-specific state size and allocate it */
statesize = 0;
for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
statesize = MAX(statesize, player_interfaces[index]->statesize);
- ld->player = (ldplayer_data *)auto_alloc_array_clear(device->machine, UINT8, statesize);
+ ld->player = (ldplayer_data *)auto_alloc_array_clear(device->machine(), UINT8, statesize);
/* copy config data to the live state */
ldcore->config = *config;
@@ -1517,7 +1517,7 @@ static DEVICE_START( laserdisc )
init_audio(device);
/* register callbacks */
- config_register(device->machine, "laserdisc", configuration_load, configuration_save);
+ config_register(device->machine(), "laserdisc", configuration_load, configuration_save);
}
@@ -1535,10 +1535,10 @@ static DEVICE_STOP( laserdisc )
chd_async_complete(ldcore->disc);
/* free any textures and palettes */
- device->machine->render().texture_free(ldcore->videotex);
+ device->machine().render().texture_free(ldcore->videotex);
if (ldcore->videopalette != NULL)
palette_deref(ldcore->videopalette);
- device->machine->render().texture_free(ldcore->overtex);
+ device->machine().render().texture_free(ldcore->overtex);
}
@@ -1549,7 +1549,7 @@ static DEVICE_STOP( laserdisc )
static DEVICE_RESET( laserdisc )
{
laserdisc_state *ld = get_safe_token(device);
- attotime curtime = device->machine->time();
+ attotime curtime = device->machine().time();
ldcore_data *ldcore = ld->core;
int pltype, line;
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index 5f9c6e22ed0..1e90f5862f6 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -341,7 +341,7 @@ const ldplayer_interface pr8210_interface =
static void pr8210_init(laserdisc_state *ld)
{
astring tempstring;
- attotime curtime = ld->device->machine->time();
+ attotime curtime = ld->device->machine().time();
ldplayer_data *player = ld->player;
/* reset our state */
@@ -381,10 +381,10 @@ static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int field
/* signal VSYNC and set a timer to turn it off */
player->vsync = TRUE;
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
/* also set a timer to fetch the VBI data when it is ready */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
}
@@ -452,7 +452,7 @@ static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
/* handle rising edge */
if (prev != ASSERT_LINE && data == ASSERT_LINE)
{
- attotime curtime = ld->device->machine->time();
+ attotime curtime = ld->device->machine().time();
attotime delta, overalldelta;
int longpulse;
@@ -841,7 +841,7 @@ static WRITE8_HANDLER( pr8210_port2_w )
/* on the falling edge of bit 5, start the slow timer */
if (!(data & 0x20) && (prev & 0x20))
- player->slowtrg = space->machine->time();
+ player->slowtrg = space->machine().time();
/* bit 6 when low triggers an IRQ on the MCU */
if (player->cpu != NULL)
@@ -1121,7 +1121,7 @@ static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fie
if (LOG_SIMUTREK)
printf("%3d:VSYNC IRQ\n", ld->screen->vpos());
device_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period(), FUNC(irq_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period(), FUNC(irq_off), 0, ld);
}
}
@@ -1166,7 +1166,7 @@ static UINT8 simutrek_status_r(laserdisc_state *ld)
static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
{
- ld->device->machine->scheduler().synchronize(FUNC(simutrek_latched_data_w), data, ld);
+ ld->device->machine().scheduler().synchronize(FUNC(simutrek_latched_data_w), data, ld);
if (LOG_SIMUTREK)
printf("%03d:**** Simutrek Command = %02X\n", ld->screen->vpos(), data);
}
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index f9477730987..02bc16486df 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -258,13 +258,13 @@ static void ldv1000_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fiel
/* signal VSYNC and set a timer to turn it off */
player->vsync = TRUE;
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
/* also set a timer to fetch the VBI data when it is ready */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
/* boost interleave for the first 1ms to improve communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(1));
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_msec(1));
}
@@ -526,7 +526,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_porta_w )
laserdisc_state *ld = ldcore_get_safe_token(device->owner());
ld->player->counter_start = data;
if (LOG_PORT_IO)
- printf("%s:PORTA.0=%02X\n", device->machine->describe_context(), data);
+ printf("%s:PORTA.0=%02X\n", device->machine().describe_context(), data);
}
@@ -589,7 +589,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
player->portc0 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0)
{
- printf("%s:PORTC.0=%02X", device->machine->describe_context(), data);
+ printf("%s:PORTC.0=%02X", device->machine().describe_context(), data);
if (data & 0x01) printf(" PRELOAD");
if (!(data & 0x02)) printf(" /MULTIJUMP");
if (data & 0x04) printf(" SCANMODE");
@@ -685,7 +685,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portb_w )
player->portb1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0)
{
- printf("%s:PORTB.1=%02X:", device->machine->describe_context(), data);
+ printf("%s:PORTB.1=%02X:", device->machine().describe_context(), data);
if (!(data & 0x01)) printf(" FOCSON");
if (!(data & 0x02)) printf(" SPDLRUN");
if (!(data & 0x04)) printf(" JUMPTRIG");
@@ -741,7 +741,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w )
player->portc1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0)
{
- printf("%s:PORTC.1=%02X", device->machine->describe_context(), data);
+ printf("%s:PORTC.1=%02X", device->machine().describe_context(), data);
if (data & 0x01) printf(" AUD1");
if (data & 0x02) printf(" AUD2");
if (data & 0x04) printf(" AUDEN");
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index e01a3f07541..d3b5d0005f7 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -234,7 +234,7 @@ static void vp931_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldn
/* set the ERP signal to 1 to indicate start of frame, and set a timer to turn it off */
ld->player->daticerp = 1;
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(15*2), FUNC(erp_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(15*2), FUNC(erp_off), 0, ld);
}
@@ -246,7 +246,7 @@ static void vp931_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldn
static INT32 vp931_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
{
/* set the first VBI timer to go at the start of line 16 */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(16*2), FUNC(vbi_data_fetch), LASERDISC_CODE_LINE16 << 2, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(16*2), FUNC(vbi_data_fetch), LASERDISC_CODE_LINE16 << 2, ld);
/* play forward by default */
return fieldnum;
@@ -261,7 +261,7 @@ static INT32 vp931_update(laserdisc_state *ld, const vbi_metadata *vbi, int fiel
static void vp931_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
{
/* set a timer to synchronize execution before sending the data */
- ld->device->machine->scheduler().synchronize(FUNC(deferred_data_w), data, ld);
+ ld->device->machine().scheduler().synchronize(FUNC(deferred_data_w), data, ld);
}
@@ -283,7 +283,7 @@ static UINT8 vp931_data_r(laserdisc_state *ld)
}
/* also boost interleave for 4 scanlines to ensure proper communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
return player->tocontroller;
}
@@ -336,7 +336,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
if (which == 0)
{
device_set_input_line(player->cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_nsec(5580), FUNC(irq_off), 0, ld);
+ machine.scheduler().timer_set(attotime::from_nsec(5580), FUNC(irq_off), 0, ld);
}
/* clock the data strobe on each subsequent callback */
@@ -344,7 +344,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
{
player->daticval = code >> (8 * (3 - which));
player->datastrobe = 1;
- machine->scheduler().timer_set(attotime::from_nsec(5000), FUNC(datastrobe_off), 0, ld);
+ machine.scheduler().timer_set(attotime::from_nsec(5000), FUNC(datastrobe_off), 0, ld);
}
/* determine the next bit to fetch and reprime ourself */
@@ -354,7 +354,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
line++;
}
if (line <= LASERDISC_CODE_LINE18 + 1)
- machine->scheduler().timer_set(ld->screen->time_until_pos(line*2, which * 2 * ld->screen->width() / 4), FUNC(vbi_data_fetch), (line << 2), ld);
+ machine.scheduler().timer_set(ld->screen->time_until_pos(line*2, which * 2 * ld->screen->width() / 4), FUNC(vbi_data_fetch), (line << 2), ld);
}
@@ -617,7 +617,7 @@ static WRITE8_HANDLER( to_controller_w )
(*player->data_ready_cb)(ld->device, TRUE);
/* also boost interleave for 4 scanlines to ensure proper communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
}
diff --git a/src/emu/machine/mb3773.c b/src/emu/machine/mb3773.c
index 55dbbed0ae8..ae114786ab7 100644
--- a/src/emu/machine/mb3773.c
+++ b/src/emu/machine/mb3773.c
@@ -55,7 +55,7 @@ device_config *mb3773_device_config::static_alloc_device_config( const machine_c
device_t *mb3773_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, mb3773_device( machine, *this ) );
+ return auto_alloc( machine, mb3773_device( machine, *this ) );
}
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index 5a60dd5686a..c487e751ae8 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -175,7 +175,7 @@ static void gain_recalc( device_t *device )
int old_index = mb87078->gain[i];
mb87078->gain[i] = calc_gain_index(mb87078->latch[0][i], mb87078->latch[1][i]);
if (old_index != mb87078->gain[i])
- mb87078->gain_changed_cb(device->machine, i, mb87078_gain_percent[mb87078->gain[i]]);
+ mb87078->gain_changed_cb(device->machine(), i, mb87078_gain_percent[mb87078->gain[i]]);
}
}
diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h
index 9c5397cd966..7f62b44c06e 100644
--- a/src/emu/machine/mb87078.h
+++ b/src/emu/machine/mb87078.h
@@ -16,7 +16,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*mb87078_gain_changed_cb)(running_machine *machine, int channel, int percent /*, float decibels*/);
+typedef void (*mb87078_gain_changed_cb)(running_machine &machine, int channel, int percent /*, float decibels*/);
typedef struct _mb87078_interface mb87078_interface;
struct _mb87078_interface
diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c
index 926818829cc..8f31779a58b 100644
--- a/src/emu/machine/mc146818.c
+++ b/src/emu/machine/mc146818.c
@@ -141,7 +141,7 @@ device_config *mc146818_device_config::static_alloc_device_config(const machine_
device_t *mc146818_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mc146818_device(machine, *this));
+ return auto_alloc(machine, mc146818_device(machine, *this));
}
@@ -436,7 +436,7 @@ READ8_MEMBER( mc146818_device::read )
switch (m_index % MC146818_DATA_SIZE) {
case 0xa:
data = m_data[m_index % MC146818_DATA_SIZE];
- if ((space.machine->time() - m_last_refresh) < attotime::from_hz(32768))
+ if ((space.machine().time() - m_last_refresh) < attotime::from_hz(32768))
data |= 0x80;
#if 0
/* for pc1512 bios realtime clock test */
diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c
index 4d07c268216..128dc29c383 100644
--- a/src/emu/machine/microtch.c
+++ b/src/emu/machine/microtch.c
@@ -151,7 +151,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
}
};
-void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
+void microtouch_init(running_machine &machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
{
memset(&microtouch, 0, sizeof(microtouch));
@@ -159,7 +159,7 @@ void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microto
microtouch.tx_callback = tx_cb;
microtouch.touch_callback = touch_cb;
- microtouch.timer = machine->scheduler().timer_alloc(FUNC(microtouch_timer_callback));
+ microtouch.timer = machine.scheduler().timer_alloc(FUNC(microtouch_timer_callback));
microtouch.timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5));
state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
diff --git a/src/emu/machine/microtch.h b/src/emu/machine/microtch.h
index efa6c2a4f12..d378c49eb91 100644
--- a/src/emu/machine/microtch.h
+++ b/src/emu/machine/microtch.h
@@ -3,10 +3,10 @@
INPUT_PORTS_EXTERN(microtouch);
-typedef void (*microtouch_tx_func)(running_machine *machine, UINT8 data);
-typedef int (*microtouch_touch_func)(running_machine *machine, int *touch_x, int *touch_y);
+typedef void (*microtouch_tx_func)(running_machine &machine, UINT8 data);
+typedef int (*microtouch_touch_func)(running_machine &machine, int *touch_x, int *touch_y);
-void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb);
+void microtouch_init(running_machine &machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb);
void microtouch_rx(int count, UINT8* data);
#endif //_MICROTOUCH_H
diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c
index 31bc218740f..8ba28098905 100644
--- a/src/emu/machine/msm6242.c
+++ b/src/emu/machine/msm6242.c
@@ -58,7 +58,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
}
else /* otherwise, use the current time */
{
- device->machine->current_datetime(curtime);
+ device->machine().current_datetime(curtime);
}
switch(offset)
@@ -103,7 +103,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
case MSM6242_REG_CF: return msm6242->reg[2];
}
- logerror("%s: MSM6242 unmapped offset %02x read\n", device->machine->describe_context(), offset);
+ logerror("%s: MSM6242 unmapped offset %02x read\n", device->machine().describe_context(), offset);
return 0;
}
@@ -120,7 +120,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
if (data & 1) /* was Hold set? */
{
- device->machine->current_datetime(msm6242->hold_time);
+ device->machine().current_datetime(msm6242->hold_time);
}
return;
@@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
}
}
- logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", device->machine->describe_context(), offset, data);
+ logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", device->machine().describe_context(), offset, data);
}
diff --git a/src/emu/machine/nmc9306.c b/src/emu/machine/nmc9306.c
index 2ea9c963365..71ded4d32ad 100644
--- a/src/emu/machine/nmc9306.c
+++ b/src/emu/machine/nmc9306.c
@@ -93,7 +93,7 @@ device_config *nmc9306_device_config::static_alloc_device_config(const machine_c
device_t *nmc9306_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, nmc9306_device(machine, *this));
+ return auto_alloc(machine, nmc9306_device(machine, *this));
}
diff --git a/src/emu/machine/nvram.c b/src/emu/machine/nvram.c
index 33894e7a6a3..58e174a0d92 100644
--- a/src/emu/machine/nvram.c
+++ b/src/emu/machine/nvram.c
@@ -83,7 +83,7 @@ device_config *nvram_device_config::static_alloc_device_config(const machine_con
device_t *nvram_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, nvram_device(machine, *this));
+ return auto_alloc(machine, nvram_device(machine, *this));
}
diff --git a/src/emu/machine/pc16552d.c b/src/emu/machine/pc16552d.c
index 3b9888d040b..4595d48a85f 100644
--- a/src/emu/machine/pc16552d.c
+++ b/src/emu/machine/pc16552d.c
@@ -54,7 +54,7 @@ typedef struct
{
PC16552D_CHANNEL ch[2];
int frequency;
- void (* irq_handler)(running_machine *machine, int channel, int value);
+ void (* irq_handler)(running_machine &machine, int channel, int value);
void (* tx_callback)(int channel, int count, UINT8* data);
} PC16552D_REGS;
@@ -67,7 +67,7 @@ static PC16552D_REGS duart[MAX_PC16552D_CHIPS];
static const int rx_trigger_level[4] = { 1, 4, 8, 14 };
-static void check_interrupts(running_machine *machine, int chip, int channel)
+static void check_interrupts(running_machine &machine, int chip, int channel)
{
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
int signal = 0;
@@ -89,7 +89,7 @@ static void check_interrupts(running_machine *machine, int chip, int channel)
}
}
-static void duart_push_rx_fifo(running_machine *machine, int chip, int channel, UINT8 data)
+static void duart_push_rx_fifo(running_machine &machine, int chip, int channel, UINT8 data)
{
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -114,7 +114,7 @@ static void duart_push_rx_fifo(running_machine *machine, int chip, int channel,
}
}
-static UINT8 duart_pop_rx_fifo(running_machine *machine, int chip, int channel)
+static UINT8 duart_pop_rx_fifo(running_machine &machine, int chip, int channel)
{
UINT8 r;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -183,7 +183,7 @@ static UINT8 duart_pop_tx_fifo(int chip, int channel, UINT8 data)
#endif
-static UINT8 duart_r(running_machine *machine, int chip, int reg)
+static UINT8 duart_r(running_machine &machine, int chip, int reg)
{
int channel = (reg >> 3) & 1;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -291,7 +291,7 @@ static UINT8 duart_r(running_machine *machine, int chip, int reg)
return ch->reg[reg];
}
-static void duart_w(running_machine *machine, int chip, int reg, UINT8 data)
+static void duart_w(running_machine &machine, int chip, int reg, UINT8 data)
{
int channel = (reg >> 3) & 1;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -387,7 +387,7 @@ static void duart_w(running_machine *machine, int chip, int reg, UINT8 data)
/*****************************************************************************/
-void pc16552d_init(running_machine *machine, int chip, int frequency, void (* irq_handler)(running_machine *machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data))
+void pc16552d_init(running_machine &machine, int chip, int frequency, void (* irq_handler)(running_machine &machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data))
{
memset(&duart[chip], 0, sizeof(PC16552D_REGS));
@@ -400,14 +400,14 @@ void pc16552d_init(running_machine *machine, int chip, int frequency, void (* ir
duart[chip].ch[1].pending_interrupt = 0;
// allocate transmit timers
- duart[chip].ch[0].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
+ duart[chip].ch[0].tx_fifo_timer = machine.scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
duart[chip].ch[0].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 0);
- duart[chip].ch[1].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
+ duart[chip].ch[1].tx_fifo_timer = machine.scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
duart[chip].ch[1].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 1);
}
-void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 data)
+void pc16552d_rx_data(running_machine &machine, int chip, int channel, UINT8 data)
{
if (duart[chip].ch[channel].reg[REG_FIFO_CTRL] & 0x01) // RCVR & XMIT FIFO enable
{
@@ -420,20 +420,20 @@ void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 dat
READ8_HANDLER(pc16552d_0_r)
{
- return duart_r(space->machine, 0, offset);
+ return duart_r(space->machine(), 0, offset);
}
WRITE8_HANDLER(pc16552d_0_w)
{
- duart_w(space->machine, 0, offset, data);
+ duart_w(space->machine(), 0, offset, data);
}
READ8_HANDLER(pc16552d_1_r)
{
- return duart_r(space->machine, 1, offset);
+ return duart_r(space->machine(), 1, offset);
}
WRITE8_HANDLER(pc16552d_1_w)
{
- duart_w(space->machine, 1, offset, data);
+ duart_w(space->machine(), 1, offset, data);
}
diff --git a/src/emu/machine/pc16552d.h b/src/emu/machine/pc16552d.h
index 58133ccc24e..93f2181e37a 100644
--- a/src/emu/machine/pc16552d.h
+++ b/src/emu/machine/pc16552d.h
@@ -1,8 +1,8 @@
#ifndef PC16552D_H
#define PC16552D_H
-void pc16552d_init(running_machine *machine, int chip, int frequency, void (* irq_handler)(running_machine *machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data));
-void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 data);
+void pc16552d_init(running_machine &machine, int chip, int frequency, void (* irq_handler)(running_machine &machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data));
+void pc16552d_rx_data(running_machine &machine, int chip, int channel, UINT8 data);
READ8_HANDLER(pc16552d_0_r);
WRITE8_HANDLER(pc16552d_0_w);
diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c
index 090e2fe1d85..ba21473d61e 100644
--- a/src/emu/machine/pci.c
+++ b/src/emu/machine/pci.c
@@ -222,10 +222,10 @@ READ64_DEVICE_HANDLER(pci_64be_r) { return read64be_with_32le_device_handler(pci
WRITE64_DEVICE_HANDLER(pci_64be_w) { write64be_with_32le_device_handler(pci_32le_w, device, offset, data, mem_mask); }
-int pci_add_sibling( running_machine *machine, char *pcitag, char *sibling )
+int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling )
{
- device_t *device1 = machine->device(pcitag);
- device_t *device2 = machine->device(sibling);
+ device_t *device1 = machine.device(pcitag);
+ device_t *device2 = machine.device(sibling);
pci_bus_state *pcibus1 = get_safe_token(device1);
pci_bus_state *pcibus2 = get_safe_token(device2);
pci_bus_config *config2;
@@ -271,7 +271,6 @@ static DEVICE_START( pci_bus )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
pcibus->config = (const pci_bus_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
@@ -281,17 +280,17 @@ static DEVICE_START( pci_bus )
/* find all our devices */
for (devicenum = 0; devicenum < ARRAY_LENGTH(pcibus->device); devicenum++)
if (pcibus->config->device[devicenum].devtag != NULL)
- pcibus->device[devicenum] = device->machine->device(pcibus->config->device[devicenum].devtag);
+ pcibus->device[devicenum] = device->machine().device(pcibus->config->device[devicenum].devtag);
if (pcibus->config->father != NULL)
- pci_add_sibling(device->machine, (char *)pcibus->config->father, (char *)device->tag());
+ pci_add_sibling(device->machine(), (char *)pcibus->config->father, (char *)device->tag());
/* register pci states */
device->save_item(NAME(pcibus->address));
device->save_item(NAME(pcibus->devicenum));
device->save_item(NAME(pcibus->busnum));
- device->machine->state().register_postload(pci_bus_postload, pcibus);
+ device->machine().state().register_postload(pci_bus_postload, pcibus);
}
diff --git a/src/emu/machine/pci.h b/src/emu/machine/pci.h
index b88e3f1aa1f..c61fcb709ba 100644
--- a/src/emu/machine/pci.h
+++ b/src/emu/machine/pci.h
@@ -64,7 +64,7 @@ WRITE32_DEVICE_HANDLER( pci_32le_w );
READ64_DEVICE_HANDLER( pci_64be_r );
WRITE64_DEVICE_HANDLER( pci_64be_w );
-int pci_add_sibling( running_machine *machine, char *pcitag, char *sibling );
+int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling );
/* ----- device interface ----- */
diff --git a/src/emu/machine/pckeybrd.h b/src/emu/machine/pckeybrd.h
index a5c21b025ab..ed1f4c4439a 100644
--- a/src/emu/machine/pckeybrd.h
+++ b/src/emu/machine/pckeybrd.h
@@ -19,12 +19,12 @@ typedef enum
AT_KEYBOARD_TYPE_MF2
} AT_KEYBOARD_TYPE;
-void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type);
+void at_keyboard_init(running_machine &machine, AT_KEYBOARD_TYPE type);
void at_keyboard_polling(void);
int at_keyboard_read(void);
-void at_keyboard_write(running_machine *machine, UINT8 data);
-void at_keyboard_reset(running_machine *machine);
+void at_keyboard_write(running_machine &machine, UINT8 data);
+void at_keyboard_reset(running_machine &machine);
void at_keyboard_set_scan_code_set(int set);
INPUT_PORTS_EXTERN( pc_keyboard );
diff --git a/src/emu/machine/pcshare.h b/src/emu/machine/pcshare.h
index 3b8f1f57eae..a746f7a1982 100644
--- a/src/emu/machine/pcshare.h
+++ b/src/emu/machine/pcshare.h
@@ -2,7 +2,7 @@
#define PCCOMMON_KEYBOARD_PC 0
#define PCCOMMON_KEYBOARD_AT 1
-void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int));
+void init_pc_common(running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int));
void pc_keyboard(void);
UINT8 pc_keyb_read(void);
diff --git a/src/emu/machine/pd4990a.c b/src/emu/machine/pd4990a.c
index 7c41e867f04..86c928cea15 100644
--- a/src/emu/machine/pd4990a.c
+++ b/src/emu/machine/pd4990a.c
@@ -449,7 +449,7 @@ static DEVICE_START( upd4990a )
upd4990a_state *upd4990a = get_safe_token(device);
system_time curtime, *systime = &curtime;
- device->machine->current_datetime(curtime);
+ device->machine().current_datetime(curtime);
#if 0
upd4990a->seconds = 0x00;
diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c
index 36e2b87e1b6..dd8e59cb952 100644
--- a/src/emu/machine/pic8259.c
+++ b/src/emu/machine/pic8259.c
@@ -406,7 +406,7 @@ static DEVICE_START( pic8259 )
assert(intf != NULL);
- pic8259->timer = device->machine->scheduler().timer_alloc( FUNC(pic8259_timerproc), (void *)device );
+ pic8259->timer = device->machine().scheduler().timer_alloc( FUNC(pic8259_timerproc), (void *)device );
/* resolve callbacks */
devcb_resolve_write_line(&pic8259->out_int_func, &intf->out_int_func, device);
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index abb85c08387..1781aae3a44 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -614,7 +614,7 @@ static void simulate2(device_t *device, struct pit8253_timer *timer, INT64 elaps
{
attotime next_fire_time = timer->last_updated + cycles_to_output * attotime::from_hz( timer->clockin );
- timer->updatetimer->adjust(next_fire_time - device->machine->time(), timer->index );
+ timer->updatetimer->adjust(next_fire_time - device->machine().time(), timer->index );
}
LOG2(("pit8253: simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x, cycles_to_output = %04x\n",
@@ -654,7 +654,7 @@ static void update(device_t *device, struct pit8253_timer *timer)
{
/* With the 82C54's maximum clockin of 10MHz, 64 bits is nearly 60,000
years of time. Should be enough for now. */
- attotime now = device->machine->time();
+ attotime now = device->machine().time();
attotime elapsed_time = now - timer->last_updated;
INT64 elapsed_cycles = elapsed_time.as_double() * timer->clockin;
@@ -916,7 +916,7 @@ WRITE8_DEVICE_HANDLER( pit8253_w )
update(device, timer);
- if ( device->machine->time() > timer->last_updated && timer->clockin != 0 )
+ if ( device->machine().time() > timer->last_updated && timer->clockin != 0 )
{
middle_of_a_cycle = 1;
}
@@ -1081,7 +1081,7 @@ static void common_start( device_t *device, int device_type ) {
/* initialize timer */
timer->clockin = pit8253->config->timer[timerno].clockin;
- timer->updatetimer = device->machine->scheduler().timer_alloc(FUNC(update_timer_cb), (void *)device);
+ timer->updatetimer = device->machine().scheduler().timer_alloc(FUNC(update_timer_cb), (void *)device);
timer->updatetimer->adjust(attotime::never, timerno);
/* resolve callbacks */
@@ -1148,7 +1148,7 @@ static DEVICE_RESET( pit8253 ) {
timer->null_count = 1;
timer->cycles_to_output = CYCLES_NEVER;
- timer->last_updated = device->machine->time();
+ timer->last_updated = device->machine().time();
update(device, timer);
}
diff --git a/src/emu/machine/ram.c b/src/emu/machine/ram.c
index 7a08d377fd0..dee4fa83c4e 100644
--- a/src/emu/machine/ram.c
+++ b/src/emu/machine/ram.c
@@ -100,7 +100,7 @@ static DEVICE_START( ram )
/* the device named 'ram' can get ram options from command line */
if (strcmp(device->tag(), RAM_TAG) == 0)
{
- const char *ramsize_string = device->machine->options().ram_size();
+ const char *ramsize_string = device->machine().options().ram_size();
if ((ramsize_string != NULL) && (ramsize_string[0] != '\0'))
ram->size = ram_parse_string(ramsize_string);
@@ -111,7 +111,7 @@ static DEVICE_START( ram )
ram->size = ram_parse_string(config->default_size);
/* allocate space for the ram */
- ram->ram = auto_alloc_array(device->machine, UINT8, ram->size);
+ ram->ram = auto_alloc_array(device->machine(), UINT8, ram->size);
/* reset ram to the default value */
memset(ram->ram, config->default_value, ram->size);
diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c
index 3ed46197e8b..502826c90e9 100644
--- a/src/emu/machine/rtc65271.c
+++ b/src/emu/machine/rtc65271.c
@@ -236,7 +236,7 @@ static int rtc65271_file_load(device_t *device, emu_file &file)
system_time systime;
/* get the current date/time from the core */
- device->machine->current_datetime(systime);
+ device->machine().current_datetime(systime);
/* set clock registers */
state->regs[reg_second] = systime.local_time.second;
@@ -522,7 +522,7 @@ static TIMER_CALLBACK( rtc_begin_update_callback )
state->regs[reg_A] |= reg_A_UIP;
/* schedule end of update cycle */
- device->machine->scheduler().timer_set(UPDATE_CYCLE_TIME, FUNC(rtc_end_update_callback), 0, (void *)device);
+ device->machine().scheduler().timer_set(UPDATE_CYCLE_TIME, FUNC(rtc_end_update_callback), 0, (void *)device);
}
}
@@ -688,9 +688,9 @@ static DEVICE_START( rtc65271 )
rtc65271_config *config = (rtc65271_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
rtc65271_state *state = get_safe_token(device);
- state->update_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
+ state->update_timer = device->machine().scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
state->update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
- state->SQW_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)device);
+ state->SQW_timer = device->machine().scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)device);
state->interrupt_callback = config->interrupt_callback;
device->save_item(NAME(state->regs));
diff --git a/src/emu/machine/s3c2400.c b/src/emu/machine/s3c2400.c
index ed330f124cd..0b969b191cb 100644
--- a/src/emu/machine/s3c2400.c
+++ b/src/emu/machine/s3c2400.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2400 )
{
- device_t *device = machine->device( S3C2400_TAG);
+ device_t *device = machine.device( S3C2400_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2400 )
{
- device_t *device = screen->machine->device( S3C2400_TAG);
+ device_t *device = screen->machine().device( S3C2400_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2400 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
space->install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
diff --git a/src/emu/machine/s3c2410.c b/src/emu/machine/s3c2410.c
index 498020ecda3..9dee05b1fbf 100644
--- a/src/emu/machine/s3c2410.c
+++ b/src/emu/machine/s3c2410.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2410 )
{
- device_t *device = machine->device( S3C2410_TAG);
+ device_t *device = machine.device( S3C2410_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2410 )
{
- device_t *device = screen->machine->device( S3C2410_TAG);
+ device_t *device = screen->machine().device( S3C2410_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2410 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
diff --git a/src/emu/machine/s3c2440.c b/src/emu/machine/s3c2440.c
index 359eb41d5bc..445053926ed 100644
--- a/src/emu/machine/s3c2440.c
+++ b/src/emu/machine/s3c2440.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2440 )
{
- device_t *device = machine->device( S3C2440_TAG);
+ device_t *device = machine.device( S3C2440_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2440 )
{
- device_t *device = screen->machine->device( S3C2440_TAG);
+ device_t *device = screen->machine().device( S3C2440_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2440 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
space->install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index 6ec6e637426..fcd4ac80a95 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -225,7 +225,7 @@ static void s3c24xx_lcd_dma_reload( device_t *device)
s3c24xx->lcd.offsize = BITS( s3c24xx->lcd.regs.lcdsaddr3, 21, 11);
s3c24xx->lcd.pagewidth_cur = 0;
s3c24xx->lcd.pagewidth_max = BITS( s3c24xx->lcd.regs.lcdsaddr3, 10, 0);
- verboselog( device->machine, 3, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", s3c24xx->lcd.vramaddr_cur, s3c24xx->lcd.vramaddr_max, s3c24xx->lcd.offsize, s3c24xx->lcd.pagewidth_max);
+ verboselog( device->machine(), 3, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", s3c24xx->lcd.vramaddr_cur, s3c24xx->lcd.vramaddr_max, s3c24xx->lcd.offsize, s3c24xx->lcd.pagewidth_max);
s3c24xx->lcd.dma_data = 0;
s3c24xx->lcd.dma_bits = 0;
}
@@ -238,7 +238,7 @@ static void s3c24xx_lcd_dma_init( device_t *device)
s3c24xx->lcd.bswp = BIT( s3c24xx->lcd.regs.lcdcon5, 1);
s3c24xx->lcd.hwswp = BIT( s3c24xx->lcd.regs.lcdcon5, 0);
s3c24xx->lcd.tpal = s3c24xx->lcd.regs.tpal;
- verboselog( device->machine, 3, "LCD - bppmode %d hwswp %d bswp %d\n", s3c24xx->lcd.bppmode, s3c24xx->lcd.hwswp, s3c24xx->lcd.bswp);
+ verboselog( device->machine(), 3, "LCD - bppmode %d hwswp %d bswp %d\n", s3c24xx->lcd.bppmode, s3c24xx->lcd.hwswp, s3c24xx->lcd.bswp);
s3c24xx->lcd.dma_data = 0;
s3c24xx->lcd.dma_bits = 0;
}
@@ -247,7 +247,7 @@ static void s3c24xx_lcd_dma_init( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
@@ -291,7 +291,7 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
@@ -570,7 +570,7 @@ static void s3c24xx_lcd_render_tft_01( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 32; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 31) & 0x01);
+ *scanline++ = palette_get_color( device->machine(), (data >> 31) & 0x01);
data = data << 1;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 4))
@@ -594,7 +594,7 @@ static void s3c24xx_lcd_render_tft_02( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 16; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 30) & 0x03);
+ *scanline++ = palette_get_color( device->machine(), (data >> 30) & 0x03);
data = data << 2;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 3))
@@ -618,7 +618,7 @@ static void s3c24xx_lcd_render_tft_04( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 8; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 28) & 0x0F);
+ *scanline++ = palette_get_color( device->machine(), (data >> 28) & 0x0F);
data = data << 4;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 2))
@@ -642,7 +642,7 @@ static void s3c24xx_lcd_render_tft_08( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 4; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 24) & 0xFF);
+ *scanline++ = palette_get_color( device->machine(), (data >> 24) & 0xFF);
data = data << 8;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 1))
@@ -684,7 +684,7 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
{
device_t *device = (device_t *)ptr;
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
UINT32 tpalen;
verboselog( machine, 2, "LCD timer callback\n");
s3c24xx->lcd.vpos = screen->vpos();
@@ -725,10 +725,10 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos, s3c24xx->lcd.hpos));
}
-static void s3c24xx_video_start( device_t *device, running_machine *machine)
+static void s3c24xx_video_start( device_t *device, running_machine &machine)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
s3c24xx->lcd.bitmap[0] = screen->alloc_compatible_bitmap();
s3c24xx->lcd.bitmap[1] = screen->alloc_compatible_bitmap();
}
@@ -789,7 +789,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
case S3C24XX_LCDCON1 :
{
// make sure line counter is going
- UINT32 vpos = device->machine->primary_screen->vpos();
+ UINT32 vpos = device->machine().primary_screen->vpos();
if (vpos < s3c24xx->lcd.vpos_min) vpos = s3c24xx->lcd.vpos_min;
if (vpos > s3c24xx->lcd.vpos_max) vpos = s3c24xx->lcd.vpos_max;
data = (data & ~0xFFFC0000) | ((s3c24xx->lcd.vpos_max - vpos) << 18);
@@ -797,7 +797,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
break;
case S3C24XX_LCDCON5 :
{
- UINT32 vpos = device->machine->primary_screen->vpos();
+ UINT32 vpos = device->machine().primary_screen->vpos();
data = data & ~0x00018000;
if (vpos < s3c24xx->lcd.vpos_min) data = data | 0x00000000;
if (vpos > s3c24xx->lcd.vpos_max) data = data | 0x00018000;
@@ -805,19 +805,19 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
}
break;
}
- verboselog( device->machine, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
return data;
}
static void s3c24xx_lcd_configure_tft( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
+ screen_device *screen = device->machine().primary_screen;
UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk;
double framerate, vclk;
UINT32 width, height;
rectangle visarea;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure_tft\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure_tft\n");
vspw = BITS( s3c24xx->lcd.regs.lcdcon2, 5, 0);
vbpd = BITS( s3c24xx->lcd.regs.lcdcon2, 31, 24);
lineval = BITS( s3c24xx->lcd.regs.lcdcon2, 23, 14);
@@ -828,11 +828,11 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
hozval = BITS( s3c24xx->lcd.regs.lcdcon3, 18, 8);
clkval = BITS( s3c24xx->lcd.regs.lcdcon1, 17, 8);
hclk = s3c24xx_get_hclk( device);
- verboselog( device->machine, 3, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk);
+ verboselog( device->machine(), 3, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk);
vclk = (double)(hclk / ((clkval + 1) * 2));
- verboselog( device->machine, 3, "LCD - vclk %f\n", vclk);
+ verboselog( device->machine(), 3, "LCD - vclk %f\n", vclk);
framerate = vclk / (((vspw + 1) + (vbpd + 1) + (lineval + 1) + (vfpd + 1)) * ((hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1)));
- verboselog( device->machine, 3, "LCD - framerate %f\n", framerate);
+ verboselog( device->machine(), 3, "LCD - framerate %f\n", framerate);
s3c24xx->lcd.framerate = framerate;
width = (hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1);
height = (vspw + 1) + (vbpd + 1) + (lineval + 1) + (vfpd + 1);
@@ -840,8 +840,8 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
visarea.min_y = (vspw + 1) + (vbpd + 1);
visarea.max_x = visarea.min_x + (hozval + 1) - 1;
visarea.max_y = visarea.min_y + (lineval + 1) - 1;
- verboselog( device->machine, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- verboselog( device->machine, 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
+ verboselog( device->machine(), 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
+ verboselog( device->machine(), 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
s3c24xx->lcd.hpos_min = (hspw + 1) + (hbpd + 1);
s3c24xx->lcd.hpos_max = s3c24xx->lcd.hpos_min + (hozval + 1) - 1;
s3c24xx->lcd.vpos_min = (vspw + 1) + (vbpd + 1);
@@ -852,12 +852,12 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
static void s3c24xx_lcd_configure_stn( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
+ screen_device *screen = device->machine().primary_screen;
UINT32 pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk;
double vclk, framerate;
UINT32 width, height;
rectangle visarea;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure_stn\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure_stn\n");
pnrmode = BITS( s3c24xx->lcd.regs.lcdcon1, 6, 5);
bppmode = BITS( s3c24xx->lcd.regs.lcdcon1, 4, 1);
clkval = BITS( s3c24xx->lcd.regs.lcdcon1, 17, 8);
@@ -867,11 +867,11 @@ static void s3c24xx_lcd_configure_stn( device_t *device)
lineblank = BITS( s3c24xx->lcd.regs.lcdcon3, 7, 0);
wlh = BITS( s3c24xx->lcd.regs.lcdcon4, 1, 0);
hclk = s3c24xx_get_hclk( device);
- verboselog( device->machine, 3, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk);
+ verboselog( device->machine(), 3, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk);
vclk = (double)(hclk / ((clkval + 0) * 2));
- verboselog( device->machine, 3, "LCD - vclk %f\n", vclk);
+ verboselog( device->machine(), 3, "LCD - vclk %f\n", vclk);
framerate = 1 / (((1 / vclk) * (hozval + 1) + (1 / hclk) * ((1 << (4 + wlh)) + (1 << (4 + wdly)) + (lineblank * 8))) * (lineval + 1));
- verboselog( device->machine, 3, "LCD - framerate %f\n", framerate);
+ verboselog( device->machine(), 3, "LCD - framerate %f\n", framerate);
switch (pnrmode)
{
case S3C24XX_PNRMODE_STN_04_SS : width = ((hozval + 1) * 4); break;
@@ -885,8 +885,8 @@ static void s3c24xx_lcd_configure_stn( device_t *device)
visarea.min_y = 0;
visarea.max_x = width - 1;
visarea.max_y = height - 1;
- verboselog( device->machine, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- verboselog( device->machine, 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
+ verboselog( device->machine(), 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
+ verboselog( device->machine(), 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
s3c24xx->lcd.hpos_min = 0;
s3c24xx->lcd.hpos_max = width - 1;
s3c24xx->lcd.vpos_min = 0;
@@ -898,7 +898,7 @@ static void s3c24xx_lcd_configure( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 bppmode;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure\n");
bppmode = BITS( s3c24xx->lcd.regs.lcdcon1, 4, 1);
if ((bppmode & (1 << 3)) == 0)
{
@@ -913,8 +913,8 @@ static void s3c24xx_lcd_configure( device_t *device)
static void s3c24xx_lcd_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
- verboselog( device->machine, 1, "LCD start\n");
+ screen_device *screen = device->machine().primary_screen;
+ verboselog( device->machine(), 1, "LCD start\n");
s3c24xx_lcd_configure( device);
s3c24xx_lcd_dma_init( device);
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos_min, s3c24xx->lcd.hpos_min));
@@ -923,7 +923,7 @@ static void s3c24xx_lcd_start( device_t *device)
static void s3c24xx_lcd_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "LCD stop\n");
+ verboselog( device->machine(), 1, "LCD stop\n");
s3c24xx->lcd.timer->adjust( attotime::never);
}
@@ -944,7 +944,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_lcd_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->lcd.regs)[offset];
- verboselog( device->machine, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->lcd.regs)[offset]);
switch (offset)
{
@@ -965,20 +965,20 @@ static READ32_DEVICE_HANDLER( s3c24xx_lcd_palette_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->lcdpal.regs.data[offset];
- verboselog( device->machine, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_lcd_palette_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
COMBINE_DATA(&s3c24xx->lcdpal.regs.data[offset]);
if (mem_mask != 0xffffffff)
{
- verboselog( device->machine, 0, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask);
+ verboselog( device->machine(), 0, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask);
}
- palette_set_color( device->machine, offset, s3c24xx_get_color_tft_16( device, data & 0xFFFF));
+ palette_set_color( device->machine(), offset, s3c24xx_get_color_tft_16( device, data & 0xFFFF));
}
/* Clock & Power Management */
@@ -1025,21 +1025,21 @@ static READ32_DEVICE_HANDLER( s3c24xx_clkpow_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->clkpow.regs)[offset];
- verboselog( device->machine, 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_clkpow_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->clkpow.regs)[offset]);
switch (offset)
{
case S3C24XX_MPLLCON :
{
- verboselog( device->machine, 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk( device), s3c24xx_get_hclk( device), s3c24xx_get_pclk( device));
- device->machine->device( "maincpu")->set_unscaled_clock(s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
+ verboselog( device->machine(), 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk( device), s3c24xx_get_hclk( device), s3c24xx_get_pclk( device));
+ device->machine().device( "maincpu")->set_unscaled_clock(s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
}
break;
}
@@ -1065,7 +1065,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
s3c24xx->irq.regs.intoffset = int_type;
if (s3c24xx->irq.line_irq != ASSERT_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
s3c24xx->irq.line_irq = ASSERT_LINE;
}
}
@@ -1073,7 +1073,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
{
if (s3c24xx->irq.line_irq != CLEAR_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
s3c24xx->irq.line_irq = CLEAR_LINE;
}
}
@@ -1089,7 +1089,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
}
if (s3c24xx->irq.line_fiq != ASSERT_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_FIRQ_LINE, ASSERT_LINE);
s3c24xx->irq.line_fiq = ASSERT_LINE;
}
}
@@ -1097,7 +1097,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
{
if (s3c24xx->irq.line_fiq != CLEAR_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_FIRQ_LINE, CLEAR_LINE);
s3c24xx->irq.line_fiq = CLEAR_LINE;
}
}
@@ -1106,7 +1106,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
static void s3c24xx_request_irq( device_t *device, UINT32 int_type)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request irq %d\n", int_type);
+ verboselog( device->machine(), 5, "request irq %d\n", int_type);
s3c24xx->irq.regs.srcpnd |= (1 << int_type);
s3c24xx_check_pending_irq( device);
}
@@ -1132,7 +1132,7 @@ static void s3c24xx_check_pending_subirq( device_t *device)
ATTR_UNUSED static void s3c24xx_request_subirq( device_t *device, UINT32 int_type)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request subirq %d\n", int_type);
+ verboselog( device->machine(), 5, "request subirq %d\n", int_type);
s3c24xx->irq.regs.subsrcpnd |= (1 << int_type);
s3c24xx_check_pending_subirq( device);
}
@@ -1163,7 +1163,7 @@ static void s3c24xx_check_pending_eint( device_t *device)
ATTR_UNUSED static void s3c24xx_request_eint( device_t *device, UINT32 number)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request external interrupt %d\n", number);
+ verboselog( device->machine(), 5, "request external interrupt %d\n", number);
if (number < 4)
{
s3c24xx_request_irq( device, S3C24XX_INT_EINT0 + number);
@@ -1181,7 +1181,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_irq_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->irq.regs)[offset];
- verboselog( device->machine, 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
return data;
}
@@ -1189,7 +1189,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_irq_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->irq.regs)[offset];
- verboselog( device->machine, 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->irq.regs)[offset]);
switch (offset)
{
@@ -1274,7 +1274,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_pwm_r )
}
break;
}
- verboselog( device->machine, 9, "(PWM) %08X -> %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(PWM) %08X -> %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
return data;
}
@@ -1286,7 +1286,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
const int mux_shift[] = { 0, 4, 8, 12, 16};
UINT32 pclk, prescaler, mux, cnt, cmp, auto_reload;
double freq, hz;
- verboselog( device->machine, 1, "PWM %d start\n", timer);
+ verboselog( device->machine(), 1, "PWM %d start\n", timer);
pclk = s3c24xx_get_pclk( device);
prescaler = (s3c24xx->pwm.regs.tcfg0 >> prescaler_shift[timer]) & 0xFF;
mux = (s3c24xx->pwm.regs.tcfg1 >> mux_shift[timer]) & 0x0F;
@@ -1351,7 +1351,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
{
hz = freq / cnt;
}
- verboselog( device->machine, 5, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz);
+ verboselog( device->machine(), 5, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz);
s3c24xx->pwm.cnt[timer] = cnt;
s3c24xx->pwm.cmp[timer] = cmp;
s3c24xx->pwm.freq[timer] = freq;
@@ -1368,7 +1368,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
static void s3c24xx_pwm_stop( device_t *device, int timer)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "PWM %d stop\n", timer);
+ verboselog( device->machine(), 1, "PWM %d stop\n", timer);
s3c24xx->pwm.timer[timer]->adjust( attotime::never);
}
@@ -1390,7 +1390,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_pwm_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->pwm.regs)[offset];
- verboselog( device->machine, 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->pwm.regs)[offset]);
switch (offset)
{
@@ -1454,10 +1454,10 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
UINT32 curr_tc, curr_src, curr_dst;
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
int dsz, inc_src, inc_dst, servmode, tsz;
const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3};
- verboselog( device->machine, 5, "DMA %d trigger\n", ch);
+ verboselog( device->machine(), 5, "DMA %d trigger\n", ch);
curr_tc = S3C24XX_DSTAT_GET_CURR_TC( regs->dstat);
dsz = S3C24XX_DCON_GET_DSZ( regs->dcon);
curr_src = S3C24XX_DCSRC_GET_CURR_SRC( regs->dcsrc);
@@ -1471,7 +1471,7 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
inc_src = BIT( regs->disrcc, 0);
inc_dst = BIT( regs->didstc, 0);
#endif
- verboselog( device->machine, 5, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz);
+ verboselog( device->machine(), 5, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz);
while (curr_tc > 0)
{
curr_tc--;
@@ -1512,7 +1512,7 @@ static void s3c24xx_dma_request_iis( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[2].regs;
- verboselog( device->machine, 5, "s3c24xx_dma_request_iis\n");
+ verboselog( device->machine(), 5, "s3c24xx_dma_request_iis\n");
if ((S3C24XX_DMASKTRIG_GET_ON_OFF( regs->dmasktrig) != 0) && (S3C24XX_DCON_GET_SWHWSEL( regs->dcon) != 0) && (S3C24XX_DCON_GET_HWSRCSEL( regs->dcon) == 0))
{
s3c24xx_dma_trigger( device, 2);
@@ -1522,7 +1522,7 @@ static void s3c24xx_dma_request_iis( device_t *device)
static void s3c24xx_dma_request_pwm( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "s3c24xx_dma_request_pwm\n");
+ verboselog( device->machine(), 5, "s3c24xx_dma_request_pwm\n");
for (int i = 0; i < 4; i++)
{
if (i != 1)
@@ -1543,7 +1543,7 @@ static void s3c24xx_dma_start( device_t *device, int ch)
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
UINT32 dsz, tsz, reload;
int inc_src, inc_dst, _int, servmode, swhwsel, hwsrcsel;
- verboselog( device->machine, 1, "DMA %d start\n", ch);
+ verboselog( device->machine(), 1, "DMA %d start\n", ch);
addr_src = S3C24XX_DISRC_GET_SADDR( regs->disrc);
addr_dst = S3C24XX_DIDST_GET_DADDR( regs->didst);
tc = S3C24XX_DCON_GET_TC( regs->dcon);
@@ -1561,8 +1561,8 @@ static void s3c24xx_dma_start( device_t *device, int ch)
inc_src = BIT( regs->disrcc, 0);
inc_dst = BIT( regs->didstc, 0);
#endif
- verboselog( device->machine, 5, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc);
- verboselog( device->machine, 5, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc");
+ verboselog( device->machine(), 5, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc);
+ verboselog( device->machine(), 5, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc");
s3c24xx_dma_reload( device, ch);
if (swhwsel == 0)
{
@@ -1572,7 +1572,7 @@ static void s3c24xx_dma_start( device_t *device, int ch)
static void s3c24xx_dma_stop( device_t *device, int ch)
{
- verboselog( device->machine, 1, "DMA %d stop\n", ch);
+ verboselog( device->machine(), 1, "DMA %d stop\n", ch);
}
static void s3c24xx_dma_recalc( device_t *device, int ch)
@@ -1626,52 +1626,52 @@ static void s3c24xx_dma_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 da
static READ32_DEVICE_HANDLER( s3c24xx_dma_0_r )
{
UINT32 data = s3c24xx_dma_r( device, 0, offset);
- verboselog( device->machine, 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_1_r )
{
UINT32 data = s3c24xx_dma_r( device, 1, offset);
- verboselog( device->machine, 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_2_r )
{
UINT32 data = s3c24xx_dma_r( device, 2, offset);
- verboselog( device->machine, 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_3_r )
{
UINT32 data = s3c24xx_dma_r( device, 3, offset);
- verboselog( device->machine, 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_0_w )
{
- verboselog( device->machine, 9, "(DMA 0) %08X <- %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 0) %08X <- %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
s3c24xx_dma_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_1_w )
{
- verboselog( device->machine, 9, "(DMA 1) %08X <- %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 1) %08X <- %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
s3c24xx_dma_w( device, 1, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_2_w )
{
- verboselog( device->machine, 9, "(DMA 2) %08X <- %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 2) %08X <- %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
s3c24xx_dma_w( device, 2, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_3_w )
{
- verboselog( device->machine, 9, "(DMA 3) %08X <- %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 3) %08X <- %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
s3c24xx_dma_w( device, 3, offset, data, mem_mask);
}
@@ -1761,7 +1761,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_gpio_r )
break;
#endif
}
- verboselog( device->machine, 9, "(GPIO) %08X -> %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
+ verboselog( device->machine(), 9, "(GPIO) %08X -> %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
return data;
}
@@ -1771,7 +1771,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_gpio_w )
#if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440)
UINT32 old_value = ((UINT32*)&s3c24xx->gpio.regs)[offset];
#endif
- verboselog( device->machine, 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
+ verboselog( device->machine(), 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->gpio.regs)[offset]);
switch (offset)
{
@@ -1844,14 +1844,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_memcon_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->memcon.regs.data[offset];
- verboselog( device->machine, 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_memcon_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(MEMCON) %08X <- %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MEMCON) %08X <- %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
COMBINE_DATA(&s3c24xx->memcon.regs.data[offset]);
}
@@ -1870,14 +1870,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_usb_host_r )
}
break;
}
- verboselog( device->machine, 9, "(USB H) %08X -> %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB H) %08X -> %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_usb_host_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(USB H) %08X <- %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB H) %08X <- %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
COMBINE_DATA(&s3c24xx->usbhost.regs.data[offset]);
}
@@ -1897,7 +1897,7 @@ static UINT32 s3c24xx_uart_r( device_t *device, UINT32 ch, UINT32 offset)
case S3C24XX_URXH :
{
UINT8 rxdata = data & 0xFF;
- verboselog( device->machine, 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?');
+ verboselog( device->machine(), 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?');
s3c24xx->uart[ch].regs.utrstat &= ~1; // [bit 0] Receive buffer data ready
}
break;
@@ -1914,7 +1914,7 @@ static void s3c24xx_uart_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 d
case S3C24XX_UTXH :
{
UINT8 txdata = data & 0xFF;
- verboselog( device->machine, 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
+ verboselog( device->machine(), 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
#ifdef UART_PRINTF
printf( "%c", ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
#endif
@@ -1926,14 +1926,14 @@ static void s3c24xx_uart_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 d
static READ32_DEVICE_HANDLER( s3c24xx_uart_0_r )
{
UINT32 data = s3c24xx_uart_r( device, 0, offset);
-// verboselog( device->machine, 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_uart_1_r )
{
UINT32 data = s3c24xx_uart_r( device, 1, offset);
-// verboselog( device->machine, 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
return data;
}
@@ -1942,7 +1942,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_uart_1_r )
static READ32_DEVICE_HANDLER( s3c24xx_uart_2_r )
{
UINT32 data = s3c24xx_uart_r( device, 2, offset);
-// verboselog( device->machine, 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
return data;
}
@@ -1950,13 +1950,13 @@ static READ32_DEVICE_HANDLER( s3c24xx_uart_2_r )
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_0_w )
{
-// verboselog( device->machine, 9, "(UART 0) %08X <- %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 0) %08X <- %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
s3c24xx_uart_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_1_w )
{
-// verboselog( device->machine, 9, "(UART 1) %08X <- %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 1) %08X <- %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
s3c24xx_uart_w( device, 1, offset, data, mem_mask);
}
@@ -1964,7 +1964,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_uart_1_w )
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_2_w )
{
-// verboselog( device->machine, 9, "(UART 2) %08X <- %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 2) %08X <- %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
s3c24xx_uart_w( device, 2, offset, data, mem_mask);
}
@@ -1984,14 +1984,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_usb_device_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->usbdev.regs.data[offset];
- verboselog( device->machine, 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_usb_device_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(USB D) %08X <- %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB D) %08X <- %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
COMBINE_DATA(&s3c24xx->usbdev.regs.data[offset]);
}
@@ -2039,7 +2039,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_wdt_r )
}
break;
}
- verboselog( device->machine, 9, "(WDT) %08X -> %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(WDT) %08X -> %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
return data;
}
@@ -2048,13 +2048,13 @@ static void s3c24xx_wdt_start( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
UINT32 pclk, prescaler, clock;
double freq, hz;
- verboselog( device->machine, 1, "WDT start\n");
+ verboselog( device->machine(), 1, "WDT start\n");
pclk = s3c24xx_get_pclk( device);
prescaler = BITS( s3c24xx->wdt.regs.wtcon, 15, 8);
clock = 16 << BITS( s3c24xx->wdt.regs.wtcon, 4, 3);
freq = (double)pclk / (prescaler + 1) / clock;
hz = freq / s3c24xx->wdt.regs.wtcnt;
- verboselog( device->machine, 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz);
+ verboselog( device->machine(), 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz);
s3c24xx->wdt.timer->adjust( attotime::from_hz( hz), 0, attotime::from_hz( hz));
#if defined(DEVICE_S3C2410)
s3c24xx->wdt.freq = freq;
@@ -2065,7 +2065,7 @@ static void s3c24xx_wdt_start( device_t *device)
static void s3c24xx_wdt_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "WDT stop\n");
+ verboselog( device->machine(), 1, "WDT stop\n");
s3c24xx->wdt.regs.wtcnt = s3c24xx_wdt_calc_current_count( device);
s3c24xx->wdt.timer->adjust( attotime::never);
}
@@ -2087,7 +2087,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_wdt_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->wdt.regs)[offset];
- verboselog( device->machine, 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->wdt.regs)[offset]);
switch (offset)
{
@@ -2156,7 +2156,7 @@ INLINE int iface_i2c_sda_r( device_t *device)
static void i2c_send_start( device_t *device)
{
- verboselog( device->machine, 5, "i2c_send_start\n");
+ verboselog( device->machine(), 5, "i2c_send_start\n");
iface_i2c_sda_w( device, 1);
iface_i2c_scl_w( device, 1);
iface_i2c_sda_w( device, 0);
@@ -2165,7 +2165,7 @@ static void i2c_send_start( device_t *device)
static void i2c_send_stop( device_t *device)
{
- verboselog( device->machine, 5, "i2c_send_stop\n");
+ verboselog( device->machine(), 5, "i2c_send_stop\n");
iface_i2c_sda_w( device, 0);
iface_i2c_scl_w( device, 1);
iface_i2c_sda_w( device, 1);
@@ -2175,7 +2175,7 @@ static void i2c_send_stop( device_t *device)
static UINT8 i2c_receive_byte( device_t *device, int ack)
{
UINT8 data = 0;
- verboselog( device->machine, 5, "i2c_receive_byte ...\n");
+ verboselog( device->machine(), 5, "i2c_receive_byte ...\n");
iface_i2c_sda_w( device, 1);
for (int i = 0; i < 8; i++)
{
@@ -2183,8 +2183,8 @@ static UINT8 i2c_receive_byte( device_t *device, int ack)
data = (data << 1) + (iface_i2c_sda_r( device) ? 1 : 0);
iface_i2c_scl_w( device, 0);
}
- verboselog( device->machine, 5, "recv data %02X\n", data);
- verboselog( device->machine, 5, "send ack %d\n", ack);
+ verboselog( device->machine(), 5, "recv data %02X\n", data);
+ verboselog( device->machine(), 5, "send ack %d\n", ack);
iface_i2c_sda_w( device, ack ? 0 : 1);
iface_i2c_scl_w( device, 1);
iface_i2c_scl_w( device, 0);
@@ -2194,8 +2194,8 @@ static UINT8 i2c_receive_byte( device_t *device, int ack)
static int i2c_send_byte( device_t *device, UINT8 data)
{
int ack;
- verboselog( device->machine, 5, "i2c_send_byte ...\n");
- verboselog( device->machine, 5, "send data %02X\n", data);
+ verboselog( device->machine(), 5, "i2c_send_byte ...\n");
+ verboselog( device->machine(), 5, "send data %02X\n", data);
for (int i = 0; i < 8; i++)
{
iface_i2c_sda_w( device, (data & 0x80) ? 1 : 0);
@@ -2206,7 +2206,7 @@ static int i2c_send_byte( device_t *device, UINT8 data)
iface_i2c_sda_w( device, 1); // ack bit
iface_i2c_scl_w( device, 1);
ack = iface_i2c_sda_r( device);
- verboselog( device->machine, 5, "recv ack %d\n", ack);
+ verboselog( device->machine(), 5, "recv ack %d\n", ack);
iface_i2c_scl_w( device, 0);
return ack;
}
@@ -2215,7 +2215,7 @@ static void iic_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
int mode_selection;
- verboselog( device->machine, 1, "IIC start\n");
+ verboselog( device->machine(), 1, "IIC start\n");
i2c_send_start( device);
mode_selection = BITS( s3c24xx->iic.regs.iicstat, 7, 6);
switch (mode_selection)
@@ -2229,7 +2229,7 @@ static void iic_start( device_t *device)
static void iic_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "IIC stop\n");
+ verboselog( device->machine(), 1, "IIC stop\n");
i2c_send_stop( device);
s3c24xx->iic.timer->adjust( attotime::never);
}
@@ -2238,7 +2238,7 @@ static void iic_resume( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
int mode_selection;
- verboselog( device->machine, 1, "IIC resume\n");
+ verboselog( device->machine(), 1, "IIC resume\n");
mode_selection = BITS( s3c24xx->iic.regs.iicstat, 7, 6);
switch (mode_selection)
{
@@ -2260,7 +2260,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_iic_r )
}
break;
}
- verboselog( device->machine, 9, "(IIC) %08X -> %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIC) %08X -> %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
return data;
}
@@ -2268,7 +2268,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_iic_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->iic.regs)[offset];
- verboselog( device->machine, 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->iic.regs)[offset]);
switch (offset)
{
@@ -2375,21 +2375,21 @@ static void s3c24xx_iis_start( device_t *device)
const UINT32 codeclk_table[] = { 256, 384};
double freq;
int pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk;
- verboselog( device->machine, 1, "IIS start\n");
+ verboselog( device->machine(), 1, "IIS start\n");
prescaler_enable = BIT( s3c24xx->iis.regs.iiscon, 1);
prescaler_control_a = BITS( s3c24xx->iis.regs.iispsr, 9, 5);
prescaler_control_b = BITS( s3c24xx->iis.regs.iispsr, 4, 0);
codeclk = BIT( s3c24xx->iis.regs.iismod, 2);
pclk = s3c24xx_get_pclk( device);
freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two?
- verboselog( device->machine, 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq);
+ verboselog( device->machine(), 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq);
s3c24xx->iis.timer->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq));
}
static void s3c24xx_iis_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "IIS stop\n");
+ verboselog( device->machine(), 1, "IIS stop\n");
s3c24xx->iis.timer->adjust( attotime::never);
}
@@ -2420,7 +2420,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_iis_r )
break;
}
#endif
- verboselog( device->machine, 9, "(IIS) %08X -> %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIS) %08X -> %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
return data;
}
@@ -2428,7 +2428,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_iis_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->iis.regs)[offset];
- verboselog( device->machine, 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->iis.regs)[offset]);
switch (offset)
{
@@ -2486,7 +2486,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_rtc_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->rtc.regs)[offset];
- verboselog( device->machine, 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
return data;
}
@@ -2511,7 +2511,7 @@ static void s3c24xx_rtc_recalc( device_t *device)
static WRITE32_DEVICE_HANDLER( s3c24xx_rtc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->rtc.regs)[offset]);
switch (offset)
{
@@ -2573,7 +2573,7 @@ static void s3c24xx_rtc_update( device_t *device)
}
}
}
- verboselog( device->machine, 5, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( s3c24xx->rtc.regs.bcdyear) + 2000, bcd_2_dec( s3c24xx->rtc.regs.bcdmon), bcd_2_dec( s3c24xx->rtc.regs.bcdday), bcd_2_dec( s3c24xx->rtc.regs.bcdhour), bcd_2_dec( s3c24xx->rtc.regs.bcdmin), bcd_2_dec( s3c24xx->rtc.regs.bcdsec));
+ verboselog( device->machine(), 5, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( s3c24xx->rtc.regs.bcdyear) + 2000, bcd_2_dec( s3c24xx->rtc.regs.bcdmon), bcd_2_dec( s3c24xx->rtc.regs.bcdday), bcd_2_dec( s3c24xx->rtc.regs.bcdhour), bcd_2_dec( s3c24xx->rtc.regs.bcdmin), bcd_2_dec( s3c24xx->rtc.regs.bcdsec));
}
static void s3c24xx_rtc_check_alarm( device_t *device)
@@ -2643,14 +2643,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_adc_r )
break;
#endif
}
- verboselog( device->machine, 9, "(ADC) %08X -> %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(ADC) %08X -> %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
return data;
}
static void s3c24xx_adc_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "ADC start\n");
+ verboselog( device->machine(), 1, "ADC start\n");
s3c24xx->adc.regs.adccon &= ~(1 << 0); // A/D conversion is completed
s3c24xx->adc.regs.adccon |= (1 << 15); // End of A/D conversion
}
@@ -2659,7 +2659,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_adc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->adc.regs)[offset];
- verboselog( device->machine, 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->adc.regs)[offset]);
switch (offset)
{
@@ -2712,7 +2712,7 @@ static void s3c24xx_spi_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 da
static READ32_DEVICE_HANDLER( s3c24xx_spi_0_r )
{
UINT32 data = s3c24xx_spi_r( device, 0, offset);
- verboselog( device->machine, 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
return data;
}
@@ -2721,7 +2721,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_spi_0_r )
static READ32_DEVICE_HANDLER( s3c24xx_spi_1_r )
{
UINT32 data = s3c24xx_spi_r( device, 1, offset);
- verboselog( device->machine, 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
return data;
}
@@ -2729,7 +2729,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_spi_1_r )
static WRITE32_DEVICE_HANDLER( s3c24xx_spi_0_w )
{
- verboselog( device->machine, 9, "(SPI 0) %08X <- %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 0) %08X <- %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
s3c24xx_spi_w( device, 0, offset, data, mem_mask);
}
@@ -2737,7 +2737,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_spi_0_w )
static WRITE32_DEVICE_HANDLER( s3c24xx_spi_1_w )
{
- verboselog( device->machine, 9, "(SPI 1) %08X <- %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 1) %08X <- %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
s3c24xx_spi_w( device, 1, offset, data, mem_mask);
}
@@ -2751,14 +2751,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_mmc_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->mmc.regs.data[offset];
- verboselog( device->machine, 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_mmc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(MMC) %08X <- %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MMC) %08X <- %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
COMBINE_DATA(&s3c24xx->mmc.regs.data[offset]);
}
@@ -2772,14 +2772,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_sdi_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->sdi.regs.data[offset];
- verboselog( device->machine, 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_sdi_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(SDI) %08X <- %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SDI) %08X <- %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
COMBINE_DATA(&s3c24xx->sdi.regs.data[offset]);
}
@@ -2903,7 +2903,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[1] = s3c24xx->nand.mecc[1];
temp[2] = s3c24xx->nand.mecc[2];
nand_update_mecc( s3c24xx->nand.mecc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2]);
+ verboselog( device->machine(), 5, "NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2]);
if (s3c24xx->nand.pos == 512) s3c24xx->nand.pos = 0;
#else
if ((s3c24xx->nand.regs.nfcont & (1 << 5)) == 0)
@@ -2913,7 +2913,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[2] = s3c24xx->nand.mecc[2];
temp[3] = s3c24xx->nand.mecc[3];
nand_update_mecc( s3c24xx->nand.mecc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], temp[3], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2], s3c24xx->nand.mecc[3]);
+ verboselog( device->machine(), 5, "NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], temp[3], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2], s3c24xx->nand.mecc[3]);
if (s3c24xx->nand.pos == 2048) s3c24xx->nand.pos = 0;
}
if ((s3c24xx->nand.regs.nfcont & (1 << 6)) == 0)
@@ -2921,7 +2921,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[0] = s3c24xx->nand.secc[0];
temp[1] = s3c24xx->nand.secc[1];
nand_update_secc( s3c24xx->nand.secc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - SECC %02X - %02X %02X -> %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], s3c24xx->nand.secc[0], s3c24xx->nand.secc[1]);
+ verboselog( device->machine(), 5, "NAND - SECC %02X - %02X %02X -> %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], s3c24xx->nand.secc[0], s3c24xx->nand.secc[1]);
if (s3c24xx->nand.pos == 16) s3c24xx->nand.pos = 0;
}
#endif
@@ -2929,27 +2929,27 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
static void s3c24xx_nand_command_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write command %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write command %02X\n", data);
iface_nand_command_w( device, data);
}
static void s3c24xx_nand_address_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write address %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write address %02X\n", data);
iface_nand_address_w( device, data);
}
static UINT8 s3c24xx_nand_data_r( device_t *device)
{
UINT8 data = iface_nand_data_r( device);
- verboselog( device->machine, 5, "NAND data read %02X\n", data);
+ verboselog( device->machine(), 5, "NAND data read %02X\n", data);
s3c24xx_nand_update_ecc( device, data);
return data;
}
static void s3c24xx_nand_data_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write data %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write data %02X\n", data);
iface_nand_data_w( device, data);
s3c24xx_nand_update_ecc( device, data);
}
@@ -3001,14 +3001,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_nand_r )
break;
#endif
}
- verboselog( device->machine, 9, "(NAND) %08X -> %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask);
+ verboselog( device->machine(), 9, "(NAND) %08X -> %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask);
return data;
}
static void s3c24xx_nand_init_ecc( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "NAND - init ecc\n");
+ verboselog( device->machine(), 5, "NAND - init ecc\n");
#if defined(DEVICE_S3C2410)
s3c24xx->nand.mecc[0] = 0;
s3c24xx->nand.mecc[1] = 0;
@@ -3028,7 +3028,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_nand_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->nand.regs)[offset];
- verboselog( device->machine, 9, "(NAND) %08X <- %08X\n", S3C24XX_BASE_NAND + (offset << 2), data);
+ verboselog( device->machine(), 9, "(NAND) %08X <- %08X\n", S3C24XX_BASE_NAND + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->nand.regs)[offset]);
switch (offset)
{
@@ -3117,14 +3117,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_cam_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->cam.regs.data[offset];
- verboselog( device->machine, 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_cam_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(CAM) %08X <- %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CAM) %08X <- %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
COMBINE_DATA(&s3c24xx->cam.regs.data[offset]);
}
@@ -3138,14 +3138,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_ac97_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->ac97.regs.data[offset];
- verboselog( device->machine, 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_ac97_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(AC97) %08X <- %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(AC97) %08X <- %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
COMBINE_DATA(&s3c24xx->ac97.regs.data[offset]);
}
@@ -3168,14 +3168,14 @@ static DEVICE_START( s3c24xx )
{
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx->iface = (const s3c24xx_interface *)device->baseconfig().static_config();
- for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device);
- for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device);
- s3c24xx->iic.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device);
- s3c24xx->iis.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iis_timer_exp), (void*)device);
- s3c24xx->lcd.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_lcd_timer_exp), (void*)device);
- s3c24xx->rtc.timer_tick_count = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device);
- s3c24xx->rtc.timer_update = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device);
- s3c24xx->wdt.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device);
+ for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device);
+ for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device);
+ s3c24xx->iic.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device);
+ s3c24xx->iis.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_iis_timer_exp), (void*)device);
+ s3c24xx->lcd.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_lcd_timer_exp), (void*)device);
+ s3c24xx->rtc.timer_tick_count = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device);
+ s3c24xx->rtc.timer_update = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device);
+ s3c24xx->wdt.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device);
s3c24xx->rtc.timer_update->adjust( attotime::from_msec( 1000), 0, attotime::from_msec( 1000));
s3c24xx_rtc_init( device);
}
diff --git a/src/emu/machine/scsi.c b/src/emu/machine/scsi.c
index 1ddf429bed8..9506bb1fe0a 100644
--- a/src/emu/machine/scsi.c
+++ b/src/emu/machine/scsi.c
@@ -1,12 +1,12 @@
#include "emu.h"
#include "scsi.h"
-void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
+void SCSIAllocInstance( running_machine &machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
{
SCSIAllocInstanceParams params;
params.instance = NULL;
params.diskregion = diskregion;
- params.machine = machine;
+ params.m_machine = &machine;
scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, 0, &params );
*instance = params.instance;
}
@@ -104,11 +104,11 @@ int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intpa
return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm );
}
-SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass )
+SCSIInstance *SCSIMalloc( running_machine &machine, const SCSIClass *scsiClass )
{
SCSIInstance *scsiInstance = (SCSIInstance *)auto_alloc_array(machine, UINT8, SCSISizeof( scsiClass ));
scsiInstance->scsiClass = scsiClass;
- scsiInstance->machine = machine;
+ scsiInstance->m_machine = &machine;
return scsiInstance;
}
diff --git a/src/emu/machine/scsi.h b/src/emu/machine/scsi.h
index 3bc85c05417..b040e32230a 100644
--- a/src/emu/machine/scsi.h
+++ b/src/emu/machine/scsi.h
@@ -20,15 +20,17 @@ typedef struct _SCSIClass
typedef struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
const SCSIClass *scsiClass;
- running_machine *machine;
+ running_machine *m_machine;
} SCSIInstance;
typedef struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
SCSIInstance *instance;
const char *diskregion;
- running_machine *machine;
+ running_machine *m_machine;
} SCSIAllocInstanceParams;
// commands accepted by a SCSI device's dispatch handler
@@ -84,7 +86,7 @@ enum
#define SCSI_PHASE_MESSAGE_OUT ( 6 )
#define SCSI_PHASE_MESSAGE_IN ( 7 )
-extern void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
+extern void SCSIAllocInstance( running_machine &machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
extern void SCSIDeleteInstance( SCSIInstance *instance );
extern void SCSISetDevice( SCSIInstance *instance, void *device );
extern void SCSIGetDevice( SCSIInstance *instance, void **device );
@@ -97,7 +99,7 @@ extern void SCSIReadData( SCSIInstance *instance, void *data, int dataLength );
extern void SCSISetPhase( SCSIInstance *instance, int phase );
extern void SCSIGetPhase( SCSIInstance *instance, int *phase );
-extern SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass );
+extern SCSIInstance *SCSIMalloc( running_machine &machine, const SCSIClass *scsiClass );
extern int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm );
extern void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance );
extern int SCSISizeof( const SCSIClass *scsiClass );
diff --git a/src/emu/machine/scsicd.c b/src/emu/machine/scsicd.c
index 8dfb0ff7e72..3034981819f 100644
--- a/src/emu/machine/scsicd.c
+++ b/src/emu/machine/scsicd.c
@@ -70,7 +70,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return SCSILengthFromUINT8( &command[ 4 ] );
case 0x1b: // START STOP UNIT
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -103,7 +103,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
our_this->cur_subblock = 0;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -143,7 +143,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
length = 4;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -173,7 +173,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (cdrom_get_track_type(cdrom, trk) == CD_TRACK_AUDIO)
{
our_this->play_err_flag = 0;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -203,7 +203,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (our_this->blocks && cdrom)
{
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -215,7 +215,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
case 0x4b: // PAUSE/RESUME
if (cdrom)
{
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_pause_audio(cdda, (command[8] & 0x01) ^ 0x01);
}
@@ -254,7 +254,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (cdrom_get_track_type(cdrom, trk) == CD_TRACK_AUDIO)
{
our_this->play_err_flag = 0;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -282,7 +282,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
our_this->cur_subblock = 0;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -329,7 +329,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
data[0] = 0x71; // deferred error
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL && cdda_audio_active(cdda))
{
data[12] = 0x00;
@@ -422,7 +422,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
msf = command[1] & 0x2;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
audio_active = cdda != NULL && cdda_audio_active(cdda);
if (audio_active)
{
@@ -671,7 +671,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0;
@@ -690,9 +690,9 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
state_save_register_item( machine, "scsicd", diskregion, 0, our_this->cur_subblock );
state_save_register_item( machine, "scsicd", diskregion, 0, our_this->play_err_flag );
- if (machine->device( diskregion )) {
+ if (machine.device( diskregion )) {
our_this->is_file = TRUE;
- our_this->cdrom = cd_get_cdrom_file( machine->device( diskregion ) );
+ our_this->cdrom = cd_get_cdrom_file( machine.device( diskregion ) );
} else {
our_this->is_file = FALSE;
our_this->cdrom = cdrom_open(get_disk_handle( machine, diskregion ));
diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c
index 0018fa17305..c20f8f23ac8 100644
--- a/src/emu/machine/scsidev.c
+++ b/src/emu/machine/scsidev.c
@@ -28,7 +28,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return 0;
default:
- logerror( "%s: SCSIDEV unknown command %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown command %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
return 0;
}
}
@@ -43,7 +43,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown read %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown read %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
break;
}
}
@@ -58,7 +58,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown write %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown write %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
break;
}
}
@@ -100,7 +100,7 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
@@ -141,12 +141,12 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
case SCSIOP_ALLOC_INSTANCE:
params = (SCSIAllocInstanceParams *)ptrparm;
- params->instance = SCSIMalloc( params->machine, (const SCSIClass *)file );
+ params->instance = SCSIMalloc( params->machine(), (const SCSIClass *)file );
scsidev_alloc_instance( params->instance, params->diskregion );
return 0;
case SCSIOP_DELETE_INSTANCE:
- auto_free( ((SCSIInstance *)file)->machine, file );
+ auto_free( ((SCSIInstance *)file)->machine(), file );
return 0;
}
return 0;
diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c
index 64b99c0c2c3..b3b6c340c8a 100644
--- a/src/emu/machine/scsihd.c
+++ b/src/emu/machine/scsihd.c
@@ -245,7 +245,7 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0;
@@ -254,9 +254,9 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
state_save_register_item( machine, "scsihd", diskregion, 0, our_this->lba );
state_save_register_item( machine, "scsihd", diskregion, 0, our_this->blocks );
- if (machine->device( diskregion )) {
+ if (machine.device( diskregion )) {
our_this->is_file = TRUE;
- our_this->disk = hd_get_hard_disk_file( machine->device( diskregion ) );
+ our_this->disk = hd_get_hard_disk_file( machine.device( diskregion ) );
} else {
our_this->is_file = FALSE;
our_this->disk = hard_disk_open(get_disk_handle( machine, diskregion ));
diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c
index 8e37f8f65a9..94c9afd9c27 100644
--- a/src/emu/machine/smc91c9x.c
+++ b/src/emu/machine/smc91c9x.c
@@ -376,7 +376,7 @@ READ16_DEVICE_HANDLER( smc91c9x_r )
}
if (LOG_ETHERNET && offset != EREG_BANK)
- logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], result, mem_mask);
+ logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", device->machine().describe_context(), ethernet_regname[offset], result, mem_mask);
return result;
}
@@ -401,7 +401,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
COMBINE_DATA(&smc->reg[offset]);
if (LOG_ETHERNET && offset != 7)
- logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], data, mem_mask);
+ logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", device->machine().describe_context(), ethernet_regname[offset], data, mem_mask);
/* handle it */
switch (offset)
@@ -516,7 +516,6 @@ static DEVICE_START( smc91c9x )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
smc->device = device;
diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c
index 2cce3bc68eb..79bd13627ca 100644
--- a/src/emu/machine/timekpr.c
+++ b/src/emu/machine/timekpr.c
@@ -62,7 +62,7 @@
#define TIMEKPR_DEVCFG_DERIVED_DEV_ALLOC(devtype) \
device_t *devtype##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(&machine, devtype##_device(machine, *this)); }
+ { return auto_alloc(machine, devtype##_device(machine, *this)); }
#define TIMEKPR_DERIVE(devtype, name, shortname) \
TIMEKPR_DEV_DERIVED_CTOR(devtype) \
@@ -104,7 +104,7 @@ device_config *timekeeper_device_config::static_alloc_device_config(const machin
device_t *timekeeper_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, timekeeper_device(machine, *this));
+ return auto_alloc(machine, timekeeper_device(machine, *this));
}
/***************************************************************************
@@ -211,7 +211,7 @@ void timekeeper_device::device_start()
m_month = make_bcd( systime.local_time.month + 1 );
m_year = make_bcd( systime.local_time.year % 100 );
m_century = make_bcd( systime.local_time.year / 100 );
- m_data = auto_alloc_array( &m_machine, UINT8, m_size );
+ m_data = auto_alloc_array( m_machine, UINT8, m_size );
m_default_data = *region();
if (m_default_data)
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index 2767b2277d5..3c09130fc2f 100644
--- a/src/emu/machine/tmp68301.c
+++ b/src/emu/machine/tmp68301.c
@@ -18,12 +18,12 @@ static emu_timer *tmp68301_timer[3]; // 3 Timers
static int tmp68301_irq_vector[8];
-static void tmp68301_update_timer( running_machine *machine, int i );
+static void tmp68301_update_timer( running_machine &machine, int i );
static IRQ_CALLBACK(tmp68301_irq_callback)
{
int vector = tmp68301_irq_vector[irqline];
-// logerror("%s: irq callback returns %04X for level %x\n",machine->describe_context(),vector,int_level);
+// logerror("%s: irq callback returns %04X for level %x\n",machine.describe_context(),vector,int_level);
return vector;
}
@@ -35,7 +35,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
UINT16 ICR = tmp68301_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9)
UINT16 IVNR = tmp68301_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR)
-// logerror("s: callback timer %04X, j = %d\n",machine->describe_context(),i,tcount);
+// logerror("s: callback timer %04X, j = %d\n",machine.describe_context(),i,tcount);
if ( (TCR & 0x0004) && // INT
!(IMR & (0x100<<i))
@@ -47,7 +47,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
tmp68301_irq_vector[level] = IVNR & 0x00e0;
tmp68301_irq_vector[level] += 4+i;
- device_set_input_line(machine->firstcpu,level,HOLD_LINE);
+ device_set_input_line(machine.firstcpu,level,HOLD_LINE);
}
if (TCR & 0x0080) // N/1
@@ -61,7 +61,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
}
}
-static void tmp68301_update_timer( running_machine *machine, int i )
+static void tmp68301_update_timer( running_machine &machine, int i )
{
UINT16 TCR = tmp68301_regs[(0x200 + i * 0x20)/2];
UINT16 MAX1 = tmp68301_regs[(0x204 + i * 0x20)/2];
@@ -90,19 +90,19 @@ static void tmp68301_update_timer( running_machine *machine, int i )
{
int scale = (TCR & 0x3c00)>>10; // P4..1
if (scale > 8) scale = 8;
- duration = attotime::from_hz(machine->firstcpu->unscaled_clock()) * ((1 << scale) * max);
+ duration = attotime::from_hz(machine.firstcpu->unscaled_clock()) * ((1 << scale) * max);
}
break;
}
-// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",machine->describe_context(),i,duration,max);
+// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",machine.describe_context(),i,duration,max);
if (!(TCR & 0x0002)) // CS
{
if (duration != attotime::zero)
tmp68301_timer[i]->adjust(duration,i);
else
- logerror("%s: TMP68301 error, timer %d duration is 0\n",machine->describe_context(),i);
+ logerror("%s: TMP68301 error, timer %d duration is 0\n",machine.describe_context(),i);
}
}
@@ -110,7 +110,7 @@ MACHINE_START( tmp68301 )
{
int i;
for (i = 0; i < 3; i++)
- tmp68301_timer[i] = machine->scheduler().timer_alloc(FUNC(tmp68301_timer_callback));
+ tmp68301_timer[i] = machine.scheduler().timer_alloc(FUNC(tmp68301_timer_callback));
}
MACHINE_RESET( tmp68301 )
@@ -120,11 +120,11 @@ MACHINE_RESET( tmp68301 )
for (i = 0; i < 3; i++)
tmp68301_IE[i] = 0;
- device_set_irq_callback(machine->firstcpu, tmp68301_irq_callback);
+ device_set_irq_callback(machine.firstcpu, tmp68301_irq_callback);
}
/* Update the IRQ state based on all possible causes */
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
int i;
@@ -150,7 +150,7 @@ static void update_irq_state(running_machine *machine)
tmp68301_IE[i] = 0; // Interrupts are edge triggerred
- device_set_input_line(machine->firstcpu,level,HOLD_LINE);
+ device_set_input_line(machine.firstcpu,level,HOLD_LINE);
}
}
}
@@ -177,13 +177,13 @@ WRITE16_HANDLER( tmp68301_regs_w )
{
int i = ((offset*2) >> 5) & 3;
- tmp68301_update_timer( space->machine, i );
+ tmp68301_update_timer( space->machine(), i );
}
break;
}
}
-void tmp68301_external_interrupt_0(running_machine *machine) { tmp68301_IE[0] = 1; update_irq_state(machine); }
-void tmp68301_external_interrupt_1(running_machine *machine) { tmp68301_IE[1] = 1; update_irq_state(machine); }
-void tmp68301_external_interrupt_2(running_machine *machine) { tmp68301_IE[2] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_0(running_machine &machine) { tmp68301_IE[0] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_1(running_machine &machine) { tmp68301_IE[1] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_2(running_machine &machine) { tmp68301_IE[2] = 1; update_irq_state(machine); }
diff --git a/src/emu/machine/tmp68301.h b/src/emu/machine/tmp68301.h
index c57407d68c8..c83c249c839 100644
--- a/src/emu/machine/tmp68301.h
+++ b/src/emu/machine/tmp68301.h
@@ -10,8 +10,8 @@ READ16_HANDLER( tmp68301_regs_r );
WRITE16_HANDLER( tmp68301_regs_w );
// Interrupts
-void tmp68301_external_interrupt_0(running_machine *machine);
-void tmp68301_external_interrupt_1(running_machine *machine);
-void tmp68301_external_interrupt_2(running_machine *machine);
+void tmp68301_external_interrupt_0(running_machine &machine);
+void tmp68301_external_interrupt_1(running_machine &machine);
+void tmp68301_external_interrupt_2(running_machine &machine);
#endif
diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c
index 3f093a69c64..df05fadf910 100644
--- a/src/emu/machine/wd33c93.c
+++ b/src/emu/machine/wd33c93.c
@@ -168,8 +168,8 @@ static const struct WD33C93interface *intf;
#define SRCID_ER 0x80
/* command handler definition */
-typedef void (*cmd_handler)(running_machine *machine);
-#define CMD_HANDLER(name) void name(running_machine *machine)
+typedef void (*cmd_handler)(running_machine &machine);
+#define CMD_HANDLER(name) void name(running_machine &machine)
#define TEMP_INPUT_LEN 262144
#define FIFO_SIZE 12
@@ -235,7 +235,7 @@ static void wd33c93_read_data(int bytes, UINT8 *pData)
}
}
-static void wd33c93_complete_immediate( running_machine *machine, int status )
+static void wd33c93_complete_immediate( running_machine &machine, int status )
{
/* reset our timer */
scsi_data.cmd_timer->reset( );
@@ -293,7 +293,7 @@ static void wd33c93_complete_cmd( UINT8 status )
/* command handlers */
static CMD_HANDLER( wd33c93_invalid_cmd )
{
- logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", machine->describe_context(), scsi_data.regs[WD_COMMAND] );
+ logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", machine.describe_context(), scsi_data.regs[WD_COMMAND] );
/* complete the command */
wd33c93_complete_cmd( CSR_INVALID );
@@ -352,7 +352,7 @@ static CMD_HANDLER( wd33c93_select_cmd )
}
/* queue up a service request out in the future */
- machine->scheduler().timer_set( attotime::from_usec(50), FUNC(wd33c93_service_request ));
+ machine.scheduler().timer_set( attotime::from_usec(50), FUNC(wd33c93_service_request ));
}
else
{
@@ -424,7 +424,7 @@ static CMD_HANDLER( wd33c93_selectxfer_cmd )
scsi_data.busphase = PHS_MESS_IN;
/* queue up a service request out in the future */
- machine->scheduler().timer_set( attotime::from_msec(50), FUNC(wd33c93_service_request ));
+ machine.scheduler().timer_set( attotime::from_msec(50), FUNC(wd33c93_service_request ));
}
}
else
@@ -454,7 +454,7 @@ static CMD_HANDLER( wd33c93_xferinfo_cmd )
scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
/* the command will be completed once the data is transferred */
- machine->scheduler().timer_set( attotime::from_msec(1), FUNC(wd33c93_deassert_cip ));
+ machine.scheduler().timer_set( attotime::from_msec(1), FUNC(wd33c93_deassert_cip ));
}
/* Command handlers */
@@ -497,7 +497,7 @@ static const cmd_handler wd33c93_cmds[0x22] =
};
/* Handle pending commands */
-static void wd33c93_command( running_machine *machine )
+static void wd33c93_command( running_machine &machine )
{
/* get the command */
UINT8 cmd = scsi_data.regs[WD_COMMAND];
@@ -540,7 +540,7 @@ WRITE8_HANDLER(wd33c93_w)
scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
/* process the command */
- wd33c93_command(space->machine);
+ wd33c93_command(space->machine());
}
else if ( scsi_data.sasr == WD_CDB_1 )
{
@@ -635,7 +635,7 @@ WRITE8_HANDLER(wd33c93_w)
}
/* complete the command */
- wd33c93_complete_immediate(space->machine, CSR_XFER_DONE | scsi_data.busphase);
+ wd33c93_complete_immediate(space->machine(), CSR_XFER_DONE | scsi_data.busphase);
}
}
else
@@ -682,7 +682,7 @@ READ8_HANDLER(wd33c93_r)
if (intf && intf->irq_callback)
{
- intf->irq_callback(space->machine, 0);
+ intf->irq_callback(space->machine(), 0);
}
LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", cpu_get_pc(space->cpu), scsi_data.regs[WD_SCSI_STATUS] ));
@@ -778,7 +778,7 @@ READ8_HANDLER(wd33c93_r)
return 0;
}
-void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface )
+void wd33c93_init( running_machine &machine, const struct WD33C93interface *interface )
{
int i;
@@ -795,7 +795,7 @@ void wd33c93_init( running_machine *machine, const struct WD33C93interface *inte
}
/* allocate a timer for commands */
- scsi_data.cmd_timer = machine->scheduler().timer_alloc(FUNC(wd33c93_complete_cb));
+ scsi_data.cmd_timer = machine.scheduler().timer_alloc(FUNC(wd33c93_complete_cb));
scsi_data.temp_input = auto_alloc_array( machine, UINT8, TEMP_INPUT_LEN );
diff --git a/src/emu/machine/wd33c93.h b/src/emu/machine/wd33c93.h
index 7598aa99cb4..2804019dbbc 100644
--- a/src/emu/machine/wd33c93.h
+++ b/src/emu/machine/wd33c93.h
@@ -11,10 +11,10 @@
struct WD33C93interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine, int state); /* irq callback */
+ void (*irq_callback)(running_machine &machine, int state); /* irq callback */
};
-extern void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface );
+extern void wd33c93_init( running_machine &machine, const struct WD33C93interface *interface );
extern void wd33c93_exit( const struct WD33C93interface *interface );
extern void wd33c93_get_dma_data(int bytes, UINT8 *pData);
extern void wd33c93_write_data(int bytes, UINT8 *pData);
diff --git a/src/emu/machine/x2212.c b/src/emu/machine/x2212.c
index 81f76677f0a..e246ca53e05 100644
--- a/src/emu/machine/x2212.c
+++ b/src/emu/machine/x2212.c
@@ -62,7 +62,7 @@ device_config *x2212_device_config::static_alloc_device_config(const machine_con
device_t *x2212_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x2212_device(machine, *this));
+ return auto_alloc(machine, x2212_device(machine, *this));
}
diff --git a/src/emu/machine/x76f041.c b/src/emu/machine/x76f041.c
index 6844c2ac507..6070a120a54 100644
--- a/src/emu/machine/x76f041.c
+++ b/src/emu/machine/x76f041.c
@@ -25,7 +25,7 @@ inline void ATTR_PRINTF(3,4) x76f041_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f041 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("x76f041 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -43,7 +43,7 @@ device_config *x76f041_device_config::static_alloc_device_config(const machine_c
device_t *x76f041_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x76f041_device(machine, *this));
+ return auto_alloc(machine, x76f041_device(machine, *this));
}
x76f041_device::x76f041_device(running_machine &_machine, const x76f041_device_config &_config)
diff --git a/src/emu/machine/x76f100.c b/src/emu/machine/x76f100.c
index 222a8d540f6..e89ec08b015 100644
--- a/src/emu/machine/x76f100.c
+++ b/src/emu/machine/x76f100.c
@@ -23,7 +23,7 @@ inline void ATTR_PRINTF(3,4) x76f100_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f100 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("x76f100 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -41,7 +41,7 @@ device_config *x76f100_device_config::static_alloc_device_config(const machine_c
device_t *x76f100_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x76f100_device(machine, *this));
+ return auto_alloc(machine, x76f100_device(machine, *this));
}
x76f100_device::x76f100_device(running_machine &_machine, const x76f100_device_config &_config)
diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c
index e112707233b..fe195f62913 100644
--- a/src/emu/machine/z80ctc.c
+++ b/src/emu/machine/z80ctc.c
@@ -108,7 +108,7 @@ device_config *z80ctc_device_config::static_alloc_device_config(const machine_co
device_t *z80ctc_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80ctc_device(machine, *this));
+ return auto_alloc(machine, z80ctc_device(machine, *this));
}
@@ -336,7 +336,7 @@ void z80ctc_device::ctc_channel::start(z80ctc_device *device, int index, bool no
if (write_line != NULL)
devcb_resolve_write_line(&m_zc, write_line, m_device);
m_notimer = notimer;
- m_timer = m_device->machine->scheduler().timer_alloc(FUNC(static_timer_callback), this);
+ m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_timer_callback), this);
// register for save states
m_device->save_item(NAME(m_mode), m_index);
diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c
index e23b39a65d8..6058d8d7148 100644
--- a/src/emu/machine/z80dart.c
+++ b/src/emu/machine/z80dart.c
@@ -221,7 +221,7 @@ device_config *z80dart_device_config::static_alloc_device_config(const machine_c
device_t *z80dart_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80dart_device(machine, *this));
+ return auto_alloc(machine, z80dart_device(machine, *this));
}
diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c
index 8f027e5037d..0ae998debcd 100644
--- a/src/emu/machine/z80dma.c
+++ b/src/emu/machine/z80dma.c
@@ -172,7 +172,7 @@ device_config *z80dma_device_config::static_alloc_device_config(const machine_co
device_t *z80dma_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80dma_device(machine, *this));
+ return auto_alloc(machine, z80dma_device(machine, *this));
}
diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c
index 3ca7bbd330c..1e6c123d308 100644
--- a/src/emu/machine/z80pio.c
+++ b/src/emu/machine/z80pio.c
@@ -84,7 +84,7 @@ device_config *z80pio_device_config::static_alloc_device_config(const machine_co
device_t *z80pio_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80pio_device(machine, *this));
+ return auto_alloc(machine, z80pio_device(machine, *this));
}
diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c
index cb39ca4c90d..71e99630a02 100644
--- a/src/emu/machine/z80sio.c
+++ b/src/emu/machine/z80sio.c
@@ -326,7 +326,7 @@ device_config *z80sio_device_config::static_alloc_device_config(const machine_co
device_t *z80sio_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80sio_device(machine, *this));
+ return auto_alloc(machine, z80sio_device(machine, *this));
}
@@ -524,7 +524,7 @@ void z80sio_device::sio_channel::start(z80sio_device *device, int index)
{
m_device = device;
m_index = index;
- m_receive_timer = device->machine->scheduler().timer_alloc(FUNC(static_serial_callback), this);
+ m_receive_timer = device->machine().scheduler().timer_alloc(FUNC(static_serial_callback), this);
}
@@ -713,7 +713,7 @@ int z80sio_device::sio_channel::rts()
void z80sio_device::sio_channel::set_cts(int state)
{
- m_device->machine->scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_CTS << 1) + (state != 0), this);
+ m_device->machine().scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_CTS << 1) + (state != 0), this);
}
@@ -723,7 +723,7 @@ void z80sio_device::sio_channel::set_cts(int state)
void z80sio_device::sio_channel::set_dcd(int state)
{
- m_device->machine->scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_DCD << 1) + (state != 0), this);
+ m_device->machine().scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_DCD << 1) + (state != 0), this);
}
diff --git a/src/emu/machine/z80sti.c b/src/emu/machine/z80sti.c
index 61442abc32d..6be81805b97 100644
--- a/src/emu/machine/z80sti.c
+++ b/src/emu/machine/z80sti.c
@@ -175,7 +175,7 @@ device_config *z80sti_device_config::static_alloc_device_config(const machine_co
device_t *z80sti_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80sti_device(machine, *this));
+ return auto_alloc(machine, z80sti_device(machine, *this));
}
diff --git a/src/emu/mame.c b/src/emu/mame.c
index 1cbfa192f72..65d671b32ef 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -129,9 +129,9 @@ const char mame_disclaimer[] =
given machine is valid
-------------------------------------------------*/
-int mame_is_valid_machine(running_machine *machine)
+int mame_is_valid_machine(running_machine &machine)
{
- return (machine != NULL && machine == global_machine);
+ return (&machine == global_machine);
}
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 5132fd3f659..52a0399dc55 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -99,7 +99,7 @@ extern const char build_version[];
int mame_execute(emu_options &options, osd_interface &osd);
/* return true if the given machine is valid */
-int mame_is_valid_machine(running_machine *machine);
+int mame_is_valid_machine(running_machine &machine);
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index b52ec412234..05fb5500cb7 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -84,11 +84,11 @@
#define NVRAM_HANDLER_NAME(name) nvram_handler_##name
-#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine *machine, emu_file *file, int read_or_write)
+#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine &machine, emu_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, emu_file &file, int action)
+#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine &machine, emu_file &file, int action)
#define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action)
@@ -110,8 +110,8 @@ class screen_device_config;
// various callback functions
-typedef void (*nvram_handler_func)(running_machine *machine, emu_file *file, int read_or_write);
-typedef void (*memcard_handler_func)(running_machine *machine, emu_file &file, int action);
+typedef void (*nvram_handler_func)(running_machine &machine, emu_file *file, int read_or_write);
+typedef void (*memcard_handler_func)(running_machine &machine, emu_file &file, int action);
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 45e3772a3cd..abb1b6c3873 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -190,13 +190,13 @@
AM_SIZE_MEMBER(struct, sizefield)
Specifies a field within a given struct as where to store the base
or size of the current bucket. The struct is assumed to be hanging
- off of the machine->driver_data pointer.
+ off of the machine.driver_data pointer.
AM_BASE_GENERIC(basefield)
AM_SIZE_GENERIC(sizefield)
Specifies a field within the global generic_pointers struct as
where to store the base or size of the current bucket. The global
- generic_pointer struct lives in machine->generic.
+ generic_pointer struct lives in machine.generic.
***************************************************************************/
@@ -788,7 +788,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory read from %s & %s\n",
- m_space.m_machine.describe_context(), m_space.name(),
+ m_space.machine().describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));
return m_space.unmap();
@@ -844,7 +844,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory write to %s = %s & %s\n",
- m_space.m_machine.describe_context(), m_space.name(),
+ m_space.machine().describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(data, 2 * sizeof(_UintType)),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));
@@ -1542,7 +1542,7 @@ UINT8 address_table::s_watchpoint_table[1 << LEVEL1_BITS];
static STATE_POSTLOAD( bank_reattach );
// debugging
-static void generate_memdump(running_machine *machine);
+static void generate_memdump(running_machine &machine);
@@ -1554,21 +1554,21 @@ static void generate_memdump(running_machine *machine);
// memory_init - initialize the memory system
//-------------------------------------------------
-void memory_init(running_machine *machine)
+void memory_init(running_machine &machine)
{
// allocate our private data
- memory_private *memdata = machine->memory_data = auto_alloc_clear(machine, memory_private);
+ memory_private *memdata = machine.memory_data = auto_alloc_clear(machine, memory_private);
memdata->banknext = STATIC_BANK1;
// loop over devices and spaces within each device
device_memory_interface *memory = NULL;
- for (bool gotone = machine->m_devicelist.first(memory); gotone; gotone = memory->next(memory))
+ for (bool gotone = machine.m_devicelist.first(memory); gotone; gotone = memory->next(memory))
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
// if there is a configuration for this space, we need an address space
const address_space_config *spaceconfig = memory->space_config(spacenum);
if (spaceconfig != NULL)
- memdata->spacelist.append(address_space::allocate(*machine, *spaceconfig, *memory, spacenum));
+ memdata->spacelist.append(address_space::allocate(machine, *spaceconfig, *memory, spacenum));
}
// construct and preprocess the address_map for each space
@@ -1588,7 +1588,7 @@ void memory_init(running_machine *machine)
space->locate_memory();
// register a callback to reset banks when reloading state
- machine->state().register_postload(bank_reattach, NULL);
+ machine.state().register_postload(bank_reattach, NULL);
// dump the final memory configuration
generate_memdump(machine);
@@ -1597,9 +1597,9 @@ void memory_init(running_machine *machine)
memdata->initialized = true;
}
-address_space *memory_nonspecific_space(running_machine *machine)
+address_space *memory_nonspecific_space(running_machine &machine)
{
- memory_private *memdata = machine->memory_data;
+ memory_private *memdata = machine.memory_data;
return memdata->spacelist.first();
}
@@ -1614,10 +1614,10 @@ address_space *memory_nonspecific_space(running_machine *machine)
// addresses for a bank
//-------------------------------------------------
-void memory_configure_bank(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
+void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_configure_bank called for unknown bank '%s'", tag);
if (base == NULL)
@@ -1634,10 +1634,10 @@ void memory_configure_bank(running_machine *machine, const char *tag, int starte
// the decrypted addresses for a bank
//-------------------------------------------------
-void memory_configure_bank_decrypted(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
+void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_configure_bank_decrypted called for unknown bank '%s'", tag);
if (base == NULL)
@@ -1654,10 +1654,10 @@ void memory_configure_bank_decrypted(running_machine *machine, const char *tag,
// entry to be the new bank base
//-------------------------------------------------
-void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
+void memory_set_bank(running_machine &machine, const char *tag, int entrynum)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_set_bank called for unknown bank '%s'", tag);
@@ -1671,10 +1671,10 @@ void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
// selected bank
//-------------------------------------------------
-int memory_get_bank(running_machine *machine, const char *tag)
+int memory_get_bank(running_machine &machine, const char *tag)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_get_bank called for unknown bank '%s'", tag);
@@ -1687,10 +1687,10 @@ int memory_get_bank(running_machine *machine, const char *tag)
// memory_set_bankptr - set the base of a bank
//-------------------------------------------------
-void memory_set_bankptr(running_machine *machine, const char *tag, void *base)
+void memory_set_bankptr(running_machine &machine, const char *tag, void *base)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
throw emu_fatalerror("memory_set_bankptr called for unknown bank '%s'", tag);
@@ -1725,14 +1725,14 @@ void *memory_get_shared(running_machine &machine, const char *tag, size_t &lengt
// to the given file
//-------------------------------------------------
-void memory_dump(running_machine *machine, FILE *file)
+void memory_dump(running_machine &machine, FILE *file)
{
// skip if we can't open the file
if (file == NULL)
return;
// loop over address spaces
- for (address_space *space = machine->memory_data->spacelist.first(); space != NULL; space = space->next())
+ for (address_space *space = machine.memory_data->spacelist.first(); space != NULL; space = space->next())
{
fprintf(file, "\n\n"
"====================================================\n"
@@ -1753,7 +1753,7 @@ void memory_dump(running_machine *machine, FILE *file)
// generate_memdump - internal memory dump
//-------------------------------------------------
-static void generate_memdump(running_machine *machine)
+static void generate_memdump(running_machine &machine)
{
if (MEM_DUMP)
{
@@ -1774,7 +1774,7 @@ static void generate_memdump(running_machine *machine)
static STATE_POSTLOAD( bank_reattach )
{
// for each non-anonymous bank, explicitly reset its entry
- for (memory_bank *bank = machine->memory_data->banklist.first(); bank != NULL; bank = bank->next())
+ for (memory_bank *bank = machine.memory_data->banklist.first(); bank != NULL; bank = bank->next())
if (!bank->anonymous() && bank->entry() != BANK_ENTRY_UNSPECIFIED)
bank->set_entry(bank->entry());
}
@@ -1790,12 +1790,11 @@ static STATE_POSTLOAD( bank_reattach )
//-------------------------------------------------
address_space::address_space(device_memory_interface &memory, address_spacenum spacenum, bool large)
- : machine(memory.device().machine),
- cpu(&memory.device()),
- m_machine(*memory.device().machine),
+ : cpu(&memory.device()),
m_next(NULL),
m_config(*memory.space_config(spacenum)),
m_device(memory.device()),
+ m_machine(memory.device().machine()),
m_map(NULL),
m_addrmask(0xffffffffUL >> (32 - m_config.m_addrbus_width)),
m_bytemask(address_to_byte_end(m_addrmask)),
@@ -1805,7 +1804,7 @@ address_space::address_space(device_memory_interface &memory, address_spacenum s
m_spacenum(spacenum),
m_debugger_access(false),
m_log_unmap(true),
- m_direct(*auto_alloc(memory.device().machine, direct_read_data(*this))),
+ m_direct(*auto_alloc(memory.device().machine(), direct_read_data(*this))),
m_name(memory.space_config(spacenum)->name()),
m_addrchars((m_config.m_databus_width + 3) / 4),
m_logaddrchars((m_config.m_logaddr_width + 3) / 4)
@@ -1841,64 +1840,64 @@ address_space &address_space::allocate(running_machine &machine, const address_s
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_8le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_8le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_8le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_8le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_8be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_8be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_8be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_8be_small(memory, spacenum));
}
case 16:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_16le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_16le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_16le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_16le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_16be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_16be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_16be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_16be_small(memory, spacenum));
}
case 32:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_32le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_32le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_32le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_32le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_32be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_32be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_32be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_32be_small(memory, spacenum));
}
case 64:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_64le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_64le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_64le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_64le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_64be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_64be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_64be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_64be_small(memory, spacenum));
}
}
throw emu_fatalerror("Invalid width %d specified for address_space::allocate", config.data_width());
@@ -1964,7 +1963,7 @@ void address_space::prepare_map()
if (entry->m_share != NULL && m_machine.memory_data->sharemap.find(entry->m_share) == NULL)
{
VPRINTF(("Creating share '%s' of length 0x%X\n", entry->m_share, entry->m_byteend + 1 - entry->m_bytestart));
- memory_share *share = auto_alloc(&m_machine, memory_share(entry->m_byteend + 1 - entry->m_bytestart));
+ memory_share *share = auto_alloc(m_machine, memory_share(entry->m_byteend + 1 - entry->m_bytestart));
m_machine.memory_data->sharemap.add(entry->m_share, share, false);
}
@@ -2171,7 +2170,7 @@ void address_space::allocate_memory()
memory_block *prev_memblock_tail = blocklist.last();
for (address_map_entry *entry = m_map->m_entrylist.first(); entry != NULL; entry = entry->next())
if (entry->m_memory != NULL)
- blocklist.append(*auto_alloc(&m_machine, memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
+ blocklist.append(*auto_alloc(m_machine, memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
// loop over all blocks just allocated and assign pointers from them
address_map_entry *unassigned = NULL;
@@ -2218,7 +2217,7 @@ void address_space::allocate_memory()
// we now have a block to allocate; do it
offs_t curbytestart = curblockstart * MEMORY_BLOCK_CHUNK;
offs_t curbyteend = curblockend * MEMORY_BLOCK_CHUNK + (MEMORY_BLOCK_CHUNK - 1);
- memory_block &block = blocklist.append(*auto_alloc(&m_machine, memory_block(*this, curbytestart, curbyteend)));
+ memory_block &block = blocklist.append(*auto_alloc(m_machine, memory_block(*this, curbytestart, curbyteend)));
// assign memory that intersected the new block
unassigned = block_assign_intersecting(curbytestart, curbyteend, block.data());
@@ -2468,7 +2467,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
}
// update the memory dump
- generate_memdump(&m_machine);
+ generate_memdump(m_machine);
}
@@ -2499,7 +2498,7 @@ void address_space::install_bank_generic(offs_t addrstart, offs_t addrend, offs_
}
// update the memory dump
- generate_memdump(&m_machine);
+ generate_memdump(m_machine);
}
@@ -2542,7 +2541,7 @@ void *address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_
{
if (m_machine.phase() >= MACHINE_PHASE_RESET)
fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
- memory_block &block = memdata->blocklist.append(*auto_alloc(&m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
+ memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
bank.set_base(block.data());
}
}
@@ -2571,7 +2570,7 @@ void *address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_
{
if (m_machine.phase() >= MACHINE_PHASE_RESET)
fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
- memory_block &block = memdata->blocklist.append(*auto_alloc(&m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
+ memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
bank.set_base(block.data());
}
}
@@ -2594,7 +2593,7 @@ UINT8 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, off
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2607,7 +2606,7 @@ UINT8 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, of
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2633,7 +2632,7 @@ UINT8 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addre
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2646,7 +2645,7 @@ UINT8 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addr
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2671,7 +2670,7 @@ UINT8 *address_space::install_legacy_read_handler(device_t &device, offs_t addrs
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2684,7 +2683,7 @@ UINT8 *address_space::install_legacy_write_handler(device_t &device, offs_t addr
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2704,7 +2703,7 @@ UINT16 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2712,7 +2711,7 @@ UINT16 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2733,7 +2732,7 @@ UINT16 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2741,7 +2740,7 @@ UINT16 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2761,7 +2760,7 @@ UINT16 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2769,7 +2768,7 @@ UINT16 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2789,7 +2788,7 @@ UINT32 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2797,7 +2796,7 @@ UINT32 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2818,7 +2817,7 @@ UINT32 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2826,7 +2825,7 @@ UINT32 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2846,7 +2845,7 @@ UINT32 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2854,7 +2853,7 @@ UINT32 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2874,7 +2873,7 @@ UINT64 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2882,7 +2881,7 @@ UINT64 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2903,7 +2902,7 @@ UINT64 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2911,7 +2910,7 @@ UINT64 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2931,7 +2930,7 @@ UINT64 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2939,7 +2938,7 @@ UINT64 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -3078,7 +3077,7 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
}
// allocate the bank
- bank = auto_alloc(&m_machine, memory_bank(*this, banknum, bytestart, byteend, tag));
+ bank = auto_alloc(m_machine, memory_bank(*this, banknum, bytestart, byteend, tag));
memdata->banklist.append(*bank);
// for named banks, add to the map and register for save states
@@ -3102,11 +3101,11 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
//-------------------------------------------------
address_table::address_table(address_space &space, bool large)
- : m_table(auto_alloc_array(&space.m_machine, UINT8, 1 << LEVEL1_BITS)),
+ : m_table(auto_alloc_array(space.machine(), UINT8, 1 << LEVEL1_BITS)),
m_live_lookup(m_table),
m_space(space),
m_large(large),
- m_subtable(auto_alloc_array(&space.m_machine, subtable_data, SUBTABLE_COUNT)),
+ m_subtable(auto_alloc_array(space.machine(), subtable_data, SUBTABLE_COUNT)),
m_subtable_alloc(0)
{
// make our static table all watchpoints
@@ -3124,8 +3123,8 @@ address_table::address_table(address_space &space, bool large)
address_table::~address_table()
{
- auto_free(&m_space.m_machine, m_table);
- auto_free(&m_space.m_machine, m_subtable);
+ auto_free(m_space.machine(), m_table);
+ auto_free(m_space.machine(), m_subtable);
}
@@ -3495,11 +3494,11 @@ UINT8 address_table::subtable_alloc()
m_subtable_alloc += SUBTABLE_ALLOC;
UINT32 newsize = (1 << LEVEL1_BITS) + (m_subtable_alloc << level2_bits());
- UINT8 *newtable = auto_alloc_array_clear(&m_space.m_machine, UINT8, newsize);
+ UINT8 *newtable = auto_alloc_array_clear(m_space.machine(), UINT8, newsize);
memcpy(newtable, m_table, oldsize);
if (m_live_lookup == m_table)
m_live_lookup = newtable;
- auto_free(&m_space.m_machine, m_table);
+ auto_free(m_space.machine(), m_table);
m_table = newtable;
}
@@ -3712,7 +3711,7 @@ const char *address_table::handler_name(UINT8 entry) const
// banks have names
if (entry >= STATIC_BANK1 && entry <= STATIC_BANKMAX)
- for (memory_bank *info = m_space.m_machine.memory_data->banklist.first(); info != NULL; info = info->next())
+ for (memory_bank *info = m_space.machine().memory_data->banklist.first(); info != NULL; info = info->next())
if (info->index() == entry)
return info->name();
@@ -3736,8 +3735,8 @@ address_table_read::address_table_read(address_space &space, bool large)
// allocate handlers for each entry, prepopulating the bankptrs for banks
for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++)
{
- UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.m_machine.memory_data->bank_ptr[entrynum] : NULL;
- m_handlers[entrynum] = auto_alloc(&space.m_machine, handler_entry_read(space.data_width(), space.endianness(), bankptr));
+ UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.machine().memory_data->bank_ptr[entrynum] : NULL;
+ m_handlers[entrynum] = auto_alloc(space.machine(), handler_entry_read(space.data_width(), space.endianness(), bankptr));
}
// we have to allocate different object types based on the data bus width
@@ -3786,7 +3785,7 @@ address_table_read::address_table_read(address_space &space, bool large)
address_table_read::~address_table_read()
{
for (int handnum = 0; handnum < ARRAY_LENGTH(m_handlers); handnum++)
- auto_free(&m_space.m_machine, m_handlers[handnum]);
+ auto_free(m_space.machine(), m_handlers[handnum]);
}
@@ -3812,8 +3811,8 @@ address_table_write::address_table_write(address_space &space, bool large)
// allocate handlers for each entry, prepopulating the bankptrs for banks
for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++)
{
- UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.m_machine.memory_data->bank_ptr[entrynum] : NULL;
- m_handlers[entrynum] = auto_alloc(&space.m_machine, handler_entry_write(space.data_width(), space.endianness(), bankptr));
+ UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.machine().memory_data->bank_ptr[entrynum] : NULL;
+ m_handlers[entrynum] = auto_alloc(space.machine(), handler_entry_write(space.data_width(), space.endianness(), bankptr));
}
// we have to allocate different object types based on the data bus width
@@ -3862,7 +3861,7 @@ address_table_write::address_table_write(address_space &space, bool large)
address_table_write::~address_table_write()
{
for (int handnum = 0; handnum < ARRAY_LENGTH(m_handlers); handnum++)
- auto_free(&m_space.m_machine, m_handlers[handnum]);
+ auto_free(m_space.machine(), m_handlers[handnum]);
}
@@ -3942,8 +3941,8 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress)
}
// if no decrypted opcodes, point to the same base
- UINT8 *base = m_space.m_machine.memory_data->bank_ptr[m_entry];
- UINT8 *based = m_space.m_machine.memory_data->bankd_ptr[m_entry];
+ UINT8 *base = m_space.machine().memory_data->bank_ptr[m_entry];
+ UINT8 *based = m_space.machine().memory_data->bankd_ptr[m_entry];
if (based == NULL)
based = base;
@@ -3978,7 +3977,7 @@ direct_read_data::direct_range *direct_read_data::find_range(offs_t byteaddress,
if (range != NULL)
m_freerangelist.detach(*range);
else
- range = auto_alloc(&m_space.m_machine, direct_range);
+ range = auto_alloc(m_space.machine(), direct_range);
// fill in the range
m_space.read().derive_range(byteaddress, range->m_bytestart, range->m_byteend);
@@ -4057,7 +4056,7 @@ void direct_read_data::explicit_configure(offs_t bytestart, offs_t byteend, offs
memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteend, void *memory)
: m_next(NULL),
- m_machine(space.m_machine),
+ m_machine(space.machine()),
m_space(space),
m_bytestart(bytestart),
m_byteend(byteend),
@@ -4071,17 +4070,17 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
{
offs_t length = byteend + 1 - bytestart;
if (length < 4096)
- m_allocated = m_data = auto_alloc_array_clear(&space.m_machine, UINT8, length);
+ m_allocated = m_data = auto_alloc_array_clear(space.machine(), UINT8, length);
else
{
- m_allocated = auto_alloc_array_clear(&space.m_machine, UINT8, length + 0xfff);
+ m_allocated = auto_alloc_array_clear(space.machine(), UINT8, length + 0xfff);
m_data = reinterpret_cast<UINT8 *>((reinterpret_cast<FPTR>(m_allocated) + 0xfff) & ~0xfff);
}
}
// register for saving, but only if we're not part of a memory region
const memory_region *region;
- for (region = space.m_machine.first_region(); region != NULL; region = region->next())
+ for (region = space.machine().first_region(); region != NULL; region = region->next())
if (m_data >= region->base() && (m_data + (byteend - bytestart + 1)) < region->end())
{
VPRINTF(("skipping save of this memory block as it is covered by a memory region\n"));
@@ -4094,7 +4093,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
int bytes_per_element = space.data_width() / 8;
astring name;
name.printf("%08x-%08x", bytestart, byteend);
- space.m_machine.state().save_memory("memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
+ space.machine().state().save_memory("memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
}
}
@@ -4106,7 +4105,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
memory_block::~memory_block()
{
if (m_allocated != NULL)
- auto_free(&m_machine, m_allocated);
+ auto_free(m_machine, m_allocated);
}
@@ -4121,9 +4120,9 @@ memory_block::~memory_block()
memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs_t byteend, const char *tag)
: m_next(NULL),
- m_machine(space.m_machine),
- m_baseptr(&space.m_machine.memory_data->bank_ptr[index]),
- m_basedptr(&space.m_machine.memory_data->bankd_ptr[index]),
+ m_machine(space.machine()),
+ m_baseptr(&space.machine().memory_data->bank_ptr[index]),
+ m_basedptr(&space.machine().memory_data->bankd_ptr[index]),
m_index(index),
m_anonymous(tag == NULL),
m_bytestart(bytestart),
@@ -4144,8 +4143,8 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs
m_name.printf("Bank '%s'", tag);
}
- if (!m_anonymous && space.m_machine.state().registration_allowed())
- space.m_machine.state().save_item("memory", m_tag, 0, NAME(m_curentry));
+ if (!m_anonymous && space.machine().state().registration_allowed())
+ space.machine().state().save_item("memory", m_tag, 0, NAME(m_curentry));
}
@@ -4155,7 +4154,7 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs
memory_bank::~memory_bank()
{
- auto_free(&m_machine, m_entry);
+ auto_free(m_machine, m_entry);
}
@@ -4184,7 +4183,7 @@ void memory_bank::add_reference(address_space &space, read_or_write readorwrite)
// if we already have a reference, skip it
if (references_space(space, readorwrite))
return;
- m_reflist.append(*auto_alloc(&space.m_machine, bank_reference(space, readorwrite)));
+ m_reflist.append(*auto_alloc(space.machine(), bank_reference(space, readorwrite)));
}
@@ -4269,12 +4268,12 @@ void memory_bank::expand_entries(int entrynum)
int newcount = entrynum + 1;
// allocate a new array and copy from the old one; zero out the new entries
- bank_entry *newentry = auto_alloc_array(&m_machine, bank_entry, newcount);
+ bank_entry *newentry = auto_alloc_array(m_machine, bank_entry, newcount);
memcpy(newentry, m_entry, sizeof(m_entry[0]) * m_entry_count);
memset(&newentry[m_entry_count], 0, (newcount - m_entry_count) * sizeof(m_entry[0]));
// free the old array and set the updated values
- auto_free(&m_machine, m_entry);
+ auto_free(m_machine, m_entry);
m_entry = newentry;
m_entry_count = newcount;
}
diff --git a/src/emu/memory.h b/src/emu/memory.h
index b7d648f61de..cf5ef7cad54 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -353,6 +353,7 @@ public:
// getters
address_space *next() const { return m_next; }
device_t &device() const { return m_device; }
+ running_machine &machine() const { return m_machine; }
const char *name() const { return m_name; }
address_spacenum spacenum() const { return m_spacenum; }
address_map *map() const { return m_map; }
@@ -576,15 +577,14 @@ private:
public:
// public state (eventually will go away)
- running_machine * machine; // kept for backwards compatibility
device_t * cpu; // kept for backwards compatibility
- running_machine & m_machine; // reference to the owning machine
protected:
// private state
address_space * m_next; // next address space in the global list
const address_space_config &m_config; // configuration of this space
device_t & m_device; // reference to the owning device
+ running_machine & m_machine; // reference to the owning machine
address_map * m_map; // original memory map
offs_t m_addrmask; // physical address mask
offs_t m_bytemask; // byte-converted physical address mask
@@ -715,31 +715,31 @@ extern const char *const address_space_names[ADDRESS_SPACES];
//**************************************************************************
// initialize the memory system
-void memory_init(running_machine *machine);
+void memory_init(running_machine &machine);
// configure the addresses for a bank
-void memory_configure_bank(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
+void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// configure the decrypted addresses for a bank
-void memory_configure_bank_decrypted(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
+void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// select one pre-configured entry to be the new bank base
-void memory_set_bank(running_machine *machine, const char *tag, int entrynum) ATTR_NONNULL(1);
+void memory_set_bank(running_machine &machine, const char *tag, int entrynum);
// return the currently selected bank
-int memory_get_bank(running_machine *machine, const char *tag) ATTR_NONNULL(1);
+int memory_get_bank(running_machine &machine, const char *tag);
// set the absolute address of a bank base
-void memory_set_bankptr(running_machine *machine, const char *tag, void *base) ATTR_NONNULL(1, 3);
+void memory_set_bankptr(running_machine &machine, const char *tag, void *base) ATTR_NONNULL(3);
// get a pointer to a shared memory region by tag
void *memory_get_shared(running_machine &machine, const char *tag);
void *memory_get_shared(running_machine &machine, const char *tag, size_t &length);
// dump the internal memory tables to the given file
-void memory_dump(running_machine *machine, FILE *file);
+void memory_dump(running_machine &machine, FILE *file);
-address_space *memory_nonspecific_space(running_machine *machine);
+address_space *memory_nonspecific_space(running_machine &machine);
//**************************************************************************
diff --git a/src/emu/output.c b/src/emu/output.c
index b4b05e30a1a..31a0f444f95 100644
--- a/src/emu/output.c
+++ b/src/emu/output.c
@@ -144,14 +144,14 @@ INLINE output_item *create_new_item(const char *outname, INT32 value)
output_init - initialize everything
-------------------------------------------------*/
-void output_init(running_machine *machine)
+void output_init(running_machine &machine)
{
/* add pause callback */
- machine->add_notifier(MACHINE_NOTIFY_PAUSE, output_pause);
- machine->add_notifier(MACHINE_NOTIFY_RESUME, output_resume);
+ machine.add_notifier(MACHINE_NOTIFY_PAUSE, output_pause);
+ machine.add_notifier(MACHINE_NOTIFY_RESUME, output_resume);
/* get a callback when done */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, output_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, output_exit);
/* reset the lists */
memset(itemtable, 0, sizeof(itemtable));
diff --git a/src/emu/output.h b/src/emu/output.h
index 308d5c764c7..46b74ea5a92 100644
--- a/src/emu/output.h
+++ b/src/emu/output.h
@@ -32,7 +32,7 @@ typedef void (*output_notifier_func)(const char *outname, INT32 value, void *par
***************************************************************************/
/* core initialization */
-void output_init(running_machine *machine);
+void output_init(running_machine &machine);
/* set the value for a given output */
void output_set_value(const char *outname, INT32 value);
diff --git a/src/emu/render.c b/src/emu/render.c
index 709e9a3d0ea..654534d3a52 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -405,7 +405,7 @@ void render_texture::release()
for (int scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
{
m_manager->invalidate_all(m_scaled[scalenum].bitmap);
- auto_free(&m_manager->machine(), m_scaled[scalenum].bitmap);
+ auto_free(m_manager->machine(), m_scaled[scalenum].bitmap);
m_scaled[scalenum].bitmap = NULL;
m_scaled[scalenum].seqid = 0;
}
@@ -423,7 +423,7 @@ void render_texture::release()
m_palette = NULL;
// free any B/C/G lookup tables
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = NULL;
m_bcglookup_entries = 0;
}
@@ -467,7 +467,7 @@ void render_texture::set_bitmap(bitmap_t *bitmap, const rectangle *sbounds, int
if (m_scaled[scalenum].bitmap != NULL)
{
m_manager->invalidate_all(m_scaled[scalenum].bitmap);
- auto_free(&m_manager->machine(), m_scaled[scalenum].bitmap);
+ auto_free(m_manager->machine(), m_scaled[scalenum].bitmap);
}
m_scaled[scalenum].bitmap = NULL;
m_scaled[scalenum].seqid = 0;
@@ -545,11 +545,11 @@ bool render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
if (scaled->bitmap != NULL)
{
m_manager->invalidate_all(scaled->bitmap);
- auto_free(&m_manager->machine(), scaled->bitmap);
+ auto_free(m_manager->machine(), scaled->bitmap);
}
// allocate a new bitmap
- scaled->bitmap = auto_alloc(&m_manager->machine(), bitmap_t(dwidth, dheight, BITMAP_FORMAT_ARGB32));
+ scaled->bitmap = auto_alloc(m_manager->machine(), bitmap_t(dwidth, dheight, BITMAP_FORMAT_ARGB32));
scaled->seqid = ++m_curseq;
// let the scaler do the work
@@ -599,9 +599,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
numentries = palette_get_num_colors(m_palette) * palette_get_num_groups(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < numentries)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, numentries);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, numentries);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = numentries;
}
@@ -629,9 +629,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
adjusted = palette_entry_list_adjusted(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < 4 * 32)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, 4 * 32);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, 4 * 32);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = 4 * 32;
}
@@ -664,9 +664,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
adjusted = palette_entry_list_adjusted(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < 4 * 256)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, 4 * 256);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, 4 * 256);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = 4 * 256;
}
@@ -1051,7 +1051,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
: m_next(NULL),
m_manager(manager),
m_curview(NULL),
- m_filelist(*auto_alloc(&manager.machine(), simple_list<layout_file>(manager.machine().respool()))),
+ m_filelist(*auto_alloc(manager.machine(), simple_list<layout_file>(manager.machine().respool()))),
m_flags(flags),
m_listindex(0),
m_width(640),
@@ -1110,7 +1110,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
render_target::~render_target()
{
- auto_free(&m_manager.machine(), &m_filelist);
+ auto_free(m_manager.machine(), &m_filelist);
}
@@ -1703,7 +1703,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename)
bool result = true;
try
{
- m_filelist.append(*auto_alloc(&m_manager.machine(), layout_file(m_manager.machine(), *rootnode, dirname)));
+ m_filelist.append(*auto_alloc(m_manager.machine(), layout_file(m_manager.machine(), *rootnode, dirname)));
}
catch (emu_fatalerror &err)
{
@@ -2458,11 +2458,11 @@ render_manager::render_manager(running_machine &machine)
m_ui_target(NULL),
m_live_textures(0),
m_texture_allocator(machine.respool()),
- m_ui_container(auto_alloc(&machine, render_container(*this))),
+ m_ui_container(auto_alloc(machine, render_container(*this))),
m_screen_container_list(machine.respool())
{
// register callbacks
- config_register(&machine, "video", config_load_static, config_save_static);
+ config_register(machine, "video", config_load_static, config_save_static);
// create one container per screen
for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
@@ -2527,7 +2527,7 @@ float render_manager::max_update_rate() const
render_target *render_manager::target_alloc(const char *layoutfile, UINT32 flags)
{
- return &m_targetlist.append(*auto_alloc(&m_machine, render_target(*this, layoutfile, flags)));
+ return &m_targetlist.append(*auto_alloc(m_machine, render_target(*this, layoutfile, flags)));
}
@@ -2621,7 +2621,7 @@ void render_manager::texture_free(render_texture *texture)
render_font *render_manager::font_alloc(const char *filename)
{
- return auto_alloc(&m_machine, render_font(*this, filename));
+ return auto_alloc(m_machine, render_font(*this, filename));
}
@@ -2631,7 +2631,7 @@ render_font *render_manager::font_alloc(const char *filename)
void render_manager::font_free(render_font *font)
{
- auto_free(&m_machine, font);
+ auto_free(m_machine, font);
}
@@ -2658,7 +2658,7 @@ void render_manager::invalidate_all(void *refptr)
render_container *render_manager::container_alloc(screen_device *screen)
{
- render_container *container = auto_alloc(&m_machine, render_container(*this, screen));
+ render_container *container = auto_alloc(m_machine, render_container(*this, screen));
if (screen != NULL)
m_screen_container_list.append(*container);
return container;
@@ -2672,7 +2672,7 @@ render_container *render_manager::container_alloc(screen_device *screen)
void render_manager::container_free(render_container *container)
{
m_screen_container_list.detach(*container);
- auto_free(&m_machine, container);
+ auto_free(m_machine, container);
}
@@ -2681,9 +2681,9 @@ void render_manager::container_free(render_container *container)
// configuration file
//-------------------------------------------------
-void render_manager::config_load_static(running_machine *machine, int config_type, xml_data_node *parentnode)
+void render_manager::config_load_static(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- machine->render().config_load(config_type, parentnode);
+ machine.render().config_load(config_type, parentnode);
}
void render_manager::config_load(int config_type, xml_data_node *parentnode)
@@ -2745,9 +2745,9 @@ void render_manager::config_load(int config_type, xml_data_node *parentnode)
// file
//-------------------------------------------------
-void render_manager::config_save_static(running_machine *machine, int config_type, xml_data_node *parentnode)
+void render_manager::config_save_static(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- machine->render().config_save(config_type, parentnode);
+ machine.render().config_save(config_type, parentnode);
}
void render_manager::config_save(int config_type, xml_data_node *parentnode)
diff --git a/src/emu/render.h b/src/emu/render.h
index 312977d9299..d14e28f03b0 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -761,8 +761,8 @@ private:
void container_free(render_container *container);
// config callbacks
- static void config_load_static(running_machine *machine, int config_type, xml_data_node *parentnode);
- static void config_save_static(running_machine *machine, int config_type, xml_data_node *parentnode);
+ static void config_load_static(running_machine &machine, int config_type, xml_data_node *parentnode);
+ static void config_save_static(running_machine &machine, int config_type, xml_data_node *parentnode);
void config_load(int config_type, xml_data_node *parentnode);
void config_save(int config_type, xml_data_node *parentnode);
diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c
index 629e6b84533..c5325f3c1e8 100644
--- a/src/emu/rendfont.c
+++ b/src/emu/rendfont.c
@@ -83,7 +83,7 @@ inline render_font::glyph &render_font::get_char(unicode_char chnum)
// grab the table; if none, return the dummy character
glyph *glyphtable = m_glyphs[chnum / 256];
if (glyphtable == NULL && m_format == FF_OSD)
- glyphtable = m_glyphs[chnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ glyphtable = m_glyphs[chnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
if (glyphtable == NULL)
return dummy_glyph;
@@ -161,15 +161,15 @@ render_font::~render_font()
{
glyph &gl = m_glyphs[tablenum][charnum];
m_manager.texture_free(gl.texture);
- auto_free(&m_manager.machine(), gl.bitmap);
+ auto_free(m_manager.machine(), gl.bitmap);
}
// free the subtable itself
- auto_free(&m_manager.machine(), m_glyphs[tablenum]);
+ auto_free(m_manager.machine(), m_glyphs[tablenum]);
}
// free the raw data and the size itself
- auto_free(&m_manager.machine(), m_rawdata);
+ auto_free(m_manager.machine(), m_rawdata);
// release the OSD font
if (m_osdfont != NULL)
@@ -212,7 +212,7 @@ void render_font::char_expand(unicode_char chnum, glyph &gl)
return;
// allocate a new bitmap of the size we need
- gl.bitmap = auto_alloc(&m_manager.machine(), bitmap_t(gl.bmwidth, m_height, BITMAP_FORMAT_ARGB32));
+ gl.bitmap = auto_alloc(m_manager.machine(), bitmap_t(gl.bmwidth, m_height, BITMAP_FORMAT_ARGB32));
bitmap_fill(gl.bitmap, NULL, 0);
// extract the data
@@ -419,7 +419,7 @@ bool render_font::load_cached_bdf(const char *filename)
// determine the file size and allocate memory
m_rawsize = file.size();
- char *data = auto_alloc_array_clear(&m_manager.machine(), char, m_rawsize + 1);
+ char *data = auto_alloc_array_clear(m_manager.machine(), char, m_rawsize + 1);
// read the first chunk
UINT32 bytes = file.read(data, MIN(CACHED_BDF_HASH_SIZE, m_rawsize));
@@ -445,7 +445,7 @@ bool render_font::load_cached_bdf(const char *filename)
// if that worked, we're done
if (result)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return true;
}
}
@@ -457,7 +457,7 @@ bool render_font::load_cached_bdf(const char *filename)
UINT32 read = file.read(data + bytes, m_rawsize - bytes);
if (read != m_rawsize - bytes)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
}
@@ -559,7 +559,7 @@ bool render_font::load_bdf()
{
// if we don't have a subtable yet, make one
if (m_glyphs[charnum / 256] == NULL)
- m_glyphs[charnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ m_glyphs[charnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
// fill in the entry
glyph &gl = m_glyphs[charnum / 256][charnum % 256];
@@ -620,11 +620,11 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
return false;
// now read the rest of the data
- UINT8 *data = auto_alloc_array(&m_manager.machine(), UINT8, filesize - CACHED_HEADER_SIZE);
+ UINT8 *data = auto_alloc_array(m_manager.machine(), UINT8, filesize - CACHED_HEADER_SIZE);
bytes_read = file.read(data, filesize - CACHED_HEADER_SIZE);
if (bytes_read != filesize - CACHED_HEADER_SIZE)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
@@ -637,7 +637,7 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
// if we don't have a subtable yet, make one
if (m_glyphs[chnum / 256] == NULL)
- m_glyphs[chnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ m_glyphs[chnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
// fill in the entry
glyph &gl = m_glyphs[chnum / 256][chnum % 256];
@@ -652,7 +652,7 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
offset += (gl.bmwidth * gl.bmheight + 7) / 8;
if (offset > filesize - CACHED_HEADER_SIZE)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
}
@@ -696,10 +696,10 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
try
{
// allocate an array to hold the character data
- UINT8 *chartable = auto_alloc_array_clear(&m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE);
+ UINT8 *chartable = auto_alloc_array_clear(m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE);
// allocate a temp buffer to compress into
- UINT8 *tempbuffer = auto_alloc_array(&m_manager.machine(), UINT8, 65536);
+ UINT8 *tempbuffer = auto_alloc_array(m_manager.machine(), UINT8, 65536);
// write the header
UINT8 *dest = tempbuffer;
@@ -773,7 +773,7 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
// free the bitmap and texture
m_manager.texture_free(gl.texture);
- auto_free(&m_manager.machine(), gl.bitmap);
+ auto_free(m_manager.machine(), gl.bitmap);
gl.texture = NULL;
gl.bitmap = NULL;
}
@@ -802,15 +802,15 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
throw emu_fatalerror("Error writing cached file");
// all done
- auto_free(&m_manager.machine(), tempbuffer);
- auto_free(&m_manager.machine(), chartable);
+ auto_free(m_manager.machine(), tempbuffer);
+ auto_free(m_manager.machine(), chartable);
return true;
}
catch (...)
{
file.remove_on_close();
- auto_free(&m_manager.machine(), tempbuffer);
- auto_free(&m_manager.machine(), chartable);
+ auto_free(m_manager.machine(), tempbuffer);
+ auto_free(m_manager.machine(), chartable);
return false;
}
}
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 5f99b5b8d27..c6e03f1c1d6 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -454,7 +454,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
for (xml_data_node *compnode = elemnode.child; compnode != NULL; compnode = compnode->next)
{
// allocate a new component
- component &newcomp = m_complist.append(*auto_alloc(&machine, component(machine, *compnode, dirname)));
+ component &newcomp = m_complist.append(*auto_alloc(machine, component(machine, *compnode, dirname)));
// accumulate bounds
if (first)
@@ -494,7 +494,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
}
// allocate an array of element textures for the states
- m_elemtex = auto_alloc_array(&machine, texture, m_maxstate + 1);
+ m_elemtex = auto_alloc_array(machine, texture, m_maxstate + 1);
}
@@ -505,7 +505,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
layout_element::~layout_element()
{
// loop over all states and free their textures
- auto_free(&m_machine, m_elemtex);
+ auto_free(m_machine, m_elemtex);
}
@@ -1682,19 +1682,19 @@ layout_view::layout_view(running_machine &machine, xml_data_node &viewnode, simp
// load backdrop items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop"))
- m_backdrop_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_backdrop_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load screen items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "screen"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "screen"))
- m_screen_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_screen_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load overlay items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "overlay"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "overlay"))
- m_overlay_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_overlay_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load bezel items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "bezel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "bezel"))
- m_bezel_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_bezel_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// recompute the data for the view based on a default layer config
recompute(render_layer_config());
@@ -1914,7 +1914,7 @@ int layout_view::item::state() const
{
const input_field_config *field = input_field_by_tag_and_mask(m_element->machine().m_portlist, m_input_tag, m_input_mask);
if (field != NULL)
- state = ((input_port_read_safe(&m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
+ state = ((input_port_read_safe(m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
}
return state;
}
@@ -1946,11 +1946,11 @@ layout_file::layout_file(running_machine &machine, xml_data_node &rootnode, cons
// parse all the elements
for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element"))
- m_elemlist.append(*auto_alloc(&machine, layout_element(machine, *elemnode, dirname)));
+ m_elemlist.append(*auto_alloc(machine, layout_element(machine, *elemnode, dirname)));
// parse all the views
for (xml_data_node *viewnode = xml_get_sibling(mamelayoutnode->child, "view"); viewnode != NULL; viewnode = xml_get_sibling(viewnode->next, "view"))
- m_viewlist.append(*auto_alloc(&machine, layout_view(machine, *viewnode, m_elemlist)));
+ m_viewlist.append(*auto_alloc(machine, layout_view(machine, *viewnode, m_elemlist)));
}
diff --git a/src/emu/romload.c b/src/emu/romload.c
index fec47443462..760cfc46ac0 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -49,7 +49,9 @@ struct _open_chd
typedef struct _romload_private rom_load_data;
struct _romload_private
{
- running_machine *machine; /* machine object where needed */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine; /* machine object where needed */
int system_bios; /* the system BIOS we wish to load */
int warnings; /* warning count during processing */
@@ -127,11 +129,11 @@ file_error common_process_file(emu_options &options, const char *location, bool
CHD file associated with the given region
-------------------------------------------------*/
-chd_file *get_disk_handle(running_machine *machine, const char *region)
+chd_file *get_disk_handle(running_machine &machine, const char *region)
{
open_chd *curdisk;
- for (curdisk = machine->romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next)
+ for (curdisk = machine.romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next)
if (strcmp(curdisk->region, region) == 0)
return (curdisk->diffchd != NULL) ? curdisk->diffchd : curdisk->origchd;
return NULL;
@@ -143,9 +145,9 @@ chd_file *get_disk_handle(running_machine *machine, const char *region)
list of CHD files
-------------------------------------------------*/
-static void add_disk_handle(running_machine *machine, open_chd *chd)
+static void add_disk_handle(running_machine &machine, open_chd *chd)
{
- romload_private *romload_data = machine->romload_data;
+ romload_private *romload_data = machine.romload_data;
*romload_data->chd_list_tailptr = auto_alloc(machine, open_chd);
**romload_data->chd_list_tailptr = *chd;
@@ -168,7 +170,7 @@ void set_disk_handle(running_machine &machine, const char *region, emu_file &fil
chd.origfile = &file;
/* we're okay, add to the list of disks */
- add_disk_handle(&machine, &chd);
+ add_disk_handle(machine, &chd);
}
@@ -330,7 +332,7 @@ static void CLIB_DECL ATTR_PRINTF(1,2) debugload(const char *string, ...)
static void determine_bios_rom(rom_load_data *romdata)
{
- const char *specbios = romdata->machine->options().bios();
+ const char *specbios = romdata->machine().options().bios();
const char *defaultname = NULL;
const rom_entry *rom;
int default_no = 1;
@@ -338,7 +340,7 @@ static void determine_bios_rom(rom_load_data *romdata)
romdata->system_bios = 0;
- for (const rom_source *source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (const rom_source *source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
{
/* first determine the default BIOS name */
for (rom = source->rom_region(); !ROMENTRY_ISEND(rom); rom++)
@@ -396,7 +398,7 @@ static void count_roms(rom_load_data *romdata)
romdata->romstotalsize = 0;
/* loop over regions, then over files */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
if (ROM_GETBIOSFLAGS(rom) == 0 || ROM_GETBIOSFLAGS(rom) == romdata->system_bios)
@@ -412,10 +414,10 @@ static void count_roms(rom_load_data *romdata)
random data
-------------------------------------------------*/
-static void fill_random(running_machine *machine, UINT8 *base, UINT32 length)
+static void fill_random(running_machine &machine, UINT8 *base, UINT32 length)
{
while (length--)
- *base++ = machine->rand();
+ *base++ = machine.rand();
}
@@ -531,7 +533,7 @@ static void display_loading_rom_message(rom_load_data *romdata, const char *name
else
sprintf(buffer, "Loading Complete");
- ui_set_startup_text(romdata->machine, buffer, FALSE);
+ ui_set_startup_text(romdata->machine(), buffer, FALSE);
}
@@ -550,7 +552,7 @@ static void display_rom_load_results(rom_load_data *romdata)
{
/* create the error message and exit fatally */
mame_printf_error("%s", romdata->errorstring.cstr());
- fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
+ fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
}
/* if we had warnings, output them, but continue */
@@ -569,7 +571,7 @@ static void display_rom_load_results(rom_load_data *romdata)
static void region_post_process(rom_load_data *romdata, const char *rgntag, bool invert)
{
- const memory_region *region = romdata->machine->region(rgntag);
+ const memory_region *region = romdata->machine().region(rgntag);
UINT8 *base;
int i, j;
@@ -624,9 +626,9 @@ static int open_rom_file(rom_load_data *romdata, const char *regiontag, const ro
/* attempt reading up the chain through the parents. It automatically also
attempts any kind of load by checksum supported by the archives. */
romdata->file = NULL;
- for (drv = &romdata->machine->system(); romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
+ for (drv = &romdata->machine().system(); romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
if (drv->name != NULL && *drv->name != 0)
- filerr = common_process_file(romdata->machine->options(), drv->name, has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), drv->name, has_crc, crc, romp, &romdata->file);
/* if the region is load by name, load the ROM from there */
if (romdata->file == NULL && regiontag != NULL)
@@ -676,21 +678,21 @@ static int open_rom_file(rom_load_data *romdata, const char *regiontag, const ro
// - if we are not using lists, we have regiontag only;
// - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
if (!is_list)
- filerr = common_process_file(romdata->machine->options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
else
{
// try to load from list/setname
if ((romdata->file == NULL) && (tag2.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from list/parentname
if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from setname
if ((romdata->file == NULL) && (tag4.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from parentname
if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
}
}
@@ -716,7 +718,7 @@ static int rom_fread(rom_load_data *romdata, UINT8 *buffer, int length)
/* otherwise, fill with randomness */
else
- fill_random(romdata->machine, buffer, length);
+ fill_random(romdata->machine(), buffer, length);
return length;
}
@@ -761,7 +763,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
/* use a temporary buffer for complex loads */
tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes);
- tempbuf = auto_alloc_array(romdata->machine, UINT8, tempbufsize);
+ tempbuf = auto_alloc_array(romdata->machine(), UINT8, tempbufsize);
/* chunky reads for complex loads */
skip += groupsize;
@@ -775,7 +777,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
LOG((" Reading %X bytes into buffer\n", bytesleft));
if (rom_fread(romdata, bufptr, bytesleft) != bytesleft)
{
- auto_free(romdata->machine, tempbuf);
+ auto_free(romdata->machine(), tempbuf);
return 0;
}
numbytes -= bytesleft;
@@ -836,7 +838,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
}
}
}
- auto_free(romdata->machine, tempbuf);
+ auto_free(romdata->machine(), tempbuf);
LOG((" All done\n"));
return ROM_GETLENGTH(romp);
@@ -885,7 +887,7 @@ static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
fatalerror("Error in RomModule definition: COPY has an invalid length\n");
/* make sure the source was valid */
- const memory_region *region = romdata->machine->region(srcrgntag);
+ const memory_region *region = romdata->machine().region(srcrgntag);
if (region == NULL)
fatalerror("Error in RomModule definition: COPY from an invalid region\n");
@@ -1226,7 +1228,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* first open the source drive */
LOG(("Opening disk image: %s\n", filename.cstr()));
- err = open_disk_image(romdata->machine->options(), &romdata->machine->system(), romp, &chd.origfile, &chd.origchd, locationtag);
+ err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, &chd.origfile, &chd.origchd, locationtag);
if (err != CHDERR_NONE)
{
if (err == CHDERR_FILE_NOT_FOUND)
@@ -1266,7 +1268,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
if (!DISK_ISREADONLY(romp))
{
/* try to open or create the diff */
- err = open_disk_diff(romdata->machine->options(), romp, chd.origchd, &chd.difffile, &chd.diffchd);
+ err = open_disk_diff(romdata->machine().options(), romp, chd.origchd, &chd.difffile, &chd.diffchd);
if (err != CHDERR_NONE)
{
romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_error_string(err));
@@ -1277,7 +1279,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* we're okay, add to the list of disks */
LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
- add_disk_handle(romdata->machine, &chd);
+ add_disk_handle(romdata->machine(), &chd);
}
}
}
@@ -1288,9 +1290,9 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
flags for the given device
-------------------------------------------------*/
-static void normalize_flags_for_device(running_machine *machine, const char *rgntag, UINT8 &width, endianness_t &endian)
+static void normalize_flags_for_device(running_machine &machine, const char *rgntag, UINT8 &width, endianness_t &endian)
{
- device_t *device = machine->device(rgntag);
+ device_t *device = machine.device(rgntag);
device_memory_interface *memory;
if (device->interface(memory))
{
@@ -1332,7 +1334,7 @@ static void normalize_flags_for_device(running_machine *machine, const char *rgn
void load_software_part_region(device_t *device, char *swlist, char *swname, rom_entry *start_region)
{
astring locationtag(swlist), breakstr("%");
- rom_load_data *romdata = device->machine->romload_data;
+ rom_load_data *romdata = device->machine().romload_data;
const rom_entry *region;
astring regiontag;
@@ -1340,7 +1342,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
// " swlist % clonename % parentname "
// open_rom_file contains the code to split the elements and to create paths to load from
- software_list *software_list_ptr = software_list_open(device->machine->options(), swlist, FALSE, NULL);
+ software_list *software_list_ptr = software_list_open(device->machine().options(), swlist, FALSE, NULL);
if (software_list_ptr)
{
locationtag.cat(breakstr);
@@ -1354,7 +1356,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
locationtag.cat(breakstr);
// printf("%s\n", locationtag.cstr());
}
- const char *parentname = software_get_clone(device->machine->options(), swlist, swinfo->shortname);
+ const char *parentname = software_get_clone(device->machine().options(), swlist, swinfo->shortname);
if (parentname != NULL)
swinfo = software_list_find(software_list_ptr, parentname, NULL);
else
@@ -1370,12 +1372,12 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
romdata->errorstring.reset();
- if (software_get_support(device->machine->options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
+ if (software_get_support(device->machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
{
romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist);
romdata->warnings++;
}
- if (software_get_support(device->machine->options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
+ if (software_get_support(device->machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
{
romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist);
romdata->warnings++;
@@ -1395,18 +1397,18 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
/* if this is a device region, override with the device width and endianness */
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
UINT8 width = ROMREGION_GETWIDTH(region) / 8;
- const memory_region *memregion = romdata->machine->region(regiontag);
+ const memory_region *memregion = romdata->machine().region(regiontag);
if (memregion != NULL)
{
- if (romdata->machine->device(regiontag) != NULL)
- normalize_flags_for_device(romdata->machine, regiontag, width, endianness);
+ if (romdata->machine().device(regiontag) != NULL)
+ normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* clear old region (todo: should be moved to an image unload function) */
- romdata->machine->region_free(memregion->name());
+ romdata->machine().region_free(memregion->name());
}
/* remember the base and length */
- romdata->region = romdata->machine->region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
@@ -1420,7 +1422,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
#ifdef MAME_DEBUG
/* if we're debugging, fill region with random data to catch errors */
else
- fill_random(romdata->machine, romdata->region->base(), romdata->region->bytes());
+ fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes());
#endif
/* now process the entries in the region */
@@ -1450,12 +1452,12 @@ static void process_region_list(rom_load_data *romdata)
const rom_entry *region;
/* loop until we hit the end */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
{
UINT32 regionlength = ROMREGION_GETLENGTH(region);
- rom_region_name(regiontag, &romdata->machine->system(), source, region);
+ rom_region_name(regiontag, &romdata->machine().system(), source, region);
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
/* the first entry must be a region */
@@ -1466,11 +1468,11 @@ static void process_region_list(rom_load_data *romdata)
/* if this is a device region, override with the device width and endianness */
UINT8 width = ROMREGION_GETWIDTH(region) / 8;
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
- if (romdata->machine->device(regiontag) != NULL)
- normalize_flags_for_device(romdata->machine, regiontag, width, endianness);
+ if (romdata->machine().device(regiontag) != NULL)
+ normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* remember the base and length */
- romdata->region = romdata->machine->region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
@@ -1484,7 +1486,7 @@ static void process_region_list(rom_load_data *romdata)
#ifdef MAME_DEBUG
/* if we're debugging, fill region with random data to catch errors */
else
- fill_random(romdata->machine, romdata->region->base(), romdata->region->bytes());
+ fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes());
#endif
/* now process the entries in the region */
@@ -1495,7 +1497,7 @@ static void process_region_list(rom_load_data *romdata)
}
/* now go back and post-process all the regions */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
region_post_process(romdata, ROMREGION_GETTAG(region), ROMREGION_ISINVERTED(region));
}
@@ -1506,18 +1508,18 @@ static void process_region_list(rom_load_data *romdata)
images associated with the given machine
-------------------------------------------------*/
-void rom_init(running_machine *machine)
+void rom_init(running_machine &machine)
{
rom_load_data *romdata;
/* allocate private data */
- machine->romload_data = romdata = auto_alloc_clear(machine, romload_private);
+ machine.romload_data = romdata = auto_alloc_clear(machine, romload_private);
/* make sure we get called back on the way out */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, rom_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, rom_exit);
/* reset the romdata struct */
- romdata->machine = machine;
+ romdata->m_machine = &machine;
/* figure out which BIOS we are using */
determine_bios_rom(romdata);
@@ -1527,7 +1529,7 @@ void rom_init(running_machine *machine)
/* reset the disk list */
romdata->chd_list = NULL;
- romdata->chd_list_tailptr = &machine->romload_data->chd_list;
+ romdata->chd_list_tailptr = &machine.romload_data->chd_list;
/* process the ROM entries we were passed */
process_region_list(romdata);
@@ -1565,9 +1567,9 @@ static void rom_exit(running_machine &machine)
warnings we generated
-------------------------------------------------*/
-int rom_load_warnings(running_machine *machine)
+int rom_load_warnings(running_machine &machine)
{
- return machine->romload_data->warnings;
+ return machine.romload_data->warnings;
}
@@ -1576,7 +1578,7 @@ int rom_load_warnings(running_machine *machine)
BAD_DUMP/NO_DUMP warnings we generated
-------------------------------------------------*/
-int rom_load_knownbad(running_machine *machine)
+int rom_load_knownbad(running_machine &machine)
{
- return machine->romload_data->knownbad;
+ return machine.romload_data->knownbad;
}
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 68d842d1613..65451683ec7 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -266,13 +266,13 @@ struct rom_entry
/* ----- ROM processing ----- */
/* load the ROMs and open the disk images associated with the given machine */
-void rom_init(running_machine *machine);
+void rom_init(running_machine &machine);
/* return the number of warnings we generated */
-int rom_load_warnings(running_machine *machine);
+int rom_load_warnings(running_machine &machine);
/* return the number of BAD_DUMP/NO_DUMP warnings we generated */
-int rom_load_knownbad(running_machine *machine);
+int rom_load_knownbad(running_machine &machine);
/* ----- Helpers ----- */
@@ -318,7 +318,7 @@ astring &rom_region_name(astring &result, const game_driver *drv, const rom_sour
chd_error open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_entry *romp, emu_file **image_file, chd_file **image_chd,const char *locationtag);
/* return a pointer to the CHD file associated with the given region */
-chd_file *get_disk_handle(running_machine *machine, const char *region);
+chd_file *get_disk_handle(running_machine &machine, const char *region);
/* set a pointer to the CHD file associated with the given region */
void set_disk_handle(running_machine &machine, const char *region, emu_file &file, chd_file &chdfile);
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index 1630d4dfbee..33cbac54fe6 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -143,7 +143,7 @@ emu_timer &emu_timer::init(running_machine &machine, timer_expired_func callback
emu_timer &emu_timer::init(device_t &device, device_timer_id id, void *ptr, bool temporary)
{
// ensure the entire timer state is clean
- m_machine = device.machine;
+ m_machine = &device.machine();
m_next = NULL;
m_prev = NULL;
m_callback = NULL;
@@ -875,7 +875,7 @@ void device_scheduler::execute_timers()
if (timer.m_device != NULL)
timer.m_device->timer_expired(timer, timer.m_id, timer.m_param, timer.m_ptr);
else if (timer.m_callback != NULL)
- (*timer.m_callback)(&m_machine, timer.m_ptr, timer.m_param);
+ (*timer.m_callback)(m_machine, timer.m_ptr, timer.m_param);
g_profiler.stop();
}
diff --git a/src/emu/schedule.h b/src/emu/schedule.h
index 959d2345ad5..4c8e936fd45 100644
--- a/src/emu/schedule.h
+++ b/src/emu/schedule.h
@@ -62,7 +62,7 @@
#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c))
#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c))
-#define TIMER_CALLBACK(name) void name(running_machine *machine, void *ptr, int param)
+#define TIMER_CALLBACK(name) void name(running_machine &machine, void *ptr, int param)
@@ -71,14 +71,14 @@
//**************************************************************************
// timer callbacks look like this
-typedef void (*timer_expired_func)(running_machine *machine, void *ptr, INT32 param);
+typedef void (*timer_expired_func)(running_machine &machine, void *ptr, INT32 param);
// stub for when the ptr parameter points to a class
template<class T, void (T::*func)(running_machine &machine, INT32 param)>
-void timer_expired_stub(running_machine *machine, void *ptr, INT32 param)
+void timer_expired_stub(running_machine &machine, void *ptr, INT32 param)
{
T *target = reinterpret_cast<T *>(ptr);
- (target->*func)(*machine, param);
+ (target->*func)(machine, param);
}
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 71e3a964524..8908fd69fe7 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -107,7 +107,7 @@ device_config *screen_device_config::static_alloc_device_config(const machine_co
device_t *screen_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, screen_device(machine, *this));
+ return auto_alloc(machine, screen_device(machine, *this));
}
@@ -371,15 +371,15 @@ void screen_device::device_start()
m_container->set_user_settings(settings);
// allocate the VBLANK timers
- m_vblank_begin_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
- m_vblank_end_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
+ m_vblank_begin_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
+ m_vblank_end_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
// allocate a timer to reset partial updates
- m_scanline0_timer = machine->scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
+ m_scanline0_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
// allocate a timer to generate per-scanline updates
- if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
- m_scanline_timer = machine->scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
+ if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
+ m_scanline_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
// configure the screen with the default parameters
configure(m_config.m_width, m_config.m_height, m_config.m_visarea, m_config.m_refresh);
@@ -389,23 +389,23 @@ void screen_device::device_start()
m_vblank_end_time = attotime(0, m_vblank_period);
// start the timer to generate per-scanline updates
- if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
+ if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
m_scanline_timer->adjust(time_until_pos(0));
// create burn-in bitmap
- if (machine->options().burnin())
+ if (m_machine.options().burnin())
{
int width, height;
- if (sscanf(machine->options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
+ if (sscanf(m_machine.options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
width = height = 300;
- m_burnin = auto_alloc(machine, bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
+ m_burnin = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
if (m_burnin == NULL)
fatalerror("Error allocating burn-in bitmap for screen at (%dx%d)\n", width, height);
bitmap_fill(m_burnin, NULL, 0);
}
// load the effect overlay
- const char *overname = machine->options().effect();
+ const char *overname = m_machine.options().effect();
if (overname != NULL && strcmp(overname, "none") != 0)
load_effect_overlay(overname);
@@ -496,7 +496,7 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
void screen_device::reset_origin(int beamy, int beamx)
{
// compute the effective VBLANK start/end times
- attotime curtime = machine->time();
+ attotime curtime = m_machine.time();
m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime);
m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period);
@@ -541,8 +541,8 @@ void screen_device::realloc_screen_bitmaps()
// free what we have currently
m_machine.render().texture_free(m_texture[0]);
m_machine.render().texture_free(m_texture[1]);
- auto_free(machine, m_bitmap[0]);
- auto_free(machine, m_bitmap[1]);
+ auto_free(m_machine, m_bitmap[0]);
+ auto_free(m_machine, m_bitmap[1]);
// compute new width/height
curwidth = MAX(m_width, curwidth);
@@ -552,17 +552,17 @@ void screen_device::realloc_screen_bitmaps()
palette_t *palette = NULL;
switch (m_config.m_format)
{
- case BITMAP_FORMAT_INDEXED16: m_texture_format = TEXFORMAT_PALETTE16; palette = machine->palette; break;
+ case BITMAP_FORMAT_INDEXED16: m_texture_format = TEXFORMAT_PALETTE16; palette = m_machine.palette; break;
case BITMAP_FORMAT_RGB15: m_texture_format = TEXFORMAT_RGB15; palette = NULL; break;
case BITMAP_FORMAT_RGB32: m_texture_format = TEXFORMAT_RGB32; palette = NULL; break;
default: fatalerror("Invalid bitmap format!"); break;
}
// allocate bitmaps
- m_bitmap[0] = auto_alloc(machine, bitmap_t(curwidth, curheight, m_config.m_format));
- bitmap_set_palette(m_bitmap[0], machine->palette);
- m_bitmap[1] = auto_alloc(machine, bitmap_t(curwidth, curheight, m_config.m_format));
- bitmap_set_palette(m_bitmap[1], machine->palette);
+ m_bitmap[0] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
+ bitmap_set_palette(m_bitmap[0], m_machine.palette);
+ m_bitmap[1] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
+ bitmap_set_palette(m_bitmap[1], m_machine.palette);
// allocate textures
m_texture[0] = m_machine.render().texture_alloc();
@@ -609,7 +609,7 @@ bool screen_device::update_partial(int scanline)
LOG_PARTIAL_UPDATES(("Partial: update_partial(%s, %d): ", tag(), scanline));
// these two checks only apply if we're allowed to skip frames
- if (!(machine->config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
+ if (!(m_machine.config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
{
// if skipping this frame, bail
if (m_machine.video().skip_this_frame())
@@ -696,7 +696,7 @@ void screen_device::update_now()
int screen_device::vpos() const
{
- attoseconds_t delta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
int vpos;
// round to the nearest pixel
@@ -717,7 +717,7 @@ int screen_device::vpos() const
int screen_device::hpos() const
{
- attoseconds_t delta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
// round to the nearest pixel
delta += m_pixeltime / 2;
@@ -753,7 +753,7 @@ attotime screen_device::time_until_pos(int vpos, int hpos) const
attoseconds_t targetdelta = (attoseconds_t)vpos * m_scantime + (attoseconds_t)hpos * m_pixeltime;
// if we're past that time (within 1/2 of a pixel), head to the next frame
- attoseconds_t curdelta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t curdelta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
if (targetdelta <= curdelta + m_pixeltime / 2)
targetdelta += m_frame_period;
while (targetdelta <= curdelta)
@@ -777,7 +777,7 @@ attotime screen_device::time_until_vblank_end() const
attotime target_time = m_vblank_end_time;
if (!vblank())
target_time += attotime(0, m_frame_period);
- return target_time - machine->time();
+ return target_time - m_machine.time();
}
@@ -800,7 +800,7 @@ void screen_device::register_vblank_callback(vblank_state_changed_func vblank_ca
// if not found, register
if (*itemptr == NULL)
{
- *itemptr = auto_alloc(machine, callback_item);
+ *itemptr = auto_alloc(m_machine, callback_item);
(*itemptr)->m_next = NULL;
(*itemptr)->m_callback = vblank_callback;
(*itemptr)->m_param = param;
@@ -816,7 +816,7 @@ void screen_device::register_vblank_callback(vblank_state_changed_func vblank_ca
void screen_device::vblank_begin_callback()
{
// reset the starting VBLANK time
- m_vblank_start_time = machine->time();
+ m_vblank_start_time = m_machine.time();
m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period);
// call the screen specific callbacks
@@ -824,8 +824,8 @@ void screen_device::vblank_begin_callback()
(*item->m_callback)(*this, item->m_param, true);
// if this is the primary screen and we need to update now
- if (this == machine->primary_screen && !(machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
- machine->video().frame_update();
+ if (this == m_machine.primary_screen && !(m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ m_machine.video().frame_update();
// reset the VBLANK start timer for the next frame
m_vblank_begin_timer->adjust(time_until_vblank_start());
@@ -850,8 +850,8 @@ void screen_device::vblank_end_callback()
(*item->m_callback)(*this, item->m_param, false);
// if this is the primary screen and we need to update now
- if (this == machine->primary_screen && (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
- machine->video().frame_update();
+ if (this == m_machine.primary_screen && (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ m_machine.video().frame_update();
// increment the frame number counter
m_frame_number++;
@@ -902,7 +902,7 @@ bool screen_device::update_quads()
if (m_machine.render().is_live(*this))
{
// only update if empty and not a vector game; otherwise assume the driver did it directly
- if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine->config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
+ if (m_config.m_type != SCREEN_TYPE_VECTOR && (m_machine.config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
{
// if we're not skipping the frame and if the screen actually changed, then update the texture
if (!m_machine.video().skip_this_frame() && m_changed)
@@ -911,7 +911,7 @@ bool screen_device::update_quads()
fixedvis.max_x++;
fixedvis.max_y++;
- palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? machine->palette : NULL;
+ palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? m_machine.palette : NULL;
m_texture[m_curbitmap]->set_bitmap(m_bitmap[m_curbitmap], &fixedvis, m_texture_format, palette);
m_curtexture = m_curbitmap;
@@ -965,7 +965,7 @@ void screen_device::update_burnin()
if (srcbitmap->format == BITMAP_FORMAT_INDEXED16)
{
const UINT16 *src = BITMAP_ADDR16(srcbitmap, srcy >> 16, 0);
- const rgb_t *palette = palette_entry_list_adjusted(machine->palette);
+ const rgb_t *palette = palette_entry_list_adjusted(m_machine.palette);
for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
{
rgb_t pixel = palette[src[srcx >> 16]];
@@ -1015,7 +1015,7 @@ void screen_device::finalize_burnin()
scaledvis.max_y = m_visarea.max_y * m_burnin->height / m_height;
// wrap a bitmap around the subregion we care about
- bitmap_t *finalmap = auto_alloc(machine, bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
+ bitmap_t *finalmap = auto_alloc(m_machine, bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
scaledvis.max_y + 1 - scaledvis.min_y,
BITMAP_FORMAT_ARGB32));
@@ -1058,7 +1058,7 @@ void screen_device::finalize_burnin()
// compute the name and create the file
emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- file_error filerr = file.open(machine->basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
+ file_error filerr = file.open(m_machine.basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
if (filerr == FILERR_NONE)
{
png_info pnginfo = { 0 };
@@ -1068,7 +1068,7 @@ void screen_device::finalize_burnin()
// add two text entries describing the image
sprintf(text, APPNAME " %s", build_version);
png_add_text(&pnginfo, "Software", text);
- sprintf(text, "%s %s", machine->system().manufacturer, machine->system().description);
+ sprintf(text, "%s %s", m_machine.system().manufacturer, m_machine.system().description);
png_add_text(&pnginfo, "System", text);
// now do the actual work
@@ -1125,7 +1125,7 @@ bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect)
void screen_device::screen_eof()
{
if (m_config.m_screen_eof != NULL) {
- return (*m_config.m_screen_eof)(this, machine);
+ return (*m_config.m_screen_eof)(this, m_machine);
} else {
m_machine.driver_data<driver_device>()->screen_eof();
}
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 746b7bd61f1..2c7f9d3ae25 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -78,7 +78,7 @@ extern const device_type SCREEN;
// callback that is called to notify of a change in the VBLANK state
typedef void (*vblank_state_changed_func)(screen_device &device, void *param, bool vblank_state);
typedef UINT32 (*screen_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect);
-typedef void (*screen_eof_func)(screen_device *screen, running_machine *machine);
+typedef void (*screen_eof_func)(screen_device *screen, running_machine &machine);
// ======================> screen_device_config
@@ -175,14 +175,14 @@ public:
// beam positioning and state
int vpos() const;
int hpos() const;
- bool vblank() const { return (machine->time() < m_vblank_end_time); }
+ bool vblank() const { return (m_machine.time() < m_vblank_end_time); }
bool hblank() const { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x); }
// timing
attotime time_until_pos(int vpos, int hpos = 0) const;
attotime time_until_vblank_start() const { return time_until_pos(m_visarea.max_y + 1); }
attotime time_until_vblank_end() const;
- attotime time_until_update() const { return (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
+ attotime time_until_update() const { return (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
attotime scan_period() const { return attotime(0, m_scantime); }
attotime frame_period() const { return (this == NULL || !started()) ? DEFAULT_FRAME_PERIOD : attotime(0, m_frame_period); };
UINT64 frame_number() const { return m_frame_number; }
@@ -194,7 +194,7 @@ public:
// additional helpers
void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
- bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
+ bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(m_machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
// internal to the video system
bool update_quads();
@@ -283,7 +283,7 @@ private:
#define SCREEN_UPDATE_CALL(name) SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect)
#define SCREEN_EOF_NAME(name) screen_eof_##name
-#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine *machine)
+#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine &machine)
#define SCREEN_EOF_CALL(name) SCREEN_EOF_NAME(name)(screen, machine)
#define screen_eof_0 NULL
diff --git a/src/emu/softlist.c b/src/emu/softlist.c
index 0dc7aa57205..8e3ce252433 100644
--- a/src/emu/softlist.c
+++ b/src/emu/softlist.c
@@ -163,7 +163,7 @@ INLINE void unknown_attribute_value(parse_state *state,
from the global pool. So they should be global_free'ed
when they are not used anymore.
-------------------------------------------------*/
-static void software_name_split(running_machine* machine, const char *swlist_swname, char **swlist_name, char **swname, char **swpart )
+static void software_name_split(running_machine& machine, const char *swlist_swname, char **swlist_name, char **swname, char **swpart )
{
const char *split_1st_loc = strchr( swlist_swname, ':' );
const char *split_2nd_loc = ( split_1st_loc ) ? strchr( split_1st_loc + 1, ':' ) : NULL;
@@ -1383,7 +1383,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
*sw_part = NULL;
/* Split full software name into software list name and short software name */
- software_name_split( image->device().machine, path, &swlist_name, &swname, &swpart );
+ software_name_split( image->device().machine(), path, &swlist_name, &swname, &swpart );
swname_bckp = swname;
const char *interface = image->image_config().image_interface();
@@ -1391,7 +1391,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
if ( swlist_name )
{
/* Try to open the software list xml file explicitly named by the user */
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1406,7 +1406,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
else
{
/* Loop through all the software lists named in the driver */
- for (device_t *swlists = image->device().machine->m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
if ( swlists )
{
@@ -1425,7 +1425,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1445,14 +1445,14 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
/* If not found try to load the software list using the driver name */
if ( ! software_part_ptr )
{
- swlist_name = (char *)image->device().machine->system().name;
+ swlist_name = (char *)image->device().machine().system().name;
if ( software_list_ptr )
{
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1478,7 +1478,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1502,13 +1502,13 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
if (software_info_ptr == NULL)
{
// check if there is at least a software list
- if (image->device().machine->m_devicelist.first(SOFTWARE_LIST))
+ if (image->device().machine().m_devicelist.first(SOFTWARE_LIST))
{
mame_printf_error("\n\"%s\" approximately matches the following\n"
"supported software items (best match first):\n\n", swname_bckp);
}
- for (device_t *swlists = image->device().machine->m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config();
@@ -1516,7 +1516,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
{
if (swlist->list_name[i] && *swlist->list_name[i])
{
- software_list *list = software_list_open(image->device().machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(image->device().machine().options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -1561,37 +1561,37 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
}
/* Create a copy of the software and part information */
- *sw_info = auto_alloc_clear( image->device().machine, software_info );
- (*sw_info)->shortname = auto_strdup( image->device().machine, software_info_ptr->shortname );
- (*sw_info)->longname = auto_strdup( image->device().machine, software_info_ptr->longname );
+ *sw_info = auto_alloc_clear( image->device().machine(), software_info );
+ (*sw_info)->shortname = auto_strdup( image->device().machine(), software_info_ptr->shortname );
+ (*sw_info)->longname = auto_strdup( image->device().machine(), software_info_ptr->longname );
if ( software_info_ptr->year )
- (*sw_info)->year = auto_strdup( image->device().machine, software_info_ptr->year );
+ (*sw_info)->year = auto_strdup( image->device().machine(), software_info_ptr->year );
if ( software_info_ptr->publisher )
- (*sw_info)->publisher = auto_strdup( image->device().machine, software_info_ptr->publisher );
+ (*sw_info)->publisher = auto_strdup( image->device().machine(), software_info_ptr->publisher );
- *sw_part = auto_alloc_clear( image->device().machine, software_part );
- (*sw_part)->name = auto_strdup( image->device().machine, software_part_ptr->name );
+ *sw_part = auto_alloc_clear( image->device().machine(), software_part );
+ (*sw_part)->name = auto_strdup( image->device().machine(), software_part_ptr->name );
if ( software_part_ptr->interface_ )
- (*sw_part)->interface_ = auto_strdup( image->device().machine, software_part_ptr->interface_ );
+ (*sw_part)->interface_ = auto_strdup( image->device().machine(), software_part_ptr->interface_ );
if ( software_part_ptr->featurelist )
{
feature_list *list = software_part_ptr->featurelist;
- feature_list *new_list = auto_alloc_clear( image->device().machine, feature_list );
+ feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list );
(*sw_part)->featurelist = new_list;
- new_list->name = auto_strdup( image->device().machine, list->name );
- new_list->value = auto_strdup( image->device().machine, list->value );
+ new_list->name = auto_strdup( image->device().machine(), list->name );
+ new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
while( list )
{
- new_list->next = auto_alloc_clear( image->device().machine, feature_list );
+ new_list->next = auto_alloc_clear( image->device().machine(), feature_list );
new_list = new_list->next;
- new_list->name = auto_strdup( image->device().machine, list->name );
- new_list->value = auto_strdup( image->device().machine, list->value );
+ new_list->name = auto_strdup( image->device().machine(), list->name );
+ new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
}
@@ -1600,7 +1600,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
}
/* Tell the world which part we actually loaded */
- *full_sw_name = auto_alloc_array( image->device().machine, char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
+ *full_sw_name = auto_alloc_array( image->device().machine(), char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
sprintf( *full_sw_name, "%s:%s:%s", swlist_name, software_info_ptr->shortname, software_part_ptr->name );
}
@@ -1611,9 +1611,9 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_info_ptr = NULL;
software_list_ptr = NULL;
}
- auto_free( image->device().machine, swlist_name );
- auto_free( image->device().machine, swname );
- auto_free( image->device().machine, swpart );
+ auto_free( image->device().machine(), swlist_name );
+ auto_free( image->device().machine(), swname );
+ auto_free( image->device().machine(), swpart );
return result;
}
@@ -1872,9 +1872,9 @@ struct _software_part_state
};
-static void ui_mess_menu_populate_software_parts(running_machine *machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
+static void ui_mess_menu_populate_software_parts(running_machine &machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
{
- software_list *list = software_list_open(machine->options(), swlist, FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist, FALSE, NULL);
if (list)
{
@@ -1907,7 +1907,7 @@ static void ui_mess_menu_populate_software_parts(running_machine *machine, ui_me
}
}
-void ui_mess_menu_software_parts(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_software_parts(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
software_entry_state *sw_state = (software_entry_state *)state;
@@ -1942,9 +1942,9 @@ void ui_mess_menu_software_parts(running_machine *machine, ui_menu *menu, void *
}
/* populate a specific list */
-static void ui_mess_menu_populate_software_entries(running_machine *machine, ui_menu *menu, char *list_name, device_image_interface* image)
+static void ui_mess_menu_populate_software_entries(running_machine &machine, ui_menu *menu, char *list_name, device_image_interface* image)
{
- software_list *list = software_list_open(machine->options(), list_name, FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), list_name, FALSE, NULL);
const char *interface = image->image_config().image_interface();
if (list)
{
@@ -1983,7 +1983,7 @@ bool swinfo_has_multiple_parts(software_info *swinfo, const char *interface)
return (count > 1) ? TRUE : FALSE;
}
-void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
software_menu_state *sw_state = (software_menu_state *)state;
@@ -2003,13 +2003,13 @@ void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *p
{
device_image_interface *image = sw_state->image;
software_entry_state *entry = (software_entry_state *) event->itemref;
- software_list *tmp_list = software_list_open(machine->options(), sw_state->list_name, FALSE, NULL);
+ software_list *tmp_list = software_list_open(machine.options(), sw_state->list_name, FALSE, NULL);
software_info *tmp_info = software_list_find(tmp_list, entry->short_name, NULL);
// if the selected software has multiple parts that can be loaded, open the submenu
if (swinfo_has_multiple_parts(tmp_info, image->image_config().image_interface()))
{
- ui_menu *child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_mess_menu_software_parts, entry);
+ ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_parts, entry);
software_entry_state *child_menustate = (software_entry_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->short_name = entry->short_name;
child_menustate->interface = image->image_config().image_interface();
@@ -2030,12 +2030,12 @@ void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *p
}
/* list of available software lists - i.e. cartridges, floppies */
-static void ui_mess_menu_populate_software_list(running_machine *machine, ui_menu *menu, device_image_interface* image)
+static void ui_mess_menu_populate_software_list(running_machine &machine, ui_menu *menu, device_image_interface* image)
{
bool haveCompatible = FALSE;
const char *interface = image->image_config().image_interface();
- for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
@@ -2043,7 +2043,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
{
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM))
{
- software_list *list = software_list_open(machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -2065,7 +2065,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
}
}
- for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
@@ -2073,7 +2073,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
{
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM))
{
- software_list *list = software_list_open(machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -2101,7 +2101,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
}
-void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
device_image_interface* image = (device_image_interface*)parameter;
@@ -2113,7 +2113,7 @@ void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *param
if (event != NULL && event->iptkey == IPT_UI_SELECT)
{
- ui_menu *child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_mess_menu_software_list, NULL);
+ ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_list, NULL);
software_menu_state *child_menustate = (software_menu_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->list_name = (char *)event->itemref;
child_menustate->image = image;
diff --git a/src/emu/softlist.h b/src/emu/softlist.h
index 563d5426044..b5dd563ee73 100644
--- a/src/emu/softlist.h
+++ b/src/emu/softlist.h
@@ -71,7 +71,7 @@ const char *software_part_get_feature(software_part *part, const char *feature_n
bool load_software_part(device_image_interface *image, const char *path, software_info **sw_info, software_part **sw_part, char **full_sw_name);
-void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state);
/*********************************************************************
diff --git a/src/emu/sound.c b/src/emu/sound.c
index 2081f41c118..64ffa942bef 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -86,12 +86,12 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
m_attoseconds_per_sample(0),
m_max_samples_per_update(0),
m_inputs(inputs),
- m_input((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_input, inputs)),
- m_input_array((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_sample_t *, inputs)),
+ m_input((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_input, inputs)),
+ m_input_array((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_sample_t *, inputs)),
m_resample_bufalloc(0),
m_outputs(outputs),
- m_output((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_output, outputs)),
- m_output_array((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_sample_t *, outputs)),
+ m_output((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_output, outputs)),
+ m_output_array((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_sample_t *, outputs)),
m_output_bufalloc(0),
m_output_sampindex(0),
m_output_update_sampindex(0),
@@ -110,17 +110,17 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
// create a unique tag for saving
astring state_tag;
- state_tag.printf("%d", m_device.machine->sound().m_stream_list.count());
- m_device.machine->state().save_item("stream", state_tag, 0, NAME(m_sample_rate));
- m_device.machine->state().register_postload(state_postload_stub<sound_stream, &sound_stream::postload>, this);
+ state_tag.printf("%d", m_device.machine().sound().m_stream_list.count());
+ m_device.machine().state().save_item("stream", state_tag, 0, NAME(m_sample_rate));
+ m_device.machine().state().register_postload(state_postload_stub<sound_stream, &sound_stream::postload>, this);
// save the gain of each input and output
for (int inputnum = 0; inputnum < m_inputs; inputnum++)
- m_device.machine->state().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
+ m_device.machine().state().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
for (int outputnum = 0; outputnum < m_outputs; outputnum++)
{
m_output[outputnum].m_stream = this;
- m_device.machine->state().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
+ m_device.machine().state().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
}
// force an update to the sample rates; this will cause everything to be recomputed
@@ -139,7 +139,7 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
attotime sound_stream::sample_time() const
{
- return attotime(m_device.machine->sound().last_update().seconds, 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
+ return attotime(m_device.machine().sound().last_update().seconds, 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
}
@@ -258,11 +258,11 @@ void sound_stream::set_input(int index, sound_stream *input_stream, int output_i
void sound_stream::update()
{
// determine the number of samples since the start of this second
- attotime time = m_device.machine->time();
+ attotime time = m_device.machine().time();
INT32 update_sampindex = INT32(time.attoseconds / m_attoseconds_per_sample);
// if we're ahead of the last update, then adjust upwards
- attotime last_update = m_device.machine->sound().last_update();
+ attotime last_update = m_device.machine().sound().last_update();
if (time.seconds > last_update.seconds)
{
assert(time.seconds == last_update.seconds + 1);
@@ -439,7 +439,7 @@ STREAM_UPDATE( sound_stream::device_stream_update_stub )
void sound_stream::recompute_sample_rate_data()
{
// recompute the timing parameters
- attoseconds_t update_attoseconds = m_device.machine->sound().update_attoseconds();
+ attoseconds_t update_attoseconds = m_device.machine().sound().update_attoseconds();
m_attoseconds_per_sample = ATTOSECONDS_PER_SECOND / m_sample_rate;
m_max_samples_per_update = (update_attoseconds + m_attoseconds_per_sample - 1) / m_attoseconds_per_sample;
@@ -498,9 +498,9 @@ void sound_stream::allocate_resample_buffers()
for (int inputnum = 0; inputnum < m_inputs; inputnum++)
{
stream_input &input = m_input[inputnum];
- stream_sample_t *newbuffer = auto_alloc_array(m_device.machine, stream_sample_t, m_resample_bufalloc);
+ stream_sample_t *newbuffer = auto_alloc_array(m_device.machine(), stream_sample_t, m_resample_bufalloc);
memcpy(newbuffer, input.m_resample, oldsize * sizeof(stream_sample_t));
- auto_free(m_device.machine, input.m_resample);
+ auto_free(m_device.machine(), input.m_resample);
input.m_resample = newbuffer;
}
}
@@ -526,10 +526,10 @@ void sound_stream::allocate_output_buffers()
for (int outputnum = 0; outputnum < m_outputs; outputnum++)
{
stream_output &output = m_output[outputnum];
- stream_sample_t *newbuffer = auto_alloc_array(m_device.machine, stream_sample_t, m_output_bufalloc);
+ stream_sample_t *newbuffer = auto_alloc_array(m_device.machine(), stream_sample_t, m_output_bufalloc);
memcpy(newbuffer, output.m_buffer, oldsize * sizeof(stream_sample_t));
memset(newbuffer + oldsize, 0, (m_output_bufalloc - oldsize) * sizeof(stream_sample_t));
- auto_free(m_device.machine, output.m_buffer);
+ auto_free(m_device.machine(), output.m_buffer);
output.m_buffer = newbuffer;
}
}
@@ -550,7 +550,7 @@ void sound_stream::postload()
memset(m_output[outputnum].m_buffer, 0, m_output_bufalloc * sizeof(m_output[outputnum].m_buffer[0]));
// recompute the sample indexes to make sense
- m_output_sampindex = m_device.machine->sound().last_update().attoseconds / m_attoseconds_per_sample;
+ m_output_sampindex = m_device.machine().sound().last_update().attoseconds / m_attoseconds_per_sample;
m_output_update_sampindex = m_output_sampindex;
m_output_base_sampindex = m_output_sampindex - m_max_samples_per_update;
}
@@ -791,22 +791,22 @@ sound_manager::sound_manager(running_machine &machine)
VPRINTF(("total speakers = %d\n", machine.m_devicelist.count(SPEAKER)));
// allocate memory for mix buffers
- m_leftmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
- m_rightmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
- m_finalmix = auto_alloc_array(&machine, INT16, machine.sample_rate());
+ m_leftmix = auto_alloc_array(machine, INT32, machine.sample_rate());
+ m_rightmix = auto_alloc_array(machine, INT32, machine.sample_rate());
+ m_finalmix = auto_alloc_array(machine, INT16, machine.sample_rate());
// open the output WAV file if specified
if (wavfile[0] != 0)
m_wavfile = wav_open(wavfile, machine.sample_rate(), 2);
// register callbacks
- config_register(&machine, "mixer", &sound_manager::config_load, &sound_manager::config_save);
+ config_register(machine, "mixer", &sound_manager::config_load, &sound_manager::config_save);
machine.add_notifier(MACHINE_NOTIFY_PAUSE, &sound_manager::pause);
machine.add_notifier(MACHINE_NOTIFY_RESUME, &sound_manager::resume);
machine.add_notifier(MACHINE_NOTIFY_RESET, &sound_manager::reset);
// register global states
- state_save_register_global(&machine, m_last_update);
+ state_save_register_global(machine, m_last_update);
// set the starting attenuation
set_attenuation(machine.options().volume());
@@ -836,9 +836,9 @@ sound_manager::~sound_manager()
sound_stream *sound_manager::stream_alloc(device_t &device, int inputs, int outputs, int sample_rate, void *param, sound_stream::stream_update_func callback)
{
if (callback != NULL)
- return &m_stream_list.append(*auto_alloc(device.machine, sound_stream(device, inputs, outputs, sample_rate, param, callback)));
+ return &m_stream_list.append(*auto_alloc(device.machine(), sound_stream(device, inputs, outputs, sample_rate, param, callback)));
else
- return &m_stream_list.append(*auto_alloc(device.machine, sound_stream(device, inputs, outputs, sample_rate)));
+ return &m_stream_list.append(*auto_alloc(device.machine(), sound_stream(device, inputs, outputs, sample_rate)));
}
@@ -930,7 +930,7 @@ void sound_manager::resume(running_machine &machine)
// configuration file
//-------------------------------------------------
-void sound_manager::config_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+void sound_manager::config_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
// we only care about game files
if (config_type != CONFIG_TYPE_GAME)
@@ -944,7 +944,7 @@ void sound_manager::config_load(running_machine *machine, int config_type, xml_d
for (xml_data_node *channelnode = xml_get_sibling(parentnode->child, "channel"); channelnode != NULL; channelnode = xml_get_sibling(channelnode->next, "channel"))
{
speaker_input info;
- if (machine->sound().indexed_speaker_input(xml_get_attribute_int(channelnode, "index", -1), info))
+ if (machine.sound().indexed_speaker_input(xml_get_attribute_int(channelnode, "index", -1), info))
{
float defvol = xml_get_attribute_float(channelnode, "defvol", -1000.0);
float newvol = xml_get_attribute_float(channelnode, "newvol", -1000.0);
@@ -960,7 +960,7 @@ void sound_manager::config_load(running_machine *machine, int config_type, xml_d
// file
//-------------------------------------------------
-void sound_manager::config_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+void sound_manager::config_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
// we only care about game files
if (config_type != CONFIG_TYPE_GAME)
@@ -971,7 +971,7 @@ void sound_manager::config_save(running_machine *machine, int config_type, xml_d
for (int mixernum = 0; ; mixernum++)
{
speaker_input info;
- if (!machine->sound().indexed_speaker_input(mixernum, info))
+ if (!machine.sound().indexed_speaker_input(mixernum, info))
break;
float defvol = info.stream->initial_input_gain(info.inputnum);
float newvol = info.stream->input_gain(info.inputnum);
diff --git a/src/emu/sound.h b/src/emu/sound.h
index d8130e1aae5..10ac49ef987 100644
--- a/src/emu/sound.h
+++ b/src/emu/sound.h
@@ -244,8 +244,8 @@ private:
static void reset(running_machine &machine);
static void pause(running_machine &machine);
static void resume(running_machine &machine);
- static void config_load(running_machine *machine, int config_type, xml_data_node *parentnode);
- static void config_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+ static void config_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+ static void config_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static TIMER_CALLBACK( update_static ) { reinterpret_cast<sound_manager *>(ptr)->update(); }
void update();
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index 1531cf82c95..50155b780f6 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -56,12 +56,12 @@ static DEVICE_START( ym2151 )
rate = device->clock()/64;
/* stream setup */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
info->chip = ym2151_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM2151 chip");
- device->machine->state().register_postload(ym2151intf_postload, info);
+ device->machine().state().register_postload(ym2151intf_postload, info);
ym2151_set_irq_handler(info->chip,info->intf->irqhandler);
ym2151_set_port_write_handler(info->chip,info->intf->portwritehandler);
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index 1604af2a8cd..c9759e016b0 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -134,17 +134,17 @@ static DEVICE_START( ym2203 )
assert_always(info->psg != NULL, "Error creating YM2203/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2203_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2203_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update);
/* Initialize FM emurator */
info->chip = ym2203_init(info,device,device->clock(),rate,timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2203 chip");
- device->machine->state().register_postload(ym2203_intf_postload, info);
+ device->machine().state().register_postload(ym2203_intf_postload, info);
}
static DEVICE_STOP( ym2203 )
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index fc37220eb23..ab4c738a1dc 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -62,7 +62,7 @@ static DEVICE_START( ym2413 )
assert_always(info->chip != NULL, "Error creating YM2413 chip");
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update);
ym2413_set_update_handler(info->chip, _stream_update, info);
@@ -83,7 +83,7 @@ static DEVICE_START( ym2413 )
{
ym2413_reset (i);
- ym2413[i].DAC_stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update);
+ ym2413[i].DAC_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update);
if (ym2413[i].DAC_stream == -1)
return 1;
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index 9d54be5f90b..9d267f78489 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -152,11 +152,11 @@ static DEVICE_START( ym2608 )
assert_always(info->psg != NULL, "Error creating YM2608/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2608_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2608_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update);
/* setup adpcm buffers */
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
@@ -167,7 +167,7 @@ static DEVICE_START( ym2608 )
timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2608 chip");
- device->machine->state().register_postload(ym2608_intf_postload, info);
+ device->machine().state().register_postload(ym2608_intf_postload, info);
}
static DEVICE_STOP( ym2608 )
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index e59bf97d8f8..2572bc295c9 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -156,17 +156,17 @@ static DEVICE_START( ym2610 )
assert_always(info->psg != NULL, "Error creating YM2610/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
/* setup adpcm buffers */
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
name.printf("%s.deltat", device->tag());
- pcmbufb = (void *)(device->machine->region(name)->base());
- pcmsizeb = device->machine->region(name)->bytes();
+ pcmbufb = (void *)(device->machine().region(name)->base());
+ pcmsizeb = device->machine().region(name)->bytes();
if (pcmbufb == NULL || pcmsizeb == 0)
{
pcmbufb = pcmbufa;
@@ -179,7 +179,7 @@ static DEVICE_START( ym2610 )
timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2610 chip");
- device->machine->state().register_postload(ym2610_intf_postload, info);
+ device->machine().state().register_postload(ym2610_intf_postload, info);
}
static DEVICE_STOP( ym2610 )
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index 88ca4ae82fa..2311ad39a0e 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -108,17 +108,17 @@ static DEVICE_START( ym2612 )
/* FM init */
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2612_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2612_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update);
/**** initialize YM2612 ****/
info->chip = ym2612_init(info,device,device->clock(),rate,timer_handler,IRQHandler);
assert_always(info->chip != NULL, "Error creating YM2612 chip");
- device->machine->state().register_postload(ym2612_intf_postload, info);
+ device->machine().state().register_postload(ym2612_intf_postload, info);
}
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index eeaaf46f6c7..85b2853160f 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -88,15 +88,15 @@ static DEVICE_START( ymf262 )
info->chip = ymf262_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YMF262 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);
/* YMF262 setup */
ymf262_set_timer_handler (info->chip, timer_handler_262, info);
ymf262_set_irq_handler (info->chip, IRQHandler_262, info);
ymf262_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_1), info);
}
static DEVICE_STOP( ymf262 )
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index 0d4b67b0434..e97ec9069a1 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -99,14 +99,14 @@ static DEVICE_START( ym3526 )
info->chip = ym3526_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM3526 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3526_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym3526_stream_update);
/* YM3526 setup */
ym3526_set_timer_handler (info->chip, TimerHandler, info);
ym3526_set_irq_handler (info->chip, IRQHandler, info);
ym3526_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( ym3526 )
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index fd58c7b04e1..5379ae5ed63 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -99,15 +99,15 @@ static DEVICE_START( ym3812 )
info->chip = ym3812_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM3812 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3812_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym3812_stream_update);
/* YM3812 setup */
ym3812_set_timer_handler (info->chip, TimerHandler, info);
ym3812_set_irq_handler (info->chip, IRQHandler, info);
ym3812_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( ym3812 )
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index 19e02b73dc7..240f3e93bd5 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -129,7 +129,7 @@ static DEVICE_START( y8950 )
/* ADPCM ROM data */
y8950_set_delta_t_memory(info->chip, *device->region(), device->region()->bytes());
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,y8950_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,y8950_stream_update);
/* port and keyboard handler */
y8950_set_port_handler(info->chip, Y8950PortHandler_w, Y8950PortHandler_r, info);
y8950_set_keyboard_handler(info->chip, Y8950KeyboardHandler_w, Y8950KeyboardHandler_r, info);
@@ -139,8 +139,8 @@ static DEVICE_START( y8950 )
y8950_set_irq_handler (info->chip, IRQHandler, info);
y8950_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( y8950 )
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index ca10f73af89..9dd5dbbecd4 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -521,9 +521,9 @@ static void AICA_Init(device_t *device, aica_state *AICA, const aica_interface *
}
}
- AICA->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), AICA);
- AICA->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), AICA);
- AICA->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), AICA);
+ AICA->timerA = device->machine().scheduler().timer_alloc(FUNC(timerA_cb), AICA);
+ AICA->timerB = device->machine().scheduler().timer_alloc(FUNC(timerB_cb), AICA);
+ AICA->timerC = device->machine().scheduler().timer_alloc(FUNC(timerC_cb), AICA);
for(i=0;i<0x400;++i)
{
@@ -614,9 +614,9 @@ static void AICA_Init(device_t *device, aica_state *AICA, const aica_interface *
AICA->Slots[i].lpend=1;
}
- AICALFO_Init(device->machine);
- AICA->buffertmpl=auto_alloc_array_clear(device->machine, signed int, 44100);
- AICA->buffertmpr=auto_alloc_array_clear(device->machine, signed int, 44100);
+ AICALFO_Init(device->machine());
+ AICA->buffertmpl=auto_alloc_array_clear(device->machine(), signed int, 44100);
+ AICA->buffertmpr=auto_alloc_array_clear(device->machine(), signed int, 44100);
// no "pend"
AICA[0].udata.data[0xa0/2] = 0;
@@ -1283,7 +1283,7 @@ static DEVICE_START( aica )
{
AICA->IntARMCB = intf->irq_callback;
- AICA->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
+ AICA->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
}
}
diff --git a/src/emu/sound/aicalfo.c b/src/emu/sound/aicalfo.c
index d6b6436f9cd..f992ea29a2d 100644
--- a/src/emu/sound/aicalfo.c
+++ b/src/emu/sound/aicalfo.c
@@ -34,7 +34,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256];
static int ASCALES[8][256];
-static void AICALFO_Init(running_machine *machine)
+static void AICALFO_Init(running_machine &machine)
{
int i,s;
for(i=0;i<256;++i)
@@ -82,7 +82,7 @@ static void AICALFO_Init(running_machine *machine)
//noise
//a=lfo_noise[i];
- a=machine->rand()&0xff;
+ a=machine.rand()&0xff;
p=128-a;
ALFO_NOI[i]=a;
PLFO_NOI[i]=p;
diff --git a/src/emu/sound/asc.c b/src/emu/sound/asc.c
index 7440b1b885b..824c04a92c3 100644
--- a/src/emu/sound/asc.c
+++ b/src/emu/sound/asc.c
@@ -93,7 +93,7 @@ device_config *asc_device_config::static_alloc_device_config(const machine_confi
device_t *asc_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, asc_device(machine, *this));
+ return auto_alloc(machine, asc_device(machine, *this));
}
//**************************************************************************
@@ -133,7 +133,7 @@ void asc_device::device_start()
memset(m_regs, 0, sizeof(m_regs));
- m_sync_timer = this->machine->scheduler().timer_alloc(FUNC(sync_timer_cb), this);
+ m_sync_timer = this->machine().scheduler().timer_alloc(FUNC(sync_timer_cb), this);
save_item(NAME(m_fifo_a_rdptr));
save_item(NAME(m_fifo_b_rdptr));
diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c
index 4547172cc8c..3ae7112fb7a 100644
--- a/src/emu/sound/astrocde.c
+++ b/src/emu/sound/astrocde.c
@@ -271,7 +271,7 @@ static DEVICE_START( astrocade )
chip->bitswap[i] = BITSWAP8(i, 0,1,2,3,4,5,6,7);
/* allocate a stream for output */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, astrocade_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), chip, astrocade_update);
/* reset state */
DEVICE_RESET_CALL(astrocade);
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index 3ff68bcc46f..f9f57e326b9 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -738,7 +738,7 @@ void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, in
ay8910_context *info = (ay8910_context *)infoptr;
if (info == NULL)
- info = auto_alloc_clear(device->machine, ay8910_context);
+ info = auto_alloc_clear(device->machine(), ay8910_context);
info->device = device;
info->intf = intf;
@@ -775,7 +775,7 @@ void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, in
/* The envelope is pacing twice as fast for the YM2149 as for the AY-3-8910, */
/* This handled by the step parameter. Consequently we use a divider of 8 here. */
- info->channel = device->machine->sound().stream_alloc(*device, 0, info->streams, device->clock() / 8, info, ay8910_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, info->streams, device->clock() / 8, info, ay8910_update);
ay8910_set_clock_ym(info,device->clock());
ay8910_statesave(info, device);
@@ -887,7 +887,7 @@ 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",psg->device->machine->describe_context(),psg->device->tag());
+ logerror("%s: warning - read 8910 '%s' Port A\n",psg->device->machine().describe_context(),psg->device->tag());
break;
case AY_PORTB:
if ((psg->regs[AY_ENABLE] & 0x80) != 0)
@@ -895,7 +895,7 @@ int ay8910_read_ym(void *chip)
if (psg->portBread.read)
psg->regs[AY_PORTB] = devcb_call_read8(&psg->portBread, 0);
else
- logerror("%s: warning - read 8910 '%s' Port B\n",psg->device->machine->describe_context(),psg->device->tag());
+ logerror("%s: warning - read 8910 '%s' Port B\n",psg->device->machine().describe_context(),psg->device->tag());
break;
}
diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c
index 0c0fe947f9e..fc5f9d5e124 100644
--- a/src/emu/sound/beep.c
+++ b/src/emu/sound/beep.c
@@ -92,7 +92,7 @@ static DEVICE_START( beep )
{
beep_state *pBeep = get_safe_token(device);
- pBeep->stream = device->machine->sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
+ pBeep->stream = device->machine().sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
pBeep->enable = 0;
pBeep->frequency = 3250;
pBeep->incr = 0;
diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c
index d2781fef5b1..523836045f4 100644
--- a/src/emu/sound/bsmt2000.c
+++ b/src/emu/sound/bsmt2000.c
@@ -134,7 +134,7 @@ device_config *bsmt2000_device_config::static_alloc_device_config(const machine_
device_t *bsmt2000_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, bsmt2000_device(machine, *this));
+ return auto_alloc(machine, bsmt2000_device(machine, *this));
}
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index f87c8d22b8c..cc5e5deeab9 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -470,7 +470,7 @@ static DEVICE_START( c140 )
info->banking_type = intf->banking_type;
- info->stream = device->machine->sound().stream_alloc(*device,0,2,info->sample_rate,info,update_stereo);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,info->sample_rate,info,update_stereo);
info->pRom=*device->region();
@@ -492,7 +492,7 @@ static DEVICE_START( c140 )
}
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer_left = auto_alloc_array(device->machine, INT16, 2 * info->sample_rate);
+ info->mixer_buffer_left = auto_alloc_array(device->machine(), INT16, 2 * info->sample_rate);
info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate;
}
diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c
index 93e38fd841b..4bb73edcb73 100644
--- a/src/emu/sound/c352.c
+++ b/src/emu/sound/c352.c
@@ -545,7 +545,7 @@ static DEVICE_START( c352 )
info->sample_rate_base = device->clock() / 192;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 4, info->sample_rate_base, info, c352_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 4, info->sample_rate_base, info, c352_update);
c352_init(info, device);
}
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index 0412d014dab..64a9a0dda10 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -26,7 +26,7 @@
game will reset the index prior to playback so this isn't an issue.
- While the noise emulation is complete, the data for the pseudo-random
- bitstream is calculated by machine->rand() and is not a representation of what
+ bitstream is calculated by machine.rand() and is not a representation of what
the actual hardware does.
For some background on Hudson Soft's C62 chipset:
@@ -107,7 +107,7 @@ static void c6280_init(device_t *device, c6280_t *p, double clk, double rate)
memset(p, 0, sizeof(c6280_t));
p->device = device;
- p->cpudevice = device->machine->device(intf->cpu);
+ p->cpudevice = device->machine().device(intf->cpu);
if (p->cpudevice == NULL)
fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag());
@@ -277,7 +277,7 @@ static STREAM_UPDATE( c6280_update )
p->channel[ch].noise_counter += step;
if(p->channel[ch].noise_counter >= 0x800)
{
- data = (p->device->machine->rand() & 1) ? 0x1F : 0;
+ data = (p->device->machine().rand() & 1) ? 0x1F : 0;
}
p->channel[ch].noise_counter &= 0x7FF;
outputs[0][i] += (INT16)(vll * (data - 16));
@@ -328,7 +328,7 @@ static DEVICE_START( c6280 )
c6280_init(device, info, device->clock(), rate);
/* Create stereo stream */
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, rate, info, c6280_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, rate, info, c6280_update);
}
READ8_DEVICE_HANDLER( c6280_r )
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c
index 71d02515f7d..fdf102b050b 100644
--- a/src/emu/sound/cdda.c
+++ b/src/emu/sound/cdda.c
@@ -54,11 +54,11 @@ static DEVICE_START( cdda )
cdda_info *info = get_safe_token(device);
/* allocate an audio cache */
- info->audio_cache = auto_alloc_array( device->machine, UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS );
+ info->audio_cache = auto_alloc_array( device->machine(), UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS );
//intf = (const struct CDDAinterface *)device->baseconfig().static_config();
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, cdda_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, cdda_update);
device->save_item( NAME(info->audio_playing) );
device->save_item( NAME(info->audio_pause) );
@@ -88,11 +88,11 @@ void cdda_set_cdrom(device_t *device, void *file)
that references the given CD-ROM file
-------------------------------------------------*/
-device_t *cdda_from_cdrom(running_machine *machine, void *file)
+device_t *cdda_from_cdrom(running_machine &machine, void *file)
{
device_sound_interface *sound = NULL;
- for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == CDDA)
{
cdda_info *info = get_safe_token(*sound);
diff --git a/src/emu/sound/cdda.h b/src/emu/sound/cdda.h
index 3db1830e9af..0c9c605978b 100644
--- a/src/emu/sound/cdda.h
+++ b/src/emu/sound/cdda.h
@@ -6,7 +6,7 @@
#include "devlegcy.h"
void cdda_set_cdrom(device_t *device, void *file);
-device_t *cdda_from_cdrom(running_machine *machine, void *file);
+device_t *cdda_from_cdrom(running_machine &machine, void *file);
void cdda_start_audio(device_t *device, UINT32 startlba, UINT32 numblocks);
void cdda_stop_audio(device_t *device);
diff --git a/src/emu/sound/cdp1863.c b/src/emu/sound/cdp1863.c
index 29c9dac9a19..64349b5193f 100644
--- a/src/emu/sound/cdp1863.c
+++ b/src/emu/sound/cdp1863.c
@@ -123,7 +123,7 @@ static STREAM_UPDATE( cdp1863_stream_update )
if (cdp1863->oe)
{
double frequency;
- int rate = device->machine->sample_rate() / 2;
+ int rate = device->machine().sample_rate() / 2;
/* get progress through wave */
int incr = cdp1863->incr;
@@ -175,7 +175,7 @@ static DEVICE_START( cdp1863 )
const cdp1863_config *config = get_safe_config(device);
/* set initial values */
- cdp1863->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1863, cdp1863_stream_update);
+ cdp1863->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), cdp1863, cdp1863_stream_update);
cdp1863->clock1 = device->clock();
cdp1863->clock2 = config->clock2;
cdp1863->oe = 1;
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c
index 52fcb51368f..da02f4f8f50 100644
--- a/src/emu/sound/cdp1864.c
+++ b/src/emu/sound/cdp1864.c
@@ -176,7 +176,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
- cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT));
+ cdp1864->dma_timer->adjust(machine.firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT));
cdp1864->dmaout = 0;
}
@@ -190,7 +190,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
- cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE));
+ cdp1864->dma_timer->adjust(machine.firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE));
cdp1864->dmaout = 1;
}
@@ -226,7 +226,7 @@ static void cdp1864_init_palette(device_t *device, const cdp1864_interface *intf
g = (i & 1) ? luma : 0;
b = (i & 2) ? luma : 0;
- palette_set_color_rgb( device->machine, i, r, g, b );
+ palette_set_color_rgb( device->machine(), i, r, g, b );
}
}
@@ -364,7 +364,7 @@ static STREAM_UPDATE( cdp1864_stream_update )
if (cdp1864->aoe)
{
double frequency = cdp1864->cpu->unscaled_clock() / 8 / 4 / (cdp1864->latch + 1) / 2;
- int rate = device->machine->sample_rate() / 2;
+ int rate = device->machine().sample_rate() / 2;
/* get progress through wave */
int incr = cdp1864->incr;
@@ -410,7 +410,7 @@ void cdp1864_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprec
}
else
{
- bitmap_fill(bitmap, cliprect, get_black_pen(device->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(device->machine()));
}
}
@@ -432,26 +432,26 @@ static DEVICE_START( cdp1864 )
devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device);
/* get the cpu */
- cdp1864->cpu = device->machine->device(intf->cpu_tag);
+ cdp1864->cpu = device->machine().device(intf->cpu_tag);
/* get the screen device */
- cdp1864->screen = downcast<screen_device *>(device->machine->device(intf->screen_tag));
+ cdp1864->screen = downcast<screen_device *>(device->machine().device(intf->screen_tag));
assert(cdp1864->screen != NULL);
/* allocate the temporary bitmap */
- cdp1864->bitmap = auto_bitmap_alloc(device->machine, cdp1864->screen->width(), cdp1864->screen->height(), cdp1864->screen->format());
+ cdp1864->bitmap = auto_bitmap_alloc(device->machine(), cdp1864->screen->width(), cdp1864->screen->height(), cdp1864->screen->format());
bitmap_fill(cdp1864->bitmap, 0, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8);
/* initialize the palette */
cdp1864_init_palette(device, intf);
/* create sound stream */
- cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1864, cdp1864_stream_update);
+ cdp1864->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), cdp1864, cdp1864_stream_update);
/* create the timers */
- cdp1864->int_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device);
- cdp1864->efx_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_efx_tick), (void *)device);
- cdp1864->dma_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_dma_tick), (void *)device);
+ cdp1864->int_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device);
+ cdp1864->efx_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_efx_tick), (void *)device);
+ cdp1864->dma_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_dma_tick), (void *)device);
/* register for state saving */
device->save_item(NAME(cdp1864->disp));
@@ -477,7 +477,7 @@ static DEVICE_RESET( cdp1864 )
cdp1864->int_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START));
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START));
- cdp1864->dma_timer->adjust(device->machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START));
+ cdp1864->dma_timer->adjust(device->machine().firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START));
cdp1864->disp = 0;
cdp1864->dmaout = 0;
diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c
index cd3952d6604..f003bed0791 100644
--- a/src/emu/sound/cdp1869.c
+++ b/src/emu/sound/cdp1869.c
@@ -101,7 +101,7 @@ device_config *cdp1869_device_config::static_alloc_device_config(const machine_c
device_t *cdp1869_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cdp1869_device(machine, *this));
+ return auto_alloc(machine, cdp1869_device(machine, *this));
}
@@ -496,7 +496,7 @@ void cdp1869_device::initialize_palette()
for (i = 0; i < 8; i++)
{
- palette_set_color(machine, i, get_rgb(i, i, 15));
+ palette_set_color(m_machine, i, get_rgb(i, i, 15));
}
// tone-on-tone display (CFC=1)
@@ -504,7 +504,7 @@ void cdp1869_device::initialize_palette()
{
for (int l = 0; l < 8; l++)
{
- palette_set_color(machine, i, get_rgb(i, c, l));
+ palette_set_color(m_machine, i, get_rgb(i, c, l));
i++;
}
}
diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c
index e703910374c..b15c2887312 100644
--- a/src/emu/sound/cem3394.c
+++ b/src/emu/sound/cem3394.c
@@ -334,14 +334,14 @@ static DEVICE_START( cem3394 )
chip->inv_sample_rate = 1.0 / (double)chip->sample_rate;
/* allocate stream channels, 1 per chip */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, cem3394_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, cem3394_update);
chip->external = intf->external;
chip->vco_zero_freq = intf->vco_zero_freq;
chip->filter_zero_freq = intf->filter_zero_freq;
/* allocate memory for a mixer buffer and external buffer (1 second should do it!) */
- chip->mixer_buffer = auto_alloc_array(device->machine, INT16, chip->sample_rate);
- chip->external_buffer = auto_alloc_array(device->machine, INT16, chip->sample_rate);
+ chip->mixer_buffer = auto_alloc_array(device->machine(), INT16, chip->sample_rate);
+ chip->external_buffer = auto_alloc_array(device->machine(), INT16, chip->sample_rate);
device->save_item(NAME(chip->values));
device->save_item(NAME(chip->wave_select));
diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c
index 4a600718d16..57b5171cc22 100644
--- a/src/emu/sound/dac.c
+++ b/src/emu/sound/dac.c
@@ -110,7 +110,7 @@ static DEVICE_START( dac )
DAC_build_voltable(info);
- info->channel = device->machine->sound().stream_alloc(*device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
+ info->channel = device->machine().sound().stream_alloc(*device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
info->output = 0;
device->save_item(NAME(info->output));
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index 5fbb1cbf5f0..48410c38df7 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -648,8 +648,8 @@ static DEVICE_START(digitalker)
{
digitalker *dg = get_safe_token(device);
dg->device = device;
- dg->rom = device->machine->region(device->tag())->base();
- dg->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
+ dg->rom = device->machine().region(device->tag())->base();
+ dg->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
dg->dac_index = 128;
dg->data = 0xff;
dg->cs = dg->cms = dg->wr = 1;
diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c
index 53331138932..d2e09bcd7e0 100644
--- a/src/emu/sound/disc_inp.c
+++ b/src/emu/sound/disc_inp.c
@@ -23,14 +23,14 @@
READ8_DEVICE_HANDLER(discrete_sound_r)
{
discrete_device *disc_device = downcast<discrete_device *>(device);
- return disc_device->read( *disc_device->machine->firstcpu->space(), offset, 0xff);
+ return disc_device->read( *disc_device->machine().firstcpu->space(), offset, 0xff);
}
WRITE8_DEVICE_HANDLER(discrete_sound_w)
{
discrete_device *disc_device = downcast<discrete_device *>(device);
- disc_device->write(*disc_device->machine->firstcpu->space(), offset, data, 0xff);
+ disc_device->write(*disc_device->machine().firstcpu->space(), offset, data, 0xff);
}
/************************************************************************
@@ -75,7 +75,7 @@ DISCRETE_RESET(dss_adjustment)
{
double min, max;
- m_port = m_device->machine->m_portlist.find((const char *)this->custom_data());
+ m_port = m_device->machine().m_portlist.find((const char *)this->custom_data());
if (m_port == NULL)
fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag", this->index());
@@ -334,7 +334,7 @@ void DISCRETE_CLASS_NAME(dss_input_stream)::stream_start(void)
discrete_sound_device *snd_device = downcast<discrete_sound_device *>(m_device);
//assert(DSS_INPUT_STREAM__STREAM < snd_device->m_input_stream_list.count());
- m_buffer_stream = m_device->machine->sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
+ m_buffer_stream = m_device->machine().sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
snd_device->get_stream()->set_input(m_stream_in_number, m_buffer_stream);
}
diff --git a/src/emu/sound/disc_wav.c b/src/emu/sound/disc_wav.c
index c3d46dad81e..1e4109d52ff 100644
--- a/src/emu/sound/disc_wav.c
+++ b/src/emu/sound/disc_wav.c
@@ -452,7 +452,7 @@ DISCRETE_STEP(dss_noise)
if(m_phase > (2.0 * M_PI))
{
/* GCC's rand returns a RAND_MAX value of 0x7fff */
- int newval = (m_device->machine->rand() & 0x7fff) - 16384;
+ int newval = (m_device->machine().rand() & 0x7fff) - 16384;
/* make sure the peak to peak values are the amplitude */
v_out = DSS_NOISE__AMP / 2;
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 75b5671db11..b2bb8036238 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -314,7 +314,7 @@ void discrete_task::check(discrete_task *dest_task)
{
output_buffer buf;
- buf.node_buf = auto_alloc_array(m_device.machine, double,
+ buf.node_buf = auto_alloc_array(m_device.machine(), double,
((task_node->sample_rate() + sound_manager::STREAMS_UPDATE_FREQUENCY) / sound_manager::STREAMS_UPDATE_FREQUENCY));
buf.ptr = buf.node_buf;
buf.source = dest_node->m_input[inputnum];
@@ -326,7 +326,7 @@ void discrete_task::check(discrete_task *dest_task)
m_device.discrete_log("dso_task_start - buffering %d(%d) in task %p group %d referenced by %d group %d", NODE_INDEX(inputnode_num), NODE_CHILD_NODE_NUM(inputnode_num), this, task_group, dest_node->index(), dest_task->task_group);
/* register into source list */
- //source = auto_alloc(device->machine, discrete_source_node);
+ //source = auto_alloc(device->machine(), discrete_source_node);
//source.task = this;
//source.output_node = i;
source.linked_outbuf = pbuf;
@@ -688,7 +688,7 @@ void discrete_device::init_nodes(const sound_block_list_t &block_list)
/* make sure we have one simple task
* No need to create a node since there are no dependencies.
*/
- task = auto_alloc_clear(machine, discrete_task(*this));
+ task = auto_alloc_clear(m_machine, discrete_task(*this));
task_list.add(task);
}
@@ -722,7 +722,7 @@ void discrete_device::init_nodes(const sound_block_list_t &block_list)
{
if (task != NULL)
fatalerror("init_nodes() - Nested DISCRETE_START_TASK.");
- task = auto_alloc_clear(machine, discrete_task(*this));
+ task = auto_alloc_clear(m_machine, discrete_task(*this));
task->task_group = block->initial[0];
if (task->task_group < 0 || task->task_group >= DISCRETE_MAX_TASK_GROUPS)
fatalerror("discrete_dso_task: illegal task_group %d", task->task_group);
@@ -861,12 +861,12 @@ device_config *discrete_sound_device_config::static_alloc_device_config(const ma
device_t *discrete_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, discrete_device(machine, *this));
+ return auto_alloc(machine, discrete_device(machine, *this));
}
device_t *discrete_sound_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, discrete_sound_device(machine, *this));
+ return auto_alloc(machine, discrete_sound_device(machine, *this));
}
@@ -930,7 +930,7 @@ void discrete_device::device_start()
if (this->clock())
m_sample_rate = this->clock();
else
- m_sample_rate = this->machine->sample_rate();
+ m_sample_rate = this->machine().sample_rate();
m_sample_time = 1.0 / m_sample_rate;
m_neg_sample_time = - m_sample_time;
@@ -958,7 +958,7 @@ void discrete_device::device_start()
m_node_list.clear();
/* allocate memory to hold pointers to nodes by index */
- m_indexed_node = auto_alloc_array_clear(this->machine, discrete_base_node *, DISCRETE_MAX_NODES);
+ m_indexed_node = auto_alloc_array_clear(this->machine(), discrete_base_node *, DISCRETE_MAX_NODES);
/* initialize the node data */
init_nodes(block_list);
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index 9174c9753a9..731bdef93e9 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -4563,7 +4563,7 @@ class discrete_node_factory : public discrete_node_base_factory
template <class C>
discrete_base_node * discrete_node_factory<C>::Create(discrete_device * pdev, const discrete_block *block)
{
- discrete_base_node *r = auto_alloc_clear(pdev->machine, C);
+ discrete_base_node *r = auto_alloc_clear(pdev->machine(), C);
r->init(pdev, block);
return r;
diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c
index 470604834e2..9a8d6613235 100644
--- a/src/emu/sound/dmadac.c
+++ b/src/emu/sound/dmadac.c
@@ -106,13 +106,13 @@ static DEVICE_START( dmadac )
dmadac_state *info = get_safe_token(device);
/* allocate a clear a buffer */
- info->buffer = auto_alloc_array_clear(device->machine, INT16, BUFFER_SIZE);
+ info->buffer = auto_alloc_array_clear(device->machine(), INT16, BUFFER_SIZE);
/* reset the state */
info->volume = 0x100;
/* allocate a stream channel */
- info->channel = device->machine->sound().stream_alloc(*device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
/* register with the save state system */
device->save_item(NAME(info->bufin));
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index f0e4f58a028..23fc862b099 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -259,14 +259,14 @@ static DEVICE_START( es5503 )
chip->oscillators[osc].irqpend = 0;
chip->oscillators[osc].accumulator = 0;
- chip->oscillators[osc].timer = device->machine->scheduler().timer_alloc(FUNC(es5503_timer_cb), &chip->oscillators[osc]);
+ chip->oscillators[osc].timer = device->machine().scheduler().timer_alloc(FUNC(es5503_timer_cb), &chip->oscillators[osc]);
chip->oscillators[osc].chip = (void *)chip;
}
chip->oscsenabled = 1;
chip->output_rate = (device->clock()/8)/34; // (input clock / 8) / # of oscs. enabled + 2
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
}
READ8_DEVICE_HANDLER( es5503_r )
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index f6e8572fbd2..2f25bd7ead4 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -261,7 +261,7 @@ static void compute_tables(es5506_state *chip)
int i;
/* allocate ulaw lookup table */
- chip->ulaw_lookup = auto_alloc_array(chip->device->machine, INT16, 1 << ULAW_MAXBITS);
+ chip->ulaw_lookup = auto_alloc_array(chip->device->machine(), INT16, 1 << ULAW_MAXBITS);
/* generate ulaw lookup table */
for (i = 0; i < (1 << ULAW_MAXBITS); i++)
@@ -280,7 +280,7 @@ static void compute_tables(es5506_state *chip)
}
/* allocate volume lookup table */
- chip->volume_lookup = auto_alloc_array(chip->device->machine, UINT16, 4096);
+ chip->volume_lookup = auto_alloc_array(chip->device->machine(), UINT16, 4096);
/* generate volume lookup table */
for (i = 0; i < 4096; i++)
@@ -910,13 +910,13 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
eslog = fopen("es.log", "w");
/* create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
/* initialize the regions */
- chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine->region(intf->region0)->base() : NULL;
- chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine->region(intf->region1)->base() : NULL;
- chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine->region(intf->region2)->base() : NULL;
- chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine->region(intf->region3)->base() : NULL;
+ chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine().region(intf->region0)->base() : NULL;
+ chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine().region(intf->region1)->base() : NULL;
+ chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine().region(intf->region2)->base() : NULL;
+ chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine().region(intf->region3)->base() : NULL;
/* initialize the rest of the structure */
chip->device = device;
@@ -940,7 +940,7 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
}
/* allocate memory */
- chip->scratch = auto_alloc_array(device->machine, INT32, 2 * MAX_SAMPLE_CHUNK);
+ chip->scratch = auto_alloc_array(device->machine(), INT32, 2 * MAX_SAMPLE_CHUNK);
/* register save */
device->save_item(NAME(chip->sample_rate));
@@ -1596,7 +1596,7 @@ static DEVICE_RESET( es5505 )
INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- running_machine *machine = chip->device->machine;
+ running_machine &machine = chip->device->machine();
switch (offset)
{
@@ -1619,7 +1619,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
}
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
+ fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
break;
case 0x01: /* FC */
@@ -1628,7 +1628,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->freqcount);
+ fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->freqcount);
break;
case 0x02: /* STRT (hi) */
@@ -1637,7 +1637,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
+ fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x03: /* STRT (lo) */
@@ -1646,7 +1646,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
+ fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x04: /* END (hi) */
@@ -1658,7 +1658,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
+ fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x05: /* END (lo) */
@@ -1670,7 +1670,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
+ fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x06: /* K2 */
@@ -1679,7 +1679,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, K2=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k2);
+ fprintf(eslog, "%s:voice %d, K2=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->k2);
break;
case 0x07: /* K1 */
@@ -1688,21 +1688,21 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, K1=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k1);
+ fprintf(eslog, "%s:voice %d, K1=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->k1);
break;
case 0x08: /* LVOL */
if (ACCESSING_BITS_8_15)
voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->lvol);
+ fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->lvol);
break;
case 0x09: /* RVOL */
if (ACCESSING_BITS_8_15)
voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->rvol);
+ fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->rvol);
break;
case 0x0a: /* ACC (hi) */
@@ -1711,7 +1711,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
+ fprintf(eslog, "%s:voice %d, accum=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0b: /* ACC (lo) */
@@ -1720,7 +1720,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
+ fprintf(eslog, "%s:voice %d, accum=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0c: /* unused */
@@ -1751,7 +1751,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- running_machine *machine = chip->device->machine;
+ running_machine &machine = chip->device->machine();
switch (offset)
{
@@ -1769,7 +1769,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
((data << 2) & (CONTROL_CA0 | CONTROL_CA1));
}
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask);
+ fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask);
break;
case 0x01: /* O4(n-1) */
@@ -1778,7 +1778,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
break;
case 0x02: /* O3(n-1) */
@@ -1787,7 +1787,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
break;
case 0x03: /* O3(n-2) */
@@ -1796,7 +1796,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
break;
case 0x04: /* O2(n-1) */
@@ -1805,7 +1805,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
break;
case 0x05: /* O2(n-2) */
@@ -1814,7 +1814,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
break;
case 0x06: /* O1(n-1) */
@@ -1823,7 +1823,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
+ fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
break;
case 0x07:
@@ -1906,7 +1906,7 @@ WRITE16_DEVICE_HANDLER( es5505_w )
es5506_state *chip = get_safe_token(device);
es5506_voice *voice = &chip->voice[chip->current_page & 0x1f];
-// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine->describe_context(), chip->current_page, offset, data, mem_mask);
+// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine.describe_context(), chip->current_page, offset, data, mem_mask);
/* force an update */
chip->stream->update();
diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c
index 4615b5dc026..8cae3700798 100644
--- a/src/emu/sound/es8712.c
+++ b/src/emu/sound/es8712.c
@@ -227,7 +227,7 @@ static DEVICE_START( es8712 )
chip->region_base = *device->region();
/* generate the name and create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, es8712_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), chip, es8712_update);
/* initialize the rest of the structure */
chip->signal = -2;
diff --git a/src/emu/sound/filter.c b/src/emu/sound/filter.c
index 5aa7582fdad..43acebde248 100644
--- a/src/emu/sound/filter.c
+++ b/src/emu/sound/filter.c
@@ -134,7 +134,7 @@ filter* filter_lp_fir_alloc(double freq, int order) {
void filter2_setup(device_t *device, int type, double fc, double d, double gain,
filter2_context *filter2)
{
- int sample_rate = device->machine->sample_rate();
+ int sample_rate = device->machine().sample_rate();
double w; /* cutoff freq, in radians/sec */
double w_squared;
double den; /* temp variable */
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index 9f004c08cbc..ab831c234ed 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -83,7 +83,7 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d
/* Cut Frequency = 1/(2*Pi*Req*C) */
/* k = (1-(EXP(-TIMEDELTA/RC))) */
- info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine->sample_rate()));
+ info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine().sample_rate()));
}
@@ -93,7 +93,7 @@ static DEVICE_START( filter_rc )
const flt_rc_config *conf = (const flt_rc_config *)device->baseconfig().static_config();
info->device = device;
- info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_rc_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_rc_update);
if (conf)
set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C);
else
diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c
index 2e057223f8e..27b354be948 100644
--- a/src/emu/sound/flt_vol.c
+++ b/src/emu/sound/flt_vol.c
@@ -34,7 +34,7 @@ static DEVICE_START( filter_volume )
filter_volume_state *info = get_safe_token(device);
info->gain = 0x100;
- info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_volume_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_volume_update);
}
diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c
index 256a6a595a8..8027883618c 100644
--- a/src/emu/sound/fm.c
+++ b/src/emu/sound/fm.c
@@ -841,7 +841,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
{
if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 )
{
- if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(ST->device->machine)) > 0)
+ if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(&ST->device->machine())) > 0)
return ST->status | 0x80; /* with busy */
/* expire */
FM_BUSY_CLEAR(ST);
@@ -851,7 +851,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock )
{
TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler);
- ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(ST->device->machine), expiry_period);
+ ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period);
}
#else
#define FM_STATUS_FLAG(ST) ((ST)->status)
@@ -2264,11 +2264,11 @@ void * ym2203_init(void *param, device_t *device, int clock, int rate,
YM2203 *F2203;
/* allocate ym2203 state space */
- F2203 = auto_alloc_clear(device->machine, YM2203);
+ F2203 = auto_alloc_clear(device->machine(), YM2203);
if( !init_tables() )
{
- auto_free( device->machine, F2203 );
+ auto_free( device->machine(), F2203 );
return NULL;
}
@@ -2295,7 +2295,7 @@ void ym2203_shutdown(void *chip)
YM2203 *FM2203 = (YM2203 *)chip;
FMCloseTable();
- auto_free(FM2203->OPN.ST.device->machine, FM2203);
+ auto_free(FM2203->OPN.ST.device->machine(), FM2203);
}
/* YM2203 I/O interface */
@@ -3487,11 +3487,11 @@ void * ym2608_init(void *param, device_t *device, int clock, int rate,
YM2608 *F2608;
/* allocate extend state space */
- F2608 = auto_alloc_clear(device->machine, YM2608);
+ F2608 = auto_alloc_clear(device->machine(), YM2608);
/* allocate total level table (128kb space) */
if( !init_tables() )
{
- auto_free( device->machine, F2608 );
+ auto_free( device->machine(), F2608 );
return NULL;
}
@@ -3539,7 +3539,7 @@ void ym2608_shutdown(void *chip)
YM2608 *F2608 = (YM2608 *)chip;
FMCloseTable();
- auto_free(F2608->OPN.ST.device->machine, F2608);
+ auto_free(F2608->OPN.ST.device->machine(), F2608);
}
/* reset one of chips */
@@ -4170,11 +4170,11 @@ void *ym2610_init(void *param, device_t *device, int clock, int rate,
YM2610 *F2610;
/* allocate extend state space */
- F2610 = auto_alloc_clear(device->machine, YM2610);
+ F2610 = auto_alloc_clear(device->machine(), YM2610);
/* allocate total level table (128kb space) */
if( !init_tables() )
{
- auto_free( device->machine, F2610 );
+ auto_free( device->machine(), F2610 );
return NULL;
}
@@ -4214,7 +4214,7 @@ void ym2610_shutdown(void *chip)
YM2610 *F2610 = (YM2610 *)chip;
FMCloseTable();
- auto_free(F2610->OPN.ST.device->machine, F2610);
+ auto_free(F2610->OPN.ST.device->machine(), F2610);
}
/* reset one of chip */
@@ -4230,17 +4230,17 @@ void ym2610_reset_chip(void *chip)
/* setup PCM buffers again */
name.printf("%s",dev->tag());
- F2610->pcmbuf = (const UINT8 *)dev->machine->region(name)->base();
- F2610->pcm_size = dev->machine->region(name)->bytes();
+ F2610->pcmbuf = (const UINT8 *)dev->machine().region(name)->base();
+ F2610->pcm_size = dev->machine().region(name)->bytes();
name.printf("%s.deltat",dev->tag());
- F2610->deltaT.memory = (UINT8 *)dev->machine->region(name)->base();
+ F2610->deltaT.memory = (UINT8 *)dev->machine().region(name)->base();
if(F2610->deltaT.memory == NULL)
{
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
F2610->deltaT.memory_size = F2610->pcm_size;
}
else
- F2610->deltaT.memory_size = dev->machine->region(name)->bytes();
+ F2610->deltaT.memory_size = dev->machine().region(name)->bytes();
/* Reset Prescaler */
OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */
diff --git a/src/emu/sound/fm.h b/src/emu/sound/fm.h
index 6a195006fc0..120ca9bdea8 100644
--- a/src/emu/sound/fm.h
+++ b/src/emu/sound/fm.h
@@ -42,7 +42,7 @@ struct _ssg_callbacks
#if FM_BUSY_FLAG_SUPPORT
#define TIME_TYPE attotime
#define UNDEFINED_TIME attotime::zero
-#define FM_GET_TIME_NOW(machine) machine->time()
+#define FM_GET_TIME_NOW(machine) (machine)->time()
#define ADD_TIMES(t1, t2) ((t1) + (t2))
#define COMPARE_TIMES(t1, t2) (((t1) == (t2)) ? 0 : ((t1) < (t2)) ? -1 : 1)
#define MULTIPLY_TIME_BY_INT(t,i) ((t) * (i))
diff --git a/src/emu/sound/fm2612.c b/src/emu/sound/fm2612.c
index 7a22e09dcc9..b8002cf1a29 100644
--- a/src/emu/sound/fm2612.c
+++ b/src/emu/sound/fm2612.c
@@ -1004,7 +1004,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
{
if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 )
{
- if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(ST->device->machine)) > 0)
+ if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(&ST->device->machine())) > 0)
return ST->status | 0x80; /* with busy */
/* expire */
FM_BUSY_CLEAR(ST);
@@ -1014,7 +1014,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock )
{
TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler);
- ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(ST->device->machine), expiry_period);
+ ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period);
}
#else
#define FM_STATUS_FLAG(ST) ((ST)->status)
@@ -2369,7 +2369,7 @@ void * ym2612_init(void *param, device_t *device, int clock, int rate,
YM2612 *F2612;
/* allocate extend state space */
- F2612 = auto_alloc_clear(device->machine, YM2612);
+ F2612 = auto_alloc_clear(device->machine(), YM2612);
/* allocate total level table (128kb space) */
init_tables();
@@ -2397,7 +2397,7 @@ void ym2612_shutdown(void *chip)
YM2612 *F2612 = (YM2612 *)chip;
FMCloseTable();
- auto_free(F2612->OPN.ST.device->machine, F2612);
+ auto_free(F2612->OPN.ST.device->machine(), F2612);
}
/* reset one of chip */
diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c
index 7f885bc1119..77e2a03473e 100644
--- a/src/emu/sound/fmopl.c
+++ b/src/emu/sound/fmopl.c
@@ -1744,7 +1744,7 @@ static int OPL_LockTable(device_t *device)
{
cymfile = fopen("3812_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 3812_.cym\n");
}
@@ -1957,7 +1957,7 @@ static void OPL_save_state(FM_OPL *OPL, device_t *device)
device->save_item(NAME(OPL->statusmask));
device->save_item(NAME(OPL->mode));
- device->machine->state().register_postload(OPL_postload, OPL);
+ device->machine().state().register_postload(OPL_postload, OPL);
}
@@ -1980,7 +1980,7 @@ static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type)
#endif
/* allocate memory block */
- ptr = (char *)auto_alloc_array_clear(device->machine, UINT8, state_size);
+ ptr = (char *)auto_alloc_array_clear(device->machine(), UINT8, state_size);
OPL = (FM_OPL *)ptr;
@@ -2009,7 +2009,7 @@ static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type)
static void OPLDestroy(FM_OPL *OPL)
{
OPL_UnLockTable();
- auto_free(OPL->device->machine, OPL);
+ auto_free(OPL->device->machine(), OPL);
}
/* Optional handlers */
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 036590bf837..5823f3248e4 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -195,7 +195,7 @@ READ16_DEVICE_HANDLER( gaelcosnd_r )
{
gaelco_sound_state *info = get_safe_token(device);
- LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine->describe_context(), offset));
+ LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine().describe_context(), offset));
return info->sndregs[offset];
}
@@ -209,7 +209,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w )
gaelco_sound_state *info = get_safe_token(device);
gaelco_sound_channel *channel = &info->channel[offset >> 3];
- LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine->describe_context(), data, offset));
+ LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine().describe_context(), data, offset));
/* first update the stream to this point in time */
info->stream->update();
@@ -259,8 +259,8 @@ static DEVICE_START( gaelco )
for (j = 0; j < 4; j++){
info->banks[j] = intf->banks[j];
}
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
- info->snd_data = (UINT8 *)device->machine->region(intf->gfxregion)->base();
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
+ info->snd_data = (UINT8 *)device->machine().region(intf->gfxregion)->base();
if (info->snd_data == NULL)
info->snd_data = *device->region();
diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c
index c10f765a3c6..58d4d862886 100644
--- a/src/emu/sound/hc55516.c
+++ b/src/emu/sound/hc55516.c
@@ -76,7 +76,7 @@ static void start_common(device_t *device, UINT8 _shiftreg_mask, int _active_clo
chip->last_clock_state = 0;
/* create the stream */
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, chip, hc55516_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, chip, hc55516_update);
device->save_item(NAME(chip->last_clock_state));
device->save_item(NAME(chip->digit));
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index 0a15dae9b6d..02fe11b9eca 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -33,7 +33,7 @@ device_config *ics2115_device_config::static_alloc_device_config(const machine_c
device_t *ics2115_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ics2115_device(machine, *this));
+ return auto_alloc(machine, ics2115_device(machine, *this));
}
ics2115_device::ics2115_device(running_machine &machine, const ics2115_device_config &config)
@@ -47,8 +47,8 @@ ics2115_device::ics2115_device(running_machine &machine, const ics2115_device_co
void ics2115_device::device_start()
{
m_rom = *region();
- m_timer[0].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_0), this);
- m_timer[1].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_1), this);
+ m_timer[0].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_0), this);
+ m_timer[1].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_1), this);
m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 33075);
//Exact formula as per patent 5809466
diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c
index cb8aa2cc451..a92e6870fca 100644
--- a/src/emu/sound/iremga20.c
+++ b/src/emu/sound/iremga20.c
@@ -247,7 +247,7 @@ static DEVICE_START( iremga20 )
for ( i = 0; i < 0x40; i++ )
chip->regs[i] = 0;
- chip->stream = device->machine->sound().stream_alloc( *device, 0, 2, device->clock()/4, chip, IremGA20_update );
+ chip->stream = device->machine().sound().stream_alloc( *device, 0, 2, device->clock()/4, chip, IremGA20_update );
device->save_item(NAME(chip->regs));
for (i = 0; i < 4; i++)
diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c
index a33ce5c7e98..d8c14c66998 100644
--- a/src/emu/sound/k005289.c
+++ b/src/emu/sound/k005289.c
@@ -68,7 +68,7 @@ INLINE k005289_state *get_safe_token(device_t *device)
}
/* build a table to divide by the number of voices */
-static void make_mixer_table(running_machine *machine, k005289_state *info, int voices)
+static void make_mixer_table(running_machine &machine, k005289_state *info, int voices)
{
int count = voices * 128;
int i;
@@ -164,14 +164,14 @@ static DEVICE_START( k005289 )
/* get stream channels */
info->rate = device->clock()/16;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, K005289_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, info->rate, info, K005289_update);
info->mclock = device->clock();
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer = auto_alloc_array(device->machine, short, 2 * info->rate);
+ info->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * info->rate);
/* build the mixer table */
- make_mixer_table(device->machine, info, 2);
+ make_mixer_table(device->machine(), info, 2);
info->sound_prom = *device->region();
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index f763342dabd..8a5de7ee2b4 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -328,7 +328,7 @@ static DEVICE_START( k007232 )
for( i = 0; i < 0x10; i++ ) info->wreg[i] = 0;
- info->stream = device->machine->sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
KDAC_A_make_fncode(info);
}
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c
index 9a9d60cd71c..361d565c615 100644
--- a/src/emu/sound/k051649.c
+++ b/src/emu/sound/k051649.c
@@ -62,7 +62,7 @@ INLINE k051649_state *get_safe_token(device_t *device)
}
/* build a table to divide by the number of voices */
-static void make_mixer_table(running_machine *machine, k051649_state *info, int voices)
+static void make_mixer_table(running_machine &machine, k051649_state *info, int voices)
{
int count = voices * 256;
int i;
@@ -138,14 +138,14 @@ static DEVICE_START( k051649 )
/* get stream channels */
info->rate = device->clock()/16;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update);
info->mclock = device->clock();
/* allocate a buffer to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer = auto_alloc_array(device->machine, short, 2 * info->rate);
+ info->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * info->rate);
/* build the mixer table */
- make_mixer_table(device->machine, info, 5);
+ make_mixer_table(device->machine(), info, 5);
}
static DEVICE_RESET( k051649 )
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 068e026159e..e694bec5dc7 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -221,7 +221,7 @@ static DEVICE_START( k053260 )
ic->mode = 0;
- const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine->region(ic->intf->rgnoverride) : device->region();
+ const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine().region(ic->intf->rgnoverride) : device->region();
ic->rom = *region;
ic->rom_size = region->bytes();
@@ -231,9 +231,9 @@ static DEVICE_START( k053260 )
for ( i = 0; i < 0x30; i++ )
ic->regs[i] = 0;
- ic->delta_table = auto_alloc_array( device->machine, UINT32, 0x1000 );
+ ic->delta_table = auto_alloc_array( device->machine(), UINT32, 0x1000 );
- ic->channel = device->machine->sound().stream_alloc( *device, 0, 2, rate, ic, k053260_update );
+ ic->channel = device->machine().sound().stream_alloc( *device, 0, 2, rate, ic, k053260_update );
InitDeltaTable( ic, rate, device->clock() );
@@ -258,7 +258,7 @@ static DEVICE_START( k053260 )
/* setup SH1 timer if necessary */
if ( ic->intf->irq )
- device->machine->scheduler().timer_pulse( attotime::from_hz(device->clock()) * 32, FUNC(ic->intf->irq ));
+ device->machine().scheduler().timer_pulse( attotime::from_hz(device->clock()) * 32, FUNC(ic->intf->irq ));
}
INLINE void check_bounds( k053260_state *ic, int channel )
@@ -424,7 +424,7 @@ READ8_DEVICE_HANDLER( k053260_r )
ic->channels[0].pos += ( 1 << 16 );
if ( offs > ic->rom_size ) {
- logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine->describe_context(),offs,ic->rom_size );
+ logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine().describe_context(),offs,ic->rom_size );
return 0;
}
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index 00d44b5cdb1..638d7b62007 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -384,7 +384,7 @@ else
double gc_f0;
int gc_i, gc_j, gc_k, gc_l;
- if (input_code_pressed_once(device->machine, KEYCODE_DEL_PAD))
+ if (input_code_pressed_once(device->machine(), KEYCODE_DEL_PAD))
{
gc_active ^= 1;
if (!gc_active) popmessage(NULL);
@@ -392,23 +392,23 @@ else
if (gc_active)
{
- if (input_code_pressed_once(device->machine, KEYCODE_0_PAD)) gc_chip ^= 1;
+ if (input_code_pressed_once(device->machine(), KEYCODE_0_PAD)) gc_chip ^= 1;
gc_i = gc_pos[gc_chip];
gc_j = 0;
- if (input_code_pressed_once(device->machine, KEYCODE_4_PAD)) { gc_i--; gc_j = 1; }
- if (input_code_pressed_once(device->machine, KEYCODE_6_PAD)) { gc_i++; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_4_PAD)) { gc_i--; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_6_PAD)) { gc_i++; gc_j = 1; }
if (gc_j) { gc_i &= 7; gc_pos[gc_chip] = gc_i; }
- if (input_code_pressed_once(device->machine, KEYCODE_5_PAD))
+ if (input_code_pressed_once(device->machine(), KEYCODE_5_PAD))
info->k054539_gain[gc_i] = 1.0;
else
{
gc_fptr = &info->k054539_gain[gc_i];
gc_f0 = *gc_fptr;
gc_j = 0;
- if (input_code_pressed_once(device->machine, KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; }
- if (input_code_pressed_once(device->machine, KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; }
if (gc_j) { if (gc_f0 < 0) gc_f0 = 0; *gc_fptr = gc_f0; }
}
@@ -451,12 +451,12 @@ static void k054539_init_chip(device_t *device, k054539_state *info)
info->k054539_flags |= K054539_UPDATE_AT_KEYON; //* make it default until proven otherwise
// Real size of 0x4000, the addon is to simplify the reverb buffer computations
- info->ram = auto_alloc_array(device->machine, unsigned char, 0x4000*2+device->clock()/50*2);
+ info->ram = auto_alloc_array(device->machine(), unsigned char, 0x4000*2+device->clock()/50*2);
info->reverb_pos = 0;
info->cur_ptr = 0;
memset(info->ram, 0, 0x4000*2+device->clock()/50*2);
- const memory_region *region = (info->intf->rgnoverride != NULL) ? device->machine->region(info->intf->rgnoverride) : device->region();
+ const memory_region *region = (info->intf->rgnoverride != NULL) ? device->machine().region(info->intf->rgnoverride) : device->region();
info->rom = *region;
info->rom_size = region->bytes();
info->rom_mask = 0xffffffffU;
@@ -470,9 +470,9 @@ static void k054539_init_chip(device_t *device, k054539_state *info)
// One or more of the registers must be the timer period
// And anyway, this particular frequency is probably wrong
// 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise
- device->machine->scheduler().timer_pulse(attotime::from_hz(480), FUNC(k054539_irq), 0, info);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(480), FUNC(k054539_irq), 0, info);
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock(), info, k054539_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock(), info, k054539_update);
device->save_item(NAME(info->regs));
device->save_pointer(NAME(info->ram), 0x4000);
@@ -674,7 +674,7 @@ static DEVICE_START( k054539 )
k054539_init_chip(device, info);
- device->machine->state().register_postload(reset_zones, info);
+ device->machine().state().register_postload(reset_zones, info);
}
diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c
index eb2c671b59d..758303edd11 100644
--- a/src/emu/sound/k056800.c
+++ b/src/emu/sound/k056800.c
@@ -61,7 +61,7 @@ static void k056800_host_reg_w( device_t *device, int reg, UINT8 data )
k056800->sound_reg[reg] = data;
if (reg == 7)
- k056800->irq_cb(device->machine, 1);
+ k056800->irq_cb(device->machine(), 1);
}
static UINT8 k056800_sound_reg_r( device_t *device, int reg )
@@ -146,7 +146,7 @@ static DEVICE_START( k056800 )
k056800->irq_cb = intf->irq_cb;
- k056800->sound_cpu_timer = device->machine->scheduler().timer_alloc(FUNC(k056800_sound_cpu_timer_tick), k056800);
+ k056800->sound_cpu_timer = device->machine().scheduler().timer_alloc(FUNC(k056800_sound_cpu_timer_tick), k056800);
k056800->sound_cpu_timer->adjust(timer_period, 0, timer_period);
device->save_item(NAME(k056800->host_reg));
diff --git a/src/emu/sound/k056800.h b/src/emu/sound/k056800.h
index 57c205b61a7..81afa200ae3 100644
--- a/src/emu/sound/k056800.h
+++ b/src/emu/sound/k056800.h
@@ -14,7 +14,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*k056800_irq_cb)(running_machine *, int);
+typedef void (*k056800_irq_cb)(running_machine &, int);
typedef struct _k056800_interface k056800_interface;
diff --git a/src/emu/sound/mas3507d.c b/src/emu/sound/mas3507d.c
index c88a3d4e477..77fa947259d 100644
--- a/src/emu/sound/mas3507d.c
+++ b/src/emu/sound/mas3507d.c
@@ -21,7 +21,7 @@ device_config *mas3507d_device_config::static_alloc_device_config(const machine_
device_t *mas3507d_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mas3507d_device(machine, *this));
+ return auto_alloc(machine, mas3507d_device(machine, *this));
}
mas3507d_device::mas3507d_device(running_machine &machine, const mas3507d_device_config &_config)
diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c
index 471a4ed193d..061fe8a957a 100644
--- a/src/emu/sound/mos6560.c
+++ b/src/emu/sound/mos6560.c
@@ -145,7 +145,7 @@ INLINE const mos6560_interface *get_interface( device_t *device )
if(VERBOSE_LEVEL >= N) \
{ \
if( M ) \
- logerror("%11.6f: %-24s", device->machine->time().as_double(), (char*) M ); \
+ logerror("%11.6f: %-24s", device->machine().time().as_double(), (char*) M ); \
logerror A; \
} \
} while (0)
@@ -153,9 +153,9 @@ INLINE const mos6560_interface *get_interface( device_t *device )
/* 2008-05 FP: lightpen code needs to read input port from vc20.c */
-#define LIGHTPEN_BUTTON ((mos6560->lightpen_button_cb != NULL) ? mos6560->lightpen_button_cb(device->machine) : 0)
-#define LIGHTPEN_X_VALUE ((mos6560->lightpen_x_cb != NULL) ? mos6560->lightpen_x_cb(device->machine) : 0)
-#define LIGHTPEN_Y_VALUE ((mos6560->lightpen_y_cb != NULL) ? mos6560->lightpen_y_cb(device->machine) : 0)
+#define LIGHTPEN_BUTTON ((mos6560->lightpen_button_cb != NULL) ? mos6560->lightpen_button_cb(device->machine()) : 0)
+#define LIGHTPEN_X_VALUE ((mos6560->lightpen_x_cb != NULL) ? mos6560->lightpen_x_cb(device->machine()) : 0)
+#define LIGHTPEN_Y_VALUE ((mos6560->lightpen_y_cb != NULL) ? mos6560->lightpen_y_cb(device->machine()) : 0)
/* lightpen delivers values from internal counters
* they do not start with the visual area or frame area */
@@ -214,7 +214,7 @@ static void mos6560_draw_character( device_t *device, int ybegin, int yend, int
for (y = ybegin; y <= yend; y++)
{
- code = mos6560->dma_read(device->machine, (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
+ code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 0) = color[code >> 7];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 1) = color[(code >> 6) & 1];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 2) = color[(code >> 5) & 1];
@@ -238,7 +238,7 @@ static void mos6560_draw_character_multi( device_t *device, int ybegin, int yend
for (y = ybegin; y <= yend; y++)
{
- code = mos6560->dma_read(device->machine, (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
+ code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 0) =
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 1) = color[code >> 6];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 2) =
@@ -298,8 +298,8 @@ static void mos6560_drawlines( device_t *device, int first, int last )
for (xoff = mos6560->xpos; (xoff < mos6560->xpos + mos6560->xsize) && (xoff < mos6560->total_xsize); xoff += 8, offs++)
{
- ch = mos6560->dma_read(device->machine, (mos6560->videoaddr + offs) & 0x3fff);
- attr = (mos6560->dma_read_color(device->machine, (mos6560->videoaddr + offs) & 0x3fff)) & 0xf;
+ ch = mos6560->dma_read(device->machine(), (mos6560->videoaddr + offs) & 0x3fff);
+ attr = (mos6560->dma_read_color(device->machine(), (mos6560->videoaddr + offs) & 0x3fff)) & 0xf;
if (mos6560->type == MOS6560_ATTACKUFO)
{
@@ -460,7 +460,7 @@ READ8_DEVICE_HANDLER( mos6560_port_r )
break;
case 6: /*lightpen horizontal */
case 7: /*lightpen vertical */
- if (LIGHTPEN_BUTTON && ((device->machine->time().as_double() - mos6560->lightpenreadtime) * MOS656X_VRETRACERATE >= 1))
+ if (LIGHTPEN_BUTTON && ((device->machine().time().as_double() - mos6560->lightpenreadtime) * MOS656X_VRETRACERATE >= 1))
{
/* only 1 update each frame */
/* and diode must recognize light */
@@ -469,13 +469,13 @@ READ8_DEVICE_HANDLER( mos6560_port_r )
mos6560->reg[6] = MOS656X_X_VALUE;
mos6560->reg[7] = MOS656X_Y_VALUE;
}
- mos6560->lightpenreadtime = device->machine->time().as_double();
+ mos6560->lightpenreadtime = device->machine().time().as_double();
}
val = mos6560->reg[offset];
break;
case 8: /* poti 1 */
case 9: /* poti 2 */
- val = (mos6560->paddle_cb != NULL) ? mos6560->paddle_cb[offset - 8](device->machine) : mos6560->reg[offset];
+ val = (mos6560->paddle_cb != NULL) ? mos6560->paddle_cb[offset - 8](device->machine()) : mos6560->reg[offset];
break;
default:
val = mos6560->reg[offset];
@@ -587,7 +587,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE1_ON)
{
mos6560->tone1pos = 0;
- mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
+ mos6560->tone1samples = device->machine().sample_rate() / TONE1_FREQUENCY;
if (!mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@@ -598,7 +598,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE2_ON)
{
mos6560->tone2pos = 0;
- mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
+ mos6560->tone2samples = device->machine().sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@@ -609,7 +609,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE3_ON)
{
mos6560->tone3pos = 0;
- mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
+ mos6560->tone3samples = device->machine().sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@@ -619,7 +619,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
mos6560->reg[offset] = data;
if (NOISE_ON)
{
- mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine->sample_rate()
+ mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine().sample_rate()
* NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
DBG_LOG (1, "mos6560", ("noise %.2x %d sample:%d\n",
data, NOISE_FREQUENCY, mos6560->noisesamples));
@@ -664,7 +664,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone1pos >= mos6560->tone1samples)
{
mos6560->tone1pos = 0;
- mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
+ mos6560->tone1samples = device->machine().sample_rate() / TONE1_FREQUENCY;
if (mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@@ -680,7 +680,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone2pos >= mos6560->tone2samples)
{
mos6560->tone2pos = 0;
- mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
+ mos6560->tone2samples = device->machine().sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@@ -696,7 +696,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone3pos >= mos6560->tone3samples)
{
mos6560->tone3pos = 0;
- mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
+ mos6560->tone3samples = device->machine().sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@@ -739,11 +739,11 @@ static void mos6560_sound_start( device_t *device )
mos6560_state *mos6560 = get_safe_token(device);
int i;
- mos6560->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, mos6560_update);
+ mos6560->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, mos6560_update);
/* buffer for fastest played sample for 5 second so we have enough data for min 5 second */
mos6560->noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
- mos6560->noise = auto_alloc_array(device->machine, INT8, mos6560->noisesize);
+ mos6560->noise = auto_alloc_array(device->machine(), INT8, mos6560->noisesize);
{
int noiseshift = 0x7ffff8;
char data;
@@ -774,11 +774,11 @@ static void mos6560_sound_start( device_t *device )
noiseshift <<= 1;
}
}
- mos6560->tonesize = device->machine->sample_rate() / TONE_FREQUENCY_MIN;
+ mos6560->tonesize = device->machine().sample_rate() / TONE_FREQUENCY_MIN;
if (mos6560->tonesize > 0)
{
- mos6560->tone = auto_alloc_array(device->machine, INT16, mos6560->tonesize);
+ mos6560->tone = auto_alloc_array(device->machine(), INT16, mos6560->tonesize);
for (i = 0; i < mos6560->tonesize; i++)
{
@@ -802,13 +802,13 @@ static DEVICE_START( mos6560 )
const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config();
int width, height;
- mos6560->screen = downcast<screen_device *>(device->machine->device(intf->screen));
+ mos6560->screen = downcast<screen_device *>(device->machine().device(intf->screen));
width = mos6560->screen->width();
height = mos6560->screen->height();
mos6560->type = intf->type;
- mos6560->bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
+ mos6560->bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
assert(intf->dma_read != NULL);
assert(intf->dma_read_color != NULL);
diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h
index 7d1e873df3b..fc7d406e0d5 100644
--- a/src/emu/sound/mos6560.h
+++ b/src/emu/sound/mos6560.h
@@ -15,13 +15,13 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef UINT8 (*mos6560_lightpen_x_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_lightpen_y_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_lightpen_button_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_paddle_callback)(running_machine *machine);
+typedef UINT8 (*mos6560_lightpen_x_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_lightpen_y_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_lightpen_button_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_paddle_callback)(running_machine &machine);
-typedef int (*mos6560_dma_read)(running_machine *machine, int);
-typedef int (*mos6560_dma_read_color)(running_machine *machine, int);
+typedef int (*mos6560_dma_read)(running_machine &machine, int);
+typedef int (*mos6560_dma_read_color)(running_machine &machine, int);
typedef enum
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c
index cf50d6e442d..3414804e91f 100644
--- a/src/emu/sound/msm5205.c
+++ b/src/emu/sound/msm5205.c
@@ -187,8 +187,8 @@ static DEVICE_START( msm5205 )
ComputeTables (voice);
/* stream system initialize */
- voice->stream = device->machine->sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
- voice->timer = device->machine->scheduler().timer_alloc(FUNC(MSM5205_vclk_callback), voice);
+ voice->stream = device->machine().sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
+ voice->timer = device->machine().scheduler().timer_alloc(FUNC(MSM5205_vclk_callback), voice);
/* initialize */
DEVICE_RESET_CALL(msm5205);
@@ -221,7 +221,7 @@ void msm5205_vclk_w (device_t *device, int vclk)
if( voice->vclk != vclk)
{
voice->vclk = vclk;
- if( !vclk ) MSM5205_vclk_callback(voice->device->machine, voice, 0);
+ if( !vclk ) MSM5205_vclk_callback(voice->device->machine(), voice, 0);
}
}
}
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index f7bcd3378f9..819eff53b7f 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -796,10 +796,10 @@ static DEVICE_START( msm5232 )
msm5232_init(chip, intf, device->clock(), rate);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 11, rate, chip, MSM5232_update_one);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 11, rate, chip, MSM5232_update_one);
/* register with the save state system */
- device->machine->state().register_postload(msm5232_postload, chip);
+ device->machine().state().register_postload(msm5232_postload, chip);
device->save_item(NAME(chip->EN_out16));
device->save_item(NAME(chip->EN_out8));
device->save_item(NAME(chip->EN_out4));
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index a0cff9a46a7..43c7a2b3a2f 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -503,7 +503,7 @@ static DEVICE_START( multipcm )
ptChip->ROM=*device->region();
ptChip->Rate=(float) device->clock() / MULTIPCM_CLOCKDIV;
- ptChip->stream = device->machine->sound().stream_alloc(*device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
+ ptChip->stream = device->machine().sound().stream_alloc(*device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
//Volume+pan table
for(i=0;i<0x800;++i)
diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c
index 9c33e396ee2..0c0faae0b1b 100644
--- a/src/emu/sound/n63701x.c
+++ b/src/emu/sound/n63701x.c
@@ -114,7 +114,7 @@ static DEVICE_START( namco_63701x )
chip->rom = *device->region();
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
}
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index 8d60b93aa2d..eae14998f21 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -112,7 +112,7 @@ static void update_namco_waveform(namco_sound *chip, int offset, UINT8 data)
/* build the decoded waveform table */
-static void build_decoded_waveform(running_machine *machine, namco_sound *chip, UINT8 *rgnbase)
+static void build_decoded_waveform(running_machine &machine, namco_sound *chip, UINT8 *rgnbase)
{
INT16 *p;
int size;
@@ -369,7 +369,7 @@ static DEVICE_START( namco )
chip->last_channel = chip->channel_list + chip->num_voices;
chip->stereo = intf->stereo;
- chip->soundregs = auto_alloc_array_clear(device->machine, UINT8, 0x400);
+ chip->soundregs = auto_alloc_array_clear(device->machine(), UINT8, 0x400);
/* adjust internal clock */
chip->namco_clock = device->clock();
@@ -384,13 +384,13 @@ static DEVICE_START( namco )
logerror("Namco: freq fractional bits = %d: internal freq = %d, output freq = %d\n", chip->f_fracbits, chip->namco_clock, chip->sample_rate);
/* build the waveform table */
- build_decoded_waveform(device->machine, chip, *device->region());
+ build_decoded_waveform(device->machine(), chip, *device->region());
/* get stream channels */
if (intf->stereo)
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
else
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, namco_update_mono);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, namco_update_mono);
/* start with sound enabled, many games don't have a sound enable register */
chip->sound_enable = 1;
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index c95a9672691..f7c37cae2fa 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -690,9 +690,9 @@ static DEVICE_START( nesapu )
int i;
/* Initialize global variables */
- info->samps_per_sync = rate / ATTOSECONDS_TO_HZ(device->machine->primary_screen->frame_period().attoseconds);
+ info->samps_per_sync = rate / ATTOSECONDS_TO_HZ(device->machine().primary_screen->frame_period().attoseconds);
info->buffer_size = info->samps_per_sync;
- info->real_rate = info->samps_per_sync * ATTOSECONDS_TO_HZ(device->machine->primary_screen->frame_period().attoseconds);
+ info->real_rate = info->samps_per_sync * ATTOSECONDS_TO_HZ(device->machine().primary_screen->frame_period().attoseconds);
info->apu_incsize = (float) (device->clock() / (float) info->real_rate);
/* Use initializer calls */
@@ -704,9 +704,9 @@ static DEVICE_START( nesapu )
info->buffer_size+=info->samps_per_sync;
/* Initialize individual chips */
- (info->APU.dpcm).memory = device->machine->device(intf->cpu_tag)->memory().space(AS_PROGRAM);
+ (info->APU.dpcm).memory = device->machine().device(intf->cpu_tag)->memory().space(AS_PROGRAM);
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
/* register for save */
for (i = 0; i < 2; i++)
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 54132196ebc..f2eb959bafb 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -227,7 +227,7 @@ static DEVICE_START( nile )
info->sound_ram = *device->region();
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, nile_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, nile_update);
}
diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c
index 1bff117eaf2..15dd49a9eb1 100644
--- a/src/emu/sound/okim6258.c
+++ b/src/emu/sound/okim6258.c
@@ -201,7 +201,7 @@ static DEVICE_START( okim6258 )
info->output_bits = intf->output_12bits ? 12 : 10;
info->divider = dividers[intf->divider];
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/info->divider, info, okim6258_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/info->divider, info, okim6258_update);
info->signal = -2;
info->step = 0;
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index 1b765f31f50..af27711b7d3 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -115,7 +115,7 @@ device_config *okim6295_device_config::static_alloc_device_config(const machine_
device_t *okim6295_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, okim6295_device(machine, *this));
+ return auto_alloc(machine, okim6295_device(machine, *this));
}
@@ -266,7 +266,7 @@ void okim6295_device::set_bank_base(offs_t base)
if (m_bank_installed)
{
m_bank_offs = base;
- memory_set_bankptr(&m_machine, tag(), m_region->base() + base);
+ memory_set_bankptr(m_machine, tag(), m_region->base() + base);
}
}
diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c
index fcfda3f9ba9..c1ac5f5eb92 100644
--- a/src/emu/sound/okim6376.c
+++ b/src/emu/sound/okim6376.c
@@ -306,7 +306,7 @@ static DEVICE_START( okim6376 )
info->master_clock = device->clock();
/* generate the name and create the stream */
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/divisor, info, okim6376_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/divisor, info, okim6376_update);
/* initialize the voices */
for (voice = 0; voice < OKIM6376_VOICES; voice++)
diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c
index ffbf37a39f2..095c811f9ad 100644
--- a/src/emu/sound/okim9810.c
+++ b/src/emu/sound/okim9810.c
@@ -101,7 +101,7 @@ device_config *okim9810_device_config::static_alloc_device_config(const machine_
device_t *okim9810_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, okim9810_device(machine, *this));
+ return auto_alloc(machine, okim9810_device(machine, *this));
}
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index 54f15f94d88..d63278331d4 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -648,15 +648,15 @@ static DEVICE_START( pokey )
chip->clockmult = DIV_64;
chip->KBCODE = 0x09; /* Atari 800 'no key' */
chip->SKCTL = SK_RESET; /* let the RNG run after reset */
- chip->rtimer = device->machine->scheduler().timer_alloc(FUNC(NULL));
+ chip->rtimer = device->machine().scheduler().timer_alloc(FUNC(NULL));
- chip->timer[0] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
- chip->timer[1] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
- chip->timer[2] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[0] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[1] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[2] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
for (i=0; i<8; i++)
{
- chip->ptimer[i] = device->machine->scheduler().timer_alloc(FUNC(pokey_pot_trigger), chip);
+ chip->ptimer[i] = device->machine().scheduler().timer_alloc(FUNC(pokey_pot_trigger), chip);
devcb_resolve_read8(&chip->pot_r[i], &chip->intf.pot_r[i], device);
}
devcb_resolve_read8(&chip->allpot_r, &chip->intf.allpot_r, device);
@@ -664,7 +664,7 @@ static DEVICE_START( pokey )
devcb_resolve_write8(&chip->serout_w, &chip->intf.serout_w, device);
chip->interrupt_cb = chip->intf.interrupt_cb;
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, chip, pokey_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, chip, pokey_update);
register_for_save(chip, device);
}
@@ -843,7 +843,7 @@ READ8_DEVICE_HANDLER( pokey_r )
}
}
else
- logerror("%s: warning - read '%s' POT%d\n", p->device->machine->describe_context(), p->device->tag(), pot);
+ logerror("%s: warning - read '%s' POT%d\n", p->device->machine().describe_context(), p->device->tag(), pot);
break;
case ALLPOT_C:
@@ -943,7 +943,7 @@ READ8_HANDLER( quad_pokey_r )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- return pokey_r(space->machine->device(devname[pokey_num]), pokey_reg);
+ return pokey_r(space->machine().device(devname[pokey_num]), pokey_reg);
}
@@ -1138,9 +1138,9 @@ WRITE8_DEVICE_HANDLER( pokey_w )
* loaders from Ballblazer and Escape from Fractalus
* The real times are unknown
*/
- device->machine->scheduler().timer_set(attotime::from_usec(200), FUNC(pokey_serout_ready_cb), 0, p);
+ device->machine().scheduler().timer_set(attotime::from_usec(200), FUNC(pokey_serout_ready_cb), 0, p);
/* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */
- device->machine->scheduler().timer_set(attotime::from_usec(2000), FUNC(pokey_serout_complete), 0, p);
+ device->machine().scheduler().timer_set(attotime::from_usec(2000), FUNC(pokey_serout_complete), 0, p);
break;
case IRQEN_C:
@@ -1329,13 +1329,13 @@ WRITE8_HANDLER( quad_pokey_w )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- pokey_w(space->machine->device(devname[pokey_num]), pokey_reg, data);
+ pokey_w(space->machine().device(devname[pokey_num]), pokey_reg, data);
}
void pokey_serin_ready(device_t *device, int after)
{
pokey_state *p = get_safe_token(device);
- device->machine->scheduler().timer_set(p->clock_period * after, FUNC(pokey_serin_ready_cb), 0, p);
+ device->machine().scheduler().timer_set(p->clock_period * after, FUNC(pokey_serin_ready_cb), 0, p);
}
void pokey_break_w(device_t *device, int shift)
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index af1222395d9..cc08776aca6 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -123,7 +123,7 @@ static DEVICE_START( qsound )
{
/* Allocate stream */
- chip->stream = device->machine->sound().stream_alloc(
+ chip->stream = device->machine().sound().stream_alloc(
*device, 0, 2,
device->clock() / QSOUND_CLOCKDIV,
chip,
@@ -187,7 +187,7 @@ WRITE8_DEVICE_HANDLER( qsound_w )
break;
default:
- logerror("%s: unexpected qsound write to offset %d == %02X\n", device->machine->describe_context(), offset, data);
+ logerror("%s: unexpected qsound write to offset %d == %02X\n", device->machine().describe_context(), offset, data);
break;
}
}
diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c
index e7c12f73d1e..65ff5be839f 100644
--- a/src/emu/sound/rf5c400.c
+++ b/src/emu/sound/rf5c400.c
@@ -264,7 +264,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
double r;
// attack
- r = 1.0 / (ENV_AR_SPEED * device->machine->sample_rate());
+ r = 1.0 / (ENV_AR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_AR; i++)
{
info->env_ar_table[i] = 1.0;
@@ -280,7 +280,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// decay
- r = -1.0 / (ENV_DR_SPEED * device->machine->sample_rate());
+ r = -1.0 / (ENV_DR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_DR; i++)
{
info->env_dr_table[i] = r;
@@ -296,7 +296,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// release
- r = -1.0 / (ENV_RR_SPEED * device->machine->sample_rate());
+ r = -1.0 / (ENV_RR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_RR; i++)
{
info->env_rr_table[i] = r;
@@ -345,7 +345,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
device->save_item(NAME(info->channels[i].env_scale), i);
}
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/384, info, rf5c400_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, info, rf5c400_update);
}
@@ -448,11 +448,11 @@ WRITE16_DEVICE_HANDLER( rf5c400_w )
default:
{
- //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", device->machine->describe_context(), data, offset, mem_mask);
+ //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", device->machine().describe_context(), data, offset, mem_mask);
break;
}
}
- //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", device->machine->describe_context(), data, offset, mem_mask);
+ //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", device->machine().describe_context(), data, offset, mem_mask);
}
else
{
diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c
index ba756d0ec56..56f60f4e7a7 100644
--- a/src/emu/sound/rf5c68.c
+++ b/src/emu/sound/rf5c68.c
@@ -145,7 +145,7 @@ static DEVICE_START( rf5c68 )
rf5c68_state *chip = get_safe_token(device);
/* allocate the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 384, chip, rf5c68_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 384, chip, rf5c68_update);
chip->device = device;
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index d2d9741b658..902d644e81c 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -592,7 +592,7 @@ static DEVICE_START( s14001a )
chip->SpeechRom = *device->region();
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate(), chip, s14001a_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine().sample_rate(), chip, s14001a_pcm_update);
}
int s14001a_bsy_r(device_t *device)
diff --git a/src/emu/sound/s2636.c b/src/emu/sound/s2636.c
index 36c5c29a519..baeb1b7f487 100644
--- a/src/emu/sound/s2636.c
+++ b/src/emu/sound/s2636.c
@@ -38,7 +38,7 @@ void s2636_soundport_w (device_t *device, int offset, int data)
token->pos = 0;
token->level = TRUE;
// frequency 7874/(data+1)
- token->size = device->machine->sample_rate() * (data + 1) /7874;
+ token->size = device->machine().sample_rate() * (data + 1) /7874;
break;
}
}
@@ -79,7 +79,7 @@ static DEVICE_START(s2636_sound)
{
s2636_sound *token = get_token(device);
memset(token, 0, sizeof(*token));
- token->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, s2636_update);
+ token->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, s2636_update);
}
diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c
index 19054f55327..f93f1639247 100644
--- a/src/emu/sound/saa1099.c
+++ b/src/emu/sound/saa1099.c
@@ -327,7 +327,7 @@ static DEVICE_START( saa1099 )
saa->sample_rate = device->clock() / 256;
/* for each chip allocate one stream */
- saa->stream = device->machine->sound().stream_alloc(*device, 0, 2, saa->sample_rate, saa, saa1099_update);
+ saa->stream = device->machine().sound().stream_alloc(*device, 0, 2, saa->sample_rate, saa, saa1099_update);
}
WRITE8_DEVICE_HANDLER( saa1099_control_w )
@@ -337,7 +337,7 @@ WRITE8_DEVICE_HANDLER( saa1099_control_w )
if ((data & 0xff) > 0x1c)
{
/* Error! */
- logerror("%s: (SAA1099 '%s') Unknown register selected\n",device->machine->describe_context(), device->tag());
+ logerror("%s: (SAA1099 '%s') Unknown register selected\n",device->machine().describe_context(), device->tag());
}
saa->selected_reg = data & 0x1f;
@@ -423,7 +423,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
int i;
/* Synch & Reset generators */
- logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",device->machine->describe_context(), device->tag());
+ logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",device->machine().describe_context(), device->tag());
for (i = 0; i < 6; i++)
{
saa->channels[i].level = 0;
@@ -432,7 +432,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
}
break;
default: /* Error! */
- logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",device->machine->describe_context(), device->tag(), reg, data);
+ logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",device->machine().describe_context(), device->tag(), reg, data);
}
}
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index 2d76933a3ed..1052cbfbcfb 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -48,7 +48,7 @@ INLINE samples_info *get_safe_token(device_t *device)
read_wav_sample - read a WAV file as a sample
-------------------------------------------------*/
-static int read_wav_sample(running_machine *machine, emu_file &file, loaded_sample *sample)
+static int read_wav_sample(running_machine &machine, emu_file &file, loaded_sample *sample)
{
unsigned long offset = 0;
UINT32 length, rate, filesize;
@@ -177,14 +177,14 @@ static int read_wav_sample(running_machine *machine, emu_file &file, loaded_samp
readsamples - load all samples
-------------------------------------------------*/
-loaded_samples *readsamples(running_machine *machine, const char *const *samplenames, const char *basename)
+loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *basename)
{
loaded_samples *samples;
int skipfirst = 0;
int i;
/* if the user doesn't want to use samples, bail */
- if (!machine->options().samples())
+ if (!machine.options().samples())
return NULL;
if (samplenames == 0 || samplenames[0] == 0)
return NULL;
@@ -206,7 +206,7 @@ loaded_samples *readsamples(running_machine *machine, const char *const *samplen
for (i = 0; i < samples->total; i++)
if (samplenames[i+skipfirst][0])
{
- emu_file file(machine->options().sample_path(), OPEN_FLAG_READ);
+ emu_file file(machine.options().sample_path(), OPEN_FLAG_READ);
file_error filerr = file.open(basename, PATH_SEPARATOR, samplenames[i+skipfirst]);
if (filerr != FILERR_NONE && skipfirst)
@@ -251,7 +251,7 @@ void sample_start(device_t *device,int channel,int samplenum,int loop)
chan->pos = 0;
chan->frac = 0;
chan->basefreq = sample->frequency;
- chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
chan->loop = loop;
}
@@ -275,7 +275,7 @@ void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int s
chan->pos = 0;
chan->frac = 0;
chan->basefreq = frequency;
- chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
chan->loop = loop;
}
@@ -292,7 +292,7 @@ void sample_set_freq(device_t *device,int channel,int freq)
/* force an update before we start */
chan->stream->update();
- chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine().sample_rate();
}
@@ -468,15 +468,15 @@ static DEVICE_START( samples )
/* read audio samples */
if (intf->samplenames)
- info->samples = readsamples(device->machine, intf->samplenames,device->machine->system().name);
+ info->samples = readsamples(device->machine(), intf->samplenames,device->machine().system().name);
/* allocate channels */
info->numchannels = intf->channels;
assert(info->numchannels < MAX_CHANNELS);
- info->channel = auto_alloc_array(device->machine, sample_channel, info->numchannels);
+ info->channel = auto_alloc_array(device->machine(), sample_channel, info->numchannels);
for (i = 0; i < info->numchannels; i++)
{
- info->channel[i].stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), &info->channel[i], sample_update_sound);
+ info->channel[i].stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), &info->channel[i], sample_update_sound);
info->channel[i].source = NULL;
info->channel[i].source_num = -1;
@@ -493,7 +493,7 @@ static DEVICE_START( samples )
device->save_item(NAME(info->channel[i].loop), i);
device->save_item(NAME(info->channel[i].paused), i);
}
- device->machine->state().register_postload(samples_postload, info);
+ device->machine().state().register_postload(samples_postload, info);
/* initialize any custom handlers */
if (intf->start)
diff --git a/src/emu/sound/samples.h b/src/emu/sound/samples.h
index 018296aec08..0d44d994c2f 100644
--- a/src/emu/sound/samples.h
+++ b/src/emu/sound/samples.h
@@ -42,7 +42,7 @@ int sample_playing(device_t *device,int channel);
/* helper function that reads samples from disk - this can be used by other */
/* drivers as well (e.g. a sound chip emulator needing drum samples) */
-loaded_samples *readsamples(running_machine *machine, const char *const *samplenames, const char *name);
+loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *name);
DECLARE_LEGACY_SOUND_DEVICE(SAMPLES, samples);
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index 7e92f3eca8d..486f473ee33 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -547,9 +547,9 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface *
scsp->SCSPRAM += intf->roffset;
}
- scsp->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), scsp);
- scsp->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), scsp);
- scsp->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), scsp);
+ scsp->timerA = device->machine().scheduler().timer_alloc(FUNC(timerA_cb), scsp);
+ scsp->timerB = device->machine().scheduler().timer_alloc(FUNC(timerB_cb), scsp);
+ scsp->timerC = device->machine().scheduler().timer_alloc(FUNC(timerC_cb), scsp);
for(i=0;i<0x400;++i)
{
@@ -639,9 +639,9 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface *
scsp->Slots[i].EG.state=RELEASE;
}
- LFO_Init(device->machine);
- scsp->buffertmpl=auto_alloc_array_clear(device->machine, signed int, 44100);
- scsp->buffertmpr=auto_alloc_array_clear(device->machine, signed int, 44100);
+ LFO_Init(device->machine());
+ scsp->buffertmpl=auto_alloc_array_clear(device->machine(), signed int, 44100);
+ scsp->buffertmpr=auto_alloc_array_clear(device->machine(), signed int, 44100);
// no "pend"
scsp->udata.data[0x20/2] = 0;
@@ -696,7 +696,7 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r)
static void SCSP_UpdateReg(scsp_state *scsp, int reg)
{
/* temporary hack until this is converted to a device */
- address_space *space = scsp->device->machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = scsp->device->machine().firstcpu->memory().space(AS_PROGRAM);
switch(reg&0x3f)
{
case 0x2:
@@ -716,7 +716,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg)
break;
case 0x6:
case 0x7:
- scsp_midi_in(space->machine->device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
+ scsp_midi_in(space->machine().device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
break;
case 0x12:
case 0x13:
@@ -1214,7 +1214,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
/*Job done,request a dma end irq*/
if(scsp_regs[0x1e/2] & 0x10)
- device_set_input_line(space->machine->device("audiocpu"),dma_transfer_end,HOLD_LINE);
+ device_set_input_line(space->machine().device("audiocpu"),dma_transfer_end,HOLD_LINE);
}
#ifdef UNUSED_FUNCTION
@@ -1249,7 +1249,7 @@ static DEVICE_START( scsp )
{
scsp->Int68kCB = intf->irq_callback;
- scsp->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
+ scsp->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
}
}
@@ -1318,7 +1318,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
scsp->scsp_dtlg = scsp_regs[0x416/2] & 0x0ffe;
if(scsp_dexe)
{
- dma_scsp(device->machine->firstcpu->memory().space(AS_PROGRAM), scsp);
+ dma_scsp(device->machine().firstcpu->memory().space(AS_PROGRAM), scsp);
scsp_regs[0x416/2]^=0x1000;//disable starting bit
}
break;
@@ -1326,7 +1326,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
case 0x42a:
if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/
{
- device_set_input_line_and_vector(device->machine->firstcpu, 9, HOLD_LINE , 0x46);
+ device_set_input_line_and_vector(device->machine().firstcpu, 9, HOLD_LINE , 0x46);
logerror("SCSP: Main CPU interrupt\n");
}
break;
diff --git a/src/emu/sound/scsplfo.c b/src/emu/sound/scsplfo.c
index 2609a612524..ca658d1d4ec 100644
--- a/src/emu/sound/scsplfo.c
+++ b/src/emu/sound/scsplfo.c
@@ -38,7 +38,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256];
static int ASCALES[8][256];
-static void LFO_Init(running_machine *machine)
+static void LFO_Init(running_machine &machine)
{
int i,s;
for(i=0;i<256;++i)
@@ -86,7 +86,7 @@ static void LFO_Init(running_machine *machine)
//noise
//a=lfo_noise[i];
- a=machine->rand()&0xff;
+ a=machine.rand()&0xff;
p=128-a;
ALFO_NOI[i]=a;
PLFO_NOI[i]=p;
diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c
index c7edc760ef6..4df96f9d9b6 100644
--- a/src/emu/sound/segapcm.c
+++ b/src/emu/sound/segapcm.c
@@ -109,7 +109,7 @@ static DEVICE_START( segapcm )
segapcm_state *spcm = get_safe_token(device);
spcm->rom = *device->region();
- spcm->ram = auto_alloc_array(device->machine, UINT8, 0x800);
+ spcm->ram = auto_alloc_array(device->machine(), UINT8, 0x800);
memset(spcm->ram, 0xff, 0x800);
@@ -127,7 +127,7 @@ static DEVICE_START( segapcm )
spcm->bankmask = mask & (rom_mask >> spcm->bankshift);
- spcm->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 128, spcm, SEGAPCM_update);
+ spcm->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 128, spcm, SEGAPCM_update);
device->save_item(NAME(spcm->low));
device->save_pointer(NAME(spcm->ram), 0x800);
diff --git a/src/emu/sound/sid.c b/src/emu/sound/sid.c
index 8aca0f283eb..5f35e04d8ba 100644
--- a/src/emu/sound/sid.c
+++ b/src/emu/sound/sid.c
@@ -149,9 +149,9 @@ int sidEmuReset(_SID6581 *This)
}
-static void filterTableInit(running_machine *machine)
+static void filterTableInit(running_machine &machine)
{
- int sample_rate = machine->sample_rate();
+ int sample_rate = machine.sample_rate();
UINT16 uk;
/* Parameter calculation has not been moved to a separate function */
/* by purpose. */
@@ -233,8 +233,8 @@ void sid6581_init (_SID6581 *This)
This->filter.Enabled = TRUE;
- sidInitMixerEngine(This->device->machine);
- filterTableInit(This->device->machine);
+ sidInitMixerEngine(This->device->machine());
+ filterTableInit(This->device->machine());
sidInitWaveformTables(This->type);
@@ -323,7 +323,7 @@ void sid6581_port_w (_SID6581 *This, int offset, int data)
}
}
-int sid6581_port_r (running_machine *machine, _SID6581 *This, int offset)
+int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset)
{
int data;
/* SIDPLAY reads last written at a sid address value */
diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h
index df512edda13..e8c4e1bfe04 100644
--- a/src/emu/sound/sid.h
+++ b/src/emu/sound/sid.h
@@ -58,7 +58,7 @@ void sid6581_init (_SID6581 *This);
int sidEmuReset(_SID6581 *This);
-int sid6581_port_r (running_machine *machine, _SID6581 *This, int offset);
+int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset);
void sid6581_port_w (_SID6581 *This, int offset, int data);
void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen );
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index 6596df42d6e..49b99579078 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -35,8 +35,8 @@ static void sid_start(device_t *device, SIDTYPE sidtype)
const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config();
sid->device = device;
- sid->mixer_channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *) sid, sid_update);
- sid->PCMfreq = device->machine->sample_rate();
+ sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update);
+ sid->PCMfreq = device->machine().sample_rate();
sid->clock = device->clock();
sid->ad_read = iface ? iface->ad_read : NULL;
sid->type = sidtype;
@@ -71,7 +71,7 @@ static DEVICE_START( sid8580 )
READ8_DEVICE_HANDLER ( sid6581_r )
{
- return sid6581_port_r(device->machine, get_sid(device), offset);
+ return sid6581_port_r(device->machine(), get_sid(device), offset);
}
diff --git a/src/emu/sound/sidvoice.c b/src/emu/sound/sidvoice.c
index 32387b569bc..59da4ed3ba6 100644
--- a/src/emu/sound/sidvoice.c
+++ b/src/emu/sound/sidvoice.c
@@ -25,7 +25,7 @@ static INT8* ampMod1x8;
static const UINT32 noiseSeed = 0x7ffff8;
-void sidInitMixerEngine(running_machine *machine)
+void sidInitMixerEngine(running_machine &machine)
{
UINT16 uk;
INT32 si, sj ;
diff --git a/src/emu/sound/sidvoice.h b/src/emu/sound/sidvoice.h
index fbf1fd00369..58e6ca856b5 100644
--- a/src/emu/sound/sidvoice.h
+++ b/src/emu/sound/sidvoice.h
@@ -106,7 +106,7 @@ void sidEmuSet2(sidOperator* pVoice);
INT8 sidWaveCalcNormal(sidOperator* pVoice);
void sidInitWaveformTables(SIDTYPE type);
-void sidInitMixerEngine(running_machine *machine);
+void sidInitMixerEngine(running_machine &machine);
#if 0
extern ptr2sidVoidFunc sid6581ModeNormalTable[16];
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index 15852105526..1c62f699fa9 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -253,7 +253,7 @@ struct _sn76477_state
/* others */
sound_stream *channel; /* returned by stream_create() */
- int sample_rate; /* from machine->sample_rate() */
+ int sample_rate; /* from machine.sample_rate() */
device_t *device;
wav_file *file; /* handle of the wave file to produce */
@@ -1988,13 +1988,13 @@ static STREAM_UPDATE( SN76477_update )
#if TEST_MODE
- static int recursing = 0; /* we need to prevent recursion since enable_w calls input_code_pressed_once(device->machine, KEYCODE_SPACE->update */
+ static int recursing = 0; /* we need to prevent recursion since enable_w calls input_code_pressed_once(device->machine(), KEYCODE_SPACE->update */
if () && !recursing)
{
recursing = 1;
- device->machine->sound().system_enable();
+ device->machine().sound().system_enable();
SN76477_test_enable_w(sn, !sn->enable);
}
@@ -2406,7 +2406,7 @@ static DEVICE_START( sn76477 )
sn->device = device;
- sn->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sn, SN76477_update);
+ sn->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), sn, SN76477_update);
if (device->clock() > 0)
{
@@ -2414,7 +2414,7 @@ static DEVICE_START( sn76477 )
}
else
{
- sn->sample_rate = device->machine->sample_rate();
+ sn->sample_rate = device->machine().sample_rate();
}
intialize_noise(sn);
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index e3d66fbed62..826f4e7866a 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -360,7 +360,7 @@ static int SN76496_init(device_t *device, sn76496_state *R, int stereo)
int sample_rate = device->clock()/2;
int i;
- R->Channel = device->machine->sound().stream_alloc(*device,0,(stereo?2:1),sample_rate,R,SN76496Update);
+ R->Channel = device->machine().sound().stream_alloc(*device,0,(stereo?2:1),sample_rate,R,SN76496Update);
for (i = 0;i < 4;i++) R->Volume[i] = 0;
diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c
index b2ccc46b1f7..20efad91663 100644
--- a/src/emu/sound/snkwave.c
+++ b/src/emu/sound/snkwave.c
@@ -119,7 +119,7 @@ static DEVICE_START( snkwave )
chip->sample_rate = chip->external_clock >> CLOCK_SHIFT;
/* get stream channels */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, snkwave_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, snkwave_update);
/* reset all the voices */
chip->frequency = 0;
diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c
index fb6110eb67e..9c5f6367869 100644
--- a/src/emu/sound/sp0250.c
+++ b/src/emu/sound/sp0250.c
@@ -208,10 +208,10 @@ static DEVICE_START( sp0250 )
if (sp->drq != NULL)
{
sp->drq(sp->device, ASSERT_LINE);
- device->machine->scheduler().timer_pulse(attotime::from_hz(device->clock()) * CLOCK_DIVIDER, FUNC(sp0250_timer_tick), 0, sp);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(device->clock()) * CLOCK_DIVIDER, FUNC(sp0250_timer_tick), 0, sp);
}
- sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
+ sp->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
}
@@ -226,7 +226,7 @@ WRITE8_DEVICE_HANDLER( sp0250_w )
sp->drq(sp->device, CLEAR_LINE);
}
else
- logerror("%s: overflow SP0250 FIFO\n", device->machine->describe_context());
+ logerror("%s: overflow SP0250 FIFO\n", device->machine().describe_context());
}
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 7481c9d48e9..914a601a9e5 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -1186,7 +1186,7 @@ static DEVICE_START( sp0256 )
devcb_call_write_line(&sp->drq, 1);
devcb_call_write_line(&sp->sby, 1);
- sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
+ sp->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
/* -------------------------------------------------------------------- */
/* Configure our internal variables. */
@@ -1196,7 +1196,7 @@ static DEVICE_START( sp0256 )
/* -------------------------------------------------------------------- */
/* Allocate a scratch buffer for generating ~10kHz samples. */
/* -------------------------------------------------------------------- */
- sp->scratch = auto_alloc_array(device->machine, INT16, SCBUF_SIZE);
+ sp->scratch = auto_alloc_array(device->machine(), INT16, SCBUF_SIZE);
sp->sc_head = sp->sc_tail = 0;
/* -------------------------------------------------------------------- */
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c
index fd43eade776..54f13bfa9f2 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -140,7 +140,7 @@ static DEVICE_START( speaker )
int i;
double x;
- sp->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sp, speaker_sound_update);
+ sp->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), sp, speaker_sound_update);
if (intf != NULL)
{
@@ -159,8 +159,8 @@ static DEVICE_START( speaker )
for (i = 0; i < FILTER_LENGTH; i++)
sp->composed_volume[i] = 0;
sp->composed_sample_index = 0;
- sp->last_update_time = device->machine->time();
- sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine->sample_rate());
+ sp->last_update_time = device->machine().time();
+ sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine().sample_rate());
sp->channel_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->channel_sample_period);
sp->interm_sample_period = sp->channel_sample_period / RATE_MULTIPLIER;
sp->interm_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->interm_sample_period);
@@ -275,7 +275,7 @@ void speaker_level_w(device_t *device, int new_level)
new_level = sp->num_levels - 1;
volume = sp->levels[sp->level];
- time = device->machine->time();
+ time = device->machine().time();
if (time < sp->channel_next_sample_time)
{
diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c
index 4ffbe31f845..e64f58f4e3a 100644
--- a/src/emu/sound/spu.c
+++ b/src/emu/sound/spu.c
@@ -285,7 +285,7 @@ device_config *spu_device_config::static_alloc_device_config(const machine_confi
device_t *spu_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, spu_device(machine, *this));
+ return auto_alloc(machine, spu_device(machine, *this));
}
class adpcm_decoder
@@ -3121,18 +3121,18 @@ void spu_device::flush_cdda(const unsigned int sector)
// MAME I/O stuff. This can get cleaner when machine/psx.c does.
-static void spu_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void spu_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- spu_device *spu = machine->device<spu_device>("spu");
- UINT8 *psxram = (UINT8 *)memory_get_shared(*machine, "share1");
+ spu_device *spu = machine.device<spu_device>("spu");
+ UINT8 *psxram = (UINT8 *)memory_get_shared(machine, "share1");
spu->start_dma(psxram + n_address, false, n_size*4);
}
-static void spu_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void spu_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- spu_device *spu = machine->device<spu_device>("spu");
- UINT8 *psxram = (UINT8 *)memory_get_shared(*machine, "share1");
+ spu_device *spu = machine.device<spu_device>("spu");
+ UINT8 *psxram = (UINT8 *)memory_get_shared(machine, "share1");
// printf("SPU DMA write from %x, size %x\n", n_address, n_size);
@@ -3141,12 +3141,12 @@ static void spu_dma_write( running_machine *machine, UINT32 n_address, INT32 n_s
READ16_HANDLER( spu_r )
{
- spu_device *spu = space->machine->device<spu_device>("spu");
+ spu_device *spu = space->machine().device<spu_device>("spu");
if (!spu->installed_dma_hooks)
{
- psx_dma_install_read_handler(space->machine, 4, spu_dma_read);
- psx_dma_install_write_handler(space->machine, 4, spu_dma_write);
+ psx_dma_install_read_handler(space->machine(), 4, spu_dma_read);
+ psx_dma_install_write_handler(space->machine(), 4, spu_dma_write);
spu->installed_dma_hooks = true;
}
@@ -3155,12 +3155,12 @@ READ16_HANDLER( spu_r )
WRITE16_HANDLER( spu_w )
{
- spu_device *spu = space->machine->device<spu_device>("spu");
+ spu_device *spu = space->machine().device<spu_device>("spu");
if (!spu->installed_dma_hooks)
{
- psx_dma_install_read_handler(space->machine, 4, spu_dma_read);
- psx_dma_install_write_handler(space->machine, 4, spu_dma_write);
+ psx_dma_install_read_handler(space->machine(), 4, spu_dma_read);
+ psx_dma_install_write_handler(space->machine(), 4, spu_dma_write);
spu->installed_dma_hooks = true;
}
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index c4473995127..dd9e41ed651 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -142,7 +142,7 @@ static DEVICE_START( st0016 )
info->sound_ram = intf->p_soundram;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, st0016_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, st0016_update);
}
diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c
index 864f31a3d0f..8f03adaa0aa 100644
--- a/src/emu/sound/t6w28.c
+++ b/src/emu/sound/t6w28.c
@@ -309,7 +309,7 @@ static int t6w28_init(device_t *device, t6w28_state *R)
int sample_rate = device->clock()/16;
int i;
- R->Channel = device->machine->sound().stream_alloc(*device,0,2,sample_rate,R,t6w28_update);
+ R->Channel = device->machine().sound().stream_alloc(*device,0,2,sample_rate,R,t6w28_update);
R->SampleRate = sample_rate;
diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c
index cd3091ef3d7..8c977c5c102 100644
--- a/src/emu/sound/tiaintf.c
+++ b/src/emu/sound/tiaintf.c
@@ -28,7 +28,7 @@ static DEVICE_START( tia )
{
tia_state *info = get_safe_token(device);
- info->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
info->chip = tia_sound_init(device->clock(), device->clock(), 16);
assert_always(info->chip != NULL, "Error creating TIA chip");
diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c
index d8d8ceb92d5..5c263335fee 100644
--- a/src/emu/sound/tms3615.c
+++ b/src/emu/sound/tms3615.c
@@ -89,7 +89,7 @@ static DEVICE_START( tms3615 )
{
tms_state *tms = get_safe_token(device);
- tms->channel = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
+ tms->channel = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
tms->samplerate = device->clock()/8;
tms->basefreq = device->clock();
}
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index 6d1e4635f73..e9c70baacdc 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -500,7 +500,7 @@ static DEVICE_START( tms36xx )
tms->intf = (const tms36xx_interface *)device->baseconfig().static_config();
- tms->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
+ tms->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
tms->samplerate = device->clock() * 64;
tms->basefreq = device->clock();
enable = 0;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 09f34a1b124..11b04ad2998 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -1031,7 +1031,7 @@ static DEVICE_START( tms5110 )
devcb_resolve_read_line(&tms->data_func, &tms->intf->data_func, device);
/* initialize a stream */
- tms->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5110_update);
+ tms->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5110_update);
if (tms->table == NULL)
{
@@ -1048,7 +1048,7 @@ static DEVICE_START( tms5110 )
}
tms->state = CTL_STATE_INPUT; /* most probably not defined */
- tms->romclk_hack_timer = device->machine->scheduler().timer_alloc(FUNC(romclk_hack_timer_cb), (void *) device);
+ tms->romclk_hack_timer = device->machine().scheduler().timer_alloc(FUNC(romclk_hack_timer_cb), (void *) device);
register_for_save_states(tms);
}
@@ -1415,13 +1415,13 @@ static DEVICE_START( tmsprom )
tms->rom = *device->region();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No rom region found");
- tms->prom = device->machine->region(tms->intf->prom_region)->base();
+ tms->prom = device->machine().region(tms->intf->prom_region)->base();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No prom region found");
tms->device = device;
tms->clock = device->clock();
- tms->romclk_timer = device->machine->scheduler().timer_alloc(FUNC(tmsprom_step), device);
+ tms->romclk_timer = device->machine().scheduler().timer_alloc(FUNC(tmsprom_step), device);
tms->romclk_timer->adjust(attotime::zero, 0, attotime::from_hz(tms->clock));
tms->bit = 0;
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index 0ad9576a78b..06969db03ca 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -1518,7 +1518,7 @@ static DEVICE_START( tms5220 )
devcb_resolve_write_line(&tms->readyq_func, &tms->intf->readyq_func, device);
/* initialize a stream */
- tms->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5220_update);
+ tms->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5220_update);
/*if (tms->table == NULL)
{
@@ -1696,7 +1696,7 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w )
tms->io_ready = 0;
update_ready_state(tms);
/* How long does /READY stay inactive, when /RS is pulled low? I believe its almost always ~16 clocks (25 usec at 800khz as shown on the datasheet) */
- tms->device->machine->scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~11?) cycles to complete
+ tms->device->machine().scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~11?) cycles to complete
}
}
}
@@ -1759,7 +1759,7 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w )
SET RATE (5220C only): ? cycles (probably ~16)
*/
// TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles
- tms->device->machine->scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
+ tms->device->machine().scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
}
}
}
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index 7d6fffa2991..f5bd40697cb 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -628,7 +628,7 @@ static void register_for_save(upd7759_state *chip, device_t *device)
device->save_item(NAME(chip->sample));
device->save_item(NAME(chip->romoffset));
- device->machine->state().register_postload(upd7759_postload, chip);
+ device->machine().state().register_postload(upd7759_postload, chip);
}
@@ -641,7 +641,7 @@ static DEVICE_START( upd7759 )
chip->device = device;
/* allocate a stream channel */
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update);
/* compute the stepping rate based on the chip's clock speed */
chip->step = 4 * FRAC_ONE;
@@ -655,7 +655,7 @@ static DEVICE_START( upd7759 )
/* compute the ROM base or allocate a timer */
chip->rom = chip->rombase = *device->region();
if (chip->rom == NULL)
- chip->timer = device->machine->scheduler().timer_alloc(FUNC(upd7759_slave_update), chip);
+ chip->timer = device->machine().scheduler().timer_alloc(FUNC(upd7759_slave_update), chip);
/* set the DRQ callback */
chip->drqcallback = intf->drqcallback;
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 351233f72ad..634c3cca5f9 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -47,7 +47,7 @@ RST not only resets the chip on its rising edge but grabs a byte of mode state d
9bit DAC is composed of 5bit Physical and 3bitPWM.
todo:
- Noise Generator circuit without 'machine->rand()' function.
+ Noise Generator circuit without 'machine.rand()' function.
----------- command format (Analytical result) ----------
@@ -410,7 +410,7 @@ static STREAM_UPDATE( vlm5030_update_callback )
}
else if (chip->old_pitch <= 1)
{ /* generate unvoiced samples here */
- current_val = (chip->device->machine->rand()&1) ? chip->current_energy : -chip->current_energy;
+ current_val = (chip->device->machine().rand()&1) ? chip->current_energy : -chip->current_energy;
}
else
{
@@ -703,7 +703,7 @@ static DEVICE_START( vlm5030 )
else
chip->address_mask = chip->intf->memory_size-1;
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, emulation_rate,chip,vlm5030_update_callback);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, emulation_rate,chip,vlm5030_update_callback);
/* don't restore "UINT8 *chip->rom" when use vlm5030_set_rom() */
@@ -726,7 +726,7 @@ static DEVICE_START( vlm5030 )
device->save_item(NAME(chip->target_pitch));
device->save_item(NAME(chip->target_k));
device->save_item(NAME(chip->x));
- device->machine->state().register_postload(vlm5030_restore_state, chip);
+ device->machine().state().register_postload(vlm5030_restore_state, chip);
}
diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c
index adfb1e212ff..176d7cf537f 100644
--- a/src/emu/sound/votrax.c
+++ b/src/emu/sound/votrax.c
@@ -113,11 +113,11 @@ static DEVICE_START( votrax )
votrax_state *votrax = get_safe_token(device);
votrax->device = device;
- votrax->samples = readsamples(device->machine,VotraxTable,"votrax");
+ votrax->samples = readsamples(device->machine(),VotraxTable,"votrax");
votrax->frequency = 8000;
votrax->volume = 230;
- votrax->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), votrax, votrax_update_sound);
+ votrax->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), votrax, votrax_update_sound);
votrax->sample = NULL;
votrax->step = 0;
@@ -144,7 +144,7 @@ WRITE8_DEVICE_HANDLER( votrax_w )
info->sample = &info->samples->sample[Phoneme];
info->pos = 0;
info->frac = 0;
- info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine->sample_rate();
+ info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine().sample_rate();
info->channel->set_output_gain(0, (info->volume + (8*Intonation)*100/255) / 100.0);
}
}
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index 46ca52ed6ae..e39d049fc26 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -110,7 +110,7 @@ static DEVICE_START( vrender0 )
memcpy(&(VR0->Intf),intf,sizeof(vr0_interface));
memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS));
- VR0->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, VR0, VR0_Update);
+ VR0->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, VR0, VR0_Update);
device->save_item(NAME(VR0->SOUNDREGS));
}
diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c
index 42b7f724da3..86bbd429361 100644
--- a/src/emu/sound/wave.c
+++ b/src/emu/sound/wave.c
@@ -22,7 +22,7 @@
static STREAM_UPDATE( wave_sound_update )
{
device_image_interface *image = (device_image_interface *)param;
- int speakers = image->device().machine->m_devicelist.count(SPEAKER);
+ int speakers = image->device().machine().m_devicelist.count(SPEAKER);
cassette_image *cassette;
cassette_state state;
double time_index;
@@ -39,7 +39,7 @@ static STREAM_UPDATE( wave_sound_update )
{
cassette = cassette_get_image(&image->device());
time_index = cassette_get_position(&image->device());
- duration = ((double) samples) / image->device().machine->sample_rate();
+ duration = ((double) samples) / image->device().machine().sample_rate();
cassette_get_samples(cassette, 0, time_index, duration, samples, 2, left_buffer, CASSETTE_WAVEFORM_16BIT);
if (speakers > 1)
@@ -68,12 +68,12 @@ static DEVICE_START( wave )
assert( device != NULL );
assert( device->baseconfig().static_config() != NULL );
- int speakers = device->machine->config().m_devicelist.count(SPEAKER);
- image = dynamic_cast<device_image_interface *>(device->machine->device( (const char *)device->baseconfig().static_config()));
+ int speakers = device->machine().config().m_devicelist.count(SPEAKER);
+ image = dynamic_cast<device_image_interface *>(device->machine().device( (const char *)device->baseconfig().static_config()));
if (speakers > 1)
- device->machine->sound().stream_alloc(*device, 0, 2, device->machine->sample_rate(), (void *)image, wave_sound_update);
+ device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), (void *)image, wave_sound_update);
else
- device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *)image, wave_sound_update);
+ device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *)image, wave_sound_update);
}
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 2bdc309ffd0..c4d446e0173 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -216,7 +216,7 @@ static DEVICE_START( x1_010 )
LOG_SOUND(("masterclock = %d rate = %d\n", device->clock(), info->rate ));
/* get stream channels */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,info->rate,info,seta_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,info->rate,info,seta_update);
}
@@ -255,7 +255,7 @@ WRITE8_DEVICE_HANDLER( seta_sound_w )
info->smp_offset[channel] = 0;
info->env_offset[channel] = 0;
}
- LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine->describe_context(), offset, data ));
+ LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine().describe_context(), offset, data ));
info->reg[offset] = data;
}
@@ -271,7 +271,7 @@ READ16_DEVICE_HANDLER( seta_sound_word_r )
ret = info->HI_WORD_BUF[offset]<<8;
ret += (seta_sound_r( device, offset )&0xff);
- LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, ret ));
+ LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, ret ));
return ret;
}
@@ -280,7 +280,7 @@ WRITE16_DEVICE_HANDLER( seta_sound_word_w )
x1_010_state *info = get_safe_token(device);
info->HI_WORD_BUF[offset] = (data>>8)&0xff;
seta_sound_w( device, offset, data&0xff );
- LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, data ));
+ LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, data ));
}
diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c
index 924790fea68..dd092c5b3ba 100644
--- a/src/emu/sound/ym2151.c
+++ b/src/emu/sound/ym2151.c
@@ -824,7 +824,7 @@ static TIMER_CALLBACK( timer_callback_a )
if (chip->irq_enable & 0x04)
{
chip->status |= 1;
- machine->scheduler().timer_set(attotime::zero, FUNC(irqAon_callback), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(irqAon_callback), 0, chip);
}
if (chip->irq_enable & 0x80)
chip->csm_req = 2; /* request KEY ON / KEY OFF sequence */
@@ -837,7 +837,7 @@ static TIMER_CALLBACK( timer_callback_b )
if (chip->irq_enable & 0x08)
{
chip->status |= 2;
- machine->scheduler().timer_set(attotime::zero, FUNC(irqBon_callback), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(irqBon_callback), 0, chip);
}
}
#if 0
@@ -1098,7 +1098,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
{
#ifdef USE_MAME_TIMERS
chip->status &= ~1;
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(irqAoff_callback), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(irqAoff_callback), 0, chip);
#else
int oldstate = chip->status & 3;
chip->status &= ~1;
@@ -1110,7 +1110,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
{
#ifdef USE_MAME_TIMERS
chip->status &= ~2;
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(irqBoff_callback), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(irqBoff_callback), 0, chip);
#else
int oldstate = chip->status & 3;
chip->status &= ~2;
@@ -1485,7 +1485,7 @@ static void ym2151_state_save_register( YM2151 *chip, device_t *device )
device->save_item(NAME(chip->connect));
- device->machine->state().register_postload(ym2151_postload, chip);
+ device->machine().state().register_postload(ym2151_postload, chip);
}
#else
STATE_POSTLOAD( ym2151_postload )
@@ -1509,7 +1509,7 @@ void * ym2151_init(device_t *device, int clock, int rate)
{
YM2151 *PSG;
- PSG = auto_alloc(device->machine, YM2151);
+ PSG = auto_alloc(device->machine(), YM2151);
memset(PSG, 0, sizeof(YM2151));
@@ -1533,8 +1533,8 @@ void * ym2151_init(device_t *device, int clock, int rate)
#ifdef USE_MAME_TIMERS
/* this must be done _before_ a call to ym2151_reset_chip() */
- PSG->timer_A = device->machine->scheduler().timer_alloc(FUNC(timer_callback_a), PSG);
- PSG->timer_B = device->machine->scheduler().timer_alloc(FUNC(timer_callback_b), PSG);
+ PSG->timer_A = device->machine().scheduler().timer_alloc(FUNC(timer_callback_a), PSG);
+ PSG->timer_B = device->machine().scheduler().timer_alloc(FUNC(timer_callback_b), PSG);
#else
PSG->tim_A = 0;
PSG->tim_B = 0;
@@ -1546,7 +1546,7 @@ void * ym2151_init(device_t *device, int clock, int rate)
{
cymfile = fopen("2151_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 2151_.cym\n");
}
@@ -1560,7 +1560,7 @@ void ym2151_shutdown(void *_chip)
{
YM2151 *chip = (YM2151 *)_chip;
- auto_free (chip->device->machine, chip);
+ auto_free (chip->device->machine(), chip);
if (cymfile)
fclose (cymfile);
diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c
index 68992390a33..7aaf447e99b 100644
--- a/src/emu/sound/ym2413.c
+++ b/src/emu/sound/ym2413.c
@@ -1940,7 +1940,7 @@ static int OPLL_LockTable(device_t *device)
{
cymfile = fopen("2413_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 2413_.cym\n");
}
@@ -2011,7 +2011,7 @@ static YM2413 *OPLLCreate(device_t *device, int clock, int rate)
if (OPLL_LockTable(device) == -1) return NULL;
/* allocate memory block */
- chip = auto_alloc_clear(device->machine, YM2413);
+ chip = auto_alloc_clear(device->machine(), YM2413);
chip->device = device;
chip->clock = clock;
@@ -2029,7 +2029,7 @@ static YM2413 *OPLLCreate(device_t *device, int clock, int rate)
static void OPLLDestroy(YM2413 *chip)
{
OPLL_UnLockTable();
- auto_free(chip->device->machine, chip);
+ auto_free(chip->device->machine(), chip);
}
/* Option handlers */
diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c
index 0d6ab4d9353..e6ea783f58f 100644
--- a/src/emu/sound/ymf262.c
+++ b/src/emu/sound/ymf262.c
@@ -2268,7 +2268,7 @@ static int OPL3_LockTable(device_t *device)
{
cymfile = fopen("ymf262_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create ymf262_.cym file\n");
}
@@ -2341,7 +2341,7 @@ static OPL3 *OPL3Create(device_t *device, int clock, int rate, int type)
if (OPL3_LockTable(device) == -1) return NULL;
/* allocate memory block */
- chip = auto_alloc_clear(device->machine, OPL3);
+ chip = auto_alloc_clear(device->machine(), OPL3);
chip->device = device;
chip->type = type;
@@ -2360,7 +2360,7 @@ static OPL3 *OPL3Create(device_t *device, int clock, int rate, int type)
static void OPL3Destroy(OPL3 *chip)
{
OPL3_UnLockTable();
- auto_free(chip->device->machine, chip);
+ auto_free(chip->device->machine(), chip);
}
diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c
index 3a476785612..043fb6f60c4 100644
--- a/src/emu/sound/ymf271.c
+++ b/src/emu/sound/ymf271.c
@@ -1589,7 +1589,7 @@ READ8_DEVICE_HANDLER( ymf271_r )
return 0;
}
-static void init_tables(running_machine *machine)
+static void init_tables(running_machine &machine)
{
int i,j;
@@ -1752,8 +1752,8 @@ static void init_state(YMF271Chip *chip, device_t *device)
static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(device_t *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write)
{
- chip->timA = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip);
- chip->timB = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip);
+ chip->timA = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip);
+ chip->timB = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip);
chip->rom = rom;
chip->irq_callback = cb;
@@ -1761,7 +1761,7 @@ static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*c
devcb_resolve_read8(&chip->ext_mem_read, ext_read, device);
devcb_resolve_write8(&chip->ext_mem_write, ext_write, device);
- init_tables(device->machine);
+ init_tables(device->machine());
init_state(chip, device);
}
@@ -1778,7 +1778,7 @@ static DEVICE_START( ymf271 )
intf = (device->baseconfig().static_config() != NULL) ? (const ymf271_interface *)device->baseconfig().static_config() : &defintrf;
ymf271_init(device, chip, *device->region(), intf->irq_callback, &intf->ext_read, &intf->ext_write);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
for (i = 0; i < 256; i++)
{
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index 7584588fffa..c0a116b1854 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -340,7 +340,7 @@ static STREAM_UPDATE( ymf278b_pcm_update )
}
}
-static void ymf278b_irq_check(running_machine *machine, YMF278BChip *chip)
+static void ymf278b_irq_check(running_machine &machine, YMF278BChip *chip)
{
int prev_line = chip->irq_line;
chip->irq_line = chip->current_irq ? ASSERT_LINE : CLEAR_LINE;
@@ -398,7 +398,7 @@ static void ymf278b_timer_b_reset(YMF278BChip *chip)
chip->timer_b->adjust(attotime::never);
}
-static void ymf278b_A_w(running_machine *machine, YMF278BChip *chip, UINT8 reg, UINT8 data)
+static void ymf278b_A_w(running_machine &machine, YMF278BChip *chip, UINT8 reg, UINT8 data)
{
switch(reg)
{
@@ -620,7 +620,7 @@ READ8_DEVICE_HANDLER( ymf278b_r )
return chip->current_irq | (chip->irq_line == ASSERT_LINE ? 0x80 : 0x00);
default:
- logerror("%s: unexpected read at offset %X from ymf278b\n", device->machine->describe_context(), offset);
+ logerror("%s: unexpected read at offset %X from ymf278b\n", device->machine().describe_context(), offset);
break;
}
return 0xff;
@@ -637,7 +637,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w )
break;
case 1:
- ymf278b_A_w(device->machine, chip, chip->port_A, data);
+ ymf278b_A_w(device->machine(), chip, chip->port_A, data);
break;
case 2:
@@ -657,7 +657,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w )
break;
default:
- logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", device->machine->describe_context(), offset, data);
+ logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", device->machine().describe_context(), offset, data);
break;
}
}
@@ -666,8 +666,8 @@ static void ymf278b_init(device_t *device, YMF278BChip *chip, void (*cb)(device_
{
chip->rom = *device->region();
chip->irq_callback = cb;
- chip->timer_a = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip);
- chip->timer_b = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_b_tick), chip);
+ chip->timer_a = device->machine().scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip);
+ chip->timer_b = device->machine().scheduler().timer_alloc(FUNC(ymf278b_timer_b_tick), chip);
chip->irq_line = CLEAR_LINE;
chip->clock = device->clock();
}
@@ -741,7 +741,7 @@ static DEVICE_START( ymf278b )
intf = (device->baseconfig().static_config() != NULL) ? (const ymf278b_interface *)device->baseconfig().static_config() : &defintrf;
ymf278b_init(device, chip, intf->irq_callback);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
// Volume table, 1 = -0.375dB, 8 = -3dB, 256 = -96dB
for(i = 0; i < 256; i++)
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index f363b80d98b..04f7938dae3 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -205,7 +205,7 @@ static STATE_POSTLOAD( YMZ280B_state_save_update_step )
struct YMZ280BVoice *voice = &chip->voice[j];
update_step(chip, voice);
if(voice->irq_schedule)
- machine->scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[j]), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[j]), 0, chip);
}
}
@@ -581,7 +581,7 @@ static STREAM_UPDATE( ymz280b_update )
voice->playing = 0;
/* set update_irq_state_timer. IRQ is signaled on next CPU execution. */
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[v]), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[v]), 0, chip);
voice->irq_schedule = 1;
}
}
@@ -651,10 +651,10 @@ static DEVICE_START( ymz280b )
chip->irq_callback = intf->irq_callback;
/* create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);
/* allocate memory */
- chip->scratch = auto_alloc_array(device->machine, INT16, MAX_SAMPLE_CHUNK);
+ chip->scratch = auto_alloc_array(device->machine(), INT16, MAX_SAMPLE_CHUNK);
/* state save */
{
@@ -694,7 +694,7 @@ static DEVICE_START( ymz280b )
}
}
- device->machine->state().register_postload(YMZ280B_state_save_update_step, chip);
+ device->machine().state().register_postload(YMZ280B_state_save_update_step, chip);
#if MAKE_WAVS
chip->wavresample = wav_open("resamp.wav", INTERNAL_SAMPLE_RATE, 2);
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index 7f5f99a3a04..28be392d6aa 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -226,9 +226,9 @@ static DEVICE_START( zsg2 )
memset(&info->zc, 0, sizeof(info->zc));
memset(&info->act, 0, sizeof(info->act));
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, info->sample_rate, info, update_stereo);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, info->sample_rate, info, update_stereo);
- info->bank_samples = device->machine->region(intf->samplergn)->base();
+ info->bank_samples = device->machine().region(intf->samplergn)->base();
}
/**************************************************************************
diff --git a/src/emu/speaker.c b/src/emu/speaker.c
index 924f2dab582..052a581a676 100644
--- a/src/emu/speaker.c
+++ b/src/emu/speaker.c
@@ -99,7 +99,7 @@ device_config *speaker_device_config::static_alloc_device_config(const machine_c
device_t *speaker_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, speaker_device(machine, *this));
+ return auto_alloc(machine, speaker_device(machine, *this));
}
@@ -170,7 +170,7 @@ void speaker_device::device_start()
}
// allocate the mixer stream
- m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, machine->sample_rate());
+ m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, m_machine.sample_rate());
}
diff --git a/src/emu/state.c b/src/emu/state.c
index a56f3a25528..1e5577addbc 100644
--- a/src/emu/state.c
+++ b/src/emu/state.c
@@ -162,7 +162,7 @@ void state_manager::register_presave(prepost_func func, void *param)
fatalerror("Duplicate save state function (%p, %p)", param, func);
// allocate a new entry
- m_presave_list.append(*auto_alloc(&m_machine, state_callback(func, param)));
+ m_presave_list.append(*auto_alloc(m_machine, state_callback(func, param)));
}
@@ -183,7 +183,7 @@ void state_manager::register_postload(prepost_func func, void *param)
fatalerror("Duplicate save state function (%p, %p)", param, func);
// allocate a new entry
- m_postload_list.append(*auto_alloc(&m_machine, state_callback(func, param)));
+ m_postload_list.append(*auto_alloc(m_machine, state_callback(func, param)));
}
@@ -228,7 +228,7 @@ void state_manager::save_memory(const char *module, const char *tag, UINT32 inde
}
// insert us into the list
- m_entry_list.insert_after(*auto_alloc(&m_machine, state_entry(val, totalname, valsize, valcount)), insert_after);
+ m_entry_list.insert_after(*auto_alloc(m_machine, state_entry(val, totalname, valsize, valcount)), insert_after);
}
@@ -237,12 +237,11 @@ void state_manager::save_memory(const char *module, const char *tag, UINT32 inde
// state
//-------------------------------------------------
-state_save_error state_manager::check_file(running_machine *machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
+state_save_error state_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
{
// if we want to validate the signature, compute it
UINT32 sig = 0;
- if (machine != NULL)
- sig = machine->state().signature();
+ sig = machine.state().signature();
// seek to the beginning and read the header
file.compress(FCOMPRESS_NONE);
@@ -300,7 +299,7 @@ state_save_error state_manager::read_file(emu_file &file)
// call the post-load functions
for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next())
- (*func->m_func)(&m_machine, func->m_param);
+ (*func->m_func)(m_machine, func->m_param);
return STATERR_NONE;
}
@@ -334,7 +333,7 @@ state_save_error state_manager::write_file(emu_file &file)
// call the pre-save functions
for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next())
- (*func->m_func)(&m_machine, func->m_param);
+ (*func->m_func)(m_machine, func->m_param);
// then write all the data
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
diff --git a/src/emu/state.h b/src/emu/state.h
index 8b22f1b990c..dacfef66673 100644
--- a/src/emu/state.h
+++ b/src/emu/state.h
@@ -68,20 +68,20 @@ enum state_save_error
//**************************************************************************
// macros to declare presave/postload functions with the appropriate parameters
-#define STATE_PRESAVE(name) void name(running_machine *machine, void *param)
-#define STATE_POSTLOAD(name) void name(running_machine *machine, void *param)
+#define STATE_PRESAVE(name) void name(running_machine &machine, void *param)
+#define STATE_POSTLOAD(name) void name(running_machine &machine, void *param)
// templates to assume the 'param' of a presave/postload function is a class pointer
template<class T, void (T::*func)()>
-void state_presave_stub(running_machine *machine, void *param)
+void state_presave_stub(running_machine &machine, void *param)
{
T *target = reinterpret_cast<T *>(param);
(target->*func)();
}
template<class T, void (T::*func)()>
-void state_postload_stub(running_machine *machine, void *param)
+void state_postload_stub(running_machine &machine, void *param)
{
T *target = reinterpret_cast<T *>(param);
(target->*func)();
@@ -97,37 +97,37 @@ void state_postload_stub(running_machine *machine, void *param)
// register items with explicit tags
#define state_save_register_item(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_pointer(_mach, _mod, _tag, _index, _val, _count) \
- (_mach)->state().save_pointer(_mod, _tag, _index, _val, #_val, _count)
+ (_mach).state().save_pointer(_mod, _tag, _index, _val, #_val, _count)
#define state_save_register_item_array(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_2d_array(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_bitmap(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, *(_val), #_val)
+ (_mach).state().save_item(_mod, _tag, _index, *(_val), #_val)
// register global items
#define state_save_register_global(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_pointer(_mach, _val, _count) \
- (_mach)->state().save_pointer(_val, #_val, _count)
+ (_mach).state().save_pointer(_val, #_val, _count)
#define state_save_register_global_array(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_2d_array(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_bitmap(_mach, _val) \
- (_mach)->state().save_item(*(_val), #_val)
+ (_mach).state().save_item(*(_val), #_val)
@@ -142,7 +142,7 @@ class state_manager
template<typename T> struct type_checker<T*> { static const bool is_atom = false; static const bool is_pointer = true; };
public:
- typedef void (*prepost_func)(running_machine *machine, void *param);
+ typedef void (*prepost_func)(running_machine &machine, void *param);
// construction/destruction
state_manager(running_machine &machine);
@@ -202,7 +202,7 @@ public:
void save_pointer(T *value, const char *valname, UINT32 count, int index = 0) { save_pointer("global", NULL, index, value, valname, count); }
// file processing
- static state_save_error check_file(running_machine *machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...));
+ static state_save_error check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...));
state_save_error write_file(emu_file &file);
state_save_error read_file(emu_file &file);
diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c
index 41e3e48a604..014779c1b6f 100644
--- a/src/emu/tilemap.c
+++ b/src/emu/tilemap.c
@@ -67,8 +67,10 @@ struct _blit_parameters
/* core tilemap structure */
struct _tilemap_t
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
tilemap_t * next; /* pointer to next tilemap */
- running_machine * machine; /* pointer back to the owning machine */
+ running_machine * m_machine; /* pointer back to the owning machine */
/* basic tilemap metrics */
UINT32 rows; /* number of tile rows */
@@ -135,7 +137,7 @@ struct _tilemap_private
***************************************************************************/
/* system management helpers */
-static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
+static tilemap_t *tilemap_create_common(running_machine &machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
static void tilemap_exit(running_machine &machine);
static STATE_POSTLOAD( tilemap_postload );
static void tilemap_dispose(tilemap_t *tmap);
@@ -238,12 +240,12 @@ INLINE INT32 effective_colscroll(tilemap_t *tmap, int index, UINT32 screen_heigh
indexed_tilemap - return a tilemap by index
-------------------------------------------------*/
-INLINE tilemap_t *indexed_tilemap(running_machine *machine, int index)
+INLINE tilemap_t *indexed_tilemap(running_machine &machine, int index)
{
tilemap_t *tmap;
/* find by the tilemap index */
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
if (index-- == 0)
return tmap;
@@ -266,9 +268,9 @@ INLINE int gfx_elements_changed(tilemap_t *tmap)
/* iterate over all used gfx types and set the dirty flag if any of them have changed */
for (gfxnum = 0; usedmask != 0; usedmask >>= 1, gfxnum++)
if ((usedmask & 1) != 0)
- if (tmap->gfx_dirtyseq[gfxnum] != tmap->machine->gfx[gfxnum]->dirtyseq)
+ if (tmap->gfx_dirtyseq[gfxnum] != tmap->machine().gfx[gfxnum]->dirtyseq)
{
- tmap->gfx_dirtyseq[gfxnum] = tmap->machine->gfx[gfxnum]->dirtyseq;
+ tmap->gfx_dirtyseq[gfxnum] = tmap->machine().gfx[gfxnum]->dirtyseq;
isdirty = TRUE;
}
@@ -284,20 +286,20 @@ INLINE int gfx_elements_changed(tilemap_t *tmap)
tilemap_init - initialize the tilemap system
-------------------------------------------------*/
-void tilemap_init(running_machine *machine)
+void tilemap_init(running_machine &machine)
{
UINT32 screen_width, screen_height;
- if (machine->primary_screen == NULL)
+ if (machine.primary_screen == NULL)
return;
- screen_width = machine->primary_screen->width();
- screen_height = machine->primary_screen->height();
+ screen_width = machine.primary_screen->width();
+ screen_height = machine.primary_screen->height();
if (screen_width != 0 && screen_height != 0)
{
- machine->priority_bitmap = auto_bitmap_alloc(machine, screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, tilemap_exit);
+ machine.priority_bitmap = auto_bitmap_alloc(machine, screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, tilemap_exit);
}
}
@@ -311,9 +313,9 @@ void tilemap_init(running_machine *machine)
tilemap_create - create a new tilemap
-------------------------------------------------*/
-tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
+tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
- return tilemap_create_common(machine, (void *)machine, tile_get_info, mapper, tilewidth, tileheight, cols, rows);
+ return tilemap_create_common(machine, (void *)&machine, tile_get_info, mapper, tilewidth, tileheight, cols, rows);
}
@@ -324,7 +326,7 @@ tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_
tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
- return tilemap_create_common(device->machine, (void *)device, (tile_get_info_func)tile_get_info, mapper, tilewidth, tileheight, cols, rows);
+ return tilemap_create_common(device->machine(), (void *)device, (tile_get_info_func)tile_get_info, mapper, tilewidth, tileheight, cols, rows);
}
@@ -333,25 +335,25 @@ tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func til
function
-------------------------------------------------*/
-static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
+static tilemap_t *tilemap_create_common(running_machine &machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
tilemap_t *tmap;
int tilemap_instance;
int group;
/* if no tilemap private data yet, allocate it */
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
{
- machine->tilemap_data = auto_alloc_clear(machine, tilemap_private);
- machine->tilemap_data->tailptr = &machine->tilemap_data->list;
+ machine.tilemap_data = auto_alloc_clear(machine, tilemap_private);
+ machine.tilemap_data->tailptr = &machine.tilemap_data->list;
}
- tilemap_instance = machine->tilemap_data->instance;
+ tilemap_instance = machine.tilemap_data->instance;
/* allocate the tilemap itself */
tmap = auto_alloc_clear(machine, tilemap_t);
/* fill in the basic metrics */
- tmap->machine = machine;
+ tmap->m_machine = &machine;
tmap->rows = rows;
tmap->cols = cols;
tmap->tilewidth = tilewidth;
@@ -392,26 +394,26 @@ static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info
tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
/* add us to the end of the list of tilemaps */
- *machine->tilemap_data->tailptr = tmap;
- machine->tilemap_data->tailptr = &tmap->next;
+ *machine.tilemap_data->tailptr = tmap;
+ machine.tilemap_data->tailptr = &tmap->next;
/* save relevant state */
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->enable));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->attributes));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->palette_offset));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->pen_data_offset));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollrows));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollcols));
- machine->state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->rowscroll), rows * tileheight);
- machine->state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->colscroll), cols * tilewidth);
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx_flipped));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy_flipped));
- machine->tilemap_data->instance++;
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->enable));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->attributes));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->palette_offset));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->pen_data_offset));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollrows));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollcols));
+ machine.state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->rowscroll), rows * tileheight);
+ machine.state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->colscroll), cols * tilewidth);
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx_flipped));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy_flipped));
+ machine.tilemap_data->instance++;
/* reset everything after a load */
- machine->state().register_postload(tilemap_postload, tmap);
+ machine.state().register_postload(tilemap_postload, tmap);
return tmap;
}
@@ -482,14 +484,14 @@ void tilemap_set_flip(tilemap_t *tmap, UINT32 attributes)
the tilemaps
-------------------------------------------------*/
-void tilemap_set_flip_all(running_machine *machine, UINT32 attributes)
+void tilemap_set_flip_all(running_machine &machine, UINT32 attributes)
{
tilemap_t *tmap;
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
return;
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
tilemap_set_flip(tmap, attributes);
}
@@ -539,10 +541,10 @@ void tilemap_mark_all_tiles_dirty(tilemap_t *tmap)
tiles in all the tilemaps dirty
-------------------------------------------------*/
-void tilemap_mark_all_tiles_dirty_all(running_machine *machine)
+void tilemap_mark_all_tiles_dirty_all(running_machine &machine)
{
tilemap_t *tmap;
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
tilemap_mark_all_tiles_dirty(tmap);
}
@@ -836,8 +838,8 @@ g_profiler.start(PROFILER_TILEMAP_DRAW);
tmap->gfx_used = 0;
}
- width = tmap->machine->primary_screen->width();
- height = tmap->machine->primary_screen->height();
+ width = tmap->machine().primary_screen->width();
+ height = tmap->machine().primary_screen->height();
/* XY scrolling playfield */
if (tmap->scrollrows == 1 && tmap->scrollcols == 1)
@@ -984,16 +986,16 @@ g_profiler.stop();
tilemap_count - return the number of tilemaps
-------------------------------------------------*/
-int tilemap_count(running_machine *machine)
+int tilemap_count(running_machine &machine)
{
tilemap_t *tmap;
int count = 0;
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
return 0;
/* find by the tilemap index */
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
count++;
return count;
}
@@ -1004,7 +1006,7 @@ int tilemap_count(running_machine *machine)
indexed tilemap
-------------------------------------------------*/
-void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width, UINT32 *height)
+void tilemap_size_by_index(running_machine &machine, int number, UINT32 *width, UINT32 *height)
{
tilemap_t *tmap = indexed_tilemap(machine, number);
*width = tmap->width;
@@ -1018,7 +1020,7 @@ void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width,
priority)
-------------------------------------------------*/
-void tilemap_draw_by_index(running_machine *machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly)
+void tilemap_draw_by_index(running_machine &machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly)
{
tilemap_t *tmap = indexed_tilemap(machine, number);
blit_parameters blit;
@@ -1156,7 +1158,7 @@ static void tilemap_dispose(tilemap_t *tmap)
tilemap_t **tmapptr;
/* walk the list of tilemaps; when we find ourself, remove it */
- for (tmapptr = &tmap->machine->tilemap_data->list; *tmapptr != NULL; tmapptr = &(*tmapptr)->next)
+ for (tmapptr = &tmap->machine().tilemap_data->list; *tmapptr != NULL; tmapptr = &(*tmapptr)->next)
if (*tmapptr == tmap)
{
*tmapptr = tmap->next;
@@ -1164,15 +1166,15 @@ static void tilemap_dispose(tilemap_t *tmap)
}
/* free allocated memory */
- auto_free(tmap->machine, tmap->pen_to_flags);
- auto_free(tmap->machine, tmap->tileflags);
- auto_free(tmap->machine, tmap->flagsmap);
- auto_free(tmap->machine, tmap->pixmap);
- auto_free(tmap->machine, tmap->colscroll);
- auto_free(tmap->machine, tmap->rowscroll);
- auto_free(tmap->machine, tmap->logical_to_memory);
- auto_free(tmap->machine, tmap->memory_to_logical);
- auto_free(tmap->machine, tmap);
+ auto_free(tmap->machine(), tmap->pen_to_flags);
+ auto_free(tmap->machine(), tmap->tileflags);
+ auto_free(tmap->machine(), tmap->flagsmap);
+ auto_free(tmap->machine(), tmap->pixmap);
+ auto_free(tmap->machine(), tmap->colscroll);
+ auto_free(tmap->machine(), tmap->rowscroll);
+ auto_free(tmap->machine(), tmap->logical_to_memory);
+ auto_free(tmap->machine(), tmap->memory_to_logical);
+ auto_free(tmap->machine(), tmap);
}
@@ -1204,8 +1206,8 @@ static void mappings_create(tilemap_t *tmap)
tmap->max_memory_index++;
/* allocate the necessary mappings */
- tmap->memory_to_logical = auto_alloc_array(tmap->machine, tilemap_logical_index, tmap->max_memory_index);
- tmap->logical_to_memory = auto_alloc_array(tmap->machine, tilemap_memory_index, tmap->max_logical_index);
+ tmap->memory_to_logical = auto_alloc_array(tmap->machine(), tilemap_logical_index, tmap->max_memory_index);
+ tmap->logical_to_memory = auto_alloc_array(tmap->machine(), tilemap_memory_index, tmap->max_logical_index);
/* update the mappings */
mappings_update(tmap);
@@ -1333,7 +1335,7 @@ g_profiler.start(PROFILER_TILEMAP_UPDATE);
/* call the get info callback for the associated memory index */
memindex = tmap->logical_to_memory[logindex];
- (*tmap->tile_get_info)((running_machine *)tmap->tile_get_info_object, &tmap->tileinfo, memindex, tmap->user_data);
+ (*tmap->tile_get_info)(*(running_machine *)tmap->tile_get_info_object, &tmap->tileinfo, memindex, tmap->user_data);
/* apply the global tilemap flip to the returned flip flags */
flags = tmap->tileinfo.flags ^ (tmap->attributes & 0x03);
@@ -1350,7 +1352,7 @@ g_profiler.start(PROFILER_TILEMAP_UPDATE);
if (tmap->tileinfo.gfxnum != 0xff && (tmap->gfx_used & (1 << tmap->tileinfo.gfxnum)) == 0)
{
tmap->gfx_used |= 1 << tmap->tileinfo.gfxnum;
- tmap->gfx_dirtyseq[tmap->tileinfo.gfxnum] = tmap->machine->gfx[tmap->tileinfo.gfxnum]->dirtyseq;
+ tmap->gfx_dirtyseq[tmap->tileinfo.gfxnum] = tmap->machine().gfx[tmap->tileinfo.gfxnum]->dirtyseq;
}
g_profiler.stop();
@@ -1615,7 +1617,7 @@ static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bi
static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit, int xpos, int ypos)
{
- bitmap_t *priority_bitmap = tmap->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = tmap->machine().priority_bitmap;
bitmap_t *dest = blit->bitmap;
const UINT16 *source_baseaddr;
const UINT8 *mask_baseaddr;
@@ -1724,7 +1726,7 @@ static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit,
{
for (cury = y; cury < nexty; cury++)
{
- (*blit->draw_opaque)(dest0, source0, x_end - x_start, tmap->machine->pens, pmap0, blit->tilemap_priority_code, blit->alpha);
+ (*blit->draw_opaque)(dest0, source0, x_end - x_start, tmap->machine().pens, pmap0, blit->tilemap_priority_code, blit->alpha);
dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
source0 += tmap->pixmap->rowpixels;
@@ -1738,7 +1740,7 @@ static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit,
const UINT8 *mask0 = mask_baseaddr + x_start;
for (cury = y; cury < nexty; cury++)
{
- (*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, tmap->machine->pens, pmap0, blit->tilemap_priority_code, blit->alpha);
+ (*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, tmap->machine().pens, pmap0, blit->tilemap_priority_code, blit->alpha);
dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
source0 += tmap->pixmap->rowpixels;
@@ -1794,8 +1796,8 @@ do { \
static void tilemap_draw_roz_core(tilemap_t *tmap, const blit_parameters *blit,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound)
{
- const pen_t *clut = &tmap->machine->pens[blit->tilemap_priority_code >> 16];
- bitmap_t *priority_bitmap = tmap->machine->priority_bitmap;
+ const pen_t *clut = &tmap->machine().pens[blit->tilemap_priority_code >> 16];
+ bitmap_t *priority_bitmap = tmap->machine().priority_bitmap;
bitmap_t *destbitmap = blit->bitmap;
bitmap_t *srcbitmap = tmap->pixmap;
bitmap_t *flagsmap = tmap->flagsmap;
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 9c83c91ff47..0f9b750b05d 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -173,7 +173,7 @@
// set the common info for the tile
SET_TILE_INFO(
- 1, // use machine->gfx[1] for tile graphics
+ 1, // use machine.gfx[1] for tile graphics
code, // the index of the graphics for this tile
color, // the color to use for this tile
(flipx ? TILE_FLIPX : 0) | // flags for this tile; also
@@ -354,7 +354,7 @@
***************************************************************************/
/* function definition for a get info callback */
-#define TILE_GET_INFO(_name) void _name(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
+#define TILE_GET_INFO(_name) void _name(running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
#define TILE_GET_INFO_DEVICE(_name) void _name(device_t *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
/* function definition for a logical-to-memory mapper */
@@ -362,7 +362,7 @@
/* useful macro inside of a TILE_GET_INFO callback to set tile information */
#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo_set(machine, tileinfo, GFX, CODE, COLOR, FLAGS)
-#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo_set(device->machine, tileinfo, GFX, CODE, COLOR, FLAGS)
+#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo_set(device->machine(), tileinfo, GFX, CODE, COLOR, FLAGS)
/* Macros for setting tile attributes in the TILE_GET_INFO callback: */
/* TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0 */
@@ -394,12 +394,12 @@ struct _tile_data
UINT8 group; /* defaults to 0; range from 0..TILEMAP_NUM_GROUPS */
UINT8 flags; /* defaults to 0; one or more of TILE_* flags above */
UINT8 pen_mask; /* defaults to 0xff; mask to apply to pen_data while rendering the tile */
- UINT8 gfxnum; /* defaults to 0xff; specify index of machine->gfx for auto-invalidation on dirty */
+ UINT8 gfxnum; /* defaults to 0xff; specify index of machine.gfx for auto-invalidation on dirty */
};
/* callback function to get info about a tile */
-typedef void (*tile_get_info_func)(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
+typedef void (*tile_get_info_func)(running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
typedef void (*tile_get_info_device_func)(device_t *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
/* callback function to map a column,row pair to a memory index */
@@ -415,14 +415,14 @@ typedef tilemap_memory_index (*tilemap_mapper_func)(UINT32 col, UINT32 row, UINT
/* ----- system-wide management ----- */
/* initialize the tilemap system -- not for use by drivers */
-void tilemap_init(running_machine *machine);
+void tilemap_init(running_machine &machine);
/* ----- tilemap creation and configuration ----- */
/* create a new tilemap; note that tilemaps are tracked by the core so there is no dispose */
-tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
+tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
/* create a new tilemap that is owned by a device */
tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
@@ -446,7 +446,7 @@ int tilemap_get_enable(tilemap_t *tmap);
void tilemap_set_flip(tilemap_t *tmap, UINT32 attributes);
/* set a global flip for all tilemaps */
-void tilemap_set_flip_all(running_machine *machine, UINT32 attributes);
+void tilemap_set_flip_all(running_machine &machine, UINT32 attributes);
@@ -459,7 +459,7 @@ void tilemap_mark_tile_dirty(tilemap_t *tmap, tilemap_memory_index memory_index)
void tilemap_mark_all_tiles_dirty(tilemap_t *tmap);
/* mark all the tiles dirty in all tilemaps */
-void tilemap_mark_all_tiles_dirty_all(running_machine *machine);
+void tilemap_mark_all_tiles_dirty_all(running_machine &machine);
@@ -531,13 +531,13 @@ void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle *cliprect, tilemap
/* ----- indexed tilemap handling ----- */
/* return the number of tilemaps */
-int tilemap_count(running_machine *machine);
+int tilemap_count(running_machine &machine);
/* return the size of an indexed tilemap */
-void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width, UINT32 *height);
+void tilemap_size_by_index(running_machine &machine, int number, UINT32 *width, UINT32 *height);
/* render an indexed tilemap with fixed characteristics (no priority) */
-void tilemap_draw_by_index(running_machine *machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly);
+void tilemap_draw_by_index(running_machine &machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly);
@@ -566,9 +566,9 @@ TILEMAP_MAPPER( tilemap_scan_cols_flip_xy );
structure
-------------------------------------------------*/
-INLINE void tileinfo_set(running_machine *machine, tile_data *tileinfo, int gfxnum, int rawcode, int rawcolor, int flags)
+INLINE void tileinfo_set(running_machine &machine, tile_data *tileinfo, int gfxnum, int rawcode, int rawcolor, int flags)
{
- const gfx_element *gfx = machine->gfx[gfxnum];
+ const gfx_element *gfx = machine.gfx[gfxnum];
int code = rawcode % gfx->total_elements;
tileinfo->pen_data = gfx_element_get_data(gfx, code);
tileinfo->palette_base = gfx->color_base + gfx->color_granularity * rawcolor;
diff --git a/src/emu/timer.c b/src/emu/timer.c
index bc9a4e8d396..eb4a2020ef9 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -100,7 +100,7 @@ device_config *timer_device_config::static_alloc_device_config(const machine_con
device_t *timer_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, timer_device(machine, *this));
+ return auto_alloc(machine, timer_device(machine, *this));
}
@@ -280,7 +280,7 @@ void timer_device::device_start()
{
// fetch the screen
if (m_config.m_screen != NULL)
- m_screen = downcast<screen_device *>(machine->device(m_config.m_screen));
+ m_screen = downcast<screen_device *>(m_machine.device(m_config.m_screen));
// allocate the timer
m_timer = timer_alloc();
diff --git a/src/emu/ui.c b/src/emu/ui.c
index 6fa9834c12d..61110734aca 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -93,7 +93,7 @@ static const input_item_id non_char_keys[] =
static render_font *ui_font;
/* current UI handler */
-static UINT32 (*ui_handler_callback)(running_machine *, render_container *, UINT32);
+static UINT32 (*ui_handler_callback)(running_machine &, render_container *, UINT32);
static UINT32 ui_handler_param;
/* flag to track single stepping */
@@ -129,42 +129,42 @@ static UINT8 non_char_keys_down[(ARRAY_LENGTH(non_char_keys) + 7) / 8];
static void ui_exit(running_machine &machine);
/* text generators */
-static astring &disclaimer_string(running_machine *machine, astring &buffer);
-static astring &warnings_string(running_machine *machine, astring &buffer);
+static astring &disclaimer_string(running_machine &machine, astring &buffer);
+static astring &warnings_string(running_machine &machine, astring &buffer);
/* UI handlers */
-static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state);
/* slider controls */
-static slider_state *slider_alloc(running_machine *machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
-static slider_state *slider_init(running_machine *machine);
-static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval);
+static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
+static slider_state *slider_init(running_machine &machine);
+static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval);
static char *slider_get_screen_desc(screen_device &screen);
static char *slider_get_laserdisc_desc(device_t *screen);
#ifdef MAME_DEBUG
-static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
#endif
@@ -177,7 +177,7 @@ static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *st
pair for the current UI handler
-------------------------------------------------*/
-INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, render_container *, UINT32), UINT32 param)
+INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine &, render_container *, UINT32), UINT32 param)
{
ui_handler_callback = callback;
ui_handler_param = param;
@@ -234,10 +234,10 @@ INLINE int is_breakable_char(unicode_char ch)
ui_init - set up the user interface
-------------------------------------------------*/
-int ui_init(running_machine *machine)
+int ui_init(running_machine &machine)
{
/* make sure we clean up after ourselves */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_exit);
/* initialize the other UI bits */
ui_menu_init(machine);
@@ -247,7 +247,7 @@ int ui_init(running_machine *machine)
single_step = FALSE;
ui_set_handler(handler_messagebox, 0);
/* retrieve options */
- ui_use_natural_keyboard = machine->options().natural_keyboard();
+ ui_use_natural_keyboard = machine.options().natural_keyboard();
return 0;
}
@@ -270,17 +270,17 @@ static void ui_exit(running_machine &machine)
various startup screens
-------------------------------------------------*/
-int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer)
+int ui_display_startup_screens(running_machine &machine, int first_time, int show_disclaimer)
{
const int maxstate = 3;
- int str = machine->options().seconds_to_run();
- int show_gameinfo = !machine->options().skip_gameinfo();
+ int str = machine.options().seconds_to_run();
+ int show_gameinfo = !machine.options().skip_gameinfo();
int show_warnings = TRUE;
int state;
/* disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,
or if we are debugging */
- if (!first_time || (str > 0 && str < 60*5) || &machine->system() == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (!first_time || (str > 0 && str < 60*5) || &machine.system() == &GAME_NAME(empty) || (machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
show_gameinfo = show_warnings = show_disclaimer = FALSE;
/* initialize the on-screen display system */
@@ -288,7 +288,7 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
/* loop over states */
ui_set_handler(handler_ingame, 0);
- for (state = 0; state < maxstate && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select(); state++)
+ for (state = 0; state < maxstate && !machine.scheduled_event_pending() && !ui_menu_is_force_game_select(); state++)
{
/* default to standard colors */
messagebox_backcolor = UI_BACKGROUND_COLOR;
@@ -305,9 +305,9 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
if (show_warnings && warnings_string(machine, messagebox_text).len() > 0)
{
ui_set_handler(handler_messagebox_ok, 0);
- if (machine->system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
+ if (machine.system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
messagebox_backcolor = UI_YELLOW_COLOR;
- if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
+ if (machine.system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
messagebox_backcolor = UI_RED_COLOR;
}
break;
@@ -323,12 +323,12 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
while (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) ;
/* loop while we have a handler */
- while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
- machine->video().frame_update();
+ while (ui_handler_callback != handler_ingame && !machine.scheduled_event_pending() && !ui_menu_is_force_game_select())
+ machine.video().frame_update();
/* clear the handler and force an update */
ui_set_handler(handler_ingame, 0);
- machine->video().frame_update();
+ machine.video().frame_update();
}
/* if we're the empty driver, force the menus on */
@@ -344,7 +344,7 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
at startup
-------------------------------------------------*/
-void ui_set_startup_text(running_machine *machine, const char *text, int force)
+void ui_set_startup_text(running_machine &machine, const char *text, int force)
{
static osd_ticks_t lastupdatetime = 0;
osd_ticks_t curtime = osd_ticks();
@@ -357,7 +357,7 @@ void ui_set_startup_text(running_machine *machine, const char *text, int force)
if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4)
{
lastupdatetime = curtime;
- machine->video().frame_update();
+ machine.video().frame_update();
}
}
@@ -367,15 +367,15 @@ void ui_set_startup_text(running_machine *machine, const char *text, int force)
render it; called by video.c
-------------------------------------------------*/
-void ui_update_and_render(running_machine *machine, render_container *container)
+void ui_update_and_render(running_machine &machine, render_container *container)
{
/* always start clean */
container->empty();
/* if we're paused, dim the whole screen */
- if (machine->phase() >= MACHINE_PHASE_RESET && (single_step || machine->paused()))
+ if (machine.phase() >= MACHINE_PHASE_RESET && (single_step || machine.paused()))
{
- int alpha = (1.0f - machine->options().pause_brightness()) * 255.0f;
+ int alpha = (1.0f - machine.options().pause_brightness()) * 255.0f;
if (ui_menu_is_force_game_select())
alpha = 255;
if (alpha > 255)
@@ -385,8 +385,8 @@ void ui_update_and_render(running_machine *machine, render_container *container)
}
/* render any cheat stuff at the bottom */
- if (machine->phase() >= MACHINE_PHASE_RESET)
- machine->cheat().render_text(*container);
+ if (machine.phase() >= MACHINE_PHASE_RESET)
+ machine.cheat().render_text(*container);
/* call the current UI handler */
assert(ui_handler_callback != NULL);
@@ -880,10 +880,10 @@ int ui_is_menu_active(void)
text to the given buffer
-------------------------------------------------*/
-static astring &disclaimer_string(running_machine *machine, astring &string)
+static astring &disclaimer_string(running_machine &machine, astring &string)
{
string.cpy("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
- string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine->system().description);
+ string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine.system().description);
string.cat("Otherwise, type OK or move the joystick left then right to continue");
return string;
}
@@ -894,7 +894,7 @@ static astring &disclaimer_string(running_machine *machine, astring &string)
text to the given buffer
-------------------------------------------------*/
-static astring &warnings_string(running_machine *machine, astring &string)
+static astring &warnings_string(running_machine &machine, astring &string)
{
#define WARNING_FLAGS ( GAME_NOT_WORKING | \
GAME_UNEMULATED_PROTECTION | \
@@ -912,19 +912,19 @@ static astring &warnings_string(running_machine *machine, astring &string)
string.reset();
/* if no warnings, nothing to return */
- if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine->system().flags & WARNING_FLAGS))
+ if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine.system().flags & WARNING_FLAGS))
return string;
/* add a warning if any ROMs were loaded with warnings */
if (rom_load_warnings(machine) > 0)
{
string.cat("One or more ROMs/CHDs for this game are incorrect. The " GAMENOUN " may not run correctly.\n");
- if (machine->system().flags & WARNING_FLAGS)
+ if (machine.system().flags & WARNING_FLAGS)
string.cat("\n");
}
/* if we have at least one warning flag, print the general header */
- if ((machine->system().flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
+ if ((machine.system().flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
{
string.cat("There are known problems with this " GAMENOUN "\n\n");
@@ -935,46 +935,46 @@ static astring &warnings_string(running_machine *machine, astring &string)
/* add one line per warning flag */
if (input_machine_has_keyboard(machine))
string.cat("The keyboard emulation may not be 100% accurate.\n");
- if (machine->system().flags & GAME_IMPERFECT_COLORS)
+ if (machine.system().flags & GAME_IMPERFECT_COLORS)
string.cat("The colors aren't 100% accurate.\n");
- if (machine->system().flags & GAME_WRONG_COLORS)
+ if (machine.system().flags & GAME_WRONG_COLORS)
string.cat("The colors are completely wrong.\n");
- if (machine->system().flags & GAME_IMPERFECT_GRAPHICS)
+ if (machine.system().flags & GAME_IMPERFECT_GRAPHICS)
string.cat("The video emulation isn't 100% accurate.\n");
- if (machine->system().flags & GAME_IMPERFECT_SOUND)
+ if (machine.system().flags & GAME_IMPERFECT_SOUND)
string.cat("The sound emulation isn't 100% accurate.\n");
- if (machine->system().flags & GAME_NO_SOUND)
+ if (machine.system().flags & GAME_NO_SOUND)
string.cat("The game lacks sound.\n");
- if (machine->system().flags & GAME_NO_COCKTAIL)
+ if (machine.system().flags & GAME_NO_COCKTAIL)
string.cat("Screen flipping in cocktail mode is not supported.\n");
/* check if external artwork is present before displaying this warning? */
- if (machine->system().flags & GAME_REQUIRES_ARTWORK)
+ if (machine.system().flags & GAME_REQUIRES_ARTWORK)
string.cat("The game requires external artwork files\n");
/* if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger */
- if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
+ if (machine.system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
{
const game_driver *maindrv;
const game_driver *clone_of;
int foundworking;
/* add the strings for these warnings */
- if (machine->system().flags & GAME_UNEMULATED_PROTECTION)
+ if (machine.system().flags & GAME_UNEMULATED_PROTECTION)
string.cat("The game has protection which isn't fully emulated.\n");
- if (machine->system().flags & GAME_NOT_WORKING)
+ if (machine.system().flags & GAME_NOT_WORKING)
string.cat("\nTHIS " CAPGAMENOUN " DOESN'T WORK. The emulation for this game is not yet complete. "
"There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
- if (machine->system().flags & GAME_MECHANICAL)
+ if (machine.system().flags & GAME_MECHANICAL)
string.cat("\nCertain elements of this " GAMENOUN " cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
"It is not possible to fully play this " GAMENOUN ".\n");
/* find the parent of this driver */
- clone_of = driver_get_clone(&machine->system());
+ clone_of = driver_get_clone(&machine.system());
if (clone_of != NULL && !(clone_of->flags & GAME_IS_BIOS_ROOT))
maindrv = clone_of;
else
- maindrv = &machine->system();
+ maindrv = &machine.system();
/* scan the driver list for any working clones and add them */
foundworking = FALSE;
@@ -1007,17 +1007,17 @@ static astring &warnings_string(running_machine *machine, astring &string)
string with the game info text
-------------------------------------------------*/
-astring &game_info_astring(running_machine *machine, astring &string)
+astring &game_info_astring(running_machine &machine, astring &string)
{
- int scrcount = machine->m_devicelist.count(SCREEN);
+ int scrcount = machine.m_devicelist.count(SCREEN);
int found_sound = FALSE;
/* print description, manufacturer, and CPU: */
- string.printf("%s\n%s %s\n\nCPU:\n", machine->system().description, machine->system().year, machine->system().manufacturer);
+ string.printf("%s\n%s %s\n\nCPU:\n", machine.system().description, machine.system().year, machine.system().manufacturer);
/* loop over all CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
/* get cpu specific clock that takes internal multiplier/dividers into account */
int clock = exec->device().clock();
@@ -1047,7 +1047,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
/* loop over all sound chips */
device_sound_interface *sound = NULL;
- for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
/* append the Sound: string */
if (!found_sound)
@@ -1086,7 +1086,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
string.cat("None\n");
else
{
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
{
if (scrcount > 1)
{
@@ -1103,7 +1103,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
visarea.max_x - visarea.min_x + 1,
visarea.max_y - visarea.min_y + 1,
- (machine->system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
+ (machine.system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
}
}
@@ -1123,7 +1123,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
messagebox_text string but handles no input
-------------------------------------------------*/
-static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state)
{
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
return 0;
@@ -1135,7 +1135,7 @@ static UINT32 handler_messagebox(running_machine *machine, render_container *con
messagebox_text string and waits for an OK
-------------------------------------------------*/
-static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state)
{
/* draw a standard message window */
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
@@ -1151,7 +1151,7 @@ static UINT32 handler_messagebox_ok(running_machine *machine, render_container *
/* if the user cancels, exit out completely */
else if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
- machine->schedule_exit();
+ machine.schedule_exit();
state = UI_HANDLER_CANCEL;
}
@@ -1165,7 +1165,7 @@ static UINT32 handler_messagebox_ok(running_machine *machine, render_container *
any keypress
-------------------------------------------------*/
-static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state)
{
/* draw a standard message window */
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
@@ -1173,7 +1173,7 @@ static UINT32 handler_messagebox_anykey(running_machine *machine, render_contain
/* if the user cancels, exit out completely */
if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
- machine->schedule_exit();
+ machine.schedule_exit();
state = UI_HANDLER_CANCEL;
}
@@ -1189,7 +1189,7 @@ static UINT32 handler_messagebox_anykey(running_machine *machine, render_contain
natural keyboard input
-------------------------------------------------*/
-static void process_natural_keyboard(running_machine *machine)
+static void process_natural_keyboard(running_machine &machine)
{
ui_event event;
int i, pressed;
@@ -1240,7 +1240,7 @@ static void process_natural_keyboard(running_machine *machine)
ui_paste - does a paste from the keyboard
-------------------------------------------------*/
-void ui_paste(running_machine *machine)
+void ui_paste(running_machine &machine)
{
/* retrieve the clipboard text */
char *text = osd_get_clipboard_text();
@@ -1261,14 +1261,14 @@ void ui_paste(running_machine *machine)
callback function for each image device
-------------------------------------------------*/
-void ui_image_handler_ingame(running_machine *machine)
+void ui_image_handler_ingame(running_machine &machine)
{
device_image_interface *image = NULL;
/* run display routine for devices */
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (machine.phase() == MACHINE_PHASE_RUNNING)
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
image->call_display();
}
@@ -1281,15 +1281,15 @@ void ui_image_handler_ingame(running_machine *machine)
of the standard keypresses
-------------------------------------------------*/
-static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state)
{
- bool is_paused = machine->paused();
+ bool is_paused = machine.paused();
/* first draw the FPS counter */
if (showfps || osd_ticks() < showfps_end)
{
astring tempstring;
- ui_draw_text_full(container, machine->video().speed_text(tempstring), 0.0f, 0.0f, 1.0f,
+ ui_draw_text_full(container, machine.video().speed_text(tempstring), 0.0f, 0.0f, 1.0f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
else
@@ -1299,19 +1299,19 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (show_profiler)
{
astring profilertext;
- g_profiler.text(*machine, profilertext);
+ g_profiler.text(machine, profilertext);
ui_draw_text_full(container, profilertext, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
/* if we're single-stepping, pause now */
if (single_step)
{
- machine->pause();
+ machine.pause();
single_step = FALSE;
}
/* determine if we should disable the rest of the UI */
- int ui_disabled = (input_machine_has_keyboard(machine) && !machine->ui_active());
+ int ui_disabled = (input_machine_has_keyboard(machine) && !machine.ui_active());
/* is ScrLk UI toggling applicable here? */
if (input_machine_has_keyboard(machine))
@@ -1320,10 +1320,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
{
/* toggle the UI */
- machine->set_ui_active(!machine->ui_active());
+ machine.set_ui_active(!machine.ui_active());
/* display a popup indicating the new status */
- if (machine->ui_active())
+ if (machine.ui_active())
{
ui_popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
"Keyboard Emulation Status",
@@ -1347,7 +1347,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
}
/* is the natural keyboard enabled? */
- if (ui_get_use_natural_keyboard(machine) && (machine->phase() == MACHINE_PHASE_RUNNING))
+ if (ui_get_use_natural_keyboard(machine) && (machine.phase() == MACHINE_PHASE_RUNNING))
process_natural_keyboard(machine);
if (!ui_disabled)
@@ -1362,47 +1362,47 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_disabled) return ui_disabled;
if (ui_input_pressed(machine, IPT_UI_CANCEL))
- machine->schedule_exit();
+ machine.schedule_exit();
/* turn on menus if requested */
if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
return ui_set_handler(ui_menu_ui_handler, 0);
/* if the on-screen display isn't up and the user has toggled it, turn it on */
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
return ui_set_handler(ui_slider_ui_handler, 1);
/* handle a reset request */
if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
- machine->schedule_hard_reset();
+ machine.schedule_hard_reset();
if (ui_input_pressed(machine, IPT_UI_SOFT_RESET))
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
/* handle a request to display graphics/palette */
if (ui_input_pressed(machine, IPT_UI_SHOW_GFX))
{
if (!is_paused)
- machine->pause();
+ machine.pause();
return ui_set_handler(ui_gfx_ui_handler, is_paused);
}
/* handle a save state request */
if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
{
- machine->pause();
+ machine.pause();
return ui_set_handler(handler_load_save, LOADSAVE_SAVE);
}
/* handle a load state request */
if (ui_input_pressed(machine, IPT_UI_LOAD_STATE))
{
- machine->pause();
+ machine.pause();
return ui_set_handler(handler_load_save, LOADSAVE_LOAD);
}
/* handle a save snapshot request */
if (ui_input_pressed(machine, IPT_UI_SNAPSHOT))
- machine->video().save_active_screen_snapshots();
+ machine.video().save_active_screen_snapshots();
/* toggle pause */
if (ui_input_pressed(machine, IPT_UI_PAUSE))
@@ -1411,29 +1411,29 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (is_paused && (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)))
{
single_step = TRUE;
- machine->resume();
+ machine.resume();
}
- else if (machine->paused())
- machine->resume();
+ else if (machine.paused())
+ machine.resume();
else
- machine->pause();
+ machine.pause();
}
/* handle a toggle cheats request */
if (ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT))
- machine->cheat().set_enable(!machine->cheat().enabled());
+ machine.cheat().set_enable(!machine.cheat().enabled());
/* toggle movie recording */
if (ui_input_pressed(machine, IPT_UI_RECORD_MOVIE))
{
- if (!machine->video().is_recording())
+ if (!machine.video().is_recording())
{
- machine->video().begin_recording(NULL, video_manager::MF_MNG);
+ machine.video().begin_recording(NULL, video_manager::MF_MNG);
popmessage("REC START");
}
else
{
- machine->video().end_recording();
+ machine.video().end_recording();
popmessage("REC STOP");
}
}
@@ -1450,10 +1450,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_INC))
{
/* get the current value and increment it */
- int newframeskip = machine->video().frameskip() + 1;
+ int newframeskip = machine.video().frameskip() + 1;
if (newframeskip > MAX_FRAMESKIP)
newframeskip = -1;
- machine->video().set_frameskip(newframeskip);
+ machine.video().set_frameskip(newframeskip);
/* display the FPS counter for 2 seconds */
ui_show_fps_temp(2.0);
@@ -1463,10 +1463,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_DEC))
{
/* get the current value and decrement it */
- int newframeskip = machine->video().frameskip() - 1;
+ int newframeskip = machine.video().frameskip() - 1;
if (newframeskip < -1)
newframeskip = MAX_FRAMESKIP;
- machine->video().set_frameskip(newframeskip);
+ machine.video().set_frameskip(newframeskip);
/* display the FPS counter for 2 seconds */
ui_show_fps_temp(2.0);
@@ -1474,16 +1474,16 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
/* toggle throttle? */
if (ui_input_pressed(machine, IPT_UI_THROTTLE))
- machine->video().set_throttled(!machine->video().throttled());
+ machine.video().set_throttled(!machine.video().throttled());
/* check for fast forward */
if (input_type_pressed(machine, IPT_UI_FAST_FORWARD, 0))
{
- machine->video().set_fastforward(true);
+ machine.video().set_fastforward(true);
ui_show_fps_temp(0.5);
}
else
- machine->video().set_fastforward(false);
+ machine.video().set_fastforward(false);
return 0;
}
@@ -1494,7 +1494,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
specifying a game to save or load
-------------------------------------------------*/
-static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state)
{
char filename[20];
input_code code;
@@ -1520,7 +1520,7 @@ static UINT32 handler_load_save(running_machine *machine, render_container *cont
popmessage("Load cancelled");
/* reset the state */
- machine->resume();
+ machine.resume();
return UI_HANDLER_CANCEL;
}
@@ -1544,16 +1544,16 @@ static UINT32 handler_load_save(running_machine *machine, render_container *cont
if (state == LOADSAVE_SAVE)
{
popmessage("Save to position %c", file);
- machine->schedule_save(filename);
+ machine.schedule_save(filename);
}
else
{
popmessage("Load from position %c", file);
- machine->schedule_load(filename);
+ machine.schedule_load(filename);
}
/* remove the pause and reset the state */
- machine->resume();
+ machine.resume();
return UI_HANDLER_CANCEL;
}
@@ -1577,7 +1577,7 @@ const slider_state *ui_get_slider_list(void)
slider_alloc - allocate a new slider entry
-------------------------------------------------*/
-static slider_state *slider_alloc(running_machine *machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
+static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
{
int size = sizeof(slider_state) + strlen(title);
slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size);
@@ -1599,7 +1599,7 @@ static slider_state *slider_alloc(running_machine *machine, const char *title, I
controls
-------------------------------------------------*/
-static slider_state *slider_init(running_machine *machine)
+static slider_state *slider_init(running_machine &machine)
{
const input_field_config *field;
const input_port_config *port;
@@ -1615,7 +1615,7 @@ static slider_state *slider_init(running_machine *machine)
/* add per-channel volume */
speaker_input info;
- for (item = 0; machine->sound().indexed_speaker_input(item, info); item++)
+ for (item = 0; machine.sound().indexed_speaker_input(item, info); item++)
{
INT32 maxval = 2000;
INT32 defval = info.stream->initial_input_gain(info.inputnum) * 1000.0f + 0.5f;
@@ -1630,7 +1630,7 @@ static slider_state *slider_init(running_machine *machine)
}
/* add analog adjusters */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->type == IPT_ADJUSTER)
{
@@ -1640,10 +1640,10 @@ static slider_state *slider_init(running_machine *machine)
}
/* add CPU overclocking (cheat only) */
- if (machine->options().cheat())
+ if (machine.options().cheat())
{
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
void *param = (void *)&exec->device();
string.printf("Overclock CPU %s", exec->device().tag());
@@ -1653,7 +1653,7 @@ static slider_state *slider_init(running_machine *machine)
}
/* add screen parameters */
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
{
int defxscale = floor(screen->config().xscale() * 1000.0f + 0.5f);
int defyscale = floor(screen->config().yscale() * 1000.0f + 0.5f);
@@ -1662,7 +1662,7 @@ static slider_state *slider_init(running_machine *machine)
void *param = (void *)screen;
/* add refresh rate tweaker */
- if (machine->options().cheat())
+ if (machine.options().cheat())
{
string.printf("%s Refresh Rate", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, -10000, 0, 10000, 1000, slider_refresh, param);
@@ -1695,7 +1695,7 @@ static slider_state *slider_init(running_machine *machine)
tailptr = &(*tailptr)->next;
}
- for (device = machine->m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
+ for (device = machine.m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
{
const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
if (config->overupdate != NULL)
@@ -1722,7 +1722,7 @@ static slider_state *slider_init(running_machine *machine)
}
}
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
if (screen->screen_type() == SCREEN_TYPE_VECTOR)
{
/* add flicker control */
@@ -1735,7 +1735,7 @@ static slider_state *slider_init(running_machine *machine)
#ifdef MAME_DEBUG
/* add crosshair adjusters */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
{
@@ -1757,13 +1757,13 @@ static slider_state *slider_init(running_machine *machine)
slider_volume - global volume slider callback
-------------------------------------------------*/
-static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
- machine->sound().set_attenuation(newval);
+ machine.sound().set_attenuation(newval);
if (string != NULL)
- string->printf("%3ddB", machine->sound().attenuation());
- return machine->sound().attenuation();
+ string->printf("%3ddB", machine.sound().attenuation());
+ return machine.sound().attenuation();
}
@@ -1772,10 +1772,10 @@ static INT32 slider_volume(running_machine *machine, void *arg, astring *string,
slider callback
-------------------------------------------------*/
-static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval)
{
speaker_input info;
- if (!machine->sound().indexed_speaker_input((FPTR)arg, info))
+ if (!machine.sound().indexed_speaker_input((FPTR)arg, info))
return 0;
if (newval != SLIDER_NOCHANGE)
{
@@ -1794,7 +1794,7 @@ static INT32 slider_mixervol(running_machine *machine, void *arg, astring *strin
callback
-------------------------------------------------*/
-static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval)
{
const input_field_config *field = (const input_field_config *)arg;
input_field_user_settings settings;
@@ -1816,7 +1816,7 @@ static INT32 slider_adjuster(running_machine *machine, void *arg, astring *strin
callback
-------------------------------------------------*/
-static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *cpu = (device_t *)arg;
if (newval != SLIDER_NOCHANGE)
@@ -1831,7 +1831,7 @@ static INT32 slider_overclock(running_machine *machine, void *arg, astring *stri
slider_refresh - refresh rate slider callback
-------------------------------------------------*/
-static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
double defrefresh = ATTOSECONDS_TO_HZ(screen->config().refresh());
@@ -1845,8 +1845,8 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string
screen->configure(width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
}
if (string != NULL)
- string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds));
- refresh = ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds);
+ string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds));
+ refresh = ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds);
return floor((refresh - defrefresh) * 1000.0f + 0.5f);
}
@@ -1856,7 +1856,7 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1878,7 +1878,7 @@ static INT32 slider_brightness(running_machine *machine, void *arg, astring *str
callback
-------------------------------------------------*/
-static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1899,7 +1899,7 @@ static INT32 slider_contrast(running_machine *machine, void *arg, astring *strin
slider_gamma - screen gamma slider callback
-------------------------------------------------*/
-static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1921,7 +1921,7 @@ static INT32 slider_gamma(running_machine *machine, void *arg, astring *string,
callback
-------------------------------------------------*/
-static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1943,7 +1943,7 @@ static INT32 slider_xscale(running_machine *machine, void *arg, astring *string,
callback
-------------------------------------------------*/
-static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1965,7 +1965,7 @@ static INT32 slider_yscale(running_machine *machine, void *arg, astring *string,
slider callback
-------------------------------------------------*/
-static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1987,7 +1987,7 @@ static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string
slider callback
-------------------------------------------------*/
-static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -2009,7 +2009,7 @@ static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2031,7 +2031,7 @@ static INT32 slider_overxscale(running_machine *machine, void *arg, astring *str
callback
-------------------------------------------------*/
-static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2053,7 +2053,7 @@ static INT32 slider_overyscale(running_machine *machine, void *arg, astring *str
slider callback
-------------------------------------------------*/
-static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2075,7 +2075,7 @@ static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *st
slider callback
-------------------------------------------------*/
-static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2097,7 +2097,7 @@ static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *st
callback
-------------------------------------------------*/
-static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
vector_set_flicker((float)newval * 0.1f);
@@ -2112,7 +2112,7 @@ static INT32 slider_flicker(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
vector_set_beam((float)newval * 0.01f);
@@ -2129,7 +2129,7 @@ static INT32 slider_beam(running_machine *machine, void *arg, astring *string, I
static char *slider_get_screen_desc(screen_device &screen)
{
- int scrcount = screen.machine->m_devicelist.count(SCREEN);
+ int scrcount = screen.machine().m_devicelist.count(SCREEN);
static char descbuf[256];
if (scrcount > 1)
@@ -2148,7 +2148,7 @@ static char *slider_get_screen_desc(screen_device &screen)
static char *slider_get_laserdisc_desc(device_t *laserdisc)
{
- int ldcount = laserdisc->machine->m_devicelist.count(LASERDISC);
+ int ldcount = laserdisc->machine().m_devicelist.count(LASERDISC);
static char descbuf[256];
if (ldcount > 1)
@@ -2166,7 +2166,7 @@ static char *slider_get_laserdisc_desc(device_t *laserdisc)
-------------------------------------------------*/
#ifdef MAME_DEBUG
-static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
input_field_config *field = (input_field_config *)arg;
@@ -2185,7 +2185,7 @@ static INT32 slider_crossscale(running_machine *machine, void *arg, astring *str
-------------------------------------------------*/
#ifdef MAME_DEBUG
-static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
input_field_config *field = (input_field_config *)arg;
@@ -2203,7 +2203,7 @@ static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *st
whether the natural keyboard is active
-------------------------------------------------*/
-int ui_get_use_natural_keyboard(running_machine *machine)
+int ui_get_use_natural_keyboard(running_machine &machine)
{
return ui_use_natural_keyboard;
}
@@ -2215,11 +2215,11 @@ int ui_get_use_natural_keyboard(running_machine *machine)
whether the natural keyboard is active
-------------------------------------------------*/
-void ui_set_use_natural_keyboard(running_machine *machine, int use_natural_keyboard)
+void ui_set_use_natural_keyboard(running_machine &machine, int use_natural_keyboard)
{
ui_use_natural_keyboard = use_natural_keyboard;
astring error;
- machine->options().set_value(OPTION_NATURAL_KEYBOARD, use_natural_keyboard, OPTION_PRIORITY_CMDLINE, error);
+ machine.options().set_value(OPTION_NATURAL_KEYBOARD, use_natural_keyboard, OPTION_PRIORITY_CMDLINE, error);
assert(!error);
}
diff --git a/src/emu/ui.h b/src/emu/ui.h
index d4f35f6b569..6eb096032ec 100644
--- a/src/emu/ui.h
+++ b/src/emu/ui.h
@@ -91,7 +91,7 @@ enum
TYPE DEFINITIONS
***************************************************************************/
-typedef INT32 (*slider_update)(running_machine *machine, void *arg, astring *string, INT32 newval);
+typedef INT32 (*slider_update)(running_machine &machine, void *arg, astring *string, INT32 newval);
typedef struct _slider_state slider_state;
struct _slider_state
@@ -121,16 +121,16 @@ struct _slider_state
***************************************************************************/
/* main init/exit routines */
-int ui_init(running_machine *machine);
+int ui_init(running_machine &machine);
/* display the startup screens */
-int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer);
+int ui_display_startup_screens(running_machine &machine, int first_time, int show_disclaimer);
/* set the current text to display at startup */
-void ui_set_startup_text(running_machine *machine, const char *text, int force);
+void ui_set_startup_text(running_machine &machine, const char *text, int force);
/* once-per-frame update and render */
-void ui_update_and_render(running_machine *machine, render_container *container);
+void ui_update_and_render(running_machine &machine, render_container *container);
/* returns the current UI font */
render_font *ui_get_font(running_machine &machine);
@@ -173,18 +173,18 @@ void ui_show_menu(void);
int ui_is_menu_active(void);
/* print the game info string into a buffer */
-astring &game_info_astring(running_machine *machine, astring &string);
+astring &game_info_astring(running_machine &machine, astring &string);
/* get the list of sliders */
const slider_state *ui_get_slider_list(void);
/* paste */
-void ui_paste(running_machine *machine);
+void ui_paste(running_machine &machine);
/* returns whether the natural keyboard is active */
-int ui_get_use_natural_keyboard(running_machine *machine);
+int ui_get_use_natural_keyboard(running_machine &machine);
/* specifies whether the natural keyboard is active */
-void ui_set_use_natural_keyboard(running_machine *machine, int use_natural_keyboard);
+void ui_set_use_natural_keyboard(running_machine &machine, int use_natural_keyboard);
#endif /* __USRINTRF_H__ */
diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c
index 5b413e3fb03..2167be8a64b 100644
--- a/src/emu/uigfx.c
+++ b/src/emu/uigfx.c
@@ -79,19 +79,19 @@ static ui_gfx_state ui_gfx;
static void ui_gfx_exit(running_machine &machine);
/* palette handling */
-static void palette_handle_keys(running_machine *machine, ui_gfx_state *state);
-static void palette_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void palette_handle_keys(running_machine &machine, ui_gfx_state *state);
+static void palette_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
/* graphics set handling */
-static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, int xcells, int ycells);
-static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
-static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
-static void gfxset_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void gfxset_handle_keys(running_machine &machine, ui_gfx_state *state, int xcells, int ycells);
+static void gfxset_draw_item(running_machine &machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
+static void gfxset_update_bitmap(running_machine &machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
+static void gfxset_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
/* tilemap handling */
-static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, int viswidth, int visheight);
-static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height);
-static void tilemap_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void tilemap_handle_keys(running_machine &machine, ui_gfx_state *state, int viswidth, int visheight);
+static void tilemap_update_bitmap(running_machine &machine, ui_gfx_state *state, int width, int height);
+static void tilemap_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
@@ -103,13 +103,13 @@ static void tilemap_handler(running_machine *machine, render_container *containe
ui_gfx_init - initialize the menu system
-------------------------------------------------*/
-void ui_gfx_init(running_machine *machine)
+void ui_gfx_init(running_machine &machine)
{
ui_gfx_state *state = &ui_gfx;
int gfx;
/* make sure we clean up after ourselves */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_gfx_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_gfx_exit);
/* initialize our global state */
memset(state, 0, sizeof(*state));
@@ -120,12 +120,12 @@ void ui_gfx_init(running_machine *machine)
/* set up the graphics state */
for (gfx = 0; gfx < MAX_GFX_ELEMENTS; gfx++)
{
- state->gfxset.rotate[gfx] = machine->system().flags & ORIENTATION_MASK;
+ state->gfxset.rotate[gfx] = machine.system().flags & ORIENTATION_MASK;
state->gfxset.count[gfx] = 16;
}
/* set up the tilemap state */
- state->tilemap.rotate = machine->system().flags & ORIENTATION_MASK;
+ state->tilemap.rotate = machine.system().flags & ORIENTATION_MASK;
}
@@ -149,16 +149,16 @@ static void ui_gfx_exit(running_machine &machine)
ui_gfx_ui_handler - primary UI handler
-------------------------------------------------*/
-UINT32 ui_gfx_ui_handler(running_machine *machine, render_container *container, UINT32 uistate)
+UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
{
ui_gfx_state *state = &ui_gfx;
/* if we have nothing, implicitly cancel */
- if (machine->total_colors() == 0 && machine->colortable == NULL && machine->gfx[0] == NULL && tilemap_count(machine) == 0)
+ if (machine.total_colors() == 0 && machine.colortable == NULL && machine.gfx[0] == NULL && tilemap_count(machine) == 0)
goto cancel;
/* if we're not paused, mark the bitmap dirty */
- if (!machine->paused())
+ if (!machine.paused())
state->bitmap_dirty = TRUE;
/* switch off the state to display something */
@@ -167,7 +167,7 @@ again:
{
case 0:
/* if we have a palette, display it */
- if (machine->total_colors() > 0)
+ if (machine.total_colors() > 0)
{
palette_handler(machine, container, state);
break;
@@ -178,7 +178,7 @@ again:
case 1:
/* if we have graphics sets, display them */
- if (machine->gfx[0] != NULL)
+ if (machine.gfx[0] != NULL)
{
gfxset_handler(machine, container, state);
break;
@@ -208,10 +208,10 @@ again:
if (ui_input_pressed(machine, IPT_UI_PAUSE))
{
- if (machine->paused())
- machine->resume();
+ if (machine.paused())
+ machine.resume();
else
- machine->pause();
+ machine.pause();
}
if (ui_input_pressed(machine, IPT_UI_CANCEL) || ui_input_pressed(machine, IPT_UI_SHOW_GFX))
@@ -221,7 +221,7 @@ again:
cancel:
if (!uistate)
- machine->resume();
+ machine.resume();
state->bitmap_dirty = TRUE;
return UI_HANDLER_CANCEL;
}
@@ -237,12 +237,12 @@ cancel:
viewer
-------------------------------------------------*/
-static void palette_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void palette_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- int total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->total_colors();
+ int total = state->palette.which ? colortable_palette_get_size(machine.colortable) : machine.total_colors();
const char *title = state->palette.which ? "COLORTABLE" : "PALETTE";
- const rgb_t *raw_color = palette_entry_list_raw(machine->palette);
- render_font *ui_font = ui_get_font(*machine);
+ const rgb_t *raw_color = palette_entry_list_raw(machine.palette);
+ render_font *ui_font = ui_get_font(machine);
float cellwidth, cellheight;
float chwidth, chheight;
float titlewidth;
@@ -252,8 +252,8 @@ static void palette_handler(running_machine *machine, render_container *containe
int x, y, skip;
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -273,7 +273,7 @@ static void palette_handler(running_machine *machine, render_container *containe
cellboxbounds.y0 += 3.0f * chheight;
/* figure out the title and expand the outer box to fit */
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
x0 = 0.0f;
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
@@ -286,8 +286,8 @@ static void palette_handler(running_machine *machine, render_container *containe
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* compute the cell size */
@@ -300,7 +300,7 @@ static void palette_handler(running_machine *machine, render_container *containe
{
x0 = boxbounds.x0 + 6.0f * chwidth + (float)x * cellwidth;
y0 = boxbounds.y0 + 2.0f * chheight;
- container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
+ container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
/* if we're skipping, draw a point between the character and the box to indicate which */
/* one it's referring to */
@@ -328,8 +328,8 @@ static void palette_handler(running_machine *machine, render_container *containe
sprintf(buffer, "%5X", state->palette.offset + y * state->palette.count);
for (x = 4; x >= 0; x--)
{
- x0 -= ui_font->char_width(chheight, machine->render().ui_aspect(), buffer[x]);
- container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
+ x0 -= ui_font->char_width(chheight, machine.render().ui_aspect(), buffer[x]);
+ container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
}
}
@@ -340,7 +340,7 @@ static void palette_handler(running_machine *machine, render_container *containe
int index = state->palette.offset + y * state->palette.count + x;
if (index < total)
{
- pen_t pen = state->palette.which ? colortable_palette_get_color(machine->colortable, index) : raw_color[index];
+ pen_t pen = state->palette.which ? colortable_palette_get_color(machine.colortable, index) : raw_color[index];
container->add_rect(cellboxbounds.x0 + x * cellwidth, cellboxbounds.y0 + y * cellheight,
cellboxbounds.x0 + (x + 1) * cellwidth, cellboxbounds.y0 + (y + 1) * cellheight,
0xff000000 | pen, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@@ -357,7 +357,7 @@ static void palette_handler(running_machine *machine, render_container *containe
palette viewer
-------------------------------------------------*/
-static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
+static void palette_handle_keys(running_machine &machine, ui_gfx_state *state)
{
int rowcount, screencount;
int total;
@@ -383,11 +383,11 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
/* clamp within range */
if (state->palette.which < 0)
state->palette.which = 1;
- if (state->palette.which > (int)(machine->colortable != NULL))
- state->palette.which = (int)(machine->colortable != NULL);
+ if (state->palette.which > (int)(machine.colortable != NULL))
+ state->palette.which = (int)(machine.colortable != NULL);
/* cache some info in locals */
- total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->total_colors();
+ total = state->palette.which ? colortable_palette_get_size(machine.colortable) : machine.total_colors();
/* determine number of entries per row and total */
rowcount = state->palette.count;
@@ -425,11 +425,11 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
viewer
-------------------------------------------------*/
-static void gfxset_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void gfxset_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- render_font *ui_font = ui_get_font(*machine);
+ render_font *ui_font = ui_get_font(machine);
int set = state->gfxset.set;
- gfx_element *gfx = machine->gfx[set];
+ gfx_element *gfx = machine.gfx[set];
float fullwidth, fullheight;
float cellwidth, cellheight;
float chwidth, chheight;
@@ -439,8 +439,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
render_bounds cellboxbounds;
render_bounds boxbounds;
int cellboxwidth, cellboxheight;
- int targwidth = machine->render().ui_target().width();
- int targheight = machine->render().ui_target().height();
+ int targwidth = machine.render().ui_target().width();
+ int targheight = machine.render().ui_target().height();
int cellxpix, cellypix;
int xcells, ycells;
int pixelscale = 0;
@@ -448,8 +448,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
char title[100];
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -512,9 +512,9 @@ static void gfxset_handler(running_machine *machine, render_container *container
boxbounds.y1 = boxbounds.y0 + fullheight;
/* figure out the title and expand the outer box to fit */
- for (x = 0; x < MAX_GFX_ELEMENTS && machine->gfx[x] != NULL; x++) ;
+ for (x = 0; x < MAX_GFX_ELEMENTS && machine.gfx[x] != NULL; x++) ;
sprintf(title, "GFX %d/%d %dx%d COLOR %X", state->gfxset.set, x - 1, gfx->width, gfx->height, state->gfxset.color[set]);
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
x0 = 0.0f;
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
@@ -527,8 +527,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* draw the top column headers */
@@ -537,7 +537,7 @@ static void gfxset_handler(running_machine *machine, render_container *container
{
x0 = boxbounds.x0 + 6.0f * chwidth + (float)x * cellwidth;
y0 = boxbounds.y0 + 2.0f * chheight;
- container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
+ container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
/* if we're skipping, draw a point between the character and the box to indicate which */
/* one it's referring to */
@@ -565,8 +565,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
sprintf(buffer, "%5X", state->gfxset.offset[set] + y * xcells);
for (x = 4; x >= 0; x--)
{
- x0 -= ui_font->char_width(chheight, machine->render().ui_aspect(), buffer[x]);
- container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
+ x0 -= ui_font->char_width(chheight, machine.render().ui_aspect(), buffer[x]);
+ container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
}
}
@@ -589,7 +589,7 @@ static void gfxset_handler(running_machine *machine, render_container *container
graphics viewer
-------------------------------------------------*/
-static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, int xcells, int ycells)
+static void gfxset_handle_keys(running_machine &machine, ui_gfx_state *state, int xcells, int ycells)
{
ui_gfx_state oldstate = *state;
gfx_element *gfx;
@@ -599,7 +599,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
if (ui_input_pressed(machine, IPT_UI_PREV_GROUP))
{
for (temp = state->gfxset.set - 1; temp >= 0; temp--)
- if (machine->gfx[temp] != NULL)
+ if (machine.gfx[temp] != NULL)
break;
if (temp >= 0)
state->gfxset.set = temp;
@@ -607,7 +607,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
if (ui_input_pressed(machine, IPT_UI_NEXT_GROUP))
{
for (temp = state->gfxset.set + 1; temp < MAX_GFX_ELEMENTS; temp++)
- if (machine->gfx[temp] != NULL)
+ if (machine.gfx[temp] != NULL)
break;
if (temp < MAX_GFX_ELEMENTS)
state->gfxset.set = temp;
@@ -615,7 +615,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
/* cache some info in locals */
set = state->gfxset.set;
- gfx = machine->gfx[set];
+ gfx = machine.gfx[set];
/* handle cells per line (minus,plus) */
if (ui_input_pressed(machine, IPT_UI_ZOOM_OUT))
@@ -682,7 +682,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
graphics view bitmap
-------------------------------------------------*/
-static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
+static void gfxset_update_bitmap(running_machine &machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
{
int set = state->gfxset.set;
int cellxpix, cellypix;
@@ -696,12 +696,12 @@ static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state,
if (state->bitmap == NULL || state->texture == NULL || state->bitmap->bpp != 32 || state->bitmap->width != cellxpix * xcells || state->bitmap->height != cellypix * ycells)
{
/* free the old stuff */
- machine->render().texture_free(state->texture);
+ machine.render().texture_free(state->texture);
global_free(state->bitmap);
/* allocate new stuff */
state->bitmap = global_alloc(bitmap_t(cellxpix * xcells, cellypix * ycells, BITMAP_FORMAT_ARGB32));
- state->texture = machine->render().texture_alloc();
+ state->texture = machine.render().texture_alloc();
state->texture->set_bitmap(state->bitmap, NULL, TEXFORMAT_ARGB32);
/* force a redraw */
@@ -761,7 +761,7 @@ static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state,
the view
-------------------------------------------------*/
-static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
+static void gfxset_draw_item(running_machine &machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
{
static const pen_t default_palette[] =
{
@@ -770,7 +770,7 @@ static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, i
};
int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width;
int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height;
- const rgb_t *palette = (machine->total_colors() != 0) ? palette_entry_list_raw(machine->palette) : NULL;
+ const rgb_t *palette = (machine.total_colors() != 0) ? palette_entry_list_raw(machine.palette) : NULL;
UINT32 rowpixels = bitmap->rowpixels;
UINT32 palette_mask = ~0;
int x, y;
@@ -838,14 +838,14 @@ static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, i
viewer
-------------------------------------------------*/
-static void tilemap_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void tilemap_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- render_font *ui_font = ui_get_font(*machine);
+ render_font *ui_font = ui_get_font(machine);
float chwidth, chheight;
render_bounds mapboxbounds;
render_bounds boxbounds;
- int targwidth = machine->render().ui_target().width();
- int targheight = machine->render().ui_target().height();
+ int targwidth = machine.render().ui_target().width();
+ int targheight = machine.render().ui_target().height();
float titlewidth;
float x0, y0;
int mapboxwidth, mapboxheight;
@@ -860,8 +860,8 @@ static void tilemap_handler(running_machine *machine, render_container *containe
{ UINT32 temp = mapwidth; mapwidth = mapheight; mapheight = temp; }
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -908,7 +908,7 @@ static void tilemap_handler(running_machine *machine, render_container *containe
/* figure out the title and expand the outer box to fit */
sprintf(title, "TMAP %d/%d %dx%d OFFS %d,%d", state->tilemap.which, tilemap_count(machine) - 1, mapwidth, mapheight, state->tilemap.xoffs, state->tilemap.yoffs);
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
{
boxbounds.x0 = 0.5f - 0.5f * (titlewidth + chwidth);
@@ -923,8 +923,8 @@ static void tilemap_handler(running_machine *machine, render_container *containe
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* update the bitmap */
@@ -946,7 +946,7 @@ static void tilemap_handler(running_machine *machine, render_container *containe
tilemap view
-------------------------------------------------*/
-static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, int viswidth, int visheight)
+static void tilemap_handle_keys(running_machine &machine, ui_gfx_state *state, int viswidth, int visheight)
{
ui_gfx_state oldstate = *state;
UINT32 mapwidth, mapheight;
@@ -1029,16 +1029,16 @@ static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, i
for the tilemap view
-------------------------------------------------*/
-static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height)
+static void tilemap_update_bitmap(running_machine &machine, ui_gfx_state *state, int width, int height)
{
- bitmap_format screen_format = machine->primary_screen->format();
+ bitmap_format screen_format = machine.primary_screen->format();
palette_t *palette = NULL;
int screen_texformat;
/* convert the screen format to a texture format */
switch (screen_format)
{
- case BITMAP_FORMAT_INDEXED16: screen_texformat = TEXFORMAT_PALETTE16; palette = machine->palette; break;
+ case BITMAP_FORMAT_INDEXED16: screen_texformat = TEXFORMAT_PALETTE16; palette = machine.palette; break;
case BITMAP_FORMAT_RGB15: screen_texformat = TEXFORMAT_RGB15; palette = NULL; break;
case BITMAP_FORMAT_RGB32: screen_texformat = TEXFORMAT_RGB32; palette = NULL; break;
default: fatalerror("Invalid bitmap format!"); break;
@@ -1052,12 +1052,12 @@ static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state,
if (state->bitmap == NULL || state->texture == NULL || state->bitmap->format != screen_format || state->bitmap->width != width || state->bitmap->height != height)
{
/* free the old stuff */
- machine->render().texture_free(state->texture);
+ machine.render().texture_free(state->texture);
global_free(state->bitmap);
/* allocate new stuff */
state->bitmap = global_alloc(bitmap_t(width, height, screen_format));
- state->texture = machine->render().texture_alloc();
+ state->texture = machine.render().texture_alloc();
state->texture->set_bitmap(state->bitmap, NULL, screen_texformat, palette);
/* force a redraw */
diff --git a/src/emu/uigfx.h b/src/emu/uigfx.h
index d7d1d2c42e8..c514916d127 100644
--- a/src/emu/uigfx.h
+++ b/src/emu/uigfx.h
@@ -21,10 +21,10 @@
***************************************************************************/
/* initialization */
-void ui_gfx_init(running_machine *machine);
+void ui_gfx_init(running_machine &machine);
/* master handler */
-UINT32 ui_gfx_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 state);
#endif /* __UIGFX_H__ */
diff --git a/src/emu/uiimage.c b/src/emu/uiimage.c
index 7c903b3cfe0..5405ff6d2c3 100644
--- a/src/emu/uiimage.c
+++ b/src/emu/uiimage.c
@@ -196,7 +196,7 @@ static void extra_text_draw_box(render_container &ui_container, float origx1, fl
and footer text
-------------------------------------------------*/
-static void extra_text_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom,
+static void extra_text_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom,
float origx1, float origy1, float origx2, float origy2,
const char *header, const char *footer)
{
@@ -204,9 +204,9 @@ static void extra_text_render(running_machine *machine, ui_menu *menu, void *sta
footer = ((footer != NULL) && (footer[0] != '\0')) ? footer : NULL;
if (header != NULL)
- extra_text_draw_box(machine->render().ui_container(), origx1, origx2, origy1, top, header, -1);
+ extra_text_draw_box(machine.render().ui_container(), origx1, origx2, origy1, top, header, -1);
if (footer != NULL)
- extra_text_draw_box(machine->render().ui_container(), origx1, origx2, origy2, bottom, footer, +1);
+ extra_text_draw_box(machine.render().ui_container(), origx1, origx2, origy2, bottom, footer, +1);
}
@@ -220,7 +220,7 @@ static void extra_text_render(running_machine *machine, ui_menu *menu, void *sta
confirm save as menu
-------------------------------------------------*/
-static void menu_confirm_save_as_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_confirm_save_as_populate(running_machine &machine, ui_menu *menu, void *state)
{
ui_menu_item_append(menu, "File Already Exists - Overide?", NULL, MENU_FLAG_DISABLE, NULL);
ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, MENU_FLAG_DISABLE, NULL);
@@ -234,7 +234,7 @@ static void menu_confirm_save_as_populate(running_machine *machine, ui_menu *men
menu_confirm_save_as - confirm save as menu
-------------------------------------------------*/
-static void menu_confirm_save_as(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_confirm_save_as(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
confirm_save_as_menu_state *menustate = (confirm_save_as_menu_state *) state;
@@ -292,7 +292,7 @@ static int is_valid_filename_char(unicode_char unichar)
special rendering
-------------------------------------------------*/
-static void file_create_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_create_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_create_menu_state *menustate = (file_create_menu_state *) state;
@@ -308,7 +308,7 @@ static void file_create_render_extra(running_machine *machine, ui_menu *menu, vo
creator menu
-------------------------------------------------*/
-static void menu_file_create_populate(running_machine *machine, ui_menu *menu, void *state, void *selection)
+static void menu_file_create_populate(running_machine &machine, ui_menu *menu, void *state, void *selection)
{
astring buffer;
file_create_menu_state *menustate = (file_create_menu_state *) state;
@@ -341,7 +341,7 @@ static void menu_file_create_populate(running_machine *machine, ui_menu *menu, v
ui_menu_item_append(menu, "Create", NULL, 0, ITEMREF_CREATE);
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_create_render_extra, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 0);
+ ui_menu_set_custom_render(menu, file_create_render_extra, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 0);
}
@@ -382,7 +382,7 @@ static int create_new_image(device_image_interface *image, const char *directory
case ENTTYPE_FILE:
/* a file exists here - ask for permission from the user */
- child_menu = ui_menu_alloc(image->device().machine, &image->device().machine->render().ui_container(), menu_confirm_save_as, NULL);
+ child_menu = ui_menu_alloc(image->device().machine(), &image->device().machine().render().ui_container(), menu_confirm_save_as, NULL);
child_menustate = (confirm_save_as_menu_state*)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->yes = yes;
ui_menu_stack_push(child_menu);
@@ -423,7 +423,7 @@ static int create_new_image(device_image_interface *image, const char *directory
menu_file_create - file creator menu
-------------------------------------------------*/
-static void menu_file_create(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_file_create(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
void *selection;
const ui_menu_event *event;
@@ -498,7 +498,7 @@ static void menu_file_create(running_machine *machine, ui_menu *menu, void *para
special rendering
-------------------------------------------------*/
-static void file_selector_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_selector_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_selector_menu_state *menustate = (file_selector_menu_state *) state;
@@ -676,7 +676,7 @@ static void append_file_selector_entry_menu_item(ui_menu *menu, const file_selec
allocates all menu items for a directory
-------------------------------------------------*/
-static file_error menu_file_selector_populate(running_machine *machine, ui_menu *menu, file_selector_menu_state *menustate)
+static file_error menu_file_selector_populate(running_machine &machine, ui_menu *menu, file_selector_menu_state *menustate)
{
zippath_directory *directory = NULL;
file_error err = FILERR_NONE;
@@ -744,7 +744,7 @@ static file_error menu_file_selector_populate(running_machine *machine, ui_menu
ui_menu_set_selection(menu, (void *) selected_entry);
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_selector_render_extra, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 0);
+ ui_menu_set_custom_render(menu, file_selector_render_extra, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 0);
done:
if (directory != NULL)
@@ -770,7 +770,7 @@ static file_error check_path(const char *path)
menu_file_selector - file selector menu
-------------------------------------------------*/
-static void menu_file_selector(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_file_selector(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
file_error err;
const ui_menu_event *event;
@@ -815,13 +815,13 @@ static void menu_file_selector(running_machine *machine, ui_menu *menu, void *pa
case SELECTOR_ENTRY_TYPE_CREATE:
/* create */
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), menu_file_create, NULL);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), menu_file_create, NULL);
child_menustate = (file_create_menu_state*)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->manager_menustate = menustate->manager_menustate;
ui_menu_stack_push(child_menu);
break;
case SELECTOR_ENTRY_TYPE_SOFTWARE_LIST:
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_image_menu_software, menustate->manager_menustate->selected_device);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_image_menu_software, menustate->manager_menustate->selected_device);
ui_menu_stack_push(child_menu);
break;
case SELECTOR_ENTRY_TYPE_DRIVE:
@@ -956,7 +956,7 @@ static void fix_working_directory(device_image_interface *image)
special rendering
-------------------------------------------------*/
-static void file_manager_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_manager_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_manager_menu_state *menustate = (file_manager_menu_state *) state;
const char *path;
@@ -974,14 +974,14 @@ static void file_manager_render_extra(running_machine *machine, ui_menu *menu, v
file manager menu
-------------------------------------------------*/
-static void menu_file_manager_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_file_manager_populate(running_machine &machine, ui_menu *menu, void *state)
{
char buffer[2048];
device_image_interface *image = NULL;
astring tmp_name;
/* cycle through all devices for this system */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
/* get the image type/id */
snprintf(buffer, ARRAY_LENGTH(buffer),
@@ -1019,7 +1019,7 @@ static void menu_file_manager_populate(running_machine *machine, ui_menu *menu,
}
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_manager_render_extra, 0, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, file_manager_render_extra, 0, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER);
}
@@ -1045,7 +1045,7 @@ static void file_manager_destroy_state(ui_menu *menu, void *state)
menu_file_manager - main file manager menu
-------------------------------------------------*/
-void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_file_manager(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
file_manager_menu_state *menustate;
@@ -1088,7 +1088,7 @@ void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *p
ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_POSITION);
/* push the menu */
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), menu_file_selector, NULL);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), menu_file_selector, NULL);
child_menustate = (file_selector_menu_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->manager_menustate = menustate;
ui_menu_stack_push(child_menu);
@@ -1101,7 +1101,7 @@ void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *p
on all loaded images
-------------------------------------------------*/
-void ui_image_menu_image_info(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_image_info(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* if the menu isn't built, populate now */
if (!ui_menu_populated(menu))
@@ -1160,10 +1160,10 @@ struct _bitbanger_control_menu_state
devices in the machine
-------------------------------------------------*/
-INLINE int cassette_count( running_machine *machine )
+INLINE int cassette_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine->m_devicelist.first(CASSETTE);
+ device_t *device = machine.m_devicelist.first(CASSETTE);
while ( device )
{
@@ -1178,10 +1178,10 @@ INLINE int cassette_count( running_machine *machine )
devices in the machine
-------------------------------------------------*/
-INLINE int bitbanger_count( running_machine *machine )
+INLINE int bitbanger_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine->m_devicelist.first(BITBANGER);
+ device_t *device = machine.m_devicelist.first(BITBANGER);
while ( device )
{
@@ -1223,7 +1223,7 @@ astring *tapecontrol_gettime(astring *dest, device_t *device, int *curpos, int *
main tape control menu
-------------------------------------------------*/
-static void menu_tape_control_populate(running_machine *machine, ui_menu *menu, tape_control_menu_state *menustate)
+static void menu_tape_control_populate(running_machine &machine, ui_menu *menu, tape_control_menu_state *menustate)
{
astring timepos;
cassette_state state;
@@ -1300,7 +1300,7 @@ static void menu_tape_control_populate(running_machine *machine, ui_menu *menu,
main bitbanger control menu
-------------------------------------------------*/
-static void menu_bitbanger_control_populate(running_machine *machine, ui_menu *menu, bitbanger_control_menu_state *menustate)
+static void menu_bitbanger_control_populate(running_machine &machine, ui_menu *menu, bitbanger_control_menu_state *menustate)
{
int count = bitbanger_count(machine);
UINT32 flags = 0, mode_flags = 0, baud_flags = 0, tune_flags = 0;
@@ -1353,7 +1353,7 @@ static void menu_bitbanger_control_populate(running_machine *machine, ui_menu *m
menu_tape_control - main tape control menu
-------------------------------------------------*/
-void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_tape_control(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
tape_control_menu_state *menustate;
const ui_menu_event *event;
@@ -1368,7 +1368,7 @@ void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *pa
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine->m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == CASSETTE) {
if (index==0) break;
@@ -1450,7 +1450,7 @@ void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *pa
control menu
-------------------------------------------------*/
-void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_bitbanger_control(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
bitbanger_control_menu_state *menustate;
const ui_menu_event *event;
@@ -1465,7 +1465,7 @@ void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, voi
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine->m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == BITBANGER) {
if (index==0) break;
diff --git a/src/emu/uiimage.h b/src/emu/uiimage.h
index 5c83d64e44e..31881cdbdb9 100644
--- a/src/emu/uiimage.h
+++ b/src/emu/uiimage.h
@@ -20,12 +20,12 @@
FUNCTION PROTOTYPES
***************************************************************************/
-void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_file_manager(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_image_menu_image_info(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_image_info(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_mess_menu_bitbanger_control(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_mess_menu_tape_control(running_machine &machine, ui_menu *menu, void *parameter, void *state);
#endif /* __UIIMAGE_H__ */
diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c
index 486d710ff54..1a7af6dda67 100644
--- a/src/emu/uiinput.c
+++ b/src/emu/uiinput.c
@@ -59,7 +59,7 @@ struct _ui_input_private
FUNCTION PROTOYPES
***************************************************************************/
-//static void ui_input_frame_update(running_machine *machine);
+//static void ui_input_frame_update(running_machine &machine);
@@ -72,15 +72,15 @@ struct _ui_input_private
system
-------------------------------------------------*/
-void ui_input_init(running_machine *machine)
+void ui_input_init(running_machine &machine)
{
/* create the private data */
- machine->ui_input_data = auto_alloc_clear(machine, ui_input_private);
- machine->ui_input_data->current_mouse_x = -1;
- machine->ui_input_data->current_mouse_y = -1;
+ machine.ui_input_data = auto_alloc_clear(machine, ui_input_private);
+ machine.ui_input_data->current_mouse_x = -1;
+ machine.ui_input_data->current_mouse_y = -1;
/* add a frame callback to poll inputs */
- machine->add_notifier(MACHINE_NOTIFY_FRAME, ui_input_frame_update);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, ui_input_frame_update);
}
@@ -103,7 +103,7 @@ void ui_input_frame_update(running_machine &machine)
/* update the state of all the UI keys */
for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
{
- int pressed = input_seq_pressed(&machine, input_type_seq(&machine, code, 0, SEQ_TYPE_STANDARD));
+ int pressed = input_seq_pressed(machine, input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD));
if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)
uidata->seqpressed[code] = pressed;
}
@@ -115,9 +115,9 @@ void ui_input_frame_update(running_machine &machine)
onto the queue
-------------------------------------------------*/
-int ui_input_push_event(running_machine *machine, ui_event evt)
+int ui_input_push_event(running_machine &machine, ui_event evt)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
/* we may be called before the UI is initialized */
if (uidata == NULL)
@@ -168,9 +168,9 @@ int ui_input_push_event(running_machine *machine, ui_event evt)
ui_input_pop_event - pops an event off of the queue
-------------------------------------------------*/
-int ui_input_pop_event(running_machine *machine, ui_event *evt)
+int ui_input_pop_event(running_machine &machine, ui_event *evt)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int result;
if (uidata->events_start != uidata->events_end)
@@ -193,9 +193,9 @@ int ui_input_pop_event(running_machine *machine, ui_event *evt)
and resets the sequence states
-------------------------------------------------*/
-void ui_input_reset(running_machine *machine)
+void ui_input_reset(running_machine &machine)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int code;
uidata->events_start = 0;
@@ -213,9 +213,9 @@ void ui_input_reset(running_machine *machine)
location of the mouse
-------------------------------------------------*/
-render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button)
+render_target *ui_input_find_mouse(running_machine &machine, INT32 *x, INT32 *y, int *button)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
if (x != NULL)
*x = uidata->current_mouse_x;
if (y != NULL)
@@ -237,7 +237,7 @@ render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y,
detected
-------------------------------------------------*/
-int ui_input_pressed(running_machine *machine, int code)
+int ui_input_pressed(running_machine &machine, int code)
{
return ui_input_pressed_repeat(machine, code, 0);
}
@@ -250,9 +250,9 @@ int ui_input_pressed(running_machine *machine, int code)
is triggered
-------------------------------------------------*/
-int ui_input_pressed_repeat(running_machine *machine, int code, int speed)
+int ui_input_pressed_repeat(running_machine &machine, int code, int speed)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int pressed = FALSE;
g_profiler.start(PROFILER_INPUT);
diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h
index dc0d3382b28..5923fb501de 100644
--- a/src/emu/uiinput.h
+++ b/src/emu/uiinput.h
@@ -55,7 +55,7 @@ struct _ui_event
/* ----- core system management ----- */
/* initialization */
-void ui_input_init(running_machine *machine);
+void ui_input_init(running_machine &machine);
@@ -64,27 +64,27 @@ void ui_input_init(running_machine *machine);
void ui_input_frame_update(running_machine &machine);
/* pushes a single event onto the queue */
-int ui_input_push_event(running_machine *machine, ui_event event);
+int ui_input_push_event(running_machine &machine, ui_event event);
/* pops an event off of the queue */
-int ui_input_pop_event(running_machine *machine, ui_event *event);
+int ui_input_pop_event(running_machine &machine, ui_event *event);
/* clears all outstanding events */
-void ui_input_reset(running_machine *machine);
+void ui_input_reset(running_machine &machine);
/* retrieves the current location of the mouse */
-render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button);
+render_target *ui_input_find_mouse(running_machine &machine, INT32 *x, INT32 *y, int *button);
/* ----- user interface sequence reading ----- */
/* return TRUE if a key down for the given user interface sequence is detected */
-int ui_input_pressed(running_machine *machine, int code);
+int ui_input_pressed(running_machine &machine, int code);
/* return TRUE if a key down for the given user interface sequence is detected, or if
autorepeat at the given speed is triggered */
-int ui_input_pressed_repeat(running_machine *machine, int code, int speed);
+int ui_input_pressed_repeat(running_machine &machine, int code, int speed);
@@ -97,7 +97,7 @@ int ui_input_pressed_repeat(running_machine *machine, int code, int speed);
move event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_move_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_MOVE;
@@ -113,7 +113,7 @@ INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_targ
mouse leave event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_target *target)
+INLINE void ui_input_push_mouse_leave_event(running_machine &machine, render_target *target)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_LEAVE;
@@ -127,7 +127,7 @@ INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_tar
down event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_down_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_down_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_DOWN;
@@ -143,7 +143,7 @@ INLINE void ui_input_push_mouse_down_event(running_machine *machine, render_targ
down event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_up_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_up_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_UP;
@@ -160,7 +160,7 @@ INLINE void ui_input_push_mouse_up_event(running_machine *machine, render_target
render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_double_click_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_double_click_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_DOUBLE_CLICK;
@@ -176,7 +176,7 @@ INLINE void ui_input_push_mouse_double_click_event(running_machine *machine, ren
to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_char_event(running_machine *machine, render_target *target, unicode_char ch)
+INLINE void ui_input_push_char_event(running_machine &machine, render_target *target, unicode_char ch)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_CHAR;
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index d628cd67298..efd14614b1b 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -118,7 +118,9 @@ struct _ui_menu_item
struct _ui_menu
{
- running_machine * machine; /* machine we are attached to */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* machine we are attached to */
render_container * container; /* render_container we render to */
ui_menu_handler_func handler; /* handler callback */
void * parameter; /* parameter */
@@ -252,59 +254,59 @@ static const char exittext[] = "Exit";
static void ui_menu_exit(running_machine &machine);
/* internal menu processing */
-static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly);
+static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly);
static void ui_menu_draw_text_box(ui_menu *menu);
static void ui_menu_handle_events(ui_menu *menu);
static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags);
static void ui_menu_validate_selection(ui_menu *menu, int scandir);
-static void ui_menu_clear_free_list(running_machine *machine);
+static void ui_menu_clear_free_list(running_machine &machine);
/* menu handlers */
-static void menu_main(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_main_populate(running_machine *machine, ui_menu *menu, void *state);
-static void menu_input_groups(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_groups_populate(running_machine *machine, ui_menu *menu, void *state);
-static void menu_input_general(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_general_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate, int group);
-static void menu_input_specific(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate);
-static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+static void menu_main(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_main_populate(running_machine &machine, ui_menu *menu, void *state);
+static void menu_input_groups(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_groups_populate(running_machine &machine, ui_menu *menu, void *state);
+static void menu_input_general(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_general_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate, int group);
+static void menu_input_specific(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_specific_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate);
+static void menu_input_common(running_machine &machine, ui_menu *menu, void *parameter, void *state);
static int CLIB_DECL menu_input_compare_items(const void *i1, const void *i2);
-static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate);
-static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_common(running_machine *machine, ui_menu *menu, void *state, UINT32 type);
-static void menu_settings_populate(running_machine *machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type);
-static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_analog_populate(running_machine *machine, ui_menu *menu);
-static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, attotime *curtime);
-static void menu_game_info(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_cheat_populate(running_machine *machine, ui_menu *menu);
-static void menu_memory_card(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, int cardnum);
-static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int menuless_mode);
-static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2);
-static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_video_targets_populate(running_machine *machine, ui_menu *menu);
-static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_video_options_populate(running_machine *machine, ui_menu *menu, render_target *target);
-static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_crosshair_populate(running_machine *machine, ui_menu *menu);
-static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_select_game(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_select_game_populate(running_machine *machine, ui_menu *menu, select_game_state *menustate);
+static void menu_input_populate_and_sort(running_machine &machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate);
+static void menu_settings_dip_switches(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_driver_config(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_categories(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_common(running_machine &machine, ui_menu *menu, void *state, UINT32 type);
+static void menu_settings_populate(running_machine &machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type);
+static void menu_analog(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_analog_populate(running_machine &machine, ui_menu *menu);
+static void menu_bookkeeping(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_bookkeeping_populate(running_machine &machine, ui_menu *menu, attotime *curtime);
+static void menu_game_info(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_cheat(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_cheat_populate(running_machine &machine, ui_menu *menu);
+static void menu_memory_card(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_memory_card_populate(running_machine &machine, ui_menu *menu, int cardnum);
+static void menu_sliders(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_sliders_populate(running_machine &machine, ui_menu *menu, int menuless_mode);
+static void menu_sliders_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2);
+static void menu_video_targets(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_video_targets_populate(running_machine &machine, ui_menu *menu);
+static void menu_video_options(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_video_options_populate(running_machine &machine, ui_menu *menu, render_target *target);
+static void menu_crosshair(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_crosshair_populate(running_machine &machine, ui_menu *menu);
+static void menu_quit_game(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_select_game(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_select_game_populate(running_machine &machine, ui_menu *menu, select_game_state *menustate);
static int CLIB_DECL menu_select_game_driver_compare(const void *elem1, const void *elem2);
static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state *menustate);
-static void menu_select_game_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+static void menu_select_game_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
/* menu helpers */
static void menu_render_triangle(bitmap_t &dest, const bitmap_t &source, const rectangle &sbounds, void *param);
static void menu_settings_custom_render_one(render_container *container, float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask);
-static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+static void menu_settings_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
@@ -320,7 +322,7 @@ static void menu_settings_custom_render(running_machine *machine, ui_menu *menu,
INLINE const input_seq *get_field_default_seq(const input_field_config *field, input_seq_type seqtype)
{
if (input_seq_get_1(&field->seq[seqtype]) == SEQCODE_DEFAULT)
- return input_type_seq(field->port->machine, field->type, field->player, seqtype);
+ return input_type_seq(field->port->machine(), field->type, field->player, seqtype);
else
return &field->seq[seqtype];
}
@@ -362,7 +364,7 @@ INLINE int item_is_selectable(const ui_menu_item *item)
INLINE int exclusive_input_pressed(ui_menu *menu, int key, int repeat)
{
- if (menu->menu_event.iptkey == IPT_INVALID && ui_input_pressed_repeat(menu->machine, key, repeat))
+ if (menu->menu_event.iptkey == IPT_INVALID && ui_input_pressed_repeat(menu->machine(), key, repeat))
{
menu->menu_event.iptkey = key;
return TRUE;
@@ -380,7 +382,7 @@ INLINE int exclusive_input_pressed(ui_menu *menu, int key, int repeat)
ui_menu_init - initialize the menu system
-------------------------------------------------*/
-void ui_menu_init(running_machine *machine)
+void ui_menu_init(running_machine &machine)
{
int x;
@@ -396,14 +398,14 @@ void ui_menu_init(running_machine *machine)
if (x > 256 - 25) alpha = 0xff * (255 - x) / 25;
*BITMAP_ADDR32(hilight_bitmap, 0, x) = MAKE_ARGB(alpha,0xff,0xff,0xff);
}
- hilight_texture = machine->render().texture_alloc();
+ hilight_texture = machine.render().texture_alloc();
hilight_texture->set_bitmap(hilight_bitmap, NULL, TEXFORMAT_ARGB32);
/* create a texture for arrow icons */
- arrow_texture = machine->render().texture_alloc(menu_render_triangle);
+ arrow_texture = machine.render().texture_alloc(menu_render_triangle);
/* add an exit callback to free memory */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_menu_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_menu_exit);
}
@@ -414,8 +416,8 @@ void ui_menu_init(running_machine *machine)
static void ui_menu_exit(running_machine &machine)
{
/* free menus */
- ui_menu_stack_reset(&machine);
- ui_menu_clear_free_list(&machine);
+ ui_menu_stack_reset(machine);
+ ui_menu_clear_free_list(machine);
/* free textures */
machine.render().texture_free(hilight_texture);
@@ -432,7 +434,7 @@ static void ui_menu_exit(running_machine &machine)
ui_menu_alloc - allocate a new menu
-------------------------------------------------*/
-ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui_menu_handler_func handler, void *parameter)
+ui_menu *ui_menu_alloc(running_machine &machine, render_container *container, ui_menu_handler_func handler, void *parameter)
{
ui_menu *menu;
@@ -440,7 +442,7 @@ ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui
menu = auto_alloc_clear(machine, ui_menu);
/* initialize the state */
- menu->machine = machine;
+ menu->m_machine = &machine;
menu->container = container;
menu->handler = handler;
menu->parameter = parameter;
@@ -462,23 +464,23 @@ void ui_menu_free(ui_menu *menu)
{
ui_menu_pool *pool = menu->pool;
menu->pool = pool->next;
- auto_free(menu->machine, pool);
+ auto_free(menu->machine(), pool);
}
/* free the item array */
if (menu->item != NULL)
- auto_free(menu->machine, menu->item);
+ auto_free(menu->machine(), menu->item);
/* free the state */
if (menu->state != NULL)
{
if (menu->destroy_state != NULL)
(*menu->destroy_state)(menu, menu->state);
- auto_free(menu->machine, menu->state);
+ auto_free(menu->machine(), menu->state);
}
/* free the menu */
- auto_free(menu->machine, menu);
+ auto_free(menu->machine(), menu);
}
@@ -550,10 +552,10 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U
{
int olditems = menu->allocitems;
menu->allocitems += UI_MENU_ALLOC_ITEMS;
- ui_menu_item *newitems = auto_alloc_array(menu->machine, ui_menu_item, menu->allocitems);
+ ui_menu_item *newitems = auto_alloc_array(menu->machine(), ui_menu_item, menu->allocitems);
for (int itemnum = 0; itemnum < olditems; itemnum++)
newitems[itemnum] = menu->item[itemnum];
- auto_free(menu->machine, menu->item);
+ auto_free(menu->machine(), menu->item);
menu->item = newitems;
}
index = menu->numitems++;
@@ -585,7 +587,7 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U
and returning any interesting events
-------------------------------------------------*/
-const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags)
+const ui_menu_event *ui_menu_process(running_machine &machine, ui_menu *menu, UINT32 flags)
{
/* reset the menu_event */
menu->menu_event.iptkey = IPT_INVALID;
@@ -644,9 +646,9 @@ void *ui_menu_alloc_state(ui_menu *menu, size_t size, ui_menu_destroy_state_func
{
if (menu->destroy_state != NULL)
(*menu->destroy_state)(menu, menu->state);
- auto_free(menu->machine, menu->state);
+ auto_free(menu->machine(), menu->state);
}
- menu->state = auto_alloc_array_clear(menu->machine, UINT8, size);
+ menu->state = auto_alloc_array_clear(menu->machine(), UINT8, size);
menu->destroy_state = destroy_state;
return menu->state;
@@ -674,7 +676,7 @@ void *ui_menu_pool_alloc(ui_menu *menu, size_t size)
}
/* allocate a new pool */
- pool = (ui_menu_pool *)auto_alloc_array_clear(menu->machine, UINT8, sizeof(*pool) + UI_MENU_POOL_SIZE);
+ pool = (ui_menu_pool *)auto_alloc_array_clear(menu->machine(), UINT8, sizeof(*pool) + UI_MENU_POOL_SIZE);
/* wire it up */
pool->next = menu->pool;
@@ -735,11 +737,11 @@ void ui_menu_set_selection(ui_menu *menu, void *selected_itemref)
ui_menu_draw - draw a menu
-------------------------------------------------*/
-static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly)
+static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly)
{
- float line_height = ui_get_line_height(*machine);
- float lr_arrow_width = 0.4f * line_height * machine->render().ui_aspect();
- float ud_arrow_width = line_height * machine->render().ui_aspect();
+ float line_height = ui_get_line_height(machine);
+ float lr_arrow_width = 0.4f * line_height * machine.render().ui_aspect();
+ float ud_arrow_width = line_height * machine.render().ui_aspect();
float gutter_width = lr_arrow_width * 1.3f;
float x1, y1, x2, y2;
@@ -765,11 +767,11 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
float total_width;
/* compute width of left hand side */
- total_width = gutter_width + ui_get_string_width(*machine, item->text) + gutter_width;
+ total_width = gutter_width + ui_get_string_width(machine, item->text) + gutter_width;
/* add in width of right hand side */
if (item->subtext)
- total_width += 2.0f * gutter_width + ui_get_string_width(*machine, item->subtext);
+ total_width += 2.0f * gutter_width + ui_get_string_width(machine, item->subtext);
/* track the maximum */
if (total_width > visible_width)
@@ -933,7 +935,7 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
item_width += 2.0f * gutter_width;
/* if the subitem doesn't fit here, display dots */
- if (ui_get_string_width(*machine, subitem_text) > effective_width - item_width)
+ if (ui_get_string_width(machine, subitem_text) > effective_width - item_width)
{
subitem_text = "...";
if (itemnum == menu->selected)
@@ -1003,7 +1005,7 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
if (menu->custom != NULL)
{
void *selectedref = (menu->selected >= 0 && menu->selected < menu->numitems) ? menu->item[menu->selected].ref : NULL;
- (*menu->custom)(menu->machine, menu, menu->state, selectedref, menu->customtop, menu->custombottom, x1, y1, x2, y2);
+ (*menu->custom)(menu->machine(), menu, menu->state, selectedref, menu->customtop, menu->custombottom, x1, y1, x2, y2);
}
/* return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow */
@@ -1021,8 +1023,8 @@ static void ui_menu_draw_text_box(ui_menu *menu)
{
const char *text = menu->item[0].text;
const char *backtext = menu->item[1].text;
- float line_height = ui_get_line_height(*menu->machine);
- float lr_arrow_width = 0.4f * line_height * menu->machine->render().ui_aspect();
+ float line_height = ui_get_line_height(menu->machine());
+ float lr_arrow_width = 0.4f * line_height * menu->machine().render().ui_aspect();
float gutter_width = lr_arrow_width;
float target_width, target_height, prior_width;
float target_x, target_y;
@@ -1035,7 +1037,7 @@ static void ui_menu_draw_text_box(ui_menu *menu)
target_height = floor((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
/* maximum against "return to prior menu" text */
- prior_width = ui_get_string_width(*menu->machine, backtext) + 2.0f * gutter_width;
+ prior_width = ui_get_string_width(menu->machine(), backtext) + 2.0f * gutter_width;
target_width = MAX(target_width, prior_width);
/* determine the target location */
@@ -1088,7 +1090,7 @@ static void ui_menu_handle_events(ui_menu *menu)
ui_event menu_event;
/* loop while we have interesting events */
- while (ui_input_pop_event(menu->machine, &menu_event) && !stop)
+ while (ui_input_pop_event(menu->machine(), &menu_event) && !stop)
{
switch (menu_event.event_type)
{
@@ -1119,7 +1121,7 @@ static void ui_menu_handle_events(ui_menu *menu)
if (menu->selected == menu->numitems - 1)
{
menu->menu_event.iptkey = IPT_UI_CANCEL;
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
}
}
stop = TRUE;
@@ -1163,7 +1165,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
if (menu->selected == menu->numitems - 1)
{
menu->menu_event.iptkey = IPT_UI_CANCEL;
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
}
return;
}
@@ -1171,7 +1173,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
/* hitting cancel also pops the stack */
if (exclusive_input_pressed(menu, IPT_UI_CANCEL, 0))
{
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
return;
}
@@ -1233,15 +1235,15 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
/* pause enables/disables pause */
if (!ignorepause && exclusive_input_pressed(menu, IPT_UI_PAUSE, 0))
{
- if (menu->machine->paused())
- menu->machine->resume();
+ if (menu->machine().paused())
+ menu->machine().resume();
else
- menu->machine->pause();
+ menu->machine().pause();
}
/* handle a toggle cheats request */
- if (ui_input_pressed_repeat(menu->machine, IPT_UI_TOGGLE_CHEAT, 0))
- menu->machine->cheat().set_enable(!menu->machine->cheat().enabled());
+ if (ui_input_pressed_repeat(menu->machine(), IPT_UI_TOGGLE_CHEAT, 0))
+ menu->machine().cheat().set_enable(!menu->machine().cheat().enabled());
/* see if any other UI keys are pressed */
if (menu->menu_event.iptkey == IPT_INVALID)
@@ -1281,7 +1283,7 @@ static void ui_menu_validate_selection(ui_menu *menu, int scandir)
accumulated in the free list
-------------------------------------------------*/
-static void ui_menu_clear_free_list(running_machine *machine)
+static void ui_menu_clear_free_list(running_machine &machine)
{
while (menu_free != NULL)
{
@@ -1301,7 +1303,7 @@ static void ui_menu_clear_free_list(running_machine *machine)
ui_menu_stack_reset - reset the menu stack
-------------------------------------------------*/
-void ui_menu_stack_reset(running_machine *machine)
+void ui_menu_stack_reset(running_machine &machine)
{
while (menu_stack != NULL)
ui_menu_stack_pop(machine);
@@ -1318,7 +1320,7 @@ void ui_menu_stack_push(ui_menu *menu)
menu->parent = menu_stack;
menu_stack = menu;
ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
- ui_input_reset(menu->machine);
+ ui_input_reset(menu->machine());
}
@@ -1326,7 +1328,7 @@ void ui_menu_stack_push(ui_menu *menu)
ui_menu_stack_pop - pop a menu from the stack
-------------------------------------------------*/
-void ui_menu_stack_pop(running_machine *machine)
+void ui_menu_stack_pop(running_machine &machine)
{
if (menu_stack != NULL)
{
@@ -1349,7 +1351,7 @@ void ui_menu_stack_pop(running_machine *machine)
and calls the menu handler
-------------------------------------------------*/
-UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container, UINT32 state)
+UINT32 ui_menu_ui_handler(running_machine &machine, render_container *container, UINT32 state)
{
/* if we have no menus stacked up, start with the main menu */
if (menu_stack == NULL)
@@ -1379,7 +1381,7 @@ UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container,
standard menu handler
-------------------------------------------------*/
-UINT32 ui_slider_ui_handler(running_machine *machine, render_container *container, UINT32 state)
+UINT32 ui_slider_ui_handler(running_machine &machine, render_container *container, UINT32 state)
{
UINT32 result;
@@ -1403,9 +1405,9 @@ UINT32 ui_slider_ui_handler(running_machine *machine, render_container *containe
select menu to be visible and inescapable
-------------------------------------------------*/
-void ui_menu_force_game_select(running_machine *machine, render_container *container)
+void ui_menu_force_game_select(running_machine &machine, render_container *container)
{
- char *gamename = (char *)machine->options().system_name();
+ char *gamename = (char *)machine.options().system_name();
/* reset the menu stack */
ui_menu_stack_reset(machine);
@@ -1418,7 +1420,7 @@ void ui_menu_force_game_select(running_machine *machine, render_container *conta
ui_show_menu();
/* make sure MAME is paused */
- machine->pause();
+ machine.pause();
}
@@ -1449,7 +1451,7 @@ int ui_menu_is_force_game_select(void)
menu_main - handle the main menu
-------------------------------------------------*/
-static void menu_main(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_main(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -1468,7 +1470,7 @@ static void menu_main(running_machine *machine, ui_menu *menu, void *parameter,
ui_menu_keyboard_mode - menu that
-------------------------------------------------*/
-static void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void ui_menu_keyboard_mode(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
int natural = ui_get_use_natural_keyboard(machine);
@@ -1495,7 +1497,7 @@ static void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void
menu_main_populate - populate the main menu
-------------------------------------------------*/
-static void menu_main_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_main_populate(running_machine &machine, ui_menu *menu, void *state)
{
const input_field_config *field;
const input_port_config *port;
@@ -1505,7 +1507,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
int has_dips = FALSE;
/* scan the input port array to see what options we need to enable */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
{
if (field->type == IPT_DIPSWITCH)
@@ -1539,7 +1541,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, (void *)menu_game_info);
device_image_interface *image = NULL;
- if (machine->m_devicelist.first(image))
+ if (machine.m_devicelist.first(image))
{
/* add image info menu */
ui_menu_item_append(menu, "Image Information", NULL, 0, (void*)ui_image_menu_image_info);
@@ -1548,11 +1550,11 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "File Manager", NULL, 0, (void*)ui_image_menu_file_manager);
/* add tape control menu */
- if (machine->m_devicelist.first(CASSETTE))
+ if (machine.m_devicelist.first(CASSETTE))
ui_menu_item_append(menu, "Tape Control", NULL, 0, (void*)ui_mess_menu_tape_control);
/* add bitbanger control menu */
- if (machine->m_devicelist.first(BITBANGER))
+ if (machine.m_devicelist.first(BITBANGER))
ui_menu_item_append(menu, "Bitbanger Control", NULL, 0, (void*)ui_mess_menu_bitbanger_control);
}
/* add keyboard mode menu */
@@ -1563,18 +1565,18 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "Slider Controls", NULL, 0, (void *)menu_sliders);
/* add video options menu */
- ui_menu_item_append(menu, "Video Options", NULL, 0, (machine->render().target_by_index(1) != NULL) ? (void *)menu_video_targets : (void *)menu_video_options);
+ ui_menu_item_append(menu, "Video Options", NULL, 0, (machine.render().target_by_index(1) != NULL) ? (void *)menu_video_targets : (void *)menu_video_options);
/* add crosshair options menu */
if (crosshair_get_usage(machine))
ui_menu_item_append(menu, "Crosshair Options", NULL, 0, (void *)menu_crosshair);
/* add cheat menu */
- if (machine->options().cheat() && machine->cheat().first() != NULL)
+ if (machine.options().cheat() && machine.cheat().first() != NULL)
ui_menu_item_append(menu, "Cheat", NULL, 0, (void *)menu_cheat);
/* add memory card menu */
- if (machine->config().m_memcard_handler != NULL)
+ if (machine.config().m_memcard_handler != NULL)
ui_menu_item_append(menu, "Memory Card", NULL, 0, (void *)menu_memory_card);
/* add reset and exit menus */
@@ -1587,7 +1589,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
menu
-------------------------------------------------*/
-static void menu_input_groups(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_groups(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -1607,7 +1609,7 @@ static void menu_input_groups(running_machine *machine, ui_menu *menu, void *par
input groups menu
-------------------------------------------------*/
-static void menu_input_groups_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_input_groups_populate(running_machine &machine, ui_menu *menu, void *state)
{
int player;
@@ -1629,7 +1631,7 @@ static void menu_input_groups_populate(running_machine *machine, ui_menu *menu,
input menu
-------------------------------------------------*/
-static void menu_input_general(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_general(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_input_common(machine, menu, parameter, state);
}
@@ -1640,7 +1642,7 @@ static void menu_input_general(running_machine *machine, ui_menu *menu, void *pa
general input menu
-------------------------------------------------*/
-static void menu_input_general_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate, int group)
+static void menu_input_general_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate, int group)
{
input_item_data *itemlist = NULL;
const input_type_desc *typedesc;
@@ -1694,7 +1696,7 @@ static void menu_input_general_populate(running_machine *machine, ui_menu *menu,
input menu
-------------------------------------------------*/
-static void menu_input_specific(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_specific(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_input_common(machine, menu, NULL, state);
}
@@ -1705,7 +1707,7 @@ static void menu_input_specific(running_machine *machine, ui_menu *menu, void *p
the input menu with game-specific items
-------------------------------------------------*/
-static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate)
+static void menu_input_specific_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate)
{
input_item_data *itemlist = NULL;
const input_field_config *field;
@@ -1719,7 +1721,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu
suborder[SEQ_TYPE_INCREMENT] = 2;
/* iterate over the input ports and add menu items */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
{
const char *name = input_field_name(field);
@@ -1770,7 +1772,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu
menu_input - display a menu for inputs
-------------------------------------------------*/
-static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_common(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
input_item_data *seqchangeditem = NULL;
input_menu_state *menustate;
@@ -1906,7 +1908,7 @@ static int menu_input_compare_items(const void *i1, const void *i2)
menu from them
-------------------------------------------------*/
-static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate)
+static void menu_input_populate_and_sort(running_machine &machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate)
{
const char *nameformat[INPUT_TYPE_TOTAL] = { 0 };
input_item_data **itemarray, *item;
@@ -1967,7 +1969,7 @@ static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu
switches menu
-------------------------------------------------*/
-static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_dip_switches(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_DIPSWITCH);
}
@@ -1978,7 +1980,7 @@ static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu,
driver config menu
-------------------------------------------------*/
-static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_driver_config(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_CONFIG);
}
@@ -1989,7 +1991,7 @@ static void menu_settings_driver_config(running_machine *machine, ui_menu *menu,
categories menu
-------------------------------------------------*/
-static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_categories(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_CATEGORY);
}
@@ -2000,7 +2002,7 @@ static void menu_settings_categories(running_machine *machine, ui_menu *menu, vo
switches menus
-------------------------------------------------*/
-static void menu_settings_common(running_machine *machine, ui_menu *menu, void *state, UINT32 type)
+static void menu_settings_common(running_machine &machine, ui_menu *menu, void *state, UINT32 type)
{
settings_menu_state *menustate;
const ui_menu_event *menu_event;
@@ -2059,7 +2061,7 @@ static void menu_settings_common(running_machine *machine, ui_menu *menu, void *
switches menus
-------------------------------------------------*/
-static void menu_settings_populate(running_machine *machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type)
+static void menu_settings_populate(running_machine &machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type)
{
const input_field_config *field;
const input_port_config *port;
@@ -2071,7 +2073,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett
diplist_tailptr = &menustate->diplist;
/* loop over input ports and set up the current values */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->type == type && input_condition_true(machine, &field->condition))
{
@@ -2141,7 +2143,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett
rendering
-------------------------------------------------*/
-static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
+static void menu_settings_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{
const input_field_config *field = (const input_field_config *)selectedref;
settings_menu_state *menustate = (settings_menu_state *)state;
@@ -2248,7 +2250,7 @@ static void menu_settings_custom_render_one(render_container *container, float x
menu_analog - handle the analog settings menu
-------------------------------------------------*/
-static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_analog(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2317,7 +2319,7 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter
settings menu
-------------------------------------------------*/
-static void menu_analog_populate(running_machine *machine, ui_menu *menu)
+static void menu_analog_populate(running_machine &machine, ui_menu *menu)
{
const input_field_config *field;
const input_port_config *port;
@@ -2325,7 +2327,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
astring text;
/* loop over input ports and add the items */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (input_type_is_analog(field->type) && input_condition_true(machine, &field->condition))
{
@@ -2427,7 +2429,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
information menu
-------------------------------------------------*/
-static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_bookkeeping(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
attotime *prevtime;
attotime curtime;
@@ -2438,7 +2440,7 @@ static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *para
prevtime = (attotime *)state;
/* if the time has rolled over another second, regenerate */
- curtime = machine->time();
+ curtime = machine.time();
if (prevtime->seconds != curtime.seconds)
{
ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
@@ -2456,7 +2458,7 @@ static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *para
information menu
-------------------------------------------------*/
-static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, attotime *curtime)
+static void menu_bookkeeping_populate(running_machine &machine, ui_menu *menu, attotime *curtime)
{
int tickets = get_dispensed_tickets(machine);
astring tempstring;
@@ -2502,7 +2504,7 @@ static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, a
menu
-------------------------------------------------*/
-static void menu_game_info(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_game_info(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* if the menu isn't built, populate now */
if (!ui_menu_populated(menu))
@@ -2520,7 +2522,7 @@ static void menu_game_info(running_machine *machine, ui_menu *menu, void *parame
menu_cheat - handle the cheat menu
-------------------------------------------------*/
-static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_cheat(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2542,7 +2544,7 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
/* handle reset all + reset all cheats for reload all option */
if ((FPTR)menu_event->itemref < 3 && menu_event->iptkey == IPT_UI_SELECT)
{
- for (cheat_entry *curcheat = machine->cheat().first(); curcheat != NULL; curcheat = curcheat->next())
+ for (cheat_entry *curcheat = machine.cheat().first(); curcheat != NULL; curcheat = curcheat->next())
if (curcheat->select_default_state())
changed = true;
}
@@ -2590,7 +2592,7 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
if ((FPTR)menu_event->itemref == 2 && menu_event->iptkey == IPT_UI_SELECT)
{
/* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */
- machine->cheat().reload();
+ machine.cheat().reload();
/* display the reloaded cheats */
ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
@@ -2608,12 +2610,12 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
menu_cheat_populate - populate the cheat menu
-------------------------------------------------*/
-static void menu_cheat_populate(running_machine *machine, ui_menu *menu)
+static void menu_cheat_populate(running_machine &machine, ui_menu *menu)
{
/* iterate over cheats */
astring text;
astring subtext;
- for (cheat_entry *curcheat = machine->cheat().first(); curcheat != NULL; curcheat = curcheat->next())
+ for (cheat_entry *curcheat = machine.cheat().first(); curcheat != NULL; curcheat = curcheat->next())
{
UINT32 flags;
curcheat->menu_text(text, subtext, flags);
@@ -2636,7 +2638,7 @@ static void menu_cheat_populate(running_machine *machine, ui_menu *menu)
menu
-------------------------------------------------*/
-static void menu_memory_card(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_memory_card(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
int *cardnum;
@@ -2665,10 +2667,10 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
{
/* handle card loading; if we succeed, clear the menus */
case MEMCARD_ITEM_LOAD:
- if (memcard_insert(menu->machine, *cardnum) == 0)
+ if (memcard_insert(menu->machine(), *cardnum) == 0)
{
popmessage("Memory card loaded");
- ui_menu_stack_reset(menu->machine);
+ ui_menu_stack_reset(menu->machine());
}
else
popmessage("Error loading memory card");
@@ -2676,13 +2678,13 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
/* handle card ejecting */
case MEMCARD_ITEM_EJECT:
- memcard_eject(*menu->machine);
+ memcard_eject(menu->machine());
popmessage("Memory card ejected");
break;
/* handle card creating */
case MEMCARD_ITEM_CREATE:
- if (memcard_create(menu->machine, *cardnum, FALSE) == 0)
+ if (memcard_create(menu->machine(), *cardnum, FALSE) == 0)
popmessage("Memory card created");
else
popmessage("Error creating memory card\n(Card may already exist)");
@@ -2717,7 +2719,7 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
memory card menu
-------------------------------------------------*/
-static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, int cardnum)
+static void menu_memory_card_populate(running_machine &machine, ui_menu *menu, int cardnum)
{
char tempstring[20];
UINT32 flags = 0;
@@ -2742,7 +2744,7 @@ static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, i
menu_sliders - handle the sliders menu
-------------------------------------------------*/
-static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_sliders(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
int menuless_mode = (parameter != NULL);
const ui_menu_event *menu_event;
@@ -2852,7 +2854,7 @@ static void menu_sliders(running_machine *machine, ui_menu *menu, void *paramete
menu
-------------------------------------------------*/
-static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int menuless_mode)
+static void menu_sliders_populate(running_machine &machine, ui_menu *menu, int menuless_mode)
{
const slider_state *curslider;
astring tempstring;
@@ -2872,7 +2874,7 @@ static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int m
break;
}
- ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height(*machine) + 2.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height(machine) + 2.0f * UI_BOX_TB_BORDER);
}
@@ -2881,13 +2883,13 @@ static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int m
rendering
-------------------------------------------------*/
-static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
+static void menu_sliders_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{
const slider_state *curslider = (const slider_state *)selectedref;
if (curslider != NULL)
{
float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x;
- float line_height = ui_get_line_height(*machine);
+ float line_height = ui_get_line_height(machine);
float percentage, default_percentage;
astring tempstring;
float text_height;
@@ -2952,7 +2954,7 @@ static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu,
menu
-------------------------------------------------*/
-static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_video_targets(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2972,14 +2974,14 @@ static void menu_video_targets(running_machine *machine, ui_menu *menu, void *pa
video targets menu
-------------------------------------------------*/
-static void menu_video_targets_populate(running_machine *machine, ui_menu *menu)
+static void menu_video_targets_populate(running_machine &machine, ui_menu *menu)
{
int targetnum;
/* find the targets */
for (targetnum = 0; ; targetnum++)
{
- render_target *target = machine->render().target_by_index(targetnum);
+ render_target *target = machine.render().target_by_index(targetnum);
char buffer[40];
/* stop when we run out */
@@ -2998,9 +3000,9 @@ static void menu_video_targets_populate(running_machine *machine, ui_menu *menu)
menu
-------------------------------------------------*/
-static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_video_options(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
- render_target *target = (parameter != NULL) ? (render_target *)parameter : machine->render().first_target();
+ render_target *target = (parameter != NULL) ? (render_target *)parameter : machine.render().first_target();
const ui_menu_event *menu_event;
int changed = FALSE;
@@ -3086,7 +3088,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa
video options menu
-------------------------------------------------*/
-static void menu_video_options_populate(running_machine *machine, ui_menu *menu, render_target *target)
+static void menu_video_options_populate(running_machine &machine, ui_menu *menu, render_target *target)
{
const char *subtext = "";
astring tempstring;
@@ -3141,7 +3143,7 @@ static void menu_video_options_populate(running_machine *machine, ui_menu *menu,
menu
-------------------------------------------------*/
-static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_crosshair(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -3246,7 +3248,7 @@ static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parame
crosshair settings menu
-------------------------------------------------*/
-static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
+static void menu_crosshair_populate(running_machine &machine, ui_menu *menu)
{
crosshair_user_settings settings;
crosshair_item_data *data;
@@ -3299,7 +3301,7 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
/* search for crosshair graphics */
/* open a path to the crosshairs */
- file_enumerator path(machine->options().crosshair_path());
+ file_enumerator path(machine.options().crosshair_path());
const osd_directory_entry *dir;
/* reset search flags */
int using_default = FALSE;
@@ -3401,10 +3403,10 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
quitting the game
-------------------------------------------------*/
-static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_quit_game(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* request a reset */
- machine->schedule_exit();
+ machine.schedule_exit();
/* reset the menu stack */
ui_menu_stack_reset(machine);
@@ -3416,7 +3418,7 @@ static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parame
menu
-------------------------------------------------*/
-static void menu_select_game(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_select_game(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
select_game_state *menustate;
const ui_menu_event *menu_event;
@@ -3452,7 +3454,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
/* special case for configure inputs */
if ((FPTR)driver == 1)
- ui_menu_stack_push(ui_menu_alloc(menu->machine, menu->container, menu_input_groups, NULL));
+ ui_menu_stack_push(ui_menu_alloc(menu->machine(), menu->container, menu_input_groups, NULL));
/* anything else is a driver */
else
@@ -3462,7 +3464,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
int audit_result;
/* audit the game first to see if we're going to work */
- audit_records = audit_images(menu->machine->options(), driver, AUDIT_VALIDATE_FAST, &audit);
+ audit_records = audit_images(menu->machine().options(), driver, AUDIT_VALIDATE_FAST, &audit);
audit_result = audit_summary(driver, audit_records, audit, FALSE);
if (audit_records > 0)
global_free(audit);
@@ -3470,7 +3472,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
/* if everything looks good, schedule the new driver */
if (audit_result == CORRECT || audit_result == BEST_AVAILABLE)
{
- machine->schedule_new_driver(*driver);
+ machine.schedule_new_driver(*driver);
ui_menu_stack_reset(machine);
}
@@ -3487,7 +3489,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
else if (menu_event->iptkey == IPT_UI_CANCEL && menustate->search[0] != 0)
{
/* since we have already been popped, we must recreate ourself from scratch */
- ui_menu_stack_push(ui_menu_alloc(menu->machine, menu->container, menu_select_game, NULL));
+ ui_menu_stack_push(ui_menu_alloc(menu->machine(), menu->container, menu_select_game, NULL));
}
/* typed characters append to the buffer */
@@ -3527,7 +3529,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
select menu
-------------------------------------------------*/
-static void menu_select_game_populate(running_machine *machine, ui_menu *menu, select_game_state *menustate)
+static void menu_select_game_populate(running_machine &machine, ui_menu *menu, select_game_state *menustate)
{
int matchcount;
int curitem;
@@ -3572,7 +3574,7 @@ static void menu_select_game_populate(running_machine *machine, ui_menu *menu, s
}
/* configure the custom rendering */
- ui_menu_set_custom_render(menu, menu_select_game_custom_render, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 4.0f * ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, menu_select_game_custom_render, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 4.0f * ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER);
}
@@ -3614,7 +3616,7 @@ static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state
memset(found, 0, (driver_count + 7) / 8);
/* open a path to the ROMs and find them in the array */
- file_enumerator path(menu->machine->options().media_path());
+ file_enumerator path(menu->machine().options().media_path());
const osd_directory_entry *dir;
/* iterate while we get new objects */
@@ -3660,7 +3662,7 @@ static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state
special rendering
-------------------------------------------------*/
-static void menu_select_game_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void menu_select_game_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
select_game_state *menustate = (select_game_state *)state;
const game_driver *driver;
@@ -3798,7 +3800,7 @@ static void menu_select_game_custom_render(running_machine *machine, ui_menu *me
{
ui_draw_text_full(menu->container, &tempbuf[line][0], x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
- y1 += ui_get_line_height(*machine);
+ y1 += ui_get_line_height(machine);
}
}
diff --git a/src/emu/uimenu.h b/src/emu/uimenu.h
index b58dd9f2b33..4e4d5e4f20f 100644
--- a/src/emu/uimenu.h
+++ b/src/emu/uimenu.h
@@ -57,8 +57,8 @@ typedef struct _ui_menu ui_menu;
/* menu-related callback functions */
-typedef void (*ui_menu_handler_func)(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-typedef void (*ui_menu_custom_func)(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+typedef void (*ui_menu_handler_func)(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+typedef void (*ui_menu_custom_func)(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
typedef void (*ui_menu_destroy_state_func)(ui_menu *menu, void *state);
@@ -81,14 +81,14 @@ struct _ui_menu_event
/* ----- core system management ----- */
/* initialization */
-void ui_menu_init(running_machine *machine);
+void ui_menu_init(running_machine &machine);
/* ----- core menu management ----- */
/* allocate a new menu */
-ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui_menu_handler_func handler, void *parameter);
+ui_menu *ui_menu_alloc(running_machine &machine, render_container *container, ui_menu_handler_func handler, void *parameter);
/* free a menu */
void ui_menu_free(ui_menu *menu);
@@ -103,7 +103,7 @@ int ui_menu_populated(ui_menu *menu);
void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, UINT32 flags, void *ref);
/* process a menu, drawing it and returning any interesting events */
-const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags);
+const ui_menu_event *ui_menu_process(running_machine &machine, ui_menu *menu, UINT32 flags);
/* configure the menu for custom rendering */
void ui_menu_set_custom_render(ui_menu *menu, ui_menu_custom_func custom, float top, float bottom);
@@ -128,26 +128,26 @@ void ui_menu_set_selection(ui_menu *menu, void *selected_itemref);
/* ----- menu stack management ----- */
/* reset the menus, clearing everything */
-void ui_menu_stack_reset(running_machine *machine);
+void ui_menu_stack_reset(running_machine &machine);
/* push a new menu onto the stack */
void ui_menu_stack_push(ui_menu *menu);
/* pop a menu from the stack */
-void ui_menu_stack_pop(running_machine *machine);
+void ui_menu_stack_pop(running_machine &machine);
/* ----- UI system interaction ----- */
/* master handler */
-UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_menu_ui_handler(running_machine &machine, render_container *container, UINT32 state);
/* slider handler */
-UINT32 ui_slider_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_slider_ui_handler(running_machine &machine, render_container *container, UINT32 state);
/* force game select menu */
-void ui_menu_force_game_select(running_machine *machine, render_container *container);
+void ui_menu_force_game_select(running_machine &machine, render_container *container);
int ui_menu_is_force_game_select(void);
diff --git a/src/emu/video.c b/src/emu/video.c
index 5cc3c54698b..aed2ef572bc 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -234,10 +234,10 @@ void video_manager::frame_update(bool debug)
}
// draw the user interface
- ui_update_and_render(&m_machine, &m_machine.render().ui_container());
+ ui_update_and_render(m_machine, &m_machine.render().ui_container());
// update the internal render debugger
- debugint_update_during_game(&m_machine);
+ debugint_update_during_game(m_machine);
// if we're throttling, synchronize before rendering
attotime current_time = m_machine.time();
@@ -265,7 +265,7 @@ void video_manager::frame_update(bool debug)
if (phase == MACHINE_PHASE_RUNNING)
{
// reset partial updates if we're paused or if the debugger is active
- if (m_machine.primary_screen != NULL && (m_machine.paused() || debug || debugger_within_instruction_hook(&m_machine)))
+ if (m_machine.primary_screen != NULL && (m_machine.paused() || debug || debugger_within_instruction_hook(m_machine)))
m_machine.primary_screen->scanline0_callback();
// otherwise, call the video EOF callback
@@ -452,7 +452,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
else if (format == MF_MNG)
{
// create a new movie file and start recording
- m_mngfile = auto_alloc(&m_machine, emu_file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ m_mngfile = auto_alloc(m_machine, emu_file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr;
if (name != NULL)
filerr = m_mngfile->open(name);
@@ -497,7 +497,7 @@ void video_manager::end_recording()
if (m_mngfile != NULL)
{
mng_capture_stop(*m_mngfile);
- auto_free(&m_machine, m_mngfile);
+ auto_free(m_machine, m_mngfile);
m_mngfile = NULL;
}
@@ -1082,8 +1082,8 @@ void video_manager::create_snapshot_bitmap(device_t *screen)
if (m_snap_bitmap == NULL || width != m_snap_bitmap->width || height != m_snap_bitmap->height)
{
if (m_snap_bitmap != NULL)
- auto_free(&m_machine, m_snap_bitmap);
- m_snap_bitmap = auto_alloc(&m_machine, bitmap_t(width, height, BITMAP_FORMAT_RGB32));
+ auto_free(m_machine, m_snap_bitmap);
+ m_snap_bitmap = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_RGB32));
}
// render the screen there
@@ -1294,10 +1294,10 @@ void video_manager::record_frame()
invalid palette index
-------------------------------------------------*/
-void video_assert_out_of_range_pixels(running_machine *machine, bitmap_t *bitmap)
+void video_assert_out_of_range_pixels(running_machine &machine, bitmap_t *bitmap)
{
#ifdef MAME_DEBUG
- int maxindex = palette_get_max_index(machine->palette);
+ int maxindex = palette_get_max_index(machine.palette);
int x, y;
// this only applies to indexed16 bitmaps
diff --git a/src/emu/video.h b/src/emu/video.h
index e83e06d96f3..b928f9b6d0f 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -204,7 +204,7 @@ private:
// ----- debugging helpers -----
// assert if any pixels in the given bitmap contain an invalid palette index
-void video_assert_out_of_range_pixels(running_machine *machine, bitmap_t *bitmap);
+void video_assert_out_of_range_pixels(running_machine &machine, bitmap_t *bitmap);
#endif /* __VIDEO_H__ */
diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c
index f048f8929f2..88ea8b4a6ad 100644
--- a/src/emu/video/crt9007.c
+++ b/src/emu/video/crt9007.c
@@ -255,7 +255,7 @@ device_config *crt9007_device_config::static_alloc_device_config(const machine_c
device_t *crt9007_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9007_device(machine, *this));
+ return auto_alloc(machine, crt9007_device(machine, *this));
}
@@ -566,7 +566,7 @@ void crt9007_device::device_start()
devcb_resolve_write_line(&m_out_sld_func, &m_config.out_sld_func, this);
// get the screen device
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
assert(m_screen != NULL);
// set horizontal pixels per column
diff --git a/src/emu/video/crt9021.c b/src/emu/video/crt9021.c
index 13844f4808f..dd159dd2ba4 100644
--- a/src/emu/video/crt9021.c
+++ b/src/emu/video/crt9021.c
@@ -103,7 +103,7 @@ device_config *crt9021_device_config::static_alloc_device_config(const machine_c
device_t *crt9021_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9021_device(machine, *this));
+ return auto_alloc(machine, crt9021_device(machine, *this));
}
@@ -166,7 +166,7 @@ void crt9021_device::device_start()
devcb_resolve_read_line(&m_in_atten_func, &m_config.in_atten_func, this);
// get the screen device
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
assert(m_screen != NULL);
// register for state saving
diff --git a/src/emu/video/crt9212.c b/src/emu/video/crt9212.c
index 0a91fc8948a..8b6e75e5766 100644
--- a/src/emu/video/crt9212.c
+++ b/src/emu/video/crt9212.c
@@ -76,7 +76,7 @@ device_config *crt9212_device_config::static_alloc_device_config(const machine_c
device_t *crt9212_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9212_device(machine, *this));
+ return auto_alloc(machine, crt9212_device(machine, *this));
}
diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c
index 9b74b409f6e..f600106dc4b 100644
--- a/src/emu/video/generic.c
+++ b/src/emu/video/generic.c
@@ -118,9 +118,9 @@ const gfx_layout gfx_16x16x4_planar =
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_le(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_le(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset & ~1] | (machine->generic.paletteram.u8[offset | 1] << 8);
+ return machine.generic.paletteram.u8[offset & ~1] | (machine.generic.paletteram.u8[offset | 1] << 8);
}
@@ -130,9 +130,9 @@ INLINE UINT16 paletteram16_le(running_machine *machine, offs_t offset)
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_be(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_be(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset | 1] | (machine->generic.paletteram.u8[offset & ~1] << 8);
+ return machine.generic.paletteram.u8[offset | 1] | (machine.generic.paletteram.u8[offset & ~1] << 8);
}
@@ -142,9 +142,9 @@ INLINE UINT16 paletteram16_be(running_machine *machine, offs_t offset)
RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_split(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_split(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset] | (machine->generic.paletteram2.u8[offset] << 8);
+ return machine.generic.paletteram.u8[offset] | (machine.generic.paletteram2.u8[offset] << 8);
}
@@ -154,9 +154,9 @@ INLINE UINT16 paletteram16_split(running_machine *machine, offs_t offset)
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT32 paletteram32_be(running_machine *machine, offs_t offset)
+INLINE UINT32 paletteram32_be(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u16[offset | 1] | (machine->generic.paletteram.u16[offset & ~1] << 16);
+ return machine.generic.paletteram.u16[offset | 1] | (machine.generic.paletteram.u16[offset & ~1] << 16);
}
@@ -166,7 +166,7 @@ INLINE UINT32 paletteram32_be(running_machine *machine, offs_t offset)
shift values
-------------------------------------------------*/
-INLINE void set_color_444(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_444(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal4bit(data >> rshift), pal4bit(data >> gshift), pal4bit(data >> bshift));
}
@@ -178,7 +178,7 @@ INLINE void set_color_444(running_machine *machine, pen_t color, int rshift, int
shift values
-------------------------------------------------*/
-INLINE void set_color_4444(running_machine *machine, pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_4444(running_machine &machine, pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data)
{
static const UINT8 ztable[16] =
{ 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 };
@@ -199,7 +199,7 @@ INLINE void set_color_4444(running_machine *machine, pen_t color, int ishift, in
shift values
-------------------------------------------------*/
-INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
@@ -211,7 +211,7 @@ INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int
shift values
-------------------------------------------------*/
-INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
+INLINE void set_color_888(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
{
palette_set_color_rgb(machine, color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
}
@@ -227,34 +227,34 @@ INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int
register for save states
-------------------------------------------------*/
-void generic_video_init(running_machine *machine)
+void generic_video_init(running_machine &machine)
{
generic_video_private *state;
- state = machine->generic_video_data = auto_alloc_clear(machine, generic_video_private);
+ state = machine.generic_video_data = auto_alloc_clear(machine, generic_video_private);
- machine->state().save_item(NAME(state->flip_screen_x));
- machine->state().save_item(NAME(state->flip_screen_y));
+ machine.state().save_item(NAME(state->flip_screen_x));
+ machine.state().save_item(NAME(state->flip_screen_y));
// create spriteram buffers if necessary
- if (machine->config().m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
+ if (machine.config().m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
{
- assert_always(machine->generic.spriteram_size != 0, "Video buffers spriteram but spriteram size is 0");
+ assert_always(machine.generic.spriteram_size != 0, "Video buffers spriteram but spriteram size is 0");
// allocate memory for the back buffer
- machine->generic.buffered_spriteram.u8 = auto_alloc_array(machine, UINT8, machine->generic.spriteram_size);
+ machine.generic.buffered_spriteram.u8 = auto_alloc_array(machine, UINT8, machine.generic.spriteram_size);
// register for saving it
- state_save_register_global_pointer(machine, machine->generic.buffered_spriteram.u8, machine->generic.spriteram_size);
+ state_save_register_global_pointer(machine, machine.generic.buffered_spriteram.u8, machine.generic.spriteram_size);
// do the same for the second back buffer, if present
- if (machine->generic.spriteram2_size)
+ if (machine.generic.spriteram2_size)
{
// allocate memory
- machine->generic.buffered_spriteram2.u8 = auto_alloc_array(machine, UINT8, machine->generic.spriteram2_size);
+ machine.generic.buffered_spriteram2.u8 = auto_alloc_array(machine, UINT8, machine.generic.spriteram2_size);
// register for saving it
- state_save_register_global_pointer(machine, machine->generic.buffered_spriteram2.u8, machine->generic.spriteram2_size);
+ state_save_register_global_pointer(machine, machine.generic.buffered_spriteram2.u8, machine.generic.spriteram2_size);
}
}
}
@@ -273,10 +273,10 @@ void generic_video_init(running_machine *machine)
VIDEO_START( generic_bitmapped )
{
/* allocate the temporary bitmap */
- machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ machine.generic.tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
/* ensure the contents of the bitmap are saved */
- machine->state().save_item(NAME(*machine->generic.tmpbitmap));
+ machine.state().save_item(NAME(*machine.generic.tmpbitmap));
}
@@ -287,7 +287,7 @@ VIDEO_START( generic_bitmapped )
SCREEN_UPDATE( generic_bitmapped )
{
- copybitmap(bitmap, screen->machine->generic.tmpbitmap, 0, 0, 0, 0, cliprect);
+ copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
return 0;
}
@@ -348,17 +348,17 @@ more control is needed over what is buffered.
WRITE8_HANDLER( buffer_spriteram_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u8, space->machine->generic.spriteram.u8, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u8, space->machine().generic.spriteram.u8, space->machine().generic.spriteram_size);
}
WRITE16_HANDLER( buffer_spriteram16_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u16, space->machine->generic.spriteram.u16, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u16, space->machine().generic.spriteram.u16, space->machine().generic.spriteram_size);
}
WRITE32_HANDLER( buffer_spriteram32_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u32, space->machine->generic.spriteram.u32, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u32, space->machine().generic.spriteram.u32, space->machine().generic.spriteram_size);
}
@@ -369,17 +369,17 @@ WRITE32_HANDLER( buffer_spriteram32_w )
WRITE8_HANDLER( buffer_spriteram_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u8, space->machine->generic.spriteram2.u8, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u8, space->machine().generic.spriteram2.u8, space->machine().generic.spriteram2_size);
}
WRITE16_HANDLER( buffer_spriteram16_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u16, space->machine->generic.spriteram2.u16, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u16, space->machine().generic.spriteram2.u16, space->machine().generic.spriteram2_size);
}
WRITE32_HANDLER( buffer_spriteram32_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u32, space->machine->generic.spriteram2.u32, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u32, space->machine().generic.spriteram2.u32, space->machine().generic.spriteram2_size);
}
@@ -388,14 +388,14 @@ WRITE32_HANDLER( buffer_spriteram32_2_w )
spriteram
-------------------------------------------------*/
-void buffer_spriteram(running_machine *machine, UINT8 *ptr, int length)
+void buffer_spriteram(running_machine &machine, UINT8 *ptr, int length)
{
- memcpy(machine->generic.buffered_spriteram.u8, ptr, length);
+ memcpy(machine.generic.buffered_spriteram.u8, ptr, length);
}
-void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length)
+void buffer_spriteram_2(running_machine &machine, UINT8 *ptr, int length)
{
- memcpy(machine->generic.buffered_spriteram2.u8, ptr, length);
+ memcpy(machine.generic.buffered_spriteram2.u8, ptr, length);
}
@@ -408,13 +408,13 @@ void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length)
updateflip - handle global flipping
-------------------------------------------------*/
-static void updateflip(running_machine *machine)
+static void updateflip(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
- attoseconds_t period = machine->primary_screen->frame_period().attoseconds;
- rectangle visarea = machine->primary_screen->visible_area();
+ generic_video_private *state = machine.generic_video_data;
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
+ attoseconds_t period = machine.primary_screen->frame_period().attoseconds;
+ rectangle visarea = machine.primary_screen->visible_area();
tilemap_set_flip_all(machine,(TILEMAP_FLIPX & state->flip_screen_x) | (TILEMAP_FLIPY & state->flip_screen_y));
@@ -435,7 +435,7 @@ static void updateflip(running_machine *machine)
visarea.max_y = temp;
}
- machine->primary_screen->configure(width, height, visarea, period);
+ machine.primary_screen->configure(width, height, visarea, period);
}
@@ -443,9 +443,9 @@ static void updateflip(running_machine *machine)
flip_screen_set - set global flip
-------------------------------------------------*/
-void flip_screen_set(running_machine *machine, int on)
+void flip_screen_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_x != on || state->flip_screen_y != on)
{
@@ -461,14 +461,14 @@ void flip_screen_set(running_machine *machine, int on)
do not call update_flip.
-------------------------------------------------*/
-void flip_screen_set_no_update(running_machine *machine, int on)
+void flip_screen_set_no_update(running_machine &machine, int on)
{
/* flip_screen_y is not updated on purpose
* this function is for drivers which
* where writing to flip_screen_x to
* bypass update_flip
*/
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
state->flip_screen_x = on;
}
@@ -478,9 +478,9 @@ void flip_screen_set_no_update(running_machine *machine, int on)
flip_screen_x_set - set global horizontal flip
-------------------------------------------------*/
-void flip_screen_x_set(running_machine *machine, int on)
+void flip_screen_x_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_x != on)
{
@@ -494,9 +494,9 @@ void flip_screen_x_set(running_machine *machine, int on)
flip_screen_y_set - set global vertical flip
-------------------------------------------------*/
-void flip_screen_y_set(running_machine *machine, int on)
+void flip_screen_y_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_y != on)
{
@@ -510,9 +510,9 @@ void flip_screen_y_set(running_machine *machine, int on)
flip_screen_get - get global flip
-------------------------------------------------*/
-int flip_screen_get(running_machine *machine)
+int flip_screen_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_x;
}
@@ -521,9 +521,9 @@ int flip_screen_get(running_machine *machine)
flip_screen_x_get - get global x flip
-------------------------------------------------*/
-int flip_screen_x_get(running_machine *machine)
+int flip_screen_x_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_x;
}
@@ -532,9 +532,9 @@ int flip_screen_x_get(running_machine *machine)
flip_screen_get - get global y flip
-------------------------------------------------*/
-int flip_screen_y_get(running_machine *machine)
+int flip_screen_y_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_y;
}
@@ -552,7 +552,7 @@ PALETTE_INIT( all_black )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
palette_set_color(machine,i,RGB_BLACK); /* black */
}
@@ -606,7 +606,7 @@ PALETTE_INIT( RRRR_GGGG_BBBB )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -618,17 +618,17 @@ PALETTE_INIT( RRRR_GGGG_BBBB )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[i + 2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + 2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + 2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + 2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + 2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + 2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + 2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + 2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -688,8 +688,8 @@ PALETTE_INIT( RRRRR_GGGGGG_BBBBB )
WRITE8_HANDLER( paletteram_RRRGGGBB_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
}
@@ -699,8 +699,8 @@ WRITE8_HANDLER( paletteram_RRRGGGBB_w )
WRITE8_HANDLER( paletteram_BBGGGRRR_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
@@ -712,8 +712,8 @@ WRITE8_HANDLER( paletteram_BBGGRRII_w )
{
int i = (data >> 0) & 3;
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal4bit(((data >> 0) & 0x0c) | i),
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal4bit(((data >> 0) & 0x0c) | i),
pal4bit(((data >> 2) & 0x0c) | i),
pal4bit(((data >> 4) & 0x0c) | i));
}
@@ -726,8 +726,8 @@ WRITE8_HANDLER( paletteram_IIBBGGRR_w )
{
int i = (data >> 6) & 3;
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal4bit(((data << 2) & 0x0c) | i),
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal4bit(((data << 2) & 0x0c) | i),
pal4bit(((data >> 0) & 0x0c) | i),
pal4bit(((data >> 2) & 0x0c) | i));
}
@@ -744,32 +744,32 @@ WRITE8_HANDLER( paletteram_IIBBGGRR_w )
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 0, 4, 8, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 0, 4, 8, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 0, 4, 8, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 0, 4, 8, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 0, 4, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 0, 4, 8, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 0, 4, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 0, 4, 8, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxBBBBGGGGRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 0, 4, 8, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 0, 4, 8, space->machine().generic.paletteram.u16[offset]);
}
@@ -779,32 +779,32 @@ WRITE16_HANDLER( paletteram16_xxxxBBBBGGGGRRRR_word_w )
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 4, 0, 8, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 4, 0, 8, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 4, 0, 8, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 4, 0, 8, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 4, 0, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 4, 0, 8, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 4, 0, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 4, 0, 8, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxBBBBRRRRGGGG_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 4, 0, 8, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 4, 0, 8, space->machine().generic.paletteram.u16[offset]);
}
@@ -814,14 +814,14 @@ WRITE16_HANDLER( paletteram16_xxxxBBBBRRRRGGGG_word_w )
WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 0, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 0, 4, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 0, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 0, 4, paletteram16_split(space->machine(), offset));
}
@@ -831,32 +831,32 @@ WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split2_w )
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 8, 4, 0, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 8, 4, 0, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 8, 4, 0, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 8, 4, 0, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 4, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 4, 0, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 4, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 4, 0, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxRRRRGGGGBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 8, 4, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 8, 4, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -866,26 +866,26 @@ WRITE16_HANDLER( paletteram16_xxxxRRRRGGGGBBBB_word_w )
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 12, 8, 4, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 12, 8, 4, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 12, 8, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 12, 8, 4, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 12, 8, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 12, 8, 4, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBxxxx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 12, 8, 4, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 12, 8, 4, space->machine().generic.paletteram.u16[offset]);
}
@@ -900,32 +900,32 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBxxxx_word_w )
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 0, 5, 10, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 0, 5, 10, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 0, 5, 10, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 0, 5, 10, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 0, 5, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 0, 5, 10, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 0, 5, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 0, 5, 10, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xBBBBBGGGGGRRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 0, 5, 10, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 0, 5, 10, space->machine().generic.paletteram.u16[offset]);
}
@@ -935,14 +935,14 @@ WRITE16_HANDLER( paletteram16_xBBBBBGGGGGRRRRR_word_w )
WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 5, 0, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 5, 0, 10, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 5, 0, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 5, 0, 10, paletteram16_split(space->machine(), offset));
}
@@ -952,32 +952,32 @@ WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split2_w )
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 10, 5, 0, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 10, 5, 0, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 10, 5, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 10, 5, 0, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 10, 5, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 10, 5, 0, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xRRRRRGGGGGBBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 10, 5, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 10, 5, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -987,8 +987,8 @@ WRITE16_HANDLER( paletteram16_xRRRRRGGGGGBBBBB_word_w )
WRITE16_HANDLER( paletteram16_xGGGGGRRRRRBBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 5, 10, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 5, 10, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -998,8 +998,8 @@ WRITE16_HANDLER( paletteram16_xGGGGGRRRRRBBBBB_word_w )
WRITE16_HANDLER( paletteram16_xGGGGGBBBBBRRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 0, 10, 5, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 0, 10, 5, space->machine().generic.paletteram.u16[offset]);
}
@@ -1009,8 +1009,8 @@ WRITE16_HANDLER( paletteram16_xGGGGGBBBBBRRRRR_word_w )
WRITE16_HANDLER( paletteram16_GGGGGRRRRRBBBBBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 6, 11, 1, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 6, 11, 1, space->machine().generic.paletteram.u16[offset]);
}
/*-------------------------------------------------
@@ -1019,8 +1019,8 @@ WRITE16_HANDLER( paletteram16_GGGGGRRRRRBBBBBx_word_w )
WRITE16_HANDLER( paletteram16_RRRRRGGGGGBBBBBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 11, 6, 1, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 11, 6, 1, space->machine().generic.paletteram.u16[offset]);
}
@@ -1030,9 +1030,9 @@ WRITE16_HANDLER( paletteram16_RRRRRGGGGGBBBBBx_word_w )
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBRGBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- data = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ data = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
pal5bit(((data >> 7) & 0x1e) | ((data >> 2) & 0x01)),
pal5bit(((data >> 3) & 0x1e) | ((data >> 1) & 0x01)));
}
@@ -1049,8 +1049,8 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBRGBx_word_w )
WRITE16_HANDLER( paletteram16_IIIIRRRRGGGGBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_4444(space->machine, offset, 12, 8, 4, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_4444(space->machine(), offset, 12, 8, 4, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -1060,8 +1060,8 @@ WRITE16_HANDLER( paletteram16_IIIIRRRRGGGGBBBB_word_w )
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBIIII_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_4444(space->machine, offset, 0, 12, 8, 4, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_4444(space->machine(), offset, 0, 12, 8, 4, space->machine().generic.paletteram.u16[offset]);
}
@@ -1076,8 +1076,8 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBIIII_word_w )
WRITE16_HANDLER( paletteram16_xrgb_word_be_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_888(space->machine, offset / 2, 16, 8, 0, paletteram32_be(space->machine, offset));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_888(space->machine(), offset / 2, 16, 8, 0, paletteram32_be(space->machine(), offset));
}
@@ -1087,6 +1087,6 @@ WRITE16_HANDLER( paletteram16_xrgb_word_be_w )
WRITE16_HANDLER( paletteram16_xbgr_word_be_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_888(space->machine, offset / 2, 0, 8, 16, paletteram32_be(space->machine, offset));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_888(space->machine(), offset / 2, 0, 8, 16, paletteram32_be(space->machine(), offset));
}
diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h
index 90796c75591..9ed617608d8 100644
--- a/src/emu/video/generic.h
+++ b/src/emu/video/generic.h
@@ -38,7 +38,7 @@ extern const gfx_layout gfx_16x16x4_planar;
/* ----- initialization ----- */
/* set up all the common systems */
-void generic_video_init(running_machine *machine);
+void generic_video_init(running_machine &machine);
/* generic video start with a temporary bitmap */
VIDEO_START( generic_bitmapped );
@@ -59,21 +59,21 @@ WRITE16_HANDLER( buffer_spriteram16_2_w );
WRITE32_HANDLER( buffer_spriteram32_2_w );
/* perform the actual buffering */
-void buffer_spriteram(running_machine *machine, UINT8 *ptr, int length);
-void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length);
+void buffer_spriteram(running_machine &machine, UINT8 *ptr, int length);
+void buffer_spriteram_2(running_machine &machine, UINT8 *ptr, int length);
/* ----- global attributes ----- */
/* set global attributes */
-void flip_screen_set(running_machine *machine, int on);
-void flip_screen_set_no_update(running_machine *machine, int on); /* will not call update_flip */
-void flip_screen_x_set(running_machine *machine, int on);
-void flip_screen_y_set(running_machine *machine, int on);
-int flip_screen_get(running_machine *machine);
-int flip_screen_x_get(running_machine *machine);
-int flip_screen_y_get(running_machine *machine);
+void flip_screen_set(running_machine &machine, int on);
+void flip_screen_set_no_update(running_machine &machine, int on); /* will not call update_flip */
+void flip_screen_x_set(running_machine &machine, int on);
+void flip_screen_y_set(running_machine &machine, int on);
+int flip_screen_get(running_machine &machine);
+int flip_screen_x_get(running_machine &machine);
+int flip_screen_y_get(running_machine &machine);
//#define flip_screen flip_screen_get(machine)
diff --git a/src/emu/video/hd61830.c b/src/emu/video/hd61830.c
index 6fceb8014cb..b8fa2de0f85 100644
--- a/src/emu/video/hd61830.c
+++ b/src/emu/video/hd61830.c
@@ -105,7 +105,7 @@ device_config *hd61830_device_config::static_alloc_device_config(const machine_c
device_t *hd61830_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, hd61830_device(machine, *this));
+ return auto_alloc(machine, hd61830_device(machine, *this));
}
@@ -208,7 +208,7 @@ void hd61830_device::device_start()
// resolve callbacks
devcb_resolve_read8(&m_in_rd_func, &m_config.m_in_rd_func, this);
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
// register for state saving
save_item(NAME(m_bf));
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index 2e8a5efea7e..7d159b45224 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -1037,7 +1037,7 @@ static void hd63484_command_w(device_t *device, UINT16 cmd)
#if LOG_COMMANDS
int i;
- logerror("%s: HD63484 command %s (%04x) ", device->machine->describe_context(), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]);
+ logerror("%s: HD63484 command %s (%04x) ", device->machine().describe_context(), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]);
for (i = 1; i < hd63484->fifo_counter; i++)
logerror("%04x ", hd63484->fifo[i]);
logerror("\n");
@@ -1470,7 +1470,7 @@ READ16_DEVICE_HANDLER( hd63484_status_r )
// if (cpu_get_pc(space->cpu) != 0xfced6 && cpu_get_pc(space->cpu) != 0xfe1d6)
// logerror("%05x: HD63484 status read\n",cpu_get_pc(space->cpu));
- return 0xff22 | (device->machine->rand() & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */
+ return 0xff22 | (device->machine().rand() & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */
}
WRITE16_DEVICE_HANDLER( hd63484_address_w )
@@ -1508,7 +1508,7 @@ READ16_DEVICE_HANDLER( hd63484_data_r )
int res;
if (hd63484->regno == 0x80)
- res = device->machine->primary_screen->vpos();
+ res = device->machine().primary_screen->vpos();
else if (hd63484->regno == 0)
{
#if LOG_COMMANDS
@@ -1562,7 +1562,7 @@ static DEVICE_START( hd63484 )
const hd63484_interface *intf = get_interface(device);
hd63484->skattva_hack = intf->skattva_hack;
- hd63484->ram = auto_alloc_array_clear(device->machine, UINT16, HD63484_RAM_SIZE);
+ hd63484->ram = auto_alloc_array_clear(device->machine(), UINT16, HD63484_RAM_SIZE);
// device->save_item(NAME(hd63484->clear_bitmap));
// device->save_pointer(NAME(hd63484->spriteram), 0x1000);
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index a2858038003..3ea4a924f18 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -208,7 +208,7 @@ INLINE void call_on_update_address(device_t *device, int strobe)
mc6845_t *mc6845 = get_safe_token(device);
if (mc6845->intf->on_update_addr_changed)
- device->machine->scheduler().timer_set(attotime::zero, FUNC(on_update_address_cb), (mc6845->update_addr << 8) | strobe, (void *) device);
+ device->machine().scheduler().timer_set(attotime::zero, FUNC(on_update_address_cb), (mc6845->update_addr << 8) | strobe, (void *) device);
else
fatalerror("M6845: transparent memory mode without handler\n");
}
@@ -289,7 +289,7 @@ WRITE8_DEVICE_HANDLER( mc6845_register_w )
{
mc6845_t *mc6845 = get_safe_token(device);
- if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", device->machine->describe_context(), mc6845->register_address_latch, data);
+ if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", device->machine().describe_context(), mc6845->register_address_latch, data);
switch (mc6845->register_address_latch)
{
@@ -893,10 +893,10 @@ static void common_start(device_t *device, int device_type)
/* get the screen device */
if ( mc6845->intf->screen_tag != NULL )
{
- mc6845->screen = downcast<screen_device *>(device->machine->device(mc6845->intf->screen_tag));
+ mc6845->screen = downcast<screen_device *>(device->machine().device(mc6845->intf->screen_tag));
if (mc6845->screen == NULL) {
astring tempstring;
- mc6845->screen = downcast<screen_device *>(device->machine->device(device->owner()->subtag(tempstring,mc6845->intf->screen_tag)));
+ mc6845->screen = downcast<screen_device *>(device->machine().device(device->owner()->subtag(tempstring,mc6845->intf->screen_tag)));
}
assert(mc6845->screen != NULL);
}
@@ -904,19 +904,19 @@ static void common_start(device_t *device, int device_type)
mc6845->screen = NULL;
/* create the timers */
- mc6845->line_timer = device->machine->scheduler().timer_alloc(FUNC(line_timer_cb), (void *)device);
+ mc6845->line_timer = device->machine().scheduler().timer_alloc(FUNC(line_timer_cb), (void *)device);
- mc6845->de_off_timer = device->machine->scheduler().timer_alloc(FUNC(de_off_timer_cb), (void *)device);
- mc6845->upd_adr_timer = device->machine->scheduler().timer_alloc(FUNC(upd_adr_timer_cb), (void *)device);
+ mc6845->de_off_timer = device->machine().scheduler().timer_alloc(FUNC(de_off_timer_cb), (void *)device);
+ mc6845->upd_adr_timer = device->machine().scheduler().timer_alloc(FUNC(upd_adr_timer_cb), (void *)device);
- mc6845->cur_on_timer = device->machine->scheduler().timer_alloc(FUNC(cur_on_timer_cb), (void *)device);
- mc6845->cur_off_timer = device->machine->scheduler().timer_alloc(FUNC(cur_off_timer_cb), (void *)device);
+ mc6845->cur_on_timer = device->machine().scheduler().timer_alloc(FUNC(cur_on_timer_cb), (void *)device);
+ mc6845->cur_off_timer = device->machine().scheduler().timer_alloc(FUNC(cur_off_timer_cb), (void *)device);
- mc6845->hsync_on_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device);
- mc6845->hsync_off_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device);
+ mc6845->hsync_on_timer = device->machine().scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device);
+ mc6845->hsync_off_timer = device->machine().scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device);
}
- mc6845->light_pen_latch_timer = device->machine->scheduler().timer_alloc(FUNC(light_pen_latch_timer_cb), (void *)device);
+ mc6845->light_pen_latch_timer = device->machine().scheduler().timer_alloc(FUNC(light_pen_latch_timer_cb), (void *)device);
/* Use some large startup values */
mc6845->horiz_char_total = 0xff;
@@ -924,7 +924,7 @@ static void common_start(device_t *device, int device_type)
mc6845->vert_char_total = 0x7f;
/* register for state saving */
- device->machine->state().register_postload(mc6845_state_save_postload, mc6845);
+ device->machine().state().register_postload(mc6845_state_save_postload, mc6845);
device->save_item(NAME(mc6845->clock));
device->save_item(NAME(mc6845->hpixels_per_column));
diff --git a/src/emu/video/msm6255.c b/src/emu/video/msm6255.c
index 9b0b078a7c3..00d43391d2a 100644
--- a/src/emu/video/msm6255.c
+++ b/src/emu/video/msm6255.c
@@ -143,7 +143,7 @@ msm6255_device::msm6255_device(running_machine &_machine, const msm6255_device_c
void msm6255_device::device_start()
{
// find screen
- m_screen = machine->device<screen_device>(m_config.m_screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
// register for state saving
save_item(NAME(m_ir));
@@ -447,6 +447,6 @@ void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
}
else
{
- bitmap_fill(bitmap, cliprect, get_black_pen(machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
}
}
diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c
index 70eb3cbc52f..c38b10067ae 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -80,8 +80,8 @@ static VIDEO_START( vga );
static VIDEO_RESET( ega );
static VIDEO_RESET( vga );
-static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height);
-static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height);
+static pc_video_update_proc pc_vga_choosevideomode(running_machine &machine, int *width, int *height);
+static pc_video_update_proc pc_ega_choosevideomode(running_machine &machine, int *width, int *height);
/***************************************************************************
@@ -594,9 +594,9 @@ static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w,
static READ64_HANDLER( vga_ega64_r ) { return read64be_with_read8_handler(vga_ega_r, space, offset, mem_mask); }
static WRITE64_HANDLER( vga_ega64_w ) { write64be_with_write8_handler(vga_ega_w, space, offset, data, mem_mask); }
-static void vga_cpu_interface(running_machine *machine)
+static void vga_cpu_interface(running_machine &machine)
{
- address_space *space = machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
static int sequencer, gc;
read8_space_func read_handler;
write8_space_func write_handler;
@@ -675,7 +675,7 @@ static void vga_cpu_interface(running_machine *machine)
}
else
{
- buswidth = downcast<cpu_device *>(machine->firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
+ buswidth = downcast<cpu_device *>(machine.firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
@@ -781,7 +781,7 @@ static READ8_HANDLER(vga_crtc_r)
int clock=vga.monitor.get_clock();
int lines=vga.monitor.get_lines();
int columns=vga.monitor.get_columns();
- int diff = (((space->machine->time() - vga.monitor.start_time) * clock).seconds)
+ int diff = (((space->machine().time() - vga.monitor.start_time) * clock).seconds)
%(lines*columns);
if (diff<columns*vga.monitor.get_sync_lines()) data|=8;
diff=diff/lines;
@@ -791,7 +791,7 @@ static READ8_HANDLER(vga_crtc_r)
if (vga.monitor.retrace)
{
data |= 1;
- if ((space->machine->time() - vga.monitor.start_time) > attotime::from_usec(300))
+ if ((space->machine().time() - vga.monitor.start_time) > attotime::from_usec(300))
{
data |= 8;
vga.monitor.retrace=0;
@@ -799,9 +799,9 @@ static READ8_HANDLER(vga_crtc_r)
}
else
{
- if ((space->machine->time() - vga.monitor.start_time) > attotime::from_msec(15))
+ if ((space->machine().time() - vga.monitor.start_time) > attotime::from_msec(15))
vga.monitor.retrace=1;
- vga.monitor.start_time=space->machine->time();
+ vga.monitor.start_time=space->machine().time();
}
#else
// not working with ps2m30
@@ -1053,10 +1053,10 @@ WRITE8_HANDLER(vga_port_03c0_w)
if (vga.sequencer.index < vga.svga_intf.seq_regcount)
{
vga.sequencer.data[vga.sequencer.index] = data;
- vga_cpu_interface(space->machine);
+ vga_cpu_interface(space->machine());
if (vga.sequencer.index == 0)
- vga.monitor.start_time = space->machine->time();
+ vga.monitor.start_time = space->machine().time();
}
break;
case 6:
@@ -1118,7 +1118,7 @@ WRITE8_HANDLER(vga_port_03c0_w)
if (vga.gc.index < vga.svga_intf.gc_regcount)
{
vga.gc.data[vga.gc.index] = data;
- vga_cpu_interface(space->machine);
+ vga_cpu_interface(space->machine());
}
break;
}
@@ -1154,7 +1154,7 @@ READ8_HANDLER( paradise_ega_03c0_r )
-void pc_vga_reset(running_machine *machine)
+void pc_vga_reset(running_machine &machine)
{
/* clear out the VGA structure */
memset(vga.pens, 0, sizeof(vga.pens));
@@ -1217,7 +1217,7 @@ static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vg
static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); }
static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); }
-void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf)
+void pc_vga_init(running_machine &machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf)
{
int i, j, k, mask, buswidth;
address_space *spacevga;
@@ -1265,8 +1265,8 @@ void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_in
memset(vga.crtc.data, '\0', vga.svga_intf.crtc_regcount);
memset(vga.gc.data, '\0', vga.svga_intf.gc_regcount);
- buswidth = downcast<cpu_device *>(machine->firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
- spacevga = machine->firstcpu->memory().space(vga.vga_intf.port_addressspace);
+ buswidth = downcast<cpu_device *>(machine.firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
+ spacevga = machine.firstcpu->memory().space(vga.vga_intf.port_addressspace);
switch(buswidth)
{
case 8:
@@ -1325,7 +1325,7 @@ static VIDEO_START( ega )
vga.monitor.get_columns = ega_get_crtc_columns;
vga.monitor.get_sync_lines = vga_get_crtc_sync_lines;
vga.monitor.get_sync_columns = vga_get_crtc_sync_columns;
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
pc_video_start(machine, pc_ega_choosevideomode, 0);
}
@@ -1340,7 +1340,7 @@ static VIDEO_START( vga )
vga.monitor.get_columns=vga_get_crtc_columns;
vga.monitor.get_sync_lines=vga_get_crtc_sync_lines;
vga.monitor.get_sync_columns=vga_get_crtc_sync_columns;
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
pc_video_start(machine, pc_vga_choosevideomode, 0);
}
@@ -1519,7 +1519,7 @@ static void vga_vh_vga(bitmap_t *bitmap)
}
}
-static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height)
+static pc_video_update_proc pc_ega_choosevideomode(running_machine &machine, int *width, int *height)
{
pc_video_update_proc proc = NULL;
int i;
@@ -1527,7 +1527,7 @@ static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int
//if (CRTC_ON)
{
for (i = 0; i < 16; i++)
- vga.pens[i]=machine->pens[i/*vga.attribute.data[i]&0x3f*/];
+ vga.pens[i]=machine.pens[i/*vga.attribute.data[i]&0x3f*/];
if (!GRAPHIC_MODE)
{
@@ -1545,7 +1545,7 @@ static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int
return proc;
}
-static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height)
+static pc_video_update_proc pc_vga_choosevideomode(running_machine &machine, int *width, int *height)
{
pc_video_update_proc proc = NULL;
int i;
@@ -1567,7 +1567,7 @@ static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int
{
for (i=0; i<16;i++)
{
- vga.pens[i] = machine->pens[(vga.attribute.data[i]&0x0f)
+ vga.pens[i] = machine.pens[(vga.attribute.data[i]&0x0f)
|((vga.attribute.data[0x14]&0xf)<<4)];
}
}
@@ -1575,7 +1575,7 @@ static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int
{
for (i=0; i<16;i++)
{
- vga.pens[i]=machine->pens[(vga.attribute.data[i]&0x3f)
+ vga.pens[i]=machine.pens[(vga.attribute.data[i]&0x3f)
|((vga.attribute.data[0x14]&0xc)<<4)];
}
}
diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h
index 525274ae344..da059e7ef39 100644
--- a/src/emu/video/pc_vga.h
+++ b/src/emu/video/pc_vga.h
@@ -19,7 +19,7 @@ struct pc_vga_interface
{
/* VGA memory mapper */
const char *vga_memory_bank;
- void (*map_vga_memory)(running_machine *machine, offs_t begin, offs_t end, read8_space_func rh, write8_space_func wh);
+ void (*map_vga_memory)(running_machine &machine, offs_t begin, offs_t end, read8_space_func rh, write8_space_func wh);
/* VGA dipswitch (???) */
read8_space_func read_dipswitch;
@@ -38,8 +38,8 @@ struct pc_svga_interface
pc_video_update_proc (*choosevideomode)(const UINT8 *sequencer, const UINT8 *crtc, const UINT8 *gc, int *width, int *height);
};
-void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf);
-void pc_vga_reset(running_machine *machine);
+void pc_vga_init(running_machine &machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf);
+void pc_vga_reset(running_machine &machine);
void *pc_vga_memory(void);
size_t pc_vga_memory_size(void);
@@ -103,7 +103,7 @@ WRITE16_HANDLER( vga_port16le_03d0_w );
*/
#if 0
int i;
- UINT8 *memory=machine->region("maincpu")->base()+0xc0000;
+ UINT8 *memory=machine.region("maincpu")->base()+0xc0000;
UINT8 chksum;
/* oak vga */
diff --git a/src/emu/video/pc_video.c b/src/emu/video/pc_video.c
index 5293ffbf69e..9d591dcf908 100644
--- a/src/emu/video/pc_video.c
+++ b/src/emu/video/pc_video.c
@@ -19,7 +19,7 @@
***************************************************************************/
-static pc_video_update_proc (*pc_choosevideomode)(running_machine *machine, int *width, int *height);
+static pc_video_update_proc (*pc_choosevideomode)(running_machine &machine, int *width, int *height);
static int pc_anythingdirty;
static int pc_current_height;
static int pc_current_width;
@@ -38,22 +38,22 @@ static STATE_POSTLOAD( pc_video_postload )
-void pc_video_start(running_machine *machine,
- pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
+void pc_video_start(running_machine &machine,
+ pc_video_update_proc (*choosevideomode)(running_machine &machine, int *width, int *height),
size_t vramsize)
{
pc_choosevideomode = choosevideomode;
pc_anythingdirty = 1;
pc_current_height = -1;
pc_current_width = -1;
- machine->generic.tmpbitmap = NULL;
+ machine.generic.tmpbitmap = NULL;
if (vramsize)
{
video_start_generic_bitmapped(machine);
}
- machine->state().register_postload(pc_video_postload, NULL);
+ machine.state().register_postload(pc_video_postload, NULL);
}
@@ -64,7 +64,7 @@ SCREEN_UPDATE( pc_video )
int w = 0, h = 0;
pc_video_update_proc video_update;
- video_update = pc_choosevideomode(screen->machine, &w, &h);
+ video_update = pc_choosevideomode(screen->machine(), &w, &h);
if (video_update)
{
@@ -88,11 +88,11 @@ SCREEN_UPDATE( pc_video )
bitmap_fill(bitmap, cliprect, 0);
}
- video_update(screen->machine->generic.tmpbitmap ? screen->machine->generic.tmpbitmap : bitmap);
+ video_update(screen->machine().generic.tmpbitmap ? screen->machine().generic.tmpbitmap : bitmap);
- if (screen->machine->generic.tmpbitmap)
+ if (screen->machine().generic.tmpbitmap)
{
- copybitmap(bitmap, screen->machine->generic.tmpbitmap, 0, 0, 0, 0, cliprect);
+ copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
if (!pc_anythingdirty)
rc = UPDATE_HAS_NOT_CHANGED;
pc_anythingdirty = 0;
diff --git a/src/emu/video/pc_video.h b/src/emu/video/pc_video.h
index 2256ce59cbf..8f1e13655b4 100644
--- a/src/emu/video/pc_video.h
+++ b/src/emu/video/pc_video.h
@@ -11,8 +11,8 @@
typedef void (*pc_video_update_proc)(bitmap_t *bitmap);
-void pc_video_start(running_machine *machine,
- pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
+void pc_video_start(running_machine &machine,
+ pc_video_update_proc (*choosevideomode)(running_machine &machine, int *width, int *height),
size_t vramsize);
SCREEN_UPDATE( pc_video );
diff --git a/src/emu/video/poly.c b/src/emu/video/poly.c
index 02c1c16f8bf..4f372146231 100644
--- a/src/emu/video/poly.c
+++ b/src/emu/video/poly.c
@@ -200,7 +200,7 @@ struct _poly_manager
FUNCTION PROTOTYPES
***************************************************************************/
-static void **allocate_array(running_machine *machine, size_t *itemsize, UINT32 itemcount);
+static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount);
static void *poly_item_callback(void *param, int threadid);
static STATE_PRESAVE( poly_state_presave );
@@ -316,7 +316,7 @@ INLINE polygon_info *allocate_polygon(poly_manager *poly, int miny, int maxy)
manager
-------------------------------------------------*/
-poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags)
+poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags)
{
poly_manager *poly;
@@ -347,7 +347,7 @@ poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_d
poly->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ);
/* request a pre-save callback for synchronization */
- machine->state().register_presave(poly_state_presave, poly);
+ machine.state().register_presave(poly_state_presave, poly);
return poly;
}
@@ -1286,7 +1286,7 @@ int poly_zclip_if_less(int numverts, const poly_vertex *v, poly_vertex *outv, in
allocate_array - allocate an array of pointers
-------------------------------------------------*/
-static void **allocate_array(running_machine *machine, size_t *itemsize, UINT32 itemcount)
+static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount)
{
void **ptrarray;
int itemnum;
diff --git a/src/emu/video/poly.h b/src/emu/video/poly.h
index e6fc8c54fa3..49706ec5998 100644
--- a/src/emu/video/poly.h
+++ b/src/emu/video/poly.h
@@ -100,7 +100,7 @@ typedef void (*poly_draw_scanline_func)(void *dest, INT32 scanline, const poly_e
/* ----- initialization/teardown ----- */
/* allocate a new poly manager that can render triangles */
-poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags);
+poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags);
/* free a poly manager */
void poly_free(poly_manager *poly);
diff --git a/src/emu/video/resnet.c b/src/emu/video/resnet.c
index d60328e5f74..35d98e376ba 100644
--- a/src/emu/video/resnet.c
+++ b/src/emu/video/resnet.c
@@ -696,7 +696,7 @@ int compute_res_net(int inputs, int channel, const res_net_info *di)
return (int) (v * 255 / vcc + 0.4);
}
-rgb_t *compute_res_net_all(running_machine *machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di)
+rgb_t *compute_res_net_all(running_machine &machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di)
{
UINT8 r,g,b;
int i,j,k;
diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h
index f81d37a5ad1..1c7d53845c6 100644
--- a/src/emu/video/resnet.h
+++ b/src/emu/video/resnet.h
@@ -160,7 +160,7 @@ int compute_res_net(int inputs, int channel, const res_net_info *di);
/* compute all values */
-rgb_t *compute_res_net_all(running_machine *machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di);
+rgb_t *compute_res_net_all(running_machine &machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di);
/* legacy interface */
diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c
index 75045759216..f261e1f36db 100644
--- a/src/emu/video/s2636.c
+++ b/src/emu/video/s2636.c
@@ -324,7 +324,7 @@ WRITE8_DEVICE_HANDLER( s2636_work_ram_w )
const s2636_interface *intf = get_interface(device);
if ( intf->sound && *intf->sound )
{
- s2636_soundport_w(device->machine->device(intf->sound), 0, data);
+ s2636_soundport_w(device->machine().device(intf->sound), 0, data);
}
}
@@ -351,7 +351,7 @@ static DEVICE_START( s2636 )
{
s2636_state *s2636 = get_safe_token(device);
const s2636_interface *intf = get_interface(device);
- screen_device *screen = downcast<screen_device *>(device->machine->device(intf->screen));
+ screen_device *screen = downcast<screen_device *>(device->machine().device(intf->screen));
int width = screen->width();
int height = screen->height();
@@ -359,9 +359,9 @@ static DEVICE_START( s2636 )
s2636->x_offset = intf->x_offset;
s2636->y_offset = intf->y_offset;
- s2636->work_ram = auto_alloc_array_clear(device->machine, UINT8, intf->work_ram_size);
- s2636->bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
- s2636->collision_bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
+ s2636->work_ram = auto_alloc_array_clear(device->machine(), UINT8, intf->work_ram_size);
+ s2636->bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
+ s2636->collision_bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
device->save_item(NAME(s2636->x_offset));
device->save_item(NAME(s2636->y_offset));
diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c
index 8ca8457dd2e..d62f7ae3edd 100644
--- a/src/emu/video/saa5050.c
+++ b/src/emu/video/saa5050.c
@@ -154,18 +154,18 @@ PALETTE_INIT( saa5050 )
{
UINT8 i, r, g, b;
- machine->colortable = colortable_alloc(machine, 8);
+ machine.colortable = colortable_alloc(machine, 8);
for ( i = 0; i < 8; i++ )
{
r = saa5050_colors[i * 3];
g = saa5050_colors[i * 3 + 1];
b = saa5050_colors[i * 3 + 2];
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 128; i++)
- colortable_entry_set_value(machine->colortable, i, saa5050_palette[i]);
+ colortable_entry_set_value(machine.colortable, i, saa5050_palette[i]);
}
/*************************************
@@ -317,12 +317,12 @@ void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle *clipre
{
if (saa5050->flags & SAA5050_DBLHI)
{
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 1], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 2], code, colour, 0, 0, sx * 12, (ssy + 1) * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 1], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 2], code, colour, 0, 0, sx * 12, (ssy + 1) * 20, 0x20000, 0x20000);
}
else
{
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 0], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 0], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
}
}
}
@@ -344,14 +344,14 @@ static DEVICE_START( saa5050 )
saa5050_state *saa5050 = get_safe_token(device);
const saa5050_interface *intf = get_interface(device);
- saa5050->screen = device->machine->device(intf->screen);
+ saa5050->screen = device->machine().device(intf->screen);
saa5050->gfxnum = intf->gfxnum;
saa5050->x = intf->x;
saa5050->y = intf->y;
saa5050->size = intf->size;
saa5050->rev = intf->rev;
- saa5050->videoram = auto_alloc_array(device->machine, UINT8, 0x800);
+ saa5050->videoram = auto_alloc_array(device->machine(), UINT8, 0x800);
device->save_pointer(NAME(saa5050->videoram), 0x800);
device->save_item(NAME(saa5050->flags));
diff --git a/src/emu/video/tlc34076.c b/src/emu/video/tlc34076.c
index 5e36420e2a8..cbc5d5ae148 100644
--- a/src/emu/video/tlc34076.c
+++ b/src/emu/video/tlc34076.c
@@ -267,13 +267,13 @@ static DEVICE_START( tlc34076 )
state->dacbits = config->res_sel ? 8 : 6;
- state_save_register_global_array(device->machine, state->local_paletteram);
- state_save_register_global_array(device->machine, state->regs);
- state_save_register_global_array(device->machine, state->pens);
+ state_save_register_global_array(device->machine(), state->local_paletteram);
+ state_save_register_global_array(device->machine(), state->regs);
+ state_save_register_global_array(device->machine(), state->pens);
- state_save_register_global(device->machine, state->writeindex);
- state_save_register_global(device->machine, state->readindex);
- state_save_register_global(device->machine, state->dacbits);
+ state_save_register_global(device->machine(), state->writeindex);
+ state_save_register_global(device->machine(), state->readindex);
+ state_save_register_global(device->machine(), state->dacbits);
}
static const char DEVTEMPLATE_SOURCE[] = __FILE__;
diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c
index e6d754914a1..b4ad0d6aa2d 100644
--- a/src/emu/video/tms34061.c
+++ b/src/emu/video/tms34061.c
@@ -75,12 +75,12 @@ static TIMER_CALLBACK( tms34061_interrupt );
*
*************************************/
-void tms34061_start(running_machine *machine, const struct tms34061_interface *interface)
+void tms34061_start(running_machine &machine, const struct tms34061_interface *interface)
{
/* reset the data */
memset(&tms34061, 0, sizeof(tms34061));
tms34061.intf = *interface;
- tms34061.screen = downcast<screen_device *>(machine->device(tms34061.intf.screen_tag));
+ tms34061.screen = downcast<screen_device *>(machine.device(tms34061.intf.screen_tag));
tms34061.vrammask = tms34061.intf.vramsize - 1;
/* allocate memory for VRAM */
@@ -119,7 +119,7 @@ void tms34061_start(running_machine *machine, const struct tms34061_interface *i
tms34061.regs[TMS34061_VERCOUNTER] = 0x0000;
/* start vertical interrupt timer */
- tms34061.timer = machine->scheduler().timer_alloc(FUNC(tms34061_interrupt));
+ tms34061.timer = machine.scheduler().timer_alloc(FUNC(tms34061_interrupt));
}
@@ -137,9 +137,9 @@ INLINE void update_interrupts(void)
{
/* if the status bit is set, and ints are enabled, turn it on */
if ((tms34061.regs[TMS34061_STATUS] & 0x0001) && (tms34061.regs[TMS34061_CONTROL1] & 0x0400))
- (*tms34061.intf.interrupt)(tms34061.screen->machine, ASSERT_LINE);
+ (*tms34061.intf.interrupt)(tms34061.screen->machine(), ASSERT_LINE);
else
- (*tms34061.intf.interrupt)(tms34061.screen->machine, CLEAR_LINE);
+ (*tms34061.intf.interrupt)(tms34061.screen->machine(), CLEAR_LINE);
}
}
@@ -184,7 +184,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine->describe_context(), regnames[regnum], tms34061.regs[regnum]);
+ if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine().describe_context(), regnames[regnum], tms34061.regs[regnum]);
/* update the state of things */
switch (regnum)
@@ -262,7 +262,7 @@ static UINT8 register_r(address_space *space, offs_t offset)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine->describe_context(), regnames[regnum], result);
+ if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine().describe_context(), regnames[regnum], result);
return (offset & 0x02) ? (result >> 8) : result;
}
@@ -369,7 +369,7 @@ static void xypixel_w(address_space *space, int offset, UINT8 data)
/* mask to the VRAM size */
pixeloffs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine->describe_context(), pixeloffs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine().describe_context(), pixeloffs, data, tms34061.latchdata);
/* set the pixel data */
tms34061.vram[pixeloffs] = data;
@@ -425,7 +425,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask;
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
- if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine->describe_context(), offs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine().describe_context(), offs, data, tms34061.latchdata);
if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata)
{
tms34061.vram[offs] = data;
@@ -439,7 +439,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine->describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine().describe_context(), offs);
memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift);
memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift);
@@ -451,14 +451,14 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine->describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine().describe_context(), offs);
tms34061.shiftreg = &tms34061.vram[offs];
break;
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(), func);
+ logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(), func);
break;
}
}
@@ -512,7 +512,7 @@ UINT8 tms34061_r(address_space *space, int col, int row, int func)
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(),
+ logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(),
func);
break;
}
diff --git a/src/emu/video/tms34061.h b/src/emu/video/tms34061.h
index e94b56d9c29..0128785d9ef 100644
--- a/src/emu/video/tms34061.h
+++ b/src/emu/video/tms34061.h
@@ -43,7 +43,7 @@ struct tms34061_interface
const char *screen_tag; /* the screen we are acting on */
UINT8 rowshift; /* VRAM address is (row << rowshift) | col */
UINT32 vramsize; /* size of video RAM */
- void (*interrupt)(running_machine *machine, int state); /* interrupt gen callback */
+ void (*interrupt)(running_machine &machine, int state); /* interrupt gen callback */
};
@@ -59,7 +59,7 @@ struct tms34061_display
/* starts/stops the emulator */
-void tms34061_start(running_machine *machine, const struct tms34061_interface *interface);
+void tms34061_start(running_machine &machine, const struct tms34061_interface *interface);
/* reads/writes to the 34061 */
UINT8 tms34061_r(address_space *space, int col, int row, int func);
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index 5ef5425d04d..a7c89807d54 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -271,19 +271,19 @@ static DEVICE_START( tms9927 )
tms->hpixels_per_column = tms->intf->hpixels_per_column;
/* get the screen device */
- tms->screen = downcast<screen_device *>(device->machine->device(tms->intf->screen_tag));
+ tms->screen = downcast<screen_device *>(device->machine().device(tms->intf->screen_tag));
assert(tms->screen != NULL);
/* get the self-load PROM */
if (tms->intf->selfload_region != NULL)
{
- tms->selfload = device->machine->region(tms->intf->selfload_region)->base();
+ tms->selfload = device->machine().region(tms->intf->selfload_region)->base();
assert(tms->selfload != NULL);
}
}
/* register for state saving */
- device->machine->state().register_postload(tms9927_state_save_postload, tms);
+ device->machine().state().register_postload(tms9927_state_save_postload, tms);
device->save_item(NAME(tms->clock));
device->save_item(NAME(tms->reg));
diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c
index ce9e803b821..b427a4cda3e 100644
--- a/src/emu/video/tms9928a.c
+++ b/src/emu/video/tms9928a.c
@@ -108,7 +108,7 @@ static void draw_mode3 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
static void draw_mode23 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
static void draw_modebogus (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
static void draw_sprites (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
-static void change_register (running_machine *machine, int reg, UINT8 data);
+static void change_register (running_machine &machine, int reg, UINT8 data);
static void (*const ModeHandlers[])(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) = {
draw_mode0, draw_mode1, draw_mode2, draw_mode12,
@@ -139,7 +139,7 @@ typedef struct {
INT32 Addr;
int colour,pattern,nametbl,spriteattribute,spritepattern;
int colourmask,patternmask;
- void (*INTCallback)(running_machine *, int);
+ void (*INTCallback)(running_machine &, int);
/* memory */
UINT8 *vMem, *dBackMem;
bitmap_t *tmpbmp;
@@ -176,7 +176,7 @@ void TMS9928A_reset () {
tms.latch = 0;
}
-static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *intf)
+static void TMS9928A_start (running_machine &machine, const TMS9928a_interface *intf)
{
assert_always(((intf->vram == 0x1000) || (intf->vram == 0x2000) || (intf->vram == 0x4000)), "4, 8 or 16 kB vram please");
@@ -194,9 +194,9 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
tms.visarea.max_y = tms.top_border + 24*8 - 1 + MIN(intf->bordery, tms.bottom_border);
/* configure the screen if we weren't overridden */
- if (machine->primary_screen->width() == LEFT_BORDER+32*8+RIGHT_BORDER &&
- machine->primary_screen->height() == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
- machine->primary_screen->configure(LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, tms.visarea, machine->primary_screen->frame_period().attoseconds);
+ if (machine.primary_screen->width() == LEFT_BORDER+32*8+RIGHT_BORDER &&
+ machine.primary_screen->height() == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
+ machine.primary_screen->configure(LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, tms.visarea, machine.primary_screen->frame_period().attoseconds);
/* Video RAM */
tms.vramsize = intf->vram;
@@ -206,7 +206,7 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
tms.dBackMem = auto_alloc_array(machine, UINT8, IMAGE_SIZE);
/* back bitmap */
- tms.tmpbmp = auto_bitmap_alloc (machine, 256, 192, machine->primary_screen->format());
+ tms.tmpbmp = auto_bitmap_alloc (machine, 256, 192, machine.primary_screen->format());
TMS9928A_reset ();
tms.LimitSprites = 1;
@@ -233,7 +233,7 @@ const rectangle *TMS9928A_get_visarea (void)
}
-void TMS9928A_post_load (running_machine *machine) {
+void TMS9928A_post_load (running_machine &machine) {
int i;
/* all registers need to be re-written, so tables are recalculated */
@@ -271,7 +271,7 @@ READ8_HANDLER (TMS9928A_register_r) {
tms.StatusReg = 0x1f;
if (tms.INT) {
tms.INT = 0;
- if (tms.INTCallback) tms.INTCallback (space->machine, tms.INT);
+ if (tms.INTCallback) tms.INTCallback (space->machine(), tms.INT);
}
tms.latch = 0;
return b;
@@ -287,7 +287,7 @@ WRITE8_HANDLER (TMS9928A_register_w) {
if (data & 0x80) {
/* register write */
reg = data & 7;
- change_register (space->machine, reg, tms.Addr & 0xff);
+ change_register (space->machine(), reg, tms.Addr & 0xff);
} else {
if ( !(data & 0x40) ) {
/* read ahead */
@@ -302,7 +302,7 @@ WRITE8_HANDLER (TMS9928A_register_w) {
}
}
-static void change_register (running_machine *machine, int reg, UINT8 val) {
+static void change_register (running_machine &machine, int reg, UINT8 val) {
static const UINT8 Mask[8] =
{ 0x03, 0xfb, 0x0f, 0xff, 0x07, 0x7f, 0x07, 0xff };
static const char *const modes[] = {
@@ -393,15 +393,15 @@ void TMS9928A_set_spriteslimit (int limit) {
SCREEN_UPDATE( tms9928a )
{
INT32 BackColour = tms.Regs[7] & 15;
- rgb_t oldcolor = palette_get_color(screen->machine, 0);
+ rgb_t oldcolor = palette_get_color(screen->machine(), 0);
if (!BackColour) BackColour=1;
/* note we preserve the alpha here; this is so that it can be controlled independently */
/* see cliffhgr.c for an example */
- palette_set_color(screen->machine, 0, (TMS9928A_palette[BackColour] & MAKE_ARGB(0,255,255,255)) | (oldcolor & MAKE_ARGB(255,0,0,0)));
+ palette_set_color(screen->machine(), 0, (TMS9928A_palette[BackColour] & MAKE_ARGB(0,255,255,255)) | (oldcolor & MAKE_ARGB(255,0,0,0)));
if (! (tms.Regs[1] & 0x40))
- bitmap_fill(bitmap, cliprect, screen->machine->pens[BackColour]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[BackColour]);
else
{
(*ModeHandlers[TMS_MODE])(screen, tms.tmpbmp, cliprect);
@@ -430,13 +430,13 @@ SCREEN_UPDATE( tms9928a )
return 0;
}
-int TMS9928A_interrupt(running_machine *machine) {
+int TMS9928A_interrupt(running_machine &machine) {
int b;
/* when skipping frames, calculate sprite collision */
- if (machine->video().skip_this_frame()) {
+ if (machine.video().skip_this_frame()) {
if (TMS_SPRITES_ENABLED) {
- draw_sprites (machine->primary_screen, NULL, NULL);
+ draw_sprites (machine.primary_screen, NULL, NULL);
}
}
@@ -456,7 +456,7 @@ static void draw_mode1 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
rectangle rt;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -491,7 +491,7 @@ static void draw_mode12 (device_t *screen, bitmap_t *bitmap, const rectangle *cl
const pen_t *pens;
rectangle rt;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -525,7 +525,7 @@ static void draw_mode0 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -552,7 +552,7 @@ static void draw_mode2 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
const pen_t *pens;
UINT8 *colourptr,*patternptr;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -581,7 +581,7 @@ static void draw_mode3 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -611,7 +611,7 @@ static void draw_mode23 (device_t *screen, bitmap_t *bitmap, const rectangle *cl
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -642,7 +642,7 @@ static void draw_modebogus (device_t *screen, bitmap_t *bitmap, const rectangle
int x,y,n,xx;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -673,7 +673,7 @@ static void draw_sprites (device_t *screen, bitmap_t *bitmap, const rectangle *c
UINT16 line,line2;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
attributeptr = tms.vMem + tms.spriteattribute;
size = (tms.Regs[1] & 2) ? 16 : 8;
large = (int)(tms.Regs[1] & 1);
diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h
index d5bd15af7bc..62e24fe8e48 100644
--- a/src/emu/video/tms9928a.h
+++ b/src/emu/video/tms9928a.h
@@ -45,7 +45,7 @@ typedef struct TMS9928a_interface
tms9928a_model model; /* model: tms9929(a) runs at 50Hz instead of 60Hz */
int vram; /* VRAM size in bytes (4k, 8k or 16k) */
int borderx, bordery; /* number of border pixels to show in each direction */
- void (*int_callback)(running_machine *, int); /* callback which is called whenever the state
+ void (*int_callback)(running_machine &, int); /* callback which is called whenever the state
** of the INT output of the TMS9918A changes (may be NULL)*/
} TMS9928a_interface;
@@ -82,7 +82,7 @@ extern SCREEN_UPDATE( tms9928a );
** This next function must be called 50 (tms9929a) or 60 (tms99x8a) times per second,
** to generate the necessary interrupts
*/
-int TMS9928A_interrupt (running_machine *machine);
+int TMS9928A_interrupt (running_machine &machine);
/*
** The parameter is a function pointer. This function is called whenever
@@ -98,7 +98,7 @@ void TMS9928A_set_spriteslimit (int);
/*
** After loading a state, call this function
*/
-void TMS9928A_post_load (running_machine *machine);
+void TMS9928A_post_load (running_machine &machine);
/*
** MachineDriver video declarations for the TMS9928A chip
diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c
index 2a0a639b681..292467e512e 100644
--- a/src/emu/video/v9938.c
+++ b/src/emu/video/v9938.c
@@ -34,7 +34,7 @@ typedef struct {
int vram_size;
/* interrupt */
UINT8 INT;
- void (*INTCallback)(running_machine *, int);
+ void (*INTCallback)(running_machine &, int);
int scanline;
/* blinking */
int blink, blink_count;
@@ -94,13 +94,13 @@ static const char *const v9938_modes[] = {
"UNKNOWN"
};
-static void v9938_register_write (running_machine *machine, int reg, int data);
+static void v9938_register_write (running_machine &machine, int reg, int data);
static void v9938_update_command (void);
static void v9938_cpu_to_vdp (UINT8 V);
static UINT8 v9938_command_unit_w (UINT8 Op);
static UINT8 v9938_vdp_to_cpu (void);
static void v9938_set_mode (void);
-static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line);
+static void v9938_refresh_line (running_machine &machine, bitmap_t *bmp, int line);
/***************************************************************************
@@ -435,7 +435,7 @@ READ8_HANDLER (v9938_1_vram_r)
return v9938_vram_r();
}
-static void v9938_command_w(running_machine *machine, UINT8 data)
+static void v9938_command_w(running_machine &machine, UINT8 data)
{
if (vdp->cmd_write_first)
{
@@ -463,13 +463,13 @@ static void v9938_command_w(running_machine *machine, UINT8 data)
WRITE8_HANDLER (v9938_0_command_w)
{
vdp = &vdps[0];
- v9938_command_w(space->machine, data);
+ v9938_command_w(space->machine(), data);
}
WRITE8_HANDLER (v9938_1_command_w)
{
vdp = &vdps[1];
- v9938_command_w(space->machine, data);
+ v9938_command_w(space->machine(), data);
}
/***************************************************************************
@@ -478,7 +478,7 @@ WRITE8_HANDLER (v9938_1_command_w)
***************************************************************************/
-void v9938_init (running_machine *machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) )
+void v9938_init (running_machine &machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine &, int) )
{
vdp = &vdps[which];
@@ -590,7 +590,7 @@ void v9938_reset (int which)
vdp->statReg[6] = 0xfc;
}
-static void v9938_check_int (running_machine *machine)
+static void v9938_check_int (running_machine &machine)
{
UINT8 n;
@@ -644,7 +644,7 @@ void v9938_set_resolution (int which, int i)
***************************************************************************/
-static void v9938_register_w(running_machine *machine, UINT8 data)
+static void v9938_register_w(running_machine &machine, UINT8 data)
{
int reg;
@@ -659,16 +659,16 @@ static void v9938_register_w(running_machine *machine, UINT8 data)
WRITE8_HANDLER (v9938_0_register_w)
{
vdp = &vdps[0];
- v9938_register_w(space->machine, data);
+ v9938_register_w(space->machine(), data);
}
WRITE8_HANDLER (v9938_1_register_w)
{
vdp = &vdps[1];
- v9938_register_w(space->machine, data);
+ v9938_register_w(space->machine(), data);
}
-static void v9938_register_write (running_machine *machine, int reg, int data)
+static void v9938_register_write (running_machine &machine, int reg, int data)
{
static UINT8 const reg_mask[] =
{
@@ -756,7 +756,7 @@ static void v9938_register_write (running_machine *machine, int reg, int data)
vdp->contReg[reg] = data;
}
-static UINT8 v9938_status_r(running_machine *machine)
+static UINT8 v9938_status_r(running_machine &machine)
{
int reg;
UINT8 ret;
@@ -790,7 +790,7 @@ static UINT8 v9938_status_r(running_machine *machine)
if ( (n < 28) || (n > 199) ) vdp.statReg[2] |= 0x20;
else vdp.statReg[2] &= ~0x20;
*/
- if (machine->rand() & 1) vdp->statReg[2] |= 0x20;
+ if (machine.rand() & 1) vdp->statReg[2] |= 0x20;
else vdp->statReg[2] &= ~0x20;
ret = vdp->statReg[2];
break;
@@ -830,13 +830,13 @@ static UINT8 v9938_status_r(running_machine *machine)
READ8_HANDLER( v9938_0_status_r )
{
vdp = &vdps[0];
- return v9938_status_r(space->machine);
+ return v9938_status_r(space->machine());
}
READ8_HANDLER( v9938_1_status_r )
{
vdp = &vdps[1];
- return v9938_status_r(space->machine);
+ return v9938_status_r(space->machine());
}
/***************************************************************************
@@ -1222,9 +1222,9 @@ static void v9938_set_mode (void)
vdp->mode = i;
}
-static void v9938_refresh_16 (running_machine *machine, bitmap_t *bmp, int line)
+static void v9938_refresh_16 (running_machine &machine, bitmap_t *bmp, int line)
{
- const pen_t *pens = machine->pens;
+ const pen_t *pens = machine.pens;
int i, double_lines;
UINT8 col[256];
UINT16 *ln, *ln2 = NULL;
@@ -1282,7 +1282,7 @@ static void v9938_refresh_16 (running_machine *machine, bitmap_t *bmp, int line)
memcpy (ln2, ln, (512 + 32) * 2);
}
-static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line)
+static void v9938_refresh_line (running_machine &machine, bitmap_t *bmp, int line)
{
int ind16, ind256;
@@ -1409,7 +1409,7 @@ I do not know the behaviour of FV when IE0=0. That is the part that I still
have to test.
*/
-static void v9938_interrupt_start_vblank (running_machine *machine)
+static void v9938_interrupt_start_vblank (running_machine &machine)
{
#if 0
if (input_code_pressed (machine, KEYCODE_D) )
@@ -1469,7 +1469,7 @@ static void v9938_interrupt_start_vblank (running_machine *machine)
vdp->size_now = -1;
}
-int v9938_interrupt (running_machine *machine, int which)
+int v9938_interrupt (running_machine &machine, int which)
{
int scanline, max, pal, scanline_start;
diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h
index f7496ccdce6..f14072c85e0 100644
--- a/src/emu/video/v9938.h
+++ b/src/emu/video/v9938.h
@@ -14,9 +14,9 @@
#define RENDER_LOW (1)
#define RENDER_AUTO (2)
-void v9938_init (running_machine *machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) );
+void v9938_init (running_machine &machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine &, int) );
void v9938_reset (int which);
-int v9938_interrupt (running_machine *machine, int which);
+int v9938_interrupt (running_machine &machine, int which);
void v9938_set_sprite_limit (int which, int);
void v9938_set_resolution (int which, int);
int v9938_get_transpen(int which);
diff --git a/src/emu/video/vector.c b/src/emu/video/vector.c
index 94eb76a669c..cf92011acbc 100644
--- a/src/emu/video/vector.c
+++ b/src/emu/video/vector.c
@@ -175,10 +175,10 @@ float vector_get_beam(void)
VIDEO_START( vector )
{
- beam_width = machine->options().beam();
+ beam_width = machine.options().beam();
/* Grab the settings for this session */
- vector_set_flicker(machine->options().flicker());
+ vector_set_flicker(machine.options().flicker());
vector_index = 0;
@@ -191,7 +191,7 @@ VIDEO_START( vector )
* Adds a line end point to the vertices list. The vector processor emulation
* needs to call this.
*/
-void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int intensity)
+void vector_add_point (running_machine &machine, int x, int y, rgb_t color, int intensity)
{
point *newpoint;
@@ -200,7 +200,7 @@ void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int
if (flicker && (intensity > 0))
{
- intensity += (intensity * (0x80-(machine->rand()&0xff)) * flicker)>>16;
+ intensity += (intensity * (0x80-(machine.rand()&0xff)) * flicker)>>16;
if (intensity < 0)
intensity = 0;
if (intensity > 0xff)
@@ -256,7 +256,7 @@ void vector_clear_list (void)
SCREEN_UPDATE( vector )
{
- UINT32 flags = PRIMFLAG_ANTIALIAS(screen->machine->options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD);
+ UINT32 flags = PRIMFLAG_ANTIALIAS(screen->machine().options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD);
const rectangle &visarea = screen->visible_area();
float xscale = 1.0f / (65536 * (visarea.max_x - visarea.min_x));
float yscale = 1.0f / (65536 * (visarea.max_y - visarea.min_y));
diff --git a/src/emu/video/vector.h b/src/emu/video/vector.h
index 8d4fc7d8353..9fe90bba9d6 100644
--- a/src/emu/video/vector.h
+++ b/src/emu/video/vector.h
@@ -14,7 +14,7 @@ VIDEO_START( vector );
SCREEN_UPDATE( vector );
void vector_clear_list(void);
-void vector_add_point(running_machine *machine, int x, int y, rgb_t color, int intensity);
+void vector_add_point(running_machine &machine, int x, int y, rgb_t color, int intensity);
void vector_add_clip(int minx, int miny, int maxx, int maxy);
void vector_set_flicker(float _flicker);
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index d275cff840b..13e09886b4f 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -416,7 +416,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
}
/* debugging! */
- if (input_code_pressed(device->machine, KEYCODE_L))
+ if (input_code_pressed(device->machine(), KEYCODE_L))
drawbuf = v->fbi.backbuf;
/* copy from the current front buffer */
@@ -430,7 +430,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
}
/* update stats display */
- statskey = (input_code_pressed(device->machine, KEYCODE_BACKSLASH) != 0);
+ statskey = (input_code_pressed(device->machine(), KEYCODE_BACKSLASH) != 0);
if (statskey && statskey != v->stats.lastkey)
v->stats.display = !v->stats.display;
v->stats.lastkey = statskey;
@@ -440,7 +440,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
popmessage(v->stats.buffer, 0, 0);
/* update render override */
- v->stats.render_override = input_code_pressed(device->machine, KEYCODE_ENTER);
+ v->stats.render_override = input_code_pressed(device->machine(), KEYCODE_ENTER);
if (DEBUG_DEPTH && v->stats.render_override)
{
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -523,7 +523,7 @@ static void init_fbi(voodoo_state *v, fbi_state *f, void *memory, int fbmem)
}
/* allocate a VBLANK timer */
- f->vblank_timer = v->device->machine->scheduler().timer_alloc(FUNC(vblank_callback), v);
+ f->vblank_timer = v->device->machine().scheduler().timer_alloc(FUNC(vblank_callback), v);
f->vblank = FALSE;
/* initialize the memory FIFO */
@@ -656,7 +656,7 @@ static void init_save_state(device_t *device)
voodoo_state *v = get_safe_token(device);
int index, subindex;
- device->machine->state().register_postload(voodoo_postload, v);
+ device->machine().state().register_postload(voodoo_postload, v);
/* register states: core */
device->save_item(NAME(v->extra_cycles));
@@ -910,13 +910,13 @@ static void swap_buffers(voodoo_state *v)
/* reset the last_op_time to now and start processing the next command */
if (v->pci.op_pending)
{
- v->pci.op_end_time = v->device->machine->time();
+ v->pci.op_end_time = v->device->machine().time();
flush_fifos(v, v->pci.op_end_time);
}
/* we may be able to unstall now */
if (v->pci.stall_state != NOT_STALLED)
- check_stalled_cpu(v, v->device->machine->time());
+ check_stalled_cpu(v, v->device->machine().time());
/* periodically log rasterizer info */
v->stats.swaps++;
@@ -1015,7 +1015,7 @@ static TIMER_CALLBACK( vblank_callback )
if (v->pci.op_pending)
{
if (LOG_VBLANK_SWAP) logerror("---- vblank flush begin\n");
- flush_fifos(v, machine->time());
+ flush_fifos(v, machine.time());
if (LOG_VBLANK_SWAP) logerror("---- vblank flush end\n");
}
@@ -1033,7 +1033,7 @@ static TIMER_CALLBACK( vblank_callback )
swap_buffers(v);
/* set a timer for the next off state */
- machine->scheduler().timer_set(v->screen->time_until_pos(0), FUNC(vblank_off_callback), 0, v);
+ machine.scheduler().timer_set(v->screen->time_until_pos(0), FUNC(vblank_off_callback), 0, v);
/* set internal state and call the client */
v->fbi.vblank = TRUE;
@@ -2002,10 +2002,10 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
if (cycles > 0)
{
v->pci.op_pending = TRUE;
- v->pci.op_end_time = v->device->machine->time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
+ v->pci.op_end_time = v->device->machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- v->device->machine->time().seconds, (UINT32)(v->device->machine->time().attoseconds >> 32), (UINT32)v->device->machine->time().attoseconds,
+ v->device->machine().time().seconds, (UINT32)(v->device->machine().time().attoseconds >> 32), (UINT32)v->device->machine().time().attoseconds,
v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
}
}
@@ -2022,7 +2022,7 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
static TIMER_CALLBACK( stall_cpu_callback )
{
- check_stalled_cpu((voodoo_state *)ptr, machine->time());
+ check_stalled_cpu((voodoo_state *)ptr, machine.time());
}
@@ -2069,7 +2069,7 @@ static void check_stalled_cpu(voodoo_state *v, attotime current_time)
if (v->pci.stall_callback)
(*v->pci.stall_callback)(v->device, FALSE);
else
- v->device->machine->scheduler().trigger(v->trigger);
+ v->device->machine().scheduler().trigger(v->trigger);
}
/* if not, set a timer for the next one */
@@ -3463,7 +3463,7 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
/* special handling for registers */
if ((offset & 0xc00000/4) == 0)
@@ -3543,10 +3543,10 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
if (cycles)
{
v->pci.op_pending = TRUE;
- v->pci.op_end_time = device->machine->time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
+ v->pci.op_end_time = device->machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- device->machine->time().seconds, (UINT32)(device->machine->time().attoseconds >> 32), (UINT32)device->machine->time().attoseconds,
+ device->machine().time().seconds, (UINT32)(device->machine().time().attoseconds >> 32), (UINT32)device->machine().time().attoseconds,
v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
}
g_profiler.stop();
@@ -3596,7 +3596,7 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
fifo_items(&v->fbi.fifo) >= 2 * 32 * FBIINIT0_MEMORY_FIFO_HWM(v->reg[fbiInit0].u))
{
if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit memory FIFO HWM -- stalling\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine().time());
}
}
@@ -3605,14 +3605,14 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
fifo_space(&v->pci.fifo) <= 2 * FBIINIT0_PCI_FIFO_LWM(v->reg[fbiInit0].u))
{
if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit PCI FIFO free LWM -- stalling\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine().time());
}
/* if we weren't ready, and this is a non-FIFO access, stall until the FIFOs are clear */
if (stall)
{
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:voodoo_w wrote non-FIFO register -- stalling until clear\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, device->machine().time());
}
g_profiler.stop();
@@ -3890,7 +3890,7 @@ READ32_DEVICE_HANDLER( voodoo_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
/* target the appropriate location */
if (!(offset & (0xc00000/4)))
@@ -3966,7 +3966,7 @@ static READ32_DEVICE_HANDLER( banshee_agp_r )
}
if (LOG_REGISTERS)
- logerror("%s:banshee_r(AGP:%s)\n", v->device->machine->describe_context(), banshee_agp_reg_name[offset]);
+ logerror("%s:banshee_r(AGP:%s)\n", v->device->machine().describe_context(), banshee_agp_reg_name[offset]);
return result;
}
@@ -3978,22 +3978,22 @@ READ32_DEVICE_HANDLER( banshee_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
result = banshee_io_r(device, offset, mem_mask);
else if (offset < 0x100000/4)
result = banshee_agp_r(device, offset, mem_mask);
else if (offset < 0x200000/4)
- logerror("%s:banshee_r(2D:%X)\n", device->machine->describe_context(), (offset*4) & 0xfffff);
+ logerror("%s:banshee_r(2D:%X)\n", device->machine().describe_context(), (offset*4) & 0xfffff);
else if (offset < 0x600000/4)
result = register_r(v, offset & 0x1fffff/4);
else if (offset < 0x800000/4)
- logerror("%s:banshee_r(TEX:%X)\n", device->machine->describe_context(), (offset*4) & 0x1fffff);
+ logerror("%s:banshee_r(TEX:%X)\n", device->machine().describe_context(), (offset*4) & 0x1fffff);
else if (offset < 0xc00000/4)
- logerror("%s:banshee_r(RES:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff);
+ logerror("%s:banshee_r(RES:%X)\n", device->machine().describe_context(), (offset*4) & 0x3fffff);
else if (offset < 0x1000000/4)
- logerror("%s:banshee_r(YUV:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff);
+ logerror("%s:banshee_r(YUV:%X)\n", device->machine().describe_context(), (offset*4) & 0x3fffff);
else if (offset < 0x2000000/4)
{
UINT8 temp = v->fbi.lfb_stride;
@@ -4012,11 +4012,11 @@ READ32_DEVICE_HANDLER( banshee_fb_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < v->fbi.lfb_base)
{
- logerror("%s:banshee_fb_r(%X)\n", device->machine->describe_context(), offset*4);
+ logerror("%s:banshee_fb_r(%X)\n", device->machine().describe_context(), offset*4);
if (offset*4 <= v->fbi.mask)
result = ((UINT32 *)v->fbi.ram)[offset];
}
@@ -4041,7 +4041,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
result = v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_att_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f]);
+ logerror("%s:banshee_att_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3c1 & 0x1f]);
break;
/* Input status 0 */
@@ -4054,7 +4054,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
*/
result = 0x00;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Sequencer access */
@@ -4062,7 +4062,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
result = v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_seq_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f]);
+ logerror("%s:banshee_seq_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3c4 & 0x1f]);
break;
/* Feature control */
@@ -4070,14 +4070,14 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
result = v->banshee.vga[0x3da & 0x1f];
v->banshee.attff = 0;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Miscellaneous output */
case 0x3cc:
result = v->banshee.vga[0x3c2 & 0x1f];
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Graphics controller access */
@@ -4085,7 +4085,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
result = v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_gc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f]);
+ logerror("%s:banshee_gc_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3ce & 0x1f]);
break;
/* CRTC access */
@@ -4093,7 +4093,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
result = v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_crtc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f]);
+ logerror("%s:banshee_crtc_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3d4 & 0x1f]);
break;
/* Input status 1 */
@@ -4109,13 +4109,13 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
*/
result = 0x04;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
default:
result = v->banshee.vga[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
}
return result;
@@ -4139,7 +4139,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
case io_dacData:
result = v->fbi.clut[v->banshee.io[io_dacAddr] & 0x1ff] = v->banshee.io[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_dac_r(%X)\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff);
+ logerror("%s:banshee_dac_r(%X)\n", device->machine().describe_context(), v->banshee.io[io_dacAddr] & 0x1ff);
break;
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
@@ -4159,7 +4159,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
default:
result = v->banshee.io[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_io_r(%s)\n", device->machine->describe_context(), banshee_io_reg_name[offset]);
+ logerror("%s:banshee_io_r(%s)\n", device->machine().describe_context(), banshee_io_reg_name[offset]);
break;
}
@@ -4169,7 +4169,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
READ32_DEVICE_HANDLER( banshee_rom_r )
{
- logerror("%s:banshee_rom_r(%X)\n", device->machine->describe_context(), offset*4);
+ logerror("%s:banshee_rom_r(%X)\n", device->machine().describe_context(), offset*4);
return 0xffffffff;
}
@@ -4263,7 +4263,7 @@ static WRITE32_DEVICE_HANDLER( banshee_agp_w )
}
if (LOG_REGISTERS)
- logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", device->machine->describe_context(), banshee_agp_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", device->machine().describe_context(), banshee_agp_reg_name[offset], data, mem_mask);
}
@@ -4273,22 +4273,22 @@ WRITE32_DEVICE_HANDLER( banshee_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
banshee_io_w(device, offset, data, mem_mask);
else if (offset < 0x100000/4)
banshee_agp_w(device, offset, data, mem_mask);
else if (offset < 0x200000/4)
- logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0xfffff, data, mem_mask);
+ logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0xfffff, data, mem_mask);
else if (offset < 0x600000/4)
register_w(v, offset & 0x1fffff/4, data);
else if (offset < 0x800000/4)
- logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x1fffff, data, mem_mask);
+ logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x1fffff, data, mem_mask);
else if (offset < 0xc00000/4)
- logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
+ logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
else if (offset < 0x1000000/4)
- logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
+ logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
else if (offset < 0x2000000/4)
{
UINT8 temp = v->fbi.lfb_stride;
@@ -4306,7 +4306,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < v->fbi.lfb_base)
{
@@ -4318,7 +4318,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w )
{
if (offset*4 <= v->fbi.mask)
COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]);
- logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", device->machine->describe_context(), offset*4, data, mem_mask);
+ logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", device->machine().describe_context(), offset*4, data, mem_mask);
}
}
else
@@ -4341,14 +4341,14 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
{
v->banshee.vga[0x3c1 & 0x1f] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data);
+ logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine().describe_context(), 0x3c0+offset, data);
}
else
{
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_att_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f], data);
+ logerror("%s:banshee_att_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3c1 & 0x1f], data);
}
v->banshee.attff ^= 1;
break;
@@ -4358,7 +4358,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_seq_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f], data);
+ logerror("%s:banshee_seq_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3c4 & 0x1f], data);
break;
/* Graphics controller access */
@@ -4366,7 +4366,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_gc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f], data);
+ logerror("%s:banshee_gc_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3ce & 0x1f], data);
break;
/* CRTC access */
@@ -4374,13 +4374,13 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_crtc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f], data);
+ logerror("%s:banshee_crtc_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3d4 & 0x1f], data);
break;
default:
v->banshee.vga[offset] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data);
+ logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine().describe_context(), 0x3c0+offset, data);
break;
}
}
@@ -4402,7 +4402,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
if ((v->banshee.io[offset] ^ old) & 0x2800)
v->fbi.clut_dirty = TRUE;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_dacData:
@@ -4413,14 +4413,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
v->fbi.clut_dirty = TRUE;
}
if (LOG_REGISTERS)
- logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
+ logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", device->machine().describe_context(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
break;
case io_miscInit0:
COMBINE_DATA(&v->banshee.io[offset]);
v->fbi.yorigin = (data >> 18) & 0xfff;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_vidScreenSize:
@@ -4434,14 +4434,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
v->screen->set_visible_area(0, v->fbi.width - 1, 0, v->fbi.height - 1);
adjust_vblank_timer(v);
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_lfbMemoryConfig:
v->fbi.lfb_base = (data & 0x1fff) << 10;
v->fbi.lfb_stride = ((data >> 13) & 7) + 9;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
@@ -4460,7 +4460,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
default:
COMBINE_DATA(&v->banshee.io[offset]);
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
}
}
@@ -4487,7 +4487,6 @@ static DEVICE_START( voodoo )
/* validate some basic stuff */
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* validate configuration */
assert(config->screen != NULL);
@@ -4505,8 +4504,8 @@ static DEVICE_START( voodoo )
v->pci.stall_callback = config->stall;
/* create a multiprocessor work queue */
- v->poly = poly_alloc(device->machine, 64, sizeof(poly_extra_data), 0);
- v->thread_stats = auto_alloc_array(device->machine, stats_block, WORK_MAX_THREADS);
+ v->poly = poly_alloc(device->machine(), 64, sizeof(poly_extra_data), 0);
+ v->thread_stats = auto_alloc_array(device->machine(), stats_block, WORK_MAX_THREADS);
/* create a table of precomputed 1/n and log2(n) values */
/* n ranges from 1.0000 to 2.0000 */
@@ -4574,10 +4573,10 @@ static DEVICE_START( voodoo )
}
/* set the type, and initialize the chip mask */
- v->index = device->machine->m_devicelist.indexof(device->type(), device->tag());
- v->screen = downcast<screen_device *>(device->machine->device(config->screen));
+ v->index = device->machine().m_devicelist.indexof(device->type(), device->tag());
+ v->screen = downcast<screen_device *>(device->machine().device(config->screen));
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
- v->cpu = device->machine->device(config->cputag);
+ v->cpu = device->machine().device(config->cputag);
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
v->type = config->type;
v->chipmask = 0x01;
@@ -4593,21 +4592,21 @@ static DEVICE_START( voodoo )
v->pci.fifo.size = 64*2;
v->pci.fifo.in = v->pci.fifo.out = 0;
v->pci.stall_state = NOT_STALLED;
- v->pci.continue_timer = v->device->machine->scheduler().timer_alloc(FUNC(stall_cpu_callback), v);
+ v->pci.continue_timer = v->device->machine().scheduler().timer_alloc(FUNC(stall_cpu_callback), v);
/* allocate memory */
tmumem0 = config->tmumem0;
if (config->type <= VOODOO_2)
{
/* separate FB/TMU memory */
- fbmem = auto_alloc_array(device->machine, UINT8, config->fbmem << 20);
- tmumem[0] = auto_alloc_array(device->machine, UINT8, config->tmumem0 << 20);
- tmumem[1] = (config->tmumem1 != 0) ? auto_alloc_array(device->machine, UINT8, config->tmumem1 << 20) : NULL;
+ fbmem = auto_alloc_array(device->machine(), UINT8, config->fbmem << 20);
+ tmumem[0] = auto_alloc_array(device->machine(), UINT8, config->tmumem0 << 20);
+ tmumem[1] = (config->tmumem1 != 0) ? auto_alloc_array(device->machine(), UINT8, config->tmumem1 << 20) : NULL;
}
else
{
/* shared memory */
- tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(device->machine, UINT8, config->fbmem << 20);
+ tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(device->machine(), UINT8, config->fbmem << 20);
tmumem0 = config->fbmem;
}
diff --git a/src/emu/watchdog.c b/src/emu/watchdog.c
index 130e2815378..564aebec2d3 100644
--- a/src/emu/watchdog.c
+++ b/src/emu/watchdog.c
@@ -36,16 +36,16 @@ static TIMER_CALLBACK( watchdog_callback );
watchdog_init - one time initialization
-------------------------------------------------*/
-void watchdog_init(running_machine *machine)
+void watchdog_init(running_machine &machine)
{
/* allocate a timer for the watchdog */
- watchdog_timer = machine->scheduler().timer_alloc(FUNC(watchdog_callback));
+ watchdog_timer = machine.scheduler().timer_alloc(FUNC(watchdog_callback));
- machine->add_notifier(MACHINE_NOTIFY_RESET, watchdog_internal_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, watchdog_internal_reset);
/* save some stuff in the default tag */
- machine->state().save_item(NAME(watchdog_enabled));
- machine->state().save_item(NAME(watchdog_counter));
+ machine.state().save_item(NAME(watchdog_enabled));
+ machine.state().save_item(NAME(watchdog_counter));
}
@@ -58,7 +58,7 @@ static void watchdog_internal_reset(running_machine &machine)
{
/* set up the watchdog timer; only start off enabled if explicitly configured */
watchdog_enabled = (machine.config().m_watchdog_vblank_count != 0 || machine.config().m_watchdog_time != attotime::zero);
- watchdog_reset(&machine);
+ watchdog_reset(machine);
watchdog_enabled = TRUE;
}
@@ -75,7 +75,7 @@ static TIMER_CALLBACK( watchdog_callback )
popmessage("Reset caused by the watchdog!!!\n");
#endif
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -90,12 +90,12 @@ static void on_vblank(screen_device &screen, void *param, bool vblank_state)
if (vblank_state && watchdog_enabled)
{
/* check the watchdog */
- if (screen.machine->config().m_watchdog_vblank_count != 0)
+ if (screen.machine().config().m_watchdog_vblank_count != 0)
{
watchdog_counter = watchdog_counter - 1;
if (watchdog_counter == 0)
- watchdog_callback(screen.machine, NULL, 0);
+ watchdog_callback(screen.machine(), NULL, 0);
}
}
}
@@ -105,25 +105,25 @@ static void on_vblank(screen_device &screen, void *param, bool vblank_state)
watchdog_reset - reset the watchdog timer
-------------------------------------------------*/
-void watchdog_reset(running_machine *machine)
+void watchdog_reset(running_machine &machine)
{
/* if we're not enabled, skip it */
if (!watchdog_enabled)
watchdog_timer->adjust(attotime::never);
/* VBLANK-based watchdog? */
- else if (machine->config().m_watchdog_vblank_count != 0)
+ else if (machine.config().m_watchdog_vblank_count != 0)
{
- watchdog_counter = machine->config().m_watchdog_vblank_count;
+ watchdog_counter = machine.config().m_watchdog_vblank_count;
/* register a VBLANK callback for the primary screen */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(on_vblank, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(on_vblank, NULL);
}
/* timer-based watchdog? */
- else if (machine->config().m_watchdog_time != attotime::zero)
- watchdog_timer->adjust(machine->config().m_watchdog_time);
+ else if (machine.config().m_watchdog_time != attotime::zero)
+ watchdog_timer->adjust(machine.config().m_watchdog_time);
/* default to an obscene amount of time (3 seconds) */
else
@@ -135,7 +135,7 @@ void watchdog_reset(running_machine *machine)
watchdog_enable - reset the watchdog timer
-------------------------------------------------*/
-void watchdog_enable(running_machine *machine, int enable)
+void watchdog_enable(running_machine &machine, int enable)
{
/* when re-enabled, we reset our state */
if (watchdog_enabled != enable)
diff --git a/src/emu/watchdog.h b/src/emu/watchdog.h
index acebfb96818..3787a729164 100644
--- a/src/emu/watchdog.h
+++ b/src/emu/watchdog.h
@@ -20,13 +20,13 @@
/* startup */
-void watchdog_init(running_machine *machine);
+void watchdog_init(running_machine &machine);
/* reset the watchdog */
-void watchdog_reset(running_machine *machine);
+void watchdog_reset(running_machine &machine);
/* enable/disable the watchdog */
-void watchdog_enable(running_machine *machine, int enable);
+void watchdog_enable(running_machine &machine, int enable);
#endif /* __WATCHDOG_H__ */
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index 6c84ed82492..467a02bfa6c 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -93,7 +93,7 @@ static chd_file *get_disc(device_t *device)
chd_file *image_chd = NULL;
/* open a path to the ROMs and find the first CHD file */
- file_enumerator path(device->machine->options().media_path());
+ file_enumerator path(device->machine().options().media_path());
const osd_directory_entry *dir;
/* iterate while we get new objects */
@@ -112,7 +112,7 @@ static chd_file *get_disc(device_t *device)
chd_error chderr;
/* open the file itself via our search path */
- image_file = auto_alloc(device->machine, emu_file(device->machine->options().media_path(), OPEN_FLAG_READ));
+ image_file = auto_alloc(device->machine(), emu_file(device->machine().options().media_path(), OPEN_FLAG_READ));
filerr = image_file->open(dir->name);
if (filerr == FILERR_NONE)
{
@@ -120,15 +120,15 @@ static chd_file *get_disc(device_t *device)
chderr = chd_open_file(*image_file, CHD_OPEN_READ, NULL, &image_chd);
if (chderr == CHDERR_NONE)
{
- set_disk_handle(*device->machine, "laserdisc", *image_file, *image_chd);
+ set_disk_handle(device->machine(), "laserdisc", *image_file, *image_chd);
filename.cpy(dir->name);
- device->machine->add_notifier(MACHINE_NOTIFY_EXIT, free_string);
+ device->machine().add_notifier(MACHINE_NOTIFY_EXIT, free_string);
break;
}
}
/* close the file on failure */
- auto_free(device->machine, image_file);
+ auto_free(device->machine(), image_file);
image_file = NULL;
}
}
@@ -137,7 +137,7 @@ static chd_file *get_disc(device_t *device)
if (image_file == NULL)
fatalerror("No valid image file found!\n");
- return get_disk_handle(device->machine, "laserdisc");
+ return get_disk_handle(device->machine(), "laserdisc");
}
@@ -150,7 +150,7 @@ static chd_file *get_disc(device_t *device)
static void process_commands(device_t *laserdisc)
{
- input_port_value controls = input_port_read(laserdisc->machine, "controls");
+ input_port_value controls = input_port_read(laserdisc->machine(), "controls");
int number;
/* step backwards */
@@ -223,7 +223,7 @@ static void process_commands(device_t *laserdisc)
static TIMER_CALLBACK( vsync_update )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
int vblank_scanline;
attotime target;
@@ -232,9 +232,9 @@ static TIMER_CALLBACK( vsync_update )
process_commands(laserdisc);
/* set a timer to go off on the next VBLANK */
- vblank_scanline = machine->primary_screen->visible_area().max_y + 1;
- target = machine->primary_screen->time_until_pos(vblank_scanline);
- machine->scheduler().timer_set(target, FUNC(vsync_update));
+ vblank_scanline = machine.primary_screen->visible_area().max_y + 1;
+ target = machine.primary_screen->time_until_pos(vblank_scanline);
+ machine.scheduler().timer_set(target, FUNC(vsync_update));
}
@@ -246,7 +246,7 @@ static MACHINE_START( ldplayer )
static TIMER_CALLBACK( autoplay )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
/* start playing */
(*execute_command)(laserdisc, CMD_PLAY);
@@ -257,7 +257,7 @@ static TIMER_CALLBACK( autoplay )
static MACHINE_RESET( ldplayer )
{
/* set up a timer to start playing immediately */
- machine->scheduler().timer_set(attotime::zero, FUNC(autoplay));
+ machine.scheduler().timer_set(attotime::zero, FUNC(autoplay));
/* indicate the name of the file we opened */
popmessage("Opened %s\n", filename.cstr());
@@ -299,7 +299,7 @@ static TIMER_CALLBACK( pr8210_bit_callback )
{
/* assert the line and set a timer for deassertion */
laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_usec(250), FUNC(pr8210_bit_off_callback), 0, ptr);
+ machine.scheduler().timer_set(attotime::from_usec(250), FUNC(pr8210_bit_off_callback), 0, ptr);
/* space 0 bits apart by 1msec, and 1 bits by 2msec */
duration = attotime::from_msec((data & 0x80) ? 2 : 1);
@@ -319,9 +319,9 @@ static TIMER_CALLBACK( pr8210_bit_callback )
static MACHINE_START( pr8210 )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
MACHINE_START_CALL(ldplayer);
- pr8210_bit_timer = machine->scheduler().timer_alloc(FUNC(pr8210_bit_callback), (void *)laserdisc);
+ pr8210_bit_timer = machine.scheduler().timer_alloc(FUNC(pr8210_bit_callback), (void *)laserdisc);
}
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index 922c17b6761..28de78be6ab 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -16,9 +16,9 @@
MACHINE_START( extra_8080bw_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
- state->speaker = machine->device("speaker");
+ state->speaker = machine.device("speaker");
state->save_item(NAME(state->port_1_last_extra));
state->save_item(NAME(state->port_2_last_extra));
@@ -33,7 +33,7 @@ MACHINE_START( extra_8080bw_sh )
WRITE8_HANDLER( invadpt2_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* SAUCER SOUND */
@@ -45,7 +45,7 @@ WRITE8_HANDLER( invadpt2_sh_port_1_w )
state->screen_red = data & 0x04;
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->port_1_last_extra = data;
@@ -60,7 +60,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
D2 = 82K
D3 = 100K */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 3, 0); /* FLEET */
@@ -83,7 +83,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
WRITE8_HANDLER( spcewars_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* Saucer Sound */
@@ -127,7 +127,7 @@ const samples_interface lrescue_samples_interface =
WRITE8_HANDLER( lrescue_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Thrust */
@@ -136,7 +136,7 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 0, 0); /* Alien Hit */
if (rising_bits & 0x10) sample_start(state->samples, 2, 5, 0); /* Bonus Ship (not confirmed) */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
@@ -145,7 +145,7 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
WRITE8_HANDLER( lrescue_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 8, 0); /* Footstep high tone */
@@ -185,7 +185,7 @@ WRITE8_HANDLER( cosmo_sh_port_2_w )
WRITE8_HANDLER( ballbomb_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 2, 0); /* Hit a balloon */
@@ -194,7 +194,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 7, 0); /* Hit a Bomb */
if (rising_bits & 0x10) sample_start(state->samples, 3, 8, 0); /* Bonus Base at 1500 points */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
@@ -203,7 +203,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
WRITE8_HANDLER( ballbomb_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (data & 0x01) sample_start(state->samples, 0, 7, 0); /* Indicates plane will drop bombs */
@@ -262,7 +262,7 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( indianbt_sh_port_1_w )
{
/* bit 4 occurs every 5.25 seconds during gameplay */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 7, 0); /* Death */
@@ -270,7 +270,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
if (rising_bits & 0x04) sample_start(state->samples, 2, 3, 0); /* Move */
if (rising_bits & 0x08) sample_start(state->samples, 3, 2, 0); /* Hit */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x01;
@@ -279,7 +279,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
WRITE8_HANDLER( indianbt_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 0, 0); /* Bird dropped an egg, Lasso used */
@@ -635,9 +635,9 @@ WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
{
- _8080bw_state *state = device->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = device->machine().driver_data<_8080bw_state>();
- coin_lockout_global_w(device->machine, data & 0x04); /* SX8 */
+ coin_lockout_global_w(device->machine(), data & 0x04); /* SX8 */
state->c8080bw_flip_screen = data & 0x20; /* SX11 */
@@ -789,7 +789,7 @@ static const double schaser_effect_rc[8] =
WRITE8_HANDLER( schaser_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
int effect;
/* bit 0 - Dot Sound Enable (SX0)
@@ -862,21 +862,21 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
bit 4 - Field Control B (SX10)
bit 5 - Flip Screen */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
//printf( "schaser_sh_port_2_w: %02x\n", data );
discrete_sound_w(state->discrete, SCHASER_MUSIC_BIT, data & 0x01);
discrete_sound_w(state->discrete, SCHASER_SND_EN, data & 0x02);
- space->machine->sound().system_enable(data & 0x02);
+ space->machine().sound().system_enable(data & 0x02);
- coin_lockout_global_w(space->machine, data & 0x04);
+ coin_lockout_global_w(space->machine(), data & 0x04);
state->schaser_background_disable = (data >> 3) & 0x01;
state->schaser_background_select = (data >> 4) & 0x01;
- state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine, CABINET_PORT_TAG) & 0x01);
+ state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine(), CABINET_PORT_TAG) & 0x01);
state->port_2_last_extra = data;
}
@@ -884,7 +884,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
static TIMER_CALLBACK( schaser_effect_555_cb )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
int effect = param;
attotime new_time;
/* Toggle 555 output */
@@ -909,7 +909,7 @@ static TIMER_CALLBACK( schaser_effect_555_cb )
static STATE_POSTLOAD( schaser_reinit_555_time_remain )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
state->schaser_effect_555_time_remain = attotime::from_double(state->schaser_effect_555_time_remain_savable);
schaser_sh_port_2_w(space, 0, state->port_2_last_extra);
@@ -918,22 +918,22 @@ static STATE_POSTLOAD( schaser_reinit_555_time_remain )
MACHINE_START( schaser_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
- state->schaser_effect_555_timer = machine->scheduler().timer_alloc(FUNC(schaser_effect_555_cb));
+ state->schaser_effect_555_timer = machine.scheduler().timer_alloc(FUNC(schaser_effect_555_cb));
state->save_item(NAME(state->schaser_explosion));
state->save_item(NAME(state->schaser_effect_555_is_low));
state->save_item(NAME(state->schaser_effect_555_time_remain_savable));
state->save_item(NAME(state->port_2_last_extra));
- machine->state().register_postload(schaser_reinit_555_time_remain, NULL);
+ machine.state().register_postload(schaser_reinit_555_time_remain, NULL);
}
MACHINE_RESET( schaser_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
state->schaser_effect_555_is_low = 0;
state->schaser_effect_555_timer->adjust(attotime::never);
@@ -952,7 +952,7 @@ MACHINE_RESET( schaser_sh )
WRITE8_HANDLER( rollingc_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_3_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 4, 0, 0); /* Steering */
@@ -976,7 +976,7 @@ WRITE8_HANDLER( rollingc_sh_port_w )
WRITE8_HANDLER( invrvnge_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
switch (data)
{
@@ -1021,7 +1021,7 @@ WRITE8_HANDLER( invrvnge_sh_port_w )
WRITE8_HANDLER( lupin3_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 6, 0); /* Walking, get money */
@@ -1037,7 +1037,7 @@ WRITE8_HANDLER( lupin3_sh_port_1_w )
WRITE8_HANDLER( lupin3_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Lands on top of building, wife kicks man */
@@ -1048,7 +1048,7 @@ WRITE8_HANDLER( lupin3_sh_port_2_w )
state->color_map = data & 0x40;
- state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine, "IN2") & 0x04);
+ state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine(), "IN2") & 0x04);
state->port_2_last_extra = data;
}
@@ -1066,7 +1066,7 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
bit 3 = 1st speedup
Death is a stream of ff's with some fe's thrown in */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 1, 6, 0); /* Ran over a dot */
@@ -1077,11 +1077,11 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
WRITE8_HANDLER( schasercv_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
speaker_level_w(state->speaker, (data & 0x01) ? 1 : 0); /* End-of-Level */
- space->machine->sound().system_enable(data & 0x10);
+ space->machine().sound().system_enable(data & 0x10);
state->c8080bw_flip_screen = data & 0x20;
}
@@ -1094,7 +1094,7 @@ WRITE8_HANDLER( schasercv_sh_port_2_w )
WRITE8_HANDLER( yosakdon_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Game Over */
@@ -1103,14 +1103,14 @@ WRITE8_HANDLER( yosakdon_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 2, 0); /* Man dead */
if (rising_bits & 0x10) sample_start(state->samples, 5, 8, 0); /* Bonus Man? */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->port_1_last_extra = data;
}
WRITE8_HANDLER( yosakdon_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 6, 0); /* Ready? , Game Over */
@@ -1134,7 +1134,7 @@ WRITE8_HANDLER( yosakdon_sh_port_2_w )
WRITE8_HANDLER( shuttlei_sh_port_1_w )
{
/* bit 3 is high while you are alive and playing */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 4, 0); /* Fleet move */
@@ -1147,7 +1147,7 @@ WRITE8_HANDLER( shuttlei_sh_port_1_w )
WRITE8_HANDLER( shuttlei_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
switch (data)
{
diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c
index 9ef03c75c03..1354af8506b 100644
--- a/src/mame/audio/amiga.c
+++ b/src/mame/audio/amiga.c
@@ -78,7 +78,7 @@ INLINE amiga_audio *get_safe_token( device_t *device )
static TIMER_CALLBACK( signal_irq )
{
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
}
@@ -124,7 +124,7 @@ void amiga_audio_update(device_t *device)
static STREAM_UPDATE( amiga_stream_update )
{
- amiga_state *state = device->machine->driver_data<amiga_state>();
+ amiga_state *state = device->machine().driver_data<amiga_state>();
amiga_audio *audio = (amiga_audio *)param;
int channum, sampoffs = 0;
@@ -242,7 +242,7 @@ static STREAM_UPDATE( amiga_stream_update )
/* if we're in manual mode, signal an interrupt once we latch the low byte */
if (!chan->dmaenabled && chan->manualmode && (chan->curlocation & 1))
{
- signal_irq(device->machine, NULL, channum);
+ signal_irq(device->machine(), NULL, channum);
chan->manualmode = FALSE;
}
}
@@ -270,11 +270,11 @@ static DEVICE_START( amiga_sound )
for (i = 0; i < 4; i++)
{
audio_state->channel[i].index = i;
- audio_state->channel[i].irq_timer = device->machine->scheduler().timer_alloc(FUNC(signal_irq));
+ audio_state->channel[i].irq_timer = device->machine().scheduler().timer_alloc(FUNC(signal_irq));
}
/* create the stream */
- audio_state->stream = device->machine->sound().stream_alloc(*device, 0, 4, device->clock() / CLOCK_DIVIDER, audio_state, amiga_stream_update);
+ audio_state->stream = device->machine().sound().stream_alloc(*device, 0, 4, device->clock() / CLOCK_DIVIDER, audio_state, amiga_stream_update);
}
diff --git a/src/mame/audio/astrof.c b/src/mame/audio/astrof.c
index 24a2ab782c7..f8709a57ef3 100644
--- a/src/mame/audio/astrof.c
+++ b/src/mame/audio/astrof.c
@@ -34,7 +34,7 @@
WRITE8_HANDLER( astrof_audio_1_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_1_last;
if (state->astrof_death_playing)
@@ -72,7 +72,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
/* D6 - don't know. Probably something to do with the explosion sounds */
/* D7 - sound enable bit */
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
state->port_1_last = data;
}
@@ -80,7 +80,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
WRITE8_HANDLER( astrof_audio_2_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 - explosion select (triggered by D2 of the other port */
@@ -184,7 +184,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( tomahawk_audio_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
/* D0 - sonar */
@@ -202,7 +202,7 @@ WRITE8_HANDLER( tomahawk_audio_w )
/* D6 - explosion */
/* D7 - sound enable bit */
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 81968c8fcb6..9fcf4038393 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -71,7 +71,7 @@ static UINT8 oki6295_volume;
static UINT8 ym2151_ct1;
static UINT8 ym2151_ct2;
-static void update_all_volumes(running_machine *machine);
+static void update_all_volumes(running_machine &machine);
static READ8_HANDLER( jsa1_io_r );
static WRITE8_HANDLER( jsa1_io_w );
@@ -105,7 +105,7 @@ ADDRESS_MAP_END
*
*************************************/
-static void init_save_state(running_machine *machine)
+static void init_save_state(running_machine &machine)
{
state_save_register_global(machine, overall_volume);
state_save_register_global(machine, pokey_volume);
@@ -122,28 +122,28 @@ static void init_save_state(running_machine *machine)
*
*************************************/
-void atarijsa_init(running_machine *machine, const char *testport, int testmask)
+void atarijsa_init(running_machine &machine, const char *testport, int testmask)
{
UINT8 *rgn;
/* copy in the parameters */
- jsacpu = machine->device<cpu_device>("jsa");
+ jsacpu = machine.device<cpu_device>("jsa");
assert_always(jsacpu != NULL, "Could not find JSA CPU!");
test_port = testport;
test_mask = testmask;
/* predetermine the bank base */
- rgn = machine->region("jsa")->base();
+ rgn = machine.region("jsa")->base();
bank_base = &rgn[0x03000];
bank_source_data = &rgn[0x10000];
/* determine which sound hardware is installed */
- tms5220 = machine->device("tms");
- ym2151 = machine->device<ym2151_device>("ymsnd");
- pokey = machine->device<pokey_device>("pokey");
- oki6295 = machine->device<okim6295_device>("adpcm");
- oki6295_l = machine->device<okim6295_device>("adpcml");
- oki6295_r = machine->device<okim6295_device>("adpcmr");
+ tms5220 = machine.device("tms");
+ ym2151 = machine.device<ym2151_device>("ymsnd");
+ pokey = machine.device<pokey_device>("pokey");
+ oki6295 = machine.device<okim6295_device>("adpcm");
+ oki6295_l = machine.device<okim6295_device>("adpcml");
+ oki6295_r = machine.device<okim6295_device>("adpcmr");
/* install POKEY memory handlers */
if (pokey != NULL)
@@ -161,8 +161,8 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
/* the upper 128k is fixed, the lower 128k is bankswitched */
for (rgn = 0; rgn < ARRAY_LENGTH(regions); rgn++)
{
- UINT8 *base = machine->region(regions[rgn])->base();
- if (base != NULL && machine->region(regions[rgn])->bytes() >= 0x80000)
+ UINT8 *base = machine.region(regions[rgn])->base();
+ if (base != NULL && machine.region(regions[rgn])->bytes() >= 0x80000)
{
const char *bank = (rgn != 2) ? "bank12" : "bank14";
const char *bank_plus_1 = (rgn != 2) ? "bank13" : "bank15";
@@ -203,7 +203,7 @@ void atarijsa_reset(void)
static READ8_HANDLER( jsa1_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -227,8 +227,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "JSAI");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(space->machine(), "JSAI");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
@@ -298,11 +298,11 @@ static WRITE8_HANDLER( jsa1_io_w )
}
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@@ -318,7 +318,7 @@ static WRITE8_HANDLER( jsa1_io_w )
tms5220_volume = ((data >> 6) & 3) * 100 / 3;
pokey_volume = ((data >> 4) & 3) * 100 / 3;
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -333,7 +333,7 @@ static WRITE8_HANDLER( jsa1_io_w )
static READ8_HANDLER( jsa2_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -360,8 +360,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "JSAII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(space->machine(), "JSAII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -419,14 +419,14 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL)
@@ -443,7 +443,7 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -458,7 +458,7 @@ static WRITE8_HANDLER( jsa2_io_w )
static READ8_HANDLER( jsa3_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -483,8 +483,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine, "JSAIII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(space->machine(), "JSAIII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -511,7 +511,7 @@ static WRITE8_HANDLER( jsa3_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
case 0x002: /* /RDP */
@@ -544,18 +544,18 @@ static WRITE8_HANDLER( jsa3_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL) oki6295->set_pin7(data & 8);
@@ -572,12 +572,12 @@ static WRITE8_HANDLER( jsa3_io_w )
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 1) | ((data >> 3) & 2));
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -592,7 +592,7 @@ static WRITE8_HANDLER( jsa3_io_w )
static READ8_HANDLER( jsa3s_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -617,8 +617,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine, "JSAIII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(space->machine(), "JSAIII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -645,7 +645,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
case 0x002: /* /RDP */
@@ -678,17 +678,17 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the OKI bank */
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
oki6295_l->set_pin7(data & 8);
@@ -705,13 +705,13 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* update the OKI bank */
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 1) | ((data >> 3) & 2));
- memory_set_bank(space->machine, "bank14", data >> 6);
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank14", data >> 6);
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -720,7 +720,7 @@ static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
{
ym2151_ct1 = data&0x1;
ym2151_ct2 = (data&0x2)>>1;
- update_all_volumes(device->machine);
+ update_all_volumes(device->machine());
}
@@ -730,7 +730,7 @@ static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
*
*************************************/
-static void update_all_volumes(running_machine *machine )
+static void update_all_volumes(running_machine &machine )
{
if (pokey != NULL) atarigen_set_pokey_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1);
//if (pokey != NULL) atarigen_set_pokey_stereo_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1, (overall_volume * pokey_volume / 100) * ym2151_ct2);
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index c347fd8f359..ebae34fe4ed 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -5,7 +5,7 @@
****************************************************************************/
-void atarijsa_init(running_machine *machine, const char *testport, int testmask);
+void atarijsa_init(running_machine &machine, const char *testport, int testmask);
void atarijsa_reset(void);
diff --git a/src/mame/audio/aztarac.c b/src/mame/audio/aztarac.c
index f1fa6f77af1..247f2e796a3 100644
--- a/src/mame/audio/aztarac.c
+++ b/src/mame/audio/aztarac.c
@@ -11,26 +11,26 @@
READ16_HANDLER( aztarac_sound_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->sound_status & 0x01;
}
WRITE16_HANDLER( aztarac_sound_w )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
soundlatch_w(space, offset, data);
state->sound_status ^= 0x21;
if (state->sound_status & 0x20)
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
READ8_HANDLER( aztarac_snd_command_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
state->sound_status |= 0x01;
state->sound_status &= ~0x20;
return soundlatch_r(space,offset);
@@ -38,19 +38,19 @@ READ8_HANDLER( aztarac_snd_command_r )
READ8_HANDLER( aztarac_snd_status_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->sound_status & ~0x01;
}
WRITE8_HANDLER( aztarac_snd_status_w )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
state->sound_status &= ~0x10;
}
INTERRUPT_GEN( aztarac_snd_timed_irq )
{
- aztarac_state *state = device->machine->driver_data<aztarac_state>();
+ aztarac_state *state = device->machine().driver_data<aztarac_state>();
state->sound_status ^= 0x10;
if (state->sound_status & 0x10)
diff --git a/src/mame/audio/beezer.c b/src/mame/audio/beezer.c
index 72799043bbe..ff63c6d0938 100644
--- a/src/mame/audio/beezer.c
+++ b/src/mame/audio/beezer.c
@@ -135,7 +135,7 @@ INLINE beezer_sound_state *get_safe_token(device_t *device)
/*static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{
beezer_sound_state *sndstate = get_safe_token(device);
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, (sndstate->ptm_irq_state) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, (sndstate->ptm_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}*/
@@ -380,8 +380,8 @@ static DEVICE_START( common_sh_start )
state->sh6840_clocks_per_sample = (int)(((double)SH6840_CLOCK / (double)sample_rate) * (double)(1 << 24));
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, NULL, beezer_stream_update);
- state->maincpu = device->machine->device("maincpu");
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, NULL, beezer_stream_update);
+ state->maincpu = device->machine().device("maincpu");
sh6840_register_state_globals(device);
}
diff --git a/src/mame/audio/blockade.c b/src/mame/audio/blockade.c
index b01097ee2a0..f0987226972 100644
--- a/src/mame/audio/blockade.c
+++ b/src/mame/audio/blockade.c
@@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
WRITE8_HANDLER( blockade_env_on_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n");
sample_start(samples, 0,0,0);
return;
diff --git a/src/mame/audio/bzone.c b/src/mame/audio/bzone.c
index de88a21048e..74bf7a873ad 100644
--- a/src/mame/audio/bzone.c
+++ b/src/mame/audio/bzone.c
@@ -392,7 +392,7 @@ WRITE8_DEVICE_HANDLER( bzone_sounds_w )
discrete_sound_w(device, BZ_INPUT, data);
output_set_value("startled", (data >> 6) & 1);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
}
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index 00beada9528..e37d0d970c2 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -39,7 +39,7 @@ static attotime cage_cpu_h1_clock_period;
static UINT8 cpu_to_cage_ready;
static UINT8 cage_to_cpu_ready;
-static void (*cage_irqhandler)(running_machine *, int);
+static void (*cage_irqhandler)(running_machine &, int);
static attotime serial_period_per_word;
@@ -153,23 +153,23 @@ static WRITE32_HANDLER( speedup_w );
*
*************************************/
-void cage_init(running_machine *machine, offs_t speedup)
+void cage_init(running_machine &machine, offs_t speedup)
{
attotime cage_cpu_clock_period;
int chan;
cage_irqhandler = NULL;
- memory_set_bankptr(machine, "bank10", machine->region("cageboot")->base());
- memory_set_bankptr(machine, "bank11", machine->region("cage")->base());
+ memory_set_bankptr(machine, "bank10", machine.region("cageboot")->base());
+ memory_set_bankptr(machine, "bank11", machine.region("cage")->base());
- cage_cpu = machine->device<cpu_device>("cage");
+ cage_cpu = machine.device<cpu_device>("cage");
cage_cpu_clock_period = attotime::from_hz(cage_cpu->clock());
cage_cpu_h1_clock_period = cage_cpu_clock_period * 2;
- dma_timer = machine->device<timer_device>("cage_dma_timer");
- timer[0] = machine->device<timer_device>("cage_timer0");
- timer[1] = machine->device<timer_device>("cage_timer1");
+ dma_timer = machine.device<timer_device>("cage_dma_timer");
+ timer[0] = machine.device<timer_device>("cage_timer0");
+ timer[1] = machine.device<timer_device>("cage_timer1");
if (speedup)
speedup_ram = cage_cpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(speedup, speedup, FUNC(speedup_w));
@@ -178,7 +178,7 @@ void cage_init(running_machine *machine, offs_t speedup)
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
- dmadac[chan] = machine->device<dmadac_sound_device>(buffer);
+ dmadac[chan] = machine.device<dmadac_sound_device>(buffer);
}
state_save_register_global(machine, cpu_to_cage_ready);
@@ -192,7 +192,7 @@ void cage_init(running_machine *machine, offs_t speedup)
}
-void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
+void cage_set_irq_handler(void (*irqhandler)(running_machine &, int))
{
cage_irqhandler = irqhandler;
}
@@ -201,7 +201,7 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
void cage_reset_w(int state)
{
if (state)
- cage_control_w(cage_cpu->machine, 0);
+ cage_control_w(cage_cpu->machine(), 0);
device_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -342,7 +342,7 @@ static void update_timer(int which)
*
*************************************/
-static void update_serial(running_machine *machine)
+static void update_serial(running_machine &machine)
{
attotime serial_clock_period, bit_clock_period;
UINT32 freq;
@@ -438,7 +438,7 @@ static WRITE32_HANDLER( tms32031_io_w )
case SPORT_GLOBAL_CTL:
case SPORT_TIMER_CTL:
case SPORT_TIMER_PERIOD:
- update_serial(space->machine);
+ update_serial(space->machine());
break;
}
}
@@ -451,7 +451,7 @@ static WRITE32_HANDLER( tms32031_io_w )
*
*************************************/
-static void update_control_lines(running_machine *machine)
+static void update_control_lines(running_machine &machine)
{
int val;
@@ -482,7 +482,7 @@ static READ32_HANDLER( cage_from_main_r )
if (LOG_COMM)
logerror("%06X:CAGE read command = %04X\n", cpu_get_pc(space->cpu), cage_from_main);
cpu_to_cage_ready = 0;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
device_set_input_line(cage_cpu, TMS3203X_IRQ0, CLEAR_LINE);
return cage_from_main;
}
@@ -501,7 +501,7 @@ static WRITE32_HANDLER( cage_to_main_w )
logerror("%06X:Data from CAGE = %04X\n", cpu_get_pc(space->cpu), data);
soundlatch_word_w(space, 0, data, mem_mask);
cage_to_cpu_ready = 1;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
}
@@ -519,9 +519,9 @@ static READ32_HANDLER( cage_io_status_r )
UINT16 main_from_cage_r(address_space *space)
{
if (LOG_COMM)
- logerror("%s:main read data = %04X\n", space->machine->describe_context(), soundlatch_word_r(space, 0, 0));
+ logerror("%s:main read data = %04X\n", space->machine().describe_context(), soundlatch_word_r(space, 0, 0));
cage_to_cpu_ready = 0;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
return soundlatch_word_r(space, 0, 0xffff);
}
@@ -537,10 +537,10 @@ static TIMER_CALLBACK( deferred_cage_w )
void main_to_cage_w(UINT16 data)
{
- running_machine *machine = cage_cpu->machine;
+ running_machine &machine = cage_cpu->machine();
if (LOG_COMM)
- logerror("%s:Command to CAGE = %04X\n", machine->describe_context(), data);
- machine->scheduler().synchronize(FUNC(deferred_cage_w), data);
+ logerror("%s:Command to CAGE = %04X\n", machine.describe_context(), data);
+ machine.scheduler().synchronize(FUNC(deferred_cage_w), data);
}
@@ -557,7 +557,7 @@ UINT16 cage_control_r(void)
}
-void cage_control_w(running_machine *machine, UINT16 data)
+void cage_control_w(running_machine &machine, UINT16 data)
{
cage_control = data;
diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h
index cfb2b8f10fb..56169307470 100644
--- a/src/mame/audio/cage.h
+++ b/src/mame/audio/cage.h
@@ -10,11 +10,11 @@
MACHINE_CONFIG_EXTERN( cage );
MACHINE_CONFIG_EXTERN( cage_seattle );
-void cage_init(running_machine *machine, offs_t speedup);
-void cage_set_irq_handler(void (*irqhandler)(running_machine *, int));
+void cage_init(running_machine &machine, offs_t speedup);
+void cage_set_irq_handler(void (*irqhandler)(running_machine &, int));
void cage_reset_w(int state);
UINT16 main_from_cage_r(address_space *space);
UINT16 cage_control_r(void);
void main_to_cage_w(UINT16 data);
-void cage_control_w(running_machine *machine, UINT16 data);
+void cage_control_w(running_machine &machine, UINT16 data);
diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c
index 413396e055d..8d7f87e4836 100644
--- a/src/mame/audio/carnival.c
+++ b/src/mame/audio/carnival.c
@@ -127,7 +127,7 @@ static int psgData = 0;
WRITE8_HANDLER( carnival_audio_1_w )
{
static int port1State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w )
WRITE8_HANDLER( carnival_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -236,7 +236,7 @@ WRITE8_HANDLER( carnival_audio_2_w )
if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET )
/* reset output is no longer asserted active low */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE );
}
diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c
index 61eef77b63f..d9e7bc4eb4c 100644
--- a/src/mame/audio/cchasm.c
+++ b/src/mame/audio/cchasm.c
@@ -14,7 +14,7 @@
WRITE8_HANDLER( cchasm_reset_coin_flag_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
if (state->coin_flag)
{
state->coin_flag = 0;
@@ -24,7 +24,7 @@ WRITE8_HANDLER( cchasm_reset_coin_flag_w )
INPUT_CHANGED( cchasm_set_coin_flag )
{
- cchasm_state *state = field->port->machine->driver_data<cchasm_state>();
+ cchasm_state *state = field->port->machine().driver_data<cchasm_state>();
if (!newval && !state->coin_flag)
{
state->coin_flag = 1;
@@ -34,14 +34,14 @@ INPUT_CHANGED( cchasm_set_coin_flag )
READ8_HANDLER( cchasm_coin_sound_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
- UINT8 coin = (input_port_read(space->machine, "IN3") >> 4) & 0x7;
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
+ UINT8 coin = (input_port_read(space->machine(), "IN3") >> 4) & 0x7;
return state->sound_flags | (state->coin_flag << 3) | coin;
}
READ8_HANDLER( cchasm_soundlatch2_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
state->sound_flags &= ~0x80;
z80ctc_trg2_w(state->ctc, 0);
return soundlatch2_r(space, offset);
@@ -49,15 +49,15 @@ READ8_HANDLER( cchasm_soundlatch2_r )
WRITE8_HANDLER( cchasm_soundlatch4_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
state->sound_flags |= 0x40;
soundlatch4_w(space, offset, data);
- cputag_set_input_line(space->machine, "maincpu", 1, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, HOLD_LINE);
}
WRITE16_HANDLER( cchasm_io_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
//static int led;
if (ACCESSING_BITS_8_15)
@@ -72,7 +72,7 @@ WRITE16_HANDLER( cchasm_io_w )
state->sound_flags |= 0x80;
soundlatch2_w (space, offset, data);
z80ctc_trg2_w(state->ctc, 1);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
case 2:
//led = data;
@@ -83,7 +83,7 @@ WRITE16_HANDLER( cchasm_io_w )
READ16_HANDLER( cchasm_io_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
switch (offset & 0xf)
{
case 0x0:
@@ -92,11 +92,11 @@ READ16_HANDLER( cchasm_io_r )
state->sound_flags &= ~0x40;
return soundlatch4_r (space,offset) << 8;
case 0x2:
- return (state->sound_flags| (input_port_read(space->machine, "IN3") & 0x07) | 0x08) << 8;
+ return (state->sound_flags| (input_port_read(space->machine(), "IN3") & 0x07) | 0x08) << 8;
case 0x5:
- return input_port_read(space->machine, "IN2") << 8;
+ return input_port_read(space->machine(), "IN2") << 8;
case 0x8:
- return input_port_read(space->machine, "IN1") << 8;
+ return input_port_read(space->machine(), "IN1") << 8;
default:
return 0xff << 8;
}
@@ -105,23 +105,23 @@ READ16_HANDLER( cchasm_io_r )
static WRITE_LINE_DEVICE_HANDLER( ctc_timer_1_w )
{
- cchasm_state *drvstate = device->machine->driver_data<cchasm_state>();
+ cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
if (state) /* rising edge */
{
drvstate->output[0] ^= 0x7f;
drvstate->channel_active[0] = 1;
- dac_data_w(device->machine->device("dac1"), drvstate->output[0]);
+ dac_data_w(device->machine().device("dac1"), drvstate->output[0]);
}
}
static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w )
{
- cchasm_state *drvstate = device->machine->driver_data<cchasm_state>();
+ cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
if (state) /* rising edge */
{
drvstate->output[1] ^= 0x7f;
drvstate->channel_active[1] = 1;
- dac_data_w(device->machine->device("dac2"), drvstate->output[0]);
+ dac_data_w(device->machine().device("dac2"), drvstate->output[0]);
}
}
@@ -136,10 +136,10 @@ Z80CTC_INTERFACE( cchasm_ctc_intf )
SOUND_START( cchasm )
{
- cchasm_state *state = machine->driver_data<cchasm_state>();
+ cchasm_state *state = machine.driver_data<cchasm_state>();
state->coin_flag = 0;
state->sound_flags = 0;
state->output[0] = 0; state->output[1] = 0;
- state->ctc = machine->device("ctc");
+ state->ctc = machine.device("ctc");
}
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index a82f49ee781..497276fadc1 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -15,19 +15,19 @@ static INT16 *samplebuf; /* buffer to decode samples at run time */
static SAMPLES_START( cclimber_sh_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
samplebuf = 0;
- if (machine->region("samples")->base())
- samplebuf = auto_alloc_array(machine, INT16, 2 * machine->region("samples")->bytes());
+ if (machine.region("samples")->base())
+ samplebuf = auto_alloc_array(machine, INT16, 2 * machine.region("samples")->bytes());
}
-static void cclimber_play_sample(running_machine *machine, int start,int freq,int volume)
+static void cclimber_play_sample(running_machine &machine, int start,int freq,int volume)
{
int len;
- int romlen = machine->region("samples")->bytes();
- const UINT8 *rom = machine->region("samples")->base();
- device_t *samples = machine->device("samples");
+ int romlen = machine.region("samples")->bytes();
+ const UINT8 *rom = machine.region("samples")->base();
+ device_t *samples = machine.device("samples");
if (!rom) return;
@@ -74,7 +74,7 @@ WRITE8_HANDLER( cclimber_sample_trigger_w )
if (data == 0)
return;
- cclimber_play_sample(space->machine, 32 * sample_num,sample_freq,sample_volume);
+ cclimber_play_sample(space->machine(), 32 * sample_num,sample_freq,sample_volume);
}
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index 5da3bf54707..a2eb85dbd86 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -53,7 +53,7 @@
WRITE8_HANDLER( cinemat_sound_control_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
UINT8 oldval = state->sound_control;
/* form an 8-bit value with the new bit */
@@ -61,7 +61,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
/* if something changed, call the sound subroutine */
if ((state->sound_control != oldval) && state->sound_handler)
- (*state->sound_handler)(space->machine, state->sound_control, state->sound_control ^ oldval);
+ (*state->sound_handler)(space->machine(), state->sound_control, state->sound_control ^ oldval);
}
@@ -74,7 +74,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
static MACHINE_START( generic )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* register for save states */
state_save_register_global(machine, state->sound_control);
state_save_register_global(machine, state->current_shift);
@@ -89,9 +89,9 @@ static MACHINE_START( generic )
}
-static void generic_init(running_machine *machine, void (*callback)(running_machine *,UINT8, UINT8))
+static void generic_init(running_machine &machine, void (*callback)(running_machine &,UINT8, UINT8))
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* call the standard init */
MACHINE_RESET_CALL(cinemat);
@@ -141,17 +141,17 @@ static const samples_interface spacewar_samples_interface =
spacewar_sample_names
};
-static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void spacewar_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
- sample_start(samples, 0, (machine->rand() & 1) ? 0 : 6, 0);
+ sample_start(samples, 0, (machine.rand() & 1) ? 0 : 6, 0);
/* Fire sound - rising edge */
if (SOUNDVAL_RISING_EDGE(0x02))
- sample_start(samples, 1, (machine->rand() & 1) ? 1 : 7, 0);
+ sample_start(samples, 1, (machine.rand() & 1) ? 1 : 7, 0);
/* Player 1 thrust - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x04))
@@ -221,9 +221,9 @@ static const samples_interface barrier_samples_interface =
barrier_sample_names
};
-static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void barrier_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@@ -275,10 +275,10 @@ static const samples_interface speedfrk_samples_interface =
speedfrk_sample_names
};
-static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void speedfrk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@@ -342,9 +342,9 @@ static const samples_interface starhawk_samples_interface =
starhawk_sample_names
};
-static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void starhawk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -419,9 +419,9 @@ static const samples_interface sundance_samples_interface =
sundance_sample_names
};
-static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void sundance_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -490,13 +490,13 @@ static const samples_interface tailg_samples_interface =
tailg_sample_names
};
-static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void tailg_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* update the shift register (actually just a simple mux) */
state->current_shift = (state->current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
@@ -580,9 +580,9 @@ static const samples_interface warrior_samples_interface =
warrior_sample_names
};
-static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void warrior_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -652,10 +652,10 @@ static const samples_interface armora_samples_interface =
armora_sample_names
};
-static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void armora_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -755,10 +755,10 @@ static const samples_interface ripoff_samples_interface =
ripoff_sample_names
};
-static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void ripoff_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@@ -844,10 +844,10 @@ static const samples_interface starcas_samples_interface =
starcas_sample_names
};
-static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void starcas_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -888,14 +888,14 @@ static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bit
target_pitch = 0x5800 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 225;
if (state->current_pitch < target_pitch)
state->current_pitch += 150;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -959,10 +959,10 @@ static const samples_interface solarq_samples_interface =
solarq_sample_names
};
-static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -993,7 +993,7 @@ static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits
state->target_volume = 0;
/* ramp the thrust volume */
- if (sample_playing(samples, 2) && machine->primary_screen->frame_number() > state->last_frame)
+ if (sample_playing(samples, 2) && machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_volume > state->target_volume)
state->current_volume -= 0.078f;
@@ -1003,7 +1003,7 @@ static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits
sample_set_volume(samples, 2, state->current_volume);
else
sample_stop(samples, 2);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* fire - falling edge */
@@ -1100,10 +1100,10 @@ static const samples_interface boxingb_samples_interface =
boxingb_sample_names
};
-static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void boxingb_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -1233,10 +1233,10 @@ static const samples_interface wotw_samples_interface =
wotw_sample_names
};
-static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void wotw_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1277,14 +1277,14 @@ static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_c
target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 300;
if (state->current_pitch < target_pitch)
state->current_pitch += 200;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -1348,10 +1348,10 @@ static const samples_interface wotwc_samples_interface =
wotwc_sample_names
};
-static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void wotwc_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1392,14 +1392,14 @@ static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_
target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 300;
if (state->current_pitch < target_pitch)
state->current_pitch += 200;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -1445,26 +1445,26 @@ MACHINE_CONFIG_END
static TIMER_CALLBACK( synced_sound_w )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->sound_fifo[state->sound_fifo_in] = param;
state->sound_fifo_in = (state->sound_fifo_in + 1) % 16;
}
-static void demon_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void demon_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
/* all inputs are inverted */
sound_val = ~sound_val;
/* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */
if ((bits_changed & 0x10) && (sound_val & 0x10))
- machine->scheduler().synchronize(FUNC(synced_sound_w), sound_val & 0x0f);
+ machine.scheduler().synchronize(FUNC(synced_sound_w), sound_val & 0x0f);
}
static READ8_DEVICE_HANDLER( sound_porta_r )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
/* bits 0-3 are the sound data; bit 4 is the data ready */
return state->sound_fifo[state->sound_fifo_out] | ((state->sound_fifo_in != state->sound_fifo_out) << 4);
}
@@ -1472,14 +1472,14 @@ static READ8_DEVICE_HANDLER( sound_porta_r )
static READ8_DEVICE_HANDLER( sound_portb_r )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
return state->last_portb_write;
}
static WRITE8_DEVICE_HANDLER( sound_portb_w )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
/* watch for a 0->1 edge on bit 0 ("shift out") to advance the data pointer */
if ((data & 1) != (state->last_portb_write & 1) && (data & 1) != 0)
state->sound_fifo_out = (state->sound_fifo_out + 1) % 16;
@@ -1490,7 +1490,7 @@ static WRITE8_DEVICE_HANDLER( sound_portb_w )
/* bit 2 controls the global mute */
if ((data & 4) != (state->last_portb_write & 4))
- device->machine->sound().system_mute(data & 4);
+ device->machine().sound().system_mute(data & 4);
/* remember the last value written */
state->last_portb_write = data;
@@ -1536,7 +1536,7 @@ static Z80CTC_INTERFACE( demon_z80ctc_interface )
static MACHINE_RESET( demon_sound )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* generic init */
generic_init(machine, demon_sound_w);
@@ -1545,7 +1545,7 @@ static MACHINE_RESET( demon_sound )
state->last_portb_write = 0xff;
/* turn off channel A on AY8910 #0 because it is used as a low-pass filter */
- ay8910_set_volume(machine->device("ay1"), 0, 0);
+ ay8910_set_volume(machine.device("ay1"), 0, 0);
}
@@ -1614,19 +1614,19 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( qb3_sound_w )
{
- UINT16 rega = cpu_get_reg(space->machine->device("maincpu"), CCPU_A);
- demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
+ UINT16 rega = cpu_get_reg(space->machine().device("maincpu"), CCPU_A);
+ demon_sound_w(space->machine(), 0x00 | (~rega & 0x0f), 0x10);
}
static MACHINE_RESET( qb3_sound )
{
MACHINE_RESET_CALL(demon_sound);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x04, 0x04, FUNC(qb3_sound_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x04, 0x04, FUNC(qb3_sound_w));
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
/* on a cube rotate */
- machine->region("audiocpu")->base()[0x11dc] = 0x09;
+ machine.region("audiocpu")->base()[0x11dc] = 0x09;
}
diff --git a/src/mame/audio/circus.c b/src/mame/audio/circus.c
index 52f037ae3c5..1c6b28b1eaa 100644
--- a/src/mame/audio/circus.c
+++ b/src/mame/audio/circus.c
@@ -172,10 +172,10 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( circus_clown_z_w )
{
- circus_state *state = space->machine->driver_data<circus_state>();
+ circus_state *state = space->machine().driver_data<circus_state>();
state->clown_z = (data & 0x0f);
- *(space->machine->region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
+ *(space->machine().region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
/* Bits 4-6 enable/disable trigger different events */
switch (state->game_id)
@@ -275,5 +275,5 @@ WRITE8_HANDLER( circus_clown_z_w )
}
/* Bit 7 enables amplifier (0 = on) */
- space->machine->sound().system_mute(data & 0x80);
+ space->machine().sound().system_mute(data & 0x80);
}
diff --git a/src/mame/audio/copsnrob.c b/src/mame/audio/copsnrob.c
index 7fcaa492730..c25e364bb37 100644
--- a/src/mame/audio/copsnrob.c
+++ b/src/mame/audio/copsnrob.c
@@ -688,8 +688,8 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( copsnrob_misc_w )
{
- device_t *device = space->machine->device("discrete");
- copsnrob_state *state = space->machine->driver_data<copsnrob_state>();
+ device_t *device = space->machine().device("discrete");
+ copsnrob_state *state = space->machine().driver_data<copsnrob_state>();
UINT8 latched_data = state->ic_h3_data;
UINT8 special_data = data & 0x01;
@@ -730,12 +730,12 @@ WRITE8_HANDLER( copsnrob_misc_w )
case 0x06:
/* One Start */
- set_led_status(space->machine, 0, !special_data);
+ set_led_status(space->machine(), 0, !special_data);
break;
case 0x07:
discrete_sound_w(device, COPSNROB_AUDIO_ENABLE, special_data);
- //space->machine->sound().system_mute(special_data);
+ //space->machine().sound().system_mute(special_data);
break;
}
diff --git a/src/mame/audio/cps3.c b/src/mame/audio/cps3.c
index 5d359db6246..d458d7b0204 100644
--- a/src/mame/audio/cps3.c
+++ b/src/mame/audio/cps3.c
@@ -40,7 +40,7 @@ static STREAM_UPDATE( cps3_stream_update )
// the actual 'user5' region only exists on the nocd sets, on the others it's allocated in the initialization.
// it's a shared gfx/sound region, so can't be allocated as part of the sound device.
- state->base = (INT8*)device->machine->driver_data<cps3_state>()->user5region;
+ state->base = (INT8*)device->machine().driver_data<cps3_state>()->user5region;
/* Clear the buffers */
memset(outputs[0], 0, samples*sizeof(*outputs[0]));
@@ -114,7 +114,7 @@ static DEVICE_START( cps3_sound )
cps3_sound_state *state = get_safe_token(device);
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 384, NULL, cps3_stream_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 384, NULL, cps3_stream_update);
}
DEVICE_GET_INFO( cps3_sound )
diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c
index 0c0f5a8ade6..10c1350be8f 100644
--- a/src/mame/audio/cyberbal.c
+++ b/src/mame/audio/cyberbal.c
@@ -11,16 +11,16 @@
#include "includes/cyberbal.h"
-static void update_sound_68k_interrupts(running_machine *machine);
+static void update_sound_68k_interrupts(running_machine &machine);
-void cyberbal_sound_reset(running_machine *machine)
+void cyberbal_sound_reset(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
/* reset the sound system */
- state->bank_base = &machine->region("audiocpu")->base()[0x10000];
+ state->bank_base = &machine.region("audiocpu")->base()[0x10000];
memory_set_bankptr(machine, "soundbank", &state->bank_base[0x0000]);
state->fast_68k_int = state->io_68k_int = 0;
state->sound_data_from_68k = state->sound_data_from_6502 = 0;
@@ -37,9 +37,9 @@ void cyberbal_sound_reset(running_machine *machine)
READ8_HANDLER( cyberbal_special_port3_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "JSAII");
- if (!(input_port_read(space->machine, "IN0") & 0x8000)) temp ^= 0x80;
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "JSAII");
+ if (!(input_port_read(space->machine(), "IN0") & 0x8000)) temp ^= 0x80;
if (state->cpu_to_sound_ready) temp ^= 0x40;
if (state->sound_to_cpu_ready) temp ^= 0x20;
return temp;
@@ -48,7 +48,7 @@ READ8_HANDLER( cyberbal_special_port3_r )
READ8_HANDLER( cyberbal_sound_6502_stat_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = 0xff;
if (state->sound_data_from_6502_ready) temp ^= 0x80;
if (state->sound_data_from_68k_ready) temp ^= 0x40;
@@ -58,18 +58,18 @@ READ8_HANDLER( cyberbal_sound_6502_stat_r )
WRITE8_HANDLER( cyberbal_sound_bank_select_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- memory_set_bankptr(space->machine, "soundbank", &state->bank_base[0x1000 * ((data >> 6) & 3)]);
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
- cputag_set_input_line(space->machine, "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
- if (!(data & 0x01)) devtag_reset(space->machine, "ymsnd");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ memory_set_bankptr(space->machine(), "soundbank", &state->bank_base[0x1000 * ((data >> 6) & 3)]);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ cputag_set_input_line(space->machine(), "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+ if (!(data & 0x01)) devtag_reset(space->machine(), "ymsnd");
}
READ8_HANDLER( cyberbal_sound_68k_6502_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
state->sound_data_from_68k_ready = 0;
return state->sound_data_from_68k;
}
@@ -77,7 +77,7 @@ READ8_HANDLER( cyberbal_sound_68k_6502_r )
WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
state->sound_data_from_6502 = data;
state->sound_data_from_6502_ready = 1;
@@ -85,7 +85,7 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
if (!state->io_68k_int)
{
state->io_68k_int = 1;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
@@ -97,9 +97,9 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
*
*************************************/
-static void update_sound_68k_interrupts(running_machine *machine)
+static void update_sound_68k_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "dac", 6, state->fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "dac", 2, state->io_68k_int ? ASSERT_LINE : CLEAR_LINE);
}
@@ -107,29 +107,29 @@ static void update_sound_68k_interrupts(running_machine *machine)
INTERRUPT_GEN( cyberbal_sound_68k_irq_gen )
{
- cyberbal_state *state = device->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = device->machine().driver_data<cyberbal_state>();
if (!state->fast_68k_int)
{
state->fast_68k_int = 1;
- update_sound_68k_interrupts(device->machine);
+ update_sound_68k_interrupts(device->machine());
}
}
WRITE16_HANDLER( cyberbal_io_68k_irq_ack_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
if (state->io_68k_int)
{
state->io_68k_int = 0;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
READ16_HANDLER( cyberbal_sound_68k_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = (state->sound_data_from_6502 << 8) | 0xff;
state->sound_data_from_6502_ready = 0;
@@ -142,7 +142,7 @@ READ16_HANDLER( cyberbal_sound_68k_r )
WRITE16_HANDLER( cyberbal_sound_68k_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
if (ACCESSING_BITS_8_15)
{
state->sound_data_from_68k = (data >> 8) & 0xff;
@@ -153,13 +153,13 @@ WRITE16_HANDLER( cyberbal_sound_68k_w )
WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- device_t *dac = space->machine->device((offset & 8) ? "dac2" : "dac1");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ device_t *dac = space->machine().device((offset & 8) ? "dac2" : "dac1");
dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
if (state->fast_68k_int)
{
state->fast_68k_int = 0;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 89b3bc929b4..66d93556192 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -321,8 +321,8 @@ struct _dcs_state
UINT8 last_output_full;
UINT8 last_input_empty;
UINT16 progflags;
- void (*output_full_cb)(running_machine *, int);
- void (*input_empty_cb)(running_machine *, int);
+ void (*output_full_cb)(running_machine &, int);
+ void (*input_empty_cb)(running_machine &, int);
UINT16 (*fifo_data_r)(device_t *device);
UINT16 (*fifo_status_r)(device_t *device);
@@ -385,7 +385,7 @@ static READ16_HANDLER( dcs_dataram_r );
static WRITE16_HANDLER( dcs_dataram_w );
static WRITE16_HANDLER( dcs_data_bank_select_w );
-static void sdrc_reset(running_machine *machine);
+static void sdrc_reset(running_machine &machine);
static READ16_HANDLER( sdrc_r );
static WRITE16_HANDLER( sdrc_w );
static STATE_POSTLOAD( sdrc_postload );
@@ -413,14 +413,14 @@ static void timer_enable_callback(adsp21xx_device &device, int enable);
static TIMER_DEVICE_CALLBACK( internal_timer_callback );
static TIMER_DEVICE_CALLBACK( dcs_irq );
static TIMER_DEVICE_CALLBACK( sport0_irq );
-static void recompute_sample_rate(running_machine *machine);
+static void recompute_sample_rate(running_machine &machine);
static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data);
static READ16_HANDLER( dcs_polling_r );
static WRITE16_HANDLER( dcs_polling_w );
static TIMER_DEVICE_CALLBACK( transfer_watchdog_callback );
-static int preprocess_write(running_machine *machine, UINT16 data);
+static int preprocess_write(running_machine &machine, UINT16 data);
@@ -885,7 +885,7 @@ static TIMER_CALLBACK( dcs_reset )
*
*************************************/
-static void dcs_register_state(running_machine *machine)
+static void dcs_register_state(running_machine &machine)
{
state_save_register_global_array(machine, sdrc.reg);
state_save_register_global(machine, sdrc.seed);
@@ -935,33 +935,33 @@ static void dcs_register_state(running_machine *machine)
state_save_register_global_pointer(machine, dcs_sram, 0x8000*4 / sizeof(dcs_sram[0]));
if (dcs.rev == 2)
- machine->state().register_postload(sdrc_postload, NULL);
+ machine.state().register_postload(sdrc_postload, NULL);
}
-void dcs_init(running_machine *machine)
+void dcs_init(running_machine &machine)
{
memset(&dcs, 0, sizeof(dcs));
dcs_sram = NULL;
/* find the DCS CPU and the sound ROMs */
- dcs.cpu = machine->device<adsp21xx_device>("dcs");
+ dcs.cpu = machine.device<adsp21xx_device>("dcs");
dcs.program = dcs.cpu->space(AS_PROGRAM);
dcs.data = dcs.cpu->space(AS_DATA);
dcs.rev = 1;
dcs.channels = 1;
- dcs.dmadac[0] = machine->device<dmadac_sound_device>("dac");
+ dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac");
/* configure boot and sound ROMs */
- dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
- dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
+ dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
dcs.sounddata = dcs.bootrom;
dcs.sounddata_words = dcs.bootrom_words;
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
memory_configure_bank(machine, "databank", 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
/* create the timers */
- dcs.internal_timer = machine->device<timer_device>("dcs_int_timer");
- dcs.reg_timer = machine->device<timer_device>("dcs_reg_timer");
+ dcs.internal_timer = machine.device<timer_device>("dcs_int_timer");
+ dcs.reg_timer = machine.device<timer_device>("dcs_reg_timer");
/* non-RAM based automatically acks */
dcs.auto_ack = TRUE;
@@ -974,37 +974,37 @@ void dcs_init(running_machine *machine)
}
-void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
+void dcs2_init(running_machine &machine, int dram_in_mb, offs_t polling_offset)
{
int soundbank_words;
memset(&dcs, 0, sizeof(dcs));
/* find the DCS CPU and the sound ROMs */
- dcs.cpu = machine->device<adsp21xx_device>("dcs2");
+ dcs.cpu = machine.device<adsp21xx_device>("dcs2");
dcs.rev = 2;
soundbank_words = 0x1000;
if (dcs.cpu == NULL)
{
- dcs.cpu = machine->device<adsp21xx_device>("dsio");
+ dcs.cpu = machine.device<adsp21xx_device>("dsio");
dcs.rev = 3;
soundbank_words = 0x400;
}
if (dcs.cpu == NULL)
{
- dcs.cpu = machine->device<adsp21xx_device>("denver");
+ dcs.cpu = machine.device<adsp21xx_device>("denver");
dcs.rev = 4;
soundbank_words = 0x800;
}
dcs.program = dcs.cpu->space(AS_PROGRAM);
dcs.data = dcs.cpu->space(AS_DATA);
dcs.channels = 2;
- dcs.dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- dcs.dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ dcs.dmadac[1] = machine.device<dmadac_sound_device>("dac2");
/* always boot from the base of "dcs" */
- dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
- dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
+ dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
/* supports both RAM and ROM variants */
if (dram_in_mb != 0)
@@ -1025,9 +1025,9 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
dcs_sram = auto_alloc_array(machine, UINT16, 0x8000*4/2);
/* create the timers */
- dcs.internal_timer = machine->device<timer_device>("dcs_int_timer");
- dcs.reg_timer = machine->device<timer_device>("dcs_reg_timer");
- dcs.sport_timer = machine->device<timer_device>("dcs_sport_timer");
+ dcs.internal_timer = machine.device<timer_device>("dcs_int_timer");
+ dcs.reg_timer = machine.device<timer_device>("dcs_reg_timer");
+ dcs.sport_timer = machine.device<timer_device>("dcs_sport_timer");
/* we don't do auto-ack by default */
dcs.auto_ack = FALSE;
@@ -1040,7 +1040,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
/* allocate a watchdog timer for HLE transfers */
transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0);
if (transfer.hle_enabled)
- transfer.watchdog = machine->device<timer_device>("dcs_hle_timer");
+ transfer.watchdog = machine.device<timer_device>("dcs_hle_timer");
/* register for save states */
dcs_register_state(machine);
@@ -1080,11 +1080,11 @@ static WRITE16_HANDLER( dcs_dataram_w )
static WRITE16_HANDLER( dcs_data_bank_select_w )
{
dcs.sounddata_bank = data & 0x7ff;
- memory_set_bank(space->machine, "databank", dcs.sounddata_bank % dcs.sounddata_banks);
+ memory_set_bank(space->machine(), "databank", dcs.sounddata_bank % dcs.sounddata_banks);
/* bit 11 = sound board led */
#if 0
- set_led_status(space->machine, 2, data & 0x800);
+ set_led_status(space->machine(), 2, data & 0x800);
#endif
}
@@ -1096,7 +1096,7 @@ static WRITE16_HANDLER( dcs_data_bank_select_w )
*
*************************************/
-INLINE void sdrc_update_bank_pointers(running_machine *machine)
+INLINE void sdrc_update_bank_pointers(running_machine &machine)
{
if (SDRC_SM_EN != 0)
{
@@ -1121,7 +1121,7 @@ INLINE void sdrc_update_bank_pointers(running_machine *machine)
}
-static void sdrc_remap_memory(running_machine *machine)
+static void sdrc_remap_memory(running_machine &machine)
{
/* if SRAM disabled, clean it out */
if (SDRC_SM_EN == 0)
@@ -1184,7 +1184,7 @@ static STATE_POSTLOAD( sdrc_postload )
}
-static void sdrc_reset(running_machine *machine)
+static void sdrc_reset(running_machine &machine)
{
memset(sdrc.reg, 0, sizeof(sdrc.reg));
sdrc_remap_memory(machine);
@@ -1256,9 +1256,9 @@ static WRITE16_HANDLER( sdrc_w )
case 0:
sdrc.reg[0] = data;
if (diff & 0x1833)
- sdrc_remap_memory(space->machine);
+ sdrc_remap_memory(space->machine());
if (diff & 0x0380)
- sdrc_update_bank_pointers(space->machine);
+ sdrc_update_bank_pointers(space->machine());
break;
/* offset 1 controls RAM mapping */
@@ -1266,14 +1266,14 @@ static WRITE16_HANDLER( sdrc_w )
sdrc.reg[1] = data;
// dmadac_enable(&dcs.dmadac[0], dcs.channels, SDRC_MUTE);
if (diff & 0x0003)
- sdrc_remap_memory(space->machine);
+ sdrc_remap_memory(space->machine());
break;
/* offset 2 controls paging */
case 2:
sdrc.reg[2] = data;
if (diff & 0x1fff)
- sdrc_update_bank_pointers(space->machine);
+ sdrc_update_bank_pointers(space->machine());
break;
/* offset 3 controls security */
@@ -1352,13 +1352,13 @@ static WRITE16_HANDLER( dsio_w )
dmadac_enable(&dcs.dmadac[0], dcs.channels, DSIO_MUTE);
/* bit 0 resets the FIFO */
- midway_ioasic_fifo_reset_w(space->machine, DSIO_EMPTY_FIFO ^ 1);
+ midway_ioasic_fifo_reset_w(space->machine(), DSIO_EMPTY_FIFO ^ 1);
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- memory_set_bank(space->machine, "databank", DSIO_DM_PG % dcs.sounddata_banks);
+ memory_set_bank(space->machine(), "databank", DSIO_DM_PG % dcs.sounddata_banks);
break;
}
}
@@ -1412,24 +1412,24 @@ static WRITE16_HANDLER( denver_w )
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
- dcs.dmadac[chan] = space->machine->device<dmadac_sound_device>(buffer);
+ dcs.dmadac[chan] = space->machine().device<dmadac_sound_device>(buffer);
}
dmadac_enable(&dcs.dmadac[0], dcs.channels, enable);
if (dcs.channels < 6)
dmadac_enable(&dcs.dmadac[dcs.channels], 6 - dcs.channels, FALSE);
- recompute_sample_rate(space->machine);
+ recompute_sample_rate(space->machine());
}
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- memory_set_bank(space->machine, "databank", DENV_DM_PG % dcs.sounddata_bank);
+ memory_set_bank(space->machine(), "databank", DENV_DM_PG % dcs.sounddata_bank);
break;
/* offset 3 controls FIFO reset */
case 3:
- midway_ioasic_fifo_reset_w(space->machine, 1);
+ midway_ioasic_fifo_reset_w(space->machine(), 1);
break;
}
}
@@ -1490,7 +1490,7 @@ READ32_HANDLER( dsio_idma_data_r )
DCS COMMUNICATIONS
****************************************************************************/
-void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int))
+void dcs_set_io_callbacks(void (*output_full_cb)(running_machine &, int), void (*input_empty_cb)(running_machine &, int))
{
dcs.input_empty_cb = input_empty_cb;
dcs.output_full_cb = output_full_cb;
@@ -1508,7 +1508,7 @@ int dcs_control_r(void)
{
/* only boost for DCS2 boards */
if (!dcs.auto_ack && !transfer.hle_enabled)
- dcs.cpu->machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
+ dcs.cpu->machine().scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
return dcs.latch_control;
}
@@ -1518,10 +1518,10 @@ void dcs_reset_w(int state)
/* going high halts the CPU */
if (state)
{
- logerror("%s: DCS reset = %d\n", dcs.cpu->machine->describe_context(), state);
+ logerror("%s: DCS reset = %d\n", dcs.cpu->machine().describe_context(), state);
/* just run through the init code again */
- dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_reset));
+ dcs.cpu->machine().scheduler().synchronize(FUNC(dcs_reset));
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -1560,13 +1560,13 @@ static READ16_HANDLER( fifo_input_r )
INPUT LATCH (data from host to DCS)
****************************************************************************/
-static void dcs_delayed_data_w(running_machine *machine, int data)
+static void dcs_delayed_data_w(running_machine &machine, int data)
{
if (LOG_DCS_IO)
- logerror("%s:dcs_data_w(%04X)\n", machine->describe_context(), data);
+ logerror("%s:dcs_data_w(%04X)\n", machine.describe_context(), data);
/* boost the interleave temporarily */
- machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
+ machine.scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
/* set the IRQ line on the ADSP */
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, ASSERT_LINE);
@@ -1590,21 +1590,21 @@ static TIMER_CALLBACK( dcs_delayed_data_w_callback )
void dcs_data_w(int data)
{
/* preprocess the write */
- if (preprocess_write(dcs.cpu->machine, data))
+ if (preprocess_write(dcs.cpu->machine(), data))
return;
/* if we are DCS1, set a timer to latch the data */
if (dcs.sport_timer == NULL)
- dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_delayed_data_w_callback), data);
+ dcs.cpu->machine().scheduler().synchronize(FUNC(dcs_delayed_data_w_callback), data);
else
- dcs_delayed_data_w(dcs.cpu->machine, data);
+ dcs_delayed_data_w(dcs.cpu->machine(), data);
}
static WRITE16_HANDLER( input_latch_ack_w )
{
if (!dcs.last_input_empty && dcs.input_empty_cb)
- (*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(space->machine(), dcs.last_input_empty = 1);
SET_INPUT_EMPTY();
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
}
@@ -1638,7 +1638,7 @@ static WRITE16_HANDLER( output_latch_w )
{
if (LOG_DCS_IO)
logerror("%08X:output_latch_w(%04X) (empty=%d)\n", cpu_get_pc(space->cpu), data, IS_OUTPUT_EMPTY());
- space->machine->scheduler().synchronize(FUNC(latch_delayed_w), data);
+ space->machine().scheduler().synchronize(FUNC(latch_delayed_w), data);
}
@@ -1656,7 +1656,7 @@ static TIMER_CALLBACK( delayed_ack_w_callback )
void dcs_ack_w(void)
{
- dcs.cpu->machine->scheduler().synchronize(FUNC(delayed_ack_w_callback));
+ dcs.cpu->machine().scheduler().synchronize(FUNC(delayed_ack_w_callback));
}
@@ -1664,12 +1664,12 @@ int dcs_data_r(void)
{
/* data is actually only 8 bit (read from d8-d15) */
if (dcs.last_output_full && dcs.output_full_cb)
- (*dcs.output_full_cb)(dcs.cpu->machine, dcs.last_output_full = 0);
+ (*dcs.output_full_cb)(dcs.cpu->machine(), dcs.last_output_full = 0);
if (dcs.auto_ack)
delayed_ack_w();
if (LOG_DCS_IO)
- logerror("%s:dcs_data_r(%04X)\n", dcs.cpu->machine->describe_context(), dcs.output_data);
+ logerror("%s:dcs_data_r(%04X)\n", dcs.cpu->machine().describe_context(), dcs.output_data);
return dcs.output_data;
}
@@ -1692,7 +1692,7 @@ static WRITE16_HANDLER( output_control_w )
{
if (LOG_DCS_IO)
logerror("%04X:output_control = %04X\n", cpu_get_pc(space->cpu), data);
- space->machine->scheduler().synchronize(FUNC(output_control_delayed_w), data);
+ space->machine().scheduler().synchronize(FUNC(output_control_delayed_w), data);
}
@@ -1716,7 +1716,7 @@ int dcs_data2_r(void)
*
*************************************/
-static void update_timer_count(running_machine *machine)
+static void update_timer_count(running_machine &machine)
{
UINT64 periods_since_start;
UINT64 elapsed_cycles;
@@ -1765,7 +1765,7 @@ static TIMER_DEVICE_CALLBACK( internal_timer_callback )
}
-static void reset_timer(running_machine *machine)
+static void reset_timer(running_machine &machine)
{
/* if not enabled, skip */
if (!dcs.timer_enable)
@@ -1804,7 +1804,7 @@ static void timer_enable_callback(adsp21xx_device &device, int enable)
if (enable)
{
// mame_printf_debug("Timer enabled @ %d cycles/int, or %f Hz\n", dcs.timer_scale * (dcs.timer_period + 1), 1.0 / dcs.cpu->cycles_to_attotime(dcs.timer_scale * (dcs.timer_period + 1)));
- reset_timer(device.machine);
+ reset_timer(device.machine());
}
else
{
@@ -1855,7 +1855,7 @@ static READ16_HANDLER( adsp_control_r )
break;
case TIMER_COUNT_REG:
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
result = dcs.control_regs[offset];
break;
@@ -1911,23 +1911,23 @@ static WRITE16_HANDLER( adsp_control_w )
data = (data & 0xff) + 1;
if (data != dcs.timer_scale)
{
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
dcs.timer_scale = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
}
break;
case TIMER_COUNT_REG:
dcs.timer_start_count = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
break;
case TIMER_PERIOD_REG:
if (data != dcs.timer_period)
{
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
dcs.timer_period = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
}
break;
@@ -1992,7 +1992,7 @@ static TIMER_DEVICE_CALLBACK( sport0_irq )
}
-static void recompute_sample_rate(running_machine *machine)
+static void recompute_sample_rate(running_machine &machine)
{
/* calculate how long until we generate an interrupt */
@@ -2050,7 +2050,7 @@ static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data)
dcs.ireg_base = source;
/* recompute the sample rate and timer */
- recompute_sample_rate(device.machine);
+ recompute_sample_rate(device.machine());
return;
}
else
@@ -2104,7 +2104,7 @@ void dcs_fifo_notify(int count, int max)
if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write(dcs.cpu->machine, (*dcs.fifo_data_r)(dcs.cpu));
+ preprocess_write(dcs.cpu->machine(), (*dcs.fifo_data_r)(dcs.cpu));
}
}
@@ -2116,7 +2116,7 @@ static TIMER_DEVICE_CALLBACK( transfer_watchdog_callback )
if (transfer.fifo_entries && starting_writes_left == transfer.writes_left)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write(timer.machine, (*dcs.fifo_data_r)(dcs.cpu));
+ preprocess_write(timer.machine(), (*dcs.fifo_data_r)(dcs.cpu));
}
if (transfer.watchdog != NULL)
transfer.watchdog->adjust(attotime::from_msec(1), transfer.writes_left);
@@ -2128,7 +2128,7 @@ static TIMER_CALLBACK( s1_ack_callback2 )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
return;
}
output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, 0x000a, 0xffff);
@@ -2140,17 +2140,17 @@ static TIMER_CALLBACK( s1_ack_callback1 )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
return;
}
output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, param, 0xffff);
/* chain to the next word we need to write back */
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
}
-static int preprocess_stage_1(running_machine *machine, UINT16 data)
+static int preprocess_stage_1(running_machine &machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2159,7 +2159,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
if (data == 0x001a)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS Transfer command %04X\n", machine.describe_context(), data);
transfer.state++;
if (transfer.hle_enabled)
return 1;
@@ -2169,7 +2169,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
else if (data == 0x002a)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS State change %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS State change %04X\n", machine.describe_context(), data);
transfer.dcs_state = 1;
}
@@ -2262,7 +2262,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
/* if we're done, start a timer to send the response words */
if (transfer.state == 0)
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), transfer.sum);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), transfer.sum);
return 1;
}
break;
@@ -2278,7 +2278,7 @@ static TIMER_CALLBACK( s2_ack_callback )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), param);
return;
}
output_latch_w(space, 0, param, 0xffff);
@@ -2286,7 +2286,7 @@ static TIMER_CALLBACK( s2_ack_callback )
}
-static int preprocess_stage_2(running_machine *machine, UINT16 data)
+static int preprocess_stage_2(running_machine &machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2295,7 +2295,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
if (data == 0x55d0 || data == 0x55d1)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS Transfer command %04X\n", machine.describe_context(), data);
transfer.state++;
if (transfer.hle_enabled)
return 1;
@@ -2305,7 +2305,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
else
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:Command: %04X\n", machine->describe_context(), data);
+ logerror("%s:Command: %04X\n", machine.describe_context(), data);
}
break;
@@ -2375,7 +2375,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
/* if we're done, start a timer to send the response words */
if (transfer.state == 0)
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), transfer.sum);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), transfer.sum);
transfer.watchdog->reset();
}
return 1;
@@ -2386,7 +2386,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
}
-static int preprocess_write(running_machine *machine, UINT16 data)
+static int preprocess_write(running_machine &machine, UINT16 data)
{
int result;
diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h
index 0066598a7dd..ae65cedd1ee 100644
--- a/src/mame/audio/dcs.h
+++ b/src/mame/audio/dcs.h
@@ -12,12 +12,12 @@ MACHINE_CONFIG_EXTERN( dcs2_audio_2104 );
MACHINE_CONFIG_EXTERN( dcs2_audio_dsio );
MACHINE_CONFIG_EXTERN( dcs2_audio_denver );
-void dcs_init(running_machine *machine);
-void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset);
+void dcs_init(running_machine &machine);
+void dcs2_init(running_machine &machine, int dram_in_mb, offs_t polling_offset);
void dcs_set_auto_ack(int state);
void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(device_t *device), UINT16 (*fifo_status_r)(device_t *device));
-void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int));
+void dcs_set_io_callbacks(void (*output_full_cb)(running_machine &, int), void (*input_empty_cb)(running_machine &, int));
int dcs_data_r(void);
void dcs_ack_w(void);
diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c
index 1ba5cac8567..325dac17afc 100644
--- a/src/mame/audio/depthch.c
+++ b/src/mame/audio/depthch.c
@@ -56,7 +56,7 @@ enum
WRITE8_HANDLER( depthch_audio_w )
{
static int port1State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index ccfc0dd4111..77484d45b61 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -1114,9 +1114,9 @@ DISCRETE_SOUND_END
static SOUND_START( dkong)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
- state->snd_rom = machine->region("soundcpu")->base();
+ state->snd_rom = machine.region("soundcpu")->base();
}
@@ -1244,7 +1244,7 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
UINT8 page = latch8_r(state->dev_vp2, 0) & 0x47;
if ( page & 0x40 )
@@ -1253,7 +1253,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r )
}
else
{
- /* printf("%s:rom access\n",device->machine->describe_context()); */
+ /* printf("%s:rom access\n",device->machine().describe_context()); */
return (state->snd_rom[0x1000 + (page & 7) * 256 + offset]);
}
}
@@ -1273,9 +1273,9 @@ static WRITE8_DEVICE_HANDLER( dkong_p1_w )
WRITE8_HANDLER( dkong_audio_irq_w )
{
if (data)
- cputag_set_input_line(space->machine, "soundcpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c
index 09307278a6e..5ab0edd60c7 100644
--- a/src/mame/audio/exidy.c
+++ b/src/mame/audio/exidy.c
@@ -132,7 +132,7 @@ INLINE exidy_sound_state *get_safe_token(device_t *device)
static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{
exidy_sound_state *sndstate = get_safe_token(device);
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(sndstate->pia1) | sndstate->riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(sndstate->pia1) | sndstate->riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -401,8 +401,8 @@ static DEVICE_START( common_sh_start )
state->sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24));
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, NULL, exidy_stream_update);
- state->maincpu = device->machine->device("maincpu");
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, NULL, exidy_stream_update);
+ state->maincpu = device->machine().device("maincpu");
sh6840_register_state_globals(device);
}
@@ -491,11 +491,11 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
{
exidy_sound_state *state = get_safe_token(device);
if (state->cvsd != NULL)
- cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (state->tms != NULL)
{
- logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), riot6532_porta_out_get(state->riot));
+ logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), riot6532_porta_out_get(state->riot));
tms5220_data_w(state->tms, 0, data);
}
}
@@ -505,7 +505,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
exidy_sound_state *state = get_safe_token(device);
if (state->tms != NULL)
{
- logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), tms5220_status_r(state->tms, 0));
+ logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->tms, 0));
return tms5220_status_r(state->tms, 0);
}
else
@@ -802,18 +802,18 @@ static const pia6821_interface venture_pia1_intf =
static DEVICE_START( venture_common_sh_start )
{
exidy_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
DEVICE_START_CALL(common_sh_start);
- state->riot = machine->device("riot");
+ state->riot = machine.device("riot");
state->has_sh8253 = TRUE;
state->tms = NULL;
- state->pia1 = device->machine->device("pia1");
+ state->pia1 = device->machine().device("pia1");
/* determine which sound hardware is installed */
- state->cvsd = device->machine->device("cvsd");
+ state->cvsd = device->machine().device("cvsd");
/* 8253 */
state->freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
@@ -836,8 +836,8 @@ static DEVICE_RESET( venture_sound )
DEVICE_RESET_CALL(common_sh_reset);
/* PIA */
- devtag_reset(device->machine, "pia0");
- devtag_reset(device->machine, "pia1");
+ devtag_reset(device->machine(), "pia0");
+ devtag_reset(device->machine(), "pia1");
/* 6532 */
state->riot->reset();
@@ -1008,7 +1008,7 @@ WRITE8_DEVICE_HANDLER( victory_sound_command_w )
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", cpu_get_previouspc(state->maincpu), data);
- device->machine->scheduler().synchronize(FUNC(delayed_command_w), data, state->pia1);
+ device->machine().scheduler().synchronize(FUNC(delayed_command_w), data, state->pia1);
}
@@ -1016,7 +1016,7 @@ static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w )
{
exidy_sound_state *state = get_safe_token(device);
- if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine->describe_context(), data);
+ if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine().describe_context(), data);
if (!data) pia6821_ca1_w(state->pia1, 1);
}
@@ -1026,7 +1026,7 @@ static WRITE8_DEVICE_HANDLER( victory_main_ack_w )
{
exidy_sound_state *state = get_safe_token(device);
- if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine->describe_context(), data);
+ if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine().describe_context(), data);
if (state->victory_sound_response_ack_clk && !data)
pia6821_cb1_w(state->pia1, 1);
@@ -1060,7 +1060,7 @@ static DEVICE_START( victory_sound )
device->save_item(NAME(state->victory_sound_response_ack_clk));
DEVICE_START_CALL(venture_common_sh_start);
- state->tms = device->machine->device("tms");
+ state->tms = device->machine().device("tms");
}
diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c
index 7ac9ebff735..b0c9de7f3df 100644
--- a/src/mame/audio/exidy440.c
+++ b/src/mame/audio/exidy440.c
@@ -110,12 +110,12 @@ static const int channel_bits[4] =
/* function prototypes */
static STREAM_UPDATE( channel_update );
static void m6844_finished(int ch);
-static void play_cvsd(running_machine *machine, int ch);
+static void play_cvsd(running_machine &machine, int ch);
static void stop_cvsd(int ch);
static void reset_sound_cache(void);
static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency);
-static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency);
+static INT16 *find_or_add_to_sound_cache(running_machine &machine, int address, int length, int bits, int frequency);
static void decode_and_filter_cvsd(UINT8 *data, int bytes, int maskbits, int frequency, INT16 *dest);
static void fir_filter(INT32 *input, INT16 *output, int count);
@@ -130,7 +130,7 @@ static void fir_filter(INT32 *input, INT16 *output, int count);
static DEVICE_START( exidy440_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, length;
/* reset the system */
@@ -159,10 +159,10 @@ static DEVICE_START( exidy440_sound )
channel_frequency[3] = device->clock()/2;
/* get stream channels */
- stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock(), NULL, channel_update);
+ stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock(), NULL, channel_update);
/* allocate the sample cache */
- length = machine->region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
+ length = machine.region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
sound_cache = (sound_cache_entry *)auto_alloc_array(machine, UINT8, length);
/* determine the hard end of the cache and reset */
@@ -336,14 +336,14 @@ static STREAM_UPDATE( channel_update )
static READ8_HANDLER( sound_command_r )
{
/* clear the FIRQ that got us here and acknowledge the read to the main CPU */
- cputag_set_input_line(space->machine, "audiocpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 1, CLEAR_LINE);
sound_command_ack = 1;
return sound_command;
}
-void exidy440_sound_command(running_machine *machine, UINT8 param)
+void exidy440_sound_command(running_machine &machine, UINT8 param)
{
sound_command = param;
sound_command_ack = 0;
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( sound_volume_w )
static WRITE8_HANDLER( sound_interrupt_clear_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
@@ -584,7 +584,7 @@ static WRITE8_HANDLER( m6844_w )
m6844_channel[i].start_counter = m6844_channel[i].counter;
/* generate and play the sample */
- play_cvsd(space->machine, i);
+ play_cvsd(space->machine(), i);
}
/* if we're going inactive... */
@@ -655,7 +655,7 @@ static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits
}
-static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency)
+static INT16 *find_or_add_to_sound_cache(running_machine &machine, int address, int length, int bits, int frequency)
{
sound_cache_entry *current;
@@ -663,7 +663,7 @@ static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address,
if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency)
return current->data;
- return add_to_sound_cache(&machine->region("cvsd")->base()[address], address, length, bits, frequency);
+ return add_to_sound_cache(&machine.region("cvsd")->base()[address], address, length, bits, frequency);
}
@@ -674,7 +674,7 @@ static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address,
*
*************************************/
-static void play_cvsd(running_machine *machine, int ch)
+static void play_cvsd(running_machine &machine, int ch)
{
sound_channel_data *channel = &sound_channel[ch];
int address = m6844_channel[ch].address;
diff --git a/src/mame/audio/exidy440.h b/src/mame/audio/exidy440.h
index bee7f376d0b..15339153cb4 100644
--- a/src/mame/audio/exidy440.h
+++ b/src/mame/audio/exidy440.h
@@ -1,4 +1,4 @@
-void exidy440_sound_command(running_machine *machine, UINT8 param);
+void exidy440_sound_command(running_machine &machine, UINT8 param);
UINT8 exidy440_sound_command_ack(void);
MACHINE_CONFIG_EXTERN( exidy440_audio );
diff --git a/src/mame/audio/firetrk.c b/src/mame/audio/firetrk.c
index 88807617976..7703aae19f7 100644
--- a/src/mame/audio/firetrk.c
+++ b/src/mame/audio/firetrk.c
@@ -11,7 +11,7 @@
WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w )
{
- firetrk_state *state = device->machine->driver_data<firetrk_state>();
+ firetrk_state *state = device->machine().driver_data<firetrk_state>();
state->skid[0] = 0;
state->skid[1] = 0;
diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c
index d8f9f501a44..d744b934a52 100644
--- a/src/mame/audio/flower.c
+++ b/src/mame/audio/flower.c
@@ -68,7 +68,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -166,15 +166,15 @@ static STREAM_UPDATE( flower_update_mono )
static DEVICE_START( flower_sound )
{
flower_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
int i;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, 0, flower_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, 0, flower_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- state->mixer_buffer = auto_alloc_array(device->machine, short, 2 * samplerate);
+ state->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * samplerate);
state->mixer_buffer_2 = state->mixer_buffer + samplerate;
/* build the mixer table */
@@ -184,8 +184,8 @@ static DEVICE_START( flower_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom1 = machine->region("sound1")->base();
- state->sound_rom2 = machine->region("sound2")->base();
+ state->sound_rom1 = machine.region("sound1")->base();
+ state->sound_rom2 = machine.region("sound2")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c
index 41d1c966a67..5c1af8bd050 100644
--- a/src/mame/audio/geebee.c
+++ b/src/mame/audio/geebee.c
@@ -129,7 +129,7 @@ static STREAM_UPDATE( geebee_sound_update )
static DEVICE_START( geebee_sound )
{
geebee_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i;
state->decay = auto_alloc_array(machine, UINT16, 32768);
@@ -138,10 +138,10 @@ static DEVICE_START( geebee_sound )
state->decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
/* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
state->vcount = 0;
- state->volume_timer = machine->scheduler().timer_alloc(FUNC(volume_decay), state);
+ state->volume_timer = machine.scheduler().timer_alloc(FUNC(volume_decay), state);
}
DEVICE_GET_INFO( geebee_sound )
diff --git a/src/mame/audio/gomoku.c b/src/mame/audio/gomoku.c
index e72a239150a..83b30a3b163 100644
--- a/src/mame/audio/gomoku.c
+++ b/src/mame/audio/gomoku.c
@@ -69,7 +69,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -174,12 +174,12 @@ static STREAM_UPDATE( gomoku_update_mono )
static DEVICE_START( gomoku_sound )
{
gomoku_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
int ch;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, NULL, gomoku_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, NULL, gomoku_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
state->mixer_buffer = auto_alloc_array(machine, short, 2 * samplerate);
@@ -192,7 +192,7 @@ static DEVICE_START( gomoku_sound )
state->num_voices = MAX_VOICES;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom = machine->region("gomoku")->base();
+ state->sound_rom = machine.region("gomoku")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c
index 78c0d6b845a..ebee3d46b8d 100644
--- a/src/mame/audio/gorf.c
+++ b/src/mame/audio/gorf.c
@@ -116,7 +116,7 @@ static int plural = 0;
READ8_HANDLER( gorf_speech_r )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int Phoneme,Intonation;
int i = 0;
@@ -182,6 +182,6 @@ READ8_HANDLER( gorf_speech_r )
CUSTOM_INPUT( gorf_speech_status_r )
{
- device_t *samples = field->port->machine->device("samples");
+ device_t *samples = field->port->machine().device("samples");
return !sample_playing(samples, 0);
}
diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c
index ffc76c7e6ef..73a1a6bb696 100644
--- a/src/mame/audio/gottlieb.c
+++ b/src/mame/audio/gottlieb.c
@@ -43,7 +43,7 @@ static void trigger_sample(device_t *samples, UINT8 data);
WRITE8_HANDLER( gottlieb_sh_w )
{
- device_t *riot = space->machine->device("riot");
+ device_t *riot = space->machine().device("riot");
/* identify rev1 boards by the presence of a 6532 RIOT device */
if (riot != NULL)
@@ -62,7 +62,7 @@ WRITE8_HANDLER( gottlieb_sh_w )
static void gottlieb1_sh_w(device_t *riot, UINT8 data)
{
- device_t *samples = riot->machine->device("samples");
+ device_t *samples = riot->machine().device("samples");
int pa7 = (data & 0x0f) != 0xf;
int pa0_5 = ~data & 0x3f;
@@ -84,14 +84,14 @@ static void gottlieb1_sh_w(device_t *riot, UINT8 data)
static WRITE_LINE_DEVICE_HANDLER( snd_interrupt )
{
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, state);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, state);
}
static WRITE8_DEVICE_HANDLER( r6532_portb_w )
{
/* unsure if this is ever used, but the NMI is connected to the RIOT's PB7 */
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -131,9 +131,9 @@ static void play_sample(device_t *samples, const char *phonemes)
static void trigger_sample(device_t *samples, UINT8 data)
{
- gottlieb_state *state = samples->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = samples->machine().driver_data<gottlieb_state>();
/* Reactor samples */
- if (strcmp(samples->machine->system().name, "reactor") == 0)
+ if (strcmp(samples->machine().system().name, "reactor") == 0)
{
switch (data)
{
@@ -183,10 +183,10 @@ static void trigger_sample(device_t *samples, UINT8 data)
#ifdef UNUSED_FUNCTION
-void gottlieb_knocker(running_machine *machine)
+void gottlieb_knocker(running_machine &machine)
{
- device_t *samples = space->machine->device("samples");
- if (!strcmp(machine->system().name,"reactor")) /* reactor */
+ device_t *samples = space->machine().device("samples");
+ if (!strcmp(machine.system().name,"reactor")) /* reactor */
{
}
else if (samples != NULL) /* qbert */
@@ -211,7 +211,7 @@ static TIMER_CALLBACK( gottlieb_nmi_generate )
static WRITE8_HANDLER( vortrax_data_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
static const char *const PhonemeTable[0x40] =
{
"EH3", "EH2", "EH1", "PA0", "DT" , "A1" , "A2" , "ZH",
@@ -234,7 +234,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
{
if (state->votrax_queuepos > 1)
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int last = -1;
int i;
char phonemes[200];
@@ -262,12 +262,12 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
}
/* generate a NMI after a while to make the CPU continue to send data */
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(gottlieb_nmi_generate));
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(gottlieb_nmi_generate));
}
static WRITE8_HANDLER( speech_clock_dac_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
if (data != state->last)
mame_printf_debug("clock = %02X\n", data);
state->last = data;
@@ -282,7 +282,7 @@ state->last = data;
static SOUND_START( gottlieb1 )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->score_sample = 7;
state->random_offset = 0;
@@ -362,7 +362,7 @@ INPUT_PORTS_END
static void gottlieb2_sh_w(address_space *space, UINT8 data)
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* when data is not 0xff, the transparent latch at A3 allows it to pass through unmolested */
if (data != 0xff)
{
@@ -373,8 +373,8 @@ static void gottlieb2_sh_w(address_space *space, UINT8 data)
/* if the previous data was 0xff, clock an IRQ on each */
if (state->last_command == 0xff)
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
- cputag_set_input_line(space->machine, "speech", M6502_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "speech", M6502_IRQ_LINE, ASSERT_LINE);
}
}
state->last_command = data;
@@ -383,22 +383,22 @@ static void gottlieb2_sh_w(address_space *space, UINT8 data)
static READ8_HANDLER( speech_data_r )
{
- cputag_set_input_line(space->machine, "speech", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "speech", M6502_IRQ_LINE, CLEAR_LINE);
return soundlatch_r(space, offset);
}
static READ8_HANDLER( audio_data_r )
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
return soundlatch2_r(space, offset);
}
static WRITE8_HANDLER( signal_audio_nmi_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -409,17 +409,17 @@ static WRITE8_HANDLER( signal_audio_nmi_w )
*
*************************************/
-INLINE void nmi_timer_adjust(running_machine *machine)
+INLINE void nmi_timer_adjust(running_machine &machine)
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* adjust timer to go off in the future based on the current rate */
state->nmi_timer->adjust(attotime::from_hz(SOUND2_CLOCK/16) * (256 * (256 - state->nmi_rate)));
}
-INLINE void nmi_state_update(running_machine *machine)
+INLINE void nmi_state_update(running_machine &machine)
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* update the NMI line state based on the enable and state */
cputag_set_input_line(machine, "speech", INPUT_LINE_NMI, (state->nmi_state && (state->speech_control & 1)) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -427,7 +427,7 @@ INLINE void nmi_state_update(running_machine *machine)
static TIMER_CALLBACK( nmi_clear )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* clear the NMI state and update it */
state->nmi_state = 0;
nmi_state_update(machine);
@@ -436,13 +436,13 @@ static TIMER_CALLBACK( nmi_clear )
static TIMER_CALLBACK( nmi_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* assert the NMI if it is not disabled */
state->nmi_state = 1;
nmi_state_update(machine);
/* set a timer to turn it off again on hte next SOUND_CLOCK/16 */
- machine->scheduler().timer_set(attotime::from_hz(SOUND2_CLOCK/16), FUNC(nmi_clear));
+ machine.scheduler().timer_set(attotime::from_hz(SOUND2_CLOCK/16), FUNC(nmi_clear));
/* adjust the NMI timer for the next time */
nmi_timer_adjust(machine);
@@ -451,7 +451,7 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( nmi_rate_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* the new rate is picked up when the previous timer expires */
state->nmi_rate = data;
}
@@ -466,13 +466,13 @@ static WRITE8_HANDLER( nmi_rate_w )
static CUSTOM_INPUT( speech_drq_custom_r )
{
- return sp0250_drq_r(field->port->machine->device("spsnd"));
+ return sp0250_drq_r(field->port->machine().device("spsnd"));
}
static WRITE8_DEVICE_HANDLER( gottlieb_dac_w )
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
/* dual DAC; the first DAC serves as the reference voltage for the
second, effectively scaling the output */
state->dac_data[offset] = data;
@@ -482,12 +482,12 @@ static WRITE8_DEVICE_HANDLER( gottlieb_dac_w )
static WRITE8_HANDLER( speech_control_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
UINT8 previous = state->speech_control;
state->speech_control = data;
/* bit 0 enables/disables the NMI line */
- nmi_state_update(space->machine);
+ nmi_state_update(space->machine());
/* bit 1 controls a LED on the sound board */
@@ -496,7 +496,7 @@ static WRITE8_HANDLER( speech_control_w )
{
/* bit 3 selects which of the two 8913 to enable */
/* bit 4 goes to the 8913 BC1 pin */
- device_t *ay = space->machine->device((data & 0x08) ? "ay1" : "ay2");
+ device_t *ay = space->machine().device((data & 0x08) ? "ay1" : "ay2");
ay8910_data_address_w(ay, data >> 4, *state->psg_latch);
}
@@ -505,13 +505,13 @@ static WRITE8_HANDLER( speech_control_w )
/* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
if ((previous & 0x40) == 0 && (data & 0x40) != 0)
{
- device_t *sp = space->machine->device("spsnd");
+ device_t *sp = space->machine().device("spsnd");
sp0250_w(sp, 0, *state->sp0250_latch);
}
/* bit 7 goes to the speech chip RESET pin */
if ((previous ^ data) & 0x80)
- space->machine->device("spsnd")->reset();
+ space->machine().device("spsnd")->reset();
}
@@ -524,9 +524,9 @@ static WRITE8_HANDLER( speech_control_w )
static SOUND_START( gottlieb2 )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* set up the NMI timer */
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(nmi_callback));
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(nmi_callback));
state->nmi_rate = 0;
nmi_timer_adjust(machine);
diff --git a/src/mame/audio/gotya.c b/src/mame/audio/gotya.c
index 0504d69fc73..2577ade958e 100644
--- a/src/mame/audio/gotya.c
+++ b/src/mame/audio/gotya.c
@@ -41,7 +41,7 @@ static const struct gotya_sample gotya_samples[] =
WRITE8_HANDLER( gotya_soundlatch_w )
{
- gotya_state *state = space->machine->driver_data<gotya_state>();
+ gotya_state *state = space->machine().driver_data<gotya_state>();
int sample_number;
if (data == 0)
diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c
index 3bca6d87163..b13437475fb 100644
--- a/src/mame/audio/gridlee.c
+++ b/src/mame/audio/gridlee.c
@@ -69,14 +69,14 @@ static STREAM_UPDATE( gridlee_stream_update )
static DEVICE_START( gridlee_sound )
{
gridlee_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, machine->sample_rate(), NULL, gridlee_stream_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, machine.sample_rate(), NULL, gridlee_stream_update);
- state->samples = device->machine->device("samples");
+ state->samples = device->machine().device("samples");
- state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
+ state->freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
}
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 620b2d7ab0f..650829cda4e 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -21,11 +21,11 @@
*
*************************************/
-void hdsnd_init(running_machine *machine)
+void hdsnd_init(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- state->rombase = (UINT8 *)machine->region("serialroms")->base();
- state->romsize = machine->region("serialroms")->bytes();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ state->rombase = (UINT8 *)machine.region("serialroms")->base();
+ state->romsize = machine.region("serialroms")->bytes();
}
@@ -36,9 +36,9 @@ void hdsnd_init(running_machine *machine)
*
*************************************/
-static void update_68k_interrupts(running_machine *machine)
+static void update_68k_interrupts(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
device_set_input_line(state->soundcpu, 1, state->mainflag ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->soundcpu, 3, state->irq68k ? ASSERT_LINE : CLEAR_LINE);
}
@@ -53,7 +53,7 @@ static void update_68k_interrupts(running_machine *machine)
READ16_HANDLER( hd68k_snd_data_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->soundflag = 0;
logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(space->cpu), state->sounddata);
return state->sounddata;
@@ -62,14 +62,14 @@ READ16_HANDLER( hd68k_snd_data_r )
READ16_HANDLER( hd68k_snd_status_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return (state->mainflag << 15) | (state->soundflag << 14) | 0x1fff;
}
static TIMER_CALLBACK( delayed_68k_w )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
state->maindata = param;
state->mainflag = 1;
update_68k_interrupts(machine);
@@ -78,18 +78,18 @@ static TIMER_CALLBACK( delayed_68k_w )
WRITE16_HANDLER( hd68k_snd_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_68k_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_68k_w), data);
logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(space->cpu), data);
}
WRITE16_HANDLER( hd68k_snd_reset_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
state->mainflag = state->soundflag = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
logerror("%06X:Reset sound\n", cpu_get_previouspc(space->cpu));
}
@@ -103,9 +103,9 @@ WRITE16_HANDLER( hd68k_snd_reset_w )
READ16_HANDLER( hdsnd68k_data_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->mainflag = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(space->cpu), state->maindata);
return state->maindata;
}
@@ -113,7 +113,7 @@ READ16_HANDLER( hdsnd68k_data_r )
WRITE16_HANDLER( hdsnd68k_data_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddata);
state->soundflag = 1;
logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(space->cpu), data);
@@ -148,9 +148,9 @@ READ16_HANDLER( hdsnd68k_status_r )
// D14 = 'Sound Flag'
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(space->cpu), offset);
- return (state->mainflag << 15) | (state->soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine, "IN0") & 0x0020) << 8) | 0;
+ return (state->mainflag << 15) | (state->soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine(), "IN0") & 0x0020) << 8) | 0;
}
@@ -163,7 +163,7 @@ READ16_HANDLER( hdsnd68k_status_r )
WRITE16_HANDLER( hdsnd68k_latches_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
data = (offset >> 3) & 1;
@@ -212,9 +212,9 @@ WRITE16_HANDLER( hdsnd68k_speech_w )
WRITE16_HANDLER( hdsnd68k_irqclr_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->irq68k = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
}
@@ -227,21 +227,21 @@ WRITE16_HANDLER( hdsnd68k_irqclr_w )
READ16_HANDLER( hdsnd68k_320ram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->sounddsp_ram[offset & 0xfff];
}
WRITE16_HANDLER( hdsnd68k_320ram_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddsp_ram[offset & 0xfff]);
}
READ16_HANDLER( hdsnd68k_320ports_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
address_space *iospace = state->sounddsp->memory().space(AS_IO);
return iospace->read_word((offset & 7) << 1);
}
@@ -249,7 +249,7 @@ READ16_HANDLER( hdsnd68k_320ports_r )
WRITE16_HANDLER( hdsnd68k_320ports_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
address_space *iospace = state->sounddsp->memory().space(AS_IO);
iospace->write_word((offset & 7) << 1, data);
}
@@ -257,7 +257,7 @@ WRITE16_HANDLER( hdsnd68k_320ports_w )
READ16_HANDLER( hdsnd68k_320com_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->cramen)
return state->comram[offset & 0x1ff];
@@ -269,7 +269,7 @@ READ16_HANDLER( hdsnd68k_320com_r )
WRITE16_HANDLER( hdsnd68k_320com_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->cramen)
COMBINE_DATA(&state->comram[offset & 0x1ff]);
@@ -287,7 +287,7 @@ WRITE16_HANDLER( hdsnd68k_320com_w )
READ16_HANDLER( hdsnddsp_get_bio )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT64 cycles_since_last_bio = state->sounddsp->total_cycles() - state->last_bio_cycles;
INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio;
@@ -312,7 +312,7 @@ READ16_HANDLER( hdsnddsp_get_bio )
WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
{
- harddriv_state *state = device->machine->driver_data<harddriv_state>();
+ harddriv_state *state = device->machine().driver_data<harddriv_state>();
/* DAC L */
if (!state->dacmute)
@@ -338,15 +338,15 @@ WRITE16_HANDLER( hdsnddsp_mute_w )
WRITE16_HANDLER( hdsnddsp_gen68kirq_w )
{
/* generate 68k IRQ */
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->irq68k = 1;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
}
WRITE16_HANDLER( hdsnddsp_soundaddr_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (offset == 0)
{
/* select sound ROM block */
@@ -362,7 +362,7 @@ WRITE16_HANDLER( hdsnddsp_soundaddr_w )
READ16_HANDLER( hdsnddsp_rom_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->sound_rom_offs < state->romsize)
return state->rombase[state->sound_rom_offs++] << 7;
state->sound_rom_offs++;
@@ -372,7 +372,7 @@ READ16_HANDLER( hdsnddsp_rom_r )
READ16_HANDLER( hdsnddsp_comram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->comram[state->sound_rom_offs++ & 0x1ff];
}
diff --git a/src/mame/audio/hyprolyb.c b/src/mame/audio/hyprolyb.c
index 62c49a2b79b..88948ff6fe4 100644
--- a/src/mame/audio/hyprolyb.c
+++ b/src/mame/audio/hyprolyb.c
@@ -25,8 +25,8 @@ static DEVICE_START( hyprolyb_adpcm )
{
hyprolyb_adpcm_state *state = get_safe_token(device);
- state->space = device->machine->device("audiocpu")->memory().space(AS_PROGRAM);
- state->msm = device->machine->device("msm");
+ state->space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ state->msm = device->machine().device("msm");
device->save_item(NAME(state->adpcm_ready)); // only bootlegs
device->save_item(NAME(state->adpcm_busy));
device->save_item(NAME(state->vck_ready));
@@ -113,7 +113,7 @@ ADDRESS_MAP_END
static void adpcm_vck_callback( device_t *device )
{
- device_t *adpcm = device->machine->device("hyprolyb_adpcm");
+ device_t *adpcm = device->machine().device("hyprolyb_adpcm");
hyprolyb_adpcm_state *state = get_safe_token(adpcm);
state->vck_ready = 0x80;
diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c
index 568daf8a91f..bb80fdfed69 100644
--- a/src/mame/audio/invinco.c
+++ b/src/mame/audio/invinco.c
@@ -66,7 +66,7 @@ enum
WRITE8_HANDLER( invinco_audio_w )
{
static int port2State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index 9ab3bd6d02a..923aa4e6ccb 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -41,12 +41,12 @@ INLINE irem_audio_state *get_safe_token( device_t *device )
static DEVICE_START( irem_audio )
{
irem_audio_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
- state->adpcm1 = machine->device("msm1");
- state->adpcm2 = machine->device("msm2");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ state->adpcm1 = machine.device("msm1");
+ state->adpcm2 = machine.device("msm2");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
device->save_item(NAME(state->port1));
device->save_item(NAME(state->port2));
@@ -66,7 +66,7 @@ WRITE8_HANDLER( irem_sound_cmd_w )
if ((data & 0x80) == 0)
soundlatch_w(space, 0, data & 0x7f);
else
- cputag_set_input_line(space->machine, "iremsound", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "iremsound", 0, ASSERT_LINE);
}
@@ -180,7 +180,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_1_porta_w )
static WRITE8_HANDLER( sound_irq_ack_w )
{
- cputag_set_input_line(space->machine, "iremsound", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "iremsound", 0, CLEAR_LINE);
}
@@ -219,9 +219,9 @@ static WRITE8_DEVICE_HANDLER( m62_adpcm_w )
static void adpcm_int(device_t *device)
{
- device_t *adpcm2 = device->machine->device("msm2");
+ device_t *adpcm2 = device->machine().device("msm2");
- cputag_set_input_line(device->machine, "iremsound", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "iremsound", INPUT_LINE_NMI, PULSE_LINE);
/* the first MSM5205 clocks the second */
if (adpcm2 != NULL)
diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c
index 9f70fd88a42..7d5e406b565 100644
--- a/src/mame/audio/jaguar.c
+++ b/src/mame/audio/jaguar.c
@@ -181,15 +181,15 @@ static WRITE32_HANDLER( dsp_flags_w );
*
*************************************/
-void jaguar_dsp_suspend(running_machine *machine)
+void jaguar_dsp_suspend(running_machine &machine)
{
- machine->device<cpu_device>("audiocpu")->suspend(SUSPEND_REASON_SPIN, 1);
+ machine.device<cpu_device>("audiocpu")->suspend(SUSPEND_REASON_SPIN, 1);
}
-void jaguar_dsp_resume(running_machine *machine)
+void jaguar_dsp_resume(running_machine &machine)
{
- machine->device<cpu_device>("audiocpu")->resume(SUSPEND_REASON_SPIN);
+ machine.device<cpu_device>("audiocpu")->resume(SUSPEND_REASON_SPIN);
}
@@ -200,7 +200,7 @@ void jaguar_dsp_resume(running_machine *machine)
*
*************************************/
-static void update_gpu_irq(running_machine *machine)
+static void update_gpu_irq(running_machine &machine)
{
if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f)
{
@@ -218,7 +218,7 @@ void jaguar_external_int(device_t *device, int state)
gpu_irq_state |= 1;
else
gpu_irq_state &= ~1;
- update_gpu_irq(device->machine);
+ update_gpu_irq(device->machine());
}
@@ -229,7 +229,7 @@ void jaguar_external_int(device_t *device, int state)
*
*************************************/
-void cojag_sound_init(running_machine *machine)
+void cojag_sound_init(running_machine &machine)
{
int i;
@@ -252,17 +252,17 @@ void cojag_sound_init(running_machine *machine)
jaguar_wave_rom[0x200 + i] = (int)(32767. * sin(2.0 * M_PI * (double)i / (double)0x80));
/* F1DA00 = traingle wave with noise */
- jaguar_wave_rom[0x280 + i] = jaguar_wave_rom[0x000 + i] * (machine->rand() % 32768) / 32768;
+ jaguar_wave_rom[0x280 + i] = jaguar_wave_rom[0x000 + i] * (machine.rand() % 32768) / 32768;
/* F1DC00 = spike */
jaguar_wave_rom[0x300 + i] = (i == 0x40) ? 32767 : 0;
/* F1DE00 = white noise */
- jaguar_wave_rom[0x380 + i] = machine->rand() % 32768;
+ jaguar_wave_rom[0x380 + i] = machine.rand() % 32768;
}
#if ENABLE_SPEEDUP_HACKS
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
#endif
}
@@ -299,7 +299,7 @@ WRITE16_HANDLER( jaguar_jerry_regs_w )
{
case JINTCTRL:
gpu_irq_state &= ~(dsp_regs[JINTCTRL] >> 8);
- update_gpu_irq(space->machine);
+ update_gpu_irq(space->machine());
break;
}
@@ -339,18 +339,18 @@ WRITE32_HANDLER( jaguar_jerry_regs32_w )
static WRITE32_HANDLER( dsp_flags_w )
{
/* write the data through */
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
/* if they were clearing the A2S interrupt, see if we are headed for the spin */
/* loop with R22 != 0; if we are, just start spinning again */
- if (space->cpu == space->machine->device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
+ if (space->cpu == space->machine().device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
{
/* see if we're going back to the spin loop */
if (!(data & 0x04000) && cpu_get_reg(space->cpu, JAGUAR_R22) != 0)
{
UINT32 r30 = cpu_get_reg(space->cpu, JAGUAR_R30) & 0xffffff;
if (r30 >= 0xf1b124 && r30 <= 0xf1b126)
- jaguar_dsp_suspend(space->machine);
+ jaguar_dsp_suspend(space->machine());
}
}
}
@@ -370,8 +370,8 @@ static WRITE32_HANDLER( dsp_flags_w )
TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
{
/* assert the A2S IRQ on CPU #2 (DSP) */
- cputag_set_input_line(timer.machine, "audiocpu", 1, ASSERT_LINE);
- jaguar_dsp_resume(timer.machine);
+ cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
+ jaguar_dsp_resume(timer.machine());
/* fix flaky code in interrupt handler which thwarts our speedup */
if ((jaguar_dsp_ram[0x3e/4] & 0xffff) == 0xbfbc &&
@@ -389,8 +389,8 @@ TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
{
/* assert the A2S IRQ on CPU #2 (DSP) */
- cputag_set_input_line(timer.machine, "audiocpu", 1, ASSERT_LINE);
- jaguar_dsp_resume(timer.machine);
+ cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
+ jaguar_dsp_resume(timer.machine());
}
#endif
@@ -416,12 +416,12 @@ WRITE32_HANDLER( jaguar_serial_w )
{
/* right DAC */
case 2:
- dac_signed_data_16_w(space->machine->device("dac2"), (data & 0xffff) ^ 0x8000);
+ dac_signed_data_16_w(space->machine().device("dac2"), (data & 0xffff) ^ 0x8000);
break;
/* left DAC */
case 3:
- dac_signed_data_16_w(space->machine->device("dac1"), (data & 0xffff) ^ 0x8000);
+ dac_signed_data_16_w(space->machine().device("dac1"), (data & 0xffff) ^ 0x8000);
break;
/* frequency register */
@@ -436,7 +436,7 @@ WRITE32_HANDLER( jaguar_serial_w )
if ((data & 0x3f) == 0x15)
{
attotime rate = attotime::from_hz(26000000) * (32 * 2 * (serial_frequency + 1));
- timer_device *serial_timer = space->machine->device<timer_device>("serial_timer");
+ timer_device *serial_timer = space->machine().device<timer_device>("serial_timer");
serial_timer->adjust(rate, 0, rate);
}
break;
diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c
index 5aba809acd9..dd40be19e47 100644
--- a/src/mame/audio/jedi.c
+++ b/src/mame/audio/jedi.c
@@ -22,7 +22,7 @@
static SOUND_START( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* set up save state */
state->save_item(NAME(state->audio_latch));
@@ -40,7 +40,7 @@ static SOUND_START( jedi )
static SOUND_RESET( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* init globals */
state->audio_latch = 0;
@@ -60,7 +60,7 @@ static SOUND_RESET( jedi )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
}
@@ -73,13 +73,13 @@ static WRITE8_HANDLER( irq_ack_w )
WRITE8_HANDLER( jedi_audio_reset_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
static TIMER_CALLBACK( delayed_audio_latch_w )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
state->audio_latch = param;
*state->audio_comm_stat |= 0x80;
@@ -88,13 +88,13 @@ static TIMER_CALLBACK( delayed_audio_latch_w )
WRITE8_HANDLER( jedi_audio_latch_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_audio_latch_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_audio_latch_w), data);
}
static READ8_HANDLER( audio_latch_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x80;
return state->audio_latch;
@@ -103,7 +103,7 @@ static READ8_HANDLER( audio_latch_r )
CUSTOM_INPUT( jedi_audio_comm_stat_r )
{
- jedi_state *state = field->port->machine->driver_data<jedi_state>();
+ jedi_state *state = field->port->machine().driver_data<jedi_state>();
return *state->audio_comm_stat >> 6;
}
@@ -117,7 +117,7 @@ CUSTOM_INPUT( jedi_audio_comm_stat_r )
READ8_HANDLER( jedi_audio_ack_latch_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x40;
return state->audio_ack_latch;
@@ -126,7 +126,7 @@ READ8_HANDLER( jedi_audio_ack_latch_r )
static WRITE8_HANDLER( audio_ack_latch_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->audio_ack_latch = data;
*state->audio_comm_stat |= 0x40;
@@ -142,12 +142,12 @@ static WRITE8_HANDLER( audio_ack_latch_w )
static WRITE8_HANDLER( speech_strobe_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
int new_speech_strobe_state = (~offset >> 8) & 1;
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
{
- device_t *tms = space->machine->device("tms");
+ device_t *tms = space->machine().device("tms");
tms5220_data_w(tms, 0, *state->speech_data);
}
state->speech_strobe_state = new_speech_strobe_state;
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( speech_strobe_w )
static READ8_HANDLER( speech_ready_r )
{
- return (tms5220_readyq_r(space->machine->device("tms"))) << 7;
+ return (tms5220_readyq_r(space->machine().device("tms"))) << 7;
}
diff --git a/src/mame/audio/laserbat.c b/src/mame/audio/laserbat.c
index b6761b9824f..1c05d5b92b0 100644
--- a/src/mame/audio/laserbat.c
+++ b/src/mame/audio/laserbat.c
@@ -5,13 +5,13 @@
WRITE8_HANDLER( laserbat_csound1_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->csound1 = data;
}
WRITE8_HANDLER( laserbat_csound2_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
int ksound = 0;
if (data & 0x01)
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index e77eb0cd8d5..00c37d1d0ad 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -271,11 +271,11 @@ static DEVICE_START( leland_sound )
state->dac_bufout[0] = state->dac_bufout[1] = 0;
/* allocate the stream */
- state->dac_stream = device->machine->sound().stream_alloc(*device, 0, 1, 256*60, NULL, leland_update);
+ state->dac_stream = device->machine().sound().stream_alloc(*device, 0, 1, 256*60, NULL, leland_update);
/* allocate memory */
- state->dac_buffer[0] = auto_alloc_array(device->machine, UINT8, DAC_BUFFER_SIZE);
- state->dac_buffer[1] = auto_alloc_array(device->machine, UINT8, DAC_BUFFER_SIZE);
+ state->dac_buffer[0] = auto_alloc_array(device->machine(), UINT8, DAC_BUFFER_SIZE);
+ state->dac_buffer[1] = auto_alloc_array(device->machine(), UINT8, DAC_BUFFER_SIZE);
}
@@ -537,37 +537,37 @@ static TIMER_CALLBACK( dma_timer_callback );
static DEVICE_START( common_sh_start )
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
- address_space *dmaspace = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ running_machine &machine = device->machine();
+ address_space *dmaspace = machine.device("audiocpu")->memory().space(AS_PROGRAM);
int i;
/* determine which sound hardware is installed */
- state->has_ym2151 = (device->machine->device("ymsnd") != NULL);
+ state->has_ym2151 = (device->machine().device("ymsnd") != NULL);
/* allocate separate streams for the DMA and non-DMA DACs */
- state->dma_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
- state->nondma_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update);
+ state->dma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
+ state->nondma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update);
/* if we have a 2151, install an externally driven DAC stream */
if (state->has_ym2151)
{
- state->ext_base = machine->region("dac")->base();
- state->extern_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
+ state->ext_base = machine.region("dac")->base();
+ state->extern_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
}
/* create timers here so they stick around */
state->i80186.cpu = dmaspace->cpu;
- state->i80186.timer[0].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[1].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[2].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[0].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.timer[1].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.timer[2].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.dma[0].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device);
- state->i80186.dma[1].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device);
+ state->i80186.timer[0].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[1].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[2].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[0].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.timer[1].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.timer[2].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.dma[0].finish_timer = machine.scheduler().timer_alloc(FUNC(dma_timer_callback), device);
+ state->i80186.dma[1].finish_timer = machine.scheduler().timer_alloc(FUNC(dma_timer_callback), device);
for (i = 0; i < 9; i++)
- state->counter[i].timer = machine->scheduler().timer_alloc(FUNC(NULL));
+ state->counter[i].timer = machine.scheduler().timer_alloc(FUNC(NULL));
}
static DEVICE_START( leland_80186_sound )
@@ -693,8 +693,8 @@ static DEVICE_RESET( leland_80186_sound )
static IRQ_CALLBACK( int_callback )
{
- leland_sound_state *state = get_safe_token(device->machine->device("custom"));
- if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine->time().as_double(), state->i80186.intr.poll_status & 0x1f);
+ leland_sound_state *state = get_safe_token(device->machine().device("custom"));
+ if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine().time().as_double(), state->i80186.intr.poll_status & 0x1f);
/* clear the interrupt */
device_set_input_line(state->i80186.cpu, 0, CLEAR_LINE);
@@ -729,7 +729,7 @@ static IRQ_CALLBACK( int_callback )
static void update_interrupt_state(device_t *device)
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j, new_vector = 0;
if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", state->i80186.intr.request, state->i80186.intr.status, state->i80186.intr.in_service);
@@ -809,14 +809,14 @@ generate_int:
if (!state->i80186.intr.pending)
cputag_set_input_line(machine, "audiocpu", 0, ASSERT_LINE);
state->i80186.intr.pending = 1;
- if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine->time().as_double(), new_vector);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine.time().as_double(), new_vector);
}
static void handle_eoi(device_t *device, int data)
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j;
/* specific case */
@@ -834,9 +834,9 @@ static void handle_eoi(device_t *device, int data)
case 0x0d: state->i80186.intr.in_service &= ~0x20; break;
case 0x0e: state->i80186.intr.in_service &= ~0x40; break;
case 0x0f: state->i80186.intr.in_service &= ~0x80; break;
- default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", machine->describe_context(), data & 0x1f);
+ default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", machine.describe_context(), data & 0x1f);
}
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", machine->time().as_double(), data & 0x1f);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", machine.time().as_double(), data & 0x1f);
}
/* non-specific case */
@@ -849,7 +849,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.timer & 7) == i && (state->i80186.intr.in_service & 0x01))
{
state->i80186.intr.in_service &= ~0x01;
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", machine->time().as_double());
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", machine.time().as_double());
return;
}
@@ -858,7 +858,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.dma[j] & 7) == i && (state->i80186.intr.in_service & (0x04 << j)))
{
state->i80186.intr.in_service &= ~(0x04 << j);
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", machine->time().as_double(), j);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", machine.time().as_double(), j);
return;
}
@@ -867,7 +867,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.ext[j] & 7) == i && (state->i80186.intr.in_service & (0x10 << j)))
{
state->i80186.intr.in_service &= ~(0x10 << j);
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", machine->time().as_double(), j);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", machine.time().as_double(), j);
return;
}
}
@@ -1759,14 +1759,14 @@ WRITE8_DEVICE_HANDLER( leland_80186_control_w )
}
/* /RESET */
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
/* /NMI */
/* If the master CPU doesn't get a response by the time it's ready to send
the next command, it uses an NMI to force the issue; unfortunately, this
seems to really screw up the sound system. It turns out it's better to
just wait for the original interrupt to occur naturally */
-/* cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
+/* cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
/* INT0 */
if (data & 0x20)
@@ -1807,14 +1807,14 @@ static TIMER_CALLBACK( command_lo_sync )
{
device_t *device = (device_t *)ptr;
leland_sound_state *state = get_safe_token(device);
- if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", machine->describe_context(), param);
+ if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", machine.describe_context(), param);
state->sound_command = (state->sound_command & 0xff00) | param;
}
WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w )
{
- device->machine->scheduler().synchronize(FUNC(command_lo_sync), data, device);
+ device->machine().scheduler().synchronize(FUNC(command_lo_sync), data, device);
}
@@ -1846,7 +1846,7 @@ static TIMER_CALLBACK( delayed_response_r )
{
device_t *device = (device_t *)ptr;
leland_sound_state *state = get_safe_token(device);
- cpu_device *master = machine->device<cpu_device>("master");
+ cpu_device *master = machine.device<cpu_device>("master");
int checkpc = param;
int pc = master->pc();
int oldaf = master->state(Z80_AF);
@@ -1877,7 +1877,7 @@ READ8_DEVICE_HANDLER( leland_80186_response_r )
if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, state->sound_response);
/* synchronize the response */
- device->machine->scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
+ device->machine().scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
return state->sound_response;
}
@@ -2124,7 +2124,7 @@ static READ16_DEVICE_HANDLER( peripheral_r )
if (!state->has_ym2151)
return pit8254_r(device, offset | 0x40, mem_mask);
else
- return ym2151_r(device->machine->device("ymsnd"), offset);
+ return ym2151_r(device->machine().device("ymsnd"), offset);
case 4:
if (state->is_redline)
@@ -2161,7 +2161,7 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
if (!state->has_ym2151)
pit8254_w(device, offset | 0x40, data, mem_mask);
else
- ym2151_w(device->machine->device("ymsnd"), offset, data);
+ ym2151_w(device->machine().device("ymsnd"), offset, data);
break;
case 4:
diff --git a/src/mame/audio/m72.c b/src/mame/audio/m72.c
index 0f9981c569e..0fbe57ff755 100644
--- a/src/mame/audio/m72.c
+++ b/src/mame/audio/m72.c
@@ -118,9 +118,9 @@ SOUND_RESET( m72 )
void m72_ym2151_irq_handler(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
WRITE16_HANDLER( m72_sound_command_w )
@@ -128,19 +128,19 @@ WRITE16_HANDLER( m72_sound_command_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space,offset,data);
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
}
}
WRITE8_HANDLER( m72_sound_command_byte_w )
{
soundlatch_w(space,offset,data);
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
}
WRITE8_HANDLER( m72_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR);
}
@@ -200,11 +200,11 @@ WRITE8_HANDLER( poundfor_sample_addr_w )
READ8_HANDLER( m72_sample_r )
{
- return space->machine->region("samples")->base()[sample_addr];
+ return space->machine().region("samples")->base()[sample_addr];
}
WRITE8_DEVICE_HANDLER( m72_sample_w )
{
dac_signed_data_w(device, data);
- sample_addr = (sample_addr + 1) & (device->machine->region("samples")->bytes() - 1);
+ sample_addr = (sample_addr + 1) & (device->machine().region("samples")->bytes() - 1);
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index cdf729c2567..0317914161d 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -398,11 +398,11 @@ DISCRETE_SOUND_END
static void set_ea(address_space *space, int ea)
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
//printf("ea: %d\n", ea);
//cputag_set_input_line(machine, "audiocpu", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
if (state->eabank != NULL)
- memory_set_bank(space->machine, state->eabank, ea);
+ memory_set_bank(space->machine(), state->eabank, ea);
}
/****************************************************************
@@ -413,10 +413,10 @@ static void set_ea(address_space *space, int ea)
static SOUND_START( mario )
{
- mario_state *state = machine->driver_data<mario_state>();
- device_t *audiocpu = machine->device("audiocpu");
+ mario_state *state = machine.driver_data<mario_state>();
+ device_t *audiocpu = machine.device("audiocpu");
#if USE_8039
- UINT8 *SND = machine->region("audiocpu")->base();
+ UINT8 *SND = machine.region("audiocpu")->base();
SND[0x1001] = 0x01;
#endif
@@ -426,8 +426,8 @@ static SOUND_START( mario )
{
state->eabank = "bank1";
audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("audiocpu")->base() + 0x1000, 0x800);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("audiocpu")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("audiocpu")->base() + 0x1000, 0x800);
}
state->save_item(NAME(state->last));
@@ -436,8 +436,8 @@ static SOUND_START( mario )
static SOUND_RESET( mario )
{
- mario_state *state = machine->driver_data<mario_state>();
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ mario_state *state = machine.driver_data<mario_state>();
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
#if USE_8039
set_ea(machine, 1);
@@ -482,8 +482,8 @@ static READ8_HANDLER( mario_sh_t1_r )
static READ8_HANDLER( mario_sh_tune_r )
{
- UINT8 *SND = space->machine->region("audiocpu")->base();
- UINT16 mask = space->machine->region("audiocpu")->bytes()-1;
+ UINT8 *SND = space->machine().region("audiocpu")->base();
+ UINT16 mask = space->machine().region("audiocpu")->bytes()-1;
UINT8 p2 = I8035_P2_R(space);
if ((p2 >> 7) & 1)
@@ -515,12 +515,12 @@ static WRITE8_HANDLER( mario_sh_p2_w )
WRITE8_HANDLER( masao_sh_irqtrigger_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
if (state->last == 1 && data == 0)
{
/* setting bit 0 high then low triggers IRQ on the sound CPU */
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
}
state->last = data;
@@ -548,15 +548,15 @@ WRITE8_DEVICE_HANDLER( mario_sh2_w )
/* Misc samples */
WRITE8_HANDLER( mario_sh3_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
switch (offset)
{
case 0: /* death */
if (data)
- cputag_set_input_line(space->machine, "audiocpu",0,ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu",0,ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu",0,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu",0,CLEAR_LINE);
break;
case 1: /* get coin */
I8035_T_W_AH(space, 0,data & 1);
@@ -577,7 +577,7 @@ WRITE8_HANDLER( mario_sh3_w )
I8035_P1_W_AH(space, 3, data & 1);
break;
case 7: /* skid */
- discrete_sound_w(space->machine->device("discrete"), DS_SOUND7_INP, data & 1);
+ discrete_sound_w(space->machine().device("discrete"), DS_SOUND7_INP, data & 1);
break;
}
}
diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c
index 424bb6cf7dc..095c11ee698 100644
--- a/src/mame/audio/mcr.c
+++ b/src/mame/audio/mcr.c
@@ -91,7 +91,7 @@ static UINT8 squawkntalk_tms_strobes;
*
*************************************/
-static void ssio_compute_ay8910_modulation(running_machine *machine);
+static void ssio_compute_ay8910_modulation(running_machine &machine);
@@ -101,14 +101,14 @@ static void ssio_compute_ay8910_modulation(running_machine *machine);
*
*************************************/
-void mcr_sound_init(running_machine *machine, UINT8 config)
+void mcr_sound_init(running_machine &machine, UINT8 config)
{
mcr_sound_config = config;
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
- ssio_sound_cpu = machine->device("ssiocpu");
+ ssio_sound_cpu = machine.device("ssiocpu");
ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
@@ -121,28 +121,28 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
- turbocs_sound_cpu = machine->device("tcscpu");
+ turbocs_sound_cpu = machine.device("tcscpu");
state_save_register_global(machine, turbocs_status);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
- csdeluxe_sound_cpu = machine->device("csdcpu");
+ csdeluxe_sound_cpu = machine.device("csdcpu");
state_save_register_global(machine, csdeluxe_status);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
- soundsgood_sound_cpu = machine->device("sgcpu");
+ soundsgood_sound_cpu = machine.device("sgcpu");
state_save_register_global(machine, soundsgood_status);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
- squawkntalk_sound_cpu = machine->device("sntcpu");
+ squawkntalk_sound_cpu = machine.device("sntcpu");
state_save_register_global(machine, squawkntalk_tms_command);
state_save_register_global(machine, squawkntalk_tms_strobes);
}
@@ -153,7 +153,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
}
-void mcr_sound_reset(running_machine *machine)
+void mcr_sound_reset(running_machine &machine)
{
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
@@ -240,9 +240,9 @@ void mcr_sound_reset(running_machine *machine)
frequency of sound output. So we simply apply a volume
adjustment to each voice according to the duty cycle.
*/
-static void ssio_compute_ay8910_modulation(running_machine *machine)
+static void ssio_compute_ay8910_modulation(running_machine &machine)
{
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
int volval;
/* loop over all possible values of the duty cycle */
@@ -314,10 +314,10 @@ static TIMER_CALLBACK( ssio_delayed_data_w )
ssio_data[param >> 8] = param & 0xff;
}
-static void ssio_update_volumes(running_machine *machine)
+static void ssio_update_volumes(running_machine &machine)
{
- device_t *ay0 = machine->device("ssio.1");
- device_t *ay1 = machine->device("ssio.2");
+ device_t *ay0 = machine.device("ssio.1");
+ device_t *ay1 = machine.device("ssio.2");
ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]);
ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]);
ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]);
@@ -330,21 +330,21 @@ static WRITE8_DEVICE_HANDLER( ssio_porta0_w )
{
ssio_duty_cycle[0][0] = data & 15;
ssio_duty_cycle[0][1] = data >> 4;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_portb0_w )
{
ssio_duty_cycle[0][2] = data & 15;
ssio_overall[0] = (data >> 4) & 7;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_porta1_w )
{
ssio_duty_cycle[1][0] = data & 15;
ssio_duty_cycle[1][1] = data >> 4;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_portb1_w )
@@ -352,13 +352,13 @@ static WRITE8_DEVICE_HANDLER( ssio_portb1_w )
ssio_duty_cycle[1][2] = data & 15;
ssio_overall[1] = (data >> 4) & 7;
ssio_mute = data & 0x80;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
/********* external interfaces ***********/
WRITE8_HANDLER( ssio_data_w )
{
- space->machine->scheduler().synchronize(FUNC(ssio_delayed_data_w), (offset << 8) | (data & 0xff));
+ space->machine().scheduler().synchronize(FUNC(ssio_delayed_data_w), (offset << 8) | (data & 0xff));
}
READ8_HANDLER( ssio_status_r )
@@ -366,7 +366,7 @@ READ8_HANDLER( ssio_status_r )
return ssio_status;
}
-void ssio_reset_w(running_machine *machine, int state)
+void ssio_reset_w(running_machine &machine, int state)
{
/* going high halts the CPU */
if (state)
@@ -389,7 +389,7 @@ void ssio_reset_w(running_machine *machine, int state)
READ8_HANDLER( ssio_input_port_r )
{
static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" };
- UINT8 result = input_port_read_safe(space->machine, port[offset], 0xff);
+ UINT8 result = input_port_read_safe(space->machine(), port[offset], 0xff);
if (ssio_custom_input[offset])
result = (result & ~ssio_custom_input_mask[offset]) |
((*ssio_custom_input[offset])(space, offset) & ssio_custom_input_mask[offset]);
@@ -491,7 +491,7 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("csddac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
@@ -499,7 +499,7 @@ static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("csddac"), dacval << 6);
if (~z_mask & 0x10) csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2);
@@ -514,14 +514,14 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq )
static TIMER_CALLBACK( csdeluxe_delayed_data_w )
{
- device_t *pia = machine->device("csdpia");
+ device_t *pia = machine.device("csdpia");
pia6821_portb_w(pia, 0, param & 0x0f);
pia6821_ca1_w(pia, ~param & 0x10);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static READ16_DEVICE_HANDLER( csdeluxe_pia_r )
@@ -548,7 +548,7 @@ static WRITE16_DEVICE_HANDLER( csdeluxe_pia_w )
/********* external interfaces ***********/
WRITE8_HANDLER( csdeluxe_data_w )
{
- space->machine->scheduler().synchronize(FUNC(csdeluxe_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(csdeluxe_delayed_data_w), data);
}
READ8_HANDLER( csdeluxe_status_r )
@@ -556,7 +556,7 @@ READ8_HANDLER( csdeluxe_status_r )
return csdeluxe_status;
}
-void csdeluxe_reset_w(running_machine *machine, int state)
+void csdeluxe_reset_w(running_machine &machine, int state)
{
device_set_input_line(csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -629,7 +629,7 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( soundsgood_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("sgdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
@@ -637,7 +637,7 @@ static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("sgdac"), dacval << 6);
if (~z_mask & 0x10) soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2);
@@ -652,21 +652,21 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq )
static TIMER_CALLBACK( soundsgood_delayed_data_w )
{
- device_t *pia = machine->device("sgpia");
+ device_t *pia = machine.device("sgpia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, ~param & 0x01);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
}
/********* external interfaces ***********/
WRITE8_HANDLER( soundsgood_data_w )
{
- space->machine->scheduler().synchronize(FUNC(soundsgood_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(soundsgood_delayed_data_w), data);
}
READ8_HANDLER( soundsgood_status_r )
@@ -674,7 +674,7 @@ READ8_HANDLER( soundsgood_status_r )
return soundsgood_status;
}
-void soundsgood_reset_w(running_machine *machine, int state)
+void soundsgood_reset_w(running_machine &machine, int state)
{
//if (state) mame_printf_debug("SG Reset\n");
device_set_input_line(soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
@@ -737,13 +737,13 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( turbocs_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("tcsdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( turbocs_portb_w )
{
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("tcsdac"), dacval << 6);
turbocs_status = (data >> 4) & 3;
}
@@ -756,21 +756,21 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq )
static TIMER_CALLBACK( turbocs_delayed_data_w )
{
- device_t *pia = machine->device("tcspia");
+ device_t *pia = machine.device("tcspia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, ~param & 0x01);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
/********* external interfaces ***********/
WRITE8_HANDLER( turbocs_data_w )
{
- space->machine->scheduler().synchronize(FUNC(turbocs_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(turbocs_delayed_data_w), data);
}
READ8_HANDLER( turbocs_status_r )
@@ -778,7 +778,7 @@ READ8_HANDLER( turbocs_status_r )
return turbocs_status;
}
-void turbocs_reset_w(running_machine *machine, int state)
+void turbocs_reset_w(running_machine &machine, int state)
{
device_set_input_line(turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -853,7 +853,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w )
static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
{
- device_t *tms = device->machine->device("sntspeech");
+ device_t *tms = device->machine().device("sntspeech");
/* bits 0-1 select read/write strobes on the TMS5200 */
data &= 0x03;
@@ -884,8 +884,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
{
- device_t *pia0 = device->machine->device("sntpia0");
- device_t *pia1 = device->machine->device("sntpia1");
+ device_t *pia0 = device->machine().device("sntpia0");
+ device_t *pia1 = device->machine().device("sntpia1");
int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
device_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
@@ -893,7 +893,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
static TIMER_CALLBACK( squawkntalk_delayed_data_w )
{
- device_t *pia0 = machine->device("sntpia0");
+ device_t *pia0 = machine.device("sntpia0");
pia6821_porta_w(pia0, 0, ~param & 0x0f);
pia6821_cb1_w(pia0, ~param & 0x10);
@@ -903,10 +903,10 @@ static TIMER_CALLBACK( squawkntalk_delayed_data_w )
/********* external interfaces ***********/
WRITE8_HANDLER( squawkntalk_data_w )
{
- space->machine->scheduler().synchronize(FUNC(squawkntalk_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(squawkntalk_delayed_data_w), data);
}
-void squawkntalk_reset_w(running_machine *machine, int state)
+void squawkntalk_reset_w(running_machine &machine, int state)
{
device_set_input_line(squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/audio/mcr.h b/src/mame/audio/mcr.h
index 87f11e469d6..bde55c17505 100644
--- a/src/mame/audio/mcr.h
+++ b/src/mame/audio/mcr.h
@@ -12,31 +12,31 @@
/************ Generic MCR routines ***************/
-void mcr_sound_init(running_machine *machine, UINT8 config);
-void mcr_sound_reset(running_machine *machine);
+void mcr_sound_init(running_machine &machine, UINT8 config);
+void mcr_sound_reset(running_machine &machine);
WRITE8_HANDLER( ssio_data_w );
READ8_HANDLER( ssio_status_r );
READ8_HANDLER( ssio_input_port_r );
WRITE8_HANDLER( ssio_output_port_w );
-void ssio_reset_w(running_machine *machine, int state);
+void ssio_reset_w(running_machine &machine, int state);
void ssio_set_custom_input(int which, int mask, read8_space_func handler);
void ssio_set_custom_output(int which, int mask, write8_space_func handler);
WRITE8_HANDLER( csdeluxe_data_w );
READ8_HANDLER( csdeluxe_status_r );
-void csdeluxe_reset_w(running_machine *machine, int state);
+void csdeluxe_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( turbocs_data_w );
READ8_HANDLER( turbocs_status_r );
-void turbocs_reset_w(running_machine *machine, int state);
+void turbocs_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( soundsgood_data_w );
READ8_HANDLER( soundsgood_status_r );
-void soundsgood_reset_w(running_machine *machine, int state);
+void soundsgood_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( squawkntalk_data_w );
-void squawkntalk_reset_w(running_machine *machine, int state);
+void squawkntalk_reset_w(running_machine &machine, int state);
diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c
index 2fb65f965f0..88cad32251f 100644
--- a/src/mame/audio/meadows.c
+++ b/src/mame/audio/meadows.c
@@ -30,7 +30,7 @@ static const INT16 waveform[2] = { -120*256, 120*256 };
/************************************/
SAMPLES_START( meadows_sh_start )
{
- meadows_state *state = device->machine->driver_data<meadows_state>();
+ meadows_state *state = device->machine().driver_data<meadows_state>();
state->_0c00 = state->_0c01 = state->_0c02 = state->_0c03 = 0;
state->dac = 0;
state->dac_enable = 0;
@@ -47,10 +47,10 @@ SAMPLES_START( meadows_sh_start )
/************************************/
/* Sound handler update */
/************************************/
-void meadows_sh_update(running_machine *machine)
+void meadows_sh_update(running_machine &machine)
{
- meadows_state *state = machine->driver_data<meadows_state>();
- device_t *samples = machine->device("samples");
+ meadows_state *state = machine.driver_data<meadows_state>();
+ device_t *samples = machine.device("samples");
int preset, amp;
if (state->latched_0c01 != state->_0c01 || state->latched_0c03 != state->_0c03)
@@ -58,7 +58,7 @@ void meadows_sh_update(running_machine *machine)
/* amplitude is a combination of the upper 4 bits of 0c01 */
/* and bit 4 merged from S2650's flag output */
amp = ((state->_0c03 & ENABLE_CTR1) == 0) ? 0 : (state->_0c01 & 0xf0) >> 1;
- if( cpu_get_reg(machine->device("maincpu"), S2650_FO) )
+ if( cpu_get_reg(machine.device("maincpu"), S2650_FO) )
amp += 0x80;
/* calculate frequency for counter #1 */
/* bit 0..3 of 0c01 are ctr preset */
@@ -94,9 +94,9 @@ void meadows_sh_update(running_machine *machine)
state->dac_enable = state->_0c03 & ENABLE_DAC;
if (state->dac_enable)
- dac_data_w(machine->device("dac"), state->dac);
+ dac_data_w(machine.device("dac"), state->dac);
else
- dac_data_w(machine->device("dac"), 0);
+ dac_data_w(machine.device("dac"), 0);
}
state->latched_0c01 = state->_0c01;
@@ -107,14 +107,14 @@ void meadows_sh_update(running_machine *machine)
/************************************/
/* Write DAC value */
/************************************/
-void meadows_sh_dac_w(running_machine *machine, int data)
+void meadows_sh_dac_w(running_machine &machine, int data)
{
- meadows_state *state = machine->driver_data<meadows_state>();
+ meadows_state *state = machine.driver_data<meadows_state>();
state->dac = data;
if (state->dac_enable)
- dac_data_w(machine->device("dac"), state->dac);
+ dac_data_w(machine.device("dac"), state->dac);
else
- dac_data_w(machine->device("dac"), 0);
+ dac_data_w(machine.device("dac"), 0);
}
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index b3ef279284e..93588a92f43 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -99,7 +99,7 @@ INLINE double step_cr_filter(filter_state *state, double input)
*
*************************************/
-static void filter_init(running_machine *machine, lp_filter *iir, double fs)
+static void filter_init(running_machine &machine, lp_filter *iir, double fs)
{
/* Section 1 */
iir->ProtoCoef[0].a0 = 1.0;
@@ -178,13 +178,13 @@ static void recompute_filter(lp_filter *iir, double k, double q, double fc)
iir->coef[0] = k;
}
-void micro3d_noise_sh_w(running_machine *machine, UINT8 data)
+void micro3d_noise_sh_w(running_machine &machine, UINT8 data)
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
if (~data & 8)
{
- device_t *device = machine->device(data & 4 ? "noise_2" : "noise_1");
+ device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1");
noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
if (state->dac_data != nstate->dac[data & 3])
@@ -310,12 +310,12 @@ static STREAM_UPDATE( micro3d_stream_update )
static DEVICE_START( micro3d_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
noise_state *state = get_safe_token(device);
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), state, micro3d_stream_update);
- filter_init(machine, &state->filter, machine->sample_rate());
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), state, micro3d_stream_update);
+ filter_init(machine, &state->filter, machine.sample_rate());
configure_filter(&state->noise_filters[0], 2.7e3 + 2.7e3, 1.0e-6);
configure_filter(&state->noise_filters[1], 2.7e3 + 1e3, 0.30e-6);
@@ -372,7 +372,7 @@ DEVICE_GET_INFO( micro3d_sound )
WRITE8_HANDLER( micro3d_snd_dac_a )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->dac_data = data;
}
@@ -383,7 +383,7 @@ WRITE8_HANDLER( micro3d_snd_dac_b )
WRITE8_HANDLER( micro3d_sound_io_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->sound_port_latch[offset] = data;
@@ -391,12 +391,12 @@ WRITE8_HANDLER( micro3d_sound_io_w )
{
case 0x01:
{
- micro3d_noise_sh_w(space->machine, data);
+ micro3d_noise_sh_w(space->machine(), data);
break;
}
case 0x03:
{
- device_t *upd = space->machine->device("upd7759");
+ device_t *upd = space->machine().device("upd7759");
upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0);
upd7759_reset_w(upd, (data & 0x10) ? 0 : 1);
break;
@@ -406,12 +406,12 @@ WRITE8_HANDLER( micro3d_sound_io_w )
READ8_HANDLER( micro3d_sound_io_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
switch (offset)
{
- case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine, "SOUND_SW");
- case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine->device("upd7759")) ? 0x08 : 0);
+ case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine(), "SOUND_SW");
+ case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine().device("upd7759")) ? 0x08 : 0);
default: return 0;
}
}
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index 1fef144e856..96464eeb8d1 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -19,7 +19,7 @@
static SOUND_START( samples )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->port_1_last));
@@ -165,7 +165,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( seawolf_audio_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable SHIP HIT sound */
@@ -183,7 +183,7 @@ WRITE8_HANDLER( seawolf_audio_w )
/* if (data & 0x10) enable MINE HIT sound */
if (rising_bits & 0x10) sample_start(state->samples, 4, 4, 0);
- coin_counter_w(space->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
@@ -231,11 +231,11 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( gunfight_audio_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
/* D0 and D1 are just tied to 1k resistors */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
/* the 74175 latches and inverts the top 4 bits */
switch ((~data >> 4) & 0x0f)
@@ -343,7 +343,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x10) enable CHEER sound */
- if (tornbase_get_cabinet_type(device->machine) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
+ if (tornbase_get_cabinet_type(device->machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
{
/* if (data & 0x20) enable WHISTLE sound */
@@ -356,7 +356,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x40) enable WHISTLE sound */
}
- coin_counter_w(device->machine, 0, (data >> 7) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 7) & 0x01);
}
@@ -397,7 +397,7 @@ WRITE8_HANDLER( zzzap_audio_2_w )
before it appears again, not sure what
it is supposed to sound like) */
- coin_counter_w(space->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
/* D4, D6 and D7 are not connected */
}
@@ -580,7 +580,7 @@ MACHINE_CONFIG_END
void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
{
/* controls need to be active low */
- int controls = ~input_port_read(device->machine, "IN0") & 0xff;
+ int controls = ~input_port_read(device->machine(), "IN0") & 0xff;
discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
@@ -592,7 +592,7 @@ void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
/* A better option might be to update it at vblank or set a timer to do it. */
/* The only noticeable difference doing it here, is that the controls don't */
/* imediately start making tones if pressed right after the coin is inserted. */
- discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine, "IN1") >> 3) & 0x01);
+ discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine(), "IN1") >> 3) & 0x01);
}
@@ -828,7 +828,7 @@ WRITE8_DEVICE_HANDLER( boothill_audio_w )
{
/* D0 and D1 are not connected */
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
@@ -1059,9 +1059,9 @@ WRITE8_DEVICE_HANDLER( checkmat_audio_w )
discrete_sound_w(device, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
- device->machine->sound().system_enable((data >> 3) & 0x01);
+ device->machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
discrete_sound_w(device, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
@@ -1268,7 +1268,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
{
/* D0 and D1 are not connected */
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
@@ -1284,7 +1284,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
@@ -1543,7 +1543,7 @@ WRITE8_DEVICE_HANDLER( dplay_audio_w )
discrete_sound_w(device, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
}
@@ -1593,14 +1593,14 @@ WRITE8_HANDLER( gmissile_audio_1_w )
reversed (D5=R, D7=L), but the software confirms that
ours is right */
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable RIGHT MISSILE sound (goes to right speaker) */
if (rising_bits & 0x10) sample_start(state->samples2, 0, 0, 0);
@@ -1688,14 +1688,14 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( m4_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable LEFT PLAYER SHOT sound (goes to left speaker) */
if (rising_bits & 0x10) sample_start(state->samples1, 0, 0, 0);
@@ -1715,7 +1715,7 @@ WRITE8_HANDLER( m4_audio_1_w )
WRITE8_HANDLER( m4_audio_2_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */
@@ -1950,8 +1950,8 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( clowns_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
- coin_counter_w(space->machine, 0, (data >> 0) & 0x01);
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
+ coin_counter_w(space->machine(), 0, (data >> 0) & 0x01);
state->clowns_controller_select = (data >> 1) & 0x01;
@@ -1961,7 +1961,7 @@ WRITE8_HANDLER( clowns_audio_1_w )
WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
@@ -1970,7 +1970,7 @@ WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
discrete_sound_w(device, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
- device->machine->sound().system_enable((data >> 3) & 0x01);
+ device->machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
@@ -2317,13 +2317,13 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
- coin_counter_w(device->machine, 0, (data >> 0) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 0) & 0x01);
state->clowns_controller_select = (data >> 1) & 0x01;
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
}
@@ -2553,7 +2553,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
discrete_sound_w(device, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, NODE_29, (data >> 3) & 0x07);
@@ -2569,7 +2569,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
{
discrete_sound_w(device, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 1) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
/* D2-D7 are not connected */
}
@@ -2615,9 +2615,9 @@ WRITE8_HANDLER( dogpatch_audio_w )
{
/* D0 and D1 are most likely not used */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable LEFT SHOOT sound */
@@ -3152,7 +3152,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
{
- device->machine->sound().system_enable((data >> 0) & 0x01);
+ device->machine().sound().system_enable((data >> 0) & 0x01);
/* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
but it is never set by the software */
@@ -3165,7 +3165,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
/* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */
@@ -3181,7 +3181,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
@@ -3234,7 +3234,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( phantom2_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable PLAYER SHOT sound */
@@ -3242,10 +3242,10 @@ WRITE8_HANDLER( phantom2_audio_1_w )
/* if (data & 0x02) enable ENEMY SHOT sound */
- space->machine->sound().system_mute(!(data & 0x20));
- space->machine->sound().system_enable((data >> 2) & 0x01);
+ space->machine().sound().system_mute(!(data & 0x20));
+ space->machine().sound().system_enable((data >> 2) & 0x01);
- coin_counter_w(space->machine, 0, (data >> 3) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 3) & 0x01);
/* if (data & 0x10) enable RADAR sound */
@@ -3257,7 +3257,7 @@ WRITE8_HANDLER( phantom2_audio_1_w )
WRITE8_HANDLER( phantom2_audio_2_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 are not connected */
@@ -3366,9 +3366,9 @@ WRITE8_DEVICE_HANDLER( bowler_audio_1_w )
{
/* D0 - selects controller on the cocktail PCB */
- coin_counter_w(device->machine, 0, (data >> 1) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, BOWLER_FOWL_EN, (data >> 3) & 0x01);
@@ -4088,7 +4088,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn, (~data >> 0) & 0x01); /* saucer sound */
@@ -4097,7 +4097,7 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@@ -4105,13 +4105,13 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */
- if (invaders_is_cabinet_cocktail(device->machine))
+ if (invaders_is_cabinet_cocktail(device->machine()))
{
state->invaders_flip_screen = (data >> 5) & 0x01;
}
@@ -4721,7 +4721,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn1, (~data >> 0) & 0x01); /* saucer sound */
@@ -4730,7 +4730,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@@ -4747,7 +4747,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn2, (~data >> 0) & 0x01); /* saucer sound */
diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c
index 4538eabc672..73b1c2e1308 100644
--- a/src/mame/audio/n8080.c
+++ b/src/mame/audio/n8080.c
@@ -71,7 +71,7 @@ static const sn76477_interface spacefev_sn76477_interface =
static void spacefev_update_SN76477_status( device_t *sn )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
double dblR0 = RES_M(1.0);
double dblR1 = RES_M(1.5);
@@ -101,7 +101,7 @@ static void spacefev_update_SN76477_status( device_t *sn )
static void sheriff_update_SN76477_status( device_t *sn )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
if (state->mono_flop[1])
{
sn76477_vco_voltage_w(sn, 5);
@@ -123,7 +123,7 @@ static void sheriff_update_SN76477_status( device_t *sn )
static void update_SN76477_status( device_t *device )
{
- n8080_state *state = device->machine->driver_data<n8080_state>();
+ n8080_state *state = device->machine().driver_data<n8080_state>();
if (state->n8080_hardware == 1)
{
spacefev_update_SN76477_status(device);
@@ -137,7 +137,7 @@ static void update_SN76477_status( device_t *device )
static void start_mono_flop( device_t *sn, int n, attotime expire )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
state->mono_flop[n] = 1;
update_SN76477_status(sn);
@@ -148,7 +148,7 @@ static void start_mono_flop( device_t *sn, int n, attotime expire )
static void stop_mono_flop( device_t *sn, int n )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
state->mono_flop[n] = 0;
update_SN76477_status(sn);
@@ -159,14 +159,14 @@ static void stop_mono_flop( device_t *sn, int n )
static TIMER_CALLBACK( stop_mono_flop_callback )
{
- stop_mono_flop(machine->device("snsnd"), param);
+ stop_mono_flop(machine.device("snsnd"), param);
}
-static void spacefev_sound_pins_changed( running_machine *machine )
+static void spacefev_sound_pins_changed( running_machine &machine )
{
- device_t *sn = machine->device("snsnd");
- n8080_state *state = machine->driver_data<n8080_state>();
+ device_t *sn = machine.device("snsnd");
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x3))
@@ -191,15 +191,15 @@ static void spacefev_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void sheriff_sound_pins_changed( running_machine *machine )
+static void sheriff_sound_pins_changed( running_machine &machine )
{
- device_t *sn = machine->device("snsnd");
- n8080_state *state = machine->driver_data<n8080_state>();
+ device_t *sn = machine.device("snsnd");
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x6))
@@ -216,14 +216,14 @@ static void sheriff_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void helifire_sound_pins_changed( running_machine *machine )
+static void helifire_sound_pins_changed( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
/* ((state->curr_sound_pins >> 0xa) & 1) not emulated */
@@ -232,14 +232,14 @@ static void helifire_sound_pins_changed( running_machine *machine )
if (changes & (1 << 6))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void sound_pins_changed( running_machine *machine )
+static void sound_pins_changed( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
if (state->n8080_hardware == 1)
spacefev_sound_pins_changed(machine);
@@ -252,9 +252,9 @@ static void sound_pins_changed( running_machine *machine )
}
-static void delayed_sound_1( running_machine *machine, int data )
+static void delayed_sound_1( running_machine &machine, int data )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x7) |
@@ -293,9 +293,9 @@ static TIMER_CALLBACK( delayed_sound_1_callback )
}
-static void delayed_sound_2( running_machine *machine, int data )
+static void delayed_sound_2( running_machine &machine, int data )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x8) |
@@ -329,18 +329,18 @@ static TIMER_CALLBACK( delayed_sound_2_callback )
WRITE8_HANDLER( n8080_sound_1_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_1_callback), data); /* force CPUs to sync */
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_1_callback), data); /* force CPUs to sync */
}
WRITE8_HANDLER( n8080_sound_2_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_2_callback), data); /* force CPUs to sync */
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_2_callback), data); /* force CPUs to sync */
}
static READ8_HANDLER( n8080_8035_p1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0xb) & 1) val |= 0x01;
@@ -358,31 +358,31 @@ static READ8_HANDLER( n8080_8035_p1_r )
static READ8_HANDLER( n8080_8035_t0_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x7) & 1;
}
static READ8_HANDLER( n8080_8035_t1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0xc) & 1;
}
static READ8_HANDLER( helifire_8035_t0_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x3) & 1;
}
static READ8_HANDLER( helifire_8035_t1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x4) & 1;
}
static READ8_HANDLER( helifire_8035_external_ram_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0x7) & 1) val |= 0x01;
@@ -396,27 +396,27 @@ static READ8_HANDLER( helifire_8035_external_ram_r )
static READ8_HANDLER( helifire_8035_p2_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return ((state->curr_sound_pins >> 0xc) & 1) ? 0x10 : 0x00; /* not used */
}
static WRITE8_HANDLER( n8080_dac_w )
{
- dac_data_w(space->machine->device("dac"), data & 0x80);
+ dac_data_w(space->machine().device("dac"), data & 0x80);
}
static WRITE8_HANDLER( helifire_dac_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
- dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume);
+ n8080_state *state = space->machine().driver_data<n8080_state>();
+ dac_data_w(space->machine().device("dac"), data * state->helifire_dac_volume);
}
static WRITE8_HANDLER( helifire_sound_ctrl_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
state->helifire_dac_phase = data & 0x80;
/* data & 0x40 not emulated */
@@ -431,14 +431,14 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w )
state->helifire_dac_timing = DECAY_RATE * log(state->helifire_dac_volume);
}
- state->helifire_dac_timing += space->machine->time().as_double();
+ state->helifire_dac_timing += space->machine().time().as_double();
}
static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
{
- device_t *sn = timer.machine->device("snsnd");
- n8080_state *state = timer.machine->driver_data<n8080_state>();
+ device_t *sn = timer.machine().device("snsnd");
+ n8080_state *state = timer.machine().driver_data<n8080_state>();
double voltage = 0;
if (state->mono_flop[2])
@@ -452,8 +452,8 @@ static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
{
- n8080_state *state = timer.machine->driver_data<n8080_state>();
- double t = state->helifire_dac_timing - timer.machine->time().as_double();
+ n8080_state *state = timer.machine().driver_data<n8080_state>();
+ double t = state->helifire_dac_timing - timer.machine().time().as_double();
if (state->helifire_dac_phase)
{
@@ -468,11 +468,11 @@ static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
MACHINE_START( spacefev_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[2] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[0] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[1] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[2] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -483,7 +483,7 @@ MACHINE_START( spacefev_sound )
MACHINE_RESET( spacefev_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 1;
state->mono_flop[0] = 0;
@@ -500,10 +500,10 @@ MACHINE_RESET( spacefev_sound )
MACHINE_START( sheriff_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[0] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[1] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -514,7 +514,7 @@ MACHINE_START( sheriff_sound )
MACHINE_RESET( sheriff_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 2;
state->mono_flop[0] = 0;
@@ -530,7 +530,7 @@ MACHINE_RESET( sheriff_sound )
MACHINE_START( helifire_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -543,7 +543,7 @@ MACHINE_START( helifire_sound )
MACHINE_RESET( helifire_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 3;
state->helifire_dac_volume = 1;
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index 40db760d817..4aaba9585e3 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -142,7 +142,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
{
namco_52xx_state *state = get_safe_token(device);
- device->machine->scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
device_set_input_line(state->cpu, 0, ASSERT_LINE);
@@ -154,7 +154,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
/* the 52xx uses TSTI to check for an interrupt; it also may be handling
a timer interrupt, so we need to ensure the IRQ line is held long enough */
- device->machine->scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
}
@@ -210,7 +210,7 @@ static DEVICE_START( namco_52xx )
/* find the attached discrete sound device */
assert(intf->discrete != NULL);
- state->discrete = device->machine->device(intf->discrete);
+ state->discrete = device->machine().device(intf->discrete);
assert(state->discrete != NULL);
state->basenode = intf->firstnode;
@@ -220,7 +220,7 @@ static DEVICE_START( namco_52xx )
/* start the external clock */
if (intf->extclock != 0)
- device->machine->scheduler().timer_pulse(attotime(0, intf->extclock), FUNC(external_clock_pulse), 0, device);
+ device->machine().scheduler().timer_pulse(attotime(0, intf->extclock), FUNC(external_clock_pulse), 0, device);
}
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 89c90620cb1..633b1a2328d 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -120,7 +120,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
{
namco_54xx_state *state = get_safe_token(device);
- device->machine->scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
device_set_input_line(state->cpu, 0, ASSERT_LINE);
@@ -129,7 +129,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
- device->machine->scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
}
@@ -174,7 +174,7 @@ static DEVICE_START( namco_54xx )
/* find the attached discrete sound device */
assert(config->discrete != NULL);
- state->discrete = device->machine->device(config->discrete);
+ state->discrete = device->machine().device(config->discrete);
assert(state->discrete != NULL);
state->basenode = config->firstnode;
}
diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c
index fcb52ac4e63..1fcb4fdac81 100644
--- a/src/mame/audio/namcoc7x.c
+++ b/src/mame/audio/namcoc7x.c
@@ -77,9 +77,9 @@ void namcoc7x_sound_write16(UINT16 command, UINT32 offset)
namcoc7x_mcuram[offset] = command;
}
-void namcoc7x_on_driver_init(running_machine *machine)
+void namcoc7x_on_driver_init(running_machine &machine)
{
- UINT8 *pROM = (UINT8 *)machine->region("c7x")->base();
+ UINT8 *pROM = (UINT8 *)machine.region("c7x")->base();
device_t *cpu;
// clear the two 16-bits magic values at the start of the rom
@@ -88,7 +88,7 @@ void namcoc7x_on_driver_init(running_machine *machine)
memset(pROM, 0, 4);
// install speedup cheat
- for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext())
+ for (cpu = machine.device("maincpu"); cpu != NULL; cpu = cpu->typenext())
if (cpu->type() == M37702)
cpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(speedup_r), FUNC(speedup_w));
}
diff --git a/src/mame/audio/namcoc7x.h b/src/mame/audio/namcoc7x.h
index f1ba9d7b915..362d9fb443a 100644
--- a/src/mame/audio/namcoc7x.h
+++ b/src/mame/audio/namcoc7x.h
@@ -25,7 +25,7 @@ WRITE32_HANDLER(namcoc7x_soundram32_w);
READ32_HANDLER(namcoc7x_soundram32_r);
void namcoc7x_sound_write16(UINT16 command, UINT32 offset);
-void namcoc7x_on_driver_init(running_machine *machine);
+void namcoc7x_on_driver_init(running_machine &machine);
void namcoc7x_set_host_ram(UINT32 *hostram);
/* BIOS from Prop Cycle used as a substitute until we can trojan the real BIOSes for these games */
diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c
index 4834e937a60..ca5f126c9a9 100644
--- a/src/mame/audio/phoenix.c
+++ b/src/mame/audio/phoenix.c
@@ -225,7 +225,7 @@ INLINE int noise(phoenix_sound_state *state, int samplerate)
static STREAM_UPDATE( phoenix_sound_update )
{
phoenix_sound_state *state = get_safe_token(device);
- int samplerate = device->machine->sample_rate();
+ int samplerate = device->machine().sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@@ -546,10 +546,10 @@ static DEVICE_START( phoenix_sound )
memset(&state->c25_state, 0, sizeof(state->c25_state));
memset(&state->noise_state, 0, sizeof(state->noise_state));
- state->discrete = device->machine->device("discrete");
- state->tms = device->machine->device("tms");
+ state->discrete = device->machine().device("discrete");
+ state->tms = device->machine().device("tms");
- state->poly18 = auto_alloc_array(device->machine, UINT32, 1ul << (18-5));
+ state->poly18 = auto_alloc_array(device->machine(), UINT32, 1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@@ -566,7 +566,7 @@ static DEVICE_START( phoenix_sound )
state->poly18[i] = bits;
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, phoenix_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, phoenix_sound_update);
register_state(device);
}
diff --git a/src/mame/audio/pleiads.c b/src/mame/audio/pleiads.c
index 50e2a59d906..6e7cb2d64fc 100644
--- a/src/mame/audio/pleiads.c
+++ b/src/mame/audio/pleiads.c
@@ -409,7 +409,7 @@ INLINE int noise(pleiads_sound_state *state, int samplerate)
static STREAM_UPDATE( pleiads_sound_update )
{
pleiads_sound_state *state = get_safe_token(device);
- int rate = device->machine->sample_rate();
+ int rate = device->machine().sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@@ -478,8 +478,8 @@ static DEVICE_START( common_sh_start )
UINT32 shiftreg;
state->pc4.level = PC4_MIN;
- state->tms = device->machine->device("tms");
- state->poly18 = auto_alloc_array(device->machine, UINT32, 1ul << (18-5));
+ state->tms = device->machine().device("tms");
+ state->poly18 = auto_alloc_array(device->machine(), UINT32, 1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@@ -496,7 +496,7 @@ static DEVICE_START( common_sh_start )
state->poly18[i] = bits;
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), NULL, pleiads_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), NULL, pleiads_sound_update);
}
static DEVICE_START( pleiads_sound )
diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c
index 8d00f1e7779..e5f80598bed 100644
--- a/src/mame/audio/polepos.c
+++ b/src/mame/audio/polepos.c
@@ -74,13 +74,13 @@ static STREAM_UPDATE( engine_sound_update )
}
/* determine the effective clock rate */
- clock = (device->machine->device("maincpu")->unscaled_clock() / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
+ clock = (device->machine().device("maincpu")->unscaled_clock() / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
step = (clock << 12) / OUTPUT_RATE;
/* determine the volume */
slot = (state->sample_msb >> 3) & 7;
volume = volume_table[slot];
- base = &device->machine->region("engine")->base()[slot * 0x800];
+ base = &device->machine().region("engine")->base()[slot * 0x800];
/* fill in the sample */
while (samples--)
@@ -113,7 +113,7 @@ static STREAM_UPDATE( engine_sound_update )
static DEVICE_START( polepos_sound )
{
polepos_sound_state *state = get_safe_token(device);
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update);
state->sample_msb = state->sample_lsb = 0;
state->sample_enable = 0;
diff --git a/src/mame/audio/polyplay.c b/src/mame/audio/polyplay.c
index 61eb3f0dda9..ad4724ddbc2 100644
--- a/src/mame/audio/polyplay.c
+++ b/src/mame/audio/polyplay.c
@@ -20,7 +20,7 @@
SAMPLES_START( polyplay_sh_start )
{
- polyplay_state *state = device->machine->driver_data<polyplay_state>();
+ polyplay_state *state = device->machine().driver_data<polyplay_state>();
int i;
for (i = 0; i < SAMPLE_LENGTH / 2; i++) {
@@ -34,22 +34,22 @@ SAMPLES_START( polyplay_sh_start )
state->channel_playing2 = 0;
}
-void polyplay_set_channel1(running_machine *machine, int active)
+void polyplay_set_channel1(running_machine &machine, int active)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
+ polyplay_state *state = machine.driver_data<polyplay_state>();
state->channel_playing1 = active;
}
-void polyplay_set_channel2(running_machine *machine, int active)
+void polyplay_set_channel2(running_machine &machine, int active)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
+ polyplay_state *state = machine.driver_data<polyplay_state>();
state->channel_playing2 = active;
}
-void polyplay_play_channel1(running_machine *machine, int data)
+void polyplay_play_channel1(running_machine &machine, int data)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
- device_t *samples = machine->device("samples");
+ polyplay_state *state = machine.driver_data<polyplay_state>();
+ device_t *samples = machine.device("samples");
if (data) {
state->freq1 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 0, state->channel_playing1 * 1.0);
@@ -61,10 +61,10 @@ void polyplay_play_channel1(running_machine *machine, int data)
}
}
-void polyplay_play_channel2(running_machine *machine, int data)
+void polyplay_play_channel2(running_machine &machine, int data)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
- device_t *samples = machine->device("samples");
+ polyplay_state *state = machine.driver_data<polyplay_state>();
+ device_t *samples = machine.device("samples");
if (data) {
state->freq2 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 1, state->channel_playing2 * 1.0);
diff --git a/src/mame/audio/pulsar.c b/src/mame/audio/pulsar.c
index 3ca90171c6e..94d44018bae 100644
--- a/src/mame/audio/pulsar.c
+++ b/src/mame/audio/pulsar.c
@@ -88,7 +88,7 @@ static int port1State = 0;
WRITE8_HANDLER( pulsar_audio_1_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
@@ -139,7 +139,7 @@ WRITE8_HANDLER( pulsar_audio_1_w )
WRITE8_HANDLER( pulsar_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
static int port2State = 0;
int bitsChanged;
int bitsGoneHigh;
diff --git a/src/mame/audio/qix.c b/src/mame/audio/qix.c
index 7853e643cab..d424542eed5 100644
--- a/src/mame/audio/qix.c
+++ b/src/mame/audio/qix.c
@@ -109,14 +109,14 @@ static TIMER_CALLBACK( deferred_sndpia1_porta_w )
static WRITE8_DEVICE_HANDLER( sync_sndpia1_porta_w )
{
/* we need to synchronize this so the sound CPU doesn't drop anything important */
- device->machine->scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)device);
}
static WRITE8_DEVICE_HANDLER( slither_coinctl_w )
{
- coin_lockout_w(device->machine, 0, (~data >> 6) & 1);
- coin_counter_w(device->machine, 0, (data >> 5) & 1);
+ coin_lockout_w(device->machine(), 0, (~data >> 6) & 1);
+ coin_counter_w(device->machine(), 0, (data >> 5) & 1);
}
@@ -132,7 +132,7 @@ static WRITE_LINE_DEVICE_HANDLER( qix_pia_dint )
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
/* DINT is connected to the data CPU's IRQ line */
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -141,7 +141,7 @@ static WRITE_LINE_DEVICE_HANDLER( qix_pia_sint )
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
/* SINT is connected to the sound CPU's IRQ line */
- cputag_set_input_line(device->machine, "audiocpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c
index 3a58961e1b8..5ecbf9f113f 100644
--- a/src/mame/audio/redalert.c
+++ b/src/mame/audio/redalert.c
@@ -70,13 +70,13 @@ WRITE8_HANDLER( redalert_audio_command_w )
/* D7 is also connected to the NMI input of the CPU -
the NMI is actually toggled by a 74121 */
if ((data & 0x80) == 0x00)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
/* BC2 is connected to a pull-up resistor, so BC2=1 always */
switch (data & 0x03)
{
@@ -102,14 +102,14 @@ static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
static READ8_HANDLER( redalert_ay8910_latch_1_r )
{
- redalert_state *state = space->machine->driver_data<redalert_state>();
+ redalert_state *state = space->machine().driver_data<redalert_state>();
return state->ay8910_latch_1;
}
static WRITE8_HANDLER( redalert_ay8910_latch_2_w )
{
- redalert_state *state = space->machine->driver_data<redalert_state>();
+ redalert_state *state = space->machine().driver_data<redalert_state>();
state->ay8910_latch_2 = data;
}
@@ -142,7 +142,7 @@ ADDRESS_MAP_END
static SOUND_START( redalert_audio )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
state->save_item(NAME(state->ay8910_latch_1));
state->save_item(NAME(state->ay8910_latch_2));
}
@@ -157,19 +157,19 @@ static SOUND_START( redalert_audio )
WRITE8_HANDLER( redalert_voice_command_w )
{
soundlatch2_w(space, 0, (data & 0x78) >> 3);
- cputag_set_input_line(space->machine, "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( sod_callback )
{
- hc55516_digit_w(device->machine->device("cvsd"), state);
+ hc55516_digit_w(device->machine().device("cvsd"), state);
}
static READ_LINE_DEVICE_HANDLER( sid_callback )
{
- return hc55516_clock_state_r(device->machine->device("cvsd"));
+ return hc55516_clock_state_r(device->machine().device("cvsd"));
}
@@ -284,29 +284,29 @@ WRITE8_HANDLER( demoneye_audio_command_w )
{
/* the byte is connected to port A of the AY8910 */
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_latch_1_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
state->ay8910_latch_1 = data;
}
static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
return state->ay8910_latch_2;
}
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
- device_t *ay1 = device->machine->device("ay1");
- device_t *ay2 = device->machine->device("ay2");
+ redalert_state *state = device->machine().driver_data<redalert_state>();
+ device_t *ay1 = device->machine().device("ay1");
+ device_t *ay2 = device->machine().device("ay2");
switch (state->ay8910_latch_1 & 0x03)
{
@@ -389,7 +389,7 @@ static const pia6821_interface demoneye_pia_intf =
static SOUND_START( demoneye )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
state->save_item(NAME(state->ay8910_latch_1));
state->save_item(NAME(state->ay8910_latch_2));
}
diff --git a/src/mame/audio/redbaron.c b/src/mame/audio/redbaron.c
index 6f1dd670731..96f2958b171 100644
--- a/src/mame/audio/redbaron.c
+++ b/src/mame/audio/redbaron.c
@@ -189,7 +189,7 @@ static DEVICE_START( redbaron_sound )
redbaron_sound_state *state = get_safe_token(device);
int i;
- state->vol_lookup = auto_alloc_array(device->machine, INT16, 32768);
+ state->vol_lookup = auto_alloc_array(device->machine(), INT16, 32768);
for( i = 0; i < 0x8000; i++ )
state->vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
@@ -223,7 +223,7 @@ static DEVICE_START( redbaron_sound )
state->vol_crash[i] = 32767 * r0 / (r0 + r1);
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update);
}
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index a080ebdb067..d985de1c285 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -45,7 +45,7 @@ static const int scramble_timer[10] =
READ8_DEVICE_HANDLER( scramble_portB_r )
{
- return scramble_timer[(device->machine->device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
+ return scramble_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
@@ -74,23 +74,23 @@ static const int frogger_timer[10] =
READ8_DEVICE_HANDLER( frogger_portB_r )
{
- return frogger_timer[(device->machine->device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
+ return frogger_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
/* bit 4 is sound disable */
- device->machine->sound().system_mute((data & 0x10) >> 4);
+ device->machine().sound().system_mute((data & 0x10) >> 4);
}
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
@@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
static IRQ_CALLBACK(scramble_sh_irq_callback)
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* interrupt acknowledge clears the flip-flop --
we need to pulse the CLR line because MAME's core never clears this
@@ -114,18 +114,18 @@ WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback )
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
- cputag_set_input_line(device->machine, "audiocpu", 0, !state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, !state ? ASSERT_LINE : CLEAR_LINE);
}
WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
READ8_DEVICE_HANDLER( hotshock_soundlatch_r )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
- return soundlatch_r(device->machine->device("audiocpu")->memory().space(AS_PROGRAM),0);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
+ return soundlatch_r(device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0);
}
static void filter_w(device_t *device, int data)
@@ -144,27 +144,27 @@ static void filter_w(device_t *device, int data)
WRITE8_HANDLER( scramble_filter_w )
{
- filter_w(space->machine->device("filter.1.0"), (offset >> 0) & 3);
- filter_w(space->machine->device("filter.1.1"), (offset >> 2) & 3);
- filter_w(space->machine->device("filter.1.2"), (offset >> 4) & 3);
- filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
- filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
- filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
+ filter_w(space->machine().device("filter.1.0"), (offset >> 0) & 3);
+ filter_w(space->machine().device("filter.1.1"), (offset >> 2) & 3);
+ filter_w(space->machine().device("filter.1.2"), (offset >> 4) & 3);
+ filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3);
+ filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3);
+ filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3);
}
WRITE8_HANDLER( frogger_filter_w )
{
- filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
- filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
- filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
+ filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3);
+ filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3);
+ filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3);
}
-void scramble_sh_init(running_machine *machine)
+void scramble_sh_init(running_machine &machine)
{
- device_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
+ device_set_irq_callback(machine.device("audiocpu"), scramble_sh_irq_callback);
/* PR is always 0, D is always 1 */
- ttl7474_d_w(machine->device("konami_7474"), 1);
+ ttl7474_d_w(machine.device("konami_7474"), 1);
}
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index f5c6b6cb579..f80d9fbce89 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -205,7 +205,7 @@ MACHINE_CONFIG_END
static SOUND_START( astrob )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_rate);
}
@@ -220,12 +220,12 @@ static SOUND_START( astrob )
WRITE8_HANDLER( astrob_sound_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
static const float attack_resistor[10] =
{
120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
};
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
float freq_factor;
UINT8 diff = data ^ state->sound_state[offset];
@@ -255,7 +255,7 @@ WRITE8_HANDLER( astrob_sound_w )
if ((data & 0x10) && sample_playing(samples, 4)) sample_stop(samples, 4);
/* MUTE */
- space->machine->sound().system_mute(data & 0x20);
+ space->machine().sound().system_mute(data & 0x20);
/* REFILL: channel 5 */
if (!(data & 0x40) && !sample_playing(samples, 5)) sample_start(samples, 5, 9, FALSE);
@@ -440,7 +440,7 @@ MACHINE_CONFIG_END
static SOUND_START( sega005 )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_addr);
state_save_register_global(machine, state->sound_data);
@@ -458,8 +458,8 @@ static SOUND_START( sega005 )
static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- device_t *samples = device->machine->device("samples");
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -488,10 +488,10 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
}
-INLINE void sega005_update_sound_data(running_machine *machine)
+INLINE void sega005_update_sound_data(running_machine &machine)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
- UINT8 newval = machine->region("005")->base()[state->sound_addr];
+ segag80r_state *state = machine.driver_data<segag80r_state>();
+ UINT8 newval = machine.region("005")->base()[state->sound_addr];
UINT8 diff = newval ^ state->sound_data;
//mame_printf_debug(" [%03X] = %02X\n", state->sound_addr, newval);
@@ -517,7 +517,7 @@ INLINE void sega005_update_sound_data(running_machine *machine)
static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/*
D6: manual timer clock (0->1)
D5: 0 = manual timer, 1 = auto timer
@@ -547,7 +547,7 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
state->sound_addr = (state->sound_addr & 0x780) | ((state->sound_addr + 1) & 0x07f);
/* update the sound data */
- sega005_update_sound_data(device->machine);
+ sega005_update_sound_data(device->machine());
}
@@ -560,14 +560,14 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
static DEVICE_START( sega005_sound )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- running_machine *machine = device->machine;
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ running_machine &machine = device->machine();
/* create the stream */
- state->sega005_stream = device->machine->sound().stream_alloc(*device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
+ state->sega005_stream = device->machine().sound().stream_alloc(*device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
/* create a timer for the 555 */
- state->sega005_sound_timer = machine->scheduler().timer_alloc(FUNC(sega005_auto_timer));
+ state->sega005_sound_timer = machine.scheduler().timer_alloc(FUNC(sega005_auto_timer));
/* set the initial sound data */
state->sound_data = 0x00;
@@ -591,8 +591,8 @@ DEVICE_GET_INFO( sega005_sound )
static STREAM_UPDATE( sega005_stream_update )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- const UINT8 *sound_prom = device->machine->region("proms")->base();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ const UINT8 *sound_prom = device->machine().region("proms")->base();
int i;
/* no implementation yet */
@@ -614,7 +614,7 @@ static STREAM_UPDATE( sega005_stream_update )
static TIMER_CALLBACK( sega005_auto_timer )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* force an update then clock the sound address if not held in reset */
state->sega005_stream->update();
if ((state->sound_state[1] & 0x20) && !(state->sound_state[1] & 0x10))
@@ -679,7 +679,7 @@ MACHINE_CONFIG_END
static SOUND_START( spaceod )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
}
@@ -693,8 +693,8 @@ static SOUND_START( spaceod )
WRITE8_HANDLER( spaceod_sound_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
- device_t *samples = space->machine->device("samples");
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 diff = data ^ state->sound_state[offset];
state->sound_state[offset] = data;
@@ -863,7 +863,7 @@ MACHINE_CONFIG_END
static SOUND_START( monsterb )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_addr);
state_save_register_global(machine, state->n7751_command);
@@ -880,14 +880,14 @@ static SOUND_START( monsterb )
static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
{
- device_t *tms = device->machine->device("music");
+ device_t *tms = device->machine().device("music");
int enable_val;
/* Lower four data lines get decoded into 13 control lines */
tms36xx_note_w(tms, 0, data & 15);
/* Top four data lines address an 82S123 ROM that enables/disables voices */
- enable_val = device->machine->region("prom")->base()[(data & 0xF0) >> 4];
+ enable_val = device->machine().region("prom")->base()[(data & 0xF0) >> 4];
tms3617_enable_w(tms, enable_val >> 2);
}
@@ -901,8 +901,8 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- device_t *samples = device->machine->device("samples");
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -925,14 +925,14 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
static READ8_DEVICE_HANDLER( n7751_status_r )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
return state->n7751_busy << 4;
}
static WRITE8_DEVICE_HANDLER( n7751_command_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/*
Z80 7751 control port
@@ -940,14 +940,14 @@ static WRITE8_DEVICE_HANDLER( n7751_command_w )
D3 = /INT line
*/
state->n7751_command = data & 0x07;
- cputag_set_input_line(device->machine, "audiocpu", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ cputag_set_input_line(device->machine(), "audiocpu", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/* P4 - address lines 0-3 */
/* P5 - address lines 4-7 */
/* P6 - address lines 8-11 */
@@ -969,7 +969,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
case 3:
state->sound_addr &= 0xfff;
{
- int numroms = device->machine->region("n7751")->bytes() / 0x1000;
+ int numroms = device->machine().region("n7751")->bytes() / 0x1000;
if (!(data & 0x01) && numroms >= 1) state->sound_addr |= 0x0000;
if (!(data & 0x02) && numroms >= 2) state->sound_addr |= 0x1000;
if (!(data & 0x04) && numroms >= 3) state->sound_addr |= 0x2000;
@@ -982,15 +982,15 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
static READ8_HANDLER( n7751_rom_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* read from BUS */
- return space->machine->region("n7751")->base()[state->sound_addr];
+ return space->machine().region("n7751")->base()[state->sound_addr];
}
static READ8_HANDLER( n7751_command_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
/* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
return 0x80 | ((state->n7751_command & 0x07) << 4);
@@ -999,7 +999,7 @@ static READ8_HANDLER( n7751_command_r )
static WRITE8_DEVICE_HANDLER( n7751_p2_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/* write to P2; low 4 bits go to 8243 */
i8243_p2_w(device, offset, data & 0x0f);
diff --git a/src/mame/audio/segag80v.c b/src/mame/audio/segag80v.c
index c18ab02adae..606c69deb5f 100644
--- a/src/mame/audio/segag80v.c
+++ b/src/mame/audio/segag80v.c
@@ -137,7 +137,7 @@ d0 crafts joining
WRITE8_HANDLER( elim1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play fireball sample */
@@ -171,7 +171,7 @@ WRITE8_HANDLER( elim1_sh_w )
WRITE8_HANDLER( elim2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play thrust sample */
@@ -198,7 +198,7 @@ WRITE8_HANDLER( elim2_sh_w )
WRITE8_HANDLER( zektor1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
@@ -233,7 +233,7 @@ WRITE8_HANDLER( zektor1_sh_w )
WRITE8_HANDLER( zektor2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play thrust sample */
@@ -261,7 +261,7 @@ WRITE8_HANDLER( zektor2_sh_w )
WRITE8_HANDLER( spacfury1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* craft growing */
@@ -298,7 +298,7 @@ WRITE8_HANDLER( spacfury1_sh_w )
WRITE8_HANDLER( spacfury2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* craft joining */
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index 50388ed8e50..d6ba0410c1f 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -168,7 +168,7 @@ static READ8_HANDLER( speech_p1_r )
static READ8_HANDLER( speech_rom_r )
{
- return space->machine->region("speech")->base()[0x100 * (speech_p2 & 0x3f) + offset];
+ return space->machine().region("speech")->base()[0x100 * (speech_p2 & 0x3f) + offset];
}
static WRITE8_HANDLER( speech_p1_w )
@@ -222,7 +222,7 @@ static TIMER_CALLBACK( delayed_speech_w )
WRITE8_HANDLER( sega_speech_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_speech_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_speech_w), data);
}
@@ -308,7 +308,7 @@ static TIMER_DEVICE_CALLBACK( increment_t1_clock )
}
-void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask)
+void sega_usb_reset(running_machine &machine, UINT8 t1_clock_mask)
{
/* halt the USB CPU at reset time */
device_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
@@ -356,10 +356,10 @@ static TIMER_CALLBACK( delayed_usb_data_w )
WRITE8_HANDLER( sega_usb_data_w )
{
LOG(("%04X:usb_data_w = %02X\n", cpu_get_pc(space->cpu), data));
- space->machine->scheduler().synchronize(FUNC(delayed_usb_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_usb_data_w), data);
/* boost the interleave so that sequences can be sent */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
}
@@ -638,19 +638,19 @@ static STREAM_UPDATE( usb_stream_update )
static DEVICE_START( usb_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
filter_state temp;
int tchan, tgroup;
/* find the CPU we are associated with */
- usb.cpu = machine->device("usbcpu");
+ usb.cpu = machine.device("usbcpu");
assert(usb.cpu != NULL);
/* allocate work RAM */
usb.work_ram = auto_alloc_array(machine, UINT8, 0x400);
/* create a sound stream */
- usb.stream = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, usb_stream_update);
+ usb.stream = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, usb_stream_update);
/* initialize state */
usb.noise_shift = 0x15555;
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index cd17b92bc4b..2690a8d0d61 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -14,7 +14,7 @@ WRITE8_HANDLER( sega_speech_control_w );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board_rom );
-void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask);
+void sega_usb_reset(running_machine &machine, UINT8 t1_clock_mask);
READ8_HANDLER( sega_usb_status_r );
WRITE8_HANDLER( sega_usb_data_w );
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index 74337dc95e7..8a6de3f282c 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -101,11 +101,11 @@ static UINT8 decrypt_opcode(int a,int src)
return src;
}
-void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
+void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
- UINT8 *rom = machine->region(cpu)->base();
+ UINT8 *rom = machine.region(cpu)->base();
int i;
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
@@ -170,12 +170,12 @@ static STREAM_UPDATE( seibu_adpcm_callback )
static DEVICE_START( seibu_adpcm )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
state->playing = 0;
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
- state->base = machine->region("adpcm")->base();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
+ state->base = machine.region("adpcm")->base();
state->adpcm.reset();
}
@@ -200,10 +200,10 @@ DEVICE_GET_INFO( seibu_adpcm )
// simplify PCB layout/routing rather than intentional protection, but it
// still fits, especially since the Z80s for all these games are truly encrypted.
-void seibu_adpcm_decrypt(running_machine *machine, const char *region)
+void seibu_adpcm_decrypt(running_machine &machine, const char *region)
{
- UINT8 *ROM = machine->region(region)->base();
- int len = machine->region(region)->bytes();
+ UINT8 *ROM = machine.region(region)->base();
+ int len = machine.region(region)->bytes();
int i;
for (i = 0; i < len; i++)
@@ -263,7 +263,7 @@ enum
RST18_CLEAR
};
-static void update_irq_lines(running_machine *machine, int param)
+static void update_irq_lines(running_machine &machine, int param)
{
static int irq1,irq2;
@@ -299,7 +299,7 @@ static void update_irq_lines(running_machine *machine, int param)
WRITE8_HANDLER( seibu_irq_clear_w )
{
/* Denjin Makai and SD Gundam doesn't like this, it's tied to the rst18 ack ONLY so it could be related to it. */
- //update_irq_lines(space->machine, VECTOR_INIT);
+ //update_irq_lines(space->machine(), VECTOR_INIT);
}
WRITE8_HANDLER( seibu_rst10_ack_w )
@@ -309,32 +309,32 @@ WRITE8_HANDLER( seibu_rst10_ack_w )
WRITE8_HANDLER( seibu_rst18_ack_w )
{
- update_irq_lines(space->machine, RST18_CLEAR);
+ update_irq_lines(space->machine(), RST18_CLEAR);
}
void seibu_ym3812_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
void seibu_ym2151_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
void seibu_ym2203_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
/***************************************************************************/
MACHINE_RESET( seibu_sound )
{
- int romlength = machine->region("audiocpu")->bytes();
- UINT8 *rom = machine->region("audiocpu")->base();
+ int romlength = machine.region("audiocpu")->bytes();
+ UINT8 *rom = machine.region("audiocpu")->base();
- sound_cpu = machine->device("audiocpu");
+ sound_cpu = machine.device("audiocpu");
update_irq_lines(machine, VECTOR_INIT);
if (romlength > 0x10000)
{
@@ -352,13 +352,13 @@ static int main2sub_pending,sub2main_pending;
WRITE8_HANDLER( seibu_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
WRITE8_HANDLER( seibu_coin_w )
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
}
READ8_HANDLER( seibu_soundlatch_r )
@@ -411,7 +411,7 @@ WRITE16_HANDLER( seibu_main_word_w )
main2sub[offset] = data;
break;
case 4:
- update_irq_lines(space->machine, RST18_ASSERT);
+ update_irq_lines(space->machine(), RST18_ASSERT);
break;
case 2: //Sengoku Mahjong writes here
case 6:
@@ -443,7 +443,7 @@ WRITE16_HANDLER( seibu_main_mustb_w )
// logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
- update_irq_lines(space->machine, RST18_ASSERT);
+ update_irq_lines(space->machine(), RST18_ASSERT);
}
/***************************************************************************/
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index 9cead069e8f..0ac388fa6e1 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -57,9 +57,9 @@ READ8_HANDLER( seibu_soundlatch_r );
READ8_HANDLER( seibu_main_data_pending_r );
WRITE8_HANDLER( seibu_main_data_w );
MACHINE_RESET( seibu_sound );
-void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length);
+void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length);
-void seibu_adpcm_decrypt(running_machine *machine, const char *region);
+void seibu_adpcm_decrypt(running_machine &machine, const char *region);
WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
diff --git a/src/mame/audio/senjyo.c b/src/mame/audio/senjyo.c
index 99a7ddf314e..4d91e70d33b 100644
--- a/src/mame/audio/senjyo.c
+++ b/src/mame/audio/senjyo.c
@@ -19,7 +19,7 @@ const z80_daisy_config senjyo_daisy_chain[] =
static READ8_DEVICE_HANDLER( pio_pa_r )
{
- senjyo_state *state = device->machine->driver_data<senjyo_state>();
+ senjyo_state *state = device->machine().driver_data<senjyo_state>();
return state->sound_cmd;
}
@@ -48,8 +48,8 @@ Z80CTC_INTERFACE( senjyo_ctc_intf )
WRITE8_HANDLER( senjyo_volume_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
- samples_device *samples = space->machine->device<samples_device>("samples");
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
+ samples_device *samples = space->machine().device<samples_device>("samples");
state->single_volume = data & 0x0f;
sample_set_volume(samples, 0, state->single_volume / 15.0);
@@ -58,11 +58,11 @@ WRITE8_HANDLER( senjyo_volume_w )
static TIMER_CALLBACK( senjyo_sh_update )
{
- device_t *samples = machine->device("samples");
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ device_t *samples = machine.device("samples");
+ senjyo_state *state = machine.driver_data<senjyo_state>();
/* ctc2 timer single tone generator frequency */
- z80ctc_device *ctc = machine->device<z80ctc_device>("z80ctc");
+ z80ctc_device *ctc = machine.device<z80ctc_device>("z80ctc");
attotime period = ctc->period(2);
if (period != attotime::zero)
state->single_rate = ATTOSECONDS_TO_HZ(period.attoseconds);
@@ -75,8 +75,8 @@ static TIMER_CALLBACK( senjyo_sh_update )
SAMPLES_START( senjyo_sh_start )
{
- running_machine *machine = device->machine;
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ running_machine &machine = device->machine();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
int i;
state->single_data = auto_alloc_array(machine, INT16, SINGLE_LENGTH);
@@ -90,5 +90,5 @@ SAMPLES_START( senjyo_sh_start )
sample_set_volume(device, 0, state->single_volume / 15.0);
sample_start_raw(device, 0, state->single_data, SINGLE_LENGTH, state->single_rate, 1);
- machine->scheduler().timer_pulse(machine->primary_screen->frame_period(), FUNC(senjyo_sh_update));
+ machine.scheduler().timer_pulse(machine.primary_screen->frame_period(), FUNC(senjyo_sh_update));
}
diff --git a/src/mame/audio/skyraid.c b/src/mame/audio/skyraid.c
index c091c7e2f2d..9e11c7e1b2a 100644
--- a/src/mame/audio/skyraid.c
+++ b/src/mame/audio/skyraid.c
@@ -295,7 +295,7 @@ WRITE8_DEVICE_HANDLER( skyraid_sound_w )
discrete_sound_w(device, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
discrete_sound_w(device, SKYRAID_MISSILE_EN, data & 0x02);
discrete_sound_w(device, SKYRAID_EXPLOSION_EN, data & 0x04);
- set_led_status(device->machine, 0, !(data & 0x08));
+ set_led_status(device->machine(), 0, !(data & 0x08));
discrete_sound_w(device, SKYRAID_PLANE_ON_EN, data & 0x10);
discrete_sound_w(device, SKYRAID_ATTRACT_EN, data & 0x20);
}
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index bcf621323fe..b5bc396f691 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1171,7 +1171,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
if ((data & 0x80) != (spc700->ram[0xf1] & 0x80))
{
if (data & 0x80)
- memcpy(spc700->ipl_region, device->machine->region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, device->machine().region("user5")->base(), 64);
else
memcpy(spc700->ipl_region, &spc700->ram[0xffc0], 64);
}
@@ -1188,7 +1188,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
case 0x7: /* Port 3 */
// mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, cpu_get_pc(space->cpu));
spc700->port_out[offset - 4] = data;
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
break;
case 0xa: /* Timer 0 */
case 0xb: /* Timer 1 */
@@ -1309,26 +1309,26 @@ static void state_register( device_t *device )
static DEVICE_START( snes_sound )
{
snes_sound_state *spc700 = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
- spc700->channel = device->machine->sound().stream_alloc(*device, 0, 2, 32000, 0, snes_sh_update);
+ spc700->channel = device->machine().sound().stream_alloc(*device, 0, 2, 32000, 0, snes_sh_update);
- spc700->ram = auto_alloc_array_clear(device->machine, UINT8, SNES_SPCRAM_SIZE);
+ spc700->ram = auto_alloc_array_clear(device->machine(), UINT8, SNES_SPCRAM_SIZE);
/* default to ROM visible */
spc700->ram[0xf1] = 0x80;
/* put IPL image at the top of RAM */
- memcpy(spc700->ipl_region, machine->region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, machine.region("user5")->base(), 64);
/* Initialize the timers */
- spc700->timer[0] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[0] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[0]->adjust(attotime::from_hz(8000), 0, attotime::from_hz(8000));
spc700->timer[0]->enable(false);
- spc700->timer[1] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[1] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[1]->adjust(attotime::from_hz(8000), 1, attotime::from_hz(8000));
spc700->timer[1]->enable(false);
- spc700->timer[2] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[2] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[2]->adjust(attotime::from_hz(64000), 2, attotime::from_hz(64000));
spc700->timer[2]->enable(false);
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index 01669f4d1fb..5ccdb7d356b 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -618,9 +618,9 @@ static void build_waveform(snk6502_sound_state *state, int channel, int mask)
tone_channels[channel].form[i] *= 65535 / 160;
}
-void snk6502_set_music_freq(running_machine *machine, int freq)
+void snk6502_set_music_freq(running_machine &machine, int freq)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -640,9 +640,9 @@ void snk6502_set_music_freq(running_machine *machine, int freq)
}
}
-void snk6502_set_music_clock(running_machine *machine, double clock_time)
+void snk6502_set_music_clock(running_machine &machine, double clock_time)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
state->tone_clock_expire = clock_time * SAMPLE_RATE * FRAC_ONE;
@@ -653,16 +653,16 @@ static DEVICE_START( snk6502_sound )
{
snk6502_sound_state *state = get_safe_token(device);
- state->samples = device->machine->device("samples");
- state->ROM = device->machine->region("snk6502")->base();
+ state->samples = device->machine().device("samples");
+ state->ROM = device->machine().region("snk6502")->base();
// adjusted
- snk6502_set_music_freq(device->machine, 43000);
+ snk6502_set_music_freq(device->machine(), 43000);
// 38.99 Hz update (according to schematic)
- snk6502_set_music_clock(device->machine, M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));
+ snk6502_set_music_clock(device->machine(), M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));
- state->tone_stream = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, snk6502_tone_update);
+ state->tone_stream = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, snk6502_tone_update);
}
DEVICE_GET_INFO( snk6502_sound )
@@ -681,9 +681,9 @@ DEVICE_GET_INFO( snk6502_sound )
}
}
-int snk6502_music0_playing(running_machine *machine)
+int snk6502_music0_playing(running_machine &machine)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -693,7 +693,7 @@ int snk6502_music0_playing(running_machine *machine)
WRITE8_HANDLER( sasuke_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -763,7 +763,7 @@ WRITE8_HANDLER( sasuke_sound_w )
WRITE8_HANDLER( satansat_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -830,7 +830,7 @@ WRITE8_HANDLER( satansat_sound_w )
WRITE8_HANDLER( vanguard_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -880,7 +880,7 @@ WRITE8_HANDLER( vanguard_sound_w )
}
/* SHOT B */
- sn76477_enable_w(space->machine->device("sn76477.2"), (data & 0x40) ? 0 : 1);
+ sn76477_enable_w(space->machine().device("sn76477.2"), (data & 0x40) ? 0 : 1);
state->LastPort1 = data;
break;
@@ -931,7 +931,7 @@ WRITE8_HANDLER( vanguard_sound_w )
WRITE8_HANDLER( fantasy_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -974,7 +974,7 @@ WRITE8_HANDLER( fantasy_sound_w )
}
/* BOMB */
- discrete_sound_w(space->machine->device("discrete"), FANTASY_BOMB_EN, data & 0x80);
+ discrete_sound_w(space->machine().device("discrete"), FANTASY_BOMB_EN, data & 0x80);
state->LastPort1 = data;
break;
@@ -1070,7 +1070,7 @@ WRITE8_HANDLER( fantasy_sound_w )
#define HD68880_SYBS 0x0f
-static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 *table, int start)
+static void snk6502_speech_w(running_machine &machine, UINT8 data, const UINT16 *table, int start)
{
/*
bit description
@@ -1084,7 +1084,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16
7
*/
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
@@ -1237,7 +1237,7 @@ WRITE8_HANDLER( vanguard_speech_w )
0x054ce
};
- snk6502_speech_w(space->machine, data, vanguard_table, 2);
+ snk6502_speech_w(space->machine(), data, vanguard_table, 2);
}
WRITE8_HANDLER( fantasy_speech_w )
@@ -1262,7 +1262,7 @@ WRITE8_HANDLER( fantasy_speech_w )
0
};
- snk6502_speech_w(space->machine, data, fantasy_table, 0);
+ snk6502_speech_w(space->machine(), data, fantasy_table, 0);
}
diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c
index 27e9c12a3ea..5ebba454cb9 100644
--- a/src/mame/audio/spacefb.c
+++ b/src/mame/audio/spacefb.c
@@ -13,31 +13,31 @@
READ8_HANDLER( spacefb_audio_p2_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return (state->sound_latch & 0x18) << 1;
}
READ8_HANDLER( spacefb_audio_t0_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return state->sound_latch & 0x20;
}
READ8_HANDLER( spacefb_audio_t1_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return state->sound_latch & 0x04;
}
WRITE8_HANDLER( spacefb_port_1_w )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
- device_t *samples = space->machine->device("samples");
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
+ device_t *samples = space->machine().device("samples");
- cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
/* enemy killed */
if (!(data & 0x01) && (state->sound_latch & 0x01)) sample_start(samples, 0,0,0);
diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c
index 48f883f64a9..76e1c2d0123 100644
--- a/src/mame/audio/starwars.c
+++ b/src/mame/audio/starwars.c
@@ -18,8 +18,8 @@
SOUND_START( starwars )
{
- starwars_state *state = machine->driver_data<starwars_state>();
- state->riot = machine->device("riot");
+ starwars_state *state = machine.driver_data<starwars_state>();
+ state->riot = machine.device("riot");
}
@@ -44,7 +44,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
/* Note: bit 4 is always set to avoid sound self test */
UINT8 olddata = riot6532_porta_in_get(device);
- return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine->device("tms")) << 2);
+ return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine().device("tms")) << 2);
}
@@ -59,7 +59,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
static WRITE_LINE_DEVICE_HANDLER( snd_interrupt )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, state);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, state);
}
@@ -83,16 +83,16 @@ const riot6532_interface starwars_riot6532_intf =
static TIMER_CALLBACK( sound_callback )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x40, 0x40);
state->main_data = param;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
READ8_HANDLER( starwars_sin_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0x80);
return state->sound_data;
}
@@ -100,7 +100,7 @@ READ8_HANDLER( starwars_sin_r )
WRITE8_HANDLER( starwars_sout_w )
{
- space->machine->scheduler().synchronize(FUNC(sound_callback), data);
+ space->machine().scheduler().synchronize(FUNC(sound_callback), data);
}
@@ -113,7 +113,7 @@ WRITE8_HANDLER( starwars_sout_w )
READ8_HANDLER( starwars_main_read_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0x40);
return state->main_data;
}
@@ -121,32 +121,32 @@ READ8_HANDLER( starwars_main_read_r )
READ8_HANDLER( starwars_main_ready_flag_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
return riot6532_porta_in_get(state->riot) & 0xc0; /* only upper two flag bits mapped */
}
static TIMER_CALLBACK( main_callback )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
if (riot6532_porta_in_get(state->riot) & 0x80)
logerror("Sound data not read %x\n",state->sound_data);
riot6532_porta_in_set(state->riot, 0x80, 0x80);
state->sound_data = param;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
WRITE8_HANDLER( starwars_main_wr_w )
{
- space->machine->scheduler().synchronize(FUNC(main_callback), data);
+ space->machine().scheduler().synchronize(FUNC(main_callback), data);
}
WRITE8_HANDLER( starwars_soundrst_w )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0xc0);
/* reset sound CPU here */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
}
diff --git a/src/mame/audio/suna8.c b/src/mame/audio/suna8.c
index 85fa45cc5a0..05275dbcc1b 100644
--- a/src/mame/audio/suna8.c
+++ b/src/mame/audio/suna8.c
@@ -13,7 +13,7 @@
WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if( data )
{
if( ~data & 0x10 )
@@ -30,7 +30,7 @@ WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if( data )
{
if(( state->sample != 0 ) && ( ~data & 0x30 )) // don't play state->sample zero when the bit is active
@@ -42,16 +42,16 @@ WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
WRITE8_DEVICE_HANDLER( suna8_samples_number_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
state->sample = data & 0xf;
}
SAMPLES_START( suna8_sh_start )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
- running_machine *machine = device->machine;
- int i, len = machine->region("samples")->bytes();
- UINT8 *ROM = machine->region("samples")->base();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
+ running_machine &machine = device->machine();
+ int i, len = machine.region("samples")->bytes();
+ UINT8 *ROM = machine.region("samples")->base();
state->samplebuf = auto_alloc_array(machine, INT16, len);
diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c
index 432501def0f..46e263e74cd 100644
--- a/src/mame/audio/t5182.c
+++ b/src/mame/audio/t5182.c
@@ -199,7 +199,7 @@ static TIMER_CALLBACK( setirq_callback )
break;
}
- cpu = machine->device(CPUTAG_T5182);
+ cpu = machine.device(CPUTAG_T5182);
if (cpu == NULL)
return;
@@ -214,25 +214,25 @@ static TIMER_CALLBACK( setirq_callback )
WRITE8_HANDLER( t5182_sound_irq_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
}
static WRITE8_HANDLER( t5182_ym2151_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
}
static WRITE8_HANDLER( t5182_cpu_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
}
static void t5182_ym2151_irq_handler(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_CLEAR);
}
diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c
index 2dac10af581..3f6936cc780 100644
--- a/src/mame/audio/taito_en.c
+++ b/src/mame/audio/taito_en.c
@@ -44,7 +44,7 @@ static WRITE16_HANDLER(f3_68000_share_w)
static WRITE16_HANDLER( f3_es5505_bank_w )
{
- UINT32 max_banks_this_game=(space->machine->region("ensoniq.0")->bytes()/0x200000)-1;
+ UINT32 max_banks_this_game=(space->machine().region("ensoniq.0")->bytes()/0x200000)-1;
#if 0
{
@@ -56,7 +56,7 @@ static WRITE16_HANDLER( f3_es5505_bank_w )
/* mask out unused bits */
data &= max_banks_this_game;
- es5505_voice_bank_w(space->machine->device("ensoniq"),offset,data<<20);
+ es5505_voice_bank_w(space->machine().device("ensoniq"),offset,data<<20);
}
static WRITE16_HANDLER( f3_volume_w )
@@ -82,8 +82,8 @@ static TIMER_DEVICE_CALLBACK( taito_en_timer_callback )
/* Only cause IRQ if the mask is set to allow it */
if (m68681_imr & 0x08)
{
- device_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
- cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE);
+ device_set_input_line_vector(timer.machine().device("audiocpu"), 6, vector_reg);
+ cputag_set_input_line(timer.machine(), "audiocpu", 6, ASSERT_LINE);
imr_status |= 0x08;
}
}
@@ -103,7 +103,7 @@ static READ16_HANDLER(f3_68681_r)
/* IRQ ack */
if (offset == 0x0f)
{
- cputag_set_input_line(space->machine, "audiocpu", 6, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 6, CLEAR_LINE);
return 0;
}
@@ -128,7 +128,7 @@ static WRITE16_HANDLER(f3_68681_w)
case 3:
logerror("Counter: X1/Clk - divided by 16, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter*16);
timer_mode=TIMER_SINGLESHOT;
- timer = space->machine->device<timer_device>("timer_68681");
+ timer = space->machine().device<timer_device>("timer_68681");
timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter*16));
break;
case 4:
@@ -140,7 +140,7 @@ static WRITE16_HANDLER(f3_68681_w)
case 6:
logerror("Timer: X1/Clk, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter);
timer_mode=TIMER_PULSE;
- timer = space->machine->device<timer_device>("timer_68681");
+ timer = space->machine().device<timer_device>("timer_68681");
timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter), 0, downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter));
break;
case 7:
@@ -187,7 +187,7 @@ static READ16_HANDLER(es5510_dsp_r)
*/
// offset<<=1;
-//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine->rand()%0xffff;
+//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine().rand()%0xffff;
if (offset==0x12) return 0;
@@ -199,7 +199,7 @@ static READ16_HANDLER(es5510_dsp_r)
static WRITE16_HANDLER(es5510_dsp_w)
{
- UINT8 *snd_mem = (UINT8 *)space->machine->region("ensoniq.0")->base();
+ UINT8 *snd_mem = (UINT8 *)space->machine().region("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(space->cpu),offset,data);
@@ -257,7 +257,7 @@ ADDRESS_MAP_END
SOUND_RESET( taito_f3_soundsystem_reset )
{
/* Sound cpu program loads to 0xc00000 so we use a bank */
- UINT16 *ROM = (UINT16 *)machine->region("audiocpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("audiocpu")->base();
memory_set_bankptr(machine, "bank1",&ROM[0x80000]);
memory_set_bankptr(machine, "bank2",&ROM[0x90000]);
memory_set_bankptr(machine, "bank3",&ROM[0xa0000]);
@@ -268,10 +268,10 @@ SOUND_RESET( taito_f3_soundsystem_reset )
sound_ram[3]=ROM[0x80003];
/* reset CPU to catch any banking of startup vectors */
- machine->device("audiocpu")->reset();
+ machine.device("audiocpu")->reset();
//cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
- f3_shared_ram = (UINT32 *)memory_get_shared(*machine, "f3_shared");
+ f3_shared_ram = (UINT32 *)memory_get_shared(machine, "f3_shared");
}
static const es5505_interface es5505_taito_f3_config =
diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c
index 6c87c9fb287..3bca8a8a6fe 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -290,8 +290,8 @@ static DEVICE_START( tc0140syt )
const tc0140syt_interface *intf = get_interface(device);
/* use the given gfx set */
- tc0140syt->mastercpu = device->machine->device(intf->master);
- tc0140syt->slavecpu = device->machine->device(intf->slave);
+ tc0140syt->mastercpu = device->machine().device(intf->master);
+ tc0140syt->slavecpu = device->machine().device(intf->slave);
device->save_item(NAME(tc0140syt->mainmode));
device->save_item(NAME(tc0140syt->submode));
diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c
index 49be8db1ef6..e86b4330a98 100644
--- a/src/mame/audio/targ.c
+++ b/src/mame/audio/targ.c
@@ -61,11 +61,11 @@ static void adjust_sample(device_t *samples, UINT8 freq)
WRITE8_HANDLER( targ_audio_1_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
/* CPU music */
if ((data & 0x01) != (port_1_last & 0x01))
- dac_data_w(space->machine->device("dac"),(data & 0x01) * 0xff);
+ dac_data_w(space->machine().device("dac"),(data & 0x01) * 0xff);
/* shot */
if (FALLING_EDGE(0x02) && !sample_playing(samples, 0)) sample_start(samples, 0,1,0);
@@ -114,8 +114,8 @@ WRITE8_HANDLER( targ_audio_2_w )
{
if ((data & 0x01) && !(port_2_last & 0x01))
{
- device_t *samples = space->machine->device("samples");
- UINT8 *prom = space->machine->region("targ")->base();
+ device_t *samples = space->machine().device("samples");
+ UINT8 *prom = space->machine().region("targ")->base();
tone_pointer = (tone_pointer + 1) & 0x0f;
@@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w )
WRITE8_HANDLER( spectar_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
adjust_sample(samples, data);
}
@@ -145,9 +145,9 @@ static const char *const sample_names[] =
};
-static void common_audio_start(running_machine *machine, int freq)
+static void common_audio_start(running_machine &machine, int freq)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
max_freq = freq;
tone_freq = 0;
@@ -165,14 +165,14 @@ static void common_audio_start(running_machine *machine, int freq)
static SAMPLES_START( spectar_audio_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
common_audio_start(machine, SPECTAR_MAXFREQ);
}
static SAMPLES_START( targ_audio_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
common_audio_start(machine, TARG_MAXFREQ);
tone_pointer = 0;
diff --git a/src/mame/audio/tiamc1.c b/src/mame/audio/tiamc1.c
index cfbf1c7e89d..15428631c2c 100644
--- a/src/mame/audio/tiamc1.c
+++ b/src/mame/audio/tiamc1.c
@@ -300,13 +300,13 @@ static STREAM_UPDATE( tiamc1_sound_update )
static DEVICE_START( tiamc1_sound )
{
tiamc1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j;
timer8253_reset(&state->timer0);
timer8253_reset(&state->timer1);
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, 0, tiamc1_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, 0, tiamc1_sound_update);
state->timer1_divider = 0;
diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c
index 87e2f93d3f4..1cfa9c8d9ac 100644
--- a/src/mame/audio/timeplt.c
+++ b/src/mame/audio/timeplt.c
@@ -50,16 +50,16 @@ INLINE timeplt_audio_state *get_safe_token( device_t *device )
static DEVICE_START( timeplt_audio )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
timeplt_audio_state *state = get_safe_token(device);
- state->soundcpu = machine->device<cpu_device>("tpsound");
- state->filter_0_0 = machine->device("filter.0.0");
- state->filter_0_1 = machine->device("filter.0.1");
- state->filter_0_2 = machine->device("filter.0.2");
- state->filter_1_0 = machine->device("filter.1.0");
- state->filter_1_1 = machine->device("filter.1.1");
- state->filter_1_2 = machine->device("filter.1.2");
+ state->soundcpu = machine.device<cpu_device>("tpsound");
+ state->filter_0_0 = machine.device("filter.0.0");
+ state->filter_0_1 = machine.device("filter.0.1");
+ state->filter_0_2 = machine.device("filter.0.2");
+ state->filter_1_0 = machine.device("filter.1.0");
+ state->filter_1_1 = machine.device("filter.1.1");
+ state->filter_1_2 = machine.device("filter.1.2");
state->last_irq_state = 0;
device->save_item(NAME(state->last_irq_state));
@@ -145,7 +145,7 @@ static WRITE8_DEVICE_HANDLER( timeplt_filter_w )
WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
{
- device_t *audio = space->machine->device("timeplt_audio");
+ device_t *audio = space->machine().device("timeplt_audio");
timeplt_audio_state *state = get_safe_token(audio);
if (state->last_irq_state == 0 && data)
diff --git a/src/mame/audio/trackfld.c b/src/mame/audio/trackfld.c
index 7b5c98f2575..0fa832aa6a2 100644
--- a/src/mame/audio/trackfld.c
+++ b/src/mame/audio/trackfld.c
@@ -42,8 +42,8 @@ static DEVICE_START( trackfld_audio )
{
trackfld_audio_state *state = get_safe_token(device);
- state->audiocpu = device->machine->device<cpu_device>("audiocpu");
- state->vlm = device->machine->device("vlm");
+ state->audiocpu = device->machine().device<cpu_device>("audiocpu");
+ state->vlm = device->machine().device("vlm");
/* sound */
device->save_item(NAME(state->SN76496_latch));
@@ -75,7 +75,7 @@ static DEVICE_RESET( trackfld_audio )
READ8_HANDLER( trackfld_sh_timer_r )
{
- UINT32 clock = space->machine->device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
+ UINT32 clock = space->machine().device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
return clock & 0xF;
}
@@ -87,7 +87,7 @@ READ8_DEVICE_HANDLER( trackfld_speech_r )
WRITE8_DEVICE_HANDLER( trackfld_sound_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->last_addr;
@@ -108,7 +108,7 @@ WRITE8_DEVICE_HANDLER( trackfld_sound_w )
READ8_HANDLER( hyperspt_sh_timer_r )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
UINT32 clock = state->audiocpu->total_cycles() / TIMER_RATE;
@@ -120,7 +120,7 @@ READ8_HANDLER( hyperspt_sh_timer_r )
WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->last_addr;
@@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
WRITE8_HANDLER( konami_sh_irqtrigger_w )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
if (state->last_irq == 0 && data)
{
@@ -160,7 +160,7 @@ WRITE8_HANDLER( konami_sh_irqtrigger_w )
WRITE8_HANDLER( konami_SN76496_latch_w )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
state->SN76496_latch = data;
}
@@ -168,7 +168,7 @@ WRITE8_HANDLER( konami_SN76496_latch_w )
WRITE8_DEVICE_HANDLER( konami_SN76496_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
sn76496_w(device, offset, state->SN76496_latch);
}
diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c
index 94fa637667c..4d19580f7e8 100644
--- a/src/mame/audio/turbo.c
+++ b/src/mame/audio/turbo.c
@@ -39,7 +39,7 @@ static void turbo_update_samples(turbo_state *state, device_t *samples)
static TIMER_CALLBACK( update_sound_a )
{
- device_t *discrete = machine->device("discrete");
+ device_t *discrete = machine.device("discrete");
int data = param;
/* missing short crash sample, but I've never seen it triggered */
@@ -72,9 +72,9 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n");
WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
{
#if (!DISCRETE_TEST)
- device_t *samples = device->machine->device("samples");
+ device_t *samples = device->machine().device("samples");
#endif
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -110,7 +110,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
#else
if (((data ^ state->last_sound_a) & 0x1e) && (state->last_sound_a & 0x1e) != 0x1e)
- space->machine->scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
+ space->machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
else
update_sound_a(data);
@@ -122,8 +122,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -145,8 +145,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
/* OSEL1-2 */
state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
@@ -296,7 +296,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
{
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->sound_state[0] = data;
/* DIS0-3 contained in bits 0-3 */
@@ -326,8 +326,8 @@ INLINE void subroc3d_update_volume(device_t *samples, int leftchan, UINT8 dis, U
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -382,8 +382,8 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@@ -414,7 +414,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
sample_set_volume(samples, 11, (data & 0x40) ? 0 : 1.0);
/* /GAME START */
- device->machine->sound().system_mute(data & 0x80);
+ device->machine().sound().system_mute(data & 0x80);
}
@@ -507,8 +507,8 @@ static void buckrog_update_samples(turbo_state *state, device_t *samples)
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -533,8 +533,8 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -569,7 +569,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
if ((diff & 0x40) && !(data & 0x40) && sample_playing(samples, 5)) sample_stop(samples, 5);
/* GAME ON */
- device->machine->sound().system_enable(data & 0x80);
+ device->machine().sound().system_enable(data & 0x80);
}
diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c
index ec883bce3d1..f38e183b613 100644
--- a/src/mame/audio/tx1.c
+++ b/src/mame/audio/tx1.c
@@ -294,15 +294,15 @@ static STREAM_UPDATE( tx1_stream_update )
static DEVICE_START( tx1_sound )
{
tx1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
static const int r1[3] = { 180e3, 390e3, 56e3 };
static const int r2[3] = { 390e3, 390e3, 180e3 };
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, tx1_stream_update);
- state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), NULL, tx1_stream_update);
+ state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine.sample_rate();
/* Compute the engine resistor weights */
compute_resistor_weights(0, 10000, -1.0,
@@ -434,18 +434,18 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w )
WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
{
tx1_sound_state *state = get_safe_token(device);
- device_t *ym1 = device->machine->device("ym1");
- device_t *ym2 = device->machine->device("ym2");
+ device_t *ym1 = device->machine().device("ym1");
+ device_t *ym2 = device->machine().device("ym2");
double gain;
state->stream->update();
state->ym2_outputb = data ^ 0xff;
- if (!strcmp(device->machine->system().name, "buggyboyjr"))
+ if (!strcmp(device->machine().system().name, "buggyboyjr"))
{
- coin_counter_w(device->machine, 0, data & 0x01);
- coin_counter_w(device->machine, 1, data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x01);
+ coin_counter_w(device->machine(), 1, data & 0x02);
}
/*
@@ -489,7 +489,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
step_0 = state->pit8253.counts[0].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[0].val) * state->freq_to_step : 0;
step_1 = state->pit8253.counts[1].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[1].val) * state->freq_to_step : 0;
- if (!strcmp(device->machine->system().name, "buggyboyjr"))
+ if (!strcmp(device->machine().system().name, "buggyboyjr"))
gain0 = BIT(state->ym2_outputb, 3) ? 1.0 : 2.0;
else
gain0 = BIT(state->ym1_outputa, 3) ? 1.0 : 2.0;
@@ -508,7 +508,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
pit1 = state->eng_voltages[(state->step1 >> 24) & 0xf];
/* Calculate the tyre screech noise source */
- for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine->sample_rate(); ++i)
+ for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine().sample_rate(); ++i)
{
/* CD4006 is a 4-4-1-4-4-1 shift register */
int p13 = BIT(state->noise_lfsra, 3);
@@ -554,7 +554,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
static DEVICE_START( buggyboy_sound )
{
tx1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
static const int resistors[4] = { 330000, 220000, 330000, 220000 };
double aweights[4];
int i;
@@ -572,8 +572,8 @@ static DEVICE_START( buggyboy_sound )
state->eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, buggyboy_stream_update);
- state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), NULL, buggyboy_stream_update);
+ state->freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
}
static DEVICE_RESET( buggyboy_sound )
diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c
index 0272d1ff9de..dce5a79bfda 100644
--- a/src/mame/audio/vicdual.c
+++ b/src/mame/audio/vicdual.c
@@ -132,21 +132,21 @@ MACHINE_CONFIG_END
static TIMER_CALLBACK( frogs_croak_callback )
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
sample_stop(samples, 2);
}
MACHINE_START( frogs_audio )
{
- frogs_croak_timer = machine->scheduler().timer_alloc(FUNC(frogs_croak_callback));
+ frogs_croak_timer = machine.scheduler().timer_alloc(FUNC(frogs_croak_callback));
}
WRITE8_HANDLER( frogs_audio_w )
{
- device_t *samples = space->machine->device("samples");
- device_t *discrete = space->machine->device("discrete");
+ device_t *samples = space->machine().device("samples");
+ device_t *discrete = space->machine().device("discrete");
static int last_croak = 0;
static int last_buzzz = 0;
int new_croak = data & 0x08;
@@ -462,7 +462,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( headon_audio_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
@@ -477,7 +477,7 @@ WRITE8_HANDLER( headon_audio_w )
WRITE8_HANDLER( invho2_audio_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);
diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c
index b9b85267da1..56295fc974d 100644
--- a/src/mame/audio/warpwarp.c
+++ b/src/mame/audio/warpwarp.c
@@ -226,7 +226,7 @@ static STREAM_UPDATE( warpwarp_sound_update )
static DEVICE_START( warpwarp_sound )
{
warpwarp_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i;
state->decay = auto_alloc_array(machine, INT16, 32768);
@@ -234,10 +234,10 @@ static DEVICE_START( warpwarp_sound )
for( i = 0; i < 0x8000; i++ )
state->decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
- state->sound_volume_timer = machine->scheduler().timer_alloc(FUNC(sound_volume_decay), state);
- state->music_volume_timer = machine->scheduler().timer_alloc(FUNC(music_volume_decay), state);
+ state->sound_volume_timer = machine.scheduler().timer_alloc(FUNC(sound_volume_decay), state);
+ state->music_volume_timer = machine.scheduler().timer_alloc(FUNC(music_volume_decay), state);
}
diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c
index 0a01f345577..ca5c807e25e 100644
--- a/src/mame/audio/williams.c
+++ b/src/mame/audio/williams.c
@@ -61,7 +61,7 @@ static device_t *soundalt_cpu;
FUNCTION PROTOTYPES
****************************************************************************/
-static void init_audio_state(running_machine *machine);
+static void init_audio_state(running_machine &machine);
static void cvsd_ym2151_irq(device_t *device, int state);
static void adpcm_ym2151_irq(device_t *device, int state);
@@ -264,17 +264,17 @@ MACHINE_CONFIG_END
INITIALIZATION
****************************************************************************/
-void williams_cvsd_init(running_machine *machine)
+void williams_cvsd_init(running_machine &machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
- sound_cpu = machine->device("cvsdcpu");
+ sound_cpu = machine.device("cvsdcpu");
soundalt_cpu = NULL;
/* configure master CPU banks */
- ROM = machine->region("cvsdcpu")->base();
+ ROM = machine.region("cvsdcpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -288,7 +288,7 @@ void williams_cvsd_init(running_machine *machine)
memory_set_bank(machine, "bank5", 0);
/* reset the IRQ state */
- pia6821_ca1_w(machine->device("cvsdpia"), 1);
+ pia6821_ca1_w(machine.device("cvsdpia"), 1);
/* register for save states */
state_save_register_global(machine, williams_sound_int_state);
@@ -296,17 +296,17 @@ void williams_cvsd_init(running_machine *machine)
}
-void williams_narc_init(running_machine *machine)
+void williams_narc_init(running_machine &machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
- sound_cpu = machine->device("narc1cpu");
- soundalt_cpu = machine->device("narc2cpu");
+ sound_cpu = machine.device("narc1cpu");
+ soundalt_cpu = machine.device("narc2cpu");
/* configure master CPU banks */
- ROM = machine->region("narc1cpu")->base();
+ ROM = machine.region("narc1cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -320,7 +320,7 @@ void williams_narc_init(running_machine *machine)
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* configure slave CPU banks */
- ROM = machine->region("narc2cpu")->base();
+ ROM = machine.region("narc2cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -340,22 +340,22 @@ void williams_narc_init(running_machine *machine)
}
-void williams_adpcm_init(running_machine *machine)
+void williams_adpcm_init(running_machine &machine)
{
UINT8 *ROM;
/* configure the CPU */
- sound_cpu = machine->device("adpcm");
+ sound_cpu = machine.device("adpcm");
soundalt_cpu = NULL;
/* configure banks */
- ROM = machine->region("adpcm")->base();
+ ROM = machine.region("adpcm")->base();
memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x10000], 0x8000);
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
/* expand ADPCM data */
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);
@@ -378,7 +378,7 @@ void williams_adpcm_init(running_machine *machine)
}
-static void init_audio_state(running_machine *machine)
+static void init_audio_state(running_machine &machine)
{
/* reset the YM2151 state */
devtag_reset(machine, "ymsnd");
@@ -407,7 +407,7 @@ static void init_audio_state(running_machine *machine)
static void cvsd_ym2151_irq(device_t *device, int state)
{
- pia6821_ca1_w(device->machine->device("cvsdpia"), !state);
+ pia6821_ca1_w(device->machine().device("cvsdpia"), !state);
}
@@ -441,7 +441,7 @@ static void adpcm_ym2151_irq(device_t *device, int state)
static WRITE8_HANDLER( cvsd_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x0f);
+ memory_set_bank(space->machine(), "bank5", data & 0x0f);
}
@@ -471,16 +471,16 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w )
static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
{
- device_t *pia = machine->device("cvsdpia");
+ device_t *pia = machine.device("cvsdpia");
pia6821_portb_w(pia, 0, param & 0xff);
pia6821_cb1_w(pia, (param >> 8) & 1);
pia6821_cb2_w(pia, (param >> 9) & 1);
}
-void williams_cvsd_data_w(running_machine *machine, int data)
+void williams_cvsd_data_w(running_machine &machine, int data)
{
- machine->scheduler().synchronize(FUNC(williams_cvsd_delayed_data_w), data);
+ machine.scheduler().synchronize(FUNC(williams_cvsd_delayed_data_w), data);
}
@@ -492,7 +492,7 @@ void williams_cvsd_reset_w(int state)
if (state)
{
cvsd_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(space->cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
/* going low resets and reactivates the CPU */
@@ -508,13 +508,13 @@ void williams_cvsd_reset_w(int state)
static WRITE8_HANDLER( narc_master_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x0f);
+ memory_set_bank(space->machine(), "bank5", data & 0x0f);
}
static WRITE8_HANDLER( narc_slave_bank_select_w )
{
- memory_set_bank(space->machine, "bank7", data & 0x0f);
+ memory_set_bank(space->machine(), "bank7", data & 0x0f);
}
@@ -554,7 +554,7 @@ static TIMER_CALLBACK( narc_sync_clear )
static WRITE8_HANDLER( narc_master_sync_w )
{
- space->machine->scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x01);
+ space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x01);
audio_sync |= 0x01;
logerror("Master sync = %02X\n", data);
}
@@ -568,7 +568,7 @@ static WRITE8_HANDLER( narc_slave_talkback_w )
static WRITE8_HANDLER( narc_slave_sync_w )
{
- space->machine->scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x02);
+ space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x02);
audio_sync |= 0x02;
logerror("Slave sync = %02X\n", data);
}
@@ -601,7 +601,7 @@ void williams_narc_reset_w(int state)
address_space *space = sound_cpu->memory().space(AS_PROGRAM);
narc_master_bank_select_w(space, 0, 0);
narc_slave_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -627,7 +627,7 @@ int williams_narc_talkback_r(void)
static WRITE8_HANDLER( adpcm_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x07);
+ memory_set_bank(space->machine(), "bank5", data & 0x07);
}
@@ -649,7 +649,7 @@ static READ8_HANDLER( adpcm_command_r )
/* don't clear the external IRQ state for a short while; this allows the
self-tests to pass */
- space->machine->scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state));
+ space->machine().scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state));
return soundlatch_r(space, 0);
}
@@ -674,7 +674,7 @@ void williams_adpcm_data_w(int data)
{
device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
williams_sound_int_state = 1;
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
}
@@ -686,7 +686,7 @@ void williams_adpcm_reset_w(int state)
{
address_space *space = sound_cpu->memory().space(AS_PROGRAM);
adpcm_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
/* going low resets and reactivates the CPU */
diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h
index dc66bbf1584..1a79bbbb7df 100644
--- a/src/mame/audio/williams.h
+++ b/src/mame/audio/williams.h
@@ -8,16 +8,16 @@ MACHINE_CONFIG_EXTERN( williams_cvsd_sound );
MACHINE_CONFIG_EXTERN( williams_adpcm_sound );
MACHINE_CONFIG_EXTERN( williams_narc_sound );
-void williams_cvsd_init(running_machine *machine);
-void williams_cvsd_data_w(running_machine *machine, int data);
+void williams_cvsd_init(running_machine &machine);
+void williams_cvsd_data_w(running_machine &machine, int data);
void williams_cvsd_reset_w(int state);
-void williams_adpcm_init(running_machine *machine);
+void williams_adpcm_init(running_machine &machine);
void williams_adpcm_data_w(int data);
void williams_adpcm_reset_w(int state);
int williams_adpcm_sound_irq_r(void);
-void williams_narc_init(running_machine *machine);
+void williams_narc_init(running_machine &machine);
void williams_narc_data_w(int data);
void williams_narc_reset_w(int state);
int williams_narc_talkback_r(void);
diff --git a/src/mame/audio/wiping.c b/src/mame/audio/wiping.c
index 20e0b26ac7e..a5404f50061 100644
--- a/src/mame/audio/wiping.c
+++ b/src/mame/audio/wiping.c
@@ -71,7 +71,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -175,11 +175,11 @@ static STREAM_UPDATE( wiping_update_mono )
static DEVICE_START( wiping_sound )
{
wiping_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, NULL, wiping_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, NULL, wiping_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
state->mixer_buffer = auto_alloc_array(machine, short, 2 * samplerate);
@@ -192,8 +192,8 @@ static DEVICE_START( wiping_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom = machine->region("samples")->base();
- state->sound_prom = machine->region("soundproms")->base();
+ state->sound_rom = machine.region("samples")->base();
+ state->sound_prom = machine.region("soundproms")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/wow.c b/src/mame/audio/wow.c
index 68c9cb33d3f..052e47fbb5e 100644
--- a/src/mame/audio/wow.c
+++ b/src/mame/audio/wow.c
@@ -108,7 +108,7 @@ static int plural;
READ8_HANDLER( wow_speech_r )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int Phoneme/*, Intonation*/;
int i = 0;
@@ -177,6 +177,6 @@ READ8_HANDLER( wow_speech_r )
CUSTOM_INPUT( wow_speech_status_r )
{
- device_t *samples = field->port->machine->device("samples");
+ device_t *samples = field->port->machine().device("samples");
return !sample_playing(samples, 0);
}
diff --git a/src/mame/audio/zaxxon.c b/src/mame/audio/zaxxon.c
index 577e2b9affb..875a87df9ab 100644
--- a/src/mame/audio/zaxxon.c
+++ b/src/mame/audio/zaxxon.c
@@ -113,8 +113,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -149,8 +149,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -167,8 +167,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@@ -225,8 +225,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( congo_sound_b_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -239,8 +239,8 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w )
WRITE8_DEVICE_HANDLER( congo_sound_c_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index 205d76fa691..029f351be78 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -71,7 +71,7 @@ correctly.
static WRITE8_HANDLER( c1942_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static TIMER_DEVICE_CALLBACK( c1942_scanline )
@@ -79,10 +79,10 @@ static TIMER_DEVICE_CALLBACK( c1942_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // unknown irq event, presumably vblank-in or a periodic one (writes to the soundlatch and drives freeze dip-switch)
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
}
@@ -238,9 +238,9 @@ GFXDECODE_END
static MACHINE_START( 1942 )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->palette_bank));
state->save_item(NAME(state->scroll));
@@ -248,7 +248,7 @@ static MACHINE_START( 1942 )
static MACHINE_RESET( 1942 )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
state->palette_bank = 0;
state->scroll[0] = 0;
@@ -506,7 +506,7 @@ ROM_END
static DRIVER_INIT( 1942 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x4000);
}
diff --git a/src/mame/drivers/1943.c b/src/mame/drivers/1943.c
index b4185095240..89d1ca92957 100644
--- a/src/mame/drivers/1943.c
+++ b/src/mame/drivers/1943.c
@@ -248,7 +248,7 @@ GFXDECODE_END
static MACHINE_RESET( 1943 )
{
- _1943_state *state = machine->driver_data<_1943_state>();
+ _1943_state *state = machine.driver_data<_1943_state>();
state->char_on = 0;
state->obj_on = 0;
@@ -589,7 +589,7 @@ ROM_END
static DRIVER_INIT( 1943 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 29, &ROM[0x10000], 0x1000);
memory_configure_bank(machine, "bank2", 0, 29, &ROM[0x11000], 0x1000);
memory_configure_bank(machine, "bank3", 0, 29, &ROM[0x12000], 0x1000);
@@ -603,7 +603,7 @@ static DRIVER_INIT( 1943b )
DRIVER_INIT_CALL( 1943 );
//it expects 0x00 to be returned from the protection reads because the protection has been patched out.
//AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc007, 0xc007, FUNC(_1943b_c007_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc007, 0xc007, FUNC(_1943b_c007_r));
}
diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c
index 5e8c92a2b5f..1ecb6528cda 100644
--- a/src/mame/drivers/1945kiii.c
+++ b/src/mame/drivers/1945kiii.c
@@ -72,28 +72,28 @@ public:
static WRITE16_HANDLER( k3_bgram_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
COMBINE_DATA(&state->bgram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_k3_bg_tile_info )
{
- k3_state *state = machine->driver_data<k3_state>();
+ k3_state *state = machine.driver_data<k3_state>();
int tileno = state->bgram[tile_index];
SET_TILE_INFO(1, tileno, 0, 0);
}
static VIDEO_START(k3)
{
- k3_state *state = machine->driver_data<k3_state>();
+ k3_state *state = machine.driver_data<k3_state>();
state->bg_tilemap = tilemap_create(machine, get_k3_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 64);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- k3_state *state = machine->driver_data<k3_state>();
- const gfx_element *gfx = machine->gfx[0];
+ k3_state *state = machine.driver_data<k3_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT16 *source = state->spriteram_1;
UINT16 *source2 = state->spriteram_2;
UINT16 *finish = source + 0x1000 / 2;
@@ -118,28 +118,28 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(k3)
{
- k3_state *state = screen->machine->driver_data<k3_state>();
+ k3_state *state = screen->machine().driver_data<k3_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( k3_scrollx_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_scrolly_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_soundbanks_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
state->oki1->set_bank_base((data & 4) ? 0x40000 : 0);
state->oki2->set_bank_base((data & 2) ? 0x40000 : 0);
}
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index 7420a705e93..0b8594a2cca 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -76,7 +76,7 @@
static WRITE8_HANDLER( irqack_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
int bit = data & 1;
cpu_interrupt_enable(state->maincpu, bit);
@@ -87,7 +87,7 @@ static WRITE8_HANDLER( irqack_w )
static WRITE8_HANDLER( timer_pulse_w )
{
- //_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ //_20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
//printf("timer pulse %02x\n", data);
}
@@ -131,7 +131,7 @@ static const eeprom_interface _20pacgal_eeprom_intf =
static WRITE8_HANDLER( _20pacgal_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -142,12 +142,12 @@ static WRITE8_HANDLER( _20pacgal_coin_counter_w )
*
*************************************/
-static void set_bankptr(running_machine *machine)
+static void set_bankptr(running_machine &machine)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
if (state->game_selected == 0)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", rom + 0x08000);
}
else
@@ -156,15 +156,15 @@ static void set_bankptr(running_machine *machine)
static WRITE8_HANDLER( ram_bank_select_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->game_selected = data & 1;
- set_bankptr(space->machine);
+ set_bankptr(space->machine());
}
static WRITE8_HANDLER( ram_48000_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
if (state->game_selected)
{
@@ -188,19 +188,19 @@ static STATE_POSTLOAD( postload_20pacgal )
static WRITE8_HANDLER( sprite_gfx_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_gfx_ram[offset] = data;
}
static WRITE8_HANDLER( sprite_ram_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_ram[offset] = data;
}
static WRITE8_HANDLER( sprite_lookup_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_color_lookup[offset] = data;
}
@@ -331,19 +331,19 @@ INPUT_PORTS_END
static MACHINE_START( 20pacgal )
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
- state->maincpu = machine->device("maincpu");
- state->eeprom = machine->device("eeprom");
+ state->maincpu = machine.device("maincpu");
+ state->eeprom = machine.device("eeprom");
state->save_item(NAME(state->game_selected));
state->save_item(NAME(state->ram_48000));
- machine->state().register_postload(postload_20pacgal, NULL);
+ machine.state().register_postload(postload_20pacgal, NULL);
}
static MACHINE_RESET( 20pacgal )
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->game_selected = 0;
}
@@ -451,14 +451,14 @@ ROM_END
static DRIVER_INIT(20pacgal)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->sprite_pal_base = 0x00<<2;
}
static DRIVER_INIT(25pacman)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->sprite_pal_base = 0x20<<2;
}
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index 311457b00d7..af9efdfc56e 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -83,7 +83,7 @@ public:
UINT16 data0 = map[y * 128 + x * 2]; \
UINT16 data1 = map[y * 128 + x * 2 + 1]; \
drawgfx_transpen(bitmap, \
- cliprect,screen->machine->gfx[0], data1, \
+ cliprect,screen->machine().gfx[0], data1, \
data0 & 0xff, \
data0 & 0x4000, data0 & 0x8000, \
x * 16 - 512 /*+(((INT16)(state->unkram[0x60000 / 2 + num])) / 32)*/, \
@@ -93,7 +93,7 @@ public:
static SCREEN_UPDATE( drill )
{
- _2mindril_state *state = screen->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = screen->machine().driver_data<_2mindril_state>();
bitmap_fill(bitmap, NULL, 0);
DRAW_MAP(state->map1ram, 0)
@@ -108,7 +108,7 @@ static SCREEN_UPDATE( drill )
{
drawgfx_transpen( bitmap,
cliprect,
- screen->machine->gfx[1],
+ screen->machine().gfx[1],
state->textram[y * 64 + x] & 0xff, //1ff ??
((state->textram[y * 64 + x] >> 9) & 0xf),
0, 0,
@@ -122,15 +122,15 @@ static SCREEN_UPDATE( drill )
static VIDEO_START( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
- machine->gfx[0]->color_granularity = 16;
- gfx_element_set_source(machine->gfx[1], (UINT8 *)state->charram);
+ machine.gfx[0]->color_granularity = 16;
+ gfx_element_set_source(machine.gfx[1], (UINT8 *)state->charram);
}
static READ16_HANDLER( drill_io_r )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
// if (offset * 2 == 0x4)
/*popmessage("PC=%08x %04x %04x %04x %04x %04x %04x %04x %04x", cpu_get_pc(space->cpu), state->iodata[0/2], state->iodata[2/2], state->iodata[4/2], state->iodata[6/2],
@@ -138,10 +138,10 @@ static READ16_HANDLER( drill_io_r )
switch(offset)
{
- case 0x0/2: return input_port_read(space->machine, "DSW");
+ case 0x0/2: return input_port_read(space->machine(), "DSW");
case 0x2/2:
{
- int arm_pwr = input_port_read(space->machine, "IN0");//throw
+ int arm_pwr = input_port_read(space->machine(), "IN0");//throw
//popmessage("PC=%08x %02x",cpu_get_pc(space->cpu),arm_pwr);
if(arm_pwr > 0xe0) return ~0x1800;
@@ -151,7 +151,7 @@ static READ16_HANDLER( drill_io_r )
else return ~0x0000;
}
case 0x4/2: return (state->defender_sensor) | (state->shutter_sensor);
- case 0xe/2: return input_port_read(space->machine, "IN2");//coins
+ case 0xe/2: return input_port_read(space->machine(), "IN2");//coins
// default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(space->cpu), offset * 2, state->iodata[offset]);
}
@@ -160,16 +160,16 @@ static READ16_HANDLER( drill_io_r )
static WRITE16_HANDLER( drill_io_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
COMBINE_DATA(&state->iodata[offset]);
switch(offset)
{
case 0x8/2:
- coin_counter_w(space->machine, 0, state->iodata[offset] & 0x0400);
- coin_counter_w(space->machine, 1, state->iodata[offset] & 0x0800);
- coin_lockout_w(space->machine, 0, ~state->iodata[offset] & 0x0100);
- coin_lockout_w(space->machine, 1, ~state->iodata[offset] & 0x0200);
+ coin_counter_w(space->machine(), 0, state->iodata[offset] & 0x0400);
+ coin_counter_w(space->machine(), 1, state->iodata[offset] & 0x0800);
+ coin_lockout_w(space->machine(), 0, ~state->iodata[offset] & 0x0100);
+ coin_lockout_w(space->machine(), 1, ~state->iodata[offset] & 0x0200);
break;
}
@@ -194,52 +194,52 @@ static WRITE16_HANDLER( drill_io_w )
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( shutter_req )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->shutter_sensor = param;
}
static TIMER_CALLBACK( defender_req )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->defender_sensor = param;
}
#endif
static WRITE16_HANDLER( sensors_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
/*---- xxxx ---- ---- select "lamps" (guess)*/
/*---- ---- ---- -x-- lamp*/
if (data & 1)
{
- //space->machine->scheduler().timer_set(attotime::from_seconds(2), FUNC(shutter_req ), 0x100);
+ //space->machine().scheduler().timer_set(attotime::from_seconds(2), FUNC(shutter_req ), 0x100);
state->shutter_sensor = 0x100;
}
else if (data & 2)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(shutter_req ), 0x200);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(shutter_req ), 0x200);
state->shutter_sensor = 0x200;
}
if (data & 0x1000 || data & 0x4000)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x800);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x800);
state->defender_sensor = 0x800;
}
else if (data & 0x2000 || data & 0x8000)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x400);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x400);
state->defender_sensor = 0x400;
}
}
static WRITE16_HANDLER( charram_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
COMBINE_DATA(&state->charram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[1], offset / 16);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset / 16);
}
static ADDRESS_MAP_START( drill_map, AS_PROGRAM, 16 )
@@ -414,7 +414,7 @@ static INTERRUPT_GEN( drill_interrupt )
/* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/
static void irqhandler(device_t *device, int irq)
{
-// _2mindril_state *state = machine->driver_data<_2mindril_state>();
+// _2mindril_state *state = machine.driver_data<_2mindril_state>();
// device_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -426,9 +426,9 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->defender_sensor));
state->save_item(NAME(state->shutter_sensor));
@@ -436,7 +436,7 @@ static MACHINE_START( drill )
static MACHINE_RESET( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->defender_sensor = 0;
state->shutter_sensor = 0;
@@ -494,9 +494,9 @@ ROM_END
static DRIVER_INIT( drill )
{
// rearrange gfx roms to something we can decode, two of the roms form 4bpp of the graphics, the third forms another 2bpp but is in a different format
- UINT32 *src = (UINT32*)machine->region( "gfx2" )->base();
- UINT32 *dst = (UINT32*)machine->region( "gfx1" )->base();// + 0x400000;
-// UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT32 *src = (UINT32*)machine.region( "gfx2" )->base();
+ UINT32 *dst = (UINT32*)machine.region( "gfx1" )->base();// + 0x400000;
+// UINT8 *rom = machine.region( "maincpu" )->base();
int i;
for (i = 0; i < 0x400000 / 4; i++)
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index 930cedfa9ee..246e5ad10ac 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -57,20 +57,20 @@ public:
};
-static void pxa255_dma_irq_check(running_machine* machine);
+static void pxa255_dma_irq_check(running_machine& machine);
static READ32_HANDLER( pxa255_dma_r );
static WRITE32_HANDLER( pxa255_dma_w );
static READ32_HANDLER( pxa255_i2s_r );
static WRITE32_HANDLER( pxa255_i2s_w );
-static void pxa255_ostimer_irq_check(running_machine* machine);
+static void pxa255_ostimer_irq_check(running_machine& machine);
static TIMER_CALLBACK( pxa255_ostimer_match );
static READ32_HANDLER( pxa255_ostimer_r );
static WRITE32_HANDLER( pxa255_ostimer_w );
-static void pxa255_update_interrupts(running_machine* machine);
-static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int state);
+static void pxa255_update_interrupts(running_machine& machine);
+static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int state);
static READ32_HANDLER( pxa255_intc_r );
static WRITE32_HANDLER( pxa255_intc_w );
@@ -78,15 +78,15 @@ static READ32_HANDLER( pxa255_gpio_r );
static WRITE32_HANDLER( pxa255_gpio_w );
static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel);
-static void pxa255_lcd_irq_check(running_machine* machine);
-static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel);
-static void pxa255_lcd_check_load_next_branch(running_machine* machine, int channel);
+static void pxa255_lcd_irq_check(running_machine& machine);
+static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel);
+static void pxa255_lcd_check_load_next_branch(running_machine& machine, int channel);
static READ32_HANDLER( pxa255_lcd_r );
static WRITE32_HANDLER( pxa255_lcd_w );
#define VERBOSE_LEVEL ( 3 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level, const char* s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level, const char* s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -95,8 +95,8 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
- //printf( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
+ //printf( "%s: %s", machine.describe_context(), buf );
}
}
@@ -110,34 +110,34 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level,
static READ32_HANDLER( pxa255_i2s_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
switch(PXA255_I2S_BASE_ADDR | (offset << 2))
{
case PXA255_SACR0:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller Global Control Register: %08x & %08x\n", i2s_regs->sacr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller Global Control Register: %08x & %08x\n", i2s_regs->sacr0, mem_mask );
return i2s_regs->sacr0;
case PXA255_SACR1:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", i2s_regs->sacr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", i2s_regs->sacr1, mem_mask );
return i2s_regs->sacr1;
case PXA255_SASR0:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", i2s_regs->sasr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", i2s_regs->sasr0, mem_mask );
return i2s_regs->sasr0;
case PXA255_SAIMR:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Interrupt Mask Register: %08x & %08x\n", i2s_regs->saimr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Interrupt Mask Register: %08x & %08x\n", i2s_regs->saimr, mem_mask );
return i2s_regs->saimr;
case PXA255_SAICR:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Interrupt Clear Register: %08x & %08x\n", i2s_regs->saicr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Interrupt Clear Register: %08x & %08x\n", i2s_regs->saicr, mem_mask );
return i2s_regs->saicr;
case PXA255_SADIV:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Clock Divider Register: %08x & %08x\n", i2s_regs->sadiv, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Clock Divider Register: %08x & %08x\n", i2s_regs->sadiv, mem_mask );
return i2s_regs->sadiv;
case PXA255_SADR:
- verboselog( space->machine, 5, "pxa255_i2s_r: Serial Audio Data Register: %08x & %08x\n", i2s_regs->sadr, mem_mask );
+ verboselog( space->machine(), 5, "pxa255_i2s_r: Serial Audio Data Register: %08x & %08x\n", i2s_regs->sadr, mem_mask );
return i2s_regs->sadr;
default:
- verboselog( space->machine, 0, "pxa255_i2s_r: Unknown address: %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_i2s_r: Unknown address: %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -145,7 +145,7 @@ static READ32_HANDLER( pxa255_i2s_r )
static WRITE32_HANDLER( pxa255_i2s_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
#if 0
@@ -166,23 +166,23 @@ static WRITE32_HANDLER( pxa255_i2s_w )
switch(PXA255_I2S_BASE_ADDR | (offset << 2))
{
case PXA255_SACR0:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller Global Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller Global Control Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sacr0 = data & 0x0000ff3d;
break;
case PXA255_SACR1:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sacr1 = data & 0x00000039;
break;
case PXA255_SASR0:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sasr0 = data & 0x0000ff7f;
break;
case PXA255_SAIMR:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Interrupt Mask Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Interrupt Mask Register: %08x & %08x\n", data, mem_mask );
i2s_regs->saimr = data & 0x00000078;
break;
case PXA255_SAICR:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Interrupt Clear Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Interrupt Clear Register: %08x & %08x\n", data, mem_mask );
if(i2s_regs->saicr & PXA255_SAICR_ROR)
{
i2s_regs->sasr0 &= ~PXA255_SASR0_ROR;
@@ -193,13 +193,13 @@ static WRITE32_HANDLER( pxa255_i2s_w )
}
break;
case PXA255_SADIV:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Clock Divider Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Clock Divider Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sadiv = data & 0x0000007f;
dmadac_set_frequency(&state->dmadac[0], 2, ((double)147600000 / (double)i2s_regs->sadiv) / 256.0);
dmadac_enable(&state->dmadac[0], 2, 1);
break;
case PXA255_SADR:
- verboselog( space->machine, 4, "pxa255_i2s_w: Serial Audio Data Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_i2s_w: Serial Audio Data Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sadr = data;
#if 0
if(audio_dump)
@@ -209,7 +209,7 @@ static WRITE32_HANDLER( pxa255_i2s_w )
#endif
break;
default:
- verboselog( space->machine, 0, "pxa255_i2s_w: Unknown address: %08x = %08x & %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_i2s_w: Unknown address: %08x = %08x & %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -222,9 +222,9 @@ static WRITE32_HANDLER( pxa255_i2s_w )
*/
-static void pxa255_dma_irq_check(running_machine* machine)
+static void pxa255_dma_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
int channel = 0;
int set_intr = 0;
@@ -245,9 +245,9 @@ static void pxa255_dma_irq_check(running_machine* machine)
pxa255_set_irq_line(machine, PXA255_INT_DMA, set_intr);
}
-static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int channel)
+static void pxa255_dma_load_descriptor_and_start(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
attotime period;
@@ -260,7 +260,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c
// Load the next descriptor
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
dma_regs->dsadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x4);
dma_regs->dtadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x8);
dma_regs->dcmd[channel] = space->read_dword(dma_regs->ddadr[channel] + 0xc);
@@ -290,7 +290,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c
static TIMER_CALLBACK( pxa255_dma_dma_end )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
UINT32 sadr = dma_regs->dsadr[param];
UINT32 tadr = dma_regs->dtadr[param];
@@ -300,7 +300,7 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
UINT16 temp16;
UINT32 temp32;
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
switch(param)
{
case 3:
@@ -401,7 +401,7 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
static READ32_HANDLER( pxa255_dma_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@@ -410,10 +410,10 @@ static READ32_HANDLER( pxa255_dma_r )
case PXA255_DCSR4: case PXA255_DCSR5: case PXA255_DCSR6: case PXA255_DCSR7:
case PXA255_DCSR8: case PXA255_DCSR9: case PXA255_DCSR10: case PXA255_DCSR11:
case PXA255_DCSR12: case PXA255_DCSR13: case PXA255_DCSR14: case PXA255_DCSR15:
- verboselog( space->machine, 4, "pxa255_dma_r: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, dma_regs->dcsr[offset], mem_mask );
+ verboselog( space->machine(), 4, "pxa255_dma_r: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, dma_regs->dcsr[offset], mem_mask );
return dma_regs->dcsr[offset];
case PXA255_DINT:
- if (0) verboselog( space->machine, 3, "pxa255_dma_r: DMA Interrupt Register: %08x & %08x\n", dma_regs->dint, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_dma_r: DMA Interrupt Register: %08x & %08x\n", dma_regs->dint, mem_mask );
return dma_regs->dint;
case PXA255_DRCMR0: case PXA255_DRCMR1: case PXA255_DRCMR2: case PXA255_DRCMR3:
case PXA255_DRCMR4: case PXA255_DRCMR5: case PXA255_DRCMR6: case PXA255_DRCMR7:
@@ -425,34 +425,34 @@ static READ32_HANDLER( pxa255_dma_r )
case PXA255_DRCMR28: case PXA255_DRCMR29: case PXA255_DRCMR30: case PXA255_DRCMR31:
case PXA255_DRCMR32: case PXA255_DRCMR33: case PXA255_DRCMR34: case PXA255_DRCMR35:
case PXA255_DRCMR36: case PXA255_DRCMR37: case PXA255_DRCMR38: case PXA255_DRCMR39:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), 0, mem_mask );
return dma_regs->drcmr[offset - (0x100 >> 2)];
case PXA255_DDADR0: case PXA255_DDADR1: case PXA255_DDADR2: case PXA255_DDADR3:
case PXA255_DDADR4: case PXA255_DDADR5: case PXA255_DDADR6: case PXA255_DDADR7:
case PXA255_DDADR8: case PXA255_DDADR9: case PXA255_DDADR10: case PXA255_DDADR11:
case PXA255_DDADR12: case PXA255_DDADR13: case PXA255_DDADR14: case PXA255_DDADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->ddadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DSADR0: case PXA255_DSADR1: case PXA255_DSADR2: case PXA255_DSADR3:
case PXA255_DSADR4: case PXA255_DSADR5: case PXA255_DSADR6: case PXA255_DSADR7:
case PXA255_DSADR8: case PXA255_DSADR9: case PXA255_DSADR10: case PXA255_DSADR11:
case PXA255_DSADR12: case PXA255_DSADR13: case PXA255_DSADR14: case PXA255_DSADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dsadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DTADR0: case PXA255_DTADR1: case PXA255_DTADR2: case PXA255_DTADR3:
case PXA255_DTADR4: case PXA255_DTADR5: case PXA255_DTADR6: case PXA255_DTADR7:
case PXA255_DTADR8: case PXA255_DTADR9: case PXA255_DTADR10: case PXA255_DTADR11:
case PXA255_DTADR12: case PXA255_DTADR13: case PXA255_DTADR14: case PXA255_DTADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dtadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DCMD0: case PXA255_DCMD1: case PXA255_DCMD2: case PXA255_DCMD3:
case PXA255_DCMD4: case PXA255_DCMD5: case PXA255_DCMD6: case PXA255_DCMD7:
case PXA255_DCMD8: case PXA255_DCMD9: case PXA255_DCMD10: case PXA255_DCMD11:
case PXA255_DCMD12: case PXA255_DCMD13: case PXA255_DCMD14: case PXA255_DCMD15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dcmd[(offset - (0x200 >> 2)) >> 2];
default:
- verboselog( space->machine, 0, "pxa255_dma_r: Unknown address: %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_dma_r: Unknown address: %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -460,7 +460,7 @@ static READ32_HANDLER( pxa255_dma_r )
static WRITE32_HANDLER( pxa255_dma_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@@ -469,7 +469,7 @@ static WRITE32_HANDLER( pxa255_dma_w )
case PXA255_DCSR4: case PXA255_DCSR5: case PXA255_DCSR6: case PXA255_DCSR7:
case PXA255_DCSR8: case PXA255_DCSR9: case PXA255_DCSR10: case PXA255_DCSR11:
case PXA255_DCSR12: case PXA255_DCSR13: case PXA255_DCSR14: case PXA255_DCSR15:
- if (0) verboselog( space->machine, 3, "pxa255_dma_w: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_dma_w: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, data, mem_mask );
dma_regs->dcsr[offset] &= ~(data & 0x00000007);
dma_regs->dcsr[offset] &= ~0x60000000;
dma_regs->dcsr[offset] |= data & 0x60000000;
@@ -478,21 +478,21 @@ static WRITE32_HANDLER( pxa255_dma_w )
dma_regs->dcsr[offset] |= PXA255_DCSR_RUN;
if(data & PXA255_DCSR_NODESCFETCH)
{
- verboselog( space->machine, 0, " No-Descriptor-Fetch mode is not supported.\n" );
+ verboselog( space->machine(), 0, " No-Descriptor-Fetch mode is not supported.\n" );
break;
}
- pxa255_dma_load_descriptor_and_start(space->machine, offset);
+ pxa255_dma_load_descriptor_and_start(space->machine(), offset);
}
else if(!(data & PXA255_DCSR_RUN))
{
dma_regs->dcsr[offset] &= ~PXA255_DCSR_RUN;
}
- pxa255_dma_irq_check(space->machine);
+ pxa255_dma_irq_check(space->machine());
break;
case PXA255_DINT:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Interrupt Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Interrupt Register: %08x & %08x\n", data, mem_mask );
dma_regs->dint &= ~data;
break;
case PXA255_DRCMR0: case PXA255_DRCMR1: case PXA255_DRCMR2: case PXA255_DRCMR3:
@@ -505,39 +505,39 @@ static WRITE32_HANDLER( pxa255_dma_w )
case PXA255_DRCMR28: case PXA255_DRCMR29: case PXA255_DRCMR30: case PXA255_DRCMR31:
case PXA255_DRCMR32: case PXA255_DRCMR33: case PXA255_DRCMR34: case PXA255_DRCMR35:
case PXA255_DRCMR36: case PXA255_DRCMR37: case PXA255_DRCMR38: case PXA255_DRCMR39:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), data, mem_mask );
dma_regs->drcmr[offset - (0x100 >> 2)] = data & 0x0000008f;
break;
case PXA255_DDADR0: case PXA255_DDADR1: case PXA255_DDADR2: case PXA255_DDADR3:
case PXA255_DDADR4: case PXA255_DDADR5: case PXA255_DDADR6: case PXA255_DDADR7:
case PXA255_DDADR8: case PXA255_DDADR9: case PXA255_DDADR10: case PXA255_DDADR11:
case PXA255_DDADR12: case PXA255_DDADR13: case PXA255_DDADR14: case PXA255_DDADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->ddadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffff1;
break;
case PXA255_DSADR0: case PXA255_DSADR1: case PXA255_DSADR2: case PXA255_DSADR3:
case PXA255_DSADR4: case PXA255_DSADR5: case PXA255_DSADR6: case PXA255_DSADR7:
case PXA255_DSADR8: case PXA255_DSADR9: case PXA255_DSADR10: case PXA255_DSADR11:
case PXA255_DSADR12: case PXA255_DSADR13: case PXA255_DSADR14: case PXA255_DSADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dsadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffffc;
break;
case PXA255_DTADR0: case PXA255_DTADR1: case PXA255_DTADR2: case PXA255_DTADR3:
case PXA255_DTADR4: case PXA255_DTADR5: case PXA255_DTADR6: case PXA255_DTADR7:
case PXA255_DTADR8: case PXA255_DTADR9: case PXA255_DTADR10: case PXA255_DTADR11:
case PXA255_DTADR12: case PXA255_DTADR13: case PXA255_DTADR14: case PXA255_DTADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dtadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffffc;
break;
case PXA255_DCMD0: case PXA255_DCMD1: case PXA255_DCMD2: case PXA255_DCMD3:
case PXA255_DCMD4: case PXA255_DCMD5: case PXA255_DCMD6: case PXA255_DCMD7:
case PXA255_DCMD8: case PXA255_DCMD9: case PXA255_DCMD10: case PXA255_DCMD11:
case PXA255_DCMD12: case PXA255_DCMD13: case PXA255_DCMD14: case PXA255_DCMD15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dcmd[(offset - (0x200 >> 2)) >> 2] = data & 0xf067dfff;
break;
default:
- verboselog( space->machine, 0, "pxa255_dma_w: Unknown address: %08x = %08x & %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_dma_w: Unknown address: %08x = %08x & %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -550,9 +550,9 @@ static WRITE32_HANDLER( pxa255_dma_w )
*/
-static void pxa255_ostimer_irq_check(running_machine* machine)
+static void pxa255_ostimer_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
pxa255_set_irq_line(machine, PXA255_INT_OSTIMER0, (ostimer_regs->oier & PXA255_OIER_E0) ? ((ostimer_regs->ossr & PXA255_OSSR_M0) ? 1 : 0) : 0);
@@ -563,7 +563,7 @@ static void pxa255_ostimer_irq_check(running_machine* machine)
static TIMER_CALLBACK( pxa255_ostimer_match )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
if (0) verboselog(machine, 3, "pxa255_ostimer_match channel %d\n", param);
@@ -574,39 +574,39 @@ static TIMER_CALLBACK( pxa255_ostimer_match )
static READ32_HANDLER( pxa255_ostimer_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
{
case PXA255_OSMR0:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 0: %08x & %08x\n", ostimer_regs->osmr[0], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 0: %08x & %08x\n", ostimer_regs->osmr[0], mem_mask );
return ostimer_regs->osmr[0];
case PXA255_OSMR1:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 1: %08x & %08x\n", ostimer_regs->osmr[1], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 1: %08x & %08x\n", ostimer_regs->osmr[1], mem_mask );
return ostimer_regs->osmr[1];
case PXA255_OSMR2:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 2: %08x & %08x\n", ostimer_regs->osmr[2], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 2: %08x & %08x\n", ostimer_regs->osmr[2], mem_mask );
return ostimer_regs->osmr[2];
case PXA255_OSMR3:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 3: %08x & %08x\n", ostimer_regs->osmr[3], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 3: %08x & %08x\n", ostimer_regs->osmr[3], mem_mask );
return ostimer_regs->osmr[3];
case PXA255_OSCR:
- if (0) verboselog( space->machine, 4, "pxa255_ostimer_r: OS Timer Count Register: %08x & %08x\n", ostimer_regs->oscr, mem_mask );
+ if (0) verboselog( space->machine(), 4, "pxa255_ostimer_r: OS Timer Count Register: %08x & %08x\n", ostimer_regs->oscr, mem_mask );
// free-running 3.something MHz counter. this is a complete hack.
ostimer_regs->oscr += 0x300;
return ostimer_regs->oscr;
case PXA255_OSSR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Status Register: %08x & %08x\n", ostimer_regs->ossr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Status Register: %08x & %08x\n", ostimer_regs->ossr, mem_mask );
return ostimer_regs->ossr;
case PXA255_OWER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Watchdog Match Enable Register: %08x & %08x\n", ostimer_regs->ower, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Watchdog Match Enable Register: %08x & %08x\n", ostimer_regs->ower, mem_mask );
return ostimer_regs->ower;
case PXA255_OIER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Interrupt Enable Register: %08x & %08x\n", ostimer_regs->oier, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Interrupt Enable Register: %08x & %08x\n", ostimer_regs->oier, mem_mask );
return ostimer_regs->oier;
default:
- if (0) verboselog( space->machine, 0, "pxa255_ostimer_r: Unknown address: %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2));
+ if (0) verboselog( space->machine(), 0, "pxa255_ostimer_r: Unknown address: %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -614,13 +614,13 @@ static READ32_HANDLER( pxa255_ostimer_r )
static WRITE32_HANDLER( pxa255_ostimer_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
{
case PXA255_OSMR0:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 0: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 0: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[0] = data;
if(ostimer_regs->oier & PXA255_OIER_E0)
{
@@ -631,7 +631,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR1:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 1: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 1: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[1] = data;
if(ostimer_regs->oier & PXA255_OIER_E1)
{
@@ -641,7 +641,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR2:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 2: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 2: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[2] = data;
if(ostimer_regs->oier & PXA255_OIER_E2)
{
@@ -651,7 +651,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR3:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 3: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 3: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[3] = data;
if(ostimer_regs->oier & PXA255_OIER_E3)
{
@@ -661,22 +661,22 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSCR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Count Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Count Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->oscr = data;
break;
case PXA255_OSSR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Status Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Status Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->ossr &= ~data;
- pxa255_ostimer_irq_check(space->machine);
+ pxa255_ostimer_irq_check(space->machine());
break;
case PXA255_OWER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Watchdog Enable Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Watchdog Enable Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->ower = data & 0x00000001;
break;
case PXA255_OIER:
{
int index = 0;
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Interrupt Enable Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Interrupt Enable Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->oier = data & 0x0000000f;
for(index = 0; index < 4; index++)
{
@@ -691,7 +691,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
break;
}
default:
- verboselog( space->machine, 0, "pxa255_ostimer_w: Unknown address: %08x = %08x & %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_ostimer_w: Unknown address: %08x = %08x & %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -704,9 +704,9 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
*/
-static void pxa255_update_interrupts(running_machine* machine)
+static void pxa255_update_interrupts(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icfp = (intc_regs->icpr & intc_regs->icmr) & intc_regs->iclr;
@@ -715,9 +715,9 @@ static void pxa255_update_interrupts(running_machine* machine)
cputag_set_input_line(machine, "maincpu", ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE);
}
-static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_state)
+static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int irq_state)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icpr &= ~line;
@@ -728,31 +728,31 @@ static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_s
static READ32_HANDLER( pxa255_intc_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
{
case PXA255_ICIP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller IRQ Pending Register: %08x & %08x\n", intc_regs->icip, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller IRQ Pending Register: %08x & %08x\n", intc_regs->icip, mem_mask );
return intc_regs->icip;
case PXA255_ICMR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Mask Register: %08x & %08x\n", intc_regs->icmr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Mask Register: %08x & %08x\n", intc_regs->icmr, mem_mask );
return intc_regs->icmr;
case PXA255_ICLR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Level Register: %08x & %08x\n", intc_regs->iclr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Level Register: %08x & %08x\n", intc_regs->iclr, mem_mask );
return intc_regs->iclr;
case PXA255_ICFP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller FIQ Pending Register: %08x & %08x\n", intc_regs->icfp, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller FIQ Pending Register: %08x & %08x\n", intc_regs->icfp, mem_mask );
return intc_regs->icfp;
case PXA255_ICPR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Pending Register: %08x & %08x\n", intc_regs->icpr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Pending Register: %08x & %08x\n", intc_regs->icpr, mem_mask );
return intc_regs->icpr;
case PXA255_ICCR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Control Register: %08x & %08x\n", intc_regs->iccr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Control Register: %08x & %08x\n", intc_regs->iccr, mem_mask );
return intc_regs->iccr;
default:
- verboselog( space->machine, 0, "pxa255_intc_r: Unknown address: %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_intc_r: Unknown address: %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -760,34 +760,34 @@ static READ32_HANDLER( pxa255_intc_r )
static WRITE32_HANDLER( pxa255_intc_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
{
case PXA255_ICIP:
- verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller IRQ Pending Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller IRQ Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICMR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Mask Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Mask Register: %08x & %08x\n", data, mem_mask );
intc_regs->icmr = data & 0xfffe7f00;
break;
case PXA255_ICLR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Level Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Level Register: %08x & %08x\n", data, mem_mask );
intc_regs->iclr = data & 0xfffe7f00;
break;
case PXA255_ICFP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller FIQ Pending Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller FIQ Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICPR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller Pending Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICCR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Control Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Control Register: %08x & %08x\n", data, mem_mask );
intc_regs->iccr = data & 0x00000001;
break;
default:
- verboselog( space->machine, 0, "pxa255_intc_w: Unknown address: %08x = %08x & %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_intc_w: Unknown address: %08x = %08x & %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -802,97 +802,97 @@ static WRITE32_HANDLER( pxa255_intc_w )
static READ32_HANDLER( pxa255_gpio_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
{
case PXA255_GPLR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin-Level Register 0: %08x & %08x\n", gpio_regs->gplr0 | (1 << 1), mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin-Level Register 0: %08x & %08x\n", gpio_regs->gplr0 | (1 << 1), mem_mask );
return gpio_regs->gplr0 | (1 << 1) | (eeprom_read_bit(state->eeprom) << 5); // Must be on. Probably a DIP switch.
case PXA255_GPLR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 1: %08x & %08x\n", gpio_regs->gplr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 1: %08x & %08x\n", gpio_regs->gplr1, mem_mask );
return 0xff9fffff;
/*
0x200000 = flip screen
*/
case PXA255_GPLR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 2: %08x & %08x\n", gpio_regs->gplr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 2: %08x & %08x\n", gpio_regs->gplr2, mem_mask );
return gpio_regs->gplr2;
case PXA255_GPDR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 0: %08x & %08x\n", gpio_regs->gpdr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 0: %08x & %08x\n", gpio_regs->gpdr0, mem_mask );
return gpio_regs->gpdr0;
case PXA255_GPDR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 1: %08x & %08x\n", gpio_regs->gpdr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 1: %08x & %08x\n", gpio_regs->gpdr1, mem_mask );
return gpio_regs->gpdr1;
case PXA255_GPDR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 2: %08x & %08x\n", gpio_regs->gpdr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 2: %08x & %08x\n", gpio_regs->gpdr2, mem_mask );
return gpio_regs->gpdr2;
case PXA255_GPSR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 0: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 0: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPSR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 1: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 1: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPSR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 2: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 2: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 0: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 0: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 1: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 1: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 2: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 2: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GRER0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->grer0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->grer0, mem_mask );
return gpio_regs->grer0;
case PXA255_GRER1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->grer1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->grer1, mem_mask );
return gpio_regs->grer1;
case PXA255_GRER2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->grer2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->grer2, mem_mask );
return gpio_regs->grer2;
case PXA255_GFER0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->gfer0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->gfer0, mem_mask );
return gpio_regs->gfer0;
case PXA255_GFER1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->gfer1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->gfer1, mem_mask );
return gpio_regs->gfer1;
case PXA255_GFER2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->gfer2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->gfer2, mem_mask );
return gpio_regs->gfer2;
case PXA255_GEDR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
return gpio_regs->gedr0;
case PXA255_GEDR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
return gpio_regs->gedr1;
case PXA255_GEDR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
return gpio_regs->gedr2;
case PXA255_GAFR0_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
return gpio_regs->gafr0l;
case PXA255_GAFR0_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
return gpio_regs->gafr0u;
case PXA255_GAFR1_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
return gpio_regs->gafr1l;
case PXA255_GAFR1_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
return gpio_regs->gafr1u;
case PXA255_GAFR2_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
return gpio_regs->gafr2l;
case PXA255_GAFR2_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
return gpio_regs->gafr2u;
default:
- verboselog( space->machine, 0, "pxa255_gpio_r: Unknown address: %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_gpio_r: Unknown address: %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -900,34 +900,34 @@ static READ32_HANDLER( pxa255_gpio_r )
static WRITE32_HANDLER( pxa255_gpio_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
{
case PXA255_GPLR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPLR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPLR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 2: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPDR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr0 = data;
break;
case PXA255_GPDR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr1 = data;
break;
case PXA255_GPDR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr2 = data;
break;
case PXA255_GPSR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr0 |= data & gpio_regs->gpdr0;
if(data & 0x00000004)
{
@@ -943,15 +943,15 @@ static WRITE32_HANDLER( pxa255_gpio_w )
}
break;
case PXA255_GPSR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr1 |= data & gpio_regs->gpdr1;
break;
case PXA255_GPSR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr2 |= data & gpio_regs->gpdr2;
break;
case PXA255_GPCR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr0 &= ~(data & gpio_regs->gpdr0);
if(data & 0x00000004)
{
@@ -967,75 +967,75 @@ static WRITE32_HANDLER( pxa255_gpio_w )
}
break;
case PXA255_GPCR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr1 &= ~(data & gpio_regs->gpdr1);
break;
case PXA255_GPCR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr2 &= ~(data & gpio_regs->gpdr2);
break;
case PXA255_GRER0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->grer0 = data;
break;
case PXA255_GRER1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->grer1 = data;
break;
case PXA255_GRER2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->grer2 = data;
break;
case PXA255_GFER0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer0 = data;
break;
case PXA255_GFER1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer1 = data;
break;
case PXA255_GFER2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer2 = data;
break;
case PXA255_GEDR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
gpio_regs->gedr0 &= ~data;
break;
case PXA255_GEDR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
gpio_regs->gedr1 &= ~data;
break;
case PXA255_GEDR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
gpio_regs->gedr2 &= ~data;
break;
case PXA255_GAFR0_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
gpio_regs->gafr0l = data;
break;
case PXA255_GAFR0_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
gpio_regs->gafr0u = data;
break;
case PXA255_GAFR1_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
gpio_regs->gafr1l = data;
break;
case PXA255_GAFR1_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
gpio_regs->gafr1u = data;
break;
case PXA255_GAFR2_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
gpio_regs->gafr2l = data;
break;
case PXA255_GAFR2_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
gpio_regs->gafr2u = data;
break;
default:
- verboselog( space->machine, 0, "pxa255_gpio_w: Unknown address: %08x = %08x & %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_gpio_w: Unknown address: %08x = %08x & %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -1050,23 +1050,23 @@ static WRITE32_HANDLER( pxa255_gpio_w )
static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel)
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
lcd_regs->dma[channel].fdadr = space->read_dword(address);
lcd_regs->dma[channel].fsadr = space->read_dword(address + 0x04);
lcd_regs->dma[channel].fidr = space->read_dword(address + 0x08);
lcd_regs->dma[channel].ldcmd = space->read_dword(address + 0x0c);
- verboselog( space->machine, 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
- verboselog( space->machine, 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
- verboselog( space->machine, 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
- verboselog( space->machine, 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
- verboselog( space->machine, 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
+ verboselog( space->machine(), 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
+ verboselog( space->machine(), 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
+ verboselog( space->machine(), 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
+ verboselog( space->machine(), 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
+ verboselog( space->machine(), 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
}
-static void pxa255_lcd_irq_check(running_machine* machine)
+static void pxa255_lcd_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(((lcd_regs->lcsr & PXA255_LCSR_BS) != 0 && (lcd_regs->lccr0 & PXA255_LCCR0_BM) == 0) ||
@@ -1081,9 +1081,9 @@ static void pxa255_lcd_irq_check(running_machine* machine)
}
}
-static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
+static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->dma[channel].fdadr != 0)
@@ -1101,7 +1101,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
if(lcd_regs->dma[channel].ldcmd & PXA255_LDCMD_PAL)
{
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index += 2)
@@ -1113,7 +1113,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
}
else
{
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index++)
@@ -1124,16 +1124,16 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
}
}
-static void pxa255_lcd_check_load_next_branch(running_machine* machine, int channel)
+static void pxa255_lcd_check_load_next_branch(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->fbr[channel] & 1)
{
verboselog( machine, 4, "pxa255_lcd_check_load_next_branch: Taking branch\n" );
lcd_regs->fbr[channel] &= ~1;
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
//lcd_regs->fbr[channel] = (space->read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
//printf( "%08x\n", lcd_regs->fbr[channel] );
pxa255_lcd_load_dma_descriptor(space, lcd_regs->fbr[channel] & 0xfffffff0, 0);
@@ -1156,7 +1156,7 @@ static void pxa255_lcd_check_load_next_branch(running_machine* machine, int chan
static TIMER_CALLBACK( pxa255_lcd_dma_eof )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if (0) verboselog( machine, 3, "End of frame callback\n" );
@@ -1171,67 +1171,67 @@ static TIMER_CALLBACK( pxa255_lcd_dma_eof )
static READ32_HANDLER( pxa255_lcd_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
{
case PXA255_LCCR0: // 0x44000000
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 0: %08x & %08x\n", lcd_regs->lccr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 0: %08x & %08x\n", lcd_regs->lccr0, mem_mask );
return lcd_regs->lccr0;
case PXA255_LCCR1: // 0x44000004
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 1: %08x & %08x\n", lcd_regs->lccr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 1: %08x & %08x\n", lcd_regs->lccr1, mem_mask );
return lcd_regs->lccr1;
case PXA255_LCCR2: // 0x44000008
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 2: %08x & %08x\n", lcd_regs->lccr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 2: %08x & %08x\n", lcd_regs->lccr2, mem_mask );
return lcd_regs->lccr2;
case PXA255_LCCR3: // 0x4400000c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 3: %08x & %08x\n", lcd_regs->lccr3, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 3: %08x & %08x\n", lcd_regs->lccr3, mem_mask );
return lcd_regs->lccr3;
case PXA255_FBR0: // 0x44000020
- verboselog( space->machine, 4, "pxa255_lcd_r: LCD Frame Branch Register 0: %08x & %08x\n", lcd_regs->fbr[0], mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_r: LCD Frame Branch Register 0: %08x & %08x\n", lcd_regs->fbr[0], mem_mask );
return lcd_regs->fbr[0];
case PXA255_FBR1: // 0x44000024
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Frame Branch Register 1: %08x & %08x\n", lcd_regs->fbr[1], mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Frame Branch Register 1: %08x & %08x\n", lcd_regs->fbr[1], mem_mask );
return lcd_regs->fbr[1];
case PXA255_LCSR: // 0x44000038
- verboselog( space->machine, 4, "pxa255_lcd_r: LCD Status Register: %08x & %08x\n", lcd_regs->lcsr, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_r: LCD Status Register: %08x & %08x\n", lcd_regs->lcsr, mem_mask );
return lcd_regs->lcsr;
case PXA255_LIIDR: // 0x4400003c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Interrupt ID Register: %08x & %08x\n", lcd_regs->liidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Interrupt ID Register: %08x & %08x\n", lcd_regs->liidr, mem_mask );
return lcd_regs->liidr;
case PXA255_TRGBR: // 0x44000040
- verboselog( space->machine, 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->trgbr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->trgbr, mem_mask );
return lcd_regs->trgbr;
case PXA255_TCR: // 0x44000044
- verboselog( space->machine, 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->tcr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->tcr, mem_mask );
return lcd_regs->tcr;
case PXA255_FDADR0: // 0x44000200
- if (0) verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fdadr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fdadr, mem_mask );
return lcd_regs->dma[0].fdadr;
case PXA255_FSADR0: // 0x44000204
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fsadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fsadr, mem_mask );
return lcd_regs->dma[0].fsadr;
case PXA255_FIDR0: // 0x44000208
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame ID Register 0: %08x & %08x\n", lcd_regs->dma[0].fidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame ID Register 0: %08x & %08x\n", lcd_regs->dma[0].fidr, mem_mask );
return lcd_regs->dma[0].fidr;
case PXA255_LDCMD0: // 0x4400020c
- if (0) verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Command Register 0: %08x & %08x\n", lcd_regs->dma[0].ldcmd & 0xfff00000, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Command Register 0: %08x & %08x\n", lcd_regs->dma[0].ldcmd & 0xfff00000, mem_mask );
return lcd_regs->dma[0].ldcmd & 0xfff00000;
case PXA255_FDADR1: // 0x44000210
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fdadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fdadr, mem_mask );
return lcd_regs->dma[1].fdadr;
case PXA255_FSADR1: // 0x44000214
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fsadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fsadr, mem_mask );
return lcd_regs->dma[1].fsadr;
case PXA255_FIDR1: // 0x44000218
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame ID Register 1: %08x & %08x\n", lcd_regs->dma[1].fidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame ID Register 1: %08x & %08x\n", lcd_regs->dma[1].fidr, mem_mask );
return lcd_regs->dma[1].fidr;
case PXA255_LDCMD1: // 0x4400021c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Command Register 1: %08x & %08x\n", lcd_regs->dma[1].ldcmd & 0xfff00000, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Command Register 1: %08x & %08x\n", lcd_regs->dma[1].ldcmd & 0xfff00000, mem_mask );
return lcd_regs->dma[1].ldcmd & 0xfff00000;
default:
- verboselog( space->machine, 0, "pxa255_lcd_r: Unknown address: %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_lcd_r: Unknown address: %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -1239,65 +1239,65 @@ static READ32_HANDLER( pxa255_lcd_r )
static WRITE32_HANDLER( pxa255_lcd_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
{
case PXA255_LCCR0: // 0x44000000
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 0: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr0 = data & 0x00fffeff;
break;
case PXA255_LCCR1: // 0x44000004
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 1: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr1 = data;
break;
case PXA255_LCCR2: // 0x44000008
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 2: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr2 = data;
break;
case PXA255_LCCR3: // 0x4400000c
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 3: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 3: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr3 = data;
break;
case PXA255_FBR0: // 0x44000020
- verboselog( space->machine, 4l, "pxa255_lcd_w: LCD Frame Branch Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4l, "pxa255_lcd_w: LCD Frame Branch Register 0: %08x & %08x\n", data, mem_mask );
lcd_regs->fbr[0] = data & 0xfffffff3;
if(!lcd_regs->dma[0].eof->enabled())
{
- if (0) verboselog( space->machine, 3, "ch0 EOF timer is not enabled, taking branch now\n" );
- pxa255_lcd_check_load_next_branch(space->machine, 0);
- pxa255_lcd_irq_check(space->machine);
+ if (0) verboselog( space->machine(), 3, "ch0 EOF timer is not enabled, taking branch now\n" );
+ pxa255_lcd_check_load_next_branch(space->machine(), 0);
+ pxa255_lcd_irq_check(space->machine());
}
break;
case PXA255_FBR1: // 0x44000024
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Frame Branch Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Frame Branch Register 1: %08x & %08x\n", data, mem_mask );
lcd_regs->fbr[1] = data & 0xfffffff3;
if(!lcd_regs->dma[1].eof->enabled())
{
- verboselog( space->machine, 3, "ch1 EOF timer is not enabled, taking branch now\n" );
- pxa255_lcd_check_load_next_branch(space->machine, 1);
- pxa255_lcd_irq_check(space->machine);
+ verboselog( space->machine(), 3, "ch1 EOF timer is not enabled, taking branch now\n" );
+ pxa255_lcd_check_load_next_branch(space->machine(), 1);
+ pxa255_lcd_irq_check(space->machine());
}
break;
case PXA255_LCSR: // 0x44000038
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD Controller Status Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD Controller Status Register: %08x & %08x\n", data, mem_mask );
lcd_regs->lcsr &= ~data;
- pxa255_lcd_irq_check(space->machine);
+ pxa255_lcd_irq_check(space->machine());
break;
case PXA255_LIIDR: // 0x4400003c
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Controller Interrupt ID Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Controller Interrupt ID Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_TRGBR: // 0x44000040
- verboselog( space->machine, 3, "pxa255_lcd_w: TMED RGB Seed Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: TMED RGB Seed Register: %08x & %08x\n", data, mem_mask );
lcd_regs->trgbr = data & 0x00ffffff;
break;
case PXA255_TCR: // 0x44000044
- verboselog( space->machine, 3, "pxa255_lcd_w: TMED Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: TMED Control Register: %08x & %08x\n", data, mem_mask );
lcd_regs->tcr = data & 0x00004fff;
break;
case PXA255_FDADR0: // 0x44000200
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[0].eof->enabled())
{
pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 0);
@@ -1309,16 +1309,16 @@ static WRITE32_HANDLER( pxa255_lcd_w )
}
break;
case PXA255_FSADR0: // 0x44000204
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FIDR0: // 0x44000208
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_LDCMD0: // 0x4400020c
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FDADR1: // 0x44000210
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[1].eof->enabled())
{
pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 1);
@@ -1330,16 +1330,16 @@ static WRITE32_HANDLER( pxa255_lcd_w )
}
break;
case PXA255_FSADR1: // 0x44000214
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FIDR1: // 0x44000218
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_LDCMD1: // 0x4400021c
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 1: %08x & %08x\n", data, mem_mask );
break;
default:
- verboselog( space->machine, 0, "pxa255_lcd_w: Unknown address: %08x = %08x & %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_lcd_w: Unknown address: %08x = %08x & %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -1362,7 +1362,7 @@ static READ32_HANDLER( unknown_r )
static READ32_HANDLER( cpld_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
//if (cpu_get_pc(space->cpu) != 0xe3af4) printf("CPLD read @ %x (PC %x state %d)\n", offset, cpu_get_pc(space->cpu), state);
@@ -1372,7 +1372,7 @@ static READ32_HANDLER( cpld_r )
}
else if (cpu_get_pc(space->cpu) == 0xe3af4)
{
- return input_port_read(space->machine, "MCUIPT");
+ return input_port_read(space->machine(), "MCUIPT");
}
else
{
@@ -1419,7 +1419,7 @@ static READ32_HANDLER( cpld_r )
static WRITE32_HANDLER( cpld_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
if (mem_mask == 0xffff)
{
@@ -1453,13 +1453,13 @@ static READ32_HANDLER( prot_cheater_r )
static DRIVER_INIT( 39in1 )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
- state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
- state->eeprom = machine->device<eeprom_device>("eeprom");
+ state->dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ state->dmadac[1] = machine.device<dmadac_sound_device>("dac2");
+ state->eeprom = machine.device<eeprom_device>("eeprom");
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
space->install_legacy_read_handler (0xa0151648, 0xa015164b, FUNC(prot_cheater_r));
}
@@ -1514,7 +1514,7 @@ INPUT_PORTS_END
static SCREEN_UPDATE( 39in1 )
{
- _39in1_state *state = screen->machine->driver_data<_39in1_state>();
+ _39in1_state *state = screen->machine().driver_data<_39in1_state>();
int x = 0;
int y = 0;
@@ -1530,9 +1530,9 @@ static SCREEN_UPDATE( 39in1 )
}
/* To be moved to DEVICE_START( pxa255 ) upon completion */
-static void pxa255_start(running_machine* machine)
+static void pxa255_start(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
int index = 0;
//pxa255_t* pxa255 = pxa255_get_safe_token( device );
@@ -1542,21 +1542,21 @@ static void pxa255_start(running_machine* machine)
for(index = 0; index < 16; index++)
{
state->dma_regs.dcsr[index] = 0x00000008;
- state->dma_regs.timer[index] = machine->scheduler().timer_alloc(FUNC(pxa255_dma_dma_end));
+ state->dma_regs.timer[index] = machine.scheduler().timer_alloc(FUNC(pxa255_dma_dma_end));
}
memset(&state->ostimer_regs, 0, sizeof(state->ostimer_regs));
for(index = 0; index < 4; index++)
{
state->ostimer_regs.osmr[index] = 0;
- state->ostimer_regs.timer[index] = machine->scheduler().timer_alloc(FUNC(pxa255_ostimer_match));
+ state->ostimer_regs.timer[index] = machine.scheduler().timer_alloc(FUNC(pxa255_ostimer_match));
}
memset(&state->intc_regs, 0, sizeof(state->intc_regs));
memset(&state->lcd_regs, 0, sizeof(state->lcd_regs));
- state->lcd_regs.dma[0].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
- state->lcd_regs.dma[1].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
+ state->lcd_regs.dma[0].eof = machine.scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
+ state->lcd_regs.dma[1].eof = machine.scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
state->lcd_regs.trgbr = 0x00aa5500;
state->lcd_regs.tcr = 0x0000754f;
@@ -1565,7 +1565,7 @@ static void pxa255_start(running_machine* machine)
static MACHINE_START(39in1)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x80000; i += 2)
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 0a52436f331..e1f7fa0c388 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -227,7 +227,7 @@ Notes - Has jumper setting for 122HZ or 61HZ)
static TIMER_CALLBACK( nmi_callback )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -237,18 +237,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -262,7 +262,7 @@ static WRITE8_HANDLER( nmi_enable_w )
#if 0
static WRITE8_HANDLER( fortyl_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
#endif
@@ -276,12 +276,12 @@ static WRITE8_HANDLER( bank_select_w )
// popmessage("WRONG BANK SELECT = %x !!!!\n",data);
}
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER( pix1_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
@@ -290,7 +290,7 @@ static WRITE8_HANDLER( pix1_w )
static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
@@ -299,7 +299,7 @@ static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
static WRITE8_HANDLER( pix2_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if ((data!=0x00) && (data != 0xff))
// logerror("pix2 = %2x\n", data);
@@ -310,14 +310,14 @@ static WRITE8_HANDLER( pix2_w )
#if 0
static READ8_HANDLER( pix1_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->pix1;
}
#endif
static READ8_HANDLER( pix2_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
int res;
int d1 = state->pix1 & 7;
@@ -395,7 +395,7 @@ static const UINT8 mcu_data2[0x80] =
static WRITE8_HANDLER( undoukai_mcu_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
int ram_adr = state->mcu_ram[0x1b5] * 0x100 + state->mcu_ram[0x1b4];
int d, i;
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( undoukai_mcu_w )
static READ8_HANDLER( undoukai_mcu_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// logerror("mcu_r %02x\n", state->from_mcu);
@@ -573,8 +573,8 @@ static READ8_HANDLER( undoukai_mcu_status_r )
static DRIVER_INIT( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
state->pix_color[0] = 0x000;
@@ -585,15 +585,15 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
#if 0
/* character ROM hack
to show a white line on the opponent side */
- UINT8 *ROM = machine->region("gfx2")->base();
+ UINT8 *ROM = machine.region("gfx2")->base();
int adr = 0x10 * 0x022b;
ROM[adr + 0x000a] = 0x00;
ROM[adr + 0x000b] = 0x00;
@@ -611,20 +611,20 @@ static DRIVER_INIT( 40love )
static READ8_HANDLER( from_snd_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->snd_flag = 0;
return state->snd_data;
}
static READ8_HANDLER( snd_flag_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->snd_flag | 0xfd;
}
static WRITE8_HANDLER( to_main_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->snd_data = data;
state->snd_flag = 2;
}
@@ -683,7 +683,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int i;
double db = 0.0;
@@ -708,7 +708,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl0 = data & 0xff;
// popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -723,7 +723,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_DEVICE_HANDLER( sound_control_1_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl1 = data & 0xff;
// popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
device_sound_interface *sound;
@@ -736,7 +736,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_1_w )
static WRITE8_DEVICE_HANDLER( sound_control_2_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
int i;
state->snd_ctrl2 = data & 0xff;
// popmessage("SND2 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -749,7 +749,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_2_w )
static WRITE8_DEVICE_HANDLER( sound_control_3_w ) /* unknown */
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl3 = data & 0xff;
// popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
}
@@ -986,9 +986,9 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( 40love )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
/* video */
state->save_item(NAME(state->pix1));
@@ -1007,7 +1007,7 @@ static MACHINE_START( 40love )
static MACHINE_START( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
MACHINE_START_CALL(40love);
@@ -1022,7 +1022,7 @@ static MACHINE_START( undoukai )
static MACHINE_RESET( common )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
MACHINE_RESET_CALL(ta7630);
@@ -1050,7 +1050,7 @@ static MACHINE_RESET( 40love )
static MACHINE_RESET( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int i;
MACHINE_RESET_CALL(common);
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index f0a38ee4789..ac76432b14e 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -55,13 +55,13 @@ Sound :
static WRITE8_HANDLER( sound_data_w )
{
- _4enraya_state *state = space->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
state->soundlatch = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- _4enraya_state *state = device->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = device->machine().driver_data<_4enraya_state>();
if ((state->last_snd_ctrl & 0x04) == 0x04 && (data & 0x4) == 0x00)
ay8910_data_address_w(device, state->last_snd_ctrl, state->soundlatch);
@@ -150,7 +150,7 @@ GFXDECODE_END
static MACHINE_START( 4enraya )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
state->save_item(NAME(state->soundlatch));
state->save_item(NAME(state->last_snd_ctrl));
@@ -158,7 +158,7 @@ static MACHINE_START( 4enraya )
static MACHINE_RESET( 4enraya )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
state->soundlatch = 0;
state->last_snd_ctrl = 0;
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index af26718f6c2..e5334aa6ef4 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -479,14 +479,14 @@ public:
static WRITE8_HANDLER( fclown_videoram_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( fclown_colorram_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -494,7 +494,7 @@ static WRITE8_HANDLER( fclown_colorram_w )
static TILE_GET_INFO( get_fclown_tile_info )
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
/* - bits -
7654 3210
@@ -516,14 +516,14 @@ static TILE_GET_INFO( get_fclown_tile_info )
static VIDEO_START(fclown)
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
state->bg_tilemap = tilemap_create(machine, get_fclown_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( fclown )
{
- _5clown_state *state = screen->machine->driver_data<_5clown_state>();
+ _5clown_state *state = screen->machine().driver_data<_5clown_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -544,7 +544,7 @@ static PALETTE_INIT( fclown )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -580,13 +580,13 @@ static PALETTE_INIT( fclown )
*/
static READ8_DEVICE_HANDLER( mux_port_r )
{
- _5clown_state *state = device->machine->driver_data<_5clown_state>();
+ _5clown_state *state = device->machine().driver_data<_5clown_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
@@ -595,7 +595,7 @@ static READ8_DEVICE_HANDLER( mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- _5clown_state *state = device->machine->driver_data<_5clown_state>();
+ _5clown_state *state = device->machine().driver_data<_5clown_state>();
state->mux_data = data ^ 0xff; /* Inverted */
}
@@ -611,10 +611,10 @@ static WRITE8_DEVICE_HANDLER( counters_w )
-x-- ---- Unknown (increments at start).
x--- ---- Unknown (increments at start).
*/
- coin_counter_w(device->machine, 0, data & 0x10); /* Key In */
- coin_counter_w(device->machine, 1, data & 0x20); /* Payout */
- coin_counter_w(device->machine, 2, data & 0x40); /* unknown */
- coin_counter_w(device->machine, 3, data & 0x80); /* unknown */
+ coin_counter_w(device->machine(), 0, data & 0x10); /* Key In */
+ coin_counter_w(device->machine(), 1, data & 0x20); /* Payout */
+ coin_counter_w(device->machine(), 2, data & 0x40); /* unknown */
+ coin_counter_w(device->machine(), 3, data & 0x80); /* unknown */
}
@@ -627,12 +627,12 @@ static WRITE8_DEVICE_HANDLER( trigsnd_w )
if ( (data & 0x0f) == 0x07 )
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE );
}
else
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE );
}
}
@@ -660,7 +660,7 @@ static WRITE8_HANDLER( cpu_c048_w)
static WRITE8_HANDLER( cpu_d800_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
logerror("Main: Write to $D800: %02x\n", data);
state->main_latch_d800 = data;
}
@@ -683,14 +683,14 @@ static WRITE8_DEVICE_HANDLER( fclown_ay8910_w )
static READ8_HANDLER( snd_e06_r )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
logerror("Sound: Read from $0E06 \n");
return state->main_latch_d800;
}
static WRITE8_HANDLER( snd_800_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->snd_latch_0800 = data;
if (state->snd_latch_0a02 == 0xc0)
@@ -706,7 +706,7 @@ static WRITE8_HANDLER( snd_800_w )
static WRITE8_HANDLER( snd_a02_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->snd_latch_0a02 = data & 0xff;
logerror("Sound: Write to $0A02: %02x\n", state->snd_latch_0a02);
}
@@ -1198,11 +1198,11 @@ ROM_END
static DRIVER_INIT( fclown )
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
/* Decrypting main program */
int x;
- UINT8 *src = machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@@ -1212,8 +1212,8 @@ static DRIVER_INIT( fclown )
/* Decrypting GFX by segments */
- UINT8 *gfx1_src = machine->region( "gfx1" )->base();
- UINT8 *gfx2_src = machine->region( "gfx2" )->base();
+ UINT8 *gfx1_src = machine.region( "gfx1" )->base();
+ UINT8 *gfx2_src = machine.region( "gfx2" )->base();
for (x = 0x2000; x < 0x3000; x++)
{
@@ -1233,7 +1233,7 @@ static DRIVER_INIT( fclown )
/* Decrypting sound samples */
- UINT8 *samples_src = machine->region( "oki6295" )->base();
+ UINT8 *samples_src = machine.region( "oki6295" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@@ -1251,7 +1251,7 @@ static DRIVER_INIT( fclown )
/* Assigning AY-3-8910 sound device */
- state->ay8910 = machine->device("ay8910");
+ state->ay8910 = machine.device("ay8910");
}
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 17227028144..42c9a560ef0 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -1156,7 +1156,7 @@ MACHINE_CONFIG_END
static CUSTOM_INPUT( sflush_80_r )
{
- return (field->port->machine->primary_screen->vpos() & 0x80) ? 1 : 0;
+ return (field->port->machine().primary_screen->vpos() & 0x80) ? 1 : 0;
}
static ADDRESS_MAP_START( sflush_map, AS_PROGRAM, 8 )
@@ -1361,7 +1361,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( polaris_interrupt )
{
- _8080bw_state *state = device->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = device->machine().driver_data<_8080bw_state>();
state->polaris_cloud_speed++;
if (state->polaris_cloud_speed >= 4) /* every 4 frames - this was verified against real machine */
@@ -1373,7 +1373,7 @@ static INTERRUPT_GEN( polaris_interrupt )
static MACHINE_START( polaris )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
state->save_item(NAME(state->polaris_cloud_speed));
state->save_item(NAME(state->polaris_cloud_pos));
@@ -1736,7 +1736,7 @@ static READ8_HANDLER(indianbt_r)
case 0x5ffc: return 0;
}
logerror("unknown port 0 read @ %x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( indianbt_io_map, AS_IO, 8 )
@@ -1782,7 +1782,7 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( steelwkr_sh_port_3_w )
{
- coin_lockout_global_w(space->machine, !(~data & 0x03)); /* possibly */
+ coin_lockout_global_w(space->machine(), !(~data & 0x03)); /* possibly */
}
static ADDRESS_MAP_START( steelwkr_io_map, AS_IO, 8 )
@@ -2166,8 +2166,8 @@ MACHINE_CONFIG_END
/* decrypt function for vortex */
static DRIVER_INIT( vortex )
{
- UINT8 *rom = machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
for (x = 0; x < length; x++)
diff --git a/src/mame/drivers/86lions.c b/src/mame/drivers/86lions.c
index 798484d772f..60faefe19a6 100644
--- a/src/mame/drivers/86lions.c
+++ b/src/mame/drivers/86lions.c
@@ -51,8 +51,8 @@ static VIDEO_START(lions)
static SCREEN_UPDATE(lions)
{
- _86lions_state *state = screen->machine->driver_data<_86lions_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ _86lions_state *state = screen->machine().driver_data<_86lions_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0;
int y,x;
@@ -81,7 +81,7 @@ static SCREEN_UPDATE(lions)
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -226,39 +226,39 @@ static const ay8910_interface ay8910_config =
//static READ8_DEVICE_HANDLER( input_a )
//{
//return input_port_read(machine, "IN0");
-// return device->machine->rand();
+// return device->machine().rand();
//return 0xff;
//}
//static READ8_DEVICE_HANDLER( input_b )
//{
//return input_port_read(machine, "IN1");
-// return device->machine->rand();
+// return device->machine().rand();
//return 0xff;
//}
static READ8_DEVICE_HANDLER( input_ca1 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_cb1 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_ca2 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_cb2 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
@@ -331,7 +331,7 @@ static PALETTE_INIT( lions )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 2cae66c1b51..afbdb47bb6b 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -24,7 +24,7 @@
static INTERRUPT_GEN( k88games_interrupt )
{
- _88games_state *state = device->machine->driver_data<_88games_state>();
+ _88games_state *state = device->machine().driver_data<_88games_state>();
if (k052109_is_irq_enabled(state->k052109))
irq0_line_hold(device);
@@ -32,7 +32,7 @@ static INTERRUPT_GEN( k88games_interrupt )
static READ8_HANDLER( bankedram_r )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (state->videobank)
return state->ram[offset];
@@ -47,7 +47,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (state->videobank)
state->ram[offset] = data;
@@ -57,11 +57,11 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( k88games_5f84_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
/* bits 0/1 coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 enables ROM reading from the 051316 */
/* also 5fce == 2 read roms, == 3 read ram */
@@ -73,14 +73,14 @@ static WRITE8_HANDLER( k88games_5f84_w )
static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( speech_control_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_t *upd;
state->speech_chip = (data & 4) ? 1 : 0;
@@ -92,7 +92,7 @@ static WRITE8_HANDLER( speech_control_w )
static WRITE8_HANDLER( speech_msg_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_t *upd = state->speech_chip ? state->upd_2 : state->upd_1;
upd7759_port_w(upd, 0, data);
@@ -101,7 +101,7 @@ static WRITE8_HANDLER( speech_msg_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -118,7 +118,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -273,8 +273,8 @@ INPUT_PORTS_END
static KONAMI_SETLINES_CALLBACK( k88games_banking )
{
- _88games_state *state = device->machine->driver_data<_88games_state>();
- UINT8 *RAM = device->machine->region("maincpu")->base();
+ _88games_state *state = device->machine().driver_data<_88games_state>();
+ UINT8 *RAM = device->machine().region("maincpu")->base();
int offs;
logerror("%04x: bank select %02x\n", cpu_get_pc(device), lines);
@@ -286,18 +286,18 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
memcpy(state->banked_rom, &RAM[offs], 0x1000);
if (lines & 0x08)
{
- if (device->machine->generic.paletteram.u8 != state->paletteram_1000)
+ if (device->machine().generic.paletteram.u8 != state->paletteram_1000)
{
- memcpy(state->paletteram_1000, device->machine->generic.paletteram.u8, 0x1000);
- device->machine->generic.paletteram.u8 = state->paletteram_1000;
+ memcpy(state->paletteram_1000, device->machine().generic.paletteram.u8, 0x1000);
+ device->machine().generic.paletteram.u8 = state->paletteram_1000;
}
}
else
{
- if (device->machine->generic.paletteram.u8 != &RAM[0x20000])
+ if (device->machine().generic.paletteram.u8 != &RAM[0x20000])
{
- memcpy(&RAM[0x20000], device->machine->generic.paletteram.u8, 0x1000);
- device->machine->generic.paletteram.u8 = &RAM[0x20000];
+ memcpy(&RAM[0x20000], device->machine().generic.paletteram.u8, 0x1000);
+ device->machine().generic.paletteram.u8 = &RAM[0x20000];
}
memcpy(state->paletteram_1000, &RAM[offs+0x1000], 0x1000);
}
@@ -315,14 +315,14 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
static MACHINE_START( 88games )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k051316 = machine->device("k051316");
- state->upd_1 = machine->device("upd1");
- state->upd_2 = machine->device("upd2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k051316 = machine.device("k051316");
+ state->upd_1 = machine.device("upd1");
+ state->upd_2 = machine.device("upd2");
state->save_item(NAME(state->videobank));
state->save_item(NAME(state->zoomreadroms));
@@ -335,10 +335,10 @@ static MACHINE_START( 88games )
static MACHINE_RESET( 88games )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
- konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
- machine->generic.paletteram.u8 = &machine->region("maincpu")->base()[0x20000];
+ konami_configure_set_lines(machine.device("maincpu"), k88games_banking);
+ machine.generic.paletteram.u8 = &machine.region("maincpu")->base()[0x20000];
state->videobank = 0;
state->zoomreadroms = 0;
diff --git a/src/mame/drivers/ace.c b/src/mame/drivers/ace.c
index bf01411bd9d..fb4dda2dfac 100644
--- a/src/mame/drivers/ace.c
+++ b/src/mame/drivers/ace.c
@@ -61,48 +61,48 @@ public:
static WRITE8_HANDLER( ace_objpos_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
state->objpos[offset] = data;
}
#if 0
static READ8_HANDLER( ace_objpos_r )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
return state->objpos[offset];
}
#endif
static VIDEO_START( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
- gfx_element_set_source(machine->gfx[1], state->characterram);
- gfx_element_set_source(machine->gfx[2], state->characterram);
- gfx_element_set_source(machine->gfx[3], state->characterram);
- gfx_element_set_source(machine->gfx[4], state->scoreram);
+ ace_state *state = machine.driver_data<ace_state>();
+ gfx_element_set_source(machine.gfx[1], state->characterram);
+ gfx_element_set_source(machine.gfx[2], state->characterram);
+ gfx_element_set_source(machine.gfx[3], state->characterram);
+ gfx_element_set_source(machine.gfx[4], state->scoreram);
}
static SCREEN_UPDATE( ace )
{
- ace_state *state = screen->machine->driver_data<ace_state>();
+ ace_state *state = screen->machine().driver_data<ace_state>();
int offs;
/* first of all, fill the screen with the background color */
bitmap_fill(bitmap, cliprect, 0);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1],
0,
0,
0, 0,
state->objpos[0], state->objpos[1]);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[2],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[2],
0,
0,
0, 0,
state->objpos[2], state->objpos[3]);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[3],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[3],
0,
0,
0, 0,
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( ace )
for (offs = 0; offs < 8; offs++)
{
drawgfx_opaque(bitmap,/* ?? */
- cliprect, screen->machine->gfx[4],
+ cliprect, screen->machine().gfx[4],
offs,
0,
0, 0,
@@ -130,7 +130,7 @@ static PALETTE_INIT( ace )
static WRITE8_HANDLER( ace_characterram_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
if (state->characterram[offset] != data)
{
if (data & ~0x07)
@@ -139,22 +139,22 @@ static WRITE8_HANDLER( ace_characterram_w )
popmessage("write to %04x data = %02x\n", 0x8000 + offset, data);
}
state->characterram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], 0);
- gfx_element_mark_dirty(space->machine->gfx[2], 0);
- gfx_element_mark_dirty(space->machine->gfx[3], 0);
+ gfx_element_mark_dirty(space->machine().gfx[1], 0);
+ gfx_element_mark_dirty(space->machine().gfx[2], 0);
+ gfx_element_mark_dirty(space->machine().gfx[3], 0);
}
}
static WRITE8_HANDLER( ace_scoreram_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
state->scoreram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[4], offset / 32);
+ gfx_element_mark_dirty(space->machine().gfx[4], offset / 32);
}
static READ8_HANDLER( unk_r )
{
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
@@ -319,22 +319,22 @@ GFXDECODE_END
static STATE_POSTLOAD( ace_postload )
{
- gfx_element_mark_dirty(machine->gfx[1], 0);
- gfx_element_mark_dirty(machine->gfx[2], 0);
- gfx_element_mark_dirty(machine->gfx[3], 0);
- gfx_element_mark_dirty(machine->gfx[4], 0);
+ gfx_element_mark_dirty(machine.gfx[1], 0);
+ gfx_element_mark_dirty(machine.gfx[2], 0);
+ gfx_element_mark_dirty(machine.gfx[3], 0);
+ gfx_element_mark_dirty(machine.gfx[4], 0);
}
static MACHINE_START( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
+ ace_state *state = machine.driver_data<ace_state>();
state->save_item(NAME(state->objpos));
- machine->state().register_postload(ace_postload, NULL);
+ machine.state().register_postload(ace_postload, NULL);
}
static MACHINE_RESET( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
+ ace_state *state = machine.driver_data<ace_state>();
int i;
for (i = 0; i < 8; i++)
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 3201d2653f9..afe8ce74102 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -29,9 +29,9 @@ public:
-static void acefruit_update_irq(running_machine *machine, int vpos )
+static void acefruit_update_irq(running_machine &machine, int vpos )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
+ acefruit_state *state = machine.driver_data<acefruit_state>();
int col;
int row = vpos / 8;
@@ -52,33 +52,33 @@ static void acefruit_update_irq(running_machine *machine, int vpos )
static TIMER_CALLBACK( acefruit_refresh )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
- int vpos = machine->primary_screen->vpos();
+ acefruit_state *state = machine.driver_data<acefruit_state>();
+ int vpos = machine.primary_screen->vpos();
- machine->primary_screen->update_partial(vpos );
+ machine.primary_screen->update_partial(vpos );
acefruit_update_irq(machine, vpos );
vpos = ( ( vpos / 8 ) + 1 ) * 8;
- state->refresh_timer->adjust( machine->primary_screen->time_until_pos(vpos) );
+ state->refresh_timer->adjust( machine.primary_screen->time_until_pos(vpos) );
}
static VIDEO_START( acefruit )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
- state->refresh_timer = machine->scheduler().timer_alloc(FUNC(acefruit_refresh));
+ acefruit_state *state = machine.driver_data<acefruit_state>();
+ state->refresh_timer = machine.scheduler().timer_alloc(FUNC(acefruit_refresh));
}
static INTERRUPT_GEN( acefruit_vblank )
{
- acefruit_state *state = device->machine->driver_data<acefruit_state>();
+ acefruit_state *state = device->machine().driver_data<acefruit_state>();
device_set_input_line(device, 0, HOLD_LINE );
state->refresh_timer->adjust( attotime::zero );
}
static SCREEN_UPDATE( acefruit )
{
- acefruit_state *state = screen->machine->driver_data<acefruit_state>();
+ acefruit_state *state = screen->machine().driver_data<acefruit_state>();
int startrow = cliprect->min_y / 8;
int endrow = cliprect->max_y / 8;
int row;
@@ -98,7 +98,7 @@ static SCREEN_UPDATE( acefruit )
if( color < 0x4 )
{
- drawgfx_opaque( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
+ drawgfx_opaque( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
}
else if( color >= 0x5 && color <= 0x7 )
{
@@ -106,7 +106,7 @@ static SCREEN_UPDATE( acefruit )
int x;
static const int spriteskip[] = { 1, 2, 4 };
int spritesize = spriteskip[ color - 5 ];
- const gfx_element *gfx = screen->machine->gfx[ 0 ];
+ const gfx_element *gfx = screen->machine().gfx[ 0 ];
for( x = 0; x < 16; x++ )
{
@@ -168,9 +168,9 @@ static CUSTOM_INPUT( sidewndr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 1);
default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -184,13 +184,13 @@ static CUSTOM_INPUT( starspnr_coinage_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 2);
case 0x08:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 3);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 3);
default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -204,11 +204,11 @@ static CUSTOM_INPUT( starspnr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 2);
default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -217,7 +217,7 @@ static CUSTOM_INPUT( starspnr_payout_r )
static WRITE8_HANDLER( acefruit_colorram_w )
{
- acefruit_state *state = space->machine->driver_data<acefruit_state>();
+ acefruit_state *state = space->machine().driver_data<acefruit_state>();
state->colorram[ offset ] = data & 0xf;
}
@@ -595,7 +595,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sidewndr )
{
- UINT8 *ROM = machine->region( "maincpu" )->base();
+ UINT8 *ROM = machine.region( "maincpu" )->base();
/* replace "ret nc" ( 0xd0 ) with "di" */
ROM[ 0 ] = 0xf3;
/* this is either a bad dump or the cpu core should set the carry flag on reset */
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index f405e6a872f..dc1571ae5ae 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -90,7 +90,7 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( ac_get_bg_tile_info )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
int code = state->ac_bgvram[tile_index];
SET_TILE_INFO(
1,
@@ -101,7 +101,7 @@ static TILE_GET_INFO( ac_get_bg_tile_info )
static TILE_GET_INFO( ac_get_tx_tile_info )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
int code = state->ac_txvram[tile_index];
SET_TILE_INFO(
0,
@@ -110,9 +110,9 @@ static TILE_GET_INFO( ac_get_tx_tile_info )
0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask)
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -152,7 +152,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
xx = w;
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, flipy,
@@ -171,7 +171,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static VIDEO_START( acommand )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
state->tx_tilemap = tilemap_create(machine, ac_get_tx_tile_info,tilemap_scan_cols,8,8,512,32);
state->bg_tilemap = tilemap_create(machine, ac_get_bg_tile_info,bg_scan,16,16,256,16);
@@ -240,9 +240,9 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value)
static SCREEN_UPDATE( acommand )
{
- acommand_state *state = screen->machine->driver_data<acommand_state>();
+ acommand_state *state = screen->machine().driver_data<acommand_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect,0,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,0,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
/*Order might be wrong,but these for sure are the led numbers tested*/
@@ -259,21 +259,21 @@ static SCREEN_UPDATE( acommand )
static WRITE16_HANDLER( ac_bgvram_w )
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_bgvram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE16_HANDLER( ac_txvram_w )
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_txvram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static WRITE16_HANDLER(ac_bgscroll_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
switch(offset)
{
case 0: tilemap_set_scrollx(state->bg_tilemap,0,data); break;
@@ -284,7 +284,7 @@ static WRITE16_HANDLER(ac_bgscroll_w)
static WRITE16_HANDLER(ac_txscroll_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
switch(offset)
{
case 0: tilemap_set_scrollx(state->tx_tilemap,0,data); break;
@@ -298,7 +298,7 @@ static WRITE16_HANDLER(ac_txscroll_w)
static READ16_HANDLER(ac_devices_r)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
logerror("(PC=%06x) read at %04x\n",cpu_get_pc(space->cpu),offset*2);
switch(offset)
@@ -316,13 +316,13 @@ static READ16_HANDLER(ac_devices_r)
---- ---- ---- --x- (Activate Test)
---- ---- ---- ---x (Advance Thru Tests)
*/
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x0014/2:
case 0x0016/2:
- return space->machine->device<okim6295_device>("oki1")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki1")->read(*space,0);
case 0x0018/2:
case 0x001a/2:
- return space->machine->device<okim6295_device>("oki2")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki2")->read(*space,0);
case 0x0040/2:
/*
"Upper switch / Under Switch"
@@ -387,22 +387,22 @@ static READ16_HANDLER(ac_devices_r)
xxxx xxxx ---- ---- DIPSW4
---- ---- xxxx xxxx DIPSW3
*/
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
return state->ac_devram[offset];
}
static WRITE16_HANDLER(ac_devices_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_devram[offset]);
switch(offset)
{
case 0x00/2:
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * (data & 0x3));
oki2->set_bank_base(0x40000 * (data & 0x30) >> 4);
}
@@ -411,7 +411,7 @@ static WRITE16_HANDLER(ac_devices_w)
case 0x16/2:
if(ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
oki1->write(*space,0,data);
}
break;
@@ -419,7 +419,7 @@ static WRITE16_HANDLER(ac_devices_w)
case 0x1a/2:
if(ACCESSING_BITS_0_7)
{
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki2->write(*space,0,data);
}
break;
@@ -585,10 +585,10 @@ static TIMER_DEVICE_CALLBACK( acommand_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line(timer.machine, "maincpu", 2, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
if(scanline == 0) // vblank-in irq? (update palette and layers)
- cputag_set_input_line(timer.machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 3, HOLD_LINE);
}
static MACHINE_CONFIG_START( acommand, acommand_state )
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 474b9e8629c..c282dd1c486 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -36,20 +36,20 @@
static WRITE8_HANDLER( triothep_control_select_w )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
state->trio_control_select = data;
}
static READ8_HANDLER( triothep_control_r )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
switch (state->trio_control_select)
{
- case 0: return input_port_read(space->machine, "P1");
- case 1: return input_port_read(space->machine, "P2");
- case 2: return input_port_read(space->machine, "DSW1");
- case 3: return input_port_read(space->machine, "DSW2");
- case 4: return input_port_read(space->machine, "SYSTEM"); /* VBL */
+ case 0: return input_port_read(space->machine(), "P1");
+ case 1: return input_port_read(space->machine(), "P2");
+ case 2: return input_port_read(space->machine(), "DSW1");
+ case 3: return input_port_read(space->machine(), "DSW2");
+ case 4: return input_port_read(space->machine(), "SYSTEM"); /* VBL */
}
return 0xff;
@@ -57,7 +57,7 @@ static READ8_HANDLER( triothep_control_r )
static WRITE8_HANDLER( actfancr_sound_w )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -66,11 +66,11 @@ static WRITE8_HANDLER( actfancr_sound_w )
static WRITE8_HANDLER( actfancr_buffer_spriteram_w)
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
- UINT8* buffered_spriteram = space->machine->generic.buffered_spriteram.u8;
+ UINT8* buffered_spriteram = space->machine().generic.buffered_spriteram.u8;
// make a buffered copy
- memcpy(buffered_spriteram, space->machine->generic.spriteram.u8, 0x800);
+ memcpy(buffered_spriteram, space->machine().generic.spriteram.u8, 0x800);
// copy to a 16-bit region for our sprite draw code too
for (int i=0;i<0x800/2;i++)
{
@@ -284,7 +284,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- actfancr_state *state = device->machine->driver_data<actfancr_state>();
+ actfancr_state *state = device->machine().driver_data<actfancr_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
@@ -297,15 +297,15 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( actfancr )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_START( triothep )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
MACHINE_START_CALL(actfancr);
@@ -314,13 +314,13 @@ static MACHINE_START( triothep )
static MACHINE_RESET( actfancr )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
state->flipscreen = 0;
}
static MACHINE_RESET( triothep )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
MACHINE_RESET_CALL(actfancr);
state->trio_control_select = 0;
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 271c46ceb1f..bed48e9e8d6 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -178,7 +178,7 @@ public:
static void duart_irq_handler( device_t *device, UINT8 vector )
{
- adp_state *state = device->machine->driver_data<adp_state>();
+ adp_state *state = device->machine().driver_data<adp_state>();
device_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector);
};
@@ -190,25 +190,25 @@ static void duart_tx( device_t *device, int channel, UINT8 data )
}
};
-static void microtouch_tx( running_machine *machine, UINT8 data )
+static void microtouch_tx( running_machine &machine, UINT8 data )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
duart68681_rx_data(state->duart, 0, data);
}
static UINT8 duart_input( device_t *device )
{
- return input_port_read(device->machine, "DSW1");
+ return input_port_read(device->machine(), "DSW1");
}
static MACHINE_START( skattv )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
microtouch_init(machine, microtouch_tx, 0);
- state->maincpu = machine->device("maincpu");
- state->duart = machine->device("duart68681");
- state->hd63484 = machine->device("hd63484");
+ state->maincpu = machine.device("maincpu");
+ state->duart = machine.device("duart68681");
+ state->hd63484 = machine.device("hd63484");
state->save_item(NAME(state->mux_data));
state->save_item(NAME(state->register_active));
@@ -224,10 +224,10 @@ static MACHINE_START( skattv )
// hack to handle acrt rom
{
- UINT16 *rom = (UINT16*)machine->region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
int i;
- device_t *hd63484 = machine->device("hd63484");
+ device_t *hd63484 = machine.device("hd63484");
for(i = 0; i < 0x40000/2; ++i)
{
@@ -241,7 +241,7 @@ static MACHINE_START( skattv )
static MACHINE_RESET( skattv )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
state->mux_data = 0;
state->register_active = 0;
@@ -259,7 +259,7 @@ static PALETTE_INIT( adp )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -291,34 +291,34 @@ static VIDEO_START(adp)
static SCREEN_UPDATE( adp )
{
- adp_state *state = screen->machine->driver_data<adp_state>();
+ adp_state *state = screen->machine().driver_data<adp_state>();
int x, y, b, src;
b = ((hd63484_regs_r(state->hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(state->hd63484, 0xce/2, 0xffff);
#if 1
- if (input_code_pressed(screen->machine, KEYCODE_M)) b = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x2000 * 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x2000 * 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x2000 * 3;
- if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x2000 * 4;
- if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x2000 * 5;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x2000 * 6;
- if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x2000 * 7;
- if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x2000 * 8;
- if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x2000 * 9;
- if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x2000 * 10;
- if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x2000 * 11;
- if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x2000 * 12;
- if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x2000 * 13;
- if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x2000 * 14;
- if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x2000 * 15;
- if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x2000 * 16;
- if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x2000 * 17;
- if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x2000 * 18;
- if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x2000 * 19;
- if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x2000 * 20;
- if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x2000 * 21;
- if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x2000 * 22;
+ if (input_code_pressed(screen->machine(), KEYCODE_M)) b = 0;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) b += 0x2000 * 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) b += 0x2000 * 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) b += 0x2000 * 3;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) b += 0x2000 * 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) b += 0x2000 * 5;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) b += 0x2000 * 6;
+ if (input_code_pressed(screen->machine(), KEYCODE_U)) b += 0x2000 * 7;
+ if (input_code_pressed(screen->machine(), KEYCODE_I)) b += 0x2000 * 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) b += 0x2000 * 9;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) b += 0x2000 * 10;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) b += 0x2000 * 11;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) b += 0x2000 * 12;
+ if (input_code_pressed(screen->machine(), KEYCODE_G)) b += 0x2000 * 13;
+ if (input_code_pressed(screen->machine(), KEYCODE_H)) b += 0x2000 * 14;
+ if (input_code_pressed(screen->machine(), KEYCODE_J)) b += 0x2000 * 15;
+ if (input_code_pressed(screen->machine(), KEYCODE_K)) b += 0x2000 * 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_Z)) b += 0x2000 * 17;
+ if (input_code_pressed(screen->machine(), KEYCODE_X)) b += 0x2000 * 18;
+ if (input_code_pressed(screen->machine(), KEYCODE_C)) b += 0x2000 * 19;
+ if (input_code_pressed(screen->machine(), KEYCODE_V)) b += 0x2000 * 20;
+ if (input_code_pressed(screen->machine(), KEYCODE_B)) b += 0x2000 * 21;
+ if (input_code_pressed(screen->machine(), KEYCODE_N)) b += 0x2000 * 22;
#endif
for (y = 0;y < 280;y++)
{
@@ -333,7 +333,7 @@ static SCREEN_UPDATE( adp )
b++;
}
}
-if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
+if (!input_code_pressed(screen->machine(), KEYCODE_O)) // debug: toggle window
if ((hd63484_regs_r(state->hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
{
int sy = (hd63484_regs_r(state->hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(state->hd63484, 0x88/2, 0xffff) >> 8);
@@ -368,49 +368,49 @@ if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
static READ16_HANDLER( test_r )
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
int value = 0xffff;
switch (state->mux_data)
{
- case 0x00: value = input_port_read(space->machine, "x0"); break;
- case 0x01: value = input_port_read(space->machine, "x1"); break;
- case 0x02: value = input_port_read(space->machine, "x2"); break;
- case 0x03: value = input_port_read(space->machine, "1P_UP"); break;
- case 0x04: value = input_port_read(space->machine, "1P_B1"); break;
- case 0x05: value = input_port_read(space->machine, "x5"); break;
- case 0x06: value = input_port_read(space->machine, "1P_RIGHT"); break;
- case 0x07: value = input_port_read(space->machine, "1P_DOWN"); break;
- case 0x08: value = input_port_read(space->machine, "1P_LEFT"); break;
- case 0x09: value = input_port_read(space->machine, "x9"); break;
- case 0x0a: value = input_port_read(space->machine, "x10"); break;
- case 0x0b: value = input_port_read(space->machine, "x11"); break;
- case 0x0c: value = input_port_read(space->machine, "x12"); break;
- case 0x0d: value = input_port_read(space->machine, "x13"); break;
- case 0x0e: value = input_port_read(space->machine, "1P_START"); break;
- case 0x0f: value = input_port_read(space->machine, "1P_COIN"); break;
+ case 0x00: value = input_port_read(space->machine(), "x0"); break;
+ case 0x01: value = input_port_read(space->machine(), "x1"); break;
+ case 0x02: value = input_port_read(space->machine(), "x2"); break;
+ case 0x03: value = input_port_read(space->machine(), "1P_UP"); break;
+ case 0x04: value = input_port_read(space->machine(), "1P_B1"); break;
+ case 0x05: value = input_port_read(space->machine(), "x5"); break;
+ case 0x06: value = input_port_read(space->machine(), "1P_RIGHT"); break;
+ case 0x07: value = input_port_read(space->machine(), "1P_DOWN"); break;
+ case 0x08: value = input_port_read(space->machine(), "1P_LEFT"); break;
+ case 0x09: value = input_port_read(space->machine(), "x9"); break;
+ case 0x0a: value = input_port_read(space->machine(), "x10"); break;
+ case 0x0b: value = input_port_read(space->machine(), "x11"); break;
+ case 0x0c: value = input_port_read(space->machine(), "x12"); break;
+ case 0x0d: value = input_port_read(space->machine(), "x13"); break;
+ case 0x0e: value = input_port_read(space->machine(), "1P_START"); break;
+ case 0x0f: value = input_port_read(space->machine(), "1P_COIN"); break;
}
state->mux_data++;
state->mux_data &= 0xf;
/*
- switch (space->machine->rand() & 3)
+ switch (space->machine().rand() & 3)
{
case 0:
return 0;
case 1:
return 0xffff;
default:
- return space->machine->rand() & 0xffff;
+ return space->machine().rand() & 0xffff;
}
*/
- return value | (space->machine->rand() & 0x0000);
+ return value | (space->machine().rand() & 0x0000);
}
/*???*/
static WRITE16_HANDLER(wh2_w)
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
state->register_active = data;
}
@@ -419,15 +419,15 @@ static READ8_DEVICE_HANDLER(t2_r)
UINT8 res;
int h,w;
res = 0;
- h = device->machine->primary_screen->height();
- w = device->machine->primary_screen->width();
+ h = device->machine().primary_screen->height();
+ w = device->machine().primary_screen->width();
// popmessage("%d %d",h,w);
- if (device->machine->primary_screen->hpos() > h)
+ if (device->machine().primary_screen->hpos() > h)
res|= 0x20; //hblank
- if (device->machine->primary_screen->vpos() > w)
+ if (device->machine().primary_screen->vpos() > w)
res|= 0x40; //vblank
return res;
@@ -465,7 +465,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( ramdac_io_w )
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
switch(offset)
{
case 0:
@@ -488,7 +488,7 @@ static WRITE8_HANDLER( ramdac_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
state->pal.offs&=0xff;
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index 34f8db6f119..fd8cc241814 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -30,7 +30,7 @@ Revisions:
static READ8_HANDLER( aeroboto_201_r )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
/* if you keep a button pressed during boot, the game will expect this */
/* serie of values to be returned from 3004, and display "PASS 201" if it is */
static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 };
@@ -42,7 +42,7 @@ static READ8_HANDLER( aeroboto_201_r )
static INTERRUPT_GEN( aeroboto_interrupt )
{
- aeroboto_state *state = device->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = device->machine().driver_data<aeroboto_state>();
if (!state->disable_irq)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -52,13 +52,13 @@ static INTERRUPT_GEN( aeroboto_interrupt )
static READ8_HANDLER( aeroboto_irq_ack_r )
{
- cputag_set_input_line(space->machine,"maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(),"maincpu", 0, CLEAR_LINE);
return 0xff;
}
static READ8_HANDLER( aeroboto_2973_r )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
state->mainram[0x02be] = 0;
return 0xff;
@@ -66,7 +66,7 @@ static READ8_HANDLER( aeroboto_2973_r )
static WRITE8_HANDLER ( aeroboto_1a2_w )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
state->mainram[0x01a2] = data;
if (data)
@@ -228,10 +228,10 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( formatz )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
- state->stars_rom = machine->region("gfx2")->base();
- state->stars_length = machine->region("gfx2")->bytes();
+ state->stars_rom = machine.region("gfx2")->base();
+ state->stars_length = machine.region("gfx2")->bytes();
state->save_item(NAME(state->disable_irq));
state->save_item(NAME(state->count));
@@ -239,7 +239,7 @@ static MACHINE_START( formatz )
static MACHINE_RESET( formatz )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
state->disable_irq = 0;
state->count = 0;
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index 34a92e24d60..edcd2cf1a46 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -68,7 +68,7 @@ Verification still needed for the other PCBs.
static WRITE16_HANDLER( sound_command_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
@@ -79,7 +79,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( turbofrc_sound_command_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_8_15)
{
state->pending_command = 1;
@@ -90,7 +90,7 @@ static WRITE16_HANDLER( turbofrc_sound_command_w )
static WRITE16_HANDLER( aerfboot_soundlatch_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if(ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
@@ -100,19 +100,19 @@ static WRITE16_HANDLER( aerfboot_soundlatch_w )
static READ16_HANDLER( pending_command_r )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
return state->pending_command;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( aerofgt_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
@@ -134,7 +134,7 @@ static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
/*bit 2 (0x4) setted too?*/
if (data & 0x4)
memcpy(&oki[0x20000], &oki[((data & 0x3) * 0x20000) + 0x40000], 0x20000);
@@ -1282,7 +1282,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- aerofgt_state *state = device->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = device->machine().driver_data<aerofgt_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1299,15 +1299,15 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( common )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->pending_command));
}
static MACHINE_START( aerofgt )
{
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rom[0x10000], 0x8000);
@@ -1316,7 +1316,7 @@ static MACHINE_START( aerofgt )
static MACHINE_RESET( common )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->pending_command = 0;
}
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 18b4f21d3ad..04c9d015470 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -228,7 +228,7 @@ Code at 505: waits for bit 1 to go low, writes command, waits for bit
/* Read/Write Handlers */
static READ8_HANDLER( devram_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
// There's an MCU here, possibly
switch (offset)
@@ -254,7 +254,7 @@ static READ8_HANDLER( devram_r )
/* Reading eff4, F0 times must yield at most 80-1 consecutive
equal values */
case 0xff4:
- return space->machine->rand();
+ return space->machine().rand();
default:
return state->devram[offset];
@@ -263,22 +263,22 @@ static READ8_HANDLER( devram_r )
static WRITE8_HANDLER( master_nmi_trigger_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( master_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( slave_bankswitch_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
// used at the end of levels, after defeating the boss, to leave trails
pandora_set_clear_bitmap(state->pandora, data & 0x20);
@@ -286,12 +286,12 @@ static WRITE8_HANDLER( slave_bankswitch_w )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank3", data & 0x07);
+ memory_set_bank(space->machine(), "bank3", data & 0x07);
}
static READ8_HANDLER( soundcommand_status_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
return 4 + state->soundlatch_status * 2 + (1 - state->soundlatch2_status);
@@ -299,21 +299,21 @@ static READ8_HANDLER( soundcommand_status_r )
static READ8_HANDLER( soundcommand_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->soundlatch_status = 0; // soundlatch has been read
return soundlatch_r(space, 0);
}
static READ8_HANDLER( soundcommand2_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->soundlatch2_status = 0; // soundlatch2 has been read
return soundlatch2_r(space, 0);
}
static WRITE8_HANDLER( soundcommand_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch_w(space, 0, data);
state->soundlatch_status = 1; // soundlatch has been written
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
@@ -321,14 +321,14 @@ static WRITE8_HANDLER( soundcommand_w )
static WRITE8_HANDLER( soundcommand2_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch2_w(space, 0, data);
state->soundlatch2_status = 1; // soundlatch2 has been written
}
static WRITE8_HANDLER( airbustr_paletteram_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
int val;
/* ! byte 1 ! ! byte 0 ! */
@@ -338,15 +338,15 @@ static WRITE8_HANDLER( airbustr_paletteram_w )
state->paletteram[offset] = data;
val = (state->paletteram[offset | 1] << 8) | state->paletteram[offset & ~1];
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
}
static WRITE8_HANDLER( airbustr_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
- coin_lockout_w(space->machine, 0, ~data & 4);
- coin_lockout_w(space->machine, 1, ~data & 8);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
+ coin_lockout_w(space->machine(), 0, ~data & 4);
+ coin_lockout_w(space->machine(), 1, ~data & 8);
}
/* Memory Maps */
@@ -559,14 +559,14 @@ static const ym2203_interface ym2203_config =
static INTERRUPT_GEN( master_interrupt )
{
- airbustr_state *state = device->machine->driver_data<airbustr_state>();
+ airbustr_state *state = device->machine().driver_data<airbustr_state>();
state->master_addr ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->master_addr);
}
static INTERRUPT_GEN( slave_interrupt )
{
- airbustr_state *state = device->machine->driver_data<airbustr_state>();
+ airbustr_state *state = device->machine().driver_data<airbustr_state>();
state->slave_addr ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->slave_addr);
}
@@ -575,10 +575,10 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
- UINT8 *MASTER = machine->region("master")->base();
- UINT8 *SLAVE = machine->region("slave")->base();
- UINT8 *AUDIO = machine->region("audiocpu")->base();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
+ UINT8 *MASTER = machine.region("master")->base();
+ UINT8 *SLAVE = machine.region("slave")->base();
+ UINT8 *AUDIO = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &MASTER[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 3, 5, &MASTER[0x10000], 0x4000);
@@ -587,10 +587,10 @@ static MACHINE_START( airbustr )
memory_configure_bank(machine, "bank3", 0, 3, &AUDIO[0x00000], 0x4000);
memory_configure_bank(machine, "bank3", 3, 5, &AUDIO[0x10000], 0x4000);
- state->master = machine->device("master");
- state->slave = machine->device("slave");
- state->audiocpu = machine->device("audiocpu");
- state->pandora = machine->device("pandora");
+ state->master = machine.device("master");
+ state->slave = machine.device("slave");
+ state->audiocpu = machine.device("audiocpu");
+ state->pandora = machine.device("pandora");
state->save_item(NAME(state->soundlatch_status));
state->save_item(NAME(state->soundlatch2_status));
@@ -605,7 +605,7 @@ static MACHINE_START( airbustr )
static MACHINE_RESET( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
state->soundlatch_status = state->soundlatch2_status = 0;
state->master_addr = 0xff;
@@ -798,7 +798,7 @@ ROM_END
static DRIVER_INIT( airbustr )
{
- machine->device("master")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe000, 0xefff, FUNC(devram_r)); // protection device lives here
+ machine.device("master")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe000, 0xefff, FUNC(devram_r)); // protection device lives here
}
diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c
index 01c80cbce51..963a89515c9 100644
--- a/src/mame/drivers/ajax.c
+++ b/src/mame/drivers/ajax.c
@@ -137,7 +137,7 @@ INPUT_PORTS_END
static WRITE8_HANDLER( sound_bank_w )
{
- ajax_state *state = space->machine->driver_data<ajax_state>();
+ ajax_state *state = space->machine().driver_data<ajax_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */
diff --git a/src/mame/drivers/albazc.c b/src/mame/drivers/albazc.c
index 5178f1f87e2..95770d5bf4b 100644
--- a/src/mame/drivers/albazc.c
+++ b/src/mame/drivers/albazc.c
@@ -51,9 +51,9 @@ static VIDEO_START( hanaroku )
{
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- albazc_state *state = machine->driver_data<albazc_state>();
+ albazc_state *state = machine.driver_data<albazc_state>();
int i;
for (i = 511; i >= 0; i--)
@@ -72,7 +72,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], code, color, flipx, flipy,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy,
sx, sy, 0);
}
}
@@ -80,7 +80,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(hanaroku)
{
bitmap_fill(bitmap, cliprect, 0x1f0); // ???
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -99,11 +99,11 @@ static WRITE8_HANDLER( hanaroku_out_0_w )
7 meter5 (start)
*/
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
- coin_counter_w(space->machine, 3, data & 0x08);
- coin_counter_w(space->machine, 4, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
+ coin_counter_w(space->machine(), 3, data & 0x08);
+ coin_counter_w(space->machine(), 4, data & 0x80);
}
static WRITE8_HANDLER( hanaroku_out_1_w )
@@ -129,7 +129,7 @@ static WRITE8_HANDLER( hanaroku_out_2_w )
static WRITE8_HANDLER( albazc_vregs_w )
{
- albazc_state *state = space->machine->driver_data<albazc_state>();
+ albazc_state *state = space->machine().driver_data<albazc_state>();
#ifdef UNUSED_FUNCTION
{
@@ -142,7 +142,7 @@ static WRITE8_HANDLER( albazc_vregs_w )
if(offset == 0)
{
/* core bug with this? */
- //flip_screen_set(space->machine, (data & 0x40) >> 6);
+ //flip_screen_set(space->machine(), (data & 0x40) >> 6);
state->flip_bit = (data & 0x40) >> 6;
}
}
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index 320bf0b21bf..dd5f101ebf3 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -88,7 +88,7 @@ public:
static TILE_GET_INFO( y_get_bg_tile_info )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@@ -102,13 +102,13 @@ static TILE_GET_INFO( y_get_bg_tile_info )
static VIDEO_START( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
state->bg_tilemap = tilemap_create(machine, y_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( yumefuda )
{
- albazg_state *state = screen->machine->driver_data<albazg_state>();
+ albazg_state *state = screen->machine().driver_data<albazg_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -133,14 +133,14 @@ GFXDECODE_END
static WRITE8_HANDLER( yumefuda_vram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( yumefuda_cram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -148,14 +148,14 @@ static WRITE8_HANDLER( yumefuda_cram_w )
/*Custom RAM (Thrash Protection)*/
static READ8_HANDLER( custom_ram_r )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(space->cpu));
return state->cus_ram[offset];// ^ 0x55;
}
static WRITE8_HANDLER( custom_ram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(space->cpu));
if(state->prot_lock)
state->cus_ram[offset] = data;
@@ -164,23 +164,23 @@ static WRITE8_HANDLER( custom_ram_w )
/*this might be used as NVRAM commands btw*/
static WRITE8_HANDLER( prot_lock_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("PC %04x Prot lock value written %02x\n", cpu_get_pc(space->cpu), data);
state->prot_lock = data;
}
static READ8_DEVICE_HANDLER( mux_r )
{
- albazg_state *state = device->machine->driver_data<albazg_state>();
+ albazg_state *state = device->machine().driver_data<albazg_state>();
switch(state->mux_data)
{
- case 0x00: return input_port_read(device->machine, "IN0");
- case 0x01: return input_port_read(device->machine, "IN1");
- case 0x02: return input_port_read(device->machine, "IN2");
- case 0x04: return input_port_read(device->machine, "IN3");
- case 0x08: return input_port_read(device->machine, "IN4");
- case 0x10: return input_port_read(device->machine, "IN5");
- case 0x20: return input_port_read(device->machine, "IN6");
+ case 0x00: return input_port_read(device->machine(), "IN0");
+ case 0x01: return input_port_read(device->machine(), "IN1");
+ case 0x02: return input_port_read(device->machine(), "IN2");
+ case 0x04: return input_port_read(device->machine(), "IN3");
+ case 0x08: return input_port_read(device->machine(), "IN4");
+ case 0x10: return input_port_read(device->machine(), "IN5");
+ case 0x20: return input_port_read(device->machine(), "IN6");
}
return 0xff;
@@ -188,7 +188,7 @@ static READ8_DEVICE_HANDLER( mux_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- albazg_state *state = device->machine->driver_data<albazg_state>();
+ albazg_state *state = device->machine().driver_data<albazg_state>();
int new_bank = (data & 0xc0) >> 6;
//0x10000 "Learn Mode"
@@ -198,7 +198,7 @@ static WRITE8_DEVICE_HANDLER( mux_w )
if( state->bank != new_bank)
{
state->bank = new_bank;
- memory_set_bank(device->machine, "bank1", state->bank);
+ memory_set_bank(device->machine(), "bank1", state->bank);
}
state->mux_data = data & ~0xc0;
@@ -206,12 +206,12 @@ static WRITE8_DEVICE_HANDLER( mux_w )
static WRITE8_DEVICE_HANDLER( yumefuda_output_w )
{
- coin_counter_w(device->machine, 0, ~data & 4);
- coin_counter_w(device->machine, 1, ~data & 2);
- coin_lockout_global_w(device->machine, data & 1);
+ coin_counter_w(device->machine(), 0, ~data & 4);
+ coin_counter_w(device->machine(), 1, ~data & 2);
+ coin_lockout_global_w(device->machine(), data & 1);
//data & 0x10 hopper-c (active LOW)
//data & 0x08 divider (active HIGH)
- flip_screen_set(device->machine, ~data & 0x20);
+ flip_screen_set(device->machine(), ~data & 0x20);
}
static const ay8910_interface ay8910_config =
@@ -375,8 +375,8 @@ INPUT_PORTS_END
static MACHINE_START( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ albazg_state *state = machine.driver_data<albazg_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
@@ -387,7 +387,7 @@ static MACHINE_START( yumefuda )
static MACHINE_RESET( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
state->mux_data = 0;
state->bank = -1;
state->prot_lock = 0;
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 6c8b46ff09f..92f917d3e32 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -174,9 +174,9 @@ Notes:
static READ32_HANDLER( aleck_dips_r )
{
if (offset == 0)
- return (input_port_read(space->machine, "IN0")); /* mtetrisc has regular inputs here */
+ return (input_port_read(space->machine(), "IN0")); /* mtetrisc has regular inputs here */
else if (offset == 1)
- return (input_port_read(space->machine, "IN1"));
+ return (input_port_read(space->machine(), "IN1"));
return 0;
}
@@ -563,7 +563,7 @@ static const mips3_config vr4300_config =
static INTERRUPT_GEN( n64_vblank )
{
- signal_rcp_interrupt(device->machine, VI_INTERRUPT);
+ signal_rcp_interrupt(device->machine(), VI_INTERRUPT);
}
static MACHINE_CONFIG_START( aleck64, _n64_state )
@@ -603,7 +603,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( aleck64 )
{
- UINT8 *rom = machine->region("user2")->base();
+ UINT8 *rom = machine.region("user2")->base();
rom[0x67c] = 0;
rom[0x67d] = 0;
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 1e6552a44d7..2818fbdcd4e 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -56,8 +56,8 @@ static int get_lightgun_pos(screen_device &screen, int player, int *x, int *y)
{
const rectangle &visarea = screen.visible_area();
- int xpos = input_port_read_safe(screen.machine, (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
- int ypos = input_port_read_safe(screen.machine, (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
+ int xpos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
+ int ypos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
if (xpos == -1 || ypos == -1)
return FALSE;
@@ -95,10 +95,10 @@ static VIDEO_START( alg )
static MACHINE_START( alg )
{
- alg_state *state = machine->driver_data<alg_state>();
- state->laserdisc = machine->device("laserdisc");
+ alg_state *state = machine.driver_data<alg_state>();
+ state->laserdisc = machine.device("laserdisc");
- state->serial_timer = machine->scheduler().timer_alloc(FUNC(response_timer));
+ state->serial_timer = machine.scheduler().timer_alloc(FUNC(response_timer));
state->serial_timer_active = FALSE;
}
@@ -118,7 +118,7 @@ static MACHINE_RESET( alg )
static TIMER_CALLBACK( response_timer )
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* if we still have data to send, do it now */
if (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
@@ -137,9 +137,9 @@ static TIMER_CALLBACK( response_timer )
}
-static void vsync_callback(running_machine *machine)
+static void vsync_callback(running_machine &machine)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* if we have data available, set a timer to read it */
if (!state->serial_timer_active && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
@@ -150,9 +150,9 @@ static void vsync_callback(running_machine *machine)
}
-static void serial_w(running_machine *machine, UINT16 data)
+static void serial_w(running_machine &machine, UINT16 data)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* write to the laserdisc player */
laserdisc_data_w(state->laserdisc, data & 0xff);
@@ -173,9 +173,9 @@ static void serial_w(running_machine *machine, UINT16 data)
*
*************************************/
-static void alg_potgo_w(running_machine *machine, UINT16 data)
+static void alg_potgo_w(running_machine &machine, UINT16 data)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* bit 15 controls whether pin 9 is input/output */
/* bit 14 controls the value, which selects which player's controls to read */
@@ -185,30 +185,30 @@ static void alg_potgo_w(running_machine *machine, UINT16 data)
static CUSTOM_INPUT( lightgun_pos_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
int x = 0, y = 0;
/* get the position based on the input select */
- get_lightgun_pos(*field->port->machine->primary_screen, state->input_select, &x, &y);
+ get_lightgun_pos(*field->port->machine().primary_screen, state->input_select, &x, &y);
return (y << 8) | (x >> 2);
}
static CUSTOM_INPUT( lightgun_trigger_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
/* read the trigger control based on the input select */
- return (input_port_read(field->port->machine, "TRIGGERS") >> state->input_select) & 1;
+ return (input_port_read(field->port->machine(), "TRIGGERS") >> state->input_select) & 1;
}
static CUSTOM_INPUT( lightgun_holster_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
/* read the holster control based on the input select */
- return (input_port_read(field->port->machine, "TRIGGERS") >> (2 + state->input_select)) & 1;
+ return (input_port_read(field->port->machine(), "TRIGGERS") >> (2 + state->input_select)) & 1;
}
@@ -221,10 +221,10 @@ static CUSTOM_INPUT( lightgun_holster_r )
static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
@@ -239,13 +239,13 @@ static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
static READ8_DEVICE_HANDLER( alg_cia_0_porta_r )
{
- return input_port_read(device->machine, "FIRE") | 0x3f;
+ return input_port_read(device->machine(), "FIRE") | 0x3f;
}
static READ8_DEVICE_HANDLER( alg_cia_0_portb_r )
{
- logerror("%s:alg_cia_0_portb_r\n", device->machine->describe_context());
+ logerror("%s:alg_cia_0_portb_r\n", device->machine().describe_context());
return 0xff;
}
@@ -253,20 +253,20 @@ static READ8_DEVICE_HANDLER( alg_cia_0_portb_r )
static WRITE8_DEVICE_HANDLER( alg_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:alg_cia_0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:alg_cia_0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
static READ8_DEVICE_HANDLER( alg_cia_1_porta_r )
{
- logerror("%s:alg_cia_1_porta_r\n", device->machine->describe_context());
+ logerror("%s:alg_cia_1_porta_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( alg_cia_1_porta_w )
{
- logerror("%s:alg_cia_1_porta_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:alg_cia_1_porta_w(%02x)\n", device->machine().describe_context(), data);
}
@@ -678,9 +678,9 @@ ROM_END
*
*************************************/
-static void alg_init(running_machine *machine)
+static void alg_init(running_machine &machine)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
static const amiga_machine_interface alg_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -696,7 +696,7 @@ static void alg_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
}
@@ -709,8 +709,8 @@ static void alg_init(running_machine *machine)
static DRIVER_INIT( palr1 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -729,8 +729,8 @@ static DRIVER_INIT( palr1 )
static DRIVER_INIT( palr3 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -748,8 +748,8 @@ static DRIVER_INIT( palr3 )
static DRIVER_INIT( palr6 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -770,7 +770,7 @@ static DRIVER_INIT( palr6 )
static DRIVER_INIT( aplatoon )
{
/* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */
- UINT8 *rom = machine->region("user2")->base();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x40000);
int i;
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 709887dfeaf..27803f2f3cd 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -21,7 +21,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking );
static INTERRUPT_GEN( aliens_interrupt )
{
- aliens_state *state = device->machine->driver_data<aliens_state>();
+ aliens_state *state = device->machine().driver_data<aliens_state>();
if (k051960_is_irq_enabled(state->k051960))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -29,17 +29,17 @@ static INTERRUPT_GEN( aliens_interrupt )
static READ8_HANDLER( bankedram_r )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -49,11 +49,11 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( aliens_coin_counter_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
/* bits 0-1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 5 = select work RAM or palette */
state->palette_selected = data & 0x20;
@@ -73,7 +73,7 @@ static WRITE8_HANDLER( aliens_coin_counter_w )
static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
{
- aliens_state *state = device->machine->driver_data<aliens_state>();
+ aliens_state *state = device->machine().driver_data<aliens_state>();
/* b1: bank for chanel A */
/* b0: bank for chanel B */
@@ -95,7 +95,7 @@ static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -112,7 +112,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -237,26 +237,26 @@ static const k051960_interface aliens_k051960_intf =
static MACHINE_START( aliens )
{
- aliens_state *state = machine->driver_data<aliens_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ aliens_state *state = machine.driver_data<aliens_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->palette_selected));
}
static MACHINE_RESET( aliens )
{
- aliens_state *state = machine->driver_data<aliens_state>();
+ aliens_state *state = machine.driver_data<aliens_state>();
- konami_configure_set_lines(machine->device("maincpu"), aliens_banking);
+ konami_configure_set_lines(machine.device("maincpu"), aliens_banking);
state->palette_selected = 0;
}
@@ -554,7 +554,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking )
bank -= 4;
bank += (lines & 0x0f);
- memory_set_bank(device->machine, "bank1", bank);
+ memory_set_bank(device->machine(), "bank1", bank);
}
GAME( 1990, aliens, 0, aliens, aliens, 0, ROT0, "Konami", "Aliens (World set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index a3bbc190729..430fa1a5ea0 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -206,14 +206,14 @@ DIP locations verified from manuals for:
static WRITE16_HANDLER( tnextspc_coin_counters_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE16_HANDLER( tnextspc_unknown_w )
{
logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", cpu_get_pc(space->cpu), offset, data);
if (offset == 0)
- alpha68k_flipscreen_w(space->machine, data & 0x100);
+ alpha68k_flipscreen_w(space->machine(), data & 0x100);
}
static WRITE16_HANDLER( alpha_microcontroller_w )
@@ -221,72 +221,72 @@ static WRITE16_HANDLER( alpha_microcontroller_w )
logerror("%04x: Alpha write trigger at %04x (%04x)\n", cpu_get_pc(space->cpu), offset, data);
/* 0x44 = coin clear signal to microcontroller? */
if (offset == 0x2d && ACCESSING_BITS_0_7)
- alpha68k_flipscreen_w(space->machine, data & 1);
+ alpha68k_flipscreen_w(space->machine(), data & 1);
}
/******************************************************************************/
static READ16_HANDLER( kyros_dip_r )
{
- return input_port_read(space->machine, "IN1") << 8;
+ return input_port_read(space->machine(), "IN1") << 8;
}
static READ16_HANDLER( control_1_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(input_port_read(space->machine, "IN0") + (input_port_read(space->machine, "IN1") << 8));
+ return ~(input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
- return (input_port_read(space->machine, "IN0") + (input_port_read(space->machine, "IN1") << 8));
+ return (input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
}
static READ16_HANDLER( control_2_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(input_port_read(space->machine, "IN3") + ((~(1 << input_port_read(space->machine, "IN5"))) << 8));
+ return ~(input_port_read(space->machine(), "IN3") + ((~(1 << input_port_read(space->machine(), "IN5"))) << 8));
- return input_port_read(space->machine, "IN3") + /* Low byte of CN1 */
- ((~(1 << input_port_read(space->machine, "IN5"))) << 8);
+ return input_port_read(space->machine(), "IN3") + /* Low byte of CN1 */
+ ((~(1 << input_port_read(space->machine(), "IN5"))) << 8);
}
static READ16_HANDLER( control_2_V_r )
{
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
static READ16_HANDLER( control_3_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(((~(1 << input_port_read(space->machine, "IN6"))) << 8) & 0xff00);
+ return ~(((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00);
- return ((~(1 << input_port_read(space->machine, "IN6"))) << 8) & 0xff00;
+ return ((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00;
}
/* High 4 bits of CN1 & CN2 */
static READ16_HANDLER( control_4_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~((((~(1 << input_port_read(space->machine, "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine, "IN5")))) & 0x0f00));
+ return ~((((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00));
- return (((~(1 << input_port_read(space->machine, "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine, "IN5")))) & 0x0f00);
+ return (((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00);
}
static READ16_HANDLER( jongbou_inputs_r )
{
- UINT8 inp1 = input_port_read(space->machine, "IN3");
- UINT8 inp2 = input_port_read(space->machine, "IN4");
+ UINT8 inp1 = input_port_read(space->machine(), "IN3");
+ UINT8 inp2 = input_port_read(space->machine(), "IN4");
inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
- return input_port_read(space->machine, "IN0") | inp1 | inp2 << 4;
+ return input_port_read(space->machine(), "IN0") | inp1 | inp2 << 4;
}
@@ -310,12 +310,12 @@ static WRITE16_HANDLER( alpha68k_V_sound_w )
if(ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff);
if(ACCESSING_BITS_8_15)
- alpha68k_V_video_bank_w(space->machine, (data >> 8) & 0xff);
+ alpha68k_V_video_bank_w(space->machine(), (data >> 8) & 0xff);
}
//AT
static WRITE16_HANDLER( paddlema_soundlatch_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@@ -326,7 +326,7 @@ static WRITE16_HANDLER( paddlema_soundlatch_w )
static WRITE16_HANDLER( tnextspc_soundlatch_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@@ -345,7 +345,7 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
*/
static const UINT8 coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
@@ -355,15 +355,15 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
state->trigstate++;
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
state->latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "IN1") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN1") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -373,13 +373,13 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
else
state->credits = 0;
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
state->latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "IN1") >>1 ) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN1") >>1 ) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -427,13 +427,13 @@ static READ16_HANDLER( alpha_II_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 2 */
- state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x22: /* Coin value */
@@ -441,9 +441,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -452,9 +452,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
if (state->game_id == ALPHA68K_BTLFIELDB)
- state->coinvalue = (input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
else
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
@@ -466,7 +466,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -475,9 +475,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
if (state->game_id == ALPHA68K_BTLFIELDB)
- state->coinvalue = (input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
else
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
@@ -522,21 +522,21 @@ static READ16_HANDLER( alpha_V_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 1 */
- state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x22: /* Coin value */
state->shared_ram[0x22] = (source & 0xff00) | (state->credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -544,7 +544,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -555,7 +555,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id>>8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -563,7 +563,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -589,12 +589,12 @@ static READ16_HANDLER( alpha_V_trigger_r )
break;
case 0x1f00: /* Dipswitch 1 */
- state->shared_ram[0x1f00] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0x1f00] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x1f29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x1f29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -602,7 +602,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -613,7 +613,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x1f29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -621,7 +621,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -642,7 +642,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
the microcontroller supplies it (it does for all the other games,
but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
source = state->shared_ram[0x0163];
- state->shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(space->machine, "IN4") << 8);
+ state->shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(space->machine(), "IN4") << 8);
return 0;
case 0x1ffe: /* Custom ID check */
@@ -742,7 +742,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sound_bank_w )
{
- memory_set_bank(space->machine, "bank7", data);
+ memory_set_bank(space->machine(), "bank7", data);
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
@@ -1841,7 +1841,7 @@ static const ym2203_interface ym2203_config =
static void YM3812_irq( device_t *device, int param )
{
- alpha68k_state *state = device->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = device->machine().driver_data<alpha68k_state>();
device_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE);
}
@@ -1864,9 +1864,9 @@ static INTERRUPT_GEN( alpha68k_interrupt )
static MACHINE_START( common )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->trigstate));
state->save_item(NAME(state->deposits1));
@@ -1880,7 +1880,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->trigstate = 0;
state->deposits1 = 0;
@@ -1894,8 +1894,8 @@ static MACHINE_RESET( common )
static MACHINE_START( alpha68k_V )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 32, &ROM[0x10000], 0x4000);
@@ -1907,7 +1907,7 @@ static MACHINE_START( alpha68k_V )
static MACHINE_RESET( alpha68k_V )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@@ -1917,7 +1917,7 @@ static MACHINE_RESET( alpha68k_V )
static MACHINE_RESET( alpha68k_II )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@@ -1930,8 +1930,8 @@ static MACHINE_RESET( alpha68k_II )
static MACHINE_START( alpha68k_II )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 28, &ROM[0x10000], 0x4000);
@@ -3089,7 +3089,7 @@ ROM_END
static DRIVER_INIT( sstingry )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3098,7 +3098,7 @@ static DRIVER_INIT( sstingry )
static DRIVER_INIT( kyros )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x0012;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3107,8 +3107,8 @@ static DRIVER_INIT( kyros )
static DRIVER_INIT( jongbou )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0c0000, 0x0c0001, FUNC(jongbou_inputs_r));
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0c0000, 0x0c0001, FUNC(jongbou_inputs_r));
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3117,7 +3117,7 @@ static DRIVER_INIT( jongbou )
static DRIVER_INIT( paddlema )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->microcontroller_id = 0;
state->coin_id = 0; // Not needed !
state->game_id = 0;
@@ -3125,7 +3125,7 @@ static DRIVER_INIT( paddlema )
static DRIVER_INIT( timesold )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3134,7 +3134,7 @@ static DRIVER_INIT( timesold )
static DRIVER_INIT( timesold1 )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3143,7 +3143,7 @@ static DRIVER_INIT( timesold1 )
static DRIVER_INIT( btlfield )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3152,7 +3152,7 @@ static DRIVER_INIT( btlfield )
static DRIVER_INIT( btlfieldb )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8); //not checked
@@ -3161,8 +3161,8 @@ static DRIVER_INIT( btlfieldb )
static DRIVER_INIT( skysoldr )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", (machine->region("user1")->base()) + 0x40000);
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", (machine.region("user1")->base()) + 0x40000);
state->invert_controls = 0;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3171,7 +3171,7 @@ static DRIVER_INIT( skysoldr )
static DRIVER_INIT( goldmedl )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //AT
state->coin_id = 0x23 | (0x24 << 8);
@@ -3180,8 +3180,8 @@ static DRIVER_INIT( goldmedl )
static DRIVER_INIT( goldmedla )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("maincpu")->base() + 0x20000);
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("maincpu")->base() + 0x20000);
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
state->coin_id = 0x23 | (0x24 << 8);
@@ -3190,7 +3190,7 @@ static DRIVER_INIT( goldmedla )
static DRIVER_INIT( skyadvnt )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3199,7 +3199,7 @@ static DRIVER_INIT( skyadvnt )
static DRIVER_INIT( skyadvntu )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3208,8 +3208,8 @@ static DRIVER_INIT( skyadvntu )
static DRIVER_INIT( gangwarsu )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3218,8 +3218,8 @@ static DRIVER_INIT( gangwarsu )
static DRIVER_INIT( gangwars )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3228,8 +3228,8 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( sbasebal )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* Patch protection check, it does a divide by zero because the MCU is trying to
calculate the ball speed when a strike is scored, notice that current emulation
@@ -3258,7 +3258,7 @@ static DRIVER_INIT( sbasebal )
static DRIVER_INIT( tnextspc )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x890a;
state->coin_id = 0; // Not needed !
diff --git a/src/mame/drivers/ambush.c b/src/mame/drivers/ambush.c
index 45e800affb7..a423fb341de 100644
--- a/src/mame/drivers/ambush.c
+++ b/src/mame/drivers/ambush.c
@@ -47,13 +47,13 @@
static WRITE8_HANDLER( ambush_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
diff --git a/src/mame/drivers/ampoker2.c b/src/mame/drivers/ampoker2.c
index b3a310904d7..8fc578c721e 100644
--- a/src/mame/drivers/ampoker2.c
+++ b/src/mame/drivers/ampoker2.c
@@ -588,7 +588,7 @@ static WRITE8_HANDLER( ampoker2_watchdog_reset_w )
if (((data >> 3) & 0x01) == 0) /* check for refresh value (0x08) */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
// popmessage("%02x", data);
}
else
@@ -1406,8 +1406,8 @@ ROM_END
static DRIVER_INIT( rabbitpk )
{
- UINT8 *rom = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -1458,7 +1458,7 @@ static DRIVER_INIT( piccolop )
*/
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* NOP'ing the mortal jump... */
rom[0x154b] = 0x00;
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 2faa0a29ad6..cc4cc96c226 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -34,9 +34,9 @@ Sound: YM2151
Or last value when wheel delta = 0
*/
-static UINT8 amspdwy_wheel_r( running_machine *machine, int index )
+static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
UINT8 wheel = input_port_read(machine, portnames[2 + index]);
if (wheel != state->wheel_old[index])
@@ -54,22 +54,22 @@ static UINT8 amspdwy_wheel_r( running_machine *machine, int index )
static READ8_HANDLER( amspdwy_wheel_0_r )
{
- return amspdwy_wheel_r(space->machine, 0);
+ return amspdwy_wheel_r(space->machine(), 0);
}
static READ8_HANDLER( amspdwy_wheel_1_r )
{
- return amspdwy_wheel_r(space->machine, 1);
+ return amspdwy_wheel_r(space->machine(), 1);
}
static READ8_DEVICE_HANDLER( amspdwy_sound_r )
{
- return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine, "IN0");
+ return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0");
}
static WRITE8_HANDLER( amspdwy_sound_w )
{
- amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -94,7 +94,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( amspdwy_port_r )
{
- UINT8 *tracks = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *tracks = space->machine().region("maincpu")->base() + 0x10000;
return tracks[offset];
}
@@ -241,7 +241,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- amspdwy_state *state = device->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = device->machine().driver_data<amspdwy_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -252,9 +252,9 @@ static const ym2151_interface amspdwy_ym2151_interface =
static MACHINE_START( amspdwy )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->wheel_old));
@@ -263,7 +263,7 @@ static MACHINE_START( amspdwy )
static MACHINE_RESET( amspdwy )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
state->flipscreen = 0;
state->wheel_old[0] = 0;
state->wheel_old[1] = 0;
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 91ecf2dfb8a..0f7743d8306 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -141,7 +141,7 @@ static WRITE8_HANDLER( angelkds_sub_sound_w );
static WRITE8_HANDLER( angelkds_cpu_bank_write )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
+ memory_set_bank(space->machine(), "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
}
@@ -161,9 +161,9 @@ static READ8_HANDLER( angelkds_input_r )
static const char *const portnames[] = { "I81", "I82" };
static const char *const fakenames[] = { "FAKE1", "FAKE2" };
- fake = input_port_read(space->machine, fakenames[offset]);
+ fake = input_port_read(space->machine(), fakenames[offset]);
- return ((fake & 0x01) ? fake : input_port_read(space->machine, portnames[offset]));
+ return ((fake & 0x01) ? fake : input_port_read(space->machine(), portnames[offset]));
}
#else
@@ -172,7 +172,7 @@ static READ8_HANDLER( angelkds_input_r )
{
static const char *const portnames[] = { "I81", "I82" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
#endif
@@ -489,32 +489,32 @@ sound related ?
static WRITE8_HANDLER( angelkds_main_sound_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->sound[offset] = data;
}
static READ8_HANDLER( angelkds_main_sound_r )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
return state->sound2[offset];
}
static WRITE8_HANDLER( angelkds_sub_sound_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->sound2[offset] = data;
}
static READ8_HANDLER( angelkds_sub_sound_r )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
return state->sound[offset];
}
static void irqhandler( device_t *device, int irq )
{
- angelkds_state *state = device->machine->driver_data<angelkds_state>();
+ angelkds_state *state = device->machine().driver_data<angelkds_state>();
device_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -575,9 +575,9 @@ GFXDECODE_END
static MACHINE_START( angelkds )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->layer_ctrl));
state->save_item(NAME(state->txbank));
@@ -589,7 +589,7 @@ static MACHINE_START( angelkds )
static MACHINE_RESET( angelkds )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
int i;
for (i = 0; i < 4; i++)
@@ -750,13 +750,13 @@ ROM_END
static DRIVER_INIT( angelkds )
{
- UINT8 *RAM = machine->region("user1")->base();
+ UINT8 *RAM = machine.region("user1")->base();
memory_configure_bank(machine, "bank1", 0, 8, &RAM[0x0000], 0x4000);
}
static DRIVER_INIT( spcpostn )
{
- UINT8 *RAM = machine->region("user1")->base();
+ UINT8 *RAM = machine.region("user1")->base();
sega_317_0005_decode(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 10, &RAM[0x0000], 0x4000);
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index ef6f0ff2fbd..830788948e2 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -171,13 +171,13 @@ Language
static void appoooh_adpcm_int(device_t *device)
{
- appoooh_state *state = device->machine->driver_data<appoooh_state>();
+ appoooh_state *state = device->machine().driver_data<appoooh_state>();
if (state->adpcm_address != 0xffffffff)
{
if (state->adpcm_data == 0xffffffff)
{
- UINT8 *RAM = device->machine->region("adpcm")->base();
+ UINT8 *RAM = device->machine().region("adpcm")->base();
state->adpcm_data = RAM[state->adpcm_address++];
msm5205_data_w(device, state->adpcm_data >> 4);
@@ -199,7 +199,7 @@ static void appoooh_adpcm_int(device_t *device)
/* adpcm address write */
static WRITE8_HANDLER( appoooh_adpcm_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->adpcm_address = data << 8;
msm5205_reset_w(state->adpcm, 0);
@@ -402,9 +402,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( appoooh )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
- state->adpcm = machine->device("msm");
+ state->adpcm = machine.device("msm");
state->save_item(NAME(state->adpcm_data));
state->save_item(NAME(state->adpcm_address));
@@ -413,7 +413,7 @@ static MACHINE_START( appoooh )
static MACHINE_RESET( appoooh )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
state->adpcm_address = 0xffffffff;
state->adpcm_data = 0;
@@ -598,8 +598,8 @@ static DRIVER_INIT(robowres)
static DRIVER_INIT(robowresb)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x1c000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x1c000);
}
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index c4734b5d432..89e0d0f0014 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -62,7 +62,7 @@ Stephh's notes (based on the game M68000 code and some tests) :
#if AQUARIUS_HACK
static MACHINE_RESET( aquarium_hack )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
int data = input_port_read(machine, "FAKE");
/* Language : 0x0000 = Japanese - Other value = English */
@@ -74,10 +74,10 @@ static MACHINE_RESET( aquarium_hack )
static READ16_HANDLER( aquarium_coins_r )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
int data;
- data = (input_port_read(space->machine, "SYSTEM") & 0x7fff);
+ data = (input_port_read(space->machine(), "SYSTEM") & 0x7fff);
data |= state->aquarium_snd_ack;
state->aquarium_snd_ack = 0;
@@ -86,14 +86,14 @@ static READ16_HANDLER( aquarium_coins_r )
static WRITE8_HANDLER( aquarium_snd_ack_w )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
state->aquarium_snd_ack = 0x8000;
}
static WRITE16_HANDLER( aquarium_sound_w )
{
// popmessage("sound write %04x",data);
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
soundlatch_w(space, 1, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE );
@@ -101,7 +101,7 @@ static WRITE16_HANDLER( aquarium_sound_w )
static WRITE8_HANDLER( aquarium_z80_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
@@ -122,14 +122,14 @@ static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
static READ8_HANDLER( aquarium_oki_r )
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
return aquarium_snd_bitswap(oki->read(*space, offset));
}
static WRITE8_HANDLER( aquarium_oki_w )
{
- logerror("%s:Writing %04x to the OKI M6295\n", space->machine->describe_context(), aquarium_snd_bitswap(data));
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ logerror("%s:Writing %04x to the OKI M6295\n", space->machine().describe_context(), aquarium_snd_bitswap(data));
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->write(*space, offset, (aquarium_snd_bitswap(data)));
}
@@ -279,13 +279,13 @@ static const gfx_layout tilelayout =
static DRIVER_INIT( aquarium )
{
- UINT8 *Z80 = machine->region("audiocpu")->base();
+ UINT8 *Z80 = machine.region("audiocpu")->base();
/* The BG tiles are 5bpp, this rearranges the data from
the roms containing the 1bpp data so we can decode it
correctly */
- UINT8 *DAT2 = machine->region("gfx1")->base() + 0x080000;
- UINT8 *DAT = machine->region("user1")->base();
+ UINT8 *DAT2 = machine.region("gfx1")->base() + 0x080000;
+ UINT8 *DAT = machine.region("user1")->base();
int len = 0x0200000;
for (len = 0; len < 0x020000; len++)
@@ -300,8 +300,8 @@ static DRIVER_INIT( aquarium )
DAT2[len * 4 + 2] |= (DAT[len] & 0x01) << 3;
}
- DAT2 = machine->region("gfx4")->base() + 0x080000;
- DAT = machine->region("user2")->base();
+ DAT2 = machine.region("gfx4")->base() + 0x080000;
+ DAT = machine.region("user2")->base();
for (len = 0; len < 0x020000; len++)
{
@@ -330,7 +330,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- aquarium_state *state = device->machine->driver_data<aquarium_state>();
+ aquarium_state *state = device->machine().driver_data<aquarium_state>();
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -342,16 +342,16 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( aquarium )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->aquarium_snd_ack));
}
static MACHINE_RESET( aquarium )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
state->aquarium_snd_ack = 0;
#if AQUARIUS_HACK
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index ac9b7f64991..8bbc1573c9e 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -60,7 +60,7 @@
static WRITE8_DEVICE_HANDLER( ay8910_porta_w )
{
- arabian_state *state = device->machine->driver_data<arabian_state>();
+ arabian_state *state = device->machine().driver_data<arabian_state>();
/*
bit 7 = ENA
@@ -82,12 +82,12 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
bit 0 = coin 1 counter
*/
- cputag_set_input_line(device->machine, "mcu", MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(device->machine, "mcu", INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "mcu", MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "mcu", INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
/* clock the coin counters */
- coin_counter_w(device->machine, 1, ~data & 0x02);
- coin_counter_w(device->machine, 0, ~data & 0x01);
+ coin_counter_w(device->machine(), 1, ~data & 0x02);
+ coin_counter_w(device->machine(), 0, ~data & 0x01);
}
@@ -100,7 +100,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
static READ8_HANDLER( mcu_port_r_r )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 val = state->mcu_port_r[offset];
@@ -113,7 +113,7 @@ static READ8_HANDLER( mcu_port_r_r )
static WRITE8_HANDLER( mcu_port_r_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
if (offset == 0)
{
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( mcu_port_r_w )
static READ8_HANDLER( mcu_portk_r )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 val = 0xf;
if (~state->mcu_port_r[0] & 1)
@@ -148,7 +148,7 @@ static READ8_HANDLER( mcu_portk_r )
{
if (~sel & (1 << i))
{
- val = input_port_read(space->machine, comnames[i]);
+ val = input_port_read(space->machine(), comnames[i]);
break;
}
}
@@ -159,7 +159,7 @@ static READ8_HANDLER( mcu_portk_r )
static WRITE8_HANDLER( mcu_port_o_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 out = data & 0x0f;
if (data & 0x10)
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( mcu_port_o_w )
static WRITE8_HANDLER( mcu_port_p_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
state->mcu_port_p = data & 0x0f;
}
@@ -348,7 +348,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( arabian )
{
- arabian_state *state = machine->driver_data<arabian_state>();
+ arabian_state *state = machine.driver_data<arabian_state>();
state->save_item(NAME(state->mcu_port_o));
state->save_item(NAME(state->mcu_port_p));
@@ -357,7 +357,7 @@ static MACHINE_START( arabian )
static MACHINE_RESET( arabian )
{
- arabian_state *state = machine->driver_data<arabian_state>();
+ arabian_state *state = machine.driver_data<arabian_state>();
state->video_control = 0;
}
diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c
index 3f6572b5f2d..5e238c00a94 100644
--- a/src/mame/drivers/arcadecl.c
+++ b/src/mame/drivers/arcadecl.c
@@ -81,9 +81,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -92,7 +92,7 @@ static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
if ((scanline & 32) == 0)
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -111,11 +111,11 @@ static MACHINE_START( arcadecl )
static MACHINE_RESET( arcadecl )
{
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
}
@@ -137,9 +137,9 @@ static WRITE16_HANDLER( latch_w )
/* lower byte being modified? */
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000);
- atarigen_set_oki6295_vol(space->machine, (data & 0x001f) * 100 / 0x1f);
+ atarigen_set_oki6295_vol(space->machine(), (data & 0x001f) * 100 / 0x1f);
}
}
@@ -398,7 +398,7 @@ ROM_END
static DRIVER_INIT( sparkz )
{
- memset(machine->region("gfx1")->base(), 0, machine->region("gfx1")->bytes());
+ memset(machine.region("gfx1")->base(), 0, machine.region("gfx1")->bytes());
}
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 6e8b8a512f1..76b9fdd20da 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -100,19 +100,19 @@ static WRITE16_HANDLER( arcadia_multibios_change_game )
static WRITE8_DEVICE_HANDLER( arcadia_cia_0_porta_w )
{
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
/* bit 2 = Power Led on Amiga */
- set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
+ set_led_status(device->machine(), 0, (data & 2) ? 0 : 1);
}
@@ -137,7 +137,7 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_portb_w )
/* writing a 0 in the low bit clears one of the coins */
if ((data & 1) == 0)
{
- UINT8 *coin_counter = device->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = device->machine().driver_data<arcadia_state>()->coin_counter;
if (coin_counter[0] > 0)
coin_counter[0]--;
@@ -157,7 +157,7 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_portb_w )
static CUSTOM_INPUT( coin_counter_r )
{
int coin = (FPTR)param;
- UINT8 *coin_counter = field->port->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = field->port->machine().driver_data<arcadia_state>()->coin_counter;
/* return coin counter values */
return coin_counter[coin] & 3;
@@ -167,7 +167,7 @@ static CUSTOM_INPUT( coin_counter_r )
static INPUT_CHANGED( coin_changed_callback )
{
int coin = (FPTR)param;
- UINT8 *coin_counter = field->port->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = field->port->machine().driver_data<arcadia_state>()->coin_counter;
/* check for a 0 -> 1 transition */
if (!oldval && newval && coin_counter[coin] < 3)
@@ -175,9 +175,9 @@ static INPUT_CHANGED( coin_changed_callback )
}
-static void arcadia_reset_coins(running_machine *machine)
+static void arcadia_reset_coins(running_machine &machine)
{
- UINT8 *coin_counter = machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = machine.driver_data<arcadia_state>()->coin_counter;
/* reset coin counters */
coin_counter[0] = coin_counter[1] = 0;
@@ -726,9 +726,9 @@ ROM_END
*
*************************************/
-INLINE void generic_decode(running_machine *machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
+INLINE void generic_decode(running_machine &machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
{
- UINT16 *rom = (UINT16 *)machine->region(tag)->base();
+ UINT16 *rom = (UINT16 *)machine.region(tag)->base();
int i;
/* only the low byte of ROMs are encrypted in these games */
@@ -737,12 +737,12 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
#if 0
{
- UINT8 *ROM = machine->region(tag)->base();
- int size = machine->region(tag)->bytes();
+ UINT8 *ROM = machine.region(tag)->base();
+ int size = machine.region(tag)->bytes();
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -761,9 +761,9 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
*
*************************************/
-static void arcadia_init(running_machine *machine)
+static void arcadia_init(running_machine &machine)
{
- arcadia_state *state = machine->driver_data<arcadia_state>();
+ arcadia_state *state = machine.driver_data<arcadia_state>();
static const amiga_machine_interface arcadia_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -780,10 +780,10 @@ static void arcadia_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* OnePlay bios is encrypted, TenPlay is not */
- biosrom = (UINT16 *)machine->region("user2")->base();
+ biosrom = (UINT16 *)machine.region("user2")->base();
if (biosrom[0] != 0x4afc)
generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
}
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index faaf72990ff..e6a084ce297 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -143,7 +143,7 @@ static INTERRUPT_GEN( argus_interrupt )
/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -165,11 +165,11 @@ static const ym2203_interface ym2203_config =
static WRITE8_HANDLER( argus_bankselect_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + ((data & 7) * 0x4000);
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
}
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 0e396a73e63..03c1c7a6751 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -224,15 +224,15 @@ static const UINT8 cashcade_p[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
static VIDEO_START(aristmk4)
{
int tile;
- for (tile = 0; tile < machine->gfx[0]->total_elements; tile++)
+ for (tile = 0; tile < machine.gfx[0]->total_elements; tile++)
{
- gfx_element_decode(machine->gfx[0], tile);
+ gfx_element_decode(machine.gfx[0], tile);
}
}
-INLINE void uBackgroundColour(running_machine *machine)
+INLINE void uBackgroundColour(running_machine &machine)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
/* SW7 can be set when the main door is open, this allows the colours for the background
to be adjusted whilst the machine is running.
@@ -266,8 +266,8 @@ INLINE void uBackgroundColour(running_machine *machine)
static SCREEN_UPDATE(aristmk4)
{
- aristmk4_state *state = screen->machine->driver_data<aristmk4_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ aristmk4_state *state = screen->machine().driver_data<aristmk4_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int x,y;
int count = 0;
int color;
@@ -283,7 +283,7 @@ static SCREEN_UPDATE(aristmk4)
color = ((state->mkiv_vram[count]) & 0xe0) >> 5;
tile = (state->mkiv_vram[count+1]|state->mkiv_vram[count]<<8) & 0x3ff;
bgtile = (state->mkiv_vram[count+1]|state->mkiv_vram[count]<<8) & 0xff; // first 256 tiles
- uBackgroundColour(screen->machine); // read sw7
+ uBackgroundColour(screen->machine()); // read sw7
gfx_element_decode(gfx, bgtile); // force the machine to update only the first 256 tiles.
// as we only update the background, not the entire display.
flipx = ((state->mkiv_vram[count]) & 0x04);
@@ -297,19 +297,19 @@ static SCREEN_UPDATE(aristmk4)
static READ8_HANDLER(ldsw)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
- int U3_p2_ret= input_port_read(space->machine, "5002");
+ int U3_p2_ret= input_port_read(space->machine(), "5002");
if(U3_p2_ret & 0x1)
{
return 0;
}
- return state->cgdrsw = input_port_read(space->machine, "CGDRSW");
+ return state->cgdrsw = input_port_read(space->machine(), "CGDRSW");
}
static READ8_HANDLER(cgdrr)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
if(state->cgdrsw) // is the LC closed
{
@@ -320,7 +320,7 @@ static READ8_HANDLER(cgdrr)
static WRITE8_HANDLER(cgdrw)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
state->ripple = data;
@@ -328,7 +328,7 @@ static WRITE8_HANDLER(cgdrw)
static WRITE8_HANDLER(u3_p0)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
state->u3_p0_w = data;
//logerror("u3_p0_w: %02X\n",state->u3_p0_w);
@@ -337,10 +337,10 @@ static WRITE8_HANDLER(u3_p0)
static READ8_HANDLER(u3_p2)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
- int u3_p2_ret= input_port_read(space->machine, "5002");
- int u3_p3_ret= input_port_read(space->machine, "5003");
+ int u3_p2_ret= input_port_read(space->machine(), "5002");
+ int u3_p3_ret= input_port_read(space->machine(), "5003");
output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light
output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light
@@ -353,7 +353,7 @@ static READ8_HANDLER(u3_p2)
if (state->inscrd==0)
{
- state->inscrd=input_port_read(space->machine, "insertcoin");
+ state->inscrd=input_port_read(space->machine(), "insertcoin");
}
if (state->inscrd==1)
@@ -391,7 +391,7 @@ static READ8_HANDLER(mkiv_pia_ina)
{
/* uncomment this code once RTC is fixed */
- //return space->machine->device<mc146818_device>("rtc")->read(*space,1);
+ //return space->machine().device<mc146818_device>("rtc")->read(*space,1);
return 0; // OK for now, the aussie version has no RTC on the MB so this is valid.
}
@@ -399,8 +399,8 @@ static READ8_HANDLER(mkiv_pia_ina)
static WRITE8_HANDLER(mkiv_pia_outa)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
- mc146818_device *mc = space->machine->device<mc146818_device>("rtc");
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
+ mc146818_device *mc = space->machine().device<mc146818_device>("rtc");
if(state->rtc_data_strobe)
{
mc->write(*space,1,data);
@@ -419,7 +419,7 @@ static WRITE8_HANDLER(mkiv_pia_outa)
//output ca2
static WRITE8_DEVICE_HANDLER(mkiv_pia_ca2)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->rtc_address_strobe = data;
// logerror("address strobe %02X\n", address_strobe);
}
@@ -428,7 +428,7 @@ static WRITE8_DEVICE_HANDLER(mkiv_pia_ca2)
//output cb2
static WRITE8_DEVICE_HANDLER(mkiv_pia_cb2)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->rtc_data_strobe = data;
//logerror("data strobe: %02X\n", data);
}
@@ -438,7 +438,7 @@ static WRITE8_DEVICE_HANDLER(mkiv_pia_cb2)
//output b
static WRITE8_DEVICE_HANDLER(mkiv_pia_outb)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
UINT8 emet[5];
int i = 0;
@@ -489,7 +489,7 @@ VERSATILE INTERFACE ADAPTER CONFIGURATION
static TIMER_CALLBACK(coin_input_reset)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
state->inscrd=0; //reset credit input after 150msec
@@ -497,7 +497,7 @@ static TIMER_CALLBACK(coin_input_reset)
static TIMER_CALLBACK(hopper_reset)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
state->hopper_motor=0x01;
@@ -508,18 +508,18 @@ static TIMER_CALLBACK(hopper_reset)
static READ8_DEVICE_HANDLER(via_a_r)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
int psg_ret=0;
if (state->ay8910_1&0x03) // SW1 read.
{
- psg_ret = ay8910_r(device->machine->device("ay1"), 0);
+ psg_ret = ay8910_r(device->machine().device("ay1"), 0);
//logerror("PSG porta ay1 returned %02X\n",psg_ret);
}
else if (state->ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
{
- psg_ret = ay8910_r(device->machine->device("ay2"), 0);
+ psg_ret = ay8910_r(device->machine().device("ay2"), 0);
//logerror("PSG porta ay2 returned %02X\n",psg_ret);
}
return psg_ret;
@@ -529,9 +529,9 @@ static READ8_DEVICE_HANDLER(via_a_r)
static READ8_DEVICE_HANDLER(via_b_r)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
- int ret=input_port_read(device->machine, "via_port_b");
+ int ret=input_port_read(device->machine(), "via_port_b");
// Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR )
// However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here.
@@ -556,7 +556,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
case 0x02:
ret=ret^0x20;
state->inscrd++;
- device->machine->scheduler().timer_set(attotime::from_msec(150), FUNC(coin_input_reset));
+ device->machine().scheduler().timer_set(attotime::from_msec(150), FUNC(coin_input_reset));
break;
default:
@@ -570,7 +570,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
{
case 0x00:
ret=ret^0x40;
- device->machine->scheduler().timer_set(attotime::from_msec(175), FUNC(hopper_reset));
+ device->machine().scheduler().timer_set(attotime::from_msec(175), FUNC(hopper_reset));
state->hopper_motor=0x02;
break;
case 0x01:
@@ -587,7 +587,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
static WRITE8_DEVICE_HANDLER(via_a_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>(); //via_b_w will handle sending the data to the ay8910, so just write the data for it to use later
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>(); //via_b_w will handle sending the data to the ay8910, so just write the data for it to use later
//logerror("VIA port A write %02X\n",data);
state->psg_data = data;
@@ -596,7 +596,7 @@ static WRITE8_DEVICE_HANDLER(via_a_w)
static WRITE8_DEVICE_HANDLER(via_b_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->ay8910_1 = ( data & 0x0F ) ; //only need first 4 bits per schematics
//NOTE: when bit 4 is off, we write to AY1, when bit 4 is on, we write to AY2
state->ay8910_2 = state->ay8910_1;
@@ -629,14 +629,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
- ay8910_data_w( device->machine->device("ay1"), 0 , state->psg_data );
+ ay8910_data_w( device->machine().device("ay1"), 0 , state->psg_data );
//logerror("VIA Port A write data ay1: %02X\n",state->psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( device->machine->device("ay1"), 0 , state->psg_data );
+ ay8910_address_w( device->machine().device("ay1"), 0 , state->psg_data );
//logerror("VIA Port B write register ay1: %02X\n",state->psg_data);
break;
}
@@ -662,14 +662,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
- ay8910_data_w( device->machine->device("ay2"), 0 , state->psg_data );
+ ay8910_data_w( device->machine().device("ay2"), 0 , state->psg_data );
//logerror("VIA Port A write data ay2: %02X\n",state->psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( device->machine->device("ay2"), 0 , state->psg_data );
+ ay8910_address_w( device->machine().device("ay2"), 0 , state->psg_data );
//logerror("VIA Port B write register ay2: %02X\n",state->psg_data);
break;
}
@@ -709,7 +709,7 @@ static WRITE8_DEVICE_HANDLER(via_ca2_w)
static WRITE8_DEVICE_HANDLER(via_cb2_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
// CB2 = hopper motor (HOPMO1). When it is 0x01, it is not running (active low)
// when it goes to 0, we're expecting to coins to be paid out, handled in via_b_r
// as soon as it is 1, HOPCO1 to remain 'ON'
@@ -771,7 +771,7 @@ static WRITE8_DEVICE_HANDLER(zn434_w)
static READ8_HANDLER(cashcade_r)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
/* work around for cashcade games */
return cashcade_p[(state->cashcade_c++)%15];
}
@@ -1330,7 +1330,7 @@ static const ay8910_interface ay8910_config2 =
static WRITE8_DEVICE_HANDLER(firq)
{
- cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, data ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_FIRQ_LINE, data ? ASSERT_LINE : CLEAR_LINE);
}
static const via6522_interface via_interface =
@@ -1381,12 +1381,12 @@ static const mc6845_interface mc6845_intf =
static READ8_DEVICE_HANDLER(pa1_r)
{
- return (input_port_read(device->machine, "SW3") << 4) + input_port_read(device->machine, "SW4");
+ return (input_port_read(device->machine(), "SW3") << 4) + input_port_read(device->machine(), "SW4");
}
static READ8_DEVICE_HANDLER(pb1_r)
{
- return (input_port_read(device->machine, "SW5") << 4) + input_port_read(device->machine, "SW6");
+ return (input_port_read(device->machine(), "SW5") << 4) + input_port_read(device->machine(), "SW6");
}
static READ8_DEVICE_HANDLER(pc1_r)
@@ -1409,7 +1409,7 @@ static PALETTE_INIT( aristmk4 )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -1434,17 +1434,17 @@ static PALETTE_INIT( aristmk4 )
static DRIVER_INIT( aristmk4 )
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
- state->shapeRomPtr = (UINT8 *)machine->region("tile_gfx")->base();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
+ state->shapeRomPtr = (UINT8 *)machine.region("tile_gfx")->base();
memcpy(state->shapeRom,state->shapeRomPtr,sizeof(state->shapeRom)); // back up
state->nvram = auto_alloc_array(machine, UINT8, 0x1000);
}
static MACHINE_START( aristmk4 )
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
- state->samples = machine->device("samples");
+ state->samples = machine.device("samples");
state_save_register_global_pointer(machine, state->nvram, 0x1000); // state->nvram
}
@@ -1455,10 +1455,10 @@ static MACHINE_RESET( aristmk4 )
switch(input_port_read(machine, "LK13")) // cpu speed control... 3mhz or 1.5mhz
{
case 0x00:
- machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 Mhz
+ machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 Mhz
break;
case 0x10:
- machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/8); // 1.5 Mhz
+ machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/8); // 1.5 Mhz
break;
}
@@ -1483,9 +1483,9 @@ static TIMER_DEVICE_CALLBACK( aristmk4_pf )
*/
- if(input_port_read(timer.machine, "powerfail")) // send NMI signal if L pressed
+ if(input_port_read(timer.machine(), "powerfail")) // send NMI signal if L pressed
{
- cputag_set_input_line( timer.machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
+ cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
}
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 04b57e1507c..24e59d75492 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -79,14 +79,14 @@ public:
static WRITE32_HANDLER( mk5_ext_latch_w )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
/* this banks "something" */
state->ext_latch = data & 1;
}
static READ32_HANDLER( ext_timer_latch_r )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
/* reset 2KHz timer */
ioc_regs[IRQ_STATUS_A] &= 0xfe;
state->mk5_2KHz_timer->adjust(attotime::from_hz(2000));
@@ -97,7 +97,7 @@ static READ32_HANDLER( ext_timer_latch_r )
/* same as plain AA but with the I2C unconnected */
static READ32_HANDLER( mk5_ioc_r )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
UINT32 ioc_addr;
ioc_addr = offset*4;
@@ -108,10 +108,10 @@ static READ32_HANDLER( mk5_ioc_r )
{
int vert_pos;
- vert_pos = space->machine->primary_screen->vpos();
+ vert_pos = space->machine().primary_screen->vpos();
state->flyback = (vert_pos <= vidc_regs[VIDC_VDSR] || vert_pos >= vidc_regs[VIDC_VDER]) ? 0x80 : 0x00;
- //i2c_data = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ //i2c_data = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (state->flyback) | (ioc_regs[CONTROL] & 0x7c) | (1<<1) | 1;
}
@@ -121,7 +121,7 @@ static READ32_HANDLER( mk5_ioc_r )
static WRITE32_HANDLER( mk5_ioc_w )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
UINT32 ioc_addr;
ioc_addr = offset*4;
@@ -186,7 +186,7 @@ static WRITE32_HANDLER( sram_banksel_w )
write: 03010420 00 select bank 0
*/
- memory_set_bank(space->machine,"sram_bank", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(),"sram_bank", (data & 0xc0) >> 6);
}
static ADDRESS_MAP_START( aristmk5_map, AS_PROGRAM, 32 )
@@ -225,7 +225,7 @@ INPUT_PORTS_END
static DRIVER_INIT( aristmk5 )
{
- UINT8 *SRAM = machine->region("sram")->base();
+ UINT8 *SRAM = machine.region("sram")->base();
archimedes_driver_init(machine);
memory_configure_bank(machine, "sram_bank", 0, 4, &SRAM[0], 0x8000);
@@ -233,7 +233,7 @@ static DRIVER_INIT( aristmk5 )
static TIMER_CALLBACK( mk5_2KHz_callback )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
ioc_regs[IRQ_STATUS_A] |= 1;
state->mk5_2KHz_timer->adjust(attotime::never);
@@ -241,18 +241,18 @@ static TIMER_CALLBACK( mk5_2KHz_callback )
static MACHINE_START( aristmk5 )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
archimedes_init(machine);
// reset the DAC to centerline
- //dac_signed_data_w(machine->device("dac"), 0x80);
+ //dac_signed_data_w(machine.device("dac"), 0x80);
- state->mk5_2KHz_timer = machine->scheduler().timer_alloc(FUNC(mk5_2KHz_callback));
+ state->mk5_2KHz_timer = machine.scheduler().timer_alloc(FUNC(mk5_2KHz_callback));
}
static MACHINE_RESET( aristmk5 )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
archimedes_reset(machine);
state->mk5_2KHz_timer->adjust(attotime::from_hz(2000));
@@ -260,15 +260,15 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *PRG;// = machine->region("prg_code")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *PRG;// = machine.region("prg_code")->base();
int i;
UINT8 op_mode;
static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "game_prg", "game_prg" };
op_mode = input_port_read(machine, "ROM_LOAD");
- PRG = machine->region(rom_region[op_mode & 3])->base();
+ PRG = machine.region(rom_region[op_mode & 3])->base();
for(i=0;i<0x300000;i++)
ROM[i] = PRG[i];
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index 668deed3cdd..9ae6939566a 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -914,9 +914,9 @@ static const ay8910_interface hexa_ay8910_config =
static MACHINE_START( arkanoid )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
- state->mcu = machine->device("mcu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->bootleg_cmd));
@@ -939,7 +939,7 @@ static MACHINE_START( arkanoid )
static MACHINE_RESET( arkanoid )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->port_a_in = 0;
state->port_a_out = 0;
@@ -1444,34 +1444,34 @@ ROM_END
/* Driver Initialization */
-static void arkanoid_bootleg_init( running_machine *machine )
+static void arkanoid_bootleg_init( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf000, 0xf000, FUNC(arkanoid_bootleg_f000_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf002, 0xf002, FUNC(arkanoid_bootleg_f002_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd018, 0xd018, FUNC(arkanoid_bootleg_d018_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd008, 0xd008, FUNC(arkanoid_bootleg_d008_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf000, 0xf000, FUNC(arkanoid_bootleg_f000_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf002, 0xf002, FUNC(arkanoid_bootleg_f002_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd018, 0xd018, FUNC(arkanoid_bootleg_d018_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd008, 0xd008, FUNC(arkanoid_bootleg_d008_r) );
}
static DRIVER_INIT( arkangc )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkangc2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( block2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
// the graphics on this bootleg have the data scrambled
int tile;
- UINT8* srcgfx = machine->region("gfx1")->base();
+ UINT8* srcgfx = machine.region("gfx1")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x18000);
for (tile = 0; tile < 0x3000; tile++)
@@ -1504,28 +1504,28 @@ static DRIVER_INIT( block2 )
static DRIVER_INIT( arkblock )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOCK;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkbloc2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkgcbl )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKGCBL;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( paddle2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = PADDLE2;
arkanoid_bootleg_init(machine);
}
@@ -1533,7 +1533,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -1541,13 +1541,13 @@ static DRIVER_INIT( tetrsark )
ROM[x] = ROM[x] ^ 0x94;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd008, 0xd008, FUNC(tetrsark_d008_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd008, 0xd008, FUNC(tetrsark_d008_w) );
}
static DRIVER_INIT( hexa )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
#if 0
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index 5e0c9ac54d0..6d81540535e 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -176,22 +176,22 @@ Stephh's notes (based on the games M68000 code and some tests) :
static WRITE16_HANDLER( io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
}
static WRITE16_HANDLER( terraf_io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
if ((state->vreg & 0x4000) && !(state->vreg & 0x0100))
{
@@ -209,12 +209,12 @@ static WRITE16_HANDLER( terraf_io_w )
static WRITE16_HANDLER( kodure_io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
/* This is a temporary condition specification. */
if (!(state->vreg & 0x0080))
@@ -242,7 +242,7 @@ static READ8_HANDLER( soundlatch_clear_r )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( legion_command_c )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->legion_cmd[offset]);
//logerror("Legion CMD %04x=%04x", offset, data);
@@ -761,7 +761,7 @@ GFXDECODE_END
static MACHINE_START( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->save_item(NAME(state->mcu_mode));
state->save_item(NAME(state->old_mcu_mode));
@@ -776,7 +776,7 @@ static MACHINE_START( armedf )
static MACHINE_RESET( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->mcu_mode = 0;
state->old_mcu_mode = 0;
@@ -1508,36 +1508,36 @@ ROM_END
static DRIVER_INIT( terraf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 0;
}
static DRIVER_INIT( terrafu )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 5;
}
static DRIVER_INIT( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 1;
}
static DRIVER_INIT( kodure )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 2;
}
static DRIVER_INIT( legion )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x0001d6 / 2] = 0x0001;
/* To avoid checksum error */
RAM[0x000488 / 2] = 0x4e71;
@@ -1548,11 +1548,11 @@ static DRIVER_INIT( legion )
static DRIVER_INIT( legiono )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x0001d6/2] = 0x0001;
/* No need to patch the checksum routine (see notes) ! */
#endif
@@ -1562,7 +1562,7 @@ static DRIVER_INIT( legiono )
static DRIVER_INIT( cclimbr2 )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 4;
}
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index a22db8b3c76..46b45bf81a2 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -42,9 +42,9 @@
*
*************************************/
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
cputag_set_input_line(machine, "maincpu", 4, state->tms_irq ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->hack_irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -52,9 +52,9 @@ static void update_irq_state(running_machine *machine)
static void m68k_gen_int(device_t *device, int state)
{
- artmagic_state *drvstate = device->machine->driver_data<artmagic_state>();
+ artmagic_state *drvstate = device->machine().driver_data<artmagic_state>();
drvstate->tms_irq = state;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
@@ -67,7 +67,7 @@ static void m68k_gen_int(device_t *device, int state)
static MACHINE_START( artmagic )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state_save_register_global(machine, state->tms_irq);
state_save_register_global(machine, state->hack_irq);
state_save_register_global(machine, state->prot_input_index);
@@ -81,7 +81,7 @@ static MACHINE_START( artmagic )
static MACHINE_RESET( artmagic )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state->tms_irq = state->hack_irq = 0;
update_irq_state(machine);
}
@@ -96,13 +96,13 @@ static MACHINE_RESET( artmagic )
static READ16_HANDLER( tms_host_r )
{
- return tms34010_host_r(space->machine->device("tms"), offset);
+ return tms34010_host_r(space->machine().device("tms"), offset);
}
static WRITE16_HANDLER( tms_host_w )
{
- tms34010_host_w(space->machine->device("tms"), offset, data);
+ tms34010_host_w(space->machine().device("tms"), offset, data);
}
@@ -115,13 +115,13 @@ static WRITE16_HANDLER( tms_host_w )
static WRITE16_HANDLER( control_w )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
COMBINE_DATA(&state->control[offset]);
/* OKI banking here */
if (offset == 0)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((((data >> 4) & 1) * 0x40000) % oki->region()->bytes());
}
@@ -138,23 +138,23 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( irq_off )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state->hack_irq = 0;
update_irq_state(machine);
}
static READ16_HANDLER( ultennis_hack_r )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* IRQ5 points to: jsr (a5); rte */
UINT32 pc = cpu_get_pc(space->cpu);
if (pc == 0x18c2 || pc == 0x18e4)
{
state->hack_irq = 1;
- update_irq_state(space->machine);
- space->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
+ update_irq_state(space->machine());
+ space->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
}
- return input_port_read(space->machine, "300000");
+ return input_port_read(space->machine(), "300000");
}
@@ -165,15 +165,15 @@ static READ16_HANDLER( ultennis_hack_r )
*
*************************************/
-static void ultennis_protection(running_machine *machine)
+static void ultennis_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
case 0x00: /* reset */
state->prot_input_index = state->prot_output_index = 0;
- state->prot_output[0] = machine->rand();
+ state->prot_output[0] = machine.rand();
break;
case 0x01: /* 01 aaaa bbbb cccc dddd (xxxx) */
@@ -256,15 +256,15 @@ static void ultennis_protection(running_machine *machine)
}
-static void cheesech_protection(running_machine *machine)
+static void cheesech_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
case 0x00: /* reset */
state->prot_input_index = state->prot_output_index = 0;
- state->prot_output[0] = machine->rand();
+ state->prot_output[0] = machine.rand();
break;
case 0x01: /* 01 aaaa bbbb (xxxx) */
@@ -317,9 +317,9 @@ static void cheesech_protection(running_machine *machine)
}
-static void stonebal_protection(running_machine *machine)
+static void stonebal_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
@@ -387,14 +387,14 @@ static void stonebal_protection(running_machine *machine)
static CUSTOM_INPUT( prot_r )
{
- artmagic_state *state = field->port->machine->driver_data<artmagic_state>();
+ artmagic_state *state = field->port->machine().driver_data<artmagic_state>();
return state->prot_output_bit;
}
static WRITE16_HANDLER( protection_bit_w )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* shift in the new bit based on the offset */
state->prot_input[state->prot_input_index] <<= 1;
state->prot_input[state->prot_input_index] |= offset;
@@ -412,7 +412,7 @@ static WRITE16_HANDLER( protection_bit_w )
state->prot_bit_index = 0;
/* update the protection state */
- (*state->protection_handler)(space->machine);
+ (*state->protection_handler)(space->machine());
}
}
@@ -461,7 +461,7 @@ ADDRESS_MAP_END
static READ16_HANDLER(unk_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( shtstar_map, AS_PROGRAM, 16 )
@@ -1130,9 +1130,9 @@ ROM_END
*
*************************************/
-static void decrypt_ultennis(running_machine *machine)
+static void decrypt_ultennis(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
int i;
/* set up the parameters for the blitter data decryption which will happen at runtime */
@@ -1147,9 +1147,9 @@ static void decrypt_ultennis(running_machine *machine)
}
-static void decrypt_cheesech(running_machine *machine)
+static void decrypt_cheesech(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
int i;
/* set up the parameters for the blitter data decryption which will happen at runtime */
@@ -1166,19 +1166,19 @@ static void decrypt_cheesech(running_machine *machine)
static DRIVER_INIT( ultennis )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_ultennis(machine);
state->is_stoneball = 0;
state->protection_handler = ultennis_protection;
/* additional (protection?) hack */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x300000, 0x300001, FUNC(ultennis_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x300000, 0x300001, FUNC(ultennis_hack_r));
}
static DRIVER_INIT( cheesech )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_cheesech(machine);
state->is_stoneball = 0;
state->protection_handler = cheesech_protection;
@@ -1187,7 +1187,7 @@ static DRIVER_INIT( cheesech )
static DRIVER_INIT( stonebal )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_ultennis(machine);
state->is_stoneball = 1; /* blits 1 line high are NOT encrypted, also different first pixel decrypt */
state->protection_handler = stonebal_protection;
@@ -1195,7 +1195,7 @@ static DRIVER_INIT( stonebal )
static DRIVER_INIT( shtstar )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* wrong */
decrypt_ultennis(machine);
state->is_stoneball =0;
diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c
index f907e7c4b83..b3567819903 100644
--- a/src/mame/drivers/ashnojoe.c
+++ b/src/mame/drivers/ashnojoe.c
@@ -88,7 +88,7 @@ static READ16_HANDLER(fake_4a00a_r)
static WRITE16_HANDLER( ashnojoe_soundlatch_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
if (ACCESSING_BITS_0_7)
{
state->soundlatch_status = 1;
@@ -121,20 +121,20 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( adpcm_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->adpcm_byte = data;
}
static READ8_HANDLER( sound_latch_r )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->soundlatch_status = 0;
return soundlatch_r(space, 0);
}
static READ8_HANDLER( sound_latch_status_r )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
return state->soundlatch_status;
}
@@ -276,7 +276,7 @@ GFXDECODE_END
static void ym2203_irq_handler( device_t *device, int irq )
{
- ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -291,7 +291,7 @@ static WRITE8_DEVICE_HANDLER( ym2203_write_a )
static WRITE8_DEVICE_HANDLER( ym2203_write_b )
{
- memory_set_bank(device->machine, "bank4", data & 0x0f);
+ memory_set_bank(device->machine(), "bank4", data & 0x0f);
}
static const ym2203_interface ym2203_config =
@@ -309,7 +309,7 @@ static const ym2203_interface ym2203_config =
static void ashnojoe_vclk_cb( device_t *device )
{
- ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
if (state->msm5205_vclk_toggle == 0)
{
msm5205_data_w(device, state->adpcm_byte >> 4);
@@ -332,9 +332,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( ashnojoe )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->adpcm_byte));
state->save_item(NAME(state->soundlatch_status));
@@ -343,7 +343,7 @@ static MACHINE_START( ashnojoe )
static MACHINE_RESET( ashnojoe )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
state->adpcm_byte = 0;
state->soundlatch_status = 0;
@@ -467,7 +467,7 @@ ROM_END
static DRIVER_INIT( ashnojoe )
{
- UINT8 *ROM = machine->region("adpcm")->base();
+ UINT8 *ROM = machine.region("adpcm")->base();
memory_configure_bank(machine, "bank4", 0, 16, &ROM[0x00000], 0x8000);
memory_set_bank(machine, "bank4", 0);
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 2ba276af382..041d466edf9 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -33,14 +33,14 @@ static const eeprom_interface eeprom_intf =
#if 0
static READ16_HANDLER( control2_r )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
return state->cur_control2;
}
#endif
static WRITE16_HANDLER( control2_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
if (ACCESSING_BITS_0_7)
{
@@ -48,7 +48,7 @@ static WRITE16_HANDLER( control2_w )
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
/* bit 5 is select tile bank */
k056832_set_tile_bank(state->k056832, (data & 0x20) >> 5);
@@ -57,7 +57,7 @@ static WRITE16_HANDLER( control2_w )
static INTERRUPT_GEN( asterix_interrupt )
{
- asterix_state *state = device->machine->driver_data<asterix_state>();
+ asterix_state *state = device->machine().driver_data<asterix_state>();
// global interrupt masking
if (!k056832_is_irq_enabled(state->k056832, 0))
@@ -73,21 +73,21 @@ static READ8_DEVICE_HANDLER( asterix_sound_r )
static TIMER_CALLBACK( nmi_callback )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
+ space->machine().scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
}
static WRITE16_HANDLER( sound_irq_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -97,7 +97,7 @@ static WRITE16_HANDLER( sound_irq_w )
#if 0
static WRITE16_HANDLER( protection_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
COMBINE_DATA(state->prot + offset);
if (offset == 1)
@@ -136,7 +136,7 @@ static WRITE16_HANDLER( protection_w )
static WRITE16_HANDLER( protection_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
COMBINE_DATA(state->prot + offset);
if (offset == 1)
@@ -250,14 +250,14 @@ static const k05324x_interface asterix_k05324x_intf =
static MACHINE_START( asterix )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053260 = machine->device("k053260");
- state->k056832 = machine->device("k056832");
- state->k053244 = machine->device("k053244");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053260 = machine.device("k053260");
+ state->k056832 = machine.device("k056832");
+ state->k053244 = machine.device("k053244");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->prot));
@@ -272,7 +272,7 @@ static MACHINE_START( asterix )
static MACHINE_RESET( asterix )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
int i;
state->cur_control2 = 0;
@@ -467,8 +467,8 @@ ROM_END
static DRIVER_INIT( asterix )
{
#if 0
- *(UINT16 *)(machine->region("maincpu")->base() + 0x07f34) = 0x602a;
- *(UINT16 *)(machine->region("maincpu")->base() + 0x00008) = 0x0400;
+ *(UINT16 *)(machine.region("maincpu")->base() + 0x07f34) = 0x602a;
+ *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x0400;
#endif
}
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index 5d40efaa74d..168f2b61a5b 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -204,7 +204,7 @@ There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in a
static WRITE8_HANDLER( astdelux_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
@@ -308,7 +308,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
static INPUT_PORTS_START( asteroid )
@@ -921,14 +921,14 @@ ROM_END
static DRIVER_INIT( asteroidb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2000, 0x2000, "IN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2003, 0x2003, "HS");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2000, 0x2000, "IN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2003, 0x2003, "HS");
}
static DRIVER_INIT( asterock )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2000, 0x2007, FUNC(asterock_IN0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2000, 0x2007, FUNC(asterock_IN0_r));
}
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 8ea7ca741d8..4d35d53fdbd 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -104,7 +104,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static VIDEO_START( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size);
state->save_item(NAME(state->color_latch));
@@ -114,14 +114,14 @@ static VIDEO_START( spaceint )
static WRITE8_HANDLER( color_latch_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
state->color_latch = data & 0x0f;
}
static WRITE8_HANDLER( spaceint_videoram_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
state->videoram[offset] = data;
state->colorram[offset] = state->color_latch;
}
@@ -134,9 +134,9 @@ static WRITE8_HANDLER( spaceint_videoram_w )
*
*************************************/
-static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
+static void plot_byte( running_machine &machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
pen_t fore_pen = MAKE_RGB(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1));
UINT8 flip_xor = state->screen_flip & 7;
@@ -153,8 +153,8 @@ static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT
static SCREEN_UPDATE( astinvad )
{
- astinvad_state *state = screen->machine->driver_data<astinvad_state>();
- const UINT8 *color_prom = screen->machine->region("proms")->base();
+ astinvad_state *state = screen->machine().driver_data<astinvad_state>();
+ const UINT8 *color_prom = screen->machine().region("proms")->base();
UINT8 yoffs = state->flip_yoffs & state->screen_flip;
int x, y;
@@ -164,7 +164,7 @@ static SCREEN_UPDATE( astinvad )
{
UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->screen_flip ? 0 : 4);
UINT8 data = state->videoram[(((y ^ state->screen_flip) + yoffs) << 5) | ((x ^ state->screen_flip) >> 3)];
- plot_byte(screen->machine, bitmap, y, x, data, state->screen_red ? 1 : color);
+ plot_byte(screen->machine(), bitmap, y, x, data, state->screen_red ? 1 : color);
}
return 0;
@@ -173,8 +173,8 @@ static SCREEN_UPDATE( astinvad )
static SCREEN_UPDATE( spaceint )
{
- astinvad_state *state = screen->machine->driver_data<astinvad_state>();
- const UINT8 *color_prom = screen->machine->region("proms")->base();
+ astinvad_state *state = screen->machine().driver_data<astinvad_state>();
+ const UINT8 *color_prom = screen->machine().region("proms")->base();
int offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -189,7 +189,7 @@ static SCREEN_UPDATE( spaceint )
offs_t n = ((offs >> 5) & 0xf0) | color;
color = color_prom[n] & 0x07;
- plot_byte(screen->machine, bitmap, y, x, data, color);
+ plot_byte(screen->machine(), bitmap, y, x, data, color);
}
return 0;
@@ -205,35 +205,35 @@ static SCREEN_UPDATE( spaceint )
static TIMER_CALLBACK( kamikaze_int_off )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
static TIMER_CALLBACK( kamizake_int_gen )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* interrupts are asserted on every state change of the 128V line */
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
param ^= 128;
- state->int_timer->adjust(machine->primary_screen->time_until_pos(param), param);
+ state->int_timer->adjust(machine.primary_screen->time_until_pos(param), param);
/* an RC circuit turns the interrupt off after a short amount of time */
- machine->scheduler().timer_set(attotime::from_double(300 * 0.1e-6), FUNC(kamikaze_int_off));
+ machine.scheduler().timer_set(attotime::from_double(300 * 0.1e-6), FUNC(kamikaze_int_off));
}
static MACHINE_START( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
- state->maincpu = machine->device("maincpu");
- state->ppi8255_0 = machine->device("ppi8255_0");
- state->ppi8255_1 = machine->device("ppi8255_1");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->ppi8255_0 = machine.device("ppi8255_0");
+ state->ppi8255_1 = machine.device("ppi8255_1");
+ state->samples = machine.device("samples");
- state->int_timer = machine->scheduler().timer_alloc(FUNC(kamizake_int_gen));
- state->int_timer->adjust(machine->primary_screen->time_until_pos(128), 128);
+ state->int_timer = machine.scheduler().timer_alloc(FUNC(kamizake_int_gen));
+ state->int_timer->adjust(machine.primary_screen->time_until_pos(128), 128);
state->save_item(NAME(state->screen_flip));
state->save_item(NAME(state->screen_red));
@@ -242,7 +242,7 @@ static MACHINE_START( kamikaze )
static MACHINE_RESET( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->screen_flip = 0;
state->screen_red = 0;
@@ -253,10 +253,10 @@ static MACHINE_RESET( kamikaze )
static MACHINE_START( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->screen_flip));
state->save_item(NAME(state->sound_state));
@@ -264,7 +264,7 @@ static MACHINE_START( spaceint )
static MACHINE_RESET( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->screen_flip = 0;
state->sound_state[0] = 0;
@@ -275,7 +275,7 @@ static MACHINE_RESET( spaceint )
static INPUT_CHANGED( spaceint_coin_inserted )
{
- astinvad_state *state = field->port->machine->driver_data<astinvad_state>();
+ astinvad_state *state = field->port->machine().driver_data<astinvad_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -290,7 +290,7 @@ static INPUT_CHANGED( spaceint_coin_inserted )
static READ8_HANDLER( kamikaze_ppi_r )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
UINT8 result = 0xff;
/* the address lines are used for /CS; yes, they can overlap! */
@@ -304,7 +304,7 @@ static READ8_HANDLER( kamikaze_ppi_r )
static WRITE8_HANDLER( kamikaze_ppi_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
/* the address lines are used for /CS; yes, they can overlap! */
if (!(offset & 4))
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( kamikaze_ppi_w )
static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
{
- astinvad_state *state = device->machine->driver_data<astinvad_state>();
+ astinvad_state *state = device->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@@ -333,14 +333,14 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
if (bits_gone_hi & 0x04) sample_start(state->samples, 2, SND_BASEHIT, 0);
if (bits_gone_hi & 0x08) sample_start(state->samples, 3, SND_INVADERHIT, 0);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
}
static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
{
- astinvad_state *state = device->machine->driver_data<astinvad_state>();
+ astinvad_state *state = device->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
@@ -350,13 +350,13 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) sample_start(state->samples, 5, SND_FLEET4, 0);
if (bits_gone_hi & 0x10) sample_start(state->samples, 4, SND_UFOHIT, 0);
- state->screen_flip = (input_port_read(device->machine, "CABINET") & data & 0x20) ? 0xff : 0x00;
+ state->screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00;
}
static WRITE8_HANDLER( spaceint_sound1_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@@ -375,15 +375,15 @@ static WRITE8_HANDLER( spaceint_sound1_w )
static WRITE8_HANDLER( spaceint_sound2_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
- space->machine->sound().system_enable(data & 0x02);
+ space->machine().sound().system_enable(data & 0x02);
if (bits_gone_hi & 0x04) sample_start(state->samples, 3, SND_INVADERHIT, 0);
- state->screen_flip = (input_port_read(space->machine, "CABINET") & data & 0x80) ? 0xff : 0x00;
+ state->screen_flip = (input_port_read(space->machine(), "CABINET") & data & 0x80) ? 0xff : 0x00;
}
@@ -743,7 +743,7 @@ ROM_END
static DRIVER_INIT( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* the flip screen logic adds 32 to the Y after flipping */
state->flip_yoffs = 32;
@@ -752,7 +752,7 @@ static DRIVER_INIT( kamikaze )
static DRIVER_INIT( spcking2 )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* don't have the schematics, but the blanking must center the screen here */
state->flip_yoffs = 0;
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index a67109fe466..935ef6f09b5 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -210,7 +210,7 @@ static WRITE8_HANDLER( seawolf2_lamps_w )
static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~port_1_last;
port_1_last = data;
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~port_2_last;
port_2_last = data;
@@ -250,7 +250,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
if (rising_bits & 0x10) sample_start(samples, 8, 3, 0); /* Right Sonar */
if (rising_bits & 0x20) sample_start(samples, 3, 3, 0); /* Left Sonar */
- coin_counter_w(space->machine, 0, data & 0x40); /* Coin Counter */
+ coin_counter_w(space->machine(), 0, data & 0x40); /* Coin Counter */
}
@@ -264,7 +264,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
static CUSTOM_INPUT( ebases_trackball_r )
{
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
- return input_port_read(field->port->machine, names[input_select]);
+ return input_port_read(field->port->machine(), names[input_select]);
}
@@ -276,7 +276,7 @@ static WRITE8_HANDLER( ebases_trackball_select_w )
static WRITE8_HANDLER( ebases_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -289,9 +289,9 @@ static WRITE8_HANDLER( ebases_coin_w )
static READ8_HANDLER( spacezap_io_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- return input_port_read_safe(space->machine, "P3HANDLE", 0xff);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ return input_port_read_safe(space->machine(), "P3HANDLE", 0xff);
}
@@ -308,13 +308,13 @@ static READ8_HANDLER( wow_io_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
case 2: astrocade_sparkle[0] = data; break;
case 3: astrocade_sparkle[1] = data; break;
case 4: astrocade_sparkle[2] = data; break;
case 5: astrocade_sparkle[3] = data; break;
- case 7: coin_counter_w(space->machine, 2, data); break;
+ case 7: coin_counter_w(space->machine(), 2, data); break;
}
return 0xff;
}
@@ -333,15 +333,15 @@ static READ8_HANDLER( gorf_io_1_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
case 2: astrocade_sparkle[0] = data; break;
case 3: astrocade_sparkle[1] = data; break;
case 4: astrocade_sparkle[2] = data; break;
case 5: astrocade_sparkle[3] = data; break;
case 6:
- space->machine->device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
- space->machine->device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
+ space->machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
+ space->machine().device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
break;
case 7: mame_printf_debug("io_1:%d\n", data); break;
}
@@ -381,11 +381,11 @@ static READ8_HANDLER( robby_io_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
- case 2: coin_counter_w(space->machine, 2, data); break;
- case 6: set_led_status(space->machine, 0, data); break;
- case 7: set_led_status(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
+ case 2: coin_counter_w(space->machine(), 2, data); break;
+ case 6: set_led_status(space->machine(), 0, data); break;
+ case 7: set_led_status(space->machine(), 1, data); break;
}
return 0xff;
}
@@ -400,10 +400,10 @@ static READ8_HANDLER( robby_io_r )
static READ8_HANDLER( profpac_io_1_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- set_led_status(space->machine, 0, (offset >> 10) & 1);
- set_led_status(space->machine, 1, (offset >> 11) & 1);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ set_led_status(space->machine(), 0, (offset >> 10) & 1);
+ set_led_status(space->machine(), 1, (offset >> 11) & 1);
return 0xff;
}
@@ -432,14 +432,14 @@ static WRITE8_HANDLER( profpac_banksw_w )
/* set the main banking */
space->install_read_bank(0x4000, 0xbfff, "bank1");
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + 0x8000 * bank);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user1")->base() + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
space->install_legacy_read_handler(0x4000, 0x7fff, FUNC(profpac_videoram_r));
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
- if ((data & 0x80) && space->machine->region("user2")->base() != NULL)
+ if ((data & 0x80) && space->machine().region("user2")->base() != NULL)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
bank = data - 0x80;
@@ -448,7 +448,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
if (bank < 0x28)
{
space->install_read_bank(0x4000, 0x7fff, "bank2");
- memory_set_bankptr(space->machine, "bank2", space->machine->region("user2")->base() + 0x4000 * bank);
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region("user2")->base() + 0x4000 * bank);
}
else
space->unmap_read(0x4000, 0x7fff);
@@ -458,7 +458,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
static STATE_POSTLOAD( profbank_banksw_restore )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
profpac_banksw_w(space, 0, profpac_bank);
}
@@ -473,10 +473,10 @@ static STATE_POSTLOAD( profbank_banksw_restore )
static READ8_HANDLER( demndrgn_io_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- set_led_status(space->machine, 0, (offset >> 10) & 1);
- set_led_status(space->machine, 1, (offset >> 11) & 1);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ set_led_status(space->machine(), 0, (offset >> 10) & 1);
+ set_led_status(space->machine(), 1, (offset >> 11) & 1);
input_select = (offset >> 12) & 1;
return 0xff;
}
@@ -485,7 +485,7 @@ static READ8_HANDLER( demndrgn_io_r )
static CUSTOM_INPUT( demndragn_joystick_r )
{
static const char *const names[] = { "MOVEX", "MOVEY" };
- return input_port_read(field->port->machine, names[input_select]);
+ return input_port_read(field->port->machine(), names[input_select]);
}
@@ -526,7 +526,7 @@ static const ay8910_interface ay8912_interface =
static WRITE8_HANDLER( tenpindx_sound_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -554,7 +554,7 @@ static WRITE8_HANDLER( tenpindx_lamp_w )
static WRITE8_HANDLER( tenpindx_counter_w )
{
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
if (data & 0xfc) mame_printf_debug("tenpindx_counter_w = %02X\n", data);
}
@@ -1729,54 +1729,54 @@ ROM_END
static DRIVER_INIT( seawolf2 )
{
astrocade_video_config = 0x00;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x40, 0, 0xff18, FUNC(seawolf2_sound_1_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x41, 0x41, 0, 0xff18, FUNC(seawolf2_sound_2_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x42, 0x43, 0, 0xff18, FUNC(seawolf2_lamps_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x40, 0, 0xff18, FUNC(seawolf2_sound_1_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x41, 0x41, 0, 0xff18, FUNC(seawolf2_sound_2_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x42, 0x43, 0, 0xff18, FUNC(seawolf2_lamps_w));
}
static DRIVER_INIT( ebases )
{
astrocade_video_config = AC_SOUND_PRESENT;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, 0, 0xff07, FUNC(ebases_coin_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x28, 0x28, 0, 0xff07, FUNC(ebases_trackball_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, 0, 0xff07, FUNC(ebases_coin_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x28, 0x28, 0, 0xff07, FUNC(ebases_trackball_select_w));
}
static DRIVER_INIT( spacezap )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x13, 0x13, 0x03ff, 0xff00, FUNC(spacezap_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x13, 0x13, 0x03ff, 0xff00, FUNC(spacezap_io_r));
}
static DRIVER_INIT( wow )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(wow_io_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(wow_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r));
}
static DRIVER_INIT( gorf )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(gorf_io_1_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, 0x0fff, 0xff00, FUNC(gorf_io_2_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(gorf_io_1_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, 0x0fff, 0xff00, FUNC(gorf_io_2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r));
}
static DRIVER_INIT( robby )
{
astrocade_video_config = AC_SOUND_PRESENT;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(robby_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(robby_io_r));
}
static DRIVER_INIT( profpac )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = AC_SOUND_PRESENT;
iospace->install_legacy_read_handler(0x14, 0x14, 0x0fff, 0xff00, FUNC(profpac_io_1_r));
@@ -1784,13 +1784,13 @@ static DRIVER_INIT( profpac )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
static DRIVER_INIT( demndrgn )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = 0x00;
iospace->install_legacy_read_handler(0x14, 0x14, 0x1fff, 0xff00, FUNC(demndrgn_io_r));
@@ -1800,13 +1800,13 @@ static DRIVER_INIT( demndrgn )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
static DRIVER_INIT( tenpindx )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = 0x00;
iospace->install_read_port(0x60, 0x60, 0x0000, 0xff00, "P60");
@@ -1821,7 +1821,7 @@ static DRIVER_INIT( tenpindx )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index df79c961569..e6d6ec11142 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -60,9 +60,9 @@ public:
static VIDEO_START( astrocorp )
{
- astrocorp_state *state = machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = machine.driver_data<astrocorp_state>();
- state->bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->bitmap));
state->save_item (NAME(state->screen_enable));
@@ -91,9 +91,9 @@ static VIDEO_START( astrocorp )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- astrocorp_state *state = machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = machine.driver_data<astrocorp_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = state->spriteram + state->spriteram_size / 2;
@@ -127,7 +127,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
for (xwrap = 0 ; xwrap <= 0x200 ; xwrap += 0x200)
{
- drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[0],
code, 0,
0, 0,
sx + x * 16 - xwrap, sy + y * 16 - ywrap, 0xff);
@@ -141,12 +141,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(astrocorp)
{
- astrocorp_state *state = screen->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = screen->machine().driver_data<astrocorp_state>();
if (state->screen_enable & 1)
copybitmap(bitmap, state->bitmap, 0,0,0,0, cliprect);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -158,20 +158,20 @@ static SCREEN_UPDATE(astrocorp)
static WRITE16_HANDLER( astrocorp_draw_sprites_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
UINT16 old = state->draw_sprites;
UINT16 now = COMBINE_DATA(&state->draw_sprites);
if (!old && now)
- draw_sprites(space->machine, state->bitmap, &space->machine->primary_screen->visible_area());
+ draw_sprites(space->machine(), state->bitmap, &space->machine().primary_screen->visible_area());
}
static WRITE16_HANDLER( astrocorp_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -199,18 +199,18 @@ static WRITE16_HANDLER( showhand_outputs_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, (data & 0x0004)); // coin counter
- set_led_status(space->machine, 0, (data & 0x0008)); // you win
- if ((data & 0x0010)) increment_dispensed_tickets(space->machine, 1); // coin out
- set_led_status(space->machine, 1, (data & 0x0020)); // coin/hopper jam
+ coin_counter_w(space->machine(), 0, (data & 0x0004)); // coin counter
+ set_led_status(space->machine(), 0, (data & 0x0008)); // you win
+ if ((data & 0x0010)) increment_dispensed_tickets(space->machine(), 1); // coin out
+ set_led_status(space->machine(), 1, (data & 0x0020)); // coin/hopper jam
}
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 2, (data & 0x0100)); // bet
- set_led_status(space->machine, 3, (data & 0x0800)); // start
- set_led_status(space->machine, 4, (data & 0x1000)); // ? select/choose
- set_led_status(space->machine, 5, (data & 0x2000)); // ? select/choose
- set_led_status(space->machine, 6, (data & 0x4000)); // look
+ set_led_status(space->machine(), 2, (data & 0x0100)); // bet
+ set_led_status(space->machine(), 3, (data & 0x0800)); // start
+ set_led_status(space->machine(), 4, (data & 0x1000)); // ? select/choose
+ set_led_status(space->machine(), 5, (data & 0x2000)); // ? select/choose
+ set_led_status(space->machine(), 6, (data & 0x4000)); // look
}
// popmessage("%04X",data);
}
@@ -235,23 +235,23 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, (data & 0x0001)); // key in |
- coin_counter_w(space->machine, 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter
- coin_counter_w(space->machine, 1, (data & 0x0004)); // key out |
- ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0008)<<4); // hopper motor?
+ coin_counter_w(space->machine(), 0, (data & 0x0001)); // key in |
+ coin_counter_w(space->machine(), 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter
+ coin_counter_w(space->machine(), 1, (data & 0x0004)); // key out |
+ ticket_dispenser_w(space->machine().device("hopper"), 0, (data & 0x0008)<<4); // hopper motor?
// (data & 0x0010) // hopper?
- set_led_status(space->machine, 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant")
- ticket_dispenser_w(space->machine->device("ticket"), 0, data & 0x0080); // ticket motor?
+ set_led_status(space->machine(), 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant")
+ ticket_dispenser_w(space->machine().device("ticket"), 0, data & 0x0080); // ticket motor?
}
if (ACCESSING_BITS_8_15)
{
// lamps:
- set_led_status(space->machine, 1, (data & 0x0100)); // select
- set_led_status(space->machine, 2, (data & 0x0400)); // take
- set_led_status(space->machine, 3, (data & 0x0800)); // bet
- set_led_status(space->machine, 4, (data & 0x1000)); // start
- set_led_status(space->machine, 5, (data & 0x4000)); // win / test
- set_led_status(space->machine, 6, (data & 0x8000)); // ticket?
+ set_led_status(space->machine(), 1, (data & 0x0100)); // select
+ set_led_status(space->machine(), 2, (data & 0x0400)); // take
+ set_led_status(space->machine(), 3, (data & 0x0800)); // bet
+ set_led_status(space->machine(), 4, (data & 0x1000)); // start
+ set_led_status(space->machine(), 5, (data & 0x4000)); // win / test
+ set_led_status(space->machine(), 6, (data & 0x8000)); // ticket?
}
// popmessage("%04X",data);
@@ -259,7 +259,7 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
static WRITE16_HANDLER( astrocorp_screen_enable_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
COMBINE_DATA(&state->screen_enable);
// popmessage("%04X",data);
if (state->screen_enable & (~1))
@@ -274,9 +274,9 @@ static READ16_HANDLER( astrocorp_unk_r )
// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
static WRITE16_HANDLER( astrocorp_palette_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb(space->machine, offset,
+ palette_set_color_rgb(space->machine(), offset,
pal5bit((state->paletteram[offset] >> 0) & 0x1f),
pal6bit((state->paletteram[offset] >> 5) & 0x3f),
pal5bit((state->paletteram[offset] >> 11) & 0x1f)
@@ -1004,7 +1004,7 @@ ROM_END
static DRIVER_INIT( showhand )
{
#if 0
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[0x0a1a/2] = 0x6000; // hopper jam
@@ -1020,7 +1020,7 @@ static DRIVER_INIT( showhand )
static DRIVER_INIT( showhanc )
{
#if 0
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[0x14d4/2] = 0x4e71; // enable full test mode
rom[0x14d6/2] = 0x4e71; // ""
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 167c8313a74..dbde20a4347 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -81,7 +81,7 @@
static READ8_HANDLER( irq_clear_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -90,7 +90,7 @@ static READ8_HANDLER( irq_clear_r )
static TIMER_DEVICE_CALLBACK( irq_callback )
{
- astrof_state *state = timer.machine->driver_data<astrof_state>();
+ astrof_state *state = timer.machine().driver_data<astrof_state>();
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
}
@@ -104,17 +104,17 @@ static TIMER_DEVICE_CALLBACK( irq_callback )
static INPUT_CHANGED( coin_inserted )
{
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
- coin_counter_w(field->port->machine, 0, newval);
+ coin_counter_w(field->port->machine(), 0, newval);
}
static INPUT_CHANGED( service_coin_inserted )
{
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* service coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@@ -123,7 +123,7 @@ static INPUT_CHANGED( service_coin_inserted )
static CUSTOM_INPUT( astrof_p1_controls_r )
{
- return input_port_read(field->port->machine, "P1");
+ return input_port_read(field->port->machine(), "P1");
}
@@ -134,10 +134,10 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
/* on an upright cabinet, a single set of controls
is connected to both sets of pins on the edge
connector */
- if (input_port_read(field->port->machine, "CAB"))
- ret = input_port_read(field->port->machine, "P2");
+ if (input_port_read(field->port->machine(), "CAB"))
+ ret = input_port_read(field->port->machine(), "P2");
else
- ret = input_port_read(field->port->machine, "P1");
+ ret = input_port_read(field->port->machine(), "P1");
return ret;
}
@@ -146,16 +146,16 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
static CUSTOM_INPUT( tomahawk_controls_r )
{
UINT32 ret;
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* on a cocktail cabinet, two sets of controls are
multiplexed on a single set of inputs
(not verified on pcb) */
if (state->flipscreen)
- ret = input_port_read(field->port->machine, "P2");
+ ret = input_port_read(field->port->machine(), "P2");
else
- ret = input_port_read(field->port->machine, "P1");
+ ret = input_port_read(field->port->machine(), "P1");
return ret;
}
@@ -174,7 +174,7 @@ static CUSTOM_INPUT( tomahawk_controls_r )
static VIDEO_START( astrof )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* allocate the color RAM -- half the size of the video RAM as A0 is not connected */
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size / 2);
@@ -182,9 +182,9 @@ static VIDEO_START( astrof )
}
-static rgb_t make_pen( running_machine *machine, UINT8 data )
+static rgb_t make_pen( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
UINT8 r1_bit = state->red_on ? 0x01 : (data >> 0) & 0x01;
UINT8 r2_bit = state->red_on ? 0x01 : (data >> 1) & 0x01;
@@ -203,13 +203,13 @@ static rgb_t make_pen( running_machine *machine, UINT8 data )
}
-static void astrof_get_pens( running_machine *machine, pen_t *pens )
+static void astrof_get_pens( running_machine &machine, pen_t *pens )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
offs_t i;
UINT8 bank = (state->astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
/* this results in e.g. astrof background being black */
@@ -240,10 +240,10 @@ static void astrof_get_pens( running_machine *machine, pen_t *pens )
}
-static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
+static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
@@ -282,7 +282,7 @@ static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
static WRITE8_HANDLER( astrof_videoram_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = *state->astrof_color & 0x0e;
@@ -291,7 +291,7 @@ static WRITE8_HANDLER( astrof_videoram_w )
static WRITE8_HANDLER( tomahawk_videoram_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = (*state->astrof_color & 0x0e) | ((*state->astrof_color & 0x01) << 4);
@@ -300,9 +300,9 @@ static WRITE8_HANDLER( tomahawk_videoram_w )
static WRITE8_HANDLER( video_control_1_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
- state->flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine, "CAB");
+ state->flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine(), "CAB");
/* this ties to the CLR pin of the shift registers */
state->screen_off = (data & 0x02) ? TRUE : FALSE;
@@ -310,13 +310,13 @@ static WRITE8_HANDLER( video_control_1_w )
/* D2 - not connected in the schematics, but at one point Astro Fighter sets it to 1 */
/* D3-D7 - not connected */
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void astrof_set_video_control_2( running_machine *machine, UINT8 data )
+static void astrof_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -332,14 +332,14 @@ static void astrof_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( astrof_video_control_2_w )
{
- astrof_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ astrof_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void spfghmk2_set_video_control_2( running_machine *machine, UINT8 data )
+static void spfghmk2_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -352,14 +352,14 @@ static void spfghmk2_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( spfghmk2_video_control_2_w )
{
- spfghmk2_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ spfghmk2_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void tomahawk_set_video_control_2( running_machine *machine, UINT8 data )
+static void tomahawk_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -371,14 +371,14 @@ static void tomahawk_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( tomahawk_video_control_2_w )
{
- tomahawk_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ tomahawk_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void video_update_common( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
+static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -425,9 +425,9 @@ static SCREEN_UPDATE( astrof )
{
pen_t pens[ASTROF_NUM_PENS];
- astrof_get_pens(screen->machine, pens);
+ astrof_get_pens(screen->machine(), pens);
- video_update_common(screen->machine, bitmap, cliprect, pens);
+ video_update_common(screen->machine(), bitmap, cliprect, pens);
return 0;
}
@@ -437,9 +437,9 @@ static SCREEN_UPDATE( tomahawk )
{
pen_t pens[TOMAHAWK_NUM_PENS];
- tomahawk_get_pens(screen->machine, pens);
+ tomahawk_get_pens(screen->machine(), pens);
- video_update_common(screen->machine, bitmap, cliprect, pens);
+ video_update_common(screen->machine(), bitmap, cliprect, pens);
return 0;
}
@@ -455,13 +455,13 @@ static SCREEN_UPDATE( tomahawk )
static READ8_HANDLER( shoot_r )
{
/* not really sure about this */
- return space->machine->rand() & 8;
+ return space->machine().rand() & 8;
}
static READ8_HANDLER( abattle_coin_prot_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->abattle_count = (state->abattle_count + 1) % 0x0101;
return state->abattle_count ? 0x07 : 0x00;
@@ -470,7 +470,7 @@ static READ8_HANDLER( abattle_coin_prot_r )
static READ8_HANDLER( afire_coin_prot_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->abattle_count = state->abattle_count ^ 0x01;
return state->abattle_count ? 0x07 : 0x00;
@@ -479,7 +479,7 @@ static READ8_HANDLER( afire_coin_prot_r )
static READ8_HANDLER( tomahawk_protection_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
/* flip the byte */
return BITSWAP8(*state->tomahawk_protection, 0, 1, 2, 3, 4, 5, 6, 7);
@@ -495,13 +495,13 @@ static READ8_HANDLER( tomahawk_protection_r )
static MACHINE_START( astrof )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
astrof_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
/* register for state saving */
state->save_item(NAME(state->red_on));
@@ -518,7 +518,7 @@ static MACHINE_START( astrof )
static MACHINE_START( abattle )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* register for state saving */
state->save_item(NAME(state->abattle_count));
@@ -529,12 +529,12 @@ static MACHINE_START( abattle )
static MACHINE_START( spfghmk2 )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
spfghmk2_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
/* the red background circuit is disabled */
state->red_on = FALSE;
@@ -548,13 +548,13 @@ static MACHINE_START( spfghmk2 )
static MACHINE_START( tomahawk )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
tomahawk_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
- state->sn = machine->device("snsnd");
+ state->maincpu = machine.device("maincpu");
+ state->sn = machine.device("snsnd");
/* register for state saving */
state->save_item(NAME(state->red_on));
@@ -572,7 +572,7 @@ static MACHINE_START( tomahawk )
static MACHINE_RESET( abattle )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
state->abattle_count = 0;
}
@@ -1300,44 +1300,44 @@ ROM_END
static DRIVER_INIT( abattle )
{
/* use the protection PROM to decrypt the ROMs */
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *prom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *prom = machine.region("user1")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = prom[rom[i]];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
}
static DRIVER_INIT( afire )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = ~rom[i];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(afire_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(afire_coin_prot_r));
}
static DRIVER_INIT( sstarbtl )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = ~rom[i];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
}
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index bafa45db5e2..6ea6cf9ca0d 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -232,13 +232,13 @@ DIP locations verified for:
static TIMER_CALLBACK( cadash_interrupt5 )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE);
}
static INTERRUPT_GEN( cadash_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(cadash_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(cadash_interrupt5));
device_set_input_line(device, 4, HOLD_LINE); /* interrupt vector 4 */
}
@@ -249,19 +249,19 @@ static INTERRUPT_GEN( cadash_interrupt )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_2151_w )
{
- memory_set_bank(device->machine, "bank1", data & 0x03);
+ memory_set_bank(device->machine(), "bank1", data & 0x03);
}
static void asuka_msm5205_vck( device_t *device )
{
- asuka_state *state = device->machine->driver_data<asuka_state>();
+ asuka_state *state = device->machine().driver_data<asuka_state>();
if (state->adpcm_data != -1)
{
@@ -270,7 +270,7 @@ static void asuka_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("ymsnd")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("ymsnd")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@@ -278,7 +278,7 @@ static void asuka_msm5205_vck( device_t *device )
static WRITE8_HANDLER( asuka_msm5205_address_w )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff) | (data << 8);
}
@@ -289,7 +289,7 @@ static WRITE8_DEVICE_HANDLER( asuka_msm5205_start_w )
static WRITE8_DEVICE_HANDLER( asuka_msm5205_stop_w )
{
- asuka_state *state = device->machine->driver_data<asuka_state>();
+ asuka_state *state = device->machine().driver_data<asuka_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0xff00;
}
@@ -771,7 +771,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -835,16 +835,16 @@ static const tc0110pcr_interface asuka_tc0110pcr_intf =
static MACHINE_START( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->pc090oj = machine->device("pc090oj");
- state->tc0100scn = machine->device("tc0100scn");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->pc090oj = machine.device("pc090oj");
+ state->tc0100scn = machine.device("tc0100scn");
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
- memory_configure_bank(machine, "bank1", 1, 3, machine->region("audiocpu")->base() + 0x10000, 0x04000);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("audiocpu")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 3, machine.region("audiocpu")->base() + 0x10000, 0x04000);
state->save_item(NAME(state->adpcm_pos));
state->save_item(NAME(state->adpcm_data));
@@ -860,7 +860,7 @@ static MACHINE_START( asuka )
static MACHINE_RESET( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
state->adpcm_pos = 0;
state->adpcm_data = -1;
@@ -876,7 +876,7 @@ static MACHINE_RESET( asuka )
static SCREEN_EOF( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
pc090oj_eof_callback(state->pc090oj);
}
diff --git a/src/mame/drivers/atarifb.c b/src/mame/drivers/atarifb.c
index 742f3eb7889..bebca222abb 100644
--- a/src/mame/drivers/atarifb.c
+++ b/src/mame/drivers/atarifb.c
@@ -507,9 +507,9 @@ GFXDECODE_END
static MACHINE_START( atarifb )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->CTRLD));
state->save_item(NAME(state->sign_x_1));
@@ -532,7 +532,7 @@ static MACHINE_START( atarifb )
static MACHINE_RESET( atarifb )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
state->CTRLD = 0;
state->sign_x_1 = 0;
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index ebebbfcced4..e66e5477efc 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -32,9 +32,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
atarigen_init(machine);
state->save_item(NAME(state->which_input));
}
@@ -50,12 +50,12 @@ static MACHINE_START( atarig1 )
static MACHINE_RESET( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarig1_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarig1_scanline_update, 8);
atarijsa_reset();
}
@@ -71,7 +71,7 @@ static WRITE16_HANDLER( mo_control_w )
{
if (ACCESSING_BITS_0_7)
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
atarirle_control_w(state->rle, data & 7);
}
}
@@ -79,7 +79,7 @@ static WRITE16_HANDLER( mo_control_w )
static WRITE16_HANDLER( mo_command_w )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(state->rle, (data == 0 && state->is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@@ -94,8 +94,8 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
- int temp = input_port_read(space->machine, "IN0");
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
+ int temp = input_port_read(space->machine(), "IN0");
if (state->cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
@@ -104,7 +104,7 @@ static READ16_HANDLER( special_port0_r )
static WRITE16_HANDLER( a2d_select_w )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
state->which_input = offset;
}
@@ -112,15 +112,15 @@ static WRITE16_HANDLER( a2d_select_w )
static READ16_HANDLER( a2d_data_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2" };
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
/* Pit Fighter has no A2D, just another input port */
if (state->is_pitfight)
- return input_port_read(space->machine, "ADC0");
+ return input_port_read(space->machine(), "ADC0");
/* otherwise, assume it's hydra */
if (state->which_input < 3)
- return input_port_read(space->machine, adcnames[state->which_input]) << 8;
+ return input_port_read(space->machine(), adcnames[state->which_input]) << 8;
return 0;
}
@@ -152,7 +152,7 @@ INLINE void update_bank(atarig1_state *state, int bank)
static STATE_POSTLOAD( pitfightb_state_postload )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
int bank = state->bslapstic_bank;
state->bslapstic_bank = -1;
update_bank(state, bank);
@@ -161,7 +161,7 @@ static STATE_POSTLOAD( pitfightb_state_postload )
static READ16_HANDLER( pitfightb_cheap_slapstic_r )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
int result = state->bslapstic_base[offset & 0xfff];
/* the cheap replacement slapstic just triggers on the simple banking */
@@ -187,12 +187,12 @@ static READ16_HANDLER( pitfightb_cheap_slapstic_r )
}
-static void pitfightb_cheap_slapstic_init(running_machine *machine)
+static void pitfightb_cheap_slapstic_init(running_machine &machine)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
/* install a read handler */
- state->bslapstic_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x038000, 0x03ffff, FUNC(pitfightb_cheap_slapstic_r));
+ state->bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x038000, 0x03ffff, FUNC(pitfightb_cheap_slapstic_r));
/* allocate memory for a copy of bank 0 */
state->bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1218,9 +1218,9 @@ ROM_END
*
*************************************/
-static void init_g1_common(running_machine *machine, offs_t slapstic_base, int slapstic, int is_pitfight)
+static void init_g1_common(running_machine &machine, offs_t slapstic_base, int slapstic, int is_pitfight)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
state->eeprom_default = NULL;
if (slapstic == -1)
@@ -1228,10 +1228,10 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s
pitfightb_cheap_slapstic_init(machine);
state->save_item(NAME(state->bslapstic_bank));
state->save_item(NAME(state->bslapstic_primed));
- machine->state().register_postload(pitfightb_state_postload, NULL);
+ machine.state().register_postload(pitfightb_state_postload, NULL);
}
else if (slapstic != 0)
- atarigen_slapstic_init(machine->device("maincpu"), slapstic_base, 0, slapstic);
+ atarigen_slapstic_init(machine.device("maincpu"), slapstic_base, 0, slapstic);
atarijsa_init(machine, "IN0", 0x4000);
state->is_pitfight = is_pitfight;
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index 4073b7f3d06..f0a74aa0919 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -41,7 +41,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarigen_init(machine);
state->save_item(NAME(state->analog_data));
@@ -54,11 +54,11 @@ static MACHINE_START( atarig42 )
static MACHINE_RESET( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarig42_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarig42_scanline_update, 8);
atarijsa_reset();
}
@@ -72,8 +72,8 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
- int temp = input_port_read(space->machine, "IN2");
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
+ int temp = input_port_read(space->machine(), "IN2");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -84,15 +84,15 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w )
{
static const char *const portnames[] = { "A2D0", "A2D1" };
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
- state->analog_data = input_port_read(space->machine, portnames[offset != 0]);
+ state->analog_data = input_port_read(space->machine(), portnames[offset != 0]);
}
static READ16_HANDLER( a2d_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
return state->analog_data << 8;
}
@@ -102,10 +102,10 @@ static WRITE16_HANDLER( io_latch_w )
/* upper byte */
if (ACCESSING_BITS_8_15)
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
/* bit 14 controls the ASIC65 reset line */
- asic65_reset(space->machine, (~data >> 14) & 1);
+ asic65_reset(space->machine(), (~data >> 14) & 1);
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 11) & 7);
@@ -115,7 +115,7 @@ static WRITE16_HANDLER( io_latch_w )
if (ACCESSING_BITS_0_7)
{
/* bit 4 resets the sound CPU */
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (!(data & 0x10)) atarijsa_reset();
/* bit 5 is /XRESET, probably related to the ASIC */
@@ -127,7 +127,7 @@ static WRITE16_HANDLER( io_latch_w )
static WRITE16_HANDLER( mo_command_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(state->rle, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@@ -266,7 +266,7 @@ static void roadriot_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( roadriot_sloop_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@@ -277,7 +277,7 @@ static READ16_HANDLER( roadriot_sloop_data_r )
static WRITE16_HANDLER( roadriot_sloop_data_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
}
@@ -325,7 +325,7 @@ static void guardians_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( guardians_sloop_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@@ -336,7 +336,7 @@ static READ16_HANDLER( guardians_sloop_data_r )
static WRITE16_HANDLER( guardians_sloop_data_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
}
@@ -795,14 +795,14 @@ ROM_END
static DRIVER_INIT( roadriot )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x400;
- address_space *main = machine->device<m68000_device>("maincpu")->space(AS_PROGRAM);
+ address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->sloop_base = main->install_legacy_readwrite_handler(0x000000, 0x07ffff, FUNC(roadriot_sloop_data_r), FUNC(roadriot_sloop_data_w));
- main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, *machine));
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, machine));
asic65_config(machine, ASIC65_ROMBASED);
/*
@@ -830,18 +830,18 @@ static DRIVER_INIT( roadriot )
static DRIVER_INIT( guardian )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x000;
/* it looks like they jsr to $80000 as some kind of protection */
/* put an RTS there so we don't die */
- *(UINT16 *)&machine->region("maincpu")->base()[0x80000] = 0x4E75;
+ *(UINT16 *)&machine.region("maincpu")->base()[0x80000] = 0x4E75;
- address_space *main = machine->device<m68000_device>("maincpu")->space(AS_PROGRAM);
+ address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->sloop_base = main->install_legacy_readwrite_handler(0x000000, 0x07ffff, FUNC(guardians_sloop_data_r), FUNC(guardians_sloop_data_w));
- main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, *machine));
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, machine));
asic65_config(machine, ASIC65_GUARDIANS);
/*
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index 4922c82088c..559f6ff65a5 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -37,7 +37,7 @@
*
*************************************/
-static void cage_irq_callback(running_machine *machine, int reason);
+static void cage_irq_callback(running_machine &machine, int reason);
@@ -47,9 +47,9 @@ static void cage_irq_callback(running_machine *machine, int reason);
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
cputag_set_input_line(machine, "maincpu", 3, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -64,11 +64,11 @@ static MACHINE_START( atarigt )
static MACHINE_RESET( atarigt )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarigt_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarigt_scanline_update, 8);
}
@@ -79,12 +79,12 @@ static MACHINE_RESET( atarigt )
*
*************************************/
-static void cage_irq_callback(running_machine *machine, int reason)
+static void cage_irq_callback(running_machine &machine, int reason)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (reason)
- atarigen_sound_int_gen(machine->device("maincpu"));
+ atarigen_sound_int_gen(machine.device("maincpu"));
else
atarigen_sound_int_ack_w(space,0,0,0xffff);
}
@@ -99,7 +99,7 @@ static void cage_irq_callback(running_machine *machine, int reason)
static READ32_HANDLER( special_port2_r )
{
- int temp = input_port_read(space->machine, "SERVICE");
+ int temp = input_port_read(space->machine(), "SERVICE");
temp ^= 0x0001; /* /A2DRDY always high for now */
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
@@ -108,8 +108,8 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
- int temp = input_port_read(space->machine, "COIN");
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
+ int temp = input_port_read(space->machine(), "COIN");
if (state->video_int_state) temp ^= 0x0001;
if (state->scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp;
@@ -156,7 +156,7 @@ static READ32_HANDLER( analog_port0_r )
compute_fake_pots(pots);
return (pots[0] << 24) | (pots[3] << 8);
#else
- return (input_port_read(space->machine, "AN1") << 24) | (input_port_read(space->machine, "AN2") << 8);
+ return (input_port_read(space->machine(), "AN1") << 24) | (input_port_read(space->machine(), "AN2") << 8);
#endif
}
@@ -168,7 +168,7 @@ static READ32_HANDLER( analog_port1_r )
compute_fake_pots(pots);
return (pots[2] << 24) | (pots[1] << 8);
#else
- return (input_port_read(space->machine, "AN3") << 24) | (input_port_read(space->machine, "AN4") << 8);
+ return (input_port_read(space->machine(), "AN3") << 24) | (input_port_read(space->machine(), "AN4") << 8);
#endif
}
@@ -196,7 +196,7 @@ static WRITE32_HANDLER( latch_w )
/* upper byte */
if (ACCESSING_BITS_24_31)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 27) & 7);
@@ -205,15 +205,15 @@ static WRITE32_HANDLER( latch_w )
if (ACCESSING_BITS_16_23)
{
// cage_reset_w(data & 0x00100000);
- coin_counter_w(space->machine, 0, data & 0x00080000);
- coin_counter_w(space->machine, 1, data & 0x00010000);
+ coin_counter_w(space->machine(), 0, data & 0x00080000);
+ coin_counter_w(space->machine(), 1, data & 0x00010000);
}
}
static WRITE32_HANDLER( mo_command_w )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(state->rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@@ -248,7 +248,7 @@ static READ32_HANDLER( sound_data_r )
static WRITE32_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_15)
- cage_control_w(space->machine, data);
+ cage_control_w(space->machine(), data);
if (ACCESSING_BITS_16_31)
main_to_cage_w(data >> 16);
}
@@ -277,7 +277,7 @@ static void tmek_update_mode(atarigt_state *state, offs_t offset)
static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/*
T-Mek init:
($387C0) = $0001
@@ -301,7 +301,7 @@ static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
static void tmek_protection_r(address_space *space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", cpu_get_previouspc(space->cpu), offset);
/* track accesses */
@@ -368,7 +368,7 @@ static void primage_update_mode(atarigt_state *state, offs_t offset)
static void primrage_protection_w(address_space *space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
if (LOG_PROTECTION)
{
UINT32 pc = cpu_get_previouspc(space->cpu);
@@ -439,7 +439,7 @@ static void primrage_protection_w(address_space *space, offs_t offset, UINT16 da
static void primrage_protection_r(address_space *space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/* track accesses */
primage_update_mode(state, offset);
@@ -554,7 +554,7 @@ if (LOG_PROTECTION)
static READ32_HANDLER( colorram_protection_r )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
UINT32 result32 = 0;
UINT16 result;
@@ -578,7 +578,7 @@ static READ32_HANDLER( colorram_protection_r )
static WRITE32_HANDLER( colorram_protection_w )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
if (ACCESSING_BITS_16_31)
@@ -1269,7 +1269,7 @@ static WRITE32_HANDLER( tmek_pf_w )
static DRIVER_INIT( tmek )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
state->eeprom_default = NULL;
state->is_primrage = 0;
@@ -1282,13 +1282,13 @@ static DRIVER_INIT( tmek )
state->protection_w = tmek_protection_w;
/* temp hack */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd72000, 0xd75fff, FUNC(tmek_pf_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd72000, 0xd75fff, FUNC(tmek_pf_w));
}
-static void primrage_init_common(running_machine *machine, offs_t cage_speedup)
+static void primrage_init_common(running_machine &machine, offs_t cage_speedup)
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
state->eeprom_default = NULL;
state->is_primrage = 1;
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 11c0ae73da0..b70a5124428 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -33,9 +33,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -49,11 +49,11 @@ static MACHINE_START( atarigx2 )
static MACHINE_RESET( atarigx2 )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarigx2_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarigx2_scanline_update, 8);
atarijsa_reset();
}
@@ -67,8 +67,8 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
- int temp = input_port_read(space->machine, "SERVICE");
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
+ int temp = input_port_read(space->machine(), "SERVICE");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -78,7 +78,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- int temp = input_port_read(space->machine, "SPECIAL");
+ int temp = input_port_read(space->machine(), "SPECIAL");
return (temp << 16) | temp;
}
@@ -90,9 +90,9 @@ static READ32_HANDLER( a2d_data_r )
switch (offset)
{
case 0:
- return (input_port_read(space->machine, "A2D0") << 24) | (input_port_read(space->machine, "A2D1") << 8);
+ return (input_port_read(space->machine(), "A2D0") << 24) | (input_port_read(space->machine(), "A2D1") << 8);
case 1:
- return (input_port_read(space->machine, "A2D2") << 24) | (input_port_read(space->machine, "A2D3") << 8);
+ return (input_port_read(space->machine(), "A2D2") << 24) | (input_port_read(space->machine(), "A2D3") << 8);
}
return 0;
@@ -117,7 +117,7 @@ static WRITE32_HANDLER( latch_w )
/* upper byte */
if (ACCESSING_BITS_24_31)
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 27) & 7);
@@ -125,13 +125,13 @@ static WRITE32_HANDLER( latch_w )
/* lower byte */
if (ACCESSING_BITS_16_23)
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE32_HANDLER( mo_command_w )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(state->rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@@ -148,7 +148,7 @@ static WRITE32_HANDLER( mo_command_w )
static WRITE32_HANDLER( atarigx2_protection_w )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
{
int pc = cpu_get_previouspc(space->cpu);
// if (pc == 0x11cbe || pc == 0x11c30)
@@ -1105,7 +1105,7 @@ static READ32_HANDLER( atarigx2_protection_r )
{ 0xffffffff, 0xffff }
};
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
UINT32 result = state->protection_base[offset];
if (offset == 0x300)
@@ -1128,7 +1128,7 @@ static READ32_HANDLER( atarigx2_protection_r )
if (lookup_table[i][0] == 0xffffffff)
{
if (state->last_write_offset*2 >= 0x700 && state->last_write_offset*2 < 0x720)
- result = space->machine->rand() << 16;
+ result = space->machine().rand() << 16;
else
result = 0xffff << 16;
logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(space->cpu), offset, result);
@@ -2194,7 +2194,7 @@ ROM_END
static DRIVER_INIT( spclords )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@@ -2204,7 +2204,7 @@ static DRIVER_INIT( spclords )
static DRIVER_INIT( motofren )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@@ -2240,13 +2240,13 @@ static READ32_HANDLER( rrreveng_prot_r )
static DRIVER_INIT( rrreveng )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
state->playfield_base = 0x000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xca0fc0, 0xca0fc3, FUNC(rrreveng_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xca0fc0, 0xca0fc3, FUNC(rrreveng_prot_r));
}
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 05f3e4fc7ff..c9d902fc643 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -206,9 +206,9 @@ RoadBlasters (aka Future Vette):005*
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
cputag_set_input_line(machine, "maincpu", 2, state->joystick_int && state->joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -218,7 +218,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarisy1 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
atarigen_init(machine);
state->save_item(NAME(state->joystick_int));
@@ -229,13 +229,13 @@ static MACHINE_START( atarisy1 )
static MACHINE_RESET( atarisy1 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
/* initialize the system */
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_sound_io_reset(machine.device("audiocpu"));
/* reset the joystick parameters */
state->joystick_value = 0;
@@ -253,30 +253,30 @@ static MACHINE_RESET( atarisy1 )
static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
{
- atarisy1_state *state = timer.machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
state->joystick_value = param;
state->joystick_int = 1;
- atarigen_update_interrupts(timer.machine);
+ atarigen_update_interrupts(timer.machine());
}
static READ16_HANDLER( joystick_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
int newval = 0xff;
static const char *const portnames[] = { "IN0", "IN1" };
/* digital joystick type */
if (state->joystick_type == 1)
- newval = (input_port_read(space->machine, "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
+ newval = (input_port_read(space->machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */
else if (state->joystick_type == 2)
- newval = input_port_read(space->machine, portnames[offset & 1]);
+ newval = input_port_read(space->machine(), portnames[offset & 1]);
/* Road Blasters gas pedal */
else if (state->joystick_type == 3)
- newval = input_port_read(space->machine, "IN1");
+ newval = input_port_read(space->machine(), "IN1");
/* the A4 bit enables/disables joystick IRQs */
state->joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@@ -284,7 +284,7 @@ static READ16_HANDLER( joystick_r )
/* clear any existing interrupt and set a timer for a new one */
state->joystick_int = 0;
state->joystick_timer->adjust(attotime::from_usec(50), newval);
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
return state->joystick_value;
}
@@ -293,7 +293,7 @@ static READ16_HANDLER( joystick_r )
static WRITE16_HANDLER( joystick_w )
{
/* the A4 bit enables/disables joystick IRQs */
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
state->joystick_int_enable = ((offset >> 3) & 1) ^ 1;
}
@@ -307,7 +307,7 @@ static WRITE16_HANDLER( joystick_w )
static READ16_HANDLER( trakball_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
int result = 0xff;
/* Marble Madness trackball type -- rotated 45 degrees! */
@@ -323,13 +323,13 @@ static READ16_HANDLER( trakball_r )
if (player == 0)
{
- posx = (INT8)input_port_read(space->machine, "IN0");
- posy = (INT8)input_port_read(space->machine, "IN1");
+ posx = (INT8)input_port_read(space->machine(), "IN0");
+ posy = (INT8)input_port_read(space->machine(), "IN1");
}
else
{
- posx = (INT8)input_port_read(space->machine, "IN2");
- posy = (INT8)input_port_read(space->machine, "IN3");
+ posx = (INT8)input_port_read(space->machine(), "IN2");
+ posy = (INT8)input_port_read(space->machine(), "IN3");
}
state->cur[player][0] = posx + posy;
@@ -341,7 +341,7 @@ static READ16_HANDLER( trakball_r )
/* Road Blasters steering wheel */
else if (state->trackball_type == 2)
- result = input_port_read(space->machine, "IN0");
+ result = input_port_read(space->machine(), "IN0");
return result;
}
@@ -356,8 +356,8 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
- int temp = input_port_read(space->machine, "F60000");
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ int temp = input_port_read(space->machine(), "F60000");
if (state->cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -372,12 +372,12 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
- int temp = input_port_read(space->machine, "1820");
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ int temp = input_port_read(space->machine(), "1820");
if (state->cpu_to_sound_ready) temp ^= 0x08;
if (state->sound_to_cpu_ready) temp ^= 0x10;
- if (!(input_port_read(space->machine, "F60000") & 0x0040)) temp ^= 0x80;
+ if (!(input_port_read(space->machine(), "F60000") & 0x0040)) temp ^= 0x80;
return temp;
}
@@ -407,33 +407,33 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_DEVICE_HANDLER( via_pa_w )
{
- tms5220_data_w(device->machine->device("tms"), 0, data);
+ tms5220_data_w(device->machine().device("tms"), 0, data);
}
static READ8_DEVICE_HANDLER( via_pa_r )
{
- return tms5220_status_r(device->machine->device("tms"), 0);
+ return tms5220_status_r(device->machine().device("tms"), 0);
}
static WRITE8_DEVICE_HANDLER( via_pb_w )
{
/* write strobe */
- tms5220_wsq_w(device->machine->device("tms"), data & 1);
+ tms5220_wsq_w(device->machine().device("tms"), data & 1);
/* read strobe */
- tms5220_rsq_w(device->machine->device("tms"), (data & 2)>>1);
+ tms5220_rsq_w(device->machine().device("tms"), (data & 2)>>1);
/* bit 4 is connected to an up-counter, clocked by SYCLKB */
data = 5 | ((data >> 3) & 2);
- tms5220_set_frequency(device->machine->device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
+ tms5220_set_frequency(device->machine().device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
}
static READ8_DEVICE_HANDLER( via_pb_r )
{
- return (tms5220_readyq_r(device->machine->device("tms")) << 2) | (tms5220_intq_r(device->machine->device("tms")) << 3);
+ return (tms5220_readyq_r(device->machine().device("tms")) << 2) | (tms5220_intq_r(device->machine().device("tms")) << 3);
}
@@ -456,7 +456,7 @@ static const via6522_interface via_interface =
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 1);
+ set_led_status(space->machine(), offset, ~data & 1);
}
@@ -2343,9 +2343,9 @@ ROM_END
static DRIVER_INIT( marble )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 103);
state->joystick_type = 0; /* none */
state->trackball_type = 1; /* rotated */
@@ -2354,9 +2354,9 @@ static DRIVER_INIT( marble )
static DRIVER_INIT( peterpak )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 107);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@@ -2365,9 +2365,9 @@ static DRIVER_INIT( peterpak )
static DRIVER_INIT( indytemp )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 105);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@@ -2376,9 +2376,9 @@ static DRIVER_INIT( indytemp )
static DRIVER_INIT( roadrunn )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 108);
state->joystick_type = 2; /* analog */
state->trackball_type = 0; /* none */
@@ -2387,9 +2387,9 @@ static DRIVER_INIT( roadrunn )
static DRIVER_INIT( roadb109 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 109);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
@@ -2398,9 +2398,9 @@ static DRIVER_INIT( roadb109 )
static DRIVER_INIT( roadb110 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 110);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 6117c0fed48..97cd7e18996 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -155,9 +155,9 @@ static STATE_POSTLOAD( bankselect_postload );
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
if (state->video_int_state)
cputag_set_input_line(machine, "maincpu", 3, ASSERT_LINE);
@@ -190,13 +190,13 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- atarisy2_state *state = screen.machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = screen.machine().driver_data<atarisy2_state>();
if (scanline <= screen.height())
{
/* generate the 32V interrupt (IRQ 2) */
if ((scanline % 64) == 0)
if (state->interrupt_enable & 4)
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
}
@@ -223,30 +223,30 @@ DIRECT_UPDATE_HANDLER( atarisy2_direct_handler )
static MACHINE_START( atarisy2 )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
atarigen_init(machine);
state->save_item(NAME(state->interrupt_enable));
state->save_item(NAME(state->which_adc));
state->save_item(NAME(state->p2portwr_state));
state->save_item(NAME(state->p2portrd_state));
- machine->state().register_postload(bankselect_postload, NULL);
+ machine.state().register_postload(bankselect_postload, NULL);
state->save_item(NAME(state->sound_reset_state));
}
static MACHINE_RESET( atarisy2 )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
atarigen_eeprom_reset(state);
slapstic_reset();
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_sound_io_reset(machine->device("soundcpu"));
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64);
+ atarigen_sound_io_reset(machine.device("soundcpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 64);
- address_space *main = machine->device<t11_device>("maincpu")->space(AS_PROGRAM);
- main->set_direct_update_handler(direct_update_delegate_create_static(atarisy2_direct_handler, *machine));
+ address_space *main = machine.device<t11_device>("maincpu")->space(AS_PROGRAM);
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarisy2_direct_handler, machine));
state->p2portwr_state = 0;
state->p2portrd_state = 0;
@@ -264,7 +264,7 @@ static MACHINE_RESET( atarisy2 )
static INTERRUPT_GEN( vblank_int )
{
- atarisy2_state *state = device->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = device->machine().driver_data<atarisy2_state>();
/* clock the VBLANK through */
if (state->interrupt_enable & 8)
@@ -275,9 +275,9 @@ static INTERRUPT_GEN( vblank_int )
static WRITE16_HANDLER( int0_ack_w )
{
/* reset sound IRQ */
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
state->p2portrd_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
}
@@ -285,13 +285,13 @@ static WRITE16_HANDLER( int1_ack_w )
{
/* reset sound CPU */
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( delayed_int_enable_w )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
state->interrupt_enable = param;
}
@@ -299,7 +299,7 @@ static TIMER_CALLBACK( delayed_int_enable_w )
static WRITE16_HANDLER( int_enable_w )
{
if (offset == 0 && ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_int_enable_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_int_enable_w), data);
}
@@ -332,22 +332,22 @@ static WRITE16_HANDLER( bankselect_w )
0x8e000, 0x86000, 0x7e000, 0x76000
};
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
int newword = state->bankselect[offset];
UINT8 *base;
COMBINE_DATA(&newword);
state->bankselect[offset] = newword;
- base = &space->machine->region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
+ base = &space->machine().region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
memcpy(offset ? state->rombank2 : state->rombank1, base, 0x2000);
}
static STATE_POSTLOAD( bankselect_postload )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
bankselect_w(space, 0, state->bankselect[0], 0xffff);
bankselect_w(space, 1, state->bankselect[1], 0xffff);
@@ -363,8 +363,8 @@ static STATE_POSTLOAD( bankselect_postload )
static READ16_HANDLER( switch_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
- int result = input_port_read(space->machine, "1800") | (input_port_read(space->machine, "1801") << 8);
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ int result = input_port_read(space->machine(), "1800") | (input_port_read(space->machine(), "1801") << 8);
if (state->cpu_to_sound_ready) result ^= 0x20;
if (state->sound_to_cpu_ready) result ^= 0x10;
@@ -375,14 +375,14 @@ static READ16_HANDLER( switch_r )
static READ8_HANDLER( switch_6502_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
- int result = input_port_read(space->machine, "1840");
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ int result = input_port_read(space->machine(), "1840");
if (state->cpu_to_sound_ready) result |= 0x01;
if (state->sound_to_cpu_ready) result |= 0x02;
- if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0))
+ if ((state->has_tms5220) && (tms5220_readyq_r(space->machine().device("tms")) == 0))
result &= ~0x04;
- if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
+ if (!(input_port_read(space->machine(), "1801") & 0x80)) result |= 0x10;
return result;
}
@@ -390,12 +390,12 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_HANDLER( switch_6502_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
data = 12 | ((data >> 5) & 1);
- tms5220_set_frequency(space->machine->device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
+ tms5220_set_frequency(space->machine().device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
}
}
@@ -409,7 +409,7 @@ static WRITE8_HANDLER( switch_6502_w )
static WRITE16_HANDLER( adc_strobe_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
state->which_adc = offset & 3;
}
@@ -417,23 +417,23 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->which_adc < state->pedal_count)
- return ~input_port_read(space->machine, adcnames[state->which_adc]);
+ return ~input_port_read(space->machine(), adcnames[state->which_adc]);
- return input_port_read(space->machine, adcnames[state->which_adc]) | 0xff00;
+ return input_port_read(space->machine(), adcnames[state->which_adc]) | 0xff00;
}
static READ8_HANDLER( leta_r )
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (offset <= 1 && state->pedal_count == -1) /* 720 */
{
- switch (input_port_read(space->machine, "SELECT"))
+ switch (input_port_read(space->machine(), "SELECT"))
{
case 0: /* Real */
break;
@@ -441,8 +441,8 @@ static READ8_HANDLER( leta_r )
case 1: /* Fake Joystick */
/* special thanks to MAME Analog+ for the mapping code */
{
- int analogx = input_port_read(space->machine, "FAKE_JOY_X") - 128;
- int analogy = input_port_read(space->machine, "FAKE_JOY_Y") - 128;
+ int analogx = input_port_read(space->machine(), "FAKE_JOY_X") - 128;
+ int analogy = input_port_read(space->machine(), "FAKE_JOY_Y") - 128;
double angle;
/* if the joystick is centered, leave the rest of this alone */
@@ -481,7 +481,7 @@ static READ8_HANDLER( leta_r )
{
INT32 diff;
UINT32 temp;
- UINT32 rotate_count = input_port_read(space->machine, "FAKE_SPINNER") & 0xffff;
+ UINT32 rotate_count = input_port_read(space->machine(), "FAKE_SPINNER") & 0xffff;
/* rotate_count behaves the same as the real LEAT1 Rotate encoder
* we use it to generate the LETA0 Center encoder count
*/
@@ -559,7 +559,7 @@ static READ8_HANDLER( leta_r )
return 0xff;
}
}
- return input_port_read(space->machine, letanames[offset]);
+ return input_port_read(space->machine(), letanames[offset]);
}
@@ -669,7 +669,7 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x02)) rbott += 1.0/47;
if (!(data & 0x04)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_ym2151_vol(space->machine, gain * 100);
+ atarigen_set_ym2151_vol(space->machine(), gain * 100);
/* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */
rtop = 1.0/(1.0/100 + 1.0/100);
@@ -677,7 +677,7 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x08)) rbott += 1.0/47;
if (!(data & 0x10)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_pokey_vol(space->machine, gain * 100);
+ atarigen_set_pokey_vol(space->machine(), gain * 100);
/* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */
rtop = 1.0/(1.0/100 + 1.0/100);
@@ -686,13 +686,13 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x40)) rbott += 1.0/47;
if (!(data & 0x80)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_tms5220_vol(space->machine, gain * 100);
+ atarigen_set_tms5220_vol(space->machine(), gain * 100);
}
static WRITE8_HANDLER( sound_reset_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* if no change, do nothing */
if ((data & 1) == state->sound_reset_state)
@@ -704,11 +704,11 @@ static WRITE8_HANDLER( sound_reset_w )
return;
/* a large number of signals are reset when this happens */
- atarigen_sound_io_reset(space->machine->device("soundcpu"));
- devtag_reset(space->machine, "ymsnd");
+ atarigen_sound_io_reset(space->machine().device("soundcpu"));
+ devtag_reset(space->machine(), "ymsnd");
if (state->has_tms5220)
{
- devtag_reset(space->machine, "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
+ devtag_reset(space->machine(), "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
}
mixer_w(space, 0, 0);
}
@@ -716,11 +716,11 @@ static WRITE8_HANDLER( sound_reset_w )
static READ16_HANDLER( sound_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clear the p2portwr state on a p1portrd */
state->p2portwr_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
return atarigen_sound_r(space,offset,0xffff);
@@ -729,11 +729,11 @@ static READ16_HANDLER( sound_r )
static WRITE8_HANDLER( sound_6502_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clock the state through */
state->p2portwr_state = (state->interrupt_enable & 2) != 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
atarigen_6502_sound_w(space, offset, data);
@@ -742,11 +742,11 @@ static WRITE8_HANDLER( sound_6502_w )
static READ8_HANDLER( sound_6502_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clock the state through */
state->p2portrd_state = (state->interrupt_enable & 1) != 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
return atarigen_6502_sound_r(space, offset);
@@ -762,19 +762,19 @@ static READ8_HANDLER( sound_6502_r )
static WRITE8_HANDLER( tms5220_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
- tms5220_data_w(space->machine->device("tms"), 0, data);
+ tms5220_data_w(space->machine().device("tms"), 0, data);
}
}
static WRITE8_HANDLER( tms5220_strobe_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
- tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1));
+ tms5220_wsq_w(space->machine().device("tms"), 1-(offset & 1));
}
}
@@ -786,8 +786,8 @@ static WRITE8_HANDLER( tms5220_strobe_w )
static WRITE8_HANDLER( coincount_w )
{
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
- coin_counter_w(space->machine, 1, (data >> 1) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 1) & 1);
}
@@ -3195,8 +3195,8 @@ ROM_END
static DRIVER_INIT( paperboy )
{
int i;
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 105);
@@ -3210,7 +3210,7 @@ static DRIVER_INIT( paperboy )
state->pedal_count = 0;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
@@ -3219,20 +3219,20 @@ static DRIVER_INIT( 720 )
/* without the default EEPROM, 720 hangs at startup due to communication
issues with the sound CPU; temporarily increasing the sound CPU frequency
to ~2.2MHz "fixes" the problem */
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
slapstic_init(machine, 107);
state->pedal_count = -1;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
static DRIVER_INIT( ssprint )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
int i;
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 108);
@@ -3248,8 +3248,8 @@ static DRIVER_INIT( ssprint )
static DRIVER_INIT( csprint )
{
int i;
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 109);
@@ -3264,13 +3264,13 @@ static DRIVER_INIT( csprint )
static DRIVER_INIT( apb )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
slapstic_init(machine, 110);
state->pedal_count = 2;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 274330bb287..115ed20c090 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -125,7 +125,7 @@ static MACHINE_RESET( airrace );
static VIDEO_START( atarisy4 )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
state->poly = poly_alloc(machine, 1024, sizeof(poly_extra_data), POLYFLAG_NO_WORK_QUEUE);
}
@@ -136,7 +136,7 @@ static VIDEO_RESET( atarisy4 )
static SCREEN_UPDATE( atarisy4 )
{
- atarisy4_state *state = screen->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = screen->machine().driver_data<atarisy4_state>();
int y;
UINT32 offset = 0;
@@ -161,8 +161,8 @@ static SCREEN_UPDATE( atarisy4 )
{
UINT16 data = *src++;
- *dest++ = screen->machine->pens[data & 0xff];
- *dest++ = screen->machine->pens[data >> 8];
+ *dest++ = screen->machine().pens[data & 0xff];
+ *dest++ = screen->machine().pens[data >> 8];
}
}
return 0;
@@ -304,9 +304,9 @@ static void draw_polygon(atarisy4_state *state, UINT16 color)
PFVR 0x2B Polygon vector relative
PFC 0x2C Polygon close
*/
-void execute_gpu_command(running_machine *machine)
+void execute_gpu_command(running_machine &machine)
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
switch (gpu.ecr)
{
case 0x04:
@@ -457,7 +457,7 @@ static WRITE16_HANDLER( gpu_w )
case 0x17:
{
gpu.ecr = data;
- execute_gpu_command(space->machine);
+ execute_gpu_command(space->machine());
break;
}
case 0x1a: gpu.far = data; break;
@@ -466,7 +466,7 @@ static WRITE16_HANDLER( gpu_w )
gpu.mcr = data;
if (~data & 0x08)
- cputag_set_input_line(space->machine, "maincpu", 6, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 6, CLEAR_LINE);
break;
}
@@ -501,7 +501,7 @@ static READ16_HANDLER( gpu_r )
static INTERRUPT_GEN( vblank_int )
{
if (gpu.mcr & 0x08)
- cputag_set_input_line(device->machine, "maincpu", 6, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, ASSERT_LINE);
}
@@ -513,7 +513,7 @@ static INTERRUPT_GEN( vblank_int )
static READ16_HANDLER( m68k_shared_0_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[0], 3))
return (state->shared_ram[0][offset]);
else
@@ -522,14 +522,14 @@ static READ16_HANDLER( m68k_shared_0_r )
static WRITE16_HANDLER( m68k_shared_0_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[0], 3))
COMBINE_DATA(&state->shared_ram[0][offset]);
}
static READ16_HANDLER( m68k_shared_1_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[1], 3))
return (state->shared_ram[1][offset]);
else
@@ -538,35 +538,35 @@ static READ16_HANDLER( m68k_shared_1_r )
static WRITE16_HANDLER( m68k_shared_1_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[1], 3))
COMBINE_DATA(&state->shared_ram[1][offset]);
}
static READ16_HANDLER( dsp0_status_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return state->csr[0];
}
static WRITE16_HANDLER( dsp0_control_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
- cputag_set_input_line(space->machine, "dsp0", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp0", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
+ cputag_set_input_line(space->machine(), "dsp0", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp0", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
state->csr[0] = data;
}
static READ16_HANDLER( dsp0_bio_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return BIT(state->csr[0], 2);
}
static WRITE16_HANDLER( dsp0_bank_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (data & 0x4000)
{
/* Set TIDONE bit */
@@ -577,34 +577,34 @@ static WRITE16_HANDLER( dsp0_bank_w )
}
data &= 0x3800;
- memory_set_bankptr(space->machine, "dsp0_bank1", &state->shared_ram[0][data]);
+ memory_set_bankptr(space->machine(), "dsp0_bank1", &state->shared_ram[0][data]);
state->dsp_bank[0] = data;
}
static READ16_HANDLER( dsp1_status_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return state->csr[1];
}
static WRITE16_HANDLER( dsp1_control_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp1", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp1", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
state->csr[1] = data;
}
static READ16_HANDLER( dsp1_bio_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return BIT(state->csr[1], 2);
}
static WRITE16_HANDLER( dsp1_bank_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (data & 0x4000)
{
/* Set TIDONE bit */
@@ -615,7 +615,7 @@ static WRITE16_HANDLER( dsp1_bank_w )
}
data &= 0x3800;
- memory_set_bankptr(space->machine, "dsp1_bank1", &state->shared_ram[1][data]);
+ memory_set_bankptr(space->machine(), "dsp1_bank1", &state->shared_ram[1][data]);
state->dsp_bank[1] = data;
}
@@ -685,7 +685,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( analog_r )
{
- return (input_port_read(space->machine, "STICKX") << 8) | input_port_read(space->machine, "STICKY");
+ return (input_port_read(space->machine(), "STICKX") << 8) | input_port_read(space->machine(), "STICKY");
}
static INPUT_PORTS_START( atarisy4 )
@@ -961,41 +961,41 @@ next_line:
static DRIVER_INIT( laststar )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
- address_space *main = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
+ address_space *main = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Allocate 16kB of shared RAM */
state->shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */
- load_hexfile(main, machine->region("code")->base());
- load_hexfile(main, machine->region("data")->base());
+ load_hexfile(main, machine.region("code")->base());
+ load_hexfile(main, machine.region("data")->base());
/* Set up the DSP */
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
- load_ldafile(machine->device("dsp0")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
}
static DRIVER_INIT( airrace )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
/* Allocate two sets of 32kB shared RAM */
state->shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x4000);
state->shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
- load_hexfile(machine->device("maincpu")->memory().space(AS_PROGRAM), machine->region("code")->base());
+ load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.region("code")->base());
/* Set up the first DSP */
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
- load_ldafile(machine->device("dsp0")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
/* Set up the second DSP */
memory_set_bankptr(machine, "dsp1_bank0", state->shared_ram[1]);
memory_set_bankptr(machine, "dsp1_bank1", &state->shared_ram[1][0x800]);
- load_ldafile(machine->device("dsp1")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp1")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
}
static MACHINE_RESET( atarisy4 )
diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c
index f2cff6bb05a..2eda507727b 100644
--- a/src/mame/drivers/ataxx.c
+++ b/src/mame/drivers/ataxx.c
@@ -711,7 +711,7 @@ static DRIVER_INIT( ataxx )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
}
@@ -721,7 +721,7 @@ static DRIVER_INIT( ataxxj )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
}
@@ -731,9 +731,9 @@ static DRIVER_INIT( wsf )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1_P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P3_P4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "BUTTONS");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1_P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P3_P4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "BUTTONS");
}
@@ -743,14 +743,14 @@ static DRIVER_INIT( indyheat )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x02, FUNC(indyheat_wheel_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x08, 0x0b, FUNC(indyheat_analog_r));
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x02, FUNC(indyheat_wheel_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x08, 0x0b, FUNC(indyheat_analog_r));
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
/* set up additional output ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_write_handler(0x08, 0x0b, FUNC(indyheat_analog_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_write_handler(0x08, 0x0b, FUNC(indyheat_analog_w));
}
@@ -760,9 +760,9 @@ static DRIVER_INIT( brutforc )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
}
@@ -772,12 +772,12 @@ static DRIVER_INIT( asylum )
leland_rotate_memory(machine, "slave");
/* asylum appears to have some extra RAM for the slave CPU */
- machine->device("slave")->memory().space(AS_PROGRAM)->install_ram(0xf000, 0xfffb);
+ machine.device("slave")->memory().space(AS_PROGRAM)->install_ram(0xf000, 0xfffb);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
}
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index 926142d8efd..971fa59d42d 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -68,7 +68,7 @@
static TIMER_CALLBACK( interrupt_gen )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
int scanline = param;
/* assert/deassert the interrupt */
@@ -78,13 +78,13 @@ static TIMER_CALLBACK( interrupt_gen )
scanline += 32;
if (scanline >= 256)
scanline -= 256;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -95,9 +95,9 @@ static WRITE8_HANDLER( irq_ack_w )
*
*************************************/
-static void reset_bank(running_machine *machine)
+static void reset_bank(running_machine &machine)
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
memcpy(state->slapstic_base, &state->slapstic_source[state->current_bank * 0x4000], 0x4000);
}
@@ -111,21 +111,21 @@ static STATE_POSTLOAD( atetris_postload )
static MACHINE_START( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
/* Allocate interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_gen));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_gen));
/* Set up save state */
state->save_item(NAME(state->current_bank));
state->save_item(NAME(state->nvram_write_enable));
- machine->state().register_postload(atetris_postload, NULL);
+ machine.state().register_postload(atetris_postload, NULL);
}
static MACHINE_RESET( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
/* reset the slapstic */
slapstic_reset();
@@ -133,7 +133,7 @@ static MACHINE_RESET( atetris )
reset_bank(machine);
/* start interrupts going (32V clocked by 16V) */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(48), 48);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(48), 48);
}
@@ -146,7 +146,7 @@ static MACHINE_RESET( atetris )
static READ8_HANDLER( atetris_slapstic_r )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
int result = state->slapstic_base[0x2000 + offset];
int new_bank = slapstic_tweak(space, offset) & 1;
@@ -169,8 +169,8 @@ static READ8_HANDLER( atetris_slapstic_r )
static WRITE8_HANDLER( coincount_w )
{
- coin_counter_w(space->machine, 0, (data >> 5) & 1);
- coin_counter_w(space->machine, 1, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 4) & 1);
}
@@ -183,7 +183,7 @@ static WRITE8_HANDLER( coincount_w )
static WRITE8_HANDLER( nvram_w )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
if (state->nvram_write_enable)
state->m_nvram[offset] = data;
@@ -193,7 +193,7 @@ static WRITE8_HANDLER( nvram_w )
static WRITE8_HANDLER( nvram_enable_w )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
state->nvram_write_enable = 1;
}
@@ -496,8 +496,8 @@ ROM_END
static DRIVER_INIT( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
- UINT8 *rgn = machine->region("maincpu")->base();
+ atetris_state *state = machine.driver_data<atetris_state>();
+ UINT8 *rgn = machine.region("maincpu")->base();
slapstic_init(machine, 101);
state->slapstic_source = &rgn[0x10000];
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index d07a991fbfb..90712d1d183 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -99,8 +99,8 @@ static READ8_HANDLER(attckufo_io_r)
{
switch(offset)
{
- case 0: return input_port_read(space->machine, "DSW");
- case 2: return input_port_read(space->machine, "INPUT");
+ case 0: return input_port_read(space->machine(), "DSW");
+ case 2: return input_port_read(space->machine(), "INPUT");
}
return 0xff;
}
@@ -156,26 +156,26 @@ INPUT_PORTS_END
static INTERRUPT_GEN( attckufo_raster_interrupt )
{
- attckufo_state *state = device->machine->driver_data<attckufo_state>();
+ attckufo_state *state = device->machine().driver_data<attckufo_state>();
mos6560_raster_interrupt_gen(state->mos6560);
}
static SCREEN_UPDATE( attckufo )
{
- attckufo_state *state = screen->machine->driver_data<attckufo_state>();
+ attckufo_state *state = screen->machine().driver_data<attckufo_state>();
mos6560_video_update(state->mos6560, bitmap, cliprect);
return 0;
}
-static int attckufo_dma_read( running_machine *machine, int offset )
+static int attckufo_dma_read( running_machine &machine, int offset )
{
- attckufo_state *state = machine->driver_data<attckufo_state>();
+ attckufo_state *state = machine.driver_data<attckufo_state>();
return state->maincpu->space(AS_PROGRAM)->read_byte(offset);
}
-static int attckufo_dma_read_color( running_machine *machine, int offset )
+static int attckufo_dma_read_color( running_machine &machine, int offset )
{
- attckufo_state *state = machine->driver_data<attckufo_state>();
+ attckufo_state *state = machine.driver_data<attckufo_state>();
return state->maincpu->space(AS_PROGRAM)->read_byte(offset + 0x400);
}
diff --git a/src/mame/drivers/avalnche.c b/src/mame/drivers/avalnche.c
index 2c8b087afe7..4c8f335962d 100644
--- a/src/mame/drivers/avalnche.c
+++ b/src/mame/drivers/avalnche.c
@@ -47,7 +47,7 @@
static SCREEN_UPDATE( avalnche )
{
- avalnche_state *state = screen->machine->driver_data<avalnche_state>();
+ avalnche_state *state = screen->machine().driver_data<avalnche_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -86,29 +86,29 @@ static SCREEN_UPDATE( avalnche )
static WRITE8_HANDLER( avalance_video_invert_w )
{
- avalnche_state *state = space->machine->driver_data<avalnche_state>();
+ avalnche_state *state = space->machine().driver_data<avalnche_state>();
state->avalance_video_inverted = data & 0x01;
}
static WRITE8_HANDLER( catch_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE8_HANDLER( avalance_credit_1_lamp_w )
{
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( avalance_credit_2_lamp_w )
{
- set_led_status(space->machine, 1, data & 1);
+ set_led_status(space->machine(), 1, data & 1);
}
static WRITE8_HANDLER( avalance_start_lamp_w )
{
- set_led_status(space->machine, 2, data & 1);
+ set_led_status(space->machine(), 2, data & 1);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -241,14 +241,14 @@ static INTERRUPT_GEN( avalnche_interrupt )
static MACHINE_START( avalnche )
{
- avalnche_state *state = machine->driver_data<avalnche_state>();
+ avalnche_state *state = machine.driver_data<avalnche_state>();
state->save_item(NAME(state->avalance_video_inverted));
}
static MACHINE_RESET( avalnche )
{
- avalnche_state *state = machine->driver_data<avalnche_state>();
+ avalnche_state *state = machine.driver_data<avalnche_state>();
state->avalance_video_inverted = 0;
}
diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c
index ad8b77ed4b3..2e492e3f2a4 100644
--- a/src/mame/drivers/avt.c
+++ b/src/mame/drivers/avt.c
@@ -434,7 +434,7 @@ public:
static WRITE8_HANDLER( avt_videoram_w )
{
- avt_state *state = space->machine->driver_data<avt_state>();
+ avt_state *state = space->machine().driver_data<avt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -442,7 +442,7 @@ static WRITE8_HANDLER( avt_videoram_w )
static WRITE8_HANDLER( avt_colorram_w )
{
- avt_state *state = space->machine->driver_data<avt_state>();
+ avt_state *state = space->machine().driver_data<avt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -450,7 +450,7 @@ static WRITE8_HANDLER( avt_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- avt_state *state = machine->driver_data<avt_state>();
+ avt_state *state = machine.driver_data<avt_state>();
/* - bits -
7654 3210
xxxx ---- color code.
@@ -466,14 +466,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( avt )
{
- avt_state *state = machine->driver_data<avt_state>();
+ avt_state *state = machine.driver_data<avt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 28, 32);
}
static SCREEN_UPDATE( avt )
{
- avt_state *state = screen->machine->driver_data<avt_state>();
+ avt_state *state = screen->machine().driver_data<avt_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -494,7 +494,7 @@ static PALETTE_INIT( avt )
/* 0000BGRI */
if (color_prom == 0) return;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int bit1, bit2, bit3, r, g, b, inten, intenmin, intenmax, i;
diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c
index 43d1f306433..0e231e13905 100644
--- a/src/mame/drivers/aztarac.c
+++ b/src/mame/drivers/aztarac.c
@@ -37,7 +37,7 @@ static IRQ_CALLBACK(aztarac_irq_callback)
static MACHINE_RESET( aztarac )
{
- device_set_irq_callback(machine->device("maincpu"), aztarac_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), aztarac_irq_callback);
}
@@ -50,7 +50,7 @@ static MACHINE_RESET( aztarac )
static READ16_HANDLER( nvram_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->m_nvram[offset] | 0xfff0;
}
@@ -64,8 +64,8 @@ static READ16_HANDLER( nvram_r )
static READ16_HANDLER( joystick_r )
{
- return (((input_port_read(space->machine, "STICKZ") - 0xf) << 8) |
- ((input_port_read(space->machine, "STICKY") - 0xf) & 0xff));
+ return (((input_port_read(space->machine(), "STICKZ") - 0xf) << 8) |
+ ((input_port_read(space->machine(), "STICKY") - 0xf) & 0xff));
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index bc86e0d1e7a..318cf502ae0 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -59,7 +59,7 @@ public:
/* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */
static VIDEO_START( backfire )
{
- backfire_state *state = machine->driver_data<backfire_state>();
+ backfire_state *state = machine.driver_data<backfire_state>();
state->spriteram_1 = auto_alloc_array(machine, UINT16, 0x2000/2);
state->spriteram_2 = auto_alloc_array(machine, UINT16, 0x2000/2);
@@ -84,10 +84,10 @@ static VIDEO_START( backfire )
static SCREEN_UPDATE( backfire )
{
- backfire_state *state = screen->machine->driver_data<backfire_state>();
+ backfire_state *state = screen->machine().driver_data<backfire_state>();
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(screen->machine, 1);
+ flip_screen_set_no_update(screen->machine(), 1);
/* screen 1 uses pf1 as the forground and pf3 as the background */
/* screen 2 uses pf2 as the foreground and pf4 as the background */
@@ -97,40 +97,40 @@ static SCREEN_UPDATE( backfire )
if (screen == state->lscreen)
{
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, cliprect, 0x100);
if (state->left_priority[0] == 0)
{
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 1);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_1, 0x800);
}
else if (state->left_priority[0] == 2)
{
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_1, 0x800);
}
else
popmessage( "unknown left priority %08x", state->left_priority[0]);
}
else if (screen == state->rscreen)
{
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, cliprect, 0x500);
if (state->right_priority[0] == 0)
{
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 1);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x800);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_2, 0x800);
}
else if (state->right_priority[0] == 2)
{
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x800);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_2, 0x800);
}
else
popmessage( "unknown right priority %08x", state->right_priority[0]);
@@ -143,34 +143,34 @@ static SCREEN_UPDATE( backfire )
static READ32_DEVICE_HANDLER( backfire_eeprom_r )
{
/* some kind of screen indicator? checked by backfirea set before it will boot */
- int backfire_screen = device->machine->rand() & 1;
- return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine, "IN0")
- | ((input_port_read(device->machine, "IN2") & 0xbf) << 16)
- | ((input_port_read(device->machine, "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
+ int backfire_screen = device->machine().rand() & 1;
+ return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine(), "IN0")
+ | ((input_port_read(device->machine(), "IN2") & 0xbf) << 16)
+ | ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
}
static READ32_HANDLER( backfire_control2_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
- return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN1") | (input_port_read(space->machine, "IN1") << 16);
+ return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine(), "IN1") | (input_port_read(space->machine(), "IN1") << 16);
}
#ifdef UNUSED_FUNCTION
static READ32_HANDLER(backfire_control3_r)
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
- return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN2") << 16);
+ return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine(), "IN2") | (input_port_read(space->machine(), "IN2") << 16);
}
#endif
static WRITE32_DEVICE_HANDLER(backfire_eeprom_w)
{
- logerror("%s:write eprom %08x (%08x) %08x\n",device->machine->describe_context(),offset<<1,mem_mask,data);
+ logerror("%s:write eprom %08x (%08x) %08x\n",device->machine().describe_context(),offset<<1,mem_mask,data);
if (ACCESSING_BITS_0_7)
{
eeprom_set_clock_line(device, BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
@@ -182,49 +182,49 @@ static WRITE32_DEVICE_HANDLER(backfire_eeprom_w)
static WRITE32_HANDLER(backfire_nonbuffered_palette_w)
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
/* map 32-bit writes to 16-bit */
-static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
-static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
+static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
+static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
#ifdef UNUSED_FUNCTION
READ32_HANDLER( backfire_unknown_wheel_r )
{
- return input_port_read(space->machine, "PADDLE0");
+ return input_port_read(space->machine(), "PADDLE0");
}
READ32_HANDLER( backfire_wheel1_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
READ32_HANDLER( backfire_wheel2_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
static READ32_HANDLER( backfire_spriteram1_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
return state->spriteram_1[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( backfire_spriteram1_w )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -233,13 +233,13 @@ static WRITE32_HANDLER( backfire_spriteram1_w )
static READ32_HANDLER( backfire_spriteram2_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
return state->spriteram_2[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( backfire_spriteram2_w )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -440,14 +440,14 @@ static const deco16ic_interface backfire_deco16ic_tilegen2_intf =
static MACHINE_START( backfire )
{
- backfire_state *state = machine->driver_data<backfire_state>();
-
- state->maincpu = machine->device("maincpu");
- state->deco_tilegen1 = machine->device("tilegen1");
- state->deco_tilegen2 = machine->device("tilegen2");
- state->lscreen = machine->device("lscreen");
- state->rscreen = machine->device("rscreen");
- state->eeprom = machine->device("eeprom");
+ backfire_state *state = machine.driver_data<backfire_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
+ state->deco_tilegen2 = machine.device("tilegen2");
+ state->lscreen = machine.device("lscreen");
+ state->rscreen = machine.device("rscreen");
+ state->eeprom = machine.device("eeprom");
}
UINT16 backfire_pri_callback(UINT16 x)
@@ -639,9 +639,9 @@ ROM_START( backfirea )
ROM_LOAD( "mbz-06.19l", 0x200000, 0x080000, CRC(4a38c635) SHA1(7f0fb6a7a4aa6774c04fa38e53ceff8744fe1e9f) )
ROM_END
-static void descramble_sound( running_machine *machine )
+static void descramble_sound( running_machine &machine )
{
- UINT8 *rom = machine->region("ymz")->base();
+ UINT8 *rom = machine.region("ymz")->base();
int length = 0x200000; // only the first rom is swapped on backfire!
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
@@ -667,7 +667,7 @@ static void descramble_sound( running_machine *machine )
static READ32_HANDLER( backfire_speedup_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
//mame_printf_debug( "%08x\n",cpu_get_pc(space->cpu));
@@ -683,9 +683,9 @@ static DRIVER_INIT( backfire )
deco56_decrypt_gfx(machine, "gfx1"); /* 141 */
deco56_decrypt_gfx(machine, "gfx2"); /* 141 */
deco156_decrypt(machine);
- machine->device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */
+ machine.device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */
descramble_sound(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0170018, 0x017001b, FUNC(backfire_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0170018, 0x017001b, FUNC(backfire_speedup_r) );
}
GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index fce8e50410c..01052bb1fda 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -176,9 +176,9 @@ Measurements -
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -186,19 +186,19 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
atarigen_6502_irq_ack_r(space, 0);
- else if (!(input_port_read(screen.machine, "FE4000") & 0x40))
- atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
+ else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
+ atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
static MACHINE_START( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
atarigen_init(machine);
@@ -208,15 +208,15 @@ static MACHINE_START( badlands )
static MACHINE_RESET( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_sound_io_reset(machine.device("audiocpu"));
memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
@@ -230,8 +230,8 @@ static MACHINE_RESET( badlands )
static INTERRUPT_GEN( vblank_int )
{
- badlands_state *state = device->machine->driver_data<badlands_state>();
- int pedal_state = input_port_read(device->machine, "PEDALS");
+ badlands_state *state = device->machine().driver_data<badlands_state>();
+ int pedal_state = input_port_read(device->machine(), "PEDALS");
int i;
/* update the pedals once per frame */
@@ -255,7 +255,7 @@ static INTERRUPT_GEN( vblank_int )
static READ16_HANDLER( sound_busy_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
int temp = 0xfeff;
if (state->cpu_to_sound_ready) temp ^= 0x0100;
return temp;
@@ -264,14 +264,14 @@ static READ16_HANDLER( sound_busy_r )
static READ16_HANDLER( pedal_0_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
return state->pedal_value[0];
}
static READ16_HANDLER( pedal_1_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
return state->pedal_value[1];
}
@@ -285,7 +285,7 @@ static READ16_HANDLER( pedal_1_r )
static READ8_HANDLER( audio_io_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -309,8 +309,8 @@ static READ8_HANDLER( audio_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "AUDIO");
- if (!(input_port_read(space->machine, "FE4000") & 0x0080)) result ^= 0x90;
+ result = input_port_read(space->machine(), "AUDIO");
+ if (!(input_port_read(space->machine(), "FE4000") & 0x0080)) result ^= 0x90;
if (state->cpu_to_sound_ready) result ^= 0x40;
if (state->sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10;
@@ -334,7 +334,7 @@ static READ8_HANDLER( audio_io_r )
static WRITE8_HANDLER( audio_io_w )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
switch (offset & 0x206)
{
@@ -588,11 +588,11 @@ ROM_END
static DRIVER_INIT( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the audio system */
- state->bank_base = &machine->region("audiocpu")->base()[0x03000];
- state->bank_source_data = &machine->region("audiocpu")->base()[0x10000];
+ state->bank_base = &machine.region("audiocpu")->base()[0x03000];
+ state->bank_source_data = &machine.region("audiocpu")->base()[0x10000];
}
@@ -681,9 +681,9 @@ static GFXDECODE_START( badlandsb )
GFXDECODE_ENTRY( "gfx2", 0, molayout, 128, 8 )
GFXDECODE_END
-static void update_interrupts_bootleg(running_machine *machine)
+static void update_interrupts_bootleg(running_machine &machine)
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -692,23 +692,23 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
{
/* sound IRQ is on 32V */
// if (scanline & 32)
-// atarigen_6502_irq_ack_r(screen->machine, 0);
+// atarigen_6502_irq_ack_r(screen->machine(), 0);
// else if (!(input_port_read(machine, "FE4000") & 0x40))
-// atarigen_6502_irq_gen(screen->machine->device("audiocpu"));
+// atarigen_6502_irq_gen(screen->machine().device("audiocpu"));
}
static MACHINE_RESET( badlandsb )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
// state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts_bootleg);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update_bootleg, 32);
-// atarigen_sound_io_reset(machine->device("audiocpu"));
+// atarigen_sound_io_reset(machine.device("audiocpu"));
// memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index 8037504551b..9b57f01d39a 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -69,8 +69,8 @@ DIP locations verified for:
static WRITE8_DEVICE_HANDLER( bagman_ls259_w )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ bagman_state *state = device->machine().driver_data<bagman_state>();
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
bagman_pal16r6_w(space, offset,data); /*this is just a simulation*/
if (state->ls259_buf[offset] != (data&1) )
@@ -99,7 +99,7 @@ static WRITE8_DEVICE_HANDLER( bagman_ls259_w )
static WRITE8_HANDLER( bagman_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
static WRITE8_DEVICE_HANDLER( bagman_interrupt_w )
@@ -378,10 +378,10 @@ static const ay8910_interface ay8910_config =
I don't know if the following is correct, there can possbily be multiple solutions for the same problem. */
static READ8_DEVICE_HANDLER( dial_input_p1_r )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
+ bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine, "DIAL_P1");
+ dial_val = input_port_read(device->machine(), "DIAL_P1");
if(state->p1_res != 0x60)
state->p1_res = 0x60;
@@ -394,15 +394,15 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
state->p1_old_val = dial_val;
- return (input_port_read(device->machine, "P1") & 0x9f) | (state->p1_res);
+ return (input_port_read(device->machine(), "P1") & 0x9f) | (state->p1_res);
}
static READ8_DEVICE_HANDLER( dial_input_p2_r )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
+ bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine, "DIAL_P2");
+ dial_val = input_port_read(device->machine(), "DIAL_P2");
if(state->p2_res != 0x60)
state->p2_res = 0x60;
@@ -415,7 +415,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
state->p2_old_val = dial_val;
- return (input_port_read(device->machine, "P2") & 0x9f) | (state->p2_res);
+ return (input_port_read(device->machine(), "P2") & 0x9f) | (state->p2_res);
}
static const ay8910_interface ay8910_dial_config =
@@ -930,11 +930,11 @@ ROM_END
static DRIVER_INIT( bagman )
{
- bagman_state *state = machine->driver_data<bagman_state>();
+ bagman_state *state = machine.driver_data<bagman_state>();
/* Unmap video enable register, not available on earlier hardware revision(s)
Bagman is supposed to have glitches during screen transitions */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xa003, 0xa003);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xa003, 0xa003);
*state->video_enable = 1;
}
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index 0d120ed7826..493a4599e48 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -2038,7 +2038,7 @@ ROM_END
#define EXPAND_NONE 0x3f
#define SWAP_HALVES 0x80
-static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
+static void expand_roms(running_machine &machine, UINT8 cd_rom_mask)
{
/* load AB bank data from 0x10000-0x20000 */
/* load CD bank data from 0x20000-0x2e000 */
@@ -2047,8 +2047,8 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
UINT8 *temp = auto_alloc_array(machine, UINT8, 0x20000);
{
- UINT8 *rom = machine->region("maincpu")->base();
- UINT32 len = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT32 len = machine.region("maincpu")->bytes();
UINT32 base;
for (base = 0x10000; base < len; base += 0x30000)
@@ -2104,9 +2104,9 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
}
}
-INLINE void config_shooter_adc(running_machine *machine, UINT8 shooter, UINT8 adc_shift)
+INLINE void config_shooter_adc(running_machine &machine, UINT8 shooter, UINT8 adc_shift)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
state->shooter = shooter;
state->adc_shift = adc_shift;
}
@@ -2122,7 +2122,7 @@ static DRIVER_INIT( stocker ) { expand_roms(machine, EXPAND_ALL); config_shoot
static DRIVER_INIT( triviag1 ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( triviag2 )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memcpy(&rom[0x20000], &rom[0x28000], 0x4000);
memcpy(&rom[0x24000], &rom[0x28000], 0x4000);
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */);
@@ -2134,48 +2134,48 @@ static DRIVER_INIT( minigolf2 ) { expand_roms(machine, 0x0c); config_shoo
static DRIVER_INIT( toggle ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( nametune )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine, FALSE, 0 /* noanalog */);
}
static DRIVER_INIT( nstocker )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine, TRUE, 1);
}
static DRIVER_INIT( sfootbal )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine, FALSE, 0);
}
static DRIVER_INIT( spiker )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_readwrite_handler(0x9f80, 0x9f8f, FUNC(spiker_expand_r), FUNC(spiker_expand_w));
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine, FALSE, 1);
}
static DRIVER_INIT( stompin )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, 0x0c | SWAP_HALVES); config_shooter_adc(machine, FALSE, 32);
}
static DRIVER_INIT( rescraid ) { expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( grudge )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_read_handler(0x9400, 0x9400, FUNC(grudge_steering_r));
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0);
}
static DRIVER_INIT( shrike )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_readwrite_handler(0x9e00, 0x9fff, FUNC(shrike_shared_6809_r), FUNC(shrike_shared_6809_w));
space->install_legacy_write_handler(0x9e01, 0x9e01, FUNC(shrike_sprite_select_w) );
- machine->device("68k")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x10000, 0x1001f, FUNC(shrike_io_68k_r), FUNC(shrike_io_68k_w));
+ machine.device("68k")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x10000, 0x1001f, FUNC(shrike_io_68k_r), FUNC(shrike_io_68k_w));
expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 32);
}
diff --git a/src/mame/drivers/bankp.c b/src/mame/drivers/bankp.c
index ef3763f07cc..77a9af2dca4 100644
--- a/src/mame/drivers/bankp.c
+++ b/src/mame/drivers/bankp.c
@@ -261,7 +261,7 @@ GFXDECODE_END
static MACHINE_RESET( bankp )
{
- bankp_state *state = machine->driver_data<bankp_state>();
+ bankp_state *state = machine.driver_data<bankp_state>();
state->scroll_x = 0;
state->priority = 0;
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 081da1797ae..90161364850 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -113,36 +113,36 @@ DIP locations verified for:
static WRITE8_HANDLER( inputport_select_w )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
if ((data & 0xe0) == 0x60)
state->inputport_selected = data & 0x07;
else if ((data & 0xe0) == 0xc0)
{
- coin_lockout_global_w(space->machine, ~data & 1);
- coin_counter_w(space->machine, 0,data & 2);
- coin_counter_w(space->machine, 1,data & 4);
+ coin_lockout_global_w(space->machine(), ~data & 1);
+ coin_counter_w(space->machine(), 0,data & 2);
+ coin_counter_w(space->machine(), 1,data & 4);
}
}
static READ8_HANDLER( inputport_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
switch (state->inputport_selected)
{
case 0x00: /* DSW A (bits 0-4) */
- return (input_port_read(space->machine, "DSWA") & 0xf8) >> 3;
+ return (input_port_read(space->machine(), "DSWA") & 0xf8) >> 3;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
- return ((input_port_read(space->machine, "DSWA") & 0x07) << 2) | ((input_port_read(space->machine, "DSWB") & 0xc0) >> 6);
+ return ((input_port_read(space->machine(), "DSWA") & 0x07) << 2) | ((input_port_read(space->machine(), "DSWB") & 0xc0) >> 6);
case 0x02: /* DSW B (bits 2-6) */
- return (input_port_read(space->machine, "DSWB") & 0x3e) >> 1;
+ return (input_port_read(space->machine(), "DSWB") & 0x3e) >> 1;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(space->machine, "DSWB") & 0x01) << 4) | (input_port_read(space->machine, "EDGE") & 0x0f);
+ return ((input_port_read(space->machine(), "DSWB") & 0x01) << 4) | (input_port_read(space->machine(), "EDGE") & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x05: /* 2P controls */
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x06: /* 1P controls */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
default:
return 0xff;
}
@@ -150,13 +150,13 @@ static READ8_HANDLER( inputport_r )
static WRITE8_HANDLER( baraduke_lamps_w )
{
- set_led_status(space->machine, 0,data & 0x08);
- set_led_status(space->machine, 1,data & 0x10);
+ set_led_status(space->machine(), 0,data & 0x08);
+ set_led_status(space->machine(), 1,data & 0x10);
}
static WRITE8_HANDLER( baraduke_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -175,7 +175,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( soundkludge_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
return ((state->counter++) >> 4) & 0xff;
}
@@ -539,7 +539,7 @@ static DRIVER_INIT( baraduke )
int i;
/* unpack the third tile ROM */
- rom = machine->region("gfx2")->base() + 0x8000;
+ rom = machine.region("gfx2")->base() + 0x8000;
for (i = 0x2000;i < 0x4000;i++)
{
rom[i + 0x2000] = rom[i];
diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c
index 1016a1e93f2..764b816d15c 100644
--- a/src/mame/drivers/batman.c
+++ b/src/mame/drivers/batman.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -40,7 +40,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( batman )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
atarigen_init(machine);
state->save_item(NAME(state->latch_data));
@@ -50,12 +50,12 @@ static MACHINE_START( batman )
static MACHINE_RESET( batman )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 2);
- atarigen_scanline_timer_reset(*machine->primary_screen, batman_scanline_update, 8);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 2);
+ atarigen_scanline_timer_reset(*machine.primary_screen, batman_scanline_update, 8);
atarijsa_reset();
}
@@ -69,13 +69,13 @@ static MACHINE_RESET( batman )
static READ16_HANDLER( batman_atarivc_r )
{
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( batman_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
@@ -88,8 +88,8 @@ static WRITE16_HANDLER( batman_atarivc_w )
static READ16_HANDLER( special_port2_r )
{
- batman_state *state = space->machine->driver_data<batman_state>();
- int result = input_port_read(space->machine, "260010");
+ batman_state *state = space->machine().driver_data<batman_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->sound_to_cpu_ready) result ^= 0x0010;
if (state->cpu_to_sound_ready) result ^= 0x0020;
return result;
@@ -98,20 +98,20 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( latch_w )
{
- batman_state *state = space->machine->driver_data<batman_state>();
+ batman_state *state = space->machine().driver_data<batman_state>();
int oldword = state->latch_data;
COMBINE_DATA(&state->latch_data);
/* bit 4 is connected to the /RESET pin on the 6502 */
if (state->latch_data & 0x0010)
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, ASSERT_LINE);
/* alpha bank is selected by the upper 4 bits */
if ((oldword ^ state->latch_data) & 0x7000)
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
tilemap_mark_all_tiles_dirty(state->alpha_tilemap);
state->alpha_tile_bank = (state->latch_data >> 12) & 7;
}
diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c
index 01d5a783753..94a1b790380 100644
--- a/src/mame/drivers/battlane.c
+++ b/src/mame/drivers/battlane.c
@@ -22,7 +22,7 @@
static WRITE8_HANDLER( battlane_cpu_command_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
state->cpu_control = data;
@@ -36,7 +36,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
0x01 = Y Scroll MSB
*/
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
/*
I think that the NMI is an inhibitor. It is constantly set
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
static INTERRUPT_GEN( battlane_cpu1_interrupt )
{
- battlane_state *state = device->machine->driver_data<battlane_state>();
+ battlane_state *state = device->machine().driver_data<battlane_state>();
/* See note in battlane_cpu_command_w */
if (~state->cpu_control & 0x08)
@@ -258,7 +258,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- battlane_state *state = device->machine->driver_data<battlane_state>();
+ battlane_state *state = device->machine().driver_data<battlane_state>();
device_set_input_line(state->maincpu, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -276,10 +276,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( battlane )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->video_ctrl));
state->save_item(NAME(state->cpu_control));
@@ -287,7 +287,7 @@ static MACHINE_START( battlane )
static MACHINE_RESET( battlane )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
state->video_ctrl = 0;
state->cpu_control = 0;
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index f8f80199025..6856bfba569 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -36,7 +36,7 @@ static WRITE8_HANDLER( battlera_sound_w )
if (offset == 0)
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
@@ -44,20 +44,20 @@ static WRITE8_HANDLER( battlera_sound_w )
static WRITE8_HANDLER( control_data_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
state->control_port_select=data;
}
static READ8_HANDLER( control_data_r )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
switch (state->control_port_select)
{
- case 0xfe: return input_port_read(space->machine, "IN0"); /* Player 1 */
- case 0xfd: return input_port_read(space->machine, "IN1"); /* Player 2 */
- case 0xfb: return input_port_read(space->machine, "IN2"); /* Coins */
- case 0xf7: return input_port_read(space->machine, "DSW2"); /* Dip 2 */
- case 0xef: return input_port_read(space->machine, "DSW1"); /* Dip 1 */
+ case 0xfe: return input_port_read(space->machine(), "IN0"); /* Player 1 */
+ case 0xfd: return input_port_read(space->machine(), "IN1"); /* Player 2 */
+ case 0xfb: return input_port_read(space->machine(), "IN2"); /* Coins */
+ case 0xf7: return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
+ case 0xef: return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
}
return 0xff;
@@ -87,19 +87,19 @@ ADDRESS_MAP_END
static void battlera_adpcm_int(device_t *device)
{
- battlera_state *state = device->machine->driver_data<battlera_state>();
+ battlera_state *state = device->machine().driver_data<battlera_state>();
msm5205_data_w(device,state->msm5205next >> 4);
state->msm5205next <<= 4;
state->toggle = 1 - state->toggle;
if (state->toggle)
- cputag_set_input_line(device->machine, "audiocpu", 1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 1, HOLD_LINE);
}
static WRITE8_HANDLER( battlera_adpcm_data_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
state->msm5205next = data;
}
diff --git a/src/mame/drivers/battlex.c b/src/mame/drivers/battlex.c
index 4731c08b3e8..e2e8a368bc4 100644
--- a/src/mame/drivers/battlex.c
+++ b/src/mame/drivers/battlex.c
@@ -51,18 +51,18 @@
static INTERRUPT_GEN( battlex_interrupt )
{
- battlex_state *state = device->machine->driver_data<battlex_state>();
+ battlex_state *state = device->machine().driver_data<battlex_state>();
state->in0_b4 = 1;
device_set_input_line(device, 0, ASSERT_LINE);
}
static CUSTOM_INPUT( battlex_in0_b4_r )
{
- battlex_state *state = field->port->machine->driver_data<battlex_state>();
+ battlex_state *state = field->port->machine().driver_data<battlex_state>();
UINT32 ret = state->in0_b4;
if (state->in0_b4)
{
- cputag_set_input_line(field->port->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", 0, CLEAR_LINE);
state->in0_b4 = 0;
}
@@ -229,7 +229,7 @@ static const ay8910_interface battlex_ay8910_interface =
static MACHINE_START( battlex )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
/* register for save states */
state->save_item(NAME(state->scroll_lsb));
@@ -240,7 +240,7 @@ static MACHINE_START( battlex )
static MACHINE_RESET( battlex )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
state->scroll_lsb = 0;
state->scroll_msb = 0;
@@ -318,9 +318,9 @@ ROM_END
static DRIVER_INIT( battlex )
{
- UINT8 *colormask = machine->region("user1")->base();
- UINT8 *gfxdata = machine->region("user2")->base();
- UINT8 *dest = machine->region("gfx1")->base();
+ UINT8 *colormask = machine.region("user1")->base();
+ UINT8 *gfxdata = machine.region("user2")->base();
+ UINT8 *dest = machine.region("gfx1")->base();
int tile, line, bit;
diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c
index 37ed70e1e81..c0342e10b45 100644
--- a/src/mame/drivers/battlnts.c
+++ b/src/mame/drivers/battlnts.c
@@ -27,25 +27,25 @@
static INTERRUPT_GEN( battlnts_interrupt )
{
- battlnts_state *state = device->machine->driver_data<battlnts_state>();
+ battlnts_state *state = device->machine().driver_data<battlnts_state>();
if (k007342_is_int_enabled(state->k007342))
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
{
- battlnts_state *state = space->machine->driver_data<battlnts_state>();
+ battlnts_state *state = space->machine().driver_data<battlnts_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( battlnts_bankswitch_w )
{
/* bits 6 & 7 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
/* bits 4 & 5 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
/* other bits unknown */
}
@@ -220,14 +220,14 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( battlnts )
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
- state->k007342 = machine->device("k007342");
- state->k007420 = machine->device("k007420");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007342 = machine.device("k007342");
+ state->k007420 = machine.device("k007420");
state->save_item(NAME(state->spritebank));
state->save_item(NAME(state->layer_colorbase));
@@ -235,7 +235,7 @@ static MACHINE_START( battlnts )
static MACHINE_RESET( battlnts )
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 0;
@@ -402,7 +402,7 @@ static void shuffle( UINT8 *buf, int len )
static DRIVER_INIT( rackemup )
{
/* rearrange char ROM */
- shuffle(machine->region("gfx1")->base(), machine->region("gfx1")->bytes());
+ shuffle(machine.region("gfx1")->base(), machine.region("gfx1")->bytes());
}
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index a8394091df1..e469a57c667 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -239,14 +239,14 @@ Country :
static READ16_HANDLER( sound_status_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
return state->sound_status;
}
static WRITE8_HANDLER( sound_status_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
state->sound_status = data;
}
@@ -256,24 +256,24 @@ static WRITE16_HANDLER( sound_cpu_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data&0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
/* Eprom is byte wide, top half of word _must_ be 0xff */
static READ16_HANDLER( eprom_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
return (state->eprom_data[offset]&0xff) | 0xff00;
}
static READ16_HANDLER( control_3_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
- UINT16 retdata = input_port_read(space->machine, port[state->gun_select]);
+ UINT16 retdata = input_port_read(space->machine(), port[state->gun_select]);
retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
@@ -282,7 +282,7 @@ static READ16_HANDLER( control_3_r )
static WRITE16_HANDLER( gun_select_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
logerror("%08x: gun r\n",cpu_get_pc(space->cpu));
@@ -314,8 +314,8 @@ static READ16_HANDLER( mechatt_gun_r )
{
int x, y;
- x = input_port_read(space->machine, offset ? "GUNX2" : "GUNX1");
- y = input_port_read(space->machine, offset ? "GUNY2" : "GUNY1");
+ x = input_port_read(space->machine(), offset ? "GUNX2" : "GUNX1");
+ y = input_port_read(space->machine(), offset ? "GUNY2" : "GUNY1");
/* Todo - does the hardware really clamp like this? */
x += 0x18;
@@ -644,7 +644,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int irq )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2608_interface ym2608_config =
@@ -666,7 +666,7 @@ static const ym2610_interface ym2610_config =
static SCREEN_EOF( bbuster )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
buffer_spriteram16_2_w(space,0,0,0xffff);
@@ -674,7 +674,7 @@ static SCREEN_EOF( bbuster )
static SCREEN_EOF( mechatt )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
}
diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c
index b2e6c087728..b00e80401e2 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -92,7 +92,7 @@ static const int interrupt_lines[INTERRUPTS_PER_FRAME] = { 0x00, 0x80 };
static TIMER_CALLBACK( interrupt_callback )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
int interrupt_number = param;
int next_interrupt_number;
int next_vpos;
@@ -103,22 +103,22 @@ static TIMER_CALLBACK( interrupt_callback )
next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME;
next_vpos = interrupt_lines[next_interrupt_number];
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_interrupt_number);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_interrupt_number);
}
-static void create_interrupt_timer( running_machine *machine )
+static void create_interrupt_timer( running_machine &machine )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ beaminv_state *state = machine.driver_data<beaminv_state>();
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
}
-static void start_interrupt_timer( running_machine *machine )
+static void start_interrupt_timer( running_machine &machine )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
int vpos = interrupt_lines[0];
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -131,10 +131,10 @@ static void start_interrupt_timer( running_machine *machine )
static MACHINE_START( beaminv )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
create_interrupt_timer(machine);
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
/* setup for save states */
state->save_item(NAME(state->controller_select));
@@ -150,7 +150,7 @@ static MACHINE_START( beaminv )
static MACHINE_RESET( beaminv )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
start_interrupt_timer(machine);
state->controller_select = 0;
@@ -166,7 +166,7 @@ static MACHINE_RESET( beaminv )
static SCREEN_UPDATE( beaminv )
{
- beaminv_state *state = screen->machine->driver_data<beaminv_state>();
+ beaminv_state *state = screen->machine().driver_data<beaminv_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -193,7 +193,7 @@ static SCREEN_UPDATE( beaminv )
static READ8_HANDLER( v128_r )
{
- return (space->machine->primary_screen->vpos() >> 7) & 0x01;
+ return (space->machine().primary_screen->vpos() >> 7) & 0x01;
}
@@ -210,7 +210,7 @@ static READ8_HANDLER( v128_r )
static WRITE8_HANDLER( controller_select_w )
{
- beaminv_state *state = space->machine->driver_data<beaminv_state>();
+ beaminv_state *state = space->machine().driver_data<beaminv_state>();
/* 0x01 (player 1) or 0x02 (player 2) */
state->controller_select = data;
}
@@ -218,8 +218,8 @@ static WRITE8_HANDLER( controller_select_w )
static READ8_HANDLER( controller_r )
{
- beaminv_state *state = space->machine->driver_data<beaminv_state>();
- return input_port_read(space->machine, (state->controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
+ beaminv_state *state = space->machine().driver_data<beaminv_state>();
+ return input_port_read(space->machine(), (state->controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
}
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 4a60d20e403..026c8b219d7 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -116,15 +116,15 @@
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- beathead_state *state = timer.machine->driver_data<beathead_state>();
+ beathead_state *state = timer.machine().driver_data<beathead_state>();
int scanline = param;
/* update the video */
- timer.machine->primary_screen->update_now();
+ timer.machine().primary_screen->update_now();
/* on scanline zero, clear any halt condition */
if (scanline == 0)
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
/* wrap around at 262 */
scanline++;
@@ -136,17 +136,17 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
state->update_interrupts();
/* set the timer for the next one */
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
}
void beathead_state::machine_start()
{
- atarigen_init(&m_machine);
+ atarigen_init(m_machine);
}
-static void update_interrupts(running_machine *machine) { machine->driver_data<beathead_state>()->update_interrupts(); }
+static void update_interrupts(running_machine &machine) { machine.driver_data<beathead_state>()->update_interrupts(); }
void beathead_state::machine_reset()
{
/* reset the common subsystems */
@@ -192,7 +192,7 @@ void beathead_state::update_interrupts()
{
m_irq_line_state = gen_int;
//if (m_irq_line_state != CLEAR_LINE)
- cputag_set_input_line(&m_machine, "maincpu", ASAP_IRQ0, m_irq_line_state);
+ cputag_set_input_line(m_machine, "maincpu", ASAP_IRQ0, m_irq_line_state);
//else
//asap_set_irq_line(ASAP_IRQ0, m_irq_line_state);
}
@@ -257,7 +257,7 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
READ32_MEMBER( beathead_state::input_2_r )
{
- int result = input_port_read(&m_machine, "IN2");
+ int result = input_port_read(m_machine, "IN2");
if (sound_to_cpu_ready) result ^= 0x10;
if (cpu_to_sound_ready) result ^= 0x20;
return result;
@@ -287,7 +287,7 @@ WRITE32_MEMBER( beathead_state::sound_data_w )
WRITE32_MEMBER( beathead_state::sound_reset_w )
{
logerror("Sound reset = %d\n", !offset);
- cputag_set_input_line(&m_machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(m_machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
}
@@ -300,7 +300,7 @@ WRITE32_MEMBER( beathead_state::sound_reset_w )
WRITE32_MEMBER( beathead_state::coin_count_w )
{
- coin_counter_w(&m_machine, 0, !offset);
+ coin_counter_w(m_machine, 0, !offset);
}
@@ -497,7 +497,7 @@ READ32_MEMBER( beathead_state::movie_speedup_r )
static DRIVER_INIT( beathead )
{
- beathead_state *state = machine->driver_data<beathead_state>();
+ beathead_state *state = machine.driver_data<beathead_state>();
/* initialize the common systems */
atarijsa_init(machine, "IN2", 0x0040);
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index 41ca0e44afe..79a4908978d 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -72,7 +72,7 @@ static const UINT8 nmi_trigger_v256s [NMIS_PER_FRAME] = { 0x00, 0x00, 0x00, 0x00
static READ8_HANDLER( led_on_r )
{
- set_led_status(space->machine, 0, 1);
+ set_led_status(space->machine(), 0, 1);
return 0;
}
@@ -80,13 +80,13 @@ static READ8_HANDLER( led_on_r )
static WRITE8_HANDLER( led_on_w )
{
- set_led_status(space->machine, 0, 1);
+ set_led_status(space->machine(), 0, 1);
}
static READ8_HANDLER( led_off_r )
{
- set_led_status(space->machine, 0, 0);
+ set_led_status(space->machine(), 0, 0);
return 0;
}
@@ -94,7 +94,7 @@ static READ8_HANDLER( led_off_r )
static WRITE8_HANDLER( led_off_w )
{
- set_led_status(space->machine, 0, 0);
+ set_led_status(space->machine(), 0, 0);
}
@@ -155,14 +155,14 @@ static int vsync_chain_counter_to_vpos(UINT8 counter, UINT8 v256)
static WRITE8_HANDLER( irq_enable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->irq_enabled = data & 0x01;
}
static TIMER_CALLBACK( irq_callback )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int irq_number = param;
UINT8 next_counter;
UINT8 next_v256;
@@ -179,22 +179,22 @@ static TIMER_CALLBACK( irq_callback )
next_v256 = irq_trigger_v256s[next_irq_number];
next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256);
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_irq_number);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_irq_number);
}
-static void create_irq_timer(running_machine *machine)
+static void create_irq_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_callback));
+ berzerk_state *state = machine.driver_data<berzerk_state>();
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_callback));
}
-static void start_irq_timer(running_machine *machine)
+static void start_irq_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int vpos = vsync_chain_counter_to_vpos(irq_trigger_counts[0], irq_trigger_v256s[0]);
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -214,21 +214,21 @@ static void start_irq_timer(running_machine *machine)
static WRITE8_HANDLER( nmi_enable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 1;
}
static WRITE8_HANDLER( nmi_disable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 0;
}
static READ8_HANDLER( nmi_enable_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 1;
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( nmi_enable_r )
static READ8_HANDLER( nmi_disable_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 0;
return 0;
@@ -246,7 +246,7 @@ static READ8_HANDLER( nmi_disable_r )
static TIMER_CALLBACK( nmi_callback )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int nmi_number = param;
UINT8 next_counter;
UINT8 next_v256;
@@ -263,22 +263,22 @@ static TIMER_CALLBACK( nmi_callback )
next_v256 = nmi_trigger_v256s[next_nmi_number];
next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256);
- state->nmi_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_nmi_number);
+ state->nmi_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_nmi_number);
}
-static void create_nmi_timer(running_machine *machine)
+static void create_nmi_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(nmi_callback));
+ berzerk_state *state = machine.driver_data<berzerk_state>();
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(nmi_callback));
}
-static void start_nmi_timer(running_machine *machine)
+static void start_nmi_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int vpos = vsync_chain_counter_to_vpos(nmi_trigger_counts[0], nmi_trigger_v256s[0]);
- state->nmi_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->nmi_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -291,7 +291,7 @@ static void start_nmi_timer(running_machine *machine)
static MACHINE_START( berzerk )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
create_irq_timer(machine);
create_nmi_timer(machine);
@@ -313,7 +313,7 @@ static MACHINE_START( berzerk )
static MACHINE_RESET( berzerk )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
state->irq_enabled = 0;
state->nmi_enabled = 0;
set_led_status(machine, 0, 0);
@@ -349,7 +349,7 @@ static VIDEO_START( berzerk )
static WRITE8_HANDLER( magicram_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
UINT8 alu_output;
UINT8 current_video_data = state->videoram[offset];
@@ -388,7 +388,7 @@ static WRITE8_HANDLER( magicram_w )
static WRITE8_HANDLER( magicram_control_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
/* save the control byte, clear the shift data latch,
and set the intercept flip-flop */
state->magicram_control = data;
@@ -399,17 +399,17 @@ static WRITE8_HANDLER( magicram_control_w )
static READ8_HANDLER( intercept_v256_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
UINT8 counter;
UINT8 v256;
- vpos_to_vsync_chain_counter(space->machine->primary_screen->vpos(), &counter, &v256);
+ vpos_to_vsync_chain_counter(space->machine().primary_screen->vpos(), &counter, &v256);
return (!state->intercept << 7) | v256;
}
-static void get_pens(running_machine *machine, pen_t *pens)
+static void get_pens(running_machine &machine, pen_t *pens)
{
static const int resistances_wg[] = { 750, 0 };
static const int resistances_el[] = { 1.0 / ((1.0 / 750.0) + (1.0 / 360.0)), 0 };
@@ -446,11 +446,11 @@ static void get_pens(running_machine *machine, pen_t *pens)
static SCREEN_UPDATE( berzerk )
{
- berzerk_state *state = screen->machine->driver_data<berzerk_state>();
+ berzerk_state *state = screen->machine().driver_data<berzerk_state>();
pen_t pens[NUM_PENS];
offs_t offs;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
{
/* offset 4 writes to the S14001A */
case 4:
- device = space->machine->device("speech");
+ device = space->machine().device("speech");
switch (data >> 6)
{
/* write data to the S14001 */
@@ -519,7 +519,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
break;
case 1:
- device = space->machine->device("speech");
+ device = space->machine().device("speech");
/* volume */
s14001a_set_volume(device, ((data & 0x38) >> 3) + 1);
@@ -537,12 +537,12 @@ static WRITE8_HANDLER( berzerk_audio_w )
/* offset 6 writes to the sfxcontrol latch */
case 6:
- exidy_sfxctrl_w(space->machine->device("exidy"), data >> 6, data);
+ exidy_sfxctrl_w(space->machine().device("exidy"), data >> 6, data);
break;
/* everything else writes to the 6840 */
default:
- exidy_sh6840_w(space->machine->device("exidy"), offset, data);
+ exidy_sh6840_w(space->machine().device("exidy"), offset, data);
break;
}
@@ -551,7 +551,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
static READ8_HANDLER( berzerk_audio_r )
{
- device_t *device = space->machine->device("speech");
+ device_t *device = space->machine().device("speech");
switch (offset)
{
/* offset 4 reads from the S14001A */
@@ -563,7 +563,7 @@ static READ8_HANDLER( berzerk_audio_r )
return 0;
/* everything else reads from the 6840 */
default:
- return exidy_sh6840_r(space->machine->device("exidy"), offset);
+ return exidy_sh6840_r(space->machine().device("exidy"), offset);
}
}
@@ -571,7 +571,7 @@ static READ8_HANDLER( berzerk_audio_r )
static SOUND_RESET(berzerk)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
/* clears the flip-flop controlling the volume and freq on the speech chip */
berzerk_audio_w(space, 4, 0x40);
}
@@ -887,16 +887,16 @@ INPUT_PORTS_END
static READ8_HANDLER( moonwarp_p1_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
// This seems to be the same type of dial as the later 'moon war 2' set uses
// see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic
// I.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature
// one difference is it lacks the strobe input (does it?), which if not active causes
// the dial input to go open bus. This is used in moon war 2 to switch between player 1
// and player 2 dials, which share a single port. moonwarp uses separate ports for the dials.
- signed char dialread = input_port_read(space->machine,"P1_DIAL");
+ signed char dialread = input_port_read(space->machine(),"P1_DIAL");
UINT8 ret;
- UINT8 buttons = (input_port_read(space->machine,"P1")&0xe0);
+ UINT8 buttons = (input_port_read(space->machine(),"P1")&0xe0);
if (dialread < 0) state->p1_direction = 0;
else if (dialread > 0) state->p1_direction = 0x10;
state->p1_counter_74ls161 += abs(dialread);
@@ -908,11 +908,11 @@ static READ8_HANDLER( moonwarp_p1_r )
static READ8_HANDLER( moonwarp_p2_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
// same as above, but for player 2 in cocktail mode
- signed char dialread = input_port_read(space->machine,"P2_DIAL");
+ signed char dialread = input_port_read(space->machine(),"P2_DIAL");
UINT8 ret;
- UINT8 buttons = (input_port_read(space->machine,"P2")&0xe0);
+ UINT8 buttons = (input_port_read(space->machine(),"P2")&0xe0);
if (dialread < 0) state->p2_direction = 0;
else if (dialread > 0) state->p2_direction = 0x10;
state->p2_counter_74ls161 += abs(dialread);
@@ -1209,7 +1209,7 @@ ROM_END
static DRIVER_INIT( moonwarp )
{
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
io->install_legacy_read_handler (0x48, 0x48, FUNC(moonwarp_p1_r));
io->install_legacy_read_handler (0x4a, 0x4a, FUNC(moonwarp_p2_r));
}
diff --git a/src/mame/drivers/bestleag.c b/src/mame/drivers/bestleag.c
index 4c429abf262..b2cdc7e07d9 100644
--- a/src/mame/drivers/bestleag.c
+++ b/src/mame/drivers/bestleag.c
@@ -46,7 +46,7 @@ public:
static TILE_GET_INFO( get_tx_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->txram[tile_index];
SET_TILE_INFO(
@@ -58,7 +58,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->bgram[tile_index];
SET_TILE_INFO(
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->fgram[tile_index];
SET_TILE_INFO(
@@ -93,7 +93,7 @@ static TILEMAP_MAPPER( bsb_bg_scan )
static VIDEO_START(bestleag)
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_cols,8,8,256, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,bsb_bg_scan,16,16,128, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,bsb_bg_scan,16,16,128, 64);
@@ -107,9 +107,9 @@ Note: sprite chip is different than the other Big Striker sets and they
include several similiarities with other Playmark games (including
the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2))
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
UINT16 *spriteram16 = state->spriteram;
/*
@@ -136,26 +136,26 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if(state->vregs[0x00/2] & 0x1000)
color &= 7;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, 0,
flipx ? (sx+16) : (sx),sy,15);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code+1,
color,
flipx, 0,
flipx ? (sx) : (sx+16),sy,15);
/* wraparound x */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, 0,
flipx ? (sx+16 - 512) : (sx - 512),sy,15);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code+1,
color,
flipx, 0,
@@ -165,7 +165,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static SCREEN_UPDATE(bestleag)
{
- bestleag_state *state = screen->machine->driver_data<bestleag_state>();
+ bestleag_state *state = screen->machine().driver_data<bestleag_state>();
tilemap_set_scrollx(state->bg_tilemap,0,(state->vregs[0x00/2] & 0xfff) + (state->vregs[0x08/2] & 0x7) - 3);
tilemap_set_scrolly(state->bg_tilemap,0,state->vregs[0x02/2]);
tilemap_set_scrollx(state->tx_tilemap,0,state->vregs[0x04/2]);
@@ -175,14 +175,14 @@ static SCREEN_UPDATE(bestleag)
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
static SCREEN_UPDATE(bestleaw)
{
- bestleag_state *state = screen->machine->driver_data<bestleag_state>();
+ bestleag_state *state = screen->machine().driver_data<bestleag_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->vregs[0x08/2]);
tilemap_set_scrolly(state->bg_tilemap,0,state->vregs[0x0a/2]);
tilemap_set_scrollx(state->tx_tilemap,0,state->vregs[0x00/2]);
@@ -192,28 +192,28 @@ static SCREEN_UPDATE(bestleaw)
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
static WRITE16_HANDLER( bestleag_txram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->txram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static WRITE16_HANDLER( bestleag_bgram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE16_HANDLER( bestleag_fgram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index c0f13dd5b18..142fb2f4c64 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -92,7 +92,7 @@
/*
Function prototypes
*/
-INLINE void z80_bank(running_machine *machine, int num, int data);
+INLINE void z80_bank(running_machine &machine, int num, int data);
/***************************************************************************
@@ -319,7 +319,7 @@ static const UINT8 col76index[] = {0, 2, 4, 7};
static VIDEO_START( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
int i;
memcpy(state->col4bit, col4bit_default, sizeof(state->col4bit));
@@ -341,7 +341,7 @@ static VIDEO_START( bfcobra )
static SCREEN_UPDATE( bfcobra )
{
- bfcobra_state *state = screen->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = screen->machine().driver_data<bfcobra_state>();
int x, y;
UINT8 *src;
UINT32 *dest;
@@ -385,13 +385,13 @@ static SCREEN_UPDATE( bfcobra )
if ( ( state->videomode & 0x81 ) == 1 || (state->videomode & 0x80 && pen & 0x80) )
{
- *dest++ = screen->machine->pens[hirescol[pen & 0x0f]];
- *dest++ = screen->machine->pens[hirescol[(pen >> 4) & 0x0f]];
+ *dest++ = screen->machine().pens[hirescol[pen & 0x0f]];
+ *dest++ = screen->machine().pens[hirescol[(pen >> 4) & 0x0f]];
}
else
{
- *dest++ = screen->machine->pens[lorescol[pen]];
- *dest++ = screen->machine->pens[lorescol[pen]];
+ *dest++ = screen->machine().pens[lorescol[pen]];
+ *dest++ = screen->machine().pens[lorescol[pen]];
}
}
}
@@ -399,20 +399,20 @@ static SCREEN_UPDATE( bfcobra )
return 0;
}
-INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
+INLINE UINT8* blitter_get_addr(running_machine &machine, UINT32 addr)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
if (addr < 0x10000)
{
/* Is this region fixed? */
- return (UINT8*)(machine->region("user1")->base() + addr);
+ return (UINT8*)(machine.region("user1")->base() + addr);
}
else if(addr < 0x20000)
{
addr &= 0xffff;
addr += (state->bank_data[0] & 1) ? 0x10000 : 0;
- return (UINT8*)(machine->region("user1")->base() + addr + ((state->bank_data[0] >> 1) * 0x20000));
+ return (UINT8*)(machine.region("user1")->base() + addr + ((state->bank_data[0] >> 1) * 0x20000));
}
else if (addr >= 0x20000 && addr < 0x40000)
{
@@ -432,9 +432,9 @@ INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
*/
static void RunBlit(address_space *space)
{
-#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine, blitter.program.addr++))
+#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine(), blitter.program.addr++))
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct blitter_t &blitter = state->blitter;
int cycles_used = 0;
@@ -462,7 +462,7 @@ static void RunBlit(address_space *space)
/* This debug is now wrong ! */
if (DEBUG_BLITTER)
{
- mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine->describe_context(), blitter.program.addr - 12);
+ mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine().describe_context(), blitter.program.addr - 12);
mame_printf_debug("Command Reg %.2x", blitter.command);
mame_printf_debug(" %s %s %s %s %s %s %s\n",
blitter.command & CMD_RUN ? "RUN" : " ",
@@ -544,7 +544,7 @@ static void RunBlit(address_space *space)
blitter.source.addr0 -=blitter.step;
}
- *blitter_get_addr(space->machine, blitter.dest.addr) = blitter.pattern;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = blitter.pattern;
cycles_used++;
} while (--innercnt);
@@ -558,7 +558,7 @@ static void RunBlit(address_space *space)
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
{
- srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
blitter.source.loword++;
cycles_used++;
}
@@ -568,7 +568,7 @@ static void RunBlit(address_space *space)
{
if (LOOPTYPE == 0 || LOOPTYPE == 1)
{
- srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
cycles_used++;
if (blitter.modectl & MODE_SSIGN)
@@ -583,7 +583,7 @@ static void RunBlit(address_space *space)
/* Read destination pixel? */
if (LOOPTYPE == 0)
{
- dstdata = *blitter_get_addr(space->machine, blitter.dest.addr & 0xfffff);
+ dstdata = *blitter_get_addr(space->machine(), blitter.dest.addr & 0xfffff);
cycles_used++;
}
@@ -652,10 +652,10 @@ static void RunBlit(address_space *space)
The existing destination pixel is used as a lookup
into the table and the colours is replaced.
*/
- UINT8 dest = *blitter_get_addr(space->machine, blitter.dest.addr);
- UINT8 newcol = *(blitter_get_addr(space->machine, (blitter.source.addr + dest) & 0xfffff));
+ UINT8 dest = *blitter_get_addr(space->machine(), blitter.dest.addr);
+ UINT8 newcol = *(blitter_get_addr(space->machine(), (blitter.source.addr + dest) & 0xfffff));
- *blitter_get_addr(space->machine, blitter.dest.addr) = newcol;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = newcol;
cycles_used += 3;
}
else
@@ -674,7 +674,7 @@ static void RunBlit(address_space *space)
if (blitter.compfunc & CMPFUNC_LOG0)
final_result |= ~result & ~dstdata;
- *blitter_get_addr(space->machine, blitter.dest.addr) = final_result;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = final_result;
cycles_used++;
}
}
@@ -720,7 +720,7 @@ static void RunBlit(address_space *space)
static READ8_HANDLER( ramdac_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct ramdac_t &ramdac = state->ramdac;
UINT8 val = 0xff;
@@ -733,7 +733,7 @@ static READ8_HANDLER( ramdac_r )
if (*count == 0)
{
rgb_t color;
- color = palette_get_color(space->machine, ramdac.addr_r);
+ color = palette_get_color(space->machine(), ramdac.addr_r);
ramdac.color_r[0] = RGB_RED(color);
ramdac.color_r[1] = RGB_GREEN(color);
@@ -763,7 +763,7 @@ static READ8_HANDLER( ramdac_r )
static WRITE8_HANDLER( ramdac_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct ramdac_t &ramdac = state->ramdac;
switch (offset & 3)
@@ -779,7 +779,7 @@ static WRITE8_HANDLER( ramdac_w )
ramdac.color_w[ramdac.count_w] = pal6bit(data);
if (++ramdac.count_w == 3)
{
- palette_set_color_rgb(space->machine, ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
+ palette_set_color_rgb(space->machine(), ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
ramdac.count_w = 0;
ramdac.addr_w++;
}
@@ -847,9 +847,9 @@ static WRITE8_HANDLER( ramdac_w )
***************************************************************************/
-static void update_irqs(running_machine *machine)
+static void update_irqs(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
int newstate = state->blitter_irq || state->vblank_irq || state->acia_irq;
if (newstate != state->irq_state)
@@ -861,7 +861,7 @@ static void update_irqs(running_machine *machine)
static READ8_HANDLER( chipset_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
UINT8 val = 0xff;
switch(offset)
@@ -885,7 +885,7 @@ static READ8_HANDLER( chipset_r )
val = 0x1;
/* TODO */
- update_irqs(space->machine);
+ update_irqs(space->machine());
break;
}
case 0x1C:
@@ -902,7 +902,7 @@ static READ8_HANDLER( chipset_r )
}
case 0x22:
{
- val = 0x40 | input_port_read(space->machine, "JOYSTICK");
+ val = 0x40 | input_port_read(space->machine(), "JOYSTICK");
break;
}
default:
@@ -916,7 +916,7 @@ static READ8_HANDLER( chipset_r )
static WRITE8_HANDLER( chipset_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
switch (offset)
{
case 0x01:
@@ -928,7 +928,7 @@ static WRITE8_HANDLER( chipset_w )
data &= 0x3f;
state->bank_data[offset] = data;
- z80_bank(space->machine, offset, data);
+ z80_bank(space->machine(), offset, data);
break;
}
@@ -1003,16 +1003,16 @@ static WRITE8_HANDLER( chipset_w )
}
}
-INLINE void z80_bank(running_machine *machine, int num, int data)
+INLINE void z80_bank(running_machine &machine, int num, int data)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
static const char * const bank_names[] = { "bank1", "bank2", "bank3" };
if (data < 0x08)
{
UINT32 offset = ((state->bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((state->bank_data[0] & 1) ? 0 : 0x10000));
- memory_set_bankptr(machine, bank_names[num - 1], machine->region("user1")->base() + offset);
+ memory_set_bankptr(machine, bank_names[num - 1], machine.region("user1")->base() + offset);
}
else if (data < 0x10)
{
@@ -1026,11 +1026,11 @@ INLINE void z80_bank(running_machine *machine, int num, int data)
static WRITE8_HANDLER( rombank_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
state->bank_data[0] = data;
- z80_bank(space->machine, 1, state->bank_data[1]);
- z80_bank(space->machine, 2, state->bank_data[2]);
- z80_bank(space->machine, 3, state->bank_data[3]);
+ z80_bank(space->machine(), 1, state->bank_data[1]);
+ z80_bank(space->machine(), 2, state->bank_data[2]);
+ z80_bank(space->machine(), 3, state->bank_data[3]);
}
@@ -1079,9 +1079,9 @@ enum command
SCAN_HIGH_OR_EQUAL = 29
};
-static void reset_fdc(running_machine *machine)
+static void reset_fdc(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
memset(&state->fdc, 0, sizeof(state->fdc));
state->fdc.MSR = 0x80;
@@ -1090,7 +1090,7 @@ static void reset_fdc(running_machine *machine)
static READ8_HANDLER( fdctrl_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
UINT8 val = 0;
val = state->fdc.MSR;
@@ -1100,7 +1100,7 @@ static READ8_HANDLER( fdctrl_r )
static READ8_HANDLER( fddata_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct fdc_t &fdc = state->fdc;
#define BPS 1024
#define SPT 10
@@ -1130,7 +1130,7 @@ static READ8_HANDLER( fddata_r )
}
fdc.offset = (BPT * fdc.track*2) + (fdc.side ? BPT : 0) + (BPS * (fdc.sector-1)) + fdc.byte_pos++;
- val = *(space->machine->region("user2")->base() + fdc.offset);
+ val = *(space->machine().region("user2")->base() + fdc.offset);
/* Move on to next sector? */
if (fdc.byte_pos == 1024)
@@ -1174,7 +1174,7 @@ static READ8_HANDLER( fddata_r )
static WRITE8_HANDLER( fdctrl_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct fdc_t &fdc = state->fdc;
switch (fdc.phase)
{
@@ -1304,7 +1304,7 @@ WRITE8_HANDLER( fd_ctrl_w )
static MACHINE_RESET( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
unsigned int pal;
for (pal = 0; pal < 256; ++pal)
@@ -1376,14 +1376,14 @@ static READ8_HANDLER( int_latch_r )
/* TODO */
static READ8_HANDLER( meter_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
return state->meter_latch;
}
/* TODO: This is borrowed from Scorpion 1 */
static WRITE8_HANDLER( meter_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
int i;
int changed = state->meter_latch ^ data;
@@ -1406,13 +1406,13 @@ static WRITE8_HANDLER( meter_w )
/* TODO */
static READ8_HANDLER( latch_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
return state->mux_input;
}
static WRITE8_HANDLER( latch_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
/* TODO: This is borrowed from Scorpion 1 */
switch(offset)
{
@@ -1430,7 +1430,7 @@ static WRITE8_HANDLER( latch_w )
/* Clock is low */
if (!(data & 0x08))
- state->mux_input = input_port_read(space->machine, port[input_strobe]);
+ state->mux_input = input_port_read(space->machine(), port[input_strobe]);
}
break;
}
@@ -1587,9 +1587,9 @@ INPUT_PORTS_END
/*
Allocate work RAM and video RAM shared by the Z80 and chipset.
*/
-static void init_ram(running_machine *machine)
+static void init_ram(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
/* 768kB work RAM */
state->work_ram = auto_alloc_array_clear(machine, UINT8, 0xC0000);
@@ -1603,21 +1603,21 @@ static void init_ram(running_machine *machine)
static READ_LINE_DEVICE_HANDLER( z80_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->m6809_z80_line;
}
static WRITE_LINE_DEVICE_HANDLER( z80_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->z80_m6809_line = state;
}
static WRITE_LINE_DEVICE_HANDLER( z80_acia_irq )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->acia_irq = state ? CLEAR_LINE : ASSERT_LINE;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static ACIA6850_INTERFACE( z80_acia_if )
@@ -1634,19 +1634,19 @@ static ACIA6850_INTERFACE( z80_acia_if )
static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->z80_m6809_line;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->m6809_z80_line = state;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_data_irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
}
static ACIA6850_INTERFACE( m6809_acia_if )
@@ -1663,13 +1663,13 @@ static ACIA6850_INTERFACE( m6809_acia_if )
static READ_LINE_DEVICE_HANDLER( data_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->data_r;
}
static WRITE_LINE_DEVICE_HANDLER( data_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->data_t = state;
}
@@ -1690,7 +1690,7 @@ static ACIA6850_INTERFACE( data_acia_if )
/* TODO: Driver vs Machine Init */
static DRIVER_INIT( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
/*
6809 ROM address and data lines are scrambled.
This is the same scrambling as Scorpion 2.
@@ -1703,7 +1703,7 @@ static DRIVER_INIT( bfcobra )
UINT8 *tmp;
tmp = auto_alloc_array(machine, UINT8, 0x8000);
- rom = machine->region("audiocpu")->base() + 0x8000;
+ rom = machine.region("audiocpu")->base() + 0x8000;
memcpy(tmp, rom, 0x8000);
for (i = 0; i < 0x8000; i++)
@@ -1732,7 +1732,7 @@ static DRIVER_INIT( bfcobra )
state->bank_data[3] = 0;
/* Fixed 16kB ROM region */
- memory_set_bankptr(machine, "bank4", machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank4", machine.region("user1")->base());
/* TODO: Properly sort out the data ACIA */
state->data_r = 1;
@@ -1762,9 +1762,9 @@ static INTERRUPT_GEN( timer_irq )
/* TODO */
static INTERRUPT_GEN( vblank_gen )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
state->vblank_irq = 1;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static MACHINE_CONFIG_START( bfcobra, bfcobra_state )
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index 65846373d2a..ce735e23ebd 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -156,14 +156,14 @@ static int Scorpion1_GetSwitchState(bfm_sc1_state *drvstate, int strobe, int dat
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine,"bank1",data & 0x03);
+ memory_set_bank(space->machine(),"bank1",data & 0x03);
}
///////////////////////////////////////////////////////////////////////////
static INTERRUPT_GEN( timer_irq )
{
- bfm_sc1_state *state = device->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = device->machine().driver_data<bfm_sc1_state>();
if ( state->watchdog_kicked )
{
state->watchdog_cnt = 0;
@@ -174,7 +174,7 @@ static INTERRUPT_GEN( timer_irq )
state->watchdog_cnt++;
if ( state->watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
- device->machine->schedule_soft_reset();// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
+ device->machine().schedule_soft_reset();// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
return;
}
}
@@ -183,9 +183,9 @@ static INTERRUPT_GEN( timer_irq )
{
state->irq_status = 0x01 |0x02; //0xff;
- state->sc1_Inputs[2] = input_port_read(device->machine,"STROBE0");
+ state->sc1_Inputs[2] = input_port_read(device->machine(),"STROBE0");
- generic_pulse_irq_line(device->machine->device("maincpu"), M6809_IRQ_LINE);
+ generic_pulse_irq_line(device->machine().device("maincpu"), M6809_IRQ_LINE);
}
}
@@ -193,7 +193,7 @@ static INTERRUPT_GEN( timer_irq )
static READ8_HANDLER( irqlatch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int result = state->irq_status | 0x02;
state->irq_status = 0;
@@ -205,7 +205,7 @@ static READ8_HANDLER( irqlatch_r )
static WRITE8_HANDLER( reel12_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( state->locked & 0x01 )
{ // hardware is still state->locked,
if ( data == 0x46 ) state->locked &= ~0x01;
@@ -228,7 +228,7 @@ static WRITE8_HANDLER( reel12_w )
static WRITE8_HANDLER( reel34_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( state->locked & 0x02 )
{ // hardware is still state->locked,
if ( data == 0x42 ) state->locked &= ~0x02;
@@ -251,7 +251,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( reel56_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( stepper_update(4, (data>>4)&0x0f) ) state->reel_changed |= 0x10;
if ( stepper_update(5, data&0x0f ) ) state->reel_changed |= 0x20;
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( reel56_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int i;
if ( state->locked & 0x04 )
{ // hardware is still state->locked,
@@ -286,7 +286,7 @@ static WRITE8_HANDLER( mmtr_w )
if ( changed & (1 << i) )
{
MechMtr_update(i, data & (1 << i) );
- generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
+ generic_pulse_irq_line(space->machine().device("maincpu"), M6809_FIRQ_LINE);
}
}
}
@@ -296,7 +296,7 @@ static WRITE8_HANDLER( mmtr_w )
static READ8_HANDLER( mmtr_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mmtr_latch;
}
@@ -304,7 +304,7 @@ static READ8_HANDLER( mmtr_r )
static READ8_HANDLER( dipcoin_r )
{
- return input_port_read(space->machine,"STROBE0") & 0x1F;
+ return input_port_read(space->machine(),"STROBE0") & 0x1F;
}
///////////////////////////////////////////////////////////////////////////
@@ -318,7 +318,7 @@ static READ8_DEVICE_HANDLER( nec_r )
static WRITE8_HANDLER( vfd_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->vfd_latch ^ data;
state->vfd_latch = data;
@@ -380,7 +380,7 @@ static const UINT8 BFM_strcnv[] =
static READ8_HANDLER( mux1latch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mux1_input;
}
@@ -402,7 +402,7 @@ static READ8_HANDLER( mux1dathi_r )
static WRITE8_HANDLER( mux1latch_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->mux1_outputlatch ^ data;
static const char *const portnames[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7" };
state->mux1_outputlatch = data;
@@ -438,7 +438,7 @@ static WRITE8_HANDLER( mux1latch_w )
if ( !(data & 0x08) )
{
- state->sc1_Inputs[ input_strobe ] = input_port_read(space->machine,portnames[input_strobe]);
+ state->sc1_Inputs[ input_strobe ] = input_port_read(space->machine(),portnames[input_strobe]);
state->mux1_input = state->sc1_Inputs[ input_strobe ];
}
@@ -449,7 +449,7 @@ static WRITE8_HANDLER( mux1latch_w )
static WRITE8_HANDLER( mux1datlo_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux1_datalo = data;
}
@@ -457,7 +457,7 @@ static WRITE8_HANDLER( mux1datlo_w )
static WRITE8_HANDLER( mux1dathi_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux1_datahi = data;
}
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( mux1dathi_w )
static READ8_HANDLER( mux2latch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mux2_input;
}
@@ -487,7 +487,7 @@ static READ8_HANDLER( mux2dathi_r )
static WRITE8_HANDLER( mux2latch_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->mux2_outputlatch ^ data;
state->mux2_outputlatch = data;
@@ -523,7 +523,7 @@ static WRITE8_HANDLER( mux2latch_w )
static WRITE8_HANDLER( mux2datlo_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux2_datalo = data;
}
@@ -531,7 +531,7 @@ static WRITE8_HANDLER( mux2datlo_w )
static WRITE8_HANDLER( mux2dathi_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux2_datahi = data;
}
@@ -539,7 +539,7 @@ static WRITE8_HANDLER( mux2dathi_w )
static WRITE8_HANDLER( watchdog_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->watchdog_kicked = 1;
}
@@ -561,7 +561,7 @@ static WRITE8_HANDLER( aciadata_w )
static READ8_HANDLER( aciastat_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->acia_status;
}
@@ -578,7 +578,7 @@ static READ8_HANDLER( aciadata_r )
static WRITE8_HANDLER( triac_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->triac_latch = data;
}
@@ -586,7 +586,7 @@ static WRITE8_HANDLER( triac_w )
static READ8_HANDLER( triac_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->triac_latch;
}
@@ -611,7 +611,7 @@ static WRITE8_DEVICE_HANDLER( nec_latch_w )
static WRITE8_HANDLER( vid_uart_tx_w )
{
adder2_send(data);
- cputag_set_input_line(space->machine, "adder2", M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ
+ cputag_set_input_line(space->machine(), "adder2", M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ
}
///////////////////////////////////////////////////////////////////////////
@@ -653,12 +653,12 @@ static const UINT8 DataDecode[]=
-static void decode_sc1(running_machine *machine,const char *rom_region)
+static void decode_sc1(running_machine &machine,const char *rom_region)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
UINT8 *tmp, *rom;
- rom = machine->region(rom_region)->base();
+ rom = machine.region(rom_region)->base();
tmp = auto_alloc_array(machine, UINT8, 0x10000);
@@ -709,7 +709,7 @@ static void decode_sc1(running_machine *machine,const char *rom_region)
static MACHINE_RESET( bfm_sc1 )
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
BFM_BD1_init(0);
state->vfd_latch = 0;
state->mmtr_latch = 0;
@@ -749,7 +749,7 @@ static MACHINE_RESET( bfm_sc1 )
// init rom bank ////////////////////////////////////////////////////////////////////
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_configure_bank(machine,"bank1", 0, 1, &rom[0x10000], 0);
memory_configure_bank(machine,"bank1", 1, 3, &rom[0x02000], 0x02000);
@@ -1332,12 +1332,12 @@ ROM_END
/////////////////////////////////////////////////////////////////////////////////////
-static void sc1_common_init(running_machine *machine, int reels, int decrypt)
+static void sc1_common_init(running_machine &machine, int reels, int decrypt)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
UINT8 *rom, i;
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
if ( rom )
{
memcpy(&rom[0x10000], &rom[0x00000], 0x2000);
@@ -1389,7 +1389,7 @@ static DRIVER_INIT(rou029)
static DRIVER_INIT(clatt)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
sc1_common_init(machine,6,1);
MechMtr_config(machine,8);
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index 53b11567e34..faef1f9b5ef 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -237,8 +237,8 @@ public:
// local prototypes ///////////////////////////////////////////////////////
-static int read_e2ram(running_machine *machine);
-static void e2ram_reset(running_machine *machine);
+static int read_e2ram(running_machine &machine);
+static void e2ram_reset(running_machine &machine);
/* INPUTS layout
@@ -262,9 +262,9 @@ static void e2ram_reset(running_machine *machine);
// called if board is reset ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-static void on_scorpion2_reset(running_machine *machine)
+static void on_scorpion2_reset(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
state->vfd1_latch = 0;
state->vfd2_latch = 0;
state->mmtr_latch = 0;
@@ -330,7 +330,7 @@ send data to them, although obviously there's no response. */
// init rom bank ////////////////////////////////////////////////////////
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 1, &rom[0x10000], 0);
memory_configure_bank(machine, "bank1", 1, 3, &rom[0x02000], 0x02000);
@@ -341,9 +341,9 @@ send data to them, although obviously there's no response. */
///////////////////////////////////////////////////////////////////////////
-void Scorpion2_SetSwitchState(running_machine *machine, int strobe, int data, int state)
+void Scorpion2_SetSwitchState(running_machine &machine, int strobe, int data, int state)
{
- bfm_sc2_state *drvstate = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *drvstate = machine.driver_data<bfm_sc2_state>();
if ( strobe < 11 && data < 8 )
{
if ( strobe < 8 )
@@ -375,9 +375,9 @@ void Scorpion2_SetSwitchState(running_machine *machine, int strobe, int data, in
///////////////////////////////////////////////////////////////////////////
-int Scorpion2_GetSwitchState(running_machine *machine, int strobe, int data)
+int Scorpion2_GetSwitchState(running_machine &machine, int strobe, int data)
{
- bfm_sc2_state *drvstate = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *drvstate = machine.driver_data<bfm_sc2_state>();
int state = 0;
if ( strobe < 11 && data < 8 )
@@ -405,7 +405,7 @@ int Scorpion2_GetSwitchState(running_machine *machine, int strobe, int data)
static NVRAM_HANDLER( bfm_sc2 )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
static const UINT8 init_e2ram[10] = { 1, 4, 10, 20, 0, 1, 1, 4, 10, 20 };
if ( read_or_write )
{ // writing
@@ -429,7 +429,7 @@ static NVRAM_HANDLER( bfm_sc2 )
static WRITE8_HANDLER( watchdog_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->watchdog_kicked = 1;
}
@@ -437,14 +437,14 @@ static WRITE8_HANDLER( watchdog_w )
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1",data & 0x03);
+ memory_set_bank(space->machine(), "bank1",data & 0x03);
}
///////////////////////////////////////////////////////////////////////////
static INTERRUPT_GEN( timer_irq )
{
- bfm_sc2_state *state = device->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = device->machine().driver_data<bfm_sc2_state>();
state->timercnt++;
if ( state->watchdog_kicked )
@@ -457,8 +457,8 @@ static INTERRUPT_GEN( timer_irq )
state->watchdog_cnt++;
if ( state->watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
- device->machine->schedule_soft_reset(); // reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
- on_scorpion2_reset(device->machine);
+ device->machine().schedule_soft_reset(); // reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
+ on_scorpion2_reset(device->machine());
return;
}
}
@@ -476,7 +476,7 @@ static INTERRUPT_GEN( timer_irq )
static WRITE8_HANDLER( reel12_vid_w ) // in a video cabinet this is used to drive a hopper
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel12_latch = data;
if ( state->has_hopper )
@@ -512,7 +512,7 @@ static WRITE8_HANDLER( reel12_vid_w ) // in a video cabinet this is used to dri
static WRITE8_HANDLER( reel34_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel34_latch = data;
if ( stepper_update(2, data&0x0f ) ) state->reel_changed |= 0x04;
@@ -531,7 +531,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( reel56_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel56_latch = data;
if ( stepper_update(4, data&0x0f ) ) state->reel_changed |= 0x10;
@@ -552,7 +552,7 @@ static WRITE8_HANDLER( reel56_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int i;
int changed = state->mmtr_latch ^ data;
@@ -565,14 +565,14 @@ static WRITE8_HANDLER( mmtr_w )
MechMtr_update(i, data & (1 << i) );
}
}
- if ( data & 0x1F ) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
+ if ( data & 0x1F ) cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( mux_output_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int i;
int off = offset<<3;
@@ -593,7 +593,7 @@ static WRITE8_HANDLER( mux_output_w )
static READ8_HANDLER( mux_input_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = 0xFF,t1,t2;
static const char *const port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7", "STROBE8", "STROBE9", "STROBE10", "STROBE11" };
@@ -603,11 +603,11 @@ static READ8_HANDLER( mux_input_r )
t1 = state->input_override[offset]; // strobe 0-7 data 0-4
t2 = state->input_override[offset+idx]; // strobe 8-B data 0-4
- t1 = (state->sc2_Inputs[offset] & t1) | ( ( input_port_read(space->machine, port[offset]) & ~t1) & 0x1F);
+ t1 = (state->sc2_Inputs[offset] & t1) | ( ( input_port_read(space->machine(), port[offset]) & ~t1) & 0x1F);
if (idx == 8)
- t2 = (state->sc2_Inputs[offset+8] & t2) | ( ( input_port_read(space->machine, port[offset+8]) & ~t2) << 5);
+ t2 = (state->sc2_Inputs[offset+8] & t2) | ( ( input_port_read(space->machine(), port[offset+8]) & ~t2) << 5);
else
- t2 = (state->sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(space->machine, port[offset+4]) & ~t2) << 2) & 0x60);
+ t2 = (state->sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(space->machine(), port[offset+4]) & ~t2) << 2) & 0x60);
state->sc2_Inputs[offset] = (state->sc2_Inputs[offset] & ~0x1F) | t1;
state->sc2_Inputs[offset+idx] = (state->sc2_Inputs[offset+idx] & ~0x60) | t2;
@@ -645,15 +645,15 @@ static WRITE8_HANDLER( unknown_w )
static WRITE8_HANDLER( volume_override_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int old = state->volume_override;
state->volume_override = data?1:0;
if ( old != state->volume_override )
{
- ym2413_device *ym = space->machine->device<ym2413_device>("ymsnd");
- upd7759_device *upd = space->machine->device<upd7759_device>("upd");
+ ym2413_device *ym = space->machine().device<ym2413_device>("ymsnd");
+ upd7759_device *upd = space->machine().device<upd7759_device>("upd");
float percent = state->volume_override? 1.0f : (32-state->global_volume)/32.0f;
ym->set_output_gain(0, percent);
@@ -674,7 +674,7 @@ static WRITE8_DEVICE_HANDLER( nec_reset_w )
static WRITE8_DEVICE_HANDLER( nec_latch_w )
{
- bfm_sc2_state *state = device->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = device->machine().driver_data<bfm_sc2_state>();
int bank = 0;
if ( data & 0x80 ) bank |= 0x01;
@@ -691,7 +691,7 @@ static WRITE8_DEVICE_HANDLER( nec_latch_w )
static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are connected to this
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
// b7 = NEC busy
// b6 = alpha busy (also matrix board)
// b5 - b0 = reel optics
@@ -715,7 +715,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co
}
}
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; // update sound busy input
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80; // update sound busy input
return result;
}
@@ -724,7 +724,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co
static WRITE8_HANDLER( expansion_latch_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int changed = state->expansion_latch^data;
state->expansion_latch = data;
@@ -752,8 +752,8 @@ static WRITE8_HANDLER( expansion_latch_w )
}
{
- ym2413_device *ym = space->machine->device<ym2413_device>("ymsnd");
- upd7759_device *upd = space->machine->device<upd7759_device>("upd");
+ ym2413_device *ym = space->machine().device<ym2413_device>("ymsnd");
+ upd7759_device *upd = space->machine().device<upd7759_device>("upd");
float percent = state->volume_override ? 1.0f : (32-state->global_volume)/32.0f;
ym->set_output_gain(0, percent);
@@ -781,7 +781,7 @@ static WRITE8_HANDLER( muxena_w )
static WRITE8_HANDLER( timerirq_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->is_timer_enabled = data & 1;
}
@@ -789,7 +789,7 @@ static WRITE8_HANDLER( timerirq_w )
static READ8_HANDLER( timerirqclr_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->irq_timer_stat = 0;
state->irq_status = 0;
@@ -800,7 +800,7 @@ static READ8_HANDLER( timerirqclr_r )
static READ8_HANDLER( irqstatus_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = state->irq_status | state->irq_timer_stat | 0x80; // 0x80 = ~MUXERROR
state->irq_timer_stat = 0;
@@ -812,7 +812,7 @@ static READ8_HANDLER( irqstatus_r )
static WRITE8_HANDLER( coininhib_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int changed = state->coin_inhibits^data,i,p;
state->coin_inhibits = data;
@@ -824,7 +824,7 @@ static WRITE8_HANDLER( coininhib_w )
{
if ( changed & p )
{ // this inhibit line has changed
- coin_lockout_w(space->machine, i, (~data & p) ); // update lockouts
+ coin_lockout_w(space->machine(), i, (~data & p) ); // update lockouts
changed &= ~p;
}
@@ -837,14 +837,14 @@ static WRITE8_HANDLER( coininhib_w )
static READ8_HANDLER( coin_input_r )
{
- return input_port_read(space->machine, "COINS");
+ return input_port_read(space->machine(), "COINS");
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( payout_latch_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->pay_latch = data;
}
@@ -852,7 +852,7 @@ static WRITE8_HANDLER( payout_latch_w )
static WRITE8_HANDLER( payout_triac_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
if ( state->triac_select == 0x57 )
{
int slide = 0;
@@ -888,7 +888,7 @@ static WRITE8_HANDLER( payout_triac_w )
{
int strobe = state->slide_pay_sensor[slide]>>4, data = state->slide_pay_sensor[slide]&0x0F;
- Scorpion2_SetSwitchState(space->machine, strobe, data, 0);
+ Scorpion2_SetSwitchState(space->machine(), strobe, data, 0);
}
state->slide_states[slide] = 1;
}
@@ -901,7 +901,7 @@ static WRITE8_HANDLER( payout_triac_w )
{
int strobe = state->slide_pay_sensor[slide]>>4, data = state->slide_pay_sensor[slide]&0x0F;
- Scorpion2_SetSwitchState(space->machine, strobe, data, 1);
+ Scorpion2_SetSwitchState(space->machine(), strobe, data, 1);
}
state->slide_states[slide] = 0;
}
@@ -914,7 +914,7 @@ static WRITE8_HANDLER( payout_triac_w )
static WRITE8_HANDLER( payout_select_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->triac_select = data;
}
@@ -922,7 +922,7 @@ static WRITE8_HANDLER( payout_select_w )
static WRITE8_HANDLER( vfd1_data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd1_latch = data;
BFM_BD1_newdata(0, data);
BFM_BD1_draw(0);
@@ -932,7 +932,7 @@ static WRITE8_HANDLER( vfd1_data_w )
static WRITE8_HANDLER( vfd2_data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd2_latch = data;
BFM_BD1_newdata(1, data);
BFM_BD1_draw(1);
@@ -954,7 +954,7 @@ static WRITE8_HANDLER( vfd_reset_w )
static READ8_HANDLER( uart1stat_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int status = 0x06;
if ( state->data_to_uart1 ) status |= 0x01;
@@ -966,7 +966,7 @@ static READ8_HANDLER( uart1stat_r )
static READ8_HANDLER( uart1data_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
return state->uart1_data;
}
@@ -980,7 +980,7 @@ static WRITE8_HANDLER( uart1ctrl_w )
static WRITE8_HANDLER( uart1data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->data_to_uart2 = 1;
state->uart1_data = data;
UART_LOG(("uart1:%x\n", data));
@@ -989,7 +989,7 @@ static WRITE8_HANDLER( uart1data_w )
static READ8_HANDLER( uart2stat_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int status = 0x06;
if ( state->data_to_uart2 ) status |= 0x01;
@@ -1001,7 +1001,7 @@ static READ8_HANDLER( uart2stat_r )
static READ8_HANDLER( uart2data_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
return state->uart2_data;
}
@@ -1016,7 +1016,7 @@ static WRITE8_HANDLER( uart2ctrl_w )
static WRITE8_HANDLER( uart2data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->data_to_uart1 = 1;
state->uart2_data = data;
UART_LOG(("uart2:%x\n", data));
@@ -1027,7 +1027,7 @@ static WRITE8_HANDLER( uart2data_w )
static WRITE8_HANDLER( vid_uart_tx_w )
{
adder2_send(data);
- cputag_set_input_line(space->machine, "adder2", M6809_IRQ_LINE, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "adder2", M6809_IRQ_LINE, HOLD_LINE );
LOG_SERIAL(("sadder %02X (%c)\n",data, data ));
}
@@ -1060,12 +1060,12 @@ static READ8_HANDLER( vid_uart_ctrl_r )
static READ8_HANDLER( key_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = state->key[ offset ];
if ( offset == 7 )
{
- result = (result & 0xFE) | read_e2ram(space->machine);
+ result = (result & 0xFE) | read_e2ram(space->machine());
}
return result;
@@ -1088,9 +1088,9 @@ on a simple two wire bus.
#define SDA 0x02 //SDA pin (data)
-static void e2ram_reset(running_machine *machine)
+static void e2ram_reset(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
state->e2reg = 0;
state->e2state = 0;
state->e2address = 0;
@@ -1154,7 +1154,7 @@ static int recAck(int changed, int data)
//
static WRITE8_HANDLER( e2ram_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>(); // b0 = clock b1 = data
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>(); // b0 = clock b1 = data
int changed, ack;
@@ -1361,9 +1361,9 @@ static WRITE8_HANDLER( e2ram_w )
}
}
-static int read_e2ram(running_machine *machine)
+static int read_e2ram(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
LOG(("e2ram: r %d (%02X) \n", state->e2data_pin, state->e2data_to_read ));
return state->e2data_pin;
@@ -1384,12 +1384,12 @@ static const UINT8 DataDecode[]=
///////////////////////////////////////////////////////////////////////////
-static void decode_mainrom(running_machine *machine, const char *rom_region)
+static void decode_mainrom(running_machine &machine, const char *rom_region)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *tmp, *rom;
- rom = machine->region(rom_region)->base();
+ rom = machine.region(rom_region)->base();
tmp = auto_alloc_array(machine, UINT8, 0x10000);
{
@@ -1453,10 +1453,10 @@ static MACHINE_RESET( init )
static SCREEN_UPDATE( addersc2 )
{
- bfm_sc2_state *state = screen->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = screen->machine().driver_data<bfm_sc2_state>();
if ( state->sc2_show_door )
{
- output_set_value("door",( Scorpion2_GetSwitchState(screen->machine,state->sc2_door_state>>4, state->sc2_door_state & 0x0F) ) );
+ output_set_value("door",( Scorpion2_GetSwitchState(screen->machine(),state->sc2_door_state>>4, state->sc2_door_state & 0x0F) ) );
}
return SCREEN_UPDATE_CALL(adder2);
@@ -2211,14 +2211,14 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-static void sc2_common_init(running_machine *machine, int decrypt)
+static void sc2_common_init(running_machine &machine, int decrypt)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *rom;
if (decrypt) decode_mainrom(machine, "maincpu"); // decode main rom
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
if ( rom )
{
memcpy(&rom[0x10000], &rom[0x00000], 0x2000);
@@ -2227,12 +2227,12 @@ static void sc2_common_init(running_machine *machine, int decrypt)
memset(state->sc2_Inputs, 0, sizeof(state->sc2_Inputs)); // clear all inputs
}
-static void adder2_common_init(running_machine *machine)
+static void adder2_common_init(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *pal;
- pal = machine->region("proms")->base();
+ pal = machine.region("proms")->base();
if ( pal )
{
memcpy(state->key, pal, 8);
@@ -2243,7 +2243,7 @@ static void adder2_common_init(running_machine *machine)
static DRIVER_INIT (quintoon)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine);
MechMtr_config(machine,8); // setup mech meters
@@ -2265,7 +2265,7 @@ static DRIVER_INIT (quintoon)
static DRIVER_INIT( pyramid )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2283,7 +2283,7 @@ static DRIVER_INIT( pyramid )
static DRIVER_INIT( sltsbelg )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2298,7 +2298,7 @@ static DRIVER_INIT( sltsbelg )
static DRIVER_INIT( adder_dutch )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2317,7 +2317,7 @@ static DRIVER_INIT( adder_dutch )
static DRIVER_INIT( gldncrwn )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2609,7 +2609,7 @@ GAMEL( 1997, gldncrwn, 0, scorpion2_vid, gldncrwn, gldncrwn, 0, "BFM
/* Reels 1 and 2 */
static WRITE8_HANDLER( reel12_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel12_latch = data;
if ( stepper_update(0, data&0x0f ) ) state->reel_changed |= 0x01;
@@ -2628,14 +2628,14 @@ static WRITE8_HANDLER( reel12_w )
/* VFD Status */
static READ8_HANDLER( vfd_status_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
/* b7 = NEC busy */
/* b6 = alpha busy (also matrix board) */
/* b5 - b0 = reel optics */
int result = state->optic_pattern;
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80;
return result;
}
@@ -2643,14 +2643,14 @@ static READ8_HANDLER( vfd_status_r )
/* VFD Status and data */
static READ8_HANDLER( vfd_status_dm01_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
/* b7 = NEC busy */
/* b6 = alpha busy (also matrix board) */
/* b5 - b0 = reel optics */
int result = state->optic_pattern;
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80;
if ( BFM_dm01_busy() ) result |= 0x40;
@@ -2660,9 +2660,9 @@ static READ8_HANDLER( vfd_status_dm01_r )
static WRITE8_HANDLER( vfd1_data_dm01_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd1_latch = data;
- BFM_dm01_writedata(space->machine,data);
+ BFM_dm01_writedata(space->machine(),data);
}
@@ -3991,7 +3991,7 @@ static MACHINE_CONFIG_START( scorpion2_dm01, bfm_sc2_state )
MCFG_CPU_PERIODIC_INT(bfm_dm01_vbl, 1500 ) /* generate 1500 NMI's per second ?? what is the exact freq?? */
MACHINE_CONFIG_END
-static void sc2awp_common_init(running_machine *machine,int reels, int decrypt)
+static void sc2awp_common_init(running_machine &machine,int reels, int decrypt)
{
int n;
sc2_common_init(machine, decrypt);
@@ -4008,7 +4008,7 @@ static void sc2awp_common_init(running_machine *machine,int reels, int decrypt)
static DRIVER_INIT (bbrkfst)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,5, 1);
MechMtr_config(machine,8);
@@ -4031,7 +4031,7 @@ static DRIVER_INIT (bbrkfst)
static DRIVER_INIT (drwho)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,4, 1);
MechMtr_config(machine,8);
@@ -4052,7 +4052,7 @@ static DRIVER_INIT (drwho)
static DRIVER_INIT (drwhon)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,4, 0);
MechMtr_config(machine,8);
@@ -4082,7 +4082,7 @@ static DRIVER_INIT (focus)
static DRIVER_INIT (cpeno1)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,5);
@@ -4127,7 +4127,7 @@ static DRIVER_INIT (cpeno1)
static DRIVER_INIT (bfmcgslm)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,8);
BFM_BD1_init(0);
@@ -4136,7 +4136,7 @@ static DRIVER_INIT (bfmcgslm)
static DRIVER_INIT (luvjub)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,8);
state->has_hopper = 0;
diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c
index d4d70cf4840..8b5ceadcf03 100644
--- a/src/mame/drivers/bfmsys85.c
+++ b/src/mame/drivers/bfmsys85.c
@@ -106,13 +106,13 @@ public:
static READ_LINE_DEVICE_HANDLER( sys85_data_r )
{
- bfmsys85_state *state = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = device->machine().driver_data<bfmsys85_state>();
return state->sys85_data_line_r;
}
static WRITE_LINE_DEVICE_HANDLER( sys85_data_w )
{
- bfmsys85_state *drvstate = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *drvstate = device->machine().driver_data<bfmsys85_state>();
drvstate->sys85_data_line_t = state;
}
@@ -131,7 +131,7 @@ static ACIA6850_INTERFACE( m6809_acia_if )
static MACHINE_RESET( bfm_sys85 )
{
- bfmsys85_state *state = machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = machine.driver_data<bfmsys85_state>();
state->vfd_latch = 0;
state->mmtr_latch = 0;
state->triac_latch = 0;
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( watchdog_w )
static INTERRUPT_GEN( timer_irq )
{
- bfmsys85_state *state = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = device->machine().driver_data<bfmsys85_state>();
if ( state->is_timer_enabled )
{
state->irq_status = 0x01 |0x02; //0xff;
@@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq )
static READ8_HANDLER( irqlatch_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int result = state->irq_status | 0x02;
state->irq_status = 0;
@@ -192,7 +192,7 @@ static READ8_HANDLER( irqlatch_r )
static WRITE8_HANDLER( reel12_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
if ( stepper_update(0, (data>>4)&0x0f) ) state->reel_changed |= 0x01;
if ( stepper_update(1, data&0x0f ) ) state->reel_changed |= 0x02;
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( reel12_w )
static WRITE8_HANDLER( reel34_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
if ( stepper_update(2, (data>>4)&0x0f) ) state->reel_changed |= 0x04;
if ( stepper_update(3, data&0x0f ) ) state->reel_changed |= 0x08;
@@ -226,7 +226,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int i;
int changed = state->mmtr_latch ^ data;
@@ -235,20 +235,20 @@ static WRITE8_HANDLER( mmtr_w )
for (i=0; i<8; i++)
if ( changed & (1 << i) ) MechMtr_update(i, data & (1 << i) );
- if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
+ if ( data ) generic_pulse_irq_line(space->machine().device("maincpu"), M6809_FIRQ_LINE);
}
///////////////////////////////////////////////////////////////////////////
static READ8_HANDLER( mmtr_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->mmtr_latch;
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( vfd_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int changed = state->vfd_latch ^ data;
state->vfd_latch = data;
@@ -305,7 +305,7 @@ static const UINT8 BFM_strcnv85[] =
static WRITE8_HANDLER( mux_ctrl_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
switch ( data & 0xF0 )
{
case 0x10:
@@ -348,7 +348,7 @@ static READ8_HANDLER( mux_ctrl_r )
static WRITE8_HANDLER( mux_data_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int pattern = 0x01, i,
off = state->mux_output_strobe<<4;
@@ -370,7 +370,7 @@ static WRITE8_HANDLER( mux_data_w )
static READ8_HANDLER( mux_data_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->mux_input;
}
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( mux_enable_w )
static WRITE8_HANDLER( triac_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
state->triac_latch = data;
}
@@ -394,7 +394,7 @@ static WRITE8_HANDLER( triac_w )
static READ8_HANDLER( triac_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->triac_latch;
}
diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c
index e5e9a2cbd37..20a2a3d0d7c 100644
--- a/src/mame/drivers/big10.c
+++ b/src/mame/drivers/big10.c
@@ -81,21 +81,21 @@ public:
* Interrupt handling & Video *
***************************************/
-static void big10_vdp_interrupt(running_machine *machine, int i)
+static void big10_vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line (machine, "maincpu", 0, (i ? ASSERT_LINE : CLEAR_LINE));
}
static INTERRUPT_GEN( big10_interrupt )
{
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static VIDEO_START( big10 )
{
VIDEO_START_CALL(generic_bitmapped);
- v9938_init (machine, 0, *machine->primary_screen, machine->generic.tmpbitmap, MODEL_V9938, VDP_MEM, big10_vdp_interrupt);
+ v9938_init (machine, 0, *machine.primary_screen, machine.generic.tmpbitmap, MODEL_V9938, VDP_MEM, big10_vdp_interrupt);
v9938_reset(0);
}
@@ -117,18 +117,18 @@ static MACHINE_RESET(big10)
static WRITE8_DEVICE_HANDLER( mux_w )
{
- big10_state *state = device->machine->driver_data<big10_state>();
+ big10_state *state = device->machine().driver_data<big10_state>();
state->mux_data = ~data;
}
static READ8_HANDLER( mux_r )
{
- big10_state *state = space->machine->driver_data<big10_state>();
+ big10_state *state = space->machine().driver_data<big10_state>();
switch(state->mux_data)
{
- case 1: return input_port_read(space->machine, "IN1");
- case 2: return input_port_read(space->machine, "IN2");
- case 4: return input_port_read(space->machine, "IN3");
+ case 1: return input_port_read(space->machine(), "IN1");
+ case 2: return input_port_read(space->machine(), "IN2");
+ case 4: return input_port_read(space->machine(), "IN3");
}
return state->mux_data;
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 87081c940db..645f5bcb195 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -66,55 +66,55 @@ J1100072A
static WRITE8_HANDLER( beg_banking_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->beg_bank = data;
/* d0-d3 connect to A11-A14 of the ROMs (via ls273 latch)
d4-d7 select one of ROMs (via ls273(above) and then ls154)
*/
- memory_set_bank(space->machine, "bank1", state->beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
+ memory_set_bank(space->machine(), "bank1", state->beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
}
static TIMER_CALLBACK( from_sound_latch_callback )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
state->from_sound = param & 0xff;
state->sound_state |= 2;
}
static WRITE8_HANDLER( beg_fromsound_w ) /* write to D800 sets bit 1 in status */
{
- space->machine->scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(space->cpu) << 16) | data);
+ space->machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(space->cpu) << 16) | data);
}
static READ8_HANDLER( beg_fromsound_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->from_sound;
}
static READ8_HANDLER( beg_soundstate_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
UINT8 ret = state->sound_state;
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
state->sound_state &= ~2; /* read from port 21 clears bit 1 in status */
return ret;
}
static READ8_HANDLER( soundstate_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->sound_state;
}
static TIMER_CALLBACK( nmi_callback )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -125,27 +125,27 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->for_sound = data;
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_state |= 1;
return state->for_sound;
}
static WRITE8_HANDLER( nmi_disable_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static TIMER_CALLBACK( deferred_ls74_w )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
int offs = (param >> 8) & 255;
int data = param & 255;
state->beg13_ls74[offs] = data;
@@ -165,27 +165,27 @@ static TIMER_CALLBACK( deferred_ls74_w )
/* do this on a timer to let the CPUs synchronize */
static WRITE8_HANDLER( beg13_a_clr_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
}
static WRITE8_HANDLER( beg13_b_clr_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
}
static WRITE8_HANDLER( beg13_a_set_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
}
static WRITE8_HANDLER( beg13_b_set_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
}
static READ8_HANDLER( beg_status_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* d0 = Q of 74ls74 IC13(partA)
d1 = Q of 74ls74 IC13(partB)
@@ -197,30 +197,30 @@ static READ8_HANDLER( beg_status_r )
*/
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return (state->beg13_ls74[0] << 0) | (state->beg13_ls74[1] << 1);
}
static READ8_HANDLER( beg_trackball_x_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const portx_name[2] = { "P1X", "P2X" };
- return input_port_read(space->machine, portx_name[state->port_select]);
+ return input_port_read(space->machine(), portx_name[state->port_select]);
}
static READ8_HANDLER( beg_trackball_y_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const porty_name[2] = { "P1Y", "P2Y" };
- return input_port_read(space->machine, porty_name[state->port_select]);
+ return input_port_read(space->machine(), porty_name[state->port_select]);
}
static WRITE8_HANDLER( beg_port08_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_select = (data & 0x04) >> 2;
}
@@ -342,7 +342,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/*
bit 0 and bit 1 = coin inputs
bit 3 and bit 4 = MCU status
@@ -350,7 +350,7 @@ static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
*/
state->mcu_coin_bit5 ^= 0x20;
- return bigevglf_mcu_status_r(space, 0) | (input_port_read(space->machine, "PORT04") & 3) | state->mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
+ return bigevglf_mcu_status_r(space, 0) | (input_port_read(space->machine(), "PORT04") & 3) | state->mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
}
static ADDRESS_MAP_START( bigevglf_sub_portmap, AS_IO, 8 )
@@ -432,10 +432,10 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( bigevglf )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->vidram_bank));
state->save_item(NAME(state->plane_selected));
@@ -469,7 +469,7 @@ static MACHINE_START( bigevglf )
static MACHINE_RESET( bigevglf )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
state->vidram_bank = 0;
state->plane_selected = 0;
@@ -634,7 +634,7 @@ ROM_END
static DRIVER_INIT( bigevglf )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0xff, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/bigfghtr.c b/src/mame/drivers/bigfghtr.c
index 0ec1be0b0c4..0173058fa35 100644
--- a/src/mame/drivers/bigfghtr.c
+++ b/src/mame/drivers/bigfghtr.c
@@ -146,7 +146,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int data = state->fg_videoram[tile_index];
SET_TILE_INFO(
1,
@@ -158,7 +158,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int data = state->bg_videoram[tile_index];
SET_TILE_INFO(
2,
@@ -169,7 +169,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int tile_number = state->text_videoram[tile_index] & 0xff;
int attributes;
@@ -184,7 +184,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
@@ -196,7 +196,7 @@ static VIDEO_START( bigfghtr )
static WRITE16_HANDLER(text_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->text_videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
@@ -204,7 +204,7 @@ static WRITE16_HANDLER(text_videoram_w )
static WRITE16_HANDLER( fg_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -212,7 +212,7 @@ static WRITE16_HANDLER( fg_videoram_w )
static WRITE16_HANDLER( bg_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -220,19 +220,19 @@ static WRITE16_HANDLER( bg_videoram_w )
static WRITE16_HANDLER( fg_scrollx_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrollx);
}
static WRITE16_HANDLER( fg_scrolly_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrolly);
}
static WRITE16_HANDLER( bg_scrollx_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_x);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x);
@@ -240,17 +240,17 @@ static WRITE16_HANDLER( bg_scrollx_w )
static WRITE16_HANDLER( bg_scrolly_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_y);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
int offs;
- for (offs = 0; offs < machine->generic.spriteram_size / 2; offs += 4)
+ for (offs = 0; offs < machine.generic.spriteram_size / 2; offs += 4)
{
int code = buffered_spriteram[offs + 1]; /* ??YX?TTTTTTTTTTT */
int flipx = code & 0x2000;
@@ -261,7 +261,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (((buffered_spriteram[offs + 0] & 0x3000) >> 12) == priority)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & 0xfff,
color,
flipx,flipy,
@@ -273,7 +273,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( bigfghtr )
{
- bigfghtr_state *state = screen->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = screen->machine().driver_data<bigfghtr_state>();
int sprite_enable = state->vreg & 0x200;
tilemap_set_enable(state->bg_tilemap, state->vreg & 0x800);
@@ -286,20 +286,20 @@ static SCREEN_UPDATE( bigfghtr )
if (state->vreg & 0x0800)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if(sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
if(sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
if (sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
@@ -308,7 +308,7 @@ static SCREEN_UPDATE( bigfghtr )
static SCREEN_EOF( bigfghtr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
@@ -321,16 +321,16 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( io_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->vreg);
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
}
static WRITE16_HANDLER( sharedram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->sharedram[offset]);
switch(offset)
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( sharedram_w )
static READ16_HANDLER(sharedram_r)
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
if(state->mcu_input_snippet)
{
@@ -354,21 +354,21 @@ static READ16_HANDLER(sharedram_r)
if(state->read_latch)
{
state->read_latch = 0;
- return space->machine->rand(); // TODO
+ return space->machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine, "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine, "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine, "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine, "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
}
}
@@ -380,20 +380,20 @@ static READ16_HANDLER(sharedram_r)
if(state->read_latch)
{
state->read_latch = 0;
- return space->machine->rand(); // TODO
+ return space->machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine, "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine, "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine, "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine, "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
/*
protection controls where the program code should jump to.
@@ -475,7 +475,7 @@ static READ16_HANDLER(sharedram_r)
static READ16_HANDLER( latch_r )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
state->read_latch = 1;
return 0;
@@ -655,7 +655,7 @@ GFXDECODE_END
static MACHINE_START( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->save_item(NAME(state->fg_scrollx));
state->save_item(NAME(state->fg_scrolly));
@@ -667,7 +667,7 @@ static MACHINE_START( bigfghtr )
static MACHINE_RESET( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->fg_scrollx = 0;
state->fg_scrolly = 0;
diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c
index bd97227c695..e57c22b610d 100644
--- a/src/mame/drivers/bingoc.c
+++ b/src/mame/drivers/bingoc.c
@@ -70,15 +70,15 @@ static READ16_HANDLER( bingoc_rand_r )
*/
static READ8_HANDLER( sound_test_r )
{
- bingoc_state *state = space->machine->driver_data<bingoc_state>();
+ bingoc_state *state = space->machine().driver_data<bingoc_state>();
- if(input_code_pressed_once(space->machine, KEYCODE_Z))
+ if(input_code_pressed_once(space->machine(), KEYCODE_Z))
state->x++;
- if(input_code_pressed_once(space->machine, KEYCODE_X))
+ if(input_code_pressed_once(space->machine(), KEYCODE_X))
state->x--;
- if(input_code_pressed_once(space->machine, KEYCODE_A))
+ if(input_code_pressed_once(space->machine(), KEYCODE_A))
return 0xff;
popmessage("%02x",state->x);
@@ -88,7 +88,7 @@ static READ8_HANDLER( sound_test_r )
static WRITE16_HANDLER( main_sound_latch_w )
{
soundlatch_w(space,0,data&0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
#endif
@@ -98,7 +98,7 @@ static WRITE8_DEVICE_HANDLER( bingoc_play_w )
---- --x- sound rom banking
---- ---x start-stop sample
*/
- UINT8 *upd = device->machine->region("upd")->base();
+ UINT8 *upd = device->machine().region("upd")->base();
memcpy(&upd[0x00000], &upd[0x20000 + (((data & 2)>>1) * 0x20000)], 0x20000);
upd7759_start_w(device, data & 1);
// printf("%02x\n",data);
diff --git a/src/mame/drivers/bingor.c b/src/mame/drivers/bingor.c
index f302824d4fa..498414626d0 100644
--- a/src/mame/drivers/bingor.c
+++ b/src/mame/drivers/bingor.c
@@ -459,10 +459,10 @@ static VIDEO_START(bingor)
static SCREEN_UPDATE(bingor)
{
- bingor_state *state = screen->machine->driver_data<bingor_state>();
+ bingor_state *state = screen->machine().driver_data<bingor_state>();
int x,y,count;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (0x2000/2);
@@ -475,22 +475,22 @@ static SCREEN_UPDATE(bingor)
color = (state->blit_ram[count] & 0xf000)>>12;
if((x+3)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+3) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+3) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x0f00)>>8;
if((x+2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+2) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+2) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x00f0)>>4;
if((x+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+1) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x000f)>>0;
if((x+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine().pens[color];
count++;
}
@@ -502,7 +502,7 @@ static SCREEN_UPDATE(bingor)
#if 0
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -523,7 +523,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( test8_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( pic_io_map, AS_IO, 8 )
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index b89cf4db002..e6c6cd40fff 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -73,7 +73,7 @@
static WRITE16_HANDLER( hacked_controls_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(space->cpu), offset, data);
COMBINE_DATA(&state->inp[offset]);
@@ -81,7 +81,7 @@ static WRITE16_HANDLER( hacked_controls_w )
static READ16_HANDLER( hacked_controls_r )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(space->cpu), offset, state->inp[offset]);
return state->inp[offset];
@@ -89,22 +89,22 @@ static READ16_HANDLER( hacked_controls_r )
static WRITE16_HANDLER( bionicc_mpu_trigger_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
- data = input_port_read(space->machine, "SYSTEM") >> 12;
+ data = input_port_read(space->machine(), "SYSTEM") >> 12;
state->inp[0] = data ^ 0x0f;
- data = input_port_read(space->machine, "P2");
+ data = input_port_read(space->machine(), "P2");
state->inp[1] = data ^ 0xff;
- data = input_port_read(space->machine, "P1");
+ data = input_port_read(space->machine(), "P1");
state->inp[2] = data ^ 0xff;
}
static WRITE16_HANDLER( hacked_soundcommand_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
COMBINE_DATA(&state->soundcommand);
soundlatch_w(space, 0, state->soundcommand & 0xff);
@@ -112,7 +112,7 @@ static WRITE16_HANDLER( hacked_soundcommand_w )
static READ16_HANDLER( hacked_soundcommand_r )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
return state->soundcommand;
}
@@ -335,7 +335,7 @@ GFXDECODE_END
static MACHINE_START( bionicc )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
state->save_item(NAME(state->soundcommand));
state->save_item(NAME(state->inp));
@@ -344,7 +344,7 @@ static MACHINE_START( bionicc )
static MACHINE_RESET( bionicc )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
state->inp[0] = 0;
state->inp[1] = 0;
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c
index 2c861498c0a..e8fd7c32820 100644
--- a/src/mame/drivers/bishi.c
+++ b/src/mame/drivers/bishi.c
@@ -92,27 +92,27 @@ Notes:
static READ16_HANDLER( control_r )
{
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
return state->cur_control;
}
static WRITE16_HANDLER( control_w )
{
// bit 8 = interrupt gate
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control);
}
static WRITE16_HANDLER( control2_w )
{
// bit 12 = part of the banking calculation for the K056832 ROM readback
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control2);
}
static INTERRUPT_GEN(bishi_interrupt)
{
- bishi_state *state = device->machine->driver_data<bishi_state>();
+ bishi_state *state = device->machine().driver_data<bishi_state>();
if (state->cur_control & 0x800)
{
switch (cpu_getiloops(device))
@@ -131,12 +131,12 @@ static INTERRUPT_GEN(bishi_interrupt)
/* compensate for a bug in the ram/rom test */
static READ16_HANDLER( bishi_mirror_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
static READ16_HANDLER( bishi_K056832_rom_r )
{
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
UINT16 ouroffs;
ouroffs = (offset >> 1) * 8;
@@ -369,7 +369,7 @@ INPUT_PORTS_END
static void sound_irq_gen(device_t *device, int state)
{
- bishi_state *bishi = device->machine->driver_data<bishi_state>();
+ bishi_state *bishi = device->machine().driver_data<bishi_state>();
if (state)
device_set_input_line(bishi->maincpu, M68K_IRQ_1, ASSERT_LINE);
else
@@ -400,12 +400,12 @@ static const k054338_interface bishi_k054338_intf =
static MACHINE_START( bishi )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
- state->maincpu = machine->device("maincpu");
- state->k056832 = machine->device("k056832");
- state->k054338 = machine->device("k054338");
- state->k055555 = machine->device("k055555");
+ state->maincpu = machine.device("maincpu");
+ state->k056832 = machine.device("k056832");
+ state->k054338 = machine.device("k054338");
+ state->k055555 = machine.device("k055555");
state->save_item(NAME(state->cur_control));
state->save_item(NAME(state->cur_control2));
@@ -413,7 +413,7 @@ static MACHINE_START( bishi )
static MACHINE_RESET( bishi )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
state->cur_control = 0;
state->cur_control2 = 0;
}
diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c
index 67e9586ce45..1db824f7548 100644
--- a/src/mame/drivers/bking.c
+++ b/src/mame/drivers/bking.c
@@ -25,20 +25,20 @@ DIP Locations verified for:
static READ8_HANDLER( bking_sndnmi_disable_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->sound_nmi_enable = 0;
return 0;
}
static WRITE8_HANDLER( bking_sndnmi_enable_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->sound_nmi_enable = 1;
}
static WRITE8_HANDLER( bking_soundlatch_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
int i, code = 0;
for (i = 0;i < 8;i++)
@@ -52,20 +52,20 @@ static WRITE8_HANDLER( bking_soundlatch_w )
static WRITE8_HANDLER( bking3_addr_l_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->addr_l = data;
}
static WRITE8_HANDLER( bking3_addr_h_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->addr_h = data;
}
static READ8_HANDLER( bking3_extrarom_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
- UINT8 *rom = space->machine->region("user2")->base();
+ bking_state *state = space->machine().driver_data<bking_state>();
+ UINT8 *rom = space->machine().region("user2")->base();
return rom[state->addr_h * 256 + state->addr_l];
}
@@ -147,40 +147,40 @@ ADDRESS_MAP_END
#if 0
static READ8_HANDLER( bking3_68705_port_a_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
//printf("port_a_r = %02X\n",(state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a));
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
static WRITE8_HANDLER( bking3_68705_port_a_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->port_a_out = data;
// printf("port_a_out = %02X\n",data);
}
static WRITE8_HANDLER( bking3_68705_ddr_a_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->ddr_a = data;
}
static READ8_HANDLER( bking3_68705_port_b_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
static WRITE8_HANDLER( bking3_68705_port_b_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
// if(data != 0xff)
// printf("port_b_out = %02X\n",data);
if (~data & 0x02)
{
state->port_a_in = from_main;
- if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ if (main_sent) cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
main_sent = 0;
}
@@ -199,7 +199,7 @@ static WRITE8_HANDLER( bking3_68705_port_b_w )
static WRITE8_HANDLER( bking3_68705_ddr_b_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->ddr_b = data;
}
@@ -402,9 +402,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
/* video */
state->save_item(NAME(state->pc3259_output));
@@ -428,7 +428,7 @@ static MACHINE_START( bking )
static MACHINE_START( bking3 )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
MACHINE_START_CALL(bking);
@@ -440,7 +440,7 @@ static MACHINE_START( bking3 )
static MACHINE_RESET( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
/* video */
state->pc3259_output[0] = 0;
@@ -467,7 +467,7 @@ static MACHINE_RESET( bking )
static MACHINE_RESET( bking3 )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
diff --git a/src/mame/drivers/blackt96.c b/src/mame/drivers/blackt96.c
index 1c1548617cd..80407aa1782 100644
--- a/src/mame/drivers/blackt96.c
+++ b/src/mame/drivers/blackt96.c
@@ -68,11 +68,11 @@ static VIDEO_START( blackt96 )
{
}
-static void draw_strip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int stripnum, int xbase, int ybase, int bg)
+static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int stripnum, int xbase, int ybase, int bg)
{
- blackt96_state *state = machine->driver_data<blackt96_state>();
- const gfx_element *gfxspr = machine->gfx[1];
- const gfx_element *gfxbg = machine->gfx[0];
+ blackt96_state *state = machine.driver_data<blackt96_state>();
+ const gfx_element *gfxspr = machine.gfx[1];
+ const gfx_element *gfxbg = machine.gfx[0];
int base = stripnum;
int count = 0;
@@ -98,9 +98,9 @@ static void draw_strip(running_machine *machine, bitmap_t *bitmap, const rectang
}
-static void draw_main(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bg)
+static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bg)
{
- blackt96_state *state = machine->driver_data<blackt96_state>();
+ blackt96_state *state = machine.driver_data<blackt96_state>();
int x;
@@ -130,15 +130,15 @@ static void draw_main(running_machine *machine, bitmap_t *bitmap, const rectangl
static SCREEN_UPDATE( blackt96 )
{
- blackt96_state *state = screen->machine->driver_data<blackt96_state>();
+ blackt96_state *state = screen->machine().driver_data<blackt96_state>();
int count;
int x,y;
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- draw_main(screen->machine,bitmap,cliprect,1);
- draw_main(screen->machine,bitmap,cliprect,0);
+ draw_main(screen->machine(),bitmap,cliprect,1);
+ draw_main(screen->machine(),bitmap,cliprect,0);
/* Text Layer */
count = 0;
@@ -455,7 +455,7 @@ static WRITE8_HANDLER( blackt96_soundio_port00_w )
static READ8_HANDLER( blackt96_soundio_port01_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( blackt96_soundio_port01_w )
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( blackt96_soundio_port01_w )
static READ8_HANDLER( blackt96_soundio_port02_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( blackt96_soundio_port02_w )
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 93efc8a03dd..83fe17b214a 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -38,7 +38,7 @@
static INTERRUPT_GEN( bladestl_interrupt )
{
- bladestl_state *state = device->machine->driver_data<bladestl_state>();
+ bladestl_state *state = device->machine().driver_data<bladestl_state>();
if (cpu_getiloops(device) == 0)
{
@@ -59,11 +59,11 @@ static INTERRUPT_GEN( bladestl_interrupt )
static READ8_HANDLER( trackball_r )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
int curr, delta;
- curr = input_port_read(space->machine, port[offset]);
+ curr = input_port_read(space->machine(), port[offset]);
delta = (curr - state->last_track[offset]) & 0xff;
state->last_track[offset] = curr;
@@ -72,20 +72,20 @@ static READ8_HANDLER( trackball_r )
static WRITE8_HANDLER( bladestl_bankswitch_w )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bits 2 & 3 = lamps */
- set_led_status(space->machine, 0,data & 0x04);
- set_led_status(space->machine, 1,data & 0x08);
+ set_led_status(space->machine(), 0,data & 0x04);
+ set_led_status(space->machine(), 1,data & 0x08);
/* bit 4 = relay (???) */
/* bits 5-6 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0x60) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0x60) >> 5);
/* bit 7 = select sprite bank */
state->spritebank = (data & 0x80) << 3;
@@ -94,7 +94,7 @@ static WRITE8_HANDLER( bladestl_bankswitch_w )
static WRITE8_HANDLER( bladestl_sh_irqtrigger_w )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
@@ -306,14 +306,14 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( bladestl )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007342 = machine->device("k007342");
- state->k007420 = machine->device("k007420");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007342 = machine.device("k007342");
+ state->k007420 = machine.device("k007420");
state->save_item(NAME(state->spritebank));
state->save_item(NAME(state->layer_colorbase));
@@ -322,7 +322,7 @@ static MACHINE_START( bladestl )
static MACHINE_RESET( bladestl )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
int i;
state->layer_colorbase[0] = 0;
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index fcca0adc0f0..33cf5d196d4 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -313,14 +313,14 @@ public:
static WRITE8_HANDLER( megadpkr_videoram_w )
{
- blitz_state *state = space->machine->driver_data<blitz_state>();
+ blitz_state *state = space->machine().driver_data<blitz_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( megadpkr_colorram_w )
{
- blitz_state *state = space->machine->driver_data<blitz_state>();
+ blitz_state *state = space->machine().driver_data<blitz_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -328,7 +328,7 @@ static WRITE8_HANDLER( megadpkr_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- blitz_state *state = machine->driver_data<blitz_state>();
+ blitz_state *state = machine.driver_data<blitz_state>();
/* - bits -
7654 3210
--xx xx-- tiles color.
@@ -348,13 +348,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( megadpkr )
{
- blitz_state *state = machine->driver_data<blitz_state>();
+ blitz_state *state = machine.driver_data<blitz_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( megadpkr )
{
- blitz_state *state = screen->machine->driver_data<blitz_state>();
+ blitz_state *state = screen->machine().driver_data<blitz_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -380,7 +380,7 @@ static PALETTE_INIT( megadpkr )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -416,13 +416,13 @@ static PALETTE_INIT( megadpkr )
*/
static READ8_DEVICE_HANDLER( megadpkr_mux_port_r )
{
- blitz_state *state = device->machine->driver_data<blitz_state>();
+ blitz_state *state = device->machine().driver_data<blitz_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
}
@@ -430,7 +430,7 @@ static READ8_DEVICE_HANDLER( megadpkr_mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- blitz_state *state = device->machine->driver_data<blitz_state>();
+ blitz_state *state = device->machine().driver_data<blitz_state>();
state->mux_data = data ^ 0xff; /* inverted */
}
@@ -449,9 +449,9 @@ static WRITE8_DEVICE_HANDLER( lamps_a_w )
// output_set_lamp_value(4, 1 - ((data >> 4) & 1)); /* Lamp 4 */
// popmessage("written : %02X", data);
-// coin_counter_w(device->machine, 0, data & 0x40); /* counter1 */
-// coin_counter_w(device->machine, 1, data & 0x80); /* counter2 */
-// coin_counter_w(device->machine, 2, data & 0x20); /* counter3 */
+// coin_counter_w(device->machine(), 0, data & 0x40); /* counter1 */
+// coin_counter_w(device->machine(), 1, data & 0x80); /* counter2 */
+// coin_counter_w(device->machine(), 2, data & 0x20); /* counter3 */
/* Counters:
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index 33bf829dfbd..b8901047a03 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -78,7 +78,7 @@ struct blit_t
static VIDEO_START(blitz68k)
{
- blitz68k_state *state = machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = machine.driver_data<blitz68k_state>();
state->blit_buffer = auto_alloc_array(machine, UINT8, 512*256);
blit.addr_factor = 2;
}
@@ -91,7 +91,7 @@ static VIDEO_START(blitz68k_addr_factor1)
static SCREEN_UPDATE(blitz68k)
{
- blitz68k_state *state = screen->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = screen->machine().driver_data<blitz68k_state>();
int x,y;
UINT8 *src = state->blit_buffer;
@@ -100,7 +100,7 @@ static SCREEN_UPDATE(blitz68k)
{
for(x = 0; x < 512; x++)
{
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[*src++];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[*src++];
}
}
@@ -112,7 +112,7 @@ static SCREEN_UPDATE(blitz68k)
static SCREEN_UPDATE(blitz68k_noblit)
{
- blitz68k_state *state = screen->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = screen->machine().driver_data<blitz68k_state>();
int x,y;
UINT16 *src = state->frame_buffer;
@@ -122,10 +122,10 @@ static SCREEN_UPDATE(blitz68k_noblit)
for(x = 0; x < 512; )
{
UINT16 pen = *src++;
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 8) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 12) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 0) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 4) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 8) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 12) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 0) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 4) & 0xf];
}
}
@@ -140,7 +140,7 @@ static SCREEN_UPDATE(blitz68k_noblit)
static WRITE16_HANDLER( paletteram_io_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
int pal_data;
switch(offset*2)
@@ -167,7 +167,7 @@ static WRITE16_HANDLER( paletteram_io_w )
case 2:
pal_data = (data & 0xff00) >> 8;
state->pal.b = ((pal_data & 0x3f) << 2) | ((pal_data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -187,7 +187,7 @@ static WRITE16_HANDLER( paletteram_io_w )
static WRITE8_HANDLER( paletteram_bt476_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
switch(offset)
{
case 0:
@@ -213,7 +213,7 @@ static WRITE8_HANDLER( paletteram_bt476_w )
break;
case 2:
state->btpal.b = data << 2;
- palette_set_color(space->machine, state->btpal.offs, MAKE_RGB(state->btpal.r, state->btpal.g, state->btpal.b));
+ palette_set_color(space->machine(), state->btpal.offs, MAKE_RGB(state->btpal.r, state->btpal.g, state->btpal.b));
state->btpal.offs_internal = 0;
state->btpal.offs++;
break;
@@ -224,7 +224,7 @@ static WRITE8_HANDLER( paletteram_bt476_w )
static READ8_HANDLER( paletteram_bt476_r )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
UINT8 ret = 0xff;
switch(offset)
@@ -267,8 +267,8 @@ static READ8_HANDLER( paletteram_bt476_r )
static WRITE16_HANDLER( blit_copy_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
- UINT8 *blit_rom = space->machine->region("blitter")->base();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
+ UINT8 *blit_rom = space->machine().region("blitter")->base();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x,y,x_size,y_size;
@@ -456,15 +456,15 @@ static WRITE8_HANDLER( blit_flags_w )
static WRITE8_HANDLER( blit_draw_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
- UINT8 *blit_rom = space->machine->region("blitter")->base();
- int blit_romsize = space->machine->region("blitter")->bytes();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
+ UINT8 *blit_rom = space->machine().region("blitter")->base();
+ int blit_romsize = space->machine().region("blitter")->bytes();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x, y, x_size, y_size;
UINT32 src;
- logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", space->machine->describe_context(),
+ logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", space->machine().describe_context(),
blit.x, blit.y, blit.w, blit.h,
blit.addr[2], blit.addr[1], blit.addr[0],
blit.pen[0], blit.pen[1], blit.pen[2], blit.pen[3],
@@ -577,14 +577,14 @@ static WRITE16_HANDLER( lamps_w )
static READ16_HANDLER( test_r )
{
- return 0xffff;//space->machine->rand();
+ return 0xffff;//space->machine().rand();
}
#if 0
static WRITE16_HANDLER( irq_callback_w )
{
// popmessage("%02x",data);
- cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE );
}
static WRITE16_HANDLER( sound_write_w )
@@ -657,14 +657,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( bankrob_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( bankrob_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -680,11 +680,11 @@ static READ8_HANDLER( bankrob_mcu_status_write_r )
static WRITE8_HANDLER( bankrob_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( bankrob_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( bankrob_map, AS_PROGRAM, 16 )
@@ -740,14 +740,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( bankroba_mcu1_r )
{
- UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = space->machine().rand(); // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( bankroba_mcu2_r )
{
- UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = space->machine().rand(); // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -762,11 +762,11 @@ static READ8_HANDLER( bankroba_mcu2_status_write_r )
static WRITE8_HANDLER( bankroba_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( bankroba_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( bankroba_map, AS_PROGRAM, 16 )
@@ -828,14 +828,14 @@ static WRITE16_HANDLER( cjffruit_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
- set_led_status(space->machine, 0, data & 0x0200); // win???
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
+ set_led_status(space->machine(), 0, data & 0x0200); // win???
// 1 data & 0x0400 // win???
- set_led_status(space->machine, 2, data & 0x0800); // small
- set_led_status(space->machine, 3, data & 0x1000); // big
- set_led_status(space->machine, 4, data & 0x2000); // take
- set_led_status(space->machine, 5, data & 0x4000); // double up
- set_led_status(space->machine, 6, data & 0x8000); // cancel
+ set_led_status(space->machine(), 2, data & 0x0800); // small
+ set_led_status(space->machine(), 3, data & 0x1000); // big
+ set_led_status(space->machine(), 4, data & 0x2000); // take
+ set_led_status(space->machine(), 5, data & 0x4000); // double up
+ set_led_status(space->machine(), 6, data & 0x8000); // cancel
show_leds123();
}
}
@@ -845,14 +845,14 @@ static WRITE16_HANDLER( cjffruit_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // start
- set_led_status(space->machine, 8, data & 0x0200); // bet
- set_led_status(space->machine, 9, data & 0x0400); // hold 5
- set_led_status(space->machine, 10, data & 0x0800); // hold 4
- set_led_status(space->machine, 11, data & 0x1000); // hold 3
- set_led_status(space->machine, 12, data & 0x2000); // hold 2
- set_led_status(space->machine, 13, data & 0x4000); // collect
- set_led_status(space->machine, 14, data & 0x8000); // call attendant
+ set_led_status(space->machine(), 7, data & 0x0100); // start
+ set_led_status(space->machine(), 8, data & 0x0200); // bet
+ set_led_status(space->machine(), 9, data & 0x0400); // hold 5
+ set_led_status(space->machine(), 10, data & 0x0800); // hold 4
+ set_led_status(space->machine(), 11, data & 0x1000); // hold 3
+ set_led_status(space->machine(), 12, data & 0x2000); // hold 2
+ set_led_status(space->machine(), 13, data & 0x4000); // collect
+ set_led_status(space->machine(), 14, data & 0x8000); // call attendant
show_leds123();
}
}
@@ -862,8 +862,8 @@ static WRITE16_HANDLER( cjffruit_leds3_w )
data = COMBINE_DATA(leds3);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 15, data & 0x0100); // hopper coins?
- set_led_status(space->machine, 16, data & 0x0400); // coin out?
+ set_led_status(space->machine(), 15, data & 0x0100); // hopper coins?
+ set_led_status(space->machine(), 16, data & 0x0400); // coin out?
show_leds123();
}
}
@@ -896,14 +896,14 @@ static WRITE16_DEVICE_HANDLER( crtc_lpen_w )
// MCU simulation (to be done)
static READ16_HANDLER( cjffruit_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( cjffruit_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static ADDRESS_MAP_START( cjffruit_map, AS_PROGRAM, 16 )
@@ -947,14 +947,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ16_HANDLER( deucesw2_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( deucesw2_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static WRITE16_HANDLER( deucesw2_leds1_w )
@@ -962,14 +962,14 @@ static WRITE16_HANDLER( deucesw2_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
- set_led_status(space->machine, 0, data & 0x0200); // win???
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
+ set_led_status(space->machine(), 0, data & 0x0200); // win???
// 1 data & 0x0400 // win???
- set_led_status(space->machine, 2, data & 0x0800); // small
- set_led_status(space->machine, 3, data & 0x1000); // big
- set_led_status(space->machine, 4, data & 0x2000); // take
- set_led_status(space->machine, 5, data & 0x4000); // double up
- set_led_status(space->machine, 6, data & 0x8000); // cancel
+ set_led_status(space->machine(), 2, data & 0x0800); // small
+ set_led_status(space->machine(), 3, data & 0x1000); // big
+ set_led_status(space->machine(), 4, data & 0x2000); // take
+ set_led_status(space->machine(), 5, data & 0x4000); // double up
+ set_led_status(space->machine(), 6, data & 0x8000); // cancel
show_leds123();
}
}
@@ -979,14 +979,14 @@ static WRITE16_HANDLER( deucesw2_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // start
- set_led_status(space->machine, 8, data & 0x0200); // bet
- set_led_status(space->machine, 9, data & 0x0400); // hold 5
- set_led_status(space->machine, 10, data & 0x0800); // hold 4
- set_led_status(space->machine, 11, data & 0x1000); // hold 3
- set_led_status(space->machine, 12, data & 0x2000); // hold 2
- set_led_status(space->machine, 13, data & 0x4000); // hold 1
- set_led_status(space->machine, 14, data & 0x8000); // call attendant
+ set_led_status(space->machine(), 7, data & 0x0100); // start
+ set_led_status(space->machine(), 8, data & 0x0200); // bet
+ set_led_status(space->machine(), 9, data & 0x0400); // hold 5
+ set_led_status(space->machine(), 10, data & 0x0800); // hold 4
+ set_led_status(space->machine(), 11, data & 0x1000); // hold 3
+ set_led_status(space->machine(), 12, data & 0x2000); // hold 2
+ set_led_status(space->machine(), 13, data & 0x4000); // hold 1
+ set_led_status(space->machine(), 14, data & 0x8000); // call attendant
show_leds123();
}
}
@@ -996,8 +996,8 @@ static WRITE16_HANDLER( deucesw2_leds3_w )
data = COMBINE_DATA(leds3);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 15, data & 0x0100); // hopper coins?
- set_led_status(space->machine, 16, data & 0x0400); // coin out?
+ set_led_status(space->machine(), 15, data & 0x0100); // hopper coins?
+ set_led_status(space->machine(), 16, data & 0x0400); // coin out?
show_leds123();
}
}
@@ -1043,14 +1043,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( dualgame_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( dualgame_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -1066,11 +1066,11 @@ static READ8_HANDLER( dualgame_mcu_status_write_r )
static WRITE8_HANDLER( dualgame_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( dualgame_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( dualgame_map, AS_PROGRAM, 16 )
@@ -1131,14 +1131,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ16_HANDLER( hermit_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( hermit_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static WRITE16_HANDLER( hermit_leds1_w )
@@ -1146,7 +1146,7 @@ static WRITE16_HANDLER( hermit_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
show_leds12();
}
}
@@ -1156,7 +1156,7 @@ static WRITE16_HANDLER( hermit_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // button
+ set_led_status(space->machine(), 7, data & 0x0100); // button
show_leds12();
}
}
@@ -1164,12 +1164,12 @@ static WRITE16_HANDLER( hermit_leds2_w )
static READ16_HANDLER( hermit_track_r )
{
#ifdef MAME_DEBUG
-// popmessage("track %02x %02x", input_port_read(space->machine, "TRACK_X"), input_port_read(space->machine, "TRACK_Y"));
+// popmessage("track %02x %02x", input_port_read(space->machine(), "TRACK_X"), input_port_read(space->machine(), "TRACK_Y"));
#endif
return
- ((0xf - ((input_port_read(space->machine, "TRACK_Y") + 0x7) & 0xf)) << 12) |
- ((0xf - ((input_port_read(space->machine, "TRACK_X") + 0x7) & 0xf)) << 8) ;
+ ((0xf - ((input_port_read(space->machine(), "TRACK_Y") + 0x7) & 0xf)) << 12) |
+ ((0xf - ((input_port_read(space->machine(), "TRACK_X") + 0x7) & 0xf)) << 8) ;
}
static ADDRESS_MAP_START( hermit_map, AS_PROGRAM, 16 )
@@ -1210,14 +1210,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( maxidbl_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( maxidbl_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -1233,11 +1233,11 @@ static READ8_HANDLER( maxidbl_mcu_status_write_r )
static WRITE8_HANDLER( maxidbl_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( maxidbl_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( maxidbl_map, AS_PROGRAM, 16 )
@@ -1622,17 +1622,17 @@ static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq1)
{
- cputag_set_input_line(device->machine, "maincpu", 1, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 1, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq3)
{
- cputag_set_input_line(device->machine, "maincpu", 3, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 3, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq5)
{
- cputag_set_input_line(device->machine, "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
}
const mc6845_interface mc6845_intf_irq1 =
@@ -1721,7 +1721,7 @@ MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK( steaser_mcu_sim )
{
- blitz68k_state *state = timer.machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = timer.machine().driver_data<blitz68k_state>();
// static int i;
/*first off, signal the "MCU is running" flag*/
state->m_nvram[0x932/2] = 0xffff;
@@ -1729,14 +1729,14 @@ static TIMER_DEVICE_CALLBACK( steaser_mcu_sim )
// for(i=0;i<8;i+=2)
// state->m_nvram[((0x8a0)+i)/2] = 0;
/*finally, read the inputs*/
- state->m_nvram[0x89e/2] = input_port_read(timer.machine, "MENU") & 0xffff;
- state->m_nvram[0x8a0/2] = input_port_read(timer.machine, "STAT") & 0xffff;
- state->m_nvram[0x8a2/2] = input_port_read(timer.machine, "BET_DEAL") & 0xffff;
- state->m_nvram[0x8a4/2] = input_port_read(timer.machine, "TAKE_DOUBLE") & 0xffff;
- state->m_nvram[0x8a6/2] = input_port_read(timer.machine, "SMALL_BIG") & 0xffff;
- state->m_nvram[0x8a8/2] = input_port_read(timer.machine, "CANCEL_HOLD1") & 0xffff;
- state->m_nvram[0x8aa/2] = input_port_read(timer.machine, "HOLD2_HOLD3") & 0xffff;
- state->m_nvram[0x8ac/2] = input_port_read(timer.machine, "HOLD4_HOLD5") & 0xffff;
+ state->m_nvram[0x89e/2] = input_port_read(timer.machine(), "MENU") & 0xffff;
+ state->m_nvram[0x8a0/2] = input_port_read(timer.machine(), "STAT") & 0xffff;
+ state->m_nvram[0x8a2/2] = input_port_read(timer.machine(), "BET_DEAL") & 0xffff;
+ state->m_nvram[0x8a4/2] = input_port_read(timer.machine(), "TAKE_DOUBLE") & 0xffff;
+ state->m_nvram[0x8a6/2] = input_port_read(timer.machine(), "SMALL_BIG") & 0xffff;
+ state->m_nvram[0x8a8/2] = input_port_read(timer.machine(), "CANCEL_HOLD1") & 0xffff;
+ state->m_nvram[0x8aa/2] = input_port_read(timer.machine(), "HOLD2_HOLD3") & 0xffff;
+ state->m_nvram[0x8ac/2] = input_port_read(timer.machine(), "HOLD4_HOLD5") & 0xffff;
}
/* TODO: remove this hack.*/
@@ -2688,7 +2688,7 @@ ROM_END
static DRIVER_INIT( bankrob )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xb5e0/2] = 0x6028;
@@ -2703,7 +2703,7 @@ static DRIVER_INIT( bankrob )
static DRIVER_INIT( bankroba )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0x11e4e/2] = 0x6028;
@@ -2718,7 +2718,7 @@ static DRIVER_INIT( bankroba )
static DRIVER_INIT( cjffruit )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xf564/2] = 0x6028;
@@ -2729,7 +2729,7 @@ static DRIVER_INIT( cjffruit )
static DRIVER_INIT( deucesw2 )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0x8fe4/2] = 0x6020;
@@ -2740,7 +2740,7 @@ static DRIVER_INIT( deucesw2 )
static DRIVER_INIT( dualgame )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xa518/2] = 0x6024;
@@ -2751,7 +2751,7 @@ static DRIVER_INIT( dualgame )
static DRIVER_INIT( hermit )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xdeba/2] = 0x602e;
@@ -2768,7 +2768,7 @@ static DRIVER_INIT( hermit )
static DRIVER_INIT( maxidbl )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xb384/2] = 0x6036;
@@ -2779,7 +2779,7 @@ static DRIVER_INIT( maxidbl )
static DRIVER_INIT( megadblj )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xe21c/2] = 0x6040;
@@ -2790,7 +2790,7 @@ static DRIVER_INIT( megadblj )
static DRIVER_INIT( megadble )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xcfc2/2] = 0x4e71;
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index 38609168b2b..668221349b0 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -28,20 +28,20 @@ Protection comms between main cpu and i8751
static READ8_HANDLER( blktiger_from_mcu_r )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
return state->i8751_latch;
}
static WRITE8_HANDLER( blktiger_to_mcu_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
state->z80_latch = data;
}
static READ8_HANDLER( blktiger_from_main_r )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
//printf("%02x read\n",latch);
return state->z80_latch;
@@ -49,7 +49,7 @@ static READ8_HANDLER( blktiger_from_main_r )
static WRITE8_HANDLER( blktiger_to_main_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
//printf("%02x write\n",data);
state->i8751_latch = data;
}
@@ -58,15 +58,15 @@ static WRITE8_HANDLER( blktiger_to_main_w )
static WRITE8_HANDLER( blktiger_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( blktiger_coinlockout_w )
{
- if (input_port_read(space->machine, "COIN_LOCKOUT") & 0x01)
+ if (input_port_read(space->machine(), "COIN_LOCKOUT") & 0x01)
{
- coin_lockout_w(space->machine, 0,~data & 0x01);
- coin_lockout_w(space->machine, 1,~data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x01);
+ coin_lockout_w(space->machine(), 1,~data & 0x02);
}
}
@@ -265,7 +265,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- blktiger_state *state = device->machine->driver_data<blktiger_state>();
+ blktiger_state *state = device->machine().driver_data<blktiger_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -281,13 +281,13 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( blktiger )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
/* configure bankswitching */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->scroll_bank));
state->save_item(NAME(state->screen_layout));
@@ -302,10 +302,10 @@ static MACHINE_START( blktiger )
static MACHINE_RESET( blktiger )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
/* configure bankswitching */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->scroll_x[0] = 0;
state->scroll_x[1] = 0;
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index 7d0928aceec..c448941df8f 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -43,7 +43,7 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000);
}
}
@@ -60,15 +60,15 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
- state->pot_wheel = ~input_port_read(space->machine, "WHEEL") & 0xff;
+ state->pot_wheel = ~input_port_read(space->machine(), "WHEEL") & 0xff;
}
static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
{
@@ -80,8 +80,8 @@ static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
static READ16_HANDLER( blmbycar_pot_wheel_r )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
- return ((state->pot_wheel & 0x80) ? 0x04 : 0) | (space->machine->rand() & 0x08);
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
+ return ((state->pot_wheel & 0x80) ? 0x04 : 0) | (space->machine().rand() & 0x08);
}
@@ -89,7 +89,7 @@ static READ16_HANDLER( blmbycar_pot_wheel_r )
static READ16_HANDLER( blmbycar_opt_wheel_r )
{
- return (~input_port_read(space->machine, "WHEEL") & 0xff) << 8;
+ return (~input_port_read(space->machine(), "WHEEL") & 0xff) << 8;
}
@@ -130,7 +130,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( waterball_unk_r )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
state->retvalue ^= 0x0008; // must toggle.. but not vblank?
return state->retvalue;
@@ -341,7 +341,7 @@ GFXDECODE_END
static MACHINE_START( blmbycar )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->save_item(NAME(state->pot_wheel));
state->save_item(NAME(state->old_val));
@@ -349,7 +349,7 @@ static MACHINE_START( blmbycar )
static MACHINE_RESET( blmbycar )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->pot_wheel = 0;
state->old_val = 0;
@@ -391,14 +391,14 @@ MACHINE_CONFIG_END
static MACHINE_START( watrball )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->save_item(NAME(state->retvalue));
}
static MACHINE_RESET( watrball )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->retvalue = 0;
}
@@ -527,8 +527,8 @@ ROM_END
static DRIVER_INIT( blmbycar )
{
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes() / 2;
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes() / 2;
int i;
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/blockade.c b/src/mame/drivers/blockade.c
index 3c84bb81967..dd193d24cec 100644
--- a/src/mame/drivers/blockade.c
+++ b/src/mame/drivers/blockade.c
@@ -60,10 +60,10 @@
static INTERRUPT_GEN( blockade_interrupt )
{
- blockade_state *state = device->machine->driver_data<blockade_state>();
+ blockade_state *state = device->machine().driver_data<blockade_state>();
device_resume(device, SUSPEND_ANY_REASON);
- if ((input_port_read(device->machine, "IN0") & 0x80) == 0)
+ if ((input_port_read(device->machine(), "IN0") & 0x80) == 0)
{
state->just_been_reset = 1;
device_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE);
@@ -78,16 +78,16 @@ static INTERRUPT_GEN( blockade_interrupt )
static READ8_HANDLER( blockade_input_port_0_r )
{
- blockade_state *state = space->machine->driver_data<blockade_state>();
+ blockade_state *state = space->machine().driver_data<blockade_state>();
/* coin latch is bit 7 */
- UINT8 temp = (input_port_read(space->machine, "IN0") & 0x7f);
+ UINT8 temp = (input_port_read(space->machine(), "IN0") & 0x7f);
return (state->coin_latch << 7) | temp;
}
static WRITE8_HANDLER( blockade_coin_latch_w )
{
- blockade_state *state = space->machine->driver_data<blockade_state>();
+ blockade_state *state = space->machine().driver_data<blockade_state>();
if (data & 0x80)
{
@@ -456,7 +456,7 @@ static PALETTE_INIT( blockade )
static MACHINE_START( blockade )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
state->save_item(NAME(state->coin_latch));
state->save_item(NAME(state->just_been_reset));
@@ -464,7 +464,7 @@ static MACHINE_START( blockade )
static MACHINE_RESET( blockade )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
state->coin_latch = 1;
state->just_been_reset = 0;
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 381761c6e20..131534a78e6 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -32,7 +32,7 @@ static KONAMI_SETLINES_CALLBACK( blockhl_banking );
static INTERRUPT_GEN( blockhl_interrupt )
{
- blockhl_state *state = device->machine->driver_data<blockhl_state>();
+ blockhl_state *state = device->machine().driver_data<blockhl_state>();
if (k052109_is_irq_enabled(state->k052109) && state->rombank == 0) /* kludge to prevent crashes */
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -40,17 +40,17 @@ static INTERRUPT_GEN( blockhl_interrupt )
static READ8_HANDLER( bankedram_r )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -60,7 +60,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -68,7 +68,7 @@ static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -85,7 +85,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -193,15 +193,15 @@ static const k051960_interface blockhl_k051960_intf =
static MACHINE_START( blockhl )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->palette_selected));
state->save_item(NAME(state->rombank));
@@ -209,9 +209,9 @@ static MACHINE_START( blockhl )
static MACHINE_RESET( blockhl )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
- konami_configure_set_lines(machine->device("maincpu"), blockhl_banking);
+ konami_configure_set_lines(machine.device("maincpu"), blockhl_banking);
state->palette_selected = 0;
state->rombank = 0;
@@ -320,15 +320,15 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( blockhl_banking )
{
- blockhl_state *state = device->machine->driver_data<blockhl_state>();
+ blockhl_state *state = device->machine().driver_data<blockhl_state>();
/* bits 0-1 = ROM bank */
state->rombank = lines & 0x03;
- memory_set_bank(device->machine, "bank1", state->rombank);
+ memory_set_bank(device->machine(), "bank1", state->rombank);
/* bits 3/4 = coin counters */
- coin_counter_w(device->machine, 0, lines & 0x08);
- coin_counter_w(device->machine, 1, lines & 0x10);
+ coin_counter_w(device->machine(), 0, lines & 0x08);
+ coin_counter_w(device->machine(), 1, lines & 0x10);
/* bit 5 = select palette RAM or work RAM at 5800-5fff */
state->palette_selected = ~lines & 0x20;
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index eabacbd0bb7..a02b7483228 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -83,7 +83,7 @@ static INTERRUPT_GEN( blockout_interrupt )
static WRITE16_HANDLER( blockout_sound_command_w )
{
- blockout_state *state = space->machine->driver_data<blockout_state>();
+ blockout_state *state = space->machine().driver_data<blockout_state>();
if (ACCESSING_BITS_0_7)
{
@@ -237,7 +237,7 @@ INPUT_PORTS_END
/* handler called by the 2151 emulator when the internal timers cause an IRQ */
static void blockout_irq_handler(device_t *device, int irq)
{
- blockout_state *state = device->machine->driver_data<blockout_state>();
+ blockout_state *state = device->machine().driver_data<blockout_state>();
device_set_input_line_and_vector(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
}
@@ -255,16 +255,16 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( blockout )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->color));
}
static MACHINE_RESET( blockout )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
state->color = 0;
}
diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c
index 9d4dd98fa55..87e0a0780bc 100644
--- a/src/mame/drivers/blstroid.c
+++ b/src/mame/drivers/blstroid.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
static WRITE16_HANDLER( blstroid_halt_until_hblank_0_w )
{
- atarigen_halt_until_hblank_0(*space->machine->primary_screen);
+ atarigen_halt_until_hblank_0(*space->machine().primary_screen);
}
@@ -54,11 +54,11 @@ static MACHINE_START( blstroid )
static MACHINE_RESET( blstroid )
{
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, blstroid_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, blstroid_scanline_update, 8);
atarijsa_reset();
}
@@ -73,11 +73,11 @@ static MACHINE_RESET( blstroid )
static READ16_HANDLER( inputs_r )
{
static const char *const iptnames[] = { "IN0", "IN1" };
- blstroid_state *state = space->machine->driver_data<blstroid_state>();
- int temp = input_port_read(space->machine, iptnames[offset & 1]);
+ blstroid_state *state = space->machine().driver_data<blstroid_state>();
+ int temp = input_port_read(space->machine(), iptnames[offset & 1]);
if (state->cpu_to_sound_ready) temp ^= 0x0040;
- if (atarigen_get_hblank(*space->machine->primary_screen)) temp ^= 0x0010;
+ if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0010;
return temp;
}
diff --git a/src/mame/drivers/blueprnt.c b/src/mame/drivers/blueprnt.c
index 53e19343d8f..9d7f2a68603 100644
--- a/src/mame/drivers/blueprnt.c
+++ b/src/mame/drivers/blueprnt.c
@@ -60,27 +60,27 @@
static WRITE8_DEVICE_HANDLER( dipsw_w )
{
- blueprnt_state *state = device->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = device->machine().driver_data<blueprnt_state>();
state->dipsw = data;
}
static READ8_HANDLER( blueprnt_sh_dipsw_r )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
return state->dipsw;
}
static WRITE8_HANDLER( blueprnt_sound_command_w )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( blueprnt_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
/*************************************
@@ -281,16 +281,16 @@ static const ay8910_interface ay8910_interface_2 =
static MACHINE_START( blueprnt )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->dipsw));
}
static MACHINE_RESET( blueprnt )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
state->gfx_bank = 0;
state->dipsw = 0;
diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c
index 2fe318c084d..e4573186c20 100644
--- a/src/mame/drivers/bmcbowl.c
+++ b/src/mame/drivers/bmcbowl.c
@@ -134,14 +134,14 @@ static VIDEO_START( bmcbowl )
static SCREEN_UPDATE( bmcbowl )
{
- bmcbowl_state *state = screen->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = screen->machine().driver_data<bmcbowl_state>();
/*
280x230,4 bitmap layers, 8bpp,
missing scroll and priorities (maybe fixed ones)
*/
int x,y,z,pixdat;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
z=0;
for (y=0;y<230;y++)
@@ -184,7 +184,7 @@ static SCREEN_UPDATE( bmcbowl )
static READ16_HANDLER( bmc_random_read )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER( bmc_protection_r )
@@ -201,20 +201,20 @@ static READ16_HANDLER( bmc_protection_r )
break;
}
logerror("Protection read @ %X\n",cpu_get_previouspc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER( bmc_RAMDAC_offset_w )
{
- bmcbowl_state *state = space->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = space->machine().driver_data<bmcbowl_state>();
state->clr_offset=data*3;
}
static WRITE16_HANDLER( bmc_RAMDAC_color_w )
{
- bmcbowl_state *state = space->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = space->machine().driver_data<bmcbowl_state>();
state->bmc_colorram[state->clr_offset]=data;
- palette_set_color_rgb(space->machine,state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
+ palette_set_color_rgb(space->machine(),state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
state->clr_offset=(state->clr_offset+1)%768;
}
@@ -226,7 +226,7 @@ static WRITE16_HANDLER( scroll_w )
static READ8_DEVICE_HANDLER(via_b_in)
{
- return input_port_read(device->machine, "IN3");
+ return input_port_read(device->machine(), "IN3");
}
@@ -299,7 +299,7 @@ static void init_stats(bmcbowl_state *state, const UINT8 *table, int table_len,
static NVRAM_HANDLER( bmcbowl )
{
- bmcbowl_state *state = machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = machine.driver_data<bmcbowl_state>();
int i;
if (read_or_write)
@@ -446,20 +446,20 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER(dips1_r)
{
- bmcbowl_state *state = device->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
switch(state->bmc_input)
{
- case 0x00: return input_port_read(device->machine, "IN1");
- case 0x40: return input_port_read(device->machine, "IN2");
+ case 0x00: return input_port_read(device->machine(), "IN1");
+ case 0x40: return input_port_read(device->machine(), "IN2");
}
- logerror("%s:unknown input - %X\n",device->machine->describe_context(),state->bmc_input);
+ logerror("%s:unknown input - %X\n",device->machine().describe_context(),state->bmc_input);
return 0xff;
}
static WRITE8_DEVICE_HANDLER(input_mux_w)
{
- bmcbowl_state *state = device->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
state->bmc_input=data;
}
@@ -552,7 +552,7 @@ ROM_END
static DRIVER_INIT(bmcbowl)
{
- bmcbowl_state *state = machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = machine.driver_data<bmcbowl_state>();
state->bmc_colorram = auto_alloc_array(machine, UINT8, 768);
}
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index 27370e7297b..25c2d8723c9 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -127,7 +127,7 @@ public:
static TILE_GET_INFO( get_ms32_tx0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno, colour;
tileno = state->ms32_tx0_ram[tile_index *2+0] & 0x0000ffff;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( get_ms32_tx0_tile_info )
static TILE_GET_INFO( get_ms32_tx1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno, colour;
tileno = state->ms32_tx1_ram[tile_index *2+0] & 0x0000ffff;
@@ -149,14 +149,14 @@ static TILE_GET_INFO( get_ms32_tx1_tile_info )
static WRITE32_HANDLER( ms32_tx0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_tx0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_tx_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_tx1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_tx1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_tx_tilemap[1],offset/2);
}
@@ -165,7 +165,7 @@ static WRITE32_HANDLER( ms32_tx1_ram_w )
static TILE_GET_INFO( get_ms32_bg0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_bg0_ram[tile_index *2+0] & 0x0000ffff;
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_ms32_bg0_tile_info )
static TILE_GET_INFO( get_ms32_bg1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_bg1_ram[tile_index *2+0] & 0x0000ffff;
@@ -187,23 +187,23 @@ static TILE_GET_INFO( get_ms32_bg1_tile_info )
static WRITE32_HANDLER( ms32_bg0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_bg0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_bg_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_bg1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_bg1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_bg_tilemap[1],offset/2);
}
/* ROZ Layers */
-static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int chip)
+static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int chip)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
/* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */
if (state->ms32_roz_ctrl[chip][0x5c/4] & 1) /* "super" mode */
@@ -289,7 +289,7 @@ static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle
static TILE_GET_INFO( get_ms32_roz0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_roz0_ram[tile_index *2+0] & 0x0000ffff;
@@ -300,7 +300,7 @@ static TILE_GET_INFO( get_ms32_roz0_tile_info )
static TILE_GET_INFO( get_ms32_roz1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_roz1_ram[tile_index *2+0] & 0x0000ffff;
@@ -311,22 +311,22 @@ static TILE_GET_INFO( get_ms32_roz1_tile_info )
static WRITE32_HANDLER( ms32_roz0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_roz0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_roz_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_roz1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_roz1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_roz_tilemap[1],offset/2);
}
-static void update_color(running_machine *machine, int color, int screen)
+static void update_color(running_machine &machine, int color, int screen)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int r,g,b;
r = ((state->ms32_pal_ram[screen][color*2] & 0xff00) >>8 );
@@ -338,23 +338,23 @@ static void update_color(running_machine *machine, int color, int screen)
static WRITE32_HANDLER( ms32_pal0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_pal_ram[0][offset]);
- update_color(space->machine, offset/2, 0);
+ update_color(space->machine(), offset/2, 0);
}
static WRITE32_HANDLER( ms32_pal1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_pal_ram[1][offset]);
- update_color(space->machine, offset/2, 1);
+ update_color(space->machine(), offset/2, 1);
}
/* SPRITES based on tetrisp2 for now, readd priority bits later */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
/***************************************************************************
@@ -395,7 +395,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int tx, ty, sx, sy, flipx, flipy;
int xsize, ysize, xzoom, yzoom;
int code, attr, color, size, pri, pri_mask;
- gfx_element *gfx = machine->gfx[region];
+ gfx_element *gfx = machine.gfx[region];
UINT32 *source = sprram_top;
const UINT32 *finish = sprram_top + (sprram_size - 0x10) / 4;
@@ -474,7 +474,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color,
flipx, flipy,
sx,sy,
- xzoom, yzoom, machine->priority_bitmap,pri_mask, 0);
+ xzoom, yzoom, machine.priority_bitmap,pri_mask, 0);
} /* end sprite loop */
}
@@ -482,14 +482,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static WRITE32_HANDLER( ms32_spramx_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_spram[offset]);
}
static VIDEO_START(bnstars)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->ms32_tx_tilemap[0] = tilemap_create(machine, get_ms32_tx0_tile_info,tilemap_scan_rows, 8, 8,64,64);
state->ms32_tx_tilemap[1] = tilemap_create(machine, get_ms32_tx1_tile_info,tilemap_scan_rows, 8, 8,64,64);
tilemap_set_transparent_pen(state->ms32_tx_tilemap[0],0);
@@ -514,11 +514,11 @@ static VIDEO_START(bnstars)
static SCREEN_UPDATE(bnstars)
{
- bnstars_state *state = screen->machine->driver_data<bnstars_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ bnstars_state *state = screen->machine().driver_data<bnstars_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (screen==left_screen)
{
@@ -529,14 +529,14 @@ static SCREEN_UPDATE(bnstars)
tilemap_set_scrolly(state->ms32_bg_tilemap[0], 0, state->ms32_bg0_scroll[0x0c/4] + state->ms32_bg0_scroll[0x14/4] );
tilemap_draw(bitmap,cliprect,state->ms32_bg_tilemap[0],0,1);
- draw_roz(screen->machine,bitmap,cliprect,2,0);
+ draw_roz(screen->machine(),bitmap,cliprect,2,0);
tilemap_set_scrollx(state->ms32_tx_tilemap[0], 0, state->ms32_tx0_scroll[0x00/4] + state->ms32_tx0_scroll[0x08/4] + 0x18);
tilemap_set_scrolly(state->ms32_tx_tilemap[0], 0, state->ms32_tx0_scroll[0x0c/4] + state->ms32_tx0_scroll[0x14/4]);
tilemap_draw(bitmap,cliprect,state->ms32_tx_tilemap[0],0,4);
- draw_sprites(screen->machine,bitmap,cliprect, state->ms32_spram, 0x20000, 0);
+ draw_sprites(screen->machine(),bitmap,cliprect, state->ms32_spram, 0x20000, 0);
}
else if (screen == right_screen)
{
@@ -547,13 +547,13 @@ static SCREEN_UPDATE(bnstars)
tilemap_set_scrolly(state->ms32_bg_tilemap[1], 0, state->ms32_bg1_scroll[0x0c/4] + state->ms32_bg1_scroll[0x14/4] );
tilemap_draw(bitmap,cliprect,state->ms32_bg_tilemap[1],0,1);
- draw_roz(screen->machine,bitmap,cliprect,2,1);
+ draw_roz(screen->machine(),bitmap,cliprect,2,1);
tilemap_set_scrollx(state->ms32_tx_tilemap[1], 0, state->ms32_tx1_scroll[0x00/4] + state->ms32_tx1_scroll[0x08/4] + 0x18);
tilemap_set_scrolly(state->ms32_tx_tilemap[1], 0, state->ms32_tx1_scroll[0x0c/4] + state->ms32_tx1_scroll[0x14/4]);
tilemap_draw(bitmap,cliprect,state->ms32_tx_tilemap[1],0,4);
- draw_sprites(screen->machine,bitmap,cliprect, state->ms32_spram+(0x20000/4), 0x20000, 4);
+ draw_sprites(screen->machine(),bitmap,cliprect, state->ms32_spram+(0x20000/4), 0x20000, 4);
}
return 0;
@@ -1221,7 +1221,7 @@ GFXDECODE_END
static READ32_HANDLER( bnstars1_r )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
switch (state->bnstars1_mahjong_select & 0x2080)
{
default:
@@ -1229,33 +1229,33 @@ static READ32_HANDLER( bnstars1_r )
return 0xffffffff;
case 0x0000:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x0080:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x2000:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x2080:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
}
static READ32_HANDLER( bnstars2_r )
{
- return input_port_read(space->machine, "IN4");
+ return input_port_read(space->machine(), "IN4");
}
static READ32_HANDLER( bnstars3_r )
{
- return input_port_read(space->machine, "IN5");
+ return input_port_read(space->machine(), "IN5");
}
static WRITE32_HANDLER( bnstars1_mahjong_select_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
state->bnstars1_mahjong_select = data;
// printf("%08x\n",state->bnstars1_mahjong_select);
}
@@ -1308,7 +1308,7 @@ ADDRESS_MAP_END
static IRQ_CALLBACK(irq_callback)
{
- bnstars_state *state = device->machine->driver_data<bnstars_state>();
+ bnstars_state *state = device->machine().driver_data<bnstars_state>();
int i;
for(i=15; i>=0 && !(state->irqreq & (1<<i)); i--);
state->irqreq &= ~(1<<i);
@@ -1317,17 +1317,17 @@ static IRQ_CALLBACK(irq_callback)
return i;
}
-static void irq_init(running_machine *machine)
+static void irq_init(running_machine &machine)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->irqreq = 0;
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
-static void irq_raise(running_machine *machine, int level)
+static void irq_raise(running_machine &machine, int level)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->irqreq |= (1<<level);
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
@@ -1335,8 +1335,8 @@ static void irq_raise(running_machine *machine, int level)
static INTERRUPT_GEN(ms32_interrupt)
{
- if( cpu_getiloops(device) == 0 ) irq_raise(device->machine, 10);
- if( cpu_getiloops(device) == 1 ) irq_raise(device->machine, 9);
+ if( cpu_getiloops(device) == 0 ) irq_raise(device->machine(), 10);
+ if( cpu_getiloops(device) == 1 ) irq_raise(device->machine(), 9);
/* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose)
@@ -1345,7 +1345,7 @@ static INTERRUPT_GEN(ms32_interrupt)
desertwr
p47aces
*/
- if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine, 0);
+ if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine(), 0);
}
static MACHINE_RESET( ms32 )
@@ -1472,7 +1472,7 @@ static DRIVER_INIT (bnstars)
decrypt_ms32_tx(machine, 0x00020,0x7e, "gfx7");
decrypt_ms32_bg(machine, 0x00001,0x9b, "gfx6");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
}
GAME( 1997, bnstars1, 0, bnstars, bnstars, bnstars, ROT0, "Jaleco", "Vs. Janshi Brandnew Stars", GAME_NO_SOUND )
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index 6bbf08d429c..b5938c51f4d 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -24,24 +24,24 @@
static WRITE8_HANDLER( bogeyman_8910_latch_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->psg_latch = data;
}
static WRITE8_HANDLER( bogeyman_8910_control_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
// bit 0 is flipscreen
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
if ((state->last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(space->machine->device("ay1"), state->last_write >> 4, state->psg_latch);
+ ay8910_data_address_w(space->machine().device("ay1"), state->last_write >> 4, state->psg_latch);
// bit 7 goes to 8910 #1 BDIR pin
if ((state->last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(space->machine->device("ay2"), state->last_write >> 6, state->psg_latch);
+ ay8910_data_address_w(space->machine().device("ay2"), state->last_write >> 6, state->psg_latch);
state->last_write = data;
}
@@ -207,7 +207,7 @@ GFXDECODE_END
static MACHINE_START( bogeyman )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
state->save_item(NAME(state->psg_latch));
state->save_item(NAME(state->last_write));
@@ -215,7 +215,7 @@ static MACHINE_START( bogeyman )
static MACHINE_RESET( bogeyman )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
state->psg_latch = 0;
state->last_write = 0;
@@ -223,7 +223,7 @@ static MACHINE_RESET( bogeyman )
static WRITE8_DEVICE_HANDLER( bogeyman_colbank_w )
{
- bogeyman_state *state = device->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = device->machine().driver_data<bogeyman_state>();
if((data & 1) != (state->colbank & 1))
{
diff --git a/src/mame/drivers/bombjack.c b/src/mame/drivers/bombjack.c
index 29a6e7ddcc7..eb17472b19e 100644
--- a/src/mame/drivers/bombjack.c
+++ b/src/mame/drivers/bombjack.c
@@ -103,19 +103,19 @@ Dip Locations and factory settings verified with manual
static TIMER_CALLBACK( soundlatch_callback )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->latch = param;
}
static WRITE8_HANDLER( bombjack_soundlatch_w )
{
/* make all the CPUs synchronize, and only AFTER that write the new command to the latch */
- space->machine->scheduler().synchronize(FUNC(soundlatch_callback), data);
+ space->machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
}
static READ8_HANDLER( bombjack_soundlatch_r )
{
- bombjack_state *state = space->machine->driver_data<bombjack_state>();
+ bombjack_state *state = space->machine().driver_data<bombjack_state>();
int res;
res = state->latch;
@@ -328,7 +328,7 @@ GFXDECODE_END
static MACHINE_START( bombjack )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->save_item(NAME(state->latch));
state->save_item(NAME(state->background_image));
@@ -337,7 +337,7 @@ static MACHINE_START( bombjack )
static MACHINE_RESET( bombjack )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->latch = 0;
state->background_image = 0;
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index 2f945cc722f..aebcb094a50 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -276,13 +276,13 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- boogwing_state *driver_state = device->machine->driver_data<boogwing_state>();
+ boogwing_state *driver_state = device->machine().driver_data<boogwing_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- boogwing_state *state = device->machine->driver_data<boogwing_state>();
+ boogwing_state *state = device->machine().driver_data<boogwing_state>();
state->oki2->set_bank_base(((data & 2) >> 1) * 0x40000);
state->oki1->set_bank_base((data & 1) * 0x40000);
}
@@ -564,8 +564,8 @@ ROM_END
static DRIVER_INIT( boogwing )
{
- const UINT8* src = machine->region("gfx6")->base();
- UINT8* dst = machine->region("tiles2")->base() + 0x200000;
+ const UINT8* src = machine.region("gfx6")->base();
+ UINT8* dst = machine.region("tiles2")->base() + 0x200000;
deco56_decrypt_gfx(machine, "tiles1");
deco56_decrypt_gfx(machine, "tiles2");
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index ff5f5b05961..c3eb2f25d43 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( bottom9_interrupt )
{
- bottom9_state *state = device->machine->driver_data<bottom9_state>();
+ bottom9_state *state = device->machine().driver_data<bottom9_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, 0, HOLD_LINE);
@@ -31,7 +31,7 @@ static INTERRUPT_GEN( bottom9_interrupt )
static READ8_HANDLER( k052109_051960_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -48,7 +48,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -60,7 +60,7 @@ static WRITE8_HANDLER( k052109_051960_w )
static READ8_HANDLER( bottom9_bankedram1_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset);
@@ -75,7 +75,7 @@ static READ8_HANDLER( bottom9_bankedram1_r )
static WRITE8_HANDLER( bottom9_bankedram1_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset, data);
@@ -85,17 +85,17 @@ static WRITE8_HANDLER( bottom9_bankedram1_w )
static READ8_HANDLER( bottom9_bankedram2_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset + 0x2000);
else
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static WRITE8_HANDLER( bottom9_bankedram2_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset + 0x2000, data);
@@ -117,16 +117,16 @@ static WRITE8_HANDLER( bankswitch_w )
else
bank = ((data & 0x0e) >> 1);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
static WRITE8_HANDLER( bottom9_1f90_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
@@ -143,26 +143,26 @@ static WRITE8_HANDLER( bottom9_1f90_w )
static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static INTERRUPT_GEN( bottom9_sound_interrupt )
{
- bottom9_state *state = device->machine->driver_data<bottom9_state>();
+ bottom9_state *state = device->machine().driver_data<bottom9_state>();
if (state->nmienable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
state->nmienable = data;
}
static WRITE8_HANDLER( sound_bank_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
int bank_A, bank_B;
bank_A = ((data >> 0) & 0x03);
@@ -332,18 +332,18 @@ static const k051316_interface bottom9_k051316_intf =
static MACHINE_START( bottom9 )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k051316 = machine->device("k051316");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k051316 = machine.device("k051316");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
state->save_item(NAME(state->video_enable));
state->save_item(NAME(state->zoomreadroms));
@@ -353,7 +353,7 @@ static MACHINE_START( bottom9 )
static MACHINE_RESET( bottom9 )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
state->video_enable = 0;
state->zoomreadroms = 0;
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index 803bb6d2495..dbb80c530de 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -46,7 +46,7 @@ public:
static TIMER_CALLBACK( pot_interrupt )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int mask = param;
if (state->pot_latch & mask)
@@ -58,7 +58,7 @@ static TIMER_CALLBACK( pot_interrupt )
static TIMER_CALLBACK( periodic_callback )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int scanline = param;
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
@@ -80,7 +80,7 @@ static TIMER_CALLBACK( periodic_callback )
for (i = 1; i < 256; i++)
if (mask[i] != 0)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(i), FUNC(pot_interrupt), mask[i]);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(i), FUNC(pot_interrupt), mask[i]);
state->pot_state = 0;
}
@@ -90,7 +90,7 @@ static TIMER_CALLBACK( periodic_callback )
if (scanline >= 262)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
}
@@ -109,14 +109,14 @@ static PALETTE_INIT( boxer )
palette_set_color(machine,3, MAKE_RGB(0x00,0x00,0x00));
}
-static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect )
+static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int n;
for (n = 0; n < 2; n++)
{
- const UINT8* p = machine->region(n == 0 ? "user1" : "user2")->base();
+ const UINT8* p = machine.region(n == 0 ? "user1" : "user2")->base();
int i, j;
@@ -135,7 +135,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
code = p[32 * l + 4 * i + j];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[n],
+ machine.gfx[n],
code,
0,
code & 0x80, 0,
@@ -145,7 +145,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
code = p[32 * r + 4 * i - j + 3];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[n],
+ machine.gfx[n],
code,
0,
!(code & 0x80), 0,
@@ -159,7 +159,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
static SCREEN_UPDATE( boxer )
{
- boxer_state *state = screen->machine->driver_data<boxer_state>();
+ boxer_state *state = screen->machine().driver_data<boxer_state>();
int i, j;
bitmap_fill(bitmap, cliprect, 1);
@@ -171,7 +171,7 @@ static SCREEN_UPDATE( boxer )
UINT8 code = state->tile_ram[32 * i + j];
drawgfx_transpen(bitmap, cliprect,
- screen->machine->gfx[2],
+ screen->machine().gfx[2],
code,
0,
code & 0x40, code & 0x40,
@@ -180,7 +180,7 @@ static SCREEN_UPDATE( boxer )
}
}
- draw_boxer(screen->machine, bitmap, cliprect);
+ draw_boxer(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -193,9 +193,9 @@ static SCREEN_UPDATE( boxer )
static READ8_HANDLER( boxer_input_r )
{
- UINT8 val = input_port_read(space->machine, "IN0");
+ UINT8 val = input_port_read(space->machine(), "IN0");
- if (input_port_read(space->machine, "IN3") < space->machine->primary_screen->vpos())
+ if (input_port_read(space->machine(), "IN3") < space->machine().primary_screen->vpos())
val |= 0x02;
return (val << ((offset & 7) ^ 7)) & 0x80;
@@ -204,7 +204,7 @@ static READ8_HANDLER( boxer_input_r )
static READ8_HANDLER( boxer_misc_r )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
UINT8 val = 0;
switch (offset & 3)
@@ -214,15 +214,15 @@ static READ8_HANDLER( boxer_misc_r )
break;
case 1:
- val = space->machine->primary_screen->vpos();
+ val = space->machine().primary_screen->vpos();
break;
case 2:
- val = input_port_read(space->machine, "IN1");
+ val = input_port_read(space->machine(), "IN1");
break;
case 3:
- val = input_port_read(space->machine, "IN2");
+ val = input_port_read(space->machine(), "IN2");
break;
}
@@ -244,7 +244,7 @@ static WRITE8_HANDLER( boxer_sound_w )
static WRITE8_HANDLER( boxer_pot_w )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
/* BIT0 => HPOT1 */
/* BIT1 => VPOT1 */
/* BIT2 => RPOT1 */
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( boxer_pot_w )
static WRITE8_HANDLER( boxer_irq_reset_w )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -272,14 +272,14 @@ static WRITE8_HANDLER( boxer_crowd_w )
/* BIT2 => CROWD-2 */
/* BIT3 => CROWD-3 */
- coin_lockout_global_w(space->machine, data & 1);
+ coin_lockout_global_w(space->machine(), data & 1);
}
static WRITE8_HANDLER( boxer_led_w )
{
- set_led_status(space->machine, 1, !(data & 1));
- set_led_status(space->machine, 0, !(data & 2));
+ set_led_status(space->machine(), 1, !(data & 1));
+ set_led_status(space->machine(), 0, !(data & 2));
}
@@ -417,9 +417,9 @@ GFXDECODE_END
static MACHINE_START( boxer )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->pot_state));
state->save_item(NAME(state->pot_latch));
@@ -427,8 +427,8 @@ static MACHINE_START( boxer )
static MACHINE_RESET( boxer )
{
- boxer_state *state = machine->driver_data<boxer_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(periodic_callback));
+ boxer_state *state = machine.driver_data<boxer_state>();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(periodic_callback));
state->pot_state = 0;
state->pot_latch = 0;
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index 02d8f2c7d81..fdbd13d57bd 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -67,7 +67,7 @@
static WRITE8_HANDLER( brkthru_1803_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
cpu_interrupt_enable(state->maincpu, ~data & 1);
@@ -75,7 +75,7 @@ static WRITE8_HANDLER( brkthru_1803_w )
}
static WRITE8_HANDLER( darwin_0803_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
/*cpu_interrupt_enable(state->audiocpu, ~data & 1);*/
logerror("0803 %02X\n",data);
@@ -85,14 +85,14 @@ static WRITE8_HANDLER( darwin_0803_w )
static WRITE8_HANDLER( brkthru_soundlatch_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
{
- brkthru_state *state = field->port->machine->driver_data<brkthru_state>();
+ brkthru_state *state = field->port->machine().driver_data<brkthru_state>();
/* coin insertion causes an IRQ */
device_set_input_line(state->maincpu, 0, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -346,7 +346,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- brkthru_state *state = device->machine->driver_data<brkthru_state>();
+ brkthru_state *state = device->machine().driver_data<brkthru_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, linestate);
}
@@ -365,10 +365,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( brkthru )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bgscroll));
state->save_item(NAME(state->bgbasecolor));
@@ -377,7 +377,7 @@ static MACHINE_START( brkthru )
static MACHINE_RESET( brkthru )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
state->bgscroll = 0;
state->bgbasecolor = 0;
@@ -654,7 +654,7 @@ ROM_END
static DRIVER_INIT( brkthru )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
}
diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c
index 028aa31f01e..6f5f13bff43 100644
--- a/src/mame/drivers/bsktball.c
+++ b/src/mame/drivers/bsktball.c
@@ -40,29 +40,29 @@ static PALETTE_INIT( bsktball )
{
int i;
- machine->colortable = colortable_alloc(machine, 4);
+ machine.colortable = colortable_alloc(machine, 4);
- colortable_palette_set_color(machine->colortable,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- colortable_palette_set_color(machine->colortable,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
- colortable_palette_set_color(machine->colortable,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
- colortable_palette_set_color(machine->colortable,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ colortable_palette_set_color(machine.colortable,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ colortable_palette_set_color(machine.colortable,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
+ colortable_palette_set_color(machine.colortable,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
+ colortable_palette_set_color(machine.colortable,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
/* playfield */
for (i = 0; i < 2; i++)
{
- colortable_entry_set_value(machine->colortable, i*4 + 0, 1);
- colortable_entry_set_value(machine->colortable, i*4 + 1, 3 * i);
- colortable_entry_set_value(machine->colortable, i*4 + 2, 3 * i);
- colortable_entry_set_value(machine->colortable, i*4 + 3, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 0, 1);
+ colortable_entry_set_value(machine.colortable, i*4 + 1, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 2, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 3, 3 * i);
}
/* motion */
for (i = 0; i < 4*4*4; i++)
{
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 0, 1);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 1, (i >> 2) & 3);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 2, (i >> 0) & 3);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 3, (i >> 4) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 0, 1);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 1, (i >> 2) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 2, (i >> 0) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 3, (i >> 4) & 3);
}
}
@@ -212,7 +212,7 @@ GFXDECODE_END
static MACHINE_START( bsktball )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
state->save_item(NAME(state->nmi_on));
state->save_item(NAME(state->i256v));
@@ -230,7 +230,7 @@ static MACHINE_START( bsktball )
static MACHINE_RESET( bsktball )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
state->nmi_on = 0;
state->i256v = 0;
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index f5d74c05f75..cc34b03b65d 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -166,7 +166,7 @@ static UINT8 *decrypted;
static WRITE8_HANDLER( audio_nmi_enable_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
/* for most games, this serves as the NMI enable for the audio CPU; however,
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
@@ -180,7 +180,7 @@ static WRITE8_HANDLER( audio_nmi_enable_w )
static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
{
- btime_state *state = device->machine->driver_data<btime_state>();
+ btime_state *state = device->machine().driver_data<btime_state>();
/* port A bit 0, when 1, inhibits the NMI */
if (state->audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
@@ -192,7 +192,7 @@ static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
{
- btime_state *state = timer.machine->driver_data<btime_state>();
+ btime_state *state = timer.machine().driver_data<btime_state>();
int scanline = param;
state->audio_nmi_state = scanline & 8;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
@@ -208,7 +208,7 @@ INLINE UINT8 swap_bits_5_6(UINT8 data)
static void btime_decrypt( address_space *space )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
UINT8 *src, *src1;
int addr, addr1;
@@ -224,12 +224,12 @@ static void btime_decrypt( address_space *space )
/* however if the previous instruction was JSR (which caused a write to */
/* the stack), fetch the address of the next instruction. */
addr1 = cpu_get_previouspc(space->cpu);
- src1 = (addr1 < 0x9000) ? state->rambase : space->machine->region("maincpu")->base();
+ src1 = (addr1 < 0x9000) ? state->rambase : space->machine().region("maincpu")->base();
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
/* If the address of the next instruction is xxxx xxx1 xxxx x1xx, decode it. */
- src = (addr < 0x9000) ? state->rambase : space->machine->region("maincpu")->base();
+ src = (addr < 0x9000) ? state->rambase : space->machine().region("maincpu")->base();
if ((addr & 0x0104) == 0x0104)
{
/* 76543210 -> 65342710 bit rotation */
@@ -239,7 +239,7 @@ static void btime_decrypt( address_space *space )
static WRITE8_HANDLER( lnc_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( lnc_w )
static WRITE8_HANDLER( mmonkey_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@@ -280,7 +280,7 @@ static WRITE8_HANDLER( mmonkey_w )
static WRITE8_HANDLER( btime_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@@ -299,7 +299,7 @@ static WRITE8_HANDLER( btime_w )
static WRITE8_HANDLER( tisland_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@@ -320,7 +320,7 @@ static WRITE8_HANDLER( tisland_w )
static WRITE8_HANDLER( zoar_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x8000 && offset <= 0x87ff) ;
@@ -340,7 +340,7 @@ static WRITE8_HANDLER( zoar_w )
static WRITE8_HANDLER( disco_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x04ff) ;
else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data);
@@ -525,7 +525,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_irq_hi )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
if (newval)
device_set_input_line(state->maincpu, 0, HOLD_LINE);
@@ -533,7 +533,7 @@ static INPUT_CHANGED( coin_inserted_irq_hi )
static INPUT_CHANGED( coin_inserted_irq_lo )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
if (!newval)
device_set_input_line(state->maincpu, 0, HOLD_LINE);
@@ -541,28 +541,28 @@ static INPUT_CHANGED( coin_inserted_irq_lo )
static INPUT_CHANGED( coin_inserted_nmi_lo )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( audio_command_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
}
static READ8_HANDLER( audio_command_r )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
static READ8_HANDLER( zoar_dsw1_read )
{
- return (!space->machine->primary_screen->vblank() << 7) | (input_port_read(space->machine, "DSW1") & 0x7f);
+ return (!space->machine().primary_screen->vblank() << 7) | (input_port_read(space->machine(), "DSW1") & 0x7f);
}
static INPUT_PORTS_START( btime )
@@ -1425,10 +1425,10 @@ DISCRETE_SOUND_END
static MACHINE_START( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->btime_palette));
state->save_item(NAME(state->bnj_scroll1));
@@ -1440,7 +1440,7 @@ static MACHINE_START( btime )
static MACHINE_START( mmonkey )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
MACHINE_START_CALL(btime);
@@ -1452,7 +1452,7 @@ static MACHINE_START( mmonkey )
static MACHINE_RESET( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
/* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
state->audio_nmi_enabled = (state->audio_nmi_enable_type == AUDIO_ENABLE_NONE);
@@ -1469,7 +1469,7 @@ static MACHINE_RESET( btime )
static MACHINE_RESET( lnc )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
*state->lnc_charbank = 1;
MACHINE_RESET_CALL(btime);
@@ -1477,7 +1477,7 @@ static MACHINE_RESET( lnc )
static MACHINE_RESET( mmonkey )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
MACHINE_RESET_CALL(lnc);
@@ -2069,11 +2069,11 @@ ROM_START( sdtennis )
ROM_LOAD( "ao_04.10f", 0x1000, 0x1000, CRC(921952af) SHA1(4e9248f3493a5f4651278f27c11f507571242317) )
ROM_END
-static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
+static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
{
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine->region(cputag)->base();
+ UINT8 *rom = machine.region(cputag)->base();
offs_t addr;
space->set_decrypted_region(0x0000, 0xffff, decrypt);
@@ -2082,13 +2082,13 @@ static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
for (addr = 0; addr < 0x10000; addr++)
decrypt[addr] = swap_bits_5_6(rom[addr]);
- if (space->cpu == machine->device("maincpu"))
+ if (space->cpu == machine.device("maincpu"))
decrypted = decrypt;
}
static READ8_HANDLER( wtennis_reset_hack_r )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
/* Otherwise the game goes into test mode and there is no way out that I
can see. I'm not sure how it can work, it probably somehow has to do
@@ -2099,10 +2099,10 @@ static READ8_HANDLER( wtennis_reset_hack_r )
return RAM[0xc15f];
}
-static void init_rom1(running_machine *machine)
+static void init_rom1(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -2115,15 +2115,15 @@ static void init_rom1(running_machine *machine)
static DRIVER_INIT( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
init_rom1(machine);
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( zoar )
{
- btime_state *state = machine->driver_data<btime_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ btime_state *state = machine.driver_data<btime_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
/* At location 0xD50A is what looks like an undocumented opcode. I tried
implementing it given what opcode 0x23 should do, but it still didn't
@@ -2137,8 +2137,8 @@ static DRIVER_INIT( zoar )
static DRIVER_INIT( tisland )
{
- btime_state *state = machine->driver_data<btime_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ btime_state *state = machine.driver_data<btime_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
/* At location 0xa2b6 there's a strange RLA followed by a BPL that reads from an
unmapped area that causes the game to fail in several circumstances.On the Cassette
@@ -2152,57 +2152,57 @@ static DRIVER_INIT( tisland )
static DRIVER_INIT( lnc )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( bnj )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( disco )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( cookrace )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- memory_set_bankptr(machine, "bank10", machine->region("audiocpu")->base() + 0xe200);
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
+ memory_set_bankptr(machine, "bank10", machine.region("audiocpu")->base() + 0xe200);
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( protennb )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( wtennis )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc15f, 0xc15f, FUNC(wtennis_reset_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc15f, 0xc15f, FUNC(wtennis_reset_hack_r));
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- memory_set_bankptr(machine, "bank10", machine->region("audiocpu")->base() + 0xe200);
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
+ memory_set_bankptr(machine, "bank10", machine.region("audiocpu")->base() + 0xe200);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( sdtennis )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
decrypt_C10707_cpu(machine, "audiocpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c
index 4dc65524735..865ef658741 100644
--- a/src/mame/drivers/btoads.c
+++ b/src/mame/drivers/btoads.c
@@ -29,7 +29,7 @@
static MACHINE_START( btoads )
{
- btoads_state *state = machine->driver_data<btoads_state>();
+ btoads_state *state = machine.driver_data<btoads_state>();
state_save_register_global(machine, state->main_to_sound_data);
state_save_register_global(machine, state->main_to_sound_ready);
state_save_register_global(machine, state->sound_to_main_data);
@@ -47,26 +47,26 @@ static MACHINE_START( btoads )
static TIMER_CALLBACK( delayed_sound_w )
{
- btoads_state *state = machine->driver_data<btoads_state>();
+ btoads_state *state = machine.driver_data<btoads_state>();
state->main_to_sound_data = param;
state->main_to_sound_ready = 1;
- device_triggerint(machine->device("audiocpu"));
+ device_triggerint(machine.device("audiocpu"));
/* use a timer to make long transfers faster */
- machine->scheduler().timer_set(attotime::from_usec(50), FUNC(NULL));
+ machine.scheduler().timer_set(attotime::from_usec(50), FUNC(NULL));
}
static WRITE16_HANDLER( main_sound_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
static READ16_HANDLER( main_sound_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->sound_to_main_ready = 0;
return state->sound_to_main_data;
}
@@ -74,14 +74,14 @@ static READ16_HANDLER( main_sound_r )
static CUSTOM_INPUT( main_to_sound_r )
{
- btoads_state *state = field->port->machine->driver_data<btoads_state>();
+ btoads_state *state = field->port->machine().driver_data<btoads_state>();
return state->main_to_sound_ready;
}
static CUSTOM_INPUT( sound_to_main_r )
{
- btoads_state *state = field->port->machine->driver_data<btoads_state>();
+ btoads_state *state = field->port->machine().driver_data<btoads_state>();
return state->sound_to_main_ready;
}
@@ -94,7 +94,7 @@ static CUSTOM_INPUT( sound_to_main_r )
static WRITE8_HANDLER( sound_data_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->sound_to_main_data = data;
state->sound_to_main_ready = 1;
}
@@ -102,7 +102,7 @@ static WRITE8_HANDLER( sound_data_w )
static READ8_HANDLER( sound_data_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->main_to_sound_ready = 0;
return state->main_to_sound_data;
}
@@ -110,14 +110,14 @@ static READ8_HANDLER( sound_data_r )
static READ8_HANDLER( sound_ready_to_send_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->sound_to_main_ready ? 0x00 : 0x80;
}
static READ8_HANDLER( sound_data_ready_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
if (cpu_get_pc(space->cpu) == 0xd50 && !state->main_to_sound_ready)
device_spin_until_interrupt(space->cpu);
return state->main_to_sound_ready ? 0x00 : 0x80;
@@ -133,13 +133,13 @@ static READ8_HANDLER( sound_data_ready_r )
static WRITE8_HANDLER( sound_int_state_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
/* top bit controls BSMT2000 reset */
if (!(state->sound_int_state & 0x80) && (data & 0x80))
- devtag_reset(space->machine, "bsmt");
+ devtag_reset(space->machine(), "bsmt");
/* also clears interrupts */
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
state->sound_int_state = data;
}
@@ -153,14 +153,14 @@ static WRITE8_HANDLER( sound_int_state_w )
static READ8_HANDLER( bsmt_ready_r )
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
static WRITE8_HANDLER( bsmt2000_port_w )
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->write_reg(offset >> 8);
bsmt->write_data(((offset & 0xff) << 8) | data);
}
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index d675f681de0..110cad563ab 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -699,7 +699,7 @@ GFXDECODE_END
// handler called by the 2203 emulator when the internal timers cause an IRQ
static void irqhandler(device_t *device, int irq)
{
- bublbobl_state *state = device->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = device->machine().driver_data<bublbobl_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -723,12 +723,12 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( common )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
- state->maincpu = machine->device("maincpu");
- state->mcu = machine->device("mcu");
- state->audiocpu = machine->device("audiocpu");
- state->slave = machine->device("slave");
+ state->maincpu = machine.device("maincpu");
+ state->mcu = machine.device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->slave = machine.device("slave");
state->save_item(NAME(state->sound_nmi_enable));
state->save_item(NAME(state->pending_nmi));
@@ -738,7 +738,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
state->sound_nmi_enable = 0;
state->pending_nmi = 0;
@@ -748,7 +748,7 @@ static MACHINE_RESET( common )
static MACHINE_START( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -757,7 +757,7 @@ static MACHINE_START( tokio )
static MACHINE_RESET( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -806,7 +806,7 @@ MACHINE_CONFIG_END
static MACHINE_START( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -826,7 +826,7 @@ static MACHINE_START( bublbobl )
static MACHINE_RESET( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -890,7 +890,7 @@ MACHINE_CONFIG_END
static MACHINE_START( boblbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -900,7 +900,7 @@ static MACHINE_START( boblbobl )
static MACHINE_RESET( boblbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -923,7 +923,7 @@ MACHINE_CONFIG_END
static MACHINE_START( bub68705 )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -939,7 +939,7 @@ static MACHINE_START( bub68705 )
static MACHINE_RESET( bub68705 )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -1525,15 +1525,15 @@ ROM_END
*
*************************************/
-static void configure_banks( running_machine* machine )
+static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
}
static DRIVER_INIT( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
configure_banks(machine);
@@ -1543,7 +1543,7 @@ static DRIVER_INIT( bublbobl )
static DRIVER_INIT( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
configure_banks(machine);
/* preemptively enable video, the bit is not mapped for this game and */
@@ -1555,14 +1555,14 @@ static DRIVER_INIT( tokiob )
{
DRIVER_INIT_CALL(tokio);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe00, 0xfe00, FUNC(tokiob_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe00, 0xfe00, FUNC(tokiob_mcu_r) );
}
static DRIVER_INIT( dland )
{
// rearrange gfx to original format
int i;
- UINT8* src = machine->region("gfx1")->base();
+ UINT8* src = machine.region("gfx1")->base();
for (i = 0; i < 0x40000; i++)
src[i] = BITSWAP8(src[i],7,6,5,4,0,1,2,3);
diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c
index bda227bba3b..2f0bd683f2d 100644
--- a/src/mame/drivers/buggychl.c
+++ b/src/mame/drivers/buggychl.c
@@ -89,12 +89,12 @@ Dip locations and factory settings verified from dip listing
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check if data&7 < # banks?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check if data&7 < # banks?
}
static TIMER_CALLBACK( nmi_callback )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -105,18 +105,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -127,7 +127,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static WRITE8_HANDLER( sound_enable_w )
{
- space->machine->sound().system_enable(data & 1);
+ space->machine().sound().system_enable(data & 1);
}
@@ -361,12 +361,12 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( buggychl )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sound_nmi_enable));
state->save_item(NAME(state->pending_nmi));
@@ -380,7 +380,7 @@ static MACHINE_START( buggychl )
static MACHINE_RESET( buggychl )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c
index 3e6f15a78ba..5a68893c9c8 100644
--- a/src/mame/drivers/buster.c
+++ b/src/mame/drivers/buster.c
@@ -28,8 +28,8 @@ static VIDEO_START(buster)
static SCREEN_UPDATE(buster)
{
- buster_state *state = screen->machine->driver_data<buster_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ buster_state *state = screen->machine().driver_data<buster_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x0000;
int y,x;
@@ -122,8 +122,8 @@ ROM_END
static DRIVER_INIT( buster )
{
- buster_state *state = machine->driver_data<buster_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ buster_state *state = machine.driver_data<buster_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
// vram = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(state->rom, ROM, 0x4000);
}
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index d86dcd15c04..e672a6155a9 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -270,9 +270,9 @@ static READ8_HANDLER( spacduel_IN3_r )
int res2;
int res3;
- res1 = input_port_read(space->machine, "IN3");
- res2 = input_port_read(space->machine, "IN4");
- res3 = input_port_read_safe(space->machine, "DSW2", 0);
+ res1 = input_port_read(space->machine(), "IN3");
+ res2 = input_port_read(space->machine(), "IN4");
+ res3 = input_port_read_safe(space->machine(), "DSW2", 0);
res = 0x00;
switch (offset & 0x07)
@@ -316,7 +316,7 @@ static READ8_HANDLER( spacduel_IN3_r )
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
@@ -328,7 +328,7 @@ static CUSTOM_INPUT( clock_r )
static WRITE8_HANDLER( bwidow_misc_w )
{
- bwidow_state *state = space->machine->driver_data<bwidow_state>();
+ bwidow_state *state = space->machine().driver_data<bwidow_state>();
/*
0x10 = p1 led
0x20 = p2 led
@@ -337,10 +337,10 @@ static WRITE8_HANDLER( bwidow_misc_w )
*/
if (data == state->lastdata) return;
- set_led_status(space->machine, 0,~data & 0x10);
- set_led_status(space->machine, 1,~data & 0x20);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ set_led_status(space->machine(), 0,~data & 0x10);
+ set_led_status(space->machine(), 1,~data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
state->lastdata = data;
}
@@ -352,7 +352,7 @@ static WRITE8_HANDLER( bwidow_misc_w )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index 8a6b8474862..9db568d352d 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -36,7 +36,7 @@ Known issues:
static INTERRUPT_GEN ( bwp1_interrupt )
{
- bwing_state *state = device->machine->driver_data<bwing_state>();
+ bwing_state *state = device->machine().driver_data<bwing_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -53,7 +53,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break;
case 1:
- if (~input_port_read(device->machine, "IN2") & 0x03)
+ if (~input_port_read(device->machine(), "IN2") & 0x03)
{
if (!state->coin)
{
@@ -66,7 +66,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break;
case 2:
- if (input_port_read(device->machine, "IN3"))
+ if (input_port_read(device->machine(), "IN3"))
device_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE);
break;
}
@@ -75,7 +75,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
static INTERRUPT_GEN ( bwp3_interrupt )
{
- bwing_state *state = device->machine->driver_data<bwing_state>();
+ bwing_state *state = device->machine().driver_data<bwing_state>();
if (!state->bwp3_nmimask)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
@@ -86,38 +86,38 @@ static INTERRUPT_GEN ( bwp3_interrupt )
static WRITE8_HANDLER( bwp12_sharedram1_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp1_sharedram1[offset] = state->bwp2_sharedram1[offset] = data;
}
static WRITE8_HANDLER( bwp3_u8F_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp3_u8F_d = data; // prepares custom chip for various operations
}
static WRITE8_HANDLER( bwp3_nmimask_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp3_nmimask = data & 0x80;
}
static WRITE8_HANDLER( bwp3_nmiack_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
static READ8_HANDLER( bwp1_io_r )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
- if (offset == 0) return(input_port_read(space->machine, "DSW0"));
- if (offset == 1) return(input_port_read(space->machine, "DSW1"));
- if (offset == 2) return(input_port_read(space->machine, "IN0"));
- if (offset == 3) return(input_port_read(space->machine, "IN1"));
- if (offset == 4) return(input_port_read(space->machine, "IN2"));
+ if (offset == 0) return(input_port_read(space->machine(), "DSW0"));
+ if (offset == 1) return(input_port_read(space->machine(), "DSW1"));
+ if (offset == 2) return(input_port_read(space->machine(), "IN0"));
+ if (offset == 3) return(input_port_read(space->machine(), "IN1"));
+ if (offset == 4) return(input_port_read(space->machine(), "IN2"));
return((state->bwp123_membase[0])[0x1b00 + offset]);
}
@@ -125,7 +125,7 @@ static READ8_HANDLER( bwp1_io_r )
static WRITE8_HANDLER( bwp1_ctrl_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
@@ -171,7 +171,7 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
static WRITE8_HANDLER( bwp2_ctrl_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
@@ -374,11 +374,11 @@ GFXDECODE_END
static MACHINE_START( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->coin));
state->save_item(NAME(state->palatch));
@@ -397,7 +397,7 @@ static MACHINE_START( bwing )
static MACHINE_RESET( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
int i;
state->coin = 0;
@@ -624,9 +624,9 @@ ROM_END
//****************************************************************************
// Initializations
-static void fix_bwp3( running_machine *machine )
+static void fix_bwp3( running_machine &machine )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
UINT8 *rom = state->bwp3_rombase;
int i, j = state->bwp3_romsize;
UINT8 ah, al;
@@ -642,11 +642,11 @@ static void fix_bwp3( running_machine *machine )
static DRIVER_INIT( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
- state->bwp123_membase[0] = machine->region("maincpu")->base();
- state->bwp123_membase[1] = machine->region("sub")->base();
- state->bwp123_membase[2] = machine->region("audiocpu")->base();
+ state->bwp123_membase[0] = machine.region("maincpu")->base();
+ state->bwp123_membase[1] = machine.region("sub")->base();
+ state->bwp123_membase[2] = machine.region("audiocpu")->base();
fix_bwp3(machine);
}
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 4737ecaac13..5fdc9959808 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -222,14 +222,14 @@
static MACHINE_START( bzone )
{
- bzone_state *state = machine->driver_data<bzone_state>();
+ bzone_state *state = machine.driver_data<bzone_state>();
state_save_register_global(machine, state->analog_data);
}
static MACHINE_START( redbaron )
{
- bzone_state *state = machine->driver_data<bzone_state>();
+ bzone_state *state = machine.driver_data<bzone_state>();
state_save_register_global(machine, state->analog_data);
state_save_register_global(machine, state->rb_input_select);
}
@@ -244,7 +244,7 @@ static MACHINE_START( redbaron )
static INTERRUPT_GEN( bzone_interrupt )
{
- if (input_port_read(device->machine, "IN0") & 0x10)
+ if (input_port_read(device->machine(), "IN0") & 0x10)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -258,13 +258,13 @@ static INTERRUPT_GEN( bzone_interrupt )
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
static WRITE8_HANDLER( bzone_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
@@ -277,13 +277,13 @@ static WRITE8_HANDLER( bzone_coin_counter_w )
static READ8_DEVICE_HANDLER( redbaron_joy_r )
{
- bzone_state *state = device->machine->driver_data<bzone_state>();
- return input_port_read(device->machine, state->rb_input_select ? "FAKE1" : "FAKE2");
+ bzone_state *state = device->machine().driver_data<bzone_state>();
+ return input_port_read(device->machine(), state->rb_input_select ? "FAKE1" : "FAKE2");
}
static WRITE8_DEVICE_HANDLER( redbaron_joysound_w )
{
- bzone_state *state = device->machine->driver_data<bzone_state>();
+ bzone_state *state = device->machine().driver_data<bzone_state>();
state->rb_input_select = data & 1;
redbaron_sounds_w(device, offset, data);
}
@@ -780,24 +780,24 @@ ROM_END
static READ8_HANDLER( analog_data_r )
{
- bzone_state *state = space->machine->driver_data<bzone_state>();
+ bzone_state *state = space->machine().driver_data<bzone_state>();
return state->analog_data;
}
static WRITE8_HANDLER( analog_select_w )
{
- bzone_state *state = space->machine->driver_data<bzone_state>();
+ bzone_state *state = space->machine().driver_data<bzone_state>();
static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
if (offset <= 2)
- state->analog_data = input_port_read(space->machine, analog_port[offset]);
+ state->analog_data = input_port_read(space->machine(), analog_port[offset]);
}
static DRIVER_INIT( bradley )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_ram(0x400, 0x7ff);
space->install_read_port(0x1808, 0x1808, "1808");
space->install_read_port(0x1809, 0x1809, "1809");
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 68868a069a1..77686440b79 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -54,7 +54,7 @@ Dip locations verified with Fabtek manual for the trackball version
static MACHINE_RESET( cabalbl )
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
state->sound_command1 = state->sound_command2 = 0xff;
}
@@ -63,7 +63,7 @@ static MACHINE_RESET( cabalbl )
static WRITE16_HANDLER( cabalbl_sndcmd_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
@@ -81,25 +81,25 @@ static WRITE16_HANDLER( cabalbl_sndcmd_w )
static WRITE16_HANDLER( track_reset_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
int i;
static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
for (i = 0; i < 4; i++)
- state->last[i] = input_port_read(space->machine, track_names[i]);
+ state->last[i] = input_port_read(space->machine(), track_names[i]);
}
static READ16_HANDLER( track_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
default:
- case 0: return (( input_port_read(space->machine, "IN0") - state->last[0]) & 0x00ff) | (((input_port_read(space->machine, "IN2") - state->last[2]) & 0x00ff) << 8); /* X lo */
- case 1: return (((input_port_read(space->machine, "IN0") - state->last[0]) & 0xff00) >> 8) | (( input_port_read(space->machine, "IN2") - state->last[2]) & 0xff00); /* X hi */
- case 2: return (( input_port_read(space->machine, "IN1") - state->last[1]) & 0x00ff) | (((input_port_read(space->machine, "IN3") - state->last[3]) & 0x00ff) << 8); /* Y lo */
- case 3: return (((input_port_read(space->machine, "IN1") - state->last[1]) & 0xff00) >> 8) | (( input_port_read(space->machine, "IN3") - state->last[3]) & 0xff00); /* Y hi */
+ case 0: return (( input_port_read(space->machine(), "IN0") - state->last[0]) & 0x00ff) | (((input_port_read(space->machine(), "IN2") - state->last[2]) & 0x00ff) << 8); /* X lo */
+ case 1: return (((input_port_read(space->machine(), "IN0") - state->last[0]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN2") - state->last[2]) & 0xff00); /* X hi */
+ case 2: return (( input_port_read(space->machine(), "IN1") - state->last[1]) & 0x00ff) | (((input_port_read(space->machine(), "IN3") - state->last[3]) & 0x00ff) << 8); /* Y lo */
+ case 3: return (((input_port_read(space->machine(), "IN1") - state->last[1]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN3") - state->last[3]) & 0xff00); /* Y hi */
}
}
@@ -114,7 +114,7 @@ static WRITE16_HANDLER( cabal_sound_irq_trigger_word_w )
static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
@@ -162,22 +162,22 @@ ADDRESS_MAP_END
static READ8_HANDLER( cabalbl_snd2_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
return BITSWAP8(state->sound_command2, 7,2,4,5,3,6,1,0);
}
static READ8_HANDLER( cabalbl_snd1_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
return BITSWAP8(state->sound_command1, 7,2,4,5,3,6,1,0);
}
static WRITE8_HANDLER( cabalbl_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
//data & 0x40? video enable?
}
@@ -464,7 +464,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface cabalbl_ym2151_interface =
@@ -835,11 +835,11 @@ ROM_END
-static void seibu_sound_bootleg(running_machine *machine,const char *cpu,int length)
+static void seibu_sound_bootleg(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
- UINT8 *rom = machine->region(cpu)->base();
+ UINT8 *rom = machine.region(cpu)->base();
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c
index 364c0cbe06f..452aed60295 100644
--- a/src/mame/drivers/cabaret.c
+++ b/src/mame/drivers/cabaret.c
@@ -53,28 +53,28 @@ public:
static WRITE8_HANDLER( bg_scroll_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->bg_scroll[offset] = data;
tilemap_set_scrolly(state->bg_tilemap,offset,data);
}
static WRITE8_HANDLER( bg_tile_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->bg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
int code = state->bg_tile_ram[tile_index];
SET_TILE_INFO(1, code & 0xff, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -82,21 +82,21 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( fg_tile_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(cabaret)
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 64, 8);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -106,8 +106,8 @@ static VIDEO_START(cabaret)
static SCREEN_UPDATE(cabaret)
{
- cabaret_state *state = screen->machine->driver_data<cabaret_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ cabaret_state *state = screen->machine().driver_data<cabaret_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -131,19 +131,19 @@ static void show_out(cabaret_state *state)
static WRITE8_HANDLER( cabaret_nmi_and_coins_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
if ((state->nmi_enable ^ data) & (~0xdd))
{
logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(space->cpu),data);
// popmessage("%02x",data);
}
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x40); // led for coin state->out / hopper active
+ set_led_status(space->machine(), 6, data & 0x40); // led for coin state->out / hopper active
state->nmi_enable = data; // data & 0x80 // nmi enable?
@@ -314,13 +314,13 @@ GFXDECODE_END
static MACHINE_RESET( cabaret )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
state->nmi_enable = 0;
}
static INTERRUPT_GEN( cabaret_interrupt )
{
- cabaret_state *state = device->machine->driver_data<cabaret_state>();
+ cabaret_state *state = device->machine().driver_data<cabaret_state>();
if (state->nmi_enable & 0x80)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -357,7 +357,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( cabaret )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 7bbc0462448..f5ca27678b4 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -129,10 +129,10 @@ static VIDEO_START(calchase)
static SCREEN_UPDATE(calchase)
{
- calchase_state *state = screen->machine->driver_data<calchase_state>();
+ calchase_state *state = screen->machine().driver_data<calchase_state>();
int x,y,count,i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (0);
@@ -147,7 +147,7 @@ static SCREEN_UPDATE(calchase)
color = (state->vga_vram[count])>>(32-i) & 0x1;
if((x+i)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine().pens[color];
}
@@ -182,7 +182,7 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
static READ8_HANDLER(at_page8_r)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8) {
@@ -205,7 +205,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8) {
@@ -227,7 +227,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -236,7 +236,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -246,7 +246,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static void set_dma_channel(device_t *device, int channel, int state)
{
- calchase_state *drvstate = device->machine->driver_data<calchase_state>();
+ calchase_state *drvstate = device->machine().driver_data<calchase_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -322,7 +322,7 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
// mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
return state->mxtc_config_reg[reg];
@@ -330,8 +330,8 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function,
static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
-// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
+// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
switch(reg)
{
@@ -339,11 +339,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- memory_set_bankptr(busdevice->machine, "bank1", state->bios_ram);
+ memory_set_bankptr(busdevice->machine(), "bank1", state->bios_ram);
}
else // disable RAM access (reads go to BIOS ROM)
{
- memory_set_bankptr(busdevice->machine, "bank1", busdevice->machine->region("bios")->base() + 0x10000);
+ memory_set_bankptr(busdevice->machine(), "bank1", busdevice->machine().region("bios")->base() + 0x10000);
}
break;
}
@@ -352,9 +352,9 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
state->mxtc_config_reg[reg] = data;
}
-static void intel82439tx_init(running_machine *machine)
+static void intel82439tx_init(running_machine &machine)
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
state->mxtc_config_reg[0x60] = 0x02;
state->mxtc_config_reg[0x61] = 0x02;
state->mxtc_config_reg[0x62] = 0x02;
@@ -409,15 +409,15 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
// mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
return state->piix4_config_reg[function][reg];
}
static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
-// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
+// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
state->piix4_config_reg[function][reg] = data;
}
@@ -465,7 +465,7 @@ static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int functi
static WRITE32_HANDLER(bios_ram_w)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
if (state->mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
COMBINE_DATA(state->bios_ram + offset);
@@ -565,7 +565,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- calchase_state *state = device->machine->driver_data<calchase_state>();
+ calchase_state *state = device->machine().driver_data<calchase_state>();
int r = 0;
r = pic8259_acknowledge( state->pic8259_2);
if (r==0)
@@ -577,14 +577,14 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(calchase)
{
- calchase_state *state = machine->driver_data<calchase_state>();
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ calchase_state *state = machine.driver_data<calchase_state>();
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
- state->pit8254 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ state->pit8254 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
/*************************************************************
@@ -595,7 +595,7 @@ static MACHINE_START(calchase)
static WRITE_LINE_DEVICE_HANDLER( calchase_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface calchase_pic8259_1_config =
@@ -636,29 +636,29 @@ static const struct pit8253_config calchase_pit8254_config =
static MACHINE_RESET(calchase)
{
- memory_set_bankptr(machine, "bank1", machine->region("bios")->base() + 0x10000);
+ memory_set_bankptr(machine, "bank1", machine.region("bios")->base() + 0x10000);
}
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- calchase_state *drvstate = machine->driver_data<calchase_state>();
+ calchase_state *drvstate = machine.driver_data<calchase_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static void ide_interrupt(device_t *device, int state)
{
- calchase_state *drvstate = device->machine->driver_data<calchase_state>();
+ calchase_state *drvstate = device->machine().driver_data<calchase_state>();
pic8259_ir6_w(drvstate->pic8259_2, state);
}
-static int calchase_get_out2(running_machine *machine)
+static int calchase_get_out2(running_machine &machine)
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
return pit8253_get_output(state->pit8254, 2 );
}
@@ -667,9 +667,9 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, calchase_get_out2
};
-static void calchase_set_keyb_int(running_machine *machine, int state)
+static void calchase_set_keyb_int(running_machine &machine, int state)
{
- calchase_state *drvstate = machine->driver_data<calchase_state>();
+ calchase_state *drvstate = machine.driver_data<calchase_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
@@ -709,7 +709,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( calchase )
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
state->bios_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int);
diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c
index ac9c209e048..04458e136bb 100644
--- a/src/mame/drivers/calomega.c
+++ b/src/mame/drivers/calomega.c
@@ -660,7 +660,7 @@
static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
{
int trx_clk;
- UINT8 dsw2 = input_port_read(device->machine, "SW2");
+ UINT8 dsw2 = input_port_read(device->machine(), "SW2");
trx_clk = UART_CLOCK * dsw2 / 128;
acia6850_set_rx_clock(device, trx_clk);
acia6850_set_tx_clock(device, trx_clk);
@@ -669,21 +669,21 @@ static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
static READ8_DEVICE_HANDLER( s903_mux_port_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->s903_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
- return input_port_read(device->machine, "FRQ"); /* bit7 used for 50/60 Hz selector */
+ return input_port_read(device->machine(), "FRQ"); /* bit7 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s903_mux_w )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
state->s903_mux_data = data ^ 0xff; /* inverted */
}
@@ -691,21 +691,21 @@ static WRITE8_DEVICE_HANDLER( s903_mux_w )
static READ8_DEVICE_HANDLER( s905_mux_port_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->s905_mux_data & 0x0f ) /* bits 0-3 */
{
- case 0x01: return input_port_read(device->machine, "IN0-0");
- case 0x02: return input_port_read(device->machine, "IN0-1");
- case 0x04: return input_port_read(device->machine, "IN0-2");
- case 0x08: return input_port_read(device->machine, "IN0-3");
+ case 0x01: return input_port_read(device->machine(), "IN0-0");
+ case 0x02: return input_port_read(device->machine(), "IN0-1");
+ case 0x04: return input_port_read(device->machine(), "IN0-2");
+ case 0x08: return input_port_read(device->machine(), "IN0-3");
}
- return input_port_read(device->machine, "FRQ"); /* bit6 used for 50/60 Hz selector */
+ return input_port_read(device->machine(), "FRQ"); /* bit6 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s905_mux_w )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
state->s905_mux_data = data ^ 0xff; /* inverted */
}
@@ -716,7 +716,7 @@ static READ8_DEVICE_HANDLER( pia0_ain_r )
{
/* Valid input port. Each polled value is stored at $0538 */
logerror("PIA0: Port A in\n");
- return input_port_read(device->machine, "IN0");
+ return input_port_read(device->machine(), "IN0");
}
static READ8_DEVICE_HANDLER( pia0_bin_r )
@@ -2654,13 +2654,13 @@ static const pia6821_interface sys906_pia1_intf =
static READ_LINE_DEVICE_HANDLER( acia_rx_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
return state->rx_line;
}
static WRITE_LINE_DEVICE_HANDLER( acia_tx_w )
{
- calomega_state *drvstate = device->machine->driver_data<calomega_state>();
+ calomega_state *drvstate = device->machine().driver_data<calomega_state>();
drvstate->tx_line = state;
}
@@ -3916,7 +3916,7 @@ static DRIVER_INIT( standard )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3928,7 +3928,7 @@ static DRIVER_INIT( standard )
static DRIVER_INIT( elgrande )
{
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
/* background color is adjusted through RGB pots */
for (x = 0x0000; x < 0x0400; x++)
@@ -3942,7 +3942,7 @@ static DRIVER_INIT( jjpoker )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3955,7 +3955,7 @@ static DRIVER_INIT( comg080 )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3967,7 +3967,7 @@ static DRIVER_INIT( comg080 )
Start = $2042; NMI = $26f8;
Also a fake vector at $3ff8-$3ff9. The code checks these values to continue.
*/
- UINT8 *PRGROM = machine->region( "maincpu" )->base();
+ UINT8 *PRGROM = machine.region( "maincpu" )->base();
PRGROM[0x3ff8] = 0x8e; /* checked by code */
PRGROM[0x3ff9] = 0x97; /* checked by code */
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index 7709052c30b..9aefcdfdb5a 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -108,8 +108,8 @@ public:
static TILE_GET_INFO( get_bg_tile_info )
{
- calorie_state *state = machine->driver_data<calorie_state>();
- UINT8 *src = machine->region("user1")->base();
+ calorie_state *state = machine.driver_data<calorie_state>();
+ UINT8 *src = machine.region("user1")->base();
int bg_base = (state->bg_bank & 0x0f) * 0x200;
int code = src[bg_base + tile_index] | (((src[bg_base + tile_index + 0x100]) & 0x10) << 4);
int color = src[bg_base + tile_index + 0x100] & 0x0f;
@@ -120,7 +120,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
int code = ((state->fg_ram[tile_index + 0x400] & 0x30) << 4) | state->fg_ram[tile_index];
int color = state->fg_ram[tile_index + 0x400] & 0x0f;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -140,7 +140,7 @@ static VIDEO_START( calorie )
static SCREEN_UPDATE( calorie )
{
- calorie_state *state = screen->machine->driver_data<calorie_state>();
+ calorie_state *state = screen->machine().driver_data<calorie_state>();
int x;
if (state->bg_bank & 0x10)
@@ -165,7 +165,7 @@ static SCREEN_UPDATE( calorie )
ypos = 0xff - state->sprites[x + 2];
xpos = state->sprites[x + 3];
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
if (state->sprites[x + 1] & 0x10)
ypos = 0xff - ypos + 32;
@@ -180,12 +180,12 @@ static SCREEN_UPDATE( calorie )
if (state->sprites[x + 1] & 0x10)
{
/* 32x32 sprites */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
}
else
{
/* 16x16 sprites */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
}
}
return 0;
@@ -199,14 +199,14 @@ static SCREEN_UPDATE( calorie )
static WRITE8_HANDLER( fg_ram_w )
{
- calorie_state *state = space->machine->driver_data<calorie_state>();
+ calorie_state *state = space->machine().driver_data<calorie_state>();
state->fg_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
static WRITE8_HANDLER( bg_bank_w )
{
- calorie_state *state = space->machine->driver_data<calorie_state>();
+ calorie_state *state = space->machine().driver_data<calorie_state>();
if((state->bg_bank & ~0x10) != (data & ~0x10))
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -215,7 +215,7 @@ static WRITE8_HANDLER( bg_bank_w )
static WRITE8_HANDLER( calorie_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static READ8_HANDLER( calorie_soundlatch_r )
@@ -416,14 +416,14 @@ GFXDECODE_END
static MACHINE_START( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->save_item(NAME(state->bg_bank));
}
static MACHINE_RESET( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->bg_bank = 0;
}
@@ -550,8 +550,8 @@ static DRIVER_INIT( calorie )
static DRIVER_INIT( calorieb )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x10000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index d061581944f..fde3eca8472 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -67,10 +67,10 @@ static READ8_HANDLER( canyon_switches_r )
{
UINT8 val = 0;
- if ((input_port_read(space->machine, "IN2") >> (offset & 7)) & 1)
+ if ((input_port_read(space->machine(), "IN2") >> (offset & 7)) & 1)
val |= 0x80;
- if ((input_port_read(space->machine, "IN1") >> (offset & 3)) & 1)
+ if ((input_port_read(space->machine(), "IN1") >> (offset & 3)) & 1)
val |= 0x01;
return val;
@@ -79,7 +79,7 @@ static READ8_HANDLER( canyon_switches_r )
static READ8_HANDLER( canyon_options_r )
{
- return (input_port_read(space->machine, "DSW") >> (2 * (~offset & 3))) & 3;
+ return (input_port_read(space->machine(), "DSW") >> (2 * (~offset & 3))) & 3;
}
@@ -93,7 +93,7 @@ static READ8_HANDLER( canyon_options_r )
static WRITE8_HANDLER( canyon_led_w )
{
- set_led_status(space->machine, offset & 0x01, offset & 0x02);
+ set_led_status(space->machine(), offset & 0x01, offset & 0x02);
}
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index 4121d401800..d46b8c4cc1b 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -107,7 +107,7 @@
static INTERRUPT_GEN( capbowl_interrupt )
{
- if (input_port_read(device->machine, "SERVICE") & 1) /* get status of the F2 key */
+ if (input_port_read(device->machine(), "SERVICE") & 1) /* get status of the F2 key */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */
}
@@ -123,10 +123,10 @@ static TIMER_CALLBACK( capbowl_update )
{
int scanline = param;
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
scanline += 32;
if (scanline > 240) scanline = 32;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(capbowl_update), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(capbowl_update), scanline);
}
@@ -139,7 +139,7 @@ static TIMER_CALLBACK( capbowl_update )
static WRITE8_HANDLER( capbowl_rom_select_w )
{
// 2009-11 FP: shall we add a check to be sure that bank < 6?
- memory_set_bank(space->machine, "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
+ memory_set_bank(space->machine(), "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
}
@@ -152,25 +152,25 @@ static WRITE8_HANDLER( capbowl_rom_select_w )
static READ8_HANDLER( track_0_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
- return (input_port_read(space->machine, "IN0") & 0xf0) | ((input_port_read(space->machine, "TRACKY") - state->last_trackball_val[0]) & 0x0f);
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ((input_port_read(space->machine(), "TRACKY") - state->last_trackball_val[0]) & 0x0f);
}
static READ8_HANDLER( track_1_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
- return (input_port_read(space->machine, "IN1") & 0xf0) | ((input_port_read(space->machine, "TRACKX") - state->last_trackball_val[1]) & 0x0f);
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
+ return (input_port_read(space->machine(), "IN1") & 0xf0) | ((input_port_read(space->machine(), "TRACKX") - state->last_trackball_val[1]) & 0x0f);
}
static WRITE8_HANDLER( track_reset_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
/* reset the trackball counters */
- state->last_trackball_val[0] = input_port_read(space->machine, "TRACKY");
- state->last_trackball_val[1] = input_port_read(space->machine, "TRACKX");
+ state->last_trackball_val[0] = input_port_read(space->machine(), "TRACKY");
+ state->last_trackball_val[1] = input_port_read(space->machine(), "TRACKX");
watchdog_reset_w(space, offset, data);
}
@@ -185,7 +185,7 @@ static WRITE8_HANDLER( track_reset_w )
static WRITE8_HANDLER( capbowl_sndcmd_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
soundlatch_w(space, offset, data);
}
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( capbowl_sndcmd_w )
static void firqhandler( device_t *device, int irq )
{
- capbowl_state *state = device->machine->driver_data<capbowl_state>();
+ capbowl_state *state = device->machine().driver_data<capbowl_state>();
device_set_input_line(state->audiocpu, 1, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -340,10 +340,10 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( capbowl )
{
- capbowl_state *state = machine->driver_data<capbowl_state>();
+ capbowl_state *state = machine.driver_data<capbowl_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->blitter_addr));
state->save_item(NAME(state->last_trackball_val[0]));
@@ -352,9 +352,9 @@ static MACHINE_START( capbowl )
static MACHINE_RESET( capbowl )
{
- capbowl_state *state = machine->driver_data<capbowl_state>();
+ capbowl_state *state = machine.driver_data<capbowl_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(32), FUNC(capbowl_update), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(32), FUNC(capbowl_update), 32);
state->blitter_addr = 0;
state->last_trackball_val[0] = 0;
@@ -504,7 +504,7 @@ ROM_END
static DRIVER_INIT( capbowl )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* configure ROM banks in 0x0000-0x3fff */
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c
index 1667fb2c317..76a30bdae25 100644
--- a/src/mame/drivers/cardline.c
+++ b/src/mame/drivers/cardline.c
@@ -37,7 +37,7 @@ public:
-#define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, machine->gfx[0],\
+#define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, (machine).gfx[0],\
(state->videoram[index+offset] | (state->colorram[index+offset]<<8))&0x3fff,\
(state->colorram[index+offset]&0x80)>>7,\
0,0,\
@@ -46,7 +46,7 @@ public:
static SCREEN_UPDATE( cardline )
{
- cardline_state *state = screen->machine->driver_data<cardline_state>();
+ cardline_state *state = screen->machine().driver_data<cardline_state>();
int x,y;
bitmap_fill(bitmap,cliprect,0);
for(y=0;y<32;y++)
@@ -56,14 +56,14 @@ static SCREEN_UPDATE( cardline )
int index=y*64+x;
if(state->video&1)
{
- DRAW_TILE(screen->machine,0,0);
- DRAW_TILE(screen->machine,0x800,1);
+ DRAW_TILE(screen->machine(),0,0);
+ DRAW_TILE(screen->machine(),0x800,1);
}
if(state->video&2)
{
- DRAW_TILE(screen->machine,0x1000,0);
- DRAW_TILE(screen->machine,0x1800,1);
+ DRAW_TILE(screen->machine(),0x1000,0);
+ DRAW_TILE(screen->machine(),0x1800,1);
}
}
}
@@ -72,27 +72,27 @@ static SCREEN_UPDATE( cardline )
static WRITE8_HANDLER(vram_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
offset+=0x1000*((state->video&2)>>1);
state->videoram[offset]=data;
}
static WRITE8_HANDLER(attr_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
offset+=0x1000*((state->video&2)>>1);
state->colorram[offset]=data;
}
static WRITE8_HANDLER(video_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
state->video=data;
}
static READ8_HANDLER(unk_r)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
state->var^=0x10;
//printf("var %d\n",state->var);
return state->var;
@@ -185,7 +185,7 @@ static PALETTE_INIT(cardline)
{
int i,r,g,b,data;
int bit0,bit1,bit2;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
data=color_prom[i];
diff --git a/src/mame/drivers/carjmbre.c b/src/mame/drivers/carjmbre.c
index 3e5b01d6cc0..d34957f49d2 100644
--- a/src/mame/drivers/carjmbre.c
+++ b/src/mame/drivers/carjmbre.c
@@ -178,7 +178,7 @@ GFXDECODE_END
static MACHINE_RESET( carjmbre )
{
- carjmbre_state *state = machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = machine.driver_data<carjmbre_state>();
state->flipscreen = 0;
state->bgcolor = 0;
diff --git a/src/mame/drivers/carpolo.c b/src/mame/drivers/carpolo.c
index 37d7714e7df..a4145761c67 100644
--- a/src/mame/drivers/carpolo.c
+++ b/src/mame/drivers/carpolo.c
@@ -332,8 +332,8 @@ static DRIVER_INIT( carpolo )
/* invert gfx PROM since the bits are active LO */
- ROM = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ ROM = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (i = 0;i < len; i++)
ROM[i] ^= 0x0f;
}
diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c
index 2220c95d129..61a83806e6f 100644
--- a/src/mame/drivers/carrera.c
+++ b/src/mame/drivers/carrera.c
@@ -246,7 +246,7 @@ GFXDECODE_END
static SCREEN_UPDATE(carrera)
{
- carrera_state *state = screen->machine->driver_data<carrera_state>();
+ carrera_state *state = screen->machine().driver_data<carrera_state>();
int x,y;
int count = 0;
@@ -257,7 +257,7 @@ static SCREEN_UPDATE(carrera)
{
int tile = state->tileram[count&0x7ff] | state->tileram[(count&0x7ff)+0x800]<<8;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8);
count++;
}
}
@@ -266,7 +266,7 @@ static SCREEN_UPDATE(carrera)
static READ8_DEVICE_HANDLER( unknown_r )
{
- return device->machine->rand();
+ return device->machine().rand();
}
/* these are set as input, but I have no idea which input port it uses is for the AY */
diff --git a/src/mame/drivers/caswin.c b/src/mame/drivers/caswin.c
index c4a732fbae9..56adb4c7ca1 100644
--- a/src/mame/drivers/caswin.c
+++ b/src/mame/drivers/caswin.c
@@ -62,7 +62,7 @@ public:
static TILE_GET_INFO( get_sc0_tile_info )
{
- caswin_state *state = machine->driver_data<caswin_state>();
+ caswin_state *state = machine.driver_data<caswin_state>();
int tile = (state->sc0_vram[tile_index] | ((state->sc0_attr[tile_index] & 0x70)<<4)) & 0x7ff;
int colour = state->sc0_attr[tile_index] & 0xf;
@@ -75,27 +75,27 @@ static TILE_GET_INFO( get_sc0_tile_info )
static VIDEO_START(vvillage)
{
- caswin_state *state = machine->driver_data<caswin_state>();
+ caswin_state *state = machine.driver_data<caswin_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,32);
}
static SCREEN_UPDATE(vvillage)
{
- caswin_state *state = screen->machine->driver_data<caswin_state>();
+ caswin_state *state = screen->machine().driver_data<caswin_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
return 0;
}
static WRITE8_HANDLER( sc0_vram_w )
{
- caswin_state *state = space->machine->driver_data<caswin_state>();
+ caswin_state *state = space->machine().driver_data<caswin_state>();
state->sc0_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_attr_w )
{
- caswin_state *state = space->machine->driver_data<caswin_state>();
+ caswin_state *state = space->machine().driver_data<caswin_state>();
state->sc0_attr[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( vvillage_scroll_w )
/*---- ---x flip screen */
static WRITE8_HANDLER( vvillage_vregs_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
/**********************
@@ -121,16 +121,16 @@ static WRITE8_HANDLER( vvillage_vregs_w )
static READ8_HANDLER( vvillage_rng_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( vvillage_output_w )
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 1);
// data & 4 payout counter
- coin_lockout_w(space->machine, 0,data & 0x20);
- coin_lockout_w(space->machine, 1,data & 0x20);
+ coin_lockout_w(space->machine(), 0,data & 0x20);
+ coin_lockout_w(space->machine(), 1,data & 0x20);
}
static WRITE8_HANDLER( vvillage_lamps_w )
@@ -142,11 +142,11 @@ static WRITE8_HANDLER( vvillage_lamps_w )
---- --x- lamp button 2
---- ---x lamp button 1
*/
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
- set_led_status(space->machine, 4, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
+ set_led_status(space->machine(), 4, data & 0x10);
}
static ADDRESS_MAP_START( vvillage_mem, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 7cd94df18f4..a1f84f58fbc 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -93,9 +93,9 @@ Versions known to exist but not dumped:
/* Update the IRQ state based on all possible causes */
-static void update_irq_state( running_machine *machine )
+static void update_irq_state( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->vblank_irq || state->sound_irq || state->unknown_irq)
device_set_input_line(state->maincpu, state->irq_level, ASSERT_LINE);
else
@@ -104,7 +104,7 @@ static void update_irq_state( running_machine *machine )
static TIMER_CALLBACK( cave_vblank_end )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->kludge == 3) /* mazinger metmqstr */
{
state->unknown_irq = 1;
@@ -115,27 +115,27 @@ static TIMER_CALLBACK( cave_vblank_end )
static TIMER_DEVICE_CALLBACK( cave_vblank_start )
{
- cave_state *state = timer.machine->driver_data<cave_state>();
+ cave_state *state = timer.machine().driver_data<cave_state>();
state->vblank_irq = 1;
- update_irq_state(timer.machine);
- cave_get_sprite_info(timer.machine);
+ update_irq_state(timer.machine());
+ cave_get_sprite_info(timer.machine());
state->agallet_vblank_irq = 1;
- timer.machine->scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end));
+ timer.machine().scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end));
}
/* Called once/frame to generate the VBLANK interrupt */
static INTERRUPT_GEN( cave_interrupt )
{
- cave_state *state = device->machine->driver_data<cave_state>();
+ cave_state *state = device->machine().driver_data<cave_state>();
state->int_timer->adjust(attotime::from_usec(17376 - state->time_vblank_irq));
}
/* Called by the YMZ280B to set the IRQ state */
static void sound_irq_gen( device_t *device, int state )
{
- cave_state *cave = device->machine->driver_data<cave_state>();
+ cave_state *cave = device->machine().driver_data<cave_state>();
cave->sound_irq = (state != 0);
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
@@ -157,7 +157,7 @@ static void sound_irq_gen( device_t *device, int state )
static READ16_HANDLER( cave_irq_cause_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
int result = 0x0003;
if (state->vblank_irq)
@@ -170,7 +170,7 @@ static READ16_HANDLER( cave_irq_cause_r )
if (offset == 6/2)
state->unknown_irq = 0;
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
/*
sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0.
@@ -202,7 +202,7 @@ static READ8_HANDLER( soundflags_r )
{
// bit 2 is low: can read command (lo)
// bit 3 is low: can read command (hi)
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// return (state->sound_flag1 ? 0 : 4) |
// (state->sound_flag2 ? 0 : 8) ;
return 0;
@@ -212,7 +212,7 @@ static READ16_HANDLER( soundflags_ack_r )
{
// bit 0 is low: can write command
// bit 1 is low: can read answer
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
// return ((state->sound_flag1 | state->sound_flag2) ? 1 : 0) |
// ((state->soundbuf_len > 0) ? 0 : 2) ;
@@ -222,7 +222,7 @@ static READ16_HANDLER( soundflags_ack_r )
/* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */
static WRITE16_HANDLER( sound_cmd_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag1 = 1;
// state->sound_flag2 = 1;
soundlatch_word_w(space, offset, data, mem_mask);
@@ -233,7 +233,7 @@ static WRITE16_HANDLER( sound_cmd_w )
/* Sound CPU: read the low 8 bits of the 16 bit sound latch */
static READ8_HANDLER( soundlatch_lo_r )
{
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag1 = 0;
return soundlatch_word_r(space, offset, 0x00ff) & 0xff;
}
@@ -241,7 +241,7 @@ static READ8_HANDLER( soundlatch_lo_r )
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
static READ8_HANDLER( soundlatch_hi_r )
{
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag2 = 0;
return soundlatch_word_r(space, offset, 0xff00) >> 8;
}
@@ -249,7 +249,7 @@ static READ8_HANDLER( soundlatch_hi_r )
/* Main CPU: read the latch written by the sound CPU (acknowledge) */
static READ16_HANDLER( soundlatch_ack_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (state->soundbuf_len > 0)
{
UINT8 data = state->soundbuf_data[0];
@@ -268,7 +268,7 @@ static READ16_HANDLER( soundlatch_ack_r )
/* Sound CPU: write latch for the main CPU (acknowledge) */
static WRITE8_HANDLER( soundlatch_ack_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
state->soundbuf_data[state->soundbuf_len] = data;
if (state->soundbuf_len < 32)
state->soundbuf_len++;
@@ -289,14 +289,14 @@ static WRITE8_HANDLER( soundlatch_ack_w )
static WRITE16_DEVICE_HANDLER( cave_eeprom_msb_w )
{
if (data & ~0xfe00)
- logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data);
+ logerror("%s: Unknown EEPROM bit written %04X\n", device->machine().describe_context(), data);
if (ACCESSING_BITS_8_15) // even address
{
- coin_lockout_w(device->machine, 1,~data & 0x8000);
- coin_lockout_w(device->machine, 0,~data & 0x4000);
- coin_counter_w(device->machine, 1, data & 0x2000);
- coin_counter_w(device->machine, 0, data & 0x1000);
+ coin_lockout_w(device->machine(), 1,~data & 0x8000);
+ coin_lockout_w(device->machine(), 0,~data & 0x4000);
+ coin_counter_w(device->machine(), 1, data & 0x2000);
+ coin_counter_w(device->machine(), 0, data & 0x1000);
// latch the bit
eeprom_write_bit(device, data & 0x0800);
@@ -311,7 +311,7 @@ static WRITE16_DEVICE_HANDLER( cave_eeprom_msb_w )
static WRITE16_DEVICE_HANDLER( sailormn_eeprom_msb_w )
{
- sailormn_tilebank_w(device->machine, data & 0x0100);
+ sailormn_tilebank_w(device->machine(), data & 0x0100);
cave_eeprom_msb_w(device, offset, data & ~0x0100, mem_mask);
}
@@ -333,14 +333,14 @@ static WRITE16_DEVICE_HANDLER( hotdogst_eeprom_msb_w )
static WRITE16_DEVICE_HANDLER( cave_eeprom_lsb_w )
{
if (data & ~0x00ef)
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if (ACCESSING_BITS_0_7) // odd address
{
- coin_lockout_w(device->machine, 1, ~data & 0x0008);
- coin_lockout_w(device->machine, 0, ~data & 0x0004);
- coin_counter_w(device->machine, 1, data & 0x0002);
- coin_counter_w(device->machine, 0, data & 0x0001);
+ coin_lockout_w(device->machine(), 1, ~data & 0x0008);
+ coin_lockout_w(device->machine(), 0, ~data & 0x0004);
+ coin_counter_w(device->machine(), 1, data & 0x0002);
+ coin_counter_w(device->machine(), 0, data & 0x0001);
// latch the bit
eeprom_write_bit(device, data & 0x80);
@@ -358,8 +358,8 @@ static WRITE16_HANDLER( gaia_coin_lsb_w )
{
if (ACCESSING_BITS_0_7) // odd address
{
- coin_counter_w(space->machine, 1, data & 0x0002);
- coin_counter_w(space->machine, 0, data & 0x0001);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
}
}
@@ -368,12 +368,12 @@ static WRITE16_HANDLER( gaia_coin_lsb_w )
static WRITE16_DEVICE_HANDLER( metmqstr_eeprom_msb_w )
{
if (data & ~0xff00)
- logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data);
+ logerror("%s: Unknown EEPROM bit written %04X\n", device->machine().describe_context(), data);
if (ACCESSING_BITS_8_15) // even address
{
- coin_counter_w(device->machine, 1, data & 0x2000);
- coin_counter_w(device->machine, 0, data & 0x1000);
+ coin_counter_w(device->machine(), 1, data & 0x2000);
+ coin_counter_w(device->machine(), 0, data & 0x1000);
if (~data & 0x0100)
{
@@ -501,7 +501,7 @@ static READ16_HANDLER( donpachi_videoregs_r )
#if 0
WRITE16_HANDLER( donpachi_videoregs_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
COMBINE_DATA(&state->videoregs[offset]);
switch (offset)
@@ -646,47 +646,47 @@ ADDRESS_MAP_END
Koro Koro Quest
***************************************************************************/
-static void show_leds(running_machine *machine)
+static void show_leds(running_machine &machine)
{
#ifdef MAME_DEBUG
-// cave_state *state = machine->driver_data<cave_state>();
+// cave_state *state = machine.driver_data<cave_state>();
// popmessage("led %04X eep %02X", state->leds[0], (state->leds[1] >> 8) & ~0x70);
#endif
}
static WRITE16_HANDLER( korokoro_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
COMBINE_DATA(&state->leds[0]);
- set_led_status(space->machine, 0, data & 0x8000);
- set_led_status(space->machine, 1, data & 0x4000);
- set_led_status(space->machine, 2, data & 0x1000); // square button
- set_led_status(space->machine, 3, data & 0x0800); // round button
-// coin_lockout_w(space->machine, 1, ~data & 0x0200); // coin lockouts?
-// coin_lockout_w(space->machine, 0, ~data & 0x0100);
+ set_led_status(space->machine(), 0, data & 0x8000);
+ set_led_status(space->machine(), 1, data & 0x4000);
+ set_led_status(space->machine(), 2, data & 0x1000); // square button
+ set_led_status(space->machine(), 3, data & 0x0800); // round button
+// coin_lockout_w(space->machine(), 1, ~data & 0x0200); // coin lockouts?
+// coin_lockout_w(space->machine(), 0, ~data & 0x0100);
-// coin_counter_w(space->machine, 2, data & 0x0080);
-// coin_counter_w(space->machine, 1, data & 0x0020);
- coin_counter_w(space->machine, 0, data & 0x0010);
+// coin_counter_w(space->machine(), 2, data & 0x0080);
+// coin_counter_w(space->machine(), 1, data & 0x0020);
+ coin_counter_w(space->machine(), 0, data & 0x0010);
- set_led_status(space->machine, 5, data & 0x0008);
- set_led_status(space->machine, 6, data & 0x0004);
- set_led_status(space->machine, 7, data & 0x0002);
- set_led_status(space->machine, 8, data & 0x0001);
+ set_led_status(space->machine(), 5, data & 0x0008);
+ set_led_status(space->machine(), 6, data & 0x0004);
+ set_led_status(space->machine(), 7, data & 0x0002);
+ set_led_status(space->machine(), 8, data & 0x0001);
- show_leds(space->machine);
+ show_leds(space->machine());
}
static WRITE16_DEVICE_HANDLER( korokoro_eeprom_msb_w )
{
- cave_state *state = device->machine->driver_data<cave_state>();
+ cave_state *state = device->machine().driver_data<cave_state>();
if (data & ~0x7000)
{
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
COMBINE_DATA(&state->leds[1]);
- show_leds(device->machine);
+ show_leds(device->machine());
}
if (ACCESSING_BITS_8_15) // even address
@@ -706,7 +706,7 @@ static WRITE16_DEVICE_HANDLER( korokoro_eeprom_msb_w )
static CUSTOM_INPUT( korokoro_hopper_r )
{
- cave_state *state = field->port->machine->driver_data<cave_state>();
+ cave_state *state = field->port->machine().driver_data<cave_state>();
return state->hopper ? 1 : 0;
}
@@ -827,10 +827,10 @@ INLINE void vctrl_w(UINT16 *VCTRL, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16
}
COMBINE_DATA(&VCTRL[offset]);
}
-static WRITE16_HANDLER( pwrinst2_vctrl_0_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_0, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_1_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_1, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_2_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_2, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_3_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_3, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_0_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_0, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_1_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_1, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_2_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_2, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_3_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_3, offset, data, mem_mask); }
static ADDRESS_MAP_START( pwrinst2_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM
@@ -865,7 +865,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( sailormn_input0_r )
{
// watchdog_reset16_r(0, 0); // written too rarely for mame.
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16 )
@@ -905,7 +905,7 @@ ADDRESS_MAP_END
static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w )
{
if (data & ~0x0038)
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if (ACCESSING_BITS_0_7) // odd address
{
@@ -922,17 +922,17 @@ static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w )
static WRITE16_HANDLER( tjumpman_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine, 0, data & 0x0001); // suru
- set_led_status(space->machine, 1, data & 0x0002); // shinai
- set_led_status(space->machine, 2, data & 0x0004); // payout
- set_led_status(space->machine, 3, data & 0x0008); // go
- set_led_status(space->machine, 4, data & 0x0010); // 1 bet
- set_led_status(space->machine, 5, data & 0x0020); // medal
+ set_led_status(space->machine(), 0, data & 0x0001); // suru
+ set_led_status(space->machine(), 1, data & 0x0002); // shinai
+ set_led_status(space->machine(), 2, data & 0x0004); // payout
+ set_led_status(space->machine(), 3, data & 0x0008); // go
+ set_led_status(space->machine(), 4, data & 0x0010); // 1 bet
+ set_led_status(space->machine(), 5, data & 0x0020); // medal
state->hopper = data & 0x0040; // hopper
- set_led_status(space->machine, 6, data & 0x0080); // 3 bet
+ set_led_status(space->machine(), 6, data & 0x0080); // 3 bet
}
// popmessage("led %04X", data);
@@ -940,8 +940,8 @@ static WRITE16_HANDLER( tjumpman_leds_w )
static CUSTOM_INPUT( tjumpman_hopper_r )
{
- cave_state *state = field->port->machine->driver_data<cave_state>();
- return (state->hopper && !(field->port->machine->primary_screen->frame_number() % 10)) ? 0 : 1;
+ cave_state *state = field->port->machine().driver_data<cave_state>();
+ return (state->hopper && !(field->port->machine().primary_screen->frame_number() % 10)) ? 0 : 1;
}
static ADDRESS_MAP_START( tjumpman_map, AS_PROGRAM, 16 )
@@ -970,15 +970,15 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( pacslot_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine, 0, data & 0x0001); // pac-man
- set_led_status(space->machine, 1, data & 0x0002); // ms. pac-man
- set_led_status(space->machine, 2, data & 0x0004); // payout
- set_led_status(space->machine, 3, data & 0x0008); // start
- set_led_status(space->machine, 4, data & 0x0010); // bet
- set_led_status(space->machine, 5, data & 0x0020); // medal
+ set_led_status(space->machine(), 0, data & 0x0001); // pac-man
+ set_led_status(space->machine(), 1, data & 0x0002); // ms. pac-man
+ set_led_status(space->machine(), 2, data & 0x0004); // payout
+ set_led_status(space->machine(), 3, data & 0x0008); // start
+ set_led_status(space->machine(), 4, data & 0x0010); // bet
+ set_led_status(space->machine(), 5, data & 0x0020); // medal
state->hopper = data & 0x0040; // hopper
}
@@ -1055,15 +1055,15 @@ static WRITE8_HANDLER( hotdogst_rombank_w )
if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", data & 0x0f);
}
static WRITE8_HANDLER( hotdogst_okibank_w )
{
int bank1 = (data >> 0) & 0x3;
int bank2 = (data >> 4) & 0x3;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static ADDRESS_MAP_START( hotdogst_sound_map, AS_PROGRAM, 8 )
@@ -1092,7 +1092,7 @@ static WRITE8_HANDLER( mazinger_rombank_w )
if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
}
static ADDRESS_MAP_START( mazinger_sound_map, AS_PROGRAM, 8 )
@@ -1123,23 +1123,23 @@ static WRITE8_HANDLER( metmqstr_rombank_w )
if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( metmqstr_okibank0_w )
{
int bank1 = (data >> 0) & 0x7;
int bank2 = (data >> 4) & 0x7;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static WRITE8_HANDLER( metmqstr_okibank1_w )
{
int bank1 = (data >> 0) & 0x7;
int bank2 = (data >> 4) & 0x7;
- memory_set_bank(space->machine, "bank5", bank1);
- memory_set_bank(space->machine, "bank6", bank2);
+ memory_set_bank(space->machine(), "bank5", bank1);
+ memory_set_bank(space->machine(), "bank6", bank2);
}
static ADDRESS_MAP_START( metmqstr_sound_map, AS_PROGRAM, 8 )
@@ -1171,7 +1171,7 @@ static WRITE8_HANDLER( pwrinst2_rombank_w )
if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static ADDRESS_MAP_START( pwrinst2_sound_map, AS_PROGRAM, 8 )
@@ -1200,13 +1200,13 @@ ADDRESS_MAP_END
static READ8_HANDLER( mirror_ram_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
return state->mirror_ram[offset];
}
static WRITE8_HANDLER( mirror_ram_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
state->mirror_ram[offset] = data;
}
@@ -1215,23 +1215,23 @@ static WRITE8_HANDLER( sailormn_rombank_w )
if (data & ~0x1f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( sailormn_okibank0_w )
{
int bank1 = (data >> 0) & 0xf;
int bank2 = (data >> 4) & 0xf;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static WRITE8_HANDLER( sailormn_okibank1_w )
{
int bank1 = (data >> 0) & 0xf;
int bank2 = (data >> 4) & 0xf;
- memory_set_bank(space->machine, "bank5", bank1);
- memory_set_bank(space->machine, "bank6", bank2);
+ memory_set_bank(space->machine(), "bank5", bank1);
+ memory_set_bank(space->machine(), "bank6", bank2);
}
static ADDRESS_MAP_START( sailormn_sound_map, AS_PROGRAM, 8 )
@@ -1799,10 +1799,10 @@ GFXDECODE_END
static MACHINE_START( cave )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->soundbuf_len));
state->save_item(NAME(state->soundbuf_data));
@@ -1815,7 +1815,7 @@ static MACHINE_START( cave )
static MACHINE_RESET( cave )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
memset(state->soundbuf_data, 0, 32);
state->soundbuf_len = 0;
@@ -1833,7 +1833,7 @@ static const ymz280b_interface ymz280b_intf =
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
@@ -2608,10 +2608,10 @@ MACHINE_CONFIG_END
***************************************************************************/
/* 4 bits -> 8 bits. Even and odd pixels are swapped */
-static void unpack_sprites(running_machine *machine)
+static void unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine->region("sprites")->bytes();
- UINT8 *rgn = machine->region ("sprites")->base();
+ const UINT32 len = machine.region("sprites")->bytes();
+ UINT8 *rgn = machine.region ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2625,10 +2625,10 @@ static void unpack_sprites(running_machine *machine)
/* 4 bits -> 8 bits. Even and odd pixels and even and odd words, are swapped */
-static void ddonpach_unpack_sprites(running_machine *machine)
+static void ddonpach_unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine->region("sprites")->bytes();
- UINT8 *rgn = machine->region ("sprites")->base();
+ const UINT32 len = machine.region("sprites")->bytes();
+ UINT8 *rgn = machine.region ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2649,10 +2649,10 @@ static void ddonpach_unpack_sprites(running_machine *machine)
/* 2 pages of 4 bits -> 8 bits */
-static void esprade_unpack_sprites(running_machine *machine)
+static void esprade_unpack_sprites(running_machine &machine)
{
- UINT8 *src = machine->region("sprites")->base();
- UINT8 *dst = src + machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ UINT8 *dst = src + machine.region("sprites")->bytes();
while(src < dst)
{
@@ -4365,10 +4365,10 @@ ROM_END
/* Tiles are 6 bit, 4 bits stored in one rom, 2 bits in the other.
Expand the 2 bit part into a 4 bit layout, so we can decode it */
-static void sailormn_unpack_tiles( running_machine *machine, const char *region )
+static void sailormn_unpack_tiles( running_machine &machine, const char *region )
{
- const UINT32 len = machine->region(region)->bytes();
- UINT8 *rgn = machine->region(region)->base();
+ const UINT32 len = machine.region(region)->bytes();
+ UINT8 *rgn = machine.region(region)->base();
UINT8 *src = rgn + (len/4)*3 - 1;
UINT8 *dst = rgn + (len/4)*4 - 2;
@@ -4384,9 +4384,9 @@ static void sailormn_unpack_tiles( running_machine *machine, const char *region
}
}
-static void init_cave(running_machine *machine)
+static void init_cave(running_machine &machine)
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
state->spritetype[0] = 0; // Normal sprites
state->kludge = 0;
@@ -4398,17 +4398,17 @@ static void init_cave(running_machine *machine)
static DRIVER_INIT( agallet )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000);
@@ -4419,7 +4419,7 @@ static DRIVER_INIT( agallet )
static DRIVER_INIT( dfeveron )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4428,7 +4428,7 @@ static DRIVER_INIT( dfeveron )
static DRIVER_INIT( feversos )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4437,7 +4437,7 @@ static DRIVER_INIT( feversos )
static DRIVER_INIT( ddonpach )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
ddonpach_unpack_sprites(machine);
@@ -4447,7 +4447,7 @@ static DRIVER_INIT( ddonpach )
static DRIVER_INIT( donpachi )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
ddonpach_unpack_sprites(machine);
@@ -4458,7 +4458,7 @@ static DRIVER_INIT( donpachi )
static DRIVER_INIT( esprade )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
esprade_unpack_sprites(machine);
@@ -4466,7 +4466,7 @@ static DRIVER_INIT( esprade )
#if 0 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x118A/2] = 0x4e71; //palette fix 118A: 5548 SUBQ.W #2,A0 --> NOP
}
#endif
@@ -4474,7 +4474,7 @@ static DRIVER_INIT( esprade )
static DRIVER_INIT( gaia )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
/* No EEPROM */
@@ -4486,7 +4486,7 @@ static DRIVER_INIT( gaia )
static DRIVER_INIT( guwange )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
esprade_unpack_sprites(machine);
@@ -4495,15 +4495,15 @@ static DRIVER_INIT( guwange )
static DRIVER_INIT( hotdogst )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank2", 0, 0x2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank2", 2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000);
@@ -4514,18 +4514,18 @@ static DRIVER_INIT( hotdogst )
static DRIVER_INIT( mazinger )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
init_cave(machine);
memory_configure_bank(machine, "bank2", 0, 2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank2", 2, 6, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000);
@@ -4545,25 +4545,25 @@ static DRIVER_INIT( mazinger )
state->time_vblank_irq = 2100;
/* setup extra ROM */
- memory_set_bankptr(machine, "bank1",machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank1",machine.region("user1")->base());
}
static DRIVER_INIT( metmqstr )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 8, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 8, &ROM[0x00000], 0x20000);
@@ -4576,11 +4576,11 @@ static DRIVER_INIT( metmqstr )
static DRIVER_INIT( pwrinst2j )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
int i, j;
init_cave(machine);
@@ -4616,7 +4616,7 @@ static DRIVER_INIT( pwrinst2 )
#if 1 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0xd46c / 2] = 0xd482; // kurara dash fix 0xd400 -> 0xd482
}
#endif
@@ -4625,22 +4625,22 @@ static DRIVER_INIT( pwrinst2 )
static DRIVER_INIT( sailormn )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000);
@@ -4667,7 +4667,7 @@ static DRIVER_INIT( sailormn )
static DRIVER_INIT( tjumpman )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4681,7 +4681,7 @@ static DRIVER_INIT( tjumpman )
static DRIVER_INIT( uopoko )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4691,7 +4691,7 @@ static DRIVER_INIT( uopoko )
static DRIVER_INIT( korokoro )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
state->irq_level = 2;
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 19ee10a73a0..6261419abde 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -329,9 +329,9 @@ static const rectangle visible3 = { 0*8, (14+48)*8-1, 17*8, (17+7)*8-1 };
static SCREEN_UPDATE(cb2001)
{
- cb2001_state *state = screen->machine->driver_data<cb2001_state>();
+ cb2001_state *state = screen->machine().driver_data<cb2001_state>();
int count,x,y;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = 0x0000;
@@ -352,7 +352,7 @@ static SCREEN_UPDATE(cb2001)
tile += state->videobank*0x2000;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8);
count++;
}
@@ -413,7 +413,7 @@ static SCREEN_UPDATE(cb2001)
tile += 0x1000;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8,0);
count++;
}
}
@@ -429,7 +429,7 @@ static SCREEN_UPDATE(cb2001)
is being executed incorrectly */
WRITE16_HANDLER( cb2001_vidctrl_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
if (mem_mask&0xff00) // video control?
{
printf("cb2001_vidctrl_w %04x %04x\n", data, mem_mask);
@@ -441,7 +441,7 @@ WRITE16_HANDLER( cb2001_vidctrl_w )
WRITE16_HANDLER( cb2001_vidctrl2_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
if (mem_mask&0xff00) // video control?
{
printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // i think this switches to 'reels' mode
@@ -456,7 +456,7 @@ WRITE16_HANDLER( cb2001_vidctrl2_w )
static TILE_GET_INFO( get_cb2001_reel1_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0000/2) + tile_index/2];
if (tile_index&1)
@@ -475,7 +475,7 @@ static TILE_GET_INFO( get_cb2001_reel1_tile_info )
static TILE_GET_INFO( get_cb2001_reel2_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0200/2) + tile_index/2];
if (tile_index&1)
@@ -495,7 +495,7 @@ static TILE_GET_INFO( get_cb2001_reel2_tile_info )
static TILE_GET_INFO( get_cb2001_reel3_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0400/2) + tile_index/2];
int colour = 0;//(cb2001_out_c&0x7) + 8;
@@ -514,7 +514,7 @@ static TILE_GET_INFO( get_cb2001_reel3_tile_info )
static VIDEO_START(cb2001)
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
state->reel1_tilemap = tilemap_create(machine,get_cb2001_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_cb2001_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_cb2001_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
@@ -526,7 +526,7 @@ static VIDEO_START(cb2001)
WRITE16_HANDLER( cb2001_bg_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
COMBINE_DATA(&state->vram_bg[offset]);
// also used for the reel tilemaps in a different mode
@@ -778,8 +778,8 @@ static PALETTE_INIT(cb2001)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
- int length = machine->region("proms")->bytes();
+ UINT8*proms = machine.region("proms")->base();
+ int length = machine.region("proms")->bytes();
UINT16 dat;
dat = (proms[0x000+i] << 8) | proms[0x200+i];
diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c
index f473937a1c2..64504e30080 100644
--- a/src/mame/drivers/cball.c
+++ b/src/mame/drivers/cball.c
@@ -27,7 +27,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, code, code >> 7, 0);
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_tile_info )
static WRITE8_HANDLER( cball_vram_w )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -45,20 +45,20 @@ static WRITE8_HANDLER( cball_vram_w )
static VIDEO_START( cball )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( cball )
{
- cball_state *state = screen->machine->driver_data<cball_state>();
+ cball_state *state = screen->machine().driver_data<cball_state>();
/* draw playfield */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw sprite */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->video_ram[0x399] >> 4,
0,
0, 0,
@@ -70,7 +70,7 @@ static SCREEN_UPDATE( cball )
static TIMER_CALLBACK( interrupt_callback )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
int scanline = param;
generic_pulse_irq_line(state->maincpu, 0);
@@ -80,19 +80,19 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 262)
scanline = 16;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
}
static MACHINE_START( cball )
{
- cball_state *state = machine->driver_data<cball_state>();
- state->maincpu = machine->device("maincpu");
+ cball_state *state = machine.driver_data<cball_state>();
+ state->maincpu = machine.device("maincpu");
}
static MACHINE_RESET( cball )
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
}
@@ -109,7 +109,7 @@ static PALETTE_INIT( cball )
static READ8_HANDLER( cball_wram_r )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
return state->video_ram[0x380 + offset];
}
@@ -117,7 +117,7 @@ static READ8_HANDLER( cball_wram_r )
static WRITE8_HANDLER( cball_wram_w )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
state->video_ram[0x380 + offset] = data;
}
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index ed38648d1f5..16eb995f883 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -29,11 +29,11 @@
static WRITE8_HANDLER( cbasebal_bankswitch_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
/* bits 0-4 select ROM bank */
//logerror("%04x: bankswitch %02x\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
/* bit 5 used but unknown */
@@ -44,7 +44,7 @@ static WRITE8_HANDLER( cbasebal_bankswitch_w )
static READ8_HANDLER( bankedram_r )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
switch (state->rambank)
{
@@ -52,7 +52,7 @@ static READ8_HANDLER( bankedram_r )
return cbasebal_textram_r(space, offset); /* VRAM */
case 1:
if (offset < 0x800)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return 0;
break;
@@ -63,7 +63,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
switch (state->rambank)
{
@@ -82,10 +82,10 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( cbasebal_coinctrl_w )
{
- coin_lockout_w(space->machine, 0, ~data & 0x04);
- coin_lockout_w(space->machine, 1, ~data & 0x08);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_lockout_w(space->machine(), 0, ~data & 0x04);
+ coin_lockout_w(space->machine(), 1, ~data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
@@ -244,9 +244,9 @@ GFXDECODE_END
static MACHINE_START( cbasebal )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
- memory_configure_bank(machine, "bank1", 0, 32, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 32, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->rambank));
state->save_item(NAME(state->tilebank));
@@ -261,7 +261,7 @@ static MACHINE_START( cbasebal )
static MACHINE_RESET( cbasebal )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
state->rambank = 0;
state->tilebank = 0;
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index a9fede405df..67d2ad8d3e4 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -28,7 +28,7 @@
static WRITE16_HANDLER( twocrude_control_w )
{
- cbuster_state *state = space->machine->driver_data<cbuster_state>();
+ cbuster_state *state = space->machine().driver_data<cbuster_state>();
switch (offset << 1)
{
@@ -81,22 +81,22 @@ static WRITE16_HANDLER( twocrude_control_w )
static READ16_HANDLER( twocrude_control_r )
{
- cbuster_state *state = space->machine->driver_data<cbuster_state>();
+ cbuster_state *state = space->machine().driver_data<cbuster_state>();
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Dip Switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 4: /* Protection */
logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(space->cpu), offset);
return state->prot;
case 6: /* Credits, VBL in byte 7 */
- return input_port_read(space->machine, "COINS");
+ return input_port_read(space->machine(), "COINS");
}
return ~0;
@@ -266,7 +266,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cbuster_state *driver_state = device->machine->driver_data<cbuster_state>();
+ cbuster_state *driver_state = device->machine().driver_data<cbuster_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -306,12 +306,12 @@ static const deco16ic_interface twocrude_deco16ic_tilegen2_intf =
static MACHINE_START( cbuster )
{
- cbuster_state *state = machine->driver_data<cbuster_state>();
+ cbuster_state *state = machine.driver_data<cbuster_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
- state->deco_tilegen2 = machine->device("tilegen2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
+ state->deco_tilegen2 = machine.device("tilegen2");
state->save_item(NAME(state->prot));
state->save_item(NAME(state->pri));
@@ -319,7 +319,7 @@ static MACHINE_START( cbuster )
static MACHINE_RESET( cbuster )
{
- cbuster_state *state = machine->driver_data<cbuster_state>();
+ cbuster_state *state = machine.driver_data<cbuster_state>();
state->prot = 0;
state->pri = 0;
@@ -533,7 +533,7 @@ ROM_END
static DRIVER_INIT( twocrude )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
UINT8 *PTR;
int i, j;
@@ -550,8 +550,8 @@ static DRIVER_INIT( twocrude )
}
/* Rearrange the 'extra' sprite bank to be in the same format as main sprites */
- RAM = machine->region("gfx3")->base() + 0x080000;
- PTR = machine->region("gfx3")->base() + 0x140000;
+ RAM = machine.region("gfx3")->base() + 0x080000;
+ PTR = machine.region("gfx3")->base() + 0x140000;
for (i = 0; i < 0x20000; i += 64)
{
for (j = 0; j < 16; j += 1)
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index 8ba4bc0592f..fd79d138ba7 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -138,9 +138,9 @@
*
*************************************/
-INLINE void schedule_next_irq( running_machine *machine, int curscanline )
+INLINE void schedule_next_irq( running_machine &machine, int curscanline )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
/* scan for a rising edge on the IRQCK signal */
for (curscanline++; ; curscanline = (curscanline + 1) & 0xff)
@@ -148,13 +148,13 @@ INLINE void schedule_next_irq( running_machine *machine, int curscanline )
break;
/* next one at the start of this scanline */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(curscanline), curscanline);
}
static TIMER_CALLBACK( clock_irq )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
/* assert the IRQ if not already asserted */
if (!state->irq_state)
@@ -164,7 +164,7 @@ static TIMER_CALLBACK( clock_irq )
}
/* force an update now */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* find the next edge */
schedule_next_irq(machine, param);
@@ -173,8 +173,8 @@ static TIMER_CALLBACK( clock_irq )
static CUSTOM_INPUT( get_vblank )
{
- ccastles_state *state = field->port->machine->driver_data<ccastles_state>();
- int scanline = field->port->machine->primary_screen->vpos();
+ ccastles_state *state = field->port->machine().driver_data<ccastles_state>();
+ int scanline = field->port->machine().primary_screen->vpos();
return state->syncprom[scanline & 0xff] & 1;
}
@@ -188,11 +188,11 @@ static CUSTOM_INPUT( get_vblank )
static MACHINE_START( ccastles )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
rectangle visarea;
/* initialize globals */
- state->syncprom = machine->region("proms")->base() + 0x000;
+ state->syncprom = machine.region("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->vblank_start = 0; state->vblank_start < 256; state->vblank_start++)
@@ -214,13 +214,13 @@ static MACHINE_START( ccastles )
visarea.max_x = 255;
visarea.min_y = state->vblank_end;
visarea.max_y = state->vblank_start - 1;
- machine->primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
+ machine.primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
/* configure the ROM banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0xa000, 0x6000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0xa000, 0x6000);
/* create a timer for IRQs and set up the first callback */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
state->irq_state = 0;
schedule_next_irq(machine, 0);
@@ -232,7 +232,7 @@ static MACHINE_START( ccastles )
static MACHINE_RESET( ccastles )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
@@ -247,7 +247,7 @@ static MACHINE_RESET( ccastles )
static WRITE8_HANDLER( irq_ack_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
if (state->irq_state)
{
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -258,19 +258,19 @@ static WRITE8_HANDLER( irq_ack_w )
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 1);
+ set_led_status(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( ccounter_w )
{
- coin_counter_w(space->machine, offset, data & 1);
+ coin_counter_w(space->machine(), offset, data & 1);
}
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
@@ -278,7 +278,7 @@ static READ8_HANDLER( leta_r )
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
- return input_port_read(space->machine, letanames[offset]);
+ return input_port_read(space->machine(), letanames[offset]);
}
@@ -291,7 +291,7 @@ static READ8_HANDLER( leta_r )
static WRITE8_HANDLER( nvram_recall_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_4b->recall(0);
state->nvram_4b->recall(1);
state->nvram_4b->recall(0);
@@ -303,7 +303,7 @@ static WRITE8_HANDLER( nvram_recall_w )
static WRITE8_HANDLER( nvram_store_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_store[offset] = data & 1;
state->nvram_4b->store(~state->nvram_store[0] & state->nvram_store[1]);
state->nvram_4a->store(~state->nvram_store[0] & state->nvram_store[1]);
@@ -312,14 +312,14 @@ static WRITE8_HANDLER( nvram_store_w )
static READ8_HANDLER( nvram_r )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
return (state->nvram_4b->read(*space, offset) & 0x0f) | (state->nvram_4a->read(*space, offset) << 4);
}
static WRITE8_HANDLER( nvram_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_4b->write(*space, offset, data);
state->nvram_4a->write(*space, offset, data >> 4);
}
diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c
index df156b3f151..f3f684c0724 100644
--- a/src/mame/drivers/cchance.c
+++ b/src/mame/drivers/cchance.c
@@ -53,21 +53,21 @@ static WRITE8_HANDLER( output_0_w )
{
//---- --x- divider?
- coin_lockout_w(space->machine, 0, ~data & 1);
+ coin_lockout_w(space->machine(), 0, ~data & 1);
-// coin_counter_w(space->machine, 0, ~data & 1);
+// coin_counter_w(space->machine(), 0, ~data & 1);
}
static READ8_HANDLER( input_1_r )
{
- cchance_state *state = space->machine->driver_data<cchance_state>();
- return (state->hop_io) | (state->bell_io) | (input_port_read(space->machine, "SP") & 0xff);
+ cchance_state *state = space->machine().driver_data<cchance_state>();
+ return (state->hop_io) | (state->bell_io) | (input_port_read(space->machine(), "SP") & 0xff);
}
static WRITE8_HANDLER( output_1_w )
{
- cchance_state *state = space->machine->driver_data<cchance_state>();
+ cchance_state *state = space->machine().driver_data<cchance_state>();
state->hop_io = (data & 0x40)>>4;
state->bell_io = (data & 0x80)>>4;
@@ -195,7 +195,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( cchance )
{
- cchance_state *state = machine->driver_data<cchance_state>();
+ cchance_state *state = machine.driver_data<cchance_state>();
state->mcu = NULL;
state->save_item(NAME(state->screenflip));
@@ -205,7 +205,7 @@ static MACHINE_START( cchance )
static MACHINE_RESET( cchance )
{
- cchance_state *state = machine->driver_data<cchance_state>();
+ cchance_state *state = machine.driver_data<cchance_state>();
state->screenflip = 0;
state->mcu_type = -1;
diff --git a/src/mame/drivers/cchasm.c b/src/mame/drivers/cchasm.c
index c065d3281d9..7318b317746 100644
--- a/src/mame/drivers/cchasm.c
+++ b/src/mame/drivers/cchasm.c
@@ -69,7 +69,7 @@ ADDRESS_MAP_END
static WRITE_LINE_DEVICE_HANDLER( cchasm_6840_irq )
{
- cputag_set_input_line(device->machine, "maincpu", 4, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 4, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface cchasm_6840_intf =
diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c
index 7be66555323..ddb46371f92 100644
--- a/src/mame/drivers/cclimber.c
+++ b/src/mame/drivers/cclimber.c
@@ -217,60 +217,60 @@ Dip location verified from manual for: cclimber, guzzler, swimmer
static WRITE8_HANDLER( swimmer_sh_soundlatch_w )
{
soundlatch_w(space,offset,data);
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( yamato_p0_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->yamato_p0 = data;
}
static WRITE8_HANDLER( yamato_p1_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->yamato_p1 = data;
}
static READ8_HANDLER( yamato_p0_r )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
return state->yamato_p0;
}
static READ8_HANDLER( yamato_p1_r )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
return state->yamato_p1;
}
static WRITE8_HANDLER(toprollr_rombank_w)
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->toprollr_rombank &= ~(1 << offset);
state->toprollr_rombank |= (data & 1) << offset;
if (state->toprollr_rombank < 3)
- memory_set_bank(space->machine, "bank1", state->toprollr_rombank);
+ memory_set_bank(space->machine(), "bank1", state->toprollr_rombank);
}
static TIMER_CALLBACK( disable_interrupts )
{
- cpu_interrupt_enable(machine->device("maincpu"), 0);
+ cpu_interrupt_enable(machine.device("maincpu"), 0);
}
static MACHINE_RESET( cclimber )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
/* Disable interrupts, River Patrol / Silver Land needs this */
/* we must do this on a timer in order to have it take effect */
/* otherwise, the reset process will override our changes */
- machine->scheduler().synchronize(FUNC(disable_interrupts));
+ machine.scheduler().synchronize(FUNC(disable_interrupts));
state->toprollr_rombank = 0;
}
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index 0e097900e95..af92b1ca24e 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -46,7 +46,7 @@
#define MGNUMBER_USE_JOY 1
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra);
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra);
static WRITE32_HANDLER( aga_overlay_w )
{
@@ -55,7 +55,7 @@ static WRITE32_HANDLER( aga_overlay_w )
data = (data >> 16) & 1;
/* switch banks as appropriate */
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
@@ -85,12 +85,12 @@ static WRITE32_HANDLER( aga_overlay_w )
static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
{
/* bit 1 = cd audio mute */
- device->machine->device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
+ device->machine().device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
/* bit 2 = Power Led on Amiga */
- set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
+ set_led_status(device->machine(), 0, (data & 2) ? 0 : 1);
- handle_cd32_joystick_cia(device->machine, data, mos6526_r(device, 2));
+ handle_cd32_joystick_cia(device->machine(), data, mos6526_r(device, 2));
}
/*************************************
@@ -111,14 +111,14 @@ static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
static READ8_DEVICE_HANDLER( cd32_cia_0_portb_r )
{
/* parallel port */
- logerror("%s:CIA0_portb_r\n", device->machine->describe_context());
+ logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( cd32_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
static ADDRESS_MAP_START( cd32_map, AS_PROGRAM, 32 )
@@ -141,9 +141,9 @@ ADDRESS_MAP_END
*
*************************************/
-static void cd32_potgo_w(running_machine *machine, UINT16 data)
+static void cd32_potgo_w(running_machine &machine, UINT16 data)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
if (state->input_hack != NULL)
@@ -171,9 +171,9 @@ static void cd32_potgo_w(running_machine *machine, UINT16 data)
}
}
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra)
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
for (i = 0; i < 2; i++)
@@ -198,9 +198,9 @@ static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8
}
}
-static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
+static UINT16 handle_joystick_potgor(running_machine &machine, UINT16 potgor)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const char *const player_portname[] = { "P2", "P1" };
int i;
@@ -230,8 +230,8 @@ static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
static CUSTOM_INPUT(cubo_input)
{
- cd32_state *state = field->port->machine->driver_data<cd32_state>();
- return handle_joystick_potgor(field->port->machine, state->potgo_value) >> 10;
+ cd32_state *state = field->port->machine().driver_data<cd32_state>();
+ return handle_joystick_potgor(field->port->machine(), state->potgo_value) >> 10;
}
static INPUT_PORTS_START( cd32 )
@@ -825,7 +825,7 @@ ROM_END
static DRIVER_INIT( cd32 )
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const amiga_machine_interface cd32_intf =
{
AGA_CHIP_RAM_MASK,
@@ -841,7 +841,7 @@ static DRIVER_INIT( cd32 )
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* input hack */
state->input_hack = NULL;
@@ -1221,35 +1221,35 @@ ROM_END
*
*************************************/
-static void cndypuzl_input_hack(running_machine *machine)
+static void cndypuzl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x051c02, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ebe, 0x0000);
}
}
static DRIVER_INIT(cndypuzl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = cndypuzl_input_hack;
}
-static void haremchl_input_hack(running_machine *machine)
+static void haremchl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x002907, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x1f, 0x00);
}
@@ -1257,20 +1257,20 @@ static void haremchl_input_hack(running_machine *machine)
static DRIVER_INIT(haremchl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = haremchl_input_hack;
}
-static void lsrquiz_input_hack(running_machine *machine)
+static void lsrquiz_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x001e1b, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x13, 0x00);
}
@@ -1278,21 +1278,21 @@ static void lsrquiz_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz_input_hack;
}
/* The hack isn't working if you exit the test mode with P1 button 2 ! */
-static void lsrquiz2_input_hack(running_machine *machine)
+static void lsrquiz2_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x046107, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 2));
amiga_chip_ram_w8(state, r_A2 + 0x17, 0x00);
}
@@ -1300,20 +1300,20 @@ static void lsrquiz2_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz2)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz2_input_hack;
}
-static void lasstixx_input_hack(running_machine *machine)
+static void lasstixx_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x00281c, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x24, 0x00);
}
@@ -1321,47 +1321,47 @@ static void lasstixx_input_hack(running_machine *machine)
static DRIVER_INIT(lasstixx)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lasstixx_input_hack;
}
-static void mgnumber_input_hack(running_machine *machine)
+static void mgnumber_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x04bfa0, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ed8, 0x0000);
}
}
static DRIVER_INIT(mgnumber)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgnumber_input_hack;
}
-static void mgprem11_input_hack(running_machine *machine)
+static void mgprem11_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x044f7e, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
amiga_chip_ram_w8(state, r_A5 - 0x7eca, 0x00);
}
}
static DRIVER_INIT(mgprem11)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgprem11_input_hack;
}
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 192ecf72a60..82d80d93c72 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -35,7 +35,7 @@ TODO:
#include "imagedev/chd_cd.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -44,7 +44,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
@@ -81,49 +81,49 @@ ADDRESS_MAP_END
static INPUT_CHANGED( mcu_input )
{
- cdi_state *state = field->port->machine->driver_data<cdi_state>();
+ cdi_state *state = field->port->machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
bool send = false;
switch((FPTR)param)
{
case 0x39:
- if(input_port_read(field->port->machine, "INPUT1") & 0x01) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x01) send = true;
break;
case 0x37:
- if(input_port_read(field->port->machine, "INPUT1") & 0x02) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x02) send = true;
break;
case 0x31:
- if(input_port_read(field->port->machine, "INPUT1") & 0x04) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x04) send = true;
break;
case 0x32:
- if(input_port_read(field->port->machine, "INPUT1") & 0x08) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x08) send = true;
break;
case 0x33:
- if(input_port_read(field->port->machine, "INPUT1") & 0x10) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x10) send = true;
break;
case 0x30:
- if(input_port_read(field->port->machine, "INPUT2") & 0x01) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x01) send = true;
break;
case 0x38:
- if(input_port_read(field->port->machine, "INPUT2") & 0x02) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x02) send = true;
break;
case 0x34:
- if(input_port_read(field->port->machine, "INPUT2") & 0x04) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x04) send = true;
break;
case 0x35:
- if(input_port_read(field->port->machine, "INPUT2") & 0x08) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x08) send = true;
break;
case 0x36:
- if(input_port_read(field->port->machine, "INPUT2") & 0x10) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x10) send = true;
break;
}
if(send)
{
UINT8 data = (UINT8)((FPTR)param & 0x000000ff);
- scc68070_quizard_rx(field->port->machine, scc68070, data);
+ scc68070_quizard_rx(field->port->machine(), scc68070, data);
}
}
@@ -192,25 +192,25 @@ INPUT_PORTS_END
static MACHINE_START( cdi )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
scc68070_register_globals(machine, &state->scc68070_regs);
}
static MACHINE_RESET( cdi )
{
- cdi_state *state = machine->driver_data<cdi_state>();
- UINT16 *src = (UINT16*)machine->region("maincpu")->base();
+ cdi_state *state = machine.driver_data<cdi_state>();
+ UINT16 *src = (UINT16*)machine.region("maincpu")->base();
UINT16 *dst = state->planea;
- //device_t *cdrom_dev = machine->device("cdrom");
+ //device_t *cdrom_dev = machine.device("cdrom");
memcpy(dst, src, 0x8);
scc68070_init(machine, &state->scc68070_regs);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
- state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ state->dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ state->dmadac[1] = machine.device<dmadac_sound_device>("dac2");
}
static MACHINE_RESET( quizrd12 )
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 3f179a9120c..f23994c57d3 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -446,16 +446,16 @@ static TIMER_DEVICE_CALLBACK( generate_interrupt )
/* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
if (scanline & 16)
- cputag_set_input_line(timer.machine, "maincpu", 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
/* do a partial update now to handle sprite multiplexing (Maze Invaders) */
- timer.machine->primary_screen->update_partial(scanline);
+ timer.machine().primary_screen->update_partial(scanline);
}
static MACHINE_START( centiped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->save_item(NAME(state->oldpos));
state->save_item(NAME(state->sign));
@@ -465,7 +465,7 @@ static MACHINE_START( centiped )
static MACHINE_RESET( centiped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->dsw_select = 0;
@@ -475,7 +475,7 @@ static MACHINE_RESET( centiped )
static MACHINE_RESET( magworm )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
MACHINE_RESET_CALL(centiped);
@@ -486,7 +486,7 @@ static MACHINE_RESET( magworm )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -515,9 +515,9 @@ static WRITE8_HANDLER( irq_ack_w )
* to prevent the counter from wrapping around between reads.
*/
-INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
+INLINE int read_trackball(running_machine &machine, int idx, int switch_port)
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 newpos;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
static const char *const tracknames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
@@ -545,25 +545,25 @@ INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
static READ8_HANDLER( centiped_IN0_r )
{
- return read_trackball(space->machine, 0, 0);
+ return read_trackball(space->machine(), 0, 0);
}
static READ8_HANDLER( centiped_IN2_r )
{
- return read_trackball(space->machine, 1, 2);
+ return read_trackball(space->machine(), 1, 2);
}
static READ8_HANDLER( milliped_IN1_r )
{
- return read_trackball(space->machine, 1, 1);
+ return read_trackball(space->machine(), 1, 1);
}
static READ8_HANDLER( milliped_IN2_r )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
- UINT8 data = input_port_read(space->machine, "IN2");
+ centiped_state *state = space->machine().driver_data<centiped_state>();
+ UINT8 data = input_port_read(space->machine(), "IN2");
/* MSH - 15 Feb, 2007
* The P2 X Joystick inputs are not properly handled in
@@ -574,7 +574,7 @@ static READ8_HANDLER( milliped_IN2_r )
*/
if (0 != state->control_select) {
/* Bottom 4 bits is our joystick inputs */
- UINT8 joy2data = input_port_read(space->machine, "IN3") & 0x0f;
+ UINT8 joy2data = input_port_read(space->machine(), "IN3") & 0x0f;
data = data & 0xf0; /* Keep the top 4 bits */
data |= (joy2data & 0x0a) >> 1; /* flip left and up */
data |= (joy2data & 0x05) << 1; /* flip right and down */
@@ -584,7 +584,7 @@ static READ8_HANDLER( milliped_IN2_r )
static WRITE8_HANDLER( input_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->dsw_select = (~data >> 7) & 1;
}
@@ -592,7 +592,7 @@ static WRITE8_HANDLER( input_select_w )
/* used P2 controls if 1, P1 controls if 0 */
static WRITE8_HANDLER( control_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->control_select = (data >> 7) & 1;
}
@@ -600,16 +600,16 @@ static WRITE8_HANDLER( control_select_w )
static READ8_HANDLER( mazeinv_input_r )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
static const char *const sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
- return input_port_read(space->machine, sticknames[state->control_select]);
+ return input_port_read(space->machine(), sticknames[state->control_select]);
}
static WRITE8_HANDLER( mazeinv_input_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->control_select = offset & 3;
}
@@ -636,25 +636,25 @@ static READ8_HANDLER( bullsdrt_data_port_r )
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 0x80);
+ set_led_status(space->machine(), offset, ~data & 0x80);
}
static READ8_DEVICE_HANDLER( caterplr_rand_r )
{
- return device->machine->rand() % 0xff;
+ return device->machine().rand() % 0xff;
}
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static WRITE8_HANDLER( bullsdrt_coin_count_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
@@ -1985,8 +1985,8 @@ ROM_END
static DRIVER_INIT( caterplr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *device = machine->device("pokey");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *device = machine.device("pokey");
space->install_legacy_readwrite_handler(*device, 0x1000, 0x100f, FUNC(caterplr_AY8910_r), FUNC(caterplr_AY8910_w));
space->install_legacy_read_handler(*device, 0x1780, 0x1780, FUNC(caterplr_rand_r));
}
@@ -1994,8 +1994,8 @@ static DRIVER_INIT( caterplr )
static DRIVER_INIT( magworm )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *device = machine->device("pokey");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *device = machine.device("pokey");
space->install_legacy_write_handler(*device, 0x1001, 0x1001, FUNC(ay8910_address_w));
space->install_legacy_readwrite_handler(*device, 0x1003, 0x1003, FUNC(ay8910_r), FUNC(ay8910_data_w));
}
@@ -2003,7 +2003,7 @@ static DRIVER_INIT( magworm )
static DRIVER_INIT( bullsdrt )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->dsw_select = 0;
}
diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c
index 64d541e1e2b..d03030aa1bd 100644
--- a/src/mame/drivers/chaknpop.c
+++ b/src/mame/drivers/chaknpop.c
@@ -18,12 +18,12 @@
static WRITE8_DEVICE_HANDLER ( unknown_port_1_w )
{
- //logerror("%s: write to unknow port 1: 0x%02x\n", device->machine->describe_context(), data);
+ //logerror("%s: write to unknow port 1: 0x%02x\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER ( unknown_port_2_w )
{
- //logerror("%s: write to unknow port 2: 0x%02x\n", device->machine->describe_context(), data);
+ //logerror("%s: write to unknow port 2: 0x%02x\n", device->machine().describe_context(), data);
}
static WRITE8_HANDLER ( coinlock_w )
@@ -243,8 +243,8 @@ GFXDECODE_END
static MACHINE_START( chaknpop )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -259,7 +259,7 @@ static MACHINE_START( chaknpop )
static MACHINE_RESET( chaknpop )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
state->gfxmode = 0;
state->flip_x = 0;
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 19a85a8aa0f..f0b7a1ee7c2 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -77,9 +77,9 @@ public:
-static void cham24_set_mirroring( running_machine *machine, int mirroring )
+static void cham24_set_mirroring( running_machine &machine, int mirroring )
{
- cham24_state *state = machine->driver_data<cham24_state>();
+ cham24_state *state = machine.driver_data<cham24_state>();
switch(mirroring)
{
case PPU_MIRROR_LOW:
@@ -112,14 +112,14 @@ static void cham24_set_mirroring( running_machine *machine, int mirroring )
static WRITE8_HANDLER( nt_w )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
int page = ((offset & 0xc00) >> 10);
state->nt_page[page][offset & 0x3ff] = data;
}
static READ8_HANDLER( nt_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
int page = ((offset & 0xc00) >> 10);
return state->nt_page[page][offset & 0x3ff];
@@ -128,7 +128,7 @@ static READ8_HANDLER( nt_r )
static WRITE8_HANDLER( sprite_dma_w )
{
int source = (data & 7);
- ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source);
+ ppu2c0x_spriteram_dma(space, space->machine().device("ppu"), source);
}
static READ8_DEVICE_HANDLER( psg_4015_r )
@@ -149,13 +149,13 @@ static WRITE8_DEVICE_HANDLER( psg_4017_w )
static READ8_HANDLER( cham24_IN0_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
return ((state->in_0 >> state->in_0_shift++) & 0x01) | 0x40;
}
static WRITE8_HANDLER( cham24_IN0_w )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
if (data & 0xfe)
{
//logerror("Unhandled cham24_IN0_w write: data = %02X\n", data);
@@ -169,14 +169,14 @@ static WRITE8_HANDLER( cham24_IN0_w )
state->in_0_shift = 0;
state->in_1_shift = 0;
- state->in_0 = input_port_read(space->machine, "P1");
- state->in_1 = input_port_read(space->machine, "P2");
+ state->in_0 = input_port_read(space->machine(), "P1");
+ state->in_1 = input_port_read(space->machine(), "P2");
}
static READ8_HANDLER( cham24_IN1_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
return ((state->in_1 >> state->in_1_shift++) & 0x01) | 0x40;
}
@@ -188,14 +188,14 @@ static WRITE8_HANDLER( cham24_mapper_w )
UINT32 prg_bank_page_size = (offset >> 12) & 0x01;
UINT32 gfx_mirroring = (offset >> 13) & 0x01;
- UINT8* dst = space->machine->region("maincpu")->base();
- UINT8* src = space->machine->region("user1")->base();
+ UINT8* dst = space->machine().region("maincpu")->base();
+ UINT8* src = space->machine().region("user1")->base();
// switch PPU VROM bank
- memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * gfx_bank));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("gfx1")->base() + (0x2000 * gfx_bank));
// set gfx mirroring
- cham24_set_mirroring(space->machine, gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ cham24_set_mirroring(space->machine(), gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
// switch PRG bank
if (prg_bank_page_size == 0)
@@ -269,7 +269,7 @@ static PALETTE_INIT( cham24 )
static void ppu_irq( device_t *device, int *ppu_regs )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
/* our ppu interface */
@@ -288,24 +288,24 @@ static VIDEO_START( cham24 )
static SCREEN_UPDATE( cham24 )
{
/* render the ppu */
- ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0);
+ ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0);
return 0;
}
static MACHINE_START( cham24 )
{
- cham24_state *state = machine->driver_data<cham24_state>();
+ cham24_state *state = machine.driver_data<cham24_state>();
/* switch PRG rom */
- UINT8* dst = machine->region("maincpu")->base();
- UINT8* src = machine->region("user1")->base();
+ UINT8* dst = machine.region("maincpu")->base();
+ UINT8* src = machine.region("user1")->base();
memcpy(&dst[0x8000], &src[0x0f8000], 0x4000);
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
/* uses 8K swapping, all ROM!*/
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("gfx1")->base());
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("gfx1")->base());
/* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
@@ -315,7 +315,7 @@ static MACHINE_START( cham24 )
state->nt_page[3] = state->nt_ram + 0xc00;
/* and read/write handlers */
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nt_r), FUNC(nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nt_r), FUNC(nt_w));
}
static DRIVER_INIT( cham24 )
diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c
index d6ce2f98d73..6b8154834db 100644
--- a/src/mame/drivers/champbas.c
+++ b/src/mame/drivers/champbas.c
@@ -97,11 +97,11 @@ TODO:
static SCREEN_EOF( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->watchdog_count++;
if (state->watchdog_count == 0x10)
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -113,20 +113,20 @@ static SCREEN_EOF( champbas )
static WRITE8_HANDLER( champbas_watchdog_reset_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
state->watchdog_count = 0;
}
static CUSTOM_INPUT( champbas_watchdog_bit2 )
{
- champbas_state *state = field->port->machine->driver_data<champbas_state>();
+ champbas_state *state = field->port->machine().driver_data<champbas_state>();
return BIT(state->watchdog_count, 2);
}
static WRITE8_HANDLER( irq_enable_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
int bit = data & 1;
cpu_interrupt_enable(state->maincpu, bit);
@@ -136,7 +136,7 @@ static WRITE8_HANDLER( irq_enable_w )
static TIMER_CALLBACK( exctsccr_fm_callback )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -161,7 +161,7 @@ static WRITE8_HANDLER( champbas_mcu_switch_w )
static WRITE8_HANDLER( champbas_mcu_halt_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
// MCU not present/not used in champbas
if (state->mcu == NULL)
@@ -566,10 +566,10 @@ GFXDECODE_END
static MACHINE_START( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
- state->maincpu = machine->device("maincpu");
- state->mcu = machine->device(CPUTAG_MCU);
+ state->maincpu = machine.device("maincpu");
+ state->mcu = machine.device(CPUTAG_MCU);
state->save_item(NAME(state->watchdog_count));
state->save_item(NAME(state->palette_bank));
@@ -578,11 +578,11 @@ static MACHINE_START( champbas )
static MACHINE_START( exctsccr )
{
- champbas_state *state = machine->driver_data<champbas_state>();
- state->audiocpu = machine->device("audiocpu");
+ champbas_state *state = machine.driver_data<champbas_state>();
+ state->audiocpu = machine.device("audiocpu");
// FIXME
- machine->scheduler().timer_pulse(attotime::from_hz(75), FUNC(exctsccr_fm_callback)); /* updates fm */
+ machine.scheduler().timer_pulse(attotime::from_hz(75), FUNC(exctsccr_fm_callback)); /* updates fm */
MACHINE_START_CALL(champbas);
}
@@ -590,7 +590,7 @@ static MACHINE_START( exctsccr )
static MACHINE_RESET( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->palette_bank = 0;
state->gfx_bank = 0; // talbot has only 1 bank
@@ -1173,9 +1173,9 @@ ROM_END
static DRIVER_INIT(champbas)
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine->region("gfx1")->base();
- UINT8 *rom2 = machine->region("gfx2")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom1 = machine.region("gfx1")->base();
+ UINT8 *rom2 = machine.region("gfx2")->base();
+ int len = machine.region("gfx1")->bytes();
int i;
for (i = 0; i < len/2; ++i)
@@ -1190,8 +1190,8 @@ static DRIVER_INIT(champbas)
static DRIVER_INIT( exctsccr )
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine->region("gfx1")->base();
- UINT8 *rom2 = machine->region("gfx2")->base();
+ UINT8 *rom1 = machine.region("gfx1")->base();
+ UINT8 *rom2 = machine.region("gfx2")->base();
int i;
// planes 0,1
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index 7b762bf06d2..c94e100cd02 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -171,10 +171,10 @@ public:
static READ8_HANDLER( trackball_r )
{
- champbwl_state *state = space->machine->driver_data<champbwl_state>();
+ champbwl_state *state = space->machine().driver_data<champbwl_state>();
UINT8 ret;
- UINT8 port4 = input_port_read(space->machine, "FAKEX");
- UINT8 port5 = input_port_read(space->machine, "FAKEY");
+ UINT8 port4 = input_port_read(space->machine(), "FAKEX");
+ UINT8 port5 = input_port_read(space->machine(), "FAKEY");
ret = (((port4 - state->last_trackball_val[0]) & 0x0f)<<4) | ((port5 - state->last_trackball_val[1]) & 0x0f);
@@ -186,18 +186,18 @@ static READ8_HANDLER( trackball_r )
static WRITE8_HANDLER( champbwl_misc_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
- coin_lockout_w(space->machine, 0, ~data & 8);
- coin_lockout_w(space->machine, 1, ~data & 4);
+ coin_lockout_w(space->machine(), 0, ~data & 8);
+ coin_lockout_w(space->machine(), 1, ~data & 4);
- memory_set_bank(space->machine, "bank1", (data & 0x30) >> 4);
+ memory_set_bank(space->machine(), "bank1", (data & 0x30) >> 4);
}
static WRITE8_HANDLER( champbwl_objctrl_w )
{
- champbwl_state *state = space->machine->driver_data<champbwl_state>();
+ champbwl_state *state = space->machine().driver_data<champbwl_state>();
if(offset != 0)
data ^= 0xff;
@@ -345,8 +345,8 @@ static const x1_010_interface champbwl_sound_intf =
static MACHINE_START( champbwl )
{
- champbwl_state *state = machine->driver_data<champbwl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ champbwl_state *state = machine.driver_data<champbwl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
state->mcu = NULL;
@@ -358,7 +358,7 @@ static MACHINE_START( champbwl )
static MACHINE_RESET( champbwl )
{
- champbwl_state *state = machine->driver_data<champbwl_state>();
+ champbwl_state *state = machine.driver_data<champbwl_state>();
state->screenflip = 0;
state->mcu_type = -1;
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index 62464ddeaa6..0fd90deec8c 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -77,11 +77,11 @@ static PALETTE_INIT( chanbara )
{
int i, red, green, blue;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
red = color_prom[i];
- green = color_prom[machine->total_colors() + i];
- blue = color_prom[2 * machine->total_colors() + i];
+ green = color_prom[machine.total_colors() + i];
+ blue = color_prom[2 * machine.total_colors() + i];
palette_set_color_rgb(machine, i, pal4bit(red << 1), pal4bit(green << 1), pal4bit(blue << 1));
}
@@ -89,7 +89,7 @@ static PALETTE_INIT( chanbara )
static WRITE8_HANDLER( chanbara_videoram_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -97,7 +97,7 @@ static WRITE8_HANDLER( chanbara_videoram_w )
static WRITE8_HANDLER( chanbara_colorram_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -105,7 +105,7 @@ static WRITE8_HANDLER( chanbara_colorram_w )
static WRITE8_HANDLER( chanbara_videoram2_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
@@ -113,7 +113,7 @@ static WRITE8_HANDLER( chanbara_videoram2_w )
static WRITE8_HANDLER( chanbara_colorram2_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
@@ -122,7 +122,7 @@ static WRITE8_HANDLER( chanbara_colorram2_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 1) << 8);
int color = (state->colorram[tile_index] >> 1) & 0x1f;
@@ -131,7 +131,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int code = state->videoram2[tile_index];
int color = (state->colorram2[tile_index] >> 1) & 0x1f;
@@ -140,15 +140,15 @@ static TILE_GET_INFO( get_bg2_tile_info )
static VIDEO_START(chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,8, 8, 32, 32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows,16, 16, 16, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int offs;
for (offs = 0; offs < 0x80; offs += 4)
@@ -173,18 +173,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
if (!flipy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy-16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy-16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code+1, color, flipx, flipy, sx, sy, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy-16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code+1, color, flipx, flipy, sx, sy-16, 0);
}
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
}
}
}
@@ -192,11 +192,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( chanbara )
{
- chanbara_state *state = screen->machine->driver_data<chanbara_state>();
+ chanbara_state *state = screen->machine().driver_data<chanbara_state>();
tilemap_set_scrolly(state->bg2_tilemap, 0, state->scroll | (state->scrollhi << 8));
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -325,7 +325,7 @@ GFXDECODE_END
static WRITE8_DEVICE_HANDLER( chanbara_ay_out_0_w )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
//printf("chanbara_ay_out_0_w %02x\n",data);
state->scroll = data;
@@ -333,19 +333,19 @@ static WRITE8_DEVICE_HANDLER( chanbara_ay_out_0_w )
static WRITE8_DEVICE_HANDLER( chanbara_ay_out_1_w )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
//printf("chanbara_ay_out_1_w %02x\n",data);
state->scrollhi = data & 0x03;
- memory_set_bank(device->machine, "bank1", (data & 0x04) >> 2);
+ memory_set_bank(device->machine(), "bank1", (data & 0x04) >> 2);
//if (data & 0xf8) printf("chanbara_ay_out_1_w unused bits set %02x\n", data & 0xf8);
}
static void sound_irq( device_t *device, int linestate )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
device_set_input_line(state->maincpu, 0, linestate);
}
@@ -366,9 +366,9 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->scroll));
state->save_item(NAME(state->scrollhi));
@@ -376,7 +376,7 @@ static MACHINE_START( chanbara )
static MACHINE_RESET( chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
state->scroll = 0;
state->scrollhi = 0;
@@ -453,9 +453,9 @@ ROM_END
static DRIVER_INIT(chanbara )
{
- UINT8 *src = machine->region("gfx4")->base();
- UINT8 *dst = machine->region("gfx3")->base() + 0x4000;
- UINT8 *bg = machine->region("user1")->base();
+ UINT8 *src = machine.region("gfx4")->base();
+ UINT8 *dst = machine.region("gfx3")->base() + 0x4000;
+ UINT8 *bg = machine.region("user1")->base();
int i;
for (i = 0; i < 0x1000; i++)
diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c
index 7b7c8ff0542..4fedf0d7b61 100644
--- a/src/mame/drivers/changela.c
+++ b/src/mame/drivers/changela.c
@@ -20,7 +20,7 @@ Tomasz Slanina
static READ8_HANDLER( mcu_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
//mame_printf_debug("Z80 MCU R = %x\n", state->mcu_out);
return state->mcu_out;
@@ -29,7 +29,7 @@ static READ8_HANDLER( mcu_r )
/* latch LS374 at U39 */
static WRITE8_HANDLER( mcu_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->mcu_in = data;
}
@@ -40,49 +40,49 @@ static WRITE8_HANDLER( mcu_w )
static READ8_HANDLER( changela_68705_port_a_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
static WRITE8_HANDLER( changela_68705_port_a_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_a_out = data;
}
static WRITE8_HANDLER( changela_68705_ddr_a_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_a = data;
}
static READ8_HANDLER( changela_68705_port_b_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
- return (state->port_b_out & state->ddr_b) | (input_port_read(space->machine, "MCU") & ~state->ddr_b);
+ changela_state *state = space->machine().driver_data<changela_state>();
+ return (state->port_b_out & state->ddr_b) | (input_port_read(space->machine(), "MCU") & ~state->ddr_b);
}
static WRITE8_HANDLER( changela_68705_port_b_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_b_out = data;
}
static WRITE8_HANDLER( changela_68705_ddr_b_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_b = data;
}
static READ8_HANDLER( changela_68705_port_c_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return (state->port_c_out & state->ddr_c) | (state->port_c_in & ~state->ddr_c);
}
static WRITE8_HANDLER( changela_68705_port_c_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
/* PC3 is connected to the CLOCK input of the LS374,
so we latch the data on positive going edge of the clock */
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( changela_68705_port_c_w )
static WRITE8_HANDLER( changela_68705_ddr_c_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_c = data;
}
@@ -123,29 +123,29 @@ ADDRESS_MAP_END
/* U30 */
static READ8_HANDLER( changela_24_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return ((state->port_c_out & 2) << 2) | 7; /* bits 2,1,0-N/C inputs */
}
static READ8_HANDLER( changela_25_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
//collisions on bits 3,2, bits 1,0-N/C inputs
return (state->tree1_col << 3) | (state->tree0_col << 2) | 0x03;
}
static READ8_HANDLER( changela_30_r )
{
- return input_port_read(space->machine, "WHEEL") & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
+ return input_port_read(space->machine(), "WHEEL") & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
}
static READ8_HANDLER( changela_31_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
/* If the new value is less than the old value, and it did not wrap around,
or if the new value is greater than the old value, and it did wrap around,
then we are moving LEFT. */
- UINT8 curr_value = input_port_read(space->machine, "WHEEL");
+ UINT8 curr_value = input_port_read(space->machine(), "WHEEL");
if ((curr_value < state->prev_value_31 && (state->prev_value_31 - curr_value) < 0x80)
|| (curr_value > state->prev_value_31 && (curr_value - state->prev_value_31) > 0x80))
@@ -162,7 +162,7 @@ static READ8_HANDLER( changela_31_r )
static READ8_HANDLER( changela_2c_r )
{
- int val = input_port_read(space->machine, "IN0");
+ int val = input_port_read(space->machine(), "IN0");
val = (val & 0x30) | ((val & 1) << 7) | (((val & 1) ^ 1) << 6);
@@ -175,11 +175,11 @@ static READ8_HANDLER( changela_2d_r )
int v8 = 0;
int gas;
- if ((space->machine->primary_screen->vpos() & 0xf8) == 0xf8)
+ if ((space->machine().primary_screen->vpos() & 0xf8) == 0xf8)
v8 = 1;
/* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
- switch (input_port_read(space->machine, "IN1") & 0x03)
+ switch (input_port_read(space->machine(), "IN1") & 0x03)
{
case 0x02:
gas = 0x80;
@@ -192,30 +192,30 @@ static READ8_HANDLER( changela_2d_r )
break;
}
- return (input_port_read(space->machine, "IN1") & 0x20) | gas | (v8 << 4);
+ return (input_port_read(space->machine(), "IN1") & 0x20) | gas | (v8 << 4);
}
static WRITE8_HANDLER( mcu_pc_0_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_c_in = (state->port_c_in & 0xfe) | (data & 1);
}
static WRITE8_HANDLER( changela_collision_reset_0 )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->collision_reset = data & 0x01;
}
static WRITE8_HANDLER( changela_collision_reset_1 )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->tree_collision_reset = data & 0x01;
}
static WRITE8_HANDLER( changela_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -422,10 +422,10 @@ static const ay8910_interface ay8910_interface_2 =
static INTERRUPT_GEN( chl_interrupt )
{
- changela_state *state = device->machine->driver_data<changela_state>();
- int vector = device->machine->primary_screen->vblank() ? 0xdf : 0xcf; /* 4 irqs per frame: 3 times 0xcf, 1 time 0xdf */
+ changela_state *state = device->machine().driver_data<changela_state>();
+ int vector = device->machine().primary_screen->vblank() ? 0xdf : 0xcf; /* 4 irqs per frame: 3 times 0xcf, 1 time 0xdf */
-// device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
+// device->machine().primary_screen->update_partial(device->machine().primary_screen->vpos());
device_set_input_line_and_vector(device, 0, HOLD_LINE, vector);
@@ -439,9 +439,9 @@ static INTERRUPT_GEN( chl_interrupt )
static MACHINE_START(changela)
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
- state->mcu = machine->device("mcu");
+ state->mcu = machine.device("mcu");
/* video */
state->save_item(NAME(state->slopeROM_bank));
@@ -481,7 +481,7 @@ static MACHINE_START(changela)
static MACHINE_RESET (changela)
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
/* video */
state->slopeROM_bank = 0;
diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c
index 7145187fbe5..210ea066b8b 100644
--- a/src/mame/drivers/cheekyms.c
+++ b/src/mame/drivers/cheekyms.c
@@ -14,7 +14,7 @@
static INPUT_CHANGED( coin_inserted )
{
- cheekyms_state *state = field->port->machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = field->port->machine().driver_data<cheekyms_state>();
/* this starts a 556 one-shot timer (and triggers a sound effect) */
if (newval)
@@ -111,10 +111,10 @@ GFXDECODE_END
static MACHINE_START( cheekyms )
{
- cheekyms_state *state = machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = machine.driver_data<cheekyms_state>();
- state->maincpu = machine->device("maincpu");
- state->dac = machine->device("dac");
+ state->maincpu = machine.device("maincpu");
+ state->dac = machine.device("dac");
}
static MACHINE_CONFIG_START( cheekyms, cheekyms_state )
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 91927860eda..61f2c2d637b 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -332,7 +332,7 @@ St. Instr. Comment
*/
/* jamtable disassembler */
-static void jamtable_disasm(running_machine *machine, address_space *space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
+static void jamtable_disasm(running_machine &machine, address_space *space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
{
UINT32 base,addr;
UINT32 opcode,op1,op2;
@@ -426,9 +426,9 @@ static void jamtable_disasm(running_machine *machine, address_space *space,UINT3
}
}
-void jamtable_disasm_command(running_machine *machine, int ref, int params, const char **param)
+void jamtable_disasm_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine->firstcpu->space();
+ address_space *space=machine.firstcpu->space();
UINT64 addr,size;
if (params < 2)
@@ -569,7 +569,7 @@ INPUT_PORTS_END
static MACHINE_START( chihiro )
{
smbus_register_device(0x45,smbus_cx25871);
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
debug_console_register_command(machine,"jamdis",CMDFLAG_NONE,0,2,3,jamtable_disasm_command);
}
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 9269835ebc8..4f6b4c16542 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -110,15 +110,15 @@ INLINE int scanline_to_vcount( int scanline )
static TIMER_DEVICE_CALLBACK( chinagat_scanline )
{
- ddragon_state *state = timer.machine->driver_data<ddragon_state>();
+ ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8)
@@ -135,7 +135,7 @@ static TIMER_DEVICE_CALLBACK( chinagat_scanline )
static WRITE8_HANDLER( chinagat_interrupt_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
switch (offset)
{
@@ -170,31 +170,31 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
---- -x-- Flip screen
--x- ---- Enable video ???
****************************/
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrolly_hi = ((data & 0x02) >> 1);
state->scrollx_hi = data & 0x01;
- flip_screen_set(space->machine, ~data & 0x04);
+ flip_screen_set(space->machine(), ~data & 0x04);
}
static WRITE8_HANDLER( chinagat_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static WRITE8_HANDLER( chinagat_sub_bankswitch_w )
{
- memory_set_bank(space->machine, "bank4", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ memory_set_bank(space->machine(), "bank4", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static READ8_HANDLER( saiyugoub1_mcu_command_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
#if 0
if (state->mcu_command == 0x78)
{
- space->machine->device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
+ space->machine().device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
}
#endif
return state->mcu_command;
@@ -202,29 +202,29 @@ static READ8_HANDLER( saiyugoub1_mcu_command_r )
static WRITE8_HANDLER( saiyugoub1_mcu_command_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->mcu_command = data;
#if 0
if (data != 0x78)
{
- space->machine->device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
+ space->machine().device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
}
#endif
}
static WRITE8_HANDLER( saiyugoub1_adpcm_rom_addr_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* i8748 Port 1 write */
state->i8748_P1 = data;
}
static WRITE8_DEVICE_HANDLER( saiyugoub1_adpcm_control_w )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
/* i8748 Port 2 write */
- UINT8 *saiyugoub1_adpcm_rom = device->machine->region("adpcm")->base();
+ UINT8 *saiyugoub1_adpcm_rom = device->machine().region("adpcm")->base();
if (data & 0x80) /* Reset m5205 and disable ADPCM ROM outputs */
{
@@ -275,7 +275,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
/* Actually, T0 output clk mode is not supported by the i8048 core */
#if 0
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
state->m5205_clk++;
if (state->m5205_clk == 8)
@@ -290,7 +290,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
static READ8_HANDLER( saiyugoub1_m5205_irq_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
if (state->adpcm_sound_irq)
{
state->adpcm_sound_irq = 0;
@@ -301,7 +301,7 @@ static READ8_HANDLER( saiyugoub1_m5205_irq_r )
static void saiyugoub1_m5205_irq_w( device_t *device )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
state->adpcm_sound_irq = 1;
}
@@ -494,7 +494,7 @@ GFXDECODE_END
static void chinagat_irq_handler( device_t *device, int irq )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
device_set_input_line(state->snd_cpu, 0, irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -524,14 +524,14 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
- state->maincpu = machine->device("maincpu");
- state->sub_cpu = machine->device("sub");
- state->snd_cpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->sub_cpu = machine.device("sub");
+ state->snd_cpu = machine.device("audiocpu");
/* configure banks */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* register for save states */
state->save_item(NAME(state->scrollx_hi));
@@ -551,7 +551,7 @@ static MACHINE_START( chinagat )
static MACHINE_RESET( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->scrollx_hi = 0;
state->scrolly_hi = 0;
@@ -914,9 +914,9 @@ ROM_END
static DRIVER_INIT( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SUB = machine->region("sub")->base();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SUB = machine.region("sub")->base();
state->technos_video_hw = 1;
state->sprite_irq = M6809_IRQ_LINE;
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index f5c8009f295..6f8b496514a 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -72,7 +72,7 @@ public:
static PALETTE_INIT( chinsan )
{
- UINT8 *src = machine->region( "color_proms" )->base();
+ UINT8 *src = machine.region( "color_proms" )->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -85,7 +85,7 @@ static VIDEO_START( chinsan )
static SCREEN_UPDATE( chinsan )
{
- chinsan_state *state = screen->machine->driver_data<chinsan_state>();
+ chinsan_state *state = screen->machine().driver_data<chinsan_state>();
int y, x, count;
count = 0;
for (y = 0; y < 32; y++)
@@ -95,7 +95,7 @@ static SCREEN_UPDATE( chinsan )
int tileno, colour;
tileno = state->video[count] | (state->video[count + 0x800] << 8);
colour = state->video[count + 0x1000] >> 3;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tileno,colour,0,0,x*8,y*8);
count++;
}
}
@@ -113,7 +113,7 @@ static SCREEN_UPDATE( chinsan )
static WRITE8_HANDLER( ctrl_w )
{
- memory_set_bank(space->machine, "bank1", data >> 6);
+ memory_set_bank(space->machine(), "bank1", data >> 6);
}
static WRITE8_DEVICE_HANDLER( ym_port_w1 )
@@ -142,7 +142,7 @@ static const ym2203_interface ym2203_config =
static WRITE8_HANDLER( chinsan_port00_w )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
state->port_select = data;
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( chinsan_port00_w )
static READ8_HANDLER( chinsan_input_port_0_r )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
//return 0xff; // the inputs don't seem to work, so just return ff for now
@@ -169,62 +169,62 @@ static READ8_HANDLER( chinsan_input_port_0_r )
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(space->machine, "MAHJONG_P2_1");
+ return input_port_read(space->machine(), "MAHJONG_P2_1");
case 0x53:
- return input_port_read(space->machine, "MAHJONG_P2_2");
+ return input_port_read(space->machine(), "MAHJONG_P2_2");
case 0x57:
- return input_port_read(space->machine, "MAHJONG_P2_3");
+ return input_port_read(space->machine(), "MAHJONG_P2_3");
case 0x5b:
- return input_port_read(space->machine, "MAHJONG_P2_4");
+ return input_port_read(space->machine(), "MAHJONG_P2_4");
case 0x5d:
- return input_port_read(space->machine, "MAHJONG_P2_5");
+ return input_port_read(space->machine(), "MAHJONG_P2_5");
case 0x5e:
- return input_port_read(space->machine, "MAHJONG_P2_6");
+ return input_port_read(space->machine(), "MAHJONG_P2_6");
}
printf("chinsan_input_port_0_r unk_r %02x\n", state->port_select);
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( chinsan_input_port_1_r )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
switch (state->port_select)
{
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(space->machine, "MAHJONG_P1_1");
+ return input_port_read(space->machine(), "MAHJONG_P1_1");
case 0x53:
- return input_port_read(space->machine, "MAHJONG_P1_2");
+ return input_port_read(space->machine(), "MAHJONG_P1_2");
case 0x57:
- return input_port_read(space->machine, "MAHJONG_P1_3");
+ return input_port_read(space->machine(), "MAHJONG_P1_3");
case 0x5b:
- return input_port_read(space->machine, "MAHJONG_P1_4");
+ return input_port_read(space->machine(), "MAHJONG_P1_4");
case 0x5d:
- return input_port_read(space->machine, "MAHJONG_P1_5");
+ return input_port_read(space->machine(), "MAHJONG_P1_5");
case 0x5e:
- return input_port_read(space->machine, "MAHJONG_P1_6");
+ return input_port_read(space->machine(), "MAHJONG_P1_6");
}
printf("chinsan_input_port_1_r unk_r %02x\n", state->port_select);
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_DEVICE_HANDLER( chin_adpcm_w )
{
- chinsan_state *state = device->machine->driver_data<chinsan_state>();
+ chinsan_state *state = device->machine().driver_data<chinsan_state>();
state->adpcm_pos = (data & 0xff) * 0x100;
state->adpcm_idle = 0;
msm5205_reset_w(device, 0);
@@ -528,7 +528,7 @@ GFXDECODE_END
static void chin_adpcm_int( device_t *device )
{
- chinsan_state *state = device->machine->driver_data<chinsan_state>();
+ chinsan_state *state = device->machine().driver_data<chinsan_state>();
if (state->adpcm_pos >= 0x10000 || state->adpcm_idle)
{
@@ -538,7 +538,7 @@ static void chin_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -566,9 +566,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( chinsan )
{
- chinsan_state *state = machine->driver_data<chinsan_state>();
+ chinsan_state *state = machine.driver_data<chinsan_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->adpcm_idle));
state->save_item(NAME(state->port_select));
@@ -579,7 +579,7 @@ static MACHINE_START( chinsan )
static MACHINE_RESET( chinsan )
{
- chinsan_state *state = machine->driver_data<chinsan_state>();
+ chinsan_state *state = machine.driver_data<chinsan_state>();
state->adpcm_idle = 1;
state->port_select = 0;
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index d095d4ff698..270a0abfefd 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -28,7 +28,7 @@ static WRITE8_DEVICE_HANDLER( k007232_extvolume_w );
static INTERRUPT_GEN( chqflag_interrupt )
{
- chqflag_state *state = device->machine->driver_data<chqflag_state>();
+ chqflag_state *state = device->machine().driver_data<chqflag_state>();
if (cpu_getiloops(device) == 0)
{
@@ -44,20 +44,20 @@ static INTERRUPT_GEN( chqflag_interrupt )
static WRITE8_HANDLER( chqflag_bankswitch_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
/* bits 0-4 = ROM bank # (0x00-0x11) */
bankaddress = 0x10000 + (data & 0x1f) * 0x4000;
- memory_set_bankptr(space->machine, "bank4", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank4", &RAM[bankaddress]);
/* bit 5 = memory bank select */
if (data & 0x20)
{
space->install_read_bank(0x1800, 0x1fff, "bank5");
space->install_legacy_write_handler(0x1800, 0x1fff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w));
- memory_set_bankptr(space->machine, "bank5", space->machine->generic.paletteram.v);
+ memory_set_bankptr(space->machine(), "bank5", space->machine().generic.paletteram.v);
if (state->k051316_readroms)
space->install_legacy_readwrite_handler(*state->k051316_1, 0x1000, 0x17ff, FUNC(k051316_rom_r), FUNC(k051316_w)); /* 051316 #1 (ROM test) */
@@ -75,11 +75,11 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
static WRITE8_HANDLER( chqflag_vreg_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine, 1, data & 0x01);
- coin_counter_w(space->machine, 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x02);
/* bit 4 = enable rom reading thru K051316 #1 & #2 */
state->k051316_readroms = (data & 0x10);
@@ -95,9 +95,9 @@ static WRITE8_HANDLER( chqflag_vreg_w )
/* the headlight (which have the shadow bit set) become highlights */
/* Maybe one of the bits inverts the SHAD line while the other darkens the background. */
if (data & 0x08)
- palette_set_shadow_factor(space->machine, 1 / PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_set_shadow_factor(space->machine(), 1 / PALETTE_DEFAULT_SHADOW_FACTOR);
else
- palette_set_shadow_factor(space->machine, PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_set_shadow_factor(space->machine(), PALETTE_DEFAULT_SHADOW_FACTOR);
if ((data & 0x80) != state->last_vreg)
{
@@ -108,7 +108,7 @@ static WRITE8_HANDLER( chqflag_vreg_w )
/* only affect the background */
for (i = 512; i < 1024; i++)
- palette_set_pen_contrast(space->machine, i, brt);
+ palette_set_pen_contrast(space->machine(), i, brt);
}
//if ((data & 0xf8) && (data & 0xf8) != 0x88)
@@ -120,17 +120,17 @@ static WRITE8_HANDLER( chqflag_vreg_w )
static WRITE8_HANDLER( select_analog_ctrl_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
state->analog_ctrl = data;
}
static READ8_HANDLER( analog_read_r )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
switch (state->analog_ctrl & 0x03)
{
- case 0x00: return (state->accel = input_port_read(space->machine, "IN3")); /* accelerator */
- case 0x01: return (state->wheel = input_port_read(space->machine, "IN4")); /* steering */
+ case 0x00: return (state->accel = input_port_read(space->machine(), "IN3")); /* accelerator */
+ case 0x01: return (state->wheel = input_port_read(space->machine(), "IN4")); /* steering */
case 0x02: return state->accel; /* accelerator (previous?) */
case 0x03: return state->wheel; /* steering (previous?) */
}
@@ -140,7 +140,7 @@ static READ8_HANDLER( analog_read_r )
static WRITE8_HANDLER( chqflag_sh_irqtrigger_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
soundlatch2_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -176,7 +176,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( k007232_bankswitch_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */
@@ -292,7 +292,7 @@ INPUT_PORTS_END
static void chqflag_ym2151_irq_w( device_t *device, int data )
{
- chqflag_state *state = device->machine->driver_data<chqflag_state>();
+ chqflag_state *state = device->machine().driver_data<chqflag_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, data ? ASSERT_LINE : CLEAR_LINE);
}
@@ -354,18 +354,18 @@ static const k051316_interface chqflag_k051316_intf_2 =
static MACHINE_START( chqflag )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k051316_1 = machine->device("k051316_1");
- state->k051316_2 = machine->device("k051316_2");
- state->k051960 = machine->device("k051960");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k051316_1 = machine.device("k051316_1");
+ state->k051316_2 = machine.device("k051316_2");
+ state->k051960 = machine.device("k051960");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
state->save_item(NAME(state->k051316_readroms));
state->save_item(NAME(state->last_vreg));
@@ -376,7 +376,7 @@ static MACHINE_START( chqflag )
static MACHINE_RESET( chqflag )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
state->k051316_readroms = 0;
state->last_vreg = 0;
diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c
index 1df9be71702..e470e99255d 100644
--- a/src/mame/drivers/chsuper.c
+++ b/src/mame/drivers/chsuper.c
@@ -34,9 +34,9 @@ static VIDEO_START(chsuper)
static SCREEN_UPDATE(chsuper)
{
- //chsuper_state *state = screen->machine->driver_data<chsuper_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
- UINT8 *vram = screen->machine->region("vram")->base();
+ //chsuper_state *state = screen->machine().driver_data<chsuper_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
+ UINT8 *vram = screen->machine().region("vram")->base();
int count = 0x0000;
int y,x;
@@ -58,7 +58,7 @@ static SCREEN_UPDATE(chsuper)
static WRITE8_HANDLER( paletteram_io_w )
{
- chsuper_state *state = space->machine->driver_data<chsuper_state>();
+ chsuper_state *state = space->machine().driver_data<chsuper_state>();
switch(offset)
{
case 0:
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( paletteram_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -97,7 +97,7 @@ static READ8_HANDLER( ff_r )
static WRITE8_HANDLER( chsuper_vram_w )
{
- UINT8 *vram = space->machine->region("vram")->base();
+ UINT8 *vram = space->machine().region("vram")->base();
vram[offset] = data;
}
@@ -280,9 +280,9 @@ ROM_END
static DRIVER_INIT( chsuper2 )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x7f00;
@@ -305,9 +305,9 @@ static DRIVER_INIT( chsuper2 )
static DRIVER_INIT( chsuper3 )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x0e00;
@@ -330,9 +330,9 @@ static DRIVER_INIT( chsuper3 )
static DRIVER_INIT( chmpnum )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x1800;
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index 4ecd55cbe1e..71708627a30 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -54,7 +54,7 @@ WRITE8_MEMBER( cidelsa_state::draco_sound_bankswitch_w )
int bank = BIT(data, 3);
- memory_set_bank(&m_machine, "bank1", bank);
+ memory_set_bank(m_machine, "bank1", bank);
}
WRITE8_MEMBER( cidelsa_state::draco_sound_g_w )
@@ -136,9 +136,9 @@ WRITE8_MEMBER( cidelsa_state::altair_out1_w )
7 CONT. M1
*/
- set_led_status(&m_machine, 0, data & 0x08); // 1P
- set_led_status(&m_machine, 1, data & 0x10); // 2P
- set_led_status(&m_machine, 2, data & 0x20); // FIRE
+ set_led_status(m_machine, 0, data & 0x08); // 1P
+ set_led_status(m_machine, 1, data & 0x10); // 2P
+ set_led_status(m_machine, 2, data & 0x20); // FIRE
}
WRITE8_MEMBER( cidelsa_state::draco_out1_w )
@@ -281,14 +281,14 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( cdp1869_pcb_r )
{
- cidelsa_state *state = field->port->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = field->port->machine().driver_data<cidelsa_state>();
return state->m_cdp1869_pcb;
}
static INPUT_CHANGED( ef_w )
{
- cputag_set_input_line(field->port->machine, CDP1802_TAG, (int)(FPTR)param, newval);
+ cputag_set_input_line(field->port->machine(), CDP1802_TAG, (int)(FPTR)param, newval);
}
static INPUT_PORTS_START( destryer )
@@ -437,14 +437,14 @@ INPUT_PORTS_END
static TIMER_CALLBACK( set_cpu_mode )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
state->m_reset = 1;
}
static MACHINE_START( cidelsa )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
/* register for state saving */
state->save_item(NAME(state->m_reset));
@@ -452,12 +452,12 @@ static MACHINE_START( cidelsa )
static MACHINE_START( draco )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
MACHINE_START_CALL( cidelsa );
/* setup COP402 memory banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region(COP402N_TAG)->base(), 0x400);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region(COP402N_TAG)->base(), 0x400);
memory_set_bank(machine, "bank1", 0);
/* register for state saving */
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index 6abaaa799d0..bc235779738 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -51,7 +51,7 @@
static MACHINE_START( cinemat )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state_save_register_global(machine, state->coin_detected);
state_save_register_global(machine, state->coin_last_reset);
state_save_register_global(machine, state->mux_select);
@@ -60,7 +60,7 @@ static MACHINE_START( cinemat )
MACHINE_RESET( cinemat )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* reset the coin states */
state->coin_detected = 0;
state->coin_last_reset = 0;
@@ -79,14 +79,14 @@ MACHINE_RESET( cinemat )
static READ8_HANDLER( inputs_r )
{
- return (input_port_read(space->machine, "INPUTS") >> offset) & 1;
+ return (input_port_read(space->machine(), "INPUTS") >> offset) & 1;
}
static READ8_HANDLER( switches_r )
{
static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
- return (input_port_read(space->machine, "SWITCHES") >> switch_shuffle[offset]) & 1;
+ return (input_port_read(space->machine(), "SWITCHES") >> switch_shuffle[offset]) & 1;
}
@@ -99,7 +99,7 @@ static READ8_HANDLER( switches_r )
static INPUT_CHANGED( coin_inserted )
{
- cinemat_state *state = field->port->machine->driver_data<cinemat_state>();
+ cinemat_state *state = field->port->machine().driver_data<cinemat_state>();
/* on the falling edge of a new coin, set the coin_detected flag */
if (newval == 0)
state->coin_detected = 1;
@@ -108,7 +108,7 @@ static INPUT_CHANGED( coin_inserted )
static READ8_HANDLER( coin_input_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
return !state->coin_detected;
}
@@ -122,7 +122,7 @@ static READ8_HANDLER( coin_input_r )
static WRITE8_HANDLER( coin_reset_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
/* on the rising edge of a coin reset, clear the coin_detected flag */
if (state->coin_last_reset != data && data != 0)
state->coin_detected = 0;
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( coin_reset_w )
static WRITE8_HANDLER( mux_select_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
state->mux_select = data;
cinemat_sound_control_w(space, 0x07, data);
}
@@ -147,13 +147,13 @@ static WRITE8_HANDLER( mux_select_w )
static UINT8 joystick_read(device_t *device)
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
- if (device->machine->phase() != MACHINE_PHASE_RUNNING)
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
+ if (device->machine().phase() != MACHINE_PHASE_RUNNING)
return 0;
else
{
int xval = (INT16)(cpu_get_reg(device, CCPU_X) << 4) >> 4;
- return (input_port_read_safe(device->machine, state->mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
+ return (input_port_read_safe(device->machine(), state->mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
}
}
@@ -171,7 +171,7 @@ static READ8_HANDLER( speedfrk_wheel_r )
int delta_wheel;
/* the shift register is cleared once per 'frame' */
- delta_wheel = (INT8)input_port_read(space->machine, "WHEEL") / 8;
+ delta_wheel = (INT8)input_port_read(space->machine(), "WHEEL") / 8;
if (delta_wheel > 3)
delta_wheel = 3;
else if (delta_wheel < -3)
@@ -183,15 +183,15 @@ static READ8_HANDLER( speedfrk_wheel_r )
static READ8_HANDLER( speedfrk_gear_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
- int gearval = input_port_read(space->machine, "GEAR");
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
+ int gearval = input_port_read(space->machine(), "GEAR");
/* check the fake gear input port and determine the bit settings for the gear */
if ((gearval & 0x0f) != 0x0f)
state->gear = gearval & 0x0f;
/* add the start key into the mix -- note that it overlaps 4th gear */
- if (!(input_port_read(space->machine, "INPUTS") & 0x80))
+ if (!(input_port_read(space->machine(), "INPUTS") & 0x80))
state->gear &= ~0x08;
return (state->gear >> offset) & 1;
@@ -237,9 +237,9 @@ static READ8_HANDLER( sundance_inputs_r )
{
/* handle special keys first */
if (sundance_port_map[offset].portname)
- return (input_port_read(space->machine, sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
+ return (input_port_read(space->machine(), sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
else
- return (input_port_read(space->machine, "INPUTS") >> offset) & 1;
+ return (input_port_read(space->machine(), "INPUTS") >> offset) & 1;
}
@@ -252,8 +252,8 @@ static READ8_HANDLER( sundance_inputs_r )
static READ8_HANDLER( boxingb_dial_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
- int value = input_port_read(space->machine, "DIAL");
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
+ int value = input_port_read(space->machine(), "DIAL");
if (!state->mux_select) offset += 4;
return (value >> offset) & 1;
}
@@ -268,8 +268,8 @@ static READ8_HANDLER( boxingb_dial_r )
static READ8_HANDLER( qb3_frame_r )
{
- attotime next_update = space->machine->primary_screen->time_until_update();
- attotime frame_period = space->machine->primary_screen->frame_period();
+ attotime next_update = space->machine().primary_screen->time_until_update();
+ attotime frame_period = space->machine().primary_screen->frame_period();
int percent = next_update.attoseconds / (frame_period.attoseconds / 100);
/* note this is just an approximation... */
@@ -279,7 +279,7 @@ static READ8_HANDLER( qb3_frame_r )
static WRITE8_HANDLER( qb3_ram_bank_w )
{
- memory_set_bank(space->machine, "bank1", cpu_get_reg(space->machine->device("maincpu"), CCPU_P) & 3);
+ memory_set_bank(space->machine(), "bank1", cpu_get_reg(space->machine().device("maincpu"), CCPU_P) & 3);
}
@@ -1458,37 +1458,37 @@ ROM_END
static DRIVER_INIT( speedfrk )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->gear = 0xe;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(speedfrk_wheel_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x06, FUNC(speedfrk_gear_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(speedfrk_wheel_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x06, FUNC(speedfrk_gear_r));
}
static DRIVER_INIT( sundance )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x0f, FUNC(sundance_inputs_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x0f, FUNC(sundance_inputs_r));
}
static DRIVER_INIT( tailg )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
}
static DRIVER_INIT( boxingb )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0c, 0x0f, FUNC(boxingb_dial_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0c, 0x0f, FUNC(boxingb_dial_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
}
static DRIVER_INIT( qb3 )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0f, 0x0f, FUNC(qb3_frame_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x00, 0x00, FUNC(qb3_ram_bank_w));
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0f, 0x0f, FUNC(qb3_frame_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x00, 0x00, FUNC(qb3_ram_bank_w));
memory_configure_bank(machine, "bank1", 0, 4, state->rambase, 0x100*2);
}
diff --git a/src/mame/drivers/circus.c b/src/mame/drivers/circus.c
index 5e2211439bf..8428c222b0c 100644
--- a/src/mame/drivers/circus.c
+++ b/src/mame/drivers/circus.c
@@ -54,8 +54,8 @@ D000 Paddle Position and Interrupt Reset (where applicable)
static READ8_HANDLER( circus_paddle_r )
{
// also clears irq
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
- return input_port_read(space->machine, "PADDLE");
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ return input_port_read(space->machine(), "PADDLE");
}
static ADDRESS_MAP_START( circus_map, AS_PROGRAM, 8 )
@@ -264,11 +264,11 @@ GFXDECODE_END
***************************************************************************/
static MACHINE_START( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
- state->discrete = machine->device("discrete");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->clown_x));
state->save_item(NAME(state->clown_y));
@@ -277,7 +277,7 @@ static MACHINE_START( circus )
static MACHINE_RESET( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->clown_x = 0;
state->clown_y = 0;
@@ -573,23 +573,23 @@ ROM_END
static DRIVER_INIT( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 1;
}
static DRIVER_INIT( robotbwl )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 2;
}
static DRIVER_INIT( crash )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 3;
}
static DRIVER_INIT( ripcord )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 4;
}
diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c
index 4392f4c9373..f52260b59f3 100644
--- a/src/mame/drivers/circusc.c
+++ b/src/mame/drivers/circusc.c
@@ -59,20 +59,20 @@ To enter service mode, keep 1&2 pressed on reset
static MACHINE_START( circusc )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->sn1 = machine->device("sn1");
- state->sn2 = machine->device("sn2");
- state->dac = machine->device("dac");
- state->discrete = machine->device("fltdisc");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->sn1 = machine.device("sn1");
+ state->sn2 = machine.device("sn2");
+ state->dac = machine.device("dac");
+ state->discrete = machine.device("fltdisc");
state->save_item(NAME(state->sn_latch));
}
static MACHINE_RESET( circusc )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
state->sn_latch = 0;
}
@@ -89,7 +89,7 @@ static READ8_HANDLER( circusc_sh_timer_r )
* Can be shortened to:
*/
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
int clock;
clock = state->audiocpu->total_cycles() >> 9;
@@ -99,18 +99,18 @@ static READ8_HANDLER( circusc_sh_timer_r )
static WRITE8_HANDLER( circusc_sh_irqtrigger_w )
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( circusc_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static WRITE8_HANDLER(circusc_sound_w)
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
switch (offset & 7)
{
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 32ee60d4bb3..7ca7c470038 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -188,43 +188,43 @@ Cisco Heat.
static READ16_HANDLER( sharedram1_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->sharedram1[offset];
}
static READ16_HANDLER( sharedram2_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->sharedram2[offset];
}
static WRITE16_HANDLER( sharedram1_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->sharedram1[offset]);
}
static WRITE16_HANDLER( sharedram2_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->sharedram2[offset]);
}
static READ16_HANDLER( rom_1_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_1[offset];
}
static READ16_HANDLER( rom_2_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_2[offset];
}
static READ16_HANDLER( rom_3_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_3[offset];
}
@@ -235,23 +235,23 @@ static READ16_HANDLER( rom_3_r )
static WRITE16_HANDLER( bigrun_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(space->machine, 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(space->machine(), 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(space->machine, 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(space->machine(), 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
}
static ADDRESS_MAP_START( bigrun_map, AS_PROGRAM, 16 )
@@ -288,23 +288,23 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( cischeat_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine, 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine(), 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine, 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine(), 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
}
static ADDRESS_MAP_START( cischeat_map, AS_PROGRAM, 16 )
@@ -340,23 +340,23 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( f1gpstar_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine, 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine(), 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
}
/* F1 GP Star tests:
@@ -420,18 +420,18 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( scudhamm_paletteram16_w )
{
- int newword = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ int newword = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((newword >> 11) & 0x1E ) | ((newword >> 3) & 0x01));
int g = pal5bit(((newword >> 7 ) & 0x1E ) | ((newword >> 2) & 0x01));
int b = pal5bit(((newword >> 3 ) & 0x1E ) | ((newword >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
}
@@ -446,7 +446,7 @@ static WRITE16_HANDLER( scudhamm_paletteram16_w )
READ16_HANDLER( scudhamm_motor_status_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->scudhamm_motor_command; // Motor Status
}
@@ -467,15 +467,15 @@ READ16_HANDLER( scudhamm_motor_pos_r )
static WRITE16_HANDLER( scudhamm_motor_command_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA( &state->scudhamm_motor_command );
}
READ16_HANDLER( scudhamm_analog_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
- int i=input_port_read(space->machine, "IN1"),j;
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
+ int i=input_port_read(space->machine(), "IN1"),j;
if ((i^state->prev)&0x4000) {
if (i<state->prev) state->prev-=0x8000;
@@ -503,15 +503,15 @@ static WRITE16_HANDLER( scudhamm_leds_w )
{
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 0, data & 0x0100); // 3 buttons
- set_led_status(space->machine, 1, data & 0x0200);
- set_led_status(space->machine, 2, data & 0x0400);
+ set_led_status(space->machine(), 0, data & 0x0100); // 3 buttons
+ set_led_status(space->machine(), 1, data & 0x0200);
+ set_led_status(space->machine(), 2, data & 0x0400);
}
if (ACCESSING_BITS_0_7)
{
-// set_led_status(space->machine, 3, data & 0x0010); // if we had more leds..
-// set_led_status(space->machine, 4, data & 0x0020);
+// set_led_status(space->machine(), 3, data & 0x0010); // if we had more leds..
+// set_led_status(space->machine(), 4, data & 0x0020);
}
}
@@ -529,8 +529,8 @@ static WRITE16_HANDLER( scudhamm_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * ((data >> 0) & 0x3) );
oki2->set_bank_base(0x40000 * ((data >> 4) & 0x3) );
}
@@ -566,26 +566,26 @@ static READ16_HANDLER( armchmp2_motor_status_r )
static WRITE16_HANDLER( armchmp2_motor_command_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA( &state->scudhamm_motor_command );
}
static READ16_HANDLER( armchmp2_analog_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
int armdelta;
- armdelta = input_port_read(space->machine, "IN1") - state->armold;
- state->armold = input_port_read(space->machine, "IN1");
+ armdelta = input_port_read(space->machine(), "IN1") - state->armold;
+ state->armold = input_port_read(space->machine(), "IN1");
return ~( state->scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins
}
static READ16_HANDLER( armchmp2_buttons_r )
{
- int arm_x = input_port_read(space->machine, "IN1");
+ int arm_x = input_port_read(space->machine(), "IN1");
- UINT16 ret = input_port_read(space->machine, "IN0");
+ UINT16 ret = input_port_read(space->machine(), "IN0");
if (arm_x < 0x40) ret &= ~1;
else if (arm_x > 0xc0) ret &= ~2;
@@ -606,16 +606,16 @@ static WRITE16_HANDLER( armchmp2_leds_w )
{
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 0, data & 0x0100);
- set_led_status(space->machine, 1, data & 0x1000);
- set_led_status(space->machine, 2, data & 0x2000);
- set_led_status(space->machine, 3, data & 0x4000);
+ set_led_status(space->machine(), 0, data & 0x0100);
+ set_led_status(space->machine(), 1, data & 0x1000);
+ set_led_status(space->machine(), 2, data & 0x2000);
+ set_led_status(space->machine(), 3, data & 0x4000);
}
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0040);
- coin_counter_w(space->machine, 1, data & 0x0080);
+ coin_counter_w(space->machine(), 0, data & 0x0040);
+ coin_counter_w(space->machine(), 1, data & 0x0080);
}
}
@@ -727,8 +727,8 @@ static WRITE16_HANDLER( bigrun_soundbank_w )
{
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * ((data >> 0) & 1) );
oki2->set_bank_base(0x40000 * ((data >> 4) & 1) );
}
@@ -810,13 +810,13 @@ ADDRESS_MAP_END
static READ16_HANDLER ( f1gpstr2_io_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->vregs[offset + 0x1000/2];
}
static WRITE16_HANDLER( f1gpstr2_io_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->vregs[offset + 0x1000/2]);
}
@@ -1832,10 +1832,10 @@ MACHINE_CONFIG_END
We need to untangle it
*/
-static void cischeat_untangle_sprites(running_machine *machine, const char *region)
+static void cischeat_untangle_sprites(running_machine &machine, const char *region)
{
- UINT8 *src = machine->region(region)->base();
- const UINT8 *end = src + machine->region(region)->bytes();
+ UINT8 *src = machine.region(region)->base();
+ const UINT8 *end = src + machine.region(region)->bytes();
while (src < end)
{
@@ -1987,9 +1987,9 @@ ROM_END
static DRIVER_INIT( bigrun )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) machine->region("user1")->base();
+ state->rom_1 = (UINT16 *) machine.region("user1")->base();
cischeat_untangle_sprites(machine, "gfx4"); // Untangle sprites
phantasm_rom_decode(machine, "soundcpu"); // Decrypt sound cpu code
@@ -2110,19 +2110,19 @@ ROM_END
static DRIVER_INIT( cischeat )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) (machine->region("user1")->base() + 0x00000);
- state->rom_2 = (UINT16 *) (machine->region("cpu2")->base() + 0x40000);
- state->rom_3 = (UINT16 *) (machine->region("cpu3")->base() + 0x40000);
+ state->rom_1 = (UINT16 *) (machine.region("user1")->base() + 0x00000);
+ state->rom_2 = (UINT16 *) (machine.region("cpu2")->base() + 0x40000);
+ state->rom_3 = (UINT16 *) (machine.region("cpu3")->base() + 0x40000);
- memcpy(machine->region("user1")->base() + 0x80000, state->rom_2, 0x40000);
+ memcpy(machine.region("user1")->base() + 0x80000, state->rom_2, 0x40000);
memset(state->rom_2, 0, 0x40000);
- state->rom_2 = (UINT16 *) (machine->region("user1")->base() + 0x80000);
+ state->rom_2 = (UINT16 *) (machine.region("user1")->base() + 0x80000);
- memcpy(machine->region("user1")->base() + 0xc0000, state->rom_3, 0x40000);
+ memcpy(machine.region("user1")->base() + 0xc0000, state->rom_3, 0x40000);
memset(state->rom_3, 0, 0x40000);
- state->rom_3 = (UINT16 *) (machine->region("user1")->base() + 0xc0000);
+ state->rom_3 = (UINT16 *) (machine.region("user1")->base() + 0xc0000);
cischeat_untangle_sprites(machine, "gfx4"); // Untangle sprites
astyanax_rom_decode(machine, "soundcpu"); // Decrypt sound cpu code
@@ -2338,9 +2338,9 @@ ROM_END
static DRIVER_INIT( f1gpstar )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) machine->region("user1")->base();
+ state->rom_1 = (UINT16 *) machine.region("user1")->base();
cischeat_untangle_sprites(machine, "gfx4");
}
@@ -2554,7 +2554,7 @@ ROM_END
static DRIVER_INIT( wildplt )
{
- machine->device("cpu1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x080000, 0x087fff, FUNC(wildplt_vregs_r) );
+ machine.device("cpu1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x080000, 0x087fff, FUNC(wildplt_vregs_r) );
DRIVER_INIT_CALL(f1gpstar);
}
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index 97b17e85a58..41d3fdea51e 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -16,12 +16,12 @@ Dip locations added from dip listing at crazykong.com
static READ8_HANDLER( citycon_in_r )
{
- return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
+ return input_port_read(space->machine(), flip_screen_get(space->machine()) ? "P2" : "P1");
}
static READ8_HANDLER( citycon_irq_ack_r )
{
- citycon_state *state = space->machine->driver_data<citycon_state>();
+ citycon_state *state = space->machine().driver_data<citycon_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -189,16 +189,16 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( citycon )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->bg_image));
}
static MACHINE_RESET( citycon )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
state->bg_image = 0;
}
@@ -340,7 +340,7 @@ ROM_END
static DRIVER_INIT( citycon )
{
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
/*
diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c
index 7b73482d23d..a075b5add0b 100644
--- a/src/mame/drivers/clayshoo.c
+++ b/src/mame/drivers/clayshoo.c
@@ -42,12 +42,12 @@ public:
static WRITE8_DEVICE_HANDLER( input_port_select_w )
{
- clayshoo_state *state = device->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = device->machine().driver_data<clayshoo_state>();
state->input_port_select = data;
}
-static UINT8 difficulty_input_port_r( running_machine *machine, int bit )
+static UINT8 difficulty_input_port_r( running_machine &machine, int bit )
{
UINT8 ret = 0;
@@ -67,16 +67,16 @@ static UINT8 difficulty_input_port_r( running_machine *machine, int bit )
static READ8_DEVICE_HANDLER( input_port_r )
{
- clayshoo_state *state = device->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = device->machine().driver_data<clayshoo_state>();
UINT8 ret = 0;
switch (state->input_port_select)
{
- case 0x01: ret = input_port_read(device->machine, "IN0"); break;
- case 0x02: ret = input_port_read(device->machine, "IN1"); break;
- case 0x04: ret = (input_port_read(device->machine, "IN2") & 0xf0) | difficulty_input_port_r(device->machine, 0) |
- (difficulty_input_port_r(device->machine, 3) << 2); break;
- case 0x08: ret = input_port_read(device->machine, "IN3"); break;
+ case 0x01: ret = input_port_read(device->machine(), "IN0"); break;
+ case 0x02: ret = input_port_read(device->machine(), "IN1"); break;
+ case 0x04: ret = (input_port_read(device->machine(), "IN2") & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
+ (difficulty_input_port_r(device->machine(), 3) << 2); break;
+ case 0x08: ret = input_port_read(device->machine(), "IN3"); break;
case 0x10:
case 0x20: break; /* these two are not really used */
default: logerror("Unexpected port read: %02X\n", state->input_port_select);
@@ -94,7 +94,7 @@ static READ8_DEVICE_HANDLER( input_port_r )
static TIMER_CALLBACK( reset_analog_bit )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
state->analog_port_val &= ~param;
}
@@ -109,7 +109,7 @@ static attotime compute_duration( device_t *device, int analog_pos )
static WRITE8_HANDLER( analog_reset_w )
{
- clayshoo_state *state = space->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = space->machine().driver_data<clayshoo_state>();
/* reset the analog value, and start the two times that will fire
off in a short period proportional to the position of the
@@ -117,23 +117,23 @@ static WRITE8_HANDLER( analog_reset_w )
state->analog_port_val = 0xff;
- state->analog_timer_1->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN1")), 0x02);
- state->analog_timer_2->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN2")), 0x01);
+ state->analog_timer_1->adjust(compute_duration(space->cpu, input_port_read(space->machine(), "AN1")), 0x02);
+ state->analog_timer_2->adjust(compute_duration(space->cpu, input_port_read(space->machine(), "AN2")), 0x01);
}
static READ8_HANDLER( analog_r )
{
- clayshoo_state *state = space->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = space->machine().driver_data<clayshoo_state>();
return state->analog_port_val;
}
-static void create_analog_timers( running_machine *machine )
+static void create_analog_timers( running_machine &machine )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
- state->analog_timer_1 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit));
- state->analog_timer_2 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit));
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
+ state->analog_timer_1 = machine.scheduler().timer_alloc(FUNC(reset_analog_bit));
+ state->analog_timer_2 = machine.scheduler().timer_alloc(FUNC(reset_analog_bit));
}
@@ -167,7 +167,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static MACHINE_START( clayshoo )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
create_analog_timers(machine);
/* register for state saving */
@@ -185,7 +185,7 @@ static MACHINE_START( clayshoo )
static SCREEN_UPDATE( clayshoo )
{
- clayshoo_state *state = screen->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = screen->machine().driver_data<clayshoo_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -315,7 +315,7 @@ INPUT_PORTS_END
static MACHINE_RESET( clayshoo )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
state->input_port_select = 0;
state->analog_port_val = 0;
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index 905bb63d645..4d230215879 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -95,7 +95,7 @@ static emu_timer *irq_timer;
static WRITE8_HANDLER( cliff_test_led_w )
{
- set_led_status(space->machine, 0, offset ^ 1);
+ set_led_status(space->machine(), 0, offset ^ 1);
}
static WRITE8_HANDLER( cliff_port_bank_w )
@@ -112,7 +112,7 @@ static READ8_HANDLER( cliff_port_r )
static const char *const banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
if (port_bank < 7)
- return input_port_read(space->machine, banknames[port_bank]);
+ return input_port_read(space->machine(), banknames[port_bank]);
/* output is pulled up for non-mapped ports */
return 0xff;
@@ -133,13 +133,13 @@ static WRITE8_HANDLER( cliff_phillips_clear_w )
static WRITE8_HANDLER( cliff_coin_counter_w )
{
- coin_counter_w(space->machine, 0, (data & 0x40) ? 1 : 0 );
+ coin_counter_w(space->machine(), 0, (data & 0x40) ? 1 : 0 );
}
static READ8_HANDLER( cliff_irq_ack_r )
{
/* deassert IRQ on the CPU */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
return 0x00;
}
@@ -152,13 +152,13 @@ static WRITE8_DEVICE_HANDLER( cliff_sound_overlay_w )
/* configure pen 0 and 1 as transparent in the renderer and use it as the compositing color */
if (overlay)
{
- palette_set_color(device->machine, 0, palette_get_color(device->machine, 0) & MAKE_ARGB(0,255,255,255));
- palette_set_color(device->machine, 1, palette_get_color(device->machine, 1) & MAKE_ARGB(0,255,255,255));
+ palette_set_color(device->machine(), 0, palette_get_color(device->machine(), 0) & MAKE_ARGB(0,255,255,255));
+ palette_set_color(device->machine(), 1, palette_get_color(device->machine(), 1) & MAKE_ARGB(0,255,255,255));
}
else
{
- palette_set_color(device->machine, 0, palette_get_color(device->machine, 0) | MAKE_ARGB(255,0,0,0));
- palette_set_color(device->machine, 1, palette_get_color(device->machine, 1) | MAKE_ARGB(255,0,0,0));
+ palette_set_color(device->machine(), 0, palette_get_color(device->machine(), 0) | MAKE_ARGB(255,0,0,0));
+ palette_set_color(device->machine(), 1, palette_get_color(device->machine(), 1) | MAKE_ARGB(255,0,0,0));
}
/* audio */
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( cliff_ldwire_w )
static INTERRUPT_GEN( cliff_vsync )
{
/* clock the video chip every 60Hz */
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
static TIMER_CALLBACK( cliff_irq_callback )
@@ -204,10 +204,10 @@ static TIMER_CALLBACK( cliff_irq_callback )
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
- irq_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param);
+ irq_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param);
}
-static void vdp_interrupt(running_machine *machine, int state)
+static void vdp_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -216,15 +216,15 @@ static void vdp_interrupt(running_machine *machine, int state)
static MACHINE_START( cliffhgr )
{
- laserdisc = machine->device("laserdisc");
- irq_timer = machine->scheduler().timer_alloc(FUNC(cliff_irq_callback));
+ laserdisc = machine.device("laserdisc");
+ irq_timer = machine.scheduler().timer_alloc(FUNC(cliff_irq_callback));
}
static MACHINE_RESET( cliffhgr )
{
port_bank = 0;
phillips_code = 0;
- irq_timer->adjust(machine->primary_screen->time_until_pos(17), 17);
+ irq_timer->adjust(machine.primary_screen->time_until_pos(17), 17);
}
/********************************************************/
diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c
index 8cb68018fad..a3a9e147754 100644
--- a/src/mame/drivers/cloak.c
+++ b/src/mame/drivers/cloak.c
@@ -129,12 +129,12 @@
static WRITE8_HANDLER( cloak_led_w )
{
- set_led_status(space->machine, 1 - offset, ~data & 0x80);
+ set_led_status(space->machine(), 1 - offset, ~data & 0x80);
}
static WRITE8_HANDLER( cloak_coin_counter_w )
{
- coin_counter_w(space->machine, 1 - offset, data & 0x80);
+ coin_counter_w(space->machine(), 1 - offset, data & 0x80);
}
static WRITE8_HANDLER( cloak_custom_w )
@@ -143,17 +143,17 @@ static WRITE8_HANDLER( cloak_custom_w )
static WRITE8_HANDLER( cloak_irq_reset_0_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( cloak_irq_reset_1_w )
{
- cputag_set_input_line(space->machine, "slave", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "slave", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( cloak_nvram_enable_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
state->nvram_enabled = data & 0x01;
}
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 448781bb7ba..0822b944256 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -110,21 +110,21 @@
*
*************************************/
-INLINE void schedule_next_irq(running_machine *machine, int curscanline)
+INLINE void schedule_next_irq(running_machine &machine, int curscanline)
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
/* IRQ is clocked by /32V, so every 64 scanlines */
curscanline = (curscanline + 64) & 255;
/* next one at the start of this scanline */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(curscanline), curscanline);
}
static TIMER_CALLBACK( clock_irq )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
/* assert the IRQ if not already asserted */
if (!state->irq_state)
{
@@ -133,7 +133,7 @@ static TIMER_CALLBACK( clock_irq )
}
/* force an update now */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* find the next edge */
schedule_next_irq(machine, param);
@@ -142,8 +142,8 @@ static TIMER_CALLBACK( clock_irq )
static CUSTOM_INPUT( get_vblank )
{
- cloud9_state *state = field->port->machine->driver_data<cloud9_state>();
- int scanline = field->port->machine->primary_screen->vpos();
+ cloud9_state *state = field->port->machine().driver_data<cloud9_state>();
+ int scanline = field->port->machine().primary_screen->vpos();
return (~state->syncprom[scanline & 0xff] >> 1) & 1;
}
@@ -157,11 +157,11 @@ static CUSTOM_INPUT( get_vblank )
static MACHINE_START( cloud9 )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
rectangle visarea;
/* initialize globals */
- state->syncprom = machine->region("proms")->base() + 0x000;
+ state->syncprom = machine.region("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->vblank_start = 0; state->vblank_start < 256; state->vblank_start++)
@@ -183,10 +183,10 @@ static MACHINE_START( cloud9 )
visarea.max_x = 255;
visarea.min_y = state->vblank_end + 1;
visarea.max_y = state->vblank_start;
- machine->primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
+ machine.primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
/* create a timer for IRQs and set up the first callback */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
state->irq_state = 0;
schedule_next_irq(machine, 0-64);
@@ -197,7 +197,7 @@ static MACHINE_START( cloud9 )
static MACHINE_RESET( cloud9 )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
@@ -212,7 +212,7 @@ static MACHINE_RESET( cloud9 )
static WRITE8_HANDLER( irq_ack_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
if (state->irq_state)
{
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -223,19 +223,19 @@ static WRITE8_HANDLER( irq_ack_w )
static WRITE8_HANDLER( cloud9_led_w )
{
- set_led_status(space->machine, offset, ~data & 0x80);
+ set_led_status(space->machine(), offset, ~data & 0x80);
}
static WRITE8_HANDLER( cloud9_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x80);
+ coin_counter_w(space->machine(), offset, data & 0x80);
}
static READ8_HANDLER( leta_r )
{
- return input_port_read(space->machine, offset ? "TRACKX" : "TRACKY");
+ return input_port_read(space->machine(), offset ? "TRACKX" : "TRACKY");
}
@@ -248,7 +248,7 @@ static READ8_HANDLER( leta_r )
static WRITE8_HANDLER( nvram_recall_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
state->nvram->recall(0);
state->nvram->recall(1);
state->nvram->recall(0);
@@ -257,7 +257,7 @@ static WRITE8_HANDLER( nvram_recall_w )
static WRITE8_HANDLER( nvram_store_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
state->nvram->store(0);
state->nvram->store(1);
state->nvram->store(0);
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index 026453daa76..5e26ff5f35b 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -30,10 +30,10 @@ static MACHINE_RESET( clshroad )
static READ8_HANDLER( clshroad_input_r )
{
- return ((~input_port_read(space->machine, "P1") & (1 << offset)) ? 1 : 0) |
- ((~input_port_read(space->machine, "P2") & (1 << offset)) ? 2 : 0) |
- ((~input_port_read(space->machine, "DSW1") & (1 << offset)) ? 4 : 0) |
- ((~input_port_read(space->machine, "DSW2") & (1 << offset)) ? 8 : 0) ;
+ return ((~input_port_read(space->machine(), "P1") & (1 << offset)) ? 1 : 0) |
+ ((~input_port_read(space->machine(), "P2") & (1 << offset)) ? 2 : 0) |
+ ((~input_port_read(space->machine(), "DSW1") & (1 << offset)) ? 4 : 0) |
+ ((~input_port_read(space->machine(), "DSW2") & (1 << offset)) ? 8 : 0) ;
}
@@ -473,7 +473,7 @@ without this the death sequence never ends so the game is unplayable after you
die once, it would be nice to avoid the hack however
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x05C6] = 0xc3;
ROM[0x05C7] = 0x8d;
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index a6a26a1ec3f..0d420f8c6cb 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -60,9 +60,9 @@ static VIDEO_START( cmmb )
static SCREEN_UPDATE( cmmb )
{
- cmmb_state *state = screen->machine->driver_data<cmmb_state>();
+ cmmb_state *state = screen->machine().driver_data<cmmb_state>();
UINT8 *videoram = state->videoram;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x00000;
int y,x;
@@ -85,22 +85,22 @@ static SCREEN_UPDATE( cmmb )
static READ8_HANDLER( cmmb_charram_r )
{
- UINT8 *GFX = space->machine->region("gfx")->base();
+ UINT8 *GFX = space->machine().region("gfx")->base();
return GFX[offset];
}
static WRITE8_HANDLER( cmmb_charram_w )
{
- UINT8 *GFX = space->machine->region("gfx")->base();
+ UINT8 *GFX = space->machine().region("gfx")->base();
GFX[offset] = data;
offset&=0xfff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 4);
- gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 4);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset >> 5);
}
@@ -115,10 +115,10 @@ static READ8_HANDLER( cmmb_input_r )
//printf("%02x R\n",offset);
switch(offset)
{
- case 0x00: return input_port_read(space->machine, "IN2");
+ case 0x00: return input_port_read(space->machine(), "IN2");
case 0x03: return 4; //eeprom?
- case 0x0e: return input_port_read(space->machine, "IN0");
- case 0x0f: return input_port_read(space->machine, "IN1");
+ case 0x0e: return input_port_read(space->machine(), "IN0");
+ case 0x0f: return input_port_read(space->machine(), "IN1");
}
return 0xff;
@@ -127,27 +127,27 @@ static READ8_HANDLER( cmmb_input_r )
/*
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000 + (0x10000 * (data & 0x03));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
*/
static WRITE8_HANDLER( cmmb_output_w )
{
- cmmb_state *state = space->machine->driver_data<cmmb_state>();
+ cmmb_state *state = space->machine().driver_data<cmmb_state>();
//printf("%02x -> [%02x] W\n",data,offset);
switch(offset)
{
case 0x01:
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
break;
case 0x03:
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( cmmb_output_w )
static READ8_HANDLER( kludge_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
/* overlap empty addresses */
@@ -288,7 +288,7 @@ GFXDECODE_END
static INTERRUPT_GEN( cmmb_irq )
{
- //if(input_code_pressed_once(device->machine, KEYCODE_Z))
+ //if(input_code_pressed_once(device->machine(), KEYCODE_Z))
// device_set_input_line(device, 0, HOLD_LINE);
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index f37330361c5..2e86edee9f9 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -56,7 +56,7 @@ Note about version levels using Mutant Fighter as the example:
static WRITE16_HANDLER( cninja_sound_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
@@ -64,7 +64,7 @@ static WRITE16_HANDLER( cninja_sound_w )
static WRITE16_HANDLER( stoneage_sound_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -72,7 +72,7 @@ static WRITE16_HANDLER( stoneage_sound_w )
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- cninja_state *state = timer.machine->driver_data<cninja_state>();
+ cninja_state *state = timer.machine().driver_data<cninja_state>();
device_set_input_line(state->maincpu, (state->irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
state->raster_irq_timer->reset();
@@ -80,7 +80,7 @@ static TIMER_DEVICE_CALLBACK( interrupt_gen )
static READ16_HANDLER( cninja_irq_r )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
switch (offset)
{
@@ -100,7 +100,7 @@ static READ16_HANDLER( cninja_irq_r )
static WRITE16_HANDLER( cninja_irq_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
switch (offset)
{
@@ -118,7 +118,7 @@ static WRITE16_HANDLER( cninja_irq_w )
state->scanline = data & 0xff;
if (!BIT(state->irq_mask, 1) && state->scanline > 0 && state->scanline < 240)
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(state->scanline), state->scanline);
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(state->scanline), state->scanline);
else
state->raster_irq_timer->reset();
return;
@@ -135,11 +135,11 @@ static READ16_HANDLER( robocop2_prot_r )
switch (offset << 1)
{
case 0x41a: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x320: /* Coins */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x4e6: /* Dip switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(space->cpu), offset);
return 0x84;
@@ -152,17 +152,17 @@ static READ16_HANDLER( robocop2_prot_r )
static WRITE16_HANDLER( cninja_pf12_control_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
deco16ic_pf_control_w(state->deco_tilegen1, offset, data, mem_mask);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static WRITE16_HANDLER( cninja_pf34_control_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
deco16ic_pf_control_w(state->deco_tilegen2, offset, data, mem_mask);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
@@ -722,19 +722,19 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cninja_state *driver_state = device->machine->driver_data<cninja_state>();
+ cninja_state *driver_state = device->machine().driver_data<cninja_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static void sound_irq2(device_t *device, int state)
{
- cninja_state *driver_state = device->machine->driver_data<cninja_state>();
+ cninja_state *driver_state = device->machine().driver_data<cninja_state>();
device_set_input_line(driver_state->audiocpu, 0, state);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- cninja_state *state = device->machine->driver_data<cninja_state>();
+ cninja_state *state = device->machine().driver_data<cninja_state>();
/* the second OKIM6295 ROM is bank switched */
state->oki2->set_bank_base((data & 1) * 0x40000);
@@ -883,7 +883,7 @@ static const deco16ic_interface mutantf_deco16ic_tilegen2_intf =
static MACHINE_START( cninja )
{
- cninja_state *state = machine->driver_data<cninja_state>();
+ cninja_state *state = machine.driver_data<cninja_state>();
state->save_item(NAME(state->scanline));
state->save_item(NAME(state->irq_mask));
@@ -891,7 +891,7 @@ static MACHINE_START( cninja )
static MACHINE_RESET( cninja )
{
- cninja_state *state = machine->driver_data<cninja_state>();
+ cninja_state *state = machine.driver_data<cninja_state>();
state->scanline = 0;
state->irq_mask = 0;
@@ -2002,9 +2002,9 @@ ROM_END
/**********************************************************************************/
-static void cninja_patch( running_machine *machine )
+static void cninja_patch( running_machine &machine )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x80000 / 2; i++)
@@ -2032,19 +2032,19 @@ static void cninja_patch( running_machine *machine )
static DRIVER_INIT( cninja )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(cninja_sound_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(cninja_sound_w));
cninja_patch(machine);
}
static DRIVER_INIT( stoneage )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(stoneage_sound_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(stoneage_sound_w));
}
static DRIVER_INIT( mutantf )
{
- const UINT8 *src = machine->region("gfx2")->base();
- UINT8 *dst = machine->region("gfx1")->base();
+ const UINT8 *src = machine.region("gfx2")->base();
+ UINT8 *dst = machine.region("gfx1")->base();
/* The 16x16 graphic has some 8x8 chars in it - decode them in GFX1 */
memcpy(dst + 0x50000, dst + 0x10000, 0x10000);
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index f0da1441214..a5bfdde9ef5 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -63,7 +63,7 @@ public:
static PALETTE_INIT( zerotrgt )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -89,7 +89,7 @@ static PALETTE_INIT( zerotrgt )
static TILE_GET_INFO( get_bg_tile_info )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int code = state->videoram2[tile_index];
SET_TILE_INFO(2, code + state->bg_bank, state->bg_color_bank, 0);
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int code = state->videoram[tile_index];
int attr = state->colorram[tile_index];
@@ -108,7 +108,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows_flip_x, 8, 8, 32, 32);
@@ -119,7 +119,7 @@ static VIDEO_START( cntsteer )
static VIDEO_START( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows_flip_x, 8, 8, 32, 32);
@@ -141,9 +141,9 @@ Sprite list:
[2] xxxx xxxx X attribute
[3] xxxx xxxx sprite number
*/
-static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int offs;
for (offs = 0; offs < 0x200; offs += 4)
@@ -176,17 +176,17 @@ static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
{
if (fy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy - 16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy, 0);
}
}
else
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
}
}
@@ -199,9 +199,9 @@ static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
---- --xx tile bank
*/
-static void cntsteer_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int offs;
for (offs = 0; offs < 0x80; offs += 4)
@@ -234,26 +234,26 @@ static void cntsteer_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
{
if (fy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy - 16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy, 0);
}
}
else
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
}
}
static SCREEN_UPDATE( zerotrgt )
{
- cntsteer_state *state = screen->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = screen->machine().driver_data<cntsteer_state>();
if (state->disable_roz)
- bitmap_fill(bitmap, cliprect, screen->machine->pens[8 * state->bg_color_bank]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->bg_color_bank]);
else
{
int p1, p2, p3, p4;
@@ -293,7 +293,7 @@ static SCREEN_UPDATE( zerotrgt )
0, 0);
}
- zerotrgt_draw_sprites(screen->machine, bitmap, cliprect);
+ zerotrgt_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -301,10 +301,10 @@ static SCREEN_UPDATE( zerotrgt )
static SCREEN_UPDATE( cntsteer )
{
- cntsteer_state *state = screen->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = screen->machine().driver_data<cntsteer_state>();
if (state->disable_roz)
- bitmap_fill(bitmap, cliprect, screen->machine->pens[8 * state->bg_color_bank]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->bg_color_bank]);
else
{
int p1, p2, p3, p4;
@@ -342,7 +342,7 @@ static SCREEN_UPDATE( cntsteer )
0, 0);
}
- cntsteer_draw_sprites(screen->machine, bitmap, cliprect);
+ cntsteer_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -362,7 +362,7 @@ static SCREEN_UPDATE( cntsteer )
*/
static WRITE8_HANDLER(zerotrgt_vregs_w)
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
// static UINT8 test[5];
// test[offset] = data;
@@ -378,7 +378,7 @@ static WRITE8_HANDLER(zerotrgt_vregs_w)
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
break;
case 3: state->rotation_sign = (data & 1);
- flip_screen_set(space->machine, !(data & 4));
+ flip_screen_set(space->machine(), !(data & 4));
state->scrolly_hi = (data & 0x30) << 4;
state->scrollx_hi = (data & 0xc0) << 2;
break;
@@ -388,7 +388,7 @@ static WRITE8_HANDLER(zerotrgt_vregs_w)
static WRITE8_HANDLER(cntsteer_vregs_w)
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
// static UINT8 test[5];
// test[offset] = data;
@@ -413,21 +413,21 @@ static WRITE8_HANDLER(cntsteer_vregs_w)
static WRITE8_HANDLER( cntsteer_foreground_vram_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( cntsteer_foreground_attr_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( cntsteer_background_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -440,20 +440,20 @@ static WRITE8_HANDLER( cntsteer_background_w )
static WRITE8_HANDLER( gekitsui_sub_irq_ack )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, CLEAR_LINE);
}
static WRITE8_HANDLER( cntsteer_sound_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static WRITE8_HANDLER( zerotrgt_ctrl_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
/*TODO: check this.*/
logerror("CTRL: %04x: %04x: %04x\n", cpu_get_pc(space->cpu), offset, data);
// if (offset == 0) device_set_input_line(state->subcpu, INPUT_LINE_RESET, ASSERT_LINE);
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( zerotrgt_ctrl_w )
static WRITE8_HANDLER( cntsteer_sub_irq_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, ASSERT_LINE);
// printf("%02x IRQ\n", data);
}
@@ -479,7 +479,7 @@ static WRITE8_HANDLER( cntsteer_sub_nmi_w )
static WRITE8_HANDLER( cntsteer_main_irq_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, HOLD_LINE);
}
@@ -487,7 +487,7 @@ static WRITE8_HANDLER( cntsteer_main_irq_w )
static READ8_HANDLER( cntsteer_adx_r )
{
UINT8 res = 0, adx_val;
- adx_val = input_port_read(space->machine, "AN_STEERING");
+ adx_val = input_port_read(space->machine(), "AN_STEERING");
if (adx_val >= 0x70 && adx_val <= 0x90)
res = 0xff;
@@ -572,13 +572,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( nmimask_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->nmimask = data & 0x80;
}
static INTERRUPT_GEN ( sound_interrupt )
{
- cntsteer_state *state = device->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = device->machine().driver_data<cntsteer_state>();
if (!state->nmimask)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -667,7 +667,7 @@ INPUT_PORTS_END
static INPUT_CHANGED( coin_inserted )
{
- cntsteer_state *state = field->port->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = field->port->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -800,11 +800,11 @@ GFXDECODE_END
static MACHINE_START( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("subcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("subcpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->bg_bank));
@@ -821,7 +821,7 @@ static MACHINE_START( cntsteer )
static MACHINE_START( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->save_item(NAME(state->nmimask));
MACHINE_START_CALL(cntsteer);
@@ -830,7 +830,7 @@ static MACHINE_START( zerotrgt )
static MACHINE_RESET( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->flipscreen = 0;
state->bg_bank = 0;
@@ -848,7 +848,7 @@ static MACHINE_RESET( cntsteer )
static MACHINE_RESET( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->nmimask = 0;
MACHINE_RESET_CALL(cntsteer);
@@ -1132,10 +1132,10 @@ ROM_END
/***************************************************************************/
-static void zerotrgt_rearrange_gfx( running_machine *machine, int romsize, int romarea )
+static void zerotrgt_rearrange_gfx( running_machine &machine, int romsize, int romarea )
{
- UINT8 *src = machine->region("gfx4")->base();
- UINT8 *dst = machine->region("gfx3")->base();
+ UINT8 *src = machine.region("gfx4")->base();
+ UINT8 *dst = machine.region("gfx3")->base();
int rm;
int cnt1;
@@ -1154,7 +1154,7 @@ static void zerotrgt_rearrange_gfx( running_machine *machine, int romsize, int r
#if 0
static DRIVER_INIT( cntsteer )
{
- UINT8 *RAM = machine->region("subcpu")->base();
+ UINT8 *RAM = machine.region("subcpu")->base();
RAM[0xc2cf] = 0x43; /* Patch out Cpu 1 ram test - it never ends..?! */
RAM[0xc2d0] = 0x43;
diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c
index fe4acd4a060..c69b20b4782 100644
--- a/src/mame/drivers/coinmstr.c
+++ b/src/mame/drivers/coinmstr.c
@@ -46,7 +46,7 @@ public:
static WRITE8_HANDLER( quizmstr_bg_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -55,7 +55,7 @@ static WRITE8_HANDLER( quizmstr_bg_w )
}
-static void coinmstr_set_pal(running_machine *machine, UINT32 paldat, int col)
+static void coinmstr_set_pal(running_machine &machine, UINT32 paldat, int col)
{
col = col *4;
@@ -90,7 +90,7 @@ static void coinmstr_set_pal(running_machine *machine, UINT32 paldat, int col)
static WRITE8_HANDLER( quizmstr_attr1_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram1[offset] = data;
if(offset >= 0x0240)
@@ -99,14 +99,14 @@ static WRITE8_HANDLER( quizmstr_attr1_w )
UINT32 paldata = (state->attr_ram1[offset] & 0x7f) | ((state->attr_ram2[offset] & 0x7f) << 7);
tilemap_mark_tile_dirty(state->bg_tilemap, offset - 0x0240);
- coinmstr_set_pal(space->machine, paldata, offset - 0x240);
+ coinmstr_set_pal(space->machine(), paldata, offset - 0x240);
}
}
static WRITE8_HANDLER( quizmstr_attr2_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram2[offset] = data;
if(offset >= 0x0240)
@@ -115,14 +115,14 @@ static WRITE8_HANDLER( quizmstr_attr2_w )
UINT32 paldata = (state->attr_ram1[offset] & 0x7f) | ((state->attr_ram2[offset] & 0x7f) << 7);
tilemap_mark_tile_dirty(state->bg_tilemap, offset - 0x0240);
- coinmstr_set_pal(space->machine, paldata, offset - 0x240);
+ coinmstr_set_pal(space->machine(), paldata, offset - 0x240);
}
}
static WRITE8_HANDLER( quizmstr_attr3_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram3[offset] = data;
if(offset >= 0x0240)
@@ -133,9 +133,9 @@ static WRITE8_HANDLER( quizmstr_attr3_w )
static READ8_HANDLER( question_r )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
int address;
- UINT8 *questions = space->machine->region("user1")->base();
+ UINT8 *questions = space->machine().region("user1")->base();
switch(state->question_adr[2])
{
@@ -182,7 +182,7 @@ static READ8_HANDLER( question_r )
static WRITE8_HANDLER( question_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
if(data != state->question_adr[offset])
{
logerror("offset = %d data = %02X\n",offset,data);
@@ -895,7 +895,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_bg_tile_info )
{
- coinmstr_state *state = machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = machine.driver_data<coinmstr_state>();
UINT8 *videoram = state->videoram;
int tile = videoram[tile_index + 0x0240];
int color = tile_index;
@@ -910,13 +910,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( coinmstr )
{
- coinmstr_state *state = machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = machine.driver_data<coinmstr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 46, 32);
}
static SCREEN_UPDATE( coinmstr )
{
- coinmstr_state *state = screen->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = screen->machine().driver_data<coinmstr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -1211,8 +1211,8 @@ ROM_END
static DRIVER_INIT( coinmstr )
{
- UINT8 *rom = machine->region("user1")->base();
- int length = machine->region("user1")->bytes();
+ UINT8 *rom = machine.region("user1")->base();
+ int length = machine.region("user1")->bytes();
UINT8 *buf = auto_alloc_array(machine, UINT8, length);
int i;
diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c
index afc32265ba6..829d6de082a 100644
--- a/src/mame/drivers/coinmvga.c
+++ b/src/mame/drivers/coinmvga.c
@@ -242,8 +242,8 @@ static VIDEO_START( coinmvga )
static SCREEN_UPDATE( coinmvga )
{
- coinmvga_state *state = screen->machine->driver_data<coinmvga_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ coinmvga_state *state = screen->machine().driver_data<coinmvga_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x04000/2;
int y,x;
@@ -283,7 +283,7 @@ static PALETTE_INIT( coinmvga )
static WRITE16_HANDLER( ramdac_bg_w )
{
- coinmvga_state *state = space->machine->driver_data<coinmvga_state>();
+ coinmvga_state *state = space->machine().driver_data<coinmvga_state>();
if(ACCESSING_BITS_8_15)
{
state->bgpal.offs = data >> 8;
@@ -303,7 +303,7 @@ static WRITE16_HANDLER( ramdac_bg_w )
break;
case 2:
state->bgpal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->bgpal.offs, MAKE_RGB(state->bgpal.r, state->bgpal.g, state->bgpal.b));
+ palette_set_color(space->machine(), state->bgpal.offs, MAKE_RGB(state->bgpal.r, state->bgpal.g, state->bgpal.b));
state->bgpal.offs_internal = 0;
state->bgpal.offs++;
break;
@@ -314,7 +314,7 @@ static WRITE16_HANDLER( ramdac_bg_w )
static WRITE16_HANDLER( ramdac_fg_w )
{
- coinmvga_state *state = space->machine->driver_data<coinmvga_state>();
+ coinmvga_state *state = space->machine().driver_data<coinmvga_state>();
if(ACCESSING_BITS_8_15)
{
state->fgpal.offs = data >> 8;
@@ -334,7 +334,7 @@ static WRITE16_HANDLER( ramdac_fg_w )
break;
case 2:
state->fgpal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, 0x100+state->fgpal.offs, MAKE_RGB(state->fgpal.r, state->fgpal.g, state->fgpal.b));
+ palette_set_color(space->machine(), 0x100+state->fgpal.offs, MAKE_RGB(state->fgpal.r, state->fgpal.g, state->fgpal.b));
state->fgpal.offs_internal = 0;
state->fgpal.offs++;
break;
@@ -345,7 +345,7 @@ static WRITE16_HANDLER( ramdac_fg_w )
/*
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}*/
/*************************
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT( colorama )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x02B476/2] = 0x5470;
@@ -887,7 +887,7 @@ static DRIVER_INIT( colorama )
static DRIVER_INIT( cmrltv75 )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x056fd6/2] = 0x5470;
diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c
index 8a905906b02..7dee9ba9932 100644
--- a/src/mame/drivers/cojag.c
+++ b/src/mame/drivers/cojag.c
@@ -361,8 +361,8 @@ UINT8 cojag_is_r3000;
static MACHINE_RESET( cojag )
{
- cojag_state *state = machine->driver_data<cojag_state>();
- UINT8 *rom = machine->region("user2")->base();
+ cojag_state *state = machine.driver_data<cojag_state>();
+ UINT8 *rom = machine.region("user2")->base();
/* 68020 only: copy the interrupt vectors into RAM */
if (!cojag_is_r3000)
@@ -392,8 +392,8 @@ static MACHINE_RESET( cojag )
jaguar_dsp_resume(machine);
/* halt the CPUs */
- jaguargpu_ctrl_w(machine->device("gpu"), G_CTRL, 0, 0xffffffff);
- jaguardsp_ctrl_w(machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
+ jaguargpu_ctrl_w(machine.device("gpu"), G_CTRL, 0, 0xffffffff);
+ jaguardsp_ctrl_w(machine.device("audiocpu"), D_CTRL, 0, 0xffffffff);
/* set blitter idle flag */
blitter_status = 1;
@@ -409,7 +409,7 @@ static MACHINE_RESET( cojag )
static READ32_HANDLER( misc_control_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* D7 = board reset (low)
D6 = audio must & reset (high)
D5 = volume control data (invert on write)
@@ -423,7 +423,7 @@ static READ32_HANDLER( misc_control_r )
static WRITE32_HANDLER( misc_control_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(space->cpu), data);
/* D7 = board reset (low)
@@ -437,19 +437,19 @@ static WRITE32_HANDLER( misc_control_w )
if (!(data & 0x80))
{
/* clear any spinuntil stuff */
- jaguar_gpu_resume(space->machine);
- jaguar_dsp_resume(space->machine);
+ jaguar_gpu_resume(space->machine());
+ jaguar_dsp_resume(space->machine());
/* halt the CPUs */
- jaguargpu_ctrl_w(space->machine->device("gpu"), G_CTRL, 0, 0xffffffff);
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
+ jaguargpu_ctrl_w(space->machine().device("gpu"), G_CTRL, 0, 0xffffffff);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), D_CTRL, 0, 0xffffffff);
}
/* adjust banking */
- if (space->machine->region("user2")->base())
+ if (space->machine().region("user2")->base())
{
- memory_set_bank(space->machine, "bank2", (data >> 1) & 7);
- memory_set_bank(space->machine, "bank9", (data >> 1) & 7);
+ memory_set_bank(space->machine(), "bank2", (data >> 1) & 7);
+ memory_set_bank(space->machine(), "bank9", (data >> 1) & 7);
}
COMBINE_DATA(&state->misc_control_data);
@@ -465,13 +465,13 @@ static WRITE32_HANDLER( misc_control_w )
static READ32_HANDLER( gpuctrl_r )
{
- return jaguargpu_ctrl_r(space->machine->device("gpu"), offset);
+ return jaguargpu_ctrl_r(space->machine().device("gpu"), offset);
}
static WRITE32_HANDLER( gpuctrl_w )
{
- jaguargpu_ctrl_w(space->machine->device("gpu"), offset, data, mem_mask);
+ jaguargpu_ctrl_w(space->machine().device("gpu"), offset, data, mem_mask);
}
@@ -484,13 +484,13 @@ static WRITE32_HANDLER( gpuctrl_w )
static READ32_HANDLER( dspctrl_r )
{
- return jaguardsp_ctrl_r(space->machine->device("audiocpu"), offset);
+ return jaguardsp_ctrl_r(space->machine().device("audiocpu"), offset);
}
static WRITE32_HANDLER( dspctrl_w )
{
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
}
@@ -512,11 +512,11 @@ static WRITE32_HANDLER( latch_w )
logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(space->cpu), data);
/* adjust banking */
- if (space->machine->region("user2")->base())
+ if (space->machine().region("user2")->base())
{
if (cojag_is_r3000)
- memory_set_bank(space->machine, "bank1", data & 1);
- memory_set_bank(space->machine, "bank8", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank8", data & 1);
}
}
@@ -530,7 +530,7 @@ static WRITE32_HANDLER( latch_w )
static READ32_HANDLER( eeprom_data_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
if (cojag_is_r3000)
return state->m_nvram[offset] | 0xffffff00;
else
@@ -540,14 +540,14 @@ static READ32_HANDLER( eeprom_data_r )
static WRITE32_HANDLER( eeprom_enable_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
state->eeprom_enable = 1;
}
static WRITE32_HANDLER( eeprom_data_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
// if (state->eeprom_enable)
{
if (cojag_is_r3000)
@@ -592,39 +592,39 @@ static WRITE32_HANDLER( eeprom_data_w )
static TIMER_CALLBACK( gpu_sync_timer )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
/* if a command is still pending, and we haven't maxed out our timer, set a new one */
if (state->gpu_command_pending && param < 1000)
- machine->scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
+ machine.scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
}
static WRITE32_HANDLER( gpu_jump_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* update the data in memory */
COMBINE_DATA(state->gpu_jump_address);
logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(space->cpu), *state->gpu_jump_address);
/* if the GPU is suspended, release it now */
- jaguar_gpu_resume(space->machine);
+ jaguar_gpu_resume(space->machine());
/* start the sync timer going, and note that there is a command pending */
- space->machine->scheduler().synchronize(FUNC(gpu_sync_timer));
+ space->machine().scheduler().synchronize(FUNC(gpu_sync_timer));
state->gpu_command_pending = 1;
}
static READ32_HANDLER( gpu_jump_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* if the current GPU command is just pointing back to the spin loop, and */
/* we're reading it from the spin loop, we can optimize */
if (*state->gpu_jump_address == state->gpu_spin_pc && cpu_get_previouspc(space->cpu) == state->gpu_spin_pc)
{
#if ENABLE_SPEEDUP_HACKS
/* spin if we're allowed */
- jaguar_gpu_suspend(space->machine);
+ jaguar_gpu_suspend(space->machine());
#endif
/* no command is pending */
@@ -659,7 +659,7 @@ static READ32_HANDLER( gpu_jump_r )
static READ32_HANDLER( cojagr3k_main_speedup_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* if it's been less than main_speedup_max_cycles cycles since the last time */
@@ -708,7 +708,7 @@ static READ32_HANDLER( cojagr3k_main_speedup_r )
static READ32_HANDLER( main_gpu_wait_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
if (state->gpu_command_pending)
device_spin_until_interrupt(space->cpu);
return *state->main_gpu_wait;
@@ -735,7 +735,7 @@ static READ32_HANDLER( main_gpu_wait_r )
static WRITE32_HANDLER( area51_main_speedup_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* store the data */
@@ -770,7 +770,7 @@ static WRITE32_HANDLER( area51_main_speedup_w )
static WRITE32_HANDLER( area51mx_main_speedup_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* store the data */
@@ -1527,19 +1527,19 @@ ROM_END
*
*************************************/
-static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
+static void cojag_common_init(running_machine &machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
/* copy over the ROM */
- state->main_cpu = machine->device<cpu_device>("maincpu");
+ state->main_cpu = machine.device<cpu_device>("maincpu");
cojag_is_r3000 = (state->main_cpu->type() == R3041BE);
/* install synchronization hooks for GPU */
if (cojag_is_r3000)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
else
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
- machine->device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
+ machine.device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
state->gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
state->gpu_spin_pc = 0xf03000 + spin_pc;
@@ -1550,31 +1550,31 @@ static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UI
static DRIVER_INIT( area51a )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x5c4, 0x5a0);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
#endif
}
static DRIVER_INIT( area51 )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( maxforce )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1583,14 +1583,14 @@ static DRIVER_INIT( maxforce )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( area51mx )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1598,14 +1598,14 @@ static DRIVER_INIT( area51mx )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
#endif
}
static DRIVER_INIT( a51mxr3k )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1614,35 +1614,35 @@ static DRIVER_INIT( a51mxr3k )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( fishfren )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x578, 0x554);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 200;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
#endif
}
-static void init_freeze_common(running_machine *machine, offs_t main_speedup_addr)
+static void init_freeze_common(running_machine &machine, offs_t main_speedup_addr)
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0bc, 0x09c);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 200;
if (main_speedup_addr != 0)
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
- state->main_gpu_wait = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
+ state->main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
#endif
}
@@ -1656,13 +1656,13 @@ static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
static DRIVER_INIT( vcircle )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x5c0, 0x5a0);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 50;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
#endif
}
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 829c007a706..bb4e6968d80 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -138,7 +138,7 @@ Dip location and recommended settings verified with the US manual
static WRITE8_HANDLER( combatsc_vreg_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data != state->vreg)
{
tilemap_mark_all_tiles_dirty(state->textlayer);
@@ -152,7 +152,7 @@ static WRITE8_HANDLER( combatsc_vreg_w )
static WRITE8_HANDLER( combatscb_sh_irqtrigger_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -161,12 +161,12 @@ static READ8_HANDLER( combatscb_io_r )
{
static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
static WRITE8_HANDLER( combatscb_priority_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data & 0x40)
{
@@ -186,7 +186,7 @@ static WRITE8_HANDLER( combatscb_priority_w )
static WRITE8_HANDLER( combatsc_bankselect_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->priority = data & 0x20;
@@ -204,14 +204,14 @@ static WRITE8_HANDLER( combatsc_bankselect_w )
}
if (data & 0x10)
- memory_set_bank(space->machine, "bank1", (data & 0x0e) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0e) >> 1);
else
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
}
static WRITE8_HANDLER( combatscb_io_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
switch (offset)
{
@@ -224,7 +224,7 @@ static WRITE8_HANDLER( combatscb_io_w )
static WRITE8_HANDLER( combatscb_bankselect_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data & 0x40)
{
@@ -244,13 +244,13 @@ static WRITE8_HANDLER( combatscb_bankselect_w )
state->bank_select = data;
if (data & 0x10)
- memory_set_bank(space->machine, "bank1", (data & 0x0e) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0e) >> 1);
else
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
if (data == 0x1f)
{
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
space->install_legacy_write_handler(0x4000, 0x7fff, FUNC(combatscb_io_w));
space->install_legacy_read_handler(0x4400, 0x4403, FUNC(combatscb_io_r));/* IO RAM & Video Registers */
}
@@ -270,13 +270,13 @@ static WRITE8_HANDLER( combatsc_coin_counter_w )
/* b1: coin counter 2 */
/* b0: coin counter 1 */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static READ8_HANDLER( trackball_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (offset == 0)
{
@@ -287,7 +287,7 @@ static READ8_HANDLER( trackball_r )
{
UINT8 curr;
- curr = input_port_read_safe(space->machine, tracknames[i], 0xff);
+ curr = input_port_read_safe(space->machine(), tracknames[i], 0xff);
dir[i] = curr - state->pos[i];
state->sign[i] = dir[i] & 0x80;
@@ -314,12 +314,12 @@ static READ8_HANDLER( trackball_r )
/* the protection is a simple multiply */
static WRITE8_HANDLER( protection_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->prot[offset] = data;
}
static READ8_HANDLER( protection_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
return ((state->prot[0] * state->prot[1]) >> (offset * 8)) & 0xff;
}
static WRITE8_HANDLER( protection_clock_w )
@@ -332,7 +332,7 @@ static WRITE8_HANDLER( protection_clock_w )
static WRITE8_HANDLER( combatsc_sh_irqtrigger_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -358,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( combatsc_portA_w )
static READ8_DEVICE_HANDLER ( combatsc_ym2203_r )
{
- combatsc_state *state = device->machine->driver_data<combatsc_state>();
+ combatsc_state *state = device->machine().driver_data<combatsc_state>();
int status = ym2203_r(device,offset);
if (cpu_get_pc(state->audiocpu) == 0x334)
@@ -682,20 +682,20 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( combatsc )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
- UINT8 *MEM = machine->region("maincpu")->base() + 0x38000;
+ combatsc_state *state = machine.driver_data<combatsc_state>();
+ UINT8 *MEM = machine.region("maincpu")->base() + 0x38000;
state->io_ram = MEM + 0x0000;
state->page[0] = MEM + 0x4000;
state->page[1] = MEM + 0x6000;
- state->interleave_timer = machine->scheduler().timer_alloc(FUNC(NULL));
+ state->interleave_timer = machine.scheduler().timer_alloc(FUNC(NULL));
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
- memory_configure_bank(machine, "bank1", 0, 10, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 10, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->priority));
state->save_item(NAME(state->vreg));
@@ -710,8 +710,8 @@ static MACHINE_START( combatsc )
static MACHINE_RESET( combatsc )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ combatsc_state *state = machine.driver_data<combatsc_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
memset(state->io_ram, 0x00, 0x4000);
@@ -995,7 +995,7 @@ ROM_END
static DRIVER_INIT( combatsc )
{
/* joystick instead of trackball */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0404, 0x0404, "IN1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0404, 0x0404, "IN1");
}
diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c
index 2e6cad05f92..815dc908065 100644
--- a/src/mame/drivers/commando.c
+++ b/src/mame/drivers/commando.c
@@ -226,9 +226,9 @@ static INTERRUPT_GEN( commando_interrupt )
static MACHINE_START( commando )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->scroll_x));
state->save_item(NAME(state->scroll_y));
@@ -236,7 +236,7 @@ static MACHINE_START( commando )
static MACHINE_RESET( commando )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
state->scroll_x[0] = 0;
state->scroll_x[1] = 0;
@@ -518,8 +518,8 @@ ROM_END
static DRIVER_INIT( commando )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
@@ -538,8 +538,8 @@ static DRIVER_INIT( commando )
static DRIVER_INIT( spaceinv )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
diff --git a/src/mame/drivers/compgolf.c b/src/mame/drivers/compgolf.c
index 5ad89de2e39..cf7261b6e53 100644
--- a/src/mame/drivers/compgolf.c
+++ b/src/mame/drivers/compgolf.c
@@ -24,19 +24,19 @@
static WRITE8_DEVICE_HANDLER( compgolf_scrollx_lo_w )
{
- compgolf_state *state = device->machine->driver_data<compgolf_state>();
+ compgolf_state *state = device->machine().driver_data<compgolf_state>();
state->scrollx_lo = data;
}
static WRITE8_DEVICE_HANDLER( compgolf_scrolly_lo_w )
{
- compgolf_state *state = device->machine->driver_data<compgolf_state>();
+ compgolf_state *state = device->machine().driver_data<compgolf_state>();
state->scrolly_lo = data;
}
static WRITE8_HANDLER( compgolf_ctrl_w )
{
- compgolf_state *state = space->machine->driver_data<compgolf_state>();
+ compgolf_state *state = space->machine().driver_data<compgolf_state>();
/* bit 4 and 6 are always set */
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( compgolf_ctrl_w )
if (state->bank != new_bank)
{
state->bank = new_bank;
- memory_set_bank(space->machine, "bank1", state->bank);
+ memory_set_bank(space->machine(), "bank1", state->bank);
}
state->scrollx_hi = (data & 1) << 8;
@@ -203,7 +203,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "maincpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "maincpu", 0, linestate);
}
static const ym2203_interface ym2203_config =
@@ -228,7 +228,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( compgolf )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
state->save_item(NAME(state->bank));
state->save_item(NAME(state->scrollx_lo));
@@ -239,7 +239,7 @@ static MACHINE_START( compgolf )
static MACHINE_RESET( compgolf )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
state->bank = -1;
state->scrollx_lo = 0;
@@ -346,10 +346,10 @@ ROM_END
*
*************************************/
-static void compgolf_expand_bg(running_machine *machine)
+static void compgolf_expand_bg(running_machine &machine)
{
- UINT8 *GFXDST = machine->region("gfx2")->base();
- UINT8 *GFXSRC = machine->region("gfx4")->base();
+ UINT8 *GFXDST = machine.region("gfx2")->base();
+ UINT8 *GFXSRC = machine.region("gfx4")->base();
int x;
@@ -362,7 +362,7 @@ static void compgolf_expand_bg(running_machine *machine)
static DRIVER_INIT( compgolf )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("user1")->base(), 0x4000);
compgolf_expand_bg(machine);
}
diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c
index c88ea38d37a..7506310a41e 100644
--- a/src/mame/drivers/contra.c
+++ b/src/mame/drivers/contra.c
@@ -27,29 +27,29 @@ Dip locations and factory settings verified with manual
static INTERRUPT_GEN( contra_interrupt )
{
- contra_state *state = device->machine->driver_data<contra_state>();
+ contra_state *state = device->machine().driver_data<contra_state>();
if (k007121_ctrlram_r(state->k007121_1, 7) & 0x02)
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( contra_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( contra_sh_irqtrigger_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( contra_coin_counter_w )
{
if (data & 0x01)
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
if (data & 0x02)
- coin_counter_w(space->machine, 1, (data & 0x02) >> 1);
+ coin_counter_w(space->machine(), 1, (data & 0x02) >> 1);
}
static WRITE8_HANDLER( cpu_sound_command_w )
@@ -178,14 +178,14 @@ GFXDECODE_END
static MACHINE_START( contra )
{
- contra_state *state = machine->driver_data<contra_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ contra_state *state = machine.driver_data<contra_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
}
static MACHINE_CONFIG_START( contra, contra_state )
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 9d4630e3558..17e1195152a 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -56,7 +56,7 @@ static const UINT16 nvram_unlock_seq[] =
static void amerdart_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- coolpool_state *state = screen.machine->driver_data<coolpool_state>();
+ coolpool_state *state = screen.machine().driver_data<coolpool_state>();
UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0xff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
@@ -85,11 +85,11 @@ static void amerdart_scanline(screen_device &screen, bitmap_t *bitmap, int scanl
static void coolpool_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- coolpool_state *state = screen.machine->driver_data<coolpool_state>();
+ coolpool_state *state = screen.machine().driver_data<coolpool_state>();
UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0x1ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr;
int x;
@@ -111,7 +111,7 @@ static void coolpool_scanline(screen_device &screen, bitmap_t *bitmap, int scanl
static void coolpool_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
memcpy(shiftreg, &state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
}
@@ -119,7 +119,7 @@ static void coolpool_to_shiftreg(address_space *space, UINT32 address, UINT16 *s
static void coolpool_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
memcpy(&state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
}
@@ -134,10 +134,10 @@ static void coolpool_from_shiftreg(address_space *space, UINT32 address, UINT16
static MACHINE_RESET( amerdart )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
- state->maincpu = machine->device("maincpu");
- state->dsp = machine->device("dsp");
+ state->maincpu = machine.device("maincpu");
+ state->dsp = machine.device("dsp");
state->nvram_write_enable = 0;
}
@@ -145,7 +145,7 @@ static MACHINE_RESET( amerdart )
static MACHINE_RESET( coolpool )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->nvram_write_enable = 0;
}
@@ -159,14 +159,14 @@ static MACHINE_RESET( coolpool )
static TIMER_DEVICE_CALLBACK( nvram_write_timeout )
{
- coolpool_state *state = timer.machine->driver_data<coolpool_state>();
+ coolpool_state *state = timer.machine().driver_data<coolpool_state>();
state->nvram_write_enable = 0;
}
static WRITE16_HANDLER( nvram_thrash_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* keep track of the last few writes */
memmove(&state->nvram_write_seq[0], &state->nvram_write_seq[1], (NVRAM_UNLOCK_SEQ_LEN - 1) * sizeof(state->nvram_write_seq[0]));
state->nvram_write_seq[NVRAM_UNLOCK_SEQ_LEN - 1] = offset & 0x3ff;
@@ -175,7 +175,7 @@ static WRITE16_HANDLER( nvram_thrash_w )
if (!memcmp(nvram_unlock_seq, state->nvram_write_seq, sizeof(nvram_unlock_seq)))
{
state->nvram_write_enable = 1;
- timer_device *nvram_timer = space->machine->device<timer_device>("nvram_timer");
+ timer_device *nvram_timer = space->machine().device<timer_device>("nvram_timer");
nvram_timer->adjust(attotime::from_msec(1000));
}
}
@@ -183,7 +183,7 @@ static WRITE16_HANDLER( nvram_thrash_w )
static WRITE16_HANDLER( nvram_data_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* only the low 8 bits matter */
if (ACCESSING_BITS_0_7)
{
@@ -211,7 +211,7 @@ static WRITE16_HANDLER( nvram_thrash_data_w )
static TIMER_DEVICE_CALLBACK( amerdart_audio_int_gen )
{
- coolpool_state *state = timer.machine->driver_data<coolpool_state>();
+ coolpool_state *state = timer.machine().driver_data<coolpool_state>();
device_set_input_line(state->dsp, 0, ASSERT_LINE);
device_set_input_line(state->dsp, 0, CLEAR_LINE);
@@ -222,17 +222,17 @@ static WRITE16_HANDLER( amerdart_misc_w )
{
logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
- coin_counter_w(space->machine, 0, ~data & 0x0001);
- coin_counter_w(space->machine, 1, ~data & 0x0002);
+ coin_counter_w(space->machine(), 0, ~data & 0x0001);
+ coin_counter_w(space->machine(), 1, ~data & 0x0002);
/* bits 10-15 are counted down over time */
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
}
static READ16_HANDLER( amerdart_dsp_bio_line_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* Skip idle checking */
if (state->old_cmd == state->cmd_pending)
@@ -252,17 +252,17 @@ static READ16_HANDLER( amerdart_dsp_bio_line_r )
static READ16_HANDLER( amerdart_iop_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
return state->iop_answer;
}
static WRITE16_HANDLER( amerdart_iop_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
COMBINE_DATA(&state->iop_cmd);
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( amerdart_iop_w )
static READ16_HANDLER( amerdart_dsp_cmd_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:DSP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
state->cmd_pending = 0;
@@ -280,11 +280,11 @@ static READ16_HANDLER( amerdart_dsp_cmd_r )
static WRITE16_HANDLER( amerdart_dsp_answer_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:DSP answer %04x\n", cpu_get_pc(space->cpu), data);
state->iop_answer = data;
- cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, ASSERT_LINE);
}
@@ -319,7 +319,7 @@ static int amerdart_trackball_dec(int data)
static int amerdart_trackball_direction(address_space *space, int num, int data)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
UINT16 result_x = (data & 0x0c) >> 2;
UINT16 result_y = (data & 0x03) >> 0;
@@ -409,15 +409,15 @@ static READ16_HANDLER( amerdart_trackball_r )
*/
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
state->result = (state->lastresult | 0x00ff);
- state->newx[1] = input_port_read(space->machine, "XAXIS1"); /* Trackball 1 Left - Right */
- state->newy[1] = input_port_read(space->machine, "YAXIS1"); /* Trackball 1 Up - Down */
- state->newx[2] = input_port_read(space->machine, "XAXIS2"); /* Trackball 2 Left - Right */
- state->newy[2] = input_port_read(space->machine, "YAXIS2"); /* Trackball 2 Up - Down */
+ state->newx[1] = input_port_read(space->machine(), "XAXIS1"); /* Trackball 1 Left - Right */
+ state->newy[1] = input_port_read(space->machine(), "YAXIS1"); /* Trackball 1 Up - Down */
+ state->newx[2] = input_port_read(space->machine(), "XAXIS2"); /* Trackball 2 Left - Right */
+ state->newy[2] = input_port_read(space->machine(), "YAXIS2"); /* Trackball 2 Up - Down */
state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
@@ -449,10 +449,10 @@ static WRITE16_HANDLER( coolpool_misc_w )
{
logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
- coin_counter_w(space->machine, 0, ~data & 0x0001);
- coin_counter_w(space->machine, 1, ~data & 0x0002);
+ coin_counter_w(space->machine(), 0, ~data & 0x0001);
+ coin_counter_w(space->machine(), 1, ~data & 0x0002);
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -466,30 +466,30 @@ static WRITE16_HANDLER( coolpool_misc_w )
static TIMER_CALLBACK( deferred_iop_w )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->iop_cmd = param;
state->cmd_pending = 1;
cputag_set_input_line(machine, "dsp", 0, HOLD_LINE); /* ??? I have no idea who should generate this! */
/* the DSP polls the status bit so it isn't strictly */
/* necessary to also have an IRQ */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
static WRITE16_HANDLER( coolpool_iop_w )
{
logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
- space->machine->scheduler().synchronize(FUNC(deferred_iop_w), data);
+ space->machine().scheduler().synchronize(FUNC(deferred_iop_w), data);
}
static READ16_HANDLER( coolpool_iop_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
return state->iop_answer;
}
@@ -505,7 +505,7 @@ static READ16_HANDLER( coolpool_iop_r )
static READ16_HANDLER( dsp_cmd_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
state->cmd_pending = 0;
logerror("%08x:IOP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
@@ -515,17 +515,17 @@ static READ16_HANDLER( dsp_cmd_r )
static WRITE16_HANDLER( dsp_answer_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
logerror("%08x:IOP answer %04x\n", cpu_get_pc(space->cpu), data);
state->iop_answer = data;
- cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, ASSERT_LINE);
}
static READ16_HANDLER( dsp_bio_line_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
return state->cmd_pending ? CLEAR_LINE : ASSERT_LINE;
}
@@ -546,16 +546,16 @@ static READ16_HANDLER( dsp_hold_line_r )
static READ16_HANDLER( dsp_rom_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
- UINT8 *rom = space->machine->region("user2")->base();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
+ UINT8 *rom = space->machine().region("user2")->base();
- return rom[state->iop_romaddr & (space->machine->region("user2")->bytes() - 1)];
+ return rom[state->iop_romaddr & (space->machine().region("user2")->bytes() - 1)];
}
static WRITE16_HANDLER( dsp_romaddr_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
switch (offset)
{
@@ -585,11 +585,11 @@ static WRITE16_DEVICE_HANDLER( dsp_dac_w )
static READ16_HANDLER( coolpool_input_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
- state->result = (input_port_read(space->machine, "IN1") & 0x00ff) | (state->lastresult & 0xff00);
- state->newx[1] = input_port_read(space->machine, "XAXIS");
- state->newy[1] = input_port_read(space->machine, "YAXIS");
+ state->result = (input_port_read(space->machine(), "IN1") & 0x00ff) | (state->lastresult & 0xff00);
+ state->newx[1] = input_port_read(space->machine(), "XAXIS");
+ state->newy[1] = input_port_read(space->machine(), "YAXIS");
state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
@@ -1172,9 +1172,9 @@ ROM_END
*
*************************************/
-static void register_state_save(running_machine *machine)
+static void register_state_save(running_machine &machine)
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->save_item(NAME(state->oldx));
state->save_item(NAME(state->oldy));
@@ -1191,7 +1191,7 @@ static void register_state_save(running_machine *machine)
static DRIVER_INIT( amerdart )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->lastresult = 0xffff;
@@ -1200,7 +1200,7 @@ static DRIVER_INIT( amerdart )
static DRIVER_INIT( coolpool )
{
- machine->device("dsp")->memory().space(AS_IO)->install_legacy_read_handler(0x07, 0x07, FUNC(coolpool_input_r));
+ machine.device("dsp")->memory().space(AS_IO)->install_legacy_read_handler(0x07, 0x07, FUNC(coolpool_input_r));
register_state_save(machine);
}
@@ -1212,8 +1212,8 @@ static DRIVER_INIT( 9ballsht )
UINT16 *rom;
/* decrypt the main program ROMs */
- rom = (UINT16 *)machine->region("user1")->base();
- len = machine->region("user1")->bytes();
+ rom = (UINT16 *)machine.region("user1")->base();
+ len = machine.region("user1")->bytes();
for (a = 0;a < len/2;a++)
{
int hi,lo,nhi,nlo;
@@ -1236,8 +1236,8 @@ static DRIVER_INIT( 9ballsht )
}
/* decrypt the sub data ROMs */
- rom = (UINT16 *)machine->region("user2")->base();
- len = machine->region("user2")->bytes();
+ rom = (UINT16 *)machine.region("user2")->base();
+ len = machine.region("user2")->bytes();
for (a = 1;a < len/2;a+=4)
{
/* just swap bits 1 and 2 of the address */
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index c4d0f2b14c5..7cc327c350f 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -284,9 +284,9 @@ public:
static VIDEO_START(coolridr)
{
- coolridr_state *state = machine->driver_data<coolridr_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ coolridr_state *state = machine.driver_data<coolridr_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->temp_bitmap_sprites = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_RGB32);
state->test_offs = 0x2000;
@@ -294,35 +294,35 @@ static VIDEO_START(coolridr)
static SCREEN_UPDATE(coolridr)
{
- coolridr_state *state = screen->machine->driver_data<coolridr_state>();
+ coolridr_state *state = screen->machine().driver_data<coolridr_state>();
/* planes seems to basically be at 0x8000 and 0x28000... */
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
UINT32 count;
int y,x;
- if(input_code_pressed(screen->machine,KEYCODE_Z))
+ if(input_code_pressed(screen->machine(),KEYCODE_Z))
state->test_offs+=4;
- if(input_code_pressed(screen->machine,KEYCODE_X))
+ if(input_code_pressed(screen->machine(),KEYCODE_X))
state->test_offs-=4;
- if(input_code_pressed(screen->machine,KEYCODE_C))
+ if(input_code_pressed(screen->machine(),KEYCODE_C))
state->test_offs+=0x40;
- if(input_code_pressed(screen->machine,KEYCODE_V))
+ if(input_code_pressed(screen->machine(),KEYCODE_V))
state->test_offs-=0x40;
- if(input_code_pressed(screen->machine,KEYCODE_B))
+ if(input_code_pressed(screen->machine(),KEYCODE_B))
state->test_offs+=0x400;
- if(input_code_pressed(screen->machine,KEYCODE_N))
+ if(input_code_pressed(screen->machine(),KEYCODE_N))
state->test_offs-=0x400;
- if(input_code_pressed_once(screen->machine,KEYCODE_A))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_A))
state->color++;
- if(input_code_pressed_once(screen->machine,KEYCODE_S))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_S))
state->color--;
if(state->test_offs > 0x100000*4)
@@ -360,7 +360,7 @@ static SCREEN_UPDATE(coolridr)
/* unknown purpose */
static READ32_HANDLER(sysh1_unk_r)
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
switch(offset)
{
case 0x08/4:
@@ -380,7 +380,7 @@ static READ32_HANDLER(sysh1_unk_r)
static WRITE32_HANDLER(sysh1_unk_w)
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->h1_unk[offset]);
}
@@ -388,7 +388,7 @@ static WRITE32_HANDLER(sysh1_unk_w)
#if 0
static READ32_HANDLER(sysh1_ioga_r)
{
- //return space->machine->rand();//h1_ioga[offset];
+ //return space->machine().rand();//h1_ioga[offset];
return h1_ioga[offset];
}
@@ -429,7 +429,7 @@ CMD = ac90 PARAM = 0001 DATA = 03f40170
/* this looks like an exotic I/O-based tilemap / sprite blitter, very unusual from Sega... */
static WRITE32_HANDLER( sysh1_txt_blit_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->sysh1_txt_blit[offset]);
@@ -464,7 +464,7 @@ static WRITE32_HANDLER( sysh1_txt_blit_w )
{
int x2,y2;
- const gfx_element *gfx = space->machine->gfx[1];
+ const gfx_element *gfx = space->machine().gfx[1];
rectangle clip;
y2 = (state->attr_buff[9] & 0x01ff0000) >> 16;
@@ -505,23 +505,23 @@ static WRITE32_HANDLER( sysh1_txt_blit_w )
static WRITE32_HANDLER( sysh1_pal_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
-
- r = ((space->machine->generic.paletteram.u32[offset] & 0x00007c00) >> 10);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x000003e0) >> 5);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x0000001f) >> 0);
- palette_set_color_rgb(space->machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
- r = ((space->machine->generic.paletteram.u32[offset] & 0x7c000000) >> 26);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x03e00000) >> 21);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x001f0000) >> 16);
- palette_set_color_rgb(space->machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x00007c00) >> 10);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x000003e0) >> 5);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x0000001f) >> 0);
+ palette_set_color_rgb(space->machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x7c000000) >> 26);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x03e00000) >> 21);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x001f0000) >> 16);
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
}
/* FIXME: this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex :/ */
static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
UINT32 src,dst,size,type,s_i;
UINT8 end_dma_mark;
@@ -570,7 +570,7 @@ static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
//size/=2;
if((src & 0xff00000) == 0x3e00000)
return; //FIXME: kludge to avoid palette corruption
- //debugger_break(space->machine);
+ //debugger_break(space->machine());
}
if(type == 0xc || type == 0xd || type == 0xe)
@@ -597,7 +597,7 @@ static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
static WRITE32_HANDLER( sysh1_dma_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->framebuffer_vram[offset]);
if(offset*4 == 0x000)
@@ -609,18 +609,18 @@ static WRITE32_HANDLER( sysh1_dma_w )
static WRITE32_HANDLER( sysh1_char_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->h1_charram[offset]);
{
- UINT8 *gfx = space->machine->region("ram_gfx")->base();
+ UINT8 *gfx = space->machine().region("ram_gfx")->base();
gfx[offset*4+0] = (state->h1_charram[offset] & 0xff000000) >> 24;
gfx[offset*4+1] = (state->h1_charram[offset] & 0x00ff0000) >> 16;
gfx[offset*4+2] = (state->h1_charram[offset] & 0x0000ff00) >> 8;
gfx[offset*4+3] = (state->h1_charram[offset] & 0x000000ff) >> 0;
- gfx_element_mark_dirty(space->machine->gfx[2], offset/64); //*4/256
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/64); //*4/256
}
}
@@ -1166,7 +1166,7 @@ ROM_END
#if 0
static READ32_HANDLER( coolridr_hack1_r )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
offs_t pc = downcast<cpu_device *>(space->cpu)->pc();
if(pc == 0x6012374 || pc == 0x6012392)
return 0;
@@ -1177,7 +1177,7 @@ static READ32_HANDLER( coolridr_hack1_r )
static READ32_HANDLER( coolridr_hack2_r )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
offs_t pc = downcast<cpu_device *>(space->cpu)->pc();
if(pc == 0x6002cba || pc == 0x6002d42)
return 0;
@@ -1187,8 +1187,8 @@ static READ32_HANDLER( coolridr_hack2_r )
static DRIVER_INIT( coolridr )
{
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d8894, 0x060d8897, FUNC(coolridr_hack2_r) );
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d8894, 0x060d8897, FUNC(coolridr_hack2_r) );
}
GAME( 1995, coolridr, 0, coolridr, coolridr, coolridr, ROT0, "Sega", "Cool Riders (US)",GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/cop01.c b/src/mame/drivers/cop01.c
index 55584366989..57e6a200ed7 100644
--- a/src/mame/drivers/cop01.c
+++ b/src/mame/drivers/cop01.c
@@ -68,14 +68,14 @@ Mighty Guy board layout:
static WRITE8_HANDLER( cop01_sound_command_w )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static READ8_HANDLER( cop01_sound_command_r )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
int res = (soundlatch_r(space, offset) & 0x7f) << 1;
/* bit 0 seems to be a timer */
@@ -96,7 +96,7 @@ static READ8_HANDLER( cop01_sound_command_r )
static CUSTOM_INPUT( mightguy_area_r )
{
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, "FAKE") & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(field->port->machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
}
@@ -156,7 +156,7 @@ ADDRESS_MAP_END
/* this just gets some garbage out of the YM3526 */
static READ8_HANDLER( kludge )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
return state->timer++;
}
@@ -414,9 +414,9 @@ GFXDECODE_END
static MACHINE_START( cop01 )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
state->save_item(NAME(state->pulse));
state->save_item(NAME(state->timer));
@@ -425,7 +425,7 @@ static MACHINE_START( cop01 )
static MACHINE_RESET( cop01 )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
state->pulse = 0;
state->timer = 0;
@@ -641,7 +641,7 @@ static DRIVER_INIT( mightguy )
#if MIGHTGUY_HACK
/* This is a hack to fix the game code to get a fully working
"Starting Area" fake Dip Switch */
- UINT8 *RAM = (UINT8 *)machine->region("maincpu")->base();
+ UINT8 *RAM = (UINT8 *)machine.region("maincpu")->base();
RAM[0x00e4] = 0x07; // rlca
RAM[0x00e5] = 0x07; // rlca
RAM[0x00e6] = 0x07; // rlca
diff --git a/src/mame/drivers/copsnrob.c b/src/mame/drivers/copsnrob.c
index 48cdbd88e1d..f7dc0079d8a 100644
--- a/src/mame/drivers/copsnrob.c
+++ b/src/mame/drivers/copsnrob.c
@@ -81,16 +81,16 @@ static PALETTE_INIT( copsnrob )
static READ8_HANDLER( copsnrob_misc_r )
{
- return input_port_read(space->machine, "IN0") & 0x80;
+ return input_port_read(space->machine(), "IN0") & 0x80;
}
static WRITE8_HANDLER( copsnrob_misc2_w )
{
- copsnrob_state *state = space->machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = space->machine().driver_data<copsnrob_state>();
state->misc = data & 0x7f;
/* Multi Player Start */
- set_led_status(space->machine, 1, !((data >> 6) & 0x01));
+ set_led_status(space->machine(), 1, !((data >> 6) & 0x01));
}
@@ -251,7 +251,7 @@ GFXDECODE_END
static MACHINE_START( copsnrob )
{
- copsnrob_state *state = machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = machine.driver_data<copsnrob_state>();
state->save_item(NAME(state->ic_h3_data));
state->save_item(NAME(state->misc));
@@ -259,7 +259,7 @@ static MACHINE_START( copsnrob )
static MACHINE_RESET( copsnrob )
{
- copsnrob_state *state = machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = machine.driver_data<copsnrob_state>();
state->ic_h3_data = 0;
state->misc = 0;
diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c
index 485b8d9c226..5ddd1acc646 100644
--- a/src/mame/drivers/corona.c
+++ b/src/mame/drivers/corona.c
@@ -380,13 +380,13 @@ static WRITE8_HANDLER( blitter_aux_w )
static READ8_HANDLER( blitter_status_r )
{
/* code checks bit 6 and/or bit 7 */
- //return space->machine->rand() & 0xc0;
+ //return space->machine().rand() & 0xc0;
/*
x--- ---- blitter busy
-x-- ---- vblank
*/
- return 0x80 | ((space->machine->primary_screen->vblank() & 1) << 6);
+ return 0x80 | ((space->machine().primary_screen->vblank() & 1) << 6);
}
static void blitter_execute(int x, int y, int color, int width, int flag)
@@ -463,12 +463,12 @@ static SCREEN_UPDATE(luckyrlt)
static WRITE8_HANDLER( sound_latch_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, ASSERT_LINE);
}
static READ8_HANDLER( sound_latch_r )
{
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
return soundlatch_r(space, 0);
}
@@ -491,12 +491,12 @@ static READ8_HANDLER( mux_port_r )
{
switch( input_selector )
{
- case 0x01: return input_port_read(space->machine, "IN0-1");
- case 0x02: return input_port_read(space->machine, "IN0-2");
- case 0x04: return input_port_read(space->machine, "IN0-3");
- case 0x08: return input_port_read(space->machine, "IN0-4");
- case 0x10: return input_port_read(space->machine, "IN0-5");
- case 0x20: return input_port_read(space->machine, "IN0-6");
+ case 0x01: return input_port_read(space->machine(), "IN0-1");
+ case 0x02: return input_port_read(space->machine(), "IN0-2");
+ case 0x04: return input_port_read(space->machine(), "IN0-3");
+ case 0x08: return input_port_read(space->machine(), "IN0-4");
+ case 0x10: return input_port_read(space->machine(), "IN0-5");
+ case 0x20: return input_port_read(space->machine(), "IN0-6");
}
return 0xff;
@@ -515,8 +515,8 @@ static WRITE8_HANDLER( mux_port_w )
*/
input_selector = (data ^ 0xff) & 0x3f; /* Input Selector, */
- coin_counter_w(space->machine, 0, (data ^ 0xff) & 0x40); /* Credits In (mechanical meters) */
- coin_counter_w(space->machine, 1, (data ^ 0xff) & 0x80); /* Credits Out (mechanical meters) */
+ coin_counter_w(space->machine(), 0, (data ^ 0xff) & 0x40); /* Credits In (mechanical meters) */
+ coin_counter_w(space->machine(), 1, (data ^ 0xff) & 0x80); /* Credits Out (mechanical meters) */
// logerror("muxsel: %02x \n", input_selector);
}
@@ -534,9 +534,9 @@ static WRITE8_HANDLER( wc_meters_w )
Data is written inverted.
*/
- coin_counter_w(space->machine, 0, (data ^ 0xff) & 0x01); /* Credits In */
- coin_counter_w(space->machine, 1, (data ^ 0xff) & 0x02); /* Credits In (through Coin 3) */
- coin_counter_w(space->machine, 2, (data ^ 0xff) & 0x04); /* Credits Out */
+ coin_counter_w(space->machine(), 0, (data ^ 0xff) & 0x01); /* Credits In */
+ coin_counter_w(space->machine(), 1, (data ^ 0xff) & 0x02); /* Credits In (through Coin 3) */
+ coin_counter_w(space->machine(), 2, (data ^ 0xff) & 0x04); /* Credits Out */
// popmessage("meters: %02x", (data ^ 0xff));
}
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 3fc698cd07a..ade1987d744 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -39,7 +39,7 @@ a physical DSW B but only read when SWA:3,4 are both set to OFF. Currently,
static WRITE8_HANDLER( panic_sound_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 11)
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( panic_sound_output2_w )
static WRITE8_HANDLER( cosmicg_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 12)
@@ -179,7 +179,7 @@ static WRITE8_HANDLER( cosmicg_output_w )
static WRITE8_HANDLER( cosmica_sound_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 11)
@@ -318,7 +318,7 @@ static INTERRUPT_GEN( panic_interrupt )
/* mostly not noticed since sound is */
/* only enabled if game in progress! */
- if ((input_port_read(device->machine, "SYSTEM") & 0xc0) != 0xc0)
+ if ((input_port_read(device->machine(), "SYSTEM") & 0xc0) != 0xc0)
panic_sound_output_w(device->memory().space(AS_PROGRAM), 17, 1);
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xcf); /* RST 08h */
@@ -329,12 +329,12 @@ static INTERRUPT_GEN( panic_interrupt )
static INTERRUPT_GEN( cosmica_interrupt )
{
- cosmic_state *state = device->machine->driver_data<cosmic_state>();
+ cosmic_state *state = device->machine().driver_data<cosmic_state>();
state->pixel_clock = (state->pixel_clock + 2) & 0x3f;
if (state->pixel_clock == 0)
{
- if (input_port_read(device->machine, "FAKE") & 1) /* Left Coin */
+ if (input_port_read(device->machine(), "FAKE") & 1) /* Left Coin */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -348,7 +348,7 @@ static INTERRUPT_GEN( cosmicg_interrupt )
It makes sense and works fine, but I cannot be 100% sure this is correct,
as I have no Cosmic Guerilla console :-) . */
- if ((input_port_read(device->machine, "IN2") & 1)) /* Coin */
+ if ((input_port_read(device->machine(), "IN2") & 1)) /* Coin */
/* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
device_set_input_line_and_vector(device, 0, ASSERT_LINE, 6);
else
@@ -358,35 +358,35 @@ static INTERRUPT_GEN( cosmicg_interrupt )
static INTERRUPT_GEN( magspot_interrupt )
{
/* Coin 1 causes an IRQ, Coin 2 an NMI */
- if (input_port_read(device->machine, "COINS") & 0x01)
+ if (input_port_read(device->machine(), "COINS") & 0x01)
device_set_input_line(device, 0, HOLD_LINE);
- else if (input_port_read(device->machine, "COINS") & 0x02)
+ else if (input_port_read(device->machine(), "COINS") & 0x02)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static INTERRUPT_GEN( nomnlnd_interrupt )
{
/* Coin causes an NMI */
- if (input_port_read(device->machine, "COIN") & 0x01)
+ if (input_port_read(device->machine(), "COIN") & 0x01)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( cosmica_pixel_clock_r )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
return state->pixel_clock;
}
static READ8_HANDLER( cosmicg_port_0_r )
{
/* The top four address lines from the CRTC are bits 0-3 */
- return (input_port_read(space->machine, "IN0") & 0xf0) | ((space->machine->primary_screen->vpos() & 0xf0) >> 4);
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ((space->machine().primary_screen->vpos() & 0xf0) >> 4);
}
static READ8_HANDLER( magspot_coinage_dip_r )
{
- return (input_port_read_safe(space->machine, "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
+ return (input_port_read_safe(space->machine(), "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
}
@@ -394,8 +394,8 @@ static READ8_HANDLER( magspot_coinage_dip_r )
static READ8_HANDLER( nomnlnd_port_0_1_r )
{
- int control = input_port_read(space->machine, offset ? "IN1" : "IN0");
- int fire = input_port_read(space->machine, "IN3");
+ int control = input_port_read(space->machine(), offset ? "IN1" : "IN0");
+ int fire = input_port_read(space->machine(), "IN3");
/* If firing - stop tank */
if ((fire & 0xc0) == 0) return 0xff;
@@ -413,7 +413,7 @@ static READ8_HANDLER( nomnlnd_port_0_1_r )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
@@ -1012,10 +1012,10 @@ static const samples_interface cosmicg_samples_interface =
static MACHINE_START( cosmic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
- state->samples = machine->device("samples");
- state->dac = machine->device("dac");
+ state->samples = machine.device("samples");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->sound_enabled));
state->save_item(NAME(state->march_select));
@@ -1029,7 +1029,7 @@ static MACHINE_START( cosmic )
static MACHINE_RESET( cosmic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->pixel_clock = 0;
state->background_enable = 0;
@@ -1563,11 +1563,11 @@ ROM_END
static DRIVER_INIT( cosmicg )
{
/* Program ROMs have data pins connected different from normal */
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs, len;
UINT8 *rom;
- len = machine->region("maincpu")->bytes();
- rom = machine->region("maincpu")->base();
+ len = machine.region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
for (offs = 0; offs < len; offs++)
{
UINT8 scrambled = rom[offs];
@@ -1588,7 +1588,7 @@ static DRIVER_INIT( cosmicg )
static DRIVER_INIT( cosmica )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->sound_enabled = 1;
state->dive_bomb_b_select = 0;
}
@@ -1596,22 +1596,22 @@ static DRIVER_INIT( cosmica )
static DRIVER_INIT( devzone )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
}
static DRIVER_INIT( nomnlnd )
{
- device_t *dac = machine->device("dac");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5000, 0x5001, FUNC(nomnlnd_port_0_1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x4800, 0x4800);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x480a, 0x480a, FUNC(dac_w));
+ device_t *dac = machine.device("dac");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5000, 0x5001, FUNC(nomnlnd_port_0_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x4800, 0x4800);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x480a, 0x480a, FUNC(dac_w));
}
static DRIVER_INIT( panic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->sound_enabled = 1;
}
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 95fd98c71a2..f63d7246aaf 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -247,45 +247,45 @@ Stephh's log (2006.09.20) :
READ16_HANDLER( cps1_dsw_r )
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(space->machine, dswname[offset]);
+ int in = input_port_read(space->machine(), dswname[offset]);
return (in << 8) | 0xff;
}
static READ16_HANDLER( cps1_hack_dsw_r )
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(space->machine, dswname[offset]);
+ int in = input_port_read(space->machine(), dswname[offset]);
return (in << 8) | in;
}
static READ16_HANDLER( forgottn_dial_0_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- return ((input_port_read(space->machine, "DIAL0") - state->dial[0]) >> (8 * offset)) & 0xff;
+ cps_state *state = space->machine().driver_data<cps_state>();
+ return ((input_port_read(space->machine(), "DIAL0") - state->dial[0]) >> (8 * offset)) & 0xff;
}
static READ16_HANDLER( forgottn_dial_1_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- return ((input_port_read(space->machine, "DIAL1") - state->dial[1]) >> (8 * offset)) & 0xff;
+ cps_state *state = space->machine().driver_data<cps_state>();
+ return ((input_port_read(space->machine(), "DIAL1") - state->dial[1]) >> (8 * offset)) & 0xff;
}
static WRITE16_HANDLER( forgottn_dial_0_reset_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- state->dial[0] = input_port_read(space->machine, "DIAL0");
+ cps_state *state = space->machine().driver_data<cps_state>();
+ state->dial[0] = input_port_read(space->machine(), "DIAL0");
}
static WRITE16_HANDLER( forgottn_dial_1_reset_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- state->dial[1] = input_port_read(space->machine, "DIAL1");
+ cps_state *state = space->machine().driver_data<cps_state>();
+ state->dial[1] = input_port_read(space->machine(), "DIAL1");
}
static WRITE8_HANDLER( cps1_snd_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_DEVICE_HANDLER( cps1_oki_pin7_w )
@@ -309,10 +309,10 @@ WRITE16_HANDLER( cps1_coinctrl_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, ~data & 0x0400);
- coin_lockout_w(space->machine, 1, ~data & 0x0800);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, ~data & 0x0400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x0800);
// bit 15 = CPS-A custom reset?
}
@@ -322,10 +322,10 @@ static WRITE16_HANDLER( cpsq_coinctrl2_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 2, data & 0x01);
- coin_lockout_w(space->machine, 2, ~data & 0x02);
- coin_counter_w(space->machine, 3, data & 0x04);
- coin_lockout_w(space->machine, 3, ~data & 0x08);
+ coin_counter_w(space->machine(), 2, data & 0x01);
+ coin_lockout_w(space->machine(), 2, ~data & 0x02);
+ coin_counter_w(space->machine(), 3, data & 0x04);
+ coin_lockout_w(space->machine(), 3, ~data & 0x08);
}
}
@@ -352,7 +352,7 @@ static INTERRUPT_GEN( cps1_qsound_interrupt )
static READ16_HANDLER( qsound_rom_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
if (rom)
return rom[offset] | 0xff00;
@@ -365,13 +365,13 @@ static READ16_HANDLER( qsound_rom_r )
READ16_HANDLER( qsound_sharedram1_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->qsound_sharedram1[offset] | 0xff00;
}
WRITE16_HANDLER( qsound_sharedram1_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
state->qsound_sharedram1[offset] = data;
@@ -379,13 +379,13 @@ WRITE16_HANDLER( qsound_sharedram1_w )
static READ16_HANDLER( qsound_sharedram2_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->qsound_sharedram2[offset] | 0xff00;
}
static WRITE16_HANDLER( qsound_sharedram2_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
state->qsound_sharedram2[offset] = data;
@@ -395,13 +395,13 @@ static WRITE8_HANDLER( qsound_banksw_w )
{
/* Z80 bank register for music note data. It's odd that it isn't encrypted though. */
int bank = data & 0x0f;
- if ((0x10000 + (bank * 0x4000)) >= space->machine->region("audiocpu")->bytes())
+ if ((0x10000 + (bank * 0x4000)) >= space->machine().region("audiocpu")->bytes())
{
logerror("WARNING: Q sound bank overflow (%02x)\n", data);
bank = 0;
}
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
@@ -2922,7 +2922,7 @@ GFXDECODE_END
static void cps1_irq_handler_mus(device_t *device, int irq)
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2944,22 +2944,22 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( common )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_START( cps1 )
{
MACHINE_START_CALL(common);
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_START( qsound )
{
MACHINE_START_CALL(common);
- memory_configure_bank(machine, "bank1", 0, 6, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 6, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( cps1_10MHz, cps_state )
@@ -9961,14 +9961,14 @@ ROM_END
static DRIVER_INIT( forgottn )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
/* Forgotten Worlds has a NEC uPD4701AC on the B-board handling dial inputs from the CN-MOWS connector. */
/* The memory mapping is handled by PAL LWIO */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800040, 0x800041, FUNC(forgottn_dial_0_reset_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800048, 0x800049, FUNC(forgottn_dial_1_reset_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800052, 0x800055, FUNC(forgottn_dial_0_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80005a, 0x80005d, FUNC(forgottn_dial_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800040, 0x800041, FUNC(forgottn_dial_0_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800048, 0x800049, FUNC(forgottn_dial_1_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800052, 0x800055, FUNC(forgottn_dial_0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80005a, 0x80005d, FUNC(forgottn_dial_1_r));
state->save_item(NAME(state->dial));
@@ -9982,8 +9982,8 @@ static DRIVER_INIT( sf2ee )
{
/* This specific revision of SF2 has the CPS-B custom mapped at a different address. */
/* The mapping is handled by the PAL IOB2 on the B-board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x800140, 0x80017f);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x800140, 0x80017f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
DRIVER_INIT_CALL(cps1);
}
@@ -9991,7 +9991,7 @@ static DRIVER_INIT( sf2ee )
static DRIVER_INIT( sf2thndr )
{
/* This particular hack uses a modified B-board PAL which mirrors the CPS-B registers at an alternate address */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
DRIVER_INIT_CALL(cps1);
}
@@ -9999,7 +9999,7 @@ static DRIVER_INIT( sf2thndr )
static DRIVER_INIT( sf2hack )
{
/* some SF2 hacks have some inputs wired to the LSB instead of MSB */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800018, 0x80001f, FUNC(cps1_hack_dsw_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800018, 0x80001f, FUNC(cps1_hack_dsw_r));
DRIVER_INIT_CALL(cps1);
}
@@ -10032,14 +10032,14 @@ static DRIVER_INIT( pang3n )
{
/* Pang 3 is the only non-QSound game to have an EEPROM. */
/* It is mapped in the CPS-B address range so probably is on the C-board. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_port(0x80017a, 0x80017b, "EEPROMIN", "EEPROMOUT");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_port(0x80017a, 0x80017b, "EEPROMIN", "EEPROMOUT");
DRIVER_INIT_CALL(cps1);
}
static DRIVER_INIT( pang3 )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
int A, src, dst;
for (A = 0x80000; A < 0x100000; A += 2)
@@ -10070,8 +10070,8 @@ static READ16_HANDLER( sf2mdt_r )
static DRIVER_INIT( sf2mdt )
{
int i;
- UINT32 gfx_size = machine->region( "gfx" )->bytes();
- UINT8 *rom = machine->region( "gfx" )->base();
+ UINT32 gfx_size = machine.region( "gfx" )->bytes();
+ UINT8 *rom = machine.region( "gfx" )->base();
UINT8 tmp;
for( i = 0; i < gfx_size; i += 8 )
@@ -10083,11 +10083,11 @@ static DRIVER_INIT( sf2mdt )
rom[i + 3] = rom[i + 6];
rom[i + 6] = tmp;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01a, 0x70c01b, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01c, 0x70c01d, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01e, 0x70c01f, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c010, 0x70c011, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c018, 0x70c019, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01a, 0x70c01b, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01c, 0x70c01d, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01e, 0x70c01f, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c010, 0x70c011, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c018, 0x70c019, FUNC(sf2mdt_r));
DRIVER_INIT_CALL(cps1);
}
@@ -10095,7 +10095,7 @@ static DRIVER_INIT( sf2mdt )
static DRIVER_INIT( dinohunt )
{
// is this shared with the new sound hw?
- UINT8* ram = (UINT8*)machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xf18000, 0xf19fff);
+ UINT8* ram = (UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xf18000, 0xf19fff);
memset(ram,0xff,0x2000);
DRIVER_INIT_CALL(cps1);
}
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index b5a08555481..b03851712ca 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -624,7 +624,7 @@ Stephh's inputs notes (based on some tests on the "parent" set) :
static INTERRUPT_GEN( cps2_interrupt )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
/* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
if (state->scancount >= 258)
@@ -647,8 +647,8 @@ static INTERRUPT_GEN( cps2_interrupt )
{
state->cps_b_regs[0x10/2] = 0;
device_set_input_line(device, 4, HOLD_LINE);
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
state->scancalls++;
// popmessage("IRQ4 scancounter = %04i", state->scancount);
}
@@ -658,8 +658,8 @@ static INTERRUPT_GEN( cps2_interrupt )
{
state->cps_b_regs[0x12 / 2] = 0;
device_set_input_line(device, 4, HOLD_LINE);
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
state->scancalls++;
// popmessage("IRQ4 scancounter = %04i",scancount);
}
@@ -671,10 +671,10 @@ static INTERRUPT_GEN( cps2_interrupt )
device_set_input_line(device, 2, HOLD_LINE);
if(state->scancalls)
{
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(256);
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(256);
}
- cps2_objram_latch(device->machine);
+ cps2_objram_latch(device->machine());
}
//popmessage("Raster calls = %i", state->scancalls);
}
@@ -697,7 +697,7 @@ static const eeprom_interface cps2_eeprom_interface =
static WRITE16_HANDLER( cps2_eeprom_port_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_8_15)
{
@@ -711,7 +711,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
/* bit 7 - */
/* EEPROM */
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
if (ACCESSING_BITS_0_7)
@@ -729,37 +729,37 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
if (state->audiocpu != NULL)
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
- coin_counter_w(space->machine, 0, data & 0x0001);
- if ((strncmp(space->machine->system().name, "pzloop2", 8) == 0) ||
- (strncmp(space->machine->system().name, "pzloop2j", 8) == 0))
+ coin_counter_w(space->machine(), 0, data & 0x0001);
+ if ((strncmp(space->machine().system().name, "pzloop2", 8) == 0) ||
+ (strncmp(space->machine().system().name, "pzloop2j", 8) == 0))
{
// Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls
state->readpaddle = data & 0x0002;
}
else
{
- coin_counter_w(space->machine, 1, data & 0x0002);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
}
- if (strncmp(space->machine->system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
+ if (strncmp(space->machine().system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
{
- coin_lockout_w(space->machine, 0, data & 0x0010);
- coin_lockout_w(space->machine, 1, data & 0x0020);
- coin_lockout_w(space->machine, 2, data & 0x0040);
- coin_lockout_w(space->machine, 3, data & 0x0080);
+ coin_lockout_w(space->machine(), 0, data & 0x0010);
+ coin_lockout_w(space->machine(), 1, data & 0x0020);
+ coin_lockout_w(space->machine(), 2, data & 0x0040);
+ coin_lockout_w(space->machine(), 3, data & 0x0080);
}
else
{
- coin_lockout_w(space->machine, 0, ~data & 0x0010);
- coin_lockout_w(space->machine, 1, ~data & 0x0020);
- coin_lockout_w(space->machine, 2, ~data & 0x0040);
- coin_lockout_w(space->machine, 3, ~data & 0x0080);
+ coin_lockout_w(space->machine(), 0, ~data & 0x0010);
+ coin_lockout_w(space->machine(), 1, ~data & 0x0020);
+ coin_lockout_w(space->machine(), 2, ~data & 0x0040);
+ coin_lockout_w(space->machine(), 3, ~data & 0x0080);
}
/*
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x10);
- set_led_status(space->machine, 2, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x10);
+ set_led_status(space->machine(), 2, data & 0x20);
*/
}
}
@@ -773,7 +773,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
static READ16_HANDLER( cps2_qsound_volume_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
/* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */
/* Network adapter (ssf2tb) present when bit 15 = 0 */
@@ -799,12 +799,12 @@ static READ16_HANDLER( kludge_r )
static READ16_HANDLER( joy_or_paddle_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->readpaddle != 0)
- return (input_port_read(space->machine, "IN0"));
+ return (input_port_read(space->machine(), "IN0"));
else
- return (input_port_read(space->machine, "PADDLE1") & 0xff) | (input_port_read(space->machine, "PADDLE2") << 8);
+ return (input_port_read(space->machine(), "PADDLE1") & 0xff) | (input_port_read(space->machine(), "PADDLE2") << 8);
}
@@ -1201,15 +1201,15 @@ GFXDECODE_END
static MACHINE_START( cps2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->scancount));
if (state->audiocpu != NULL) // gigamn2 has no audiocpu
- memory_configure_bank(machine, "bank1", 0, (QSOUND_SIZE - 0x10000) / 0x4000, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, (QSOUND_SIZE - 0x10000) / 0x4000, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
@@ -7974,7 +7974,7 @@ ROM_END
static DRIVER_INIT( cps2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
/* Decrypt the game - see machine/cps2crpt.c */
DRIVER_INIT_CALL(cps2crpt);
@@ -7985,12 +7985,12 @@ static DRIVER_INIT( cps2 )
state->scancount = 0;
state->cps2networkpresent = 0;
- machine->device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
+ machine.device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
}
static DRIVER_INIT( ssf2tb )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
DRIVER_INIT_CALL(cps2);
@@ -8004,7 +8004,7 @@ static DRIVER_INIT( ssf2tb )
static DRIVER_INIT ( pzloop2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
DRIVER_INIT_CALL(cps2);
@@ -8012,36 +8012,36 @@ static DRIVER_INIT ( pzloop2 )
state->save_item(NAME(state->readpaddle));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x804000, 0x804001, FUNC(joy_or_paddle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x804000, 0x804001, FUNC(joy_or_paddle_r));
}
static READ16_HANDLER( gigamn2_dummyqsound_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->gigamn2_dummyqsound_ram[offset];
};
static WRITE16_HANDLER( gigamn2_dummyqsound_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->gigamn2_dummyqsound_ram[offset] = data;
};
static DRIVER_INIT( gigamn2 )
{
- cps_state *state = machine->driver_data<cps_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ cps_state *state = machine.driver_data<cps_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
DRIVER_INIT_CALL(cps2);
state->gigamn2_dummyqsound_ram = auto_alloc_array(machine, UINT16, 0x20000 / 2);
state->save_pointer(NAME(state->gigamn2_dummyqsound_ram), 0x20000 / 2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigamn2_dummyqsound_r), FUNC(gigamn2_dummyqsound_w)); // no qsound..
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigamn2_dummyqsound_r), FUNC(gigamn2_dummyqsound_w)); // no qsound..
space->set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
- m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length);
+ m68k_set_encrypted_opcode_range(machine.device("maincpu"), 0, length);
}
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index eb1a5a97a94..f599336c5a5 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -345,14 +345,14 @@ Notes:
#define CPS3_TRANSPARENCY_PEN_INDEX 2
#define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
-static void copy_from_nvram(running_machine *machine);
+static void copy_from_nvram(running_machine &machine);
INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
int transparency,int transparent_color,
int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
{
- cps3_state *state = gfx->machine->driver_data<cps3_state>();
+ cps3_state *state = gfx->machine().driver_data<cps3_state>();
rectangle myclip;
// UINT8 al;
@@ -549,7 +549,7 @@ INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_
if (c&0x02) dest[x] |= 0x4000;
if (c&0x04) dest[x] |= 0x8000;
if (c&0x08) dest[x] |= 0x10000;
- if (c&0xf0) dest[x] |= gfx->machine->rand(); // ?? not used?
+ if (c&0xf0) dest[x] |= gfx->machine().rand(); // ?? not used?
}
else
{
@@ -616,13 +616,13 @@ static UINT32 cps3_mask(UINT32 address, UINT32 key1, UINT32 key2)
return val | (val << 16);
}
-static void cps3_decrypt_bios(running_machine *machine)
+static void cps3_decrypt_bios(running_machine &machine)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int i;
- UINT32 *coderegion = (UINT32*)machine->region("user1")->base();
+ UINT32 *coderegion = (UINT32*)machine.region("user1")->base();
- state->decrypted_bios = (UINT32*)machine->region("user1")->base();
+ state->decrypted_bios = (UINT32*)machine.region("user1")->base();
for (i=0;i<0x80000;i+=4)
{
@@ -634,7 +634,7 @@ static void cps3_decrypt_bios(running_machine *machine)
/* Dump to file */
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);
@@ -649,23 +649,23 @@ static void cps3_decrypt_bios(running_machine *machine)
}
-static void init_common(running_machine *machine, UINT32 key1, UINT32 key2, int altEncryption)
+static void init_common(running_machine &machine, UINT32 key1, UINT32 key2, int altEncryption)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->key1 = key1;
state->key2 = key2;
state->altEncryption = altEncryption;
// cache pointers to regions
- state->user4region = machine->region("user4")->base();
- state->user5region = machine->region("user5")->base();
+ state->user4region = machine.region("user4")->base();
+ state->user5region = machine.region("user5")->base();
if (!state->user4region) state->user4region = auto_alloc_array(machine, UINT8, USER4REGION_LENGTH);
if (!state->user5region) state->user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH);
// set strict verify
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_STRICT_VERIFY);
cps3_decrypt_bios(machine);
state->decrypted_gamerom = auto_alloc_array(machine, UINT32, 0x1000000/4);
@@ -678,17 +678,17 @@ static void init_common(running_machine *machine, UINT32 key1, UINT32 key2, int
state->_0xc0000000_ram_decrypted = auto_alloc_array(machine, UINT32, 0x400/4);
- address_space *main = machine->device<sh2_device>("maincpu")->space(AS_PROGRAM);
- main->set_direct_update_handler(direct_update_delegate_create_static(cps3_direct_handler, *machine));
+ address_space *main = machine.device<sh2_device>("maincpu")->space(AS_PROGRAM);
+ main->set_direct_update_handler(direct_update_delegate_create_static(cps3_direct_handler, machine));
// flash roms
astring tempstr;
for (int simmnum = 0; simmnum < 7; simmnum++)
for (int chipnum = 0; chipnum < 8; chipnum++)
- state->simm[simmnum][chipnum] = machine->device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum));
+ state->simm[simmnum][chipnum] = machine.device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum));
state->eeprom = auto_alloc_array(machine, UINT32, 0x400/4);
- machine->device<nvram_device>("eeprom")->set_base(state->eeprom, 0x400);
+ machine.device<nvram_device>("eeprom")->set_base(state->eeprom, 0x400);
}
static DRIVER_INIT( jojo ) { init_common(machine, 0x02203ee3, 0x01301972, 0); }
@@ -729,9 +729,9 @@ static const gfx_layout cps3_tiles8x8_layout =
};
-static void cps3_set_mame_colours(running_machine *machine, int colournum, UINT16 data, UINT32 fadeval)
+static void cps3_set_mame_colours(running_machine &machine, int colournum, UINT16 data, UINT32 fadeval)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int r,g,b;
UINT16* dst = (UINT16*)state->colourram;
@@ -771,7 +771,7 @@ static void cps3_set_mame_colours(running_machine *machine, int colournum, UINT1
static VIDEO_START(cps3)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->ss_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
memset(state->ss_ram, 0x00, 0x10000);
state_save_register_global_pointer(machine, state->ss_ram, 0x10000/4);
@@ -781,13 +781,13 @@ static VIDEO_START(cps3)
state_save_register_global_pointer(machine, state->char_ram, 0x800000 /4);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[0] = gfx_element_alloc(machine, &cps3_tiles8x8_layout, (UINT8 *)state->ss_ram, machine->total_colors() / 16, 0);
+ machine.gfx[0] = gfx_element_alloc(machine, &cps3_tiles8x8_layout, (UINT8 *)state->ss_ram, machine.total_colors() / 16, 0);
//decode_ssram();
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[1] = gfx_element_alloc(machine, &cps3_tiles16x16_layout, (UINT8 *)state->char_ram, machine->total_colors() / 64, 0);
- machine->gfx[1]->color_granularity = 64;
+ machine.gfx[1] = gfx_element_alloc(machine, &cps3_tiles16x16_layout, (UINT8 *)state->char_ram, machine.total_colors() / 64, 0);
+ machine.gfx[1]->color_granularity = 64;
//decode_charram();
@@ -798,7 +798,7 @@ static VIDEO_START(cps3)
// the renderbuffer can be twice the size of the screen, this allows us to handle framebuffer zoom values
// between 0x00 and 0x80 (0x40 is normal, 0x80 would be 'view twice as much', 0x20 is 'view half as much')
- state->renderbuffer_bitmap = auto_bitmap_alloc(machine,512*2,224*2,machine->primary_screen->format());
+ state->renderbuffer_bitmap = auto_bitmap_alloc(machine,512*2,224*2,machine.primary_screen->format());
state->renderbuffer_clip.min_x = 0;
state->renderbuffer_clip.max_x = state->screenwidth-1;
@@ -811,9 +811,9 @@ static VIDEO_START(cps3)
// the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped)
-static void cps3_draw_tilemapsprite_line(running_machine *machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
+static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT32* tmapregs[4] = { state->tilemap20_regs_base, state->tilemap30_regs_base, state->tilemap40_regs_base, state->tilemap50_regs_base };
UINT32* regs;
int line;
@@ -886,17 +886,17 @@ static void cps3_draw_tilemapsprite_line(running_machine *machine, int tmnum, in
yflip = (dat & 0x00000800)>>11;
xflip = (dat & 0x00001000)>>12;
- if (!bpp) machine->gfx[1]->color_granularity=256;
- else machine->gfx[1]->color_granularity=64;
+ if (!bpp) machine.gfx[1]->color_granularity=256;
+ else machine.gfx[1]->color_granularity=64;
- cps3_drawgfxzoom(bitmap,&clip,machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
+ cps3_drawgfxzoom(bitmap,&clip,machine.gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
}
}
}
static SCREEN_UPDATE(cps3)
{
- cps3_state *state = screen->machine->driver_data<cps3_state>();
+ cps3_state *state = screen->machine().driver_data<cps3_state>();
int y,x, count;
attoseconds_t period = screen->frame_period().attoseconds;
rectangle visarea = screen->visible_area();
@@ -1046,7 +1046,7 @@ static SCREEN_UPDATE(cps3)
{
for (uu=0;uu<1023;uu++)
{
- cps3_draw_tilemapsprite_line(screen->machine, tilemapnum, uu, state->renderbuffer_bitmap, &state->renderbuffer_clip );
+ cps3_draw_tilemapsprite_line(screen->machine(), tilemapnum, uu, state->renderbuffer_bitmap, &state->renderbuffer_clip );
}
}
bg_drawn[tilemapnum] = 1;
@@ -1104,7 +1104,7 @@ static SCREEN_UPDATE(cps3)
if (current_ypos&0x200) current_ypos-=0x400;
- //if ( (whichbpp) && (machine->primary_screen->frame_number() & 1)) continue;
+ //if ( (whichbpp) && (machine.primary_screen->frame_number() & 1)) continue;
/* use the palette value from the main list or the sublists? */
if (whichpal)
@@ -1119,13 +1119,13 @@ static SCREEN_UPDATE(cps3)
/* use the bpp value from the main list or the sublists? */
if (whichbpp)
{
- if (!global_bpp) screen->machine->gfx[1]->color_granularity=256;
- else screen->machine->gfx[1]->color_granularity=64;
+ if (!global_bpp) screen->machine().gfx[1]->color_granularity=256;
+ else screen->machine().gfx[1]->color_granularity=64;
}
else
{
- if (!bpp) screen->machine->gfx[1]->color_granularity=256;
- else screen->machine->gfx[1]->color_granularity=64;
+ if (!bpp) screen->machine().gfx[1]->color_granularity=256;
+ else screen->machine().gfx[1]->color_granularity=64;
}
{
@@ -1133,11 +1133,11 @@ static SCREEN_UPDATE(cps3)
if (global_alpha || alpha)
{
- cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
+ cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
}
else
{
- cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
+ cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
}
count++;
}
@@ -1203,7 +1203,7 @@ static SCREEN_UPDATE(cps3)
pal += state->ss_pal_base << 5;
tile+=0x200;
- cps3_drawgfxzoom(bitmap, cliprect, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
+ cps3_drawgfxzoom(bitmap, cliprect, screen->machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
count++;
}
}
@@ -1213,7 +1213,7 @@ static SCREEN_UPDATE(cps3)
static READ32_HANDLER( cps3_ssram_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset>0x8000/4)
return LITTLE_ENDIANIZE_INT32(state->ss_ram[offset]);
else
@@ -1222,13 +1222,13 @@ static READ32_HANDLER( cps3_ssram_r )
static WRITE32_HANDLER( cps3_ssram_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset>0x8000/4)
{
// we only want to endian-flip the character data, the tilemap info is fine
data = LITTLE_ENDIANIZE_INT32(data);
mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
- gfx_element_mark_dirty(space->machine->gfx[0], offset/16);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/16);
}
COMBINE_DATA(&state->ss_ram[offset]);
@@ -1236,7 +1236,7 @@ static WRITE32_HANDLER( cps3_ssram_w )
static WRITE32_HANDLER( cps3_0xc0000000_ram_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
COMBINE_DATA( &state->_0xc0000000_ram[offset] );
// store a decrypted copy
state->_0xc0000000_ram_decrypted[offset] = state->_0xc0000000_ram[offset]^cps3_mask(offset*4+0xc0000000, state->key1, state->key2);
@@ -1252,7 +1252,7 @@ DIRECT_UPDATE_HANDLER( cps3_direct_handler )
/* BIOS ROM */
if (address < 0x80000)
{
- direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().m_machine.region("user1"));
+ direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().machine().region("user1"));
return ~0;
}
/* RAM */
@@ -1282,7 +1282,7 @@ DIRECT_UPDATE_HANDLER( cps3_direct_handler )
static WRITE32_HANDLER( cram_bank_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (ACCESSING_BITS_0_7)
{
// this seems to be related to accesses to the 0x04100000 region
@@ -1312,7 +1312,7 @@ static WRITE32_HANDLER( cram_bank_w )
static READ32_HANDLER( cram_data_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 fulloffset = (((state->cram_bank&0x7)*0x100000)/4) + offset;
return LITTLE_ENDIANIZE_INT32(state->char_ram[fulloffset]);
@@ -1320,19 +1320,19 @@ static READ32_HANDLER( cram_data_r )
static WRITE32_HANDLER( cram_data_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 fulloffset = (((state->cram_bank&0x7)*0x100000)/4) + offset;
mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
data = LITTLE_ENDIANIZE_INT32(data);
COMBINE_DATA(&state->char_ram[fulloffset]);
- gfx_element_mark_dirty(space->machine->gfx[1], fulloffset/0x40);
+ gfx_element_mark_dirty(space->machine().gfx[1], fulloffset/0x40);
}
/* FLASH ROM ACCESS */
static READ32_HANDLER( cps3_gfxflash_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 result = 0;
if (state->cram_gfxflash_bank&1) offset += 0x200000/4;
@@ -1371,7 +1371,7 @@ static READ32_HANDLER( cps3_gfxflash_r )
static WRITE32_HANDLER( cps3_gfxflash_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int command;
if (state->cram_gfxflash_bank&1) offset += 0x200000/4;
@@ -1430,7 +1430,7 @@ static WRITE32_HANDLER( cps3_gfxflash_w )
static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, UINT32 mem_mask)
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 result = 0;
if (state->simm[which][0] == NULL || state->simm[which][1] == NULL || state->simm[which][2] == NULL || state->simm[which][3] == NULL)
@@ -1466,7 +1466,7 @@ static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, U
static READ32_HANDLER( cps3_flash1_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 retvalue = cps3_flashmain_r(space, 0, offset,mem_mask);
if (state->altEncryption) return retvalue;
@@ -1477,7 +1477,7 @@ static READ32_HANDLER( cps3_flash1_r )
static READ32_HANDLER( cps3_flash2_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 retvalue = cps3_flashmain_r(space, 1, offset,mem_mask);
if (state->altEncryption) return retvalue;
@@ -1486,9 +1486,9 @@ static READ32_HANDLER( cps3_flash2_r )
return retvalue;
}
-static void cps3_flashmain_w(running_machine *machine, int which, UINT32 offset, UINT32 data, UINT32 mem_mask)
+static void cps3_flashmain_w(running_machine &machine, int which, UINT32 offset, UINT32 data, UINT32 mem_mask)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int command;
if (state->simm[which][0] == NULL || state->simm[which][1] == NULL || state->simm[which][2] == NULL || state->simm[which][3] == NULL)
@@ -1549,17 +1549,17 @@ static void cps3_flashmain_w(running_machine *machine, int which, UINT32 offset,
static WRITE32_HANDLER( cps3_flash1_w )
{
- cps3_flashmain_w(space->machine,0,offset,data,mem_mask);
+ cps3_flashmain_w(space->machine(),0,offset,data,mem_mask);
}
static WRITE32_HANDLER( cps3_flash2_w )
{
- cps3_flashmain_w(space->machine,1,offset,data,mem_mask);
+ cps3_flashmain_w(space->machine(),1,offset,data,mem_mask);
}
static WRITE32_HANDLER( cram_gfxflash_bank_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (ACCESSING_BITS_24_31)
{
//printf("cram_gfxflash_bank_w MSB32 %08x\n",data);
@@ -1640,7 +1640,7 @@ static READ32_HANDLER( cps3_40C0004_r )
static READ32_HANDLER( cps3_eeprom_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int addr = offset*4;
if (addr>=0x100 && addr<=0x17f)
@@ -1670,7 +1670,7 @@ static READ32_HANDLER( cps3_eeprom_r )
static WRITE32_HANDLER( cps3_eeprom_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int addr = offset*4;
if (addr>=0x080 && addr<=0x0ff)
@@ -1723,7 +1723,7 @@ static WRITE32_HANDLER( cps3_cdrom_w )
static WRITE32_HANDLER( cps3_ss_bank_base_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
// might be scroll registers or something else..
// used to display bank with 'insert coin' on during sfiii2 attract intro
COMBINE_DATA(&state->ss_bank_base);
@@ -1733,7 +1733,7 @@ static WRITE32_HANDLER( cps3_ss_bank_base_w )
static WRITE32_HANDLER( cps3_ss_pal_base_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if(DEBUG_PRINTF) printf ("cps3_ss_pal_base_w %08x %08x\n", data, mem_mask);
if(ACCESSING_BITS_24_31)
@@ -1754,7 +1754,7 @@ static WRITE32_HANDLER( cps3_ss_pal_base_w )
static WRITE32_HANDLER( cps3_palettedma_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset==0)
{
COMBINE_DATA(&state->paldma_source);
@@ -1790,11 +1790,11 @@ static WRITE32_HANDLER( cps3_palettedma_w )
//if (state->paldma_fade!=0) printf("%08x\n",state->paldma_fade);
- cps3_set_mame_colours(space->machine, (state->paldma_dest+i)^1, coldata, state->paldma_fade);
+ cps3_set_mame_colours(space->machine(), (state->paldma_dest+i)^1, coldata, state->paldma_fade);
}
- cputag_set_input_line(space->machine, "maincpu", 10, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 10, ASSERT_LINE);
}
@@ -1809,9 +1809,9 @@ static WRITE32_HANDLER( cps3_palettedma_w )
-static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 destination, int max_length )
+static UINT32 process_byte( running_machine &machine, UINT8 real_byte, UINT32 destination, int max_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* dest = (UINT8*)state->char_ram;
//printf("process byte for destination %08x\n", destination);
@@ -1830,7 +1830,7 @@ static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 de
while (state->rle_length)
{
dest[((destination+tranfercount)&0x7fffff)^3] = (state->last_normal_byte&0x3f);
- gfx_element_mark_dirty(machine->gfx[1], ((destination+tranfercount)&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], ((destination+tranfercount)&0x7fffff)/0x100);
//printf("RLE WRite Byte %08x, %02x\n", destination+tranfercount, real_byte);
tranfercount++;
@@ -1849,14 +1849,14 @@ static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 de
//printf("Write Normal Data\n");
dest[(destination&0x7fffff)^3] = real_byte;
state->last_normal_byte = real_byte;
- gfx_element_mark_dirty(machine->gfx[1], (destination&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (destination&0x7fffff)/0x100);
return 1;
}
}
-static void cps3_do_char_dma( running_machine *machine, UINT32 real_source, UINT32 real_destination, UINT32 real_length )
+static void cps3_do_char_dma( running_machine &machine, UINT32 real_source, UINT32 real_destination, UINT32 real_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* sourcedata = (UINT8*)state->user5region;
int length_remaining;
@@ -1906,9 +1906,9 @@ static void cps3_do_char_dma( running_machine *machine, UINT32 real_source, UINT
}
}
-static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
+static UINT32 ProcessByte8(running_machine &machine,UINT8 b,UINT32 dst_offset)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* destRAM = (UINT8*)state->char_ram;
int l=0;
@@ -1920,7 +1920,7 @@ static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
for(i=0;i<rle;++i)
{
destRAM[(dst_offset&0x7fffff)^3] = state->lastb;
- gfx_element_mark_dirty(machine->gfx[1], (dst_offset&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (dst_offset&0x7fffff)/0x100);
dst_offset++;
++l;
@@ -1934,14 +1934,14 @@ static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
state->lastb2=state->lastb;
state->lastb=b;
destRAM[(dst_offset&0x7fffff)^3] = b;
- gfx_element_mark_dirty(machine->gfx[1], (dst_offset&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (dst_offset&0x7fffff)/0x100);
return 1;
}
}
-static void cps3_do_alt_char_dma( running_machine *machine, UINT32 src, UINT32 real_dest, UINT32 real_length )
+static void cps3_do_alt_char_dma( running_machine &machine, UINT32 src, UINT32 real_dest, UINT32 real_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* px = (UINT8*)state->user5region;
UINT32 start = real_dest;
UINT32 ds = real_dest;
@@ -1981,9 +1981,9 @@ static void cps3_do_alt_char_dma( running_machine *machine, UINT32 src, UINT32 r
}
}
-static void cps3_process_character_dma(running_machine *machine, UINT32 address)
+static void cps3_process_character_dma(running_machine &machine, UINT32 address)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int i;
//printf("charDMA start:\n");
@@ -2036,7 +2036,7 @@ static void cps3_process_character_dma(running_machine *machine, UINT32 address)
static WRITE32_HANDLER( cps3_characterdma_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if(DEBUG_PRINTF) printf("chardma_w %08x %08x %08x\n", offset, data, mem_mask);
if (offset==0)
@@ -2063,7 +2063,7 @@ static WRITE32_HANDLER( cps3_characterdma_w )
list_address = (state->chardma_source | ((state->chardma_other&0x003f0000)));
//printf("chardma_w activated %08x %08x (address = cram %08x)\n", state->chardma_source, state->chardma_other, list_address*4 );
- cps3_process_character_dma(space->machine, list_address);
+ cps3_process_character_dma(space->machine(), list_address);
}
else
{
@@ -2082,23 +2082,23 @@ static WRITE32_HANDLER( cps3_characterdma_w )
static WRITE32_HANDLER( cps3_irq10_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 10, CLEAR_LINE); return;
+ cputag_set_input_line(space->machine(), "maincpu", 10, CLEAR_LINE); return;
}
static WRITE32_HANDLER( cps3_irq12_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 12, CLEAR_LINE); return;
+ cputag_set_input_line(space->machine(), "maincpu", 12, CLEAR_LINE); return;
}
static WRITE32_HANDLER( cps3_unk_vidregs_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
COMBINE_DATA(&state->unk_vidregs[offset]);
}
static READ32_HANDLER( cps3_colourram_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT16* src = (UINT16*)state->colourram;
return src[offset*2+1] | (src[offset*2+0]<<16);
@@ -2106,17 +2106,17 @@ static READ32_HANDLER( cps3_colourram_r )
static WRITE32_HANDLER( cps3_colourram_w )
{
- //cps3_state *state = space->machine->driver_data<cps3_state>();
+ //cps3_state *state = space->machine().driver_data<cps3_state>();
// COMBINE_DATA(&state->colourram[offset]);
if (ACCESSING_BITS_24_31)
{
- cps3_set_mame_colours(space->machine, offset*2, (data & 0xffff0000) >> 16, 0);
+ cps3_set_mame_colours(space->machine(), offset*2, (data & 0xffff0000) >> 16, 0);
}
if (ACCESSING_BITS_0_7)
{
- cps3_set_mame_colours(space->machine, offset*2+1, (data & 0x0000ffff) >> 0, 0);
+ cps3_set_mame_colours(space->machine(), offset*2+1, (data & 0x0000ffff) >> 0, 0);
}
}
@@ -2266,12 +2266,12 @@ static void cps3_exit(running_machine &machine)
static MACHINE_START( cps3 )
{
wd33c93_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, cps3_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, cps3_exit);
}
static MACHINE_RESET( cps3 )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->current_table_address = -1;
// copy data from flashroms back into user regions + decrypt into regions we execute/draw from.
@@ -2281,9 +2281,9 @@ static MACHINE_RESET( cps3 )
// make a copy in the regions we execute code / draw gfx from
-static void copy_from_nvram(running_machine *machine)
+static void copy_from_nvram(running_machine &machine)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT32* romdata = (UINT32*)state->user4region;
UINT32* romdata2 = (UINT32*)state->decrypted_gamerom;
int i;
@@ -2353,7 +2353,7 @@ static void copy_from_nvram(running_machine *machine)
/*
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);
@@ -2371,7 +2371,7 @@ static void copy_from_nvram(running_machine *machine)
static int cps3_dma_callback(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size)
{
- cps3_state *state = device->machine->driver_data<cps3_state>();
+ cps3_state *state = device->machine().driver_data<cps3_state>();
/*
on the actual CPS3 hardware the SH2 DMA bypasses the encryption.
@@ -2408,7 +2408,7 @@ static int cps3_dma_callback(device_t *device, UINT32 src, UINT32 dst, UINT32 da
}
else
{
- //printf("%s :src %08x, dst %08x, returning %08x\n", machine->describe_context(), src, dst, data);
+ //printf("%s :src %08x, dst %08x, returning %08x\n", machine.describe_context(), src, dst, data);
}
/* I doubt this is endian safe.. needs checking / fixing */
@@ -3095,7 +3095,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn)
rom[0x1fec8/4]^=0x00000004; // region
@@ -3120,7 +3120,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear jpn)
rom[0x1fec8/4]^=0x00000002; // region
rom[0x1fec8/4]^=0x00000070; // DEV mode
@@ -3141,7 +3141,7 @@ ROM_END
OCEANIA 7
ASIA NCD 8
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid)
rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD
// test on startup, only during game, must be another flag
@@ -3166,7 +3166,7 @@ ROM_END
// bios rom also lists korea, but game rom does not.
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3188,7 +3188,7 @@ ROM_END
OCEANIA 7
ASIA 8
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3210,7 +3210,7 @@ ROM_END
BRAZIL 6
OCEANIA 7
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000004; // region (clear region)
rom[0x1fec8/4]^=0x00000001; // region
rom[0x1fecc/4]^=0x01000000; // nocd
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index c78e025fa46..4b4476a6ca6 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -50,36 +50,36 @@ static void pc3092_reset(void)
}
-static void pc3092_update(running_machine *machine)
+static void pc3092_update(running_machine &machine)
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
flip_screen_set(machine, (state->pc3092_data[1] & 0x01) ? TRUE : FALSE);
}
static WRITE8_HANDLER( pc3092_w )
{
- crbaloon_state *state = space->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = space->machine().driver_data<crbaloon_state>();
state->pc3092_data[offset] = data & 0x0f;
if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(space->cpu), offset, state->pc3092_data[offset]);
- pc3092_update(space->machine);
+ pc3092_update(space->machine());
}
static CUSTOM_INPUT( pc3092_r )
{
- crbaloon_state *state = field->port->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = field->port->machine().driver_data<crbaloon_state>();
UINT32 ret;
/* enable coin & start input? Wild guess!!! */
if (state->pc3092_data[1] & 0x02)
- ret = input_port_read(field->port->machine, "PC3092");
+ ret = input_port_read(field->port->machine(), "PC3092");
else
ret = 0x00;
- if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field->port->machine->describe_context(), ret);
+ if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field->port->machine().describe_context(), ret);
return ret;
}
@@ -120,7 +120,7 @@ static READ8_HANDLER( pc3259_r )
UINT8 ret = 0;
UINT8 reg = offset >> 2;
- UINT16 collision_address = crbaloon_get_collision_address(space->machine);
+ UINT16 collision_address = crbaloon_get_collision_address(space->machine());
int collided = (collision_address != 0xffff);
switch (reg)
@@ -145,7 +145,7 @@ static READ8_HANDLER( pc3259_r )
if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", cpu_get_pc(space->cpu), reg, ret);
- return ret | (input_port_read(space->machine, "DSW1") & 0xf0);
+ return ret | (input_port_read(space->machine(), "DSW1") & 0xf0);
}
@@ -158,15 +158,15 @@ static READ8_HANDLER( pc3259_r )
static WRITE8_HANDLER( port_sound_w )
{
- device_t *discrete = space->machine->device("discrete");
- device_t *sn = space->machine->device("snsnd");
+ device_t *discrete = space->machine().device("discrete");
+ device_t *sn = space->machine().device("snsnd");
/* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
- cpu_interrupt_enable(space->machine->device("maincpu"), (data & 0x01) ? TRUE : FALSE);
- crbaloon_set_clear_collision_address(space->machine, (data & 0x01) ? TRUE : FALSE);
+ cpu_interrupt_enable(space->machine().device("maincpu"), (data & 0x01) ? TRUE : FALSE);
+ crbaloon_set_clear_collision_address(space->machine(), (data & 0x01) ? TRUE : FALSE);
/* D1 - SOUND STOP */
- space->machine->sound().system_enable((data & 0x02) ? TRUE : FALSE);
+ space->machine().sound().system_enable((data & 0x02) ? TRUE : FALSE);
/* D2 - unlabeled - music enable */
crbaloon_audio_set_music_enable(discrete, 0, (data & 0x04) ? TRUE : FALSE);
@@ -341,8 +341,8 @@ GFXDECODE_END
static MACHINE_RESET( crballoon )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
- device_t *discrete = machine->device("discrete");
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
+ device_t *discrete = machine.device("discrete");
pc3092_reset();
port_sound_w(space, 0, 0);
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index cc0648e98b3..02a5a348a5f 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -44,19 +44,19 @@
static WRITE8_HANDLER( rom_bank_select_w )
{
- memory_set_bank(space->machine, "bank1", data & 15);
+ memory_set_bank(space->machine(), "bank1", data & 15);
}
static MACHINE_START( crgolf )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
/* configure the banking */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
memory_set_bank(machine, "bank1", 0);
/* register for save states */
@@ -70,7 +70,7 @@ static MACHINE_START( crgolf )
static MACHINE_RESET( crgolf )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
state->port_select = 0;
state->main_to_sound_data = 0;
@@ -89,21 +89,21 @@ static MACHINE_RESET( crgolf )
static READ8_HANDLER( switch_input_r )
{
static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
- return input_port_read(space->machine, portnames[state->port_select]);
+ return input_port_read(space->machine(), portnames[state->port_select]);
}
static READ8_HANDLER( analog_input_r )
{
- return ((input_port_read(space->machine, "STICK0") >> 4) | (input_port_read(space->machine, "STICK1") & 0xf0)) ^ 0x88;
+ return ((input_port_read(space->machine(), "STICK0") >> 4) | (input_port_read(space->machine(), "STICK1") & 0xf0)) ^ 0x88;
}
static WRITE8_HANDLER( switch_input_select_w )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
if (!(data & 0x40)) state->port_select = 6;
if (!(data & 0x20)) state->port_select = 5;
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( unknown_w )
static TIMER_CALLBACK( main_to_sound_callback )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
state->main_to_sound_data = param;
@@ -139,13 +139,13 @@ static TIMER_CALLBACK( main_to_sound_callback )
static WRITE8_HANDLER( main_to_sound_w )
{
- space->machine->scheduler().synchronize(FUNC(main_to_sound_callback), data);
+ space->machine().scheduler().synchronize(FUNC(main_to_sound_callback), data);
}
static READ8_HANDLER( main_to_sound_r )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
return state->main_to_sound_data;
@@ -161,7 +161,7 @@ static READ8_HANDLER( main_to_sound_r )
static TIMER_CALLBACK( sound_to_main_callback )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, ASSERT_LINE);
state->sound_to_main_data = param;
@@ -170,13 +170,13 @@ static TIMER_CALLBACK( sound_to_main_callback )
static WRITE8_HANDLER( sound_to_main_w )
{
- space->machine->scheduler().synchronize(FUNC(sound_to_main_callback), data);
+ space->machine().scheduler().synchronize(FUNC(sound_to_main_callback), data);
}
static READ8_HANDLER( sound_to_main_r )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE);
return state->sound_to_main_data;
@@ -192,12 +192,12 @@ static READ8_HANDLER( sound_to_main_r )
static void vck_callback( device_t *device )
{
- crgolf_state *state = device->machine->driver_data<crgolf_state>();
+ crgolf_state *state = device->machine().driver_data<crgolf_state>();
/* only play back if we have data remaining */
if (state->sample_count != 0xff)
{
- UINT8 data = device->machine->region("adpcm")->base()[state->sample_offset >> 1];
+ UINT8 data = device->machine().region("adpcm")->base()[state->sample_offset >> 1];
/* write the next nibble and advance */
msm5205_data_w(device, (data >> (4 * (~state->sample_offset & 1))) & 0x0f);
@@ -218,7 +218,7 @@ static void vck_callback( device_t *device )
static WRITE8_DEVICE_HANDLER( crgolfhi_sample_w )
{
- crgolf_state *state = device->machine->driver_data<crgolf_state>();
+ crgolf_state *state = device->machine().driver_data<crgolf_state>();
switch (offset)
{
@@ -599,8 +599,8 @@ ROM_END
static DRIVER_INIT( crgolfhi )
{
- device_t *msm = machine->device("msm");
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*msm, 0xa000, 0xa003, FUNC(crgolfhi_sample_w));
+ device_t *msm = machine.device("msm");
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*msm, 0xa000, 0xa003, FUNC(crgolfhi_sample_w));
}
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index 24759bfafbc..3cf888484cf 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -26,13 +26,13 @@ static KONAMI_SETLINES_CALLBACK( crimfght_banking );
static WRITE8_HANDLER( crimfght_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE8_HANDLER( crimfght_sh_irqtrigger_w )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -42,7 +42,7 @@ static WRITE8_DEVICE_HANDLER( crimfght_snd_bankswitch_w )
/* b1: bank for channel A */
/* b0: bank for channel B */
- crimfght_state *state = device->machine->driver_data<crimfght_state>();
+ crimfght_state *state = device->machine().driver_data<crimfght_state>();
int bank_A = BIT(data, 1);
int bank_B = BIT(data, 0);
@@ -51,7 +51,7 @@ static WRITE8_DEVICE_HANDLER( crimfght_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -68,7 +68,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -257,22 +257,22 @@ static const k051960_interface crimfght_k051960_intf =
static MACHINE_START( crimfght )
{
- crimfght_state *state = machine->driver_data<crimfght_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ crimfght_state *state = machine.driver_data<crimfght_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank2", 0, 12, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank2", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k007232 = machine->device("k007232");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k007232 = machine.device("k007232");
}
static MACHINE_RESET( crimfght )
{
- konami_configure_set_lines(machine->device("maincpu"), crimfght_banking);
+ konami_configure_set_lines(machine.device("maincpu"), crimfght_banking);
}
static MACHINE_CONFIG_START( crimfght, crimfght_state )
@@ -405,14 +405,14 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( crimfght_banking )
{
- crimfght_state *state = device->machine->driver_data<crimfght_state>();
+ crimfght_state *state = device->machine().driver_data<crimfght_state>();
/* bit 5 = select work RAM or palette */
if (lines & 0x20)
{
device->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank3");
device->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000, 0x03ff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w));
- memory_set_bankptr(device->machine, "bank3", device->machine->generic.paletteram.v);
+ memory_set_bankptr(device->machine(), "bank3", device->machine().generic.paletteram.v);
}
else
device->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */
@@ -420,7 +420,7 @@ static KONAMI_SETLINES_CALLBACK( crimfght_banking )
/* bit 6 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- memory_set_bank(device->machine, "bank2", lines & 0x0f);
+ memory_set_bank(device->machine(), "bank2", lines & 0x0f);
}
GAME( 1989, crimfght, 0, crimfght, crimfght, 0, ROT0, "Konami", "Crime Fighters (US 4 players)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c
index 72743cc4d0a..ae3c5aaa01b 100644
--- a/src/mame/drivers/crospang.c
+++ b/src/mame/drivers/crospang.c
@@ -313,7 +313,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- crospang_state *state = device->machine->driver_data<crospang_state>();
+ crospang_state *state = device->machine().driver_data<crospang_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -325,9 +325,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( crospang )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bestri_tilebank));
state->save_item(NAME(state->xsproff));
@@ -336,7 +336,7 @@ static MACHINE_START( crospang )
static MACHINE_RESET( crospang )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
state->bestri_tilebank = 0;
// state->xsproff = 4;
@@ -586,10 +586,10 @@ ROM_START( bestri )
ROM_END
-static void tumblepb_gfx1_rearrange(running_machine *machine)
+static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c
index 45341d1ad83..1055dd56067 100644
--- a/src/mame/drivers/crshrace.c
+++ b/src/mame/drivers/crshrace.c
@@ -139,7 +139,7 @@ Dip locations verified with Service Mode.
static READ16_HANDLER( extrarom1_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
offset *= 2;
@@ -148,7 +148,7 @@ static READ16_HANDLER( extrarom1_r )
static READ16_HANDLER( extrarom2_r )
{
- UINT8 *rom = space->machine->region("user2")->base();
+ UINT8 *rom = space->machine().region("user2")->base();
offset *= 2;
@@ -157,12 +157,12 @@ static READ16_HANDLER( extrarom2_r )
static WRITE8_HANDLER( crshrace_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE16_HANDLER( sound_command_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
if (ACCESSING_BITS_0_7)
{
@@ -174,13 +174,13 @@ static WRITE16_HANDLER( sound_command_w )
static CUSTOM_INPUT( country_sndpending_r )
{
- crshrace_state *state = field->port->machine->driver_data<crshrace_state>();
+ crshrace_state *state = field->port->machine().driver_data<crshrace_state>();
return state->pending_command;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
state->pending_command = 0;
}
@@ -427,7 +427,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- crshrace_state *state = device->machine->driver_data<crshrace_state>();
+ crshrace_state *state = device->machine().driver_data<crshrace_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -444,12 +444,12 @@ static const k053936_interface crshrace_k053936_intf =
static MACHINE_START( crshrace )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
- state->audiocpu = machine->device("audiocpu");
- state->k053936 = machine->device("k053936");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936 = machine.device("k053936");
state->save_item(NAME(state->roz_bank));
state->save_item(NAME(state->gfxctrl));
@@ -459,7 +459,7 @@ static MACHINE_START( crshrace )
static MACHINE_RESET( crshrace )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
state->roz_bank = 0;
state->gfxctrl = 0;
@@ -584,7 +584,7 @@ ROM_END
void crshrace_patch_code( UINT16 offset )
{
/* A hack which shows 3 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[(offset + 0)/2] = 0x4e71;
RAM[(offset + 2)/2] = 0x4e71;
RAM[(offset + 4)/2] = 0x4e71;
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 7946f567dc6..13d95bb8628 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -157,9 +157,9 @@ public:
device_t *vr0video;
};
-static void IntReq( running_machine *machine, int num )
+static void IntReq( running_machine &machine, int num )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT32 IntEn = space->read_dword(0x01800c08);
UINT32 IntPend = space->read_dword(0x01800c0c);
@@ -177,7 +177,7 @@ static void IntReq( running_machine *machine, int num )
static READ32_HANDLER( FlipCount_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
#ifdef IDLE_LOOP_SPEEDUP
UINT32 IntPend = space->read_dword(0x01800c0c);
@@ -190,7 +190,7 @@ static READ32_HANDLER( FlipCount_r )
static WRITE32_HANDLER( FlipCount_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (mem_mask & 0x00ff0000)
{
@@ -204,28 +204,28 @@ static WRITE32_HANDLER( FlipCount_w )
static READ32_HANDLER( Input_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (offset == 0)
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
else if (offset == 1)
- return input_port_read(space->machine, "P3_P4");
+ return input_port_read(space->machine(), "P3_P4");
else if( offset == 2)
{
- UINT8 Port4 = input_port_read(space->machine, "SYSTEM");
+ UINT8 Port4 = input_port_read(space->machine(), "SYSTEM");
if (!(Port4 & 0x10) && ((state->OldPort4 ^ Port4) & 0x10)) //coin buttons trigger IRQs
- IntReq(space->machine, 12);
+ IntReq(space->machine(), 12);
if (!(Port4 & 0x20) && ((state->OldPort4 ^ Port4) & 0x20))
- IntReq(space->machine, 19);
+ IntReq(space->machine(), 19);
state->OldPort4 = Port4;
- return /*dips*/input_port_read(space->machine, "DSW") | (Port4 << 16);
+ return /*dips*/input_port_read(space->machine(), "DSW") | (Port4 << 16);
}
return 0;
}
static WRITE32_HANDLER( IntAck_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
UINT32 IntPend = space->read_dword(0x01800c0c);
if (mem_mask & 0xff)
@@ -241,7 +241,7 @@ static WRITE32_HANDLER( IntAck_w )
static IRQ_CALLBACK( icallback )
{
- crystal_state *state = device->machine->driver_data<crystal_state>();
+ crystal_state *state = device->machine().driver_data<crystal_state>();
address_space *space = device->memory().space(AS_PROGRAM);
UINT32 IntPend = space->read_dword(0x01800c0c);
int i;
@@ -258,18 +258,18 @@ static IRQ_CALLBACK( icallback )
static WRITE32_HANDLER( Banksw_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
state->Bank = (data >> 1) & 7;
if (state->Bank <= 2)
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + state->Bank * 0x1000000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user1")->base() + state->Bank * 0x1000000);
else
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user2")->base());
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user2")->base());
}
static TIMER_CALLBACK( Timercb )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int which = (int)(FPTR)ptr;
static const int num[] = { 0, 1, 9, 10 };
@@ -281,7 +281,7 @@ static TIMER_CALLBACK( Timercb )
INLINE void Timer_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (((data ^ state->Timerctrl[which]) & 1) && (data & 1)) //Timer activate
{
@@ -304,7 +304,7 @@ static WRITE32_HANDLER( Timer0_w )
static READ32_HANDLER( Timer0_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[0];
}
@@ -315,7 +315,7 @@ static WRITE32_HANDLER( Timer1_w )
static READ32_HANDLER( Timer1_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[1];
}
@@ -326,7 +326,7 @@ static WRITE32_HANDLER( Timer2_w )
static READ32_HANDLER( Timer2_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[2];
}
@@ -337,19 +337,19 @@ static WRITE32_HANDLER( Timer3_w )
static READ32_HANDLER( Timer3_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[3];
}
static READ32_HANDLER( FlashCmd_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if ((state->FlashCmd & 0xff) == 0xff)
{
if (state->Bank <= 2)
{
- UINT32 *ptr = (UINT32*)(space->machine->region("user1")->base() + state->Bank * 0x1000000);
+ UINT32 *ptr = (UINT32*)(space->machine().region("user1")->base() + state->Bank * 0x1000000);
return ptr[0];
}
else
@@ -367,19 +367,19 @@ static READ32_HANDLER( FlashCmd_r )
static WRITE32_HANDLER( FlashCmd_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
state->FlashCmd = data;
}
static READ32_HANDLER( PIO_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->PIO;
}
static WRITE32_HANDLER( PIO_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
UINT32 RST = data & 0x01000000;
UINT32 CLK = data & 0x02000000;
UINT32 DAT = data & 0x10000000;
@@ -400,7 +400,7 @@ static WRITE32_HANDLER( PIO_w )
INLINE void DMA_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (((data ^ state->DMActrl[which]) & (1 << 10)) && (data & (1 << 10))) //DMAOn
{
@@ -436,14 +436,14 @@ INLINE void DMA_w( address_space *space, int which, UINT32 data, UINT32 mem_mask
}
data &= ~(1 << 10);
space->write_dword(0x0180080C + which * 0x10, 0);
- IntReq(space->machine, 7 + which);
+ IntReq(space->machine(), 7 + which);
}
COMBINE_DATA(&state->DMActrl[which]);
}
static READ32_HANDLER( DMA0_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->DMActrl[0];
}
@@ -454,7 +454,7 @@ static WRITE32_HANDLER( DMA0_w )
static READ32_HANDLER( DMA1_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->DMActrl[1];
}
@@ -498,7 +498,7 @@ static ADDRESS_MAP_START( crystal_mem, AS_PROGRAM, 32 )
ADDRESS_MAP_END
-static void PatchReset( running_machine *machine )
+static void PatchReset( running_machine &machine )
{
//The test menu reset routine seems buggy
//it reads the reset vector from 0x02000000 but it should be
@@ -522,7 +522,7 @@ loop:
JMP Loop1
*/
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
#if 1
static const UINT32 Patch[] =
@@ -550,26 +550,26 @@ loop:
static STATE_POSTLOAD( crystal_banksw_postload )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
if (state->Bank <= 2)
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + state->Bank * 0x1000000);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + state->Bank * 0x1000000);
else
- memory_set_bankptr(machine, "bank1", machine->region("user2")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("user2")->base());
}
static MACHINE_START( crystal )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int i;
- state->maincpu = machine->device("maincpu");
- state->ds1302 = machine->device("rtc");
- state->vr0video = machine->device("vr0");
+ state->maincpu = machine.device("maincpu");
+ state->ds1302 = machine.device("rtc");
+ state->vr0video = machine.device("vr0");
- device_set_irq_callback(machine->device("maincpu"), icallback);
+ device_set_irq_callback(machine.device("maincpu"), icallback);
for (i = 0; i < 4; i++)
- state->Timer[i] = machine->scheduler().timer_alloc(FUNC(Timercb), (void*)(FPTR)i);
+ state->Timer[i] = machine.scheduler().timer_alloc(FUNC(Timercb), (void*)(FPTR)i);
PatchReset(machine);
@@ -585,21 +585,21 @@ static MACHINE_START( crystal )
state->save_item(NAME(state->PIO));
state->save_item(NAME(state->DMActrl));
state->save_item(NAME(state->OldPort4));
- machine->state().register_postload(crystal_banksw_postload, NULL);
+ machine.state().register_postload(crystal_banksw_postload, NULL);
}
static MACHINE_RESET( crystal )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int i;
memset(state->sysregs, 0, 0x10000);
memset(state->vidregs, 0, 0x10000);
state->FlipCount = 0;
state->IntHigh = 0;
- device_set_irq_callback(machine->device("maincpu"), icallback);
+ device_set_irq_callback(machine.device("maincpu"), icallback);
state->Bank = 0;
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0);
state->FlashCmd = 0xff;
state->OldPort4 = 0;
@@ -612,7 +612,7 @@ static MACHINE_RESET( crystal )
state->Timer[i]->adjust(attotime::never);
}
- vr0_snd_set_areas(machine->device("vrender"), state->textureram, state->frameram);
+ vr0_snd_set_areas(machine.device("vrender"), state->textureram, state->frameram);
#ifdef IDLE_LOOP_SPEEDUP
state->FlipCntRead = 0;
#endif
@@ -633,8 +633,8 @@ static void SetVidReg( address_space *space, UINT16 reg, UINT16 val )
static SCREEN_UPDATE( crystal )
{
- crystal_state *state = screen->machine->driver_data<crystal_state>();
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ crystal_state *state = screen->machine().driver_data<crystal_state>();
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
int DoFlip;
UINT32 B0 = 0x0;
@@ -694,8 +694,8 @@ static SCREEN_UPDATE( crystal )
static SCREEN_EOF(crystal)
{
- crystal_state *state = machine->driver_data<crystal_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ crystal_state *state = machine.driver_data<crystal_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 head, tail;
int DoFlip = 0;
@@ -722,7 +722,7 @@ static SCREEN_EOF(crystal)
static INTERRUPT_GEN(crystal_interrupt)
{
- IntReq(device->machine, 24); //VRender0 VBlank
+ IntReq(device->machine(), 24); //VRender0 VBlank
}
static INPUT_PORTS_START(crystal)
@@ -927,7 +927,7 @@ ROM_END
static DRIVER_INIT(crysking)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
//patch the data feed by the protection
@@ -946,7 +946,7 @@ static DRIVER_INIT(crysking)
static DRIVER_INIT(evosocc)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom += 0x1000000 * 2 / 2;
Rom[WORD_XOR_LE(0x97388E/2)] = 0x90FC; //PUSH R2..R7
@@ -964,7 +964,7 @@ static DRIVER_INIT(evosocc)
static DRIVER_INIT(topbladv)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom[WORD_XOR_LE(0x12d7a/2)] = 0x90FC; //PUSH R7-R6-R5-R4-R3-R2
Rom[WORD_XOR_LE(0x12d7c/2)] = 0x9001; //PUSH R0
@@ -982,7 +982,7 @@ static DRIVER_INIT(topbladv)
static DRIVER_INIT(officeye)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom[WORD_XOR_LE(0x9c9e/2)] = 0x901C; //PUSH R4-R3-R2
Rom[WORD_XOR_LE(0x9ca0/2)] = 0x9001; //PUSH R0
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index f83145476d7..fc984866707 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -109,9 +109,9 @@ public:
#if 0
-static void ar_coin_hack(running_machine *machine)
+static void ar_coin_hack(running_machine &machine)
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
if(input_port_read(machine, "COIN") & 1)
{
if(state->coin_stat==0)
@@ -135,7 +135,7 @@ static void ar_coin_hack(running_machine *machine)
static TILE_GET_INFO( get_cstx_tile_info )
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
int code = (state->txram[tile_index*2]);
int attr = (state->txram[tile_index*2+1]);
int rg;
@@ -152,22 +152,22 @@ static TILE_GET_INFO( get_cstx_tile_info )
static WRITE8_HANDLER(cshooter_txram_w)
{
- cshooter_state *state = space->machine->driver_data<cshooter_state>();
+ cshooter_state *state = space->machine().driver_data<cshooter_state>();
state->txram[offset] = data;
tilemap_mark_tile_dirty(state->txtilemap,offset/2);
}
static VIDEO_START(cshooter)
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
state->txtilemap = tilemap_create(machine, get_cstx_tile_info,tilemap_scan_rows, 8,8,32, 32);
tilemap_set_transparent_pen(state->txtilemap, 3);
}
static SCREEN_UPDATE(cshooter)
{
- cshooter_state *state = screen->machine->driver_data<cshooter_state>();
- bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen->screen->machine)*/);
+ cshooter_state *state = screen->machine().driver_data<cshooter_state>();
+ bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen->screen->machine())*/);
tilemap_mark_all_tiles_dirty(state->txtilemap);
//sprites
@@ -180,25 +180,25 @@ static SCREEN_UPDATE(cshooter)
{
int tile=0x30+((spriteram[i]>>2)&0x1f);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3],spriteram[i+2],3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3]+8,spriteram[i+2],3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3]+8,spriteram[i+2]+8,3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
@@ -217,21 +217,21 @@ static SCREEN_UPDATE(cshooter)
static INTERRUPT_GEN( cshooter_interrupt )
{
- //cshooter_state *state = device->machine->driver_data<cshooter_state>();
+ //cshooter_state *state = device->machine().driver_data<cshooter_state>();
if(cpu_getiloops(device))
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x08);
else
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x10);
// if(state->mainram!=NULL)
-// ar_coin_hack(device->machine);
+// ar_coin_hack(device->machine());
}
static MACHINE_RESET( cshooter )
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
state->counter = 0;
}
@@ -242,11 +242,11 @@ static MACHINE_RESET( airraid )
static READ8_HANDLER ( cshooter_coin_r )
{
- cshooter_state *state = space->machine->driver_data<cshooter_state>();
+ cshooter_state *state = space->machine().driver_data<cshooter_state>();
/* Even reads must return 0xff - Odd reads must return the contents of input port 5.
Code at 0x5061 is executed once during P.O.S.T. where there is one read.
Code at 0x50b4 is then executed each frame (not sure) where there are 2 reads. */
- return ( (state->counter++ & 1) ? 0xff : input_port_read(space->machine, "COIN") );
+ return ( (state->counter++ & 1) ? 0xff : input_port_read(space->machine(), "COIN") );
}
static WRITE8_HANDLER ( cshooter_c500_w )
@@ -259,27 +259,27 @@ static WRITE8_HANDLER ( cshooter_c700_w )
static WRITE8_HANDLER ( bank_w )
{
- memory_set_bankptr(space->machine, "bank1",&space->machine->region("user1")->base()[0x4000*((data>>4)&3)]);
+ memory_set_bankptr(space->machine(), "bank1",&space->machine().region("user1")->base()[0x4000*((data>>4)&3)]);
}
static WRITE8_HANDLER(pal_w)
{
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
offset&=0xff;
- palette_set_color_rgb(space->machine, offset, pal4bit(space->machine->generic.paletteram.u8[offset] >> 4), pal4bit(space->machine->generic.paletteram.u8[offset]), pal4bit(space->machine->generic.paletteram.u8[offset+0x100]));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(space->machine().generic.paletteram.u8[offset] >> 4), pal4bit(space->machine().generic.paletteram.u8[offset]), pal4bit(space->machine().generic.paletteram.u8[offset+0x100]));
}
static WRITE8_HANDLER(pal2_w)
{
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
offset&=0x1ff;
- palette_set_color_rgb(space->machine, offset, pal4bit(space->machine->generic.paletteram.u8[offset] >> 4), pal4bit(space->machine->generic.paletteram.u8[offset]), pal4bit(space->machine->generic.paletteram.u8[offset+0x200]));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(space->machine().generic.paletteram.u8[offset] >> 4), pal4bit(space->machine().generic.paletteram.u8[offset]), pal4bit(space->machine().generic.paletteram.u8[offset+0x200]));
}
static READ8_HANDLER(pal_r)
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static ADDRESS_MAP_START( cshooter_map, AS_PROGRAM, 8 )
@@ -687,19 +687,19 @@ ROM_END
static DRIVER_INIT( cshooter )
{
/* temp so it boots */
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0xa2] = 0x00;
rom[0xa3] = 0x00;
rom[0xa4] = 0x00;
- memory_set_bankptr(machine, "bank1",&machine->region("user1")->base()[0]);
+ memory_set_bankptr(machine, "bank1",&machine.region("user1")->base()[0]);
}
static DRIVER_INIT( cshootere )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -729,7 +729,7 @@ static DRIVER_INIT( cshootere )
rom[A] = BITSWAP8(rom[A],7,6,1,4,3,2,5,0);
}
- memory_set_bankptr(machine, "bank1",&machine->region("user1")->base()[0]);
+ memory_set_bankptr(machine, "bank1",&machine.region("user1")->base()[0]);
seibu_sound_decrypt(machine,"audiocpu",0x2000);
}
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 1d023078858..7e9a9e0ff33 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -50,7 +50,7 @@ public:
#define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2
#define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2
-static void csplayh5_vdp0_interrupt(running_machine *machine, int i)
+static void csplayh5_vdp0_interrupt(running_machine &machine, int i)
{
/* this is not used as the v9938 interrupt callbacks are broken
interrupts seem to be fired quite randomly */
@@ -58,16 +58,16 @@ static void csplayh5_vdp0_interrupt(running_machine *machine, int i)
static VIDEO_START( csplayh5 )
{
- csplayh5_state *state = machine->driver_data<csplayh5_state>();
- state->vdp0_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- v9938_init (machine, 0, *machine->primary_screen, state->vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt);
+ csplayh5_state *state = machine.driver_data<csplayh5_state>();
+ state->vdp0_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ v9938_init (machine, 0, *machine.primary_screen, state->vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt);
v9938_reset(0);
}
static SCREEN_UPDATE( csplayh5 )
{
- csplayh5_state *state = screen->machine->driver_data<csplayh5_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ csplayh5_state *state = screen->machine().driver_data<csplayh5_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
copybitmap(bitmap, state->vdp0_bitmap, 0, 0, 0, 0, cliprect);
@@ -77,14 +77,14 @@ static SCREEN_UPDATE( csplayh5 )
static READ16_HANDLER( csplayh5_mux_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "KEY0");
- case 0x02: return input_port_read(space->machine, "KEY1");
- case 0x04: return input_port_read(space->machine, "KEY2");
- case 0x08: return input_port_read(space->machine, "KEY3");
- case 0x10: return input_port_read(space->machine, "KEY4");
+ case 0x01: return input_port_read(space->machine(), "KEY0");
+ case 0x02: return input_port_read(space->machine(), "KEY1");
+ case 0x04: return input_port_read(space->machine(), "KEY2");
+ case 0x08: return input_port_read(space->machine(), "KEY3");
+ case 0x10: return input_port_read(space->machine(), "KEY4");
}
return 0xffff;
@@ -92,7 +92,7 @@ static READ16_HANDLER( csplayh5_mux_r )
static WRITE16_HANDLER( csplayh5_mux_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->mux_data = (~data & 0x1f);
}
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
#if USE_H8
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( csplayh5_sub_map, AS_PROGRAM, 16 )
@@ -157,9 +157,9 @@ sound HW is identical to Niyanpai
#define DAC_WRITE dac_w
#endif
-static void csplayh5_soundbank_w(running_machine *machine, int data)
+static void csplayh5_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
memory_set_bankptr(machine, "bank1", &SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -197,7 +197,7 @@ static READ8_HANDLER( tmpz84c011_pio_r )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine().describe_context(), offset);
portdata = 0xff;
break;
}
@@ -210,13 +210,13 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
switch (offset)
{
case 0: /* PA_0 */
- csplayh5_soundbank_w(space->machine, data & 0x03);
+ csplayh5_soundbank_w(space->machine(), data & 0x03);
break;
case 1: /* PB_0 */
- DAC_WRITE(space->machine->device("dac2"), 0, data);
+ DAC_WRITE(space->machine().device("dac2"), 0, data);
break;
case 2: /* PC_0 */
- DAC_WRITE(space->machine->device("dac1"), 0, data);
+ DAC_WRITE(space->machine().device("dac1"), 0, data);
break;
case 3: /* PD_0 */
break;
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine().describe_context(), offset, data);
break;
}
}
@@ -234,65 +234,65 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
/* CPU interface */
static READ8_HANDLER( tmpz84c011_0_pa_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]);
}
static READ8_HANDLER( tmpz84c011_0_pb_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]);
}
static READ8_HANDLER( tmpz84c011_0_pc_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]);
}
static READ8_HANDLER( tmpz84c011_0_pd_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]);
}
static READ8_HANDLER( tmpz84c011_0_pe_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]);
}
static WRITE8_HANDLER( tmpz84c011_0_pa_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[0] = data;
tmpz84c011_pio_w(space, 0, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pb_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[1] = data;
tmpz84c011_pio_w(space, 1, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pc_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[2] = data;
tmpz84c011_pio_w(space, 2, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pd_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[3] = data;
tmpz84c011_pio_w(space, 3, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pe_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[4] = data;
tmpz84c011_pio_w(space, 4, data);
}
@@ -300,62 +300,62 @@ static WRITE8_HANDLER( tmpz84c011_0_pe_w )
static READ8_HANDLER( tmpz84c011_0_dir_pa_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[0];
}
static READ8_HANDLER( tmpz84c011_0_dir_pb_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[1];
}
static READ8_HANDLER( tmpz84c011_0_dir_pc_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[2];
}
static READ8_HANDLER( tmpz84c011_0_dir_pd_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[3];
}
static READ8_HANDLER( tmpz84c011_0_dir_pe_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[4];
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[0] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[1] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[2] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[3] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[4] = data;
}
@@ -586,8 +586,8 @@ static Z80CTC_INTERFACE( ctc_intf )
static MACHINE_RESET( csplayh5 )
{
- csplayh5_state *state = machine->driver_data<csplayh5_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ csplayh5_state *state = machine.driver_data<csplayh5_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
@@ -602,7 +602,7 @@ static INTERRUPT_GEN( scanline_irq )
{
v9938_set_sprite_limit(0, 0);
v9938_set_resolution(0, RENDER_HIGH);
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static INTERRUPT_GEN( csplayh5_irq )
@@ -680,8 +680,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT( csplayh5 )
{
- UINT16 *MAINROM = (UINT16 *)machine->region("maincpu")->base();
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ UINT16 *MAINROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
// initialize sound rom bank
csplayh5_soundbank_w(machine, 0);
diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c
index c1efdf65c22..e73e9951685 100644
--- a/src/mame/drivers/cubeqst.c
+++ b/src/mame/drivers/cubeqst.c
@@ -62,7 +62,7 @@ static const rectangle overlay_clip = { 0, 320-1, 0, 256-8 };
static VIDEO_START( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
state->video_field = 0;
state->depth_buffer = auto_alloc_array(machine, UINT8, 512);
}
@@ -70,7 +70,7 @@ static VIDEO_START( cubeqst )
/* TODO: Use resistor values */
static PALETTE_INIT( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
int i;
state->colormap = auto_alloc_array(machine, rgb_t, 65536);
@@ -90,14 +90,14 @@ static PALETTE_INIT( cubeqst )
static WRITE16_HANDLER( palette_w )
{
- space->machine->primary_screen->update_now();
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ space->machine().primary_screen->update_now();
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
}
/* TODO: This is a simplified version of what actually happens */
static SCREEN_UPDATE( cubeqst )
{
- cubeqst_state *state = screen->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = screen->machine().driver_data<cubeqst_state>();
int y;
/*
@@ -112,8 +112,8 @@ static SCREEN_UPDATE( cubeqst )
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
{
int i;
- int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine->device("line_cpu"), y);
- UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine->device("line_cpu"));
+ int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine().device("line_cpu"), y);
+ UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine().device("line_cpu"));
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT32 pen;
@@ -155,7 +155,7 @@ static SCREEN_UPDATE( cubeqst )
}
/* Draw the span, testing for depth */
- pen = state->colormap[screen->machine->generic.paletteram.u16[color]];
+ pen = state->colormap[screen->machine().generic.paletteram.u16[color]];
for (x = h1; x <= h2; ++x)
{
if (!(state->depth_buffer[x] < depth))
@@ -174,12 +174,12 @@ static SCREEN_UPDATE( cubeqst )
static READ16_HANDLER( line_r )
{
/* I think this is unusued */
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
static INTERRUPT_GEN( vblank )
{
- cubeqst_state *state = device->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = device->machine().driver_data<cubeqst_state>();
int int_level = state->video_field == 0 ? 5 : 6;
device_set_input_line(device, int_level, HOLD_LINE);
@@ -197,7 +197,7 @@ static INTERRUPT_GEN( vblank )
static WRITE16_HANDLER( laserdisc_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
laserdisc_data_w(state->laserdisc, data & 0xff);
}
@@ -207,7 +207,7 @@ static WRITE16_HANDLER( laserdisc_w )
*/
static READ16_HANDLER( laserdisc_r )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
int ldp_command_flag = (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_READY) == ASSERT_LINE) ? 0 : 1;
int ldp_seek_status = (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_STATUS) == ASSERT_LINE) ? 1 : 0;
@@ -218,7 +218,7 @@ static READ16_HANDLER( laserdisc_r )
/* LDP audio squelch control */
static WRITE16_HANDLER( ldaud_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
simutrek_set_audio_squelch(state->laserdisc, data & 1 ? ASSERT_LINE : CLEAR_LINE);
}
@@ -234,7 +234,7 @@ static WRITE16_HANDLER( ldaud_w )
*/
static WRITE16_HANDLER( control_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
laserdisc_video_enable(state->laserdisc, data & 1);
}
@@ -247,17 +247,17 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( delayed_bank_swap )
{
- cubeqcpu_swap_line_banks(machine->device("line_cpu"));
+ cubeqcpu_swap_line_banks(machine.device("line_cpu"));
/* TODO: This is a little dubious */
- cubeqcpu_clear_stack(machine->device("line_cpu"));
+ cubeqcpu_clear_stack(machine.device("line_cpu"));
}
-static void swap_linecpu_banks(running_machine *machine)
+static void swap_linecpu_banks(running_machine &machine)
{
/* Best sync up before we switch banks around */
- machine->scheduler().synchronize(FUNC(delayed_bank_swap));
+ machine.scheduler().synchronize(FUNC(delayed_bank_swap));
}
@@ -271,14 +271,14 @@ static void swap_linecpu_banks(running_machine *machine)
*/
static WRITE16_HANDLER( reset_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
- cputag_set_input_line(space->machine, "rotate_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "line_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sound_cpu", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
+ cputag_set_input_line(space->machine(), "rotate_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "line_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
/* Swap stack and pointer RAM banks on rising edge of display reset */
if (!BIT(state->reset_latch, 0) && BIT(data, 0))
- swap_linecpu_banks(space->machine);
+ swap_linecpu_banks(space->machine());
if (!BIT(data, 2))
state->laserdisc->reset();
@@ -295,7 +295,7 @@ static WRITE16_HANDLER( reset_w )
static WRITE16_HANDLER( io_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
/*
0: Spare lamp
1: Spare driver
@@ -322,8 +322,8 @@ static WRITE16_HANDLER( io_w )
static READ16_HANDLER( io_r )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
- UINT16 port_data = input_port_read(space->machine, "IO");
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
+ UINT16 port_data = input_port_read(space->machine(), "IO");
/*
Certain bits depend on Q7 of the IO latch:
@@ -344,7 +344,7 @@ static READ16_HANDLER( io_r )
/* Trackball ('CHOP') */
static READ16_HANDLER( chop_r )
{
- return (input_port_read(space->machine, "TRACK_X") << 8) | input_port_read(space->machine, "TRACK_Y");
+ return (input_port_read(space->machine(), "TRACK_X") << 8) | input_port_read(space->machine(), "TRACK_Y");
}
@@ -385,22 +385,22 @@ INPUT_PORTS_END
static READ16_HANDLER( read_rotram )
{
- return cubeqcpu_rotram_r(space->machine->device("rotate_cpu"), offset, mem_mask);
+ return cubeqcpu_rotram_r(space->machine().device("rotate_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_rotram )
{
- cubeqcpu_rotram_w(space->machine->device("rotate_cpu"), offset, data, mem_mask);
+ cubeqcpu_rotram_w(space->machine().device("rotate_cpu"), offset, data, mem_mask);
}
static READ16_HANDLER( read_sndram )
{
- return cubeqcpu_sndram_r(space->machine->device("sound_cpu"), offset, mem_mask);
+ return cubeqcpu_sndram_r(space->machine().device("sound_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_sndram )
{
- cubeqcpu_sndram_w(space->machine->device("sound_cpu"), offset, data, mem_mask);
+ cubeqcpu_sndram_w(space->machine().device("sound_cpu"), offset, data, mem_mask);
}
static ADDRESS_MAP_START( m68k_program_map, AS_PROGRAM, 16 )
@@ -437,13 +437,13 @@ ADDRESS_MAP_END
static MACHINE_START( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
- state->laserdisc = machine->device("laserdisc");
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
+ state->laserdisc = machine.device("laserdisc");
}
static MACHINE_RESET( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
state->reset_latch = 0;
/* Auxillary CPUs are held in reset */
@@ -479,7 +479,7 @@ static void sound_dac_w(device_t *device, UINT16 data)
"rdac6", "ldac6",
"rdac7", "ldac7"
};
- dac_signed_data_16_w(device->machine->device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
+ dac_signed_data_16_w(device->machine().device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
}
static const cubeqst_snd_config snd_config =
diff --git a/src/mame/drivers/cultures.c b/src/mame/drivers/cultures.c
index 63fcaf10ef7..61b00d75259 100644
--- a/src/mame/drivers/cultures.c
+++ b/src/mame/drivers/cultures.c
@@ -42,30 +42,30 @@ public:
static TILE_GET_INFO( get_bg1_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *region = machine->region("gfx3")->base() + 0x200000 + 0x80000 * state->bg1_bank;
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *region = machine.region("gfx3")->base() + 0x200000 + 0x80000 * state->bg1_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(2, code, code >> 12, 0);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *region = machine->region("gfx2")->base() + 0x200000 + 0x80000 * state->bg2_bank;
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *region = machine.region("gfx2")->base() + 0x200000 + 0x80000 * state->bg2_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(1, code, code >> 12, 0);
}
static TILE_GET_INFO( get_bg0_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
int code = state->bg0_videoram[tile_index * 2] + (state->bg0_videoram[tile_index * 2 + 1] << 8);
SET_TILE_INFO(0, code, code >> 12, 0);
}
static VIDEO_START( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
state->bg0_tilemap = tilemap_create(machine, get_bg0_tile_info,tilemap_scan_rows, 8, 8, 64, 128);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info,tilemap_scan_rows, 8, 8, 512, 512);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info,tilemap_scan_rows, 8, 8, 512, 512);
@@ -84,7 +84,7 @@ static VIDEO_START( cultures )
static SCREEN_UPDATE( cultures )
{
- cultures_state *state = screen->machine->driver_data<cultures_state>();
+ cultures_state *state = screen->machine().driver_data<cultures_state>();
int attr;
// tilemaps attributes
@@ -114,14 +114,14 @@ static SCREEN_UPDATE( cultures )
static WRITE8_HANDLER( cpu_bankswitch_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ cultures_state *state = space->machine().driver_data<cultures_state>();
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
state->video_bank = ~data & 0x20;
}
static WRITE8_HANDLER( bg0_videoram_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
if (state->video_bank == 0)
{
int r, g, b, datax;
@@ -133,7 +133,7 @@ static WRITE8_HANDLER( bg0_videoram_w )
g = ((datax >> 3) & 0x1e) | ((datax & 0x2000) ? 0x1 : 0);
b = ((datax << 1) & 0x1e) | ((datax & 0x1000) ? 0x1 : 0);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
else
{
@@ -144,14 +144,14 @@ static WRITE8_HANDLER( bg0_videoram_w )
static WRITE8_HANDLER( misc_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
int new_bank = data & 0xf;
if (state->old_bank != new_bank)
{
// oki banking
- UINT8 *src = space->machine->region("oki")->base() + 0x40000 + 0x20000 * new_bank;
- UINT8 *dst = space->machine->region("oki")->base() + 0x20000;
+ UINT8 *src = space->machine().region("oki")->base() + 0x40000 + 0x20000 * new_bank;
+ UINT8 *dst = space->machine().region("oki")->base() + 0x20000;
memcpy(dst, src, 0x20000);
state->old_bank = new_bank;
@@ -162,7 +162,7 @@ static WRITE8_HANDLER( misc_w )
static WRITE8_HANDLER( bg_bank_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
if (state->bg1_bank != (data & 3))
{
state->bg1_bank = data & 3;
@@ -174,7 +174,7 @@ static WRITE8_HANDLER( bg_bank_w )
state->bg2_bank = (data & 0xc) >> 2;
tilemap_mark_all_tiles_dirty(state->bg2_tilemap);
}
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x10);
}
static ADDRESS_MAP_START( cultures_map, AS_PROGRAM, 8 )
@@ -352,15 +352,15 @@ GFXDECODE_END
static INTERRUPT_GEN( cultures_interrupt )
{
- cultures_state *state = device->machine->driver_data<cultures_state>();
+ cultures_state *state = device->machine().driver_data<cultures_state>();
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
}
static MACHINE_START( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x0000], 0x4000);
@@ -374,7 +374,7 @@ static MACHINE_START( cultures )
static MACHINE_RESET( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
state->old_bank = -1;
state->video_bank = 0;
state->irq_enable = 0;
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 9d5cfd3f904..d783314b7de 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -114,7 +114,7 @@ Todo & FIXME:
READ8_HANDLER( cvs_video_or_color_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->video_ram[offset];
@@ -124,7 +124,7 @@ READ8_HANDLER( cvs_video_or_color_ram_r )
WRITE8_HANDLER( cvs_video_or_color_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
state->video_ram[offset] = data;
@@ -135,7 +135,7 @@ WRITE8_HANDLER( cvs_video_or_color_ram_w )
READ8_HANDLER( cvs_bullet_ram_or_palette_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->palette_ram[offset & 0x0f];
@@ -145,7 +145,7 @@ READ8_HANDLER( cvs_bullet_ram_or_palette_r )
WRITE8_HANDLER( cvs_bullet_ram_or_palette_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
state->palette_ram[offset & 0x0f] = data;
@@ -156,7 +156,7 @@ WRITE8_HANDLER( cvs_bullet_ram_or_palette_w )
READ8_HANDLER( cvs_s2636_0_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(0 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -166,13 +166,13 @@ READ8_HANDLER( cvs_s2636_0_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (0 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_0, offset, data);
@@ -181,7 +181,7 @@ WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w )
READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(1 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -191,13 +191,13 @@ READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (1 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_1, offset, data);
@@ -206,7 +206,7 @@ WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(2 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -216,13 +216,13 @@ READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (2 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_2, offset, data);
@@ -241,7 +241,7 @@ static INTERRUPT_GEN( cvs_main_cpu_interrupt )
device_set_input_line_vector(device, 0, 0x03);
generic_pulse_irq_line(device, 0);
- cvs_scroll_stars(device->machine);
+ cvs_scroll_stars(device->machine());
}
@@ -262,7 +262,7 @@ static void cvs_slave_cpu_interrupt( device_t *cpu, int state )
static READ8_HANDLER( cvs_input_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
UINT8 ret = 0;
/* the upper 4 bits of the address is used to select the character banking attributes */
@@ -272,12 +272,12 @@ static READ8_HANDLER( cvs_input_r )
/* the lower 4 (or 3?) bits select the port to read */
switch (offset & 0x0f) /* might be 0x07 */
{
- case 0x00: ret = input_port_read(space->machine, "IN0"); break;
- case 0x02: ret = input_port_read(space->machine, "IN1"); break;
- case 0x03: ret = input_port_read(space->machine, "IN2"); break;
- case 0x04: ret = input_port_read(space->machine, "IN3"); break;
- case 0x06: ret = input_port_read(space->machine, "DSW3"); break;
- case 0x07: ret = input_port_read(space->machine, "DSW2"); break;
+ case 0x00: ret = input_port_read(space->machine(), "IN0"); break;
+ case 0x02: ret = input_port_read(space->machine(), "IN1"); break;
+ case 0x03: ret = input_port_read(space->machine(), "IN2"); break;
+ case 0x04: ret = input_port_read(space->machine(), "IN3"); break;
+ case 0x06: ret = input_port_read(space->machine(), "DSW3"); break;
+ case 0x07: ret = input_port_read(space->machine(), "DSW2"); break;
default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(space->cpu), offset & 0x0f); break;
}
@@ -294,7 +294,7 @@ static READ8_HANDLER( cvs_input_r )
#if 0
static READ8_HANDLER( cvs_393hz_clock_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
return state->cvs_393hz_clock ? 0x80 : 0;
}
#endif
@@ -306,7 +306,7 @@ static READ8_DEVICE_HANDLER( tms_clock_r )
static TIMER_CALLBACK( cvs_393hz_timer_cb )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
state->cvs_393hz_clock = !state->cvs_393hz_clock;
/* quasar.c games use this timer but have no dac3! */
@@ -318,10 +318,10 @@ static TIMER_CALLBACK( cvs_393hz_timer_cb )
}
-static void start_393hz_timer(running_machine *machine)
+static void start_393hz_timer(running_machine &machine)
{
- cvs_state *state = machine->driver_data<cvs_state>();
- state->cvs_393hz_timer = machine->scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb));
+ cvs_state *state = machine.driver_data<cvs_state>();
+ state->cvs_393hz_timer = machine.scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb));
state->cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393));
}
@@ -335,7 +335,7 @@ static void start_393hz_timer(running_machine *machine)
static WRITE8_DEVICE_HANDLER( cvs_4_bit_dac_data_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
UINT8 dac_value;
static int old_data[4] = {0,0,0,0};
@@ -358,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( cvs_4_bit_dac_data_w )
static WRITE8_DEVICE_HANDLER( cvs_unknown_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
/* offset 2 is used in 8ball
* offset 0 is used in spacefrt
@@ -385,7 +385,7 @@ static WRITE8_DEVICE_HANDLER( cvs_unknown_w )
static WRITE8_HANDLER( cvs_speech_rom_address_lo_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
/* assuming that d0-d2 are cleared here */
state->speech_rom_bit_address = (state->speech_rom_bit_address & 0xf800) | (data << 3);
@@ -394,7 +394,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_lo_w )
static WRITE8_HANDLER( cvs_speech_rom_address_hi_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
state->speech_rom_bit_address = (state->speech_rom_bit_address & 0x07ff) | (data << 11);
LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", cpu_get_pc(space->cpu), data, state->speech_rom_bit_address >> 3));
}
@@ -402,7 +402,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_hi_w )
static READ8_HANDLER( cvs_speech_command_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
/* FIXME: this was by observation on board ???
* -bit 7 is TMS status (active LO) */
@@ -412,7 +412,7 @@ static READ8_HANDLER( cvs_speech_command_r )
static WRITE8_DEVICE_HANDLER( cvs_tms5110_ctl_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
UINT8 ctl;
/*
* offset 0: CS ?
@@ -439,13 +439,13 @@ static WRITE8_DEVICE_HANDLER( cvs_tms5110_pdc_w )
static int speech_rom_read_bit( device_t *device )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
- running_machine *machine = device->machine;
- UINT8 *ROM = machine->region("speechdata")->base();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
+ running_machine &machine = device->machine();
+ UINT8 *ROM = machine.region("speechdata")->base();
int bit;
/* before reading the bit, clamp the address to the region length */
- state->speech_rom_bit_address = state->speech_rom_bit_address & ((machine->region("speechdata")->bytes() * 8) - 1);
+ state->speech_rom_bit_address = state->speech_rom_bit_address & ((machine.region("speechdata")->bytes() * 8) - 1);
bit = (ROM[state->speech_rom_bit_address >> 3] >> (state->speech_rom_bit_address & 0x07)) & 0x01;
/* prepare for next bit */
@@ -471,7 +471,7 @@ static const tms5110_interface tms5100_interface =
static WRITE8_HANDLER( audio_command_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
LOG(("data %02x\n", data));
/* cause interrupt on audio CPU if bit 7 set */
@@ -1007,23 +1007,23 @@ static const s2636_interface s2636_2_config =
MACHINE_START( cvs )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
/* allocate memory */
- if (machine->gfx[1] != NULL)
- gfx_element_set_source(machine->gfx[1], state->character_ram);
+ if (machine.gfx[1] != NULL)
+ gfx_element_set_source(machine.gfx[1], state->character_ram);
start_393hz_timer(machine);
/* set devices */
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->speech = machine->device("speech");
- state->dac3 = machine->device("dac3");
- state->tms = machine->device("tms");
- state->s2636_0 = machine->device("s2636_0");
- state->s2636_1 = machine->device("s2636_1");
- state->s2636_2 = machine->device("s2636_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->speech = machine.device("speech");
+ state->dac3 = machine.device("dac3");
+ state->tms = machine.device("tms");
+ state->s2636_0 = machine.device("s2636_0");
+ state->s2636_1 = machine.device("s2636_1");
+ state->s2636_2 = machine.device("s2636_2");
/* register state save */
state->save_item(NAME(state->color_ram));
@@ -1042,7 +1042,7 @@ MACHINE_START( cvs )
MACHINE_RESET( cvs )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
state->character_banking_mode = 0;
state->character_ram_page_start = 0;
@@ -1592,7 +1592,7 @@ ROM_END
static DRIVER_INIT( huncholy )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0082] = 0xc0;
@@ -1612,7 +1612,7 @@ static DRIVER_INIT( huncholy )
static DRIVER_INIT( hunchbaka )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
offs_t offs;
@@ -1624,7 +1624,7 @@ static DRIVER_INIT( hunchbaka )
static DRIVER_INIT( superbik )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0079] = 0xc0;
@@ -1652,7 +1652,7 @@ static DRIVER_INIT( superbik )
static DRIVER_INIT( hero )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0087] = 0xc0;
@@ -1674,7 +1674,7 @@ static DRIVER_INIT( hero )
static DRIVER_INIT( raiders )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
offs_t offs;
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index 4721c0a6f52..3b19c45c4d6 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -35,9 +35,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "maincpu", 1, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "extra", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -45,7 +45,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( cyberbal )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_init(machine);
state->save_item(NAME(state->fast_68k_int));
@@ -59,13 +59,13 @@ static MACHINE_START( cyberbal )
static MACHINE_RESET( cyberbal )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, cyberbal_scanline_update, 8);
+ atarigen_sound_io_reset(machine.device("audiocpu"));
cyberbal_sound_reset(machine);
@@ -74,9 +74,9 @@ static MACHINE_RESET( cyberbal )
}
-static void cyberbal2p_update_interrupts(running_machine *machine)
+static void cyberbal2p_update_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -84,11 +84,11 @@ static void cyberbal2p_update_interrupts(running_machine *machine)
static MACHINE_RESET( cyberbal2p )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, cyberbal2p_update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, cyberbal_scanline_update, 8);
atarijsa_reset();
}
@@ -102,8 +102,8 @@ static MACHINE_RESET( cyberbal2p )
static READ16_HANDLER( special_port0_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "IN0");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "IN0");
if (state->cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -111,8 +111,8 @@ static READ16_HANDLER( special_port0_r )
static READ16_HANDLER( special_port2_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "IN2");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "IN2");
if (state->cpu_to_sound_ready) temp ^= 0x2000;
return temp;
}
@@ -120,7 +120,7 @@ static READ16_HANDLER( special_port2_r )
static READ16_HANDLER( sound_state_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = 0xffff;
if (state->cpu_to_sound_ready) temp ^= 0xffff;
return temp;
@@ -136,7 +136,7 @@ static READ16_HANDLER( sound_state_r )
static WRITE16_HANDLER( p2_reset_w )
{
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, CLEAR_LINE);
}
@@ -1009,13 +1009,13 @@ ROM_END
static DRIVER_INIT( cyberbal )
{
- atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 0);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x018000, 0, 0);
}
static DRIVER_INIT( cyberbalt )
{
- atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 116);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x018000, 0, 116);
}
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 90407cec5f8..c72b547cd3f 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -190,7 +190,7 @@ public:
static TILE_GET_INFO( get_tx_tile_info )
{
- cybertnk_state *state = machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = machine.driver_data<cybertnk_state>();
int code = state->tx_vram[tile_index];
SET_TILE_INFO(
0,
@@ -201,7 +201,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( cybertnk )
{
- cybertnk_state *state = machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = machine.driver_data<cybertnk_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows,8,8,128,32);
tilemap_set_transparent_pen(state->tx_tilemap,0);
}
@@ -218,9 +218,9 @@ static void draw_pixel( bitmap_t* bitmap, const rectangle *cliprect, int y, int
static SCREEN_UPDATE( cybertnk )
{
- cybertnk_state *state = screen->machine->driver_data<cybertnk_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ cybertnk_state *state = screen->machine().driver_data<cybertnk_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
int screen_shift = 0;
if (screen==left_screen)
@@ -236,11 +236,11 @@ static SCREEN_UPDATE( cybertnk )
tilemap_set_scrolldx(state->tx_tilemap, screen_shift, screen_shift);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
{
int i;
- const gfx_element *gfx = screen->machine->gfx[3];
+ const gfx_element *gfx = screen->machine().gfx[3];
for (i=0;i<0x1000/4;i+=4)
@@ -258,7 +258,7 @@ static SCREEN_UPDATE( cybertnk )
{
int count,x,y;
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
count = 0;
@@ -279,7 +279,7 @@ static SCREEN_UPDATE( cybertnk )
{
int count,x,y;
- const gfx_element *gfx = screen->machine->gfx[1];
+ const gfx_element *gfx = screen->machine().gfx[1];
count = 0;
@@ -301,7 +301,7 @@ static SCREEN_UPDATE( cybertnk )
/* non-tile based spriteram (BARE-BONES, looks pretty complex) */
if(1)
{
- const UINT8 *blit_ram = screen->machine->region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base();
int offs,x,y,z,xsize,ysize,yi,xi,col_bank,fx,zoom;
UINT32 spr_offs,spr_offs_helper;
int xf,yf,xz,yz;
@@ -354,11 +354,11 @@ static SCREEN_UPDATE( cybertnk )
dot|= col_bank<<4;
if(fx)
{
- draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]);
}
else
{
- draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]);
}
}
xf+=zoom;
@@ -386,11 +386,11 @@ static SCREEN_UPDATE( cybertnk )
dot|= col_bank<<4;
if(fx)
{
- draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]);
}
else
{
- draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]);
}
}
xf+=zoom;
@@ -433,47 +433,47 @@ static SCREEN_UPDATE( cybertnk )
if(0) //sprite gfx debug viewer
{
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed_once(screen->machine, KEYCODE_T))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_T))
state->start_offs+=0x20000;
- if(input_code_pressed_once(screen->machine, KEYCODE_Y))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Y))
state->start_offs-=0x20000;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs+=4;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs-=4;
- if(input_code_pressed(screen->machine, KEYCODE_D))
+ if(input_code_pressed(screen->machine(), KEYCODE_D))
state->color_pen++;
- if(input_code_pressed(screen->machine, KEYCODE_F))
+ if(input_code_pressed(screen->machine(), KEYCODE_F))
state->color_pen--;
popmessage("%02x %02x %04x %02x",state->test_x,state->test_y,state->start_offs,state->color_pen);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -490,28 +490,28 @@ static SCREEN_UPDATE( cybertnk )
color|= ((blit_ram[count+3] & 0xff) << 0);
dot = (color & 0xf0000000) >> 28;
- *BITMAP_ADDR16(bitmap, y, x+0) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+0) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0f000000) >> 24;
- *BITMAP_ADDR16(bitmap, y, x+4) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+4) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x00f00000) >> 20;
- *BITMAP_ADDR16(bitmap, y, x+1) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+1) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x000f0000) >> 16;
- *BITMAP_ADDR16(bitmap, y, x+5) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+5) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0000f000) >> 12;
- *BITMAP_ADDR16(bitmap, y, x+2) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+2) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x00000f00) >> 8;
- *BITMAP_ADDR16(bitmap, y, x+6) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+6) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x000000f0) >> 4;
- *BITMAP_ADDR16(bitmap, y, x+3) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+3) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0000000f) >> 0;
- *BITMAP_ADDR16(bitmap, y, x+7) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+7) = screen->machine().pens[dot+(state->color_pen<<4)];
count+=4;
}
@@ -526,18 +526,18 @@ static SCREEN_UPDATE( cybertnk )
static WRITE16_HANDLER( tx_vram_w )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
COMBINE_DATA(&state->tx_vram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static READ16_HANDLER( io_r )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
switch( offset )
{
case 2/2:
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
// 0x00110007 is controller device select
// 0x001100D5 is controller data
@@ -546,15 +546,15 @@ static READ16_HANDLER( io_r )
switch( (state->io_ram[6/2]) & 0xff )
{
case 0:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "TRAVERSE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "TRAVERSE");
break;
case 0x20:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "ELEVATE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "ELEVATE");
break;
case 0x40:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "ACCEL");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "ACCEL");
break;
case 0x42:
@@ -566,7 +566,7 @@ static READ16_HANDLER( io_r )
break;
case 0x60:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "HANDLE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "HANDLE");
break;
//default:
@@ -575,13 +575,13 @@ static READ16_HANDLER( io_r )
return 0;
case 6/2:
- return input_port_read(space->machine, "IN0"); // high half
+ return input_port_read(space->machine(), "IN0"); // high half
case 8/2:
- return input_port_read(space->machine, "IN0"); // low half
+ return input_port_read(space->machine(), "IN0"); // low half
case 0xa/2:
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
case 0xd4/2:
return state->io_ram[offset]; // controller data
@@ -596,7 +596,7 @@ static READ16_HANDLER( io_r )
static WRITE16_HANDLER( io_w )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
COMBINE_DATA(&state->io_ram[offset]);
switch( offset )
@@ -604,7 +604,7 @@ static WRITE16_HANDLER( io_w )
case 0/2:
// sound data
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
else
LOG_UNKNOWN_WRITE
break;
@@ -669,7 +669,7 @@ static WRITE16_HANDLER( io_w )
static READ8_HANDLER( soundport_r )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
return state->io_ram[0] & 0xff;
}
@@ -1003,7 +1003,7 @@ DRIVER_INIT( cybertnk )
UINT8* road_data;
int i;
- road_data = machine->region("road_data")->base();
+ road_data = machine.region("road_data")->base();
for (i=0;i < 0x40000;i++)
{
road_data[i] = BITSWAP8(road_data[i],3,2,1,0,7,6,5,4);
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index 78964e5ba17..04ed58d9311 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -123,10 +123,10 @@ static VIDEO_START( cyclemb )
static SCREEN_UPDATE( cyclemb )
{
- cyclemb_state *state = screen->machine->driver_data<cyclemb_state>();
+ cyclemb_state *state = screen->machine().driver_data<cyclemb_state>();
int x,y,count;
- const gfx_element *gfx = screen->machine->gfx[0];
- UINT8 flip_screen = flip_screen_get(screen->machine);
+ const gfx_element *gfx = screen->machine().gfx[0];
+ UINT8 flip_screen = flip_screen_get(screen->machine());
count = 0;
@@ -208,7 +208,7 @@ static SCREEN_UPDATE( cyclemb )
fx = !fx;
fy = !fy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[region],spr_offs,col,fx,fy,x,y,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[region],spr_offs,col,fx,fy,x,y,0);
}
}
@@ -217,14 +217,14 @@ static SCREEN_UPDATE( cyclemb )
static WRITE8_HANDLER( cyclemb_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 3);
+ memory_set_bank(space->machine(), "bank1", data & 3);
}
#if 0
static WRITE8_HANDLER( sound_cmd_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
#endif
@@ -238,13 +238,13 @@ static READ8_HANDLER( mcu_status_r )
static WRITE8_HANDLER( sound_cmd_w ) //actually ciom
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
#endif
static WRITE8_HANDLER( cyclemb_flip_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
// a bunch of other things are setted here
}
@@ -604,7 +604,7 @@ ROM_END
static DRIVER_INIT( cyclemb )
{
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x1000);
}
GAME( 1984, cyclemb, 0, cyclemb, cyclemb, cyclemb, ROT0, "Taito Corporation", "Cycle Mahbou (Japan)", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c
index fab6513221e..23fb7ecc8d8 100644
--- a/src/mame/drivers/d9final.c
+++ b/src/mame/drivers/d9final.c
@@ -40,7 +40,7 @@ public:
static TILE_GET_INFO( get_sc0_tile_info )
{
- d9final_state *state = machine->driver_data<d9final_state>();
+ d9final_state *state = machine.driver_data<d9final_state>();
int tile = ((state->hi_vram[tile_index] & 0x3f)<<8) | state->lo_vram[tile_index];
int color = state->cram[tile_index] & 0x3f;
@@ -53,45 +53,45 @@ static TILE_GET_INFO( get_sc0_tile_info )
static VIDEO_START(d9final)
{
- d9final_state *state = machine->driver_data<d9final_state>();
+ d9final_state *state = machine.driver_data<d9final_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,64,32);
}
static SCREEN_UPDATE(d9final)
{
- d9final_state *state = screen->machine->driver_data<d9final_state>();
+ d9final_state *state = screen->machine().driver_data<d9final_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
return 0;
}
static WRITE8_HANDLER( sc0_lovram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->lo_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_hivram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->hi_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_cram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->cram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( d9final_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000+(0x4000 * (data & 0x7));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
/* game checks this after three attract cycles, otherwise coin inputs stop to work. */
@@ -268,7 +268,7 @@ GFXDECODE_END
static MACHINE_RESET( d9final )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0x10000]);
}
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index 8a730738598..eafc26817fd 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -56,43 +56,43 @@ public:
static WRITE8_HANDLER( background_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( foreground_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( bg_bank_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
if ((data & 3) != state->bg_bank)
{
state->bg_bank = data & 3;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- flip_screen_set(space->machine, data & 0xc); // probably one bit for flipx and one for flipy
+ flip_screen_set(space->machine(), data & 0xc); // probably one bit for flipx and one for flipy
}
static WRITE8_HANDLER( coins_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
- set_led_status(space->machine, 0, data & 4);
- set_led_status(space->machine, 1, data & 8);
+ set_led_status(space->machine(), 0, data & 4);
+ set_led_status(space->machine(), 1, data & 8);
}
static WRITE8_HANDLER(snd_w)
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -128,32 +128,32 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( adpcm_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->msm_data = data;
state->msm_toggle = 0;
}
static WRITE8_HANDLER( snd_ack_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->snd_ack = data;
}
static CUSTOM_INPUT( snd_ack_r )
{
- dacholer_state *state = field->port->machine->driver_data<dacholer_state>();
+ dacholer_state *state = field->port->machine().driver_data<dacholer_state>();
return state->snd_ack; //guess ...
}
static WRITE8_HANDLER( snd_irq_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->snd_interrupt_enable = data;
}
static WRITE8_HANDLER( music_irq_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->music_interrupt_enable = data;
}
@@ -311,28 +311,28 @@ INPUT_PORTS_END
static TILE_GET_INFO( get_bg_tile_info )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
SET_TILE_INFO(1, state->bgvideoram[tile_index] + state->bg_bank * 0x100, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
SET_TILE_INFO(0, state->fgvideoram[tile_index], 0, 0);
}
static VIDEO_START( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
int offs, code, attr, sx, sy, flipx, flipy;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -354,7 +354,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code,
0,
flipx,flipy,
@@ -364,10 +364,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(dacholer)
{
- dacholer_state *state = screen->machine->driver_data<dacholer_state>();
+ dacholer_state *state = screen->machine().driver_data<dacholer_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -403,7 +403,7 @@ GFXDECODE_END
static INTERRUPT_GEN( sound_irq )
{
- dacholer_state *state = device->machine->driver_data<dacholer_state>();
+ dacholer_state *state = device->machine().driver_data<dacholer_state>();
if (state->music_interrupt_enable == 1)
{
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x30);
@@ -412,7 +412,7 @@ static INTERRUPT_GEN( sound_irq )
static void adpcm_int( device_t *device )
{
- dacholer_state *state = device->machine->driver_data<dacholer_state>();
+ dacholer_state *state = device->machine().driver_data<dacholer_state>();
if (state->snd_interrupt_enable == 1 || (state->snd_interrupt_enable == 0 && state->msm_toggle == 1))
{
msm5205_data_w(device, state->msm_data >> 4);
@@ -435,9 +435,9 @@ static const msm5205_interface msm_interface =
static MACHINE_START( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bg_bank));
state->save_item(NAME(state->msm_data));
@@ -449,7 +449,7 @@ static MACHINE_START( dacholer )
static MACHINE_RESET( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
state->msm_data = 0;
state->msm_toggle = 0;
@@ -474,7 +474,7 @@ static PALETTE_INIT( dacholer )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
diff --git a/src/mame/drivers/dai3wksi.c b/src/mame/drivers/dai3wksi.c
index f0a0fc2f4de..216baf7e3b6 100644
--- a/src/mame/drivers/dai3wksi.c
+++ b/src/mame/drivers/dai3wksi.c
@@ -125,7 +125,7 @@ static void dai3wksi_get_pens(pen_t *pens)
static SCREEN_UPDATE( dai3wksi )
{
- dai3wksi_state *state = screen->machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = screen->machine().driver_data<dai3wksi_state>();
offs_t offs;
pen_t pens[8];
@@ -147,7 +147,7 @@ static SCREEN_UPDATE( dai3wksi )
}
else
{
- if (input_port_read(screen->machine, "IN2") & 0x03)
+ if (input_port_read(screen->machine(), "IN2") & 0x03)
color = vr_prom2[value];
else
color = vr_prom1[value];
@@ -196,8 +196,8 @@ static SCREEN_UPDATE( dai3wksi )
#if (USE_SAMPLES)
static WRITE8_HANDLER( dai3wksi_audio_1_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~state->port_last1;
state->enabled_sound = data & 0x80;
@@ -217,8 +217,8 @@ static WRITE8_HANDLER( dai3wksi_audio_1_w )
static WRITE8_HANDLER( dai3wksi_audio_2_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~state->port_last2;
state->dai3wksi_flipscreen = data & 0x10;
@@ -246,8 +246,8 @@ static WRITE8_HANDLER( dai3wksi_audio_2_w )
static WRITE8_HANDLER( dai3wksi_audio_3_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
if (state->enabled_sound)
{
@@ -284,9 +284,9 @@ static const samples_interface dai3wksi_samples_interface =
static WRITE8_HANDLER( dai3wksi_audio_1_w )
{
- device_t *ic79 = space->machine->device("ic79");
+ device_t *ic79 = space->machine().device("ic79");
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
sn76477_enable_w(ic79, (~data >> 5) & 0x01); /* invader movement enable */
sn76477_envelope_1_w(ic79, (~data >> 2) & 0x01); /* invader movement envelope control*/
@@ -295,10 +295,10 @@ static WRITE8_HANDLER( dai3wksi_audio_1_w )
static WRITE8_HANDLER( dai3wksi_audio_2_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *ic77 = space->machine->device("ic77");
- device_t *ic78 = space->machine->device("ic78");
- device_t *ic80 = space->machine->device("ic80");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *ic77 = space->machine().device("ic77");
+ device_t *ic78 = space->machine().device("ic78");
+ device_t *ic80 = space->machine().device("ic80");
state->dai3wksi_flipscreen = data & 0x10;
state->dai3wksi_redscreen = ~data & 0x20;
@@ -312,7 +312,7 @@ static WRITE8_HANDLER( dai3wksi_audio_2_w )
static WRITE8_HANDLER( dai3wksi_audio_3_w )
{
- device_t *ic81 = space->machine->device("ic81");
+ device_t *ic81 = space->machine().device("ic81");
sn76477_enable_w(ic81, (~data >> 2) & 0x01); /* player shoot enable */
sn76477_vco_w(ic81, (~data >> 3) & 0x01); /* player shoot vco control */
@@ -564,7 +564,7 @@ INPUT_PORTS_END
static MACHINE_START( dai3wksi )
{
- dai3wksi_state *state = machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = machine.driver_data<dai3wksi_state>();
/* Set up save state */
state->save_item(NAME(state->dai3wksi_flipscreen));
@@ -578,7 +578,7 @@ static MACHINE_START( dai3wksi )
static MACHINE_RESET( dai3wksi )
{
- dai3wksi_state *state = machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = machine.driver_data<dai3wksi_state>();
state->port_last1 = 0;
state->port_last2 = 0;
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index f3c32cbe6a3..aa62f1b5141 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -68,7 +68,7 @@ public:
/* FIXME: Really needed? - Should be handled by either interface */
static WRITE8_DEVICE_HANDLER( dambustr_noise_enable_w )
{
- dambustr_state *state = device->machine->driver_data<dambustr_state>();
+ dambustr_state *state = device->machine().driver_data<dambustr_state>();
if (data != state->noise_data) {
state->noise_data = data;
galaxian_noise_enable_w(device, offset, data);
@@ -205,9 +205,9 @@ static DRIVER_INIT(dambustr)
{
int i, j, tmp;
int tmpram[16];
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *usr = machine->region("user1")->base();
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *usr = machine.region("user1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
// Bit swap addresses
for(i=0; i<4096*4; i++) {
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index 4e248a47bee..8821568e1de 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -139,25 +139,25 @@ sounds.
#include "darius.lh"
-static void parse_control( running_machine *machine ) /* assumes Z80 sandwiched between 68Ks */
+static void parse_control( running_machine &machine ) /* assumes Z80 sandwiched between 68Ks */
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_set_input_line(state->cpub, INPUT_LINE_RESET, (state->cpua_ctrl & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( cpua_ctrl_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
if ((data & 0xff00) && ((data & 0xff) == 0))
data = data >> 8;
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data);
}
@@ -174,7 +174,7 @@ static WRITE16_HANDLER( darius_watchdog_w )
static READ16_HANDLER( darius_ioc_r )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
switch (offset)
{
@@ -182,19 +182,19 @@ static READ16_HANDLER( darius_ioc_r )
return (tc0140syt_comm_r(state->tc0140syt, 0) & 0xff); /* sound interface read */
case 0x04:
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
case 0x05:
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
case 0x06:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x07:
return state->coin_word; /* bits 3&4 coin lockouts, must return zero */
case 0x08:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(space->cpu),offset);
@@ -204,7 +204,7 @@ logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(
static WRITE16_HANDLER( darius_ioc_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
switch (offset)
{
@@ -225,10 +225,10 @@ static WRITE16_HANDLER( darius_ioc_w )
case 0x30: /* coin control */
/* bits 7,5,4,0 used on reset */
/* bit 4 used whenever bg is blanked ? */
- coin_lockout_w(space->machine, 0, ~data & 0x02);
- coin_lockout_w(space->machine, 1, ~data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_lockout_w(space->machine(), 0, ~data & 0x02);
+ coin_lockout_w(space->machine(), 1, ~data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x40);
state->coin_word = data & 0xffff;
//popmessage(" address %04x value %04x",offset,data);
return;
@@ -274,25 +274,25 @@ ADDRESS_MAP_END
SOUND
*****************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
memory_set_bank(machine, "bank1", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->banknum = data & 0x03;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
// banknum = data;
// reset_sound_region();
}
static WRITE8_HANDLER( adpcm_command_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->adpcm_command = data;
/* logerror("#ADPCM command write =%2x\n",data); */
}
@@ -309,9 +309,9 @@ static WRITE8_HANDLER( display_value )
Sound mixer/pan control
*****************************************************/
-static void update_fm0( running_machine *machine )
+static void update_fm0( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = ( state->pan[0] * state->vol[6]) >> 8;
int right = ((0xff - state->pan[0]) * state->vol[6]) >> 8;
@@ -321,9 +321,9 @@ static void update_fm0( running_machine *machine )
flt_volume_set_volume(state->filter0_3r, right / 100.0); /* FM #0 */
}
-static void update_fm1( running_machine *machine )
+static void update_fm1( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = ( state->pan[1] * state->vol[7]) >> 8;
int right = ((0xff - state->pan[1]) * state->vol[7]) >> 8;
@@ -333,9 +333,9 @@ static void update_fm1( running_machine *machine )
flt_volume_set_volume(state->filter1_3r, right / 100.0); /* FM #1 */
}
-static void update_psg0( running_machine *machine, int port )
+static void update_psg0( running_machine &machine, int port )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_t *lvol = NULL, *rvol = NULL;
int left, right;
@@ -356,9 +356,9 @@ static void update_psg0( running_machine *machine, int port )
flt_volume_set_volume(rvol, right / 100.0);
}
-static void update_psg1( running_machine *machine, int port )
+static void update_psg1( running_machine &machine, int port )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_t *lvol = NULL, *rvol = NULL;
int left, right;
@@ -379,9 +379,9 @@ static void update_psg1( running_machine *machine, int port )
flt_volume_set_volume(rvol, right / 100.0);
}
-static void update_da( running_machine *machine )
+static void update_da( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = state->def_vol[(state->pan[4] >> 4) & 0x0f];
int right = state->def_vol[(state->pan[4] >> 0) & 0x0f];
@@ -393,48 +393,48 @@ static void update_da( running_machine *machine )
static WRITE8_HANDLER( darius_fm0_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[0] = data & 0xff; /* data 0x00:right 0xff:left */
- update_fm0(space->machine);
+ update_fm0(space->machine());
}
static WRITE8_HANDLER( darius_fm1_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[1] = data & 0xff;
- update_fm1(space->machine);
+ update_fm1(space->machine());
}
static WRITE8_HANDLER( darius_psg0_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[2] = data & 0xff;
- update_psg0(space->machine, 0);
- update_psg0(space->machine, 1);
- update_psg0(space->machine, 2);
+ update_psg0(space->machine(), 0);
+ update_psg0(space->machine(), 1);
+ update_psg0(space->machine(), 2);
}
static WRITE8_HANDLER( darius_psg1_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[3] = data & 0xff;
- update_psg1(space->machine, 0);
- update_psg1(space->machine, 1);
- update_psg1(space->machine, 2);
+ update_psg1(space->machine(), 0);
+ update_psg1(space->machine(), 1);
+ update_psg1(space->machine(), 2);
}
static WRITE8_HANDLER( darius_da_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[4] = data & 0xff;
- update_da(space->machine);
+ update_da(space->machine());
}
/**** Mixer Control ****/
static WRITE8_DEVICE_HANDLER( darius_write_portA0 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control FM #0 PSG #0 A
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
@@ -442,47 +442,47 @@ static WRITE8_DEVICE_HANDLER( darius_write_portA0 )
state->vol[0] = state->def_vol[(data >> 4) & 0x0f];
state->vol[6] = state->def_vol[(data >> 0) & 0x0f];
- update_fm0(device->machine);
- update_psg0(device->machine, 0);
+ update_fm0(device->machine());
+ update_psg0(device->machine(), 0);
}
static WRITE8_DEVICE_HANDLER( darius_write_portA1 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control FM #1 PSG #1 A
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[3] = state->def_vol[(data >> 4) & 0x0f];
state->vol[7] = state->def_vol[(data >> 0) & 0x0f];
- update_fm1(device->machine);
- update_psg1(device->machine, 0);
+ update_fm1(device->machine());
+ update_psg1(device->machine(), 0);
}
static WRITE8_DEVICE_HANDLER( darius_write_portB0 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control PSG #0 B/C
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[1] = state->def_vol[(data >> 4) & 0x0f];
state->vol[2] = state->def_vol[(data >> 0) & 0x0f];
- update_psg0(device->machine, 1);
- update_psg0(device->machine, 2);
+ update_psg0(device->machine(), 1);
+ update_psg0(device->machine(), 2);
}
static WRITE8_DEVICE_HANDLER( darius_write_portB1 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control PSG #1 B/C
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[4] = state->def_vol[(data >> 4) & 0x0f];
state->vol[5] = state->def_vol[(data >> 0) & 0x0f];
- update_psg1(device->machine, 1);
- update_psg1(device->machine, 2);
+ update_psg1(device->machine(), 1);
+ update_psg1(device->machine(), 2);
}
@@ -515,7 +515,7 @@ ADDRESS_MAP_END
static void darius_adpcm_int( device_t *device )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
if (state->nmi_enable)
device_set_input_line(state->adpcm, INPUT_LINE_NMI, PULSE_LINE);
@@ -529,7 +529,7 @@ static const msm5205_interface msm5205_config =
static READ8_HANDLER( adpcm_command_read )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
/* logerror("read port 0: %02x PC=%4x\n",adpcm_command, cpu_get_pc(space->cpu) ); */
return state->adpcm_command;
@@ -547,7 +547,7 @@ static READ8_HANDLER( readport3 )
static WRITE8_HANDLER( adpcm_nmi_disable )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->nmi_enable = 0;
/* logerror("write port 0: NMI DISABLE PC=%4x\n", data, cpu_get_pc(space->cpu) ); */
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( adpcm_nmi_disable )
static WRITE8_HANDLER( adpcm_nmi_enable )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->nmi_enable = 1;
/* logerror("write port 1: NMI ENABLE PC=%4x\n", cpu_get_pc(space->cpu) ); */
}
@@ -800,7 +800,7 @@ GFXDECODE_END
/* handler called by the YM2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq ) /* assumes Z80 sandwiched between 68Ks */
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -853,43 +853,43 @@ static STATE_POSTLOAD( darius_postload )
static MACHINE_START( darius )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x8000);
- memory_configure_bank(machine, "bank1", 4, 1, machine->region("audiocpu")->base(), 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank1", 4, 1, machine.region("audiocpu")->base(), 0x8000);
memory_set_bank(machine, "bank1", 4);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->cpub = machine->device("cpub");
- state->adpcm = machine->device("adpcm");
- state->pc080sn = machine->device("pc080sn");
- state->tc0140syt = machine->device("tc0140syt");
-
- state->lscreen = machine->device("lscreen");
- state->mscreen = machine->device("mscreen");
- state->rscreen = machine->device("rscreen");
-
- state->filter0_0l = machine->device("filter0.0l");
- state->filter0_0r = machine->device("filter0.0r");
- state->filter0_1l = machine->device("filter0.1l");
- state->filter0_1r = machine->device("filter0.1r");
- state->filter0_2l = machine->device("filter0.2l");
- state->filter0_2r = machine->device("filter0.2r");
- state->filter0_3l = machine->device("filter0.3l");
- state->filter0_3r = machine->device("filter0.3r");
-
- state->filter1_0l = machine->device("filter1.0l");
- state->filter1_0r = machine->device("filter1.0r");
- state->filter1_1l = machine->device("filter1.1l");
- state->filter1_1r = machine->device("filter1.1r");
- state->filter1_2l = machine->device("filter1.2l");
- state->filter1_2r = machine->device("filter1.2r");
- state->filter1_3l = machine->device("filter1.3l");
- state->filter1_3r = machine->device("filter1.3r");
-
- state->msm5205_l = machine->device("msm5205.l");
- state->msm5205_r = machine->device("msm5205.r");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->cpub = machine.device("cpub");
+ state->adpcm = machine.device("adpcm");
+ state->pc080sn = machine.device("pc080sn");
+ state->tc0140syt = machine.device("tc0140syt");
+
+ state->lscreen = machine.device("lscreen");
+ state->mscreen = machine.device("mscreen");
+ state->rscreen = machine.device("rscreen");
+
+ state->filter0_0l = machine.device("filter0.0l");
+ state->filter0_0r = machine.device("filter0.0r");
+ state->filter0_1l = machine.device("filter0.1l");
+ state->filter0_1r = machine.device("filter0.1r");
+ state->filter0_2l = machine.device("filter0.2l");
+ state->filter0_2r = machine.device("filter0.2r");
+ state->filter0_3l = machine.device("filter0.3l");
+ state->filter0_3r = machine.device("filter0.3r");
+
+ state->filter1_0l = machine.device("filter1.0l");
+ state->filter1_0r = machine.device("filter1.0r");
+ state->filter1_1l = machine.device("filter1.1l");
+ state->filter1_1r = machine.device("filter1.1r");
+ state->filter1_2l = machine.device("filter1.2l");
+ state->filter1_2r = machine.device("filter1.2r");
+ state->filter1_3l = machine.device("filter1.3l");
+ state->filter1_3r = machine.device("filter1.3r");
+
+ state->msm5205_l = machine.device("msm5205.l");
+ state->msm5205_r = machine.device("msm5205.r");
state->save_item(NAME(state->cpua_ctrl));
state->save_item(NAME(state->coin_word));
@@ -899,13 +899,13 @@ static MACHINE_START( darius )
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->vol));
state->save_item(NAME(state->pan));
- machine->state().register_postload(darius_postload, NULL);
+ machine.state().register_postload(darius_postload, NULL);
}
static MACHINE_RESET( darius )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int i;
state->cpua_ctrl = 0xff;
@@ -914,7 +914,7 @@ static MACHINE_RESET( darius )
state->adpcm_command = 0;
state->nmi_enable = 0;
- machine->sound().system_enable(true); /* mixer enabled */
+ machine.sound().system_enable(true); /* mixer enabled */
for (i = 0; i < DARIUS_VOL_MAX; i++)
state->vol[i] = 0x00; /* min volume */
@@ -1291,7 +1291,7 @@ ROM_END
static DRIVER_INIT( darius )
{
/**** setup sound bank image ****/
- UINT8 *RAM = machine->region("audiocpu")->base();
+ UINT8 *RAM = machine.region("audiocpu")->base();
int i;
for (i = 3; i >= 0; i--)
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 1f82fdecd15..34d620461ed 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -99,7 +99,7 @@ static SCREEN_UPDATE( darkhors );
static TILE_GET_INFO( get_tile_info_0 )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT16 tile = state->tmapram[tile_index] >> 16;
UINT16 color = state->tmapram[tile_index] & 0xffff;
SET_TILE_INFO(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT16 tile = state->tmapram2[tile_index] >> 16;
UINT16 color = state->tmapram2[tile_index] & 0xffff;
SET_TILE_INFO(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
@@ -115,20 +115,20 @@ static TILE_GET_INFO( get_tile_info_1 )
static WRITE32_HANDLER( darkhors_tmapram_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->tmapram[offset]);
tilemap_mark_tile_dirty(state->tmap, offset);
}
static WRITE32_HANDLER( darkhors_tmapram2_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->tmapram2[offset]);
tilemap_mark_tile_dirty(state->tmap2, offset);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT32 *s = state->spriteram;
UINT32 *end = state->spriteram + 0x02000/4;
@@ -155,7 +155,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = -sy;
sy += 0xf8;
- drawgfx_transpen( bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen( bitmap, cliprect, machine.gfx[0],
code/2, color,
flipx, flipy, sx, sy, 0);
}
@@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static VIDEO_START( darkhors )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
state->tmap = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows,
16,16, 0x40,0x40 );
@@ -173,26 +173,26 @@ static VIDEO_START( darkhors )
tilemap_set_transparent_pen(state->tmap, 0);
tilemap_set_transparent_pen(state->tmap2, 0);
- machine->gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
+ machine.gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
}
static SCREEN_UPDATE( darkhors )
{
- darkhors_state *state = screen->machine->driver_data<darkhors_state>();
+ darkhors_state *state = screen->machine().driver_data<darkhors_state>();
int layers_ctrl = -1;
#if DARKHORS_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_set_scrollx(state->tmap,0, (state->tmapscroll[0] >> 16) - 5);
tilemap_set_scrolly(state->tmap,0, (state->tmapscroll[0] & 0xffff) - 0xff );
@@ -202,7 +202,7 @@ static SCREEN_UPDATE( darkhors )
tilemap_set_scrolly(state->tmap2,0, (state->tmapscroll2[0] & 0xffff) - 0xff );
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->tmap2, 0, 0);
- if (layers_ctrl & 4) draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 4) draw_sprites(screen->machine(),bitmap,cliprect);
#if DARKHORS_DEBUG
#if 0
@@ -244,7 +244,7 @@ static const eeprom_interface eeprom_intf =
static WRITE32_DEVICE_HANDLER( darkhors_eeprom_w )
{
if (data & ~0xff000000)
- logerror("%s: Unknown EEPROM bit written %08X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %08X\n",device->machine().describe_context(),data);
if ( ACCESSING_BITS_24_31 )
{
@@ -267,7 +267,7 @@ static WRITE32_HANDLER( paletteram32_xBBBBBGGGGGRRRRR_dword_w )
static WRITE32_HANDLER( darkhors_input_sel_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->input_sel);
// if (ACCESSING_BITS_16_31) popmessage("%04X",data >> 16);
}
@@ -290,14 +290,14 @@ static int mask_to_bit( int mask )
static READ32_HANDLER( darkhors_input_sel_r )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
// from bit mask to bit number
int bit_p1 = mask_to_bit((state->input_sel & 0x00ff0000) >> 16);
int bit_p2 = mask_to_bit((state->input_sel & 0xff000000) >> 24);
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
- return (input_port_read(space->machine, portnames[bit_p1]) & 0x00ffffff) |
- (input_port_read(space->machine, portnames[bit_p2]) & 0xff000000) ;
+ return (input_port_read(space->machine(), portnames[bit_p1]) & 0x00ffffff) |
+ (input_port_read(space->machine(), portnames[bit_p2]) & 0xff000000) ;
}
static WRITE32_HANDLER( darkhors_unk1_w )
@@ -336,9 +336,9 @@ ADDRESS_MAP_END
static WRITE32_HANDLER( jclub2_tileram_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->jclub2_tileram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[state->jclub2_gfx_index], offset/(256/4));
+ gfx_element_mark_dirty(space->machine().gfx[state->jclub2_gfx_index], offset/(256/4));
}
@@ -677,16 +677,16 @@ MACHINE_CONFIG_END
static VIDEO_START(jclub2)
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
/* find first empty slot to decode gfx */
for (state->jclub2_gfx_index = 0; state->jclub2_gfx_index < MAX_GFX_ELEMENTS; state->jclub2_gfx_index++)
- if (machine->gfx[state->jclub2_gfx_index] == 0)
+ if (machine.gfx[state->jclub2_gfx_index] == 0)
break;
assert(state->jclub2_gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[state->jclub2_gfx_index] = gfx_element_alloc(machine, &layout_16x16x8_jclub2, (UINT8 *)state->jclub2_tileram, machine->total_colors() / 16, 0);
+ machine.gfx[state->jclub2_gfx_index] = gfx_element_alloc(machine, &layout_16x16x8_jclub2, (UINT8 *)state->jclub2_tileram, machine.total_colors() / 16, 0);
}
@@ -945,8 +945,8 @@ ROM_END
static DRIVER_INIT( darkhors )
{
- UINT32 *rom = (UINT32 *) machine->region("maincpu")->base();
- UINT8 *eeprom = (UINT8 *) machine->region("eeprom")->base();
+ UINT32 *rom = (UINT32 *) machine.region("maincpu")->base();
+ UINT8 *eeprom = (UINT8 *) machine.region("eeprom")->base();
int i;
#if 1
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index 3ba30535e54..ab2094934e5 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -32,9 +32,9 @@ TODO:
static WRITE8_HANDLER(darkmist_hw_w)
{
- darkmist_state *state = space->machine->driver_data<darkmist_state>();
+ darkmist_state *state = space->machine().driver_data<darkmist_state>();
state->hw=data;
- memory_set_bankptr(space->machine, "bank1",&space->machine->region("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
+ memory_set_bankptr(space->machine(), "bank1",&space->machine().region("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8 )
@@ -313,15 +313,15 @@ ROM_START( darkmist )
ROM_END
-static void decrypt_gfx(running_machine *machine)
+static void decrypt_gfx(running_machine &machine)
{
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x40000);
UINT8 *rom;
int size;
int i;
- rom = machine->region("gfx1")->base();
- size = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ size = machine.region("gfx1")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -343,8 +343,8 @@ static void decrypt_gfx(running_machine *machine)
}
- rom = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -366,8 +366,8 @@ static void decrypt_gfx(running_machine *machine)
}
- rom = machine->region("gfx3")->base();
- size = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ size = machine.region("gfx3")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -391,10 +391,10 @@ static void decrypt_gfx(running_machine *machine)
auto_free(machine, buf);
}
-static void decrypt_snd(running_machine *machine)
+static void decrypt_snd(running_machine &machine)
{
int i;
- UINT8 *ROM = machine->region("t5182")->base();
+ UINT8 *ROM = machine.region("t5182")->base();
for(i=0x8000;i<0x10000;i++)
ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
@@ -402,9 +402,9 @@ static void decrypt_snd(running_machine *machine)
static DRIVER_INIT(darkmist)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, len;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x10000);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
@@ -437,11 +437,11 @@ static DRIVER_INIT(darkmist)
}
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
- memory_set_bankptr(space->machine, "bank1",&ROM[0x010000]);
+ memory_set_bankptr(space->machine(), "bank1",&ROM[0x010000]);
/* adr line swaps */
- ROM = machine->region("user1")->base();
- len = machine->region("user1")->bytes();
+ ROM = machine.region("user1")->base();
+ len = machine.region("user1")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
@@ -449,24 +449,24 @@ static DRIVER_INIT(darkmist)
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine->region("user2")->base();
- len = machine->region("user2")->bytes();
+ ROM = machine.region("user2")->base();
+ len = machine.region("user2")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine->region("user3")->base();
- len = machine->region("user3")->bytes();
+ ROM = machine.region("user3")->base();
+ len = machine.region("user3")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14 ,5,4,3,2,11,10,9,8,13,12,1,0,7,6)];
}
- ROM = machine->region("user4")->base();
- len = machine->region("user4")->bytes();
+ ROM = machine.region("user4")->base();
+ len = machine.region("user4")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 31e34434a3b..c1046888617 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -33,7 +33,7 @@ static WRITE16_HANDLER( darkseal_control_w )
return;
case 8: /* Sound CPU write */
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
case 0xa: /* IRQ Ack (VBL) */
return;
@@ -45,13 +45,13 @@ static READ16_HANDLER( darkseal_control_r )
switch (offset<<1)
{
case 0:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 2:
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 4:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
return ~0;
@@ -224,7 +224,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, state); /* IRQ 2 */
}
static const ym2151_interface ym2151_config =
@@ -475,7 +475,7 @@ ROM_END
static DRIVER_INIT( darkseal )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
for (i=0x00000; i<0x80000; i++)
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index 5f03dce4651..98fd42ca4f6 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -138,19 +138,19 @@ static READ16_HANDLER( dassault_control_r )
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Player 3 & Player 4 joysticks & fire buttons */
- return input_port_read(space->machine, "P3_P4");
+ return input_port_read(space->machine(), "P3_P4");
case 4: /* Dip 1 (stored at 0x3f8035) */
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
case 6: /* Dip 2 (stored at 0x3f8034) */
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
case 8: /* VBL, Credits */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
return 0xffff;
@@ -158,19 +158,19 @@ static READ16_HANDLER( dassault_control_r )
static WRITE16_HANDLER( dassault_control_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0xfffe)
logerror("Coin cointrol %04x\n", data);
}
static READ16_HANDLER( dassault_sub_control_r )
{
- return input_port_read(space->machine, "VBLANK1");
+ return input_port_read(space->machine(), "VBLANK1");
}
static WRITE16_HANDLER( dassault_sound_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE); /* IRQ1 */
}
@@ -178,7 +178,7 @@ static WRITE16_HANDLER( dassault_sound_w )
/* The CPU-CPU irq controller is overlaid onto the end of the shared memory */
static READ16_HANDLER( dassault_irq_r )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, 5, CLEAR_LINE); break;
@@ -189,7 +189,7 @@ static READ16_HANDLER( dassault_irq_r )
static WRITE16_HANDLER( dassault_irq_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, 5, ASSERT_LINE); break;
@@ -201,13 +201,13 @@ static WRITE16_HANDLER( dassault_irq_w )
static WRITE16_HANDLER( shared_ram_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
COMBINE_DATA(&state->shared_ram[offset]);
}
static READ16_HANDLER( shared_ram_r )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
return state->shared_ram[offset];
}
@@ -513,13 +513,13 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- dassault_state *driver_state = device->machine->driver_data<dassault_state>();
+ dassault_state *driver_state = device->machine().driver_data<dassault_state>();
device_set_input_line(driver_state->audiocpu, 1, state);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- dassault_state *state = device->machine->driver_data<dassault_state>();
+ dassault_state *state = device->machine().driver_data<dassault_state>();
/* the second OKIM6295 ROM is bank switched */
state->oki2->set_bank_base((data & 1) * 0x40000);
@@ -828,7 +828,7 @@ ROM_END
static READ16_HANDLER( dassault_main_skip )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
int ret = state->ram[0];
if (cpu_get_previouspc(space->cpu) == 0x1170 && ret & 0x8000)
@@ -839,7 +839,7 @@ static READ16_HANDLER( dassault_main_skip )
static READ16_HANDLER( thndzone_main_skip )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
int ret = state->ram[0];
if (cpu_get_pc(space->cpu) == 0x114c && ret & 0x8000)
@@ -850,8 +850,8 @@ static READ16_HANDLER( thndzone_main_skip )
static DRIVER_INIT( dassault )
{
- const UINT8 *src = machine->region("gfx1")->base();
- UINT8 *dst = machine->region("gfx2")->base();
+ const UINT8 *src = machine.region("gfx1")->base();
+ UINT8 *dst = machine.region("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
@@ -865,13 +865,13 @@ static DRIVER_INIT( dassault )
auto_free(machine, tmp);
/* Save time waiting on vblank bit */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(dassault_main_skip));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(dassault_main_skip));
}
static DRIVER_INIT( thndzone )
{
- const UINT8 *src = machine->region("gfx1")->base();
- UINT8 *dst = machine->region("gfx2")->base();
+ const UINT8 *src = machine.region("gfx1")->base();
+ UINT8 *dst = machine.region("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
@@ -885,7 +885,7 @@ static DRIVER_INIT( thndzone )
auto_free(machine, tmp);
/* Save time waiting on vblank bit */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(thndzone_main_skip));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(thndzone_main_skip));
}
/**********************************************************************************/
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index 6403f10a565..5a2ca651c01 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -89,18 +89,18 @@ UINT16 dblwings_pri_callback(UINT16 x)
static SCREEN_UPDATE(dblewing)
{
- dblewing_state *state = screen->machine->driver_data<dblewing_state>();
+ dblewing_state *state = screen->machine().driver_data<dblewing_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
return 0;
}
@@ -116,7 +116,7 @@ static SCREEN_UPDATE(dblewing)
*/
static READ16_HANDLER ( dblewing_prot_r )
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
switch (offset * 2)
{
@@ -135,11 +135,11 @@ static READ16_HANDLER ( dblewing_prot_r )
case 0x330: return 0; // controls bonuses such as shoot type,bombs etc.
case 0x1d4: return state->_70c_data; //controls restart points
- case 0x0ac: return (input_port_read(space->machine, "DSW") & 0x40) << 4;//flip screen
+ case 0x0ac: return (input_port_read(space->machine(), "DSW") & 0x40) << 4;//flip screen
case 0x4b0: return state->_608_data;//coinage
case 0x068:
{
- switch (input_port_read(space->machine, "DSW") & 0x0300) //I don't know how to relationate this...
+ switch (input_port_read(space->machine(), "DSW") & 0x0300) //I don't know how to relationate this...
{
case 0x0000: return 0x000;//0
case 0x0100: return 0x060;//3
@@ -149,12 +149,12 @@ static READ16_HANDLER ( dblewing_prot_r )
}
case 0x094: return state->_104_data;// p1 inputs select screen OK
case 0x24c: return state->_008_data;//read DSW (mirror for coinage/territory)
- case 0x298: return input_port_read(space->machine, "SYSTEM");//vblank
- case 0x476: return input_port_read(space->machine, "SYSTEM");//mirror for coins
- case 0x506: return input_port_read(space->machine, "DSW");
+ case 0x298: return input_port_read(space->machine(), "SYSTEM");//vblank
+ case 0x476: return input_port_read(space->machine(), "SYSTEM");//mirror for coins
+ case 0x506: return input_port_read(space->machine(), "DSW");
case 0x5d8: return state->_406_data;
- case 0x2b4: return input_port_read(space->machine, "P1_P2");
- case 0x1a8: return (input_port_read(space->machine, "DSW") & 0x4000) >> 12;//allow continue
+ case 0x2b4: return input_port_read(space->machine(), "P1_P2");
+ case 0x1a8: return (input_port_read(space->machine(), "DSW") & 0x4000) >> 12;//allow continue
case 0x3ec: return state->_70c_data; //score entry
case 0x246: return state->_580_data; // these three controls "perfect bonus" I suppose...
case 0x52e: return state->_580_data;
@@ -175,12 +175,12 @@ static READ16_HANDLER ( dblewing_prot_r )
mame_printf_debug("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask);
- return 0;//space->machine->rand();
+ return 0;//space->machine().rand();
}
static WRITE16_HANDLER( dblewing_prot_w )
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
// if (offset * 2 != 0x380)
// printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask, data);
@@ -328,7 +328,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(irq_latch_r)
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
/* bit 1 of dblewing_sound_irq specifies IRQ command writes */
state->sound_irq &= ~0x02;
@@ -520,7 +520,7 @@ INPUT_PORTS_END
static void sound_irq( device_t *device, int state )
{
- dblewing_state *driver_state = device->machine->driver_data<dblewing_state>();
+ dblewing_state *driver_state = device->machine().driver_data<dblewing_state>();
/* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */
if (state)
@@ -554,11 +554,11 @@ static const deco16ic_interface dblewing_deco16ic_tilegen1_intf =
static MACHINE_START( dblewing )
{
- dblewing_state *state = machine->driver_data<dblewing_state>();
+ dblewing_state *state = machine.driver_data<dblewing_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
state->save_item(NAME(state->_008_data));
state->save_item(NAME(state->_104_data));
@@ -593,7 +593,7 @@ static MACHINE_START( dblewing )
static MACHINE_RESET( dblewing )
{
- dblewing_state *state = machine->driver_data<dblewing_state>();
+ dblewing_state *state = machine.driver_data<dblewing_state>();
state->_008_data = 0;
state->_104_data = 0;
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index d9d84ec39fc..f7745f9b2c2 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -63,7 +63,7 @@ Notes:
static INTERRUPT_GEN( dbz_interrupt )
{
- dbz_state *state = device->machine->driver_data<dbz_state>();
+ dbz_state *state = device->machine().driver_data<dbz_state>();
switch (cpu_getiloops(device))
{
@@ -81,14 +81,14 @@ static INTERRUPT_GEN( dbz_interrupt )
#if 0
static READ16_HANDLER( dbzcontrol_r )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
return state->control;
}
#endif
static WRITE16_HANDLER( dbzcontrol_w )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
/* bit 10 = enable '246 readback */
COMBINE_DATA(&state->control);
@@ -98,8 +98,8 @@ static WRITE16_HANDLER( dbzcontrol_w )
else
k053246_set_objcha_line(state->k053246, CLEAR_LINE);
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE16_HANDLER( dbz_sound_command_w )
@@ -109,13 +109,13 @@ static WRITE16_HANDLER( dbz_sound_command_w )
static WRITE16_HANDLER( dbz_sound_cause_nmi )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static void dbz_sound_irq( device_t *device, int irq )
{
- dbz_state *state = device->machine->driver_data<dbz_state>();
+ dbz_state *state = device->machine().driver_data<dbz_state>();
if (irq)
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
@@ -338,15 +338,15 @@ static const k053936_interface dbz_k053936_intf =
static MACHINE_START( dbz )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053936_1 = machine->device("k053936_1");
- state->k053936_2 = machine->device("k053936_2");
- state->k056832 = machine->device("k056832");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936_1 = machine.device("k053936_1");
+ state->k053936_2 = machine.device("k053936_2");
+ state->k056832 = machine.device("k056832");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->control));
state->save_item(NAME(state->sprite_colorbase));
@@ -356,7 +356,7 @@ static MACHINE_START( dbz )
static MACHINE_RESET( dbz )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
int i;
for (i = 0; i < 5; i++)
@@ -500,7 +500,7 @@ static DRIVER_INIT( dbz )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// nop out dbz1's mask rom test
// tile ROM test
diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c
index 01dff9aee56..902bce0950d 100644
--- a/src/mame/drivers/dcheese.c
+++ b/src/mame/drivers/dcheese.c
@@ -49,7 +49,7 @@
static void update_irq_state( device_t *cpu )
{
- dcheese_state *state = cpu->machine->driver_data<dcheese_state>();
+ dcheese_state *state = cpu->machine().driver_data<dcheese_state>();
int i;
for (i = 1; i < 5; i++)
@@ -59,7 +59,7 @@ static void update_irq_state( device_t *cpu )
static IRQ_CALLBACK( irq_callback )
{
- dcheese_state *state = device->machine->driver_data<dcheese_state>();
+ dcheese_state *state = device->machine().driver_data<dcheese_state>();
/* auto-ack the IRQ */
state->irq_state[irqline] = 0;
@@ -70,9 +70,9 @@ static IRQ_CALLBACK( irq_callback )
}
-void dcheese_signal_irq( running_machine *machine, int which )
+void dcheese_signal_irq( running_machine &machine, int which )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
state->irq_state[which] = 1;
update_irq_state(state->maincpu);
@@ -82,7 +82,7 @@ void dcheese_signal_irq( running_machine *machine, int which )
static INTERRUPT_GEN( dcheese_vblank )
{
logerror("---- VBLANK ----\n");
- dcheese_signal_irq(device->machine, 4);
+ dcheese_signal_irq(device->machine(), 4);
}
@@ -95,11 +95,11 @@ static INTERRUPT_GEN( dcheese_vblank )
static MACHINE_START( dcheese )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->bsmt = machine->device("bsmt");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->bsmt = machine.device("bsmt");
device_set_irq_callback(state->maincpu, irq_callback);
@@ -119,7 +119,7 @@ static MACHINE_START( dcheese )
static CUSTOM_INPUT( sound_latch_state_r )
{
- dcheese_state *state = field->port->machine->driver_data<dcheese_state>();
+ dcheese_state *state = field->port->machine().driver_data<dcheese_state>();
return state->soundlatch_full;
}
@@ -130,15 +130,15 @@ static WRITE16_HANDLER( eeprom_control_w )
/* bits $0080-$0010 are probably lamps */
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 1) << 7);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 1) << 7);
}
}
static WRITE16_HANDLER( sound_command_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
if (ACCESSING_BITS_0_7)
{
@@ -159,7 +159,7 @@ static WRITE16_HANDLER( sound_command_w )
static READ8_HANDLER( sound_command_r )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
/* read the latch and clear the IRQ */
state->soundlatch_full = 0;
@@ -171,14 +171,14 @@ static READ8_HANDLER( sound_command_r )
static READ8_HANDLER( sound_status_r )
{
/* seems to be ready signal on BSMT or latching hardware */
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
static WRITE8_HANDLER( sound_control_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
UINT8 diff = data ^ state->sound_control;
state->sound_control = data;
@@ -193,8 +193,8 @@ static WRITE8_HANDLER( sound_control_w )
static WRITE8_HANDLER( bsmt_data_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
/* writes come in pairs; even bytes latch, odd bytes write */
if (offset % 2 == 0)
diff --git a/src/mame/drivers/dcon.c b/src/mame/drivers/dcon.c
index fde7fb71412..667403a1e5a 100644
--- a/src/mame/drivers/dcon.c
+++ b/src/mame/drivers/dcon.c
@@ -377,7 +377,7 @@ ROM_END
/***************************************************************************/
static DRIVER_INIT( sdgndmps )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x1356/2] = 0x4e71; /* beq -> nop */
RAM[0x1358/2] = 0x4e71;
diff --git a/src/mame/drivers/dday.c b/src/mame/drivers/dday.c
index 4ed374cf353..5bf851b2869 100644
--- a/src/mame/drivers/dday.c
+++ b/src/mame/drivers/dday.c
@@ -222,9 +222,9 @@ GFXDECODE_END
static MACHINE_START( dday )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
- state->ay1 = machine->device("ay1");
+ state->ay1 = machine.device("ay1");
state->save_item(NAME(state->control));
state->save_item(NAME(state->sl_enable));
@@ -234,7 +234,7 @@ static MACHINE_START( dday )
static MACHINE_RESET( dday )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
state->control = 0;
state->sl_enable = 0;
diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c
index 6d20860c514..568a574f2c2 100644
--- a/src/mame/drivers/ddayjlc.c
+++ b/src/mame/drivers/ddayjlc.c
@@ -130,25 +130,25 @@ static const UINT8 prot_data[0x10] =
static CUSTOM_INPUT( prot_r )
{
- ddayjlc_state *state = field->port->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = field->port->machine().driver_data<ddayjlc_state>();
return prot_data[state->prot_addr];
}
static WRITE8_HANDLER( prot_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->prot_addr = (state->prot_addr & (~(1 << offset))) | ((data & 1) << offset);
}
static WRITE8_HANDLER( char_bank_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->char_bank = data;
}
static WRITE8_HANDLER( ddayjlc_bgram_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
if (!offset)
tilemap_set_scrollx(state->bg_tilemap, 0, data + 8);
@@ -159,49 +159,49 @@ static WRITE8_HANDLER( ddayjlc_bgram_w )
static WRITE8_HANDLER( ddayjlc_videoram_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->videoram[offset] = data;
}
static WRITE8_HANDLER(sound_nmi_w)
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->sound_nmi_enable = data;
}
static WRITE8_HANDLER(main_nmi_w)
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->main_nmi_enable = data;
}
static WRITE8_HANDLER( bg0_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfe) | (data & 1);
}
static WRITE8_HANDLER( bg1_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfd) | ((data & 1) << 1);
}
static WRITE8_HANDLER( bg2_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfb) | ((data & 1) << 2);
if (state->bgadr > 2)
state->bgadr = 0;
- memory_set_bank(space->machine, "bank1", state->bgadr);
+ memory_set_bank(space->machine(), "bank1", state->bgadr);
}
static WRITE8_HANDLER( sound_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@@ -209,7 +209,7 @@ static WRITE8_HANDLER( sound_w )
static WRITE8_HANDLER( i8257_CH0_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->e00x_d[offset][state->e00x_l[offset]] = data;
state->e00x_l[offset] ^= 1;
@@ -217,7 +217,7 @@ static WRITE8_HANDLER( i8257_CH0_w )
static WRITE8_HANDLER( i8257_LMSR_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
if (!data)
{
@@ -366,7 +366,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info_bg )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
int code = state->bgram[tile_index] + ((state->bgram[tile_index + 0x400] & 0x08) << 5);
int color = (state->bgram[tile_index + 0x400] & 0x7);
color |= (state->bgram[tile_index + 0x400] & 0x40) >> 3;
@@ -376,13 +376,13 @@ static TILE_GET_INFO( get_tile_info_bg )
static VIDEO_START( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( ddayjlc )
{
- ddayjlc_state *state = screen->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = screen->machine().driver_data<ddayjlc_state>();
UINT32 i;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -398,7 +398,7 @@ static SCREEN_UPDATE( ddayjlc )
code = (code & 0x7f) | ((flags & 0x30) << 3);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], code, color, xflip, yflip, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], code, color, xflip, yflip, x, y, 0);
}
{
@@ -409,9 +409,9 @@ static SCREEN_UPDATE( ddayjlc )
{
c = state->videoram[y * 32 + x];
if (x > 1 && x < 30)
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
else
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8);
}
}
return 0;
@@ -429,14 +429,14 @@ static const ay8910_interface ay8910_config =
static INTERRUPT_GEN( ddayjlc_interrupt )
{
- ddayjlc_state *state = device->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = device->machine().driver_data<ddayjlc_state>();
if(state->main_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static INTERRUPT_GEN( ddayjlc_snd_interrupt )
{
- ddayjlc_state *state = device->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = device->machine().driver_data<ddayjlc_state>();
if(state->sound_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -444,9 +444,9 @@ static INTERRUPT_GEN( ddayjlc_snd_interrupt )
static MACHINE_START( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->char_bank));
state->save_item(NAME(state->bgadr));
@@ -463,7 +463,7 @@ static MACHINE_START( ddayjlc )
static MACHINE_RESET( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
int i;
state->char_bank = 0;
@@ -671,8 +671,8 @@ static DRIVER_INIT( ddayjlc )
UINT8 *src, *dst, *temp;
temp = auto_alloc_array(machine, UINT8, 0x10000);
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
newadr = 0;
oldaddr = 0;
@@ -686,7 +686,7 @@ static DRIVER_INIT( ddayjlc )
auto_free(machine, temp);
}
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("user1")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
}
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index 5bc0eecb8d3..882bf8d8c3c 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -144,13 +144,13 @@ public:
static WRITE16_HANDLER( ddealer_flipscreen_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
state->flipscreen = data & 0x01;
}
static TILE_GET_INFO( get_back_tile_info )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
int code = state->back_vram[tile_index];
SET_TILE_INFO(
0,
@@ -161,14 +161,14 @@ static TILE_GET_INFO( get_back_tile_info )
static VIDEO_START( ddealer )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->flipscreen = 0;
state->back_tilemap = tilemap_create(machine, get_back_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
}
-static void ddealer_draw_video_layer( running_machine *machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle *cliprect, int flipy)
+static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle *cliprect, int flipy)
{
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
INT16 sx, sy;
int x,y, count;
@@ -251,7 +251,7 @@ static void ddealer_draw_video_layer( running_machine *machine, UINT16* vreg_bas
static SCREEN_UPDATE( ddealer )
{
- ddealer_state *state = screen->machine->driver_data<ddealer_state>();
+ ddealer_state *state = screen->machine().driver_data<ddealer_state>();
tilemap_set_scrollx(state->back_tilemap, 0, state->flipscreen ? -192 : -64);
tilemap_set_flip(state->back_tilemap, state->flipscreen ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0);
tilemap_draw(bitmap, cliprect, state->back_tilemap, 0, 0);
@@ -266,24 +266,24 @@ static SCREEN_UPDATE( ddealer )
{
if (state->vregs[0xcc / 2] & 0x80)
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
- ddealer_draw_video_layer(screen->machine, &state->vregs[0xcc / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0xcc / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
else
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
}
else
{
if (state->vregs[0xcc / 2] & 0x80)
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0xcc / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0xcc / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
else
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
}
@@ -293,11 +293,11 @@ static SCREEN_UPDATE( ddealer )
static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
{
- ddealer_state *state = timer.machine->driver_data<ddealer_state>();
+ ddealer_state *state = timer.machine().driver_data<ddealer_state>();
/*coin/credit simulation*/
/*$fe002 is used,might be for multiple coins for one credit settings.*/
- state->coin_input = (~(input_port_read(timer.machine, "IN0")));
+ state->coin_input = (~(input_port_read(timer.machine(), "IN0")));
if (state->coin_input & 0x01)//coin 1
{
@@ -350,17 +350,17 @@ static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
}
/*random number generators,controls order of cards*/
- state->mcu_shared_ram[0x10 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x12 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x14 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x16 / 2] = timer.machine->rand() & 0xffff;
+ state->mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff;
}
static WRITE16_HANDLER( back_vram_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->back_vram[offset]);
tilemap_mark_tile_dirty(state->back_tilemap, offset);
}
@@ -368,7 +368,7 @@ static WRITE16_HANDLER( back_vram_w )
static WRITE16_HANDLER( ddealer_vregs_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->vregs[offset]);
}
@@ -396,7 +396,7 @@ Protection handling,identical to Hacha Mecha Fighter / Thunder Dragon with diffe
static WRITE16_HANDLER( ddealer_mcu_shared_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->mcu_shared_ram[offset]);
switch(offset)
@@ -590,7 +590,7 @@ GFXDECODE_END
static MACHINE_START( ddealer )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->save_item(NAME(state->respcount));
state->save_item(NAME(state->flipscreen));
@@ -600,7 +600,7 @@ static MACHINE_START( ddealer )
static MACHINE_RESET (ddealer)
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->respcount = 0;
state->flipscreen = 0;
@@ -650,7 +650,7 @@ MACHINE_CONFIG_END
static READ16_HANDLER( ddealer_mcu_r )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
static const int resp[] =
{
0x93, 0xc7, 0x00, 0x8000,
@@ -671,7 +671,7 @@ static READ16_HANDLER( ddealer_mcu_r )
static DRIVER_INIT( ddealer )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe01c, 0xfe01d, FUNC(ddealer_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe01c, 0xfe01d, FUNC(ddealer_mcu_r) );
}
ROM_START( ddealer )
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index c052a7466c1..98773504c81 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -139,7 +139,7 @@ static const int mjflove_commands[8] = { BLIT_STOP, BLIT_CHANGE_PEN, BLIT_CHANGE
VIDEO_START( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
for (i = 0; i < 8; i++)
@@ -237,7 +237,7 @@ VIDEO_START( ddenlovr )
static VIDEO_START( mmpanic )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -246,7 +246,7 @@ static VIDEO_START( mmpanic )
static VIDEO_START( hanakanz )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -256,7 +256,7 @@ static VIDEO_START( hanakanz )
static VIDEO_START( mjflove )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -268,9 +268,9 @@ static void ddenlovr_flipscreen_w( UINT8 data )
logerror("flipscreen = %02x (%s)\n", data, (data & 1) ? "off" : "on");
}
-static void ddenlovr_blit_flip_w( running_machine *machine, UINT8 data )
+static void ddenlovr_blit_flip_w( running_machine &machine, UINT8 data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
if ((data ^ state->ddenlovr_blit_flip) & 0xec)
{
@@ -285,13 +285,13 @@ static void ddenlovr_blit_flip_w( running_machine *machine, UINT8 data )
WRITE8_HANDLER( ddenlovr_bgcolor_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_bgcolor = data;
}
static WRITE8_HANDLER( ddenlovr_bgcolor2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_bgcolor2 = data;
}
@@ -304,13 +304,13 @@ static WRITE16_HANDLER( ddenlovr16_bgcolor_w )
WRITE8_HANDLER( ddenlovr_priority_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_priority = data;
}
static WRITE8_HANDLER( ddenlovr_priority2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_priority2 = data;
}
@@ -323,13 +323,13 @@ static WRITE16_HANDLER( ddenlovr16_priority_w )
WRITE8_HANDLER( ddenlovr_layer_enable_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_layer_enable = data;
}
static WRITE8_HANDLER( ddenlovr_layer_enable2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_layer_enable2 = data;
}
@@ -342,9 +342,9 @@ static WRITE16_HANDLER( ddenlovr16_layer_enable_w )
-static void do_plot( running_machine *machine, int x, int y, int pen )
+static void do_plot( running_machine &machine, int x, int y, int pen )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int addr, temp;
int xclip, yclip;
@@ -433,11 +433,11 @@ INLINE void log_draw_error( int src, int cmd )
06 blit_pen_mode (replace values stored in ROM)
*/
-static int blit_draw( running_machine *machine, int src, int sx )
+static int blit_draw( running_machine &machine, int src, int sx )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *src_data = machine->region("blitter")->base();
- int src_len = machine->region("blitter")->bytes();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *src_data = machine.region("blitter")->base();
+ int src_len = machine.region("blitter")->bytes();
int bit_addr = (src & 0xffffff) * state->ddenlovr_blit_rom_bits; /* convert to bit address */
int pen_size, arg_size, cmd;
int x;
@@ -528,9 +528,9 @@ static int blit_draw( running_machine *machine, int src, int sx )
/* Draw a simple rectangle
*/
-static void blit_rect_xywh( running_machine *machine )
+static void blit_rect_xywh( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int x, y;
#ifdef MAME_DEBUG
@@ -555,9 +555,9 @@ static void blit_rect_xywh( running_machine *machine )
04 blit_pen
0c line_length - always 0?
*/
-static void blit_rect_yh( running_machine *machine )
+static void blit_rect_yh( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int start = 512 * state->ddenlovr_blit_y;
int length = 512 * (state->ddenlovr_rect_height + 1);
@@ -595,9 +595,9 @@ static void blit_rect_yh( running_machine *machine )
02 Y
04 blit_pen
*/
-static void blit_fill_xy( running_machine *machine, int x, int y )
+static void blit_fill_xy( running_machine &machine, int x, int y )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int start = 512 * y + x;
#ifdef MAME_DEBUG
@@ -630,9 +630,9 @@ static void blit_fill_xy( running_machine *machine, int x, int y )
04 blit_pen
ddenlovr_blit_x and ddenlovr_blit_y are left pointing to the last pixel at the end of the command
*/
-static void blit_horiz_line( running_machine *machine )
+static void blit_horiz_line( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
#ifdef MAME_DEBUG
@@ -661,9 +661,9 @@ static void blit_horiz_line( running_machine *machine )
04 blit_pen
ddenlovr_blit_x and ddenlovr_blit_y are left pointing to the last pixel at the end of the command
*/
-static void blit_vert_line( running_machine *machine )
+static void blit_vert_line( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
#ifdef MAME_DEBUG
@@ -680,13 +680,13 @@ static void blit_vert_line( running_machine *machine )
-INLINE void log_blit( running_machine *machine, int data )
+INLINE void log_blit( running_machine &machine, int data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
#if 1
logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x flip %02x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
- machine->describe_context(),
+ machine.describe_context(),
state->ddenlovr_blit_address, state->ddenlovr_blit_x, state->ddenlovr_blit_y, data,
state->ddenlovr_dest_layer, state->ddenlovr_blit_pen, state->ddenlovr_blit_pen_mode, state->ddenlovr_rect_width, state->ddenlovr_rect_height, state->ddenlovr_line_length, state->ddenlovr_blit_flip,
state->ddenlovr_clip_ctrl, state->ddenlovr_clip_x, state->ddenlovr_clip_y, state->ddenlovr_clip_width, state->ddenlovr_clip_height);
@@ -695,7 +695,7 @@ INLINE void log_blit( running_machine *machine, int data )
static void blitter_w( address_space *space, int blitter, offs_t offset, UINT8 data, int irq_vector )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -725,7 +725,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
case 0x03:
- ddenlovr_blit_flip_w(space->machine, data);
+ ddenlovr_blit_flip_w(space->machine(), data);
break;
case 0x04:
@@ -794,31 +794,31 @@ g_profiler.start(PROFILER_VIDEO);
case 0x24:
- log_blit(space->machine, data);
+ log_blit(space->machine(), data);
switch (data)
{
- case 0x04: blit_fill_xy(space->machine, 0, 0);
+ case 0x04: blit_fill_xy(space->machine(), 0, 0);
break;
- case 0x14: blit_fill_xy(space->machine, state->ddenlovr_blit_x, state->ddenlovr_blit_y);
+ case 0x14: blit_fill_xy(space->machine(), state->ddenlovr_blit_x, state->ddenlovr_blit_y);
break;
- case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine, state->ddenlovr_blit_address, state->ddenlovr_blit_x);
+ case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine(), state->ddenlovr_blit_address, state->ddenlovr_blit_x);
break;
- case 0x13: blit_horiz_line(space->machine);
+ case 0x13: blit_horiz_line(space->machine());
break;
- case 0x1b: blit_vert_line(space->machine);
+ case 0x1b: blit_vert_line(space->machine());
break;
- case 0x1c: blit_rect_xywh(space->machine);
+ case 0x1c: blit_rect_xywh(space->machine());
break;
// These two are issued one after the other (43 then 8c)
// 8c is issued immediately after 43 has finished, without
// changing any argument
case 0x43: break;
- case 0x8c: blit_rect_yh(space->machine);
+ case 0x8c: blit_rect_yh(space->machine());
break;
default:
@@ -856,9 +856,9 @@ g_profiler.stop();
// differences wrt blitter_data_w: slightly different blitter commands
-static void blitter_w_funkyfig( running_machine *machine, int blitter, offs_t offset, UINT8 data, int irq_vector )
+static void blitter_w_funkyfig( running_machine &machine, int blitter, offs_t offset, UINT8 data, int irq_vector )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -994,7 +994,7 @@ g_profiler.start(PROFILER_VIDEO);
;
#ifdef MAME_DEBUG
popmessage("unknown blitter command %02x", data);
- logerror("%s: unknown blitter command %02x\n", machine->describe_context(), data);
+ logerror("%s: unknown blitter command %02x\n", machine.describe_context(), data);
#endif
}
@@ -1002,7 +1002,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
default:
- logerror("%s: Blitter %d reg %02x = %02x\n", machine->describe_context(), blitter, state->ddenlovr_blit_regs[blitter], data);
+ logerror("%s: Blitter %d reg %02x = %02x\n", machine.describe_context(), blitter, state->ddenlovr_blit_regs[blitter], data);
break;
}
}
@@ -1015,14 +1015,14 @@ g_profiler.stop();
static WRITE8_HANDLER( hanakanz_blitter_reg_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_blit_latch = data;
}
// differences wrt blitter_data_w: registers are shuffled around, hi_bits in the low bits, clip_w/h, includes layers registers
static WRITE8_HANDLER( hanakanz_blitter_data_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -1044,7 +1044,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
case 0x0c:
- ddenlovr_blit_flip_w(space->machine, data);
+ ddenlovr_blit_flip_w(space->machine(), data);
break;
case 0x10:
@@ -1163,31 +1163,31 @@ g_profiler.start(PROFILER_VIDEO);
case 0x90:
- log_blit(space->machine, data);
+ log_blit(space->machine(), data);
switch (data)
{
- case 0x04: blit_fill_xy(space->machine, 0, 0);
+ case 0x04: blit_fill_xy(space->machine(), 0, 0);
break;
- case 0x14: blit_fill_xy(space->machine, state->ddenlovr_blit_x, state->ddenlovr_blit_y);
+ case 0x14: blit_fill_xy(space->machine(), state->ddenlovr_blit_x, state->ddenlovr_blit_y);
break;
- case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine, state->ddenlovr_blit_address, state->ddenlovr_blit_x);
+ case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine(), state->ddenlovr_blit_address, state->ddenlovr_blit_x);
break;
- case 0x13: blit_horiz_line(space->machine);
+ case 0x13: blit_horiz_line(space->machine());
break;
- case 0x1b: blit_vert_line(space->machine);
+ case 0x1b: blit_vert_line(space->machine());
break;
- case 0x1c: blit_rect_xywh(space->machine);
+ case 0x1c: blit_rect_xywh(space->machine());
break;
// These two are issued one after the other (43 then 8c)
// 8c is issued immediately after 43 has finished, without
// changing any argument
case 0x43: break;
- case 0x8c: blit_rect_yh(space->machine);
+ case 0x8c: blit_rect_yh(space->machine());
break;
default:
@@ -1225,7 +1225,7 @@ static WRITE16_HANDLER( ddenlovr_blitter_w )
static WRITE16_HANDLER( ddenlovr_blitter_irq_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1244,9 +1244,9 @@ static WRITE16_HANDLER( ddenlovr_blitter_irq_ack_w )
static READ8_HANDLER( rongrong_gfxrom_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("blitter")->base();
- size_t size = space->machine->region("blitter")->bytes();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("blitter")->base();
+ size_t size = space->machine().region("blitter")->bytes();
int address = state->ddenlovr_blit_address;
if (address >= size)
@@ -1266,9 +1266,9 @@ static READ16_HANDLER( ddenlovr_gfxrom_r )
}
-static void copylayer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int x,y;
int scrollx = state->ddenlovr_scroll[layer / 4 * 8 + (layer % 4) + 0];
int scrolly = state->ddenlovr_scroll[layer / 4 * 8 + (layer % 4) + 4];
@@ -1302,7 +1302,7 @@ static void copylayer(running_machine *machine, bitmap_t *bitmap, const rectangl
SCREEN_UPDATE(ddenlovr)
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
static const int order[24][4] =
{
@@ -1319,7 +1319,7 @@ SCREEN_UPDATE(ddenlovr)
#if 0
static int base = 0x0;
- const UINT8 *gfx = screen->machine->region("blitter")->base();
+ const UINT8 *gfx = screen->machine().region("blitter")->base();
int next;
memset(state->ddenlovr_pixmap[0], 0, 512 * 512);
memset(state->ddenlovr_pixmap[1], 0, 512 * 512);
@@ -1330,38 +1330,38 @@ SCREEN_UPDATE(ddenlovr)
state->ddenlovr_blit_pen_mode = 0;
state->ddenlovr_blit_y = 5;
state->ddenlovr_clip_ctrl = 0x0f;
- next = blit_draw(screen->machine, base, 0);
+ next = blit_draw(screen->machine(), base, 0);
popmessage("GFX %06x", base);
- if (input_code_pressed(screen->machine, KEYCODE_S)) base = next;
- if (input_code_pressed_once(screen->machine, KEYCODE_X)) base = next;
- if (input_code_pressed(screen->machine, KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
- if (input_code_pressed(screen->machine, KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
- if (input_code_pressed_once(screen->machine, KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
- if (input_code_pressed_once(screen->machine, KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) base = next;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_X)) base = next;
+ if (input_code_pressed(screen->machine(), KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
+ if (input_code_pressed(screen->machine(), KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
#endif
bitmap_fill(bitmap, cliprect, state->ddenlovr_bgcolor);
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask, mask2;
mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) mask |= 8;
mask2 = 0;
if (state->extra_layers)
{
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask2 |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_S)) mask2 |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_D)) mask2 |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_F)) mask2 |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask2 |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) mask2 |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) mask2 |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) mask2 |= 8;
}
if (mask || mask2)
@@ -1380,10 +1380,10 @@ SCREEN_UPDATE(ddenlovr)
pri = 0;
}
- copylayer(screen->machine, bitmap, cliprect, order[pri][0]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][1]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][2]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][3]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][0]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][1]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][2]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][3]);
if (state->extra_layers)
{
@@ -1395,10 +1395,10 @@ SCREEN_UPDATE(ddenlovr)
pri = 0;
}
- copylayer(screen->machine, bitmap, cliprect, order[pri][0] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][1] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][2] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][3] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][0] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][1] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][2] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][3] + 4);
}
state->ddenlovr_layer_enable = enab;
@@ -1409,25 +1409,25 @@ SCREEN_UPDATE(ddenlovr)
static CUSTOM_INPUT( ddenlovr_special_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag;
}
static WRITE16_HANDLER( ddenlovr_coincounter_0_w )
{
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE16_HANDLER( ddenlovr_coincounter_1_w )
{
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
}
static WRITE8_HANDLER( rongrong_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int r, g, b, d1, d2, indx;
state->palram[offset] = data;
@@ -1441,7 +1441,7 @@ static WRITE8_HANDLER( rongrong_palette_w )
/* what were they smoking??? */
b = ((d1 & 0xe0) >> 5) | (d2 & 0xc0) >> 3;
- palette_set_color_rgb(space->machine, indx, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), indx, pal5bit(r), pal5bit(g), pal5bit(b));
}
static WRITE16_HANDLER( ddenlovr_palette_w )
@@ -1453,58 +1453,58 @@ static WRITE16_HANDLER( ddenlovr_palette_w )
WRITE8_HANDLER( ddenlovr_palette_base_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_base[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_palette_base2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_base[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_palette_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_mask[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_palette_mask2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_mask[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_transparency_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_pen[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_transparency_pen2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_pen[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_transparency_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_mask[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_transparency_mask2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_mask[offset + 4] = data;
}
static WRITE16_HANDLER( ddenlovr16_palette_base_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_palette_base[offset] = data & 0xff;
@@ -1512,7 +1512,7 @@ static WRITE16_HANDLER( ddenlovr16_palette_base_w )
static WRITE16_HANDLER( ddenlovr16_palette_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_palette_mask[offset] = data & 0xff;
@@ -1520,7 +1520,7 @@ static WRITE16_HANDLER( ddenlovr16_palette_mask_w )
static WRITE16_HANDLER( ddenlovr16_transparency_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_transparency_pen[offset] = data & 0xff;
@@ -1528,7 +1528,7 @@ static WRITE16_HANDLER( ddenlovr16_transparency_pen_w )
static WRITE16_HANDLER( ddenlovr16_transparency_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_transparency_mask[offset] = data & 0xff;
@@ -1554,7 +1554,7 @@ static WRITE16_DEVICE_HANDLER( ddenlovr_oki_bank_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1566,7 +1566,7 @@ static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank2_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1591,13 +1591,13 @@ static READ16_HANDLER( unk16_r )
static WRITE8_DEVICE_HANDLER( ddenlovr_select_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static WRITE16_HANDLER( ddenlovr_select_16_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->dsw_sel = data;
@@ -1605,13 +1605,13 @@ static WRITE16_HANDLER( ddenlovr_select_16_w )
static WRITE8_HANDLER( ddenlovr_select2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
}
static WRITE16_HANDLER( ddenlovr_select2_16_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->input_sel = data;
@@ -1619,15 +1619,15 @@ static WRITE16_HANDLER( ddenlovr_select2_16_w )
static READ8_HANDLER( rongrong_input2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
// logerror("%04x: input2_r offset %d select %x\n", cpu_get_pc(space->cpu), offset, state->input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "P1");
- case 0x01: return input_port_read(space->machine, "P2");
- case 0x02: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "P1");
+ case 0x01: return input_port_read(space->machine(), "P2");
+ case 0x02: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
}
@@ -1635,27 +1635,27 @@ static READ8_HANDLER( rongrong_input2_r )
static READ8_DEVICE_HANDLER( quiz365_input_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 3)) return 0xff;//device->machine->rand();
- if (!BIT(state->dsw_sel, 4)) return 0xff;//device->machine->rand();
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 3)) return 0xff;//device->machine().rand();
+ if (!BIT(state->dsw_sel, 4)) return 0xff;//device->machine().rand();
return 0xff;
}
static READ16_HANDLER( quiz365_input2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
// logerror("%04x: input2_r offset %d select %x\n",cpu_get_pc(space->cpu), offset, state->input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (state->input_sel)
{
- case 0x10: return input_port_read(space->machine, "P1");
- case 0x11: return input_port_read(space->machine, "P2");
- case 0x12: return input_port_read(space->machine, "SYSTEM");
+ case 0x10: return input_port_read(space->machine(), "P1");
+ case 0x11: return input_port_read(space->machine(), "P2");
+ case 0x12: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
}
@@ -1663,7 +1663,7 @@ static READ16_HANDLER( quiz365_input2_r )
static WRITE8_HANDLER( rongrong_blitter_busy_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rongrong_blitter_busy_select = data;
if (data != 0x18)
@@ -1672,7 +1672,7 @@ static WRITE8_HANDLER( rongrong_blitter_busy_w )
static READ8_HANDLER( rongrong_blitter_busy_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->rongrong_blitter_busy_select)
{
@@ -1687,14 +1687,14 @@ static READ8_HANDLER( rongrong_blitter_busy_r )
static WRITE16_HANDLER( quiz365_coincounter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
if (state->input_sel == 0x1c)
{
- coin_counter_w(space->machine, 0, ~data & 1);
- coin_counter_w(space->machine, 1, ~data & 4);
+ coin_counter_w(space->machine(), 0, ~data & 1);
+ coin_counter_w(space->machine(), 1, ~data & 4);
}
}
}
@@ -1705,7 +1705,7 @@ static WRITE16_HANDLER( quiz365_coincounter_w )
*/
static READ16_HANDLER( quiz365_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->quiz365_protection[0])
{
@@ -1718,7 +1718,7 @@ static READ16_HANDLER( quiz365_protection_r )
static WRITE16_HANDLER( quiz365_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
COMBINE_DATA(state->quiz365_protection + offset);
}
@@ -1761,11 +1761,11 @@ ADDRESS_MAP_END
static READ16_HANDLER( ddenlovj_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 dsw = 0;
- if ((~*state->dsw_sel16) & 0x01) dsw |= input_port_read(space->machine, "DSW1");
- if ((~*state->dsw_sel16) & 0x02) dsw |= input_port_read(space->machine, "DSW2");
- if ((~*state->dsw_sel16) & 0x04) dsw |= input_port_read(space->machine, "DSW3");
+ if ((~*state->dsw_sel16) & 0x01) dsw |= input_port_read(space->machine(), "DSW1");
+ if ((~*state->dsw_sel16) & 0x02) dsw |= input_port_read(space->machine(), "DSW2");
+ if ((~*state->dsw_sel16) & 0x04) dsw |= input_port_read(space->machine(), "DSW3");
return dsw;
}
@@ -1773,15 +1773,15 @@ static WRITE16_HANDLER( ddenlovj_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x04);
// data & 0x80 ?
}
}
static CUSTOM_INPUT( ddenlovj_blitter_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag ? 0x03 : 0x00; // bit 4 = 1 -> blitter busy
}
@@ -1819,7 +1819,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( ddenlovrk_protection1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (*state->protection1)
{
case 0x007e: return 0x00aa;
@@ -1829,7 +1829,7 @@ static READ16_HANDLER( ddenlovrk_protection1_r )
static READ16_HANDLER( ddenlovrk_protection2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (*state->protection1)
{
case 0x0000: return *state->protection2;
@@ -1838,7 +1838,7 @@ static READ16_HANDLER( ddenlovrk_protection2_r )
}
static WRITE16_HANDLER( ddenlovrk_protection2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
COMBINE_DATA(state->protection2);
state->oki->set_bank_base(((*state->protection2) & 0x7) * 0x40000);
@@ -1921,17 +1921,17 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( nettoqc_special_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag ? 0x03 : 0x00;
}
static READ16_HANDLER( nettoqc_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
return 0xffff;
}
@@ -1944,7 +1944,7 @@ static READ16_HANDLER( nettoqc_input_r )
static READ16_HANDLER( nettoqc_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->protection1[0] & 0xff)
{
@@ -1957,8 +1957,8 @@ static WRITE16_HANDLER( nettoqc_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x04);
// data & 0x80 ?
}
}
@@ -2012,28 +2012,28 @@ ADDRESS_MAP_END
static READ8_HANDLER( rongrong_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return 0xff;//space->machine->rand();
- if (!BIT(state->dsw_sel, 3)) return 0xff;//space->machine->rand();
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return 0xff;//space->machine().rand();
+ if (!BIT(state->dsw_sel, 3)) return 0xff;//space->machine().rand();
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW3");
return 0xff;
}
static WRITE8_HANDLER( rongrong_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
//logerror("%04x: rongrong_select_w %02x\n",cpu_get_pc(space->cpu),data);
/* bits 0-4 = **both** ROM bank **AND** input select */
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
state->dsw_sel = data;
/* bits 5-7 = RAM bank */
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
@@ -2127,13 +2127,13 @@ static READ8_HANDLER( magic_r )
static WRITE8_HANDLER( mmpanic_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
/* Bit 4? */
}
static WRITE8_HANDLER( mmpanic_soundlatch_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -2148,37 +2148,37 @@ static WRITE8_HANDLER( mmpanic_blitter2_w )
blitter_w(space, 1, offset, data, 0xdf); // RST 18
}
-static void mmpanic_update_leds(running_machine *machine)
+static void mmpanic_update_leds(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
set_led_status(machine, 0, state->mmpanic_leds);
}
/* leds 1-8 */
static WRITE8_HANDLER( mmpanic_leds_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->mmpanic_leds = (state->mmpanic_leds & 0xff00) | data;
- mmpanic_update_leds(space->machine);
+ mmpanic_update_leds(space->machine());
}
/* led 9 */
static WRITE8_HANDLER( mmpanic_leds2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->mmpanic_leds = (state->mmpanic_leds & 0xfeff) | (data ? 0x0100 : 0);
- mmpanic_update_leds(space->machine);
+ mmpanic_update_leds(space->machine());
}
static WRITE8_HANDLER( mmpanic_lockout_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->dsw_sel == 0x0c)
{
- coin_counter_w(space->machine, 0, (~data) & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x02);
- set_led_status(space->machine, 1, (~data) & 0x04);
+ coin_counter_w(space->machine(), 0, (~data) & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x02);
+ set_led_status(space->machine(), 1, (~data) & 0x04);
}
}
@@ -2284,38 +2284,38 @@ static READ8_HANDLER( funkyfig_busy_r )
static WRITE8_HANDLER( funkyfig_blitter_w )
{
- blitter_w_funkyfig(space->machine, 0, offset, data, 0xe0);
+ blitter_w_funkyfig(space->machine(), 0, offset, data, 0xe0);
}
static WRITE8_HANDLER( funkyfig_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
// bit 4 selects palette ram at 8000?
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
static READ8_HANDLER( funkyfig_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(space->cpu), state->dsw_sel);
return 0xff;
}
static READ8_HANDLER( funkyfig_coin_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x22: return input_port_read(space->machine, "IN2");
+ case 0x22: return input_port_read(space->machine(), "IN2");
case 0x23: return state->funkyfig_lockout;
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -2324,12 +2324,12 @@ static READ8_HANDLER( funkyfig_coin_r )
static READ8_HANDLER( funkyfig_key_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x20: return input_port_read(space->machine, "IN0");
- case 0x21: return input_port_read(space->machine, "IN1");
+ case 0x20: return input_port_read(space->machine(), "IN0");
+ case 0x21: return input_port_read(space->machine(), "IN1");
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -2337,14 +2337,14 @@ static READ8_HANDLER( funkyfig_key_r )
static WRITE8_HANDLER( funkyfig_lockout_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x2c:
state->funkyfig_lockout = data;
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x02);
if (data & ~0x03)
logerror("%06x: warning, unknown bits written, lockout = %02x\n", cpu_get_pc(space->cpu), data);
break;
@@ -2405,8 +2405,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hanakanz_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
- memory_set_bank(space->machine, "bank2", ((data & 0xf0) >> 4));
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", ((data & 0xf0) >> 4));
}
static ADDRESS_MAP_START( hanakanz_map, AS_PROGRAM, 8 )
@@ -2419,41 +2419,41 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hanakanz_keyb_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->keyb = data;
}
static WRITE8_HANDLER( hanakanz_dsw_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_HANDLER( hanakanz_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
return val;
}
static READ8_HANDLER( hanakanz_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine, "DSW4");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW5");
return 0xff;
}
@@ -2464,9 +2464,9 @@ static READ8_HANDLER( hanakanz_busy_r )
static READ8_HANDLER( hanakanz_gfxrom_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("blitter")->base();
- size_t size = space->machine->region("blitter")->bytes();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("blitter")->base();
+ size_t size = space->machine().region("blitter")->bytes();
int address = (state->ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
@@ -2498,7 +2498,7 @@ static WRITE8_HANDLER( hanakanz_coincounter_w )
// bit 2 = 1 if bet on
// bit 3 = 1 if bet off
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0xf0)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -2510,7 +2510,7 @@ static WRITE8_HANDLER( hanakanz_coincounter_w )
static WRITE8_HANDLER( hanakanz_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->ddenlovr_blit_latch & 0x80)
{
@@ -2524,7 +2524,7 @@ static WRITE8_HANDLER( hanakanz_palette_w )
int g = state->ddenlovr_blit_latch & 0x1f;
int r = data & 0x1f;
int b = ((data & 0xe0) >> 5) | ((state->ddenlovr_blit_latch & 0x60) >> 2);
- palette_set_color_rgb(space->machine, (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -2536,7 +2536,7 @@ static WRITE8_DEVICE_HANDLER( hanakanz_oki_bank_w )
static READ8_HANDLER( hanakanz_rand_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( hanakanz_portmap, AS_IO, 8 )
@@ -2583,13 +2583,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjreach1_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->prot_val = data;
}
static READ8_HANDLER( mjreach1_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->prot_val;
}
@@ -2621,16 +2621,16 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjchuuka_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
if (offset)
val |= 0x80; // blitter busy
@@ -2644,16 +2644,16 @@ static WRITE8_HANDLER( mjchuuka_blitter_w )
hanakanz_blitter_data_w(space, 0, data);
}
-static void mjchuuka_get_romdata(running_machine *machine)
+static void mjchuuka_get_romdata(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *rom = machine->region("blitter")->base();
- size_t size = machine->region("blitter")->bytes();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *rom = machine.region("blitter")->base();
+ size_t size = machine.region("blitter")->bytes();
int address = (state->ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
{
- logerror("%s: Error, Blitter address %06X out of range\n", machine->describe_context(), address);
+ logerror("%s: Error, Blitter address %06X out of range\n", machine.describe_context(), address);
address %= size;
}
@@ -2663,21 +2663,21 @@ static void mjchuuka_get_romdata(running_machine *machine)
static READ8_HANDLER( mjchuuka_gfxrom_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- mjchuuka_get_romdata(space->machine);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ mjchuuka_get_romdata(space->machine());
state->ddenlovr_blit_address++;
return state->romdata[0];
}
static READ8_HANDLER( mjchuuka_gfxrom_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->romdata[1];
}
static WRITE8_HANDLER( mjchuuka_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 rgb = (offset & 0xff00) | data;
if (rgb & 0x8000)
@@ -2692,7 +2692,7 @@ static WRITE8_HANDLER( mjchuuka_palette_w )
int r = (rgb >> 0) & 0x1f;
int g = (rgb >> 8) & 0x1f;
int b = ((rgb >> 5) & 0x07) | ((rgb & 0x6000) >> 10);
- palette_set_color_rgb(space->machine, (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -2703,8 +2703,8 @@ static WRITE8_HANDLER( mjchuuka_coincounter_w )
// bit 3 = lockout
// bit 8?
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x08);
if (data & 0x74)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -2764,13 +2764,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjmyster_rambank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
//logerror("%04x: rambank = %02x\n", cpu_get_pc(space->cpu), data);
}
static WRITE8_HANDLER( mjmyster_select2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
if (data & 0x80)
@@ -2779,11 +2779,11 @@ static WRITE8_HANDLER( mjmyster_select2_w )
static READ8_HANDLER( mjmyster_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "SYSTEM");
case 0x01: return 0xff;
case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x03: return 0xff;
@@ -2796,14 +2796,14 @@ static READ8_HANDLER( mjmyster_coins_r )
static READ8_HANDLER( mjmyster_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 ret = 0xff;
- if (BIT(state->keyb, 0)) ret = input_port_read(space->machine, "KEY0");
- else if (BIT(state->keyb, 1)) ret = input_port_read(space->machine, "KEY1");
- else if (BIT(state->keyb, 2)) ret = input_port_read(space->machine, "KEY2");
- else if (BIT(state->keyb, 3)) ret = input_port_read(space->machine, "KEY3");
- else if (BIT(state->keyb, 4)) ret = input_port_read(space->machine, "KEY4");
+ if (BIT(state->keyb, 0)) ret = input_port_read(space->machine(), "KEY0");
+ else if (BIT(state->keyb, 1)) ret = input_port_read(space->machine(), "KEY1");
+ else if (BIT(state->keyb, 2)) ret = input_port_read(space->machine(), "KEY2");
+ else if (BIT(state->keyb, 3)) ret = input_port_read(space->machine(), "KEY3");
+ else if (BIT(state->keyb, 4)) ret = input_port_read(space->machine(), "KEY4");
else logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(space->cpu), state->keyb);
state->keyb <<= 1;
@@ -2813,26 +2813,26 @@ static READ8_HANDLER( mjmyster_keyb_r )
static READ8_HANDLER( mjmyster_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW4");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW3");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW5");
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(space->cpu), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( mjmyster_coincounter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x0c:
- coin_counter_w(space->machine, 0, (~data) & 0x01); // coin in
- coin_counter_w(space->machine, 0, (~data) & 0x02); // coin out actually
+ coin_counter_w(space->machine(), 0, (~data) & 0x01); // coin in
+ coin_counter_w(space->machine(), 0, (~data) & 0x02); // coin out actually
#ifdef MAME_DEBUG
// popmessage("cc: %02x",data);
#endif
@@ -2883,16 +2883,16 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hginga_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
state->hginga_rombank = data;
}
// similar to rongrong
static READ8_HANDLER( hginga_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
if (state->hginga_rombank & 0x10)
return hanakanz_rand_r(space, 0);
@@ -2911,33 +2911,33 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( hginga_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW4");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW5");
- logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine->describe_context(), state->dsw_sel);
+ logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( hginga_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
state->keyb = 0;
}
static READ8_HANDLER( hginga_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x20: return input_port_read(space->machine, "SYSTEM");
- case 0x21: return input_port_read(space->machine, "BET");
+ case 0x20: return input_port_read(space->machine(), "SYSTEM");
+ case 0x21: return input_port_read(space->machine(), "BET");
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return state->coins;
}
@@ -2952,7 +2952,7 @@ static WRITE8_HANDLER( hginga_80_w )
static WRITE8_HANDLER( hginga_coins_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
@@ -2964,7 +2964,7 @@ static WRITE8_HANDLER( hginga_coins_w )
// bit 2 = 1 if bet on
// bit 3 = 1 if bet on
// bit 7?
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
#ifdef MAME_DEBUG
// popmessage("COINS %02x", data);
#endif
@@ -2977,7 +2977,7 @@ static WRITE8_HANDLER( hginga_coins_w )
static READ8_HANDLER( hginga_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -2988,11 +2988,11 @@ static READ8_HANDLER( hginga_input_r )
// player 1
case 0xa1:
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
// player 2
case 0xa2:
- return input_port_read(space->machine, keynames1[state->keyb++]);
+ return input_port_read(space->machine(), keynames1[state->keyb++]);
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -3000,7 +3000,7 @@ static READ8_HANDLER( hginga_input_r )
static WRITE8_HANDLER( hginga_blitter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (offset == 0)
{
state->ddenlovr_blit_latch = data;
@@ -3062,31 +3062,31 @@ ADDRESS_MAP_END
static UINT8 hgokou_player_r( address_space *space, int player )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 hopper_bit = ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 hopper_bit = ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
- if (!BIT(state->input_sel, 0)) return input_port_read(space->machine, player ? "KEY5" : "KEY0") | hopper_bit;
- if (!BIT(state->input_sel, 1)) return input_port_read(space->machine, player ? "KEY6" : "KEY1") | hopper_bit;
- if (!BIT(state->input_sel, 2)) return input_port_read(space->machine, player ? "KEY7" : "KEY2") | hopper_bit;
- if (!BIT(state->input_sel, 3)) return input_port_read(space->machine, player ? "KEY8" : "KEY3") | hopper_bit;
- if (!BIT(state->input_sel, 4)) return input_port_read(space->machine, player ? "KEY9" : "KEY4") | hopper_bit;
+ if (!BIT(state->input_sel, 0)) return input_port_read(space->machine(), player ? "KEY5" : "KEY0") | hopper_bit;
+ if (!BIT(state->input_sel, 1)) return input_port_read(space->machine(), player ? "KEY6" : "KEY1") | hopper_bit;
+ if (!BIT(state->input_sel, 2)) return input_port_read(space->machine(), player ? "KEY7" : "KEY2") | hopper_bit;
+ if (!BIT(state->input_sel, 3)) return input_port_read(space->machine(), player ? "KEY8" : "KEY3") | hopper_bit;
+ if (!BIT(state->input_sel, 4)) return input_port_read(space->machine(), player ? "KEY9" : "KEY4") | hopper_bit;
return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
}
static WRITE8_HANDLER( hgokou_dsw_sel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_HANDLER( hgokou_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->dsw_sel)
{
- case 0x20: return input_port_read(space->machine, "SYSTEM");
+ case 0x20: return input_port_read(space->machine(), "SYSTEM");
case 0x21: return hgokou_player_r(space, 1);
case 0x22: return hgokou_player_r(space, 0);
case 0x23: return state->coins;
@@ -3097,7 +3097,7 @@ static READ8_HANDLER( hgokou_input_r )
static WRITE8_HANDLER( hgokou_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->dsw_sel)
{
@@ -3105,7 +3105,7 @@ static WRITE8_HANDLER( hgokou_input_w )
// bit 0 = coin counter
// bit 1 = out counter
// bit 2 = hopper
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
state->hopper = data & 0x04;
#ifdef MAME_DEBUG
// popmessage("COINS %02x",data);
@@ -3125,8 +3125,8 @@ static WRITE8_HANDLER( hgokou_input_w )
// similar to rongrong
static READ8_HANDLER( hgokou_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
if (state->hginga_rombank == 0)
return hanakanz_rand_r(space, 0);
@@ -3177,30 +3177,30 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hparadis_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
state->keyb = 0;
- memory_set_bank(space->machine, "bank1", data & 0x07);
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
static READ8_HANDLER( hparadis_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "P1");
- case 0x01: return input_port_read(space->machine, "P2");
- case 0x02: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "P1");
+ case 0x01: return input_port_read(space->machine(), "P2");
+ case 0x02: return input_port_read(space->machine(), "SYSTEM");
case 0x0d: return 0x00;
- case 0x80: return input_port_read(space->machine, keynames0[state->keyb++]); // P1 (Keys)
- case 0x81: return input_port_read(space->machine, keynames1[state->keyb++]); // P2 (Keys)
+ case 0x80: return input_port_read(space->machine(), keynames0[state->keyb++]); // P1 (Keys)
+ case 0x81: return input_port_read(space->machine(), keynames1[state->keyb++]); // P2 (Keys)
}
logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -3208,23 +3208,23 @@ static READ8_HANDLER( hparadis_input_r )
static READ8_HANDLER( hparadis_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
if (!BIT(state->dsw_sel, 2)) return 0xff;
if (!BIT(state->dsw_sel, 3)) return 0xff;
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW3");
return 0xff;
}
static WRITE8_HANDLER( hparadis_coin_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x0c: coin_counter_w(space->machine, 0, data & 1); break;
+ case 0x0c: coin_counter_w(space->machine(), 0, data & 1); break;
case 0x0d: break;
default:
logerror("%04x: coins_w with select = %02x, data = %02x\n",cpu_get_pc(space->cpu), state->input_sel, data);
@@ -3270,11 +3270,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjmywrld_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x80: return input_port_read(space->machine, "SYSTEM");
+ case 0x80: return input_port_read(space->machine(), "SYSTEM");
case 0x81: return 0x00;
case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x83: return 0x00;
@@ -3320,13 +3320,13 @@ ADDRESS_MAP_END
static READ16_HANDLER( akamaru_protection1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->prot_16 & 0x0008) ? 0x0001 : 0x0000;
}
static WRITE16_HANDLER( akamaru_protection1_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int bank;
COMBINE_DATA(&state->prot_16);
@@ -3344,17 +3344,17 @@ static READ16_HANDLER( akamaru_protection2_r )
static READ16_HANDLER( akamaru_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 dsw = 0;
- if (state->dsw_sel16[1] == 0xff) dsw |= input_port_read(space->machine, "DSW1");
- if (state->dsw_sel16[0] == 0xff) dsw |= input_port_read(space->machine, "DSW2");
+ if (state->dsw_sel16[1] == 0xff) dsw |= input_port_read(space->machine(), "DSW1");
+ if (state->dsw_sel16[0] == 0xff) dsw |= input_port_read(space->machine(), "DSW2");
return dsw;
}
static READ16_HANDLER( akamaru_blitter_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag << 6; // bit 7 = 1 -> blitter busy
}
@@ -3415,7 +3415,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjflove_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0xf);
+ memory_set_bank(space->machine(), "bank1", data & 0xf);
}
static WRITE8_DEVICE_HANDLER( mjflove_okibank_w )
@@ -3432,21 +3432,21 @@ static READ8_HANDLER( mjflove_protection_r )
static READ8_HANDLER( mjflove_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
return val;
}
static CUSTOM_INPUT( mjflove_blitter_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
// bit 7 = 1 -> blitter busy
// bit 6 = 0 -> VBLANK?
@@ -3462,7 +3462,7 @@ static WRITE8_HANDLER( mjflove_blitter_w )
static WRITE8_HANDLER( mjflove_coincounter_w )
{
// bit 0 = in counter
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
if (data & 0xfe)
{
@@ -3513,7 +3513,7 @@ static WRITE8_DEVICE_HANDLER( jongtei_okibank_w )
static WRITE8_HANDLER( jongtei_dsw_keyb_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
state->keyb = data;
}
@@ -3557,16 +3557,16 @@ ADDRESS_MAP_END
static READ8_HANDLER( sryudens_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
if (offset)
val &= 0x7f; // bit 7 = blitter busy
return val;
@@ -3580,7 +3580,7 @@ static WRITE8_HANDLER( sryudens_coincounter_w )
// bit 4
// bit 7 = ? mostly on
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0x68)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -3592,7 +3592,7 @@ static WRITE8_HANDLER( sryudens_coincounter_w )
static WRITE8_HANDLER( sryudens_rambank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", data & 0x0f);
//logerror("%04x: rambank = %02x\n", cpu_get_pc(space->cpu), data);
}
@@ -3634,31 +3634,31 @@ ADDRESS_MAP_END
static READ8_HANDLER( daimyojn_keyb1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), "KEY4");
- val |= input_port_read(space->machine, "BET");
+ val |= input_port_read(space->machine(), "BET");
return val;
}
static READ8_HANDLER( daimyojn_keyb2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, "KEY5");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, "KEY6");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, "KEY7");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, "KEY8");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), "KEY5");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), "KEY6");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), "KEY7");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), "KEY8");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), "KEY9");
- val |= input_port_read(space->machine, "HOPPER");
+ val |= input_port_read(space->machine(), "HOPPER");
return val;
}
@@ -3667,13 +3667,13 @@ static READ8_HANDLER( daimyojn_keyb2_r )
static WRITE8_HANDLER( daimyojn_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->prot_val = data;
}
static READ8_HANDLER( daimyojn_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->prot_val)
{
case 0xd4: return 0x96;
@@ -3693,13 +3693,13 @@ static WRITE8_DEVICE_HANDLER( daimyojn_okibank_w )
static WRITE8_HANDLER( daimyojn_palette_sel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->daimyojn_palette_sel = data;
}
static WRITE8_HANDLER( daimyojn_blitter_data_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->daimyojn_palette_sel & 0x01)
hanakanz_palette_w(space, offset, data);
@@ -7574,11 +7574,11 @@ INPUT_PORTS_END
static MACHINE_START( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->oki = machine->device<okim6295_device>("oki");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->oki = machine.device<okim6295_device>("oki");
state->save_item(NAME(state->input_sel));
state->save_item(NAME(state->dsw_sel));
@@ -7607,7 +7607,7 @@ static MACHINE_START( ddenlovr )
static MACHINE_RESET( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->input_sel = 0;
state->dsw_sel = 0;
@@ -7637,7 +7637,7 @@ static MACHINE_RESET( ddenlovr )
static MACHINE_START( rongrong )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x010000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x110000], 0x1000);
@@ -7646,7 +7646,7 @@ static MACHINE_START( rongrong )
static MACHINE_START( mmpanic )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
MACHINE_START_CALL(ddenlovr);
@@ -7654,7 +7654,7 @@ static MACHINE_START( mmpanic )
static MACHINE_START( funkyfig )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7663,7 +7663,7 @@ static MACHINE_START( funkyfig )
static MACHINE_START( hanakanz )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 0x10, &ROM[0x90000], 0x1000);
@@ -7672,7 +7672,7 @@ static MACHINE_START( hanakanz )
static MACHINE_START( mjmyster )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7681,7 +7681,7 @@ static MACHINE_START( mjmyster )
static MACHINE_START( hparadis )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x50000], 0x1000);
@@ -7690,7 +7690,7 @@ static MACHINE_START( hparadis )
static MACHINE_START( mjflove )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7699,7 +7699,7 @@ static MACHINE_START( mjflove )
static MACHINE_START( sryudens )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 0x10, &ROM[0x90000], 0x1000);
@@ -7811,7 +7811,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( quizchq_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -7892,7 +7892,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( mmpanic_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -7966,7 +7966,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( hanakanz_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8044,7 +8044,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( mjchuuka_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8160,7 +8160,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( hginga_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8254,7 +8254,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mjflove_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->mjflove_irq_cause = 1 | (1 << 1);
@@ -9107,7 +9107,7 @@ static DRIVER_INIT( rongrong )
version of the game might be a bootleg with the protection
patched. (both sets need this)
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x60d4, 0x60d4);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x60d4, 0x60d4);
}
/***************************************************************************
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index 3f6940b9317..b20633a97e2 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -118,15 +118,15 @@ INLINE int scanline_to_vcount( int scanline )
static TIMER_DEVICE_CALLBACK( ddragon_scanline )
{
- ddragon_state *state = timer.machine->driver_data<ddragon_state>();
+ ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8)
@@ -147,16 +147,16 @@ static TIMER_DEVICE_CALLBACK( ddragon_scanline )
static MACHINE_START( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
/* configure banks */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->sub_cpu = machine->device("sub");
- state->snd_cpu = machine->device("soundcpu");
- state->adpcm_1 = machine->device("adpcm1");
- state->adpcm_2 = machine->device("adpcm2");
+ state->maincpu = machine.device("maincpu");
+ state->sub_cpu = machine.device("sub");
+ state->snd_cpu = machine.device("soundcpu");
+ state->adpcm_1 = machine.device("adpcm1");
+ state->adpcm_2 = machine.device("adpcm2");
/* register for save states */
state->save_item(NAME(state->dd_sub_cpu_busy));
@@ -171,7 +171,7 @@ static MACHINE_START( ddragon )
static MACHINE_RESET( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->dd_sub_cpu_busy = 1;
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
@@ -192,10 +192,10 @@ static MACHINE_RESET( ddragon )
static WRITE8_HANDLER( ddragon_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
- flip_screen_set(space->machine, ~data & 0x04);
+ flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
@@ -204,35 +204,35 @@ static WRITE8_HANDLER( ddragon_bankswitch_w )
else if (state->dd_sub_cpu_busy == 0)
device_set_input_line(state->sub_cpu, state->sprite_irq, (state->sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
- memory_set_bank(space->machine, "bank1", (data & 0xe0) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0xe0) >> 5);
}
static WRITE8_HANDLER( toffy_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
-// flip_screen_set(space->machine, ~data & 0x04);
+// flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
/* I don't know ... */
- memory_set_bank(space->machine, "bank1", (data & 0x20) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0x20) >> 5);
}
static READ8_HANDLER( darktowr_mcu_bank_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
// logerror("BankRead %05x %08x\n",cpu_get_pc(space->cpu),offset);
/* Horrible hack - the alternate TStrike set is mismatched against the MCU,
so just hack around the protection here. (The hacks are 'right' as I have
the original source code & notes to this version of TStrike to examine).
*/
- if (!strcmp(space->machine->system().name, "tstrike"))
+ if (!strcmp(space->machine().system().name, "tstrike"))
{
/* Static protection checks at boot-up */
if (cpu_get_pc(space->cpu) == 0x9ace)
@@ -254,7 +254,7 @@ static READ8_HANDLER( darktowr_mcu_bank_r )
static WRITE8_HANDLER( darktowr_mcu_bank_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(space->cpu), offset, data);
if (offset == 0x1400 || offset == 0)
@@ -267,14 +267,14 @@ static WRITE8_HANDLER( darktowr_mcu_bank_w )
static WRITE8_HANDLER( darktowr_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
- int oldbank = memory_get_bank(space->machine, "bank1");
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ int oldbank = memory_get_bank(space->machine(), "bank1");
int newbank = (data & 0xe0) >> 5;
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
-// flip_screen_set(space->machine, ~data & 0x04);
+// flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
@@ -283,7 +283,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
else if (state->dd_sub_cpu_busy == 0)
device_set_input_line(state->sub_cpu, state->sprite_irq, (state->sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
- memory_set_bank(space->machine, "bank1", newbank);
+ memory_set_bank(space->machine(), "bank1", newbank);
if (newbank == 4 && oldbank != 4)
space->install_legacy_readwrite_handler(0x4000, 0x7fff, FUNC(darktowr_mcu_bank_r), FUNC(darktowr_mcu_bank_w));
else if (newbank != 4 && oldbank == 4)
@@ -300,7 +300,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
static WRITE8_HANDLER( ddragon_interrupt_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
switch (offset)
{
case 0: /* 380b - NMI ack */
@@ -329,21 +329,21 @@ static WRITE8_HANDLER( ddragon_interrupt_w )
static WRITE8_HANDLER( ddragon2_sub_irq_ack_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->sub_cpu, state->sprite_irq, CLEAR_LINE );
}
static WRITE8_HANDLER( ddragon2_sub_irq_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE);
}
static void irq_handler( device_t *device, int irq )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
device_set_input_line(state->snd_cpu, state->ym_irq , irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -357,14 +357,14 @@ static void irq_handler( device_t *device, int irq )
static CUSTOM_INPUT( sub_cpu_busy )
{
- ddragon_state *state = field->port->machine->driver_data<ddragon_state>();
+ ddragon_state *state = field->port->machine().driver_data<ddragon_state>();
return state->dd_sub_cpu_busy;
}
static WRITE8_HANDLER( darktowr_mcu_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(space->cpu), offset, data);
state->darktowr_mcu_ports[offset] = data;
}
@@ -379,7 +379,7 @@ static READ8_HANDLER( ddragon_hd63701_internal_registers_r )
static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* I don't know why port 0x17 is used.. Doesn't seem to be a standard MCU port */
if (offset == 0x17)
@@ -405,7 +405,7 @@ static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w )
static READ8_HANDLER( ddragon_spriteram_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* Double Dragon crash fix - see notes above */
if (offset == 0x49 && cpu_get_pc(space->cpu) == 0x6261 && state->spriteram[offset] == 0x1f)
@@ -417,7 +417,7 @@ static READ8_HANDLER( ddragon_spriteram_r )
static WRITE8_HANDLER( ddragon_spriteram_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
if (space->cpu == state->sub_cpu && offset == 0)
state->dd_sub_cpu_busy = 1;
@@ -435,7 +435,7 @@ static WRITE8_HANDLER( ddragon_spriteram_w )
static WRITE8_HANDLER( dd_adpcm_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_t *adpcm = (offset & 1) ? state->adpcm_2 : state->adpcm_1;
int chip = (adpcm == state->adpcm_1) ? 0 : 1;
@@ -464,7 +464,7 @@ static WRITE8_HANDLER( dd_adpcm_w )
static void dd_adpcm_int( device_t *device )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
int chip = (device == state->adpcm_1) ? 0 : 1;
if (state->adpcm_pos[chip] >= state->adpcm_end[chip] || state->adpcm_pos[chip] >= 0x10000)
@@ -479,7 +479,7 @@ static void dd_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
state->adpcm_data[chip] = ROM[state->adpcm_pos[chip]++];
msm5205_data_w(device, state->adpcm_data[chip] >> 4);
@@ -489,7 +489,7 @@ static void dd_adpcm_int( device_t *device )
static READ8_HANDLER( dd_adpcm_status_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
return state->adpcm_idle[0] + (state->adpcm_idle[1] << 1);
}
@@ -576,7 +576,7 @@ ADDRESS_MAP_END
/* might not be 100% accurate, check bits written */
static WRITE8_HANDLER( ddragonba_port_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE);
device_set_input_line(state->sub_cpu, state->sprite_irq, CLEAR_LINE );
}
@@ -1996,7 +1996,7 @@ ROM_END
static DRIVER_INIT( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
@@ -2006,7 +2006,7 @@ static DRIVER_INIT( ddragon )
static DRIVER_INIT( ddragon2 )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = INPUT_LINE_NMI;
state->ym_irq = 0;
@@ -2016,47 +2016,47 @@ static DRIVER_INIT( ddragon2 )
static DRIVER_INIT( darktowr )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
state->technos_video_hw = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(darktowr_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(darktowr_bankswitch_w));
}
static DRIVER_INIT( toffy )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
int i, length;
UINT8 *rom;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
state->technos_video_hw = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(toffy_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(toffy_bankswitch_w));
/* the program rom has a simple bitswap encryption */
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0);
/* and the fg gfx ... */
- rom = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
/* and the sprites gfx */
- rom = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1);
/* and the bg gfx */
- rom = machine->region("gfx3")->base();
- length = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ length = machine.region("gfx3")->bytes();
for (i = 0; i < length / 2; i++)
{
rom[i + 0*length/2] = BITSWAP8(rom[i + 0*length/2], 7,6,1,4,3,2,5,0);
@@ -2068,12 +2068,12 @@ static DRIVER_INIT( toffy )
static DRIVER_INIT( ddragon6809 )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
int i;
UINT8 *dst,*src;
- src = machine->region("chars")->base();
- dst = machine->region("gfx1")->base();
+ src = machine.region("chars")->base();
+ dst = machine.region("gfx1")->base();
for (i = 0; i < 0x8000; i++)
{
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index 30603e503c4..74e9172d792 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -162,7 +162,7 @@ static WRITE8_DEVICE_HANDLER( oki_bankswitch_w )
static WRITE16_HANDLER( ddragon3_io_w )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
COMBINE_DATA(&state->io_reg[offset]);
@@ -516,7 +516,7 @@ GFXDECODE_END
static void dd3_ymirq_handler(device_t *device, int irq)
{
- ddragon3_state *state = device->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = device->machine().driver_data<ddragon3_state>();
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -533,21 +533,21 @@ static const ym2151_interface ym2151_config =
static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
{
- ddragon3_state *state = timer.machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = timer.machine().driver_data<ddragon3_state>();
int scanline = param;
/* An interrupt is generated every 16 scanlines */
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
device_set_input_line(state->maincpu, 5, ASSERT_LINE);
}
/* Vblank is raised on scanline 248 */
if (scanline == 248)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
device_set_input_line(state->maincpu, 6, ASSERT_LINE);
}
}
@@ -560,10 +560,10 @@ static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
static MACHINE_START( ddragon3 )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->vreg));
state->save_item(NAME(state->bg_scrollx));
@@ -576,7 +576,7 @@ static MACHINE_START( ddragon3 )
static MACHINE_RESET( ddragon3 )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
int i;
state->vreg = 0;
diff --git a/src/mame/drivers/ddribble.c b/src/mame/drivers/ddribble.c
index 9fa210e3f9f..7c711289cc5 100644
--- a/src/mame/drivers/ddribble.c
+++ b/src/mame/drivers/ddribble.c
@@ -20,14 +20,14 @@
static INTERRUPT_GEN( ddribble_interrupt_0 )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
if (state->int_enable_0)
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
static INTERRUPT_GEN( ddribble_interrupt_1 )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
if (state->int_enable_1)
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
@@ -35,31 +35,31 @@ static INTERRUPT_GEN( ddribble_interrupt_1 )
static WRITE8_HANDLER( ddribble_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static READ8_HANDLER( ddribble_sharedram_r )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( ddribble_sharedram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->sharedram[offset] = data;
}
static READ8_HANDLER( ddribble_snd_sharedram_r )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
return state->snd_sharedram[offset];
}
static WRITE8_HANDLER( ddribble_snd_sharedram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->snd_sharedram[offset] = data;
}
@@ -69,13 +69,13 @@ static WRITE8_HANDLER( ddribble_coin_counter_w )
/* b2-b3: unknown */
/* b1: coin counter 2 */
/* b0: coin counter 1 */
- coin_counter_w(space->machine, 0,(data) & 0x01);
- coin_counter_w(space->machine, 1,(data >> 1) & 0x01);
+ coin_counter_w(space->machine(), 0,(data) & 0x01);
+ coin_counter_w(space->machine(), 1,(data >> 1) & 0x01);
}
static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
{
- return device->machine->rand(); /* patch */
+ return device->machine().rand(); /* patch */
/* FIXME: remove ? */
#if 0
if (vlm5030_bsy(device)) return 1;
@@ -85,8 +85,8 @@ static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
static WRITE8_DEVICE_HANDLER( ddribble_vlm5030_ctrl_w )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
- UINT8 *SPEECH_ROM = device->machine->region("vlm")->base();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
+ UINT8 *SPEECH_ROM = device->machine().region("vlm")->base();
/* b7 : vlm data bus OE */
@@ -250,13 +250,13 @@ static const vlm5030_interface vlm5030_config =
static MACHINE_START( ddribble )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000);
- state->filter1 = machine->device("filter1");
- state->filter2 = machine->device("filter2");
- state->filter3 = machine->device("filter3");
+ state->filter1 = machine.device("filter1");
+ state->filter2 = machine.device("filter2");
+ state->filter3 = machine.device("filter3");
state->save_item(NAME(state->int_enable_0));
state->save_item(NAME(state->int_enable_1));
@@ -267,7 +267,7 @@ static MACHINE_START( ddribble )
static MACHINE_RESET( ddribble )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
int i;
for (i = 0; i < 5; i++)
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index de4b987e72c..ecb6055ca41 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -48,11 +48,11 @@ Dip locations and factory settings verified with US manual
static READ16_HANDLER( ghunter_trackball_low_r )
{
- return (input_port_read(space->machine, "TRACKX") & 0xff) | ((input_port_read(space->machine, "TRACKY") & 0xff) << 8);
+ return (input_port_read(space->machine(), "TRACKX") & 0xff) | ((input_port_read(space->machine(), "TRACKY") & 0xff) << 8);
}
static READ16_HANDLER( ghunter_trackball_high_r )
{
- return ((input_port_read(space->machine, "TRACKX") & 0x0f00) >> 4) | (input_port_read(space->machine, "TRACKY") & 0x0f00);
+ return ((input_port_read(space->machine(), "TRACKX") & 0x0f00) >> 4) | (input_port_read(space->machine(), "TRACKY") & 0x0f00);
}
/* Memory Maps */
@@ -403,8 +403,8 @@ static DRIVER_INIT( ghunter )
seibu_sound_decrypt(machine, "audiocpu", 0x2000);
seibu_adpcm_decrypt(machine, "adpcm");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x80001, FUNC(ghunter_trackball_low_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0000, 0xb0001, FUNC(ghunter_trackball_high_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x80001, FUNC(ghunter_trackball_low_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0000, 0xb0001, FUNC(ghunter_trackball_high_r));
}
/* Game Drivers */
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 5d4db30c709..9af5f646fc6 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -183,12 +183,12 @@ static WRITE16_HANDLER( dec0_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
case 6: /* Intel 8751 microcontroller - Bad Dudes, Heavy Barrel, Birdy Try only */
- dec0_i8751_write(space->machine, data);
+ dec0_i8751_write(space->machine(), data);
break;
case 8: /* Interrupt ack (VBL - IRQ 6) */
@@ -202,7 +202,7 @@ static WRITE16_HANDLER( dec0_control_w )
break;
case 0xe: /* Reset Intel 8751? - not sure, all the games write here at startup */
- dec0_i8751_reset(space->machine);
+ dec0_i8751_reset(space->machine());
logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(space->cpu),data,0x30c010+(offset<<1));
break;
@@ -221,7 +221,7 @@ static WRITE16_HANDLER( automat_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
break;
@@ -254,7 +254,7 @@ static WRITE16_HANDLER( slyspy_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
case 2:
@@ -268,7 +268,7 @@ static WRITE16_HANDLER( midres_sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -330,13 +330,13 @@ READ16_HANDLER( slyspy_controls_r )
switch (offset<<1)
{
case 0: /* Dip Switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 4: /* Credits */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
logerror("Unknown control read at 30c000 %d\n", offset);
@@ -394,35 +394,35 @@ READ16_HANDLER( slyspy_protection_r )
static WRITE16_HANDLER( unmapped_w )
{
// fall through for unmapped protection areas
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
logerror("unmapped memory write to %04x = %04x in mode %d\n", 0x240000+offset*2, data, state->slyspy_state);
}
-void slyspy_set_protection_map(running_machine* machine, int type);
+void slyspy_set_protection_map(running_machine& machine, int type);
WRITE16_HANDLER( slyspy_state_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->slyspy_state=0;
- slyspy_set_protection_map(space->machine, state->slyspy_state);
+ slyspy_set_protection_map(space->machine(), state->slyspy_state);
}
READ16_HANDLER( slyspy_state_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->slyspy_state++;
state->slyspy_state=state->slyspy_state%4;
- slyspy_set_protection_map(space->machine, state->slyspy_state);
+ slyspy_set_protection_map(space->machine(), state->slyspy_state);
return 0; /* Value doesn't mater */
}
-void slyspy_set_protection_map(running_machine* machine, int type)
+void slyspy_set_protection_map(running_machine& machine, int type)
{
- address_space* space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine->device<deco_bac06_device>("tilegen1");
- deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine->device<deco_bac06_device>("tilegen2");
+ deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen1");
+ deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen2");
space->install_legacy_write_handler( 0x240000, 0x24ffff, FUNC(unmapped_w));
@@ -640,7 +640,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( automat_adpcm_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->automat_adpcm_byte = data;
}
@@ -1254,12 +1254,12 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate); /* IRQ */
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate); /* IRQ */
}
static void sound_irq2(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, linestate); /* IRQ2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, linestate); /* IRQ2 */
}
static const ym3812_interface ym3812_config =
@@ -1277,7 +1277,7 @@ static const ym3812_interface ym3812b_interface =
static void automat_vclk_cb(device_t *device)
{
- dec0_state *state = device->machine->driver_data<dec0_state>();
+ dec0_state *state = device->machine().driver_data<dec0_state>();
if (state->automat_msm5205_vclk_toggle == 0)
{
msm5205_data_w(device, state->automat_adpcm_byte & 0xf);
@@ -1285,7 +1285,7 @@ static void automat_vclk_cb(device_t *device)
else
{
msm5205_data_w(device, state->automat_adpcm_byte >> 4);
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
state->automat_msm5205_vclk_toggle ^= 1;
@@ -2906,12 +2906,12 @@ ROM_END
// helper function
#if 0
-static void dump_to_file(running_machine* machine, UINT8* ROM, int offset, int size)
+static void dump_to_file(running_machine& machine, UINT8* ROM, int offset, int size)
{
{
FILE *fp;
char filename[256];
- sprintf(filename,"%s_%08x_%08x", machine->system().name, offset, size);
+ sprintf(filename,"%s_%08x_%08x", machine.system().name, offset, size);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -2924,7 +2924,7 @@ static void dump_to_file(running_machine* machine, UINT8* ROM, int offset, int s
static DRIVER_INIT( convert_robocop_gfx4_to_automat )
{
- UINT8* R = machine->region("gfx4")->base();
+ UINT8* R = machine.region("gfx4")->base();
int i;
for (i=0;i<0x80000;i++)
@@ -2945,10 +2945,10 @@ static DRIVER_INIT( convert_robocop_gfx4_to_automat )
static DRIVER_INIT( midresb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00180000, 0x0018000f, FUNC(dec0_controls_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001a0000, 0x001a000f, FUNC(dec0_rotary_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00180000, 0x0018000f, FUNC(dec0_controls_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001a0000, 0x001a000f, FUNC(dec0_rotary_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00180014, 0x00180015, FUNC(midres_sound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00180014, 0x00180015, FUNC(midres_sound_w) );
}
/******************************************************************************/
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 3241a370b3d..988fd4b5c44 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -55,25 +55,25 @@ To do:
/* Only used by ghostb, gondo, garyoret, other games can control buffering */
static SCREEN_EOF( dec8 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
static READ8_HANDLER( i8751_h_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
return state->i8751_return >> 8; /* MSB */
}
static READ8_HANDLER( i8751_l_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
return state->i8751_return & 0xff; /* LSB */
}
static WRITE8_HANDLER( i8751_reset_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
}
@@ -81,28 +81,28 @@ static WRITE8_HANDLER( i8751_reset_w )
static READ8_HANDLER( gondo_player_1_r )
{
- int val = 1 << input_port_read(space->machine, "AN0");
+ int val = 1 << input_port_read(space->machine(), "AN0");
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN0") & 0xf);
+ return ((~val >> 4) & 0xf0) | (input_port_read(space->machine(), "IN0") & 0xf);
}
return 0xff;
}
static READ8_HANDLER( gondo_player_2_r )
{
- int val = 1 << input_port_read(space->machine, "AN1");
+ int val = 1 << input_port_read(space->machine(), "AN1");
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN1") & 0xf);
+ return ((~val >> 4) & 0xf0) | (input_port_read(space->machine(), "IN1") & 0xf);
}
return 0xff;
}
@@ -119,20 +119,20 @@ static TIMER_CALLBACK( dec8_i8751_timer_callback )
{
// The schematics show a clocked LS194 shift register (3A) is used to automatically
// clear the IRQ request. The MCU does not clear it itself.
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
}
static WRITE8_HANDLER( dec8_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
case 0: /* High byte - SECIRQ is trigged on activating this latch */
state->i8751_value = (state->i8751_value & 0xff) | (data << 8);
device_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
- space->machine->scheduler().timer_set(state->mcu->clocks_to_attotime(64), FUNC(dec8_i8751_timer_callback)); // 64 clocks not confirmed
+ space->machine().scheduler().timer_set(state->mcu->clocks_to_attotime(64), FUNC(dec8_i8751_timer_callback)); // 64 clocks not confirmed
break;
case 1: /* Low byte */
state->i8751_value = (state->i8751_value & 0xff00) | data;
@@ -148,7 +148,7 @@ static WRITE8_HANDLER( dec8_i8751_w )
static WRITE8_HANDLER( srdarwin_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -168,8 +168,8 @@ static WRITE8_HANDLER( srdarwin_i8751_w )
if (state->i8751_value == 0x5000) state->i8751_return = ((state->coin1 / 10) << 4) | (state->coin1 % 10); /* Coin request */
if (state->i8751_value == 0x6000) {state->i8751_value = -1; state->coin1--; } /* Coin clear */
/* Nb: Command 0x4000 for setting coinage options is not sup3ed */
- if ((input_port_read(space->machine, "FAKE") & 1) == 1) state->latch = 1;
- if ((input_port_read(space->machine, "FAKE") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "FAKE") & 1) == 1) state->latch = 1;
+ if ((input_port_read(space->machine(), "FAKE") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
/* This next value is the index to a series of tables,
each table controls the end of level bad guy, wrong values crash the
@@ -223,7 +223,7 @@ bb63 = Square things again
static WRITE8_HANDLER( shackled_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -238,9 +238,9 @@ static WRITE8_HANDLER( shackled_i8751_w )
}
/* Coins are controlled by the i8751 */
- if (/*(input_port_read(space->machine, "IN2") & 3) == 3*/!state->latch) {state->latch = 1; state->coin1 = state->coin2 = 0;}
- if ((input_port_read(space->machine, "IN2") & 1) != 1 && state->latch) {state->coin1 = 1; state->latch = 0;}
- if ((input_port_read(space->machine, "IN2") & 2) != 2 && state->latch) {state->coin2 = 1; state->latch = 0;}
+ if (/*(input_port_read(space->machine(), "IN2") & 3) == 3*/!state->latch) {state->latch = 1; state->coin1 = state->coin2 = 0;}
+ if ((input_port_read(space->machine(), "IN2") & 1) != 1 && state->latch) {state->coin1 = 1; state->latch = 0;}
+ if ((input_port_read(space->machine(), "IN2") & 2) != 2 && state->latch) {state->coin2 = 1; state->latch = 0;}
if (state->i8751_value == 0x0050) state->i8751_return = 0; /* Breywood ID */
if (state->i8751_value == 0x0051) state->i8751_return = 0; /* Shackled ID */
@@ -252,7 +252,7 @@ static WRITE8_HANDLER( shackled_i8751_w )
static WRITE8_HANDLER( lastmisn_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -269,8 +269,8 @@ static WRITE8_HANDLER( lastmisn_i8751_w )
if (offset == 0)
{
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "IN2") & 3) == 3 && !state->latch) state->latch = 1;
- if ((input_port_read(space->machine, "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x400; state->i8751_return = 0x400; return;}
+ if ((input_port_read(space->machine(), "IN2") & 3) == 3 && !state->latch) state->latch = 1;
+ if ((input_port_read(space->machine(), "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x400; state->i8751_return = 0x400; return;}
if (state->i8751_value == 0x007a) state->i8751_return = 0x0185; /* Japan ID code */
if (state->i8751_value == 0x007b) state->i8751_return = 0x0184; /* USA ID code */
if (state->i8751_value == 0x0001) {state->coin1 = state->snd = 0;}//???
@@ -284,7 +284,7 @@ static WRITE8_HANDLER( lastmisn_i8751_w )
static WRITE8_HANDLER( csilver_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -301,8 +301,8 @@ static WRITE8_HANDLER( csilver_i8751_w )
if (offset == 0)
{
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "IN2") & 3) == 3 && !state->latch) state->latch = 1;
- if ((input_port_read(space->machine, "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x1200; state->i8751_return = 0x1200; return;}
+ if ((input_port_read(space->machine(), "IN2") & 3) == 3 && !state->latch) state->latch = 1;
+ if ((input_port_read(space->machine(), "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x1200; state->i8751_return = 0x1200; return;}
if (state->i8751_value == 0x054a) {state->i8751_return = ~(0x4a); state->coin1 = 0; state->snd = 0;} /* Captain Silver (Japan) ID */
if (state->i8751_value == 0x054c) {state->i8751_return = ~(0x4c); state->coin1 = 0; state->snd = 0;} /* Captain Silver (World) ID */
@@ -314,7 +314,7 @@ static WRITE8_HANDLER( csilver_i8751_w )
static WRITE8_HANDLER( garyoret_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -328,9 +328,9 @@ static WRITE8_HANDLER( garyoret_i8751_w )
}
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "I8751") & 3) == 3) state->latch = 1;
- if ((input_port_read(space->machine, "I8751") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
- if ((input_port_read(space->machine, "I8751") & 2) != 2 && state->latch) {state->coin2++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "I8751") & 3) == 3) state->latch = 1;
+ if ((input_port_read(space->machine(), "I8751") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "I8751") & 2) != 2 && state->latch) {state->coin2++; state->latch = 0;}
/* Work out return values */
if ((state->i8751_value >> 8) == 0x00) {state->i8751_return = 0; state->coin1 = state->coin2 = 0;}
@@ -344,13 +344,13 @@ static WRITE8_HANDLER( garyoret_i8751_w )
static WRITE8_HANDLER( dec8_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
/* Used by Ghostbusters, Meikyuu Hunter G & Gondomania */
static WRITE8_HANDLER( ghostb_bank_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/* Bit 0: SECCLR - acknowledge interrupt from I8751
Bit 1: NMI enable/disable
@@ -359,11 +359,11 @@ static WRITE8_HANDLER( ghostb_bank_w )
Bits 4-7: Bank switch
*/
- memory_set_bank(space->machine, "bank1", data >> 4);
+ memory_set_bank(space->machine(), "bank1", data >> 4);
if ((data&1)==0) device_set_input_line(state->maincpu, M6809_IRQ_LINE, CLEAR_LINE);
if (data & 2) state->nmi_enable =1; else state->nmi_enable = 0;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static WRITE8_HANDLER( csilver_control_w )
@@ -375,19 +375,19 @@ static WRITE8_HANDLER( csilver_control_w )
Bit 0x40 - Unused.
Bit 0x80 - Hold subcpu reset line high if clear, else low? (Not needed anyway)
*/
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( dec8_sound_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static void csilver_adpcm_int( device_t *device )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
state->toggle ^= 1;
if (state->toggle)
device_set_input_line(state->audiocpu, M6502_IRQ_LINE, HOLD_LINE);
@@ -404,20 +404,20 @@ static READ8_DEVICE_HANDLER( csilver_adpcm_reset_r )
static WRITE8_HANDLER( csilver_adpcm_data_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->msm5205next = data;
}
static WRITE8_HANDLER( csilver_sound_bank_w )
{
- memory_set_bank(space->machine, "bank3", (data & 0x08) >> 3);
+ memory_set_bank(space->machine(), "bank3", (data & 0x08) >> 3);
}
/******************************************************************************/
static WRITE8_HANDLER( oscar_int_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/* Deal with interrupts, coins also generate NMI to CPU 0 */
switch (offset)
{
@@ -439,7 +439,7 @@ static WRITE8_HANDLER( oscar_int_w )
/* Used by Shackled, Last Mission, Captain Silver */
static WRITE8_HANDLER( shackled_int_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
#if 0
/* This is correct, but the cpus in Shackled need an interleave of about 5000!
With lower interleave CPU 0 misses an interrupt at the start of the game
@@ -482,16 +482,16 @@ static WRITE8_HANDLER( shackled_int_w )
/******************************************************************************/
-static READ8_HANDLER( shackled_sprite_r ) { return space->machine->generic.spriteram.u8[offset]; }
-static WRITE8_HANDLER( shackled_sprite_w ) { space->machine->generic.spriteram.u8[offset] = data; }
-static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine, data); }
+static READ8_HANDLER( shackled_sprite_r ) { return space->machine().generic.spriteram.u8[offset]; }
+static WRITE8_HANDLER( shackled_sprite_w ) { space->machine().generic.spriteram.u8[offset] = data; }
+static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine(), data); }
/******************************************************************************/
static WRITE8_HANDLER( dec8_mxc06_buffer_spriteram_w)
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
- UINT8* spriteram = space->machine->generic.spriteram.u8;
+ dec8_state *state = space->machine().driver_data<dec8_state>();
+ UINT8* spriteram = space->machine().generic.spriteram.u8;
// copy to a 16-bit region for the sprite chip
for (int i=0;i<0x800/2;i++)
{
@@ -842,7 +842,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( dec8_mcu_from_main_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
@@ -853,7 +853,7 @@ static READ8_HANDLER( dec8_mcu_from_main_r )
case 2:
return 0xff;
case 3:
- return input_port_read(space->machine, "I8751");
+ return input_port_read(space->machine(), "I8751");
}
return 0xff; //compile safe.
@@ -861,7 +861,7 @@ static READ8_HANDLER( dec8_mcu_from_main_r )
static WRITE8_HANDLER( dec8_mcu_to_main_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
// Outputs P0 and P1 are latched
if (offset==0) state->i8751_port0=data;
@@ -1898,7 +1898,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* M6502_IRQ_LINE */
}
@@ -1922,7 +1922,7 @@ static const msm5205_interface msm5205_config =
static INTERRUPT_GEN( gondo_interrupt )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); /* VBL */
}
@@ -1930,9 +1930,9 @@ static INTERRUPT_GEN( gondo_interrupt )
/* Coins generate NMI's */
static INTERRUPT_GEN( oscar_interrupt )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
- if ((input_port_read(device->machine, "IN2") & 0x7) == 0x7) state->latch = 1;
- if (state->latch && (input_port_read(device->machine, "IN2") & 0x7) != 0x7)
+ dec8_state *state = device->machine().driver_data<dec8_state>();
+ if ((input_port_read(device->machine(), "IN2") & 0x7) == 0x7) state->latch = 1;
+ if (state->latch && (input_port_read(device->machine(), "IN2") & 0x7) != 0x7)
{
state->latch = 0;
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -1944,12 +1944,12 @@ static INTERRUPT_GEN( oscar_interrupt )
static MACHINE_START( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->latch));
state->save_item(NAME(state->nmi_enable));
@@ -1970,7 +1970,7 @@ static MACHINE_START( dec8 )
static MACHINE_RESET( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int i;
state->nmi_enable = state->i8751_port0 = state->i8751_port1 = 0;
@@ -3443,21 +3443,21 @@ ROM_END
static DRIVER_INIT( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->latch = 0;
}
/* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */
static DRIVER_INIT( deco222 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ dec8_state *state = machine.driver_data<dec8_state>();
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
int A;
UINT8 *decrypt;
UINT8 *rom;
/* bits 5 and 6 of the opcodes are swapped */
- rom = machine->region("audiocpu")->base();
+ rom = machine.region("audiocpu")->base();
decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -3471,8 +3471,8 @@ static DRIVER_INIT( deco222 )
/* Below, I set up the correct number of banks depending on the "maincpu" region size */
static DRIVER_INIT( ghostb )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3483,8 +3483,8 @@ static DRIVER_INIT( ghostb )
static DRIVER_INIT( meikyuh )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3495,36 +3495,36 @@ static DRIVER_INIT( meikyuh )
static DRIVER_INIT( cobracom )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( oscar )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
static DRIVER_INIT( gondo )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( garyoret )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( csilver )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 14, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank3", 0, 2, &RAM[0x10000], 0x4000);
@@ -3533,21 +3533,21 @@ static DRIVER_INIT( csilver )
static DRIVER_INIT( shackled )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 14, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( lastmisn )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( srdarwin )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index ff74beb6e2e..9eb284e766c 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -46,7 +46,7 @@ public:
static VIDEO_START( wcvol95 )
{
- deco156_state *state = machine->driver_data<deco156_state>();
+ deco156_state *state = machine.driver_data<deco156_state>();
state->spriteram = auto_alloc_array(machine, UINT16, 0x2000/2);
/* and register the allocated ram so that save states still work */
@@ -59,17 +59,17 @@ static VIDEO_START( wcvol95 )
static SCREEN_UPDATE( wcvol95 )
{
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(screen->machine, 1);
+ flip_screen_set_no_update(screen->machine(), 1);
- deco156_state *state = screen->machine->driver_data<deco156_state>();
+ deco156_state *state = screen->machine().driver_data<deco156_state>();
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, NULL, 0);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x800);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
@@ -78,11 +78,11 @@ static SCREEN_UPDATE( wcvol95 )
static WRITE32_HANDLER(hvysmsh_eeprom_w)
{
- deco156_state *state = space->machine->driver_data<deco156_state>();
+ deco156_state *state = space->machine().driver_data<deco156_state>();
if (ACCESSING_BITS_0_7)
{
state->oki2->set_bank_base(0x40000 * (data & 0x7));
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -94,8 +94,8 @@ static WRITE32_DEVICE_HANDLER( hvysmsh_oki_0_bank_w )
static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w)
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
/* This is the same as deco32_nonbuffered_palette_w in video/deco32.c */
@@ -103,21 +103,21 @@ static WRITE32_HANDLER( deco156_nonbuffered_palette_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- b = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- r = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
-static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( wcvol95_spriteram_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->spriteram[offset] ^ 0xffff0000; }
-static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( wcvol95_spriteram_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->spriteram[offset]); }
+static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( wcvol95_spriteram_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->spriteram[offset] ^ 0xffff0000; }
+static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( wcvol95_spriteram_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->spriteram[offset]); }
static ADDRESS_MAP_START( hvysmsh_map, AS_PROGRAM, 32 )
@@ -606,10 +606,10 @@ ROM_END
/**********************************************************************************/
-static void descramble_sound( running_machine *machine, const char *tag )
+static void descramble_sound( running_machine &machine, const char *tag )
{
- UINT8 *rom = machine->region(tag)->base();
- int length = machine->region(tag)->bytes();
+ UINT8 *rom = machine.region(tag)->base();
+ int length = machine.region(tag)->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index b747f06c0be..7f67d33a31a 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -279,24 +279,24 @@ static const deco16ic_interface fghthist_deco16ic_tilegen2_intf =
#if 0
static WRITE32_HANDLER( deco32_pf12_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
COMBINE_DATA(&state->pf12_control[offset]);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static WRITE32_HANDLER( deco32_pf34_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
COMBINE_DATA(&state->pf34_control[offset]);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
#endif
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- cputag_set_input_line(timer.machine, "maincpu", ARM_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", ARM_IRQ_LINE, HOLD_LINE);
}
static READ32_HANDLER( deco32_irq_controller_r )
@@ -306,7 +306,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
switch (offset)
{
case 2: /* Raster IRQ ACK - value read is not used */
- cputag_set_input_line(space->machine, "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
return 0;
case 3: /* Irq controller
@@ -323,7 +323,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
/* ZV03082007 - video_screen_get_vblank() doesn't work for Captain America, as it expects
that this bit is NOT set in rows 0-7. */
- vblank = space->machine->primary_screen->vpos() > space->machine->primary_screen->visible_area().max_y;
+ vblank = space->machine().primary_screen->vpos() > space->machine().primary_screen->visible_area().max_y;
if (vblank)
return 0xffffff80 | 0x1 | 0x10; /* Assume VBL takes priority over possible raster/lightgun irq */
@@ -337,7 +337,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
static WRITE32_HANDLER( deco32_irq_controller_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
int scanline;
switch (offset) {
@@ -351,7 +351,7 @@ static WRITE32_HANDLER( deco32_irq_controller_w )
if (state->raster_enable && scanline>0 && scanline<240)
{
// needs +16 for the raster to align on captaven intro? (might just be our screen size / visible area / layer offsets need adjusting instead)
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(scanline+16, 320));
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(scanline+16, 320));
}
else
state->raster_irq_timer->reset();
@@ -364,7 +364,7 @@ static WRITE32_HANDLER( deco32_irq_controller_w )
static WRITE32_HANDLER( deco32_sound_w )
{
soundlatch_w(space,0,data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static READ32_HANDLER( deco32_71_r )
@@ -378,9 +378,9 @@ static READ32_HANDLER( captaven_prot_r )
{
/* Protection/IO chip 75, same as Lemmings & Robocop 2 */
switch (offset<<2) {
- case 0x0a0: return input_port_read(space->machine, "IN0"); /* Player 1 & 2 controls */
- case 0x158: return input_port_read(space->machine, "IN1"); /* Player 3 & 4 controls */
- case 0xed4: return input_port_read(space->machine, "IN2"); /* Misc */
+ case 0x0a0: return input_port_read(space->machine(), "IN0"); /* Player 1 & 2 controls */
+ case 0x158: return input_port_read(space->machine(), "IN1"); /* Player 3 & 4 controls */
+ case 0xed4: return input_port_read(space->machine(), "IN2"); /* Misc */
}
logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(space->cpu),offset<<2);
@@ -390,15 +390,15 @@ static READ32_HANDLER( captaven_prot_r )
static READ32_HANDLER( captaven_soundcpu_r )
{
/* Top byte - top bit low == sound cpu busy, bottom word is dips */
- return 0xffff0000 | input_port_read(space->machine, "DSW");
+ return 0xffff0000 | input_port_read(space->machine(), "DSW");
}
static READ32_HANDLER( fghthist_control_r )
{
switch (offset) {
- case 0: return 0xffff0000 | input_port_read(space->machine, "IN0");
- case 1: return 0xffff0000 | input_port_read(space->machine, "IN1"); //check top bits??
- case 2: return 0xfffffffe | eeprom_read_bit(space->machine->device("eeprom"));
+ case 0: return 0xffff0000 | input_port_read(space->machine(), "IN0");
+ case 1: return 0xffff0000 | input_port_read(space->machine(), "IN1"); //check top bits??
+ case 2: return 0xfffffffe | eeprom_read_bit(space->machine().device("eeprom"));
}
return 0xffffffff;
@@ -407,7 +407,7 @@ static READ32_HANDLER( fghthist_control_r )
static WRITE32_HANDLER( fghthist_eeprom_w )
{
if (ACCESSING_BITS_0_7) {
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x10);
eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
@@ -425,21 +425,21 @@ static WRITE32_HANDLER( fghthist_eeprom_w )
static READ32_HANDLER( dragngun_service_r )
{
// logerror("%08x:Read service\n",cpu_get_pc(space->cpu));
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static READ32_HANDLER( lockload_gun_mirror_r )
{
//logerror("%08x:Read gun %d\n",cpu_get_pc(space->cpu),offset);
-//return ((space->machine->rand()%0xffff)<<16) | space->machine->rand()%0xffff;
+//return ((space->machine().rand()%0xffff)<<16) | space->machine().rand()%0xffff;
if (offset) /* Mirror of player 1 and player 2 fire buttons */
- return input_port_read(space->machine, "IN4") | ((space->machine->rand()%0xff)<<16);
- return input_port_read(space->machine, "IN3") | input_port_read(space->machine, "LIGHT0_X") | (input_port_read(space->machine, "LIGHT0_X")<<16) | (input_port_read(space->machine, "LIGHT0_X")<<24); //((space->machine->rand()%0xff)<<16);
+ return input_port_read(space->machine(), "IN4") | ((space->machine().rand()%0xff)<<16);
+ return input_port_read(space->machine(), "IN3") | input_port_read(space->machine(), "LIGHT0_X") | (input_port_read(space->machine(), "LIGHT0_X")<<16) | (input_port_read(space->machine(), "LIGHT0_X")<<24); //((space->machine().rand()%0xff)<<16);
}
static READ32_HANDLER( dragngun_prot_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
// logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
if (!state->strobe) state->strobe=8;
@@ -448,9 +448,9 @@ static READ32_HANDLER( dragngun_prot_r )
//definitely vblank in locked load
switch (offset<<1) {
- case 0x140/2: return 0xffff0000 | input_port_read(space->machine, "IN0"); /* IN0 */
- case 0xadc/2: return 0xffff0000 | input_port_read(space->machine, "IN1") | state->strobe; /* IN1 */
- case 0x6a0/2: return 0xffff0000 | input_port_read(space->machine, "DSW"); /* IN2 (Dip switch) */
+ case 0x140/2: return 0xffff0000 | input_port_read(space->machine(), "IN0"); /* IN0 */
+ case 0xadc/2: return 0xffff0000 | input_port_read(space->machine(), "IN1") | state->strobe; /* IN1 */
+ case 0x6a0/2: return 0xffff0000 | input_port_read(space->machine(), "DSW"); /* IN2 (Dip switch) */
}
return 0xffffffff;
}
@@ -458,13 +458,13 @@ static READ32_HANDLER( dragngun_prot_r )
static READ32_HANDLER( dragngun_lightgun_r )
{
- dragngun_state *state = space->machine->driver_data<dragngun_state>();
+ dragngun_state *state = space->machine().driver_data<dragngun_state>();
/* Ports 0-3 are read, but seem unused */
switch (state->dragngun_lightgun_port) {
- case 4: return input_port_read(space->machine, "LIGHT0_X");
- case 5: return input_port_read(space->machine, "LIGHT1_X");
- case 6: return input_port_read(space->machine, "LIGHT0_Y");
- case 7: return input_port_read(space->machine, "LIGHT1_Y");
+ case 4: return input_port_read(space->machine(), "LIGHT0_X");
+ case 5: return input_port_read(space->machine(), "LIGHT1_X");
+ case 6: return input_port_read(space->machine(), "LIGHT0_Y");
+ case 7: return input_port_read(space->machine(), "LIGHT1_Y");
}
// logerror("Illegal lightgun port %d read \n",state->dragngun_lightgun_port);
@@ -473,7 +473,7 @@ static READ32_HANDLER( dragngun_lightgun_r )
static WRITE32_HANDLER( dragngun_lightgun_w )
{
- dragngun_state *state = space->machine->driver_data<dragngun_state>();
+ dragngun_state *state = space->machine().driver_data<dragngun_state>();
// logerror("Lightgun port %d\n",state->dragngun_lightgun_port);
state->dragngun_lightgun_port=offset;
}
@@ -491,7 +491,7 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
return;
}
- logerror("%s:Write control 1 %08x %08x\n",device->machine->describe_context(),offset,data);
+ logerror("%s:Write control 1 %08x %08x\n",device->machine().describe_context(),offset,data);
}
/**********************************************************************************/
@@ -499,10 +499,10 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
static READ32_HANDLER( tattass_prot_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
switch (offset<<1) {
- case 0x280: return input_port_read(space->machine, "IN0") << 16;
- case 0x4c4: return input_port_read(space->machine, "IN1") << 16;
+ case 0x280: return input_port_read(space->machine(), "IN0") << 16;
+ case 0x4c4: return input_port_read(space->machine(), "IN1") << 16;
case 0x35a: return state->tattass_eprom_bit << 16;
}
@@ -524,8 +524,8 @@ static WRITE32_HANDLER( tattass_prot_w )
static WRITE32_HANDLER( tattass_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- eeprom_device *eeprom = space->machine->device<eeprom_device>("eeprom");
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
address_space *eeprom_space = eeprom->space();
/* Eprom in low byte */
@@ -644,9 +644,9 @@ static WRITE32_HANDLER( tattass_control_w )
/* Sound board reset control */
if (data&0x80)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
/* bit 0x4 fade cancel? */
/* bit 0x8 ?? */
@@ -660,9 +660,9 @@ static READ32_HANDLER( nslasher_prot_r )
{
switch (offset<<1) {
- case 0x280: return input_port_read(space->machine, "IN0") << 16| 0xffff; /* IN0 */
- case 0x4c4: return input_port_read(space->machine, "IN1") << 16| 0xffff; /* IN1 */
- case 0x35a: return (eeprom_read_bit(space->machine->device("eeprom"))<< 16) | 0xffff; // Debug switch in low word??
+ case 0x280: return input_port_read(space->machine(), "IN0") << 16| 0xffff; /* IN0 */
+ case 0x4c4: return input_port_read(space->machine(), "IN1") << 16| 0xffff; /* IN1 */
+ case 0x35a: return (eeprom_read_bit(space->machine().device("eeprom"))<< 16) | 0xffff; // Debug switch in low word??
}
//logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
@@ -674,7 +674,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x10);
eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
@@ -686,7 +686,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w )
static WRITE32_HANDLER( nslasher_prot_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
//logerror("%08x:write prot %08x (%08x) %08x\n",cpu_get_pc(space->cpu),offset<<1,mem_mask,data);
/* Only sound port of chip is used - no protection */
@@ -695,7 +695,7 @@ static WRITE32_HANDLER( nslasher_prot_w )
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
soundlatch_w(space,0,(data>>16)&0xff);
state->nslasher_sound_irq |= 0x02;
- cputag_set_input_line(space->machine, "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -703,13 +703,13 @@ static WRITE32_HANDLER( nslasher_prot_w )
static READ32_HANDLER( deco32_spriteram_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
return state->spriteram16[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( deco32_spriteram_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&state->spriteram16[offset]);
@@ -717,19 +717,19 @@ static WRITE32_HANDLER( deco32_spriteram_w )
static WRITE32_HANDLER( deco32_buffer_spriteram_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
memcpy(state->spriteram16_buffered, state->spriteram16, 0x1000);
}
static READ32_HANDLER( deco32_spriteram2_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
return state->spriteram16_2[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( deco32_spriteram2_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&state->spriteram16_2[offset]);
@@ -737,16 +737,16 @@ static WRITE32_HANDLER( deco32_spriteram2_w )
static WRITE32_HANDLER( deco32_buffer_spriteram2_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
memcpy(state->spriteram16_2_buffered, state->spriteram16_2, 0x1000);
}
// tattass tests these as 32-bit ram, even if only 16-bits are hooked up to the tilemap chip - does it mirror parts of the dword?
-static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
static ADDRESS_MAP_START( captaven_map, AS_PROGRAM, 32 )
@@ -1032,36 +1032,36 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(deco32_bsmt_reset_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
UINT8 diff = data ^ state->bsmt_reset;
state->bsmt_reset = data;
if ((diff & 0x80) && !(data & 0x80))
- devtag_reset(space->machine, "bsmt");
+ devtag_reset(space->machine(), "bsmt");
}
static WRITE8_HANDLER(deco32_bsmt0_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
state->bsmt_latch = data;
}
static void bsmt_ready_callback(bsmt2000_device &device)
{
- cputag_set_input_line(device.machine, "audiocpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
+ cputag_set_input_line(device.machine(), "audiocpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
}
static WRITE8_HANDLER(deco32_bsmt1_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->write_reg(offset ^ 0xff);
bsmt->write_data((state->bsmt_latch << 8) | data);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
}
static READ8_HANDLER(deco32_bsmt_status_r)
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
@@ -1088,10 +1088,10 @@ ADDRESS_MAP_END
static READ8_HANDLER(latch_r)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
state->nslasher_sound_irq &= ~0x02;
- cputag_set_input_line(space->machine, "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
return soundlatch_r(space,0);
}
@@ -1689,24 +1689,24 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, state); /* IRQ 2 */
}
static void sound_irq_nslasher(device_t *device, int state)
{
- deco32_state *drvstate = device->machine->driver_data<deco32_state>();
+ deco32_state *drvstate = device->machine().driver_data<deco32_state>();
/* bit 0 of nslasher_sound_irq specifies IRQ from sound chip */
if (state)
drvstate->nslasher_sound_irq |= 0x01;
else
drvstate->nslasher_sound_irq &= ~0x01;
- cputag_set_input_line(device->machine, "audiocpu", 0, (drvstate->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (drvstate->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- okim6295_device *oki1 = device->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = device->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = device->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = device->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(((data >> 0)& 1) * 0x40000);
oki2->set_bank_base(((data >> 1)& 1) * 0x40000);
}
@@ -1733,8 +1733,8 @@ static const eeprom_interface eeprom_interface_tattass =
static MACHINE_RESET( deco32 )
{
- deco32_state *state = machine->driver_data<deco32_state>();
- state->raster_irq_timer = machine->device<timer_device>("int_timer");
+ deco32_state *state = machine.driver_data<deco32_state>();
+ state->raster_irq_timer = machine.device<timer_device>("int_timer");
}
static INTERRUPT_GEN( deco32_vbl_interrupt )
@@ -3251,9 +3251,9 @@ static DRIVER_INIT( captaven )
static DRIVER_INIT( dragngun )
{
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
- const UINT8 *SRC_RAM = machine->region("gfx1")->base();
- UINT8 *DST_RAM = machine->region("gfx2")->base();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ const UINT8 *SRC_RAM = machine.region("gfx1")->base();
+ UINT8 *DST_RAM = machine.region("gfx2")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3275,8 +3275,8 @@ static DRIVER_INIT( fghthist )
static DRIVER_INIT( lockload )
{
- UINT8 *RAM = machine->region("maincpu")->base();
-// UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
+// UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3292,7 +3292,7 @@ static DRIVER_INIT( lockload )
static DRIVER_INIT( tattass )
{
- UINT8 *RAM = machine->region("gfx1")->base();
+ UINT8 *RAM = machine.region("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3300,7 +3300,7 @@ static DRIVER_INIT( tattass )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine->region("gfx2")->base();
+ RAM = machine.region("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
@@ -3313,7 +3313,7 @@ static DRIVER_INIT( tattass )
static DRIVER_INIT( nslasher )
{
- UINT8 *RAM = machine->region("gfx1")->base();
+ UINT8 *RAM = machine.region("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3321,7 +3321,7 @@ static DRIVER_INIT( nslasher )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine->region("gfx2")->base();
+ RAM = machine.region("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c
index 53d49172dc7..d928babbd14 100644
--- a/src/mame/drivers/deco_ld.c
+++ b/src/mame/drivers/deco_ld.c
@@ -124,9 +124,9 @@ public:
static SCREEN_UPDATE( rblaster )
{
- deco_ld_state *state = screen->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = screen->machine().driver_data<deco_ld_state>();
UINT8 *videoram = state->videoram;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x0000;
int y,x;
@@ -150,19 +150,19 @@ static SCREEN_UPDATE( rblaster )
static WRITE8_HANDLER( rblaster_sound_w )
{
soundlatch_w(space,0,data);
- device_set_input_line(space->machine->cpu[1], 0, HOLD_LINE);
+ device_set_input_line(space->machine().cpu[1], 0, HOLD_LINE);
}
#endif
static WRITE8_HANDLER( rblaster_vram_bank_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->vram_bank = data;
}
static READ8_HANDLER( laserdisc_r )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
UINT8 result = laserdisc_data_r(state->laserdisc);
mame_printf_debug("laserdisc_r = %02X\n", result);
return result;
@@ -171,13 +171,13 @@ static READ8_HANDLER( laserdisc_r )
static WRITE8_HANDLER( laserdisc_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->laserdisc_data = data;
}
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( begas_map, AS_PROGRAM, 8 )
@@ -237,14 +237,14 @@ ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( nmimask_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->nmimask = data & 0x80;
}
#endif
static INTERRUPT_GEN ( sound_interrupt )
{
- deco_ld_state *state = device->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = device->machine().driver_data<deco_ld_state>();
if (!state->nmimask) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -510,8 +510,8 @@ GFXDECODE_END
static MACHINE_START( rblaster )
{
- deco_ld_state *state = machine->driver_data<deco_ld_state>();
- state->laserdisc = machine->device("laserdisc");
+ deco_ld_state *state = machine.driver_data<deco_ld_state>();
+ state->laserdisc = machine.device("laserdisc");
}
static MACHINE_CONFIG_START( rblaster, deco_ld_state )
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index ec68d51e8ef..e0c516ab582 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -110,9 +110,9 @@
static READ32_HANDLER(test2_r)
{
// if (offset==0)
-// return input_port_read(space->machine, "IN0"); //0xffffffff;
+// return input_port_read(space->machine(), "IN0"); //0xffffffff;
// logerror("%08x: Test2_r %d\n",cpu_get_pc(space->cpu),offset);
- return space->machine->rand(); //0xffffffff;
+ return space->machine().rand(); //0xffffffff;
}
static READ32_HANDLER(test3_r)
@@ -122,7 +122,7 @@ static READ32_HANDLER(test3_r)
*/
//if (offset==0)
-// return space->machine->rand()|(space->machine->rand()<<16);
+// return space->machine().rand()|(space->machine().rand()<<16);
// logerror("%08x: Test3_r %d\n",cpu_get_pc(space->cpu),offset);
return 0xffffffff;
}
@@ -141,19 +141,19 @@ static WRITE32_DEVICE_HANDLER( avengrs_eprom_w )
//volume control todo
}
else
- logerror("%s: eprom_w %08x mask %08x\n",device->machine->describe_context(),data,mem_mask);
+ logerror("%s: eprom_w %08x mask %08x\n",device->machine().describe_context(),data,mem_mask);
}
static WRITE32_HANDLER( avengrs_palette_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
/* x bbbbb ggggg rrrrr */
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
static READ32_HANDLER( decomlc_vbl_r )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
state->vbl_i ^=0xffffffff;
//logerror("vbl r %08x\n", cpu_get_pc(space->cpu));
// Todo: Vblank probably in $10
@@ -162,31 +162,31 @@ static READ32_HANDLER( decomlc_vbl_r )
static READ32_HANDLER( mlc_scanline_r )
{
-// logerror("read scanline counter (%d)\n", space->machine->primary_screen->vpos());
- return space->machine->primary_screen->vpos();
+// logerror("read scanline counter (%d)\n", space->machine().primary_screen->vpos());
+ return space->machine().primary_screen->vpos();
}
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- deco_mlc_state *state = timer.machine->driver_data<deco_mlc_state>();
-// logerror("hit scanline IRQ %d (%08x)\n", machine->primary_screen->vpos(), info.i);
- cputag_set_input_line(timer.machine, "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
+ deco_mlc_state *state = timer.machine().driver_data<deco_mlc_state>();
+// logerror("hit scanline IRQ %d (%08x)\n", machine.primary_screen->vpos(), info.i);
+ cputag_set_input_line(timer.machine(), "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
}
static WRITE32_HANDLER( mlc_irq_w )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
- int scanline=space->machine->primary_screen->vpos();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
+ int scanline=space->machine().primary_screen->vpos();
state->irq_ram[offset]=data&0xffff;
switch (offset*4)
{
case 0x10: /* IRQ ack. Value written doesn't matter */
- cputag_set_input_line(space->machine, "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
return;
case 0x14: /* Prepare scanline interrupt */
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(state->irq_ram[0x14/4]));
- //logerror("prepare scanline to fire at %d (currently on %d)\n", state->irq_ram[0x14/4], space->machine->primary_screen->vpos());
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(state->irq_ram[0x14/4]));
+ //logerror("prepare scanline to fire at %d (currently on %d)\n", state->irq_ram[0x14/4], space->machine().primary_screen->vpos());
return;
case 0x18:
case 0x1c:
@@ -222,13 +222,13 @@ static WRITE32_HANDLER( mlc_irq_w )
static READ32_HANDLER(mlc_spriteram_r)
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
return state->spriteram[offset]&0xffff;
}
static READ32_HANDLER(mlc_vram_r)
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
return state->mlc_vram[offset]&0xffff;
}
@@ -373,9 +373,9 @@ GFXDECODE_END
static MACHINE_RESET( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
state->vbl_i = 0xffffffff;
- state->raster_irq_timer = machine->device<timer_device>("int_timer");
+ state->raster_irq_timer = machine.device<timer_device>("int_timer");
}
static MACHINE_CONFIG_START( avengrgs, deco_mlc_state )
@@ -695,11 +695,11 @@ ROM_END
/***************************************************************************/
-static void descramble_sound( running_machine *machine )
+static void descramble_sound( running_machine &machine )
{
/* the same as simpl156 / heavy smash? */
- UINT8 *rom = machine->region("ymz")->base();
- int length = machine->region("ymz")->bytes();
+ UINT8 *rom = machine.region("ymz")->base();
+ int length = machine.region("ymz")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
@@ -725,7 +725,7 @@ static void descramble_sound( running_machine *machine )
static READ32_HANDLER( avengrgs_speedup_r )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
UINT32 a=state->mlc_ram[0x89a0/4];
UINT32 p=cpu_get_pc(space->cpu);
@@ -736,26 +736,26 @@ static READ32_HANDLER( avengrgs_speedup_r )
static DRIVER_INIT( avengrgs )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
// init options
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
// set up speed cheat
- sh2drc_add_pcflush(machine->device("maincpu"), 0x3234);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x32dc);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x3234);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x32dc);
state->mainCpuIsArm = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01089a0, 0x01089a3, FUNC(avengrgs_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01089a0, 0x01089a3, FUNC(avengrgs_speedup_r) );
descramble_sound(machine);
}
static DRIVER_INIT( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
/* The timing in the ARM core isn't as accurate as it should be, so bump up the
effective clock rate here to compensate otherwise we have slowdowns in
Skull Fung where there probably shouldn't be. */
- machine->device("maincpu")->set_clock_scale(2.0f);
+ machine.device("maincpu")->set_clock_scale(2.0f);
state->mainCpuIsArm = 1;
deco156_decrypt(machine);
descramble_sound(machine);
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index 1a304888461..f0376d298d6 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -57,42 +57,42 @@ INLINE int swap_bits_5_6(int data)
static WRITE8_HANDLER( ram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0x0000 + offset] = swap_bits_5_6(data);
state->rambase[0x0000 + offset] = data;
}
static WRITE8_HANDLER( charram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0x6000 + offset] = swap_bits_5_6(data);
decocass_charram_w(space, offset, data);
}
static WRITE8_HANDLER( fgvideoram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xc000 + offset] = swap_bits_5_6(data);
decocass_fgvideoram_w(space, offset, data);
}
static WRITE8_HANDLER( fgcolorram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xc400 + offset] = swap_bits_5_6(data);
decocass_colorram_w(space, offset, data);
}
static WRITE8_HANDLER( tileram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xd000 + offset] = swap_bits_5_6(data);
decocass_tileram_w(space, offset, data);
}
static WRITE8_HANDLER( objectram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xd800 + offset] = swap_bits_5_6(data);
decocass_objectram_w(space, offset, data);
}
@@ -102,14 +102,14 @@ static WRITE8_HANDLER( mirrorcolorram_w ) { offset = ((offset >> 5) & 0x1f) | ((
static READ8_HANDLER( mirrorvideoram_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->fgvideoram[offset];
}
static READ8_HANDLER( mirrorcolorram_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->colorram[offset];
}
@@ -601,28 +601,28 @@ static PALETTE_INIT( decocass )
{
int i;
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* set up 32 colors 1:1 pens */
for (i = 0; i < 32; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* setup straight/flipped colors for background tiles (D7 of color_center_bot ?) */
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine->colortable, 32+i, 3*8+i);
- colortable_entry_set_value(machine->colortable, 40+i, 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01));
+ colortable_entry_set_value(machine.colortable, 32+i, 3*8+i);
+ colortable_entry_set_value(machine.colortable, 40+i, 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01));
}
/* setup 4 colors for 1bpp object */
- colortable_entry_set_value(machine->colortable, 48+0*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+0*2+1, 25); /* testtape red from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+1*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+1*2+1, 28); /* testtape blue from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+2*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+2*2+1, 26); /* testtape green from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+3*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+3*2+1, 23); /* ???? */
+ colortable_entry_set_value(machine.colortable, 48+0*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+0*2+1, 25); /* testtape red from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+1*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+1*2+1, 28); /* testtape blue from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+2*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+2*2+1, 26); /* testtape green from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+3*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+3*2+1, 23); /* ???? */
}
@@ -1323,9 +1323,9 @@ ROM_END
static DRIVER_INIT( decocass )
{
- decocass_state *state = machine->driver_data<decocass_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ decocass_state *state = machine.driver_data<decocass_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
/* allocate memory and mark all RAM regions with their decrypted pointers */
@@ -1348,9 +1348,9 @@ static DRIVER_INIT( decocass )
static DRIVER_INIT( decocrom )
{
- decocass_state *state = machine->driver_data<decocass_state>();
- int romlength = machine->region("user3")->bytes();
- UINT8 *rom = machine->region("user3")->base();
+ decocass_state *state = machine.driver_data<decocass_state>();
+ int romlength = machine.region("user3")->bytes();
+ UINT8 *rom = machine.region("user3")->base();
int i;
state->decrypted2 = auto_alloc_array(machine, UINT8, romlength);
@@ -1363,16 +1363,16 @@ static DRIVER_INIT( decocrom )
state->decrypted2[i] = swap_bits_5_6(rom[i]);
/* convert charram to a banked ROM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w));
memory_configure_bank(machine, "bank1", 0, 1, state->charram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user3")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user3")->base(), 0);
memory_configure_bank_decrypted(machine, "bank1", 0, 1, &state->decrypted[0x6000], 0);
memory_configure_bank_decrypted(machine, "bank1", 1, 1, state->decrypted2, 0);
memory_set_bank(machine, "bank1", 0);
/* install the bank selector */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe900, 0xe900, FUNC(decocass_e900_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe900, 0xe900, FUNC(decocass_e900_w));
state->save_pointer(NAME(state->decrypted2), romlength);
}
diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c
index 4e4989068da..75219f76258 100644
--- a/src/mame/drivers/deniam.c
+++ b/src/mame/drivers/deniam.c
@@ -50,7 +50,7 @@ Notes:
static WRITE16_HANDLER( sound_command_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space,offset, (data >> 8) & 0xff);
@@ -75,7 +75,7 @@ static WRITE16_DEVICE_HANDLER( deniam16c_oki_rom_bank_w )
static WRITE16_HANDLER( deniam_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, CLEAR_LINE);
}
static ADDRESS_MAP_START( deniam16b_map, AS_PROGRAM, 16 )
@@ -223,7 +223,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- deniam_state *state = device->machine->driver_data<deniam_state>();
+ deniam_state *state = device->machine().driver_data<deniam_state>();
/* system 16c doesn't have the sound CPU */
if (state->audio_cpu != NULL)
@@ -239,9 +239,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( deniam )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->display_enable));
state->save_item(NAME(state->coinctrl));
@@ -264,7 +264,7 @@ static MACHINE_START( deniam )
static MACHINE_RESET( deniam )
{
/* logicpr2 does not reset the bank base on startup */
- machine->device<okim6295_device>("oki")->set_bank_base(0x00000);
+ machine.device<okim6295_device>("oki")->set_bank_base(0x00000);
}
static MACHINE_CONFIG_START( deniam16b, deniam_state )
diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c
index bf573700918..3ec4e4b8f62 100644
--- a/src/mame/drivers/deshoros.c
+++ b/src/mame/drivers/deshoros.c
@@ -32,7 +32,7 @@ public:
static VIDEO_START( deshoros )
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
UINT8 i;
for(i=0;i<20;i++)
state->led_array[i] = 0x20;
@@ -41,7 +41,7 @@ static VIDEO_START( deshoros )
static SCREEN_UPDATE( deshoros )
{
- deshoros_state *state = screen->machine->driver_data<deshoros_state>();
+ deshoros_state *state = screen->machine().driver_data<deshoros_state>();
popmessage("%s",state->led_array);
return 0;
}
@@ -58,12 +58,12 @@ static void update_led_array(deshoros_state *state, UINT8 new_data)
}
-static void answer_bankswitch(running_machine *machine,UINT8 new_bank)
+static void answer_bankswitch(running_machine &machine,UINT8 new_bank)
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
if(state->bank!=new_bank)
{
- UINT8 *ROM = machine->region("data")->base();
+ UINT8 *ROM = machine.region("data")->base();
UINT32 bankaddress;
state->bank = new_bank;
@@ -74,13 +74,13 @@ static void answer_bankswitch(running_machine *machine,UINT8 new_bank)
static READ8_HANDLER( io_r )
{
- deshoros_state *state = space->machine->driver_data<deshoros_state>();
+ deshoros_state *state = space->machine().driver_data<deshoros_state>();
switch(offset)
{
case 0x00: return 0xff; //printer read
- case 0x03: return input_port_read(space->machine, "KEY0" );
- case 0x04: return input_port_read(space->machine, "KEY1" );
- case 0x05: return input_port_read(space->machine, "SYSTEM" );
+ case 0x03: return input_port_read(space->machine(), "KEY0" );
+ case 0x04: return input_port_read(space->machine(), "KEY1" );
+ case 0x05: return input_port_read(space->machine(), "SYSTEM" );
case 0x0a: return state->io_ram[offset]; //"buzzer" 0 read
case 0x0b: return state->io_ram[offset]; //"buzzer" 1 read
}
@@ -91,16 +91,16 @@ static READ8_HANDLER( io_r )
static WRITE8_HANDLER( io_w )
{
- deshoros_state *state = space->machine->driver_data<deshoros_state>();
+ deshoros_state *state = space->machine().driver_data<deshoros_state>();
switch(offset)
{
case 0x00: /*Printer data*/ return;
case 0x02: update_led_array(state, data); return;
- case 0x05: coin_lockout_w(space->machine, 0,state->io_ram[offset] & 1);return;
+ case 0x05: coin_lockout_w(space->machine(), 0,state->io_ram[offset] & 1);return;
case 0x06: /*Printer IRQ enable*/ return;
// case 0x0a: "buzzer" 0 write
// case 0x0b: "buzzer" 1 write
- case 0x0c: answer_bankswitch(space->machine,data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
+ case 0x0c: answer_bankswitch(space->machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
}
state->io_ram[offset] = data;
// printf("%02x -> [%02x]\n",data,offset);
@@ -161,12 +161,12 @@ INPUT_PORTS_END
/*Is it there an IRQ mask?*/
static INTERRUPT_GEN( deshoros_irq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
}
static MACHINE_RESET( deshoros )
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
state->bank = -1;
}
diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c
index 992a1a718ae..9306b4edb4b 100644
--- a/src/mame/drivers/destroyr.c
+++ b/src/mame/drivers/destroyr.c
@@ -38,7 +38,7 @@ public:
static SCREEN_UPDATE( destroyr )
{
- destroyr_state *state = screen->machine->driver_data<destroyr_state>();
+ destroyr_state *state = screen->machine().driver_data<destroyr_state>();
int i, j;
bitmap_fill(bitmap, cliprect, 0);
@@ -64,7 +64,7 @@ static SCREEN_UPDATE( destroyr )
continue;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
}
/* draw alpha numerics */
@@ -74,7 +74,7 @@ static SCREEN_UPDATE( destroyr )
{
int num = state->alpha_num_ram[32 * i + j];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
}
}
@@ -85,13 +85,13 @@ static SCREEN_UPDATE( destroyr )
int horz = 256 - state->minor_obj_ram[i + 2];
int vert = 256 - state->minor_obj_ram[i + 4];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], num, 0, 0, 0, horz, vert, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], num, 0, 0, 0, horz, vert, 0);
}
/* draw waves */
for (i = 0; i < 4; i++)
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], state->wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], state->wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
}
/* draw cursor */
@@ -105,7 +105,7 @@ static SCREEN_UPDATE( destroyr )
static TIMER_CALLBACK( destroyr_dial_callback )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
int dial = param;
/* Analog inputs come from the player's depth control potentiometer.
@@ -126,21 +126,21 @@ static TIMER_CALLBACK( destroyr_dial_callback )
static TIMER_CALLBACK( destroyr_frame_callback )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
state->potsense[0] = 0;
state->potsense[1] = 0;
/* PCB supports two dials, but cab has only got one */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
}
static MACHINE_RESET( destroyr )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
state->cursor = 0;
state->wavemod = 0;
@@ -156,7 +156,7 @@ static MACHINE_RESET( destroyr )
static WRITE8_HANDLER( destroyr_misc_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
/* bits 0 to 2 connect to the sound circuits */
state->attract = data & 0x01;
@@ -166,14 +166,14 @@ static WRITE8_HANDLER( destroyr_misc_w )
state->wavemod = data & 0x10;
state->potmask[1] = data & 0x20;
- coin_lockout_w(space->machine, 0, !state->attract);
- coin_lockout_w(space->machine, 1, !state->attract);
+ coin_lockout_w(space->machine(), 0, !state->attract);
+ coin_lockout_w(space->machine(), 1, !state->attract);
}
static WRITE8_HANDLER( destroyr_cursor_load_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
state->cursor = data;
watchdog_reset_w(space, offset, data);
}
@@ -181,7 +181,7 @@ static WRITE8_HANDLER( destroyr_cursor_load_w )
static WRITE8_HANDLER( destroyr_interrupt_ack_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -193,10 +193,10 @@ static WRITE8_HANDLER( destroyr_output_w )
else switch (offset & 7)
{
case 0:
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
break;
case 1:
- set_led_status(space->machine, 1, data & 1); /* no second LED present on cab */
+ set_led_status(space->machine(), 1, data & 1); /* no second LED present on cab */
break;
case 2:
/* bit 0 => songate */
@@ -222,16 +222,16 @@ static WRITE8_HANDLER( destroyr_output_w )
static READ8_HANDLER( destroyr_input_r )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
if (offset & 1)
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else
{
- UINT8 ret = input_port_read(space->machine, "IN0");
+ UINT8 ret = input_port_read(space->machine(), "IN0");
if (state->potsense[0] && state->potmask[0])
ret |= 4;
@@ -245,7 +245,7 @@ static READ8_HANDLER( destroyr_input_r )
static READ8_HANDLER( destroyr_scanline_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -422,9 +422,9 @@ static PALETTE_INIT( destroyr )
static MACHINE_START( destroyr )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->cursor));
state->save_item(NAME(state->wavemod));
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index dca7df67e7f..54cfe1ce78b 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -70,8 +70,8 @@ public:
static READ32_HANDLER( flash_r )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(offset >= (0x2000000 - state->flash_roms * 0x400000) / 4)
{
@@ -102,14 +102,14 @@ static READ32_HANDLER( flash_r )
static WRITE32_HANDLER( flash_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
if(state->flash_cmd == 0x20200000)
{
// erase game settings
if(data == 0xd0d00000)
{
// point to game settings
- UINT8 *rom = (UINT8 *)space->machine->region("user1")->base() + offset*4;
+ UINT8 *rom = (UINT8 *)space->machine().region("user1")->base() + offset*4;
// erase one block
memset(rom, 0xff, 0x10000);
@@ -127,7 +127,7 @@ static WRITE32_HANDLER( flash_w )
}
else
{
- UINT16 *rom = (UINT16 *)space->machine->region("user1")->base();
+ UINT16 *rom = (UINT16 *)space->machine().region("user1")->base();
// write game settings
@@ -150,7 +150,7 @@ static WRITE32_HANDLER( flash_w )
static WRITE32_HANDLER( vram_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
UINT32 *dest = &state->vram[offset+(0x40000/4)*state->vbuffer];
if (mem_mask == 0xffffffff)
@@ -168,13 +168,13 @@ static WRITE32_HANDLER( vram_w )
static READ32_HANDLER( vram_r )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
return state->vram[offset+(0x40000/4)*state->vbuffer];
}
static WRITE32_HANDLER( vbuffer_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
if(state->old_vbuf == 3 && (data & 3) == 2)
{
state->vbuffer ^= 1;
@@ -185,15 +185,15 @@ static WRITE32_HANDLER( vbuffer_w )
static WRITE32_HANDLER( coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static READ32_HANDLER( vblank_r )
{
/* burn a bunch of cycles because this is polled frequently during busy loops */
device_eat_cycles(space->cpu, 100);
- return input_port_read(space->machine, "VBLANK");
+ return input_port_read(space->machine(), "VBLANK");
}
static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 32 )
@@ -221,7 +221,7 @@ static NVRAM_HANDLER( flashroms )
if (read_or_write)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -234,7 +234,7 @@ static NVRAM_HANDLER( flashroms )
else if (file)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -281,13 +281,13 @@ INPUT_PORTS_END
static VIDEO_START( dgpix )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->vram = auto_alloc_array(machine, UINT32, 0x40000*2/4);
}
static SCREEN_UPDATE( dgpix )
{
- dgpix_state *state = screen->machine->driver_data<dgpix_state>();
+ dgpix_state *state = screen->machine().driver_data<dgpix_state>();
int y;
for (y = 0; y < 240; y++)
@@ -311,7 +311,7 @@ static SCREEN_UPDATE( dgpix )
static MACHINE_RESET( dgpix )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->vbuffer = 0;
state->flash_cmd = 0;
state->first_offset = -1;
@@ -572,8 +572,8 @@ ROM_END
static DRIVER_INIT( xfiles )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000;
+ dgpix_state *state = machine.driver_data<dgpix_state>();
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aa92e)] = 3;
rom[BYTE4_XOR_BE(0x3aa92f)] = 0;
@@ -583,15 +583,15 @@ static DRIVER_INIT( xfiles )
rom[BYTE4_XOR_BE(0x3aa933)] = 0;
// protection related ?
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0xf0c8b440, 0xf0c8b447);
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0xf0c8b440, 0xf0c8b447);
state->flash_roms = 2;
}
static DRIVER_INIT( kdynastg )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000;
+ dgpix_state *state = machine.driver_data<dgpix_state>();
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aaa10)] = 3; // 129f0 - nopped call
rom[BYTE4_XOR_BE(0x3aaa11)] = 0;
@@ -604,14 +604,14 @@ static DRIVER_INIT( kdynastg )
rom[BYTE4_XOR_BE(0x3a45c9)] = 0;
// protection related ?
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x12341234, 0x12341243);
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x12341234, 0x12341243);
state->flash_roms = 4;
}
static DRIVER_INIT( fmaniac3 )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->flash_roms = 2;
}
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index e413de624a4..c713bb33136 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -162,7 +162,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- dietgo_state *driver_state = device->machine->driver_data<dietgo_state>();
+ dietgo_state *driver_state = device->machine().driver_data<dietgo_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -197,11 +197,11 @@ static const deco16ic_interface dietgo_deco16ic_tilegen1_intf =
static MACHINE_START( dietgo )
{
- dietgo_state *state = machine->driver_data<dietgo_state>();
+ dietgo_state *state = machine.driver_data<dietgo_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( dietgo, dietgo_state )
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index c9cdb07ac90..810172b50f7 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -72,9 +72,9 @@ static VIDEO_START( discoboy )
{
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
int flipscreen = 0;
int offs, sx, sy;
@@ -107,11 +107,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- code = machine->rand();
+ code = machine.rand();
}
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipscreen,0,
@@ -122,7 +122,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( discoboy )
{
- discoboy_state *state = screen->machine->driver_data<discoboy_state>();
+ discoboy_state *state = screen->machine().driver_data<discoboy_state>();
UINT16 x, y;
int i;
int count = 0;
@@ -137,7 +137,7 @@ static SCREEN_UPDATE( discoboy )
g = ((pal >> 4) & 0xf) << 4;
r = ((pal >> 8) & 0xf) << 4;
- palette_set_color(screen->machine, i / 2, MAKE_RGB(r, g, b));
+ palette_set_color(screen->machine(), i / 2, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x800; i += 2)
@@ -150,7 +150,7 @@ static SCREEN_UPDATE( discoboy )
g = ((pal >> 4) & 0xf) << 4;
r = ((pal >> 8) & 0xf) << 4;
- palette_set_color(screen->machine, (i / 2) + 0x400, MAKE_RGB(r, g, b));
+ palette_set_color(screen->machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b));
}
bitmap_fill(bitmap, cliprect, 0x3ff);
@@ -169,54 +169,54 @@ static SCREEN_UPDATE( discoboy )
tileno = 0x2000 + (tileno & 0x1fff) + 0x0000;
}
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], tileno, state->ram_att[count / 2], 0, 0, x*8, y*8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], tileno, state->ram_att[count / 2], 0, 0, x*8, y*8);
count += 2;
}
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
#ifdef UNUSED_FUNCTION
-void discoboy_setrombank( running_machine *machine, UINT8 data )
+void discoboy_setrombank( running_machine &machine, UINT8 data )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
data &= 0x2f;
- memory_set_bankptr(space->machine, "bank1", &ROM[0x6000 + (data * 0x1000)] );
+ memory_set_bankptr(space->machine(), "bank1", &ROM[0x6000 + (data * 0x1000)] );
}
#endif
static WRITE8_HANDLER( rambank_select_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
state->ram_bank = data;
if (data &= 0x83) logerror("rambank_select_w !!!!!");
}
static WRITE8_HANDLER( discoboy_port_00_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (data & 0xfe) logerror("unk discoboy_port_00_w %02x\n",data);
state->port_00 = data;
}
static WRITE8_HANDLER( discoboy_port_01_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
// 00 10 20 30 during gameplay 1,2,3 other times?? title screen bit 0x40 toggle
//printf("unk discoboy_port_01_w %02x\n",data);
// discoboy gfxbank
state->gfxbank = data & 0xf0;
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
// printf("unk discoboy_port_03_w %02x\n", data);
// device_set_input_line(state->audiocpu, INPUT_LINE_NMI, HOLD_LINE);
soundlatch_w(space, 0, data);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( discoboy_port_06_w )
static WRITE8_HANDLER( rambank_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->ram_bank & 0x20)
state->ram_2[offset] = data;
@@ -242,7 +242,7 @@ static WRITE8_HANDLER( rambank_w )
static READ8_HANDLER( rambank_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->ram_bank & 0x20)
return state->ram_2[offset];
@@ -252,7 +252,7 @@ static READ8_HANDLER( rambank_r )
static READ8_HANDLER( rambank2_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->port_00 == 0x00)
return state->ram_3[offset];
@@ -261,12 +261,12 @@ static READ8_HANDLER( rambank2_r )
else
printf("unk rb2_r\n");
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( rambank2_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->port_00 == 0x00)
state->ram_3[offset] = data;
@@ -278,13 +278,13 @@ static WRITE8_HANDLER( rambank2_w )
static READ8_HANDLER( discoboy_ram_att_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
return state->ram_att[offset];
}
static WRITE8_HANDLER( discoboy_ram_att_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
state->ram_att[offset] = data;
}
@@ -323,7 +323,7 @@ ADDRESS_MAP_END
static void splash_msm5205_int( device_t *device )
{
- discoboy_state *state = device->machine->driver_data<discoboy_state>();
+ discoboy_state *state = device->machine().driver_data<discoboy_state>();
msm5205_data_w(device, state->adpcm_data >> 4);
// state->adpcm_data = (state->adpcm_data << 4) & 0xf0;
}
@@ -442,9 +442,9 @@ static const msm5205_interface discoboy_msm5205_interface =
static MACHINE_START( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->ram_bank));
state->save_item(NAME(state->port_00));
@@ -454,7 +454,7 @@ static MACHINE_START( discoboy )
static MACHINE_RESET( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
state->ram_bank = 0;
state->port_00 = 0;
@@ -535,8 +535,8 @@ ROM_END
static DRIVER_INIT( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memset(state->ram_1, 0, sizeof(state->ram_1));
memset(state->ram_2, 0, sizeof(state->ram_2));
diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c
index 75ff5045b2a..3b7876ec579 100644
--- a/src/mame/drivers/diverboy.c
+++ b/src/mame/drivers/diverboy.c
@@ -73,9 +73,9 @@ static VIDEO_START(diverboy)
{
}
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- diverboy_state *state = machine->driver_data<diverboy_state>();
+ diverboy_state *state = machine.driver_data<diverboy_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = source + (state->spriteram_size / 2);
@@ -95,9 +95,9 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
bank = (source[1] & 0x0002) >> 1;
- if (!flash || (machine->primary_screen->frame_number() & 1))
+ if (!flash || (machine.primary_screen->frame_number() & 1))
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[bank],
number,
colr,
0,0,
@@ -111,15 +111,15 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(diverboy)
{
-// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- draw_sprites(screen->machine, bitmap, cliprect);
+// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( soundcmd_w )
{
- diverboy_state *state = space->machine->driver_data<diverboy_state>();
+ diverboy_state *state = space->machine().driver_data<diverboy_state>();
if (ACCESSING_BITS_0_7)
{
@@ -244,9 +244,9 @@ GFXDECODE_END
static MACHINE_START( diverboy )
{
- diverboy_state *state = machine->driver_data<diverboy_state>();
+ diverboy_state *state = machine.driver_data<diverboy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( diverboy, diverboy_state )
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index 0ea7be6b8fb..b67491fc678 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -149,7 +149,7 @@ Notes:
static WRITE8_HANDLER( beast_data_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->data_to_beast = data;
state->z80_to_beast_full = 1;
@@ -159,7 +159,7 @@ static WRITE8_HANDLER( beast_data_w )
static READ8_HANDLER( beast_data_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_to_z80_full = 0;
return state->data_to_z80;
@@ -167,7 +167,7 @@ static READ8_HANDLER( beast_data_r )
static READ8_HANDLER( beast_status_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
return (!state->beast_to_z80_full << 2) | (state->z80_to_beast_full << 3);
}
@@ -175,17 +175,17 @@ static READ8_HANDLER( beast_status_r )
static WRITE8_HANDLER( trigger_nmi_on_cpu0 )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( cpu0_bankswitch_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
data ^= state->bankxor;
- memory_set_bank(space->machine, "bank1", data);
- memory_set_bank(space->machine, "bank4", 0); /* unsure if/how this area is banked */
+ memory_set_bank(space->machine(), "bank1", data);
+ memory_set_bank(space->machine(), "bank4", 0); /* unsure if/how this area is banked */
}
/******************************************************************************/
@@ -198,7 +198,7 @@ static WRITE8_HANDLER( cpu0_bankswitch_w )
*/
static WRITE8_HANDLER( cpu1_bankswitch_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->videoreg = data;
switch (data & 0xf)
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
case 0x01:
case 0x02:
case 0x03:
- memory_set_bank(space->machine, "bank2", (data & 0xf));
+ memory_set_bank(space->machine(), "bank2", (data & 0xf));
break;
/* bs101.6w */
@@ -220,7 +220,7 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
case 0x0d:
case 0x0e:
case 0x0f:
- memory_set_bank(space->machine, "bank2", (data & 0xf) - 4);
+ memory_set_bank(space->machine(), "bank2", (data & 0xf) - 4);
break;
default:
@@ -230,22 +230,22 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
/******************************************************************************/
static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->cpu2, INPUT_LINE_NMI, PULSE_LINE);
} /* trigger_nmi_on_sound_cpu2 */
static WRITE8_HANDLER( cpu2_bankswitch_w )
{
- memory_set_bank(space->machine, "bank3", data); // shall we check data<0x07?
+ memory_set_bank(space->machine(), "bank3", data); // shall we check data<0x07?
}
/******************************************************************************/
@@ -315,7 +315,7 @@ static READ8_HANDLER( beast_p0_r )
static WRITE8_HANDLER( beast_p0_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (!BIT(state->beast_p0, 1) && BIT(data, 1))
{
@@ -331,7 +331,7 @@ static WRITE8_HANDLER( beast_p0_w )
static READ8_HANDLER( beast_p1_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (BIT(state->beast_p0, 0) == 0)
return state->data_to_beast;
@@ -341,7 +341,7 @@ static READ8_HANDLER( beast_p1_r )
static WRITE8_HANDLER( beast_p1_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (data == 0xff)
{
@@ -354,30 +354,30 @@ static WRITE8_HANDLER( beast_p1_w )
static READ8_HANDLER( beast_p2_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
switch ((state->beast_p0 >> 2) & 3)
{
- case 0: return input_port_read(space->machine, "IN1");
- case 1: return input_port_read(space->machine, "IN2");
- case 2: return input_port_read(space->machine, "IN0");
+ case 0: return input_port_read(space->machine(), "IN1");
+ case 1: return input_port_read(space->machine(), "IN2");
+ case 2: return input_port_read(space->machine(), "IN0");
default: return 0xff;
}
}
static WRITE8_HANDLER( beast_p2_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_p2 = data;
}
static READ8_HANDLER( beast_p3_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
UINT8 dsw = 0;
- UINT8 dsw1 = ~input_port_read(space->machine, "DSW1");
- UINT8 dsw2 = ~input_port_read(space->machine, "DSW2");
+ UINT8 dsw1 = ~input_port_read(space->machine(), "DSW1");
+ UINT8 dsw2 = ~input_port_read(space->machine(), "DSW2");
switch ((state->beast_p0 >> 5) & 3)
{
@@ -391,7 +391,7 @@ static READ8_HANDLER( beast_p3_r )
static WRITE8_HANDLER( beast_p3_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_p3 = data;
device_set_input_line(state->cpu1, INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
@@ -518,11 +518,11 @@ static TIMER_DEVICE_CALLBACK( djboy_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xfd);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xfd);
/* Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this */
if(scanline == 64)
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xff);
}
static const kaneko_pandora_interface djboy_pandora_config =
@@ -535,10 +535,10 @@ static const kaneko_pandora_interface djboy_pandora_config =
static MACHINE_START( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *CPU1 = machine->region("cpu1")->base();
- UINT8 *CPU2 = machine->region("cpu2")->base();
+ djboy_state *state = machine.driver_data<djboy_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *CPU1 = machine.region("cpu1")->base();
+ UINT8 *CPU2 = machine.region("cpu2")->base();
memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x00000], 0x2000);
memory_configure_bank(machine, "bank1", 4, 28, &MAIN[0x10000], 0x2000);
@@ -548,11 +548,11 @@ static MACHINE_START( djboy )
memory_configure_bank(machine, "bank3", 3, 5, &CPU2[0x10000], 0x4000);
memory_configure_bank(machine, "bank4", 0, 1, &MAIN[0x10000], 0x3000); /* unsure if/how this area is banked */
- state->maincpu = machine->device("maincpu");
- state->cpu1 = machine->device("cpu1");
- state->cpu2 = machine->device("cpu2");
- state->beast = machine->device("beast");
- state->pandora = machine->device("pandora");
+ state->maincpu = machine.device("maincpu");
+ state->cpu1 = machine.device("cpu1");
+ state->cpu2 = machine.device("cpu2");
+ state->beast = machine.device("beast");
+ state->pandora = machine.device("pandora");
state->save_item(NAME(state->videoreg));
state->save_item(NAME(state->scrollx));
@@ -572,7 +572,7 @@ static MACHINE_START( djboy )
static MACHINE_RESET( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->videoreg = 0;
state->scrollx = 0;
@@ -748,13 +748,13 @@ ROM_END
static DRIVER_INIT( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->bankxor = 0x00;
}
static DRIVER_INIT( djboyj )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->bankxor = 0x1f;
}
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index c023e0a1428..305f9c9d33f 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -89,38 +89,38 @@ static WRITE32_HANDLER( paletteram32_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
r = (data >> 0) & 0xff;
g = (data >> 8) & 0xff;
b = (data >> 16) & 0xff;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
//---------
-static void sndram_set_bank(running_machine *machine)
+static void sndram_set_bank(running_machine &machine)
{
- djmain_state *state = machine->driver_data<djmain_state>();
- state->sndram = machine->region("shared")->base() + 0x80000 * state->sndram_bank;
+ djmain_state *state = machine.driver_data<djmain_state>();
+ state->sndram = machine.region("shared")->base() + 0x80000 * state->sndram_bank;
}
static WRITE32_HANDLER( sndram_bank_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_31)
{
state->sndram_bank = (data >> 16) & 0x1f;
- sndram_set_bank(space->machine);
+ sndram_set_bank(space->machine());
}
}
static READ32_HANDLER( sndram_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
UINT32 data = 0;
if (ACCESSING_BITS_24_31)
@@ -140,7 +140,7 @@ static READ32_HANDLER( sndram_r )
static WRITE32_HANDLER( sndram_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_24_31)
state->sndram[offset * 4] = data >> 24;
@@ -162,9 +162,9 @@ static READ16_HANDLER( dual539_r )
UINT16 ret = 0;
if (ACCESSING_BITS_0_7)
- ret |= k054539_r(space->machine->device("konami2"), offset);
+ ret |= k054539_r(space->machine().device("konami2"), offset);
if (ACCESSING_BITS_8_15)
- ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
+ ret |= k054539_r(space->machine().device("konami1"), offset)<<8;
return ret;
}
@@ -172,9 +172,9 @@ static READ16_HANDLER( dual539_r )
static WRITE16_HANDLER( dual539_w )
{
if (ACCESSING_BITS_0_7)
- k054539_w(space->machine->device("konami2"), offset, data);
+ k054539_w(space->machine().device("konami2"), offset, data);
if (ACCESSING_BITS_8_15)
- k054539_w(space->machine->device("konami1"), offset, data>>8);
+ k054539_w(space->machine().device("konami1"), offset, data>>8);
}
@@ -182,7 +182,7 @@ static WRITE16_HANDLER( dual539_w )
static READ32_HANDLER( obj_ctrl_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
// read state->obj_regs[0x0c/4]: unknown
// read state->obj_regs[0x24/4]: unknown
@@ -191,7 +191,7 @@ static READ32_HANDLER( obj_ctrl_r )
static WRITE32_HANDLER( obj_ctrl_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
// write state->obj_regs[0x28/4]: bank for rom readthrough
COMBINE_DATA(&state->obj_regs[offset]);
@@ -199,8 +199,8 @@ static WRITE32_HANDLER( obj_ctrl_w )
static READ32_HANDLER( obj_rom_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
- UINT8 *mem8 = space->machine->region("gfx1")->base();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
+ UINT8 *mem8 = space->machine().region("gfx1")->base();
int bank = state->obj_regs[0x28/4] >> 16;
offset += bank * 0x200;
@@ -220,7 +220,7 @@ static READ32_HANDLER( obj_rom_r )
static WRITE32_HANDLER( v_ctrl_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_31)
{
data >>= 16;
@@ -230,16 +230,16 @@ static WRITE32_HANDLER( v_ctrl_w )
if (state->pending_vb_int && !DISABLE_VB_INT)
{
state->pending_vb_int = 0;
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_4, HOLD_LINE);
}
}
}
static READ32_HANDLER( v_rom_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
- device_t *k056832 = space->machine->device("k056832");
- UINT8 *mem8 = space->machine->region("gfx2")->base();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
+ device_t *k056832 = space->machine().device("k056832");
+ UINT8 *mem8 = space->machine().region("gfx2")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset *= 2;
@@ -261,18 +261,18 @@ static READ32_HANDLER( v_rom_r )
static READ8_HANDLER( inp1_r )
{
static const char *const portnames[] = { "DSW3", "BTN3", "BTN2", "BTN1" };
- return input_port_read(space->machine, portnames[ offset & 0x03 ]);
+ return input_port_read(space->machine(), portnames[ offset & 0x03 ]);
}
static READ8_HANDLER( inp2_r )
{
static const char *const portnames[] = { "DSW1", "DSW2", "UNK2", "UNK1" };
- return input_port_read(space->machine, portnames[ offset & 0x03 ]);
+ return input_port_read(space->machine(), portnames[ offset & 0x03 ]);
}
static READ32_HANDLER( turntable_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
UINT32 result = 0;
static const char *const ttnames[] = { "TT1", "TT2" };
@@ -281,7 +281,7 @@ static READ32_HANDLER( turntable_r )
UINT8 pos;
int delta;
- pos = input_port_read_safe(space->machine, ttnames[state->turntable_select], 0);
+ pos = input_port_read_safe(space->machine(), ttnames[state->turntable_select], 0);
delta = pos - state->turntable_last_pos[state->turntable_select];
if (delta < -128)
delta += 256;
@@ -299,7 +299,7 @@ static READ32_HANDLER( turntable_r )
static WRITE32_HANDLER( turntable_select_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_23)
state->turntable_select = (data >> 19) & 1;
}
@@ -392,9 +392,9 @@ static WRITE32_HANDLER( light_ctrl_2_w )
{
output_set_value("left-ssr", !!(data & 0x08000000)); // SSR
output_set_value("right-ssr", !!(data & 0x08000000)); // SSR
- set_led_status(space->machine, 0, data & 0x00010000); // 1P START
- set_led_status(space->machine, 1, data & 0x00020000); // 2P START
- set_led_status(space->machine, 2, data & 0x00040000); // EFFECT
+ set_led_status(space->machine(), 0, data & 0x00010000); // 1P START
+ set_led_status(space->machine(), 1, data & 0x00020000); // 2P START
+ set_led_status(space->machine(), 2, data & 0x00040000); // EFFECT
}
}
@@ -428,7 +428,7 @@ static WRITE32_HANDLER( unknownc02000_w )
static INTERRUPT_GEN( vb_interrupt )
{
- djmain_state *state = device->machine->driver_data<djmain_state>();
+ djmain_state *state = device->machine().driver_data<djmain_state>();
state->pending_vb_int = 0;
if (DISABLE_VB_INT)
@@ -447,12 +447,12 @@ static void ide_interrupt(device_t *device, int state)
if (state != CLEAR_LINE)
{
//logerror("IDE interrupt asserted\n");
- cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_1, HOLD_LINE);
}
else
{
//logerror("IDE interrupt cleared\n");
- cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_1, CLEAR_LINE);
}
}
@@ -1432,8 +1432,8 @@ static STATE_POSTLOAD( djmain_postload )
static MACHINE_START( djmain )
{
- djmain_state *state = machine->driver_data<djmain_state>();
- device_t *ide = machine->device("ide");
+ djmain_state *state = machine.driver_data<djmain_state>();
+ device_t *ide = machine.device("ide");
if (ide != NULL && state->ide_master_password != NULL)
ide_set_master_password(ide, state->ide_master_password);
@@ -1445,13 +1445,13 @@ static MACHINE_START( djmain )
state_save_register_global(machine, state->v_ctrl);
state_save_register_global_array(machine, state->obj_regs);
- machine->state().register_postload(djmain_postload, NULL);
+ machine.state().register_postload(djmain_postload, NULL);
}
static MACHINE_RESET( djmain )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
/* reset sound ram bank */
state->sndram_bank = 0;
sndram_set_bank(machine);
@@ -2036,7 +2036,7 @@ ROM_END
static DRIVER_INIT( beatmania )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
state->ide_master_password = NULL;
state->ide_user_password = NULL;
}
@@ -2052,7 +2052,7 @@ static const UINT8 beatmania_master_password[2 + 32] =
static DRIVER_INIT( hmcompmx )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 hmcompmx_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2070,7 +2070,7 @@ static DRIVER_INIT( hmcompmx )
static DRIVER_INIT( bm4thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm4thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2087,7 +2087,7 @@ static DRIVER_INIT( bm4thmix )
static DRIVER_INIT( bm5thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm5thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2105,7 +2105,7 @@ static DRIVER_INIT( bm5thmix )
static DRIVER_INIT( bmclubmx )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmclubmx_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2124,7 +2124,7 @@ static DRIVER_INIT( bmclubmx )
static DRIVER_INIT( bmcompm2 )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmcompm2_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2142,7 +2142,7 @@ static DRIVER_INIT( bmcompm2 )
static DRIVER_INIT( hmcompm2 )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 hmcompm2_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2160,7 +2160,7 @@ static DRIVER_INIT( hmcompm2 )
static DRIVER_INIT( bmdct )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmdct_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2178,7 +2178,7 @@ static DRIVER_INIT( bmdct )
static DRIVER_INIT( bmcorerm )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmcorerm_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2196,7 +2196,7 @@ static DRIVER_INIT( bmcorerm )
static DRIVER_INIT( bm6thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm6thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2214,7 +2214,7 @@ static DRIVER_INIT( bm6thmix )
static DRIVER_INIT( bm7thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm7thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2232,7 +2232,7 @@ static DRIVER_INIT( bm7thmix )
static DRIVER_INIT( bmfinal )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmfinal_user_password[2 + 32] =
{
0x00, 0x00,
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 8d7b9ef7449..f92b20b7051 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -400,19 +400,19 @@ static INTERRUPT_GEN( s2650_interrupt )
*
*************************************/
-static void dkong_init_device_driver_data( running_machine *machine )
+static void dkong_init_device_driver_data( running_machine &machine )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
- state->dev_n2a03a = machine->device("n2a03a");
- state->dev_n2a03b = machine->device("n2a03b");
- state->dev_6h = machine->device("ls259.6h");
- state->dev_vp2 = machine->device("virtual_p2");
+ state->dev_n2a03a = machine.device("n2a03a");
+ state->dev_n2a03b = machine.device("n2a03b");
+ state->dev_6h = machine.device("ls259.6h");
+ state->dev_vp2 = machine.device("virtual_p2");
}
static MACHINE_START( dkong2b )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
dkong_init_device_driver_data(machine);
state->hardware_type = HARDWARE_TKG04;
@@ -423,9 +423,9 @@ static MACHINE_START( dkong2b )
static MACHINE_START( s2650 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *p = machine->region("user1")->base();
- const char *game_name = machine->system().name;
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *p = machine.region("user1")->base();
+ const char *game_name = machine.system().name;
int i;
MACHINE_START_CALL(dkong2b);
@@ -457,7 +457,7 @@ static MACHINE_START( s2650 )
static MACHINE_START( radarscp )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS02;
@@ -465,7 +465,7 @@ static MACHINE_START( radarscp )
static MACHINE_START( radarscp1 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS01;
@@ -473,7 +473,7 @@ static MACHINE_START( radarscp1 )
static MACHINE_START( dkong3 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
dkong_init_device_driver_data(machine);
state->hardware_type = HARDWARE_TKG04;
@@ -486,8 +486,8 @@ static MACHINE_RESET( dkong )
static MACHINE_RESET( strtheat )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -499,8 +499,8 @@ static MACHINE_RESET( strtheat )
static MACHINE_RESET( drakton )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -519,7 +519,7 @@ static MACHINE_RESET( drakton )
static READ8_HANDLER( hb_dma_read_byte )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -533,7 +533,7 @@ static READ8_HANDLER( hb_dma_read_byte )
static WRITE8_HANDLER( hb_dma_write_byte )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -547,13 +547,13 @@ static WRITE8_HANDLER( hb_dma_write_byte )
static READ8_DEVICE_HANDLER( p8257_ctl_r )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
return state->dma_latch;
}
static WRITE8_DEVICE_HANDLER( p8257_ctl_w )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
state->dma_latch = data;
}
@@ -566,7 +566,7 @@ static WRITE8_DEVICE_HANDLER( p8257_ctl_w )
static WRITE8_HANDLER( dkong3_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE8_DEVICE_HANDLER( p8257_drq_w )
@@ -577,13 +577,13 @@ static WRITE8_DEVICE_HANDLER( p8257_drq_w )
static READ8_HANDLER( dkong_in2_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
/* mcu status (sound feedback) is inverted bit4 from port B (8039) */
UINT8 mcustatus = latch8_bit4_q_r(state->dev_vp2, 0);
UINT8 r;
- r = (input_port_read(space->machine, "IN2") & 0xBF) | (mcustatus << 6);
- coin_counter_w(space->machine, offset, r >> 7);
+ r = (input_port_read(space->machine(), "IN2") & 0xBF) | (mcustatus << 6);
+ coin_counter_w(space->machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
return r;
@@ -595,8 +595,8 @@ static READ8_HANDLER( dkongjr_in2_r )
UINT8 r;
- r = (input_port_read(space->machine, "IN2") & 0xBF) | 0x40;
- coin_counter_w(space->machine, offset, r >> 7);
+ r = (input_port_read(space->machine(), "IN2") & 0xBF) | 0x40;
+ coin_counter_w(space->machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
return r;
@@ -616,7 +616,7 @@ static WRITE8_HANDLER( s2650_mirror_w )
static READ8_HANDLER( epos_decrypt_rom )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (offset & 0x01)
{
@@ -631,10 +631,10 @@ static READ8_HANDLER( epos_decrypt_rom )
switch(state->decrypt_counter)
{
- case 0x08: memory_set_bank(space->machine, "bank1", 0); break;
- case 0x09: memory_set_bank(space->machine, "bank1", 1); break;
- case 0x0A: memory_set_bank(space->machine, "bank1", 2); break;
- case 0x0B: memory_set_bank(space->machine, "bank1", 3); break;
+ case 0x08: memory_set_bank(space->machine(), "bank1", 0); break;
+ case 0x09: memory_set_bank(space->machine(), "bank1", 1); break;
+ case 0x0A: memory_set_bank(space->machine(), "bank1", 2); break;
+ case 0x0B: memory_set_bank(space->machine(), "bank1", 3); break;
default:
logerror("Invalid counter = %02X\n",state->decrypt_counter);
break;
@@ -646,7 +646,7 @@ static READ8_HANDLER( epos_decrypt_rom )
static WRITE8_HANDLER( s2650_data_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("write : pc = %04x, loopback = %02x\n",cpu_get_pc(space->cpu), data);
#endif
@@ -656,7 +656,7 @@ static WRITE8_HANDLER( s2650_data_w )
static WRITE8_HANDLER( s2650_fo_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("write : pc = %04x, FO = %02x\n",cpu_get_pc(space->cpu), data);
#endif
@@ -669,7 +669,7 @@ static WRITE8_HANDLER( s2650_fo_w )
static READ8_HANDLER( s2650_port0_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("port 0 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(space->cpu), state->hunchloopback, state->main_fo);
#endif
@@ -694,7 +694,7 @@ static READ8_HANDLER( s2650_port0_r )
static READ8_HANDLER( s2650_port1_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("port 1 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(space->cpu), state->hunchloopback, state->main_fo);
@@ -717,7 +717,7 @@ static READ8_HANDLER( s2650_port1_r )
static WRITE8_HANDLER( dkong3_2a03_reset_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (data & 1)
{
@@ -733,30 +733,30 @@ static WRITE8_HANDLER( dkong3_2a03_reset_w )
static READ8_HANDLER( strtheat_inputport_0_r )
{
- if(input_port_read(space->machine, "DSW0") & 0x40)
+ if(input_port_read(space->machine(), "DSW0") & 0x40)
{
/* Joystick inputs */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(space->machine, "IN0") & ~3) | (input_port_read(space->machine, "IN4") & 3);
+ return (input_port_read(space->machine(), "IN0") & ~3) | (input_port_read(space->machine(), "IN4") & 3);
}
}
static READ8_HANDLER( strtheat_inputport_1_r )
{
- if(input_port_read(space->machine, "DSW0") & 0x40)
+ if(input_port_read(space->machine(), "DSW0") & 0x40)
{
/* Joystick inputs */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(space->machine, "IN1") & ~3) | (input_port_read(space->machine, "IN5") & 3);
+ return (input_port_read(space->machine(), "IN1") & ~3) | (input_port_read(space->machine(), "IN5") & 3);
}
}
@@ -1621,8 +1621,8 @@ static READ8_DEVICE_HANDLER( braze_eeprom_r )
static WRITE8_HANDLER( braze_a15_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
- memory_set_bank(space->machine, "bank2", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank2", data & 0x01);
}
static WRITE8_DEVICE_HANDLER( braze_eeprom_w )
@@ -1632,14 +1632,14 @@ static WRITE8_DEVICE_HANDLER( braze_eeprom_w )
eeprom_set_clock_line(device, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
}
-static void braze_decrypt_rom(running_machine *machine, UINT8 *dest)
+static void braze_decrypt_rom(running_machine &machine, UINT8 *dest)
{
UINT8 oldbyte,newbyte;
UINT8 *ROM;
UINT32 mem;
UINT32 newmem;
- ROM = machine->region("braze")->base();
+ ROM = machine.region("braze")->base();
for (mem=0;mem<0x10000;mem++)
{
@@ -2983,13 +2983,13 @@ ROM_END
*
*************************************/
-static void drakton_decrypt_rom(running_machine *machine, UINT8 mod, int offs, int *bs)
+static void drakton_decrypt_rom(running_machine &machine, UINT8 mod, int offs, int *bs)
{
UINT8 oldbyte,newbyte;
UINT8 *ROM;
int mem;
- ROM = machine->region("maincpu")->base();
+ ROM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -3015,7 +3015,7 @@ static void drakton_decrypt_rom(running_machine *machine, UINT8 mod, int offs, i
static DRIVER_INIT( herodk )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* swap data lines D3 and D4 */
for (A = 0;A < 0x8000;A++)
@@ -3040,7 +3040,7 @@ static DRIVER_INIT( drakton )
{7,1,4,0,3,6,2,5},
};
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3062,7 +3062,7 @@ static DRIVER_INIT( strtheat )
{6,3,4,1,0,7,2,5},
};
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3073,21 +3073,21 @@ static DRIVER_INIT( strtheat )
drakton_decrypt_rom(machine, 0x88, 0x1c000, bs[3]);
/* custom handlers supporting Joystick or Steering Wheel */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c00, 0x7c00, FUNC(strtheat_inputport_0_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c80, 0x7c80, FUNC(strtheat_inputport_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c00, 0x7c00, FUNC(strtheat_inputport_0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c80, 0x7c80, FUNC(strtheat_inputport_1_r));
}
static DRIVER_INIT( dkongx )
{
UINT8 *decrypted;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *eeprom = machine->device("eeprom");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *eeprom = machine.device("eeprom");
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" );
space->install_legacy_write_handler(0xe000, 0xe000, FUNC(braze_a15_w));
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 5dfd115e6f0..3f3aa5a769f 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -95,20 +95,20 @@ static const UINT8 led_map[16] =
static void dleuro_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", 0, state);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state);
}
static WRITE8_DEVICE_HANDLER( serial_transmit )
{
- dlair_state *state = device->machine->driver_data<dlair_state>();
+ dlair_state *state = device->machine().driver_data<dlair_state>();
laserdisc_data_w(state->laserdisc, data);
}
static int serial_receive(device_t *device, int channel)
{
- dlair_state *state = device->machine->driver_data<dlair_state>();
+ dlair_state *state = device->machine().driver_data<dlair_state>();
/* if we still have data to send, do it now */
if (channel == 0 && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
return laserdisc_data_r(state->laserdisc);
@@ -174,7 +174,7 @@ static PALETTE_INIT( dleuro )
static SCREEN_UPDATE( dleuro )
{
- dlair_state *state = screen->machine->driver_data<dlair_state>();
+ dlair_state *state = screen->machine().driver_data<dlair_state>();
UINT8 *videoram = state->videoram;
int x, y;
@@ -183,7 +183,7 @@ static SCREEN_UPDATE( dleuro )
for (x = 0; x < 32; x++)
{
UINT8 *base = &videoram[y * 64 + x * 2 + 1];
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
}
return 0;
@@ -199,14 +199,14 @@ static SCREEN_UPDATE( dleuro )
static MACHINE_START( dlair )
{
- dlair_state *state = machine->driver_data<dlair_state>();
- state->laserdisc = machine->device<laserdisc_device>("laserdisc");
+ dlair_state *state = machine.driver_data<dlair_state>();
+ state->laserdisc = machine.device<laserdisc_device>("laserdisc");
}
static MACHINE_RESET( dlair )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
/* determine the laserdisc player from the DIP switches */
if (state->laserdisc_type == LASERDISC_TYPE_VARIABLE)
{
@@ -226,10 +226,10 @@ static MACHINE_RESET( dlair )
static INTERRUPT_GEN( vblank_callback )
{
/* also update the speaker on the European version */
- beep_device *beep = device->machine->device<beep_device>("beep");
+ beep_device *beep = device->machine().device<beep_device>("beep");
if (beep != NULL)
{
- z80ctc_device *ctc = device->machine->device<z80ctc_device>("ctc");
+ z80ctc_device *ctc = device->machine().device<z80ctc_device>("ctc");
beep_set_state(beep, 1);
beep_set_frequency(beep, ATTOSECONDS_TO_HZ(ctc->period(0).attoseconds));
}
@@ -245,7 +245,7 @@ static INTERRUPT_GEN( vblank_callback )
static WRITE8_HANDLER( misc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
/*
D0-D3 = B0-B3
D4 = coin counter
@@ -256,7 +256,7 @@ static WRITE8_HANDLER( misc_w )
UINT8 diff = data ^ state->last_misc;
state->last_misc = data;
- coin_counter_w(space->machine, 0, (~data >> 4) & 1);
+ coin_counter_w(space->machine(), 0, (~data >> 4) & 1);
/* on bit 5 going low, push the data out to the laserdisc player */
if ((diff & 0x20) && !(data & 0x20))
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( misc_w )
static WRITE8_HANDLER( dleuro_misc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
/*
D0 = CHAR GEN ON+
D1 = KILL VIDEO+
@@ -283,8 +283,8 @@ static WRITE8_HANDLER( dleuro_misc_w )
UINT8 diff = data ^ state->last_misc;
state->last_misc = data;
- coin_counter_w(space->machine, 1, (~data >> 3) & 1);
- coin_counter_w(space->machine, 0, (~data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (~data >> 3) & 1);
+ coin_counter_w(space->machine(), 0, (~data >> 4) & 1);
/* on bit 5 going low, push the data out to the laserdisc player */
if ((diff & 0x20) && !(data & 0x20))
@@ -316,7 +316,7 @@ static WRITE8_HANDLER( led_den2_w )
static CUSTOM_INPUT( laserdisc_status_r )
{
- dlair_state *state = field->port->machine->driver_data<dlair_state>();
+ dlair_state *state = field->port->machine().driver_data<dlair_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -334,7 +334,7 @@ static CUSTOM_INPUT( laserdisc_status_r )
static CUSTOM_INPUT( laserdisc_command_r )
{
- dlair_state *state = field->port->machine->driver_data<dlair_state>();
+ dlair_state *state = field->port->machine().driver_data<dlair_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -352,7 +352,7 @@ static CUSTOM_INPUT( laserdisc_command_r )
static READ8_HANDLER( laserdisc_r )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
UINT8 result = laserdisc_data_r(state->laserdisc);
mame_printf_debug("laserdisc_r = %02X\n", result);
return result;
@@ -361,7 +361,7 @@ static READ8_HANDLER( laserdisc_r )
static WRITE8_HANDLER( laserdisc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
state->laserdisc_data = data;
}
@@ -949,14 +949,14 @@ ROM_END
static DRIVER_INIT( fixed )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
state->laserdisc_type = LASERDISC_TYPE_FIXED;
}
static DRIVER_INIT( variable )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
state->laserdisc_type = LASERDISC_TYPE_VARIABLE;
}
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index fd47edf0576..2da4575f955 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -76,7 +76,7 @@ public:
static WRITE8_HANDLER( dderby_sound_w )
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -84,14 +84,14 @@ static READ8_HANDLER( input_r )
{
switch(offset & 7)
{
- case 0: return input_port_read(space->machine, "IN0");
- case 1: return input_port_read(space->machine, "IN1");
- case 2: return input_port_read(space->machine, "IN2");
- case 3: return input_port_read(space->machine, "IN3");
- case 4: return input_port_read(space->machine, "IN4");
- case 5: return input_port_read(space->machine, "IN5");
- case 6: return input_port_read(space->machine, "IN6");
- case 7: return input_port_read(space->machine, "IN7");
+ case 0: return input_port_read(space->machine(), "IN0");
+ case 1: return input_port_read(space->machine(), "IN1");
+ case 2: return input_port_read(space->machine(), "IN2");
+ case 3: return input_port_read(space->machine(), "IN3");
+ case 4: return input_port_read(space->machine(), "IN4");
+ case 5: return input_port_read(space->machine(), "IN5");
+ case 6: return input_port_read(space->machine(), "IN6");
+ case 7: return input_port_read(space->machine(), "IN7");
}
return 0xff;
@@ -99,7 +99,7 @@ static READ8_HANDLER( input_r )
static WRITE8_HANDLER( output_w )
{
- dmndrby_state *state = space->machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = space->machine().driver_data<dmndrby_state>();
/*
---- x--- refill meter [4]
---- x--- token out meter [5]
@@ -313,7 +313,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_dmndrby_tile_info )
{
- dmndrby_state *state = machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = machine.driver_data<dmndrby_state>();
int code = state->racetrack_tilemap_rom[tile_index];
int attr = state->racetrack_tilemap_rom[tile_index+0x2000];
@@ -331,8 +331,8 @@ static TILE_GET_INFO( get_dmndrby_tile_info )
static VIDEO_START(dderby)
{
- dmndrby_state *state = machine->driver_data<dmndrby_state>();
- state->racetrack_tilemap_rom = machine->region("user1")->base();
+ dmndrby_state *state = machine.driver_data<dmndrby_state>();
+ state->racetrack_tilemap_rom = machine.region("user1")->base();
state->racetrack_tilemap = tilemap_create(machine,get_dmndrby_tile_info,tilemap_scan_rows,16,16, 16, 512);
tilemap_mark_all_tiles_dirty(state->racetrack_tilemap);
@@ -340,14 +340,14 @@ static VIDEO_START(dderby)
static SCREEN_UPDATE(dderby)
{
- dmndrby_state *state = screen->machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = screen->machine().driver_data<dmndrby_state>();
int x,y,count;
int off,scrolly;
- const gfx_element *gfx = screen->machine->gfx[0];
- const gfx_element *sprites = screen->machine->gfx[1];
- const gfx_element *track = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[0];
+ const gfx_element *sprites = screen->machine().gfx[1];
+ const gfx_element *track = screen->machine().gfx[2];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* Draw racetrack
@@ -450,7 +450,7 @@ static PALETTE_INIT( dmnderby )
2, &resistances_b[0], bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -475,29 +475,29 @@ static PALETTE_INIT( dmnderby )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
- color_prom = machine->region("proms2")->base();
+ color_prom = machine.region("proms2")->base();
/* normal tiles use colors 0-15 */
for (i = 0x000; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
/*Main Z80 is IM 0,HW-latched irqs. */
static INTERRUPT_GEN( dderby_irq )
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h */
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h */
}
static INTERRUPT_GEN( dderby_timer_irq )
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
}
static MACHINE_CONFIG_START( dderby, dmndrby_state )
diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c
index a7700ff1020..8b67369ad3e 100644
--- a/src/mame/drivers/docastle.c
+++ b/src/mame/drivers/docastle.c
@@ -163,9 +163,9 @@ Dip locations verified with manual for docastle, dorunrun and dowild.
/* Read/Write Handlers */
static void idsoccer_adpcm_int( device_t *device )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
- if (state->adpcm_pos >= device->machine->region("adpcm")->bytes())
+ if (state->adpcm_pos >= device->machine().region("adpcm")->bytes())
{
state->adpcm_idle = 1;
msm5205_reset_w(device, 1);
@@ -177,14 +177,14 @@ static void idsoccer_adpcm_int( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos++];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos++];
msm5205_data_w(device, state->adpcm_data >> 4);
}
}
static READ8_DEVICE_HANDLER( idsoccer_adpcm_status_r )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
// this is wrong, but the samples work anyway!!
state->adpcm_status ^= 0x80;
@@ -193,7 +193,7 @@ static READ8_DEVICE_HANDLER( idsoccer_adpcm_status_r )
static WRITE8_DEVICE_HANDLER( idsoccer_adpcm_w )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
if (data & 0x80)
{
@@ -563,7 +563,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_RESET( docastle )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
int i;
for (i = 0; i < 9; i++)
@@ -579,10 +579,10 @@ static MACHINE_RESET( docastle )
static MACHINE_START( docastle )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->slave = machine->device<cpu_device>("slave");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->slave = machine.device<cpu_device>("slave");
state->save_item(NAME(state->adpcm_pos));
state->save_item(NAME(state->adpcm_data));
diff --git a/src/mame/drivers/dogfgt.c b/src/mame/drivers/dogfgt.c
index 41af2494f2f..ebf2b41f2fd 100644
--- a/src/mame/drivers/dogfgt.c
+++ b/src/mame/drivers/dogfgt.c
@@ -16,20 +16,20 @@ driver by Nicola Salmoria
static READ8_HANDLER( sharedram_r )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( sharedram_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->sharedram[offset] = data;
}
static WRITE8_HANDLER( subirqtrigger_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
/* bit 0 used but unknown */
if (data & 0x04)
device_set_input_line(state->subcpu, 0, ASSERT_LINE);
@@ -37,27 +37,27 @@ static WRITE8_HANDLER( subirqtrigger_w )
static WRITE8_HANDLER( sub_irqack_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
device_set_input_line(state->subcpu, 0, CLEAR_LINE);
}
static WRITE8_HANDLER( dogfgt_soundlatch_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->soundlatch = data;
}
static WRITE8_HANDLER( dogfgt_soundcontrol_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
/* bit 5 goes to 8910 #0 BDIR pin */
if ((state->last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(space->machine->device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
+ ay8910_data_address_w(space->machine().device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
/* bit 7 goes to 8910 #1 BDIR pin */
if ((state->last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(space->machine->device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
+ ay8910_data_address_w(space->machine().device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
state->last_snd_ctrl = data;
}
@@ -215,9 +215,9 @@ GFXDECODE_END
static MACHINE_START( dogfgt )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->bm_plane));
state->save_item(NAME(state->lastflip));
@@ -231,7 +231,7 @@ static MACHINE_START( dogfgt )
static MACHINE_RESET( dogfgt )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
int i;
state->bm_plane = 0;
diff --git a/src/mame/drivers/dominob.c b/src/mame/drivers/dominob.c
index 26c1a36e6fe..a0ccc97e2b4 100644
--- a/src/mame/drivers/dominob.c
+++ b/src/mame/drivers/dominob.c
@@ -84,12 +84,12 @@ public:
static VIDEO_START( dominob )
{
- machine->gfx[0]->color_granularity = 8;
+ machine.gfx[0]->color_granularity = 8;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dominob_state *state = machine->driver_data<dominob_state>();
+ dominob_state *state = machine.driver_data<dominob_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -103,12 +103,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = state->spriteram[offs + 3] + ((state->spriteram[offs + 2] & 0x03) << 8) ;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code,
((state->spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code + 1,
((state->spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(machine),flip_screen_y_get(machine),
@@ -119,7 +119,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( dominob )
{
- dominob_state *state = screen->machine->driver_data<dominob_state>();
+ dominob_state *state = screen->machine().driver_data<dominob_state>();
int x,y;
int index = 0;
@@ -130,7 +130,7 @@ static SCREEN_UPDATE( dominob )
{
drawgfx_opaque(bitmap,
cliprect,
- screen->machine->gfx[1],
+ screen->machine().gfx[1],
state->bgram[index] + 256 * (state->bgram[index + 1] & 0xf),
state->bgram[index + 1] >> 4,
0, 0,
@@ -145,7 +145,7 @@ static SCREEN_UPDATE( dominob )
{
drawgfx_transpen( bitmap,
cliprect,
- screen->machine->gfx[0],
+ screen->machine().gfx[0],
state->videoram[(y * 32 + x) * 2 + 1] + (state->videoram[(y * 32 + x) * 2] & 7) * 256,
(state->videoram[(y * 32 + x) * 2] >> 3),
0, 0,
@@ -153,7 +153,7 @@ static SCREEN_UPDATE( dominob )
}
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index 266ae492c6c..b21ffb18e6b 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -87,24 +87,24 @@ be verified on real PCB.
static WRITE8_HANDLER( lastday_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
if (data & 0xf8) popmessage("bankswitch %02x",data);
}
static MACHINE_START( lastday )
{
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static MACHINE_RESET( sound_ym2203 )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
state->interrupt_line_1=0;
state->interrupt_line_2=0;
@@ -777,21 +777,21 @@ static READ8_DEVICE_HANDLER( unk_r )
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static void irqhandler_2203_1(device_t *device, int irq)
{
- dooyong_state *state = device->machine->driver_data<dooyong_state>();
+ dooyong_state *state = device->machine().driver_data<dooyong_state>();
state->interrupt_line_1=irq;
- cputag_set_input_line(device->machine, "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
}
static void irqhandler_2203_2(device_t *device, int irq)
{
- dooyong_state *state = device->machine->driver_data<dooyong_state>();
+ dooyong_state *state = device->machine().driver_data<dooyong_state>();
state->interrupt_line_2=irq;
- cputag_set_input_line(device->machine, "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_interface_1 =
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index 24ff38b1772..10ab1820404 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -42,7 +42,7 @@ public:
static CUSTOM_INPUT( dorachan_protection_r )
{
- dorachan_state *state = field->port->machine->driver_data<dorachan_state>();
+ dorachan_state *state = field->port->machine().driver_data<dorachan_state>();
UINT8 ret = 0;
switch (cpu_get_previouspc(state->main_cpu))
@@ -80,14 +80,14 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( dorachan )
{
- dorachan_state *state = screen->machine->driver_data<dorachan_state>();
+ dorachan_state *state = screen->machine().driver_data<dorachan_state>();
pen_t pens[NUM_PENS];
offs_t offs;
const UINT8 *color_map_base;
get_pens(pens);
- color_map_base = screen->machine->region("proms")->base();
+ color_map_base = screen->machine().region("proms")->base();
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -123,17 +123,17 @@ static SCREEN_UPDATE( dorachan )
static WRITE8_HANDLER(dorachan_ctrl_w)
{
- dorachan_state *state = space->machine->driver_data<dorachan_state>();
+ dorachan_state *state = space->machine().driver_data<dorachan_state>();
state->flip_screen = (data >> 6) & 0x01;
}
static CUSTOM_INPUT( dorachan_v128_r )
{
- dorachan_state *state = field->port->machine->driver_data<dorachan_state>();
+ dorachan_state *state = field->port->machine().driver_data<dorachan_state>();
/* to avoid resetting (when player 2 starts) bit 0 need to be inverted when screen is flipped */
- return ((field->port->machine->primary_screen->vpos() >> 7) & 0x01) ^ state->flip_screen;
+ return ((field->port->machine().primary_screen->vpos() >> 7) & 0x01) ^ state->flip_screen;
}
@@ -224,16 +224,16 @@ INPUT_PORTS_END
static MACHINE_START( dorachan )
{
- dorachan_state *state = machine->driver_data<dorachan_state>();
+ dorachan_state *state = machine.driver_data<dorachan_state>();
- state->main_cpu = machine->device("maincpu");
+ state->main_cpu = machine.device("maincpu");
state->save_item(NAME(state->flip_screen));
}
static MACHINE_RESET( dorachan )
{
- dorachan_state *state = machine->driver_data<dorachan_state>();
+ dorachan_state *state = machine.driver_data<dorachan_state>();
state->flip_screen = 0;
}
diff --git a/src/mame/drivers/dotrikun.c b/src/mame/drivers/dotrikun.c
index af82bf93a44..762a5c1bbd4 100644
--- a/src/mame/drivers/dotrikun.c
+++ b/src/mame/drivers/dotrikun.c
@@ -46,7 +46,7 @@ public:
static WRITE8_HANDLER( dotrikun_color_w )
{
- dotrikun_state *state = space->machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = space->machine().driver_data<dotrikun_state>();
/*
x--- ---- screen color swap?
---- -x-- B
@@ -55,13 +55,13 @@ static WRITE8_HANDLER( dotrikun_color_w )
*/
state->color = data;
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static SCREEN_UPDATE( dotrikun )
{
- dotrikun_state *state = screen->machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = screen->machine().driver_data<dotrikun_state>();
int x,y,i;
pen_t back_pen = MAKE_RGB(pal1bit(state->color >> 3), pal1bit(state->color >> 4), pal1bit(state->color >> 5));
@@ -135,13 +135,13 @@ INPUT_PORTS_END
static MACHINE_START( dotrikun )
{
- dotrikun_state *state = machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = machine.driver_data<dotrikun_state>();
state->save_item(NAME(state->color));
}
static MACHINE_RESET( dotrikun )
{
- dotrikun_state *state = machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = machine.driver_data<dotrikun_state>();
state->color = 0;
}
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index a715609013c..ae273ffda6b 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -13,13 +13,13 @@ Atari Drag Race Driver
static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
{
- dragrace_state *state = timer.machine->driver_data<dragrace_state>();
+ dragrace_state *state = timer.machine().driver_data<dragrace_state>();
int i;
static const char *const portnames[] = { "P1", "P2" };
for (i = 0; i < 2; i++)
{
- switch (input_port_read(timer.machine, portnames[i]))
+ switch (input_port_read(timer.machine(), portnames[i]))
{
case 0x01: state->gear[i] = 1; break;
case 0x02: state->gear[i] = 2; break;
@@ -30,13 +30,13 @@ static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
}
/* watchdog is disabled during service mode */
- watchdog_enable(timer.machine, input_port_read(timer.machine, "IN0") & 0x20);
+ watchdog_enable(timer.machine(), input_port_read(timer.machine(), "IN0") & 0x20);
}
-static void dragrace_update_misc_flags( running_machine *machine )
+static void dragrace_update_misc_flags( running_machine &machine )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
/* 0x0900 = set 3SPEED1 0x00000001
* 0x0901 = set 4SPEED1 0x00000002
* 0x0902 = set 5SPEED1 0x00000004
@@ -90,7 +90,7 @@ static void dragrace_update_misc_flags( running_machine *machine )
static WRITE8_HANDLER( dragrace_misc_w )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
/* Set/clear individual bit */
UINT32 mask = 1 << offset;
@@ -99,24 +99,24 @@ static WRITE8_HANDLER( dragrace_misc_w )
else
state->misc_flags &= (~mask);
logerror("Set %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0900 + offset, mask, state->misc_flags, data & 0x01);
- dragrace_update_misc_flags(space->machine);
+ dragrace_update_misc_flags(space->machine());
}
static WRITE8_HANDLER( dragrace_misc_clear_w )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
/* Clear 8 bits */
UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8);
state->misc_flags &= (~mask);
logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920 + offset, mask, state->misc_flags, data & 0x01);
- dragrace_update_misc_flags(space->machine);
+ dragrace_update_misc_flags(space->machine());
}
static READ8_HANDLER( dragrace_input_r )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
- int val = input_port_read(space->machine, "IN2");
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
+ int val = input_port_read(space->machine(), "IN2");
static const char *const portnames[] = { "IN0", "IN1" };
UINT8 maskA = 1 << (offset % 8);
@@ -126,7 +126,7 @@ static READ8_HANDLER( dragrace_input_r )
for (i = 0; i < 2; i++)
{
- int in = input_port_read(space->machine, portnames[i]);
+ int in = input_port_read(space->machine(), portnames[i]);
if (state->gear[i] != 0)
in &= ~(1 << state->gear[i]);
@@ -149,7 +149,7 @@ static READ8_HANDLER( dragrace_steering_r )
for (i = 0; i < 2; i++)
{
- int dial = input_port_read(space->machine, dialnames[i]);
+ int dial = input_port_read(space->machine(), dialnames[i]);
bitA[i] = ((dial + 1) / 2) & 1;
bitB[i] = ((dial + 0) / 2) & 1;
@@ -163,7 +163,7 @@ static READ8_HANDLER( dragrace_steering_r )
static READ8_HANDLER( dragrace_scanline_r )
{
- return (space->machine->primary_screen->vpos() ^ 0xf0) | 0x0f;
+ return (space->machine().primary_screen->vpos() ^ 0xf0) | 0x0f;
}
@@ -316,9 +316,9 @@ static PALETTE_INIT( dragrace )
static MACHINE_START( dragrace )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
- state->discrete = machine->device("discrete");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->misc_flags));
state->save_item(NAME(state->gear));
@@ -326,7 +326,7 @@ static MACHINE_START( dragrace )
static MACHINE_RESET( dragrace )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
state->misc_flags = 0;
state->gear[0] = 0;
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index d9af87cda51..f0a62228904 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -113,13 +113,13 @@ public:
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
- const gfx_element *gfx = machine->gfx[0];
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT32 *source = state->spriteram;
UINT32 *finish = state->spriteram + 0x1000 / 4;
- UINT16 *redirect = (UINT16 *)machine->region("gfx3")->base();
+ UINT16 *redirect = (UINT16 *)machine.region("gfx3")->base();
while (source < finish)
{
@@ -171,7 +171,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static WRITE32_HANDLER( dreamwld_bg_videoram_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset * 2);
tilemap_mark_tile_dirty(state->bg_tilemap, offset * 2 + 1);
@@ -179,7 +179,7 @@ static WRITE32_HANDLER( dreamwld_bg_videoram_w )
static TILE_GET_INFO( get_dreamwld_bg_tile_info )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
int tileno, colour;
tileno = (tile_index & 1) ? (state->bg_videoram[tile_index >> 1] & 0xffff) : ((state->bg_videoram[tile_index >> 1] >> 16) & 0xffff);
colour = tileno >> 13;
@@ -190,7 +190,7 @@ static TILE_GET_INFO( get_dreamwld_bg_tile_info )
static WRITE32_HANDLER( dreamwld_bg2_videoram_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
COMBINE_DATA(&state->bg2_videoram[offset]);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset * 2);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset * 2 + 1);
@@ -198,7 +198,7 @@ static WRITE32_HANDLER( dreamwld_bg2_videoram_w )
static TILE_GET_INFO( get_dreamwld_bg2_tile_info )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
UINT16 tileno, colour;
tileno = (tile_index & 1) ? (state->bg2_videoram[tile_index >> 1] & 0xffff) : ((state->bg2_videoram[tile_index >> 1] >> 16) & 0xffff);
colour = tileno >> 13;
@@ -208,7 +208,7 @@ static TILE_GET_INFO( get_dreamwld_bg2_tile_info )
static VIDEO_START( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->bg_tilemap = tilemap_create(machine, get_dreamwld_bg_tile_info,tilemap_scan_rows, 16, 16, 64,32);
state->bg2_tilemap = tilemap_create(machine, get_dreamwld_bg2_tile_info,tilemap_scan_rows, 16, 16, 64,32);
@@ -217,7 +217,7 @@ static VIDEO_START( dreamwld )
static SCREEN_UPDATE( dreamwld )
{
- dreamwld_state *state = screen->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = screen->machine().driver_data<dreamwld_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scroll[(0x400 / 4)] + 32);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg_scroll[(0x400 / 4) + 2] + 32);
@@ -242,7 +242,7 @@ static SCREEN_UPDATE( dreamwld )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -250,10 +250,10 @@ static SCREEN_UPDATE( dreamwld )
static READ32_HANDLER( dreamwld_protdata_r )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
- UINT8 *protdata = space->machine->region("user1")->base();
- size_t protsize = space->machine->region("user1")->bytes();
+ UINT8 *protdata = space->machine().region("user1")->base();
+ size_t protsize = space->machine().region("user1")->bytes();
UINT8 dat = protdata[(state->protindex++) % protsize];
return dat << 24;
}
@@ -261,7 +261,7 @@ static READ32_HANDLER( dreamwld_protdata_r )
static WRITE32_HANDLER( dreamwld_palette_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
UINT16 dat;
int color;
@@ -269,17 +269,17 @@ static WRITE32_HANDLER( dreamwld_palette_w )
color = offset * 2;
dat = state->paletteram[offset] & 0x7fff;
- palette_set_color_rgb(space->machine, color + 1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
+ palette_set_color_rgb(space->machine(), color + 1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
dat = (state->paletteram[offset] >> 16) & 0x7fff;
- palette_set_color_rgb(space->machine, color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
+ palette_set_color_rgb(space->machine(), color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
}
-static void dreamwld_oki_setbank( running_machine *machine, UINT8 chip, UINT8 bank )
+static void dreamwld_oki_setbank( running_machine &machine, UINT8 chip, UINT8 bank )
{
/* 0x30000-0x3ffff is banked.
banks are at 0x30000,0x40000,0x50000 and 0x60000 in rom */
- UINT8 *sound = machine->region(chip ? "oki1" : "oki2")->base();
+ UINT8 *sound = machine.region(chip ? "oki1" : "oki2")->base();
logerror("OKI%d: set bank %02x\n", chip, bank);
memcpy(sound + 0x30000, sound + 0xb0000 + 0x10000 * bank, 0x10000);
}
@@ -288,7 +288,7 @@ static void dreamwld_oki_setbank( running_machine *machine, UINT8 chip, UINT8 ba
static WRITE32_HANDLER( dreamwld_6295_0_bank_w )
{
if (ACCESSING_BITS_0_7)
- dreamwld_oki_setbank(space->machine, 0, data & 0x3);
+ dreamwld_oki_setbank(space->machine(), 0, data & 0x3);
else
logerror("OKI0: unk bank write %x mem_mask %8x\n", data, mem_mask);
}
@@ -296,7 +296,7 @@ static WRITE32_HANDLER( dreamwld_6295_0_bank_w )
static WRITE32_HANDLER( dreamwld_6295_1_bank_w )
{
if (ACCESSING_BITS_0_7)
- dreamwld_oki_setbank(space->machine, 1, data & 0x3);
+ dreamwld_oki_setbank(space->machine(), 1, data & 0x3);
else
logerror("OKI1: unk bank write %x mem_mask %8x\n", data, mem_mask);
}
@@ -402,7 +402,7 @@ GFXDECODE_END
static MACHINE_START( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->save_item(NAME(state->protindex));
state->save_item(NAME(state->tilebank));
@@ -411,7 +411,7 @@ static MACHINE_START( dreamwld )
static MACHINE_RESET( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->tilebankold[0] = state->tilebankold[1] = -1;
state->tilebank[0] = state->tilebank[1] = 0;
diff --git a/src/mame/drivers/drgnmst.c b/src/mame/drivers/drgnmst.c
index bfcb8e0fe0e..9305354bf48 100644
--- a/src/mame/drivers/drgnmst.c
+++ b/src/mame/drivers/drgnmst.c
@@ -43,14 +43,14 @@ Notes:
static WRITE16_HANDLER( drgnmst_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x100);
- coin_lockout_w(space->machine, 0, ~data & 0x400);
- coin_lockout_w(space->machine, 1, ~data & 0x800);
+ coin_counter_w(space->machine(), 0, data & 0x100);
+ coin_lockout_w(space->machine(), 0, ~data & 0x400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x800);
}
static WRITE16_HANDLER( drgnmst_snd_command_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (ACCESSING_BITS_0_7)
{
@@ -61,7 +61,7 @@ static WRITE16_HANDLER( drgnmst_snd_command_w )
static WRITE16_HANDLER( drgnmst_snd_flag_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* Enables the following 68K write operation to latch through to the PIC */
if (ACCESSING_BITS_0_7)
@@ -71,13 +71,13 @@ static WRITE16_HANDLER( drgnmst_snd_flag_w )
static READ8_HANDLER( pic16c5x_port0_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
return state->pic16c5x_port0;
}
static READ8_HANDLER( drgnmst_snd_command_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int data = 0;
switch (state->oki_control & 0x1f)
@@ -94,7 +94,7 @@ static READ8_HANDLER( drgnmst_snd_command_r )
static READ8_HANDLER( drgnmst_snd_flag_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (state->snd_flag)
{
state->snd_flag = 0;
@@ -106,7 +106,7 @@ static READ8_HANDLER( drgnmst_snd_flag_r )
static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* This is a 4 bit port.
Each pair of bits is used in part of the OKI PCM ROM bank selectors.
See the Port 2 write handler below (drgnmst_snd_control_w) for details.
@@ -117,7 +117,7 @@ static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
static WRITE8_HANDLER( drgnmst_oki_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
state->oki_command = data;
}
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( drgnmst_snd_control_w )
The OKI0 banks are pre-configured below in the driver init.
*/
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int oki_new_bank;
state->oki_control = data;
@@ -379,7 +379,7 @@ GFXDECODE_END
static MACHINE_START( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->save_item(NAME(state->snd_flag));
state->save_item(NAME(state->snd_command));
@@ -392,7 +392,7 @@ static MACHINE_START( drgnmst )
static MACHINE_RESET( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->snd_flag = 0;
state->snd_command = 0;
@@ -495,9 +495,9 @@ static UINT8 drgnmst_asciitohex( UINT8 data )
static DRIVER_INIT( drgnmst )
{
- UINT8 *drgnmst_PICROM_HEX = machine->region("user1")->base();
- UINT16 *drgnmst_PICROM = (UINT16 *)machine->region("audiocpu")->base();
- UINT8 *drgnmst_PCM = machine->region("oki1")->base();
+ UINT8 *drgnmst_PICROM_HEX = machine.region("user1")->base();
+ UINT16 *drgnmst_PICROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT8 *drgnmst_PCM = machine.region("oki1")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
@@ -563,7 +563,7 @@ static DRIVER_INIT( drgnmst )
data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- pic16c5x_set_config(machine->device("audiocpu"), data);
+ pic16c5x_set_config(machine.device("audiocpu"), data);
src_pos = 0x7fff; /* Force Exit */
}
diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c
index 38ccbea0cef..7287592971e 100644
--- a/src/mame/drivers/dribling.c
+++ b/src/mame/drivers/dribling.c
@@ -40,7 +40,7 @@
static INTERRUPT_GEN( dribling_irq_gen )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
if (state->di)
device_set_input_line(device, 0, ASSERT_LINE);
}
@@ -55,7 +55,7 @@ static INTERRUPT_GEN( dribling_irq_gen )
static READ8_DEVICE_HANDLER( dsr_r )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* return DSR0-7 */
return (state->ds << state->sh) | (state->dr >> (8 - state->sh));
@@ -64,15 +64,15 @@ static READ8_DEVICE_HANDLER( dsr_r )
static READ8_DEVICE_HANDLER( input_mux0_r )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* low value in the given bit selects */
if (!(state->input_mux & 0x01))
- return input_port_read(device->machine, "MUX0");
+ return input_port_read(device->machine(), "MUX0");
else if (!(state->input_mux & 0x02))
- return input_port_read(device->machine, "MUX1");
+ return input_port_read(device->machine(), "MUX1");
else if (!(state->input_mux & 0x04))
- return input_port_read(device->machine, "MUX2");
+ return input_port_read(device->machine(), "MUX2");
return 0xff;
}
@@ -86,7 +86,7 @@ static READ8_DEVICE_HANDLER( input_mux0_r )
static WRITE8_DEVICE_HANDLER( misc_w )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* bit 7 = di */
state->di = (data >> 7) & 1;
@@ -105,7 +105,7 @@ static WRITE8_DEVICE_HANDLER( misc_w )
/* bit 1 = (10) = PC1 */
/* bit 0 = (32) = PC0 */
state->input_mux = data & 7;
- logerror("%s:misc_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:misc_w(%02X)\n", device->machine().describe_context(), data);
}
@@ -119,24 +119,24 @@ static WRITE8_DEVICE_HANDLER( sound_w )
/* bit 2 = folla a */
/* bit 1 = folla m */
/* bit 0 = folla b */
- logerror("%s:sound_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:sound_w(%02X)\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( pb_w )
{
/* write PB0-7 */
- logerror("%s:pb_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:pb_w(%02X)\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( shr_w )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* bit 3 = watchdog */
if (data & 0x08)
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
/* bit 2-0 = SH0-2 */
state->sh = data & 0x07;
@@ -152,7 +152,7 @@ static WRITE8_DEVICE_HANDLER( shr_w )
static READ8_HANDLER( ioread )
{
- dribling_state *state = space->machine->driver_data<dribling_state>();
+ dribling_state *state = space->machine().driver_data<dribling_state>();
if (offset & 0x08)
return ppi8255_r(state->ppi_0, offset & 3);
@@ -164,7 +164,7 @@ static READ8_HANDLER( ioread )
static WRITE8_HANDLER( iowrite )
{
- dribling_state *state = space->machine->driver_data<dribling_state>();
+ dribling_state *state = space->machine().driver_data<dribling_state>();
if (offset & 0x08)
ppi8255_w(state->ppi_0, offset & 3, data);
@@ -285,11 +285,11 @@ INPUT_PORTS_END
static MACHINE_START( dribling )
{
- dribling_state *state = machine->driver_data<dribling_state>();
+ dribling_state *state = machine.driver_data<dribling_state>();
- state->maincpu = machine->device("maincpu");
- state->ppi_0 = machine->device("ppi8255_0");
- state->ppi_1 = machine->device("ppi8255_1");
+ state->maincpu = machine.device("maincpu");
+ state->ppi_0 = machine.device("ppi8255_0");
+ state->ppi_1 = machine.device("ppi8255_1");
state->save_item(NAME(state->abca));
state->save_item(NAME(state->di));
@@ -301,7 +301,7 @@ static MACHINE_START( dribling )
static MACHINE_RESET( dribling )
{
- dribling_state *state = machine->driver_data<dribling_state>();
+ dribling_state *state = machine.driver_data<dribling_state>();
state->abca = 0;
state->di = 0;
diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c
index 924a52d45ff..c319d483be3 100644
--- a/src/mame/drivers/drmicro.c
+++ b/src/mame/drivers/drmicro.c
@@ -25,7 +25,7 @@ Quite similar to Appoooh
static INTERRUPT_GEN( drmicro_interrupt )
{
- drmicro_state *state = device->machine->driver_data<drmicro_state>();
+ drmicro_state *state = device->machine().driver_data<drmicro_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -33,11 +33,11 @@ static INTERRUPT_GEN( drmicro_interrupt )
static WRITE8_HANDLER( nmi_enable_w )
{
- drmicro_state *state = space->machine->driver_data<drmicro_state>();
+ drmicro_state *state = space->machine().driver_data<drmicro_state>();
state->nmi_enable = data & 1;
state->flipscreen = (data & 2) ? 1 : 0;
- flip_screen_set(space->machine, data & 2);
+ flip_screen_set(space->machine(), data & 2);
// bit2,3 unknown
}
@@ -45,8 +45,8 @@ static WRITE8_HANDLER( nmi_enable_w )
static void pcm_w(device_t *device)
{
- drmicro_state *state = device->machine->driver_data<drmicro_state>();
- UINT8 *PCM = device->machine->region("adpcm")->base();
+ drmicro_state *state = device->machine().driver_data<drmicro_state>();
+ UINT8 *PCM = device->machine().region("adpcm")->base();
int data = PCM[state->pcm_adr / 2];
@@ -66,7 +66,7 @@ static void pcm_w(device_t *device)
static WRITE8_HANDLER( pcm_set_w )
{
- drmicro_state *state = space->machine->driver_data<drmicro_state>();
+ drmicro_state *state = space->machine().driver_data<drmicro_state>();
state->pcm_adr = ((data & 0x3f) << 9);
pcm_w(state->msm);
}
@@ -228,9 +228,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( drmicro )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
- state->msm = machine->device("msm");
+ state->msm = machine.device("msm");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->pcm_adr));
@@ -239,7 +239,7 @@ static MACHINE_START( drmicro )
static MACHINE_RESET( drmicro )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
state->nmi_enable = 0;
state->pcm_adr = 0;
diff --git a/src/mame/drivers/drtomy.c b/src/mame/drivers/drtomy.c
index 9d46c18f237..bf7c45413ff 100644
--- a/src/mame/drivers/drtomy.c
+++ b/src/mame/drivers/drtomy.c
@@ -34,7 +34,7 @@ public:
static TILE_GET_INFO( get_tile_info_fg )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int code = state->videoram_fg[tile_index] & 0xfff;
int color = (state->videoram_fg[tile_index] & 0xf000) >> 12;
SET_TILE_INFO(2, code, color, 0);
@@ -43,7 +43,7 @@ static TILE_GET_INFO( get_tile_info_fg )
static TILE_GET_INFO( get_tile_info_bg )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int code = state->videoram_bg[tile_index] & 0xfff;
int color = (state->videoram_bg[tile_index] & 0xf000) >> 12;
SET_TILE_INFO(1, code, color, 0);
@@ -67,11 +67,11 @@ static TILE_GET_INFO( get_tile_info_bg )
3 | xxxxxxxx xxxxxx-- | sprite code
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int i, x, y, ex, ey;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
static const int x_offset[2] = {0x0, 0x2};
static const int y_offset[2] = {0x0, 0x1};
@@ -114,7 +114,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_START( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->tilemap_bg = tilemap_create(machine, get_tile_info_bg, tilemap_scan_rows, 16, 16, 32, 32);
state->tilemap_fg = tilemap_create(machine, get_tile_info_fg, tilemap_scan_rows, 16, 16, 32, 32);
@@ -124,31 +124,31 @@ static VIDEO_START( drtomy )
static SCREEN_UPDATE( drtomy )
{
- drtomy_state *state = screen->machine->driver_data<drtomy_state>();
+ drtomy_state *state = screen->machine().driver_data<drtomy_state>();
tilemap_draw(bitmap, cliprect, state->tilemap_bg, 0, 0);
tilemap_draw(bitmap, cliprect, state->tilemap_fg, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( drtomy_vram_fg_w )
{
- drtomy_state *state = space->machine->driver_data<drtomy_state>();
+ drtomy_state *state = space->machine().driver_data<drtomy_state>();
COMBINE_DATA(&state->videoram_fg[offset]);
tilemap_mark_tile_dirty(state->tilemap_fg, offset);
}
static WRITE16_HANDLER( drtomy_vram_bg_w )
{
- drtomy_state *state = space->machine->driver_data<drtomy_state>();
+ drtomy_state *state = space->machine().driver_data<drtomy_state>();
COMBINE_DATA(&state->videoram_bg[offset]);
tilemap_mark_tile_dirty(state->tilemap_bg, offset);
}
static WRITE16_DEVICE_HANDLER( drtomy_okibank_w )
{
- drtomy_state *state = device->machine->driver_data<drtomy_state>();
+ drtomy_state *state = device->machine().driver_data<drtomy_state>();
if (state->oki_bank != (data & 3))
{
state->oki_bank = data & 3;
@@ -278,14 +278,14 @@ INPUT_PORTS_END
static MACHINE_START( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->save_item(NAME(state->oki_bank));
}
static MACHINE_RESET( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->oki_bank = 0;
}
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index eaf5ffcb3ef..e66392dbeae 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -59,8 +59,8 @@ public:
static MACHINE_START( drw80pkr )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
- machine->device<nvram_device>("nvram")->set_base(state->pkr_io_ram, sizeof(state->pkr_io_ram));
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
+ machine.device<nvram_device>("nvram")->set_base(state->pkr_io_ram, sizeof(state->pkr_io_ram));
}
/*****************
@@ -69,37 +69,37 @@ static MACHINE_START( drw80pkr )
static WRITE8_HANDLER( t0_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->t0 = data;
}
static WRITE8_HANDLER( t1_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->t1 = data;
}
static WRITE8_HANDLER( p0_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p0 = data;
}
static WRITE8_HANDLER( p1_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p1 = data;
}
static WRITE8_HANDLER( p2_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p2 = data;
}
static WRITE8_HANDLER( prog_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->prog = data;
// Bankswitch Program Memory
@@ -107,19 +107,19 @@ static WRITE8_HANDLER( prog_w )
{
state->active_bank = state->active_bank ^ 0x01;
- memory_set_bank(space->machine, "bank1", state->active_bank);
+ memory_set_bank(space->machine(), "bank1", state->active_bank);
}
}
static WRITE8_HANDLER( bus_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->bus = data;
}
static WRITE8_HANDLER( drw80pkr_io_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
UINT16 n_offs;
if (state->p2 == 0x3f || state->p2 == 0x7f)
@@ -184,11 +184,11 @@ static WRITE8_HANDLER( drw80pkr_io_w )
// ay8910 control port
if (state->p1 == 0xfc)
- ay8910_address_w(space->machine->device("aysnd"), 0, data);
+ ay8910_address_w(space->machine().device("aysnd"), 0, data);
// ay8910_write_port_0_w
if (state->p1 == 0xfe)
- ay8910_data_w(space->machine->device("aysnd"), 0, data);
+ ay8910_data_w(space->machine().device("aysnd"), 0, data);
}
}
@@ -198,43 +198,43 @@ static WRITE8_HANDLER( drw80pkr_io_w )
static READ8_HANDLER( t0_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->t0;
}
static READ8_HANDLER( t1_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->t1;
}
static READ8_HANDLER( p0_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p0;
}
static READ8_HANDLER( p1_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p1;
}
static READ8_HANDLER( p2_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p2;
}
static READ8_HANDLER( bus_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->bus;
}
static READ8_HANDLER( drw80pkr_io_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
UINT8 ret;
UINT16 kbdin;
@@ -284,7 +284,7 @@ static READ8_HANDLER( drw80pkr_io_r )
{
// TODO: Get Input Port Values
- kbdin = ((input_port_read(space->machine, "IN1") & 0xaf ) << 8) + input_port_read(space->machine, "IN0");
+ kbdin = ((input_port_read(space->machine(), "IN1") & 0xaf ) << 8) + input_port_read(space->machine(), "IN0");
switch (kbdin)
{
@@ -324,7 +324,7 @@ static READ8_HANDLER( drw80pkr_io_r )
static TILE_GET_INFO( get_bg_tile_info )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
int color = state->color_ram[tile_index];
int code = state->video_ram[tile_index];
@@ -333,13 +333,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( drw80pkr )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 24, 27);
}
static SCREEN_UPDATE( drw80pkr )
{
- drw80pkr_state *state = screen->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = screen->machine().driver_data<drw80pkr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -349,7 +349,7 @@ static PALETTE_INIT( drw80pkr )
{
int j;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int r, g, b, tr, tg, tb, i;
@@ -404,7 +404,7 @@ GFXDECODE_END
static DRIVER_INIT( drw80pkr )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base(), 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base(), 0x1000);
}
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index e5e22c1a37a..f6245ac1347 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -95,14 +95,14 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
UINT16 code = state->videoram[tile_index];
UINT8 color = state->colorram[tile_index] & 0x0f;
SET_TILE_INFO(0, code, color, 0);
}
static TILE_GET_INFO( get_tile_info2 )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
UINT16 code = state->videoram2[tile_index];
UINT8 color = state->colorram2[tile_index] & 0x0f;
SET_TILE_INFO(1, code, color, 0);
@@ -110,7 +110,7 @@ static TILE_GET_INFO( get_tile_info2 )
static VIDEO_START(dunhuang)
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
state->tmap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20);
state->tmap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8,32, 0x40,0x8);
@@ -126,20 +126,20 @@ static VIDEO_START(dunhuang)
static SCREEN_UPDATE( dunhuang )
{
- dunhuang_state *state = screen->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = screen->machine().driver_data<dunhuang_state>();
int layers_ctrl = -1;
#if DUNHUANG_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
switch (state->layers)
{
@@ -164,7 +164,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
static WRITE8_HANDLER( dunhuang_pos_x_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->pos_x = data & 0x3f;
state->written = 0;
state->written2 = 0;
@@ -172,7 +172,7 @@ static WRITE8_HANDLER( dunhuang_pos_x_w )
static WRITE8_HANDLER( dunhuang_pos_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->pos_y = data;
state->written = 0;
state->written2 = 0;
@@ -180,7 +180,7 @@ static WRITE8_HANDLER( dunhuang_pos_y_w )
static WRITE8_HANDLER( dunhuang_tile_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int addr;
if (state->written & (1 << offset))
@@ -207,7 +207,7 @@ static WRITE8_HANDLER( dunhuang_tile_w )
static WRITE8_HANDLER( dunhuang_tile2_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int addr;
if (state->written2 & (1 << offset))
@@ -236,12 +236,12 @@ static WRITE8_HANDLER( dunhuang_tile2_w )
static WRITE8_HANDLER( dunhuang_clear_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->clear_y = data;
}
static WRITE8_HANDLER( dunhuang_horiz_clear_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i;
// logerror("%06x: horiz clear, y = %02x, data = %02d\n", cpu_get_pc(space->cpu), state->clear_y,data);
for (i = 0; i < 0x40; i++)
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( dunhuang_horiz_clear_w )
static WRITE8_HANDLER( dunhuang_vert_clear_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i;
// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", cpu_get_pc(space->cpu), state->pos_x,state->pos_y,data);
for (i = 0; i < 0x08; i++)
@@ -279,50 +279,50 @@ static WRITE8_HANDLER( dunhuang_vert_clear_w )
static WRITE8_HANDLER( dunhuang_block_dest_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_dest = data;
}
static WRITE8_HANDLER( dunhuang_block_x_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_x = data;
}
static WRITE8_HANDLER( dunhuang_block_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_y = data;
}
static WRITE8_HANDLER( dunhuang_block_w_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_w = data;
}
static WRITE8_HANDLER( dunhuang_block_c_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_c = data;
}
static WRITE8_HANDLER( dunhuang_block_addr_lo_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_addr_lo = data;
}
static WRITE8_HANDLER( dunhuang_block_addr_hi_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_addr_hi = data;
}
static WRITE8_HANDLER( dunhuang_block_h_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i,j, addr;
UINT8 *tile_addr;
@@ -330,7 +330,7 @@ static WRITE8_HANDLER( dunhuang_block_h_w )
state->block_h = data;
- tile_addr = space->machine->region("gfx2")->base() + ((state->block_addr_hi << 8) + state->block_addr_lo) * 4;
+ tile_addr = space->machine().region("gfx2")->base() + ((state->block_addr_hi << 8) + state->block_addr_lo) * 4;
switch (state->block_dest)
{
@@ -373,16 +373,16 @@ static WRITE8_HANDLER( dunhuang_block_h_w )
static WRITE8_HANDLER( dunhuang_paloffs_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->paloffs = data * 3;
}
static WRITE8_HANDLER( dunhuang_paldata_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->paldata[state->paloffs] = data;
- palette_set_color_rgb( space->machine, state->paloffs/3,
+ palette_set_color_rgb( space->machine(), state->paloffs/3,
pal6bit(state->paldata[(state->paloffs/3)*3+0]),
pal6bit(state->paldata[(state->paloffs/3)*3+1]),
pal6bit(state->paldata[(state->paloffs/3)*3+2])
@@ -395,7 +395,7 @@ static WRITE8_HANDLER( dunhuang_paldata_w )
static WRITE8_HANDLER( dunhuang_layers_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
// popmessage("layers %02x",data);
state->layers = data;
}
@@ -414,53 +414,53 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( dunhuang_input_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->input = data;
}
static READ8_HANDLER( dunhuang_service_r )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
- return input_port_read(space->machine, "SERVICE")
- | ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0x00 : 0x08) // bit 3: hopper sensor
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
+ return input_port_read(space->machine(), "SERVICE")
+ | ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0x00 : 0x08) // bit 3: hopper sensor
| 0x80 // bit 7 low -> tiles block transferrer busy
;
}
static READ8_DEVICE_HANDLER( dunhuang_dsw_r )
{
- dunhuang_state *state = device->machine->driver_data<dunhuang_state>();
- if (!(state->input & 0x01)) return input_port_read(device->machine, "DSW1");
- if (!(state->input & 0x02)) return input_port_read(device->machine, "DSW2");
- if (!(state->input & 0x04)) return input_port_read(device->machine, "DSW3");
- if (!(state->input & 0x08)) return input_port_read(device->machine, "DSW4");
- if (!(state->input & 0x10)) return input_port_read(device->machine, "DSW5");
- logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine->describe_context(), state->input);
+ dunhuang_state *state = device->machine().driver_data<dunhuang_state>();
+ if (!(state->input & 0x01)) return input_port_read(device->machine(), "DSW1");
+ if (!(state->input & 0x02)) return input_port_read(device->machine(), "DSW2");
+ if (!(state->input & 0x04)) return input_port_read(device->machine(), "DSW3");
+ if (!(state->input & 0x08)) return input_port_read(device->machine(), "DSW4");
+ if (!(state->input & 0x10)) return input_port_read(device->machine(), "DSW5");
+ logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine().describe_context(), state->input);
return 0xff;
}
static READ8_HANDLER( dunhuang_input_r )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
- if (!(state->input & 0x01)) return input_port_read(space->machine, "IN0");
- if (!(state->input & 0x02)) return input_port_read(space->machine, "IN1");
- if (!(state->input & 0x04)) return input_port_read(space->machine, "IN2");
- if (!(state->input & 0x08)) return input_port_read(space->machine, "IN3");
- if (!(state->input & 0x10)) return input_port_read(space->machine, "IN4");
- logerror("%s: warning, unknown input bits read, input = %02x\n", space->machine->describe_context(), state->input);
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
+ if (!(state->input & 0x01)) return input_port_read(space->machine(), "IN0");
+ if (!(state->input & 0x02)) return input_port_read(space->machine(), "IN1");
+ if (!(state->input & 0x04)) return input_port_read(space->machine(), "IN2");
+ if (!(state->input & 0x08)) return input_port_read(space->machine(), "IN3");
+ if (!(state->input & 0x10)) return input_port_read(space->machine(), "IN4");
+ logerror("%s: warning, unknown input bits read, input = %02x\n", space->machine().describe_context(), state->input);
return 0xff;
}
static WRITE8_HANDLER( dunhuang_rombank_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
// ? data & 0x01
// ? data & 0x02
- memory_set_bank(space->machine, "bank1", ((data >> 2) & 0x7));
+ memory_set_bank(space->machine(), "bank1", ((data >> 2) & 0x7));
// COIN OUT: data & 0x20
- coin_counter_w(space->machine, 0, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x40);
state->hopper = data & 0x80;
}
@@ -756,8 +756,8 @@ static const ay8910_interface dunhuang_ay8910_interface =
static MACHINE_START( dunhuang )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
@@ -782,7 +782,7 @@ static MACHINE_START( dunhuang )
static MACHINE_RESET( dunhuang )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
state->written = 0;
state->written2 = 0;
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index c7cb63f24a7..96b65bac35e 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -349,7 +349,7 @@ enum
static WRITE8_HANDLER (i8275_preg_w) //param reg
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
switch (state->i8275Command)
{
@@ -470,7 +470,7 @@ static READ8_HANDLER (i8275_preg_r) //param reg
static WRITE8_HANDLER (i8275_creg_w) //comand reg
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
switch (data>>5)
{
@@ -515,7 +515,7 @@ static READ8_HANDLER (i8275_sreg_r) //status
static READ8_HANDLER(dwarfd_ram_r)
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
if (state->crt_access == 0)
{
@@ -531,7 +531,7 @@ static READ8_HANDLER(dwarfd_ram_r)
static WRITE8_HANDLER(dwarfd_ram_w)
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
state->dw_ram[offset] = data;
}
@@ -568,7 +568,7 @@ static WRITE8_HANDLER(output2_w)
static READ8_HANDLER(qc_b8_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( mem_map, AS_PROGRAM, 8 )
@@ -680,9 +680,9 @@ static VIDEO_START(dwarfd)
{
}
-static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
int x, y;
for (y = 0; y < maxy; y++)
{
@@ -725,13 +725,13 @@ static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle
if ((tile & 0xc0) == 0xc0)
{
b = 1;
- tile = machine->rand() & 0x7f;//(tile >> 2) & 0xf;
+ tile = machine.rand() & 0x7f;//(tile >> 2) & 0xf;
}
}
else
b = 1;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
tile + (state->bank + bank2) * 128,
0,
0, 0,
@@ -743,14 +743,14 @@ static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle
static SCREEN_UPDATE( dwarfd )
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- drawCrt(screen->machine, bitmap, cliprect);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ drawCrt(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE_LINE_DEVICE_HANDLER( dwarfd_sod_callback )
{
- dwarfd_state *driver_state = device->machine->driver_data<dwarfd_state>();
+ dwarfd_state *driver_state = device->machine().driver_data<dwarfd_state>();
driver_state->crt_access = state;
}
@@ -767,7 +767,7 @@ static I8085_CONFIG( dwarfd_i8085_config )
#define NUM_LINES 25
static INTERRUPT_GEN( dwarfd_interrupt )
{
- dwarfd_state *state = device->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = device->machine().driver_data<dwarfd_state>();
if (cpu_getiloops(device) < NUM_LINES)
{
@@ -887,9 +887,9 @@ static PALETTE_INIT(dwarfd)
for (i = 0; i < 256; i++)
{
- int r = machine->rand()|0x80;
- int g = machine->rand()|0x80;
- int b = machine->rand()|0x80;
+ int r = machine.rand()|0x80;
+ int g = machine.rand()|0x80;
+ int b = machine.rand()|0x80;
if (i == 0) r = g = b = 0;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -913,7 +913,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( dwarfd )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
state->save_item(NAME(state->bank));
state->save_item(NAME(state->line));
@@ -937,7 +937,7 @@ static MACHINE_START( dwarfd )
static MACHINE_RESET( dwarfd )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
state->bank = 0;
state->line = 0;
@@ -1136,13 +1136,13 @@ ROM_END
static DRIVER_INIT(dwarfd)
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
int i;
UINT8 *src, *dst;
/* expand gfx roms */
- src = machine->region("gfx1")->base();
- dst = machine->region("gfx2")->base();
+ src = machine.region("gfx1")->base();
+ dst = machine.region("gfx2")->base();
for (i = 0; i < 0x4000; i++)
{
@@ -1155,7 +1155,7 @@ static DRIVER_INIT(dwarfd)
}
/* use low bit as 'interpolation' bit */
- src = machine->region("gfx2")->base();
+ src = machine.region("gfx2")->base();
for (i = 0; i < 0x8000; i++)
{
if (src[i] & 0x10)
@@ -1186,12 +1186,12 @@ static DRIVER_INIT(qc)
DRIVER_INIT_CALL(dwarfd);
// hacks for program to proceed
- machine->region("maincpu")->base()[0x6564] = 0x00;
- machine->region("maincpu")->base()[0x6565] = 0x00;
+ machine.region("maincpu")->base()[0x6564] = 0x00;
+ machine.region("maincpu")->base()[0x6565] = 0x00;
- machine->region("maincpu")->base()[0x59b2] = 0x00;
- machine->region("maincpu")->base()[0x59b3] = 0x00;
- machine->region("maincpu")->base()[0x59b4] = 0x00;
+ machine.region("maincpu")->base()[0x59b2] = 0x00;
+ machine.region("maincpu")->base()[0x59b3] = 0x00;
+ machine.region("maincpu")->base()[0x59b4] = 0x00;
}
diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c
index 8980614b045..c0b61ff6db2 100644
--- a/src/mame/drivers/dynadice.c
+++ b/src/mame/drivers/dynadice.c
@@ -59,7 +59,7 @@ public:
static WRITE8_HANDLER( dynadice_videoram_w )
{
- dynadice_state *state = space->machine->driver_data<dynadice_state>();
+ dynadice_state *state = space->machine().driver_data<dynadice_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
tilemap_mark_all_tiles_dirty(state->top_tilemap);
@@ -67,13 +67,13 @@ static WRITE8_HANDLER( dynadice_videoram_w )
static WRITE8_HANDLER( sound_data_w )
{
- dynadice_state *state = space->machine->driver_data<dynadice_state>();
+ dynadice_state *state = space->machine().driver_data<dynadice_state>();
state->ay_data = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- dynadice_state *state = device->machine->driver_data<dynadice_state>();
+ dynadice_state *state = device->machine().driver_data<dynadice_state>();
/*
AY 3-8910 :
@@ -190,14 +190,14 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
static VIDEO_START( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
/* pacman - style videoram layout */
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -207,7 +207,7 @@ static VIDEO_START( dynadice )
static SCREEN_UPDATE( dynadice )
{
- dynadice_state *state = screen->machine->driver_data<dynadice_state>();
+ dynadice_state *state = screen->machine().driver_data<dynadice_state>();
rectangle myclip = *cliprect;
myclip.max_x = 15;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -224,13 +224,13 @@ static PALETTE_INIT( dynadice )
static MACHINE_START( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
state->save_item(NAME(state->ay_data));
}
static MACHINE_RESET( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
state->ay_data = 0;
}
@@ -293,10 +293,10 @@ ROM_END
static DRIVER_INIT( dynadice )
{
int i, j;
- UINT8 *usr1 = machine->region("user1")->base();
- UINT8 *cpu2 = machine->region("audiocpu")->base();
- UINT8 *gfx1 = machine->region("gfx1")->base();
- UINT8 *gfx2 = machine->region("gfx2")->base();
+ UINT8 *usr1 = machine.region("user1")->base();
+ UINT8 *cpu2 = machine.region("audiocpu")->base();
+ UINT8 *gfx1 = machine.region("gfx1")->base();
+ UINT8 *gfx2 = machine.region("gfx2")->base();
cpu2[0x0b] = 0x23; /* bug in game code Dec HL -> Inc HL*/
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index cd0d50ed07e..54b0ed7f4b2 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -99,39 +99,39 @@ TODO:
/* It runs in IM 0, thus needs an opcode on the data bus */
-void sprtmtch_update_irq( running_machine *machine )
+void sprtmtch_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = (state->sound_irq ? 0x08 : 0) | ((state->vblank_irq) ? 0x10 : 0) | ((state->blitter_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->maincpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static WRITE8_HANDLER( dynax_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->vblank_irq = 0;
- sprtmtch_update_irq(space->machine);
+ sprtmtch_update_irq(space->machine());
}
static WRITE8_HANDLER( dynax_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = 0;
- sprtmtch_update_irq(space->machine);
+ sprtmtch_update_irq(space->machine());
}
static INTERRUPT_GEN( sprtmtch_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->vblank_irq = 1;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
static void sprtmtch_sound_callback( device_t *device, int state )
{
- dynax_state *driver_state = device->machine->driver_data<dynax_state>();
+ dynax_state *driver_state = device->machine().driver_data<dynax_state>();
driver_state->sound_irq = state;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
@@ -140,39 +140,39 @@ static void sprtmtch_sound_callback( device_t *device, int state )
***************************************************************************/
/* It runs in IM 0, thus needs an opcode on the data bus */
-void jantouki_update_irq(running_machine *machine)
+void jantouki_update_irq(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = ((state->blitter_irq) ? 0x08 : 0) | ((state->blitter2_irq) ? 0x10 : 0) | ((state->vblank_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->maincpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static WRITE8_HANDLER( jantouki_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->vblank_irq = 0;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static WRITE8_HANDLER( jantouki_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = data;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static WRITE8_HANDLER( jantouki_blitter2_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter2_irq = data;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static INTERRUPT_GEN( jantouki_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->vblank_irq = 1;
- jantouki_update_irq(device->machine);
+ jantouki_update_irq(device->machine());
}
@@ -180,32 +180,32 @@ static INTERRUPT_GEN( jantouki_vblank_interrupt )
Jantouki - Sound CPU
***************************************************************************/
-static void jantouki_sound_update_irq(running_machine *machine)
+static void jantouki_sound_update_irq(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = ((state->sound_irq) ? 0x08 : 0) | ((state->soundlatch_irq) ? 0x10 : 0) | ((state->sound_vblank_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static INTERRUPT_GEN( jantouki_sound_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->sound_vblank_irq = 1;
- jantouki_sound_update_irq(device->machine);
+ jantouki_sound_update_irq(device->machine());
}
static WRITE8_HANDLER( jantouki_sound_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->sound_vblank_irq = 0;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static void jantouki_sound_callback(device_t *device, int state)
{
- dynax_state *driver_state = device->machine->driver_data<dynax_state>();
+ dynax_state *driver_state = device->machine().driver_data<dynax_state>();
driver_state->sound_irq = state;
- jantouki_sound_update_irq(device->machine);
+ jantouki_sound_update_irq(device->machine());
}
@@ -223,12 +223,12 @@ static void jantouki_sound_callback(device_t *device, int state)
static WRITE8_HANDLER( dynax_coincounter_0_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
static WRITE8_HANDLER( dynax_coincounter_1_w )
{
- coin_counter_w(space->machine, 1, data);
+ coin_counter_w(space->machine(), 1, data);
}
static READ8_HANDLER( ret_ff )
@@ -239,60 +239,60 @@ static READ8_HANDLER( ret_ff )
static READ8_HANDLER( hanamai_keyboard_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY0");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY1");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY2");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY3");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY0");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY1");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY2");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY3");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY4");
return res;
}
static READ8_HANDLER( hanamai_keyboard_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY5");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY6");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY7");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY8");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY5");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY6");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY7");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY8");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY9");
return res;
}
static WRITE8_HANDLER( hanamai_keyboard_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->keyb = data;
}
static WRITE8_HANDLER( dynax_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( jantouki_sound_rombank_w )
{
- memory_set_bank(space->machine, "bank2", data);
+ memory_set_bank(space->machine(), "bank2", data);
}
static WRITE8_HANDLER( hnoridur_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- int bank_n = (space->machine->region("maincpu")->bytes() - 0x10000) / 0x8000;
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ int bank_n = (space->machine().region("maincpu")->bytes() - 0x10000) / 0x8000;
//logerror("%04x: rom bank = %02x\n", cpu_get_pc(space->cpu), data);
if (data < bank_n)
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
else
logerror("rom_bank = %02x (larger than the maximum bank %02x)\n", data, bank_n);
state->hnoridur_bank = data;
@@ -301,14 +301,14 @@ static WRITE8_HANDLER( hnoridur_rombank_w )
static WRITE8_HANDLER( hnoridur_palbank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->palbank = data & 0x0f;
dynax_blit_palbank_w(space, 0, data);
}
static WRITE8_HANDLER( hnoridur_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->hnoridur_bank)
{
@@ -327,7 +327,7 @@ static WRITE8_HANDLER( hnoridur_palette_w )
// hnoridur: R/W RAM
case 0x18:
{
- UINT8 *RAM = space->machine->region("maincpu")->base() + 0x10000 + state->hnoridur_bank * 0x8000;
+ UINT8 *RAM = space->machine().region("maincpu")->base() + 0x10000 + state->hnoridur_bank * 0x8000;
RAM[offset] = data;
return;
}
@@ -343,13 +343,13 @@ static WRITE8_HANDLER( hnoridur_palette_w )
int r = BITSWAP8((x >> 0) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int g = BITSWAP8((x >> 5) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int b = BITSWAP8((x >> 10) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
- palette_set_color_rgb(space->machine, 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static WRITE8_HANDLER( yarunara_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int addr = 512 * state->palbank + offset;
switch (state->hnoridur_bank)
@@ -375,13 +375,13 @@ static WRITE8_HANDLER( yarunara_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + ((offset & 0x0f) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + ((offset & 0x0f) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static WRITE8_HANDLER( nanajign_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->hnoridur_bank)
{
@@ -404,14 +404,14 @@ static WRITE8_HANDLER( nanajign_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static void adpcm_int( device_t *device )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -426,7 +426,7 @@ static void adpcm_int( device_t *device )
static void adpcm_int_cpu1( device_t *device )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -441,23 +441,23 @@ static void adpcm_int_cpu1( device_t *device )
static WRITE8_HANDLER( adpcm_data_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->msm5205next = data;
}
static WRITE8_DEVICE_HANDLER( adpcm_reset_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->resetkludge = data & 1;
msm5205_reset_w(device, ~data & 1);
}
static MACHINE_RESET( adpcm )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
/* start with the MSM5205 reset */
state->resetkludge = 0;
- msm5205_reset_w(machine->device("msm"), 1);
+ msm5205_reset_w(machine.device("msm"), 1);
}
static WRITE8_HANDLER( yarunara_layer_half_w )
@@ -609,35 +609,35 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hjingi_bank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hnoridur_bank = data;
}
static WRITE8_HANDLER( hjingi_lockout_w )
{
- coin_lockout_w(space->machine, 0, (~data) & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x01);
}
static WRITE8_HANDLER( hjingi_hopper_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hopper = data & 0x01;
}
-static UINT8 hjingi_hopper_bit( running_machine *machine )
+static UINT8 hjingi_hopper_bit( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- return (state->hopper && !(machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6);
+ dynax_state *state = machine.driver_data<dynax_state>();
+ return (state->hopper && !(machine.primary_screen->frame_number() % 10)) ? 0 : (1 << 6);
}
static READ8_HANDLER( hjingi_keyboard_0_r )
{
- return hanamai_keyboard_0_r(space, 0) | hjingi_hopper_bit(space->machine);
+ return hanamai_keyboard_0_r(space, 0) | hjingi_hopper_bit(space->machine());
}
static READ8_HANDLER( hjingi_keyboard_1_r )
{
- return hanamai_keyboard_1_r(space, 0) | input_port_read(space->machine, "BET");
+ return hanamai_keyboard_1_r(space, 0) | input_port_read(space->machine(), "BET");
}
static ADDRESS_MAP_START( hjingi_mem_map, AS_PROGRAM, 8 )
@@ -706,7 +706,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( yarunara_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
@@ -721,7 +721,7 @@ static WRITE8_HANDLER( yarunara_input_w )
static READ8_HANDLER( yarunara_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -732,7 +732,7 @@ static READ8_HANDLER( yarunara_input_r )
switch (state->input_sel)
{
case 0x00:
- return input_port_read(space->machine, "COINS"); // coins
+ return input_port_read(space->machine(), "COINS"); // coins
case 0x02:
return 0xff; // bit 7 must be 1. Bit 2?
@@ -749,12 +749,12 @@ static READ8_HANDLER( yarunara_input_r )
// player 2
case 0x01: //quiztvqq
case 0x81:
- return input_port_read(space->machine, keynames1[state->keyb++]);
+ return input_port_read(space->machine(), keynames1[state->keyb++]);
// player 1
case 0x02: //quiztvqq
case 0x82:
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
default:
return 0xff;
@@ -766,8 +766,8 @@ static READ8_HANDLER( yarunara_input_r )
static WRITE8_HANDLER( yarunara_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ memory_set_bank(space->machine(), "bank1", data);
state->hnoridur_bank = data;
}
@@ -962,19 +962,19 @@ ADDRESS_MAP_END
static READ8_HANDLER( jantouki_soundlatch_ack_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->soundlatch_ack) ? 0x80 : 0;
}
static WRITE8_HANDLER( jantouki_soundlatch_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_ack = 1;
state->soundlatch_full = 1;
state->soundlatch_irq = 1;
state->latch = data;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static READ8_HANDLER( jantouki_blitter_busy_r )
@@ -984,8 +984,8 @@ static READ8_HANDLER( jantouki_blitter_busy_r )
static WRITE8_HANDLER( jantouki_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
- set_led_status(space->machine, 0, data & 0x10); // maybe
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
+ set_led_status(space->machine(), 0, data & 0x10); // maybe
}
static ADDRESS_MAP_START( jantouki_io_map, AS_IO, 8 )
@@ -1027,22 +1027,22 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( jantouki_soundlatch_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_ack = data;
state->soundlatch_irq = 0;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static READ8_HANDLER( jantouki_soundlatch_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_full = 0;
return state->latch;
}
static READ8_HANDLER( jantouki_soundlatch_status_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->soundlatch_full) ? 0 : 0x80;
}
@@ -1068,21 +1068,21 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjelctrn_keyboard_1_r )
{
- return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(space->machine, "FAKE") ? 0x40 : 0);
+ return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(space->machine(), "FAKE") ? 0x40 : 0);
}
static READ8_HANDLER( mjelctrn_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int dsw = (state->keyb & 0xc0) >> 6;
static const char *const dswnames[] = { "DSW0", "DSW1", "DSW3", "DSW4" };
- return input_port_read(space->machine, dswnames[dsw]);
+ return input_port_read(space->machine(), dswnames[dsw]);
}
static WRITE8_HANDLER( mjelctrn_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = 0;
}
@@ -1131,33 +1131,33 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( htengoku_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
state->keyb = 0;
}
static WRITE8_DEVICE_HANDLER( htengoku_dsw_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_DEVICE_HANDLER( htengoku_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW0");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4");
- logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine->describe_context(), state->dsw_sel);
+ dynax_state *state = device->machine().driver_data<dynax_state>();
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( htengoku_coin_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
@@ -1165,7 +1165,7 @@ static WRITE8_HANDLER( htengoku_coin_w )
// bit 0 = coin counter
// bit 1 = out counter
// bit 2 = hopper
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
state->hopper = data & 0x04;
#ifdef MAME_DEBUG
// popmessage("COINS %02x",data);
@@ -1182,14 +1182,14 @@ static WRITE8_HANDLER( htengoku_coin_w )
static READ8_HANDLER( htengoku_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
switch (state->input_sel)
{
- case 0x81: return input_port_read(space->machine, keynames1[state->keyb++]);
- case 0x82: return input_port_read(space->machine, keynames0[state->keyb++]);
+ case 0x81: return input_port_read(space->machine(), keynames1[state->keyb++]);
+ case 0x82: return input_port_read(space->machine(), keynames0[state->keyb++]);
case 0x0d: return 0xff; // unused
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -1198,13 +1198,13 @@ static READ8_HANDLER( htengoku_input_r )
static READ8_HANDLER( htengoku_coin_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "COINS");
+ case 0x00: return input_port_read(space->machine(), "COINS");
case 0x01: return 0xff; //?
- case 0x02: return 0xbf | ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
+ case 0x02: return 0xbf | ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
case 0x03: return state->coins;
}
logerror("%04x: coin_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -1213,9 +1213,9 @@ static READ8_HANDLER( htengoku_coin_r )
static WRITE8_HANDLER( htengoku_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
state->hnoridur_bank = data;
}
@@ -1276,7 +1276,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tenkai_ipsel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
case 0: state->input_sel = data;
@@ -1290,13 +1290,13 @@ static WRITE8_HANDLER( tenkai_ipsel_w )
static WRITE8_HANDLER( tenkai_ip_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x0c:
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
// bit 2?
// bit 3?
// popmessage("%02x", data);
@@ -1312,7 +1312,7 @@ static WRITE8_HANDLER( tenkai_ip_w )
static READ8_HANDLER( tenkai_ip_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
//static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -1323,7 +1323,7 @@ static READ8_HANDLER( tenkai_ip_r )
switch (state->input_sel)
{
case 0x00:
- return input_port_read(space->machine, "COINS"); // coins
+ return input_port_read(space->machine(), "COINS"); // coins
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(space->cpu), state->input_sel, offset);
@@ -1342,13 +1342,13 @@ static READ8_HANDLER( tenkai_ip_r )
case 0x81:
if (state->keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(space->cpu), state->keyb);
- return 0xff;//input_port_read(space->machine, keynames1[state->keyb++]);
+ return 0xff;//input_port_read(space->machine(), keynames1[state->keyb++]);
// player 1
case 0x82:
if (state->keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(space->cpu), state->keyb);
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(space->cpu), state->input_sel, offset);
@@ -1362,33 +1362,33 @@ static READ8_HANDLER( tenkai_ip_r )
static WRITE8_DEVICE_HANDLER( tenkai_dswsel_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_DEVICE_HANDLER( tenkai_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW0");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4");
- logerror("%s: unmapped dsw %02x read\n", device->machine->describe_context(), state->dsw_sel);
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ logerror("%s: unmapped dsw %02x read\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static READ8_HANDLER( tenkai_palette_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->palette_ram[512 * state->palbank + offset];
}
static WRITE8_HANDLER( tenkai_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int addr = 512 * state->palbank + offset;
state->palette_ram[addr] = data;
@@ -1398,14 +1398,14 @@ static WRITE8_HANDLER( tenkai_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + ((offset & 0xf) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + ((offset & 0xf) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
}
}
-static void tenkai_update_rombank( running_machine *machine )
+static void tenkai_update_rombank( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- state->romptr = machine->region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank;
+ dynax_state *state = machine.driver_data<dynax_state>();
+ state->romptr = machine.region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank;
// logerror("rombank = %02x\n", state->rombank);
}
@@ -1416,26 +1416,26 @@ static READ8_HANDLER( tenkai_p3_r )
static WRITE8_HANDLER( tenkai_p3_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = ((data & 0x04) << 1) | (state->rombank & 0x07);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static WRITE8_HANDLER( tenkai_p4_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = (state->rombank & 0x08) | ((data & 0x0e) >> 1);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static READ8_HANDLER( tenkai_p5_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->tenkai_p5_val;
}
static WRITE8_HANDLER( tenkai_p6_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_p5_val &= 0x0f;
if (data & 0x0f)
@@ -1444,7 +1444,7 @@ static WRITE8_HANDLER( tenkai_p6_w )
static WRITE8_HANDLER( tenkai_p7_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_p5_val &= 0xf0;
if (data & 0x03)
@@ -1453,9 +1453,9 @@ static WRITE8_HANDLER( tenkai_p7_w )
static WRITE8_HANDLER( tenkai_p8_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = ((data & 0x08) << 1) | (state->rombank & 0x0f);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static READ8_HANDLER( tenkai_p8_r )
@@ -1465,7 +1465,7 @@ static READ8_HANDLER( tenkai_p8_r )
static READ8_HANDLER( tenkai_8000_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->rombank < 0x10)
return state->romptr[offset];
@@ -1480,7 +1480,7 @@ static READ8_HANDLER( tenkai_8000_r )
static WRITE8_HANDLER( tenkai_8000_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if ((state->rombank == 0x10) && (offset < 0x10))
{
@@ -1496,24 +1496,24 @@ static WRITE8_HANDLER( tenkai_8000_w )
logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", cpu_get_pc(space->cpu), offset, data, state->rombank);
}
-static void tenkai_show_6c( running_machine *machine )
+static void tenkai_show_6c( running_machine &machine )
{
-// dynax_state *state = machine->driver_data<dynax_state>();
+// dynax_state *state = machine.driver_data<dynax_state>();
// popmessage("%02x %02x", state->tenkai_6c, state->tenkai_70);
}
static WRITE8_HANDLER( tenkai_6c_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_6c = data;
- tenkai_show_6c(space->machine);
+ tenkai_show_6c(space->machine());
}
static WRITE8_HANDLER( tenkai_70_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_70 = data;
- tenkai_show_6c(space->machine);
+ tenkai_show_6c(space->machine());
}
static WRITE8_HANDLER( tenkai_blit_romregion_w )
@@ -1570,30 +1570,30 @@ ADDRESS_MAP_END
static READ8_HANDLER( gekisha_keyboard_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY0");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY1");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY2");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY3");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY0");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY1");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY2");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY3");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY4");
return res;
}
static READ8_HANDLER( gekisha_keyboard_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY5");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY6");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY7");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY8");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY5");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY6");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY7");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY8");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY9");
// bit 6
- res |= input_port_read(space->machine, "BET");
+ res |= input_port_read(space->machine(), "BET");
// bit 7 = blitter busy
@@ -1602,41 +1602,41 @@ static READ8_HANDLER( gekisha_keyboard_1_r )
static WRITE8_HANDLER( gekisha_hopper_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->gekisha_val[offset] = data;
// popmessage("%02x %02x", gekisha_val[0], gekisha_val[1]);
}
-static void gekisha_set_rombank( running_machine *machine, UINT8 data )
+static void gekisha_set_rombank( running_machine &machine, UINT8 data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->rombank = data;
- state->romptr = machine->region("maincpu")->base() + 0x8000 + state->rombank * 0x8000;
+ state->romptr = machine.region("maincpu")->base() + 0x8000 + state->rombank * 0x8000;
}
static WRITE8_HANDLER( gekisha_p4_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->gekisha_rom_enable = !BIT(data, 3);
- gekisha_set_rombank(space->machine, BIT(data, 2));
+ gekisha_set_rombank(space->machine(), BIT(data, 2));
}
static READ8_HANDLER( gekisha_8000_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->gekisha_rom_enable)
return state->romptr[offset];
switch (offset + 0x8000)
{
- case 0x8061: return input_port_read(space->machine, "COINS");
+ case 0x8061: return input_port_read(space->machine(), "COINS");
case 0x8062: return gekisha_keyboard_1_r(space, 0);
case 0x8063: return gekisha_keyboard_0_r(space, 0);
- case 0x8064: return input_port_read(space->machine, "DSW1");
- case 0x8065: return input_port_read(space->machine, "DSW3");
- case 0x8066: return input_port_read(space->machine, "DSW4");
- case 0x8067: return input_port_read(space->machine, "DSW2");
+ case 0x8064: return input_port_read(space->machine(), "DSW1");
+ case 0x8065: return input_port_read(space->machine(), "DSW3");
+ case 0x8066: return input_port_read(space->machine(), "DSW4");
+ case 0x8067: return input_port_read(space->machine(), "DSW2");
}
logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(space->cpu), offset, state->rombank);
@@ -1645,7 +1645,7 @@ static READ8_HANDLER( gekisha_8000_r )
static WRITE8_HANDLER( gekisha_8000_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (!state->gekisha_rom_enable)
{
@@ -4203,12 +4203,12 @@ INPUT_PORTS_END
static MACHINE_START( dynax )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->rtc = machine->device("rtc");
- state->ymsnd = machine->device("ymsnd");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->rtc = machine.device("rtc");
+ state->ymsnd = machine.device("ymsnd");
state->save_item(NAME(state->sound_irq));
state->save_item(NAME(state->vblank_irq));
@@ -4243,9 +4243,9 @@ static MACHINE_START( dynax )
static MACHINE_RESET( dynax )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- if (machine->device("msm") != NULL)
+ if (machine.device("msm") != NULL)
MACHINE_RESET_CALL(adpcm);
state->sound_irq = 0;
@@ -4283,7 +4283,7 @@ static MACHINE_RESET( dynax )
static MACHINE_START( hanamai )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x8000], 0x8000);
MACHINE_START_CALL(dynax);
@@ -4291,8 +4291,8 @@ static MACHINE_START( hanamai )
static MACHINE_START( hnoridur )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int bank_n = (machine->region("maincpu")->bytes() - 0x10000) / 0x8000;
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int bank_n = (machine.region("maincpu")->bytes() - 0x10000) / 0x8000;
memory_configure_bank(machine, "bank1", 0, bank_n, &ROM[0x10000], 0x8000);
@@ -4301,7 +4301,7 @@ static MACHINE_START( hnoridur )
static MACHINE_START( htengoku )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
@@ -4596,7 +4596,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( yarunara_clock_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->yarunara_clk_toggle ^= 1;
if (state->yarunara_clk_toggle == 1)
@@ -4604,7 +4604,7 @@ static INTERRUPT_GEN( yarunara_clock_interrupt )
else
state->sound_irq = 1;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
static MACHINE_CONFIG_DERIVED( yarunara, hnoridur )
@@ -4674,15 +4674,15 @@ static const msm5205_interface jantouki_msm5205_interface =
static MACHINE_START( jantouki )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SOUND = machine->region("soundcpu")->base();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SOUND = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &MAIN[0x8000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 12, &SOUND[0x8000], 0x8000);
- state->top_scr = machine->device("top");
- state->bot_scr = machine->device("bottom");
+ state->top_scr = machine.device("top");
+ state->bot_scr = machine.device("bottom");
MACHINE_START_CALL(dynax);
}
@@ -4757,16 +4757,16 @@ MACHINE_CONFIG_END
/* It runs in IM 2, thus needs a vector on the data bus:
0xfa and 0xfc are very similar, they should be triggered by the blitter
0xf8 is vblank */
-void mjelctrn_update_irq( running_machine *machine )
+void mjelctrn_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->blitter_irq = 1;
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0xfa);
}
static INTERRUPT_GEN( mjelctrn_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4792,16 +4792,16 @@ MACHINE_CONFIG_END
0x42 and 0x44 are very similar, they should be triggered by the blitter
0x40 is vblank
0x46 is a periodic irq? */
-void neruton_update_irq( running_machine *machine )
+void neruton_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->blitter_irq = 1;
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0x42);
}
static INTERRUPT_GEN( neruton_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4830,7 +4830,7 @@ MACHINE_CONFIG_END
0x40 is vblank */
static INTERRUPT_GEN( majxtal7_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4934,7 +4934,7 @@ static MACHINE_START( tenkai )
{
MACHINE_START_CALL(dynax);
- machine->state().register_postload(tenkai_bank_postload, NULL);
+ machine.state().register_postload(tenkai_bank_postload, NULL);
}
static MACHINE_CONFIG_START( tenkai, dynax_state )
@@ -4988,7 +4988,7 @@ MACHINE_CONFIG_END
static STATE_POSTLOAD( gekisha_bank_postload )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
gekisha_set_rombank(machine, state->rombank);
}
@@ -4997,7 +4997,7 @@ static MACHINE_START( gekisha )
{
MACHINE_START_CALL(dynax);
- machine->state().register_postload(gekisha_bank_postload, NULL);
+ machine.state().register_postload(gekisha_bank_postload, NULL);
}
static MACHINE_RESET( gekisha )
@@ -5386,7 +5386,7 @@ ROM_END
static DRIVER_INIT( blktouch )
{
// fearsome encryption ;-)
- UINT8 *src = (UINT8 *)machine->region("maincpu")->base();
+ UINT8 *src = (UINT8 *)machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x90000; i++)
@@ -5395,7 +5395,7 @@ static DRIVER_INIT( blktouch )
}
- src = (UINT8 *)machine->region("gfx1")->base();
+ src = (UINT8 *)machine.region("gfx1")->base();
for (i = 0; i < 0xc0000; i++)
{
@@ -5408,8 +5408,8 @@ static DRIVER_INIT( maya )
{
/* Address lines scrambling on 1 z80 rom */
int i;
- UINT8 *gfx = (UINT8 *)machine->region("gfx1")->base();
- UINT8 *rom = machine->region("maincpu")->base() + 0x28000, *end = rom + 0x10000;
+ UINT8 *gfx = (UINT8 *)machine.region("gfx1")->base();
+ UINT8 *rom = machine.region("maincpu")->base() + 0x28000, *end = rom + 0x10000;
for ( ; rom < end; rom += 8)
{
UINT8 temp[8];
@@ -6126,8 +6126,8 @@ ROM_END
static DRIVER_INIT( mjelct3 )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
@@ -6139,8 +6139,8 @@ static DRIVER_INIT( mjelct3 )
static DRIVER_INIT( mjelct3a )
{
int i, j;
- UINT8 *rom = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
@@ -6517,7 +6517,7 @@ ROM_END
static DRIVER_INIT( mjreach )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x10060, 0x10060, FUNC(yarunara_flipscreen_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x10060, 0x10060, FUNC(yarunara_flipscreen_w));
}
/***************************************************************************
diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c
index 4fa71048c98..a7c84cc0886 100644
--- a/src/mame/drivers/egghunt.c
+++ b/src/mame/drivers/egghunt.c
@@ -69,9 +69,9 @@ public:
};
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
int flipscreen = 0;
int offs, sx, sy;
@@ -100,7 +100,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
sx = 496 - sx;
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipscreen,flipscreen,
@@ -110,7 +110,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
static TILE_GET_INFO( get_bg_tile_info )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
int code = ((state->bgram[tile_index * 2 + 1] << 8) | state->bgram[tile_index * 2]) & 0x3fff;
int colour = state->atram[tile_index] & 0x3f;
@@ -129,7 +129,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static READ8_HANDLER( egghunt_bgram_r )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
if (state->vidram_bank)
{
return state->spram[offset];
@@ -142,7 +142,7 @@ static READ8_HANDLER( egghunt_bgram_r )
static WRITE8_HANDLER( egghunt_bgram_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
if (state->vidram_bank)
{
state->spram[offset] = data;
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( egghunt_bgram_w )
static WRITE8_HANDLER( egghunt_atram_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
state->atram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -164,7 +164,7 @@ static WRITE8_HANDLER( egghunt_atram_w )
static VIDEO_START(egghunt)
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -174,15 +174,15 @@ static VIDEO_START(egghunt)
static SCREEN_UPDATE(egghunt)
{
- egghunt_state *state = screen->machine->driver_data<egghunt_state>();
+ egghunt_state *state = screen->machine().driver_data<egghunt_state>();
tilemap_draw(bitmap,cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE8_HANDLER( egghunt_gfx_banking_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
// data & 0x03 is used for tile banking
// data & 0x30 is used for sprites banking
state->gfx_banking = data & 0x33;
@@ -192,26 +192,26 @@ static WRITE8_HANDLER( egghunt_gfx_banking_w )
static WRITE8_HANDLER( egghunt_vidram_bank_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
state->vidram_bank = data & 1;
}
static WRITE8_HANDLER( egghunt_soundlatch_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static READ8_DEVICE_HANDLER( egghunt_okibanking_r )
{
- egghunt_state *state = device->machine->driver_data<egghunt_state>();
+ egghunt_state *state = device->machine().driver_data<egghunt_state>();
return state->okibanking;
}
static WRITE8_DEVICE_HANDLER( egghunt_okibanking_w )
{
- egghunt_state *state = device->machine->driver_data<egghunt_state>();
+ egghunt_state *state = device->machine().driver_data<egghunt_state>();
state->okibanking = data;
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
@@ -388,9 +388,9 @@ GFXDECODE_END
static MACHINE_START( egghunt )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->gfx_banking));
state->save_item(NAME(state->okibanking));
@@ -399,7 +399,7 @@ static MACHINE_START( egghunt )
static MACHINE_RESET( egghunt )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
state->gfx_banking = 0;
state->okibanking = 0;
state->vidram_bank = 0;
diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c
index 150a3028b08..dbf643c1443 100644
--- a/src/mame/drivers/embargo.c
+++ b/src/mame/drivers/embargo.c
@@ -33,7 +33,7 @@ public:
static SCREEN_UPDATE( embargo )
{
- embargo_state *state = screen->machine->driver_data<embargo_state>();
+ embargo_state *state = screen->machine().driver_data<embargo_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -67,14 +67,14 @@ static SCREEN_UPDATE( embargo )
static READ8_HANDLER( input_port_bit_r )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
- return (input_port_read(space->machine, "IN1") << (7 - state->input_select)) & 0x80;
+ embargo_state *state = space->machine().driver_data<embargo_state>();
+ return (input_port_read(space->machine(), "IN1") << (7 - state->input_select)) & 0x80;
}
static READ8_HANDLER( dial_r )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
UINT8 lo = 0;
UINT8 hi = 0;
@@ -94,14 +94,14 @@ static READ8_HANDLER( dial_r )
if (state->dial_enable_1 && !state->dial_enable_2)
{
- lo = input_port_read(space->machine, "DIAL0");
- hi = input_port_read(space->machine, "DIAL1");
+ lo = input_port_read(space->machine(), "DIAL0");
+ hi = input_port_read(space->machine(), "DIAL1");
}
if (state->dial_enable_2 && !state->dial_enable_1)
{
- lo = input_port_read(space->machine, "DIAL2");
- hi = input_port_read(space->machine, "DIAL3");
+ lo = input_port_read(space->machine(), "DIAL2");
+ hi = input_port_read(space->machine(), "DIAL3");
}
lo = 12 * lo / 256;
@@ -126,21 +126,21 @@ static READ8_HANDLER( dial_r )
static WRITE8_HANDLER( port_1_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->dial_enable_1 = data & 0x01; /* other bits unknown */
}
static WRITE8_HANDLER( port_2_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->dial_enable_2 = data & 0x01; /* other bits unknown */
}
static WRITE8_HANDLER( input_select_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->input_select = data & 0x07;
}
@@ -228,7 +228,7 @@ INPUT_PORTS_END
static MACHINE_START( embargo )
{
- embargo_state *state = machine->driver_data<embargo_state>();
+ embargo_state *state = machine.driver_data<embargo_state>();
/* register for state saving */
state->save_item(NAME(state->dial_enable_1));
@@ -239,7 +239,7 @@ static MACHINE_START( embargo )
static MACHINE_RESET( embargo )
{
- embargo_state *state = machine->driver_data<embargo_state>();
+ embargo_state *state = machine.driver_data<embargo_state>();
state->dial_enable_1 = 0;
state->dial_enable_2 = 0;
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 4fdccf151f6..52d4e40f777 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -103,19 +103,19 @@ INLINE int vysnc_chain_counter_to_vpos( UINT16 counter )
static TIMER_CALLBACK( interrupt_clear_callback )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
static TIMER_CALLBACK( interrupt_assert_callback )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
UINT16 next_counter;
int next_vpos;
/* compute vector and set the interrupt line */
- int vpos = machine->primary_screen->vpos();
+ int vpos = machine.primary_screen->vpos();
UINT16 counter = vpos_to_vysnc_chain_counter(vpos);
UINT8 vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4);
device_set_input_line_and_vector(state->maincpu, 0, ASSERT_LINE, vector);
@@ -127,35 +127,35 @@ static TIMER_CALLBACK( interrupt_assert_callback )
next_counter = INT_TRIGGER_COUNT_1;
next_vpos = vysnc_chain_counter_to_vpos(next_counter);
- state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(next_vpos));
- state->interrupt_clear_timer->adjust(machine->primary_screen->time_until_pos(vpos + 1));
+ state->interrupt_assert_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
+ state->interrupt_clear_timer->adjust(machine.primary_screen->time_until_pos(vpos + 1));
}
-static void create_interrupt_timers( running_machine *machine )
+static void create_interrupt_timers( running_machine &machine )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
- state->interrupt_clear_timer = machine->scheduler().timer_alloc(FUNC(interrupt_clear_callback));
- state->interrupt_assert_timer = machine->scheduler().timer_alloc(FUNC(interrupt_assert_callback));
+ enigma2_state *state = machine.driver_data<enigma2_state>();
+ state->interrupt_clear_timer = machine.scheduler().timer_alloc(FUNC(interrupt_clear_callback));
+ state->interrupt_assert_timer = machine.scheduler().timer_alloc(FUNC(interrupt_assert_callback));
}
-static void start_interrupt_timers( running_machine *machine )
+static void start_interrupt_timers( running_machine &machine )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1);
- state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->interrupt_assert_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
static MACHINE_START( enigma2 )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
create_interrupt_timers(machine);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->blink_count));
state->save_item(NAME(state->sound_latch));
@@ -167,7 +167,7 @@ static MACHINE_START( enigma2 )
static MACHINE_RESET( enigma2 )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
state->last_sound_data = 0;
@@ -199,11 +199,11 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( enigma2 )
{
- enigma2_state *state = screen->machine->driver_data<enigma2_state>();
+ enigma2_state *state = screen->machine().driver_data<enigma2_state>();
pen_t pens[NUM_PENS];
const rectangle &visarea = screen->visible_area();
- UINT8 *prom = screen->machine->region("proms")->base();
+ UINT8 *prom = screen->machine().region("proms")->base();
UINT8 *color_map_base = state->flip_screen ? &prom[0x0400] : &prom[0x0000];
UINT8 *star_map_base = (state->blink_count & 0x08) ? &prom[0x0c00] : &prom[0x0800];
@@ -227,7 +227,7 @@ static SCREEN_UPDATE( enigma2 )
offs_t color_map_address = (y >> 3 << 5) | (x >> 3);
/* the schematics shows it like this, but it doesn't work as this would
produce no stars, due to the contents of the PROM -- maybe there is
- a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine) */
+ a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine()) */
/* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */
offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3);
@@ -287,7 +287,7 @@ static SCREEN_UPDATE( enigma2 )
static SCREEN_UPDATE( enigma2a )
{
- enigma2_state *state = screen->machine->driver_data<enigma2_state>();
+ enigma2_state *state = screen->machine().driver_data<enigma2_state>();
UINT8 x = 0;
const rectangle &visarea = screen->visible_area();
UINT16 bitmap_y = visarea.min_y;
@@ -349,7 +349,7 @@ static SCREEN_UPDATE( enigma2a )
static READ8_HANDLER( dip_switch_r )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
UINT8 ret = 0x00;
if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, cpu_get_pc(space->cpu), state->protection_data);
@@ -361,7 +361,7 @@ static READ8_HANDLER( dip_switch_r )
if (state->protection_data != 0xff)
ret = state->protection_data ^ 0x88;
else
- ret = input_port_read(space->machine, "DSW");
+ ret = input_port_read(space->machine(), "DSW");
break;
case 0x02:
@@ -382,7 +382,7 @@ static READ8_HANDLER( dip_switch_r )
static WRITE8_HANDLER( sound_data_w )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
/* clock sound latch shift register on rising edge of D2 */
if (!(data & 0x04) && (state->last_sound_data & 0x04))
state->sound_latch = (state->sound_latch << 1) | (~data & 0x01);
@@ -395,39 +395,39 @@ static WRITE8_HANDLER( sound_data_w )
static READ8_DEVICE_HANDLER( sound_latch_r )
{
- enigma2_state *state = device->machine->driver_data<enigma2_state>();
+ enigma2_state *state = device->machine().driver_data<enigma2_state>();
return BITSWAP8(state->sound_latch,0,1,2,3,4,5,6,7);
}
static WRITE8_DEVICE_HANDLER( protection_data_w )
{
- enigma2_state *state = device->machine->driver_data<enigma2_state>();
- if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", device->machine->describe_context(), data);
+ enigma2_state *state = device->machine().driver_data<enigma2_state>();
+ if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", device->machine().describe_context(), data);
state->protection_data = data;
}
static WRITE8_HANDLER( enigma2_flip_screen_w )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
- state->flip_screen = ((data >> 5) & 0x01) && ((input_port_read(space->machine, "DSW") & 0x20) == 0x20);
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
+ state->flip_screen = ((data >> 5) & 0x01) && ((input_port_read(space->machine(), "DSW") & 0x20) == 0x20);
}
static CUSTOM_INPUT( p1_controls_r )
{
- return input_port_read(field->port->machine, "P1CONTROLS");
+ return input_port_read(field->port->machine(), "P1CONTROLS");
}
static CUSTOM_INPUT( p2_controls_r )
{
- enigma2_state *state = field->port->machine->driver_data<enigma2_state>();
+ enigma2_state *state = field->port->machine().driver_data<enigma2_state>();
if (state->flip_screen)
- return input_port_read(field->port->machine, "P2CONTROLS");
+ return input_port_read(field->port->machine(), "P2CONTROLS");
else
- return input_port_read(field->port->machine, "P1CONTROLS");
+ return input_port_read(field->port->machine(), "P1CONTROLS");
}
@@ -708,7 +708,7 @@ ROM_END
static DRIVER_INIT(enigma2)
{
offs_t i;
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
for(i = 0; i < 0x2000; i++)
{
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 0fc2c970b48..37797088550 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -86,17 +86,17 @@ static READ32_HANDLER( eolith_custom_r )
*/
eolith_speedup_read(space);
- return (input_port_read(space->machine, "IN0") & ~0x300) | (space->machine->rand() & 0x300);
+ return (input_port_read(space->machine(), "IN0") & ~0x300) | (space->machine().rand() & 0x300);
}
static WRITE32_HANDLER( systemcontrol_w )
{
- eolith_state *state = space->machine->driver_data<eolith_state>();
+ eolith_state *state = space->machine().driver_data<eolith_state>();
state->buffer = (data & 0x80) >> 7;
- coin_counter_w(space->machine, 0, data & state->coin_counter_bit);
- set_led_status(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & state->coin_counter_bit);
+ set_led_status(space->machine(), 0, data & 1);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
// bit 0x100 and 0x040 ?
}
@@ -104,8 +104,8 @@ static WRITE32_HANDLER( systemcontrol_w )
static READ32_HANDLER( hidctch3_pen1_r )
{
//320 x 240
- int xpos = input_port_read(space->machine, "PEN_X_P1");
- int ypos = input_port_read(space->machine, "PEN_Y_P1");
+ int xpos = input_port_read(space->machine(), "PEN_X_P1");
+ int ypos = input_port_read(space->machine(), "PEN_Y_P1");
return xpos + (ypos*168*2);
}
@@ -113,8 +113,8 @@ static READ32_HANDLER( hidctch3_pen1_r )
static READ32_HANDLER( hidctch3_pen2_r )
{
//320 x 240
- int xpos = input_port_read(space->machine, "PEN_X_P2");
- int ypos = input_port_read(space->machine, "PEN_Y_P2");
+ int xpos = input_port_read(space->machine(), "PEN_X_P2");
+ int ypos = input_port_read(space->machine(), "PEN_Y_P2");
return xpos + (ypos*168*2);
}
@@ -1110,18 +1110,18 @@ static DRIVER_INIT( eolith )
static DRIVER_INIT( landbrk )
{
- eolith_state *state = machine->driver_data<eolith_state>();
+ eolith_state *state = machine.driver_data<eolith_state>();
state->coin_counter_bit = 0x1000;
init_eolith_speedup(machine);
}
static DRIVER_INIT( landbrka )
{
- eolith_state *state = machine->driver_data<eolith_state>();
+ eolith_state *state = machine.driver_data<eolith_state>();
//it fails compares with memories:
//$4002d338 -> $4002d348 .... $4002d33f -> $4002d34f
//related with bits 0x100 - 0x200 read at startup from input(0) ?
- UINT32 *rombase = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
rombase[0x14f00/4] = (rombase[0x14f00/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
state->coin_counter_bit = 0x2000;
@@ -1131,22 +1131,22 @@ static DRIVER_INIT( landbrka )
static DRIVER_INIT( hidctch2 )
{
//it fails compares in memory like in landbrka
- UINT32 *rombase = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
rombase[0xbcc8/4] = (rombase[0xbcc8/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
init_eolith_speedup(machine);
}
static DRIVER_INIT( hidctch3 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfc200000, 0xfc200003); // this generates pens vibration
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfc200000, 0xfc200003); // this generates pens vibration
// It is not clear why the first reads are needed too
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
init_eolith_speedup(machine);
}
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 53d93e2b3c1..d41faca74c0 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -43,11 +43,11 @@ static const eeprom_interface eeprom_interface_93C66 =
static WRITE16_HANDLER( eeprom_w )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
state->vbuffer = (data & 0x80) >> 7;
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
//data & 0x100 and data & 0x004 always set
}
@@ -55,20 +55,20 @@ static WRITE16_HANDLER( eeprom_w )
static READ16_HANDLER( eolith16_custom_r )
{
eolith_speedup_read(space);
- return input_port_read(space->machine, "SPECIAL");
+ return input_port_read(space->machine(), "SPECIAL");
}
static WRITE16_HANDLER( vram_w )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
COMBINE_DATA(&state->vram[offset + (0x10000/2) * state->vbuffer]);
}
static READ16_HANDLER( vram_r )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
return state->vram[offset + (0x10000/2) * state->vbuffer];
}
@@ -118,13 +118,13 @@ INPUT_PORTS_END
static VIDEO_START( eolith16 )
{
- eolith16_state *state = machine->driver_data<eolith16_state>();
+ eolith16_state *state = machine.driver_data<eolith16_state>();
state->vram = auto_alloc_array(machine, UINT16, 0x10000);
}
static SCREEN_UPDATE( eolith16 )
{
- eolith16_state *state = screen->machine->driver_data<eolith16_state>();
+ eolith16_state *state = screen->machine().driver_data<eolith16_state>();
int x,y,count;
int color;
diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c
index 0c2ddc3a5d0..73dcd3d46e1 100644
--- a/src/mame/drivers/eolithsp.c
+++ b/src/mame/drivers/eolithsp.c
@@ -21,7 +21,7 @@ void eolith_speedup_read(address_space *space)
{
/* for debug */
//if ((cpu_get_pc(space->cpu)!=eolith_speedup_address) && (eolith_vblank!=1) )
- // printf("%s:eolith speedup_read data %02x\n",space->machine->describe_context(), eolith_vblank);
+ // printf("%s:eolith speedup_read data %02x\n",space->machine().describe_context(), eolith_vblank);
if (cpu_get_pc(space->cpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline)
{
@@ -60,7 +60,7 @@ static const struct
};
-void init_eolith_speedup(running_machine *machine)
+void init_eolith_speedup(running_machine &machine)
{
int n_game = 0;
eolith_speedup_address = 0;
@@ -68,7 +68,7 @@ void init_eolith_speedup(running_machine *machine)
while( eolith_speedup_table[ n_game ].s_name != NULL )
{
- if( strcmp( machine->system().name, eolith_speedup_table[ n_game ].s_name ) == 0 )
+ if( strcmp( machine.system().name, eolith_speedup_table[ n_game ].s_name ) == 0 )
{
eolith_speedup_address = eolith_speedup_table[ n_game ].speedup_address;
eolith_speedup_resume_scanline = eolith_speedup_table[ n_game ].speedup_resume_scanline;
@@ -90,7 +90,7 @@ INTERRUPT_GEN( eolith_speedup )
if (eolith_scanline==eolith_speedup_resume_scanline)
{
- device->machine->scheduler().trigger(1000);
+ device->machine().scheduler().trigger(1000);
}
if (eolith_scanline==240)
diff --git a/src/mame/drivers/epos.c b/src/mame/drivers/epos.c
index e9f4780391b..19bc3558d4e 100644
--- a/src/mame/drivers/epos.c
+++ b/src/mame/drivers/epos.c
@@ -36,7 +36,7 @@
static WRITE8_HANDLER( dealer_decrypt_rom )
{
- epos_state *state = space->machine->driver_data<epos_state>();
+ epos_state *state = space->machine().driver_data<epos_state>();
if (offset & 0x04)
state->counter = (state->counter + 1) & 0x03;
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( dealer_decrypt_rom )
// logerror("PC %08x: ctr=%04x\n",cpu_get_pc(space->cpu), state->counter);
- memory_set_bank(space->machine, "bank1", state->counter);
+ memory_set_bank(space->machine(), "bank1", state->counter);
// is the 2nd bank changed by the counter or it always uses the 1st key?
}
@@ -102,7 +102,7 @@ ADDRESS_MAP_END
*/
static WRITE8_DEVICE_HANDLER( write_prtc )
{
- memory_set_bank(device->machine, "bank2", data & 0x01);
+ memory_set_bank(device->machine(), "bank2", data & 0x01);
}
static const ppi8255_interface ppi8255_intf =
@@ -365,7 +365,7 @@ INPUT_PORTS_END
static MACHINE_START( epos )
{
- epos_state *state = machine->driver_data<epos_state>();
+ epos_state *state = machine.driver_data<epos_state>();
state->save_item(NAME(state->palette));
state->save_item(NAME(state->counter));
@@ -373,7 +373,7 @@ static MACHINE_START( epos )
static MACHINE_RESET( epos )
{
- epos_state *state = machine->driver_data<epos_state>();
+ epos_state *state = machine.driver_data<epos_state>();
state->palette = 0;
state->counter = 0;
@@ -382,7 +382,7 @@ static MACHINE_RESET( epos )
static MACHINE_START( dealer )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x0000], 0x10000);
memory_configure_bank(machine, "bank2", 0, 2, &ROM[0x6000], 0x1000);
@@ -610,7 +610,7 @@ ROM_END
static DRIVER_INIT( dealer )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
/* Key 0 */
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index 0724d9c628e..3641f8400ee 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -36,13 +36,13 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
- if (machine->device("extra") != NULL)
+ if (machine.device("extra") != NULL)
cputag_set_input_line(machine, "extra", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -57,11 +57,11 @@ static MACHINE_START( eprom )
static MACHINE_RESET( eprom )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, eprom_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, eprom_scanline_update, 8);
atarijsa_reset();
}
@@ -75,8 +75,8 @@ static MACHINE_RESET( eprom )
static READ16_HANDLER( special_port1_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
- int result = input_port_read(space->machine, "260010");
+ eprom_state *state = space->machine().driver_data<eprom_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->sound_to_cpu_ready) result ^= 0x0004;
if (state->cpu_to_sound_ready) result ^= 0x0008;
@@ -88,9 +88,9 @@ static READ16_HANDLER( special_port1_r )
static READ16_HANDLER( adc_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- int result = input_port_read(space->machine, adcnames[state->last_offset & 3]);
+ int result = input_port_read(space->machine(), adcnames[state->last_offset & 3]);
state->last_offset = offset;
return result;
@@ -106,15 +106,15 @@ static READ16_HANDLER( adc_r )
static WRITE16_HANDLER( eprom_latch_w )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
- if (ACCESSING_BITS_0_7 && (space->machine->device("extra") != NULL))
+ if (ACCESSING_BITS_0_7 && (space->machine().device("extra") != NULL))
{
/* bit 0: reset extra CPU */
if (data & 1)
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, ASSERT_LINE);
/* bits 1-4: screen intensity */
state->screen_intensity = (data & 0x1e) >> 1;
@@ -134,14 +134,14 @@ static WRITE16_HANDLER( eprom_latch_w )
static READ16_HANDLER( sync_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
return state->sync_data[offset];
}
static WRITE16_HANDLER( sync_w )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
int oldword = state->sync_data[offset];
int newword = oldword;
COMBINE_DATA(&newword);
@@ -725,13 +725,13 @@ ROM_END
static DRIVER_INIT( eprom )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
atarijsa_init(machine, "260010", 0x0002);
/* install CPU synchronization handlers */
- state->sync_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
- state->sync_data = machine->device("extra")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
+ state->sync_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
+ state->sync_data = machine.device("extra")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
}
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 4c35836572d..67a7b82e469 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -398,13 +398,13 @@ D
static TIMER_CALLBACK( equites_nmi_callback )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
device_set_input_line(state->audio_cpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static TIMER_CALLBACK( equites_frq_adjuster_callback )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
msm5232_set_clock(state->msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
@@ -418,16 +418,16 @@ static TIMER_CALLBACK( equites_frq_adjuster_callback )
static SOUND_START(equites)
{
- equites_state *state = machine->driver_data<equites_state>();
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(equites_nmi_callback));
+ equites_state *state = machine.driver_data<equites_state>();
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(equites_nmi_callback));
- state->adjuster_timer = machine->scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback));
+ state->adjuster_timer = machine.scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback));
state->adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}
static WRITE8_HANDLER(equites_c0f8_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
switch (offset)
{
@@ -476,7 +476,7 @@ static WRITE8_HANDLER(equites_c0f8_w)
static WRITE8_DEVICE_HANDLER( equites_8910porta_w )
{
- equites_state *state = device->machine->driver_data<equites_state>();
+ equites_state *state = device->machine().driver_data<equites_state>();
// bongo 1
sample_set_volume(device, 0, ((data & 0x30) >> 4) * 0.33);
@@ -497,7 +497,7 @@ popmessage("HH %d(%d) CYM %d(%d)", state->hihat, BIT(state->ay_port_b, 6), state
static WRITE8_DEVICE_HANDLER( equites_8910portb_w )
{
- equites_state *state = device->machine->driver_data<equites_state>();
+ equites_state *state = device->machine().driver_data<equites_state>();
#if POPDRUMKIT
if (data & ~state->ay_port_b & 0x08) state->cymbal++;
if (data & ~state->ay_port_b & 0x04) state->hihat++;
@@ -533,14 +533,14 @@ popmessage("HH %d(%d) CYM %d(%d)",state->hihat,BIT(state->ay_port_b,6),state->cy
static WRITE8_HANDLER(equites_cymbal_ctrl_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->eq_cymbal_ctrl++;
}
-static void equites_update_dac( running_machine *machine )
+static void equites_update_dac( running_machine &machine )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
// there is only one latch, which is used to drive two DAC channels.
// When the channel is enabled in the 4066, it goes to a series of
@@ -557,16 +557,16 @@ static void equites_update_dac( running_machine *machine )
static WRITE8_HANDLER( equites_dac_latch_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->dac_latch = data << 2;
- equites_update_dac(space->machine);
+ equites_update_dac(space->machine());
}
static WRITE8_HANDLER( equites_8155_portb_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->eq8155_port_b = data;
- equites_update_dac(space->machine);
+ equites_update_dac(space->machine());
}
static void equites_msm5232_gate( device_t *device, int state )
@@ -590,7 +590,7 @@ static INTERRUPT_GEN( equites_interrupt )
static WRITE8_HANDLER(equites_8155_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
// FIXME proper 8155 emulation must be implemented
switch( offset )
@@ -637,26 +637,26 @@ static WRITE8_HANDLER(equites_8155_w)
#if HVOLTAGE_DEBUG
static READ16_HANDLER(hvoltage_debug_r)
{
- return(input_port_read(space->machine, "FAKE"));
+ return(input_port_read(space->machine(), "FAKE"));
}
#endif
static CUSTOM_INPUT( gekisou_unknown_status )
{
- equites_state *state = field->port->machine->driver_data<equites_state>();
+ equites_state *state = field->port->machine().driver_data<equites_state>();
return state->unknown_bit;
}
static WRITE16_HANDLER( gekisou_unknown_0_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->unknown_bit = 0;
}
static WRITE16_HANDLER( gekisou_unknown_1_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->unknown_bit = 1;
}
@@ -666,7 +666,7 @@ static WRITE16_HANDLER( gekisou_unknown_1_w )
static READ16_HANDLER(equites_spriteram_kludge_r)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (state->spriteram[0] == 0x5555)
return 0;
else
@@ -675,26 +675,26 @@ static READ16_HANDLER(equites_spriteram_kludge_r)
static READ16_HANDLER(mcu_r)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
return 0xff00 | state->mcu_ram[offset];
}
static WRITE16_HANDLER(mcu_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_0_7)
state->mcu_ram[offset] = data & 0xff;
}
static WRITE16_HANDLER( mcu_halt_assert_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
device_set_input_line(state->mcu, INPUT_LINE_HALT, ASSERT_LINE);
}
static WRITE16_HANDLER( mcu_halt_clear_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
device_set_input_line(state->mcu, INPUT_LINE_HALT, CLEAR_LINE);
}
@@ -1189,13 +1189,13 @@ MACHINE_CONFIG_END
static MACHINE_START( equites )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
- state->mcu = machine->device("mcu");
- state->audio_cpu = machine->device("audiocpu");
- state->msm = machine->device<msm5232_device>("msm");
- state->dac_1 = machine->device("dac1");
- state->dac_2 = machine->device("dac2");
+ state->mcu = machine.device("mcu");
+ state->audio_cpu = machine.device("audiocpu");
+ state->msm = machine.device<msm5232_device>("msm");
+ state->dac_1 = machine.device("dac1");
+ state->dac_2 = machine.device("dac2");
state->save_item(NAME(state->fg_char_bank));
state->save_item(NAME(state->bgcolor));
@@ -1221,7 +1221,7 @@ static MACHINE_START( equites )
static MACHINE_RESET( equites )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
flip_screen_set(machine, 0);
@@ -1856,9 +1856,9 @@ ROM_END
/******************************************************************************/
// Initializations
-static void unpack_block( running_machine *machine, const char *region, int offset, int size )
+static void unpack_block( running_machine &machine, const char *region, int offset, int size )
{
- UINT8 *rom = machine->region(region)->base();
+ UINT8 *rom = machine.region(region)->base();
int i;
for (i = 0; i < size; ++i)
@@ -1868,7 +1868,7 @@ static void unpack_block( running_machine *machine, const char *region, int offs
}
}
-static void unpack_region( running_machine *machine, const char *region )
+static void unpack_region( running_machine &machine, const char *region )
{
unpack_block(machine, region, 0x0000, 0x2000);
unpack_block(machine, region, 0x4000, 0x2000);
@@ -1899,8 +1899,8 @@ static DRIVER_INIT( gekisou )
unpack_region(machine, "gfx3");
// install special handlers for unknown device (protection?)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x580000, 0x580001, FUNC(gekisou_unknown_0_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5a0000, 0x5a0001, FUNC(gekisou_unknown_1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x580000, 0x580001, FUNC(gekisou_unknown_0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5a0000, 0x5a0001, FUNC(gekisou_unknown_1_w));
}
static DRIVER_INIT( splndrbt )
@@ -1913,7 +1913,7 @@ static DRIVER_INIT( hvoltage )
unpack_region(machine, "gfx3");
#if HVOLTAGE_DEBUG
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000038, 0x000039, FUNC(hvoltage_debug_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000038, 0x000039, FUNC(hvoltage_debug_r));
#endif
}
diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c
index f8e1302be5b..21c7c93e5a5 100644
--- a/src/mame/drivers/ertictac.c
+++ b/src/mame/drivers/ertictac.c
@@ -41,11 +41,11 @@ static READ32_HANDLER( ertictac_podule_r )
switch(offset)
{
- case 0x04/4: return input_port_read(space->machine, "DSW1") & 0xff;
- case 0x08/4: return input_port_read(space->machine, "DSW2") & 0xff;
- case 0x10/4: return input_port_read(space->machine, "SYSTEM") & 0xff;
- case 0x14/4: return input_port_read(space->machine, "P2") & 0xff;
- case 0x18/4: return input_port_read(space->machine, "P1") & 0xff;
+ case 0x04/4: return input_port_read(space->machine(), "DSW1") & 0xff;
+ case 0x08/4: return input_port_read(space->machine(), "DSW2") & 0xff;
+ case 0x10/4: return input_port_read(space->machine(), "SYSTEM") & 0xff;
+ case 0x14/4: return input_port_read(space->machine(), "P2") & 0xff;
+ case 0x18/4: return input_port_read(space->machine(), "P1") & 0xff;
}
return 0;
@@ -194,7 +194,7 @@ static MACHINE_START( ertictac )
archimedes_init(machine);
// reset the DAC to centerline
- //dac_signed_data_w(machine->device("dac"), 0x80);
+ //dac_signed_data_w(machine.device("dac"), 0x80);
}
static MACHINE_RESET( ertictac )
@@ -204,7 +204,7 @@ static MACHINE_RESET( ertictac )
static INTERRUPT_GEN( ertictac_podule_irq )
{
- archimedes_request_irq_b(device->machine, ARCHIMEDES_IRQB_PODULE_IRQ);
+ archimedes_request_irq_b(device->machine(), ARCHIMEDES_IRQB_PODULE_IRQ);
}
/* TODO: Are we sure that this HW have I2C device? */
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index b580ac0638c..be03aac60b6 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -61,13 +61,13 @@ Head Panic
static WRITE16_HANDLER( esd16_spriteram_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
COMBINE_DATA(&state->spriteram[offset]);
}
static WRITE16_HANDLER( esd16_sound_command_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
@@ -106,7 +106,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER(hedpanic_platform_w)
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
int offsets = state->headpanic_platform_x[0] + 0x40 * state->headpanic_platform_y[0];
state->vram_1[offsets] = data;
@@ -116,7 +116,7 @@ static WRITE16_HANDLER(hedpanic_platform_w)
static READ16_HANDLER( esd_eeprom_r )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_8_15)
{
return ((eeprom_read_bit(state->eeprom) & 0x01) << 15);
@@ -129,7 +129,7 @@ static READ16_HANDLER( esd_eeprom_r )
static WRITE16_HANDLER( esd_eeprom_w )
{
if (ACCESSING_BITS_8_15)
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(space->cpu), data, mem_mask);
}
@@ -230,7 +230,7 @@ static WRITE8_HANDLER( esd16_sound_rombank_w )
int bank = data & 0xf;
if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(space->cpu), data);
if (bank >= 3) bank += 1;
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
static ADDRESS_MAP_START( multchmp_sound_map, AS_PROGRAM, 8 )
@@ -241,7 +241,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( esd16_sound_command_r )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
/* Clear IRQ only after reading the command, or some get lost */
device_set_input_line(state->audio_cpu, 0, CLEAR_LINE);
@@ -519,20 +519,20 @@ GFXDECODE_END
static MACHINE_START( esd16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
- UINT8 *AUDIO = machine->region("audiocpu")->base();
+ esd16_state *state = machine.driver_data<esd16_state>();
+ UINT8 *AUDIO = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000);
- state->audio_cpu = machine->device("audiocpu");
- state->eeprom = machine->device("eeprom");
+ state->audio_cpu = machine.device("audiocpu");
+ state->eeprom = machine.device("eeprom");
state->save_item(NAME(state->tilemap0_color));
}
static MACHINE_RESET( esd16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
state->tilemap0_color = 0;
}
diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c
index 8b9570a3818..b634f5d9289 100644
--- a/src/mame/drivers/esh.c
+++ b/src/mame/drivers/esh.c
@@ -48,7 +48,7 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( esh )
{
- esh_state *state = screen->machine->driver_data<esh_state>();
+ esh_state *state = screen->machine().driver_data<esh_state>();
int charx, chary;
/* clear */
@@ -66,7 +66,7 @@ static SCREEN_UPDATE( esh )
//int blinkLine = (state->tile_control_ram[current_screen_character] & 0x40) >> 6;
//int blinkChar = (state->tile_control_ram[current_screen_character] & 0x80) >> 7;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character] + (0x100 * tileOffs),
palIndex,
0, 0, charx*8, chary*8, 0);
@@ -82,19 +82,19 @@ static SCREEN_UPDATE( esh )
/* MEMORY HANDLERS */
static READ8_HANDLER(ldp_read)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
return laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER(ldp_write)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
laserdisc_data_w(state->laserdisc,data);
}
static WRITE8_HANDLER(misc_write)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
/* Bit 0 unknown */
if (data & 0x02)
@@ -141,9 +141,9 @@ static WRITE8_HANDLER(led_writes)
static WRITE8_HANDLER(nmi_line_w)
{
if (data == 0x00)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
if (data == 0x01)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
if (data != 0x00 && data != 0x01)
logerror("NMI line got a weird value!\n");
@@ -222,7 +222,7 @@ static PALETTE_INIT( esh )
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int r,g,b;
int bit0,bit1,bit2;
@@ -278,13 +278,13 @@ static INTERRUPT_GEN( vblank_callback_esh )
{
// IRQ
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
}
static MACHINE_START( esh )
{
- esh_state *state = machine->driver_data<esh_state>();
- state->laserdisc = machine->device("laserdisc");
+ esh_state *state = machine.driver_data<esh_state>();
+ state->laserdisc = machine.device("laserdisc");
}
diff --git a/src/mame/drivers/espial.c b/src/mame/drivers/espial.c
index b955618bb35..adff0bce129 100644
--- a/src/mame/drivers/espial.c
+++ b/src/mame/drivers/espial.c
@@ -43,28 +43,28 @@ Stephh's notes (based on the games Z80 code and some tests) :
static TIMER_CALLBACK( interrupt_disable )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
//interrupt_enable = 0;
cpu_interrupt_enable(state->maincpu, 0);
}
static MACHINE_RESET( espial )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
state->flipscreen = 0;
/* we must start with NMI interrupts disabled */
- machine->scheduler().synchronize(FUNC(interrupt_disable));
+ machine.scheduler().synchronize(FUNC(interrupt_disable));
state->sound_nmi_enabled = FALSE;
}
static MACHINE_START( espial )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
//state_save_register_global_array(machine, mcu_out[1]);
state->save_item(NAME(state->sound_nmi_enabled));
@@ -79,14 +79,14 @@ static WRITE8_HANDLER( espial_master_interrupt_enable_w )
WRITE8_HANDLER( espial_sound_nmi_enable_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->sound_nmi_enabled = data & 1;
}
INTERRUPT_GEN( espial_sound_nmi_gen )
{
- espial_state *state = device->machine->driver_data<espial_state>();
+ espial_state *state = device->machine().driver_data<espial_state>();
if (state->sound_nmi_enabled)
nmi_line_pulse(device);
@@ -104,7 +104,7 @@ static INTERRUPT_GEN( espial_master_interrupt )
static WRITE8_HANDLER( espial_master_soundlatch_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 79c64f03c9f..6286761eec7 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -43,7 +43,7 @@
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "sound_cpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sound_cpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface ptm_intf =
@@ -95,32 +95,32 @@ static READ8_HANDLER( uart_r )
static READ8_HANDLER( g_status_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- int bank4 = BIT(get_rip_status(space->machine->device("video_cpu")), 2);
- int vblank = space->machine->primary_screen->vblank();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ int bank4 = BIT(get_rip_status(space->machine().device("video_cpu")), 2);
+ int vblank = space->machine().primary_screen->vblank();
return (!vblank << 7) | (bank4 << 6) | (state->f_status & 0x2f);
}
static WRITE8_HANDLER( g_status_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
int bankaddress;
- UINT8 *rom = space->machine->region("game_cpu")->base();
+ UINT8 *rom = space->machine().region("game_cpu")->base();
state->g_status = data;
bankaddress = 0x10000 + (data & 0x03) * 0x10000;
- memory_set_bankptr(space->machine, "bank1", &rom[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[bankaddress]);
- cputag_set_input_line(space->machine, "frame_cpu", M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "frame_cpu", INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "frame_cpu", M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "frame_cpu", INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "video_cpu", INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "video_cpu", INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
/* /VBLANK IRQ acknowledge */
if (!(data & 0x20))
- cputag_set_input_line(space->machine, "game_cpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "game_cpu", M6809_IRQ_LINE, CLEAR_LINE);
}
@@ -145,9 +145,9 @@ static WRITE8_HANDLER( g_status_w )
static READ8_HANDLER( f_status_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- int vblank = space->machine->primary_screen->vblank();
- UINT8 rip_status = get_rip_status(space->machine->device("video_cpu"));
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ int vblank = space->machine().primary_screen->vblank();
+ UINT8 rip_status = get_rip_status(space->machine().device("video_cpu"));
rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) | BIT(rip_status, 7);
@@ -156,7 +156,7 @@ static READ8_HANDLER( f_status_r )
static WRITE8_HANDLER( f_status_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->f_status = data;
}
@@ -169,21 +169,21 @@ static WRITE8_HANDLER( f_status_w )
static TIMER_CALLBACK( delayed_bank_swap )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
state->_fasel ^= 1;
state->_fbsel ^= 1;
}
static WRITE8_HANDLER( frame_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- space->machine->scheduler().synchronize(FUNC(delayed_bank_swap));
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ space->machine().scheduler().synchronize(FUNC(delayed_bank_swap));
state->frame_vbl = 1;
}
static READ8_HANDLER( fdt_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
if (!state->_fasel)
return state->fdt_b[offset];
else
@@ -192,7 +192,7 @@ static READ8_HANDLER( fdt_r )
static WRITE8_HANDLER( fdt_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
if (!state->_fasel)
state->fdt_b[offset] = data;
else
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( fdt_w )
static READ16_DEVICE_HANDLER( fdt_rip_r )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->_fasel)
@@ -219,7 +219,7 @@ static READ16_DEVICE_HANDLER( fdt_rip_r )
static WRITE16_DEVICE_HANDLER( fdt_rip_w )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->_fasel)
@@ -245,12 +245,12 @@ static WRITE16_DEVICE_HANDLER( fdt_rip_w )
D7 = /FDONE
*/
-static UINT8 rip_status_in(running_machine *machine)
+static UINT8 rip_status_in(running_machine &machine)
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- int vpos = machine->primary_screen->vpos();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ int vpos = machine.primary_screen->vpos();
UINT8 _vblank = !(vpos >= ESRIPSYS_VBLANK_START);
-// UINT8 _hblank = !machine->primary_screen->hblank();
+// UINT8 _hblank = !machine.primary_screen->hblank();
return _vblank
| (state->hblank << 1)
@@ -268,13 +268,13 @@ static UINT8 rip_status_in(running_machine *machine)
static WRITE8_HANDLER( g_iobus_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->g_iodata = data;
}
static READ8_HANDLER( g_iobus_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
switch (state->g_ioaddr & 0x7f)
{
case 0:
@@ -285,32 +285,32 @@ static READ8_HANDLER( g_iobus_r )
return state->cmos_ram[(state->cmos_ram_a10_3 << 3) | (state->cmos_ram_a2_0 & 3)];
case 8:
{
- int keypad = input_port_read(space->machine, "KEYPAD_B") | state->keypad_status;
+ int keypad = input_port_read(space->machine(), "KEYPAD_B") | state->keypad_status;
state->keypad_status = 0;
state->io_firq_status = 0;
return keypad;
}
case 9:
{
- return input_port_read(space->machine, "KEYPAD_A");
+ return input_port_read(space->machine(), "KEYPAD_A");
}
case 0xa:
{
- int coins = state->coin_latch | (input_port_read(space->machine, "COINS") & 0x30);
+ int coins = state->coin_latch | (input_port_read(space->machine(), "COINS") & 0x30);
state->coin_latch = 0;
state->io_firq_status = 0;
return coins;
}
case 0x10:
- return input_port_read(space->machine, "IO_1");
+ return input_port_read(space->machine(), "IO_1");
case 0x11:
- return input_port_read(space->machine, "JOYSTICK_X");
+ return input_port_read(space->machine(), "JOYSTICK_X");
case 0x12:
- return input_port_read(space->machine, "JOYSTICK_Y");
+ return input_port_read(space->machine(), "JOYSTICK_Y");
case 0x16:
return state->io_firq_status;
case 0x18:
- return input_port_read(space->machine, "IO_2");
+ return input_port_read(space->machine(), "IO_2");
/* Unused I/O */
case 0x19:
case 0x1a:
@@ -342,7 +342,7 @@ static READ8_HANDLER( g_iobus_r )
static WRITE8_HANDLER( g_ioadd_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->g_ioaddr = data;
/* Bit 7 is connected to /OE of LS374 containing I/O data */
@@ -357,7 +357,7 @@ static WRITE8_HANDLER( g_ioadd_w )
}
case 0x02:
{
- cputag_set_input_line(space->machine, "sound_cpu", INPUT_LINE_NMI, state->g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", INPUT_LINE_NMI, state->g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE);
if (!(state->g_to_s_latch2 & 1) && (state->g_iodata & 1))
{
@@ -365,7 +365,7 @@ static WRITE8_HANDLER( g_ioadd_w )
state->u56a = 1;
/*...causing a sound CPU /IRQ */
- cputag_set_input_line(space->machine, "sound_cpu", M6809_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", M6809_IRQ_LINE, ASSERT_LINE);
}
if (state->g_iodata & 2)
@@ -414,23 +414,23 @@ static WRITE8_HANDLER( g_ioadd_w )
static INPUT_CHANGED( keypad_interrupt )
{
- esripsys_state *state = field->port->machine->driver_data<esripsys_state>();
+ esripsys_state *state = field->port->machine().driver_data<esripsys_state>();
if (newval == 0)
{
state->io_firq_status |= 2;
state->keypad_status |= 0x20;
- cputag_set_input_line(field->port->machine, "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(field->port->machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
}
}
static INPUT_CHANGED( coin_interrupt )
{
- esripsys_state *state = field->port->machine->driver_data<esripsys_state>();
+ esripsys_state *state = field->port->machine().driver_data<esripsys_state>();
if (newval == 1)
{
state->io_firq_status |= 2;
- state->coin_latch = input_port_read(field->port->machine, "COINS") << 2;
- cputag_set_input_line(field->port->machine, "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
+ state->coin_latch = input_port_read(field->port->machine(), "COINS") << 2;
+ cputag_set_input_line(field->port->machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
}
}
@@ -493,20 +493,20 @@ INPUT_PORTS_END
/* Game/Sound CPU communications */
static READ8_HANDLER( s_200e_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
return state->g_to_s_latch1;
}
static WRITE8_HANDLER( s_200e_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->s_to_g_latch1 = data;
}
static WRITE8_HANDLER( s_200f_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- UINT8 *rom = space->machine->region("sound_data")->base();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ UINT8 *rom = space->machine().region("sound_data")->base();
int rombank = data & 0x20 ? 0x2000 : 0;
/* Bit 6 -> Reset latch U56A */
@@ -514,23 +514,23 @@ static WRITE8_HANDLER( s_200f_w )
if (state->s_to_g_latch2 & 0x40)
{
state->u56a = 0;
- cputag_set_input_line(space->machine, "sound_cpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", M6809_IRQ_LINE, CLEAR_LINE);
}
if (!(state->s_to_g_latch2 & 0x80) && (data & 0x80))
state->u56b = 1;
/* Speech data resides in the upper 8kB of the ROMs */
- memory_set_bankptr(space->machine, "bank2", &rom[0x0000 + rombank]);
- memory_set_bankptr(space->machine, "bank3", &rom[0x4000 + rombank]);
- memory_set_bankptr(space->machine, "bank4", &rom[0x8000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank2", &rom[0x0000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank3", &rom[0x4000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank4", &rom[0x8000 + rombank]);
state->s_to_g_latch2 = data;
}
static READ8_HANDLER( s_200f_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
return (state->g_to_s_latch2 & 0xfc) | (state->u56b << 1) | state->u56a;
}
@@ -539,7 +539,7 @@ static READ8_HANDLER( tms5220_r )
if (offset == 0)
{
/* TMS5220 core returns status bits in D7-D6 */
- device_t *tms = space->machine->device("tms5220nl");
+ device_t *tms = space->machine().device("tms5220nl");
UINT8 status = tms5220_status_r(tms, 0);
status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5);
@@ -552,8 +552,8 @@ static READ8_HANDLER( tms5220_r )
/* TODO: Implement correctly using the state PROM */
static WRITE8_HANDLER( tms5220_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- device_t *tms = space->machine->device("tms5220nl");
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ device_t *tms = space->machine().device("tms5220nl");
if (offset == 0)
{
state->tms_data = data;
@@ -577,7 +577,7 @@ static WRITE8_HANDLER( control_w )
/* 10-bit MC3410CL DAC */
static WRITE8_DEVICE_HANDLER( esripsys_dac_w )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
if (offset == 0)
{
state->dac_msb = data & 3;
@@ -597,7 +597,7 @@ static WRITE8_DEVICE_HANDLER( esripsys_dac_w )
/* 8-bit MC3408 DAC */
static WRITE8_HANDLER( volume_dac_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->dac_vol = data;
}
@@ -662,14 +662,14 @@ ADDRESS_MAP_END
static DRIVER_INIT( esripsys )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- UINT8 *rom = machine->region("sound_data")->base();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ UINT8 *rom = machine.region("sound_data")->base();
state->fdt_a = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
state->fdt_b = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
state->cmos_ram = auto_alloc_array(machine, UINT8, CMOS_RAM_SIZE);
- machine->device<nvram_device>("nvram")->set_base(state->cmos_ram, CMOS_RAM_SIZE);
+ machine.device<nvram_device>("nvram")->set_base(state->cmos_ram, CMOS_RAM_SIZE);
memory_set_bankptr(machine, "bank2", &rom[0x0000]);
memory_set_bankptr(machine, "bank3", &rom[0x4000]);
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 4dd01df3995..8066803f167 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -52,49 +52,49 @@ public:
static WRITE8_HANDLER( ettrivia_fg_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( ettrivia_bg_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE8_HANDLER( ettrivia_control_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->palreg = (data >> 1) & 3;
state->gfx_bank = (data >> 2) & 1;
state->question_bank = (data >> 3) & 3;
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static READ8_HANDLER( ettrivia_question_r )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
- UINT8 *QUESTIONS = space->machine->region("user1")->base();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
+ UINT8 *QUESTIONS = space->machine().region("user1")->base();
return QUESTIONS[offset + 0x10000 * state->question_bank];
}
static WRITE8_HANDLER( b000_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->b000_val = data;
}
static READ8_HANDLER( b000_r )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
if(state->b800_prev)
return state->b000_ret;
else
@@ -103,26 +103,26 @@ static READ8_HANDLER( b000_r )
static WRITE8_HANDLER( b800_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
switch(data)
{
/* special case to return the value written to 0xb000 */
/* does it reset the chips too ? */
case 0: break;
- case 0xc4: state->b000_ret = ay8910_r(space->machine->device("ay1"), 0); break;
- case 0x94: state->b000_ret = ay8910_r(space->machine->device("ay2"), 0); break;
- case 0x86: state->b000_ret = ay8910_r(space->machine->device("ay3"), 0); break;
+ case 0xc4: state->b000_ret = ay8910_r(space->machine().device("ay1"), 0); break;
+ case 0x94: state->b000_ret = ay8910_r(space->machine().device("ay2"), 0); break;
+ case 0x86: state->b000_ret = ay8910_r(space->machine().device("ay3"), 0); break;
case 0x80:
switch(state->b800_prev)
{
- case 0xe0: ay8910_address_w(space->machine->device("ay1"),0,state->b000_val); break;
- case 0x98: ay8910_address_w(space->machine->device("ay2"),0,state->b000_val); break;
- case 0x83: ay8910_address_w(space->machine->device("ay3"),0,state->b000_val); break;
+ case 0xe0: ay8910_address_w(space->machine().device("ay1"),0,state->b000_val); break;
+ case 0x98: ay8910_address_w(space->machine().device("ay2"),0,state->b000_val); break;
+ case 0x83: ay8910_address_w(space->machine().device("ay3"),0,state->b000_val); break;
- case 0xa0: ay8910_data_w(space->machine->device("ay1"),0,state->b000_val); break;
- case 0x88: ay8910_data_w(space->machine->device("ay2"),0,state->b000_val); break;
- case 0x81: ay8910_data_w(space->machine->device("ay3"),0,state->b000_val); break;
+ case 0xa0: ay8910_data_w(space->machine().device("ay1"),0,state->b000_val); break;
+ case 0x88: ay8910_data_w(space->machine().device("ay2"),0,state->b000_val); break;
+ case 0x81: ay8910_data_w(space->machine().device("ay3"),0,state->b000_val); break;
}
break;
@@ -188,9 +188,9 @@ static GFXDECODE_START( ettrivia )
GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*4, 32 )
GFXDECODE_END
-INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
+INLINE void get_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
int code = vidram[tile_index];
int color = (code >> 5) + 8 * state->palreg;
@@ -201,13 +201,13 @@ INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int til
static TILE_GET_INFO( get_tile_info_bg )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
get_tile_info(machine, tileinfo, tile_index, state->bg_videoram, 0);
}
static TILE_GET_INFO( get_tile_info_fg )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 1);
}
@@ -223,7 +223,7 @@ static PALETTE_INIT( ettrivia )
2, resistances, weights, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1;
int r, g, b;
@@ -249,7 +249,7 @@ static PALETTE_INIT( ettrivia )
static VIDEO_START( ettrivia )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
state->bg_tilemap = tilemap_create( machine, get_tile_info_bg,tilemap_scan_rows,8,8,64,32 );
state->fg_tilemap = tilemap_create( machine, get_tile_info_fg,tilemap_scan_rows,8,8,64,32 );
@@ -258,7 +258,7 @@ static VIDEO_START( ettrivia )
static SCREEN_UPDATE( ettrivia )
{
- ettrivia_state *state = screen->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = screen->machine().driver_data<ettrivia_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
@@ -287,7 +287,7 @@ static const ay8910_interface ay8912_interface_3 =
static INTERRUPT_GEN( ettrivia_interrupt )
{
- if( input_port_read(device->machine, "COIN") & 0x01 )
+ if( input_port_read(device->machine(), "COIN") & 0x01 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
else
device_set_input_line(device, 0, HOLD_LINE);
diff --git a/src/mame/drivers/exedexes.c b/src/mame/drivers/exedexes.c
index 3eb585936a8..776e4b6dbbb 100644
--- a/src/mame/drivers/exedexes.c
+++ b/src/mame/drivers/exedexes.c
@@ -194,7 +194,7 @@ GFXDECODE_END
static MACHINE_START( exedexes )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
state->save_item(NAME(state->chon));
state->save_item(NAME(state->objon));
@@ -204,7 +204,7 @@ static MACHINE_START( exedexes )
static MACHINE_RESET( exedexes )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
state->chon = 0;
state->objon = 0;
diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c
index 4c003bbc84c..21eb56ab8a2 100644
--- a/src/mame/drivers/exerion.c
+++ b/src/mame/drivers/exerion.c
@@ -133,14 +133,14 @@ Stephh's notes (based on the games Z80 code and some tests) :
static CUSTOM_INPUT( exerion_controls_r )
{
static const char *const inname[2] = { "P1", "P2" };
- exerion_state *state = field->port->machine->driver_data<exerion_state>();
- return input_port_read(field->port->machine, inname[state->cocktail_flip]) & 0x3f;
+ exerion_state *state = field->port->machine().driver_data<exerion_state>();
+ return input_port_read(field->port->machine(), inname[state->cocktail_flip]) & 0x3f;
}
static INPUT_CHANGED( coin_inserted )
{
- exerion_state *state = field->port->machine->driver_data<exerion_state>();
+ exerion_state *state = field->port->machine().driver_data<exerion_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -157,7 +157,7 @@ static INPUT_CHANGED( coin_inserted )
/* protection or some sort of timer. */
static READ8_DEVICE_HANDLER( exerion_porta_r )
{
- exerion_state *state = device->machine->driver_data<exerion_state>();
+ exerion_state *state = device->machine().driver_data<exerion_state>();
state->porta ^= 0x40;
return state->porta;
}
@@ -165,9 +165,9 @@ static READ8_DEVICE_HANDLER( exerion_porta_r )
static WRITE8_DEVICE_HANDLER( exerion_portb_w )
{
- exerion_state *state = device->machine->driver_data<exerion_state>();
+ exerion_state *state = device->machine().driver_data<exerion_state>();
/* pull the expected value from the ROM */
- state->porta = device->machine->region("maincpu")->base()[0x5f76];
+ state->porta = device->machine().region("maincpu")->base()[0x5f76];
state->portb = data;
logerror("Port B = %02X\n", data);
@@ -176,9 +176,9 @@ static WRITE8_DEVICE_HANDLER( exerion_portb_w )
static READ8_HANDLER( exerion_protection_r )
{
- exerion_state *state = space->machine->driver_data<exerion_state>();
+ exerion_state *state = space->machine().driver_data<exerion_state>();
if (cpu_get_pc(space->cpu) == 0x4143)
- return space->machine->region("maincpu")->base()[0x33c0 + (state->main_ram[0xd] << 2) + offset];
+ return space->machine().region("maincpu")->base()[0x33c0 + (state->main_ram[0xd] << 2) + offset];
else
return state->main_ram[0x8 + offset];
}
@@ -384,9 +384,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( exerion )
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->porta));
state->save_item(NAME(state->portb));
@@ -399,7 +399,7 @@ static MACHINE_START( exerion )
static MACHINE_RESET( exerion )
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
int i;
state->porta = 0;
@@ -562,8 +562,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -580,8 +580,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ dst = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -603,7 +603,7 @@ static DRIVER_INIT( exerion )
static DRIVER_INIT( exerionb )
{
- UINT8 *ram = machine->region("maincpu")->base();
+ UINT8 *ram = machine.region("maincpu")->base();
int addr;
/* the program ROMs have data lines D1 and D2 swapped. Decode them. */
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index ac8668fb0b8..57ace786fee 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -158,8 +158,8 @@ Fax 1982 6502 FXL, FLA
static CUSTOM_INPUT( teetert_input_r )
{
- exidy_state *state = field->port->machine->driver_data<exidy_state>();
- UINT8 dial = input_port_read(field->port->machine, "DIAL");
+ exidy_state *state = field->port->machine().driver_data<exidy_state>();
+ UINT8 dial = input_port_read(field->port->machine(), "DIAL");
int result = 0;
result = (dial != state->last_dial) << 4;
@@ -187,9 +187,9 @@ static CUSTOM_INPUT( teetert_input_r )
static WRITE8_HANDLER( fax_bank_select_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1", &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
if ((data & 0x1f) > 0x17)
logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1f);
}
@@ -795,7 +795,7 @@ GFXDECODE_END
static MACHINE_START( teetert )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
state_save_register_global(machine, state->last_dial);
}
@@ -1384,7 +1384,7 @@ ROM_END
static DRIVER_INIT( sidetrac )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1396,7 +1396,7 @@ static DRIVER_INIT( sidetrac )
static DRIVER_INIT( targ )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1408,7 +1408,7 @@ static DRIVER_INIT( targ )
static DRIVER_INIT( spectar )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1419,7 +1419,7 @@ static DRIVER_INIT( spectar )
static DRIVER_INIT( rallys )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1430,7 +1430,7 @@ static DRIVER_INIT( rallys )
static DRIVER_INIT( phantoma )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1439,8 +1439,8 @@ static DRIVER_INIT( phantoma )
state->color_latch[0] = 0x09;
/* the ROM is actually mapped high */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf800, 0xffff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0xf800);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf800, 0xffff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0xf800);
}
@@ -1470,7 +1470,7 @@ static DRIVER_INIT( pepper2 )
static DRIVER_INIT( fax )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
exidy_video_config(machine, 0x04, 0x04, TRUE);
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index 52eb4ee0163..a44c0bb107b 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -256,7 +256,7 @@ static INPUT_CHANGED( coin_inserted )
{
/* if we got a coin, set the IRQ on the main CPU */
if (newval == 0)
- cputag_set_input_line(field->port->machine, "maincpu", 0, ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", 0, ASSERT_LINE);
}
@@ -269,14 +269,14 @@ static INPUT_CHANGED( coin_inserted )
static CUSTOM_INPUT( firq_beam_r )
{
- exidy440_state *state = field->port->machine->driver_data<exidy440_state>();
+ exidy440_state *state = field->port->machine().driver_data<exidy440_state>();
return state->firq_beam;
}
static CUSTOM_INPUT( firq_vblank_r )
{
- exidy440_state *state = field->port->machine->driver_data<exidy440_state>();
+ exidy440_state *state = field->port->machine().driver_data<exidy440_state>();
return state->firq_vblank;
}
@@ -284,7 +284,7 @@ static CUSTOM_INPUT( firq_vblank_r )
static CUSTOM_INPUT( hitnmiss_button1_r )
{
/* button 1 shows up in two bits */
- UINT32 button1 = input_port_read(field->port->machine, "HITNMISS_BUTTON1");
+ UINT32 button1 = input_port_read(field->port->machine(), "HITNMISS_BUTTON1");
return (button1 << 1) | button1;
}
@@ -296,31 +296,31 @@ static CUSTOM_INPUT( hitnmiss_button1_r )
*
*************************************/
-void exidy440_bank_select(running_machine *machine, UINT8 bank)
+void exidy440_bank_select(running_machine &machine, UINT8 bank)
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
/* for the showdown case, bank 0 is a PLD */
if (state->showdown_bank_data[0] != NULL)
{
if (bank == 0 && state->bank != 0)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x7fff, FUNC(showdown_bank0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x7fff, FUNC(showdown_bank0_r));
else if (bank != 0 && state->bank == 0)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank1");
}
/* select the bank and update the bank pointer */
state->bank = bank;
- memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x10000 + state->bank * 0x4000]);
+ memory_set_bankptr(machine, "bank1", &machine.region("maincpu")->base()[0x10000 + state->bank * 0x4000]);
}
static WRITE8_HANDLER( bankram_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* EEROM lives in the upper 8k of bank 15 */
if (state->bank == 15 && offset >= 0x2000)
{
- space->machine->region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
+ space->machine().region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
logerror("W EEROM[%04X] = %02X\n", offset - 0x2000, data);
}
@@ -338,8 +338,8 @@ static WRITE8_HANDLER( bankram_w )
static READ8_HANDLER( exidy440_input_port_3_r )
{
/* I/O1 accesses clear the CIRQ flip/flop */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
- return input_port_read(space->machine, "IN3");
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ return input_port_read(space->machine(), "IN3");
}
@@ -365,20 +365,20 @@ static TIMER_CALLBACK( delayed_sound_command_w )
static WRITE8_HANDLER( sound_command_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_command_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_command_w), data);
}
static WRITE8_HANDLER( exidy440_input_port_3_w )
{
/* I/O1 accesses clear the CIRQ flip/flop */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( exidy440_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -391,7 +391,7 @@ static WRITE8_HANDLER( exidy440_coin_counter_w )
static READ8_HANDLER( showdown_bank0_r )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* showdown relies on different values from different memory locations */
/* yukon relies on multiple reads from the same location returning different values */
UINT8 result = 0xff;
@@ -427,13 +427,13 @@ static READ8_HANDLER( claypign_protection_r )
static READ8_HANDLER( topsecex_input_port_5_r )
{
- return (input_port_read(space->machine, "AN1") & 1) ? 0x01 : 0x02;
+ return (input_port_read(space->machine(), "AN1") & 1) ? 0x01 : 0x02;
}
static WRITE8_HANDLER( topsecex_yscroll_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
*state->topsecex_yscroll = data;
}
@@ -448,13 +448,13 @@ static WRITE8_HANDLER( topsecex_yscroll_w )
static MACHINE_START( exidy440 )
{
/* the EEROM lives in the uppermost 8k of the top bank */
- UINT8 *rom = machine->region("maincpu")->base();
- machine->device<nvram_device>("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000);
+ UINT8 *rom = machine.region("maincpu")->base();
+ machine.device<nvram_device>("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000);
}
static MACHINE_RESET( exidy440 )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
state->bank = 0xff;
exidy440_bank_select(machine, 0);
}
@@ -1929,7 +1929,7 @@ ROM_END
static DRIVER_INIT( exidy440 )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
state->showdown_bank_data[0] = state->showdown_bank_data[1] = NULL;
}
@@ -1938,27 +1938,27 @@ static DRIVER_INIT( claypign )
{
DRIVER_INIT_CALL(exidy440);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec0, 0x2ec3, FUNC(claypign_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec0, 0x2ec3, FUNC(claypign_protection_r));
}
static DRIVER_INIT( topsecex )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
DRIVER_INIT_CALL(exidy440);
/* extra input ports and scrolling */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec5, 0x2ec5, FUNC(topsecex_input_port_5_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec6, 0x2ec6, "AN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec7, 0x2ec7, "IN4");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec5, 0x2ec5, FUNC(topsecex_input_port_5_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec6, 0x2ec6, "AN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec7, 0x2ec7, "IN4");
- state->topsecex_yscroll = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ec1, 0x2ec1, FUNC(topsecex_yscroll_w));
+ state->topsecex_yscroll = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ec1, 0x2ec1, FUNC(topsecex_yscroll_w));
}
static DRIVER_INIT( showdown )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
static const UINT8 bankdata0[0x18] =
{
0x15,0x40,0xc1,0x8d,0x4c,0x84,0x0e,0xce,
@@ -1982,7 +1982,7 @@ static DRIVER_INIT( showdown )
static DRIVER_INIT( yukon )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
static const UINT8 bankdata0[0x18] =
{
0x31,0x40,0xc1,0x95,0x54,0x90,0x16,0xd6,
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index 0c77383bc83..5abccfcf87b 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -310,7 +310,7 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
}
@@ -323,14 +323,14 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
static WRITE16_HANDLER( galsnew_paletteram_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
}
static WRITE16_HANDLER(galsnew_vram_0_bank_w)
{
- expro02_state *state = space->machine->driver_data<expro02_state>();
+ expro02_state *state = space->machine().driver_data<expro02_state>();
int i;
if(state->vram_0_bank_num != data)
{
@@ -347,7 +347,7 @@ static WRITE16_HANDLER(galsnew_vram_0_bank_w)
static WRITE16_HANDLER(galsnew_vram_1_bank_w)
{
- expro02_state *state = space->machine->driver_data<expro02_state>();
+ expro02_state *state = space->machine().driver_data<expro02_state>();
int i;
if(state->vram_1_bank_num != data)
{
@@ -739,8 +739,8 @@ ROM_END
static DRIVER_INIT(galsnew)
{
- UINT32 *src = (UINT32 *)machine->region("gfx3" )->base();
- UINT32 *dst = (UINT32 *)machine->region("gfx2" )->base();
+ UINT32 *src = (UINT32 *)machine.region("gfx3" )->base();
+ UINT32 *dst = (UINT32 *)machine.region("gfx2" )->base();
int x, offset;
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index ed3bff31dab..6a7765b429e 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -219,7 +219,7 @@ Stephh's notes (based on the games M6502 code and some tests) :
static READ8_HANDLER( exprraid_protection_r )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
switch (offset)
{
case 0:
@@ -233,14 +233,14 @@ static READ8_HANDLER( exprraid_protection_r )
static WRITE8_HANDLER( sound_cpu_command_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( vblank_r )
{
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8 )
@@ -280,13 +280,13 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_deco16 )
{
- exprraid_state *state = field->port->machine->driver_data<exprraid_state>();
+ exprraid_state *state = field->port->machine().driver_data<exprraid_state>();
device_set_input_line(state->maincpu, DECO16_IRQ_LINE, newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_CHANGED( coin_inserted_nmi )
{
- exprraid_state *state = field->port->machine->driver_data<exprraid_state>();
+ exprraid_state *state = field->port->machine().driver_data<exprraid_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -441,7 +441,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- exprraid_state *state = device->machine->driver_data<exprraid_state>();
+ exprraid_state *state = device->machine().driver_data<exprraid_state>();
device_set_input_line_and_vector(state->slave, 0, linestate, 0xff);
}
@@ -453,9 +453,9 @@ static const ym3526_interface ym3526_config =
#if 0
static INTERRUPT_GEN( exprraid_interrupt )
{
- exprraid_state *state = device->machine->driver_data<exprraid_state>();
+ exprraid_state *state = device->machine().driver_data<exprraid_state>();
- if ((~input_port_read(device->machine, "IN2")) & 0xc0)
+ if ((~input_port_read(device->machine(), "IN2")) & 0xc0)
{
if (state->coin == 0)
{
@@ -475,17 +475,17 @@ static INTERRUPT_GEN( exprraid_interrupt )
static MACHINE_START( exprraid )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
- state->maincpu = machine->device("maincpu");
- state->slave = machine->device("slave");
+ state->maincpu = machine.device("maincpu");
+ state->slave = machine.device("slave");
state->save_item(NAME(state->bg_index));
}
static MACHINE_RESET( exprraid )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
state->bg_index[0] = 0;
state->bg_index[1] = 0;
@@ -733,11 +733,11 @@ ROM_START( wexpressb2 )
ROM_END
-static void exprraid_gfx_expand(running_machine *machine)
+static void exprraid_gfx_expand(running_machine &machine)
{
/* Expand the background rom so we can use regular decode routines */
- UINT8 *gfx = machine->region("gfx3")->base();
+ UINT8 *gfx = machine.region("gfx3")->base();
int offs = 0x10000 - 0x1000;
int i;
@@ -756,7 +756,7 @@ static void exprraid_gfx_expand(running_machine *machine)
static DRIVER_INIT( wexpress )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* HACK: this set uses M6502 irq vectors but DECO CPU-16 opcodes??? */
rom[0xfff7] = rom[0xfffa];
@@ -778,13 +778,13 @@ static DRIVER_INIT( exprraid )
static DRIVER_INIT( wexpressb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(vblank_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(vblank_r));
exprraid_gfx_expand(machine);
}
static DRIVER_INIT( wexpressb2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFC0, 0xFFC0, FUNC(vblank_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFC0, 0xFFC0, FUNC(vblank_r));
exprraid_gfx_expand(machine);
}
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index e9600879413..aca7a2fb6fd 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -78,13 +78,13 @@
static WRITE16_HANDLER( exterm_host_data_w )
{
- tms34010_host_w(space->machine->device("slave"), offset / TOWORD(0x00100000), data);
+ tms34010_host_w(space->machine().device("slave"), offset / TOWORD(0x00100000), data);
}
static READ16_HANDLER( exterm_host_data_r )
{
- return tms34010_host_r(space->machine->device("slave"), offset / TOWORD(0x00100000));
+ return tms34010_host_r(space->machine().device("slave"), offset / TOWORD(0x00100000));
}
@@ -97,11 +97,11 @@ static READ16_HANDLER( exterm_host_data_r )
static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 mem_mask)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
UINT16 port;
/* Read the fake input port */
- UINT8 trackball_pos = input_port_read(space->machine, which ? "DIAL1" : "DIAL0");
+ UINT8 trackball_pos = input_port_read(space->machine(), which ? "DIAL1" : "DIAL0");
/* Calculate the change from the last position. */
UINT8 trackball_diff = state->trackball_old[which] - trackball_pos;
@@ -117,7 +117,7 @@ static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 me
state->aimpos[which] = (state->aimpos[which] + trackball_diff) & 0x3f;
/* Combine it with the standard input bits */
- port = which ? input_port_read(space->machine, "P2") : input_port_read(space->machine, "P1");
+ port = which ? input_port_read(space->machine(), "P2") : input_port_read(space->machine(), "P1");
return (port & 0xc0ff) | (state->aimpos[which] << 8);
}
@@ -144,7 +144,7 @@ static READ16_HANDLER( exterm_input_port_1_r )
static WRITE16_HANDLER( exterm_output_port_0_w )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* All the outputs are activated on the rising edge */
if (ACCESSING_BITS_0_7)
@@ -160,11 +160,11 @@ static WRITE16_HANDLER( exterm_output_port_0_w )
{
/* Bit 13 = Resets the slave CPU */
if ((data & 0x2000) && !(state->last & 0x2000))
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, PULSE_LINE);
/* Bits 14-15 = Coin counters */
- coin_counter_w(space->machine, 0, data & 0x8000);
- coin_counter_w(space->machine, 1, data & 0x4000);
+ coin_counter_w(space->machine(), 0, data & 0x8000);
+ coin_counter_w(space->machine(), 1, data & 0x4000);
}
COMBINE_DATA(&state->last);
@@ -173,7 +173,7 @@ static WRITE16_HANDLER( exterm_output_port_0_w )
static TIMER_CALLBACK( sound_delayed_w )
{
- exterm_state *state = machine->driver_data<exterm_state>();
+ exterm_state *state = machine.driver_data<exterm_state>();
/* data is latched independently for both sound CPUs */
state->master_sound_latch = state->slave_sound_latch = param;
cputag_set_input_line(machine, "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
@@ -184,7 +184,7 @@ static TIMER_CALLBACK( sound_delayed_w )
static WRITE16_HANDLER( sound_latch_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(sound_delayed_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(sound_delayed_w), data & 0xff);
}
@@ -197,16 +197,16 @@ static WRITE16_HANDLER( sound_latch_w )
static TIMER_DEVICE_CALLBACK( master_sound_nmi_callback )
{
- exterm_state *state = timer.machine->driver_data<exterm_state>();
+ exterm_state *state = timer.machine().driver_data<exterm_state>();
/* bit 0 of the sound control determines if the NMI is actually delivered */
if (state->sound_control & 0x01)
- cputag_set_input_line(timer.machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( ym2151_data_latch_w )
{
- exterm_state *state = device->machine->driver_data<exterm_state>();
+ exterm_state *state = device->machine().driver_data<exterm_state>();
/* bit 7 of the sound control selects which port */
ym2151_w(device, state->sound_control >> 7, data);
}
@@ -218,32 +218,32 @@ static WRITE8_HANDLER( sound_nmi_rate_w )
/* this value is latched into up-counters, which are clocked at the */
/* input clock / 256 */
attotime nmi_rate = attotime::from_hz(4000000) * (4096 * (256 - data));
- timer_device *nmi_timer = space->machine->device<timer_device>("snd_nmi_timer");
+ timer_device *nmi_timer = space->machine().device<timer_device>("snd_nmi_timer");
nmi_timer->adjust(nmi_rate, 0, nmi_rate);
}
static READ8_HANDLER( sound_master_latch_r )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* read latch and clear interrupt */
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
return state->master_sound_latch;
}
static READ8_HANDLER( sound_slave_latch_r )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* read latch and clear interrupt */
- cputag_set_input_line(space->machine, "audioslave", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audioslave", M6502_IRQ_LINE, CLEAR_LINE);
return state->slave_sound_latch;
}
static WRITE8_DEVICE_HANDLER( sound_slave_dac_w )
{
- exterm_state *state = device->machine->driver_data<exterm_state>();
+ exterm_state *state = device->machine().driver_data<exterm_state>();
/* DAC A is used to modulate DAC B */
state->dac_value[offset & 1] = data;
dac_data_16_w(device, (state->dac_value[0] ^ 0xff) * state->dac_value[1]);
@@ -253,14 +253,14 @@ static WRITE8_DEVICE_HANDLER( sound_slave_dac_w )
static READ8_HANDLER( sound_nmi_to_slave_r )
{
/* a read from here triggers an NMI pulse to the slave */
- cputag_set_input_line(space->machine, "audioslave", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audioslave", INPUT_LINE_NMI, PULSE_LINE);
return 0xff;
}
static WRITE8_HANDLER( sound_control_w )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/*
D7 = to S4-15
D6 = to S4-12
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index aab0523f597..c1b1b8188e5 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -48,74 +48,74 @@ TODO:
static WRITE8_HANDLER( exzisus_cpua_bankswitch_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
- UINT8 *RAM = space->machine->region("cpua")->base();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
+ UINT8 *RAM = space->machine().region("cpua")->base();
if ( (data & 0x0f) != state->cpua_bank )
{
state->cpua_bank = data & 0x0f;
if (state->cpua_bank >= 2)
{
- memory_set_bankptr(space->machine, "bank2", &RAM[ 0x10000 + ( (state->cpua_bank - 2) * 0x4000 ) ] );
+ memory_set_bankptr(space->machine(), "bank2", &RAM[ 0x10000 + ( (state->cpua_bank - 2) * 0x4000 ) ] );
}
}
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
static WRITE8_HANDLER( exzisus_cpub_bankswitch_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
- UINT8 *RAM = space->machine->region("cpub")->base();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
+ UINT8 *RAM = space->machine().region("cpub")->base();
if ( (data & 0x0f) != state->cpub_bank )
{
state->cpub_bank = data & 0x0f;
if (state->cpub_bank >= 2)
{
- memory_set_bankptr(space->machine, "bank1", &RAM[ 0x10000 + ( (state->cpub_bank - 2) * 0x4000 ) ] );
+ memory_set_bankptr(space->machine(), "bank1", &RAM[ 0x10000 + ( (state->cpub_bank - 2) * 0x4000 ) ] );
}
}
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
static WRITE8_HANDLER( exzisus_coincounter_w )
{
- coin_lockout_w(space->machine, 0,~data & 0x01);
- coin_lockout_w(space->machine, 1,~data & 0x02);
- coin_counter_w(space->machine, 0,data & 0x04);
- coin_counter_w(space->machine, 1,data & 0x08);
+ coin_lockout_w(space->machine(), 0,~data & 0x01);
+ coin_lockout_w(space->machine(), 1,~data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x04);
+ coin_counter_w(space->machine(), 1,data & 0x08);
}
static READ8_HANDLER( exzisus_sharedram_ab_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->sharedram_ab[offset];
}
static READ8_HANDLER( exzisus_sharedram_ac_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->sharedram_ac[offset];
}
static WRITE8_HANDLER( exzisus_sharedram_ab_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->sharedram_ab[offset] = data;
}
static WRITE8_HANDLER( exzisus_sharedram_ac_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->sharedram_ac[offset] = data;
}
// is it ok that cpub_reset refers to cpuc?
static WRITE8_HANDLER( exzisus_cpub_reset_w )
{
- cputag_set_input_line(space->machine, "cpuc", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "cpuc", INPUT_LINE_RESET, PULSE_LINE);
}
#if 0
@@ -123,7 +123,7 @@ static WRITE8_HANDLER( exzisus_cpub_reset_w )
// the RAM check to work
static DRIVER_INIT( exzisus )
{
- UINT8 *RAM = machine->region("cpua")->base();
+ UINT8 *RAM = machine.region("cpua")->base();
/* Fix WORK RAM error */
RAM[0x67fd] = 0x18;
@@ -260,7 +260,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c
index 9517f3993ed..be1adcc0337 100644
--- a/src/mame/drivers/f-32.c
+++ b/src/mame/drivers/f-32.c
@@ -32,7 +32,7 @@ public:
static SCREEN_UPDATE( mosaicf2 )
{
- mosaicf2_state *state = screen->machine->driver_data<mosaicf2_state>();
+ mosaicf2_state *state = screen->machine().driver_data<mosaicf2_state>();
offs_t offs;
for (offs = 0; offs < 0x10000; offs++)
@@ -62,12 +62,12 @@ ADDRESS_MAP_END
static READ32_HANDLER( f32_input_port_1_r )
{
/* burn a bunch of cycles because this is polled frequently during busy loops */
- mosaicf2_state *state = space->machine->driver_data<mosaicf2_state>();
+ mosaicf2_state *state = space->machine().driver_data<mosaicf2_state>();
offs_t pc = state->maincpu->pc();
if ((pc == 0x000379de) || (pc == 0x000379cc) )
state->maincpu->eat_cycles(100);
//else printf("PC %08x\n", pc );
- return input_port_read(space->machine, "SYSTEM_P2");
+ return input_port_read(space->machine(), "SYSTEM_P2");
}
diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c
index ba75831eb63..2dbad86b178 100644
--- a/src/mame/drivers/f1gp.c
+++ b/src/mame/drivers/f1gp.c
@@ -30,19 +30,19 @@
static READ16_HANDLER( sharedram_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return state->sharedram[offset];
}
static WRITE16_HANDLER( sharedram_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->sharedram[offset]);
}
static READ16_HANDLER( extrarom_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
offset *= 2;
@@ -51,7 +51,7 @@ static READ16_HANDLER( extrarom_r )
static READ16_HANDLER( extrarom2_r )
{
- UINT8 *rom = space->machine->region("user2")->base();
+ UINT8 *rom = space->machine().region("user2")->base();
offset *= 2;
@@ -60,13 +60,13 @@ static READ16_HANDLER( extrarom2_r )
static WRITE8_HANDLER( f1gp_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE16_HANDLER( sound_command_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
if (ACCESSING_BITS_0_7)
{
@@ -78,13 +78,13 @@ static WRITE16_HANDLER( sound_command_w )
static READ16_HANDLER( command_pending_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return (state->pending_command ? 0xff : 0);
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
state->pending_command = 0;
}
@@ -168,8 +168,8 @@ static WRITE16_HANDLER( f1gpb_misc_w )
if(old_bank != new_bank && new_bank < 5)
{
// oki banking
- UINT8 *src = space->machine->region("oki")->base() + 0x40000 + 0x10000 * new_bank;
- UINT8 *dst = space->machine->region("oki")->base() + 0x30000;
+ UINT8 *src = space->machine().region("oki")->base() + 0x40000 + 0x10000 * new_bank;
+ UINT8 *dst = space->machine().region("oki")->base() + 0x30000;
memcpy(dst, src, 0x10000);
old_bank = new_bank;
@@ -411,7 +411,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- f1gp_state *state = device->machine->driver_data<f1gp_state>();
+ f1gp_state *state = device->machine().driver_data<f1gp_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -433,7 +433,7 @@ static const k053936_interface f1gp2_k053936_intf =
static MACHINE_START( f1gpb )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->save_item(NAME(state->pending_command));
state->save_item(NAME(state->roz_bank));
@@ -444,20 +444,20 @@ static MACHINE_START( f1gpb )
static MACHINE_START( f1gp )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000);
- state->audiocpu = machine->device("audiocpu");
- state->k053936 = machine->device("k053936");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936 = machine.device("k053936");
MACHINE_START_CALL(f1gpb);
}
static MACHINE_RESET( f1gp )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->pending_command = 0;
state->roz_bank = 0;
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index 4590ce4ff2d..85147e055d8 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -61,7 +61,7 @@ Year + Game Main CPU Sound CPU Sound Video
static WRITE8_HANDLER( fantland_nmi_enable_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
state->nmi_enable = data;
if ((state->nmi_enable != 0) && (state->nmi_enable != 8))
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( fantland_nmi_enable_16_w )
static WRITE8_HANDLER( fantland_soundlatch_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audio_cpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -93,21 +93,21 @@ static WRITE16_HANDLER( fantland_soundlatch_16_w )
static READ16_HANDLER( spriteram_16_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram = state->spriteram;
return spriteram[2 * offset + 0] | (spriteram[2 * offset + 1] << 8);
}
static READ16_HANDLER( spriteram2_16_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram_2 = state->spriteram2;
return spriteram_2[2 * offset + 0] | (spriteram_2[2 * offset + 1] << 8);
}
static WRITE16_HANDLER( spriteram_16_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram = state->spriteram;
if (ACCESSING_BITS_0_7)
spriteram[2 * offset + 0] = data;
@@ -117,7 +117,7 @@ static WRITE16_HANDLER( spriteram_16_w )
static WRITE16_HANDLER( spriteram2_16_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram_2 = state->spriteram2;
if (ACCESSING_BITS_0_7)
spriteram_2[2 * offset + 0] = data;
@@ -170,7 +170,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( borntofi_nmi_enable_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
state->nmi_enable = data;
// data & 0x31 changes when lightgun fires
@@ -184,23 +184,23 @@ static WRITE8_HANDLER( borntofi_nmi_enable_w )
// Trackball doesn't work correctly
static READ8_HANDLER( borntofi_inputs_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
int x, y, f;
- switch (input_port_read(space->machine, "Controls") & 0x03)
+ switch (input_port_read(space->machine(), "Controls") & 0x03)
{
case 3:
- case 1: return input_port_read(space->machine, offset ? "P2_GUN" : "P1_GUN"); // Lightgun buttons
- case 2: return input_port_read(space->machine, offset ? "P2_JOY" : "P1_JOY"); // Joystick
+ case 1: return input_port_read(space->machine(), offset ? "P2_GUN" : "P1_GUN"); // Lightgun buttons
+ case 2: return input_port_read(space->machine(), offset ? "P2_JOY" : "P1_JOY"); // Joystick
}
// Trackball
- x = input_port_read(space->machine, offset ? "P2 Trackball X" : "P1 Trackball X");
- y = input_port_read(space->machine, offset ? "P2 Trackball Y" : "P1 Trackball Y");
- f = space->machine->primary_screen->frame_number();
+ x = input_port_read(space->machine(), offset ? "P2 Trackball X" : "P1 Trackball X");
+ y = input_port_read(space->machine(), offset ? "P2 Trackball Y" : "P1 Trackball Y");
+ f = space->machine().primary_screen->frame_number();
- state->input_ret[offset] = (state->input_ret[offset] & 0x14) | (input_port_read(space->machine, offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
+ state->input_ret[offset] = (state->input_ret[offset] & 0x14) | (input_port_read(space->machine(), offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
x = (x & 0x7f) - (x & 0x80);
y = (y & 0x7f) - (y & 0x80);
@@ -317,23 +317,23 @@ ADDRESS_MAP_END
static void borntofi_adpcm_start( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
msm5205_reset_w(device, 0);
state->adpcm_playing[voice] = 1;
state->adpcm_nibble[voice] = 0;
-// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine->describe_context(), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]);
+// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine().describe_context(), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]);
}
static void borntofi_adpcm_stop( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
msm5205_reset_w(device, 1);
state->adpcm_playing[voice] = 0;
}
static WRITE8_HANDLER( borntofi_msm5205_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
int voice = offset / 8;
int reg = offset % 8;
device_t *msm;
@@ -369,7 +369,7 @@ static WRITE8_HANDLER( borntofi_msm5205_w )
static void borntofi_adpcm_int( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
UINT8 *rom;
size_t len;
int start, stop;
@@ -377,8 +377,8 @@ static void borntofi_adpcm_int( device_t *device, int voice )
if (!state->adpcm_playing[voice])
return;
- rom = device->machine->region("adpcm")->base();
- len = device->machine->region("adpcm")->bytes() * 2;
+ rom = device->machine().region("adpcm")->base();
+ len = device->machine().region("adpcm")->bytes() * 2;
start = state->adpcm_addr[0][voice] + state->adpcm_nibble[voice];
stop = state->adpcm_addr[1][voice];
@@ -730,7 +730,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( wheelrun_wheel_r )
{
int player = (FPTR)param;
- int delta = input_port_read(field->port->machine, player ? "WHEEL1" : "WHEEL0");
+ int delta = input_port_read(field->port->machine(), player ? "WHEEL1" : "WHEEL0");
delta = (delta & 0x7f) - (delta & 0x80) + 4;
if (delta > 7) delta = 7;
@@ -827,22 +827,22 @@ GFXDECODE_END
static MACHINE_START( fantland )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( fantland )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
state->nmi_enable = 0;
}
static INTERRUPT_GEN( fantland_irq )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
if (state->nmi_enable & 8)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -897,7 +897,7 @@ MACHINE_CONFIG_END
static void galaxygn_sound_irq( device_t *device, int line )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
device_set_input_line_and_vector(state->audio_cpu, 0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4);
}
@@ -967,14 +967,14 @@ static const msm5205_interface msm5205_config_3 =
static MACHINE_START( borntofi )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
MACHINE_START_CALL(fantland);
- state->msm1 = machine->device("msm1");
- state->msm2 = machine->device("msm2");
- state->msm3 = machine->device("msm3");
- state->msm4 = machine->device("msm4");
+ state->msm1 = machine.device("msm1");
+ state->msm2 = machine.device("msm2");
+ state->msm3 = machine.device("msm3");
+ state->msm4 = machine.device("msm4");
state->save_item(NAME(state->old_x));
state->save_item(NAME(state->old_y));
@@ -988,7 +988,7 @@ static MACHINE_START( borntofi )
static MACHINE_RESET( borntofi )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
int i;
MACHINE_RESET_CALL(fantland);
@@ -1009,10 +1009,10 @@ static MACHINE_RESET( borntofi )
state->adpcm_nibble[i] = 0;
}
- borntofi_adpcm_stop(machine->device("msm1"), 0);
- borntofi_adpcm_stop(machine->device("msm2"), 1);
- borntofi_adpcm_stop(machine->device("msm3"), 2);
- borntofi_adpcm_stop(machine->device("msm4"), 3);
+ borntofi_adpcm_stop(machine.device("msm1"), 0);
+ borntofi_adpcm_stop(machine.device("msm2"), 1);
+ borntofi_adpcm_stop(machine.device("msm3"), 2);
+ borntofi_adpcm_stop(machine.device("msm4"), 3);
}
static MACHINE_CONFIG_START( borntofi, fantland_state )
@@ -1053,7 +1053,7 @@ MACHINE_CONFIG_END
static void wheelrun_ym3526_irqhandler( device_t *device, int state )
{
- fantland_state *driver = device->machine->driver_data<fantland_state>();
+ fantland_state *driver = device->machine().driver_data<fantland_state>();
device_set_input_line(driver->audio_cpu, INPUT_LINE_IRQ0, state);
}
diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c
index e004ba687d5..088f93c4fa1 100644
--- a/src/mame/drivers/fastfred.c
+++ b/src/mame/drivers/fastfred.c
@@ -124,25 +124,25 @@ static READ8_HANDLER( boggy84_custom_io_r )
static MACHINE_START( imago )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- gfx_element_set_source(machine->gfx[1], state->imago_sprites);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ gfx_element_set_source(machine.gfx[1], state->imago_sprites);
}
static WRITE8_HANDLER( imago_dma_irq_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, data & 1 ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, data & 1 ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_HANDLER( imago_sprites_bank_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->imago_sprites_bank = (data & 2) >> 1;
}
static WRITE8_HANDLER( imago_sprites_dma_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
- UINT8 *rom = (UINT8 *)space->machine->region("gfx2")->base();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ UINT8 *rom = (UINT8 *)space->machine().region("gfx2")->base();
UINT8 sprites_data;
sprites_data = rom[state->imago_sprites_address + 0x2000*0 + state->imago_sprites_bank * 0x1000];
@@ -154,12 +154,12 @@ static WRITE8_HANDLER( imago_sprites_dma_w )
sprites_data = rom[state->imago_sprites_address + 0x2000*2 + state->imago_sprites_bank * 0x1000];
state->imago_sprites[offset + 0x800*2] = sprites_data;
- gfx_element_mark_dirty(space->machine->gfx[1], offset/32);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/32);
}
static READ8_HANDLER( imago_sprites_offset_r )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->imago_sprites_address = offset;
return 0xff; //not really used
}
@@ -978,54 +978,54 @@ ROM_END
static DRIVER_INIT( flyboy )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc085, 0xc099, FUNC(flyboy_custom1_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc8fb, 0xc900, FUNC(flyboy_custom2_io_r));
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc085, 0xc099, FUNC(flyboy_custom1_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc8fb, 0xc900, FUNC(flyboy_custom2_io_r));
state->hardware_type = 1;
}
static DRIVER_INIT( flyboyb )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->hardware_type = 1;
}
static DRIVER_INIT( fastfred )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(fastfred_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(fastfred_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 1;
}
static DRIVER_INIT( jumpcoas )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 0;
}
static DRIVER_INIT( boggy84b )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 2;
}
static DRIVER_INIT( boggy84 )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(boggy84_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(boggy84_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 2;
}
static DRIVER_INIT( imago )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->hardware_type = 3;
}
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index a62bc7010d8..c7428edbecb 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -20,7 +20,7 @@
static INTERRUPT_GEN( fastlane_interrupt )
{
- fastlane_state *state = device->machine->driver_data<fastlane_state>();
+ fastlane_state *state = device->machine().driver_data<fastlane_state>();
if (cpu_getiloops(device) == 0)
{
@@ -36,7 +36,7 @@ static INTERRUPT_GEN( fastlane_interrupt )
static WRITE8_HANDLER( k007121_registers_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
if (offset < 8)
k007121_ctrl_w(state->k007121, offset, data);
@@ -46,14 +46,14 @@ static WRITE8_HANDLER( k007121_registers_w )
static WRITE8_HANDLER( fastlane_bankswitch_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
/* bits 0 & 1 coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bits 2 & 3 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0c) >> 2);
/* bit 4: bank # for the 007232 (chip 2) */
k007232_set_bank(state->konami2, 0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4));
@@ -201,13 +201,13 @@ static const k007232_interface k007232_interface_2 =
static MACHINE_START( fastlane )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
- state->konami2 = machine->device("konami2");
- state->k007121 = machine->device("k007121");
+ state->konami2 = machine.device("konami2");
+ state->k007121 = machine.device("k007121");
}
static MACHINE_CONFIG_START( fastlane, fastlane_state )
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index 0510f8167a6..8c707fb5160 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -36,7 +36,7 @@ inputs + notes by stephh
static INPUT_CHANGED( coin_inserted )
{
- fcombat_state *state = field->port->machine->driver_data<fcombat_state>();
+ fcombat_state *state = field->port->machine().driver_data<fcombat_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -61,9 +61,9 @@ static READ8_HANDLER( fcombat_protection_r )
static READ8_HANDLER( fcombat_port01_r )
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
/* the cocktail flip bit muxes between ports 0 and 1 */
- return state->cocktail_flip ? input_port_read(space->machine, "IN1") : input_port_read(space->machine, "IN0");
+ return state->cocktail_flip ? input_port_read(space->machine(), "IN1") : input_port_read(space->machine(), "IN0");
}
@@ -71,19 +71,19 @@ static READ8_HANDLER( fcombat_port01_r )
static WRITE8_HANDLER(e900_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sh = data;
}
static WRITE8_HANDLER(ea00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sv = (state->fcombat_sv & 0xff00) | data;
}
static WRITE8_HANDLER(eb00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sv = (state->fcombat_sv & 0xff) | (data << 8);
}
@@ -92,23 +92,23 @@ static WRITE8_HANDLER(eb00_w)
static WRITE8_HANDLER(ec00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->tx = data;
}
static WRITE8_HANDLER(ed00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->ty = data;
}
static READ8_HANDLER(e300_r)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
int wx = (state->tx + state->fcombat_sh) / 16;
int wy = (state->ty * 2 + state->fcombat_sv) / 16;
- return space->machine->region("user2")->base()[wx * 32 * 16 + wy];
+ return space->machine().region("user2")->base()[wx * 32 * 16 + wy];
}
static WRITE8_HANDLER(ee00_w)
@@ -267,9 +267,9 @@ GFXDECODE_END
static MACHINE_START( fcombat )
{
- fcombat_state *state = machine->driver_data<fcombat_state>();
+ fcombat_state *state = machine.driver_data<fcombat_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->cocktail_flip));
state->save_item(NAME(state->char_palette));
@@ -283,7 +283,7 @@ static MACHINE_START( fcombat )
static MACHINE_RESET( fcombat )
{
- fcombat_state *state = machine->driver_data<fcombat_state>();
+ fcombat_state *state = machine.driver_data<fcombat_state>();
state->cocktail_flip = 0;
state->char_palette = 0;
@@ -348,8 +348,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -366,8 +366,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ dst = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -387,8 +387,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx3")->base();
- length = machine->region("gfx3")->bytes();
+ dst = machine.region("gfx3")->base();
+ length = machine.region("gfx3")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -406,8 +406,8 @@ static DRIVER_INIT( fcombat )
}
src = temp;
- dst = machine->region("user1")->base();
- length = machine->region("user1")->bytes();
+ dst = machine.region("user1")->base();
+ length = machine.region("user1")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
@@ -418,8 +418,8 @@ static DRIVER_INIT( fcombat )
src = temp;
- dst = machine->region("user2")->base();
- length = machine->region("user2")->bytes();
+ dst = machine.region("user2")->base();
+ length = machine.region("user2")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index 567c6d1482a..17c8d5b3818 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -42,7 +42,7 @@ from 2.bin to 9.bin program eproms
static WRITE16_HANDLER( fcrash_soundlatch_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
{
@@ -53,17 +53,17 @@ static WRITE16_HANDLER( fcrash_soundlatch_w )
static WRITE8_HANDLER( fcrash_snd_bankswitch_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0);
state->msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0);
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static void m5205_int1( device_t *device )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
msm5205_data_w(device, state->sample_buffer1 & 0x0f);
state->sample_buffer1 >>= 4;
@@ -74,7 +74,7 @@ static void m5205_int1( device_t *device )
static void m5205_int2( device_t *device )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
msm5205_data_w(device, state->sample_buffer2 & 0x0f);
state->sample_buffer2 >>= 4;
@@ -84,13 +84,13 @@ static void m5205_int2( device_t *device )
static WRITE8_HANDLER( fcrash_msm5205_0_data_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->sample_buffer1 = data;
}
static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->sample_buffer2 = data;
}
@@ -99,9 +99,9 @@ static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
/* not verified */
#define CPS1_ROWSCROLL_OFFS (0x20/2) /* base of row scroll offsets in other RAM */
-static void fcrash_update_transmasks( running_machine *machine )
+static void fcrash_update_transmasks( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int i;
int priority[4];
@@ -126,9 +126,9 @@ static void fcrash_update_transmasks( running_machine *machine )
}
}
-static void fcrash_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int pos;
int base = 0x50c8 / 2;
@@ -153,15 +153,15 @@ static void fcrash_render_sprites( running_machine *machine, bitmap_t *bitmap, c
colour = state->gfxram[base +pos + 1] & 0x1f;
ypos = 256 - ypos;
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine->priority_bitmap, 0x02, 15);
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine.priority_bitmap, 0x02, 15);
}
}
-static void fcrash_render_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
+static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
@@ -176,9 +176,9 @@ static void fcrash_render_layer( running_machine *machine, bitmap_t *bitmap, con
}
}
-static void fcrash_render_high_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
@@ -193,9 +193,9 @@ static void fcrash_render_high_layer( running_machine *machine, bitmap_t *bitmap
}
}
-static void fcrash_build_palette( running_machine *machine )
+static void fcrash_build_palette( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int offset;
for (offset = 0; offset < 32 * 6 * 16; offset++)
@@ -218,22 +218,22 @@ static void fcrash_build_palette( running_machine *machine )
static SCREEN_UPDATE( fcrash )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int layercontrol, l0, l1, l2, l3;
int videocontrol = state->cps_a_regs[0x22 / 2];
- flip_screen_set(screen->machine, videocontrol & 0x8000);
+ flip_screen_set(screen->machine(), videocontrol & 0x8000);
layercontrol = state->cps_b_regs[0x20 / 2];
/* Get video memory base registers */
- cps1_get_video_base(screen->machine);
+ cps1_get_video_base(screen->machine());
/* Build palette */
- fcrash_build_palette(screen->machine);
+ fcrash_build_palette(screen->machine());
- fcrash_update_transmasks(screen->machine);
+ fcrash_update_transmasks(screen->machine());
tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x - 62);
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y);
@@ -270,28 +270,28 @@ static SCREEN_UPDATE( fcrash )
/* Blank screen */
bitmap_fill(bitmap, cliprect, 0xbff);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
l0 = (layercontrol >> 0x06) & 03;
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0);
if (l1 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0);
if (l2 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0);
if (l3 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0);
return 0;
}
@@ -299,21 +299,21 @@ static SCREEN_UPDATE( fcrash )
// doesn't have the scroll offsets like fcrash
static SCREEN_UPDATE( kodb )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int layercontrol, l0, l1, l2, l3;
int videocontrol = state->cps_a_regs[0x22 / 2];
- flip_screen_set(screen->machine, videocontrol & 0x8000);
+ flip_screen_set(screen->machine(), videocontrol & 0x8000);
layercontrol = state->cps_b_regs[0x20 / 2];
/* Get video memory base registers */
- cps1_get_video_base(screen->machine);
+ cps1_get_video_base(screen->machine());
/* Build palette */
- fcrash_build_palette(screen->machine);
+ fcrash_build_palette(screen->machine());
- fcrash_update_transmasks(screen->machine);
+ fcrash_update_transmasks(screen->machine());
tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x);
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y);
@@ -351,28 +351,28 @@ static SCREEN_UPDATE( kodb )
/* Blank screen */
bitmap_fill(bitmap, cliprect, 0xbff);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
l0 = (layercontrol >> 0x06) & 03;
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0);
if (l1 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0);
if (l2 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0);
if (l3 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0);
return 0;
}
@@ -691,15 +691,15 @@ static const msm5205_interface msm5205_interface2 =
static MACHINE_START( fcrash )
{
- cps_state *state = machine->driver_data<cps_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ cps_state *state = machine.driver_data<cps_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->msm_1 = machine->device<msm5205_device>("msm1");
- state->msm_2 = machine->device<msm5205_device>("msm2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->msm_1 = machine.device<msm5205_device>("msm1");
+ state->msm_2 = machine.device<msm5205_device>("msm2");
state->save_item(NAME(state->sample_buffer1));
state->save_item(NAME(state->sample_buffer2));
@@ -709,15 +709,15 @@ static MACHINE_START( fcrash )
static MACHINE_START( kodb )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
}
static MACHINE_RESET( fcrash )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
state->sample_buffer1 = 0;
state->sample_buffer2 = 0;
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index 022d233b90a..90307718bb0 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -84,11 +84,11 @@ static VIDEO_START( feversoc )
static SCREEN_UPDATE( feversoc )
{
- feversoc_state *state = screen->machine->driver_data<feversoc_state>();
+ feversoc_state *state = screen->machine().driver_data<feversoc_state>();
UINT32 *spriteram32 = state->spriteram;
int offs,spr_offs,colour,sx,sy,h,w,dx,dy;
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //black pen
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //black pen
for(offs=(0x2000/4)-2;offs>-1;offs-=2)
{
@@ -106,7 +106,7 @@ static SCREEN_UPDATE( feversoc )
for(dx=0;dx<w;dx++)
for(dy=0;dy<h;dy++)
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
}
return 0;
@@ -115,27 +115,27 @@ static SCREEN_UPDATE( feversoc )
static WRITE32_HANDLER( fs_paletteram_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = ((space->machine->generic.paletteram.u32[offset] & 0x001f0000)>>16) << 3;
- g = ((space->machine->generic.paletteram.u32[offset] & 0x03e00000)>>16) >> 2;
- b = ((space->machine->generic.paletteram.u32[offset] & 0x7c000000)>>16) >> 7;
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x001f0000)>>16) << 3;
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x03e00000)>>16) >> 2;
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x7c000000)>>16) >> 7;
- palette_set_color(space->machine,offset*2+0,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset*2+0,MAKE_RGB(r,g,b));
- r = (space->machine->generic.paletteram.u32[offset] & 0x001f) << 3;
- g = (space->machine->generic.paletteram.u32[offset] & 0x03e0) >> 2;
- b = (space->machine->generic.paletteram.u32[offset] & 0x7c00) >> 7;
+ r = (space->machine().generic.paletteram.u32[offset] & 0x001f) << 3;
+ g = (space->machine().generic.paletteram.u32[offset] & 0x03e0) >> 2;
+ b = (space->machine().generic.paletteram.u32[offset] & 0x7c00) >> 7;
- palette_set_color(space->machine,offset*2+1,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset*2+1,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( in0_r )
{
- feversoc_state *state = space->machine->driver_data<feversoc_state>();
+ feversoc_state *state = space->machine().driver_data<feversoc_state>();
state->x^=0x40; //vblank? eeprom read bit?
- return (input_port_read(space->machine, "IN0") | state->x) | (input_port_read(space->machine, "IN1")<<16);
+ return (input_port_read(space->machine(), "IN0") | state->x) | (input_port_read(space->machine(), "IN1")<<16);
}
static WRITE32_HANDLER( output_w )
@@ -143,19 +143,19 @@ static WRITE32_HANDLER( output_w )
if(ACCESSING_BITS_16_31)
{
/* probably eeprom stuff too */
- coin_lockout_w(space->machine, 0,~data>>16 & 0x40);
- coin_lockout_w(space->machine, 1,~data>>16 & 0x40);
- coin_counter_w(space->machine, 0,data>>16 & 1);
+ coin_lockout_w(space->machine(), 0,~data>>16 & 0x40);
+ coin_lockout_w(space->machine(), 1,~data>>16 & 0x40);
+ coin_counter_w(space->machine(), 0,data>>16 & 1);
//data>>16 & 2 coin out
- coin_counter_w(space->machine, 1,data>>16 & 4);
+ coin_counter_w(space->machine(), 1,data>>16 & 4);
//data>>16 & 8 coin hopper
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base(0x40000 * (((data>>16) & 0x20)>>5));
}
if(ACCESSING_BITS_0_15)
{
/* -xxx xxxx lamps*/
- coin_counter_w(space->machine, 2,data & 0x2000); //key in
+ coin_counter_w(space->machine(), 2,data & 0x2000); //key in
//data & 0x4000 key out
}
}
@@ -244,7 +244,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( feversoc_irq )
{
- cputag_set_input_line(device->machine, "maincpu", 8, HOLD_LINE );
+ cputag_set_input_line(device->machine(), "maincpu", 8, HOLD_LINE );
}
static MACHINE_CONFIG_START( feversoc, feversoc_state )
@@ -296,7 +296,7 @@ ROM_END
static DRIVER_INIT( feversoc )
{
- seibuspi_rise11_sprite_decrypt_feversoc(machine->region("gfx1")->base(), 0x200000);
+ seibuspi_rise11_sprite_decrypt_feversoc(machine.region("gfx1")->base(), 0x200000);
}
GAME( 2004, feversoc, 0, feversoc, feversoc, feversoc, ROT0, "Seibu Kaihatsu", "Fever Soccer", 0 )
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index 78ea5492974..142a8a4bd44 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -70,7 +70,7 @@ static PALETTE_INIT( fgoal )
static TIMER_CALLBACK( interrupt_callback )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
int scanline;
int coin = (input_port_read(machine, "IN1") & 2);
@@ -81,39 +81,39 @@ static TIMER_CALLBACK( interrupt_callback )
state->prev_coin = coin;
- scanline = machine->primary_screen->vpos() + 128;
+ scanline = machine.primary_screen->vpos() + 128;
if (scanline > 256)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback));
}
-static unsigned video_ram_address( running_machine *machine )
+static unsigned video_ram_address( running_machine &machine )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
return 0x4000 | (state->row << 5) | (state->col >> 3);
}
static READ8_HANDLER( fgoal_analog_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
- return input_port_read(space->machine, state->fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
+ return input_port_read(space->machine(), state->fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
}
static CUSTOM_INPUT( fgoal_80_r )
{
- UINT8 ret = (field->port->machine->primary_screen->vpos() & 0x80) ? 1 : 0;
+ UINT8 ret = (field->port->machine().primary_screen->vpos() & 0x80) ? 1 : 0;
return ret;
}
static READ8_HANDLER( fgoal_nmi_reset_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE);
return 0;
@@ -122,7 +122,7 @@ static READ8_HANDLER( fgoal_nmi_reset_r )
static READ8_HANDLER( fgoal_irq_reset_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -131,14 +131,14 @@ static READ8_HANDLER( fgoal_irq_reset_r )
static READ8_HANDLER( fgoal_row_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
return state->row;
}
static WRITE8_HANDLER( fgoal_row_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->row = data;
mb14241_shift_data_w(state->mb14241, 0, 0);
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( fgoal_row_w )
static WRITE8_HANDLER( fgoal_col_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->col = data;
mb14241_shift_count_w(state->mb14241, 0, data);
@@ -154,17 +154,17 @@ static WRITE8_HANDLER( fgoal_col_w )
static READ8_HANDLER( fgoal_address_hi_r )
{
- return video_ram_address(space->machine) >> 8;
+ return video_ram_address(space->machine()) >> 8;
}
static READ8_HANDLER( fgoal_address_lo_r )
{
- return video_ram_address(space->machine) & 0xff;
+ return video_ram_address(space->machine()) & 0xff;
}
static READ8_HANDLER( fgoal_shifter_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
UINT8 v = mb14241_shift_result_r(state->mb14241, 0);
return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
@@ -172,7 +172,7 @@ static READ8_HANDLER( fgoal_shifter_r )
static READ8_HANDLER( fgoal_shifter_reverse_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
UINT8 v = mb14241_shift_result_r(state->mb14241, 0);
return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7);
@@ -200,7 +200,7 @@ static WRITE8_HANDLER( fgoal_sound2_w )
/* BIT3 => SX5 */
/* BIT4 => SX4 */
/* BIT5 => SX3 */
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->fgoal_player = data & 1;
}
@@ -338,10 +338,10 @@ GFXDECODE_END
static MACHINE_START( fgoal )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
- state->maincpu = machine->device("maincpu");
- state->mb14241 = machine->device("mb14241");
+ state->maincpu = machine.device("maincpu");
+ state->mb14241 = machine.device("mb14241");
state->save_item(NAME(state->xpos));
state->save_item(NAME(state->ypos));
@@ -354,9 +354,9 @@ static MACHINE_START( fgoal )
static MACHINE_RESET( fgoal )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(interrupt_callback));
state->xpos = 0;
state->ypos = 0;
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index 7722efb2452..a493fd7a45e 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( finalizr_interrupt )
{
- finalizr_state *state = device->machine->driver_data<finalizr_state>();
+ finalizr_state *state = device->machine().driver_data<finalizr_state>();
if (cpu_getiloops(device) == 0)
{
@@ -39,28 +39,28 @@ static INTERRUPT_GEN( finalizr_interrupt )
static WRITE8_HANDLER( finalizr_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( finalizr_flipscreen_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, ~data & 0x08);
+ flip_screen_set(space->machine(), ~data & 0x08);
}
static WRITE8_HANDLER( finalizr_i8039_irq_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
device_set_input_line(state->audio_cpu, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
/* bit 0x80 goes active low, indicating that the
external IRQ being serviced is complete
@@ -73,7 +73,7 @@ static WRITE8_HANDLER( i8039_irqen_w )
static READ8_HANDLER( i8039_T1_r )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
/* I suspect the clock-out from the I8039 T0 line should be connected
here (See the i8039_T0_w handler below).
@@ -245,9 +245,9 @@ GFXDECODE_END
static MACHINE_START( finalizr )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->spriterambank));
state->save_item(NAME(state->charbank));
@@ -258,7 +258,7 @@ static MACHINE_START( finalizr )
static MACHINE_RESET( finalizr )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
state->spriterambank = 0;
state->charbank = 0;
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index ecf73582a15..3a0a522d33a 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -184,7 +184,7 @@ public:
static VIDEO_START(firebeat)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
state->gcu[0].vram = auto_alloc_array(machine, UINT32, 0x2000000/4);
state->gcu[1].vram = auto_alloc_array(machine, UINT32, 0x2000000/4);
memset(state->gcu[0].vram, 0, 0x2000000);
@@ -192,9 +192,9 @@ static VIDEO_START(firebeat)
}
-static void gcu_draw_object(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
+static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// 0x00: xxx----- -------- -------- -------- command type
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx object data address in vram
@@ -393,9 +393,9 @@ static void gcu_fill_rect(bitmap_t *bitmap, const rectangle *cliprect, UINT32 *c
}
}
-static void gcu_draw_character(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
+static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// 0x00: xxx----- -------- -------- -------- command type
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx character data address in vram
@@ -442,9 +442,9 @@ static void gcu_draw_character(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void gcu_exec_display_list(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 address)
+static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 address)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int counter = 0;
int end = 0;
@@ -515,39 +515,39 @@ static void gcu_exec_display_list(running_machine *machine, bitmap_t *bitmap, co
static SCREEN_UPDATE(firebeat)
{
- firebeat_state *state = screen->machine->driver_data<firebeat_state>();
+ firebeat_state *state = screen->machine().driver_data<firebeat_state>();
int chip;
- if (screen == screen->machine->m_devicelist.find(SCREEN, 0))
+ if (screen == screen->machine().m_devicelist.find(SCREEN, 0))
chip = 0;
else
chip = 1;
bitmap_fill(bitmap, cliprect, 0);
- if (mame_stricmp(screen->machine->system().name, "popn7") == 0)
+ if (mame_stricmp(screen->machine().system().name, "popn7") == 0)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1f80000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1f80000);
}
else
{
if (state->layer >= 2)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x8000);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x0000);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x10000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x8000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x0000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x10000);
}
else if (state->layer == 0)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x200000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x200000);
- //gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x186040);
+ //gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x186040);
}
else if (state->layer == 1)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1d0800);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1d0800);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1a9440);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1a9440);
}
}
@@ -555,7 +555,7 @@ static SCREEN_UPDATE(firebeat)
if (state->tick >= 5)
{
state->tick = 0;
- if (input_code_pressed(screen->machine, KEYCODE_0))
+ if (input_code_pressed(screen->machine(), KEYCODE_0))
{
state->layer++;
if (state->layer > 2)
@@ -565,7 +565,7 @@ static SCREEN_UPDATE(firebeat)
}
/*
- if (input_code_pressed_once(screen->machine, KEYCODE_9))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_9))
{
FILE *file = fopen("vram0.bin", "wb");
int i;
@@ -597,9 +597,9 @@ static SCREEN_UPDATE(firebeat)
return 0;
}
-static UINT32 GCU_r(running_machine *machine, int chip, UINT32 offset, UINT32 mem_mask)
+static UINT32 GCU_r(running_machine &machine, int chip, UINT32 offset, UINT32 mem_mask)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int reg = offset * 4;
/* VRAM Read */
@@ -621,14 +621,14 @@ static UINT32 GCU_r(running_machine *machine, int chip, UINT32 offset, UINT32 me
return 0xffffffff;
}
-static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data, UINT32 mem_mask)
+static void GCU_w(running_machine &machine, int chip, UINT32 offset, UINT32 data, UINT32 mem_mask)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int reg = offset * 4;
if (reg != 0x70 && chip == 0)
{
- //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine->describe_context(), chip, data, offset, mem_mask);
+ //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine.describe_context(), chip, data, offset, mem_mask);
//logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cmachine->describe_context(), hip, data, offset, mem_mask);
}
@@ -649,7 +649,7 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data
COMBINE_DATA( &state->gcu[chip].visible_area );
if (ACCESSING_BITS_0_15)
{
- screen_device *screen = downcast<screen_device *>(machine->m_devicelist.find(SCREEN, chip));
+ screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, chip));
if (screen != NULL)
{
@@ -702,22 +702,22 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data
static READ32_HANDLER(gcu0_r)
{
- return GCU_r(space->machine, 0, offset, mem_mask);
+ return GCU_r(space->machine(), 0, offset, mem_mask);
}
static WRITE32_HANDLER(gcu0_w)
{
- GCU_w(space->machine, 0, offset, data, mem_mask);
+ GCU_w(space->machine(), 0, offset, data, mem_mask);
}
static READ32_HANDLER(gcu1_r)
{
- return GCU_r(space->machine, 1, offset, mem_mask);
+ return GCU_r(space->machine(), 1, offset, mem_mask);
}
static WRITE32_HANDLER(gcu1_w)
{
- GCU_w(space->machine, 1, offset, data, mem_mask);
+ GCU_w(space->machine(), 1, offset, data, mem_mask);
}
/*****************************************************************************/
@@ -728,15 +728,15 @@ static READ32_HANDLER(input_r)
if (ACCESSING_BITS_24_31)
{
- r |= (input_port_read(space->machine, "IN0") & 0xff) << 24;
+ r |= (input_port_read(space->machine(), "IN0") & 0xff) << 24;
}
if (ACCESSING_BITS_8_15)
{
- r |= (input_port_read(space->machine, "IN1") & 0xff) << 8;
+ r |= (input_port_read(space->machine(), "IN1") & 0xff) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= (input_port_read(space->machine, "IN2") & 0xff);
+ r |= (input_port_read(space->machine(), "IN2") & 0xff);
}
return r;
@@ -746,17 +746,17 @@ static READ32_HANDLER( sensor_r )
{
if (offset == 0)
{
- return input_port_read(space->machine, "SENSOR1") | 0x01000100;
+ return input_port_read(space->machine(), "SENSOR1") | 0x01000100;
}
else
{
- return input_port_read(space->machine, "SENSOR2") | 0x01000100;
+ return input_port_read(space->machine(), "SENSOR2") | 0x01000100;
}
}
static READ32_HANDLER(flashram_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
{
@@ -779,7 +779,7 @@ static READ32_HANDLER(flashram_r)
static WRITE32_HANDLER(flashram_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->flash[0]->write((offset*4)+0, (data >> 24) & 0xff);
@@ -800,7 +800,7 @@ static WRITE32_HANDLER(flashram_w)
static READ32_HANDLER(soundflash_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
@@ -835,7 +835,7 @@ static READ32_HANDLER(soundflash_r)
static WRITE32_HANDLER(soundflash_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
{
@@ -902,12 +902,12 @@ static WRITE32_HANDLER(soundflash_w)
#define ATAPI_REG_CMDSTATUS 7
-static void atapi_cause_irq(running_machine *machine)
+static void atapi_cause_irq(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ4, ASSERT_LINE);
}
-static void atapi_clear_irq(running_machine *machine)
+static void atapi_clear_irq(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ4, CLEAR_LINE);
}
@@ -919,9 +919,9 @@ static void atapi_exit(running_machine& machine)
SCSIDeleteInstance(state->atapi_device_data[0]);
}
-static void atapi_init(running_machine *machine)
+static void atapi_init(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
memset(state->atapi_regs, 0, sizeof(state->atapi_regs));
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -936,12 +936,12 @@ static void atapi_init(running_machine *machine)
SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &state->atapi_device_data[0], "scsi0" );
// TODO: the slave drive can be either CD-ROM, DVD-ROM or HDD
SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &state->atapi_device_data[1], "scsi1" );
- machine->add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
}
-static void atapi_reset(running_machine *machine)
+static void atapi_reset(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
logerror("ATAPI reset\n");
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -955,9 +955,9 @@ static void atapi_reset(running_machine *machine)
-static UINT16 atapi_command_reg_r(running_machine *machine, int reg)
+static UINT16 atapi_command_reg_r(running_machine &machine, int reg)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int i, data;
// printf("ATAPI: Command reg read %d\n", reg);
@@ -1018,14 +1018,14 @@ static UINT16 atapi_command_reg_r(running_machine *machine, int reg)
}
}
-static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data)
+static void atapi_command_reg_w(running_machine &machine, int reg, UINT16 data)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int i;
if (reg == ATAPI_REG_DATA)
{
-// printf("%s:ATAPI: packet write %04x\n", device->machine->describe_context(), data);
+// printf("%s:ATAPI: packet write %04x\n", device->machine().describe_context(), data);
state->atapi_data[state->atapi_data_ptr] = data;
state->atapi_data_ptr++;
@@ -1175,9 +1175,9 @@ static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data)
}
}
-static UINT16 atapi_control_reg_r(running_machine *machine, int reg)
+static UINT16 atapi_control_reg_r(running_machine &machine, int reg)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
UINT16 value;
switch(reg)
{
@@ -1199,7 +1199,7 @@ static UINT16 atapi_control_reg_r(running_machine *machine, int reg)
return 0;
}
-static void atapi_control_reg_w(running_machine *machine, int reg, UINT16 data)
+static void atapi_control_reg_w(running_machine &machine, int reg, UINT16 data)
{
switch(reg)
{
@@ -1225,12 +1225,12 @@ static READ32_HANDLER( atapi_command_r )
// printf("atapi_command_r: %08X, %08X\n", offset, mem_mask);
if (ACCESSING_BITS_16_31)
{
- r = atapi_command_reg_r(space->machine, offset*2);
+ r = atapi_command_reg_r(space->machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_command_reg_r(space->machine, (offset*2) + 1);
+ r = atapi_command_reg_r(space->machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1241,11 +1241,11 @@ static WRITE32_HANDLER( atapi_command_w )
if (ACCESSING_BITS_16_31)
{
- atapi_command_reg_w(space->machine, offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
+ atapi_command_reg_w(space->machine(), offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
}
else
{
- atapi_command_reg_w(space->machine, (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
+ atapi_command_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
}
}
@@ -1257,12 +1257,12 @@ static READ32_HANDLER( atapi_control_r )
if (ACCESSING_BITS_16_31)
{
- r = atapi_control_reg_r(space->machine, offset*2);
+ r = atapi_control_reg_r(space->machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_control_reg_r(space->machine, (offset*2) + 1);
+ r = atapi_control_reg_r(space->machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1271,11 +1271,11 @@ static WRITE32_HANDLER( atapi_control_w )
{
if (ACCESSING_BITS_16_31)
{
- atapi_control_reg_w(space->machine, offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
+ atapi_control_reg_w(space->machine(), offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
}
else
{
- atapi_control_reg_w(space->machine, (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
+ atapi_control_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
}
}
@@ -1326,7 +1326,7 @@ static WRITE32_HANDLER( comm_uart_w )
}
}
-static void comm_uart_irq_callback(running_machine *machine, int channel, int value)
+static void comm_uart_irq_callback(running_machine &machine, int channel, int value)
{
// TODO
//cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ2, ASSERT_LINE);
@@ -1340,7 +1340,7 @@ static const int ppd_cab_data[2] = { 0x1, 0x9 };
static READ32_HANDLER( cabinet_r )
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
// printf("cabinet_r: %08X, %08X\n", offset, mem_mask);
@@ -1366,11 +1366,11 @@ static READ32_HANDLER( keyboard_wheel_r )
{
if (offset == 0) // Keyboard Wheel (P1)
{
- return input_port_read(space->machine, "WHEEL_P1") << 24;
+ return input_port_read(space->machine(), "WHEEL_P1") << 24;
}
else if (offset == 2) // Keyboard Wheel (P2)
{
- return input_port_read(space->machine, "WHEEL_P2") << 24;
+ return input_port_read(space->machine(), "WHEEL_P2") << 24;
}
return 0;
@@ -1396,9 +1396,9 @@ static WRITE32_HANDLER( midi_uart_w )
}
}
-static void midi_uart_irq_callback(running_machine *machine, int channel, int value)
+static void midi_uart_irq_callback(running_machine &machine, int channel, int value)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
if (channel == 0)
{
if ((state->extend_board_irq_enable & 0x02) == 0 && value != CLEAR_LINE)
@@ -1452,7 +1452,7 @@ static const int keyboard_notes[24] =
static TIMER_CALLBACK( keyboard_timer_callback )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
static const int kb_uart_channel[2] = { 1, 0 };
static const char *const keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
int keyboard;
@@ -1505,7 +1505,7 @@ static TIMER_CALLBACK( keyboard_timer_callback )
static READ32_HANDLER( extend_board_irq_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1518,7 +1518,7 @@ static READ32_HANDLER( extend_board_irq_r)
static WRITE32_HANDLER( extend_board_irq_w )
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
// printf("extend_board_irq_w: %08X, %08X, %08X\n", data, offset, mem_mask);
if (ACCESSING_BITS_24_31)
@@ -1672,7 +1672,7 @@ static WRITE32_HANDLER( lamp_output3_ppp_w )
static READ32_HANDLER(ppc_spu_share_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1697,7 +1697,7 @@ static READ32_HANDLER(ppc_spu_share_r)
static WRITE32_HANDLER(ppc_spu_share_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->spu_shared_ram[(offset * 4) + 0] = (data >> 24) & 0xff;
@@ -1719,13 +1719,13 @@ static WRITE32_HANDLER(ppc_spu_share_w)
#ifdef UNUSED_FUNCTION
static READ16_HANDLER(m68k_spu_share_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
return state->spu_shared_ram[offset] << 8;
}
static WRITE16_HANDLER(m68k_spu_share_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
state->spu_shared_ram[offset] = (data >> 8) & 0xff;
}
#endif
@@ -1739,16 +1739,16 @@ static READ16_HANDLER(spu_unk_r)
static MACHINE_START( firebeat )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->work_ram);
- state->flash[0] = machine->device<fujitsu_29f016a_device>("flash0");
- state->flash[1] = machine->device<fujitsu_29f016a_device>("flash1");
- state->flash[2] = machine->device<fujitsu_29f016a_device>("flash2");
+ state->flash[0] = machine.device<fujitsu_29f016a_device>("flash0");
+ state->flash[1] = machine.device<fujitsu_29f016a_device>("flash1");
+ state->flash[2] = machine.device<fujitsu_29f016a_device>("flash2");
}
static ADDRESS_MAP_START( firebeat_map, AS_PROGRAM, 32 )
@@ -1784,7 +1784,7 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( soundram_r )
{
- firebeat_state *state = device->machine->driver_data<firebeat_state>();
+ firebeat_state *state = device->machine().driver_data<firebeat_state>();
if (offset >= 0 && offset < 0x200000)
{
return state->flash[1]->read(offset & 0x1fffff);
@@ -1954,10 +1954,10 @@ static INTERRUPT_GEN(firebeat_interrupt)
static MACHINE_RESET( firebeat )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
void *cd;
int i;
- UINT8 *sound = machine->region("ymz")->base();
+ UINT8 *sound = machine.region("ymz")->base();
for (i=0; i < 0x200000; i++)
{
@@ -1966,7 +1966,7 @@ static MACHINE_RESET( firebeat )
}
SCSIGetDevice( state->atapi_device_data[1], &cd );
- cdda_set_cdrom(machine->device("cdda"), cd);
+ cdda_set_cdrom(machine.device("cdda"), cd);
}
static MACHINE_CONFIG_START( firebeat, firebeat_state )
@@ -2109,9 +2109,9 @@ static void set_ibutton(firebeat_state *state, UINT8 *data)
}
}
-static int ibutton_w(running_machine *machine, UINT8 data)
+static int ibutton_w(running_machine &machine, UINT8 data)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int r = -1;
switch (state->ibutton_state)
@@ -2203,28 +2203,28 @@ static int ibutton_w(running_machine *machine, UINT8 data)
static void security_w(device_t *device, UINT8 data)
{
- int r = ibutton_w(device->machine, data);
+ int r = ibutton_w(device->machine(), data);
if (r >= 0)
- ppc4xx_spu_receive_byte(device->machine->device("maincpu"), r);
+ ppc4xx_spu_receive_byte(device->machine().device("maincpu"), r);
}
/*****************************************************************************/
-static void init_lights(running_machine *machine, write32_space_func out1, write32_space_func out2, write32_space_func out3)
+static void init_lights(running_machine &machine, write32_space_func out1, write32_space_func out2, write32_space_func out3)
{
if(!out1) out1 = lamp_output_w;
if(!out2) out1 = lamp_output2_w;
if(!out3) out1 = lamp_output3_w;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000804, 0x7d000807, FUNC(out1));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000320, 0x7d000323, FUNC(out2));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000324, 0x7d000327, FUNC(out3));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000804, 0x7d000807, FUNC(out1));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000320, 0x7d000323, FUNC(out2));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000324, 0x7d000327, FUNC(out3));
}
-static void init_firebeat(running_machine *machine)
+static void init_firebeat(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
- UINT8 *rom = machine->region("user2")->base();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
+ UINT8 *rom = machine.region("user2")->base();
atapi_init(machine);
@@ -2236,7 +2236,7 @@ static void init_firebeat(running_machine *machine)
state->cur_cab_data = cab_data;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), security_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), security_w);
set_ibutton(state, rom);
@@ -2251,24 +2251,24 @@ static DRIVER_INIT(ppp)
static DRIVER_INIT(ppd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
init_firebeat(machine);
init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
state->cur_cab_data = ppd_cab_data;
}
-static void init_keyboard(running_machine *machine)
+static void init_keyboard(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// set keyboard timer
- state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(keyboard_timer_callback));
+ state->keyboard_timer = machine.scheduler().timer_alloc(FUNC(keyboard_timer_callback));
state->keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10));
}
static DRIVER_INIT(kbm)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
init_firebeat(machine);
init_lights(machine, lamp_output_kbm_w, NULL, NULL);
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 7734a87f9d7..92af885ed31 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -89,7 +89,7 @@ fffe=reset e7cc
*/
static READ8_HANDLER( firefox_disc_status_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
UINT8 result = 0xff;
result ^= 0x20;
@@ -105,7 +105,7 @@ static READ8_HANDLER( firefox_disc_status_r )
/* this reset RDDSK (&DSKRD) */
static READ8_HANDLER( firefox_disc_data_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
return state->m_n_disc_read_data;
}
@@ -113,31 +113,31 @@ static READ8_HANDLER( firefox_disc_data_r )
/* 4218 - DSKREAD, set RDDSK */
static WRITE8_HANDLER( firefox_disc_read_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_read_data = laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER( firefox_disc_lock_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_lock = data & 0x80;
}
static WRITE8_HANDLER( audio_enable_w )
{
- space->machine->device<laserdisc_sound_device>("ldsound")->set_output_gain(~offset & 1, (data & 0x80) ? 1.0 : 0.0);
+ space->machine().device<laserdisc_sound_device>("ldsound")->set_output_gain(~offset & 1, (data & 0x80) ? 1.0 : 0.0);
}
static WRITE8_HANDLER( firefox_disc_reset_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
/* active low on dbb7 */
static WRITE8_HANDLER( firefox_disc_write_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
if ( ( data & 0x80 ) == 0 )
laserdisc_data_w(state->laserdisc, state->m_n_disc_data);
}
@@ -145,7 +145,7 @@ static WRITE8_HANDLER( firefox_disc_write_w )
/* latch the data */
static WRITE8_HANDLER( firefox_disc_data_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_data = data;
}
@@ -160,14 +160,14 @@ static WRITE8_HANDLER( firefox_disc_data_w )
static TILE_GET_INFO( bgtile_get_info )
{
- firefox_state *state = machine->driver_data<firefox_state>();
+ firefox_state *state = machine.driver_data<firefox_state>();
SET_TILE_INFO(0, state->tileram[tile_index], 0, 0);
}
static WRITE8_HANDLER( tileram_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->tileram[offset] = data;
tilemap_mark_tile_dirty(state->bgtiles, offset);
}
@@ -175,20 +175,20 @@ static WRITE8_HANDLER( tileram_w )
static VIDEO_START( firefox )
{
- firefox_state *state = machine->driver_data<firefox_state>();
+ firefox_state *state = machine.driver_data<firefox_state>();
state->bgtiles = tilemap_create(machine, bgtile_get_info, tilemap_scan_rows, 8,8, 64,64);
tilemap_set_transparent_pen(state->bgtiles, 0);
- tilemap_set_scrolldy(state->bgtiles, machine->primary_screen->visible_area().min_y, 0);
+ tilemap_set_scrolldy(state->bgtiles, machine.primary_screen->visible_area().min_y, 0);
}
static SCREEN_UPDATE( firefox )
{
- firefox_state *state = screen->machine->driver_data<firefox_state>();
+ firefox_state *state = screen->machine().driver_data<firefox_state>();
int sprite;
int gfxtop = screen->visible_area().min_y;
- bitmap_fill( bitmap, cliprect, palette_get_color(screen->machine, 256) );
+ bitmap_fill( bitmap, cliprect, palette_get_color(screen->machine(), 256) );
for( sprite = 0; sprite < 32; sprite++ )
{
@@ -208,7 +208,7 @@ static SCREEN_UPDATE( firefox )
int flipx = flags & 0x20;
int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) );
- drawgfx_transpen( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
+ drawgfx_transpen( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
}
}
}
@@ -220,12 +220,12 @@ static SCREEN_UPDATE( firefox )
static TIMER_DEVICE_CALLBACK( video_timer_callback )
{
- timer.machine->primary_screen->update_now();
+ timer.machine().primary_screen->update_now();
- cputag_set_input_line( timer.machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE );
+ cputag_set_input_line( timer.machine(), "maincpu", M6809_IRQ_LINE, ASSERT_LINE );
}
-static void set_rgba( running_machine *machine, int start, int index, unsigned char *palette_ram )
+static void set_rgba( running_machine &machine, int start, int index, unsigned char *palette_ram )
{
int r = palette_ram[ index ];
int g = palette_ram[ index + 256 ];
@@ -237,21 +237,21 @@ static void set_rgba( running_machine *machine, int start, int index, unsigned c
static WRITE8_HANDLER( tile_palette_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->tile_palette[ offset ] = data;
- set_rgba( space->machine, 0, offset & 0xff, state->tile_palette );
+ set_rgba( space->machine(), 0, offset & 0xff, state->tile_palette );
}
static WRITE8_HANDLER( sprite_palette_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sprite_palette[ offset ] = data;
- set_rgba( space->machine, 256, offset & 0xff, state->sprite_palette );
+ set_rgba( space->machine(), 256, offset & 0xff, state->sprite_palette );
}
static WRITE8_HANDLER( firefox_objram_bank_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sprite_bank = data & 0x03;
}
@@ -265,49 +265,49 @@ static WRITE8_HANDLER( firefox_objram_bank_w )
static CUSTOM_INPUT( mainflag_r )
{
- firefox_state *state = field->port->machine->driver_data<firefox_state>();
+ firefox_state *state = field->port->machine().driver_data<firefox_state>();
return state->main_to_sound_flag;
}
static CUSTOM_INPUT( soundflag_r )
{
- firefox_state *state = field->port->machine->driver_data<firefox_state>();
+ firefox_state *state = field->port->machine().driver_data<firefox_state>();
return state->sound_to_main_flag;
}
static READ8_HANDLER( sound_to_main_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sound_to_main_flag = 0;
return soundlatch2_r(space, 0);
}
static WRITE8_HANDLER( main_to_sound_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->main_to_sound_flag = 1;
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( sound_reset_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
+ firefox_state *state = space->machine().driver_data<firefox_state>();
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
if ((data & 0x80) != 0)
state->sound_to_main_flag = state->main_to_sound_flag = 0;
}
static READ8_HANDLER( main_to_sound_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->main_to_sound_flag = 0;
return soundlatch_r(space, 0);
}
static WRITE8_HANDLER( sound_to_main_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sound_to_main_flag = 1;
soundlatch2_w(space, 0, data);
}
@@ -322,7 +322,7 @@ static WRITE8_HANDLER( sound_to_main_w )
static READ8_DEVICE_HANDLER( riot_porta_r )
{
- firefox_state *state = device->machine->driver_data<firefox_state>();
+ firefox_state *state = device->machine().driver_data<firefox_state>();
/* bit 7 = MAINFLAG */
/* bit 6 = SOUNDFLAG */
/* bit 5 = PA5 */
@@ -337,7 +337,7 @@ static READ8_DEVICE_HANDLER( riot_porta_r )
static WRITE8_DEVICE_HANDLER( riot_porta_w )
{
- device_t *tms = device->machine->device("tms");
+ device_t *tms = device->machine().device("tms");
/* handle 5220 read */
tms5220_rsq_w(tms, (data>>1) & 1);
@@ -348,7 +348,7 @@ static WRITE8_DEVICE_HANDLER( riot_porta_w )
static WRITE_LINE_DEVICE_HANDLER( riot_irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -361,18 +361,18 @@ static WRITE_LINE_DEVICE_HANDLER( riot_irq )
static READ8_HANDLER( adc_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
if( state->control_num == 0 )
{
- return input_port_read( space->machine, "PITCH" );
+ return input_port_read( space->machine(), "PITCH" );
}
- return input_port_read( space->machine, "YAW" );
+ return input_port_read( space->machine(), "YAW" );
}
static WRITE8_HANDLER( adc_select_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->control_num = offset;
}
@@ -386,27 +386,27 @@ static WRITE8_HANDLER( adc_select_w )
static WRITE8_HANDLER( nvram_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->write(*space, offset, data >> 4);
state->nvram_1d->write(*space, offset, data & 0xf);
}
static READ8_HANDLER( nvram_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
return (state->nvram_1c->read(*space, offset) << 4) | (state->nvram_1d->read(*space, offset) & 0x0f);
}
static WRITE8_HANDLER( novram_recall_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->recall(data & 0x80);
state->nvram_1d->recall(data & 0x80);
}
static WRITE8_HANDLER( novram_store_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->store(data & 0x80);
state->nvram_1d->store(data & 0x80);
}
@@ -421,22 +421,22 @@ static WRITE8_HANDLER( novram_store_w )
static WRITE8_HANDLER( rom_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( main_irq_clear_w )
{
- cputag_set_input_line( space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", M6809_IRQ_LINE, CLEAR_LINE );
}
static WRITE8_HANDLER( main_firq_clear_w )
{
- cputag_set_input_line( space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE );
}
static WRITE8_HANDLER( self_reset_w )
{
- cputag_set_input_line( space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE );
}
@@ -449,12 +449,12 @@ static WRITE8_HANDLER( self_reset_w )
static WRITE8_HANDLER( led_w )
{
- set_led_status( space->machine, offset, ( data & 0x80 ) == 0 );
+ set_led_status( space->machine(), offset, ( data & 0x80 ) == 0 );
}
static WRITE8_HANDLER( firefox_coin_counter_w )
{
- coin_counter_w( space->machine, offset, data & 0x80 );
+ coin_counter_w( space->machine(), offset, data & 0x80 );
}
@@ -462,18 +462,18 @@ static WRITE8_HANDLER( firefox_coin_counter_w )
static void firq_gen(device_t *device, int state)
{
if (state)
- cputag_set_input_line( device->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
+ cputag_set_input_line( device->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
}
static MACHINE_START( firefox )
{
- firefox_state *state = machine->driver_data<firefox_state>();
- memory_configure_bank(machine, "bank1", 0, 32, machine->region("maincpu")->base() + 0x10000, 0x1000);
- state->nvram_1c = machine->device<x2212_device>("nvram_1c");
- state->nvram_1d = machine->device<x2212_device>("nvram_1d");
+ firefox_state *state = machine.driver_data<firefox_state>();
+ memory_configure_bank(machine, "bank1", 0, 32, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ state->nvram_1c = machine.device<x2212_device>("nvram_1c");
+ state->nvram_1d = machine.device<x2212_device>("nvram_1d");
- state->laserdisc = machine->device("laserdisc");
+ state->laserdisc = machine.device("laserdisc");
vp931_set_data_ready_callback(state->laserdisc, firq_gen);
state->control_num = 0;
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index 38d2776f3d5..a3908fc775e 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -179,13 +179,13 @@ Stephh's notes (based on the games Z80 code and some tests) :
static WRITE8_HANDLER( firetrap_nmi_disable_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->nmi_enable = ~data & 1;
}
static WRITE8_HANDLER( firetrap_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static READ8_HANDLER( firetrap_8751_bootleg_r )
@@ -193,9 +193,9 @@ static READ8_HANDLER( firetrap_8751_bootleg_r )
/* Check for coin insertion */
/* the following only works in the bootleg version, which doesn't have an */
/* 8751 - the real thing is much more complicated than that. */
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
UINT8 coin = 0;
- UINT8 port = input_port_read(space->machine, "IN2") & 0x70;
+ UINT8 port = input_port_read(space->machine(), "IN2") & 0x70;
if (cpu_get_pc(space->cpu) == 0x1188)
return ~state->coin_command_pending;
@@ -217,7 +217,7 @@ static READ8_HANDLER( firetrap_8751_bootleg_r )
static READ8_HANDLER( firetrap_8751_r )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
//logerror("PC:%04x read from 8751\n",cpu_get_pc(space->cpu));
return state->i8751_return;
}
@@ -244,7 +244,7 @@ static WRITE8_HANDLER( firetrap_8751_w )
};
static const int i8751_coin_data[]={ 0x00, 0xb7 };
static const int i8751_36_data[]={ 0x00, 0xbc };
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
/* End of command - important to note, as coin input is supressed while commands are pending */
if (data == 0x26)
@@ -308,26 +308,26 @@ static WRITE8_HANDLER( firetrap_8751_w )
static WRITE8_HANDLER( firetrap_sound_command_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( firetrap_sound_2400_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
msm5205_reset_w(state->msm, ~data & 0x01);
state->irq_enable = data & 0x02;
}
static WRITE8_HANDLER( firetrap_sound_bankselect_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x01);
+ memory_set_bank(space->machine(), "bank2", data & 0x01);
}
static void firetrap_adpcm_int( device_t *device )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -339,13 +339,13 @@ static void firetrap_adpcm_int( device_t *device )
static WRITE8_HANDLER( firetrap_adpcm_data_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->msm5205next = data;
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
@@ -576,9 +576,9 @@ static const msm5205_interface msm5205_config =
static INTERRUPT_GEN( firetrap )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
UINT8 coin = 0;
- UINT8 port = input_port_read(device->machine, "COIN") & 0x07;
+ UINT8 port = input_port_read(device->machine(), "COIN") & 0x07;
/* Check for coin IRQ */
if (cpu_getiloops(device))
@@ -613,7 +613,7 @@ static INTERRUPT_GEN( firetrap )
static INTERRUPT_GEN( bootleg )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
if (state->nmi_enable)
device_set_input_line (device, INPUT_LINE_NMI, PULSE_LINE);
@@ -622,13 +622,13 @@ static INTERRUPT_GEN( bootleg )
static MACHINE_START( firetrap )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SOUND = machine->region("audiocpu")->base();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SOUND = machine.region("audiocpu")->base();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->msm = machine->device("msm");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->msm = machine.device("msm");
memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x10000], 0x4000);
memory_configure_bank(machine, "bank2", 0, 2, &SOUND[0x10000], 0x4000);
@@ -650,7 +650,7 @@ static MACHINE_START( firetrap )
static MACHINE_RESET( firetrap )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
int i;
for (i = 0; i < 2; i++)
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index e65b51d0ddd..dc554be0623 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -14,35 +14,35 @@ Atari Fire Truck + Super Bug + Monte Carlo driver
-static void set_service_mode(running_machine *machine, int enable)
+static void set_service_mode(running_machine &machine, int enable)
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
state->in_service_mode = enable;
/* watchdog is disabled during service mode */
watchdog_enable(machine, !enable);
/* change CPU clock speed according to service switch change */
- machine->device("maincpu")->set_unscaled_clock(enable ? (MASTER_CLOCK/12) : (MASTER_CLOCK/16));
+ machine.device("maincpu")->set_unscaled_clock(enable ? (MASTER_CLOCK/12) : (MASTER_CLOCK/16));
}
static INPUT_CHANGED( service_mode_switch_changed )
{
- set_service_mode(field->port->machine, newval);
+ set_service_mode(field->port->machine(), newval);
}
static INPUT_CHANGED( firetrk_horn_changed )
{
- device_t *discrete = field->port->machine->device("discrete");
+ device_t *discrete = field->port->machine().device("discrete");
discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval);
}
static INPUT_CHANGED( gear_changed )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
if (newval)
state->gear = (FPTR)param;
}
@@ -50,7 +50,7 @@ static INPUT_CHANGED( gear_changed )
static INTERRUPT_GEN( firetrk_interrupt )
{
- firetrk_state *state = device->machine->driver_data<firetrk_state>();
+ firetrk_state *state = device->machine().driver_data<firetrk_state>();
/* NMI interrupts are disabled during service mode in firetrk and montecar */
if (!state->in_service_mode)
@@ -62,7 +62,7 @@ static TIMER_CALLBACK( periodic_callback )
{
int scanline = param;
- generic_pulse_irq_line(machine->device("maincpu"), 0);
+ generic_pulse_irq_line(machine.device("maincpu"), 0);
/* IRQs are generated by inverse 16V signal */
scanline += 32;
@@ -70,34 +70,34 @@ static TIMER_CALLBACK( periodic_callback )
if (scanline > 262)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
}
static WRITE8_HANDLER( firetrk_output_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START1 LAMP */
- set_led_status(space->machine, 0, !(data & 0x01));
+ set_led_status(space->machine(), 0, !(data & 0x01));
/* BIT1 => START2 LAMP */
- set_led_status(space->machine, 1, !(data & 0x02));
+ set_led_status(space->machine(), 1, !(data & 0x02));
/* BIT2 => FLASH */
state->flash = data & 0x04;
/* BIT3 => TRACK LAMP */
- set_led_status(space->machine, 3, !(data & 0x08));
+ set_led_status(space->machine(), 3, !(data & 0x08));
/* BIT4 => ATTRACT */
discrete_sound_w(discrete, FIRETRUCK_ATTRACT_EN, data & 0x10);
- coin_lockout_w(space->machine, 0, !(data & 0x10));
- coin_lockout_w(space->machine, 1, !(data & 0x10));
+ coin_lockout_w(space->machine(), 0, !(data & 0x10));
+ coin_lockout_w(space->machine(), 1, !(data & 0x10));
/* BIT5 => START3 LAMP */
- set_led_status(space->machine, 2, !(data & 0x20));
+ set_led_status(space->machine(), 2, !(data & 0x20));
/* BIT6 => UNUSED */
@@ -108,34 +108,34 @@ static WRITE8_HANDLER( firetrk_output_w )
static WRITE8_HANDLER( superbug_output_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START LAMP */
- set_led_status(space->machine, 0, offset & 0x01);
+ set_led_status(space->machine(), 0, offset & 0x01);
/* BIT1 => ATTRACT */
discrete_sound_w(discrete, SUPERBUG_ATTRACT_EN, offset & 0x02);
- coin_lockout_w(space->machine, 0, !(offset & 0x02));
- coin_lockout_w(space->machine, 1, !(offset & 0x02));
+ coin_lockout_w(space->machine(), 0, !(offset & 0x02));
+ coin_lockout_w(space->machine(), 1, !(offset & 0x02));
/* BIT2 => FLASH */
state->flash = offset & 0x04;
/* BIT3 => TRACK LAMP */
- set_led_status(space->machine, 1, offset & 0x08);
+ set_led_status(space->machine(), 1, offset & 0x08);
}
static WRITE8_HANDLER( montecar_output_1_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START LAMP */
- set_led_status(space->machine, 0, !(data & 0x01));
+ set_led_status(space->machine(), 0, !(data & 0x01));
/* BIT1 => TRACK LAMP */
- set_led_status(space->machine, 1, !(data & 0x02));
+ set_led_status(space->machine(), 1, !(data & 0x02));
/* BIT2 => ATTRACT */
discrete_sound_w(discrete, MONTECAR_ATTRACT_INV, data & 0x04);
@@ -144,20 +144,20 @@ static WRITE8_HANDLER( montecar_output_1_w )
/* BIT4 => UNUSED */
/* BIT5 => COIN3 COUNTER */
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
/* BIT6 => COIN2 COUNTER */
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x40);
/* BIT7 => COIN1 COUNTER */
- coin_counter_w(space->machine, 2, data & 0x20);
+ coin_counter_w(space->machine(), 2, data & 0x20);
}
static WRITE8_HANDLER( montecar_output_2_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
state->flash = data & 0x80;
@@ -170,14 +170,14 @@ static MACHINE_RESET( firetrk )
{
set_service_mode(machine, 0);
- machine->scheduler().synchronize(FUNC(periodic_callback));
+ machine.scheduler().synchronize(FUNC(periodic_callback));
}
static READ8_HANDLER( firetrk_dip_r )
{
- UINT8 val0 = input_port_read(space->machine, "DIP_0");
- UINT8 val1 = input_port_read(space->machine, "DIP_1");
+ UINT8 val0 = input_port_read(space->machine(), "DIP_0");
+ UINT8 val1 = input_port_read(space->machine(), "DIP_1");
if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
@@ -188,8 +188,8 @@ static READ8_HANDLER( firetrk_dip_r )
static READ8_HANDLER( montecar_dip_r )
{
- UINT8 val0 = input_port_read(space->machine, "DIP_0");
- UINT8 val1 = input_port_read(space->machine, "DIP_1");
+ UINT8 val0 = input_port_read(space->machine(), "DIP_0");
+ UINT8 val1 = input_port_read(space->machine(), "DIP_1");
if (val1 & (1 << (3 - offset))) val0 |= 1;
if (val1 & (1 << (7 - offset))) val0 |= 2;
@@ -200,21 +200,21 @@ static READ8_HANDLER( montecar_dip_r )
static CUSTOM_INPUT( steer_dir_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return state->steer_dir[(FPTR)param];
}
static CUSTOM_INPUT( steer_flag_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return state->steer_flag[(FPTR)param];
}
static CUSTOM_INPUT( skid_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
UINT32 ret;
int which = (FPTR)param;
@@ -229,7 +229,7 @@ static CUSTOM_INPUT( skid_r )
static CUSTOM_INPUT( crash_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
UINT32 ret;
int which = (FPTR)param;
@@ -244,20 +244,20 @@ static CUSTOM_INPUT( crash_r )
static CUSTOM_INPUT( gear_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return (state->gear == (FPTR)param) ? 1 : 0;
}
static READ8_HANDLER( firetrk_input_r )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
int i;
/* update steering wheels */
for (i = 0; i < 2; i++)
{
- UINT32 new_dial = input_port_read_safe(space->machine, (i ? "STEER_2" : "STEER_1"), 0);
+ UINT32 new_dial = input_port_read_safe(space->machine(), (i ? "STEER_2" : "STEER_1"), 0);
INT32 delta = new_dial - state->dial[i];
if (delta != 0)
@@ -269,15 +269,15 @@ static READ8_HANDLER( firetrk_input_r )
}
}
- return ((input_port_read_safe(space->machine, "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
- ((input_port_read_safe(space->machine, "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
- ((input_port_read_safe(space->machine, "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
+ return ((input_port_read_safe(space->machine(), "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
+ ((input_port_read_safe(space->machine(), "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
+ ((input_port_read_safe(space->machine(), "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
}
static READ8_HANDLER( montecar_input_r )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
UINT8 ret = firetrk_input_r(space, offset);
if (state->crash[0])
@@ -293,14 +293,14 @@ static READ8_HANDLER( montecar_input_r )
static WRITE8_HANDLER( blink_on_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
*state->blink = TRUE;
}
static WRITE8_HANDLER( montecar_car_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[0] = 0;
state->skid[0] = 0;
}
@@ -308,7 +308,7 @@ static WRITE8_HANDLER( montecar_car_reset_w )
static WRITE8_HANDLER( montecar_drone_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[1] = 0;
state->skid[1] = 0;
}
@@ -316,7 +316,7 @@ static WRITE8_HANDLER( montecar_drone_reset_w )
static WRITE8_HANDLER( steer_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->steer_flag[0] = 1;
state->steer_flag[1] = 1;
}
@@ -324,7 +324,7 @@ static WRITE8_HANDLER( steer_reset_w )
static WRITE8_HANDLER( crash_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[0] = 0;
state->crash[1] = 0;
}
diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c
index 4dae28e6fea..2944498a225 100644
--- a/src/mame/drivers/fitfight.c
+++ b/src/mame/drivers/fitfight.c
@@ -90,14 +90,14 @@ Stephh's notes :
static READ16_HANDLER(fitfight_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = state->fof_700000_data;
return (data << 2);
}
static READ16_HANDLER(histryma_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = (state->fof_700000_data & 0x00AA);
data |= ((state->fof_700000_data & 0x0055) >> 2);
return (data);
@@ -105,7 +105,7 @@ static READ16_HANDLER(histryma_700000_r)
static READ16_HANDLER(bbprot_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = 0;
data = (state->fof_700000_data & 0x000b);
data |= ((state->fof_700000_data & 0x01d0) >> 2);
@@ -116,7 +116,7 @@ static READ16_HANDLER(bbprot_700000_r)
static WRITE16_HANDLER(fitfight_700000_w)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
COMBINE_DATA(&state->fof_700000[offset]); // needed for scrolling
if (data < 0x0200) // to avoid considering writes of 0x0200
@@ -219,19 +219,19 @@ ADDRESS_MAP_END
static READ8_HANDLER(snd_porta_r)
{
//mame_printf_debug("PA R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER(snd_portb_r)
{
//mame_printf_debug("PB R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER(snd_portc_r)
{
//mame_printf_debug("PC R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER(snd_porta_w)
@@ -719,14 +719,14 @@ GFXDECODE_END
static MACHINE_START( fitfight )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->save_item(NAME(state->fof_700000_data));
}
static MACHINE_RESET( fitfight )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->fof_700000_data = 0;
}
@@ -975,25 +975,25 @@ ROM_END
static DRIVER_INIT( fitfight )
{
-// UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
// mem16[0x0165B2/2] = 0x4e71; // for now so it boots
- fitfight_state *state = machine->driver_data<fitfight_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(fitfight_700000_r));
+ fitfight_state *state = machine.driver_data<fitfight_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(fitfight_700000_r));
state->bbprot_kludge = 0;
}
static DRIVER_INIT( histryma )
{
-// UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
// mem16[0x017FDC/2] = 0x4e71; // for now so it boots
- fitfight_state *state = machine->driver_data<fitfight_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(histryma_700000_r));
+ fitfight_state *state = machine.driver_data<fitfight_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(histryma_700000_r));
state->bbprot_kludge = 0;
}
static DRIVER_INIT( bbprot )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->bbprot_kludge = 1;
}
diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c
index e60e615e33a..2e0620d77dc 100644
--- a/src/mame/drivers/flkatck.c
+++ b/src/mame/drivers/flkatck.c
@@ -22,7 +22,7 @@
static INTERRUPT_GEN( flkatck_interrupt )
{
- flkatck_state *state = device->machine->driver_data<flkatck_state>();
+ flkatck_state *state = device->machine().driver_data<flkatck_state>();
if (state->irq_enabled)
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
@@ -31,12 +31,12 @@ static INTERRUPT_GEN( flkatck_interrupt )
static WRITE8_HANDLER( flkatck_bankswitch_w )
{
/* bits 3-4: coin counters */
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
/* bits 0-1: bank # */
if ((data & 0x03) != 0x03) /* for safety */
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static READ8_HANDLER( flkatck_ls138_r )
@@ -47,13 +47,13 @@ static READ8_HANDLER( flkatck_ls138_r )
{
case 0x00:
if (offset & 0x02)
- data = input_port_read(space->machine, (offset & 0x01) ? "COIN" : "DSW3");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "COIN" : "DSW3");
else
- data = input_port_read(space->machine, (offset & 0x01) ? "P2" : "P1");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "P2" : "P1");
break;
case 0x01:
if (offset & 0x02)
- data = input_port_read(space->machine, (offset & 0x01) ? "DSW1" : "DSW2");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "DSW1" : "DSW2");
break;
}
@@ -62,7 +62,7 @@ static READ8_HANDLER( flkatck_ls138_r )
static WRITE8_HANDLER( flkatck_ls138_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
switch ((offset & 0x1c) >> 2)
{
@@ -84,13 +84,13 @@ static WRITE8_HANDLER( flkatck_ls138_w )
/* Protection - an external multiplyer connected to the sound CPU */
static READ8_HANDLER( multiply_r )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
return (state->multiply_reg[0] * state->multiply_reg[1]) & 0xff;
}
static WRITE8_HANDLER( multiply_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
state->multiply_reg[offset] = data;
}
@@ -197,13 +197,13 @@ static const k007232_interface k007232_config =
static MACHINE_START( flkatck )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121 = machine->device("k007121");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121 = machine.device("k007121");
state->save_item(NAME(state->irq_enabled));
state->save_item(NAME(state->multiply_reg));
@@ -212,9 +212,9 @@ static MACHINE_START( flkatck )
static MACHINE_RESET( flkatck )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
- k007232_set_bank(machine->device("konami"), 0, 1);
+ k007232_set_bank(machine.device("konami"), 0, 1);
state->irq_enabled = 0;
state->multiply_reg[0] = 0;
diff --git a/src/mame/drivers/flower.c b/src/mame/drivers/flower.c
index 303045ae6e1..aa9a95f1781 100644
--- a/src/mame/drivers/flower.c
+++ b/src/mame/drivers/flower.c
@@ -78,30 +78,30 @@ CHIP # POSITION TYPE
static WRITE8_HANDLER( flower_irq_ack )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( sn_irq_enable_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
*state->sn_irq_enable = data;
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static INTERRUPT_GEN( sn_irq )
{
- flower_state *state = device->machine->driver_data<flower_state>();
+ flower_state *state = device->machine().driver_data<flower_state>();
if ((*state->sn_irq_enable & 1) == 1)
device_set_input_line(device, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_command_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
soundlatch_w(space, 0, data);
if ((*state->sn_nmi_enable & 1) == 1)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( flower_cpu1_2, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index fc045ff49b4..b2d1e3e9574 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -20,27 +20,27 @@
static READ8_HANDLER( from_snd_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->snd_flag = 0;
return state->snd_data;
}
static READ8_HANDLER( snd_flag_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
return state->snd_flag | 0xfd;
}
static WRITE8_HANDLER( to_main_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->snd_data = data;
state->snd_flag = 2;
}
static TIMER_CALLBACK( nmi_callback )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -50,19 +50,19 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -125,7 +125,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( victnine_mcu_status_bit01_r )
{
- flstory_state *state = field->port->machine->driver_data<flstory_state>();
+ flstory_state *state = field->port->machine().driver_data<flstory_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
return (victnine_mcu_status_r(space, 0) & 3);
@@ -161,7 +161,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( rumba_mcu_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//printf("PC=%04x R %02x\n",cpu_get_pc(space->cpu),state->mcu_cmd);
if((state->mcu_cmd & 0xf0) == 0x00) // end packet cmd, value returned is meaningless (probably used for main <-> mcu comms syncronization)
@@ -213,7 +213,7 @@ static READ8_HANDLER( rumba_mcu_r )
static WRITE8_HANDLER( rumba_mcu_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//if((state->mcu_cmd & 0xf0) == 0xc0)
// printf("%02x ",data);
@@ -370,7 +370,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int i;
double db = 0.0;
@@ -395,7 +395,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl0 = data & 0xff;
// popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -411,7 +411,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_DEVICE_HANDLER( sound_control_1_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl1 = data & 0xff;
// popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -425,7 +425,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_1_w )
static WRITE8_DEVICE_HANDLER( sound_control_2_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
int i;
state->snd_ctrl2 = data & 0xff;
@@ -439,7 +439,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_2_w )
static WRITE8_DEVICE_HANDLER( sound_control_3_w ) /* unknown */
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl3 = data & 0xff;
// popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -1014,11 +1014,11 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( flstory )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
/* video */
state->save_item(NAME(state->char_bank));
@@ -1054,7 +1054,7 @@ static MACHINE_START( flstory )
static MACHINE_RESET( flstory )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
MACHINE_RESET_CALL(ta7630);
@@ -1266,7 +1266,7 @@ MACHINE_CONFIG_END
static MACHINE_RESET( rumba )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
MACHINE_RESET_CALL(flstory);
state->mcu_cmd = 0;
}
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index f2482a59fc3..756a8e80709 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -55,7 +55,7 @@ static TILEMAP_MAPPER( flyball_get_memory_offset )
static TILE_GET_INFO( flyball_get_tile_info )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
UINT8 data = state->playfield_ram[tile_index];
int flags = ((data & 0x40) ? TILE_FLIPX : 0) | ((data & 0x80) ? TILE_FLIPY : 0);
int code = data & 63;
@@ -71,14 +71,14 @@ static TILE_GET_INFO( flyball_get_tile_info )
static VIDEO_START( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
state->tmap = tilemap_create(machine, flyball_get_tile_info, flyball_get_memory_offset, 8, 16, 32, 16);
}
static SCREEN_UPDATE( flyball )
{
- flyball_state *state = screen->machine->driver_data<flyball_state>();
+ flyball_state *state = screen->machine().driver_data<flyball_state>();
int pitcherx = state->pitcher_horz;
int pitchery = state->pitcher_vert - 31;
@@ -94,7 +94,7 @@ static SCREEN_UPDATE( flyball )
tilemap_draw(bitmap, cliprect, state->tmap, 0, 0);
/* draw pitcher */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], state->pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], state->pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
/* draw ball */
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( flyball )
static TIMER_CALLBACK( flyball_joystick_callback )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int potsense = param;
if (potsense & ~state->potmask)
@@ -123,7 +123,7 @@ static TIMER_CALLBACK( flyball_joystick_callback )
static TIMER_CALLBACK( flyball_quarter_callback )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int scanline = param;
int potsense[64], i;
@@ -136,12 +136,12 @@ static TIMER_CALLBACK( flyball_quarter_callback )
for (i = 0; i < 64; i++)
if (potsense[i] != 0)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline + i), FUNC(flyball_joystick_callback), potsense[i]);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline + i), FUNC(flyball_joystick_callback), potsense[i]);
scanline += 0x40;
scanline &= 0xff;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(flyball_quarter_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(flyball_quarter_callback), scanline);
state->potsense = 0;
state->potmask = 0;
@@ -157,53 +157,53 @@ static TIMER_CALLBACK( flyball_quarter_callback )
/* two physical buttons (start game and stop runner) share the same port bit */
static READ8_HANDLER( flyball_input_r )
{
- return input_port_read(space->machine, "IN0") & input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN0") & input_port_read(space->machine(), "IN1");
}
static READ8_HANDLER( flyball_scanline_r )
{
- return space->machine->primary_screen->vpos() & 0x3f;
+ return space->machine().primary_screen->vpos() & 0x3f;
}
static READ8_HANDLER( flyball_potsense_r )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
return state->potsense & ~state->potmask;
}
static WRITE8_HANDLER( flyball_potmask_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->potmask |= data & 0xf;
}
static WRITE8_HANDLER( flyball_pitcher_pic_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_pic = data & 0xf;
}
static WRITE8_HANDLER( flyball_ball_vert_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->ball_vert = data;
}
static WRITE8_HANDLER( flyball_ball_horz_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->ball_horz = data;
}
static WRITE8_HANDLER( flyball_pitcher_vert_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_vert = data;
}
static WRITE8_HANDLER( flyball_pitcher_horz_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_horz = data;
}
@@ -214,7 +214,7 @@ static WRITE8_HANDLER( flyball_misc_w )
switch (offset)
{
case 0:
- set_led_status(space->machine, 0, bit);
+ set_led_status(space->machine(), 0, bit);
break;
case 1:
/* crowd very loud */
@@ -361,9 +361,9 @@ static PALETTE_INIT( flyball )
static MACHINE_START( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->pitcher_vert));
state->save_item(NAME(state->pitcher_horz));
@@ -376,18 +376,18 @@ static MACHINE_START( flyball )
static MACHINE_RESET( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int i;
/* address bits 0 through 8 are inverted */
- UINT8* ROM = machine->region("maincpu")->base() + 0x2000;
+ UINT8* ROM = machine.region("maincpu")->base() + 0x2000;
for (i = 0; i < 0x1000; i++)
state->rombase[i] = ROM[i ^ 0x1ff];
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(flyball_quarter_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(flyball_quarter_callback));
state->pitcher_vert = 0;
state->pitcher_horz = 0;
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index c1e15d08f61..0caeb5a03a4 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -91,7 +91,7 @@
static WRITE16_HANDLER( nvram_recall_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
state->m_nvram->recall(0);
state->m_nvram->recall(1);
state->m_nvram->recall(0);
@@ -105,9 +105,9 @@ static WRITE16_HANDLER( nvram_recall_w )
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state && state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -124,7 +124,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
mystery yet */
/* INT 1 is on 32V */
- atarigen_scanline_int_gen(timer.machine->device("maincpu"));
+ atarigen_scanline_int_gen(timer.machine().device("maincpu"));
/* advance to the next interrupt */
scanline += 64;
@@ -132,13 +132,13 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
scanline = 0;
/* set a timer for it */
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( foodf )
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
atarigen_init(machine);
state->save_item(NAME(state->whichport));
}
@@ -146,10 +146,10 @@ static MACHINE_START( foodf )
static MACHINE_RESET( foodf )
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
atarigen_interrupt_reset(state, update_interrupts);
- timer_device *scan_timer = machine->device<timer_device>("scan_timer");
- scan_timer->adjust(machine->primary_screen->time_until_pos(0));
+ timer_device *scan_timer = machine.device<timer_device>("scan_timer");
+ scan_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -162,7 +162,7 @@ static MACHINE_RESET( foodf )
static WRITE8_HANDLER( digital_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
foodf_set_flip(state, data & 0x01);
state->m_nvram->store(data & 0x02);
@@ -175,8 +175,8 @@ static WRITE8_HANDLER( digital_w )
output_set_led_value(0, (data >> 4) & 1);
output_set_led_value(1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 6) & 1);
- coin_counter_w(space->machine, 1, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 7) & 1);
}
@@ -190,15 +190,15 @@ static WRITE8_HANDLER( digital_w )
static READ16_HANDLER( analog_r )
{
static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
- return input_port_read(space->machine, portnames[state->whichport]);
+ return input_port_read(space->machine(), portnames[state->whichport]);
}
static WRITE16_HANDLER( analog_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
state->whichport = offset ^ 3;
}
@@ -330,7 +330,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER( pot_r )
{
- return (input_port_read(device->machine, "DSW") >> offset) << 7;
+ return (input_port_read(device->machine(), "DSW") >> offset) << 7;
}
static const pokey_interface pokey_config =
diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c
index 09e5af5f779..c13f24d0ab5 100644
--- a/src/mame/drivers/forte2.c
+++ b/src/mame/drivers/forte2.c
@@ -71,13 +71,13 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER(forte2_ay8910_read_input)
{
- forte2_state *state = device->machine->driver_data<forte2_state>();
- return input_port_read(device->machine, "IN0") | (state->input_mask&0x3f);
+ forte2_state *state = device->machine().driver_data<forte2_state>();
+ return input_port_read(device->machine(), "IN0") | (state->input_mask&0x3f);
}
static WRITE8_DEVICE_HANDLER( forte2_ay8910_set_input_mask )
{
- forte2_state *state = device->machine->driver_data<forte2_state>();
+ forte2_state *state = device->machine().driver_data<forte2_state>();
/* PSG reg 15, writes 0 at coin insert, 0xff at boot and game over */
state->input_mask = data;
}
@@ -93,7 +93,7 @@ static const ay8910_interface forte2_ay8910_interface =
};
-static void vdp_interrupt(running_machine *machine, int i)
+static void vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line(machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
@@ -113,14 +113,14 @@ static STATE_POSTLOAD ( forte2 )
static MACHINE_START( forte2 )
{
- forte2_state *state = machine->driver_data<forte2_state>();
+ forte2_state *state = machine.driver_data<forte2_state>();
TMS9928A_configure(&tms9928a_interface);
state->input_mask = 0xff;
/* register for save states */
state_save_register_global(machine, state->input_mask);
- machine->state().register_postload(forte2, NULL);
+ machine.state().register_postload(forte2, NULL);
}
static MACHINE_RESET( forte2 )
@@ -130,7 +130,7 @@ static MACHINE_RESET( forte2 )
static INTERRUPT_GEN( pesadelo_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
@@ -161,8 +161,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT(pesadelo)
{
int i;
- UINT8 *mem = machine->region("maincpu")->base();
- int memsize = machine->region("maincpu")->bytes();
+ UINT8 *mem = machine.region("maincpu")->base();
+ int memsize = machine.region("maincpu")->bytes();
UINT8 *buf;
// data swap
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index b19f67a67d3..5419ec31a2f 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -49,7 +49,7 @@ static VIDEO_START(fortecar)
static SCREEN_UPDATE(fortecar)
{
- fortecar_state *state = screen->machine->driver_data<fortecar_state>();
+ fortecar_state *state = screen->machine().driver_data<fortecar_state>();
int x,y,count;
count = 0;
@@ -62,7 +62,7 @@ static SCREEN_UPDATE(fortecar)
tile = (state->ram[(count*4)+1] | (state->ram[(count*4)+2]<<8)) & 0xfff;
color = state->ram[(count*4)+3] & 3;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,color,0,0,x*8,y*8);
count++;
}
@@ -80,7 +80,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
static READ8_DEVICE_HANDLER( ppi0_portc_r )
{
-// popmessage("%s",device->machine->describe_context());
+// popmessage("%s",device->machine().describe_context());
return (~(eeprom_read_bit(device)<<1) & 2);
}
@@ -254,7 +254,7 @@ GFXDECODE_END
static MACHINE_RESET(fortecar)
{
- fortecar_state *state = machine->driver_data<fortecar_state>();
+ fortecar_state *state = machine.driver_data<fortecar_state>();
state->bank = -1;
}
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 17b0548708b..a0a7727971d 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -46,49 +46,49 @@ static WRITE8_HANDLER( flipscreen_w )
{
/* flip Y/X could be the other way round... */
if (offset)
- flip_screen_y_set(space->machine, ~data & 1);
+ flip_screen_y_set(space->machine(), ~data & 1);
else
- flip_screen_x_set(space->machine, ~data & 1);
+ flip_screen_x_set(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, offset, ~data & 1);
+ coin_counter_w(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( spinner_select_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->spinner = data & 1;
}
static READ8_HANDLER( spinner_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
- return input_port_read(space->machine, state->spinner ? "IN3" : "IN2");
+ freekick_state *state = space->machine().driver_data<freekick_state>();
+ return input_port_read(space->machine(), state->spinner ? "IN3" : "IN2");
}
static WRITE8_HANDLER( pbillrd_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->nmi_en = data & 1;
}
static INTERRUPT_GEN( freekick_irqgen )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
if (state->nmi_en)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( oigas_5_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
if (data > 0xc0 && data < 0xe0)
state->cnt = 1;
@@ -101,7 +101,7 @@ static WRITE8_HANDLER( oigas_5_w )
static READ8_HANDLER( oigas_3_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
switch (++state->cnt)
{
case 2: return ~(state->inval >> 8);
@@ -144,13 +144,13 @@ static READ8_HANDLER( oigas_2_r )
static READ8_HANDLER( freekick_ff_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
return state->ff_data;
}
static WRITE8_HANDLER( freekick_ff_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->ff_data = data;
}
@@ -513,20 +513,20 @@ INPUT_PORTS_END
static WRITE8_DEVICE_HANDLER( snd_rom_addr_l_w )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
state->romaddr = (state->romaddr & 0xff00) | data;
}
static WRITE8_DEVICE_HANDLER( snd_rom_addr_h_w )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
state->romaddr = (state->romaddr & 0x00ff) | (data << 8);
}
static READ8_DEVICE_HANDLER( snd_rom_r )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
- return device->machine->region("user1")->base()[state->romaddr & 0x7fff];
+ freekick_state *state = device->machine().driver_data<freekick_state>();
+ return device->machine().region("user1")->base()[state->romaddr & 0x7fff];
}
static const ppi8255_interface ppi8255_intf[2] =
@@ -596,7 +596,7 @@ GFXDECODE_END
static MACHINE_START( freekick )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->save_item(NAME(state->romaddr));
state->save_item(NAME(state->spinner));
@@ -606,7 +606,7 @@ static MACHINE_START( freekick )
static MACHINE_RESET( freekick )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->romaddr = 0;
state->spinner = 0;
@@ -616,14 +616,14 @@ static MACHINE_RESET( freekick )
static MACHINE_START( pbillrd )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
MACHINE_START_CALL(freekick);
}
static MACHINE_START( oigas )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->save_item(NAME(state->inval));
state->save_item(NAME(state->outval));
@@ -634,7 +634,7 @@ static MACHINE_START( oigas )
static MACHINE_RESET( oigas )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
MACHINE_RESET_CALL(freekick);
@@ -1108,8 +1108,8 @@ ROM_END
static DRIVER_INIT(gigasb)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0xbfff, machine->region("maincpu")->base() + 0x10000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0xbfff, machine.region("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index de34b2bc2aa..6c70996c412 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( fromanc2_interrupt )
static WRITE16_HANDLER( fromanc2_sndcmd_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
soundlatch_w(space, offset, (data >> 8) & 0xff); // 1P (LEFT)
soundlatch2_w(space, offset, data & 0xff); // 2P (RIGHT)
@@ -50,21 +50,21 @@ static WRITE16_HANDLER( fromanc2_sndcmd_w )
static WRITE16_HANDLER( fromanc2_portselect_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->portselect = data;
}
static READ16_HANDLER( fromanc2_keymatrix_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 ret;
switch (state->portselect)
{
- case 0x01: ret = input_port_read(space->machine, "KEY0"); break;
- case 0x02: ret = input_port_read(space->machine, "KEY1"); break;
- case 0x04: ret = input_port_read(space->machine, "KEY2"); break;
- case 0x08: ret = input_port_read(space->machine, "KEY3"); break;
+ case 0x01: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 0x02: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 0x04: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 0x08: ret = input_port_read(space->machine(), "KEY3"); break;
default: ret = 0xffff;
logerror("PC:%08X unknown %02X\n", cpu_get_pc(space->cpu), state->portselect);
break;
@@ -75,46 +75,46 @@ static READ16_HANDLER( fromanc2_keymatrix_r )
static CUSTOM_INPUT( subcpu_int_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->subcpu_int_flag & 0x01;
}
static CUSTOM_INPUT( sndcpu_nmi_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->sndcpu_nmi_flag & 0x01;
}
static CUSTOM_INPUT( subcpu_nmi_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->subcpu_nmi_flag & 0x01;
}
static WRITE16_HANDLER( fromanc2_eeprom_w )
{
if (ACCESSING_BITS_8_15)
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
static WRITE16_HANDLER( fromancr_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- fromancr_gfxbank_w(space->machine, data & 0xfff8);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ fromancr_gfxbank_w(space->machine(), data & 0xfff8);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
static WRITE16_HANDLER( fromanc4_eeprom_w )
{
if (ACCESSING_BITS_0_7)
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
static WRITE16_HANDLER( fromanc2_subcpu_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch1 = data;
device_set_input_line(state->subcpu, 0, HOLD_LINE);
@@ -123,7 +123,7 @@ static WRITE16_HANDLER( fromanc2_subcpu_w )
static READ16_HANDLER( fromanc2_subcpu_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, PULSE_LINE);
state->subcpu_nmi_flag = 0;
@@ -132,13 +132,13 @@ static READ16_HANDLER( fromanc2_subcpu_r )
static READ8_HANDLER( fromanc2_maincpu_r_l )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->datalatch1 & 0x00ff;
}
static READ8_HANDLER( fromanc2_maincpu_r_h )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->subcpu_int_flag = 1;
return (state->datalatch1 & 0xff00) >> 8;
@@ -146,25 +146,25 @@ static READ8_HANDLER( fromanc2_maincpu_r_h )
static WRITE8_HANDLER( fromanc2_maincpu_w_l )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch_2l = data;
}
static WRITE8_HANDLER( fromanc2_maincpu_w_h )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch_2h = data;
}
static WRITE8_HANDLER( fromanc2_subcpu_nmi_clr )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->subcpu_nmi_flag = 1;
}
static READ8_HANDLER( fromanc2_sndcpu_nmi_clr )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->sndcpu_nmi_flag = 1;
return 0xff;
@@ -173,10 +173,10 @@ static READ8_HANDLER( fromanc2_sndcpu_nmi_clr )
static WRITE8_HANDLER( fromanc2_subcpu_rombank_w )
{
// Change ROM BANK
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
// Change RAM BANK
- memory_set_bank(space->machine, "bank2", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank2", (data & 0x0c) >> 2);
}
@@ -497,7 +497,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- fromanc2_state *state = device->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = device->machine().driver_data<fromanc2_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -515,13 +515,13 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( fromanc4 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->eeprom = machine->device("eeprom");
- state->left_screen = machine->device("lscreen");
- state->right_screen = machine->device("rscreen");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->eeprom = machine.device("eeprom");
+ state->left_screen = machine.device("lscreen");
+ state->right_screen = machine.device("rscreen");
state->save_item(NAME(state->portselect));
state->save_item(NAME(state->sndcpu_nmi_flag));
@@ -534,11 +534,11 @@ static MACHINE_START( fromanc4 )
static MACHINE_START( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("sub")->base(), 0x4000);
- memory_configure_bank(machine, "bank2", 0, 1, machine->region("sub")->base() + 0x08000, 0x4000);
- memory_configure_bank(machine, "bank2", 1, 3, machine->region("sub")->base() + 0x14000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("sub")->base(), 0x4000);
+ memory_configure_bank(machine, "bank2", 0, 1, machine.region("sub")->base() + 0x08000, 0x4000);
+ memory_configure_bank(machine, "bank2", 1, 3, machine.region("sub")->base() + 0x14000, 0x4000);
MACHINE_START_CALL(fromanc4);
@@ -548,7 +548,7 @@ static MACHINE_START( fromanc2 )
static MACHINE_RESET( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->portselect = 0;
state->datalatch1 = 0;
@@ -828,7 +828,7 @@ ROM_END
static DRIVER_INIT( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->subcpu_nmi_flag = 1;
state->subcpu_int_flag = 1;
state->sndcpu_nmi_flag = 1;
@@ -836,7 +836,7 @@ static DRIVER_INIT( fromanc2 )
static DRIVER_INIT( fromanc4 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->sndcpu_nmi_flag = 1;
}
diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c
index 8bbb27fd74b..fdf171c8876 100644
--- a/src/mame/drivers/fromance.c
+++ b/src/mame/drivers/fromance.c
@@ -55,14 +55,14 @@ Memo:
static READ8_HANDLER( fromance_commanddata_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
return state->commanddata;
}
static TIMER_CALLBACK( deferred_commanddata_w )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
state->commanddata = param;
state->directionflag = 1;
}
@@ -71,16 +71,16 @@ static TIMER_CALLBACK( deferred_commanddata_w )
static WRITE8_HANDLER( fromance_commanddata_w )
{
/* do this on a timer to let the slave CPU synchronize */
- space->machine->scheduler().synchronize(FUNC(deferred_commanddata_w), data);
+ space->machine().scheduler().synchronize(FUNC(deferred_commanddata_w), data);
}
static READ8_HANDLER( fromance_busycheck_main_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
if (!state->directionflag)
return 0x00; // standby
@@ -91,7 +91,7 @@ static READ8_HANDLER( fromance_busycheck_main_r )
static READ8_HANDLER( fromance_busycheck_sub_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
if (state->directionflag)
return 0xff; // standby
@@ -102,7 +102,7 @@ static READ8_HANDLER( fromance_busycheck_sub_r )
static WRITE8_HANDLER( fromance_busycheck_sub_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->directionflag = 0;
}
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( fromance_busycheck_sub_w )
static WRITE8_HANDLER( fromance_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
@@ -129,7 +129,7 @@ static WRITE8_HANDLER( fromance_rombank_w )
static WRITE8_DEVICE_HANDLER( fromance_adpcm_reset_w )
{
- fromance_state *state = device->machine->driver_data<fromance_state>();
+ fromance_state *state = device->machine().driver_data<fromance_state>();
state->adpcm_reset = (data & 0x01);
state->vclk_left = 0;
@@ -139,7 +139,7 @@ static WRITE8_DEVICE_HANDLER( fromance_adpcm_reset_w )
static WRITE8_HANDLER( fromance_adpcm_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->adpcm_data = data;
state->vclk_left = 2;
}
@@ -147,7 +147,7 @@ static WRITE8_HANDLER( fromance_adpcm_w )
static void fromance_adpcm_int( device_t *device )
{
- fromance_state *state = device->machine->driver_data<fromance_state>();
+ fromance_state *state = device->machine().driver_data<fromance_state>();
/* skip if we're reset */
if (!state->adpcm_reset)
@@ -176,26 +176,26 @@ static void fromance_adpcm_int( device_t *device )
static WRITE8_HANDLER( fromance_portselect_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->portselect = data;
}
static READ8_HANDLER( fromance_keymatrix_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
int ret = 0xff;
if (state->portselect & 0x01)
- ret &= input_port_read(space->machine, "KEY1");
+ ret &= input_port_read(space->machine(), "KEY1");
if (state->portselect & 0x02)
- ret &= input_port_read(space->machine, "KEY2");
+ ret &= input_port_read(space->machine(), "KEY2");
if (state->portselect & 0x04)
- ret &= input_port_read(space->machine, "KEY3");
+ ret &= input_port_read(space->machine(), "KEY3");
if (state->portselect & 0x08)
- ret &= input_port_read(space->machine, "KEY4");
+ ret &= input_port_read(space->machine(), "KEY4");
if (state->portselect & 0x10)
- ret &= input_port_read(space->machine, "KEY5");
+ ret &= input_port_read(space->machine(), "KEY5");
return ret;
}
@@ -960,12 +960,12 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( fromance )
{
- fromance_state *state = machine->driver_data<fromance_state>();
- UINT8 *ROM = machine->region("sub")->base();
+ fromance_state *state = machine.driver_data<fromance_state>();
+ UINT8 *ROM = machine.region("sub")->base();
memory_configure_bank(machine, "bank1", 0, 0x100, &ROM[0x10000], 0x4000);
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->directionflag));
state->save_item(NAME(state->commanddata));
@@ -980,7 +980,7 @@ static MACHINE_START( fromance )
static MACHINE_RESET( fromance )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
int i;
state->directionflag = 0;
diff --git a/src/mame/drivers/funkybee.c b/src/mame/drivers/funkybee.c
index 30e59f2f779..8514644e95b 100644
--- a/src/mame/drivers/funkybee.c
+++ b/src/mame/drivers/funkybee.c
@@ -80,12 +80,12 @@ Stephh's notes (based on the games Z80 code and some tests) :
static READ8_HANDLER( funkybee_input_port_0_r )
{
watchdog_reset_r(space, 0);
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static WRITE8_HANDLER( funkybee_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static ADDRESS_MAP_START( funkybee_map, AS_PROGRAM, 8 )
@@ -280,14 +280,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( funkybee )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
state->save_item(NAME(state->gfx_bank));
}
static MACHINE_RESET( funkybee )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
state->gfx_bank = 0;
}
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index cff39ae0e12..249cefa3029 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -277,7 +277,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- funkyjet_state *driver_state = device->machine->driver_data<funkyjet_state>();
+ funkyjet_state *driver_state = device->machine().driver_data<funkyjet_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -299,11 +299,11 @@ static const deco16ic_interface funkyjet_deco16ic_tilegen1_intf =
static MACHINE_START( funkyjet )
{
- funkyjet_state *state = machine->driver_data<funkyjet_state>();
+ funkyjet_state *state = machine.driver_data<funkyjet_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( funkyjet, funkyjet_state )
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index 946e207c968..fb8de6a9f52 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -764,8 +764,8 @@ static WRITE8_DEVICE_HANDLER(funworld_lamp_a_w)
output_set_lamp_value(3, (data >> 7) & 1); /* button hold4/high */
output_set_lamp_value(5, 1-((data >> 5) & 1)); /* button 6 (collect/cancel) */
- coin_counter_w(device->machine, 0, data & 0x01); /* credit in counter */
- coin_counter_w(device->machine, 7, data & 0x04); /* credit out counter, mapped as coin 8 */
+ coin_counter_w(device->machine(), 0, data & 0x01); /* credit in counter */
+ coin_counter_w(device->machine(), 7, data & 0x04); /* credit out counter, mapped as coin 8 */
// popmessage("Lamps A: %02X", data);
}
@@ -810,7 +810,7 @@ static UINT8 funquiz_question_bank = 0x80;
static READ8_HANDLER( questions_r )
{
- UINT8* quiz = space->machine->region("questions")->base();
+ UINT8* quiz = space->machine().region("questions")->base();
int extraoffset = ((funquiz_question_bank & 0x1f) * 0x8000);
// if 0x80 is set, read the 2nd half of the question rom (contains header info)
@@ -4049,7 +4049,7 @@ static DRIVER_INIT( tabblue )
*****************************************************************************************************/
int x, na, nb, nad, nbd;
- UINT8 *src = machine->region( "gfx1" )->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
for (x=0x0000; x < 0x10000; x++)
@@ -4079,7 +4079,7 @@ static DRIVER_INIT( magicd2a )
******************************************************************/
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xc1c6] = 0x92;
}
@@ -4088,8 +4088,8 @@ static DRIVER_INIT( magicd2b )
/*** same as blue TAB PCB, with the magicd2a patch ***/
{
int x, na, nb, nad, nbd;
- UINT8 *src = machine->region( "gfx1" )->base();
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (x=0x0000; x < 0x10000; x++)
{
@@ -4108,7 +4108,7 @@ static DRIVER_INIT( magicd2b )
static DRIVER_INIT( soccernw )
{
/* temporary patch to avoid hardware errors for debug purposes */
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x80b2] = 0xa9;
ROM[0x80b3] = 0x00;
@@ -4143,16 +4143,16 @@ static DRIVER_INIT( saloon )
*************************************************/
{
- UINT8 *rom = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0x8000;
- UINT8 *gfxrom = machine->region("gfx1")->base();
- int sizeg = machine->region("gfx1")->bytes();
+ UINT8 *gfxrom = machine.region("gfx1")->base();
+ int sizeg = machine.region("gfx1")->bytes();
int startg = 0;
- UINT8 *prom = machine->region("proms")->base();
- int sizep = machine->region("proms")->bytes();
+ UINT8 *prom = machine.region("proms")->base();
+ int sizep = machine.region("proms")->bytes();
int startp = 0;
UINT8 *buffer;
@@ -4237,8 +4237,8 @@ static DRIVER_INIT( multiwin )
******************************************************/
{
- UINT8 *ROM = machine->region("maincpu")->base();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4256,7 +4256,7 @@ static DRIVER_INIT( multiwin )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x8000, 0xffff, machine->region("maincpu")->base() + 0x18000);
+ space->set_decrypted_region(0x8000, 0xffff, machine.region("maincpu")->base() + 0x18000);
}
static DRIVER_INIT( royalcdc )
@@ -4270,8 +4270,8 @@ static DRIVER_INIT( royalcdc )
******************************************************/
- UINT8 *ROM = machine->region("maincpu")->base();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4309,7 +4309,7 @@ static DRIVER_INIT( royalcdc )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x6000, 0xffff, machine->region("maincpu")->base() + 0x16000);
+ space->set_decrypted_region(0x6000, 0xffff, machine.region("maincpu")->base() + 0x16000);
}
diff --git a/src/mame/drivers/funybubl.c b/src/mame/drivers/funybubl.c
index 61574426ea1..69f6becc097 100644
--- a/src/mame/drivers/funybubl.c
+++ b/src/mame/drivers/funybubl.c
@@ -56,18 +56,18 @@ Note: SW2, SW3 & SW4 not populated
static WRITE8_HANDLER ( funybubl_vidram_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER ( funybubl_cpurombank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x3f); // should we add a check that (data&0x3f) < #banks?
+ memory_set_bank(space->machine(), "bank2", data & 0x3f); // should we add a check that (data&0x3f) < #banks?
}
static WRITE8_HANDLER( funybubl_soundcommand_w )
{
- funybubl_state *state = space->machine->driver_data<funybubl_state>();
+ funybubl_state *state = space->machine().driver_data<funybubl_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -202,10 +202,10 @@ GFXDECODE_END
static MACHINE_START( funybubl )
{
- funybubl_state *state = machine->driver_data<funybubl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ funybubl_state *state = machine.driver_data<funybubl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->banked_vram));
diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c
index 445dd28643a..f83165ae04e 100644
--- a/src/mame/drivers/fuukifg2.c
+++ b/src/mame/drivers/fuukifg2.c
@@ -53,26 +53,26 @@ To Do:
static WRITE16_HANDLER( fuuki16_vregs_w )
{
- fuuki16_state *state = space->machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = space->machine().driver_data<fuuki16_state>();
UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
if ((offset == 0x1c/2) && old_data != new_data)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
- attotime period = space->machine->primary_screen->frame_period();
- state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period);
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
+ attotime period = space->machine().primary_screen->frame_period();
+ state->raster_interrupt_timer->adjust(space->machine().primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period);
}
}
static WRITE16_HANDLER( fuuki16_sound_command_w )
{
- fuuki16_state *state = space->machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = space->machine().driver_data<fuuki16_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space,0,data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
// device_spin_until_time(space->cpu, attotime::from_usec(50)); // Allow the other CPU to reply
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters
}
}
@@ -106,7 +106,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( fuuki16_sound_rombank_w )
{
if (data <= 2)
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
else
logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(space->cpu), data);
}
@@ -376,7 +376,7 @@ GFXDECODE_END
static void soundirq( device_t *device, int state )
{
- fuuki16_state *fuuki16 = device->machine->driver_data<fuuki16_state>();
+ fuuki16_state *fuuki16 = device->machine().driver_data<fuuki16_state>();
device_set_input_line(fuuki16->audiocpu, 0, state);
}
@@ -399,51 +399,51 @@ static const ym3812_interface fuuki16_ym3812_intf =
static TIMER_CALLBACK( level_1_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
}
static TIMER_CALLBACK( raster_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
- state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ state->raster_interrupt_timer->adjust(machine.primary_screen->frame_period());
}
static MACHINE_START( fuuki16 )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x8000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
- state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC(raster_interrupt_callback));
+ state->raster_interrupt_timer = machine.scheduler().timer_alloc(FUNC(raster_interrupt_callback));
}
static MACHINE_RESET( fuuki16 )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
- state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ state->raster_interrupt_timer->adjust(machine.primary_screen->time_until_pos(0, visarea.max_x + 1));
}
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index cf00569c337..6bb6cf40dad 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -157,7 +157,7 @@ FG-3J ROM-J 507KA0301P04 Rev:1.3
static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if(ACCESSING_BITS_16_31)
{
int r,g,b;
@@ -167,7 +167,7 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
g = (state->paletteram[offset] & 0x03e00000) >> (5 + 16);
b = (state->paletteram[offset] & 0x001f0000) >> (0 + 16);
- palette_set_color_rgb(space->machine, offset * 2, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2, pal5bit(r), pal5bit(g), pal5bit(b));
}
if(ACCESSING_BITS_0_15)
@@ -179,7 +179,7 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
g = (state->paletteram[offset] & 0x000003e0) >> (5);
b = (state->paletteram[offset] & 0x0000001f) >> (0);
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -194,14 +194,14 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
/* Sound comms */
static READ32_HANDLER( snd_020_r )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
UINT32 retdata = state->shared_ram[offset * 2] << 16 | state->shared_ram[(offset * 2) + 1];
return retdata;
}
static WRITE32_HANDLER( snd_020_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if (ACCESSING_BITS_16_23)
state->shared_ram[offset * 2] = data >> 16;
@@ -212,16 +212,16 @@ static WRITE32_HANDLER( snd_020_w )
static WRITE32_HANDLER( fuuki32_vregs_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if (state->vregs[offset] != data)
{
COMBINE_DATA(&state->vregs[offset]);
if (offset == 0x1c / 4)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
- attotime period = space->machine->primary_screen->frame_period();
- state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period);
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
+ attotime period = space->machine().primary_screen->frame_period();
+ state->raster_interrupt_timer->adjust(space->machine().primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period);
}
}
}
@@ -269,19 +269,19 @@ ADDRESS_MAP_END
static WRITE8_HANDLER ( fuuki32_sound_bw_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
static READ8_HANDLER( snd_z80_r )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
UINT8 retdata = state->shared_ram[offset];
return retdata;
}
static WRITE8_HANDLER( snd_z80_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
state->shared_ram[offset] = data;
}
@@ -485,40 +485,40 @@ GFXDECODE_END
static TIMER_CALLBACK( level_1_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
}
static TIMER_CALLBACK( raster_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
- state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ state->raster_interrupt_timer->adjust(machine.primary_screen->frame_period());
}
static MACHINE_START( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x3e, &ROM[0x10000], 0x8000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
- state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC(raster_interrupt_callback));
+ state->raster_interrupt_timer = machine.scheduler().timer_alloc(FUNC(raster_interrupt_callback));
state->save_item(NAME(state->spr_buffered_tilebank));
state->save_item(NAME(state->shared_ram));
@@ -527,18 +527,18 @@ static MACHINE_START( fuuki32 )
static MACHINE_RESET( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
- state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ state->raster_interrupt_timer->adjust(machine.primary_screen->time_until_pos(0, visarea.max_x + 1));
}
static void irqhandler( device_t *device, int irq )
{
- fuuki32_state *state = device->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = device->machine().driver_data<fuuki32_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c
index 2a68fcabeb5..bfc7ca426c2 100644
--- a/src/mame/drivers/gaelco.c
+++ b/src/mame/drivers/gaelco.c
@@ -23,7 +23,7 @@
static WRITE16_HANDLER( bigkarnk_sound_command_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
if (ACCESSING_BITS_0_7)
{
@@ -40,11 +40,11 @@ static WRITE16_HANDLER( bigkarnk_coin_w )
{
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w(space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w(space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
break;
}
}
@@ -52,7 +52,7 @@ static WRITE16_HANDLER( bigkarnk_coin_w )
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7)
{
@@ -64,7 +64,7 @@ static WRITE16_HANDLER( OKIM6295_bankswitch_w )
static WRITE16_HANDLER( gaelco_vram_encrypted_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( gaelco_vram_encrypted_w )
static WRITE16_HANDLER(gaelco_encrypted_w)
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
@@ -87,7 +87,7 @@ static WRITE16_HANDLER(gaelco_encrypted_w)
static WRITE16_HANDLER( thoop_vram_encrypted_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
@@ -98,7 +98,7 @@ static WRITE16_HANDLER( thoop_vram_encrypted_w )
static WRITE16_HANDLER(thoop_encrypted_w)
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
@@ -492,9 +492,9 @@ GFXDECODEINFO(0x100000,64)
static MACHINE_START( gaelco )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( bigkarnk, gaelco_state )
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index fdb2bd74f72..0faa7f4bc6d 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -209,10 +209,10 @@ ROM_END
BANG
============================================================================*/
-static READ16_HANDLER(p1_gun_x) {return (input_port_read(space->machine, "LIGHT0_X") * 320 / 0x100) + 1;}
-static READ16_HANDLER(p1_gun_y) {return (input_port_read(space->machine, "LIGHT0_Y") * 240 / 0x100) - 4;}
-static READ16_HANDLER(p2_gun_x) {return (input_port_read(space->machine, "LIGHT1_X") * 320 / 0x100) + 1;}
-static READ16_HANDLER(p2_gun_y) {return (input_port_read(space->machine, "LIGHT1_Y") * 240 / 0x100) - 4;}
+static READ16_HANDLER(p1_gun_x) {return (input_port_read(space->machine(), "LIGHT0_X") * 320 / 0x100) + 1;}
+static READ16_HANDLER(p1_gun_y) {return (input_port_read(space->machine(), "LIGHT0_Y") * 240 / 0x100) - 4;}
+static READ16_HANDLER(p2_gun_x) {return (input_port_read(space->machine(), "LIGHT1_X") * 320 / 0x100) + 1;}
+static READ16_HANDLER(p2_gun_y) {return (input_port_read(space->machine(), "LIGHT1_Y") * 240 / 0x100) - 4;}
static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index c3f8592174a..200020eac95 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -162,9 +162,9 @@ static void adsp_tx_callback(adsp21xx_device &device, int port, INT32 data);
static WRITE_LINE_DEVICE_HANDLER( ser_irq )
{
if (state)
- cputag_set_input_line(device->machine, "maincpu", 6, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, ASSERT_LINE);
else
- cputag_set_input_line(device->machine, "maincpu", 6, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, CLEAR_LINE);
}
@@ -184,7 +184,7 @@ static const gaelco_serial_interface serial_interface =
static MACHINE_START( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
/* Save state support */
state_save_register_global(machine, state->sound_data);
state_save_register_global(machine, state->sound_status);
@@ -199,14 +199,14 @@ static MACHINE_START( gaelco3d )
static MACHINE_RESET( common )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
UINT16 *src;
int i;
state->framenum = 0;
/* boot the ADSP chip */
- src = (UINT16 *)machine->region("user1")->base();
+ src = (UINT16 *)machine.region("user1")->base();
for (i = 0; i < (src[3] & 0xff) * 8; i++)
{
UINT32 opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff);
@@ -214,9 +214,9 @@ static MACHINE_RESET( common )
}
/* allocate a timer for feeding the autobuffer */
- state->adsp_autobuffer_timer = machine->device<timer_device>("adsp_timer");
+ state->adsp_autobuffer_timer = machine.device<timer_device>("adsp_timer");
- memory_configure_bank(machine, "bank1", 0, 256, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 256, machine.region("user1")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
/* keep the TMS32031 halted until the code is ready to go */
@@ -226,14 +226,14 @@ static MACHINE_RESET( common )
{
char buffer[10];
sprintf(buffer, "dac%d", i + 1);
- state->dmadac[i] = machine->device<dmadac_sound_device>(buffer);
+ state->dmadac[i] = machine.device<dmadac_sound_device>(buffer);
}
}
static MACHINE_RESET( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
MACHINE_RESET_CALL( common );
state->tms_offset_xor = 0;
}
@@ -241,7 +241,7 @@ static MACHINE_RESET( gaelco3d )
static MACHINE_RESET( gaelco3d2 )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
MACHINE_RESET_CALL( common );
state->tms_offset_xor = BYTE_XOR_BE(0);
}
@@ -256,14 +256,14 @@ static MACHINE_RESET( gaelco3d2 )
static INTERRUPT_GEN( vblank_gen )
{
- gaelco3d_render(*device->machine->primary_screen);
+ gaelco3d_render(*device->machine().primary_screen);
device_set_input_line(device, 2, ASSERT_LINE);
}
static WRITE16_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
}
static WRITE32_HANDLER( irq_ack32_w )
@@ -271,7 +271,7 @@ static WRITE32_HANDLER( irq_ack32_w )
if (mem_mask == 0xffff0000)
irq_ack_w(space, offset, data, mem_mask >> 16);
else if (ACCESSING_BITS_0_7)
- gaelco_serial_tr_w(space->machine->device("serial"), 0, data & 0x01);
+ gaelco_serial_tr_w(space->machine().device("serial"), 0, data & 0x01);
else
logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
}
@@ -293,7 +293,7 @@ static READ16_DEVICE_HANDLER( eeprom_data_r )
/* bit 0 is clock */
/* bit 1 active */
result &= ~GAELCOSER_EXT_STATUS_MASK;
- result |= gaelco_serial_status_r(device->machine->device("serial"), 0);
+ result |= gaelco_serial_status_r(device->machine().device("serial"), 0);
}
if (eeprom_read_bit(device))
@@ -309,13 +309,13 @@ static READ32_DEVICE_HANDLER( eeprom_data32_r )
return (eeprom_data_r(device, 0, mem_mask >> 16) << 16) | 0xffff;
else if (ACCESSING_BITS_0_7)
{
- UINT8 data = gaelco_serial_data_r(device->machine->device("serial"),0);
+ UINT8 data = gaelco_serial_data_r(device->machine().device("serial"),0);
if (LOG)
- logerror("%06X:read(%02X) = %08X & %08X\n", cpu_get_pc(device->machine->device("maincpu")), offset, data, mem_mask);
+ logerror("%06X:read(%02X) = %08X & %08X\n", cpu_get_pc(device->machine().device("maincpu")), offset, data, mem_mask);
return data | 0xffffff00;
}
else
- logerror("%06X:read(%02X) = mask %08X\n", cpu_get_pc(device->machine->device("maincpu")), offset, mem_mask);
+ logerror("%06X:read(%02X) = mask %08X\n", cpu_get_pc(device->machine().device("maincpu")), offset, mem_mask);
return 0xffffffff;
}
@@ -353,7 +353,7 @@ static WRITE16_DEVICE_HANDLER( eeprom_cs_w )
static TIMER_CALLBACK( delayed_sound_w )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
if (LOG)
logerror("delayed_sound_w(%02X)\n", param);
state->sound_data = param;
@@ -366,23 +366,23 @@ static WRITE16_HANDLER( sound_data_w )
if (LOG)
logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
static READ16_HANDLER( sound_data_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("sound_data_r(%02X)\n", state->sound_data);
- cputag_set_input_line(space->machine, "adsp", ADSP2115_IRQ2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "adsp", ADSP2115_IRQ2, CLEAR_LINE);
return state->sound_data;
}
static READ16_HANDLER( sound_status_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("%06X:sound_status_r(%02X) = %02X\n", cpu_get_pc(space->cpu), offset, state->sound_status);
if (ACCESSING_BITS_0_7)
@@ -393,7 +393,7 @@ static READ16_HANDLER( sound_status_r )
static WRITE16_HANDLER( sound_status_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("sound_status_w(%02X)\n", state->sound_data);
state->sound_status = data;
@@ -409,7 +409,7 @@ static WRITE16_HANDLER( sound_status_w )
static CUSTOM_INPUT( analog_bit_r )
{
- gaelco3d_state *state = field->port->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = field->port->machine().driver_data<gaelco3d_state>();
int which = (FPTR)param;
return (state->analog_ports[which] >> 7) & 0x01;
}
@@ -417,7 +417,7 @@ static CUSTOM_INPUT( analog_bit_r )
static WRITE16_HANDLER( analog_port_clock_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
/* a zero/one combo is written here to clock the next analog port bit */
if (ACCESSING_BITS_0_7)
{
@@ -439,16 +439,16 @@ static WRITE16_HANDLER( analog_port_clock_w )
static WRITE16_HANDLER( analog_port_latch_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
/* a zero is written here to read the analog ports, and a one is written when finished */
if (ACCESSING_BITS_0_7)
{
if (!(data & 0xff))
{
- state->analog_ports[0] = input_port_read_safe(space->machine, "ANALOG0", 0);
- state->analog_ports[1] = input_port_read_safe(space->machine, "ANALOG1", 0);
- state->analog_ports[2] = input_port_read_safe(space->machine, "ANALOG2", 0);
- state->analog_ports[3] = input_port_read_safe(space->machine, "ANALOG3", 0);
+ state->analog_ports[0] = input_port_read_safe(space->machine(), "ANALOG0", 0);
+ state->analog_ports[1] = input_port_read_safe(space->machine(), "ANALOG1", 0);
+ state->analog_ports[2] = input_port_read_safe(space->machine(), "ANALOG2", 0);
+ state->analog_ports[3] = input_port_read_safe(space->machine(), "ANALOG3", 0);
}
}
else
@@ -469,7 +469,7 @@ static WRITE16_HANDLER( analog_port_latch_w )
static READ32_HANDLER( tms_m68k_ram_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", cpu_get_pc(space->cpu), offset, !(offset & 1) ? ((INT32)state->m68k_ram_base[offset/2] >> 16) : (int)(INT16)state->m68k_ram_base[offset/2]);
return (INT32)(INT16)state->m68k_ram_base[offset ^ state->tms_offset_xor];
}
@@ -477,7 +477,7 @@ static READ32_HANDLER( tms_m68k_ram_r )
static WRITE32_HANDLER( tms_m68k_ram_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
state->m68k_ram_base[offset ^ state->tms_offset_xor] = data;
}
@@ -503,7 +503,7 @@ static WRITE16_HANDLER( tms_reset_w )
/* it does not ever appear to be touched after that */
if (LOG)
logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
- cputag_set_input_line(space->machine, "tms", INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "tms", INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -514,7 +514,7 @@ static WRITE16_HANDLER( tms_irq_w )
if (LOG)
logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "tms", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "tms", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -527,7 +527,7 @@ static WRITE16_HANDLER( tms_control3_w )
static WRITE16_HANDLER( tms_comm_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
COMBINE_DATA(&state->tms_comm_base[offset ^ state->tms_offset_xor]);
if (LOG)
logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*2, data, mem_mask);
@@ -574,7 +574,7 @@ ADSP control 3FFF W = 0C08 (SYSCONTROL_REG)
static WRITE16_HANDLER( adsp_control_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("ADSP control %04X W = %04X\n", 0x3fe0 + offset, data);
@@ -613,7 +613,7 @@ static WRITE16_HANDLER( adsp_rombank_w )
{
if (LOG)
logerror("adsp_rombank_w(%d) = %04X\n", offset, data);
- memory_set_bank(space->machine, "bank1", (offset & 1) * 0x80 + (data & 0x7f));
+ memory_set_bank(space->machine(), "bank1", (offset & 1) * 0x80 + (data & 0x7f));
}
@@ -626,8 +626,8 @@ static WRITE16_HANDLER( adsp_rombank_w )
static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
{
- gaelco3d_state *state = timer.machine->driver_data<gaelco3d_state>();
- cpu_device *adsp = timer.machine->device<cpu_device>("adsp");
+ gaelco3d_state *state = timer.machine().driver_data<gaelco3d_state>();
+ cpu_device *adsp = timer.machine().device<cpu_device>("adsp");
/* get the index register */
int reg = adsp->state(ADSP2100_I0 + state->adsp_ireg);
@@ -657,7 +657,7 @@ static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
static void adsp_tx_callback(adsp21xx_device &device, int port, INT32 data)
{
- gaelco3d_state *state = device.machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = device.machine().driver_data<gaelco3d_state>();
/* check if it's for SPORT1 */
if (port != 1)
return;
@@ -1207,18 +1207,18 @@ ROM_END
static DRIVER_INIT( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
UINT8 *src, *dst;
int x, y;
/* allocate memory */
- state->texture_size = machine->region("gfx1")->bytes();
- state->texmask_size = machine->region("gfx2")->bytes() * 8;
+ state->texture_size = machine.region("gfx1")->bytes();
+ state->texmask_size = machine.region("gfx2")->bytes() * 8;
state->texture = auto_alloc_array(machine, UINT8, state->texture_size);
state->texmask = auto_alloc_array(machine, UINT8, state->texmask_size);
/* first expand the pixel data */
- src = machine->region("gfx1")->base();
+ src = machine.region("gfx1")->base();
dst = state->texture;
for (y = 0; y < state->texture_size/4096; y += 2)
for (x = 0; x < 4096; x += 2)
@@ -1230,7 +1230,7 @@ static DRIVER_INIT( gaelco3d )
}
/* then expand the mask data */
- src = machine->region("gfx2")->base();
+ src = machine.region("gfx2")->base();
dst = state->texmask;
for (y = 0; y < state->texmask_size/4096; y++)
for (x = 0; x < 4096; x++)
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index 8eebf0111ac..5220268b23a 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -138,7 +138,7 @@ Notes:
static WRITE16_HANDLER( gaiden_sound_command_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff); /* Ninja Gaiden */
@@ -149,7 +149,7 @@ static WRITE16_HANDLER( gaiden_sound_command_w )
static WRITE16_HANDLER( drgnbowl_sound_command_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -166,7 +166,7 @@ static WRITE16_HANDLER( drgnbowl_sound_command_w )
static WRITE16_HANDLER( wildfang_protection_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -217,7 +217,7 @@ static WRITE16_HANDLER( wildfang_protection_w )
static READ16_HANDLER( wildfang_protection_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
// logerror("PC %06x: read prot %02x\n", cpu_get_pc(space->cpu), state->prot);
return state->prot;
}
@@ -295,7 +295,7 @@ static const int jumppoints_other[0x100] =
static MACHINE_RESET( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
state->prot = 0;
state->jumpcode = 0;
@@ -315,8 +315,8 @@ static MACHINE_RESET( raiga )
static MACHINE_START( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
- state->audiocpu = machine->device("audiocpu");
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->prot));
state->save_item(NAME(state->jumpcode));
@@ -336,7 +336,7 @@ static MACHINE_START( raiga )
static WRITE16_HANDLER( raiga_protection_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -388,7 +388,7 @@ static WRITE16_HANDLER( raiga_protection_w )
static READ16_HANDLER( raiga_protection_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
// logerror("PC %06x: read prot %02x\n", cpu_get_pc(space->cpu), state->prot);
return state->prot;
}
@@ -750,7 +750,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- gaiden_state *state = device->machine->driver_data<gaiden_state>();
+ gaiden_state *state = device->machine().driver_data<gaiden_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1491,7 +1491,7 @@ ROM_END
static DRIVER_INIT( shadoww )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y = sprite size X */
state->sprite_sizey = 0;
state->raiga_jumppoints = jumppoints_00;
@@ -1499,35 +1499,35 @@ static DRIVER_INIT( shadoww )
static DRIVER_INIT( wildfang )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y = sprite size X */
state->sprite_sizey = 0;
state->raiga_jumppoints = jumppoints_00;
state->prot = 0;
state->jumpcode = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(wildfang_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(wildfang_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(wildfang_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(wildfang_protection_w));
}
static DRIVER_INIT( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y independent from sprite size X */
state->sprite_sizey = 2;
state->raiga_jumppoints = jumppoints_00;
state->prot = 0;
state->jumpcode = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(raiga_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(raiga_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(raiga_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(raiga_protection_w));
}
-static void descramble_drgnbowl_gfx(running_machine *machine)
+static void descramble_drgnbowl_gfx(running_machine &machine)
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer, ROM, size);
@@ -1543,8 +1543,8 @@ static void descramble_drgnbowl_gfx(running_machine *machine)
auto_free(machine, buffer);
- ROM = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes();
+ ROM = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes();
buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer,ROM,size);
@@ -1564,13 +1564,13 @@ static void descramble_drgnbowl_gfx(running_machine *machine)
static DRIVER_INIT( drgnbowl )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
state->raiga_jumppoints = jumppoints_00;
descramble_drgnbowl_gfx(machine);
}
-static void descramble_mastninj_gfx(running_machine *machine, UINT8* src)
+static void descramble_mastninj_gfx(running_machine &machine, UINT8* src)
{
UINT8 *buffer;
int len = 0x80000;
@@ -1614,8 +1614,8 @@ static void descramble_mastninj_gfx(running_machine *machine, UINT8* src)
static DRIVER_INIT(mastninj)
{
// rearrange the graphic roms into a format that MAME can decode
- descramble_mastninj_gfx(machine, machine->region("gfx2")->base());
- descramble_mastninj_gfx(machine, machine->region("gfx3")->base());
+ descramble_mastninj_gfx(machine, machine.region("gfx2")->base());
+ descramble_mastninj_gfx(machine, machine.region("gfx3")->base());
DRIVER_INIT_CALL(shadoww);
}
diff --git a/src/mame/drivers/gal3.c b/src/mame/drivers/gal3.c
index cf42c2c1038..c737a835a5c 100644
--- a/src/mame/drivers/gal3.c
+++ b/src/mame/drivers/gal3.c
@@ -159,7 +159,7 @@ static VIDEO_START(gal3)
}
-static void update_palette( running_machine *machine )
+static void update_palette( running_machine &machine )
{
int i;
INT16 data1,data2;
@@ -167,8 +167,8 @@ static void update_palette( running_machine *machine )
for( i=0; i<NAMCOS21_NUM_COLORS; i++ )
{
- data1 = machine->generic.paletteram.u16[0x00000/2+i];
- data2 = machine->generic.paletteram.u16[0x10000/2+i];
+ data1 = machine.generic.paletteram.u16[0x00000/2+i];
+ data2 = machine.generic.paletteram.u16[0x10000/2+i];
r = data1>>8;
g = data1&0xff;
@@ -180,27 +180,27 @@ static void update_palette( running_machine *machine )
static SCREEN_UPDATE(gal3)
{
- gal3_state *state = screen->machine->driver_data<gal3_state>();
+ gal3_state *state = screen->machine().driver_data<gal3_state>();
int i;
char mst[18], slv[18];
static int pivot = 15;
int pri;
- update_palette(screen->machine);
+ update_palette(screen->machine());
- if( input_code_pressed_once(screen->machine, KEYCODE_H)&&(pivot<15) ) pivot+=1;
- if( input_code_pressed_once(screen->machine, KEYCODE_J)&&(pivot>0) ) pivot-=1;
+ if( input_code_pressed_once(screen->machine(), KEYCODE_H)&&(pivot<15) ) pivot+=1;
+ if( input_code_pressed_once(screen->machine(), KEYCODE_J)&&(pivot>0) ) pivot-=1;
for( pri=0; pri<pivot; pri++ )
{
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}
/* CopyVisiblePolyFrameBuffer( bitmap, cliprect,0,0x7fbf );
for( pri=pivot; pri<15; pri++ )
{
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}*/
// CPU Diag LEDs
@@ -234,7 +234,7 @@ static SCREEN_UPDATE(gal3)
static NVRAM_HANDLER( gal3 )
{
- gal3_state *state = machine->driver_data<gal3_state>();
+ gal3_state *state = machine.driver_data<gal3_state>();
int i;
UINT8 data[4];
if( read_or_write )
@@ -271,26 +271,26 @@ static NVRAM_HANDLER( gal3 )
static READ32_HANDLER( shareram0_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->mpSharedRAM0[offset];
}
static WRITE32_HANDLER( shareram0_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA( &state->mpSharedRAM0[offset] );
}
#if 0
static READ32_HANDLER( shareram1_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->mpSharedRAM1[offset];
}
static WRITE32_HANDLER( shareram1_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA( &state->mpSharedRAM1[offset] );
}
#endif
@@ -299,25 +299,25 @@ static WRITE32_HANDLER( shareram1_w )
static READ32_HANDLER( led_mst_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->led_mst;
}
static WRITE32_HANDLER( led_mst_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA(&state->led_mst);
}
static READ32_HANDLER( led_slv_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->led_slv;
}
static WRITE32_HANDLER( led_slv_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA(&state->led_slv);
}
@@ -326,28 +326,28 @@ static WRITE32_HANDLER( led_slv_w )
static READ32_HANDLER( paletteram32_r )
{
offset *= 2;
- return (space->machine->generic.paletteram.u16[offset]<<16)|space->machine->generic.paletteram.u16[offset+1];
+ return (space->machine().generic.paletteram.u16[offset]<<16)|space->machine().generic.paletteram.u16[offset+1];
}
static WRITE32_HANDLER( paletteram32_w )
{
UINT32 v;
offset *= 2;
- v = (space->machine->generic.paletteram.u16[offset]<<16)|space->machine->generic.paletteram.u16[offset+1];
+ v = (space->machine().generic.paletteram.u16[offset]<<16)|space->machine().generic.paletteram.u16[offset+1];
COMBINE_DATA( &v );
- space->machine->generic.paletteram.u16[offset+0] = v>>16;
- space->machine->generic.paletteram.u16[offset+1] = v&0xffff;
+ space->machine().generic.paletteram.u16[offset+0] = v>>16;
+ space->machine().generic.paletteram.u16[offset+1] = v&0xffff;
}
static READ32_HANDLER(namcos21_video_enable_r)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->namcos21_video_enable<<16;
}
static WRITE32_HANDLER(namcos21_video_enable_w)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
UINT32 v;
v = state->namcos21_video_enable<<16;
COMBINE_DATA( &v ); // 0xff53, instead of 0x40 in namcos21
@@ -356,7 +356,7 @@ static WRITE32_HANDLER(namcos21_video_enable_w)
static READ32_HANDLER(rso_r)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
/*store $5555 @$0046, and readback @$0000
read @$0144 and store at A6_21e & A4_5c
Check @$009a==1 to start DEMO
@@ -367,7 +367,7 @@ static READ32_HANDLER(rso_r)
static WRITE32_HANDLER(rso_w)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
UINT32 v;
offset *= 2;
v = (state->rsoSharedRAM[offset]<<16)|state->rsoSharedRAM[offset+1];
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 4b233d03398..e0e31443a5e 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -717,49 +717,49 @@ static READ8_HANDLER( bosco_dsw_r )
{
int bit0,bit1;
- bit0 = (input_port_read(space->machine, "DSWB") >> offset) & 1;
- bit1 = (input_port_read(space->machine, "DSWA") >> offset) & 1;
+ bit0 = (input_port_read(space->machine(), "DSWB") >> offset) & 1;
+ bit1 = (input_port_read(space->machine(), "DSWA") >> offset) & 1;
return bit0 | (bit1 << 1);
}
static WRITE8_HANDLER( galaga_flip_screen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static WRITE8_HANDLER( bosco_flip_screen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( bosco_latch_w )
{
- galaga_state *state = space->machine->driver_data<galaga_state>();
+ galaga_state *state = space->machine().driver_data<galaga_state>();
int bit = data & 1;
switch (offset)
{
case 0x00: /* IRQ1 */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x01: /* IRQ2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* NMION */
- cpu_interrupt_enable(space->machine->device("sub2"), !bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), !bit);
break;
case 0x03: /* RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x04: /* n.c. */
@@ -779,19 +779,19 @@ static WRITE8_HANDLER( bosco_latch_w )
}
}
-static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; }
+static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine(), (const char *)param) >> 4; }
static WRITE8_DEVICE_HANDLER( out_0 )
{
- set_led_status(device->machine, 1,data & 1);
- set_led_status(device->machine, 0,data & 2);
- coin_counter_w(device->machine, 1,~data & 4);
- coin_counter_w(device->machine, 0,~data & 8);
+ set_led_status(device->machine(), 1,data & 1);
+ set_led_status(device->machine(), 0,data & 2);
+ coin_counter_w(device->machine(), 1,~data & 4);
+ coin_counter_w(device->machine(), 0,~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_1 )
{
- coin_lockout_global_w(device->machine, data & 1);
+ coin_lockout_global_w(device->machine(), data & 1);
}
static const namco_51xx_interface namco_51xx_intf =
@@ -811,7 +811,7 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine->region("52xx")->bytes();
+ UINT32 length = device->machine().region("52xx")->bytes();
//printf("ROM read %04X\n", offset);
if (!(offset & 0x1000))
offset = (offset & 0xfff) | 0x0000;
@@ -821,7 +821,7 @@ static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
offset = (offset & 0xfff) | 0x2000;
else if (!(offset & 0x8000))
offset = (offset & 0xfff) | 0x3000;
- return (offset < length) ? device->machine->region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
@@ -842,7 +842,7 @@ static const namco_52xx_interface namco_52xx_intf =
static READ8_DEVICE_HANDLER( custom_mod_r )
{
- galaga_state *state = device->machine->driver_data<galaga_state>();
+ galaga_state *state = device->machine().driver_data<galaga_state>();
/* MOD0-2 is connected to K1-3; K0 is left unconnected */
return state->custom_mod << 1;
}
@@ -862,33 +862,33 @@ static const namco_53xx_interface namco_53xx_intf =
static TIMER_CALLBACK( cpu3_interrupt_callback )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
int scanline = param;
- nmi_line_pulse(machine->device("sub2"));
+ nmi_line_pulse(machine.device("sub2"));
scanline = scanline + 128;
if (scanline >= 272)
scanline = 64;
/* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
- state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->cpu3_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* create the interrupt timer */
- state->cpu3_interrupt_timer = machine->scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
+ state->cpu3_interrupt_timer = machine.scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
state->custom_mod = 0;
state_save_register_global(machine, state->custom_mod);
}
-static void bosco_latch_reset(running_machine *machine)
+static void bosco_latch_reset(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -898,12 +898,12 @@ static void bosco_latch_reset(running_machine *machine)
static MACHINE_RESET( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* Reset all latches */
bosco_latch_reset(machine);
- state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->cpu3_interrupt_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
}
static MACHINE_RESET( battles )
@@ -3193,8 +3193,8 @@ ROM_END
static DRIVER_INIT (galaga)
{
/* swap bytes for flipped character so we can decode them together with normal characters */
- UINT8 *rom = machine->region("gfx1")->base();
- int i, len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int i, len = machine.region("gfx1")->bytes();
for (i = 0;i < len;i++)
{
@@ -3212,7 +3212,7 @@ static DRIVER_INIT (gatsbee)
DRIVER_INIT_CALL(galaga);
/* Gatsbee has a larger character ROM, we need a handler for banking */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1000, 0x1000, FUNC(gatsbee_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1000, 0x1000, FUNC(gatsbee_bank_w));
}
@@ -3221,7 +3221,7 @@ static DRIVER_INIT( xevious )
UINT8 *rom;
int i;
- rom = machine->region("gfx3")->base() + 0x5000;
+ rom = machine.region("gfx3")->base() + 0x5000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
}
@@ -3233,14 +3233,14 @@ static DRIVER_INIT( xevios )
/* convert one of the sprite ROMs to the format used by Xevious */
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
for (A = 0x5000;A < 0x7000;A++)
{
rom[A] = BITSWAP8(rom[A],1,3,5,7,0,2,4,6);
}
/* convert one of tile map ROMs to the format used by Xevious */
- rom = machine->region("gfx4")->base();
+ rom = machine.region("gfx4")->base();
for (A = 0x0000;A < 0x1000;A++)
{
rom[A] = BITSWAP8(rom[A],3,7,5,1,2,6,4,0);
@@ -3253,8 +3253,8 @@ static DRIVER_INIT( xevios )
static DRIVER_INIT( battles )
{
/* replace the Namco I/O handlers with interface to the 4th CPU */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) );
DRIVER_INIT_CALL(xevious);
}
diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c
index 2b6da92ef25..61cf10a4600 100644
--- a/src/mame/drivers/galastrm.c
+++ b/src/mame/drivers/galastrm.c
@@ -50,7 +50,7 @@ $305.b invincibility
static INTERRUPT_GEN( galastrm_interrupt )
{
- galastrm_state *state = device->machine->driver_data<galastrm_state>();
+ galastrm_state *state = device->machine().driver_data<galastrm_state>();
state->frame_counter ^= 1;
device_set_input_line(device, 5, HOLD_LINE);
}
@@ -64,16 +64,16 @@ static TIMER_CALLBACK( galastrm_interrupt6 )
static WRITE32_HANDLER( galastrm_palette_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0110pcr_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0110pcr_addr < 4096))
- palette_set_color_rgb(space->machine, state->tc0110pcr_addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), state->tc0110pcr_addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static WRITE32_HANDLER( galastrm_tc0610_0_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0610_0_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0610_0_addr < 8))
@@ -82,7 +82,7 @@ static WRITE32_HANDLER( galastrm_tc0610_0_w )
static WRITE32_HANDLER( galastrm_tc0610_1_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0610_1_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0610_1_addr < 8))
@@ -92,19 +92,19 @@ static WRITE32_HANDLER( galastrm_tc0610_1_w )
static CUSTOM_INPUT( frame_counter_r )
{
- galastrm_state *state = field->port->machine->driver_data<galastrm_state>();
+ galastrm_state *state = field->port->machine().driver_data<galastrm_state>();
return state->frame_counter;
}
static CUSTOM_INPUT( coin_word_r )
{
- galastrm_state *state = field->port->machine->driver_data<galastrm_state>();
+ galastrm_state *state = field->port->machine().driver_data<galastrm_state>();
return state->coin_word;
}
static WRITE32_HANDLER( galastrm_input_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
#if 0
{
@@ -122,12 +122,12 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31) /* $400000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -140,10 +140,10 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0, ~data & 0x01000000);
- coin_lockout_w(space->machine, 1, ~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x04000000);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x04000000);
state->coin_word = (data >> 16) &0xffff;
}
//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(space->cpu),offset);
@@ -156,16 +156,16 @@ static READ32_HANDLER( galastrm_adstick_ctrl_r )
if (offset == 0x00)
{
if (ACCESSING_BITS_24_31)
- return input_port_read(space->machine, "STICKX") << 24;
+ return input_port_read(space->machine(), "STICKX") << 24;
if (ACCESSING_BITS_16_23)
- return input_port_read(space->machine, "STICKY") << 16;
+ return input_port_read(space->machine(), "STICKY") << 16;
}
return 0;
}
static WRITE32_HANDLER( galastrm_adstick_ctrl_w )
{
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(galastrm_interrupt6));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(galastrm_interrupt6));
}
/***********************************************************
diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c
index 525094ccf31..8ff823a8c7b 100644
--- a/src/mame/drivers/galaxi.c
+++ b/src/mame/drivers/galaxi.c
@@ -75,77 +75,77 @@ public:
static TILE_GET_INFO( get_bg1_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg1_ram[tile_index];
SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg2_ram[tile_index];
SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
}
static TILE_GET_INFO( get_bg3_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg3_ram[tile_index];
SET_TILE_INFO(0, code, (code >> 12), 0);
}
static TILE_GET_INFO( get_bg4_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg4_ram[tile_index];
SET_TILE_INFO(0, code, (code >> 12), 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->fg_ram[tile_index];
SET_TILE_INFO(1, code, 0x20 + (code >> 12), 0);
}
static WRITE16_HANDLER( galaxi_bg1_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg1_ram[offset]);
tilemap_mark_tile_dirty(state->bg1_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg2_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg2_ram[offset]);
tilemap_mark_tile_dirty(state->bg2_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg3_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg3_ram[offset]);
tilemap_mark_tile_dirty(state->bg3_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg4_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg4_ram[offset]);
tilemap_mark_tile_dirty(state->bg4_tmap, offset);
}
static WRITE16_HANDLER( galaxi_fg_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->fg_ram[offset]);
tilemap_mark_tile_dirty(state->fg_tmap, offset);
}
static VIDEO_START(galaxi)
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->bg1_tmap = tilemap_create(machine, get_bg1_tile_info, tilemap_scan_rows, 16, 16, 0x20, 0x10);
state->bg2_tmap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows, 16, 16, 0x20, 0x10);
@@ -166,24 +166,24 @@ static VIDEO_START(galaxi)
static SCREEN_UPDATE(galaxi)
{
- galaxi_state *state = screen->machine->driver_data<galaxi_state>();
+ galaxi_state *state = screen->machine().driver_data<galaxi_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_R)) // remapped due to inputs changes.
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) // remapped due to inputs changes.
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_T)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_U)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_I)) msk |= 8;
- if (input_code_pressed(screen->machine, KEYCODE_O)) msk |= 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_U)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_I)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_O)) msk |= 16;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->bg1_tmap, TILEMAP_DRAW_OPAQUE, 0);
- else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->bg2_tmap, 0, 0);
if (layers_ctrl & 4) tilemap_draw(bitmap, cliprect, state->bg3_tmap, 0, 0);
if (layers_ctrl & 8) tilemap_draw(bitmap, cliprect, state->bg4_tmap, 0, 0);
@@ -197,29 +197,29 @@ static SCREEN_UPDATE(galaxi)
Memory Maps
***************************************************************************/
-static void show_out( running_machine *machine )
+static void show_out( running_machine &machine )
{
-// galaxi_state *state = machine->driver_data<galaxi_state>();
+// galaxi_state *state = machine.driver_data<galaxi_state>();
// popmessage("%04x %04x %04x", state->out[0], state->out[1], state->out[2]);
}
static WRITE16_HANDLER( galaxi_500000_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->out[0]);
- show_out(space->machine);
+ show_out(space->machine());
}
static WRITE16_HANDLER( galaxi_500002_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->out[1]);
- show_out(space->machine);
+ show_out(space->machine());
}
static WRITE16_HANDLER( galaxi_500004_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
if (ACCESSING_BITS_0_7)
{
@@ -247,23 +247,23 @@ static WRITE16_HANDLER( galaxi_500004_w )
{
state->ticket = data & 0x0100;
state->hopper = data & 0x1000;
- coin_counter_w(space->machine, 0, data & 0x2000); // coins
+ coin_counter_w(space->machine(), 0, data & 0x2000); // coins
}
COMBINE_DATA(&state->out[2]);
- show_out(space->machine);
+ show_out(space->machine());
}
static CUSTOM_INPUT( ticket_r )
{
- galaxi_state *state = field->port->machine->driver_data<galaxi_state>();
- return state->ticket && !(field->port->machine->primary_screen->frame_number() % 10);
+ galaxi_state *state = field->port->machine().driver_data<galaxi_state>();
+ return state->ticket && !(field->port->machine().primary_screen->frame_number() % 10);
}
static CUSTOM_INPUT( hopper_r )
{
- galaxi_state *state = field->port->machine->driver_data<galaxi_state>();
- return state->hopper && !(field->port->machine->primary_screen->frame_number() % 10);
+ galaxi_state *state = field->port->machine().driver_data<galaxi_state>();
+ return state->hopper && !(field->port->machine().primary_screen->frame_number() % 10);
}
@@ -373,7 +373,7 @@ GFXDECODE_END
static MACHINE_START( galaxi )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->save_item(NAME(state->hopper));
state->save_item(NAME(state->ticket));
@@ -382,7 +382,7 @@ static MACHINE_START( galaxi )
static MACHINE_RESET( galaxi )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->hopper = 0;
state->ticket = 0;
diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c
index e5f74ab4553..1abfcff18eb 100644
--- a/src/mame/drivers/galaxia.c
+++ b/src/mame/drivers/galaxia.c
@@ -43,16 +43,16 @@ public:
static SCREEN_UPDATE( galaxia )
{
- galaxia_state *state = screen->machine->driver_data<galaxia_state>();
+ galaxia_state *state = screen->machine().driver_data<galaxia_state>();
int x,y, count;
bitmap_t *s2636_0_bitmap;
bitmap_t *s2636_1_bitmap;
bitmap_t *s2636_2_bitmap;
- device_t *s2636_0 = screen->machine->device("s2636_0");
- device_t *s2636_1 = screen->machine->device("s2636_1");
- device_t *s2636_2 = screen->machine->device("s2636_2");
+ device_t *s2636_0 = screen->machine().device("s2636_0");
+ device_t *s2636_1 = screen->machine().device("s2636_1");
+ device_t *s2636_2 = screen->machine().device("s2636_2");
count = 0;
@@ -61,7 +61,7 @@ static SCREEN_UPDATE( galaxia )
for (x=0;x<256/8;x++)
{
int tile = state->video[count];
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8);
count++;
}
}
@@ -100,7 +100,7 @@ static SCREEN_UPDATE( galaxia )
static WRITE8_HANDLER(galaxia_video_w)
{
- galaxia_state *state = space->machine->driver_data<galaxia_state>();
+ galaxia_state *state = space->machine().driver_data<galaxia_state>();
if (cpu_get_reg(space->cpu, S2650_FO))
{
state->video[offset]=data;
@@ -113,7 +113,7 @@ static WRITE8_HANDLER(galaxia_video_w)
static READ8_HANDLER(galaxia_video_r)
{
- galaxia_state *state = space->machine->driver_data<galaxia_state>();
+ galaxia_state *state = space->machine().driver_data<galaxia_state>();
return state->video[offset];
}
@@ -357,7 +357,7 @@ ROM_END
static DRIVER_INIT(galaxia)
{
- galaxia_state *state = machine->driver_data<galaxia_state>();
+ galaxia_state *state = machine.driver_data<galaxia_state>();
state->color=auto_alloc_array(machine, UINT8, 0x400);
}
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index f414d021584..190e37b56b4 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -475,12 +475,12 @@ static INTERRUPT_GEN( fakechange_interrupt_gen )
{
interrupt_gen(device);
- if (input_port_read_safe(device->machine, "FAKE_SELECT", 0x00))
+ if (input_port_read_safe(device->machine(), "FAKE_SELECT", 0x00))
{
tenspot_current_game++;
tenspot_current_game%=10;
- tenspot_set_game_bank(device->machine, tenspot_current_game, 1);
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ tenspot_set_game_bank(device->machine(), tenspot_current_game, 1);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
}
@@ -504,26 +504,26 @@ static WRITE8_HANDLER( start_lamp_w )
{
/* offset 0 = 1P START LAMP */
/* offset 1 = 2P START LAMP */
- set_led_status(space->machine, offset, data & 1);
+ set_led_status(space->machine(), offset, data & 1);
}
static WRITE8_HANDLER( coin_lock_w )
{
/* many variants and bootlegs don't have this */
- coin_lockout_global_w(space->machine, ~data & 1);
+ coin_lockout_global_w(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( coin_count_0_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( coin_count_1_w )
{
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
}
@@ -538,8 +538,8 @@ static READ8_HANDLER( konami_ay8910_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0);
+ if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -549,14 +549,14 @@ static WRITE8_HANDLER( konami_ay8910_w )
/* AV 4,5 ==> AY8910 #2 */
/* the decoding here is very simplistic, and you can address two simultaneously */
if (offset & 0x10)
- ay8910_address_w(space->machine->device("8910.1"), 0, data);
+ ay8910_address_w(space->machine().device("8910.1"), 0, data);
else if (offset & 0x20)
- ay8910_data_w(space->machine->device("8910.1"), 0, data);
+ ay8910_data_w(space->machine().device("8910.1"), 0, data);
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_address_w(space->machine->device("8910.0"), 0, data);
+ ay8910_address_w(space->machine().device("8910.0"), 0, data);
else if (offset & 0x80)
- ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ ay8910_data_w(space->machine().device("8910.0"), 0, data);
}
@@ -568,10 +568,10 @@ static WRITE8_DEVICE_HANDLER( konami_sound_control_w )
/* the inverse of bit 3 clocks the flip flop to signal an INT */
/* it is automatically cleared on the acknowledge */
if ((old & 0x08) && !(data & 0x08))
- cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, HOLD_LINE);
/* bit 4 is sound disable */
- device->machine->sound().system_mute(data & 0x10);
+ device->machine().sound().system_mute(data & 0x10);
}
@@ -591,7 +591,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r )
current counter index, we use the sound cpu clock times 8 mod
16*16*2*8*5*2.
*/
- UINT32 cycles = (device->machine->device<cpu_device>("audiocpu")->total_cycles() * 8) % (UINT64)(16*16*2*8*5*2);
+ UINT32 cycles = (device->machine().device<cpu_device>("audiocpu")->total_cycles() * 8) % (UINT64)(16*16*2*8*5*2);
UINT8 hibit = 0;
/* separate the high bit from the others */
@@ -612,7 +612,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r )
static WRITE8_HANDLER( konami_sound_filter_w )
{
- device_t *discrete = space->machine->device("konami");
+ device_t *discrete = space->machine().device("konami");
static const char *const ayname[2] = { "8910.0", "8910.1" };
int which, chan;
@@ -620,7 +620,7 @@ static WRITE8_HANDLER( konami_sound_filter_w )
/* AV0 .. AV5 ==> AY8910 #2 */
/* AV6 .. AV11 ==> AY8910 #1 */
for (which = 0; which < 2; which++)
- if (space->machine->device(ayname[which]) != NULL)
+ if (space->machine().device(ayname[which]) != NULL)
for (chan = 0; chan < 3; chan++)
{
UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3;
@@ -634,13 +634,13 @@ static WRITE8_HANDLER( konami_sound_filter_w )
static WRITE8_DEVICE_HANDLER( konami_portc_0_w )
{
- logerror("%s:ppi0_portc_w = %02X\n", device->machine->describe_context(), data);
+ logerror("%s:ppi0_portc_w = %02X\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( konami_portc_1_w )
{
- logerror("%s:ppi1_portc_w = %02X\n", device->machine->describe_context(), data);
+ logerror("%s:ppi1_portc_w = %02X\n", device->machine().describe_context(), data);
}
@@ -677,8 +677,8 @@ static READ8_HANDLER( theend_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x0100) result &= ppi8255_r(space->machine->device("ppi8255_0"), offset & 3);
- if (offset & 0x0200) result &= ppi8255_r(space->machine->device("ppi8255_1"), offset & 3);
+ if (offset & 0x0100) result &= ppi8255_r(space->machine().device("ppi8255_0"), offset & 3);
+ if (offset & 0x0200) result &= ppi8255_r(space->machine().device("ppi8255_1"), offset & 3);
return result;
}
@@ -686,14 +686,14 @@ static READ8_HANDLER( theend_ppi8255_r )
static WRITE8_HANDLER( theend_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x0100) ppi8255_w(space->machine->device("ppi8255_0"), offset & 3, data);
- if (offset & 0x0200) ppi8255_w(space->machine->device("ppi8255_1"), offset & 3, data);
+ if (offset & 0x0100) ppi8255_w(space->machine().device("ppi8255_0"), offset & 3, data);
+ if (offset & 0x0200) ppi8255_w(space->machine().device("ppi8255_1"), offset & 3, data);
}
static WRITE8_DEVICE_HANDLER( theend_coin_counter_w )
{
- coin_counter_w(device->machine, 0, data & 0x80);
+ coin_counter_w(device->machine(), 0, data & 0x80);
}
@@ -776,14 +776,14 @@ static const ppi8255_interface scramble_ppi8255_1_intf =
static WRITE8_HANDLER( explorer_sound_control_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
static READ8_DEVICE_HANDLER( explorer_sound_latch_r )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
- return soundlatch_r(device->machine->device("audiocpu")->memory().space(AS_PROGRAM), 0);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
+ return soundlatch_r(device->machine().device("audiocpu")->memory().space(AS_PROGRAM), 0);
}
@@ -798,7 +798,7 @@ static READ8_HANDLER( sfx_sample_io_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x04) result &= ppi8255_r(space->machine->device("ppi8255_2"), offset & 3);
+ if (offset & 0x04) result &= ppi8255_r(space->machine().device("ppi8255_2"), offset & 3);
return result;
}
@@ -806,8 +806,8 @@ static READ8_HANDLER( sfx_sample_io_r )
static WRITE8_HANDLER( sfx_sample_io_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x04) ppi8255_w(space->machine->device("ppi8255_2"), offset & 3, data);
- if (offset & 0x10) dac_signed_data_w(space->machine->device("dac"), data);
+ if (offset & 0x04) ppi8255_w(space->machine().device("ppi8255_2"), offset & 3, data);
+ if (offset & 0x10) dac_signed_data_w(space->machine().device("dac"), data);
}
@@ -819,7 +819,7 @@ static WRITE8_DEVICE_HANDLER( sfx_sample_control_w )
/* the inverse of bit 0 clocks the flip flop to signal an INT */
/* it is automatically cleared on the acknowledge */
if ((old & 0x01) && !(data & 0x01))
- cputag_set_input_line(device->machine, "audio2", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audio2", 0, HOLD_LINE);
}
@@ -845,8 +845,8 @@ static READ8_HANDLER( frogger_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 1) & 3);
- if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 1) & 3);
+ if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 1) & 3);
+ if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 1) & 3);
return result;
}
@@ -854,8 +854,8 @@ static READ8_HANDLER( frogger_ppi8255_r )
static WRITE8_HANDLER( frogger_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 1) & 3, data);
- if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 1) & 3, data);
+ if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 1) & 3, data);
+ if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 1) & 3, data);
}
@@ -863,7 +863,7 @@ static READ8_HANDLER( frogger_ay8910_r )
{
/* the decoding here is very simplistic */
UINT8 result = 0xff;
- if (offset & 0x40) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x40) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -873,9 +873,9 @@ static WRITE8_HANDLER( frogger_ay8910_w )
/* the decoding here is very simplistic */
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ ay8910_data_w(space->machine().device("8910.0"), 0, data);
else if (offset & 0x80)
- ay8910_address_w(space->machine->device("8910.0"), 0, data);
+ ay8910_address_w(space->machine().device("8910.0"), 0, data);
}
@@ -889,7 +889,7 @@ static READ8_DEVICE_HANDLER( frogger_sound_timer_r )
static WRITE8_HANDLER( froggrmc_sound_control_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -904,8 +904,8 @@ static READ8_HANDLER( frogf_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 3) & 3);
- if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 3) & 3);
+ if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 3) & 3);
+ if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 3) & 3);
return result;
}
@@ -913,8 +913,8 @@ static READ8_HANDLER( frogf_ppi8255_r )
static WRITE8_HANDLER( frogf_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 3) & 3, data);
- if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 3) & 3, data);
+ if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 3) & 3, data);
+ if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 3) & 3, data);
}
@@ -925,10 +925,10 @@ static WRITE8_HANDLER( frogf_ppi8255_w )
*
*************************************/
-static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 4) & 3); }
-static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 4) & 3); }
-static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 4) & 3, data); }
-static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 4) & 3, data); }
+static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 4) & 3); }
+static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 4) & 3); }
+static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 4) & 3, data); }
+static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 4) & 3, data); }
@@ -942,9 +942,9 @@ static READ8_HANDLER( scorpion_ay8910_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x08) result &= ay8910_r(space->machine->device("8910.2"), 0);
- if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x08) result &= ay8910_r(space->machine().device("8910.2"), 0);
+ if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0);
+ if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -952,12 +952,12 @@ static READ8_HANDLER( scorpion_ay8910_r )
static WRITE8_HANDLER( scorpion_ay8910_w )
{
/* the decoding here is very simplistic, and you can address all six simultaneously */
- if (offset & 0x04) ay8910_address_w(space->machine->device("8910.2"), 0, data);
- if (offset & 0x08) ay8910_data_w(space->machine->device("8910.2"), 0, data);
- if (offset & 0x10) ay8910_address_w(space->machine->device("8910.1"), 0, data);
- if (offset & 0x20) ay8910_data_w(space->machine->device("8910.1"), 0, data);
- if (offset & 0x40) ay8910_address_w(space->machine->device("8910.0"), 0, data);
- if (offset & 0x80) ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ if (offset & 0x04) ay8910_address_w(space->machine().device("8910.2"), 0, data);
+ if (offset & 0x08) ay8910_data_w(space->machine().device("8910.2"), 0, data);
+ if (offset & 0x10) ay8910_address_w(space->machine().device("8910.1"), 0, data);
+ if (offset & 0x20) ay8910_data_w(space->machine().device("8910.1"), 0, data);
+ if (offset & 0x40) ay8910_address_w(space->machine().device("8910.0"), 0, data);
+ if (offset & 0x80) ay8910_data_w(space->machine().device("8910.0"), 0, data);
}
@@ -992,7 +992,7 @@ static WRITE8_DEVICE_HANDLER( scorpion_protection_w )
static READ8_HANDLER( scorpion_digitalker_intr_r )
{
- device_t *digitalker = space->machine->device("digitalker");
+ device_t *digitalker = space->machine().device("digitalker");
return digitalker_0_intr_r(digitalker);
}
@@ -1023,20 +1023,20 @@ static const ppi8255_interface scorpion_ppi8255_1_intf =
static INPUT_CHANGED( gmgalax_game_changed )
{
- address_space *space = field->port->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = field->port->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* new value is the selected game */
gmgalax_selected_game = newval;
/* select the bank and graphics bank based on it */
- memory_set_bank(field->port->machine, "bank1", gmgalax_selected_game);
+ memory_set_bank(field->port->machine(), "bank1", gmgalax_selected_game);
galaxian_gfxbank_w(space, 0, gmgalax_selected_game);
/* reset the stars */
galaxian_stars_enable_w(space, 0, 0);
/* reset the CPU */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
@@ -1045,7 +1045,7 @@ static CUSTOM_INPUT( gmgalax_port_r )
const char *portname = (const char *)param;
if (gmgalax_selected_game != 0)
portname += strlen(portname) + 1;
- return input_port_read(field->port->machine, portname);
+ return input_port_read(field->port->machine(), portname);
}
@@ -1058,8 +1058,8 @@ static CUSTOM_INPUT( gmgalax_port_r )
static WRITE8_HANDLER( zigzag_bankswap_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
- memory_set_bank(space->machine, "bank2", ~data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank2", ~data & 1);
}
@@ -1072,7 +1072,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w )
/* bit 0 = WRITE */
/* bit 1 = C/D */
if ((offset & 1) != 0)
- ay8910_data_address_w(space->machine->device("aysnd"), offset >> 1, zigzag_ay8910_latch);
+ ay8910_data_address_w(space->machine().device("aysnd"), offset >> 1, zigzag_ay8910_latch);
break;
case 0x100:
@@ -1096,7 +1096,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w )
static CUSTOM_INPUT( azurian_port_r )
{
- return (input_port_read(field->port->machine, "FAKE") >> (FPTR)param) & 1;
+ return (input_port_read(field->port->machine(), "FAKE") >> (FPTR)param) & 1;
}
@@ -1110,7 +1110,7 @@ static CUSTOM_INPUT( azurian_port_r )
static CUSTOM_INPUT( kingball_muxbit_r )
{
/* multiplex the service mode switch with a speech DIP switch */
- return (input_port_read(field->port->machine, "FAKE") >> kingball_speech_dip) & 1;
+ return (input_port_read(field->port->machine(), "FAKE") >> kingball_speech_dip) & 1;
}
@@ -1119,7 +1119,7 @@ static CUSTOM_INPUT( kingball_noise_r )
/* bit 5 is the NOISE line from the sound circuit. The code just verifies
that it's working, doesn't actually use return value, so we can just use
rand() */
- return field->port->machine->rand() & 1;
+ return field->port->machine().rand() & 1;
}
@@ -1164,21 +1164,21 @@ static WRITE8_HANDLER( mshuttle_ay8910_cs_w )
static WRITE8_HANDLER( mshuttle_ay8910_control_w )
{
if (!mshuttle_ay8910_cs)
- ay8910_address_w(space->machine->device("aysnd"), offset, data);
+ ay8910_address_w(space->machine().device("aysnd"), offset, data);
}
static WRITE8_HANDLER( mshuttle_ay8910_data_w )
{
if (!mshuttle_ay8910_cs)
- ay8910_data_w(space->machine->device("aysnd"), offset, data);
+ ay8910_data_w(space->machine().device("aysnd"), offset, data);
}
static READ8_HANDLER( mshuttle_ay8910_data_r )
{
if (!mshuttle_ay8910_cs)
- return ay8910_r(space->machine->device("aysnd"), offset);
+ return ay8910_r(space->machine().device("aysnd"), offset);
return 0xff;
}
@@ -1215,13 +1215,13 @@ static READ8_HANDLER( jumpbug_protection_r )
static WRITE8_HANDLER( checkman_sound_command_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
{
- cputag_set_input_line(timer.machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -2412,9 +2412,9 @@ MACHINE_CONFIG_END
*
*************************************/
-static void decode_mooncrst(running_machine *machine, int length, UINT8 *dest)
+static void decode_mooncrst(running_machine &machine, int length, UINT8 *dest)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int offs;
for (offs = 0; offs < length; offs++)
@@ -2429,7 +2429,7 @@ static void decode_mooncrst(running_machine *machine, int length, UINT8 *dest)
}
-static void decode_checkman(running_machine *machine)
+static void decode_checkman(running_machine &machine)
{
/*
Encryption Table
@@ -2476,8 +2476,8 @@ static void decode_checkman(running_machine *machine)
{ 0,2,0,2 },
{ 1,4,1,4 }
};
- UINT8 *rombase = machine->region("maincpu")->base();
- UINT32 romlength = machine->region("maincpu")->bytes();
+ UINT8 *rombase = machine.region("maincpu")->base();
+ UINT32 romlength = machine.region("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2491,10 +2491,10 @@ static void decode_checkman(running_machine *machine)
}
-static void decode_dingoe(running_machine *machine)
+static void decode_dingoe(running_machine &machine)
{
- UINT8 *rombase = machine->region("maincpu")->base();
- UINT32 romlength = machine->region("maincpu")->bytes();
+ UINT8 *rombase = machine.region("maincpu")->base();
+ UINT32 romlength = machine.region("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2514,9 +2514,9 @@ static void decode_dingoe(running_machine *machine)
}
-static void decode_frogger_sound(running_machine *machine)
+static void decode_frogger_sound(running_machine &machine)
{
- UINT8 *rombase = machine->region("audiocpu")->base();
+ UINT8 *rombase = machine.region("audiocpu")->base();
UINT32 offs;
/* the first ROM of the sound CPU has data lines D0 and D1 swapped */
@@ -2525,9 +2525,9 @@ static void decode_frogger_sound(running_machine *machine)
}
-static void decode_frogger_gfx(running_machine *machine)
+static void decode_frogger_gfx(running_machine &machine)
{
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT32 offs;
/* the 2nd gfx ROM has data lines D0 and D1 swapped */
@@ -2536,10 +2536,10 @@ static void decode_frogger_gfx(running_machine *machine)
}
-static void decode_anteater_gfx(running_machine *machine)
+static void decode_anteater_gfx(running_machine &machine)
{
- UINT32 romlength = machine->region("gfx1")->bytes();
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT32 romlength = machine.region("gfx1")->bytes();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2556,10 +2556,10 @@ static void decode_anteater_gfx(running_machine *machine)
}
-static void decode_losttomb_gfx(running_machine *machine)
+static void decode_losttomb_gfx(running_machine &machine)
{
- UINT32 romlength = machine->region("gfx1")->bytes();
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT32 romlength = machine.region("gfx1")->bytes();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2576,14 +2576,14 @@ static void decode_losttomb_gfx(running_machine *machine)
}
-static void decode_superbon(running_machine *machine)
+static void decode_superbon(running_machine &machine)
{
offs_t i;
UINT8 *RAM;
/* Deryption worked out by hand by Chris Hardy. */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0;i < 0x1000;i++)
{
@@ -2614,7 +2614,7 @@ static void decode_superbon(running_machine *machine)
*************************************/
static void common_init(
- running_machine *machine,
+ running_machine &machine,
galaxian_draw_bullet_func draw_bullet,
galaxian_draw_background_func draw_background,
galaxian_extend_tile_info_func extend_tile_info,
@@ -2631,9 +2631,9 @@ static void common_init(
}
-static void unmap_galaxian_sound(running_machine *machine, offs_t base)
+static void unmap_galaxian_sound(running_machine &machine, offs_t base)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->unmap_write(base + 0x0004, base + 0x0007, 0, 0x07f8);
space->unmap_write(base + 0x0800, base + 0x0807, 0, 0x07f8);
@@ -2656,7 +2656,7 @@ static DRIVER_INIT( galaxian )
static DRIVER_INIT( nolock )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
@@ -2668,7 +2668,7 @@ static DRIVER_INIT( nolock )
static DRIVER_INIT( azurian )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* yellow bullets instead of white ones */
common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2680,24 +2680,24 @@ static DRIVER_INIT( azurian )
static DRIVER_INIT( gmgalax )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
/* ROM is banked */
space->install_read_bank(0x0000, 0x3fff, "bank1");
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
- gmgalax_game_changed(machine->m_portlist.first()->fieldlist, NULL, 0, 0);
+ gmgalax_game_changed(machine.m_portlist.first()->fieldlist, NULL, 0, 0);
state_save_register_global(machine, gmgalax_selected_game);
}
static DRIVER_INIT( pisces )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
@@ -2709,7 +2709,7 @@ static DRIVER_INIT( pisces )
static DRIVER_INIT( batman2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
@@ -2721,7 +2721,7 @@ static DRIVER_INIT( batman2 )
static DRIVER_INIT( frogg )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
@@ -2744,7 +2744,7 @@ static DRIVER_INIT( mooncrst )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* decrypt program code */
- decode_mooncrst(machine, 0x8000, machine->region("maincpu")->base());
+ decode_mooncrst(machine, 0x8000, machine.region("maincpu")->base());
}
@@ -2757,7 +2757,7 @@ static DRIVER_INIT( mooncrsu )
static DRIVER_INIT( mooncrgx )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2769,7 +2769,7 @@ static DRIVER_INIT( mooncrgx )
static DRIVER_INIT( moonqsr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
/* video extensions */
@@ -2787,7 +2787,7 @@ static WRITE8_HANDLER( artic_gfxbank_w )
static DRIVER_INIT( pacmanbl )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
@@ -2800,11 +2800,11 @@ static READ8_HANDLER( tenspot_dsw_read )
{
char tmp[64];
sprintf(tmp,"IN2_GAME%d", tenspot_current_game);
- return input_port_read_safe(space->machine, tmp, 0x00);
+ return input_port_read_safe(space->machine(), tmp, 0x00);
}
-void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
+void tenspot_set_game_bank(running_machine& machine, int bank, int from_game)
{
char tmp[64];
UINT8* srcregion;
@@ -2813,15 +2813,15 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
int x;
sprintf(tmp,"game_%d_cpu", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("maincpu")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("maincpu")->base();
memcpy(dstregion, srcregion, 0x4000);
sprintf(tmp,"game_%d_temp", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("gfx1")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("gfx1")->base();
memcpy(dstregion, srcregion, 0x2000);
- dstregion = machine->region("gfx2")->base();
+ dstregion = machine.region("gfx2")->base();
memcpy(dstregion, srcregion, 0x2000);
if (from_game)
@@ -2829,18 +2829,18 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
for (x=0;x<0x200;x++)
{
- gfx_element_mark_dirty(machine->gfx[0], x);
+ gfx_element_mark_dirty(machine.gfx[0], x);
}
for (x=0;x<0x80;x++)
{
- gfx_element_mark_dirty(machine->gfx[1], x);
+ gfx_element_mark_dirty(machine.gfx[1], x);
}
}
sprintf(tmp,"game_%d_prom", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("proms")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("proms")->base();
memcpy(dstregion, srcregion, 0x20);
color_prom = dstregion;
@@ -2849,7 +2849,7 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
static DRIVER_INIT( tenspot )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* these are needed for batman part 2 to work properly, this banking is probably a property of the artic board,
which tenspot appears to have copied */
@@ -2886,7 +2886,7 @@ static DRIVER_INIT( devilfsg )
static DRIVER_INIT( zigzag )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, NULL, galaxian_draw_background, NULL, NULL);
@@ -2895,13 +2895,13 @@ static DRIVER_INIT( zigzag )
/* make ROMs 2 & 3 swappable */
space->install_read_bank(0x2000, 0x2fff, "bank1");
space->install_read_bank(0x3000, 0x3fff, "bank2");
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x2000, 0x1000);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("maincpu")->base() + 0x2000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
the fixed area only extends to 0x1fff */
space->install_read_bank(0x0000, 0x1fff, "bank3");
- memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base() + 0x0000);
+ memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base() + 0x0000);
/* handler for doing the swaps */
space->install_legacy_write_handler(0x7002, 0x7002, 0, 0x07f8, FUNC(zigzag_bankswap_w));
@@ -2927,8 +2927,8 @@ static DRIVER_INIT( jumpbug )
static DRIVER_INIT( checkman )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2947,7 +2947,7 @@ static DRIVER_INIT( checkman )
static DRIVER_INIT( checkmaj )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2962,7 +2962,7 @@ static DRIVER_INIT( checkmaj )
static DRIVER_INIT( dingo )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2977,8 +2977,8 @@ static DRIVER_INIT( dingo )
static DRIVER_INIT( dingoe )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2999,7 +2999,7 @@ static DRIVER_INIT( dingoe )
static DRIVER_INIT( skybase )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
@@ -3011,14 +3011,14 @@ static DRIVER_INIT( skybase )
space->install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x5fff, machine->region("maincpu")->base());
+ space->install_rom(0x0000, 0x5fff, machine.region("maincpu")->base());
}
-static void mshuttle_decode(running_machine *machine, const UINT8 convtable[8][16])
+static void mshuttle_decode(running_machine &machine, const UINT8 convtable[8][16])
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
@@ -3095,7 +3095,7 @@ static DRIVER_INIT( mshuttlj )
static DRIVER_INIT( kingball )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -3112,7 +3112,7 @@ static DRIVER_INIT( kingball )
static DRIVER_INIT( scorpnmc )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
@@ -3122,7 +3122,7 @@ static DRIVER_INIT( scorpnmc )
space->install_legacy_write_handler(0xb001, 0xb001, 0, 0x7f8, FUNC(irq_enable_w));
/* extra ROM */
- space->install_rom(0x5000, 0x67ff, machine->region("maincpu")->base() + 0x5000);
+ space->install_rom(0x5000, 0x67ff, machine.region("maincpu")->base() + 0x5000);
/* install RAM at $4000-$4800 */
space->install_ram(0x4000, 0x47ff);
@@ -3133,7 +3133,7 @@ static DRIVER_INIT( scorpnmc )
static DRIVER_INIT( thepitm )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -3146,7 +3146,7 @@ static DRIVER_INIT( thepitm )
space->unmap_write(0xb004, 0xb004, 0, 0x07f8);
/* extend ROM */
- space->install_rom(0x0000, 0x47ff, machine->region("maincpu")->base());
+ space->install_rom(0x0000, 0x47ff, machine.region("maincpu")->base());
}
/*************************************
@@ -3157,7 +3157,7 @@ static DRIVER_INIT( thepitm )
static DRIVER_INIT( theend )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -3176,7 +3176,7 @@ static DRIVER_INIT( scramble )
static DRIVER_INIT( explorer )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
@@ -3202,14 +3202,14 @@ static DRIVER_INIT( sfx )
galaxian_sfx_tilemap = TRUE;
/* sound board has space for extra ROM */
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("audiocpu")->base());
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("audiocpu")->base());
}
static DRIVER_INIT( atlantis )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
@@ -3251,7 +3251,7 @@ static DRIVER_INIT( frogger )
static DRIVER_INIT( froggrmc )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
@@ -3296,24 +3296,24 @@ static DRIVER_INIT( amidar )
static DRIVER_INIT( scorpion )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* hook up AY8910 */
- machine->device("audiocpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x00, 0xff, FUNC(scorpion_ay8910_r), FUNC(scorpion_ay8910_w));
+ machine.device("audiocpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x00, 0xff, FUNC(scorpion_ay8910_r), FUNC(scorpion_ay8910_w));
/* extra ROM */
space->install_read_bank(0x5800, 0x67ff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x5800);
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x5800);
/* no background related */
// space->nop_write(0x6803, 0x6803);
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(scorpion_digitalker_intr_r));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(scorpion_digitalker_intr_r));
/*
{
- const UINT8 *rom = machine->region("speech")->base();
+ const UINT8 *rom = machine.region("speech")->base();
int i;
for (i = 0; i < 0x2c; i++)
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 891cec9d977..fb02f255b49 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -580,9 +580,9 @@ static ADDRESS_MAP_START( scramblb_map, AS_PROGRAM, 8 )
ADDRESS_MAP_END
static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
-static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read(space->machine, "IN0") >> offset) & 0x1; }
-static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read(space->machine, "IN1") >> offset) & 0x1; }
-static READ8_HANDLER( scramb2_port2_r ) { return (input_port_read(space->machine, "IN2") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read(space->machine(), "IN0") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read(space->machine(), "IN1") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port2_r ) { return (input_port_read(space->machine(), "IN2") >> offset) & 0x1; }
static ADDRESS_MAP_START( scramb2_map, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM
@@ -917,9 +917,9 @@ static CUSTOM_INPUT( vpool_lives_r )
switch (bit_mask)
{
case 0x40: /* vpool : IN1 (0xa800) bit 6 */
- return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "LIVES") & bit_mask) >> 6);
case 0x01: /* vpool : DSW (0xb000) bit 0 */
- return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "LIVES") & bit_mask) >> 0);
default:
logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
@@ -1064,14 +1064,14 @@ static CUSTOM_INPUT( ckongg_coinage_r )
switch (bit_mask)
{
case 0x0c: /* ckongg : DSW (0xc800) bits 2 and 3 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 2);
case 0x40: /* ckongg : IN1 (0xc400) bit 6 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0xc0: /* ckongmc : IN1 (0xa800) bits 6 and 7 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0x01: /* ckongmc : DSW (0xb000) bit 0 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
default:
logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
@@ -1432,9 +1432,9 @@ static CUSTOM_INPUT( dkongjrm_coinage_r )
switch (bit_mask)
{
case 0xc0: /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0x01: /* dkongjrm : DSW (0xb0??) bit 0 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
default:
logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
diff --git a/src/mame/drivers/galdrvr.c b/src/mame/drivers/galdrvr.c
index db97830d1b6..583e2ff7e6a 100644
--- a/src/mame/drivers/galdrvr.c
+++ b/src/mame/drivers/galdrvr.c
@@ -2362,7 +2362,7 @@ static CUSTOM_INPUT( moonwar_dial_r )
static int counter_74ls161[2] = {0, 0};
static int direction[2] = {0, 0};
- signed char dialread = input_port_read(field->port->machine, dialname[p]);
+ signed char dialread = input_port_read(field->port->machine(), dialname[p]);
UINT8 ret;
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index cb1658fbc04..ae241bc447a 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -398,10 +398,10 @@ GFXDECODE_END
static MACHINE_START( galivan )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &rombase[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
@@ -415,10 +415,10 @@ static MACHINE_START( galivan )
static MACHINE_START( ninjemak )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
@@ -431,9 +431,9 @@ static MACHINE_START( ninjemak )
static MACHINE_RESET( galivan )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
// state->layers = 0x60;
state->layers = 0;
@@ -445,9 +445,9 @@ static MACHINE_RESET( galivan )
static MACHINE_RESET( ninjemak )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
state->scrollx[0] = state->scrollx[1] = 0;
state->scrolly[0] = state->scrolly[1] = 0;
@@ -1019,16 +1019,16 @@ ROM_END
static WRITE8_HANDLER( youmab_extra_bank_w )
{
if (data == 0xff)
- memory_set_bank(space->machine, "bank2", 1);
+ memory_set_bank(space->machine(), "bank2", 1);
else if (data == 0x00)
- memory_set_bank(space->machine, "bank2", 0);
+ memory_set_bank(space->machine(), "bank2", 0);
else
printf("data %03x\n", data);
}
static READ8_HANDLER( youmab_8a_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( youmab_81_w )
@@ -1043,20 +1043,20 @@ static WRITE8_HANDLER( youmab_84_w )
static DRIVER_INIT( youmab )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x82, 0x82, FUNC(youmab_extra_bank_w)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
- memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base());
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x82, 0x82, FUNC(youmab_extra_bank_w)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
+ memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base());
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("user2")->base(), 0x4000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("user2")->base(), 0x4000);
memory_set_bank(machine, "bank2", 0);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x81, 0x81, FUNC(youmab_81_w)); // ?? often, alternating values
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x84, 0x84, FUNC(youmab_84_w)); // ?? often, sequence..
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x81, 0x81, FUNC(youmab_81_w)); // ?? often, alternating values
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x84, 0x84, FUNC(youmab_84_w)); // ?? often, sequence..
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xd800, 0xd81f); // scrolling isn't here..
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xd800, 0xd81f); // scrolling isn't here..
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x8a, 0x8a, FUNC(youmab_8a_r)); // ???
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x8a, 0x8a, FUNC(youmab_8a_r)); // ???
}
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 4eec266e2a6..5364c1705dc 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -37,13 +37,13 @@ To Do:
static READ16_DEVICE_HANDLER(galpani2_eeprom_r)
{
- galpani2_state *state = device->machine->driver_data<galpani2_state>();
+ galpani2_state *state = device->machine().driver_data<galpani2_state>();
return (state->eeprom_word & ~1) | (eeprom_read_bit(device) & 1);
}
static WRITE16_DEVICE_HANDLER(galpani2_eeprom_w)
{
- galpani2_state *state = device->machine->driver_data<galpani2_state>();
+ galpani2_state *state = device->machine().driver_data<galpani2_state>();
COMBINE_DATA( &state->eeprom_word );
if ( ACCESSING_BITS_0_7 )
{
@@ -78,7 +78,7 @@ static MACHINE_RESET( galpani2 )
kaneko16_sprite_xoffs = 0x10000 - 0x16c0 + 0xc00;
kaneko16_sprite_yoffs = 0x000;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk
}
static void galpani2_write_kaneko(device_t *device)
@@ -112,9 +112,9 @@ static void galpani2_write_kaneko(device_t *device)
static WRITE8_HANDLER( galpani2_mcu_init_w )
{
- running_machine *machine = space->machine;
- address_space *srcspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *dstspace = machine->device("sub")->memory().space(AS_PROGRAM);
+ running_machine &machine = space->machine();
+ address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM);
UINT32 mcu_address, mcu_data;
for ( mcu_address = 0x100010; mcu_address < (0x100010 + 6); mcu_address += 1 )
@@ -125,10 +125,10 @@ static WRITE8_HANDLER( galpani2_mcu_init_w )
cputag_set_input_line(machine, "sub", INPUT_LINE_IRQ7, HOLD_LINE); //MCU Initialised
}
-static void galpani2_mcu_nmi1(running_machine *machine)
+static void galpani2_mcu_nmi1(running_machine &machine)
{
- address_space *srcspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *dstspace = machine->device("sub")->memory().space(AS_PROGRAM);
+ address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM);
UINT32 mcu_list, mcu_command, mcu_address, mcu_extra, mcu_src, mcu_dst, mcu_size;
for ( mcu_list = 0x100021; mcu_list < (0x100021 + 0x40); mcu_list += 4 )
@@ -144,7 +144,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
if (mcu_command != 0)
{
logerror("%s : MCU [$%06X] endidx = $%02X / command = $%02X addr = $%04X ? = $%02X.\n",
- machine->describe_context(),
+ machine.describe_context(),
mcu_list,
srcspace->read_byte(0x100020),
mcu_command,
@@ -167,7 +167,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) +
(srcspace->read_byte(mcu_address + 9)<<0) ;
- logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
+ logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
for( ; mcu_size > 0 ; mcu_size-- )
{
@@ -192,7 +192,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) +
(srcspace->read_byte(mcu_address + 9)<<0) ;
- logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
+ logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
for( ; mcu_size > 0 ; mcu_size-- )
{
@@ -220,7 +220,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
srcspace->write_byte(mcu_address+0,0xff);
srcspace->write_byte(mcu_address+1,0xff);
- logerror("%s : MCU ERROR, unknown command $%02X\n",machine->describe_context(),mcu_command);
+ logerror("%s : MCU ERROR, unknown command $%02X\n",machine.describe_context(),mcu_command);
}
/* Erase command (so that it won't be processed again)? */
@@ -228,29 +228,29 @@ static void galpani2_mcu_nmi1(running_machine *machine)
}
}
-static void galpani2_mcu_nmi2(running_machine *machine)
+static void galpani2_mcu_nmi2(running_machine &machine)
{
- galpani2_write_kaneko(machine->device("maincpu"));
- //logerror("%s : MCU executes CHECKs synchro\n", machine->describe_context());
+ galpani2_write_kaneko(machine.device("maincpu"));
+ //logerror("%s : MCU executes CHECKs synchro\n", machine.describe_context());
}
static WRITE8_HANDLER( galpani2_mcu_nmi1_w ) //driven by CPU1's int5 ISR
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
//for galpan2t:
//Triggered from 'maincpu' (00007D60),once, with no command, using alternate line, during init
//Triggered from 'maincpu' (000080BE),once, for unknown command, during init
//Triggered from 'maincpu' (0000741E),from here on...driven by int5, even if there's no command
- if ( (data & 1) && !(state->old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(space->machine);
- //if ( (data & 0x10) && !(state->old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(space->machine);
+ if ( (data & 1) && !(state->old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(space->machine());
+ //if ( (data & 0x10) && !(state->old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(space->machine());
//alternate line, same function?
state->old_mcu_nmi1 = data;
}
static WRITE8_HANDLER( galpani2_mcu_nmi2_w ) //driven by CPU2's int5 ISR
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
- if ( (data & 1) && !(state->old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(space->machine);
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ if ( (data & 1) && !(state->old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(space->machine());
state->old_mcu_nmi2 = data;
}
@@ -265,10 +265,10 @@ static WRITE8_HANDLER( galpani2_mcu_nmi2_w ) //driven by CPU2's int5 ISR
static WRITE8_HANDLER( galpani2_coin_lockout_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x08);
// & 0x10 CARD in lockout?
// & 0x20 CARD in lockout?
// & 0x40 CARD out
@@ -276,8 +276,8 @@ static WRITE8_HANDLER( galpani2_coin_lockout_w )
static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
{
- UINT8 *ROM = device->machine->region("oki1")->base();
- logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data);
+ UINT8 *ROM = device->machine().region("oki1")->base();
+ logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
}
@@ -285,7 +285,7 @@ static WRITE8_DEVICE_HANDLER( galpani2_oki2_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0xf) );
- logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data);
+ logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
}
@@ -350,9 +350,9 @@ ADDRESS_MAP_END
static READ16_HANDLER( galpani2_bankedrom_r )
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
- UINT16 *ROM = (UINT16 *) space->machine->region( "user1" )->base();
- size_t len = space->machine->region( "user1" )->bytes() / 2;
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ UINT16 *ROM = (UINT16 *) space->machine().region( "user1" )->base();
+ size_t len = space->machine().region( "user1" )->bytes() / 2;
offset += (0x800000/2) * (*state->rombank & 0x0003);
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 6033598847d..419ad940464 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -142,27 +142,27 @@ static INTERRUPT_GEN( galpani3_vblank ) // 2, 3, 5 ?
static VIDEO_START(galpani3)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
/* so we can use suprnova.c */
state->spriteram32 = auto_alloc_array(machine, UINT32, 0x4000/4);
- machine->generic.spriteram_size = 0x4000;
+ machine.generic.spriteram_size = 0x4000;
state->spc_regs = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_bitmap_1 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
- state->spritegen = machine->device<sknsspr_device>("spritegen");
+ state->spritegen = machine.device<sknsspr_device>("spritegen");
state->spritegen->skns_sprite_kludge(0,0);
}
-static int gp3_is_alpha_pen(running_machine *machine, int pen)
+static int gp3_is_alpha_pen(running_machine &machine, int pen)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
UINT16 dat = 0;
if (pen<0x4000)
{
- dat = machine->generic.paletteram.u16[pen];
+ dat = machine.generic.paletteram.u16[pen];
}
else if (pen<0x4100)
{
@@ -196,12 +196,12 @@ static int gp3_is_alpha_pen(running_machine *machine, int pen)
static SCREEN_UPDATE(galpani3)
{
- galpani3_state *state = screen->machine->driver_data<galpani3_state>();
+ galpani3_state *state = screen->machine().driver_data<galpani3_state>();
int x,y;
UINT16* src1;
UINT32* dst;
UINT16 pixdata1;
- const pen_t *paldata = screen->machine->pens;
+ const pen_t *paldata = screen->machine().pens;
bitmap_fill(bitmap, cliprect, 0x0000);
@@ -261,7 +261,7 @@ static SCREEN_UPDATE(galpani3)
UINT16 pen = dat1+0x4000;
UINT32 pal = paldata[pen];
- if (gp3_is_alpha_pen(screen->machine, pen))
+ if (gp3_is_alpha_pen(screen->machine(), pen))
{
int r,g,b;
r = (pal & 0x00ff0000)>>16;
@@ -289,7 +289,7 @@ static SCREEN_UPDATE(galpani3)
UINT16 pen = dat2+0x4100;
UINT32 pal = paldata[pen];
- if (gp3_is_alpha_pen(screen->machine, pen))
+ if (gp3_is_alpha_pen(screen->machine(), pen))
{
int r,g,b;
r = (pal & 0x00ff0000)>>16;
@@ -321,20 +321,20 @@ static SCREEN_UPDATE(galpani3)
/*
else if (pridat==0x2f) // area outside of the girl
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x00) // the initial line / box that gets drawn
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x30) // during the 'gals boxes' on the intro
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x0c) // 'nice' at end of level
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else
{
@@ -347,7 +347,7 @@ static SCREEN_UPDATE(galpani3)
bitmap_fill(state->sprite_bitmap_1, cliprect, 0x0000);
- state->spritegen->skns_draw_sprites(screen->machine, state->sprite_bitmap_1, cliprect, state->spriteram32, screen->machine->generic.spriteram_size, screen->machine->region("gfx1")->base(), screen->machine->region ("gfx1")->bytes(), state->spc_regs );
+ state->spritegen->skns_draw_sprites(screen->machine(), state->sprite_bitmap_1, cliprect, state->spriteram32, screen->machine().generic.spriteram_size, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->spc_regs );
// ignoring priority bits for now..
for (y=0;y<240;y++)
@@ -434,7 +434,7 @@ INPUT_PORTS_END
static WRITE16_HANDLER( galpani3_suprnova_sprite32_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->spriteram[offset]);
offset>>=1;
state->spriteram32[offset]=(state->spriteram[offset*2+1]<<16) | (state->spriteram[offset*2]);
@@ -442,7 +442,7 @@ static WRITE16_HANDLER( galpani3_suprnova_sprite32_w )
static WRITE16_HANDLER( galpani3_suprnova_sprite32regs_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->sprregs[offset]);
offset>>=1;
state->spc_regs[offset]=(state->sprregs[offset*2+1]<<16) | (state->sprregs[offset*2]);
@@ -457,14 +457,14 @@ static WRITE16_HANDLER( galpani3_suprnova_sprite32regs_w )
***************************************************************************/
-static void galpani3_mcu_run(running_machine *machine)
+static void galpani3_mcu_run(running_machine &machine)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
UINT16 mcu_command = state->mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = state->mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
UINT16 mcu_subcmd = state->mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
- logerror("%s: MCU executed command : %04X %04X\n",machine->describe_context(),mcu_command,mcu_offset*2);
+ logerror("%s: MCU executed command : %04X %04X\n",machine.describe_context(),mcu_command,mcu_offset*2);
/* the only MCU commands found in program code are:
0x04: protection: provide code/data,
@@ -477,7 +477,7 @@ static void galpani3_mcu_run(running_machine *machine)
case 0x03: // DSW
{
state->mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
@@ -534,7 +534,7 @@ static void galpani3_mcu_run(running_machine *machine)
#define GALPANI3_MCU_COM_W(_n_) \
static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \
{ \
- galpani3_state *state = space->machine->driver_data<galpani3_state>(); \
+ galpani3_state *state = space->machine().driver_data<galpani3_state>(); \
COMBINE_DATA(&state->mcu_com[_n_]); \
if (state->mcu_com[0] != 0xFFFF) return; \
if (state->mcu_com[1] != 0xFFFF) return; \
@@ -542,7 +542,7 @@ static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \
if (state->mcu_com[3] != 0xFFFF) return; \
\
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- galpani3_mcu_run(space->machine); \
+ galpani3_mcu_run(space->machine()); \
}
GALPANI3_MCU_COM_W(0)
@@ -560,7 +560,7 @@ static READ16_HANDLER( galpani3_mcu_status_r )
static READ16_HANDLER( galpani3_regs1_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -585,7 +585,7 @@ static READ16_HANDLER( galpani3_regs1_r )
static READ16_HANDLER( galpani3_regs2_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -610,7 +610,7 @@ static READ16_HANDLER( galpani3_regs2_r )
static READ16_HANDLER( galpani3_regs3_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -686,16 +686,16 @@ static void gp3_do_rle(UINT32 address, UINT16*framebuffer, UINT8* rledata)
static WRITE16_HANDLER( galpani3_regs1_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs1_address_w %04x\n",data);
COMBINE_DATA(&state->regs1_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs1_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs1_address_regs[1]| (state->regs1_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs1_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, state->framebuffer1, rledata);
@@ -704,16 +704,16 @@ static WRITE16_HANDLER( galpani3_regs1_go_w )
static WRITE16_HANDLER( galpani3_regs2_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs2_address_w %04x\n",data);
COMBINE_DATA(&state->regs2_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs2_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs2_address_regs[1]| (state->regs2_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs2_go_w? %08x\n", address );
@@ -726,137 +726,137 @@ static WRITE16_HANDLER( galpani3_regs2_go_w )
static WRITE16_HANDLER( galpani3_regs3_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs3_address_w %04x\n",data);
COMBINE_DATA(&state->regs3_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs3_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs3_address_regs[1]| (state->regs3_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs3_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, state->framebuffer3, rledata);
}
-static void set_color_555_gp3(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+static void set_color_555_gp3(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
static WRITE16_HANDLER( galpani3_framebuffer1_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer1_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4000, 5, 10, 0, state->framebuffer1_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4000, 5, 10, 0, state->framebuffer1_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer2_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer2_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4100, 5, 10, 0, state->framebuffer2_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4100, 5, 10, 0, state->framebuffer2_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer3_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4200, 5, 10, 0, state->framebuffer3_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4200, 5, 10, 0, state->framebuffer3_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer3_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_scrollx = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_scrollx = data;
}
static WRITE16_HANDLER( galpani3_framebuffer1_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer1_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_scrollx = data;
}
static WRITE16_HANDLER( galpani3_priority_buffer_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->priority_buffer_scrollx = data;
}
static WRITE16_HANDLER( galpani3_priority_buffer_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->priority_buffer_scrolly = data;
}
/* I'm not convinced these are enables */
static WRITE16_HANDLER( galpani3_framebuffer1_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_enable = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_enable = data;
}
static WRITE16_HANDLER( galpani3_framebuffer3_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_enable = data;
}
/* definitely looks like a cycling bg colour used for the girls */
static WRITE16_HANDLER( galpani3_framebuffer1_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer1_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4300, 5, 10, 0, state->framebuffer1_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4300, 5, 10, 0, state->framebuffer1_bgcol[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer2_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer2_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4301, 5, 10, 0, state->framebuffer2_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4301, 5, 10, 0, state->framebuffer2_bgcol[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer3_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4302, 5, 10, 0, state->framebuffer3_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4302, 5, 10, 0, state->framebuffer3_bgcol[offset]);
}
@@ -1003,7 +1003,7 @@ ROM_END
static DRIVER_INIT( galpani3 )
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
DRIVER_INIT_CALL( decrypt_toybox_rom );
memset(state->mcu_com, 0, 4 * sizeof( UINT16) );
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 868488b5ede..dbbc21dfda9 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -127,7 +127,7 @@ The current set of Super Model is an example of type C
static SCREEN_EOF( galpanic )
{
- device_t *pandora = machine->device("pandora");
+ device_t *pandora = machine.device("pandora");
pandora_eof(pandora);
}
@@ -153,11 +153,11 @@ static INTERRUPT_GEN( galhustl_interrupt )
static WRITE16_HANDLER( galpanic_6295_bankswitch_w )
{
- device_t *pandora = space->machine->device("pandora");
+ device_t *pandora = space->machine().device("pandora");
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
@@ -170,7 +170,7 @@ static WRITE16_HANDLER( galpanica_6295_bankswitch_w )
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
@@ -179,7 +179,7 @@ static WRITE16_HANDLER( galpanica_6295_bankswitch_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( galpanica_misc_w )
{
- device_t *pandora = machine->device("pandora");
+ device_t *pandora = machine.device("pandora");
if (ACCESSING_BITS_0_7)
{
@@ -194,11 +194,11 @@ static WRITE16_HANDLER( galpanic_coin_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x100);
- coin_counter_w(space->machine, 1, data & 0x200);
+ coin_counter_w(space->machine(), 0, data & 0x100);
+ coin_counter_w(space->machine(), 1, data & 0x200);
- coin_lockout_w(space->machine, 0, ~data & 0x400);
- coin_lockout_w(space->machine, 1, ~data & 0x800);
+ coin_lockout_w(space->machine(), 0, ~data & 0x400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x800);
}
}
@@ -233,7 +233,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( kludge )
{
- return space->machine->rand() & 0x0700;
+ return space->machine().rand() & 0x0700;
}
/* a kludge! */
@@ -242,7 +242,7 @@ static READ8_DEVICE_HANDLER( comad_okim6295_r )
UINT16 retvalue;
// retvalue = okim6295_r(offset,mem_mask) << 8; // doesn't work, causes lockups when girls change..
- retvalue = device->machine->rand();
+ retvalue = device->machine().rand();
return retvalue;
}
@@ -306,7 +306,7 @@ ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
READ16_HANDLER( zipzap_random_read )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
diff --git a/src/mame/drivers/galspnbl.c b/src/mame/drivers/galspnbl.c
index 5c0fedcef03..492c47fb83b 100644
--- a/src/mame/drivers/galspnbl.c
+++ b/src/mame/drivers/galspnbl.c
@@ -28,7 +28,7 @@ TODO:
static WRITE16_HANDLER( soundcommand_w )
{
- galspnbl_state *state = space->machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = space->machine().driver_data<galspnbl_state>();
if (ACCESSING_BITS_0_7)
{
@@ -190,7 +190,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- galspnbl_state *state = device->machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = device->machine().driver_data<galspnbl_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -202,9 +202,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( galspnbl )
{
- galspnbl_state *state = machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = machine.driver_data<galspnbl_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( galspnbl, galspnbl_state )
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index c506431231f..c05f219b2fb 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -138,9 +138,9 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele
static SCREEN_UPDATE(gamecstl)
{
- gamecstl_state *state = screen->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = screen->machine().driver_data<gamecstl_state>();
int i, j;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
UINT32 *cga = state->cga_ram;
int index = 0;
@@ -189,7 +189,7 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
// mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
return state->mxtc_config_reg[reg];
@@ -197,8 +197,8 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function,
static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
-// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data);
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
+// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data);
switch(reg)
{
@@ -206,11 +206,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- memory_set_bankptr(busdevice->machine, "bank1", state->bios_ram);
+ memory_set_bankptr(busdevice->machine(), "bank1", state->bios_ram);
}
else // disable RAM access (reads go to BIOS ROM)
{
- memory_set_bankptr(busdevice->machine, "bank1", busdevice->machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(busdevice->machine(), "bank1", busdevice->machine().region("user1")->base() + 0x30000);
}
break;
}
@@ -219,9 +219,9 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
state->mxtc_config_reg[reg] = data;
}
-static void intel82439tx_init(running_machine *machine)
+static void intel82439tx_init(running_machine &machine)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
state->mxtc_config_reg[0x60] = 0x02;
state->mxtc_config_reg[0x61] = 0x02;
state->mxtc_config_reg[0x62] = 0x02;
@@ -276,15 +276,15 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
// mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
return state->piix4_config_reg[function][reg];
}
static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
-// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data);
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
+// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data);
state->piix4_config_reg[function][reg] = data;
}
@@ -374,7 +374,7 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static WRITE32_HANDLER(bios_ram_w)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
if (state->mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
COMBINE_DATA(state->bios_ram + offset);
@@ -392,7 +392,7 @@ static WRITE32_HANDLER(bios_ram_w)
static READ8_HANDLER(at_page8_r)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8)
@@ -416,7 +416,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -439,7 +439,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -448,7 +448,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -458,7 +458,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -467,7 +467,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static void set_dma_channel(device_t *device, int channel, int state)
{
- gamecstl_state *drvstate = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = device->machine().driver_data<gamecstl_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -602,7 +602,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- gamecstl_state *state = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = device->machine().driver_data<gamecstl_state>();
int r = 0;
r = pic8259_acknowledge(state->pic8259_2);
if (r==0)
@@ -614,19 +614,19 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(gamecstl)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
- state->pit8254 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
+ state->pit8254 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
static MACHINE_RESET(gamecstl)
{
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0x30000);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
@@ -638,7 +638,7 @@ static MACHINE_RESET(gamecstl)
static WRITE_LINE_DEVICE_HANDLER( gamecstl_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface gamecstl_pic8259_1_config =
@@ -721,26 +721,26 @@ static MACHINE_CONFIG_START( gamecstl, gamecstl_state )
MACHINE_CONFIG_END
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- gamecstl_state *drvstate = machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = machine.driver_data<gamecstl_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static void ide_interrupt(device_t *device, int state)
{
- gamecstl_state *drvstate = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = device->machine().driver_data<gamecstl_state>();
pic8259_ir6_w(drvstate->pic8259_2, state);
}
-static int gamecstl_get_out2(running_machine *machine)
+static int gamecstl_get_out2(running_machine &machine)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
return pit8253_get_output( state->pit8254, 2 );
}
@@ -749,15 +749,15 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2
};
-static void gamecstl_set_keyb_int(running_machine *machine, int state)
+static void gamecstl_set_keyb_int(running_machine &machine, int state)
{
- gamecstl_state *drvstate = machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = machine.driver_data<gamecstl_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static DRIVER_INIT( gamecstl )
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
state->bios_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, gamecstl_set_keyb_int);
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index 8318240f346..3e9391a336d 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -91,7 +91,7 @@ TODO:
static WRITE8_DEVICE_HANDLER( io_select_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
switch (data)
{
@@ -108,15 +108,15 @@ static WRITE8_DEVICE_HANDLER( io_select_w )
static READ8_DEVICE_HANDLER( io_port_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
- return input_port_read(device->machine, portnames[state->current_port]);
+ return input_port_read(device->machine(), portnames[state->current_port]);
}
static WRITE8_DEVICE_HANDLER( coin_w )
{
- coin_counter_w(device->machine, 0, ~data & 1);
+ coin_counter_w(device->machine(), 0, ~data & 1);
}
@@ -139,28 +139,28 @@ static const via6522_interface via_1_interface =
static WRITE8_DEVICE_HANDLER( audio_reset_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
if (data == 0)
{
state->riot->reset();
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
}
static WRITE8_DEVICE_HANDLER( audio_cmd_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
riot6532_porta_in_set(state->riot, data, 0x7f);
}
static WRITE8_DEVICE_HANDLER( audio_trigger_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
riot6532_porta_in_set(state->riot, data << 7, 0x80);
}
@@ -184,17 +184,17 @@ static const via6522_interface via_2_interface =
static WRITE_LINE_DEVICE_HANDLER( r6532_irq )
{
- gameplan_state *gameplan = device->machine->driver_data<gameplan_state>();
+ gameplan_state *gameplan = device->machine().driver_data<gameplan_state>();
device_set_input_line(gameplan->audiocpu, 0, state);
if (state == ASSERT_LINE)
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
static WRITE8_DEVICE_HANDLER( r6532_soundlatch_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, data);
}
@@ -982,11 +982,11 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( gameplan )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->riot = machine->device("riot");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->riot = machine.device("riot");
/* register for save states */
state->save_item(NAME(state->current_port));
@@ -999,7 +999,7 @@ static MACHINE_START( gameplan )
static MACHINE_RESET( gameplan )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
state->current_port = 0;
state->video_x = 0;
state->video_y = 0;
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index 727237439ff..0da97ad5d5b 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -160,52 +160,52 @@ TODO:
static READ8_HANDLER( gaplus_spriteram_r )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
return state->spriteram[offset];
}
static WRITE8_HANDLER( gaplus_spriteram_w )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
state->spriteram[offset] = data;
}
static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
{
int bit = !BIT(offset, 11);
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
{
int bit = !BIT(offset, 13);
- cpu_interrupt_enable(space->machine->device("sub2"), bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
{
int bit = offset & 1;
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_sreset_w )
{
int bit = !BIT(offset, 11);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- mappy_sound_enable(space->machine->device("namco"), bit);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ mappy_sound_enable(space->machine().device("namco"), bit);
}
static WRITE8_HANDLER( gaplus_freset_w )
{
- device_t *io58xx = space->machine->device("58xx");
- device_t *io56xx = space->machine->device("56xx");
+ device_t *io58xx = space->machine().device("58xx");
+ device_t *io56xx = space->machine().device("56xx");
int bit = !BIT(offset, 11);
logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit);
@@ -232,14 +232,14 @@ static const namco_62xx_interface namco_62xx_intf =
static MACHINE_RESET( gaplus )
{
/* on reset, VINTON is reset, while the other flags don't seem to be affected */
- cpu_interrupt_enable(machine->device("sub"), 0);
+ cpu_interrupt_enable(machine.device("sub"), 0);
cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
}
static TIMER_CALLBACK( namcoio_run )
{
- device_t *io58xx = machine->device("58xx");
- device_t *io56xx = machine->device("56xx");
+ device_t *io58xx = machine.device("58xx");
+ device_t *io56xx = machine.device("56xx");
switch (param)
{
@@ -254,17 +254,17 @@ static TIMER_CALLBACK( namcoio_run )
static INTERRUPT_GEN( gaplus_interrupt_1 )
{
- device_t *io58xx = device->machine->device("58xx");
- device_t *io56xx = device->machine->device("56xx");
+ device_t *io58xx = device->machine().device("58xx");
+ device_t *io56xx = device->machine().device("56xx");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(io58xx)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
if (!namcoio_read_reset_line(io56xx)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
}
@@ -503,15 +503,15 @@ static const samples_interface gaplus_samples_interface =
static WRITE8_DEVICE_HANDLER( out_lamps0 )
{
- set_led_status(device->machine, 0, data & 1);
- set_led_status(device->machine, 1, data & 2);
- coin_lockout_global_w(device->machine, data & 4);
- coin_counter_w(device->machine, 0, ~data & 8);
+ set_led_status(device->machine(), 0, data & 1);
+ set_led_status(device->machine(), 1, data & 2);
+ coin_lockout_global_w(device->machine(), data & 4);
+ coin_counter_w(device->machine(), 0, ~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_lamps1 )
{
- coin_counter_w(device->machine, 1, ~data & 1);
+ coin_counter_w(device->machine(), 1, ~data & 1);
}
/* chip #0: player inputs, buttons, coins */
@@ -858,11 +858,11 @@ static DRIVER_INIT( gaplus )
UINT8 *rom;
int i;
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
- rom = machine->region("gfx2")->base() + 0x6000;
+ rom = machine.region("gfx2")->base() + 0x6000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] << 4;
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index a25ef8e6d33..287045710e8 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -134,9 +134,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -144,11 +144,11 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
- atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
+ atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
else
atarigen_6502_irq_ack_r(space, 0);
}
@@ -156,7 +156,7 @@ static void scanline_update(screen_device &screen, int scanline)
static MACHINE_START( gauntlet )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
atarigen_init(machine);
state->save_item(NAME(state->sound_reset_val));
@@ -165,15 +165,15 @@ static MACHINE_START( gauntlet )
static MACHINE_RESET( gauntlet )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
state->sound_reset_val = 1;
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
+ atarigen_sound_io_reset(machine.device("audiocpu"));
}
@@ -186,8 +186,8 @@ static MACHINE_RESET( gauntlet )
static READ16_HANDLER( port4_r )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
- int temp = input_port_read(space->machine, "803008");
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
+ int temp = input_port_read(space->machine(), "803008");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
return temp;
@@ -203,7 +203,7 @@ static READ16_HANDLER( port4_r )
static WRITE16_HANDLER( sound_reset_w )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
if (ACCESSING_BITS_0_7)
{
int oldword = state->sound_reset_val;
@@ -211,16 +211,16 @@ static WRITE16_HANDLER( sound_reset_w )
if ((oldword ^ state->sound_reset_val) & 1)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (state->sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
- atarigen_sound_reset(space->machine);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (state->sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
+ atarigen_sound_reset(space->machine());
if (state->sound_reset_val & 1)
{
- devtag_reset(space->machine, "ymsnd");
- devtag_reset(space->machine, "tms");
- tms5220_set_frequency(space->machine->device("tms"), ATARI_CLOCK_14MHz/2 / 11);
- atarigen_set_ym2151_vol(space->machine, 0);
- atarigen_set_pokey_vol(space->machine, 0);
- atarigen_set_tms5220_vol(space->machine, 0);
+ devtag_reset(space->machine(), "ymsnd");
+ devtag_reset(space->machine(), "tms");
+ tms5220_set_frequency(space->machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11);
+ atarigen_set_ym2151_vol(space->machine(), 0);
+ atarigen_set_pokey_vol(space->machine(), 0);
+ atarigen_set_tms5220_vol(space->machine(), 0);
}
}
}
@@ -236,13 +236,13 @@ static WRITE16_HANDLER( sound_reset_w )
static READ8_HANDLER( switch_6502_r )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
int temp = 0x30;
if (state->cpu_to_sound_ready) temp ^= 0x80;
if (state->sound_to_cpu_ready) temp ^= 0x40;
- if (!tms5220_readyq_r(space->machine->device("tms"))) temp ^= 0x20;
- if (!(input_port_read(space->machine, "803008") & 0x0008)) temp ^= 0x10;
+ if (!tms5220_readyq_r(space->machine().device("tms"))) temp ^= 0x20;
+ if (!(input_port_read(space->machine(), "803008") & 0x0008)) temp ^= 0x10;
return temp;
}
@@ -256,11 +256,11 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_HANDLER( sound_ctl_w )
{
- device_t *tms = space->machine->device("tms");
+ device_t *tms = space->machine().device("tms");
switch (offset & 7)
{
case 0: /* music reset, bit D7, low reset */
- if (((data>>7)&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if (((data>>7)&1) == 0) devtag_reset(space->machine(), "ymsnd");
break;
case 1: /* speech write, bit D7, active low */
@@ -288,9 +288,9 @@ static WRITE8_HANDLER( sound_ctl_w )
static WRITE8_HANDLER( mixer_w )
{
- atarigen_set_ym2151_vol(space->machine, (data & 7) * 100 / 7);
- atarigen_set_pokey_vol(space->machine, ((data >> 3) & 3) * 100 / 3);
- atarigen_set_tms5220_vol(space->machine, ((data >> 5) & 7) * 100 / 7);
+ atarigen_set_ym2151_vol(space->machine(), (data & 7) * 100 / 7);
+ atarigen_set_pokey_vol(space->machine(), ((data >> 3) & 3) * 100 / 3);
+ atarigen_set_tms5220_vol(space->machine(), ((data >> 5) & 7) * 100 / 7);
}
@@ -1621,12 +1621,12 @@ ROM_END
*
*************************************/
-static void gauntlet_common_init(running_machine *machine, int slapstic, int vindctr2)
+static void gauntlet_common_init(running_machine &machine, int slapstic, int vindctr2)
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
state->eeprom_default = NULL;
- atarigen_slapstic_init(machine->device("maincpu"), 0x038000, 0, slapstic);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x038000, 0, slapstic);
/* swap the top and bottom halves of the main CPU ROM images */
atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000);
@@ -1660,7 +1660,7 @@ static DRIVER_INIT( gauntlet2 )
static DRIVER_INIT( vindctr2 )
{
- UINT8 *gfx2_base = machine->region("gfx2")->base();
+ UINT8 *gfx2_base = machine.region("gfx2")->base();
UINT8 *data = auto_alloc_array(machine, UINT8, 0x8000);
int i;
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index f8cf93e15a0..fe3d7161bd1 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -88,7 +88,7 @@
static INTERRUPT_GEN( gberet_interrupt )
{
- gberet_state *state = device->machine->driver_data<gberet_state>();
+ gberet_state *state = device->machine().driver_data<gberet_state>();
if (cpu_getiloops(device) == 0)
{
if (state->irq_enable)
@@ -112,36 +112,36 @@ static INTERRUPT_GEN( gberet_interrupt )
static WRITE8_HANDLER( gberet_coin_counter_w )
{
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( gberet_flipscreen_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x04;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static WRITE8_HANDLER( mrgoemon_coin_counter_w )
{
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bits 5-7 = ROM bank select */
- memory_set_bank(space->machine, "bank1", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank1", ((data & 0xe0) >> 5));
}
static WRITE8_HANDLER( mrgoemon_flipscreen_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
/*************************************
@@ -371,7 +371,7 @@ GFXDECODE_END
static MACHINE_START( gberet )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
state->save_item(NAME(state->irq_enable));
state->save_item(NAME(state->nmi_enable));
@@ -380,7 +380,7 @@ static MACHINE_START( gberet )
static MACHINE_RESET( gberet )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
state->irq_enable = 0;
state->nmi_enable = 0;
@@ -547,7 +547,7 @@ ROM_END
static DRIVER_INIT( mrgoemon )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 8874e3fc55d..9e64e0879c7 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -21,7 +21,7 @@ static KONAMI_SETLINES_CALLBACK( gbusters_banking );
static INTERRUPT_GEN( gbusters_interrupt )
{
- gbusters_state *state = device->machine->driver_data<gbusters_state>();
+ gbusters_state *state = device->machine().driver_data<gbusters_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -29,17 +29,17 @@ static INTERRUPT_GEN( gbusters_interrupt )
static READ8_HANDLER( bankedram_r )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -49,7 +49,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( gbusters_1f98_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
/* bit 0 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
@@ -66,14 +66,14 @@ static WRITE8_HANDLER( gbusters_1f98_w )
static WRITE8_HANDLER( gbusters_coin_counter_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
/* bit 0 select palette RAM or work RAM at 5800-5fff */
state->palette_selected = ~data & 0x01;
/* bits 1 & 2 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
/* bits 3 selects tilemap priority */
state->priority = data & 0x08;
@@ -105,7 +105,7 @@ char baf[40];
static WRITE8_HANDLER( gbusters_sh_irqtrigger_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -127,7 +127,7 @@ static WRITE8_DEVICE_HANDLER( gbusters_snd_bankswitch_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -144,7 +144,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -274,31 +274,31 @@ static const k051960_interface gbusters_k051960_intf =
static MACHINE_START( gbusters )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k007232 = machine->device("k007232");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k007232 = machine.device("k007232");
state->save_item(NAME(state->palette_selected));
state->save_item(NAME(state->priority));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x800);
}
static MACHINE_RESET( gbusters )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
- konami_configure_set_lines(machine->device("maincpu"), gbusters_banking);
+ konami_configure_set_lines(machine.device("maincpu"), gbusters_banking);
/* mirror address for banked ROM */
memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
@@ -434,7 +434,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( gbusters_banking )
{
/* bits 0-3 ROM bank */
- memory_set_bank(device->machine, "bank1", lines & 0x0f);
+ memory_set_bank(device->machine(), "bank1", lines & 0x0f);
if (lines & 0xf0)
{
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index eafa0c56a7e..3aa75ad64eb 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -44,14 +44,14 @@ Stephh's notes (based on the game M68000 code and some tests) :
static TIMER_CALLBACK( gcpinbal_interrupt1 )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
}
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( gcpinbal_interrupt3 )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
// IRQ3 is from the M6585
// if (!ADPCM_playing(0))
{
@@ -64,8 +64,8 @@ static INTERRUPT_GEN( gcpinbal_interrupt )
{
/* Unsure of actual sequence */
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1));
-// device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1));
+// device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -76,20 +76,20 @@ static INTERRUPT_GEN( gcpinbal_interrupt )
static READ16_HANDLER( ioc_r )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
/* 20 (only once), 76, a0 are read in log */
switch (offset)
{
case 0x80/2:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x84/2:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x86/2:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x50:
case 0x51:
@@ -105,7 +105,7 @@ static READ16_HANDLER( ioc_r )
static WRITE16_HANDLER( ioc_w )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
COMBINE_DATA(&state->ioc_ram[offset]);
// switch (offset)
@@ -114,8 +114,8 @@ static WRITE16_HANDLER( ioc_w )
// return;
//
// case 0x88/2: /* coin control (+ others) ??? */
-// coin_lockout_w(space->machine, 0, ~data & 0x01);
-// coin_lockout_w(space->machine, 1, ~data & 0x02);
+// coin_lockout_w(space->machine(), 0, ~data & 0x01);
+// coin_lockout_w(space->machine(), 1, ~data & 0x02);
//popmessage(" address %04x value %04x", offset, data);
// }
@@ -204,7 +204,7 @@ static WRITE16_HANDLER( ioc_w )
/* Controlled through ioc? */
static void gcp_adpcm_int( device_t *device )
{
- gcpinbal_state *state = device->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = device->machine().driver_data<gcpinbal_state>();
if (state->adpcm_idle)
msm5205_reset_w(device, 1);
@@ -216,7 +216,7 @@ static void gcp_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("msm")->base();
+ UINT8 *ROM = device->machine().region("msm")->base();
state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_start] & 0x0f) : (ROM[state->adpcm_start] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -394,7 +394,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( gcpinbal )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
state->save_item(NAME(state->scrollx));
state->save_item(NAME(state->scrolly));
@@ -412,7 +412,7 @@ static MACHINE_START( gcpinbal )
static MACHINE_RESET( gcpinbal )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
int i;
for (i = 0; i < 3; i++)
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index 40a1703f28b..4c8dcf8e7b5 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -90,7 +90,7 @@ public:
static WRITE8_HANDLER( gei_drawctrl_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
state->drawctrl[offset] = data;
if (offset == 2)
{
@@ -102,7 +102,7 @@ static WRITE8_HANDLER( gei_drawctrl_w )
static WRITE8_HANDLER( gei_bitmap_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
int sx,sy;
int i;
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( gei_bitmap_w )
for (i = 0; i < 8; i++)
- *BITMAP_ADDR16(space->machine->generic.tmpbitmap, sy, sx+i) = state->color[8-i-1];
+ *BITMAP_ADDR16(space->machine().generic.tmpbitmap, sy, sx+i) = state->color[8-i-1];
}
static PALETTE_INIT(gei)
@@ -141,66 +141,66 @@ static PALETTE_INIT(quizvid)
static WRITE8_DEVICE_HANDLER( lamps_w )
{
/* 5 button lamps */
- set_led_status(device->machine, 0,data & 0x01);
- set_led_status(device->machine, 1,data & 0x02);
- set_led_status(device->machine, 2,data & 0x04);
- set_led_status(device->machine, 3,data & 0x08);
- set_led_status(device->machine, 4,data & 0x10);
+ set_led_status(device->machine(), 0,data & 0x01);
+ set_led_status(device->machine(), 1,data & 0x02);
+ set_led_status(device->machine(), 2,data & 0x04);
+ set_led_status(device->machine(), 3,data & 0x08);
+ set_led_status(device->machine(), 4,data & 0x10);
/* 3 button lamps for deal, cancel, stand in poker games;
lamp order verified in poker and selection self tests */
- set_led_status(device->machine, 7,data & 0x20);
- set_led_status(device->machine, 5,data & 0x40);
- set_led_status(device->machine, 6,data & 0x80);
+ set_led_status(device->machine(), 7,data & 0x20);
+ set_led_status(device->machine(), 5,data & 0x40);
+ set_led_status(device->machine(), 6,data & 0x80);
}
static WRITE8_DEVICE_HANDLER( sound_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* bit 3 - coin lockout, lamp10 in poker / lamp6 in trivia test modes */
- coin_lockout_global_w(device->machine, ~data & 0x08);
- set_led_status(device->machine, 9,data & 0x08);
+ coin_lockout_global_w(device->machine(), ~data & 0x08);
+ set_led_status(device->machine(), 9,data & 0x08);
/* bit 5 - ticket out in trivia games */
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x20)<< 2);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x20)<< 2);
/* bit 6 enables NMI */
interrupt_enable_w(space, 0, data & 0x40);
/* bit 7 goes directly to the sound amplifier */
- dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
+ dac_data_w(device->machine().device("dac"), ((data & 0x80) >> 7) * 255);
}
static WRITE8_DEVICE_HANDLER( sound2_w )
{
/* bit 3,6 - coin lockout, lamp10+11 in selection test mode */
- coin_lockout_w(device->machine, 0, ~data & 0x08);
- coin_lockout_w(device->machine, 1, ~data & 0x40);
- set_led_status(device->machine, 9,data & 0x08);
- set_led_status(device->machine, 10,data & 0x40);
+ coin_lockout_w(device->machine(), 0, ~data & 0x08);
+ coin_lockout_w(device->machine(), 1, ~data & 0x40);
+ set_led_status(device->machine(), 9,data & 0x08);
+ set_led_status(device->machine(), 10,data & 0x40);
/* bit 4,5 - lamps 12, 13 in selection test mode;
12 lights up if dsw maximum bet = 30 an bet > 15 or if dsw maximum bet = 10 an bet = 10 */
- set_led_status(device->machine, 11,data & 0x10);
- set_led_status(device->machine, 12,data & 0x20);
+ set_led_status(device->machine(), 11,data & 0x10);
+ set_led_status(device->machine(), 12,data & 0x20);
/* bit 7 goes directly to the sound amplifier */
- dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
+ dac_data_w(device->machine().device("dac"), ((data & 0x80) >> 7) * 255);
}
static WRITE8_DEVICE_HANDLER( lamps2_w )
{
/* bit 4 - play/raise button lamp, lamp 9 in poker test mode */
- set_led_status(device->machine, 8,data & 0x10);
+ set_led_status(device->machine(), 8,data & 0x10);
}
static WRITE8_DEVICE_HANDLER( nmi_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* bit 4 - play/raise button lamp, lamp 9 in selection test mode */
- set_led_status(device->machine, 8,data & 0x10);
+ set_led_status(device->machine(), 8,data & 0x10);
/* bit 6 enables NMI */
interrupt_enable_w(space, 0, data & 0x40);
@@ -223,68 +223,68 @@ static READ8_DEVICE_HANDLER( portC_r )
static WRITE8_HANDLER( banksel_main_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x8000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x8000);
}
static WRITE8_HANDLER( banksel_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
}
static WRITE8_HANDLER( banksel_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
}
static WRITE8_HANDLER( banksel_3_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
}
static WRITE8_HANDLER( banksel_4_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x28000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x28000);
}
static WRITE8_HANDLER( banksel_5_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x30000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x30000);
}
static WRITE8_HANDLER( banksel_1_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
}
static WRITE8_HANDLER( banksel_2_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x14000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x14000);
}
static WRITE8_HANDLER( banksel_3_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
}
static WRITE8_HANDLER( banksel_4_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1c000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1c000);
}
static WRITE8_HANDLER( banksel_5_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
}
static WRITE8_HANDLER( banksel_1_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x12000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x12000);
}
static WRITE8_HANDLER( banksel_2_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x16000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x16000);
}
static WRITE8_HANDLER( banksel_3_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1a000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1a000);
}
static WRITE8_HANDLER( banksel_4_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1e000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1e000);
}
static WRITE8_HANDLER( banksel_5_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x22000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x22000);
}
static WRITE8_HANDLER(geimulti_bank_w)
@@ -312,36 +312,36 @@ static WRITE8_HANDLER(geimulti_bank_w)
}
if (bank != -1)
- memory_set_bankptr(space->machine, "bank1", space->machine->region("bank")->base() + bank*0x8000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("bank")->base() + bank*0x8000);
}
static READ8_HANDLER(banksel_1_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
return 0x03;
};
static READ8_HANDLER(banksel_2_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
return 0x03;
}
static READ8_HANDLER(banksel_3_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
return 0x03;
}
static READ8_HANDLER(banksel_4_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x28000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x28000);
return 0x03;
}
static READ8_HANDLER(banksel_5_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x30000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x30000);
return 0x03;
}
@@ -349,13 +349,13 @@ static READ8_HANDLER(banksel_5_r)
static READ8_HANDLER( signature_r )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
return state->signature_answer;
}
static WRITE8_HANDLER( signature_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
if (data == 0) state->signature_pos = 0;
else
{
@@ -369,7 +369,7 @@ static WRITE8_HANDLER( signature_w )
static WRITE8_HANDLER( signature2_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
if (data == 0) state->signature_pos = 0;
else
{
@@ -1824,12 +1824,12 @@ ROM_END
static DRIVER_INIT( setbank )
{
- memory_set_bankptr(machine, "bank1",machine->region("maincpu")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank1",machine.region("maincpu")->base() + 0x2000);
}
static DRIVER_INIT( geimulti )
{
- memory_set_bankptr(machine, "bank1",machine->region("bank")->base() + 0x0000);
+ memory_set_bankptr(machine, "bank1",machine.region("bank")->base() + 0x0000);
}
GAME( 1982, jokpoker, 0, gselect, gselect, setbank, ROT0, "Greyhound Electronics", "Joker Poker (Version 16.03B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index b30dd84ed86..22de6d592f5 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -116,7 +116,7 @@ static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22 };
static UINT32 s3c2410_gpio_port_r( device_t *device, int port)
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
UINT32 data = state->bballoon_port[port];
switch (port)
{
@@ -137,7 +137,7 @@ static UINT32 s3c2410_gpio_port_r( device_t *device, int port)
static void s3c2410_gpio_port_w( device_t *device, int port, UINT32 data)
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
UINT32 old_value = state->bballoon_port[port];
state->bballoon_port[port] = data;
switch (port)
@@ -167,9 +167,9 @@ static void s3c2410_gpio_port_w( device_t *device, int port, UINT32 data)
static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_command_w %02X\n", data);
switch (data)
{
@@ -191,9 +191,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_address_w %02X\n", data);
switch (nand.mode)
{
@@ -225,9 +225,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
UINT8 data = 0;
switch (nand.mode)
{
@@ -238,7 +238,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
break;
case NAND_M_READ :
{
- UINT8 *flash = (UINT8 *)device->machine->region( "user1")->base();
+ UINT8 *flash = (UINT8 *)device->machine().region( "user1")->base();
if (nand.byte_addr < 0x200)
{
data = *(flash + nand.page_addr * 0x200 + nand.byte_addr);
@@ -272,20 +272,20 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_data_w )
{
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_data_w %02X\n", data);
}
static WRITE_LINE_DEVICE_HANDLER( s3c2410_i2c_scl_w )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
// logerror( "s3c2410_i2c_scl_w %d\n", state ? 1 : 0);
i2cmem_scl_write( i2cmem, state);
}
static READ_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_r )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
int state;
state = i2cmem_sda_read( i2cmem);
// logerror( "s3c2410_i2c_sda_r %d\n", state ? 1 : 0);
@@ -294,7 +294,7 @@ static READ_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_r )
static WRITE_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_w )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
// logerror( "s3c2410_i2c_sda_w %d\n", state ? 1 : 0);
i2cmem_sda_write( i2cmem, state);
}
@@ -437,8 +437,8 @@ static READ32_HANDLER( bballoon_speedup_r )
static MACHINE_RESET( bballoon )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4d000010, 0x4d000013, FUNC(bballoon_speedup_r));
- s3c2410 = machine->device("s3c2410");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4d000010, 0x4d000013, FUNC(bballoon_speedup_r));
+ s3c2410 = machine.device("s3c2410");
}
static MACHINE_CONFIG_START( bballoon, ghosteo_state )
@@ -549,8 +549,8 @@ ROM_END
static DRIVER_INIT( bballoon )
{
- ghosteo_state *state = machine->driver_data<ghosteo_state>();
- memcpy( state->steppingstone, machine->region( "user1")->base(), 4 * 1024);
+ ghosteo_state *state = machine.driver_data<ghosteo_state>();
+ memcpy( state->steppingstone, machine.region( "user1")->base(), 4 * 1024);
}
GAME( 2003, bballoon, 0, bballoon, bballoon, bballoon, ROT0, "Eolith", "BnB Arcade", GAME_NO_SOUND )
diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c
index e3a86a154b4..d221481a9ca 100644
--- a/src/mame/drivers/gijoe.c
+++ b/src/mame/drivers/gijoe.c
@@ -60,13 +60,13 @@ static const eeprom_interface eeprom_intf =
static READ16_HANDLER( control2_r )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
return state->cur_control2;
}
static WRITE16_HANDLER( control2_w )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
if (ACCESSING_BITS_0_7)
{
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( control2_w )
/* bit 3 (unknown: coin) */
/* bit 5 is enable irq 6 */
/* bit 7 (unknown: enable irq 5?) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
state->cur_control2 = data;
@@ -85,9 +85,9 @@ static WRITE16_HANDLER( control2_w )
}
}
-static void gijoe_objdma( running_machine *machine )
+static void gijoe_objdma( running_machine &machine )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
UINT16 *src_head, *src_tail, *dst_head, *dst_tail;
src_head = state->spriteram;
@@ -112,7 +112,7 @@ static void gijoe_objdma( running_machine *machine )
static TIMER_CALLBACK( dmaend_callback )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
if (state->cur_control2 & 0x0020)
device_set_input_line(state->maincpu, 6, HOLD_LINE);
@@ -120,7 +120,7 @@ static TIMER_CALLBACK( dmaend_callback )
static INTERRUPT_GEN( gijoe_interrupt )
{
- gijoe_state *state = device->machine->driver_data<gijoe_state>();
+ gijoe_state *state = device->machine().driver_data<gijoe_state>();
// global interrupt masking (*this game only)
if (!k056832_is_irq_enabled(state->k056832, 0))
@@ -128,7 +128,7 @@ static INTERRUPT_GEN( gijoe_interrupt )
if (k053246_is_irq_enabled(state->k053246))
{
- gijoe_objdma(device->machine);
+ gijoe_objdma(device->machine());
// 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock
state->dmadelay_timer->adjust(JOE_DMADELAY);
@@ -150,7 +150,7 @@ static WRITE16_HANDLER( sound_cmd_w )
static WRITE16_HANDLER( sound_irq_w )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -161,7 +161,7 @@ static READ16_HANDLER( sound_status_r )
static void sound_nmi( device_t *device )
{
- gijoe_state *state = device->machine->driver_data<gijoe_state>();
+ gijoe_state *state = device->machine().driver_data<gijoe_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -276,23 +276,23 @@ static const k053247_interface gijoe_k053247_intf =
static MACHINE_START( gijoe )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k054539 = machine->device("k054539");
- state->k056832 = machine->device("k056832");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k054539 = machine.device("k054539");
+ state->k056832 = machine.device("k056832");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
- state->dmadelay_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ state->dmadelay_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
state->save_item(NAME(state->cur_control2));
}
static MACHINE_RESET( gijoe )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
state->cur_control2 = 0;
}
diff --git a/src/mame/drivers/ginganin.c b/src/mame/drivers/ginganin.c
index 3698c125a75..b4e60934cf5 100644
--- a/src/mame/drivers/ginganin.c
+++ b/src/mame/drivers/ginganin.c
@@ -89,7 +89,7 @@ static WRITE8_HANDLER( MC6840_control_port_0_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_index0 = data;
if (state->MC6840_index0 & 0x80) /* enable timer output */
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( MC6840_control_port_1_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_index1 = data;
}
@@ -125,7 +125,7 @@ static WRITE8_HANDLER( MC6840_write_port_0_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_register0 = data;
}
@@ -134,7 +134,7 @@ static WRITE8_HANDLER( MC6840_write_port_1_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_register1 = data;
}
@@ -278,7 +278,7 @@ static INTERRUPT_GEN( ginganin_sound_interrupt )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = device->machine->driver_data<ginganin_state>();
+ ginganin_state *state = device->machine().driver_data<ginganin_state>();
if (state->S_TEMPO_OLD != state->S_TEMPO)
{
@@ -304,9 +304,9 @@ static INTERRUPT_GEN( ginganin_sound_interrupt )
static MACHINE_START( ginganin )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->layers_ctrl));
state->save_item(NAME(state->flipscreen));
@@ -322,7 +322,7 @@ static MACHINE_START( ginganin )
static MACHINE_RESET( ginganin )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
state->layers_ctrl = 0;
state->flipscreen = 0;
@@ -459,7 +459,7 @@ static DRIVER_INIT( ginganin )
UINT16 *rom;
/* main cpu patches */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
/* avoid writes to rom getting to the log */
rom[0x408 / 2] = 0x6000;
rom[0x40a / 2] = 0x001c;
@@ -467,7 +467,7 @@ static DRIVER_INIT( ginganin )
/* sound cpu patches */
/* let's clear the RAM: ROM starts at 0x4000 */
- memset(machine->region("audiocpu")->base(), 0, 0x800);
+ memset(machine.region("audiocpu")->base(), 0, 0x800);
}
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 5e242417349..d161ad066e0 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -194,22 +194,22 @@ TODO:
/*Rom bankswitching*/
static WRITE8_HANDLER( gladiatr_bankswitch_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("maincpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1", rom + 0x6000 * (data & 0x01));
+ memory_set_bankptr(space->machine(), "bank1", rom + 0x6000 * (data & 0x01));
}
static READ8_HANDLER( gladiator_dsw1_r )
{
- int orig = input_port_read(space->machine, "DSW1")^0xff;
+ int orig = input_port_read(space->machine(), "DSW1")^0xff;
return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( gladiator_dsw2_r )
{
- int orig = input_port_read(space->machine, "DSW2")^0xff;
+ int orig = input_port_read(space->machine(), "DSW2")^0xff;
return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
}
@@ -218,15 +218,15 @@ static READ8_HANDLER( gladiator_controls_r )
{
int coins = 0;
- if( input_port_read(space->machine, "COINS") & 0xc0 ) coins = 0x80;
+ if( input_port_read(space->machine(), "COINS") & 0xc0 ) coins = 0x80;
switch(offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine, "IN0") | coins;
+ return input_port_read(space->machine(), "IN0") | coins;
case 0x02: /* Player 1 Controller , coins */
- return input_port_read(space->machine, "IN1") | coins;
+ return input_port_read(space->machine(), "IN1") | coins;
case 0x04: /* Player 2 Controller , coins */
- return input_port_read(space->machine, "IN2") | coins;
+ return input_port_read(space->machine(), "IN2") | coins;
}
/* unknown */
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( gladiator_button3_r )
switch(offset)
{
case 0x01: /* button 3 */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
/* unknown */
return 0;
@@ -256,9 +256,9 @@ static MACHINE_RESET( gladiator )
TAITO8741_start(&gladiator_8741interface);
/* 6809 bank memory set */
{
- UINT8 *rom = machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = machine.region("audiocpu")->base() + 0x10000;
memory_set_bankptr(machine, "bank2",rom);
- machine->device("audiocpu")->reset();
+ machine.device("audiocpu")->reset();
}
}
@@ -273,16 +273,16 @@ static WRITE8_DEVICE_HANDLER( gladiator_int_control_w )
static void gladiator_ym_irq(device_t *device, int irq)
{
/* NMI IRQ is not used by gladiator sound program */
- cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sub", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
/*Sound Functions*/
static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
{
- UINT8 *rom = device->machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = device->machine().region("audiocpu")->base() + 0x10000;
/* bit6 = bank offset */
- memory_set_bankptr(device->machine, "bank2",rom + ((data & 0x40) ? 0xc000 : 0));
+ memory_set_bankptr(device->machine(), "bank2",rom + ((data & 0x40) ? 0xc000 : 0));
msm5205_data_w(device,data); /* bit0..3 */
msm5205_reset_w(device,(data>>5)&1); /* bit 5 */
@@ -292,18 +292,18 @@ static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
static WRITE8_HANDLER( glad_cpu_sound_command_w )
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
}
static READ8_HANDLER( glad_cpu_sound_command_r )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space,0);
}
static WRITE8_HANDLER( gladiatr_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -311,7 +311,7 @@ static WRITE8_HANDLER( gladiatr_flipscreen_w )
/* !!!!! patch to IRQ timming for 2nd CPU !!!!! */
static WRITE8_HANDLER( gladiatr_irq_patch_w )
{
- cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, HOLD_LINE);
}
#endif
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( gladiatr_irq_patch_w )
static WRITE8_HANDLER(qx0_w)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
{
state->data2=data;
@@ -333,7 +333,7 @@ static WRITE8_HANDLER(qx0_w)
static WRITE8_HANDLER(qx1_w)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
{
state->data1=data;
@@ -345,13 +345,13 @@ static WRITE8_HANDLER(qx2_w){ }
static WRITE8_HANDLER(qx3_w){ }
-static READ8_HANDLER(qx2_r){ return space->machine->rand(); }
+static READ8_HANDLER(qx2_r){ return space->machine().rand(); }
-static READ8_HANDLER(qx3_r){ return space->machine->rand()&0xf; }
+static READ8_HANDLER(qx3_r){ return space->machine().rand()&0xf; }
static READ8_HANDLER(qx0_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
return state->data1;
else
@@ -360,7 +360,7 @@ static READ8_HANDLER(qx0_r)
static READ8_HANDLER(qx1_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
return state->data2;
else
@@ -369,7 +369,7 @@ static READ8_HANDLER(qx1_r)
static MACHINE_RESET( ppking )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
state->data1 = state->data2 = 0;
state->flag1 = state->flag2 = 1;
}
@@ -627,7 +627,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER(f1_r)
{
- return device->machine->rand();
+ return device->machine().rand();
}
static const ym2203_interface ppking_ym2203_interface =
@@ -962,7 +962,7 @@ static DRIVER_INIT( gladiatr )
UINT8 *rom;
int i,j;
- rom = machine->region("gfx2")->base();
+ rom = machine.region("gfx2")->base();
// unpack 3bpp graphics
for (j = 3; j >= 0; j--)
{
@@ -976,7 +976,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x14000, rom + 0x18000, 0x4000);
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
// unpack 3bpp graphics
for (j = 5; j >= 0; j--)
{
@@ -993,14 +993,14 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x24000, rom + 0x28000, 0x4000);
/* make sure bank is valid in cpu-reset */
- rom = machine->region("audiocpu")->base() + 0x10000;
+ rom = machine.region("audiocpu")->base() + 0x10000;
memory_set_bankptr(machine, "bank2",rom);
}
static READ8_HANDLER(f6a3_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(cpu_get_previouspc(space->cpu)==0x8e)
state->m_nvram[0x6a3]=1;
@@ -1012,14 +1012,14 @@ static DRIVER_INIT(ppking)
UINT8 *rom;
int i,j;
- rom = machine->region("gfx2")->base();
+ rom = machine.region("gfx2")->base();
// unpack 3bpp graphics
for (i = 0; i < 0x2000; i++)
{
rom[i+0x2000] = rom[i] >> 4;
}
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
// unpack 3bpp graphics
for (j = 1; j >= 0; j--)
{
@@ -1030,7 +1030,7 @@ static DRIVER_INIT(ppking)
}
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf6a3,0xf6a3,FUNC(f6a3_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf6a3,0xf6a3,FUNC(f6a3_r) );
}
diff --git a/src/mame/drivers/glass.c b/src/mame/drivers/glass.c
index 92693578d6c..858d8ce17e9 100644
--- a/src/mame/drivers/glass.c
+++ b/src/mame/drivers/glass.c
@@ -15,13 +15,13 @@ The DS5002FP has up to 128KB undumped gameplay code making the game unplayable :
static WRITE16_HANDLER( clr_int_w )
{
- glass_state *state = space->machine->driver_data<glass_state>();
+ glass_state *state = space->machine().driver_data<glass_state>();
state->cause_interrupt = 1;
}
static INTERRUPT_GEN( glass_interrupt )
{
- glass_state *state = device->machine->driver_data<glass_state>();
+ glass_state *state = device->machine().driver_data<glass_state>();
if (state->cause_interrupt)
{
@@ -55,7 +55,7 @@ GFXDECODE_END
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7)
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000);
@@ -67,11 +67,11 @@ static WRITE16_HANDLER( glass_coin_w )
{
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w(space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w(space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
break;
case 0x04: /* Sound Muting (if bit 0 == 1, sound output stream = 0) */
break;
@@ -173,7 +173,7 @@ INPUT_PORTS_END
static MACHINE_START( glass )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
state->save_item(NAME(state->cause_interrupt));
state->save_item(NAME(state->current_bit));
@@ -183,7 +183,7 @@ static MACHINE_START( glass )
static MACHINE_RESET( glass )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
int i;
state->cause_interrupt = 1;
@@ -294,15 +294,15 @@ ROM_END
***************************************************************************/
-static void glass_ROM16_split_gfx( running_machine *machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
+static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
{
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine->region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine->region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length / 2; i++)
diff --git a/src/mame/drivers/gng.c b/src/mame/drivers/gng.c
index d60c1e82141..831edb1df53 100644
--- a/src/mame/drivers/gng.c
+++ b/src/mame/drivers/gng.c
@@ -31,14 +31,14 @@ Notes:
static WRITE8_HANDLER( gng_bankswitch_w )
{
if (data == 4)
- memory_set_bank(space->machine, "bank1", 4);
+ memory_set_bank(space->machine(), "bank1", 4);
else
- memory_set_bank(space->machine, "bank1", (data & 0x03));
+ memory_set_bank(space->machine(), "bank1", (data & 0x03));
}
static WRITE8_HANDLER( gng_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static ADDRESS_MAP_START( gng_map, AS_PROGRAM, 8 )
@@ -303,9 +303,9 @@ GFXDECODE_END
static MACHINE_START( gng )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x2000);
memory_configure_bank(machine, "bank1", 4, 1, &rombase[0x4000], 0x2000);
@@ -315,7 +315,7 @@ static MACHINE_START( gng )
static MACHINE_RESET( gng )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
state->scrollx[0] = 0;
state->scrollx[1] = 0;
@@ -721,7 +721,7 @@ static READ8_HANDLER( diamond_hack_r )
static DRIVER_INIT( diamond )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000, 0x6000, FUNC(diamond_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000, 0x6000, FUNC(diamond_hack_r));
}
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index aab5f121caa..61cffffbad4 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -52,7 +52,7 @@ public:
static WRITE16_HANDLER( sound_cmd_w )
{
- go2000_state *state = space->machine->driver_data<go2000_state>();
+ go2000_state *state = space->machine().driver_data<go2000_state>();
soundlatch_w(space, offset, data & 0xff);
device_set_input_line(state->soundcpu, 0, HOLD_LINE);
}
@@ -73,7 +73,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( go2000_pcm_1_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static ADDRESS_MAP_START( go2000_sound_map, AS_PROGRAM, 8 )
@@ -171,7 +171,7 @@ static VIDEO_START(go2000)
static SCREEN_UPDATE(go2000)
{
- go2000_state *state = screen->machine->driver_data<go2000_state>();
+ go2000_state *state = screen->machine().driver_data<go2000_state>();
int x,y;
int count = 0;
@@ -182,7 +182,7 @@ static SCREEN_UPDATE(go2000)
{
int tile = state->videoram[count];
int attr = state->videoram2[count];
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], tile, attr, 0, 0, x * 8, y * 8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8);
count++;
}
}
@@ -194,7 +194,7 @@ static SCREEN_UPDATE(go2000)
{
int tile = state->videoram[count];
int attr = state->videoram2[count];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
count++;
}
}
@@ -203,8 +203,8 @@ static SCREEN_UPDATE(go2000)
{
int offs;
- int max_x = screen->machine->primary_screen->width() - 8;
- int max_y = screen->machine->primary_screen->height() - 8;
+ int max_x = screen->machine().primary_screen->width() - 8;
+ int max_y = screen->machine().primary_screen->height() - 8;
for (offs = 0xf800 / 2; offs < 0x10000 / 2 ; offs += 4/2)
{
@@ -277,7 +277,7 @@ static SCREEN_UPDATE(go2000)
if (flipx)
tile_flipx = !tile_flipx;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = max_x - sx;
sy = max_y - sy;
@@ -285,7 +285,7 @@ static SCREEN_UPDATE(go2000)
tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap, cliprect,screen->machine->gfx[0],
+ drawgfx_transpen( bitmap, cliprect,screen->machine().gfx[0],
(tile & 0x1fff) + bank*0x4000,
attr,
tile_flipx, tile_flipy,
@@ -306,8 +306,8 @@ static SCREEN_UPDATE(go2000)
static MACHINE_START( go2000 )
{
- go2000_state *state = machine->driver_data<go2000_state>();
- UINT8 *SOUND = machine->region("soundcpu")->base();
+ go2000_state *state = machine.driver_data<go2000_state>();
+ UINT8 *SOUND = machine.region("soundcpu")->base();
int i;
for (i = 0; i < 8; i++)
@@ -315,7 +315,7 @@ static MACHINE_START( go2000 )
memory_set_bank(machine, "bank1", 0);
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
}
static MACHINE_CONFIG_START( go2000, go2000_state )
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 8d03bb38f05..e5db61b3a23 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -17,7 +17,7 @@
static WRITE16_HANDLER( goal92_sound_command_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
@@ -30,15 +30,15 @@ static READ16_HANDLER( goal92_inputs_r )
switch(offset)
{
case 0:
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
case 1:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 2:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 3:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
case 7:
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
default:
logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,cpu_get_pc(space->cpu));
@@ -70,14 +70,14 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( adpcm_control_w )
{
- memory_set_bank(device->machine, "bank1", data & 0x01);
+ memory_set_bank(device->machine(), "bank1", data & 0x01);
msm5205_reset_w(device, data & 0x08);
}
static WRITE8_HANDLER( adpcm_data_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
state->msm5205next = data;
}
@@ -213,7 +213,7 @@ INPUT_PORTS_END
static void irqhandler( device_t *device, int irq )
{
/* NMI writes to MSM ports *only*! -AS */
- //goal92_state *state = device->machine->driver_data<goal92_state>();
+ //goal92_state *state = device->machine().driver_data<goal92_state>();
//device_set_input_line(state->audiocpu, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -229,7 +229,7 @@ static const ym2203_interface ym2203_config =
static void goal92_adpcm_int( device_t *device )
{
- goal92_state *state = device->machine->driver_data<goal92_state>();
+ goal92_state *state = device->machine().driver_data<goal92_state>();
msm5205_data_w(device, state->msm5205next);
state->msm5205next >>= 4;
state->adpcm_toggle^= 1;
@@ -292,12 +292,12 @@ GFXDECODE_END
static MACHINE_START( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ goal92_state *state = machine.driver_data<goal92_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->fg_bank));
state->save_item(NAME(state->msm5205next));
@@ -306,7 +306,7 @@ static MACHINE_START( goal92 )
static MACHINE_RESET( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
state->fg_bank = 0;
state->msm5205next = 0;
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index ffe4db68365..ce99969e92f 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -26,24 +26,24 @@ Notes:
static WRITE8_HANDLER( goindol_bankswitch_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
if (state->char_bank != ((data & 0x10) >> 4))
{
state->char_bank = (data & 0x10) >> 4;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
}
static READ8_HANDLER( prot_f422_r )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
/* bit 7 = vblank? */
state->prot_toggle ^= 0x80;
@@ -54,7 +54,7 @@ static READ8_HANDLER( prot_f422_r )
static WRITE8_HANDLER( prot_fc44_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fc44_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0419] = 0x5b;
@@ -64,7 +64,7 @@ static WRITE8_HANDLER( prot_fc44_w )
static WRITE8_HANDLER( prot_fd99_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fd99_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0421] = 0x3f;
@@ -72,7 +72,7 @@ static WRITE8_HANDLER( prot_fd99_w )
static WRITE8_HANDLER( prot_fc66_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fc66_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0423] = 0x06;
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( prot_fc66_w )
static WRITE8_HANDLER( prot_fcb0_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fcb0_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0425] = 0x06;
@@ -226,8 +226,8 @@ GFXDECODE_END
static MACHINE_START( goindol )
{
- goindol_state *state = machine->driver_data<goindol_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ goindol_state *state = machine.driver_data<goindol_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
@@ -237,7 +237,7 @@ static MACHINE_START( goindol )
static MACHINE_RESET( goindol )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
state->char_bank = 0;
state->prot_toggle = 0;
@@ -391,7 +391,7 @@ ROM_END
static DRIVER_INIT( goindol )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* I hope that's all patches to avoid protection */
diff --git a/src/mame/drivers/goldngam.c b/src/mame/drivers/goldngam.c
index 8c9b4731e30..1db26c64608 100644
--- a/src/mame/drivers/goldngam.c
+++ b/src/mame/drivers/goldngam.c
@@ -258,7 +258,7 @@ static VIDEO_START( goldngam )
static SCREEN_UPDATE( goldngam )
{
- goldngam_state *state = screen->machine->driver_data<goldngam_state>();
+ goldngam_state *state = screen->machine().driver_data<goldngam_state>();
int x, y;
@@ -291,7 +291,7 @@ static PALETTE_INIT( goldngam )
static READ16_HANDLER(unk_r)
{
- int test1 = (space->machine->rand() & 0xae00);
+ int test1 = (space->machine().rand() & 0xae00);
// popmessage("VAL = %02x", test1);
return test1;
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 6ca691f5b06..e7c5984d2a3 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -720,21 +720,21 @@ public:
static WRITE8_HANDLER( goldnpkr_videoram_w )
{
- goldnpkr_state *state = space->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = space->machine().driver_data<goldnpkr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( goldnpkr_colorram_w )
{
- goldnpkr_state *state = space->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = space->machine().driver_data<goldnpkr_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
/* - bits -
7654 3210
--xx xx-- tiles color.
@@ -753,7 +753,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( xtnd_get_bg_tile_info )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
/* 3 graphics banks system for VK extended cards
- bits -
@@ -773,19 +773,19 @@ static TILE_GET_INFO( xtnd_get_bg_tile_info )
static VIDEO_START( goldnpkr )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static VIDEO_START( wcrdxtnd )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
state->bg_tilemap = tilemap_create(machine, xtnd_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( goldnpkr )
{
- goldnpkr_state *state = screen->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = screen->machine().driver_data<goldnpkr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -805,7 +805,7 @@ static PALETTE_INIT( goldnpkr )
/* 0000IBGR */
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, r, g, b, inten, intenmin, intenmax;
@@ -856,7 +856,7 @@ static PALETTE_INIT( witchcrd )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -899,7 +899,7 @@ static PALETTE_INIT( wcrdxtnd )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -936,28 +936,28 @@ static PALETTE_INIT( wcrdxtnd )
*/
static READ8_DEVICE_HANDLER( goldnpkr_mux_port_r )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
}
static READ8_DEVICE_HANDLER( pottnpkr_mux_port_r )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
UINT8 pa_0_4 = 0xff, pa_7; /* Temporary place holder for bits 0 to 4 & 7 */
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
pa_7 = (state->pia0_PA_data >> 7) & 1; /* To do: bit PA5 to pin CB1 */
@@ -968,13 +968,13 @@ static READ8_DEVICE_HANDLER( pottnpkr_mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
state->mux_data = data ^ 0xff; /* inverted */
}
static WRITE8_DEVICE_HANDLER( mux_port_w )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
state->pia0_PA_data = data;
}
@@ -987,12 +987,12 @@ static WRITE8_DEVICE_HANDLER( wcfalcon_snd_w )
{
if (wcfalcon_flag == 0)
{
- ay8910_data_address_w(device->machine->device("ay8910"), 0, data);
+ ay8910_data_address_w(device->machine().device("ay8910"), 0, data);
// logerror("sound address: %02x %02x\n", data, wcfalcon_flag);
}
else
{
- ay8910_data_address_w(device->machine->device("ay8910"), 1, data);
+ ay8910_data_address_w(device->machine().device("ay8910"), 1, data);
// logerror("sound data: %02x %02x\n", data, wcfalcon_flag);
}
@@ -1043,9 +1043,9 @@ static WRITE8_DEVICE_HANDLER( lamps_a_w )
output_set_lamp_value(4, 1 - ((data >> 4) & 1)); /* Lamp 4 */
// popmessage("written : %02X", data);
- coin_counter_w(device->machine, 0, data & 0x40); /* counter1 */
- coin_counter_w(device->machine, 1, data & 0x80); /* counter2 */
- coin_counter_w(device->machine, 2, data & 0x20); /* counter3 */
+ coin_counter_w(device->machine(), 0, data & 0x40); /* counter1 */
+ coin_counter_w(device->machine(), 1, data & 0x80); /* counter2 */
+ coin_counter_w(device->machine(), 2, data & 0x20); /* counter3 */
/* Counters:
@@ -4617,7 +4617,7 @@ static DRIVER_INIT( royale )
{
/* $60bb, NOPing the ORA #$F0 (after read the PIA1 port B */
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x60bb] = 0xea;
// ROM[0x60bc] = 0xea;
@@ -4647,8 +4647,8 @@ static DRIVER_INIT( flcnw )
/* Attempt to decrypt the MCU program (we're sooo close!) */
- UINT8 *ROM = machine->region("mcu")->base();
- int size = machine->region("mcu")->bytes();
+ UINT8 *ROM = machine.region("mcu")->base();
+ int size = machine.region("mcu")->bytes();
int start = 0x0000;
int i;
@@ -4666,7 +4666,7 @@ static DRIVER_INIT( vkdlsa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xe097] = 0xea;
ROM[0xe098] = 0xea;
@@ -4678,7 +4678,7 @@ static DRIVER_INIT( vkdlsb )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xe87b] = 0xea;
ROM[0xe87c] = 0xea;
@@ -4690,7 +4690,7 @@ static DRIVER_INIT( vkdlsc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x453a] = 0xea;
ROM[0x453b] = 0xea;
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index bd496a06f04..1c20efa6f04 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -122,7 +122,7 @@
static WRITE8_HANDLER( protection_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
if (data == 0x2a)
state->dataoffset = 0;
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( protection_w )
static READ8_HANDLER( protection_r )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
static const int data[4] = { 0x47, 0x4f, 0x4c, 0x44 };
state->dataoffset %= 4;
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( magodds_outb850_w )
{
// guess, could be wrong, this might just be lights
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
if (data&0x20)
state->tile_bank = 1;
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( unkcm_0x02_w )
static WRITE8_HANDLER( unkcm_0x03_w )
{
//popmessage("unkcm_0x03_w %02x", data);
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->unkch_vidreg = data;
@@ -5502,21 +5502,21 @@ static const ppi8255_interface cm_ppi8255_intf[2] =
static WRITE8_DEVICE_HANDLER( system_outputa_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("system_outputa_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( system_outputb_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("system_outputb_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( system_outputc_w )
{
- goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ goldstar_state *state = device->machine().driver_data<goldstar_state>();
state->lucky8_nmi_enable = data & 8;
state->unkch_vidreg = data & 2;
@@ -5622,13 +5622,13 @@ static const ay8910_interface cm_ay8910_config =
static WRITE8_DEVICE_HANDLER( ay8910_outputa_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("ay8910_outputa_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( ay8910_outputb_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("ay8910_outputb_w %02x",data);
}
@@ -5764,7 +5764,7 @@ static PALETTE_INIT(cm)
for (i = 0; i < 0x100; i++)
{
UINT8 data;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
data = proms[0x000 + i] | (proms[0x100 + i] << 4);
@@ -5779,7 +5779,7 @@ static PALETTE_INIT(cmast91)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -5797,7 +5797,7 @@ static PALETTE_INIT(lucky8)
UINT8 data;
UINT8 *proms;
- proms = machine->region("proms")->base();
+ proms = machine.region("proms")->base();
for (i = 0; i < 0x100; i++)
{
@@ -5806,7 +5806,7 @@ static PALETTE_INIT(lucky8)
palette_set_color_rgb(machine, i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
- proms = machine->region("proms2")->base();
+ proms = machine.region("proms2")->base();
for (i=0; i < 0x20; i++)
{
data = proms[i];
@@ -6055,7 +6055,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( lucky8_irq )
{
- goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ goldstar_state *state = device->machine().driver_data<goldstar_state>();
if(state->lucky8_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -6109,7 +6109,7 @@ static PALETTE_INIT(magodds)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -8082,7 +8082,7 @@ YM2203
static DRIVER_INIT(magoddsc)
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (A = 0;A < 0x8000;A++)
{
@@ -9620,7 +9620,7 @@ ROM_END
static DRIVER_INIT(goldstar)
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
{
@@ -9633,7 +9633,7 @@ static DRIVER_INIT(goldstar)
// this block swapping is the same for chry10, chrygld and cb3
// the underlying bitswaps / xors are different however
-static void do_blockswaps(running_machine *machine, UINT8* ROM)
+static void do_blockswaps(running_machine &machine, UINT8* ROM)
{
int A;
UINT8 *buffer;
@@ -9664,13 +9664,13 @@ static void do_blockswaps(running_machine *machine, UINT8* ROM)
auto_free(machine, buffer);
}
-static void dump_to_file(running_machine* machine, UINT8* ROM)
+static void dump_to_file(running_machine& machine, UINT8* ROM)
{
#if 0
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -9705,8 +9705,8 @@ static UINT8 chry10_decrypt(UINT8 cipherText)
static DRIVER_INIT( chry10 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -9729,8 +9729,8 @@ static DRIVER_INIT( chry10 )
static DRIVER_INIT( cb3 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -9748,7 +9748,7 @@ static DRIVER_INIT( cb3 )
static DRIVER_INIT( chrygld )
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
do_blockswaps(machine, ROM);
// a data bitswap
@@ -9764,7 +9764,7 @@ static DRIVER_INIT( chrygld )
static DRIVER_INIT(cm)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9775,7 +9775,7 @@ static DRIVER_INIT(cm)
static DRIVER_INIT(cmv4)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9786,7 +9786,7 @@ static DRIVER_INIT(cmv4)
static DRIVER_INIT(cmast91)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9797,7 +9797,7 @@ static DRIVER_INIT(cmast91)
static DRIVER_INIT(lucky8a)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x0010] = 0x21;
}
@@ -9805,7 +9805,7 @@ static DRIVER_INIT(lucky8a)
static DRIVER_INIT( nfb96sea )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
@@ -9838,7 +9838,7 @@ static READ8_HANDLER( fixedvala8_r )
static DRIVER_INIT( schery97 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9853,8 +9853,8 @@ static DRIVER_INIT( schery97 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1d, 0x1d, FUNC(fixedvala8_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2a, 0x2a, FUNC(fixedvalb4_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1d, 0x1d, FUNC(fixedvala8_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2a, 0x2a, FUNC(fixedvalb4_r));
/* Oki 6295 at 0x20 */
}
@@ -9866,7 +9866,7 @@ static READ8_HANDLER( fixedval38_r )
static DRIVER_INIT( schery97a )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9883,7 +9883,7 @@ static DRIVER_INIT( schery97a )
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedval38_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedval38_r));
/* Oki 6295 at 0x20 */
}
@@ -9895,7 +9895,7 @@ static READ8_HANDLER( fixedvalea_r )
static DRIVER_INIT( skill98 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9910,7 +9910,7 @@ static DRIVER_INIT( skill98 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1e, 0x1e, FUNC(fixedvalea_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1e, 0x1e, FUNC(fixedvalea_r));
/* Oki 6295 at 0x20 */
}
@@ -9922,7 +9922,7 @@ static READ8_HANDLER( fixedval68_r )
static DRIVER_INIT( fb36xc1 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9937,7 +9937,7 @@ static DRIVER_INIT( fb36xc1 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x31, 0x31, FUNC(fixedval68_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x31, 0x31, FUNC(fixedval68_r));
}
@@ -9959,7 +9959,7 @@ static READ8_HANDLER( fixedvalaa_r )
static DRIVER_INIT( fbse354 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9974,11 +9974,11 @@ static DRIVER_INIT( fbse354 )
ROM[i] = x;
}
// nfb96b needs both of these
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x23, 0x23, FUNC(fixedval80_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5a, 0x5a, FUNC(fixedvalaa_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x23, 0x23, FUNC(fixedval80_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5a, 0x5a, FUNC(fixedvalaa_r));
// csel96b
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x6e, 0x6e, FUNC(fixedval96_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x6e, 0x6e, FUNC(fixedval96_r));
}
@@ -9991,7 +9991,7 @@ static READ8_HANDLER( fixedvalbe_r )
static DRIVER_INIT( fbse362 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10006,7 +10006,7 @@ static DRIVER_INIT( fbse362 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2e, 0x2e, FUNC(fixedvalbe_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2e, 0x2e, FUNC(fixedvalbe_r));
}
@@ -10023,7 +10023,7 @@ static READ8_HANDLER( fixedval84_r )
static DRIVER_INIT( rp35 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10038,8 +10038,8 @@ static DRIVER_INIT( rp35 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5e, 0x5e, FUNC(fixedval84_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x36, 0x36, FUNC(fixedval90_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5e, 0x5e, FUNC(fixedval84_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x36, 0x36, FUNC(fixedval90_r));
}
static READ8_HANDLER( fixedvalb2_r )
@@ -10050,7 +10050,7 @@ static READ8_HANDLER( fixedvalb2_r )
static DRIVER_INIT( rp36 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10066,7 +10066,7 @@ static DRIVER_INIT( rp36 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x34, 0x34, FUNC(fixedvalb2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x34, 0x34, FUNC(fixedvalb2_r));
}
static READ8_HANDLER( fixedval48_r )
@@ -10077,7 +10077,7 @@ static READ8_HANDLER( fixedval48_r )
static DRIVER_INIT( rp36c3 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10093,7 +10093,7 @@ static DRIVER_INIT( rp36c3 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, FUNC(fixedval48_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, FUNC(fixedval48_r));
}
static READ8_HANDLER( fixedval09_r )
@@ -10110,7 +10110,7 @@ static READ8_HANDLER( fixedval74_r )
static DRIVER_INIT( po33 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10125,8 +10125,8 @@ static DRIVER_INIT( po33 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x32, 0x32, FUNC(fixedval74_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x12, 0x12, FUNC(fixedval09_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x32, 0x32, FUNC(fixedval74_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x12, 0x12, FUNC(fixedval09_r));
/* oki6295 at 0x20 */
}
@@ -10138,7 +10138,7 @@ static READ8_HANDLER( fixedval58_r )
static DRIVER_INIT( tc132axt )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10154,7 +10154,7 @@ static DRIVER_INIT( tc132axt )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x21, 0x21, FUNC(fixedval58_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x21, 0x21, FUNC(fixedval58_r));
}
static READ8_HANDLER( fixedvale4_r )
@@ -10170,7 +10170,7 @@ static READ8_HANDLER( fixedvalc7_r )
static DRIVER_INIT( match133 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10186,14 +10186,14 @@ static DRIVER_INIT( match133 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedvalc7_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1a, 0x1a, FUNC(fixedvale4_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedvalc7_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1a, 0x1a, FUNC(fixedvale4_r));
}
static DRIVER_INIT(cherrys)
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
unsigned char rawData[256] = {
0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7,
@@ -10230,21 +10230,21 @@ static DRIVER_INIT(cherrys)
/* todo: remove these patches! */
static DRIVER_INIT( unkch1 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9d52] = 0x00;
ROM[0x9d53] = 0x00;
}
static DRIVER_INIT( unkch3 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9b86] = 0x00;
ROM[0x9b87] = 0x00;
}
static DRIVER_INIT( unkch4 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9a6e] = 0x00;
ROM[0x9a6f] = 0x00;
}
@@ -10252,7 +10252,7 @@ static DRIVER_INIT( unkch4 )
static DRIVER_INIT( tonypok )
{
// the ppi doesn't seem to work properly, so just install the inputs directly
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
io->install_read_port(0x04, 0x04, "IN0" );
io->install_read_port(0x05, 0x05, "IN1" );
io->install_read_port(0x06, 0x06, "IN2" );
diff --git a/src/mame/drivers/gomoku.c b/src/mame/drivers/gomoku.c
index b47e09d5d40..ae1f182ebda 100644
--- a/src/mame/drivers/gomoku.c
+++ b/src/mame/drivers/gomoku.c
@@ -32,7 +32,7 @@ static READ8_HANDLER( input_port_r )
res = 0;
for (i = 0; i < 8; i++)
- res |= ((input_port_read_safe(space->machine, portnames[i], 0xff) >> offset) & 1) << i;
+ res |= ((input_port_read_safe(space->machine(), portnames[i], 0xff) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/good.c b/src/mame/drivers/good.c
index 6e2dd1e1d4b..b0bba711f52 100644
--- a/src/mame/drivers/good.c
+++ b/src/mame/drivers/good.c
@@ -54,14 +54,14 @@ public:
static WRITE16_HANDLER( fg_tilemapram_w )
{
- good_state *state = space->machine->driver_data<good_state>();
+ good_state *state = space->machine().driver_data<good_state>();
COMBINE_DATA(&state->fg_tilemapram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
int tileno = state->fg_tilemapram[tile_index * 2];
int attr = state->fg_tilemapram[tile_index * 2 + 1] & 0xf;
SET_TILE_INFO(0, tileno, attr, 0);
@@ -69,14 +69,14 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE16_HANDLER( bg_tilemapram_w )
{
- good_state *state = space->machine->driver_data<good_state>();
+ good_state *state = space->machine().driver_data<good_state>();
COMBINE_DATA(&state->bg_tilemapram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
int tileno = state->bg_tilemapram[tile_index * 2];
int attr = state->bg_tilemapram[tile_index * 2 + 1] & 0xf;
SET_TILE_INFO(1, tileno, attr, 0);
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( good )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0xf);
@@ -94,7 +94,7 @@ static VIDEO_START( good )
static SCREEN_UPDATE( good )
{
- good_state *state = screen->machine->driver_data<good_state>();
+ good_state *state = screen->machine().driver_data<good_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c
index bc5edc8d644..978fbb02db2 100644
--- a/src/mame/drivers/goodejan.c
+++ b/src/mame/drivers/goodejan.c
@@ -81,17 +81,17 @@ static WRITE16_HANDLER( goodejan_gfxbank_w )
/* Multiplexer device for the mahjong panel */
static READ16_HANDLER( mahjong_panel_r )
{
- goodejan_state *state = space->machine->driver_data<goodejan_state>();
+ goodejan_state *state = space->machine().driver_data<goodejan_state>();
UINT16 ret;
ret = 0xffff;
switch(state->mux_data)
{
- case 1: ret = input_port_read(space->machine, "KEY0"); break;
- case 2: ret = input_port_read(space->machine, "KEY1"); break;
- case 4: ret = input_port_read(space->machine, "KEY2"); break;
- case 8: ret = input_port_read(space->machine, "KEY3"); break;
- case 0x10: ret = input_port_read(space->machine, "KEY4"); break;
+ case 1: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 2: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 4: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 8: ret = input_port_read(space->machine(), "KEY3"); break;
+ case 0x10: ret = input_port_read(space->machine(), "KEY4"); break;
}
return ret;
@@ -99,7 +99,7 @@ static READ16_HANDLER( mahjong_panel_r )
static WRITE16_HANDLER( mahjong_panel_w )
{
- goodejan_state *state = space->machine->driver_data<goodejan_state>();
+ goodejan_state *state = space->machine().driver_data<goodejan_state>();
state->mux_data = data;
}
diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c
index dc529082afd..0365a346cae 100644
--- a/src/mame/drivers/gotcha.c
+++ b/src/mame/drivers/gotcha.c
@@ -238,7 +238,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- gotcha_state *state = device->machine->driver_data<gotcha_state>();
+ gotcha_state *state = device->machine().driver_data<gotcha_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -250,9 +250,9 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( gotcha )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->banksel));
state->save_item(NAME(state->gfxbank));
@@ -261,7 +261,7 @@ static MACHINE_START( gotcha )
static MACHINE_RESET( gotcha )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
int i;
for (i = 0; i < 4; i++)
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index cf03862b747..451390670f2 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -238,23 +238,23 @@ static WRITE8_HANDLER( laserdisc_command_w );
static MACHINE_START( gottlieb )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* register for save states */
state_save_register_global(machine, state->joystick_select);
state_save_register_global_array(machine, state->track);
/* see if we have a laserdisc */
- state->laserdisc = machine->m_devicelist.first(LASERDISC);
+ state->laserdisc = machine.m_devicelist.first(LASERDISC);
if (state->laserdisc != NULL)
{
/* attach to the I/O ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x05805, 0x05807, 0, 0x07f8, FUNC(laserdisc_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05805, 0x05805, 0, 0x07f8, FUNC(laserdisc_command_w)); /* command for the player */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05806, 0x05806, 0, 0x07f8, FUNC(laserdisc_select_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x05805, 0x05807, 0, 0x07f8, FUNC(laserdisc_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05805, 0x05805, 0, 0x07f8, FUNC(laserdisc_command_w)); /* command for the player */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05806, 0x05806, 0, 0x07f8, FUNC(laserdisc_select_w));
/* allocate a timer for serial transmission, and one for philips code processing */
- state->laserdisc_bit_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_bit_callback));
- state->laserdisc_philips_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_philips_callback));
+ state->laserdisc_bit_timer = machine.scheduler().timer_alloc(FUNC(laserdisc_bit_callback));
+ state->laserdisc_philips_timer = machine.scheduler().timer_alloc(FUNC(laserdisc_philips_callback));
/* create some audio RAM */
state->laserdisc_audio_buffer = auto_alloc_array(machine, UINT8, AUDIORAM_SIZE);
@@ -279,10 +279,10 @@ static MACHINE_START( gottlieb )
static MACHINE_RESET( gottlieb )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* if we have a laserdisc, reset our philips code callback for the next line 17 */
if (state->laserdisc != NULL)
- state->laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(17), 17);
+ state->laserdisc_philips_timer->adjust(machine.primary_screen->time_until_pos(17), 17);
}
@@ -295,28 +295,28 @@ static MACHINE_RESET( gottlieb )
static CUSTOM_INPUT( analog_delta_r )
{
- gottlieb_state *state = field->port->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = field->port->machine().driver_data<gottlieb_state>();
const char *string = (const char *)param;
int which = string[0] - '0';
- return input_port_read(field->port->machine, &string[1]) - state->track[which];
+ return input_port_read(field->port->machine(), &string[1]) - state->track[which];
}
static WRITE8_HANDLER( gottlieb_analog_reset_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* reset the trackball counters */
- state->track[0] = input_port_read_safe(space->machine, "TRACKX", 0);
- state->track[1] = input_port_read_safe(space->machine, "TRACKY", 0);
+ state->track[0] = input_port_read_safe(space->machine(), "TRACKX", 0);
+ state->track[1] = input_port_read_safe(space->machine(), "TRACKY", 0);
}
static CUSTOM_INPUT( stooges_joystick_r )
{
- gottlieb_state *state = field->port->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = field->port->machine().driver_data<gottlieb_state>();
static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", NULL };
- return (joyport[state->joystick_select & 3] != NULL) ? input_port_read(field->port->machine, joyport[state->joystick_select & 3]) : 0xff;
+ return (joyport[state->joystick_select & 3] != NULL) ? input_port_read(field->port->machine(), joyport[state->joystick_select & 3]) : 0xff;
}
@@ -329,7 +329,7 @@ static CUSTOM_INPUT( stooges_joystick_r )
static WRITE8_HANDLER( general_output_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* bits 0-3 control video features, and are different for laserdisc games */
if (state->laserdisc == NULL)
gottlieb_video_control_w(space, offset, data);
@@ -337,7 +337,7 @@ static WRITE8_HANDLER( general_output_w )
gottlieb_laserdisc_video_control_w(space, offset, data);
/* bit 4 controls the coin meter */
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x10);
/* bit 5 controls the knocker */
output_set_value("knocker0", (data >> 5) & 1);
@@ -351,15 +351,15 @@ static WRITE8_HANDLER( general_output_w )
static WRITE8_HANDLER( reactor_output_w )
{
general_output_w(space, offset, data & ~0xe0);
- set_led_status(space->machine, 0, data & 0x20);
- set_led_status(space->machine, 1, data & 0x40);
- set_led_status(space->machine, 2, data & 0x80);
+ set_led_status(space->machine(), 0, data & 0x20);
+ set_led_status(space->machine(), 1, data & 0x40);
+ set_led_status(space->machine(), 2, data & 0x80);
}
static WRITE8_HANDLER( stooges_output_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
general_output_w(space, offset, data & ~0x60);
state->joystick_select = (data >> 5) & 0x03;
}
@@ -374,7 +374,7 @@ static WRITE8_HANDLER( stooges_output_w )
static READ8_HANDLER( laserdisc_status_r )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* IP5 reads low 8 bits of philips code */
if (offset == 0)
return state->laserdisc_philips_code;
@@ -406,7 +406,7 @@ static READ8_HANDLER( laserdisc_status_r )
static WRITE8_HANDLER( laserdisc_select_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* selects between reading audio data and reading status */
state->laserdisc_select = data & 1;
}
@@ -414,7 +414,7 @@ static WRITE8_HANDLER( laserdisc_select_w )
static WRITE8_HANDLER( laserdisc_command_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* a write here latches data into a 8-bit register and starts
a sequence of events that sends serial data to the player */
@@ -435,7 +435,7 @@ static WRITE8_HANDLER( laserdisc_command_w )
static TIMER_CALLBACK( laserdisc_philips_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
int newcode = laserdisc_get_field_code(state->laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE);
/* the PR8210 sends line 17/18 data on each frame; the laserdisc interface
@@ -450,13 +450,13 @@ static TIMER_CALLBACK( laserdisc_philips_callback )
/* toggle to the next one */
param = (param == 17) ? 18 : 17;
- state->laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param);
+ state->laserdisc_philips_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param);
}
static TIMER_CALLBACK( laserdisc_bit_off_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* deassert the control line */
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
}
@@ -464,14 +464,14 @@ static TIMER_CALLBACK( laserdisc_bit_off_callback )
static TIMER_CALLBACK( laserdisc_bit_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
UINT8 bitsleft = param >> 16;
UINT8 data = param;
attotime duration;
/* assert the line and set a timer for deassertion */
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
- machine->scheduler().timer_set(LASERDISC_CLOCK * 10, FUNC(laserdisc_bit_off_callback));
+ machine.scheduler().timer_set(LASERDISC_CLOCK * 10, FUNC(laserdisc_bit_off_callback));
/* determine how long for the next command; there is a 555 timer with a
variable resistor controlling the timing of the pulses. Nominally, the
@@ -598,8 +598,8 @@ static void audio_handle_zero_crossing(gottlieb_state *state, attotime zerotime,
static void laserdisc_audio_process(device_t *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1)
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
- int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine, KEYCODE_L);
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
+ int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine(), KEYCODE_L);
attotime time_per_sample = attotime::from_hz(samplerate);
attotime curtime = state->laserdisc_last_time;
int cursamp;
@@ -672,10 +672,10 @@ static TIMER_CALLBACK( nmi_clear )
static INTERRUPT_GEN( gottlieb_interrupt )
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
/* assert the NMI and set a timer to clear it at the first visible line */
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(0), FUNC(nmi_clear));
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(0), FUNC(nmi_clear));
/* if we have a laserdisc, update it */
if (state->laserdisc != NULL)
@@ -2598,14 +2598,14 @@ ROM_END
static DRIVER_INIT( ramtiles )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = state->gfxcharhi = 0;
}
static DRIVER_INIT( romtiles )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = state->gfxcharhi = 1;
}
@@ -2613,13 +2613,13 @@ static DRIVER_INIT( romtiles )
static DRIVER_INIT( stooges )
{
DRIVER_INIT_CALL(ramtiles);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05803, 0x05803, 0, 0x07f8, FUNC(stooges_output_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05803, 0x05803, 0, 0x07f8, FUNC(stooges_output_w));
}
static DRIVER_INIT( screwloo )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = 0;
state->gfxcharhi = 1;
}
@@ -2627,7 +2627,7 @@ static DRIVER_INIT( screwloo )
static DRIVER_INIT( vidvince )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = 1;
state->gfxcharhi = 0;
}
diff --git a/src/mame/drivers/gotya.c b/src/mame/drivers/gotya.c
index 228ac47177a..48f86121b59 100644
--- a/src/mame/drivers/gotya.c
+++ b/src/mame/drivers/gotya.c
@@ -176,9 +176,9 @@ static const samples_interface gotya_samples_interface =
static MACHINE_START( gotya )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
- state->samples = machine->device("samples");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->scroll_bit_8));
state->save_item(NAME(state->theme_playing));
@@ -186,7 +186,7 @@ static MACHINE_START( gotya )
static MACHINE_RESET( gotya )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
state->scroll_bit_8 = 0;
state->theme_playing = 0;
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index f9e2185db45..907a13d35bc 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -70,9 +70,9 @@ public:
/* VIDEO GOODS */
-static void gpworld_draw_tiles(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
UINT8 characterX, characterY;
/* Temporarily set to 64 wide to accommodate two screens */
@@ -82,7 +82,7 @@ static void gpworld_draw_tiles(running_machine *machine, bitmap_t *bitmap,const
{
int current_screen_character = (characterY*64) + characterX;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], state->tile_RAM[current_screen_character],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->tile_RAM[current_screen_character],
characterY, 0, 0, characterX*8, characterY*8, 0);
}
}
@@ -105,9 +105,9 @@ INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,in
*BITMAP_ADDR32(bitmap, y, x) = color;
}
-static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
const int SPR_Y_TOP = 0;
const int SPR_Y_BOTTOM = 1;
const int SPR_X_LO = 2;
@@ -120,7 +120,7 @@ static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
int i;
- UINT8 *GFX = machine->region("gfx2")->base();
+ UINT8 *GFX = machine.region("gfx2")->base();
/* Heisted from Daphne which heisted it from MAME */
for (i = 0; i < 0x800; i += 8)
@@ -220,8 +220,8 @@ static SCREEN_UPDATE( gpworld )
{
bitmap_fill(bitmap, cliprect, 0);
- gpworld_draw_tiles(screen->machine, bitmap, cliprect);
- gpworld_draw_sprites(screen->machine, bitmap, cliprect);
+ gpworld_draw_tiles(screen->machine(), bitmap, cliprect);
+ gpworld_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -229,8 +229,8 @@ static SCREEN_UPDATE( gpworld )
static MACHINE_START( gpworld )
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
- state->laserdisc = machine->device("laserdisc");
+ gpworld_state *state = machine.driver_data<gpworld_state>();
+ state->laserdisc = machine.device("laserdisc");
}
@@ -238,30 +238,30 @@ static MACHINE_START( gpworld )
/* READS */
static READ8_HANDLER( ldp_read )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
return state->ldp_read_latch;
}
static READ8_HANDLER( pedal_in )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
if (state->brake_gas)
- return input_port_read(space->machine, "INACCEL");
+ return input_port_read(space->machine(), "INACCEL");
- return input_port_read(space->machine, "INBRAKE");
+ return input_port_read(space->machine(), "INBRAKE");
}
/* WRITES */
static WRITE8_HANDLER( ldp_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->ldp_write_latch = data;
}
static WRITE8_HANDLER( misc_io_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->start_lamp = (data & 0x04) >> 1;
state->nmi_enable = (data & 0x40) >> 6;
/* dunno = (data & 0x80) >> 7; */ //coin counter???
@@ -271,13 +271,13 @@ static WRITE8_HANDLER( misc_io_write )
static WRITE8_HANDLER( brake_gas_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->brake_gas = data & 0x01;
}
static WRITE8_HANDLER( palette_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
/* This is all just a (bad) guess */
int pal_index, r, g, b, a;
@@ -293,7 +293,7 @@ static WRITE8_HANDLER( palette_write )
/* logerror("PAL WRITE index : %x rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */
- palette_set_color(space->machine, (pal_index & 0xffe) >> 1, MAKE_ARGB(a, r, g, b));
+ palette_set_color(space->machine(), (pal_index & 0xffe) >> 1, MAKE_ARGB(a, r, g, b));
}
/* PROGRAM MAP */
@@ -431,7 +431,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( vblank_callback_gpworld )
{
- gpworld_state *state = device->machine->driver_data<gpworld_state>();
+ gpworld_state *state = device->machine().driver_data<gpworld_state>();
/* Do an NMI if the enabled bit is set */
if (state->nmi_enable)
{
@@ -442,7 +442,7 @@ static INTERRUPT_GEN( vblank_callback_gpworld )
/* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(100), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(irq_stop));
}
static const gfx_layout gpworld_tile_layout =
@@ -527,7 +527,7 @@ ROM_END
static DRIVER_INIT( gpworld )
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
state->nmi_enable = 0;
state->start_lamp = 0;
state->brake_gas = 0;
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index 2415cf14920..9bf23ad0009 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -30,13 +30,13 @@
static READ16_HANDLER( k052109_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k052109_r(state->k052109, offset);
}
static WRITE16_HANDLER( k052109_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k052109_w(state->k052109, offset, data & 0xff);
@@ -49,13 +49,13 @@ static WRITE16_HANDLER( k052109_halfword_w )
static READ16_HANDLER( k051937_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k051937_r(state->k051960, offset);
}
static WRITE16_HANDLER( k051937_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k051937_w(state->k051960, offset, data & 0xff);
@@ -63,28 +63,28 @@ static WRITE16_HANDLER( k051937_halfword_w )
static READ16_HANDLER( k051960_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k051960_r(state->k051960, offset);
}
static WRITE16_HANDLER( k051960_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k051960_w(state->k051960, offset, data & 0xff);
}
static WRITE16_HANDLER( cpuA_ctrl_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_8_15)
{
data >>= 8;
/* bits 0-1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 selects layer priority */
state->priority = data & 0x04;
@@ -102,7 +102,7 @@ static WRITE16_HANDLER( cpuA_ctrl_w )
static WRITE16_HANDLER( cpuB_irqenable_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_8_15)
state->irqBmask = (data >> 8) & 0x07;
@@ -110,14 +110,14 @@ static WRITE16_HANDLER( cpuB_irqenable_w )
static INTERRUPT_GEN( cpuA_interrupt )
{
- gradius3_state *state = device->machine->driver_data<gradius3_state>();
+ gradius3_state *state = device->machine().driver_data<gradius3_state>();
if (state->irqAen)
device_set_input_line(device, 2, HOLD_LINE);
}
static INTERRUPT_GEN( cpuB_interrupt )
{
- gradius3_state *state = device->machine->driver_data<gradius3_state>();
+ gradius3_state *state = device->machine().driver_data<gradius3_state>();
if (cpu_getiloops(device) & 1) /* ??? */
{
@@ -133,7 +133,7 @@ static INTERRUPT_GEN( cpuB_interrupt )
static WRITE16_HANDLER( cpuB_irqtrigger_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (state->irqBmask & 4)
{
@@ -152,7 +152,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( sound_irq_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -301,14 +301,14 @@ static const k051960_interface gradius3_k051960_intf =
static MACHINE_START( gradius3 )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->irqAen));
state->save_item(NAME(state->irqBmask));
@@ -317,7 +317,7 @@ static MACHINE_START( gradius3 )
static MACHINE_RESET( gradius3 )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
/* start with cpu B halted */
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index f42522d3f47..e05d410b5df 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -92,7 +92,7 @@ static MACHINE_RESET( grchamp )
static INTERRUPT_GEN( grchamp_cpu0_interrupt )
{
- grchamp_state *state = device->machine->driver_data<grchamp_state>();
+ grchamp_state *state = device->machine().driver_data<grchamp_state>();
if (state->cpu0_out[0] & 0x01)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -101,7 +101,7 @@ static INTERRUPT_GEN( grchamp_cpu0_interrupt )
static INTERRUPT_GEN( grchamp_cpu1_interrupt )
{
- grchamp_state *state = device->machine->driver_data<grchamp_state>();
+ grchamp_state *state = device->machine().driver_data<grchamp_state>();
if (state->cpu1_out[4] & 0x01)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -117,7 +117,7 @@ static INTERRUPT_GEN( grchamp_cpu1_interrupt )
static WRITE8_HANDLER( cpu0_outputs_w )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
UINT8 diff = data ^ state->cpu0_out[offset];
state->cpu0_out[offset] = data;
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( cpu0_outputs_w )
/* bit 6: FOG OUT */
/* bit 7: RADARON */
if ((diff & 0x01) && !(data & 0x01))
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
if ((diff & 0x02) && !(data & 0x02))
state->collide = state->collmode = 0;
break;
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( cpu0_outputs_w )
/* bit 4: coin lockout */
/* bit 5: Game Over lamp */
/* bit 6-7: n/c */
- coin_lockout_global_w(space->machine, (data >> 4) & 1);
+ coin_lockout_global_w(space->machine(), (data >> 4) & 1);
output_set_value("led0", (~data >> 5) & 1);
break;
@@ -185,13 +185,13 @@ static WRITE8_HANDLER( cpu0_outputs_w )
break;
case 0x0d: /* OUT13 */
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
break;
case 0x0e: /* OUT14 */
/* O-21 connector */
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
}
}
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( led_board_w )
{
static const UINT8 ls247_map[16] =
{ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 };
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
switch (offset)
{
@@ -244,8 +244,8 @@ static WRITE8_HANDLER( led_board_w )
static WRITE8_HANDLER( cpu1_outputs_w )
{
- device_t *discrete = space->machine->device("discrete");
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ device_t *discrete = space->machine().device("discrete");
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
UINT8 diff = data ^ state->cpu1_out[offset];
state->cpu1_out[offset] = data;
@@ -272,7 +272,7 @@ static WRITE8_HANDLER( cpu1_outputs_w )
case 0x04: /* OUT4 */
/* bit 0: interrupt enable for CPU 1 */
if ((diff & 0x01) && !(data & 0x01))
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x05: /* OUT5 - unused */
@@ -337,12 +337,12 @@ static WRITE8_HANDLER( cpu1_outputs_w )
*
*************************************/
-INLINE UINT8 get_pc3259_bits(running_machine *machine, grchamp_state *state, int offs)
+INLINE UINT8 get_pc3259_bits(running_machine &machine, grchamp_state *state, int offs)
{
int bits;
/* force a partial update to the current position */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* get the relevant 4 bits */
bits = (state->collide >> (offs*4)) & 0x0f;
@@ -354,29 +354,29 @@ INLINE UINT8 get_pc3259_bits(running_machine *machine, grchamp_state *state, int
static READ8_HANDLER( pc3259_0_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 0);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 0);
}
static READ8_HANDLER( pc3259_1_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 1);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 1);
}
static READ8_HANDLER( pc3259_2_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 2);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 2);
}
static READ8_HANDLER( pc3259_3_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 3);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 3);
}
@@ -389,14 +389,14 @@ static READ8_HANDLER( pc3259_3_r )
static READ8_HANDLER( sub_to_main_comm_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
return state->comm_latch;
}
static TIMER_CALLBACK( main_to_sub_comm_sync_w )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
int offset = param >> 8;
state->comm_latch2[offset & 3] = param;
}
@@ -404,13 +404,13 @@ static TIMER_CALLBACK( main_to_sub_comm_sync_w )
static WRITE8_HANDLER( main_to_sub_comm_w )
{
- space->machine->scheduler().synchronize(FUNC(main_to_sub_comm_sync_w), data | (offset << 8));
+ space->machine().scheduler().synchronize(FUNC(main_to_sub_comm_sync_w), data | (offset << 8));
}
static READ8_HANDLER( main_to_sub_comm_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
return state->comm_latch2[offset];
}
diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c
index ac561c3171d..eafd070a7b0 100644
--- a/src/mame/drivers/gridlee.c
+++ b/src/mame/drivers/gridlee.c
@@ -89,7 +89,7 @@
/* local prototypes */
-static void poly17_init(running_machine *machine);
+static void poly17_init(running_machine &machine);
/*************************************
*
@@ -105,18 +105,18 @@ static TIMER_CALLBACK( irq_off_tick )
static TIMER_CALLBACK( irq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* next interrupt after scanline 256 is scanline 64 */
if (param == 256)
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
else
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(param + 64), param + 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(param + 64), param + 64);
/* IRQ starts on scanline 0, 64, 128, etc. */
cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->irq_off->adjust(machine->primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
+ state->irq_off->adjust(machine.primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
}
@@ -128,21 +128,21 @@ static TIMER_CALLBACK( firq_off_tick )
static TIMER_CALLBACK( firq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* same time next frame */
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
/* IRQ starts on scanline FIRQ_SCANLINE? */
cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->firq_off->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
+ state->firq_off->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
}
static MACHINE_START( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
+ gridlee_state *state = machine.driver_data<gridlee_state>();
+ state->maincpu = machine.device<cpu_device>("maincpu");
/* create the polynomial tables */
poly17_init(machine);
@@ -150,19 +150,19 @@ static MACHINE_START( gridlee )
state_save_register_global_array(machine, state->last_analog_input);
state_save_register_global_array(machine, state->last_analog_output);
- state->irq_off = machine->scheduler().timer_alloc(FUNC(irq_off_tick));
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_timer_tick));
- state->firq_off = machine->scheduler().timer_alloc(FUNC(firq_off_tick));
- state->firq_timer = machine->scheduler().timer_alloc(FUNC(firq_timer_tick));
+ state->irq_off = machine.scheduler().timer_alloc(FUNC(irq_off_tick));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_timer_tick));
+ state->firq_off = machine.scheduler().timer_alloc(FUNC(firq_off_tick));
+ state->firq_timer = machine.scheduler().timer_alloc(FUNC(firq_timer_tick));
}
static MACHINE_RESET( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* start timers to generate interrupts */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(0));
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(0));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
}
@@ -175,13 +175,13 @@ static MACHINE_RESET( gridlee )
static READ8_HANDLER( analog_port_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
int delta, sign, magnitude;
UINT8 newval;
static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
/* first read the new trackball value and compute the signed delta */
- newval = input_port_read(space->machine, portnames[offset + 2 * state->cocktail_flip]);
+ newval = input_port_read(space->machine(), portnames[offset + 2 * state->cocktail_flip]);
delta = (int)newval - (int)state->last_analog_input[offset];
/* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
@@ -226,9 +226,9 @@ static READ8_HANDLER( analog_port_r )
#define POLY17_SHR 10
#define POLY17_ADD 0x18000
-static void poly17_init(running_machine *machine)
+static void poly17_init(running_machine &machine)
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
UINT32 i, x = 0;
UINT8 *p, *r;
@@ -258,7 +258,7 @@ static void poly17_init(running_machine *machine)
static READ8_HANDLER( random_num_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
UINT32 cc;
/* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */
@@ -279,21 +279,21 @@ static READ8_HANDLER( random_num_r )
static WRITE8_HANDLER( led_0_w )
{
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
logerror("LED 0 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( led_1_w )
{
- set_led_status(space->machine, 1, data & 1);
+ set_led_status(space->machine(), 1, data & 1);
logerror("LED 1 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( gridlee_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
logerror("coin counter %s\n", (data & 1) ? "on" : "off");
}
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index f6e071a5256..d6cee9e366b 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -81,15 +81,15 @@ Extract a standard version of this
static WRITE32_HANDLER( color_ram_w )
{
int a,r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
{
- a = space->machine->generic.paletteram.u32[offset];
+ a = space->machine().generic.paletteram.u32[offset];
r = (a &0xff0000) >> 16;
g = (a &0xff00) >> 8;
b = (a &0xff);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
}
@@ -126,30 +126,30 @@ static const eeprom_interface groundfx_eeprom_interface =
static CUSTOM_INPUT( frame_counter_r )
{
- groundfx_state *state = field->port->machine->driver_data<groundfx_state>();
+ groundfx_state *state = field->port->machine().driver_data<groundfx_state>();
return state->frame_counter;
}
static CUSTOM_INPUT( coin_word_r )
{
- groundfx_state *state = field->port->machine->driver_data<groundfx_state>();
+ groundfx_state *state = field->port->machine().driver_data<groundfx_state>();
return state->coin_word;
}
static WRITE32_HANDLER( groundfx_input_w )
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
switch (offset)
{
case 0x00:
if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
break;
@@ -157,10 +157,10 @@ static WRITE32_HANDLER( groundfx_input_w )
case 0x01:
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0,~data & 0x01000000);
- coin_lockout_w(space->machine, 1,~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x08000000);
+ coin_lockout_w(space->machine(), 0,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1,~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x08000000);
state->coin_word = (data >> 16) &0xffff;
}
break;
@@ -169,19 +169,19 @@ static WRITE32_HANDLER( groundfx_input_w )
static READ32_HANDLER( groundfx_adc_r )
{
- return (input_port_read(space->machine, "AN0") << 8) | input_port_read(space->machine, "AN1");
+ return (input_port_read(space->machine(), "AN0") << 8) | input_port_read(space->machine(), "AN1");
}
static WRITE32_HANDLER( groundfx_adc_w )
{
/* One interrupt per input port (4 per frame, though only 2 used).
1000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(groundfx_interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(groundfx_interrupt5));
}
static WRITE32_HANDLER( rotate_control_w ) /* only a guess that it's rotation */
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
if (ACCESSING_BITS_0_15)
{
state->rotate_ctrl[state->port_sel] = data;
@@ -360,7 +360,7 @@ static const tc0480scp_interface groundfx_tc0480scp_intf =
static INTERRUPT_GEN( groundfx_interrupt )
{
- groundfx_state *state = device->machine->driver_data<groundfx_state>();
+ groundfx_state *state = device->machine().driver_data<groundfx_state>();
state->frame_counter^=1;
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -441,7 +441,7 @@ ROM_END
static READ32_HANDLER( irq_speedup_r_groundfx )
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
cpu_device *cpu = downcast<cpu_device *>(space->cpu);
int ptr;
offs_t sp = cpu->sp();
@@ -459,12 +459,12 @@ static READ32_HANDLER( irq_speedup_r_groundfx )
static DRIVER_INIT( groundfx )
{
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx3")->base();
- int size=machine->region("gfx3")->bytes();
+ UINT8 *gfx = machine.region("gfx3")->base();
+ int size=machine.region("gfx3")->bytes();
int data;
/* Speedup handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20b574, 0x20b577, FUNC(irq_speedup_r_groundfx));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20b574, 0x20b577, FUNC(irq_speedup_r_groundfx));
/* make piv tile GFX format suitable for gfxdecode */
offset = size/2;
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index c85da761706..7d3e47b4352 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -161,7 +161,7 @@ static CUSTOM_INPUT( gstream_mirror_service_r )
int result;
/* PORT_SERVICE_NO_TOGGLE */
- result = (input_port_read(field->port->machine, "IN0") & 0x8000) >> 15;
+ result = (input_port_read(field->port->machine(), "IN0") & 0x8000) >> 15;
return ~result;
}
@@ -171,15 +171,15 @@ static CUSTOM_INPUT( gstream_mirror_r )
int result;
/* IPT_COIN1 */
- result = ((input_port_read(field->port->machine, "IN0") & 0x200) >> 9) << 0;
+ result = ((input_port_read(field->port->machine(), "IN0") & 0x200) >> 9) << 0;
/* IPT_COIN2 */
- result |= ((input_port_read(field->port->machine, "IN1") & 0x200) >> 9) << 1;
+ result |= ((input_port_read(field->port->machine(), "IN1") & 0x200) >> 9) << 1;
/* IPT_START1 */
- result |= ((input_port_read(field->port->machine, "IN0") & 0x400) >> 10) << 2;
+ result |= ((input_port_read(field->port->machine(), "IN0") & 0x400) >> 10) << 2;
/* IPT_START2 */
- result |= ((input_port_read(field->port->machine, "IN1") & 0x400) >> 10) << 3;
+ result |= ((input_port_read(field->port->machine(), "IN1") & 0x400) >> 10) << 3;
/* PORT_SERVICE_NO_TOGGLE */
- result |= ((input_port_read(field->port->machine, "IN0") & 0x8000) >> 15) << 6;
+ result |= ((input_port_read(field->port->machine(), "IN0") & 0x8000) >> 15) << 6;
return ~result;
}
@@ -187,22 +187,22 @@ static CUSTOM_INPUT( gstream_mirror_r )
static WRITE32_HANDLER( gstream_palette_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb(space->machine, offset * 2, pal5bit(state->paletteram[offset] >> (0 + 16)),
+ palette_set_color_rgb(space->machine(), offset * 2, pal5bit(state->paletteram[offset] >> (0 + 16)),
pal5bit(state->paletteram[offset] >> (6 + 16)),
pal5bit(state->paletteram[offset] >> (11 + 16)));
- palette_set_color_rgb(space->machine,offset * 2 + 1,pal5bit(state->paletteram[offset] >> (0)),
+ palette_set_color_rgb(space->machine(),offset * 2 + 1,pal5bit(state->paletteram[offset] >> (0)),
pal5bit(state->paletteram[offset] >> (6)),
pal5bit(state->paletteram[offset] >> (11)));
}
static WRITE32_HANDLER( gstream_vram_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
COMBINE_DATA(&state->vram[offset]);
if (ACCESSING_BITS_24_31)
@@ -224,37 +224,37 @@ static WRITE32_HANDLER( gstream_vram_w )
static WRITE32_HANDLER( gstream_tilemap1_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap1_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap1_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap1_scrolly = data;
}
static WRITE32_HANDLER( gstream_tilemap2_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap2_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap2_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap2_scrolly = data;
}
static WRITE32_HANDLER( gstream_tilemap3_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap3_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap3_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap3_scrolly = data;
}
@@ -307,7 +307,7 @@ static WRITE32_HANDLER( gstream_oki_banking_w )
Musics order is completely guessed but close to what the original PCB game should be */
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
static const int bank_table_0[16] = { -1, -1, -1, -1, -1, -1, 0, 0, -1, 6, 0, 5, -1, 0, 0, 0 };
static const int bank_table_1[16] = { -1, -1, -1, -1, -1, -1, 2, 2, -1, 0, 0, 4, -1, 1, 1, 1 };
@@ -431,7 +431,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_gs1_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x000 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x000 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno, palette + 0x10, 0);
@@ -439,7 +439,7 @@ static TILE_GET_INFO( get_gs1_tile_info )
static TILE_GET_INFO( get_gs2_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x400 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x400 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno + 0x1000, palette + 0x14, 0);
@@ -448,7 +448,7 @@ static TILE_GET_INFO( get_gs2_tile_info )
static TILE_GET_INFO( get_gs3_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x800 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x800 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno + 0x2000, palette + 0x18, 0);
@@ -457,7 +457,7 @@ static TILE_GET_INFO( get_gs3_tile_info )
static VIDEO_START(gstream)
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->tilemap1 = tilemap_create(machine, get_gs1_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
state->tilemap2 = tilemap_create(machine, get_gs2_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
state->tilemap3 = tilemap_create(machine, get_gs3_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
@@ -482,7 +482,7 @@ static SCREEN_UPDATE(gstream)
are being set ?!
*/
- gstream_state *state = screen->machine->driver_data<gstream_state>();
+ gstream_state *state = screen->machine().driver_data<gstream_state>();
int i;
//popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", state->tmap1_scrollx, state->tmap1_scrolly, state->tmap2_scrollx, state->tmap2_scrolly, state->tmap3_scrollx, state->tmap3_scrolly );
@@ -512,7 +512,7 @@ static SCREEN_UPDATE(gstream)
if (x & 0x8000) x -= 0x10000;
if (y & 0x8000) y -= 0x10000;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],code,col,0,0,x-2,y,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],code,col,0,0,x-2,y,0);
}
return 0;
@@ -521,7 +521,7 @@ static SCREEN_UPDATE(gstream)
static MACHINE_START( gstream )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->save_item(NAME(state->tmap1_scrollx));
state->save_item(NAME(state->tmap2_scrollx));
@@ -535,7 +535,7 @@ static MACHINE_START( gstream )
static MACHINE_RESET( gstream )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->tmap1_scrollx = 0;
state->tmap2_scrollx = 0;
@@ -623,7 +623,7 @@ ROM_END
static READ32_HANDLER( gstream_speedup_r )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
if (state->maincpu->state(STATE_GENPC) == 0xc0001592)
{
state->maincpu->eat_cycles(50);
@@ -634,7 +634,7 @@ static READ32_HANDLER( gstream_speedup_r )
static DRIVER_INIT( gstream )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd1ee0, 0xd1ee3, FUNC(gstream_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd1ee0, 0xd1ee3, FUNC(gstream_speedup_r) );
}
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index 1a86cb5a694..628c957b033 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -182,7 +182,7 @@ Frequencies: 68k is XTAL_32MHZ/2
static READ16_HANDLER(dmmy_8f)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->dmmy_8f_ret = ~state->dmmy_8f_ret;
return state->dmmy_8f_ret;
}
@@ -192,36 +192,36 @@ static READ16_HANDLER(dmmy_8f)
static WRITE16_HANDLER( sound_command_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
#if 0
static READ16_HANDLER( pending_command_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
return state->pending_command;
}
#endif
static WRITE8_HANDLER( gs_sh_pending_command_clear_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( gs_sh_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("audiocpu")->base();
+ UINT8 *RAM = space->machine().region("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
/*** GFX DECODE **************************************************************/
@@ -266,9 +266,9 @@ GFXDECODE_END
static void gs_ym2610_irq(device_t *device, int irq)
{
if (irq)
- cputag_set_input_line(device->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, ASSERT_LINE);
else
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -833,19 +833,19 @@ state->work_ram[0x002/2] = (_num_ & 0x0000ffff) >> 0;
static WRITE16_HANDLER( twrldc94_mcu_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->mcu_data = data;
}
static READ16_HANDLER( twrldc94_mcu_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
return state->mcu_data;
}
static WRITE16_HANDLER( twrldc94_prot_reg_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->prot_reg[1] = state->prot_reg[0];
state->prot_reg[0] = data;
@@ -958,7 +958,7 @@ static WRITE16_HANDLER( twrldc94_prot_reg_w )
static READ16_HANDLER( twrldc94_prot_reg_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
// bit 0 is for debugging vgoalsoc?
// Setting it results in a hang with a digit displayed on screen
// For twrldc94, it just disables sound.
@@ -993,7 +993,7 @@ static READ16_HANDLER( vbl_toggle_r )
static WRITE16_HANDLER( vbl_toggle_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
if( COUNTER1_ENABLE == 1 )
{
TICK_1 = (TICK_1 - 1) & 0xff; // 8bit
@@ -1015,42 +1015,42 @@ static WRITE16_HANDLER( vbl_toggle_w )
}
}
-static void mcu_init( running_machine *machine )
+static void mcu_init( running_machine &machine )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->dmmy_8f_ret = 0xFFFF;
state->pending_command = 0;
state->mcu_data = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_r));
}
static DRIVER_INIT( twrldc94 )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 1;
mcu_init( machine );
}
static DRIVER_INIT( twrldc94a )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 2;
mcu_init( machine );
}
static DRIVER_INIT( vgoalsoc )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 3;
mcu_init( machine );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200090, 0x200091, FUNC(vbl_toggle_w)); // vblank toggle
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200090, 0x200091, FUNC(vbl_toggle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200090, 0x200091, FUNC(vbl_toggle_w)); // vblank toggle
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200090, 0x200091, FUNC(vbl_toggle_r));
}
/*** GAME DRIVERS ************************************************************/
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 3b23986f43c..bd09932cf0f 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -171,7 +171,7 @@ static int gsword_coins_in(void)
/* (4004,4005) clear down counter , if (4004,4005)==0 then (402E)=0 */
static READ8_HANDLER( gsword_hack_r )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
UINT8 data = state->cpu2_ram[offset + 4];
/*if(offset==1)mame_printf_debug("CNT %02X%02X\n",state->cpu2_ram[5],state->cpu2_ram[4]); */
@@ -193,11 +193,11 @@ static READ8_HANDLER( gsword_8741_2_r )
switch (offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x02: /* Player 1 Controller */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04: /* Player 2 Controller */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
// default:
// logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(space->cpu));
}
@@ -210,11 +210,11 @@ static READ8_HANDLER( gsword_8741_3_r )
switch (offset)
{
case 0x01: /* start button */
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x02: /* Player 1 Controller? */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04: /* Player 2 Controller? */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
/* unknown */
// logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(space->cpu));
@@ -232,7 +232,7 @@ static const struct TAITO8741interface gsword_8741interface=
static MACHINE_RESET( gsword )
{
- gsword_state *state = machine->driver_data<gsword_state>();
+ gsword_state *state = machine.driver_data<gsword_state>();
int i;
for(i=0;i<4;i++) TAITO8741_reset(i);
@@ -252,7 +252,7 @@ static MACHINE_RESET( josvolly )
static INTERRUPT_GEN( gsword_snd_interrupt )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
if(state->nmi_enable)
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -261,7 +261,7 @@ static INTERRUPT_GEN( gsword_snd_interrupt )
static WRITE8_DEVICE_HANDLER( gsword_nmi_set_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
/* mame_printf_debug("AY write %02X\n",data);*/
state->protect_hack = (data&0x80) ? 0 : 1;
@@ -297,25 +297,25 @@ static WRITE8_DEVICE_HANDLER( gsword_nmi_set_w )
static WRITE8_DEVICE_HANDLER( gsword_AY8910_control_port_0_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
ay8910_address_w(device,offset,data);
state->fake8910_0 = data;
}
static WRITE8_DEVICE_HANDLER( gsword_AY8910_control_port_1_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
ay8910_address_w(device,offset,data);
state->fake8910_1 = data;
}
static READ8_DEVICE_HANDLER( gsword_fake_0_r )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
return state->fake8910_0+1;
}
static READ8_DEVICE_HANDLER( gsword_fake_1_r )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
return state->fake8910_1+1;
}
@@ -329,7 +329,7 @@ static WRITE8_DEVICE_HANDLER( gsword_adpcm_data_w )
static WRITE8_HANDLER( adpcm_soundcommand_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM , 8 )
@@ -909,7 +909,7 @@ ROM_END
static DRIVER_INIT( gsword )
{
#if 0
- UINT8 *ROM2 = machine->region("sub")->base();
+ UINT8 *ROM2 = machine.region("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x71e] = 0; /* patch for sound protection or time out function */
@@ -917,14 +917,14 @@ static DRIVER_INIT( gsword )
#endif
#if 1
/* hack for sound protection or time out function */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
#endif
}
static DRIVER_INIT( gsword2 )
{
#if 0
- UINT8 *ROM2 = machine->region("sub")->base();
+ UINT8 *ROM2 = machine.region("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x726] = 0; /* patch for sound protection or time out function */
@@ -932,7 +932,7 @@ static DRIVER_INIT( gsword2 )
#endif
#if 1
/* hack for sound protection or time out function */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
#endif
}
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 79f2d780b2b..e2cbb401e5c 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -249,55 +249,55 @@ public:
static WRITE32_HANDLER( paletteram32_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static void voodoo_vblank_0(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, param ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, param ? ASSERT_LINE : CLEAR_LINE);
}
static void voodoo_vblank_1(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE);
}
static READ32_HANDLER( gticlub_k001604_tile_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_tile_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_tile_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_tile_w(k001604, offset, data, mem_mask);
}
static READ32_HANDLER( gticlub_k001604_char_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_char_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_char_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_char_w(k001604, offset, data, mem_mask);
}
static READ32_HANDLER( gticlub_k001604_reg_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_reg_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_reg_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_reg_w(k001604, offset, data, mem_mask);
}
@@ -321,15 +321,15 @@ static const eeprom_interface eeprom_intf =
static READ8_HANDLER( sysreg_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- device_t *adc1038 = space->machine->device("adc1038");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc1038 = space->machine().device("adc1038");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
case 0:
case 1:
case 3:
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
case 2:
return adc1038_sars_read(adc1038) << 7;
@@ -356,8 +356,8 @@ static READ8_HANDLER( sysreg_r )
static WRITE8_HANDLER( sysreg_w )
{
- device_t *adc1038 = space->machine->device("adc1038");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc1038 = space->machine().device("adc1038");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
@@ -374,10 +374,10 @@ static WRITE8_HANDLER( sysreg_w )
case 4:
if (data & 0x80) /* CG Board 1 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
if (data & 0x40) /* CG Board 0 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
adc1038_di_write(adc1038, (data >> 0) & 1);
adc1038_clk_write(adc1038, (data >> 1) & 1);
@@ -391,13 +391,13 @@ static WRITE8_HANDLER( sysreg_w )
static MACHINE_START( gticlub )
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->work_ram);
}
static ADDRESS_MAP_START( gticlub_map, AS_PROGRAM, 32 )
@@ -436,25 +436,25 @@ ADDRESS_MAP_END
static READ32_HANDLER( dsp_dataram0_r )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
return state->sharc_dataram_0[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram0_w )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
state->sharc_dataram_0[offset] = data;
}
static READ32_HANDLER( dsp_dataram1_r )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
return state->sharc_dataram_1[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram1_w )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
state->sharc_dataram_1[offset] = data;
}
@@ -698,12 +698,12 @@ static TIMER_CALLBACK( irq_off )
cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
}
-static void sound_irq_callback( running_machine *machine, int irq )
+static void sound_irq_callback( running_machine &machine, int irq )
{
int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
}
static const k056800_interface gticlub_k056800_interface =
@@ -717,10 +717,10 @@ static int adc1038_input_callback( device_t *device, int input )
int value = 0;
switch (input)
{
- case 0: value = input_port_read(device->machine, "AN0"); break;
- case 1: value = input_port_read(device->machine, "AN1"); break;
- case 2: value = input_port_read(device->machine, "AN2"); break;
- case 3: value = input_port_read(device->machine, "AN3"); break;
+ case 0: value = input_port_read(device->machine(), "AN0"); break;
+ case 1: value = input_port_read(device->machine(), "AN1"); break;
+ case 2: value = input_port_read(device->machine(), "AN2"); break;
+ case 3: value = input_port_read(device->machine(), "AN3"); break;
case 4: value = 0x000; break;
case 5: value = 0x000; break;
case 6: value = 0x000; break;
@@ -1152,22 +1152,22 @@ ROM_END
static DRIVER_INIT(gticlub)
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB);
state->sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
- K001005_preprocess_texture_data(machine->region("gfx1")->base(), machine->region("gfx1")->bytes(), 1);
+ K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 1);
}
static DRIVER_INIT(hangplt)
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
state->sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
state->sharc_dataram_1 = auto_alloc_array(machine, UINT32, 0x100000/4);
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index f4af7c309bd..9b6cd9fff21 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -92,7 +92,7 @@ public:
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6840PTM, state);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6840PTM, state);
}
static const ptm6840_interface ptm_intf =
@@ -114,7 +114,7 @@ static const ptm6840_interface ptm_intf =
* TMS34061 CRTC
*****************/
-static void tms_interrupt(running_machine *machine, int state)
+static void tms_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INT_TMS34061, state);
}
@@ -177,7 +177,7 @@ static READ16_HANDLER( guab_tms34061_r )
/* Non-multiplexed mode */
static WRITE16_HANDLER( ef9369_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct ef9369 &pal = state->pal;
data &= 0x00ff;
@@ -207,7 +207,7 @@ static WRITE16_HANDLER( ef9369_w )
col = pal.clut[entry] & 0xfff;
/* Update the MAME palette */
- palette_set_color_rgb(space->machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
+ palette_set_color_rgb(space->machine(), entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
}
/* Address register auto-increment */
@@ -218,7 +218,7 @@ static WRITE16_HANDLER( ef9369_w )
static READ16_HANDLER( ef9369_r )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct ef9369 &pal = state->pal;
if ((offset & 1) == 0)
{
@@ -253,7 +253,7 @@ static SCREEN_UPDATE( guab )
/* If blanked, fill with black */
if (state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -267,8 +267,8 @@ static SCREEN_UPDATE( guab )
UINT8 pen = src[x >> 1];
/* Draw two 4-bit pixels */
- *dest++ = screen->machine->pens[pen >> 4];
- *dest++ = screen->machine->pens[pen & 0x0f];
+ *dest++ = screen->machine().pens[pen >> 4];
+ *dest++ = screen->machine().pens[pen & 0x0f];
}
}
@@ -310,9 +310,9 @@ enum wd1770_status
static TIMER_CALLBACK( fdc_data_callback )
{
- guab_state *state = machine->driver_data<guab_state>();
+ guab_state *state = machine.driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
- UINT8* disk = (UINT8*)machine->region("user1")->base();
+ UINT8* disk = (UINT8*)machine.region("user1")->base();
int more_data = 0;
/*
@@ -374,7 +374,7 @@ static TIMER_CALLBACK( fdc_data_callback )
static WRITE16_HANDLER( wd1770_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
data &= 0xff;
@@ -464,7 +464,7 @@ static WRITE16_HANDLER( wd1770_w )
fdc.sector));
/* Trigger a DRQ interrupt on the CPU */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, ASSERT_LINE);
fdc.status |= DATA_REQUEST;
break;
}
@@ -509,7 +509,7 @@ static WRITE16_HANDLER( wd1770_w )
fdc.data = data;
/* Clear the DRQ */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
/* Queue an event to write the data if write command was specified */
if (fdc.cmd & 0x20)
@@ -522,7 +522,7 @@ static WRITE16_HANDLER( wd1770_w )
static READ16_HANDLER( wd1770_r )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
UINT16 retval = 0;
@@ -548,7 +548,7 @@ static READ16_HANDLER( wd1770_r )
retval = fdc.data;
/* Clear the DRQ */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
fdc.status &= ~DATA_REQUEST;
break;
}
@@ -574,7 +574,7 @@ static READ16_HANDLER( io_r )
case 0x01:
case 0x02:
{
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
case 0x30:
{
@@ -594,7 +594,7 @@ static INPUT_CHANGED( coin_inserted )
if (newval == 0)
{
UINT32 credit;
- address_space *space = field->port->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = field->port->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Get the current credit value and add the new coin value */
credit = space->read_dword(0x8002c) + (UINT32)(FPTR)param;
@@ -610,7 +610,7 @@ static INPUT_CHANGED( coin_inserted )
static WRITE16_HANDLER( io_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
switch (offset)
{
@@ -646,7 +646,7 @@ static WRITE16_HANDLER( io_w )
}
case 0x30:
{
- sn76496_w(space->machine->device("snsnd"), 0, data & 0xff);
+ sn76496_w(space->machine().device("snsnd"), 0, data & 0xff);
break;
}
case 0x31:
@@ -775,13 +775,13 @@ INPUT_PORTS_END
static MACHINE_START( guab )
{
- guab_state *state = machine->driver_data<guab_state>();
- state->fdc_timer = machine->scheduler().timer_alloc(FUNC(fdc_data_callback));
+ guab_state *state = machine.driver_data<guab_state>();
+ state->fdc_timer = machine.scheduler().timer_alloc(FUNC(fdc_data_callback));
}
static MACHINE_RESET( guab )
{
- guab_state *state = machine->driver_data<guab_state>();
+ guab_state *state = machine.driver_data<guab_state>();
memset(&state->fdc, 0, sizeof(state->fdc));
}
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index 5d669189548..28f6b74fc30 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -62,31 +62,31 @@ static TIMER_CALLBACK( gunbustr_interrupt5 )
static INTERRUPT_GEN( gunbustr_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(gunbustr_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(gunbustr_interrupt5));
device_set_input_line(device, 4, HOLD_LINE);
}
static WRITE32_HANDLER( gunbustr_palette_w )
{
int a;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- a = space->machine->generic.paletteram.u32[offset] >> 16;
- palette_set_color_rgb(space->machine,offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
+ a = space->machine().generic.paletteram.u32[offset] >> 16;
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
- a = space->machine->generic.paletteram.u32[offset] &0xffff;
- palette_set_color_rgb(space->machine,offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
+ a = space->machine().generic.paletteram.u32[offset] &0xffff;
+ palette_set_color_rgb(space->machine(),offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
}
static CUSTOM_INPUT( coin_word_r )
{
- gunbustr_state *state = field->port->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = field->port->machine().driver_data<gunbustr_state>();
return state->coin_word;
}
static WRITE32_HANDLER( gunbustr_input_w )
{
- gunbustr_state *state = space->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = space->machine().driver_data<gunbustr_state>();
#if 0
{
@@ -104,12 +104,12 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31) /* $400000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -125,10 +125,10 @@ popmessage(t);
/* game does not write a separate counter for coin 2!
It should disable both coins when 9 credits reached
see code $1d8a-f6... but for some reason it's not */
- coin_lockout_w(space->machine, 0, data & 0x01000000);
- coin_lockout_w(space->machine, 1, data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x04000000);
+ coin_lockout_w(space->machine(), 0, data & 0x01000000);
+ coin_lockout_w(space->machine(), 1, data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x04000000);
state->coin_word = (data >> 16) &0xffff;
}
//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(space->cpu),offset);
@@ -176,14 +176,14 @@ static WRITE32_HANDLER( motor_control_w )
static READ32_HANDLER( gunbustr_gun_r )
{
- return ( input_port_read(space->machine, "LIGHT0_X") << 24) | (input_port_read(space->machine, "LIGHT0_Y") << 16) |
- ( input_port_read(space->machine, "LIGHT1_X") << 8) | input_port_read(space->machine, "LIGHT1_Y");
+ return ( input_port_read(space->machine(), "LIGHT0_X") << 24) | (input_port_read(space->machine(), "LIGHT0_Y") << 16) |
+ ( input_port_read(space->machine(), "LIGHT1_X") << 8) | input_port_read(space->machine(), "LIGHT1_Y");
}
static WRITE32_HANDLER( gunbustr_gun_w )
{
/* 10000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(gunbustr_interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(gunbustr_interrupt5));
}
@@ -407,7 +407,7 @@ ROM_END
static READ32_HANDLER( main_cycle_r )
{
- gunbustr_state *state = space->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = space->machine().driver_data<gunbustr_state>();
if (cpu_get_pc(space->cpu)==0x55a && (state->ram[0x3acc/4]&0xff000000)==0)
device_spin_until_interrupt(space->cpu);
@@ -417,7 +417,7 @@ static READ32_HANDLER( main_cycle_r )
static DRIVER_INIT( gunbustr )
{
/* Speedup handler */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x203acc, 0x203acf, FUNC(main_cycle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x203acc, 0x203acf, FUNC(main_cycle_r));
}
GAME( 1992, gunbustr, 0, gunbustr, gunbustr, gunbustr, ORIENTATION_FLIP_X, "Taito Corporation", "Gunbuster (Japan)", 0 )
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index 69a2ce45466..03d61d218a3 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -55,15 +55,15 @@ Runs in interrupt mode 0, the interrupt vectors are 0xcf (RST 08h) and
static INTERRUPT_GEN( yamyam_interrupt )
{
- gundealr_state *state = device->machine->driver_data<gundealr_state>();
+ gundealr_state *state = device->machine().driver_data<gundealr_state>();
if (cpu_getiloops(device) == 0)
{
if (state->input_ports_hack)
{
- state->rambase[0x004] = input_port_read(device->machine, "IN2");
- state->rambase[0x005] = input_port_read(device->machine, "IN1");
- state->rambase[0x006] = input_port_read(device->machine, "IN0");
+ state->rambase[0x004] = input_port_read(device->machine(), "IN2");
+ state->rambase[0x005] = input_port_read(device->machine(), "IN1");
+ state->rambase[0x006] = input_port_read(device->machine(), "IN0");
}
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h vblank */
}
@@ -73,12 +73,12 @@ static INTERRUPT_GEN( yamyam_interrupt )
static WRITE8_HANDLER( yamyam_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( yamyam_protection_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
logerror("e000 = %02x\n", state->rambase[0x000]);
state->rambase[0x000] = data;
if (data == 0x03) state->rambase[0x001] = 0x03;
@@ -446,8 +446,8 @@ GFXDECODE_END
static MACHINE_START( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
@@ -457,7 +457,7 @@ static MACHINE_START( gundealr )
static MACHINE_RESET( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->flipscreen = 0;
state->scroll[0] = 0;
@@ -571,15 +571,15 @@ ROM_END
static DRIVER_INIT( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->input_ports_hack = 0;
}
static DRIVER_INIT( yamyam )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->input_ports_hack = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(yamyam_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(yamyam_protection_w));
}
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index 33206bbaf7e..06dd6558b72 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -64,13 +64,13 @@ public:
static VIDEO_START( gunpey )
{
- gunpey_state *state = machine->driver_data<gunpey_state>();
+ gunpey_state *state = machine.driver_data<gunpey_state>();
state->blit_buffer = auto_alloc_array(machine, UINT16, 512*512);
}
static SCREEN_UPDATE( gunpey )
{
- gunpey_state *state = screen->machine->driver_data<gunpey_state>();
+ gunpey_state *state = screen->machine().driver_data<gunpey_state>();
UINT16 *blit_buffer = state->blit_buffer;
int x,y;
int count;
@@ -116,11 +116,11 @@ static READ8_HANDLER( gunpey_inputs_r )
{
switch(offset+0x7f40)
{
- case 0x7f40: return input_port_read(space->machine, "DSW1");
- case 0x7f41: return input_port_read(space->machine, "DSW2");
- case 0x7f42: return input_port_read(space->machine, "P1");
- case 0x7f43: return input_port_read(space->machine, "P2");
- case 0x7f44: return input_port_read(space->machine, "SYSTEM");
+ case 0x7f40: return input_port_read(space->machine(), "DSW1");
+ case 0x7f41: return input_port_read(space->machine(), "DSW2");
+ case 0x7f42: return input_port_read(space->machine(), "P1");
+ case 0x7f43: return input_port_read(space->machine(), "P2");
+ case 0x7f44: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
@@ -128,10 +128,10 @@ static READ8_HANDLER( gunpey_inputs_r )
static WRITE8_HANDLER( gunpey_blitter_w )
{
- gunpey_state *state = space->machine->driver_data<gunpey_state>();
+ gunpey_state *state = space->machine().driver_data<gunpey_state>();
UINT16 *blit_buffer = state->blit_buffer;
UINT16 *blit_ram = state->blit_ram;
- UINT8 *blit_rom = space->machine->region("blit_data")->base();
+ UINT8 *blit_rom = space->machine().region("blit_data")->base();
int x,y;
blit_ram[offset] = data;
@@ -304,7 +304,7 @@ INPUT_PORTS_END
static PALETTE_INIT( gunpey )
{
int i,r,g,b,val;
- UINT8 *blit_rom = machine->region("blit_data")->base();
+ UINT8 *blit_rom = machine.region("blit_data")->base();
for (i = 0; i < 512; i+=2)
{
@@ -382,7 +382,7 @@ ROM_END
static DRIVER_INIT( gunpey )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* patch SLOOOOW cycle checks ... */
rom[0x848b5] = 0x7e;
diff --git a/src/mame/drivers/gunsmoke.c b/src/mame/drivers/gunsmoke.c
index 7dadeda6cb7..d0078f246ee 100644
--- a/src/mame/drivers/gunsmoke.c
+++ b/src/mame/drivers/gunsmoke.c
@@ -274,8 +274,8 @@ GFXDECODE_END
static MACHINE_START( gunsmoke )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
- UINT8 *rombase = machine->region("maincpu")->base();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x4000);
@@ -287,7 +287,7 @@ static MACHINE_START( gunsmoke )
static MACHINE_RESET( gunsmoke )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
state->chon = 0;
state->objon = 0;
diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c
index d69a3c8bdc1..51079a0286a 100644
--- a/src/mame/drivers/gyruss.c
+++ b/src/mame/drivers/gyruss.c
@@ -89,7 +89,7 @@ static const int gyruss_timer[10] =
static READ8_DEVICE_HANDLER( gyruss_portA_r )
{
- gyruss_state *state = device->machine->driver_data<gyruss_state>();
+ gyruss_state *state = device->machine().driver_data<gyruss_state>();
return gyruss_timer[(state->audiocpu->total_cycles() / 1024) % 10];
}
@@ -101,7 +101,7 @@ static WRITE8_DEVICE_HANDLER( gyruss_dac_w )
static WRITE8_HANDLER( gyruss_irq_clear_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
device_set_input_line(state->audiocpu_2, 0, CLEAR_LINE);
}
@@ -132,14 +132,14 @@ static WRITE8_DEVICE_HANDLER( gyruss_filter1_w )
static WRITE8_HANDLER( gyruss_sh_irqtrigger_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
/* writing to this register triggers IRQ on the sound CPU */
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( gyruss_i8039_irq_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
device_set_input_line(state->audiocpu_2, 0, ASSERT_LINE);
}
@@ -499,10 +499,10 @@ DISCRETE_SOUND_END
static MACHINE_START( gyruss )
{
- gyruss_state *state = machine->driver_data<gyruss_state>();
+ gyruss_state *state = machine.driver_data<gyruss_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->audiocpu_2 = machine->device<cpu_device>("audio2");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->audiocpu_2 = machine.device<cpu_device>("audio2");
}
static MACHINE_CONFIG_START( gyruss, gyruss_state )
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index 6c73a54232c..105c0e133db 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -338,7 +338,7 @@ static void blit(halleys_state *state, int offset)
#if HALLEYS_DEBUG
if (0) {
- logerror("%s:[%04x]", machine->describe_context(), offset);
+ logerror("%s:[%04x]", machine.describe_context(), offset);
for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]);
logerror("\n");
}
@@ -975,7 +975,7 @@ COMMAND_MODE:
// draws Ben Bero Beh's color backdrop(verification required)
static WRITE8_HANDLER( bgtile_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int yskip, xskip, ecx;
UINT16 *edi;
UINT16 ax;
@@ -1001,7 +1001,7 @@ static WRITE8_HANDLER( bgtile_w )
static READ8_HANDLER( blitter_status_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
if (state->game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)==0x8017) return(0x55); // HACK: trick SRAM test on startup
return(0);
@@ -1010,7 +1010,7 @@ static READ8_HANDLER( blitter_status_r )
static READ8_HANDLER( blitter_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int i = offset & 0xf;
if (i==0 || i==4) return(1);
@@ -1021,14 +1021,14 @@ static READ8_HANDLER( blitter_r )
static TIMER_CALLBACK( blitter_reset )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->blitter_busy = 0;
}
static WRITE8_HANDLER( blitter_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int i = offset & 0xf;
state->blitter_ram[offset] = data;
@@ -1040,7 +1040,7 @@ static WRITE8_HANDLER( blitter_w )
if (i==0 || (i==4 && !data))
{
state->blitter_busy = 0;
- if (state->firq_level) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
+ if (state->firq_level) cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
}
else
{
@@ -1053,7 +1053,7 @@ static WRITE8_HANDLER( blitter_w )
static READ8_HANDLER( collision_id_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
/*
Collision detection abstract:
@@ -1092,7 +1092,7 @@ static READ8_HANDLER( collision_id_r )
static PALETTE_INIT( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
UINT32 d, r, g, b, i, j, count;
UINT32 *pal_ptr = state->internal_palette;
@@ -1139,7 +1139,7 @@ static PALETTE_INIT( halleys )
}
}
-static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data)
+static void halleys_decode_rgb(running_machine &machine, UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data)
{
/*
proms contain:
@@ -1153,10 +1153,10 @@ static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, U
int bit0, bit1, bit2, bit3, bit4;
// the four 16x4-bit SN74S189 SRAM chips are assumed be the game's 32-byte palette RAM
- sram_189 = machine->generic.paletteram.u8;
+ sram_189 = machine.generic.paletteram.u8;
// each of the three 32-byte 6330 PROM is wired to an RGB component output
- prom_6330 = machine->region("proms")->base();
+ prom_6330 = machine.region("proms")->base();
// latch1 holds 8 bits from the selected palette RAM address
latch1_273 = sram_189[addr];
@@ -1186,11 +1186,11 @@ static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, U
static WRITE8_HANDLER( halleys_paletteram_IIRRGGBB_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
UINT32 d, r, g, b, i, j;
UINT32 *pal_ptr = state->internal_palette;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
d = (UINT32)data;
j = d | BG_RGB;
pal_ptr[offset] = j;
@@ -1204,19 +1204,19 @@ static WRITE8_HANDLER( halleys_paletteram_IIRRGGBB_w )
g = d & 0x0c; g |= i; g = g<<4 | g;
b = d<<2 & 0x0c; b |= i; b = b<<4 | b;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_2BACK, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_ALPHA, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_COLLD, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_2BACK, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_ALPHA, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_COLLD, MAKE_RGB(r, g, b));
- halleys_decode_rgb(space->machine, &r, &g, &b, offset, 0);
- palette_set_color(space->machine, offset+0x20, MAKE_RGB(r, g, b));
+ halleys_decode_rgb(space->machine(), &r, &g, &b, offset, 0);
+ palette_set_color(space->machine(), offset+0x20, MAKE_RGB(r, g, b));
}
static VIDEO_START( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
#define HALLEYS_Y0 0x8e
#define HALLEYS_X0 0x9a
#define HALLEYS_Y1 0xa2
@@ -1423,9 +1423,9 @@ static void copy_fixed_2b(bitmap_t *bitmap, UINT16 *source)
}
-static void filter_bitmap(running_machine *machine, bitmap_t *bitmap, int mask)
+static void filter_bitmap(running_machine &machine, bitmap_t *bitmap, int mask)
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
int dst_pitch;
UINT32 *pal_ptr, *edi;
@@ -1466,7 +1466,7 @@ static void filter_bitmap(running_machine *machine, bitmap_t *bitmap, int mask)
static SCREEN_UPDATE( halleys )
{
- halleys_state *state = screen->machine->driver_data<halleys_state>();
+ halleys_state *state = screen->machine().driver_data<halleys_state>();
int i, j;
if (state->stars_enabled)
@@ -1478,7 +1478,7 @@ static SCREEN_UPDATE( halleys )
bitmap_fill(bitmap, cliprect, state->bgcolor);
#ifdef MAME_DEBUG
- if (input_port_read(screen->machine, "DEBUG")) copy_scroll_xp(bitmap, state->render_layer[3], *state->scrollx0, *state->scrolly0); // not used???
+ if (input_port_read(screen->machine(), "DEBUG")) copy_scroll_xp(bitmap, state->render_layer[3], *state->scrollx0, *state->scrolly0); // not used???
#endif
copy_scroll_xp(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1);
@@ -1488,14 +1488,14 @@ static SCREEN_UPDATE( halleys )
// HALF-HACK: apply RGB filter when the following conditions are met
i = state->io_ram[0xa0];
j = state->io_ram[0xa1];
- if (state->io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine, bitmap, i);
+ if (state->io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine(), bitmap, i);
return 0;
}
static SCREEN_UPDATE( benberob )
{
- halleys_state *state = screen->machine->driver_data<halleys_state>();
+ halleys_state *state = screen->machine().driver_data<halleys_state>();
if (state->io_ram[0xa0] & 0x80)
copy_scroll_op(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1);
else
@@ -1516,7 +1516,7 @@ static READ8_HANDLER( zero_r ) { return(0); }
static READ8_HANDLER( debug_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
return(state->io_ram[offset]);
}
@@ -1528,7 +1528,7 @@ static READ8_HANDLER( debug_r )
static INTERRUPT_GEN( halleys_interrupt )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -1555,7 +1555,7 @@ static INTERRUPT_GEN( halleys_interrupt )
state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1);
state->latch_delay = (latch_data) ? 0 : 4;
soundlatch_w( device->memory().space(AS_PROGRAM), 0, latch_data);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
// clear collision list of this frame unconditionally
@@ -1581,7 +1581,7 @@ static INTERRUPT_GEN( halleys_interrupt )
static INTERRUPT_GEN( benberob_interrupt )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -1595,7 +1595,7 @@ static INTERRUPT_GEN( benberob_interrupt )
state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1);
state->latch_delay = (latch_data) ? 0 : 4;
soundlatch_w(device->memory().space(AS_PROGRAM), 0, latch_data);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
@@ -1614,31 +1614,31 @@ static INTERRUPT_GEN( benberob_interrupt )
static READ8_HANDLER( vector_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
return(state->cpu1_base[0xffe0 + (offset^(state->mVectorType<<4))]);
}
static WRITE8_HANDLER( firq_ack_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
state->io_ram[0x9c] = data;
if (state->firq_level) state->firq_level--;
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( sndnmi_msk_w )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
state->sndnmi_mask = data & 1;
}
static WRITE8_HANDLER( soundcommand_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
if (state->ffcount < MAX_SOUNDS)
{
state->ffcount++;
@@ -1655,8 +1655,8 @@ static READ8_HANDLER( coin_lockout_r )
// 0x8599 : 'benberob'
// 0x83e2 : 'halleys', 'halleysc', 'halleycj'
// 0x83df : 'halley87'
- int inp = input_port_read(space->machine, "IN0");
- int result = ((input_port_read(space->machine, "DSW4")) & 0x20) >> 5;
+ int inp = input_port_read(space->machine(), "IN0");
+ int result = ((input_port_read(space->machine(), "DSW4")) & 0x20) >> 5;
if (inp & 0x80) result |= 0x02;
if (inp & 0x40) result |= 0x04;
@@ -1669,7 +1669,7 @@ static READ8_HANDLER( io_mirror_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
@@ -1955,7 +1955,7 @@ INPUT_PORTS_END
static MACHINE_RESET( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->mVectorType = 0;
state->firq_level = 0;
state->blitter_busy = 0;
@@ -2178,9 +2178,9 @@ ROM_END
//**************************************************************************
// Driver Initializations
-static void init_common(running_machine *machine)
+static void init_common(running_machine &machine)
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
UINT8 *buf, *rom;
int addr, i;
UINT8 al, ah, dl, dh;
@@ -2214,7 +2214,7 @@ static void init_common(running_machine *machine)
// decrypt main program ROM
- rom = state->cpu1_base = machine->region("maincpu")->base();
+ rom = state->cpu1_base = machine.region("maincpu")->base();
buf = state->gfx1_base;
for (i=0; i<0x10000; i++)
@@ -2227,7 +2227,7 @@ static void init_common(running_machine *machine)
// swap graphics ROM addresses and unpack each pixel
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
buf = state->gfx_plane02;
for (i=0xffff; i>=0; i--)
@@ -2261,18 +2261,18 @@ static void init_common(running_machine *machine)
static DRIVER_INIT( benberob )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_BENBEROB;
init_common(machine);
- state->blitter_reset_timer = machine->scheduler().timer_alloc(FUNC(blitter_reset));
+ state->blitter_reset_timer = machine.scheduler().timer_alloc(FUNC(blitter_reset));
}
static DRIVER_INIT( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_HALLEYS;
state->collision_detection = 0xb114;
@@ -2281,7 +2281,7 @@ static DRIVER_INIT( halleys )
static DRIVER_INIT( halley87 )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_HALLEYS;
state->collision_detection = 0xb10d;
diff --git a/src/mame/drivers/hanaawas.c b/src/mame/drivers/hanaawas.c
index 69466d2097b..9d4a4a759d2 100644
--- a/src/mame/drivers/hanaawas.c
+++ b/src/mame/drivers/hanaawas.c
@@ -32,20 +32,20 @@
static READ8_HANDLER( hanaawas_input_port_0_r )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
int i, ordinal = 0;
UINT16 buttons = 0;
switch (state->mux)
{
case 1: /* start buttons */
- buttons = input_port_read(space->machine, "START");
+ buttons = input_port_read(space->machine(), "START");
break;
case 2: /* player 1 buttons */
- buttons = input_port_read(space->machine, "P1");
+ buttons = input_port_read(space->machine(), "P1");
break;
case 4: /* player 2 buttons */
- buttons = input_port_read(space->machine, "P2");
+ buttons = input_port_read(space->machine(), "P2");
break;
}
@@ -61,12 +61,12 @@ static READ8_HANDLER( hanaawas_input_port_0_r )
}
}
- return (input_port_read(space->machine, "IN0") & 0xf0) | ordinal;
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ordinal;
}
static WRITE8_HANDLER( hanaawas_inputs_mux_w )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
state->mux = data;
}
@@ -186,14 +186,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( hanaawas )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
state->save_item(NAME(state->mux));
}
static MACHINE_RESET( hanaawas )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
state->mux = 0;
}
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index cd1481b5412..65668f00ae5 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -3771,9 +3771,9 @@ ROM_END
*************************************/
/* COMMON INIT: initialize the original "driver" main board */
-static void init_driver(running_machine *machine)
+static void init_driver(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* note that we're not multisync */
state->gsp_multisync = FALSE;
@@ -3781,9 +3781,9 @@ static void init_driver(running_machine *machine)
/* COMMON INIT: initialize the later "multisync" main board */
-static void init_multisync(running_machine *machine, int compact_inputs)
+static void init_multisync(running_machine &machine, int compact_inputs)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* note that we're multisync */
state->gsp_multisync = TRUE;
@@ -3799,9 +3799,9 @@ static void init_multisync(running_machine *machine, int compact_inputs)
/* COMMON INIT: initialize the ADSP/ADSP2 board */
-static void init_adsp(running_machine *machine)
+static void init_adsp(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ADSP program RAM */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_adsp_program_r), FUNC(hd68k_adsp_program_w));
@@ -3820,9 +3820,9 @@ static void init_adsp(running_machine *machine)
/* COMMON INIT: initialize the DS3 board */
-static void init_ds3(running_machine *machine)
+static void init_ds3(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ADSP program RAM */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_ds3_program_r), FUNC(hd68k_ds3_program_w));
@@ -3918,10 +3918,10 @@ static void init_ds3(running_machine *machine)
/* COMMON INIT: initialize the DSK add-on board */
-static void init_dsk(running_machine *machine)
+static void init_dsk(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- UINT8 *usr3 = machine->region("user3")->base();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ UINT8 *usr3 = machine.region("user3")->base();
/* install ASIC61 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
@@ -3952,10 +3952,10 @@ static void init_dsk(running_machine *machine)
/* COMMON INIT: initialize the DSK II add-on board */
-static void init_dsk2(running_machine *machine)
+static void init_dsk2(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- UINT8 *usr3 = machine->region("user3")->base();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ UINT8 *usr3 = machine.region("user3")->base();
/* install ASIC65 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
@@ -3982,9 +3982,9 @@ static void init_dsk2(running_machine *machine)
/* COMMON INIT: initialize the DSPCOM add-on board */
-static void init_dspcom(running_machine *machine)
+static void init_dspcom(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ASIC65 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w));
@@ -4000,9 +4000,9 @@ static void init_dspcom(running_machine *machine)
/* COMMON INIT: initialize the original "driver" sound board */
-static void init_driver_sound(running_machine *machine)
+static void init_driver_sound(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
hdsnd_init(machine);
@@ -4023,7 +4023,7 @@ static void init_driver_sound(running_machine *machine)
static DRIVER_INIT( harddriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_driver(machine);
@@ -4048,7 +4048,7 @@ static DRIVER_INIT( harddriv )
static DRIVER_INIT( harddrivc )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4073,7 +4073,7 @@ static DRIVER_INIT( harddrivc )
static DRIVER_INIT( stunrun )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 0);
@@ -4093,7 +4093,7 @@ static DRIVER_INIT( stunrun )
static DRIVER_INIT( racedriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_driver(machine);
@@ -4114,9 +4114,9 @@ static DRIVER_INIT( racedriv )
}
-static void racedrivc_init_common(running_machine *machine, offs_t gsp_protection)
+static void racedrivc_init_common(running_machine &machine, offs_t gsp_protection)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4156,9 +4156,9 @@ static READ16_HANDLER( steeltal_dummy_r )
}
-static void steeltal_init_common(running_machine *machine, offs_t ds3_transfer_pc, int proto_sloop)
+static void steeltal_init_common(running_machine &machine, offs_t ds3_transfer_pc, int proto_sloop)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 0);
@@ -4207,7 +4207,7 @@ static DRIVER_INIT( steeltalp ) { steeltal_init_common(machine, 0x52290, 1); }
static DRIVER_INIT( strtdriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4238,7 +4238,7 @@ static DRIVER_INIT( strtdriv )
static DRIVER_INIT( hdrivair )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4265,7 +4265,7 @@ static DRIVER_INIT( hdrivair )
static DRIVER_INIT( hdrivairp )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c
index 4231cd20f34..beb3e7ee9ac 100644
--- a/src/mame/drivers/hcastle.c
+++ b/src/mame/drivers/hcastle.c
@@ -19,19 +19,19 @@
static WRITE8_HANDLER( hcastle_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( hcastle_soundirq_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static WRITE8_HANDLER( hcastle_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
@@ -156,7 +156,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
-// hcastle_state *state = device->machine->driver_data<hcastle_state>();
+// hcastle_state *state = device->machine().driver_data<hcastle_state>();
// cputag_set_input_line(state->audiocpu, 0, linestate);
}
@@ -178,14 +178,14 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( hcastle )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
state->save_item(NAME(state->pf2_bankbase));
state->save_item(NAME(state->pf1_bankbase));
@@ -196,7 +196,7 @@ static MACHINE_START( hcastle )
static MACHINE_RESET( hcastle )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
state->pf2_bankbase = 0;
state->pf1_bankbase = 0;
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index bd5f0df1b3e..b73b1680d2c 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -92,11 +92,11 @@ static WRITE8_HANDLER( coincntr_w )
//logerror("%04x: coincntr_w %02x\n",cpu_get_pc(space->cpu),data);
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bit 5 = flip screen */
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
/* other bit unknown */
if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data);
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 6821027f8f3..557f7178bb1 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -112,7 +112,7 @@ static VIDEO_START(tourvisn)
static SCREEN_UPDATE(tourvisn)
{
- highvdeo_state *state = screen->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = screen->machine().driver_data<highvdeo_state>();
int x,y,count;
count = (0/2);
@@ -126,12 +126,12 @@ static SCREEN_UPDATE(tourvisn)
color = ((state->blit_ram[count]) & 0x00ff)>>0;
if((x*2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color];
color = ((state->blit_ram[count]) & 0xff00)>>8;
if(((x*2)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color];
count++;
}
@@ -143,7 +143,7 @@ static SCREEN_UPDATE(tourvisn)
/*Later HW, RGB565 instead of RAM-based pens (+ ramdac).*/
static SCREEN_UPDATE(brasil)
{
- highvdeo_state *state = screen->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = screen->machine().driver_data<highvdeo_state>();
int x,y,count;
count = (0/2);
@@ -176,22 +176,22 @@ static SCREEN_UPDATE(brasil)
static READ16_HANDLER( read1_r )
{
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static READ16_HANDLER( read2_r )
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
static READ16_HANDLER( read3_r )
{
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static WRITE16_HANDLER( tv_vcf_paletteram_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
switch(offset*2)
{
case 0:
@@ -213,7 +213,7 @@ static WRITE16_HANDLER( tv_vcf_paletteram_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -226,12 +226,12 @@ static WRITE16_HANDLER( tv_vcf_paletteram_w )
static WRITE16_HANDLER( tv_vcf_bankselect_w )
{
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
/* bits 0, 1 select the ROM bank */
bankaddress = (data & 0x03) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
@@ -295,7 +295,7 @@ static READ16_HANDLER( tv_ncf_read2_r )
// machine resets itself.
resetpulse ^= 0x40;
- return (input_port_read(space->machine, "IN1") & 0xbf) | resetpulse;
+ return (input_port_read(space->machine(), "IN1") & 0xbf) | resetpulse;
}
static WRITE16_DEVICE_HANDLER( tv_ncf_oki6395_w )
@@ -329,25 +329,25 @@ static WRITE16_HANDLER( tv_tcf_paletteram_w )
{
int r, g, b, color;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- color = space->machine->generic.paletteram.u16[offset];
+ color = space->machine().generic.paletteram.u16[offset];
r = (color >> 8) & 0xf8;
g = (color >> 3) & 0xf8;
b = (color << 3) & 0xf8;
- palette_set_color_rgb(space->machine, offset, r, g, b);
+ palette_set_color_rgb(space->machine(), offset, r, g, b);
}
static WRITE16_HANDLER( tv_tcf_bankselect_w )
{
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
/* bits 0, 1, 2 select the ROM bank */
bankaddress = (data & 0x07) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
static ADDRESS_MAP_START( tv_tcf_map, AS_PROGRAM, 16 )
@@ -386,13 +386,13 @@ static READ16_HANDLER( newmcard_status_r )
static READ16_HANDLER( newmcard_vblank_r )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
return state->vblank_bit; //0x80
}
static WRITE16_HANDLER( newmcard_vblank_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
state->vblank_bit = data;
}
@@ -404,8 +404,8 @@ static WRITE16_HANDLER( write2_w )
for(i=0;i<4;i++)
{
- coin_counter_w(space->machine, i,data & 0x20);
- coin_lockout_w(space->machine, i,~data & 0x08);
+ coin_counter_w(space->machine(), i,data & 0x20);
+ coin_lockout_w(space->machine(), i,~data & 0x08);
}
}
@@ -440,7 +440,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( brasil_status_r )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
static UINT16 resetpulse;
switch(offset*2)
@@ -460,9 +460,9 @@ static READ16_HANDLER( brasil_status_r )
/*bankaddress might be incorrect.*/
static WRITE16_HANDLER( brasil_status_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
switch(data & 3) //data & 7?
{
@@ -473,7 +473,7 @@ static WRITE16_HANDLER( brasil_status_w )
bankaddress = (data & 0x07) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
// popmessage("%04x",data);
}
@@ -1159,7 +1159,7 @@ static READ16_HANDLER( ciclone_status_r )
static DRIVER_INIT( ciclone )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0030, 0x0033, FUNC(ciclone_status_r) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0030, 0x0033, FUNC(ciclone_status_r) );
}
/*
@@ -1222,14 +1222,14 @@ static WRITE16_HANDLER( fashion_output_w )
for(i=0;i<4;i++)
{
- coin_counter_w(space->machine, i,data & 0x20);
- coin_lockout_w(space->machine, i,~data & 0x01);
+ coin_counter_w(space->machine(), i,data & 0x20);
+ coin_lockout_w(space->machine(), i,~data & 0x01);
}
}
static DRIVER_INIT( fashion )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0002, 0x0003, FUNC(fashion_output_w) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0002, 0x0003, FUNC(fashion_output_w) );
}
GAMEL( 2000, tour4000, 0, tv_vcf, tv_vcf, 0, ROT0, "High Video", "Tour 4000", 0, layout_fashion )
diff --git a/src/mame/drivers/himesiki.c b/src/mame/drivers/himesiki.c
index 3a4ae0432f2..f164227b867 100644
--- a/src/mame/drivers/himesiki.c
+++ b/src/mame/drivers/himesiki.c
@@ -91,7 +91,7 @@ A 12.000MHz
static WRITE8_HANDLER( himesiki_rombank_w )
{
- memory_set_bank(space->machine, "bank1", ((data & 0x08) >> 3));
+ memory_set_bank(space->machine(), "bank1", ((data & 0x08) >> 3));
if (data & 0xf7)
logerror("p06_w %02x\n", data);
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( himesiki_rombank_w )
static WRITE8_HANDLER( himesiki_sound_w )
{
- himesiki_state *state = space->machine->driver_data<himesiki_state>();
+ himesiki_state *state = space->machine().driver_data<himesiki_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->subcpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -269,12 +269,12 @@ GFXDECODE_END
static MACHINE_START( himesiki )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->scrollx));
state->save_item(NAME(state->flipscreen));
@@ -282,7 +282,7 @@ static MACHINE_START( himesiki )
static MACHINE_RESET( himesiki )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
state->scrollx[0] = 0;
state->scrollx[1] = 0;
diff --git a/src/mame/drivers/hitme.c b/src/mame/drivers/hitme.c
index 823f71847c6..72422aabaaf 100644
--- a/src/mame/drivers/hitme.c
+++ b/src/mame/drivers/hitme.c
@@ -30,7 +30,7 @@
static TILE_GET_INFO( get_hitme_tile_info )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
/* the code is the low 6 bits */
UINT8 code = state->videoram[tile_index] & 0x3f;
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_hitme_tile_info )
static WRITE8_HANDLER( hitme_vidram_w )
{
- hitme_state *state = space->machine->driver_data<hitme_state>();
+ hitme_state *state = space->machine().driver_data<hitme_state>();
/* mark this tile dirty */
state->videoram[offset] = data;
@@ -57,23 +57,23 @@ static WRITE8_HANDLER( hitme_vidram_w )
static VIDEO_START( hitme )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->tilemap = tilemap_create(machine, get_hitme_tile_info, tilemap_scan_rows, 8, 10, 40, 19);
}
static VIDEO_START( barricad )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->tilemap = tilemap_create(machine, get_hitme_tile_info, tilemap_scan_rows, 8, 8, 32, 24);
}
static SCREEN_UPDATE( hitme )
{
- hitme_state *state = screen->machine->driver_data<hitme_state>();
+ hitme_state *state = screen->machine().driver_data<hitme_state>();
/* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
- double width_resist = input_port_read(screen->machine, "WIDTH") * 25000 / 100;
+ double width_resist = input_port_read(screen->machine(), "WIDTH") * 25000 / 100;
/* this triggers a oneshot for the following length of time */
double width_duration = 0.45 * 1000e-12 * width_resist;
/* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */
@@ -119,7 +119,7 @@ static SCREEN_UPDATE( hitme )
static SCREEN_UPDATE( barricad )
{
- hitme_state *state = screen->machine->driver_data<hitme_state>();
+ hitme_state *state = screen->machine().driver_data<hitme_state>();
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
}
@@ -132,22 +132,22 @@ static SCREEN_UPDATE( barricad )
*
*************************************/
-static UINT8 read_port_and_t0( running_machine *machine, int port )
+static UINT8 read_port_and_t0( running_machine &machine, int port )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
UINT8 val = input_port_read(machine, portnames[port]);
- if (machine->time() > state->timeout_time)
+ if (machine.time() > state->timeout_time)
val ^= 0x80;
return val;
}
-static UINT8 read_port_and_t0_and_hblank( running_machine *machine, int port )
+static UINT8 read_port_and_t0_and_hblank( running_machine &machine, int port )
{
UINT8 val = read_port_and_t0(machine, port);
- if (machine->primary_screen->hpos() < (machine->primary_screen->width() * 9 / 10))
+ if (machine.primary_screen->hpos() < (machine.primary_screen->width() * 9 / 10))
val ^= 0x04;
return val;
}
@@ -155,25 +155,25 @@ static UINT8 read_port_and_t0_and_hblank( running_machine *machine, int port )
static READ8_HANDLER( hitme_port_0_r )
{
- return read_port_and_t0_and_hblank(space->machine, 0);
+ return read_port_and_t0_and_hblank(space->machine(), 0);
}
static READ8_HANDLER( hitme_port_1_r )
{
- return read_port_and_t0(space->machine, 1);
+ return read_port_and_t0(space->machine(), 1);
}
static READ8_HANDLER( hitme_port_2_r )
{
- return read_port_and_t0_and_hblank(space->machine, 2);
+ return read_port_and_t0_and_hblank(space->machine(), 2);
}
static READ8_HANDLER( hitme_port_3_r )
{
- return read_port_and_t0(space->machine, 3);
+ return read_port_and_t0(space->machine(), 3);
}
@@ -192,11 +192,11 @@ static WRITE8_DEVICE_HANDLER( output_port_0_w )
In fact, it is very important that our timing calculation timeout AFTER the sound
system's equivalent computation, or else we will hang notes.
*/
- hitme_state *state = device->machine->driver_data<hitme_state>();
- UINT8 raw_game_speed = input_port_read(device->machine, "R3");
+ hitme_state *state = device->machine().driver_data<hitme_state>();
+ UINT8 raw_game_speed = input_port_read(device->machine(), "R3");
double resistance = raw_game_speed * 25000 / 100;
attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
- state->timeout_time = device->machine->time() + duration;
+ state->timeout_time = device->machine().time() + duration;
discrete_sound_w(device, HITME_DOWNCOUNT_VAL, data);
discrete_sound_w(device, HITME_OUT0, 1);
@@ -311,7 +311,7 @@ static MACHINE_START( hitme )
static MACHINE_RESET( hitme )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->timeout_time = attotime::zero;
}
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index 7e13a3ccae6..e9494c52b69 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -69,7 +69,7 @@ public:
static VIDEO_START(hitpoker)
{
- hitpoker_state *state = machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = machine.driver_data<hitpoker_state>();
state->videoram = auto_alloc_array(machine, UINT8, 0x35ff);
state->paletteram = auto_alloc_array(machine, UINT8, 0x1000);
state->colorram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -77,7 +77,7 @@ static VIDEO_START(hitpoker)
static SCREEN_UPDATE(hitpoker)
{
- hitpoker_state *state = screen->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = screen->machine().driver_data<hitpoker_state>();
int count = 0;
int y,x;
@@ -93,7 +93,7 @@ static SCREEN_UPDATE(hitpoker)
gfx_bpp = (state->colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp
color = gfx_bpp ? ((state->colorram[count] & 0x70)>>4) : (state->colorram[count] & 0xf);
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
count+=2;
}
@@ -104,8 +104,8 @@ static SCREEN_UPDATE(hitpoker)
static READ8_HANDLER( hitpoker_vram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->videoram[offset];
@@ -115,8 +115,8 @@ static READ8_HANDLER( hitpoker_vram_r )
static WRITE8_HANDLER( hitpoker_vram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
-// UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+// UINT8 *ROM = space->machine().region("maincpu")->base();
// if(state->sys_regs[0x00] & 0x10)
state->videoram[offset] = data;
@@ -124,8 +124,8 @@ static WRITE8_HANDLER( hitpoker_vram_w )
static READ8_HANDLER( hitpoker_cram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->colorram[offset];
@@ -135,14 +135,14 @@ static READ8_HANDLER( hitpoker_cram_r )
static WRITE8_HANDLER( hitpoker_cram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
state->colorram[offset] = data;
}
static READ8_HANDLER( hitpoker_paletteram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->paletteram[offset];
@@ -152,7 +152,7 @@ static READ8_HANDLER( hitpoker_paletteram_r )
static WRITE8_HANDLER( hitpoker_paletteram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
int r,g,b,datax;
state->paletteram[offset] = data;
offset>>=1;
@@ -163,7 +163,7 @@ static WRITE8_HANDLER( hitpoker_paletteram_w )
g = ((datax)&0x07e0)>>5;
r = ((datax)&0x001f)>>0;
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal6bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal6bit(g), pal5bit(b));
}
static READ8_HANDLER( rtc_r )
@@ -175,7 +175,7 @@ static READ8_HANDLER( rtc_r )
/* tests 0x180, what EEPROM is this one??? */
static WRITE8_HANDLER( eeprom_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
if(offset == 0)
{
state->eeprom_index = (state->eeprom_index & 0x100)|(data & 0xff);
@@ -191,7 +191,7 @@ static WRITE8_HANDLER( eeprom_w )
static READ8_HANDLER( eeprom_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
state->tmp = state->eeprom_data[state->eeprom_index];
if((state->eeprom_index & 0x1f) == 0x1f)
state->tmp = 0xaa;
@@ -203,7 +203,7 @@ static READ8_HANDLER( eeprom_r )
static READ8_HANDLER( hitpoker_pic_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
// logerror("R\n");
if(offset == 0)
@@ -222,7 +222,7 @@ static READ8_HANDLER( hitpoker_pic_r )
static WRITE8_HANDLER( hitpoker_pic_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
if(offset == 0)
state->pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00;
// logerror("%02x W\n",data);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( hitpoker_pic_w )
#if 0
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -514,7 +514,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(hitpoker)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x1220] = 0x01; //patch eeprom write?
ROM[0x1221] = 0x01;
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index fff94e6a0cf..ad5f4b024f7 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -42,7 +42,7 @@ TODO:
static READ8_HANDLER( keyboard_0_r )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
int res = 0x3f;
int i;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
@@ -50,7 +50,7 @@ static READ8_HANDLER( keyboard_0_r )
for (i = 0; i < 5; i++)
{
if (~state->keyb & (1 << i))
- res &= input_port_read(space->machine, keynames[i]);
+ res &= input_port_read(space->machine(), keynames[i]);
}
return res;
@@ -64,7 +64,7 @@ static READ8_HANDLER( keyboard_1_r )
static WRITE8_HANDLER( keyboard_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
state->keyb = data;
}
@@ -503,7 +503,7 @@ INPUT_PORTS_END
static void irqhandler(device_t *device, int irq)
{
popmessage("irq");
-// cputag_set_input_line(device->machine, "maincpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+// cputag_set_input_line(device->machine(), "maincpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -530,7 +530,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( hnayayoi )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
state->save_item(NAME(state->palbank));
state->save_item(NAME(state->blit_layer));
@@ -541,10 +541,10 @@ static MACHINE_START( hnayayoi )
static MACHINE_RESET( hnayayoi )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
/* start with the MSM5205 reset */
- msm5205_reset_w(machine->device("msm"), 1);
+ msm5205_reset_w(machine.device("msm"), 1);
state->palbank = 0;
state->blit_layer = 0;
@@ -677,8 +677,8 @@ ROM_END
static DRIVER_INIT( hnfubuki )
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i, j;
/* interestingly, the blitter data has a slight encryption */
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 7ef5640035a..c06ad119e40 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -459,13 +459,13 @@ WRITE32_HANDLER( trap_write )
static READ32_HANDLER( hng64_random_read )
{
- return space->machine->rand()&0xffffffff;
+ return space->machine().rand()&0xffffffff;
}
#endif
static READ32_HANDLER( hng64_com_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("com read (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(space->cpu), (offset*4)+0xc0000000, mem_mask, state->com_ram[offset]);
return state->com_ram[offset];
@@ -473,7 +473,7 @@ static READ32_HANDLER( hng64_com_r )
static WRITE32_HANDLER( hng64_com_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("com write (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(space->cpu), (offset*4)+0xc0000000, mem_mask, data);
COMBINE_DATA(&state->com_ram[offset]);
@@ -481,7 +481,7 @@ static WRITE32_HANDLER( hng64_com_w )
static WRITE32_HANDLER( hng64_com_share_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("commw (PC=%08x): %08x %08x %08x\n", cpu_get_pc(space->cpu), data, (offset*4)+0xc0001000, mem_mask);
@@ -504,7 +504,7 @@ static READ32_HANDLER( hng64_com_share_r )
static WRITE32_HANDLER( hng64_pal_w )
{
- UINT32 *paletteram = space->machine->generic.paletteram.u32;
+ UINT32 *paletteram = space->machine().generic.paletteram.u32;
int r, g, b/*, a*/;
COMBINE_DATA(&paletteram[offset]);
@@ -513,15 +513,15 @@ static WRITE32_HANDLER( hng64_pal_w )
g = ((paletteram[offset] & 0x0000ff00) >>8);
r = ((paletteram[offset] & 0x00ff0000) >>16);
//a = ((paletteram[offset] & 0xff000000) >>24);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( hng64_sysregs_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
#if 0
if((offset*4) != 0x1084)
@@ -530,7 +530,7 @@ static READ32_HANDLER( hng64_sysregs_r )
switch(offset*4)
{
- case 0x001c: return space->machine->rand(); // hng64 hangs on start-up if zero.
+ case 0x001c: return space->machine().rand(); // hng64 hangs on start-up if zero.
//case 0x106c:
//case 0x107c:
case 0x1084: return 0x00000002; //MCU->MIPS latch port
@@ -559,14 +559,14 @@ static READ32_HANDLER( hng64_sysregs_r )
// printf("%08x\n",offset*4);
-// return space->machine->rand()&0xffffffff;
+// return space->machine().rand()&0xffffffff;
return state->sysregs[offset];
}
/* preliminary dma code, dma is used to copy program code -> ram */
static void hng64_do_dma(address_space *space)
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("Performing DMA Start %08x Len %08x Dst %08x\n", state->dma_start, state->dma_len, state->dma_dst);
@@ -596,7 +596,7 @@ static void hng64_do_dma(address_space *space)
static WRITE32_HANDLER( hng64_sysregs_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
COMBINE_DATA (&state->sysregs[offset]);
@@ -632,13 +632,13 @@ static WRITE32_HANDLER( hng64_sysregs_w )
/* Fatal Fury Wild Ambition / Buriki One */
static READ32_HANDLER( fight_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
case 0x000: return 0x00000400;
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -648,7 +648,7 @@ static READ32_HANDLER( fight_io_r )
/* Samurai Shodown 64 / Samurai Shodown 64 2 */
static READ32_HANDLER( samsho_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -667,8 +667,8 @@ static READ32_HANDLER( samsho_io_r )
else
return 0x000;
}
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -679,7 +679,7 @@ static READ32_HANDLER( samsho_io_r )
/* FIXME: trigger input doesn't work? */
static READ32_HANDLER( shoot_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -696,26 +696,26 @@ static READ32_HANDLER( shoot_io_r )
case 0x010:
{
/* Quick kludge for use the input test items */
- if(input_port_read(space->machine, "D_IN") & 0x01000000)
- state->p1_trig = space->machine->rand() & 0x01000000;
+ if(input_port_read(space->machine(), "D_IN") & 0x01000000)
+ state->p1_trig = space->machine().rand() & 0x01000000;
- return (input_port_read(space->machine, "D_IN") & ~0x01000000) | (state->p1_trig);
+ return (input_port_read(space->machine(), "D_IN") & ~0x01000000) | (state->p1_trig);
}
case 0x018:
{
UINT8 p1_x, p1_y, p2_x, p2_y;
- p1_x = input_port_read(space->machine, "LIGHT_P1_X") & 0xff;
- p1_y = input_port_read(space->machine, "LIGHT_P1_Y") & 0xff;
- p2_x = input_port_read(space->machine, "LIGHT_P2_X") & 0xff;
- p2_y = input_port_read(space->machine, "LIGHT_P2_Y") & 0xff;
+ p1_x = input_port_read(space->machine(), "LIGHT_P1_X") & 0xff;
+ p1_y = input_port_read(space->machine(), "LIGHT_P1_Y") & 0xff;
+ p2_x = input_port_read(space->machine(), "LIGHT_P2_X") & 0xff;
+ p2_y = input_port_read(space->machine(), "LIGHT_P2_Y") & 0xff;
return p1_x<<24 | p1_y<<16 | p2_x<<8 | p2_y;
}
case 0x01c:
{
UINT8 p3_x, p3_y;
- p3_x = input_port_read(space->machine, "LIGHT_P3_X") & 0xff;
- p3_y = input_port_read(space->machine, "LIGHT_P3_Y") & 0xff;
+ p3_x = input_port_read(space->machine(), "LIGHT_P3_X") & 0xff;
+ p3_y = input_port_read(space->machine(), "LIGHT_P3_Y") & 0xff;
return p3_x<<24 | p3_y<<16 | p3_x<<8 | p3_y; //FIXME: see what's the right bank here when the trigger works
}
@@ -728,7 +728,7 @@ static READ32_HANDLER( shoot_io_r )
/* Roads Edge / Xtreme Rally */
static READ32_HANDLER( racing_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -742,8 +742,8 @@ static READ32_HANDLER( racing_io_r )
else
return 0x000;
}
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -752,7 +752,7 @@ static READ32_HANDLER( racing_io_r )
static READ32_HANDLER( hng64_dualport_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu));
@@ -791,7 +791,7 @@ Beast Busters 2 outputs (all at offset == 0x1c):
static WRITE32_HANDLER( hng64_dualport_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu));
COMBINE_DATA (&state->dualport[offset]);
@@ -806,7 +806,7 @@ static WRITE32_HANDLER( hng64_dualport_w )
// <ElSemi> 30140000-3015ffff is ZBuffer A
static READ32_HANDLER( hng64_3d_1_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return state->_3d_1[offset];
}
@@ -820,14 +820,14 @@ WRITE32_HANDLER( hng64_3d_1_w )
static READ32_HANDLER( hng64_3d_2_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return state->_3d_2[offset];
}
static WRITE32_HANDLER( hng64_3d_2_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
COMBINE_DATA (&state->_3d_1[offset]);
COMBINE_DATA (&state->_3d_2[offset]);
@@ -836,7 +836,7 @@ static WRITE32_HANDLER( hng64_3d_2_w )
// The 3d 'display list'
static WRITE32_HANDLER( dl_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 *hng64_dl = state->dl;
int i;
UINT16 packet3d[16];
@@ -863,7 +863,7 @@ static WRITE32_HANDLER( dl_w )
}
// Send it off to the 3d subsystem.
- hng64_command3d(space->machine, packet3d);
+ hng64_command3d(space->machine(), packet3d);
}
}
@@ -904,7 +904,7 @@ WRITE32_HANDLER( activate_3d_buffer )
// Transition Control memory.
static WRITE32_HANDLER( tcram_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 *hng64_tcram = state->tcram;
COMBINE_DATA (&hng64_tcram[offset]);
@@ -912,7 +912,7 @@ static WRITE32_HANDLER( tcram_w )
if(offset == 0x02)
{
UINT16 min_x, min_y, max_x, max_y;
- rectangle visarea = space->machine->primary_screen->visible_area();
+ rectangle visarea = space->machine().primary_screen->visible_area();
min_x = (hng64_tcram[1] & 0xffff0000) >> 16;
min_y = (hng64_tcram[1] & 0x0000ffff) >> 0;
@@ -931,17 +931,17 @@ static WRITE32_HANDLER( tcram_w )
visarea.max_x = min_x + max_x - 1;
visarea.min_y = min_y;
visarea.max_y = min_y + max_y - 1;
- space->machine->primary_screen->configure(0x200, 0x1c0, visarea, space->machine->primary_screen->frame_period().attoseconds );
+ space->machine().primary_screen->configure(0x200, 0x1c0, visarea, space->machine().primary_screen->frame_period().attoseconds );
}
}
static READ32_HANDLER( tcram_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("Q1 R : %.8x %.8x\n", offset, hng64_tcram[offset]);
if(offset == 0x12)
- return input_port_read(space->machine, "VBLANK");
+ return input_port_read(space->machine(), "VBLANK");
return state->tcram[offset];
}
@@ -950,7 +950,7 @@ static READ32_HANDLER( tcram_r )
unknown purpose (vblank? related to the display list?). */
static READ32_HANDLER( unk_vreg_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return ++state->unk_vreg_toggle;
}
@@ -958,7 +958,7 @@ static READ32_HANDLER( unk_vreg_r )
static WRITE32_HANDLER( hng64_soundram_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 mem_mask32 = mem_mask;
UINT32 data32 = data;
@@ -978,7 +978,7 @@ static WRITE32_HANDLER( hng64_soundram_w )
static READ32_HANDLER( hng64_soundram_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT16 datalo = state->soundram[offset * 2 + 0];
UINT16 datahi = state->soundram[offset * 2 + 1];
@@ -1186,7 +1186,7 @@ static void KL5C80_init(hng64_state *state)
static READ8_HANDLER( hng64_comm_memory_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 physical_address = KL5C80_translate_address(state, offset);
logerror("READING 0x%02x from 0x%04x (0x%05x)\n", state->com_virtual_mem[physical_address], offset, physical_address);
@@ -1210,7 +1210,7 @@ static WRITE8_HANDLER( hng64_comm_memory_w )
/* KL5C80 I/O handlers */
static WRITE8_HANDLER( hng64_comm_io_mmu )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
state->com_mmu_mem[offset] = data;
@@ -1517,7 +1517,7 @@ static GFXDECODE_START( hng64 )
GFXDECODE_ENTRY( "textures", 0, hng64_texlayout, 0x0, 0x10 ) /* textures */
GFXDECODE_END
-static void hng64_reorder(running_machine *machine, UINT8* gfxregion, size_t gfxregionsize)
+static void hng64_reorder(running_machine &machine, UINT8* gfxregion, size_t gfxregionsize)
{
// by default 2 4bpp tiles are stored in each 8bpp tile, this makes decoding in MAME harder than it needs to be
// reorder them
@@ -1540,14 +1540,14 @@ static void hng64_reorder(running_machine *machine, UINT8* gfxregion, size_t gfx
static DRIVER_INIT( hng64_reorder_gfx )
{
- hng64_reorder(machine, machine->region("scrtile")->base(), machine->region("scrtile")->bytes());
+ hng64_reorder(machine, machine.region("scrtile")->base(), machine.region("scrtile")->bytes());
}
#define HACK_REGION
#ifdef HACK_REGION
-static void hng64_patch_bios_region(running_machine* machine, int region)
+static void hng64_patch_bios_region(running_machine& machine, int region)
{
- UINT8 *rom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("user1")->base();
if ((rom[0x4000]==0xff) && (rom[0x4001] == 0xff))
{
@@ -1561,7 +1561,7 @@ static void hng64_patch_bios_region(running_machine* machine, int region)
static DRIVER_INIT( hng64 )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
// region hacking, english error messages are more useful to us, but no english bios is dumped...
#ifdef HACK_REGION
@@ -1583,7 +1583,7 @@ static DRIVER_INIT( hng64 )
static DRIVER_INIT(hng64_fght)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->no_machine_error_code = 0x01000000;
DRIVER_INIT_CALL(hng64);
@@ -1591,16 +1591,16 @@ static DRIVER_INIT(hng64_fght)
static DRIVER_INIT( fatfurwa )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
- /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine->region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
+ /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine.region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
DRIVER_INIT_CALL(hng64_fght);
state->mcu_type = FIGHT_MCU;
}
static DRIVER_INIT( ss64 )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
DRIVER_INIT_CALL(hng64_fght);
state->mcu_type = SAMSHO_MCU;
@@ -1608,7 +1608,7 @@ static DRIVER_INIT( ss64 )
static DRIVER_INIT(hng64_race)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->no_machine_error_code = 0x02000000;
state->mcu_type = RACING_MCU;
@@ -1617,7 +1617,7 @@ static DRIVER_INIT(hng64_race)
static DRIVER_INIT(hng64_shoot)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->mcu_type = SHOOT_MCU;
state->no_machine_error_code = 0x03000000;
@@ -1639,7 +1639,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( irq_start )
{
- hng64_state *state = device->machine->driver_data<hng64_state>();
+ hng64_state *state = device->machine().driver_data<hng64_state>();
logerror("HNG64 interrupt level %x\n", cpu_getiloops(device));
@@ -1661,29 +1661,29 @@ static INTERRUPT_GEN( irq_start )
}
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
}
static MACHINE_START(hyperneo)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
/* set the fastest DRC options */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x00ffffff, FALSE, state->mainram);
- mips3drc_add_fastram(machine->device("maincpu"), 0x04000000, 0x05ffffff, TRUE, state->cart);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x00ffffff, FALSE, state->mainram);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x04000000, 0x05ffffff, TRUE, state->cart);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
}
static MACHINE_RESET(hyperneo)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
int i;
- const UINT8 *rom = machine->region("user2")->base();
+ const UINT8 *rom = machine.region("user2")->base();
/* Sound CPU */
UINT8 *RAM = (UINT8*)state->soundram;
@@ -1701,8 +1701,8 @@ static MACHINE_RESET(hyperneo)
KL5C80_virtual_mem_sync(state);
- address_space *space = machine->device<z80_device>("comm")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(KL5C80_direct_handler, *machine));
+ address_space *space = machine.device<z80_device>("comm")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(KL5C80_direct_handler, machine));
cputag_set_input_line(machine, "comm", INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip
// cputag_set_input_line(machine, "comm", INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner...
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 7e3ebcd877e..1e1a6a56f88 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -226,7 +226,7 @@ Custom: GX61A01
static INTERRUPT_GEN( homedata_irq )
{
- homedata_state *state = device->machine->driver_data<homedata_state>();
+ homedata_state *state = device->machine().driver_data<homedata_state>();
state->vblank = 1;
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
@@ -247,7 +247,7 @@ static INTERRUPT_GEN( upd7807_irq )
static READ8_HANDLER( mrokumei_keyboard_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
int res = 0x3f,i;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
@@ -258,7 +258,7 @@ static READ8_HANDLER( mrokumei_keyboard_r )
{
if (state->keyb & (1 << i))
{
- res = input_port_read(space->machine, keynames[i]) & 0x3f;
+ res = input_port_read(space->machine(), keynames[i]) & 0x3f;
break;
}
}
@@ -283,23 +283,23 @@ static READ8_HANDLER( mrokumei_keyboard_r )
static WRITE8_HANDLER( mrokumei_keyboard_select_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->keyb = data;
}
static READ8_HANDLER( mrokumei_sound_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
if (state->sndbank & 4)
return(soundlatch_r(space, 0));
else
- return space->machine->region("audiocpu")->base()[0x10000 + offset + (state->sndbank & 1) * 0x10000];
+ return space->machine().region("audiocpu")->base()[0x10000 + offset + (state->sndbank & 1) * 0x10000];
}
static WRITE8_HANDLER( mrokumei_sound_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* bit 0 = ROM bank
bit 2 = ROM or soundlatch
*/
@@ -308,7 +308,7 @@ static WRITE8_HANDLER( mrokumei_sound_bank_w )
static WRITE8_HANDLER( mrokumei_sound_io_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
switch (offset & 0xff)
{
case 0x40:
@@ -322,7 +322,7 @@ static WRITE8_HANDLER( mrokumei_sound_io_w )
static WRITE8_HANDLER( mrokumei_sound_cmd_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -338,19 +338,19 @@ static WRITE8_HANDLER( mrokumei_sound_cmd_w )
static READ8_HANDLER( reikaids_upd7807_porta_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
return state->upd7807_porta;
}
static WRITE8_HANDLER( reikaids_upd7807_porta_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->upd7807_porta = data;
}
static WRITE8_HANDLER( reikaids_upd7807_portc_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* port C layout:
7 coin counter
@@ -364,9 +364,9 @@ static WRITE8_HANDLER( reikaids_upd7807_portc_w )
*/
// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n", cpu_get_pc(space->cpu), data, BIT(data, 2), BIT(data, 6));
- memory_set_bank(space->machine, "bank2", data & 0x03);
+ memory_set_bank(space->machine(), "bank2", data & 0x03);
- coin_counter_w(space->machine, 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
if (BIT(state->upd7807_portc, 5) && !BIT(data, 5)) /* write clock 1->0 */
ym2203_w(state->ym, BIT(data, 3), state->upd7807_porta);
@@ -379,8 +379,8 @@ static WRITE8_HANDLER( reikaids_upd7807_portc_w )
static READ8_HANDLER( reikaids_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
- int res = input_port_read(space->machine, "IN2"); // bit 4 = coin, bit 5 = service
+ homedata_state *state = space->machine().driver_data<homedata_state>();
+ int res = input_port_read(space->machine(), "IN2"); // bit 4 = coin, bit 5 = service
res |= BIT(state->upd7807_portc, 2) * 0x01; // bit 0 = upd7807 status
res |= BIT(state->upd7807_portc, 6) * 0x02; // bit 1 = upd7807 data
@@ -397,14 +397,14 @@ static READ8_HANDLER( reikaids_io_r )
static READ8_HANDLER( reikaids_snd_command_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: sndmcd_r (%02x)\n", cpu_get_pc(space->cpu), state->snd_command);
return state->snd_command;
}
static WRITE8_HANDLER( reikaids_snd_command_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->snd_command = data;
//logerror("%04x: coprocessor_command_w %02x\n", cpu_get_pc(space->cpu), data);
}
@@ -420,21 +420,21 @@ static WRITE8_HANDLER( reikaids_snd_command_w )
static WRITE8_HANDLER( pteacher_snd_command_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: snd_command_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_cpu = data;
}
static READ8_HANDLER( pteacher_snd_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: pteacher_snd_r %02x\n",cpu_get_pc(space->cpu),to_cpu);
return state->to_cpu;
}
static READ8_HANDLER( pteacher_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* bit 6: !vblank
* bit 7: visible page
* other bits seem unused
@@ -452,9 +452,9 @@ static READ8_HANDLER( pteacher_io_r )
static READ8_HANDLER( pteacher_keyboard_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
- int dips = input_port_read(space->machine, "DSW");
+ int dips = input_port_read(space->machine(), "DSW");
// logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(space->cpu),upd7807_porta);
@@ -462,7 +462,7 @@ static READ8_HANDLER( pteacher_keyboard_r )
{
/* player 1 + dip switches */
int row = (state->upd7807_porta & 0x07);
- return input_port_read(space->machine, keynames[row]) | (((dips >> row) & 1) << 5); // 0-5
+ return input_port_read(space->machine(), keynames[row]) | (((dips >> row) & 1) << 5); // 0-5
}
if (state->upd7807_porta & 0x08)
{
@@ -476,7 +476,7 @@ static READ8_HANDLER( pteacher_keyboard_r )
static READ8_HANDLER( pteacher_upd7807_porta_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
if (!BIT(state->upd7807_portc, 6))
state->upd7807_porta = state->from_cpu;
else
@@ -487,20 +487,20 @@ static READ8_HANDLER( pteacher_upd7807_porta_r )
static WRITE8_HANDLER( pteacher_snd_answer_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->to_cpu = data;
//logerror("%04x: to_cpu = %02x\n", cpu_get_pc(space->cpu), state->to_cpu);
}
static WRITE8_HANDLER( pteacher_upd7807_porta_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->upd7807_porta = data;
}
static WRITE8_HANDLER( pteacher_upd7807_portc_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* port C layout:
7 coin counter
6 enable message from main CPU on port A
@@ -514,9 +514,9 @@ static WRITE8_HANDLER( pteacher_upd7807_portc_w )
// logerror("%04x: port C wr %02x\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank2", (data & 0x0c) >> 2);
- coin_counter_w(space->machine, 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
if (BIT(state->upd7807_portc, 5) && !BIT(data, 5)) /* clock 1->0 */
sn76496_w(state->sn, 0, state->upd7807_porta);
@@ -529,13 +529,13 @@ static WRITE8_HANDLER( pteacher_upd7807_portc_w )
static WRITE8_HANDLER( bankswitch_w )
{
- int last_bank = (space->machine->region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int last_bank = (space->machine().region("maincpu")->bytes() - 0x10000) / 0x4000;
/* last bank is fixed and is #0 for us, other banks start from #1 (hence data+1 below)*/
if (data < last_bank)
- memory_set_bank(space->machine, "bank1", data + 1);
+ memory_set_bank(space->machine(), "bank1", data + 1);
else
- memory_set_bank(space->machine, "bank1", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
}
@@ -1147,13 +1147,13 @@ GFXDECODE_END
static MACHINE_START( homedata )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->ym = machine->device("ymsnd");
- state->sn = machine->device("snsnd");
- state->dac = machine->device("dac");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->ym = machine.device("ymsnd");
+ state->sn = machine.device("snsnd");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->visible_page));
state->save_item(NAME(state->flipscreen));
@@ -1168,11 +1168,11 @@ static MACHINE_START( homedata )
static MACHINE_START( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homedata_state *state = machine.driver_data<homedata_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0xc000], 0x4000);
- memory_configure_bank(machine, "bank2", 0, 4, machine->region("audiocpu")->base(), 0x10000);
+ memory_configure_bank(machine, "bank2", 0, 4, machine.region("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1185,11 +1185,11 @@ static MACHINE_START( reikaids )
static MACHINE_START( pteacher )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homedata_state *state = machine.driver_data<homedata_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
- memory_configure_bank(machine, "bank2", 0, 4, machine->region("audiocpu")->base(), 0x10000);
+ memory_configure_bank(machine, "bank2", 0, 4, machine.region("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1203,7 +1203,7 @@ static MACHINE_START( pteacher )
static MACHINE_RESET( homedata )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->visible_page = 0;
state->flipscreen = 0;
@@ -1221,8 +1221,8 @@ static MACHINE_RESET( homedata )
static MACHINE_RESET( pteacher )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ homedata_state *state = machine.driver_data<homedata_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
pteacher_upd7807_portc_w(space, 0, 0xff);
@@ -1238,8 +1238,8 @@ static MACHINE_RESET( pteacher )
static MACHINE_RESET( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ homedata_state *state = machine.driver_data<homedata_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
reikaids_upd7807_portc_w(space, 0, 0xff);
@@ -1449,14 +1449,14 @@ ADDRESS_MAP_END
static READ8_HANDLER( mirderby_prot_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->prot_data&=0x7f;
return state->prot_data++;
}
static WRITE8_HANDLER( mirderby_prot_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->prot_data = data;
}
@@ -2032,26 +2032,26 @@ static DRIVER_INIT( jogakuen )
/* it seems that Mahjong Jogakuen runs on the same board as the others,
but with just these two addresses swapped. Instead of creating a new
MachineDriver, I just fix them here. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8007, 0x8007, FUNC(pteacher_blitter_bank_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8005, 0x8005, FUNC(pteacher_gfx_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8007, 0x8007, FUNC(pteacher_blitter_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8005, 0x8005, FUNC(pteacher_gfx_bank_w));
}
static DRIVER_INIT( mjikaga )
{
/* Mahjong Ikagadesuka is different as well. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7802, 0x7802, FUNC(pteacher_snd_r));
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0123, 0x0123, FUNC(pteacher_snd_answer_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7802, 0x7802, FUNC(pteacher_snd_r));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0123, 0x0123, FUNC(pteacher_snd_answer_w));
}
static DRIVER_INIT( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->priority = 0;
}
static DRIVER_INIT( battlcry )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->priority = 1; /* priority and initial value for bank write */
}
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 665d849ef2d..7a60f856de9 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -24,19 +24,19 @@ Todo :
static WRITE8_DEVICE_HANDLER(pa_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpa = data;
}
static WRITE8_DEVICE_HANDLER(pb_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpb = data;
}
static WRITE8_DEVICE_HANDLER(pc_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpc = data;
}
@@ -64,7 +64,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( homerun_40_r )
{
- UINT8 ret = (field->port->machine->primary_screen->vpos() > 116) ? 1 : 0;
+ UINT8 ret = (field->port->machine().primary_screen->vpos() > 116) ? 1 : 0;
return ret;
}
@@ -192,8 +192,8 @@ GFXDECODE_END
static MACHINE_START( homerun )
{
- homerun_state *state = machine->driver_data<homerun_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homerun_state *state = machine.driver_data<homerun_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 1, 7, &ROM[0x10000], 0x4000);
@@ -208,7 +208,7 @@ static MACHINE_START( homerun )
static MACHINE_RESET( homerun )
{
- homerun_state *state = machine->driver_data<homerun_state>();
+ homerun_state *state = machine.driver_data<homerun_state>();
state->gfx_ctrl = 0;
state->gc_up = 0;
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 523fbf1372d..7c53b534026 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -346,56 +346,56 @@ public:
static READ32_HANDLER( hornet_k037122_sram_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_sram_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_sram_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_sram_w(k037122, offset, data, mem_mask);
}
static READ32_HANDLER( hornet_k037122_char_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_char_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_char_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_char_w(k037122, offset, data, mem_mask);
}
static READ32_HANDLER( hornet_k037122_reg_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_reg_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_reg_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_reg_w(k037122, offset, data, mem_mask);
}
static void voodoo_vblank_0(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
}
static void voodoo_vblank_1(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
}
static SCREEN_UPDATE( hornet )
{
- hornet_state *state = screen->machine->driver_data<hornet_state>();
- device_t *voodoo = screen->machine->device("voodoo0");
- device_t *k037122 = screen->machine->device("k037122_1");
+ hornet_state *state = screen->machine().driver_data<hornet_state>();
+ device_t *voodoo = screen->machine().device("voodoo0");
+ device_t *k037122 = screen->machine().device("k037122_1");
voodoo_update(voodoo, bitmap, cliprect);
@@ -408,11 +408,11 @@ static SCREEN_UPDATE( hornet )
static SCREEN_UPDATE( hornet_2board )
{
- hornet_state *state = screen->machine->driver_data<hornet_state>();
+ hornet_state *state = screen->machine().driver_data<hornet_state>();
if (strcmp(screen->tag(), "lscreen") == 0)
{
- device_t *k037122 = screen->machine->device("k037122_1");
- device_t *voodoo = screen->machine->device("voodoo0");
+ device_t *k037122 = screen->machine().device("k037122_1");
+ device_t *voodoo = screen->machine().device("voodoo0");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
@@ -420,8 +420,8 @@ static SCREEN_UPDATE( hornet_2board )
}
else if (strcmp(screen->tag(), "rscreen") == 0)
{
- device_t *k037122 = screen->machine->device("k037122_2");
- device_t *voodoo = screen->machine->device("voodoo1");
+ device_t *k037122 = screen->machine().device("k037122_2");
+ device_t *voodoo = screen->machine().device("voodoo1");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
@@ -439,15 +439,15 @@ static READ8_HANDLER( sysreg_r )
{
UINT8 r = 0;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
- device_t *adc12138 = space->machine->device("adc12138");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc12138 = space->machine().device("adc12138");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
case 0: /* I/O port 0 */
case 1: /* I/O port 1 */
case 2: /* I/O port 2 */
- r = input_port_read(space->machine, portnames[offset]);
+ r = input_port_read(space->machine(), portnames[offset]);
break;
case 3: /* I/O port 3 */
@@ -465,7 +465,7 @@ static READ8_HANDLER( sysreg_r )
break;
case 4: /* I/O port 4 - DIP switches */
- r = input_port_read(space->machine, "DSW");
+ r = input_port_read(space->machine(), "DSW");
break;
}
return r;
@@ -473,8 +473,8 @@ static READ8_HANDLER( sysreg_r )
static WRITE8_HANDLER( sysreg_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
- device_t *adc12138 = space->machine->device("adc12138");
+ hornet_state *state = space->machine().driver_data<hornet_state>();
+ device_t *adc12138 = space->machine().device("adc12138");
switch (offset)
{
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( sysreg_w )
0x02 = LAMP1
0x01 = LAMP0
*/
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
mame_printf_debug("System register 0 = %02X\n", data);
break;
@@ -521,7 +521,7 @@ static WRITE8_HANDLER( sysreg_w )
adc1213x_di_w(adc12138, 0, (data >> 1) & 0x1);
adc1213x_sclk_w(adc12138, 0, data & 0x1);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
mame_printf_debug("System register 1 = %02X\n", data);
break;
@@ -544,7 +544,7 @@ static WRITE8_HANDLER( sysreg_w )
0x80 = WDTCLK
*/
if (data & 0x80)
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
break;
case 7: /* CG Control Register */
@@ -556,9 +556,9 @@ static WRITE8_HANDLER( sysreg_w )
0x01 = EXRGB
*/
if (data & 0x80)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
if (data & 0x40)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
set_cgboard_id((data >> 4) & 3);
break;
}
@@ -574,9 +574,9 @@ static WRITE32_HANDLER( comm1_w )
static WRITE32_HANDLER( comm_rombank_w )
{
int bank = data >> 24;
- UINT8 *usr3 = space->machine->region("user3")->base();
+ UINT8 *usr3 = space->machine().region("user3")->base();
if (usr3 != NULL)
- memory_set_bank(space->machine, "bank1", bank & 0x7f);
+ memory_set_bank(space->machine(), "bank1", bank & 0x7f);
}
static READ32_HANDLER( comm0_unk_r )
@@ -588,17 +588,17 @@ static READ32_HANDLER( comm0_unk_r )
static READ32_HANDLER(gun_r)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->gn680_ret0<<16 | state->gn680_ret1;
}
static WRITE32_HANDLER(gun_w)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
if (mem_mask == 0xffff0000)
{
state->gn680_latch = data>>16;
- cputag_set_input_line(space->machine, "gn680", M68K_IRQ_6, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "gn680", M68K_IRQ_6, HOLD_LINE);
}
}
@@ -649,15 +649,15 @@ static WRITE16_HANDLER(gn680_sysctrl)
static READ16_HANDLER(gn680_latch_r)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
- cputag_set_input_line(space->machine, "gn680", M68K_IRQ_6, CLEAR_LINE);
+ hornet_state *state = space->machine().driver_data<hornet_state>();
+ cputag_set_input_line(space->machine(), "gn680", M68K_IRQ_6, CLEAR_LINE);
return state->gn680_latch;
}
static WRITE16_HANDLER(gn680_latch_w)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
if (offset)
{
state->gn680_ret1 = data;
@@ -684,25 +684,25 @@ ADDRESS_MAP_END
static READ32_HANDLER( dsp_dataram0_r )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->sharc_dataram[0][offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram0_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
state->sharc_dataram[0][offset] = data;
}
static READ32_HANDLER( dsp_dataram1_r )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->sharc_dataram[1][offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram1_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
state->sharc_dataram[1][offset] = data;
}
@@ -858,31 +858,31 @@ static TIMER_CALLBACK( irq_off );
static MACHINE_START( hornet )
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
state->jvs_sdata_ptr = 0;
state->jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024);
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->workram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->workram);
state_save_register_global(machine, state->led_reg0);
state_save_register_global(machine, state->led_reg1);
state_save_register_global_pointer(machine, state->jvs_sdata, 1024);
state_save_register_global(machine, state->jvs_sdata_ptr);
- state->sound_irq_timer = machine->scheduler().timer_alloc(FUNC(irq_off));
+ state->sound_irq_timer = machine.scheduler().timer_alloc(FUNC(irq_off));
}
static MACHINE_RESET( hornet )
{
- UINT8 *usr3 = machine->region("user3")->base();
- UINT8 *usr5 = machine->region("user5")->base();
+ UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr5 = machine.region("user5")->base();
if (usr3 != NULL)
{
- memory_configure_bank(machine, "bank1", 0, machine->region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ memory_configure_bank(machine, "bank1", 0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
memory_set_bank(machine, "bank1", 0);
}
@@ -906,9 +906,9 @@ static TIMER_CALLBACK( irq_off )
cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
}
-static void sound_irq_callback( running_machine *machine, int irq )
+static void sound_irq_callback( running_machine &machine, int irq )
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
@@ -1000,12 +1000,12 @@ MACHINE_CONFIG_END
static MACHINE_RESET( hornet_2board )
{
- UINT8 *usr3 = machine->region("user3")->base();
- UINT8 *usr5 = machine->region("user5")->base();
+ UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr5 = machine.region("user5")->base();
if (usr3 != NULL)
{
- memory_configure_bank(machine, "bank1", 0, machine->region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ memory_configure_bank(machine, "bank1", 0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
memory_set_bank(machine, "bank1", 0);
}
cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -1085,21 +1085,21 @@ MACHINE_CONFIG_END
/*****************************************************************************/
-static void jamma_jvs_cmd_exec(running_machine *machine);
+static void jamma_jvs_cmd_exec(running_machine &machine);
static void jamma_jvs_w(device_t *device, UINT8 data)
{
- hornet_state *state = device->machine->driver_data<hornet_state>();
+ hornet_state *state = device->machine().driver_data<hornet_state>();
if (state->jvs_sdata_ptr == 0 && data != 0xe0)
return;
state->jvs_sdata[state->jvs_sdata_ptr] = data;
state->jvs_sdata_ptr++;
if (state->jvs_sdata_ptr >= 3 && state->jvs_sdata_ptr >= 3 + state->jvs_sdata[2])
- jamma_jvs_cmd_exec(device->machine);
+ jamma_jvs_cmd_exec(device->machine());
}
-static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
+static int jvs_encode_data(running_machine &machine, UINT8 *in, int length)
{
int inptr = 0;
int sum = 0;
@@ -1110,19 +1110,19 @@ static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
if (b == 0xe0)
{
sum += 0xd0 + 0xdf;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xdf);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xd0);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xdf);
}
else if (b == 0xd0)
{
sum += 0xd0 + 0xcf;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xcf);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xd0);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xcf);
}
else
{
sum += b;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), b);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), b);
}
}
return sum;
@@ -1150,9 +1150,9 @@ static int jvs_decode_data(UINT8 *in, UINT8 *out, int length)
return outptr;
}
-static void jamma_jvs_cmd_exec(running_machine *machine)
+static void jamma_jvs_cmd_exec(running_machine &machine)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
UINT8 sync, node, byte_num;
UINT8 data[1024], rdata[1024];
#if 0
@@ -1216,11 +1216,11 @@ static void jamma_jvs_cmd_exec(running_machine *machine)
// write jvs return data
sum = 0x00 + (rdata_ptr+1);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xe0); // sync
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0x00); // node
- ppc4xx_spu_receive_byte(machine->device("maincpu"), rdata_ptr + 1); // num of bytes
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xe0); // sync
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0x00); // node
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), rdata_ptr + 1); // num of bytes
sum += jvs_encode_data(machine, rdata, rdata_ptr);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), sum - 1); // checksum
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), sum - 1); // checksum
state->jvs_sdata_ptr = 0;
}
@@ -1230,25 +1230,25 @@ static void jamma_jvs_cmd_exec(running_machine *machine)
static DRIVER_INIT(hornet)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
state->led_reg0 = state->led_reg1 = 0x7f;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), jamma_jvs_w);
}
static DRIVER_INIT(hornet_2board)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
state->led_reg0 = state->led_reg1 = 0x7f;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), jamma_jvs_w);
}
/*****************************************************************************/
diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c
index 08cdcc3e60b..117631ccaf3 100644
--- a/src/mame/drivers/hotblock.c
+++ b/src/mame/drivers/hotblock.c
@@ -66,7 +66,7 @@ public:
static READ8_HANDLER( hotblock_video_read )
{
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
/* right?, anything else?? */
if (state->port0 & 0x20) // port 0 = a8 e8 -- palette
{
@@ -90,7 +90,7 @@ static WRITE8_HANDLER( hotblock_port4_w )
{
// mame_printf_debug("port4_w: pc = %06x : data %04x\n", cpu_get_pc(space->cpu), data);
// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(space->cpu), data);
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
state->port4 = data;
}
@@ -99,13 +99,13 @@ static WRITE8_HANDLER( hotblock_port4_w )
static WRITE8_HANDLER( hotblock_port0_w )
{
// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(space->cpu), data);
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
state->port0 = data;
}
static WRITE8_HANDLER( hotblock_video_write )
{
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
/* right?, anything else?? */
if (state->port0 & 0x20) // port 0 = a8 e8 -- palette
{
@@ -134,23 +134,23 @@ ADDRESS_MAP_END
static VIDEO_START(hotblock)
{
- hotblock_state *state = machine->driver_data<hotblock_state>();
+ hotblock_state *state = machine.driver_data<hotblock_state>();
state->save_item(NAME(state->pal));
}
static SCREEN_UPDATE(hotblock)
{
- hotblock_state *state = screen->machine->driver_data<hotblock_state>();
+ hotblock_state *state = screen->machine().driver_data<hotblock_state>();
int y, x, count;
int i;
static const int xxx = 320, yyy = 204;
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
for (i = 0; i < 256; i++)
{
int dat = (state->pal[i * 2 + 1] << 8) | state->pal[i * 2];
- palette_set_color_rgb(screen->machine, i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
+ palette_set_color_rgb(screen->machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
}
count = 0;
diff --git a/src/mame/drivers/hotstuff.c b/src/mame/drivers/hotstuff.c
index f5e65a7e657..7818d3c88ba 100644
--- a/src/mame/drivers/hotstuff.c
+++ b/src/mame/drivers/hotstuff.c
@@ -22,7 +22,7 @@ VIDEO_START( hotstuff )
SCREEN_UPDATE( hotstuff )
{
- hotstuff_state *state = screen->machine->driver_data<hotstuff_state>();
+ hotstuff_state *state = screen->machine().driver_data<hotstuff_state>();
int count, y,yyy,x,xxx;
UINT16 row_palette_data[0x10];
rgb_t row_palette_data_as_rgb32_pen_data[0x10];
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index 9eebffadd5a..264c7804dec 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -119,7 +119,7 @@ static DRIVER_INIT(hshavoc)
{
int x;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
static const UINT16 typedat[16] = {
1,1,1,1, 1,1,1,1,
@@ -218,7 +218,7 @@ static DRIVER_INIT(hshavoc)
*/
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->nop_write(0x200000, 0x201fff);
}
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index 7baa1940a73..d229772cb19 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -114,20 +114,20 @@ public:
static MACHINE_START( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
- state->master_cpu = machine->device("master");
- state->slave_cpu = machine->device("slave");
- state->sound_cpu = machine->device("soundcpu");
- state->mermaid = machine->device("mermaid");
- state->pandora = machine->device("pandora");
+ state->master_cpu = machine.device("master");
+ state->slave_cpu = machine.device("slave");
+ state->sound_cpu = machine.device("soundcpu");
+ state->mermaid = machine.device("mermaid");
+ state->pandora = machine.device("pandora");
// TODO: Save state
}
static MACHINE_RESET( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
state->int_vector = 0xff;
state->mermaid_int0_l = 1;
@@ -144,7 +144,7 @@ static MACHINE_RESET( hvyunit )
static TILE_GET_INFO( get_bg_tile_info )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x0f) << 8);
@@ -155,7 +155,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
}
@@ -163,11 +163,11 @@ static SCREEN_UPDATE( hvyunit )
{
#define SX_POS 96
#define SY_POS 0
- hvyunit_state *state = screen->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = screen->machine().driver_data<hvyunit_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->port0_data & 0x40) << 2) + state->scrollx + SX_POS); // TODO
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->port0_data & 0x80) << 1) + state->scrolly + SY_POS); // TODO
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
pandora_update(state->pandora, bitmap, cliprect);
@@ -176,7 +176,7 @@ static SCREEN_UPDATE( hvyunit )
static SCREEN_EOF( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
pandora_eof(state->pandora);
}
@@ -189,21 +189,21 @@ static SCREEN_EOF( hvyunit )
static WRITE8_HANDLER( trigger_nmi_on_slave_cpu )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
device_set_input_line(state->slave_cpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( master_bankswitch_w )
{
- unsigned char *ROM = space->machine->region("master")->base();
+ unsigned char *ROM = space->machine().region("master")->base();
int bank = data & 7;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank1", ROM);
+ memory_set_bankptr(space->machine(), "bank1", ROM);
}
static WRITE8_HANDLER( mermaid_data_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->data_to_mermaid = data;
state->z80_to_mermaid_full = 1;
@@ -213,7 +213,7 @@ static WRITE8_HANDLER( mermaid_data_w )
static READ8_HANDLER( mermaid_data_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_to_z80_full = 0;
return state->data_to_z80;
@@ -221,7 +221,7 @@ static READ8_HANDLER( mermaid_data_r )
static READ8_HANDLER( mermaid_status_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
return (!state->mermaid_to_z80_full << 2) | (state->z80_to_mermaid_full << 3);
}
@@ -235,7 +235,7 @@ static READ8_HANDLER( mermaid_status_r )
static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->sound_cpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -243,7 +243,7 @@ static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
static WRITE8_HANDLER( hu_videoram_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -251,7 +251,7 @@ static WRITE8_HANDLER( hu_videoram_w )
static WRITE8_HANDLER( hu_colorram_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -259,32 +259,32 @@ static WRITE8_HANDLER( hu_colorram_w )
static WRITE8_HANDLER( slave_bankswitch_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
- unsigned char *ROM = space->machine->region("slave")->base();
+ unsigned char *ROM = space->machine().region("slave")->base();
int bank = (data & 0x03);
state->port0_data = data;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank2", ROM);
+ memory_set_bankptr(space->machine(), "bank2", ROM);
}
static WRITE8_HANDLER( hu_scrollx_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->scrollx = data;
}
static WRITE8_HANDLER( hu_scrolly_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->scrolly = data;
}
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
@@ -296,11 +296,11 @@ static WRITE8_HANDLER( coin_count_w )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- unsigned char *ROM = space->machine->region("soundcpu")->base();
+ unsigned char *ROM = space->machine().region("soundcpu")->base();
int bank = data & 0x3;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank3", ROM);
+ memory_set_bankptr(space->machine(), "bank3", ROM);
}
@@ -318,7 +318,7 @@ static READ8_HANDLER( mermaid_p0_r )
static WRITE8_HANDLER( mermaid_p0_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (!BIT(state->mermaid_p[0], 1) && BIT(data, 1))
{
@@ -334,7 +334,7 @@ static WRITE8_HANDLER( mermaid_p0_w )
static READ8_HANDLER( mermaid_p1_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (BIT(state->mermaid_p[0], 0) == 0)
return state->data_to_mermaid;
@@ -344,7 +344,7 @@ static READ8_HANDLER( mermaid_p1_r )
static WRITE8_HANDLER( mermaid_p1_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (data == 0xff)
{
@@ -357,31 +357,31 @@ static WRITE8_HANDLER( mermaid_p1_w )
static READ8_HANDLER( mermaid_p2_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
switch ((state->mermaid_p[0] >> 2) & 3)
{
- case 0: return input_port_read(space->machine, "IN1");
- case 1: return input_port_read(space->machine, "IN2");
- case 2: return input_port_read(space->machine, "IN0");
+ case 0: return input_port_read(space->machine(), "IN1");
+ case 1: return input_port_read(space->machine(), "IN2");
+ case 2: return input_port_read(space->machine(), "IN0");
default: return 0xff;
}
}
static WRITE8_HANDLER( mermaid_p2_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_p[2] = data;
}
static READ8_HANDLER( mermaid_p3_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
UINT8 dsw = 0;
- UINT8 dsw1 = input_port_read(space->machine, "DSW1");
- UINT8 dsw2 = input_port_read(space->machine, "DSW2");
+ UINT8 dsw1 = input_port_read(space->machine(), "DSW1");
+ UINT8 dsw2 = input_port_read(space->machine(), "DSW2");
switch ((state->mermaid_p[0] >> 5) & 3)
{
@@ -396,7 +396,7 @@ static READ8_HANDLER( mermaid_p3_r )
static WRITE8_HANDLER( mermaid_p3_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_p[3] = data;
device_set_input_line(state->slave_cpu, INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
@@ -620,7 +620,7 @@ GFXDECODE_END
static INTERRUPT_GEN( hvyunit_interrupt )
{
- hvyunit_state *state = device->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = device->machine().driver_data<hvyunit_state>();
state->int_vector ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->int_vector);
diff --git a/src/mame/drivers/hyperspt.c b/src/mame/drivers/hyperspt.c
index 2f549b3da1a..182f1323f10 100644
--- a/src/mame/drivers/hyperspt.c
+++ b/src/mame/drivers/hyperspt.c
@@ -23,7 +23,7 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
static WRITE8_HANDLER( hyperspt_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index e393034b3ae..13f012a0b9d 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -46,9 +46,9 @@ fix comms so it boots, it's a bit of a hack for hyperduel at the moment ;-)
Interrupts
***************************************************************************/
-static void update_irq_state( running_machine *machine )
+static void update_irq_state( running_machine &machine )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
int irq = state->requested_int & ~*state->irq_enable;
device_set_input_line(state->maincpu, 3, (irq & state->int_num) ? ASSERT_LINE : CLEAR_LINE);
@@ -56,13 +56,13 @@ static void update_irq_state( running_machine *machine )
static TIMER_CALLBACK( vblank_end_callback )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->requested_int &= ~param;
}
static INTERRUPT_GEN( hyprduel_interrupt )
{
- hyprduel_state *state = device->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = device->machine().driver_data<hyprduel_state>();
int line = RASTER_LINES - cpu_getiloops(device);
if (line == RASTER_LINES)
@@ -71,23 +71,23 @@ static INTERRUPT_GEN( hyprduel_interrupt )
state->requested_int |= 0x20;
device_set_input_line(device, 2, HOLD_LINE);
/* the duration is a guess */
- device->machine->scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20);
+ device->machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20);
}
else
state->requested_int |= 0x12; /* hsync */
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
static READ16_HANDLER( hyprduel_irq_cause_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
return state->requested_int;
}
static WRITE16_HANDLER( hyprduel_irq_cause_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (ACCESSING_BITS_0_7)
{
if (data == state->int_num)
@@ -95,14 +95,14 @@ static WRITE16_HANDLER( hyprduel_irq_cause_w )
else
state->requested_int &= ~(data & *state->irq_enable);
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
}
}
static WRITE16_HANDLER( hyprduel_subcpu_control_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
switch (data)
{
@@ -135,10 +135,10 @@ static WRITE16_HANDLER( hyprduel_subcpu_control_w )
static READ16_HANDLER( hyprduel_cpusync_trigger1_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (state->cpu_trigger == 1001)
{
- space->machine->scheduler().trigger(1001);
+ space->machine().scheduler().trigger(1001);
state->cpu_trigger = 0;
}
@@ -147,7 +147,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger1_r )
static WRITE16_HANDLER( hyprduel_cpusync_trigger1_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->sharedram1[0x00040e / 2 + offset]);
if (((state->sharedram1[0x00040e / 2] << 16) + state->sharedram1[0x000410 / 2]) != 0x00)
@@ -163,10 +163,10 @@ static WRITE16_HANDLER( hyprduel_cpusync_trigger1_w )
static READ16_HANDLER( hyprduel_cpusync_trigger2_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (state->cpu_trigger == 1002)
{
- space->machine->scheduler().trigger(1002);
+ space->machine().scheduler().trigger(1002);
state->cpu_trigger = 0;
}
@@ -175,7 +175,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger2_r )
static WRITE16_HANDLER( hyprduel_cpusync_trigger2_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->sharedram1[0x000408 / 2 + offset]);
if (ACCESSING_BITS_8_15)
@@ -191,7 +191,7 @@ static WRITE16_HANDLER( hyprduel_cpusync_trigger2_w )
static TIMER_CALLBACK( magerror_irq_callback )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
device_set_input_line(state->subcpu, 1, HOLD_LINE);
}
@@ -209,9 +209,9 @@ static TIMER_CALLBACK( magerror_irq_callback )
static READ16_HANDLER( hyprduel_bankedrom_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
- UINT8 *ROM = space->machine->region("gfx1")->base();
- size_t len = space->machine->region("gfx1")->bytes();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
+ UINT8 *ROM = space->machine().region("gfx1")->base();
+ size_t len = space->machine().region("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*state->rombank);
@@ -267,7 +267,7 @@ static READ16_HANDLER( hyprduel_bankedrom_r )
static TIMER_CALLBACK( hyprduel_blit_done )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->requested_int |= 1 << state->blitter_bit;
update_irq_state(machine);
}
@@ -285,19 +285,19 @@ INLINE void blt_write( address_space *space, const int tmap, const offs_t offs,
case 2: hyprduel_vram_1_w(space, offs, data, mask); break;
case 3: hyprduel_vram_2_w(space, offs, data, mask); break;
}
-// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine->describe_context(), tmap, offs, data, mask);
+// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine().describe_context(), tmap, offs, data, mask);
}
static WRITE16_HANDLER( hyprduel_blitter_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->blitter_regs[offset]);
if (offset == 0xc / 2)
{
- UINT8 *src = space->machine->region("gfx1")->base();
- size_t src_len = space->machine->region("gfx1")->bytes();
+ UINT8 *src = space->machine().region("gfx1")->base();
+ size_t src_len = space->machine().region("gfx1")->bytes();
UINT32 tmap = (state->blitter_regs[0x00 / 2] << 16) + state->blitter_regs[0x02 / 2];
UINT32 src_offs = (state->blitter_regs[0x04 / 2] << 16) + state->blitter_regs[0x06 / 2];
@@ -342,7 +342,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w )
another blit. */
if (b1 == 0)
{
- space->machine->scheduler().timer_set(attotime::from_usec(500), FUNC(hyprduel_blit_done));
+ space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(hyprduel_blit_done));
return;
}
@@ -623,7 +623,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- hyprduel_state *hyprduel = device->machine->driver_data<hyprduel_state>();
+ hyprduel_state *hyprduel = device->machine().driver_data<hyprduel_state>();
device_set_input_line(hyprduel->subcpu, 1, HOLD_LINE);
}
@@ -638,7 +638,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_RESET( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
/* start with cpu2 halted */
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
@@ -652,10 +652,10 @@ static MACHINE_RESET( hyprduel )
static MACHINE_START( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->blitter_bit));
state->save_item(NAME(state->requested_int));
@@ -665,7 +665,7 @@ static MACHINE_START( hyprduel )
static MACHINE_START( magerror )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
MACHINE_START_CALL(hyprduel);
state->magerror_irq_timer->adjust(attotime::zero, 0, attotime::from_hz(968)); /* tempo? */
@@ -807,23 +807,23 @@ ROM_END
static DRIVER_INIT( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->int_num = 0x02;
/* cpu synchronization (severe timings) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc0040e, 0xc00411, FUNC(hyprduel_cpusync_trigger1_w));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger2_w));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff34c, 0xfff34d, FUNC(hyprduel_cpusync_trigger2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc0040e, 0xc00411, FUNC(hyprduel_cpusync_trigger1_w));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger2_w));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff34c, 0xfff34d, FUNC(hyprduel_cpusync_trigger2_r));
}
static DRIVER_INIT( magerror )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->int_num = 0x01;
- state->magerror_irq_timer = machine->scheduler().timer_alloc(FUNC(magerror_irq_callback));
+ state->magerror_irq_timer = machine.scheduler().timer_alloc(FUNC(magerror_irq_callback));
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index 6ce1cddd195..6bb60c6ccf9 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -58,14 +58,14 @@ public:
static WRITE8_HANDLER( gp98_reel1_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel1_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel1_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel1_ram[tile_index];
SET_TILE_INFO(
@@ -78,7 +78,7 @@ static TILE_GET_INFO( get_jingbell_reel1_tile_info )
static TILE_GET_INFO( get_gp98_reel1_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel1_ram[tile_index];
SET_TILE_INFO(
@@ -91,14 +91,14 @@ static TILE_GET_INFO( get_gp98_reel1_tile_info )
static WRITE8_HANDLER( gp98_reel2_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel2_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel2_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel2_ram[tile_index];
SET_TILE_INFO(
@@ -110,7 +110,7 @@ static TILE_GET_INFO( get_jingbell_reel2_tile_info )
static TILE_GET_INFO( get_gp98_reel2_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel2_ram[tile_index];
SET_TILE_INFO(
@@ -124,14 +124,14 @@ static TILE_GET_INFO( get_gp98_reel2_tile_info )
static WRITE8_HANDLER( gp98_reel3_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel3_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel3_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel3_ram[tile_index];
SET_TILE_INFO(
@@ -143,7 +143,7 @@ static TILE_GET_INFO( get_jingbell_reel3_tile_info )
static TILE_GET_INFO( get_gp98_reel3_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel3_ram[tile_index];
SET_TILE_INFO(
@@ -157,14 +157,14 @@ static TILE_GET_INFO( get_gp98_reel3_tile_info )
static WRITE8_HANDLER( gp98_reel4_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel4_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel4_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel4_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel4_ram[tile_index];
SET_TILE_INFO(
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_jingbell_reel4_tile_info )
static TILE_GET_INFO( get_gp98_reel4_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel4_ram[tile_index];
SET_TILE_INFO(
@@ -194,7 +194,7 @@ static TILE_GET_INFO( get_gp98_reel4_tile_info )
static WRITE8_HANDLER( bg_scroll_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->bg_scroll[offset] = data;
// tilemap_set_scrolly(bg_tilemap,offset,data);
}
@@ -202,28 +202,28 @@ static WRITE8_HANDLER( bg_scroll_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
SET_TILE_INFO(1, code, (4*(code >> 14)+3), 0);
}
static WRITE8_HANDLER( fg_tile_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(jingbell)
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -241,7 +241,7 @@ static VIDEO_START(jingbell)
static VIDEO_START(gp98)
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -260,16 +260,16 @@ static VIDEO_START(gp98)
static SCREEN_UPDATE(jingbell)
{
- igs009_state *state = screen->machine->driver_data<igs009_state>();
+ igs009_state *state = screen->machine().driver_data<igs009_state>();
int layers_ctrl = state->video_enable ? -1 : 0;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
@@ -303,7 +303,7 @@ static SCREEN_UPDATE(jingbell)
clip.min_y = startclipmin;
clip.max_y = startclipmin+2;
- bitmap_fill(bitmap,&clip,screen->machine->pens[rowenable]);
+ bitmap_fill(bitmap,&clip,screen->machine().pens[rowenable]);
if (rowenable==0)
{ // 0 and 1 are the same? or is there a global switchoff?
@@ -327,7 +327,7 @@ static SCREEN_UPDATE(jingbell)
}
}
- else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -342,8 +342,8 @@ static SCREEN_UPDATE(jingbell)
static CUSTOM_INPUT( hopper_r )
{
- igs009_state *state = field->port->machine->driver_data<igs009_state>();
- return state->hopper && !(field->port->machine->primary_screen->frame_number()%10);
+ igs009_state *state = field->port->machine().driver_data<igs009_state>();
+ return state->hopper && !(field->port->machine().primary_screen->frame_number()%10);
}
@@ -356,19 +356,19 @@ static void show_out(igs009_state *state)
static WRITE8_HANDLER( jingbell_nmi_and_coins_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
if ((state->nmi_enable ^ data) & (~0xdd))
{
logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(space->cpu),data);
// popmessage("%02x",data);
}
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x40); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x40); // led for coin state->out / state->hopper active
state->nmi_enable = data; // data & 0x80 // nmi enable?
@@ -378,9 +378,9 @@ static WRITE8_HANDLER( jingbell_nmi_and_coins_w )
static WRITE8_HANDLER( jingbell_video_and_leds_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
- set_led_status(space->machine, 4, data & 0x01); // start?
- set_led_status(space->machine, 5, data & 0x04); // l_bet?
+ igs009_state *state = space->machine().driver_data<igs009_state>();
+ set_led_status(space->machine(), 4, data & 0x01); // start?
+ set_led_status(space->machine(), 5, data & 0x04); // l_bet?
state->video_enable = data & 0x40;
state->hopper = (~data)& 0x80;
@@ -391,11 +391,11 @@ static WRITE8_HANDLER( jingbell_video_and_leds_w )
static WRITE8_HANDLER( jingbell_leds_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
- set_led_status(space->machine, 0, data & 0x01); // stop_1
- set_led_status(space->machine, 1, data & 0x02); // stop_2
- set_led_status(space->machine, 2, data & 0x04); // stop_3
- set_led_status(space->machine, 3, data & 0x08); // stop
+ igs009_state *state = space->machine().driver_data<igs009_state>();
+ set_led_status(space->machine(), 0, data & 0x01); // stop_1
+ set_led_status(space->machine(), 1, data & 0x02); // stop_2
+ set_led_status(space->machine(), 2, data & 0x04); // stop_3
+ set_led_status(space->machine(), 3, data & 0x08); // stop
// data & 0x10?
state->out[2] = data;
@@ -405,7 +405,7 @@ static WRITE8_HANDLER( jingbell_leds_w )
static WRITE8_HANDLER( jingbell_magic_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->igs_magic[offset] = data;
if (offset == 0)
@@ -424,15 +424,15 @@ static WRITE8_HANDLER( jingbell_magic_w )
static READ8_HANDLER( jingbell_magic_r )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
switch(state->igs_magic[0])
{
case 0x00:
- if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine, "DSW1");
- if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine, "DSW2");
- if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine, "DSW3");
- if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine, "DSW4");
- if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine, "DSW5");
+ if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine(), "DSW1");
+ if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine(), "DSW2");
+ if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine(), "DSW3");
+ if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine(), "DSW4");
+ if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine(), "DSW5");
logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(space->cpu), state->igs_magic[1]);
break;
@@ -658,7 +658,7 @@ GFXDECODE_END
static MACHINE_RESET( jingbell )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->nmi_enable = 0;
state->hopper = 0;
state->video_enable = 1;
@@ -666,7 +666,7 @@ static MACHINE_RESET( jingbell )
static INTERRUPT_GEN( jingbell_interrupt )
{
- igs009_state *state = device->machine->driver_data<igs009_state>();
+ igs009_state *state = device->machine().driver_data<igs009_state>();
if (state->nmi_enable & 0x80)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -778,8 +778,8 @@ ROM_END
static DRIVER_INIT( jingbell )
{
int i;
- UINT8 *rom = (UINT8 *)machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = (UINT8 *)machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
for (i=0; i<size; i++)
{
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index ab95327c726..1d88ad16d6a 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -131,7 +131,7 @@ public:
static WRITE16_HANDLER( igs011_priority_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->priority);
// logerror("%06x: priority = %02x\n", cpu_get_pc(space->cpu), state->priority);
@@ -143,7 +143,7 @@ static WRITE16_HANDLER( igs011_priority_w )
static VIDEO_START( igs011 )
{
- igs011_state *state = machine->driver_data<igs011_state>();
+ igs011_state *state = machine.driver_data<igs011_state>();
int i;
for (i = 0; i < 8; i++)
@@ -156,7 +156,7 @@ static VIDEO_START( igs011 )
static SCREEN_UPDATE( igs011 )
{
- igs011_state *state = screen->machine->driver_data<igs011_state>();
+ igs011_state *state = screen->machine().driver_data<igs011_state>();
#ifdef MAME_DEBUG
int layer_enable = -1;
#endif
@@ -165,17 +165,17 @@ static SCREEN_UPDATE( igs011 )
UINT16 *pri_ram;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 0x08;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 0x10;
- if (input_code_pressed(screen->machine, KEYCODE_S)) mask |= 0x20;
- if (input_code_pressed(screen->machine, KEYCODE_D)) mask |= 0x40;
- if (input_code_pressed(screen->machine, KEYCODE_F)) mask |= 0x80;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) mask |= 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) mask |= 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 0x10;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) mask |= 0x20;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) mask |= 0x40;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) mask |= 0x80;
if (mask) layer_enable &= mask;
}
#endif
@@ -204,7 +204,7 @@ static SCREEN_UPDATE( igs011 )
#ifdef MAME_DEBUG
if ((layer_enable != -1) && (pri_addr == 0xff))
- *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen->machine);
+ *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen->machine());
else
#endif
*BITMAP_ADDR16(bitmap, y, x) = state->layer[l][scr_addr] | (l << 8);
@@ -233,7 +233,7 @@ static SCREEN_UPDATE( igs011 )
static READ16_HANDLER( igs011_layers_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
UINT8 *l0 = state->layer[layer0];
@@ -247,7 +247,7 @@ static READ16_HANDLER( igs011_layers_r )
static WRITE16_HANDLER( igs011_layers_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
UINT16 word;
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
@@ -277,10 +277,10 @@ static WRITE16_HANDLER( igs011_palette )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = (space->machine->generic.paletteram.u16[offset & 0x7ff] & 0xff) | ((space->machine->generic.paletteram.u16[offset | 0x800] & 0xff) << 8);
- palette_set_color_rgb(space->machine,offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
+ rgb = (space->machine().generic.paletteram.u16[offset & 0x7ff] & 0xff) | ((space->machine().generic.paletteram.u16[offset | 0x800] & 0xff) << 8);
+ palette_set_color_rgb(space->machine(),offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
}
/***************************************************************************
@@ -292,56 +292,56 @@ static WRITE16_HANDLER( igs011_palette )
static WRITE16_HANDLER( igs011_blit_x_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.x);
}
static WRITE16_HANDLER( igs011_blit_y_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.y);
}
static WRITE16_HANDLER( igs011_blit_gfx_lo_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.gfx_lo);
}
static WRITE16_HANDLER( igs011_blit_gfx_hi_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.gfx_hi);
}
static WRITE16_HANDLER( igs011_blit_w_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.w);
}
static WRITE16_HANDLER( igs011_blit_h_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.h);
}
static WRITE16_HANDLER( igs011_blit_depth_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.depth);
}
static WRITE16_HANDLER( igs011_blit_pen_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.pen);
}
@@ -349,7 +349,7 @@ static WRITE16_HANDLER( igs011_blit_pen_w )
static WRITE16_HANDLER( igs011_blit_flags_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
int x, xstart, xend, xinc, flipx;
int y, ystart, yend, yinc, flipy;
@@ -357,12 +357,12 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
UINT8 trans_pen, clear_pen, pen_hi, *dest;
UINT8 pen = 0;
- UINT8 *gfx = space->machine->region("blitter")->base();
- UINT8 *gfx2 = space->machine->region("blitter_hi")->base();
- int gfx_size = space->machine->region("blitter")->bytes();
- int gfx2_size = space->machine->region("blitter_hi")->bytes();
+ UINT8 *gfx = space->machine().region("blitter")->base();
+ UINT8 *gfx2 = space->machine().region("blitter_hi")->base();
+ int gfx_size = space->machine().region("blitter")->bytes();
+ int gfx2_size = space->machine().region("blitter_hi")->bytes();
- const rectangle &clip = space->machine->primary_screen->visible_area();
+ const rectangle &clip = space->machine().primary_screen->visible_area();
COMBINE_DATA(&blitter.flags);
@@ -446,7 +446,7 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
#ifdef MAME_DEBUG
#if 1
- if (input_code_pressed(space->machine, KEYCODE_Z))
+ if (input_code_pressed(space->machine(), KEYCODE_Z))
{ char buf[20];
sprintf(buf, "%02X%02X",blitter.depth,blitter.flags&0xff);
// ui_draw_text(buf, blitter.x, blitter.y); // crashes mame!
@@ -466,27 +466,27 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
static CUSTOM_INPUT( igs_hopper_r )
{
- igs011_state *state = field->port->machine->driver_data<igs011_state>();
- return (state->igs_hopper && ((field->port->machine->primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
+ igs011_state *state = field->port->machine().driver_data<igs011_state>();
+ return (state->igs_hopper && ((field->port->machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
}
static WRITE16_HANDLER( igs_dips_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs_dips_sel);
}
#define IGS_DIPS_R( NUM ) \
static READ16_HANDLER( igs_##NUM##_dips_r ) \
{ \
- igs011_state *state = space->machine->driver_data<igs011_state>(); \
+ igs011_state *state = space->machine().driver_data<igs011_state>(); \
int i; \
UINT16 ret=0; \
static const char *const dipnames[] = { "DSW1", "DSW2", "DSW3", "DSW4", "DSW5" }; \
\
for (i = 0; i < NUM; i++) \
if ((~state->igs_dips_sel) & (1 << i) ) \
- ret = input_port_read(space->machine, dipnames[i]); \
+ ret = input_port_read(space->machine(), dipnames[i]); \
\
/* 0x0100 is blitter busy */ \
return (ret & 0xff) | 0x0000; \
@@ -503,10 +503,10 @@ IGS_DIPS_R( 5 )
***************************************************************************/
-static void wlcc_decrypt(running_machine *machine)
+static void wlcc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -527,10 +527,10 @@ static void wlcc_decrypt(running_machine *machine)
}
-static void lhb_decrypt(running_machine *machine)
+static void lhb_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -552,10 +552,10 @@ static void lhb_decrypt(running_machine *machine)
}
-static void drgnwrld_type3_decrypt(running_machine *machine)
+static void drgnwrld_type3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -580,10 +580,10 @@ static void drgnwrld_type3_decrypt(running_machine *machine)
}
}
-static void drgnwrld_type2_decrypt(running_machine *machine)
+static void drgnwrld_type2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -613,10 +613,10 @@ static void drgnwrld_type2_decrypt(running_machine *machine)
}
}
-static void drgnwrld_type1_decrypt(running_machine *machine)
+static void drgnwrld_type1_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -642,11 +642,11 @@ static void drgnwrld_type1_decrypt(running_machine *machine)
}
-static void lhb2_decrypt(running_machine *machine)
+static void lhb2_decrypt(running_machine &machine)
{
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -674,7 +674,7 @@ static void lhb2_decrypt(running_machine *machine)
// To be done (similar to lhb2?)
-static void nkishusp_decrypt(running_machine *machine)
+static void nkishusp_decrypt(running_machine &machine)
{
// lhb_decrypt(machine);
// dbc_decrypt(machine);
@@ -687,7 +687,7 @@ static void nkishusp_decrypt(running_machine *machine)
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -714,10 +714,10 @@ static void nkishusp_decrypt(running_machine *machine)
}
-static void vbowlj_decrypt(running_machine *machine)
+static void vbowlj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -748,10 +748,10 @@ static void vbowlj_decrypt(running_machine *machine)
}
-static void dbc_decrypt(running_machine *machine)
+static void dbc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -798,10 +798,10 @@ static void dbc_decrypt(running_machine *machine)
}
-static void ryukobou_decrypt(running_machine *machine)
+static void ryukobou_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *) machine.region("maincpu")->base();
int rom_size = 0x80000;
for (i=0; i<rom_size/2; i++)
@@ -829,11 +829,11 @@ static void ryukobou_decrypt(running_machine *machine)
***************************************************************************/
-static void lhb2_decrypt_gfx(running_machine *machine)
+static void lhb2_decrypt_gfx(running_machine &machine)
{
int i;
unsigned rom_size = 0x200000;
- UINT8 *src = (UINT8 *) (machine->region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -844,11 +844,11 @@ static void lhb2_decrypt_gfx(running_machine *machine)
auto_free(machine, result_data);
}
-static void drgnwrld_gfx_decrypt(running_machine *machine)
+static void drgnwrld_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x400000;
- UINT8 *src = (UINT8 *) (machine->region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -904,7 +904,7 @@ static void drgnwrld_gfx_decrypt(running_machine *machine)
static WRITE16_HANDLER( igs011_prot1_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
switch (offset)
@@ -944,11 +944,11 @@ static WRITE16_HANDLER( igs011_prot1_w )
break;
}
- logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+ logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
static READ16_HANDLER( igs011_prot1_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// !(b1&b2) . 0 . 0 . (b0^b3) . 0 . 0
UINT8 x = state->prot1;
return (((BIT(x,1)&BIT(x,2))^1)<<5) | ((BIT(x,0)^BIT(x,3))<<2);
@@ -957,14 +957,14 @@ static READ16_HANDLER( igs011_prot1_r )
static WRITE16_HANDLER( igs011_prot_addr_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot1 = 0x00;
state->prot1_swap = 0x00;
// state->prot2 = 0x00;
- address_space *sp = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = space->machine->region("maincpu")->base();
+ address_space *sp = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = space->machine().region("maincpu")->base();
// Plug previous address range with ROM access
sp->install_rom(state->prot1_addr + 0, state->prot1_addr + 9, rom + state->prot1_addr);
@@ -978,7 +978,7 @@ static WRITE16_HANDLER( igs011_prot_addr_w )
/*
static READ16_HANDLER( igs011_prot_fake_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch (offset)
{
case 0: return state->prot1;
@@ -999,14 +999,14 @@ static READ16_HANDLER( igs011_prot_fake_r )
// drgnwrld (33)
static WRITE16_HANDLER( igs011_prot2_reset_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot2 = 0x00;
}
// wlcc
static READ16_HANDLER( igs011_prot2_reset_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot2 = 0x00;
return 0;
}
@@ -1016,32 +1016,32 @@ static READ16_HANDLER( igs011_prot2_reset_r )
// lhb2 (55), lhb/dbc/ryukobou (33)
static WRITE16_HANDLER( igs011_prot2_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x5500) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0055)) )
{
state->prot2++;
}
// else
-// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// vbowl (33)
static WRITE16_HANDLER( igs011_prot2_dec_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
{
state->prot2--;
}
// else
-// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
static WRITE16_HANDLER( drgnwrld_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1051,13 +1051,13 @@ static WRITE16_HANDLER( drgnwrld_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)&BIT(x,0))<<4) | (BIT(x,2)<<3) | ((BIT(x,0)|BIT(x,1))<<2) | ((BIT(x,2)^BIT(x,4)^1)<<1) | (BIT(x,1)^1^BIT(x,3));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// lhb, xymg, lhb2
static WRITE16_HANDLER( lhb_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1067,13 +1067,13 @@ static WRITE16_HANDLER( lhb_igs011_prot2_swap_w )
state->prot2 = (((BIT(x,0)^1)|BIT(x,1))<<2) | (BIT(x,2)<<1) | (BIT(x,0)&BIT(x,1));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// wlcc
static WRITE16_HANDLER( wlcc_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1083,13 +1083,13 @@ static WRITE16_HANDLER( wlcc_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0)^1)<<1) | (BIT(x,4)^BIT(x,3)^1);
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// vbowl
static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1099,7 +1099,7 @@ static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0))<<1) | (BIT(x,4)^BIT(x,3));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
@@ -1107,7 +1107,7 @@ static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
// drgnwrld
static READ16_HANDLER( drgnwrldv21_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b4) | (!b0 & b2) | (!(b3 ^ b1) & !(!(b4 & b0) | b2))
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,4)^1) | ((BIT(x,0)^1) & BIT(x,2)) | ( (BIT(x,3)^BIT(x,1)^1) & ((((BIT(x,4)^1) & BIT(x,0)) | BIT(x,2))^1) );
@@ -1115,7 +1115,7 @@ static READ16_HANDLER( drgnwrldv21_igs011_prot2_r )
}
static READ16_HANDLER( drgnwrldv20j_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b4 | !b0) | !(b3 | b1) | !(b2 & b0)
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,4)^1) | (BIT(x,0)^1)) | ((BIT(x,3) | BIT(x,1))^1) | ((BIT(x,2) & BIT(x,0))^1);
@@ -1125,7 +1125,7 @@ static READ16_HANDLER( drgnwrldv20j_igs011_prot2_r )
// lhb, xymg
static READ16_HANDLER( lhb_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = !b2 | (b1 & b0)
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,2)^1) | (BIT(x,1) & BIT(x,0));
@@ -1135,7 +1135,7 @@ static READ16_HANDLER( lhb_igs011_prot2_r )
// dbc
static READ16_HANDLER( dbc_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = !b1 | (!b0 & b2)
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,1)^1) | ((BIT(x,0)^1) & BIT(x,2));
@@ -1145,7 +1145,7 @@ static READ16_HANDLER( dbc_igs011_prot2_r )
// ryukobou
static READ16_HANDLER( ryukobou_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b1 | b2) & b0
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,1)^1) | BIT(x,2)) & BIT(x,0);
@@ -1155,7 +1155,7 @@ static READ16_HANDLER( ryukobou_igs011_prot2_r )
// lhb2
static READ16_HANDLER( lhb2_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b3 = !b2 | !b1 | b0
UINT8 x = state->prot2;
UINT8 b3 = (BIT(x,2)^1) | (BIT(x,1)^1) | BIT(x,0);
@@ -1165,7 +1165,7 @@ static READ16_HANDLER( lhb2_igs011_prot2_r )
// vbowl
static READ16_HANDLER( vbowl_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,4)^1) & (BIT(x,3)^1)) | ((BIT(x,2) & BIT(x,1))^1) | ((BIT(x,4) | BIT(x,0))^1);
return (b9 << 9);
@@ -1195,7 +1195,7 @@ static READ16_HANDLER( vbowl_igs011_prot2_r )
static WRITE16_HANDLER( igs012_prot_reset_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->igs012_prot = 0x00;
state->igs012_prot_swap = 0x00;
@@ -1204,7 +1204,7 @@ static WRITE16_HANDLER( igs012_prot_reset_w )
/*
static READ16_HANDLER( igs012_prot_fake_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch (offset)
{
case 0: return state->igs012_prot;
@@ -1220,29 +1220,29 @@ static READ16_HANDLER( igs012_prot_fake_r )
static WRITE16_HANDLER( igs012_prot_mode_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xcc) || MODE_AND_DATA(1, 0xdd) )
{
state->igs012_prot_mode = state->igs012_prot_mode ^ 1;
}
else
- logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xff) )
{
state->igs012_prot = (state->igs012_prot + 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_dec_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xaa) )
{
state->igs012_prot = (state->igs012_prot - 1) & 0x1f;
@@ -1252,12 +1252,12 @@ static WRITE16_HANDLER( igs012_prot_dec_inc_w )
state->igs012_prot = (state->igs012_prot + 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_dec_copy_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0x33) )
{
state->igs012_prot = state->igs012_prot_swap;
@@ -1267,23 +1267,23 @@ static WRITE16_HANDLER( igs012_prot_dec_copy_w )
state->igs012_prot = (state->igs012_prot - 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_copy_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(1, 0x22) )
{
state->igs012_prot = state->igs012_prot_swap;
}
else
- logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0x55) || MODE_AND_DATA(1, 0xa5) )
{
// !(3 | 1)..(2 & 1)..(3 ^ 0)..(!2)
@@ -1291,12 +1291,12 @@ static WRITE16_HANDLER( igs012_prot_swap_w )
state->igs012_prot_swap = (((BIT(x,3)|BIT(x,1))^1)<<3) | ((BIT(x,2)&BIT(x,1))<<2) | ((BIT(x,3)^BIT(x,0))<<1) | (BIT(x,2)^1);
}
else
- logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static READ16_HANDLER( igs012_prot_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// FIXME: mode 0 and mode 1 are mapped to different memory ranges
UINT8 x = state->igs012_prot;
@@ -1315,7 +1315,7 @@ static READ16_HANDLER( igs012_prot_r )
static WRITE16_HANDLER( drgnwrld_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1326,7 +1326,7 @@ static WRITE16_HANDLER( drgnwrld_igs003_w )
case 0x00:
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
if (data & ~0x2)
logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -1347,12 +1347,12 @@ static WRITE16_HANDLER( drgnwrld_igs003_w )
}
static READ16_HANDLER( drgnwrld_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
- case 0x02: return input_port_read(space->machine, "IN2");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
+ case 0x02: return input_port_read(space->machine(), "IN2");
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1387,12 +1387,12 @@ static READ16_HANDLER( drgnwrld_igs003_r )
static WRITE16_HANDLER( lhb_inputs_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs_input_sel);
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20 );
+ coin_counter_w(space->machine(), 0, data & 0x20 );
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1404,17 +1404,17 @@ static WRITE16_HANDLER( lhb_inputs_w )
}
static READ16_HANDLER( lhb_inputs_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(offset)
{
case 0: return state->igs_input_sel;
case 1:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(space->cpu), state->igs_input_sel);
break;
@@ -1426,7 +1426,7 @@ static READ16_HANDLER( lhb_inputs_r )
static WRITE16_HANDLER( lhb2_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1439,7 +1439,7 @@ static WRITE16_HANDLER( lhb2_igs003_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1455,7 +1455,7 @@ static WRITE16_HANDLER( lhb2_igs003_w )
{
state->lhb2_pen_hi = data & 0x07;
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x08) ? 0x40000 : 0);
}
@@ -1471,15 +1471,15 @@ static WRITE16_HANDLER( lhb2_igs003_w )
}
static READ16_HANDLER( lhb2_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
case 0x01:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
/* fall through */
default:
logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(space->cpu), state->igs003_reg[0]);
@@ -1522,7 +1522,7 @@ static READ16_HANDLER( lhb2_igs003_r )
static WRITE16_HANDLER( wlcc_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1533,10 +1533,10 @@ static WRITE16_HANDLER( wlcc_igs003_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
// coin out data & 0x02
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
state->igs_hopper = data & 0x20;
}
@@ -1553,10 +1553,10 @@ static WRITE16_HANDLER( wlcc_igs003_w )
}
static READ16_HANDLER( wlcc_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
+ case 0x00: return input_port_read(space->machine(), "IN0");
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1591,7 +1591,7 @@ static READ16_HANDLER( wlcc_igs003_r )
static WRITE16_HANDLER( xymg_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1604,7 +1604,7 @@ static WRITE16_HANDLER( xymg_igs003_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1621,17 +1621,17 @@ static WRITE16_HANDLER( xymg_igs003_w )
}
static READ16_HANDLER( xymg_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "COIN");
+ case 0x00: return input_port_read(space->machine(), "COIN");
case 0x02:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
/* fall through */
case 0x20: return 0x49;
@@ -1668,7 +1668,7 @@ static READ16_HANDLER( xymg_igs003_r )
static WRITE16_HANDLER( vbowl_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1679,8 +1679,8 @@ static WRITE16_HANDLER( vbowl_igs003_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
if (data & ~0x3)
@@ -1695,11 +1695,11 @@ static WRITE16_HANDLER( vbowl_igs003_w )
}
static READ16_HANDLER( vbowl_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
// case 0x03:
// return 0xff; // parametric bitswaps?
@@ -1744,7 +1744,7 @@ static READ16_HANDLER( vbowl_igs003_r )
// V0400O
static DRIVER_INIT( drgnwrld )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1770,7 +1770,7 @@ static DRIVER_INIT( drgnwrld )
static DRIVER_INIT( drgnwrldv30 )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1795,12 +1795,12 @@ static DRIVER_INIT( drgnwrldv30 )
static DRIVER_INIT( drgnwrldv21 )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type2_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4c0, 0xd4ff, FUNC(drgnwrldv21_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4c0, 0xd4ff, FUNC(drgnwrldv21_igs011_prot2_r));
/*
// PROTECTION CHECKS
// bp 32ee; bp 11ca8; bp 23d5e; bp 23fd0; bp 24170; bp 24348; bp 2454e; bp 246cc; bp 24922; bp 24b66; bp 24de2; bp 2502a; bp 25556; bp 269de; bp 2766a; bp 2a830
@@ -1825,7 +1825,7 @@ static DRIVER_INIT( drgnwrldv21 )
static DRIVER_INIT( drgnwrldv21j )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1852,7 +1852,7 @@ static DRIVER_INIT( drgnwrldv21j )
static DRIVER_INIT( drgnwrldv20j )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1890,7 +1890,7 @@ static DRIVER_INIT( drgnwrldv11h )
static DRIVER_INIT( drgnwrldv10c )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1916,7 +1916,7 @@ static DRIVER_INIT( drgnwrldv10c )
static DRIVER_INIT( lhb )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
@@ -1926,7 +1926,7 @@ static DRIVER_INIT( lhb )
static DRIVER_INIT( lhbv33c )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
@@ -1936,11 +1936,11 @@ static DRIVER_INIT( lhbv33c )
static DRIVER_INIT( dbc )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
dbc_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(dbc_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(dbc_igs011_prot2_r));
/*
// PROTECTION CHECKS
rom[0x04c42/2] = 0x602e; // 004C42: 6604 bne 4c48 (rom test error otherwise)
@@ -1965,11 +1965,11 @@ static DRIVER_INIT( dbc )
static DRIVER_INIT( ryukobou )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
ryukobou_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(ryukobou_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(ryukobou_igs011_prot2_r));
// PROTECTION CHECKS
// rom[0x2df68/2] = 0x4e75; // 02DF68: 4E56 FE00 link A6, #-$200 (fills palette with pink otherwise)
@@ -1978,7 +1978,7 @@ static DRIVER_INIT( ryukobou )
static DRIVER_INIT( xymg )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
/*
@@ -2012,7 +2012,7 @@ static DRIVER_INIT( xymg )
static DRIVER_INIT( wlcc )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
wlcc_decrypt(machine);
/*
@@ -2036,7 +2036,7 @@ static DRIVER_INIT( wlcc )
static DRIVER_INIT( lhb2 )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb2_decrypt(machine);
lhb2_decrypt_gfx(machine);
@@ -2058,8 +2058,8 @@ static DRIVER_INIT( lhb2 )
static DRIVER_INIT( vbowl )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine->region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2083,8 +2083,8 @@ static DRIVER_INIT( vbowl )
static DRIVER_INIT( vbowlj )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine->region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2178,7 +2178,7 @@ ADDRESS_MAP_END
// Only values 0 and 7 are written (1 bit per irq source?)
static WRITE16_HANDLER( lhb_irq_enable_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA( &state->lhb_irq_enable );
}
@@ -2191,7 +2191,7 @@ static WRITE16_DEVICE_HANDLER( lhb_okibank_w )
}
if ( data & (~0x200) )
- logerror("%s: warning, unknown bits written in oki bank = %02x\n", device->machine->describe_context(), data);
+ logerror("%s: warning, unknown bits written in oki bank = %02x\n", device->machine().describe_context(), data);
// popmessage("oki %04x",data);
}
@@ -2357,7 +2357,7 @@ ADDRESS_MAP_END
*/
static READ16_DEVICE_HANDLER( ics2115_word_r )
{
- ics2115_device* ics2115 = device->machine->device<ics2115_device>("ics");
+ ics2115_device* ics2115 = device->machine().device<ics2115_device>("ics");
switch(offset)
{
case 0: return ics2115_device::read(ics2115, (offs_t)0);
@@ -2369,7 +2369,7 @@ static READ16_DEVICE_HANDLER( ics2115_word_r )
static WRITE16_DEVICE_HANDLER( ics2115_word_w )
{
- ics2115_device* ics2115 = device->machine->device<ics2115_device>("ics");
+ ics2115_device* ics2115 = device->machine().device<ics2115_device>("ics");
switch(offset)
{
case 1:
@@ -2389,14 +2389,14 @@ static READ16_HANDLER( vbowl_unk_r )
static SCREEN_EOF( vbowl )
{
- igs011_state *state = machine->driver_data<igs011_state>();
+ igs011_state *state = machine.driver_data<igs011_state>();
state->vbowl_trackball[0] = state->vbowl_trackball[1];
state->vbowl_trackball[1] = (input_port_read(machine, "AN1") << 8) | input_port_read(machine, "AN0");
}
static WRITE16_HANDLER( vbowl_pen_hi_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if (ACCESSING_BITS_0_7)
{
state->lhb2_pen_hi = data & 0x07;
@@ -3617,7 +3617,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( lhb_interrupt )
{
- igs011_state *state = device->machine->driver_data<igs011_state>();
+ igs011_state *state = device->machine().driver_data<igs011_state>();
if (!state->lhb_irq_enable)
return;
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index f639ba586c9..7a3d3fb11bb 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -86,7 +86,7 @@ public:
static WRITE8_HANDLER( video_disable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->video_disable = data & 1;
if (data & (~1))
logerror("PC %06X: unknown bits of video_disable written = %02x\n",cpu_get_pc(space->cpu),data);
@@ -100,7 +100,7 @@ static WRITE16_HANDLER( video_disable_lsb_w )
static VIDEO_RESET( igs017 )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->video_disable = 0;
}
@@ -109,14 +109,14 @@ static VIDEO_RESET( igs017 )
static TILE_GET_INFO( get_fg_tile_info )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
int code = state->fg_videoram[tile_index*4+0] + (state->fg_videoram[tile_index*4+1] << 8);
int attr = state->fg_videoram[tile_index*4+2] + (state->fg_videoram[tile_index*4+3] << 8);
SET_TILE_INFO(0, code, COLOR(attr), TILE_FLIPXY( attr >> 5 ));
}
static TILE_GET_INFO( get_bg_tile_info )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
int code = state->bg_videoram[tile_index*4+0] + (state->bg_videoram[tile_index*4+1] << 8);
int attr = state->bg_videoram[tile_index*4+2] + (state->bg_videoram[tile_index*4+3] << 8);
SET_TILE_INFO(0, code, COLOR(attr)+8, TILE_FLIPXY( attr >> 5 ));
@@ -124,14 +124,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static WRITE8_HANDLER( fg_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset/4);
}
static WRITE8_HANDLER( bg_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset/4);
}
@@ -140,7 +140,7 @@ static WRITE8_HANDLER( bg_w )
static READ16_HANDLER( fg_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->fg_videoram[offset];
}
static WRITE16_HANDLER( fg_lsb_w )
@@ -151,7 +151,7 @@ static WRITE16_HANDLER( fg_lsb_w )
static READ16_HANDLER( bg_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->bg_videoram[offset];
}
static WRITE16_HANDLER( bg_lsb_w )
@@ -162,12 +162,12 @@ static WRITE16_HANDLER( bg_lsb_w )
static READ16_HANDLER( spriteram_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->spriteram[offset];
}
static WRITE16_HANDLER( spriteram_lsb_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->spriteram[offset] = data;
}
@@ -176,11 +176,11 @@ static WRITE16_HANDLER( spriteram_lsb_w )
// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000.
// This routine expands each word into three bytes.
-static void expand_sprites(running_machine *machine)
+static void expand_sprites(running_machine &machine)
{
- igs017_state *state = machine->driver_data<igs017_state>();
- UINT8 *rom = machine->region("sprites")->base();
- int size = machine->region("sprites")->bytes();
+ igs017_state *state = machine.driver_data<igs017_state>();
+ UINT8 *rom = machine.region("sprites")->base();
+ int size = machine.region("sprites")->bytes();
int i;
state->sprites_gfx_size = size / 2 * 3;
@@ -198,7 +198,7 @@ static void expand_sprites(running_machine *machine)
static VIDEO_START( igs017 )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -245,9 +245,9 @@ static VIDEO_START( igs017 )
***************************************************************************/
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
// prepare GfxElement on the fly
gfx_element gfx;
@@ -263,9 +263,9 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
sx, sy, 0x1f );
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
UINT8 *s = state->spriteram;
UINT8 *end = state->spriteram + 0x800;
@@ -299,10 +299,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
// A simple gfx viewer (toggle with T)
-static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
#ifdef MAME_DEBUG
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
if (input_code_pressed_once(machine, KEYCODE_T)) state->toggle = 1-state->toggle;
if (state->toggle) {
int h = 256, w = state->debug_width, a = state->debug_addr;
@@ -344,31 +344,31 @@ static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectang
static SCREEN_UPDATE( igs017 )
{
- igs017_state *state = screen->machine->driver_data<igs017_state>();
+ igs017_state *state = screen->machine().driver_data<igs017_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- if (debug_viewer(screen->machine, bitmap,cliprect))
+ if (debug_viewer(screen->machine(), bitmap,cliprect))
return 0;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->video_disable)
return 0;
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- if (layers_ctrl & 4) draw_sprites(screen->machine, bitmap, cliprect);
+ if (layers_ctrl & 4) draw_sprites(screen->machine(), bitmap, cliprect);
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -379,10 +379,10 @@ static SCREEN_UPDATE( igs017 )
Decryption
***************************************************************************/
-static void decrypt_program_rom(running_machine *machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
+static void decrypt_program_rom(running_machine &machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
{
- int length = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -432,9 +432,9 @@ static void decrypt_program_rom(running_machine *machine, int mask, int a7, int
// iqblocka
-static void iqblocka_patch_rom(running_machine *machine)
+static void iqblocka_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// rom[0x7b64] = 0xc9;
@@ -473,10 +473,10 @@ static DRIVER_INIT( iqblockf )
// tjsb
-static void tjsb_decrypt_sprites(running_machine *machine)
+static void tjsb_decrypt_sprites(running_machine &machine)
{
- int length = machine->region("sprites")->bytes();
- UINT8 *rom = machine->region("sprites")->base();
+ int length = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.region("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -503,9 +503,9 @@ static void tjsb_decrypt_sprites(running_machine *machine)
}
}
-static void tjsb_patch_rom(running_machine *machine)
+static void tjsb_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x011df] = 0x18;
}
@@ -520,10 +520,10 @@ static DRIVER_INIT( tjsb )
// mgcs
-static void mgcs_decrypt_program_rom(running_machine *machine)
+static void mgcs_decrypt_program_rom(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -570,10 +570,10 @@ static void mgcs_decrypt_program_rom(running_machine *machine)
}
}
-static void mgcs_decrypt_tiles(running_machine *machine)
+static void mgcs_decrypt_tiles(running_machine &machine)
{
- int length = machine->region("tilemaps")->bytes();
- UINT8 *rom = machine->region("tilemaps")->base();
+ int length = machine.region("tilemaps")->bytes();
+ UINT8 *rom = machine.region("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -587,10 +587,10 @@ static void mgcs_decrypt_tiles(running_machine *machine)
auto_free(machine, tmp);
}
-static void mgcs_flip_sprites(running_machine *machine)
+static void mgcs_flip_sprites(running_machine &machine)
{
- int length = machine->region("sprites")->bytes();
- UINT8 *rom = machine->region("sprites")->base();
+ int length = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.region("sprites")->base();
int i;
for (i = 0;i < length;i+=2)
@@ -608,9 +608,9 @@ static void mgcs_flip_sprites(running_machine *machine)
}
}
-static void mgcs_patch_rom(running_machine *machine)
+static void mgcs_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x4e036/2] = 0x6006;
@@ -636,7 +636,7 @@ static DRIVER_INIT( mgcs )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( tarzan )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
int i;
int size = 0x40000;
@@ -662,7 +662,7 @@ static DRIVER_INIT( tarzan )
// by iq_132
static DRIVER_INIT( tarzana )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
int size = 0x80000;
@@ -684,7 +684,7 @@ static DRIVER_INIT( tarzana )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( starzan )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
int size = 0x040000;
@@ -739,7 +739,7 @@ static DRIVER_INIT( starzan )
static DRIVER_INIT( sdmg2 )
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -796,7 +796,7 @@ static DRIVER_INIT( sdmg2 )
static DRIVER_INIT( mgdha )
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -831,7 +831,7 @@ static DRIVER_INIT( mgdh )
{
DRIVER_INIT_CALL( mgdha );
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// additional protection
rom[0x4ad50/2] = 0x4e71;
@@ -843,7 +843,7 @@ static DRIVER_INIT( mgdh )
static DRIVER_INIT( lhzb2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -933,7 +933,7 @@ static DRIVER_INIT( lhzb2 )
static DRIVER_INIT( lhzb2a )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -995,7 +995,7 @@ static DRIVER_INIT( lhzb2a )
static DRIVER_INIT( slqz2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -1082,7 +1082,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( nmi_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->nmi_enable = data & 1;
if (data & (~1))
logerror("PC %06X: nmi_enable = %02x\n",cpu_get_pc(space->cpu),data);
@@ -1090,7 +1090,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static WRITE8_HANDLER( irq_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->irq_enable = data & 1;
if (data & (~1))
logerror("PC %06X: irq_enable = %02x\n",cpu_get_pc(space->cpu),data);
@@ -1098,18 +1098,18 @@ static WRITE8_HANDLER( irq_enable_w )
static WRITE8_HANDLER( input_select_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->input_select = data;
}
static READ8_HANDLER( input_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch (state->input_select)
{
- case 0x00: return input_port_read(space->machine, "PLAYER1");
- case 0x01: return input_port_read(space->machine, "PLAYER2");
- case 0x02: return input_port_read(space->machine, "COINS");
+ case 0x00: return input_port_read(space->machine(), "PLAYER1");
+ case 0x01: return input_port_read(space->machine(), "PLAYER2");
+ case 0x02: return input_port_read(space->machine(), "COINS");
case 0x03: return 01;
@@ -1175,7 +1175,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( mgcs_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1210,7 +1210,7 @@ static WRITE16_HANDLER( mgcs_magic_w )
static READ16_HANDLER( mgcs_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x01:
@@ -1226,20 +1226,20 @@ static READ16_HANDLER( mgcs_magic_r )
static READ8_DEVICE_HANDLER( mgcs_keys_r )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x08) return input_port_read(device->machine, "KEY0");
- if (~state->input_select & 0x10) return input_port_read(device->machine, "KEY1");
- if (~state->input_select & 0x20) return input_port_read(device->machine, "KEY2");
- if (~state->input_select & 0x40) return input_port_read(device->machine, "KEY3");
- if (~state->input_select & 0x80) return input_port_read(device->machine, "KEY4");
+ igs017_state *state = device->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x08) return input_port_read(device->machine(), "KEY0");
+ if (~state->input_select & 0x10) return input_port_read(device->machine(), "KEY1");
+ if (~state->input_select & 0x20) return input_port_read(device->machine(), "KEY2");
+ if (~state->input_select & 0x40) return input_port_read(device->machine(), "KEY3");
+ if (~state->input_select & 0x80) return input_port_read(device->machine(), "KEY4");
- logerror("%s: warning, reading key with input_select = %02x\n", device->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", device->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( irq1_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->irq1_enable = data & 1;
@@ -1249,7 +1249,7 @@ static WRITE16_HANDLER( irq1_enable_w )
static WRITE16_HANDLER( irq2_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->irq2_enable = data & 1;
@@ -1261,14 +1261,14 @@ static WRITE16_HANDLER( mgcs_paletteram_xRRRRRGGGGGBBBBB_w )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = ((space->machine->generic.paletteram.u16[offset/2*2+0] & 0xff) << 8) | (space->machine->generic.paletteram.u16[offset/2*2+1] & 0xff);
+ rgb = ((space->machine().generic.paletteram.u16[offset/2*2+0] & 0xff) << 8) | (space->machine().generic.paletteram.u16[offset/2*2+1] & 0xff);
// bitswap
rgb = BITSWAP16(rgb,7,8,9,2,14,3,13,15,12,11,10,0,1,4,5,6);
- palette_set_color_rgb(space->machine, offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
+ palette_set_color_rgb(space->machine(), offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
}
static ADDRESS_MAP_START( mgcs, AS_PROGRAM, 16 )
@@ -1295,31 +1295,31 @@ static WRITE16_HANDLER( sdmg2_paletteram_xRRRRRGGGGGBBBBB_w )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = ((space->machine->generic.paletteram.u16[offset/2*2+1] & 0xff) << 8) | (space->machine->generic.paletteram.u16[offset/2*2+0] & 0xff);
+ rgb = ((space->machine().generic.paletteram.u16[offset/2*2+1] & 0xff) << 8) | (space->machine().generic.paletteram.u16[offset/2*2+0] & 0xff);
- palette_set_color_rgb(space->machine, offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
+ palette_set_color_rgb(space->machine(), offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
}
static READ8_HANDLER( sdmg2_keys_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->input_select & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->input_select & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->input_select & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->input_select & 0x10) return input_port_read(space->machine, "KEY4");
+ igs017_state *state = space->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->input_select & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->input_select & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->input_select & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->input_select & 0x10) return input_port_read(space->machine(), "KEY4");
- if (state->input_select == 0x1f) return input_port_read(space->machine, "KEY0"); // in joystick mode
+ if (state->input_select == 0x1f) return input_port_read(space->machine(), "KEY0"); // in joystick mode
- logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", space->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( sdmg2_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1333,7 +1333,7 @@ static WRITE16_HANDLER( sdmg2_magic_w )
if (ACCESSING_BITS_0_7)
{
state->input_select = data & 0x1f;
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->hopper = data & 0x80;
}
@@ -1342,7 +1342,7 @@ static WRITE16_HANDLER( sdmg2_magic_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
}
break;
@@ -1354,13 +1354,13 @@ static WRITE16_HANDLER( sdmg2_magic_w )
static READ16_HANDLER( sdmg2_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x00:
{
- UINT16 hopper_bit = (state->hopper && ((space->machine->primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(space->machine, "COINS") | hopper_bit;
+ UINT16 hopper_bit = (state->hopper && ((space->machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
+ return input_port_read(space->machine(), "COINS") | hopper_bit;
}
case 0x02:
@@ -1395,22 +1395,22 @@ ADDRESS_MAP_END
static READ8_HANDLER( mgdh_keys_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x04) return input_port_read(space->machine, "KEY0");
- if (~state->input_select & 0x08) return input_port_read(space->machine, "KEY1");
- if (~state->input_select & 0x10) return input_port_read(space->machine, "KEY2");
- if (~state->input_select & 0x20) return input_port_read(space->machine, "KEY3");
- if (~state->input_select & 0x40) return input_port_read(space->machine, "KEY4");
+ igs017_state *state = space->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x04) return input_port_read(space->machine(), "KEY0");
+ if (~state->input_select & 0x08) return input_port_read(space->machine(), "KEY1");
+ if (~state->input_select & 0x10) return input_port_read(space->machine(), "KEY2");
+ if (~state->input_select & 0x20) return input_port_read(space->machine(), "KEY3");
+ if (~state->input_select & 0x40) return input_port_read(space->machine(), "KEY4");
- if ((state->input_select & 0xfc) == 0xfc) return input_port_read(space->machine, "DSW1");
+ if ((state->input_select & 0xfc) == 0xfc) return input_port_read(space->machine(), "DSW1");
- logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", space->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( mgdha_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1422,7 +1422,7 @@ static WRITE16_HANDLER( mgdha_magic_w )
if (ACCESSING_BITS_0_7)
{
// coin out data & 0x40
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
}
if ( data & ~0xc0 )
@@ -1446,7 +1446,7 @@ static WRITE16_HANDLER( mgdha_magic_w )
if (ACCESSING_BITS_0_7)
{
// bit 7?
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x40) ? 0x40000 : 0);
}
break;
@@ -1469,22 +1469,22 @@ static WRITE16_HANDLER( mgdha_magic_w )
static READ16_HANDLER( mgdha_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x00:
return mgdh_keys_r(space, 0);
case 0x01:
- return input_port_read(space->machine, "BUTTONS");
+ return input_port_read(space->machine(), "BUTTONS");
case 0x02:
- return BITSWAP8(input_port_read(space->machine, "DSW2"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(input_port_read(space->machine(), "DSW2"), 0,1,2,3,4,5,6,7);
case 0x03:
{
- UINT16 hopper_bit = (state->hopper && ((space->machine->primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(space->machine, "COINS") | hopper_bit;
+ UINT16 hopper_bit = (state->hopper && ((space->machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
+ return input_port_read(space->machine(), "COINS") | hopper_bit;
}
default:
@@ -2066,7 +2066,7 @@ GFXDECODE_END
static INTERRUPT_GEN( iqblocka_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->nmi_enable)
@@ -2093,7 +2093,7 @@ static const ppi8255_interface iqblocka_ppi8255_intf =
static MACHINE_RESET( iqblocka )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->nmi_enable = 0;
state->irq_enable = 0;
state->input_select = 0;
@@ -2139,7 +2139,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mgcs_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->irq2_enable)
@@ -2154,7 +2154,7 @@ static INTERRUPT_GEN( mgcs_interrupt )
static MACHINE_RESET( mgcs )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
MACHINE_RESET_CALL( iqblocka );
state->irq1_enable = 0;
state->irq2_enable = 0;
@@ -2253,7 +2253,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mgdh_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->irq2_enable)
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 2c041ebb7ec..fb15c02817b 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -54,7 +54,7 @@ public:
/* CGLayer */
static WRITE32_HANDLER( igs_cg_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_cg_videoram[offset]);
//if(data!=0)
logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(space->cpu),offset ,state->igs_cg_videoram[offset]);
@@ -98,7 +98,7 @@ static WRITE32_HANDLER( igs_cg_videoram_w )
/* TX Layer */
static WRITE32_HANDLER( igs_tx_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_tx_videoram[offset]);
tilemap_mark_tile_dirty(state->igs_tx_tilemap,offset);
//if(data!=0)
@@ -107,7 +107,7 @@ static WRITE32_HANDLER( igs_tx_videoram_w )
static TILE_GET_INFO( get_tx_tilemap_tile_info )
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
//ppppppppNNNNNNNN
int tileno,colour;
tileno = state->igs_tx_videoram[tile_index] & 0xffff;
@@ -119,7 +119,7 @@ static TILE_GET_INFO( get_tx_tilemap_tile_info )
/* BG Layer */
static WRITE32_HANDLER( igs_bg_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_bg_videoram[offset]);
tilemap_mark_tile_dirty(state->igs_bg_tilemap,offset);
//if(data!=0)
@@ -128,7 +128,7 @@ static WRITE32_HANDLER( igs_bg_videoram_w )
static TILE_GET_INFO( get_bg_tilemap_tile_info )
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
//ppppppppNNNNNNNN
int tileno,colour;
tileno = state->igs_bg_videoram[tile_index] & 0xffff;
@@ -141,11 +141,11 @@ static TILE_GET_INFO( get_bg_tilemap_tile_info )
/* Pallete Layer */
static WRITE32_HANDLER( igs_pallete32_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
- space->machine->generic.paletteram.u16=(UINT16 *)state->igs_pallete32;
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
+ space->machine().generic.paletteram.u16=(UINT16 *)state->igs_pallete32;
COMBINE_DATA(&state->igs_pallete32[offset]);
- //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2,space->machine->generic.paletteram.u16[offset*2],0);
- //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2+1,space->machine->generic.paletteram.u16[offset*2+1],0);
+ //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2,space->machine().generic.paletteram.u16[offset*2],0);
+ //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2+1,space->machine().generic.paletteram.u16[offset*2+1],0);
//if(data!=0)
//fprintf(stdout,"PALLETE RAM OFFSET %x ,data %x!\n",offset ,state->igs_pallete32[offset]);
}
@@ -154,7 +154,7 @@ static WRITE32_HANDLER( igs_pallete32_w )
static VIDEO_START(igs_majhong)
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
state->igs_tx_tilemap= tilemap_create(machine, get_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
tilemap_set_transparent_pen(state->igs_tx_tilemap,15);
state->igs_bg_tilemap= tilemap_create(machine, get_bg_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
@@ -165,9 +165,9 @@ static VIDEO_START(igs_majhong)
static SCREEN_UPDATE(igs_majhong)
{
- igs_m027_state *state = screen->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = screen->machine().driver_data<igs_m027_state>();
//??????????
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
//??????
tilemap_draw(bitmap,cliprect,state->igs_bg_tilemap,0,0);
@@ -242,11 +242,11 @@ static const UINT8 sdwx_tab[] =
0x12,0x56,0x97,0x26,0x1D,0x5F,0xA7,0xF8,0x89,0x3F,0x14,0x36,0x72,0x3B,0x48,0x7B,
0xF1,0xED,0x72,0xB7,0x7A,0x56,0x05,0xDE,0x7B,0x27,0x6D,0xCF,0x33,0x4C,0x14,0x86,
};
-static void sdwx_decrypt(running_machine *machine)
+static void sdwx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine->region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.region("user1")->base();
int rom_size = 0x80000;
@@ -287,11 +287,11 @@ static void sdwx_decrypt(running_machine *machine)
-static void sdwx_gfx_decrypt(running_machine *machine)
+static void sdwx_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x80000;
- UINT8 *src = (UINT8 *) (machine->region("gfx1")->base());
+ UINT8 *src = (UINT8 *) (machine.region("gfx1")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index 17b88f72fbb..bbc6e8676d2 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -98,7 +98,7 @@ public:
static MACHINE_RESET( igs )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->nmi_enable = 0;
state->hopper = 0;
state->bg_enable = 1;
@@ -106,7 +106,7 @@ static MACHINE_RESET( igs )
static INTERRUPT_GEN( igs_interrupt )
{
- igspoker_state *state = device->machine->driver_data<igspoker_state>();
+ igspoker_state *state = device->machine().driver_data<igspoker_state>();
if (cpu_getiloops(device) % 2) {
device_set_input_line(device, 0, HOLD_LINE);
} else {
@@ -122,7 +122,7 @@ static READ8_HANDLER( igs_irqack_r )
static WRITE8_HANDLER( igs_irqack_w )
{
-// cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+// cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -130,14 +130,14 @@ static WRITE8_HANDLER( igs_irqack_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
int code = state->bg_tile_ram[tile_index];
SET_TILE_INFO(1 + (tile_index & 3), code, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -145,28 +145,28 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( bg_tile_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->bg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE8_HANDLER( fg_tile_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(igs_video)
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 64, 8);
@@ -175,8 +175,8 @@ static VIDEO_START(igs_video)
static SCREEN_UPDATE(igs_video)
{
- igspoker_state *state = screen->machine->driver_data<igspoker_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ igspoker_state *state = screen->machine().driver_data<igspoker_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// FIX: CSK227IT must have some way to disable background, or wrong gfx?
if (state->bg_enable) tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -188,13 +188,13 @@ static SCREEN_UPDATE(igs_video)
static VIDEO_START(cpokerpk)
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static SCREEN_UPDATE(cpokerpk)
{
- igspoker_state *state = screen->machine->driver_data<igspoker_state>();
+ igspoker_state *state = screen->machine().driver_data<igspoker_state>();
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -210,13 +210,13 @@ static void show_out(igspoker_state *state)
static WRITE8_HANDLER( igs_nmi_and_coins_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x20); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x20); // led for coin state->out / state->hopper active
state->nmi_enable = data & 0x80; // nmi enable?
#ifdef VERBOSE
@@ -229,7 +229,7 @@ static WRITE8_HANDLER( igs_nmi_and_coins_w )
static WRITE8_HANDLER( igs_lamps_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
/*
- Lbits -
7654 3210
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( igs_lamps_w )
static READ8_HANDLER( custom_io_r )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
#ifdef VERBOSE
logerror("PC %06X: Protection read %02x\n",cpu_get_pc(space->cpu), (int) state->protection_res);
#endif
@@ -267,14 +267,14 @@ static READ8_HANDLER( custom_io_r )
static WRITE8_HANDLER( custom_io_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
#ifdef VERBOSE
logerror("PC %06X: Protection write %02x\n",cpu_get_pc(space->cpu),data);
#endif
switch (data)
{
- case 0x00: state->protection_res = input_port_read(space->machine, "BUTTONS1"); break;
+ case 0x00: state->protection_res = input_port_read(space->machine(), "BUTTONS1"); break;
// CSK227
case 0x20: state->protection_res = 0x49; break;
case 0x21: state->protection_res = 0x47; break;
@@ -313,14 +313,14 @@ static WRITE8_HANDLER( custom_io_w )
static CUSTOM_INPUT( hopper_r )
{
- igspoker_state *state = field->port->machine->driver_data<igspoker_state>();
- if (state->hopper) return !(field->port->machine->primary_screen->frame_number()%10);
- return input_code_pressed(field->port->machine, KEYCODE_H);
+ igspoker_state *state = field->port->machine().driver_data<igspoker_state>();
+ if (state->hopper) return !(field->port->machine().primary_screen->frame_number()%10);
+ return input_code_pressed(field->port->machine(), KEYCODE_H);
}
static READ8_HANDLER( exp_rom_r )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
return rom[offset+0x10000];
}
@@ -1751,7 +1751,7 @@ ROM_END
static DRIVER_INIT( cpoker )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1765,7 +1765,7 @@ static DRIVER_INIT( cpoker )
static DRIVER_INIT( cpokert )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -1795,7 +1795,7 @@ static DRIVER_INIT( cpokert )
static DRIVER_INIT( cska )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1812,7 +1812,7 @@ static DRIVER_INIT( cska )
static DRIVER_INIT( igs_ncs )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1929,7 +1929,7 @@ Clocks
static DRIVER_INIT( igs_ncs2 )
{
- UINT8 *src = (UINT8 *) (machine->region("maincpu")->base());
+ UINT8 *src = (UINT8 *) (machine.region("maincpu")->base());
int i;
for(i = 0; i < 0x10000; i++)
@@ -2006,8 +2006,8 @@ static DRIVER_INIT( chleague )
int length;
UINT8 *rom;
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2070,8 +2070,8 @@ static DRIVER_INIT( number10 )
UINT8 *tmp;
UINT8 *rom;
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2100,8 +2100,8 @@ static DRIVER_INIT( number10 )
rom[0xeed] = 0xc3;
/* Descramble graphic */
- rom = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
tmp = auto_alloc_array(machine, UINT8, length);
memcpy(tmp,rom,length);
for (A = 0;A < length;A++)
@@ -2149,7 +2149,7 @@ ROM_END
static DRIVER_INIT( cpokerpk )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A=0x0714; A < 0xF000; A+=0x1000)
rom[A] ^= 0x20;
@@ -2203,7 +2203,7 @@ ROM_END
static DRIVER_INIT( pktet346 )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
diff --git a/src/mame/drivers/ikki.c b/src/mame/drivers/ikki.c
index 7ef6861b1ae..d54a5eab41b 100644
--- a/src/mame/drivers/ikki.c
+++ b/src/mame/drivers/ikki.c
@@ -32,8 +32,8 @@ static READ8_HANDLER( ikki_e000_r )
static WRITE8_HANDLER( ikki_coin_counters )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
/*************************************
@@ -208,7 +208,7 @@ GFXDECODE_END
static MACHINE_START( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->punch_through_pen));
@@ -216,7 +216,7 @@ static MACHINE_START( ikki )
static MACHINE_RESET( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
state->flipscreen = 0;
}
diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c
index 7477c0f2c2e..f63de189502 100644
--- a/src/mame/drivers/imolagp.c
+++ b/src/mame/drivers/imolagp.c
@@ -117,7 +117,7 @@ public:
static WRITE8_HANDLER( transmit_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->mComData[state->mComCount++] = data;
}
@@ -137,24 +137,24 @@ static READ8_HANDLER( receive_data_r )
*/
static WRITE8_HANDLER( transmit_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->mLatchedData[offset] = data;
}
static READ8_HANDLER( trigger_slave_nmi_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
return 0;
}
static READ8_HANDLER( receive_data_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
return state->mLatchedData[offset];
}
#endif
-static void initialize_colors( running_machine *machine )
+static void initialize_colors( running_machine &machine )
{
/* optional runtime remapping of colors */
static const UINT8 color[0x10][3] =
@@ -186,7 +186,7 @@ static void initialize_colors( running_machine *machine )
static VIDEO_START( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
memset(state->videoram, 0, sizeof(state->videoram));
state->save_item(NAME(state->videoram));
@@ -197,7 +197,7 @@ static VIDEO_START( imolagp )
static SCREEN_UPDATE( imolagp )
{
- imolagp_state *state = screen->machine->driver_data<imolagp_state>();
+ imolagp_state *state = screen->machine().driver_data<imolagp_state>();
int scroll2 = state->scroll ^ 0x03;
int pass;
for (pass = 0; pass < 2; pass++)
@@ -275,13 +275,13 @@ static WRITE8_HANDLER( imola_ledram_w )
static READ8_HANDLER( steerlatch_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
return state->steerlatch;
}
static WRITE8_HANDLER( screenram_w )
{ /* ?! */
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
switch (state->draw_mode)
{
case 0x82:
@@ -299,7 +299,7 @@ static WRITE8_HANDLER( screenram_w )
static READ8_HANDLER( imola_slave_port05r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
memcpy(state->videoram[2], state->videoram[1], 0x4000); /* hack! capture before sprite plane is erased */
state->draw_mode = 0x05;
return 0;
@@ -307,14 +307,14 @@ static READ8_HANDLER( imola_slave_port05r )
static READ8_HANDLER( imola_slave_port06r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x06;
return 0;
}
static READ8_HANDLER( imola_slave_port81r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x81;
memcpy(state->videoram[2], state->videoram[1], 0x4000); /* hack! capture before sprite plane is erased */
return 0;
@@ -322,20 +322,20 @@ static READ8_HANDLER( imola_slave_port81r )
static READ8_HANDLER( imola_slave_port82r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x82;
return 0;
}
static WRITE8_HANDLER( vreg_control_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->control = data;
}
static WRITE8_HANDLER( vreg_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
switch (state->control)
{
case 0x0e:
@@ -465,7 +465,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( master_interrupt )
{
- imolagp_state *state = device->machine->driver_data<imolagp_state>();
+ imolagp_state *state = device->machine().driver_data<imolagp_state>();
int which = cpu_getiloops(device);
if (which == 0)
{
@@ -477,7 +477,7 @@ static INTERRUPT_GEN( master_interrupt )
}
else
{
- int newsteer = input_port_read(device->machine, "2802") & 0xf;
+ int newsteer = input_port_read(device->machine(), "2802") & 0xf;
if (newsteer != state->oldsteer)
{
if (state->steerlatch == 0)
@@ -510,9 +510,9 @@ static const ppi8255_interface ppi8255_intf =
static MACHINE_START( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
- state->slavecpu = machine->device("slave");
+ state->slavecpu = machine.device("slave");
state->save_item(NAME(state->control));
state->save_item(NAME(state->scroll));
@@ -529,7 +529,7 @@ static MACHINE_START( imolagp )
static MACHINE_RESET( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
state->control = 0;
state->scroll = 0;
diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c
index 141dd6d62fa..6415b38e2a8 100644
--- a/src/mame/drivers/intrscti.c
+++ b/src/mame/drivers/intrscti.c
@@ -27,7 +27,7 @@ public:
static READ8_HANDLER( unk_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( intrscti_map, AS_PROGRAM, 8 )
@@ -68,11 +68,11 @@ static VIDEO_START(intrscti)
static SCREEN_UPDATE(intrscti)
{
- intrscti_state *state = screen->machine->driver_data<intrscti_state>();
+ intrscti_state *state = screen->machine().driver_data<intrscti_state>();
int y,x;
int count;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
count = 0;
for (y=0;y<64;y++)
@@ -81,7 +81,7 @@ static SCREEN_UPDATE(intrscti)
{
int dat;
dat = state->ram[count];
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
count++;
}
}
@@ -130,7 +130,7 @@ ROM_END
static DRIVER_INIT( intrscti )
{
- UINT8 *cpu = machine->region( "maincpu" )->base();
+ UINT8 *cpu = machine.region( "maincpu" )->base();
int i;
for (i=0x8000;i<0x8fff;i++)
{
diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c
index ea03f14bd08..1fea80a2974 100644
--- a/src/mame/drivers/inufuku.c
+++ b/src/mame/drivers/inufuku.c
@@ -83,7 +83,7 @@ TODO:
static WRITE16_HANDLER( inufuku_soundcommand_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
if (ACCESSING_BITS_0_7)
{
/* hack... sound doesn't work otherwise */
@@ -98,13 +98,13 @@ static WRITE16_HANDLER( inufuku_soundcommand_w )
static WRITE8_HANDLER( pending_command_clear_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( inufuku_soundrombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
/******************************************************************************
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( inufuku_soundrombank_w )
static CUSTOM_INPUT( soundflag_r )
{
- inufuku_state *state = field->port->machine->driver_data<inufuku_state>();
+ inufuku_state *state = field->port->machine().driver_data<inufuku_state>();
UINT16 soundflag = state->pending_command ? 0 : 1;
return soundflag;
@@ -298,7 +298,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- inufuku_state *state = device->machine->driver_data<inufuku_state>();
+ inufuku_state *state = device->machine().driver_data<inufuku_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -316,13 +316,13 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( inufuku )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000);
memory_set_bank(machine, "bank1", 0);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->pending_command));
state->save_item(NAME(state->bg_scrollx));
@@ -336,7 +336,7 @@ static MACHINE_START( inufuku )
static MACHINE_RESET( inufuku )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
state->pending_command = 1;
state->bg_scrollx = 0;
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index 0cb09e96683..a232c67c29a 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -60,7 +60,7 @@ Grndtour:
static WRITE8_HANDLER( iqblock_prot_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->rambase[0xe26] = data;
state->rambase[0xe27] = data;
state->rambase[0xe1c] = data;
@@ -68,7 +68,7 @@ static WRITE8_HANDLER( iqblock_prot_w )
static WRITE8_HANDLER( grndtour_prot_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->rambase[0xe39] = data;
state->rambase[0xe3a] = data;
state->rambase[0xe2f] = data;
@@ -86,25 +86,25 @@ static INTERRUPT_GEN( iqblock_interrupt )
static WRITE8_HANDLER( iqblock_irqack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static READ8_HANDLER( extrarom_r )
{
- return space->machine->region("user1")->base()[offset];
+ return space->machine().region("user1")->base()[offset];
}
static WRITE8_DEVICE_HANDLER( port_C_w )
{
- iqblock_state *state = device->machine->driver_data<iqblock_state>();
+ iqblock_state *state = device->machine().driver_data<iqblock_state>();
/* bit 4 unknown; it is pulsed at the end of every NMI */
/* bit 5 seems to be 0 during screen redraw */
state->videoenable = data & 0x20;
/* bit 6 is coin counter */
- coin_counter_w(device->machine, 0,data & 0x40);
+ coin_counter_w(device->machine(), 0,data & 0x40);
/* bit 7 could be a second coin counter, but coin 2 doesn't seem to work... */
}
@@ -427,8 +427,8 @@ ROM_END
static DRIVER_INIT( iqblock )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -440,18 +440,18 @@ static DRIVER_INIT( iqblock )
}
/* initialize pointers for I/O mapped RAM */
- machine->generic.paletteram.u8 = rom + 0x12000;
- machine->generic.paletteram2.u8 = rom + 0x12800;
+ machine.generic.paletteram.u8 = rom + 0x12000;
+ machine.generic.paletteram2.u8 = rom + 0x12800;
state->fgvideoram = rom + 0x16800;
state->bgvideoram = rom + 0x17000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe26, 0xfe26, FUNC(iqblock_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe26, 0xfe26, FUNC(iqblock_prot_w));
state->video_type=1;
}
static DRIVER_INIT( grndtour )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -463,11 +463,11 @@ static DRIVER_INIT( grndtour )
}
/* initialize pointers for I/O mapped RAM */
- machine->generic.paletteram.u8 = rom + 0x12000;
- machine->generic.paletteram2.u8 = rom + 0x12800;
+ machine.generic.paletteram.u8 = rom + 0x12000;
+ machine.generic.paletteram2.u8 = rom + 0x12800;
state->fgvideoram = rom + 0x16800;
state->bgvideoram = rom + 0x17000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe39, 0xfe39, FUNC(grndtour_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe39, 0xfe39, FUNC(grndtour_prot_w));
state->video_type=0;
}
diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c
index e8bd0a2446d..9eae20cd732 100644
--- a/src/mame/drivers/irobot.c
+++ b/src/mame/drivers/irobot.c
@@ -94,7 +94,7 @@
static WRITE8_HANDLER( irobot_nvram_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
state->m_nvram[offset] = data & 0x0f;
}
@@ -108,13 +108,13 @@ static WRITE8_HANDLER( irobot_nvram_w )
static WRITE8_HANDLER( irobot_clearirq_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE ,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE ,CLEAR_LINE);
}
static WRITE8_HANDLER( irobot_clearfirq_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE ,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE ,CLEAR_LINE);
}
diff --git a/src/mame/drivers/ironhors.c b/src/mame/drivers/ironhors.c
index 6aabbe42510..90ac2e79e63 100644
--- a/src/mame/drivers/ironhors.c
+++ b/src/mame/drivers/ironhors.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( ironhors_interrupt )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
if (cpu_getiloops(device) == 0)
{
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( ironhors_interrupt )
static WRITE8_HANDLER( ironhors_sh_irqtrigger_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
device_set_input_line_and_vector(state->soundcpu, 0, HOLD_LINE, 0xff);
}
@@ -358,9 +358,9 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( ironhors )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->palettebank));
state->save_item(NAME(state->charbank));
@@ -369,7 +369,7 @@ static MACHINE_START( ironhors )
static MACHINE_RESET( ironhors )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
state->palettebank = 0;
state->charbank = 0;
@@ -424,7 +424,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( farwest_interrupt )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
if (cpu_getiloops(device) &1)
{
@@ -440,7 +440,7 @@ static INTERRUPT_GEN( farwest_interrupt )
static READ8_DEVICE_HANDLER( farwest_soundlatch_r )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
return soundlatch_r(state->soundcpu->memory().space(AS_PROGRAM), 0);
}
diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c
index 838f931d214..ae89e076831 100644
--- a/src/mame/drivers/istellar.c
+++ b/src/mame/drivers/istellar.c
@@ -48,7 +48,7 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( istellar )
{
- istellar_state *state = screen->machine->driver_data<istellar_state>();
+ istellar_state *state = screen->machine().driver_data<istellar_state>();
int charx, chary;
/* clear */
@@ -70,7 +70,7 @@ static SCREEN_UPDATE( istellar )
{
int current_screen_character = (chary*32) + charx;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character],
(state->tile_control_ram[current_screen_character] & 0x0f),
0, 0, charx*8, chary*8, 0);
@@ -86,8 +86,8 @@ static SCREEN_UPDATE( istellar )
static MACHINE_START( istellar )
{
- istellar_state *state = machine->driver_data<istellar_state>();
- state->laserdisc = machine->device("laserdisc");
+ istellar_state *state = machine.driver_data<istellar_state>();
+ state->laserdisc = machine.device("laserdisc");
}
@@ -96,14 +96,14 @@ static MACHINE_START( istellar )
/* Z80 0 R/W */
static READ8_HANDLER(z80_0_latch1_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
/*logerror("CPU0 : reading LDP status latch (%x)\n", state->ldp_latch1);*/
return state->ldp_latch1;
}
static WRITE8_HANDLER(z80_0_latch2_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
/*logerror("CPU0 : writing cpu_latch2 (%x). Potentially followed by an IRQ.\n", data);*/
state->ldp_latch2 = data;
@@ -111,7 +111,7 @@ static WRITE8_HANDLER(z80_0_latch2_write)
if (state->z80_2_nmi_enable)
{
logerror("Executing an NMI on CPU2\n");
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
state->z80_2_nmi_enable = 0;
}
}
@@ -123,7 +123,7 @@ static WRITE8_HANDLER(z80_0_latch2_write)
/* Z80 2 R/W */
static READ8_HANDLER(z80_2_ldp_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
UINT8 readResult = laserdisc_data_r(state->laserdisc);
logerror("CPU2 : reading LDP : %x\n", readResult);
return readResult;
@@ -131,14 +131,14 @@ static READ8_HANDLER(z80_2_ldp_read)
static READ8_HANDLER(z80_2_latch2_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : reading latch2 (%x)\n", state->ldp_latch2);
return state->ldp_latch2;
}
static READ8_HANDLER(z80_2_nmienable)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : ENABLING NMI\n");
state->z80_2_nmi_enable = 1;
return 0x00;
@@ -152,14 +152,14 @@ static READ8_HANDLER(z80_2_unknown_read)
static WRITE8_HANDLER(z80_2_latch1_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : writing latch1 (%x)\n", data);
state->ldp_latch1 = data;
}
static WRITE8_HANDLER(z80_2_ldp_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : writing LDP : 0x%x\n", data);
laserdisc_data_w(state->laserdisc,data);
}
@@ -274,7 +274,7 @@ static PALETTE_INIT( istellar )
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int r,g,b;
int bit0,bit1,bit2,bit3;
@@ -330,7 +330,7 @@ static INTERRUPT_GEN( vblank_callback_istellar )
device_set_input_line(device, 0, ASSERT_LINE);
/* Interrupt presumably comes from the LDP's status strobe */
- cputag_set_input_line(device->machine, "sub", 0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "sub", 0, ASSERT_LINE);
}
@@ -411,7 +411,7 @@ ROM_END
static DRIVER_INIT( istellar )
{
- istellar_state *state = machine->driver_data<istellar_state>();
+ istellar_state *state = machine.driver_data<istellar_state>();
state->z80_2_nmi_enable = 0;
}
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index ecd0510d964..f09db6c8213 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -364,8 +364,8 @@ Notes:
-#define START_TMS_SPINNING(n) do { device_spin_until_trigger(space->cpu, 7351 + n); space->machine->driver_data<itech32_state>()->tms_spinning[n] = 1; } while (0)
-#define STOP_TMS_SPINNING(machine, n) do { machine->scheduler().trigger(7351 + n); machine->driver_data<itech32_state>()->tms_spinning[n] = 0; } while (0)
+#define START_TMS_SPINNING(n) do { device_spin_until_trigger(space->cpu, 7351 + n); space->machine().driver_data<itech32_state>()->tms_spinning[n] = 1; } while (0)
+#define STOP_TMS_SPINNING(machine, n) do { (machine).scheduler().trigger(7351 + n); (machine).driver_data<itech32_state>()->tms_spinning[n] = 0; } while (0)
@@ -392,9 +392,9 @@ INLINE int determine_irq_state(itech32_state *state, int vint, int xint, int qin
}
-void itech32_update_interrupts(running_machine *machine, int vint, int xint, int qint)
+void itech32_update_interrupts(running_machine &machine, int vint, int xint, int qint)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/* update the states */
if (vint != -1) state->vint_state = vint;
if (xint != -1) state->xint_state = xint;
@@ -418,14 +418,14 @@ void itech32_update_interrupts(running_machine *machine, int vint, int xint, int
static INTERRUPT_GEN( generate_int1 )
{
/* signal the NMI */
- itech32_update_interrupts(device->machine, 1, -1, -1);
- if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine->primary_screen->vpos());
+ itech32_update_interrupts(device->machine(), 1, -1, -1);
+ if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine().primary_screen->vpos());
}
static WRITE16_HANDLER( int1_ack_w )
{
- itech32_update_interrupts(space->machine, 0, -1, -1);
+ itech32_update_interrupts(space->machine(), 0, -1, -1);
}
@@ -438,7 +438,7 @@ static WRITE16_HANDLER( int1_ack_w )
static MACHINE_RESET( itech32 )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
state->vint_state = state->xint_state = state->qint_state = 0;
state->sound_data = 0;
state->sound_return = 0;
@@ -467,7 +467,7 @@ static MACHINE_RESET( drivedge )
static CUSTOM_INPUT( special_port_r )
{
- itech32_state *state = field->port->machine->driver_data<itech32_state>();
+ itech32_state *state = field->port->machine().driver_data<itech32_state>();
if (state->sound_int_state)
state->special_result ^= 1;
@@ -476,8 +476,8 @@ static CUSTOM_INPUT( special_port_r )
static READ16_HANDLER( trackball_r )
{
- int lower = input_port_read(space->machine, "TRACKX1");
- int upper = input_port_read(space->machine, "TRACKY1");
+ int lower = input_port_read(space->machine(), "TRACKX1");
+ int upper = input_port_read(space->machine(), "TRACKY1");
return (lower & 15) | ((upper & 15) << 4);
}
@@ -485,8 +485,8 @@ static READ16_HANDLER( trackball_r )
static READ32_HANDLER( trackball32_8bit_r )
{
- int lower = input_port_read(space->machine, "TRACKX1");
- int upper = input_port_read(space->machine, "TRACKY1");
+ int lower = input_port_read(space->machine(), "TRACKX1");
+ int upper = input_port_read(space->machine(), "TRACKY1");
return (lower & 255) | ((upper & 255) << 8);
}
@@ -494,16 +494,16 @@ static READ32_HANDLER( trackball32_8bit_r )
static READ32_HANDLER( trackball32_4bit_p1_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- attotime curtime = space->machine->time();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ attotime curtime = space->machine().time();
- if ((curtime - state->p1_lasttime) > space->machine->primary_screen->scan_period())
+ if ((curtime - state->p1_lasttime) > space->machine().primary_screen->scan_period())
{
int upper, lower;
int dx, dy;
- int curx = input_port_read(space->machine, "TRACKX1");
- int cury = input_port_read(space->machine, "TRACKY1");
+ int curx = input_port_read(space->machine(), "TRACKX1");
+ int cury = input_port_read(space->machine(), "TRACKY1");
dx = curx - state->p1_effx;
if (dx < -0x80) dx += 0x100;
@@ -531,16 +531,16 @@ static READ32_HANDLER( trackball32_4bit_p1_r )
static READ32_HANDLER( trackball32_4bit_p2_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- attotime curtime = space->machine->time();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ attotime curtime = space->machine().time();
- if ((curtime - state->p2_lasttime) > space->machine->primary_screen->scan_period())
+ if ((curtime - state->p2_lasttime) > space->machine().primary_screen->scan_period())
{
int upper, lower;
int dx, dy;
- int curx = input_port_read(space->machine, "TRACKX2");
- int cury = input_port_read(space->machine, "TRACKY2");
+ int curx = input_port_read(space->machine(), "TRACKX2");
+ int cury = input_port_read(space->machine(), "TRACKY2");
dx = curx - state->p2_effx;
if (dx < -0x80) dx += 0x100;
@@ -575,7 +575,7 @@ static READ32_HANDLER( trackball32_4bit_combined_r )
static READ32_HANDLER( drivedge_steering_r )
{
- int val = input_port_read(space->machine, "STEER") * 2 - 0x100;
+ int val = input_port_read(space->machine(), "STEER") * 2 - 0x100;
if (val < 0) val = 0x100 | (-val);
return val << 16;
}
@@ -583,7 +583,7 @@ static READ32_HANDLER( drivedge_steering_r )
static READ32_HANDLER( drivedge_gas_r )
{
- int val = input_port_read(space->machine, "GAS");
+ int val = input_port_read(space->machine(), "GAS");
return val << 16;
}
@@ -596,14 +596,14 @@ static READ32_HANDLER( drivedge_gas_r )
static READ16_HANDLER( wcbowl_prot_result_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
return state->main_ram[0x111d/2];
}
static READ32_HANDLER( itech020_prot_result_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
UINT32 result = ((UINT32 *)state->main_ram)[state->itech020_prot_address >> 2];
result >>= (~state->itech020_prot_address & 3) * 8;
return (result & 0xff) << 8;
@@ -631,7 +631,7 @@ static READ32_HANDLER( gtclass_prot_result_r )
static WRITE8_HANDLER( sound_bank_w )
{
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("soundcpu")->base()[0x10000 + data * 0x4000]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("soundcpu")->base()[0x10000 + data * 0x4000]);
}
@@ -644,7 +644,7 @@ static WRITE8_HANDLER( sound_bank_w )
static TIMER_CALLBACK( delayed_sound_data_w )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
state->sound_data = param;
state->sound_int_state = 1;
cputag_set_input_line(machine, "soundcpu", M6809_IRQ_LINE, ASSERT_LINE);
@@ -654,13 +654,13 @@ static TIMER_CALLBACK( delayed_sound_data_w )
static WRITE16_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
}
static READ32_HANDLER( sound_data32_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
return state->sound_return << 16;
}
@@ -668,14 +668,14 @@ static READ32_HANDLER( sound_data32_r )
static WRITE32_HANDLER( sound_data32_w )
{
if (ACCESSING_BITS_16_23)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), (data >> 16) & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), (data >> 16) & 0xff);
}
static READ8_HANDLER( sound_data_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- cputag_set_input_line(space->machine, "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
state->sound_int_state = 0;
return state->sound_data;
}
@@ -683,7 +683,7 @@ static READ8_HANDLER( sound_data_r )
static WRITE8_HANDLER( sound_return_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
state->sound_return = data;
}
@@ -703,7 +703,7 @@ static READ8_HANDLER( sound_data_buffer_r )
static WRITE8_DEVICE_HANDLER( drivedge_portb_out )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
// logerror("PIA port B write = %02x\n", data);
/* bit 0 controls the fan light */
@@ -712,30 +712,30 @@ static WRITE8_DEVICE_HANDLER( drivedge_portb_out )
/* bit 4 controls the ticket dispenser */
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
- set_led_status(space->machine, 1, data & 0x01);
- set_led_status(space->machine, 2, data & 0x02);
- set_led_status(space->machine, 3, data & 0x04);
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ set_led_status(space->machine(), 1, data & 0x01);
+ set_led_status(space->machine(), 2, data & 0x02);
+ set_led_status(space->machine(), 3, data & 0x04);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
static WRITE8_DEVICE_HANDLER( drivedge_turbo_light )
{
- set_led_status(device->machine, 0, data);
+ set_led_status(device->machine(), 0, data);
}
static WRITE8_DEVICE_HANDLER( pia_portb_out )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
// logerror("PIA port B write = %02x\n", data);
/* bit 4 controls the ticket dispenser */
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
@@ -775,7 +775,7 @@ static const via6522_interface drivedge_via_interface =
static WRITE8_HANDLER( firq_clear_w )
{
- cputag_set_input_line(space->machine, "soundcpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
@@ -788,68 +788,68 @@ static WRITE8_HANDLER( firq_clear_w )
static WRITE32_HANDLER( tms_reset_assert_w )
{
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
}
static WRITE32_HANDLER( tms_reset_clear_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
/* kludge to prevent crash on first boot */
if ((state->tms1_ram[0] & 0xff000000) == 0)
{
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, CLEAR_LINE);
- STOP_TMS_SPINNING(space->machine, 0);
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, CLEAR_LINE);
+ STOP_TMS_SPINNING(space->machine(), 0);
}
if ((state->tms2_ram[0] & 0xff000000) == 0)
{
- cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_RESET, CLEAR_LINE);
- STOP_TMS_SPINNING(space->machine, 1);
+ cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_RESET, CLEAR_LINE);
+ STOP_TMS_SPINNING(space->machine(), 1);
}
}
static WRITE32_HANDLER( tms1_68k_ram_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms1_ram[offset]);
if (offset == 0) COMBINE_DATA(state->tms1_boot);
- if (offset == 0x382 && state->tms_spinning[0]) STOP_TMS_SPINNING(space->machine, 0);
+ if (offset == 0x382 && state->tms_spinning[0]) STOP_TMS_SPINNING(space->machine(), 0);
if (!state->tms_spinning[0])
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms2_68k_ram_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms2_ram[offset]);
- if (offset == 0x382 && state->tms_spinning[1]) STOP_TMS_SPINNING(space->machine, 1);
+ if (offset == 0x382 && state->tms_spinning[1]) STOP_TMS_SPINNING(space->machine(), 1);
if (!state->tms_spinning[1])
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms1_trigger_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms1_ram[offset]);
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms2_trigger_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms2_ram[offset]);
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static READ32_HANDLER( drivedge_tms1_speedup_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (state->tms1_ram[0x382] == 0 && cpu_get_pc(space->cpu) == 0xee) START_TMS_SPINNING(0);
return state->tms1_ram[0x382];
}
@@ -857,7 +857,7 @@ static READ32_HANDLER( drivedge_tms1_speedup_r )
static READ32_HANDLER( drivedge_tms2_speedup_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (state->tms2_ram[0x382] == 0 && cpu_get_pc(space->cpu) == 0x809808) START_TMS_SPINNING(1);
return state->tms2_ram[0x382];
}
@@ -895,11 +895,11 @@ static READ32_DEVICE_HANDLER( timekeeper_32be_r )
void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = m_machine.driver_data<itech32_state>();
// if nvram is the main RAM, don't overwrite exception vectors
int start = (base == state->main_ram) ? 0x80 : 0x00;
for (int i = start; i < length; i++)
- ((UINT8 *)base)[i] = machine->rand();
+ ((UINT8 *)base)[i] = m_machine.rand();
// due to accessing uninitialized RAM, we need this hack
if (state->is_drivedge)
@@ -957,7 +957,7 @@ ADDRESS_MAP_END
static READ32_HANDLER( test1_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31 && !state->written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+0);
if (ACCESSING_BITS_16_23 && !state->written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+1);
if (ACCESSING_BITS_8_15 && !state->written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+2);
@@ -967,7 +967,7 @@ static READ32_HANDLER( test1_r )
static WRITE32_HANDLER( test1_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31) state->written[0x100 + offset*4+0] = 1;
if (ACCESSING_BITS_16_23) state->written[0x100 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) state->written[0x100 + offset*4+2] = 1;
@@ -977,7 +977,7 @@ static WRITE32_HANDLER( test1_w )
static READ32_HANDLER( test2_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31 && !state->written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+0);
if (ACCESSING_BITS_16_23 && !state->written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+1);
if (ACCESSING_BITS_8_15 && !state->written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+2);
@@ -987,7 +987,7 @@ static READ32_HANDLER( test2_r )
static WRITE32_HANDLER( test2_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31) state->written[0xc00 + offset*4+0] = 1;
if (ACCESSING_BITS_16_23) state->written[0xc00 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) state->written[0xc00 + offset*4+2] = 1;
@@ -3963,16 +3963,16 @@ ROM_END
*
*************************************/
-static void init_program_rom(running_machine *machine)
+static void init_program_rom(running_machine &machine)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
memcpy(state->main_ram, state->main_rom, 0x80);
}
static DRIVER_INIT( timekill )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 512;
state->planes = 2;
@@ -3982,7 +3982,7 @@ static DRIVER_INIT( timekill )
static DRIVER_INIT( hardyard )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -3992,7 +3992,7 @@ static DRIVER_INIT( hardyard )
static DRIVER_INIT( bloodstm )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -4002,20 +4002,20 @@ static DRIVER_INIT( bloodstm )
static DRIVER_INIT( drivedge )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
state->is_drivedge = 1;
- machine->device("dsp1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms1_speedup_r));
- machine->device("dsp2")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms2_speedup_r));
+ machine.device("dsp1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms1_speedup_r));
+ machine.device("dsp2")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms2_speedup_r));
}
static DRIVER_INIT( wcbowl )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/*
This is the 3 tier PCB set:
Main P/N 1059 Rev 3 (see Hot Memory PCB layout above)
@@ -4026,17 +4026,17 @@ static DRIVER_INIT( wcbowl )
state->vram_height = 1024;
state->planes = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680001, FUNC(trackball_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680001, FUNC(trackball_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x578000, 0x57ffff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680080, 0x680081, FUNC(wcbowl_prot_result_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x680080, 0x680081);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x578000, 0x57ffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680080, 0x680081, FUNC(wcbowl_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x680080, 0x680081);
}
-static void init_sftm_common(running_machine *machine, int prot_addr)
+static void init_sftm_common(running_machine &machine, int prot_addr)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -4044,8 +4044,8 @@ static void init_sftm_common(running_machine *machine, int prot_addr)
state->itech020_prot_address = prot_addr;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
}
@@ -4061,9 +4061,9 @@ static DRIVER_INIT( sftm110 )
}
-static void init_shuffle_bowl_common(running_machine *machine, int prot_addr)
+static void init_shuffle_bowl_common(running_machine &machine, int prot_addr)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/*
The newest versions of World Class Bowling are on the same exact
platform as Shuffle Shot. So We'll use the same general INIT
@@ -4076,10 +4076,10 @@ static void init_shuffle_bowl_common(running_machine *machine, int prot_addr)
state->itech020_prot_address = prot_addr;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
}
@@ -4095,10 +4095,10 @@ static DRIVER_INIT( wcbowln ) /* PIC 16C54 labeled as ITBWL-3 */
init_shuffle_bowl_common(machine, 0x1116);
}
-static void install_timekeeper(running_machine *machine)
+static void install_timekeeper(running_machine &machine)
{
- device_t *device = machine->device("m48t02");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_32be_r), FUNC(timekeeper_32be_w));
+ device_t *device = machine.device("m48t02");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_32be_r), FUNC(timekeeper_32be_w));
}
static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */
@@ -4109,9 +4109,9 @@ static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */
install_timekeeper(machine);
}
-static void init_gt_common(running_machine *machine)
+static void init_gt_common(running_machine &machine)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 2;
@@ -4130,7 +4130,7 @@ static DRIVER_INIT( gt3d )
Hacked versions of this PCB have been found with GT97
through GTClassic. This is _NOT_ a factory modification
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_8bit_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_8bit_r));
init_gt_common(machine);
}
@@ -4143,8 +4143,8 @@ static DRIVER_INIT( aama )
board share the same sound CPU code and sample ROMs.
This board has all versions of GT for it, GT3D through GTClassic
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
init_gt_common(machine);
}
@@ -4168,7 +4168,7 @@ static DRIVER_INIT( s_ver )
board: GT97 v1.21S, GT98, GT99, GT2K & GT Classic Versions 1.00S
Trackball info is read through 200202 (actually 200203).
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200200, 0x200203, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200200, 0x200203, FUNC(trackball32_4bit_p1_r));
init_gt_common(machine);
}
@@ -4182,7 +4182,7 @@ static DRIVER_INIT( gt3dl )
Player 1 trackball read through 200003
Player 2 trackball read through 200002
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_4bit_combined_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_4bit_combined_r));
init_gt_common(machine);
}
@@ -4190,7 +4190,7 @@ static DRIVER_INIT( gt3dl )
static DRIVER_INIT( gt2kp )
{
/* a little extra protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gt2kp_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gt2kp_prot_result_r));
DRIVER_INIT_CALL(aama);
/* The protection code is:
@@ -4211,7 +4211,7 @@ Label1 bne.s Label1 ; Infinite loop if result isn't 0x01
static DRIVER_INIT( gtclasscp )
{
/* a little extra protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gtclass_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gtclass_prot_result_r));
DRIVER_INIT_CALL(aama);
/* The protection code is:
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index f6c6a9805d4..b2d9b632133 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -569,10 +569,10 @@ static const via6522_interface via_interface =
*
*************************************/
-void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter)
+void itech8_update_interrupts(running_machine &machine, int periodic, int tms34061, int blitter)
{
- itech8_state *state = machine->driver_data<itech8_state>();
- device_type main_cpu_type = machine->device("maincpu")->type();
+ itech8_state *state = machine.driver_data<itech8_state>();
+ device_type main_cpu_type = machine.device("maincpu")->type();
/* update the states */
if (periodic != -1) state->periodic_int = periodic;
@@ -613,23 +613,23 @@ static TIMER_CALLBACK( irq_off )
static INTERRUPT_GEN( generate_nmi )
{
/* signal the NMI */
- itech8_update_interrupts(device->machine, 1, -1, -1);
- device->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
+ itech8_update_interrupts(device->machine(), 1, -1, -1);
+ device->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
- if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine->primary_screen->vpos());
+ if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine().primary_screen->vpos());
}
static WRITE8_HANDLER( itech8_nmi_ack_w )
{
/* doesn't seem to hold for every game (e.g., hstennis) */
-/* cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);*/
+/* cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);*/
}
static void generate_sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "soundcpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -646,25 +646,25 @@ static TIMER_CALLBACK( behind_the_beam_update );
static MACHINE_START( sstrike )
{
/* we need to update behind the beam as well */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(behind_the_beam_update), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(behind_the_beam_update), 32);
}
static MACHINE_RESET( itech8 )
{
- itech8_state *state = machine->driver_data<itech8_state>();
- device_type main_cpu_type = machine->device("maincpu")->type();
+ itech8_state *state = machine.driver_data<itech8_state>();
+ device_type main_cpu_type = machine.device("maincpu")->type();
/* make sure bank 0 is selected */
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
{
- memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x4000]);
- machine->device("maincpu")->reset();
+ memory_set_bankptr(machine, "bank1", &machine.region("maincpu")->base()[0x4000]);
+ machine.device("maincpu")->reset();
}
/* set the visible area */
if (state->visarea)
{
- machine->primary_screen->set_visible_area(state->visarea->min_x, state->visarea->max_x, state->visarea->min_y, state->visarea->max_y);
+ machine.primary_screen->set_visible_area(state->visarea->min_x, state->visarea->max_x, state->visarea->min_y, state->visarea->max_y);
state->visarea = NULL;
}
}
@@ -683,14 +683,14 @@ static TIMER_CALLBACK( behind_the_beam_update )
int interval = param & 0xff;
/* force a partial update to the current scanline */
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
/* advance by the interval, and wrap to 0 */
scanline += interval;
if (scanline >= 256) scanline = 0;
/* set a new timer */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(behind_the_beam_update), (scanline << 8) + interval);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(behind_the_beam_update), (scanline << 8) + interval);
}
@@ -705,7 +705,7 @@ static WRITE8_HANDLER( blitter_w )
{
/* bit 0x20 on address 7 controls CPU banking */
if (offset / 2 == 7)
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
/* the rest is handled by the video hardware */
itech8_blitter_w(space, offset, data);
@@ -715,7 +715,7 @@ static WRITE8_HANDLER( blitter_w )
static WRITE8_HANDLER( rimrockn_bank_w )
{
/* banking is controlled here instead of by the blitter output */
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
}
@@ -728,7 +728,7 @@ static WRITE8_HANDLER( rimrockn_bank_w )
static CUSTOM_INPUT( special_r )
{
- itech8_state *state = field->port->machine->driver_data<itech8_state>();
+ itech8_state *state = field->port->machine().driver_data<itech8_state>();
return state->pia_portb_data & 0x01;
}
@@ -741,7 +741,7 @@ static CUSTOM_INPUT( special_r )
static WRITE8_DEVICE_HANDLER( pia_porta_out )
{
- itech8_state *state = device->machine->driver_data<itech8_state>();
+ itech8_state *state = device->machine().driver_data<itech8_state>();
logerror("PIA port A write = %02x\n", data);
state->pia_porta_data = data;
}
@@ -749,7 +749,7 @@ static WRITE8_DEVICE_HANDLER( pia_porta_out )
static WRITE8_HANDLER( pia_portb_out )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
logerror("PIA port B write = %02x\n", data);
/* bit 0 provides feedback to the main CPU */
@@ -757,14 +757,14 @@ static WRITE8_HANDLER( pia_portb_out )
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
state->pia_portb_data = data;
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
{
- itech8_state *state = device->machine->driver_data<itech8_state>();
+ itech8_state *state = device->machine().driver_data<itech8_state>();
logerror("YM2203 port B write = %02x\n", data);
/* bit 0 provides feedback to the main CPU */
@@ -772,8 +772,8 @@ static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
/* bit 6 controls the diagnostic sound LED */
/* bit 7 controls the ticket dispenser */
state->pia_portb_data = data;
- ticket_dispenser_w(device->machine->device("ticket"), 0, data & 0x80);
- coin_counter_w(device->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, data & 0x80);
+ coin_counter_w(device->machine(), 0, (data & 0x20) >> 5);
}
@@ -786,7 +786,7 @@ static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
static TIMER_CALLBACK( delayed_sound_data_w )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
state->sound_data = param;
cputag_set_input_line(machine, "soundcpu", M6809_IRQ_LINE, ASSERT_LINE);
}
@@ -794,7 +794,7 @@ static TIMER_CALLBACK( delayed_sound_data_w )
static WRITE8_HANDLER( sound_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
@@ -805,14 +805,14 @@ static WRITE8_HANDLER( gtg2_sound_data_w )
((data & 0x5d) << 1) |
((data & 0x20) >> 3) |
((data & 0x02) << 5);
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
static READ8_HANDLER( sound_data_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
- cputag_set_input_line(space->machine, "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
+ itech8_state *state = space->machine().driver_data<itech8_state>();
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
return state->sound_data;
}
@@ -826,7 +826,7 @@ static READ8_HANDLER( sound_data_r )
static WRITE16_HANDLER( grom_bank16_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
if (ACCESSING_BITS_8_15)
*state->grom_bank = data >> 8;
}
@@ -1102,7 +1102,7 @@ static CUSTOM_INPUT( gtg_mux )
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(field->port->machine, tag1) & input_port_read(field->port->machine, tag2);
+ return input_port_read(field->port->machine(), tag1) & input_port_read(field->port->machine(), tag2);
}
static INPUT_PORTS_START( gtg )
@@ -2634,31 +2634,31 @@ ROM_END
static DRIVER_INIT( grmatch )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0160, 0x0160, FUNC(grmatch_palette_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0180, 0x0180, FUNC(grmatch_xscroll_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x01e0, 0x01ff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0160, 0x0160, FUNC(grmatch_palette_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0180, 0x0180, FUNC(grmatch_xscroll_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x01e0, 0x01ff);
}
static DRIVER_INIT( slikshot )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w));
}
static DRIVER_INIT( sstrike )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w));
}
static DRIVER_INIT( hstennis )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 0, 375, 0, 239 };
state->visarea = &visible;
}
@@ -2666,7 +2666,7 @@ static DRIVER_INIT( hstennis )
static DRIVER_INIT( arligntn )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 16, 389, 0, 239 };
state->visarea = &visible;
}
@@ -2674,7 +2674,7 @@ static DRIVER_INIT( arligntn )
static DRIVER_INIT( peggle )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 18, 367, 0, 239 };
state->visarea = &visible;
}
@@ -2682,7 +2682,7 @@ static DRIVER_INIT( peggle )
static DRIVER_INIT( neckneck )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 8, 375, 0, 239 };
state->visarea = &visible;
}
@@ -2691,15 +2691,15 @@ static DRIVER_INIT( neckneck )
static DRIVER_INIT( rimrockn )
{
/* additional input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0161, 0x0161, "161");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0162, 0x0162, "162");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0163, 0x0163, "163");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0164, 0x0164, "164");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0165, 0x0165, "165");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0161, 0x0161, "161");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0162, 0x0162, "162");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0163, 0x0163, "163");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0164, 0x0164, "164");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0165, 0x0165, "165");
/* different banking mechanism (disable the old one) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01a0, 0x01a0, FUNC(rimrockn_bank_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c0, 0x01df, FUNC(itech8_blitter_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01a0, 0x01a0, FUNC(rimrockn_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c0, 0x01df, FUNC(itech8_blitter_w));
}
diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c
index b01343cd78d..b97ce2be3b6 100644
--- a/src/mame/drivers/itgambl2.c
+++ b/src/mame/drivers/itgambl2.c
@@ -75,7 +75,7 @@ public:
static VIDEO_START( itgambl2 )
{
- itgambl2_state *state = machine->driver_data<itgambl2_state>();
+ itgambl2_state *state = machine.driver_data<itgambl2_state>();
state->test_x = 256;
state->test_y = 256;
state->start_offs = 0;
@@ -84,37 +84,37 @@ static VIDEO_START( itgambl2 )
/* (dirty) debug code for looking 8bpps blitter-based gfxs */
static SCREEN_UPDATE( itgambl2 )
{
- itgambl2_state *state = screen->machine->driver_data<itgambl2_state>();
+ itgambl2_state *state = screen->machine().driver_data<itgambl2_state>();
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("gfx1")->base();
+ const UINT8 *blit_ram = screen->machine().region("gfx1")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs++;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs--;
popmessage("%d %d %04x",state->test_x,state->test_y,state->start_offs);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -127,7 +127,7 @@ static SCREEN_UPDATE( itgambl2 )
color = (blit_ram[count] & 0xff)>>0;
if((x)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color];
count++;
}
diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c
index e2e11ad8af5..0575c43fe54 100644
--- a/src/mame/drivers/itgambl3.c
+++ b/src/mame/drivers/itgambl3.c
@@ -63,7 +63,7 @@ public:
static VIDEO_START( itgambl3 )
{
- itgambl3_state *state = machine->driver_data<itgambl3_state>();
+ itgambl3_state *state = machine.driver_data<itgambl3_state>();
state->test_x = 256;
state->test_y = 256;
state->start_offs = 0;
@@ -72,37 +72,37 @@ static VIDEO_START( itgambl3 )
/* (dirty) debug code for looking 8bpps blitter-based gfxs */
static SCREEN_UPDATE( itgambl3 )
{
- itgambl3_state *state = screen->machine->driver_data<itgambl3_state>();
+ itgambl3_state *state = screen->machine().driver_data<itgambl3_state>();
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("gfx1")->base();
+ const UINT8 *blit_ram = screen->machine().region("gfx1")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs++;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs--;
popmessage("%d %d %04x",state->test_x,state->test_y,state->start_offs);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -115,7 +115,7 @@ static SCREEN_UPDATE( itgambl3 )
color = (blit_ram[count] & 0xff)>>0;
if((x)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color];
count++;
}
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 89241e355e5..cffed9f2945 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -56,7 +56,7 @@ The 2 ay-8910 read ports are responsible for reading the sound commands.
static READ8_DEVICE_HANDLER( timer_r )
{
- jack_state *state = device->machine->driver_data<jack_state>();
+ jack_state *state = device->machine().driver_data<jack_state>();
/* wrong! there should be no need for timer_rate, the same function */
/* should work for both games */
@@ -66,7 +66,7 @@ static READ8_DEVICE_HANDLER( timer_r )
static WRITE8_HANDLER( jack_sh_command_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -76,17 +76,17 @@ static WRITE8_HANDLER( jack_sh_command_w )
static WRITE8_HANDLER( joinem_misc_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
- flip_screen_set(space->machine, data & 0x80);
+ jack_state *state = space->machine().driver_data<jack_state>();
+ flip_screen_set(space->machine(), data & 0x80);
state->joinem_snd_bit = data & 1;
}
static CUSTOM_INPUT( sound_check_r )
{
- jack_state *state = field->port->machine->driver_data<jack_state>();
+ jack_state *state = field->port->machine().driver_data<jack_state>();
UINT8 ret = 0;
- if ((input_port_read(field->port->machine, "IN2") & 0x80) && !state->joinem_snd_bit)
+ if ((input_port_read(field->port->machine(), "IN2") & 0x80) && !state->joinem_snd_bit)
ret = 1;
return ret;
@@ -98,7 +98,7 @@ static CUSTOM_INPUT( sound_check_r )
static READ8_HANDLER( striv_question_r )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
// Set-up the remap table for every 16 bytes
if ((offset & 0xc00) == 0x800)
@@ -114,7 +114,7 @@ static READ8_HANDLER( striv_question_r )
// Read the actual byte from question roms
else
{
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
int real_address;
real_address = state->question_address | (offset & 0x3f0) | state->remap_address[offset & 0x0f];
@@ -794,9 +794,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
state->save_item(NAME(state->joinem_snd_bit));
state->save_item(NAME(state->question_address));
@@ -806,7 +806,7 @@ static MACHINE_START( jack )
static MACHINE_RESET( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
int i;
state->joinem_snd_bit = 0;
@@ -866,7 +866,7 @@ static INTERRUPT_GEN( joinem_interrupts )
device_set_input_line(device, 0, HOLD_LINE);
else
{
- if (!(input_port_read(device->machine, "IN2") & 0x80))
+ if (!(input_port_read(device->machine(), "IN2") & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -1303,11 +1303,11 @@ ROM_END
*
*************************************/
-static void treahunt_decode( running_machine *machine )
+static void treahunt_decode( running_machine &machine )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
int data;
@@ -1350,33 +1350,33 @@ static void treahunt_decode( running_machine *machine )
static DRIVER_INIT( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 128;
}
static DRIVER_INIT( treahunt )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 128;
treahunt_decode(machine);
}
static DRIVER_INIT( zzyzzyxx )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 16;
}
static DRIVER_INIT( loverboy )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
/* this doesn't make sense.. the startup code, and irq0 have jumps to 0..
I replace the startup jump with another jump to what appears to be
the start of the game code.
ToDo: Figure out what's really going on */
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x13] = 0x01;
ROM[0x12] = 0x9d;
@@ -1386,8 +1386,8 @@ static DRIVER_INIT( loverboy )
static DRIVER_INIT( striv )
{
- jack_state *state = machine->driver_data<jack_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ jack_state *state = machine.driver_data<jack_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
UINT8 data;
int A;
@@ -1414,10 +1414,10 @@ static DRIVER_INIT( striv )
}
// Set-up the weirdest questions read ever done
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xcfff, FUNC(striv_question_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xcfff, FUNC(striv_question_r));
// Nop out unused sprites writes
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xb000, 0xb0ff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xb000, 0xb0ff);
state->timer_rate = 128;
}
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 7f119da3e31..a1068c8d732 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -85,67 +85,67 @@ Address Dir Data Description
static READ8_HANDLER( topgunbl_rotary_r )
{
- return (1 << input_port_read_safe(space->machine, offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
+ return (1 << input_port_read_safe(space->machine(), offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
}
static WRITE8_HANDLER( jackal_flipscreen_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static READ8_HANDLER( jackal_zram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->rambank[0x0020 + offset];
}
static READ8_HANDLER( jackal_voram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->rambank[0x2000 + offset];
}
static READ8_HANDLER( jackal_spriteram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->spritebank[0x3000 + offset];
}
static WRITE8_HANDLER( jackal_rambank_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
- UINT8 *rgn = space->machine->region("master")->base();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
+ UINT8 *rgn = space->machine().region("master")->base();
if (data & 0x04)
popmessage("jackal_rambank_w %02x", data);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
state->spritebank = &rgn[((data & 0x08) << 13)];
state->rambank = &rgn[((data & 0x10) << 12)];
- memory_set_bank(space->machine, "bank1", (data & 0x20) ? 1 : 0);
+ memory_set_bank(space->machine(), "bank1", (data & 0x20) ? 1 : 0);
}
static WRITE8_HANDLER( jackal_zram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->rambank[0x0020 + offset] = data;
}
static WRITE8_HANDLER( jackal_voram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
if ((offset & 0xf800) == 0)
- jackal_mark_tile_dirty(space->machine, offset & 0x3ff);
+ jackal_mark_tile_dirty(space->machine(), offset & 0x3ff);
state->rambank[0x2000 + offset] = data;
}
@@ -153,7 +153,7 @@ static WRITE8_HANDLER( jackal_voram_w )
static WRITE8_HANDLER( jackal_spriteram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->spritebank[0x3000 + offset] = data;
}
@@ -317,7 +317,7 @@ GFXDECODE_END
static INTERRUPT_GEN( jackal_interrupt )
{
- jackal_state *state = device->machine->driver_data<jackal_state>();
+ jackal_state *state = device->machine().driver_data<jackal_state>();
if (state->irq_enable)
{
@@ -335,27 +335,27 @@ static INTERRUPT_GEN( jackal_interrupt )
static MACHINE_START( jackal )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *ROM = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *ROM = machine.region("master")->base();
memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x04000], 0x8000);
memory_configure_bank(machine, "bank1", 1, 1, &ROM[0x14000], 0x8000);
memory_set_bank(machine, "bank1", 0);
- state->mastercpu = machine->device("master");
- state->slavecpu = machine->device("slave");
+ state->mastercpu = machine.device("master");
+ state->slavecpu = machine.device("slave");
state->save_item(NAME(state->irq_enable));
}
static MACHINE_RESET( jackal )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *rgn = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *rgn = machine.region("master")->base();
// HACK: running at the nominal clock rate, music stops working
// at the beginning of the game. This fixes it.
- machine->device("slave")->set_clock_scale(1.2f);
+ machine.device("slave")->set_clock_scale(1.2f);
state->rambank = rgn;
state->spritebank = rgn;
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index 15e7ee40338..45ef2827e17 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -80,7 +80,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -88,14 +88,14 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( fg_tile_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
@@ -105,21 +105,21 @@ static WRITE8_HANDLER( fg_color_w )
static WRITE8_HANDLER( bg_scroll_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->bg_scroll[offset] = data;
}
static WRITE8_HANDLER( jackie_reel1_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel1_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel1_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
@@ -128,14 +128,14 @@ static TILE_GET_INFO( get_jackie_reel1_tile_info )
static WRITE8_HANDLER( jackie_reel2_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel2_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel2_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
@@ -143,21 +143,21 @@ static TILE_GET_INFO( get_jackie_reel2_tile_info )
static WRITE8_HANDLER( jackie_reel3_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel3_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel3_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
static VIDEO_START(jackie)
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
state->reel1_tilemap = tilemap_create(machine,get_jackie_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_jackie_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_jackie_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -173,12 +173,12 @@ static VIDEO_START(jackie)
static SCREEN_UPDATE(jackie)
{
- jackie_state *state = screen->machine->driver_data<jackie_state>();
+ jackie_state *state = screen->machine().driver_data<jackie_state>();
int i,j;
int startclipmin = 0;
const rectangle &visarea = screen->visible_area();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
for (i=0;i < 0x40;i++)
{
@@ -226,7 +226,7 @@ static SCREEN_UPDATE(jackie)
static MACHINE_RESET( jackie )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
state->irq_enable = 1;
state->nmi_enable = 0;
state->hopper = 0;
@@ -235,7 +235,7 @@ static MACHINE_RESET( jackie )
static INTERRUPT_GEN( jackie_interrupt )
{
- jackie_state *state = device->machine->driver_data<jackie_state>();
+ jackie_state *state = device->machine().driver_data<jackie_state>();
if (cpu_getiloops(device) % 2) {
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -260,7 +260,7 @@ static void show_out(jackie_state *state)
static void jackie_unk_reg_lo_w( address_space *space, int offset, UINT8 data, int reg )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->unk_reg[reg][offset] &= 0xff00;
state->unk_reg[reg][offset] |= data;
show_out(state);
@@ -272,7 +272,7 @@ static WRITE8_HANDLER( jackie_unk_reg3_lo_w ) { jackie_unk_reg_lo_w( space, offs
static void jackie_unk_reg_hi_w( address_space *space, int offset, UINT8 data, int reg )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->unk_reg[reg][offset] &= 0xff;
state->unk_reg[reg][offset] |= data << 8;
show_out(state);
@@ -284,13 +284,13 @@ static WRITE8_HANDLER( jackie_unk_reg3_hi_w ) { jackie_unk_reg_hi_w( space, offs
static WRITE8_HANDLER( jackie_nmi_and_coins_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x20); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x20); // led for coin state->out / state->hopper active
state->exp_bank = (data & 0x02) ? 1 : 0; // expram bank number
state->nmi_enable = data & 0x80; // nmi enable?
@@ -301,7 +301,7 @@ static WRITE8_HANDLER( jackie_nmi_and_coins_w )
static WRITE8_HANDLER( jackie_lamps_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
/*
- Lbits -
7654 3210
@@ -328,23 +328,23 @@ static WRITE8_HANDLER( jackie_lamps_w )
static READ8_HANDLER( igs_irqack_r )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->irq_enable = 1;
return 0;
}
static WRITE8_HANDLER( igs_irqack_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
-// cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+// cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
state->out[2] = data;
show_out(state);
}
static READ8_HANDLER( expram_r )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
- UINT8 *rom = space->machine->region("gfx3")->base();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+ UINT8 *rom = space->machine().region("gfx3")->base();
offset += state->exp_bank * 0x8000;
// logerror("PC %06X: %04x = %02x\n",cpu_get_pc(space->cpu),offset,rom[offset]);
@@ -391,9 +391,9 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( hopper_r )
{
- jackie_state *state = field->port->machine->driver_data<jackie_state>();
- if (state->hopper) return !(field->port->machine->primary_screen->frame_number()%10);
- return input_code_pressed(field->port->machine, KEYCODE_H);
+ jackie_state *state = field->port->machine().driver_data<jackie_state>();
+ if (state->hopper) return !(field->port->machine().primary_screen->frame_number()%10);
+ return input_code_pressed(field->port->machine(), KEYCODE_H);
}
static INPUT_PORTS_START( jackie )
@@ -539,7 +539,7 @@ static DRIVER_INIT( jackie )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0xf000;A++)
{
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index b96f427ebc0..a79dbebce72 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -39,8 +39,8 @@ static VIDEO_START(jackpool)
static SCREEN_UPDATE(jackpool)
{
- jackpool_state *state = screen->machine->driver_data<jackpool_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ jackpool_state *state = screen->machine().driver_data<jackpool_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count;// = 0x00000/2;
int y,x;
@@ -90,27 +90,27 @@ static READ16_HANDLER( jackpool_ff_r )
static READ16_HANDLER( jackpool_io_r )
{
- jackpool_state *state = space->machine->driver_data<jackpool_state>();
+ jackpool_state *state = space->machine().driver_data<jackpool_state>();
switch(offset*2)
{
- case 0x00: return input_port_read(space->machine,"COIN1");
- case 0x04: return input_port_read(space->machine,"UNK1");
- case 0x06: return input_port_read(space->machine,"UNK2");
- case 0x08: return input_port_read(space->machine,"SERVICE1");
- case 0x0a: return input_port_read(space->machine,"SERVICE2");//probably not a button, remote?
- case 0x0c: return input_port_read(space->machine,"PAYOUT");
- case 0x0e: return input_port_read(space->machine,"START2");
- case 0x10: return input_port_read(space->machine,"HOLD3");
- case 0x12: return input_port_read(space->machine,"HOLD4");
- case 0x14: return input_port_read(space->machine,"HOLD2");
- case 0x16: return input_port_read(space->machine,"HOLD1");
- case 0x18: return input_port_read(space->machine,"HOLD5");
- case 0x1a: return input_port_read(space->machine,"START1");
- case 0x1c: return input_port_read(space->machine,"BET");
+ case 0x00: return input_port_read(space->machine(),"COIN1");
+ case 0x04: return input_port_read(space->machine(),"UNK1");
+ case 0x06: return input_port_read(space->machine(),"UNK2");
+ case 0x08: return input_port_read(space->machine(),"SERVICE1");
+ case 0x0a: return input_port_read(space->machine(),"SERVICE2");//probably not a button, remote?
+ case 0x0c: return input_port_read(space->machine(),"PAYOUT");
+ case 0x0e: return input_port_read(space->machine(),"START2");
+ case 0x10: return input_port_read(space->machine(),"HOLD3");
+ case 0x12: return input_port_read(space->machine(),"HOLD4");
+ case 0x14: return input_port_read(space->machine(),"HOLD2");
+ case 0x16: return input_port_read(space->machine(),"HOLD1");
+ case 0x18: return input_port_read(space->machine(),"HOLD5");
+ case 0x1a: return input_port_read(space->machine(),"START1");
+ case 0x1c: return input_port_read(space->machine(),"BET");
case 0x1e: return 0xff; //ticket motor
case 0x20: return 0xff; //hopper motor
- case 0x2c: return eeprom_read_bit(space->machine->device("eeprom"));
- case 0x2e: return eeprom_read_bit(space->machine->device("eeprom"));
+ case 0x2c: return eeprom_read_bit(space->machine().device("eeprom"));
+ case 0x2e: return eeprom_read_bit(space->machine().device("eeprom"));
// default: printf("R %02x\n",offset*2); break;
}
@@ -120,7 +120,7 @@ static READ16_HANDLER( jackpool_io_r )
static WRITE16_HANDLER( jackpool_io_w )
{
- jackpool_state *state = space->machine->driver_data<jackpool_state>();
+ jackpool_state *state = space->machine().driver_data<jackpool_state>();
COMBINE_DATA(&state->io[offset]);
switch(offset*2)
@@ -138,11 +138,11 @@ static WRITE16_HANDLER( jackpool_io_w )
case 0x4a: /* ---- ---x Ticket motor */break;
case 0x4c: /* ---- ---x Hopper motor */break;
case 0x4e: state->map_vreg = data & 1; break;
- case 0x50: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
- case 0x52: eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
- case 0x54: eeprom_write_bit(space->machine->device("eeprom"), data & 1); break;
-// case 0x5a: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
-// case 0x5c: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+ case 0x50: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+ case 0x52: eeprom_set_clock_line(space->machine().device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
+ case 0x54: eeprom_write_bit(space->machine().device("eeprom"), data & 1); break;
+// case 0x5a: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+// case 0x5c: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
case 0x60: break;
// default: printf("[%02x] <- %02x W\n",offset*2,data); break;
}
@@ -151,17 +151,17 @@ static WRITE16_HANDLER( jackpool_io_w )
if(offset*2 == 0x54)
{
printf("Write bit %02x\n",data);
- eeprom_write_bit(space->machine->device("eeprom"), data & 1);
+ eeprom_write_bit(space->machine().device("eeprom"), data & 1);
}
if(offset*2 == 0x52)
{
printf("Clock bit %02x\n",data);
- eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
+ eeprom_set_clock_line(space->machine().device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
}
if(offset*2 == 0x50)
{
printf("chip select bit %02x\n",data);
- eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
+ eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
}
#endif
}
@@ -294,7 +294,7 @@ ROM_END
static DRIVER_INIT( jackpool )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* patch NVRAM routine */
rom[0x9040/2] = 0x6602;
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index 139eb4bf45a..b7290b8a060 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -94,16 +94,16 @@ Notes:
static WRITE8_HANDLER( ctrl_w )
{
- jailbrek_state *state = space->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = space->machine().driver_data<jailbrek_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static INTERRUPT_GEN( jb_interrupt )
{
- jailbrek_state *state = device->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = device->machine().driver_data<jailbrek_state>();
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -111,7 +111,7 @@ static INTERRUPT_GEN( jb_interrupt )
static INTERRUPT_GEN( jb_interrupt_nmi )
{
- jailbrek_state *state = device->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = device->machine().driver_data<jailbrek_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -239,14 +239,14 @@ GFXDECODE_END
static MACHINE_START( jailbrek )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
state->save_item(NAME(state->irq_enable));
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( jailbrek )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
state->irq_enable = 0;
state->nmi_enable = 0;
}
@@ -406,7 +406,7 @@ ROM_END
static DRIVER_INIT( jailbrek )
{
- UINT8 *SPEECH_ROM = machine->region("vlm")->base();
+ UINT8 *SPEECH_ROM = machine.region("vlm")->base();
int ind;
/*
@@ -418,7 +418,7 @@ static DRIVER_INIT( jailbrek )
represents address line A13.)
*/
- if (machine->region("vlm")->bytes() == 0x4000)
+ if (machine.region("vlm")->bytes() == 0x4000)
{
for (ind = 0; ind < 0x2000; ++ind)
{
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index f7632748df3..1804de51875 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -199,7 +199,7 @@ static TILEMAP_MAPPER( range3_8x8 )
static TILE_GET_INFO( get_sc0_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc0_vram[tile_index];
SET_TILE_INFO(
3,
@@ -210,7 +210,7 @@ static TILE_GET_INFO( get_sc0_tile_info )
static TILE_GET_INFO( get_sc1_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc1_vram[tile_index];
SET_TILE_INFO(
2,
@@ -221,7 +221,7 @@ static TILE_GET_INFO( get_sc1_tile_info )
static TILE_GET_INFO( get_sc2_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc2_vram[tile_index];
SET_TILE_INFO(
1,
@@ -232,7 +232,7 @@ static TILE_GET_INFO( get_sc2_tile_info )
static TILE_GET_INFO( get_sc3_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc3_vram[tile_index];
SET_TILE_INFO(
0,
@@ -243,7 +243,7 @@ static TILE_GET_INFO( get_sc3_tile_info )
static VIDEO_START( jalmah )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->sc0_tilemap_0 = tilemap_create(machine, get_sc0_tile_info,range0_16x16,16,16,256,32);
state->sc0_tilemap_1 = tilemap_create(machine, get_sc0_tile_info,range1_16x16,16,16,128,64);
state->sc0_tilemap_2 = tilemap_create(machine, get_sc0_tile_info,range2_16x16,16,16,64,128);
@@ -290,7 +290,7 @@ static VIDEO_START( jalmah )
static VIDEO_START( urashima )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->sc0_tilemap_0 = tilemap_create(machine, get_sc0_tile_info,range0_16x16,16,16,256,32);
state->sc3_tilemap_0 = tilemap_create(machine, get_sc3_tile_info,range2_8x8,8,8,128,64);
@@ -311,10 +311,10 @@ etc.)
In the end the final results always are one bit assigned to each priority (i.e. most
priority = 8, then 4, 2 and finally 1).
***************************************************************************************/
-static void jalmah_priority_system(running_machine *machine)
+static void jalmah_priority_system(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- UINT8 *pri_rom = machine->region("user1")->base();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ UINT8 *pri_rom = machine.region("user1")->base();
UINT8 i;
UINT8 prinum[0x10];
@@ -336,9 +336,9 @@ static void jalmah_priority_system(running_machine *machine)
//popmessage("%02x %02x %02x %02x",state->sc0_prin,state->sc1_prin,state->sc2_prin,state->sc3_prin);
}
-static void draw_sc0_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[0] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc0_tilemap_0,0,0); break;
@@ -348,9 +348,9 @@ static void draw_sc0_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc1_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[1] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc1_tilemap_0,0,0); break;
@@ -360,9 +360,9 @@ static void draw_sc1_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc2_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[2] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc2_tilemap_0,0,0); break;
@@ -372,9 +372,9 @@ static void draw_sc2_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc3_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[3] & 3)
{
case 0:
@@ -386,10 +386,10 @@ static void draw_sc3_layer(running_machine *machine, bitmap_t *bitmap, const rec
static SCREEN_UPDATE( jalmah )
{
- jalmah_state *state = screen->machine->driver_data<jalmah_state>();
+ jalmah_state *state = screen->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT8 cur_prin;
- jalmah_priority_system(screen->machine);
+ jalmah_priority_system(screen->machine());
tilemap_set_scrollx(state->sc0_tilemap_0, 0, jm_scrollram[0] & 0xfff);
tilemap_set_scrollx(state->sc0_tilemap_1, 0, jm_scrollram[0] & 0x7ff);
@@ -432,14 +432,14 @@ static SCREEN_UPDATE( jalmah )
tilemap_set_scrolly(state->sc3_tilemap_2, 0, jm_scrollram[7] & 0x1ff);
tilemap_set_scrolly(state->sc3_tilemap_3, 0, jm_scrollram[7] & 0x3ff);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0xff]); //selectable by a ram address?
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0xff]); //selectable by a ram address?
for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1)
{
- if(cur_prin==state->sc0_prin) { draw_sc0_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc1_prin) { draw_sc1_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc2_prin) { draw_sc2_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc3_prin) { draw_sc3_layer(screen->machine,bitmap,cliprect); }
+ if(cur_prin==state->sc0_prin) { draw_sc0_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc1_prin) { draw_sc1_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc2_prin) { draw_sc2_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc3_prin) { draw_sc3_layer(screen->machine(),bitmap,cliprect); }
}
return 0;
@@ -447,7 +447,7 @@ static SCREEN_UPDATE( jalmah )
static SCREEN_UPDATE( urashima )
{
- jalmah_state *state = screen->machine->driver_data<jalmah_state>();
+ jalmah_state *state = screen->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
/*this game doesn't use the RANGE register at all.*/
tilemap_set_scrollx(state->sc0_tilemap_0, 0, jm_scrollram[0]);
@@ -455,7 +455,7 @@ static SCREEN_UPDATE( urashima )
tilemap_set_scrolly(state->sc0_tilemap_0, 0, jm_scrollram[4]);
tilemap_set_scrolly(state->sc3_tilemap_0, 0, jm_scrollram[7]);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x1ff]);//selectable by a ram address?
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x1ff]);//selectable by a ram address?
if(state->jm_vregs[0] & 1) { tilemap_draw(bitmap,cliprect,state->sc0_tilemap_0,0,0); }
if(state->jm_vregs[3] & 1) { tilemap_draw(bitmap,cliprect,state->sc3_tilemap_0,0,0); }
return 0;
@@ -463,7 +463,7 @@ static SCREEN_UPDATE( urashima )
static WRITE16_HANDLER( sc0_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc0_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc0_tilemap_0,offset);
@@ -477,7 +477,7 @@ static WRITE16_HANDLER( sc0_vram_w )
static WRITE16_HANDLER( sc3_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc3_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc3_tilemap_0,offset);
@@ -489,7 +489,7 @@ static WRITE16_HANDLER( sc3_vram_w )
static WRITE16_HANDLER( sc1_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc1_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc1_tilemap_0,offset);
@@ -503,7 +503,7 @@ static WRITE16_HANDLER( sc1_vram_w )
static WRITE16_HANDLER( sc2_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc2_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc2_tilemap_0,offset);
@@ -517,7 +517,7 @@ static WRITE16_HANDLER( sc2_vram_w )
static WRITE16_HANDLER( jalmah_tilebank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
/*
xxxx ---- fg bank (used by suchipi)
---- xxxx Priority number (trusted,see mjzoomin)
@@ -540,7 +540,7 @@ static WRITE16_HANDLER( jalmah_tilebank_w )
static WRITE16_HANDLER( jalmah_scroll_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT16 *jm_vregs = state->jm_vregs;
//logerror("[%04x]<-%04x\n",(offset+0x10)*2,data);
@@ -570,7 +570,7 @@ static WRITE16_HANDLER( jalmah_scroll_w )
static WRITE16_HANDLER( urashima_bank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if (ACCESSING_BITS_0_7)
{
if (state->sc0bank != (data & 0x0f))
@@ -585,14 +585,14 @@ static WRITE16_HANDLER( urashima_bank_w )
static WRITE16_HANDLER( urashima_sc0_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc0_vram[offset]);
tilemap_mark_tile_dirty(state->sc0_tilemap_0,offset);
}
static WRITE16_HANDLER( urashima_sc3_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc3_vram[offset]);
tilemap_mark_tile_dirty(state->sc3_tilemap_0,offset);
}
@@ -600,7 +600,7 @@ static WRITE16_HANDLER( urashima_sc3_vram_w )
/*Urashima Mahjong uses a bigger (and mostly unused/wasted) video register ram.*/
static WRITE16_HANDLER( urashima_vregs_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT16 *jm_vregs = state->jm_vregs;
//logerror("[%04x]<-%04x\n",(offset)*2,data);
@@ -685,10 +685,10 @@ static WRITE16_HANDLER( urashima_dma_w )
}
/*same as $f00c0 sub-routine,but with additional work-around,to remove from here...*/
-static void daireika_palette_dma(running_machine *machine, UINT16 val)
+static void daireika_palette_dma(running_machine &machine, UINT16 val)
{
- //jalmah_state *state = machine->driver_data<jalmah_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ //jalmah_state *state = machine.driver_data<jalmah_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 index_1, index_2, src_addr, tmp_addr;
/*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */
/*a1=88000*/
@@ -707,9 +707,9 @@ static void daireika_palette_dma(running_machine *machine, UINT16 val)
}
/*RAM-based protection handlings*/
-static void daireika_mcu_run(running_machine *machine)
+static void daireika_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != state->dma_old))
@@ -757,9 +757,9 @@ static void daireika_mcu_run(running_machine *machine)
jm_shared_ram[0x00e/2] = state->prg_prot;
}
-static void mjzoomin_mcu_run(running_machine *machine)
+static void mjzoomin_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
@@ -796,15 +796,15 @@ static void mjzoomin_mcu_run(running_machine *machine)
MCU_READ("KEY1", 0x0002, 0x000/2, 0x13); /*CHI (trusted)*/
MCU_READ("KEY0", 0x0004, 0x000/2, 0x14); /*START1*/
}
- jm_shared_ram[0x00c/2] = machine->rand() & 0xffff;
+ jm_shared_ram[0x00c/2] = machine.rand() & 0xffff;
state->prg_prot++;
if(state->prg_prot > 0x10) { state->prg_prot = 0; }
jm_shared_ram[0x00e/2] = state->prg_prot;
}
-static void urashima_mcu_run(running_machine *machine)
+static void urashima_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
@@ -841,15 +841,15 @@ static void urashima_mcu_run(running_machine *machine)
MCU_READ("KEY1", 0x0002, 0x300/2, 0x13); /*CHI (trusted)*/
MCU_READ("KEY0", 0x0004, 0x300/2, 0x14); /*START1*/
}
- jm_shared_ram[0x30c/2] = machine->rand() & 0xffff;
+ jm_shared_ram[0x30c/2] = machine.rand() & 0xffff;
state->prg_prot++;
if(state->prg_prot > 0x10) { state->prg_prot = 0; }
jm_shared_ram[0x30e/2] = state->prg_prot;
}
-static void second_mcu_run(running_machine *machine)
+static void second_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
{
@@ -884,13 +884,13 @@ static void second_mcu_run(running_machine *machine)
// MCU_READ("KEY0", 0x0004, 0x7b8/2, 0x03); /*START1(correct?) */
}
- jm_shared_ram[0x20c/2] = machine->rand() & 0xffff; //kakumei2
+ jm_shared_ram[0x20c/2] = machine.rand() & 0xffff; //kakumei2
}
static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim )
{
- jalmah_state *state = timer.machine->driver_data<jalmah_state>();
+ jalmah_state *state = timer.machine().driver_data<jalmah_state>();
switch(state->mcu_prg)
{
/*
@@ -901,12 +901,12 @@ static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim )
#define KAKUMEI2_MCU (0x22)
#define SUCHIPI_MCU (0x23)
*/
- case MJZOOMIN_MCU: mjzoomin_mcu_run(timer.machine); break;
- case DAIREIKA_MCU: daireika_mcu_run(timer.machine); break;
- case URASHIMA_MCU: urashima_mcu_run(timer.machine); break;
+ case MJZOOMIN_MCU: mjzoomin_mcu_run(timer.machine()); break;
+ case DAIREIKA_MCU: daireika_mcu_run(timer.machine()); break;
+ case URASHIMA_MCU: urashima_mcu_run(timer.machine()); break;
case KAKUMEI_MCU:
case KAKUMEI2_MCU:
- case SUCHIPI_MCU: second_mcu_run(timer.machine); break;
+ case SUCHIPI_MCU: second_mcu_run(timer.machine()); break;
}
}
@@ -919,10 +919,10 @@ Basic driver start
static WRITE16_HANDLER( jalmah_okirom_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
state->oki_rom = data & 1;
@@ -937,10 +937,10 @@ static WRITE16_HANDLER( jalmah_okirom_w )
static WRITE16_HANDLER( jalmah_okibank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
state->oki_bank = data & 3;
@@ -953,7 +953,7 @@ static WRITE16_HANDLER( jalmah_okibank_w )
static WRITE16_HANDLER( jalmah_flip_screen_w )
{
/*---- ----x flip screen*/
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
// popmessage("%04x",data);
}
@@ -1344,7 +1344,7 @@ GFXDECODE_END
static MACHINE_RESET ( jalmah )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->respcount = 0;
/*check if we are into service or normal mode*/
switch(state->mcu_prg)
@@ -1708,7 +1708,7 @@ MCU code snippets
static READ16_HANDLER( urashima_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x99, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x9c, 0xd8, 0x00,
@@ -1734,7 +1734,7 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU?
*/
static WRITE16_HANDLER( urashima_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
if(ACCESSING_BITS_0_7 && data)
@@ -1928,7 +1928,7 @@ static WRITE16_HANDLER( urashima_mcu_w )
static READ16_HANDLER( daireika_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x99, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x9c, 0xd8, 0x00,
@@ -1957,7 +1957,7 @@ static const UINT16 dai_mcu_code[0x11] = { 0x33c5, 0x0010, 0x07fe, 0x3a39,0x000f
static WRITE16_HANDLER( daireika_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
UINT16 i;
@@ -2210,7 +2210,7 @@ static WRITE16_HANDLER( daireika_mcu_w )
static READ16_HANDLER( mjzoomin_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x9c, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x99, 0xd8, 0x00,
@@ -2235,7 +2235,7 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU?
*/
static WRITE16_HANDLER( mjzoomin_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
if(ACCESSING_BITS_0_7 && data)
@@ -2349,7 +2349,7 @@ static WRITE16_HANDLER( mjzoomin_mcu_w )
static READ16_HANDLER( kakumei_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x8a, 0xd8, 0x00,
0x3c, 0x7c, 0x00,
0x99, 0xd8, 0x00,
@@ -2371,7 +2371,7 @@ static READ16_HANDLER( kakumei_mcu_r )
static READ16_HANDLER( suchipi_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x8a, 0xd8, 0x00,
0x3c, 0x7c, 0x00,
0x99, 0xd8, 0x00,
@@ -2393,51 +2393,51 @@ static READ16_HANDLER( suchipi_mcu_r )
static DRIVER_INIT( urashima )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(urashima_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(urashima_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(urashima_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(urashima_mcu_w) );
state->mcu_prg = 0x12;
}
static DRIVER_INIT( daireika )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(daireika_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(daireika_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(daireika_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(daireika_mcu_w) );
state->mcu_prg = 0x11;
}
static DRIVER_INIT( mjzoomin )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(mjzoomin_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(mjzoomin_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(mjzoomin_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(mjzoomin_mcu_w) );
state->mcu_prg = 0x13;
}
static DRIVER_INIT( kakumei )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
state->mcu_prg = 0x21;
}
static DRIVER_INIT( kakumei2 )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
state->mcu_prg = 0x22;
}
static DRIVER_INIT( suchipi )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(suchipi_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(suchipi_mcu_r) );
state->mcu_prg = 0x23;
}
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index a09ddc18875..e65f814cce3 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -86,7 +86,7 @@ static PALETTE_INIT( jangou )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -114,14 +114,14 @@ static PALETTE_INIT( jangou )
static VIDEO_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
state->save_item(NAME(state->blit_buffer));
}
static SCREEN_UPDATE( jangou )
{
- jangou_state *state = screen->machine->driver_data<jangou_state>();
+ jangou_state *state = screen->machine().driver_data<jangou_state>();
int x, y;
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
@@ -132,8 +132,8 @@ static SCREEN_UPDATE( jangou )
for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
{
UINT32 srcpix = *src++;
- *dst++ = screen->machine->pens[srcpix & 0xf];
- *dst++ = screen->machine->pens[(srcpix >> 4) & 0xf];
+ *dst++ = screen->machine().pens[srcpix & 0xf];
+ *dst++ = screen->machine().pens[(srcpix >> 4) & 0xf];
}
}
@@ -151,9 +151,9 @@ h [$16]
w [$17]
*/
-static UINT8 jangou_gfx_nibble( running_machine *machine, UINT16 niboffset )
+static UINT8 jangou_gfx_nibble( running_machine &machine, UINT16 niboffset )
{
- const UINT8 *const blit_rom = machine->region("gfx")->base();
+ const UINT8 *const blit_rom = machine.region("gfx")->base();
if (niboffset & 1)
return (blit_rom[(niboffset >> 1) & 0xffff] & 0xf0) >> 4;
@@ -161,9 +161,9 @@ static UINT8 jangou_gfx_nibble( running_machine *machine, UINT16 niboffset )
return (blit_rom[(niboffset >> 1) & 0xffff] & 0x0f);
}
-static void plot_jangou_gfx_pixel( running_machine *machine, UINT8 pix, int x, int y )
+static void plot_jangou_gfx_pixel( running_machine &machine, UINT8 pix, int x, int y )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
if (y < 0 || y >= 512)
return;
if (x < 0 || x >= 512)
@@ -177,7 +177,7 @@ static void plot_jangou_gfx_pixel( running_machine *machine, UINT8 pix, int x, i
static WRITE8_HANDLER( blitter_process_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
int src, x, y, h, w, flipx;
state->blit_data[offset] = data;
@@ -208,14 +208,14 @@ static WRITE8_HANDLER( blitter_process_w )
{
int drawx = (x + xcount) & 0xff;
int drawy = (y + ycount) & 0xff;
- UINT8 dat = jangou_gfx_nibble(space->machine, src + count);
+ UINT8 dat = jangou_gfx_nibble(space->machine(), src + count);
UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4];
UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0];
dat = cur_pen_lo | (cur_pen_hi << 4);
if ((dat & 0xff) != 0)
- plot_jangou_gfx_pixel(space->machine, dat, drawx, drawy);
+ plot_jangou_gfx_pixel(space->machine(), dat, drawx, drawy);
if (!flipx)
count--;
@@ -229,7 +229,7 @@ static WRITE8_HANDLER( blitter_process_w )
/* What is the bit 5 (0x20) for?*/
static WRITE8_HANDLER( blit_vregs_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
// printf("%02x %02x\n", offset, data);
state->pen_data[offset] = data & 0xf;
@@ -243,7 +243,7 @@ static WRITE8_HANDLER( blit_vregs_w )
static WRITE8_HANDLER( mux_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->mux_data = ~data;
}
@@ -255,30 +255,30 @@ static WRITE8_HANDLER( output_w )
---- ---x coin counter
*/
// printf("%02x\n", data);
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
// flip_screen_set(data & 0x04);
-// coin_lockout_w(space->machine, 0, ~data & 0x20);
+// coin_lockout_w(space->machine(), 0, ~data & 0x20);
}
static READ8_DEVICE_HANDLER( input_mux_r )
{
- jangou_state *state = device->machine->driver_data<jangou_state>();
+ jangou_state *state = device->machine().driver_data<jangou_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL1_1");
- case 0x02: return input_port_read(device->machine, "PL1_2");
- case 0x04: return input_port_read(device->machine, "PL2_1");
- case 0x08: return input_port_read(device->machine, "PL2_2");
- case 0x10: return input_port_read(device->machine, "PL1_3");
- case 0x20: return input_port_read(device->machine, "PL2_3");
+ case 0x01: return input_port_read(device->machine(), "PL1_1");
+ case 0x02: return input_port_read(device->machine(), "PL1_2");
+ case 0x04: return input_port_read(device->machine(), "PL2_1");
+ case 0x08: return input_port_read(device->machine(), "PL2_2");
+ case 0x10: return input_port_read(device->machine(), "PL1_3");
+ case 0x20: return input_port_read(device->machine(), "PL2_3");
}
- return input_port_read(device->machine, "IN_NOMUX");
+ return input_port_read(device->machine(), "IN_NOMUX");
}
static READ8_DEVICE_HANDLER( input_system_r )
{
- return input_port_read(device->machine, "SYSTEM");
+ return input_port_read(device->machine(), "SYSTEM");
}
@@ -290,14 +290,14 @@ static READ8_DEVICE_HANDLER( input_system_r )
static WRITE8_HANDLER( sound_latch_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->cpu_1, INPUT_LINE_NMI, ASSERT_LINE);
}
static READ8_HANDLER( sound_latch_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
device_set_input_line(state->cpu_1, INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space, 0);
}
@@ -305,13 +305,13 @@ static READ8_HANDLER( sound_latch_r )
/* Jangou HC-55516 CVSD */
static WRITE8_HANDLER( cvsd_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->cvsd_shiftreg = data;
}
static TIMER_CALLBACK( cvsd_bit_timer_callback )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
/* Data is shifted out at the MSB */
hc55516_digit_w(state->cvsd, (state->cvsd_shiftreg >> 7) & 1);
@@ -326,13 +326,13 @@ static TIMER_CALLBACK( cvsd_bit_timer_callback )
/* Jangou Lady MSM5218 (MSM5205-compatible) ADPCM */
static WRITE8_HANDLER( adpcm_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->adpcm_byte = data;
}
static void jngolady_vclk_cb( device_t *device )
{
- jangou_state *state = device->machine->driver_data<jangou_state>();
+ jangou_state *state = device->machine().driver_data<jangou_state>();
if (state->msm5205_vclk_toggle == 0)
msm5205_data_w(device, state->adpcm_byte >> 4);
@@ -354,13 +354,13 @@ static void jngolady_vclk_cb( device_t *device )
static READ8_HANDLER( master_com_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
return state->z80_latch;
}
static WRITE8_HANDLER( master_com_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
device_set_input_line(state->nsc, 0, HOLD_LINE);
state->nsc_latch = data;
@@ -368,13 +368,13 @@ static WRITE8_HANDLER( master_com_w )
static READ8_HANDLER( slave_com_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
return state->nsc_latch;
}
static WRITE8_HANDLER( slave_com_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->z80_latch = data;
}
@@ -890,10 +890,10 @@ static const msm5205_interface msm5205_config =
static SOUND_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
/* Create a timer to feed the CVSD DAC with sample bits */
- state->cvsd_bit_timer = machine->scheduler().timer_alloc(FUNC(cvsd_bit_timer_callback));
+ state->cvsd_bit_timer = machine.scheduler().timer_alloc(FUNC(cvsd_bit_timer_callback));
state->cvsd_bit_timer->adjust(attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024));
}
@@ -906,12 +906,12 @@ static SOUND_START( jangou )
static MACHINE_START( common )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
- state->cpu_0 = machine->device("cpu0");
- state->cpu_1 = machine->device("cpu1");
- state->cvsd = machine->device("cvsd");
- state->nsc = machine->device("nsc");
+ state->cpu_0 = machine.device("cpu0");
+ state->cpu_1 = machine.device("cpu1");
+ state->cvsd = machine.device("cvsd");
+ state->nsc = machine.device("nsc");
state->save_item(NAME(state->pen_data));
state->save_item(NAME(state->blit_data));
@@ -920,7 +920,7 @@ static MACHINE_START( common )
static MACHINE_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_START_CALL(common);
@@ -930,7 +930,7 @@ static MACHINE_START( jangou )
static MACHINE_START( jngolady )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_START_CALL(common);
@@ -942,7 +942,7 @@ static MACHINE_START( jngolady )
static MACHINE_RESET( common )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
int i;
state->mux_data = 0;
@@ -956,7 +956,7 @@ static MACHINE_RESET( common )
static MACHINE_RESET( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_RESET_CALL(common);
@@ -966,7 +966,7 @@ static MACHINE_RESET( jangou )
static MACHINE_RESET( jngolady )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_RESET_CALL(common);
@@ -1355,19 +1355,19 @@ ROM_END
/*Temporary kludge for make the RNG work*/
static READ8_HANDLER( jngolady_rng_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static DRIVER_INIT( jngolady )
{
- machine->device("nsc")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08, 0x08, FUNC(jngolady_rng_r) );
+ machine.device("nsc")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08, 0x08, FUNC(jngolady_rng_r) );
}
static DRIVER_INIT (luckygrl)
{
// this is WRONG
int A;
- UINT8 *ROM = machine->region("cpu0")->base();
+ UINT8 *ROM = machine.region("cpu0")->base();
unsigned char patn1[32] = {
0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0,
@@ -1393,7 +1393,7 @@ static DRIVER_INIT (luckygrl)
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 622d8c94959..ea21dd2af9e 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -127,14 +127,14 @@ public:
static VIDEO_START(jantotsu)
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
state->save_item(NAME(state->bitmap));
}
static SCREEN_UPDATE(jantotsu)
{
- jantotsu_state *state = screen->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = screen->machine().driver_data<jantotsu_state>();
int x, y, i;
int count = 0;
@@ -161,7 +161,7 @@ static SCREEN_UPDATE(jantotsu)
color |= state->col_bank;
if ((x + i) <= screen->visible_area().max_x && (y + 0) < screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x + i) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x + i) = screen->machine().pens[color];
}
count++;
@@ -174,19 +174,19 @@ static SCREEN_UPDATE(jantotsu)
/* banked vram */
static READ8_HANDLER( jantotsu_bitmap_r )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
return state->bitmap[offset + ((state->vram_bank & 3) * 0x2000)];
}
static WRITE8_HANDLER( jantotsu_bitmap_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->bitmap[offset + ((state->vram_bank & 3) * 0x2000)] = data;
}
static WRITE8_HANDLER( bankaddr_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->vram_bank = ((data & 0xc0) >> 6);
@@ -231,21 +231,21 @@ static PALETTE_INIT( jantotsu )
/*Multiplexer is mapped as 6-bits reads,bits 6 & 7 are always connected to the coin mechs.*/
static READ8_HANDLER( jantotsu_mux_r )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
- UINT8 coin_port = input_port_read(space->machine, "COINS");
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
+ UINT8 coin_port = input_port_read(space->machine(), "COINS");
// printf("%02x\n", state->mux_data);
switch (state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "PL1_1") | coin_port;
- case 0x02: return input_port_read(space->machine, "PL1_2") | coin_port;
- case 0x04: return input_port_read(space->machine, "PL1_3") | coin_port;
- case 0x08: return input_port_read(space->machine, "PL1_4") | coin_port;
- case 0x10: return input_port_read(space->machine, "PL2_1") | coin_port;
- case 0x20: return input_port_read(space->machine, "PL2_2") | coin_port;
- case 0x40: return input_port_read(space->machine, "PL2_3") | coin_port;
- case 0x80: return input_port_read(space->machine, "PL2_4") | coin_port;
+ case 0x01: return input_port_read(space->machine(), "PL1_1") | coin_port;
+ case 0x02: return input_port_read(space->machine(), "PL1_2") | coin_port;
+ case 0x04: return input_port_read(space->machine(), "PL1_3") | coin_port;
+ case 0x08: return input_port_read(space->machine(), "PL1_4") | coin_port;
+ case 0x10: return input_port_read(space->machine(), "PL2_1") | coin_port;
+ case 0x20: return input_port_read(space->machine(), "PL2_2") | coin_port;
+ case 0x40: return input_port_read(space->machine(), "PL2_3") | coin_port;
+ case 0x80: return input_port_read(space->machine(), "PL2_4") | coin_port;
}
return coin_port;
@@ -253,7 +253,7 @@ static READ8_HANDLER( jantotsu_mux_r )
static WRITE8_HANDLER( jantotsu_mux_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->mux_data = ~data;
}
@@ -263,12 +263,12 @@ static WRITE8_HANDLER( jantotsu_mux_w )
a side-by-side test (to know if the background colors really works) to be sure. */
static READ8_HANDLER( jantotsu_dsw2_r )
{
- return (input_port_read(space->machine, "DSW2") & 0x3f) | 0x80;
+ return (input_port_read(space->machine(), "DSW2") & 0x3f) | 0x80;
}
static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
{
- jantotsu_state *state = device->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = device->machine().driver_data<jantotsu_state>();
switch (offset)
{
@@ -293,7 +293,7 @@ static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
static void jan_adpcm_int( device_t *device )
{
- jantotsu_state *state = device->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = device->machine().driver_data<jantotsu_state>();
if (state->adpcm_pos >= 0x10000 || state->adpcm_idle)
{
@@ -303,7 +303,7 @@ static void jan_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -478,7 +478,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( jantotsu )
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
state->save_item(NAME(state->vram_bank));
state->save_item(NAME(state->mux_data));
@@ -490,7 +490,7 @@ static MACHINE_START( jantotsu )
static MACHINE_RESET( jantotsu )
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
/*Load hard-wired background color.*/
state->col_bank = (input_port_read(machine, "DSW2") & 0xc0) >> 3;
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 07a40415c5b..b26a5d6344e 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -209,14 +209,14 @@ public:
***************************************************************************/
-static void jchan_mcu_run(running_machine *machine)
+static void jchan_mcu_run(running_machine &machine)
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
UINT16 mcu_command = state->mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = state->mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
UINT16 mcu_subcmd = state->mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
- logerror("%s : MCU executed command: %04X %04X %04X ",machine->describe_context(),mcu_command,mcu_offset*2,mcu_subcmd);
+ logerror("%s : MCU executed command: %04X %04X %04X ",machine.describe_context(),mcu_command,mcu_offset*2,mcu_subcmd);
/*
the only MCU commands found in program code are:
@@ -237,7 +237,7 @@ static void jchan_mcu_run(running_machine *machine)
case 0x03: // DSW
{
state->mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine->describe_context(),mcu_command,mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine.describe_context(),mcu_command,mcu_offset*2);
}
break;
@@ -263,7 +263,7 @@ static void jchan_mcu_run(running_machine *machine)
#define JCHAN_MCU_COM_W(_n_) \
static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \
{ \
- jchan_state *state = space->machine->driver_data<jchan_state>(); \
+ jchan_state *state = space->machine().driver_data<jchan_state>(); \
COMBINE_DATA(&state->mcu_com[_n_]); \
if (state->mcu_com[0] != 0xFFFF) return; \
if (state->mcu_com[1] != 0xFFFF) return; \
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \
if (state->mcu_com[3] != 0xFFFF) return; \
\
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- jchan_mcu_run(space->machine); \
+ jchan_mcu_run(space->machine()); \
}
JCHAN_MCU_COM_W(0)
@@ -300,7 +300,7 @@ static READ16_HANDLER( jchan_mcu_status_r )
// move was performed
static INTERRUPT_GEN( jchan_vblank )
{
- jchan_state *state = device->machine->driver_data<jchan_state>();
+ jchan_state *state = device->machine().driver_data<jchan_state>();
int i = cpu_getiloops(device);
switch (i)
{
@@ -321,15 +321,15 @@ static INTERRUPT_GEN( jchan_vblank )
{
case 0:
- cputag_set_input_line(device->machine, "sub", 1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 1, HOLD_LINE);
break;
case 220:
- cputag_set_input_line(device->machine, "sub", 2, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 2, HOLD_LINE);
break;
case 100:
- cputag_set_input_line(device->machine, "sub", 3, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 3, HOLD_LINE);
break;
}
@@ -341,20 +341,20 @@ static INTERRUPT_GEN( jchan_vblank )
static VIDEO_START(jchan)
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
/* so we can use suprnova.c */
state->sprite_ram32_1 = auto_alloc_array(machine, UINT32, 0x4000/4);
state->sprite_ram32_2 = auto_alloc_array(machine, UINT32, 0x4000/4);
- machine->generic.spriteram_size = 0x4000;
+ machine.generic.spriteram_size = 0x4000;
state->sprite_regs32_1 = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_regs32_2 = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_bitmap_1 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
state->sprite_bitmap_2 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
- state->spritegen1 = machine->device<sknsspr_device>("spritegen1");
- state->spritegen2 = machine->device<sknsspr_device>("spritegen2");
+ state->spritegen1 = machine.device<sknsspr_device>("spritegen1");
+ state->spritegen2 = machine.device<sknsspr_device>("spritegen2");
state->spritegen1->skns_sprite_kludge(0,0);
@@ -371,7 +371,7 @@ static VIDEO_START(jchan)
static SCREEN_UPDATE(jchan)
{
- jchan_state *state = screen->machine->driver_data<jchan_state>();
+ jchan_state *state = screen->machine().driver_data<jchan_state>();
int x,y;
UINT16* src1;
UINT16* src2;
@@ -379,15 +379,15 @@ static SCREEN_UPDATE(jchan)
UINT16 pixdata1;
UINT16 pixdata2;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
SCREEN_UPDATE_CALL(jchan_view2);
bitmap_fill(state->sprite_bitmap_1, cliprect, 0x0000);
bitmap_fill(state->sprite_bitmap_2, cliprect, 0x0000);
- state->spritegen1->skns_draw_sprites(screen->machine, state->sprite_bitmap_1, cliprect, state->sprite_ram32_1, 0x4000, screen->machine->region("gfx1")->base(), screen->machine->region ("gfx1")->bytes(), state->sprite_regs32_1 );
- state->spritegen2->skns_draw_sprites(screen->machine, state->sprite_bitmap_2, cliprect, state->sprite_ram32_2, 0x4000, screen->machine->region("gfx2")->base(), screen->machine->region ("gfx2")->bytes(), state->sprite_regs32_2 );
+ state->spritegen1->skns_draw_sprites(screen->machine(), state->sprite_bitmap_1, cliprect, state->sprite_ram32_1, 0x4000, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->sprite_regs32_1 );
+ state->spritegen2->skns_draw_sprites(screen->machine(), state->sprite_bitmap_2, cliprect, state->sprite_ram32_2, 0x4000, screen->machine().region("gfx2")->base(), screen->machine().region ("gfx2")->bytes(), state->sprite_regs32_2 );
// ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
for (y=0;y<240;y++)
@@ -430,19 +430,19 @@ static SCREEN_UPDATE(jchan)
static WRITE16_HANDLER( jchan_ctrl_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
state->irq_sub_enable = data & 0x8000; // hack / guess!
}
static READ16_HANDLER ( jchan_ctrl_r )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
switch(offset)
{
- case 0/2: return input_port_read(space->machine, "P1");
- case 2/2: return input_port_read(space->machine, "P2");
- case 4/2: return input_port_read(space->machine, "SYSTEM");
- case 6/2: return input_port_read(space->machine, "EXTRA");
+ case 0/2: return input_port_read(space->machine(), "P1");
+ case 2/2: return input_port_read(space->machine(), "P2");
+ case 4/2: return input_port_read(space->machine(), "SYSTEM");
+ case 6/2: return input_port_read(space->machine(), "EXTRA");
default: logerror("jchan_ctrl_r unknown!"); break;
}
return state->ctrl[offset];
@@ -457,23 +457,23 @@ static READ16_HANDLER ( jchan_ctrl_r )
/* communications - hacky! */
static WRITE16_HANDLER( main2sub_cmd_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->mainsub_shared_ram[0x03ffe/2]);
- cputag_set_input_line(space->machine, "sub", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 4, HOLD_LINE);
}
// is this called?
static WRITE16_HANDLER( sub2main_cmd_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->mainsub_shared_ram[0x0000/2]);
- cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE);
}
/* ram convert for suprnova (requires 32-bit stuff) */
static WRITE16_HANDLER( jchan_suprnova_sprite32_1_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->spriteram_1[offset]);
offset>>=1;
state->sprite_ram32_1[offset]=(state->spriteram_1[offset*2+1]<<16) | (state->spriteram_1[offset*2]);
@@ -481,7 +481,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32_1_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32regs_1_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->sprregs_1[offset]);
offset>>=1;
state->sprite_regs32_1[offset]=(state->sprregs_1[offset*2+1]<<16) | (state->sprregs_1[offset*2]);
@@ -489,7 +489,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32regs_1_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32_2_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->spriteram_2[offset]);
offset>>=1;
state->sprite_ram32_2[offset]=(state->spriteram_2[offset*2+1]<<16) | (state->spriteram_2[offset*2]);
@@ -497,7 +497,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32_2_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32regs_2_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->sprregs_2[offset]);
offset>>=1;
state->sprite_regs32_2[offset]=(state->sprregs_2[offset*2+1]<<16) | (state->sprregs_2[offset*2]);
@@ -786,16 +786,16 @@ ROM_END
static DRIVER_INIT( jchan )
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
DRIVER_INIT_CALL( decrypt_toybox_rom );
// install these here, putting them in the memory map causes issues
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x403ffe, 0x403fff, FUNC(main2sub_cmd_w) );
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(sub2main_cmd_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x403ffe, 0x403fff, FUNC(main2sub_cmd_w) );
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(sub2main_cmd_w) );
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) );
- machine->device<nvram_device>("nvram")->set_base(state->nvram_data, sizeof(state->nvram_data));
+ machine.device<nvram_device>("nvram")->set_base(state->nvram_data, sizeof(state->nvram_data));
}
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index 6806a8edaeb..00333c1dbcc 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -125,7 +125,7 @@
static TIMER_CALLBACK( generate_interrupt )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
int scanline = param;
/* IRQ is set by /32V */
@@ -136,13 +136,13 @@ static TIMER_CALLBACK( generate_interrupt )
scanline += 32;
if (scanline > 256)
scanline = 32;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static WRITE8_HANDLER( main_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
}
@@ -155,14 +155,14 @@ static WRITE8_HANDLER( main_irq_ack_w )
static MACHINE_START( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* set a timer to run the interrupts */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(generate_interrupt));
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(32), 32);
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(generate_interrupt));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(32), 32);
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* set up save state */
state->save_item(NAME(state->nvram_enabled));
@@ -178,7 +178,7 @@ static MACHINE_START( jedi )
static MACHINE_RESET( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* init globals */
state->a2d_select = 0;
@@ -195,9 +195,9 @@ static MACHINE_RESET( jedi )
static WRITE8_HANDLER( rom_banksel_w )
{
- if (data & 0x01) memory_set_bank(space->machine, "bank1", 0);
- if (data & 0x02) memory_set_bank(space->machine, "bank1", 1);
- if (data & 0x04) memory_set_bank(space->machine, "bank1", 2);
+ if (data & 0x01) memory_set_bank(space->machine(), "bank1", 0);
+ if (data & 0x02) memory_set_bank(space->machine(), "bank1", 1);
+ if (data & 0x04) memory_set_bank(space->machine(), "bank1", 2);
}
@@ -210,13 +210,13 @@ static WRITE8_HANDLER( rom_banksel_w )
static READ8_HANDLER( a2d_data_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
UINT8 ret = 0;
switch (state->a2d_select)
{
- case 0: ret = input_port_read(space->machine, "STICKY"); break;
- case 2: ret = input_port_read(space->machine, "STICKX"); break;
+ case 0: ret = input_port_read(space->machine(), "STICKY"); break;
+ case 2: ret = input_port_read(space->machine(), "STICKX"); break;
}
return ret;
@@ -225,7 +225,7 @@ static READ8_HANDLER( a2d_data_r )
static WRITE8_HANDLER( a2d_select_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->a2d_select = offset;
}
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( a2d_select_w )
static WRITE8_HANDLER( jedi_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -246,7 +246,7 @@ static WRITE8_HANDLER( jedi_coin_counter_w )
static WRITE8_HANDLER( nvram_data_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
if (state->nvram_enabled)
state->m_nvram[offset] = data;
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( nvram_data_w )
static WRITE8_HANDLER( nvram_enable_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->nvram_enabled = ~offset & 1;
}
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index a77d049eeb5..e84cb53be37 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -116,7 +116,7 @@ public:
static WRITE8_HANDLER( jokrwild_videoram_w )
{
- jokrwild_state *state = space->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = space->machine().driver_data<jokrwild_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -124,7 +124,7 @@ static WRITE8_HANDLER( jokrwild_videoram_w )
static WRITE8_HANDLER( jokrwild_colorram_w )
{
- jokrwild_state *state = space->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = space->machine().driver_data<jokrwild_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( jokrwild_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- jokrwild_state *state = machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = machine.driver_data<jokrwild_state>();
/* - bits -
7654 3210
xx-- ---- bank select.
@@ -148,14 +148,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jokrwild )
{
- jokrwild_state *state = machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = machine.driver_data<jokrwild_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 24, 26);
}
static SCREEN_UPDATE( jokrwild )
{
- jokrwild_state *state = screen->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = screen->machine().driver_data<jokrwild_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -184,7 +184,7 @@ static READ8_HANDLER( rng_r )
if(cpu_get_pc(space->cpu) == 0xab3a)
return (offset == 2) ? 0x49 : 0x92;
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
/*************************
@@ -551,7 +551,7 @@ static DRIVER_INIT( jokrwild )
*****************************************************************************/
{
int i, offs;
- UINT8 *srcp = machine->region( "maincpu" )->base();
+ UINT8 *srcp = machine.region( "maincpu" )->base();
for (i = 0x8000; i < 0x10000; i++)
{
diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c
index 24337aae2d8..f3494adde7e 100644
--- a/src/mame/drivers/jollyjgr.c
+++ b/src/mame/drivers/jollyjgr.c
@@ -131,14 +131,14 @@ public:
static WRITE8_HANDLER( jollyjgr_videoram_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( jollyjgr_attrram_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
if (offset & 1)
{
@@ -158,7 +158,7 @@ static WRITE8_HANDLER( jollyjgr_attrram_w )
static WRITE8_HANDLER( jollyjgr_misc_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
// they could be swapped, because it always set "data & 3"
state->flip_x = data & 1;
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( jollyjgr_misc_w )
static WRITE8_HANDLER( jollyjgr_coin_lookout_w )
{
- coin_lockout_global_w(space->machine, data & 1);
+ coin_lockout_global_w(space->machine(), data & 1);
/* bits 4, 5, 6 and 7 are used too */
}
@@ -425,7 +425,7 @@ static PALETTE_INIT( jollyjgr )
/* Tilemap is the same as in Galaxian */
static TILE_GET_INFO( get_bg_tile_info )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
int color = state->colorram[((tile_index & 0x1f) << 1) | 1] & 7;
int region = (state->tilemap_bank & 0x20) ? 2 : 0;
SET_TILE_INFO(region, state->videoram[tile_index], color, 0);
@@ -433,16 +433,16 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
int x, y, count;
int i, bit0, bit1, bit2;
int color;
@@ -479,7 +479,7 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
static SCREEN_UPDATE( jollyjgr )
{
- jollyjgr_state *state = screen->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = screen->machine().driver_data<jollyjgr_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -488,7 +488,7 @@ static SCREEN_UPDATE( jollyjgr )
if(state->pri) //used in Frog & Spiders level 3
{
if(!(state->bitmap_disable))
- draw_bitmap(screen->machine, bitmap);
+ draw_bitmap(screen->machine(), bitmap);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
@@ -497,7 +497,7 @@ static SCREEN_UPDATE( jollyjgr )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if(!(state->bitmap_disable))
- draw_bitmap(screen->machine, bitmap);
+ draw_bitmap(screen->machine(), bitmap);
}
/* Sprites are the same as in Galaxian */
@@ -524,7 +524,7 @@ static SCREEN_UPDATE( jollyjgr )
if (offs < 3 * 4)
sy++;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
code,color,
flipx,flipy,
sx,sy,0);
@@ -535,7 +535,7 @@ static SCREEN_UPDATE( jollyjgr )
static SCREEN_UPDATE( fspider )
{
- jollyjgr_state *state = screen->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = screen->machine().driver_data<jollyjgr_state>();
// Draw bg and sprites
SCREEN_UPDATE_CALL(jollyjgr);
@@ -608,7 +608,7 @@ GFXDECODE_END
static INTERRUPT_GEN( jollyjgr_interrupt )
{
- jollyjgr_state *state = device->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = device->machine().driver_data<jollyjgr_state>();
if(state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -616,7 +616,7 @@ static INTERRUPT_GEN( jollyjgr_interrupt )
static MACHINE_START( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->flip_x));
@@ -627,7 +627,7 @@ static MACHINE_START( jollyjgr )
static MACHINE_RESET( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->nmi_enable = 0;
state->flip_x = 0;
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 093c4fbb636..11e8ea82fd3 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -61,7 +61,7 @@ static VIDEO_START( jongkyo )
static SCREEN_UPDATE( jongkyo )
{
- jongkyo_state *state = screen->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = screen->machine().driver_data<jongkyo_state>();
int y;
for (y = 0; y < 256; ++y)
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( jongkyo )
static WRITE8_HANDLER( bank_select_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
int mask = 1 << (offset >> 1);
state->rom_bank &= ~mask;
@@ -119,12 +119,12 @@ static WRITE8_HANDLER( bank_select_w )
if (offset & 1)
state->rom_bank |= mask;
- memory_set_bank(space->machine, "bank1", state->rom_bank);
+ memory_set_bank(space->machine(), "bank1", state->rom_bank);
}
static WRITE8_HANDLER( mux_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
state->mux_data = ~data;
// printf("%02x\n", state->mux_data);
}
@@ -132,54 +132,54 @@ static WRITE8_HANDLER( mux_w )
static WRITE8_HANDLER( jongkyo_coin_counter_w )
{
/* bit 1 = coin counter */
- coin_counter_w(space->machine, 0, data & 2);
+ coin_counter_w(space->machine(), 0, data & 2);
/* bit 2 always set? */
}
static READ8_DEVICE_HANDLER( input_1p_r )
{
- jongkyo_state *state = device->machine->driver_data<jongkyo_state>();
- UINT8 cr_clear = input_port_read(device->machine, "CR_CLEAR");
+ jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
+ UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL1_1") | cr_clear;
- case 0x02: return input_port_read(device->machine, "PL1_2") | cr_clear;
- case 0x04: return input_port_read(device->machine, "PL1_3") | cr_clear;
- case 0x08: return input_port_read(device->machine, "PL1_4") | cr_clear;
- case 0x10: return input_port_read(device->machine, "PL1_5") | cr_clear;
- case 0x20: return input_port_read(device->machine, "PL1_6") | cr_clear;
+ case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
+ case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
+ case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
+ case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
+ case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
+ case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
}
// printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL1_1") & input_port_read(device->machine, "PL1_2") & input_port_read(device->machine, "PL1_3") &
- input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear;
+ return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
+ input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
}
static READ8_DEVICE_HANDLER( input_2p_r )
{
- jongkyo_state *state = device->machine->driver_data<jongkyo_state>();
- UINT8 coin_port = input_port_read(device->machine, "COINS");
+ jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
+ UINT8 coin_port = input_port_read(device->machine(), "COINS");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL2_1") | coin_port;
- case 0x02: return input_port_read(device->machine, "PL2_2") | coin_port;
- case 0x04: return input_port_read(device->machine, "PL2_3") | coin_port;
- case 0x08: return input_port_read(device->machine, "PL2_4") | coin_port;
- case 0x10: return input_port_read(device->machine, "PL2_5") | coin_port;
- case 0x20: return input_port_read(device->machine, "PL2_6") | coin_port;
+ case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
+ case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
+ case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
+ case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
+ case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
+ case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
}
// printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL2_1") & input_port_read(device->machine, "PL2_2") & input_port_read(device->machine, "PL2_3") &
- input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port;
+ return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
+ input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
}
static WRITE8_HANDLER( videoram2_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
state->videoram2[offset] = data;
}
@@ -427,7 +427,7 @@ INPUT_PORTS_END
static PALETTE_INIT(jongkyo)
{
int i;
- UINT8* proms = machine->region("proms")->base();
+ UINT8* proms = machine.region("proms")->base();
for (i = 0; i < 0x40; i++)
{
int data = proms[i];
@@ -466,7 +466,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( jongkyo )
{
- jongkyo_state *state = machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = machine.driver_data<jongkyo_state>();
state->save_item(NAME(state->videoram2));
state->save_item(NAME(state->rom_bank));
@@ -475,7 +475,7 @@ static MACHINE_START( jongkyo )
static MACHINE_RESET( jongkyo )
{
- jongkyo_state *state = machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = machine.driver_data<jongkyo_state>();
state->rom_bank = 0;
state->mux_data = 0;
@@ -548,7 +548,7 @@ ROM_END
static DRIVER_INIT( jongkyo )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0x6000; i < 0x9000; ++i)
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 7bb5a8d10ce..9b6317133bb 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -101,9 +101,9 @@
*
*************************************/
-static void update_irqs(running_machine *machine)
+static void update_irqs(running_machine &machine)
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
cputag_set_input_line(machine, "maincpu", 2, state->tms_irq ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -117,7 +117,7 @@ static void update_irqs(running_machine *machine)
static MACHINE_START( jpmimpct )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
state_save_register_global(machine, state->tms_irq);
state_save_register_global(machine, state->duart_1_irq);
state_save_register_global(machine, state->touch_cnt);
@@ -132,7 +132,7 @@ static MACHINE_START( jpmimpct )
static MACHINE_RESET( jpmimpct )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
memset(&state->duart_1, 0, sizeof(state->duart_1));
/* Reset states */
@@ -151,12 +151,12 @@ static MACHINE_RESET( jpmimpct )
static WRITE16_HANDLER( m68k_tms_w )
{
- tms34010_host_w(space->machine->device("dsp"), offset, data);
+ tms34010_host_w(space->machine().device("dsp"), offset, data);
}
static READ16_HANDLER( m68k_tms_r )
{
- return tms34010_host_r(space->machine->device("dsp"), offset);
+ return tms34010_host_r(space->machine().device("dsp"), offset);
}
@@ -190,17 +190,17 @@ static READ16_HANDLER( m68k_tms_r )
static TIMER_DEVICE_CALLBACK( duart_1_timer_event )
{
- jpmimpct_state *state = timer.machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = timer.machine().driver_data<jpmimpct_state>();
state->duart_1.tc = 0;
state->duart_1.ISR |= 0x08;
state->duart_1_irq = 1;
- update_irqs(timer.machine);
+ update_irqs(timer.machine());
}
static READ16_HANDLER( duart_1_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
struct duart_t &duart_1 = state->duart_1;
UINT16 val = 0xffff;
switch (offset)
@@ -242,20 +242,20 @@ static READ16_HANDLER( duart_1_r )
}
case 0xd:
{
- val = input_port_read(space->machine, "TEST/DEMO");
+ val = input_port_read(space->machine(), "TEST/DEMO");
break;
}
case 0xe:
{
attotime rate = attotime::from_hz(MC68681_1_CLOCK) * (16 * duart_1.CT);
- timer_device *duart_timer = space->machine->device<timer_device>("duart_1_timer");
+ timer_device *duart_timer = space->machine().device<timer_device>("duart_1_timer");
duart_timer->adjust(rate, 0, rate);
break;
}
case 0xf:
{
state->duart_1_irq = 0;
- update_irqs(space->machine);
+ update_irqs(space->machine());
duart_1.ISR |= ~0x8;
break;
}
@@ -266,7 +266,7 @@ static READ16_HANDLER( duart_1_r )
static WRITE16_HANDLER( duart_1_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
struct duart_t &duart_1 = state->duart_1;
//int old_val;
switch (offset)
@@ -353,18 +353,18 @@ static WRITE16_HANDLER( duart_1_w )
*/
static READ16_HANDLER( duart_2_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
switch (offset)
{
case 0x9:
{
if (state->touch_cnt == 0)
{
- if ( input_port_read(space->machine, "TOUCH") & 0x1 )
+ if ( input_port_read(space->machine(), "TOUCH") & 0x1 )
{
state->touch_data[0] = 0x2a;
- state->touch_data[1] = 0x7 - (input_port_read(space->machine, "TOUCH_Y") >> 5) + 0x30;
- state->touch_data[2] = (input_port_read(space->machine, "TOUCH_X") >> 5) + 0x30;
+ state->touch_data[1] = 0x7 - (input_port_read(space->machine(), "TOUCH_Y") >> 5) + 0x30;
+ state->touch_data[2] = (input_port_read(space->machine(), "TOUCH_X") >> 5) + 0x30;
/* Return RXRDY */
return 0x1;
@@ -428,22 +428,22 @@ static READ16_HANDLER( inputs1_r )
{
case 0:
{
- val = input_port_read(space->machine, "DSW");
+ val = input_port_read(space->machine(), "DSW");
break;
}
case 2:
{
- val = input_port_read(space->machine, "SW2");
+ val = input_port_read(space->machine(), "SW2");
break;
}
case 4:
{
- val = input_port_read(space->machine, "SW1");
+ val = input_port_read(space->machine(), "SW1");
break;
}
case 9:
{
- val = input_port_read(space->machine, "COINS");
+ val = input_port_read(space->machine(), "COINS");
break;
}
}
@@ -519,7 +519,7 @@ static READ16_HANDLER( jpmio_r )
static WRITE16_HANDLER( jpmio_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
switch (offset)
{
case 0x02:
@@ -781,9 +781,9 @@ INPUT_PORTS_END
static void jpmimpct_tms_irq(device_t *device, int state)
{
- jpmimpct_state *drvstate = device->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *drvstate = device->machine().driver_data<jpmimpct_state>();
drvstate->tms_irq = state;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static const tms34010_config tms_config =
@@ -1058,7 +1058,7 @@ static READ8_DEVICE_HANDLER( hopper_c_r )
static WRITE8_DEVICE_HANDLER( payen_a_w )
{
- jpmimpct_state *state = device->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = device->machine().driver_data<jpmimpct_state>();
if ( data )
{
if ( data & 0x10 )
@@ -1087,7 +1087,7 @@ static const ppi8255_interface ppi8255_intf[1] =
static MACHINE_START( impctawp )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
state_save_register_global(machine, state->duart_1_irq);
state_save_register_global(machine, state->touch_cnt);
state_save_register_global_array(machine, state->touch_data);
@@ -1108,7 +1108,7 @@ static MACHINE_START( impctawp )
static MACHINE_RESET( impctawp )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
memset(&state->duart_1, 0, sizeof(state->duart_1));
/* Reset states */
@@ -1140,7 +1140,7 @@ static MACHINE_RESET( impctawp )
*/
static READ16_HANDLER( optos_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
int i;
for (i=0; i<6; i++)
@@ -1159,7 +1159,7 @@ static READ16_HANDLER( optos_r )
static WRITE16_HANDLER( jpmioawp_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
int i;
switch (offset)
{
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 261614590e7..0c214d23402 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -80,7 +80,7 @@ enum int_levels
*
*************************************/
-static void tms_interrupt(running_machine *machine, int state)
+static void tms_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INT_TMS34061, state);
}
@@ -144,7 +144,7 @@ static READ16_HANDLER( sys5_tms34061_r )
static WRITE16_HANDLER( ramdac_w )
{
- jpmsys5_state *state = space->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = space->machine().driver_data<jpmsys5_state>();
if (offset == 0)
{
state->pal_addr = data;
@@ -157,7 +157,7 @@ static WRITE16_HANDLER( ramdac_w )
if (++state->pal_idx == 3)
{
/* Update the MAME palette */
- palette_set_color_rgb(space->machine, state->pal_addr, pal6bit(state->palette[state->pal_addr][0]), pal6bit(state->palette[state->pal_addr][1]), pal6bit(state->palette[state->pal_addr][2]));
+ palette_set_color_rgb(space->machine(), state->pal_addr, pal6bit(state->palette[state->pal_addr][0]), pal6bit(state->palette[state->pal_addr][1]), pal6bit(state->palette[state->pal_addr][2]));
state->pal_addr++;
state->pal_idx = 0;
}
@@ -182,7 +182,7 @@ static SCREEN_UPDATE( jpmsys5v )
if (state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -196,8 +196,8 @@ static SCREEN_UPDATE( jpmsys5v )
UINT8 pen = src[(x-cliprect->min_x)>>1];
/* Draw two 4-bit pixels */
- *dest++ = screen->machine->pens[(pen >> 4) & 0xf];
- *dest++ = screen->machine->pens[pen & 0xf];
+ *dest++ = screen->machine().pens[(pen >> 4) & 0xf];
+ *dest++ = screen->machine().pens[pen & 0xf];
}
}
@@ -213,15 +213,15 @@ static SCREEN_UPDATE( jpmsys5v )
static WRITE16_HANDLER( rombank_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
data &= 0x1f;
- memory_set_bankptr(space->machine, "bank1", &rom[0x20000 + 0x20000 * data]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[0x20000 + 0x20000 * data]);
}
static READ16_HANDLER( coins_r )
{
if (offset == 2)
- return input_port_read(space->machine, "COINS") << 8;
+ return input_port_read(space->machine(), "COINS") << 8;
else
return 0xffff;
}
@@ -244,7 +244,7 @@ static WRITE16_HANDLER( mux_w )
static READ16_HANDLER( mux_r )
{
if (offset == 0x81/2)
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
return 0xffff;
}
@@ -264,7 +264,7 @@ static WRITE16_DEVICE_HANDLER( jpm_upd7759_w )
}
else
{
- logerror("%s: upd7759: Unknown write to %x with %x\n", device->machine->describe_context(), offset, data);
+ logerror("%s: upd7759: Unknown write to %x with %x\n", device->machine().describe_context(), offset, data);
}
}
@@ -318,7 +318,7 @@ ADDRESS_MAP_END
/* Serial bit transmission callback */
static TIMER_CALLBACK( touch_cb )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
switch (state->touch_state)
{
case IDLE:
@@ -368,15 +368,15 @@ static TIMER_CALLBACK( touch_cb )
static INPUT_CHANGED( touchscreen_press )
{
- jpmsys5_state *state = field->port->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = field->port->machine().driver_data<jpmsys5_state>();
if (newval == 0)
{
attotime rx_period = attotime::from_hz(10000) * 16;
/* Each touch screen packet is 3 bytes */
state->touch_data[0] = 0x2a;
- state->touch_data[1] = 0x7 - (input_port_read(field->port->machine, "TOUCH_Y") >> 5) + 0x30;
- state->touch_data[2] = (input_port_read(field->port->machine, "TOUCH_X") >> 5) + 0x30;
+ state->touch_data[1] = 0x7 - (input_port_read(field->port->machine(), "TOUCH_Y") >> 5) + 0x30;
+ state->touch_data[2] = (input_port_read(field->port->machine(), "TOUCH_X") >> 5) + 0x30;
/* Start sending the data to the 68000 serially */
state->touch_data_count = 0;
@@ -464,7 +464,7 @@ INPUT_PORTS_END
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6840PTM, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6840PTM, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface ptm_intf =
@@ -484,26 +484,26 @@ static const ptm6840_interface ptm_intf =
static WRITE_LINE_DEVICE_HANDLER( acia_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6850ACIA, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6850ACIA, state ? CLEAR_LINE : ASSERT_LINE);
}
/* Clocks are incorrect */
static READ_LINE_DEVICE_HANDLER( a0_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a0_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a0_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a0_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a0_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a0_acia_dcd;
}
@@ -521,19 +521,19 @@ static ACIA6850_INTERFACE( acia0_if )
static READ_LINE_DEVICE_HANDLER( a1_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a1_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a1_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a1_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a1_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a1_acia_dcd;
}
@@ -551,19 +551,19 @@ static ACIA6850_INTERFACE( acia1_if )
static READ_LINE_DEVICE_HANDLER( a2_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a2_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a2_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a2_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a2_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a2_acia_dcd;
}
@@ -588,14 +588,14 @@ static ACIA6850_INTERFACE( acia2_if )
static MACHINE_START( jpmsys5v )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
- state->touch_timer = machine->scheduler().timer_alloc(FUNC(touch_cb));
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
+ state->touch_timer = machine.scheduler().timer_alloc(FUNC(touch_cb));
}
static MACHINE_RESET( jpmsys5v )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
state->touch_timer->reset();
state->touch_state = IDLE;
state->a2_data_in = 1;
diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c
index bf80f8c661a..91d5a49537f 100644
--- a/src/mame/drivers/jrpacman.c
+++ b/src/mame/drivers/jrpacman.c
@@ -115,8 +115,8 @@ public:
static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
{
- device_set_input_line_vector(space->machine->device("maincpu"), 0, data);
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ device_set_input_line_vector(space->machine().device("maincpu"), 0, data);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -378,7 +378,7 @@ static DRIVER_INIT( jrpacman )
{ 0,0 }
};
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i, j, A;
for (i = A = 0; table[i].count; i++)
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index 3f43ccea7ea..edde28ec020 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -108,7 +108,7 @@ public:
static WRITE8_HANDLER( jubileep_videoram_w )
{
- jubilee_state *state = space->machine->driver_data<jubilee_state>();
+ jubilee_state *state = space->machine().driver_data<jubilee_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( jubileep_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- jubilee_state *state = machine->driver_data<jubilee_state>();
+ jubilee_state *state = machine.driver_data<jubilee_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO( 0, code, 0, 0);
@@ -126,14 +126,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jubileep )
{
- jubilee_state *state = machine->driver_data<jubilee_state>();
+ jubilee_state *state = machine.driver_data<jubilee_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( jubileep )
{
- jubilee_state *state = screen->machine->driver_data<jubilee_state>();
+ jubilee_state *state = screen->machine().driver_data<jubilee_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -179,7 +179,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(unk_r)
{
- return (space->machine->rand() & 0xff);
+ return (space->machine().rand() & 0xff);
}
static ADDRESS_MAP_START( jubileep_cru_map, AS_IO, 8 )
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index fdaa6a6878a..ae07008515f 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -127,14 +127,14 @@ public:
static WRITE8_HANDLER( junofrst_blitter_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
state->blitterdata[offset] = data;
/* blitter is triggered by $8073 */
if (offset == 3)
{
int i;
- UINT8 *gfx_rom = space->machine->region("gfx1")->base();
+ UINT8 *gfx_rom = space->machine().region("gfx1")->base();
offs_t src = ((state->blitterdata[2] << 8) | state->blitterdata[3]) & 0xfffc;
offs_t dest = (state->blitterdata[0] << 8) | state->blitterdata[1];
@@ -181,13 +181,13 @@ static WRITE8_HANDLER( junofrst_blitter_w )
static WRITE8_HANDLER( junofrst_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static READ8_DEVICE_HANDLER( junofrst_portA_r )
{
- junofrst_state *state = device->machine->driver_data<junofrst_state>();
+ junofrst_state *state = device->machine().driver_data<junofrst_state>();
int timer;
/* main xtal 14.318MHz, divided by 8 to get the CPU clock, further */
@@ -204,7 +204,7 @@ static READ8_DEVICE_HANDLER( junofrst_portA_r )
static WRITE8_DEVICE_HANDLER( junofrst_portB_w )
{
- junofrst_state *state = device->machine->driver_data<junofrst_state>();
+ junofrst_state *state = device->machine().driver_data<junofrst_state>();
device_t *filter[3] = { state->filter_0_0, state->filter_0_1, state->filter_0_2 };
int i;
@@ -225,7 +225,7 @@ static WRITE8_DEVICE_HANDLER( junofrst_portB_w )
static WRITE8_HANDLER( junofrst_sh_irqtrigger_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
if (state->last_irq == 0 && data == 1)
{
@@ -239,14 +239,14 @@ static WRITE8_HANDLER( junofrst_sh_irqtrigger_w )
static WRITE8_HANDLER( junofrst_i8039_irq_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
device_set_input_line(state->i8039, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_and_status_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
if ((data & 0x80) == 0)
device_set_input_line(state->i8039, 0, CLEAR_LINE);
@@ -263,7 +263,7 @@ static WRITE8_HANDLER( flip_screen_w )
static WRITE8_HANDLER( junofrst_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -370,14 +370,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( junofrst )
{
- junofrst_state *state = machine->driver_data<junofrst_state>();
+ junofrst_state *state = machine.driver_data<junofrst_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->i8039 = machine->device("mcu");
- state->soundcpu = machine->device<cpu_device>("audiocpu");
- state->filter_0_0 = machine->device("filter.0.0");
- state->filter_0_1 = machine->device("filter.0.1");
- state->filter_0_2 = machine->device("filter.0.2");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->i8039 = machine.device("mcu");
+ state->soundcpu = machine.device<cpu_device>("audiocpu");
+ state->filter_0_0 = machine.device("filter.0.0");
+ state->filter_0_1 = machine.device("filter.0.1");
+ state->filter_0_2 = machine.device("filter.0.2");
state->save_item(NAME(state->i8039_status));
state->save_item(NAME(state->last_irq));
@@ -388,7 +388,7 @@ static MACHINE_START( junofrst )
static MACHINE_RESET( junofrst )
{
- junofrst_state *state = machine->driver_data<junofrst_state>();
+ junofrst_state *state = machine.driver_data<junofrst_state>();
state->i8039_status = 0;
state->last_irq = 0;
@@ -503,7 +503,7 @@ static DRIVER_INIT( junofrst )
{
UINT8 *decrypted = konami1_decode(machine, "maincpu");
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
memory_configure_bank_decrypted(machine, "bank1", 0, 16, decrypted + 0x10000, 0x1000);
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index e817350feaa..a19c5b50c47 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -270,17 +270,17 @@ static MACHINE_RESET( shogwarr )
static READ16_HANDLER( kaneko16_rnd_r )
{
- return space->machine->rand() & 0xffff;
+ return space->machine().rand() & 0xffff;
}
static WRITE16_HANDLER( kaneko16_coin_lockout_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, (~data) & 0x0400 );
- coin_lockout_w(space->machine, 1, (~data) & 0x0800 );
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x0400 );
+ coin_lockout_w(space->machine(), 1, (~data) & 0x0800 );
}
}
@@ -300,7 +300,7 @@ static WRITE16_HANDLER( kaneko16_soundlatch_w )
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data & 0xff00) >> 8 );
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -335,15 +335,15 @@ static WRITE16_HANDLER( kaneko16_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, data & 0x8000);
- coin_lockout_w(space->machine, 1, data & 0x8000);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, data & 0x8000);
+ coin_lockout_w(space->machine(), 1, data & 0x8000);
}
}
@@ -400,7 +400,7 @@ static WRITE16_DEVICE_HANDLER( bakubrkr_oki_bank_sw )
if (ACCESSING_BITS_0_7) {
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0x7) );
- logerror("%s:Selecting OKI bank %02X\n",device->machine->describe_context(),data&0xff);
+ logerror("%s:Selecting OKI bank %02X\n",device->machine().describe_context(),data&0xff);
}
}
@@ -490,10 +490,10 @@ static WRITE16_HANDLER( bloodwar_coin_lockout_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, data & 0x8000);
- coin_lockout_w(space->machine, 1, data & 0x8000);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, data & 0x8000);
+ coin_lockout_w(space->machine(), 1, data & 0x8000);
}
}
@@ -544,7 +544,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_0_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0xF));
- logerror("%s: OKI0 bank %08X\n",device->machine->describe_context(),data);
+ logerror("%s: OKI0 bank %08X\n",device->machine().describe_context(),data);
}
}
@@ -554,7 +554,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_1_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * data );
- logerror("%s: OKI1 bank %08X\n",device->machine->describe_context(),data);
+ logerror("%s: OKI1 bank %08X\n",device->machine().describe_context(),data);
}
}
@@ -604,12 +604,12 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr_wheel_r )
{
// check 'Controls' dip switch
- switch (input_port_read(space->machine, "DSW1") & 0x1000)
+ switch (input_port_read(space->machine(), "DSW1") & 0x1000)
{
case 0x0000: // 'Both Sides' = 270deg Wheel
- return (input_port_read(space->machine, "WHEEL0"));
+ return (input_port_read(space->machine(), "WHEEL0"));
case 0x1000: // '1P Side' = 360' Wheel
- return (input_port_read(space->machine, "WHEEL1"));
+ return (input_port_read(space->machine(), "WHEEL1"));
default:
return (0);
}
@@ -692,14 +692,14 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr2_wheel_r )
{
- switch (input_port_read(space->machine, "DSW1") & 0x1800)
+ switch (input_port_read(space->machine(), "DSW1") & 0x1800)
{
case 0x0000: // 270' A. Wheel
- return (input_port_read(space->machine, "WHEEL0"));
+ return (input_port_read(space->machine(), "WHEEL0"));
case 0x1000: // 270' D. Wheel
- return (input_port_read(space->machine, "WHEEL1") << 8);
+ return (input_port_read(space->machine(), "WHEEL1") << 8);
case 0x0800: // 360' Wheel
- return (input_port_read(space->machine, "WHEEL2") << 8);
+ return (input_port_read(space->machine(), "WHEEL2") << 8);
default:
logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(space->cpu));
return (~0);
@@ -708,7 +708,7 @@ static READ16_HANDLER( gtmr2_wheel_r )
static READ16_HANDLER( gtmr2_IN1_r )
{
- return (input_port_read(space->machine, "P2") & (input_port_read(space->machine, "FAKE") | ~0x7100));
+ return (input_port_read(space->machine(), "P2") & (input_port_read(space->machine(), "FAKE") | ~0x7100));
}
static ADDRESS_MAP_START( gtmr2_map, AS_PROGRAM, 16 )
@@ -796,11 +796,11 @@ ADDRESS_MAP_END
Shogun Warriors
***************************************************************************/
-static void kaneko16_common_oki_bank_w( running_machine* machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
+static void kaneko16_common_oki_bank_w( running_machine& machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
{
UINT32 bankaddr;
- UINT8* samples = machine->region(tag)->base();
- size_t length = machine->region(tag)->bytes();
+ UINT8* samples = machine.region(tag)->base();
+ size_t length = machine.region(tag)->bytes();
bankaddr = fixedsize + (bankedsize * bank);
@@ -814,8 +814,8 @@ static WRITE16_HANDLER( shogwarr_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- kaneko16_common_oki_bank_w(space->machine, "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
- kaneko16_common_oki_bank_w(space->machine, "bank11", "oki2", (data & 0xf) , 0x00000, 0x40000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank11", "oki2", (data & 0xf) , 0x00000, 0x40000);
}
}
@@ -823,8 +823,8 @@ static WRITE16_HANDLER( brapboys_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- kaneko16_common_oki_bank_w(space->machine, "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
- kaneko16_common_oki_bank_w(space->machine, "bank11", "oki2", (data & 0xf) , 0x20000, 0x20000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank11", "oki2", (data & 0xf) , 0x20000, 0x20000);
}
}
@@ -1770,7 +1770,7 @@ static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w )
{
// FIXME: the device line cannot be directly put in the interface due to inverse value!
// we might want to define a "reversed" set_cs_line handler
- device_t *eeprom = device->machine->device("eeprom");
+ device_t *eeprom = device->machine().device("eeprom");
// reset line asserted: reset.
eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
}
@@ -2111,7 +2111,7 @@ static INTERRUPT_GEN( shogwarr_interrupt )
// the code for this interupt is provided by the MCU..
case 0: device_set_input_line(device, 4, HOLD_LINE);
- calc3_mcu_run(device->machine);
+ calc3_mcu_run(device->machine());
break;
/*case 0:
{
@@ -2235,10 +2235,10 @@ MACHINE_CONFIG_END
have the even and odd pixels swapped. So we use this function to untangle
them and have one single gfxlayout for both tiles and sprites.
*/
-static void kaneko16_unscramble_tiles(running_machine *machine, const char *region)
+static void kaneko16_unscramble_tiles(running_machine &machine, const char *region)
{
- UINT8 *RAM = machine->region(region)->base();
- int size = machine->region(region)->bytes();
+ UINT8 *RAM = machine.region(region)->base();
+ int size = machine.region(region)->bytes();
int i;
if (RAM == NULL) return;
@@ -2249,7 +2249,7 @@ static void kaneko16_unscramble_tiles(running_machine *machine, const char *regi
}
}
-static void kaneko16_expand_sample_banks(running_machine *machine, const char *region)
+static void kaneko16_expand_sample_banks(running_machine &machine, const char *region)
{
/* The sample data for the first OKI has an address translator/
banking register in it that munges the addresses as follows:
@@ -2263,11 +2263,11 @@ static void kaneko16_expand_sample_banks(running_machine *machine, const char *r
int bank;
UINT8 *src0;
- if (machine->region(region)->bytes() < 0x40000 * 16)
+ if (machine.region(region)->bytes() < 0x40000 * 16)
fatalerror("gtmr SOUND1 region too small");
/* bank 0 maps to itself, so we just leave it alone */
- src0 = machine->region(region)->base();
+ src0 = machine.region(region)->base();
for (bank = 15; bank > 0; bank--)
{
UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank);
@@ -3843,14 +3843,14 @@ ROM_END
static DRIVER_INIT( bloodwar )
{
- machine->device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
+ machine.device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
DRIVER_INIT_CALL(samplebank);
DRIVER_INIT_CALL(decrypt_toybox_rom);
}
static DRIVER_INIT( gtmr2 )
{
- machine->device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
+ machine.device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
DRIVER_INIT_CALL(samplebank);
DRIVER_INIT_CALL(decrypt_toybox_rom_alt);
}
@@ -3877,7 +3877,7 @@ static DRIVER_INIT( shogwarr )
static DRIVER_INIT( brapboys )
{
// sample banking is different on brap boys for the music, why? GALs / PALs ?
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00000, 0xe00001, FUNC(brapboys_oki_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00000, 0xe00001, FUNC(brapboys_oki_bank_w));
// default sample banks
kaneko16_common_oki_bank_w(machine, "bank10", "oki1", 0, 0x30000, 0x10000);
diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c
index a76b5d931d5..1eaf18d3ef0 100644
--- a/src/mame/drivers/kangaroo.c
+++ b/src/mame/drivers/kangaroo.c
@@ -174,23 +174,23 @@ static WRITE8_HANDLER(mcu_sim_w);
static MACHINE_START( kangaroo )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("gfx1")->base(), 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("gfx1")->base(), 0x2000);
}
static MACHINE_START( kangaroo_mcu )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
MACHINE_START_CALL(kangaroo);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xef00, 0xefff, FUNC(mcu_sim_r), FUNC(mcu_sim_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xef00, 0xefff, FUNC(mcu_sim_r), FUNC(mcu_sim_w));
state->save_item(NAME(state->clock));
}
static MACHINE_RESET( kangaroo )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
/* I think there is a bug in the startup checks of the game. At the very */
/* beginning, during the RAM check, it goes one byte too far, and ends up */
@@ -222,7 +222,7 @@ static MACHINE_RESET( kangaroo )
static READ8_HANDLER( mcu_sim_r )
{
- kangaroo_state *state = space->machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = space->machine().driver_data<kangaroo_state>();
return ++state->clock & 0x0f;
}
@@ -240,8 +240,8 @@ static WRITE8_HANDLER( mcu_sim_w )
static WRITE8_HANDLER( kangaroo_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 9e5fa1b0130..fe92935b124 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -90,9 +90,9 @@ Stephh's notes (based on the games M68000 code and some tests) :
*************************************/
/* Emulation of the protected microcontroller - for coins & general protection */
-static void karnov_i8751_w( running_machine *machine, int data )
+static void karnov_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Pending coin operations may cause protection commands to be queued */
if (state->i8751_needs_ack)
@@ -123,15 +123,15 @@ static void karnov_i8751_w( running_machine *machine, int data )
if (data == 0x401) state->i8751_return = 0x4138; /* ^Whistling wind */
if (data == 0x408) state->i8751_return = 0x4276; /* ^Heavy Gates */
-// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
device_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */
state->i8751_needs_ack = 1;
}
-static void wndrplnt_i8751_w( running_machine *machine, int data )
+static void wndrplnt_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* The last command hasn't been ACK'd (probably a conflict with coin command) */
if (state->i8751_needs_ack)
@@ -159,7 +159,7 @@ static void wndrplnt_i8751_w( running_machine *machine, int data )
case 0x18: state->i8751_return = 0x5341; break;
}
}
-// else logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+// else logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
/* These are 68k function call addresses - different address for each power-up */
if (data == 0x400) state->i8751_return = 0x594;
@@ -189,9 +189,9 @@ static void wndrplnt_i8751_w( running_machine *machine, int data )
state->i8751_needs_ack = 1;
}
-static void chelnov_i8751_w( running_machine *machine, int data )
+static void chelnov_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Pending coin operations may cause protection commands to be queued */
if (state->i8751_needs_ack)
@@ -315,7 +315,7 @@ static void chelnov_i8751_w( running_machine *machine, int data )
}
}
- // logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+ // logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
device_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */
state->i8751_needs_ack = 1;
@@ -329,7 +329,7 @@ static void chelnov_i8751_w( running_machine *machine, int data )
static WRITE16_HANDLER( karnov_control_w )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
/* Mnemonics filled in from the schematics, brackets are my comments */
switch (offset << 1)
@@ -371,16 +371,16 @@ static WRITE16_HANDLER( karnov_control_w )
case 6: /* SECREQ (Interrupt & Data to i8751) */
if (state->microcontroller_id == KARNOV || state->microcontroller_id == KARNOVJ)
- karnov_i8751_w(space->machine, data);
+ karnov_i8751_w(space->machine(), data);
if (state->microcontroller_id == CHELNOV || state->microcontroller_id == CHELNOVU || state->microcontroller_id == CHELNOVJ)
- chelnov_i8751_w(space->machine, data);
+ chelnov_i8751_w(space->machine(), data);
if (state->microcontroller_id == WNDRPLNT)
- wndrplnt_i8751_w(space->machine, data);
+ wndrplnt_i8751_w(space->machine(), data);
break;
case 8: /* HSHIFT (9 bits) - Top bit indicates video flip */
COMBINE_DATA(&state->scroll[0]);
- karnov_flipscreen_w(space->machine, data >> 15);
+ karnov_flipscreen_w(space->machine(), data >> 15);
break;
case 0xa: /* VSHIFT */
@@ -403,16 +403,16 @@ static WRITE16_HANDLER( karnov_control_w )
static READ16_HANDLER( karnov_control_r )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
switch (offset << 1)
{
case 0:
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Start buttons & VBL */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 4:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 6: /* i8751 return values */
return state->i8751_return;
}
@@ -728,8 +728,8 @@ GFXDECODE_END
static INTERRUPT_GEN( karnov_interrupt )
{
- karnov_state *state = device->machine->driver_data<karnov_state>();
- UINT8 port = input_port_read(device->machine, "FAKE");
+ karnov_state *state = device->machine().driver_data<karnov_state>();
+ UINT8 port = input_port_read(device->machine(), "FAKE");
/* Coin input to the i8751 generates an interrupt to the main cpu */
if (port == state->coin_mask)
@@ -757,7 +757,7 @@ static INTERRUPT_GEN( karnov_interrupt )
static void sound_irq( device_t *device, int linestate )
{
- karnov_state *state = device->machine->driver_data<karnov_state>();
+ karnov_state *state = device->machine().driver_data<karnov_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
@@ -774,10 +774,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->scroll));
@@ -793,7 +793,7 @@ static MACHINE_START( karnov )
static MACHINE_RESET( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
memset(state->ram, 0, 0x4000 / 2); /* Chelnov likes ram clear on reset.. */
@@ -1116,29 +1116,29 @@ ROM_END
static DRIVER_INIT( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = KARNOV;
state->coin_mask = 0x07;
}
static DRIVER_INIT( karnovj )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = KARNOVJ;
state->coin_mask = 0x07;
}
static DRIVER_INIT( wndrplnt )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = WNDRPLNT;
state->coin_mask = 0x00;
}
static DRIVER_INIT( chelnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOV;
state->coin_mask = 0xe0;
@@ -1148,8 +1148,8 @@ static DRIVER_INIT( chelnov )
static DRIVER_INIT( chelnovu )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOVU;
state->coin_mask = 0xe0;
@@ -1159,8 +1159,8 @@ static DRIVER_INIT( chelnovu )
static DRIVER_INIT( chelnovj )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOVJ;
state->coin_mask = 0xe0;
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index ef7df83634b..50ec92144a7 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -76,34 +76,34 @@ IO ports and memory map changes. Dip switches differ too.
static WRITE8_HANDLER( control_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->nmi_enable = data & 1;
}
static WRITE8_HANDLER( sound_reset_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
if (!(data & 1))
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
msm5205_reset_w(device, !(data & 1));
state->sound_nmi_enable = ((data >> 1) & 1);
}
static WRITE8_HANDLER( sound_command_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
soundlatch_w(space, 0, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sound_msm_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->msm_data = data;
state->msm_play_lo_nibble = 1;
}
@@ -148,14 +148,14 @@ ADDRESS_MAP_END
********************/
static READ8_HANDLER( sound_reset_r )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, PULSE_LINE);
return 0;
}
static WRITE8_HANDLER( kc_sound_control_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
if (offset == 0)
state->sound_nmi_enable = ((data >> 7) & 1);
@@ -348,14 +348,14 @@ GFXDECODE_END
static INTERRUPT_GEN( kc_interrupt )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static void msmint( device_t *device )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->msm_play_lo_nibble)
msm5205_data_w(device, state->msm_data & 0x0f);
@@ -383,7 +383,7 @@ static const msm5205_interface msm_interface =
static INTERRUPT_GEN( sound_int )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->sound_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -391,9 +391,9 @@ static INTERRUPT_GEN( sound_int )
static MACHINE_START( kchamp )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->sound_nmi_enable));
@@ -401,7 +401,7 @@ static MACHINE_START( kchamp )
static MACHINE_START( kchampvs )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
MACHINE_START_CALL(kchamp);
@@ -412,7 +412,7 @@ static MACHINE_START( kchampvs )
static MACHINE_RESET( kchamp )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
state->nmi_enable = 0;
state->sound_nmi_enable = 0;
@@ -728,11 +728,11 @@ ROM_START( karatevs )
ROM_END
-static UINT8 *decrypt_code(running_machine *machine)
+static UINT8 *decrypt_code(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -746,8 +746,8 @@ static UINT8 *decrypt_code(running_machine *machine)
static DRIVER_INIT( kchampvs )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypted = decrypt_code(machine);
int A;
@@ -778,7 +778,7 @@ static DRIVER_INIT( kchampvs )
static DRIVER_INIT( kchampvs2 )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
decrypt_code(machine);
state->counter = 0;
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index 043156d1f30..8eefd792be8 100644
--- a/src/mame/drivers/kickgoal.c
+++ b/src/mame/drivers/kickgoal.c
@@ -205,8 +205,8 @@ WRITE16_DEVICE_HANDLER( kickgoal_snd_w )
static WRITE16_DEVICE_HANDLER( actionhw_snd_w )
{
- kickgoal_state *state = device->machine->driver_data<kickgoal_state>();
- logerror("%s: Writing %04x to Sound CPU - mask %04x\n",device->machine->describe_context(),data,mem_mask);
+ kickgoal_state *state = device->machine().driver_data<kickgoal_state>();
+ logerror("%s: Writing %04x to Sound CPU - mask %04x\n",device->machine().describe_context(),data,mem_mask);
if (!ACCESSING_BITS_0_7)
data >>= 8;
@@ -294,7 +294,7 @@ static WRITE16_DEVICE_HANDLER( actionhw_snd_w )
static INTERRUPT_GEN( kickgoal_interrupt )
{
- kickgoal_state *state = device->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = device->machine().driver_data<kickgoal_state>();
if ((state->adpcm->read_status() & 0x08) == 0)
{
@@ -329,7 +329,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
state->adpcm->write_command(0x81);
}
}
- if (input_code_pressed_once(device->machine, KEYCODE_PGUP))
+ if (input_code_pressed_once(device->machine(), KEYCODE_PGUP))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -348,7 +348,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_PGDN))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_PGDN))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -367,7 +367,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_INSERT))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_INSERT))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -388,7 +388,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_DEL))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_DEL))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -409,7 +409,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_Z))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_Z))
{
if (state->m6295_key_delay >= (0x80 * oki_time_base))
{
@@ -448,7 +448,7 @@ static const UINT16 kickgoal_default_eeprom_type1[64] = {
static READ16_HANDLER( kickgoal_eeprom_r )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
if (ACCESSING_BITS_0_7)
{
return eeprom_read_bit(state->eeprom);
@@ -459,7 +459,7 @@ static READ16_HANDLER( kickgoal_eeprom_r )
static WRITE16_HANDLER( kickgoal_eeprom_w )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
if (ACCESSING_BITS_0_7)
{
switch (offset)
@@ -647,7 +647,7 @@ GFXDECODE_END
static MACHINE_START( kickgoal )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->save_item(NAME(state->snd_sam));
state->save_item(NAME(state->melody_loop));
@@ -659,7 +659,7 @@ static MACHINE_START( kickgoal )
static MACHINE_RESET( kickgoal )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->melody_loop = 0;
state->snd_new = 0;
@@ -814,7 +814,7 @@ ROM_END
static DRIVER_INIT( kickgoal )
{
#if 0 /* we should find a real fix instead */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* fix "bug" that prevents game from writing to EEPROM */
rom[0x12b0/2] = 0x0001;
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index d0eed5c55e1..d489d76669e 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -115,7 +115,7 @@ xxxx ---- basic color?
static TILE_GET_INFO( get_sc0_tile_info )
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
int tile = state->vram[tile_index] | state->attr[tile_index]<<8;
int color = (state->attr[tile_index] & 0x06)>>1;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_sc0_tile_info )
static TILE_GET_INFO( get_sc1_tile_info )
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
int tile = state->vram[tile_index] | state->attr[tile_index]<<8;
int color = (state->attr[tile_index] & 0x06)>>1;
@@ -150,7 +150,7 @@ static TILE_GET_INFO( get_sc1_tile_info )
static VIDEO_START(kingdrby)
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,24);
state->sc1_tilemap = tilemap_create(machine, get_sc1_tile_info,tilemap_scan_rows,8,8,32,24);
state->sc0w_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -158,9 +158,9 @@ static VIDEO_START(kingdrby)
tilemap_set_transparent_pen(state->sc1_tilemap,0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
UINT8 *spriteram = state->spriteram;
int count = 0;
@@ -192,20 +192,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for(dy=0;dy<h;dy++)
for(dx=0;dx<w;dx++)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),0);
}
else
{
for(dy=0;dy<h;dy++)
for(dx=0;dx<w;dx++)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),0);
}
}
}
static SCREEN_UPDATE(kingdrby)
{
- kingdrby_state *state = screen->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = screen->machine().driver_data<kingdrby_state>();
const rectangle &visarea = screen->visible_area();
rectangle clip;
tilemap_set_scrollx( state->sc0_tilemap,0, state->vram[0x342]);
@@ -222,7 +222,7 @@ static SCREEN_UPDATE(kingdrby)
/*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0);
tilemap_draw(bitmap,&clip,state->sc0w_tilemap,0,0);
@@ -231,7 +231,7 @@ static SCREEN_UPDATE(kingdrby)
static WRITE8_HANDLER( sc0_vram_w )
{
- kingdrby_state *state = space->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = space->machine().driver_data<kingdrby_state>();
state->vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
tilemap_mark_tile_dirty(state->sc0w_tilemap,offset);
@@ -240,7 +240,7 @@ static WRITE8_HANDLER( sc0_vram_w )
static WRITE8_HANDLER( sc0_attr_w )
{
- kingdrby_state *state = space->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = space->machine().driver_data<kingdrby_state>();
state->attr[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
tilemap_mark_tile_dirty(state->sc0w_tilemap,offset);
@@ -257,13 +257,13 @@ static WRITE8_HANDLER( sc0_attr_w )
static READ8_DEVICE_HANDLER( hopper_io_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
- return (input_port_read(device->machine,"HPIO") & 0x3f) | state->p1_hopper | state->p2_hopper;
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
+ return (input_port_read(device->machine(),"HPIO") & 0x3f) | state->p1_hopper | state->p2_hopper;
}
static WRITE8_DEVICE_HANDLER( hopper_io_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
state->p1_hopper = (data & 0x8)<<3;
state->p2_hopper = (data & 0x4)<<5;
// printf("%02x\n",data);
@@ -271,8 +271,8 @@ static WRITE8_DEVICE_HANDLER( hopper_io_w )
static WRITE8_DEVICE_HANDLER( sound_cmd_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
state->sound_cmd = data;
/* soundlatch is unneeded since we are already using perfect interleave. */
// soundlatch_w(space,0, data);
@@ -282,18 +282,18 @@ static WRITE8_DEVICE_HANDLER( sound_cmd_w )
/* No idea about what's this (if it's really a mux etc.)*/
static WRITE8_DEVICE_HANDLER( outport2_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
// popmessage("PPI1 port C(upper) out: %02X", data);
state->mux_data = data & 0x80;
}
static READ8_DEVICE_HANDLER( input_mux_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
if(state->mux_data & 0x80)
- return input_port_read(device->machine,"MUX0");
+ return input_port_read(device->machine(),"MUX0");
else
- return input_port_read(device->machine,"MUX1");
+ return input_port_read(device->machine(),"MUX1");
}
static READ8_DEVICE_HANDLER( key_matrix_r )
@@ -301,8 +301,8 @@ static READ8_DEVICE_HANDLER( key_matrix_r )
UINT16 p1_val,p2_val;
UINT8 p1_res,p2_res;
- p1_val = input_port_read(device->machine,"KEY_1P");
- p2_val = input_port_read(device->machine,"KEY_2P");
+ p1_val = input_port_read(device->machine(),"KEY_1P");
+ p2_val = input_port_read(device->machine(),"KEY_2P");
p1_res = 0;
p2_res = 0;
@@ -350,7 +350,7 @@ static READ8_DEVICE_HANDLER( key_matrix_r )
static READ8_DEVICE_HANDLER( sound_cmd_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
return state->sound_cmd;
}
@@ -964,8 +964,8 @@ static PALETTE_INIT(kingdrby)
static PALETTE_INIT(kingdrbb)
{
- UINT8 *raw_prom = machine->region("raw_prom")->base();
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *raw_prom = machine.region("raw_prom")->base();
+ UINT8 *prom = machine.region("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c
index e47b7a1301c..d8fdaa1d0f4 100644
--- a/src/mame/drivers/kingobox.c
+++ b/src/mame/drivers/kingobox.c
@@ -23,26 +23,26 @@ Main CPU:
static WRITE8_HANDLER( video_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
device_set_input_line_and_vector(state->video_cpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sprite_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
device_set_input_line_and_vector(state->sprite_cpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( scroll_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
sprite_interrupt_w(space, offset, data);
*state->scroll_y = data;
}
static WRITE8_HANDLER( sound_command_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
soundlatch_w(space, 0, data);
device_set_input_line_and_vector(state->audio_cpu, 0, HOLD_LINE, 0xff);
}
@@ -448,7 +448,7 @@ static const ay8910_interface ay8910_config =
static INTERRUPT_GEN( kingofb_interrupt )
{
- kingofb_state *state = device->machine->driver_data<kingofb_state>();
+ kingofb_state *state = device->machine().driver_data<kingofb_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -456,11 +456,11 @@ static INTERRUPT_GEN( kingofb_interrupt )
static MACHINE_START( kingofb )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
- state->video_cpu = machine->device("video");
- state->sprite_cpu = machine->device("sprite");
- state->audio_cpu = machine->device("audiocpu");
+ state->video_cpu = machine.device("video");
+ state->sprite_cpu = machine.device("sprite");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->palette_bank));
@@ -468,7 +468,7 @@ static MACHINE_START( kingofb )
static MACHINE_RESET( kingofb )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
state->nmi_enable = 0;
state->palette_bank = 0;
@@ -794,7 +794,7 @@ ROM_END
static DRIVER_INIT( ringking3 )
{
int i;
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* expand the first color PROM to look like the kingofb ones... */
for (i = 0; i < 0x100; i++)
@@ -804,8 +804,8 @@ static DRIVER_INIT( ringking3 )
static DRIVER_INIT( ringkingw )
{
int i,j,k;
- UINT8 *PROMS = machine->region("proms")->base();
- UINT8 *USER1 = machine->region("user1")->base();
+ UINT8 *PROMS = machine.region("proms")->base();
+ UINT8 *USER1 = machine.region("user1")->base();
/* change the PROMs encode in a simple format to use kingofb decode */
for(i = 0, j = 0; j < 0x40; i++, j++)
diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c
index 3bd93c26117..93b5df3fb79 100644
--- a/src/mame/drivers/kingpin.c
+++ b/src/mame/drivers/kingpin.c
@@ -134,10 +134,10 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( kingpin_video_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
-static void vdp_interrupt (running_machine *machine, int state)
+static void vdp_interrupt (running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
}
@@ -184,12 +184,12 @@ MACHINE_CONFIG_END
static DRIVER_INIT( kingpin )
{
- kingpin_state *state = machine->driver_data<kingpin_state>();
+ kingpin_state *state = machine.driver_data<kingpin_state>();
TMS9928A_configure(&tms9928a_interface);
/* Hacks to keep the emu a'runnin */
- state->code_base = machine->region("maincpu")->base();
+ state->code_base = machine.region("maincpu")->base();
state->code_base[0x17d4] = 0xc3; /* Maybe sound related? */
}
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index a08dc25f914..8f0d1837172 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -165,11 +165,11 @@ public:
static MACHINE_START( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
- device_t *ide = machine->device("ide");
+ kinst_state *state = machine.driver_data<kinst_state>();
+ device_t *ide = machine.device("ide");
UINT8 *features = ide_get_features(ide);
- if (strncmp(machine->system().name, "kinst2", 6) != 0)
+ if (strncmp(machine.system().name, "kinst2", 6) != 0)
{
/* kinst: tweak the model number so we pass the check */
features[27*2+0] = 0x54;
@@ -199,12 +199,12 @@ static MACHINE_START( kinst )
}
/* set the fastest DRC options */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->rambase2);
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->rambase);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->rambase2);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->rambase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
}
@@ -217,7 +217,7 @@ static MACHINE_START( kinst )
static MACHINE_RESET( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
/* set a safe base location for video */
state->video_base = &state->rambase[0x30000/4];
}
@@ -232,7 +232,7 @@ static MACHINE_RESET( kinst )
static SCREEN_UPDATE( kinst )
{
- kinst_state *state = screen->machine->driver_data<kinst_state>();
+ kinst_state *state = screen->machine().driver_data<kinst_state>();
int y;
/* loop over rows and copy to the destination */
@@ -272,13 +272,13 @@ static TIMER_CALLBACK( irq0_stop )
static INTERRUPT_GEN( irq0_start )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq0_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq0_stop));
}
static void ide_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", 1, state);
+ cputag_set_input_line(device->machine(), "maincpu", 1, state);
}
@@ -322,7 +322,7 @@ static WRITE32_DEVICE_HANDLER( kinst_ide_extra_w )
static READ32_HANDLER( kinst_control_r )
{
- kinst_state *state = space->machine->driver_data<kinst_state>();
+ kinst_state *state = space->machine().driver_data<kinst_state>();
UINT32 result;
static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" };
@@ -333,7 +333,7 @@ static READ32_HANDLER( kinst_control_r )
switch (offset)
{
case 2: /* $90 -- sound return */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
result &= ~0x0002;
if (dcs_control_r() & 0x800)
result |= 0x0002;
@@ -342,11 +342,11 @@ static READ32_HANDLER( kinst_control_r )
case 0: /* $80 */
case 1: /* $88 */
case 3: /* $98 */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
break;
case 4: /* $a0 */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
if (cpu_get_pc(space->cpu) == 0x802d428)
device_spin_until_interrupt(space->cpu);
break;
@@ -358,7 +358,7 @@ static READ32_HANDLER( kinst_control_r )
static WRITE32_HANDLER( kinst_control_w )
{
- kinst_state *state = space->machine->driver_data<kinst_state>();
+ kinst_state *state = space->machine().driver_data<kinst_state>();
UINT32 olddata;
/* apply shuffling */
@@ -887,7 +887,7 @@ ROM_END
static DRIVER_INIT( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 };
dcs_init(machine);
@@ -899,7 +899,7 @@ static DRIVER_INIT( kinst )
static DRIVER_INIT( kinst2 )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
static const UINT8 kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 };
// read: $80 on ki2 = $90 on ki
diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c
index bc1215b7239..69acdeccbd5 100644
--- a/src/mame/drivers/klax.c
+++ b/src/mame/drivers/klax.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state || state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -40,8 +40,8 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
- if ((scanline & 32) == 0 && !(input_port_read(screen.machine, "P1") & 0x800))
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ if ((scanline & 32) == 0 && !(input_port_read(screen.machine(), "P1") & 0x800))
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -67,11 +67,11 @@ static MACHINE_START( klax )
static MACHINE_RESET( klax )
{
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
}
diff --git a/src/mame/drivers/kncljoe.c b/src/mame/drivers/kncljoe.c
index d1053d59936..17450dede75 100644
--- a/src/mame/drivers/kncljoe.c
+++ b/src/mame/drivers/kncljoe.c
@@ -35,7 +35,7 @@ Updates:
static WRITE8_HANDLER( sound_cmd_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
if ((data & 0x80) == 0)
soundlatch_w(space, 0, data & 0x7f);
@@ -65,13 +65,13 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( m6803_port1_w )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
state->port1 = data;
}
static WRITE8_DEVICE_HANDLER( m6803_port2_w )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
/* write latch */
if ((state->port2 & 0x01) && !(data & 0x01))
@@ -85,7 +85,7 @@ static WRITE8_DEVICE_HANDLER( m6803_port2_w )
static READ8_DEVICE_HANDLER( m6803_port1_r )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
if (state->port2 & 0x08)
return ay8910_r(device, 0);
@@ -99,7 +99,7 @@ static READ8_DEVICE_HANDLER( m6803_port2_r )
static WRITE8_HANDLER( sound_irq_ack_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
device_set_input_line(state->soundcpu, 0, CLEAR_LINE);
}
@@ -250,9 +250,9 @@ static INTERRUPT_GEN (sound_nmi)
static MACHINE_START( kncljoe )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->port1));
state->save_item(NAME(state->port2));
@@ -263,7 +263,7 @@ static MACHINE_START( kncljoe )
static MACHINE_RESET( kncljoe )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
state->port1 = 0;
state->port2 = 0;
diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c
index 8e5309a9f64..60fa5a9aefc 100644
--- a/src/mame/drivers/koftball.c
+++ b/src/mame/drivers/koftball.c
@@ -53,7 +53,7 @@ public:
static TILE_GET_INFO( get_t1_tile_info )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
int data = state->bmc_1_videoram[tile_index];
SET_TILE_INFO(
0,
@@ -64,7 +64,7 @@ static TILE_GET_INFO( get_t1_tile_info )
static TILE_GET_INFO( get_t2_tile_info )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
int data = state->bmc_2_videoram[tile_index];
SET_TILE_INFO(
0,
@@ -75,7 +75,7 @@ static TILE_GET_INFO( get_t2_tile_info )
static VIDEO_START( koftball )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
state->tilemap_1 = tilemap_create(machine, get_t1_tile_info,tilemap_scan_rows,8,8,64,32);
state->tilemap_2 = tilemap_create(machine, get_t2_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -84,7 +84,7 @@ static VIDEO_START( koftball )
static SCREEN_UPDATE( koftball )
{
- koftball_state *state = screen->machine->driver_data<koftball_state>();
+ koftball_state *state = screen->machine().driver_data<koftball_state>();
tilemap_draw( bitmap, cliprect, state->tilemap_2, 0, 0);
tilemap_draw( bitmap, cliprect, state->tilemap_1, 0, 0);
return 0;
@@ -92,33 +92,33 @@ static SCREEN_UPDATE( koftball )
static WRITE16_HANDLER( bmc_RAMDAC_offset_w )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
state->clr_offset=data*3;
}
static WRITE16_HANDLER( bmc_RAMDAC_color_w )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
state->bmc_colorram[state->clr_offset]=data;
- palette_set_color_rgb(space->machine,state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
+ palette_set_color_rgb(space->machine(),state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
state->clr_offset=(state->clr_offset+1)%768;
}
static READ16_HANDLER( bmc_RAMDAC_color_r )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
return state->bmc_colorram[state->clr_offset];
}
static READ16_HANDLER(random_number_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER(prot_r)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
switch(state->prot_data)
{
case 0x0000: return 0x0d00;
@@ -128,25 +128,25 @@ static READ16_HANDLER(prot_r)
}
logerror("unk prot r %x %x\n",state->prot_data, cpu_get_previouspc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER(prot_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->prot_data);
}
static WRITE16_HANDLER(bmc_1_videoram_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->bmc_1_videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset);
}
static WRITE16_HANDLER(bmc_2_videoram_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->bmc_2_videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap_2, offset);
}
@@ -293,7 +293,7 @@ static const UINT16 nvram[]=
#endif
static DRIVER_INIT(koftball)
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
state->bmc_colorram = auto_alloc_array(machine, UINT8, 768);
#if NVRAM_HACK
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index 5d477854f9b..cf7c5fe9bae 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -73,7 +73,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
int code = state->videoram[tile_index] | ((state->videoram[tile_index + 0x400] & 0x40) << 2);
int color = (state->videoram[tile_index + 0x400] & 0x1f);
int flip = (state->videoram[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
@@ -86,7 +86,7 @@ static PALETTE_INIT( koikoi )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -112,7 +112,7 @@ static PALETTE_INIT( koikoi )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -122,19 +122,19 @@ static PALETTE_INIT( koikoi )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
static VIDEO_START(koikoi)
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
state->tmap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE(koikoi)
{
- koikoi_state *state = screen->machine->driver_data<koikoi_state>();
+ koikoi_state *state = screen->machine().driver_data<koikoi_state>();
tilemap_draw(bitmap, cliprect, state->tmap, 0, 0);
return 0;
}
@@ -147,21 +147,21 @@ static SCREEN_UPDATE(koikoi)
static WRITE8_HANDLER( vram_w )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset & 0x3ff);
}
static READ8_DEVICE_HANDLER( input_r )
{
- koikoi_state *state = device->machine->driver_data<koikoi_state>();
+ koikoi_state *state = device->machine().driver_data<koikoi_state>();
if (state->inputcnt < 0)
return 0;
if (!state->inputcnt)
{
- int key = input_port_read(device->machine, "IN1");
+ int key = input_port_read(device->machine(), "IN1");
int keyval = 0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read
if (key)
@@ -197,16 +197,16 @@ static WRITE8_DEVICE_HANDLER( unknown_w )
static READ8_HANDLER( io_r )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
if (!offset)
- return input_port_read(space->machine, "IN0") ^ state->ioram[4]; //coin
+ return input_port_read(space->machine(), "IN0") ^ state->ioram[4]; //coin
return 0;
}
static WRITE8_HANDLER( io_w )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
if (offset == 7 && data == 0)
state->inputcnt = 0; //reset read cycle counter
@@ -334,7 +334,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( koikoi )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
state->save_item(NAME(state->inputcnt));
state->save_item(NAME(state->inputval));
@@ -344,7 +344,7 @@ static MACHINE_START( koikoi )
static MACHINE_RESET( koikoi )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
int i;
state->inputcnt = -1;
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index d976976475f..18c6db2cbd9 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -71,14 +71,14 @@ public:
static WRITE32_HANDLER( soundr3k_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
if( ACCESSING_BITS_16_31 )
{
state->sndto000[ ( offset << 1 ) + 1 ] = data >> 16;
if( offset == 3 )
{
- cputag_set_input_line(space->machine, "soundcpu", 1, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", 1, HOLD_LINE );
}
}
if( ACCESSING_BITS_0_15 )
@@ -89,7 +89,7 @@ static WRITE32_HANDLER( soundr3k_w )
static READ32_HANDLER( soundr3k_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
UINT32 data;
data = ( state->sndtor3k[ ( offset << 1 ) + 1 ] << 16 ) | state->sndtor3k[ offset << 1 ];
@@ -130,8 +130,8 @@ static const UINT16 konamigq_def_eeprom[64] =
static WRITE32_HANDLER( eeprom_w )
{
- input_port_write(space->machine, "EEPROMOUT", data & 0x07, 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
+ input_port_write(space->machine(), "EEPROMOUT", data & 0x07, 0xff);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
}
@@ -139,7 +139,7 @@ static WRITE32_HANDLER( eeprom_w )
static WRITE32_HANDLER( pcmram_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
if( ACCESSING_BITS_0_7 )
{
@@ -153,7 +153,7 @@ static WRITE32_HANDLER( pcmram_w )
static READ32_HANDLER( pcmram_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
return ( state->p_n_pcmram[ ( offset << 1 ) + 1 ] << 16 ) | state->p_n_pcmram[ offset << 1 ];
}
@@ -213,11 +213,11 @@ static READ16_HANDLER( dual539_r )
data = 0;
if( ACCESSING_BITS_0_7 )
{
- data |= k054539_r( space->machine->device("konami2"), offset );
+ data |= k054539_r( space->machine().device("konami2"), offset );
}
if( ACCESSING_BITS_8_15 )
{
- data |= k054539_r( space->machine->device("konami1"), offset ) << 8;
+ data |= k054539_r( space->machine().device("konami1"), offset ) << 8;
}
return data;
}
@@ -226,24 +226,24 @@ static WRITE16_HANDLER( dual539_w )
{
if( ACCESSING_BITS_0_7 )
{
- k054539_w( space->machine->device("konami2"), offset, data );
+ k054539_w( space->machine().device("konami2"), offset, data );
}
if( ACCESSING_BITS_8_15 )
{
- k054539_w( space->machine->device("konami1"), offset, data >> 8 );
+ k054539_w( space->machine().device("konami1"), offset, data >> 8 );
}
}
static READ16_HANDLER( sndcomm68k_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
return state->sndto000[ offset ];
}
static WRITE16_HANDLER( sndcomm68k_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
state->sndtor3k[ offset ] = data;
}
@@ -286,9 +286,9 @@ static const k054539_interface k054539_config =
/* SCSI */
-static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -322,11 +322,11 @@ static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_s
}
}
-static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
}
-static void scsi_irq(running_machine *machine)
+static void scsi_irq(running_machine &machine)
{
psx_irq_set(machine, 0x400);
}
@@ -347,11 +347,11 @@ static const struct AM53CF96interface scsi_intf =
static DRIVER_INIT( konamigq )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
psx_driver_init(machine);
- state->p_n_pcmram = machine->region( "shared" )->base() + 0x80000;
+ state->p_n_pcmram = machine.region( "shared" )->base() + 0x80000;
}
static void konamigq_exit(running_machine &machine)
@@ -361,11 +361,11 @@ static void konamigq_exit(running_machine &machine)
static MACHINE_START( konamigq )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
/* init the scsi controller and hook up it's DMA */
am53cf96_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, konamigq_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, konamigq_exit);
psx_dma_install_read_handler(machine, 5, scsi_dma_read);
psx_dma_install_write_handler(machine, 5, scsi_dma_write);
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index f679a6dec33..5a8f968a221 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -194,9 +194,9 @@ ADDRESS_MAP_END
/* SCSI */
-static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -240,9 +240,9 @@ static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_s
}
}
-static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -276,7 +276,7 @@ static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_
}
}
-static void scsi_irq(running_machine *machine)
+static void scsi_irq(running_machine &machine)
{
psx_irq_set(machine, 0x400);
}
@@ -306,14 +306,14 @@ static DRIVER_INIT( konamigv )
/* init the scsi controller and hook up it's DMA */
am53cf96_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, konamigv_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, konamigv_exit);
psx_dma_install_read_handler(machine, 5, scsi_dma_read);
psx_dma_install_write_handler(machine, 5, scsi_dma_write);
}
static MACHINE_START( konamigv )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
state->save_item(NAME(state->sector_buffer));
state->save_item(NAME(state->flash_address));
@@ -328,14 +328,14 @@ static MACHINE_RESET( konamigv )
psx_machine_init(machine);
/* also hook up CDDA audio to the CD-ROM drive */
- cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4));
+ cdda_set_cdrom(machine.device("cdda"), am53cf96_get_device(SCSI_ID_4));
}
static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
@@ -440,7 +440,7 @@ INPUT_PORTS_END
static READ32_HANDLER( flash_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
int reg = offset*2;
//int shift = 0;
@@ -471,7 +471,7 @@ static READ32_HANDLER( flash_r )
static WRITE32_HANDLER( flash_w )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
int reg = offset*2;
int chip;
@@ -506,7 +506,7 @@ static WRITE32_HANDLER( flash_w )
static READ32_HANDLER( trackball_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if( offset == 0 && mem_mask == 0x0000ffff )
{
@@ -517,7 +517,7 @@ static READ32_HANDLER( trackball_r )
for( axis = 0; axis < 2; axis++ )
{
- value = input_port_read(space->machine, axisnames[axis]);
+ value = input_port_read(space->machine(), axisnames[axis]);
diff = value - state->trackball_prev[ axis ];
state->trackball_prev[ axis ] = value;
state->trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -533,16 +533,16 @@ static READ32_HANDLER( unknown_r )
static DRIVER_INIT( simpbowl )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash8[0] = machine->device<fujitsu_29f016a_device>("flash0");
- state->flash8[1] = machine->device<fujitsu_29f016a_device>("flash1");
- state->flash8[2] = machine->device<fujitsu_29f016a_device>("flash2");
- state->flash8[3] = machine->device<fujitsu_29f016a_device>("flash3");
+ state->flash8[0] = machine.device<fujitsu_29f016a_device>("flash0");
+ state->flash8[1] = machine.device<fujitsu_29f016a_device>("flash1");
+ state->flash8[2] = machine.device<fujitsu_29f016a_device>("flash2");
+ state->flash8[3] = machine.device<fujitsu_29f016a_device>("flash3");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(flash_r), FUNC(flash_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c0, 0x1f6800c7, FUNC(trackball_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c8, 0x1f6800cb, FUNC(unknown_r) ); /* ?? */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(flash_r), FUNC(flash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c0, 0x1f6800c7, FUNC(trackball_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c8, 0x1f6800cb, FUNC(unknown_r) ); /* ?? */
DRIVER_INIT_CALL(konamigv);
}
@@ -569,7 +569,7 @@ INPUT_PORTS_END
static READ32_HANDLER( btcflash_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if (mem_mask == 0x0000ffff)
{
@@ -585,7 +585,7 @@ static READ32_HANDLER( btcflash_r )
static WRITE32_HANDLER( btcflash_w )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if (mem_mask == 0x0000ffff)
{
@@ -599,7 +599,7 @@ static WRITE32_HANDLER( btcflash_w )
static READ32_HANDLER( btc_trackball_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
// mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(space->cpu), offset, mem_mask );
@@ -612,7 +612,7 @@ static READ32_HANDLER( btc_trackball_r )
for( axis = 0; axis < 4; axis++ )
{
- value = input_port_read(space->machine, axisnames[axis]);
+ value = input_port_read(space->machine(), axisnames[axis]);
diff = value - state->btc_trackball_prev[ axis ];
state->btc_trackball_prev[ axis ] = value;
state->btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -629,13 +629,13 @@ static WRITE32_HANDLER( btc_trackball_w )
static DRIVER_INIT( btchamp )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash16[0] = machine->device<sharp_lh28f400_device>("flash");
+ state->flash16[0] = machine.device<sharp_lh28f400_device>("flash");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(btc_trackball_r), FUNC(btc_trackball_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(btc_trackball_r), FUNC(btc_trackball_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
DRIVER_INIT_CALL(konamigv);
}
@@ -688,8 +688,8 @@ static WRITE32_HANDLER( tokimeki_serial_w )
static DRIVER_INIT( tokimosh )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f680080, 0x1f680083, FUNC(tokimeki_serial_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f680090, 0x1f680093, FUNC(tokimeki_serial_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f680080, 0x1f680083, FUNC(tokimeki_serial_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f680090, 0x1f680093, FUNC(tokimeki_serial_w) );
DRIVER_INIT_CALL(konamigv);
}
@@ -717,17 +717,17 @@ static WRITE32_HANDLER( kdeadeye_0_w )
static DRIVER_INIT( kdeadeye )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash16[0] = machine->device<sharp_lh28f400_device>("flash");
+ state->flash16[0] = machine.device<sharp_lh28f400_device>("flash");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1f6800e0, 0x1f6800e3, FUNC(kdeadeye_0_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1f6800e0, 0x1f6800e3, FUNC(kdeadeye_0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
DRIVER_INIT_CALL(konamigv);
}
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index 98f3ccd6abe..69b5e6687f6 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -422,7 +422,7 @@ static WRITE32_HANDLER( esc_w )
if (konamigx_wrport1_1 & 0x10)
{
gx_rdport1_3 &= ~8;
- cputag_set_input_line(space->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, HOLD_LINE);
}
}
else
@@ -465,7 +465,7 @@ static WRITE32_HANDLER( eeprom_w )
bit 0: eeprom data
*/
- input_port_write(space->machine, "EEPROMOUT", odata, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", odata, 0xff);
konamigx_wrport1_0 = odata;
}
@@ -512,13 +512,13 @@ static WRITE32_HANDLER( control_w )
{
// enable 68k
// clear the halt condition and reset the 68000
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_HALT, CLEAR_LINE);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, PULSE_LINE);
}
else
{
// disable 68k
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
}
K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE);
@@ -581,14 +581,14 @@ static WRITE32_HANDLER( ccu_w )
// vblank interrupt ACK
if (ACCESSING_BITS_24_31)
{
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
gx_syncen |= 0x20;
}
// hblank interrupt ACK
if (ACCESSING_BITS_8_15)
{
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
gx_syncen |= 0x40;
}
}
@@ -606,7 +606,7 @@ static WRITE32_HANDLER( ccu_w )
static TIMER_CALLBACK( dmaend_callback )
{
// foul-proof (CPU0 could be deactivated while we wait)
- if (resume_trigger && suspension_active) { suspension_active = 0; machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; machine.scheduler().trigger(resume_trigger); }
// DMA busy flag must be cleared before triggering IRQ 3
gx_rdport1_3 &= ~2;
@@ -642,7 +642,7 @@ static void dmastart_callback(int data)
static INTERRUPT_GEN(konamigx_vbinterrupt)
{
// lift idle suspension
- if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; device->machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt
if (gx_syncen & 0x20)
@@ -662,7 +662,7 @@ static INTERRUPT_GEN(konamigx_vbinterrupt)
static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
{
// lift idle suspension
- if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; device->machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt
// the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
@@ -670,7 +670,7 @@ static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
// maybe this interupt should only be every 30fps, or maybe there are flags to prevent the game running too fast
// the real hardware should output the display for each screen on alternate frames
-// if(device->machine->primary_screen->frame_number() & 1)
+// if(device->machine().primary_screen->frame_number() & 1)
if (1) // gx_syncen & 0x20)
{
gx_syncen &= ~0x20;
@@ -839,7 +839,7 @@ static READ32_HANDLER( sound020_r )
return(rv);
}
-INLINE void write_snd_020(running_machine *machine, int reg, int val)
+INLINE void write_snd_020(running_machine &machine, int reg, int val)
{
sndto000[reg] = val;
@@ -857,14 +857,14 @@ static WRITE32_HANDLER( sound020_w )
{
reg = offset<<1;
val = data>>24;
- write_snd_020(space->machine, reg, val);
+ write_snd_020(space->machine(), reg, val);
}
if (ACCESSING_BITS_8_15)
{
reg = (offset<<1)+1;
val = (data>>8)&0xff;
- write_snd_020(space->machine, reg, val);
+ write_snd_020(space->machine(), reg, val);
}
}
@@ -879,9 +879,9 @@ static double adc0834_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * input_port_read(device->machine, "AN0")) / 255.0; // steer
+ return (double)(5 * input_port_read(device->machine(), "AN0")) / 255.0; // steer
case ADC083X_CH1:
- return (double)(5 * input_port_read(device->machine, "AN1")) / 255.0; // gas
+ return (double)(5 * input_port_read(device->machine(), "AN1")) / 255.0; // gas
case ADC083X_VREF:
return 5;
}
@@ -895,16 +895,16 @@ static const adc083x_interface konamigx_adc_interface = {
static READ32_HANDLER( le2_gun_H_r )
{
- int p1x = input_port_read(space->machine, "LIGHT0_X")*290/0xff+20;
- int p2x = input_port_read(space->machine, "LIGHT1_X")*290/0xff+20;
+ int p1x = input_port_read(space->machine(), "LIGHT0_X")*290/0xff+20;
+ int p2x = input_port_read(space->machine(), "LIGHT1_X")*290/0xff+20;
return (p1x<<16)|p2x;
}
static READ32_HANDLER( le2_gun_V_r )
{
- int p1y = input_port_read(space->machine, "LIGHT0_Y")*224/0xff;
- int p2y = input_port_read(space->machine, "LIGHT1_Y")*224/0xff;
+ int p1y = input_port_read(space->machine(), "LIGHT0_Y")*224/0xff;
+ int p2y = input_port_read(space->machine(), "LIGHT1_Y")*224/0xff;
// make "off the bottom" reload too
if (p1y >= 0xdf) p1y = 0;
@@ -928,14 +928,14 @@ static READ32_HANDLER( gx6bppspr_r )
static READ32_HANDLER( type1_roz_r1 )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("gfx3")->base();
return ROM[offset];
}
static READ32_HANDLER( type1_roz_r2 )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("gfx3")->base();
ROM += (0x600000/2);
@@ -1138,7 +1138,7 @@ static WRITE32_HANDLER( type4_prot_w )
if (konamigx_wrport1_1 & 0x10)
{
gx_rdport1_3 &= ~8;
- cputag_set_input_line(space->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, HOLD_LINE);
}
// don't accidentally do a phony command
@@ -1152,7 +1152,7 @@ static WRITE32_HANDLER( type4_prot_w )
// cabinet lamps for type 1 games
static WRITE32_HANDLER( type1_cablamps_w )
{
- set_led_status(space->machine, 0, (data>>24)&1);
+ set_led_status(space->machine(), 0, (data>>24)&1);
}
/**********************************************************************************/
@@ -1254,9 +1254,9 @@ static READ16_HANDLER( dual539_r )
UINT16 ret = 0;
if (ACCESSING_BITS_0_7)
- ret |= k054539_r(space->machine->device("konami2"), offset);
+ ret |= k054539_r(space->machine().device("konami2"), offset);
if (ACCESSING_BITS_8_15)
- ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
+ ret |= k054539_r(space->machine().device("konami1"), offset)<<8;
return ret;
}
@@ -1264,9 +1264,9 @@ static READ16_HANDLER( dual539_r )
static WRITE16_HANDLER( dual539_w )
{
if (ACCESSING_BITS_0_7)
- k054539_w(space->machine->device("konami2"), offset, data);
+ k054539_w(space->machine().device("konami2"), offset, data);
if (ACCESSING_BITS_8_15)
- k054539_w(space->machine->device("konami1"), offset, data>>8);
+ k054539_w(space->machine().device("konami1"), offset, data>>8);
}
static READ16_HANDLER( sndcomm68k_r )
@@ -1287,28 +1287,28 @@ static INTERRUPT_GEN(tms_sync)
static READ16_HANDLER(tms57002_data_word_r)
{
- return tms57002_data_r(space->machine->device("dasp"), 0);
+ return tms57002_data_r(space->machine().device("dasp"), 0);
}
static WRITE16_HANDLER(tms57002_data_word_w)
{
if (ACCESSING_BITS_0_7)
- tms57002_data_w(space->machine->device("dasp"), 0, data);
+ tms57002_data_w(space->machine().device("dasp"), 0, data);
}
static READ16_HANDLER(tms57002_status_word_r)
{
- return (tms57002_dready_r(space->machine->device("dasp"), 0) ? 4 : 0) |
- (tms57002_empty_r(space->machine->device("dasp"), 0) ? 1 : 0);
+ return (tms57002_dready_r(space->machine().device("dasp"), 0) ? 4 : 0) |
+ (tms57002_empty_r(space->machine().device("dasp"), 0) ? 1 : 0);
}
static WRITE16_HANDLER(tms57002_control_word_w)
{
if (ACCESSING_BITS_0_7)
{
- tms57002_pload_w(space->machine->device("dasp"), 0, data & 4);
- tms57002_cload_w(space->machine->device("dasp"), 0, data & 8);
- cputag_set_input_line(space->machine, "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
+ tms57002_pload_w(space->machine().device("dasp"), 0, data & 4);
+ tms57002_cload_w(space->machine().device("dasp"), 0, data & 8);
+ cputag_set_input_line(space->machine(), "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -3649,7 +3649,7 @@ static MACHINE_START( konamigx )
static MACHINE_RESET(konamigx)
{
- device_t *k054539_2 = machine->device("konami2");
+ device_t *k054539_2 = machine.device("konami2");
int i;
konamigx_wrport1_0 = konamigx_wrport1_1 = 0;
@@ -3671,12 +3671,12 @@ static MACHINE_RESET(konamigx)
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
cputag_set_input_line(machine, "dasp", INPUT_LINE_RESET, ASSERT_LINE);
- if (!strcmp(machine->system().name, "tkmmpzdm"))
+ if (!strcmp(machine.system().name, "tkmmpzdm"))
{
// boost voice(chip 1 channel 3-7)
for (i=3; i<=7; i++) k054539_set_gain(k054539_2, i, 2.0);
}
- else if ((!strcmp(machine->system().name, "dragoonj")) || (!strcmp(machine->system().name, "dragoona")))
+ else if ((!strcmp(machine.system().name, "dragoonj")) || (!strcmp(machine.system().name, "dragoona")))
{
// soften percussions(chip 1 channel 0-3), boost voice(chip 1 channel 4-7)
for (i=0; i<=3; i++)
@@ -3756,12 +3756,12 @@ static DRIVER_INIT(konamigx)
snd020_hack = 0;
resume_trigger = 0;
- dmadelay_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ dmadelay_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
i = match = 0;
while ((gameDefs[i].cfgport != -1) && (!match))
{
- if (!strcmp(machine->system().name, gameDefs[i].romname))
+ if (!strcmp(machine.system().name, gameDefs[i].romname))
{
match = 1;
konamigx_cfgport = gameDefs[i].cfgport;
@@ -3771,13 +3771,13 @@ static DRIVER_INIT(konamigx)
switch (gameDefs[i].special)
{
case 1: // LE2 guns
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44000, 0xd44003, FUNC(le2_gun_H_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44004, 0xd44007, FUNC(le2_gun_V_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44000, 0xd44003, FUNC(le2_gun_H_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44004, 0xd44007, FUNC(le2_gun_V_r) );
break;
case 2: // tkmmpzdm hack
{
- UINT32 *rom = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rom = (UINT32*)machine.region("maincpu")->base();
// The display is initialized after POST but the copyright screen disabled
// planes B,C,D and didn't bother restoring them. I've spent a good
@@ -3808,7 +3808,7 @@ static DRIVER_INIT(konamigx)
break;
case 7: // install type 4 Xilinx protection for non-type 3/4 games
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc0000, 0xcc0007, FUNC(type4_prot_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc0000, 0xcc0007, FUNC(type4_prot_w) );
break;
case 8: // tbyahhoo
@@ -3828,14 +3828,14 @@ static DRIVER_INIT(konamigx)
switch (readback)
{
case BPP5:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx5bppspr_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx5bppspr_r));
break;
case BPP66:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd00000, 0xd01fff, FUNC(K056832_6bpp_rom_long_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd00000, 0xd01fff, FUNC(K056832_6bpp_rom_long_r));
case BPP6:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx6bppspr_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx6bppspr_r));
break;
}
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index 00ca8f9480c..8514d8ead33 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -235,7 +235,7 @@ static VIDEO_START( m2 )
static SCREEN_UPDATE( m2 )
{
- konamim2_state *state = screen->machine->driver_data<konamim2_state>();
+ konamim2_state *state = screen->machine().driver_data<konamim2_state>();
int i, j;
UINT32 fb_start = 0xffffffff;
@@ -266,7 +266,7 @@ static SCREEN_UPDATE( m2 )
static READ64_HANDLER(irq_enable_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
if (ACCESSING_BITS_32_63)
@@ -279,7 +279,7 @@ static READ64_HANDLER(irq_enable_r)
static WRITE64_HANDLER(irq_enable_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
state->irq_enable |= (UINT32)(data >> 32);
@@ -288,7 +288,7 @@ static WRITE64_HANDLER(irq_enable_w)
static READ64_HANDLER(irq_active_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
if (ACCESSING_BITS_32_63)
@@ -320,14 +320,14 @@ static READ64_HANDLER(unk2_r)
static READ64_HANDLER(unk3_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
//return U64(0xffffffffffffffff);
return state->unk3;
}
static READ64_HANDLER(unk4_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(space->cpu));
@@ -345,7 +345,7 @@ static READ64_HANDLER(unk4_r)
static WRITE64_HANDLER(unk4_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
// logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data),
// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(space->cpu));
@@ -354,7 +354,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));
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
}
state->unk20004 = (UINT32)(data);
@@ -364,7 +364,7 @@ static WRITE64_HANDLER(unk4_w)
static READ64_HANDLER(unk30000_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
state->counter1++;
return (UINT64)(state->counter1 & 0x7f) << 32;
}
@@ -380,7 +380,7 @@ static READ64_HANDLER(unk30030_r)
static WRITE64_HANDLER(video_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
state->vdl0_address = (UINT32)(data >> 32);
@@ -393,7 +393,7 @@ static WRITE64_HANDLER(video_w)
static WRITE64_HANDLER(video_irq_ack_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
if ((data >> 32) & 0x8000)
@@ -447,12 +447,12 @@ static WRITE64_HANDLER(unk4000418_w)
static WRITE64_HANDLER(reset_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
if (data & U64(0x100000000))
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
state->unk3 = 0;
}
}
@@ -473,9 +473,9 @@ static WRITE64_HANDLER(reset_w)
-static void cde_init(running_machine *machine)
+static void cde_init(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
cdrom_file *cd = cdrom_open(get_disk_handle(machine, "cdrom"));
const cdrom_toc *toc = cdrom_get_toc(cd);
@@ -513,9 +513,9 @@ static void cde_init(running_machine *machine)
state->cde_qchannel_offset = 0;
}
-static void cde_handle_command(running_machine *machine)
+static void cde_handle_command(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
switch (state->cde_command_bytes[0])
{
case 0x04: // Set Speed
@@ -688,9 +688,9 @@ static void cde_handle_command(running_machine *machine)
}
}
-static void cde_handle_reports(running_machine *machine)
+static void cde_handle_reports(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
switch (state->cde_command_bytes[0])
{
case 0x09:
@@ -809,7 +809,7 @@ static void cde_handle_reports(running_machine *machine)
static void cde_dma_transfer(address_space *space, int channel, int next)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT32 address;
//int length;
int i;
@@ -834,7 +834,7 @@ static void cde_dma_transfer(address_space *space, int channel, int next)
static READ64_HANDLER(cde_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT32 r = 0;
int reg = offset * 2;
@@ -872,7 +872,7 @@ static READ64_HANDLER(cde_r)
if (!state->cde_response)
{
- cde_handle_reports(space->machine);
+ cde_handle_reports(space->machine());
// state->cde_command_byte_ptr = 0;
// state->cde_command_bytes[state->cde_command_byte_ptr++] = 0x1c;
@@ -910,7 +910,7 @@ static READ64_HANDLER(cde_r)
static WRITE64_HANDLER(cde_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
int reg = offset * 2;
UINT32 d;
@@ -934,7 +934,7 @@ static WRITE64_HANDLER(cde_w)
{
if (state->cde_response)
{
- cde_handle_command(space->machine);
+ cde_handle_command(space->machine());
state->cde_response = 0;
}
@@ -1099,7 +1099,7 @@ static READ64_HANDLER(cpu_r)
if (ACCESSING_BITS_32_63)
{
- r = (UINT64)((space->cpu != space->machine->device("maincpu")) ? 0x80000000 : 0);
+ r = (UINT64)((space->cpu != space->machine().device("maincpu")) ? 0x80000000 : 0);
//r |= 0x40000000; // sets Video-LowRes !?
return r << 32;
}
@@ -1141,7 +1141,7 @@ static const powerpc_config ppc602_config =
static INTERRUPT_GEN(m2)
{
- konamim2_state *state = device->machine->driver_data<konamim2_state>();
+ konamim2_state *state = device->machine().driver_data<konamim2_state>();
if (state->irq_enable & 0x800000)
{
state->irq_active |= 0x800000;
@@ -1282,7 +1282,7 @@ ROM_END
static DRIVER_INIT( m2 )
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
state->unk3 = U64(0xffffffffffffffff);
state->unk20004 = 0;
cde_init(machine);
diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c
index c4a523a87c2..b1e4b1f0ea4 100644
--- a/src/mame/drivers/kongambl.c
+++ b/src/mame/drivers/kongambl.c
@@ -30,7 +30,7 @@ public:
static VIDEO_START(kongambl)
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_association(k056832, 0);
k056832_set_layer_offs(k056832, 0, -2, 0);
@@ -41,10 +41,10 @@ static VIDEO_START(kongambl)
static SCREEN_UPDATE(kongambl)
{
- device_t *k056832 = screen->machine->device("k056832");
+ device_t *k056832 = screen->machine().device("k056832");
bitmap_fill(bitmap, cliprect, 0);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
// k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
// k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
@@ -57,7 +57,7 @@ static READ32_HANDLER( eeprom_r )
{
if (ACCESSING_BITS_0_7)
{
- UINT32 rv = input_port_read(space->machine, "SYSTEM") & ~0x1;
+ UINT32 rv = input_port_read(space->machine(), "SYSTEM") & ~0x1;
return rv; // bit 0 freezes the game if 1
}
@@ -69,7 +69,7 @@ static WRITE32_HANDLER( eeprom_w )
{
if (ACCESSING_BITS_8_15)
{
- input_port_write(space->machine, "EEPROMOUT", (data>>8)&0xf, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", (data>>8)&0xf, 0xff);
}
}
@@ -109,11 +109,11 @@ static ADDRESS_MAP_START( kongamaud_map, AS_PROGRAM, 16 )
AM_RANGE(0x200000, 0x2000ff) AM_RAM // unknown (YMZ280b? Shared with 68020?)
ADDRESS_MAP_END
-static void kongambl_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+static void kongambl_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
}
-static void kongambl_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+static void kongambl_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
}
diff --git a/src/mame/drivers/kopunch.c b/src/mame/drivers/kopunch.c
index 94ad46e0357..dc0e352f00b 100644
--- a/src/mame/drivers/kopunch.c
+++ b/src/mame/drivers/kopunch.c
@@ -18,14 +18,14 @@ static READ8_HANDLER( kopunch_in_r )
{
/* port 31 + low 3 bits of port 32 contain the punch strength */
if (offset == 0)
- return space->machine->rand();
+ return space->machine().rand();
else
- return (space->machine->rand() & 0x07) | input_port_read(space->machine, "SYSTEM");
+ return (space->machine().rand() & 0x07) | input_port_read(space->machine(), "SYSTEM");
}
static WRITE8_HANDLER( kopunch_lamp_w )
{
- set_led_status(space->machine, 0, ~data & 0x80);
+ set_led_status(space->machine(), 0, ~data & 0x80);
// if ((data & 0x7f) != 0x7f)
// popmessage("port 38 = %02x",data);
@@ -33,8 +33,8 @@ static WRITE8_HANDLER( kopunch_lamp_w )
static WRITE8_HANDLER( kopunch_coin_w )
{
- coin_counter_w(space->machine, 0, ~data & 0x80);
- coin_counter_w(space->machine, 1, ~data & 0x40);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 1, ~data & 0x40);
// if ((data & 0x3f) != 0x3f)
// popmessage("port 34 = %02x",data);
@@ -70,7 +70,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( left_coin_inserted )
{
- kopunch_state *state = field->port->machine->driver_data<kopunch_state>();
+ kopunch_state *state = field->port->machine().driver_data<kopunch_state>();
/* left coin insertion causes a rst6.5 (vector 0x34) */
if (newval)
@@ -79,7 +79,7 @@ static INPUT_CHANGED( left_coin_inserted )
static INPUT_CHANGED( right_coin_inserted )
{
- kopunch_state *state = field->port->machine->driver_data<kopunch_state>();
+ kopunch_state *state = field->port->machine().driver_data<kopunch_state>();
/* right coin insertion causes a rst5.5 (vector 0x2c) */
if (newval)
@@ -173,16 +173,16 @@ GFXDECODE_END
static MACHINE_START( kopunch )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->gfxbank));
}
static MACHINE_RESET( kopunch )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
state->gfxbank = 0;
}
diff --git a/src/mame/drivers/ksayakyu.c b/src/mame/drivers/ksayakyu.c
index 5c072e78d52..893ef65332c 100644
--- a/src/mame/drivers/ksayakyu.c
+++ b/src/mame/drivers/ksayakyu.c
@@ -81,25 +81,25 @@ static WRITE8_HANDLER( bank_select_w )
xxxxxxx - unused ?
*/
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_HANDLER( latch_w )
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->sound_status &= ~0x80;
soundlatch_w(space, 0, data | 0x80);
}
static READ8_HANDLER (sound_status_r)
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
return state->sound_status | 4;
}
static WRITE8_HANDLER(tomaincpu_w)
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->sound_status |= 0x80;
soundlatch_w(space, 0, data);
}
@@ -252,8 +252,8 @@ GFXDECODE_END
static MACHINE_START( ksayakyu )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -264,7 +264,7 @@ static MACHINE_START( ksayakyu )
static MACHINE_RESET( ksayakyu )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
state->sound_status = 0xff;
state->video_ctrl = 0;
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 97d814b349d..b6918dac2d7 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -403,12 +403,12 @@ public:
int atapi_xfermod;
UINT32 m_n_security_control;
- void (*security_callback)( running_machine *machine, int data );
+ void (*security_callback)( running_machine &machine, int data );
UINT8 gx700pwbf_output_data[ 4 ];
- void (*gx700pwfbf_output_callback)( running_machine *machine, int offset, int data );
+ void (*gx700pwfbf_output_callback)( running_machine &machine, int offset, int data );
UINT16 gx894pwbba_output_data[ 8 ];
- void (*gx894pwbba_output_callback)( running_machine *machine, int offset, int data );
+ void (*gx894pwbba_output_callback)( running_machine &machine, int offset, int data );
UINT32 stage_mask;
struct
@@ -442,7 +442,7 @@ public:
double pad_position[ 6 ];
};
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -451,7 +451,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
}
}
@@ -459,26 +459,26 @@ static const char *const diskregions[] = { "cdrom0", "cdrom1" };
static WRITE32_HANDLER( mb89371_w )
{
- verboselog( space->machine, 2, "mb89371_w %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mb89371_w %08x %08x %08x\n", offset, mem_mask, data );
}
static READ32_HANDLER( mb89371_r )
{
UINT32 data = 0xffffffff;
- verboselog( space->machine, 2, "mb89371_r %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mb89371_r %08x %08x %08x\n", offset, mem_mask, data );
return data;
}
static READ32_HANDLER( jamma_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
- running_machine *machine = space->machine;
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
+ running_machine &machine = space->machine();
int security_cart_number = state->security_cart_number;
UINT32 data = input_port_read(machine, "IN1");
data |= 0x000000c0;
- ds2401_device *ds2401 = space->machine->device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
if( ds2401 )
{
@@ -504,61 +504,61 @@ static READ32_HANDLER( jamma_r )
static READ32_HANDLER( control_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
- verboselog( space->machine, 2, "control_r( %08x, %08x ) %08x\n", offset, mem_mask, state->control );
+ verboselog( space->machine(), 2, "control_r( %08x, %08x ) %08x\n", offset, mem_mask, state->control );
return state->control;
}
static WRITE32_HANDLER( control_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 control;
int old_bank = state->flash_bank;
COMBINE_DATA(&state->control);
control = state->control;
- verboselog( space->machine, 2, "control_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "control_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
state->flash_bank = -1;
// zs01 only, others are reached through security_w
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(state->security_cart_number ? "game_eeprom" : "install_eeprom");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(state->security_cart_number ? "game_eeprom" : "install_eeprom");
if( dynamic_cast<zs01_device *>(secflash) )
secflash->sda_w( !( ( control >> 6 ) & 1 ) ); /* 0x40 */
if( state->flash_device[0][0] != NULL && ( control & ~0x43 ) == 0x00 )
{
state->flash_bank = (0 << 8) + ( ( control & 3 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "onboard %d\n", control & 3 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "onboard %d\n", control & 3 );
}
else if( state->flash_device[1][0] != NULL && ( control & ~0x47 ) == 0x10 )
{
state->flash_bank = (1 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard1 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard1 %d\n", control & 7 );
}
else if( state->flash_device[2][0] != NULL && ( control & ~0x47 ) == 0x20 )
{
state->flash_bank = (2 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard2 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard2 %d\n", control & 7 );
}
else if( state->flash_device[3][0] != NULL && ( control & ~0x47 ) == 0x20 )
{
state->flash_bank = (3 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard3 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard3 %d\n", control & 7 );
}
else if( state->flash_device[4][0] != NULL && ( control & ~0x47 ) == 0x28 )
{
state->flash_bank = (4 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard4 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard4 %d\n", control & 7 );
}
}
static TIMER_CALLBACK( atapi_xfer_end )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *atapi_regs = state->atapi_regs;
int i, n_this;
@@ -610,7 +610,7 @@ static TIMER_CALLBACK( atapi_xfer_end )
atapi_regs[ATAPI_REG_COUNTLOW] = state->atapi_xferlen & 0xff;
atapi_regs[ATAPI_REG_COUNTHIGH] = (state->atapi_xferlen>>8)&0xff;
- state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
+ state->atapi_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
}
else
{
@@ -626,9 +626,9 @@ static TIMER_CALLBACK( atapi_xfer_end )
static READ32_HANDLER( atapi_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
int reg, data;
if (mem_mask == 0x0000ffff) // word-wide command read
@@ -672,7 +672,7 @@ static READ32_HANDLER( atapi_r )
atapi_regs[ATAPI_REG_COUNTLOW] = state->atapi_xferlen & 0xff;
atapi_regs[ATAPI_REG_COUNTHIGH] = (state->atapi_xferlen>>8)&0xff;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
if( state->atapi_data_ptr < state->atapi_data_len )
@@ -689,7 +689,7 @@ static READ32_HANDLER( atapi_r )
{
atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
}
}
@@ -750,10 +750,10 @@ static READ32_HANDLER( atapi_r )
static WRITE32_HANDLER( atapi_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
UINT8 *atapi_data = state->atapi_data;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
int reg;
verboselog( machine, 2, "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
@@ -775,7 +775,7 @@ static WRITE32_HANDLER( atapi_w )
SCSIWriteData( state->inserted_cdrom, atapi_data, state->atapi_cdata_wait );
// assert IRQ
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
// not sure here, but clear DRQ at least?
atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -848,7 +848,7 @@ static WRITE32_HANDLER( atapi_w )
}
// assert IRQ
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
else
{
@@ -965,7 +965,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_regs[ATAPI_REG_COUNTLOW] = 0;
atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
break;
case 0xef: // SET FEATURES
@@ -974,7 +974,7 @@ static WRITE32_HANDLER( atapi_w )
state->atapi_data_ptr = 0;
state->atapi_data_len = 0;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
break;
default:
@@ -992,16 +992,16 @@ static void atapi_exit(running_machine& machine)
for( i = 0; i < 2; i++ )
{
- if( get_disk_handle( &machine, diskregions[i] ) != NULL )
+ if( get_disk_handle( machine, diskregions[i] ) != NULL )
{
SCSIDeleteInstance( state->available_cdroms[ i ] );
}
}
}
-static void atapi_init(running_machine *machine)
+static void atapi_init(running_machine &machine)
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int i;
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -1013,7 +1013,7 @@ static void atapi_init(running_machine *machine)
state->atapi_data_len = 0;
state->atapi_cdata_wait = 0;
- state->atapi_timer = machine->scheduler().timer_alloc(FUNC(atapi_xfer_end));
+ state->atapi_timer = machine.scheduler().timer_alloc(FUNC(atapi_xfer_end));
state->atapi_timer->adjust(attotime::never);
for( i = 0; i < 2; i++ )
@@ -1027,7 +1027,7 @@ static void atapi_init(running_machine *machine)
state->available_cdroms[ i ] = NULL;
}
}
- machine->add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
state->save_item( NAME(state->atapi_regs) );
@@ -1042,14 +1042,14 @@ static void atapi_init(running_machine *machine)
static WRITE32_HANDLER( atapi_reset_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
- verboselog( space->machine, 2, "atapi_reset_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "atapi_reset_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
if (data)
{
- verboselog( space->machine, 2, "atapi_reset_w: reset\n" );
+ verboselog( space->machine(), 2, "atapi_reset_w: reset\n" );
// mame_printf_debug("ATAPI reset\n");
@@ -1067,15 +1067,15 @@ static WRITE32_HANDLER( atapi_reset_w )
}
}
-static void cdrom_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void cdrom_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
verboselog( machine, 2, "cdrom_dma_read( %08x, %08x )\n", n_address, n_size );
// mame_printf_debug("DMA read: address %08x size %08x\n", n_address, n_size);
}
-static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void cdrom_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
verboselog( machine, 2, "cdrom_dma_write( %08x, %08x )\n", n_address, n_size );
// mame_printf_debug("DMA write: address %08x size %08x\n", n_address, n_size);
@@ -1085,22 +1085,22 @@ static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n
verboselog( machine, 2, "atapi_xfer_end: %d %d\n", state->atapi_xferlen, state->atapi_xfermod );
// set a transfer complete timer (Note: CYCLES_PER_SECTOR can't be lower than 2000 or the BIOS ends up "out of order")
- state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
+ state->atapi_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
}
static WRITE32_HANDLER( security_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
int security_cart_number = state->security_cart_number;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
COMBINE_DATA( &state->m_n_security_control );
- verboselog( space->machine, 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
if( ACCESSING_BITS_0_15 )
{
- ds2401_device *ds2401 = space->machine->device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
if( secflash ) {
if( !dynamic_cast<zs01_device *>(secflash) )
@@ -1126,16 +1126,16 @@ static WRITE32_HANDLER( security_w )
static READ32_HANDLER( security_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = state->m_n_security_control;
- verboselog( space->machine, 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
static READ32_HANDLER( flash_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = 0;
if( state->flash_bank < 0 )
@@ -1166,16 +1166,16 @@ static READ32_HANDLER( flash_r )
}
}
- verboselog( space->machine, 2, "flash_r( %08x, %08x, %08x) bank = %08x\n", offset, mem_mask, data, state->flash_bank );
+ verboselog( space->machine(), 2, "flash_r( %08x, %08x, %08x) bank = %08x\n", offset, mem_mask, data, state->flash_bank );
return data;
}
static WRITE32_HANDLER( flash_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
- verboselog( space->machine, 2, "flash_w( %08x, %08x, %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "flash_w( %08x, %08x, %08x\n", offset, mem_mask, data );
if( state->flash_bank < 0 )
{
@@ -1245,26 +1245,26 @@ ADDRESS_MAP_END
-static void flash_init( running_machine *machine )
+static void flash_init( running_machine &machine )
{
// find onboard flash devices
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
astring tempstr;
for (int index = 0; index < 8; index++)
- state->flash_device[0][index] = machine->device<fujitsu_29f016a_device>(tempstr.format("onboard.%d", index));
+ state->flash_device[0][index] = machine.device<fujitsu_29f016a_device>(tempstr.format("onboard.%d", index));
// find pccard flash devices
for (int card = 1; card <= 4; card++)
for (int index = 0; index < 16; index++)
- state->flash_device[card][index] = machine->device<fujitsu_29f016a_device>(tempstr.format("pccard%d.%d", card, index));
+ state->flash_device[card][index] = machine.device<fujitsu_29f016a_device>(tempstr.format("pccard%d.%d", card, index));
state->save_item( NAME(state->flash_bank) );
state->save_item( NAME(state->control) );
}
-static void *atapi_get_device(running_machine *machine)
+static void *atapi_get_device(running_machine &machine)
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
void *ret;
SCSIGetDevice( state->inserted_cdrom, &ret );
return ret;
@@ -1272,7 +1272,7 @@ static void *atapi_get_device(running_machine *machine)
static DRIVER_INIT( konami573 )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
psx_driver_init(machine);
atapi_init(machine);
@@ -1286,11 +1286,11 @@ static DRIVER_INIT( konami573 )
static MACHINE_RESET( konami573 )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
psx_machine_init(machine);
- if( state->machine->device<device_secure_serial_flash>("install_eeprom") )
+ if( state->machine().device<device_secure_serial_flash>("install_eeprom") )
{
/* security cart */
psx_sio_input( machine, 1, PSX_SIO_IN_DSR, PSX_SIO_IN_DSR );
@@ -1303,18 +1303,18 @@ static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
-static void update_mode( running_machine *machine )
+static void update_mode( running_machine &machine )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int cart = input_port_read(machine, "CART");
int cd = input_port_read( machine, "CD" );
SCSIInstance *new_cdrom;
- if( state->machine->device<device_secure_serial_flash>("game_eeprom") )
+ if( state->machine().device<device_secure_serial_flash>("game_eeprom") )
{
state->security_cart_number = cart;
}
@@ -1335,18 +1335,18 @@ static void update_mode( running_machine *machine )
if( state->inserted_cdrom != new_cdrom )
{
state->inserted_cdrom = new_cdrom;
- cdda_set_cdrom(machine->device("cdda"), atapi_get_device(machine));
+ cdda_set_cdrom(machine.device("cdda"), atapi_get_device(machine));
}
}
static INTERRUPT_GEN( sys573_vblank )
{
- ksys573_state *state = device->machine->driver_data<ksys573_state>();
+ ksys573_state *state = device->machine().driver_data<ksys573_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
- update_mode(device->machine);
+ update_mode(device->machine());
- if( strcmp( device->machine->system().name, "ddr2ml" ) == 0 )
+ if( strcmp( device->machine().system().name, "ddr2ml" ) == 0 )
{
/* patch out security-plate error */
@@ -1368,7 +1368,7 @@ static INTERRUPT_GEN( sys573_vblank )
p_n_psxram[ 0x1f850 / 4 ] = 0x08007e22;
}
}
- else if( strcmp( device->machine->system().name, "ddr2mla" ) == 0 )
+ else if( strcmp( device->machine().system().name, "ddr2mla" ) == 0 )
{
/* patch out security-plate error */
@@ -1395,14 +1395,14 @@ todo:
static READ32_HANDLER( ge765pwbba_r )
{
- device_t *upd4701 = space->machine->device("upd4701");
+ device_t *upd4701 = space->machine().device("upd4701");
UINT32 data = 0;
switch (offset)
{
case 0x26:
- upd4701_y_add(upd4701, 0, input_port_read_safe(space->machine, "uPD4701_y", 0), 0xffff);
- upd4701_switches_set(upd4701, 0, input_port_read_safe(space->machine, "uPD4701_switches", 0));
+ upd4701_y_add(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_y", 0), 0xffff);
+ upd4701_switches_set(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_switches", 0));
upd4701_cs_w(upd4701, 0, 0);
upd4701_xy_w(upd4701, 0, 1);
@@ -1423,17 +1423,17 @@ static READ32_HANDLER( ge765pwbba_r )
break;
default:
- verboselog(space->machine, 0, "ge765pwbba_r: unhandled offset %08x %08x\n", offset, mem_mask);
+ verboselog(space->machine(), 0, "ge765pwbba_r: unhandled offset %08x %08x\n", offset, mem_mask);
break;
}
- verboselog(space->machine, 2, "ge765pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data);
+ verboselog(space->machine(), 2, "ge765pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data);
return data;
}
static WRITE32_HANDLER( ge765pwbba_w )
{
- device_t *upd4701 = space->machine->device("upd4701");
+ device_t *upd4701 = space->machine().device("upd4701");
switch (offset)
{
case 0x04:
@@ -1462,17 +1462,17 @@ static WRITE32_HANDLER( ge765pwbba_w )
break;
default:
- verboselog(space->machine, 0, "ge765pwbba_w: unhandled offset %08x %08x %08x\n", offset, mem_mask, data);
+ verboselog(space->machine(), 0, "ge765pwbba_w: unhandled offset %08x %08x %08x\n", offset, mem_mask, data);
break;
}
- verboselog(space->machine, 2, "ge765pwbba_w( %08x, %08x, %08x )\n", offset, mem_mask, data);
+ verboselog(space->machine(), 2, "ge765pwbba_w( %08x, %08x, %08x )\n", offset, mem_mask, data);
}
static DRIVER_INIT( ge765pwbba )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(ge765pwbba_r), FUNC(ge765pwbba_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(ge765pwbba_r), FUNC(ge765pwbba_w) );
}
/*
@@ -1509,14 +1509,14 @@ static READ32_HANDLER( gx700pwbf_io_r )
break;
}
- verboselog( space->machine, 2, "gx700pwbf_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx700pwbf_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
-static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data )
+static void gx700pwbf_output( running_machine &machine, int offset, UINT8 data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
if( state->gx700pwfbf_output_callback != NULL )
{
@@ -1537,7 +1537,7 @@ static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data )
static WRITE32_HANDLER( gx700pwbf_io_w )
{
- verboselog( space->machine, 2, "gx700pwbf_io_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx700pwbf_io_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
switch( offset )
{
@@ -1545,28 +1545,28 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 0, data & 0xff );
+ gx700pwbf_output( space->machine(), 0, data & 0xff );
}
break;
case 0x22:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 1, data & 0xff );
+ gx700pwbf_output( space->machine(), 1, data & 0xff );
}
break;
case 0x24:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 2, data & 0xff );
+ gx700pwbf_output( space->machine(), 2, data & 0xff );
}
break;
case 0x26:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 3, data & 0xff );
+ gx700pwbf_output( space->machine(), 3, data & 0xff );
}
break;
@@ -1576,15 +1576,15 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
}
}
-static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
+static void gx700pwfbf_init( running_machine &machine, void (*output_callback_func)( running_machine &machine, int offset, int data ) )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
memset( state->gx700pwbf_output_data, 0, sizeof( state->gx700pwbf_output_data ) );
state->gx700pwfbf_output_callback = output_callback_func;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx700pwbf_io_r), FUNC(gx700pwbf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx700pwbf_io_r), FUNC(gx700pwbf_io_w) );
state->save_item( NAME(state->gx700pwbf_output_data) );
}
@@ -1610,16 +1610,16 @@ static const int mask[] =
0, 4, 0, 6
};
-static void gn845pwbb_do_w( running_machine *machine, int offset, int data )
+static void gn845pwbb_do_w( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
state->stage[ offset ].DO = !data;
}
-static void gn845pwbb_clk_w( running_machine *machine, int offset, int data )
+static void gn845pwbb_clk_w( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int clk = !data;
if( clk != state->stage[ offset ].clk )
@@ -1668,12 +1668,12 @@ static void gn845pwbb_clk_w( running_machine *machine, int offset, int data )
static CUSTOM_INPUT( gn845pwbb_read )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
- return input_port_read(field->port->machine, "STAGE") & state->stage_mask;
+ return input_port_read(field->port->machine(), "STAGE") & state->stage_mask;
}
-static void gn845pwbb_output_callback( running_machine *machine, int offset, int data )
+static void gn845pwbb_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -1762,7 +1762,7 @@ static void gn845pwbb_output_callback( running_machine *machine, int offset, int
static DRIVER_INIT( ddr )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -1791,17 +1791,17 @@ static READ32_HANDLER( gtrfrks_io_r )
break;
default:
- verboselog( space->machine, 0, "gtrfrks_io_r: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "gtrfrks_io_r: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
- verboselog( space->machine, 2, "gtrfrks_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gtrfrks_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
static WRITE32_HANDLER( gtrfrks_io_w )
{
- verboselog( space->machine, 2, "gtrfrks_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gtrfrks_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -1816,7 +1816,7 @@ static WRITE32_HANDLER( gtrfrks_io_w )
break;
default:
- verboselog( space->machine, 0, "gtrfrks_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "gtrfrks_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -1825,14 +1825,14 @@ static DRIVER_INIT( gtrfrks )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
}
/* GX894 digital i/o */
static READ32_HANDLER( gx894pwbba_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = 0;
switch( offset )
@@ -1849,7 +1849,7 @@ static READ32_HANDLER( gx894pwbba_r )
case 0x2b:
if( ACCESSING_BITS_0_15 )
{
- mas3507d_device *mas3507d = space->machine->device<mas3507d_device>("mpeg");
+ mas3507d_device *mas3507d = space->machine().device<mas3507d_device>("mpeg");
data |= mas3507d->i2c_scl_r() << 13;
data |= mas3507d->i2c_sda_r() << 12;
}
@@ -1910,7 +1910,7 @@ static READ32_HANDLER( gx894pwbba_r )
case 0x3b:
if( ACCESSING_BITS_16_31 )
{
- data |= space->machine->device<ds2401_device>("digital_id")->read() << 28;
+ data |= space->machine().device<ds2401_device>("digital_id")->read() << 28;
}
break;
case 0x3d:
@@ -1933,7 +1933,7 @@ static READ32_HANDLER( gx894pwbba_r )
break;
}
- verboselog( space->machine, 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(space->cpu), offset, mem_mask, data );
return data;
}
@@ -1949,9 +1949,9 @@ static char *binary( char *s, UINT32 data )
return s;
}
-static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data )
+static void gx894pwbba_output( running_machine &machine, int offset, UINT8 data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
if( state->gx894pwbba_output_callback != NULL )
{
@@ -1972,7 +1972,7 @@ static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data
static WRITE32_HANDLER( gx894pwbba_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
char buff[33];
UINT32 olda=state->a,oldb=state->b,oldc=state->c,oldd=state->d;
@@ -1983,7 +1983,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
return;
}
- verboselog( space->machine, 2, "gx894pwbba_w( %08x, %08x, %08x) %s\n", offset, mem_mask, data, binary( buff, data ) );
+ verboselog( space->machine(), 2, "gx894pwbba_w( %08x, %08x, %08x) %s\n", offset, mem_mask, data, binary( buff, data ) );
switch( offset )
{
@@ -2005,7 +2005,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
break;
case 0x2b:
if(ACCESSING_BITS_0_15) {
- mas3507d_device *mas3507d = space->machine->device<mas3507d_device>("mpeg");
+ mas3507d_device *mas3507d = space->machine().device<mas3507d_device>("mpeg");
mas3507d->i2c_scl_w(data & 0x2000);
mas3507d->i2c_sda_w(data & 0x1000);
}
@@ -2055,22 +2055,22 @@ static WRITE32_HANDLER( gx894pwbba_w )
case 0x38:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 0, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 0, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 1, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 1, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->a );
break;
case 0x39:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 7, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 7, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 3, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 3, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->b );
break;
@@ -2083,7 +2083,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
logerror("FPGA MPEG key 3/3 %02x\n", data & 0xff);
if( ACCESSING_BITS_16_31 )
{
- space->machine->device<ds2401_device>("digital_id")->write( !( ( data >> 28 ) & 1 ) );
+ space->machine().device<ds2401_device>("digital_id")->write( !( ( data >> 28 ) & 1 ) );
}
break;
case 0x3e:
@@ -2108,18 +2108,18 @@ static WRITE32_HANDLER( gx894pwbba_w )
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 4, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 4, ( data >> 28 ) & 0xf );
}
COMBINE_DATA( &state->c );
break;
case 0x3f:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 2, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 2, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 5, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 5, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->d );
break;
@@ -2133,14 +2133,14 @@ static WRITE32_HANDLER( gx894pwbba_w )
}
}
-static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
+static void gx894pwbba_init( running_machine &machine, void (*output_callback_func)( running_machine &machine, int offset, int data ) )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int gx894_ram_size = 24 * 1024 * 1024;
state->gx894pwbba_output_callback = output_callback_func;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx894pwbba_r), FUNC(gx894pwbba_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx894pwbba_r), FUNC(gx894pwbba_w) );
state->gx894_ram_write_offset = 0;
state->gx894_ram_read_offset = 0;
@@ -2167,12 +2167,12 @@ static DRIVER_INIT( gtrfrkdigital )
gx894pwbba_init( machine, NULL );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
}
/* ddr solo */
-static void ddrsolo_output_callback( running_machine *machine, int offset, int data )
+static void ddrsolo_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2234,7 +2234,7 @@ static DRIVER_INIT( ddrsolo )
/* drummania */
-static void drmn_output_callback( running_machine *machine, int offset, int data )
+static void drmn_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2314,7 +2314,7 @@ static DRIVER_INIT( drmndigital )
/* dance maniax */
-static void dmx_output_callback( running_machine *machine, int offset, int data )
+static void dmx_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2434,7 +2434,7 @@ static void dmx_output_callback( running_machine *machine, int offset, int data
static WRITE32_HANDLER( dmx_io_w )
{
- verboselog( space->machine, 2, "dmx_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "dmx_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -2449,7 +2449,7 @@ static WRITE32_HANDLER( dmx_io_w )
break;
default:
- verboselog( space->machine, 0, "dmx_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "dmx_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -2460,14 +2460,14 @@ static DRIVER_INIT( dmx )
gx894pwbba_init( machine, dmx_output_callback );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(dmx_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(dmx_io_w) );
}
/* salary man champ */
-static void salarymc_lamp_callback( running_machine *machine, int data )
+static void salarymc_lamp_callback( running_machine &machine, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int d = ( data >> 7 ) & 1;
int rst = ( data >> 6 ) & 1;
int clk = ( data >> 5 ) & 1;
@@ -2513,7 +2513,7 @@ static void salarymc_lamp_callback( running_machine *machine, int data )
static DRIVER_INIT( salarymc )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -2526,9 +2526,9 @@ static DRIVER_INIT( salarymc )
/* Hyper Bishi Bashi Champ */
-static void hyperbbc_lamp_callback( running_machine *machine, int data )
+static void hyperbbc_lamp_callback( running_machine &machine, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int red = ( data >> 6 ) & 1;
int blue = ( data >> 5 ) & 1;
int green = ( data >> 4 ) & 1;
@@ -2556,7 +2556,7 @@ static void hyperbbc_lamp_callback( running_machine *machine, int data )
static DRIVER_INIT( hyperbbc )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -2568,7 +2568,7 @@ static DRIVER_INIT( hyperbbc )
/* Mambo A Go Go */
-static void mamboagg_output_callback( running_machine *machine, int offset, int data )
+static void mamboagg_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2598,7 +2598,7 @@ static void mamboagg_output_callback( running_machine *machine, int offset, int
static WRITE32_HANDLER( mamboagg_io_w )
{
- verboselog( space->machine, 2, "mamboagg_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mamboagg_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -2609,7 +2609,7 @@ static WRITE32_HANDLER( mamboagg_io_w )
break;
default:
- verboselog( space->machine, 0, "mamboagg_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "mamboagg_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -2620,7 +2620,7 @@ static DRIVER_INIT( mamboagg )
gx894pwbba_init( machine, mamboagg_output_callback );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(mamboagg_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(mamboagg_io_w) );
}
@@ -2629,9 +2629,9 @@ static DRIVER_INIT( mamboagg )
static double punchmania_inputs_callback( device_t *device, UINT8 input )
{
- ksys573_state *state = device->machine->driver_data<ksys573_state>();
+ ksys573_state *state = device->machine().driver_data<ksys573_state>();
double *pad_position = state->pad_position;
- int pads = input_port_read(device->machine, "PADS");
+ int pads = input_port_read(device->machine(), "PADS");
for( int i = 0; i < 6; i++ )
{
if( ( pads & ( 1 << i ) ) != 0 )
@@ -2664,9 +2664,9 @@ static double punchmania_inputs_callback( device_t *device, UINT8 input )
int pad_light[ 6 ];
-static void punchmania_output_callback( running_machine *machine, int offset, int data )
+static void punchmania_output_callback( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
double *pad_position = state->pad_position;
char pad[ 7 ];
@@ -2805,8 +2805,8 @@ static DRIVER_INIT( punchmania )
static WRITE32_HANDLER( gunmania_w )
{
char s[ 1024 ] = "";
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
- ds2401_device *ds2401 = space->machine->device<ds2401_device>("gunmania_id");
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>("gunmania_id");
switch( offset )
{
@@ -2891,12 +2891,12 @@ static WRITE32_HANDLER( gunmania_w )
break;
}
- verboselog( space->machine, 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
}
static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
if( state->tank_shutter_position == 0 )
{
@@ -2908,7 +2908,7 @@ static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
static CUSTOM_INPUT( gunmania_cable_holder_sensor )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
return state->cable_holder_release;
}
@@ -2916,32 +2916,32 @@ static CUSTOM_INPUT( gunmania_cable_holder_sensor )
static READ32_HANDLER( gunmania_r )
{
UINT32 data = 0;
- ds2401_device *ds2401 = space->machine->device<ds2401_device>("gunmania_id");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>("gunmania_id");
switch( offset )
{
case 0x20:
- data = input_port_read( space->machine, "GUNX" ) | ds2401->read() << 7;
+ data = input_port_read( space->machine(), "GUNX" ) | ds2401->read() << 7;
break;
case 0x22:
- data = input_port_read( space->machine, "GUNY" ) | input_port_read( space->machine, "SENSOR" );
+ data = input_port_read( space->machine(), "GUNY" ) | input_port_read( space->machine(), "SENSOR" );
break;
case 0x34:
- data = input_port_read( space->machine, "ENCODER" );
+ data = input_port_read( space->machine(), "ENCODER" );
popmessage( "encoder %04x", data );
break;
}
- verboselog( space->machine, 2, "gunmania_r %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gunmania_r %08x %08x %08x\n", offset, mem_mask, data );
return data;
}
static DRIVER_INIT( gunmania )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gunmania_r), FUNC(gunmania_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gunmania_r), FUNC(gunmania_w) );
}
/* ADC0834 Interface */
@@ -2951,13 +2951,13 @@ static double analogue_inputs_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)( 5 * input_port_read_safe( device->machine, "analog0", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog0", 0 ) ) / 255.0;
case ADC083X_CH1:
- return (double)( 5 * input_port_read_safe( device->machine, "analog1", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog1", 0 ) ) / 255.0;
case ADC083X_CH2:
- return (double)( 5 * input_port_read_safe( device->machine, "analog2", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog2", 0 ) ) / 255.0;
case ADC083X_CH3:
- return (double)( 5 * input_port_read_safe( device->machine, "analog3", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog3", 0 ) ) / 255.0;
case ADC083X_AGND:
return 0;
case ADC083X_VREF:
diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c
index 66209107937..2434b550563 100644
--- a/src/mame/drivers/kungfur.c
+++ b/src/mame/drivers/kungfur.c
@@ -120,7 +120,7 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value)
/* actually debugging purpose, it will be converted to the artwork system at some point. */
static SCREEN_UPDATE( kungfur )
{
- kungfur_state *state = screen->machine->driver_data<kungfur_state>();
+ kungfur_state *state = screen->machine().driver_data<kungfur_state>();
// popmessage("%02x %02x %02x %02x %02x %02x",io_data[0],io_data[1],io_data[2],io_data[3],io_data[4],io_data[5]);
int i;
@@ -132,7 +132,7 @@ static SCREEN_UPDATE( kungfur )
static WRITE8_DEVICE_HANDLER( test0_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->mux_data = data & 7; /* multiplexer selector? (00-06) */
state->mux_data|= (data & 0x10)>>1;
@@ -147,7 +147,7 @@ static WRITE8_DEVICE_HANDLER( test1_w )
static WRITE8_DEVICE_HANDLER( test2_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
// io_data[2] = data; /* lower nibble should be NULL */
state->led[state->mux_data] = data;
// printf("%02x Unk 2 W\n",data);
@@ -162,7 +162,7 @@ static WRITE8_DEVICE_HANDLER( test3_w )
/*mux is always 0*/
static WRITE8_DEVICE_HANDLER( test4_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
// io_data[4] = data;
state->led[state->mux_data] = data;
}
@@ -177,18 +177,18 @@ static WRITE8_DEVICE_HANDLER( test5_w )
static WRITE8_DEVICE_HANDLER( kungfur_adpcm1_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->adpcm_pos[0] = 0x40000+(data & 0xff) * 0x100;
state->adpcm_idle[0] = 0;
- msm5205_reset_w(device->machine->device("adpcm1"),0);
+ msm5205_reset_w(device->machine().device("adpcm1"),0);
}
static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->adpcm_pos[1] = (data & 0xff) * 0x400;
state->adpcm_idle[1] = 0;
- msm5205_reset_w(device->machine->device("adpcm2"),0);
+ msm5205_reset_w(device->machine().device("adpcm2"),0);
}
/*
@@ -279,19 +279,19 @@ static const ppi8255_interface ppi8255_intf[2] =
static void kfr_adpcm1_int(device_t *device)
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
if (state->adpcm_pos[0] >= 0x40000 || state->adpcm_idle[0])
{
- msm5205_reset_w(device->machine->device("adpcm1"),1);
+ msm5205_reset_w(device->machine().device("adpcm1"),1);
state->trigger1 = 0;
}
else
{
- UINT8 *ROM = device->machine->region("adpcm1")->base();
+ UINT8 *ROM = device->machine().region("adpcm1")->base();
state->adpcm_data1 = ((state->trigger1 ? (ROM[state->adpcm_pos[0]] & 0x0f) : (ROM[state->adpcm_pos[0]] & 0xf0)>>4) );
- msm5205_data_w(device->machine->device("adpcm1"), state->adpcm_data1 & 0xf);
+ msm5205_data_w(device->machine().device("adpcm1"), state->adpcm_data1 & 0xf);
state->trigger1 ^= 1;
if(state->trigger1 == 0)
{
@@ -305,19 +305,19 @@ static void kfr_adpcm1_int(device_t *device)
static void kfr_adpcm2_int(device_t *device)
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
if (state->adpcm_pos[1] >= 0x10000 || state->adpcm_idle[1])
{
- msm5205_reset_w(device->machine->device("adpcm2"),1);
+ msm5205_reset_w(device->machine().device("adpcm2"),1);
state->trigger2 = 0;
}
else
{
- UINT8 *ROM = device->machine->region("adpcm2")->base();
+ UINT8 *ROM = device->machine().region("adpcm2")->base();
state->adpcm_data2 = ((state->trigger2 ? (ROM[state->adpcm_pos[1]] & 0x0f) : (ROM[state->adpcm_pos[1]] & 0xf0)>>4) );
- msm5205_data_w(device->machine->device("adpcm2"), state->adpcm_data2 & 0xf);
+ msm5205_data_w(device->machine().device("adpcm2"), state->adpcm_data2 & 0xf);
state->trigger2 ^= 1;
if(state->trigger2 == 0)
{
@@ -342,14 +342,14 @@ static const msm5205_interface msm5205_config_2 =
static MACHINE_RESET( kungfur )
{
- kungfur_state *state = machine->driver_data<kungfur_state>();
+ kungfur_state *state = machine.driver_data<kungfur_state>();
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
state->adpcm_idle[0] = state->adpcm_idle[1] = 1;
}
static INTERRUPT_GEN( kungfur_irq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
}
static MACHINE_CONFIG_START( kungfur, kungfur_state )
diff --git a/src/mame/drivers/kyugo.c b/src/mame/drivers/kyugo.c
index cd3852e91e8..732764a1d54 100644
--- a/src/mame/drivers/kyugo.c
+++ b/src/mame/drivers/kyugo.c
@@ -36,7 +36,7 @@
static WRITE8_HANDLER( kyugo_sub_cpu_control_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
device_set_input_line(state->subcpu, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
}
@@ -449,10 +449,10 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( kyugo )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->scroll_x_lo));
state->save_item(NAME(state->scroll_x_hi));
@@ -464,10 +464,10 @@ static MACHINE_START( kyugo )
static MACHINE_RESET( kyugo )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ kyugo_state *state = machine.driver_data<kyugo_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
// must start with interrupts and sub CPU disabled
- cpu_interrupt_enable(machine->device("maincpu"), 0);
+ cpu_interrupt_enable(machine.device("maincpu"), 0);
kyugo_sub_cpu_control_w(space, 0, 0);
state->scroll_x_lo = 0;
@@ -1333,19 +1333,19 @@ ROM_END
static DRIVER_INIT( gyrodine )
{
/* add watchdog */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(watchdog_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(watchdog_reset_w));
}
static DRIVER_INIT( srdmissn )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
/* shared RAM is mapped at 0xe000 as well */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xe000, 0xe7ff, state->shared_ram);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xe000, 0xe7ff, state->shared_ram);
/* extra RAM on sub CPU */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_ram(0x8800, 0x8fff);
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_ram(0x8800, 0x8fff);
}
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index 6811a0e6ab0..2df7cd79e3a 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -19,7 +19,7 @@
static INTERRUPT_GEN( labyrunr_interrupt )
{
- labyrunr_state *state = device->machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
if (cpu_getiloops(device) == 0)
{
@@ -38,11 +38,11 @@ static WRITE8_HANDLER( labyrunr_bankswitch_w )
if (data & 0xe0) popmessage("bankswitch %02x", data);
/* bits 0-2 = bank number */
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check if data&7 > #banks?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check if data&7 > #banks?
/* bits 3 and 4 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
}
static ADDRESS_MAP_START( labyrunr_map, AS_PROGRAM, 8 )
@@ -185,12 +185,12 @@ static const ym2203_interface ym2203_interface_2 =
static MACHINE_START( labyrunr )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
- state->k007121 = machine->device("k007121");
+ state->k007121 = machine.device("k007121");
}
static MACHINE_CONFIG_START( labyrunr, labyrunr_state )
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 616a4e1b4ed..6afb4e8c8c3 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -67,25 +67,25 @@ TODO:
/* Sound comm between CPU's */
static READ8_HANDLER( sraider_sound_low_r )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
return state->sound_low;
}
static READ8_HANDLER( sraider_sound_high_r )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
return state->sound_high;
}
static WRITE8_HANDLER( sraider_sound_low_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->sound_low = data;
}
static WRITE8_HANDLER( sraider_sound_high_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->sound_high = data;
}
@@ -100,7 +100,7 @@ static READ8_HANDLER( sraider_8005_r )
/* Unknown IO */
static WRITE8_HANDLER( sraider_misc_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
switch(offset)
{
@@ -189,7 +189,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin1_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
/* left coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@@ -197,7 +197,7 @@ static INPUT_CHANGED( coin1_inserted )
static INPUT_CHANGED( coin2_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
/* right coin insertion causes an IRQ */
if (newval)
@@ -210,7 +210,7 @@ static INPUT_CHANGED( coin2_inserted )
static CUSTOM_INPUT( ladybug_p1_control_r )
{
- return input_port_read(field->port->machine, LADYBUG_P1_CONTROL_PORT_TAG);
+ return input_port_read(field->port->machine(), LADYBUG_P1_CONTROL_PORT_TAG);
}
static CUSTOM_INPUT( ladybug_p2_control_r )
@@ -218,10 +218,10 @@ static CUSTOM_INPUT( ladybug_p2_control_r )
UINT32 ret;
/* upright cabinet only uses a single set of controls */
- if (input_port_read(field->port->machine, "DSW0") & 0x20)
- ret = input_port_read(field->port->machine, LADYBUG_P2_CONTROL_PORT_TAG);
+ if (input_port_read(field->port->machine(), "DSW0") & 0x20)
+ ret = input_port_read(field->port->machine(), LADYBUG_P2_CONTROL_PORT_TAG);
else
- ret = input_port_read(field->port->machine, LADYBUG_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(field->port->machine(), LADYBUG_P1_CONTROL_PORT_TAG);
return ret;
}
@@ -724,15 +724,15 @@ GFXDECODE_END
static MACHINE_START( ladybug )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
- state->maincpu = machine->device("maincpu");
+ ladybug_state *state = machine.driver_data<ladybug_state>();
+ state->maincpu = machine.device("maincpu");
}
static MACHINE_START( sraider )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->grid_color));
state->save_item(NAME(state->sound_low));
@@ -752,7 +752,7 @@ static MACHINE_START( sraider )
static MACHINE_RESET( sraider )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
int i;
state->grid_color = 0;
@@ -1062,10 +1062,10 @@ static DRIVER_INIT( dorodon )
/* decode the opcodes */
offs_t i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *table = machine->region("user1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *table = machine.region("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/ladyfrog.c b/src/mame/drivers/ladyfrog.c
index 0d6e3d941a2..8e5b68967fd 100644
--- a/src/mame/drivers/ladyfrog.c
+++ b/src/mame/drivers/ladyfrog.c
@@ -56,27 +56,27 @@ Notes:
static READ8_HANDLER( from_snd_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->snd_flag = 0;
return state->snd_data;
}
static WRITE8_HANDLER( to_main_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->snd_data = data;
state->snd_flag = 2;
}
static WRITE8_HANDLER( sound_cpu_reset_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 1 ) ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( nmi_callback )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -87,18 +87,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -130,7 +130,7 @@ static const msm5232_interface msm5232_config =
static READ8_HANDLER( snd_flag_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
return state->snd_flag | 0xfd;
}
@@ -285,9 +285,9 @@ GFXDECODE_END
static MACHINE_START( ladyfrog )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->tilebank));
state->save_item(NAME(state->palette_bank));
@@ -299,7 +299,7 @@ static MACHINE_START( ladyfrog )
static MACHINE_RESET( ladyfrog )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
state->tilebank = 0;
state->palette_bank = 0;
diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c
index abe1a506380..fc3afaf72ba 100644
--- a/src/mame/drivers/laserbas.c
+++ b/src/mame/drivers/laserbas.c
@@ -38,7 +38,7 @@ public:
static VIDEO_START(laserbas)
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->save_item(NAME(state->vram1));
state->save_item(NAME(state->vram2));
@@ -46,7 +46,7 @@ static VIDEO_START(laserbas)
static SCREEN_UPDATE(laserbas)
{
- laserbas_state *state = screen->machine->driver_data<laserbas_state>();
+ laserbas_state *state = screen->machine().driver_data<laserbas_state>();
int x, y;
for (y = 0; y < 256; y++)
@@ -67,7 +67,7 @@ static SCREEN_UPDATE(laserbas)
static READ8_HANDLER(vram_r)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if(!state->vrambank)
return state->vram1[offset];
@@ -77,7 +77,7 @@ static READ8_HANDLER(vram_r)
static WRITE8_HANDLER(vram_w)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if(!state->vrambank)
state->vram1[offset] = data;
@@ -87,7 +87,7 @@ static WRITE8_HANDLER(vram_w)
static READ8_HANDLER( read_unk )
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
state->count ^= 0x80;
return state->count | 0x7f;
@@ -95,12 +95,12 @@ static READ8_HANDLER( read_unk )
static WRITE8_HANDLER(palette_w)
{
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data));
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data));
}
static WRITE8_HANDLER(vrambank_w)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if ((offset & 0xf1) == 0x10)
state->vrambank = data & 0x40;
@@ -146,7 +146,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( laserbas_interrupt )
{
- if(device->machine->primary_screen->vblank())
+ if(device->machine().primary_screen->vblank())
device_set_input_line(device, 0, HOLD_LINE);
else
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -154,7 +154,7 @@ static INTERRUPT_GEN( laserbas_interrupt )
static MACHINE_START( laserbas )
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->save_item(NAME(state->vrambank));
state->save_item(NAME(state->count));
@@ -162,7 +162,7 @@ static MACHINE_START( laserbas )
static MACHINE_RESET( laserbas )
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->vrambank = 0;
state->count = 0;
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index 0e184377a72..d802e2c7e7a 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -29,7 +29,7 @@ TODO:
static WRITE8_HANDLER( laserbat_videoram_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
if (state->video_page == 0)
{
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( laserbat_videoram_w )
static WRITE8_HANDLER( video_extra_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->video_page = (data & 0x10) >> 4;
state->sprite_enable = (data & 1) ^ 1;
@@ -55,7 +55,7 @@ static WRITE8_HANDLER( video_extra_w )
static WRITE8_HANDLER( sprite_x_y_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
if (offset == 0)
state->sprite_x = 256 - data;
@@ -65,13 +65,13 @@ static WRITE8_HANDLER( sprite_x_y_w )
static WRITE8_HANDLER( laserbat_input_mux_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->input_mux = (data & 0x30) >> 4;
- flip_screen_set_no_update(space->machine, data & 0x08);
+ flip_screen_set_no_update(space->machine(), data & 0x08);
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
//data & 0x02 ?
//data & 0x04 ?
@@ -79,10 +79,10 @@ static WRITE8_HANDLER( laserbat_input_mux_w )
static READ8_HANDLER( laserbat_input_r )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(space->machine, portnames[state->input_mux]);
+ return input_port_read(space->machine(), portnames[state->input_mux]);
}
static WRITE8_HANDLER( laserbat_cnteff_w )
@@ -487,7 +487,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
// wrong color index!
SET_TILE_INFO(0, state->videoram[tile_index], state->colorram[tile_index] & 0x7f, 0);
@@ -495,7 +495,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -505,7 +505,7 @@ static VIDEO_START( laserbat )
static SCREEN_UPDATE( laserbat )
{
- laserbat_state *state = screen->machine->driver_data<laserbat_state>();
+ laserbat_state *state = screen->machine().driver_data<laserbat_state>();
int y;
bitmap_t *s2636_1_bitmap;
bitmap_t *s2636_2_bitmap;
@@ -541,7 +541,7 @@ static SCREEN_UPDATE( laserbat )
}
if (state->sprite_enable)
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->sprite_code,
state->sprite_color,
0,0,
@@ -583,32 +583,32 @@ static const sn76477_interface laserbat_sn76477_interface =
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0a )
{
- laserbat_state *laserbat = device->machine->driver_data<laserbat_state>();
+ laserbat_state *laserbat = device->machine().driver_data<laserbat_state>();
device_set_input_line(laserbat->audiocpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0b )
{
- laserbat_state *laserbat = device->machine->driver_data<laserbat_state>();
+ laserbat_state *laserbat = device->machine().driver_data<laserbat_state>();
device_set_input_line(laserbat->audiocpu, 0, state ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_DEVICE_HANDLER( zaccaria_port0a_r )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
device_t *ay = (state->active_8910 == 0) ? state->ay1 : state->ay2;
return ay8910_r(ay, 0);
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0a_w )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
state->port0a = data;
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
/* bit 1 goes to 8910 #0 BDIR pin */
if ((state->last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
{
@@ -671,7 +671,7 @@ static INTERRUPT_GEN( laserbat_interrupt )
static INTERRUPT_GEN( zaccaria_cb1_toggle )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
pia6821_cb1_w(state->pia, state->cb1_toggle & 1);
state->cb1_toggle ^= 1;
@@ -704,18 +704,18 @@ static const s2636_interface s2636_3_config =
static MACHINE_START( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
-
- state->audiocpu = machine->device("audiocpu");
- state->s2636_1 = machine->device("s2636_1");
- state->s2636_2 = machine->device("s2636_2");
- state->s2636_3 = machine->device("s2636_3");
- state->pia = machine->device("pia");
- state->sn = machine->device("snsnd");
- state->tms1 = machine->device("tms1");
- state->tms2 = machine->device("tms2");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ laserbat_state *state = machine.driver_data<laserbat_state>();
+
+ state->audiocpu = machine.device("audiocpu");
+ state->s2636_1 = machine.device("s2636_1");
+ state->s2636_2 = machine.device("s2636_2");
+ state->s2636_3 = machine.device("s2636_3");
+ state->pia = machine.device("pia");
+ state->sn = machine.device("snsnd");
+ state->tms1 = machine.device("tms1");
+ state->tms2 = machine.device("tms2");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
state->save_item(NAME(state->video_page));
state->save_item(NAME(state->input_mux));
@@ -741,7 +741,7 @@ static MACHINE_START( laserbat )
static MACHINE_RESET( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
state->video_page = 0;
state->input_mux = 0;
diff --git a/src/mame/drivers/lasso.c b/src/mame/drivers/lasso.c
index 9ae0b59a119..d73c6b07d18 100644
--- a/src/mame/drivers/lasso.c
+++ b/src/mame/drivers/lasso.c
@@ -38,7 +38,7 @@ DIP locations verified for:
static INPUT_CHANGED( coin_inserted )
{
- lasso_state *state = field->port->machine->driver_data<lasso_state>();
+ lasso_state *state = field->port->machine().driver_data<lasso_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -48,14 +48,14 @@ static INPUT_CHANGED( coin_inserted )
/* Write to the sound latch and generate an IRQ on the sound CPU */
static WRITE8_HANDLER( sound_command_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
soundlatch_w(space, offset, data);
generic_pulse_irq_line(state->audiocpu, 0);
}
static WRITE8_HANDLER( pinbo_sound_command_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -68,7 +68,7 @@ static READ8_HANDLER( sound_status_r )
static WRITE8_HANDLER( sound_select_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
UINT8 to_write = BITSWAP8(*state->chip_data, 0, 1, 2, 3, 4, 5, 6, 7);
if (~data & 0x01) /* chip #0 */
@@ -464,19 +464,19 @@ GFXDECODE_END
static MACHINE_START( lasso )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->sn_1 = machine->device("sn76489.1");
- state->sn_2 = machine->device("sn76489.2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->sn_1 = machine.device("sn76489.1");
+ state->sn_2 = machine.device("sn76489.2");
state->save_item(NAME(state->gfxbank));
}
static MACHINE_START( wwjgtin )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
MACHINE_START_CALL(lasso);
@@ -485,14 +485,14 @@ static MACHINE_START( wwjgtin )
static MACHINE_RESET( lasso )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
state->gfxbank = 0;
}
static MACHINE_RESET( wwjgtin )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
MACHINE_RESET_CALL(lasso);
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index d6ee1d24895..e5a73f6a977 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -176,7 +176,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mg_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static ADDRESS_MAP_START( madgear_sound_map, AS_PROGRAM, 8 )
@@ -442,7 +442,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- lastduel_state *state = device->machine->driver_data<lastduel_state>();
+ lastduel_state *state = device->machine().driver_data<lastduel_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -474,9 +474,9 @@ static INTERRUPT_GEN( madgear_interrupt )
static MACHINE_START( lastduel )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->tilemap_priority));
state->save_item(NAME(state->scroll));
@@ -484,7 +484,7 @@ static MACHINE_START( lastduel )
static MACHINE_START( madgear )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -493,7 +493,7 @@ static MACHINE_START( madgear )
static MACHINE_RESET( lastduel )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int i;
state->tilemap_priority = 0;
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index 8a55f37578b..032932b2309 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -99,10 +99,10 @@ public:
static VIDEO_START( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
int i;
for (i = 0; i < 2; i++)
- state->bitmap[i] = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap[i] = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->bitmap[0]));
state->save_item(NAME(*state->bitmap[1]));
@@ -112,30 +112,30 @@ static VIDEO_START( lastfght )
static SCREEN_UPDATE( lastfght )
{
- lastfght_state *state = screen->machine->driver_data<lastfght_state>();
+ lastfght_state *state = screen->machine().driver_data<lastfght_state>();
#ifdef MAME_DEBUG
#if 1
// gfx roms viewer (toggle with enter, use pgup/down to browse)
int x, y, count = 0;
- UINT8 *gfxdata = screen->machine->region("gfx1")->base();
+ UINT8 *gfxdata = screen->machine().region("gfx1")->base();
UINT8 data;
- if (input_code_pressed_once(screen->machine, KEYCODE_ENTER)) state->view_roms ^= 1;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_ENTER)) state->view_roms ^= 1;
if (state->view_roms)
{
- if (input_code_pressed_once(screen->machine, KEYCODE_PGDN)) state->base += 512 * 256;
- if (input_code_pressed_once(screen->machine, KEYCODE_PGUP)) state->base -= 512 * 256;
- state->base %= screen->machine->region("gfx1")->bytes();
+ if (input_code_pressed_once(screen->machine(), KEYCODE_PGDN)) state->base += 512 * 256;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_PGUP)) state->base -= 512 * 256;
+ state->base %= screen->machine().region("gfx1")->bytes();
count = state->base;
- bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine()));
for (y = 0 ; y < 256; y++)
{
for (x = 0; x < 512; x++)
{
- data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen->machine) : gfxdata[count]; // white grid or data
+ data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen->machine()) : gfxdata[count]; // white grid or data
*BITMAP_ADDR16(bitmap, y, x) = data;
count++;
}
@@ -155,12 +155,12 @@ static SCREEN_UPDATE( lastfght )
static WRITE16_HANDLER( colordac_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_0_7)
{
state->colorram[state->clr_offset] = data;
- palette_set_color_rgb(space->machine, state->clr_offset / 3,
+ palette_set_color_rgb(space->machine(), state->clr_offset / 3,
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 0]),
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 1]),
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 2])
@@ -178,7 +178,7 @@ static WRITE16_HANDLER( colordac_w )
// high byte of a 16 bit register
static WRITE16_HANDLER( lastfght_hi_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
logerror("%06x: 600000.b = %02x\n", cpu_get_pc(space->cpu), data >> 8);
@@ -192,7 +192,7 @@ static WRITE16_HANDLER( lastfght_hi_w )
// screen x
static WRITE16_HANDLER( lastfght_x_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
logerror("%06x: 800008.b = %02x\n", cpu_get_pc(space->cpu), data >> 8);
@@ -206,7 +206,7 @@ static WRITE16_HANDLER( lastfght_x_w )
// screen y, screen width - 1
static WRITE16_HANDLER( lastfght_yw_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -223,7 +223,7 @@ static WRITE16_HANDLER( lastfght_yw_w )
// screen height - 1
static WRITE16_HANDLER( lastfght_h_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -237,7 +237,7 @@ static WRITE16_HANDLER( lastfght_h_w )
// source delta x << 6, source x << 6
static WRITE16_HANDLER( lastfght_sx_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -254,7 +254,7 @@ static WRITE16_HANDLER( lastfght_sx_w )
// source y << 6, source y1 << 6
static WRITE16_HANDLER( lastfght_sy_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( lastfght_sy_w )
// source rom (0x200000 bytes), source page (512x256 bytes)
static WRITE16_HANDLER( lastfght_sr_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( lastfght_sr_w )
// source x1 << 6, source delta y << 6
static WRITE16_HANDLER( lastfght_sd_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -305,12 +305,12 @@ static WRITE16_HANDLER( lastfght_sd_w )
// start blit
static WRITE16_HANDLER( lastfght_blit_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
int x, y, addr;
- UINT8 *gfxdata = space->machine->region( "gfx1" )->base();
+ UINT8 *gfxdata = space->machine().region( "gfx1" )->base();
bitmap_t *dest = state->bitmap[state->dest];
#if 0
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( lastfght_blit_w )
// toggle framebuffer
static WRITE16_HANDLER( lastfght_dest_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_0_7)
state->dest ^= 1;
@@ -363,12 +363,12 @@ static READ16_HANDLER( lastfght_c00002_r )
{
// high byte:
// mask 0x1c: from sound?
- return (space->machine->rand() & 0x1c00) | input_port_read(space->machine, "IN0");
+ return (space->machine().rand() & 0x1c00) | input_port_read(space->machine(), "IN0");
}
static READ16_HANDLER( lastfght_c00004_r )
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
static READ16_HANDLER( lastfght_c00006_r )
@@ -376,12 +376,12 @@ static READ16_HANDLER( lastfght_c00006_r )
// low byte:
// bit 7 = protection?
// bit 5 = blitter?
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static WRITE16_HANDLER( lastfght_c00006_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
COMBINE_DATA(&state->c00006);
// popmessage("%04x", state->c00006);
}
@@ -508,7 +508,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( unknown_interrupt )
{
- lastfght_state *state = device->machine->driver_data<lastfght_state>();
+ lastfght_state *state = device->machine().driver_data<lastfght_state>();
switch (cpu_getiloops(device))
{
case 0:
@@ -522,9 +522,9 @@ static INTERRUPT_GEN( unknown_interrupt )
static MACHINE_START( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->clr_offset));
state->save_item(NAME(state->dest));
@@ -546,7 +546,7 @@ static MACHINE_START( lastfght )
static MACHINE_RESET( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
state->clr_offset = 0;
state->dest = 0;
@@ -612,7 +612,7 @@ ROM_END
static DRIVER_INIT(lastfght)
{
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
// pass initial check (protection ? hw?)
rom[0x00354 / 2] = 0x403e;
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index 8915dceb195..1e7cc238573 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -239,7 +239,7 @@
static INTERRUPT_GEN( lazercmd_timer )
{
- lazercmd_state *state = device->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = device->machine().driver_data<lazercmd_state>();
if (++state->timer_count >= 64 * 128)
{
@@ -251,7 +251,7 @@ static INTERRUPT_GEN( lazercmd_timer )
static INTERRUPT_GEN( bbonk_timer )
{
- lazercmd_state *state = device->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = device->machine().driver_data<lazercmd_state>();
if (++state->timer_count >= 64 * 128)
state->timer_count = 0;
@@ -283,13 +283,13 @@ static WRITE8_HANDLER( lazercmd_data_port_w )
/* triggered by REDD,r opcode */
static READ8_HANDLER( lazercmd_data_port_r )
{
- UINT8 data = input_port_read(space->machine, "DSW") & 0x0f;
+ UINT8 data = input_port_read(space->machine(), "DSW") & 0x0f;
return data;
}
static WRITE8_HANDLER( lazercmd_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -313,7 +313,7 @@ static WRITE8_HANDLER( lazercmd_hardware_w )
static WRITE8_HANDLER( medlanes_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -340,7 +340,7 @@ static WRITE8_HANDLER( medlanes_hardware_w )
static WRITE8_HANDLER( bbonk_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -361,22 +361,22 @@ static WRITE8_HANDLER( bbonk_hardware_w )
static READ8_HANDLER( lazercmd_hardware_r )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
UINT8 data = 0;
switch (offset)
{
case 0: /* player 1 joysticks */
- data = input_port_read(space->machine, "IN0");
+ data = input_port_read(space->machine(), "IN0");
break;
case 1: /* player 2 joysticks */
- data = input_port_read(space->machine, "IN1");
+ data = input_port_read(space->machine(), "IN1");
break;
case 2: /* player 1 + 2 buttons */
- data = input_port_read(space->machine, "IN3");
+ data = input_port_read(space->machine(), "IN3");
break;
case 3: /* coin slot + start buttons */
- data = input_port_read(space->machine, "IN2");
+ data = input_port_read(space->machine(), "IN2");
break;
case 4: /* vertical scan counter */
data = ((state->timer_count & 0x10) >> 1) | ((state->timer_count & 0x20) >> 3)
@@ -601,9 +601,9 @@ static PALETTE_INIT( lazercmd )
static MACHINE_START( lazercmd )
{
- lazercmd_state *state = machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = machine.driver_data<lazercmd_state>();
- state->dac = machine->device("dac");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->marker_x));
state->save_item(NAME(state->marker_y));
@@ -614,7 +614,7 @@ static MACHINE_START( lazercmd )
static MACHINE_RESET( lazercmd )
{
- lazercmd_state *state = machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = machine.driver_data<lazercmd_state>();
state->marker_x = 0;
state->marker_y = 0;
@@ -789,7 +789,7 @@ ROM_END
static DRIVER_INIT( lazercmd )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -818,7 +818,7 @@ static DRIVER_INIT( lazercmd )
static DRIVER_INIT( medlanes )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -847,7 +847,7 @@ static DRIVER_INIT( medlanes )
static DRIVER_INIT( bbonk )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index a301b0483a0..52579a3014c 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -128,7 +128,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( denjin_paletteram16_xBBBBBGGGGGRRRRR_word_w )
{
offset^=1;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
paletteram16_xBBBBBGGGGGRRRRR_word_w(space,offset,data,mem_mask);
}
@@ -897,7 +897,7 @@ static const gfx_layout legionna_new_charlayout =
};
-static void descramble_legionnaire_gfx(running_machine *machine, UINT8* src)
+static void descramble_legionnaire_gfx(running_machine &machine, UINT8* src)
{
UINT8 *buffer;
int len = 0x10000;
@@ -2169,7 +2169,7 @@ ROM_END
static DRIVER_INIT( cupsoc )
{
#if CUPSOC_DEBUG_MODE
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
/*Press p1 button 3 to enter into debug mode during gameplay*/
ROM[0xffffb/2] = 0x0000;
@@ -2181,13 +2181,13 @@ static DRIVER_INIT( cupsoc )
static DRIVER_INIT( denjinmk )
{
/* problem with audio comms? */
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
ROM[0x5fe4/2] = 0x4e71;
}
static DRIVER_INIT( legiongfx )
{
- descramble_legionnaire_gfx( machine, machine->region("gfx5")->base() );
+ descramble_legionnaire_gfx( machine, machine.region("gfx5")->base() );
}
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index 1cd94ed35e2..9ab62e9e20a 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -1978,38 +1978,38 @@ ROM_END
*
*************************************/
-static void init_master_ports(running_machine *machine, UINT8 mvram_base, UINT8 io_base)
+static void init_master_ports(running_machine &machine, UINT8 mvram_base, UINT8 io_base)
{
/* set up the master CPU VRAM I/O */
- machine->device("master")->memory().space(AS_IO)->install_legacy_readwrite_handler(mvram_base, mvram_base + 0x1f, FUNC(leland_mvram_port_r), FUNC(leland_mvram_port_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_readwrite_handler(mvram_base, mvram_base + 0x1f, FUNC(leland_mvram_port_r), FUNC(leland_mvram_port_w));
/* set up the master CPU I/O ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(io_base, io_base + 0x1f, FUNC(leland_master_input_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_write_handler(io_base, io_base + 0x0f, FUNC(leland_master_output_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(io_base, io_base + 0x1f, FUNC(leland_master_input_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_write_handler(io_base, io_base + 0x0f, FUNC(leland_master_output_w));
}
static DRIVER_INIT( cerberus )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = cerberus_bankswitch;
- memory_set_bankptr(machine, "bank1", machine->region("master")->base() + 0x2000);
- memory_set_bankptr(machine, "bank2", machine->region("master")->base() + 0xa000);
- memory_set_bankptr(machine, "bank3", machine->region("slave")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank1", machine.region("master")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank2", machine.region("master")->base() + 0xa000);
+ memory_set_bankptr(machine, "bank3", machine.region("slave")->base() + 0x2000);
/* set up the master CPU I/O ports */
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x80, 0x80, FUNC(cerberus_dial_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x90, 0x90, FUNC(cerberus_dial_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x80, 0x80, FUNC(cerberus_dial_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x90, 0x90, FUNC(cerberus_dial_2_r));
}
static DRIVER_INIT( mayhem )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2020,7 +2020,7 @@ static DRIVER_INIT( mayhem )
static DRIVER_INIT( powrplay )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2031,7 +2031,7 @@ static DRIVER_INIT( powrplay )
static DRIVER_INIT( wseries )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2042,7 +2042,7 @@ static DRIVER_INIT( wseries )
static DRIVER_INIT( alleymas )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2052,13 +2052,13 @@ static DRIVER_INIT( alleymas )
/* kludge warning: the game uses location E0CA to determine if the joysticks are available */
/* it gets cleared by the code, but there is no obvious way for the value to be set to a */
/* non-zero value. If the value is zero, the joystick is never read. */
- state->alleymas_kludge_mem = machine->device("master")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0ca, 0xe0ca, FUNC(alleymas_joystick_kludge));
+ state->alleymas_kludge_mem = machine.device("master")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0ca, 0xe0ca, FUNC(alleymas_joystick_kludge));
}
static DRIVER_INIT( upyoural )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2069,7 +2069,7 @@ static DRIVER_INIT( upyoural )
static DRIVER_INIT( dangerz )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = dangerz_bankswitch;
@@ -2077,15 +2077,15 @@ static DRIVER_INIT( dangerz )
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf4, 0xf4, FUNC(dangerz_input_upper_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(dangerz_input_y_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(dangerz_input_x_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf4, 0xf4, FUNC(dangerz_input_upper_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(dangerz_input_y_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(dangerz_input_x_r));
}
static DRIVER_INIT( basebal2 )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2096,7 +2096,7 @@ static DRIVER_INIT( basebal2 )
static DRIVER_INIT( dblplay )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2107,7 +2107,7 @@ static DRIVER_INIT( dblplay )
static DRIVER_INIT( strkzone )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2118,7 +2118,7 @@ static DRIVER_INIT( strkzone )
static DRIVER_INIT( redlin2p )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = redline_bankswitch;
@@ -2128,16 +2128,16 @@ static DRIVER_INIT( redlin2p )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xc0, 0xc0, FUNC(redline_pedal_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xd0, 0xd0, FUNC(redline_pedal_2_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(redline_wheel_2_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(redline_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xc0, 0xc0, FUNC(redline_pedal_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xd0, 0xd0, FUNC(redline_pedal_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(redline_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(redline_wheel_1_r));
}
static DRIVER_INIT( quarterb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2150,7 +2150,7 @@ static DRIVER_INIT( quarterb )
static DRIVER_INIT( viper )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2162,15 +2162,15 @@ static DRIVER_INIT( viper )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xa4, 0xa4, FUNC(dangerz_input_upper_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xb8, 0xb8, FUNC(dangerz_input_y_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xbc, 0xbc, FUNC(dangerz_input_x_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xa4, 0xa4, FUNC(dangerz_input_upper_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xb8, 0xb8, FUNC(dangerz_input_y_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xbc, 0xbc, FUNC(dangerz_input_x_r));
}
static DRIVER_INIT( teamqb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2182,14 +2182,14 @@ static DRIVER_INIT( teamqb )
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2201,14 +2201,14 @@ static DRIVER_INIT( aafb )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafbb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2220,14 +2220,14 @@ static DRIVER_INIT( aafbb )
init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafbd2p )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2239,14 +2239,14 @@ static DRIVER_INIT( aafbd2p )
init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( offroad )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2259,15 +2259,15 @@ static DRIVER_INIT( offroad )
init_master_ports(machine, 0x40, 0x80); /* yes, this is intentional */
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
}
static DRIVER_INIT( offroadt )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2279,15 +2279,15 @@ static DRIVER_INIT( offroadt )
init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
}
static DRIVER_INIT( pigout )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2299,7 +2299,7 @@ static DRIVER_INIT( pigout )
init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN4");
}
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index eacaf7b4c08..9856992f472 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -24,7 +24,7 @@
static WRITE16_HANDLER( lemmings_control_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
/* Offset==0 Pixel layer X scroll */
if (offset == 4)
@@ -36,10 +36,10 @@ static READ16_HANDLER( lemmings_trackball_r )
{
switch (offset)
{
- case 0: return input_port_read(space->machine, "AN0");
- case 1: return input_port_read(space->machine, "AN1");
- case 4: return input_port_read(space->machine, "AN2");
- case 5: return input_port_read(space->machine, "AN3");
+ case 0: return input_port_read(space->machine(), "AN0");
+ case 1: return input_port_read(space->machine(), "AN1");
+ case 4: return input_port_read(space->machine(), "AN2");
+ case 5: return input_port_read(space->machine(), "AN3");
}
return 0;
}
@@ -50,13 +50,13 @@ static READ16_HANDLER( lemmings_prot_r )
switch (offset << 1)
{
case 0x41a:
- return input_port_read(space->machine, "BUTTONS");
+ return input_port_read(space->machine(), "BUTTONS");
case 0x320:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x4e6:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
return 0;
@@ -64,7 +64,7 @@ static READ16_HANDLER( lemmings_prot_r )
static WRITE16_HANDLER( lemmings_palette_24bit_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
int r, g, b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -75,19 +75,19 @@ static WRITE16_HANDLER( lemmings_palette_24bit_w )
g = (state->paletteram[offset + 1] >> 8) & 0xff;
r = (state->paletteram[offset + 1] >> 0) & 0xff;
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r, g, b));
}
static WRITE16_HANDLER( lemmings_sound_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 1, HOLD_LINE);
}
static WRITE8_HANDLER( lemmings_sound_ack_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
device_set_input_line(state->audiocpu, 1, CLEAR_LINE);
}
@@ -246,7 +246,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- lemmings_state *lemmings = device->machine->driver_data<lemmings_state>();
+ lemmings_state *lemmings = device->machine().driver_data<lemmings_state>();
device_set_input_line(lemmings->audiocpu, 0, state);
}
@@ -257,9 +257,9 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( lemmings )
{
- lemmings_state *state = machine->driver_data<lemmings_state>();
+ lemmings_state *state = machine.driver_data<lemmings_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( lemmings, lemmings_state )
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index dd7a15b2b3d..ed922b7cbaa 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -178,8 +178,8 @@ maybe some priority issues / sprite placement issues..
static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
/* a = 1, 2 = player # */
-#define GUNX( a ) (( ( input_port_read(space->machine, gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
-#define GUNY( a ) (( ( input_port_read(space->machine, gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
+#define GUNX( a ) (( ( input_port_read(space->machine(), gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
+#define GUNY( a ) (( ( input_port_read(space->machine(), gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
/* Default Eeprom for the parent.. otherwise it will always complain first boot */
@@ -210,16 +210,16 @@ static WRITE8_HANDLER( control2_w )
/* bit 4 bankswitches the 4800-4fff region: 0 = registers, 1 = RAM ("CBNK" on schematics) */
/* bit 6 is "SHD0" (some kind of shadow control) */
/* bit 7 is "SHD1" (ditto) */
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
state->cur_control2 = data;
- input_port_write(space->machine, "EEPROMOUT", state->cur_control2, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", state->cur_control2, 0xff);
}
static INTERRUPT_GEN(lethalen_interrupt)
{
- lethal_state *state = device->machine->driver_data<lethal_state>();
+ lethal_state *state = device->machine().driver_data<lethal_state>();
if (k056832_is_irq_enabled(state->k056832, 0))
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( sound_cmd_w )
static WRITE8_HANDLER( sound_irq_w )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -243,22 +243,22 @@ static READ8_HANDLER( sound_status_r )
static void sound_nmi( device_t *device )
{
- lethal_state *state = device->machine->driver_data<lethal_state>();
+ lethal_state *state = device->machine().driver_data<lethal_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( le_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
static READ8_HANDLER( le_4800_r )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
if (state->cur_control2 & 0x10) // RAM enable
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
else
{
@@ -339,7 +339,7 @@ static READ8_HANDLER( le_4800_r )
static WRITE8_HANDLER( le_4800_w )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
if (state->cur_control2 & 0x10) // RAM enable
{
@@ -595,37 +595,37 @@ static const k054539_interface k054539_config =
static MACHINE_START( lethalen )
{
- lethal_state *state = machine->driver_data<lethal_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lethal_state *state = machine.driver_data<lethal_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->k054539 = machine->device("k054539");
- state->k053244 = machine->device("k053244");
- state->k056832 = machine->device("k056832");
- state->k054000 = machine->device("k054000");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->k054539 = machine.device("k054539");
+ state->k053244 = machine.device("k053244");
+ state->k056832 = machine.device("k056832");
+ state->k054000 = machine.device("k054000");
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x3800 + 0x02);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x3800 + 0x02);
}
static MACHINE_RESET( lethalen )
{
- lethal_state *state = machine->driver_data<lethal_state>();
- UINT8 *prgrom = (UINT8 *)machine->region("maincpu")->base();
+ lethal_state *state = machine.driver_data<lethal_state>();
+ UINT8 *prgrom = (UINT8 *)machine.region("maincpu")->base();
int i;
memory_set_bankptr(machine, "bank2", &prgrom[0x48000]);
/* force reset again to read proper reset vector */
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
for (i = 0; i < 4; i++)
state->layer_colorbase[i] = 0;
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index c61c5497448..8d1a4ccc506 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -161,7 +161,7 @@ Pin #11(+) | | R |
static CUSTOM_INPUT( cclownz_paddle )
{
- int value = input_port_read(field->port->machine, "PADDLE");
+ int value = input_port_read(field->port->machine(), "PADDLE");
return ((value << 4) & 0xf00) | (value & 0x00f);
}
@@ -175,29 +175,29 @@ static CUSTOM_INPUT( cclownz_paddle )
static WRITE16_HANDLER( ripribit_control_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 1) & 1) << 7);
+ coin_counter_w(space->machine(), 0, data & 1);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 1) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
}
static WRITE16_HANDLER( cfarm_control_w )
{
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 3) & 1);
output_set_lamp_value(2, (data >> 4) & 1);
- coin_counter_w(space->machine, 0, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 7) & 1);
}
static WRITE16_HANDLER( cclownz_control_w )
{
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 4) & 1);
output_set_lamp_value(2, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 6) & 1);
}
@@ -897,19 +897,19 @@ ROM_END
static DRIVER_INIT( ripribit )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(ripribit_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(ripribit_control_w));
}
static DRIVER_INIT( cfarm )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cfarm_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cfarm_control_w));
}
static DRIVER_INIT( cclownz )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cclownz_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cclownz_control_w));
}
diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c
index 8273d6c8319..28ae1050871 100644
--- a/src/mame/drivers/lgp.c
+++ b/src/mame/drivers/lgp.c
@@ -90,11 +90,11 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( lgp )
{
- lgp_state *state = screen->machine->driver_data<lgp_state>();
+ lgp_state *state = screen->machine().driver_data<lgp_state>();
int charx, chary;
/* make color 0 transparent */
- palette_set_color(screen->machine, 0, MAKE_ARGB(0,0,0,0));
+ palette_set_color(screen->machine(), 0, MAKE_ARGB(0,0,0,0));
/* clear */
bitmap_fill(bitmap, cliprect, 0);
@@ -108,7 +108,7 @@ static SCREEN_UPDATE( lgp )
/* Somewhere there's a flag that offsets the tilemap by 0x100*x */
/* Palette is likely set somewhere as well (tile_control_ram?) */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character],
0,
0, 0, charx*8, chary*8, 0);
@@ -123,13 +123,13 @@ static SCREEN_UPDATE( lgp )
/* Main Z80 R/W */
static READ8_HANDLER(ldp_read)
{
- lgp_state *state = space->machine->driver_data<lgp_state>();
+ lgp_state *state = space->machine().driver_data<lgp_state>();
return laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER(ldp_write)
{
- lgp_state *state = space->machine->driver_data<lgp_state>();
+ lgp_state *state = space->machine().driver_data<lgp_state>();
laserdisc_data_w(state->laserdisc,data);
}
@@ -333,7 +333,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( vblank_callback_lgp )
{
- lgp_state *state = device->machine->driver_data<lgp_state>();
+ lgp_state *state = device->machine().driver_data<lgp_state>();
// NMI
//device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -345,9 +345,9 @@ static INTERRUPT_GEN( vblank_callback_lgp )
static MACHINE_START( lgp )
{
- lgp_state *state = machine->driver_data<lgp_state>();
- state->laserdisc = machine->device("laserdisc");
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_stop));
+ lgp_state *state = machine.driver_data<lgp_state>();
+ state->laserdisc = machine.device("laserdisc");
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_stop));
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index bea04dbd15a..6711156165c 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -27,8 +27,8 @@
static READ8_HANDLER( deco16_bank_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- const UINT8 *ROM = space->machine->region("user1")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ const UINT8 *ROM = space->machine().region("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (state->bank)
@@ -55,11 +55,11 @@ static READ8_HANDLER( deco16_bank_r )
static READ8_HANDLER( deco16_io_r )
{
- if (offset == 0) return input_port_read(space->machine, "IN1"); /* Player 1 controls */
- if (offset == 1) return input_port_read(space->machine, "IN2"); /* Player 2 controls */
- if (offset == 2) return input_port_read(space->machine, "IN3"); /* Vblank, coins */
- if (offset == 3) return input_port_read(space->machine, "DSW1"); /* Dip 1 */
- if (offset == 4) return input_port_read(space->machine, "DSW2"); /* Dip 2 */
+ if (offset == 0) return input_port_read(space->machine(), "IN1"); /* Player 1 controls */
+ if (offset == 1) return input_port_read(space->machine(), "IN2"); /* Player 2 controls */
+ if (offset == 2) return input_port_read(space->machine(), "IN3"); /* Vblank, coins */
+ if (offset == 3) return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
+ if (offset == 4) return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
logerror("%04x: Read input %d\n", cpu_get_pc(space->cpu), offset);
return 0xff;
@@ -67,7 +67,7 @@ static READ8_HANDLER( deco16_io_r )
static WRITE8_HANDLER( deco16_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->bank = data;
if (state->bank)
@@ -78,8 +78,8 @@ static WRITE8_HANDLER( deco16_bank_w )
static READ8_HANDLER( prosoccr_bank_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- const UINT8 *ROM = space->machine->region("user1")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ const UINT8 *ROM = space->machine().region("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (state->bank)
@@ -108,8 +108,8 @@ static READ8_HANDLER( prosoccr_bank_r )
static READ8_HANDLER( prosoccr_charram_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- UINT8 *SRC_GFX = space->machine->region("shared_gfx")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ UINT8 *SRC_GFX = space->machine().region("shared_gfx")->base();
if (state->gfx_rom_readback)
{
@@ -130,8 +130,8 @@ static READ8_HANDLER( prosoccr_charram_r )
static WRITE8_HANDLER( prosoccr_charram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- UINT8 *FG_GFX = space->machine->region("fg_gfx")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ UINT8 *FG_GFX = space->machine().region("fg_gfx")->base();
if (state->bank)
{
@@ -162,13 +162,13 @@ static WRITE8_HANDLER( prosoccr_charram_w )
offset &= 0x7ff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
-// gfx_element_mark_dirty(space->machine->gfx[0], (offset | 0x1800) >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 3);
+// gfx_element_mark_dirty(space->machine().gfx[0], (offset | 0x1800) >> 3);
}
static WRITE8_HANDLER( prosoccr_char_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->gfx_rom_readback = data & 1; //enable GFX rom read-back
if (data & 0xfe)
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( prosoccr_char_bank_w )
static WRITE8_HANDLER( prosoccr_io_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->bank = data & 1;
if (state->bank)
@@ -189,7 +189,7 @@ static WRITE8_HANDLER( prosoccr_io_bank_w )
static READ8_HANDLER( prosport_charram_r )
{
- UINT8 *FG_GFX = space->machine->region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = space->machine().region("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -209,7 +209,7 @@ static READ8_HANDLER( prosport_charram_r )
static WRITE8_HANDLER( prosport_charram_w )
{
- UINT8 *FG_GFX = space->machine->region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = space->machine().region("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -230,8 +230,8 @@ static WRITE8_HANDLER( prosport_charram_w )
offset &= 0x7ff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[3], (offset + 0x800) >> 3);
- gfx_element_mark_dirty(space->machine->gfx[3 + 4], (offset + 0x800) >> 5);
+ gfx_element_mark_dirty(space->machine().gfx[3], (offset + 0x800) >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[3 + 4], (offset + 0x800) >> 5);
}
@@ -769,8 +769,8 @@ GFXDECODE_END
static INTERRUPT_GEN( deco16_interrupt )
{
- liberate_state *state = device->machine->driver_data<liberate_state>();
- int p = ~input_port_read(device->machine, "IN3");
+ liberate_state *state = device->machine().driver_data<liberate_state>();
+ int p = ~input_port_read(device->machine(), "IN3");
if ((p & 0x43) && !state->latch)
{
device_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
@@ -799,10 +799,10 @@ static INTERRUPT_GEN( prosport_interrupt )
static MACHINE_START( liberate )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->background_disable));
state->save_item(NAME(state->background_color));
@@ -815,7 +815,7 @@ static MACHINE_START( liberate )
static MACHINE_RESET( liberate )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
memset(state->io_ram, 0, ARRAY_LENGTH(state->io_ram));
@@ -1355,11 +1355,11 @@ ROM_END
*
*************************************/
-static void sound_cpu_decrypt(running_machine *machine)
+static void sound_cpu_decrypt(running_machine &machine)
{
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
int i;
/* Bit swapping on sound cpu - Opcodes only */
@@ -1371,7 +1371,7 @@ static void sound_cpu_decrypt(running_machine *machine)
static DRIVER_INIT( prosport )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
/* Main cpu has the nibbles swapped */
@@ -1385,15 +1385,15 @@ static DRIVER_INIT( yellowcb )
{
DRIVER_INIT_CALL(prosport);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xa000, 0xa000, "IN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xa000, 0xa000, "IN0");
}
static DRIVER_INIT( liberate )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
space->set_decrypted_region(0x0000, 0xffff, decrypted);
diff --git a/src/mame/drivers/liberatr.c b/src/mame/drivers/liberatr.c
index 85ea485a1db..3e926dd6e4e 100644
--- a/src/mame/drivers/liberatr.c
+++ b/src/mame/drivers/liberatr.c
@@ -161,13 +161,13 @@ void liberatr_state::machine_start()
WRITE8_MEMBER( liberatr_state::led_w )
{
- set_led_status(&m_machine, offset, ~data & 0x10);
+ set_led_status(m_machine, offset, ~data & 0x10);
}
WRITE8_MEMBER( liberatr_state::coin_counter_w )
{
- ::coin_counter_w(&m_machine, offset ^ 0x01, data & 0x10);
+ ::coin_counter_w(m_machine, offset ^ 0x01, data & 0x10);
}
@@ -184,8 +184,8 @@ WRITE8_MEMBER( liberatr_state::trackball_reset_w )
/* input becomes the starting point for the trackball counters */
if (((data ^ m_ctrld) & 0x10) && (data & 0x10))
{
- UINT8 trackball = input_port_read(&m_machine, "FAKE");
- UINT8 switches = input_port_read(&m_machine, "IN0");
+ UINT8 trackball = input_port_read(m_machine, "FAKE");
+ UINT8 switches = input_port_read(m_machine, "IN0");
m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
}
m_ctrld = data & 0x10;
@@ -197,13 +197,13 @@ READ8_MEMBER( liberatr_state::port0_r )
/* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
if (m_ctrld)
{
- UINT8 trackball = input_port_read(&m_machine, "FAKE");
+ UINT8 trackball = input_port_read(m_machine, "FAKE");
return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f);
}
/* otherwise, the LS191 is simply passing through the raw switch inputs */
else
- return input_port_read(&m_machine, "IN0");
+ return input_port_read(m_machine, "IN0");
}
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 153b3e3b945..52247003d1a 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -55,7 +55,7 @@ public:
};
-static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count);
+static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count);
/*****************************************************************************************************
MISC FUNCTIONS
@@ -63,44 +63,44 @@ static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectan
static WRITE32_HANDLER( limenko_coincounter_w )
{
- coin_counter_w(space->machine,0,data & 0x10000);
+ coin_counter_w(space->machine(),0,data & 0x10000);
}
static WRITE32_HANDLER( limenko_paletteram_w )
{
UINT16 paldata;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
if(ACCESSING_BITS_0_15)
{
- paldata = space->machine->generic.paletteram.u32[offset] & 0x7fff;
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
+ paldata = space->machine().generic.paletteram.u32[offset] & 0x7fff;
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
}
if(ACCESSING_BITS_16_31)
{
- paldata = (space->machine->generic.paletteram.u32[offset] >> 16) & 0x7fff;
- palette_set_color_rgb(space->machine, offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
+ paldata = (space->machine().generic.paletteram.u32[offset] >> 16) & 0x7fff;
+ palette_set_color_rgb(space->machine(), offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
}
}
static WRITE32_HANDLER( bg_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE32_HANDLER( md_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->md_videoram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap,offset);
}
static WRITE32_HANDLER( fg_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
@@ -112,13 +112,13 @@ static WRITE32_HANDLER( spotty_soundlatch_w )
static CUSTOM_INPUT( spriteram_bit_r )
{
- limenko_state *state = field->port->machine->driver_data<limenko_state>();
+ limenko_state *state = field->port->machine().driver_data<limenko_state>();
return state->spriteram_bit;
}
static WRITE32_HANDLER( spriteram_buffer_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
rectangle clip;
clip.min_x = 0;
clip.max_x = 383;
@@ -134,12 +134,12 @@ static WRITE32_HANDLER( spriteram_buffer_w )
if(state->spriteram_bit)
{
// draw the sprites to the frame buffer
- draw_sprites(space->machine,state->spriteram2,&clip,state->prev_sprites_count);
+ draw_sprites(space->machine(),state->spriteram2,&clip,state->prev_sprites_count);
}
else
{
// draw the sprites to the frame buffer
- draw_sprites(space->machine,state->spriteram,&clip,state->prev_sprites_count);
+ draw_sprites(space->machine(),state->spriteram,&clip,state->prev_sprites_count);
}
// buffer the next number of sprites to draw
@@ -203,7 +203,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( spotty_sound_cmd_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
state->spotty_sound_cmd = data;
}
@@ -214,13 +214,13 @@ static READ8_HANDLER( spotty_sound_cmd_r )
static READ8_HANDLER( spotty_sound_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
// check state->spotty_sound_cmd bits...
if(state->spotty_sound_cmd == 0xf7)
return soundlatch_r(space,0);
else
- return space->machine->device<okim6295_device>("oki")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki")->read(*space,0);
}
static ADDRESS_MAP_START( spotty_sound_io_map, AS_IO, 8 )
@@ -234,7 +234,7 @@ ADDRESS_MAP_END
static TILE_GET_INFO( get_bg_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->bg_videoram[tile_index] & 0x7ffff;
int color = (state->bg_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -242,7 +242,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_md_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->md_videoram[tile_index] & 0x7ffff;
int color = (state->md_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -250,7 +250,7 @@ static TILE_GET_INFO( get_md_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->fg_videoram[tile_index] & 0x7ffff;
int color = (state->fg_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -260,7 +260,7 @@ static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gf
UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
int priority)
{
- limenko_state *state = gfx->machine->driver_data<limenko_state>();
+ limenko_state *state = gfx->machine().driver_data<limenko_state>();
int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
@@ -359,13 +359,13 @@ static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gf
}
// sprites aren't tile based (except for 8x8 ones)
-static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count)
+static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count)
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int i;
- UINT8 *base_gfx = machine->region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine->region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.region("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
UINT8 *gfxdata;
gfx_element gfx;
@@ -418,9 +418,9 @@ static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectan
}
}
-static void copy_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle *cliprect)
+static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle *cliprect)
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int y;
for( y=cliprect->min_y; y<=cliprect->max_y; y++ )
{
@@ -443,7 +443,7 @@ static void copy_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *s
static VIDEO_START( limenko )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,128,64);
state->md_tilemap = tilemap_create(machine, get_md_tile_info,tilemap_scan_rows,8,8,128,64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,128,64);
@@ -457,10 +457,10 @@ static VIDEO_START( limenko )
static SCREEN_UPDATE( limenko )
{
- limenko_state *state = screen->machine->driver_data<limenko_state>();
+ limenko_state *state = screen->machine().driver_data<limenko_state>();
// state->videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_set_enable(state->bg_tilemap, state->videoreg[0] & 4);
tilemap_set_enable(state->md_tilemap, state->videoreg[0] & 2);
@@ -479,7 +479,7 @@ static SCREEN_UPDATE( limenko )
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,1);
if(state->videoreg[0] & 8)
- copy_sprites(screen->machine, bitmap, state->sprites_bitmap, screen->machine->priority_bitmap, cliprect);
+ copy_sprites(screen->machine(), bitmap, state->sprites_bitmap, screen->machine().priority_bitmap, cliprect);
return 0;
}
@@ -996,10 +996,10 @@ ROM_END
static READ32_HANDLER( dynabomb_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0xc25b8)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0xc25b8)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0xe2784/4];
@@ -1007,10 +1007,10 @@ static READ32_HANDLER( dynabomb_speedup_r )
static READ32_HANDLER( legendoh_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x23e32)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x23e32)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x32ab0/4];
@@ -1018,10 +1018,10 @@ static READ32_HANDLER( legendoh_speedup_r )
static READ32_HANDLER( sb2003_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x26da4)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x26da4)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x135800/4];
@@ -1029,10 +1029,10 @@ static READ32_HANDLER( sb2003_speedup_r )
static READ32_HANDLER( spotty_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x8560)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x8560)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x6626c/4];
@@ -1040,33 +1040,33 @@ static READ32_HANDLER( spotty_speedup_r )
static DRIVER_INIT( dynabomb )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe2784, 0xe2787, FUNC(dynabomb_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe2784, 0xe2787, FUNC(dynabomb_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( legendoh )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x32ab0, 0x32ab3, FUNC(legendoh_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x32ab0, 0x32ab3, FUNC(legendoh_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( sb2003 )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x135800, 0x135803, FUNC(sb2003_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x135800, 0x135803, FUNC(sb2003_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( spotty )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- UINT8 *dst = machine->region("gfx1")->base();
- UINT8 *src = machine->region("user2")->base();
+ limenko_state *state = machine.driver_data<limenko_state>();
+ UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src = machine.region("user2")->base();
int x;
/* expand 4bpp roms to 8bpp space */
@@ -1078,7 +1078,7 @@ static DRIVER_INIT( spotty )
dst[x+2] = (src[x+1]&0x0f) >> 0;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6626c, 0x6626f, FUNC(spotty_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6626c, 0x6626f, FUNC(spotty_speedup_r) );
state->spriteram_bit = 1;
}
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 2dd265960bb..b3685a580c6 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -83,13 +83,13 @@ public:
WRITE16_HANDLER( region4_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
COMBINE_DATA(&state->region4[offset]);
}
WRITE16_HANDLER(palette_offset_w)
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
//printf("palette offset set to %04x\n",data);
state->paldac_offset = data;
state->paldac_select = 0;
@@ -99,7 +99,7 @@ WRITE16_HANDLER(palette_offset_w)
WRITE16_HANDLER( palette_data_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
//printf("palette write %04x\n",data);
state->paldac[state->paldac_select][state->paldac_offset] = data;
@@ -112,7 +112,7 @@ WRITE16_HANDLER( palette_data_w )
g = state->paldac[1][state->paldac_offset];
b = state->paldac[2][state->paldac_offset];
- palette_set_color(space->machine,state->paldac_offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),state->paldac_offset,MAKE_RGB(r,g,b));
state->paldac_select = 0;
state->paldac_offset++;
@@ -122,7 +122,7 @@ WRITE16_HANDLER( palette_data_w )
WRITE16_HANDLER( palette_reset_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
// printf("palette reset write %04x\n",data);
state->paldac_select = 0;
@@ -178,7 +178,7 @@ public:
virtual device_t *alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, littlerb_vdp_device(machine, *this));
+ return auto_alloc(machine, littlerb_vdp_device(machine, *this));
}
protected:
@@ -210,9 +210,9 @@ const device_type LITTLERBVDP = littlerb_vdp_device_config::static_alloc_device_
/* end VDP device to give us our own memory map */
-static void littlerb_recalc_regs(running_machine *machine)
+static void littlerb_recalc_regs(running_machine &machine)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
state->vdp_address_low = state->write_address&0xffff;
state->vdp_address_high = (state->write_address>>16)&0xffff;
}
@@ -220,11 +220,11 @@ static void littlerb_recalc_regs(running_machine *machine)
-static void littlerb_data_write(running_machine *machine, UINT16 data, UINT16 mem_mask)
+static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 mem_mask)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
UINT32 addr = state->write_address>>4; // is this right? should we shift?
- address_space *vdp_space = machine->device<littlerb_vdp_device>("littlerbvdp")->space();
+ address_space *vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space();
vdp_space->write_word(addr*2, data, mem_mask);
@@ -239,15 +239,15 @@ static void littlerb_data_write(running_machine *machine, UINT16 data, UINT16 me
-static void littlerb_recalc_address(running_machine *machine)
+static void littlerb_recalc_address(running_machine &machine)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
state->write_address = state->vdp_address_low | state->vdp_address_high<<16;
}
static READ16_HANDLER( littlerb_vdp_r )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
logerror("%06x littlerb_vdp_r offs %04x mask %04x\n", cpu_get_pc(space->cpu), offset, mem_mask);
switch (offset)
@@ -271,7 +271,7 @@ static READ16_HANDLER( littlerb_vdp_r )
#define LOG_VDP 0
static WRITE16_HANDLER( littlerb_vdp_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
if (offset!=2)
{
@@ -311,17 +311,17 @@ static WRITE16_HANDLER( littlerb_vdp_w )
{
case 0:
state->vdp_address_low = data;
- littlerb_recalc_address(space->machine);
+ littlerb_recalc_address(space->machine());
break;
case 1:
state->vdp_address_high = data;
- littlerb_recalc_address(space->machine);
+ littlerb_recalc_address(space->machine());
break;
case 2:
- littlerb_data_write(space->machine, data, mem_mask);
+ littlerb_data_write(space->machine(), data, mem_mask);
break;
case 3:
@@ -431,9 +431,9 @@ static INPUT_PORTS_START( littlerb )
INPUT_PORTS_END
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap, int xsize,int ysize, int offset, int xpos, int ypos, int pal )
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap, int xsize,int ysize, int offset, int xpos, int ypos, int pal )
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
UINT16* spritegfx = state->region4;
int x,y;
//int pal = 1;
@@ -472,12 +472,12 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap, int xsize,in
/* sprite format / offset could be completely wrong, this is just based on our (currently incorrect) vram access */
static SCREEN_UPDATE(littlerb)
{
- littlerb_state *state = screen->machine->driver_data<littlerb_state>();
+ littlerb_state *state = screen->machine().driver_data<littlerb_state>();
int x,y,offs, code;
int xsize,ysize;
int pal;
UINT16* spriteregion = &state->region4[0x400];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
//printf("frame\n");
/* the spriteram format is something like this .. */
for (offs=0x26/2;offs<0xc00;offs+=6) // start at 00x26?
@@ -496,7 +496,7 @@ static SCREEN_UPDATE(littlerb)
//if (code!=0) printf("%04x %04x %04x %04x %04x %04x\n", spriteregion[offs+0], spriteregion[offs+1], spriteregion[offs+2], spriteregion[offs+3], spriteregion[offs+4], spriteregion[offs+5]);
- draw_sprite(screen->machine,bitmap,xsize,ysize,code,x-8,y-16, pal);
+ draw_sprite(screen->machine(),bitmap,xsize,ysize,code,x-8,y-16, pal);
}
return 0;
diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c
index 9a824ac6c9f..1aa1c95396e 100644
--- a/src/mame/drivers/lkage.c
+++ b/src/mame/drivers/lkage.c
@@ -97,7 +97,7 @@ TODO:
static TIMER_CALLBACK( nmi_callback )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -107,18 +107,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( lkage_sound_command_w )
{
soundlatch_w(space, offset, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( lkage_sh_nmi_disable_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( lkage_sh_nmi_enable_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -161,7 +161,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( port_fetch_r )
{
- return space->machine->region("user1")->base()[offset];
+ return space->machine().region("user1")->base()[offset];
}
static ADDRESS_MAP_START( lkage_io_map, AS_IO, 8 )
@@ -480,7 +480,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- lkage_state *state = device->machine->driver_data<lkage_state>();
+ lkage_state *state = device->machine().driver_data<lkage_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -496,11 +496,11 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->bg_tile_bank));
state->save_item(NAME(state->fg_tile_bank));
@@ -530,7 +530,7 @@ static MACHINE_START( lkage )
static MACHINE_RESET( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->bg_tile_bank = state->fg_tile_bank = state->tx_tile_bank =0;
@@ -922,7 +922,7 @@ ROM_END
static READ8_HANDLER( fake_mcu_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
int result = 0;
switch (state->mcu_val)
@@ -958,34 +958,34 @@ static READ8_HANDLER( fake_mcu_r )
static WRITE8_HANDLER( fake_mcu_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->mcu_val = data;
}
static READ8_HANDLER( fake_status_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
return state->mcu_ready;
}
static DRIVER_INIT( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->sprite_dx=0;
}
static DRIVER_INIT( lkageb )
{
- lkage_state *state = machine->driver_data<lkage_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf062, 0xf062, FUNC(fake_mcu_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf087, 0xf087, FUNC(fake_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf062, 0xf062, FUNC(fake_mcu_w) );
+ lkage_state *state = machine.driver_data<lkage_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf062, 0xf062, FUNC(fake_mcu_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf087, 0xf087, FUNC(fake_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf062, 0xf062, FUNC(fake_mcu_w) );
state->sprite_dx=0;
}
static DRIVER_INIT( bygone )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->sprite_dx=1;
}
diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c
index d82e9d74c07..4e76dea73c7 100644
--- a/src/mame/drivers/lockon.c
+++ b/src/mame/drivers/lockon.c
@@ -53,7 +53,7 @@ static READ8_HANDLER( adc_r );
static WRITE16_HANDLER( adrst_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->ctrl_reg = data & 0xff;
/* Bus mastering for shared access */
@@ -64,14 +64,14 @@ static WRITE16_HANDLER( adrst_w )
static READ16_HANDLER( main_gnd_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *gndspace = state->ground->memory().space(AS_PROGRAM);
return gndspace->read_word(V30_GND_ADDR | offset * 2);
}
static WRITE16_HANDLER( main_gnd_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *gndspace = state->ground->memory().space(AS_PROGRAM);
if (ACCESSING_BITS_0_7)
@@ -82,14 +82,14 @@ static WRITE16_HANDLER( main_gnd_w )
static READ16_HANDLER( main_obj_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *objspace = state->object->memory().space(AS_PROGRAM);
return objspace->read_word(V30_OBJ_ADDR | offset * 2);
}
static WRITE16_HANDLER( main_obj_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *objspace = state->object->memory().space(AS_PROGRAM);
if (ACCESSING_BITS_0_7)
@@ -100,7 +100,7 @@ static WRITE16_HANDLER( main_obj_w )
static WRITE16_HANDLER( tst_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
if (offset < 0x800)
{
@@ -121,28 +121,28 @@ static WRITE16_HANDLER( tst_w )
static READ16_HANDLER( main_z80_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *sndspace = state->audiocpu->memory().space(AS_PROGRAM);
return 0xff00 | sndspace->read_byte(offset);
}
static WRITE16_HANDLER( main_z80_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *sndspace = state->audiocpu->memory().space(AS_PROGRAM);
sndspace->write_byte(offset, data);
}
static WRITE16_HANDLER( inten_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->main_inten = 1;
}
static WRITE16_HANDLER( emres_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
- watchdog_reset(space->machine);
+ lockon_state *state = space->machine().driver_data<lockon_state>();
+ watchdog_reset(space->machine());
state->main_inten = 0;
}
@@ -342,10 +342,10 @@ static READ8_HANDLER( adc_r )
{
switch (offset)
{
- case 0: return input_port_read(space->machine, "ADC_BANK");
- case 1: return input_port_read(space->machine, "ADC_PITCH");
- case 2: return input_port_read(space->machine, "ADC_MISSILE");
- case 3: return input_port_read(space->machine, "ADC_HOVER");
+ case 0: return input_port_read(space->machine(), "ADC_BANK");
+ case 1: return input_port_read(space->machine(), "ADC_PITCH");
+ case 2: return input_port_read(space->machine(), "ADC_MISSILE");
+ case 3: return input_port_read(space->machine(), "ADC_HOVER");
default: return 0;
}
}
@@ -392,7 +392,7 @@ static WRITE8_HANDLER( sound_vol )
#define LO_RI 100000.0
#define LO_RP 100000.0
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
static const double gains[16] =
{
@@ -428,18 +428,18 @@ static WRITE8_HANDLER( sound_vol )
static void ym2203_irq(device_t *device, int irq)
{
- lockon_state *state = device->machine->driver_data<lockon_state>();
+ lockon_state *state = device->machine().driver_data<lockon_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE );
}
static WRITE8_DEVICE_HANDLER( ym2203_out_b )
{
- coin_counter_w(device->machine, 0, data & 0x80);
- coin_counter_w(device->machine, 1, data & 0x40);
- coin_counter_w(device->machine, 2, data & 0x20);
+ coin_counter_w(device->machine(), 0, data & 0x80);
+ coin_counter_w(device->machine(), 1, data & 0x40);
+ coin_counter_w(device->machine(), 2, data & 0x20);
/* 'Lock-On' lamp */
- set_led_status(device->machine, 1, !(data & 0x10));
+ set_led_status(device->machine(), 1, !(data & 0x10));
}
static const ym2203_interface ym2203_config =
@@ -464,18 +464,18 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->ground = machine->device("ground");
- state->object = machine->device("object");
- state->f2203_1l = machine->device("f2203.1l");
- state->f2203_2l = machine->device("f2203.2l");
- state->f2203_3l = machine->device("f2203.3l");
- state->f2203_1r = machine->device("f2203.1r");
- state->f2203_2r = machine->device("f2203.2r");
- state->f2203_3r = machine->device("f2203.3r");
+ lockon_state *state = machine.driver_data<lockon_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->ground = machine.device("ground");
+ state->object = machine.device("object");
+ state->f2203_1l = machine.device("f2203.1l");
+ state->f2203_2l = machine.device("f2203.2l");
+ state->f2203_3l = machine.device("f2203.3l");
+ state->f2203_1r = machine.device("f2203.1r");
+ state->f2203_2r = machine.device("f2203.2r");
+ state->f2203_3r = machine.device("f2203.3r");
state->save_item(NAME(state->ground_ctrl));
state->save_item(NAME(state->scroll_h));
@@ -497,7 +497,7 @@ static MACHINE_START( lockon )
static MACHINE_RESET( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
state->ground_ctrl = 0;
state->scroll_h = 0;
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index ab7f7c18662..6d1eed1e281 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -171,7 +171,7 @@ static PALETTE_INIT( looping )
static TILE_GET_INFO( get_tile_info )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
int tile_number = state->videoram[tile_index];
int color = state->colorram[(tile_index & 0x1f) * 2 + 1] & 0x07;
SET_TILE_INFO(0, tile_number, color, 0);
@@ -180,7 +180,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -197,23 +197,23 @@ static VIDEO_START( looping )
static WRITE8_HANDLER( flip_screen_x_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
- flip_screen_x_set(space->machine, ~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
+ looping_state *state = space->machine().driver_data<looping_state>();
+ flip_screen_x_set(space->machine(), ~data & 0x01);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine()) ? 128 : 0);
}
static WRITE8_HANDLER( flip_screen_y_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
- flip_screen_y_set(space->machine, ~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
+ looping_state *state = space->machine().driver_data<looping_state>();
+ flip_screen_y_set(space->machine(), ~data & 0x01);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine()) ? 128 : 0);
}
static WRITE8_HANDLER( looping_videoram_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -221,7 +221,7 @@ static WRITE8_HANDLER( looping_videoram_w )
static WRITE8_HANDLER( looping_colorram_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
int i;
state->colorram[offset] = data;
@@ -248,10 +248,10 @@ static WRITE8_HANDLER( looping_colorram_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
const UINT8 *source;
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
for (source = state->spriteram; source < state->spriteram + 0x40; source += 4)
{
@@ -274,17 +274,17 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
}
}
static SCREEN_UPDATE( looping )
{
- looping_state *state = screen->machine->driver_data<looping_state>();
+ looping_state *state = screen->machine().driver_data<looping_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -298,7 +298,7 @@ static SCREEN_UPDATE( looping )
static MACHINE_START( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
state->save_item(NAME(state->sound));
}
@@ -319,34 +319,34 @@ static INTERRUPT_GEN( looping_interrupt )
static WRITE8_HANDLER( level2_irq_set )
{
if (!(data & 1))
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, ASSERT_LINE, 4);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, ASSERT_LINE, 4);
}
static WRITE8_HANDLER( main_irq_ack_w )
{
if (data == 0)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( looping_souint_clr )
{
if (data == 0)
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( looping_spcint )
{
- cputag_set_input_line_and_vector(device->machine, "audiocpu", 0, !state, 6);
+ cputag_set_input_line_and_vector(device->machine(), "audiocpu", 0, !state, 6);
}
static WRITE8_HANDLER( looping_soundlatch_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, ASSERT_LINE, 4);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, ASSERT_LINE, 4);
}
@@ -370,7 +370,7 @@ static WRITE8_DEVICE_HANDLER( looping_sound_sw )
0007 = AFA
*/
- looping_state *state = device->machine->driver_data<looping_state>();
+ looping_state *state = device->machine().driver_data<looping_state>();
state->sound[offset + 1] = data ^ 1;
dac_data_w(device, ((state->sound[2] << 7) + (state->sound[3] << 6)) * state->sound[7]);
}
@@ -404,7 +404,7 @@ static WRITE8_DEVICE_HANDLER( speech_enable_w )
static WRITE8_HANDLER( ballon_enable_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
if (state->last != data)
mame_printf_debug("ballon_enable_w = %d\n", data);
state->last = data;
@@ -440,21 +440,21 @@ static WRITE8_HANDLER( plr2_w )
static READ8_HANDLER( cop_io_r )
{
- //looping_state *state = space->machine->driver_data<looping_state>();
- // if (offset == 1) return space->machine->rand() & 0x01;
+ //looping_state *state = space->machine().driver_data<looping_state>();
+ // if (offset == 1) return space->machine().rand() & 0x01;
return 1; // state->cop_io[offset];
}
static WRITE8_HANDLER( cop_io_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
state->cop_io[offset] = data;
if (offset == 0) logerror("%02x ",data);
}
static READ8_HANDLER( protection_r )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
// The code reads ($7002) ($7004) alternately
// The result must change at least once every 10 reads
// A read from ($34b0 + result) must == $01
@@ -887,9 +887,9 @@ ROM_END
static DRIVER_INIT( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
- int length = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ looping_state *state = machine.driver_data<looping_state>();
+ int length = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
state->cop_io = auto_alloc_array(machine, UINT8, 0x08);
@@ -899,7 +899,7 @@ static DRIVER_INIT( looping )
rom[i] = BITSWAP8(rom[i], 0,1,2,3,4,5,6,7);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x7007, FUNC(protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x7007, FUNC(protection_r));
}
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 5be87e6de75..0ae62ff7b45 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -57,7 +57,7 @@ Notes:
static DRIVER_INIT( lordgun )
{
int i;
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Decryption
@@ -82,7 +82,7 @@ static DRIVER_INIT( lordgun )
// From XingXing:
static DRIVER_INIT( aliencha )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Protection
@@ -106,7 +106,7 @@ static DRIVER_INIT( aliencha )
static DRIVER_INIT( alienchac )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Protection
@@ -144,22 +144,22 @@ static WRITE8_DEVICE_HANDLER(fake2_w)
static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
- device_t *eeprom = device->machine->device("eeprom");
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
+ device_t *eeprom = device->machine().device("eeprom");
int i;
if (data & ~0xfd)
{
// popmessage("EE: %02x", data);
- logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %02X\n",device->machine().describe_context(),data);
}
- coin_counter_w(device->machine, 0, data & 0x01);
+ coin_counter_w(device->machine(), 0, data & 0x01);
// Update light guns positions
for (i = 0; i < 2; i++)
if ( (data & (0x04 << i)) && !(state->old & (0x04 << i)) )
- lordgun_update_gun(device->machine, i);
+ lordgun_update_gun(device->machine(), i);
// latch the bit
eeprom_write_bit(eeprom, data & 0x40);
@@ -177,20 +177,20 @@ static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
- device_t *eeprom = device->machine->device("eeprom");
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
+ device_t *eeprom = device->machine().device("eeprom");
if (~data & ~0xf8)
{
// popmessage("EE: %02x", data);
- logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %02X\n",device->machine().describe_context(),data);
}
// bit 1? cleared during screen transitions
state->whitescreen = !(data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x08);
- coin_counter_w(device->machine, 1, data & 0x10);
+ coin_counter_w(device->machine(), 0, data & 0x08);
+ coin_counter_w(device->machine(), 1, data & 0x10);
// latch the bit
eeprom_write_bit(eeprom, data & 0x80);
@@ -205,22 +205,22 @@ static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w )
static READ8_DEVICE_HANDLER( aliencha_dip_r )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
switch (state->aliencha_dip_sel & 0x70)
{
- case 0x30: return input_port_read(device->machine, "DIP1");
- case 0x60: return input_port_read(device->machine, "DIP2");
- case 0x50: return input_port_read(device->machine, "DIP3");
+ case 0x30: return input_port_read(device->machine(), "DIP1");
+ case 0x60: return input_port_read(device->machine(), "DIP2");
+ case 0x50: return input_port_read(device->machine(), "DIP3");
default:
- logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine->describe_context(),state->aliencha_dip_sel);
+ logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine().describe_context(),state->aliencha_dip_sel);
return 0xff;
}
}
static WRITE8_DEVICE_HANDLER( aliencha_dip_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
state->aliencha_dip_sel = data;
}
@@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER( aliencha_dip_w )
// Unknown, always equal to 7 in lordgun, aliencha.
static WRITE16_HANDLER( lordgun_priority_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->priority);
// popmessage("PR: %04x", data);
}
@@ -236,25 +236,25 @@ static WRITE16_HANDLER( lordgun_priority_w )
static READ16_HANDLER( lordgun_gun_0_x_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[0].hw_x;
}
static READ16_HANDLER( lordgun_gun_0_y_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[0].hw_y;
}
static READ16_HANDLER( lordgun_gun_1_x_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[1].hw_x;
}
static READ16_HANDLER( lordgun_gun_1_y_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[1].hw_y;
}
@@ -264,7 +264,7 @@ static WRITE16_HANDLER( lordgun_soundlatch_w )
if (ACCESSING_BITS_0_7) soundlatch_w (space, 0, (data >> 0) & 0xff);
if (ACCESSING_BITS_8_15) soundlatch2_w(space, 0, (data >> 8) & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( lordgun_map, AS_PROGRAM, 16 )
@@ -341,7 +341,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( lordgun_okibank_w )
{
downcast<okim6295_device *>(device)->set_bank_base((data & 2) ? 0x40000 : 0);
- if (data & ~3) logerror("%s: unknown okibank bits %02x\n", device->machine->describe_context(), data);
+ if (data & ~3) logerror("%s: unknown okibank bits %02x\n", device->machine().describe_context(), data);
// popmessage("OKI %x", data);
}
@@ -664,7 +664,7 @@ static const ppi8255_interface aliencha_ppi8255_intf[2] =
static void soundirq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_IRQ0, state);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_IRQ0, state);
}
static const ym3812_interface lordgun_ym3812_interface =
diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c
index 1a04bd334fd..c0c8e463c47 100644
--- a/src/mame/drivers/lsasquad.c
+++ b/src/mame/drivers/lsasquad.c
@@ -155,12 +155,12 @@ Notes:
static WRITE8_HANDLER( lsasquad_bankswitch_w )
{
/* bits 0-2 select ROM bank */
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
/* bit 3 is zeroed on startup, maybe reset sound CPU */
/* bit 4 flips screen */
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
/* other bits unknown */
}
@@ -540,7 +540,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- lsasquad_state *state = device->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = device->machine().driver_data<lsasquad_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -566,14 +566,14 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lsasquad )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->port_a_in));
state->save_item(NAME(state->port_a_out));
@@ -595,7 +595,7 @@ static MACHINE_START( lsasquad )
static MACHINE_RESET( lsasquad )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
state->sound_pending = 0;
state->sound_nmi_enable = 0;
diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c
index 652f74c6a0b..5249c1676bd 100644
--- a/src/mame/drivers/ltcasino.c
+++ b/src/mame/drivers/ltcasino.c
@@ -34,7 +34,7 @@ public:
static TILE_GET_INFO( get_ltcasino_tile_info )
{
- ltcasino_state *state = machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = machine.driver_data<ltcasino_state>();
int tileno, colour;
tileno = state->tile_num_ram[tile_index];
@@ -47,21 +47,21 @@ static TILE_GET_INFO( get_ltcasino_tile_info )
static VIDEO_START(ltcasino)
{
- ltcasino_state *state = machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = machine.driver_data<ltcasino_state>();
state->tilemap = tilemap_create(machine, get_ltcasino_tile_info,tilemap_scan_rows,8, 8,64,32);
}
static WRITE8_HANDLER( ltcasino_tile_num_w )
{
- ltcasino_state *state = space->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = space->machine().driver_data<ltcasino_state>();
state->tile_num_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
}
static WRITE8_HANDLER( ltcasino_tile_atr_w )
{
- ltcasino_state *state = space->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = space->machine().driver_data<ltcasino_state>();
state->tile_atr_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
}
@@ -634,7 +634,7 @@ GFXDECODE_END
static SCREEN_UPDATE(ltcasino)
{
- ltcasino_state *state = screen->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = screen->machine().driver_data<ltcasino_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
return 0;
}
@@ -711,7 +711,7 @@ ROM_END
static DRIVER_INIT(mv4in1)
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for(i=0;i<0x10000;i++)
rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);
}
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index 853348efaa5..baef1deb01b 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -116,14 +116,14 @@ public:
static WRITE8_HANDLER( luckgrln_reel1_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel1_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel1_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( luckgrln_reel1_attr_w )
static TILE_GET_INFO( get_luckgrln_reel1_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel1_ram[tile_index];
int attr = state->reel1_attr[tile_index];
int col = (attr & 0x1f);
@@ -150,14 +150,14 @@ static TILE_GET_INFO( get_luckgrln_reel1_tile_info )
static WRITE8_HANDLER( luckgrln_reel2_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel2_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel2_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
@@ -165,7 +165,7 @@ static WRITE8_HANDLER( luckgrln_reel2_attr_w )
static TILE_GET_INFO( get_luckgrln_reel2_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel2_ram[tile_index];
int attr = state->reel2_attr[tile_index];
int col = (attr & 0x1f);
@@ -182,14 +182,14 @@ static TILE_GET_INFO( get_luckgrln_reel2_tile_info )
static WRITE8_HANDLER( luckgrln_reel3_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel3_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel3_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
@@ -197,7 +197,7 @@ static WRITE8_HANDLER( luckgrln_reel3_attr_w )
static TILE_GET_INFO( get_luckgrln_reel3_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel3_ram[tile_index];
int attr = state->reel3_attr[tile_index];
int col = (attr & 0x1f);
@@ -213,14 +213,14 @@ static TILE_GET_INFO( get_luckgrln_reel3_tile_info )
static WRITE8_HANDLER( luckgrln_reel4_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel4_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel4_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel4_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel4_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel4_tilemap,offset);
}
@@ -228,7 +228,7 @@ static WRITE8_HANDLER( luckgrln_reel4_attr_w )
static TILE_GET_INFO( get_luckgrln_reel4_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel4_ram[tile_index];
int attr = state->reel4_attr[tile_index];
int col = (attr & 0x1f);
@@ -244,7 +244,7 @@ static TILE_GET_INFO( get_luckgrln_reel4_tile_info )
static VIDEO_START(luckgrln)
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
state->reel1_tilemap = tilemap_create(machine,get_luckgrln_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_luckgrln_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_luckgrln_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
@@ -263,7 +263,7 @@ static VIDEO_START(luckgrln)
static SCREEN_UPDATE(luckgrln)
{
- luckgrln_state *state = screen->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = screen->machine().driver_data<luckgrln_state>();
int y,x;
int count = 0;
const rectangle &visarea = screen->visible_area();
@@ -341,10 +341,10 @@ static SCREEN_UPDATE(luckgrln)
if (bgenable==3) tilemap_draw(bitmap, &clip, state->reel4_tilemap, 0, 0);
}
- if (tileattr&0x08) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
#else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying)
- if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
if (tileattr&0x04)
{
@@ -354,7 +354,7 @@ static SCREEN_UPDATE(luckgrln)
if (bgenable==3) tilemap_draw(bitmap, &clip, state->reel4_tilemap, 0, 0);
}
- if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
#endif
count++;
@@ -401,7 +401,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( output_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
/* correct? */
if (data==0x84)
state->nmi_enable = 0;
@@ -415,19 +415,19 @@ static WRITE8_HANDLER( output_w )
static WRITE8_HANDLER( palette_offset_low_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_count = data<<1;
}
static WRITE8_HANDLER( palette_offset_high_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_count = state->palette_count | data<<9;
}
static WRITE8_HANDLER( palette_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_ram[state->palette_count] = data;
@@ -442,7 +442,7 @@ static WRITE8_HANDLER( palette_w )
g = (dat >> 5) & 0x1f;
b = (dat >> 10) & 0x1f;
- palette_set_color_rgb(space->machine, offs/2, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offs/2, pal5bit(r), pal5bit(g), pal5bit(b));
}
@@ -454,7 +454,7 @@ static WRITE8_HANDLER( palette_w )
static READ8_HANDLER( rtc_r )
{
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
switch(offset)
{
@@ -534,10 +534,10 @@ static WRITE8_HANDLER(counters_w)
xxxx ---- unused
*/
- coin_counter_w(space->machine, 0, data & 0x01); /* COIN 1 */
- coin_counter_w(space->machine, 1, data & 0x04); /* COIN 2 */
- coin_counter_w(space->machine, 2, data & 0x08); /* COIN 3 */
- coin_counter_w(space->machine, 3, data & 0x02); /* KEY IN */
+ coin_counter_w(space->machine(), 0, data & 0x01); /* COIN 1 */
+ coin_counter_w(space->machine(), 1, data & 0x04); /* COIN 2 */
+ coin_counter_w(space->machine(), 2, data & 0x08); /* COIN 3 */
+ coin_counter_w(space->machine(), 3, data & 0x02); /* KEY IN */
}
@@ -841,9 +841,9 @@ static const mc6845_interface mc6845_intf =
static INTERRUPT_GEN( luckgrln_irq )
{
- luckgrln_state *state = device->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = device->machine().driver_data<luckgrln_state>();
if(state->nmi_enable)
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_CONFIG_START( luckgrln, luckgrln_state )
@@ -875,7 +875,7 @@ static DRIVER_INIT( luckgrln )
{
int i;
UINT8 x,v;
- UINT8* rom = machine->region("rom_data")->base();
+ UINT8* rom = machine.region("rom_data")->base();
for (i=0;i<0x20000;i++)
{
@@ -891,7 +891,7 @@ static DRIVER_INIT( luckgrln )
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c
index 8ef7bc1e3bd..1db4c33f024 100644
--- a/src/mame/drivers/lucky74.c
+++ b/src/mame/drivers/lucky74.c
@@ -683,7 +683,7 @@
static READ8_HANDLER( custom_09R81P_port_r )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
if (offset != 0x00)
{
return state->adpcm_reg[offset];
@@ -696,13 +696,13 @@ static READ8_HANDLER( custom_09R81P_port_r )
static WRITE8_HANDLER( custom_09R81P_port_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->adpcm_reg[offset] = data;
}
static WRITE8_DEVICE_HANDLER( ym2149_portb_w )
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
/* when is in game mode writes 0x0a.
when is in test mode writes 0x0e.
after reset writes 0x16.
@@ -710,7 +710,7 @@ static WRITE8_DEVICE_HANDLER( ym2149_portb_w )
bit 0 contains the screen orientation.
*/
state->ym2149_portb = data;
- flip_screen_set(device->machine, data & 0x01);
+ flip_screen_set(device->machine(), data & 0x01);
}
static READ8_HANDLER( usart_8251_r )
@@ -722,7 +722,7 @@ static READ8_HANDLER( usart_8251_r )
static WRITE8_HANDLER( usart_8251_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
/* writes to USART 8251 port */
state->usart_8251 = data;
logerror("write to USART port: %02x \n", state->usart_8251);
@@ -737,7 +737,7 @@ static READ8_HANDLER( copro_sm7831_r )
static WRITE8_HANDLER( copro_sm7831_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
/* write to SM7831 co-processor */
state->copro_sm7831 = data;
logerror("write to co-processor: %2X\n", state->copro_sm7831);
@@ -794,7 +794,7 @@ static WRITE8_DEVICE_HANDLER(lamps_b_w)
static INTERRUPT_GEN( nmi_interrupt )
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
if ((state->ym2149_portb & 0x10) == 0) /* ym2149 portB bit 4 trigger the NMI */
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -1098,7 +1098,7 @@ GFXDECODE_END
static SOUND_START( lucky74 )
{
- lucky74_state *state = machine->driver_data<lucky74_state>();
+ lucky74_state *state = machine.driver_data<lucky74_state>();
/* cleaning all 09R81P registers */
UINT8 i;
@@ -1113,7 +1113,7 @@ static SOUND_START( lucky74 )
static void lucky74_adpcm_int(device_t *device)
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
if (state->adpcm_reg[05] == 0x01) /* register 0x05 (bit 0 activated), trigger the sample */
{
/* conditional zone for samples reproduction */
@@ -1134,7 +1134,7 @@ static void lucky74_adpcm_int(device_t *device)
if (state->adpcm_data == -1)
{
/* transferring 1st nibble */
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
diff --git a/src/mame/drivers/lvcards.c b/src/mame/drivers/lvcards.c
index bd7f2c6a19d..24c9cf60fb0 100644
--- a/src/mame/drivers/lvcards.c
+++ b/src/mame/drivers/lvcards.c
@@ -82,7 +82,7 @@ TODO:
static MACHINE_START( lvpoker )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
state_save_register_global(machine, state->payout);
state_save_register_global(machine, state->pulse);
state_save_register_global(machine, state->result);
@@ -90,7 +90,7 @@ static MACHINE_START( lvpoker )
static MACHINE_RESET( lvpoker )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
state->payout = 0;
state->pulse = 0;
state->result = 0;
@@ -98,7 +98,7 @@ static MACHINE_RESET( lvpoker )
static WRITE8_HANDLER(control_port_2_w)
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
switch (data)
{
case 0x60:
@@ -115,7 +115,7 @@ static WRITE8_HANDLER(control_port_2_w)
static WRITE8_HANDLER(control_port_2a_w)
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
switch (data)
{
case 0x60:
@@ -132,8 +132,8 @@ static WRITE8_HANDLER(control_port_2a_w)
static READ8_HANDLER( payout_r )
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
- state->result = input_port_read(space->machine, "IN2");
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
+ state->result = input_port_read(space->machine(), "IN2");
if (state->payout)
{
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index ff8bd2eb293..d6abcb3c931 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -62,30 +62,30 @@ Notes:
static WRITE8_HANDLER( avengers_adpcm_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->adpcm = data;
}
static READ8_HANDLER( avengers_adpcm_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
return state->adpcm;
}
static WRITE8_HANDLER( lwings_bankswitch_w )
{
/* bit 0 is flip screen */
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
/* bits 1 and 2 select ROM bank */
- memory_set_bank(space->machine, "bank1", (data & 0x06) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x06) >> 1);
/* bit 3 enables NMI */
interrupt_enable_w(space, 0, data & 0x08);
/* bits 6 and 7 are coin counters */
- coin_counter_w(space->machine, 1, data & 0x40);
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 1, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x80);
}
static INTERRUPT_GEN( lwings_interrupt )
@@ -97,7 +97,7 @@ static INTERRUPT_GEN( lwings_interrupt )
static WRITE8_HANDLER( avengers_protection_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
int pc = cpu_get_pc(space->cpu);
if (pc == 0x2eeb)
@@ -125,13 +125,13 @@ static WRITE8_HANDLER( avengers_protection_w )
static WRITE8_HANDLER( avengers_prot_bank_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->palette_pen = data * 64;
}
-static int avengers_fetch_paldata( running_machine *machine )
+static int avengers_fetch_paldata( running_machine &machine )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
static const char pal_data[] =
/* page 1: 0x03,0x02,0x01,0x00 */
@@ -224,7 +224,7 @@ static int avengers_fetch_paldata( running_machine *machine )
static READ8_HANDLER( avengers_protection_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
static const int xpos[8] = { 10, 7, 0, -7, -10, -7, 0, 7 };
static const int ypos[8] = { 0, 7, 10, 7, 0, -7, -10, -7 };
int best_dist = 0;
@@ -235,7 +235,7 @@ static READ8_HANDLER( avengers_protection_r )
if (cpu_get_pc(space->cpu) == 0x7c7)
{
/* palette data */
- return avengers_fetch_paldata(space->machine);
+ return avengers_fetch_paldata(space->machine());
}
/* Point to Angle Function
@@ -261,7 +261,7 @@ static READ8_HANDLER( avengers_protection_r )
static READ8_HANDLER( avengers_soundlatch2_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
UINT8 data = *state->soundlatch2 | state->soundstate;
state->soundstate = 0;
return(data);
@@ -742,8 +742,8 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( lwings )
{
- lwings_state *state = machine->driver_data<lwings_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lwings_state *state = machine.driver_data<lwings_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
@@ -758,7 +758,7 @@ static MACHINE_START( lwings )
static MACHINE_RESET( lwings )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
state->bg2_image = 0;
state->scroll_x[0] = 0;
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index 81ab3585d8f..6a38d9bbac1 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -130,14 +130,14 @@ Notes (couriersud)
static WRITE8_DEVICE_HANDLER( ic8j1_output_changed )
{
- m10_state *state = device->machine->driver_data<m10_state>();
- LOG(("ic8j1: %d %d\n", data, device->machine->primary_screen->vpos()));
+ m10_state *state = device->machine().driver_data<m10_state>();
+ LOG(("ic8j1: %d %d\n", data, device->machine().primary_screen->vpos()));
device_set_input_line(state->maincpu, 0, !data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_DEVICE_HANDLER( ic8j2_output_changed )
{
- m10_state *state = device->machine->driver_data<m10_state>();
+ m10_state *state = device->machine().driver_data<m10_state>();
/* written from /Q to A with slight delight */
LOG(("ic8j2: %d\n", data));
@@ -194,12 +194,12 @@ static PALETTE_INIT( m10 )
static MACHINE_START( m10 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
- state->maincpu = machine->device("maincpu");
- state->ic8j1 = machine->device("ic8j1");
- state->ic8j2 = machine->device("ic8j2");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->ic8j1 = machine.device("ic8j1");
+ state->ic8j2 = machine.device("ic8j2");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->bottomline));
state->save_item(NAME(state->flip));
@@ -208,7 +208,7 @@ static MACHINE_START( m10 )
static MACHINE_RESET( m10 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
state->bottomline = 0;
state->flip = 0;
@@ -242,7 +242,7 @@ static MACHINE_RESET( m10 )
static WRITE8_HANDLER( m10_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0x40)
@@ -252,11 +252,11 @@ static WRITE8_HANDLER( m10_ctrl_w )
/* I have NO IDEA if this is correct or not */
state->bottomline = ~data & 0x20;
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x80);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x80);
/* sound command in lower 4 bytes */
switch (data & 0x07)
@@ -319,7 +319,7 @@ static WRITE8_HANDLER( m10_ctrl_w )
static WRITE8_HANDLER( m11_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0x4c)
@@ -328,11 +328,11 @@ static WRITE8_HANDLER( m11_ctrl_w )
state->bottomline = ~data & 0x20;
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x80);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x80);
}
/*
@@ -352,16 +352,16 @@ static WRITE8_HANDLER( m11_ctrl_w )
static WRITE8_HANDLER( m15_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0xf0)
popmessage("M15 ctrl: %02x",data);
#endif
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x04;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x08);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x08);
}
@@ -388,7 +388,7 @@ static WRITE8_HANDLER( m10_a500_w )
static WRITE8_HANDLER( m11_a100_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
int raising_bits = data & ~state->last;
//int falling_bits = ~data & state->last;
@@ -423,7 +423,7 @@ static WRITE8_HANDLER( m11_a100_w )
static WRITE8_HANDLER( m15_a100_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
//int raising_bits = data & ~state->last;
int falling_bits = ~data & state->last;
@@ -481,8 +481,8 @@ static WRITE8_HANDLER( m15_a100_w )
static READ8_HANDLER( m10_a700_r )
{
- m10_state *state = space->machine->driver_data<m10_state>();
- //LOG(("rd:%d\n",space->machine->primary_screen->vpos()));
+ m10_state *state = space->machine().driver_data<m10_state>();
+ //LOG(("rd:%d\n",space->machine().primary_screen->vpos()));
LOG(("clear\n"));
ttl74123_clear_w(state->ic8j1, 0, 0);
ttl74123_clear_w(state->ic8j1, 0, 1);
@@ -491,8 +491,8 @@ static READ8_HANDLER( m10_a700_r )
static READ8_HANDLER( m11_a700_r )
{
- m10_state *state = space->machine->driver_data<m10_state>();
- //LOG(("rd:%d\n",space->machine->primary_screen->vpos()));
+ m10_state *state = space->machine().driver_data<m10_state>();
+ //LOG(("rd:%d\n",space->machine().primary_screen->vpos()));
//device_set_input_line(state->maincpu, 0, CLEAR_LINE);
LOG(("clear\n"));
ttl74123_clear_w(state->ic8j1, 0, 0);
@@ -508,7 +508,7 @@ static READ8_HANDLER( m11_a700_r )
static INPUT_CHANGED( coin_inserted )
{
- m10_state *state = field->port->machine->driver_data<m10_state>();
+ m10_state *state = field->port->machine().driver_data<m10_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -516,16 +516,16 @@ static INPUT_CHANGED( coin_inserted )
static TIMER_CALLBACK( interrupt_callback )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
if (param == 0)
{
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBSTART + 16), FUNC(interrupt_callback), 1);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 16), FUNC(interrupt_callback), 1);
}
if (param == 1)
{
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBSTART + 24), FUNC(interrupt_callback), 2);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 24), FUNC(interrupt_callback), 2);
}
if (param == -1)
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -536,7 +536,7 @@ static TIMER_CALLBACK( interrupt_callback )
static INTERRUPT_GEN( m11_interrupt )
{
device_set_input_line(device, 0, ASSERT_LINE);
- //device->machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBEND), FUNC(interrupt_callback), -1);
+ //device->machine().scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBEND), FUNC(interrupt_callback), -1);
}
static INTERRUPT_GEN( m10_interrupt )
@@ -548,7 +548,7 @@ static INTERRUPT_GEN( m10_interrupt )
static INTERRUPT_GEN( m15_interrupt )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), FUNC(interrupt_callback), -1);
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), FUNC(interrupt_callback), -1);
}
/*************************************
@@ -930,7 +930,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( andromed )
{
int i;
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
for (i = 0x1c00; i < 0x2000; i++)
state->rom[i] = 0x60;
@@ -939,7 +939,7 @@ static DRIVER_INIT( andromed )
static DRIVER_INIT( ipminva1 )
{
int i;
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
for (i = 0x1400; i < 0x17ff; i++)
state->rom[i] = 0x60;
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index a0ac6fb5b1b..793506987ba 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -48,48 +48,48 @@ static WRITE16_HANDLER( bankswitch_w )
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&RAM[0x100000 + ((data&0x7)*0x10000)]);
+ UINT8 *RAM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x100000 + ((data&0x7)*0x10000)]);
}
}
static MACHINE_START( m107 )
{
- m107_state *state = machine->driver_data<m107_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m107_scanline_interrupt));
+ m107_state *state = machine.driver_data<m107_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m107_scanline_interrupt));
}
static MACHINE_RESET( m107 )
{
- m107_state *state = machine->driver_data<m107_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m107_state *state = machine.driver_data<m107_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
/*****************************************************************************/
static TIMER_CALLBACK( m107_scanline_interrupt )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
int scanline = param;
/* raster interrupt */
if (scanline == state->raster_irq_position)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M107_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine->primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M107_IRQ_0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
@@ -97,8 +97,8 @@ static WRITE16_HANDLER( m107_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
}
}
@@ -108,7 +108,7 @@ enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR };
static TIMER_CALLBACK( setvector_callback )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
switch(param)
{
@@ -120,9 +120,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (state->irqvector & 0x2) /* YM2151 has precedence */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x18);
else if (state->irqvector & 0x1) /* V30 */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x19);
if (state->irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
@@ -132,7 +132,7 @@ static TIMER_CALLBACK( setvector_callback )
static WRITE16_HANDLER( m107_soundlatch_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
soundlatch_w(space, 0, data & 0xff);
// logerror("soundlatch_w %02x\n",data);
}
@@ -140,7 +140,7 @@ static WRITE16_HANDLER( m107_soundlatch_w )
static READ16_HANDLER( m107_sound_status_r )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
return state->sound_status;
}
@@ -151,19 +151,19 @@ static READ16_HANDLER( m107_soundlatch_r )
static WRITE16_HANDLER( m107_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
}
static WRITE16_HANDLER( m107_sound_status_w )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
COMBINE_DATA(&state->sound_status);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, HOLD_LINE, M107_IRQ_3);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, HOLD_LINE, M107_IRQ_3);
}
static WRITE16_HANDLER( m107_sound_reset_w )
{
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
}
/*****************************************************************************/
@@ -805,9 +805,9 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
if (state)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
static const ym2151_interface ym2151_config =
@@ -1014,13 +1014,13 @@ ROM_END
static DRIVER_INIT( firebarr )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0,RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
state->irq_vectorbase = 0x20;
@@ -1029,13 +1029,13 @@ static DRIVER_INIT( firebarr )
static DRIVER_INIT( dsoccr94 )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
state->irq_vectorbase = 0x80;
@@ -1044,13 +1044,13 @@ static DRIVER_INIT( dsoccr94 )
static DRIVER_INIT( wpksoc )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c
index b6b33d19c58..7b835476ad8 100644
--- a/src/mame/drivers/m14.c
+++ b/src/mame/drivers/m14.c
@@ -99,7 +99,7 @@ static PALETTE_INIT( m14 )
static TILE_GET_INFO( m14_get_tile_info )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
int code = state->video_ram[tile_index];
int color = state->color_ram[tile_index] & 0x0f;
@@ -115,14 +115,14 @@ static TILE_GET_INFO( m14_get_tile_info )
static VIDEO_START( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
state->m14_tilemap = tilemap_create(machine, m14_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( m14 )
{
- m14_state *state = screen->machine->driver_data<m14_state>();
+ m14_state *state = screen->machine().driver_data<m14_state>();
tilemap_draw(bitmap, cliprect, state->m14_tilemap, 0, 0);
return 0;
@@ -131,7 +131,7 @@ static SCREEN_UPDATE( m14 )
static WRITE8_HANDLER( m14_vram_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->m14_tilemap, offset);
@@ -139,7 +139,7 @@ static WRITE8_HANDLER( m14_vram_w )
static WRITE8_HANDLER( m14_cram_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
state->color_ram[offset] = data;
tilemap_mark_tile_dirty(state->m14_tilemap, offset);
@@ -154,13 +154,13 @@ static WRITE8_HANDLER( m14_cram_w )
static READ8_HANDLER( m14_rng_r )
{
/* graphic artifacts happens if this doesn't return random values. */
- return (space->machine->rand() & 0x0f) | 0xf0; /* | (input_port_read(space->machine, "IN1") & 0x80)*/;
+ return (space->machine().rand() & 0x0f) | 0xf0; /* | (input_port_read(space->machine(), "IN1") & 0x80)*/;
}
/* Here routes the hopper & the inputs */
static READ8_HANDLER( input_buttons_r )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
if (state->hop_mux)
{
@@ -168,7 +168,7 @@ static READ8_HANDLER( input_buttons_r )
return 0; //0x43 status bits
}
else
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
#if 0
@@ -184,7 +184,7 @@ static WRITE8_HANDLER( test_w )
static WRITE8_HANDLER( hopper_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
/* ---- x--- coin out */
/* ---- --x- hopper/input mux? */
@@ -222,7 +222,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( left_coin_inserted )
{
- m14_state *state = field->port->machine->driver_data<m14_state>();
+ m14_state *state = field->port->machine().driver_data<m14_state>();
/* left coin insertion causes a rst6.5 (vector 0x34) */
if (newval)
device_set_input_line(state->maincpu, I8085_RST65_LINE, HOLD_LINE);
@@ -230,7 +230,7 @@ static INPUT_CHANGED( left_coin_inserted )
static INPUT_CHANGED( right_coin_inserted )
{
- m14_state *state = field->port->machine->driver_data<m14_state>();
+ m14_state *state = field->port->machine().driver_data<m14_state>();
/* right coin insertion causes a rst5.5 (vector 0x2c) */
if (newval)
device_set_input_line(state->maincpu, I8085_RST55_LINE, HOLD_LINE);
@@ -314,16 +314,16 @@ static INTERRUPT_GEN( m14_irq )
static MACHINE_START( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->hop_mux));
}
static MACHINE_RESET( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
state->hop_mux = 0;
}
diff --git a/src/mame/drivers/m52.c b/src/mame/drivers/m52.c
index 2ef7c62edd8..00acb262403 100644
--- a/src/mame/drivers/m52.c
+++ b/src/mame/drivers/m52.c
@@ -382,7 +382,7 @@ GFXDECODE_END
static MACHINE_RESET( m52 )
{
- m52_state *state = machine->driver_data<m52_state>();
+ m52_state *state = machine.driver_data<m52_state>();
state->bg1xpos = 0;
state->bg1ypos = 0;
diff --git a/src/mame/drivers/m58.c b/src/mame/drivers/m58.c
index b1d22552763..e837aaa17ba 100644
--- a/src/mame/drivers/m58.c
+++ b/src/mame/drivers/m58.c
@@ -435,7 +435,7 @@ static DRIVER_INIT( yard85 )
// on these sets the content of the sprite color PROM needs reversing
// are the proms on the other sets from bootleg boards, or hand modified?
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x10);
- UINT8* region = machine->region("proms")->base();
+ UINT8* region = machine.region("proms")->base();
int i;
for (i=0;i<0x10;i++)
diff --git a/src/mame/drivers/m62.c b/src/mame/drivers/m62.c
index b5f1fe71929..974f02afc87 100644
--- a/src/mame/drivers/m62.c
+++ b/src/mame/drivers/m62.c
@@ -84,21 +84,21 @@ other supported games as well.
static READ8_HANDLER( ldrun2_bankswitch_r )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
if (state->ldrun2_bankswap)
{
state->ldrun2_bankswap--;
/* swap to bank #1 on second read */
if (state->ldrun2_bankswap == 0)
- memory_set_bank(space->machine, "bank1", 1);
+ memory_set_bank(space->machine(), "bank1", 1);
}
return 0;
}
static WRITE8_HANDLER( ldrun2_bankswitch_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
static const int banks[30] =
{
0,0,0,0,0,1,0,1,0,0,
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( ldrun2_bankswitch_w )
logerror("unknown bank select %02x\n",data);
return;
}
- memory_set_bank(space->machine, "bank1", banks[data - 1]);
+ memory_set_bank(space->machine(), "bank1", banks[data - 1]);
}
else
{
@@ -145,30 +145,30 @@ static READ8_HANDLER( ldrun3_prot_7_r )
static WRITE8_HANDLER( ldrun4_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_HANDLER( kidniki_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
#define battroad_bankswitch_w kidniki_bankswitch_w
static WRITE8_HANDLER( spelunkr_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE8_HANDLER( spelunk2_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", (data & 0xc0) >> 6);
- memory_set_bank(space->machine, "bank2", (data & 0x3c) >> 2);
+ memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(), "bank2", (data & 0x3c) >> 2);
}
static WRITE8_HANDLER( youjyudn_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
@@ -932,7 +932,7 @@ GFXDECODE_END
static MACHINE_START( m62 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->save_item(NAME(state->ldrun2_bankswap));
state->save_item(NAME(state->bankcontrol));
@@ -940,7 +940,7 @@ static MACHINE_START( m62 )
static MACHINE_RESET( m62 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->flipscreen = 0;
state->m62_background_hscroll = 0;
@@ -2161,50 +2161,50 @@ ROM_END
static DRIVER_INIT( battroad )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun2 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun4 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( kidniki )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* in Kid Niki, bank 0 has code falling from 7fff to 8000, */
/* so I have to copy it there because bank switching wouldn't catch it */
memcpy(ROM + 0x08000, ROM + 0x10000, 0x2000);
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunkr )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunk2 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x20000, 0x1000);
- memory_configure_bank(machine, "bank2", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x20000, 0x1000);
+ memory_configure_bank(machine, "bank2", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
}
static DRIVER_INIT( youjyudn )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
GAME( 1984, kungfum, 0, kungfum, kungfum, 0, ROT0, "Irem", "Kung-Fu Master", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 598e7c4c58f..e8eba959c88 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -209,7 +209,7 @@ static PALETTE_INIT( m63 )
static WRITE8_HANDLER( m63_videoram_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -217,7 +217,7 @@ static WRITE8_HANDLER( m63_videoram_w )
static WRITE8_HANDLER( m63_colorram_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( m63_colorram_w )
static WRITE8_HANDLER( m63_videoram2_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( m63_videoram2_w )
static WRITE8_HANDLER( m63_palbank_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (state->pal_bank != (data & 0x01))
{
@@ -244,25 +244,25 @@ static WRITE8_HANDLER( m63_palbank_w )
static WRITE8_HANDLER( m63_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (~data & 0x01))
+ if (flip_screen_get(space->machine()) != (~data & 0x01))
{
- flip_screen_set(space->machine, ~data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), ~data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static WRITE8_HANDLER( fghtbskt_flipscreen_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
- flip_screen_set(space->machine, data);
- state->fg_flag = flip_screen_get(space->machine) ? TILE_FLIPX : 0;
+ flip_screen_set(space->machine(), data);
+ state->fg_flag = flip_screen_get(space->machine()) ? TILE_FLIPX : 0;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] | ((attr & 0x30) << 4);
@@ -273,7 +273,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int code = state->videoram2[tile_index];
@@ -282,7 +282,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -291,9 +291,9 @@ static VIDEO_START( m63 )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -314,7 +314,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -323,7 +323,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx > 0xf0)
{
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx - 0x100, sy, 0);
@@ -334,7 +334,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( m63 )
{
- m63_state *state = screen->machine->driver_data<m63_state>();
+ m63_state *state = screen->machine().driver_data<m63_state>();
int col;
@@ -342,7 +342,7 @@ static SCREEN_UPDATE( m63 )
tilemap_set_scrolly(state->bg_tilemap, col, state->scrollram[col * 8]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -350,19 +350,19 @@ static SCREEN_UPDATE( m63 )
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE8_HANDLER( snd_irq_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
device_set_input_line(state->soundcpu, 0, ASSERT_LINE);
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static WRITE8_HANDLER( snddata_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if ((state->p2 & 0xf0) == 0xe0)
ay8910_address_w(state->ay1, 0, offset);
@@ -378,13 +378,13 @@ static WRITE8_HANDLER( snddata_w )
static WRITE8_HANDLER( p1_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->p1 = data;
}
static WRITE8_HANDLER( p2_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->p2 = data;
if((state->p2 & 0xf0) == 0x50)
@@ -395,13 +395,13 @@ static WRITE8_HANDLER( p2_w )
static READ8_HANDLER( snd_status_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
return state->sound_status;
}
static READ8_HANDLER( irq_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (state->sound_irq)
{
@@ -413,18 +413,18 @@ static READ8_HANDLER( irq_r )
static READ8_HANDLER( snddata_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
switch (state->p2 & 0xf0)
{
case 0x60: return soundlatch_r(space, 0); ;
- case 0x70: return space->machine->region("user1")->base()[((state->p1 & 0x1f) << 8) | offset];
+ case 0x70: return space->machine().region("user1")->base()[((state->p1 & 0x1f) << 8) | offset];
}
return 0xff;
}
static WRITE8_HANDLER( fghtbskt_samples_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (data & 1)
sample_start_raw(state->samples, 0, state->samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
@@ -673,10 +673,10 @@ GFXDECODE_END
static SAMPLES_START( fghtbskt_sh_start )
{
- running_machine *machine = device->machine;
- m63_state *state = machine->driver_data<m63_state>();
- int i, len = machine->region("samples")->bytes();
- UINT8 *ROM = machine->region("samples")->base();
+ running_machine &machine = device->machine();
+ m63_state *state = machine.driver_data<m63_state>();
+ int i, len = machine.region("samples")->bytes();
+ UINT8 *ROM = machine.region("samples")->base();
state->samplebuf = auto_alloc_array(machine, INT16, len);
state->save_pointer(NAME(state->samplebuf), len);
@@ -694,18 +694,18 @@ static const samples_interface fghtbskt_samples_interface =
static INTERRUPT_GEN( snd_irq )
{
- m63_state *state = device->machine->driver_data<m63_state>();
+ m63_state *state = device->machine().driver_data<m63_state>();
state->sound_irq = 1;
}
static MACHINE_START( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
- state->soundcpu = machine->device("soundcpu");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
- state->samples = machine->device("samples");
+ state->soundcpu = machine.device("soundcpu");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->pal_bank));
state->save_item(NAME(state->fg_flag));
@@ -720,7 +720,7 @@ static MACHINE_START( m63 )
static MACHINE_RESET( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->pal_bank = 0;
state->fg_flag = 0;
@@ -992,13 +992,13 @@ ROM_END
static DRIVER_INIT( wilytowr )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->sy_offset = 238;
}
static DRIVER_INIT( fghtbskt )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->sy_offset = 240;
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 2f754c7c28b..f7e7758854a 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -105,8 +105,8 @@ static TIMER_CALLBACK( kengo_scanline_interrupt );
static MACHINE_START( m72 )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m72_scanline_interrupt));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m72_scanline_interrupt));
state->save_item(NAME(state->mcu_sample_addr));
state->save_item(NAME(state->mcu_snd_cmd_latch));
@@ -114,8 +114,8 @@ static MACHINE_START( m72 )
static MACHINE_START( kengo )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(kengo_scanline_interrupt));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(kengo_scanline_interrupt));
state->save_item(NAME(state->mcu_sample_addr));
state->save_item(NAME(state->mcu_snd_cmd_latch));
@@ -123,68 +123,68 @@ static MACHINE_START( kengo )
static TIMER_CALLBACK( synch_callback )
{
- //machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000));
- machine->scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25));
+ //machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000));
+ machine.scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25));
}
static MACHINE_RESET( m72 )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->irq_base = 0x20;
state->mcu_sample_addr = 0;
state->mcu_snd_cmd_latch = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
- machine->scheduler().synchronize(FUNC(synch_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
+ machine.scheduler().synchronize(FUNC(synch_callback));
}
static MACHINE_RESET( xmultipl )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->irq_base = 0x08;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
static MACHINE_RESET( kengo )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
static TIMER_CALLBACK( m72_scanline_interrupt )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
int scanline = param;
/* raster interrupt - visible area only? */
if (scanline < 256 && scanline == state->raster_irq_position - 128)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, state->irq_base + 2);
}
/* VBLANK interrupt */
else if (scanline == 256)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, state->irq_base + 0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static TIMER_CALLBACK( kengo_scanline_interrupt )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
int scanline = param;
/* raster interrupt - visible area only? */
if (scanline < 256 && scanline == state->raster_irq_position - 128)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP2, ASSERT_LINE);
}
else
@@ -193,16 +193,16 @@ static TIMER_CALLBACK( kengo_scanline_interrupt )
/* VBLANK interrupt */
if (scanline == 256)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP0, ASSERT_LINE);
}
else
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP0, CLEAR_LINE);
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
/***************************************************************************
@@ -232,20 +232,20 @@ static TIMER_CALLBACK( delayed_ram16_w )
static WRITE16_HANDLER( m72_main_mcu_sound_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (data & 0xfff0)
logerror("sound_w: %04x %04x\n", mem_mask, data);
if (ACCESSING_BITS_0_7)
{
state->mcu_snd_cmd_latch = data;
- cputag_set_input_line(space->machine, "mcu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 1, ASSERT_LINE);
}
}
static WRITE16_HANDLER( m72_main_mcu_w)
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT16 val = state->protection_ram[offset];
COMBINE_DATA(&val);
@@ -257,33 +257,33 @@ static WRITE16_HANDLER( m72_main_mcu_w)
if (offset == 0x0fff/2 && ACCESSING_BITS_8_15)
{
state->protection_ram[offset] = val;
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
/* Line driven, most likely by write line */
- //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear));
- //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
+ //space->machine().scheduler().timer_set(space->machine().device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear));
+ //space->machine().scheduler().timer_set(space->machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
}
else
- space->machine->scheduler().synchronize( FUNC(delayed_ram16_w), (offset<<16) | val, state->protection_ram);
+ space->machine().scheduler().synchronize( FUNC(delayed_ram16_w), (offset<<16) | val, state->protection_ram);
}
static WRITE8_HANDLER( m72_mcu_data_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT16 val;
if (offset&1) val = (state->protection_ram[offset/2] & 0x00ff) | (data << 8);
else val = (state->protection_ram[offset/2] & 0xff00) | (data&0xff);
- space->machine->scheduler().synchronize( FUNC(delayed_ram16_w), ((offset >>1 ) << 16) | val, state->protection_ram);
+ space->machine().scheduler().synchronize( FUNC(delayed_ram16_w), ((offset >>1 ) << 16) | val, state->protection_ram);
}
static READ8_HANDLER(m72_mcu_data_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT8 ret;
if (offset == 0x0fff || offset == 0x0ffe)
{
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
}
if (offset&1) ret = (state->protection_ram[offset/2] & 0xff00)>>8;
@@ -294,30 +294,30 @@ static READ8_HANDLER(m72_mcu_data_r )
static INTERRUPT_GEN( m72_mcu_int )
{
- m72_state *state = device->machine->driver_data<m72_state>();
+ m72_state *state = device->machine().driver_data<m72_state>();
//state->mcu_snd_cmd_latch |= 0x11; /* 0x10 is special as well - FIXME */
- state->mcu_snd_cmd_latch = 0x11;// | (machine->rand() & 1); /* 0x10 is special as well - FIXME */
+ state->mcu_snd_cmd_latch = 0x11;// | (machine.rand() & 1); /* 0x10 is special as well - FIXME */
device_set_input_line(device, 1, ASSERT_LINE);
}
static READ8_HANDLER(m72_mcu_sample_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT8 sample;
- sample = space->machine->region("samples")->base()[state->mcu_sample_addr++];
+ sample = space->machine().region("samples")->base()[state->mcu_sample_addr++];
return sample;
}
static WRITE8_HANDLER(m72_mcu_ack_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
- cputag_set_input_line(space->machine, "mcu", 1, CLEAR_LINE);
+ m72_state *state = space->machine().driver_data<m72_state>();
+ cputag_set_input_line(space->machine(), "mcu", 1, CLEAR_LINE);
state->mcu_snd_cmd_latch = 0;
}
static READ8_HANDLER(m72_mcu_snd_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->mcu_snd_cmd_latch;
}
@@ -329,11 +329,11 @@ static READ8_HANDLER(m72_mcu_port_r )
static WRITE8_HANDLER(m72_mcu_port_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (offset == 1)
{
state->mcu_sample_latch = data;
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
else
logerror("port: %02x %02x\n", offset, data);
@@ -342,14 +342,14 @@ static WRITE8_HANDLER(m72_mcu_port_w )
static WRITE8_HANDLER( m72_mcu_low_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
state->mcu_sample_addr = (state->mcu_sample_addr & 0xffe000) | (data<<5);
logerror("low: %02x %02x %08x\n", offset, data, state->mcu_sample_addr);
}
static WRITE8_HANDLER( m72_mcu_high_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
state->mcu_sample_addr = (state->mcu_sample_addr & 0x1fff) | (data<<(8+5));
logerror("high: %02x %02x %08x\n", offset, data, state->mcu_sample_addr);
}
@@ -362,17 +362,17 @@ static WRITE8_DEVICE_HANDLER( m72_snd_cpu_sample_w )
static READ8_HANDLER( m72_snd_cpu_sample_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->mcu_sample_latch;
}
INLINE DRIVER_INIT( m72_8751 )
{
- m72_state *state = machine->driver_data<m72_state>();
- address_space *program = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
- address_space *sndio = machine->device("soundcpu")->memory().space(AS_IO);
- device_t *dac = machine->device("dac");
+ m72_state *state = machine.driver_data<m72_state>();
+ address_space *program = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
+ address_space *sndio = machine.device("soundcpu")->memory().space(AS_IO);
+ device_t *dac = machine.device("dac");
state->protection_ram = auto_alloc_array(machine, UINT16, 0x10000/2);
program->install_read_bank(0xb0000, 0xbffff, "bank1");
@@ -394,7 +394,7 @@ INLINE DRIVER_INIT( m72_8751 )
* prefetching on the V30.
*/
{
- UINT8 *rom=machine->region("mcu")->base();
+ UINT8 *rom=machine.region("mcu")->base();
rom[0x12d+5] += 1; printf(" 5: %d\n", rom[0x12d+5]);
rom[0x12d+8] += 5; printf(" 8: %d\n", rom[0x12d+8]);
@@ -434,8 +434,8 @@ the NMI handler in the other games.
#if 0
static int find_sample(int num)
{
- UINT8 *rom = machine->region("samples")->base();
- int len = machine->region("samples")->bytes();
+ UINT8 *rom = machine.region("samples")->base();
+ int len = machine.region("samples")->bytes();
int addr = 0;
while (num--)
@@ -456,7 +456,7 @@ static INTERRUPT_GEN(fake_nmi)
address_space *space = device->memory().space(AS_PROGRAM);
int sample = m72_sample_r(space,0);
if (sample)
- m72_sample_w(device->machine->device("dac"),0,sample);
+ m72_sample_w(device->machine().device("dac"),0,sample);
}
@@ -727,7 +727,7 @@ static void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes)
static READ16_HANDLER( protection_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_8_15)
copy_le(state->protection_ram,state->protection_code,CODE_LEN);
return state->protection_ram[0xffa/2+offset];
@@ -735,7 +735,7 @@ static READ16_HANDLER( protection_r )
static WRITE16_HANDLER( protection_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
data ^= 0xffff;
COMBINE_DATA(&state->protection_ram[offset]);
data ^= 0xffff;
@@ -744,15 +744,15 @@ static WRITE16_HANDLER( protection_w )
copy_le(&state->protection_ram[0x0fe0],state->protection_crc,CRC_LEN);
}
-static void install_protection_handler(running_machine *machine, const UINT8 *code,const UINT8 *crc)
+static void install_protection_handler(running_machine &machine, const UINT8 *code,const UINT8 *crc)
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->protection_ram = auto_alloc_array(machine, UINT16, 0x1000/2);
state->protection_code = code;
state->protection_crc = crc;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb0000, 0xb0fff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0ffa, 0xb0ffb, FUNC(protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb0000, 0xb0fff, FUNC(protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb0000, 0xb0fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0ffa, 0xb0ffb, FUNC(protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb0000, 0xb0fff, FUNC(protection_w));
memory_set_bankptr(machine, "bank1", state->protection_ram);
}
@@ -760,36 +760,36 @@ static DRIVER_INIT( bchopper )
{
install_protection_handler(machine, bchopper_code,bchopper_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
}
static DRIVER_INIT( mrheli )
{
install_protection_handler(machine, bchopper_code,mrheli_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
}
static DRIVER_INIT( nspirit )
{
install_protection_handler(machine, nspirit_code,nspirit_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(nspirit_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(nspirit_sample_trigger_w));
}
static DRIVER_INIT( imgfight )
{
install_protection_handler(machine, imgfight_code,imgfight_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(imgfight_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(imgfight_sample_trigger_w));
}
static DRIVER_INIT( loht )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
install_protection_handler(machine, loht_code,loht_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w));
/* since we skip the startup tests, clear video RAM to prevent garbage on title screen */
memset(state->videoram2,0,0x4000);
@@ -799,33 +799,33 @@ static DRIVER_INIT( xmultiplm72 )
{
install_protection_handler(machine, xmultiplm72_code,xmultiplm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(xmultiplm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(xmultiplm72_sample_trigger_w));
}
static DRIVER_INIT( dbreedm72 )
{
install_protection_handler(machine, dbreedm72_code,dbreedm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dbreedm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dbreedm72_sample_trigger_w));
}
static DRIVER_INIT( airduel )
{
install_protection_handler(machine, airduel_code,airduel_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(airduel_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(airduel_sample_trigger_w));
}
static DRIVER_INIT( dkgenm72 )
{
install_protection_handler(machine, dkgenm72_code,dkgenm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dkgenm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dkgenm72_sample_trigger_w));
}
static DRIVER_INIT( gallop )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(gallop_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(gallop_sample_trigger_w));
}
@@ -835,13 +835,13 @@ static DRIVER_INIT( gallop )
static READ16_HANDLER( soundram_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->soundram[offset * 2 + 0] | (state->soundram[offset * 2 + 1] << 8);
}
static WRITE16_HANDLER( soundram_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_0_7)
state->soundram[offset * 2 + 0] = data;
if (ACCESSING_BITS_8_15)
@@ -851,7 +851,7 @@ static WRITE16_HANDLER( soundram_w )
static READ16_HANDLER( poundfor_trackball_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
if (offset == 0)
@@ -860,7 +860,7 @@ static READ16_HANDLER( poundfor_trackball_r )
for (i = 0;i < 4;i++)
{
- curr = input_port_read(space->machine, axisnames[i]);
+ curr = input_port_read(space->machine(), axisnames[i]);
state->diff[i] = (curr - state->prev[i]);
state->prev[i] = curr;
}
@@ -872,7 +872,7 @@ static READ16_HANDLER( poundfor_trackball_r )
case 0:
return (state->diff[0] & 0xff) | ((state->diff[2] & 0xff) << 8);
case 1:
- return ((state->diff[0] >> 8) & 0x1f) | (state->diff[2] & 0x1f00) | (input_port_read(space->machine, "IN0") & 0xe0e0);
+ return ((state->diff[0] >> 8) & 0x1f) | (state->diff[2] & 0x1f00) | (input_port_read(space->machine(), "IN0") & 0xe0e0);
case 2:
return (state->diff[1] & 0xff) | ((state->diff[3] & 0xff) << 8);
case 3:
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index 2016c32f598..1ab2d2c79ba 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -76,13 +76,13 @@ public:
static WRITE8_HANDLER( ramtek_videoram_w )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
state->videoram[offset] = data & ~*state->mask;
}
static SCREEN_UPDATE( ramtek )
{
- m79amb_state *state = screen->machine->driver_data<m79amb_state>();
+ m79amb_state *state = screen->machine().driver_data<m79amb_state>();
offs_t offs;
for (offs = 0; offs < 0x2000; offs++)
@@ -109,18 +109,18 @@ static SCREEN_UPDATE( ramtek )
static READ8_HANDLER( gray5bit_controller0_r )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
- UINT8 port_data = input_port_read(space->machine, "8004");
- UINT8 gun_pos = input_port_read(space->machine, "GUN1");
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
+ UINT8 port_data = input_port_read(space->machine(), "8004");
+ UINT8 gun_pos = input_port_read(space->machine(), "GUN1");
return (port_data & 0xe0) | state->lut_gun1[gun_pos];
}
static READ8_HANDLER( gray5bit_controller1_r )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
- UINT8 port_data = input_port_read(space->machine, "8005");
- UINT8 gun_pos = input_port_read(space->machine, "GUN2");
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
+ UINT8 port_data = input_port_read(space->machine(), "8005");
+ UINT8 gun_pos = input_port_read(space->machine(), "GUN2");
return (port_data & 0xe0) | state->lut_gun2[gun_pos];
}
@@ -287,8 +287,8 @@ static const UINT8 lut_pos[0x20] = {
static DRIVER_INIT( m79amb )
{
- m79amb_state *state = machine->driver_data<m79amb_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ m79amb_state *state = machine.driver_data<m79amb_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i, j;
/* PROM data is active low */
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 4994adc086d..f243d22b319 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -38,10 +38,10 @@ Notes:
/***************************************************************************/
-static void set_m90_bank(running_machine *machine)
+static void set_m90_bank(running_machine &machine)
{
- m90_state *state = machine->driver_data<m90_state>();
- UINT8 *rom = machine->region("user1")->base();
+ m90_state *state = machine.driver_data<m90_state>();
+ UINT8 *rom = machine.region("user1")->base();
if (!rom)
popmessage("bankswitch with no banked ROM!");
@@ -55,8 +55,8 @@ static WRITE16_HANDLER( m90_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
if (data&0xfe) logerror("Coin counter %02x\n",data);
}
@@ -64,11 +64,11 @@ static WRITE16_HANDLER( m90_coincounter_w )
static WRITE16_HANDLER( quizf1_bankswitch_w )
{
- m90_state *state = space->machine->driver_data<m90_state>();
+ m90_state *state = space->machine().driver_data<m90_state>();
if (ACCESSING_BITS_0_7)
{
state->bankaddress = 0x10000 * (data & 0x0f);
- set_m90_bank(space->machine);
+ set_m90_bank(space->machine());
}
}
@@ -1145,19 +1145,19 @@ static STATE_POSTLOAD( quizf1_postload )
static DRIVER_INIT( quizf1 )
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
state->bankaddress = 0;
set_m90_bank(machine);
state_save_register_global(machine, state->bankaddress);
- machine->state().register_postload(quizf1_postload, NULL);
+ machine.state().register_postload(quizf1_postload, NULL);
}
static DRIVER_INIT( bomblord )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
for (i=0; i<0x100000; i+=8)
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index 3e90c90fccc..31621e351eb 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -215,10 +215,10 @@ static TIMER_CALLBACK( m92_scanline_interrupt );
/*****************************************************************************/
-static void set_m92_bank(running_machine *machine)
+static void set_m92_bank(running_machine &machine)
{
- m92_state *state = machine->driver_data<m92_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m92_state *state = machine.driver_data<m92_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1",&RAM[state->bankaddress]);
}
@@ -229,60 +229,60 @@ static STATE_POSTLOAD( m92_postload )
static MACHINE_START( m92 )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
state->save_item(NAME(state->irqvector));
state->save_item(NAME(state->sound_status));
state->save_item(NAME(state->bankaddress));
- machine->state().register_postload(m92_postload, NULL);
+ machine.state().register_postload(m92_postload, NULL);
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m92_scanline_interrupt));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m92_scanline_interrupt));
}
static MACHINE_RESET( m92 )
{
- m92_state *state = machine->driver_data<m92_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m92_state *state = machine.driver_data<m92_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
/*****************************************************************************/
static TIMER_CALLBACK( m92_scanline_interrupt )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
int scanline = param;
/* raster interrupt */
if (scanline == state->raster_irq_position)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine->primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
/*****************************************************************************/
static READ16_HANDLER( m92_eeprom_r )
{
- UINT8 *RAM = space->machine->region("user1")->base();
+ UINT8 *RAM = space->machine().region("user1")->base();
// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(space->cpu),offset);
return RAM[offset] | 0xff00;
}
static WRITE16_HANDLER( m92_eeprom_w )
{
- UINT8 *RAM = space->machine->region("user1")->base();
+ UINT8 *RAM = space->machine().region("user1")->base();
// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(space->cpu),offset);
if (ACCESSING_BITS_0_7)
RAM[offset] = data;
@@ -292,8 +292,8 @@ static WRITE16_HANDLER( m92_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* Bit 0x8 is Motor(?!), used in Hook, In The Hunt, UCops */
/* Bit 0x8 is Memcard related in RTypeLeo */
/* Bit 0x40 set in Blade Master test mode input check */
@@ -302,17 +302,17 @@ static WRITE16_HANDLER( m92_coincounter_w )
static WRITE16_HANDLER( m92_bankswitch_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
if (ACCESSING_BITS_0_7)
{
state->bankaddress = 0x100000 + ((data & 0x7) * 0x10000);
- set_m92_bank(space->machine);
+ set_m92_bank(space->machine());
}
}
static CUSTOM_INPUT( m92_sprite_busy_r )
{
- m92_state *state = field->port->machine->driver_data<m92_state>();
+ m92_state *state = field->port->machine().driver_data<m92_state>();
return state->sprite_buffer_busy;
}
@@ -322,8 +322,8 @@ enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR };
static TIMER_CALLBACK( setvector_callback )
{
- m92_state *state = machine->driver_data<m92_state>();
- if (!machine->device("soundcpu"))
+ m92_state *state = machine.driver_data<m92_state>();
+ if (!machine.device("soundcpu"))
return;
switch(param)
@@ -336,9 +336,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (state->irqvector & 0x2) /* YM2151 has precedence */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x18);
else if (state->irqvector & 0x1) /* V30 */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x19);
if (state->irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
@@ -348,13 +348,13 @@ static TIMER_CALLBACK( setvector_callback )
static WRITE16_HANDLER( m92_soundlatch_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
soundlatch_w(space, 0, data & 0xff);
}
static READ16_HANDLER( m92_sound_status_r )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
//logerror("%06x: read sound status\n",cpu_get_pc(space->cpu));
return state->sound_status;
}
@@ -366,20 +366,20 @@ static READ16_HANDLER( m92_soundlatch_r )
static WRITE16_HANDLER( m92_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
}
static WRITE16_HANDLER( m92_sound_status_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->sound_status);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, HOLD_LINE, M92_IRQ_3);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, HOLD_LINE, M92_IRQ_3);
}
static WRITE16_HANDLER( m92_sound_reset_w )
{
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
}
/*****************************************************************************/
@@ -911,9 +911,9 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
if (state)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
static const ym2151_interface ym2151_config =
@@ -923,9 +923,9 @@ static const ym2151_interface ym2151_config =
/***************************************************************************/
-void m92_sprite_interrupt(running_machine *machine)
+void m92_sprite_interrupt(running_machine &machine)
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_1);
}
@@ -2082,10 +2082,10 @@ ROM_START( geostorm )
ROM_END
-static void init_m92(running_machine *machine, int hasbanks)
+static void init_m92(running_machine &machine, int hasbanks)
{
- m92_state *state = machine->driver_data<m92_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m92_state *state = machine.driver_data<m92_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
if (hasbanks)
{
@@ -2098,7 +2098,7 @@ static void init_m92(running_machine *machine, int hasbanks)
memory_set_bankptr(machine, "bank2", &RAM[0xc0000]);
}
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
if (RAM)
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
@@ -2137,25 +2137,25 @@ static DRIVER_INIT( uccops )
static DRIVER_INIT( rtypeleo )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
}
static DRIVER_INIT( rtypelej )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
}
static DRIVER_INIT( majtitl2 )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
/* This game has an eprom on the game board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0000, 0xf3fff, FUNC(m92_eeprom_r), FUNC(m92_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0000, 0xf3fff, FUNC(m92_eeprom_r), FUNC(m92_eeprom_w));
state->game_kludge = 2;
}
@@ -2173,17 +2173,17 @@ static DRIVER_INIT( inthunt )
static DRIVER_INIT( lethalth )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 0);
state->irq_vectorbase = 0x20;
/* NOP out the bankswitcher */
- machine->device("maincpu")->memory().space(AS_IO)->nop_write(0x20, 0x21);
+ machine.device("maincpu")->memory().space(AS_IO)->nop_write(0x20, 0x21);
}
static DRIVER_INIT( nbbatman )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
init_m92(machine, 1);
@@ -2192,7 +2192,7 @@ static DRIVER_INIT( nbbatman )
static DRIVER_INIT( ssoldier )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
/* main CPU expects an answer even before writing the first command */
@@ -2201,7 +2201,7 @@ static DRIVER_INIT( ssoldier )
static DRIVER_INIT( psoldier )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
/* main CPU expects an answer even before writing the first command */
@@ -2215,7 +2215,7 @@ static DRIVER_INIT( dsoccr94j )
static DRIVER_INIT( gunforc2 )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
init_m92(machine, 1);
memcpy(RAM + 0x80000, RAM + 0x100000, 0x20000);
}
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index 6ffbba97687..7d6e31e6765 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -306,7 +306,7 @@ Notes:
static WRITE32_HANDLER( paletteram32_macrossp_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
int r,g,b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -314,13 +314,13 @@ static WRITE32_HANDLER( paletteram32_macrossp_w )
g = ((state->paletteram[offset] & 0x00ff0000) >>16);
r = ((state->paletteram[offset] & 0xff000000) >>24);
- palette_set_color(space->machine, offset, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r,g,b));
}
static READ32_HANDLER ( macrossp_soundstatus_r )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
// logerror("%08x read soundstatus\n", cpu_get_pc(space->cpu));
@@ -334,7 +334,7 @@ static READ32_HANDLER ( macrossp_soundstatus_r )
static WRITE32_HANDLER( macrossp_soundcmd_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
if (ACCESSING_BITS_16_31)
{
@@ -349,16 +349,16 @@ static WRITE32_HANDLER( macrossp_soundcmd_w )
static READ16_HANDLER( macrossp_soundcmd_r )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
// logerror("%06x read soundcmd\n",cpu_get_pc(space->cpu));
state->sndpending = 0;
return soundlatch_word_r(space, offset, mem_mask);
}
-static void update_colors( running_machine *machine )
+static void update_colors( running_machine &machine )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
int i, r, g, b;
for (i = 0; i < 0x1000; i++)
@@ -388,7 +388,7 @@ static void update_colors( running_machine *machine )
static WRITE32_HANDLER( macrossp_palette_fade_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
state->fade_effect = ((data & 0xff00) >> 8) - 0x28; //it writes two times, first with a -0x28 then with the proper data
// popmessage("%02x",fade_effect);
@@ -396,7 +396,7 @@ static WRITE32_HANDLER( macrossp_palette_fade_w )
if (state->old_fade != state->fade_effect)
{
state->old_fade = state->fade_effect;
- update_colors(space->machine);
+ update_colors(space->machine());
}
}
@@ -584,7 +584,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- // macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ // macrossp_state *state = space->machine().driver_data<macrossp_state>();
logerror("ES5506 irq %d\n", irq);
/* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506,
@@ -604,10 +604,10 @@ static const es5506_interface es5506_config =
static MACHINE_START( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sndpending));
state->save_item(NAME(state->snd_toggle));
@@ -617,7 +617,7 @@ static MACHINE_START( macrossp )
static MACHINE_RESET( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
state->sndpending = 0;
state->snd_toggle = 0;
@@ -774,7 +774,7 @@ PC :00018104 018104: addq.w #1, $f1015a.l
PC :0001810A 01810A: cmp.w $f10140.l, D0
PC :00018110 018110: beq 18104
*/
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->mainram[0x10158 / 4]);
if (cpu_get_pc(space->cpu) == 0x001810A) device_spin_until_interrupt(space->cpu);
@@ -783,7 +783,7 @@ PC :00018110 018110: beq 18104
#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( quizmoon_speedup_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->mainram[0x00020 / 4]);
if (cpu_get_pc(space->cpu) == 0x1cc) device_spin_until_interrupt(space->cpu);
@@ -792,13 +792,13 @@ static WRITE32_HANDLER( quizmoon_speedup_w )
static DRIVER_INIT( macrossp )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf10158, 0xf1015b, FUNC(macrossp_speedup_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf10158, 0xf1015b, FUNC(macrossp_speedup_w) );
}
static DRIVER_INIT( quizmoon )
{
#ifdef UNUSED_FUNCTION
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00020, 0xf00023, FUNC(quizmoon_speedup_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00020, 0xf00023, FUNC(quizmoon_speedup_w) );
#endif
}
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 57fd99b7762..cb27032bc52 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -93,13 +93,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(rambank_w)
{
- macs_state *state = space->machine->driver_data<macs_state>();
- memory_set_bankptr(space->machine, "bank3", &state->ram1[0x10000+(data&1)*0x800] );
+ macs_state *state = space->machine().driver_data<macs_state>();
+ memory_set_bankptr(space->machine(), "bank3", &state->ram1[0x10000+(data&1)*0x800] );
}
static READ8_HANDLER( macs_input_r )
{
- macs_state *state = space->machine->driver_data<macs_state>();
+ macs_state *state = space->machine().driver_data<macs_state>();
switch(offset)
{
case 0:
@@ -107,23 +107,23 @@ static READ8_HANDLER( macs_input_r )
/*It's bit-wise*/
switch(state->mux_data&0x0f)
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
- case 0x02: return input_port_read(space->machine, "IN2");
- case 0x04: return input_port_read(space->machine, "IN3");
- case 0x08: return input_port_read(space->machine, "IN4");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
+ case 0x02: return input_port_read(space->machine(), "IN2");
+ case 0x04: return input_port_read(space->machine(), "IN3");
+ case 0x08: return input_port_read(space->machine(), "IN4");
default:
logerror("Unmapped mahjong panel mux data %02x\n",state->mux_data);
return 0xff;
}
}
- case 1: return input_port_read(space->machine, "SYS0");
- case 2: return input_port_read(space->machine, "DSW0");
- case 3: return input_port_read(space->machine, "DSW1");
- case 4: return input_port_read(space->machine, "DSW2");
- case 5: return input_port_read(space->machine, "DSW3");
- case 6: return input_port_read(space->machine, "DSW4");
- case 7: return input_port_read(space->machine, "SYS1");
+ case 1: return input_port_read(space->machine(), "SYS0");
+ case 2: return input_port_read(space->machine(), "DSW0");
+ case 3: return input_port_read(space->machine(), "DSW1");
+ case 4: return input_port_read(space->machine(), "DSW2");
+ case 5: return input_port_read(space->machine(), "DSW3");
+ case 6: return input_port_read(space->machine(), "DSW4");
+ case 7: return input_port_read(space->machine(), "SYS1");
default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(space->cpu),offset+0xc0);
}
@@ -133,15 +133,15 @@ static READ8_HANDLER( macs_input_r )
static WRITE8_HANDLER( macs_rom_bank_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
st0016_rom_bank=data;
}
static WRITE8_HANDLER( macs_output_w )
{
- macs_state *state = space->machine->driver_data<macs_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ macs_state *state = space->machine().driver_data<macs_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
switch(offset)
{
@@ -156,14 +156,14 @@ static WRITE8_HANDLER( macs_output_w )
{
/* FIXME: dunno if this RAM bank is right, DASM tracking made on the POST screens indicates that there's just one RAM bank,
but then MACS2 games locks up. */
- memory_set_bankptr(space->machine, "bank3", &state->ram1[((data&0x20)>>5)*0x1000+0x000] );
+ memory_set_bankptr(space->machine(), "bank3", &state->ram1[((data&0x20)>>5)*0x1000+0x000] );
macs_cart_slot = (data & 0xc) >> 2;
- memory_set_bankptr(space->machine, "bank4", &ROM[macs_cart_slot*0x400000+0x10000] );
+ memory_set_bankptr(space->machine(), "bank4", &ROM[macs_cart_slot*0x400000+0x10000] );
}
- memory_set_bankptr(space->machine, "bank2", &state->ram1[((data&0x20)>>5)*0x1000+0x800] );
+ memory_set_bankptr(space->machine(), "bank2", &state->ram1[((data&0x20)>>5)*0x1000+0x800] );
break;
case 2: state->mux_data = data; break;
@@ -643,7 +643,7 @@ static const UINT8 ramdata[160]=
static MACHINE_RESET(macs)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
UINT8 *macs_ram1 = state->ram1;
#if 0
UINT8 *macs_ram2 = state->ram2;
@@ -675,11 +675,11 @@ static MACHINE_RESET(macs)
730E: ED B0 ldir
...
*/
- memcpy(macs_ram1 + 0x0e9f, machine->region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x1e9f, machine->region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x0e9f, machine.region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x1e9f, machine.region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x0800, machine->region("user1")->base()+0x73fa, 0x507);
- memcpy(macs_ram1 + 0x1800, machine->region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x0800, machine.region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x1800, machine.region("user1")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
macs_ram2[(n) - 0xe800 + 1]=(m)&0xff;\
@@ -715,15 +715,15 @@ static MACHINE_RESET(macs)
macs_ram1[0x1ff9]=0x07;
#endif
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000 );
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000 );
memory_set_bankptr(machine, "bank2", macs_ram1+0x800);
memory_set_bankptr(machine, "bank3", macs_ram1+0x10000);
- memory_set_bankptr(machine, "bank4", machine->region("maincpu")->base() );
+ memory_set_bankptr(machine, "bank4", machine.region("maincpu")->base() );
}
static DRIVER_INIT(macs)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x80;
state->rev = 1;
@@ -731,7 +731,7 @@ static DRIVER_INIT(macs)
static DRIVER_INIT(macs2)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x80;
state->rev = 2;
@@ -739,7 +739,7 @@ static DRIVER_INIT(macs2)
static DRIVER_INIT(kisekaeh)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=11|0x180;
state->rev = 1;
@@ -747,7 +747,7 @@ static DRIVER_INIT(kisekaeh)
static DRIVER_INIT(kisekaem)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x180;
state->rev = 1;
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index d457098d6ad..a0835b7a3be 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -19,30 +19,30 @@
static INPUT_CHANGED( coin_inserted )
{
/* coin insertion causes an NMI */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
-INLINE UINT8 shift_common(running_machine *machine, UINT8 hi, UINT8 lo)
+INLINE UINT8 shift_common(running_machine &machine, UINT8 hi, UINT8 lo)
{
- const UINT8 *table = machine->region("user2")->base();
+ const UINT8 *table = machine.region("user2")->base();
return table[((hi & 0x07) << 8) | lo];
}
static READ8_HANDLER( shift_r )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
- return shift_common(space->machine, *state->shift_hi, *state->shift_lo);
+ madalien_state *state = space->machine().driver_data<madalien_state>();
+ return shift_common(space->machine(), *state->shift_hi, *state->shift_lo);
}
static READ8_HANDLER( shift_rev_r )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
+ madalien_state *state = space->machine().driver_data<madalien_state>();
UINT8 hi = *state->shift_hi ^ 0x07;
UINT8 lo = BITSWAP8(*state->shift_lo,0,1,2,3,4,5,6,7);
- UINT8 ret = shift_common(space->machine, hi, lo);
+ UINT8 ret = shift_common(space->machine(), hi, lo);
return BITSWAP8(ret,7,0,1,2,3,4,5,6) & 0x7f;
}
@@ -56,14 +56,14 @@ static WRITE8_HANDLER( madalien_output_w )
static WRITE8_HANDLER( madalien_sound_command_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
soundlatch_w(space, offset, data);
}
static READ8_HANDLER(madalien_sound_command_r )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 8a2266b7c14..91194374072 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -26,7 +26,7 @@
static WRITE16_HANDLER( madmotor_sound_w )
{
- madmotor_state *state = space->machine->driver_data<madmotor_state>();
+ madmotor_state *state = space->machine().driver_data<madmotor_state>();
if (ACCESSING_BITS_0_7)
{
@@ -222,7 +222,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- madmotor_state *driver_state = device->machine->driver_data<madmotor_state>();
+ madmotor_state *driver_state = device->machine().driver_data<madmotor_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -233,17 +233,17 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( madmotor )
{
- madmotor_state *state = machine->driver_data<madmotor_state>();
+ madmotor_state *state = machine.driver_data<madmotor_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
}
static MACHINE_RESET( madmotor )
{
- madmotor_state *state = machine->driver_data<madmotor_state>();
+ madmotor_state *state = machine.driver_data<madmotor_state>();
state->flipscreen = 0;
}
@@ -353,7 +353,7 @@ ROM_END
static DRIVER_INIT( madmotor )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for (i = 0x00000;i < 0x80000;i++)
diff --git a/src/mame/drivers/magic10.c b/src/mame/drivers/magic10.c
index 1e91eed5beb..550b825e2b8 100644
--- a/src/mame/drivers/magic10.c
+++ b/src/mame/drivers/magic10.c
@@ -109,35 +109,35 @@ public:
static WRITE16_HANDLER( layer0_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer0_videoram[offset]);
tilemap_mark_tile_dirty( state->layer0_tilemap, offset >> 1);
}
static WRITE16_HANDLER( layer1_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer1_videoram[offset]);
tilemap_mark_tile_dirty( state->layer1_tilemap, offset >> 1);
}
static WRITE16_HANDLER( layer2_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer2_videoram[offset]);
tilemap_mark_tile_dirty( state->layer2_tilemap, offset >> 1);
}
static WRITE16_HANDLER( paletteram_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- palette_set_color_rgb( space->machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ palette_set_color_rgb( space->machine(), offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
}
static TILE_GET_INFO( get_layer0_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
1,
@@ -149,7 +149,7 @@ static TILE_GET_INFO( get_layer0_tile_info )
static TILE_GET_INFO( get_layer1_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
1,
@@ -161,7 +161,7 @@ static TILE_GET_INFO( get_layer1_tile_info )
static TILE_GET_INFO( get_layer2_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
0,
@@ -174,7 +174,7 @@ static TILE_GET_INFO( get_layer2_tile_info )
static VIDEO_START( magic10 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer0_tilemap = tilemap_create(machine, get_layer0_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->layer1_tilemap = tilemap_create(machine, get_layer1_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->layer2_tilemap = tilemap_create(machine, get_layer2_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -185,7 +185,7 @@ static VIDEO_START( magic10 )
static SCREEN_UPDATE( magic10 )
{
- magic10_state *state = screen->machine->driver_data<magic10_state>();
+ magic10_state *state = screen->machine().driver_data<magic10_state>();
/*TODO: understand where this comes from. */
tilemap_set_scrollx(state->layer2_tilemap, 0, state->layer2_offset[0]);
tilemap_set_scrolly(state->layer2_tilemap, 0, state->layer2_offset[1]);
@@ -211,7 +211,7 @@ static SCREEN_UPDATE( magic10 )
static READ16_HANDLER( magic102_r )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
state->magic102_ret ^= 0x20;
return state->magic102_ret;
}
@@ -275,7 +275,7 @@ static WRITE16_HANDLER( magic10_out_w )
output_set_lamp_value(7, (data >> 6) & 1); /* Lamp 7 - PLAY (BET/TAKE/CANCEL) */
output_set_lamp_value(8, (data >> 8) & 1); /* Lamp 8 - PAYOUT/SUPERGAME */
- coin_counter_w(space->machine, 0, data & 0x400);
+ coin_counter_w(space->machine(), 0, data & 0x400);
}
/***************************
@@ -1204,28 +1204,28 @@ ROM_END
static DRIVER_INIT( magic10 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 32;
state->layer2_offset[1] = 2;
}
static DRIVER_INIT( magic102 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 8;
state->layer2_offset[1] = 20;
}
static DRIVER_INIT( suprpool )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 8;
state->layer2_offset[1] = 16;
}
static DRIVER_INIT( hotslot )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
/* a value of -56 center the playfield, but displace the intro and initial screen.
a value of -64 center the intro and initial screen, but displace the playfield.
*/
@@ -1235,7 +1235,7 @@ static DRIVER_INIT( hotslot )
static DRIVER_INIT( sgsafari )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 16;
state->layer2_offset[1] = 20;
}
diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c
index 9f5888364c8..908d4c8c83f 100644
--- a/src/mame/drivers/magicard.c
+++ b/src/mame/drivers/magicard.c
@@ -380,11 +380,11 @@ static VIDEO_START(magicard)
static SCREEN_UPDATE(magicard)
{
- magicard_state *state = screen->machine->driver_data<magicard_state>();
+ magicard_state *state = screen->machine().driver_data<magicard_state>();
int x,y;
UINT32 count;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); //TODO
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); //TODO
if(!(SCC_DE_VREG)) //display enable
return 0;
@@ -402,22 +402,22 @@ static SCREEN_UPDATE(magicard)
color = ((state->magicram[count]) & 0x000f)>>0;
if(((x*4)+3)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+3) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+3) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0x00f0)>>4;
if(((x*4)+2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+2) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+2) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0x0f00)>>8;
if(((x*4)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+1) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0xf000)>>12;
if(((x*4)+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+0) = screen->machine().pens[color];
count++;
}
@@ -434,12 +434,12 @@ static SCREEN_UPDATE(magicard)
color = ((state->magicram[count]) & 0x00ff)>>0;
if(((x*2)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0xff00)>>8;
if(((x*2)+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color];
count++;
}
@@ -456,12 +456,12 @@ static SCREEN_UPDATE(magicard)
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER( paletteram_io_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
switch(offset*2)
{
case 0:
@@ -483,7 +483,7 @@ static WRITE16_HANDLER( paletteram_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -495,11 +495,11 @@ static WRITE16_HANDLER( paletteram_io_w )
static READ16_HANDLER( philips_66470_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
switch(offset)
{
// case 0/2:
-// return space->machine->rand(); //TODO
+// return space->machine().rand(); //TODO
}
//printf("[%04x]\n",offset*2);
@@ -510,7 +510,7 @@ static READ16_HANDLER( philips_66470_r )
static WRITE16_HANDLER( philips_66470_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
COMBINE_DATA(&state->pcab_vregs[offset]);
// if(offset == 0x10/2)
@@ -524,19 +524,19 @@ static WRITE16_HANDLER( philips_66470_w )
static READ16_HANDLER( scc68070_ext_irqc_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_ext_irqc_regs[offset];
}
static WRITE16_HANDLER( scc68070_ext_irqc_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_ext_irqc_regs[offset] = data;
}
static READ16_HANDLER( scc68070_iic_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
//printf("%04x\n",offset*2);
switch(offset)
@@ -549,18 +549,18 @@ static READ16_HANDLER( scc68070_iic_r )
static WRITE16_HANDLER( scc68070_iic_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_iic_regs[offset] = data;
}
static READ16_HANDLER( scc68070_uart_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
//printf("%02x\n",offset*2);
switch(offset)
{
- case 0x02/2: return space->machine->rand(); //uart mode register
+ case 0x02/2: return space->machine().rand(); //uart mode register
}
return state->scc68070_uart_regs[offset];
@@ -568,67 +568,67 @@ static READ16_HANDLER( scc68070_uart_r )
static WRITE16_HANDLER( scc68070_uart_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_uart_regs[offset] = data;
}
static READ16_HANDLER( scc68070_timer_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_timer_regs[offset];
}
static WRITE16_HANDLER( scc68070_timer_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_timer_regs[offset] = data;
}
static READ16_HANDLER( scc68070_int_irqc_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_int_irqc_regs[offset];
}
static WRITE16_HANDLER( scc68070_int_irqc_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_int_irqc_regs[offset] = data;
}
static READ16_HANDLER( scc68070_dma_ch1_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_dma_ch1_regs[offset];
}
static WRITE16_HANDLER( scc68070_dma_ch1_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_dma_ch1_regs[offset] = data;
}
static READ16_HANDLER( scc68070_dma_ch2_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_dma_ch2_regs[offset];
}
static WRITE16_HANDLER( scc68070_dma_ch2_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_dma_ch2_regs[offset] = data;
}
static READ16_HANDLER( scc68070_mmu_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_mmu_regs[offset];
}
static WRITE16_HANDLER( scc68070_mmu_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_mmu_regs[offset] = data;
switch(offset)
@@ -680,11 +680,11 @@ INPUT_PORTS_END
static MACHINE_RESET( magicard )
{
- magicard_state *state = machine->driver_data<magicard_state>();
- UINT16 *src = (UINT16*)machine->region("maincpu" )->base();
+ magicard_state *state = machine.driver_data<magicard_state>();
+ UINT16 *src = (UINT16*)machine.region("maincpu" )->base();
UINT16 *dst = state->magicram;
memcpy (dst, src, 0x80000);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
}
@@ -695,9 +695,9 @@ static MACHINE_RESET( magicard )
/*Probably there's a mask somewhere if it REALLY uses irqs at all...irq vectors dynamically changes after some time.*/
static INTERRUPT_GEN( magicard_irq )
{
- if(input_code_pressed(device->machine, KEYCODE_Z)) //vblank?
+ if(input_code_pressed(device->machine(), KEYCODE_Z)) //vblank?
device_set_input_line_and_vector(device, 1, HOLD_LINE,0xe4/4);
- if(input_code_pressed(device->machine, KEYCODE_X)) //uart irq
+ if(input_code_pressed(device->machine(), KEYCODE_X)) //uart irq
device_set_input_line_and_vector(device, 1, HOLD_LINE,0xf0/4);
}
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index 9752d6f84c8..5184a5fe6ea 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -422,21 +422,21 @@ public:
static WRITE8_HANDLER( magicfly_videoram_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( magicfly_colorram_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_magicfly_tile_info )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
/* - bits -
7654 3210
---- -xxx Tiles color.
@@ -462,13 +462,13 @@ static TILE_GET_INFO( get_magicfly_tile_info )
static VIDEO_START(magicfly)
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
state->bg_tilemap = tilemap_create(machine, get_magicfly_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static TILE_GET_INFO( get_7mezzo_tile_info )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
/* - bits -
7654 3210
---- -xxx Tiles color.
@@ -494,13 +494,13 @@ static TILE_GET_INFO( get_7mezzo_tile_info )
static VIDEO_START( 7mezzo )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
state->bg_tilemap = tilemap_create(machine, get_7mezzo_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static SCREEN_UPDATE( magicfly )
{
- magicfly_state *state = screen->machine->driver_data<magicfly_state>();
+ magicfly_state *state = screen->machine().driver_data<magicfly_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -535,21 +535,21 @@ static PALETTE_INIT( magicfly )
static READ8_HANDLER( mux_port_r )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
switch( state->input_selector )
{
- case 0x01: return input_port_read(space->machine, "IN0-0");
- case 0x02: return input_port_read(space->machine, "IN0-1");
- case 0x04: return input_port_read(space->machine, "IN0-2");
- case 0x08: return input_port_read(space->machine, "IN0-3");
- case 0x00: return input_port_read(space->machine, "DSW0");
+ case 0x01: return input_port_read(space->machine(), "IN0-0");
+ case 0x02: return input_port_read(space->machine(), "IN0-1");
+ case 0x04: return input_port_read(space->machine(), "IN0-2");
+ case 0x08: return input_port_read(space->machine(), "IN0-3");
+ case 0x00: return input_port_read(space->machine(), "DSW0");
}
return 0xff;
}
static WRITE8_HANDLER( mux_port_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
/* - bits -
7654 3210
---- xxxx Input selector.
@@ -561,11 +561,11 @@ static WRITE8_HANDLER( mux_port_w )
*/
state->input_selector = data & 0x0f; /* Input Selector */
- dac_data_w(space->machine->device("dac"), data & 0x80); /* Sound DAC */
+ dac_data_w(space->machine().device("dac"), data & 0x80); /* Sound DAC */
- coin_counter_w(space->machine, 0, data & 0x40); /* Coin1 */
- coin_counter_w(space->machine, 1, data & 0x10); /* Coin2 */
- coin_counter_w(space->machine, 2, data & 0x20); /* Payout */
+ coin_counter_w(space->machine(), 0, data & 0x40); /* Coin1 */
+ coin_counter_w(space->machine(), 1, data & 0x10); /* Coin2 */
+ coin_counter_w(space->machine(), 2, data & 0x20); /* Payout */
}
diff --git a/src/mame/drivers/magmax.c b/src/mame/drivers/magmax.c
index c842ac10ff2..5e13b2d9309 100644
--- a/src/mame/drivers/magmax.c
+++ b/src/mame/drivers/magmax.c
@@ -32,29 +32,29 @@ Stephh's notes (based on the game M68000 code and some tests) :
static WRITE16_HANDLER( magmax_sound_w )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
if (ACCESSING_BITS_0_7)
{
state->sound_latch = (data & 0xff) << 1;
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
}
static READ8_HANDLER( magmax_sound_irq_ack )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return 0;
}
static READ8_HANDLER( magmax_sound_r )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
return (state->sound_latch | state->LS74_q);
}
static WRITE8_DEVICE_HANDLER( ay8910_portB_0_w )
{
- magmax_state *state = device->machine->driver_data<magmax_state>();
+ magmax_state *state = device->machine().driver_data<magmax_state>();
/*bit 0 is input to CLR line of the LS74*/
state->LS74_clr = data & 1;
if (state->LS74_clr == 0)
@@ -63,7 +63,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portB_0_w )
static TIMER_CALLBACK( scanline_callback )
{
- magmax_state *state = machine->driver_data<magmax_state>();
+ magmax_state *state = machine.driver_data<magmax_state>();
int scanline = param;
/* bit 0 goes hi whenever line V6 from video part goes lo->hi */
@@ -74,14 +74,14 @@ static TIMER_CALLBACK( scanline_callback )
scanline += 128;
scanline &= 255;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( magmax )
{
- magmax_state *state = machine->driver_data<magmax_state>();
+ magmax_state *state = machine.driver_data<magmax_state>();
/* Create interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
/* Set up save state */
state_save_register_global(machine, state->sound_latch);
@@ -92,8 +92,8 @@ static MACHINE_START( magmax )
static MACHINE_RESET( magmax )
{
- magmax_state *state = machine->driver_data<magmax_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ magmax_state *state = machine.driver_data<magmax_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
#if 0
{
@@ -108,10 +108,10 @@ static MACHINE_RESET( magmax )
static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w )
{
- magmax_state *state = device->machine->driver_data<magmax_state>();
-ay8910_device *ay1 = device->machine->device<ay8910_device>("ay1");
-ay8910_device *ay2 = device->machine->device<ay8910_device>("ay2");
-ay8910_device *ay3 = device->machine->device<ay8910_device>("ay3");
+ magmax_state *state = device->machine().driver_data<magmax_state>();
+ay8910_device *ay1 = device->machine().device<ay8910_device>("ay1");
+ay8910_device *ay2 = device->machine().device<ay8910_device>("ay2");
+ay8910_device *ay3 = device->machine().device<ay8910_device>("ay3");
float percent;
/*There are three AY8910 chips and four(!) separate amplifiers on the board
@@ -190,7 +190,7 @@ bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C
static WRITE16_HANDLER( magmax_vreg_w )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
/* VRAM CONTROL REGISTER */
/* bit0 - coin counter 1 */
/* bit1 - coin counter 2 */
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index a73d8cadbc7..2c8139df14b 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -97,9 +97,9 @@ public:
*
*************************************/
-static void magtouch_microtouch_tx_callback(running_machine *machine, UINT8 data)
+static void magtouch_microtouch_tx_callback(running_machine &machine, UINT8 data)
{
- ins8250_receive(machine->device("ns16450_0"), data);
+ ins8250_receive(machine.device("ns16450_0"), data);
};
static INS8250_TRANSMIT( magtouch_com_transmit )
@@ -110,7 +110,7 @@ static INS8250_TRANSMIT( magtouch_com_transmit )
static INS8250_INTERRUPT( at_com_interrupt_1 )
{
- pic8259_ir4_w(device->machine->device("pic8259_1"), state);
+ pic8259_ir4_w(device->machine().device("pic8259_1"), state);
}
static const ins8250_interface magtouch_com0_interface =
@@ -133,7 +133,7 @@ static READ8_HANDLER(magtouch_io_r)
switch(offset)
{
case 1:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
default:
return 0;
}
@@ -144,7 +144,7 @@ static WRITE8_HANDLER(magtouch_io_w)
switch(offset)
{
case 6:
- memory_set_bank(space->machine, "rombank", data & 0x7f );
+ memory_set_bank(space->machine(), "rombank", data & 0x7f );
break;
}
}
@@ -176,9 +176,9 @@ static INPUT_PORTS_START( magtouch )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN3) PORT_IMPULSE(1)
INPUT_PORTS_END
-static void magtouch_set_keyb_int(running_machine *machine, int state)
+static void magtouch_set_keyb_int(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
static const struct pc_vga_interface vga_interface =
@@ -192,11 +192,11 @@ static const struct pc_vga_interface vga_interface =
static MACHINE_START( magtouch )
{
- device_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pcat_irq_callback);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, magtouch_set_keyb_int);
- memory_configure_bank(machine, "rombank", 0, 0x80, machine->region("game_prg")->base(), 0x8000 );
+ memory_configure_bank(machine, "rombank", 0, 0x80, machine.region("game_prg")->base(), 0x8000 );
memory_set_bank(machine, "rombank", 0);
microtouch_init(machine, magtouch_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 156c11b6814..e36ec298053 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -33,7 +33,7 @@ Notes:
static INTERRUPT_GEN( mainevt_interrupt )
{
- mainevt_state *state = device->machine->driver_data<mainevt_state>();
+ mainevt_state *state = device->machine().driver_data<mainevt_state>();
if (k052109_is_irq_enabled(state->k052109))
irq0_line_hold(device);
@@ -41,13 +41,13 @@ static INTERRUPT_GEN( mainevt_interrupt )
static WRITE8_HANDLER( dv_nmienable_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
state->nmi_enable = data;
}
static INTERRUPT_GEN( dv_interrupt )
{
- mainevt_state *state = device->machine->driver_data<mainevt_state>();
+ mainevt_state *state = device->machine().driver_data<mainevt_state>();
if (state->nmi_enable)
nmi_line_pulse(device);
@@ -56,10 +56,10 @@ static INTERRUPT_GEN( dv_interrupt )
static WRITE8_HANDLER( mainevt_bankswitch_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
/* bit 0-1 ROM bank select */
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
/* TODO: bit 5 = select work RAM or palette? */
//palette_selected = data & 0x20;
@@ -74,17 +74,17 @@ static WRITE8_HANDLER( mainevt_bankswitch_w )
static WRITE8_HANDLER( mainevt_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
}
static WRITE8_HANDLER( mainevt_sh_irqtrigger_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -95,7 +95,7 @@ static READ8_DEVICE_HANDLER( mainevt_sh_busy_r )
static WRITE8_HANDLER( mainevt_sh_irqcontrol_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
upd7759_reset_w(state->upd, data & 2);
upd7759_start_w(state->upd, data & 1);
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( devstor_sh_irqcontrol_w )
static WRITE8_HANDLER( mainevt_sh_bankswitch_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
int bank_A, bank_B;
//logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(space->cpu),data);
@@ -138,7 +138,7 @@ static WRITE8_DEVICE_HANDLER( dv_sh_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -155,7 +155,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -417,24 +417,24 @@ static const k051960_interface mainevt_k051960_intf =
static MACHINE_START( mainevt )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->upd = machine->device("upd");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->upd = machine.device("upd");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( mainevt )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
state->nmi_enable = 0;
}
diff --git a/src/mame/drivers/mainsnk.c b/src/mame/drivers/mainsnk.c
index 61affe0a88a..3a579ada93b 100644
--- a/src/mame/drivers/mainsnk.c
+++ b/src/mame/drivers/mainsnk.c
@@ -114,11 +114,11 @@ cc_p14.j2 8192 0xedc6a1eb M5L2764k
static WRITE8_HANDLER( sound_command_w )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->sound_cpu_busy = 1;
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( sound_command_r )
@@ -128,7 +128,7 @@ static READ8_HANDLER( sound_command_r )
static READ8_HANDLER( sound_ack_r )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->sound_cpu_busy = 0;
return 0xff;
@@ -136,7 +136,7 @@ static READ8_HANDLER( sound_ack_r )
static CUSTOM_INPUT( mainsnk_sound_r )
{
- mainsnk_state *state = field->port->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = field->port->machine().driver_data<mainsnk_state>();
return (state->sound_cpu_busy) ? 0x01 : 0x00;
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index ef2c5b1c3c0..44065ce7ff1 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -74,8 +74,8 @@
static READ8_HANDLER( fake_VRLE_r )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
- return (s2636_work_ram_r(state->s2636_0, 0xcb) & 0x3f) + (space->machine->primary_screen->vblank() * 0x40);
+ malzak_state *state = space->machine().driver_data<malzak_state>();
+ return (s2636_work_ram_r(state->s2636_0, 0xcb) & 0x3f) + (space->machine().primary_screen->vblank() * 0x40);
}
static READ8_HANDLER( s2636_portA_r )
@@ -83,7 +83,7 @@ static READ8_HANDLER( s2636_portA_r )
// POT switch position, read from port A of the first S2636
// Not sure of the correct values to return, but these should
// do based on the game code.
- switch (input_port_read(space->machine, "POT"))
+ switch (input_port_read(space->machine(), "POT"))
{
case 0: // Normal play
return 0xf0;
@@ -153,27 +153,27 @@ static WRITE8_HANDLER( port40_w )
// Bits 1-3 are all set high upon death, until the game continues
// Bit 6 is used only in Malzak II, and is set high after checking
// the selected version
-// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine->device("maincpu")), data);
- memory_set_bank(space->machine, "bank1", (data & 0x40) >> 6);
+// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine().device("maincpu")), data);
+ memory_set_bank(space->machine(), "bank1", (data & 0x40) >> 6);
}
static WRITE8_HANDLER( port60_w )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
state->malzak_x = data;
// logerror("I/O: port 0x60 write 0x%02x\n", data);
}
static WRITE8_HANDLER( portc0_w )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
state->malzak_y = data;
// logerror("I/O: port 0xc0 write 0x%02x\n", data);
}
static READ8_HANDLER( collision_r )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
// High 4 bits seem to refer to the row affected.
if(++state->collision_counter > 15)
@@ -372,13 +372,13 @@ static const saa5050_interface malzac_saa5050_intf =
static MACHINE_START( malzak )
{
- malzak_state *state = machine->driver_data<malzak_state>();
+ malzak_state *state = machine.driver_data<malzak_state>();
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("user2")->base(), 0x400);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("user2")->base(), 0x400);
- state->s2636_0 = machine->device("s2636_0");
- state->s2636_1 = machine->device("s2636_1");
- state->saa5050 = machine->device("saa5050");
+ state->s2636_0 = machine.device("s2636_0");
+ state->s2636_1 = machine.device("s2636_1");
+ state->saa5050 = machine.device("saa5050");
state->save_item(NAME(state->playfield_code));
state->save_item(NAME(state->malzak_x));
@@ -387,7 +387,7 @@ static MACHINE_START( malzak )
static MACHINE_RESET( malzak )
{
- malzak_state *state = machine->driver_data<malzak_state>();
+ malzak_state *state = machine.driver_data<malzak_state>();
memset(state->playfield_code, 0, 256);
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 1386b6c4835..7c3b0f2864a 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -579,29 +579,29 @@ TODO:
static WRITE8_HANDLER( superpac_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04: /* n.c. */
break;
case 0x06: /* SOUND ON */
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08: /* 4 RESET */
@@ -610,7 +610,7 @@ static WRITE8_HANDLER( superpac_latch_w )
break;
case 0x0a: /* SUB RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c: /* n.c. */
@@ -623,32 +623,32 @@ static WRITE8_HANDLER( superpac_latch_w )
static WRITE8_HANDLER( phozon_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00:
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02:
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04:
- cpu_interrupt_enable(space->machine->device("sub2"), bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
break;
case 0x06:
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08:
@@ -657,11 +657,11 @@ static WRITE8_HANDLER( phozon_latch_w )
break;
case 0x0a:
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c:
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0e:
@@ -671,30 +671,30 @@ static WRITE8_HANDLER( phozon_latch_w )
static WRITE8_HANDLER( mappy_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04: /* FLIP */
- flip_screen_set(space->machine, bit);
+ flip_screen_set(space->machine(), bit);
break;
case 0x06: /* SOUND ON */
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08: /* 4 RESET */
@@ -703,7 +703,7 @@ static WRITE8_HANDLER( mappy_latch_w )
break;
case 0x0a: /* SUB RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c: /* n.c. */
@@ -717,7 +717,7 @@ static WRITE8_HANDLER( mappy_latch_w )
static MACHINE_RESET( superpac )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -727,7 +727,7 @@ static MACHINE_RESET( superpac )
static MACHINE_RESET( phozon )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -737,7 +737,7 @@ static MACHINE_RESET( phozon )
static MACHINE_RESET( mappy )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -749,8 +749,8 @@ static MACHINE_RESET( mappy )
static TIMER_CALLBACK( superpac_io_run )
{
- device_t *io56xx_1 = machine->device("namcoio_1");
- device_t *io56xx_2 = machine->device("namcoio_2");
+ device_t *io56xx_1 = machine.device("namcoio_1");
+ device_t *io56xx_2 = machine.device("namcoio_2");
switch (param)
{
@@ -765,23 +765,23 @@ static TIMER_CALLBACK( superpac_io_run )
static INTERRUPT_GEN( superpac_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run), 1);
}
static TIMER_CALLBACK( pacnpal_io_run )
{
- device_t *io56xx = machine->device("namcoio_1");
- device_t *io59xx = machine->device("namcoio_2");
+ device_t *io56xx = machine.device("namcoio_1");
+ device_t *io59xx = machine.device("namcoio_2");
switch (param)
{
@@ -796,23 +796,23 @@ static TIMER_CALLBACK( pacnpal_io_run )
static INTERRUPT_GEN( pacnpal_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run), 1);
}
static TIMER_CALLBACK( phozon_io_run )
{
- device_t *io58xx = machine->device("namcoio_1");
- device_t *io56xx = machine->device("namcoio_2");
+ device_t *io58xx = machine.device("namcoio_1");
+ device_t *io56xx = machine.device("namcoio_2");
switch (param)
{
@@ -827,23 +827,23 @@ static TIMER_CALLBACK( phozon_io_run )
static INTERRUPT_GEN( phozon_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run), 1);
}
static TIMER_CALLBACK( mappy_io_run )
{
- device_t *io58xx_1 = machine->device("namcoio_1");
- device_t *io58xx_2 = machine->device("namcoio_2");
+ device_t *io58xx_1 = machine.device("namcoio_1");
+ device_t *io58xx_2 = machine.device("namcoio_2");
switch (param)
{
@@ -858,17 +858,17 @@ static TIMER_CALLBACK( mappy_io_run )
static INTERRUPT_GEN( mappy_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1);
}
@@ -1538,37 +1538,37 @@ static const namco_interface namco_config =
***************************************************************************/
-static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine, "DSW1"); } // dips A
-static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine, "DSW1") >> 4; } // dips A
+static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine(), "DSW1"); } // dips A
+static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine(), "DSW1") >> 4; } // dips A
static READ8_DEVICE_HANDLER( dipB_mux ) // dips B
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
- return input_port_read(device->machine, "DSW2") >> (4 * state->mux);
+ return input_port_read(device->machine(), "DSW2") >> (4 * state->mux);
}
static READ8_DEVICE_HANDLER( dipB_muxi ) // dips B
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
// bits are interleaved in Phozon
- return BITSWAP8(input_port_read(device->machine, "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->mux);
+ return BITSWAP8(input_port_read(device->machine(), "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->mux);
}
static WRITE8_DEVICE_HANDLER( out_mux )
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
state->mux = data & 1;
}
static WRITE8_DEVICE_HANDLER( out_lamps )
{
- set_led_status(device->machine, 0, data & 1);
- set_led_status(device->machine, 1, data & 2);
- coin_lockout_global_w(device->machine, data & 4);
- coin_counter_w(device->machine, 0, ~data & 8);
+ set_led_status(device->machine(), 0, data & 1);
+ set_led_status(device->machine(), 1, data & 2);
+ coin_lockout_global_w(device->machine(), data & 4);
+ coin_counter_w(device->machine(), 0, ~data & 8);
}
/* chip #0: player inputs, buttons, coins */
@@ -2239,14 +2239,14 @@ static DRIVER_INIT( grobda )
However, removing the 15XX from the board causes sound to disappear completely, so
the DAC might be built-in after all.
*/
- device_t *dac = machine->device("dac");
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x0002, 0x0002, FUNC(grobda_DAC_w) );
+ device_t *dac = machine.device("dac");
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x0002, 0x0002, FUNC(grobda_DAC_w) );
}
static DRIVER_INIT( digdug2 )
{
/* appears to not use the watchdog */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x8000, 0x8000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x8000, 0x8000);
}
diff --git a/src/mame/drivers/marineb.c b/src/mame/drivers/marineb.c
index a17be0a456d..7de4a0a1531 100644
--- a/src/mame/drivers/marineb.c
+++ b/src/mame/drivers/marineb.c
@@ -43,14 +43,14 @@ write
static TIMER_CALLBACK( interrupt_disable )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
//interrupt_enable = 0;
cpu_interrupt_enable(state->maincpu, 0);
}
static MACHINE_RESET( marineb )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
state->palette_bank = 0;
state->column_scroll = 0;
@@ -59,12 +59,12 @@ static MACHINE_RESET( marineb )
state->marineb_active_low_flipscreen = 0;
/* we must start with NMI interrupts disabled */
- machine->scheduler().synchronize(FUNC(interrupt_disable));
+ machine.scheduler().synchronize(FUNC(interrupt_disable));
}
static MACHINE_RESET( springer )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
MACHINE_RESET_CALL( marineb );
@@ -73,9 +73,9 @@ static MACHINE_RESET( springer )
static MACHINE_START( marineb )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->audiocpu = NULL;
state->save_item(NAME(state->marineb_active_low_flipscreen));
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index 45d78bfa2a7..9269bfbd723 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -121,7 +121,7 @@ public:
static WRITE8_HANDLER( tx_tileram_w )
{
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->tx_tileram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -129,12 +129,12 @@ static WRITE8_HANDLER( tx_tileram_w )
static READ8_HANDLER( marinedt_port1_r )
{
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//might need to be reversed for cocktail stuff
/* x/y multiplexed */
- return input_port_read(space->machine, ((state->pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
+ return input_port_read(space->machine(), ((state->pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
}
static READ8_HANDLER( marinedt_coll_r )
@@ -145,7 +145,7 @@ static READ8_HANDLER( marinedt_coll_r )
//----x--- obj1 to playfield collision
//-----xxx unused
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
return state->coll | state->collh;
}
@@ -159,8 +159,8 @@ static READ8_HANDLER( marinedt_obj1_x_r )
//xxxx---- unknown
//----xxxx x pos in tile ram
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
if (RAM[0x430e])
--state->cx;
@@ -177,7 +177,7 @@ static READ8_HANDLER( marinedt_obj1_yr_r )
//xxxx---- unknown
//----xxxx row in current screen quarter
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//has to be +1 if cx went over?
if (state->cx == 0x10)
@@ -194,18 +194,18 @@ static READ8_HANDLER( marinedt_obj1_yq_r )
//----xx-- unknown
//------xx screen quarter
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
return state->cyq | (state->cyqh << 4);
}
-static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_a = data; }
-static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_x = data; }
-static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_y = data; }
-static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_a = data; }
-static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_x = data; }
-static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_y = data; }
+static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_a = data; }
+static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_x = data; }
+static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_y = data; }
+static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_a = data; }
+static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_x = data; }
+static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_y = data; }
-static WRITE8_HANDLER( marinedt_music_w ){ marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->music = data; }
+static WRITE8_HANDLER( marinedt_music_w ){ marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->music = data; }
static WRITE8_HANDLER( marinedt_sound_w )
{
@@ -218,7 +218,7 @@ static WRITE8_HANDLER( marinedt_sound_w )
//------x- dots hit
//-------x ??
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->sound = data;
}
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( marinedt_pd_w )
//------x- obj2 enable
//-------x obj1 enable
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->pd = data;
}
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( marinedt_pf_w )
//------x- ?? upright/cocktail
//-------x ?? service mode (coin lockout??)
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//if ((state->pf & 0x07) != (data & 0x07))
// mame_printf_debug("marinedt_pf_w: %02x\n", data & 0x07);
@@ -282,7 +282,7 @@ static WRITE8_HANDLER( marinedt_pf_w )
//if (data & 0xf0)
// logerror("pf:%02x %d\n", state->pf);
- //logerror("pd:%02x %d\n", state->pd, space->machine->primary_screen->frame_number());
+ //logerror("pd:%02x %d\n", state->pd, space->machine().primary_screen->frame_number());
}
@@ -425,7 +425,7 @@ static PALETTE_INIT( marinedt )
{
int i,r,b,g;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
@@ -456,7 +456,7 @@ bit0 = 0;
static TILE_GET_INFO( get_tile_info )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
int code = state->tx_tileram[tile_index];
int color = 0;
int flags = TILE_FLIPX;
@@ -466,16 +466,16 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( marinedt )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
state->tx_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->tx_tilemap, 0);
tilemap_set_scrolldx(state->tx_tilemap, 0, 4*8);
tilemap_set_scrolldy(state->tx_tilemap, 0, -4*8);
- state->tile = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, machine->primary_screen->format());
- state->obj1 = auto_bitmap_alloc(machine, 32, 32, machine->primary_screen->format());
- state->obj2 = auto_bitmap_alloc(machine, 32, 32, machine->primary_screen->format());
+ state->tile = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, machine.primary_screen->format());
+ state->obj1 = auto_bitmap_alloc(machine, 32, 32, machine.primary_screen->format());
+ state->obj2 = auto_bitmap_alloc(machine, 32, 32, machine.primary_screen->format());
}
@@ -494,21 +494,21 @@ static VIDEO_START( marinedt )
static SCREEN_UPDATE( marinedt )
{
- marinedt_state *state = screen->machine->driver_data<marinedt_state>();
+ marinedt_state *state = screen->machine().driver_data<marinedt_state>();
int sx, sy;
bitmap_fill(state->tile, NULL, 0);
tilemap_draw(state->tile, cliprect, state->tx_tilemap, 0, 0);
bitmap_fill(state->obj1, NULL, 0);
- drawgfx_transpen(state->obj1, NULL, screen->machine->gfx[1],
+ drawgfx_transpen(state->obj1, NULL, screen->machine().gfx[1],
OBJ_CODE(state->obj1_a),
OBJ_COLOR(state->obj1_a),
OBJ_FLIPX(state->obj1_a), OBJ_FLIPY(state->obj1_a),
0, 0, 0);
bitmap_fill(state->obj2, NULL, 0);
- drawgfx_transpen(state->obj2, NULL, screen->machine->gfx[2],
+ drawgfx_transpen(state->obj2, NULL, screen->machine().gfx[2],
OBJ_CODE(state->obj2_a),
OBJ_COLOR(state->obj2_a),
OBJ_FLIPX(state->obj2_a), OBJ_FLIPY(state->obj2_a),
@@ -597,7 +597,7 @@ static SCREEN_UPDATE( marinedt )
static MACHINE_START( marinedt )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
state->save_item(NAME(state->obj1_a));
state->save_item(NAME(state->obj1_x));
@@ -621,7 +621,7 @@ static MACHINE_START( marinedt )
static MACHINE_RESET( marinedt )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
state->obj1_a = 0;
state->obj1_x = 0;
diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c
index b7945a41e66..9ee41d27c9c 100644
--- a/src/mame/drivers/mastboy.c
+++ b/src/mame/drivers/mastboy.c
@@ -466,13 +466,13 @@ public:
static VIDEO_START(mastboy)
{
- mastboy_state *state = machine->driver_data<mastboy_state>();
- gfx_element_set_source(machine->gfx[0], state->vram);
+ mastboy_state *state = machine.driver_data<mastboy_state>();
+ gfx_element_set_source(machine.gfx[0], state->vram);
}
static SCREEN_UPDATE(mastboy)
{
- mastboy_state *state = screen->machine->driver_data<mastboy_state>();
+ mastboy_state *state = screen->machine().driver_data<mastboy_state>();
int y,x,i;
int count = 0x000;
@@ -480,7 +480,7 @@ static SCREEN_UPDATE(mastboy)
{
int coldat = state->colram[i+1] | (state->colram[i+0]<<8);
- palette_set_color_rgb(screen->machine,i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4));
+ palette_set_color_rgb(screen->machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4));
}
for (y=0;y<32;y++)
@@ -494,12 +494,12 @@ static SCREEN_UPDATE(mastboy)
if (tileno&0x800)
{
- gfx = screen->machine->gfx[1];
+ gfx = screen->machine().gfx[1];
tileno &=0x7ff;
}
else
{
- gfx = screen->machine->gfx[0];
+ gfx = screen->machine().gfx[0];
}
@@ -519,7 +519,7 @@ static SCREEN_UPDATE(mastboy)
static READ8_HANDLER(banked_ram_r)
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
if ((state->bank&0x80) == 0x00)
{
int bank;
@@ -528,7 +528,7 @@ static READ8_HANDLER(banked_ram_r)
if (bank>0x3) // ROM access
{
- UINT8 *src = space->machine->region( "gfx1" )->base();
+ UINT8 *src = space->machine().region( "gfx1" )->base();
bank &=0x3;
return src[offset+(bank*0x4000)];
}
@@ -544,14 +544,14 @@ static READ8_HANDLER(banked_ram_r)
UINT8 *src;
int bank;
bank = state->bank & 0x7f;
- src = space->machine->region ( "user1" )->base() + bank * 0x4000;
+ src = space->machine().region ( "user1" )->base() + bank * 0x4000;
return src[offset];
}
}
static WRITE8_HANDLER( banked_ram_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
if ((state->bank&0x80) == 0x00)
{
int bank;
@@ -574,7 +574,7 @@ static WRITE8_HANDLER( banked_ram_w )
state->vram[offs] = data^0xff;
/* Decode the new tile */
- gfx_element_mark_dirty(space->machine->gfx[0], offs/32);
+ gfx_element_mark_dirty(space->machine().gfx[0], offs/32);
}
}
else
@@ -585,7 +585,7 @@ static WRITE8_HANDLER( banked_ram_w )
static WRITE8_HANDLER( mastboy_bank_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
// controls access to banked ram / rom
state->bank = data;
}
@@ -594,13 +594,13 @@ static WRITE8_HANDLER( mastboy_bank_w )
static READ8_HANDLER( mastboy_backupram_r )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
return state->m_nvram[offset];
}
static WRITE8_HANDLER( mastboy_backupram_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
// if (state->backupram_enabled)
// {
state->m_nvram[offset] = data;
@@ -613,7 +613,7 @@ static WRITE8_HANDLER( mastboy_backupram_w )
static WRITE8_HANDLER( backupram_enable_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
/* This is some kind of enable / disable control for backup ram (see Charles's notes) but I'm not
sure how it works in practice, if we use it then it writes a lot of data with it disabled */
state->backupram_enabled = data&1;
@@ -623,8 +623,8 @@ static WRITE8_HANDLER( backupram_enable_w )
static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
- device_t *adpcm = space->machine->device("msm");
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
+ device_t *adpcm = space->machine().device("msm");
state->m5205_sambit0 = data & 1;
msm5205_playmode_w(adpcm, (1 << 2) | (state->m5205_sambit1 << 1) | (state->m5205_sambit0) );
@@ -634,8 +634,8 @@ static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w )
static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
- device_t *adpcm = space->machine->device("msm");
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
+ device_t *adpcm = space->machine().device("msm");
state->m5205_sambit1 = data & 1;
@@ -646,26 +646,26 @@ static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w )
static WRITE8_DEVICE_HANDLER( mastboy_msm5205_reset_w )
{
- mastboy_state *state = device->machine->driver_data<mastboy_state>();
+ mastboy_state *state = device->machine().driver_data<mastboy_state>();
state->m5205_part = 0;
msm5205_reset_w(device,data&1);
}
static WRITE8_HANDLER( mastboy_msm5205_data_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
state->m5205_next = data;
}
static void mastboy_adpcm_int(device_t *device)
{
- mastboy_state *state = device->machine->driver_data<mastboy_state>();
+ mastboy_state *state = device->machine().driver_data<mastboy_state>();
msm5205_data_w(device, state->m5205_next);
state->m5205_next >>= 4;
state->m5205_part ^= 1;
if(!state->m5205_part)
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -679,15 +679,15 @@ static const msm5205_interface msm5205_config =
static WRITE8_HANDLER( mastboy_irq0_ack_w )
{
- mastboy_state *state = space->machine->driver_data<mastboy_state>();
+ mastboy_state *state = space->machine().driver_data<mastboy_state>();
state->irq0_ack = data;
if ((data & 1) == 1)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static INTERRUPT_GEN( mastboy_interrupt )
{
- mastboy_state *state = device->machine->driver_data<mastboy_state>();
+ mastboy_state *state = device->machine().driver_data<mastboy_state>();
if ((state->irq0_ack & 1) == 1)
{
device_set_input_line(device, 0, ASSERT_LINE);
@@ -863,7 +863,7 @@ GFXDECODE_END
static MACHINE_RESET( mastboy )
{
- mastboy_state *state = machine->driver_data<mastboy_state>();
+ mastboy_state *state = machine.driver_data<mastboy_state>();
/* clear some ram */
memset( state->workram, 0x00, 0x01000);
memset( state->tileram, 0x00, 0x01000);
@@ -871,7 +871,7 @@ static MACHINE_RESET( mastboy )
memset( state->vram, 0x00, 0x10000);
state->m5205_part = 0;
- msm5205_reset_w(machine->device("msm"),1);
+ msm5205_reset_w(machine.device("msm"),1);
state->irq0_ack = 0;
}
@@ -992,8 +992,8 @@ ROM_END
static DRIVER_INIT( mastboy )
{
- mastboy_state *state = machine->driver_data<mastboy_state>();
- state->vram = machine->region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
+ mastboy_state *state = machine.driver_data<mastboy_state>();
+ state->vram = machine.region( "gfx1" )->base(); // makes decoding the RAM based tiles easier this way
}
GAME( 1991, mastboy, 0, mastboy, mastboy, mastboy, ROT0, "Gaelco", "Master Boy (Spanish, PCB Rev A)", 0 )
diff --git a/src/mame/drivers/matmania.c b/src/mame/drivers/matmania.c
index 62573874b91..a2afaa53b7c 100644
--- a/src/mame/drivers/matmania.c
+++ b/src/mame/drivers/matmania.c
@@ -47,14 +47,14 @@ The driver has been updated accordingly.
static WRITE8_HANDLER( matmania_sh_command_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, M6502_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( maniach_sh_command_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
}
@@ -301,11 +301,11 @@ GFXDECODE_END
static MACHINE_START( matmania )
{
- matmania_state *state = machine->driver_data<matmania_state>();
+ matmania_state *state = machine.driver_data<matmania_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
}
static MACHINE_CONFIG_START( matmania, matmania_state )
@@ -356,7 +356,7 @@ MACHINE_CONFIG_END
/* handler called by the 3526 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int linestate)
{
- matmania_state *state = device->machine->driver_data<matmania_state>();
+ matmania_state *state = device->machine().driver_data<matmania_state>();
device_set_input_line(state->audiocpu, 1, linestate);
}
@@ -368,7 +368,7 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( maniach )
{
- matmania_state *state = machine->driver_data<matmania_state>();
+ matmania_state *state = machine.driver_data<matmania_state>();
MACHINE_START_CALL(matmania);
@@ -389,7 +389,7 @@ static MACHINE_START( maniach )
static MACHINE_RESET( maniach )
{
- matmania_state *state = machine->driver_data<matmania_state>();
+ matmania_state *state = machine.driver_data<matmania_state>();
state->port_a_in = 0;
state->port_a_out = 0;
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index 805f7e98fbe..0a8f4fb68e6 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -61,16 +61,16 @@ public:
static READ8_HANDLER( mcu_portA_r )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
- state->portA_in = input_port_read(space->machine, "dsw") | (input_port_read(space->machine, "coin") << 4) | (input_port_read(space->machine, "console") << 5);
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
+ state->portA_in = input_port_read(space->machine(), "dsw") | (input_port_read(space->machine(), "coin") << 4) | (input_port_read(space->machine(), "console") << 5);
return (state->portA_in & ~state->ddrA) | (state->portA_out & state->ddrA);
}
static WRITE8_HANDLER( mcu_portA_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->portA_out = data;
- speaker_level_w(space->machine->device("speaker"), data >> 7);
+ speaker_level_w(space->machine().device("speaker"), data >> 7);
}
/* Port B:
@@ -86,26 +86,26 @@ static WRITE8_HANDLER( mcu_portA_w )
static READ8_HANDLER( mcu_portB_r )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
return (state->portB_in & ~state->ddrB) | (state->portB_out & state->ddrB);
}
static WRITE8_HANDLER( mcu_portB_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
UINT8 diff = data ^ state->portB_out;
state->portB_out = data;
/* clear coin interrupt */
if (data & 0x04)
- cputag_set_input_line(space->machine, "mcu", M6805_IRQ_LINE, CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "mcu", M6805_IRQ_LINE, CLEAR_LINE );
/* AUDMUTE */
- space->machine->sound().system_enable((data >> 5) & 1);
+ space->machine().sound().system_enable((data >> 5) & 1);
/* RES600 */
if (diff & 0x10)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
/* latch for lamps */
if ((diff & 0x40) && !(data & 0x40))
@@ -125,13 +125,13 @@ static WRITE8_HANDLER( mcu_portB_w )
static READ8_HANDLER( mcu_portC_r )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
return (state->portC_in & ~state->ddrC) | (state->portC_out & state->ddrC);
}
static WRITE8_HANDLER( mcu_portC_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
/* uses a 7447A, which is equivalent to an LS47/48 */
static const UINT8 ls48_map[16] =
{ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
@@ -155,31 +155,31 @@ static READ8_HANDLER( mcu_ddr_r )
static WRITE8_HANDLER( mcu_portA_ddr_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->ddrA = data;
}
static WRITE8_HANDLER( mcu_portB_ddr_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->ddrB = data;
}
static WRITE8_HANDLER( mcu_portC_ddr_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->ddrC = data;
}
static TIMER_DEVICE_CALLBACK( mcu_timer_proc )
{
- maxaflex_state *state = timer.machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = timer.machine().driver_data<maxaflex_state>();
if ( --state->tdr == 0x00 )
{
if ( (state->tcr & 0x40) == 0 )
{
//timer interrupt!
- generic_pulse_irq_line(timer.machine->device("mcu"), M68705_INT_TIMER);
+ generic_pulse_irq_line(timer.machine().device("mcu"), M68705_INT_TIMER);
}
}
}
@@ -187,26 +187,26 @@ static TIMER_DEVICE_CALLBACK( mcu_timer_proc )
/* Timer Data Reg */
static READ8_HANDLER( mcu_tdr_r )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
return state->tdr;
}
static WRITE8_HANDLER( mcu_tdr_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->tdr = data;
}
/* Timer control reg */
static READ8_HANDLER( mcu_tcr_r )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
return state->tcr & ~0x08;
}
static WRITE8_HANDLER( mcu_tcr_w )
{
- maxaflex_state *state = space->machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = space->machine().driver_data<maxaflex_state>();
state->tcr = data;
if ( (state->tcr & 0x40) == 0 )
{
@@ -237,12 +237,12 @@ static WRITE8_HANDLER( mcu_tcr_w )
static MACHINE_RESET(supervisor_board)
{
- maxaflex_state *state = machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = machine.driver_data<maxaflex_state>();
state->portA_in = state->portA_out = state->ddrA = 0;
state->portB_in = state->portB_out = state->ddrB = 0;
state->portC_in = state->portC_out = state->ddrC = 0;
state->tdr = state->tcr = 0;
- state->mcu_timer = machine->device<timer_device>("mcu_timer");
+ state->mcu_timer = machine.device<timer_device>("mcu_timer");
output_set_lamp_value(0, 0);
output_set_lamp_value(1, 0);
@@ -256,12 +256,12 @@ static MACHINE_RESET(supervisor_board)
static INPUT_CHANGED( coin_inserted )
{
if (!newval)
- cputag_set_input_line(field->port->machine, "mcu", M6805_IRQ_LINE, HOLD_LINE );
+ cputag_set_input_line(field->port->machine(), "mcu", M6805_IRQ_LINE, HOLD_LINE );
}
-int atari_input_disabled(running_machine *machine)
+int atari_input_disabled(running_machine &machine)
{
- maxaflex_state *state = machine->driver_data<maxaflex_state>();
+ maxaflex_state *state = machine.driver_data<maxaflex_state>();
return (state->portB_out & 0x80) == 0x00;
}
@@ -474,7 +474,7 @@ ROM_END
static DRIVER_INIT( a600xl )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memcpy( rom + 0x5000, rom + 0xd000, 0x800 );
}
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index b0eaa77ce0a..bef681b0c43 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -114,7 +114,7 @@ static void update_outputs(i8279_state *chip, UINT16 which)
static READ8_HANDLER( m1_8279_r )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
i8279_state *chip = state->i8279 + 0;
static const char *const portnames[] = { "SW1","STROBE5","STROBE7","STROBE3","SW2","STROBE4","STROBE6","STROBE2" };
UINT8 result = 0xff;
@@ -128,7 +128,7 @@ static READ8_HANDLER( m1_8279_r )
/* read sensor RAM */
case 0x40:
addr = chip->command & 0x07;
- result = input_port_read(space->machine,"SW1");
+ result = input_port_read(space->machine(),"SW1");
/* handle autoincrement */
if (chip->command & 0x10)
chip->command = (chip->command & 0xf0) | ((addr + 1) & 0x0f);
@@ -155,7 +155,7 @@ static READ8_HANDLER( m1_8279_r )
{
if ( chip->read_sensor )
{
- result = input_port_read(space->machine,portnames[chip->sense_address]);
+ result = input_port_read(space->machine(),portnames[chip->sense_address]);
// break
}
if ( chip->sense_auto_inc )
@@ -174,7 +174,7 @@ static READ8_HANDLER( m1_8279_r )
static WRITE8_HANDLER( m1_8279_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
i8279_state *chip = state->i8279 + 0;
UINT8 addr;
@@ -293,7 +293,7 @@ static WRITE8_HANDLER( m1_8279_w )
static READ8_HANDLER( m1_8279_2_r )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
i8279_state *chip = state->i8279 + 1;
UINT8 result = 0xff;
UINT8 addr;
@@ -334,7 +334,7 @@ static READ8_HANDLER( m1_8279_2_r )
static WRITE8_HANDLER( m1_8279_2_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
i8279_state *chip = state->i8279 + 1;
UINT8 addr;
@@ -448,9 +448,9 @@ static WRITE8_HANDLER( m1_8279_2_w )
// called if board is reset ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-static void m1_stepper_reset(running_machine *machine)
+static void m1_stepper_reset(running_machine &machine)
{
- maygay1b_state *state = machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = machine.driver_data<maygay1b_state>();
int pattern = 0,i;
for ( i = 0; i < 6; i++)
{
@@ -462,9 +462,9 @@ static void m1_stepper_reset(running_machine *machine)
static MACHINE_RESET( m1 )
{
- maygay1b_state *state = machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = machine.driver_data<maygay1b_state>();
ROC10937_reset(0); // reset display1
- state->duart68681 = machine->device( "duart68681" );
+ state->duart68681 = machine.device( "duart68681" );
m1_stepper_reset(machine);
}
@@ -472,7 +472,7 @@ static MACHINE_RESET( m1 )
static void duart_irq_handler(device_t *device, UINT8 state)
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE);
LOG(("6809 irq%d \n",state));
}
@@ -496,7 +496,7 @@ static void cpu0_nmi(int state)
static WRITE8_DEVICE_HANDLER( m1_pia_porta_w )
{
- maygay1b_state *state = device->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = device->machine().driver_data<maygay1b_state>();
if ( data & 0x40 ) ROC10937_reset(0);
if ( !state->alpha_clock && (data & 0x20) )
@@ -667,7 +667,7 @@ static MACHINE_START( m1 )
}
static WRITE8_HANDLER( reel12_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
stepper_update(0, data & 0x0F );
stepper_update(1, (data>>4) & 0x0F );
@@ -682,7 +682,7 @@ static WRITE8_HANDLER( reel12_w )
static WRITE8_HANDLER( reel34_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
stepper_update(2, data & 0x0F );
stepper_update(3, (data>>4) & 0x0F );
@@ -697,7 +697,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( reel56_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
stepper_update(4, data & 0x0F );
stepper_update(5, (data>>4) & 0x0F );
@@ -712,7 +712,7 @@ static WRITE8_HANDLER( reel56_w )
static UINT8 m1_duart_r (device_t *device)
{
- maygay1b_state *state = device->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = device->machine().driver_data<maygay1b_state>();
return (state->optic_pattern);
}
@@ -726,7 +726,7 @@ static WRITE8_DEVICE_HANDLER( m1_meter_w )
static WRITE8_HANDLER( m1_latch_w )
{
- maygay1b_state *state = space->machine->driver_data<maygay1b_state>();
+ maygay1b_state *state = space->machine().driver_data<maygay1b_state>();
switch ( offset )
{
case 0: // state->RAMEN
diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c
index 7aea5fa8250..15b54c70cca 100644
--- a/src/mame/drivers/maygayv1.c
+++ b/src/mame/drivers/maygayv1.c
@@ -233,7 +233,7 @@ public:
static WRITE16_HANDLER( i82716_w )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
// Accessing register window?
if ((VREG(RWBA) & 0xfff0) == (offset & 0xfff0))
@@ -253,7 +253,7 @@ static WRITE16_HANDLER( i82716_w )
static READ16_HANDLER( i82716_r )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
// Accessing register window?
if ((VREG(RWBA) & ~0xf) == (offset & ~0xf))
@@ -282,7 +282,7 @@ static VIDEO_START( maygayv1 )
static SCREEN_UPDATE( maygayv1 )
{
- maygayv1_state *state = screen->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = screen->machine().driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
UINT16 *atable = &i82716.dram[VREG(ATBA)];
UINT16 *otable = &i82716.dram[VREG(ODTBA) & 0xfc00]; // both must be bank 0
@@ -297,7 +297,7 @@ static SCREEN_UPDATE( maygayv1 )
/* If screen output is disabled, fill with black */
if (!(VREG(VCR0) & VCR0_DEN))
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -413,7 +413,7 @@ static SCREEN_UPDATE( maygayv1 )
static SCREEN_EOF( maygayv1 )
{
- maygayv1_state *state = machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = machine.driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
// UCF
if (VREG(VCR0) & VCR0_UCF)
@@ -507,7 +507,7 @@ static void update_outputs(i8279_t &i8279, UINT16 which)
static READ16_HANDLER( maygay_8279_r )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
i8279_t &i8279 = state->i8279;
static const char *const portnames[] = { "STROBE1","STROBE2","STROBE3","STROBE4","STROBE5","STROBE6","STROBE7","STROBE8" };
UINT8 result = 0xff;
@@ -522,7 +522,7 @@ static READ16_HANDLER( maygay_8279_r )
case 0x40:
addr = i8279.command & 0x07;
- result = input_port_read(space->machine, portnames[addr]);
+ result = input_port_read(space->machine(), portnames[addr]);
/* handle autoincrement */
if (i8279.command & 0x10)
@@ -555,7 +555,7 @@ static READ16_HANDLER( maygay_8279_r )
static WRITE16_HANDLER( maygay_8279_w )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
i8279_t &i8279 = state->i8279;
UINT8 addr;
@@ -658,12 +658,12 @@ static WRITE16_HANDLER( maygay_8279_w )
static WRITE16_HANDLER( vsync_int_ctrl )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
state->vsync_latch_preset = data & 0x0100;
// Active low
if (!(state->vsync_latch_preset))
- cputag_set_input_line(space->machine, "maincpu", 3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
@@ -717,13 +717,13 @@ ADDRESS_MAP_END
static READ8_HANDLER( mcu_r )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
switch (offset)
{
case 1:
{
if ( !BIT(state->p3, 4) )
- return (input_port_read(space->machine, "REEL")); // Reels???
+ return (input_port_read(space->machine(), "REEL")); // Reels???
else
return 0;
}
@@ -735,7 +735,7 @@ static READ8_HANDLER( mcu_r )
static WRITE8_HANDLER( mcu_w )
{
- maygayv1_state *state = space->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = space->machine().driver_data<maygayv1_state>();
logerror("O %x D %x",offset,data);
switch (offset)
@@ -922,18 +922,18 @@ INPUT_PORTS_END
static void duart_irq_handler(device_t *device, UINT8 vector)
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 5, ASSERT_LINE, vector);
-// cputag_set_input_line(device->machine, "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 5, ASSERT_LINE, vector);
+// cputag_set_input_line(device->machine(), "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
};
static void duart_tx(device_t *device, int channel, UINT8 data)
{
- maygayv1_state *state = device->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = device->machine().driver_data<maygayv1_state>();
if (channel == 0)
{
state->d68681_val = data;
- cputag_set_input_line(device->machine, "soundcpu", MCS51_RX_LINE, ASSERT_LINE); // ?
+ cputag_set_input_line(device->machine(), "soundcpu", MCS51_RX_LINE, ASSERT_LINE); // ?
}
};
@@ -949,13 +949,13 @@ static const duart68681_config maygayv1_duart68681_config =
static int data_to_i8031(device_t *device)
{
- maygayv1_state *state = device->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = device->machine().driver_data<maygayv1_state>();
return state->d68681_val;
}
static void data_from_i8031(device_t *device, int data)
{
- maygayv1_state *state = device->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = device->machine().driver_data<maygayv1_state>();
duart68681_rx_data(state->duart68681, 0, data);
}
@@ -991,7 +991,7 @@ static const pia6821_interface pia_intf =
static MACHINE_START( maygayv1 )
{
- maygayv1_state *state = machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = machine.driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
i82716.dram = auto_alloc_array(machine, UINT16, 0x80000/2); // ???
i82716.line_buf = auto_alloc_array(machine, UINT8, 512);
@@ -1000,16 +1000,16 @@ static MACHINE_START( maygayv1 )
// duart_68681_init(DUART_CLOCK, duart_irq_handler, duart_tx);
- i8051_set_serial_tx_callback(machine->device("soundcpu"), data_from_i8031);
- i8051_set_serial_rx_callback(machine->device("soundcpu"), data_to_i8031);
+ i8051_set_serial_tx_callback(machine.device("soundcpu"), data_from_i8031);
+ i8051_set_serial_rx_callback(machine.device("soundcpu"), data_to_i8031);
}
static MACHINE_RESET( maygayv1 )
{
- maygayv1_state *state = machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = machine.driver_data<maygayv1_state>();
i82716_t &i82716 = state->i82716;
// ?
- state->duart68681 = machine->device( "duart68681" );
+ state->duart68681 = machine.device( "duart68681" );
memset(i82716.dram, 0, 0x40000);
i82716.r[RWBA] = 0x0200;
}
@@ -1017,9 +1017,9 @@ static MACHINE_RESET( maygayv1 )
static INTERRUPT_GEN( vsync_interrupt )
{
- maygayv1_state *state = device->machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = device->machine().driver_data<maygayv1_state>();
if (state->vsync_latch_preset)
- cputag_set_input_line(device->machine, "maincpu", 3, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 3, ASSERT_LINE);
}
@@ -1137,7 +1137,7 @@ ROM_END
static DRIVER_INIT( screenpl )
{
- maygayv1_state *state = machine->driver_data<maygayv1_state>();
+ maygayv1_state *state = machine.driver_data<maygayv1_state>();
state->p1 = state->p3 = 0xff;
}
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index 21919046a75..dc23f8bf6b9 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -41,7 +41,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- mayumi_state *state = machine->driver_data<mayumi_state>();
+ mayumi_state *state = machine.driver_data<mayumi_state>();
int code = state->videoram[tile_index] + (state->videoram[tile_index + 0x800] & 0x1f) * 0x100;
int col = (state->videoram[tile_index + 0x1000] >> 3) & 0x1f;
@@ -50,20 +50,20 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( mayumi )
{
- mayumi_state *state = machine->driver_data<mayumi_state>();
+ mayumi_state *state = machine.driver_data<mayumi_state>();
state->tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static WRITE8_HANDLER( mayumi_videoram_w )
{
- mayumi_state *state = space->machine->driver_data<mayumi_state>();
+ mayumi_state *state = space->machine().driver_data<mayumi_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset & 0x7ff);
}
static SCREEN_UPDATE( mayumi )
{
- mayumi_state *state = screen->machine->driver_data<mayumi_state>();
+ mayumi_state *state = screen->machine().driver_data<mayumi_state>();
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
}
@@ -76,7 +76,7 @@ static SCREEN_UPDATE( mayumi )
static INTERRUPT_GEN( mayumi_interrupt )
{
- mayumi_state *state = device->machine->driver_data<mayumi_state>();
+ mayumi_state *state = device->machine().driver_data<mayumi_state>();
if (state->int_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -90,25 +90,25 @@ static INTERRUPT_GEN( mayumi_interrupt )
static WRITE8_HANDLER( bank_sel_w )
{
- mayumi_state *state = space->machine->driver_data<mayumi_state>();
+ mayumi_state *state = space->machine().driver_data<mayumi_state>();
int bank = BIT(data, 7) | (BIT(data, 6) << 1);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
state->int_enable = data & 1;
- flip_screen_set(space->machine, data & 2);
+ flip_screen_set(space->machine(), data & 2);
}
static WRITE8_HANDLER( input_sel_w )
{
- mayumi_state *state = space->machine->driver_data<mayumi_state>();
+ mayumi_state *state = space->machine().driver_data<mayumi_state>();
state->input_sel = data;
}
static READ8_HANDLER( key_matrix_r )
{
- mayumi_state *state = space->machine->driver_data<mayumi_state>();
+ mayumi_state *state = space->machine().driver_data<mayumi_state>();
int p, i, ret;
static const char *const keynames[2][5] =
{
@@ -123,7 +123,7 @@ static READ8_HANDLER( key_matrix_r )
for (i = 0; i < 5; i++)
{
if (BIT(p, i))
- ret &= input_port_read(space->machine, keynames[offset][i]);
+ ret &= input_port_read(space->machine(), keynames[offset][i]);
}
return ret;
@@ -349,8 +349,8 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mayumi )
{
- mayumi_state *state = machine->driver_data<mayumi_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ mayumi_state *state = machine.driver_data<mayumi_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
memory_set_bank(machine, "bank1", 0);
@@ -361,7 +361,7 @@ static MACHINE_START( mayumi )
static MACHINE_RESET( mayumi )
{
- mayumi_state *state = machine->driver_data<mayumi_state>();
+ mayumi_state *state = machine.driver_data<mayumi_state>();
state->int_enable = 0;
state->input_sel = 0;
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 1c000f51f33..d2c473ae8b3 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -125,7 +125,7 @@ public:
static PALETTE_INIT( mazerbla )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
static const int resistances_r[2] = { 4700, 2200 };
static const int resistances_gb[3] = { 10000, 4700, 2200 };
@@ -139,7 +139,7 @@ static PALETTE_INIT( mazerbla )
static VIDEO_START( mazerbla )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
#if 0
state->planes_enabled[0] = state->planes_enabled[1] = state->planes_enabled[2] = state->planes_enabled[3] = 1;
@@ -150,10 +150,10 @@ static VIDEO_START( mazerbla )
state->dbg_lookup = 4;
#endif
- state->tmpbitmaps[0] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmaps[1] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmaps[2] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmaps[3] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmaps[0] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmaps[1] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmaps[2] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmaps[3] = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->tmpbitmaps[0]));
state->save_item(NAME(*state->tmpbitmaps[1]));
@@ -165,7 +165,7 @@ static VIDEO_START( mazerbla )
SCREEN_UPDATE( test_vcu )
{
- mazerbla_state *state = screen->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = screen->machine().driver_data<mazerbla_state>();
int *planes_enabled = state->planes_enabled;
char buf[128];
@@ -198,38 +198,38 @@ SCREEN_UPDATE( test_vcu )
bitmap_fill(state->tmpbitmaps[0], NULL, color_base);
- if (input_code_pressed_once(screen->machine, KEYCODE_1)) /* plane 1 */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_1)) /* plane 1 */
planes_enabled[0] ^= 1;
- if (input_code_pressed_once(screen->machine, KEYCODE_2)) /* plane 2 */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_2)) /* plane 2 */
planes_enabled[1] ^= 1;
- if (input_code_pressed_once(screen->machine, KEYCODE_3)) /* plane 3 */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_3)) /* plane 3 */
planes_enabled[2] ^= 1;
- if (input_code_pressed_once(screen->machine, KEYCODE_4)) /* plane 4 */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_4)) /* plane 4 */
planes_enabled[3] ^= 1;
- if (input_code_pressed_once(screen->machine, KEYCODE_I)) /* show/hide debug info */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_I)) /* show/hide debug info */
state->dbg_info = !state->dbg_info;
- if (input_code_pressed_once(screen->machine, KEYCODE_G)) /* enable gfx area handling */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_G)) /* enable gfx area handling */
state->dbg_gfx_e = !state->dbg_gfx_e;
- if (input_code_pressed_once(screen->machine, KEYCODE_C)) /* enable color area handling */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_C)) /* enable color area handling */
state->dbg_clr_e = !state->dbg_clr_e;
- if (input_code_pressed_once(screen->machine, KEYCODE_V)) /* draw only when vbank==dbg_vbank */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_V)) /* draw only when vbank==dbg_vbank */
state->dbg_vbank ^= 1;
- if (input_code_pressed_once(screen->machine, KEYCODE_L)) /* showlookup ram */
+ if (input_code_pressed_once(screen->machine(), KEYCODE_L)) /* showlookup ram */
state->dbg_lookup = (state->dbg_lookup + 1) % 5; //0,1,2,3, 4-off
if (state->dbg_info)
{
sprintf(buf,"I-info, G-gfx, C-color, V-vbank, 1-4 enable planes");
- ui_draw_text(buf, 10, 0 * ui_get_line_height(*screen->machine));
+ ui_draw_text(buf, 10, 0 * ui_get_line_height(screen->machine()));
sprintf(buf,"g:%1i c:%1i v:%1i vbk=%1i planes=%1i%1i%1i%1i ", state->dbg_gfx_e&1, state->dbg_clr_e&1, state->dbg_vbank, vbank&1,
planes_enabled[0],
@@ -237,7 +237,7 @@ SCREEN_UPDATE( test_vcu )
planes_enabled[2],
planes_enabled[3] );
- ui_draw_text(buf, 10, 1 * ui_get_line_height(*screen->machine));
+ ui_draw_text(buf, 10, 1 * ui_get_line_height(screen->machine()));
if (state->dbg_lookup!=4)
{
@@ -252,7 +252,7 @@ SCREEN_UPDATE( test_vcu )
{
sprintf(buf + strlen(buf), "%02x ", lookup_ram[lookup_offs + x + y * 16]);
}
- ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(*screen->machine));
+ ui_draw_text(buf, 0, (2 + y) * ui_get_line_height(screen->machine()));
}
}
}
@@ -264,7 +264,7 @@ SCREEN_UPDATE( test_vcu )
static SCREEN_UPDATE( mazerbla )
{
- mazerbla_state *state = screen->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = screen->machine().driver_data<mazerbla_state>();
UINT32 color_base = 0;
if (state->game_id == MAZERBLA)
@@ -285,7 +285,7 @@ static SCREEN_UPDATE( mazerbla )
static WRITE8_HANDLER( cfb_backgnd_color_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
if (state->bknd_col != data)
{
@@ -310,7 +310,7 @@ static WRITE8_HANDLER( cfb_backgnd_color_w )
bit0 = BIT(data, 0);
b = combine_3_weights(state->weights_b, bit0, bit1, bit2);
- palette_set_color(space->machine, 255, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), 255, MAKE_RGB(r, g, b));
//logerror("background color (port 01) write=%02x\n",data);
}
}
@@ -318,7 +318,7 @@ static WRITE8_HANDLER( cfb_backgnd_color_w )
static WRITE8_HANDLER( cfb_vbank_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
/* only bit 6 connected */
state->vbank = BIT(data, 6);
@@ -327,25 +327,25 @@ static WRITE8_HANDLER( cfb_vbank_w )
static WRITE8_HANDLER( cfb_rom_bank_sel_w ) /* mazer blazer */
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->gfx_rom_bank = data;
- memory_set_bankptr(space->machine, "bank1", space->machine->region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000);
}
static WRITE8_HANDLER( cfb_rom_bank_sel_w_gg ) /* great guns */
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->gfx_rom_bank = data >> 1;
- memory_set_bankptr(space->machine, "bank1", space->machine->region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000);
}
/* VCU status? */
static READ8_HANDLER( cfb_port_02_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->port02_status ^= 0xff;
return state->port02_status;
}
@@ -353,7 +353,7 @@ static READ8_HANDLER( cfb_port_02_r )
static WRITE8_HANDLER( vcu_video_reg_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
if (state->vcu_video_reg[offset] != data)
{
state->vcu_video_reg[offset] = data;
@@ -364,7 +364,7 @@ static WRITE8_HANDLER( vcu_video_reg_w )
static READ8_HANDLER( vcu_set_cmd_param_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->vcu_gfx_param_addr = offset;
/* offset = 0 is not known */
@@ -384,8 +384,8 @@ static READ8_HANDLER( vcu_set_cmd_param_r )
static READ8_HANDLER( vcu_set_gfx_addr_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
- UINT8 * rom = space->machine->region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000;
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
+ UINT8 * rom = space->machine().region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -531,8 +531,8 @@ static READ8_HANDLER( vcu_set_gfx_addr_r )
static READ8_HANDLER( vcu_set_clr_addr_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
- UINT8 * rom = space->machine->region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000;
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
+ UINT8 * rom = space->machine().region("sub2")->base() + (state->gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -659,7 +659,7 @@ static READ8_HANDLER( vcu_set_clr_addr_r )
b = combine_3_weights(state->weights_b, bit0, bit1, bit2);
if ((x + y * 16) < 255)//keep color 255 free for use as background color
- palette_set_color(space->machine, x + y * 16, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), x + y * 16, MAKE_RGB(r, g, b));
state->lookup_ram[lookup_offs + x + y * 16] = colour;
}
@@ -731,7 +731,7 @@ static READ8_HANDLER( vcu_set_clr_addr_r )
static WRITE8_HANDLER( cfb_zpu_int_req_set_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->zpu_int_vector &= ~2; /* clear D1 on INTA (interrupt acknowledge) */
@@ -740,7 +740,7 @@ static WRITE8_HANDLER( cfb_zpu_int_req_set_w )
static READ8_HANDLER( cfb_zpu_int_req_clr )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->zpu_int_vector |= 2;
@@ -753,17 +753,17 @@ static READ8_HANDLER( cfb_zpu_int_req_clr )
static READ8_HANDLER( ls670_0_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->ls670_0[offset];
}
static TIMER_CALLBACK( deferred_ls670_0_w )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
int offset = (param >> 8) & 255;
int data = param & 255;
@@ -773,22 +773,22 @@ static TIMER_CALLBACK( deferred_ls670_0_w )
static WRITE8_HANDLER( ls670_0_w )
{
/* do this on a timer to let the CPUs synchronize */
- space->machine->scheduler().synchronize(FUNC(deferred_ls670_0_w), (offset << 8) | data);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls670_0_w), (offset << 8) | data);
}
static READ8_HANDLER( ls670_1_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->ls670_1[offset];
}
static TIMER_CALLBACK( deferred_ls670_1_w )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
int offset = (param >> 8) & 255;
int data = param & 255;
@@ -798,7 +798,7 @@ static TIMER_CALLBACK( deferred_ls670_1_w )
static WRITE8_HANDLER( ls670_1_w )
{
/* do this on a timer to let the CPUs synchronize */
- space->machine->scheduler().synchronize(FUNC(deferred_ls670_1_w), (offset << 8) | data);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls670_1_w), (offset << 8) | data);
}
@@ -856,7 +856,7 @@ Vertical movement of gun is Strobe 9, Bits 0-7.
static WRITE8_HANDLER( zpu_bcd_decoder_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
/* bcd decoder used a input select (a mux) for reads from port 0x62 */
state->bcd_7445 = data & 0xf;
@@ -864,13 +864,13 @@ static WRITE8_HANDLER( zpu_bcd_decoder_w )
static READ8_HANDLER( zpu_inputs_r )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y",
"STICK1_X", "STICK1_Y", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED" };
UINT8 ret = 0;
- ret = input_port_read(space->machine, strobenames[state->bcd_7445]);
+ ret = input_port_read(space->machine(), strobenames[state->bcd_7445]);
return ret;
}
@@ -879,7 +879,7 @@ static WRITE8_HANDLER( zpu_led_w )
{
/* 0x6e - reset (offset = 0)*/
/* 0x6f - set */
- set_led_status(space->machine, 0, offset & 1);
+ set_led_status(space->machine(), 0, offset & 1);
}
static WRITE8_HANDLER( zpu_lamps_w)
@@ -887,26 +887,26 @@ static WRITE8_HANDLER( zpu_lamps_w)
/* bit 4 = /LAMP0 */
/* bit 5 = /LAMP1 */
- /*set_led_status(space->machine, 0, (data & 0x10) >> 4);*/
- /*set_led_status(space->machine, 1, (data & 0x20) >> 4);*/
+ /*set_led_status(space->machine(), 0, (data & 0x10) >> 4);*/
+ /*set_led_status(space->machine(), 1, (data & 0x20) >> 4);*/
}
static WRITE8_HANDLER( zpu_coin_counter_w )
{
/* bit 6 = coin counter */
- coin_counter_w(space->machine, offset, BIT(data, 6));
+ coin_counter_w(space->machine(), offset, BIT(data, 6));
}
static WRITE8_HANDLER(cfb_led_w)
{
/* bit 7 - led on */
- set_led_status(space->machine, 2, BIT(data, 7));
+ set_led_status(space->machine(), 2, BIT(data, 7));
}
static WRITE8_DEVICE_HANDLER( gg_led_ctrl_w )
{
/* bit 0, bit 1 - led on */
- set_led_status(device->machine, 1, BIT(data, 0));
+ set_led_status(device->machine(), 1, BIT(data, 0));
}
@@ -918,22 +918,22 @@ static WRITE8_DEVICE_HANDLER( gg_led_ctrl_w )
static WRITE8_HANDLER( vsb_ls273_audio_control_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
state->vsb_ls273 = data;
/* bit 5 - led on */
- set_led_status(space->machine, 1, BIT(data, 5));
+ set_led_status(space->machine(), 1, BIT(data, 5));
}
static READ8_DEVICE_HANDLER( soundcommand_r )
{
- mazerbla_state *state = device->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = device->machine().driver_data<mazerbla_state>();
return state->soundlatch;
}
static TIMER_CALLBACK( delayed_sound_w )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
state->soundlatch = param;
/* cause NMI on sound CPU */
@@ -942,18 +942,18 @@ static TIMER_CALLBACK( delayed_sound_w )
static WRITE8_HANDLER( main_sound_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
static WRITE8_HANDLER( sound_int_clear_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
device_set_input_line(state->subcpu, 0, CLEAR_LINE);
}
static WRITE8_HANDLER( sound_nmi_clear_w )
{
- mazerbla_state *state = space->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = space->machine().driver_data<mazerbla_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -1395,7 +1395,7 @@ static IRQ_CALLBACK(irq_callback)
note:
1111 11110 (0xfe) - cannot happen and is not handled by game */
- mazerbla_state *state = device->machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = device->machine().driver_data<mazerbla_state>();
return (state->zpu_int_vector & ~1); /* D0->GND is performed on CFB board */
}
@@ -1414,10 +1414,10 @@ static INTERRUPT_GEN( sound_interrupt )
static MACHINE_START( mazerbla )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->vcu_video_reg));
state->save_item(NAME(state->vcu_gfx_addr));
@@ -1450,7 +1450,7 @@ static MACHINE_START( mazerbla )
static MACHINE_RESET( mazerbla )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
int i;
state->zpu_int_vector = 0xff;
@@ -1483,7 +1483,7 @@ static MACHINE_RESET( mazerbla )
memset(state->lookup_ram, 0, ARRAY_LENGTH(state->lookup_ram));
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
@@ -1692,14 +1692,14 @@ ROM_END
static DRIVER_INIT( mazerbla )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
state->game_id = MAZERBLA;
}
static DRIVER_INIT( greatgun )
{
- mazerbla_state *state = machine->driver_data<mazerbla_state>();
- UINT8 *rom = machine->region("sub2")->base();
+ mazerbla_state *state = machine.driver_data<mazerbla_state>();
+ UINT8 *rom = machine.region("sub2")->base();
state->game_id = GREATGUN;
diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c
index 3a7236b9487..6fab17eb973 100644
--- a/src/mame/drivers/mcatadv.c
+++ b/src/mame/drivers/mcatadv.c
@@ -146,7 +146,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
static WRITE16_HANDLER( mcat_soundlatch_w )
{
- mcatadv_state *state = space->machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = space->machine().driver_data<mcatadv_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -157,10 +157,10 @@ static WRITE16_HANDLER( mcat_coin_w )
{
if(ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x1000);
- coin_counter_w(space->machine, 1, data & 0x2000);
- coin_lockout_w(space->machine, 0, ~data & 0x4000);
- coin_lockout_w(space->machine, 1, ~data & 0x8000);
+ coin_counter_w(space->machine(), 0, data & 0x1000);
+ coin_counter_w(space->machine(), 1, data & 0x2000);
+ coin_lockout_w(space->machine(), 0, ~data & 0x4000);
+ coin_lockout_w(space->machine(), 1, ~data & 0x8000);
}
}
#endif
@@ -207,7 +207,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER ( mcatadv_sound_bw_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
@@ -416,7 +416,7 @@ GFXDECODE_END
/* Stolen from Psikyo.c */
static void sound_irq( device_t *device, int irq )
{
- mcatadv_state *state = device->machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = device->machine().driver_data<mcatadv_state>();
device_set_input_line(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -428,14 +428,14 @@ static const ym2610_interface mcatadv_ym2610_interface =
static MACHINE_START( mcatadv )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
memory_set_bank(machine, "bank1", 1);
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->palette_bank1));
state->save_item(NAME(state->palette_bank2));
diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c
index 94ed9fcc3c4..4d3412587fd 100644
--- a/src/mame/drivers/mcr.c
+++ b/src/mame/drivers/mcr.c
@@ -321,9 +321,9 @@ static READ8_HANDLER( solarfox_ip0_r )
/* game in cocktail mode, they don't work at all. So we fake-mux */
/* the controls through player 1's ports */
if (mcr_cocktail_flip)
- return input_port_read(space->machine, "SSIO.IP0") | 0x08;
+ return input_port_read(space->machine(), "SSIO.IP0") | 0x08;
else
- return ((input_port_read(space->machine, "SSIO.IP0") & ~0x14) | 0x08) | ((input_port_read(space->machine, "SSIO.IP0") & 0x08) >> 1) | ((input_port_read(space->machine, "SSIO.IP2") & 0x01) << 4);
+ return ((input_port_read(space->machine(), "SSIO.IP0") & ~0x14) | 0x08) | ((input_port_read(space->machine(), "SSIO.IP0") & 0x08) >> 1) | ((input_port_read(space->machine(), "SSIO.IP2") & 0x01) << 4);
}
@@ -331,9 +331,9 @@ static READ8_HANDLER( solarfox_ip1_r )
{
/* same deal as above */
if (mcr_cocktail_flip)
- return input_port_read(space->machine, "SSIO.IP1") | 0xf0;
+ return input_port_read(space->machine(), "SSIO.IP1") | 0xf0;
else
- return (input_port_read(space->machine, "SSIO.IP1") >> 4) | 0xf0;
+ return (input_port_read(space->machine(), "SSIO.IP1") >> 4) | 0xf0;
}
@@ -346,7 +346,7 @@ static READ8_HANDLER( solarfox_ip1_r )
static READ8_HANDLER( kick_ip1_r )
{
- return (input_port_read(space->machine, "DIAL2") << 4) & 0xf0;
+ return (input_port_read(space->machine(), "DIAL2") << 4) & 0xf0;
}
@@ -366,18 +366,18 @@ static WRITE8_HANDLER( wacko_op4_w )
static READ8_HANDLER( wacko_ip1_r )
{
if (!input_mux)
- return input_port_read(space->machine, "SSIO.IP1");
+ return input_port_read(space->machine(), "SSIO.IP1");
else
- return input_port_read(space->machine, "SSIO.IP1.ALT");
+ return input_port_read(space->machine(), "SSIO.IP1.ALT");
}
static READ8_HANDLER( wacko_ip2_r )
{
if (!input_mux)
- return input_port_read(space->machine, "SSIO.IP2");
+ return input_port_read(space->machine(), "SSIO.IP2");
else
- return input_port_read(space->machine, "SSIO.IP2.ALT");
+ return input_port_read(space->machine(), "SSIO.IP2.ALT");
}
@@ -390,7 +390,7 @@ static READ8_HANDLER( wacko_ip2_r )
static READ8_HANDLER( kroozr_ip1_r )
{
- int dial = input_port_read(space->machine, "DIAL");
+ int dial = input_port_read(space->machine(), "DIAL");
return ((dial & 0x80) >> 1) | ((dial & 0x70) >> 4);
}
@@ -414,7 +414,7 @@ static WRITE8_HANDLER( kroozr_op4_w )
static WRITE8_HANDLER( journey_op4_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
/* if we're not playing the sample yet, start it */
if (!sample_playing(samples, 0))
@@ -535,7 +535,7 @@ static READ8_HANDLER( nflfoot_ip2_r )
static WRITE8_HANDLER( nflfoot_op4_w )
{
- device_t *sio = space->machine->device("ipu_sio");
+ device_t *sio = space->machine().device("ipu_sio");
/* bit 7 = J3-7 on IPU board = /RXDA on SIO */
logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(space->cpu), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1);
@@ -587,15 +587,15 @@ static WRITE8_HANDLER( nflfoot_op4_w )
static READ8_HANDLER( demoderb_ip1_r )
{
- return input_port_read(space->machine, "SSIO.IP1") |
- (input_port_read(space->machine, input_mux ? "SSIO.IP1.ALT2" : "SSIO.IP1.ALT1") << 2);
+ return input_port_read(space->machine(), "SSIO.IP1") |
+ (input_port_read(space->machine(), input_mux ? "SSIO.IP1.ALT2" : "SSIO.IP1.ALT1") << 2);
}
static READ8_HANDLER( demoderb_ip2_r )
{
- return input_port_read(space->machine, "SSIO.IP2") |
- (input_port_read(space->machine, input_mux ? "SSIO.IP2.ALT2" : "SSIO.IP2.ALT1") << 2);
+ return input_port_read(space->machine(), "SSIO.IP2") |
+ (input_port_read(space->machine(), input_mux ? "SSIO.IP2.ALT2" : "SSIO.IP2.ALT1") << 2);
}
@@ -2521,7 +2521,7 @@ ROM_END
*
*************************************/
-static void mcr_init(running_machine *machine, int cpuboard, int vidboard, int ssioboard)
+static void mcr_init(running_machine &machine, int cpuboard, int vidboard, int ssioboard)
{
mcr_cpu_board = cpuboard;
mcr_sprite_board = vidboard;
@@ -2580,7 +2580,7 @@ static DRIVER_INIT( twotiger )
mcr_init(machine, 90010, 91399, 90913);
mcr_sound_init(machine, MCR_SSIO);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe800, 0xefff, 0, 0x1000, FUNC(twotiger_videoram_r), FUNC(twotiger_videoram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe800, 0xefff, 0, 0x1000, FUNC(twotiger_videoram_r), FUNC(twotiger_videoram_w));
}
@@ -2649,7 +2649,7 @@ static DRIVER_INIT( demoderb )
ssio_set_custom_output(4, 0xff, demoderb_op4_w);
/* the SSIO Z80 doesn't have any program to execute */
- machine->device<cpu_device>("tcscpu")->suspend(SUSPEND_REASON_DISABLE, 1);
+ machine.device<cpu_device>("tcscpu")->suspend(SUSPEND_REASON_DISABLE, 1);
}
diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c
index da96527fc0f..031497e8998 100644
--- a/src/mame/drivers/mcr3.c
+++ b/src/mame/drivers/mcr3.c
@@ -131,7 +131,7 @@ static WRITE8_HANDLER( mcrmono_control_port_w )
D0 = coin meter 1
*/
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
mcr_cocktail_flip = (data >> 6) & 1;
}
@@ -144,23 +144,23 @@ static WRITE8_HANDLER( mcrmono_control_port_w )
static READ8_HANDLER( demoderm_ip1_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
- return input_port_read(space->machine, "MONO.IP1") |
- (input_port_read(space->machine, state->input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2);
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
+ return input_port_read(space->machine(), "MONO.IP1") |
+ (input_port_read(space->machine(), state->input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1") << 2);
}
static READ8_HANDLER( demoderm_ip2_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
- return input_port_read(space->machine, "MONO.IP2") |
- (input_port_read(space->machine, state->input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2);
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
+ return input_port_read(space->machine(), "MONO.IP2") |
+ (input_port_read(space->machine(), state->input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1") << 2);
}
static WRITE8_HANDLER( demoderm_op6_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* top 2 bits select the input */
if (data & 0x80) state->input_mux = 0;
if (data & 0x40) state->input_mux = 1;
@@ -179,17 +179,17 @@ static WRITE8_HANDLER( demoderm_op6_w )
static READ8_HANDLER( maxrpm_ip1_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
return state->latched_input;
}
static READ8_HANDLER( maxrpm_ip2_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 };
- UINT8 start = input_port_read(space->machine, "MONO.IP0");
- UINT8 shift = input_port_read(space->machine, "SHIFT");
+ UINT8 start = input_port_read(space->machine(), "MONO.IP0");
+ UINT8 shift = input_port_read(space->machine(), "SHIFT");
/* reset on a start */
if (!(start & 0x08))
@@ -231,7 +231,7 @@ static READ8_HANDLER( maxrpm_ip2_r )
static WRITE8_HANDLER( maxrpm_op5_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* latch the low 4 bits as input to the ADC0844 */
state->maxrpm_adc_control = data & 0x0f;
@@ -242,7 +242,7 @@ static WRITE8_HANDLER( maxrpm_op5_w )
static WRITE8_HANDLER( maxrpm_op6_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
static const char *const inputs[] = { "MONO.IP1", "MONO.IP1.ALT1", "MONO.IP1.ALT2", "MONO.IP1.ALT3" };
/*
Reflective Sensor Control:
@@ -264,7 +264,7 @@ static WRITE8_HANDLER( maxrpm_op6_w )
/* when the read is toggled is when the ADC value is latched */
if (!(data & 0x80))
- state->latched_input = input_port_read(space->machine, inputs[state->maxrpm_adc_select]);
+ state->latched_input = input_port_read(space->machine(), inputs[state->maxrpm_adc_select]);
/* when both the write and the enable are low, it's a write to the ADC0844 */
/* unfortunately the behavior below doesn't match up with the inputs on the */
@@ -286,14 +286,14 @@ static WRITE8_HANDLER( maxrpm_op6_w )
static READ8_HANDLER( rampage_ip4_r )
{
- return input_port_read(space->machine, "MONO.IP4") | (soundsgood_status_r(space,0) << 7);
+ return input_port_read(space->machine(), "MONO.IP4") | (soundsgood_status_r(space,0) << 7);
}
static WRITE8_HANDLER( rampage_op6_w )
{
/* bit 5 controls reset of the Sounds Good board */
- soundsgood_reset_w(space->machine, (~data >> 5) & 1);
+ soundsgood_reset_w(space->machine(), (~data >> 5) & 1);
/* low 5 bits go directly to the Sounds Good board */
soundsgood_data_w(space, offset, data);
@@ -309,7 +309,7 @@ static WRITE8_HANDLER( rampage_op6_w )
static READ8_HANDLER( powerdrv_ip2_r )
{
- return input_port_read(space->machine, "MONO.IP2") | (soundsgood_status_r(space, 0) << 7);
+ return input_port_read(space->machine(), "MONO.IP2") | (soundsgood_status_r(space, 0) << 7);
}
@@ -325,9 +325,9 @@ static WRITE8_HANDLER( powerdrv_op5_w )
/* bit 3 -> J1-10 = lamp 1 */
/* bit 2 -> J1-8 = lamp 2 */
/* bit 1 -> J1-6 = lamp 3 */
- set_led_status(space->machine, 0, (data >> 3) & 1);
- set_led_status(space->machine, 1, (data >> 2) & 1);
- set_led_status(space->machine, 2, (data >> 1) & 1);
+ set_led_status(space->machine(), 0, (data >> 3) & 1);
+ set_led_status(space->machine(), 1, (data >> 2) & 1);
+ set_led_status(space->machine(), 2, (data >> 1) & 1);
/* remaining bits go to standard connections */
mcrmono_control_port_w(space, offset, data);
@@ -337,7 +337,7 @@ static WRITE8_HANDLER( powerdrv_op5_w )
static WRITE8_HANDLER( powerdrv_op6_w )
{
/* bit 5 controls reset of the Sounds Good board */
- soundsgood_reset_w(space->machine, (~data >> 5) & 1);
+ soundsgood_reset_w(space->machine(), (~data >> 5) & 1);
/* low 5 bits go directly to the Sounds Good board */
soundsgood_data_w(space, offset, data);
@@ -353,26 +353,26 @@ static WRITE8_HANDLER( powerdrv_op6_w )
static READ8_HANDLER( stargrds_ip0_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
- UINT8 result = input_port_read(space->machine, "MONO.IP0");
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
+ UINT8 result = input_port_read(space->machine(), "MONO.IP0");
if (state->input_mux)
- result = (result & ~0x0a) | (input_port_read(space->machine, "MONO.IP0.ALT") & 0x0a);
+ result = (result & ~0x0a) | (input_port_read(space->machine(), "MONO.IP0.ALT") & 0x0a);
return (result & ~0x10) | ((soundsgood_status_r(space, 0) << 4) & 0x10);
}
static WRITE8_HANDLER( stargrds_op5_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* bit 1 controls input muxing on port 0 */
state->input_mux = (data >> 1) & 1;
/* bit 2 controls light #0 */
/* bit 3 controls light #1 */
/* bit 4 controls light #2 */
- set_led_status(space->machine, 0, (data >> 2) & 1);
- set_led_status(space->machine, 1, (data >> 3) & 1);
- set_led_status(space->machine, 2, (data >> 4) & 1);
+ set_led_status(space->machine(), 0, (data >> 2) & 1);
+ set_led_status(space->machine(), 1, (data >> 3) & 1);
+ set_led_status(space->machine(), 2, (data >> 4) & 1);
/* remaining bits go to standard connections */
mcrmono_control_port_w(space, offset, data);
@@ -382,7 +382,7 @@ static WRITE8_HANDLER( stargrds_op5_w )
static WRITE8_HANDLER( stargrds_op6_w )
{
/* bit 6 controls reset of the Sounds Good board */
- soundsgood_reset_w(space->machine, (~data >> 6) & 1);
+ soundsgood_reset_w(space->machine(), (~data >> 6) & 1);
/* unline the other games, the STROBE is in the high bit instead of the low bit */
soundsgood_data_w(space, offset, (data << 1) | (data >> 7));
@@ -398,21 +398,21 @@ static WRITE8_HANDLER( stargrds_op6_w )
static READ8_HANDLER( spyhunt_ip1_r )
{
- return input_port_read(space->machine, "SSIO.IP1") | (csdeluxe_status_r(space, 0) << 5);
+ return input_port_read(space->machine(), "SSIO.IP1") | (csdeluxe_status_r(space, 0) << 5);
}
static READ8_HANDLER( spyhunt_ip2_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* multiplexed steering wheel/gas pedal */
- return input_port_read(space->machine, state->input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
+ return input_port_read(space->machine(), state->input_mux ? "SSIO.IP2.ALT" : "SSIO.IP2");
}
static WRITE8_HANDLER( spyhunt_op4_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* Spy Hunter uses port 4 for talking to the Chip Squeak Deluxe */
/* (and for toggling the lamps and muxing the analog inputs) */
@@ -457,12 +457,12 @@ static WRITE8_HANDLER( spyhunt_op4_w )
static READ8_HANDLER( turbotag_ip2_r )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
/* multiplexed steering wheel/gas pedal */
if (state->input_mux)
- return input_port_read(space->machine, "SSIO.IP2.ALT");
+ return input_port_read(space->machine(), "SSIO.IP2.ALT");
- return input_port_read(space->machine, "SSIO.IP2") + 5 * (space->machine->primary_screen->frame_number() & 1);
+ return input_port_read(space->machine(), "SSIO.IP2") + 5 * (space->machine().primary_screen->frame_number() & 1);
}
@@ -1527,9 +1527,9 @@ ROM_END
*
*************************************/
-static void mcr_common_init(running_machine *machine, int sound_board)
+static void mcr_common_init(running_machine &machine, int sound_board)
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
mcr_sound_init(machine, sound_board);
state_save_register_global(machine, state->input_mux);
@@ -1541,27 +1541,27 @@ static void mcr_common_init(running_machine *machine, int sound_board)
static DRIVER_INIT( demoderm )
{
mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(demoderm_ip1_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(demoderm_ip2_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(demoderm_op6_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(demoderm_ip1_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(demoderm_ip2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(demoderm_op6_w));
}
static DRIVER_INIT( sarge )
{
mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(turbocs_data_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(turbocs_data_w));
}
static DRIVER_INIT( maxrpm )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(maxrpm_ip1_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(maxrpm_ip2_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(maxrpm_op5_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(maxrpm_op6_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x01, 0x01, FUNC(maxrpm_ip1_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(maxrpm_ip2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(maxrpm_op5_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(maxrpm_op6_w));
state_save_register_global(machine, state->maxrpm_adc_control);
state_save_register_global(machine, state->maxrpm_adc_select);
@@ -1574,32 +1574,32 @@ static DRIVER_INIT( maxrpm )
static DRIVER_INIT( rampage )
{
mcr_common_init(machine, MCR_SOUNDS_GOOD);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(rampage_ip4_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(rampage_op6_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(rampage_ip4_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(rampage_op6_w));
}
static DRIVER_INIT( powerdrv )
{
mcr_common_init(machine, MCR_SOUNDS_GOOD);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(powerdrv_ip2_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(powerdrv_op5_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(powerdrv_op6_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x02, 0x02, FUNC(powerdrv_ip2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(powerdrv_op5_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(powerdrv_op6_w));
}
static DRIVER_INIT( stargrds )
{
mcr_common_init(machine, MCR_SOUNDS_GOOD);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(stargrds_ip0_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(stargrds_op5_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(stargrds_op6_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(stargrds_ip0_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x05, 0x05, FUNC(stargrds_op5_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x06, 0x06, FUNC(stargrds_op6_w));
}
static DRIVER_INIT( spyhunt )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE);
ssio_set_custom_input(1, 0x60, spyhunt_ip1_r);
ssio_set_custom_input(2, 0xff, spyhunt_ip2_r);
@@ -1612,7 +1612,7 @@ static DRIVER_INIT( spyhunt )
static DRIVER_INIT( crater )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
mcr_common_init(machine, MCR_SSIO);
state->spyhunt_sprite_color_mask = 0x03;
@@ -1622,7 +1622,7 @@ static DRIVER_INIT( crater )
static DRIVER_INIT( turbotag )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
mcr_common_init(machine, MCR_SSIO | MCR_CHIP_SQUEAK_DELUXE);
ssio_set_custom_input(1, 0x60, spyhunt_ip1_r);
ssio_set_custom_input(2, 0xff, turbotag_ip2_r);
@@ -1632,10 +1632,10 @@ static DRIVER_INIT( turbotag )
state->spyhunt_scroll_offset = 88;
/* the SSIO Z80 doesn't have any program to execute */
- machine->device<cpu_device>("csdcpu")->suspend(SUSPEND_REASON_DISABLE, 1);
+ machine.device<cpu_device>("csdcpu")->suspend(SUSPEND_REASON_DISABLE, 1);
/* kludge for bad ROM read */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0b53, 0x0b53, FUNC(turbotag_kludge_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0b53, 0x0b53, FUNC(turbotag_kludge_r));
}
diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c
index b19f2758005..3635e3c2bb0 100644
--- a/src/mame/drivers/mcr68.c
+++ b/src/mame/drivers/mcr68.c
@@ -70,8 +70,8 @@
READ8_DEVICE_HANDLER( zwackery_port_2_r )
{
- int result = input_port_read(device->machine, "IN2");
- int wheel = input_port_read(device->machine, "IN5");
+ int result = input_port_read(device->machine(), "IN2");
+ int wheel = input_port_read(device->machine(), "IN5");
return result | ((wheel >> 2) & 0x3e);
}
@@ -101,7 +101,7 @@ static READ16_HANDLER( zwackery_6840_r )
static WRITE16_HANDLER( xenophobe_control_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
COMBINE_DATA(&state->control_word);
/* soundsgood_reset_w(~state->control_word & 0x0020);*/
soundsgood_data_w(space, offset, ((state->control_word & 0x000f) << 1) | ((state->control_word & 0x0010) >> 4));
@@ -117,7 +117,7 @@ static WRITE16_HANDLER( xenophobe_control_w )
static WRITE16_HANDLER( blasted_control_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
COMBINE_DATA(&state->control_word);
/* soundsgood_reset_w(~state->control_word & 0x0020);*/
soundsgood_data_w(space, offset, (state->control_word >> 8) & 0x1f);
@@ -133,11 +133,11 @@ static WRITE16_HANDLER( blasted_control_w )
static READ16_HANDLER( spyhunt2_port_0_r )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
static const char *const portnames[] = { "AN1", "AN2", "AN3", "AN4" };
- int result = input_port_read(space->machine, "IN0");
+ int result = input_port_read(space->machine(), "IN0");
int which = (state->control_word >> 3) & 3;
- int analog = input_port_read(space->machine, portnames[which]);
+ int analog = input_port_read(space->machine(), portnames[which]);
return result | ((soundsgood_status_r(space, 0) & 1) << 5) | (analog << 8);
}
@@ -145,20 +145,20 @@ static READ16_HANDLER( spyhunt2_port_0_r )
static READ16_HANDLER( spyhunt2_port_1_r )
{
- int result = input_port_read(space->machine, "IN1");
+ int result = input_port_read(space->machine(), "IN1");
return result | ((turbocs_status_r(space, 0) & 1) << 7);
}
static WRITE16_HANDLER( spyhunt2_control_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
COMBINE_DATA(&state->control_word);
/* turbocs_reset_w(~state->control_word & 0x0080);*/
turbocs_data_w(space, offset, (state->control_word >> 8) & 0x001f);
- soundsgood_reset_w(space->machine, ~state->control_word & 0x2000);
+ soundsgood_reset_w(space->machine(), ~state->control_word & 0x2000);
soundsgood_data_w(space, offset, (state->control_word >> 8) & 0x001f);
}
@@ -199,19 +199,19 @@ static const UINT8 translate49[7] = { 0x7, 0x3, 0x1, 0x0, 0xc, 0xe, 0xf };
static READ16_HANDLER( archrivl_port_1_r )
{
- return (translate49[input_port_read(space->machine, "49WAYY2") >> 4] << 12) |
- (translate49[input_port_read(space->machine, "49WAYX2") >> 4] << 8) |
- (translate49[input_port_read(space->machine, "49WAYY1") >> 4] << 4) |
- (translate49[input_port_read(space->machine, "49WAYX1") >> 4] << 0);
+ return (translate49[input_port_read(space->machine(), "49WAYY2") >> 4] << 12) |
+ (translate49[input_port_read(space->machine(), "49WAYX2") >> 4] << 8) |
+ (translate49[input_port_read(space->machine(), "49WAYY1") >> 4] << 4) |
+ (translate49[input_port_read(space->machine(), "49WAYX1") >> 4] << 0);
}
static WRITE16_HANDLER( archrivl_control_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
COMBINE_DATA(&state->control_word);
williams_cvsd_reset_w(~state->control_word & 0x0400);
- williams_cvsd_data_w(space->machine, state->control_word & 0x3ff);
+ williams_cvsd_data_w(space->machine(), state->control_word & 0x3ff);
}
@@ -224,7 +224,7 @@ static WRITE16_HANDLER( archrivl_control_w )
static WRITE16_HANDLER( pigskin_protection_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
/* ignore upper-byte only */
if (ACCESSING_BITS_0_7)
{
@@ -242,7 +242,7 @@ static WRITE16_HANDLER( pigskin_protection_w )
static READ16_HANDLER( pigskin_protection_r )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
/* based on the last 5 bytes return a value */
if (state->protection_data[4] == 0xe3 && state->protection_data[3] == 0x94)
return 0x00; /* must be <= 1 */
@@ -264,18 +264,18 @@ static READ16_HANDLER( pigskin_protection_r )
static READ16_HANDLER( pigskin_port_1_r )
{
/* see archrivl_port_1_r for 49-way joystick description */
- return input_port_read(space->machine, "IN1") |
- (translate49[input_port_read(space->machine, "49WAYX1") >> 4] << 12) |
- (translate49[input_port_read(space->machine, "49WAYY1") >> 4] << 8);
+ return input_port_read(space->machine(), "IN1") |
+ (translate49[input_port_read(space->machine(), "49WAYX1") >> 4] << 12) |
+ (translate49[input_port_read(space->machine(), "49WAYY1") >> 4] << 8);
}
static READ16_HANDLER( pigskin_port_2_r )
{
/* see archrivl_port_1_r for 49-way joystick description */
- return input_port_read(space->machine, "DSW") |
- (translate49[input_port_read(space->machine, "49WAYX2") >> 4] << 12) |
- (translate49[input_port_read(space->machine, "49WAYY2") >> 4] << 8);
+ return input_port_read(space->machine(), "DSW") |
+ (translate49[input_port_read(space->machine(), "49WAYX2") >> 4] << 12) |
+ (translate49[input_port_read(space->machine(), "49WAYY2") >> 4] << 8);
}
@@ -288,9 +288,9 @@ static READ16_HANDLER( pigskin_port_2_r )
static READ16_HANDLER( trisport_port_1_r )
{
- int xaxis = (INT8)input_port_read(space->machine, "AN1");
- int yaxis = (INT8)input_port_read(space->machine, "AN2");
- int result = input_port_read(space->machine, "IN1");
+ int xaxis = (INT8)input_port_read(space->machine(), "AN1");
+ int yaxis = (INT8)input_port_read(space->machine(), "AN2");
+ int result = input_port_read(space->machine(), "IN1");
result |= (xaxis & 0x3c) << 6;
result |= (yaxis & 0x3c) << 10;
@@ -1544,9 +1544,9 @@ ROM_END
*
*************************************/
-static void mcr68_common_init(running_machine *machine, int sound_board, int clip, int xoffset)
+static void mcr68_common_init(running_machine &machine, int sound_board, int clip, int xoffset)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr_sound_init(machine, sound_board);
state->sprite_clip = clip;
@@ -1558,69 +1558,69 @@ static void mcr68_common_init(running_machine *machine, int sound_board, int cli
static DRIVER_INIT( zwackery )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_CHIP_SQUEAK_DELUXE, 0, 0);
/* Zwackery doesn't care too much about this value; currently taken from Blasted */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
}
static DRIVER_INIT( xenophob )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, -4);
/* Xenophobe doesn't care too much about this value; currently taken from Blasted */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
/* install control port handler */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(xenophobe_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(xenophobe_control_w));
}
static DRIVER_INIT( spyhunt2 )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_TURBO_CHIP_SQUEAK | MCR_SOUNDS_GOOD, 0, -6);
/* Spy Hunter 2 doesn't care too much about this value; currently taken from Blasted */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
/* analog port handling is a bit tricky */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(spyhunt2_control_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0d0000, 0x0dffff, FUNC(spyhunt2_port_0_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0e0000, 0x0effff, FUNC(spyhunt2_port_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(spyhunt2_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0d0000, 0x0dffff, FUNC(spyhunt2_port_0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0e0000, 0x0effff, FUNC(spyhunt2_port_1_r));
}
static DRIVER_INIT( blasted )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, 0);
/* Blasted checks the timing of VBLANK relative to the 493 interrupt */
/* VBLANK is required to come within 220-256 E clocks (i.e., 2200-2560 CPU clocks) */
/* after the 493; we also allow 16 E clocks for latency */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
/* handle control writes */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(blasted_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(blasted_control_w));
/* 6840 is mapped to the lower 8 bits */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0a0000, 0x0a000f, FUNC(mcr68_6840_lower_r), FUNC(mcr68_6840_lower_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0a0000, 0x0a000f, FUNC(mcr68_6840_lower_r), FUNC(mcr68_6840_lower_w));
}
static DRIVER_INIT( intlaser )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, 0);
/* Copied from Blasted */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
/* handle control writes */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(blasted_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(blasted_control_w));
}
@@ -1628,30 +1628,30 @@ static DRIVER_INIT( intlaser )
static DRIVER_INIT( archrivl )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
/* Arch Rivals doesn't care too much about this value; currently taken from Blasted */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * (256 + 16);
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * (256 + 16);
/* handle control writes */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(archrivl_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0c0000, 0x0cffff, FUNC(archrivl_control_w));
/* 49-way joystick handling is a bit tricky */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0e0000, 0x0effff, FUNC(archrivl_port_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0e0000, 0x0effff, FUNC(archrivl_port_1_r));
/* 6840 is mapped to the lower 8 bits */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0a0000, 0x0a000f, FUNC(mcr68_6840_lower_r), FUNC(mcr68_6840_lower_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0a0000, 0x0a000f, FUNC(mcr68_6840_lower_r), FUNC(mcr68_6840_lower_w));
}
static DRIVER_INIT( pigskin )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
/* Pigskin doesn't care too much about this value; currently taken from Tri-Sports */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * 115;
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * 115;
state_save_register_global_array(machine, state->protection_data);
}
@@ -1659,13 +1659,13 @@ static DRIVER_INIT( pigskin )
static DRIVER_INIT( trisport )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 0, 0);
/* Tri-Sports checks the timing of VBLANK relative to the 493 interrupt */
/* VBLANK is required to come within 87-119 E clocks (i.e., 870-1190 CPU clocks) */
/* after the 493 */
- state->timing_factor = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10) * 115;
+ state->timing_factor = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10) * 115;
}
diff --git a/src/mame/drivers/meadows.c b/src/mame/drivers/meadows.c
index 410ce8acc6e..d15b4a59d78 100644
--- a/src/mame/drivers/meadows.c
+++ b/src/mame/drivers/meadows.c
@@ -137,21 +137,21 @@
static READ8_HANDLER( hsync_chain_r )
{
- UINT8 val = space->machine->primary_screen->hpos();
+ UINT8 val = space->machine().primary_screen->hpos();
return BITSWAP8(val,0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( vsync_chain_hi_r )
{
- UINT8 val = space->machine->primary_screen->vpos();
+ UINT8 val = space->machine().primary_screen->vpos();
return ((val >> 1) & 0x08) | ((val >> 3) & 0x04) | ((val >> 5) & 0x02) | (val >> 7);
}
static READ8_HANDLER( vsync_chain_lo_r )
{
- UINT8 val = space->machine->primary_screen->vpos();
+ UINT8 val = space->machine().primary_screen->vpos();
return val & 0x0f;
}
@@ -165,7 +165,7 @@ static READ8_HANDLER( vsync_chain_lo_r )
static WRITE8_HANDLER( meadows_audio_w )
{
- meadows_state *state = space->machine->driver_data<meadows_state>();
+ meadows_state *state = space->machine().driver_data<meadows_state>();
switch (offset)
{
case 0:
@@ -199,7 +199,7 @@ static WRITE8_HANDLER( meadows_audio_w )
static INPUT_CHANGED( coin_inserted )
{
- cputag_set_input_line_and_vector(field->port->machine, "maincpu", 0, (newval ? ASSERT_LINE : CLEAR_LINE), 0x82);
+ cputag_set_input_line_and_vector(field->port->machine(), "maincpu", 0, (newval ? ASSERT_LINE : CLEAR_LINE), 0x82);
}
@@ -212,7 +212,7 @@ static INPUT_CHANGED( coin_inserted )
static INTERRUPT_GEN( meadows_interrupt )
{
- meadows_state *state = device->machine->driver_data<meadows_state>();
+ meadows_state *state = device->machine().driver_data<meadows_state>();
/* fake something toggling the sense input line of the S2650 */
state->main_sense_state ^= 1;
device_set_input_line(device, 1, state->main_sense_state ? ASSERT_LINE : CLEAR_LINE);
@@ -228,7 +228,7 @@ static INTERRUPT_GEN( meadows_interrupt )
static INTERRUPT_GEN( minferno_interrupt )
{
- meadows_state *state = device->machine->driver_data<meadows_state>();
+ meadows_state *state = device->machine().driver_data<meadows_state>();
state->main_sense_state++;
device_set_input_line(device, 1, (state->main_sense_state & 0x40) ? ASSERT_LINE : CLEAR_LINE );
}
@@ -243,11 +243,11 @@ static INTERRUPT_GEN( minferno_interrupt )
static WRITE8_HANDLER( audio_hardware_w )
{
- meadows_state *state = space->machine->driver_data<meadows_state>();
+ meadows_state *state = space->machine().driver_data<meadows_state>();
switch (offset & 3)
{
case 0: /* DAC */
- meadows_sh_dac_w(space->machine, data ^ 0xff);
+ meadows_sh_dac_w(space->machine(), data ^ 0xff);
break;
case 1: /* counter clk 5 MHz / 256 */
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( audio_hardware_w )
break;
logerror("audio_w ctr1 preset $%x amp %d\n", data & 15, data >> 4);
state->_0c01 = data;
- meadows_sh_update(space->machine);
+ meadows_sh_update(space->machine());
break;
case 2: /* counter clk 5 MHz / 32 (/ 2 or / 4) */
@@ -263,7 +263,7 @@ static WRITE8_HANDLER( audio_hardware_w )
break;
logerror("audio_w ctr2 preset $%02x\n", data);
state->_0c02 = data;
- meadows_sh_update(space->machine);
+ meadows_sh_update(space->machine());
break;
case 3: /* audio enable */
@@ -271,7 +271,7 @@ static WRITE8_HANDLER( audio_hardware_w )
break;
logerror("audio_w enable ctr2/2:%d ctr2:%d dac:%d ctr1:%d\n", data&1, (data>>1)&1, (data>>2)&1, (data>>3)&1);
state->_0c03 = data;
- meadows_sh_update(space->machine);
+ meadows_sh_update(space->machine());
break;
}
}
@@ -286,7 +286,7 @@ static WRITE8_HANDLER( audio_hardware_w )
static READ8_HANDLER( audio_hardware_r )
{
- meadows_state *state = space->machine->driver_data<meadows_state>();
+ meadows_state *state = space->machine().driver_data<meadows_state>();
int data = 0;
switch (offset)
@@ -312,7 +312,7 @@ static READ8_HANDLER( audio_hardware_r )
static INTERRUPT_GEN( audio_interrupt )
{
- meadows_state *state = device->machine->driver_data<meadows_state>();
+ meadows_state *state = device->machine().driver_data<meadows_state>();
/* fake something toggling the sense input line of the S2650 */
state->audio_sense_state ^= 1;
device_set_input_line(device, 1, state->audio_sense_state ? ASSERT_LINE : CLEAR_LINE);
@@ -881,12 +881,12 @@ static DRIVER_INIT( gypsyjug )
0x01,0x80, 0x03,0xc0, 0x03,0xc0, 0x01,0x80
};
int i;
- UINT8 *gfx2 = machine->region("gfx2")->base();
- UINT8 *gfx3 = machine->region("gfx3")->base();
- UINT8 *gfx4 = machine->region("gfx4")->base();
- UINT8 *gfx5 = machine->region("gfx5")->base();
- int len3 = machine->region("gfx3")->bytes();
- int len4 = machine->region("gfx4")->bytes();
+ UINT8 *gfx2 = machine.region("gfx2")->base();
+ UINT8 *gfx3 = machine.region("gfx3")->base();
+ UINT8 *gfx4 = machine.region("gfx4")->base();
+ UINT8 *gfx5 = machine.region("gfx5")->base();
+ int len3 = machine.region("gfx3")->bytes();
+ int len4 = machine.region("gfx4")->bytes();
memcpy(gfx3,gfx2,len3);
@@ -905,8 +905,8 @@ static DRIVER_INIT( minferno )
UINT8 *mem;
/* create an inverted copy of the graphics data */
- mem = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ mem = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
for (i = 0; i < length/2; i++)
mem[i] = ~mem[i + length/2];
}
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index bd43d4c9d6d..57baaa9de47 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -205,7 +205,7 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele
int i,j;
const UINT8 *dp;
int index = 0;
- const pen_t *pens = gfx->machine->pens;
+ const pen_t *pens = gfx->machine().pens;
dp = gfx_element_get_data(gfx, ch);
@@ -226,9 +226,9 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele
}
}
-static void draw_framebuffer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_framebuffer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
int i, j;
int width, height;
int line_delta = (state->disp_ctrl_reg[DC_LINE_DELTA] & 0x3ff) * 4;
@@ -253,7 +253,7 @@ static void draw_framebuffer(running_machine *machine, bitmap_t *bitmap, const r
visarea.min_x = visarea.min_y = 0;
visarea.max_x = width - 1;
visarea.max_y = height - 1;
- machine->primary_screen->configure(width, height * 262 / 240, visarea, machine->primary_screen->frame_period().attoseconds);
+ machine.primary_screen->configure(width, height * 262 / 240, visarea, machine.primary_screen->frame_period().attoseconds);
}
if (state->disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode
@@ -319,11 +319,11 @@ static void draw_framebuffer(running_machine *machine, bitmap_t *bitmap, const r
}
}
-static void draw_cga(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
int i, j;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
UINT32 *cga = state->cga_ram;
int index = 0;
@@ -345,21 +345,21 @@ static void draw_cga(running_machine *machine, bitmap_t *bitmap, const rectangle
static SCREEN_UPDATE(mediagx)
{
- mediagx_state *state = screen->machine->driver_data<mediagx_state>();
+ mediagx_state *state = screen->machine().driver_data<mediagx_state>();
bitmap_fill(bitmap, cliprect, 0);
- draw_framebuffer(screen->machine, bitmap, cliprect);
+ draw_framebuffer(screen->machine(), bitmap, cliprect);
if (state->disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // don't show MDA text screen on 16-bit mode. this is basically a hack
{
- draw_cga(screen->machine, bitmap, cliprect);
+ draw_cga(screen->machine(), bitmap, cliprect);
}
return 0;
}
static READ32_HANDLER( disp_ctrl_r )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
UINT32 r = state->disp_ctrl_reg[offset];
switch (offset)
@@ -367,7 +367,7 @@ static READ32_HANDLER( disp_ctrl_r )
case DC_TIMING_CFG:
r |= 0x40000000;
- if (space->machine->primary_screen->vpos() >= state->frame_height)
+ if (space->machine().primary_screen->vpos() >= state->frame_height)
r &= ~0x40000000;
#if SPEEDUP_HACKS
@@ -382,7 +382,7 @@ static READ32_HANDLER( disp_ctrl_r )
static WRITE32_HANDLER( disp_ctrl_w )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
COMBINE_DATA(state->disp_ctrl_reg + offset);
}
@@ -423,14 +423,14 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static READ32_HANDLER( memory_ctrl_r )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
return state->memory_ctrl_reg[offset];
}
static WRITE32_HANDLER( memory_ctrl_w )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
//mame_printf_debug("memory_ctrl_w %08X, %08X, %08X\n", data, offset, mem_mask);
if (offset == 7)
@@ -456,7 +456,7 @@ static WRITE32_HANDLER( memory_ctrl_w )
static READ32_HANDLER( biu_ctrl_r )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
if (offset == 0)
{
@@ -467,7 +467,7 @@ static READ32_HANDLER( biu_ctrl_r )
static WRITE32_HANDLER( biu_ctrl_w )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
//mame_printf_debug("biu_ctrl_w %08X, %08X, %08X\n", data, offset, mem_mask);
COMBINE_DATA(state->biu_ctrl_reg + offset);
@@ -487,7 +487,7 @@ static WRITE32_HANDLER(bios_ram_w)
static UINT8 mediagx_config_reg_r(device_t *device)
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
//mame_printf_debug("mediagx_config_reg_r %02X\n", mediagx_config_reg_sel);
return state->mediagx_config_regs[state->mediagx_config_reg_sel];
@@ -495,7 +495,7 @@ static UINT8 mediagx_config_reg_r(device_t *device)
static void mediagx_config_reg_w(device_t *device, UINT8 data)
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
//mame_printf_debug("mediagx_config_reg_w %02X, %02X\n", mediagx_config_reg_sel, data);
state->mediagx_config_regs[state->mediagx_config_reg_sel] = data;
@@ -522,7 +522,7 @@ static READ8_DEVICE_HANDLER( io20_r )
static WRITE8_DEVICE_HANDLER( io20_w )
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
// 0x22, 0x23, Cyrix configuration registers
if (offset == 0x02)
@@ -541,27 +541,27 @@ static WRITE8_DEVICE_HANDLER( io20_w )
static READ32_HANDLER( parallel_port_r )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
UINT32 r = 0;
//static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23
if (ACCESSING_BITS_8_15)
{
- UINT8 nibble = state->parallel_latched;//(input_port_read_safe(space->machine, state->portnames[state->parallel_pointer / 3], 0) >> (4 * (state->parallel_pointer % 3))) & 15;
+ UINT8 nibble = state->parallel_latched;//(input_port_read_safe(space->machine(), state->portnames[state->parallel_pointer / 3], 0) >> (4 * (state->parallel_pointer % 3))) & 15;
r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11);
logerror("%08X:parallel_port_r()\n", cpu_get_pc(space->cpu));
#if 0
if (state->controls_data == 0x18)
{
- r |= input_port_read(space->machine, "IN0") << 8;
+ r |= input_port_read(space->machine(), "IN0") << 8;
}
else if (state->controls_data == 0x60)
{
- r |= input_port_read(space->machine, "IN1") << 8;
+ r |= input_port_read(space->machine(), "IN1") << 8;
}
else if (state->controls_data == 0xff || state->controls_data == 0x50)
{
- r |= input_port_read(space->machine, "IN2") << 8;
+ r |= input_port_read(space->machine(), "IN2") << 8;
}
//r |= state->control_read << 8;
@@ -577,7 +577,7 @@ static READ32_HANDLER( parallel_port_r )
static WRITE32_HANDLER( parallel_port_w )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23
COMBINE_DATA( &state->parport );
@@ -601,7 +601,7 @@ static WRITE32_HANDLER( parallel_port_w )
logerror("%08X:", cpu_get_pc(space->cpu));
- state->parallel_latched = (input_port_read_safe(space->machine, portnames[state->parallel_pointer / 3], 0) >> (4 * (state->parallel_pointer % 3))) & 15;
+ state->parallel_latched = (input_port_read_safe(space->machine(), portnames[state->parallel_pointer / 3], 0) >> (4 * (state->parallel_pointer % 3))) & 15;
//parallel_pointer++;
//logerror("[%02X] Advance pointer to %d\n", data, parallel_pointer);
switch (data & 0xfc)
@@ -661,7 +661,7 @@ static WRITE32_HANDLER( parallel_port_w )
static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
{
- mediagx_state *state = busdevice->machine->driver_data<mediagx_state>();
+ mediagx_state *state = busdevice->machine().driver_data<mediagx_state>();
//mame_printf_debug("CX5510: PCI read %d, %02X, %08X\n", function, reg, mem_mask);
switch (reg)
@@ -674,7 +674,7 @@ static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function,
static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
{
- mediagx_state *state = busdevice->machine->driver_data<mediagx_state>();
+ mediagx_state *state = busdevice->machine().driver_data<mediagx_state>();
//mame_printf_debug("CX5510: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask);
COMBINE_DATA(state->cx5510_regs + (reg/4));
@@ -684,7 +684,7 @@ static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, in
static TIMER_DEVICE_CALLBACK( sound_timer_callback )
{
- mediagx_state *state = timer.machine->driver_data<mediagx_state>();
+ mediagx_state *state = timer.machine().driver_data<mediagx_state>();
state->ad1847_sample_counter = 0;
timer.adjust(attotime::from_msec(10));
@@ -696,9 +696,9 @@ static TIMER_DEVICE_CALLBACK( sound_timer_callback )
state->dacr_ptr = 0;
}
-static void ad1847_reg_write(running_machine *machine, int reg, UINT8 data)
+static void ad1847_reg_write(running_machine &machine, int reg, UINT8 data)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
static const int divide_factor[] = { 3072, 1536, 896, 768, 448, 384, 512, 2560 };
switch (reg)
@@ -737,7 +737,7 @@ static void ad1847_reg_write(running_machine *machine, int reg, UINT8 data)
static READ32_HANDLER( ad1847_r )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
switch (offset)
{
@@ -749,7 +749,7 @@ static READ32_HANDLER( ad1847_r )
static WRITE32_HANDLER( ad1847_w )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
if (offset == 0)
{
@@ -769,7 +769,7 @@ static WRITE32_HANDLER( ad1847_w )
else if (offset == 3)
{
int reg = (data >> 8) & 0xf;
- ad1847_reg_write(space->machine, reg, data & 0xff);
+ ad1847_reg_write(space->machine(), reg, data & 0xff);
}
}
@@ -783,7 +783,7 @@ static WRITE32_HANDLER( ad1847_w )
static READ8_HANDLER(at_page8_r)
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8)
@@ -807,7 +807,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
state->at_pages[offset % 0x10] = data;
@@ -831,7 +831,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -840,7 +840,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -850,7 +850,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -859,7 +859,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static void set_dma_channel(device_t *device, int channel, int _state)
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
if (!_state) state->dma_channel = channel;
}
@@ -1006,7 +1006,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
int r;
r = pic8259_acknowledge( state->pic8259_2);
@@ -1019,13 +1019,13 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(mediagx)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
- state->pit8254 = machine->device<pit8254_device>( "pit8254" );
- state->pic8259_1 = machine->device<pic8259_device>( "pic8259_master" );
- state->pic8259_2 = machine->device<pic8259_device>( "pic8259_slave" );
- state->dma8237_1 = machine->device<i8237_device>( "dma8237_1" );
- state->dma8237_2 = machine->device<i8237_device>( "dma8237_2" );
+ state->pit8254 = machine.device<pit8254_device>( "pit8254" );
+ state->pic8259_1 = machine.device<pic8259_device>( "pic8259_master" );
+ state->pic8259_2 = machine.device<pic8259_device>( "pic8259_slave" );
+ state->dma8237_1 = machine.device<i8237_device>( "dma8237_1" );
+ state->dma8237_2 = machine.device<i8237_device>( "dma8237_2" );
state->dacl = auto_alloc_array(machine, INT16, 65536);
state->dacr = auto_alloc_array(machine, INT16, 65536);
@@ -1033,19 +1033,19 @@ static MACHINE_START(mediagx)
static MACHINE_RESET(mediagx)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
- UINT8 *rom = machine->region("bios")->base();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
+ UINT8 *rom = machine.region("bios")->base();
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
memcpy(state->bios_ram, rom, 0x40000);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
- timer_device *sound_timer = machine->device<timer_device>("sound_timer");
+ timer_device *sound_timer = machine.device<timer_device>("sound_timer");
sound_timer->adjust(attotime::from_msec(10));
- state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ state->dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ state->dmadac[1] = machine.device<dmadac_sound_device>("dac2");
dmadac_enable(&state->dmadac[0], 2, 1);
devtag_reset(machine, "ide");
}
@@ -1058,7 +1058,7 @@ static MACHINE_RESET(mediagx)
static WRITE_LINE_DEVICE_HANDLER( mediagx_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface mediagx_pic8259_1_config =
@@ -1150,28 +1150,28 @@ static MACHINE_CONFIG_START( mediagx, mediagx_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int _state)
+static void keyboard_interrupt(running_machine &machine, int _state)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
pic8259_ir1_w(state->pic8259_1, _state);
}
static void ide_interrupt(device_t *device, int _state)
{
- mediagx_state *state = device->machine->driver_data<mediagx_state>();
+ mediagx_state *state = device->machine().driver_data<mediagx_state>();
pic8259_ir6_w(state->pic8259_2, _state);
}
-static int mediagx_get_out2(running_machine *machine)
+static int mediagx_get_out2(running_machine &machine)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
return pit8253_get_output( state->pit8254, 2 );
}
@@ -1181,16 +1181,16 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, mediagx_get_out2
};
-static void mediagx_set_keyb_int(running_machine *machine, int _state)
+static void mediagx_set_keyb_int(running_machine &machine, int _state)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
pic8259_ir1_w(state->pic8259_1, _state);
}
-static void init_mediagx(running_machine *machine)
+static void init_mediagx(running_machine &machine)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
state->frame_width = state->frame_height = 1;
@@ -1203,7 +1203,7 @@ static void init_mediagx(running_machine *machine)
INLINE UINT32 generic_speedup(address_space *space, int idx)
{
- mediagx_state *state = space->machine->driver_data<mediagx_state>();
+ mediagx_state *state = space->machine().driver_data<mediagx_state>();
if (cpu_get_pc(space->cpu) == state->speedup_table[idx].pc)
{
@@ -1244,9 +1244,9 @@ static void report_speedups(running_machine &machine)
}
#endif
-static void install_speedups(running_machine *machine, const speedup_entry *entries, int count)
+static void install_speedups(running_machine &machine, const speedup_entry *entries, int count)
{
- mediagx_state *state = machine->driver_data<mediagx_state>();
+ mediagx_state *state = machine.driver_data<mediagx_state>();
int i;
assert(count < ARRAY_LENGTH(speedup_handlers));
@@ -1255,10 +1255,10 @@ static void install_speedups(running_machine *machine, const speedup_entry *entr
state->speedup_count = count;
for (i = 0; i < count; i++)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(entries[i].offset, entries[i].offset + 3, FUNC(speedup_handlers[i]));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(entries[i].offset, entries[i].offset + 3, FUNC(speedup_handlers[i]));
#ifdef MAME_DEBUG
- machine->add_notifier(MACHINE_NOTIFY_EXIT, report_speedups);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, report_speedups);
#endif
}
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index 73f5be88760..29c1efbeaf2 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -251,58 +251,58 @@ a tilemap-like structure, from which data is copied)
/* We need to always initialize 6 buttons pad */
static TIMER_CALLBACK( mess_io_timeout_timer_callback )
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
state->mess_io_stage[(int)(FPTR)ptr] = -1;
}
/* J-Cart controller port */
WRITE16_HANDLER( jcart_ctrl_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->jcart_io_data[0] = (data & 1) << 6;
state->jcart_io_data[1] = (data & 1) << 6;
}
READ16_HANDLER( jcart_ctrl_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
UINT16 retdata = 0;
UINT8 joy[2];
if (state->jcart_io_data[0] & 0x40)
{
- joy[0] = input_port_read_safe(space->machine, "JCART3_3B", 0);
- joy[1] = input_port_read_safe(space->machine, "JCART4_3B", 0);
+ joy[0] = input_port_read_safe(space->machine(), "JCART3_3B", 0);
+ joy[1] = input_port_read_safe(space->machine(), "JCART4_3B", 0);
retdata = (state->jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
else
{
- joy[0] = ((input_port_read_safe(space->machine, "JCART3_3B", 0) & 0xc0) >> 2) |
- (input_port_read_safe(space->machine, "JCART3_3B", 0) & 0x03);
- joy[1] = ((input_port_read_safe(space->machine, "JCART4_3B", 0) & 0xc0) >> 2) |
- (input_port_read_safe(space->machine, "JCART4_3B", 0) & 0x03);
+ joy[0] = ((input_port_read_safe(space->machine(), "JCART3_3B", 0) & 0xc0) >> 2) |
+ (input_port_read_safe(space->machine(), "JCART3_3B", 0) & 0x03);
+ joy[1] = ((input_port_read_safe(space->machine(), "JCART4_3B", 0) & 0xc0) >> 2) |
+ (input_port_read_safe(space->machine(), "JCART4_3B", 0) & 0x03);
retdata = (state->jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8);
}
return retdata;
}
-static void mess_init_6buttons_pad(running_machine *machine)
+static void mess_init_6buttons_pad(running_machine &machine)
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
int i;
for (i = 0; i < 3; i++)
{
- state->mess_io_timeout[i] = machine->scheduler().timer_alloc(FUNC(mess_io_timeout_timer_callback), (void*)(FPTR)i);
+ state->mess_io_timeout[i] = machine.scheduler().timer_alloc(FUNC(mess_io_timeout_timer_callback), (void*)(FPTR)i);
state->mess_io_stage[i] = -1;
}
}
/* These overwrite the MAME ones in DRIVER_INIT */
/* They're needed to give the users the choice between different controllers */
-static UINT8 mess_md_io_read_data_port(running_machine *machine, int portnum)
+static UINT8 mess_md_io_read_data_port(running_machine &machine, int portnum)
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
static const char *const pad6names[2][4] = {
{ "PAD1_6B", "PAD2_6B", "UNUSED", "UNUSED" },
{ "EXTRA1", "EXTRA2", "UNUSED", "UNUSED" }
@@ -397,9 +397,9 @@ static UINT8 mess_md_io_read_data_port(running_machine *machine, int portnum)
}
-static void mess_md_io_write_data_port(running_machine *machine, int portnum, UINT16 data)
+static void mess_md_io_write_data_port(running_machine &machine, int portnum, UINT16 data)
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
int controller;
switch (portnum)
@@ -424,7 +424,7 @@ static void mess_md_io_write_data_port(running_machine *machine, int portnum, UI
if (((megadrive_io_data_regs[portnum] & 0x40) == 0x00) && ((data & 0x40) == 0x40))
{
state->mess_io_stage[portnum]++;
- state->mess_io_timeout[portnum]->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ state->mess_io_timeout[portnum]->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
}
@@ -891,7 +891,7 @@ ROM_END
#define PICO_PENX 1
#define PICO_PENY 2
-static UINT16 pico_read_penpos(running_machine *machine, int pen)
+static UINT16 pico_read_penpos(running_machine &machine, int pen)
{
UINT16 penpos = 0;
@@ -916,7 +916,7 @@ static UINT16 pico_read_penpos(running_machine *machine, int pen)
static READ16_HANDLER( pico_68k_io_read )
{
- pico_state *state = space->machine->driver_data<pico_state>();
+ pico_state *state = space->machine().driver_data<pico_state>();
UINT8 retdata = 0;
switch (offset)
@@ -925,7 +925,7 @@ static READ16_HANDLER( pico_68k_io_read )
retdata = (megadrive_region_export << 6) | (megadrive_region_pal << 5);
break;
case 1:
- retdata = input_port_read_safe(space->machine, "PAD", 0);
+ retdata = input_port_read_safe(space->machine(), "PAD", 0);
break;
/*
@@ -940,16 +940,16 @@ static READ16_HANDLER( pico_68k_io_read )
0x2f8 - 0x3f3 (storyware)
*/
case 2:
- retdata = pico_read_penpos(space->machine, PICO_PENX) >> 8;
+ retdata = pico_read_penpos(space->machine(), PICO_PENX) >> 8;
break;
case 3:
- retdata = pico_read_penpos(space->machine, PICO_PENX) & 0x00ff;
+ retdata = pico_read_penpos(space->machine(), PICO_PENX) & 0x00ff;
break;
case 4:
- retdata = pico_read_penpos(space->machine, PICO_PENY) >> 8;
+ retdata = pico_read_penpos(space->machine(), PICO_PENY) >> 8;
break;
case 5:
- retdata = pico_read_penpos(space->machine, PICO_PENY) & 0x00ff;
+ retdata = pico_read_penpos(space->machine(), PICO_PENY) & 0x00ff;
break;
case 6:
/* Page register :
@@ -958,7 +958,7 @@ static READ16_HANDLER( pico_68k_io_read )
either page 5 or page 6 is often unused.
*/
{
- UINT8 tmp = input_port_read_safe(space->machine, "PAGE", 0);
+ UINT8 tmp = input_port_read_safe(space->machine(), "PAGE", 0);
if (tmp == 2 && state->page_register != 0x3f)
{
state->page_register <<= 1;
diff --git a/src/mame/drivers/megadrvb.c b/src/mame/drivers/megadrvb.c
index 32555f30800..a646033d7e8 100644
--- a/src/mame/drivers/megadrvb.c
+++ b/src/mame/drivers/megadrvb.c
@@ -278,10 +278,10 @@ static WRITE16_HANDLER( aladmdb_w )
static READ16_HANDLER( aladmdb_r )
{
- md_boot_state *state = space->machine->driver_data<md_boot_state>();
+ md_boot_state *state = space->machine().driver_data<md_boot_state>();
if (cpu_get_pc(space->cpu)==0x1b2a56)
{
- state->aladmdb_mcu_port = input_port_read(space->machine, "MCU");
+ state->aladmdb_mcu_port = input_port_read(space->machine(), "MCU");
if (state->aladmdb_mcu_port & 0x100)
return ((state->aladmdb_mcu_port & 0x0f) | 0x100); // coin inserted, calculate the number of coins
@@ -289,7 +289,7 @@ static READ16_HANDLER( aladmdb_r )
return (0x100); //MCU status, needed if you fall into a pitfall
}
if (cpu_get_pc(space->cpu)==0x1b2a72) return 0x0000;
- if (cpu_get_pc(space->cpu)==0x1b2d24) return (input_port_read(space->machine, "MCU") & 0x00f0) | 0x1200; // difficulty
+ if (cpu_get_pc(space->cpu)==0x1b2d24) return (input_port_read(space->machine(), "MCU") & 0x00f0) | 0x1200; // difficulty
if (cpu_get_pc(space->cpu)==0x1b2d4e) return 0x0000;
logerror("aladbl_r : %06x\n",cpu_get_pc(space->cpu));
@@ -300,19 +300,19 @@ static READ16_HANDLER( aladmdb_r )
static READ16_HANDLER( mk3mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine, dswname[offset]);
+ return input_port_read(space->machine(), dswname[offset]);
}
static READ16_HANDLER( ssf2mdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine, dswname[offset]);
+ return input_port_read(space->machine(), dswname[offset]);
}
static READ16_HANDLER( srmdb_dsw_r )
{
static const char *const dswname[3] = { "DSWA", "DSWB", "DSWC" };
- return input_port_read(space->machine, dswname[offset]);
+ return input_port_read(space->machine(), dswname[offset]);
}
static READ16_HANDLER( topshoot_200051_r )
@@ -659,13 +659,13 @@ static DRIVER_INIT( aladmdb )
* Game does a check @ 1afc00 with work RAM fff57c that makes it play like the original console version (i.e. 8 energy hits instead of 2)
*/
#if ENERGY_CONSOLE_MODE
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x1afc08/2] = 0x6600;
#endif
// 220000 = writes to mcu? 330000 = reads?
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x220000, 0x220001, FUNC(aladmdb_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x330000, 0x330001, FUNC(aladmdb_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x220000, 0x220001, FUNC(aladmdb_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x330000, 0x330001, FUNC(aladmdb_r));
megadrive_6buttons_pad = 0;
DRIVER_INIT_CALL(megadrij);
@@ -675,7 +675,7 @@ static DRIVER_INIT( aladmdb )
// after this decode look like intentional changes
static DRIVER_INIT( mk3mdb )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (int x = 0x000001; x < 0x100001; x += 2)
{
@@ -714,7 +714,7 @@ static DRIVER_INIT( mk3mdb )
rom[0x07] = 0x02;
rom[0x06] = 0x10;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(mk3mdb_dsw_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(mk3mdb_dsw_r) );
megadrive_6buttons_pad = 1;
DRIVER_INIT_CALL(megadriv);
@@ -722,13 +722,13 @@ static DRIVER_INIT( mk3mdb )
static DRIVER_INIT( ssf2mdb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xA130F0, 0xA130FF); // custom banking is disabled (!)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x5fffff, "bank5");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x5fffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xA130F0, 0xA130FF); // custom banking is disabled (!)
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x400000, 0x5fffff, "bank5");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x400000, 0x5fffff);
- memory_set_bankptr(machine, "bank5", machine->region( "maincpu" )->base() + 0x400000 );
+ memory_set_bankptr(machine, "bank5", machine.region( "maincpu" )->base() + 0x400000 );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(ssf2mdb_dsw_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(ssf2mdb_dsw_r) );
megadrive_6buttons_pad = 1;
DRIVER_INIT_CALL(megadrij);
@@ -736,7 +736,7 @@ static DRIVER_INIT( ssf2mdb )
static DRIVER_INIT( srmdb )
{
- UINT8* rom = machine->region("maincpu")->base();
+ UINT8* rom = machine.region("maincpu")->base();
/* todo, reduce bitswaps to single swap */
for (int x = 0x00001; x < 0x40000; x += 2)
@@ -770,7 +770,7 @@ static DRIVER_INIT( srmdb )
rom[0x06] = 0xd2;
rom[0x07] = 0x00;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(srmdb_dsw_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(srmdb_dsw_r) );
megadrive_6buttons_pad = 0;
DRIVER_INIT_CALL(megadriv);
@@ -778,11 +778,11 @@ static DRIVER_INIT( srmdb )
static DRIVER_INIT(topshoot)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200050, 0x200051, FUNC(topshoot_200051_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200042, 0x200043, "IN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200044, 0x200045, "IN1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200046, 0x200047, "IN2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200048, 0x200049, "IN3");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200050, 0x200051, FUNC(topshoot_200051_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200042, 0x200043, "IN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200044, 0x200045, "IN1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200046, 0x200047, "IN2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x200048, 0x200049, "IN3");
megadrive_6buttons_pad = 0;
DRIVER_INIT_CALL(megadriv);
diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c
index c4cbe0a86a1..0fd94beac20 100644
--- a/src/mame/drivers/megaplay.c
+++ b/src/mame/drivers/megaplay.c
@@ -377,7 +377,7 @@ INPUT_PORTS_END
static READ8_HANDLER( megaplay_bios_banksel_r )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
return state->bios_bank;
}
@@ -388,7 +388,7 @@ static WRITE8_HANDLER( megaplay_bios_banksel_w )
It should be possible to multiplex different game ROMs at
0x000000-0x3fffff based on these bits.
*/
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
state->bios_bank = data;
state->bios_mode = MP_ROM;
// logerror("BIOS: ROM bank %i selected [0x%02x]\n",bios_bank >> 6, data);
@@ -396,13 +396,13 @@ static WRITE8_HANDLER( megaplay_bios_banksel_w )
static READ8_HANDLER( megaplay_bios_gamesel_r )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
return state->bios_6403;
}
static WRITE8_HANDLER( megaplay_bios_gamesel_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
state->bios_6403 = data;
// logerror("BIOS: 0x6403 write: 0x%02x\n",data);
@@ -427,8 +427,8 @@ static READ16_HANDLER( megaplay_io_read )
static READ8_HANDLER( bank_r )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
- UINT8* bank = space->machine->region("mtbios")->base();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
+ UINT8* bank = space->machine().region("mtbios")->base();
UINT32 fulladdress = state->mp_bios_bank_addr + offset;
if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM Addresses
@@ -451,7 +451,7 @@ static READ8_HANDLER( bank_r )
}
else
{
- return space->machine->region("maincpu")->base()[fulladdress ^ 1];
+ return space->machine().region("maincpu")->base()[fulladdress ^ 1];
}
}
else if (fulladdress >= 0xa10000 && fulladdress <= 0xa1001f) // IO Acess
@@ -468,7 +468,7 @@ static READ8_HANDLER( bank_r )
static WRITE8_HANDLER( bank_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
UINT32 fulladdress = state->mp_bios_bank_addr + offset;
if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM / Megaplay Custom Addresses
@@ -517,7 +517,7 @@ static READ8_HANDLER( megaplay_bios_6204_r )
static WRITE8_HANDLER( megaplay_bios_width_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
state->bios_width = data;
megadrive_io_data_regs[2] = (megadrive_io_data_regs[2] & 0x07) | ((data & 0xf8));
// logerror("BIOS: 0x6204 - Width write: %02x\n", data);
@@ -525,7 +525,7 @@ static WRITE8_HANDLER( megaplay_bios_width_w )
static READ8_HANDLER( megaplay_bios_6404_r )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
// logerror("BIOS: 0x6404 read: returned 0x%02x\n",bios_6404 | (bios_6403 & 0x10) >> 4);
return (state->bios_6404 & 0xfe) | ((state->bios_6403 & 0x10) >> 4);
// return state->bios_6404 | (state->bios_6403 & 0x10) >> 4;
@@ -533,9 +533,9 @@ static READ8_HANDLER( megaplay_bios_6404_r )
static WRITE8_HANDLER( megaplay_bios_6404_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
if(((state->bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c))
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
state->bios_6404 = data;
// logerror("BIOS: 0x6404 write: 0x%02x\n", data);
@@ -549,20 +549,20 @@ static READ8_HANDLER( megaplay_bios_6600_r )
function to make the BIOS check all 4 slots (3 and 4 will be "not used")
return (state->bios_6600 & 0xfe) | (state->bios_bank & 0x01);
*/
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
return state->bios_6600;// & 0xfe;
}
static WRITE8_HANDLER( megaplay_bios_6600_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
state->bios_6600 = data;
// logerror("BIOS: 0x6600 write: 0x%02x\n",data);
}
static WRITE8_HANDLER( megaplay_game_w )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
if (state->readpos == 1)
state->game_banksel = 0;
state->game_banksel |= (1 << (state->readpos - 1)) * (data & 0x01);
@@ -631,7 +631,7 @@ static SCREEN_UPDATE(megplay)
//extern SCREEN_EOF(megadriv);
static MACHINE_RESET( megaplay )
{
- mplay_state *state = machine->driver_data<mplay_state>();
+ mplay_state *state = machine.driver_data<mplay_state>();
state->bios_mode = MP_ROM;
state->mp_bios_bank_addr = 0;
state->readpos = 1;
@@ -828,11 +828,11 @@ ROM_START( mp_shnb3 ) /* Shinobi 3 */
ROM_END
-static void mplay_start(running_machine *machine)
+static void mplay_start(running_machine &machine)
{
- UINT8 *src = machine->region("mtbios")->base();
- UINT8 *instruction_rom = machine->region("user1")->base();
- UINT8 *game_rom = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("mtbios")->base();
+ UINT8 *instruction_rom = machine.region("user1")->base();
+ UINT8 *game_rom = machine.region("maincpu")->base();
int offs;
memmove(src + 0x10000, src + 0x8000, 0x18000); // move bios..
@@ -850,13 +850,13 @@ static void mplay_start(running_machine *machine)
static READ16_HANDLER( megadriv_68k_read_z80_extra_ram )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
return state->ic36_ram[(offset << 1) ^ 1] | (state->ic36_ram[(offset << 1)] << 8);
}
static WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
{
- mplay_state *state = space->machine->driver_data<mplay_state>();
+ mplay_state *state = space->machine().driver_data<mplay_state>();
if (!ACCESSING_BITS_0_7) // byte (MSB) access
{
state->ic36_ram[(offset << 1)] = (data & 0xff00) >> 8;
@@ -874,7 +874,7 @@ static WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
static DRIVER_INIT(megaplay)
{
- mplay_state *state = machine->driver_data<mplay_state>();
+ mplay_state *state = machine.driver_data<mplay_state>();
/* to support the old code.. */
state->ic36_ram = auto_alloc_array(machine, UINT16, 0x10000 / 2);
state->ic37_ram = auto_alloc_array(machine, UINT8, 0x10000);
@@ -885,13 +885,13 @@ static DRIVER_INIT(megaplay)
mplay_start(machine);
/* for now ... */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa10000, 0xa1001f, FUNC(megaplay_io_read), FUNC(megaplay_io_write));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa10000, 0xa1001f, FUNC(megaplay_io_read), FUNC(megaplay_io_write));
/* megaplay has ram shared with the bios cpu here */
- machine->device("genesis_snd_z80")->memory().space(AS_PROGRAM)->install_ram(0x2000, 0x3fff, &state->ic36_ram[0]);
+ machine.device("genesis_snd_z80")->memory().space(AS_PROGRAM)->install_ram(0x2000, 0x3fff, &state->ic36_ram[0]);
/* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa02000, 0xa03fff, FUNC(megadriv_68k_read_z80_extra_ram), FUNC(megadriv_68k_write_z80_extra_ram));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa02000, 0xa03fff, FUNC(megadriv_68k_read_z80_extra_ram), FUNC(megadriv_68k_write_z80_extra_ram));
DRIVER_INIT_CALL(megatech_bios); // create the SMS vdp etc.
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index 19c411590e6..a499595659e 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -132,14 +132,14 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? <
static MACHINE_RESET( megasys1 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ignore_oki_status = 1; /* ignore oki status due 'protection' */
state->ip_select = 0; /* reset protection */
}
static MACHINE_RESET( megasys1_hachoo )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ignore_oki_status = 0; /* strangely hachoo need real oki status */
state->ip_select = 0; /* reset protection */
}
@@ -214,7 +214,7 @@ static INTERRUPT_GEN( interrupt_B )
static READ16_HANDLER( ip_select_r )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
int i;
// Coins P1 P2 DSW1 DSW2
@@ -233,20 +233,20 @@ static READ16_HANDLER( ip_select_r )
switch (i)
{
- case 0 : return input_port_read(space->machine, "SYSTEM");
- case 1 : return input_port_read(space->machine, "P1");
- case 2 : return input_port_read(space->machine, "P2");
- case 3 : return input_port_read(space->machine, "DSW1");
- case 4 : return input_port_read(space->machine, "DSW2");
+ case 0 : return input_port_read(space->machine(), "SYSTEM");
+ case 1 : return input_port_read(space->machine(), "P1");
+ case 2 : return input_port_read(space->machine(), "P2");
+ case 3 : return input_port_read(space->machine(), "DSW1");
+ case 4 : return input_port_read(space->machine(), "DSW2");
default : return 0x0006;
}
}
static WRITE16_HANDLER( ip_select_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
COMBINE_DATA(&state->ip_select);
- cputag_set_input_line(space->machine, "maincpu", 2, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, HOLD_LINE);
}
@@ -373,12 +373,12 @@ ADDRESS_MAP_END
static void megasys1_sound_irq(device_t *device, int irq)
{
if (irq)
- cputag_set_input_line(device->machine, "soundcpu", 4, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 4, HOLD_LINE);
}
static READ8_DEVICE_HANDLER( oki_status_r )
{
- megasys1_state *state = device->machine->driver_data<megasys1_state>();
+ megasys1_state *state = device->machine().driver_data<megasys1_state>();
if (state->ignore_oki_status == 1)
return 0;
else
@@ -1361,25 +1361,25 @@ INPUT_PORTS_END
/* Read the input ports, through a protection device */
static READ16_HANDLER( protection_peekaboo_r )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
switch (state->protection_val)
{
case 0x02: return 0x03;
- case 0x51: return input_port_read(space->machine, "P1");
- case 0x52: return input_port_read(space->machine, "P2");
+ case 0x51: return input_port_read(space->machine(), "P1");
+ case 0x52: return input_port_read(space->machine(), "P2");
default: return state->protection_val;
}
}
static WRITE16_HANDLER( protection_peekaboo_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
COMBINE_DATA(&state->protection_val);
if ((state->protection_val & 0x90) == 0x90)
{
- UINT8 *RAM = space->machine->region("oki1")->base();
+ UINT8 *RAM = space->machine().region("oki1")->base();
int new_bank = (state->protection_val & 0x7) % 7;
if (state->bank != new_bank)
@@ -1389,7 +1389,7 @@ static WRITE16_HANDLER( protection_peekaboo_w )
}
}
- cputag_set_input_line(space->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, HOLD_LINE);
}
/*************************************
@@ -1639,7 +1639,7 @@ MACHINE_CONFIG_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -3550,10 +3550,10 @@ ROM_START( tshingen )
ROM_END
-static void rodlandj_gfx_unmangle(running_machine *machine, const char *region)
+static void rodlandj_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine->region(region)->base();
- int size = machine->region(region)->bytes();
+ UINT8 *rom = machine.region(region)->base();
+ int size = machine.region(region)->bytes();
UINT8 *buffer;
int i;
@@ -3582,10 +3582,10 @@ static void rodlandj_gfx_unmangle(running_machine *machine, const char *region)
auto_free(machine, buffer);
}
-static void jitsupro_gfx_unmangle(running_machine *machine, const char *region)
+static void jitsupro_gfx_unmangle(running_machine &machine, const char *region)
{
- UINT8 *rom = machine->region(region)->base();
- int size = machine->region(region)->bytes();
+ UINT8 *rom = machine.region(region)->base();
+ int size = machine.region(region)->bytes();
UINT8 *buffer;
int i;
@@ -3617,8 +3617,8 @@ static void jitsupro_gfx_unmangle(running_machine *machine, const char *region)
static DRIVER_INIT( 64street )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
-// UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
+// UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
// RAM[0x006b8/2] = 0x6004; // d8001 test
// RAM[0x10EDE/2] = 0x6012; // watchdog
@@ -3635,13 +3635,13 @@ static DRIVER_INIT( astyanax )
astyanax_rom_decode(machine, "maincpu");
- RAM = (UINT16 *) machine->region("maincpu")->base();
+ RAM = (UINT16 *) machine.region("maincpu")->base();
RAM[0x0004e6/2] = 0x6040; // protection
}
static DRIVER_INIT( avspirit )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ip_select_values[0] = 0x37;
state->ip_select_values[1] = 0x35;
state->ip_select_values[2] = 0x36;
@@ -3656,7 +3656,7 @@ static DRIVER_INIT( avspirit )
static DRIVER_INIT( bigstrik )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ip_select_values[0] = 0x58;
state->ip_select_values[1] = 0x54;
state->ip_select_values[2] = 0x55;
@@ -3666,7 +3666,7 @@ static DRIVER_INIT( bigstrik )
static DRIVER_INIT( chimerab )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
/* same as cybattlr */
state->ip_select_values[0] = 0x56;
state->ip_select_values[1] = 0x52;
@@ -3677,7 +3677,7 @@ static DRIVER_INIT( chimerab )
static DRIVER_INIT( cybattlr )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ip_select_values[0] = 0x56;
state->ip_select_values[1] = 0x52;
state->ip_select_values[2] = 0x53;
@@ -3687,7 +3687,7 @@ static DRIVER_INIT( cybattlr )
static DRIVER_INIT( edf )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ip_select_values[0] = 0x20;
state->ip_select_values[1] = 0x21;
state->ip_select_values[2] = 0x22;
@@ -3702,7 +3702,7 @@ static READ16_HANDLER( edfbl_input_r )
static DRIVER_INIT( edfbl )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe0002, 0xe000b, FUNC(edfbl_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe0002, 0xe000b, FUNC(edfbl_input_r));
}
@@ -3712,13 +3712,13 @@ static DRIVER_INIT( hachoo )
astyanax_rom_decode(machine, "maincpu");
- RAM = (UINT16 *) machine->region("maincpu")->base();
+ RAM = (UINT16 *) machine.region("maincpu")->base();
RAM[0x0006da/2] = 0x6000; // protection
}
static DRIVER_INIT( hayaosi1 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
state->ip_select_values[0] = 0x51;
state->ip_select_values[1] = 0x52;
state->ip_select_values[2] = 0x53;
@@ -3732,7 +3732,7 @@ static DRIVER_INIT( iganinju )
phantasm_rom_decode(machine, "maincpu");
- RAM = (UINT16 *) machine->region("maincpu")->base();
+ RAM = (UINT16 *) machine.region("maincpu")->base();
RAM[0x02f000/2] = 0x835d; // protection
RAM[0x00006e/2] = 0x0420; // the only game that does
@@ -3748,9 +3748,9 @@ static WRITE16_DEVICE_HANDLER( okim6295_both_w )
static DRIVER_INIT( jitsupro )
{
- device_t *oki1 = machine->device("oki1");
- device_t *oki2 = machine->device("oki2");
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ device_t *oki1 = machine.device("oki1");
+ device_t *oki2 = machine.device("oki2");
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
astyanax_rom_decode(machine, "maincpu"); // Code
@@ -3761,13 +3761,13 @@ static DRIVER_INIT( jitsupro )
RAM[0x438/2] = 0x4e71; //
/* the sound code writes oki commands to both the lsb and msb */
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki1, 0xa0000, 0xa0003, FUNC(okim6295_both_w));
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki2, 0xc0000, 0xc0003, FUNC(okim6295_both_w));
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki1, 0xa0000, 0xa0003, FUNC(okim6295_both_w));
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki2, 0xc0000, 0xc0003, FUNC(okim6295_both_w));
}
static DRIVER_INIT( peekaboo )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x100000, 0x100001, FUNC(protection_peekaboo_r), FUNC(protection_peekaboo_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x100000, 0x100001, FUNC(protection_peekaboo_r), FUNC(protection_peekaboo_w));
}
static DRIVER_INIT( phantasm )
@@ -3781,7 +3781,7 @@ static DRIVER_INIT( plusalph )
astyanax_rom_decode(machine, "maincpu");
- RAM = (UINT16 *) machine->region("maincpu")->base();
+ RAM = (UINT16 *) machine.region("maincpu")->base();
RAM[0x0012b6/2] = 0x0000; // protection
}
@@ -3800,12 +3800,12 @@ static DRIVER_INIT( rodlandj )
static READ16_HANDLER( soldamj_spriteram16_r )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
return state->spriteram[offset];
}
static WRITE16_HANDLER( soldamj_spriteram16_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
if (offset < 0x800/2) COMBINE_DATA(&state->spriteram[offset]);
}
@@ -3814,7 +3814,7 @@ static DRIVER_INIT( soldamj )
astyanax_rom_decode(machine, "maincpu");
/* Sprite RAM is mirrored */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8c000, 0x8cfff, FUNC(soldamj_spriteram16_r), FUNC(soldamj_spriteram16_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8c000, 0x8cfff, FUNC(soldamj_spriteram16_r), FUNC(soldamj_spriteram16_w));
}
static DRIVER_INIT( soldam )
@@ -3822,7 +3822,7 @@ static DRIVER_INIT( soldam )
phantasm_rom_decode(machine, "maincpu");
/* Sprite RAM is mirrored */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8c000, 0x8cfff, FUNC(soldamj_spriteram16_r), FUNC(soldamj_spriteram16_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8c000, 0x8cfff, FUNC(soldamj_spriteram16_r), FUNC(soldamj_spriteram16_w));
}
@@ -3832,7 +3832,7 @@ static DRIVER_INIT( stdragon )
phantasm_rom_decode(machine, "maincpu");
- RAM = (UINT16 *) machine->region("maincpu")->base();
+ RAM = (UINT16 *) machine.region("maincpu")->base();
RAM[0x00045e/2] = 0x0098; // protection
}
@@ -3843,11 +3843,11 @@ static READ16_HANDLER( monkelf_input_r )
static DRIVER_INIT( monkelf )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
- UINT16 *ROM = (UINT16*)machine->region("maincpu")->base();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
+ UINT16 *ROM = (UINT16*)machine.region("maincpu")->base();
ROM[0x00744/2] = 0x4e71;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe0000, 0xe000f, FUNC(monkelf_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe0000, 0xe000f, FUNC(monkelf_input_r));
state->ram += 0x10000/2;
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 701ba14f44f..6c4a5e5e873 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -209,7 +209,7 @@ INPUT_PORTS_END
/* MEGATECH specific */
static READ8_HANDLER( megatech_cart_select_r )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
return state->mt_cart_select_reg;
}
@@ -217,14 +217,14 @@ static READ8_HANDLER( megatech_cart_select_r )
static TIMER_CALLBACK( megatech_z80_run_state )
{
- mtech_state *state = machine->driver_data<mtech_state>();
+ mtech_state *state = machine.driver_data<mtech_state>();
char tempname[20];
UINT8* game_region;
sprintf(tempname, "game%d", param);
- game_region = machine->region(tempname)->base();
+ game_region = machine.region(tempname)->base();
- memcpy(machine->region("maincpu")->base(), game_region, 0x400000);
+ memcpy(machine.region("maincpu")->base(), game_region, 0x400000);
if (!state->cart_is_genesis[param])
{
@@ -252,7 +252,7 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
printf("megatech_select_game %d\n", param+1);
sprintf(tempname, "game%d", param);
- game_region = machine->region(tempname)->base();
+ game_region = machine.region(tempname)->base();
cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, ASSERT_LINE);
@@ -268,22 +268,22 @@ static TIMER_CALLBACK( megatech_z80_stop_state )
if (game_region)
{
{
- machine->scheduler().timer_set(attotime::zero, FUNC(megatech_z80_run_state), param);
+ machine.scheduler().timer_set(attotime::zero, FUNC(megatech_z80_run_state), param);
}
}
else
{
/* no cart.. */
- memset(machine->region("mtbios")->base() + 0x8000, 0x00, 0x8000);
- memset(machine->region("maincpu")->base(), 0x00, 0x400000);
+ memset(machine.region("mtbios")->base() + 0x8000, 0x00, 0x8000);
+ memset(machine.region("maincpu")->base(), 0x00, 0x400000);
}
return;
}
-static void megatech_select_game(running_machine *machine, int gameno)
+static void megatech_select_game(running_machine &machine, int gameno)
{
- machine->scheduler().timer_set(attotime::zero, FUNC(megatech_z80_stop_state), gameno);
+ machine.scheduler().timer_set(attotime::zero, FUNC(megatech_z80_stop_state), gameno);
}
static WRITE8_HANDLER( megatech_cart_select_w )
@@ -292,16 +292,16 @@ static WRITE8_HANDLER( megatech_cart_select_w )
but it stores something in (banked?) ram
because it always seems to show the
same instructions ... */
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
state->mt_cart_select_reg = data;
- megatech_select_game(space->machine, state->mt_cart_select_reg);
+ megatech_select_game(space->machine(), state->mt_cart_select_reg);
}
static READ8_HANDLER( bios_ctrl_r )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
if (offset == 0)
return 0;
@@ -313,7 +313,7 @@ static READ8_HANDLER( bios_ctrl_r )
static WRITE8_HANDLER( bios_ctrl_w )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
if (offset == 1)
{
state->bios_ctrl_inputs = data & 0x04; // Genesis/SMS input ports disable bit
@@ -326,39 +326,39 @@ static WRITE8_HANDLER( bios_ctrl_w )
static READ8_HANDLER( megatech_z80_read_68k_banked_data )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
- address_space *space68k = space->machine->device<legacy_cpu_device>("maincpu")->space();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
+ address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
UINT8 ret = space68k->read_byte(state->mt_bank_addr + offset);
return ret;
}
static WRITE8_HANDLER( megatech_z80_write_68k_banked_data )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
- address_space *space68k = space->machine->device<legacy_cpu_device>("maincpu")->space();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
+ address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
space68k->write_byte(state->mt_bank_addr + offset,data);
}
-static void megatech_z80_bank_w(running_machine *machine, UINT16 data)
+static void megatech_z80_bank_w(running_machine &machine, UINT16 data)
{
- mtech_state *state = machine->driver_data<mtech_state>();
+ mtech_state *state = machine.driver_data<mtech_state>();
state->mt_bank_addr = ((state->mt_bank_addr >> 1) | (data << 23)) & 0xff8000;
}
static WRITE8_HANDLER( mt_z80_bank_w )
{
- megatech_z80_bank_w(space->machine, data & 1);
+ megatech_z80_bank_w(space->machine(), data & 1);
}
static READ8_HANDLER( megatech_banked_ram_r )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
return state->megatech_banked_ram[offset + 0x1000 * (state->mt_cart_select_reg & 0x07)];
}
static WRITE8_HANDLER( megatech_banked_ram_w )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
state->megatech_banked_ram[offset + 0x1000 * (state->mt_cart_select_reg & 0x07)] = data;
}
@@ -384,14 +384,14 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( megatech_bios_port_ctrl_w )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
+ mtech_state *state = space->machine().driver_data<mtech_state>();
state->bios_port_ctrl = data;
}
static READ8_HANDLER( megatech_bios_joypad_r )
{
- mtech_state *state = space->machine->driver_data<mtech_state>();
- return megatech_bios_port_cc_dc_r(space->machine, offset, state->bios_port_ctrl);
+ mtech_state *state = space->machine().driver_data<mtech_state>();
+ return megatech_bios_port_cc_dc_r(space->machine(), offset, state->bios_port_ctrl);
}
static WRITE8_HANDLER (megatech_bios_port_7f_w)
@@ -416,7 +416,7 @@ ADDRESS_MAP_END
static DRIVER_INIT(mt_slot)
{
- mtech_state *state = machine->driver_data<mtech_state>();
+ mtech_state *state = machine.driver_data<mtech_state>();
state->megatech_banked_ram = auto_alloc_array(machine, UINT8, 0x1000*8);
DRIVER_INIT_CALL(megadriv);
@@ -428,8 +428,8 @@ static DRIVER_INIT(mt_slot)
static DRIVER_INIT(mt_crt)
{
- mtech_state *state = machine->driver_data<mtech_state>();
- UINT8* pin = machine->region("sms_pin")->base();
+ mtech_state *state = machine.driver_data<mtech_state>();
+ UINT8* pin = machine.region("sms_pin")->base();
DRIVER_INIT_CALL(mt_slot);
state->cart_is_genesis[0] = !pin[0] ? 1 : 0;;
@@ -444,9 +444,9 @@ static VIDEO_START(mtnew)
//attotime::never
static SCREEN_UPDATE(mtnew)
{
- mtech_state *state = screen->machine->driver_data<mtech_state>();
- device_t *megadriv_screen = screen->machine->device("megadriv");
- device_t *menu_screen = screen->machine->device("menu");
+ mtech_state *state = screen->machine().driver_data<mtech_state>();
+ device_t *megadriv_screen = screen->machine().device("megadriv");
+ device_t *menu_screen = screen->machine().device("menu");
if (screen == megadriv_screen)
{
@@ -463,7 +463,7 @@ static SCREEN_UPDATE(mtnew)
static SCREEN_EOF(mtnew)
{
- mtech_state *state = machine->driver_data<mtech_state>();
+ mtech_state *state = machine.driver_data<mtech_state>();
if (!state->current_game_is_sms)
SCREEN_EOF_CALL(megadriv);
else
@@ -474,7 +474,7 @@ static SCREEN_EOF(mtnew)
static MACHINE_RESET(mtnew)
{
- mtech_state *state = machine->driver_data<mtech_state>();
+ mtech_state *state = machine.driver_data<mtech_state>();
state->mt_bank_addr = 0;
MACHINE_RESET_CALL(megadriv);
@@ -539,7 +539,7 @@ static const struct megatech_cart_region megatech_cart_table[] =
static DEVICE_IMAGE_LOAD( megatech_cart )
{
- mtech_state *state = image.device().machine->driver_data<mtech_state>();
+ mtech_state *state = image.device().machine().driver_data<mtech_state>();
const struct megatech_cart_region *mt_cart = &megatech_cart_table[0], *this_cart;
const char *pcb_name;
@@ -558,7 +558,7 @@ static DEVICE_IMAGE_LOAD( megatech_cart )
return IMAGE_INIT_FAIL;
//printf("load list\n");
- UINT8 *ROM = image.device().machine->region(this_cart->region)->base();
+ UINT8 *ROM = image.device().machine().region(this_cart->region)->base();
//printf("load list2\n");
UINT32 length = image.get_software_region_length("rom");
memcpy(ROM, image.get_software_region("rom"), length);
diff --git a/src/mame/drivers/megazone.c b/src/mame/drivers/megazone.c
index 603b2537143..3213fa8547f 100644
--- a/src/mame/drivers/megazone.c
+++ b/src/mame/drivers/megazone.c
@@ -20,7 +20,7 @@ To enter service mode, keep 1&2 pressed on reset
static READ8_DEVICE_HANDLER( megazone_port_a_r )
{
- megazone_state *state = device->machine->driver_data<megazone_state>();
+ megazone_state *state = device->machine().driver_data<megazone_state>();
int clock, timer;
@@ -52,19 +52,19 @@ static WRITE8_DEVICE_HANDLER( megazone_port_b_w )
C += 220000; /* 220000pF = 0.22uF */
data >>= 2;
- filter_rc_set_RC(device->machine->device(fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C));
+ filter_rc_set_RC(device->machine().device(fltname[i]),FLT_RC_LOWPASS,1000,2200,200,CAP_P(C));
}
}
static WRITE8_HANDLER( megazone_i8039_irq_w )
{
- megazone_state *state = space->machine->driver_data<megazone_state>();
+ megazone_state *state = space->machine().driver_data<megazone_state>();
device_set_input_line(state->daccpu, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_and_status_w )
{
- megazone_state *state = space->machine->driver_data<megazone_state>();
+ megazone_state *state = space->machine().driver_data<megazone_state>();
if ((data & 0x80) == 0)
device_set_input_line(state->daccpu, 0, CLEAR_LINE);
@@ -73,7 +73,7 @@ static WRITE8_HANDLER( i8039_irqen_and_status_w )
static WRITE8_HANDLER( megazone_coin_counter_w )
{
- coin_counter_w(space->machine, 1 - offset, data); /* 1-offset, because coin counters are in reversed order */
+ coin_counter_w(space->machine(), 1 - offset, data); /* 1-offset, because coin counters are in reversed order */
}
@@ -226,11 +226,11 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( megazone )
{
- megazone_state *state = machine->driver_data<megazone_state>();
+ megazone_state *state = machine.driver_data<megazone_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->daccpu = machine->device<cpu_device>("daccpu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->daccpu = machine.device<cpu_device>("daccpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->i8039_status));
@@ -238,7 +238,7 @@ static MACHINE_START( megazone )
static MACHINE_RESET( megazone )
{
- megazone_state *state = machine->driver_data<megazone_state>();
+ megazone_state *state = machine.driver_data<megazone_state>();
state->flipscreen = 0;
state->i8039_status = 0;
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index 7525a200dad..390555f5a60 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -95,7 +95,7 @@ static WRITE16_HANDLER( sound_w )
static READ16_HANDLER( alpha_mcu_r )
{
- meijinsn_state *state = space->machine->driver_data<meijinsn_state>();
+ meijinsn_state *state = space->machine().driver_data<meijinsn_state>();
static const UINT8 coinage1[2][2] = {{1,1}, {1,2}};
static const UINT8 coinage2[2][2] = {{1,5}, {2,1}};
@@ -104,7 +104,7 @@ static READ16_HANDLER( alpha_mcu_r )
switch (offset)
{
case 0: /* Dipswitch 2 */
- state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "DSW");
+ state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "DSW");
return 0;
case 0x22: /* Coin value */
@@ -115,16 +115,16 @@ static READ16_HANDLER( alpha_mcu_r )
state->credits = 0;
- if ((input_port_read(space->machine, "COINS") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "COINS") & 0x3) == 3)
state->mcu_latch = 0;
- if ((input_port_read(space->machine, "COINS") & 0x1) == 0 && !state->mcu_latch)
+ if ((input_port_read(space->machine(), "COINS") & 0x1) == 0 && !state->mcu_latch)
{
state->shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x00;
state->mcu_latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "DSW")>>3) & 1;
+ state->coinvalue = (~input_port_read(space->machine(), "DSW")>>3) & 1;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
@@ -135,13 +135,13 @@ static READ16_HANDLER( alpha_mcu_r )
else
state->credits = 0;
}
- else if ((input_port_read(space->machine, "COINS") & 0x2) == 0 && !state->mcu_latch)
+ else if ((input_port_read(space->machine(), "COINS") & 0x2) == 0 && !state->mcu_latch)
{
state->shared_ram[0x29] = (source & 0xff00) | 0x22; // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x00;
state->mcu_latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "DSW") >> 3) & 1;
+ state->coinvalue = (~input_port_read(space->machine(), "DSW") >> 3) & 1;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
@@ -251,7 +251,7 @@ static PALETTE_INIT( meijinsn )
3, resistances_rg, weights_g, 0, 1000+1000,
2, resistances_b, weights_b, 0, 1000+1000);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -279,7 +279,7 @@ static PALETTE_INIT( meijinsn )
static SCREEN_UPDATE(meijinsn)
{
- meijinsn_state *state = screen->machine->driver_data<meijinsn_state>();
+ meijinsn_state *state = screen->machine().driver_data<meijinsn_state>();
int offs;
for (offs = 0; offs < 0x4000; offs++)
@@ -320,7 +320,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( meijinsn )
{
- meijinsn_state *state = machine->driver_data<meijinsn_state>();
+ meijinsn_state *state = machine.driver_data<meijinsn_state>();
state->save_item(NAME(state->deposits1));
state->save_item(NAME(state->deposits2));
@@ -329,7 +329,7 @@ static MACHINE_START( meijinsn )
static MACHINE_RESET( meijinsn )
{
- meijinsn_state *state = machine->driver_data<meijinsn_state>();
+ meijinsn_state *state = machine.driver_data<meijinsn_state>();
state->deposits1 = 0;
state->deposits2 = 0;
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index 4d9ebaa0888..cc43c5b6f13 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -75,7 +75,7 @@ public:
static MACHINE_START(merit)
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->question_address = 0;
state->ram_palette = auto_alloc_array(machine, UINT8, RAM_PALETTE_SIZE);
@@ -89,8 +89,8 @@ static MACHINE_START(merit)
static READ8_HANDLER( questions_r )
{
- merit_state *state = space->machine->driver_data<merit_state>();
- UINT8 *questions = space->machine->region("user1")->base();
+ merit_state *state = space->machine().driver_data<merit_state>();
+ UINT8 *questions = space->machine().region("user1")->base();
int address;
switch(state->question_address >> 16)
@@ -142,7 +142,7 @@ static READ8_HANDLER( questions_r )
static WRITE8_HANDLER( low_offset_w )
{
- merit_state *state = space->machine->driver_data<merit_state>();
+ merit_state *state = space->machine().driver_data<merit_state>();
offset = (offset & 0xf0) | ((offset - state->decryption_key) & 0x0f);
offset = BITSWAP8(offset,7,6,5,4,0,1,2,3);
state->question_address = (state->question_address & 0xffff00) | offset;
@@ -150,7 +150,7 @@ static WRITE8_HANDLER( low_offset_w )
static WRITE8_HANDLER( med_offset_w )
{
- merit_state *state = space->machine->driver_data<merit_state>();
+ merit_state *state = space->machine().driver_data<merit_state>();
offset = (offset & 0xf0) | ((offset - state->decryption_key) & 0x0f);
offset = BITSWAP8(offset,7,6,5,4,0,1,2,3);
state->question_address = (state->question_address & 0xff00ff) | (offset << 8);
@@ -158,14 +158,14 @@ static WRITE8_HANDLER( med_offset_w )
static WRITE8_HANDLER( high_offset_w )
{
- merit_state *state = space->machine->driver_data<merit_state>();
+ merit_state *state = space->machine().driver_data<merit_state>();
offset = BITSWAP8(offset,7,6,5,4,0,1,2,3);
state->question_address = (state->question_address & 0x00ffff) | (offset << 16);
}
static READ8_HANDLER( palette_r )
{
- merit_state *state = space->machine->driver_data<merit_state>();
+ merit_state *state = space->machine().driver_data<merit_state>();
int co;
co = ((state->ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
@@ -174,10 +174,10 @@ static READ8_HANDLER( palette_r )
static WRITE8_HANDLER( palette_w )
{
- merit_state *state = space->machine->driver_data<merit_state>();
+ merit_state *state = space->machine().driver_data<merit_state>();
int co;
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
data &= 0x0f;
co = ((state->ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
@@ -188,7 +188,7 @@ static WRITE8_HANDLER( palette_w )
static MC6845_BEGIN_UPDATE( begin_update )
{
- merit_state *state = device->machine->driver_data<merit_state>();
+ merit_state *state = device->machine().driver_data<merit_state>();
int i;
int dim, bit0, bit1, bit2;
@@ -207,7 +207,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- merit_state *state = device->machine->driver_data<merit_state>();
+ merit_state *state = device->machine().driver_data<merit_state>();
UINT8 cx;
pen_t *pens = (pen_t *)param;
@@ -215,9 +215,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine->region("gfx1")->base();
- gfx[1] = device->machine->region("gfx2")->base();
- rlen = device->machine->region("gfx2")->bytes();
+ gfx[0] = device->machine().region("gfx1")->base();
+ gfx[1] = device->machine().region("gfx2")->base();
+ rlen = device->machine().region("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
@@ -258,12 +258,12 @@ static MC6845_UPDATE_ROW( update_row )
static WRITE_LINE_DEVICE_HANDLER(hsync_changed)
{
/* update any video up to the current scanline */
- device->machine->primary_screen->update_now();
+ device->machine().primary_screen->update_now();
}
static WRITE_LINE_DEVICE_HANDLER(vsync_changed)
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
}
static const mc6845_interface mc6845_intf =
@@ -283,30 +283,30 @@ static const mc6845_interface mc6845_intf =
static WRITE8_DEVICE_HANDLER( led1_w )
{
/* 5 button lamps player 1 */
- set_led_status(device->machine, 0,~data & 0x01);
- set_led_status(device->machine, 1,~data & 0x02);
- set_led_status(device->machine, 2,~data & 0x04);
- set_led_status(device->machine, 3,~data & 0x08);
- set_led_status(device->machine, 4,~data & 0x10);
+ set_led_status(device->machine(), 0,~data & 0x01);
+ set_led_status(device->machine(), 1,~data & 0x02);
+ set_led_status(device->machine(), 2,~data & 0x04);
+ set_led_status(device->machine(), 3,~data & 0x08);
+ set_led_status(device->machine(), 4,~data & 0x10);
}
static WRITE8_DEVICE_HANDLER( led2_w )
{
/* 5 button lamps player 2 */
- set_led_status(device->machine, 5,~data & 0x01);
- set_led_status(device->machine, 6,~data & 0x02);
- set_led_status(device->machine, 7,~data & 0x04);
- set_led_status(device->machine, 8,~data & 0x08);
- set_led_status(device->machine, 9,~data & 0x10);
+ set_led_status(device->machine(), 5,~data & 0x01);
+ set_led_status(device->machine(), 6,~data & 0x02);
+ set_led_status(device->machine(), 7,~data & 0x04);
+ set_led_status(device->machine(), 8,~data & 0x08);
+ set_led_status(device->machine(), 9,~data & 0x10);
/* coin counter */
- coin_counter_w(device->machine,0,0x80-(data & 0x80));
+ coin_counter_w(device->machine(),0,0x80-(data & 0x80));
}
static WRITE8_DEVICE_HANDLER( misc_w )
{
- merit_state *state = device->machine->driver_data<merit_state>();
- flip_screen_set(device->machine, ~data & 0x10);
+ merit_state *state = device->machine().driver_data<merit_state>();
+ flip_screen_set(device->machine(), ~data & 0x10);
state->extra_video_bank_bit = (data & 2) << 8;
state->lscnblk = (data >> 3) & 1;
@@ -315,8 +315,8 @@ static WRITE8_DEVICE_HANDLER( misc_w )
static WRITE8_DEVICE_HANDLER( misc_couple_w )
{
- merit_state *state = device->machine->driver_data<merit_state>();
- flip_screen_set(device->machine, ~data & 0x10);
+ merit_state *state = device->machine().driver_data<merit_state>();
+ flip_screen_set(device->machine(), ~data & 0x10);
state->extra_video_bank_bit = (data & 2) << 8;
state->lscnblk = (data >> 3) & 1;
@@ -330,13 +330,13 @@ static WRITE8_HANDLER(casino5_bank_w)
{
if ( data == 0 )
{
- memory_set_bank(space->machine, "bank1", 1);
- memory_set_bank(space->machine, "bank2", 1);
+ memory_set_bank(space->machine(), "bank1", 1);
+ memory_set_bank(space->machine(), "bank2", 1);
}
else if ( data == 0xff )
{
- memory_set_bank(space->machine, "bank1", 0);
- memory_set_bank(space->machine, "bank2", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
+ memory_set_bank(space->machine(), "bank2", 0);
}
else
{
@@ -346,7 +346,7 @@ static WRITE8_HANDLER(casino5_bank_w)
static CUSTOM_INPUT(rndbit_r)
{
- return field->port->machine->rand();
+ return field->port->machine().rand();
}
static ADDRESS_MAP_START( pitboss_map, AS_PROGRAM, 8 )
@@ -1155,7 +1155,7 @@ INPUT_PORTS_END
static SCREEN_UPDATE( merit )
{
- device_t *mc6845 = screen->machine->device("crtc");
+ device_t *mc6845 = screen->machine().device("crtc");
mc6845_update(mc6845, bitmap, cliprect);
return 0;
@@ -1218,8 +1218,8 @@ void merit_state::dodge_nvram_init(nvram_device &nvram, void *base, size_t size)
static MACHINE_START(casino5)
{
MACHINE_START_CALL(merit);
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x2000, 0x2000);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("maincpu")->base() + 0x6000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x2000, 0x2000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("maincpu")->base() + 0x6000, 0x2000);
memory_set_bank(machine, "bank1", 0);
memory_set_bank(machine, "bank2", 0);
}
@@ -1995,37 +1995,37 @@ ROM_END
static DRIVER_INIT( key_0 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->decryption_key = 0;
}
static DRIVER_INIT( key_2 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->decryption_key = 2;
}
static DRIVER_INIT( key_4 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->decryption_key = 4;
}
static DRIVER_INIT( key_5 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->decryption_key = 5;
}
static DRIVER_INIT( key_7 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
state->decryption_key = 7;
}
static DRIVER_INIT( couple )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
#if 0 //quick rom compare test
{
@@ -2050,9 +2050,9 @@ static DRIVER_INIT( couple )
static DRIVER_INIT( dtrvwz5 )
{
- merit_state *state = machine->driver_data<merit_state>();
+ merit_state *state = machine.driver_data<merit_state>();
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* fill b000 - b0ff with ret 0xc9 */
for ( i = 0xb000; i < 0xb100; i++ )
ROM[i] = 0xc9;
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 207f8c1fa08..ecf66dd0f7d 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -247,9 +247,9 @@ static int ds1204_r(ds1204_t *ds1204)
return ds1204->out_bit;
};
-static void ds1204_init(running_machine *machine, const UINT8* key, const UINT8* nvram)
+static void ds1204_init(running_machine &machine, const UINT8* key, const UINT8* nvram)
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
memset(&state->ds1204, 0, sizeof(state->ds1204));
if (key)
memcpy(state->ds1204.key, key, sizeof(state->ds1204.key));
@@ -274,7 +274,7 @@ static void pc16650d_tx_callback(int channel, int count, UINT8* data)
microtouch_rx(count, data);
};
-static void meritm_microtouch_tx_callback(running_machine *machine, UINT8 data)
+static void meritm_microtouch_tx_callback(running_machine &machine, UINT8 data)
{
pc16552d_rx_data(machine, 0, 0, data);
};
@@ -284,7 +284,7 @@ static void meritm_microtouch_tx_callback(running_machine *machine, UINT8 data)
* Microtouch touch coordinate transformation
*
*************************************/
-static int meritm_touch_coord_transform(running_machine *machine, int *touch_x, int *touch_y)
+static int meritm_touch_coord_transform(running_machine &machine, int *touch_x, int *touch_y)
{
int xscr = (int)((double)(*touch_x)/0x4000*544);
int yscr = (int)((double)(*touch_y)/0x4000*480);
@@ -320,20 +320,20 @@ static INTERRUPT_GEN( meritm_interrupt )
{
v9938_set_sprite_limit(0, 0);
v9938_set_resolution(0, RENDER_HIGH);
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
v9938_set_sprite_limit(1, 0);
v9938_set_resolution(1, RENDER_HIGH);
- v9938_interrupt(device->machine, 1);
+ v9938_interrupt(device->machine(), 1);
}
-static void meritm_vdp0_interrupt(running_machine *machine, int i)
+static void meritm_vdp0_interrupt(running_machine &machine, int i)
{
/* this is not used as the v9938 interrupt callbacks are broken
interrupts seem to be fired quite randomly */
}
-static void meritm_vdp1_interrupt(running_machine *machine, int i)
+static void meritm_vdp1_interrupt(running_machine &machine, int i)
{
/* this is not used as the v9938 interrupt callbacks are broken
interrupts seem to be fired quite randomly */
@@ -342,15 +342,15 @@ static void meritm_vdp1_interrupt(running_machine *machine, int i)
static VIDEO_START( meritm )
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
state->layer0_enabled = state->layer1_enabled = 1;
- state->vdp0_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- v9938_init (machine, 0, *machine->primary_screen, state->vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
+ state->vdp0_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ v9938_init (machine, 0, *machine.primary_screen, state->vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
v9938_reset(0);
- state->vdp1_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- v9938_init (machine, 1, *machine->primary_screen, state->vdp1_bitmap, MODEL_V9938, 0x20000, meritm_vdp1_interrupt);
+ state->vdp1_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ v9938_init (machine, 1, *machine.primary_screen, state->vdp1_bitmap, MODEL_V9938, 0x20000, meritm_vdp1_interrupt);
v9938_reset(1);
state->vint = 0x18;
@@ -364,19 +364,19 @@ static VIDEO_START( meritm )
static SCREEN_UPDATE( meritm )
{
- meritm_state *state = screen->machine->driver_data<meritm_state>();
- if(input_code_pressed_once(screen->machine, KEYCODE_Q))
+ meritm_state *state = screen->machine().driver_data<meritm_state>();
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Q))
{
state->layer0_enabled^=1;
popmessage("Layer 0 %sabled",state->layer0_enabled ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_W))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_W))
{
state->layer1_enabled^=1;
popmessage("Layer 1 %sabled",state->layer1_enabled ? "en" : "dis");
}
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if ( state->layer0_enabled )
{
@@ -397,9 +397,9 @@ static SCREEN_UPDATE( meritm )
*************************************/
-static void meritm_crt250_switch_banks( running_machine *machine )
+static void meritm_crt250_switch_banks( running_machine &machine )
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
int rombank = (state->bank & 0x07) ^ 0x07;
//logerror( "CRT250: Switching banks: rom = %0x (bank = %x)\n", rombank, state->bank );
@@ -408,12 +408,12 @@ static void meritm_crt250_switch_banks( running_machine *machine )
static WRITE8_HANDLER(meritm_crt250_bank_w)
{
- meritm_crt250_switch_banks(space->machine);
+ meritm_crt250_switch_banks(space->machine());
};
-static void meritm_switch_banks( running_machine *machine )
+static void meritm_switch_banks( running_machine &machine )
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
int rambank = (state->psd_a15 >> 2) & 0x3;
int rombank = (((state->bank >> 3) & 0x3) << 5) |
(((state->psd_a15 >> 1) & 0x1) << 4) |
@@ -428,15 +428,15 @@ static void meritm_switch_banks( running_machine *machine )
static WRITE8_HANDLER(meritm_psd_a15_w)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
state->psd_a15 = data;
//logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, cpu_get_pc(space->cpu) );
- meritm_switch_banks(space->machine);
+ meritm_switch_banks(space->machine());
};
static WRITE8_HANDLER(meritm_bank_w)
{
- meritm_switch_banks(space->machine);
+ meritm_switch_banks(space->machine());
};
/*************************************
@@ -448,21 +448,21 @@ static WRITE8_HANDLER(meritm_bank_w)
static WRITE8_HANDLER(meritm_crt250_questions_lo_w)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
state->questions_loword_address &= 0xff00;
state->questions_loword_address |= data;
};
static WRITE8_HANDLER(meritm_crt250_questions_hi_w)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
state->questions_loword_address &= 0x00ff;
state->questions_loword_address |= (data << 8);
};
static WRITE8_HANDLER(meritm_crt250_questions_bank_w)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
UINT32 questions_address;
UINT8 *dst;
@@ -472,7 +472,7 @@ static WRITE8_HANDLER(meritm_crt250_questions_bank_w)
return;
}
- dst = space->machine->region("maincpu")->base() + 0x70000 + 2;
+ dst = space->machine().region("maincpu")->base() + 0x70000 + 2;
if (data == 0)
{
@@ -501,7 +501,7 @@ static WRITE8_HANDLER(meritm_crt250_questions_bank_w)
default: logerror( "meritm_crt250_questions_bank_w: unknown data = %02x\n", data ); return;
}
logerror( "Reading question byte at %06X\n", questions_address | state->questions_loword_address);
- *dst = space->machine->region("extra")->base()[questions_address | state->questions_loword_address];
+ *dst = space->machine().region("extra")->base()[questions_address | state->questions_loword_address];
}
};
@@ -514,7 +514,7 @@ static WRITE8_HANDLER(meritm_crt250_questions_bank_w)
static WRITE8_HANDLER(meritm_ds1644_w)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
int rambank = (state->psd_a15 >> 2) & 0x3;
if (rambank < 3)
{
@@ -539,14 +539,14 @@ static UINT8 binary_to_BCD(UINT8 data)
static READ8_HANDLER(meritm_ds1644_r)
{
- meritm_state *state = space->machine->driver_data<meritm_state>();
+ meritm_state *state = space->machine().driver_data<meritm_state>();
system_time systime;
int rambank = (state->psd_a15 >> 2) & 0x3;
if (rambank == 3)
{
//logerror( "Reading RTC, reg = %x\n", offset);
- space->machine->current_datetime(systime);
+ space->machine().current_datetime(systime);
state->ram[0x7ff9] = binary_to_BCD(systime.local_time.second);
state->ram[0x7ffa] = binary_to_BCD(systime.local_time.minute);
state->ram[0x7ffb] = binary_to_BCD(systime.local_time.hour);
@@ -836,7 +836,7 @@ static const ay8910_interface ay8910_config =
static READ8_DEVICE_HANDLER(meritm_audio_pio_port_a_r)
{
- meritm_state *state = device->machine->driver_data<meritm_state>();
+ meritm_state *state = device->machine().driver_data<meritm_state>();
/*
bit signal description
@@ -857,7 +857,7 @@ static READ8_DEVICE_HANDLER(meritm_audio_pio_port_a_r)
static READ8_DEVICE_HANDLER(meritm_audio_pio_port_b_r)
{
- meritm_state *state = device->machine->driver_data<meritm_state>();
+ meritm_state *state = device->machine().driver_data<meritm_state>();
/*
bit description
@@ -878,7 +878,7 @@ static READ8_DEVICE_HANDLER(meritm_audio_pio_port_b_r)
static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_a_w)
{
- meritm_state *state = device->machine->driver_data<meritm_state>();
+ meritm_state *state = device->machine().driver_data<meritm_state>();
/*
bit signal description
@@ -900,7 +900,7 @@ static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_a_w)
static WRITE8_DEVICE_HANDLER(meritm_audio_pio_port_b_w)
{
- meritm_state *drvstate = device->machine->driver_data<meritm_state>();
+ meritm_state *drvstate = device->machine().driver_data<meritm_state>();
/*
bit description
@@ -986,9 +986,9 @@ static const z80_daisy_config meritm_daisy_chain[] =
static MACHINE_START(merit_common)
{
- meritm_state *state = machine->driver_data<meritm_state>();
- state->z80pio[0] = machine->device( "z80pio_0" );
- state->z80pio[1] = machine->device( "z80pio_1" );
+ meritm_state *state = machine.driver_data<meritm_state>();
+ state->z80pio[0] = machine.device( "z80pio_0" );
+ state->z80pio[1] = machine.device( "z80pio_1" );
z80pio_astb_w(state->z80pio[0], 1);
z80pio_bstb_w(state->z80pio[0], 1);
@@ -998,8 +998,8 @@ static MACHINE_START(merit_common)
static MACHINE_START(meritm_crt250)
{
- meritm_state *state = machine->driver_data<meritm_state>();
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base(), 0x10000);
+ meritm_state *state = machine.driver_data<meritm_state>();
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base(), 0x10000);
state->bank = 0xff;
meritm_crt250_switch_banks(machine);
MACHINE_START_CALL(merit_common);
@@ -1009,7 +1009,7 @@ static MACHINE_START(meritm_crt250)
static MACHINE_START(meritm_crt250_questions)
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
MACHINE_START_CALL(meritm_crt250);
state_save_register_global(machine, state->questions_loword_address);
};
@@ -1023,12 +1023,12 @@ static MACHINE_START(meritm_crt250_crt252_crt258)
static MACHINE_START(meritm_crt260)
{
- meritm_state *state = machine->driver_data<meritm_state>();
+ meritm_state *state = machine.driver_data<meritm_state>();
state->ram = auto_alloc_array(machine, UINT8, 0x8000 );
- machine->device<nvram_device>("nvram")->set_base(state->ram, 0x8000);
+ machine.device<nvram_device>("nvram")->set_base(state->ram, 0x8000);
memset(state->ram, 0x00, 0x8000);
- memory_configure_bank(machine, "bank1", 0, 128, machine->region("maincpu")->base(), 0x8000);
- memory_configure_bank(machine, "bank2", 0, 128, machine->region("maincpu")->base(), 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 128, machine.region("maincpu")->base(), 0x8000);
+ memory_configure_bank(machine, "bank2", 0, 128, machine.region("maincpu")->base(), 0x8000);
memory_configure_bank(machine, "bank3", 0, 4, state->ram, 0x2000);
state->bank = 0xff;
state->psd_a15 = 0;
@@ -1051,7 +1051,7 @@ static MACHINE_START(meritm_crt260)
static TIMER_DEVICE_CALLBACK( vblank_start_tick )
{
- meritm_state *state = timer.machine->driver_data<meritm_state>();
+ meritm_state *state = timer.machine().driver_data<meritm_state>();
/* this is a workaround to signal the v9938 vblank interrupt correctly */
state->vint = 0x08;
z80pio_pa_w(state->z80pio[0], 0, state->vint);
@@ -1059,7 +1059,7 @@ static TIMER_DEVICE_CALLBACK( vblank_start_tick )
static TIMER_DEVICE_CALLBACK( vblank_end_tick )
{
- meritm_state *state = timer.machine->driver_data<meritm_state>();
+ meritm_state *state = timer.machine().driver_data<meritm_state>();
/* this is a workaround to signal the v9938 vblank interrupt correctly */
state->vint = 0x18;
z80pio_pa_w(state->z80pio[0], 0, state->vint);
@@ -1831,7 +1831,7 @@ static DRIVER_INIT(megat3te)
ds1204_init(machine, megat3_ds1204_key, megat3_ds1204_nvram);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
};
@@ -1850,7 +1850,7 @@ static DRIVER_INIT(megat4te)
ds1204_init(machine, 0, megat4te_ds1204_nvram);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
};
@@ -1861,7 +1861,7 @@ static DRIVER_INIT(megat4st)
ds1204_init(machine, 0, megat4te_ds1204_nvram);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
};
@@ -1881,7 +1881,7 @@ static DRIVER_INIT(megat5t)
ds1204_init(machine, 0, megat5_ds1204_nvram);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfff8, 0xffff, FUNC(meritm_ds1644_r), FUNC(meritm_ds1644_w) );
}
diff --git a/src/mame/drivers/mermaid.c b/src/mame/drivers/mermaid.c
index f779d4f870a..b31b9c7c12a 100644
--- a/src/mame/drivers/mermaid.c
+++ b/src/mame/drivers/mermaid.c
@@ -124,14 +124,14 @@ Stephh's notes (based on the games Z80 code and some tests) :
static WRITE8_HANDLER( mermaid_ay8910_write_port_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
if (state->ay8910_enable[0]) ay8910_data_w(state->ay1, offset, data);
if (state->ay8910_enable[1]) ay8910_data_w(state->ay2, offset, data);
}
static WRITE8_HANDLER( mermaid_ay8910_control_port_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
if (state->ay8910_enable[0]) ay8910_address_w(state->ay1, offset, data);
if (state->ay8910_enable[1]) ay8910_address_w(state->ay2, offset, data);
}
@@ -169,28 +169,28 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( rougien_sample_rom_lo_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->adpcm_rom_sel = (data & 1) | (state->adpcm_rom_sel & 2);
}
static WRITE8_HANDLER( rougien_sample_rom_hi_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->adpcm_rom_sel = ((data & 1)<<1) | (state->adpcm_rom_sel & 1);
}
static WRITE8_HANDLER( rougien_sample_playback_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
if((state->adpcm_play_reg & 1) && ((data & 1) == 0))
{
state->adpcm_pos = state->adpcm_rom_sel*0x1000;
state->adpcm_end = state->adpcm_pos+0x1000;
state->adpcm_idle = 0;
- msm5205_reset_w(space->machine->device("adpcm"), 0);
+ msm5205_reset_w(space->machine().device("adpcm"), 0);
}
state->adpcm_play_reg = data & 1;
@@ -362,11 +362,11 @@ GFXDECODE_END
static MACHINE_START( mermaid )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
- state->maincpu = machine->device("maincpu");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ state->maincpu = machine.device("maincpu");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
state->save_item(NAME(state->coll_bit0));
state->save_item(NAME(state->coll_bit1));
@@ -387,7 +387,7 @@ static MACHINE_START( mermaid )
static MACHINE_RESET( mermaid )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
state->coll_bit0 = 0;
state->coll_bit1 = 0;
@@ -405,7 +405,7 @@ static MACHINE_RESET( mermaid )
/* Similar to Jantotsu, apparently the HW has three ports that controls what kind of sample should be played. Every sample size is 0x1000. */
static void rougien_adpcm_int( device_t *device )
{
- mermaid_state *state = device->machine->driver_data<mermaid_state>();
+ mermaid_state *state = device->machine().driver_data<mermaid_state>();
// popmessage("%08x",state->adpcm_pos);
@@ -417,7 +417,7 @@ static void rougien_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c
index 925ff8b9f1e..4da8e3f31ae 100644
--- a/src/mame/drivers/metalmx.c
+++ b/src/mame/drivers/metalmx.c
@@ -281,7 +281,7 @@ static VIDEO_START( metalmx )
static SCREEN_UPDATE( metalmx )
{
/* TODO: TMS34020 should take care of this */
- metalmx_state *state = screen->machine->driver_data<metalmx_state>();
+ metalmx_state *state = screen->machine().driver_data<metalmx_state>();
// UINT32 *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0];
UINT16 *src_base = state->gsp_vram;
@@ -309,7 +309,7 @@ static SCREEN_UPDATE( metalmx )
static READ32_HANDLER( unk_r )
{
- return 0;//space->machine->rand();
+ return 0;//space->machine().rand();
}
static READ32_HANDLER( watchdog_r )
@@ -329,7 +329,7 @@ static WRITE32_HANDLER( motor_w )
static WRITE32_HANDLER( reset_w )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
if (ACCESSING_BITS_16_31)
{
@@ -360,12 +360,12 @@ static READ32_HANDLER( sound_data_r )
static WRITE32_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_15)
- cage_control_w(space->machine, data);
+ cage_control_w(space->machine(), data);
if (ACCESSING_BITS_16_31)
main_to_cage_w(data >> 16);
}
-static void cage_irq_callback(running_machine *machine, int reason)
+static void cage_irq_callback(running_machine &machine, int reason)
{
/* TODO */
}
@@ -378,7 +378,7 @@ static void cage_irq_callback(running_machine *machine, int reason)
static WRITE32_HANDLER( dsp32c_1_w )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
offset <<= 1;
@@ -392,7 +392,7 @@ static WRITE32_HANDLER( dsp32c_1_w )
static READ32_HANDLER( dsp32c_1_r )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
UINT32 data;
offset <<= 1;
@@ -410,7 +410,7 @@ static READ32_HANDLER( dsp32c_1_r )
static WRITE32_HANDLER( dsp32c_2_w )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
offset <<= 1;
@@ -424,7 +424,7 @@ static WRITE32_HANDLER( dsp32c_2_w )
static READ32_HANDLER( dsp32c_2_r )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
UINT32 data;
offset <<= 1;
@@ -449,7 +449,7 @@ static READ32_HANDLER( dsp32c_2_r )
static WRITE32_HANDLER( host_gsp_w )
{
- address_space *gsp_space = space->machine->device("gsp")->memory().space(AS_PROGRAM);
+ address_space *gsp_space = space->machine().device("gsp")->memory().space(AS_PROGRAM);
gsp_space->write_word((0xc0000000 + (offset << 5) + 0x10) / 8, data);
gsp_space->write_word((0xc0000000 + (offset << 5))/ 8 , data >> 16);
@@ -457,7 +457,7 @@ static WRITE32_HANDLER( host_gsp_w )
static READ32_HANDLER( host_gsp_r )
{
- address_space *gsp_space = space->machine->device("gsp")->memory().space(AS_PROGRAM);
+ address_space *gsp_space = space->machine().device("gsp")->memory().space(AS_PROGRAM);
UINT32 val;
val = gsp_space->read_word((0xc0000000 + (offset << 5) + 0x10) / 8);
@@ -468,14 +468,14 @@ static READ32_HANDLER( host_gsp_r )
static READ32_HANDLER( host_dram_r )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
return (state->gsp_dram[offset * 2] << 16) | state->gsp_dram[offset * 2 + 1];
}
static WRITE32_HANDLER( host_dram_w )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
COMBINE_DATA(state->gsp_dram + offset * 2 + 1);
data >>= 16;
@@ -485,14 +485,14 @@ static WRITE32_HANDLER( host_dram_w )
static READ32_HANDLER( host_vram_r )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
return (state->gsp_vram[offset * 2] << 16) | state->gsp_vram[offset * 2 + 1];
}
static WRITE32_HANDLER( host_vram_w )
{
- metalmx_state *state = space->machine->driver_data<metalmx_state>();
+ metalmx_state *state = space->machine().driver_data<metalmx_state>();
COMBINE_DATA(state->gsp_vram + offset * 2 + 1);
data >>= 16;
@@ -502,7 +502,7 @@ static WRITE32_HANDLER( host_vram_w )
static void tms_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", 4, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 4, state ? HOLD_LINE : CLEAR_LINE);
}
@@ -779,8 +779,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT( metalmx )
{
- UINT8 *adsp_boot = (UINT8*)machine->region("adsp")->base();
- metalmx_state *state = machine->driver_data<metalmx_state>();
+ UINT8 *adsp_boot = (UINT8*)machine.region("adsp")->base();
+ metalmx_state *state = machine.driver_data<metalmx_state>();
state->adsp->load_boot_data(adsp_boot, state->adsp_internal_program_ram);
@@ -790,7 +790,7 @@ static DRIVER_INIT( metalmx )
static MACHINE_RESET( metalmx )
{
- metalmx_state *state = machine->driver_data<metalmx_state>();
+ metalmx_state *state = machine.driver_data<metalmx_state>();
device_set_input_line(state->dsp32c_1, INPUT_LINE_RESET, ASSERT_LINE);
device_set_input_line(state->dsp32c_2, INPUT_LINE_RESET, ASSERT_LINE);
diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c
index 594972da298..a67fd98f2f7 100644
--- a/src/mame/drivers/metlclsh.c
+++ b/src/mame/drivers/metlclsh.c
@@ -47,13 +47,13 @@ metlclsh:
static WRITE8_HANDLER( metlclsh_cause_irq )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, ASSERT_LINE);
}
static WRITE8_HANDLER( metlclsh_ack_nmi )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -86,25 +86,25 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( metlclsh_cause_nmi2 )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( metlclsh_ack_irq2 )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, CLEAR_LINE);
}
static WRITE8_HANDLER( metlclsh_ack_nmi2 )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE);
}
static WRITE8_HANDLER( metlclsh_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static ADDRESS_MAP_START( metlclsh_slave_map, AS_PROGRAM, 8 )
@@ -255,7 +255,7 @@ GFXDECODE_END
static void metlclsh_irqhandler(device_t *device, int linestate)
{
- metlclsh_state *state = device->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = device->machine().driver_data<metlclsh_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, linestate);
}
@@ -269,16 +269,16 @@ static INTERRUPT_GEN( metlclsh_interrupt2 )
if (cpu_getiloops(device) == 0)
return;
/* generate NMI on coin insertion */
- if ((~input_port_read(device->machine, "IN2") & 0xc0) || (~input_port_read(device->machine, "DSW") & 0x40))
+ if ((~input_port_read(device->machine(), "IN2") & 0xc0) || (~input_port_read(device->machine(), "DSW") & 0x40))
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
}
static MACHINE_START( metlclsh )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->write_mask));
state->save_item(NAME(state->gfxbank));
@@ -286,7 +286,7 @@ static MACHINE_START( metlclsh )
static MACHINE_RESET( metlclsh )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
flip_screen_set(machine, 0);
diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c
index 319f1373987..227fcb95a53 100644
--- a/src/mame/drivers/metro.c
+++ b/src/mame/drivers/metro.c
@@ -112,7 +112,7 @@ driver modified by Eisuke Watanabe
static READ16_HANDLER( metro_irq_cause_r )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
return state->requested_int[0] * 0x01 + // vblank
state->requested_int[1] * 0x02 +
@@ -126,9 +126,9 @@ static READ16_HANDLER( metro_irq_cause_r )
/* Update the IRQ state based on all possible causes */
-static void update_irq_state( running_machine *machine )
+static void update_irq_state( running_machine &machine )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
/* Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*) */
@@ -161,16 +161,16 @@ static void update_irq_state( running_machine *machine )
/* For games that supply an *IRQ Vector* on the data bus */
static IRQ_CALLBACK( metro_irq_callback )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
- // logerror("%s: irq callback returns %04X\n", device->machine->describe_context(), state->irq_vectors[int_level]);
+ // logerror("%s: irq callback returns %04X\n", device->machine().describe_context(), state->irq_vectors[int_level]);
return state->irq_vectors[irqline] & 0xff;
}
static WRITE16_HANDLER( metro_irq_cause_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
//if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n", cpu_get_pc(space->cpu), data);
@@ -188,24 +188,24 @@ static WRITE16_HANDLER( metro_irq_cause_w )
if (BIT(data, 7)) state->requested_int[7] = 0;
}
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
}
static INTERRUPT_GEN( metro_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
case 0:
state->requested_int[0] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
default:
state->requested_int[4] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
}
}
@@ -213,27 +213,27 @@ static INTERRUPT_GEN( metro_interrupt )
/* Lev 1. Lev 2 seems sound related */
static INTERRUPT_GEN( bangball_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
state->requested_int[0] = 1; // set scroll regs if a flag is set
state->requested_int[4] = 1; // clear that flag
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
static INTERRUPT_GEN( msgogo_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
case 10:
state->requested_int[0] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
case 224:
state->requested_int[4] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
}
}
@@ -241,14 +241,14 @@ static INTERRUPT_GEN( msgogo_interrupt )
static TIMER_CALLBACK( vblank_end_callback )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->requested_int[5] = param;
}
/* lev 2-7 (lev 1 seems sound related) */
static INTERRUPT_GEN( karatour_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
@@ -256,13 +256,13 @@ static INTERRUPT_GEN( karatour_interrupt )
state->requested_int[0] = 1;
state->requested_int[5] = 1; // write the scroll registers
/* the duration is a guess */
- device->machine->scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback));
- update_irq_state(device->machine);
+ device->machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback));
+ update_irq_state(device->machine());
break;
default:
state->requested_int[4] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
}
}
@@ -270,7 +270,7 @@ static INTERRUPT_GEN( karatour_interrupt )
static TIMER_CALLBACK( mouja_irq_callback )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->requested_int[0] = 1;
update_irq_state(machine);
@@ -278,7 +278,7 @@ static TIMER_CALLBACK( mouja_irq_callback )
static WRITE16_HANDLER( mouja_irq_timer_ctrl_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
double freq = 58.0 + (0xff - (data & 0xff)) / 2.2; /* 0xff=58Hz, 0x80=116Hz? */
state->mouja_irq_timer->adjust(attotime::zero, 0, attotime::from_hz(freq));
@@ -286,46 +286,46 @@ static WRITE16_HANDLER( mouja_irq_timer_ctrl_w )
static INTERRUPT_GEN( mouja_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
state->requested_int[1] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
static INTERRUPT_GEN( gakusai_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
case 0:
state->requested_int[1] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
}
}
static INTERRUPT_GEN( dokyusei_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
case 0:
state->requested_int[1] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
case 1: // needed?
state->requested_int[5] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
}
}
static void ymf278b_interrupt( device_t *device, int active )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
device_set_input_line(state->maincpu, 2, active);
}
@@ -339,7 +339,7 @@ static void ymf278b_interrupt( device_t *device, int active )
static int metro_io_callback( device_t *device, int ioline, int state )
{
- metro_state *driver_state = device->machine->driver_data<metro_state>();
+ metro_state *driver_state = device->machine().driver_data<metro_state>();
address_space *space = driver_state->maincpu->memory().space(AS_PROGRAM);
UINT8 data = 0;
@@ -359,7 +359,7 @@ static int metro_io_callback( device_t *device, int ioline, int state )
static WRITE16_HANDLER( metro_soundlatch_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
{
@@ -373,19 +373,19 @@ static WRITE16_HANDLER( metro_soundlatch_w )
static READ16_HANDLER( metro_soundstatus_r )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
return (state->busy_sndcpu ? 0x00 : 0x01);
}
static CUSTOM_INPUT( custom_soundstatus_r )
{
- metro_state *state = field->port->machine->driver_data<metro_state>();
+ metro_state *state = field->port->machine().driver_data<metro_state>();
return (state->busy_sndcpu ? 0x01 : 0x00);
}
static WRITE16_HANDLER( metro_soundstatus_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
state->soundstatus = data & 0x01;
@@ -395,35 +395,35 @@ static WRITE16_HANDLER( metro_soundstatus_w )
static WRITE8_HANDLER( metro_sound_rombank_w )
{
int bankaddress;
- UINT8 *ROM = space->machine->region("audiocpu")->base();
+ UINT8 *ROM = space->machine().region("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x03) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x0000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
static WRITE8_HANDLER( daitorid_sound_rombank_w )
{
int bankaddress;
- UINT8 *ROM = space->machine->region("audiocpu")->base();
+ UINT8 *ROM = space->machine().region("audiocpu")->base();
bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x07) * 0x4000;
if (bankaddress < 0x10000) bankaddress = 0x10000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
static READ8_HANDLER( metro_porta_r )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
return state->porta;
}
static WRITE8_HANDLER( metro_porta_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
state->porta = data;
}
@@ -440,7 +440,7 @@ static WRITE8_HANDLER( metro_portb_w )
0
*/
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
if (BIT(state->portb, 7) && !BIT(data, 7)) /* clock 1->0 */
{
@@ -482,7 +482,7 @@ static WRITE8_HANDLER( daitorid_portb_w )
1 select YM2151 register or data port
0
*/
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
if (BIT(state->portb, 7) && !BIT(data, 7)) /* clock 1->0 */
{
@@ -528,7 +528,7 @@ static WRITE8_HANDLER( daitorid_portb_w )
static void metro_sound_irq_handler( device_t *device, int state )
{
- metro_state *driver_state = device->machine->driver_data<metro_state>();
+ metro_state *driver_state = device->machine().driver_data<metro_state>();
device_set_input_line(driver_state->audiocpu, UPD7810_INTF2, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -558,8 +558,8 @@ static WRITE16_HANDLER( metro_coin_lockout_1word_w )
{
if (ACCESSING_BITS_0_7)
{
-// coin_lockout_w(space->machine, 0, data & 1);
-// coin_lockout_w(space->machine, 1, data & 2);
+// coin_lockout_w(space->machine(), 0, data & 1);
+// coin_lockout_w(space->machine(), 1, data & 2);
}
if (data & ~3) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", cpu_get_pc(space->cpu), data);
}
@@ -567,7 +567,7 @@ static WRITE16_HANDLER( metro_coin_lockout_1word_w )
static WRITE16_HANDLER( metro_coin_lockout_4words_w )
{
-// coin_lockout_w(space->machine, (offset >> 1) & 1, offset & 1);
+// coin_lockout_w(space->machine(), (offset >> 1) & 1, offset & 1);
if (data & ~1) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n", cpu_get_pc(space->cpu), data);
}
@@ -592,9 +592,9 @@ static WRITE16_HANDLER( metro_coin_lockout_4words_w )
static READ16_HANDLER( metro_bankedrom_r )
{
- metro_state *state = space->machine->driver_data<metro_state>();
- UINT8 *ROM = space->machine->region("gfx1")->base();
- size_t len = space->machine->region("gfx1")->bytes();
+ metro_state *state = space->machine().driver_data<metro_state>();
+ UINT8 *ROM = space->machine().region("gfx1")->base();
+ size_t len = space->machine().region("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*state->rombank);
@@ -655,7 +655,7 @@ static READ16_HANDLER( metro_bankedrom_r )
static TIMER_CALLBACK( metro_blit_done )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->requested_int[state->blitter_bit] = 1;
update_irq_state(machine);
}
@@ -673,19 +673,19 @@ INLINE void blt_write( address_space *space, const int tmap, const offs_t offs,
case 2: metro_vram_1_w(space, offs, data, mask); break;
case 3: metro_vram_2_w(space, offs, data, mask); break;
}
-// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine->describe_context(), tmap, offs, data, mask);
+// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine().describe_context(), tmap, offs, data, mask);
}
static WRITE16_HANDLER( metro_blitter_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
COMBINE_DATA(&state->blitter_regs[offset]);
if (offset == 0x0c / 2)
{
- UINT8 *src = space->machine->region("gfx1")->base();
- size_t src_len = space->machine->region("gfx1")->bytes();
+ UINT8 *src = space->machine().region("gfx1")->base();
+ size_t src_len = space->machine().region("gfx1")->bytes();
UINT32 tmap = (state->blitter_regs[0x00 / 2] << 16) + state->blitter_regs[0x02 / 2];
UINT32 src_offs = (state->blitter_regs[0x04 / 2] << 16) + state->blitter_regs[0x06 / 2];
@@ -729,7 +729,7 @@ static WRITE16_HANDLER( metro_blitter_w )
another blit. */
if (b1 == 0)
{
- space->machine->scheduler().timer_set(attotime::from_usec(500), FUNC(metro_blit_done));
+ space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(metro_blit_done));
return;
}
@@ -843,9 +843,9 @@ ADDRESS_MAP_END
/* Really weird way of mapping 3 DSWs */
static READ16_HANDLER( balcube_dsw_r )
{
- UINT16 dsw1 = input_port_read(space->machine, "DSW0") >> 0;
- UINT16 dsw2 = input_port_read(space->machine, "DSW0") >> 8;
- UINT16 dsw3 = input_port_read(space->machine, "IN2");
+ UINT16 dsw1 = input_port_read(space->machine(), "DSW0") >> 0;
+ UINT16 dsw2 = input_port_read(space->machine(), "DSW0") >> 8;
+ UINT16 dsw3 = input_port_read(space->machine(), "IN2");
switch (offset * 2)
{
@@ -1120,7 +1120,7 @@ ADDRESS_MAP_END
#define KARATOUR_VRAM( _n_ ) \
static READ16_HANDLER( karatour_vram_##_n_##_r ) \
{ \
- metro_state *state = space->machine->driver_data<metro_state>(); \
+ metro_state *state = space->machine().driver_data<metro_state>(); \
return state->vram_##_n_[KARATOUR_OFFS(offset)]; \
} \
static WRITE16_HANDLER( karatour_vram_##_n_##_w ) \
@@ -1272,14 +1272,14 @@ ADDRESS_MAP_END
static void gakusai_oki_bank_set(device_t *device)
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
int bank = (state->gakusai_oki_bank_lo & 7) + (state->gakusai_oki_bank_hi & 1) * 8;
downcast<okim6295_device *>(device)->set_bank_base(bank * 0x40000);
}
static WRITE16_DEVICE_HANDLER( gakusai_oki_bank_hi_w )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1290,7 +1290,7 @@ static WRITE16_DEVICE_HANDLER( gakusai_oki_bank_hi_w )
static WRITE16_DEVICE_HANDLER( gakusai_oki_bank_lo_w )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1302,14 +1302,14 @@ static WRITE16_DEVICE_HANDLER( gakusai_oki_bank_lo_w )
static READ16_HANDLER( gakusai_input_r )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
UINT16 input_sel = (*state->input_sel) ^ 0x3e;
// Bit 0 ??
- if (input_sel & 0x0002) return input_port_read(space->machine, "KEY0");
- if (input_sel & 0x0004) return input_port_read(space->machine, "KEY1");
- if (input_sel & 0x0008) return input_port_read(space->machine, "KEY2");
- if (input_sel & 0x0010) return input_port_read(space->machine, "KEY3");
- if (input_sel & 0x0020) return input_port_read(space->machine, "KEY4");
+ if (input_sel & 0x0002) return input_port_read(space->machine(), "KEY0");
+ if (input_sel & 0x0004) return input_port_read(space->machine(), "KEY1");
+ if (input_sel & 0x0008) return input_port_read(space->machine(), "KEY2");
+ if (input_sel & 0x0010) return input_port_read(space->machine(), "KEY3");
+ if (input_sel & 0x0020) return input_port_read(space->machine(), "KEY4");
return 0xffff;
}
@@ -1691,7 +1691,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( blzntrnd_sound_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
soundlatch_w(space, offset, data >> 8);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -1699,16 +1699,16 @@ static WRITE16_HANDLER( blzntrnd_sound_w )
static WRITE8_HANDLER( blzntrnd_sh_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("audiocpu")->base();
+ UINT8 *RAM = space->machine().region("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x4000;
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]);
}
static void blzntrnd_irqhandler(device_t *device, int irq)
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1769,7 +1769,7 @@ ADDRESS_MAP_END
static WRITE16_DEVICE_HANDLER( mouja_sound_rombank_w )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
state->oki->set_bank_base(((data >> 3) & 0x07) * 0x40000);
@@ -1817,7 +1817,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( puzzlet_irq_enable_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
if (ACCESSING_BITS_0_7)
*state->irq_enable = data ^ 0xffff;
@@ -1827,7 +1827,7 @@ static WRITE16_HANDLER( puzzlet_irq_enable_w )
static WRITE16_HANDLER( vram_0_clr_w )
{
static int i;
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
// printf("0 %04x %04x\n",offset,data);
for(i=0;i<0x20/2;i++)
@@ -1837,7 +1837,7 @@ static WRITE16_HANDLER( vram_0_clr_w )
static WRITE16_HANDLER( vram_1_clr_w )
{
static int i;
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
// printf("0 %04x %04x\n",offset,data);
for(i=0;i<0x20/2;i++)
@@ -1847,7 +1847,7 @@ static WRITE16_HANDLER( vram_1_clr_w )
static WRITE16_HANDLER( vram_2_clr_w )
{
static int i;
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
// printf("0 %04x %04x\n",offset,data);
for(i=0;i<0x20/2;i++)
@@ -3577,7 +3577,7 @@ GFXDECODE_END
static MACHINE_START( metro )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->save_item(NAME(state->blitter_bit));
state->save_item(NAME(state->irq_line));
@@ -3596,10 +3596,10 @@ static MACHINE_START( metro )
static MACHINE_RESET( metro )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
if (state->irq_line == -1)
- device_set_irq_callback(machine->device("maincpu"), metro_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), metro_irq_callback);
}
@@ -4524,28 +4524,28 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( puzzlet_interrupt )
{
- metro_state *state = device->machine->driver_data<metro_state>();
+ metro_state *state = device->machine().driver_data<metro_state>();
switch (cpu_getiloops(device))
{
case 0:
state->requested_int[1] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
case 1:
state->requested_int[3] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
case 2:
state->requested_int[5] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
case 3:
state->requested_int[2] = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
break;
default:
@@ -6008,9 +6008,9 @@ ROM_END
***************************************************************************/
-static void metro_common( running_machine *machine )
+static void metro_common( running_machine &machine )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
memset(state->requested_int, 0, ARRAY_LENGTH(state->requested_int));
state->irq_line = 2;
@@ -6022,8 +6022,8 @@ static void metro_common( running_machine *machine )
static DRIVER_INIT( metro )
{
- metro_state *state = machine->driver_data<metro_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ metro_state *state = machine.driver_data<metro_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
metro_common(machine);
@@ -6035,7 +6035,7 @@ static DRIVER_INIT( metro )
static DRIVER_INIT( karatour )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
UINT16 *RAM = auto_alloc_array(machine, UINT16, 0x20000*3/2);
int i;
@@ -6044,7 +6044,7 @@ static DRIVER_INIT( karatour )
state->vram_2 = RAM + (0x20000/2) * 2;
for (i = 0; i < (0x20000 * 3) / 2; i++)
- RAM[i] = machine->rand();
+ RAM[i] = machine.rand();
DRIVER_INIT_CALL(metro);
@@ -6055,8 +6055,8 @@ static DRIVER_INIT( karatour )
static DRIVER_INIT( daitorid )
{
- metro_state *state = machine->driver_data<metro_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ metro_state *state = machine.driver_data<metro_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
metro_common(machine);
@@ -6070,10 +6070,10 @@ static DRIVER_INIT( daitorid )
/* Unscramble the GFX ROMs */
static DRIVER_INIT( balcube )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
- const size_t len = machine->region("gfx1")->bytes();
- UINT8 *src = machine->region("gfx1")->base();
+ const size_t len = machine.region("gfx1")->bytes();
+ UINT8 *src = machine.region("gfx1")->base();
UINT8 *end = src + len;
while (src < end)
@@ -6093,7 +6093,7 @@ static DRIVER_INIT( balcube )
static DRIVER_INIT( dharmak )
{
- UINT8 *src = machine->region( "gfx1" )->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
int i;
for (i = 0; i < 0x200000; i += 4)
@@ -6113,22 +6113,22 @@ static DRIVER_INIT( dharmak )
static DRIVER_INIT( blzntrnd )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
metro_common(machine);
state->irq_line = 1;
}
static DRIVER_INIT( mouja )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
metro_common(machine);
state->irq_line = -1; /* split interrupt handlers */
- state->mouja_irq_timer = machine->scheduler().timer_alloc(FUNC(mouja_irq_callback));
+ state->mouja_irq_timer = machine.scheduler().timer_alloc(FUNC(mouja_irq_callback));
}
static DRIVER_INIT( gakusai )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
metro_common(machine);
state->irq_line = -1;
state->blitter_bit = 3;
@@ -6136,7 +6136,7 @@ static DRIVER_INIT( gakusai )
static DRIVER_INIT( puzzlet )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
metro_common(machine);
state->irq_line = 0;
state->blitter_bit = 0;
diff --git a/src/mame/drivers/mexico86.c b/src/mame/drivers/mexico86.c
index 3c17c8a52ff..e36c1ebbbcd 100644
--- a/src/mame/drivers/mexico86.c
+++ b/src/mame/drivers/mexico86.c
@@ -421,15 +421,15 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mexico86 )
{
- mexico86_state *state = machine->driver_data<mexico86_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ mexico86_state *state = machine.driver_data<mexico86_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->port_a_in));
state->save_item(NAME(state->port_a_out));
@@ -449,10 +449,10 @@ static MACHINE_START( mexico86 )
static MACHINE_RESET( mexico86 )
{
- mexico86_state *state = machine->driver_data<mexico86_state>();
+ mexico86_state *state = machine.driver_data<mexico86_state>();
/*TODO: check the PCB and see how the halt / reset lines are connected. */
- if (machine->device("sub") != NULL)
+ if (machine.device("sub") != NULL)
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
state->port_a_in = 0;
diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c
index 331140f79f1..e08077adc97 100644
--- a/src/mame/drivers/mgolf.c
+++ b/src/mame/drivers/mgolf.c
@@ -32,7 +32,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
+ mgolf_state *state = machine.driver_data<mgolf_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, code, code >> 7, 0);
@@ -41,7 +41,7 @@ static TILE_GET_INFO( get_tile_info )
static WRITE8_HANDLER( mgolf_vram_w )
{
- mgolf_state *state = space->machine->driver_data<mgolf_state>();
+ mgolf_state *state = space->machine().driver_data<mgolf_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -49,14 +49,14 @@ static WRITE8_HANDLER( mgolf_vram_w )
static VIDEO_START( mgolf )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
+ mgolf_state *state = machine.driver_data<mgolf_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( mgolf )
{
- mgolf_state *state = screen->machine->driver_data<mgolf_state>();
+ mgolf_state *state = screen->machine().driver_data<mgolf_state>();
int i;
/* draw playfield */
@@ -65,14 +65,14 @@ static SCREEN_UPDATE( mgolf )
/* draw sprites */
for (i = 0; i < 2; i++)
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->video_ram[0x399 + 4 * i],
i,
0, 0,
state->video_ram[0x390 + 2 * i] - 7,
state->video_ram[0x398 + 4 * i] - 16, 0);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->video_ram[0x39b + 4 * i],
i,
0, 0,
@@ -83,22 +83,22 @@ static SCREEN_UPDATE( mgolf )
}
-static void update_plunger( running_machine *machine )
+static void update_plunger( running_machine &machine )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
+ mgolf_state *state = machine.driver_data<mgolf_state>();
UINT8 val = input_port_read(machine, "BUTTON");
if (state->prev != val)
{
if (val == 0)
{
- state->time_released = machine->time();
+ state->time_released = machine.time();
if (!state->mask)
device_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE);
}
else
- state->time_pushed = machine->time();
+ state->time_pushed = machine.time();
state->prev = val;
}
@@ -107,7 +107,7 @@ static void update_plunger( running_machine *machine )
static TIMER_CALLBACK( interrupt_callback )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
+ mgolf_state *state = machine.driver_data<mgolf_state>();
int scanline = param;
update_plunger(machine);
@@ -119,33 +119,33 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 262)
scanline = 16;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
}
-static double calc_plunger_pos(running_machine *machine)
+static double calc_plunger_pos(running_machine &machine)
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
- return (machine->time().as_double() - state->time_released.as_double()) * (state->time_released.as_double() - state->time_pushed.as_double() + 0.2);
+ mgolf_state *state = machine.driver_data<mgolf_state>();
+ return (machine.time().as_double() - state->time_released.as_double()) * (state->time_released.as_double() - state->time_pushed.as_double() + 0.2);
}
static READ8_HANDLER( mgolf_wram_r )
{
- mgolf_state *state = space->machine->driver_data<mgolf_state>();
+ mgolf_state *state = space->machine().driver_data<mgolf_state>();
return state->video_ram[0x380 + offset];
}
static READ8_HANDLER( mgolf_dial_r )
{
- UINT8 val = input_port_read(space->machine, "41");
+ UINT8 val = input_port_read(space->machine(), "41");
- if ((input_port_read(space->machine, "DIAL") + 0x00) & 0x20)
+ if ((input_port_read(space->machine(), "DIAL") + 0x00) & 0x20)
{
val |= 0x01;
}
- if ((input_port_read(space->machine, "DIAL") + 0x10) & 0x20)
+ if ((input_port_read(space->machine(), "DIAL") + 0x10) & 0x20)
{
val |= 0x02;
}
@@ -156,9 +156,9 @@ static READ8_HANDLER( mgolf_dial_r )
static READ8_HANDLER( mgolf_misc_r )
{
- double plunger = calc_plunger_pos(space->machine); /* see Video Pinball */
+ double plunger = calc_plunger_pos(space->machine()); /* see Video Pinball */
- UINT8 val = input_port_read(space->machine, "61");
+ UINT8 val = input_port_read(space->machine(), "61");
if (plunger >= 0.000 && plunger <= 0.001)
{
@@ -175,7 +175,7 @@ static READ8_HANDLER( mgolf_misc_r )
static WRITE8_HANDLER( mgolf_wram_w )
{
- mgolf_state *state = space->machine->driver_data<mgolf_state>();
+ mgolf_state *state = space->machine().driver_data<mgolf_state>();
state->video_ram[0x380 + offset] = data;
}
@@ -301,9 +301,9 @@ GFXDECODE_END
static MACHINE_START( mgolf )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
+ mgolf_state *state = machine.driver_data<mgolf_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->prev));
state->save_item(NAME(state->mask));
@@ -311,8 +311,8 @@ static MACHINE_START( mgolf )
static MACHINE_RESET( mgolf )
{
- mgolf_state *state = machine->driver_data<mgolf_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
+ mgolf_state *state = machine.driver_data<mgolf_state>();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
state->mask = 0;
state->prev = 0;
diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c
index dd0873e8bf1..cd24065d657 100644
--- a/src/mame/drivers/mhavoc.c
+++ b/src/mame/drivers/mhavoc.c
@@ -206,9 +206,9 @@ static READ8_HANDLER( dual_pokey_r )
int pokey_reg = (offset % 8) | control;
if (pokey_num == 0)
- return pokey_r(space->machine->device("pokey1"), pokey_reg);
+ return pokey_r(space->machine().device("pokey1"), pokey_reg);
else
- return pokey_r(space->machine->device("pokey2"), pokey_reg);
+ return pokey_r(space->machine().device("pokey2"), pokey_reg);
}
@@ -219,9 +219,9 @@ static WRITE8_HANDLER( dual_pokey_w )
int pokey_reg = (offset % 8) | control;
if (pokey_num == 0)
- pokey_w(space->machine->device("pokey1"), pokey_reg, data);
+ pokey_w(space->machine().device("pokey1"), pokey_reg, data);
else
- pokey_w(space->machine->device("pokey2"), pokey_reg, data);
+ pokey_w(space->machine().device("pokey2"), pokey_reg, data);
}
@@ -320,7 +320,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( clock_r )
{
/* 2.4kHz (divide 2.5MHz by 1024) */
- return (field->port->machine->device<cpu_device>("alpha")->total_cycles() & 0x400) ? 0 : 1;
+ return (field->port->machine().device<cpu_device>("alpha")->total_cycles() & 0x400) ? 0 : 1;
}
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index fd7ea1f60a7..e50ab2829fb 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -75,14 +75,14 @@ static SCREEN_UPDATE( midas );
static TILE_GET_INFO( get_tile_info )
{
- midas_state *state = machine->driver_data<midas_state>();
+ midas_state *state = machine.driver_data<midas_state>();
UINT16 code = state->gfxram[ tile_index + 0x7000 ];
SET_TILE_INFO(1, code & 0xfff, (code >> 12) & 0xf, TILE_FLIPXY( 0 ));
}
static VIDEO_START( midas )
{
- midas_state *state = machine->driver_data<midas_state>();
+ midas_state *state = machine.driver_data<midas_state>();
state->gfxram = auto_alloc_array(machine, UINT16, 0x20000/2);
state->tmap = tilemap_create( machine, get_tile_info, tilemap_scan_cols,
@@ -91,9 +91,9 @@ static VIDEO_START( midas )
tilemap_set_transparent_pen(state->tmap, 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- midas_state *state = machine->driver_data<midas_state>();
+ midas_state *state = machine.driver_data<midas_state>();
UINT16 *s = state->gfxram + 0x8000;
UINT16 *codes = state->gfxram;
@@ -165,7 +165,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
UINT16 code = codes[y*2];
UINT16 attr = codes[y*2+1];
- drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[0],
+ drawgfxzoom_transpen( bitmap, cliprect, machine.gfx[0],
code,
attr >> 8,
attr & 1, attr & 2,
@@ -177,22 +177,22 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static SCREEN_UPDATE( midas )
{
- midas_state *state = screen->machine->driver_data<midas_state>();
+ midas_state *state = screen->machine().driver_data<midas_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if ( input_code_pressed(screen->machine, KEYCODE_Z) )
+ if ( input_code_pressed(screen->machine(), KEYCODE_Z) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1 << 0; // for state->tmap
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 1 << 1; // for sprites
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1 << 0; // for state->tmap
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 1 << 1; // for sprites
if (msk != 0) layers_ctrl &= msk;
}
#endif
bitmap_fill(bitmap,cliprect,4095);
- if (layers_ctrl & 2) draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 2) draw_sprites(screen->machine(), bitmap,cliprect);
if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, state->tmap, 0, 0);
return 0;
@@ -220,7 +220,7 @@ static READ16_HANDLER( ret_ffff )
static WRITE16_HANDLER( midas_gfxregs_w )
{
- midas_state *state = space->machine->driver_data<midas_state>();
+ midas_state *state = space->machine().driver_data<midas_state>();
COMBINE_DATA( state->gfxregs + offset );
switch( offset )
@@ -246,7 +246,7 @@ static WRITE16_HANDLER( livequiz_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0001);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
}
#ifdef MAME_DEBUG
// popmessage("coin %04X", data);
@@ -291,18 +291,18 @@ ADDRESS_MAP_END
static READ16_HANDLER( hammer_sensor_r )
{
- if (input_port_read(space->machine, "HAMMER") & 0x80)
+ if (input_port_read(space->machine(), "HAMMER") & 0x80)
return 0xffff;
- return (input_port_read(space->machine, "SENSORY") << 8) | input_port_read(space->machine, "SENSORX");
+ return (input_port_read(space->machine(), "SENSORY") << 8) | input_port_read(space->machine(), "SENSORX");
}
static WRITE16_HANDLER( hammer_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0001);
- coin_counter_w(space->machine, 1, data & 0x0002);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
}
#ifdef MAME_DEBUG
// popmessage("coin %04X", data);
@@ -313,9 +313,9 @@ static WRITE16_HANDLER( hammer_motor_w )
{
if (ACCESSING_BITS_0_7)
{
- ticket_dispenser_w(space->machine->device("prize1"), 0, (data & 0x0001) << 7);
- ticket_dispenser_w(space->machine->device("prize2"), 0, (data & 0x0002) << 6);
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x0010) << 3);
+ ticket_dispenser_w(space->machine().device("prize1"), 0, (data & 0x0001) << 7);
+ ticket_dispenser_w(space->machine().device("prize2"), 0, (data & 0x0002) << 6);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 0x0010) << 3);
// data & 0x0080 ?
}
#ifdef MAME_DEBUG
@@ -864,7 +864,7 @@ ROM_END
static DRIVER_INIT( livequiz )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
// PROTECTION CHECKS
rom[0x13345a/2] = 0x4e75;
diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c
index a2944dbaa8f..7be840db6ff 100644
--- a/src/mame/drivers/midvunit.c
+++ b/src/mame/drivers/midvunit.c
@@ -39,7 +39,7 @@
static MACHINE_START( midvunit )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
state_save_register_global(machine, state->cmos_protected);
state_save_register_global(machine, state->control_data);
state_save_register_global(machine, state->adc_data);
@@ -52,29 +52,29 @@ static MACHINE_START( midvunit )
static MACHINE_RESET( midvunit )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
dcs_reset_w(1);
dcs_reset_w(0);
- memcpy(state->ram_base, machine->region("user1")->base(), 0x20000*4);
- machine->device("maincpu")->reset();
+ memcpy(state->ram_base, machine.region("user1")->base(), 0x20000*4);
+ machine.device("maincpu")->reset();
- state->timer[0] = machine->device<timer_device>("timer0");
- state->timer[1] = machine->device<timer_device>("timer1");
+ state->timer[0] = machine.device<timer_device>("timer0");
+ state->timer[1] = machine.device<timer_device>("timer1");
}
static MACHINE_RESET( midvplus )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
dcs_reset_w(1);
dcs_reset_w(0);
- memcpy(state->ram_base, machine->region("user1")->base(), 0x20000*4);
- machine->device("maincpu")->reset();
+ memcpy(state->ram_base, machine.region("user1")->base(), 0x20000*4);
+ machine.device("maincpu")->reset();
- state->timer[0] = machine->device<timer_device>("timer0");
- state->timer[1] = machine->device<timer_device>("timer1");
+ state->timer[0] = machine.device<timer_device>("timer0");
+ state->timer[1] = machine.device<timer_device>("timer1");
devtag_reset(machine, "ide");
}
@@ -89,8 +89,8 @@ static MACHINE_RESET( midvplus )
static READ32_HANDLER( port0_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
- UINT16 val = input_port_read(space->machine, "IN0");
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
+ UINT16 val = input_port_read(space->machine(), "IN0");
UINT16 diff = val ^ state->last_port0;
/* make sure the shift controls are mutually exclusive */
@@ -118,10 +118,10 @@ static READ32_HANDLER( port0_r )
static READ32_HANDLER( midvunit_adc_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
if (!(state->control_data & 0x40))
{
- cputag_set_input_line(space->machine, "maincpu", 3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE);
return state->adc_data << state->adc_shift;
}
else
@@ -138,7 +138,7 @@ static TIMER_CALLBACK( adc_ready )
static WRITE32_HANDLER( midvunit_adc_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
static const char *const adcnames[] = { "WHEEL", "ACCEL", "BRAKE" };
if (!(state->control_data & 0x20))
@@ -146,8 +146,8 @@ static WRITE32_HANDLER( midvunit_adc_w )
int which = (data >> state->adc_shift) - 4;
if (which < 0 || which > 2)
logerror("adc_w: unexpected which = %02X\n", which + 4);
- state->adc_data = input_port_read_safe(space->machine, adcnames[which], 0);
- space->machine->scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready));
+ state->adc_data = input_port_read_safe(space->machine(), adcnames[which], 0);
+ space->machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready));
}
else
logerror("adc_w without enabling writes!\n");
@@ -163,14 +163,14 @@ static WRITE32_HANDLER( midvunit_adc_w )
static WRITE32_HANDLER( midvunit_cmos_protect_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
state->cmos_protected = ((data & 0xc00) != 0xc00);
}
static WRITE32_HANDLER( midvunit_cmos_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
if (!state->cmos_protected)
COMBINE_DATA(state->m_nvram + offset);
}
@@ -178,7 +178,7 @@ static WRITE32_HANDLER( midvunit_cmos_w )
static READ32_HANDLER( midvunit_cmos_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
return state->m_nvram[offset];
}
@@ -192,7 +192,7 @@ static READ32_HANDLER( midvunit_cmos_r )
static WRITE32_HANDLER( midvunit_control_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT16 olddata = state->control_data;
COMBINE_DATA(&state->control_data);
@@ -213,7 +213,7 @@ static WRITE32_HANDLER( midvunit_control_w )
static WRITE32_HANDLER( crusnwld_control_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT16 olddata = state->control_data;
COMBINE_DATA(&state->control_data);
@@ -248,7 +248,7 @@ static WRITE32_HANDLER( midvunit_sound_w )
static READ32_HANDLER( tms32031_control_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
/* watch for accesses to the timers */
if (offset == 0x24 || offset == 0x34)
{
@@ -269,7 +269,7 @@ static READ32_HANDLER( tms32031_control_r )
static WRITE32_HANDLER( tms32031_control_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
COMBINE_DATA(&state->tms32031_control[offset]);
/* ignore changes to the memory control register */
@@ -286,7 +286,7 @@ static WRITE32_HANDLER( tms32031_control_w )
/* bit 0x200 selects internal clocking, which is 1/2 the main CPU clock rate */
if (data & 0x200)
- state->timer_rate = (double)(space->machine->device("maincpu")->unscaled_clock() * 0.5);
+ state->timer_rate = (double)(space->machine().device("maincpu")->unscaled_clock() * 0.5);
else
state->timer_rate = 10000000.;
}
@@ -306,7 +306,7 @@ static WRITE32_HANDLER( tms32031_control_w )
static READ32_HANDLER( crusnwld_serial_status_r )
{
int status = midway_serial_pic_status_r();
- return (input_port_read(space->machine, "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
+ return (input_port_read(space->machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
}
@@ -347,7 +347,7 @@ static const UINT32 bit_data[0x10] =
static READ32_HANDLER( bit_data_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
int bit = (bit_data[state->bit_index / 32] >> (31 - (state->bit_index % 32))) & 1;
state->bit_index = (state->bit_index + 1) % 512;
return bit ? state->m_nvram[offset] : ~state->m_nvram[offset];
@@ -356,7 +356,7 @@ static READ32_HANDLER( bit_data_r )
static WRITE32_HANDLER( bit_reset_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
state->bit_index = 0;
}
@@ -371,7 +371,7 @@ static WRITE32_HANDLER( bit_reset_w )
static READ32_HANDLER( offroadc_serial_status_r )
{
int status = midway_serial_pic2_status_r(space);
- return (input_port_read(space->machine, "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
+ return (input_port_read(space->machine(), "991030") & 0x7fff7fff) | (status << 31) | (status << 15);
}
@@ -396,7 +396,7 @@ static WRITE32_HANDLER( offroadc_serial_data_w )
static READ32_HANDLER( midvplus_misc_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT32 result = state->midvplus_misc[offset];
switch (offset)
@@ -422,7 +422,7 @@ static READ32_HANDLER( midvplus_misc_r )
static WRITE32_HANDLER( midvplus_misc_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT32 olddata = state->midvplus_misc[offset];
int logit = 1;
@@ -458,7 +458,7 @@ static WRITE32_HANDLER( midvplus_misc_w )
static void midvplus_xf1_w(tms3203x_device &device, UINT8 val)
{
- midvunit_state *state = device.machine->driver_data<midvunit_state>();
+ midvunit_state *state = device.machine().driver_data<midvunit_state>();
// mame_printf_debug("xf1_w = %d\n", val);
if (state->lastval && !val)
@@ -1587,48 +1587,48 @@ ROM_END
static READ32_HANDLER( generic_speedup_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
device_eat_cycles(space->cpu, 100);
return state->generic_speedup[offset];
}
-static void init_crusnusa_common(running_machine *machine, offs_t speedup)
+static void init_crusnusa_common(running_machine &machine, offs_t speedup)
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
dcs_init(machine);
state->adc_shift = 24;
/* speedups */
- state->generic_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(speedup, speedup + 1, FUNC(generic_speedup_r));
+ state->generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(speedup, speedup + 1, FUNC(generic_speedup_r));
}
static DRIVER_INIT( crusnusa ) { init_crusnusa_common(machine, 0xc93e); }
static DRIVER_INIT( crusnu40 ) { init_crusnusa_common(machine, 0xc957); }
static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(machine, 0xc051); }
-static void init_crusnwld_common(running_machine *machine, offs_t speedup)
+static void init_crusnwld_common(running_machine &machine, offs_t speedup)
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
dcs_init(machine);
state->adc_shift = 16;
/* control register is different */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x994000, 0x994000, FUNC(crusnwld_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x994000, 0x994000, FUNC(crusnwld_control_w));
/* valid values are 450 or 460 */
midway_serial_pic_init(machine, 450);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_w));
/* install strange protection device */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9d0000, 0x9d1fff, FUNC(bit_data_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9d0000, 0x9d0000, FUNC(bit_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9d0000, 0x9d1fff, FUNC(bit_data_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9d0000, 0x9d0000, FUNC(bit_reset_w));
/* speedups */
if (speedup)
- state->generic_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(speedup, speedup + 1, FUNC(generic_speedup_r));
+ state->generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(speedup, speedup + 1, FUNC(generic_speedup_r));
}
static DRIVER_INIT( crusnwld ) { init_crusnwld_common(machine, 0xd4c0); }
#if 0
@@ -1638,26 +1638,26 @@ static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(machine, 0); }
static DRIVER_INIT( offroadc )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
dcs_init(machine);
state->adc_shift = 16;
/* control register is different */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x994000, 0x994000, FUNC(crusnwld_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x994000, 0x994000, FUNC(crusnwld_control_w));
/* valid values are 230 or 234 */
midway_serial_pic2_init(machine, 230, 94);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r), FUNC(offroadc_serial_data_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x991030, 0x991030, FUNC(offroadc_serial_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x996000, 0x996000, FUNC(offroadc_serial_data_r), FUNC(offroadc_serial_data_w));
/* speedups */
- state->generic_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x195aa, 0x195aa, FUNC(generic_speedup_r));
+ state->generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x195aa, 0x195aa, FUNC(generic_speedup_r));
}
static DRIVER_INIT( wargods )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
UINT8 default_nvram[256];
/* initialize the subsystems */
@@ -1677,7 +1677,7 @@ static DRIVER_INIT( wargods )
midway_serial_pic2_set_default_nvram(default_nvram);
/* speedups */
- state->generic_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2f4c, 0x2f4c, FUNC(generic_speedup_r));
+ state->generic_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2f4c, 0x2f4c, FUNC(generic_speedup_r));
}
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index 51a565cedf2..8b136558666 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -78,11 +78,11 @@ static TIMER_CALLBACK( invasn_gun_callback );
static MACHINE_START( midzeus )
{
- timer[0] = machine->scheduler().timer_alloc(FUNC(NULL));
- timer[1] = machine->scheduler().timer_alloc(FUNC(NULL));
+ timer[0] = machine.scheduler().timer_alloc(FUNC(NULL));
+ timer[1] = machine.scheduler().timer_alloc(FUNC(NULL));
- gun_timer[0] = machine->scheduler().timer_alloc(FUNC(invasn_gun_callback));
- gun_timer[1] = machine->scheduler().timer_alloc(FUNC(invasn_gun_callback));
+ gun_timer[0] = machine.scheduler().timer_alloc(FUNC(invasn_gun_callback));
+ gun_timer[1] = machine.scheduler().timer_alloc(FUNC(invasn_gun_callback));
state_save_register_global(machine, gun_control);
state_save_register_global(machine, gun_irq_state);
@@ -95,9 +95,9 @@ static MACHINE_START( midzeus )
static MACHINE_RESET( midzeus )
{
- memcpy(ram_base, machine->region("user1")->base(), 0x40000*4);
+ memcpy(ram_base, machine.region("user1")->base(), 0x40000*4);
*ram_base <<= 1;
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
cmos_protected = TRUE;
}
@@ -118,7 +118,7 @@ static TIMER_CALLBACK( display_irq_off )
static INTERRUPT_GEN( display_irq )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_hz(30000000), FUNC(display_irq_off));
+ device->machine().scheduler().timer_set(attotime::from_hz(30000000), FUNC(display_irq_off));
}
@@ -131,7 +131,7 @@ static INTERRUPT_GEN( display_irq )
static WRITE32_HANDLER( cmos_w )
{
- midzeus_state *state = space->machine->driver_data<midzeus_state>();
+ midzeus_state *state = space->machine().driver_data<midzeus_state>();
if (bitlatch[2] && !cmos_protected)
COMBINE_DATA(&state->m_nvram[offset]);
else
@@ -142,7 +142,7 @@ static WRITE32_HANDLER( cmos_w )
static READ32_HANDLER( cmos_r )
{
- midzeus_state *state = space->machine->driver_data<midzeus_state>();
+ midzeus_state *state = space->machine().driver_data<midzeus_state>();
return state->m_nvram[offset] | 0xffffff00;
}
@@ -172,21 +172,21 @@ static WRITE32_DEVICE_HANDLER( zeus2_timekeeper_w )
if (bitlatch[2] && !cmos_protected)
timekeeper_w(device, offset, data);
else
- logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", device->machine->describe_context(), bitlatch[2], cmos_protected);
+ logerror("%s:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", device->machine().describe_context(), bitlatch[2], cmos_protected);
cmos_protected = TRUE;
}
static READ32_HANDLER( zpram_r )
{
- midzeus_state *state = space->machine->driver_data<midzeus_state>();
+ midzeus_state *state = space->machine().driver_data<midzeus_state>();
return state->m_nvram[offset] | 0xffffff00;
}
static WRITE32_HANDLER( zpram_w )
{
- midzeus_state *state = space->machine->driver_data<midzeus_state>();
+ midzeus_state *state = space->machine().driver_data<midzeus_state>();
if (bitlatch[2])
COMBINE_DATA(&state->m_nvram[offset]);
else
@@ -275,7 +275,7 @@ static WRITE32_HANDLER( bitlatches_w )
/* ROM bank selection on Zeus 2 */
case 5:
- memory_set_bank(space->machine, "bank1", bitlatch[offset] & 3);
+ memory_set_bank(space->machine(), "bank1", bitlatch[offset] & 3);
break;
/* unknown purpose; crusnexo/thegrid write 1 at startup */
@@ -432,7 +432,7 @@ static CUSTOM_INPUT( custom_49way_r )
static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
const char *namex = (const char *)param;
const char *namey = namex + strlen(namex) + 1;
- return (translate49[input_port_read(field->port->machine, namey) >> 4] << 4) | translate49[input_port_read(field->port->machine, namex) >> 4];
+ return (translate49[input_port_read(field->port->machine(), namey) >> 4] << 4) | translate49[input_port_read(field->port->machine(), namex) >> 4];
}
@@ -445,7 +445,7 @@ static WRITE32_HANDLER( keypad_select_w )
static CUSTOM_INPUT( keypad_r )
{
- UINT32 bits = input_port_read(field->port->machine, (const char *)param);
+ UINT32 bits = input_port_read(field->port->machine(), (const char *)param);
UINT8 select = keypad_select;
while ((select & 1) != 0)
{
@@ -468,7 +468,7 @@ static READ32_HANDLER( analog_r )
static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
if (offset < 8 || offset > 11)
logerror("%06X:analog_r(%X)\n", cpu_get_pc(space->cpu), offset);
- return input_port_read(space->machine, tags[offset & 3]);
+ return input_port_read(space->machine(), tags[offset & 3]);
}
@@ -485,7 +485,7 @@ static WRITE32_HANDLER( analog_w )
*
*************************************/
-static void update_gun_irq(running_machine *machine)
+static void update_gun_irq(running_machine &machine)
{
/* low 2 bits of gun_control seem to enable IRQs */
if (gun_irq_state & gun_control & 0x03)
@@ -498,7 +498,7 @@ static void update_gun_irq(running_machine *machine)
static TIMER_CALLBACK( invasn_gun_callback )
{
int player = param;
- int beamy = machine->primary_screen->vpos();
+ int beamy = machine.primary_screen->vpos();
/* set the appropriate IRQ in the internal gun control and update */
gun_irq_state |= 0x01 << player;
@@ -506,8 +506,8 @@ static TIMER_CALLBACK( invasn_gun_callback )
/* generate another interrupt on the next scanline while we are within the BEAM_DY */
beamy++;
- if (beamy <= machine->primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY)
- gun_timer[player]->adjust(machine->primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player);
+ if (beamy <= machine.primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY)
+ gun_timer[player]->adjust(machine.primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player);
}
@@ -521,22 +521,22 @@ static WRITE32_HANDLER( invasn_gun_w )
/* bits 0-1 enable IRQs (?) */
/* bits 2-3 reset IRQ states */
gun_irq_state &= ~((gun_control >> 2) & 3);
- update_gun_irq(space->machine);
+ update_gun_irq(space->machine());
for (player = 0; player < 2; player++)
{
UINT8 pmask = 0x04 << player;
if (((old_control ^ gun_control) & pmask) != 0 && (gun_control & pmask) == 0)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
static const char *const names[2][2] =
{
{ "GUNX1", "GUNY1" },
{ "GUNX2", "GUNY2" }
};
- gun_x[player] = input_port_read(space->machine, names[player][0]) * (visarea.max_x + 1 - visarea.min_x) / 255 + visarea.min_x + BEAM_XOFFS;
- gun_y[player] = input_port_read(space->machine, names[player][1]) * (visarea.max_y + 1 - visarea.min_y) / 255 + visarea.min_y;
- gun_timer[player]->adjust(space->machine->primary_screen->time_until_pos(MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player);
+ gun_x[player] = input_port_read(space->machine(), names[player][0]) * (visarea.max_x + 1 - visarea.min_x) / 255 + visarea.min_x + BEAM_XOFFS;
+ gun_y[player] = input_port_read(space->machine(), names[player][1]) * (visarea.max_y + 1 - visarea.min_y) / 255 + visarea.min_y;
+ gun_timer[player]->adjust(space->machine().primary_screen->time_until_pos(MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player);
}
}
}
@@ -544,8 +544,8 @@ static WRITE32_HANDLER( invasn_gun_w )
static READ32_HANDLER( invasn_gun_r )
{
- int beamx = space->machine->primary_screen->hpos();
- int beamy = space->machine->primary_screen->vpos();
+ int beamx = space->machine().primary_screen->hpos();
+ int beamy = space->machine().primary_screen->vpos();
UINT32 result = 0xffff;
int player;
@@ -1413,7 +1413,7 @@ static DRIVER_INIT( invasn )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 468/* or 488 */, 94, NULL);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x9c0000, 0x9c0000, FUNC(invasn_gun_r), FUNC(invasn_gun_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x9c0000, 0x9c0000, FUNC(invasn_gun_r), FUNC(invasn_gun_w));
}
@@ -1421,10 +1421,10 @@ static DRIVER_INIT( crusnexo )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 472/* or 476,477,478,110 */, 99, NULL);
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("user2")->base(), 0x400000*4);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("user2")->base(), 0x400000*4);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x9b0004, 0x9b0007, FUNC(crusnexo_leds_r), FUNC(crusnexo_leds_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x8d0009, 0x8d000a, FUNC(keypad_select_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x9b0004, 0x9b0007, FUNC(crusnexo_leds_r), FUNC(crusnexo_leds_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x8d0009, 0x8d000a, FUNC(keypad_select_w));
}
@@ -1432,7 +1432,7 @@ static DRIVER_INIT( thegrid )
{
dcs2_init(machine, 0, 0);
midway_ioasic_init(machine, MIDWAY_IOASIC_STANDARD, 474/* or 491 */, 99, NULL);
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("user2")->base(), 0x400000*4);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("user2")->base(), 0x400000*4);
}
diff --git a/src/mame/drivers/mikie.c b/src/mame/drivers/mikie.c
index 95ff88aed92..52ba63d3094 100644
--- a/src/mame/drivers/mikie.c
+++ b/src/mame/drivers/mikie.c
@@ -59,7 +59,7 @@ Stephh's notes (based on the games M6809 code and some tests) :
static READ8_HANDLER( mikie_sh_timer_r )
{
- mikie_state *state = space->machine->driver_data<mikie_state>();
+ mikie_state *state = space->machine().driver_data<mikie_state>();
int clock = state->audiocpu->total_cycles() / MIKIE_TIMER_RATE;
return clock;
@@ -67,7 +67,7 @@ static READ8_HANDLER( mikie_sh_timer_r )
static WRITE8_HANDLER( mikie_sh_irqtrigger_w )
{
- mikie_state *state = space->machine->driver_data<mikie_state>();
+ mikie_state *state = space->machine().driver_data<mikie_state>();
if (state->last_irq == 0 && data == 1)
{
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( mikie_sh_irqtrigger_w )
static WRITE8_HANDLER( mikie_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
/*************************************
@@ -227,10 +227,10 @@ GFXDECODE_END
static MACHINE_START( mikie )
{
- mikie_state *state = machine->driver_data<mikie_state>();
+ mikie_state *state = machine.driver_data<mikie_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
state->save_item(NAME(state->palettebank));
state->save_item(NAME(state->last_irq));
@@ -238,7 +238,7 @@ static MACHINE_START( mikie )
static MACHINE_RESET( mikie )
{
- mikie_state *state = machine->driver_data<mikie_state>();
+ mikie_state *state = machine.driver_data<mikie_state>();
state->palettebank = 0;
state->last_irq = 0;
diff --git a/src/mame/drivers/mil4000.c b/src/mame/drivers/mil4000.c
index bac2f6ccb01..5c4612a7bca 100644
--- a/src/mame/drivers/mil4000.c
+++ b/src/mame/drivers/mil4000.c
@@ -112,7 +112,7 @@ public:
static TILE_GET_INFO( get_sc0_tile_info )
{
- mil4000_state *state = machine->driver_data<mil4000_state>();
+ mil4000_state *state = machine.driver_data<mil4000_state>();
UINT32 data = (state->sc0_vram[tile_index*2]<<16) | state->sc0_vram[tile_index*2+1];
int tile = data >> 14;
int color = (state->sc0_vram[tile_index*2+1] & 0x1f)+0;
@@ -126,7 +126,7 @@ static TILE_GET_INFO( get_sc0_tile_info )
static TILE_GET_INFO( get_sc1_tile_info )
{
- mil4000_state *state = machine->driver_data<mil4000_state>();
+ mil4000_state *state = machine.driver_data<mil4000_state>();
UINT32 data = (state->sc1_vram[tile_index*2]<<16) | state->sc1_vram[tile_index*2+1];
int tile = data >> 14;
int color = (state->sc1_vram[tile_index*2+1] & 0x1f)+0x10;
@@ -140,7 +140,7 @@ static TILE_GET_INFO( get_sc1_tile_info )
static TILE_GET_INFO( get_sc2_tile_info )
{
- mil4000_state *state = machine->driver_data<mil4000_state>();
+ mil4000_state *state = machine.driver_data<mil4000_state>();
UINT32 data = (state->sc2_vram[tile_index*2]<<16) | state->sc2_vram[tile_index*2+1];
int tile = data >> 14;
int color = (state->sc2_vram[tile_index*2+1] & 0x1f)+0x20;
@@ -154,7 +154,7 @@ static TILE_GET_INFO( get_sc2_tile_info )
static TILE_GET_INFO( get_sc3_tile_info )
{
- mil4000_state *state = machine->driver_data<mil4000_state>();
+ mil4000_state *state = machine.driver_data<mil4000_state>();
UINT32 data = (state->sc3_vram[tile_index*2]<<16) | state->sc3_vram[tile_index*2+1];
int tile = data >> 14;
int color = (state->sc3_vram[tile_index*2+1] & 0x1f)+0x30;
@@ -168,7 +168,7 @@ static TILE_GET_INFO( get_sc3_tile_info )
static VIDEO_START(mil4000)
{
- mil4000_state *state = machine->driver_data<mil4000_state>();
+ mil4000_state *state = machine.driver_data<mil4000_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,64,64);
state->sc1_tilemap = tilemap_create(machine, get_sc1_tile_info,tilemap_scan_rows,8,8,64,64);
state->sc2_tilemap = tilemap_create(machine, get_sc2_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -181,7 +181,7 @@ static VIDEO_START(mil4000)
static SCREEN_UPDATE(mil4000)
{
- mil4000_state *state = screen->machine->driver_data<mil4000_state>();
+ mil4000_state *state = screen->machine().driver_data<mil4000_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->sc1_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->sc2_tilemap,0,0);
@@ -192,7 +192,7 @@ static SCREEN_UPDATE(mil4000)
/*TODO*/
static READ16_HANDLER( hvretrace_r )
{
- mil4000_state *state = space->machine->driver_data<mil4000_state>();
+ mil4000_state *state = space->machine().driver_data<mil4000_state>();
UINT16 res;
res = 0;
@@ -214,28 +214,28 @@ static READ16_HANDLER( hvretrace_r )
static WRITE16_HANDLER( sc0_vram_w )
{
- mil4000_state *state = space->machine->driver_data<mil4000_state>();
+ mil4000_state *state = space->machine().driver_data<mil4000_state>();
state->sc0_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset/2);
}
static WRITE16_HANDLER( sc1_vram_w )
{
- mil4000_state *state = space->machine->driver_data<mil4000_state>();
+ mil4000_state *state = space->machine().driver_data<mil4000_state>();
state->sc1_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc1_tilemap,offset/2);
}
static WRITE16_HANDLER( sc2_vram_w )
{
- mil4000_state *state = space->machine->driver_data<mil4000_state>();
+ mil4000_state *state = space->machine().driver_data<mil4000_state>();
state->sc2_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc2_tilemap,offset/2);
}
static WRITE16_HANDLER( sc3_vram_w )
{
- mil4000_state *state = space->machine->driver_data<mil4000_state>();
+ mil4000_state *state = space->machine().driver_data<mil4000_state>();
state->sc3_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc3_tilemap,offset/2);
}
@@ -257,7 +257,7 @@ static WRITE16_HANDLER( output_w )
int i;
for(i=0;i<3;i++)
- coin_counter_w(space->machine, i, data & 0x2000);
+ coin_counter_w(space->machine(), i, data & 0x2000);
output_set_lamp_value(0, (data) & 1); /* HOLD1 */
output_set_lamp_value(1, (data >> 1) & 1); /* HOLD2 */
diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c
index 1d91a5e02d5..6c46dd71a0f 100644
--- a/src/mame/drivers/miniboy7.c
+++ b/src/mame/drivers/miniboy7.c
@@ -170,21 +170,21 @@ public:
static WRITE8_HANDLER( miniboy7_videoram_w )
{
- miniboy7_state *state = space->machine->driver_data<miniboy7_state>();
+ miniboy7_state *state = space->machine().driver_data<miniboy7_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( miniboy7_colorram_w )
{
- miniboy7_state *state = space->machine->driver_data<miniboy7_state>();
+ miniboy7_state *state = space->machine().driver_data<miniboy7_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- miniboy7_state *state = machine->driver_data<miniboy7_state>();
+ miniboy7_state *state = machine.driver_data<miniboy7_state>();
/* - bits -
7654 3210
--xx xx-- tiles color?.
@@ -204,13 +204,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( miniboy7 )
{
- miniboy7_state *state = machine->driver_data<miniboy7_state>();
+ miniboy7_state *state = machine.driver_data<miniboy7_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 37, 37);
}
static SCREEN_UPDATE( miniboy7 )
{
- miniboy7_state *state = screen->machine->driver_data<miniboy7_state>();
+ miniboy7_state *state = screen->machine().driver_data<miniboy7_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -233,7 +233,7 @@ static PALETTE_INIT( miniboy7 )
/* 0000IBGR */
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, r, g, b, inten, intenmin, intenmax;
diff --git a/src/mame/drivers/minivadr.c b/src/mame/drivers/minivadr.c
index 7bf7227264c..a7dfbdafec4 100644
--- a/src/mame/drivers/minivadr.c
+++ b/src/mame/drivers/minivadr.c
@@ -33,7 +33,7 @@ public:
static SCREEN_UPDATE( minivadr )
{
- minivadr_state *state = screen->machine->driver_data<minivadr_state>();
+ minivadr_state *state = screen->machine().driver_data<minivadr_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index d9acb5c5b61..7f54b269a99 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -69,53 +69,53 @@ public:
static VIDEO_START( mirage )
{
- machine->device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
}
static SCREEN_UPDATE( mirage )
{
- mirage_state *state = screen->machine->driver_data<mirage_state>();
+ mirage_state *state = screen->machine().driver_data<mirage_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 256); /* not verified */
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0800, 0x200, 0x1ff);
return 0;
}
static SCREEN_EOF( mirage )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
}
static WRITE16_HANDLER( mirage_mux_w )
{
- mirage_state *state = space->machine->driver_data<mirage_state>();
+ mirage_state *state = space->machine().driver_data<mirage_state>();
state->mux_data = data & 0x1f;
}
static READ16_HANDLER( mirage_input_r )
{
- mirage_state *state = space->machine->driver_data<mirage_state>();
+ mirage_state *state = space->machine().driver_data<mirage_state>();
switch (state->mux_data & 0x1f)
{
- case 0x01: return input_port_read(space->machine, "KEY0");
- case 0x02: return input_port_read(space->machine, "KEY1");
- case 0x04: return input_port_read(space->machine, "KEY2");
- case 0x08: return input_port_read(space->machine, "KEY3");
- case 0x10: return input_port_read(space->machine, "KEY4");
+ case 0x01: return input_port_read(space->machine(), "KEY0");
+ case 0x02: return input_port_read(space->machine(), "KEY1");
+ case 0x04: return input_port_read(space->machine(), "KEY2");
+ case 0x08: return input_port_read(space->machine(), "KEY3");
+ case 0x10: return input_port_read(space->machine(), "KEY4");
}
return 0xffff;
@@ -123,13 +123,13 @@ static READ16_HANDLER( mirage_input_r )
static WRITE16_HANDLER( okim1_rombank_w )
{
- mirage_state *state = space->machine->driver_data<mirage_state>();
+ mirage_state *state = space->machine().driver_data<mirage_state>();
state->oki_sfx->set_bank_base(0x40000 * (data & 0x3));
}
static WRITE16_HANDLER( okim0_rombank_w )
{
- mirage_state *state = space->machine->driver_data<mirage_state>();
+ mirage_state *state = space->machine().driver_data<mirage_state>();
/*bits 4-6 used on POST? */
state->oki_bgm->set_bank_base(0x40000 * (data & 0x7));
@@ -302,14 +302,14 @@ static const deco16ic_interface mirage_deco16ic_tilegen1_intf =
static MACHINE_START( mirage )
{
- mirage_state *state = machine->driver_data<mirage_state>();
+ mirage_state *state = machine.driver_data<mirage_state>();
state->save_item(NAME(state->mux_data));
}
static MACHINE_RESET( mirage )
{
- mirage_state *state = machine->driver_data<mirage_state>();
+ mirage_state *state = machine.driver_data<mirage_state>();
state->mux_data = 0;
}
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index 660c1f73958..bdeaafbe8e8 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -94,9 +94,9 @@ static VIDEO_START(mirax)
{
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- mirax_state *state = machine->driver_data<mirax_state>();
+ mirax_state *state = machine.driver_data<mirax_state>();
UINT8 *spriteram = state->spriteram;
int count;
@@ -118,14 +118,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
y = 0x100 - spriteram[count];
x = spriteram[count+3];
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],spr_offs,color,fx,fy,x,y-16,0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],spr_offs,color,fx,fy,x,y-16,0);
}
}
static SCREEN_UPDATE(mirax)
{
- mirax_state *state = screen->machine->driver_data<mirax_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ mirax_state *state = screen->machine().driver_data<mirax_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x00000;
int y,x;
@@ -146,7 +146,7 @@ static SCREEN_UPDATE(mirax)
}
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
count = 0x00000;
@@ -177,14 +177,14 @@ static SCREEN_UPDATE(mirax)
static SOUND_START(mirax)
{
- mirax_state *state = machine->driver_data<mirax_state>();
+ mirax_state *state = machine.driver_data<mirax_state>();
state->nAyCtrl = 0x00;
state->nAyData = 0x00;
}
static WRITE8_HANDLER(audio_w)
{
- mirax_state *state = space->machine->driver_data<mirax_state>();
+ mirax_state *state = space->machine().driver_data<mirax_state>();
if(cpu_get_previouspc(space->cpu)==0x2fd)
{
state->nAyCtrl=offset;
@@ -194,8 +194,8 @@ static WRITE8_HANDLER(audio_w)
static WRITE8_DEVICE_HANDLER(ay_sel)
{
- mirax_state *state = device->machine->driver_data<mirax_state>();
- if(cpu_get_previouspc(device->machine->device("audiocpu"))==0x309)
+ mirax_state *state = device->machine().driver_data<mirax_state>();
+ if(cpu_get_previouspc(device->machine().device("audiocpu"))==0x309)
{
ay8910_address_w(device,0,state->nAyCtrl);
ay8910_data_w(device,0,state->nAyData);
@@ -209,7 +209,7 @@ static READ8_HANDLER( unk_r )
static WRITE8_HANDLER( nmi_mask_w )
{
- mirax_state *state = space->machine->driver_data<mirax_state>();
+ mirax_state *state = space->machine().driver_data<mirax_state>();
state->nmi_mask = data & 1;
if(data & 0xfe)
printf("Warning: %02x written at $f501\n",data);
@@ -218,7 +218,7 @@ static WRITE8_HANDLER( nmi_mask_w )
static WRITE8_HANDLER( mirax_sound_cmd_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( mirax_main_map, AS_PROGRAM, 8 )
@@ -364,7 +364,7 @@ static PALETTE_INIT( mirax )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -389,7 +389,7 @@ static PALETTE_INIT( mirax )
static INTERRUPT_GEN( mirax_vblank_irq )
{
- mirax_state *state = device->machine->driver_data<mirax_state>();
+ mirax_state *state = device->machine().driver_data<mirax_state>();
if(state->nmi_mask)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -489,8 +489,8 @@ ROM_END
static DRIVER_INIT( mirax )
{
- UINT8 *DATA = machine->region("data_code")->base();
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *DATA = machine.region("data_code")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
for(i=0x0000;i<0x4000;i++)
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index 5007a58ba32..32c1305b93f 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -37,7 +37,7 @@ public:
static SCREEN_UPDATE( missb2 )
{
- missb2_state *state = screen->machine->driver_data<missb2_state>();
+ missb2_state *state = screen->machine().driver_data<missb2_state>();
int offs;
int sx, sy, xc, yc;
int gfx_num, gfx_attr, gfx_offs;
@@ -58,7 +58,7 @@ static SCREEN_UPDATE( missb2 )
//popmessage("%02x",(*state->bgvram) & 0x1f);
for (bg_offs = ((*state->bgvram) << 4); bg_offs < (((*state->bgvram) << 4) | 0xf); bg_offs++)
{
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[1],
bg_offs,
1,
0,0,
@@ -68,7 +68,7 @@ static SCREEN_UPDATE( missb2 )
sx = 0;
- prom = screen->machine->region("proms")->base();
+ prom = screen->machine().region("proms")->base();
for (offs = 0; offs < state->objectram_size; offs += 4)
{
/* skip empty sprites */
@@ -110,7 +110,7 @@ static SCREEN_UPDATE( missb2 )
x = sx + xc * 8;
y = (sy + yc * 8) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
x = 248 - x;
y = 248 - y;
@@ -118,7 +118,7 @@ static SCREEN_UPDATE( missb2 )
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
0,
flipx,flipy,
@@ -131,16 +131,16 @@ static SCREEN_UPDATE( missb2 )
return 0;
}
-INLINE void bg_changecolor_RRRRGGGGBBBBxxxx( running_machine *machine, pen_t color, int data )
+INLINE void bg_changecolor_RRRRGGGGBBBBxxxx( running_machine &machine, pen_t color, int data )
{
palette_set_color_rgb(machine, color + 256, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4));
}
static WRITE8_HANDLER( bg_paletteram_RRRRGGGGBBBBxxxx_be_w )
{
- missb2_state *state = space->machine->driver_data<missb2_state>();
+ missb2_state *state = space->machine().driver_data<missb2_state>();
state->bg_paletteram[offset] = data;
- bg_changecolor_RRRRGGGGBBBBxxxx(space->machine, offset / 2, state->bg_paletteram[offset | 1] | (state->bg_paletteram[offset & ~1] << 8));
+ bg_changecolor_RRRRGGGGBBBBxxxx(space->machine(), offset / 2, state->bg_paletteram[offset | 1] | (state->bg_paletteram[offset & ~1] << 8));
}
static WRITE8_HANDLER( missb2_bg_bank_w )
@@ -150,8 +150,8 @@ static WRITE8_HANDLER( missb2_bg_bank_w )
// I don't know how this is really connected, bit 1 is always high afaik...
bank = ((data & 2) ? 1 : 0) | ((data & 1) ? 4 : 0);
- memory_set_bank(space->machine, "bank2", bank);
- memory_set_bank(space->machine, "bank3", bank);
+ memory_set_bank(space->machine(), "bank2", bank);
+ memory_set_bank(space->machine(), "bank3", bank);
}
/* Memory Maps */
@@ -410,7 +410,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
logerror("YM3526 firing an IRQ\n");
-// cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+// cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym3526_interface ym3526_config =
@@ -429,11 +429,11 @@ static INTERRUPT_GEN( missb2_interrupt )
static MACHINE_START( missb2 )
{
- missb2_state *state = machine->driver_data<missb2_state>();
+ missb2_state *state = machine.driver_data<missb2_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->slave = machine->device("slave");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->slave = machine.device("slave");
state->mcu = NULL;
state->save_item(NAME(state->sound_nmi_enable));
@@ -444,7 +444,7 @@ static MACHINE_START( missb2 )
static MACHINE_RESET( missb2 )
{
- missb2_state *state = machine->driver_data<missb2_state>();
+ missb2_state *state = machine.driver_data<missb2_state>();
state->sound_nmi_enable = 0;
state->pending_nmi = 0;
@@ -568,10 +568,10 @@ ROM_START( bublpong )
ROM_END
-static void configure_banks( running_machine* machine )
+static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *SLAVE = machine->region("slave")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *SLAVE = machine.region("slave")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
@@ -582,7 +582,7 @@ static void configure_banks( running_machine* machine )
static DRIVER_INIT( missb2 )
{
- missb2_state *state = machine->driver_data<missb2_state>();
+ missb2_state *state = machine.driver_data<missb2_state>();
configure_banks(machine);
state->video_enable = 0;
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index 2614f802199..4d9c37847fe 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -415,9 +415,9 @@ INLINE int v_to_scanline(missile_state *state, int v)
}
-INLINE void schedule_next_irq(running_machine *machine, int curv)
+INLINE void schedule_next_irq(running_machine &machine, int curv)
{
- missile_state *state = machine->driver_data<missile_state>();
+ missile_state *state = machine.driver_data<missile_state>();
/* IRQ = /32V, clocked by /16V ^ flip */
/* When not flipped, clocks on 0, 64, 128, 192 */
/* When flipped, clocks on 16, 80, 144, 208 */
@@ -427,13 +427,13 @@ INLINE void schedule_next_irq(running_machine *machine, int curv)
curv = ((curv + 32) & 0xff) & ~0x10;
/* next one at the start of this scanline */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, curv)), curv);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(v_to_scanline(state, curv)), curv);
}
static TIMER_CALLBACK( clock_irq )
{
- missile_state *state = machine->driver_data<missile_state>();
+ missile_state *state = machine.driver_data<missile_state>();
int curv = param;
/* assert the IRQ if not already asserted */
@@ -441,7 +441,7 @@ static TIMER_CALLBACK( clock_irq )
cputag_set_input_line(machine, "maincpu", 0, state->irq_state ? ASSERT_LINE : CLEAR_LINE);
/* force an update while we're here */
- machine->primary_screen->update_partial(v_to_scanline(state, curv));
+ machine.primary_screen->update_partial(v_to_scanline(state, curv));
/* find the next edge */
schedule_next_irq(machine, curv);
@@ -450,8 +450,8 @@ static TIMER_CALLBACK( clock_irq )
static CUSTOM_INPUT( get_vblank )
{
- missile_state *state = field->port->machine->driver_data<missile_state>();
- int v = scanline_to_v(state, field->port->machine->primary_screen->vpos());
+ missile_state *state = field->port->machine().driver_data<missile_state>();
+ int v = scanline_to_v(state, field->port->machine().primary_screen->vpos());
return v < 24;
}
@@ -465,18 +465,18 @@ static CUSTOM_INPUT( get_vblank )
static TIMER_CALLBACK( adjust_cpu_speed )
{
- missile_state *state = machine->driver_data<missile_state>();
+ missile_state *state = machine.driver_data<missile_state>();
int curv = param;
/* starting at scanline 224, the CPU runs at half speed */
if (curv == 224)
- machine->device("maincpu")->set_unscaled_clock(MASTER_CLOCK/16);
+ machine.device("maincpu")->set_unscaled_clock(MASTER_CLOCK/16);
else
- machine->device("maincpu")->set_unscaled_clock(MASTER_CLOCK/8);
+ machine.device("maincpu")->set_unscaled_clock(MASTER_CLOCK/8);
/* scanline for the next run */
curv ^= 224;
- state->cpu_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, curv)), curv);
+ state->cpu_timer->adjust(machine.primary_screen->time_until_pos(v_to_scanline(state, curv)), curv);
}
@@ -489,7 +489,7 @@ DIRECT_UPDATE_HANDLER( missile_direct_handler )
/* RAM? */
if (address < 0x4000)
{
- missile_state *state = direct.space().m_machine.driver_data<missile_state>();
+ missile_state *state = direct.space().machine().driver_data<missile_state>();
direct.explicit_configure(0x0000 | offset, 0x3fff | offset, 0x3fff, state->videoram);
return ~0;
}
@@ -497,7 +497,7 @@ DIRECT_UPDATE_HANDLER( missile_direct_handler )
/* ROM? */
else if (address >= 0x5000)
{
- direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().m_machine.region("maincpu")->base() + 0x5000);
+ direct.explicit_configure(0x5000 | offset, 0x7fff | offset, 0x7fff, direct.space().machine().region("maincpu")->base() + 0x5000);
return ~0;
}
@@ -508,21 +508,21 @@ DIRECT_UPDATE_HANDLER( missile_direct_handler )
static MACHINE_START( missile )
{
- missile_state *state = machine->driver_data<missile_state>();
+ missile_state *state = machine.driver_data<missile_state>();
/* initialize globals */
- state->writeprom = machine->region("proms")->base();
+ state->writeprom = machine.region("proms")->base();
state->flipscreen = 0;
/* set up an opcode base handler since we use mapped handlers for RAM */
- address_space *space = machine->device<m6502_device>("maincpu")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(missile_direct_handler, *machine));
+ address_space *space = machine.device<m6502_device>("maincpu")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(missile_direct_handler, machine));
/* create a timer to speed/slow the CPU */
- state->cpu_timer = machine->scheduler().timer_alloc(FUNC(adjust_cpu_speed));
- state->cpu_timer->adjust(machine->primary_screen->time_until_pos(v_to_scanline(state, 0), 0));
+ state->cpu_timer = machine.scheduler().timer_alloc(FUNC(adjust_cpu_speed));
+ state->cpu_timer->adjust(machine.primary_screen->time_until_pos(v_to_scanline(state, 0), 0));
/* create a timer for IRQs and set up the first callback */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
state->irq_state = 0;
schedule_next_irq(machine, -32);
@@ -537,7 +537,7 @@ static MACHINE_START( missile )
static MACHINE_RESET( missile )
{
- missile_state *state = machine->driver_data<missile_state>();
+ missile_state *state = machine.driver_data<missile_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
@@ -552,7 +552,7 @@ static MACHINE_RESET( missile )
INLINE int get_madsel(address_space *space)
{
- missile_state *state = space->machine->driver_data<missile_state>();
+ missile_state *state = space->machine().driver_data<missile_state>();
UINT16 pc = cpu_get_previouspc(space->cpu);
/* if we're at a different instruction than last time, reset our delay counter */
@@ -590,7 +590,7 @@ INLINE offs_t get_bit3_addr(offs_t pixaddr)
static void write_vram(address_space *space, offs_t address, UINT8 data)
{
- missile_state *state = space->machine->driver_data<missile_state>();
+ missile_state *state = space->machine().driver_data<missile_state>();
UINT8 *videoram = state->videoram;
static const UINT8 data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff };
offs_t vramaddr;
@@ -622,7 +622,7 @@ static void write_vram(address_space *space, offs_t address, UINT8 data)
static UINT8 read_vram(address_space *space, offs_t address)
{
- missile_state *state = space->machine->driver_data<missile_state>();
+ missile_state *state = space->machine().driver_data<missile_state>();
UINT8 *videoram = state->videoram;
offs_t vramaddr;
UINT8 vramdata;
@@ -666,7 +666,7 @@ static UINT8 read_vram(address_space *space, offs_t address)
static SCREEN_UPDATE( missile )
{
- missile_state *state = screen->machine->driver_data<missile_state>();
+ missile_state *state = screen->machine().driver_data<missile_state>();
UINT8 *videoram = state->videoram;
int x, y;
@@ -709,7 +709,7 @@ static SCREEN_UPDATE( missile )
static WRITE8_HANDLER( missile_w )
{
- missile_state *state = space->machine->driver_data<missile_state>();
+ missile_state *state = space->machine().driver_data<missile_state>();
UINT8 *videoram = state->videoram;
/* if we're in MADSEL mode, write to video RAM */
if (get_madsel(space))
@@ -727,34 +727,34 @@ static WRITE8_HANDLER( missile_w )
/* POKEY */
else if (offset < 0x4800)
- pokey_w(space->machine->device("pokey"), offset & 0x0f, data);
+ pokey_w(space->machine().device("pokey"), offset & 0x0f, data);
/* OUT0 */
else if (offset < 0x4900)
{
state->flipscreen = ~data & 0x40;
- coin_counter_w(space->machine, 0, data & 0x20);
- coin_counter_w(space->machine, 1, data & 0x10);
- coin_counter_w(space->machine, 2, data & 0x08);
- set_led_status(space->machine, 1, ~data & 0x04);
- set_led_status(space->machine, 0, ~data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x20);
+ coin_counter_w(space->machine(), 1, data & 0x10);
+ coin_counter_w(space->machine(), 2, data & 0x08);
+ set_led_status(space->machine(), 1, ~data & 0x04);
+ set_led_status(space->machine(), 0, ~data & 0x02);
state->ctrld = data & 1;
}
/* color RAM */
else if (offset >= 0x4b00 && offset < 0x4c00)
- palette_set_color_rgb(space->machine, offset & 7, pal1bit(~data >> 3), pal1bit(~data >> 2), pal1bit(~data >> 1));
+ palette_set_color_rgb(space->machine(), offset & 7, pal1bit(~data >> 3), pal1bit(~data >> 2), pal1bit(~data >> 1));
/* watchdog */
else if (offset >= 0x4c00 && offset < 0x4d00)
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
/* interrupt ack */
else if (offset >= 0x4d00 && offset < 0x4e00)
{
if (state->irq_state)
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
}
@@ -767,7 +767,7 @@ static WRITE8_HANDLER( missile_w )
static READ8_HANDLER( missile_r )
{
- missile_state *state = space->machine->driver_data<missile_state>();
+ missile_state *state = space->machine().driver_data<missile_state>();
UINT8 *videoram = state->videoram;
UINT8 result = 0xff;
@@ -784,11 +784,11 @@ static READ8_HANDLER( missile_r )
/* ROM */
else if (offset >= 0x5000)
- result = space->machine->region("maincpu")->base()[offset];
+ result = space->machine().region("maincpu")->base()[offset];
/* POKEY */
else if (offset < 0x4800)
- result = pokey_r(space->machine->device("pokey"), offset & 0x0f);
+ result = pokey_r(space->machine().device("pokey"), offset & 0x0f);
/* IN0 */
else if (offset < 0x4900)
@@ -796,21 +796,21 @@ static READ8_HANDLER( missile_r )
if (state->ctrld) /* trackball */
{
if (!state->flipscreen)
- result = ((input_port_read(space->machine, "TRACK0_Y") << 4) & 0xf0) | (input_port_read(space->machine, "TRACK0_X") & 0x0f);
+ result = ((input_port_read(space->machine(), "TRACK0_Y") << 4) & 0xf0) | (input_port_read(space->machine(), "TRACK0_X") & 0x0f);
else
- result = ((input_port_read(space->machine, "TRACK1_Y") << 4) & 0xf0) | (input_port_read(space->machine, "TRACK1_X") & 0x0f);
+ result = ((input_port_read(space->machine(), "TRACK1_Y") << 4) & 0xf0) | (input_port_read(space->machine(), "TRACK1_X") & 0x0f);
}
else /* buttons */
- result = input_port_read(space->machine, "IN0");
+ result = input_port_read(space->machine(), "IN0");
}
/* IN1 */
else if (offset < 0x4a00)
- result = input_port_read(space->machine, "IN1");
+ result = input_port_read(space->machine(), "IN1");
/* IN2 */
else if (offset < 0x4b00)
- result = input_port_read(space->machine, "R10");
+ result = input_port_read(space->machine(), "R10");
/* anything else */
else
@@ -1168,7 +1168,7 @@ ROM_END
static DRIVER_INIT( suprmatk )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < 0x40; i++)
{
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index 2bb63fa068e..d3fbae9584d 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -95,7 +95,7 @@ static const eeprom_interface eeprom_intf =
static NVRAM_HANDLER( mitchell )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
if (read_or_write)
{
if (state->nvram_size) /* Super Pang, Block Block */
@@ -113,7 +113,7 @@ static NVRAM_HANDLER( mitchell )
static READ8_HANDLER( pang_port5_r )
{
- int bit = eeprom_read_bit(space->machine->device("eeprom")) << 7;
+ int bit = eeprom_read_bit(space->machine().device("eeprom")) << 7;
/* bits 0 and (sometimes) 3 are checked in the interrupt handler.
bit 3 is checked before updating the palette so it really seems to be vblank.
@@ -124,7 +124,7 @@ static READ8_HANDLER( pang_port5_r )
if (cpu_getiloops(space->cpu) & 1)
bit |= 0x01;
- return (input_port_read(space->machine, "SYS0") & 0x7e) | bit;
+ return (input_port_read(space->machine(), "SYS0") & 0x7e) | bit;
}
static WRITE8_DEVICE_HANDLER( eeprom_cs_w )
@@ -151,7 +151,7 @@ static WRITE8_DEVICE_HANDLER( eeprom_serial_w )
static WRITE8_HANDLER( pang_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
/*************************************
@@ -162,13 +162,13 @@ static WRITE8_HANDLER( pang_bankswitch_w )
static READ8_HANDLER( block_input_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
static const char *const dialnames[] = { "DIAL1", "DIAL2" };
static const char *const portnames[] = { "IN1", "IN2" };
if (state->dial_selected)
{
- int delta = (input_port_read(space->machine, dialnames[offset]) - state->dial[offset]) & 0xff;
+ int delta = (input_port_read(space->machine(), dialnames[offset]) - state->dial[offset]) & 0xff;
if (delta & 0x80)
{
@@ -196,7 +196,7 @@ static READ8_HANDLER( block_input_r )
}
else
{
- int res = input_port_read(space->machine, portnames[offset]) & 0xf7;
+ int res = input_port_read(space->machine(), portnames[offset]) & 0xf7;
if (state->dir[offset])
res |= 0x08;
@@ -207,13 +207,13 @@ static READ8_HANDLER( block_input_r )
static WRITE8_HANDLER( block_dial_control_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
if (data == 0x08)
{
/* reset the dial counters */
- state->dial[0] = input_port_read(space->machine, "DIAL1");
- state->dial[1] = input_port_read(space->machine, "DIAL2");
+ state->dial[0] = input_port_read(space->machine(), "DIAL1");
+ state->dial[1] = input_port_read(space->machine(), "DIAL2");
}
else if (data == 0x80)
state->dial_selected = 0;
@@ -224,7 +224,7 @@ static WRITE8_HANDLER( block_dial_control_w )
static READ8_HANDLER( mahjong_input_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
int i;
static const char *const keynames[2][5] =
{
@@ -235,7 +235,7 @@ static READ8_HANDLER( mahjong_input_r )
for (i = 0; i < 5; i++)
{
if (state->keymatrix & (0x80 >> i))
- return input_port_read(space->machine, keynames[offset][i]);
+ return input_port_read(space->machine(), keynames[offset][i]);
}
return 0xff;
@@ -243,42 +243,42 @@ static READ8_HANDLER( mahjong_input_r )
static WRITE8_HANDLER( mahjong_input_select_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
state->keymatrix = data;
}
static READ8_HANDLER( input_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
switch (state->input_type)
{
case 0:
default:
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
case 1: /* Mahjong games */
if (offset)
return mahjong_input_r(space, offset - 1);
else
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
break;
case 2: /* Block Block - dial control */
if (offset)
return block_input_r(space, offset - 1);
else
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
break;
case 3: /* Super Pang - simulate START 1 press to initialize EEPROM */
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
}
static WRITE8_HANDLER( input_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
switch (state->input_type)
{
@@ -366,7 +366,7 @@ ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( spangbl_msm5205_data_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
state->sample_buffer = data;
}
#endif
@@ -385,7 +385,7 @@ ADDRESS_MAP_END
/**** Monsters World ****/
static WRITE8_DEVICE_HANDLER( oki_banking_w )
{
- mitchell_state *state = device->machine->driver_data<mitchell_state>();
+ mitchell_state *state = device->machine().driver_data<mitchell_state>();
state->oki->set_bank_base(0x40000 * (data & 3));
}
@@ -399,7 +399,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(mstworld_sound_w)
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -1076,7 +1076,7 @@ GFXDECODE_END
static MACHINE_START( mitchell )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->save_item(NAME(state->sample_buffer));
state->save_item(NAME(state->sample_select));
@@ -1089,7 +1089,7 @@ static MACHINE_START( mitchell )
static MACHINE_RESET( mitchell )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->sample_buffer = 0;
state->sample_select = 0;
@@ -1198,7 +1198,7 @@ GFXDECODE_END
static void spangbl_adpcm_int( device_t *device )
{
- mitchell_state *state = device->machine->driver_data<mitchell_state>();
+ mitchell_state *state = device->machine().driver_data<mitchell_state>();
msm5205_data_w(device, state->sample_buffer & 0x0f);
state->sample_buffer >>= 4;
state->sample_select ^= 1;
@@ -2097,23 +2097,23 @@ ROM_END
*
*************************************/
-static void bootleg_decode( running_machine *machine )
+static void bootleg_decode( running_machine &machine )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x50000);
- memory_configure_bank_decrypted(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x60000, 0x4000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x50000);
+ memory_configure_bank_decrypted(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x60000, 0x4000);
}
-static void configure_banks( running_machine *machine )
+static void configure_banks( running_machine &machine )
{
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( dokaben )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
mgakuen2_decode(machine);
@@ -2121,7 +2121,7 @@ static DRIVER_INIT( dokaben )
}
static DRIVER_INIT( pang )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
pang_decode(machine);
@@ -2129,7 +2129,7 @@ static DRIVER_INIT( pang )
}
static DRIVER_INIT( pangb )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
bootleg_decode(machine);
@@ -2137,7 +2137,7 @@ static DRIVER_INIT( pangb )
}
static DRIVER_INIT( cworld )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
cworld_decode(machine);
@@ -2145,7 +2145,7 @@ static DRIVER_INIT( cworld )
}
static DRIVER_INIT( hatena )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
hatena_decode(machine);
@@ -2153,45 +2153,45 @@ static DRIVER_INIT( hatena )
}
static DRIVER_INIT( spang )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 3;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
spang_decode(machine);
configure_banks(machine);
}
static DRIVER_INIT( spangbl )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 3;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
static DRIVER_INIT( spangj )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 3;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
spangj_decode(machine);
configure_banks(machine);
}
static DRIVER_INIT( sbbros )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 3;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xe000]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xe000]; /* NVRAM */
sbbros_decode(machine);
configure_banks(machine);
}
static DRIVER_INIT( qtono1 )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
qtono1_decode(machine);
@@ -2199,7 +2199,7 @@ static DRIVER_INIT( qtono1 )
}
static DRIVER_INIT( qsangoku )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 0;
state->nvram_size = 0;
qsangoku_decode(machine);
@@ -2207,15 +2207,15 @@ static DRIVER_INIT( qsangoku )
}
static DRIVER_INIT( mgakuen )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 1;
configure_banks(machine);
- machine->device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "DSW0");
- machine->device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSW1");
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "DSW0");
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSW1");
}
static DRIVER_INIT( mgakuen2 )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 1;
state->nvram_size = 0;
mgakuen2_decode(machine);
@@ -2223,7 +2223,7 @@ static DRIVER_INIT( mgakuen2 )
}
static DRIVER_INIT( pkladies )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 1;
state->nvram_size = 0;
mgakuen2_decode(machine);
@@ -2231,7 +2231,7 @@ static DRIVER_INIT( pkladies )
}
static DRIVER_INIT( pkladiesbl )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 1;
state->nvram_size = 0;
bootleg_decode(machine);
@@ -2239,7 +2239,7 @@ static DRIVER_INIT( pkladiesbl )
}
static DRIVER_INIT( marukin )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 1;
state->nvram_size = 0;
marukin_decode(machine);
@@ -2247,19 +2247,19 @@ static DRIVER_INIT( marukin )
}
static DRIVER_INIT( block )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 2;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
block_decode(machine);
configure_banks(machine);
}
static DRIVER_INIT( blockbl )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->input_type = 2;
state->nvram_size = 0x80;
- state->nvram = &machine->region("maincpu")->base()[0xff80]; /* NVRAM */
+ state->nvram = &machine.region("maincpu")->base()[0xff80]; /* NVRAM */
bootleg_decode(machine);
configure_banks(machine);
}
@@ -2267,9 +2267,9 @@ static DRIVER_INIT( blockbl )
static DRIVER_INIT( mstworld )
{
/* descramble the program rom .. */
- int len = machine->region("maincpu")->bytes();
+ int len = machine.region("maincpu")->bytes();
UINT8* source = auto_alloc_array(machine, UINT8, len);
- UINT8* dst = machine->region("maincpu")->base() ;
+ UINT8* dst = machine.region("maincpu")->base() ;
int x;
static const int tablebank[]=
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 4387a631c4d..990800d67c3 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -68,12 +68,12 @@ static STREAM_UPDATE( mjkjidai_adpcm_callback )
static DEVICE_START( mjkjidai_adpcm )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<legacy_device_base *>(device)->token();
state->playing = 0;
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
- state->base = machine->region("adpcm")->base();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback);
+ state->base = machine.region("adpcm")->base();
state->adpcm.reset();
}
@@ -114,7 +114,7 @@ static WRITE8_DEVICE_HANDLER( adpcm_w )
static READ8_HANDLER( keyboard_r )
{
- mjkjidai_state *state = space->machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = space->machine().driver_data<mjkjidai_state>();
int res = 0x3f,i;
static const char *const keynames[] = { "PL2_1", "PL2_2", "PL2_3", "PL2_4", "PL2_5", "PL2_6", "PL1_1", "PL1_2", "PL1_3", "PL1_4", "PL1_5", "PL1_6" };
@@ -124,12 +124,12 @@ static READ8_HANDLER( keyboard_r )
{
if (~state->keyb & (1 << i))
{
- res = input_port_read(space->machine, keynames[i]) & 0x3f;
+ res = input_port_read(space->machine(), keynames[i]) & 0x3f;
break;
}
}
- res |= (input_port_read(space->machine, "IN3") & 0xc0);
+ res |= (input_port_read(space->machine(), "IN3") & 0xc0);
if (state->nvram_init_count)
{
@@ -142,7 +142,7 @@ static READ8_HANDLER( keyboard_r )
static WRITE8_HANDLER( keyboard_select_w )
{
- mjkjidai_state *state = space->machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = space->machine().driver_data<mjkjidai_state>();
// logerror("%04x: keyboard_select %d = %02x\n",cpu_get_pc(space->cpu),offset,data);
@@ -155,7 +155,7 @@ static WRITE8_HANDLER( keyboard_select_w )
static NVRAM_HANDLER( mjkjidai )
{
- mjkjidai_state *state = machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
if (read_or_write)
file->write(state->nvram, state->nvram_size);
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index 4e407120616..4e16a4875bf 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -55,17 +55,17 @@ public:
static VIDEO_START( mjsister )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
- state->tmpbitmap0 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
- state->tmpbitmap1 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
+ mjsister_state *state = machine.driver_data<mjsister_state>();
+ state->tmpbitmap0 = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
+ state->tmpbitmap1 = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
state->save_item(NAME(state->videoram0));
state->save_item(NAME(state->videoram1));
}
-static void mjsister_plot0( running_machine *machine, int offset, UINT8 data )
+static void mjsister_plot0( running_machine &machine, int offset, UINT8 data )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
int x, y, c1, c2;
x = offset & 0x7f;
@@ -78,9 +78,9 @@ static void mjsister_plot0( running_machine *machine, int offset, UINT8 data )
*BITMAP_ADDR16(state->tmpbitmap0, y, x * 2 + 1) = c2;
}
-static void mjsister_plot1( running_machine *machine, int offset, UINT8 data )
+static void mjsister_plot1( running_machine &machine, int offset, UINT8 data )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
int x, y, c1, c2;
x = offset & 0x7f;
@@ -100,22 +100,22 @@ static void mjsister_plot1( running_machine *machine, int offset, UINT8 data )
static WRITE8_HANDLER( mjsister_videoram_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
if (state->vrambank)
{
state->videoram1[offset] = data;
- mjsister_plot1(space->machine, offset, data);
+ mjsister_plot1(space->machine(), offset, data);
}
else
{
state->videoram0[offset] = data;
- mjsister_plot0(space->machine, offset, data);
+ mjsister_plot0(space->machine(), offset, data);
}
}
static SCREEN_UPDATE( mjsister )
{
- mjsister_state *state = screen->machine->driver_data<mjsister_state>();
+ mjsister_state *state = screen->machine().driver_data<mjsister_state>();
int flip = state->flip_screen;
int i, j;
@@ -125,8 +125,8 @@ static SCREEN_UPDATE( mjsister )
for (offs = 0; offs < 0x8000; offs++)
{
- mjsister_plot0(screen->machine, offs, state->videoram0[offs]);
- mjsister_plot1(screen->machine, offs, state->videoram1[offs]);
+ mjsister_plot0(screen->machine(), offs, state->videoram0[offs]);
+ mjsister_plot1(screen->machine(), offs, state->videoram1[offs]);
}
state->screen_redraw = 0;
}
@@ -141,7 +141,7 @@ static SCREEN_UPDATE( mjsister )
copybitmap_trans(bitmap, state->tmpbitmap1, flip, flip, 2, 0, cliprect, 0);
}
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -153,38 +153,38 @@ static SCREEN_UPDATE( mjsister )
static TIMER_CALLBACK( dac_callback )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
- UINT8 *DACROM = machine->region("samples")->base();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
+ UINT8 *DACROM = machine.region("samples")->base();
dac_data_w(state->dac, DACROM[(state->dac_bank * 0x10000 + state->dac_adr++) & 0x1ffff]);
if (((state->dac_adr & 0xff00 ) >> 8) != state->dac_adr_e)
- machine->scheduler().timer_set(attotime::from_hz(MCLK) * 1024, FUNC(dac_callback));
+ machine.scheduler().timer_set(attotime::from_hz(MCLK) * 1024, FUNC(dac_callback));
else
state->dac_busy = 0;
}
static WRITE8_HANDLER( mjsister_dac_adr_s_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
state->dac_adr_s = data;
}
static WRITE8_HANDLER( mjsister_dac_adr_e_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
state->dac_adr_e = data;
state->dac_adr = state->dac_adr_s << 8;
if (state->dac_busy == 0)
- space->machine->scheduler().synchronize(FUNC(dac_callback));
+ space->machine().scheduler().synchronize(FUNC(dac_callback));
state->dac_busy = 1;
}
static WRITE8_HANDLER( mjsister_banksel1_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
int tmp = state->colorbank;
switch (data)
@@ -215,12 +215,12 @@ static WRITE8_HANDLER( mjsister_banksel1_w )
if (tmp != state->colorbank)
state->screen_redraw = 1;
- memory_set_bank(space->machine, "bank1", state->rombank0 * 2 + state->rombank1);
+ memory_set_bank(space->machine(), "bank1", state->rombank0 * 2 + state->rombank1);
}
static WRITE8_HANDLER( mjsister_banksel2_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
switch (data)
{
@@ -234,24 +234,24 @@ static WRITE8_HANDLER( mjsister_banksel2_w )
logerror("%04x p31_w:%02x\n", cpu_get_pc(space->cpu), data);
}
- memory_set_bank(space->machine, "bank1", state->rombank0 * 2 + state->rombank1);
+ memory_set_bank(space->machine(), "bank1", state->rombank0 * 2 + state->rombank1);
}
static WRITE8_HANDLER( mjsister_input_sel1_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
state->input_sel1 = data;
}
static WRITE8_HANDLER( mjsister_input_sel2_w )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
state->input_sel2 = data;
}
static READ8_HANDLER( mjsister_keys_r )
{
- mjsister_state *state = space->machine->driver_data<mjsister_state>();
+ mjsister_state *state = space->machine().driver_data<mjsister_state>();
int p, i, ret = 0;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
@@ -261,7 +261,7 @@ static READ8_HANDLER( mjsister_keys_r )
for (i = 0; i < 6; i++)
{
if (BIT(p, i))
- ret |= input_port_read(space->machine, keynames[i]);
+ ret |= input_port_read(space->machine(), keynames[i]);
}
return ret;
@@ -437,7 +437,7 @@ static const ay8910_interface ay8910_config =
static STATE_POSTLOAD( mjsister_redraw )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
/* we can skip saving tmpbitmaps because we can redraw them from vram */
state->screen_redraw = 1;
@@ -445,13 +445,13 @@ static STATE_POSTLOAD( mjsister_redraw )
static MACHINE_START( mjsister )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000);
- state->maincpu = machine->device("maincpu");
- state->dac = machine->device("dac");
+ state->maincpu = machine.device("maincpu");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->dac_busy));
state->save_item(NAME(state->flip_screen));
@@ -466,12 +466,12 @@ static MACHINE_START( mjsister )
state->save_item(NAME(state->dac_bank));
state->save_item(NAME(state->dac_adr_s));
state->save_item(NAME(state->dac_adr_e));
- machine->state().register_postload(mjsister_redraw, 0);
+ machine.state().register_postload(mjsister_redraw, 0);
}
static MACHINE_RESET( mjsister )
{
- mjsister_state *state = machine->driver_data<mjsister_state>();
+ mjsister_state *state = machine.driver_data<mjsister_state>();
state->dac_busy = 0;
state->flip_screen = 0;
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index fc93d93284a..dd24838e3f2 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -61,7 +61,7 @@ static VIDEO_START(mlanding)
// 768: plane landing sequence
static SCREEN_UPDATE(mlanding)
{
- mlanding_state *state = screen->machine->driver_data<mlanding_state>();
+ mlanding_state *state = screen->machine().driver_data<mlanding_state>();
int x, y;
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
@@ -73,8 +73,8 @@ static SCREEN_UPDATE(mlanding)
{
UINT16 srcpix = *src++;
- *dst++ = screen->machine->pens[256+(srcpix & 0xff) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)];
- *dst++ = screen->machine->pens[256+(srcpix >> 8) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)];
+ *dst++ = screen->machine().pens[256+(srcpix & 0xff) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)];
+ *dst++ = screen->machine().pens[256+(srcpix >> 8) + (state->pal_fg_bank & 1 ? 0x100 : 0x000)];
}
}
@@ -82,9 +82,9 @@ static SCREEN_UPDATE(mlanding)
}
/* Return the number of pixels processed for timing purposes? */
-static int start_dma(running_machine *machine)
+static int start_dma(running_machine &machine)
{
- mlanding_state *state = machine->driver_data<mlanding_state>();
+ mlanding_state *state = machine.driver_data<mlanding_state>();
/* Traverse the DMA RAM list */
int offs;
@@ -203,20 +203,20 @@ static int start_dma(running_machine *machine)
static WRITE16_HANDLER(ml_tileram_w)
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
COMBINE_DATA(&state->ml_tileram[offset]);
}
static READ16_HANDLER(ml_tileram_r)
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
return state->ml_tileram[offset];
}
static READ16_HANDLER( io1_r ) //240006
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
/*
fedcba9876543210
x - mecha driver status
@@ -228,14 +228,14 @@ static READ16_HANDLER( io1_r ) //240006
*/
// multiplexed? or just overriden?
- int retval = (state->dma_active << 15) | (input_port_read(space->machine, "DSW") & 0x7fff);
+ int retval = (state->dma_active << 15) | (input_port_read(space->machine(), "DSW") & 0x7fff);
return retval;
}
/* output */
static WRITE16_HANDLER(ml_output_w)
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
/*
x--- ---- palette fg bankswitch
---x ---- coin lockout?
@@ -250,12 +250,12 @@ static WRITE16_HANDLER(ml_output_w)
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
data=0;
- memory_set_bankptr(device->machine, "bank1", device->machine->region("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
+ memory_set_bankptr(device->machine(), "bank1", device->machine().region("audiocpu")->base() + ((data) & 0x03) * 0x4000 + 0x10000 );
}
static void ml_msm5205_vck(device_t *device)
{
- mlanding_state *state = device->machine->driver_data<mlanding_state>();
+ mlanding_state *state = device->machine().driver_data<mlanding_state>();
// popmessage("%08x",state->adpcm_pos);
@@ -267,7 +267,7 @@ static void ml_msm5205_vck(device_t *device)
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->adpcm_data & 0xf);
@@ -275,7 +275,7 @@ static void ml_msm5205_vck(device_t *device)
if(state->trigger == 0)
{
state->adpcm_pos++;
- //cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ //cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
/*TODO: simplify this */
if(ROM[state->adpcm_pos] == 0x00 && ROM[state->adpcm_pos+1] == 0x00 && ROM[state->adpcm_pos+2] == 0x00 && ROM[state->adpcm_pos+3] == 0x00
&& ROM[state->adpcm_pos+4] == 0x00 && ROM[state->adpcm_pos+5] == 0x00 && ROM[state->adpcm_pos+6] == 0x00 && ROM[state->adpcm_pos+7] == 0x00
@@ -288,74 +288,74 @@ static void ml_msm5205_vck(device_t *device)
static TIMER_CALLBACK( dma_complete )
{
- mlanding_state *state = machine->driver_data<mlanding_state>();
+ mlanding_state *state = machine.driver_data<mlanding_state>();
state->dma_active = 0;
}
/* TODO: this uses many bits */
static WRITE16_HANDLER( ml_sub_reset_w )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
int pixels;
// Return the number of pixels drawn?
- pixels = start_dma(space->machine);
+ pixels = start_dma(space->machine());
if (pixels)
{
state->dma_active = 1;
- space->machine->scheduler().timer_set(attotime::from_msec(20), FUNC(dma_complete));
+ space->machine().scheduler().timer_set(attotime::from_msec(20), FUNC(dma_complete));
}
if(!(data & 0x40)) // unknown line used
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE);
//data & 0x20 sound cpu?
if(!(data & 0x80)) // unknown line used
{
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, CLEAR_LINE);
state->dsp_HOLD_signal = data & 0x80;
}
}
static WRITE16_HANDLER( ml_to_sound_w )
{
- device_t *tc0140syt = space->machine->device("tc0140syt");
+ device_t *tc0140syt = space->machine().device("tc0140syt");
if (offset == 0)
tc0140syt_port_w(tc0140syt, 0, data & 0xff);
else if (offset == 1)
{
- //cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ //cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
tc0140syt_comm_w(tc0140syt, 0, data & 0xff);
}
}
static WRITE8_HANDLER( ml_sound_to_main_w )
{
- device_t *tc0140syt = space->machine->device("tc0140syt");
+ device_t *tc0140syt = space->machine().device("tc0140syt");
if (offset == 0)
tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff);
else if (offset == 1)
{
- //cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ //cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
tc0140syt_slave_comm_w(tc0140syt, 0, data & 0xff);
}
}
static READ16_HANDLER( ml_analog1_lsb_r )
{
- return input_port_read(space->machine, "STICKX") & 0xff;
+ return input_port_read(space->machine(), "STICKX") & 0xff;
}
static READ16_HANDLER( ml_analog2_lsb_r )
{
- return input_port_read(space->machine, "STICKY") & 0xff;
+ return input_port_read(space->machine(), "STICKY") & 0xff;
}
static READ16_HANDLER( ml_analog3_lsb_r )
{
- return (input_port_read(space->machine, "STICKZ") & 0xff);
+ return (input_port_read(space->machine(), "STICKZ") & 0xff);
}
/*
@@ -381,7 +381,7 @@ static READ16_HANDLER( ml_analog3_lsb_r )
/* high bits of analog inputs + "limiters"/ADC converters. */
static READ16_HANDLER( ml_analog1_msb_r )
{
- return ((input_port_read(space->machine, "STICKY") & 0xf00)>>8) | (input_port_read(space->machine, "IN2") & 0xf0);
+ return ((input_port_read(space->machine(), "STICKY") & 0xf00)>>8) | (input_port_read(space->machine(), "IN2") & 0xf0);
}
static READ16_HANDLER( ml_analog2_msb_r )
@@ -389,8 +389,8 @@ static READ16_HANDLER( ml_analog2_msb_r )
UINT8 res;
UINT16 y_adc,x_adc;
- y_adc = input_port_read(space->machine, "STICKY");
- x_adc = input_port_read(space->machine, "STICKZ");
+ y_adc = input_port_read(space->machine(), "STICKY");
+ x_adc = input_port_read(space->machine(), "STICKZ");
res = 0;
@@ -406,7 +406,7 @@ static READ16_HANDLER( ml_analog2_msb_r )
// popmessage("%04x %04x",x_adc,y_adc);
- return ((input_port_read(space->machine, "STICKZ") & 0xf00)>>8) | res;
+ return ((input_port_read(space->machine(), "STICKZ") & 0xf00)>>8) | res;
}
static READ16_HANDLER( ml_analog3_msb_r )
@@ -414,8 +414,8 @@ static READ16_HANDLER( ml_analog3_msb_r )
UINT8 z_adc,res;
UINT16 x_adc;
- z_adc = input_port_read(space->machine, "STICKX");
- x_adc = input_port_read(space->machine, "STICKZ");
+ z_adc = input_port_read(space->machine(), "STICKX");
+ x_adc = input_port_read(space->machine(), "STICKZ");
res = 0;
@@ -429,23 +429,23 @@ static READ16_HANDLER( ml_analog3_msb_r )
if(x_adc & 0x800 || x_adc == 0)
res|= 0x10;
- return ((input_port_read(space->machine, "STICKX") & 0xf00)>>8) | res;
+ return ((input_port_read(space->machine(), "STICKX") & 0xf00)>>8) | res;
}
static WRITE16_HANDLER( ml_nmi_to_sound_w )
{
-// cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+// cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
static READ16_HANDLER( ml_mecha_ram_r )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
return (state->mecha_ram[offset*2]<<8)|state->mecha_ram[offset*2+1];
}
static WRITE16_HANDLER( ml_mecha_ram_w )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
COMBINE_DATA(state->mecha_ram+offset*2+1);
data >>= 8;
mem_mask >>= 8;
@@ -501,7 +501,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( ml_msm_start_lsb_w )
{
- mlanding_state *state = device->machine->driver_data<mlanding_state>();
+ mlanding_state *state = device->machine().driver_data<mlanding_state>();
state->adpcm_pos = (state->adpcm_pos & 0x0f0000) | ((data & 0xff)<<8) | 0x20;
state->adpcm_idle = 0;
msm5205_reset_w(device,0);
@@ -510,7 +510,7 @@ static WRITE8_DEVICE_HANDLER( ml_msm_start_lsb_w )
static WRITE8_HANDLER( ml_msm_start_msb_w )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff00) | ((data & 0x0f)<<16) | 0x20;
}
@@ -532,26 +532,26 @@ ADDRESS_MAP_END
static READ16_HANDLER( ml_dotram_r )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
return state->ml_dotram[offset];
}
static WRITE16_HANDLER( ml_dotram_w )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
state->ml_dotram[offset] = data;
}
static READ16_HANDLER( dsp_HOLD_signal_r )
{
- mlanding_state *state = space->machine->driver_data<mlanding_state>();
+ mlanding_state *state = space->machine().driver_data<mlanding_state>();
return state->dsp_HOLD_signal;
}
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
//mecha driver ?
@@ -713,7 +713,7 @@ INPUT_PORTS_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const msm5205_interface msm5205_config =
@@ -735,7 +735,7 @@ static const tc0140syt_interface mlanding_tc0140syt_intf =
static MACHINE_RESET( mlanding )
{
- mlanding_state *state = machine->driver_data<mlanding_state>();
+ mlanding_state *state = machine.driver_data<mlanding_state>();
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -833,7 +833,7 @@ ROM_END
static DRIVER_INIT(mlanding)
{
-// UINT8 *rom = machine->region("sub")->base();
+// UINT8 *rom = machine.region("sub")->base();
// rom[0x88b]=0x4e;
// rom[0x88a]=0x71;
}
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index adc9bfaacd5..d50998de189 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -643,13 +643,13 @@ static READ16_HANDLER( io_r )
static const char *const inputnames[] = { "IN0", "IN1", "IN2" };
if(offset < 0x8)
- return input_port_read_safe(space->machine, analognames[offset], 0x00);
+ return input_port_read_safe(space->machine(), analognames[offset], 0x00);
if(offset < 0x10)
{
offset -= 0x8;
if(offset < 3)
- return input_port_read(space->machine, inputnames[offset]);
+ return input_port_read(space->machine(), inputnames[offset]);
return 0xff;
}
@@ -667,7 +667,7 @@ static WRITE16_HANDLER( bank_w )
if(ACCESSING_BITS_0_7) {
switch(data & 0xf) {
case 0x1: // 100000-1fffff data roms banking
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x1000000 + 0x100000*((data >> 4) & 0xf));
logerror("BANK %x\n", 0x1000000 + 0x100000*((data >> 4) & 0xf));
break;
case 0x2: // 200000-2fffff data roms banking (unused, all known games have only one bank)
@@ -680,9 +680,9 @@ static WRITE16_HANDLER( bank_w )
-static void irq_raise(running_machine *machine, int level)
+static void irq_raise(running_machine &machine, int level)
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
// logerror("irq: raising %d\n", level);
// irq_status |= (1 << level);
state->last_irq = level;
@@ -691,7 +691,7 @@ static void irq_raise(running_machine *machine, int level)
static IRQ_CALLBACK(irq_callback)
{
- model1_state *state = device->machine->driver_data<model1_state>();
+ model1_state *state = device->machine().driver_data<model1_state>();
return state->last_irq;
}
// vf
@@ -708,38 +708,38 @@ static IRQ_CALLBACK(irq_callback)
// 3 = ff54c
// other = ff568/ff574
-static void irq_init(running_machine *machine)
+static void irq_init(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
static INTERRUPT_GEN(model1_interrupt)
{
- model1_state *state = device->machine->driver_data<model1_state>();
+ model1_state *state = device->machine().driver_data<model1_state>();
if (cpu_getiloops(device))
{
- irq_raise(device->machine, 1);
+ irq_raise(device->machine(), 1);
}
else
{
- irq_raise(device->machine, state->sound_irq);
+ irq_raise(device->machine(), state->sound_irq);
// if the FIFO has something in it, signal the 68k too
if (state->fifo_rptr != state->fifo_wptr)
{
- cputag_set_input_line(device->machine, "audiocpu", 2, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 2, HOLD_LINE);
}
}
}
static MACHINE_RESET(model1)
{
- model1_state *state = machine->driver_data<model1_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x1000000);
+ model1_state *state = machine.driver_data<model1_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x1000000);
irq_init(machine);
- model1_tgp_reset(machine, !strcmp(machine->system().name, "swa") || !strcmp(machine->system().name, "wingwar") || !strcmp(machine->system().name, "wingwaru") || !strcmp(machine->system().name, "wingwarj"));
- if (!strcmp(machine->system().name, "swa"))
+ model1_tgp_reset(machine, !strcmp(machine.system().name, "swa") || !strcmp(machine.system().name, "wingwar") || !strcmp(machine.system().name, "wingwaru") || !strcmp(machine.system().name, "wingwarj"));
+ if (!strcmp(machine.system().name, "swa"))
{
state->sound_irq = 0;
}
@@ -755,8 +755,8 @@ static MACHINE_RESET(model1)
static MACHINE_RESET(model1_vr)
{
- model1_state *state = machine->driver_data<model1_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x1000000);
+ model1_state *state = machine.driver_data<model1_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x1000000);
irq_init(machine);
model1_vr_tgp_reset(machine);
state->sound_irq = 3;
@@ -780,7 +780,7 @@ static WRITE16_HANDLER( network_ctl_w )
static WRITE16_HANDLER(md1_w)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->display_list1+offset);
if(0 && offset)
return;
@@ -790,7 +790,7 @@ static WRITE16_HANDLER(md1_w)
static WRITE16_HANDLER(md0_w)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->display_list0+offset);
if(0 && offset)
return;
@@ -800,15 +800,15 @@ static WRITE16_HANDLER(md0_w)
static WRITE16_HANDLER(p_w)
{
- UINT16 old = space->machine->generic.paletteram.u16[offset];
+ UINT16 old = space->machine().generic.paletteram.u16[offset];
paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset, data, mem_mask);
- if(0 && space->machine->generic.paletteram.u16[offset] != old)
+ if(0 && space->machine().generic.paletteram.u16[offset] != old)
logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu));
}
static WRITE16_HANDLER(mr_w)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->mr+offset);
if(0 && offset == 0x1138/2)
logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x500000, data, mem_mask, cpu_get_pc(space->cpu));
@@ -816,7 +816,7 @@ static WRITE16_HANDLER(mr_w)
static WRITE16_HANDLER(mr2_w)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->mr2+offset);
#if 0
if(0 && offset == 0x6e8/2) {
@@ -841,7 +841,7 @@ static WRITE16_HANDLER(mr2_w)
static READ16_HANDLER( snd_68k_ready_r )
{
- int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR);
+ int sr = cpu_get_reg(space->machine().device("audiocpu"), M68K_SR);
if ((sr & 0x0700) > 0x0100)
{
@@ -854,13 +854,13 @@ static READ16_HANDLER( snd_68k_ready_r )
static WRITE16_HANDLER( snd_latch_to_68k_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
state->to_68k[state->fifo_wptr] = data;
state->fifo_wptr++;
if (state->fifo_wptr >= ARRAY_LENGTH(state->to_68k)) state->fifo_wptr = 0;
// signal the 68000 that there's data waiting
- cputag_set_input_line(space->machine, "audiocpu", 2, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 2, HOLD_LINE);
// give the 68k time to reply
device_spin_until_time(space->cpu, attotime::from_usec(40));
}
@@ -963,7 +963,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( m1_snd_68k_latch_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
UINT16 retval;
retval = state->to_68k[state->fifo_rptr];
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 841e554f8a8..34774487818 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -112,7 +112,7 @@ enum {
#define COPRO_FIFOIN_SIZE 32000
static int copro_fifoin_pop(device_t *device, UINT32 *result)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
UINT32 r;
if (state->copro_fifoin_num == 0)
@@ -151,7 +151,7 @@ static int copro_fifoin_pop(device_t *device, UINT32 *result)
static void copro_fifoin_push(device_t *device, UINT32 data)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
if (state->copro_fifoin_num == COPRO_FIFOIN_SIZE)
{
fatalerror("Copro FIFOIN overflow (at %08X)", cpu_get_pc(device));
@@ -179,7 +179,7 @@ static void copro_fifoin_push(device_t *device, UINT32 data)
#define COPRO_FIFOOUT_SIZE 32000
static UINT32 copro_fifoout_pop(address_space *space)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
UINT32 r;
if (state->copro_fifoout_num == 0)
@@ -209,11 +209,11 @@ static UINT32 copro_fifoout_pop(address_space *space)
{
if (state->copro_fifoout_num == COPRO_FIFOOUT_SIZE)
{
- sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
}
else
{
- sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
}
}
@@ -222,7 +222,7 @@ static UINT32 copro_fifoout_pop(address_space *space)
static void copro_fifoout_push(device_t *device, UINT32 data)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
//if (state->copro_fifoout_wpos == state->copro_fifoout_rpos)
if (state->copro_fifoout_num == COPRO_FIFOOUT_SIZE)
{
@@ -261,7 +261,7 @@ static void copro_fifoout_push(device_t *device, UINT32 data)
/* Timers - these count down at 25 MHz and pull IRQ2 when they hit 0 */
static READ32_HANDLER( timers_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
i960_noburst(space->cpu);
// if timer is running, calculate current value
@@ -279,7 +279,7 @@ static READ32_HANDLER( timers_r )
static WRITE32_HANDLER( timers_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
attotime period;
i960_noburst(space->cpu);
@@ -293,7 +293,7 @@ static WRITE32_HANDLER( timers_w )
static TIMER_DEVICE_CALLBACK( model2_timer_cb )
{
- model2_state *state = timer.machine->driver_data<model2_state>();
+ model2_state *state = timer.machine().driver_data<model2_state>();
int tnum = (int)(FPTR)ptr;
int bit = tnum + 2;
@@ -302,7 +302,7 @@ static TIMER_DEVICE_CALLBACK( model2_timer_cb )
state->intreq |= (1<<bit);
if (state->intena & (1<<bit))
{
- cputag_set_input_line(timer.machine, "maincpu", I960_IRQ2, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", I960_IRQ2, ASSERT_LINE);
}
state->timervals[tnum] = 0;
@@ -311,14 +311,14 @@ static TIMER_DEVICE_CALLBACK( model2_timer_cb )
static MACHINE_START(model2)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
state->copro_fifoin_data = auto_alloc_array_clear(machine, UINT32, COPRO_FIFOIN_SIZE);
state->copro_fifoout_data = auto_alloc_array_clear(machine, UINT32, COPRO_FIFOOUT_SIZE);
}
static MACHINE_RESET(model2_common)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
int i;
state->intreq = 0;
@@ -337,17 +337,17 @@ static MACHINE_RESET(model2_common)
state->timerrun[0] = state->timerrun[1] = state->timerrun[2] = state->timerrun[3] = 0;
- state->timers[0] = machine->device<timer_device>("timer0");
- state->timers[1] = machine->device<timer_device>("timer1");
- state->timers[2] = machine->device<timer_device>("timer2");
- state->timers[3] = machine->device<timer_device>("timer3");
+ state->timers[0] = machine.device<timer_device>("timer0");
+ state->timers[1] = machine.device<timer_device>("timer1");
+ state->timers[2] = machine.device<timer_device>("timer2");
+ state->timers[3] = machine.device<timer_device>("timer3");
for (i=0; i<4; i++)
state->timers[i]->reset();
}
static MACHINE_RESET(model2o)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
MACHINE_RESET_CALL(model2_common);
// hold TGP in halt until we have code
@@ -358,18 +358,18 @@ static MACHINE_RESET(model2o)
static MACHINE_RESET(model2_scsp)
{
- model2_state *state = machine->driver_data<model2_state>();
- memory_set_bankptr(machine, "bank4", machine->region("scsp")->base() + 0x200000);
- memory_set_bankptr(machine, "bank5", machine->region("scsp")->base() + 0x600000);
+ model2_state *state = machine.driver_data<model2_state>();
+ memory_set_bankptr(machine, "bank4", machine.region("scsp")->base() + 0x200000);
+ memory_set_bankptr(machine, "bank5", machine.region("scsp")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->soundram, machine->region("audiocpu")->base() + 0x80000, 16);
- machine->device("audiocpu")->reset();
+ memcpy(state->soundram, machine.region("audiocpu")->base() + 0x80000, 16);
+ machine.device("audiocpu")->reset();
}
static MACHINE_RESET(model2)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
MACHINE_RESET_CALL(model2_common);
MACHINE_RESET_CALL(model2_scsp);
@@ -381,7 +381,7 @@ static MACHINE_RESET(model2)
static MACHINE_RESET(model2b)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
MACHINE_RESET_CALL(model2_common);
MACHINE_RESET_CALL(model2_scsp);
@@ -397,34 +397,34 @@ static MACHINE_RESET(model2b)
static MACHINE_RESET(model2c)
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
MACHINE_RESET_CALL(model2_common);
MACHINE_RESET_CALL(model2_scsp);
state->dsp_type = DSP_TYPE_TGPX4;
}
-static void chcolor(running_machine *machine, pen_t color, UINT16 data)
+static void chcolor(running_machine &machine, pen_t color, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
}
static WRITE32_HANDLER( pal32_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
COMBINE_DATA(state->paletteram32 + offset);
if(ACCESSING_BITS_0_15)
- chcolor(space->machine, offset * 2, state->paletteram32[offset]);
+ chcolor(space->machine(), offset * 2, state->paletteram32[offset]);
if(ACCESSING_BITS_16_31)
- chcolor(space->machine, offset * 2 + 1, state->paletteram32[offset] >> 16);
+ chcolor(space->machine(), offset * 2 + 1, state->paletteram32[offset] >> 16);
}
static WRITE32_HANDLER( ctrl0_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if(ACCESSING_BITS_0_7)
{
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
state->ctrlmode = data & 0x01;
eeprom_write_bit(device, data & 0x20);
eeprom_set_clock_line(device, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
@@ -434,14 +434,14 @@ static WRITE32_HANDLER( ctrl0_w )
static WRITE32_HANDLER( analog_2b_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
state->analog_channel = (data >> 16) & 0x07;
}
static READ32_HANDLER( fifoctl_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
UINT32 r = 0;
if (state->copro_fifoout_num == 0)
@@ -455,13 +455,13 @@ static READ32_HANDLER( fifoctl_r )
static READ32_HANDLER( videoctl_r )
{
- return (space->machine->primary_screen->frame_number() & 1) << 2;
+ return (space->machine().primary_screen->frame_number() & 1) << 2;
}
static CUSTOM_INPUT( _1c00000_r )
{
- model2_state *state = field->port->machine->driver_data<model2_state>();
- UINT32 ret = input_port_read(field->port->machine, "IN0");
+ model2_state *state = field->port->machine().driver_data<model2_state>();
+ UINT32 ret = input_port_read(field->port->machine(), "IN0");
if(state->ctrlmode == 0)
{
@@ -470,18 +470,18 @@ static CUSTOM_INPUT( _1c00000_r )
else
{
ret &= ~0x0030;
- return ret | 0x00d0 | (eeprom_read_bit(field->port->machine->device("eeprom")) << 5);
+ return ret | 0x00d0 | (eeprom_read_bit(field->port->machine().device("eeprom")) << 5);
}
}
static CUSTOM_INPUT( _1c0001c_r )
{
- model2_state *state = field->port->machine->driver_data<model2_state>();
+ model2_state *state = field->port->machine().driver_data<model2_state>();
UINT32 iptval = 0x00ff;
if(state->analog_channel < 4)
{
static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
- iptval = input_port_read_safe(field->port->machine, ports[state->analog_channel], 0);
+ iptval = input_port_read_safe(field->port->machine(), ports[state->analog_channel], 0);
++state->analog_channel;
}
return iptval;
@@ -564,7 +564,7 @@ static CUSTOM_INPUT( rchase2_devices_r )
static WRITE32_HANDLER( rchase2_devices_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
/*
0x00040000 start 1 lamp
0x00080000 start 2 lamp
@@ -577,7 +577,7 @@ static WRITE32_HANDLER( rchase2_devices_w )
static WRITE32_HANDLER( srallyc_devices_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
/*
0x00040000 start 1 lamp
0x00200000 vr lamp
@@ -587,7 +587,7 @@ static WRITE32_HANDLER( srallyc_devices_w )
if(mem_mask == 0x000000ff || mem_mask == 0x0000ffff)
{
state->driveio_comm_data = data & 0xff;
- cputag_set_input_line(space->machine, "drivecpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "drivecpu", 0, HOLD_LINE);
}
}
@@ -602,7 +602,7 @@ static READ32_HANDLER(copro_prg_r)
static WRITE32_HANDLER(copro_prg_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (state->coproctl & 0x80000000)
{
logerror("copro_prg_w: %08X: %08X\n", state->coprocnt, data);
@@ -616,7 +616,7 @@ static WRITE32_HANDLER(copro_prg_w)
static WRITE32_HANDLER( copro_ctl1_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
// did hi bit change?
if ((data ^ state->coproctl) == 0x80000000)
{
@@ -631,9 +631,9 @@ static WRITE32_HANDLER( copro_ctl1_w )
if (state->dsp_type != DSP_TYPE_TGPX4)
{
if (state->dsp_type == DSP_TYPE_SHARC)
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "tgp", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "tgp", INPUT_LINE_HALT, CLEAR_LINE);
}
}
}
@@ -643,16 +643,16 @@ static WRITE32_HANDLER( copro_ctl1_w )
static WRITE32_HANDLER(copro_function_port_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
UINT32 d = data & 0x800fffff;
UINT32 a = (offset >> 2) & 0xff;
d |= a << 23;
//logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask);
if (state->dsp_type == DSP_TYPE_SHARC)
- copro_fifoin_push(space->machine->device("dsp"), d);
+ copro_fifoin_push(space->machine().device("dsp"), d);
else
- copro_fifoin_push(space->machine->device("tgp"), d);
+ copro_fifoin_push(space->machine().device("tgp"), d);
}
static READ32_HANDLER(copro_fifo_r)
@@ -663,12 +663,12 @@ static READ32_HANDLER(copro_fifo_r)
static WRITE32_HANDLER(copro_fifo_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (state->coproctl & 0x80000000)
{
if (state->dsp_type == DSP_TYPE_SHARC)
{
- sharc_external_dma_write(space->machine->device("dsp"), state->coprocnt, data & 0xffff);
+ sharc_external_dma_write(space->machine().device("dsp"), state->coprocnt, data & 0xffff);
}
else if (state->dsp_type == DSP_TYPE_TGP)
{
@@ -681,27 +681,27 @@ static WRITE32_HANDLER(copro_fifo_w)
{
//mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(space->cpu));
if (state->dsp_type == DSP_TYPE_SHARC)
- copro_fifoin_push(space->machine->device("dsp"), data);
+ copro_fifoin_push(space->machine().device("dsp"), data);
else
- copro_fifoin_push(space->machine->device("tgp"), data);
+ copro_fifoin_push(space->machine().device("tgp"), data);
}
}
static WRITE32_HANDLER(copro_sharc_iop_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
/* FIXME: clean this up */
- if ((strcmp(space->machine->system().name, "schamp" ) == 0) ||
- (strcmp(space->machine->system().name, "sfight" ) == 0) ||
- (strcmp(space->machine->system().name, "fvipers" ) == 0) ||
- (strcmp(space->machine->system().name, "vstriker" ) == 0) ||
- (strcmp(space->machine->system().name, "vstrikero" ) == 0) ||
- (strcmp(space->machine->system().name, "gunblade" ) == 0) ||
- (strcmp(space->machine->system().name, "von" ) == 0) ||
- (strcmp(space->machine->system().name, "vonj" ) == 0) ||
- (strcmp(space->machine->system().name, "rchase2" ) == 0))
+ if ((strcmp(space->machine().system().name, "schamp" ) == 0) ||
+ (strcmp(space->machine().system().name, "sfight" ) == 0) ||
+ (strcmp(space->machine().system().name, "fvipers" ) == 0) ||
+ (strcmp(space->machine().system().name, "vstriker" ) == 0) ||
+ (strcmp(space->machine().system().name, "vstrikero" ) == 0) ||
+ (strcmp(space->machine().system().name, "gunblade" ) == 0) ||
+ (strcmp(space->machine().system().name, "von" ) == 0) ||
+ (strcmp(space->machine().system().name, "vonj" ) == 0) ||
+ (strcmp(space->machine().system().name, "rchase2" ) == 0))
{
- sharc_external_iop_write(space->machine->device("dsp"), offset, data);
+ sharc_external_iop_write(space->machine().device("dsp"), offset, data);
}
else
{
@@ -712,7 +712,7 @@ static WRITE32_HANDLER(copro_sharc_iop_w)
else
{
state->iop_data |= (data & 0xffff) << 16;
- sharc_external_iop_write(space->machine->device("dsp"), offset, state->iop_data);
+ sharc_external_iop_write(space->machine().device("dsp"), offset, state->iop_data);
}
state->iop_write_num++;
}
@@ -728,7 +728,7 @@ static WRITE32_HANDLER(copro_sharc_iop_w)
static WRITE32_HANDLER( geo_ctl1_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
// did hi bit change?
if ((data ^ state->geoctl) == 0x80000000)
{
@@ -750,7 +750,7 @@ static WRITE32_HANDLER( geo_ctl1_w )
#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( geo_sharc_ctl1_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
// did hi bit change?
if ((data ^ state->geoctl) == 0x80000000)
{
@@ -762,7 +762,7 @@ static WRITE32_HANDLER( geo_sharc_ctl1_w )
else
{
logerror("Boot geo, %d dwords\n", state->geocnt);
- cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_HALT, CLEAR_LINE);
//device_spin_until_time(space->cpu, attotime::from_usec(1000)); // Give the SHARC enough time to boot itself
}
}
@@ -772,7 +772,7 @@ static WRITE32_HANDLER( geo_sharc_ctl1_w )
static READ32_HANDLER(geo_sharc_fifo_r)
{
- if ((strcmp(space->machine->system().name, "manxtt" ) == 0) || (strcmp(space->machine->system().name, "srallyc" ) == 0))
+ if ((strcmp(space->machine().system().name, "manxtt" ) == 0) || (strcmp(space->machine().system().name, "srallyc" ) == 0))
{
return 8;
}
@@ -785,10 +785,10 @@ static READ32_HANDLER(geo_sharc_fifo_r)
static WRITE32_HANDLER(geo_sharc_fifo_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (state->geoctl & 0x80000000)
{
- sharc_external_dma_write(space->machine->device("dsp2"), state->geocnt, data & 0xffff);
+ sharc_external_dma_write(space->machine().device("dsp2"), state->geocnt, data & 0xffff);
state->geocnt++;
}
@@ -800,10 +800,10 @@ static WRITE32_HANDLER(geo_sharc_fifo_w)
static WRITE32_HANDLER(geo_sharc_iop_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
- if ((strcmp(space->machine->system().name, "schamp" ) == 0))
+ model2_state *state = space->machine().driver_data<model2_state>();
+ if ((strcmp(space->machine().system().name, "schamp" ) == 0))
{
- sharc_external_iop_write(space->machine->device("dsp2"), offset, data);
+ sharc_external_iop_write(space->machine().device("dsp2"), offset, data);
}
else
{
@@ -814,7 +814,7 @@ static WRITE32_HANDLER(geo_sharc_iop_w)
else
{
state->geo_iop_data |= (data & 0xffff) << 16;
- sharc_external_iop_write(space->machine->device("dsp2"), offset, state->geo_iop_data);
+ sharc_external_iop_write(space->machine().device("dsp2"), offset, state->geo_iop_data);
}
state->geo_iop_write_num++;
}
@@ -836,7 +836,7 @@ static READ32_HANDLER(geo_prg_r)
static WRITE32_HANDLER(geo_prg_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (state->geoctl & 0x80000000)
{
//logerror("geo_prg_w: %08X: %08X\n", state->geocnt, data);
@@ -851,7 +851,7 @@ static WRITE32_HANDLER(geo_prg_w)
static READ32_HANDLER( geo_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
int address = offset * 4;
if (address == 0x2008)
{
@@ -870,7 +870,7 @@ static READ32_HANDLER( geo_r )
static WRITE32_HANDLER( geo_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
int address = offset * 4;
if (address < 0x1000)
@@ -967,7 +967,7 @@ static READ32_HANDLER(desert_unk_r)
static READ32_HANDLER(model2_irq_r)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
i960_noburst(space->cpu);
if (offset)
@@ -980,7 +980,7 @@ static READ32_HANDLER(model2_irq_r)
static WRITE32_HANDLER(model2_irq_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
i960_noburst(space->cpu);
if (offset)
@@ -995,7 +995,7 @@ static WRITE32_HANDLER(model2_irq_w)
static int snd_68k_ready_r(address_space *space)
{
- int sr = cpu_get_reg(space->machine->device("audiocpu"), M68K_SR);
+ int sr = cpu_get_reg(space->machine().device("audiocpu"), M68K_SR);
if ((sr & 0x0700) > 0x0100)
{
@@ -1008,7 +1008,7 @@ static int snd_68k_ready_r(address_space *space)
static void snd_latch_to_68k_w(address_space *space, int data)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (!snd_68k_ready_r(space))
{
device_spin_until_time(space->cpu, attotime::from_usec(40));
@@ -1016,7 +1016,7 @@ static void snd_latch_to_68k_w(address_space *space, int data)
state->to_68k = data;
- cputag_set_input_line(space->machine, "audiocpu", 2, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 2, HOLD_LINE);
// give the 68k time to notice
device_spin_until_time(space->cpu, attotime::from_usec(40));
@@ -1044,7 +1044,7 @@ static WRITE32_HANDLER( model2_serial_w )
{
if (ACCESSING_BITS_0_7 && (offset == 0))
{
- scsp_midi_in(space->machine->device("scsp"), 0, data&0xff, 0);
+ scsp_midi_in(space->machine().device("scsp"), 0, data&0xff, 0);
// give the 68k time to notice
device_spin_until_time(space->cpu, attotime::from_usec(40));
@@ -1071,7 +1071,7 @@ static const UINT8 DCOPKey1326[]=
static READ32_HANDLER( model2_prot_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
UINT32 retval = 0;
if (offset == 0x10000/4)
@@ -1105,7 +1105,7 @@ static READ32_HANDLER( model2_prot_r )
static WRITE32_HANDLER( model2_prot_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if (mem_mask == 0xffff0000)
{
data >>= 16;
@@ -1178,8 +1178,8 @@ static WRITE32_HANDLER( model2_prot_w )
static READ32_HANDLER( maxx_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)space->machine->region("maincpu")->base();
+ model2_state *state = space->machine().driver_data<model2_state>();
+ UINT32 *ROM = (UINT32 *)space->machine().region("maincpu")->base();
if (offset <= 0x1f/4)
{
@@ -1224,7 +1224,7 @@ static READ32_HANDLER( maxx_r )
static READ32_HANDLER( network_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000))
{
return 0xffffffff;
@@ -1249,7 +1249,7 @@ static READ32_HANDLER( network_r )
static WRITE32_HANDLER( network_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if ((mem_mask == 0xffffffff) || (mem_mask == 0x0000ffff) || (mem_mask == 0xffff0000))
{
COMBINE_DATA(&state->netram[offset+0x4000/4]);
@@ -1302,7 +1302,7 @@ static WRITE32_HANDLER(mode_w)
static WRITE32_HANDLER(model2o_tex_w0)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if ( (offset & 1) == 0 )
{
state->textureram0[offset>>1] &= 0xffff0000;
@@ -1317,7 +1317,7 @@ static WRITE32_HANDLER(model2o_tex_w0)
static WRITE32_HANDLER(model2o_tex_w1)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if ( (offset & 1) == 0 )
{
state->textureram1[offset>>1] &= 0xffff0000;
@@ -1332,7 +1332,7 @@ static WRITE32_HANDLER(model2o_tex_w1)
static WRITE32_HANDLER(model2o_luma_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if ( (offset & 1) == 0 )
{
state->lumaram[offset>>1] &= 0xffff0000;
@@ -1347,7 +1347,7 @@ static WRITE32_HANDLER(model2o_luma_w)
static WRITE32_HANDLER(model2_3d_zclip_w)
{
- model2_3d_set_zclip( space->machine, data & 0xFF );
+ model2_3d_set_zclip( space->machine(), data & 0xFF );
}
/* common map for all Model 2 versions */
@@ -1788,7 +1788,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN(model2_interrupt)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
switch (cpu_getiloops(device))
{
case 0:
@@ -1810,7 +1810,7 @@ static INTERRUPT_GEN(model2_interrupt)
static INTERRUPT_GEN(model2c_interrupt)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
switch (cpu_getiloops(device))
{
case 0:
@@ -1836,7 +1836,7 @@ static INTERRUPT_GEN(model2c_interrupt)
static READ16_HANDLER( m1_snd_68k_latch_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
return state->to_68k;
}
@@ -1877,18 +1877,18 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( model2snd_ctrl )
{
// handle sample banking
- if (space->machine->region("scsp")->bytes() > 0x800000)
+ if (space->machine().region("scsp")->bytes() > 0x800000)
{
- UINT8 *snd = space->machine->region("scsp")->base();
+ UINT8 *snd = space->machine().region("scsp")->base();
if (data & 0x20)
{
- memory_set_bankptr(space->machine, "bank4", snd + 0x200000);
- memory_set_bankptr(space->machine, "bank5", snd + 0x600000);
+ memory_set_bankptr(space->machine(), "bank4", snd + 0x200000);
+ memory_set_bankptr(space->machine(), "bank5", snd + 0x600000);
}
else
{
- memory_set_bankptr(space->machine, "bank4", snd + 0x800000);
- memory_set_bankptr(space->machine, "bank5", snd + 0xa00000);
+ memory_set_bankptr(space->machine(), "bank4", snd + 0x800000);
+ memory_set_bankptr(space->machine(), "bank5", snd + 0xa00000);
}
}
}
@@ -1906,14 +1906,14 @@ ADDRESS_MAP_END
static void scsp_irq(device_t *device, int irq)
{
- model2_state *state = device->machine->driver_data<model2_state>();
+ model2_state *state = device->machine().driver_data<model2_state>();
if (irq > 0)
{
state->scsp_last_line = irq;
- cputag_set_input_line(device->machine, "audiocpu", irq, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", irq, ASSERT_LINE);
}
else
- cputag_set_input_line(device->machine, "audiocpu", -irq, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", -irq, CLEAR_LINE);
}
static const scsp_interface scsp_config =
@@ -1932,25 +1932,25 @@ static READ32_HANDLER(copro_sharc_input_fifo_r)
UINT32 result = 0;
//mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(space->cpu));
- copro_fifoin_pop(space->machine->device("dsp"), &result);
+ copro_fifoin_pop(space->machine().device("dsp"), &result);
return result;
}
static WRITE32_HANDLER(copro_sharc_output_fifo_w)
{
//mame_printf_debug("SHARC FIFOOUT push %08X\n", data);
- copro_fifoout_push(space->machine->device("dsp"), data);
+ copro_fifoout_push(space->machine().device("dsp"), data);
}
static READ32_HANDLER(copro_sharc_buffer_r)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
return state->bufferram[offset & 0x7fff];
}
static WRITE32_HANDLER(copro_sharc_buffer_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
//mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, cpu_get_pc(space->cpu), data, *(float*)&data);
state->bufferram[offset & 0x7fff] = data;
}
@@ -1972,13 +1972,13 @@ ADDRESS_MAP_END
static READ32_HANDLER(copro_tgp_buffer_r)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
return state->bufferram[offset & 0x7fff];
}
static WRITE32_HANDLER(copro_tgp_buffer_w)
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
state->bufferram[offset&0x7fff] = data;
}
@@ -2109,7 +2109,7 @@ MACHINE_CONFIG_END
static READ8_HANDLER( driveio_port_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
return state->driveio_comm_data;
}
@@ -4994,17 +4994,17 @@ ROM_END
static DRIVER_INIT( genprot )
{
- model2_state *state = machine->driver_data<model2_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
+ model2_state *state = machine.driver_data<model2_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
state->protstate = state->protpos = 0;
}
static DRIVER_INIT( pltkids )
{
- model2_state *state = machine->driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ model2_state *state = machine.driver_data<model2_state>();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
state->protstate = state->protpos = 0;
// fix bug in program: it destroys the interrupt table and never fixes it
@@ -5013,10 +5013,10 @@ static DRIVER_INIT( pltkids )
static DRIVER_INIT( zerogun )
{
- model2_state *state = machine->driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ model2_state *state = machine.driver_data<model2_state>();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
state->protstate = state->protpos = 0;
// fix bug in program: it destroys the interrupt table and never fixes it
@@ -5025,14 +5025,14 @@ static DRIVER_INIT( zerogun )
static DRIVER_INIT( daytonam )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x240000, 0x24ffff, FUNC(maxx_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x240000, 0x24ffff, FUNC(maxx_r) );
}
/* very crude support for let the game set itself into stand-alone mode */
static READ32_HANDLER( jaleco_network_r )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
if(offset == 0x4000/4)
{
if(state->netram[offset] == 0x00000000)
@@ -5052,17 +5052,17 @@ static READ32_HANDLER( jaleco_network_r )
static WRITE32_HANDLER( jaleco_network_w )
{
- model2_state *state = space->machine->driver_data<model2_state>();
+ model2_state *state = space->machine().driver_data<model2_state>();
COMBINE_DATA(&state->netram[offset]);
}
static DRIVER_INIT( sgt24h )
{
- model2_state *state = machine->driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ model2_state *state = machine.driver_data<model2_state>();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w));
state->protstate = state->protpos = 0;
@@ -5072,7 +5072,7 @@ static DRIVER_INIT( sgt24h )
static DRIVER_INIT( overrev )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01a10000, 0x01a1ffff, FUNC(jaleco_network_r), FUNC(jaleco_network_w));
//TODO: cache patch?
}
@@ -5080,10 +5080,10 @@ static DRIVER_INIT( overrev )
static DRIVER_INIT( doa )
{
- model2_state *state = machine->driver_data<model2_state>();
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ model2_state *state = machine.driver_data<model2_state>();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x01d80000, 0x01dfffff, FUNC(model2_prot_r), FUNC(model2_prot_w));
state->protstate = state->protpos = 0;
ROM[0x630/4] = 0x08000004;
@@ -5092,12 +5092,12 @@ static DRIVER_INIT( doa )
static DRIVER_INIT( rchase2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(rchase2_devices_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(rchase2_devices_w));
}
static DRIVER_INIT( srallyc )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(srallyc_devices_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c00008, 0x01c0000b, FUNC(srallyc_devices_w));
}
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index 744353f9eaf..941fcd71e93 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -608,13 +608,13 @@ ALL VROM ROMs are 16M MASK
#include "includes/model3.h"
-static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap);
+static void real3d_dma_callback(running_machine &machine, UINT32 src, UINT32 dst, int length, int byteswap);
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
if ((state->irq_enable & state->irq_state) || state->scsi_irq_state)
{
// printf("IRQ set: state %x enable %x scsi %x\n", state->irq_state, state->irq_enable, state->scsi_irq_state);
@@ -628,9 +628,9 @@ static void update_irq_state(running_machine *machine)
}
}
-void model3_set_irq_line(running_machine *machine, UINT8 bit, int line)
+void model3_set_irq_line(running_machine &machine, UINT8 bit, int line)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
if (line != CLEAR_LINE)
state->irq_state |= bit;
else
@@ -771,7 +771,7 @@ static void pci_device_set_reg(model3_state *state, UINT32 value)
static READ64_HANDLER( mpc105_addr_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if (ACCESSING_BITS_32_63)
{
return (UINT64)state->mpc105_addr << 32;
@@ -781,7 +781,7 @@ static READ64_HANDLER( mpc105_addr_r )
static WRITE64_HANDLER( mpc105_addr_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if (ACCESSING_BITS_32_63)
{
UINT32 d = FLIPENDIAN_INT32((UINT32)(data >> 32));
@@ -796,7 +796,7 @@ static WRITE64_HANDLER( mpc105_addr_w )
static READ64_HANDLER( mpc105_data_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(state->pci_device == 0) {
return ((UINT64)(FLIPENDIAN_INT32(state->mpc105_regs[(state->pci_reg/2)+1])) << 32) |
((UINT64)(FLIPENDIAN_INT32(state->mpc105_regs[(state->pci_reg/2)+0])));
@@ -806,7 +806,7 @@ static READ64_HANDLER( mpc105_data_r )
static WRITE64_HANDLER( mpc105_data_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(state->pci_device == 0) {
state->mpc105_regs[(state->pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32));
state->mpc105_regs[(state->pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data));
@@ -820,21 +820,21 @@ static WRITE64_HANDLER( mpc105_data_w )
static READ64_HANDLER( mpc105_reg_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
return ((UINT64)(state->mpc105_regs[(offset*2)+0]) << 32) |
(UINT64)(state->mpc105_regs[(offset*2)+1]);
}
static WRITE64_HANDLER( mpc105_reg_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
state->mpc105_regs[(offset*2)+0] = (UINT32)(data >> 32);
state->mpc105_regs[(offset*2)+1] = (UINT32)data;
}
-static void mpc105_init(running_machine *machine)
+static void mpc105_init(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
/* set reset values */
memset(state->mpc105_regs, 0, sizeof(state->mpc105_regs));
state->mpc105_regs[0x00/4] = 0x00011057; /* Vendor ID & Device ID */
@@ -854,7 +854,7 @@ static void mpc105_init(running_machine *machine)
static READ64_HANDLER( mpc106_addr_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if (ACCESSING_BITS_32_63)
{
return (UINT64)state->mpc106_addr << 32;
@@ -864,7 +864,7 @@ static READ64_HANDLER( mpc106_addr_r )
static WRITE64_HANDLER( mpc106_addr_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if (ACCESSING_BITS_32_63)
{
UINT32 d = FLIPENDIAN_INT32((UINT32)(data >> 32));
@@ -887,7 +887,7 @@ static WRITE64_HANDLER( mpc106_addr_w )
static READ64_HANDLER( mpc106_data_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(state->pci_device == 0) {
return ((UINT64)(FLIPENDIAN_INT32(state->mpc106_regs[(state->pci_reg/2)+1])) << 32) |
((UINT64)(FLIPENDIAN_INT32(state->mpc106_regs[(state->pci_reg/2)+0])));
@@ -904,7 +904,7 @@ static READ64_HANDLER( mpc106_data_r )
static WRITE64_HANDLER( mpc106_data_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(state->pci_device == 0) {
state->mpc106_regs[(state->pci_reg/2)+1] = FLIPENDIAN_INT32((UINT32)(data >> 32));
state->mpc106_regs[(state->pci_reg/2)+0] = FLIPENDIAN_INT32((UINT32)(data));
@@ -918,21 +918,21 @@ static WRITE64_HANDLER( mpc106_data_w )
static READ64_HANDLER( mpc106_reg_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
return ((UINT64)(state->mpc106_regs[(offset*2)+0]) << 32) |
(UINT64)(state->mpc106_regs[(offset*2)+1]);
}
static WRITE64_HANDLER( mpc106_reg_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
state->mpc106_regs[(offset*2)+0] = (UINT32)(data >> 32);
state->mpc106_regs[(offset*2)+1] = (UINT32)data;
}
-static void mpc106_init(running_machine *machine)
+static void mpc106_init(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
/* set reset values */
memset(state->mpc106_regs, 0, sizeof(state->mpc106_regs));
state->mpc106_regs[0x00/4] = 0x00021057; /* Vendor ID & Device ID */
@@ -1014,17 +1014,17 @@ static WRITE64_HANDLER(scsi_w)
}
}
-static UINT32 scsi_fetch(running_machine *machine, UINT32 dsp)
+static UINT32 scsi_fetch(running_machine &machine, UINT32 dsp)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 result;
result = space->read_dword(dsp);
return FLIPENDIAN_INT32(result);
}
-static void scsi_irq_callback(running_machine *machine, int state)
+static void scsi_irq_callback(running_machine &machine, int state)
{
- model3_state *drvstate = machine->driver_data<model3_state>();
+ model3_state *drvstate = machine.driver_data<model3_state>();
drvstate->scsi_irq_state = state;
update_irq_state(machine);
}
@@ -1035,7 +1035,7 @@ static void scsi_irq_callback(running_machine *machine, int state)
static READ64_HANDLER( real3d_dma_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 1:
@@ -1052,7 +1052,7 @@ static READ64_HANDLER( real3d_dma_r )
static WRITE64_HANDLER( real3d_dma_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 0:
@@ -1071,21 +1071,21 @@ static WRITE64_HANDLER( real3d_dma_w )
int length = FLIPENDIAN_INT32((UINT32)(data >> 32)) * 4;
if (state->dma_endian & 0x80)
{
- real3d_dma_callback(space->machine, state->dma_source, state->dma_dest, length, 0);
+ real3d_dma_callback(space->machine(), state->dma_source, state->dma_dest, length, 0);
}
else
{
- real3d_dma_callback(space->machine, state->dma_source, state->dma_dest, length, 1);
+ real3d_dma_callback(space->machine(), state->dma_source, state->dma_dest, length, 1);
}
state->dma_irq |= 0x01;
- scsi_irq_callback(space->machine, 1);
+ scsi_irq_callback(space->machine(), 1);
return;
}
else if(ACCESSING_BITS_16_23)
{
if(data & 0x10000) {
state->dma_irq &= ~0x1;
- scsi_irq_callback(space->machine, 0);
+ scsi_irq_callback(space->machine(), 0);
}
return;
}
@@ -1116,9 +1116,9 @@ static WRITE64_HANDLER( real3d_dma_w )
logerror("real3d_dma_w: %08X, %08X%08X, %08X%08X", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask));
}
-static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst, int length, int byteswap)
+static void real3d_dma_callback(running_machine &machine, UINT32 src, UINT32 dst, int length, int byteswap)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
switch(dst >> 24)
{
case 0x88: /* Display List End Trigger */
@@ -1142,7 +1142,7 @@ static void real3d_dma_callback(running_machine *machine, UINT32 src, UINT32 dst
case 0x9c: /* Unknown */
break;
default:
- logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine->device("maincpu")));
+ logerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(machine.device("maincpu")));
break;
}
}
@@ -1184,26 +1184,26 @@ static void model3_exit(running_machine &machine)
lsi53c810_exit(&scsi_intf);
}
-static void configure_fast_ram(running_machine *machine)
+static void configure_fast_ram(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->work_ram);
}
static MACHINE_START(model3_10)
{
lsi53c810_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
configure_fast_ram(machine);
}
static MACHINE_START(model3_15)
{
lsi53c810_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
configure_fast_ram(machine);
}
static MACHINE_START(model3_20)
@@ -1215,26 +1215,26 @@ static MACHINE_START(model3_21)
configure_fast_ram(machine);
}
-static void model3_init(running_machine *machine, int step)
+static void model3_init(running_machine &machine, int step)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
state->step = step;
- memory_set_bankptr(machine, "bank1", machine->region( "user1" )->base() + 0x800000 ); /* banked CROM */
+ memory_set_bankptr(machine, "bank1", machine.region( "user1" )->base() + 0x800000 ); /* banked CROM */
- memory_set_bankptr(machine, "bank4", machine->region("samples")->base() + 0x200000);
- memory_set_bankptr(machine, "bank5", machine->region("samples")->base() + 0x600000);
+ memory_set_bankptr(machine, "bank4", machine.region("samples")->base() + 0x200000);
+ memory_set_bankptr(machine, "bank5", machine.region("samples")->base() + 0x600000);
// copy the 68k vector table into RAM
- memcpy(state->soundram, machine->region("audiocpu")->base()+0x80000, 16);
- machine->device("audiocpu")->reset();
+ memcpy(state->soundram, machine.region("audiocpu")->base()+0x80000, 16);
+ machine.device("audiocpu")->reset();
model3_machine_init(machine, step); // step 1.5
model3_tap_reset(machine);
if(step < 0x20) {
- if( mame_stricmp(machine->system().name, "vs215") == 0 ||
- mame_stricmp(machine->system().name, "vs29815") == 0 ||
- mame_stricmp(machine->system().name, "bass") == 0 )
+ if( mame_stricmp(machine.system().name, "vs215") == 0 ||
+ mame_stricmp(machine.system().name, "vs29815") == 0 ||
+ mame_stricmp(machine.system().name, "bass") == 0 )
{
mpc106_init(machine);
}
@@ -1248,8 +1248,8 @@ static void model3_init(running_machine *machine, int step)
mpc106_init(machine);
// some step 2+ games need the older PCI ID (obvious symptom:
// vbl is enabled briefly then disabled so the game hangs)
- if (mame_stricmp(machine->system().name, "magtruck") == 0 ||
- mame_stricmp(machine->system().name, "von254g") == 0)
+ if (mame_stricmp(machine.system().name, "magtruck") == 0 ||
+ mame_stricmp(machine.system().name, "von254g") == 0)
{
state->real3d_device_id = 0x16c311db; /* PCI Vendor ID (11db = SEGA), Device ID (16c3 = 315-5827) */
}
@@ -1268,7 +1268,7 @@ static MACHINE_RESET(model3_21) { model3_init(machine, 0x21); }
static READ64_HANDLER( model3_ctrl_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch( offset )
{
case 0:
@@ -1280,11 +1280,11 @@ static READ64_HANDLER( model3_ctrl_r )
{
if(state->controls_bank & 0x1)
{
- return (input_port_read(space->machine, "IN1")) << 24;
+ return (input_port_read(space->machine(), "IN1")) << 24;
}
else
{
- return (input_port_read(space->machine, "IN0")) << 24;
+ return (input_port_read(space->machine(), "IN0")) << 24;
}
}
break;
@@ -1292,11 +1292,11 @@ static READ64_HANDLER( model3_ctrl_r )
case 1:
if (ACCESSING_BITS_56_63)
{
- return (UINT64)input_port_read(space->machine, "IN2") << 56;
+ return (UINT64)input_port_read(space->machine(), "IN2") << 56;
}
else if (ACCESSING_BITS_24_31)
{
- return input_port_read(space->machine, "IN3") << 24;
+ return input_port_read(space->machine(), "IN3") << 24;
}
break;
@@ -1331,7 +1331,7 @@ static READ64_HANDLER( model3_ctrl_r )
if (ACCESSING_BITS_24_31) /* ADC Data read */
{
static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
- UINT8 adc_data = input_port_read_safe(space->machine, adcnames[state->adc_channel], 0);
+ UINT8 adc_data = input_port_read_safe(space->machine(), adcnames[state->adc_channel], 0);
state->adc_channel++;
state->adc_channel &= 0x7;
return (UINT64)adc_data << 24;
@@ -1345,13 +1345,13 @@ static READ64_HANDLER( model3_ctrl_r )
static WRITE64_HANDLER( model3_ctrl_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 0:
if (ACCESSING_BITS_56_63)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
int reg = (data >> 56) & 0xff;
eeprom_write_bit(device, (reg & 0x20) ? 1 : 0);
eeprom_set_clock_line(device, (reg & 0x80) ? ASSERT_LINE : CLEAR_LINE);
@@ -1385,32 +1385,32 @@ static WRITE64_HANDLER( model3_ctrl_w )
switch(state->lightgun_reg_sel) /* read lightrun register */
{
case 0: /* player 1 gun X-position, lower 8-bits */
- state->serial_fifo2 = input_port_read(space->machine, "LIGHT0_Y") & 0xff;
+ state->serial_fifo2 = input_port_read(space->machine(), "LIGHT0_Y") & 0xff;
break;
case 1: /* player 1 gun X-position, upper 2-bits */
- state->serial_fifo2 = (input_port_read(space->machine, "LIGHT0_Y") >> 8) & 0x3;
+ state->serial_fifo2 = (input_port_read(space->machine(), "LIGHT0_Y") >> 8) & 0x3;
break;
case 2: /* player 1 gun Y-position, lower 8-bits */
- state->serial_fifo2 = input_port_read(space->machine, "LIGHT0_X") & 0xff;
+ state->serial_fifo2 = input_port_read(space->machine(), "LIGHT0_X") & 0xff;
break;
case 3: /* player 1 gun Y-position, upper 2-bits */
- state->serial_fifo2 = (input_port_read(space->machine, "LIGHT0_X") >> 8) & 0x3;
+ state->serial_fifo2 = (input_port_read(space->machine(), "LIGHT0_X") >> 8) & 0x3;
break;
case 4: /* player 2 gun X-position, lower 8-bits */
- state->serial_fifo2 = input_port_read(space->machine, "LIGHT1_Y") & 0xff;
+ state->serial_fifo2 = input_port_read(space->machine(), "LIGHT1_Y") & 0xff;
break;
case 5: /* player 2 gun X-position, upper 2-bits */
- state->serial_fifo2 = (input_port_read(space->machine, "LIGHT1_Y") >> 8) & 0x3;
+ state->serial_fifo2 = (input_port_read(space->machine(), "LIGHT1_Y") >> 8) & 0x3;
break;
case 6: /* player 2 gun Y-position, lower 8-bits */
- state->serial_fifo2 = input_port_read(space->machine, "LIGHT1_X") & 0xff;
+ state->serial_fifo2 = input_port_read(space->machine(), "LIGHT1_X") & 0xff;
break;
case 7: /* player 2 gun Y-position, upper 2-bits */
- state->serial_fifo2 = (input_port_read(space->machine, "LIGHT1_X") >> 8) & 0x3;
+ state->serial_fifo2 = (input_port_read(space->machine(), "LIGHT1_X") >> 8) & 0x3;
break;
case 8: /* gun offscreen (bit set = gun offscreen, bit clear = gun on screen) */
state->serial_fifo2 = 0; /* bit 0 = player 1, bit 1 = player 2 */
- if(input_port_read(space->machine, "OFFSCREEN") & 0x1) {
+ if(input_port_read(space->machine(), "OFFSCREEN") & 0x1) {
state->serial_fifo2 |= 0x01;
}
break;
@@ -1444,7 +1444,7 @@ static WRITE64_HANDLER( model3_ctrl_w )
static READ64_HANDLER( model3_sys_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
// printf("model3_sys_r: mask %llx @ %x (PC %x)\n", mem_mask, offset, cpu_get_pc(space->cpu));
switch (offset)
@@ -1459,7 +1459,7 @@ static READ64_HANDLER( model3_sys_r )
case 0x10/8:
if (ACCESSING_BITS_56_63)
{
- UINT64 res = model3_tap_read(space->machine);
+ UINT64 res = model3_tap_read(space->machine());
return res<<61;
}
@@ -1481,7 +1481,7 @@ static READ64_HANDLER( model3_sys_r )
static WRITE64_HANDLER( model3_sys_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
// printf("model3_sys_w: %llx to %x mask %llx\n", data, offset, mem_mask);
switch (offset)
@@ -1535,12 +1535,12 @@ static WRITE64_HANDLER( model3_sys_w )
data >>= 56;
data = (~data) & 0x7;
- memory_set_bankptr(space->machine, "bank1", space->machine->region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
if (ACCESSING_BITS_24_31)
{
data >>= 24;
- model3_tap_write(space->machine,
+ model3_tap_write(space->machine(),
(data >> 6) & 1,// TCK
(data >> 2) & 1,// TMS
(data >> 5) & 1,// TDI
@@ -1575,13 +1575,13 @@ static WRITE64_HANDLER( model3_rtc_w )
static READ64_HANDLER(real3d_status_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
state->real3d_status ^= U64(0xffffffffffffffff);
if (offset == 0)
{
/* pretty sure this is VBLANK */
state->real3d_status &= ~U64(0x0000000200000000);
- if (space->machine->primary_screen->vblank())
+ if (space->machine().primary_screen->vblank())
state->real3d_status |= U64(0x0000000200000000);
return state->real3d_status;
}
@@ -1598,13 +1598,13 @@ static WRITE64_HANDLER(model3_sound_w)
{
if ((mem_mask & 0xff000000) == 0xff000000)
{
- model3_set_irq_line(space->machine, 0x40, CLEAR_LINE);
+ model3_set_irq_line(space->machine(), 0x40, CLEAR_LINE);
}
// serial configuration writes
if ((mem_mask == U64(0xff00000000000000)) && (offset == 0))
{
- scsp_midi_in(space->machine->device("scsp1"), 0, (data>>56)&0xff, 0);
+ scsp_midi_in(space->machine().device("scsp1"), 0, (data>>56)&0xff, 0);
// give the 68k time to notice
device_spin_until_time(space->cpu, attotime::from_usec(40));
@@ -1615,14 +1615,14 @@ static WRITE64_HANDLER(model3_sound_w)
static READ64_HANDLER(network_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
mame_printf_debug("network_r: %02X at %08X\n", offset, cpu_get_pc(space->cpu));
return state->network_ram[offset];
}
static WRITE64_HANDLER(network_w)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
COMBINE_DATA(state->network_ram + offset);
mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), cpu_get_pc(space->cpu));
}
@@ -1711,19 +1711,19 @@ static const UINT16 oceanhun_prot_data[] =
static READ64_HANDLER(model3_security_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 0x00/8: return 0; /* status */
case 0x1c/8: /* security board data read */
{
- if (mame_stricmp(space->machine->system().name, "vs299") == 0 ||
- mame_stricmp(space->machine->system().name, "vs2v991") == 0)
+ if (mame_stricmp(space->machine().system().name, "vs299") == 0 ||
+ mame_stricmp(space->machine().system().name, "vs2v991") == 0)
{
return (UINT64)vs299_prot_data[state->prot_data_ptr++] << 48;
}
- else if (mame_stricmp(space->machine->system().name, "swtrilgy") == 0 ||
- mame_stricmp(space->machine->system().name, "swtrilgya") == 0)
+ else if (mame_stricmp(space->machine().system().name, "swtrilgy") == 0 ||
+ mame_stricmp(space->machine().system().name, "swtrilgya") == 0)
{
UINT64 data = (UINT64)swt_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr > 0x38)
@@ -1732,7 +1732,7 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
- else if (mame_stricmp(space->machine->system().name, "fvipers2") == 0)
+ else if (mame_stricmp(space->machine().system().name, "fvipers2") == 0)
{
UINT64 data = (UINT64)fvipers2_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x41)
@@ -1741,8 +1741,8 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
- else if (mame_stricmp(space->machine->system().name, "spikeout") == 0 ||
- mame_stricmp(space->machine->system().name, "spikeofe") == 0)
+ else if (mame_stricmp(space->machine().system().name, "spikeout") == 0 ||
+ mame_stricmp(space->machine().system().name, "spikeofe") == 0)
{
UINT64 data = (UINT64)spikeout_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x55)
@@ -1751,8 +1751,8 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
- else if (mame_stricmp(space->machine->system().name, "eca") == 0 ||
- mame_stricmp(space->machine->system().name, "ecax") == 0)
+ else if (mame_stricmp(space->machine().system().name, "eca") == 0 ||
+ mame_stricmp(space->machine().system().name, "ecax") == 0)
{
UINT64 data = (UINT64)eca_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 0x31)
@@ -1761,7 +1761,7 @@ static READ64_HANDLER(model3_security_r)
}
return data;
}
- else if (mame_stricmp(space->machine->system().name, "oceanhun") == 0)
+ else if (mame_stricmp(space->machine().system().name, "oceanhun") == 0)
{
UINT64 data = (UINT64)oceanhun_prot_data[state->prot_data_ptr++] << 16;
if (state->prot_data_ptr >= 58)
@@ -1785,8 +1785,8 @@ static WRITE64_HANDLER(daytona2_rombank_w)
{
data >>= 56;
data = (~data) & 0xf;
- memory_set_bankptr(space->machine, "bank1", space->machine->region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
- memory_set_bankptr(space->machine, "bank2", space->machine->region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
}
@@ -4894,18 +4894,18 @@ ROM_END
static WRITE16_HANDLER( model3snd_ctrl )
{
// handle sample banking
- if (space->machine->region("scsp2")->bytes() > 0x800000)
+ if (space->machine().region("scsp2")->bytes() > 0x800000)
{
- UINT8 *snd = space->machine->region("scsp2")->base();
+ UINT8 *snd = space->machine().region("scsp2")->base();
if (data & 0x20)
{
- memory_set_bankptr(space->machine, "bank4", snd + 0x200000);
- memory_set_bankptr(space->machine, "bank5", snd + 0x600000);
+ memory_set_bankptr(space->machine(), "bank4", snd + 0x200000);
+ memory_set_bankptr(space->machine(), "bank5", snd + 0x600000);
}
else
{
- memory_set_bankptr(space->machine, "bank4", snd + 0x800000);
- memory_set_bankptr(space->machine, "bank5", snd + 0xa00000);
+ memory_set_bankptr(space->machine(), "bank4", snd + 0x800000);
+ memory_set_bankptr(space->machine(), "bank5", snd + 0xa00000);
}
}
}
@@ -4925,14 +4925,14 @@ ADDRESS_MAP_END
static void scsp_irq(device_t *device, int irq)
{
- model3_state *state = device->machine->driver_data<model3_state>();
+ model3_state *state = device->machine().driver_data<model3_state>();
if (irq > 0)
{
state->scsp_last_line = irq;
- cputag_set_input_line(device->machine, "audiocpu", irq, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", irq, ASSERT_LINE);
}
else
- cputag_set_input_line(device->machine, "audiocpu", -irq, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", -irq, CLEAR_LINE);
}
static const scsp_interface scsp_config =
@@ -4960,11 +4960,11 @@ static const scsp_interface scsp2_interface =
*/
static INTERRUPT_GEN(model3_interrupt)
{
- model3_state *state = device->machine->driver_data<model3_state>();
+ model3_state *state = device->machine().driver_data<model3_state>();
if (state->vblank == 0) {
- model3_set_irq_line(device->machine, 0x02, ASSERT_LINE);
+ model3_set_irq_line(device->machine(), 0x02, ASSERT_LINE);
} else {
- model3_set_irq_line(device->machine, 0x0d, ASSERT_LINE);
+ model3_set_irq_line(device->machine(), 0x0d, ASSERT_LINE);
}
state->vblank++;
@@ -5152,14 +5152,14 @@ static MACHINE_CONFIG_START( model3_21, model3_state )
MCFG_SOUND_ROUTE(0, "rspeaker", 2.0)
MACHINE_CONFIG_END
-static void interleave_vroms(running_machine *machine)
+static void interleave_vroms(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int start;
int i,j,x;
- UINT16 *vrom1 = (UINT16*)machine->region("user3")->base();
- UINT16 *vrom2 = (UINT16*)machine->region("user4")->base();
- int vrom_length = machine->region("user3")->bytes();
+ UINT16 *vrom1 = (UINT16*)machine.region("user3")->base();
+ UINT16 *vrom2 = (UINT16*)machine.region("user4")->base();
+ int vrom_length = machine.region("user3")->bytes();
UINT16 *vrom;
state->vrom = auto_alloc_array(machine, UINT32, 0x4000000/4);
@@ -5187,55 +5187,55 @@ static DRIVER_INIT( model3_10 )
{
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc0000000, 0xc00000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc0000000, 0xc00000ff, FUNC(scsi_r), FUNC(scsi_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
}
static DRIVER_INIT( model3_15 )
{
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
}
static DRIVER_INIT( model3_20 )
{
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc2000000, 0xc20000ff, FUNC(real3d_dma_r), FUNC(real3d_dma_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc2000000, 0xc20000ff, FUNC(real3d_dma_r), FUNC(real3d_dma_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
}
static DRIVER_INIT( lostwsga )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: there's an M68K device at 0xC0000000 - FF, maybe lightgun controls ? */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
rom[0x7374f0/4] = 0x38840004; /* This seems to be an actual bug in the original code */
}
static DRIVER_INIT( scud )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
rom[(0x71275c^4)/4] = 0x60000000;
rom[(0x71277c^4)/4] = 0x60000000;
@@ -5243,11 +5243,11 @@ static DRIVER_INIT( scud )
static DRIVER_INIT( scudp )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
rom[(0x713724^4)/4] = 0x60000000;
rom[(0x713744^4)/4] = 0x60000000;
@@ -5260,10 +5260,10 @@ static DRIVER_INIT( scudp )
static DRIVER_INIT( lemans24 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_15);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc1000000, 0xc10000ff, FUNC(scsi_r), FUNC(scsi_w) );
rom[(0x73fe38^4)/4] = 0x38840004; /* This seems to be an actual bug in the original code */
@@ -5274,7 +5274,7 @@ static DRIVER_INIT( lemans24 )
static DRIVER_INIT( vf3 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_10);
@@ -5287,77 +5287,77 @@ static DRIVER_INIT( vf3 )
static DRIVER_INIT( vs215 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
rom[(0x70dde0^4)/4] = 0x60000000;
rom[(0x70e6f0^4)/4] = 0x60000000;
rom[(0x70e710^4)/4] = 0x60000000;
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
}
static DRIVER_INIT( vs29815 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
rom[(0x6028ec^4)/4] = 0x60000000;
rom[(0x60290c^4)/4] = 0x60000000;
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
}
static DRIVER_INIT( bass )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
rom[(0x7999a8^4)/4] = 0x60000000;
rom[(0x7999c8^4)/4] = 0x60000000;
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfec00000, 0xfedfffff, FUNC(mpc106_addr_r), FUNC(mpc106_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xfee00000, 0xfeffffff, FUNC(mpc106_data_r), FUNC(mpc106_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc106_reg_r), FUNC(mpc106_reg_w) );
}
static DRIVER_INIT( getbass )
{
interleave_vroms(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xff000000, 0xff7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf9000000, 0xf90000ff, FUNC(scsi_r), FUNC(scsi_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0800cf8, 0xf0800cff, FUNC(mpc105_addr_r), FUNC(mpc105_addr_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0c00cf8, 0xf0c00cff, FUNC(mpc105_data_r), FUNC(mpc105_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf8fff000, 0xf8fff0ff, FUNC(mpc105_reg_r), FUNC(mpc105_reg_w) );
}
static DRIVER_INIT( vs2 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5367,7 +5367,7 @@ static DRIVER_INIT( vs2 )
static DRIVER_INIT( vs298 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5378,7 +5378,7 @@ static DRIVER_INIT( vs298 )
static DRIVER_INIT( vs2v991 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5388,7 +5388,7 @@ static DRIVER_INIT( vs2v991 )
static DRIVER_INIT( vs299b )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5398,7 +5398,7 @@ static DRIVER_INIT( vs299b )
static DRIVER_INIT( vs299a )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5408,7 +5408,7 @@ static DRIVER_INIT( vs299a )
static DRIVER_INIT( vs299 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
@@ -5418,12 +5418,12 @@ static DRIVER_INIT( vs299 )
static DRIVER_INIT( harley )
{
- model3_state *state = machine->driver_data<model3_state>();
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ model3_state *state = machine.driver_data<model3_state>();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
state->network_ram = auto_alloc_array_clear(machine, UINT64, 0x10000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc0000000, 0xc00fffff, FUNC(network_r), FUNC(network_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc0000000, 0xc00fffff, FUNC(network_r), FUNC(network_w) );
rom[(0x50e8d4^4)/4] = 0x60000000;
rom[(0x50e8f4^4)/4] = 0x60000000;
@@ -5434,7 +5434,7 @@ static DRIVER_INIT( harley )
static DRIVER_INIT( srally2 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x7c0c4^4)/4] = 0x60000000;
@@ -5444,7 +5444,7 @@ static DRIVER_INIT( srally2 )
static DRIVER_INIT( swtrilgy )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf0e48^4)/4] = 0x60000000;
@@ -5455,7 +5455,7 @@ static DRIVER_INIT( swtrilgy )
static DRIVER_INIT( swtrilga )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0xf6dd0^4)/4] = 0x60000000;
@@ -5463,7 +5463,7 @@ static DRIVER_INIT( swtrilga )
static DRIVER_INIT( von2 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x189168^4)/4] = 0x60000000;
@@ -5475,7 +5475,7 @@ static DRIVER_INIT( von2 )
static DRIVER_INIT( dirtdvls )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x0600a0^4)/4] = 0x60000000;
@@ -5488,11 +5488,11 @@ static DRIVER_INIT( dirtdvls )
static DRIVER_INIT( daytona2 )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc3800000, 0xc3800007, FUNC(daytona2_rombank_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc3800000, 0xc3800007, FUNC(daytona2_rombank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
//rom[(0x68468c^4)/4] = 0x60000000;
rom[(0x6063c4^4)/4] = 0x60000000;
@@ -5502,11 +5502,11 @@ static DRIVER_INIT( daytona2 )
static DRIVER_INIT( dayto2pe )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc3800000, 0xc3800007, FUNC(daytona2_rombank_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc3800000, 0xc3800007, FUNC(daytona2_rombank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc3000000, 0xc37fffff, "bank2" );
rom[(0x606784^4)/4] = 0x60000000;
rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code
@@ -5517,7 +5517,7 @@ static DRIVER_INIT( dayto2pe )
static DRIVER_INIT( spikeout )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5526,7 +5526,7 @@ static DRIVER_INIT( spikeout )
static DRIVER_INIT( spikeofe )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x6059cc^4)/4] = 0x60000000;
@@ -5535,7 +5535,7 @@ static DRIVER_INIT( spikeofe )
static DRIVER_INIT( eca )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x535580^4)/4] = 0x60000000;
@@ -5545,7 +5545,7 @@ static DRIVER_INIT( eca )
static DRIVER_INIT( skichamp )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x5263c8^4)/4] = 0x60000000;
@@ -5556,7 +5556,7 @@ static DRIVER_INIT( skichamp )
static DRIVER_INIT( oceanhun )
{
- UINT32 *rom = (UINT32*)machine->region("user1")->base();
+ UINT32 *rom = (UINT32*)machine.region("user1")->base();
DRIVER_INIT_CALL(model3_20);
rom[(0x57995c^4)/4] = 0x60000000; // decrementer
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index e05f99c96fc..624f8fb11ff 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -59,7 +59,7 @@ static PALETTE_INIT( mogura )
static TILE_GET_INFO( get_mogura_tile_info )
{
- mogura_state *state = machine->driver_data<mogura_state>();
+ mogura_state *state = machine.driver_data<mogura_state>();
int code = state->tileram[tile_index];
int attr = state->tileram[tile_index + 0x800];
@@ -73,14 +73,14 @@ static TILE_GET_INFO( get_mogura_tile_info )
static VIDEO_START( mogura )
{
- mogura_state *state = machine->driver_data<mogura_state>();
- gfx_element_set_source(machine->gfx[0], state->gfxram);
+ mogura_state *state = machine.driver_data<mogura_state>();
+ gfx_element_set_source(machine.gfx[0], state->gfxram);
state->tilemap = tilemap_create(machine, get_mogura_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static SCREEN_UPDATE( mogura )
{
- mogura_state *state = screen->machine->driver_data<mogura_state>();
+ mogura_state *state = screen->machine().driver_data<mogura_state>();
const rectangle &visarea = screen->visible_area();
/* tilemap layout is a bit strange ... */
@@ -104,14 +104,14 @@ static SCREEN_UPDATE( mogura )
static WRITE8_HANDLER( mogura_tileram_w )
{
- mogura_state *state = space->machine->driver_data<mogura_state>();
+ mogura_state *state = space->machine().driver_data<mogura_state>();
state->tileram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset & 0x7ff);
}
static WRITE8_HANDLER(mogura_dac_w)
{
- mogura_state *state = space->machine->driver_data<mogura_state>();
+ mogura_state *state = space->machine().driver_data<mogura_state>();
dac_data_w(state->dac1, data & 0xf0); /* left */
dac_data_w(state->dac2, (data & 0x0f) << 4); /* right */
}
@@ -119,10 +119,10 @@ static WRITE8_HANDLER(mogura_dac_w)
static WRITE8_HANDLER ( mogura_gfxram_w )
{
- mogura_state *state = space->machine->driver_data<mogura_state>();
+ mogura_state *state = space->machine().driver_data<mogura_state>();
state->gfxram[offset] = data ;
- gfx_element_mark_dirty(space->machine->gfx[0], offset / 16);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset / 16);
}
@@ -192,11 +192,11 @@ GFXDECODE_END
static MACHINE_START( mogura )
{
- mogura_state *state = machine->driver_data<mogura_state>();
+ mogura_state *state = machine.driver_data<mogura_state>();
- state->maincpu = machine->device("maincpu");
- state->dac1 = machine->device("dac1");
- state->dac2 = machine->device("dac2");
+ state->maincpu = machine.device("maincpu");
+ state->dac1 = machine.device("dac1");
+ state->dac2 = machine.device("dac2");
}
static MACHINE_CONFIG_START( mogura, mogura_state )
diff --git a/src/mame/drivers/mole.c b/src/mame/drivers/mole.c
index 427f88676d9..4b7b17567d1 100644
--- a/src/mame/drivers/mole.c
+++ b/src/mame/drivers/mole.c
@@ -84,7 +84,7 @@ static PALETTE_INIT( mole )
static TILE_GET_INFO( get_bg_tile_info )
{
- mole_state *state = machine->driver_data<mole_state>();
+ mole_state *state = machine.driver_data<mole_state>();
UINT16 code = state->tileram[tile_index];
SET_TILE_INFO((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0);
@@ -92,7 +92,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( mole )
{
- mole_state *state = machine->driver_data<mole_state>();
+ mole_state *state = machine.driver_data<mole_state>();
memset(state->tileram, 0, sizeof(state->tileram));
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
@@ -101,7 +101,7 @@ static VIDEO_START( mole )
static WRITE8_HANDLER( mole_videoram_w )
{
- mole_state *state = space->machine->driver_data<mole_state>();
+ mole_state *state = space->machine().driver_data<mole_state>();
state->tileram[offset] = data | (state->tile_bank << 8);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -109,7 +109,7 @@ static WRITE8_HANDLER( mole_videoram_w )
static WRITE8_HANDLER( mole_tilebank_w )
{
- mole_state *state = space->machine->driver_data<mole_state>();
+ mole_state *state = space->machine().driver_data<mole_state>();
state->tile_bank = data;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -117,12 +117,12 @@ static WRITE8_HANDLER( mole_tilebank_w )
static WRITE8_HANDLER( mole_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
static SCREEN_UPDATE( mole )
{
- mole_state *state = screen->machine->driver_data<mole_state>();
+ mole_state *state = screen->machine().driver_data<mole_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -302,14 +302,14 @@ GFXDECODE_END
static MACHINE_START( mole )
{
- mole_state *state = machine->driver_data<mole_state>();
+ mole_state *state = machine.driver_data<mole_state>();
state->save_item(NAME(state->tile_bank));
}
static MACHINE_RESET( mole )
{
- mole_state *state = machine->driver_data<mole_state>();
+ mole_state *state = machine.driver_data<mole_state>();
state->tile_bank = 0;
}
diff --git a/src/mame/drivers/momoko.c b/src/mame/drivers/momoko.c
index 5df0a8bbb6b..a153f939f0c 100644
--- a/src/mame/drivers/momoko.c
+++ b/src/mame/drivers/momoko.c
@@ -49,7 +49,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
static WRITE8_HANDLER( momoko_bg_read_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
/****************************************************************************/
@@ -227,8 +227,8 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( momoko )
{
- momoko_state *state = machine->driver_data<momoko_state>();
- UINT8 *BG_MAP = machine->region("user1")->base();
+ momoko_state *state = machine.driver_data<momoko_state>();
+ UINT8 *BG_MAP = machine.region("user1")->base();
memory_configure_bank(machine, "bank1", 0, 32, &BG_MAP[0x0000], 0x1000);
@@ -246,7 +246,7 @@ static MACHINE_START( momoko )
static MACHINE_RESET( momoko )
{
- momoko_state *state = machine->driver_data<momoko_state>();
+ momoko_state *state = machine.driver_data<momoko_state>();
state->fg_scrollx = 0;
state->fg_scrolly = 0;
diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c
index 9e77405d537..3af5a096092 100644
--- a/src/mame/drivers/monzagp.c
+++ b/src/mame/drivers/monzagp.c
@@ -57,35 +57,35 @@ static PALETTE_INIT(monzagp)
static VIDEO_START(monzagp)
{
- monzagp_state *state = machine->driver_data<monzagp_state>();
+ monzagp_state *state = machine.driver_data<monzagp_state>();
state->screenw = 80;
state->vram = auto_alloc_array(machine, UINT8, 0x10000);
}
static SCREEN_UPDATE(monzagp)
{
- monzagp_state *state = screen->machine->driver_data<monzagp_state>();
+ monzagp_state *state = screen->machine().driver_data<monzagp_state>();
int x,y;
- if(input_code_pressed_once(screen->machine,KEYCODE_Z))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_Z))
state->bank--;
- if(input_code_pressed_once(screen->machine,KEYCODE_X))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_X))
state->bank++;
- if(input_code_pressed_once(screen->machine,KEYCODE_Q))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_Q))
{
state->screenw--;
printf("%x\n",state->screenw);
}
- if(input_code_pressed_once(screen->machine,KEYCODE_W))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_W))
{
state->screenw++;
printf("%x\n",state->screenw);
}
- if(input_code_pressed_once(screen->machine,KEYCODE_A))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_A))
{
FILE * p=fopen("vram.bin","wb");
fwrite(&state->vram[0],1,0x10000,p);
@@ -97,7 +97,7 @@ static SCREEN_UPDATE(monzagp)
{
for(x=0;x<256;x++)
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[state->bank&1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[state->bank&1],
state->vram[y*state->screenw+x],
//(state->vram[y*state->screenw+x]&0x3f)+(state->bank>>1)*64,
0,
@@ -117,12 +117,12 @@ ADDRESS_MAP_END
static READ8_HANDLER(rng_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER(port_w)
{
- monzagp_state *state = space->machine->driver_data<monzagp_state>();
+ monzagp_state *state = space->machine().driver_data<monzagp_state>();
state->coordx=offset;//-0xc0;
//state->vram[state->coordy*state->screenw+state->coordx]=data;
//if(output==0xfe)
@@ -184,7 +184,7 @@ static WRITE8_HANDLER(port1_w)
static WRITE8_HANDLER(port2_w)
{
- monzagp_state *state = space->machine->driver_data<monzagp_state>();
+ monzagp_state *state = space->machine().driver_data<monzagp_state>();
// printf("P2 %x = %x\n",cpu_get_pc(space->cpu),data);
state->coordy=data;
}
diff --git a/src/mame/drivers/moo.c b/src/mame/drivers/moo.c
index 4aca56cb7a4..c8dd44d606e 100644
--- a/src/mame/drivers/moo.c
+++ b/src/mame/drivers/moo.c
@@ -66,7 +66,7 @@ static const eeprom_interface eeprom_intf =
static READ16_HANDLER( control2_r )
{
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
return state->cur_control2;
}
@@ -80,10 +80,10 @@ static WRITE16_HANDLER( control2_w )
/* bit 10 is watchdog */
/* bit 11 is enable irq 4 (unconfirmed) */
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
COMBINE_DATA(&state->cur_control2);
- input_port_write(space->machine, "EEPROMOUT", state->cur_control2, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", state->cur_control2, 0xff);
if (data & 0x100)
k053246_set_objcha_line(state->k053246, ASSERT_LINE);
@@ -92,9 +92,9 @@ static WRITE16_HANDLER( control2_w )
}
-static void moo_objdma( running_machine *machine, int type )
+static void moo_objdma( running_machine &machine, int type )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
int num_inactive;
UINT16 *src, *dst, zmask;
int counter = k053247_get_dy(state->k053246);
@@ -121,17 +121,17 @@ static void moo_objdma( running_machine *machine, int type )
static TIMER_CALLBACK( dmaend_callback )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
if (state->cur_control2 & 0x800)
device_set_input_line(state->maincpu, 4, HOLD_LINE);
}
static INTERRUPT_GEN( moo_interrupt )
{
- moo_state *state = device->machine->driver_data<moo_state>();
+ moo_state *state = device->machine().driver_data<moo_state>();
if (k053246_is_irq_enabled(state->k053246))
{
- moo_objdma(device->machine, state->game_type);
+ moo_objdma(device->machine(), state->game_type);
// schedule DMA end interrupt (delay shortened to catch up with V-blank)
state->dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY));
@@ -144,8 +144,8 @@ static INTERRUPT_GEN( moo_interrupt )
static INTERRUPT_GEN( moobl_interrupt )
{
- moo_state *state = device->machine->driver_data<moo_state>();
- moo_objdma(device->machine, state->game_type);
+ moo_state *state = device->machine().driver_data<moo_state>();
+ moo_objdma(device->machine(), state->game_type);
// schedule DMA end interrupt (delay shortened to catch up with V-blank)
state->dmaend_timer->adjust(attotime::from_usec(MOO_DMADELAY));
@@ -171,7 +171,7 @@ static WRITE16_HANDLER( sound_cmd2_w )
static WRITE16_HANDLER( sound_irq_w )
{
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -182,7 +182,7 @@ static READ16_HANDLER( sound_status_r )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x10000 + (data&0xf)*0x4000);
}
@@ -192,7 +192,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
/* of RAM, but they put 0x10000 there. The CPU can access them all. */
static READ16_HANDLER( K053247_scattered_word_r )
{
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
if (offset & 0x0078)
return state->spriteram[offset];
@@ -205,7 +205,7 @@ static READ16_HANDLER( K053247_scattered_word_r )
static WRITE16_HANDLER( K053247_scattered_word_w )
{
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
if (offset & 0x0078)
COMBINE_DATA(state->spriteram + offset);
@@ -222,7 +222,7 @@ static WRITE16_HANDLER( K053247_scattered_word_w )
static WRITE16_HANDLER( moo_prot_w )
{
- moo_state *state = space->machine->driver_data<moo_state>();
+ moo_state *state = space->machine().driver_data<moo_state>();
UINT32 src1, src2, dst, length, a, b, res;
COMBINE_DATA(&state->protram[offset]);
@@ -431,15 +431,15 @@ INPUT_PORTS_END
static MACHINE_START( moo )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->k054539 = machine->device("k054539");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
- state->k056832 = machine->device("k056832");
- state->k054338 = machine->device("k054338");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->k054539 = machine.device("k054539");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
+ state->k056832 = machine.device("k056832");
+ state->k054338 = machine.device("k054338");
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->alpha_enabled));
@@ -448,12 +448,12 @@ static MACHINE_START( moo )
state->save_item(NAME(state->layerpri));
state->save_item(NAME(state->protram));
- state->dmaend_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ state->dmaend_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
}
static MACHINE_RESET( moo )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
int i;
for (i = 0; i < 16; i++)
@@ -915,8 +915,8 @@ ROM_END
static DRIVER_INIT( moo )
{
- moo_state *state = machine->driver_data<moo_state>();
- state->game_type = (!strcmp(machine->system().name, "bucky") || !strcmp(machine->system().name, "buckyua"));
+ moo_state *state = machine.driver_data<moo_state>();
+ state->game_type = (!strcmp(machine.system().name, "bucky") || !strcmp(machine.system().name, "buckyua"));
}
diff --git a/src/mame/drivers/mosaic.c b/src/mame/drivers/mosaic.c
index 93ff486a543..7e58178a2b2 100644
--- a/src/mame/drivers/mosaic.c
+++ b/src/mame/drivers/mosaic.c
@@ -14,7 +14,7 @@
static WRITE8_HANDLER( protection_w )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
if (!BIT(data, 7))
{
@@ -40,7 +40,7 @@ static WRITE8_HANDLER( protection_w )
static READ8_HANDLER( protection_r )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
int res = (state->prot_val >> 8) & 0xff;
logerror("%06x: protection_r %02x\n", cpu_get_pc(space->cpu), res);
@@ -52,7 +52,7 @@ static READ8_HANDLER( protection_r )
static WRITE8_HANDLER( gfire2_protection_w )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
logerror("%06x: protection_w %02x\n", cpu_get_pc(space->cpu), data);
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( gfire2_protection_w )
static READ8_HANDLER( gfire2_protection_r )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
int res = state->prot_val & 0xff;
state->prot_val >>= 8;
@@ -255,14 +255,14 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( mosaic )
{
- mosaic_state *state = machine->driver_data<mosaic_state>();
+ mosaic_state *state = machine.driver_data<mosaic_state>();
state->save_item(NAME(state->prot_val));
}
static MACHINE_RESET( mosaic )
{
- mosaic_state *state = machine->driver_data<mosaic_state>();
+ mosaic_state *state = machine.driver_data<mosaic_state>();
state->prot_val = 0;
}
diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c
index a9e6c16fd57..96a66ab231b 100644
--- a/src/mame/drivers/mouser.c
+++ b/src/mame/drivers/mouser.c
@@ -22,14 +22,14 @@
* the NMI input on the main CPU */
static WRITE8_HANDLER( mouser_nmi_enable_w )
{
- mouser_state *state = space->machine->driver_data<mouser_state>();
+ mouser_state *state = space->machine().driver_data<mouser_state>();
//logerror("nmi_enable %02x\n", data);
state->nmi_enable = data;
}
static INTERRUPT_GEN( mouser_nmi_interrupt )
{
- mouser_state *state = device->machine->driver_data<mouser_state>();
+ mouser_state *state = device->machine().driver_data<mouser_state>();
if (BIT(state->nmi_enable, 0))
nmi_line_pulse(device);
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( mouser_nmi_interrupt )
static WRITE8_HANDLER( mouser_sound_interrupt_w )
{
- mouser_state *state = space->machine->driver_data<mouser_state>();
+ mouser_state *state = space->machine().driver_data<mouser_state>();
//logerror("int %02x\n", data);
state->sound_byte = data;
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
@@ -47,7 +47,7 @@ static WRITE8_HANDLER( mouser_sound_interrupt_w )
static READ8_HANDLER( mouser_sound_byte_r )
{
- mouser_state *state = space->machine->driver_data<mouser_state>();
+ mouser_state *state = space->machine().driver_data<mouser_state>();
//logerror("sound r\n");
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return state->sound_byte;
@@ -55,13 +55,13 @@ static READ8_HANDLER( mouser_sound_byte_r )
static WRITE8_HANDLER( mouser_sound_nmi_clear_w )
{
- mouser_state *state = space->machine->driver_data<mouser_state>();
+ mouser_state *state = space->machine().driver_data<mouser_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
static INTERRUPT_GEN( mouser_sound_nmi_assert )
{
- mouser_state *state = device->machine->driver_data<mouser_state>();
+ mouser_state *state = device->machine().driver_data<mouser_state>();
if (BIT(state->nmi_enable, 0))
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
}
@@ -190,10 +190,10 @@ GFXDECODE_END
static MACHINE_START( mouser )
{
- mouser_state *state = machine->driver_data<mouser_state>();
+ mouser_state *state = machine.driver_data<mouser_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sound_byte));
state->save_item(NAME(state->nmi_enable));
@@ -201,7 +201,7 @@ static MACHINE_START( mouser )
static MACHINE_RESET( mouser )
{
- mouser_state *state = machine->driver_data<mouser_state>();
+ mouser_state *state = machine.driver_data<mouser_state>();
state->sound_byte = 0;
state->nmi_enable = 0;
@@ -300,10 +300,10 @@ static DRIVER_INIT( mouser )
/* Decode the opcodes */
offs_t i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *table = machine->region("user1")->base();
+ UINT8 *table = machine.region("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c
index a23a981c4ef..07c4f163872 100644
--- a/src/mame/drivers/mpoker.c
+++ b/src/mame/drivers/mpoker.c
@@ -193,10 +193,10 @@ static VIDEO_START(mpoker)
static SCREEN_UPDATE(mpoker)
{
- mpoker_state *state = screen->machine->driver_data<mpoker_state>();
+ mpoker_state *state = screen->machine().driver_data<mpoker_state>();
int y,x;
int count;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
count = 0;
for (y=0;y<32;y++)
@@ -232,7 +232,7 @@ static PALETTE_INIT(mpoker)
static READ8_HANDLER( mixport_r )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
/* - bits -
7654 3210
---- ---x Unknown.
@@ -247,7 +247,7 @@ static READ8_HANDLER( mixport_r )
If you change the status *every* read, the HW stucks.
*/
- state->mixdata = (input_port_read(space->machine, "SW2") & 0xfd) | (space->machine->rand() & 0x02);
+ state->mixdata = (input_port_read(space->machine(), "SW2") & 0xfd) | (space->machine().rand() & 0x02);
return state->mixdata;
}
@@ -283,7 +283,7 @@ static READ8_HANDLER( mixport_r )
static WRITE8_HANDLER( outport0_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
output_set_lamp_value(1, (data & 1)); /* Lamp 1 - BET */
output_set_lamp_value(5, (data >> 1) & 1); /* Lamp 5 - HOLD 1 */
@@ -305,7 +305,7 @@ static WRITE8_HANDLER( outport0_w )
static WRITE8_HANDLER( outport1_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
output_set_lamp_value(2, (data & 1)); /* Lamp 2 - DEAL */
output_set_lamp_value(6, (data >> 1) & 1); /* Lamp 6 - HOLD 2 */
@@ -327,7 +327,7 @@ static WRITE8_HANDLER( outport1_w )
static WRITE8_HANDLER( outport2_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
output_set_lamp_value(3, (data & 1)); /* Lamp 3 - CANCEL */
output_set_lamp_value(7, (data >> 1) & 1); /* Lamp 7 - HOLD 3 */
@@ -349,7 +349,7 @@ static WRITE8_HANDLER( outport2_w )
static WRITE8_HANDLER( outport3_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
output_set_lamp_value(4, (data & 1)); /* Lamp 4 - STAND */
output_set_lamp_value(8, (data >> 1) & 1); /* Lamp 8 - HOLD 4 */
@@ -371,7 +371,7 @@ static WRITE8_HANDLER( outport3_w )
static WRITE8_HANDLER( outport4_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
output_set_lamp_value(9, (data >> 1) & 1); /* Lamp 9 - HOLD 5 */
state->output[4] = data;
@@ -392,7 +392,7 @@ static WRITE8_HANDLER( outport4_w )
static WRITE8_HANDLER( outport5_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
state->output[5] = data;
popmessage("outport5 : %02X %02X %02X %02X %02X %02X %02X %02X", state->output[0], state->output[1], state->output[2], state->output[3], state->output[4], state->output[5], state->output[6], state->output[7]);
}
@@ -411,8 +411,8 @@ static WRITE8_HANDLER( outport5_w )
static WRITE8_HANDLER( outport6_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
- coin_counter_w(space->machine, 1, data & 0x02); /* Payout pulse */
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
+ coin_counter_w(space->machine(), 1, data & 0x02); /* Payout pulse */
state->output[6] = data;
popmessage("outport6 : %02X %02X %02X %02X %02X %02X %02X %02X", state->output[0], state->output[1], state->output[2], state->output[3], state->output[4], state->output[5], state->output[6], state->output[7]);
@@ -432,8 +432,8 @@ static WRITE8_HANDLER( outport6_w )
static WRITE8_HANDLER( outport7_w )
{
- mpoker_state *state = space->machine->driver_data<mpoker_state>();
- coin_counter_w(space->machine, 0, data & 0x02); /* Coin pulse */
+ mpoker_state *state = space->machine().driver_data<mpoker_state>();
+ coin_counter_w(space->machine(), 0, data & 0x02); /* Coin pulse */
state->output[7] = data;
popmessage("outport7 : %02X %02X %02X %02X %02X %02X %02X %02X", state->output[0], state->output[1], state->output[2], state->output[3], state->output[4], state->output[5], state->output[6], state->output[7]);
@@ -464,7 +464,7 @@ static WRITE8_HANDLER( outport7_w )
//static WRITE8_HANDLER( sound_w )
//{
-// dac_data_w(space->machine->device("dac"), data);
+// dac_data_w(space->machine().device("dac"), data);
//}
*/
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index a598f891932..1f2001502f8 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -616,7 +616,7 @@ static void mpu4_stepper_reset(mpu4_state *state)
static MACHINE_RESET( mpu4 )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
ROC10937_reset(0); /* reset display1 */
mpu4_stepper_reset(state);
@@ -636,12 +636,12 @@ static MACHINE_RESET( mpu4 )
/* init rom bank, some games don't set this */
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &rom[0x01000], 0x10000);
memory_set_bank(machine, "bank1",0);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
}
}
@@ -650,14 +650,14 @@ static MACHINE_RESET( mpu4 )
/* 6809 IRQ handler */
static WRITE_LINE_DEVICE_HANDLER( cpu0_irq )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- device_t *pia3 = device->machine->device("pia_ic3");
- device_t *pia4 = device->machine->device("pia_ic4");
- device_t *pia5 = device->machine->device("pia_ic5");
- device_t *pia6 = device->machine->device("pia_ic6");
- device_t *pia7 = device->machine->device("pia_ic7");
- device_t *pia8 = device->machine->device("pia_ic8");
- device_t *ptm2 = device->machine->device("ptm_ic2");
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ device_t *pia3 = device->machine().device("pia_ic3");
+ device_t *pia4 = device->machine().device("pia_ic4");
+ device_t *pia5 = device->machine().device("pia_ic5");
+ device_t *pia6 = device->machine().device("pia_ic6");
+ device_t *pia7 = device->machine().device("pia_ic7");
+ device_t *pia8 = device->machine().device("pia_ic8");
+ device_t *ptm2 = device->machine().device("ptm_ic2");
/* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */
int combined_state = pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3) |
@@ -670,12 +670,12 @@ static WRITE_LINE_DEVICE_HANDLER( cpu0_irq )
if (!drvstate->link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
LOG(("6809 int%d \n", combined_state));
}
else
{
- cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_FIRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
LOG(("6809 fint%d \n", combined_state));
}
}
@@ -683,13 +683,13 @@ static WRITE_LINE_DEVICE_HANDLER( cpu0_irq )
/* Bankswitching */
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1",data & 0x07);
+ memory_set_bank(space->machine(), "bank1",data & 0x07);
}
static READ8_HANDLER( bankswitch_r )
{
- return memory_get_bank(space->machine, "bank1");
+ return memory_get_bank(space->machine(), "bank1");
}
@@ -706,7 +706,7 @@ static WRITE8_DEVICE_HANDLER( ic2_o1_callback )
static WRITE8_DEVICE_HANDLER( ic2_o2_callback )
{
- device_t *pia = device->machine->device("pia_ic3");
+ device_t *pia = device->machine().device("pia_ic3");
pia6821_ca1_w(pia, data); /* copy output value to IC3 ca1 */
/* the output from timer2 is the input clock for timer3 */
/* miscellaneous interrupts generated here */
@@ -738,9 +738,9 @@ static const ptm6840_interface ptm_ic2_intf =
/* IC3, lamp data lines + alpha numeric display */
static WRITE8_DEVICE_HANDLER( pia_ic3_porta_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
int i;
- LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", device->machine->describe_context(),data));
+ LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", device->machine().describe_context(),data));
if(state->ic23_active)
{
@@ -761,9 +761,9 @@ static WRITE8_DEVICE_HANDLER( pia_ic3_porta_w )
static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
int i;
- LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", device->machine->describe_context(),data));
+ LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", device->machine().describe_context(),data));
if(state->ic23_active)
{
@@ -799,8 +799,8 @@ static WRITE8_DEVICE_HANDLER( pia_ic3_portb_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", device->machine().describe_context(),state));
drvstate->alpha_data_line = state;
ROC10937_draw_16seg(0);
@@ -809,7 +809,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic3_ca2_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic3_cb2_w )
{
- LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",device->machine->describe_context(),state));
+ LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",device->machine().describe_context(),state));
if ( state ) ROC10937_reset(0);
ROC10937_draw_16seg(0);
@@ -898,7 +898,7 @@ static void ic24_setup(mpu4_state *state)
static TIMER_CALLBACK( ic24_timeout )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->ic23_active=0;
ic24_output(state, 1);
}
@@ -907,7 +907,7 @@ static TIMER_CALLBACK( ic24_timeout )
/* IC4, 7 seg leds, 50Hz timer reel sensors, current sensors */
static WRITE8_DEVICE_HANDLER( pia_ic4_porta_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if(state->ic23_active)
{
if (((state->lamp_extender == NO_EXTENDER)||(state->lamp_extender == SMALL_CARD)||(state->lamp_extender == LARGE_CARD_C))&& (state->led_extender == NO_EXTENDER))
@@ -923,7 +923,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic4_porta_w )
static WRITE8_DEVICE_HANDLER( pia_ic4_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (state->reel_mux)
{
/* A write here connects one reel (and only one)
@@ -940,7 +940,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic4_portb_w )
static READ8_DEVICE_HANDLER( pia_ic4_portb_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if ( state->serial_data )
{
state->ic4_input_b |= 0x80;
@@ -993,15 +993,15 @@ static READ8_DEVICE_HANDLER( pia_ic4_portb_r )
if ( lamp_undercurrent ) state->ic4_input_b |= 0x01;
#endif
- LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",device->machine->describe_context(),state->ic4_input_b));
+ LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",device->machine().describe_context(),state->ic4_input_b));
return state->ic4_input_b;
}
static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine().describe_context(),state));
drvstate->IC23GB = state;
ic23_update(drvstate);
@@ -1009,8 +1009,8 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic4_ca2_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic4_cb2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", device->machine().describe_context(),state));
drvstate->reel_flag=state;
}
static const pia6821_interface pia_ic4_intf =
@@ -1032,7 +1032,7 @@ static const pia6821_interface pia_ic4_intf =
/* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */
static READ8_DEVICE_HANDLER( pia_ic5_porta_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (state->lamp_extender == LARGE_CARD_A)
{
if (state->lamp_sense && state->ic23_active)
@@ -1055,15 +1055,15 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_r )
state->aux1_input &= ~0x04;
}*/
}
- LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context()));
+ LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
- return input_port_read(device->machine, "AUX1")|state->aux1_input;
+ return input_port_read(device->machine(), "AUX1")|state->aux1_input;
}
static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
- device_t *pia_ic4 = device->machine->device("pia_ic4");
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
+ device_t *pia_ic4 = device->machine().device("pia_ic4");
if (state->hopper == HOPPER_NONDUART_A)
{
//hopper1_drive_sensor(data&0x10);
@@ -1116,7 +1116,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
awp_draw_reel(2);
}
- if (mame_stricmp(device->machine->system().name, "m_gmball") == 0)
+ if (mame_stricmp(device->machine().system().name, "m_gmball") == 0)
{
/* The 'Gamball' device is a unique piece of mechanical equipment, designed to
provide a truly fair hi-lo gamble for an AWP machine. Functionally, it consists of
@@ -1130,7 +1130,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
the physics of a bouncing ball ;)*/
if (data & 0x0f)
{
- switch (device->machine->rand() & 0xf)
+ switch (device->machine().rand() & 0xf)
{
case 0x00:
default:
@@ -1190,7 +1190,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w )
static WRITE8_DEVICE_HANDLER( pia_ic5_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (state->hopper == HOPPER_NONDUART_B)
{
//hopper1_drive_motor(data &0x01)
@@ -1204,8 +1204,8 @@ static WRITE8_DEVICE_HANDLER( pia_ic5_portb_w )
}
static READ8_DEVICE_HANDLER( pia_ic5_portb_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
- device_t *pia_ic5 = device->machine->device("pia_ic5");
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
+ device_t *pia_ic5 = device->machine().device("pia_ic5");
if (state->hopper == HOPPER_NONDUART_B)
{/*
if (hopper1_active)
@@ -1218,19 +1218,19 @@ static READ8_DEVICE_HANDLER( pia_ic5_portb_r )
}*/
}
- LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",device->machine->describe_context()));
- coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) );
- coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) );
- coin_lockout_w(device->machine, 2, (pia6821_get_output_b(pia_ic5) & 0x04) );
- coin_lockout_w(device->machine, 3, (pia6821_get_output_b(pia_ic5) & 0x08) );
- return input_port_read(device->machine, "AUX2") | state->aux2_input;
+ LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",device->machine().describe_context()));
+ coin_lockout_w(device->machine(), 0, (pia6821_get_output_b(pia_ic5) & 0x01) );
+ coin_lockout_w(device->machine(), 1, (pia6821_get_output_b(pia_ic5) & 0x02) );
+ coin_lockout_w(device->machine(), 2, (pia6821_get_output_b(pia_ic5) & 0x04) );
+ coin_lockout_w(device->machine(), 3, (pia6821_get_output_b(pia_ic5) & 0x08) );
+ return input_port_read(device->machine(), "AUX2") | state->aux2_input;
}
static WRITE_LINE_DEVICE_HANDLER( pia_ic5_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",device->machine().describe_context(),state));
drvstate->serial_data = state;
}
@@ -1260,7 +1260,7 @@ BDIR BC1 |
/* PSG function selected */
static void update_ay(device_t *device)
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (!pia6821_get_output_cb2(device))
{
switch (state->ay8913_address)
@@ -1272,14 +1272,14 @@ static void update_ay(device_t *device)
}
case 0x01:
{ /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */
- device_t *pia_ic6 = device->machine->device("pia_ic6");
+ device_t *pia_ic6 = device->machine().device("pia_ic6");
LOG(("AY8913 address = %d \n",pia6821_get_output_a(pia_ic6)&0x0f));
break;
}
case 0x02:
{/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */
- device_t *pia_ic6 = device->machine->device("pia_ic6");
- device_t *ay = device->machine->device("ay8913");
+ device_t *pia_ic6 = device->machine().device("pia_ic6");
+ device_t *ay = device->machine().device("ay8913");
ay8910_data_w(ay, 0, pia6821_get_output_a(pia_ic6));
LOG(("AY Chip Write \n"));
break;
@@ -1287,8 +1287,8 @@ static void update_ay(device_t *device)
case 0x03:
{/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it.
The register will remain selected until another is chosen.*/
- device_t *pia_ic6 = device->machine->device("pia_ic6");
- device_t *ay = device->machine->device("ay8913");
+ device_t *pia_ic6 = device->machine().device("pia_ic6");
+ device_t *ay = device->machine().device("ay8913");
ay8910_address_w(ay, 0, pia6821_get_output_a(pia_ic6));
LOG(("AY Chip Select \n"));
break;
@@ -1328,8 +1328,8 @@ static const pia6821_interface pia_ic5_intf =
/* IC6, Reel A and B and AY registers (MODs below 4 only) */
static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", device->machine->describe_context(),data));
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", device->machine().describe_context(),data));
if (state->reel_mux == SEVEN_REEL)
{
@@ -1359,8 +1359,8 @@ static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w )
static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC6 PIA Write A %2x\n", device->machine->describe_context(),data));
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC6 PIA Write A %2x\n", device->machine().describe_context(),data));
if (state->mod_number <4)
{
state->ay_data = data;
@@ -1371,8 +1371,8 @@ static WRITE8_DEVICE_HANDLER( pia_ic6_porta_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic6_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", device->machine().describe_context(),state));
if (drvstate->mod_number <4)
{
if ( state ) drvstate->ay8913_address |= 0x01;
@@ -1384,8 +1384,8 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic6_ca2_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic6_cb2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", device->machine().describe_context(),state));
if (drvstate->mod_number <4)
{
if ( state ) drvstate->ay8913_address |= 0x02;
@@ -1415,8 +1415,8 @@ static const pia6821_interface pia_ic6_intf =
/* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */
static WRITE8_DEVICE_HANDLER( pia_ic7_porta_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", device->machine->describe_context(),data));
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", device->machine().describe_context(),data));
if (state->reel_mux == SEVEN_REEL)
{
stepper_update(5, data&0x0F);
@@ -1443,7 +1443,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic7_porta_w )
static WRITE8_DEVICE_HANDLER( pia_ic7_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (state->hopper == HOPPER_DUART_A)
{
//duart write data
@@ -1493,8 +1493,8 @@ all eight meters are driven from this port, giving the 8 line driver chip
static WRITE_LINE_DEVICE_HANDLER( pia_ic7_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", device->machine->describe_context(),state));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", device->machine().describe_context(),state));
drvstate->IC23GA = state;
ic24_setup(drvstate);
@@ -1503,7 +1503,7 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic7_ca2_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic7_cb2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->remote_meter = state?0x80:0x00;
}
@@ -1527,22 +1527,22 @@ static const pia6821_interface pia_ic7_intf =
/* IC8, Inputs, TRIACS, alpha clock */
static READ8_DEVICE_HANDLER( pia_ic8_porta_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" };
- device_t *pia_ic5 = device->machine->device("pia_ic5");
+ device_t *pia_ic5 = device->machine().device("pia_ic5");
- LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", device->machine->describe_context()));
+ LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", device->machine().describe_context()));
/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
This is achieved via connecting every input line to an AND gate, thus allowing two strobes
to represent each orange input bank (strobes are active low). */
- pia6821_cb1_w(pia_ic5, (input_port_read(device->machine, "AUX2") & 0x80));
- return input_port_read(device->machine, portnames[state->input_strobe]);
+ pia6821_cb1_w(pia_ic5, (input_port_read(device->machine(), "AUX2") & 0x80));
+ return input_port_read(device->machine(), portnames[state->input_strobe]);
}
static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
if (state->hopper == HOPPER_DUART_B)
{
// duart.drive_sensor(data & 0x04, data & 0x01, 0, 0);
@@ -1552,7 +1552,7 @@ static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w )
// duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02);
}
int i;
- LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", device->machine->describe_context(),data));
+ LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", device->machine().describe_context(),data));
for (i = 0; i < 8; i++)
{
output_set_indexed_value("triac", i, data & (1 << i));
@@ -1561,8 +1561,8 @@ static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", device->machine->describe_context(), state & 0xFF));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", device->machine().describe_context(), state & 0xFF));
drvstate->IC23GC = state;
ic23_update(drvstate);
@@ -1571,8 +1571,8 @@ static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w )
static WRITE_LINE_DEVICE_HANDLER( pia_ic8_cb2_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
- LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", device->machine->describe_context(), state & 0xFF));
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
+ LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", device->machine().describe_context(), state & 0xFF));
if ( !drvstate->alpha_clock && (state) )
{
@@ -1603,17 +1603,17 @@ static const pia6821_interface pia_ic8_intf =
// Sampled sound card, using a PIA and PTM for timing and data handling
static WRITE8_DEVICE_HANDLER( pia_gb_porta_w )
{
- device_t *msm6376 = device->machine->device("msm6376");
- LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine->describe_context(),data));
+ device_t *msm6376 = device->machine().device("msm6376");
+ LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine().describe_context(),data));
okim6376_w(msm6376, 0, data);
}
static WRITE8_DEVICE_HANDLER( pia_gb_portb_w )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
int changed = state->expansion_latch^data;
- LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine->describe_context(),data));
+ LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", device->machine().describe_context(),data));
state->expansion_latch = data;
@@ -1639,8 +1639,8 @@ static WRITE8_DEVICE_HANDLER( pia_gb_portb_w )
}
static READ8_DEVICE_HANDLER( pia_gb_portb_r )
{
- device_t *msm6376 = device->machine->device("msm6376");
- LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",device->machine->describe_context()));
+ device_t *msm6376 = device->machine().device("msm6376");
+ LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",device->machine().describe_context()));
//
// b7, 1 = OKI ready, 0 = OKI busy
// b5, vol clock
@@ -1652,18 +1652,18 @@ static READ8_DEVICE_HANDLER( pia_gb_portb_r )
static WRITE_LINE_DEVICE_HANDLER( pia_gb_ca2_w )
{
- LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", device->machine->describe_context(), state));
+ LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", device->machine().describe_context(), state));
// reset line
}
static WRITE_LINE_DEVICE_HANDLER( pia_gb_cb2_w )
{
- mpu4_state *mstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *mstate = device->machine().driver_data<mpu4_state>();
//Some BWB games use this to drive the bankswitching
if (mstate->bwb_bank)
{
- memory_set_bank(device->machine, "bank1",state);
+ memory_set_bank(device->machine(), "bank1",state);
}
}
@@ -2105,13 +2105,13 @@ static const stepper_interface bwb_opto1_interface =
};
/* Common configurations */
-static void mpu4_config_common(running_machine *machine)
+static void mpu4_config_common(running_machine &machine)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
- state->ic24_timer = machine->scheduler().timer_alloc(FUNC(ic24_timeout));
+ mpu4_state *state = machine.driver_data<mpu4_state>();
+ state->ic24_timer = machine.scheduler().timer_alloc(FUNC(ic24_timeout));
}
-static void mpu4_config_common_reels(running_machine *machine,int reels)
+static void mpu4_config_common_reels(running_machine &machine,int reels)
{
int n;
/* setup n default 96 half step reels, using the standard optic flag */
@@ -2124,7 +2124,7 @@ static void mpu4_config_common_reels(running_machine *machine,int reels)
static MACHINE_START( mpu4mod2 )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
mpu4_config_common(machine);
state->link7a_connected=0;
@@ -2139,7 +2139,7 @@ static MACHINE_START( mpu4mod2 )
static MACHINE_START( mpu4dutch )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
mpu4_config_common(machine);
state->link7a_connected=0;
@@ -2153,7 +2153,7 @@ static MACHINE_START( mpu4dutch )
static MACHINE_START( mpu4mod4 )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
mpu4_config_common(machine);
state->link7a_connected=0;
@@ -2192,7 +2192,7 @@ there are again fixed call values.
static WRITE8_HANDLER( characteriser_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
int x;
int call=data;
LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data));
@@ -2258,7 +2258,7 @@ static WRITE8_HANDLER( characteriser_w )
static READ8_HANDLER( characteriser_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
if (!state->current_chr_table)
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
@@ -2290,7 +2290,7 @@ us) prone to similar weaknesses that allow a per game solution.
static WRITE8_HANDLER( bwb_characteriser_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
int x;
int call=data;
LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(space->cpu),offset,data));
@@ -2335,7 +2335,7 @@ static WRITE8_HANDLER( bwb_characteriser_w )
static READ8_HANDLER( bwb_characteriser_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
if (!state->current_chr_table)
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
@@ -2426,7 +2426,7 @@ static const mpu4_chr_table blsbys_data[72] = {
static DRIVER_INIT (m_oldtmr)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=SIX_REEL_1TO8;
stepper_config(machine, 0, &barcrest_opto1_interface);
@@ -2442,7 +2442,7 @@ static DRIVER_INIT (m_oldtmr)
static DRIVER_INIT (m_ccelbr)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=STANDARD_REEL;
// setup 4 default 96 half step reels ///////////////////////////////////
mpu4_config_common_reels(machine,4);
@@ -2452,7 +2452,7 @@ static DRIVER_INIT (m_ccelbr)
static DRIVER_INIT (m_gmball)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=STANDARD_REEL;
// setup 4 default 96 half step reels ///////////////////////////////////
mpu4_config_common_reels(machine,4);
@@ -2462,7 +2462,7 @@ static DRIVER_INIT (m_gmball)
static DRIVER_INIT (m_grtecp)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=FIVE_REEL_5TO8;
state->lamp_extender=SMALL_CARD;
// setup 5 default 96 half step reels with the mux board
@@ -2472,7 +2472,7 @@ static DRIVER_INIT (m_grtecp)
static DRIVER_INIT (m_blsbys)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->bwb_bank=1;
state->reel_mux=FIVE_REEL_5TO8;
@@ -2486,7 +2486,7 @@ static DRIVER_INIT (m_blsbys)
static DRIVER_INIT (mpu4tst2)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=STANDARD_REEL;
// setup 5 default 96 half step reels with the mux board
mpu4_config_common_reels(machine,4);
@@ -2495,7 +2495,7 @@ static DRIVER_INIT (mpu4tst2)
static DRIVER_INIT (mpu4utst)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux=STANDARD_REEL;
// setup 4 default 96 half step reels ///////////////////////////////////
mpu4_config_common_reels(machine,4);
@@ -2503,19 +2503,19 @@ static DRIVER_INIT (mpu4utst)
static DRIVER_INIT (connect4)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->led_lamp=1;
}
/* generate a 50 Hz signal (based on an RC time) */
static TIMER_DEVICE_CALLBACK( gen_50hz )
{
- mpu4_state *state = timer.machine->driver_data<mpu4_state>();
+ mpu4_state *state = timer.machine().driver_data<mpu4_state>();
/* Although reported as a '50Hz' signal, the fact that both rising and
falling edges of the pulse are used means the timer actually gives a 100Hz
oscillating signal.*/
state->signal_50hz = state->signal_50hz?0:1;
- pia6821_ca1_w(timer.machine->device("pia_ic4"), state->signal_50hz); /* signal is connected to IC4 CA1 */
+ pia6821_ca1_w(timer.machine().device("pia_ic4"), state->signal_50hz); /* signal is connected to IC4 CA1 */
if (state->signal_50hz)
{
diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c
index ea70d25b470..a862b00d02a 100644
--- a/src/mame/drivers/mpu4drvr.c
+++ b/src/mame/drivers/mpu4drvr.c
@@ -225,9 +225,9 @@ static WRITE16_HANDLER( bwb_characteriser16_w );
*/
-static void update_mpu68_interrupts(running_machine *machine)
+static void update_mpu68_interrupts(running_machine &machine)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
cputag_set_input_line(machine, "video", 1, state->m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "video", 2, state->m6850_irq_state ? CLEAR_LINE : ASSERT_LINE);
cputag_set_input_line(machine, "video", 3, state->scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
@@ -237,39 +237,39 @@ static void update_mpu68_interrupts(running_machine *machine)
static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m68k_m6809_line;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m6809_m68k_line = state;
}
static READ_LINE_DEVICE_HANDLER( m6809_acia_cts_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m6809_acia_cts;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_rts_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m6809_acia_rts = state;
}
static READ_LINE_DEVICE_HANDLER( m6809_acia_dcd_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m6809_acia_dcd;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_irq )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m68k_acia_cts = !state;
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
}
static ACIA6850_INTERFACE( m6809_acia_if )
@@ -286,40 +286,40 @@ static ACIA6850_INTERFACE( m6809_acia_if )
static READ_LINE_DEVICE_HANDLER( m68k_acia_rx_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m6809_m68k_line;
}
static WRITE_LINE_DEVICE_HANDLER( m68k_acia_tx_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m68k_m6809_line = state;
}
static READ_LINE_DEVICE_HANDLER( m68k_acia_cts_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m68k_acia_cts;
}
static WRITE_LINE_DEVICE_HANDLER( m68k_acia_rts_w )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m6809_acia_dcd = state;
}
static READ_LINE_DEVICE_HANDLER( m68k_acia_dcd_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
return state->m6809_acia_rts;
}
static WRITE_LINE_DEVICE_HANDLER( m68k_acia_irq )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m6809_acia_cts = !state;
drvstate->m6850_irq_state = state;
- update_mpu68_interrupts(device->machine);
+ update_mpu68_interrupts(device->machine());
}
static ACIA6850_INTERFACE( m68k_acia_if )
@@ -337,9 +337,9 @@ static ACIA6850_INTERFACE( m68k_acia_if )
static WRITE_LINE_DEVICE_HANDLER( cpu1_ptm_irq )
{
- mpu4_state *drvstate = device->machine->driver_data<mpu4_state>();
+ mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
drvstate->m6840_irq_state = state;
- update_mpu68_interrupts(device->machine);
+ update_mpu68_interrupts(device->machine());
}
@@ -349,8 +349,8 @@ static WRITE8_DEVICE_HANDLER( vid_o1_callback )
if (data)
{
- device_t *acia_0 = device->machine->device("acia6850_0");
- device_t *acia_1 = device->machine->device("acia6850_1");
+ device_t *acia_0 = device->machine().device("acia6850_0");
+ device_t *acia_1 = device->machine().device("acia6850_1");
acia6850_tx_clock_in(acia_0);
acia6850_rx_clock_in(acia_0);
acia6850_tx_clock_in(acia_1);
@@ -446,7 +446,7 @@ static const gfx_layout mpu4_vid_char_16x16_layout =
static SCREEN_UPDATE( mpu4_vid )
{
- mpu4_state *state = screen->machine->driver_data<mpu4_state>();
+ mpu4_state *state = screen->machine().driver_data<mpu4_state>();
int x, y/*, count = 0*/;
bitmap_fill(bitmap,cliprect,0);
@@ -476,7 +476,7 @@ static SCREEN_UPDATE( mpu4_vid )
attr = tiledat >>12;
if (attr)
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfxregion],tiledat,0,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[gfxregion],tiledat,0,0,0,x*8,y*8);
//count++;
}
@@ -491,20 +491,20 @@ static SCREEN_UPDATE( mpu4_vid )
static READ16_HANDLER( mpu4_vid_vidram_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
return state->vid_vidram[offset];
}
static WRITE16_HANDLER( mpu4_vid_vidram_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
COMBINE_DATA(&state->vid_vidram[offset]);
offset <<= 1;
- gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+0], offset/0x20);
- gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+1], offset/0x20);
- gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+2], offset/0x20);
- gfx_element_mark_dirty(space->machine->gfx[state->gfx_index+3], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[state->gfx_index+0], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[state->gfx_index+1], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[state->gfx_index+2], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[state->gfx_index+3], offset/0x20);
}
@@ -650,9 +650,9 @@ static void scn2674_write_init_regs(mpu4_state *state, UINT8 data)
if (state->scn2675_IR_pointer>14)state->scn2675_IR_pointer=14;
}
-static void scn2674_write_command(running_machine *machine, UINT8 data)
+static void scn2674_write_command(running_machine &machine, UINT8 data)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
UINT8 oprand;
int i;
@@ -874,7 +874,7 @@ static void scn2674_write_command(running_machine *machine, UINT8 data)
static READ16_HANDLER( mpu4_vid_scn2674_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
/*
Offset: Purpose
0 Interrupt Register
@@ -925,7 +925,7 @@ static READ16_HANDLER( mpu4_vid_scn2674_r )
static WRITE16_HANDLER( mpu4_vid_scn2674_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
/*
Offset: Purpose
0 Initialization Registers
@@ -947,7 +947,7 @@ static WRITE16_HANDLER( mpu4_vid_scn2674_w )
break;
case 1:
- scn2674_write_command(space->machine, data);
+ scn2674_write_command(space->machine(), data);
break;
case 2: state->scn2674_screen1_l = data; break;
@@ -962,7 +962,7 @@ static WRITE16_HANDLER( mpu4_vid_scn2674_w )
static VIDEO_START( mpu4_vid )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
/* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand.
maybe we will anyway, but for now we don't need to */
@@ -972,16 +972,16 @@ static VIDEO_START( mpu4_vid )
/* find first empty slot to decode gfx */
for (state->gfx_index = 0; state->gfx_index < MAX_GFX_ELEMENTS; state->gfx_index++)
- if (machine->gfx[state->gfx_index] == 0)
+ if (machine.gfx[state->gfx_index] == 0)
break;
assert(state->gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[state->gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0);
- machine->gfx[state->gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0);
- machine->gfx[state->gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0);
- machine->gfx[state->gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)state->vid_vidram, machine->total_colors() / 16, 0);
+ machine.gfx[state->gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)state->vid_vidram, machine.total_colors() / 16, 0);
+ machine.gfx[state->gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)state->vid_vidram, machine.total_colors() / 16, 0);
+ machine.gfx[state->gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)state->vid_vidram, machine.total_colors() / 16, 0);
+ machine.gfx[state->gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)state->vid_vidram, machine.total_colors() / 16, 0);
state->scn2675_IR_pointer = 0;
}
@@ -998,7 +998,7 @@ static VIDEO_START( mpu4_vid )
static WRITE16_HANDLER( ef9369_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
struct ef9369_t &pal = state->pal;
data &= 0x00ff;
@@ -1028,7 +1028,7 @@ static WRITE16_HANDLER( ef9369_w )
col = pal.clut[entry] & 0xfff;
/* Update the MAME palette */
- palette_set_color_rgb(space->machine, entry, pal4bit(col >> 8), pal4bit(col >> 4), pal4bit(col >> 0));
+ palette_set_color_rgb(space->machine(), entry, pal4bit(col >> 8), pal4bit(col >> 4), pal4bit(col >> 0));
}
/* Address register auto-increment */
@@ -1040,7 +1040,7 @@ static WRITE16_HANDLER( ef9369_w )
static READ16_HANDLER( ef9369_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
struct ef9369_t &pal = state->pal;
if ((offset & 1) == 0)
{
@@ -1077,7 +1077,7 @@ static READ16_HANDLER( ef9369_r )
WRITE16_HANDLER( bt471_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
struct bt471_t &bt471 = state->bt471;
UINT8 val = data & 0xff;
{
@@ -1101,7 +1101,7 @@ WRITE16_HANDLER( bt471_w )
if (++*addr_cnt == 3)
{
- palette_set_color(space->machine, bt471.address, MAKE_RGB(color[0], color[1], color[2]));
+ palette_set_color(space->machine(), bt471.address, MAKE_RGB(color[0], color[1], color[2]));
*addr_cnt = 0;
/* Address register increments */
@@ -1137,7 +1137,7 @@ READ16_HANDLER( bt471_r )
static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
{
- mpu4_state *state = device->machine->driver_data<mpu4_state>();
+ mpu4_state *state = device->machine().driver_data<mpu4_state>();
/* The SWP trackball interface connects a standard trackball to the AUX1 port on the MPU4
mainboard. As per usual, they've taken the cheap route here, reading and processing the
raw quadrature signal from the encoder wheels for a 4 bit interface, rather than use any
@@ -1147,13 +1147,13 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
We invert the X and Y data at source due to the use of Schmitt triggers in the interface, which
clean up the pulses and flip the active phase.*/
- LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine->describe_context()));
+ LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
- UINT8 data = input_port_read(device->machine, "AUX1");
+ UINT8 data = input_port_read(device->machine(), "AUX1");
- INT8 dx = input_port_read(device->machine, "TRACKX");
- INT8 dy = input_port_read(device->machine, "TRACKY");
+ INT8 dx = input_port_read(device->machine(), "TRACKX");
+ INT8 dy = input_port_read(device->machine(), "TRACKY");
state->cur[0] = dy + dx;
state->cur[1] = dy - dx;
@@ -1902,7 +1902,7 @@ INPUT_PORTS_END
/* OKI M6376 (for Mating Game) FIXME */
static READ16_DEVICE_HANDLER( oki_r )
{
- return device->machine->rand();
+ return device->machine().rand();
}
static WRITE16_DEVICE_HANDLER( oki_w )
@@ -1913,14 +1913,14 @@ static WRITE16_DEVICE_HANDLER( oki_w )
static void video_reset(device_t *device)
{
- device->machine->device("6840ptm_68k")->reset();
- device->machine->device("acia6850_1")->reset();
+ device->machine().device("6840ptm_68k")->reset();
+ device->machine().device("acia6850_1")->reset();
}
/* machine start (called only once) */
static MACHINE_START( mpu4_vid )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
mpu4_config_common(machine);
state->mod_number=4; //No AY chip
@@ -1934,12 +1934,12 @@ static MACHINE_START( mpu4_vid )
ROC10937_init(0, MSC1937, 0);
/* Hook the reset line */
- m68k_set_reset_callback(machine->device("video"), video_reset);
+ m68k_set_reset_callback(machine.device("video"), video_reset);
}
static MACHINE_RESET( mpu4_vid )
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
ROC10937_reset(0);
mpu4_stepper_reset(state);
@@ -2119,7 +2119,7 @@ static PALETTE_INIT( dealem )
3, resistances_rg, weights_g, 1000, 0,
2, resistances_b, weights_b, 1000, 0);
- len = machine->region("proms")->bytes();
+ len = machine.region("proms")->bytes();
for (i = 0; i < len; i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -2147,7 +2147,7 @@ static PALETTE_INIT( dealem )
static SCREEN_UPDATE(dealem)
{
- mpu4_state *state = screen->machine->driver_data<mpu4_state>();
+ mpu4_state *state = screen->machine().driver_data<mpu4_state>();
int x,y;
int count = 0;
@@ -2157,7 +2157,7 @@ static SCREEN_UPDATE(dealem)
{
int tile = state->dealem_videoram[count + 0x1000] | (state->dealem_videoram[count] << 8);
count++;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x * 8,y * 8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x * 8,y * 8);
}
}
@@ -2167,7 +2167,7 @@ static SCREEN_UPDATE(dealem)
static WRITE_LINE_DEVICE_HANDLER( dealem_vsync_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, state);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, state);
}
@@ -2217,9 +2217,9 @@ ADDRESS_MAP_END
static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
{
- mpu4_state *state = timer.machine->driver_data<mpu4_state>();
+ mpu4_state *state = timer.machine().driver_data<mpu4_state>();
int current_scanline=param;
- timer.machine->scheduler().synchronize();
+ timer.machine().scheduler().synchronize();
if (current_scanline==0)
@@ -2237,7 +2237,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
LOGSTUFF(("SCN2674 Ready\n"));
state->scn2674_irq_state = 1;
state->scn2674_irq_register |= 0x02;
- update_mpu68_interrupts(timer.machine);
+ update_mpu68_interrupts(timer.machine());
}
}
@@ -2250,7 +2250,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
LOGSTUFF(("SCN2674 Line Zero\n"));
state->scn2674_irq_state = 1;
state->scn2674_irq_register |= 0x08;
- update_mpu68_interrupts(timer.machine);
+ update_mpu68_interrupts(timer.machine());
}
}
@@ -2267,8 +2267,8 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
{
LOGSTUFF(("SCN2674 Split Screen 1\n"));
state->scn2674_irq_state = 1;
- update_mpu68_interrupts(timer.machine);
- timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos());
+ update_mpu68_interrupts(timer.machine());
+ timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
state->scn2674_irq_register |= 0x04;
}
@@ -2288,8 +2288,8 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
LOGSTUFF(("SCN2674 Split Screen 2 irq\n"));
state->scn2674_irq_state = 1;
state->scn2674_irq_register |= 0x01;
- update_mpu68_interrupts(timer.machine);
- timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos());
+ update_mpu68_interrupts(timer.machine());
+ timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
}
}
@@ -2305,7 +2305,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
LOGSTUFF(("vblank irq\n"));
state->scn2674_irq_state = 1;
state->scn2674_irq_register |= 0x10;
- update_mpu68_interrupts(timer.machine);
+ update_mpu68_interrupts(timer.machine());
}
}
}
@@ -2504,7 +2504,7 @@ Characteriser (CHR)
static WRITE16_HANDLER( characteriser16_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
int x;
int call=data;
LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data));
@@ -2533,7 +2533,7 @@ static WRITE16_HANDLER( characteriser16_w )
static READ16_HANDLER( characteriser16_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,state->current_chr_table[state->prot_col].response));
LOG_CHR(("Characteriser read offset %02X \n",offset));
LOG_CHR(("Characteriser read data %02X \n",state->current_chr_table[state->prot_col].response));
@@ -2566,7 +2566,7 @@ us) prone to similar weaknesses that allow a per game solution.
static WRITE16_HANDLER( bwb_characteriser16_w )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
int x;
int call=data &0xff;
LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(space->cpu),offset,data));
@@ -2611,7 +2611,7 @@ static WRITE16_HANDLER( bwb_characteriser16_w )
static READ16_HANDLER( bwb_characteriser16_r )
{
- mpu4_state *state = space->machine->driver_data<mpu4_state>();
+ mpu4_state *state = space->machine().driver_data<mpu4_state>();
if (!state->current_chr_table)
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
@@ -2789,47 +2789,47 @@ static const mpu4_chr_table prizeinv_data[72] = {
static DRIVER_INIT (adders)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = adders_data;
}
static DRIVER_INIT (crmaze)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = crmaze_data;
}
static DRIVER_INIT (crmazea)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = crmazea_data;
}
static DRIVER_INIT (crmaze2)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = crmaze2_data;
}
static DRIVER_INIT (crmaze3)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux = FLUTTERBOX;
state->current_chr_table = crmaze3_data;
}
static DRIVER_INIT (crmaze3a)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->reel_mux = FLUTTERBOX;
state->current_chr_table = crmaze3a_data;
}
static DRIVER_INIT (mating)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
- address_space *space = machine->device("video")->memory().space(AS_PROGRAM);
- device_t *device = machine->device("oki");
+ mpu4_state *state = machine.driver_data<mpu4_state>();
+ address_space *space = machine.device("video")->memory().space(AS_PROGRAM);
+ device_t *device = machine.device("oki");
/* The Mating Game has an extra 256kB RAM on the program card */
space->install_ram(0x600000, 0x63ffff);
@@ -2842,43 +2842,43 @@ static DRIVER_INIT (mating)
static DRIVER_INIT (skiltrek)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = skiltrek_data;
}
static DRIVER_INIT (timemchn)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = timemchn_data;
}
static DRIVER_INIT (strikeit)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = strikeit_data;
}
static DRIVER_INIT (turnover)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = turnover_data;
}
static DRIVER_INIT (eyesdown)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = eyesdown_data;
}
static DRIVER_INIT (quidgrid)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = quidgrid_data;
}
static DRIVER_INIT (prizeinv)
{
- mpu4_state *state = machine->driver_data<mpu4_state>();
+ mpu4_state *state = machine.driver_data<mpu4_state>();
state->current_chr_table = prizeinv_data;
}
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index c6553fa71d3..8c560192108 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -34,16 +34,16 @@
static WRITE8_DEVICE_HANDLER( mquake_cia_0_porta_w )
{
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
}
@@ -66,14 +66,14 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_porta_w )
static READ8_DEVICE_HANDLER( mquake_cia_0_portb_r )
{
/* parallel port */
- logerror("%s:CIA0_portb_r\n", device->machine->describe_context());
+ logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
@@ -95,7 +95,7 @@ static WRITE8_DEVICE_HANDLER( mquake_es5503_w )
// if not writing a "halt", set the bank
if (!(data & 1))
{
- es5503_set_base(device, device->machine->region("ensoniq")->base() + ((data>>4)*0x10000));
+ es5503_set_base(device, device->machine().region("ensoniq")->base() + ((data>>4)*0x10000));
}
}
}
@@ -114,7 +114,7 @@ static WRITE16_HANDLER( output_w )
static READ16_HANDLER( coin_chip_r )
{
if (offset == 1)
- return input_port_read(space->machine, "COINCHIP");
+ return input_port_read(space->machine(), "COINCHIP");
logerror("%06x:coin_chip_r(%02x) & %04x\n", cpu_get_pc(space->cpu), offset, mem_mask);
return 0xffff;
}
@@ -320,7 +320,7 @@ static const es5503_interface es5503_intf =
static MACHINE_RESET(mquake)
{
/* set ES5503 wave memory (this is banked in 64k increments) */
- es5503_set_base(machine->device("ensoniq"), machine->region("ensoniq")->base());
+ es5503_set_base(machine.device("ensoniq"), machine.region("ensoniq")->base());
MACHINE_RESET_CALL(amiga);
}
@@ -447,7 +447,7 @@ ROM_END
static DRIVER_INIT(mquake)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
static const amiga_machine_interface mquake_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -461,7 +461,7 @@ static DRIVER_INIT(mquake)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
}
diff --git a/src/mame/drivers/mrdo.c b/src/mame/drivers/mrdo.c
index 719b46a4fbc..aa21f68cb62 100644
--- a/src/mame/drivers/mrdo.c
+++ b/src/mame/drivers/mrdo.c
@@ -34,7 +34,7 @@ There's a chance that certain bootlegs might have the different 8/20 MHz XTALS.
/* if a read from this address doesn't return the value it expects. */
static READ8_HANDLER( mrdo_SECRE_r )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
return RAM[cpu_get_reg(space->cpu, Z80_HL)];
}
diff --git a/src/mame/drivers/mrflea.c b/src/mame/drivers/mrflea.c
index 5e90fe8a77a..dc2d4d79d5c 100644
--- a/src/mame/drivers/mrflea.c
+++ b/src/mame/drivers/mrflea.c
@@ -75,14 +75,14 @@ Stephh's notes (based on the games Z80 code and some tests) :
static WRITE8_HANDLER( mrflea_main_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->status |= 0x01; // pending command to main CPU
state->main = data;
}
static WRITE8_HANDLER( mrflea_io_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->status |= 0x08; // pending command to IO CPU
state->io = data;
device_set_input_line(state->subcpu, 0, HOLD_LINE );
@@ -90,21 +90,21 @@ static WRITE8_HANDLER( mrflea_io_w )
static READ8_HANDLER( mrflea_main_r )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->status &= ~0x01; // main CPU command read
return state->main;
}
static READ8_HANDLER( mrflea_io_r )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->status &= ~0x08; // IO CPU command read
return state->io;
}
static READ8_HANDLER( mrflea_main_status_r )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
/* 0x01: main CPU command pending
0x08: io cpu ready */
@@ -113,7 +113,7 @@ static READ8_HANDLER( mrflea_main_status_r )
static READ8_HANDLER( mrflea_io_status_r )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
/* 0x08: IO CPU command pending
0x01: main cpu ready */
@@ -122,7 +122,7 @@ static READ8_HANDLER( mrflea_io_status_r )
static INTERRUPT_GEN( mrflea_slave_interrupt )
{
- mrflea_state *state = device->machine->driver_data<mrflea_state>();
+ mrflea_state *state = device->machine().driver_data<mrflea_state>();
if (cpu_getiloops(device) == 0 || (state->status & 0x08))
device_set_input_line(device, 0, HOLD_LINE);
}
@@ -133,7 +133,7 @@ static READ8_HANDLER( mrflea_interrupt_type_r )
1. triggered (in response to sound command)
2. heartbeat (for music timing)
*/
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
if (state->status & 0x08 )
return 0x00; /* process command */
@@ -143,7 +143,7 @@ static READ8_HANDLER( mrflea_interrupt_type_r )
static WRITE8_HANDLER( mrflea_select1_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->select1 = data;
}
@@ -334,10 +334,10 @@ static const ay8910_interface mrflea_ay8910_interface_1 =
static MACHINE_START( mrflea )
{
- mrflea_state *state = machine->driver_data<mrflea_state>();
+ mrflea_state *state = machine.driver_data<mrflea_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->gfx_bank));
state->save_item(NAME(state->io));
@@ -348,7 +348,7 @@ static MACHINE_START( mrflea )
static MACHINE_RESET( mrflea )
{
- mrflea_state *state = machine->driver_data<mrflea_state>();
+ mrflea_state *state = machine.driver_data<mrflea_state>();
state->gfx_bank = 0;
state->io = 0;
diff --git a/src/mame/drivers/ms32.c b/src/mame/drivers/ms32.c
index ed5bf59dff2..61a7c26366e 100644
--- a/src/mame/drivers/ms32.c
+++ b/src/mame/drivers/ms32.c
@@ -176,25 +176,25 @@ Super Strong Warriors
static CUSTOM_INPUT( mahjong_ctrl_r )
{
- ms32_state *state = field->port->machine->driver_data<ms32_state>();
+ ms32_state *state = field->port->machine().driver_data<ms32_state>();
UINT32 mj_input;
switch (state->mahjong_input_select[0])
{
case 0x01:
- mj_input = input_port_read(field->port->machine, "MJ0");
+ mj_input = input_port_read(field->port->machine(), "MJ0");
break;
case 0x02:
- mj_input = input_port_read(field->port->machine, "MJ1");
+ mj_input = input_port_read(field->port->machine(), "MJ1");
break;
case 0x04:
- mj_input = input_port_read(field->port->machine, "MJ2");
+ mj_input = input_port_read(field->port->machine(), "MJ2");
break;
case 0x08:
- mj_input = input_port_read(field->port->machine, "MJ3");
+ mj_input = input_port_read(field->port->machine(), "MJ3");
break;
case 0x10:
- mj_input = input_port_read(field->port->machine, "MJ4");
+ mj_input = input_port_read(field->port->machine(), "MJ4");
break;
default:
mj_input = 0;
@@ -208,10 +208,10 @@ static CUSTOM_INPUT( mahjong_ctrl_r )
static READ32_HANDLER( ms32_read_inputs3 )
{
int a,b,c,d;
- a = input_port_read(space->machine, "AN2?"); // unused?
- b = input_port_read(space->machine, "AN2?"); // unused?
- c = input_port_read(space->machine, "AN1");
- d = (input_port_read(space->machine, "AN0") - 0xb0) & 0xff;
+ a = input_port_read(space->machine(), "AN2?"); // unused?
+ b = input_port_read(space->machine(), "AN2?"); // unused?
+ c = input_port_read(space->machine(), "AN1");
+ d = (input_port_read(space->machine(), "AN0") - 0xb0) & 0xff;
return a << 24 | b << 16 | c << 8 | d << 0;
}
@@ -219,7 +219,7 @@ static READ32_HANDLER( ms32_read_inputs3 )
static WRITE32_HANDLER( ms32_sound_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
// give the Z80 time to respond
device_spin_until_time(space->cpu, attotime::from_usec(40));
@@ -227,13 +227,13 @@ static WRITE32_HANDLER( ms32_sound_w )
static READ32_HANDLER( ms32_sound_r )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->to_main^0xff;
}
static WRITE32_HANDLER( reset_sub_w )
{
- if(data) cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE); // 0 too ?
+ if(data) cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE); // 0 too ?
}
@@ -244,99 +244,99 @@ static WRITE32_HANDLER( reset_sub_w )
static READ8_HANDLER( ms32_nvram_r8 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->nvram_8[offset];
}
static WRITE8_HANDLER( ms32_nvram_w8 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
state->nvram_8[offset] = data;
}
static READ8_HANDLER( ms32_priram_r8 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->priram_8[offset];
}
static WRITE8_HANDLER( ms32_priram_w8 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
state->priram_8[offset] = data;
}
static READ16_HANDLER( ms32_palram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->palram_16[offset];
}
static WRITE16_HANDLER( ms32_palram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->palram_16[offset]);
}
static READ16_HANDLER( ms32_rozram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->rozram_16[offset];
}
static WRITE16_HANDLER( ms32_rozram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->rozram_16[offset]);
tilemap_mark_tile_dirty(state->roz_tilemap,offset/2);
}
static READ16_HANDLER( ms32_lineram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->lineram_16[offset];
}
static WRITE16_HANDLER( ms32_lineram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->lineram_16[offset]);
}
static READ16_HANDLER( ms32_sprram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->sprram_16[offset];
}
static WRITE16_HANDLER( ms32_sprram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->sprram_16[offset]);
}
static READ16_HANDLER( ms32_txram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->txram_16[offset];
}
static WRITE16_HANDLER( ms32_txram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->txram_16[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset/2);
}
static READ16_HANDLER( ms32_bgram_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->bgram_16[offset];
}
static WRITE16_HANDLER( ms32_bgram_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->bgram_16[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
tilemap_mark_tile_dirty(state->bg_tilemap_alt,offset/2);
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( ms32_bgram_w16 )
static WRITE32_HANDLER( pip_w )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
state->tilemaplayoutcontrol = data;
if ((data) && (data != 1))
@@ -398,26 +398,26 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( ms32_extra_w16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
COMBINE_DATA(&state->f1superb_extraram_16[offset]);
tilemap_mark_tile_dirty(state->extra_tilemap,offset/2);
}
static READ16_HANDLER( ms32_extra_r16 )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
return state->f1superb_extraram_16[offset];
}
-static void irq_raise(running_machine *machine, int level);
+static void irq_raise(running_machine &machine, int level);
static WRITE32_HANDLER( ms32_irq2_guess_w )
{
- irq_raise(space->machine, 2);
+ irq_raise(space->machine(), 2);
}
static WRITE32_HANDLER( ms32_irq5_guess_w )
{
- irq_raise(space->machine, 5);
+ irq_raise(space->machine(), 5);
}
static ADDRESS_MAP_START( f1superb_map, AS_PROGRAM, 32 )
@@ -1298,7 +1298,7 @@ GFXDECODE_END
static IRQ_CALLBACK(irq_callback)
{
- ms32_state *state = device->machine->driver_data<ms32_state>();
+ ms32_state *state = device->machine().driver_data<ms32_state>();
int i;
for(i=15; i>=0 && !(state->irqreq & (1<<i)); i--);
state->irqreq &= ~(1<<i);
@@ -1307,25 +1307,25 @@ static IRQ_CALLBACK(irq_callback)
return i;
}
-static void irq_init(running_machine *machine)
+static void irq_init(running_machine &machine)
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
state->irqreq = 0;
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
-static void irq_raise(running_machine *machine, int level)
+static void irq_raise(running_machine &machine, int level)
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
state->irqreq |= (1<<level);
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
static INTERRUPT_GEN(ms32_interrupt)
{
- if( cpu_getiloops(device) == 0 ) irq_raise(device->machine, 10);
- if( cpu_getiloops(device) == 1 ) irq_raise(device->machine, 9);
+ if( cpu_getiloops(device) == 0 ) irq_raise(device->machine(), 10);
+ if( cpu_getiloops(device) == 1 ) irq_raise(device->machine(), 9);
/* hayaosi2 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose)
@@ -1334,7 +1334,7 @@ static INTERRUPT_GEN(ms32_interrupt)
desertwr
p47aces
*/
- if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine, 0);
+ if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine(), 0);
}
/********** SOUND **********/
@@ -1362,21 +1362,21 @@ static INTERRUPT_GEN(ms32_interrupt)
static READ8_HANDLER( latch_r )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space,0)^0xff;
}
static WRITE8_HANDLER( ms32_snd_bank_w )
{
- memory_set_bank(space->machine, "bank4", (data >> 0) & 0x0F);
- memory_set_bank(space->machine, "bank5", (data >> 4) & 0x0F);
+ memory_set_bank(space->machine(), "bank4", (data >> 0) & 0x0F);
+ memory_set_bank(space->machine(), "bank5", (data >> 4) & 0x0F);
}
static WRITE8_HANDLER( to_main_w )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
state->to_main=data;
- irq_raise(space->machine, 1);
+ irq_raise(space->machine(), 1);
}
static ADDRESS_MAP_START( ms32_sound_map, AS_PROGRAM, 8 )
@@ -1398,7 +1398,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ms32 )
{
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
memory_set_bank(machine, "bank4", 0);
memory_set_bank(machine, "bank5", 1);
irq_init(machine);
@@ -2216,17 +2216,17 @@ ROM_START( wpksocv2 )
ROM_END
-static void configure_banks(running_machine *machine)
+static void configure_banks(running_machine &machine)
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
state_save_register_global(machine, state->to_main);
- memory_configure_bank(machine, "bank4", 0, 16, machine->region("audiocpu")->base() + 0x14000, 0x4000);
- memory_configure_bank(machine, "bank5", 0, 16, machine->region("audiocpu")->base() + 0x14000, 0x4000);
+ memory_configure_bank(machine, "bank4", 0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
+ memory_configure_bank(machine, "bank5", 0, 16, machine.region("audiocpu")->base() + 0x14000, 0x4000);
}
static DRIVER_INIT( ms32_common )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
state->nvram_8 = auto_alloc_array(machine, UINT8, 0x2000);
configure_banks(machine);
}
@@ -2280,7 +2280,7 @@ static DRIVER_INIT (47pie2)
static DRIVER_INIT (f1superb)
{
#if 0 // we shouldn't need this hack, something else is wrong, and the x offsets are never copied either, v70 problems??
- UINT32 *pROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
pROM[0x19d04/4]=0x167a021a; // bne->br : sprite Y offset table is always copied to RAM
#endif
DRIVER_INIT_CALL(ss92046_01);
diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c
index 52327fec552..604baf91543 100644
--- a/src/mame/drivers/msisaac.c
+++ b/src/mame/drivers/msisaac.c
@@ -24,7 +24,7 @@ TO DO:
static TIMER_CALLBACK( nmi_callback )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -34,18 +34,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -57,12 +57,12 @@ static WRITE8_HANDLER( nmi_enable_w )
#if 0
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static WRITE8_HANDLER( msisaac_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
#endif
@@ -92,7 +92,7 @@ MCU simulation TODO:
\-Fix some graphics imperfections(*not* confirmed if they are caused by unhandled
commands or imperfect video emulation).
*/
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
switch (state->mcu_val)
{
@@ -119,7 +119,7 @@ MCU simulation TODO:
//6-down
//7-leftdwn
- UINT8 val= (input_port_read(space->machine, "IN1") >> 2) & 0x0f;
+ UINT8 val= (input_port_read(space->machine(), "IN1") >> 2) & 0x0f;
/* bit0 = left
bit1 = right
bit2 = down
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( msisaac_mcu_w )
#ifdef USE_MCU
buggychl_mcu_w(offset,data);
#else
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
//if(data != 0x0a && data != 0x42 && data != 0x02)
// popmessage("PC = %04x %02x", cpu_get_pc(space->cpu), data);
state->mcu_val = data;
@@ -216,7 +216,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
int i;
double db = 0.0;
@@ -242,7 +242,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
- msisaac_state *state = device->machine->driver_data<msisaac_state>();
+ msisaac_state *state = device->machine().driver_data<msisaac_state>();
state->snd_ctrl0 = data & 0xff;
//popmessage("SND0 0=%2x 1=%2x", state->snd_ctrl0, state->snd_ctrl1);
@@ -259,7 +259,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_HANDLER( sound_control_1_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->snd_ctrl1 = data & 0xff;
//popmessage("SND1 0=%2x 1=%2x", state->snd_ctrl0, state->snd_ctrl1);
}
@@ -438,9 +438,9 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( msisaac )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
/* video */
state->save_item(NAME(state->bg2_textbank));
@@ -460,7 +460,7 @@ static MACHINE_START( msisaac )
static MACHINE_RESET( msisaac )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
MACHINE_RESET_CALL(ta7630);
diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c
index 6f648e19e76..69b159d614e 100644
--- a/src/mame/drivers/mugsmash.c
+++ b/src/mame/drivers/mugsmash.c
@@ -48,7 +48,7 @@ behavior we use .
static WRITE16_HANDLER( mugsmash_reg2_w )
{
- mugsmash_state *state = space->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = space->machine().driver_data<mugsmash_state>();
state->regs2[offset] = data;
//popmessage ("Regs2 %04x, %04x, %04x, %04x", state->regs2[0], state->regs2[1], state->regs2[2], state->regs2[3]);
@@ -155,16 +155,16 @@ static READ16_HANDLER ( mugsmash_input_ports_r )
switch (offset)
{
case 0 :
- data = (input_port_read(space->machine, "P1") & 0xff) | ((input_port_read(space->machine, "DSW1") & 0xc0) << 6) | ((input_port_read(space->machine, "IN0") & 0x03) << 8);
+ data = (input_port_read(space->machine(), "P1") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0xc0) << 6) | ((input_port_read(space->machine(), "IN0") & 0x03) << 8);
break;
case 1 :
- data = (input_port_read(space->machine, "P2") & 0xff) | ((input_port_read(space->machine, "DSW1") & 0x3f) << 8);
+ data = (input_port_read(space->machine(), "P2") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0x3f) << 8);
break;
case 2 :
- data = ((input_port_read(space->machine, "DSW2") & 0x3f) << 8);
+ data = ((input_port_read(space->machine(), "DSW2") & 0x3f) << 8);
break;
case 3 :
- data = ((input_port_read(space->machine, "DSW2") & 0xc0) << 2);
+ data = ((input_port_read(space->machine(), "DSW2") & 0xc0) << 2);
break;
}
@@ -391,7 +391,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- mugsmash_state *state = device->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = device->machine().driver_data<mugsmash_state>();
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -402,10 +402,10 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( mugsmash )
{
- mugsmash_state *state = machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = machine.driver_data<mugsmash_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( mugsmash, mugsmash_state )
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index 38fe883a25e..2e59029684d 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -201,7 +201,7 @@ public:
static TILE_GET_INFO( get_multfish_tile_info )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
int code = state->vid[tile_index*2+0x0000] | (state->vid[tile_index*2+0x0001] << 8);
int attr = state->vid[tile_index*2+0x1000] | (state->vid[tile_index*2+0x1001] << 8);
@@ -216,7 +216,7 @@ static TILE_GET_INFO( get_multfish_tile_info )
static TILE_GET_INFO( get_multfish_reel_tile_info )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
int code = state->vid[tile_index*2+0x2000] | (state->vid[tile_index*2+0x2001] << 8);
SET_TILE_INFO(
@@ -228,7 +228,7 @@ static TILE_GET_INFO( get_multfish_reel_tile_info )
static VIDEO_START(multfish)
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
memset(state->vid,0x00,sizeof(state->vid));
state->save_item(NAME(state->vid));
@@ -243,10 +243,10 @@ static VIDEO_START(multfish)
static SCREEN_UPDATE(multfish)
{
- multfish_state *state = screen->machine->driver_data<multfish_state>();
+ multfish_state *state = screen->machine().driver_data<multfish_state>();
int i;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (!state->disp_enable) return 0;
@@ -269,7 +269,7 @@ static SCREEN_UPDATE(multfish)
static WRITE8_HANDLER( multfish_vid_w )
{
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
state->vid[offset]=data;
@@ -309,7 +309,7 @@ static WRITE8_HANDLER( multfish_vid_w )
b = ( (coldat &0x00e0)>> (5));
b|= ( (coldat &0xe000)>> (8+5-3));
- palette_set_color_rgb(space->machine, (offset-0x4000)/2, r<<3, g<<3, b<<2);
+ palette_set_color_rgb(space->machine(), (offset-0x4000)/2, r<<3, g<<3, b<<2);
}
else
{
@@ -319,7 +319,7 @@ static WRITE8_HANDLER( multfish_vid_w )
static WRITE8_HANDLER( multfish_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static READ8_DEVICE_HANDLER( multfish_timekeeper_r )
@@ -334,11 +334,11 @@ static WRITE8_DEVICE_HANDLER( multfish_timekeeper_w )
static READ8_HANDLER( bankedram_r )
{
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
if ((state->rambk & 0x80) == 0x00)
{
- return timekeeper_r(space->machine->device("m48t35"), offset + 0x2000*(state->rambk & 0x03));
+ return timekeeper_r(space->machine().device("m48t35"), offset + 0x2000*(state->rambk & 0x03));
}
else
{
@@ -349,11 +349,11 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
if ((state->rambk & 0x80) == 0x00)
{
- timekeeper_w(space->machine->device("m48t35"), offset + 0x2000*(state->rambk & 0x03), data);
+ timekeeper_w(space->machine().device("m48t35"), offset + 0x2000*(state->rambk & 0x03), data);
}
else
{
@@ -363,7 +363,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( multfish_rambank_w )
{
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
state->rambk = data;
}
@@ -373,12 +373,12 @@ static READ8_HANDLER( ray_r )
{
// the games read the raster beam position as part of the hardware checks..
// with a 6mhz clock and 640x480 resolution this seems to give the right results.
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
static CUSTOM_INPUT( multfish_hopper_r )
{
- multfish_state *state = field->port->machine->driver_data<multfish_state>();
+ multfish_state *state = field->port->machine().driver_data<multfish_state>();
if ( state->hopper_motor != 0 )
{
@@ -400,17 +400,17 @@ static WRITE8_HANDLER( multfish_hopper_w )
---- -X-- Bill Acceptor Lock 24B
---X ---- Hopper Motor 33B
*/
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
state->hopper_motor = data & 0x10;
- coin_lockout_w(space->machine, 0, data & 0x01);
- coin_lockout_w(space->machine, 1, data & 0x01);
- coin_lockout_w(space->machine, 2, data & 0x01);
- coin_lockout_w(space->machine, 3, data & 0x01);
- coin_lockout_w(space->machine, 4, data & 0x04);
- coin_lockout_w(space->machine, 5, data & 0x04);
- coin_lockout_w(space->machine, 6, data & 0x04);
- coin_lockout_w(space->machine, 7, data & 0x04);
+ coin_lockout_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space->machine(), 1, data & 0x01);
+ coin_lockout_w(space->machine(), 2, data & 0x01);
+ coin_lockout_w(space->machine(), 3, data & 0x01);
+ coin_lockout_w(space->machine(), 4, data & 0x04);
+ coin_lockout_w(space->machine(), 5, data & 0x04);
+ coin_lockout_w(space->machine(), 6, data & 0x04);
+ coin_lockout_w(space->machine(), 7, data & 0x04);
}
static WRITE8_HANDLER( rollfr_hopper_w )
@@ -418,17 +418,17 @@ static WRITE8_HANDLER( rollfr_hopper_w )
/*
By default RollFruit use inverted coinlock bit.
*/
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
state->hopper_motor = data & 0x10;
- coin_lockout_w(space->machine, 0, !data & 0x01);
- coin_lockout_w(space->machine, 1, !data & 0x01);
- coin_lockout_w(space->machine, 2, !data & 0x01);
- coin_lockout_w(space->machine, 3, !data & 0x01);
- coin_lockout_w(space->machine, 4, data & 0x04);
- coin_lockout_w(space->machine, 5, data & 0x04);
- coin_lockout_w(space->machine, 6, data & 0x04);
- coin_lockout_w(space->machine, 7, data & 0x04);
+ coin_lockout_w(space->machine(), 0, !data & 0x01);
+ coin_lockout_w(space->machine(), 1, !data & 0x01);
+ coin_lockout_w(space->machine(), 2, !data & 0x01);
+ coin_lockout_w(space->machine(), 3, !data & 0x01);
+ coin_lockout_w(space->machine(), 4, data & 0x04);
+ coin_lockout_w(space->machine(), 5, data & 0x04);
+ coin_lockout_w(space->machine(), 6, data & 0x04);
+ coin_lockout_w(space->machine(), 7, data & 0x04);
}
DRIVER_INIT( customl )
@@ -461,7 +461,7 @@ A12 <-> A13
*/
UINT32 i,j,jscr,romoffset;
- UINT8 *multfish_gfx = machine->region("gfx")->base();
+ UINT8 *multfish_gfx = machine.region("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
@@ -531,9 +531,9 @@ INLINE void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor
memcpy(romptr,tmprom,multfish_ROM_SIZE);
}
-static void lottery_decode(running_machine *machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
+static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine->region("gfx")->base();
+ UINT8 *multfish_gfx = machine.region("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -572,9 +572,9 @@ INLINE void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32
memcpy(romptr,tmprom,multfish_ROM_SIZE);
}
-static void ent_decode(running_machine *machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
+static void ent_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr)
{
- UINT8 *multfish_gfx = machine->region("gfx")->base();
+ UINT8 *multfish_gfx = machine.region("gfx")->base();
UINT8 *temprom = auto_alloc_array(machine, UINT8, multfish_ROM_SIZE);
/* ROMs decode */
@@ -592,7 +592,7 @@ static void ent_decode(running_machine *machine, UINT8 xor12, UINT8 xor34, UINT8
DRIVER_INIT( island2l )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x8bf7;
state->xor_paltype = 1;
@@ -600,7 +600,7 @@ DRIVER_INIT( island2l )
}
DRIVER_INIT( keksl )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x41f3;
state->xor_paltype = 1;
@@ -608,7 +608,7 @@ DRIVER_INIT( keksl )
}
DRIVER_INIT( pirate2l )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x8bfb;
state->xor_paltype = 1;
@@ -616,7 +616,7 @@ DRIVER_INIT( pirate2l )
}
DRIVER_INIT( fcockt2l )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0xedfb;
state->xor_paltype = 1;
@@ -624,7 +624,7 @@ DRIVER_INIT( fcockt2l )
}
DRIVER_INIT( sweetl2l )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x4bf7;
state->xor_paltype = 1;
@@ -632,7 +632,7 @@ DRIVER_INIT( sweetl2l )
}
DRIVER_INIT( gnomel )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x49ff;
state->xor_paltype = 1;
@@ -640,28 +640,28 @@ DRIVER_INIT( gnomel )
}
DRIVER_INIT( crzmonent )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x1cdb;
state->xor_paltype = 2;
}
DRIVER_INIT( resdntent )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x6edb;
state->xor_paltype = 2;
}
DRIVER_INIT( gnomeent )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x9edb;
state->xor_paltype = 2;
}
DRIVER_INIT( lhauntent )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->xor_palette = 0x1adb;
state->xor_paltype = 2;
@@ -882,12 +882,12 @@ static WRITE8_HANDLER( multfish_counters_w )
-X-- ---- Key Out Counter 27A
X--- ---- Total Bet Counter 28B
*/
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
- coin_counter_w(space->machine, 3, data & 0x10);
- coin_counter_w(space->machine, 4, data & 0x40);
- coin_counter_w(space->machine, 5, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
+ coin_counter_w(space->machine(), 3, data & 0x10);
+ coin_counter_w(space->machine(), 4, data & 0x40);
+ coin_counter_w(space->machine(), 5, data & 0x80);
}
static WRITE8_HANDLER( multfish_f3_w )
@@ -897,7 +897,7 @@ static WRITE8_HANDLER( multfish_f3_w )
static WRITE8_HANDLER( multfish_dispenable_w )
{
- multfish_state *state = space->machine->driver_data<multfish_state>();
+ multfish_state *state = space->machine().driver_data<multfish_state>();
//popmessage("multfish_f4_w %02x",data); // display enable?
state->disp_enable = data;
}
@@ -987,7 +987,7 @@ GFXDECODE_END
static MACHINE_START( multfish )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
state->save_item(NAME(state->disp_enable));
state->save_item(NAME(state->rambk));
@@ -997,9 +997,9 @@ static MACHINE_START( multfish )
static MACHINE_RESET( multfish )
{
- multfish_state *state = machine->driver_data<multfish_state>();
+ multfish_state *state = machine.driver_data<multfish_state>();
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
state->disp_enable = 0;
@@ -1060,8 +1060,8 @@ static MACHINE_RESET( island2a )
MACHINE_RESET_CALL(multfish);
// this set needs preprogrammed data in timekeeper
- timekeeper_w(machine->device("m48t35"), 0x2003 , 0x01);
- timekeeper_w(machine->device("m48t35"), 0x4003 , 0x02);
+ timekeeper_w(machine.device("m48t35"), 0x2003 , 0x01);
+ timekeeper_w(machine.device("m48t35"), 0x4003 , 0x02);
}
static MACHINE_CONFIG_DERIVED( island2a, multfish )
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 7e40bb19880..ff820ab4ffd 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -156,7 +156,7 @@ static void set_mirroring(multigam_state *state, int mirroring)
static WRITE8_HANDLER (multigam_nt_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
int page = ((offset & 0xc00) >> 10);
state->nt_page[page][offset & 0x3ff] = data;
}
@@ -164,14 +164,14 @@ static WRITE8_HANDLER (multigam_nt_w)
static READ8_HANDLER (multigam_nt_r)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
int page = ((offset & 0xc00) >> 10);
return state->nt_page[page][offset & 0x3ff];
}
static const char * const banknames[] = { "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8", "bank9" };
-static void set_videorom_bank(running_machine* machine, int start, int count, int bank, int bank_size_in_kb)
+static void set_videorom_bank(running_machine& machine, int start, int count, int bank, int bank_size_in_kb)
{
int i;
int offset = bank * (bank_size_in_kb * 0x400);
@@ -179,13 +179,13 @@ static void set_videorom_bank(running_machine* machine, int start, int count, in
/* count determines the size of the area mapped in KB */
for (i = 0; i < count; i++, offset += 0x400)
{
- memory_set_bankptr(machine, banknames[i + start], machine->region("gfx1")->base() + offset);
+ memory_set_bankptr(machine, banknames[i + start], machine.region("gfx1")->base() + offset);
}
}
-static void set_videoram_bank(running_machine* machine, int start, int count, int bank, int bank_size_in_kb)
+static void set_videoram_bank(running_machine& machine, int start, int count, int bank, int bank_size_in_kb)
{
- multigam_state *state = machine->driver_data<multigam_state>();
+ multigam_state *state = machine.driver_data<multigam_state>();
int i;
int offset = bank * (bank_size_in_kb * 0x400);
/* bank_size_in_kb is used to determine how large the "bank" parameter is */
@@ -205,7 +205,7 @@ static void set_videoram_bank(running_machine* machine, int start, int count, in
static WRITE8_HANDLER( sprite_dma_w )
{
int source = (data & 7);
- ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source);
+ ppu2c0x_spriteram_dma(space, space->machine().device("ppu"), source);
}
static READ8_DEVICE_HANDLER( psg_4015_r )
@@ -232,13 +232,13 @@ static WRITE8_DEVICE_HANDLER( psg_4017_w )
static READ8_HANDLER( multigam_IN0_r )
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
return ((state->in_0 >> state->in_0_shift++) & 0x01) | 0x40;
}
static WRITE8_HANDLER( multigam_IN0_w )
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
if (data & 0x01)
{
return;
@@ -247,22 +247,22 @@ static WRITE8_HANDLER( multigam_IN0_w )
state->in_0_shift = 0;
state->in_1_shift = 0;
- state->in_0 = input_port_read(space->machine, "P1");
- state->in_1 = input_port_read(space->machine, "P2");
+ state->in_0 = input_port_read(space->machine(), "P1");
+ state->in_1 = input_port_read(space->machine(), "P2");
state->in_dsw_shift = 0;
- state->in_dsw = input_port_read_safe(space->machine, "DSW", 0);
+ state->in_dsw = input_port_read_safe(space->machine(), "DSW", 0);
}
static READ8_HANDLER( multigam_IN1_r )
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
return ((state->in_1 >> state->in_1_shift++) & 0x01) | 0x40;
}
static CUSTOM_INPUT( multigam_inputs_r )
{
- multigam_state *state = field->port->machine->driver_data<multigam_state>();
+ multigam_state *state = field->port->machine().driver_data<multigam_state>();
/* bit 0: serial input (dsw)
bit 1: coin */
return (state->in_dsw >> state->in_dsw_shift++) & 0x01;
@@ -279,8 +279,8 @@ static CUSTOM_INPUT( multigam_inputs_r )
static WRITE8_HANDLER(multigam_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = space->machine->region("maincpu")->base();
- UINT8* src = space->machine->region("user1")->base();
+ UINT8* dst = space->machine().region("maincpu")->base();
+ UINT8* src = space->machine().region("user1")->base();
if (data & 0x80)
{
@@ -299,8 +299,8 @@ static WRITE8_HANDLER(multigam_switch_prg_rom)
static WRITE8_HANDLER(multigam_switch_gfx_rom)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
- memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * (data & 0x3f)));
+ multigam_state *state = space->machine().driver_data<multigam_state>();
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("gfx1")->base() + (0x2000 * (data & 0x3f)));
set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
state->game_gfx_bank = data;
};
@@ -308,10 +308,10 @@ static WRITE8_HANDLER(multigam_switch_gfx_rom)
static WRITE8_HANDLER(multigam_mapper2_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
if (state->game_gfx_bank & 0x80)
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * ((data & 0x3) + (state->game_gfx_bank & 0x3c))));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("gfx1")->base() + (0x2000 * ((data & 0x3) + (state->game_gfx_bank & 0x3c))));
}
else
{
@@ -370,21 +370,21 @@ ADDRESS_MAP_END
static void multigam3_mmc3_scanline_cb( device_t *device, int scanline, int vblank, int blanked )
{
- multigam_state *state = device->machine->driver_data<multigam_state>();
+ multigam_state *state = device->machine().driver_data<multigam_state>();
if (!vblank && !blanked)
{
if (--state->multigam3_mmc3_scanline_counter == -1)
{
state->multigam3_mmc3_scanline_counter = state->multigam3_mmc3_scanline_latch;
- generic_pulse_irq_line(device->machine->device("maincpu"), 0);
+ generic_pulse_irq_line(device->machine().device("maincpu"), 0);
}
}
}
static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
- device_t *ppu = space->machine->device("ppu");
+ multigam_state *state = space->machine().driver_data<multigam_state>();
+ device_t *ppu = space->machine().device("ppu");
/* basically, a MMC3 mapper from the nes */
int bankmask = state->multigam3_mmc3_prg_size == 0x40000 ? 0x1f : 0x0f;
@@ -397,7 +397,7 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
if (state->multigam3_mmc3_last_bank != (data & 0xc0))
{
int bank;
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
/* reset the banks */
if (state->multigam3_mmc3_command & 0x40)
@@ -437,7 +437,7 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
case 1: /* char banking */
data &= 0xfe;
page ^= (cmd << 1);
- set_videorom_bank(space->machine, page, 2, state->multigam3_mmc3_chr_bank_base + data, 1);
+ set_videorom_bank(space->machine(), page, 2, state->multigam3_mmc3_chr_bank_base + data, 1);
break;
case 2: /* char banking */
@@ -445,12 +445,12 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
case 4: /* char banking */
case 5: /* char banking */
page ^= cmd + 2;
- set_videorom_bank(space->machine, page, 1, state->multigam3_mmc3_chr_bank_base + data, 1);
+ set_videorom_bank(space->machine(), page, 1, state->multigam3_mmc3_chr_bank_base + data, 1);
break;
case 6: /* program banking */
{
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
if (state->multigam3_mmc3_command & 0x40)
{
/* high bank */
@@ -475,7 +475,7 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
case 7: /* program banking */
{
/* mid bank */
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
state->multigam3_mmc3_banks[1] = data & bankmask;
bank = state->multigam3_mmc3_banks[1] * 0x2000;
@@ -500,11 +500,11 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
case 0x2001: /* enable ram at $6000 */
if (data & 0x80)
{
- memory_set_bankptr(space->machine, "bank10", state->multigmc_mmc3_6000_ram);
+ memory_set_bankptr(space->machine(), "bank10", state->multigmc_mmc3_6000_ram);
}
else
{
- memory_set_bankptr(space->machine, "bank10", space->machine->region("maincpu")->base() + 0x6000);
+ memory_set_bankptr(space->machine(), "bank10", space->machine().region("maincpu")->base() + 0x6000);
}
if (data & 0x40)
{
@@ -530,10 +530,10 @@ static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
}
}
-static void multigam_init_mmc3(running_machine *machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
+static void multigam_init_mmc3(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
- multigam_state *state = machine->driver_data<multigam_state>();
- UINT8* dst = machine->region("maincpu")->base();
+ multigam_state *state = machine.driver_data<multigam_state>();
+ UINT8* dst = machine.region("maincpu")->base();
// Tom & Jerry in Super Game III enables 6000 ram, but does not read/write it
// however, it expects ROM from 6000 there (code jumps to $6xxx)
@@ -542,7 +542,7 @@ static void multigam_init_mmc3(running_machine *machine, UINT8 *prg_base, int pr
memcpy(&dst[0x8000], prg_base + (prg_size - 0x4000), 0x4000);
memcpy(&dst[0xc000], prg_base + (prg_size - 0x4000), 0x4000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigam3_mmc3_rom_switch_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigam3_mmc3_rom_switch_w) );
state->multigam3_mmc3_banks[0] = 0x1e;
state->multigam3_mmc3_banks[1] = 0x1f;
@@ -557,10 +557,10 @@ static void multigam_init_mmc3(running_machine *machine, UINT8 *prg_base, int pr
static WRITE8_HANDLER(multigm3_mapper2_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
if (state->game_gfx_bank & 0x80)
{
- set_videorom_bank(space->machine, 0, 8, (state->game_gfx_bank & 0x3c) + (data & 0x3), 8);
+ set_videorom_bank(space->machine(), 0, 8, (state->game_gfx_bank & 0x3c) + (data & 0x3), 8);
}
else
{
@@ -570,8 +570,8 @@ static WRITE8_HANDLER(multigm3_mapper2_w)
static WRITE8_HANDLER(multigm3_switch_gfx_rom)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
- set_videorom_bank(space->machine, 0, 8, data & 0x3f, 8);
+ multigam_state *state = space->machine().driver_data<multigam_state>();
+ set_videorom_bank(space->machine(), 0, 8, data & 0x3f, 8);
set_mirroring(state, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
state->game_gfx_bank = data;
};
@@ -579,18 +579,18 @@ static WRITE8_HANDLER(multigm3_switch_gfx_rom)
static WRITE8_HANDLER(multigm3_switch_prg_rom)
{
/* switch PRG rom */
- UINT8* dst = space->machine->region("maincpu")->base();
- UINT8* src = space->machine->region("user1")->base();
+ UINT8* dst = space->machine().region("maincpu")->base();
+ UINT8* src = space->machine().region("user1")->base();
if (data == 0xa8)
{
- multigam_init_mmc3(space->machine, src + 0xa0000, 0x40000, 0x180);
+ multigam_init_mmc3(space->machine(), src + 0xa0000, 0x40000, 0x180);
return;
}
else
{
space->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigm3_mapper2_w) );
- memory_set_bankptr(space->machine, "bank10", space->machine->region("maincpu")->base() + 0x6000);
+ memory_set_bankptr(space->machine(), "bank10", space->machine().region("maincpu")->base() + 0x6000);
}
if (data & 0x80)
@@ -642,23 +642,23 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(multigam3_mapper02_rom_switch_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
- UINT8* mem = space->machine->region("maincpu")->base();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
+ UINT8* mem = space->machine().region("maincpu")->base();
int bankmask = (state->mapper02_prg_size/0x4000) - 1;
memcpy(mem + 0x8000, state->mapper02_prg_base + 0x4000*(data & bankmask), 0x4000);
}
-static void multigam_init_mapper02(running_machine *machine, UINT8* prg_base, int prg_size)
+static void multigam_init_mapper02(running_machine &machine, UINT8* prg_base, int prg_size)
{
- multigam_state *state = machine->driver_data<multigam_state>();
- UINT8* mem = machine->region("maincpu")->base();
+ multigam_state *state = machine.driver_data<multigam_state>();
+ UINT8* mem = machine.region("maincpu")->base();
memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigam3_mapper02_rom_switch_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(multigam3_mapper02_rom_switch_w) );
state->mapper02_prg_base = prg_base;
state->mapper02_prg_size = prg_size;
- ppu2c0x_set_scanline_callback(machine->device("ppu"), 0);
+ ppu2c0x_set_scanline_callback(machine.device("ppu"), 0);
}
/******************************************************
@@ -670,13 +670,13 @@ static void multigam_init_mapper02(running_machine *machine, UINT8* prg_base, in
static TIMER_CALLBACK( mmc1_resync_callback )
{
- multigam_state *state = machine->driver_data<multigam_state>();
+ multigam_state *state = machine.driver_data<multigam_state>();
state->mmc1_reg_write_enable = 1;
}
static WRITE8_HANDLER( mmc1_rom_switch_w )
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
/* basically, a MMC1 mapper from the nes */
if ( state->mmc1_reg_write_enable == 0 )
@@ -686,7 +686,7 @@ static WRITE8_HANDLER( mmc1_rom_switch_w )
else
{
state->mmc1_reg_write_enable = 0;
- space->machine->scheduler().synchronize(FUNC(mmc1_resync_callback));
+ space->machine().scheduler().synchronize(FUNC(mmc1_resync_callback));
}
int reg = (offset >> 13);
@@ -755,25 +755,25 @@ static WRITE8_HANDLER( mmc1_rom_switch_w )
case 1: /* video rom banking - bank 0 - 4k or 8k */
if (state->mmc1_chr_bank_base == 0)
- set_videoram_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
+ set_videoram_bank(space->machine(), 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
else
- set_videorom_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, state->mmc1_chr_bank_base + (state->mmc1_shiftreg & 0x1f), 4);
+ set_videorom_bank(space->machine(), 0, (state->vrom4k) ? 4 : 8, state->mmc1_chr_bank_base + (state->mmc1_shiftreg & 0x1f), 4);
break;
case 2: /* video rom banking - bank 1 - 4k only */
if (state->vrom4k)
{
if (state->mmc1_chr_bank_base == 0)
- set_videoram_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
+ set_videoram_bank(space->machine(), 0, (state->vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
else
- set_videorom_bank(space->machine, 4, 4, state->mmc1_chr_bank_base + (state->mmc1_shiftreg & 0x1f), 4);
+ set_videorom_bank(space->machine(), 4, 4, state->mmc1_chr_bank_base + (state->mmc1_shiftreg & 0x1f), 4);
}
break;
case 3: /* program banking */
{
int bank = (state->mmc1_shiftreg & state->mmc1_rom_mask) * 0x4000;
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
if (!state->size16k)
{
@@ -803,14 +803,14 @@ static WRITE8_HANDLER( mmc1_rom_switch_w )
}
}
-static void multigam_init_mmc1(running_machine *machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
+static void multigam_init_mmc1(running_machine &machine, UINT8 *prg_base, int prg_size, int chr_bank_base)
{
- multigam_state *state = machine->driver_data<multigam_state>();
- UINT8* dst = machine->region("maincpu")->base();
+ multigam_state *state = machine.driver_data<multigam_state>();
+ UINT8* dst = machine.region("maincpu")->base();
memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
state->mmc1_reg_write_enable = 1;
state->mmc1_rom_mask = (prg_size / 0x4000) - 1;
@@ -818,7 +818,7 @@ static void multigam_init_mmc1(running_machine *machine, UINT8 *prg_base, int pr
state->mmc1_prg_size = prg_size;
state->mmc1_chr_bank_base = chr_bank_base;
- ppu2c0x_set_scanline_callback(machine->device("ppu"), 0);
+ ppu2c0x_set_scanline_callback(machine.device("ppu"), 0);
};
@@ -845,11 +845,11 @@ static void multigam_init_mmc1(running_machine *machine, UINT8 *prg_base, int pr
*/
-static void supergm3_set_bank(running_machine *machine)
+static void supergm3_set_bank(running_machine &machine)
{
- multigam_state *state = machine->driver_data<multigam_state>();
- device_t *ppu = machine->device("ppu");
- UINT8* mem = machine->region("maincpu")->base();
+ multigam_state *state = machine.driver_data<multigam_state>();
+ device_t *ppu = machine.device("ppu");
+ UINT8* mem = machine.region("maincpu")->base();
// video bank
if (state->supergm3_chr_bank == 0x10 ||
@@ -890,14 +890,14 @@ static void supergm3_set_bank(running_machine *machine)
{
// mapper 02
multigam_init_mapper02(machine,
- machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
+ machine.region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
0x20000);
}
else if (state->supergm3_chr_bank & 0x10)
{
// MMC3
multigam_init_mmc3(machine,
- machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
+ machine.region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
(state->supergm3_prg_bank & 0x20) ? 0x20000 : 0x40000,
(state->supergm3_chr_bank & 0x0f)*0x80);
}
@@ -905,7 +905,7 @@ static void supergm3_set_bank(running_machine *machine)
{
//MMC1
multigam_init_mmc1(machine,
- machine->region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
+ machine.region("user1")->base() + (state->supergm3_prg_bank & 0x1f)*0x20000,
0x20000,
(state->supergm3_chr_bank & 0x0f)*0x80/4 );
}
@@ -913,15 +913,15 @@ static void supergm3_set_bank(running_machine *machine)
static WRITE8_HANDLER(supergm3_prg_bank_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
state->supergm3_prg_bank = data;
}
static WRITE8_HANDLER(supergm3_chr_bank_w)
{
- multigam_state *state = space->machine->driver_data<multigam_state>();
+ multigam_state *state = space->machine().driver_data<multigam_state>();
state->supergm3_chr_bank = data;
- supergm3_set_bank(space->machine);
+ supergm3_set_bank(space->machine());
}
/******************************************************
@@ -1074,7 +1074,7 @@ static PALETTE_INIT( multigam )
static void ppu_irq( device_t *device, int *ppu_regs )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
/* our ppu interface */
@@ -1093,7 +1093,7 @@ static VIDEO_START( multigam )
static SCREEN_UPDATE( multigam )
{
/* render the ppu */
- ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0);
+ ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0);
return 0;
}
@@ -1113,58 +1113,58 @@ static MACHINE_RESET( multigam )
static MACHINE_RESET( multigm3 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* reset the ppu */
multigm3_switch_prg_rom(space, 0, 0x01 );
};
static MACHINE_START( multigam )
{
- multigam_state *state = machine->driver_data<multigam_state>();
+ multigam_state *state = machine.driver_data<multigam_state>();
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
state->nt_page[0] = state->nt_ram;
state->nt_page[1] = state->nt_ram + 0x400;
state->nt_page[2] = state->nt_ram + 0x800;
state->nt_page[3] = state->nt_ram + 0xc00;
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("gfx1")->base());
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("gfx1")->base());
}
static MACHINE_START( multigm3 )
{
- multigam_state *state = machine->driver_data<multigam_state>();
+ multigam_state *state = machine.driver_data<multigam_state>();
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
state->nt_page[0] = state->nt_ram;
state->nt_page[1] = state->nt_ram + 0x400;
state->nt_page[2] = state->nt_ram + 0x800;
state->nt_page[3] = state->nt_ram + 0xc00;
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8");
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8");
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9");
set_videorom_bank(machine, 0, 8, 0, 8);
};
static MACHINE_START( supergm3 )
{
- multigam_state *state = machine->driver_data<multigam_state>();
+ multigam_state *state = machine.driver_data<multigam_state>();
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
state->nt_page[0] = state->nt_ram;
state->nt_page[1] = state->nt_ram + 0x400;
state->nt_page[2] = state->nt_ram + 0x800;
state->nt_page[3] = state->nt_ram + 0xc00;
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(multigam_nt_r), FUNC(multigam_nt_w));
state->vram = auto_alloc_array(machine, UINT8, 0x2000);
state->multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1343,7 +1343,7 @@ ROM_END
static DRIVER_INIT( multigam )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
multigam_switch_prg_rom(space, 0x0, 0x01);
}
@@ -1358,13 +1358,13 @@ static void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble
static DRIVER_INIT(multigm3)
{
- multigam_state *state = machine->driver_data<multigam_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ multigam_state *state = machine.driver_data<multigam_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a };
- multigm3_decrypt(machine->region("maincpu")->base(), machine->region("maincpu")->bytes(), decode );
- multigm3_decrypt(machine->region("user1")->base(), machine->region("user1")->bytes(), decode );
+ multigm3_decrypt(machine.region("maincpu")->base(), machine.region("maincpu")->bytes(), decode );
+ multigm3_decrypt(machine.region("user1")->base(), machine.region("user1")->bytes(), decode );
state->multigmc_mmc3_6000_ram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1373,7 +1373,7 @@ static DRIVER_INIT(multigm3)
static DRIVER_INIT(multigmt)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8* buf = auto_alloc_array(machine, UINT8, 0x80000);
UINT8 *rom;
@@ -1381,7 +1381,7 @@ static DRIVER_INIT(multigmt)
int i;
int addr;
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
size = 0x8000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1391,7 +1391,7 @@ static DRIVER_INIT(multigmt)
rom[i] = buf[addr];
}
- rom = machine->region("user1")->base();
+ rom = machine.region("user1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
@@ -1399,7 +1399,7 @@ static DRIVER_INIT(multigmt)
addr = BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,8,11,12,10,9,7,6,5,4,3,2,1,0);
rom[i] = buf[addr];
}
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
size = 0x80000;
memcpy(buf, rom, size);
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/munchmo.c b/src/mame/drivers/munchmo.c
index 87e7b5b9c6b..ce41a7a6f6e 100644
--- a/src/mame/drivers/munchmo.c
+++ b/src/mame/drivers/munchmo.c
@@ -39,13 +39,13 @@ Stephh's notes (based on the game Z80 code and some tests) :
static WRITE8_HANDLER( mnchmobl_nmi_enable_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
state->nmi_enable = data;
}
static INTERRUPT_GEN( mnchmobl_interrupt )
{
- munchmo_state *state = device->machine->driver_data<munchmo_state>();
+ munchmo_state *state = device->machine().driver_data<munchmo_state>();
state->which = !state->which;
if (state->which)
@@ -56,7 +56,7 @@ static INTERRUPT_GEN( mnchmobl_interrupt )
static INTERRUPT_GEN( mnchmobl_sound_irq )
{
- munchmo_state *state = device->machine->driver_data<munchmo_state>();
+ munchmo_state *state = device->machine().driver_data<munchmo_state>();
if (!(state->sound_nmi_enable))
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
@@ -64,7 +64,7 @@ static INTERRUPT_GEN( mnchmobl_sound_irq )
static WRITE8_HANDLER( mnchmobl_soundlatch_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE );
@@ -72,14 +72,14 @@ static WRITE8_HANDLER( mnchmobl_soundlatch_w )
static WRITE8_HANDLER( sound_nmi_enable_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
state->sound_nmi_enable = data & 1;
}
static WRITE8_HANDLER( sound_nmi_ack_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -307,10 +307,10 @@ GFXDECODE_END
static MACHINE_START( munchmo )
{
- munchmo_state *state = machine->driver_data<munchmo_state>();
+ munchmo_state *state = machine.driver_data<munchmo_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->palette_bank));
state->save_item(NAME(state->flipscreen));
@@ -320,7 +320,7 @@ static MACHINE_START( munchmo )
static MACHINE_RESET( munchmo )
{
- munchmo_state *state = machine->driver_data<munchmo_state>();
+ munchmo_state *state = machine.driver_data<munchmo_state>();
state->palette_bank = 0;
state->flipscreen = 0;
diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c
index e00b2ee5d45..c192e2bac16 100644
--- a/src/mame/drivers/murogem.c
+++ b/src/mame/drivers/murogem.c
@@ -177,7 +177,7 @@ static PALETTE_INIT(murogem)
static SCREEN_UPDATE(murogem)
{
- murogem_state *state = screen->machine->driver_data<murogem_state>();
+ murogem_state *state = screen->machine().driver_data<murogem_state>();
int xx,yy,count;
count = 0x000;
@@ -190,7 +190,7 @@ static SCREEN_UPDATE(murogem)
int tileno = state->videoram[count]&0x3f;
int attr = state->videoram[count+0x400]&0x0f;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
count++;
diff --git a/src/mame/drivers/murogmbl.c b/src/mame/drivers/murogmbl.c
index e71466386f3..56797a75bff 100644
--- a/src/mame/drivers/murogmbl.c
+++ b/src/mame/drivers/murogmbl.c
@@ -92,8 +92,8 @@ static VIDEO_START(murogmbl)
static SCREEN_UPDATE(murogmbl)
{
- murogmbl_state *state = screen->machine->driver_data<murogmbl_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ murogmbl_state *state = screen->machine().driver_data<murogmbl_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0;
int y, x;
diff --git a/src/mame/drivers/mustache.c b/src/mame/drivers/mustache.c
index 2c01c5f95b6..a38c745172d 100644
--- a/src/mame/drivers/mustache.c
+++ b/src/mame/drivers/mustache.c
@@ -164,7 +164,7 @@ static TIMER_CALLBACK( clear_irq_cb )
static INTERRUPT_GEN( assert_irq )
{
- mustache_state *state = device->machine->driver_data<mustache_state>();
+ mustache_state *state = device->machine().driver_data<mustache_state>();
device_set_input_line(device, 0, ASSERT_LINE);
state->clear_irq_timer->adjust(downcast<cpu_device *>(device)->cycles_to_attotime(14288));
/* Timing here is an educated GUESS, Z80 /INT must stay high so the irq
@@ -180,8 +180,8 @@ static INTERRUPT_GEN( assert_irq )
static MACHINE_START( mustache )
{
- mustache_state *state = machine->driver_data<mustache_state>();
- state->clear_irq_timer = machine->scheduler().timer_alloc(FUNC(clear_irq_cb));
+ mustache_state *state = machine.driver_data<mustache_state>();
+ state->clear_irq_timer = machine.scheduler().timer_alloc(FUNC(clear_irq_cb));
}
static MACHINE_CONFIG_START( mustache, mustache_state )
@@ -253,10 +253,10 @@ static DRIVER_INIT( mustache )
{
int i;
- int G1 = machine->region("gfx1")->bytes()/3;
- int G2 = machine->region("gfx2")->bytes()/2;
- UINT8 *gfx1 = machine->region("gfx1")->base();
- UINT8 *gfx2 = machine->region("gfx2")->base();
+ int G1 = machine.region("gfx1")->bytes()/3;
+ int G2 = machine.region("gfx2")->bytes()/2;
+ UINT8 *gfx1 = machine.region("gfx1")->base();
+ UINT8 *gfx2 = machine.region("gfx2")->base();
UINT8 *buf=auto_alloc_array(machine, UINT8, G2*2);
/* BG data lines */
diff --git a/src/mame/drivers/mw18w.c b/src/mame/drivers/mw18w.c
index 5fd537d9e5f..c006e862bf3 100644
--- a/src/mame/drivers/mw18w.c
+++ b/src/mame/drivers/mw18w.c
@@ -31,7 +31,7 @@ public:
static WRITE8_HANDLER( mw18w_sound0_w )
{
// sound write (airhorn, brake, crash) plus motor speed for backdrop, and coin counter
- coin_counter_w(space->machine, 0, data&1);
+ coin_counter_w(space->machine(), 0, data&1);
}
static WRITE8_HANDLER( mw18w_sound1_w )
@@ -58,7 +58,7 @@ static WRITE8_HANDLER( mw18w_led_display_w )
static WRITE8_HANDLER( mw18w_irq0_clear_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static CUSTOM_INPUT( mw18w_sensors_r )
diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c
index 42ed8d7c32e..b827bd1b81a 100644
--- a/src/mame/drivers/mw8080bw.c
+++ b/src/mame/drivers/mw8080bw.c
@@ -167,7 +167,7 @@
static READ8_HANDLER( mw8080bw_shift_result_rev_r )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 ret = mb14241_shift_result_r(state->mb14241, 0);
return BITSWAP8(ret,0,1,2,3,4,5,6,7);
@@ -176,7 +176,7 @@ static READ8_HANDLER( mw8080bw_shift_result_rev_r )
static READ8_HANDLER( mw8080bw_reversable_shift_result_r )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 ret;
if (state->rev_shift_res)
@@ -193,7 +193,7 @@ static READ8_HANDLER( mw8080bw_reversable_shift_result_r )
static WRITE8_HANDLER( mw8080bw_reversable_shift_count_w)
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
mb14241_shift_count_w(state->mb14241, offset, data);
state->rev_shift_res = data & 0x08;
@@ -319,8 +319,8 @@ static WRITE8_HANDLER( seawolf_periscope_lamp_w )
static CUSTOM_INPUT( seawolf_erase_input_r )
{
- return input_port_read(field->port->machine, SEAWOLF_ERASE_SW_PORT_TAG) &
- input_port_read(field->port->machine, SEAWOLF_ERASE_DIP_PORT_TAG);
+ return input_port_read(field->port->machine(), SEAWOLF_ERASE_SW_PORT_TAG) &
+ input_port_read(field->port->machine(), SEAWOLF_ERASE_DIP_PORT_TAG);
}
@@ -424,7 +424,7 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( gunfight_io_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
if (offset & 0x01)
gunfight_audio_w(space, 0, data);
@@ -551,7 +551,7 @@ MACHINE_CONFIG_END
#define TORNBASE_CAB_TYPE_PORT_TAG ("CAB")
-UINT8 tornbase_get_cabinet_type(running_machine *machine)
+UINT8 tornbase_get_cabinet_type(running_machine &machine)
{
return input_port_read(machine, TORNBASE_CAB_TYPE_PORT_TAG);
}
@@ -559,7 +559,7 @@ UINT8 tornbase_get_cabinet_type(running_machine *machine)
static CUSTOM_INPUT( tornbase_hit_left_input_r )
{
- return input_port_read(field->port->machine, TORNBASE_L_HIT_PORT_TAG);
+ return input_port_read(field->port->machine(), TORNBASE_L_HIT_PORT_TAG);
}
@@ -567,16 +567,16 @@ static CUSTOM_INPUT( tornbase_hit_right_input_r )
{
UINT32 ret;
- switch (tornbase_get_cabinet_type(field->port->machine))
+ switch (tornbase_get_cabinet_type(field->port->machine()))
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
- ret = input_port_read(field->port->machine, TORNBASE_L_HIT_PORT_TAG);
+ ret = input_port_read(field->port->machine(), TORNBASE_L_HIT_PORT_TAG);
break;
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = input_port_read(field->port->machine, TORNBASE_R_HIT_PORT_TAG);
+ ret = input_port_read(field->port->machine(), TORNBASE_R_HIT_PORT_TAG);
break;
}
@@ -588,16 +588,16 @@ static CUSTOM_INPUT( tornbase_pitch_left_input_r )
{
UINT32 ret;
- switch (tornbase_get_cabinet_type(field->port->machine))
+ switch (tornbase_get_cabinet_type(field->port->machine()))
{
case TORNBASE_CAB_TYPE_UPRIGHT_OLD:
case TORNBASE_CAB_TYPE_UPRIGHT_NEW:
- ret = input_port_read(field->port->machine, TORNBASE_L_PITCH_PORT_TAG);
+ ret = input_port_read(field->port->machine(), TORNBASE_L_PITCH_PORT_TAG);
break;
case TORNBASE_CAB_TYPE_COCKTAIL:
default:
- ret = input_port_read(field->port->machine, TORNBASE_R_PITCH_PORT_TAG);
+ ret = input_port_read(field->port->machine(), TORNBASE_R_PITCH_PORT_TAG);
break;
}
@@ -607,23 +607,23 @@ static CUSTOM_INPUT( tornbase_pitch_left_input_r )
static CUSTOM_INPUT( tornbase_pitch_right_input_r )
{
- return input_port_read(field->port->machine, TORNBASE_L_PITCH_PORT_TAG);
+ return input_port_read(field->port->machine(), TORNBASE_L_PITCH_PORT_TAG);
}
static CUSTOM_INPUT( tornbase_score_input_r )
{
- return input_port_read(field->port->machine, TORNBASE_SCORE_SW_PORT_TAG) &
- input_port_read(field->port->machine, TORNBASE_SCORE_DIP_PORT_TAG);
+ return input_port_read(field->port->machine(), TORNBASE_SCORE_SW_PORT_TAG) &
+ input_port_read(field->port->machine(), TORNBASE_SCORE_DIP_PORT_TAG);
}
static WRITE8_HANDLER( tornbase_io_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
if (offset & 0x01)
- tornbase_audio_w(space->machine->device("discrete"), 0, data);
+ tornbase_audio_w(space->machine().device("discrete"), 0, data);
if (offset & 0x02)
mb14241_shift_count_w(state->mb14241, 0, data);
@@ -873,14 +873,14 @@ MACHINE_CONFIG_END
static STATE_POSTLOAD( maze_update_discrete )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
- maze_write_discrete(machine->device("discrete"), state->maze_tone_timing_state);
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
+ maze_write_discrete(machine.device("discrete"), state->maze_tone_timing_state);
}
static TIMER_CALLBACK( maze_tone_timing_timer_callback )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
state->maze_tone_timing_state = !state->maze_tone_timing_state;
maze_write_discrete(state->discrete, state->maze_tone_timing_state);
}
@@ -888,17 +888,17 @@ static TIMER_CALLBACK( maze_tone_timing_timer_callback )
static MACHINE_START( maze )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* create astable timer for IC B1 */
- machine->scheduler().timer_pulse(MAZE_555_B1_PERIOD, FUNC(maze_tone_timing_timer_callback));
+ machine.scheduler().timer_pulse(MAZE_555_B1_PERIOD, FUNC(maze_tone_timing_timer_callback));
/* initialize state of Tone Timing FF, IC C1 */
state->maze_tone_timing_state = 0;
/* setup for save states */
state->save_item(NAME(state->maze_tone_timing_state));
- machine->state().register_postload(maze_update_discrete, NULL);
+ machine.state().register_postload(maze_update_discrete, NULL);
MACHINE_START_CALL(mw8080bw);
}
@@ -907,8 +907,8 @@ static MACHINE_START( maze )
static WRITE8_HANDLER( maze_coin_counter_w )
{
/* the data is not used, just pulse the counter */
- coin_counter_w(space->machine, 0, 0);
- coin_counter_w(space->machine, 0, 1);
+ coin_counter_w(space->machine(), 0, 0);
+ coin_counter_w(space->machine(), 0, 1);
}
@@ -981,7 +981,7 @@ MACHINE_CONFIG_END
static MACHINE_START( boothill )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->rev_shift_res));
@@ -1076,7 +1076,7 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( checkmat_io_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
if (offset & 0x01) checkmat_audio_w(state->discrete, 0, data);
@@ -1183,7 +1183,7 @@ MACHINE_CONFIG_END
static MACHINE_START( desertgu )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->desertgun_controller_select));
@@ -1194,13 +1194,13 @@ static MACHINE_START( desertgu )
static CUSTOM_INPUT( desertgu_gun_input_r )
{
- mw8080bw_state *state = field->port->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = field->port->machine().driver_data<mw8080bw_state>();
UINT32 ret;
if (state->desertgun_controller_select)
- ret = input_port_read(field->port->machine, DESERTGU_GUN_X_PORT_TAG);
+ ret = input_port_read(field->port->machine(), DESERTGU_GUN_X_PORT_TAG);
else
- ret = input_port_read(field->port->machine, DESERTGU_GUN_Y_PORT_TAG);
+ ret = input_port_read(field->port->machine(), DESERTGU_GUN_Y_PORT_TAG);
return ret;
}
@@ -1208,13 +1208,13 @@ static CUSTOM_INPUT( desertgu_gun_input_r )
static CUSTOM_INPUT( desertgu_dip_sw_0_1_r )
{
- mw8080bw_state *state = field->port->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = field->port->machine().driver_data<mw8080bw_state>();
UINT32 ret;
if (state->desertgun_controller_select)
- ret = input_port_read(field->port->machine, DESERTGU_DIP_SW_0_1_SET_2_TAG);
+ ret = input_port_read(field->port->machine(), DESERTGU_DIP_SW_0_1_SET_2_TAG);
else
- ret = input_port_read(field->port->machine, DESERTGU_DIP_SW_0_1_SET_1_TAG);
+ ret = input_port_read(field->port->machine(), DESERTGU_DIP_SW_0_1_SET_1_TAG);
return ret;
}
@@ -1327,10 +1327,10 @@ static CUSTOM_INPUT( dplay_pitch_left_input_r )
{
UINT32 ret;
- if (input_port_read(field->port->machine, DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
- ret = input_port_read(field->port->machine, DPLAY_L_PITCH_PORT_TAG);
+ if (input_port_read(field->port->machine(), DPLAY_CAB_TYPE_PORT_TAG) == DPLAY_CAB_TYPE_UPRIGHT)
+ ret = input_port_read(field->port->machine(), DPLAY_L_PITCH_PORT_TAG);
else
- ret = input_port_read(field->port->machine, DPLAY_R_PITCH_PORT_TAG);
+ ret = input_port_read(field->port->machine(), DPLAY_R_PITCH_PORT_TAG);
return ret;
}
@@ -1338,7 +1338,7 @@ static CUSTOM_INPUT( dplay_pitch_left_input_r )
static CUSTOM_INPUT( dplay_pitch_right_input_r )
{
- return input_port_read(field->port->machine, DPLAY_L_PITCH_PORT_TAG);
+ return input_port_read(field->port->machine(), DPLAY_L_PITCH_PORT_TAG);
}
@@ -1511,7 +1511,7 @@ MACHINE_CONFIG_END
static MACHINE_START( gmissile )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->rev_shift_res));
@@ -1607,7 +1607,7 @@ MACHINE_CONFIG_END
static MACHINE_START( m4 )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->rev_shift_res));
@@ -1705,7 +1705,7 @@ MACHINE_CONFIG_END
static MACHINE_START( clowns )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->clowns_controller_select));
@@ -1716,16 +1716,16 @@ static MACHINE_START( clowns )
static CUSTOM_INPUT( clowns_controller_r )
{
- mw8080bw_state *state = field->port->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = field->port->machine().driver_data<mw8080bw_state>();
UINT32 ret;
if (state->clowns_controller_select)
{
- ret = input_port_read(field->port->machine, CLOWNS_CONTROLLER_P2_TAG);
+ ret = input_port_read(field->port->machine(), CLOWNS_CONTROLLER_P2_TAG);
}
else
{
- ret = input_port_read(field->port->machine, CLOWNS_CONTROLLER_P1_TAG);
+ ret = input_port_read(field->port->machine(), CLOWNS_CONTROLLER_P1_TAG);
}
return ret;
@@ -2136,14 +2136,14 @@ MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK( spcenctr_strobe_timer_callback )
{
- mw8080bw_state *state = timer.machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = timer.machine().driver_data<mw8080bw_state>();
output_set_value("STROBE", param && state->spcenctr_strobe_state);
}
static MACHINE_START( spcenctr )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->spcenctr_strobe_state));
@@ -2155,30 +2155,30 @@ static MACHINE_START( spcenctr )
}
#if 0
-UINT8 spcenctr_get_trench_width( *running_machine *machine )
+UINT8 spcenctr_get_trench_width( *running_machine &machine )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
return state->spcenctr_trench_width;
}
-UINT8 spcenctr_get_trench_center( *running_machine *machine )
+UINT8 spcenctr_get_trench_center( *running_machine &machine )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
return state->spcenctr_trench_center;
}
-UINT8 spcenctr_get_trench_slope( *running_machine *machine , UINT8 addr )
+UINT8 spcenctr_get_trench_slope( *running_machine &machine , UINT8 addr )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
return state->spcenctr_trench_slope[addr & 0x0f];
}
#endif
static WRITE8_HANDLER( spcenctr_io_w )
{ /* A7 A6 A5 A4 A3 A2 A1 A0 */
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
if ((offset & 0x07) == 0x02)
watchdog_reset_w(space, 0, data); /* - - - - - 0 1 0 */
@@ -2306,7 +2306,7 @@ MACHINE_CONFIG_END
static MACHINE_START( phantom2 )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->phantom2_cloud_counter));
@@ -2400,7 +2400,7 @@ static READ8_HANDLER( bowler_shift_result_r )
/* ZV - not too sure why this is needed, I don't see
anything unusual on the schematics that would cause
the bits to flip */
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
return ~mb14241_shift_result_r(state->mb14241, 0);
}
@@ -2536,7 +2536,7 @@ MACHINE_CONFIG_END
static MACHINE_START( invaders )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->invaders_flip_screen));
@@ -2548,9 +2548,9 @@ static MACHINE_START( invaders )
static CUSTOM_INPUT( invaders_coin_input_r )
{
- UINT32 ret = input_port_read(field->port->machine, INVADERS_COIN_INPUT_PORT_TAG);
+ UINT32 ret = input_port_read(field->port->machine(), INVADERS_COIN_INPUT_PORT_TAG);
- coin_counter_w(field->port->machine, 0, !ret);
+ coin_counter_w(field->port->machine(), 0, !ret);
return ret;
}
@@ -2563,10 +2563,10 @@ static CUSTOM_INPUT( invaders_sw6_sw7_r )
/* upright PCB : switches visible
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail(field->port->machine))
+ if (invaders_is_cabinet_cocktail(field->port->machine()))
ret = 0x03;
else
- ret = input_port_read(field->port->machine, INVADERS_SW6_SW7_PORT_TAG);
+ ret = input_port_read(field->port->machine(), INVADERS_SW6_SW7_PORT_TAG);
return ret;
}
@@ -2579,10 +2579,10 @@ static CUSTOM_INPUT( invaders_sw5_r )
/* upright PCB : switch visible
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail(field->port->machine))
+ if (invaders_is_cabinet_cocktail(field->port->machine()))
ret = 0x01;
else
- ret = input_port_read(field->port->machine, INVADERS_SW5_PORT_TAG);
+ ret = input_port_read(field->port->machine(), INVADERS_SW5_PORT_TAG);
return ret;
}
@@ -2595,10 +2595,10 @@ static CUSTOM_INPUT( invaders_in0_control_r )
/* upright PCB : P1 controls
cocktail PCB: HI */
- if (invaders_is_cabinet_cocktail(field->port->machine))
+ if (invaders_is_cabinet_cocktail(field->port->machine()))
ret = 0x07;
else
- ret = input_port_read(field->port->machine, INVADERS_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(field->port->machine(), INVADERS_P1_CONTROL_PORT_TAG);
return ret;
}
@@ -2606,7 +2606,7 @@ static CUSTOM_INPUT( invaders_in0_control_r )
CUSTOM_INPUT( invaders_in1_control_r )
{
- return input_port_read(field->port->machine, INVADERS_P1_CONTROL_PORT_TAG);
+ return input_port_read(field->port->machine(), INVADERS_P1_CONTROL_PORT_TAG);
}
@@ -2617,16 +2617,16 @@ CUSTOM_INPUT( invaders_in2_control_r )
/* upright PCB : P1 controls
cocktail PCB: P2 controls */
- if (invaders_is_cabinet_cocktail(field->port->machine))
- ret = input_port_read(field->port->machine, INVADERS_P2_CONTROL_PORT_TAG);
+ if (invaders_is_cabinet_cocktail(field->port->machine()))
+ ret = input_port_read(field->port->machine(), INVADERS_P2_CONTROL_PORT_TAG);
else
- ret = input_port_read(field->port->machine, INVADERS_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(field->port->machine(), INVADERS_P1_CONTROL_PORT_TAG);
return ret;
}
-int invaders_is_cabinet_cocktail(running_machine *machine)
+int invaders_is_cabinet_cocktail(running_machine &machine)
{
return input_port_read(machine, INVADERS_CAB_TYPE_PORT_TAG);
}
@@ -2755,9 +2755,9 @@ MACHINE_CONFIG_END
static CUSTOM_INPUT( blueshrk_coin_input_r )
{
- UINT32 ret = input_port_read(field->port->machine, BLUESHRK_COIN_INPUT_PORT_TAG);
+ UINT32 ret = input_port_read(field->port->machine(), BLUESHRK_COIN_INPUT_PORT_TAG);
- coin_counter_w(field->port->machine, 0, !ret);
+ coin_counter_w(field->port->machine(), 0, !ret);
return ret;
}
diff --git a/src/mame/drivers/mwarr.c b/src/mame/drivers/mwarr.c
index 593368e11a6..e53a40864b2 100644
--- a/src/mame/drivers/mwarr.c
+++ b/src/mame/drivers/mwarr.c
@@ -77,7 +77,7 @@ public:
static WRITE16_HANDLER( bg_videoram_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -85,7 +85,7 @@ static WRITE16_HANDLER( bg_videoram_w )
static WRITE16_HANDLER( mlow_videoram_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
COMBINE_DATA(&state->mlow_videoram[offset]);
tilemap_mark_tile_dirty(state->mlow_tilemap,offset);
@@ -93,7 +93,7 @@ static WRITE16_HANDLER( mlow_videoram_w )
static WRITE16_HANDLER( mhigh_videoram_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
COMBINE_DATA(&state->mhigh_videoram[offset]);
tilemap_mark_tile_dirty(state->mhigh_tilemap,offset);
@@ -101,7 +101,7 @@ static WRITE16_HANDLER( mhigh_videoram_w )
static WRITE16_HANDLER( tx_videoram_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
COMBINE_DATA(&state->tx_videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
@@ -114,7 +114,7 @@ static WRITE16_DEVICE_HANDLER( oki1_bank_w )
static WRITE16_HANDLER( sprites_commands_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
if (state->which)
{
@@ -152,7 +152,7 @@ static WRITE16_HANDLER( sprites_commands_w )
static WRITE16_HANDLER( mwarr_brightness_w )
{
- mwarr_state *state = space->machine->driver_data<mwarr_state>();
+ mwarr_state *state = space->machine().driver_data<mwarr_state>();
int i;
double brightness;
@@ -161,7 +161,7 @@ static WRITE16_HANDLER( mwarr_brightness_w )
brightness = (double)(data & 0xff);
for (i = 0; i < 0x800; i++)
{
- palette_set_pen_contrast(space->machine, i, brightness/255);
+ palette_set_pen_contrast(space->machine(), i, brightness/255);
}
}
@@ -332,7 +332,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_bg_tile_info )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
int tileno = state->bg_videoram[tile_index] & 0x1fff;
int colour = (state->bg_videoram[tile_index] & 0xe000) >> 13;
@@ -341,7 +341,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_mlow_tile_info )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
int tileno = state->mlow_videoram[tile_index] & 0x1fff;
int colour = (state->mlow_videoram[tile_index] & 0xe000) >> 13;
@@ -350,7 +350,7 @@ static TILE_GET_INFO( get_mlow_tile_info )
static TILE_GET_INFO( get_mhigh_tile_info )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
int tileno = state->mhigh_videoram[tile_index] & 0x1fff;
int colour = (state->mhigh_videoram[tile_index] & 0xe000) >> 13;
@@ -359,7 +359,7 @@ static TILE_GET_INFO( get_mhigh_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
int tileno = state->tx_videoram[tile_index] & 0x1fff;
int colour = (state->tx_videoram[tile_index] & 0xe000) >> 13;
@@ -368,7 +368,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( mwarr )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 16);
state->mlow_tilemap = tilemap_create(machine, get_mlow_tile_info, tilemap_scan_cols, 16, 16, 64, 16);
@@ -386,12 +386,12 @@ static VIDEO_START( mwarr )
state->save_item(NAME(state->sprites_buffer));
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
const UINT16 *source = state->sprites_buffer + 0x800 - 4;
const UINT16 *finish = state->sprites_buffer;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
int x, y, color, flipx, dy, pri, pri_mask, i;
while (source >= finish)
@@ -419,7 +419,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color,
flipx,0,
x,y+i*16,
- machine->priority_bitmap,pri_mask,0 );
+ machine.priority_bitmap,pri_mask,0 );
/* wrap around x */
pdrawgfx_transpen( bitmap,
@@ -429,7 +429,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color,
flipx,0,
x-1024,y+i*16,
- machine->priority_bitmap,pri_mask,0 );
+ machine.priority_bitmap,pri_mask,0 );
/* wrap around y */
pdrawgfx_transpen( bitmap,
@@ -439,7 +439,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color,
flipx,0,
x,y-512+i*16,
- machine->priority_bitmap,pri_mask,0 );
+ machine.priority_bitmap,pri_mask,0 );
/* wrap around x & y */
pdrawgfx_transpen( bitmap,
@@ -449,7 +449,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color,
flipx,0,
x-1024,y-512+i*16,
- machine->priority_bitmap,pri_mask,0 );
+ machine.priority_bitmap,pri_mask,0 );
}
}
@@ -459,10 +459,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( mwarr )
{
- mwarr_state *state = screen->machine->driver_data<mwarr_state>();
+ mwarr_state *state = screen->machine().driver_data<mwarr_state>();
int i;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (BIT(state->vidattrram[6], 0))
{
@@ -508,7 +508,7 @@ static SCREEN_UPDATE( mwarr )
tilemap_draw(bitmap, cliprect, state->mlow_tilemap, 0, 0x02);
tilemap_draw(bitmap, cliprect, state->mhigh_tilemap, 0, 0x04);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0x10);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -520,14 +520,14 @@ static SCREEN_UPDATE( mwarr )
static MACHINE_START( mwarr )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
state->save_item(NAME(state->which));
}
static MACHINE_RESET( mwarr )
{
- mwarr_state *state = machine->driver_data<mwarr_state>();
+ mwarr_state *state = machine.driver_data<mwarr_state>();
state->which = 0;
}
diff --git a/src/mame/drivers/mystston.c b/src/mame/drivers/mystston.c
index bba5a62e5bb..5a98c5d1b3b 100644
--- a/src/mame/drivers/mystston.c
+++ b/src/mame/drivers/mystston.c
@@ -37,7 +37,7 @@
*
*************************************/
-void mystston_on_scanline_interrupt(running_machine *machine)
+void mystston_on_scanline_interrupt(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
@@ -45,7 +45,7 @@ void mystston_on_scanline_interrupt(running_machine *machine)
static WRITE8_HANDLER( irq_clear_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -59,7 +59,7 @@ static WRITE8_HANDLER( irq_clear_w )
static INPUT_CHANGED( coin_inserted )
{
/* coin insertion causes an NMI */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -72,20 +72,20 @@ static INPUT_CHANGED( coin_inserted )
static WRITE8_HANDLER( mystston_ay8910_select_w )
{
- mystston_state *state = space->machine->driver_data<mystston_state>();
+ mystston_state *state = space->machine().driver_data<mystston_state>();
/* bit 5 goes to 8910 #0 BDIR pin */
if (((*state->ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
{
/* bit 4 goes to the 8910 #0 BC1 pin */
- ay8910_data_address_w(space->machine->device("ay1"), *state->ay8910_select >> 4, *state->ay8910_data);
+ ay8910_data_address_w(space->machine().device("ay1"), *state->ay8910_select >> 4, *state->ay8910_data);
}
/* bit 7 goes to 8910 #1 BDIR pin */
if (((*state->ay8910_select & 0x80) == 0x80) && ((data & 0x80) == 0x00))
{
/* bit 6 goes to the 8910 #1 BC1 pin */
- ay8910_data_address_w(space->machine->device("ay2"), *state->ay8910_select >> 6, *state->ay8910_data);
+ ay8910_data_address_w(space->machine().device("ay2"), *state->ay8910_select >> 6, *state->ay8910_data);
}
*state->ay8910_select = data;
diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c
index 28a1d453419..bc48be1ef60 100644
--- a/src/mame/drivers/mystwarr.c
+++ b/src/mame/drivers/mystwarr.c
@@ -63,7 +63,7 @@ static READ16_HANDLER( eeprom_r )
{
if (ACCESSING_BITS_0_7)
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
// logerror("msb access to eeprom port\n");
@@ -75,7 +75,7 @@ static WRITE16_HANDLER( mweeprom_w )
{
if (ACCESSING_BITS_8_15)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
// logerror("unknown LSB write %x to eeprom\n", data);
@@ -86,17 +86,17 @@ static READ16_HANDLER( dddeeprom_r )
{
if (ACCESSING_BITS_8_15)
{
- return input_port_read(space->machine, "IN1") << 8;
+ return input_port_read(space->machine(), "IN1") << 8;
}
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
}
static WRITE16_HANDLER( mmeeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -106,7 +106,7 @@ static WRITE16_HANDLER( mmeeprom_w )
static INTERRUPT_GEN(mystwarr_interrupt)
{
- mystwarr_state *state = device->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = device->machine().driver_data<mystwarr_state>();
if (!(state->mw_irq_control & 0x01)) return;
switch (cpu_getiloops(device))
@@ -145,7 +145,7 @@ static INTERRUPT_GEN(metamrph_interrupt)
static INTERRUPT_GEN(mchamp_interrupt)
{
- mystwarr_state *state = device->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = device->machine().driver_data<mystwarr_state>();
if (!(state->mw_irq_control & 0x02)) return;
switch (cpu_getiloops(device))
@@ -192,7 +192,7 @@ static WRITE16_HANDLER( sound_cmd2_msb_w )
static WRITE16_HANDLER( sound_irq_w )
{
- cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, HOLD_LINE);
}
static READ16_HANDLER( sound_status_r )
@@ -215,7 +215,7 @@ static READ16_HANDLER( sound_status_msb_r )
static WRITE16_HANDLER( irq_ack_w )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
K056832_b_word_w(space, offset, data, mem_mask);
if (offset == 3 && ACCESSING_BITS_0_7)
@@ -231,7 +231,7 @@ static WRITE16_HANDLER( irq_ack_w )
/* of RAM, but they put 0x10000 there. The CPU can access them all. */
static READ16_HANDLER( K053247_scattered_word_r )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (offset & 0x0078)
return state->spriteram[offset];
else
@@ -243,7 +243,7 @@ static READ16_HANDLER( K053247_scattered_word_r )
static WRITE16_HANDLER( K053247_scattered_word_w )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (offset & 0x0078)
{
// mame_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, cpu_get_pc(space->cpu));
@@ -386,7 +386,7 @@ ADDRESS_MAP_END
// Martial Champion specific interfaces
static READ16_HANDLER( K053247_martchmp_word_r )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (offset & 0x0018)
return state->spriteram[offset];
else
@@ -398,7 +398,7 @@ static READ16_HANDLER( K053247_martchmp_word_r )
static WRITE16_HANDLER( K053247_martchmp_word_w )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (offset & 0x0018)
{
COMBINE_DATA(state->spriteram+offset);
@@ -413,13 +413,13 @@ static WRITE16_HANDLER( K053247_martchmp_word_w )
static READ16_HANDLER( mccontrol_r )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
return state->mw_irq_control<<8;
}
static WRITE16_HANDLER( mccontrol_w )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (ACCESSING_BITS_8_15)
{
state->mw_irq_control = data>>8;
@@ -574,17 +574,17 @@ ADDRESS_MAP_END
/**********************************************************************************/
-static void reset_sound_region(running_machine *machine)
+static void reset_sound_region(running_machine &machine)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
- memory_set_bankptr(machine, "bank2", machine->region("soundcpu")->base() + 0x10000 + state->cur_sound_region*0x4000);
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
+ memory_set_bankptr(machine, "bank2", machine.region("soundcpu")->base() + 0x10000 + state->cur_sound_region*0x4000);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
state->cur_sound_region = (data & 0xf);
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
/* sound memory maps
@@ -865,7 +865,7 @@ static STATE_POSTLOAD( mystwarr_postload )
static MACHINE_START( mystwarr )
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
/* set default bankswitch */
state->cur_sound_region = 2;
reset_sound_region(machine);
@@ -874,13 +874,13 @@ static MACHINE_START( mystwarr )
state_save_register_global(machine, state->mw_irq_control);
state_save_register_global(machine, state->cur_sound_region);
- machine->state().register_postload(mystwarr_postload, NULL);
+ machine.state().register_postload(mystwarr_postload, NULL);
}
static MACHINE_RESET(mystwarr)
{
- device_t *k054539_1 = machine->device("konami1");
- device_t *k054539_2 = machine->device("konami2");
+ device_t *k054539_1 = machine.device("konami1");
+ device_t *k054539_2 = machine.device("konami2");
int i;
// soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7)
@@ -896,7 +896,7 @@ static MACHINE_RESET(mystwarr)
static MACHINE_RESET(dadandrn)
{
- device_t *k054539_1 = machine->device("konami1");
+ device_t *k054539_1 = machine.device("konami1");
int i;
// boost voice(chip 0 channel 4-7)
@@ -905,7 +905,7 @@ static MACHINE_RESET(dadandrn)
static MACHINE_RESET(viostorm)
{
- device_t *k054539_1 = machine->device("konami1");
+ device_t *k054539_1 = machine.device("konami1");
int i;
// boost voice(chip 0 channel 4-7)
@@ -914,8 +914,8 @@ static MACHINE_RESET(viostorm)
static MACHINE_RESET(metamrph)
{
- device_t *k054539_1 = machine->device("konami1");
- device_t *k054539_2 = machine->device("konami2");
+ device_t *k054539_1 = machine.device("konami1");
+ device_t *k054539_2 = machine.device("konami2");
int i;
// boost voice(chip 0 channel 4-7) and soften other channels
@@ -930,7 +930,7 @@ static MACHINE_RESET(metamrph)
static MACHINE_RESET(martchmp)
{
- device_t *k054539_1 = machine->device("konami1");
+ device_t *k054539_1 = machine.device("konami1");
int i;
k054539_init_flags(k054539_1, K054539_REVERSE_STEREO);
@@ -941,7 +941,7 @@ static MACHINE_RESET(martchmp)
static MACHINE_RESET(gaiapols)
{
- device_t *k054539_1 = machine->device("konami1");
+ device_t *k054539_1 = machine.device("konami1");
int i;
// boost voice(chip 0 channel 5-7)
diff --git a/src/mame/drivers/n8080.c b/src/mame/drivers/n8080.c
index e1e6066422d..f0379fcd3b7 100644
--- a/src/mame/drivers/n8080.c
+++ b/src/mame/drivers/n8080.c
@@ -19,19 +19,19 @@
static WRITE8_HANDLER( n8080_shift_bits_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
state->shift_bits = data & 7;
}
static WRITE8_HANDLER( n8080_shift_data_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
state->shift_data = (state->shift_data >> 8) | (data << 8);
}
static READ8_HANDLER( n8080_shift_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return state->shift_data >> (8 - state->shift_bits);
}
@@ -393,7 +393,7 @@ INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( rst1_tick )
{
- n8080_state *n8080 = timer.machine->driver_data<n8080_state>();
+ n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
int state = n8080->inte ? ASSERT_LINE : CLEAR_LINE;
/* V7 = 1, V6 = 0 */
@@ -402,7 +402,7 @@ static TIMER_DEVICE_CALLBACK( rst1_tick )
static TIMER_DEVICE_CALLBACK( rst2_tick )
{
- n8080_state *n8080 = timer.machine->driver_data<n8080_state>();
+ n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
int state = n8080->inte ? ASSERT_LINE : CLEAR_LINE;
/* vblank */
@@ -411,7 +411,7 @@ static TIMER_DEVICE_CALLBACK( rst2_tick )
static WRITE_LINE_DEVICE_HANDLER( n8080_inte_callback )
{
- n8080_state *n8080 = device->machine->driver_data<n8080_state>();
+ n8080_state *n8080 = device->machine().driver_data<n8080_state>();
n8080->inte = state;
}
@@ -434,9 +434,9 @@ static I8085_CONFIG( n8080_cpu_config )
static MACHINE_START( n8080 )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->shift_data));
state->save_item(NAME(state->shift_bits));
@@ -464,7 +464,7 @@ static MACHINE_START( helifire )
static MACHINE_RESET( n8080 )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->shift_data = 0;
state->shift_bits = 0;
@@ -473,7 +473,7 @@ static MACHINE_RESET( n8080 )
static MACHINE_RESET( spacefev )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
MACHINE_RESET_CALL(n8080);
MACHINE_RESET_CALL(spacefev_sound);
@@ -484,7 +484,7 @@ static MACHINE_RESET( spacefev )
static MACHINE_RESET( sheriff )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
MACHINE_RESET_CALL(n8080);
MACHINE_RESET_CALL(sheriff_sound);
@@ -495,7 +495,7 @@ static MACHINE_RESET( sheriff )
static MACHINE_RESET( helifire )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
MACHINE_RESET_CALL(n8080);
MACHINE_RESET_CALL(helifire_sound);
diff --git a/src/mame/drivers/namcofl.c b/src/mame/drivers/namcofl.c
index d83915284e7..021407703fc 100644
--- a/src/mame/drivers/namcofl.c
+++ b/src/mame/drivers/namcofl.c
@@ -184,45 +184,45 @@ static READ32_HANDLER( namcofl_sysreg_r )
static WRITE32_HANDLER( namcofl_sysreg_w )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
if ((offset == 2) && ACCESSING_BITS_0_7) // address space configuration
{
if (data == 0) // RAM at 00000000, ROM at 10000000
{
- memory_set_bankptr(space->machine, "bank1", state->workram );
- memory_set_bankptr(space->machine, "bank2", space->machine->region("maincpu")->base() );
+ memory_set_bankptr(space->machine(), "bank1", state->workram );
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region("maincpu")->base() );
}
else // ROM at 00000000, RAM at 10000000
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() );
- memory_set_bankptr(space->machine, "bank2", state->workram );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() );
+ memory_set_bankptr(space->machine(), "bank2", state->workram );
}
}
}
static WRITE32_HANDLER( namcofl_paletteram_w )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
if ((offset == 0x1808/4) && ACCESSING_BITS_16_31)
{
- UINT16 v = space->machine->generic.paletteram.u32[offset] >> 16;
+ UINT16 v = space->machine().generic.paletteram.u32[offset] >> 16;
UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1);
- state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(triggerscanline));
+ state->raster_interrupt_timer->adjust(space->machine().primary_screen->time_until_pos(triggerscanline));
}
}
static READ32_HANDLER( namcofl_share_r )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
return (state->shareram[offset*2+1] << 16) | state->shareram[offset*2];
}
static WRITE32_HANDLER( namcofl_share_w )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
COMBINE_DATA(state->shareram+offset*2);
data >>= 16;
mem_mask >>= 16;
@@ -252,7 +252,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( mcu_shared_w )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
// HACK! Many games data ROM routines redirect the vector from the sound command read to an RTS.
// This needs more investigation. nebulray and vshoot do NOT do this.
// Timers A2 and A3 are set up in "external input counter" mode, this may be related.
@@ -275,32 +275,32 @@ static WRITE16_HANDLER( mcu_shared_w )
static READ8_HANDLER( port6_r )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
return state->mcu_port6;
}
static WRITE8_HANDLER( port6_w )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
state->mcu_port6 = data;
}
static READ8_HANDLER( port7_r )
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
switch (state->mcu_port6 & 0xf0)
{
case 0x00:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x20:
- return input_port_read(space->machine, "MISC");
+ return input_port_read(space->machine(), "MISC");
case 0x40:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x60:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
default:
break;
@@ -311,17 +311,17 @@ static READ8_HANDLER( port7_r )
static READ8_HANDLER(dac7_r)
{
- return input_port_read_safe(space->machine, "ACCEL", 0xff);
+ return input_port_read_safe(space->machine(), "ACCEL", 0xff);
}
static READ8_HANDLER(dac6_r)
{
- return input_port_read_safe(space->machine, "BRAKE", 0xff);
+ return input_port_read_safe(space->machine(), "BRAKE", 0xff);
}
static READ8_HANDLER(dac5_r)
{
- return input_port_read_safe(space->machine, "WHEEL", 0xff);
+ return input_port_read_safe(space->machine(), "WHEEL", 0xff);
}
static READ8_HANDLER(dac4_r) { return 0xff; }
@@ -535,23 +535,23 @@ GFXDECODE_END
static TIMER_CALLBACK( network_interrupt_callback )
{
cputag_set_input_line(machine, "maincpu", I960_IRQ0, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->frame_period(), FUNC(network_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(network_interrupt_callback));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
cputag_set_input_line(machine, "maincpu", I960_IRQ2, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->frame_period(), FUNC(vblank_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(vblank_interrupt_callback));
}
static TIMER_CALLBACK( raster_interrupt_callback )
{
- namcofl_state *state = machine->driver_data<namcofl_state>();
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ namcofl_state *state = machine.driver_data<namcofl_state>();
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
cputag_set_input_line(machine, "maincpu", I960_IRQ1, ASSERT_LINE);
- state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period());
+ state->raster_interrupt_timer->adjust(machine.primary_screen->frame_period());
}
static INTERRUPT_GEN( mcu_interrupt )
@@ -572,18 +572,18 @@ static INTERRUPT_GEN( mcu_interrupt )
static MACHINE_START( namcofl )
{
- namcofl_state *state = machine->driver_data<namcofl_state>();
- state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC(raster_interrupt_callback));
+ namcofl_state *state = machine.driver_data<namcofl_state>();
+ state->raster_interrupt_timer = machine.scheduler().timer_alloc(FUNC(raster_interrupt_callback));
}
static MACHINE_RESET( namcofl )
{
- namcofl_state *state = machine->driver_data<namcofl_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback));
+ namcofl_state *state = machine.driver_data<namcofl_state>();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(machine.primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback));
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() );
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() );
memory_set_bankptr(machine, "bank2", state->workram );
memset(state->workram, 0x00, 0x100000);
@@ -807,12 +807,12 @@ ROM_START( finalaprj )
ROM_LOAD("finalapr.nv", 0x000000, 0x2000, CRC(d51d65fe) SHA1(8a0a523cb6ba2880951e41ca04db23584f0a108c) )
ROM_END
-static void namcofl_common_init(running_machine *machine)
+static void namcofl_common_init(running_machine &machine)
{
- namcofl_state *state = machine->driver_data<namcofl_state>();
+ namcofl_state *state = machine.driver_data<namcofl_state>();
state->workram = auto_alloc_array(machine, UINT32, 0x100000/4);
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() );
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() );
memory_set_bankptr(machine, "bank2", state->workram );
}
diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c
index c4af9dbb7f6..78a4c466d0e 100644
--- a/src/mame/drivers/namcoic.c
+++ b/src/mame/drivers/namcoic.c
@@ -24,7 +24,7 @@ static struct
UINT16 *videoram;
int gfxbank;
UINT8 *maskBaseAddr;
- void (*cb)( running_machine *machine, UINT16 code, int *gfx, int *mask);
+ void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask);
} mTilemapInfo;
void namco_tilemap_invalidate( void )
@@ -36,7 +36,7 @@ void namco_tilemap_invalidate( void )
}
} /* namco_tilemap_invalidate */
-INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT16 *vram)
+INLINE void get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,UINT16 *vram)
{
int tile, mask;
mTilemapInfo.cb( machine, vram[tile_index], &tile, &mask );
@@ -52,8 +52,8 @@ static TILE_GET_INFO( get_tile_info4 ) { get_tile_info(machine,tileinfo,tile_ind
static TILE_GET_INFO( get_tile_info5 ) { get_tile_info(machine,tileinfo,tile_index,&mTilemapInfo.videoram[0x4408]); }
void
-namco_tilemap_init( running_machine *machine, int gfxbank, void *maskBaseAddr,
- void (*cb)( running_machine *machine, UINT16 code, int *gfx, int *mask) )
+namco_tilemap_init( running_machine &machine, int gfxbank, void *maskBaseAddr,
+ void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) )
{
int i;
mTilemapInfo.gfxbank = gfxbank;
@@ -275,8 +275,8 @@ static void zdrawgfxzoom(
{
if( gfx )
{
- int shadow_offset = (gfx->machine->config().m_video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine->total_colors():0;
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ int shadow_offset = (gfx->machine().config().m_video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine().total_colors():0;
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
@@ -341,7 +341,7 @@ static void zdrawgfxzoom(
if( ex>sx )
{ /* skip if inner loop doesn't draw anything */
int y;
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
if( priority_bitmap )
{
for( y=sy; y<ey; y++ )
@@ -411,13 +411,13 @@ static void zdrawgfxzoom(
} /* zdrawgfxzoom */
void
-namcos2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control )
+namcos2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control )
{
int offset = (control & 0x000f) * (128*4);
int loop;
if( pri==0 )
{
- bitmap_fill( machine->priority_bitmap, cliprect , 0);
+ bitmap_fill( machine.priority_bitmap, cliprect , 0);
}
for( loop=0; loop < 128; loop++ )
{
@@ -467,7 +467,7 @@ namcos2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle
int scaley = (sizey<<16)/((word0&0x0200)?0x20:0x10);
if(scalex && scaley)
{
- gfx_element *gfx = machine->gfx[rgn];
+ gfx_element *gfx = machine.gfx[rgn];
if( (word0&0x0200)==0 )
gfx_element_set_source_clip(gfx, (word1&0x0001) ? 16 : 0, 16, (word1&0x0002) ? 16 : 0, 16);
@@ -491,7 +491,7 @@ namcos2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle
} /* namcos2_draw_sprites */
void
-namcos2_draw_sprites_metalhawk(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+namcos2_draw_sprites_metalhawk(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
/**
* word#0
@@ -528,7 +528,7 @@ namcos2_draw_sprites_metalhawk(running_machine *machine, bitmap_t *bitmap, const
int loop;
if( pri==0 )
{
- bitmap_fill( machine->priority_bitmap, cliprect , 0);
+ bitmap_fill( machine.priority_bitmap, cliprect , 0);
}
for( loop=0; loop < 128; loop++ )
{
@@ -611,7 +611,7 @@ namcos2_draw_sprites_metalhawk(running_machine *machine, bitmap_t *bitmap, const
zdrawgfxzoom(
bitmap,
&rect,
- machine->gfx[0],
+ machine.gfx[0],
sprn, color,
flipx,flipy,
sx,sy,
@@ -703,7 +703,7 @@ nth_byte32( const UINT32 *pSource, int which )
/**************************************************************************************************************/
-static int (*mpCodeToTile)( running_machine *machine, int code ); /* sprite banking callback */
+static int (*mpCodeToTile)( running_machine &machine, int code ); /* sprite banking callback */
static int mGfxC355; /* gfx bank for sprites */
/**
@@ -717,9 +717,9 @@ static int mGfxC355; /* gfx bank for sprites */
* 0x14000 sprite list (page1)
*/
static void
-draw_spriteC355(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *pSource, int pri, int zpos )
+draw_spriteC355(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *pSource, int pri, int zpos )
{
- UINT16 *spriteram16 = machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = machine.generic.spriteram.u16;
unsigned screen_height_remaining, screen_width_remaining;
unsigned source_height_remaining, source_width_remaining;
int hpos,vpos;
@@ -876,7 +876,7 @@ draw_spriteC355(running_machine *machine, bitmap_t *bitmap, const rectangle *cli
zdrawgfxzoom(
bitmap,
&clip,
- machine->gfx[mGfxC355],
+ machine.gfx[mGfxC355],
mpCodeToTile(machine, tile) + offset,
color,
flipx,flipy,
@@ -900,13 +900,13 @@ draw_spriteC355(running_machine *machine, bitmap_t *bitmap, const rectangle *cli
} /* draw_spriteC355 */
-static int DefaultCodeToTile( running_machine *machine, int code )
+static int DefaultCodeToTile( running_machine &machine, int code )
{
return code;
}
void
-namco_obj_init( running_machine *machine, int gfxbank, int palXOR, int (*codeToTile)( running_machine *machine, int code ) )
+namco_obj_init( running_machine &machine, int gfxbank, int palXOR, int (*codeToTile)( running_machine &machine, int code ) )
{
mGfxC355 = gfxbank;
mPalXOR = palXOR;
@@ -918,13 +918,13 @@ namco_obj_init( running_machine *machine, int gfxbank, int palXOR, int (*codeToT
{
mpCodeToTile = DefaultCodeToTile;
}
- machine->generic.spriteram.u16 = auto_alloc_array(machine, UINT16, 0x20000/2);
- memset( machine->generic.spriteram.u16, 0, 0x20000 ); /* needed for Nebulas Ray */
+ machine.generic.spriteram.u16 = auto_alloc_array(machine, UINT16, 0x20000/2);
+ memset( machine.generic.spriteram.u16, 0, 0x20000 ); /* needed for Nebulas Ray */
memset( mSpritePos,0x00,sizeof(mSpritePos) );
} /* namcosC355_init */
static void
-DrawObjectList(running_machine *machine,
+DrawObjectList(running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
int pri,
@@ -942,36 +942,36 @@ DrawObjectList(running_machine *machine,
} /* DrawObjectList */
void
-namco_obj_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+namco_obj_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
// int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
if( pri==0 )
{
- bitmap_fill( machine->priority_bitmap, cliprect , 0);
+ bitmap_fill( machine.priority_bitmap, cliprect , 0);
}
// if( offs==0 )
{ /* boot */
- DrawObjectList(machine, bitmap,cliprect,pri,&machine->generic.spriteram.u16[0x02000/2], &machine->generic.spriteram.u16[0x00000/2] );
+ DrawObjectList(machine, bitmap,cliprect,pri,&machine.generic.spriteram.u16[0x02000/2], &machine.generic.spriteram.u16[0x00000/2] );
}
// else
{
- DrawObjectList(machine, bitmap,cliprect,pri,&machine->generic.spriteram.u16[0x14000/2], &machine->generic.spriteram.u16[0x10000/2] );
+ DrawObjectList(machine, bitmap,cliprect,pri,&machine.generic.spriteram.u16[0x14000/2], &machine.generic.spriteram.u16[0x10000/2] );
}
} /* namco_obj_draw */
WRITE16_HANDLER( namco_obj16_w )
{
- COMBINE_DATA( &space->machine->generic.spriteram.u16[offset] );
+ COMBINE_DATA( &space->machine().generic.spriteram.u16[offset] );
} /* namco_obj16_w */
READ16_HANDLER( namco_obj16_r )
{
- return space->machine->generic.spriteram.u16[offset];
+ return space->machine().generic.spriteram.u16[offset];
} /* namco_obj16_r */
WRITE32_HANDLER( namco_obj32_w )
{
- UINT16 *spriteram16 = space->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = space->machine().generic.spriteram.u16;
UINT32 v;
offset *= 2;
v = (spriteram16[offset]<<16)|spriteram16[offset+1];
@@ -982,14 +982,14 @@ WRITE32_HANDLER( namco_obj32_w )
READ32_HANDLER( namco_obj32_r )
{
- UINT16 *spriteram16 = space->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = space->machine().generic.spriteram.u16;
offset *= 2;
return (spriteram16[offset]<<16)|spriteram16[offset+1];
} /* namco_obj32_r */
WRITE32_HANDLER( namco_obj32_le_w )
{
- UINT16 *spriteram16 = space->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = space->machine().generic.spriteram.u16;
UINT32 v;
offset *= 2;
v = (spriteram16[offset+1]<<16)|spriteram16[offset];
@@ -1000,7 +1000,7 @@ WRITE32_HANDLER( namco_obj32_le_w )
READ32_HANDLER( namco_obj32_le_r )
{
- UINT16 *spriteram16 = space->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = space->machine().generic.spriteram.u16;
offset *= 2;
return (spriteram16[offset+1]<<16)|spriteram16[offset];
} /* namco_obj32_r */
@@ -1030,7 +1030,7 @@ static const char * mRozMaskRegion;
* Graphics ROM addressing varies across games.
*/
static void
-roz_get_info( running_machine *machine, tile_data *tileinfo, int tile_index, int which)
+roz_get_info( running_machine &machine, tile_data *tileinfo, int tile_index, int which)
{
UINT16 tile = rozvideoram16[tile_index];
int bank, mangle;
@@ -1091,7 +1091,7 @@ roz_get_info( running_machine *machine, tile_data *tileinfo, int tile_index, int
break;
}
SET_TILE_INFO( mRozGfxBank,mangle,0/*color*/,0/*flag*/ );
- tileinfo->mask_data = 32*tile + (UINT8 *)machine->region( mRozMaskRegion )->base();
+ tileinfo->mask_data = 32*tile + (UINT8 *)machine.region( mRozMaskRegion )->base();
} /* roz_get_info */
static
@@ -1118,7 +1118,7 @@ TILEMAP_MAPPER( namco_roz_scan )
} /* namco_roz_scan*/
void
-namco_roz_init( running_machine *machine, int gfxbank, const char * maskregion )
+namco_roz_init( running_machine &machine, int gfxbank, const char * maskregion )
{
int i;
static const tile_get_info_func roz_info[ROZ_TILEMAP_COUNT] =
@@ -1566,12 +1566,12 @@ WRITE16_HANDLER( namco_road16_w )
else
{
offset -= 0x10000/2;
- gfx_element_mark_dirty(space->machine->gfx[mRoadGfxBank], offset/WORDS_PER_ROAD_TILE);
+ gfx_element_mark_dirty(space->machine().gfx[mRoadGfxBank], offset/WORDS_PER_ROAD_TILE);
}
}
void
-namco_road_init(running_machine *machine, int gfxbank )
+namco_road_init(running_machine &machine, int gfxbank )
{
gfx_element *pGfx;
@@ -1582,7 +1582,7 @@ namco_road_init(running_machine *machine, int gfxbank )
pGfx = gfx_element_alloc( machine, &RoadTileLayout, 0x10000+(UINT8 *)mpRoadRAM, 0x3f, 0xf00);
- machine->gfx[gfxbank] = pGfx;
+ machine.gfx[gfxbank] = pGfx;
mpRoadTilemap = tilemap_create(machine,
get_road_info,tilemap_scan_rows,
ROAD_TILE_SIZE,ROAD_TILE_SIZE,
@@ -1599,9 +1599,9 @@ namco_road_set_transparent_color(pen_t pen)
}
void
-namco_road_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+namco_road_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- const UINT8 *clut = (const UINT8 *)machine->region("user3")->base();
+ const UINT8 *clut = (const UINT8 *)machine.region("user3")->base();
bitmap_t *pSourceBitmap;
unsigned yscroll;
int i;
@@ -1660,7 +1660,7 @@ namco_road_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cli
{
int pen = pSourceGfx[sourcex>>16];
- if(colortable_entry_get_value(machine->colortable, pen) != mRoadTransparentColor)
+ if(colortable_entry_get_value(machine.colortable, pen) != mRoadTransparentColor)
{
if( clut )
{
diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c
index 9f7340d54f3..99f73eb236e 100644
--- a/src/mame/drivers/namcona1.c
+++ b/src/mame/drivers/namcona1.c
@@ -203,7 +203,7 @@ static const UINT8 CgangpzlDefaultNvMem[] =
static NVRAM_HANDLER( namcosna1 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
if( read_or_write )
{
file->write( state->nvmem, NA1_NVRAM_SIZE );
@@ -238,13 +238,13 @@ static NVRAM_HANDLER( namcosna1 )
static READ16_HANDLER( namcona1_nvram_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->nvmem[offset];
} /* namcona1_nvram_r */
static WRITE16_HANDLER( namcona1_nvram_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
if( ACCESSING_BITS_0_7 )
{
state->nvmem[offset] = data&0xff;
@@ -369,9 +369,9 @@ INPUT_PORTS_END
/***************************************************************************/
/* FIXME: These two functions shouldn't be necessary? */
-static void simulate_mcu( running_machine *machine )
+static void simulate_mcu( running_machine &machine )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
state->workram[0xf60/2] = 0x0000; /* mcu ready */
}
@@ -403,13 +403,13 @@ static void write_version_info( namcona1_state *state )
*/
static READ16_HANDLER( custom_key_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
int old_count;
old_count = state->count;
do
{
- state->count = space->machine->rand();
+ state->count = space->machine().rand();
} while( old_count == state->count );
switch( state->gametype )
@@ -481,7 +481,7 @@ static READ16_HANDLER( custom_key_r )
default:
return 0;
}
- return space->machine->rand()&0xffff;
+ return space->machine().rand()&0xffff;
} /* custom_key_r */
static WRITE16_HANDLER( custom_key_w )
@@ -492,15 +492,15 @@ static WRITE16_HANDLER( custom_key_w )
static READ16_HANDLER( namcona1_vreg_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->vreg[offset];
} /* namcona1_vreg_r */
-static int transfer_dword( running_machine *machine, UINT32 dest, UINT32 source )
+static int transfer_dword( running_machine &machine, UINT32 dest, UINT32 source )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 data;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if( source>=0x400000 && source<0xc00000 )
{
@@ -614,9 +614,9 @@ static void blit_setup( int format, int *bytes_per_row, int *pitch, int mode )
}
} /* blit_setup */
-static void namcona1_blit( running_machine *machine )
+static void namcona1_blit( running_machine &machine )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
int src0 = state->vreg[0x0];
int src1 = state->vreg[0x1];
int src2 = state->vreg[0x2];
@@ -643,7 +643,7 @@ static void namcona1_blit( running_machine *machine )
(void)src0;
/*
logerror( "%s: blt(%08x,%08x,numBytes=%04x);src=%04x %04x %04x; dst=%04x %04x %04x; gfx=%04x\n",
- machine->describe_context(),
+ machine.describe_context(),
dst_baseaddr,src_baseaddr,num_bytes,
src0,src1,src2,
dst0,dst1,dst2,
@@ -694,13 +694,13 @@ static void namcona1_blit( running_machine *machine )
static WRITE16_HANDLER( namcona1_vreg_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
COMBINE_DATA( &state->vreg[offset] );
switch( offset )
{
case 0x18/2:
- namcona1_blit(space->machine);
+ namcona1_blit(space->machine());
/* see also 0x1e */
break;
@@ -717,17 +717,17 @@ static WRITE16_HANDLER( namcona1_vreg_w )
static READ16_HANDLER( mcu_mailbox_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->mcu_mailbox[offset%8];
}
static WRITE16_HANDLER( mcu_mailbox_w_68k )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
// logerror("mailbox_w_68k: %x @ %x\n", data, offset);
if (offset == 4)
- cputag_set_input_line(space->machine, "mcu", M37710_LINE_IRQ0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "mcu", M37710_LINE_IRQ0, HOLD_LINE);
COMBINE_DATA(&state->mcu_mailbox[offset%8]);
@@ -742,7 +742,7 @@ static WRITE16_HANDLER( mcu_mailbox_w_68k )
static WRITE16_HANDLER( mcu_mailbox_w_mcu )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
COMBINE_DATA(&state->mcu_mailbox[offset%8]);
}
@@ -789,7 +789,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( na1mcu_shared_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
UINT16 data;
data = state->workram[offset];
@@ -806,7 +806,7 @@ static READ16_HANDLER( na1mcu_shared_r )
static WRITE16_HANDLER( na1mcu_shared_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
mem_mask = FLIPENDIAN_INT16(mem_mask);
data = FLIPENDIAN_INT16(data);
@@ -846,19 +846,19 @@ ADDRESS_MAP_END
// port 4: bit 3 (0x08) enables the 68000 (see the 68k launch code at c604 in swcourt's BIOS)
static READ8_HANDLER( port4_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->mcu_port4;
}
static WRITE8_HANDLER( port4_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
if ((data & 0x08) && !(state->mcu_port4 & 0x08))
{
logerror("launching 68k, PC=%x\n", cpu_get_pc(space->cpu));
// reset and launch the 68k
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, CLEAR_LINE);
}
state->mcu_port4 = data;
@@ -867,13 +867,13 @@ static WRITE8_HANDLER( port4_w )
// port 5: not sure yet, but MCU code requires this interaction at least
static READ8_HANDLER( port5_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->mcu_port5;
}
static WRITE8_HANDLER( port5_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
state->mcu_port5 = data;
// bit 0 must mirror bit 1 - this is checked at CCD3 in the C69 BIOS
@@ -888,26 +888,26 @@ static READ8_HANDLER( port6_r )
static WRITE8_HANDLER( port6_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
state->mcu_port6 = data;
}
static READ8_HANDLER( port7_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
switch (state->mcu_port6 & 0xe0)
{
case 0x40:
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
case 0x60:
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
case 0x20:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x00:
- return input_port_read(space->machine, "P4");
+ return input_port_read(space->machine(), "P4");
}
return 0xff;
@@ -920,27 +920,27 @@ static WRITE8_HANDLER( port7_w )
// port 8: bit 5 (0x20) toggles, watchdog?
static READ8_HANDLER( port8_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
return state->mcu_port8;
}
static WRITE8_HANDLER( port8_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
state->mcu_port8 = data;
}
static MACHINE_START( namcona1 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
- c140_set_base(machine->device("c140"), state->workram);
+ namcona1_state *state = machine.driver_data<namcona1_state>();
+ c140_set_base(machine.device("c140"), state->workram);
}
// for games with the MCU emulated, the MCU boots the 68000. don't allow it before that.
static MACHINE_RESET( namcona1_mcu )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE);
state->mcu_port5 = 1;
@@ -959,7 +959,7 @@ static MACHINE_RESET( namcona1_mcu )
static READ8_HANDLER( portana_r )
{
static const UINT8 bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 };
- UINT8 port = input_port_read(space->machine, "P3");
+ UINT8 port = input_port_read(space->machine(), "P3");
return (port & bitnum[offset>>1]) ? 0xff : 0x00;
}
@@ -976,11 +976,11 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( namcona1_interrupt )
{
- namcona1_state *state = device->machine->driver_data<namcona1_state>();
+ namcona1_state *state = device->machine().driver_data<namcona1_state>();
int level = cpu_getiloops(device); /* 0,1,2,3,4 */
if( level==0 )
{
- simulate_mcu( device->machine );
+ simulate_mcu( device->machine() );
}
if( state->mEnableInterrupts )
{
@@ -991,7 +991,7 @@ static INTERRUPT_GEN( namcona1_interrupt )
int scanline = state->vreg[0x8a/2]&0xff;
if( scanline )
{
- device->machine->primary_screen->update_partial(scanline );
+ device->machine().primary_screen->update_partial(scanline );
}
}
device_set_input_line(device, level+1, HOLD_LINE);
@@ -1082,10 +1082,10 @@ static MACHINE_CONFIG_DERIVED( namcona2, namcona1 )
MACHINE_CONFIG_END
-static void init_namcona1( running_machine *machine, int gametype )
+static void init_namcona1( running_machine &machine, int gametype )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
- UINT16 *pMem = (UINT16 *)machine->region( "maincpu" )->base();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
+ UINT16 *pMem = (UINT16 *)machine.region( "maincpu" )->base();
state->gametype = gametype;
state->mpBank0 = &pMem[0x80000/2];
diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c
index 157701359bb..c4669ac9f6e 100644
--- a/src/mame/drivers/namconb1.c
+++ b/src/mame/drivers/namconb1.c
@@ -285,18 +285,18 @@ GFX: Custom 145 ( 80 pin PQFP)
static TIMER_CALLBACK( namconb1_TriggerPOSIRQ )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
if(state->pos_irq_active || !(state->namconb_cpureg[0x02] & 0xf0))
return;
- machine->primary_screen->update_partial(param);
+ machine.primary_screen->update_partial(param);
state->pos_irq_active = 1;
cputag_set_input_line(machine, "maincpu", state->namconb_cpureg[0x02] & 0xf, ASSERT_LINE);
}
static INTERRUPT_GEN( namconb1_interrupt )
{
- namconb1_state *state = device->machine->driver_data<namconb1_state>();
+ namconb1_state *state = device->machine().driver_data<namconb1_state>();
/**
* 400000 0x00
* 400001 0x00
@@ -331,7 +331,7 @@ static INTERRUPT_GEN( namconb1_interrupt )
* 40001e 0x00
* 40001f 0x00
*/
- int scanline = (device->machine->generic.paletteram.u32[0x1808/4]&0xffff)-32;
+ int scanline = (device->machine().generic.paletteram.u32[0x1808/4]&0xffff)-32;
if((!state->vblank_irq_active) && (state->namconb_cpureg[0x04] & 0xf0)) {
device_set_input_line(device, state->namconb_cpureg[0x04] & 0xf, ASSERT_LINE);
@@ -344,7 +344,7 @@ static INTERRUPT_GEN( namconb1_interrupt )
}
if( scanline < NAMCONB1_VBSTART )
{
- device->machine->scheduler().timer_set( device->machine->primary_screen->time_until_pos(scanline), FUNC(namconb1_TriggerPOSIRQ ), scanline);
+ device->machine().scheduler().timer_set( device->machine().primary_screen->time_until_pos(scanline), FUNC(namconb1_TriggerPOSIRQ ), scanline);
}
} /* namconb1_interrupt */
@@ -366,15 +366,15 @@ static INTERRUPT_GEN( mcu_interrupt )
static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
- machine->primary_screen->update_partial(param);
+ namconb1_state *state = machine.driver_data<namconb1_state>();
+ machine.primary_screen->update_partial(param);
state->pos_irq_active = 1;
cputag_set_input_line(machine, "maincpu", state->namconb_cpureg[0x02], ASSERT_LINE);
}
static INTERRUPT_GEN( namconb2_interrupt )
{
- namconb1_state *state = device->machine->driver_data<namconb1_state>();
+ namconb1_state *state = device->machine().driver_data<namconb1_state>();
/**
* f00000 0x01 // VBLANK irq level
* f00001 0x00
@@ -404,7 +404,7 @@ static INTERRUPT_GEN( namconb2_interrupt )
* f0001e 0x00
* f0001f 0x01
*/
- int scanline = (device->machine->generic.paletteram.u32[0x1808/4]&0xffff)-32;
+ int scanline = (device->machine().generic.paletteram.u32[0x1808/4]&0xffff)-32;
if((!state->vblank_irq_active) && state->namconb_cpureg[0x00]) {
device_set_input_line(device, state->namconb_cpureg[0x00], ASSERT_LINE);
@@ -415,12 +415,12 @@ static INTERRUPT_GEN( namconb2_interrupt )
scanline = 0;
if( scanline < NAMCONB1_VBSTART )
- device->machine->scheduler().timer_set( device->machine->primary_screen->time_until_pos(scanline), FUNC(namconb2_TriggerPOSIRQ ), scanline);
+ device->machine().scheduler().timer_set( device->machine().primary_screen->time_until_pos(scanline), FUNC(namconb2_TriggerPOSIRQ ), scanline);
} /* namconb2_interrupt */
-static void namconb1_cpureg8_w(running_machine *machine, int reg, UINT8 data)
+static void namconb1_cpureg8_w(running_machine &machine, int reg, UINT8 data)
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
UINT8 prev = state->namconb_cpureg[reg];
state->namconb_cpureg[reg] = data;
switch(reg) {
@@ -475,19 +475,19 @@ static void namconb1_cpureg8_w(running_machine *machine, int reg, UINT8 data)
static WRITE32_HANDLER( namconb1_cpureg_w )
{
if(mem_mask & 0xff000000)
- namconb1_cpureg8_w(space->machine, offset*4, data >> 24);
+ namconb1_cpureg8_w(space->machine(), offset*4, data >> 24);
if(mem_mask & 0x00ff0000)
- namconb1_cpureg8_w(space->machine, offset*4+1, data >> 16);
+ namconb1_cpureg8_w(space->machine(), offset*4+1, data >> 16);
if(mem_mask & 0x0000ff00)
- namconb1_cpureg8_w(space->machine, offset*4+2, data >> 8);
+ namconb1_cpureg8_w(space->machine(), offset*4+2, data >> 8);
if(mem_mask & 0x000000ff)
- namconb1_cpureg8_w(space->machine, offset*4+3, data);
+ namconb1_cpureg8_w(space->machine(), offset*4+3, data);
}
-static void namconb2_cpureg8_w(running_machine *machine, int reg, UINT8 data)
+static void namconb2_cpureg8_w(running_machine &machine, int reg, UINT8 data)
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
UINT8 prev = state->namconb_cpureg[reg];
state->namconb_cpureg[reg] = data;
switch(reg) {
@@ -543,18 +543,18 @@ static void namconb2_cpureg8_w(running_machine *machine, int reg, UINT8 data)
static WRITE32_HANDLER( namconb2_cpureg_w )
{
if(mem_mask & 0xff000000)
- namconb2_cpureg8_w(space->machine, offset*4, data >> 24);
+ namconb2_cpureg8_w(space->machine(), offset*4, data >> 24);
if(mem_mask & 0x00ff0000)
- namconb2_cpureg8_w(space->machine, offset*4+1, data >> 16);
+ namconb2_cpureg8_w(space->machine(), offset*4+1, data >> 16);
if(mem_mask & 0x0000ff00)
- namconb2_cpureg8_w(space->machine, offset*4+2, data >> 8);
+ namconb2_cpureg8_w(space->machine(), offset*4+2, data >> 8);
if(mem_mask & 0x000000ff)
- namconb2_cpureg8_w(space->machine, offset*4+3, data);
+ namconb2_cpureg8_w(space->machine(), offset*4+3, data);
}
static READ32_HANDLER(namconb_cpureg_r)
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
return (state->namconb_cpureg[offset*4] << 24) | (state->namconb_cpureg[offset*4+1] << 16)
| (state->namconb_cpureg[offset*4+2] << 8) | state->namconb_cpureg[offset*4+3];
}
@@ -564,7 +564,7 @@ static READ32_HANDLER(namconb_cpureg_r)
static NVRAM_HANDLER( namconb1 )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
int i;
UINT8 data[4];
if( read_or_write )
@@ -602,7 +602,7 @@ static NVRAM_HANDLER( namconb1 )
static MACHINE_START(namconb)
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
state->vblank_irq_active = 0;
state->pos_irq_active = 0;
memset(state->namconb_cpureg, 0, sizeof(state->namconb_cpureg));
@@ -610,7 +610,7 @@ static MACHINE_START(namconb)
static DRIVER_INIT( nebulray )
{
- UINT8 *pMem = (UINT8 *)machine->region(NAMCONB1_TILEMASKREGION)->base();
+ UINT8 *pMem = (UINT8 *)machine.region(NAMCONB1_TILEMASKREGION)->base();
size_t numBytes = (0xfe7-0xe6f)*8;
memset( &pMem[0xe6f*8], 0, numBytes );
@@ -664,12 +664,12 @@ static DRIVER_INIT( outfxies )
static READ32_HANDLER( custom_key_r )
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
UINT16 old_count = state->count;
do
{ /* pick a random number, but don't pick the same twice in a row */
- state->count = space->machine->rand();
+ state->count = space->machine().rand();
} while( state->count==old_count );
switch( namcos2_gametype )
@@ -816,10 +816,10 @@ static READ32_HANDLER( gunbulet_gun_r )
switch( offset )
{
- case 0: case 1: result = (UINT8)(0x0f + input_port_read(space->machine, "LIGHT1_Y") * 224/255); break; /* Y (p2) */
- case 2: case 3: result = (UINT8)(0x26 + input_port_read(space->machine, "LIGHT1_X") * 288/314); break; /* X (p2) */
- case 4: case 5: result = (UINT8)(0x0f + input_port_read(space->machine, "LIGHT0_Y") * 224/255); break; /* Y (p1) */
- case 6: case 7: result = (UINT8)(0x26 + input_port_read(space->machine, "LIGHT0_X") * 288/314); break; /* X (p1) */
+ case 0: case 1: result = (UINT8)(0x0f + input_port_read(space->machine(), "LIGHT1_Y") * 224/255); break; /* Y (p2) */
+ case 2: case 3: result = (UINT8)(0x26 + input_port_read(space->machine(), "LIGHT1_X") * 288/314); break; /* X (p2) */
+ case 4: case 5: result = (UINT8)(0x0f + input_port_read(space->machine(), "LIGHT0_Y") * 224/255); break; /* Y (p1) */
+ case 6: case 7: result = (UINT8)(0x26 + input_port_read(space->machine(), "LIGHT0_X") * 288/314); break; /* X (p1) */
}
return result<<24;
} /* gunbulet_gun_r */
@@ -827,7 +827,7 @@ static READ32_HANDLER( gunbulet_gun_r )
static
READ32_HANDLER( randgen_r )
{
- return space->machine->rand();
+ return space->machine().rand();
} /* randgen_r */
static
@@ -841,13 +841,13 @@ WRITE32_HANDLER( srand_w )
static READ32_HANDLER(namconb_share_r)
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
return (state->namconb_shareram[offset*2] << 16) | state->namconb_shareram[offset*2+1];
}
static WRITE32_HANDLER(namconb_share_w)
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
COMBINE_DATA(state->namconb_shareram+offset*2+1);
data >>= 16;
mem_mask >>= 16;
@@ -897,7 +897,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( nbmcu_shared_w )
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
// HACK! Many games data ROM routines redirect the vector from the sound command read to an RTS.
// This needs more investigation. nebulray and vshoot do NOT do this.
// Timers A2 and A3 are set up in "external input counter" mode, this may be related.
@@ -927,32 +927,32 @@ ADDRESS_MAP_END
static READ8_HANDLER( port6_r )
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
return state->nbx_port6;
}
static WRITE8_HANDLER( port6_w )
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
state->nbx_port6 = data;
}
static READ8_HANDLER( port7_r )
{
- namconb1_state *state = space->machine->driver_data<namconb1_state>();
+ namconb1_state *state = space->machine().driver_data<namconb1_state>();
switch (state->nbx_port6 & 0xf0)
{
case 0x00:
- return input_port_read_safe(space->machine, "P4", 0xff);
+ return input_port_read_safe(space->machine(), "P4", 0xff);
case 0x20:
- return input_port_read(space->machine, "MISC");
+ return input_port_read(space->machine(), "MISC");
case 0x40:
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
case 0x60:
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
default:
break;
@@ -966,42 +966,42 @@ static READ8_HANDLER( port7_r )
// register full scale, so it works...
static READ8_HANDLER(dac7_r) // bit 7
{
- return input_port_read_safe(space->machine, "P3", 0xff)&0x80;
+ return input_port_read_safe(space->machine(), "P3", 0xff)&0x80;
}
static READ8_HANDLER(dac6_r) // bit 3
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<1)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<1)&0x80;
}
static READ8_HANDLER(dac5_r) // bit 2
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<2)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<2)&0x80;
}
static READ8_HANDLER(dac4_r) // bit 1
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<3)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<3)&0x80;
}
static READ8_HANDLER(dac3_r) // bit 0
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<4)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<4)&0x80;
}
static READ8_HANDLER(dac2_r) // bit 4
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<5)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<5)&0x80;
}
static READ8_HANDLER(dac1_r) // bit 5
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<6)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<6)&0x80;
}
static READ8_HANDLER(dac0_r) // bit 6
{
- return (input_port_read_safe(space->machine, "P3", 0xff)<<7)&0x80;
+ return (input_port_read_safe(space->machine(), "P3", 0xff)<<7)&0x80;
}
static ADDRESS_MAP_START( namcoc75_io, AS_IO, 8 )
diff --git a/src/mame/drivers/namcond1.c b/src/mame/drivers/namcond1.c
index 02071926029..2cbe3ec614c 100644
--- a/src/mame/drivers/namcond1.c
+++ b/src/mame/drivers/namcond1.c
@@ -222,13 +222,13 @@ GFXDECODE_END
static WRITE16_HANDLER( sharedram_sub_w )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
COMBINE_DATA(&state->shared_ram[offset]);
}
static READ16_HANDLER( sharedram_sub_r )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
return state->shared_ram[offset];
}
@@ -245,7 +245,7 @@ static READ8_HANDLER( mcu_pa_read )
static WRITE8_HANDLER( mcu_pa_write )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
state->p8 = data;
}
@@ -269,7 +269,7 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( mcu_interrupt )
{
- namcond1_state *state = device->machine->driver_data<namcond1_state>();
+ namcond1_state *state = device->machine().driver_data<namcond1_state>();
if( state->h8_irq5_enabled )
{
generic_pulse_irq_line(device, H8_IRQ5);
diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c
index c535f3bc516..0a85ccef425 100644
--- a/src/mame/drivers/namcos1.c
+++ b/src/mame/drivers/namcos1.c
@@ -352,7 +352,7 @@ C - uses sub board with support for player 3 and 4 controls
static WRITE8_HANDLER( namcos1_sub_firq_w )
{
- cputag_set_input_line(space->machine, "sub", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", M6809_FIRQ_LINE, ASSERT_LINE);
}
static WRITE8_HANDLER( irq_ack_w )
@@ -369,27 +369,27 @@ static WRITE8_HANDLER( firq_ack_w )
static READ8_HANDLER( dsw_r )
{
- int ret = input_port_read(space->machine, "DIPSW");
+ int ret = input_port_read(space->machine(), "DIPSW");
if (!(offset & 2)) ret >>= 4;
return 0xf0 | ret;
}
static WRITE8_HANDLER( namcos1_coin_w )
{
- coin_lockout_global_w(space->machine, ~data & 1);
- coin_counter_w(space->machine, 0,data & 2);
- coin_counter_w(space->machine, 1,data & 4);
+ coin_lockout_global_w(space->machine(), ~data & 1);
+ coin_counter_w(space->machine(), 0,data & 2);
+ coin_counter_w(space->machine(), 1,data & 4);
}
-static void namcos1_update_DACs(running_machine *machine)
+static void namcos1_update_DACs(running_machine &machine)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
- dac_signed_data_16_w(machine->device("dac"),0x8000 + (state->dac0_value * state->dac0_gain) + (state->dac1_value * state->dac1_gain));
+ namcos1_state *state = machine.driver_data<namcos1_state>();
+ dac_signed_data_16_w(machine.device("dac"),0x8000 + (state->dac0_value * state->dac0_gain) + (state->dac1_value * state->dac1_gain));
}
-void namcos1_init_DACs(running_machine *machine)
+void namcos1_init_DACs(running_machine &machine)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
state->dac0_value = 0;
state->dac1_value = 0;
state->dac0_gain=0x80;
@@ -398,7 +398,7 @@ void namcos1_init_DACs(running_machine *machine)
static WRITE8_HANDLER( namcos1_dac_gain_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
int value;
/* DAC0 (bits 0,2) */
@@ -409,21 +409,21 @@ static WRITE8_HANDLER( namcos1_dac_gain_w )
value = (data >> 3) & 3; /* GAIN2,GAIN3 */
state->dac1_gain = 0x20 * (value+1);
- namcos1_update_DACs(space->machine);
+ namcos1_update_DACs(space->machine());
}
static WRITE8_HANDLER( namcos1_dac0_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
state->dac0_value = data - 0x80; /* shift zero point */
- namcos1_update_DACs(space->machine);
+ namcos1_update_DACs(space->machine());
}
static WRITE8_HANDLER( namcos1_dac1_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
state->dac1_value = data - 0x80; /* shift zero point */
- namcos1_update_DACs(space->machine);
+ namcos1_update_DACs(space->machine());
}
@@ -1061,7 +1061,7 @@ GFXDECODE_END
static void namcos1_sound_interrupt( device_t *device, int irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index 16f33775526..ac37d1af350 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -270,7 +270,7 @@ Utyuu Daisakusen Chocovader Contactee CVC1 Ver.A KC022A
WRITE32_HANDLER( namcos10_bank_w )
{
- memory_set_bank( space->machine, "bank1", data & 0xf );
+ memory_set_bank( space->machine(), "bank1", data & 0xf );
}
class namcos10_state : public psx_state
@@ -306,12 +306,12 @@ static ADDRESS_MAP_START( namcos10_map, AS_PROGRAM, 32 )
AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP
ADDRESS_MAP_END
-static void memm_driver_init( running_machine *machine )
+static void memm_driver_init( running_machine &machine )
{
psx_driver_init(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f300000, 0x1f300003, FUNC(namcos10_bank_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank( 0x1f400000, 0x1f7fffff, "bank1" );
- memory_configure_bank( machine, "bank1", 0, 16, machine->region( "user2" )->base(), 4 * 1024 * 1024 );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f300000, 0x1f300003, FUNC(namcos10_bank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank( 0x1f400000, 0x1f7fffff, "bank1" );
+ memory_configure_bank( machine, "bank1", 0, 16, machine.region( "user2" )->base(), 4 * 1024 * 1024 );
}
UINT8 *nand_base;
@@ -391,32 +391,32 @@ WRITE32_HANDLER( watchdog_w )
{
}
-static void memn_driver_init( running_machine *machine )
+static void memn_driver_init( running_machine &machine )
{
- UINT8 *BIOS = (UINT8 *)machine->region( "user1" )->base();
- nand_base = (UINT8 *)machine->region( "user2" )->base();
+ UINT8 *BIOS = (UINT8 *)machine.region( "user1" )->base();
+ nand_base = (UINT8 *)machine.region( "user2" )->base();
nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1f400000, 0x1f400003, FUNC(nand_status_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f410000, 0x1f410003, FUNC(nand_address1_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f420000, 0x1f420003, FUNC(nand_address2_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f430000, 0x1f430003, FUNC(nand_address3_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f440000, 0x1f440003, FUNC(nand_address4_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1f450000, 0x1f450003, FUNC(nand_data_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(watchdog_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0xbf500000, 0xbf5007d7, FUNC(nand_block_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0xbf500000, 0xbf5007d7, FUNC(nand_block_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1f400000, 0x1f400003, FUNC(nand_status_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f410000, 0x1f410003, FUNC(nand_address1_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f420000, 0x1f420003, FUNC(nand_address2_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f430000, 0x1f430003, FUNC(nand_address3_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f440000, 0x1f440003, FUNC(nand_address4_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1f450000, 0x1f450003, FUNC(nand_data_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(watchdog_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0xbf500000, 0xbf5007d7, FUNC(nand_block_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0xbf500000, 0xbf5007d7, FUNC(nand_block_r) );
psx_driver_init(machine);
}
-static void decrypt_bios( running_machine *machine, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
+static void decrypt_bios( running_machine &machine, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0 )
{
- UINT16 *BIOS = (UINT16 *)machine->region( "user1" )->base();
- int len = machine->region( "user1" )->bytes() / 2;
+ UINT16 *BIOS = (UINT16 *)machine.region( "user1" )->base();
+ int len = machine.region( "user1" )->bytes() / 2;
int i;
for( i = 0; i < len; i++ )
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 323fe321ac5..9d3cb53216d 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -287,7 +287,7 @@ public:
UINT32 m_n_bankoffset;
};
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -296,15 +296,15 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
}
}
static WRITE32_HANDLER( keycus_w )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
- verboselog( space->machine, 1, "keycus_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
COMBINE_DATA( &state->keycus[ offset ] );
}
@@ -312,7 +312,7 @@ static WRITE32_HANDLER( keycus_w )
static READ32_HANDLER( keycus_c406_r )
{
/* todo: verify behaviour */
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
@@ -327,7 +327,7 @@ static READ32_HANDLER( keycus_c406_r )
( ( namcos11_keycus[ 1 ] >> 8 ) & 0xf );
break;
}
- verboselog( space->machine, 1, "keycus_c406_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c406_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
@@ -335,7 +335,7 @@ static READ32_HANDLER( keycus_c406_r )
static READ32_HANDLER( keycus_c409_r )
{
/* todo: verify behaviour */
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 data;
data = state->keycus[ offset ];
@@ -345,14 +345,14 @@ static READ32_HANDLER( keycus_c409_r )
data = ( data & 0x0000ffff ) | 0x000f0000;
break;
}
- verboselog( space->machine, 1, "keycus_c409_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c409_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
/* dunk mania */
static READ32_HANDLER( keycus_c410_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
UINT32 n_value;
@@ -381,14 +381,14 @@ static READ32_HANDLER( keycus_c410_r )
( ( ( n_value / 10000 ) % 10 ) << 16 );
break;
}
- verboselog( space->machine, 1, "keycus_c410_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c410_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
/* prime goal ex */
static READ32_HANDLER( keycus_c411_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
UINT32 n_value;
@@ -416,14 +416,14 @@ static READ32_HANDLER( keycus_c411_r )
break;
}
- verboselog( space->machine, 1, "keycus_c411_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c411_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
/* xevious 3d/g */
static READ32_HANDLER( keycus_c430_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
UINT16 n_value;
@@ -452,14 +452,14 @@ static READ32_HANDLER( keycus_c430_r )
( ( ( n_value / 1 ) % 10 ) << 16 );
break;
}
- verboselog( space->machine, 1, "keycus_c430_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c430_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
/* dancing eyes */
static READ32_HANDLER( keycus_c431_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
UINT16 n_value;
@@ -486,14 +486,14 @@ static READ32_HANDLER( keycus_c431_r )
data = ( data & 0xffff0000 ) | ( ( n_value / 10000 ) % 10 );
break;
}
- verboselog( space->machine, 1, "keycus_c431_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c431_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
/* pocket racer */
static READ32_HANDLER( keycus_c432_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 *namcos11_keycus = state->keycus;
UINT32 data;
UINT16 n_value;
@@ -521,7 +521,7 @@ static READ32_HANDLER( keycus_c432_r )
break;
}
- verboselog( space->machine, 1, "keycus_c432_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c432_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
@@ -529,7 +529,7 @@ static READ32_HANDLER( keycus_c432_r )
static READ32_HANDLER( keycus_c442_r )
{
/* todo: verify behaviour */
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 data;
data = state->keycus[ offset ];
@@ -543,7 +543,7 @@ static READ32_HANDLER( keycus_c442_r )
}
break;
}
- verboselog( space->machine, 1, "keycus_c442_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c442_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
@@ -551,7 +551,7 @@ static READ32_HANDLER( keycus_c442_r )
static READ32_HANDLER( keycus_c443_r )
{
/* todo: verify behaviour */
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT32 data;
data = state->keycus[ offset ];
@@ -577,16 +577,16 @@ static READ32_HANDLER( keycus_c443_r )
}
break;
}
- verboselog( space->machine, 1, "keycus_c443_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "keycus_c443_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
static INTERRUPT_GEN( namcos11_vblank )
{
- namcos11_state *state = device->machine->driver_data<namcos11_state>();
+ namcos11_state *state = device->machine().driver_data<namcos11_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
- if( strcmp( device->machine->system().name, "pocketrc" ) == 0 )
+ if( strcmp( device->machine().system().name, "pocketrc" ) == 0 )
{
if( p_n_psxram[ 0x12c74 / 4 ] == 0x1440fff9 )
{
@@ -603,14 +603,14 @@ static INTERRUPT_GEN( namcos11_vblank )
INLINE void bankswitch_rom8( address_space *space, const char *bank, int n_data )
{
- memory_set_bank( space->machine, bank, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
+ memory_set_bank( space->machine(), bank, ( ( n_data & 0xc0 ) >> 4 ) + ( n_data & 0x03 ) );
}
static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" };
static WRITE32_HANDLER( bankswitch_rom32_w )
{
- verboselog( space->machine, 2, "bankswitch_rom32_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 2, "bankswitch_rom32_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
if( ACCESSING_BITS_0_15 )
{
@@ -624,9 +624,9 @@ static WRITE32_HANDLER( bankswitch_rom32_w )
static WRITE32_HANDLER( bankswitch_rom64_upper_w )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
- verboselog( space->machine, 2, "bankswitch_rom64_upper_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 2, "bankswitch_rom64_upper_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
if( ACCESSING_BITS_0_15 )
{
@@ -640,15 +640,15 @@ static WRITE32_HANDLER( bankswitch_rom64_upper_w )
INLINE void bankswitch_rom64( address_space *space, const char *bank, int n_data )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
/* todo: verify behaviour */
- memory_set_bank( space->machine, bank, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ state->m_n_bankoffset ) );
+ memory_set_bank( space->machine(), bank, ( ( ( ( n_data & 0xc0 ) >> 3 ) + ( n_data & 0x07 ) ) ^ state->m_n_bankoffset ) );
}
static WRITE32_HANDLER( bankswitch_rom64_w )
{
- verboselog( space->machine, 2, "bankswitch_rom64_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 2, "bankswitch_rom64_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
if( ACCESSING_BITS_0_15 )
{
@@ -669,11 +669,11 @@ static WRITE32_HANDLER( lightgun_w )
output_set_value( "recoil0", !( data & 0x02 ) );
output_set_value( "recoil1", !( data & 0x01 ) );
- verboselog( space->machine, 1, "lightgun_w: outputs (%08x %08x)\n", data, mem_mask );
+ verboselog( space->machine(), 1, "lightgun_w: outputs (%08x %08x)\n", data, mem_mask );
}
if( ACCESSING_BITS_16_31 )
{
- verboselog( space->machine, 2, "lightgun_w: start reading (%08x %08x)\n", data, mem_mask );
+ verboselog( space->machine(), 2, "lightgun_w: start reading (%08x %08x)\n", data, mem_mask );
}
}
@@ -683,19 +683,19 @@ static READ32_HANDLER( lightgun_r )
switch( offset )
{
case 0:
- data = input_port_read( space->machine, "GUN1X" );
+ data = input_port_read( space->machine(), "GUN1X" );
break;
case 1:
- data = ( input_port_read( space->machine, "GUN1Y" ) ) | ( ( input_port_read( space->machine, "GUN1Y" ) + 1 ) << 16 );
+ data = ( input_port_read( space->machine(), "GUN1Y" ) ) | ( ( input_port_read( space->machine(), "GUN1Y" ) + 1 ) << 16 );
break;
case 2:
- data = input_port_read( space->machine, "GUN2X" );
+ data = input_port_read( space->machine(), "GUN2X" );
break;
case 3:
- data = ( input_port_read( space->machine, "GUN2Y" ) ) | ( ( input_port_read( space->machine, "GUN2Y" ) + 1 ) << 16 );
+ data = ( input_port_read( space->machine(), "GUN2Y" ) ) | ( ( input_port_read( space->machine(), "GUN2Y" ) + 1 ) << 16 );
break;
}
- verboselog( space->machine, 2, "lightgun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "lightgun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
@@ -732,7 +732,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( c76_shared_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT16 *share16 = (UINT16 *)state->sharedram;
return share16[offset];
@@ -740,7 +740,7 @@ static READ16_HANDLER( c76_shared_r )
static WRITE16_HANDLER( c76_shared_w )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
UINT16 *share16 = (UINT16 *)state->sharedram;
COMBINE_DATA(&share16[offset]);
@@ -748,7 +748,7 @@ static WRITE16_HANDLER( c76_shared_w )
static READ16_HANDLER( c76_speedup_r )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
if ((cpu_get_pc(space->cpu) == 0xc153) && (!(state->su_83 & 0xff00)))
{
@@ -760,7 +760,7 @@ static READ16_HANDLER( c76_speedup_r )
static WRITE16_HANDLER( c76_speedup_w )
{
- namcos11_state *state = space->machine->driver_data<namcos11_state>();
+ namcos11_state *state = space->machine().driver_data<namcos11_state>();
COMBINE_DATA(&state->su_83);
}
@@ -772,16 +772,16 @@ static READ16_HANDLER( c76_inputs_r )
switch (offset)
{
case 0:
- return input_port_read(space->machine, "PLAYER4");
+ return input_port_read(space->machine(), "PLAYER4");
case 1:
- return input_port_read(space->machine, "SWITCH");
+ return input_port_read(space->machine(), "SWITCH");
case 2:
- return input_port_read(space->machine, "PLAYER1");
+ return input_port_read(space->machine(), "PLAYER1");
case 3:
- return input_port_read(space->machine, "PLAYER2");
+ return input_port_read(space->machine(), "PLAYER2");
}
return 0xff;
@@ -801,52 +801,52 @@ ADDRESS_MAP_END
static READ8_HANDLER(dac7_r) // bit 7
{
- return input_port_read_safe(space->machine, "PLAYER3", 0xff)&0x80;
+ return input_port_read_safe(space->machine(), "PLAYER3", 0xff)&0x80;
}
static READ8_HANDLER(dac6_r) // bit 3
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<4)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<4)&0x80;
}
static READ8_HANDLER(dac5_r) // bit 2
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<5)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<5)&0x80;
}
static READ8_HANDLER(dac4_r) // bit 1
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<6)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<6)&0x80;
}
static READ8_HANDLER(dac3_r) // bit 0
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<7)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<7)&0x80;
}
static READ8_HANDLER(dac2_r) // bit 4
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<3)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<3)&0x80;
}
static READ8_HANDLER(dac1_r) // bit 5
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<2)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<2)&0x80;
}
static READ8_HANDLER(dac0_r) // bit 6
{
- return (input_port_read_safe(space->machine, "PLAYER3", 0xff)<<1)&0x80;
+ return (input_port_read_safe(space->machine(), "PLAYER3", 0xff)<<1)&0x80;
}
static READ8_HANDLER(pocketrc_gas_r)
{
- return input_port_read(space->machine, "GAS");
+ return input_port_read(space->machine(), "GAS");
}
static READ8_HANDLER(pocketrc_steer_r)
{
- return input_port_read(space->machine, "STEERING");
+ return input_port_read(space->machine(), "STEERING");
}
ADDRESS_MAP_START( c76_io_map, AS_IO, 8 )
@@ -912,15 +912,15 @@ static const struct
static DRIVER_INIT( namcos11 )
{
- namcos11_state *state = machine->driver_data<namcos11_state>();
+ namcos11_state *state = machine.driver_data<namcos11_state>();
int n_game;
- machine->device("c76")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(c76_speedup_r), FUNC(c76_speedup_w));
+ machine.device("c76")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(c76_speedup_r), FUNC(c76_speedup_w));
- if( strcmp( machine->system().name, "pocketrc" ) == 0 )
+ if( strcmp( machine.system().name, "pocketrc" ) == 0 )
{
- machine->device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC0_L, FUNC(pocketrc_steer_r));
- machine->device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC1_L, M37710_ADC1_L, FUNC(pocketrc_gas_r));
+ machine.device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC0_L, FUNC(pocketrc_steer_r));
+ machine.device("c76")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC1_L, M37710_ADC1_L, FUNC(pocketrc_gas_r));
}
psx_driver_init(machine);
@@ -928,26 +928,26 @@ static DRIVER_INIT( namcos11 )
n_game = 0;
while( namcos11_config_table[ n_game ].s_name != NULL )
{
- if( strcmp( machine->system().name, namcos11_config_table[ n_game ].s_name ) == 0 )
+ if( strcmp( machine.system().name, namcos11_config_table[ n_game ].s_name ) == 0 )
{
if( namcos11_config_table[ n_game ].keycus_r != NULL )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(namcos11_config_table[ n_game ].keycus_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( 0x1fa20000, 0x1fa2ffff, FUNC(namcos11_config_table[ n_game ].keycus_r) );
}
if( namcos11_config_table[ n_game ].n_daughterboard != 0 )
{
int bank;
- UINT32 len = machine->region( "user2" )->bytes();
- UINT8 *rgn = machine->region( "user2" )->base();
-
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f000000, 0x1f0fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f100000, 0x1f1fffff, "bank2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f200000, 0x1f2fffff, "bank3" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f300000, 0x1f3fffff, "bank4" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f400000, 0x1f4fffff, "bank5" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f500000, 0x1f5fffff, "bank6" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f600000, 0x1f6fffff, "bank7" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f700000, 0x1f7fffff, "bank8" );
+ UINT32 len = machine.region( "user2" )->bytes();
+ UINT8 *rgn = machine.region( "user2" )->base();
+
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f000000, 0x1f0fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f100000, 0x1f1fffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f200000, 0x1f2fffff, "bank3" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f300000, 0x1f3fffff, "bank4" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f400000, 0x1f4fffff, "bank5" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f500000, 0x1f5fffff, "bank6" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f600000, 0x1f6fffff, "bank7" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x1f700000, 0x1f7fffff, "bank8" );
for( bank = 0; bank < 8; bank++ )
{
@@ -957,36 +957,36 @@ static DRIVER_INIT( namcos11 )
if( namcos11_config_table[ n_game ].n_daughterboard == 32 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1fa10020, 0x1fa1002f, FUNC(bankswitch_rom32_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1fa10020, 0x1fa1002f, FUNC(bankswitch_rom32_w) );
}
if( namcos11_config_table[ n_game ].n_daughterboard == 64 )
{
state->m_n_bankoffset = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f080000, 0x1f080003, FUNC(bankswitch_rom64_upper_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x1fa10020, 0x1fa1002f);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1fa10020, 0x1fa1002f, FUNC(bankswitch_rom64_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f080000, 0x1f080003, FUNC(bankswitch_rom64_upper_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x1fa10020, 0x1fa1002f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1fa10020, 0x1fa1002f, FUNC(bankswitch_rom64_w) );
state->save_item( NAME(state->m_n_bankoffset) );
}
}
else
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x1fa10020, 0x1fa1002f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x1fa10020, 0x1fa1002f);
}
break;
}
n_game++;
}
- if( strcmp( machine->system().name, "ptblank2a" ) == 0 )
+ if( strcmp( machine.system().name, "ptblank2a" ) == 0 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(lightgun_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(lightgun_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(lightgun_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(lightgun_r) );
}
}
static MACHINE_RESET( namcos11 )
{
- namcos11_state *state = machine->driver_data<namcos11_state>();
+ namcos11_state *state = machine.driver_data<namcos11_state>();
memset( state->keycus, 0, state->keycus_size );
psx_machine_init(machine);
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 241018980b5..72bc9b58119 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1055,7 +1055,7 @@ public:
int s12_settings[8];
};
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -1064,29 +1064,29 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
}
}
static WRITE32_HANDLER( sharedram_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
- verboselog( space->machine, 1, "sharedram_w( %08x, %08x, %08x )\n", ( offset * 4 ), data, mem_mask );
+ verboselog( space->machine(), 1, "sharedram_w( %08x, %08x, %08x )\n", ( offset * 4 ), data, mem_mask );
COMBINE_DATA( &state->sharedram[ offset ] );
}
static READ32_HANDLER( sharedram_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
- verboselog( space->machine, 1, "sharedram_r( %08x, %08x ) %08x\n", ( offset * 4 ), mem_mask, state->sharedram[ offset ] );
+ verboselog( space->machine(), 1, "sharedram_r( %08x, %08x ) %08x\n", ( offset * 4 ), mem_mask, state->sharedram[ offset ] );
return state->sharedram[ offset ];
}
static WRITE16_HANDLER( sharedram_sub_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
UINT16 *shared16 = (UINT16 *)state->sharedram;
@@ -1095,7 +1095,7 @@ static WRITE16_HANDLER( sharedram_sub_w )
static READ16_HANDLER( sharedram_sub_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
UINT16 *shared16 = (UINT16 *)state->sharedram;
@@ -1104,11 +1104,11 @@ static READ16_HANDLER( sharedram_sub_r )
static WRITE32_HANDLER( bankoffset_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// Golgo 13 has different banking (maybe the keycus controls it?)
- if( strcmp( space->machine->system().name, "golgo13" ) == 0 ||
- strcmp( space->machine->system().name, "g13knd" ) == 0 )
+ if( strcmp( space->machine().system().name, "golgo13" ) == 0 ||
+ strcmp( space->machine().system().name, "g13knd" ) == 0 )
{
if( ( data & 8 ) != 0 )
{
@@ -1124,14 +1124,14 @@ static WRITE32_HANDLER( bankoffset_w )
state->m_n_bankoffset = data;
}
- memory_set_bank( space->machine, "bank1", state->m_n_bankoffset );
+ memory_set_bank( space->machine(), "bank1", state->m_n_bankoffset );
- verboselog( space->machine, 1, "bankoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, state->m_n_bankoffset );
+ verboselog( space->machine(), 1, "bankoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, state->m_n_bankoffset );
}
static WRITE32_HANDLER( dmaoffset_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
if( ACCESSING_BITS_0_15 )
{
@@ -1141,12 +1141,12 @@ static WRITE32_HANDLER( dmaoffset_w )
{
state->m_n_dmaoffset = ( ( offset * 4 ) + 2 ) | ( data & 0xffff0000 );
}
- verboselog( space->machine, 1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, state->m_n_dmaoffset );
+ verboselog( space->machine(), 1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, state->m_n_dmaoffset );
}
-static void namcos12_rom_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void namcos12_rom_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- namcos12_state *state = machine->driver_data<namcos12_state>();
+ namcos12_state *state = machine.driver_data<namcos12_state>();
const char *n_region;
int n_offset;
@@ -1175,8 +1175,8 @@ static void namcos12_rom_read( running_machine *machine, UINT32 n_address, INT32
verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) game %08x\n", n_address, n_size, n_offset );
}
- source = (UINT16 *) machine->region( n_region )->base();
- n_romleft = ( machine->region( n_region )->bytes() - n_offset ) / 4;
+ source = (UINT16 *) machine.region( n_region )->base();
+ n_romleft = ( machine.region( n_region )->bytes() - n_offset ) / 4;
if( n_size > n_romleft )
{
verboselog( machine, 1, "namcos12_rom_read dma truncated %d to %d passed end of rom\n", n_size, n_romleft );
@@ -1206,7 +1206,7 @@ static void namcos12_rom_read( running_machine *machine, UINT32 n_address, INT32
static WRITE32_HANDLER( s12_dma_bias_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
state->m_n_dmabias = data;
}
@@ -1261,11 +1261,11 @@ static WRITE32_HANDLER( system11gun_w )
output_set_value("P2_Start_lamp", (~data & 0x04)>>2);
- verboselog( space->machine, 1, "system11gun_w: outputs (%08x %08x)\n", data, mem_mask );
+ verboselog( space->machine(), 1, "system11gun_w: outputs (%08x %08x)\n", data, mem_mask );
}
if( ACCESSING_BITS_16_31 )
{
- verboselog( space->machine, 2, "system11gun_w: start reading (%08x %08x)\n", data, mem_mask );
+ verboselog( space->machine(), 2, "system11gun_w: start reading (%08x %08x)\n", data, mem_mask );
}
}
@@ -1275,43 +1275,43 @@ static READ32_HANDLER( system11gun_r )
switch( offset )
{
case 0:
- data = input_port_read(space->machine, "LIGHT0_X");
+ data = input_port_read(space->machine(), "LIGHT0_X");
break;
case 1:
- data = ( input_port_read(space->machine, "LIGHT0_Y") ) | ( ( input_port_read(space->machine, "LIGHT0_Y") + 1 ) << 16 );
+ data = ( input_port_read(space->machine(), "LIGHT0_Y") ) | ( ( input_port_read(space->machine(), "LIGHT0_Y") + 1 ) << 16 );
break;
case 2:
- data = input_port_read(space->machine, "LIGHT1_X");
+ data = input_port_read(space->machine(), "LIGHT1_X");
break;
case 3:
- data = ( input_port_read(space->machine, "LIGHT1_Y") ) | ( ( input_port_read(space->machine, "LIGHT1_Y") + 1 ) << 16 );
+ data = ( input_port_read(space->machine(), "LIGHT1_Y") ) | ( ( input_port_read(space->machine(), "LIGHT1_Y") + 1 ) << 16 );
break;
}
- verboselog( space->machine, 2, "system11gun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "system11gun_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
-static void system11gun_install( running_machine *machine )
+static void system11gun_install( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(system11gun_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(system11gun_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f788000, 0x1f788003, FUNC(system11gun_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1f780000, 0x1f78000f, FUNC(system11gun_r) );
}
static WRITE32_HANDLER( kcoff_w )
{
- memory_set_bankptr( space->machine, "bank2", space->machine->region( "user1" )->base() + 0x20280 );
+ memory_set_bankptr( space->machine(), "bank2", space->machine().region( "user1" )->base() + 0x20280 );
}
static WRITE32_HANDLER( kcon_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
- memory_set_bankptr( space->machine, "bank2", state->kcram );
+ memory_set_bankptr( space->machine(), "bank2", state->kcram );
}
static WRITE32_HANDLER( tektagt_protection_1_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// Second dma offset or protection ref values write
state->m_n_tektagdmaoffset = data;
@@ -1327,7 +1327,7 @@ static READ32_HANDLER( tektagt_protection_1_r )
static WRITE32_HANDLER( tektagt_protection_2_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// Writes are 0 or rand(), only used as a "start prot value write" trigger
state->ttt_cnt = 0;
@@ -1335,7 +1335,7 @@ static WRITE32_HANDLER( tektagt_protection_2_w )
static READ32_HANDLER( tektagt_protection_2_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
UINT32 *ttt_val = state->ttt_val;
UINT32 data = 0;
@@ -1365,16 +1365,16 @@ static READ32_HANDLER( tektagt_protection_3_r )
static MACHINE_RESET( namcos12 )
{
- namcos12_state *state = machine->driver_data<namcos12_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ namcos12_state *state = machine.driver_data<namcos12_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
psx_machine_init(machine);
bankoffset_w(space,0,0,0xffffffff);
state->has_tektagt_dma = 0;
- if( strcmp( machine->system().name, "tektagt" ) == 0 ||
- strcmp( machine->system().name, "tektagta" ) == 0 ||
- strcmp( machine->system().name, "tektagtb" ) == 0 ||
- strcmp( machine->system().name, "tektagtc" ) == 0 )
+ if( strcmp( machine.system().name, "tektagt" ) == 0 ||
+ strcmp( machine.system().name, "tektagta" ) == 0 ||
+ strcmp( machine.system().name, "tektagtb" ) == 0 ||
+ strcmp( machine.system().name, "tektagtc" ) == 0 )
{
state->has_tektagt_dma = 1;
space->install_legacy_readwrite_handler(0x1fb00000, 0x1fb00003, FUNC(tektagt_protection_1_r), FUNC(tektagt_protection_1_w) );
@@ -1382,24 +1382,24 @@ static MACHINE_RESET( namcos12 )
space->install_legacy_read_handler(0x1f700000, 0x1f700003, FUNC(tektagt_protection_3_r) );
}
- if( strcmp( machine->system().name, "tektagt" ) == 0 ||
- strcmp( machine->system().name, "tektagta" ) == 0 ||
- strcmp( machine->system().name, "tektagtb" ) == 0 ||
- strcmp( machine->system().name, "tektagtc" ) == 0 ||
- strcmp( machine->system().name, "fgtlayer" ) == 0 ||
- strcmp( machine->system().name, "golgo13" ) == 0 ||
- strcmp( machine->system().name, "g13knd" ) == 0 ||
- strcmp( machine->system().name, "mrdrillr" ) == 0 ||
- strcmp( machine->system().name, "pacapp" ) == 0 ||
- strcmp( machine->system().name, "pacappsp" ) == 0 ||
- strcmp( machine->system().name, "pacapp2" ) == 0 ||
- strcmp( machine->system().name, "tenkomorj" ) == 0 ||
- strcmp( machine->system().name, "tenkomor" ) == 0 ||
- strcmp( machine->system().name, "ptblank2" ) == 0 ||
- strcmp( machine->system().name, "sws2000" ) == 0 ||
- strcmp( machine->system().name, "sws2001" ) == 0 ||
- strcmp( machine->system().name, "truckk" ) == 0 ||
- strcmp( machine->system().name, "ghlpanic" ) == 0 )
+ if( strcmp( machine.system().name, "tektagt" ) == 0 ||
+ strcmp( machine.system().name, "tektagta" ) == 0 ||
+ strcmp( machine.system().name, "tektagtb" ) == 0 ||
+ strcmp( machine.system().name, "tektagtc" ) == 0 ||
+ strcmp( machine.system().name, "fgtlayer" ) == 0 ||
+ strcmp( machine.system().name, "golgo13" ) == 0 ||
+ strcmp( machine.system().name, "g13knd" ) == 0 ||
+ strcmp( machine.system().name, "mrdrillr" ) == 0 ||
+ strcmp( machine.system().name, "pacapp" ) == 0 ||
+ strcmp( machine.system().name, "pacappsp" ) == 0 ||
+ strcmp( machine.system().name, "pacapp2" ) == 0 ||
+ strcmp( machine.system().name, "tenkomorj" ) == 0 ||
+ strcmp( machine.system().name, "tenkomor" ) == 0 ||
+ strcmp( machine.system().name, "ptblank2" ) == 0 ||
+ strcmp( machine.system().name, "sws2000" ) == 0 ||
+ strcmp( machine.system().name, "sws2001" ) == 0 ||
+ strcmp( machine.system().name, "truckk" ) == 0 ||
+ strcmp( machine.system().name, "ghlpanic" ) == 0 )
{
/* this is based on guesswork, it might not even be keycus. */
space->install_read_bank (0x1fc20280, 0x1fc2028b, "bank2" );
@@ -1407,7 +1407,7 @@ static MACHINE_RESET( namcos12 )
space->install_legacy_write_handler(0x1f018000, 0x1f018003, FUNC(kcoff_w) );
memset( state->kcram, 0, sizeof( state->kcram ) );
- memory_set_bankptr( space->machine, "bank2", state->kcram );
+ memory_set_bankptr( space->machine(), "bank2", state->kcram );
}
}
@@ -1433,14 +1433,14 @@ static READ8_HANDLER( s12_mcu_p8_r )
static READ8_HANDLER( s12_mcu_pa_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
return state->s12_porta;
}
static WRITE8_HANDLER( s12_mcu_pa_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// bit 0 = chip enable for the RTC
// reset the state on the rising edge of the bit
@@ -1459,12 +1459,12 @@ INLINE UINT8 make_bcd(UINT8 data)
static READ8_HANDLER( s12_mcu_rtc_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
UINT8 ret = 0;
system_time systime;
static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 };
- space->machine->current_datetime(systime);
+ space->machine().current_datetime(systime);
switch (state->s12_rtcstate)
{
@@ -1501,7 +1501,7 @@ static READ8_HANDLER( s12_mcu_rtc_r )
static READ8_HANDLER( s12_mcu_portB_r )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// golgo13 won't boot if this doesn't toggle every read
state->s12_lastpB ^= 0x80;
@@ -1510,7 +1510,7 @@ static READ8_HANDLER( s12_mcu_portB_r )
static WRITE8_HANDLER( s12_mcu_portB_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
// bit 7 = chip enable for the video settings controller
if (data & 0x80)
@@ -1523,7 +1523,7 @@ static WRITE8_HANDLER( s12_mcu_portB_w )
static WRITE8_HANDLER( s12_mcu_settings_w )
{
- namcos12_state *state = space->machine->driver_data<namcos12_state>();
+ namcos12_state *state = space->machine().driver_data<namcos12_state>();
int *s12_settings = state->s12_settings;
if (state->s12_setstate)
@@ -1557,7 +1557,7 @@ static WRITE8_HANDLER( s12_mcu_settings_w )
static READ8_HANDLER( s12_mcu_gun_h_r )
{
- const input_port_config *port = space->machine->port("LIGHT0_X");
+ const input_port_config *port = space->machine().port("LIGHT0_X");
if( port != NULL )
{
int rv = input_port_read_direct( port ) << 6;
@@ -1576,7 +1576,7 @@ static READ8_HANDLER( s12_mcu_gun_h_r )
static READ8_HANDLER( s12_mcu_gun_v_r )
{
- const input_port_config *port = space->machine->port("LIGHT0_Y");
+ const input_port_config *port = space->machine().port("LIGHT0_Y");
if( port != NULL )
{
int rv = input_port_read_direct( port ) << 6;
@@ -1607,13 +1607,13 @@ ADDRESS_MAP_END
static DRIVER_INIT( namcos12 )
{
- namcos12_state *state = machine->driver_data<namcos12_state>();
+ namcos12_state *state = machine.driver_data<namcos12_state>();
psx_driver_init(machine);
psx_dma_install_read_handler( machine, 5, namcos12_rom_read );
- memory_configure_bank(machine, "bank1", 0, machine->region( "user2" )->bytes() / 0x200000, machine->region( "user2" )->base(), 0x200000 );
+ memory_configure_bank(machine, "bank1", 0, machine.region( "user2" )->bytes() / 0x200000, machine.region( "user2" )->base(), 0x200000 );
state->s12_porta = 0;
state->s12_rtcstate = 0;
@@ -1638,7 +1638,7 @@ static DRIVER_INIT( ptblank2 )
DRIVER_INIT_CALL(namcos12);
/* patch out wait for dma 5 to complete */
- *( (UINT32 *)( machine->region( "user1" )->base() + 0x331c4 ) ) = 0;
+ *( (UINT32 *)( machine.region( "user1" )->base() + 0x331c4 ) ) = 0;
system11gun_install(machine);
}
diff --git a/src/mame/drivers/namcos2.c b/src/mame/drivers/namcos2.c
index 601c0c5d9f9..358077e918d 100644
--- a/src/mame/drivers/namcos2.c
+++ b/src/mame/drivers/namcos2.c
@@ -5035,7 +5035,7 @@ static DRIVER_INIT( assaultp_hack ){
//
// This is used in conjunction with the interleave increase in the
// MACHINE_DRIVER
- machine->device("mcu")->set_clock_scale(4.0f);
+ machine.device("mcu")->set_clock_scale(4.0f);
DRIVER_INIT_CALL( assaultp );
}
@@ -5096,7 +5096,7 @@ static DRIVER_INIT( metlhawk )
{
/* unscramble sprites */
int i, j, k, l;
- UINT8 *data = machine->region("gfx1")->base();
+ UINT8 *data = machine.region("gfx1")->base();
for(i=0; i<0x200000; i+=32*32)
{
for(j=0; j<32*32; j+=32*4)
@@ -5213,7 +5213,7 @@ static DRIVER_INIT( bubbletr ){
static DRIVER_INIT( luckywld ){
- UINT8 *pData = (UINT8 *)machine->region( "gfx5" )->base();
+ UINT8 *pData = (UINT8 *)machine.region( "gfx5" )->base();
int i;
for( i=0; i<32*0x4000; i++ )
{ /* unscramble gfx mask */
diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c
index e80194b2b41..6c7d4b4b63b 100644
--- a/src/mame/drivers/namcos21.c
+++ b/src/mame/drivers/namcos21.c
@@ -349,9 +349,9 @@ struct dsp_state
static dsp_state *mpDspState;
static INT32
-ReadPointROMData( running_machine *machine, unsigned offset )
+ReadPointROMData( running_machine &machine, unsigned offset )
{
- const INT32 *pPointData = (INT32 *)machine->region( "user2" )->base();
+ const INT32 *pPointData = (INT32 *)machine.region( "user2" )->base();
INT32 result = pPointData[offset];
return result;
}
@@ -432,7 +432,7 @@ TransmitWordToSlave( UINT16 data )
} /* TransmitWordToSlave */
static void
-TransferDspData( running_machine *machine )
+TransferDspData( running_machine &machine )
{
UINT16 addr = mpDspState->masterSourceAddr;
int mode = addr&0x8000;
@@ -532,7 +532,7 @@ static int mbNeedsKickstart;
static UINT16 *master_dsp_code;
void
-namcos21_kickstart( running_machine *machine, int internal )
+namcos21_kickstart( running_machine &machine, int internal )
{
/* patch dsp watchdog */
switch( namcos2_gametype )
@@ -575,13 +575,13 @@ ReadWordFromSlaveInput( address_space *space )
{
mpDspState->slaveBytesAdvertised--;
}
- if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", space->machine->describe_context(), data, mpDspState->slaveBytesAvailable );
+ if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", space->machine().describe_context(), data, mpDspState->slaveBytesAvailable );
}
return data;
} /* ReadWordFromSlaveInput */
static size_t
-GetInputBytesAdvertisedForSlave( running_machine *machine )
+GetInputBytesAdvertisedForSlave( running_machine &machine )
{
if( mpDspState->slaveBytesAdvertised < mpDspState->slaveBytesAvailable )
{
@@ -609,11 +609,11 @@ static WRITE16_HANDLER( dspram16_w )
offset == 1+(mpDspState->masterSourceAddr&0x7fff) )
{
if (ENABLE_LOGGING) logerror( "IDC-CONTINUE\n" );
- TransferDspData(space->machine);
+ TransferDspData(space->machine());
}
else if (namcos2_gametype == NAMCOS21_SOLVALOU &&
offset == 0x103 &&
- space->cpu == space->machine->device("maincpu"))
+ space->cpu == space->machine().device("maincpu"))
{ /* hack; synchronization for solvalou */
device_yield(space->cpu);
}
@@ -623,9 +623,9 @@ static WRITE16_HANDLER( dspram16_w )
/************************************************************************************/
static int
-InitDSP( running_machine *machine )
+InitDSP( running_machine &machine )
{
- UINT16 *pMem = (UINT16 *)machine->region("dspmaster")->base();
+ UINT16 *pMem = (UINT16 *)machine.region("dspmaster")->base();
/**
* DSP BIOS tests "CPU ID" on startup
* "JAPAN (C)1990 NAMCO LTD. by H.F "
@@ -648,7 +648,7 @@ static int mbPointRomDataAvailable;
static READ16_HANDLER( dsp_port0_r )
{
- INT32 data = ReadPointROMData(space->machine, pointrom_idx++);
+ INT32 data = ReadPointROMData(space->machine(), pointrom_idx++);
mPointRomMSB = (UINT8)(data>>16);
mbPointRomDataAvailable = 1;
return (UINT16)data;
@@ -683,7 +683,7 @@ static WRITE16_HANDLER( dsp_port2_w )
{
if (ENABLE_LOGGING) logerror( "IDC ADDR INIT(0x%04x)\n", data );
mpDspState->masterSourceAddr = data;
- TransferDspData(space->machine);
+ TransferDspData(space->machine());
} /* dsp_port2_w */
static READ16_HANDLER( dsp_port3_idc_rcv_enable_r )
@@ -902,7 +902,7 @@ static WRITE16_HANDLER(slave_port0_w)
static READ16_HANDLER(slave_port2_r)
{
- return GetInputBytesAdvertisedForSlave(space->machine);
+ return GetInputBytesAdvertisedForSlave(space->machine());
} /* slave_port2_r */
static READ16_HANDLER(slave_port3_r)
@@ -1087,12 +1087,12 @@ static READ16_HANDLER( data2_r )
static READ16_HANDLER( paletteram16_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
static WRITE16_HANDLER( paletteram16_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
}
/******************************************************************************/
@@ -1260,7 +1260,7 @@ static WRITE16_HANDLER( winrun_dsp_pointrom_addr_w )
static READ16_HANDLER( winrun_dsp_pointrom_data_r )
{
- UINT16 *ptrom = (UINT16 *)space->machine->region("user2")->base();
+ UINT16 *ptrom = (UINT16 *)space->machine().region("user2")->base();
return ptrom[winrun_pointrom_addr++];
} /* winrun_dsp_pointrom_data_r */
@@ -1269,7 +1269,7 @@ static WRITE16_HANDLER( winrun_dsp_complete_w )
if( data )
{
winrun_flushpoly();
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, PULSE_LINE);
namcos21_ClearPolyFrameBuffer();
}
}
@@ -1302,7 +1302,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( gpu_data_r )
{
- const UINT16 *pSrc = (UINT16 *)space->machine->region( "user3" )->base();
+ const UINT16 *pSrc = (UINT16 *)space->machine().region( "user3" )->base();
return pSrc[offset];
}
@@ -1320,7 +1320,7 @@ static WRITE16_HANDLER( winrun_dspbios_w )
COMBINE_DATA( &winrun_dspbios[offset] );
if( offset==0xfff )
{
- UINT16 *mem = (UINT16 *)space->machine->region("dsp")->base();
+ UINT16 *mem = (UINT16 *)space->machine().region("dsp")->base();
memcpy( mem, winrun_dspbios, 0x2000 );
winrun_dsp_alive = 1;
}
@@ -2201,11 +2201,11 @@ ROM_START( winrun91 )
ROM_LOAD("avo3.11e",0x180000,0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) )
ROM_END
-static void namcos21_init( running_machine *machine, int game_type )
+static void namcos21_init( running_machine &machine, int game_type )
{
namcos2_gametype = game_type;
pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
- mpDataROM = (UINT16 *)machine->region( "user1" )->base();
+ mpDataROM = (UINT16 *)machine.region( "user1" )->base();
InitDSP(machine);
mbNeedsKickstart = 20;
if( game_type==NAMCOS21_CYBERSLED )
@@ -2216,7 +2216,7 @@ static void namcos21_init( running_machine *machine, int game_type )
static DRIVER_INIT( winrun )
{
- UINT16 *pMem = (UINT16 *)machine->region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
@@ -2224,7 +2224,7 @@ static DRIVER_INIT( winrun )
winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_WINRUN91;
- mpDataROM = (UINT16 *)machine->region( "user1" )->base();
+ mpDataROM = (UINT16 *)machine.region( "user1" )->base();
pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
pointram_idx = 0;
mbNeedsKickstart = 0;
@@ -2248,7 +2248,7 @@ static DRIVER_INIT( cybsled )
static DRIVER_INIT( solvalou )
{
- UINT16 *mem = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem = (UINT16 *)machine.region("maincpu")->base();
mem[0x20ce4/2+1] = 0x0000; // $200128
mem[0x20cf4/2+0] = 0x4e71; // 2nd ptr_booting
mem[0x20cf4/2+1] = 0x4e71;
@@ -2259,13 +2259,13 @@ static DRIVER_INIT( solvalou )
static DRIVER_INIT( driveyes )
{
- UINT16 *pMem = (UINT16 *)machine->region("dsp")->base();
+ UINT16 *pMem = (UINT16 *)machine.region("dsp")->base();
int pc = 0;
pMem[pc++] = 0xff80; /* b */
pMem[pc++] = 0;
winrun_dspcomram = auto_alloc_array(machine, UINT16, 0x1000*2);
namcos2_gametype = NAMCOS21_DRIVERS_EYES;
- mpDataROM = (UINT16 *)machine->region( "user1" )->base();
+ mpDataROM = (UINT16 *)machine.region( "user1" )->base();
pointram = auto_alloc_array(machine, UINT8, PTRAM_SIZE);
pointram_idx = 0;
mbNeedsKickstart = 0;
diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c
index ba1d13f3ade..74eb5d46711 100644
--- a/src/mame/drivers/namcos22.c
+++ b/src/mame/drivers/namcos22.c
@@ -1200,7 +1200,7 @@ nthbyte( const UINT32 *pSource, int offs )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-ReadAnalogDrivingPorts( running_machine *machine, UINT16 *gas, UINT16 *brake, UINT16 *steer )
+ReadAnalogDrivingPorts( running_machine &machine, UINT16 *gas, UINT16 *brake, UINT16 *steer )
{
*gas = input_port_read(machine, "GAS");
*brake = input_port_read(machine, "BRAKE");
@@ -1209,7 +1209,7 @@ ReadAnalogDrivingPorts( running_machine *machine, UINT16 *gas, UINT16 *brake, UI
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static UINT16
-AnalogAsDigital( running_machine *machine )
+AnalogAsDigital( running_machine &machine )
{
UINT16 stick = input_port_read_safe(machine, "INPUTS", 0);
UINT16 gas = input_port_read_safe(machine, "GAS", 0);
@@ -1260,7 +1260,7 @@ AnalogAsDigital( running_machine *machine )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleCoinage(running_machine *machine, int slots)
+HandleCoinage(running_machine &machine, int slots)
{
UINT16 *share16 = (UINT16 *)namcos22_shareram;
UINT32 coin_state;
@@ -1289,7 +1289,7 @@ HandleCoinage(running_machine *machine, int slots)
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleDrivingIO( running_machine *machine )
+HandleDrivingIO( running_machine &machine )
{
if( nthbyte(namcos22_system_controller, 0x18) != 0 )
{
@@ -1345,7 +1345,7 @@ HandleDrivingIO( running_machine *machine )
/* TODO: REMOVE (THIS IS HANDLED BY "SUBCPU") */
static void
-HandleCyberCommandoIO( running_machine *machine )
+HandleCyberCommandoIO( running_machine &machine )
{
if( nthbyte(namcos22_system_controller, 0x18) != 0 )
{
@@ -1367,7 +1367,7 @@ HandleCyberCommandoIO( running_machine *machine )
/*********************************************************************************************/
static void
-InitDSP( running_machine *machine, int bSuperSystem22 )
+InitDSP( running_machine &machine, int bSuperSystem22 )
{
mbSuperSystem22 = bSuperSystem22;
cputag_set_input_line(machine, "master",INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
@@ -1550,7 +1550,7 @@ static WRITE16_HANDLER( slave_external_ram_w )
COMBINE_DATA( &mpSlaveExternalRAM[offset] );
}
-static void HaltSlaveDSP( running_machine *machine )
+static void HaltSlaveDSP( running_machine &machine )
{
cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -1637,7 +1637,7 @@ static WRITE16_HANDLER( upload_code_to_slave_dsp_w )
logerror( "UPLOAD_READY; cmd = 0x%x\n", data );
if( data==0 )
{
- HaltSlaveDSP(space->machine);
+ HaltSlaveDSP(space->machine());
}
else if( data==1 )
{
@@ -1737,12 +1737,12 @@ static INTERRUPT_GEN( dsp_serial_pulse1 )
if( cpu_getiloops(device) == 0 )
{
- cputag_set_input_line(device->machine, "master", TMS32025_INT0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "master", TMS32025_INT0, HOLD_LINE);
}
- cputag_set_input_line(device->machine, "master", TMS32025_RINT, HOLD_LINE);
- cputag_set_input_line(device->machine, "master", TMS32025_XINT, HOLD_LINE);
- cputag_set_input_line(device->machine, "slave", TMS32025_RINT, HOLD_LINE);
- cputag_set_input_line(device->machine, "slave", TMS32025_XINT, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "master", TMS32025_RINT, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "master", TMS32025_XINT, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "slave", TMS32025_RINT, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "slave", TMS32025_XINT, HOLD_LINE);
}
}
@@ -1803,7 +1803,7 @@ static WRITE16_HANDLER( master_render_device_w )
mRenderBufData[mRenderBufSize++] = data;
if( mRenderBufSize == MAX_RENDER_CMD_SEQ )
{
- namcos22_draw_direct_poly( space->machine, mRenderBufData );
+ namcos22_draw_direct_poly( space->machine(), mRenderBufData );
}
}
}
@@ -1962,9 +1962,9 @@ static NVRAM_HANDLER( namcos22 )
else
{
memset( namcos22_nvmem, 0x00, namcos22_nvmem_size );
- if (machine->region("nvram")->bytes() == namcos22_nvmem_size)
+ if (machine.region("nvram")->bytes() == namcos22_nvmem_size)
{
- UINT8* nvram = machine->region("nvram")->base();
+ UINT8* nvram = machine.region("nvram")->base();
for( i=0; i<namcos22_nvmem_size/4; i++ )
{
@@ -2174,11 +2174,11 @@ static WRITE32_HANDLER( namcos22_system_controller_w )
{ /* SUBCPU enable for Super System 22 */
if (data)
{
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, CLEAR_LINE);
}
else
{
- cputag_set_input_line(space->machine, "mcu",INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */
+ cputag_set_input_line(space->machine(), "mcu",INPUT_LINE_RESET,ASSERT_LINE); /* M37710 MCU */
}
}
}
@@ -2188,7 +2188,7 @@ static WRITE32_HANDLER( namcos22_system_controller_w )
{ /* SUBCPU enable on System 22 (guessed, but too early crashes Rave Racer so it's a good test) */
if (data == 0xff00)
{
- space->machine->scheduler().timer_set(attotime::from_msec(50), FUNC(start_subcpu));
+ space->machine().scheduler().timer_set(attotime::from_msec(50), FUNC(start_subcpu));
}
}
}
@@ -2200,19 +2200,19 @@ static WRITE32_HANDLER( namcos22_system_controller_w )
{
if( newReg == 0 )
{ /* disable DSPs */
- cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */
+ cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */
mbEnableDspIrqs = 0;
}
else if( newReg == 1 )
{ /*enable dsp and rendering subsystem */
- cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE);
namcos22_enable_slave_simulation();
mbEnableDspIrqs = 1;
}
else if( newReg == 0xff )
{ /* used to upload game-specific code to master/slave dsps */
- cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "master", INPUT_LINE_RESET, CLEAR_LINE);
mbEnableDspIrqs = 0;
}
}
@@ -2311,14 +2311,14 @@ static READ32_HANDLER( namcos22_portbit_r )
}
static WRITE32_HANDLER( namcos22_portbit_w )
{
- unsigned dat50000008 = AnalogAsDigital(space->machine);
+ unsigned dat50000008 = AnalogAsDigital(space->machine());
unsigned dat5000000a = 0xffff;
mSys22PortBits = (dat50000008<<16)|dat5000000a;
}
static READ32_HANDLER( namcos22_dipswitch_r )
{
- return input_port_read(space->machine, "DSW0")<<16;
+ return input_port_read(space->machine(), "DSW0")<<16;
}
static READ32_HANDLER( namcos22_mcuram_r )
@@ -2387,8 +2387,8 @@ static WRITE32_HANDLER( spotram_w )
static READ32_HANDLER( namcos22_gun_r )
{
- int xpos = input_port_read_safe(space->machine, "LIGHTX", 0) * 640 / 0xff;
- int ypos = input_port_read_safe(space->machine, "LIGHTY", 0) * 480 / 0xff;
+ int xpos = input_port_read_safe(space->machine(), "LIGHTX", 0) * 640 / 0xff;
+ int ypos = input_port_read_safe(space->machine(), "LIGHTY", 0) * 480 / 0xff;
switch( offset )
{
case 0: /* 430000 */
@@ -2550,11 +2550,11 @@ static READ8_HANDLER( mcu_port5_r )
{
if (mFrameCount & 1)
{
- return input_port_read_safe(space->machine, "MCUP5A", 0xff) | 0x80;
+ return input_port_read_safe(space->machine(), "MCUP5A", 0xff) | 0x80;
}
else
{
- return input_port_read_safe(space->machine, "MCUP5A", 0xff) & 0x7f;
+ return input_port_read_safe(space->machine(), "MCUP5A", 0xff) & 0x7f;
}
}
else
@@ -2573,11 +2573,11 @@ static READ8_HANDLER( mcu_port5_r )
{
if (p4 & 8)
{
- return input_port_read_safe(space->machine, "MCUP5A", 0xff);
+ return input_port_read_safe(space->machine(), "MCUP5A", 0xff);
}
else
{
- return input_port_read_safe(space->machine, "MCUP5B", 0xff);
+ return input_port_read_safe(space->machine(), "MCUP5B", 0xff);
}
}
}
@@ -2598,10 +2598,10 @@ static WRITE8_HANDLER( mcu_port5_w )
// bit 1 = fan
// bit 2 = button light
- if (!strcmp(space->machine->system().name, "propcycl"))
+ if (!strcmp(space->machine().system().name, "propcycl"))
{
output_set_value("fan0", data & 1);
- set_led_status(space->machine, 0, data & 2);
+ set_led_status(space->machine(), 0, data & 2);
}
}
@@ -2620,9 +2620,9 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
{
static UINT16 ddx, ddy;
- ddx = input_port_read(space->machine, "STICKX")^0xff;
+ ddx = input_port_read(space->machine(), "STICKX")^0xff;
if (ddx > 0) ddx -= 1;
- ddy = input_port_read(space->machine, "STICKY");
+ ddy = input_port_read(space->machine(), "STICKY");
if (ddy > 0) ddy -= 1;
ddx <<= 2;
@@ -2639,12 +2639,12 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
// and timer A3 is configured by the MCU program to cause an interrupt each time
// it's clocked. by counting the number of interrupts in a frame, we can determine
// how fast the user is pedaling.
- if( input_port_read(space->machine, "JOY") & 0x10 )
+ if( input_port_read(space->machine(), "JOY") & 0x10 )
{
int i;
for (i = 0; i < 16; i++)
{
- generic_pulse_irq_line(space->machine->device("mcu"), M37710_LINE_TIMERA3TICK);
+ generic_pulse_irq_line(space->machine().device("mcu"), M37710_LINE_TIMERA3TICK);
}
}
@@ -2663,12 +2663,12 @@ static READ8_HANDLER( propcycle_mcu_adc_r )
// 0 H+L = swing, 1 H+L = edge
static READ8_HANDLER( alpineracer_mcu_adc_r )
{
- UINT16 swing = (0xff - input_port_read(space->machine, "SWING"))<<2;
- UINT16 edge = (0xff - input_port_read(space->machine, "EDGE"))<<2;
+ UINT16 swing = (0xff - input_port_read(space->machine(), "SWING"))<<2;
+ UINT16 edge = (0xff - input_port_read(space->machine(), "EDGE"))<<2;
// fake out the centering a bit
- if (input_port_read(space->machine, "SWING") == 0x80) swing = 0x200;
- if (input_port_read(space->machine, "EDGE") == 0x80) edge = 0x200;
+ if (input_port_read(space->machine(), "SWING") == 0x80) swing = 0x200;
+ if (input_port_read(space->machine(), "EDGE") == 0x80) edge = 0x200;
switch (offset)
{
@@ -2692,7 +2692,7 @@ static READ8_HANDLER( alpineracer_mcu_adc_r )
static READ8_HANDLER( cybrcycc_mcu_adc_r )
{
UINT16 gas,brake,steer;
- ReadAnalogDrivingPorts( space->machine, &gas, &brake, &steer );
+ ReadAnalogDrivingPorts( space->machine(), &gas, &brake, &steer );
gas <<= 2;
brake <<= 2;
@@ -2726,7 +2726,7 @@ static READ8_HANDLER( cybrcycc_mcu_adc_r )
static READ8_HANDLER( tokyowar_mcu_adc_r )
{
UINT16 gas,brake,steer;
- ReadAnalogDrivingPorts( space->machine, &gas, &brake, &steer );
+ ReadAnalogDrivingPorts( space->machine(), &gas, &brake, &steer );
gas <<= 2;
brake <<= 2;
@@ -2761,9 +2761,9 @@ static READ8_HANDLER( aquajet_mcu_adc_r )
{
UINT16 gas, steer, ddy;
- gas = input_port_read(space->machine, "GAS") ^ 0x7f;
- steer = input_port_read(space->machine, "STEER") ^ 0xff;
- ddy = input_port_read(space->machine, "STICKY");
+ gas = input_port_read(space->machine(), "GAS") ^ 0x7f;
+ steer = input_port_read(space->machine(), "STEER") ^ 0xff;
+ ddy = input_port_read(space->machine(), "STICKY");
if (ddy > 0) ddy -= 1;
gas <<= 2;
@@ -2806,9 +2806,9 @@ static READ8_HANDLER( airco22_mcu_adc_r )
{
UINT16 pedal, x, y;
- pedal = input_port_read(space->machine, "PEDAL")<<2;
- x = input_port_read(space->machine, "STICKX")<<2;
- y = input_port_read(space->machine, "STICKY")<<2;
+ pedal = input_port_read(space->machine(), "PEDAL")<<2;
+ x = input_port_read(space->machine(), "STICKX")<<2;
+ y = input_port_read(space->machine(), "STICKY")<<2;
switch (offset)
@@ -3192,7 +3192,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
switch( namcos22_gametype )
{
case NAMCOS22_RIDGE_RACER:
- HandleDrivingIO(device->machine);
+ HandleDrivingIO(device->machine());
irq_level1 = 4;
irq_level2 = 5;
// 1:0a0b6
@@ -3205,7 +3205,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_RIDGE_RACER2:
- HandleDrivingIO(device->machine);
+ HandleDrivingIO(device->machine());
irq_level1 = 1;
irq_level2 = 5;
//1:0d10c 40000005
@@ -3218,11 +3218,11 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_RAVE_RACER:
- HandleDrivingIO(device->machine);
+ HandleDrivingIO(device->machine());
break;
case NAMCOS22_VICTORY_LAP:
- HandleDrivingIO(device->machine);
+ HandleDrivingIO(device->machine());
// a54 indir to 21c2 (hblank?)
// a5a (rte)
// a5c (rte)
@@ -3235,7 +3235,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
break;
case NAMCOS22_ACE_DRIVER:
- HandleDrivingIO(device->machine);
+ HandleDrivingIO(device->machine());
// 9f8 (rte)
// 9fa (rte)
// 9fc (rte)
@@ -3253,7 +3253,7 @@ static INTERRUPT_GEN( namcos22_interrupt )
//move.b #$35, $40000004.l
//
//move.b #$34, $40000004.l
- HandleCyberCommandoIO(device->machine);
+ HandleCyberCommandoIO(device->machine());
irq_level1 = nthbyte(namcos22_system_controller,0x04)&0x7;
irq_level2 = nthbyte(namcos22_system_controller,0x02)&0x7;
break;
@@ -5287,7 +5287,7 @@ INPUT_PORTS_END /* Time Crisis */
static CUSTOM_INPUT( acedrvr_shift_read )
{
- int shift = input_port_read(field->port->machine, "SHIFT");
+ int shift = input_port_read(field->port->machine(), "SHIFT");
if (shift > 0 && shift != prev_stick_state)
{
@@ -5467,7 +5467,7 @@ INPUT_PORTS_END /* Victory Lap */
static CUSTOM_INPUT( ridger_gear_read )
{
- int gear = input_port_read(field->port->machine, "GEARS");
+ int gear = input_port_read(field->port->machine(), "GEARS");
if (gear > 0 && gear != prev_stick_state)
{
@@ -5775,30 +5775,30 @@ static READ16_HANDLER( mcuc74_speedup_r )
return su_82;
}
-static void install_c74_speedup(running_machine *machine)
+static void install_c74_speedup(running_machine &machine)
{
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x80, 0x81, FUNC(mcuc74_speedup_r), FUNC(mcu_speedup_w));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x80, 0x81, FUNC(mcuc74_speedup_r), FUNC(mcu_speedup_w));
}
-static void install_130_speedup(running_machine *machine)
+static void install_130_speedup(running_machine &machine)
{
// install speedup cheat for 1.30 MCU BIOS
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(mcu130_speedup_r), FUNC(mcu_speedup_w));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(mcu130_speedup_r), FUNC(mcu_speedup_w));
}
-static void install_141_speedup(running_machine *machine)
+static void install_141_speedup(running_machine &machine)
{
// install speedup cheat for 1.41 MCU BIOS
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(mcu141_speedup_r), FUNC(mcu_speedup_w));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(mcu141_speedup_r), FUNC(mcu_speedup_w));
}
-static void namcos22_init( running_machine *machine, enum namcos22_gametype game_type )
+static void namcos22_init( running_machine &machine, enum namcos22_gametype game_type )
{
namcos22_gametype = game_type;
mpPointRAM = auto_alloc_array(machine, UINT32, 0x20000);
}
-static void namcos22s_init( running_machine *machine, enum namcos22_gametype game_type )
+static void namcos22s_init( running_machine &machine, enum namcos22_gametype game_type )
{
namcos22_init(machine, game_type);
mSpotRAM.RAM = auto_alloc_array(machine, UINT16, SPOTRAM_SIZE);
@@ -5808,7 +5808,7 @@ static DRIVER_INIT( alpiner )
{
namcos22s_init(machine, NAMCOS22_ALPINE_RACER);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
install_130_speedup(machine);
}
@@ -5817,7 +5817,7 @@ static DRIVER_INIT( alpiner2 )
{
namcos22s_init(machine, NAMCOS22_ALPINE_RACER_2);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
install_130_speedup(machine);
}
@@ -5826,7 +5826,7 @@ static DRIVER_INIT( alpinesa )
{
namcos22s_init(machine, NAMCOS22_ALPINE_SURFER);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(alpineracer_mcu_adc_r));
install_141_speedup(machine);
}
@@ -5835,12 +5835,12 @@ static DRIVER_INIT( airco22 )
{
namcos22s_init(machine, NAMCOS22_AIR_COMBAT22);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(airco22_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(airco22_mcu_adc_r));
}
static DRIVER_INIT( propcycl )
{
- UINT32 *pROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
/* patch out strange routine (uninitialized-eprom related?) */
pROM[0x1992C/4] = 0x4E754E75;
@@ -5859,7 +5859,7 @@ static DRIVER_INIT( propcycl )
namcos22s_init(machine, NAMCOS22_PROP_CYCLE);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(propcycle_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(propcycle_mcu_adc_r));
install_141_speedup(machine);
}
@@ -5921,7 +5921,7 @@ static DRIVER_INIT( raveracw )
static DRIVER_INIT( cybrcomm )
{
- UINT32 *pROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
pROM[0x18ade8/4] = 0x4e714e71;
pROM[0x18ae38/4] = 0x4e714e71;
pROM[0x18ae80/4] = 0x4e714e71;
@@ -5939,13 +5939,13 @@ static DRIVER_INIT( cybrcomm )
static DRIVER_INIT( cybrcyc )
{
/* patch DSP RAM test */
- UINT32 *pROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT32 *pROM = (UINT32 *)machine.region("maincpu")->base();
pROM[0x355C/4] &= 0x0000ffff;
pROM[0x355C/4] |= 0x4e710000;
namcos22s_init(machine, NAMCOS22_CYBER_CYCLES);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(cybrcycc_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(cybrcycc_mcu_adc_r));
install_130_speedup(machine);
}
@@ -5961,21 +5961,21 @@ static DRIVER_INIT( tokyowar )
{
namcos22s_init(machine, NAMCOS22_TOKYO_WARS);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(tokyowar_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(tokyowar_mcu_adc_r));
}
static DRIVER_INIT( aquajet )
{
namcos22s_init(machine, NAMCOS22_AQUA_JET);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(aquajet_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(aquajet_mcu_adc_r));
}
static DRIVER_INIT( dirtdash )
{
namcos22s_init(machine, NAMCOS22_DIRT_DASH);
- machine->device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(aquajet_mcu_adc_r));
+ machine.device("mcu")->memory().space(AS_IO)->install_legacy_read_handler(M37710_ADC0_L, M37710_ADC7_H, FUNC(aquajet_mcu_adc_r));
}
/************************************************************************************/
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index c4c72011862..363f8b09ac9 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -1067,7 +1067,7 @@ static WRITE32_HANDLER( namcos23_textram_w )
static WRITE32_HANDLER( s23_txtchar_w )
{
COMBINE_DATA(&namcos23_charram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[0], offset/32);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/32);
}
static UINT8 nthbyte( const UINT32 *pSource, int offs )
@@ -1076,16 +1076,16 @@ static UINT8 nthbyte( const UINT32 *pSource, int offs )
return (pSource[0]<<((offs&3)*8))>>24;
}
-INLINE void UpdatePalette( running_machine *machine, int entry )
+INLINE void UpdatePalette( running_machine &machine, int entry )
{
int j;
for( j=0; j<2; j++ )
{
int which = (entry*2)+(j*2);
- int r = nthbyte(machine->generic.paletteram.u32, which+0x00001);
- int g = nthbyte(machine->generic.paletteram.u32, which+0x10001);
- int b = nthbyte(machine->generic.paletteram.u32, which+0x20001);
+ int r = nthbyte(machine.generic.paletteram.u32, which+0x00001);
+ int g = nthbyte(machine.generic.paletteram.u32, which+0x10001);
+ int b = nthbyte(machine.generic.paletteram.u32, which+0x20001);
palette_set_color( machine, which/2, MAKE_RGB(r,g,b) );
}
}
@@ -1094,9 +1094,9 @@ INLINE void UpdatePalette( running_machine *machine, int entry )
static WRITE32_HANDLER( namcos23_paletteram_w )
{
- COMBINE_DATA( &space->machine->generic.paletteram.u32[offset] );
+ COMBINE_DATA( &space->machine().generic.paletteram.u32[offset] );
- UpdatePalette(space->machine, (offset % (0x10000/4))*2);
+ UpdatePalette(space->machine(), (offset % (0x10000/4))*2);
}
static READ16_HANDLER(s23_c417_r)
@@ -1116,7 +1116,7 @@ static READ16_HANDLER(s23_c417_r)
1: 1st c435 busy (inverted)
0: xcpreq
*/
- case 0: return 0x8e | (space->machine->primary_screen->vblank() ? 0x0000 : 0x8000);
+ case 0: return 0x8e | (space->machine().primary_screen->vblank() ? 0x0000 : 0x8000);
case 1: return c417_adr;
case 4:
// logerror("c417_r %04x = %04x (%08x, %08x)\n", c417_adr, c417_ram[c417_adr], cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
@@ -1157,7 +1157,7 @@ static WRITE16_HANDLER(s23_c417_w)
break;
case 7:
logerror("c417_w: ack IRQ 2 (%x)\n", data);
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ2, CLEAR_LINE);
break;
default:
logerror("c417_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
@@ -1289,7 +1289,7 @@ static WRITE16_HANDLER(s23_ctl_w)
case 2: case 3:
// These may be coming from another CPU, in particular the I/O one
- ctl_inp_buffer[offset-2] = input_port_read(space->machine, offset == 2 ? "P1" : "P2");
+ ctl_inp_buffer[offset-2] = input_port_read(space->machine(), offset == 2 ? "P1" : "P2");
break;
case 5:
if(ctl_vbl_active) {
@@ -1312,7 +1312,7 @@ static READ16_HANDLER(s23_ctl_r)
{
switch(offset) {
// 0100 set freezes gorgon (polygon fifo flag)
- case 1: return 0x0000 | input_port_read(space->machine, "DSW");
+ case 1: return 0x0000 | input_port_read(space->machine(), "DSW");
case 2: case 3: {
UINT16 res = ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000;
ctl_inp_buffer[offset-2] = (ctl_inp_buffer[offset-2] << 1) | 1;
@@ -1349,12 +1349,12 @@ static WRITE16_HANDLER(s23_c361_w)
c361_scanline = data;
if (data == 0x1ff)
{
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ1, CLEAR_LINE);
c361_timer->adjust(attotime::never);
}
else
{
- c361_timer->adjust(space->machine->primary_screen->time_until_pos(c361_scanline));
+ c361_timer->adjust(space->machine().primary_screen->time_until_pos(c361_scanline));
}
break;
@@ -1366,8 +1366,8 @@ static WRITE16_HANDLER(s23_c361_w)
static READ16_HANDLER(s23_c361_r)
{
switch(offset) {
- case 5: return space->machine->primary_screen->vpos()*2 | (space->machine->primary_screen->vblank() ? 1 : 0);
- case 6: return space->machine->primary_screen->vblank();
+ case 5: return space->machine().primary_screen->vpos()*2 | (space->machine().primary_screen->vblank() ? 1 : 0);
+ case 6: return space->machine().primary_screen->vblank();
}
logerror("c361_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
return 0xffff;
@@ -1386,12 +1386,12 @@ static WRITE16_HANDLER(s23_c422_w)
if (data == 0xfffb)
{
logerror("c422_w: raise IRQ 3\n");
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ3, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ3, ASSERT_LINE);
}
else if (data == 0x000f)
{
logerror("c422_w: ack IRQ 3\n");
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ3, CLEAR_LINE);
}
break;
@@ -1417,16 +1417,16 @@ static WRITE32_HANDLER( s23_mcuen_w )
// Panic Park: writing 1 when it's already running means reboot?
if (s23_subcpu_running)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
s23_subcpu_running = 1;
}
else
{
logerror("S23: stopping H8/3002\n");
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
s23_subcpu_running = 0;
}
}
@@ -1451,7 +1451,7 @@ static WRITE32_HANDLER( gorgon_sharedram_w )
if ((offset == 0x6000/4) && (data == 0) && (mem_mask == 0xff000000))
{
logerror("S23: Final Furlong hack stopping H8/3002\n");
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
}
@@ -1807,7 +1807,7 @@ static WRITE32_HANDLER( p3d_w)
p3d_dma(space, p3d_address, p3d_size);
return;
case 0x17:
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ1, CLEAR_LINE);
c361_timer->adjust(attotime::never);
return;
}
@@ -1841,7 +1841,7 @@ static void render_project(poly_vertex &pv)
pv.p[0] = w;
}
-static void render_one_model(running_machine *machine, const namcos23_render_entry *re)
+static void render_one_model(running_machine &machine, const namcos23_render_entry *re)
{
UINT32 adr = ptrom[re->model.model];
if(adr >= ptrom_limit) {
@@ -1932,7 +1932,7 @@ static void render_one_model(running_machine *machine, const namcos23_render_ent
p->zkey = 0.5*(minz+maxz);
p->front = !(h & 0x00000001);
p->rd.texture_lookup = texture_lookup_nocache_point;
- p->rd.pens = machine->pens + (color << 8);
+ p->rd.pens = machine.pens + (color << 8);
render_poly_count++;
}
@@ -1952,7 +1952,7 @@ static int render_poly_compare(const void *i1, const void *i2)
return p1->zkey < p2->zkey ? 1 : p1->zkey > p2->zkey ? -1 : 0;
}
-static void render_flush(running_machine *machine, bitmap_t *bitmap)
+static void render_flush(running_machine &machine, bitmap_t *bitmap)
{
if(!render_poly_count)
return;
@@ -1973,7 +1973,7 @@ static void render_flush(running_machine *machine, bitmap_t *bitmap)
render_poly_count = 0;
}
-static void render_run(running_machine *machine, bitmap_t *bitmap)
+static void render_run(running_machine &machine, bitmap_t *bitmap)
{
render_poly_count = 0;
const namcos23_render_entry *re = render_entries[!render_cur];
@@ -1996,14 +1996,14 @@ static void render_run(running_machine *machine, bitmap_t *bitmap)
static VIDEO_START( ss23 )
{
- gfx_element_set_source(machine->gfx[0], (UINT8 *)namcos23_charram);
+ gfx_element_set_source(machine.gfx[0], (UINT8 *)namcos23_charram);
bgtilemap = tilemap_create(machine, TextTilemapGetInfo, tilemap_scan_rows, 16, 16, 64, 64);
tilemap_set_transparent_pen(bgtilemap, 0xf);
// Gorgon's tilemap offset is 0, S23/SS23's is 860
- if ((!strcmp(machine->system().name, "rapidrvr")) ||
- (!strcmp(machine->system().name, "rapidrvr2")) ||
- (!strcmp(machine->system().name, "finlflng")))
+ if ((!strcmp(machine.system().name, "rapidrvr")) ||
+ (!strcmp(machine.system().name, "rapidrvr2")) ||
+ (!strcmp(machine.system().name, "finlflng")))
{
tilemap_set_scrolldx(bgtilemap, 0, 0);
}
@@ -2016,11 +2016,11 @@ static VIDEO_START( ss23 )
static SCREEN_UPDATE( ss23 )
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- render_run( screen->machine, bitmap );
+ render_run( screen->machine(), bitmap );
- gfx_element *gfx = screen->machine->gfx[0];
+ gfx_element *gfx = screen->machine().gfx[0];
memset(gfx->dirty, 1, gfx->total_elements);
tilemap_draw( bitmap, cliprect, bgtilemap, 0/*flags*/, 0/*priority*/ ); /* opaque */
@@ -2040,7 +2040,7 @@ static INTERRUPT_GEN(s23_interrupt)
static MACHINE_START( s23 )
{
- c361_timer = machine->scheduler().timer_alloc(FUNC(c361_timer_cb));
+ c361_timer = machine.scheduler().timer_alloc(FUNC(c361_timer_cb));
c361_timer->adjust(attotime::never);
}
@@ -2104,7 +2104,7 @@ ADDRESS_MAP_END
static READ32_HANDLER( gmen_trigger_sh2 )
{
logerror("gmen_trigger_sh2: booting SH-2\n");
- cputag_set_input_line(space->machine, "gmen", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "gmen", INPUT_LINE_RESET, CLEAR_LINE);
return 0;
}
@@ -2164,7 +2164,7 @@ static WRITE16_HANDLER( sub_interrupt_main_w )
{
if ((mem_mask == 0xffff) && (data == 0x3170))
{
- cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", MIPS3_IRQ1, ASSERT_LINE);
}
else
{
@@ -2222,7 +2222,7 @@ static READ8_HANDLER( s23_mcu_rtc_r )
system_time systime;
static const int weekday[7] = { 7, 1, 2, 3, 4, 5, 6 };
- space->machine->current_datetime(systime);
+ space->machine().current_datetime(systime);
switch (s23_rtcstate)
{
@@ -2312,12 +2312,12 @@ static READ8_HANDLER( s23_mcu_iob_r )
if (im_rd == im_wr)
{
- cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
}
else
{
- cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
- cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
}
return ret;
@@ -2328,7 +2328,7 @@ static WRITE8_HANDLER( s23_mcu_iob_w )
maintoio[mi_wr++] = data;
mi_wr &= 0x7f;
- cputag_set_input_line(space->machine, "ioboard", H8_SCI_0_RX, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "ioboard", H8_SCI_0_RX, ASSERT_LINE);
}
static INPUT_PORTS_START( gorgon )
@@ -2551,7 +2551,7 @@ static READ8_HANDLER( s23_iob_mcu_r )
if (mi_rd == mi_wr)
{
- cputag_set_input_line(space->machine, "ioboard", H8_SCI_0_RX, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "ioboard", H8_SCI_0_RX, CLEAR_LINE);
}
return ret;
@@ -2562,7 +2562,7 @@ static WRITE8_HANDLER( s23_iob_mcu_w )
iotomain[im_wr++] = data;
im_wr &= 0x7f;
- cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
}
static UINT8 s23_tssio_port_4 = 0;
@@ -2581,7 +2581,7 @@ static WRITE8_HANDLER( s23_iob_p4_w )
static READ8_HANDLER(iob_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
/* H8/3334 (Namco C78) I/O board MCU */
@@ -2627,14 +2627,14 @@ ADDRESS_MAP_END
static DRIVER_INIT(ss23)
{
- ptrom = (const UINT32 *)machine->region("pointrom")->base();
- tmlrom = (const UINT16 *)machine->region("textilemapl")->base();
- tmhrom = machine->region("textilemaph")->base();
- texrom = machine->region("textile")->base();
+ ptrom = (const UINT32 *)machine.region("pointrom")->base();
+ tmlrom = (const UINT16 *)machine.region("textilemapl")->base();
+ tmhrom = machine.region("textilemaph")->base();
+ texrom = machine.region("textile")->base();
- tileid_mask = (machine->region("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
- tile_mask = machine->region("textile")->bytes()/256 - 1;
- ptrom_limit = machine->region("pointrom")->bytes()/4;
+ tileid_mask = (machine.region("textilemapl")->bytes()/2 - 1) & ~0xff; // Used for y masking
+ tile_mask = machine.region("textile")->bytes()/256 - 1;
+ ptrom_limit = machine.region("pointrom")->bytes()/4;
mi_rd = mi_wr = im_rd = im_wr = 0;
namcos23_jvssense = 1;
@@ -2649,21 +2649,21 @@ static DRIVER_INIT(ss23)
render_count[0] = render_count[1] = 0;
render_cur = 0;
- if ((!strcmp(machine->system().name, "motoxgo")) ||
- (!strcmp(machine->system().name, "panicprk")) ||
- (!strcmp(machine->system().name, "rapidrvr")) ||
- (!strcmp(machine->system().name, "rapidrvr2")) ||
- (!strcmp(machine->system().name, "finlflng")) ||
- (!strcmp(machine->system().name, "gunwars")) ||
- (!strcmp(machine->system().name, "downhill")) ||
- (!strcmp(machine->system().name, "finfurl2")) ||
- (!strcmp(machine->system().name, "finfurl2j")) ||
- (!strcmp(machine->system().name, "raceon")) ||
- (!strcmp(machine->system().name, "crszone")) ||
- (!strcmp(machine->system().name, "crszonea")) ||
- (!strcmp(machine->system().name, "crszoneb")) ||
- (!strcmp(machine->system().name, "timecrs2b")) ||
- (!strcmp(machine->system().name, "timecrs2")))
+ if ((!strcmp(machine.system().name, "motoxgo")) ||
+ (!strcmp(machine.system().name, "panicprk")) ||
+ (!strcmp(machine.system().name, "rapidrvr")) ||
+ (!strcmp(machine.system().name, "rapidrvr2")) ||
+ (!strcmp(machine.system().name, "finlflng")) ||
+ (!strcmp(machine.system().name, "gunwars")) ||
+ (!strcmp(machine.system().name, "downhill")) ||
+ (!strcmp(machine.system().name, "finfurl2")) ||
+ (!strcmp(machine.system().name, "finfurl2j")) ||
+ (!strcmp(machine.system().name, "raceon")) ||
+ (!strcmp(machine.system().name, "crszone")) ||
+ (!strcmp(machine.system().name, "crszonea")) ||
+ (!strcmp(machine.system().name, "crszoneb")) ||
+ (!strcmp(machine.system().name, "timecrs2b")) ||
+ (!strcmp(machine.system().name, "timecrs2")))
{
has_jvsio = 1;
}
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index 196bd095310..5e7f6f30efe 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -184,29 +184,29 @@ TODO:
static WRITE8_HANDLER( bankswitch1_w )
{
- UINT8 *base = space->machine->region("cpu1")->base() + 0x10000;
+ UINT8 *base = space->machine().region("cpu1")->base() + 0x10000;
/* if the ROM expansion module is available, don't do anything. This avoids conflict */
/* with bankswitch1_ext_w() in wndrmomo */
- if (space->machine->region("user1")->base()) return;
+ if (space->machine().region("user1")->base()) return;
- memory_set_bankptr(space->machine, "bank1",base + ((data & 0x03) * 0x2000));
+ memory_set_bankptr(space->machine(), "bank1",base + ((data & 0x03) * 0x2000));
}
static WRITE8_HANDLER( bankswitch1_ext_w )
{
- UINT8 *base = space->machine->region("user1")->base();
+ UINT8 *base = space->machine().region("user1")->base();
if (base == 0) return;
- memory_set_bankptr(space->machine, "bank1",base + ((data & 0x1f) * 0x2000));
+ memory_set_bankptr(space->machine(), "bank1",base + ((data & 0x1f) * 0x2000));
}
static WRITE8_HANDLER( bankswitch2_w )
{
- UINT8 *base = space->machine->region("cpu2")->base() + 0x10000;
+ UINT8 *base = space->machine().region("cpu2")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank2",base + ((data & 0x03) * 0x2000));
+ memory_set_bankptr(space->machine(), "bank2",base + ((data & 0x03) * 0x2000));
}
/* Stubs to pass the correct Dip Switch setup to the MCU */
@@ -214,15 +214,15 @@ static READ8_HANDLER( dsw0_r )
{
int rhi, rlo;
- rhi = ( input_port_read(space->machine, "DSWA") & 0x01 ) << 4;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x04 ) << 3;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x10 ) << 2;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x40 ) << 1;
+ rhi = ( input_port_read(space->machine(), "DSWA") & 0x01 ) << 4;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x04 ) << 3;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x10 ) << 2;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x40 ) << 1;
- rlo = ( input_port_read(space->machine, "DSWB") & 0x01 );
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x04 ) >> 1;
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x10 ) >> 2;
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x40 ) >> 3;
+ rlo = ( input_port_read(space->machine(), "DSWB") & 0x01 );
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x04 ) >> 1;
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x10 ) >> 2;
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x40 ) >> 3;
return rhi | rlo;
}
@@ -231,15 +231,15 @@ static READ8_HANDLER( dsw1_r )
{
int rhi, rlo;
- rhi = ( input_port_read(space->machine, "DSWA") & 0x02 ) << 3;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x08 ) << 2;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x20 ) << 1;
- rhi |= ( input_port_read(space->machine, "DSWA") & 0x80 );
+ rhi = ( input_port_read(space->machine(), "DSWA") & 0x02 ) << 3;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x08 ) << 2;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x20 ) << 1;
+ rhi |= ( input_port_read(space->machine(), "DSWA") & 0x80 );
- rlo = ( input_port_read(space->machine, "DSWB") & 0x02 ) >> 1;
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x08 ) >> 2;
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x20 ) >> 3;
- rlo |= ( input_port_read(space->machine, "DSWB") & 0x80 ) >> 4;
+ rlo = ( input_port_read(space->machine(), "DSWB") & 0x02 ) >> 1;
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x08 ) >> 2;
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x20 ) >> 3;
+ rlo |= ( input_port_read(space->machine(), "DSWB") & 0x80 ) >> 4;
return rhi | rlo;
}
@@ -247,18 +247,18 @@ static READ8_HANDLER( dsw1_r )
static WRITE8_HANDLER( int_ack1_w )
{
- cputag_set_input_line(space->machine, "cpu1", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "cpu1", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( int_ack2_w )
{
- cputag_set_input_line(space->machine, "cpu2", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "cpu2", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( watchdog1_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->wdog |= 1;
if (state->wdog == 3)
{
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( watchdog1_w )
static WRITE8_HANDLER( watchdog2_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->wdog |= 2;
if (state->wdog == 3)
{
@@ -281,22 +281,22 @@ static WRITE8_HANDLER( watchdog2_w )
static WRITE8_HANDLER( namcos86_coin_w )
{
- coin_lockout_global_w(space->machine, data & 1);
- coin_counter_w(space->machine, 0,~data & 2);
- coin_counter_w(space->machine, 1,~data & 4);
+ coin_lockout_global_w(space->machine(), data & 1);
+ coin_counter_w(space->machine(), 0,~data & 2);
+ coin_counter_w(space->machine(), 1,~data & 4);
}
static WRITE8_HANDLER( namcos86_led_w )
{
- set_led_status(space->machine, 0,data & 0x08);
- set_led_status(space->machine, 1,data & 0x10);
+ set_led_status(space->machine(), 0,data & 0x08);
+ set_led_status(space->machine(), 1,data & 0x10);
}
static WRITE8_HANDLER( cus115_w )
{
/* make sure the expansion board is present */
- if (!space->machine->region("user1")->base())
+ if (!space->machine().region("user1")->base())
{
popmessage("expansion board not present");
return;
@@ -308,7 +308,7 @@ static WRITE8_HANDLER( cus115_w )
case 1:
case 2:
case 3:
- namco_63701x_w(space->machine->device("namco2"), (offset & 0x1e00) >> 9,data);
+ namco_63701x_w(space->machine().device("namco2"), (offset & 0x1e00) >> 9,data);
break;
case 4:
@@ -326,7 +326,7 @@ static WRITE8_HANDLER( cus115_w )
static MACHINE_RESET( namco86 )
{
- UINT8 *base = machine->region("cpu1")->base() + 0x10000;
+ UINT8 *base = machine.region("cpu1")->base() + 0x10000;
memory_set_bankptr(machine, "bank1",base);
}
@@ -1474,8 +1474,8 @@ static DRIVER_INIT( namco86 )
UINT8 *buffer;
/* shuffle tile ROMs so regular gfx unpack routines can be used */
- gfx = machine->region("gfx1")->base();
- size = machine->region("gfx1")->bytes() * 2 / 3;
+ gfx = machine.region("gfx1")->base();
+ size = machine.region("gfx1")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
@@ -1499,8 +1499,8 @@ static DRIVER_INIT( namco86 )
auto_free( machine, buffer );
}
- gfx = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes() * 2 / 3;
+ gfx = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes() * 2 / 3;
buffer = auto_alloc_array(machine, UINT8, size );
{
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 4938c9de8d2..8d4f9eb11e1 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -1426,7 +1426,7 @@ static NVRAM_HANDLER( naomi_eeproms )
// some games require defaults to boot (vertical, 1 player etc.)
for (i=0; i<ARRAY_LENGTH(jvseeprom_default_game); i++)
- if (!strcmp(machine->system().name, jvseeprom_default_game[i].name))
+ if (!strcmp(machine.system().name, jvseeprom_default_game[i].name))
{
jvseeprom_default = jvseeprom_default_game[i].eeprom;
break;
@@ -1636,7 +1636,7 @@ static WRITE64_HANDLER( aw_flash_w )
awflash->write(addr, data);
}
-INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
+INLINE int decode_reg32_64(running_machine &machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
{
int reg = offset * 2;
@@ -1645,7 +1645,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m
// non 32-bit accesses have not yet been seen here, we need to know when they are
if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
- mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context());
+ mame_printf_verbose("%s:Wrong mask!\n", machine.describe_context());
// debugger_break(machine);
}
@@ -1663,11 +1663,11 @@ static READ64_HANDLER( aw_modem_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
if (reg == 0x280/4)
{
- UINT32 coins = input_port_read(space->machine, "COINS");
+ UINT32 coins = input_port_read(space->machine(), "COINS");
if (coins & 0x01)
{
@@ -1691,7 +1691,7 @@ static WRITE64_HANDLER( aw_modem_w )
UINT64 shift;
UINT32 dat;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
mame_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask);
}
@@ -1758,7 +1758,7 @@ ADDRESS_MAP_END
*/
static void aica_irq(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", ARM7_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", ARM7_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2005,7 +2005,7 @@ INPUT_PORTS_END
static MACHINE_RESET( naomi )
{
MACHINE_RESET_CALL(dc);
- aica_set_ram_base(machine->device("aica"), dc_sound_ram, 8*1024*1024);
+ aica_set_ram_base(machine.device("aica"), dc_sound_ram, 8*1024*1024);
}
/*
@@ -6600,9 +6600,9 @@ static const UINT32 rumblef2_key = 0xd674a;
static DRIVER_INIT( atomiswave )
{
- UINT64 *ROM = (UINT64 *)machine->region("awflash")->base();
+ UINT64 *ROM = (UINT64 *)machine.region("awflash")->base();
#if 0
- UINT8 *dcdata = (UINT8 *)machine->region("user1")->base();
+ UINT8 *dcdata = (UINT8 *)machine.region("user1")->base();
FILE *f;
f = fopen("aw.bin", "wb");
@@ -6612,15 +6612,15 @@ static DRIVER_INIT( atomiswave )
// patch out long startup delay
ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (UINT64)0x0009<<48;
- awflash = machine->device<macronix_29l001mc_device>("awflash");
+ awflash = machine.device<macronix_29l001mc_device>("awflash");
}
#define AW_DRIVER_INIT(DRIVER) \
static DRIVER_INIT(DRIVER) \
{ \
int i; \
- UINT16 *src = (UINT16 *)(machine->region("user1")->base()); \
- int rom_size = machine->region("user1")->bytes(); \
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base()); \
+ int rom_size = machine.region("user1")->bytes(); \
for(i=0; i<rom_size/2; i++) \
{ \
src[i] = atomiswave_decrypt(src[i], i*2, DRIVER##_key); \
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index f4bfd92bc27..a27a901d450 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -112,15 +112,15 @@ TODO:
static READ8_HANDLER( in0_port_r )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
- int in0 = input_port_read(space->machine, "IN0");
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
+ int in0 = input_port_read(space->machine(), "IN0");
if ( state->cocktail )
{
// cabinet == cocktail -AND- handling player 2
in0 = ( in0 & 0x03 ) | // start buttons
- ( input_port_read(space->machine, "IN0_COCKTAIL") & 0xFC ); // cocktail inputs
+ ( input_port_read(space->machine(), "IN0_COCKTAIL") & 0xFC ); // cocktail inputs
}
return in0;
@@ -130,8 +130,8 @@ static READ8_HANDLER( dsw0_port_r )
{
// vblank replaces the cabinet dip
- return ( ( input_port_read(space->machine, "DSW0") & 0x7F ) | // dsw0
- ( input_port_read(space->machine, "FAKE") & 0x80 ) ); // vblank
+ return ( ( input_port_read(space->machine(), "DSW0") & 0x7F ) | // dsw0
+ ( input_port_read(space->machine(), "FAKE") & 0x80 ) ); // vblank
}
/* Pop Flamer
@@ -144,7 +144,7 @@ static READ8_HANDLER( dsw0_port_r )
static READ8_HANDLER( popflame_protection_r ) /* Not used by bootleg/hack */
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
static const int seed00[4] = { 0x78, 0x68, 0x48, 0x38|0x80 };
static const int seed10[4] = { 0x68, 0x60, 0x68, 0x60|0x80 };
UINT8 seedxx;
@@ -184,7 +184,7 @@ static READ8_HANDLER( popflame_protection_r ) /* Not used by bootleg/hack */
static WRITE8_HANDLER( popflame_protection_w )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
/*
Alternative protection check is executed at the end of stage 3, it seems some kind of pseudo "EEPROM" device:
2720: 21 98 B0 ld hl,$B098
@@ -284,7 +284,7 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( naughtyb_interrupt )
{
- if (input_port_read(device->machine, "FAKE") & 1)
+ if (input_port_read(device->machine(), "FAKE") & 1)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -854,22 +854,22 @@ ROM_END
static DRIVER_INIT( popflame )
{
/* install a handler to catch protection checks */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9000, 0x9000, FUNC(popflame_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9090, 0x9090, FUNC(popflame_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9000, 0x9000, FUNC(popflame_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9090, 0x9090, FUNC(popflame_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb000, 0xb0ff, FUNC(popflame_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb000, 0xb0ff, FUNC(popflame_protection_w));
}
static READ8_HANDLER( trvmstr_questions_r )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
- return space->machine->region("user1")->base()[state->question_offset];
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
+ return space->machine().region("user1")->base()[state->question_offset];
}
static WRITE8_HANDLER( trvmstr_questions_w )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
switch(offset)
{
case 0:
@@ -887,7 +887,7 @@ static WRITE8_HANDLER( trvmstr_questions_w )
static DRIVER_INIT( trvmstr )
{
/* install questions' handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc000, 0xc002, FUNC(trvmstr_questions_r), FUNC(trvmstr_questions_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xc000, 0xc002, FUNC(trvmstr_questions_r), FUNC(trvmstr_questions_w));
}
diff --git a/src/mame/drivers/nbmj8688.c b/src/mame/drivers/nbmj8688.c
index 9b3c40cee4f..d4c921ec3f8 100644
--- a/src/mame/drivers/nbmj8688.c
+++ b/src/mame/drivers/nbmj8688.c
@@ -67,8 +67,8 @@ static DRIVER_INIT( otonano )
static DRIVER_INIT( mjcamera )
{
- UINT8 *rom = machine->region("voice")->base() + 0x20000;
- UINT8 *prot = machine->region("user1")->base();
+ UINT8 *rom = machine.region("voice")->base() + 0x20000;
+ UINT8 *prot = machine.region("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -87,7 +87,7 @@ static DRIVER_INIT( mjcamera )
static DRIVER_INIT( kanatuen )
{
/* uses the same protection data as mjcamer, but a different check */
- UINT8 *rom = machine->region("voice")->base() + 0x30000;
+ UINT8 *rom = machine.region("voice")->base() + 0x30000;
rom[0x0004] = 0x09;
rom[0x0103] = 0x0e;
@@ -101,7 +101,7 @@ static DRIVER_INIT( kyuhito )
{
#if 1
/* uses the same protection data as ????, but a different check */
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x0149] = 0x00;
rom[0x014a] = 0x00;
@@ -113,8 +113,8 @@ static DRIVER_INIT( kyuhito )
static DRIVER_INIT( idhimitu )
{
- UINT8 *rom = machine->region("voice")->base() + 0x20000;
- UINT8 *prot = machine->region("user1")->base();
+ UINT8 *rom = machine.region("voice")->base() + 0x20000;
+ UINT8 *prot = machine.region("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -138,8 +138,8 @@ static DRIVER_INIT( kaguya )
static DRIVER_INIT( kaguya2 )
{
- UINT8 *rom = machine->region("voice")->base() + 0x20000;
- UINT8 *prot = machine->region("user1")->base();
+ UINT8 *rom = machine.region("voice")->base() + 0x20000;
+ UINT8 *prot = machine.region("user1")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -325,8 +325,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( barline_output_w )
{
- coin_lockout_w(space->machine, 0,~data & 0x80);
- coin_counter_w(space->machine, 0,data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x80);
+ coin_counter_w(space->machine(), 0,data & 0x02);
}
static ADDRESS_MAP_START( barline_io_map, AS_IO, 8 )
diff --git a/src/mame/drivers/nbmj8891.c b/src/mame/drivers/nbmj8891.c
index 5ea51277eda..6e24045cb22 100644
--- a/src/mame/drivers/nbmj8891.c
+++ b/src/mame/drivers/nbmj8891.c
@@ -61,7 +61,7 @@ TODO:
static DRIVER_INIT( gionbana )
{
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -85,7 +85,7 @@ static DRIVER_INIT( mgion )
static DRIVER_INIT( omotesnd )
{
#if 0
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -100,7 +100,7 @@ static DRIVER_INIT( omotesnd )
#endif
#if 1
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// Protection ROM check skip
ROM[0x0106] = 0x00;
@@ -135,7 +135,7 @@ static DRIVER_INIT( msjiken )
static DRIVER_INIT( telmahjn )
{
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -153,7 +153,7 @@ static DRIVER_INIT( telmahjn )
static DRIVER_INIT( mgmen89 )
{
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -171,8 +171,8 @@ static DRIVER_INIT( mgmen89 )
static DRIVER_INIT( mjfocus )
{
- UINT8 *prot = machine->region("protection")->base();
- UINT8 *ram = machine->region("maincpu")->base() + 0xf800;
+ UINT8 *prot = machine.region("protection")->base();
+ UINT8 *ram = machine.region("maincpu")->base() + 0xf800;
int i;
/* need to clear RAM otherwise it doesn't boot... */
@@ -194,7 +194,7 @@ static DRIVER_INIT( mjfocus )
static DRIVER_INIT( mjfocusm )
{
#if 1
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// Protection ROM check skip
ROM[0x014e] = 0x00;
@@ -206,7 +206,7 @@ static DRIVER_INIT( mjfocusm )
static DRIVER_INIT( scandal )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -223,10 +223,10 @@ static DRIVER_INIT( mjnanpas )
{
/* they forgot to enable the protection check in this game... */
#if 0
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
- machine->region("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
+ machine.region("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed
/* this is one possible way to rearrange the protection ROM data to get the
expected 0xfe1a checksum. It's probably completely wrong! But since the
@@ -284,7 +284,7 @@ static DRIVER_INIT( hanaoji )
static DRIVER_INIT( pairsnb )
{
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -302,7 +302,7 @@ static DRIVER_INIT( pairsnb )
static DRIVER_INIT( pairsten )
{
- UINT8 *prot = machine->region("protection")->base();
+ UINT8 *prot = machine.region("protection")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
diff --git a/src/mame/drivers/nbmj8900.c b/src/mame/drivers/nbmj8900.c
index cde2ee6d7d6..cb9a64634fe 100644
--- a/src/mame/drivers/nbmj8900.c
+++ b/src/mame/drivers/nbmj8900.c
@@ -45,7 +45,7 @@ TODO:
static DRIVER_INIT( ohpaipee )
{
#if 0
- UINT8 *prot = machine->region("protdata")->base();
+ UINT8 *prot = machine.region("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -59,7 +59,7 @@ static DRIVER_INIT( ohpaipee )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine->region("maincpu")->base();
+ unsigned char *ROM = machine.region("maincpu")->base();
// Protection ROM check skip
ROM[0x00e4] = 0x00;
@@ -78,7 +78,7 @@ static DRIVER_INIT( ohpaipee )
static DRIVER_INIT( togenkyo )
{
#if 0
- UINT8 *prot = machine->region("protdata")->base();
+ UINT8 *prot = machine.region("protdata")->base();
int i;
/* this is one possible way to rearrange the protection ROM data to get the
@@ -91,7 +91,7 @@ static DRIVER_INIT( togenkyo )
prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
}
#else
- unsigned char *ROM = machine->region("maincpu")->base();
+ unsigned char *ROM = machine.region("maincpu")->base();
// Protection ROM check skip
ROM[0x010b] = 0x00;
diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c
index 78283a6db85..622dd295eb4 100644
--- a/src/mame/drivers/nbmj8991.c
+++ b/src/mame/drivers/nbmj8991.c
@@ -49,7 +49,7 @@ Notes:
static WRITE8_HANDLER( nbmj8991_soundbank_w )
{
if (!(data & 0x80)) soundlatch_clear_w(space, 0, 0);
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE8_HANDLER( nbmj8991_sound_w )
@@ -67,10 +67,10 @@ static READ8_HANDLER( nbmj8991_sound_r )
static MACHINE_RESET( nbmj8991 )
{
- device_t *audiocpu = machine->device("audiocpu");
+ device_t *audiocpu = machine.device("audiocpu");
if (audiocpu != NULL && audiocpu->type() == Z80)
{
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x8000, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x8000, 0x8000);
memory_set_bank(machine, "bank1", 0);
}
MACHINE_RESET_CALL(nb1413m3);
@@ -108,7 +108,7 @@ static DRIVER_INIT( vanilla )
static DRIVER_INIT( finalbny )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00;
@@ -134,7 +134,7 @@ static DRIVER_INIT( hyouban )
static DRIVER_INIT( galkaika )
{
#if 1
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -145,7 +145,7 @@ static DRIVER_INIT( galkaika )
static DRIVER_INIT( tokyogal )
{
#if 1
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
@@ -156,7 +156,7 @@ static DRIVER_INIT( tokyogal )
static DRIVER_INIT( tokimbsj )
{
#if 1
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// Patch to IM2 -> IM1
ROM[0x0002] = 0x56;
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 4279da91b0b..6df8526bf37 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -40,9 +40,9 @@ Notes:
static WRITE8_HANDLER( nbmj9195_soundbank_w )
{
- UINT8 *SNDROM = space->machine->region("audiocpu")->base();
+ UINT8 *SNDROM = space->machine().region("audiocpu")->base();
- memory_set_bankptr(space->machine, "bank1", &SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
+ memory_set_bankptr(space->machine(), "bank1", &SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
static READ8_HANDLER( nbmj9195_sound_r )
@@ -62,7 +62,7 @@ static WRITE8_HANDLER( nbmj9195_soundclr_w )
static void nbmj9195_outcoin_flag_w(address_space *space, int data)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
// bit0: coin in counter
// bit1: coin out counter
// bit2: hopper
@@ -74,19 +74,19 @@ static void nbmj9195_outcoin_flag_w(address_space *space, int data)
static WRITE8_HANDLER( nbmj9195_inputportsel_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->inputport = (data ^ 0xff);
}
-static int nbmj9195_dipsw_r(running_machine *machine)
+static int nbmj9195_dipsw_r(running_machine &machine)
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
return ((((input_port_read(machine, "DSWA") & 0xff) | ((input_port_read(machine, "DSWB") & 0xff) << 8)) >> state->dipswbitsel) & 0x01);
}
static void nbmj9195_dipswbitsel_w(address_space *space, int data)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
switch (data & 0xc0)
{
case 0x00:
@@ -106,26 +106,26 @@ static void nbmj9195_dipswbitsel_w(address_space *space, int data)
static void mscoutm_inputportsel_w(address_space *space, int data)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->mscoutm_inputport = (data ^ 0xff);
}
static READ8_HANDLER( mscoutm_dipsw_0_r )
{
// DIPSW A
- return (((input_port_read(space->machine, "DSWA") & 0x01) << 7) | ((input_port_read(space->machine, "DSWA") & 0x02) << 5) |
- ((input_port_read(space->machine, "DSWA") & 0x04) << 3) | ((input_port_read(space->machine, "DSWA") & 0x08) << 1) |
- ((input_port_read(space->machine, "DSWA") & 0x10) >> 1) | ((input_port_read(space->machine, "DSWA") & 0x20) >> 3) |
- ((input_port_read(space->machine, "DSWA") & 0x40) >> 5) | ((input_port_read(space->machine, "DSWA") & 0x80) >> 7));
+ return (((input_port_read(space->machine(), "DSWA") & 0x01) << 7) | ((input_port_read(space->machine(), "DSWA") & 0x02) << 5) |
+ ((input_port_read(space->machine(), "DSWA") & 0x04) << 3) | ((input_port_read(space->machine(), "DSWA") & 0x08) << 1) |
+ ((input_port_read(space->machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(space->machine(), "DSWA") & 0x20) >> 3) |
+ ((input_port_read(space->machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(space->machine(), "DSWA") & 0x80) >> 7));
}
static READ8_HANDLER( mscoutm_dipsw_1_r )
{
// DIPSW B
- return (((input_port_read(space->machine, "DSWB") & 0x01) << 7) | ((input_port_read(space->machine, "DSWB") & 0x02) << 5) |
- ((input_port_read(space->machine, "DSWB") & 0x04) << 3) | ((input_port_read(space->machine, "DSWB") & 0x08) << 1) |
- ((input_port_read(space->machine, "DSWB") & 0x10) >> 1) | ((input_port_read(space->machine, "DSWB") & 0x20) >> 3) |
- ((input_port_read(space->machine, "DSWB") & 0x40) >> 5) | ((input_port_read(space->machine, "DSWB") & 0x80) >> 7));
+ return (((input_port_read(space->machine(), "DSWB") & 0x01) << 7) | ((input_port_read(space->machine(), "DSWB") & 0x02) << 5) |
+ ((input_port_read(space->machine(), "DSWB") & 0x04) << 3) | ((input_port_read(space->machine(), "DSWB") & 0x08) << 1) |
+ ((input_port_read(space->machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(space->machine(), "DSWB") & 0x20) >> 3) |
+ ((input_port_read(space->machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(space->machine(), "DSWB") & 0x80) >> 7));
}
@@ -134,42 +134,42 @@ static READ8_HANDLER( mscoutm_dipsw_1_r )
static READ8_HANDLER( tmpz84c011_pio_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int portdata;
- if ((!strcmp(space->machine->system().name, "mscoutm")) ||
- (!strcmp(space->machine->system().name, "imekura")) ||
- (!strcmp(space->machine->system().name, "mjegolf")))
+ if ((!strcmp(space->machine().system().name, "mscoutm")) ||
+ (!strcmp(space->machine().system().name, "imekura")) ||
+ (!strcmp(space->machine().system().name, "mjegolf")))
{
switch (offset)
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = input_port_read(space->machine, "SYSTEM");
+ portdata = input_port_read(space->machine(), "SYSTEM");
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (state->mscoutm_inputport)
{
case 0x01:
- portdata = input_port_read(space->machine, "KEY0");
+ portdata = input_port_read(space->machine(), "KEY0");
break;
case 0x02:
- portdata = input_port_read(space->machine, "KEY1");
+ portdata = input_port_read(space->machine(), "KEY1");
break;
case 0x04:
- portdata = input_port_read(space->machine, "KEY2");
+ portdata = input_port_read(space->machine(), "KEY2");
break;
case 0x08:
- portdata = input_port_read(space->machine, "KEY3");
+ portdata = input_port_read(space->machine(), "KEY3");
break;
case 0x10:
- portdata = input_port_read(space->machine, "KEY4");
+ portdata = input_port_read(space->machine(), "KEY4");
break;
default:
- portdata = (input_port_read(space->machine, "KEY0") & input_port_read(space->machine, "KEY1") & input_port_read(space->machine, "KEY2")
- & input_port_read(space->machine, "KEY3") & input_port_read(space->machine, "KEY4"));
+ portdata = (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
+ & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
break;
}
break;
@@ -178,23 +178,23 @@ static READ8_HANDLER( tmpz84c011_pio_r )
switch (state->mscoutm_inputport)
{
case 0x01:
- portdata = input_port_read(space->machine, "KEY5");
+ portdata = input_port_read(space->machine(), "KEY5");
break;
case 0x02:
- portdata = input_port_read(space->machine, "KEY6");
+ portdata = input_port_read(space->machine(), "KEY6");
break;
case 0x04:
- portdata = input_port_read(space->machine, "KEY7");
+ portdata = input_port_read(space->machine(), "KEY7");
break;
case 0x08:
- portdata = input_port_read(space->machine, "KEY8");
+ portdata = input_port_read(space->machine(), "KEY8");
break;
case 0x10:
- portdata = input_port_read(space->machine, "KEY9");
+ portdata = input_port_read(space->machine(), "KEY9");
break;
default:
- portdata = (input_port_read(space->machine, "KEY5") & input_port_read(space->machine, "KEY6") & input_port_read(space->machine, "KEY7")
- & input_port_read(space->machine, "KEY8") & input_port_read(space->machine, "KEY9"));
+ portdata = (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
+ & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
break;
}
break;
@@ -222,7 +222,7 @@ static READ8_HANDLER( tmpz84c011_pio_r )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine().describe_context(), offset);
portdata = 0xff;
break;
}
@@ -233,29 +233,29 @@ static READ8_HANDLER( tmpz84c011_pio_r )
{
case 0: /* PA_0 */
// COIN IN, ETC...
- portdata = ((input_port_read(space->machine, "SYSTEM") & 0xfe) | state->outcoin_flag);
+ portdata = ((input_port_read(space->machine(), "SYSTEM") & 0xfe) | state->outcoin_flag);
break;
case 1: /* PB_0 */
// PLAYER1 KEY, DIPSW A/B
switch (state->inputport)
{
case 0x01:
- portdata = input_port_read(space->machine, "KEY0");
+ portdata = input_port_read(space->machine(), "KEY0");
break;
case 0x02:
- portdata = input_port_read(space->machine, "KEY1");
+ portdata = input_port_read(space->machine(), "KEY1");
break;
case 0x04:
- portdata = input_port_read(space->machine, "KEY2");
+ portdata = input_port_read(space->machine(), "KEY2");
break;
case 0x08:
- portdata = input_port_read(space->machine, "KEY3");
+ portdata = input_port_read(space->machine(), "KEY3");
break;
case 0x10:
- portdata = ((input_port_read(space->machine, "KEY4") & 0x7f) | (nbmj9195_dipsw_r(space->machine) << 7));
+ portdata = ((input_port_read(space->machine(), "KEY4") & 0x7f) | (nbmj9195_dipsw_r(space->machine()) << 7));
break;
default:
- portdata = (input_port_read(space->machine, "KEY0") & input_port_read(space->machine, "KEY1") & input_port_read(space->machine, "KEY2") & input_port_read(space->machine, "KEY3") & (input_port_read(space->machine, "KEY4") & 0x7f));
+ portdata = (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2") & input_port_read(space->machine(), "KEY3") & (input_port_read(space->machine(), "KEY4") & 0x7f));
break;
}
break;
@@ -264,22 +264,22 @@ static READ8_HANDLER( tmpz84c011_pio_r )
switch (state->inputport)
{
case 0x01:
- portdata = input_port_read(space->machine, "KEY5");
+ portdata = input_port_read(space->machine(), "KEY5");
break;
case 0x02:
- portdata = input_port_read(space->machine, "KEY6");
+ portdata = input_port_read(space->machine(), "KEY6");
break;
case 0x04:
- portdata = input_port_read(space->machine, "KEY7");
+ portdata = input_port_read(space->machine(), "KEY7");
break;
case 0x08:
- portdata = input_port_read(space->machine, "KEY8");
+ portdata = input_port_read(space->machine(), "KEY8");
break;
case 0x10:
- portdata = input_port_read(space->machine, "KEY9") & 0x7f;
+ portdata = input_port_read(space->machine(), "KEY9") & 0x7f;
break;
default:
- portdata = (input_port_read(space->machine, "KEY5") & input_port_read(space->machine, "KEY6") & input_port_read(space->machine, "KEY7") & input_port_read(space->machine, "KEY8") & (input_port_read(space->machine, "KEY9") & 0x7f));
+ portdata = (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7") & input_port_read(space->machine(), "KEY8") & (input_port_read(space->machine(), "KEY9") & 0x7f));
break;
}
break;
@@ -307,7 +307,7 @@ static READ8_HANDLER( tmpz84c011_pio_r )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine().describe_context(), offset);
portdata = 0xff;
break;
}
@@ -318,9 +318,9 @@ static READ8_HANDLER( tmpz84c011_pio_r )
static WRITE8_HANDLER( tmpz84c011_pio_w )
{
- if ((!strcmp(space->machine->system().name, "imekura")) ||
- (!strcmp(space->machine->system().name, "mscoutm")) ||
- (!strcmp(space->machine->system().name, "mjegolf")))
+ if ((!strcmp(space->machine().system().name, "imekura")) ||
+ (!strcmp(space->machine().system().name, "mscoutm")) ||
+ (!strcmp(space->machine().system().name, "mjegolf")))
{
switch (offset)
@@ -343,10 +343,10 @@ static WRITE8_HANDLER( tmpz84c011_pio_w )
nbmj9195_soundbank_w(space, 0, data);
break;
case 6: /* PB_1 */
- DAC_WRITE(space->machine->device("dac2"), 0, data);
+ DAC_WRITE(space->machine().device("dac2"), 0, data);
break;
case 7: /* PC_1 */
- DAC_WRITE(space->machine->device("dac1"), 0, data);
+ DAC_WRITE(space->machine().device("dac1"), 0, data);
break;
case 8: /* PD_1 */
break;
@@ -355,7 +355,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine().describe_context(), offset, data);
break;
}
}
@@ -381,10 +381,10 @@ static WRITE8_HANDLER( tmpz84c011_pio_w )
nbmj9195_soundbank_w(space, 0, data);
break;
case 6: /* PB_1 */
- DAC_WRITE(space->machine->device("dac2"), 0, data);
+ DAC_WRITE(space->machine().device("dac2"), 0, data);
break;
case 7: /* PC_1 */
- DAC_WRITE(space->machine->device("dac1"), 0, data);
+ DAC_WRITE(space->machine().device("dac1"), 0, data);
break;
case 8: /* PD_1 */
break;
@@ -393,7 +393,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine().describe_context(), offset, data);
break;
}
}
@@ -405,60 +405,60 @@ static WRITE8_HANDLER( tmpz84c011_pio_w )
/* device 0 */
static READ8_HANDLER( tmpz84c011_0_pa_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]);
}
static READ8_HANDLER( tmpz84c011_0_pb_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]);
}
static READ8_HANDLER( tmpz84c011_0_pc_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]);
}
static READ8_HANDLER( tmpz84c011_0_pd_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]);
}
static READ8_HANDLER( tmpz84c011_0_pe_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]);
}
static WRITE8_HANDLER( tmpz84c011_0_pa_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[0] = data;
tmpz84c011_pio_w(space, 0, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pb_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[1] = data;
tmpz84c011_pio_w(space, 1, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pc_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[2] = data;
tmpz84c011_pio_w(space, 2, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pd_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[3] = data;
tmpz84c011_pio_w(space, 3, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pe_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[4] = data;
tmpz84c011_pio_w(space, 4, data);
}
@@ -466,57 +466,57 @@ static WRITE8_HANDLER( tmpz84c011_0_pe_w )
static READ8_HANDLER( tmpz84c011_0_dir_pa_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[0];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[0];
}
static READ8_HANDLER( tmpz84c011_0_dir_pb_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[1];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[1];
}
static READ8_HANDLER( tmpz84c011_0_dir_pc_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[2];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[2];
}
static READ8_HANDLER( tmpz84c011_0_dir_pd_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[3];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[3];
}
static READ8_HANDLER( tmpz84c011_0_dir_pe_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[4];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[4];
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[0] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[1] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[2] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[3] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[4] = data;
}
@@ -524,61 +524,61 @@ static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )
/* device 1 */
static READ8_HANDLER( tmpz84c011_1_pa_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,5) & ~state->pio_dir[5]) | (state->pio_latch[5] & state->pio_dir[5]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,5) & ~state->pio_dir[5]) | (state->pio_latch[5] & state->pio_dir[5]);
}
static READ8_HANDLER( tmpz84c011_1_pb_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,6) & ~state->pio_dir[6]) | (state->pio_latch[6] & state->pio_dir[6]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,6) & ~state->pio_dir[6]) | (state->pio_latch[6] & state->pio_dir[6]);
}
static READ8_HANDLER( tmpz84c011_1_pc_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,7) & ~state->pio_dir[7]) | (state->pio_latch[7] & state->pio_dir[7]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,7) & ~state->pio_dir[7]) | (state->pio_latch[7] & state->pio_dir[7]);
}
static READ8_HANDLER( tmpz84c011_1_pd_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,8) & ~state->pio_dir[8]) | (state->pio_latch[8] & state->pio_dir[8]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,8) & ~state->pio_dir[8]) | (state->pio_latch[8] & state->pio_dir[8]);
}
static READ8_HANDLER( tmpz84c011_1_pe_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,9) & ~state->pio_dir[9]) | (state->pio_latch[9] & state->pio_dir[9]);
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return (tmpz84c011_pio_r(space,9) & ~state->pio_dir[9]) | (state->pio_latch[9] & state->pio_dir[9]);
}
static WRITE8_HANDLER( tmpz84c011_1_pa_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[5] = data;
tmpz84c011_pio_w(space, 5, data);
}
static WRITE8_HANDLER( tmpz84c011_1_pb_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[6] = data;
tmpz84c011_pio_w(space, 6, data);
}
static WRITE8_HANDLER( tmpz84c011_1_pc_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[7] = data;
tmpz84c011_pio_w(space, 7, data);
}
static WRITE8_HANDLER( tmpz84c011_1_pd_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[8] = data;
tmpz84c011_pio_w(space, 8, data);
}
static WRITE8_HANDLER( tmpz84c011_1_pe_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_latch[9] = data;
tmpz84c011_pio_w(space, 9, data);
}
@@ -586,64 +586,64 @@ static WRITE8_HANDLER( tmpz84c011_1_pe_w )
static READ8_HANDLER( tmpz84c011_1_dir_pa_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[5];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[5];
}
static READ8_HANDLER( tmpz84c011_1_dir_pb_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[6];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[6];
}
static READ8_HANDLER( tmpz84c011_1_dir_pc_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[7];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[7];
}
static READ8_HANDLER( tmpz84c011_1_dir_pd_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[8];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[8];
}
static READ8_HANDLER( tmpz84c011_1_dir_pe_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>(); return state->pio_dir[9];
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>(); return state->pio_dir[9];
}
static WRITE8_HANDLER( tmpz84c011_1_dir_pa_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[5] = data;
}
static WRITE8_HANDLER( tmpz84c011_1_dir_pb_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[6] = data;
}
static WRITE8_HANDLER( tmpz84c011_1_dir_pc_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[7] = data;
}
static WRITE8_HANDLER( tmpz84c011_1_dir_pd_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[8] = data;
}
static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->pio_dir[9] = data;
}
/* CTC of main cpu, ch0 trigger is vblank */
static INTERRUPT_GEN( ctc0_trg1 )
{
- device_t *ctc = device->machine->device("main_ctc");
+ device_t *ctc = device->machine().device("main_ctc");
z80ctc_trg1_w(ctc, 1);
z80ctc_trg1_w(ctc, 0);
}
@@ -668,8 +668,8 @@ static Z80CTC_INTERFACE( ctc_intf_audio )
static MACHINE_RESET( sailorws )
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
@@ -682,8 +682,8 @@ static MACHINE_RESET( sailorws )
static DRIVER_INIT( nbmj9195 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *ROM = machine->region("audiocpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("audiocpu")->base();
// sound program patch
ROM[0x0213] = 0x00; // DI -> NOP
diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c
index edab80e591f..383dcfcf967 100644
--- a/src/mame/drivers/nemesis.c
+++ b/src/mame/drivers/nemesis.c
@@ -55,7 +55,7 @@ So this is the correct behavior of real hardware, not an emulation bug.
static INTERRUPT_GEN( nemesis_interrupt )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
if (state->irq_on)
device_set_input_line(device, 1, HOLD_LINE);
@@ -63,7 +63,7 @@ static INTERRUPT_GEN( nemesis_interrupt )
static INTERRUPT_GEN( konamigt_interrupt )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
if (cpu_getiloops(device) == 0)
{
@@ -79,7 +79,7 @@ static INTERRUPT_GEN( konamigt_interrupt )
static INTERRUPT_GEN( gx400_interrupt )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
switch (cpu_getiloops(device))
{
@@ -102,7 +102,7 @@ static INTERRUPT_GEN( gx400_interrupt )
static INTERRUPT_GEN( salamand_interrupt )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
if (state->irq_on)
device_set_input_line(device, 1, HOLD_LINE);
@@ -110,7 +110,7 @@ static INTERRUPT_GEN( salamand_interrupt )
static INTERRUPT_GEN( blkpnthr_interrupt )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
if (state->irq_on)
device_set_input_line(device, 2, HOLD_LINE);
@@ -119,29 +119,29 @@ static INTERRUPT_GEN( blkpnthr_interrupt )
static WRITE16_HANDLER( gx400_irq1_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->irq1_on = data & 0x0001;
if (ACCESSING_BITS_8_15)
- coin_lockout_w(space->machine, 1, data & 0x0100);
+ coin_lockout_w(space->machine(), 1, data & 0x0100);
}
static WRITE16_HANDLER( gx400_irq2_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->irq2_on = data & 0x0001;
if (ACCESSING_BITS_8_15)
- coin_lockout_w(space->machine, 0, data & 0x0100);
+ coin_lockout_w(space->machine(), 0, data & 0x0100);
}
static WRITE16_HANDLER( gx400_irq4_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_8_15)
state->irq4_on = data & 0x0100;
@@ -149,47 +149,47 @@ static WRITE16_HANDLER( gx400_irq4_enable_word_w )
static WRITE16_HANDLER( nemesis_irq_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->irq_on = data & 0xff;
if (ACCESSING_BITS_8_15)
- coin_lockout_global_w(space->machine, data & 0x0100);
+ coin_lockout_global_w(space->machine(), data & 0x0100);
}
static WRITE16_HANDLER( konamigt_irq_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->irq_on = data & 0xff;
if (ACCESSING_BITS_8_15)
- coin_lockout_w(space->machine, 1, data & 0x0100);
+ coin_lockout_w(space->machine(), 1, data & 0x0100);
}
static WRITE16_HANDLER( konamigt_irq2_enable_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->irq2_on = data & 0xff;
if (ACCESSING_BITS_8_15)
- coin_lockout_w(space->machine, 0, data & 0x0100);
+ coin_lockout_w(space->machine(), 0, data & 0x0100);
}
static READ16_HANDLER( gx400_sharedram_word_r )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
return state->gx400_shared_ram[offset];
}
static WRITE16_HANDLER( gx400_sharedram_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->gx400_shared_ram[offset] = data;
@@ -205,8 +205,8 @@ static READ16_HANDLER( konamigt_input_word_r )
bit 12-15: accel
*/
- int data = input_port_read(space->machine, "IN3");
- int data2 = input_port_read(space->machine, "PADDLE");
+ int data = input_port_read(space->machine(), "IN3");
+ int data2 = input_port_read(space->machine(), "PADDLE");
int ret=0x0000;
@@ -225,7 +225,7 @@ static READ16_HANDLER( konamigt_input_word_r )
static WRITE16_HANDLER( selected_ip_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
state->selected_ip = data & 0xff; // latch the value
@@ -233,14 +233,14 @@ static WRITE16_HANDLER( selected_ip_word_w )
static READ16_HANDLER( selected_ip_word_r )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
switch (state->selected_ip & 0xf)
{ // From WEC Le Mans Schems:
- case 0xc: return input_port_read(space->machine, "ACCEL"); // Accel - Schems: Accelevr
- case 0: return input_port_read(space->machine, "ACCEL");
- case 0xd: return input_port_read(space->machine, "WHEEL"); // Wheel - Schems: Handlevr
- case 1: return input_port_read(space->machine, "WHEEL");
+ case 0xc: return input_port_read(space->machine(), "ACCEL"); // Accel - Schems: Accelevr
+ case 0: return input_port_read(space->machine(), "ACCEL");
+ case 0xd: return input_port_read(space->machine(), "WHEEL"); // Wheel - Schems: Handlevr
+ case 1: return input_port_read(space->machine(), "WHEEL");
default: return ~0;
}
@@ -255,7 +255,7 @@ static WRITE16_HANDLER( nemesis_soundlatch_word_w )
static WRITE8_DEVICE_HANDLER( gx400_speech_start_w )
{
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
/* the voice data is not in a rom but in sound RAM at $8000 */
vlm5030_set_rom(device, state->gx400_shared_ram + 0x4000);
@@ -277,7 +277,7 @@ static READ8_DEVICE_HANDLER( nemesis_portA_r )
bit 5: vlm5030 busy
bit 7: unused by this software version. Bubble Memory version uses this bit.
*/
- nemesis_state *state = device->machine->driver_data<nemesis_state>();
+ nemesis_state *state = device->machine().driver_data<nemesis_state>();
int res = (state->audiocpu->total_cycles() / 1024) & 0x2f; // this should be 0x0f, but it doesn't work
res |= 0xd0;
@@ -571,7 +571,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( wd_r )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
state->frame_counter ^= 1;
return state->frame_counter;
}
@@ -1617,7 +1617,7 @@ static const ay8910_interface ay8910_interface_2 =
static void sound_irq(device_t *device, int state)
{
/* Interrupts _are_ generated, I wonder where they go.. */
-// nemesis_state *driver_state = device->machine->driver_data<nemesis_state>();
+// nemesis_state *driver_state = device->machine().driver_data<nemesis_state>();
// device_set_input_line(driver_state->audiocpu, 0, HOLD_LINE);
}
@@ -1646,11 +1646,11 @@ static const k007232_interface k007232_config =
static MACHINE_START( nemesis )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->vlm = machine->device("vlm");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->vlm = machine.device("vlm");
state->save_item(NAME(state->irq_on));
state->save_item(NAME(state->irq1_on));
@@ -1667,7 +1667,7 @@ static MACHINE_START( nemesis )
static MACHINE_RESET( nemesis )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
state->irq_on = 0;
state->irq1_on = 0;
diff --git a/src/mame/drivers/neodrvr.c b/src/mame/drivers/neodrvr.c
index 2b47786d4ad..e97794317eb 100644
--- a/src/mame/drivers/neodrvr.c
+++ b/src/mame/drivers/neodrvr.c
@@ -7638,7 +7638,7 @@ static DRIVER_INIT( mslugx )
static DRIVER_INIT( kof99 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
kof99_decrypt_68k(machine);
state->fixed_layer_bank_type = 1;
@@ -7648,7 +7648,7 @@ static DRIVER_INIT( kof99 )
static DRIVER_INIT( kof99k )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0x00);
@@ -7656,7 +7656,7 @@ static DRIVER_INIT( kof99k )
static DRIVER_INIT( garou )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
garou_decrypt_68k(machine);
state->fixed_layer_bank_type = 1;
@@ -7666,7 +7666,7 @@ static DRIVER_INIT( garou )
static DRIVER_INIT( garouo )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
garouo_decrypt_68k(machine);
state->fixed_layer_bank_type = 1;
@@ -7683,7 +7683,7 @@ static DRIVER_INIT( garoubl )
static DRIVER_INIT( mslug3 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
mslug3_decrypt_68k(machine);
state->fixed_layer_bank_type = 1;
@@ -7693,7 +7693,7 @@ static DRIVER_INIT( mslug3 )
static DRIVER_INIT( mslug3h )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0xad);
@@ -7708,7 +7708,7 @@ static DRIVER_INIT( mslug3b6 )
static DRIVER_INIT( kof2000 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
kof2000_decrypt_68k(machine);
state->fixed_layer_bank_type = 2;
@@ -7719,7 +7719,7 @@ static DRIVER_INIT( kof2000 )
static DRIVER_INIT( kof2000n )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 2;
neogeo_cmc50_m1_decrypt(machine);
@@ -7728,7 +7728,7 @@ static DRIVER_INIT( kof2000n )
static DRIVER_INIT( kof2001 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof2000_neogeo_gfx_decrypt(machine, 0x1e);
@@ -7758,7 +7758,7 @@ static DRIVER_INIT ( ct2k3sa )
static DRIVER_INIT( mslug4 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1; /* USA violent content screen is wrong -- not a bug, confirmed on real hardware! */
neogeo_cmc50_m1_decrypt(machine);
@@ -7776,7 +7776,7 @@ static DRIVER_INIT( ms4plus )
static DRIVER_INIT( ganryu )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0x07);
@@ -7784,7 +7784,7 @@ static DRIVER_INIT( ganryu )
static DRIVER_INIT( s1945p )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0x05);
@@ -7792,7 +7792,7 @@ static DRIVER_INIT( s1945p )
static DRIVER_INIT( preisle2 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0x9f);
@@ -7800,7 +7800,7 @@ static DRIVER_INIT( preisle2 )
static DRIVER_INIT( bangbead )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0xf8);
@@ -7808,7 +7808,7 @@ static DRIVER_INIT( bangbead )
static DRIVER_INIT( nitd )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0xff);
@@ -7816,7 +7816,7 @@ static DRIVER_INIT( nitd )
static DRIVER_INIT( zupapa )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0xbd);
@@ -7824,7 +7824,7 @@ static DRIVER_INIT( zupapa )
static DRIVER_INIT( sengoku3 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
kof99_neogeo_gfx_decrypt(machine, 0xfe);
@@ -7832,7 +7832,7 @@ static DRIVER_INIT( sengoku3 )
static DRIVER_INIT( rotd )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
neo_pcm2_snk_1999(machine, 16);
state->fixed_layer_bank_type = 1;
@@ -7855,8 +7855,8 @@ static DRIVER_INIT( kof2002b )
kof2002_decrypt_68k(machine);
neo_pcm2_swap(machine, 0);
neogeo_cmc50_m1_decrypt(machine);
- kof2002b_gfx_decrypt(machine, machine->region("sprites")->base(),0x4000000);
- kof2002b_gfx_decrypt(machine, machine->region("fixed")->base(),0x20000);
+ kof2002b_gfx_decrypt(machine, machine.region("sprites")->base(),0x4000000);
+ kof2002b_gfx_decrypt(machine, machine.region("fixed")->base(),0x20000);
}
static DRIVER_INIT( kf2k2pls )
@@ -7915,7 +7915,7 @@ static DRIVER_INIT( kof2k4se )
static DRIVER_INIT( matrim )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
matrim_decrypt_68k(machine);
neo_pcm2_swap(machine, 1);
@@ -7926,7 +7926,7 @@ static DRIVER_INIT( matrim )
static DRIVER_INIT( matrimbl )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
matrim_decrypt_68k(machine);
state->fixed_layer_bank_type = 2;
@@ -7936,7 +7936,7 @@ static DRIVER_INIT( matrimbl )
static DRIVER_INIT( pnyaa )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
neo_pcm2_snk_1999(machine, 4);
state->fixed_layer_bank_type = 1;
@@ -7946,7 +7946,7 @@ static DRIVER_INIT( pnyaa )
static DRIVER_INIT( mslug5 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
mslug5_decrypt_68k(machine);
neo_pcm2_swap(machine, 2);
@@ -7959,17 +7959,17 @@ static DRIVER_INIT( mslug5 )
static TIMER_CALLBACK( ms5pcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine->region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( ms5pcb )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
/* start a timer that will check the BIOS select DIP every second */
- machine->scheduler().timer_set(attotime::zero, FUNC(ms5pcb_bios_timer_callback));
- machine->scheduler().timer_pulse(attotime::from_msec(1000), FUNC(ms5pcb_bios_timer_callback));
+ machine.scheduler().timer_set(attotime::zero, FUNC(ms5pcb_bios_timer_callback));
+ machine.scheduler().timer_pulse(attotime::from_msec(1000), FUNC(ms5pcb_bios_timer_callback));
mslug5_decrypt_68k(machine);
svcpcb_gfx_decrypt(machine);
@@ -7983,7 +7983,7 @@ static DRIVER_INIT( ms5pcb )
static DRIVER_INIT( ms5plus )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
cmc50_neogeo_gfx_decrypt(machine, 0x19);
neo_pcm2_swap(machine, 2);
@@ -7996,17 +7996,17 @@ static DRIVER_INIT( ms5plus )
static TIMER_CALLBACK( svcpcb_bios_timer_callback )
{
int harddip3 = input_port_read(machine, "HARDDIP") & 1;
- memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine->region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
+ memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine.region("mainbios")->base() + 0x20000 + harddip3 * 0x20000);
}
static DRIVER_INIT( svcpcb )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
/* start a timer that will check the BIOS select DIP every second */
- machine->scheduler().timer_set(attotime::zero, FUNC(svcpcb_bios_timer_callback));
- machine->scheduler().timer_pulse(attotime::from_msec(1000), FUNC(svcpcb_bios_timer_callback));
+ machine.scheduler().timer_set(attotime::zero, FUNC(svcpcb_bios_timer_callback));
+ machine.scheduler().timer_pulse(attotime::from_msec(1000), FUNC(svcpcb_bios_timer_callback));
svc_px_decrypt(machine);
svcpcb_gfx_decrypt(machine);
@@ -8020,7 +8020,7 @@ static DRIVER_INIT( svcpcb )
static DRIVER_INIT( svc )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
svc_px_decrypt(machine);
neo_pcm2_swap(machine, 3);
@@ -8067,7 +8067,7 @@ static DRIVER_INIT( svcsplus )
static DRIVER_INIT( samsho5 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
samsho5_decrypt_68k(machine);
neo_pcm2_swap(machine, 4);
@@ -8087,7 +8087,7 @@ static DRIVER_INIT( samsho5b )
static DRIVER_INIT( kf2k3pcb )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
kf2k3pcb_decrypt_68k(machine);
kf2k3pcb_gfx_decrypt(machine);
@@ -8099,7 +8099,7 @@ static DRIVER_INIT( kf2k3pcb )
incorrect */
{
int i;
- UINT8* rom = machine->region("audiocpu")->base();
+ UINT8* rom = machine.region("audiocpu")->base();
for (i = 0; i < 0x90000; i++)
{
rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2);
@@ -8112,12 +8112,12 @@ static DRIVER_INIT( kf2k3pcb )
neo_pcm2_swap(machine, 5);
state->fixed_layer_bank_type = 2;
install_pvc_protection(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc00000, 0xc7ffff, "bios" ); // 512k bios
}
static DRIVER_INIT( kof2003 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
kof2003_decrypt_68k(machine);
neo_pcm2_swap(machine, 5);
@@ -8129,7 +8129,7 @@ static DRIVER_INIT( kof2003 )
static DRIVER_INIT( kof2003h )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
kof2003h_decrypt_68k(machine);
neo_pcm2_swap(machine, 5);
@@ -8170,7 +8170,7 @@ static DRIVER_INIT( kf2k3upl )
static DRIVER_INIT( samsh5sp )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
samsh5sp_decrypt_68k(machine);
neo_pcm2_swap(machine, 6);
@@ -8181,25 +8181,25 @@ static DRIVER_INIT( samsh5sp )
static DRIVER_INIT( jockeygp )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 1;
neogeo_cmc50_m1_decrypt(machine);
kof2000_neogeo_gfx_decrypt(machine, 0xac);
/* install some extra RAM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff);
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5");
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6");
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5");
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6");
}
static DRIVER_INIT( vliner )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x200000, 0x201fff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x280000, 0x280001, "IN5");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2c0000, 0x2c0001, "IN6");
DRIVER_INIT_CALL(neogeo);
}
@@ -8207,7 +8207,7 @@ static DRIVER_INIT( vliner )
static DRIVER_INIT( kog )
{
/* overlay cartridge ROM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0ffffe, 0x0fffff, "JUMPER");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0ffffe, 0x0fffff, "JUMPER");
kog_px_decrypt(machine);
neogeo_bootleg_sx_decrypt(machine, 1);
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 50b727c81f7..904e80a42ed 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -224,8 +224,8 @@ static UINT16 *save_ram;
*
*************************************/
-static void set_output_latch(running_machine *machine, UINT8 data);
-static void set_output_data(running_machine *machine, UINT8 data);
+static void set_output_latch(running_machine &machine, UINT8 data);
+static void set_output_data(running_machine &machine, UINT8 data);
/*************************************
@@ -240,30 +240,30 @@ static void set_output_data(running_machine *machine, UINT8 data);
#define IRQ2CTRL_AUTOLOAD_REPEAT (0x80)
-static void adjust_display_position_interrupt_timer( running_machine *machine )
+static void adjust_display_position_interrupt_timer( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if ((state->display_counter + 1) != 0)
{
attotime period = attotime::from_hz(NEOGEO_PIXEL_CLOCK) * (state->display_counter + 1);
- if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", machine->primary_screen->vpos(), machine->primary_screen->hpos(), (state->display_counter + 1) / NEOGEO_HTOTAL, (state->display_counter + 1) % NEOGEO_HTOTAL);
+ if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", machine.primary_screen->vpos(), machine.primary_screen->hpos(), (state->display_counter + 1) / NEOGEO_HTOTAL, (state->display_counter + 1) % NEOGEO_HTOTAL);
state->display_position_interrupt_timer->adjust(period);
}
}
-void neogeo_set_display_position_interrupt_control( running_machine *machine, UINT16 data )
+void neogeo_set_display_position_interrupt_control( running_machine &machine, UINT16 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->display_position_interrupt_control = data;
}
void neogeo_set_display_counter_msb( address_space *space, UINT16 data )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
state->display_counter = (state->display_counter & 0x0000ffff) | ((UINT32)data << 16);
@@ -273,7 +273,7 @@ void neogeo_set_display_counter_msb( address_space *space, UINT16 data )
void neogeo_set_display_counter_lsb( address_space *space, UINT16 data )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
state->display_counter = (state->display_counter & 0xffff0000) | data;
@@ -282,14 +282,14 @@ void neogeo_set_display_counter_lsb( address_space *space, UINT16 data )
if (state->display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE)
{
if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_RELATIVE ");
- adjust_display_position_interrupt_timer(space->machine);
+ adjust_display_position_interrupt_timer(space->machine());
}
}
-static void update_interrupts( running_machine *machine )
+static void update_interrupts( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
cputag_set_input_line(machine, "maincpu", 1, state->vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE);
@@ -297,9 +297,9 @@ static void update_interrupts( running_machine *machine )
}
-void neogeo_acknowledge_interrupt( running_machine *machine, UINT16 data )
+void neogeo_acknowledge_interrupt( running_machine &machine, UINT16 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if (data & 0x01)
state->irq3_pending = 0;
@@ -314,13 +314,13 @@ void neogeo_acknowledge_interrupt( running_machine *machine, UINT16 data )
static TIMER_CALLBACK( display_position_interrupt_callback )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
- if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", machine->primary_screen->vpos(), machine->primary_screen->hpos());
+ if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", machine.primary_screen->vpos(), machine.primary_screen->hpos());
if (state->display_position_interrupt_control & IRQ2CTRL_ENABLE)
{
- if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", machine->primary_screen->vpos(), machine->primary_screen->hpos());
+ if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", machine.primary_screen->vpos(), machine.primary_screen->hpos());
state->display_position_interrupt_pending = 1;
update_interrupts(machine);
@@ -336,7 +336,7 @@ static TIMER_CALLBACK( display_position_interrupt_callback )
static TIMER_CALLBACK( display_position_vblank_callback )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if (state->display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)
{
@@ -345,15 +345,15 @@ static TIMER_CALLBACK( display_position_vblank_callback )
}
/* set timer for next screen */
- state->display_position_vblank_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
+ state->display_position_vblank_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
- if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", machine->primary_screen->vpos(), machine->primary_screen->hpos());
+ if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", machine.primary_screen->vpos(), machine.primary_screen->hpos());
/* add a timer tick to the pd4990a */
upd4990a_addretrace(state->upd4990a);
@@ -363,24 +363,24 @@ static TIMER_CALLBACK( vblank_interrupt_callback )
update_interrupts(machine);
/* set timer for next screen */
- state->vblank_interrupt_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART));
+ state->vblank_interrupt_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART));
}
-static void create_interrupt_timers( running_machine *machine )
+static void create_interrupt_timers( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->display_position_interrupt_timer = machine->scheduler().timer_alloc(FUNC(display_position_interrupt_callback));
- state->display_position_vblank_timer = machine->scheduler().timer_alloc(FUNC(display_position_vblank_callback));
- state->vblank_interrupt_timer = machine->scheduler().timer_alloc(FUNC(vblank_interrupt_callback));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->display_position_interrupt_timer = machine.scheduler().timer_alloc(FUNC(display_position_interrupt_callback));
+ state->display_position_vblank_timer = machine.scheduler().timer_alloc(FUNC(display_position_vblank_callback));
+ state->vblank_interrupt_timer = machine.scheduler().timer_alloc(FUNC(vblank_interrupt_callback));
}
-static void start_interrupt_timers( running_machine *machine )
+static void start_interrupt_timers( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->vblank_interrupt_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART));
- state->display_position_vblank_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->vblank_interrupt_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART));
+ state->display_position_vblank_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
}
@@ -393,21 +393,21 @@ static void start_interrupt_timers( running_machine *machine )
static void audio_cpu_irq(device_t *device, int assert)
{
- neogeo_state *state = device->machine->driver_data<neogeo_state>();
+ neogeo_state *state = device->machine().driver_data<neogeo_state>();
device_set_input_line(state->audiocpu, 0, assert ? ASSERT_LINE : CLEAR_LINE);
}
-static void audio_cpu_assert_nmi(running_machine *machine)
+static void audio_cpu_assert_nmi(running_machine &machine)
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( audio_cpu_clear_nmi_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -419,16 +419,16 @@ static WRITE8_HANDLER( audio_cpu_clear_nmi_w )
*
*************************************/
-static void select_controller( running_machine *machine, UINT8 data )
+static void select_controller( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->controller_select = data;
}
static CUSTOM_INPUT( multiplexed_controller_r )
{
- neogeo_state *state = field->port->machine->driver_data<neogeo_state>();
+ neogeo_state *state = field->port->machine().driver_data<neogeo_state>();
int port = (FPTR)param;
static const char *const cntrl[2][2] =
@@ -436,13 +436,13 @@ static CUSTOM_INPUT( multiplexed_controller_r )
{ "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" }
};
- return input_port_read_safe(field->port->machine, cntrl[port][state->controller_select & 0x01], 0x00);
+ return input_port_read_safe(field->port->machine(), cntrl[port][state->controller_select & 0x01], 0x00);
}
static CUSTOM_INPUT( mahjong_controller_r )
{
- neogeo_state *state = field->port->machine->driver_data<neogeo_state>();
+ neogeo_state *state = field->port->machine().driver_data<neogeo_state>();
UINT32 ret;
/*
@@ -456,10 +456,10 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF
{
default:
case 0x00: ret = 0x0000; break; /* nothing? */
- case 0x09: ret = input_port_read(field->port->machine, "MAHJONG1"); break;
- case 0x12: ret = input_port_read(field->port->machine, "MAHJONG2"); break;
- case 0x1b: ret = input_port_read(field->port->machine, "MAHJONG3"); break; /* player 1 normal inputs? */
- case 0x24: ret = input_port_read(field->port->machine, "MAHJONG4"); break;
+ case 0x09: ret = input_port_read(field->port->machine(), "MAHJONG1"); break;
+ case 0x12: ret = input_port_read(field->port->machine(), "MAHJONG2"); break;
+ case 0x1b: ret = input_port_read(field->port->machine(), "MAHJONG3"); break; /* player 1 normal inputs? */
+ case 0x24: ret = input_port_read(field->port->machine(), "MAHJONG4"); break;
}
return ret;
@@ -468,12 +468,12 @@ cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF
static WRITE16_HANDLER( io_control_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
switch (offset)
{
- case 0x00: select_controller(space->machine, data & 0x00ff); break;
- case 0x18: set_output_latch(space->machine, data & 0x00ff); break;
- case 0x20: set_output_data(space->machine, data & 0x00ff); break;
+ case 0x00: select_controller(space->machine(), data & 0x00ff); break;
+ case 0x18: set_output_latch(space->machine(), data & 0x00ff); break;
+ case 0x20: set_output_data(space->machine(), data & 0x00ff); break;
case 0x28: upd4990a_control_16_w(state->upd4990a, 0, data, mem_mask); break;
// case 0x30: break; // coin counters
// case 0x31: break; // coin counters
@@ -496,7 +496,7 @@ static WRITE16_HANDLER( io_control_w )
READ16_HANDLER( neogeo_unmapped_r )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
UINT16 ret;
/* unmapped memory returns the last word on the data bus, which is almost always the opcode
@@ -525,7 +525,7 @@ READ16_HANDLER( neogeo_unmapped_r )
static CUSTOM_INPUT( get_calendar_status )
{
- neogeo_state *state = field->port->machine->driver_data<neogeo_state>();
+ neogeo_state *state = field->port->machine().driver_data<neogeo_state>();
return (upd4990a_databit_r(state->upd4990a, 0) << 1) | upd4990a_testbit_r(state->upd4990a, 0);
}
@@ -537,16 +537,16 @@ static CUSTOM_INPUT( get_calendar_status )
*
*************************************/
-static void set_save_ram_unlock( running_machine *machine, UINT8 data )
+static void set_save_ram_unlock( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->save_ram_unlocked = data;
}
static WRITE16_HANDLER( save_ram_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
if (state->save_ram_unlocked)
COMBINE_DATA(&save_ram[offset]);
@@ -567,7 +567,7 @@ static CUSTOM_INPUT( get_memcard_status )
{
/* D0 and D1 are memcard presence indicators, D2 indicates memcard
write protect status (we are always write enabled) */
- return (memcard_present(field->port->machine) == -1) ? 0x07 : 0x00;
+ return (memcard_present(field->port->machine()) == -1) ? 0x07 : 0x00;
}
@@ -575,7 +575,7 @@ static READ16_HANDLER( memcard_r )
{
UINT16 ret;
- if (memcard_present(space->machine) != -1)
+ if (memcard_present(space->machine()) != -1)
ret = memcard_data[offset] | 0xff00;
else
ret = 0xffff;
@@ -588,7 +588,7 @@ static WRITE16_HANDLER( memcard_w )
{
if (ACCESSING_BITS_0_7)
{
- if (memcard_present(space->machine) != -1)
+ if (memcard_present(space->machine()) != -1)
memcard_data[offset] = data;
}
}
@@ -628,10 +628,10 @@ static WRITE16_HANDLER( audio_command_w )
{
soundlatch_w(space, 0, data >> 8);
- audio_cpu_assert_nmi(space->machine);
+ audio_cpu_assert_nmi(space->machine());
/* boost the interleave to let the audio CPU read the command */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(space->cpu), data, mem_mask);
}
@@ -653,7 +653,7 @@ static READ8_HANDLER( audio_command_r )
static WRITE8_HANDLER( audio_result_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
if (LOG_CPU_COMM && (state->audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(space->cpu), data);
@@ -663,10 +663,10 @@ static WRITE8_HANDLER( audio_result_w )
static CUSTOM_INPUT( get_audio_result )
{
- neogeo_state *state = field->port->machine->driver_data<neogeo_state>();
+ neogeo_state *state = field->port->machine().driver_data<neogeo_state>();
UINT32 ret = state->audio_result;
-// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field->port->machine->device("maincpu")), ret);
+// if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(field->port->machine().device("maincpu")), ret);
return ret;
}
@@ -679,45 +679,45 @@ static CUSTOM_INPUT( get_audio_result )
*
*************************************/
-static void _set_main_cpu_vector_table_source( running_machine *machine )
+static void _set_main_cpu_vector_table_source( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
memory_set_bank(machine, NEOGEO_BANK_VECTORS, state->main_cpu_vector_table_source);
}
-static void set_main_cpu_vector_table_source( running_machine *machine, UINT8 data )
+static void set_main_cpu_vector_table_source( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->main_cpu_vector_table_source = data;
_set_main_cpu_vector_table_source(machine);
}
-static void _set_main_cpu_bank_address( running_machine *machine )
+static void _set_main_cpu_bank_address( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- memory_set_bankptr(machine, NEOGEO_BANK_CARTRIDGE, &machine->region("maincpu")->base()[state->main_cpu_bank_address]);
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ memory_set_bankptr(machine, NEOGEO_BANK_CARTRIDGE, &machine.region("maincpu")->base()[state->main_cpu_bank_address]);
}
void neogeo_set_main_cpu_bank_address( address_space *space, UINT32 bank_address )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", cpu_get_pc(space->cpu), bank_address);
state->main_cpu_bank_address = bank_address;
- _set_main_cpu_bank_address(space->machine);
+ _set_main_cpu_bank_address(space->machine());
}
static WRITE16_HANDLER( main_cpu_bank_select_w )
{
UINT32 bank_address;
- UINT32 len = space->machine->region("maincpu")->bytes();
+ UINT32 len = space->machine().region("maincpu")->bytes();
if ((len <= 0x100000) && (data & 0x07))
logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(space->cpu), data);
@@ -736,16 +736,16 @@ static WRITE16_HANDLER( main_cpu_bank_select_w )
}
-static void main_cpu_banking_init( running_machine *machine )
+static void main_cpu_banking_init( running_machine &machine )
{
- address_space *mainspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
- memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 0, 1, machine->region("mainbios")->base(), 0);
- memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 1, 1, machine->region("maincpu")->base(), 0);
+ memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 0, 1, machine.region("mainbios")->base(), 0);
+ memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 1, 1, machine.region("maincpu")->base(), 0);
/* set initial main CPU bank */
- if (machine->region("maincpu")->bytes() > 0x100000)
+ if (machine.region("maincpu")->bytes() > 0x100000)
neogeo_set_main_cpu_bank_address(mainspace, 0x100000);
else
neogeo_set_main_cpu_bank_address(mainspace, 0x000000);
@@ -759,9 +759,9 @@ static void main_cpu_banking_init( running_machine *machine )
*
*************************************/
-static void set_audio_cpu_banking( running_machine *machine )
+static void set_audio_cpu_banking( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int region;
for (region = 0; region < 4; region++)
@@ -771,13 +771,13 @@ static void set_audio_cpu_banking( running_machine *machine )
static void audio_cpu_bank_select( address_space *space, int region, UINT8 bank )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", cpu_get_pc(space->cpu), region, bank);
state->audio_cpu_banks[region] = bank;
- set_audio_cpu_banking(space->machine);
+ set_audio_cpu_banking(space->machine());
}
@@ -815,19 +815,19 @@ static READ8_HANDLER( audio_cpu_bank_select_8000_bfff_r )
static void _set_audio_cpu_rom_source( address_space *space )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
-/* if (!machine->region("audiobios")->base()) */
+/* if (!machine.region("audiobios")->base()) */
state->audio_cpu_rom_source = 1;
- memory_set_bank(space->machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, state->audio_cpu_rom_source);
+ memory_set_bank(space->machine(), NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, state->audio_cpu_rom_source);
/* reset CPU if the source changed -- this is a guess */
if (state->audio_cpu_rom_source != state->audio_cpu_rom_source_last)
{
state->audio_cpu_rom_source_last = state->audio_cpu_rom_source;
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", cpu_get_pc(space->cpu), state->audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
}
@@ -836,30 +836,30 @@ static void _set_audio_cpu_rom_source( address_space *space )
static void set_audio_cpu_rom_source( address_space *space, UINT8 data )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
state->audio_cpu_rom_source = data;
_set_audio_cpu_rom_source(space);
}
-static void audio_cpu_banking_init( running_machine *machine )
+static void audio_cpu_banking_init( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int region;
int bank;
UINT8 *rgn;
UINT32 address_mask;
/* audio bios/cartridge selection */
- if (machine->region("audiobios")->base())
- memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 0, 1, machine->region("audiobios")->base(), 0);
- memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 1, 1, machine->region("audiocpu")->base(), 0);
+ if (machine.region("audiobios")->base())
+ memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 0, 1, machine.region("audiobios")->base(), 0);
+ memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 1, 1, machine.region("audiocpu")->base(), 0);
/* audio banking */
- address_mask = machine->region("audiocpu")->bytes() - 0x10000 - 1;
+ address_mask = machine.region("audiocpu")->bytes() - 0x10000 - 1;
- rgn = machine->region("audiocpu")->base();
+ rgn = machine.region("audiocpu")->base();
for (region = 0; region < 4; region++)
{
for (bank = 0; bank < 0x100; bank++)
@@ -879,7 +879,7 @@ static void audio_cpu_banking_init( running_machine *machine )
set_audio_cpu_banking(machine);
state->audio_cpu_rom_source_last = 0;
- set_audio_cpu_rom_source(machine->device("maincpu")->memory().space(AS_PROGRAM), 0);
+ set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
}
@@ -899,13 +899,13 @@ static WRITE16_HANDLER( system_control_w )
switch (offset & 0x07)
{
default:
- case 0x00: neogeo_set_screen_dark(space->machine, bit); break;
- case 0x01: set_main_cpu_vector_table_source(space->machine, bit);
+ case 0x00: neogeo_set_screen_dark(space->machine(), bit); break;
+ case 0x01: set_main_cpu_vector_table_source(space->machine(), bit);
set_audio_cpu_rom_source(space, bit); /* this is a guess */
break;
- case 0x05: neogeo_set_fixed_layer_source(space->machine, bit); break;
- case 0x06: set_save_ram_unlock(space->machine, bit); break;
- case 0x07: neogeo_set_palette_bank(space->machine, bit); break;
+ case 0x05: neogeo_set_fixed_layer_source(space->machine(), bit); break;
+ case 0x06: set_save_ram_unlock(space->machine(), bit); break;
+ case 0x07: neogeo_set_palette_bank(space->machine(), bit); break;
case 0x02: /* unknown - HC32 middle pin 1 */
case 0x03: /* unknown - uPD4990 pin ? */
@@ -971,9 +971,9 @@ static WRITE16_HANDLER( watchdog_w )
*
*************************************/
-static void set_outputs( running_machine *machine )
+static void set_outputs( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
static const UINT8 led_map[0x10] =
{ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 };
@@ -990,9 +990,9 @@ static void set_outputs( running_machine *machine )
}
-static void set_output_latch( running_machine *machine, UINT8 data )
+static void set_output_latch( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
/* looks like the LEDs are set on the
falling edge */
@@ -1008,7 +1008,7 @@ static void set_output_latch( running_machine *machine, UINT8 data )
state->led2_value = ~state->output_data;
if (falling_bits & 0xc7)
- logerror("%s Unmaped LED write. Data: %x\n", machine->describe_context(), falling_bits);
+ logerror("%s Unmaped LED write. Data: %x\n", machine.describe_context(), falling_bits);
state->output_latch = data;
@@ -1016,9 +1016,9 @@ static void set_output_latch( running_machine *machine, UINT8 data )
}
-static void set_output_data( running_machine *machine, UINT8 data )
+static void set_output_data( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->output_data = data;
}
@@ -1035,19 +1035,19 @@ static STATE_POSTLOAD( neogeo_postload )
_set_main_cpu_bank_address(machine);
_set_main_cpu_vector_table_source(machine);
set_audio_cpu_banking(machine);
- _set_audio_cpu_rom_source(machine->device("maincpu")->memory().space(AS_PROGRAM));
+ _set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM));
set_outputs(machine);
}
static MACHINE_START( neogeo )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
/* configure NVRAM */
- machine->device<nvram_device>("saveram")->set_base(save_ram, 0x2000);
+ machine.device<nvram_device>("saveram")->set_base(save_ram, 0x2000);
/* set the BIOS bank */
- memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine->region("mainbios")->base());
+ memory_set_bankptr(machine, NEOGEO_BANK_BIOS, machine.region("mainbios")->base());
/* set the initial main CPU bank */
main_cpu_banking_init(machine);
@@ -1064,9 +1064,9 @@ static MACHINE_START( neogeo )
state->irq3_pending = 1;
/* get devices */
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->upd4990a = machine->device("upd4990a");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->upd4990a = machine.device("upd4990a");
/* register state save */
state->save_item(NAME(state->display_position_interrupt_control));
@@ -1090,7 +1090,7 @@ static MACHINE_START( neogeo )
state->save_item(NAME(state->led2_value));
state->save_item(NAME(state->recurse));
- machine->state().register_postload(neogeo_postload, NULL);
+ machine.state().register_postload(neogeo_postload, NULL);
}
@@ -1103,15 +1103,15 @@ static MACHINE_START( neogeo )
static MACHINE_RESET( neogeo )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
offs_t offs;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* reset system control registers */
for (offs = 0; offs < 8; offs++)
system_control_w(space, offs, 0, 0x00ff);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
neogeo_reset_rng(machine);
@@ -1378,7 +1378,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( neogeo )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->fixed_layer_bank_type = 0;
}
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index 5ada343fe0a..b00eee530a7 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -53,11 +53,11 @@ xxxx xxxx xxxx xxxx [2] scroll Y, signed
---- ---- --?? ??xx [6] map register
*/
-static void draw_layer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int layer,int data_shift)
+static void draw_layer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int layer,int data_shift)
{
- neoprint_state *state = machine->driver_data<neoprint_state>();
+ neoprint_state *state = machine.driver_data<neoprint_state>();
int i, y, x;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
INT16 scrollx, scrolly;
i = (state->npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4;
@@ -95,8 +95,8 @@ SCREEN_UPDATE(neoprint)
{
bitmap_fill(bitmap, cliprect, 0);
- draw_layer(screen->machine,bitmap,cliprect,1,2);
- draw_layer(screen->machine,bitmap,cliprect,0,2);
+ draw_layer(screen->machine(),bitmap,cliprect,1,2);
+ draw_layer(screen->machine(),bitmap,cliprect,0,2);
return 0;
}
@@ -105,9 +105,9 @@ SCREEN_UPDATE(nprsp)
{
bitmap_fill(bitmap, cliprect, 0);
- draw_layer(screen->machine,bitmap,cliprect,1,0);
- draw_layer(screen->machine,bitmap,cliprect,2,0);
- draw_layer(screen->machine,bitmap,cliprect,0,0);
+ draw_layer(screen->machine(),bitmap,cliprect,1,0);
+ draw_layer(screen->machine(),bitmap,cliprect,2,0);
+ draw_layer(screen->machine(),bitmap,cliprect,0,0);
return 0;
}
@@ -118,23 +118,23 @@ static READ16_HANDLER( neoprint_calendar_r )
//if(cpu_get_pc(space->cpu) != 0x4b38 )//&& cpu_get_pc(space->cpu) != 0x5f86 && cpu_get_pc(space->cpu) != 0x5f90)
// printf("%08x\n",cpu_get_pc(space->cpu));
- return (upd4990a_databit_r(space->machine->device("upd4990a"), 0) << 15);
+ return (upd4990a_databit_r(space->machine().device("upd4990a"), 0) << 15);
}
static WRITE16_HANDLER( neoprint_calendar_w )
{
- upd4990a_control_16_w(space->machine->device("upd4990a"), 0, ((data >> 8) & 7), mem_mask);
+ upd4990a_control_16_w(space->machine().device("upd4990a"), 0, ((data >> 8) & 7), mem_mask);
}
static READ8_HANDLER( neoprint_unk_r )
{
- neoprint_state *state = space->machine->driver_data<neoprint_state>();
+ neoprint_state *state = space->machine().driver_data<neoprint_state>();
/* ---x ---- tested in irq routine, odd/even field number? */
/* ---- xx-- one of these two must be high */
/* ---- --xx checked right before entering into attract mode, presumably printer/camera related */
- state->vblank = (space->machine->primary_screen->frame_number() & 0x1) ? 0x10 : 0x00;
+ state->vblank = (space->machine().primary_screen->frame_number() & 0x1) ? 0x10 : 0x00;
//if(cpu_get_pc(space->cpu) != 0x1504 && cpu_get_pc(space->cpu) != 0x5f86 && cpu_get_pc(space->cpu) != 0x5f90)
// printf("%08x\n",cpu_get_pc(space->cpu));
@@ -144,11 +144,11 @@ static READ8_HANDLER( neoprint_unk_r )
static READ16_HANDLER( neoprint_audio_result_r )
{
- neoprint_state *state = space->machine->driver_data<neoprint_state>();
+ neoprint_state *state = space->machine().driver_data<neoprint_state>();
return (state->audio_result << 8) | 0x00;
}
-static void audio_cpu_assert_nmi(running_machine *machine)
+static void audio_cpu_assert_nmi(running_machine &machine)
{
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
}
@@ -156,7 +156,7 @@ static void audio_cpu_assert_nmi(running_machine *machine)
static WRITE8_HANDLER( audio_cpu_clear_nmi_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
}
static WRITE16_HANDLER( audio_command_w )
@@ -166,10 +166,10 @@ static WRITE16_HANDLER( audio_command_w )
{
soundlatch_w(space, 0, data >> 8);
- audio_cpu_assert_nmi(space->machine);
+ audio_cpu_assert_nmi(space->machine());
/* boost the interleave to let the audio CPU read the command */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
//if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(space->cpu), data, mem_mask);
}
@@ -192,8 +192,8 @@ static READ8_HANDLER( audio_command_r )
static WRITE8_HANDLER( audio_result_w )
{
- neoprint_state *state = space->machine->driver_data<neoprint_state>();
- //neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neoprint_state *state = space->machine().driver_data<neoprint_state>();
+ //neogeo_state *state = space->machine().driver_data<neogeo_state>();
//if (LOG_CPU_COMM && (state->audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(space->cpu), data);
@@ -225,12 +225,12 @@ static WRITE16_HANDLER( nprsp_palette_w )
{
UINT8 r,g,b,i;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- g = (space->machine->generic.paletteram.u16[offset & ~1] & 0xf800) >> 8;
- r = (space->machine->generic.paletteram.u16[offset & ~1] & 0x00f8) >> 0;
- i = (space->machine->generic.paletteram.u16[offset | 1] & 0x1c00) >> 10;
- b = (space->machine->generic.paletteram.u16[offset | 1] & 0x00f8) >> 0;
+ g = (space->machine().generic.paletteram.u16[offset & ~1] & 0xf800) >> 8;
+ r = (space->machine().generic.paletteram.u16[offset & ~1] & 0x00f8) >> 0;
+ i = (space->machine().generic.paletteram.u16[offset | 1] & 0x1c00) >> 10;
+ b = (space->machine().generic.paletteram.u16[offset | 1] & 0x00f8) >> 0;
r |= i;
g |= i;
b |= i;
@@ -244,13 +244,13 @@ static WRITE16_HANDLER( nprsp_palette_w )
pal_entry = ((offset & 0xfffe) >> 1) + ((offset & 0x20000) ? 0x8000 : 0);
- palette_set_color(space->machine, pal_entry, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), pal_entry, MAKE_RGB(r,g,b));
}
}
static WRITE8_HANDLER( nprsp_bank_w )
{
- neoprint_state *state = space->machine->driver_data<neoprint_state>();
+ neoprint_state *state = space->machine().driver_data<neoprint_state>();
/* this register seems flip-flop based ... */
if((data & 0xf0) == 0x20)
@@ -264,8 +264,8 @@ static WRITE8_HANDLER( nprsp_bank_w )
static READ16_HANDLER( rom_window_r )
{
- neoprint_state *state = space->machine->driver_data<neoprint_state>();
- UINT16 *rom = (UINT16 *)space->machine->region("maincpu")->base();
+ neoprint_state *state = space->machine().driver_data<neoprint_state>();
+ UINT16 *rom = (UINT16 *)space->machine().region("maincpu")->base();
return rom[offset | 0x80000/2 | state->bank_val*0x40000/2];
}
@@ -437,7 +437,7 @@ GFXDECODE_END
static void audio_cpu_irq(device_t *device, int assert)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, assert ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, assert ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -485,7 +485,7 @@ MACHINE_CONFIG_END
static MACHINE_RESET( nprsp )
{
- neoprint_state *state = machine->driver_data<neoprint_state>();
+ neoprint_state *state = machine.driver_data<neoprint_state>();
state->bank_val = 0;
}
@@ -586,7 +586,7 @@ ROM_END
/* FIXME: get rid of these two, probably something to do with irq3 and camera / printer devices */
static DRIVER_INIT( npcartv1 )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
ROM[0x1260/2] = 0x4e71;
@@ -596,14 +596,14 @@ static DRIVER_INIT( npcartv1 )
static DRIVER_INIT( 98best44 )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
ROM[0x1312/2] = 0x4e71;
}
static DRIVER_INIT( nprsp )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
ROM[0x13a4/2] = 0x4e71;
ROM[0x13bc/2] = 0x4e71;
diff --git a/src/mame/drivers/neptunp2.c b/src/mame/drivers/neptunp2.c
index dff5fdfb461..29b7ecfaac9 100644
--- a/src/mame/drivers/neptunp2.c
+++ b/src/mame/drivers/neptunp2.c
@@ -31,7 +31,7 @@ static SCREEN_UPDATE( neptunp2 )
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( neptunp2_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/news.c b/src/mame/drivers/news.c
index 03d0d03e3a6..77d4deaae74 100644
--- a/src/mame/drivers/news.c
+++ b/src/mame/drivers/news.c
@@ -115,14 +115,14 @@ GFXDECODE_END
static MACHINE_START( news )
{
- news_state *state = machine->driver_data<news_state>();
+ news_state *state = machine.driver_data<news_state>();
state->save_item(NAME(state->bgpic));
}
static MACHINE_RESET( news )
{
- news_state *state = machine->driver_data<news_state>();
+ news_state *state = machine.driver_data<news_state>();
state->bgpic = 0;
}
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c
index 9b5a3818eaf..6a15d4c41e8 100644
--- a/src/mame/drivers/nightgal.c
+++ b/src/mame/drivers/nightgal.c
@@ -62,14 +62,14 @@ static READ8_HANDLER( blitter_status_r )
static VIDEO_START( nightgal )
{
- nightgal_state *state = machine->driver_data<nightgal_state>();
+ nightgal_state *state = machine.driver_data<nightgal_state>();
state->save_item(NAME(state->blit_buffer));
}
static SCREEN_UPDATE( nightgal )
{
- nightgal_state *state = screen->machine->driver_data<nightgal_state>();
+ nightgal_state *state = screen->machine().driver_data<nightgal_state>();
int x, y;
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
@@ -80,8 +80,8 @@ static SCREEN_UPDATE( nightgal )
for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
{
UINT32 srcpix = *src++;
- *dst++ = screen->machine->pens[srcpix & 0xf];
- *dst++ = screen->machine->pens[(srcpix >> 4) & 0xf];
+ *dst++ = screen->machine().pens[srcpix & 0xf];
+ *dst++ = screen->machine().pens[(srcpix >> 4) & 0xf];
}
}
@@ -89,9 +89,9 @@ static SCREEN_UPDATE( nightgal )
return 0;
}
-static UINT8 nightgal_gfx_nibble( running_machine *machine, int niboffset )
+static UINT8 nightgal_gfx_nibble( running_machine &machine, int niboffset )
{
- UINT8 *blit_rom = machine->region("gfx1")->base();
+ UINT8 *blit_rom = machine.region("gfx1")->base();
if (niboffset & 1)
{
@@ -103,9 +103,9 @@ static UINT8 nightgal_gfx_nibble( running_machine *machine, int niboffset )
}
}
-static void plot_nightgal_gfx_pixel( running_machine *machine, UINT8 pix, int x, int y )
+static void plot_nightgal_gfx_pixel( running_machine &machine, UINT8 pix, int x, int y )
{
- nightgal_state *state = machine->driver_data<nightgal_state>();
+ nightgal_state *state = machine.driver_data<nightgal_state>();
if (y >= 512) return;
if (x >= 512) return;
if (y < 0) return;
@@ -119,7 +119,7 @@ static void plot_nightgal_gfx_pixel( running_machine *machine, UINT8 pix, int x,
static WRITE8_HANDLER( nsc_true_blitter_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
int src, x, y, h, w, flipx;
state->true_blit[offset] = data;
@@ -152,14 +152,14 @@ static WRITE8_HANDLER( nsc_true_blitter_w )
{
int drawx = (x + xcount) & 0xff;
int drawy = (y + ycount) & 0xff;
- UINT8 dat = nightgal_gfx_nibble(space->machine, src + count);
+ UINT8 dat = nightgal_gfx_nibble(space->machine(), src + count);
UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4];
UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0];
dat = cur_pen_lo | (cur_pen_hi << 4);
if ((dat & 0xff) != 0)
- plot_nightgal_gfx_pixel(space->machine, dat, drawx, drawy);
+ plot_nightgal_gfx_pixel(space->machine(), dat, drawx, drawy);
if (!flipx)
count--;
@@ -174,7 +174,7 @@ static WRITE8_HANDLER( nsc_true_blitter_w )
/* different register writes (probably a PAL line swapping).*/
static WRITE8_HANDLER( sexygal_nsc_true_blitter_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
int src, x, y, h, w, flipx;
state->true_blit[offset] = data;
@@ -208,14 +208,14 @@ static WRITE8_HANDLER( sexygal_nsc_true_blitter_w )
{
int drawx = (x + xcount) & 0xff;
int drawy = (y + ycount) & 0xff;
- UINT8 dat = nightgal_gfx_nibble(space->machine, src + count);
+ UINT8 dat = nightgal_gfx_nibble(space->machine(), src + count);
UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4];
UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0];
dat = cur_pen_lo | cur_pen_hi << 4;
if ((dat & 0xff) != 0)
- plot_nightgal_gfx_pixel(space->machine, dat, drawx, drawy);
+ plot_nightgal_gfx_pixel(space->machine(), dat, drawx, drawy);
if (!flipx)
count--;
@@ -242,7 +242,7 @@ static PALETTE_INIT( nightgal )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -298,40 +298,40 @@ master-slave algorythm
#ifdef UNUSED_CODE
static WRITE8_HANDLER( nsc_latch_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
device_set_input_line(state->subcpu, 0, HOLD_LINE );
}
static READ8_HANDLER( nsc_latch_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
return state->z80_latch;
}
static WRITE8_HANDLER( z80_latch_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->nsc_latch = data;
}
static READ8_HANDLER( z80_latch_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
return state->nsc_latch;
}
/*z80 -> MCU video params*/
static WRITE8_HANDLER( blitter_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->blit_raw_data[offset] = data;
MAIN_Z80_HALT;
}
static READ8_HANDLER( nsc_blit_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
MAIN_Z80_RUN;
return state->blit_raw_data[offset];
}
@@ -340,26 +340,26 @@ static READ8_HANDLER( nsc_blit_r )
static WRITE8_HANDLER( royalqn_blitter_0_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->blit_raw_data[0] = data;
}
static WRITE8_HANDLER( royalqn_blitter_1_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->blit_raw_data[1] = data;
}
static WRITE8_HANDLER( royalqn_blitter_2_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->blit_raw_data[2] = data;
device_set_input_line(state->subcpu, 0, ASSERT_LINE );
}
static READ8_HANDLER( royalqn_nsc_blit_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
if(offset == 2)
device_set_input_line(state->subcpu, 0, CLEAR_LINE );
@@ -369,14 +369,14 @@ static READ8_HANDLER( royalqn_nsc_blit_r )
static READ8_HANDLER( royalqn_comm_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
return (state->comms_ram[offset] & 0x80) | (0x7f); //bits 6-0 are undefined, presumably open bus
}
static WRITE8_HANDLER( royalqn_comm_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->comms_ram[offset] = data & 0x80;
}
@@ -384,19 +384,19 @@ static WRITE8_HANDLER( royalqn_comm_w )
#ifdef UNUSED_CODE
static WRITE8_HANDLER( blit_vregs_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->pen_raw_data[offset] = data;
}
static READ8_HANDLER( blit_vregs_r )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
return state->pen_raw_data[offset];
}
#endif
static WRITE8_HANDLER( blit_true_vregs_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->pen_data[offset] = data;
}
@@ -408,49 +408,49 @@ static WRITE8_HANDLER( blit_true_vregs_w )
static WRITE8_HANDLER( mux_w )
{
- nightgal_state *state = space->machine->driver_data<nightgal_state>();
+ nightgal_state *state = space->machine().driver_data<nightgal_state>();
state->mux_data = ~data;
//printf("%02x\n", state->mux_data);
}
static READ8_DEVICE_HANDLER( input_1p_r )
{
- nightgal_state *state = device->machine->driver_data<nightgal_state>();
- UINT8 cr_clear = input_port_read(device->machine, "CR_CLEAR");
+ nightgal_state *state = device->machine().driver_data<nightgal_state>();
+ UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL1_1") | cr_clear;
- case 0x02: return input_port_read(device->machine, "PL1_2") | cr_clear;
- case 0x04: return input_port_read(device->machine, "PL1_3") | cr_clear;
- case 0x08: return input_port_read(device->machine, "PL1_4") | cr_clear;
- case 0x10: return input_port_read(device->machine, "PL1_5") | cr_clear;
- case 0x20: return input_port_read(device->machine, "PL1_6") | cr_clear;
+ case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
+ case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
+ case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
+ case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
+ case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
+ case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
}
//printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL1_1") & input_port_read(device->machine, "PL1_2") & input_port_read(device->machine, "PL1_3") &
- input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear;
+ return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
+ input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
}
static READ8_DEVICE_HANDLER( input_2p_r )
{
- nightgal_state *state = device->machine->driver_data<nightgal_state>();
- UINT8 coin_port = input_port_read(device->machine, "COINS");
+ nightgal_state *state = device->machine().driver_data<nightgal_state>();
+ UINT8 coin_port = input_port_read(device->machine(), "COINS");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL2_1") | coin_port;
- case 0x02: return input_port_read(device->machine, "PL2_2") | coin_port;
- case 0x04: return input_port_read(device->machine, "PL2_3") | coin_port;
- case 0x08: return input_port_read(device->machine, "PL2_4") | coin_port;
- case 0x10: return input_port_read(device->machine, "PL2_5") | coin_port;
- case 0x20: return input_port_read(device->machine, "PL2_6") | coin_port;
+ case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
+ case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
+ case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
+ case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
+ case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
+ case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
}
//printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL2_1") & input_port_read(device->machine, "PL2_2") & input_port_read(device->machine, "PL2_3") &
- input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port;
+ return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
+ input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
}
/********************************************
@@ -826,10 +826,10 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( nightgal )
{
- nightgal_state *state = machine->driver_data<nightgal_state>();
+ nightgal_state *state = machine.driver_data<nightgal_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->nsc_latch));
state->save_item(NAME(state->z80_latch));
@@ -843,7 +843,7 @@ static MACHINE_START( nightgal )
static MACHINE_RESET( nightgal )
{
- nightgal_state *state = machine->driver_data<nightgal_state>();
+ nightgal_state *state = machine.driver_data<nightgal_state>();
state->nsc_latch = 0;
state->z80_latch = 0;
@@ -1223,7 +1223,7 @@ ROM_END
static DRIVER_INIT( royalqn )
{
- UINT8 *ROM = machine->region("sub")->base();
+ UINT8 *ROM = machine.region("sub")->base();
/* patch open bus / protection */
ROM[0xc27e] = 0x02;
@@ -1232,7 +1232,7 @@ static DRIVER_INIT( royalqn )
static DRIVER_INIT( ngalsumr )
{
- UINT8 *ROM = machine->region("sub")->base();
+ UINT8 *ROM = machine.region("sub")->base();
/* patch protection */
ROM[0xd6ce] = 0x02;
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index a9207d25003..faa20d3cd8d 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -143,7 +143,7 @@ TODO:
//#define NE555_FREQUENCY (1.0f / (0.693 * (560 + 2*51) * 0.1e-6)) // theoretical: this gives 21.8kHz which is too high
-static void omegaf_io_protection_reset(running_machine *machine);
+static void omegaf_io_protection_reset(running_machine &machine);
static INTERRUPT_GEN( ninjakd2_interrupt )
@@ -155,15 +155,15 @@ static INTERRUPT_GEN( ninjakd2_interrupt )
static MACHINE_RESET( ninjakd2 )
{
/* initialize main Z80 bank */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_set_bank(machine, "bank1", 0);
}
-static void robokid_init_banks(running_machine *machine)
+static void robokid_init_banks(running_machine &machine)
{
/* initialize main Z80 bank */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base(), 0x4000);
- memory_configure_bank(machine, "bank1", 2, 14, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 2, 14, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_set_bank(machine, "bank1", 0);
}
@@ -182,22 +182,22 @@ static MACHINE_RESET( omegaf )
static WRITE8_HANDLER( ninjakd2_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
}
static WRITE8_HANDLER( robokid_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0xf);
+ memory_set_bank(space->machine(), "bank1", data & 0xf);
}
static WRITE8_HANDLER( ninjakd2_soundreset_w )
{
// bit 4 resets sound CPU
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
// bit 7 flips screen
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
// other bits unused
}
@@ -206,10 +206,10 @@ static WRITE8_HANDLER( ninjakd2_soundreset_w )
static SAMPLES_START( ninjakd2_init_samples )
{
- ninjakd2_state *state = device->machine->driver_data<ninjakd2_state>();
- running_machine *machine = device->machine;
- const UINT8* const rom = machine->region("pcm")->base();
- const int length = machine->region("pcm")->bytes();
+ ninjakd2_state *state = device->machine().driver_data<ninjakd2_state>();
+ running_machine &machine = device->machine();
+ const UINT8* const rom = machine.region("pcm")->base();
+ const int length = machine.region("pcm")->bytes();
INT16* sampledata = auto_alloc_array(machine, INT16, length);
int i;
@@ -223,14 +223,14 @@ static SAMPLES_START( ninjakd2_init_samples )
static WRITE8_HANDLER( ninjakd2_pcm_play_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
- device_t *samples = space->machine->device("pcm");
- const UINT8* const rom = space->machine->region("pcm")->base();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
+ device_t *samples = space->machine().device("pcm");
+ const UINT8* const rom = space->machine().region("pcm")->base();
// only Ninja Kid II uses this
if (rom)
{
- const int length = space->machine->region("pcm")->bytes();
+ const int length = space->machine().region("pcm")->bytes();
const int start = data << 8;
@@ -256,9 +256,9 @@ static WRITE8_HANDLER( ninjakd2_pcm_play_w )
*
*************************************/
-static void omegaf_io_protection_reset(running_machine *machine)
+static void omegaf_io_protection_reset(running_machine &machine)
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
// make sure protection starts in a known state
state->omegaf_io_protection[0] = 0;
state->omegaf_io_protection[1] = 0;
@@ -269,7 +269,7 @@ static void omegaf_io_protection_reset(running_machine *machine)
static READ8_HANDLER( omegaf_io_protection_r )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
UINT8 result = 0xff;
switch (state->omegaf_io_protection[1] & 3)
@@ -332,8 +332,8 @@ static READ8_HANDLER( omegaf_io_protection_r )
case 1: // dip switches
switch (offset)
{
- case 0: result = input_port_read(space->machine, "DIPSW1"); break;
- case 1: result = input_port_read(space->machine, "DIPSW2"); break;
+ case 0: result = input_port_read(space->machine(), "DIPSW1"); break;
+ case 1: result = input_port_read(space->machine(), "DIPSW2"); break;
case 2: result = 0x02; break;
}
break;
@@ -341,8 +341,8 @@ static READ8_HANDLER( omegaf_io_protection_r )
case 2: // player inputs
switch (offset)
{
- case 0: result = input_port_read(space->machine, "PAD1"); break;
- case 1: result = input_port_read(space->machine, "PAD2"); break;
+ case 0: result = input_port_read(space->machine(), "PAD1"); break;
+ case 1: result = input_port_read(space->machine(), "PAD2"); break;
case 2: result = 0x01; break;
}
break;
@@ -353,7 +353,7 @@ static READ8_HANDLER( omegaf_io_protection_r )
static WRITE8_HANDLER( omegaf_io_protection_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
// load parameter on c006 bit 0 rise transition
if (offset == 2 && (data & 1) && !(state->omegaf_io_protection[2] & 1))
{
@@ -876,7 +876,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -1396,11 +1396,11 @@ by one place all the intervening bits.
******************************************************************************/
-static void lineswap_gfx_roms(running_machine *machine, const char *region, const int bit)
+static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine->region(region)->bytes();
+ const int length = machine.region(region)->bytes();
- UINT8* const src = machine->region(region)->base();
+ UINT8* const src = machine.region(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
@@ -1420,7 +1420,7 @@ static void lineswap_gfx_roms(running_machine *machine, const char *region, cons
auto_free(machine, temp);
}
-static void gfx_unscramble(running_machine *machine)
+static void gfx_unscramble(running_machine &machine)
{
lineswap_gfx_roms(machine, "gfx1", 13); // fg tiles
lineswap_gfx_roms(machine, "gfx2", 14); // sprites
@@ -1444,8 +1444,8 @@ static DRIVER_INIT( ninjakd2 )
static DRIVER_INIT( bootleg )
{
- address_space *space = machine->device("soundcpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("soundcpu")->base() + 0x10000);
+ address_space *space = machine.device("soundcpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("soundcpu")->base() + 0x10000);
gfx_unscramble(machine);
}
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 680eb6bf7b3..cc6d1f868dc 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -323,25 +323,25 @@ rumbling on a subwoofer in the cabinet.)
extern const char layout_darius[];
-static void parse_control( running_machine *machine ) /* assumes Z80 sandwiched between 68Ks */
+static void parse_control( running_machine &machine ) /* assumes Z80 sandwiched between 68Ks */
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, (state->cpua_ctrl & 0x1) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( cpua_ctrl_w )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
if ((data &0xff00) && ((data &0xff) == 0))
data = data >> 8;
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data);
}
@@ -351,23 +351,23 @@ static WRITE16_HANDLER( cpua_ctrl_w )
SOUND
*****************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static WRITE16_HANDLER( ninjaw_sound_w )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, data & 0xff);
@@ -382,7 +382,7 @@ static WRITE16_HANDLER( ninjaw_sound_w )
static READ16_HANDLER( ninjaw_sound_r )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
@@ -395,7 +395,7 @@ static READ16_HANDLER( ninjaw_sound_r )
static WRITE8_HANDLER( ninjaw_pancontrol )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
device_t *flt = NULL;
offset &= 3;
@@ -415,7 +415,7 @@ static WRITE8_HANDLER( ninjaw_pancontrol )
static WRITE16_HANDLER( tc0100scn_triple_screen_w )
{
- ninjaw_state *state = space->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
tc0100scn_word_w(state->tc0100scn_1, offset, data, mem_mask);
tc0100scn_word_w(state->tc0100scn_2, offset, data, mem_mask);
@@ -648,7 +648,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- ninjaw_state *state = device->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = device->machine().driver_data<ninjaw_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -759,42 +759,42 @@ static STATE_POSTLOAD( ninjaw_postload )
static MACHINE_START( ninjaw )
{
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
- memory_configure_bank(machine, "bank10", 0, 8, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->tc0140syt = machine->device("tc0140syt");
- state->tc0100scn_1 = machine->device("tc0100scn_1");
- state->tc0100scn_2 = machine->device("tc0100scn_2");
- state->tc0100scn_3 = machine->device("tc0100scn_3");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->tc0140syt = machine.device("tc0140syt");
+ state->tc0100scn_1 = machine.device("tc0100scn_1");
+ state->tc0100scn_2 = machine.device("tc0100scn_2");
+ state->tc0100scn_3 = machine.device("tc0100scn_3");
- state->lscreen = machine->device("lscreen");
- state->mscreen = machine->device("mscreen");
- state->rscreen = machine->device("rscreen");
+ state->lscreen = machine.device("lscreen");
+ state->mscreen = machine.device("mscreen");
+ state->rscreen = machine.device("rscreen");
- state->_2610_1l = machine->device("2610.1.l");
- state->_2610_1r = machine->device("2610.1.r");
- state->_2610_2l = machine->device("2610.2.l");
- state->_2610_2r = machine->device("2610.2.r");
+ state->_2610_1l = machine.device("2610.1.l");
+ state->_2610_1r = machine.device("2610.1.r");
+ state->_2610_2l = machine.device("2610.2.l");
+ state->_2610_2r = machine.device("2610.2.r");
state->save_item(NAME(state->cpua_ctrl));
state->save_item(NAME(state->banknum));
state->save_item(NAME(state->pandata));
- machine->state().register_postload(ninjaw_postload, NULL);
+ machine.state().register_postload(ninjaw_postload, NULL);
}
static MACHINE_RESET( ninjaw )
{
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
state->cpua_ctrl = 0xff;
state->banknum = 0;
memset(state->pandata, 0, sizeof(state->pandata));
/**** mixer control enable ****/
- machine->sound().system_enable(true); /* mixer enabled */
+ machine.sound().system_enable(true); /* mixer enabled */
}
static MACHINE_CONFIG_START( ninjaw, ninjaw_state )
diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c
index d6b2f893491..f59b2749bab 100644
--- a/src/mame/drivers/niyanpai.c
+++ b/src/mame/drivers/niyanpai.c
@@ -53,9 +53,9 @@ Memo:
#endif
-static void niyanpai_soundbank_w(running_machine *machine, int data)
+static void niyanpai_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
memory_set_bankptr(machine, "bank1", &SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -101,7 +101,7 @@ static READ8_HANDLER( tmpz84c011_pio_r )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine().describe_context(), offset);
portdata = 0xff;
break;
}
@@ -114,13 +114,13 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
switch (offset)
{
case 0: /* PA_0 */
- niyanpai_soundbank_w(space->machine, data & 0x03);
+ niyanpai_soundbank_w(space->machine(), data & 0x03);
break;
case 1: /* PB_0 */
- DAC_WRITE(space->machine->device("dac2"), 0, data);
+ DAC_WRITE(space->machine().device("dac2"), 0, data);
break;
case 2: /* PC_0 */
- DAC_WRITE(space->machine->device("dac1"), 0, data);
+ DAC_WRITE(space->machine().device("dac1"), 0, data);
break;
case 3: /* PD_0 */
break;
@@ -129,7 +129,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine().describe_context(), offset, data);
break;
}
}
@@ -137,125 +137,125 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
/* CPU interface */
static READ8_HANDLER( tmpz84c011_0_pa_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]);
}
static READ8_HANDLER( tmpz84c011_0_pb_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]);
}
static READ8_HANDLER( tmpz84c011_0_pc_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]);
}
static READ8_HANDLER( tmpz84c011_0_pd_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]);
}
static READ8_HANDLER( tmpz84c011_0_pe_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]);
}
static WRITE8_HANDLER( tmpz84c011_0_pa_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_latch[0] = data;
tmpz84c011_pio_w(space, 0, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pb_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_latch[1] = data;
tmpz84c011_pio_w(space, 1, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pc_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_latch[2] = data;
tmpz84c011_pio_w(space, 2, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pd_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_latch[3] = data;
tmpz84c011_pio_w(space, 3, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pe_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_latch[4] = data;
tmpz84c011_pio_w(space, 4, data);
}
static READ8_HANDLER( tmpz84c011_0_dir_pa_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->pio_dir[0];
}
static READ8_HANDLER( tmpz84c011_0_dir_pb_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->pio_dir[1];
}
static READ8_HANDLER( tmpz84c011_0_dir_pc_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->pio_dir[2];
}
static READ8_HANDLER( tmpz84c011_0_dir_pd_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->pio_dir[3];
}
static READ8_HANDLER( tmpz84c011_0_dir_pe_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->pio_dir[4];
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_dir[0] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_dir[1] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_dir[2] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_dir[3] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->pio_dir[4] = data;
}
@@ -271,8 +271,8 @@ static Z80CTC_INTERFACE( ctc_intf )
static MACHINE_RESET( niyanpai )
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
@@ -285,8 +285,8 @@ static MACHINE_RESET( niyanpai )
static DRIVER_INIT( niyanpai )
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
// sound program patch
SNDROM[0x0213] = 0x00; // DI -> NOP
@@ -303,33 +303,33 @@ static READ16_HANDLER( niyanpai_dipsw_r )
{
UINT8 dipsw_a, dipsw_b;
- dipsw_a = (((input_port_read(space->machine, "DSWA") & 0x01) << 7) | ((input_port_read(space->machine, "DSWA") & 0x02) << 5) |
- ((input_port_read(space->machine, "DSWA") & 0x04) << 3) | ((input_port_read(space->machine, "DSWA") & 0x08) << 1) |
- ((input_port_read(space->machine, "DSWA") & 0x10) >> 1) | ((input_port_read(space->machine, "DSWA") & 0x20) >> 3) |
- ((input_port_read(space->machine, "DSWA") & 0x40) >> 5) | ((input_port_read(space->machine, "DSWA") & 0x80) >> 7));
+ dipsw_a = (((input_port_read(space->machine(), "DSWA") & 0x01) << 7) | ((input_port_read(space->machine(), "DSWA") & 0x02) << 5) |
+ ((input_port_read(space->machine(), "DSWA") & 0x04) << 3) | ((input_port_read(space->machine(), "DSWA") & 0x08) << 1) |
+ ((input_port_read(space->machine(), "DSWA") & 0x10) >> 1) | ((input_port_read(space->machine(), "DSWA") & 0x20) >> 3) |
+ ((input_port_read(space->machine(), "DSWA") & 0x40) >> 5) | ((input_port_read(space->machine(), "DSWA") & 0x80) >> 7));
- dipsw_b = (((input_port_read(space->machine, "DSWB") & 0x01) << 7) | ((input_port_read(space->machine, "DSWB") & 0x02) << 5) |
- ((input_port_read(space->machine, "DSWB") & 0x04) << 3) | ((input_port_read(space->machine, "DSWB") & 0x08) << 1) |
- ((input_port_read(space->machine, "DSWB") & 0x10) >> 1) | ((input_port_read(space->machine, "DSWB") & 0x20) >> 3) |
- ((input_port_read(space->machine, "DSWB") & 0x40) >> 5) | ((input_port_read(space->machine, "DSWB") & 0x80) >> 7));
+ dipsw_b = (((input_port_read(space->machine(), "DSWB") & 0x01) << 7) | ((input_port_read(space->machine(), "DSWB") & 0x02) << 5) |
+ ((input_port_read(space->machine(), "DSWB") & 0x04) << 3) | ((input_port_read(space->machine(), "DSWB") & 0x08) << 1) |
+ ((input_port_read(space->machine(), "DSWB") & 0x10) >> 1) | ((input_port_read(space->machine(), "DSWB") & 0x20) >> 3) |
+ ((input_port_read(space->machine(), "DSWB") & 0x40) >> 5) | ((input_port_read(space->machine(), "DSWB") & 0x80) >> 7));
return ((dipsw_a << 8) | dipsw_b);
}
static READ16_HANDLER( musobana_inputport_0_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
int portdata;
switch ((state->musobana_inputport ^ 0xff00) >> 8)
{
- case 0x01: portdata = input_port_read(space->machine, "KEY0"); break;
- case 0x02: portdata = input_port_read(space->machine, "KEY1"); break;
- case 0x04: portdata = input_port_read(space->machine, "KEY2"); break;
- case 0x08: portdata = input_port_read(space->machine, "KEY3"); break;
- case 0x10: portdata = input_port_read(space->machine, "KEY4"); break;
- default: portdata = input_port_read(space->machine, "KEY0") & input_port_read(space->machine, "KEY1") & input_port_read(space->machine, "KEY2")
- & input_port_read(space->machine, "KEY3") & input_port_read(space->machine, "KEY4"); break;
+ case 0x01: portdata = input_port_read(space->machine(), "KEY0"); break;
+ case 0x02: portdata = input_port_read(space->machine(), "KEY1"); break;
+ case 0x04: portdata = input_port_read(space->machine(), "KEY2"); break;
+ case 0x08: portdata = input_port_read(space->machine(), "KEY3"); break;
+ case 0x10: portdata = input_port_read(space->machine(), "KEY4"); break;
+ default: portdata = input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
+ & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"); break;
}
return (portdata);
@@ -337,8 +337,8 @@ static READ16_HANDLER( musobana_inputport_0_r )
static CUSTOM_INPUT( musobana_outcoin_flag_r )
{
- niyanpai_state *state = field->port->machine->driver_data<niyanpai_state>();
- address_space *space = field->port->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ niyanpai_state *state = field->port->machine().driver_data<niyanpai_state>();
+ address_space *space = field->port->machine().device("maincpu")->memory().space(AS_PROGRAM);
// tmp68301_parallel_interface[0x05]
// bit 0 coin counter
// bit 2 motor on
@@ -352,7 +352,7 @@ static CUSTOM_INPUT( musobana_outcoin_flag_r )
static WRITE16_HANDLER ( musobana_inputport_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
state->musobana_inputport = data;
}
diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c
index 829209dfb4b..a0c342a6855 100644
--- a/src/mame/drivers/nmg5.c
+++ b/src/mame/drivers/nmg5.c
@@ -256,21 +256,21 @@ public:
static WRITE16_HANDLER( fg_videoram_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE16_HANDLER( bg_videoram_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE16_HANDLER( nmg5_soundlatch_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
if (ACCESSING_BITS_0_7)
{
@@ -281,30 +281,30 @@ static WRITE16_HANDLER( nmg5_soundlatch_w )
static READ16_HANDLER( prot_r )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
return state->prot_val | state->input_data;
}
static WRITE16_HANDLER( prot_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
state->input_data = data & 0x0f;
}
static WRITE16_HANDLER( gfx_bank_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
if (state->gfx_bank != (data & 3))
{
state->gfx_bank = data & 3;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static WRITE16_HANDLER( priority_reg_w )
{
- nmg5_state *state = space->machine->driver_data<nmg5_state>();
+ nmg5_state *state = space->machine().driver_data<nmg5_state>();
state->priority_reg = data & 7;
@@ -823,27 +823,27 @@ static INPUT_PORTS_START( wondstck )
INPUT_PORTS_END
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, UINT16 *vram, int color )
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, UINT16 *vram, int color )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
SET_TILE_INFO(0, vram[tile_index] | (state->gfx_bank << 16), color, 0);
}
-static TILE_GET_INFO( fg_get_tile_info ) { nmg5_state *state = machine->driver_data<nmg5_state>(); get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 0); }
-static TILE_GET_INFO( bg_get_tile_info ) { nmg5_state *state = machine->driver_data<nmg5_state>(); get_tile_info(machine, tileinfo, tile_index, state->bg_videoram, 1); }
+static TILE_GET_INFO( fg_get_tile_info ) { nmg5_state *state = machine.driver_data<nmg5_state>(); get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 0); }
+static TILE_GET_INFO( bg_get_tile_info ) { nmg5_state *state = machine.driver_data<nmg5_state>(); get_tile_info(machine, tileinfo, tile_index, state->bg_videoram, 1); }
static VIDEO_START( nmg5 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -861,14 +861,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
for (y = 0; y < height; y++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + (flipy ? height-1 - y : y),
color,
flipx,flipy,
sx & 0x1ff,248 - ((sy + 0x10 * (height - y)) & 0x1ff),0);
/* wrap around */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + (flipy ? height-1 - y : y),
color,
flipx,flipy,
@@ -877,9 +877,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
int yyy = 256;
int xxx = 512 / 4;
UINT16 x, y, count;
@@ -909,7 +909,7 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
static SCREEN_UPDATE( nmg5 )
{
- nmg5_state *state = screen->machine->driver_data<nmg5_state>();
+ nmg5_state *state = screen->machine().driver_data<nmg5_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_ram[3] + 9);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_ram[2] + 3);
@@ -920,33 +920,33 @@ static SCREEN_UPDATE( nmg5 )
if (state->priority_reg == 0)
{
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_bitmap(screen->machine, bitmap);
+ draw_bitmap(screen->machine(), bitmap);
}
else if (state->priority_reg == 1)
{
- draw_bitmap(screen->machine, bitmap);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
else if (state->priority_reg == 2)
{
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bitmap(screen->machine, bitmap);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
else if (state->priority_reg == 3)
{
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bitmap(screen->machine, bitmap);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap);
}
else if (state->priority_reg == 7)
{
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_bitmap(screen->machine, bitmap);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
return 0;
}
@@ -998,7 +998,7 @@ GFXDECODE_END
static void soundirq( device_t *device, int state )
{
- nmg5_state *driver_state = device->machine->driver_data<nmg5_state>();
+ nmg5_state *driver_state = device->machine().driver_data<nmg5_state>();
device_set_input_line(driver_state->soundcpu, 0, state);
}
@@ -1009,10 +1009,10 @@ static const ym3812_interface ym3812_intf =
static MACHINE_START( nmg5 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->gfx_bank));
state->save_item(NAME(state->priority_reg));
@@ -1021,7 +1021,7 @@ static MACHINE_START( nmg5 )
static MACHINE_RESET( nmg5 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
/* some games don't set the priority register so it should be hard-coded to a normal layout */
state->priority_reg = 7;
@@ -1523,25 +1523,25 @@ ROM_END
static DRIVER_INIT( prot_val_00 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
state->prot_val = 0x00;
}
static DRIVER_INIT( prot_val_10 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
state->prot_val = 0x10;
}
static DRIVER_INIT( prot_val_20 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
state->prot_val = 0x20;
}
static DRIVER_INIT( prot_val_40 )
{
- nmg5_state *state = machine->driver_data<nmg5_state>();
+ nmg5_state *state = machine.driver_data<nmg5_state>();
state->prot_val = 0x40;
}
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index 16eaed8c1e6..5db20976bc6 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -172,7 +172,7 @@ Afega stands for "Art-Fiction Electronic Game"
static WRITE16_HANDLER( nmk16_mainram_strange_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
UINT16* dstram;
dstram = state->mainram;
@@ -207,7 +207,7 @@ static WRITE16_HANDLER ( ssmissin_sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
@@ -215,7 +215,7 @@ static WRITE16_HANDLER ( ssmissin_sound_w )
static WRITE8_HANDLER ( ssmissin_soundbank_w )
{
- UINT8 *rom = space->machine->region("oki1")->base();
+ UINT8 *rom = space->machine().region("oki1")->base();
int bank;
bank = data & 0x3;
@@ -235,7 +235,7 @@ static WRITE16_HANDLER( tharrier_mcu_control_w )
static READ16_HANDLER( tharrier_mcu_r )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
/* The MCU is mapped as the top byte for byte accesses only,
all word accesses are to the input port */
if (ACCESSING_BITS_8_15 && !ACCESSING_BITS_0_7)
@@ -259,14 +259,14 @@ static READ16_HANDLER( tharrier_mcu_r )
return res << 8;
}
else
- return ~input_port_read(space->machine, "IN1");
+ return ~input_port_read(space->machine(), "IN1");
}
static WRITE16_HANDLER( macross2_sound_reset_w )
{
/* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum:
every time music changes Z80 is resetted */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( macross2_sound_command_w )
@@ -277,14 +277,14 @@ static WRITE16_HANDLER( macross2_sound_command_w )
static WRITE8_HANDLER( macross2_sound_bank_w )
{
- UINT8 *rom = space->machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("audiocpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1",rom + (data & 0x07) * 0x4000);
+ memory_set_bankptr(space->machine(), "bank1",rom + (data & 0x07) * 0x4000);
}
static WRITE8_HANDLER( tharrier_oki6295_bankswitch_0_w )
{
- UINT8 *rom = space->machine->region("oki1")->base();
+ UINT8 *rom = space->machine().region("oki1")->base();
data &= 3;
if (data != 3)
@@ -293,7 +293,7 @@ static WRITE8_HANDLER( tharrier_oki6295_bankswitch_0_w )
static WRITE8_HANDLER( tharrier_oki6295_bankswitch_1_w )
{
- UINT8 *rom = space->machine->region("oki2")->base();
+ UINT8 *rom = space->machine().region("oki2")->base();
data &= 3;
if (data != 3)
@@ -305,7 +305,7 @@ static WRITE16_HANDLER( afega_soundlatch_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data&0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
@@ -599,7 +599,7 @@ f0 - player bombs (8c36)
static WRITE16_HANDLER( hachamf_mainram_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->mainram[offset]);
switch(offset)
@@ -677,7 +677,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( tdragon_mainram_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->mainram[offset]);
switch(offset)
@@ -732,9 +732,9 @@ static WRITE16_HANDLER( tdragon_mainram_w )
}
/*coin setting MCU simulation*/
-static void mcu_run(running_machine *machine, UINT8 dsw_setting)
+static void mcu_run(running_machine &machine, UINT8 dsw_setting)
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
UINT16 coin_input;
UINT8 dsw[2];
UINT8 i;
@@ -873,12 +873,12 @@ static void mcu_run(running_machine *machine, UINT8 dsw_setting)
static TIMER_DEVICE_CALLBACK( tdragon_mcu_sim )
{
- mcu_run(timer.machine,1);
+ mcu_run(timer.machine(),1);
}
static TIMER_DEVICE_CALLBACK( hachamf_mcu_sim )
{
- mcu_run(timer.machine,0);
+ mcu_run(timer.machine(),0);
}
static ADDRESS_MAP_START( tdragon_map, AS_PROGRAM, 16 )
@@ -1064,7 +1064,7 @@ ADDRESS_MAP_END
*/
static WRITE8_HANDLER( okibank_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
state->mask[offset] |= 1 << (data & 0x1f);
popmessage("%x %x %x %x - %x %x %x %x",state->mask[0],state->mask[1],state->mask[2],state->mask[3],state->mask[4],state->mask[5],state->mask[6],state->mask[7]);
}
@@ -1072,7 +1072,7 @@ static WRITE8_HANDLER( okibank_w )
static WRITE8_HANDLER( raphero_sound_rombank_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("audiocpu")->base() + 0x10000 + (data & 0x07) * 0x4000);
}
static ADDRESS_MAP_START( raphero_sound_mem_map, AS_PROGRAM, 8 )
@@ -3504,7 +3504,7 @@ static const ym2203_interface ym2203_nmk004_interface =
static void ym2203_irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -3522,12 +3522,12 @@ static TIMER_DEVICE_CALLBACK( nmk16_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line(timer.machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
/* This is either vblank-in or sprite dma irq complete, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous
cpu_getiloops() implementation), mostly noticeable with sword collisions and related attract mode behaviour. */
if(scanline == 0)
- cputag_set_input_line(timer.machine, "maincpu", 2, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
}
/* bee-oh board, almost certainly it has different timings */
@@ -3536,11 +3536,11 @@ static TIMER_DEVICE_CALLBACK( manybloc_scanline )
int scanline = param;
if(scanline == 248) // vblank-out irq
- cputag_set_input_line(timer.machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
/* This is either vblank-in or sprite dma irq complete */
if(scanline == 0)
- cputag_set_input_line(timer.machine, "maincpu", 2, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
}
@@ -4398,7 +4398,7 @@ static UINT32 bjtwin_address_map_sprites(UINT32 addr)
}
-static void decode_gfx(running_machine *machine)
+static void decode_gfx(running_machine &machine)
{
/* GFX are scrambled. We decode them here. (BIG Thanks to Antiriad for descrambling info) */
UINT8 *rom;
@@ -4431,16 +4431,16 @@ static void decode_gfx(running_machine *machine)
/* background */
- rom = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]);
}
/* sprites */
- rom = machine->region("gfx3")->base();
- len = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ len = machine.region("gfx3")->bytes();
for (A = 0;A < len;A += 2)
{
UINT16 tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]);
@@ -4449,7 +4449,7 @@ static void decode_gfx(running_machine *machine)
}
}
-static void decode_tdragonb(running_machine *machine)
+static void decode_tdragonb(running_machine &machine)
{
/* Descrambling Info Again Taken from Raine, Huge Thanks to Antiriad and the Raine Team for
going Open Source, best of luck in future development. */
@@ -4469,8 +4469,8 @@ static void decode_tdragonb(running_machine *machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine->region("maincpu")->base();
- len = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ len = machine.region("maincpu")->bytes();
for (A = 0;A < len;A += 2)
{
int h = A+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A+NATIVE_ENDIAN_VALUE_LE_BE(0,1);
@@ -4479,22 +4479,22 @@ static void decode_tdragonb(running_machine *machine)
rom[l] = tmp & 0xff;
}
- rom = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine->region("gfx3")->base();
- len = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ len = machine.region("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
}
-static void decode_ssmissin(running_machine *machine)
+static void decode_ssmissin(running_machine &machine)
{
/* Like Thunder Dragon Bootleg without the Program Rom Swapping */
UINT8 *rom;
@@ -4506,15 +4506,15 @@ static void decode_ssmissin(running_machine *machine)
{0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0},
};
- rom = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
}
- rom = machine->region("gfx3")->base();
- len = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ len = machine.region("gfx3")->bytes();
for (A = 0;A < len;A++)
{
rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]);
@@ -4529,7 +4529,7 @@ static DRIVER_INIT( nmk )
static DRIVER_INIT( hachamf )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
//rom[0x0006/2] = 0x7dc2; /* replace reset vector with the "real" one */
@@ -4540,7 +4540,7 @@ static DRIVER_INIT( hachamf )
static DRIVER_INIT( tdragonb )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
decode_tdragonb(machine);
@@ -4551,7 +4551,7 @@ static DRIVER_INIT( tdragonb )
static DRIVER_INIT( tdragon )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
//rom[0x94b0/2] = 0; /* Patch out JMP to shared memory (protection) */
//rom[0x94b2/2] = 0x92f4;
@@ -4585,7 +4585,7 @@ static DRIVER_INIT( bjtwin )
* 008F7E: 207C 000F 9000 movea.l #$f9000, A0
*/
#if 0
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x09172/2] = 0x6006; /* patch checksum error */
rom[0x08f74/2] = 0x4e71;
#endif
@@ -4598,8 +4598,8 @@ static DRIVER_INIT( bjtwin )
static READ16_HANDLER( vandykeb_r ) { return 0x0000; }
static DRIVER_INIT (vandykeb)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08000e, 0x08000f, FUNC(vandykeb_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x08001e, 0x08001f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08000e, 0x08000f, FUNC(vandykeb_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x08001e, 0x08001f);
}
@@ -4621,13 +4621,13 @@ static READ16_HANDLER( afega_unknown_r )
static WRITE16_HANDLER( afega_scroll0_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->afega_scroll_0[offset]);
}
static WRITE16_HANDLER( afega_scroll1_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->afega_scroll_1[offset]);
}
@@ -4669,14 +4669,14 @@ ADDRESS_MAP_END
// The high byte of the word written is the address to write to (byte offset), the low byte is data
static WRITE16_HANDLER( twinactn_scroll0_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
int byte = ((data >> 8) & 3) ^ 2;
int bit = ((byte & 1) ? 0 : 8);
state->afega_scroll_0[byte / 2] = (state->afega_scroll_0[byte / 2] & (0xff << (8-bit))) | ((data & 0xff) << bit);
}
static WRITE16_HANDLER( twinactn_scroll1_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
int byte = ((data >> 8) & 3) ^ 2;
int bit = ((byte & 1) ? 0 : 8);
state->afega_scroll_1[byte / 2] = (state->afega_scroll_1[byte / 2] & (0xff << (8-bit))) | ((data & 0xff) << bit);
@@ -4685,7 +4685,7 @@ static WRITE16_HANDLER( twinactn_scroll1_w )
static WRITE16_HANDLER( twinactn_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
if (data & (~1))
logerror("%06x: unknown flip screen bit written %04x\n", cpu_get_pc(space->cpu), data);
@@ -4733,7 +4733,7 @@ static WRITE8_DEVICE_HANDLER( twinactn_oki_bank_w )
downcast<okim6295_device *>(device)->set_bank_base((data & 3) * 0x40000);
if (data & (~3))
- logerror("%s: invalid oki bank %02x\n", device->machine->describe_context(), data);
+ logerror("%s: invalid oki bank %02x\n", device->machine().describe_context(), data);
// logerror("%04x: oki bank %02x\n", cpu_get_pc(space->cpu), data);
}
@@ -4828,7 +4828,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface afega_ym2151_intf =
@@ -5001,12 +5001,12 @@ MACHINE_CONFIG_END
/* Address lines scrambling */
-static void decryptcode( running_machine *machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12,
+static void decryptcode( running_machine &machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12,
int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 )
{
int i;
- UINT8 *RAM = machine->region( "maincpu" )->base();
- size_t size = machine->region( "maincpu" )->bytes();
+ UINT8 *RAM = machine.region( "maincpu" )->base();
+ size_t size = machine.region( "maincpu" )->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size );
memcpy( buffer, RAM, size );
diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c
index 5fc7243ad35..be43dbc026e 100644
--- a/src/mame/drivers/norautp.c
+++ b/src/mame/drivers/norautp.c
@@ -559,19 +559,19 @@
static VIDEO_START( norautp )
{
- norautp_state *state = machine->driver_data<norautp_state>();
+ norautp_state *state = machine.driver_data<norautp_state>();
state->np_vram = auto_alloc_array(machine, UINT16, 0x1000/2);
}
static SCREEN_UPDATE( norautp )
{
- norautp_state *state = screen->machine->driver_data<norautp_state>();
+ norautp_state *state = screen->machine().driver_data<norautp_state>();
int x, y, count;
count = 0;
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //black pen
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //black pen
for(y = 0; y < 8; y++)
{
@@ -583,7 +583,7 @@ static SCREEN_UPDATE( norautp )
int tile = state->np_vram[count] & 0x3f;
int colour = (state->np_vram[count] & 0xc0) >> 6;
- drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32);
+ drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[1], tile, colour, 0, 0, (x * 32) + 8, y * 32);
count+=2;
}
@@ -595,7 +595,7 @@ static SCREEN_UPDATE( norautp )
int tile = state->np_vram[count] & 0x3f;
int colour = (state->np_vram[count] & 0xc0) >> 6;
- drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[0], tile, colour, 0, 0, x * 16, y * 32);
+ drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[0], tile, colour, 0, 0, x * 16, y * 32);
count++;
}
@@ -664,7 +664,7 @@ static WRITE8_DEVICE_HANDLER( soundlamps_w )
xxxx ---- * Discrete Sound Lines.
*/
- device_t *discrete = device->machine->device("discrete");
+ device_t *discrete = device->machine().device("discrete");
output_set_lamp_value(8, (data >> 0) & 1); /* DEAL / DRAW lamp */
output_set_lamp_value(9, (data >> 1) & 1); /* BET / COLLECT lamp */
@@ -694,9 +694,9 @@ static WRITE8_DEVICE_HANDLER( counterlamps_w )
output_set_lamp_value(10, (data >> 0) & 1); /* HI lamp */
output_set_lamp_value(11, (data >> 1) & 1); /* LO lamp */
- coin_counter_w(device->machine, 0, data & 0x10); /* Coin1/3 counter */
- coin_counter_w(device->machine, 1, data & 0x20); /* Coin2 counter */
- coin_counter_w(device->machine, 2, data & 0x08); /* Payout pulse */
+ coin_counter_w(device->machine(), 0, data & 0x10); /* Coin1/3 counter */
+ coin_counter_w(device->machine(), 1, data & 0x20); /* Coin2 counter */
+ coin_counter_w(device->machine(), 2, data & 0x08); /* Payout pulse */
}
@@ -725,26 +725,26 @@ static READ8_HANDLER( test_r )
static READ8_HANDLER( vram_data_r )
//static READ8_DEVICE_HANDLER( vram_data_r )
{
- norautp_state *state = space->machine->driver_data<norautp_state>();
+ norautp_state *state = space->machine().driver_data<norautp_state>();
return state->np_vram[state->np_addr];
}
static WRITE8_HANDLER( vram_data_w )
//static WRITE8_DEVICE_HANDLER( vram_data_w )
{
- norautp_state *state = space->machine->driver_data<norautp_state>();
+ norautp_state *state = space->machine().driver_data<norautp_state>();
state->np_vram[state->np_addr] = data & 0xff;
/* trigger 8255-2 port C bit 7 (/OBF) */
-// i8255a_pc7_w(device->machine->device("ppi8255_2"), 0);
-// i8255a_pc7_w(device->machine->device("ppi8255_2"), 1);
+// i8255a_pc7_w(device->machine().device("ppi8255_2"), 0);
+// i8255a_pc7_w(device->machine().device("ppi8255_2"), 1);
}
static WRITE8_HANDLER( vram_addr_w )
//static WRITE8_DEVICE_HANDLER( vram_addr_w )
{
- norautp_state *state = space->machine->driver_data<norautp_state>();
+ norautp_state *state = space->machine().driver_data<norautp_state>();
state->np_addr = data;
}
@@ -3370,21 +3370,21 @@ ROM_END
*/
//static DRIVER_INIT( norautrh )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x1110] = 0x00;
// ROM[0x1111] = 0x00;
//}
//static DRIVER_INIT( norautpn )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x0827] = 0x00;
// ROM[0x0828] = 0x00;
//}
//static DRIVER_INIT( norautu )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x083c] = 0x00;
// ROM[0x083d] = 0x00;
// ROM[0x083e] = 0x00;
@@ -3392,7 +3392,7 @@ ROM_END
//static DRIVER_INIT( gtipoker )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x0cc6] = 0x00;
// ROM[0x0cc7] = 0x00;
// ROM[0x0cc8] = 0x00;
@@ -3403,7 +3403,7 @@ ROM_END
//static DRIVER_INIT( dphl )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x1510] = 0x00;
// ROM[0x1511] = 0x00;
// ROM[0x1512] = 0x00;
@@ -3411,7 +3411,7 @@ ROM_END
//static DRIVER_INIT( dphla )
//{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x0b09] = 0x00;
// ROM[0x0b0a] = 0x00;
// ROM[0x0b0b] = 0x00;
@@ -3421,9 +3421,9 @@ static DRIVER_INIT( enc )
{
/* Attempt to decrypt the program ROM */
-// UINT8 *rom = machine->region("maincpu")->base();
+// UINT8 *rom = machine.region("maincpu")->base();
// UINT8 *buffer;
-// int size = 0x2000; //machine->region("maincpu")->bytes();
+// int size = 0x2000; //machine.region("maincpu")->bytes();
// int start = 0;
// int i;
@@ -3460,7 +3460,7 @@ static DRIVER_INIT( deb )
/* Just for debugging purposes */
/* Should be removed soon */
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x02f7] = 0xca;
ROM[0x02f8] = 0x18;
ROM[0x206c] = 0xff;
@@ -3470,7 +3470,7 @@ static DRIVER_INIT( ssa )
/* Passing the video PPI handshaking lines */
/* Just for debugging purposes */
{
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x073b] = 0x00;
// ROM[0x073c] = 0x00;
diff --git a/src/mame/drivers/nova2001.c b/src/mame/drivers/nova2001.c
index 52ceaaf19c2..763698b5fb1 100644
--- a/src/mame/drivers/nova2001.c
+++ b/src/mame/drivers/nova2001.c
@@ -135,20 +135,20 @@ e000 - e7ff R/W Work RAM
static CUSTOM_INPUT( ninjakun_io_A002_ctrl_r )
{
- nova2001_state *state = field->port->machine->driver_data<nova2001_state>();
+ nova2001_state *state = field->port->machine().driver_data<nova2001_state>();
return state->ninjakun_io_a002_ctrl;
}
static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
if( data == 0x80 ) state->ninjakun_io_a002_ctrl |= 0x01;
if( data == 0x40 ) state->ninjakun_io_a002_ctrl &= ~0x02;
}
static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
if( data == 0x40 ) state->ninjakun_io_a002_ctrl |= 0x02;
if( data == 0x80 ) state->ninjakun_io_a002_ctrl &= ~0x01;
}
@@ -163,7 +163,7 @@ static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
static MACHINE_START( ninjakun )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
/* Save State Stuff */
state_save_register_global(machine, state->ninjakun_io_a002_ctrl);
}
@@ -986,11 +986,11 @@ This code is overly generic because it is used for several games in ninjakd2.c
******************************************************************************/
-static void lineswap_gfx_roms(running_machine *machine, const char *region, const int bit)
+static void lineswap_gfx_roms(running_machine &machine, const char *region, const int bit)
{
- const int length = machine->region(region)->bytes();
+ const int length = machine.region(region)->bytes();
- UINT8* const src = machine->region(region)->base();
+ UINT8* const src = machine.region(region)->base();
UINT8* const temp = auto_alloc_array(machine, UINT8, length);
diff --git a/src/mame/drivers/nsmpoker.c b/src/mame/drivers/nsmpoker.c
index c62e26e512e..5a4add4f342 100644
--- a/src/mame/drivers/nsmpoker.c
+++ b/src/mame/drivers/nsmpoker.c
@@ -83,7 +83,7 @@ public:
static WRITE8_HANDLER( nsmpoker_videoram_w )
{
- nsmpoker_state *state = space->machine->driver_data<nsmpoker_state>();
+ nsmpoker_state *state = space->machine().driver_data<nsmpoker_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -91,7 +91,7 @@ static WRITE8_HANDLER( nsmpoker_videoram_w )
static WRITE8_HANDLER( nsmpoker_colorram_w )
{
- nsmpoker_state *state = space->machine->driver_data<nsmpoker_state>();
+ nsmpoker_state *state = space->machine().driver_data<nsmpoker_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( nsmpoker_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- nsmpoker_state *state = machine->driver_data<nsmpoker_state>();
+ nsmpoker_state *state = machine.driver_data<nsmpoker_state>();
/* - bits -
7654 3210
---- ---- bank select.
@@ -117,14 +117,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( nsmpoker )
{
- nsmpoker_state *state = machine->driver_data<nsmpoker_state>();
+ nsmpoker_state *state = machine.driver_data<nsmpoker_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( nsmpoker )
{
- nsmpoker_state *state = screen->machine->driver_data<nsmpoker_state>();
+ nsmpoker_state *state = screen->machine().driver_data<nsmpoker_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -152,7 +152,7 @@ static INTERRUPT_GEN( nsmpoker_interrupt )
static READ8_HANDLER( debug_r )
{
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index 5edcd282703..f201e8d922f 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -381,16 +381,16 @@ static WRITE8_HANDLER( nss_eeprom_w )
static READ8_HANDLER( m50458_r )
{
- nss_state *state = space->machine->driver_data<nss_state>();
+ nss_state *state = space->machine().driver_data<nss_state>();
if(state->m50458_rom_bank)
{
- UINT8 *gfx_rom = space->machine->region("m50458_gfx")->base();
+ UINT8 *gfx_rom = space->machine().region("m50458_gfx")->base();
return gfx_rom[offset & 0xfff];
}
else
{
- UINT8 *gfx_ram = space->machine->region("m50458_vram")->base();
+ UINT8 *gfx_ram = space->machine().region("m50458_vram")->base();
return gfx_ram[offset & 0xfff];
}
@@ -400,12 +400,12 @@ static READ8_HANDLER( m50458_r )
static WRITE8_HANDLER( m50458_w )
{
- nss_state *state = space->machine->driver_data<nss_state>();
+ nss_state *state = space->machine().driver_data<nss_state>();
if(state->m50458_rom_bank)
logerror("Warning: write to M50458 GFX ROM!\n");
else
{
- UINT8 *gfx_ram = space->machine->region("m50458_vram")->base();
+ UINT8 *gfx_ram = space->machine().region("m50458_vram")->base();
gfx_ram[offset & 0xfff] = data;
}
@@ -424,7 +424,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( port00_r )
{
- nss_state *state = space->machine->driver_data<nss_state>();
+ nss_state *state = space->machine().driver_data<nss_state>();
/*
-x-- ---- almost certainly tied to the vblank signal
*/
@@ -464,14 +464,14 @@ static READ8_HANDLER( port03_r )
static WRITE8_HANDLER( port80_w )
{
- nss_state *state = space->machine->driver_data<nss_state>();
+ nss_state *state = space->machine().driver_data<nss_state>();
/*
---- -x-- written when 0x9000-0x9fff is read, probably a bankswitch
---- --x- see port 0x02 note
---- ---x BIOS bankswitch
*/
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
state->m50458_rom_bank = data & 4;
}
@@ -499,8 +499,8 @@ ADDRESS_MAP_END
static MACHINE_START( nss )
{
- nss_state *state = machine->driver_data<nss_state>();
- UINT8 *ROM = machine->region("bios")->base();
+ nss_state *state = machine.driver_data<nss_state>();
+ UINT8 *ROM = machine.region("bios")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000);
memory_set_bank(machine, "bank1", 0);
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 88b9b0efc94..6ad77fdd4e1 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -248,24 +248,24 @@ public:
static WRITE32_HANDLER( paletteram32_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static void voodoo_vblank_0(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
}
static SCREEN_UPDATE( nwktr )
{
- nwktr_state *state = screen->machine->driver_data<nwktr_state>();
- device_t *voodoo = screen->machine->device("voodoo");
- device_t *k001604 = screen->machine->device("k001604");
+ nwktr_state *state = screen->machine().driver_data<nwktr_state>();
+ device_t *voodoo = screen->machine().device("voodoo");
+ device_t *k001604 = screen->machine().device("k001604");
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
voodoo_update(voodoo, bitmap, cliprect);
@@ -280,21 +280,21 @@ static SCREEN_UPDATE( nwktr )
static READ32_HANDLER( sysreg_r )
{
- device_t *adc12138 = space->machine->device("adc12138");
+ device_t *adc12138 = space->machine().device("adc12138");
UINT32 r = 0;
if (offset == 0)
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "IN0") << 24;
+ r |= input_port_read(space->machine(), "IN0") << 24;
}
if (ACCESSING_BITS_16_23)
{
- r |= input_port_read(space->machine, "IN1") << 16;
+ r |= input_port_read(space->machine(), "IN1") << 16;
}
if (ACCESSING_BITS_8_15)
{
- r |= input_port_read(space->machine, "IN2") << 8;
+ r |= input_port_read(space->machine(), "IN2") << 8;
}
if (ACCESSING_BITS_0_7)
{
@@ -305,7 +305,7 @@ static READ32_HANDLER( sysreg_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "DSW") << 24;
+ r |= input_port_read(space->machine(), "DSW") << 24;
}
}
return r;
@@ -313,8 +313,8 @@ static READ32_HANDLER( sysreg_r )
static WRITE32_HANDLER( sysreg_w )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
- device_t *adc12138 = space->machine->device("adc12138");
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
+ device_t *adc12138 = space->machine().device("adc12138");
if( offset == 0 )
{
if (ACCESSING_BITS_24_31)
@@ -345,11 +345,11 @@ static WRITE32_HANDLER( sysreg_w )
{
if (data & 0x80) // CG Board 1 IRQ Ack
{
- //cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ //cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
}
if (data & 0x40) // CG Board 0 IRQ Ack
{
- //cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ //cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
}
}
return;
@@ -357,9 +357,9 @@ static WRITE32_HANDLER( sysreg_w )
}
-static void lanc2_init(running_machine *machine)
+static void lanc2_init(running_machine &machine)
{
- nwktr_state *state = machine->driver_data<nwktr_state>();
+ nwktr_state *state = machine.driver_data<nwktr_state>();
state->fpga_uploaded = 0;
state->lanc2_ram_r = 0;
state->lanc2_ram_w = 0;
@@ -368,7 +368,7 @@ static void lanc2_init(running_machine *machine)
static READ32_HANDLER( lanc1_r )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
switch (offset)
{
case 0x40/4:
@@ -396,7 +396,7 @@ static WRITE32_HANDLER( lanc1_w )
static READ32_HANDLER( lanc2_r )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
UINT32 r = 0;
if (offset == 0)
@@ -427,7 +427,7 @@ static READ32_HANDLER( lanc2_r )
static WRITE32_HANDLER( lanc2_w )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
if (offset == 0)
{
if (ACCESSING_BITS_24_31)
@@ -459,7 +459,7 @@ static WRITE32_HANDLER( lanc2_w )
}
if (offset == 4)
{
- if (mame_stricmp(space->machine->system().name, "thrilld") == 0)
+ if (mame_stricmp(space->machine().system().name, "thrilld") == 0)
{
state->work_ram[(0x3ffed0/4) + 0] = 0x472a3731;
state->work_ram[(0x3ffed0/4) + 1] = 0x33202020;
@@ -480,12 +480,12 @@ static WRITE32_HANDLER( lanc2_w )
static MACHINE_START( nwktr )
{
- nwktr_state *state = machine->driver_data<nwktr_state>();
+ nwktr_state *state = machine.driver_data<nwktr_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->work_ram);
}
static ADDRESS_MAP_START( nwktr_map, AS_PROGRAM, 32 )
@@ -524,13 +524,13 @@ ADDRESS_MAP_END
static READ32_HANDLER( dsp_dataram_r )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
return state->sharc_dataram[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram_w )
{
- nwktr_state *state = space->machine->driver_data<nwktr_state>();
+ nwktr_state *state = space->machine().driver_data<nwktr_state>();
state->sharc_dataram[offset] = data;
}
@@ -621,11 +621,11 @@ static double adc12138_input_callback( device_t *device, UINT8 input )
int value = 0;
switch (input)
{
- case 0: value = input_port_read(device->machine, "ANALOG1") - 0x800; break;
- case 1: value = input_port_read(device->machine, "ANALOG2"); break;
- case 2: value = input_port_read(device->machine, "ANALOG3"); break;
- case 3: value = input_port_read(device->machine, "ANALOG4"); break;
- case 4: value = input_port_read(device->machine, "ANALOG5"); break;
+ case 0: value = input_port_read(device->machine(), "ANALOG1") - 0x800; break;
+ case 1: value = input_port_read(device->machine(), "ANALOG2"); break;
+ case 2: value = input_port_read(device->machine(), "ANALOG3"); break;
+ case 3: value = input_port_read(device->machine(), "ANALOG4"); break;
+ case 4: value = input_port_read(device->machine(), "ANALOG5"); break;
}
return (double)(value) / 2047.0;
@@ -635,12 +635,12 @@ static const adc12138_interface nwktr_adc_interface = {
adc12138_input_callback
};
-static void sound_irq_callback(running_machine *machine, int irq)
+static void sound_irq_callback(running_machine &machine, int irq)
{
if (irq == 0)
- generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ1);
+ generic_pulse_irq_line(machine.device("audiocpu"), INPUT_LINE_IRQ1);
else
- generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ2);
+ generic_pulse_irq_line(machine.device("audiocpu"), INPUT_LINE_IRQ2);
}
static const k056800_interface nwktr_k056800_interface =
@@ -734,9 +734,9 @@ MACHINE_CONFIG_END
static DRIVER_INIT(nwktr)
{
- nwktr_state *state = machine->driver_data<nwktr_state>();
+ nwktr_state *state = machine.driver_data<nwktr_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_NWKTR);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
state->sharc_dataram = auto_alloc_array(machine, UINT32, 0x100000/4);
state->led_reg0 = state->led_reg1 = 0x7f;
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index dbe3cd1595c..00c3fed9182 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -202,32 +202,32 @@ Stephh's additional notes (based on the game Z80 code and some tests) :
static WRITE8_HANDLER( sub_cpu_halt_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
device_set_input_line(state->subcpu, INPUT_LINE_HALT, (data) ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_HANDLER( from_snd_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->snd_data;
}
static WRITE8_HANDLER( to_main_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->snd_data = data;
}
static READ8_HANDLER(nycaptor_sharedram_r)
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER(nycaptor_sharedram_w)
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->sharedram[offset] = data;
}
@@ -238,8 +238,8 @@ static READ8_HANDLER( nycaptor_b_r )
static READ8_HANDLER( nycaptor_by_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
- int port = input_port_read(space->machine, "LIGHTY");
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
+ int port = input_port_read(space->machine(), "LIGHTY");
if (state->gametype == 1)
port = 255 - port;
@@ -249,20 +249,20 @@ static READ8_HANDLER( nycaptor_by_r )
static READ8_HANDLER( nycaptor_bx_r )
{
- return (input_port_read(space->machine, "LIGHTX") + 0x27) | 1;
+ return (input_port_read(space->machine(), "LIGHTX") + 0x27) | 1;
}
static WRITE8_HANDLER( sound_cpu_reset_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_RESET( ta7630 )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
double db = 0.0;
double db_step = 0.50; /* 0.50 dB step (at least, maybe more) */
@@ -280,7 +280,7 @@ static MACHINE_RESET( ta7630 )
static TIMER_CALLBACK( nmi_callback )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -290,18 +290,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -334,15 +334,15 @@ static const msm5232_interface msm5232_config =
static READ8_HANDLER ( nycaptor_generic_control_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->generic_control_reg;
}
static WRITE8_HANDLER( nycaptor_generic_control_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->generic_control_reg = data;
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
}
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8 )
@@ -439,16 +439,16 @@ static WRITE8_HANDLER(cyclshtg_mcu_w)
static READ8_HANDLER(cyclshtg_mcu_status_r1)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( cyclshtg_generic_control_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
int bank = (data >> 2) & 3;
state->generic_control_reg = data;
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x10000 + bank*0x4000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + bank*0x4000 );
}
@@ -498,7 +498,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( unk_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( bronx_master_map, AS_PROGRAM, 8 )
@@ -777,12 +777,12 @@ GFXDECODE_END
static MACHINE_START( nycaptor )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->generic_control_reg));
state->save_item(NAME(state->sound_nmi_enable));
@@ -811,7 +811,7 @@ static MACHINE_START( nycaptor )
static MACHINE_RESET( nycaptor )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
MACHINE_RESET_CALL(ta7630);
@@ -1355,21 +1355,21 @@ ROM_END
static DRIVER_INIT( nycaptor )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
state->gametype = 0;
}
static DRIVER_INIT( cyclshtg )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
state->gametype = 1;
}
static DRIVER_INIT( bronx )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
@@ -1379,9 +1379,9 @@ static DRIVER_INIT( bronx )
static DRIVER_INIT( colt )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 16ce161c2b6..aac2bad5fa4 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( audio_2_command_w );
static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
{
- nyny_state *driver_state = device->machine->driver_data<nyny_state>();
+ nyny_state *driver_state = device->machine().driver_data<nyny_state>();
int combined_state = pia6821_get_irq_a(driver_state->pia1) | pia6821_get_irq_b(driver_state->pia1) | pia6821_get_irq_b(driver_state->pia2);
device_set_input_line(driver_state->maincpu, M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
@@ -141,7 +141,7 @@ static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
static WRITE_LINE_DEVICE_HANDLER( main_cpu_firq )
{
- nyny_state *driver_state = device->machine->driver_data<nyny_state>();
+ nyny_state *driver_state = device->machine().driver_data<nyny_state>();
device_set_input_line(driver_state->maincpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -155,18 +155,18 @@ static WRITE_LINE_DEVICE_HANDLER( main_cpu_firq )
static INTERRUPT_GEN( update_pia_1 )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
/* update the different PIA pins from the input ports */
/* CA1 - copy of PA0 (COIN1) */
- pia6821_ca1_w(state->pia1, input_port_read(device->machine, "IN0") & 0x01);
+ pia6821_ca1_w(state->pia1, input_port_read(device->machine(), "IN0") & 0x01);
/* CA2 - copy of PA1 (SERVICE1) */
- pia6821_ca2_w(state->pia1, input_port_read(device->machine, "IN0") & 0x02);
+ pia6821_ca2_w(state->pia1, input_port_read(device->machine(), "IN0") & 0x02);
/* CB1 - (crosshatch) */
- pia6821_cb1_w(state->pia1, input_port_read(device->machine, "CROSS"));
+ pia6821_cb1_w(state->pia1, input_port_read(device->machine(), "CROSS"));
/* CB2 - NOT CONNECTED */
}
@@ -198,14 +198,14 @@ static const pia6821_interface pia_1_intf =
static WRITE8_DEVICE_HANDLER( pia_2_port_a_w )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
state->star_delay_counter = (state->star_delay_counter & 0x0f00) | data;
}
static WRITE8_DEVICE_HANDLER( pia_2_port_b_w )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
/* bits 0-3 go to bits 8-11 of the star delay counter */
state->star_delay_counter = (state->star_delay_counter & 0x00ff) | ((data & 0x0f) << 8);
@@ -250,7 +250,7 @@ static const pia6821_interface pia_2_intf =
static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
pia6821_ca1_w(state->pia2, data);
}
@@ -277,14 +277,14 @@ static const ttl74123_interface ic48_1_config =
static WRITE_LINE_DEVICE_HANDLER( flipscreen_w )
{
- nyny_state *driver_state = device->machine->driver_data<nyny_state>();
+ nyny_state *driver_state = device->machine().driver_data<nyny_state>();
driver_state->flipscreen = state ? 0 : 1;
}
static MC6845_BEGIN_UPDATE( begin_update )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
/* create the pens */
offs_t i;
@@ -299,7 +299,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
UINT8 cx;
pen_t *pens = (pen_t *)param;
UINT8 x = 0;
@@ -360,16 +360,16 @@ static MC6845_UPDATE_ROW( update_row )
}
-INLINE void shift_star_generator( running_machine *machine )
+INLINE void shift_star_generator( running_machine &machine )
{
- nyny_state *state = machine->driver_data<nyny_state>();
+ nyny_state *state = machine.driver_data<nyny_state>();
state->star_shift_reg = (state->star_shift_reg << 1) | (((~state->star_shift_reg >> 15) & 0x01) ^ ((state->star_shift_reg >> 2) & 0x01));
}
static MC6845_END_UPDATE( end_update )
{
- nyny_state *state = device->machine->driver_data<nyny_state>();
+ nyny_state *state = device->machine().driver_data<nyny_state>();
/* draw the star field into the bitmap */
int y;
@@ -397,7 +397,7 @@ static MC6845_END_UPDATE( end_update )
}
if (delay_counter == 0)
- shift_star_generator(device->machine);
+ shift_star_generator(device->machine());
else
delay_counter = delay_counter - 1;
}
@@ -407,7 +407,7 @@ static MC6845_END_UPDATE( end_update )
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
{
- nyny_state *driver_state = device->machine->driver_data<nyny_state>();
+ nyny_state *driver_state = device->machine().driver_data<nyny_state>();
ttl74123_a_w(driver_state->ic48_1, 0, state);
}
@@ -429,7 +429,7 @@ static const mc6845_interface mc6845_intf =
static SCREEN_UPDATE( nyny )
{
- nyny_state *state = screen->machine->driver_data<nyny_state>();
+ nyny_state *state = screen->machine().driver_data<nyny_state>();
mc6845_update(state->mc6845, bitmap, cliprect);
@@ -446,7 +446,7 @@ static SCREEN_UPDATE( nyny )
static WRITE8_HANDLER( audio_1_command_w )
{
- nyny_state *state = space->machine->driver_data<nyny_state>();
+ nyny_state *state = space->machine().driver_data<nyny_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, M6800_IRQ_LINE, HOLD_LINE);
@@ -455,7 +455,7 @@ static WRITE8_HANDLER( audio_1_command_w )
static WRITE8_HANDLER( audio_1_answer_w )
{
- nyny_state *state = space->machine->driver_data<nyny_state>();
+ nyny_state *state = space->machine().driver_data<nyny_state>();
soundlatch3_w(space, 0, data);
device_set_input_line(state->maincpu, M6809_IRQ_LINE, HOLD_LINE);
@@ -466,7 +466,7 @@ static WRITE8_DEVICE_HANDLER( nyny_ay8910_37_port_a_w )
{
/* not sure what this does */
- /*logerror("%x PORT A write %x at Y=%x X=%x\n", cpu_get_pc(space->cpu), data, space->machine->primary_screen->vpos(), space->machine->primary_screen->hpos());*/
+ /*logerror("%x PORT A write %x at Y=%x X=%x\n", cpu_get_pc(space->cpu), data, space->machine().primary_screen->vpos(), space->machine().primary_screen->hpos());*/
}
@@ -501,7 +501,7 @@ static const ay8910_interface ay8910_64_interface =
static WRITE8_HANDLER( audio_2_command_w )
{
- nyny_state *state = space->machine->driver_data<nyny_state>();
+ nyny_state *state = space->machine().driver_data<nyny_state>();
soundlatch2_w(space, 0, (data & 0x60) >> 5);
device_set_input_line(state->audiocpu2, M6800_IRQ_LINE, BIT(data, 7) ? CLEAR_LINE : ASSERT_LINE);
@@ -517,7 +517,7 @@ static WRITE8_HANDLER( audio_2_command_w )
static READ8_HANDLER( nyny_pia_1_2_r )
{
- nyny_state *state = space->machine->driver_data<nyny_state>();
+ nyny_state *state = space->machine().driver_data<nyny_state>();
UINT8 ret = 0;
/* the address bits are directly connected to the chip selects */
@@ -530,7 +530,7 @@ static READ8_HANDLER( nyny_pia_1_2_r )
static WRITE8_HANDLER( nyny_pia_1_2_w )
{
- nyny_state *state = space->machine->driver_data<nyny_state>();
+ nyny_state *state = space->machine().driver_data<nyny_state>();
/* the address bits are directly connected to the chip selects */
if (BIT(offset, 2)) pia6821_w(state->pia1, offset & 0x03, data);
@@ -680,15 +680,15 @@ INPUT_PORTS_END
static MACHINE_START( nyny )
{
- nyny_state *state = machine->driver_data<nyny_state>();
+ nyny_state *state = machine.driver_data<nyny_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->audiocpu2 = machine->device("audio2");
- state->ic48_1 = machine->device("ic48_1");
- state->mc6845 = machine->device("crtc");
- state->pia1 = machine->device("pia1");
- state->pia2 = machine->device("pia2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->audiocpu2 = machine.device("audio2");
+ state->ic48_1 = machine.device("ic48_1");
+ state->mc6845 = machine.device("crtc");
+ state->pia1 = machine.device("pia1");
+ state->pia2 = machine.device("pia2");
/* setup for save states */
state->save_item(NAME(state->flipscreen));
@@ -699,7 +699,7 @@ static MACHINE_START( nyny )
static MACHINE_RESET( nyny )
{
- nyny_state *state = machine->driver_data<nyny_state>();
+ nyny_state *state = machine.driver_data<nyny_state>();
state->flipscreen = 0;
state->star_enable = 0;
diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c
index 04ab300ed36..f1bafabf202 100644
--- a/src/mame/drivers/offtwall.c
+++ b/src/mame/drivers/offtwall.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -53,11 +53,11 @@ static MACHINE_START( offtwall )
static MACHINE_RESET( offtwall )
{
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 1);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 1);
atarijsa_reset();
}
@@ -71,13 +71,13 @@ static MACHINE_RESET( offtwall )
static READ16_HANDLER( offtwall_atarivc_r )
{
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( offtwall_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
@@ -90,8 +90,8 @@ static WRITE16_HANDLER( offtwall_atarivc_w )
static READ16_HANDLER( special_port3_r )
{
- offtwall_state *state = space->machine->driver_data<offtwall_state>();
- int result = input_port_read(space->machine, "260010");
+ offtwall_state *state = space->machine().driver_data<offtwall_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->cpu_to_sound_ready) result ^= 0x0020;
return result;
}
@@ -103,7 +103,7 @@ static WRITE16_HANDLER( io_latch_w )
if (ACCESSING_BITS_0_7)
{
/* bit 4 resets the sound CPU */
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (!(data & 0x10)) atarijsa_reset();
}
@@ -150,7 +150,7 @@ static WRITE16_HANDLER( io_latch_w )
static READ16_HANDLER( bankswitch_r )
{
- offtwall_state *state = space->machine->driver_data<offtwall_state>();
+ offtwall_state *state = space->machine().driver_data<offtwall_state>();
/* this is the table lookup; the bank is determined by the address that was requested */
state->bank_offset = (offset & 3) * 0x1000;
@@ -162,7 +162,7 @@ static READ16_HANDLER( bankswitch_r )
static READ16_HANDLER( bankrom_r )
{
- offtwall_state *state = space->machine->driver_data<offtwall_state>();
+ offtwall_state *state = space->machine().driver_data<offtwall_state>();
/* this is the banked ROM read */
logerror("%06X: %04X\n", cpu_get_previouspc(space->cpu), offset);
@@ -204,7 +204,7 @@ static READ16_HANDLER( bankrom_r )
static READ16_HANDLER( spritecache_count_r )
{
- offtwall_state *state = space->machine->driver_data<offtwall_state>();
+ offtwall_state *state = space->machine().driver_data<offtwall_state>();
int prevpc = cpu_get_previouspc(space->cpu);
/* if this read is coming from $99f8 or $9992, it's in the sprite copy loop */
@@ -259,7 +259,7 @@ static READ16_HANDLER( spritecache_count_r )
static READ16_HANDLER( unknown_verify_r )
{
- offtwall_state *state = space->machine->driver_data<offtwall_state>();
+ offtwall_state *state = space->machine().driver_data<offtwall_state>();
int prevpc = cpu_get_previouspc(space->cpu);
if (prevpc < 0x5c5e || prevpc > 0xc432)
return state->unknown_verify_base[offset];
@@ -492,27 +492,27 @@ ROM_END
static DRIVER_INIT( offtwall )
{
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
atarijsa_init(machine, "260010", 0x0040);
/* install son-of-slapstic workarounds */
- state->spritecache_count = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r));
- state->bankswitch_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037ec2, 0x037f39, FUNC(bankswitch_r));
- state->unknown_verify_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf1e, 0x3fdf1f, FUNC(unknown_verify_r));
+ state->spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r));
+ state->bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037ec2, 0x037f39, FUNC(bankswitch_r));
+ state->unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf1e, 0x3fdf1f, FUNC(unknown_verify_r));
}
static DRIVER_INIT( offtwalc )
{
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
atarijsa_init(machine, "260010", 0x0040);
/* install son-of-slapstic workarounds */
- state->spritecache_count = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r));
- state->bankswitch_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037eca, 0x037f43, FUNC(bankswitch_r));
- state->unknown_verify_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf24, 0x3fdf25, FUNC(unknown_verify_r));
+ state->spritecache_count = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fde42, 0x3fde43, FUNC(spritecache_count_r));
+ state->bankswitch_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x037eca, 0x037f43, FUNC(bankswitch_r));
+ state->unknown_verify_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3fdf24, 0x3fdf25, FUNC(unknown_verify_r));
}
diff --git a/src/mame/drivers/ohmygod.c b/src/mame/drivers/ohmygod.c
index 65629cb4fec..1b5f635fe41 100644
--- a/src/mame/drivers/ohmygod.c
+++ b/src/mame/drivers/ohmygod.c
@@ -19,11 +19,11 @@ Notes:
static WRITE16_HANDLER( ohmygod_ctrl_w )
{
- ohmygod_state *state = space->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = space->machine().driver_data<ohmygod_state>();
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
/* ADPCM bank switch */
if (state->sndbank != ((data >> state->adpcm_bank_shift) & 0x0f))
@@ -34,8 +34,8 @@ static WRITE16_HANDLER( ohmygod_ctrl_w )
}
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x1000);
- coin_counter_w(space->machine, 1, data & 0x2000);
+ coin_counter_w(space->machine(), 0, data & 0x1000);
+ coin_counter_w(space->machine(), 1, data & 0x2000);
}
}
@@ -296,7 +296,7 @@ GFXDECODE_END
static MACHINE_START( ohmygod )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
state->save_item(NAME(state->spritebank));
state->save_item(NAME(state->scrollx));
@@ -306,8 +306,8 @@ static MACHINE_START( ohmygod )
static MACHINE_RESET( ohmygod )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
- UINT8 *rom = machine->region("oki")->base();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
+ UINT8 *rom = machine.region("oki")->base();
state->sndbank = 0;
memcpy(rom + 0x20000, rom + 0x40000 + 0x20000 * state->sndbank, 0x20000);
@@ -393,13 +393,13 @@ ROM_END
static DRIVER_INIT( ohmygod )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
state->adpcm_bank_shift = 4;
}
static DRIVER_INIT( naname )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
state->adpcm_bank_shift = 0;
}
diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c
index 2214f94f535..ab6e8b45526 100644
--- a/src/mame/drivers/ojankohs.c
+++ b/src/mame/drivers/ojankohs.c
@@ -41,14 +41,14 @@ Memo:
static WRITE8_HANDLER( ojankohs_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x3f);
+ memory_set_bank(space->machine(), "bank1", data & 0x3f);
}
static WRITE8_HANDLER( ojankoy_rombank_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
state->adpcm_reset = BIT(data, 5);
if (!state->adpcm_reset)
@@ -59,7 +59,7 @@ static WRITE8_HANDLER( ojankoy_rombank_w )
static WRITE8_DEVICE_HANDLER( ojankohs_adpcm_reset_w )
{
- ojankohs_state *state = device->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = device->machine().driver_data<ojankohs_state>();
state->adpcm_reset = BIT(data, 0);
state->vclk_left = 0;
@@ -68,14 +68,14 @@ static WRITE8_DEVICE_HANDLER( ojankohs_adpcm_reset_w )
static WRITE8_HANDLER( ojankohs_msm5205_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
state->adpcm_data = data;
state->vclk_left = 2;
}
static void ojankohs_adpcm_int( device_t *device )
{
- ojankohs_state *state = device->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = device->machine().driver_data<ojankohs_state>();
/* skip if we're reset */
if (!state->adpcm_reset)
@@ -96,9 +96,9 @@ static void ojankohs_adpcm_int( device_t *device )
static WRITE8_HANDLER( ojankoc_ctrl_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
state->adpcm_reset = BIT(data, 4);
msm5205_reset_w(state->msm, !BIT(data, 4));
@@ -107,29 +107,29 @@ static WRITE8_HANDLER( ojankoc_ctrl_w )
static WRITE8_HANDLER( ojankohs_portselect_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
state->portselect = data;
}
static READ8_HANDLER( ojankohs_keymatrix_r )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int ret;
switch (state->portselect)
{
- case 0x01: ret = input_port_read(space->machine, "KEY0"); break;
- case 0x02: ret = input_port_read(space->machine, "KEY1"); break;
- case 0x04: ret = input_port_read(space->machine, "KEY2"); break;
- case 0x08: ret = input_port_read(space->machine, "KEY3"); break;
- case 0x10: ret = input_port_read(space->machine, "KEY4"); break;
+ case 0x01: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 0x02: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 0x04: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 0x08: ret = input_port_read(space->machine(), "KEY3"); break;
+ case 0x10: ret = input_port_read(space->machine(), "KEY4"); break;
case 0x20: ret = 0xff; break;
case 0x3f: ret = 0xff;
- ret &= input_port_read(space->machine, "KEY0");
- ret &= input_port_read(space->machine, "KEY1");
- ret &= input_port_read(space->machine, "KEY2");
- ret &= input_port_read(space->machine, "KEY3");
- ret &= input_port_read(space->machine, "KEY4");
+ ret &= input_port_read(space->machine(), "KEY0");
+ ret &= input_port_read(space->machine(), "KEY1");
+ ret &= input_port_read(space->machine(), "KEY2");
+ ret &= input_port_read(space->machine(), "KEY3");
+ ret &= input_port_read(space->machine(), "KEY4");
break;
default: ret = 0xff;
logerror("PC:%04X unknown %02X\n", cpu_get_pc(space->cpu), state->portselect);
@@ -141,7 +141,7 @@ static READ8_HANDLER( ojankohs_keymatrix_r )
static READ8_HANDLER( ojankoc_keymatrix_r )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int i;
int ret = 0;
static const char *const keynames[2][5] =
@@ -153,48 +153,48 @@ static READ8_HANDLER( ojankoc_keymatrix_r )
for (i = 0; i < 5; i++)
{
if (!BIT(state->portselect, i))
- ret |= input_port_read(space->machine, keynames[offset][i]);
+ ret |= input_port_read(space->machine(), keynames[offset][i]);
}
- return (ret & 0x3f) | (input_port_read(space->machine, offset ? "IN1" : "IN0") & 0xc0);
+ return (ret & 0x3f) | (input_port_read(space->machine(), offset ? "IN1" : "IN0") & 0xc0);
}
static READ8_DEVICE_HANDLER( ojankohs_ay8910_0_r )
{
// DIPSW 1
- return (((input_port_read(device->machine, "DSW1") & 0x01) << 7) | ((input_port_read(device->machine, "DSW1") & 0x02) << 5) |
- ((input_port_read(device->machine, "DSW1") & 0x04) << 3) | ((input_port_read(device->machine, "DSW1") & 0x08) << 1) |
- ((input_port_read(device->machine, "DSW1") & 0x10) >> 1) | ((input_port_read(device->machine, "DSW1") & 0x20) >> 3) |
- ((input_port_read(device->machine, "DSW1") & 0x40) >> 5) | ((input_port_read(device->machine, "DSW1") & 0x80) >> 7));
+ return (((input_port_read(device->machine(), "DSW1") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW1") & 0x02) << 5) |
+ ((input_port_read(device->machine(), "DSW1") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW1") & 0x08) << 1) |
+ ((input_port_read(device->machine(), "DSW1") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW1") & 0x20) >> 3) |
+ ((input_port_read(device->machine(), "DSW1") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW1") & 0x80) >> 7));
}
static READ8_DEVICE_HANDLER( ojankohs_ay8910_1_r )
{
// DIPSW 1
- return (((input_port_read(device->machine, "DSW2") & 0x01) << 7) | ((input_port_read(device->machine, "DSW2") & 0x02) << 5) |
- ((input_port_read(device->machine, "DSW2") & 0x04) << 3) | ((input_port_read(device->machine, "DSW2") & 0x08) << 1) |
- ((input_port_read(device->machine, "DSW2") & 0x10) >> 1) | ((input_port_read(device->machine, "DSW2") & 0x20) >> 3) |
- ((input_port_read(device->machine, "DSW2") & 0x40) >> 5) | ((input_port_read(device->machine, "DSW2") & 0x80) >> 7));
+ return (((input_port_read(device->machine(), "DSW2") & 0x01) << 7) | ((input_port_read(device->machine(), "DSW2") & 0x02) << 5) |
+ ((input_port_read(device->machine(), "DSW2") & 0x04) << 3) | ((input_port_read(device->machine(), "DSW2") & 0x08) << 1) |
+ ((input_port_read(device->machine(), "DSW2") & 0x10) >> 1) | ((input_port_read(device->machine(), "DSW2") & 0x20) >> 3) |
+ ((input_port_read(device->machine(), "DSW2") & 0x40) >> 5) | ((input_port_read(device->machine(), "DSW2") & 0x80) >> 7));
}
static READ8_HANDLER( ccasino_dipsw3_r )
{
- return (input_port_read(space->machine, "DSW3") ^ 0xff); // DIPSW 3
+ return (input_port_read(space->machine(), "DSW3") ^ 0xff); // DIPSW 3
}
static READ8_HANDLER( ccasino_dipsw4_r )
{
- return (input_port_read(space->machine, "DSW4") ^ 0xff); // DIPSW 4
+ return (input_port_read(space->machine(), "DSW4") ^ 0xff); // DIPSW 4
}
static WRITE8_HANDLER( ojankoy_coinctr_w )
{
- coin_counter_w(space->machine, 0, BIT(data, 0));
+ coin_counter_w(space->machine(), 0, BIT(data, 0));
}
static WRITE8_HANDLER( ccasino_coinctr_w )
{
- coin_counter_w(space->machine, 0, BIT(data, 1));
+ coin_counter_w(space->machine(), 0, BIT(data, 1));
}
@@ -795,10 +795,10 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( common )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
- state->maincpu = machine->device("maincpu");
- state->msm = machine->device("msm");
+ state->maincpu = machine.device("maincpu");
+ state->msm = machine.device("msm");
state->save_item(NAME(state->gfxreg));
state->save_item(NAME(state->flipscreen));
@@ -814,7 +814,7 @@ static MACHINE_START( common )
static MACHINE_START( ojankohs )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x40, &ROM[0x10000], 0x4000);
@@ -823,7 +823,7 @@ static MACHINE_START( ojankohs )
static MACHINE_START( ojankoy )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x10000], 0x4000);
@@ -832,7 +832,7 @@ static MACHINE_START( ojankoy )
static MACHINE_START( ojankoc )
{
- UINT8 *ROM = machine->region("user1")->base();
+ UINT8 *ROM = machine.region("user1")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x0000], 0x8000);
@@ -841,7 +841,7 @@ static MACHINE_START( ojankoc )
static MACHINE_RESET( ojankohs )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
state->portselect = 0;
diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c
index 3d15559eae8..247fcea1a04 100644
--- a/src/mame/drivers/olibochu.c
+++ b/src/mame/drivers/olibochu.c
@@ -84,7 +84,7 @@ static PALETTE_INIT( olibochu )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen;
int bit0, bit1, bit2, r, g, b;
@@ -119,24 +119,24 @@ static PALETTE_INIT( olibochu )
static WRITE8_HANDLER( olibochu_videoram_w )
{
- olibochu_state *state = space->machine->driver_data<olibochu_state>();
+ olibochu_state *state = space->machine().driver_data<olibochu_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( olibochu_colorram_w )
{
- olibochu_state *state = space->machine->driver_data<olibochu_state>();
+ olibochu_state *state = space->machine().driver_data<olibochu_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( olibochu_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* other bits are used, but unknown */
@@ -144,7 +144,7 @@ static WRITE8_HANDLER( olibochu_flipscreen_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- olibochu_state *state = machine->driver_data<olibochu_state>();
+ olibochu_state *state = machine.driver_data<olibochu_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x20) << 3);
int color = (attr & 0x1f) + 0x20;
@@ -155,13 +155,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( olibochu )
{
- olibochu_state *state = machine->driver_data<olibochu_state>();
+ olibochu_state *state = machine.driver_data<olibochu_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- olibochu_state *state = machine->driver_data<olibochu_state>();
+ olibochu_state *state = machine.driver_data<olibochu_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -186,7 +186,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -212,7 +212,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -221,16 +221,16 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( olibochu )
{
- olibochu_state *state = screen->machine->driver_data<olibochu_state>();
+ olibochu_state *state = screen->machine().driver_data<olibochu_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE8_HANDLER( sound_command_w )
{
- olibochu_state *state = space->machine->driver_data<olibochu_state>();
+ olibochu_state *state = space->machine().driver_data<olibochu_state>();
int c;
if (offset == 0)
@@ -424,14 +424,14 @@ static INTERRUPT_GEN( olibochu_interrupt )
static MACHINE_START( olibochu )
{
- olibochu_state *state = machine->driver_data<olibochu_state>();
+ olibochu_state *state = machine.driver_data<olibochu_state>();
state->save_item(NAME(state->cmd));
}
static MACHINE_RESET( olibochu )
{
- olibochu_state *state = machine->driver_data<olibochu_state>();
+ olibochu_state *state = machine.driver_data<olibochu_state>();
state->cmd = 0;
}
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 481479896c3..5d00d1ee073 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -240,7 +240,7 @@ public:
static MACHINE_RESET( omegrace )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Omega Race expects the vector processor to be ready. */
avgdvg_reset_w(space, 0, 0);
}
@@ -293,7 +293,7 @@ static const UINT8 spinnerTable[64] =
static READ8_HANDLER( omegrace_spinner1_r )
{
- return (spinnerTable[input_port_read(space->machine, "SPIN0") & 0x3f]);
+ return (spinnerTable[input_port_read(space->machine(), "SPIN0") & 0x3f]);
}
@@ -307,14 +307,14 @@ static READ8_HANDLER( omegrace_spinner1_r )
static WRITE8_HANDLER( omegrace_leds_w )
{
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bits 2 to 5 are the start leds (4 and 5 cocktail only) */
- set_led_status(space->machine, 0,~data & 0x04);
- set_led_status(space->machine, 1,~data & 0x08);
- set_led_status(space->machine, 2,~data & 0x10);
- set_led_status(space->machine, 3,~data & 0x20);
+ set_led_status(space->machine(), 0,~data & 0x04);
+ set_led_status(space->machine(), 1,~data & 0x08);
+ set_led_status(space->machine(), 2,~data & 0x10);
+ set_led_status(space->machine(), 3,~data & 0x20);
/* bit 6 flips screen (not supported) */
}
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( omegrace_leds_w )
static WRITE8_HANDLER( omegrace_soundlatch_w )
{
soundlatch_w (space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -585,8 +585,8 @@ ROM_END
static DRIVER_INIT( omegrace )
{
- int i, len = machine->region("user1")->bytes();
- UINT8 *prom = machine->region("user1")->base();
+ int i, len = machine.region("user1")->bytes();
+ UINT8 *prom = machine.region("user1")->base();
/* Omega Race has two pairs of the state PROM output
* lines swapped before going into the decoder.
diff --git a/src/mame/drivers/oneshot.c b/src/mame/drivers/oneshot.c
index 75edfb5e848..a5e49a05ecb 100644
--- a/src/mame/drivers/oneshot.c
+++ b/src/mame/drivers/oneshot.c
@@ -38,8 +38,8 @@ TO DO :
static READ16_HANDLER( oneshot_in0_word_r )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
- int data = input_port_read(space->machine, "DSW1");
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
+ int data = input_port_read(space->machine(), "DSW1");
switch (data & 0x0c)
{
@@ -62,7 +62,7 @@ static READ16_HANDLER( oneshot_in0_word_r )
static READ16_HANDLER( oneshot_gun_x_p1_r )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
/* shots must be in a different location to register */
state->p1_wobble ^= 1;
@@ -72,13 +72,13 @@ static READ16_HANDLER( oneshot_gun_x_p1_r )
static READ16_HANDLER( oneshot_gun_y_p1_r )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
return state->gun_y_p1;
}
static READ16_HANDLER( oneshot_gun_x_p2_r )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
/* shots must be in a different location to register */
state->p2_wobble ^= 1;
@@ -88,7 +88,7 @@ static READ16_HANDLER( oneshot_gun_x_p2_r )
static READ16_HANDLER( oneshot_gun_y_p2_r )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
return state->gun_y_p2;
}
@@ -332,7 +332,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- oneshot_state *state = device->machine->driver_data<oneshot_state>();
+ oneshot_state *state = device->machine().driver_data<oneshot_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -343,10 +343,10 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( oneshot )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->gun_x_p1));
state->save_item(NAME(state->gun_y_p1));
@@ -359,7 +359,7 @@ static MACHINE_START( oneshot )
static MACHINE_RESET( oneshot )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
state->gun_x_p1 = 0;
state->gun_y_p1 = 0;
diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c
index 7b6b882797c..2e6dd4305b6 100644
--- a/src/mame/drivers/onetwo.c
+++ b/src/mame/drivers/onetwo.c
@@ -75,7 +75,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
- onetwo_state *state = machine->driver_data<onetwo_state>();
+ onetwo_state *state = machine.driver_data<onetwo_state>();
int code = (state->fgram[tile_index * 2 + 1] << 8) | state->fgram[tile_index * 2];
int color = (state->fgram[tile_index * 2 + 1] & 0x80) >> 7;
@@ -86,13 +86,13 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( onetwo )
{
- onetwo_state *state = machine->driver_data<onetwo_state>();
+ onetwo_state *state = machine.driver_data<onetwo_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static SCREEN_UPDATE( onetwo )
{
- onetwo_state *state = screen->machine->driver_data<onetwo_state>();
+ onetwo_state *state = screen->machine().driver_data<onetwo_state>();
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -105,33 +105,33 @@ static SCREEN_UPDATE( onetwo )
static WRITE8_HANDLER( onetwo_fgram_w )
{
- onetwo_state *state = space->machine->driver_data<onetwo_state>();
+ onetwo_state *state = space->machine().driver_data<onetwo_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
static WRITE8_HANDLER( onetwo_cpubank_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
static WRITE8_HANDLER( onetwo_coin_counters_w )
{
- watchdog_reset(space->machine);
- coin_counter_w(space->machine, 0, BIT(data, 1));
- coin_counter_w(space->machine, 1, BIT(data, 2));
+ watchdog_reset(space->machine());
+ coin_counter_w(space->machine(), 0, BIT(data, 1));
+ coin_counter_w(space->machine(), 1, BIT(data, 2));
}
static WRITE8_HANDLER( onetwo_soundlatch_w )
{
- onetwo_state *state = space->machine->driver_data<onetwo_state>();
+ onetwo_state *state = space->machine().driver_data<onetwo_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
-static void set_color(running_machine *machine, int offset)
+static void set_color(running_machine &machine, int offset)
{
- onetwo_state *state = machine->driver_data<onetwo_state>();
+ onetwo_state *state = machine.driver_data<onetwo_state>();
int r, g, b;
r = state->paletteram[offset] & 0x1f;
@@ -142,16 +142,16 @@ static void set_color(running_machine *machine, int offset)
static WRITE8_HANDLER(palette1_w)
{
- onetwo_state *state = space->machine->driver_data<onetwo_state>();
+ onetwo_state *state = space->machine().driver_data<onetwo_state>();
state->paletteram[offset] = data;
- set_color(space->machine, offset);
+ set_color(space->machine(), offset);
}
static WRITE8_HANDLER(palette2_w)
{
- onetwo_state *state = space->machine->driver_data<onetwo_state>();
+ onetwo_state *state = space->machine().driver_data<onetwo_state>();
state->paletteram2[offset] = data;
- set_color(space->machine, offset);
+ set_color(space->machine(), offset);
}
/*************************************
@@ -325,7 +325,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- onetwo_state *state = device->machine->driver_data<onetwo_state>();
+ onetwo_state *state = device->machine().driver_data<onetwo_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -342,13 +342,13 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( onetwo )
{
- onetwo_state *state = machine->driver_data<onetwo_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ onetwo_state *state = machine.driver_data<onetwo_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( onetwo, onetwo_state )
diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c
index fdd7345c3ef..1c6c57d0138 100644
--- a/src/mame/drivers/opwolf.c
+++ b/src/mame/drivers/opwolf.c
@@ -286,13 +286,13 @@ register. So what is controlling priority.
static READ16_HANDLER( cchip_r )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
return state->cchip_ram[offset];
}
static WRITE16_HANDLER( cchip_w )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
state->cchip_ram[offset] = data &0xff;
}
@@ -306,27 +306,27 @@ static WRITE16_HANDLER( cchip_w )
static READ16_HANDLER( opwolf_in_r )
{
static const char *const inname[2] = { "IN0", "IN1" };
- return input_port_read(space->machine, inname[offset]);
+ return input_port_read(space->machine(), inname[offset]);
}
static READ16_HANDLER( opwolf_dsw_r )
{
static const char *const dswname[2] = { "DSWA", "DSWB" };
- return input_port_read(space->machine, dswname[offset]);
+ return input_port_read(space->machine(), dswname[offset]);
}
static READ16_HANDLER( opwolf_lightgun_r )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
int scaled;
switch (offset)
{
case 0x00: /* P1X - Have to remap 8 bit input value, into 0-319 visible range */
- scaled = (input_port_read(space->machine, P1X_PORT_TAG) * 320 ) / 256;
+ scaled = (input_port_read(space->machine(), P1X_PORT_TAG) * 320 ) / 256;
return (scaled + 0x15 + state->opwolf_gun_xoffs);
case 0x01: /* P1Y */
- return (input_port_read(space->machine, P1Y_PORT_TAG) - 0x24 + state->opwolf_gun_yoffs);
+ return (input_port_read(space->machine(), P1Y_PORT_TAG) - 0x24 + state->opwolf_gun_yoffs);
}
return 0xff;
@@ -334,12 +334,12 @@ static READ16_HANDLER( opwolf_lightgun_r )
static READ8_HANDLER( z80_input1_r )
{
- return input_port_read(space->machine, "IN0"); /* irrelevant mirror ? */
+ return input_port_read(space->machine(), "IN0"); /* irrelevant mirror ? */
}
static READ8_HANDLER( z80_input2_r )
{
- return input_port_read(space->machine, "IN0"); /* needed for coins */
+ return input_port_read(space->machine(), "IN0"); /* needed for coins */
}
@@ -349,7 +349,7 @@ static READ8_HANDLER( z80_input2_r )
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(device->machine, "bank10", (data - 1) & 0x03);
+ memory_set_bank(device->machine(), "bank10", (data - 1) & 0x03);
}
/***********************************************************
@@ -431,14 +431,14 @@ ADDRESS_MAP_END
static MACHINE_START( opwolf )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->pc080sn = machine->device("pc080sn");
- state->pc090oj = machine->device("pc090oj");
- state->msm1 = machine->device("msm1");
- state->msm2 = machine->device("msm2");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->pc080sn = machine.device("pc080sn");
+ state->pc090oj = machine.device("pc090oj");
+ state->msm1 = machine.device("msm1");
+ state->msm2 = machine.device("msm2");
state->save_item(NAME(state->sprite_ctrl));
state->save_item(NAME(state->sprites_flipscreen));
@@ -451,7 +451,7 @@ static MACHINE_START( opwolf )
static MACHINE_RESET( opwolf )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
state->adpcm_b[0] = state->adpcm_b[1] = 0;
state->adpcm_c[0] = state->adpcm_c[1] = 0;
@@ -462,13 +462,13 @@ static MACHINE_RESET( opwolf )
state->sprite_ctrl = 0;
state->sprites_flipscreen = 0;
- msm5205_reset_w(machine->device("msm1"), 1);
- msm5205_reset_w(machine->device("msm2"), 1);
+ msm5205_reset_w(machine.device("msm1"), 1);
+ msm5205_reset_w(machine.device("msm2"), 1);
}
static void opwolf_msm5205_vck( device_t *device )
{
- opwolf_state *state = device->machine->driver_data<opwolf_state>();
+ opwolf_state *state = device->machine().driver_data<opwolf_state>();
int chip = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
if (state->adpcm_data[chip] != -1)
{
@@ -479,7 +479,7 @@ static void opwolf_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data[chip] = device->machine->region("adpcm")->base()[state->adpcm_pos[chip]];
+ state->adpcm_data[chip] = device->machine().region("adpcm")->base()[state->adpcm_pos[chip]];
state->adpcm_pos[chip] = (state->adpcm_pos[chip] + 1) & 0x7ffff;
msm5205_data_w(device, state->adpcm_data[chip] >> 4);
}
@@ -487,7 +487,7 @@ static void opwolf_msm5205_vck( device_t *device )
static WRITE8_DEVICE_HANDLER( opwolf_adpcm_b_w )
{
- opwolf_state *state = device->machine->driver_data<opwolf_state>();
+ opwolf_state *state = device->machine().driver_data<opwolf_state>();
int start;
int end;
@@ -510,7 +510,7 @@ static WRITE8_DEVICE_HANDLER( opwolf_adpcm_b_w )
static WRITE8_DEVICE_HANDLER( opwolf_adpcm_c_w )
{
- opwolf_state *state = device->machine->driver_data<opwolf_state>();
+ opwolf_state *state = device->machine().driver_data<opwolf_state>();
int start;
int end;
@@ -695,7 +695,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- opwolf_state *state = device->machine->driver_data<opwolf_state>();
+ opwolf_state *state = device->machine().driver_data<opwolf_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -983,8 +983,8 @@ ROM_END
static DRIVER_INIT( opwolf )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine->region("maincpu")->base();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
+ UINT16* rom = (UINT16*)machine.region("maincpu")->base();
state->opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -994,14 +994,14 @@ static DRIVER_INIT( opwolf )
state->opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff);
state->opwolf_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff);
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( opwolfb )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
- UINT16* rom = (UINT16*)machine->region("maincpu")->base();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
+ UINT16* rom = (UINT16*)machine.region("maincpu")->base();
state->opwolf_region = rom[0x03fffe / 2] & 0xff;
@@ -1009,7 +1009,7 @@ static DRIVER_INIT( opwolfb )
state->opwolf_gun_xoffs = -2;
state->opwolf_gun_yoffs = 17;
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/orbit.c b/src/mame/drivers/orbit.c
index ac0d5673446..46e5fdb2278 100644
--- a/src/mame/drivers/orbit.c
+++ b/src/mame/drivers/orbit.c
@@ -33,7 +33,7 @@ Atari Orbit Driver
static TIMER_DEVICE_CALLBACK( nmi_32v )
{
- orbit_state *state = timer.machine->driver_data<orbit_state>();
+ orbit_state *state = timer.machine().driver_data<orbit_state>();
int scanline = param;
int nmistate = (scanline & 32) && (state->misc_flags & 4);
device_set_input_line(state->maincpu, INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE);
@@ -42,7 +42,7 @@ static TIMER_DEVICE_CALLBACK( nmi_32v )
static TIMER_CALLBACK( irq_off )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -50,7 +50,7 @@ static TIMER_CALLBACK( irq_off )
static INTERRUPT_GEN( orbit_interrupt )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_vblank_end(), FUNC(irq_off));
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_vblank_end(), FUNC(irq_off));
}
@@ -61,9 +61,9 @@ static INTERRUPT_GEN( orbit_interrupt )
*
*************************************/
-static void update_misc_flags(running_machine *machine, UINT8 val)
+static void update_misc_flags(running_machine &machine, UINT8 val)
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
state->misc_flags = val;
@@ -88,13 +88,13 @@ static void update_misc_flags(running_machine *machine, UINT8 val)
static WRITE8_HANDLER( orbit_misc_w )
{
- orbit_state *state = space->machine->driver_data<orbit_state>();
+ orbit_state *state = space->machine().driver_data<orbit_state>();
UINT8 bit = offset >> 1;
if (offset & 1)
- update_misc_flags(space->machine, state->misc_flags | (1 << bit));
+ update_misc_flags(space->machine(), state->misc_flags | (1 << bit));
else
- update_misc_flags(space->machine, state->misc_flags & ~(1 << bit));
+ update_misc_flags(space->machine(), state->misc_flags & ~(1 << bit));
}
@@ -274,10 +274,10 @@ GFXDECODE_END
static MACHINE_START( orbit )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
- state->maincpu = machine->device("maincpu");
- state->discrete = machine->device("discrete");
+ state->maincpu = machine.device("maincpu");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->misc_flags));
state->save_item(NAME(state->flip_screen));
@@ -285,7 +285,7 @@ static MACHINE_START( orbit )
static MACHINE_RESET( orbit )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
update_misc_flags(machine, 0);
state->flip_screen = 0;
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index 52f25223eca..d9183034b05 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -78,12 +78,12 @@ public:
static MC6845_UPDATE_ROW( update_row )
{
- othello_state *state = device->machine->driver_data<othello_state>();
+ othello_state *state = device->machine().driver_data<othello_state>();
int cx, x;
UINT32 data_address;
UINT32 tmp;
- const UINT8 *gfx = device->machine->region("gfx")->base();
+ const UINT8 *gfx = device->machine().region("gfx")->base();
for(cx = 0; cx < x_count; ++cx)
{
@@ -101,7 +101,7 @@ static MC6845_UPDATE_ROW( update_row )
static PALETTE_INIT( othello )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
palette_set_color(machine, i, MAKE_RGB(0xff, 0x00, 0xff));
}
@@ -118,7 +118,7 @@ static PALETTE_INIT( othello )
static SCREEN_UPDATE( othello )
{
- othello_state *state = screen->machine->driver_data<othello_state>();
+ othello_state *state = screen->machine().driver_data<othello_state>();
mc6845_update(state->mc6845, bitmap, cliprect);
return 0;
@@ -134,18 +134,18 @@ ADDRESS_MAP_END
static READ8_HANDLER( unk_87_r )
{
/* n7751_status_r ? bit 7 = ack/status from device connected to port 8a? */
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( unk_8a_w )
{
/*
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
state->n7751_command = (data & 0x07);
device_set_input_line(state->n7751, 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
//device_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
*/
logerror("8a -> %x\n", data);
@@ -158,12 +158,12 @@ static WRITE8_HANDLER( unk_8c_w )
static READ8_HANDLER( unk_8c_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( sound_ack_r )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
return state->ack_data;
}
@@ -174,7 +174,7 @@ static WRITE8_HANDLER( unk_8f_w )
static WRITE8_HANDLER( tilebank_w )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
state->tile_bank = (data == 0x0f) ? 0x100 : 0x00;
logerror("tilebank -> %x\n", data);
}
@@ -203,19 +203,19 @@ static READ8_HANDLER( latch_r )
static WRITE8_HANDLER( ay_select_w )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
state->ay_select = data;
}
static WRITE8_HANDLER( ack_w )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
state->ack_data = data;
}
static WRITE8_HANDLER( ay_address_w )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
if (state->ay_select & 1) ay8910_address_w(state->ay1, 0, data);
if (state->ay_select & 2) ay8910_address_w(state->ay2, 0, data);
@@ -223,7 +223,7 @@ static WRITE8_HANDLER( ay_address_w )
static WRITE8_HANDLER( ay_data_w )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
if (state->ay_select & 1) ay8910_data_w(state->ay1, 0, data);
if (state->ay_select & 2) ay8910_data_w(state->ay2, 0, data);
@@ -245,7 +245,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
{
- othello_state *state = device->machine->driver_data<othello_state>();
+ othello_state *state = device->machine().driver_data<othello_state>();
/* P4 - address lines 0-3 */
/* P5 - address lines 4-7 */
@@ -280,19 +280,19 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
static READ8_HANDLER( n7751_rom_r )
{
- othello_state *state = space->machine->driver_data<othello_state>();
- return space->machine->region("n7751data")->base()[state->sound_addr];
+ othello_state *state = space->machine().driver_data<othello_state>();
+ return space->machine().region("n7751data")->base()[state->sound_addr];
}
static READ8_HANDLER( n7751_command_r )
{
- othello_state *state = space->machine->driver_data<othello_state>();
+ othello_state *state = space->machine().driver_data<othello_state>();
return 0x80 | ((state->n7751_command & 0x07) << 4);
}
static WRITE8_DEVICE_HANDLER( n7751_p2_w )
{
- othello_state *state = device->machine->driver_data<othello_state>();
+ othello_state *state = device->machine().driver_data<othello_state>();
/* write to P2; low 4 bits go to 8243 */
i8243_p2_w(device, offset, data & 0x0f);
@@ -380,13 +380,13 @@ static const mc6845_interface h46505_intf =
static MACHINE_START( othello )
{
- othello_state *state = machine->driver_data<othello_state>();
+ othello_state *state = machine.driver_data<othello_state>();
- state->maincpu = machine->device("maincpu");
- state->mc6845 = machine->device("crtc");
- state->n7751 = machine->device("n7751");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ state->maincpu = machine.device("maincpu");
+ state->mc6845 = machine.device("crtc");
+ state->n7751 = machine.device("n7751");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
state->save_item(NAME(state->tile_bank));
state->save_item(NAME(state->ay_select));
@@ -398,7 +398,7 @@ static MACHINE_START( othello )
static MACHINE_RESET( othello )
{
- othello_state *state = machine->driver_data<othello_state>();
+ othello_state *state = machine.driver_data<othello_state>();
state->tile_bank = 0;
state->ay_select = 0;
diff --git a/src/mame/drivers/othldrby.c b/src/mame/drivers/othldrby.c
index 575b61be1a0..6b3ec44c01c 100644
--- a/src/mame/drivers/othldrby.c
+++ b/src/mame/drivers/othldrby.c
@@ -22,13 +22,13 @@ Notes:
static READ16_HANDLER( pip )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
return state->toggle ^= 1;
}
static READ16_HANDLER( pap )
{
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -42,10 +42,10 @@ static WRITE16_HANDLER( coinctrl_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
- coin_lockout_w(space->machine, 0, ~data & 4);
- coin_lockout_w(space->machine, 1, ~data & 8);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
+ coin_lockout_w(space->machine(), 0, ~data & 4);
+ coin_lockout_w(space->machine(), 1, ~data & 8);
}
}
@@ -57,7 +57,7 @@ static READ16_HANDLER( calendar_r )
{
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
switch (offset)
{
@@ -218,7 +218,7 @@ GFXDECODE_END
static MACHINE_START( othldrby )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
state->save_item(NAME(state->toggle));
state->save_item(NAME(state->vram_addr));
@@ -228,7 +228,7 @@ static MACHINE_START( othldrby )
static MACHINE_RESET( othldrby )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
state->toggle = 0xff;
state->vram_addr = 0;
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index 47a667b5943..fab4aad99f3 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -249,16 +249,16 @@ TODO:
INTERRUPTS
***********************************************************/
-static void update_irq( running_machine *machine )
+static void update_irq( running_machine &machine )
{
- othunder_state *state = machine->driver_data<othunder_state>();
+ othunder_state *state = machine.driver_data<othunder_state>();
device_set_input_line(state->maincpu, 6, state->ad_irq ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->maincpu, 5, state->vblank_irq ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE16_HANDLER( irq_ack_w )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
switch (offset)
{
@@ -271,20 +271,20 @@ static WRITE16_HANDLER( irq_ack_w )
break;
}
- update_irq(space->machine);
+ update_irq(space->machine());
}
static INTERRUPT_GEN( vblank_interrupt )
{
- othunder_state *state = device->machine->driver_data<othunder_state>();
+ othunder_state *state = device->machine().driver_data<othunder_state>();
state->vblank_irq = 1;
- update_irq(device->machine);
+ update_irq(device->machine());
}
static TIMER_CALLBACK( ad_interrupt )
{
- othunder_state *state = machine->driver_data<othunder_state>();
+ othunder_state *state = machine.driver_data<othunder_state>();
state->ad_irq = 1;
update_irq(machine);
@@ -312,7 +312,7 @@ static const eeprom_interface eeprom_intf =
static WRITE16_HANDLER( othunder_tc0220ioc_w )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
if (ACCESSING_BITS_0_7)
{
@@ -354,7 +354,7 @@ static WRITE16_HANDLER( othunder_tc0220ioc_w )
static READ16_HANDLER( othunder_tc0220ioc_r )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
switch (offset)
{
@@ -375,7 +375,7 @@ static READ16_HANDLER( othunder_tc0220ioc_r )
static READ16_HANDLER( othunder_lightgun_r )
{
static const char *const portname[4] = { P1X_PORT_TAG, P1Y_PORT_TAG, P2X_PORT_TAG, P2Y_PORT_TAG };
- return input_port_read(space->machine, portname[offset]);
+ return input_port_read(space->machine(), portname[offset]);
}
static WRITE16_HANDLER( othunder_lightgun_w )
@@ -385,7 +385,7 @@ static WRITE16_HANDLER( othunder_lightgun_w )
The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock
cycles, so would end in a maximum of 15.625us. We'll use 10. */
- space->machine->scheduler().timer_set(attotime::from_usec(10), FUNC(ad_interrupt));
+ space->machine().scheduler().timer_set(attotime::from_usec(10), FUNC(ad_interrupt));
}
@@ -393,23 +393,23 @@ static WRITE16_HANDLER( othunder_lightgun_w )
SOUND
*****************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- othunder_state *state = machine->driver_data<othunder_state>();
+ othunder_state *state = machine.driver_data<othunder_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static WRITE16_HANDLER( othunder_sound_w )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, data & 0xff);
else if (offset == 1)
@@ -418,7 +418,7 @@ static WRITE16_HANDLER( othunder_sound_w )
static READ16_HANDLER( othunder_sound_r )
{
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
else
@@ -429,7 +429,7 @@ static WRITE8_HANDLER( othunder_TC0310FAM_w )
{
/* there are two TC0310FAM, one for CH1 and one for CH2 from the YM2610. The
PSG output is routed to both chips. */
- othunder_state *state = space->machine->driver_data<othunder_state>();
+ othunder_state *state = space->machine().driver_data<othunder_state>();
int voll, volr;
state->pan[offset] = data & 0x1f;
@@ -636,7 +636,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- othunder_state *state = device->machine->driver_data<othunder_state>();
+ othunder_state *state = device->machine().driver_data<othunder_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -684,34 +684,34 @@ static STATE_POSTLOAD( othunder_postload )
static MACHINE_START( othunder )
{
- othunder_state *state = machine->driver_data<othunder_state>();
-
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0xc000, 0x4000);
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->eeprom = machine->device("eeprom");
- state->tc0220ioc = machine->device("tc0220ioc");
- state->tc0100scn = machine->device("tc0100scn");
- state->tc0110pcr = machine->device("tc0110pcr");
- state->tc0140syt = machine->device("tc0140syt");
- state->_2610_0l = machine->device("2610.0l");
- state->_2610_0r = machine->device("2610.0r");
- state->_2610_1l = machine->device("2610.1l");
- state->_2610_1r = machine->device("2610.1r");
- state->_2610_2l = machine->device("2610.2l");
- state->_2610_2r = machine->device("2610.2r");
+ othunder_state *state = machine.driver_data<othunder_state>();
+
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->eeprom = machine.device("eeprom");
+ state->tc0220ioc = machine.device("tc0220ioc");
+ state->tc0100scn = machine.device("tc0100scn");
+ state->tc0110pcr = machine.device("tc0110pcr");
+ state->tc0140syt = machine.device("tc0140syt");
+ state->_2610_0l = machine.device("2610.0l");
+ state->_2610_0r = machine.device("2610.0r");
+ state->_2610_1l = machine.device("2610.1l");
+ state->_2610_1r = machine.device("2610.1r");
+ state->_2610_2l = machine.device("2610.2l");
+ state->_2610_2r = machine.device("2610.2r");
state->save_item(NAME(state->vblank_irq));
state->save_item(NAME(state->ad_irq));
state->save_item(NAME(state->banknum));
state->save_item(NAME(state->pan));
- machine->state().register_postload(othunder_postload, NULL);
+ machine.state().register_postload(othunder_postload, NULL);
}
static MACHINE_RESET( othunder )
{
- othunder_state *state = machine->driver_data<othunder_state>();
+ othunder_state *state = machine.driver_data<othunder_state>();
state->vblank_irq = 0;
state->ad_irq = 0;
diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c
index cf3da7892c5..0b835424880 100644
--- a/src/mame/drivers/overdriv.c
+++ b/src/mame/drivers/overdriv.c
@@ -68,7 +68,7 @@ static WRITE16_HANDLER( eeprom_w )
/* bit 0 is data */
/* bit 1 is clock (active high) */
/* bit 2 is cs (active low) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -83,7 +83,7 @@ static INTERRUPT_GEN( cpuA_interrupt )
static INTERRUPT_GEN( cpuB_interrupt )
{
- overdriv_state *state = device->machine->driver_data<overdriv_state>();
+ overdriv_state *state = device->machine().driver_data<overdriv_state>();
if (k053246_is_irq_enabled(state->k053246))
device_set_input_line(device, 4, HOLD_LINE);
@@ -92,7 +92,7 @@ static INTERRUPT_GEN( cpuB_interrupt )
static WRITE16_HANDLER( cpuA_ctrl_w )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
if (ACCESSING_BITS_0_7)
{
@@ -101,9 +101,9 @@ static WRITE16_HANDLER( cpuA_ctrl_w )
/* bit 1 is clear during service mode - function unknown */
- set_led_status(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
//logerror("%06x: write %04x to cpuA_ctrl_w\n",cpu_get_pc(space->cpu),data);
}
@@ -111,13 +111,13 @@ static WRITE16_HANDLER( cpuA_ctrl_w )
static READ16_HANDLER( cpuB_ctrl_r )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
return state->cpuB_ctrl;
}
static WRITE16_HANDLER( cpuB_ctrl_w )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
COMBINE_DATA(&state->cpuB_ctrl);
if (ACCESSING_BITS_0_7)
@@ -139,19 +139,19 @@ static READ8_DEVICE_HANDLER( overdriv_sound_r )
static WRITE16_HANDLER( overdriv_soundirq_w )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
}
static WRITE16_HANDLER( overdriv_cpuB_irq5_w )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
device_set_input_line(state->subcpu, 5, HOLD_LINE);
}
static WRITE16_HANDLER( overdriv_cpuB_irq6_w )
{
- overdriv_state *state = space->machine->driver_data<overdriv_state>();
+ overdriv_state *state = space->machine().driver_data<overdriv_state>();
device_set_input_line(state->subcpu, 6, HOLD_LINE);
}
@@ -296,17 +296,17 @@ static const k051316_interface overdriv_k051316_intf_2 =
static MACHINE_START( overdriv )
{
- overdriv_state *state = machine->driver_data<overdriv_state>();
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->k051316_1 = machine->device("k051316_1");
- state->k051316_2 = machine->device("k051316_2");
- state->k053260_1 = machine->device("k053260_1");
- state->k053260_2 = machine->device("k053260_2");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ overdriv_state *state = machine.driver_data<overdriv_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->k051316_1 = machine.device("k051316_1");
+ state->k051316_2 = machine.device("k051316_2");
+ state->k053260_1 = machine.device("k053260_1");
+ state->k053260_2 = machine.device("k053260_2");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->cpuB_ctrl));
state->save_item(NAME(state->sprite_colorbase));
@@ -316,7 +316,7 @@ static MACHINE_START( overdriv )
static MACHINE_RESET( overdriv )
{
- overdriv_state *state = machine->driver_data<overdriv_state>();
+ overdriv_state *state = machine.driver_data<overdriv_state>();
state->cpuB_ctrl = 0;
state->sprite_colorbase = 0;
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c
index 9b1662cd5c8..ca8ed6788fc 100644
--- a/src/mame/drivers/pachifev.c
+++ b/src/mame/drivers/pachifev.c
@@ -109,7 +109,7 @@ static WRITE8_HANDLER(controls_w)
{
if(!data)
{
- pachifev_state *state = space->machine->driver_data<pachifev_state>();
+ pachifev_state *state = space->machine().driver_data<pachifev_state>();
/*end of input read*/
state->power=0;
@@ -124,7 +124,7 @@ static WRITE8_HANDLER(controls_w)
static READ8_HANDLER(controls_r)
{
- pachifev_state *state = space->machine->driver_data<pachifev_state>();
+ pachifev_state *state = space->machine().driver_data<pachifev_state>();
int output_bit=(state->power < state->max_power)?0:1;
++state->power;
return output_bit;
@@ -250,7 +250,7 @@ INPUT_PORTS_END
static void pf_adpcm_int(device_t *device)
{
- pachifev_state *state = device->machine->driver_data<pachifev_state>();
+ pachifev_state *state = device->machine().driver_data<pachifev_state>();
if (state->adpcm_pos >= 0x4000 || state->adpcm_idle)
{
@@ -260,7 +260,7 @@ static void pf_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0)>>4) );
msm5205_data_w(device,state->adpcm_data & 0xf);
@@ -284,7 +284,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_RESET( pachifev )
{
- pachifev_state *state = machine->driver_data<pachifev_state>();
+ pachifev_state *state = machine.driver_data<pachifev_state>();
state->power=0;
state->max_power=0;
@@ -300,11 +300,11 @@ static MACHINE_RESET( pachifev )
static INTERRUPT_GEN( pachifev_vblank_irq )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
{
static const char *const inname[2] = { "PLUNGER_P1", "PLUNGER_P2" };
- pachifev_state *state = device->machine->driver_data<pachifev_state>();
+ pachifev_state *state = device->machine().driver_data<pachifev_state>();
/* I wish I had found a better way to handle cocktail inputs, but I can't find a way to access internal RAM */
/* (bit 5 of 0xf0aa : 0 = player 1 and 1 = player 2 - bit 6 of 0xf0aa : 0 = upright and 1 = cocktail). */
@@ -312,10 +312,10 @@ static INTERRUPT_GEN( pachifev_vblank_irq )
address_space *ramspace = device->memory().space(AS_PROGRAM);
UINT8 player = 0;
- if ((ramspace->read_byte(0xe00f) == 0x01) && ((input_port_read(device->machine, "DSW1") & 0x08) == 0x00))
+ if ((ramspace->read_byte(0xe00f) == 0x01) && ((input_port_read(device->machine(), "DSW1") & 0x08) == 0x00))
player = 1;
- int current_power=input_port_read(device->machine, inname[player]) & 0x3f;
+ int current_power=input_port_read(device->machine(), inname[player]) & 0x3f;
if(current_power != state->previous_power)
{
popmessage ("%d%%", (current_power * 100) / 0x3f);
@@ -345,7 +345,7 @@ static MACHINE_START( pachifev)
/* configure VDP */
TMS9928A_configure(&tms9928a_interface);
{
- pachifev_state *state = machine->driver_data<pachifev_state>();
+ pachifev_state *state = machine.driver_data<pachifev_state>();
state->save_item(NAME(state->power));
state->save_item(NAME(state->max_power));
diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c
index 3ab12894706..d5ca8f9f1f8 100644
--- a/src/mame/drivers/pacland.c
+++ b/src/mame/drivers/pacland.c
@@ -181,15 +181,15 @@ Notes:
static WRITE8_HANDLER( pacland_subreset_w )
{
int bit = !BIT(offset,11);
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( pacland_flipscreen_w )
{
int bit = !BIT(offset,11);
- /* can't use flip_screen_set(space->machine, ) because the visible area is asymmetrical */
- flip_screen_set_no_update(space->machine, bit);
- tilemap_set_flip_all(space->machine,flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ /* can't use flip_screen_set(space->machine(), ) because the visible area is asymmetrical */
+ flip_screen_set_no_update(space->machine(), bit);
+ tilemap_set_flip_all(space->machine(),flip_screen_get(space->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
@@ -198,39 +198,39 @@ static READ8_HANDLER( pacland_input_r )
int shift = 4 * (offset & 1);
int port = offset & 2;
static const char *const portnames[] = { "DSWA", "DSWB", "IN0", "IN1" };
- int r = (input_port_read(space->machine, portnames[port]) << shift) & 0xf0;
- r |= (input_port_read(space->machine, portnames[port+1]) >> (4 - shift)) & 0x0f;
+ int r = (input_port_read(space->machine(), portnames[port]) << shift) & 0xf0;
+ r |= (input_port_read(space->machine(), portnames[port+1]) >> (4 - shift)) & 0x0f;
return r;
}
static WRITE8_HANDLER( pacland_coin_w )
{
- coin_lockout_global_w(space->machine, data & 1);
- coin_counter_w(space->machine, 0, ~data & 2);
- coin_counter_w(space->machine, 1, ~data & 4);
+ coin_lockout_global_w(space->machine(), data & 1);
+ coin_counter_w(space->machine(), 0, ~data & 2);
+ coin_counter_w(space->machine(), 1, ~data & 4);
}
static WRITE8_HANDLER( pacland_led_w )
{
- set_led_status(space->machine, 0, data & 0x08);
- set_led_status(space->machine, 1, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x08);
+ set_led_status(space->machine(), 1, data & 0x10);
}
static WRITE8_HANDLER( pacland_irq_1_ctrl_w )
{
int bit = !BIT(offset, 11);
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( pacland_irq_2_ctrl_w )
{
int bit = !BIT(offset, 13);
- cpu_interrupt_enable(space->machine->device("mcu"), bit);
+ cpu_interrupt_enable(space->machine().device("mcu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 18651d3a511..ce91258dec7 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -374,7 +374,7 @@ Boards:
static MACHINE_RESET( mschamp )
{
- UINT8 *rom = machine->region("maincpu")->base() + 0x10000;
+ UINT8 *rom = machine.region("maincpu")->base() + 0x10000;
int whichbank = input_port_read(machine, "GAME") & 1;
memory_configure_bank(machine, "bank1", 0, 2, &rom[0x0000], 0x8000);
@@ -394,8 +394,8 @@ static MACHINE_RESET( mschamp )
static WRITE8_HANDLER( pacman_interrupt_vector_w )
{
- device_set_input_line_vector(space->machine->device("maincpu"), 0, data);
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ device_set_input_line_vector(space->machine().device("maincpu"), 0, data);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -409,7 +409,7 @@ static INTERRUPT_GEN( pacman_interrupt )
/* and that the speedup button is pressed */
else
{
- UINT8 value = input_port_read_safe(device->machine, "FAKE", 0);
+ UINT8 value = input_port_read_safe(device->machine(), "FAKE", 0);
if ((value & 7) == 5 || (value & 6) == 2)
irq0_line_hold(device);
}
@@ -476,7 +476,7 @@ static WRITE8_HANDLER( piranha_interrupt_vector_w)
{
if (data == 0xfa) data = 0x78;
if (data == 0xfc) data = 0xfc;
- device_set_input_line_vector(space->machine->device("maincpu"), 0, data );
+ device_set_input_line_vector(space->machine().device("maincpu"), 0, data );
}
@@ -485,7 +485,7 @@ static WRITE8_HANDLER( nmouse_interrupt_vector_w)
if (data == 0xbf) data = 0x3c;
if (data == 0xc6) data = 0x40;
if (data == 0xfc) data = 0xfc;
- device_set_input_line_vector(space->machine->device("maincpu"), 0, data );
+ device_set_input_line_vector(space->machine().device("maincpu"), 0, data );
}
@@ -497,19 +497,19 @@ static WRITE8_HANDLER( nmouse_interrupt_vector_w)
static WRITE8_HANDLER( pacman_leds_w )
{
- set_led_status(space->machine, offset,data & 1);
+ set_led_status(space->machine(), offset,data & 1);
}
static WRITE8_HANDLER( pacman_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data & 1);
+ coin_counter_w(space->machine(), offset,data & 1);
}
static WRITE8_HANDLER( pacman_coin_lockout_global_w )
{
- coin_lockout_global_w(space->machine, ~data & 0x01);
+ coin_lockout_global_w(space->machine(), ~data & 0x01);
}
@@ -525,11 +525,11 @@ static WRITE8_HANDLER( alibaba_sound_w )
/* since the sound region in Ali Baba is not contiguous, translate the
offset into the 0-0x1f range */
if (offset < 0x10)
- pacman_sound_w(space->machine->device("namco"), offset, data);
+ pacman_sound_w(space->machine().device("namco"), offset, data);
else if (offset < 0x20)
- space->machine->generic.spriteram2.u8[offset - 0x10] = data;
+ space->machine().generic.spriteram2.u8[offset - 0x10] = data;
else
- pacman_sound_w(space->machine->device("namco"), offset - 0x10, data);
+ pacman_sound_w(space->machine().device("namco"), offset - 0x10, data);
}
@@ -537,13 +537,13 @@ static READ8_HANDLER( alibaba_mystery_1_r )
{
/* The return value determines what the mystery item is. Each bit corresponds
to a question mark */
- return space->machine->rand() & 0x0f;
+ return space->machine().rand() & 0x0f;
}
static READ8_HANDLER( alibaba_mystery_2_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
/* The single bit return value determines when the mystery is lit up.
This is certainly wrong */
state->mystery++;
@@ -560,7 +560,7 @@ static READ8_HANDLER( alibaba_mystery_2_r )
static READ8_HANDLER( maketrax_special_port2_r )
{
- int data = input_port_read(space->machine, "DSW1");
+ int data = input_port_read(space->machine(), "DSW1");
int pc = cpu_get_previouspc(space->cpu);
if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40;
@@ -603,7 +603,7 @@ static READ8_HANDLER( maketrax_special_port3_r )
static READ8_HANDLER( korosuke_special_port2_r )
{
- int data = input_port_read(space->machine, "DSW1");
+ int data = input_port_read(space->machine(), "DSW1");
int pc = cpu_get_previouspc(space->cpu);
if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40;
@@ -651,7 +651,7 @@ static READ8_HANDLER( korosuke_special_port3_r )
static READ8_HANDLER( mschamp_kludge_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
return state->counter++;
}
@@ -664,15 +664,15 @@ static READ8_HANDLER( mschamp_kludge_r )
static WRITE8_HANDLER( bigbucks_bank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->bigbucks_bank = data;
}
static READ8_HANDLER( bigbucks_question_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
- UINT8 *question = space->machine->region("user1")->base();
+ UINT8 *question = space->machine().region("user1")->base();
UINT8 ret;
ret = question[(state->bigbucks_bank << 16) | (offset ^ 0xffff)];
@@ -693,10 +693,10 @@ static INTERRUPT_GEN( s2650_interrupt )
static WRITE8_HANDLER( porky_banking_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
- memory_set_bank(space->machine, "bank2", data & 1);
- memory_set_bank(space->machine, "bank3", data & 1);
- memory_set_bank(space->machine, "bank4", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank2", data & 1);
+ memory_set_bank(space->machine(), "bank3", data & 1);
+ memory_set_bank(space->machine(), "bank4", data & 1);
}
static READ8_HANDLER( drivfrcp_port1_r )
@@ -746,44 +746,44 @@ static READ8_HANDLER( porky_port1_r )
static READ8_HANDLER( rocktrv2_prot1_data_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
return state->rocktrv2_prot_data[0] >> 4;
}
static READ8_HANDLER( rocktrv2_prot2_data_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
return state->rocktrv2_prot_data[1] >> 4;
}
static READ8_HANDLER( rocktrv2_prot3_data_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
return state->rocktrv2_prot_data[2] >> 4;
}
static READ8_HANDLER( rocktrv2_prot4_data_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
return state->rocktrv2_prot_data[3] >> 4;
}
static WRITE8_HANDLER( rocktrv2_prot_data_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->rocktrv2_prot_data[offset] = data;
}
static WRITE8_HANDLER( rocktrv2_question_bank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->rocktrv2_question_bank = data;
}
static READ8_HANDLER( rocktrv2_question_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
- UINT8 *question = space->machine->region("user1")->base();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
+ UINT8 *question = space->machine().region("user1")->base();
return question[offset | (state->rocktrv2_question_bank * 0x8000)];
}
@@ -872,18 +872,18 @@ static READ8_HANDLER( pacman_read_nop )
#define mspacman_disable_decode_latch(m) memory_set_bank(m, "bank1", 0)
// any access to these ROM addresses disables the decoder, and all you see is the original Pac-Man code
-static READ8_HANDLER( mspacman_disable_decode_r_0x0038 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x0038]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x03b0 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x03b0]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x1600 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x1600]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x2120 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x2120]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x3ff0 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x3ff0]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x8000 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x8000]; }
-static READ8_HANDLER( mspacman_disable_decode_r_0x97f0 ) { mspacman_disable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x97f0]; }
-static WRITE8_HANDLER( mspacman_disable_decode_w ) { mspacman_disable_decode_latch(space->machine); }
+static READ8_HANDLER( mspacman_disable_decode_r_0x0038 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x0038]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x03b0 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x03b0]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x1600 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x1600]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x2120 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x2120]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x3ff0 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x3ff0]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x8000 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x8000]; }
+static READ8_HANDLER( mspacman_disable_decode_r_0x97f0 ) { mspacman_disable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x97f0]; }
+static WRITE8_HANDLER( mspacman_disable_decode_w ) { mspacman_disable_decode_latch(space->machine()); }
// any access to these ROM addresses enables the decoder, and you'll see the Ms. Pac-Man code
-static READ8_HANDLER( mspacman_enable_decode_r_0x3ff8 ) { mspacman_enable_decode_latch(space->machine); return space->machine->region("maincpu")->base()[offset+0x3ff8+0x10000]; }
-static WRITE8_HANDLER( mspacman_enable_decode_w ) { mspacman_enable_decode_latch(space->machine); }
+static READ8_HANDLER( mspacman_enable_decode_r_0x3ff8 ) { mspacman_enable_decode_latch(space->machine()); return space->machine().region("maincpu")->base()[offset+0x3ff8+0x10000]; }
+static WRITE8_HANDLER( mspacman_enable_decode_w ) { mspacman_enable_decode_latch(space->machine()); }
@@ -5306,11 +5306,11 @@ ROM_END
*
*************************************/
-static void maketrax_rom_decode(running_machine *machine)
+static void maketrax_rom_decode(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5332,17 +5332,17 @@ static void maketrax_rom_decode(running_machine *machine)
static DRIVER_INIT( maketrax )
{
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5080, 0x50bf, FUNC(maketrax_special_port2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x50c0, 0x50ff, FUNC(maketrax_special_port3_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5080, 0x50bf, FUNC(maketrax_special_port2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x50c0, 0x50ff, FUNC(maketrax_special_port3_r));
maketrax_rom_decode(machine);
}
-static void korosuke_rom_decode(running_machine *machine)
+static void korosuke_rom_decode(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
@@ -5364,8 +5364,8 @@ static void korosuke_rom_decode(running_machine *machine)
static DRIVER_INIT( korosuke )
{
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5080, 0x5080, FUNC(korosuke_special_port2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x50c0, 0x50ff, FUNC(korosuke_special_port3_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5080, 0x5080, FUNC(korosuke_special_port2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x50c0, 0x50ff, FUNC(korosuke_special_port3_r));
korosuke_rom_decode(machine);
}
@@ -5377,10 +5377,10 @@ static DRIVER_INIT( ponpoko )
int i, j;
UINT8 *RAM, temp;
- int length = machine->region("gfx1")->bytes()/2;
+ int length = machine.region("gfx1")->bytes()/2;
/* Characters */
- RAM = machine->region("gfx1")->base();
+ RAM = machine.region("gfx1")->base();
for (i = 0;i < length;i += 0x10)
{
for (j = 0; j < 8; j++)
@@ -5392,7 +5392,7 @@ static DRIVER_INIT( ponpoko )
}
/* Sprites */
- RAM = machine->region("gfx1")->base()+length;
+ RAM = machine.region("gfx1")->base()+length;
for (i = 0;i < length;i += 0x20)
{
for (j = 0; j < 8; j++)
@@ -5430,7 +5430,7 @@ static DRIVER_INIT( eyes )
/* CPU ROMs */
/* Data lines D3 and D5 swapped */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = BITSWAP8(RAM[i],7,6,3,4,5,2,1,0);
@@ -5440,8 +5440,8 @@ static DRIVER_INIT( eyes )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5514,10 +5514,10 @@ static DRIVER_INIT( mspacman )
/* CPU ROMs */
/* Pac-Man code is in low bank */
- ROM = machine->region("maincpu")->base();
+ ROM = machine.region("maincpu")->base();
/* decrypted Ms. Pac-Man code is in high bank */
- DROM = &machine->region("maincpu")->base()[0x10000];
+ DROM = &machine.region("maincpu")->base()[0x10000];
/* copy ROMs into decrypted bank */
for (i = 0; i < 0x1000; i++)
@@ -5564,8 +5564,8 @@ static DRIVER_INIT( woodpek )
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0;i < len;i += 8)
eyes_decode(&RAM[i]);
}
@@ -5582,7 +5582,7 @@ static DRIVER_INIT( jumpshot )
static DRIVER_INIT( drivfrcp )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0 * 0x2000]);
memory_set_bankptr(machine, "bank2", &ROM[1 * 0x2000]);
memory_set_bankptr(machine, "bank3", &ROM[2 * 0x2000]);
@@ -5591,7 +5591,7 @@ static DRIVER_INIT( drivfrcp )
static DRIVER_INIT( 8bpm )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
/* Data lines D0 and D6 swapped */
@@ -5608,7 +5608,7 @@ static DRIVER_INIT( 8bpm )
static DRIVER_INIT( porky )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
/* Data lines D0 and D4 swapped */
@@ -5631,7 +5631,7 @@ static DRIVER_INIT( porky )
static DRIVER_INIT( rocktrv2 )
{
/* hack to pass the rom check for the bad rom */
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x7ffe] = 0xa7;
ROM[0x7fee] = 0x6d;
@@ -5643,7 +5643,7 @@ socket and run through the 74298. Clock is tied to system clock. */
static DRIVER_INIT( mspacmbe )
{
UINT8 temp;
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
/* Address lines A1 and A0 swapped if A2=0 */
@@ -5660,7 +5660,7 @@ static DRIVER_INIT( mspacmbe )
static READ8_HANDLER( cannonbp_protection_r )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
/* At 6p where a rom would usually be there is an epoxy resin chip with 'Novomatic Industrie' Cannon Ball tm 1984 label. */
/* As I have no clue about what shall be in this chip, what follows is only a simulation which is enough to play the game. */
@@ -5707,10 +5707,10 @@ static READ8_HANDLER( cannonbp_protection_r )
static DRIVER_INIT( cannonbp )
{
/* extra memory */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x4800, 0x4bff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x4800, 0x4bff);
/* protection? */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3fff, FUNC(cannonbp_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3fff, FUNC(cannonbp_protection_r));
}
diff --git a/src/mame/drivers/pandoras.c b/src/mame/drivers/pandoras.c
index 85a76e04e8a..8a8cd5714b7 100644
--- a/src/mame/drivers/pandoras.c
+++ b/src/mame/drivers/pandoras.c
@@ -37,7 +37,7 @@ Boards:
static INTERRUPT_GEN( pandoras_master_interrupt )
{
- pandoras_state *state = device->machine->driver_data<pandoras_state>();
+ pandoras_state *state = device->machine().driver_data<pandoras_state>();
if (state->irq_enable_a)
device_set_input_line(device, M6809_IRQ_LINE, HOLD_LINE);
@@ -45,7 +45,7 @@ static INTERRUPT_GEN( pandoras_master_interrupt )
static INTERRUPT_GEN( pandoras_slave_interrupt )
{
- pandoras_state *state = device->machine->driver_data<pandoras_state>();
+ pandoras_state *state = device->machine().driver_data<pandoras_state>();
if (state->irq_enable_b)
device_set_input_line(device, M6809_IRQ_LINE, HOLD_LINE);
@@ -62,7 +62,7 @@ static WRITE8_HANDLER( pandoras_int_control_w )
other bytes unknown */
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
switch (offset)
{
@@ -70,9 +70,9 @@ static WRITE8_HANDLER( pandoras_int_control_w )
device_set_input_line(state->maincpu, M6809_IRQ_LINE, CLEAR_LINE);
state->irq_enable_a = data;
break;
- case 0x02: coin_counter_w(space->machine, 0,data & 0x01);
+ case 0x02: coin_counter_w(space->machine(), 0,data & 0x01);
break;
- case 0x03: coin_counter_w(space->machine, 1,data & 0x01);
+ case 0x03: coin_counter_w(space->machine(), 1,data & 0x01);
break;
case 0x05: pandoras_flipscreen_w(space, 0, data);
break;
@@ -90,7 +90,7 @@ static WRITE8_HANDLER( pandoras_int_control_w )
static WRITE8_HANDLER( pandoras_cpua_irqtrigger_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
if (!state->firq_old_data_a && data)
device_set_input_line(state->maincpu, M6809_FIRQ_LINE, HOLD_LINE);
@@ -100,7 +100,7 @@ static WRITE8_HANDLER( pandoras_cpua_irqtrigger_w )
static WRITE8_HANDLER( pandoras_cpub_irqtrigger_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
if (!state->firq_old_data_b && data)
device_set_input_line(state->subcpu, M6809_FIRQ_LINE, HOLD_LINE);
@@ -110,13 +110,13 @@ static WRITE8_HANDLER( pandoras_cpub_irqtrigger_w )
static WRITE8_HANDLER( pandoras_i8039_irqtrigger_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
device_set_input_line(state->mcu, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_and_status_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
/* bit 7 enables IRQ */
if ((data & 0x80) == 0)
@@ -128,7 +128,7 @@ static WRITE8_HANDLER( i8039_irqen_and_status_w )
static WRITE8_HANDLER( pandoras_z80_irqtrigger_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -300,12 +300,12 @@ GFXDECODE_END
static MACHINE_START( pandoras )
{
- pandoras_state *state = machine->driver_data<pandoras_state>();
+ pandoras_state *state = machine.driver_data<pandoras_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->subcpu = machine->device<cpu_device>("sub");
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->mcu = machine->device<cpu_device>("mcu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->subcpu = machine.device<cpu_device>("sub");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->mcu = machine.device<cpu_device>("mcu");
state->save_item(NAME(state->firq_old_data_a));
state->save_item(NAME(state->firq_old_data_b));
@@ -316,7 +316,7 @@ static MACHINE_START( pandoras )
static MACHINE_RESET( pandoras )
{
- pandoras_state *state = machine->driver_data<pandoras_state>();
+ pandoras_state *state = machine.driver_data<pandoras_state>();
state->firq_old_data_a = 0;
state->firq_old_data_b = 0;
@@ -329,13 +329,13 @@ static MACHINE_RESET( pandoras )
static READ8_DEVICE_HANDLER( pandoras_portA_r )
{
- pandoras_state *state = device->machine->driver_data<pandoras_state>();
+ pandoras_state *state = device->machine().driver_data<pandoras_state>();
return state->i8039_status;
}
static READ8_DEVICE_HANDLER( pandoras_portB_r )
{
- pandoras_state *state = device->machine->driver_data<pandoras_state>();
+ pandoras_state *state = device->machine().driver_data<pandoras_state>();
return (state->audiocpu->total_cycles() / 512) & 0x0f;
}
diff --git a/src/mame/drivers/pangofun.c b/src/mame/drivers/pangofun.c
index 502fdba80c0..c0ccaeeae9b 100644
--- a/src/mame/drivers/pangofun.c
+++ b/src/mame/drivers/pangofun.c
@@ -157,9 +157,9 @@ static INPUT_PORTS_START( pangofun )
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
-static void pangofun_set_keyb_int(running_machine *machine, int state)
+static void pangofun_set_keyb_int(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
static const struct pc_vga_interface vga_interface ={
@@ -170,18 +170,18 @@ static const struct pc_vga_interface vga_interface ={
0x0000
};
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
-static int pcat_dyn_get_out2(running_machine *machine) {
- return pit8253_get_output(machine->device("pit8254"), 2 );
+static int pcat_dyn_get_out2(running_machine &machine) {
+ return pit8253_get_output(machine.device("pit8254"), 2 );
}
@@ -192,7 +192,7 @@ static const struct kbdc8042_interface at8042 =
static MACHINE_START( pangofun )
{
- device_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pcat_irq_callback);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pangofun_set_keyb_int);
kbdc8042_init(machine, &at8042);
}
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index 71a3e97fd15..21df4455cde 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -91,7 +91,7 @@ static PALETTE_INIT( panicr )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -100,7 +100,7 @@ static PALETTE_INIT( panicr )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -116,7 +116,7 @@ static PALETTE_INIT( panicr )
else
ctabentry = (color_prom[i] & 0x3f) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
// tile lookup table
@@ -124,7 +124,7 @@ static PALETTE_INIT( panicr )
{
UINT8 ctabentry = (color_prom[i] & 0x3f) | 0x00;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
// sprite lookup table
@@ -137,7 +137,7 @@ static PALETTE_INIT( panicr )
else
ctabentry = (color_prom[i] & 0x3f) | 0x40;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -145,8 +145,8 @@ static TILE_GET_INFO( get_bgtile_info )
{
int code,attr;
- code=machine->region("user1")->base()[tile_index];
- attr=machine->region("user2")->base()[tile_index];
+ code=machine.region("user1")->base()[tile_index];
+ attr=machine.region("user2")->base()[tile_index];
code+=((attr&7)<<8);
SET_TILE_INFO(
1,
@@ -157,7 +157,7 @@ static TILE_GET_INFO( get_bgtile_info )
static TILE_GET_INFO( get_txttile_info )
{
- panicr_state *state = machine->driver_data<panicr_state>();
+ panicr_state *state = machine.driver_data<panicr_state>();
UINT8 *videoram = state->videoram;
int code=videoram[tile_index*4];
int attr=videoram[tile_index*4+2];
@@ -209,16 +209,16 @@ ADDRESS_MAP_END
static VIDEO_START( panicr )
{
- panicr_state *state = machine->driver_data<panicr_state>();
+ panicr_state *state = machine.driver_data<panicr_state>();
state->bgtilemap = tilemap_create( machine, get_bgtile_info,tilemap_scan_rows,16,16,1024,16 );
state->txttilemap = tilemap_create( machine, get_txttile_info,tilemap_scan_rows,8,8,32,32 );
- colortable_configure_tilemap_groups(machine->colortable, state->txttilemap, machine->gfx[0], 0);
+ colortable_configure_tilemap_groups(machine.colortable, state->txttilemap, machine.gfx[0], 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- panicr_state *state = machine->driver_data<panicr_state>();
+ panicr_state *state = machine.driver_data<panicr_state>();
UINT8 *spriteram = state->spriteram;
int offs,flipx,flipy,x,y,color,sprite;
@@ -233,21 +233,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
color = spriteram[offs+1] & 0x0f;
sprite = spriteram[offs+0]+(state->scrollram[0x0c]<<8);
- drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
sprite,
color,flipx,flipy,x,y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0));
}
}
static SCREEN_UPDATE( panicr)
{
- panicr_state *state = screen->machine->driver_data<panicr_state>();
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ panicr_state *state = screen->machine().driver_data<panicr_state>();
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_mark_all_tiles_dirty( state->txttilemap );
tilemap_set_scrollx( state->bgtilemap,0, ((state->scrollram[0x02]&0x0f)<<12)+((state->scrollram[0x02]&0xf0)<<4)+((state->scrollram[0x04]&0x7f)<<1)+((state->scrollram[0x04]&0x80)>>7) );
tilemap_draw(bitmap,cliprect,state->bgtilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->txttilemap,0,0);
return 0;
@@ -461,8 +461,8 @@ static DRIVER_INIT( panicr )
int size;
int i;
- rom = machine->region("gfx1")->base();
- size = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ size = machine.region("gfx1")->bytes();
// text data lines
for (i = 0;i < size/2;i++)
@@ -484,8 +484,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes();
// tiles data lines
for (i = 0;i < size/4;i++)
@@ -511,8 +511,8 @@ static DRIVER_INIT( panicr )
}
- rom = machine->region("gfx3")->base();
- size = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ size = machine.region("gfx3")->bytes();
// sprites data lines
for (i = 0;i < size/2;i++)
@@ -537,8 +537,8 @@ static DRIVER_INIT( panicr )
//rearrange bg tilemaps a bit....
- rom = machine->region("user1")->base();
- size = machine->region("user1")->bytes();
+ rom = machine.region("user1")->base();
+ size = machine.region("user1")->bytes();
memcpy(buf,rom, size);
{
@@ -550,8 +550,8 @@ static DRIVER_INIT( panicr )
}
}
- rom = machine->region("user2")->base();
- size = machine->region("user2")->bytes();
+ rom = machine.region("user2")->base();
+ size = machine.region("user2")->bytes();
memcpy(buf,rom, size);
{
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index 99a20df90d9..59533698b31 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -44,7 +44,7 @@ paradise: I'm not sure it's working correctly:
static WRITE8_HANDLER( paradise_rombank_w )
{
int bank = data;
- int bank_n = space->machine->region("maincpu")->bytes() / 0x4000 - 1;
+ int bank_n = space->machine().region("maincpu")->bytes() / 0x4000 - 1;
if (bank >= bank_n)
{
@@ -52,20 +52,20 @@ static WRITE8_HANDLER( paradise_rombank_w )
bank %= bank_n;
}
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
static WRITE8_DEVICE_HANDLER( paradise_okibank_w )
{
if (data & ~0x02)
- logerror("%s: unknown oki bank bits %02X\n", device->machine->describe_context(), data);
+ logerror("%s: unknown oki bank bits %02X\n", device->machine().describe_context(), data);
downcast<okim6295_device *>(device)->set_bank_base((data & 0x02) ? 0x40000 : 0);
}
static WRITE8_HANDLER( torus_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data ^ 0xff);
+ coin_counter_w(space->machine(), 0, data ^ 0xff);
}
#define STANDARD_MAP \
@@ -543,9 +543,9 @@ GFXDECODE_END
static MACHINE_START( paradise )
{
- paradise_state *state = machine->driver_data<paradise_state>();
- int bank_n = machine->region("maincpu")->bytes() / 0x4000 - 1;
- UINT8 *ROM = machine->region("maincpu")->base();
+ paradise_state *state = machine.driver_data<paradise_state>();
+ int bank_n = machine.region("maincpu")->bytes() / 0x4000 - 1;
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 3, bank_n - 3, &ROM[0x10000], 0x4000);
@@ -556,7 +556,7 @@ static MACHINE_START( paradise )
static MACHINE_RESET( paradise )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
state->palbank = 0;
state->priority = 0;
@@ -1041,23 +1041,23 @@ ROM_END
static DRIVER_INIT (paradise)
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
state->sprite_inc = 0x20;
}
// Inverted flipscreen and sprites are packed in less memory (same number though)
static DRIVER_INIT (tgtball)
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
state->sprite_inc = 4;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x2001, 0x2001, FUNC(tgtball_flipscreen_w) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x2001, 0x2001, FUNC(tgtball_flipscreen_w) );
}
static DRIVER_INIT (torus)
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
state->sprite_inc = 4;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x2070, 0x2070, FUNC(torus_coin_counter_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x2070, 0x2070, FUNC(torus_coin_counter_w));
}
diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c
index 4ca64393261..a34112ab8e0 100644
--- a/src/mame/drivers/parodius.c
+++ b/src/mame/drivers/parodius.c
@@ -21,21 +21,21 @@ static KONAMI_SETLINES_CALLBACK( parodius_banking );
static INTERRUPT_GEN( parodius_interrupt )
{
- parodius_state *state = device->machine->driver_data<parodius_state>();
+ parodius_state *state = device->machine().driver_data<parodius_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, 0, HOLD_LINE);
}
static READ8_HANDLER( bankedram_r )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if (state->videobank & 0x01)
{
if (state->videobank & 0x04)
- return space->machine->generic.paletteram.u8[offset + 0x0800];
+ return space->machine().generic.paletteram.u8[offset + 0x0800];
else
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
else
return state->ram[offset];
@@ -43,7 +43,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if (state->videobank & 0x01)
{
@@ -58,7 +58,7 @@ static WRITE8_HANDLER( bankedram_w )
static READ8_HANDLER( parodius_052109_053245_r )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if (state->videobank & 0x02)
return k053245_r(state->k053245, offset);
@@ -68,7 +68,7 @@ static READ8_HANDLER( parodius_052109_053245_r )
static WRITE8_HANDLER( parodius_052109_053245_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if (state->videobank & 0x02)
k053245_w(state->k053245, offset, data);
@@ -78,7 +78,7 @@ static WRITE8_HANDLER( parodius_052109_053245_w )
static WRITE8_HANDLER( parodius_videobank_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if (state->videobank & 0xf8)
logerror("%04x: videobank = %02x\n",cpu_get_pc(space->cpu),data);
@@ -91,14 +91,14 @@ static WRITE8_HANDLER( parodius_videobank_w )
static WRITE8_HANDLER( parodius_3fc0_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
if ((data & 0xf4) != 0x10)
logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
@@ -113,15 +113,15 @@ static READ8_DEVICE_HANDLER( parodius_sound_r )
static WRITE8_HANDLER( parodius_sh_irqtrigger_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
#if 0
-static void sound_nmi_callback( running_machine *machine, int param )
+static void sound_nmi_callback( running_machine &machine, int param )
{
- parodius_state *state = machine->driver_data<parodius_state>();
+ parodius_state *state = machine.driver_data<parodius_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ( state->nmi_enabled ) ? CLEAR_LINE : ASSERT_LINE );
nmi_enabled = 0;
@@ -130,16 +130,16 @@ static void sound_nmi_callback( running_machine *machine, int param )
static TIMER_CALLBACK( nmi_callback )
{
- parodius_state *state = machine->driver_data<parodius_state>();
+ parodius_state *state = machine.driver_data<parodius_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
- parodius_state *state = space->machine->driver_data<parodius_state>();
+ parodius_state *state = space->machine().driver_data<parodius_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
}
/********************************************/
@@ -257,35 +257,35 @@ static const k05324x_interface parodius_k05324x_intf =
static MACHINE_START( parodius )
{
- parodius_state *state = machine->driver_data<parodius_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ parodius_state *state = machine.driver_data<parodius_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 14, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank1", 14, 2, &ROM[0x08000], 0x4000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053260 = machine->device("k053260");
- state->k053245 = machine->device("k053245");
- state->k053251 = machine->device("k053251");
- state->k052109 = machine->device("k052109");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053260 = machine.device("k053260");
+ state->k053245 = machine.device("k053245");
+ state->k053251 = machine.device("k053251");
+ state->k052109 = machine.device("k052109");
state->save_item(NAME(state->videobank));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
state->save_item(NAME(state->layerpri));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x1000);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x1000);
}
static MACHINE_RESET( parodius )
{
- parodius_state *state = machine->driver_data<parodius_state>();
+ parodius_state *state = machine.driver_data<parodius_state>();
int i;
- konami_configure_set_lines(machine->device("maincpu"), parodius_banking);
+ konami_configure_set_lines(machine.device("maincpu"), parodius_banking);
for (i = 0; i < 3; i++)
{
@@ -419,7 +419,7 @@ static KONAMI_SETLINES_CALLBACK( parodius_banking )
if (lines & 0xf0)
logerror("%04x: setlines %02x\n", cpu_get_pc(device), lines);
- memory_set_bank(device->machine, "bank1", (lines & 0x0f) ^ 0x0f);
+ memory_set_bank(device->machine(), "bank1", (lines & 0x0f) ^ 0x0f);
}
GAME( 1990, parodius, 0, parodius, parodius, 0, ROT0, "Konami", "Parodius DA! (World, set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index c9a3133d04c..c154793df67 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -98,7 +98,7 @@ public:
static WRITE16_HANDLER( pasha2_misc_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
if (offset)
{
@@ -118,7 +118,7 @@ static WRITE16_HANDLER( pasha2_misc_w )
case 0xb000:
case 0xc000:
case 0xd000:
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user2")->base() + 0x400 * (bank - 0x8000)); break;
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user2")->base() + 0x400 * (bank - 0x8000)); break;
}
}
}
@@ -127,7 +127,7 @@ static WRITE16_HANDLER( pasha2_misc_w )
static WRITE16_HANDLER( pasha2_palette_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
int color;
COMBINE_DATA(&state->paletteram[offset]);
@@ -135,33 +135,33 @@ static WRITE16_HANDLER( pasha2_palette_w )
offset &= 0xff;
color = (state->paletteram[offset] >> 8) | (state->paletteram[offset + 0x100] & 0xff00);
- palette_set_color_rgb(space->machine, offset * 2 + 0, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
+ palette_set_color_rgb(space->machine(), offset * 2 + 0, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
color = (state->paletteram[offset] & 0xff) | ((state->paletteram[offset + 0x100] & 0xff) << 8);
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
}
static WRITE16_HANDLER( vbuffer_set_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
state->vbuffer = 1;
}
static WRITE16_HANDLER( vbuffer_clear_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
state->vbuffer = 0;
}
static WRITE16_HANDLER( bitmap_0_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
COMBINE_DATA(&state->bitmap0[offset + state->vbuffer * 0x20000 / 2]);
}
static WRITE16_HANDLER( bitmap_1_w )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
// handle overlapping pixels without writing them
switch (mem_mask)
@@ -326,7 +326,7 @@ INPUT_PORTS_END
static VIDEO_START( pasha2 )
{
- pasha2_state *state = machine->driver_data<pasha2_state>();
+ pasha2_state *state = machine.driver_data<pasha2_state>();
state->save_item(NAME(state->bitmap0));
state->save_item(NAME(state->bitmap1));
@@ -334,7 +334,7 @@ static VIDEO_START( pasha2 )
static SCREEN_UPDATE( pasha2 )
{
- pasha2_state *state = screen->machine->driver_data<pasha2_state>();
+ pasha2_state *state = screen->machine().driver_data<pasha2_state>();
int x, y, count;
int color;
@@ -383,7 +383,7 @@ static SCREEN_UPDATE( pasha2 )
static MACHINE_START( pasha2 )
{
- pasha2_state *state = machine->driver_data<pasha2_state>();
+ pasha2_state *state = machine.driver_data<pasha2_state>();
state->save_item(NAME(state->old_bank));
state->save_item(NAME(state->vbuffer));
@@ -391,7 +391,7 @@ static MACHINE_START( pasha2 )
static MACHINE_RESET( pasha2 )
{
- pasha2_state *state = machine->driver_data<pasha2_state>();
+ pasha2_state *state = machine.driver_data<pasha2_state>();
state->old_bank = -1;
state->vbuffer = 0;
@@ -461,7 +461,7 @@ ROM_END
static READ16_HANDLER( pasha2_speedup_r )
{
- pasha2_state *state = space->machine->driver_data<pasha2_state>();
+ pasha2_state *state = space->machine().driver_data<pasha2_state>();
if(cpu_get_pc(space->cpu) == 0x8302)
device_spin_until_interrupt(space->cpu);
@@ -471,9 +471,9 @@ static READ16_HANDLER( pasha2_speedup_r )
static DRIVER_INIT( pasha2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x95744, 0x95747, FUNC(pasha2_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x95744, 0x95747, FUNC(pasha2_speedup_r) );
- memory_set_bankptr(machine, "bank1", machine->region("user2")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("user2")->base());
}
GAME( 1998, pasha2, 0, pasha2, pasha2, pasha2, ROT0, "Dong Sung", "Pasha Pasha 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pastelg.c b/src/mame/drivers/pastelg.c
index 6a5e0dfd12c..711d6fc6230 100644
--- a/src/mame/drivers/pastelg.c
+++ b/src/mame/drivers/pastelg.c
@@ -45,7 +45,7 @@ static DRIVER_INIT( pastelg )
static READ8_HANDLER( pastelg_sndrom_r )
{
- UINT8 *ROM = space->machine->region("voice")->base();
+ UINT8 *ROM = space->machine().region("voice")->base();
return ROM[pastelg_blitter_src_addr_r(space) & 0x7fff];
}
@@ -80,14 +80,14 @@ ADDRESS_MAP_END
static READ8_HANDLER( threeds_inputport1_r )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine,"KEY0_PL1");
- case 0x02: return input_port_read(space->machine,"KEY1_PL1");
- case 0x04: return input_port_read(space->machine,"KEY2_PL1");
- case 0x08: return input_port_read(space->machine,"KEY3_PL1");
- case 0x10: return input_port_read(space->machine,"KEY4_PL1");
+ case 0x01: return input_port_read(space->machine(),"KEY0_PL1");
+ case 0x02: return input_port_read(space->machine(),"KEY1_PL1");
+ case 0x04: return input_port_read(space->machine(),"KEY2_PL1");
+ case 0x08: return input_port_read(space->machine(),"KEY3_PL1");
+ case 0x10: return input_port_read(space->machine(),"KEY4_PL1");
}
return 0xff;
@@ -95,14 +95,14 @@ static READ8_HANDLER( threeds_inputport1_r )
static READ8_HANDLER( threeds_inputport2_r )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine,"KEY0_PL2");
- case 0x02: return input_port_read(space->machine,"KEY1_PL2");
- case 0x04: return input_port_read(space->machine,"KEY2_PL2");
- case 0x08: return input_port_read(space->machine,"KEY3_PL2");
- case 0x10: return input_port_read(space->machine,"KEY4_PL2");
+ case 0x01: return input_port_read(space->machine(),"KEY0_PL2");
+ case 0x02: return input_port_read(space->machine(),"KEY1_PL2");
+ case 0x04: return input_port_read(space->machine(),"KEY2_PL2");
+ case 0x08: return input_port_read(space->machine(),"KEY3_PL2");
+ case 0x10: return input_port_read(space->machine(),"KEY4_PL2");
}
return 0xff;
@@ -110,7 +110,7 @@ static READ8_HANDLER( threeds_inputport2_r )
static WRITE8_HANDLER( threeds_inputportsel_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
state->mux_data = ~data;
}
@@ -217,7 +217,7 @@ INPUT_PORTS_END
// stops the game hanging..
static CUSTOM_INPUT( nb1413m3_hackbusyflag_r )
{
- return field->port->machine->rand() & 3;
+ return field->port->machine().rand() & 3;
}
static INPUT_PORTS_START( threeds )
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index ee5b1015960..e58c878e3ca 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -73,7 +73,7 @@ Stephh's notes (based on the game Z80 code and some tests) :
static WRITE8_HANDLER( pbaction_sh_command_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0x00);
}
@@ -254,17 +254,17 @@ static INTERRUPT_GEN( pbaction_interrupt )
static MACHINE_START( pbaction )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->scroll));
}
static MACHINE_RESET( pbaction )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
state->scroll = 0;
}
@@ -460,7 +460,7 @@ ROM_END
static READ8_HANDLER( pbactio3_prot_kludge_r )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
/* on startup, the game expect this location to NOT act as RAM */
if (cpu_get_pc(space->cpu) == 0xab80)
@@ -472,7 +472,7 @@ static READ8_HANDLER( pbactio3_prot_kludge_r )
static DRIVER_INIT( pbactio3 )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0; i < 0xc000; i++)
@@ -484,7 +484,7 @@ static DRIVER_INIT( pbactio3 )
pbaction_decode(machine, "maincpu");
/* install a protection (?) workaround */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xc000, FUNC(pbactio3_prot_kludge_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xc000, FUNC(pbactio3_prot_kludge_r) );
}
static DRIVER_INIT( pbactio4 )
diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c
index e65e325fc3b..ff00befd904 100644
--- a/src/mame/drivers/pcat_dyn.c
+++ b/src/mame/drivers/pcat_dyn.c
@@ -92,9 +92,9 @@ static INPUT_PORTS_START( pcat_dyn )
PORT_START("pc_keyboard_7")
INPUT_PORTS_END
-static void pcat_dyn_set_keyb_int(running_machine *machine, int state)
+static void pcat_dyn_set_keyb_int(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
static const struct pc_vga_interface vga_interface =
@@ -106,18 +106,18 @@ static const struct pc_vga_interface vga_interface =
0x0000
};
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
-static int pcat_dyn_get_out2(running_machine *machine) {
- return pit8253_get_output(machine->device("pit8254"), 2 );
+static int pcat_dyn_get_out2(running_machine &machine) {
+ return pit8253_get_output(machine.device("pit8254"), 2 );
}
@@ -129,7 +129,7 @@ static const struct kbdc8042_interface at8042 =
static MACHINE_START( pcat_dyn )
{
- device_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pcat_irq_callback);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, pcat_dyn_set_keyb_int);
kbdc8042_init(machine, &at8042);
}
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index 8fcfb65f7ad..6a3fea46ab8 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -102,9 +102,9 @@ public:
};
-static void pcat_nit_microtouch_tx_callback(running_machine *machine, UINT8 data)
+static void pcat_nit_microtouch_tx_callback(running_machine &machine, UINT8 data)
{
- ins8250_receive(machine->device("ns16450_0"), data);
+ ins8250_receive(machine.device("ns16450_0"), data);
};
static INS8250_TRANSMIT( pcat_nit_com_transmit )
@@ -115,7 +115,7 @@ static INS8250_TRANSMIT( pcat_nit_com_transmit )
static INS8250_INTERRUPT( at_com_interrupt_1 )
{
- pic8259_ir4_w(device->machine->device("pic8259_1"), state);
+ pic8259_ir4_w(device->machine().device("pic8259_1"), state);
}
static const ins8250_interface pcat_nit_com0_interface =
@@ -135,7 +135,7 @@ static const ins8250_interface pcat_nit_com0_interface =
static WRITE8_HANDLER(pcat_nit_rombank_w)
{
- pcat_nit_state *state = space->machine->driver_data<pcat_nit_state>();
+ pcat_nit_state *state = space->machine().driver_data<pcat_nit_state>();
logerror( "rom bank #%02x at PC=%08X\n", data, cpu_get_pc(space->cpu) );
if ( data & 0x40 )
{
@@ -145,11 +145,11 @@ static WRITE8_HANDLER(pcat_nit_rombank_w)
if ( data & 0x80 )
{
- memory_set_bank(space->machine, "rombank", (data & 0x3f) | 0x40 );
+ memory_set_bank(space->machine(), "rombank", (data & 0x3f) | 0x40 );
}
else
{
- memory_set_bank(space->machine, "rombank", data & 0x3f );
+ memory_set_bank(space->machine(), "rombank", data & 0x3f );
}
}
else
@@ -159,7 +159,7 @@ static WRITE8_HANDLER(pcat_nit_rombank_w)
space->install_readwrite_bank(0x000d8000, 0x000d9fff, "nvrambank" );
- memory_set_bankptr(space->machine, "nvrambank", state->banked_nvram);
+ memory_set_bankptr(space->machine(), "nvrambank", state->banked_nvram);
}
}
@@ -182,7 +182,7 @@ static READ8_HANDLER(pcat_nit_io_r)
case 0: /* 278 */
return 0xff;
case 1: /* 279 */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 7: /* 27f dips */
return 0xff;
default:
@@ -207,9 +207,9 @@ static INPUT_PORTS_START( pcat_nit )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN3) PORT_IMPULSE(1)
INPUT_PORTS_END
-static void streetg2_set_keyb_int(running_machine *machine, int state)
+static void streetg2_set_keyb_int(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
static const struct pc_vga_interface vga_interface =
@@ -223,11 +223,11 @@ static const struct pc_vga_interface vga_interface =
static MACHINE_START( streetg2 )
{
- device_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pcat_irq_callback);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, streetg2_set_keyb_int);
- memory_configure_bank(machine, "rombank", 0, 0x80, machine->region("game_prg")->base(), 0x8000 );
+ memory_configure_bank(machine, "rombank", 0, 0x80, machine.region("game_prg")->base(), 0x8000 );
memory_set_bank(machine, "rombank", 0);
microtouch_init(machine, pcat_nit_microtouch_tx_callback, NULL);
@@ -389,7 +389,7 @@ ROM_END
static DRIVER_INIT(pcat_nit)
{
- pcat_nit_state *state = machine->driver_data<pcat_nit_state>();
+ pcat_nit_state *state = machine.driver_data<pcat_nit_state>();
state->banked_nvram = auto_alloc_array(machine, UINT8, 0x2000);
pc_vga_init(machine, &vga_interface, NULL);
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index eecd455c67d..ae1fd53c4d8 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -24,42 +24,42 @@
static WRITE8_HANDLER( pcktgal_bank_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- if (data & 1) { memory_set_bankptr(space->machine, "bank1", &RAM[0x4000]); }
- else { memory_set_bankptr(space->machine, "bank1", &RAM[0x10000]); }
+ if (data & 1) { memory_set_bankptr(space->machine(), "bank1", &RAM[0x4000]); }
+ else { memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000]); }
- if (data & 2) { memory_set_bankptr(space->machine, "bank2", &RAM[0x6000]); }
- else { memory_set_bankptr(space->machine, "bank2", &RAM[0x12000]); }
+ if (data & 2) { memory_set_bankptr(space->machine(), "bank2", &RAM[0x6000]); }
+ else { memory_set_bankptr(space->machine(), "bank2", &RAM[0x12000]); }
}
static WRITE8_HANDLER( pcktgal_sound_bank_w )
{
- memory_set_bank(space->machine, "bank3", (data >> 2) & 1);
+ memory_set_bank(space->machine(), "bank3", (data >> 2) & 1);
}
static WRITE8_HANDLER( pcktgal_sound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static void pcktgal_adpcm_int(device_t *device)
{
- pcktgal_state *state = device->machine->driver_data<pcktgal_state>();
+ pcktgal_state *state = device->machine().driver_data<pcktgal_state>();
msm5205_data_w(device,state->msm5205next >> 4);
state->msm5205next<<=4;
state->toggle = 1 - state->toggle;
if (state->toggle)
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( pcktgal_adpcm_data_w )
{
- pcktgal_state *state = space->machine->driver_data<pcktgal_state>();
+ pcktgal_state *state = space->machine().driver_data<pcktgal_state>();
state->msm5205next=data;
}
@@ -413,9 +413,9 @@ ROM_END
static DRIVER_INIT( deco222 )
{
int A;
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
space->set_decrypted_region(0x8000, 0xffff, decrypted);
@@ -423,17 +423,17 @@ static DRIVER_INIT( deco222 )
for (A = 0x8000;A < 0x18000;A++)
decrypted[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
- memory_configure_bank(machine, "bank3", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank3", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
memory_configure_bank_decrypted(machine, "bank3", 0, 2, &decrypted[0x8000], 0x4000);
}
static DRIVER_INIT( graphics )
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i,j,temp[16];
- memory_configure_bank(machine, "bank3", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank3", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
/* Tile graphics roms have some swapped lines, original version only */
for (i = 0x00000;i < len;i += 32)
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index 714ae793e71..02e5526f068 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -112,7 +112,7 @@ public:
visarea.max_x = _x_-1; \
visarea.min_y = 0; \
visarea.max_y = _y_-1; \
- machine->primary_screen->configure(_x_, _y_, visarea, machine->primary_screen->frame_period().attoseconds ); \
+ machine.primary_screen->configure(_x_, _y_, visarea, machine.primary_screen->frame_period().attoseconds ); \
} \
@@ -122,7 +122,7 @@ public:
#define RES_320x200 0
#define RES_640x200 1
-static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num);
+static void cga_alphanumeric_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num);
static VIDEO_START( filetto )
{
@@ -142,15 +142,15 @@ static READ8_HANDLER( vga_hvretrace_r )
UINT8 res;
int h,w;
res = 0;
- h = space->machine->primary_screen->height();
- w = space->machine->primary_screen->width();
+ h = space->machine().primary_screen->height();
+ w = space->machine().primary_screen->width();
// popmessage("%d %d",h,w);
- if (space->machine->primary_screen->hpos() > h)
+ if (space->machine().primary_screen->hpos() > h)
res|= 1;
- if (space->machine->primary_screen->vpos() > w)
+ if (space->machine().primary_screen->vpos() > w)
res|= 8;
return res;
@@ -158,9 +158,9 @@ static READ8_HANDLER( vga_hvretrace_r )
/*Basic Graphic mode */
/*TODO: non-black colours should use the bright versions*/
-static void cga_graphic_bitmap(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs)
+static void cga_graphic_bitmap(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs)
{
- pcxt_state *state = machine->driver_data<pcxt_state>();
+ pcxt_state *state = machine.driver_data<pcxt_state>();
UINT16 x,y;
UINT32 offs;
@@ -169,10 +169,10 @@ static void cga_graphic_bitmap(running_machine *machine,bitmap_t *bitmap,const r
for(y=0;y<200;y+=2)
for(x=0;x<320;x+=4)
{
- *BITMAP_ADDR16(bitmap, y, x+0) = machine->pens[0x200+(((state->vga_vram[offs] & 0xc0)>>6)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+1) = machine->pens[0x200+(((state->vga_vram[offs] & 0x30)>>4)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+2) = machine->pens[0x200+(((state->vga_vram[offs] & 0x0c)>>2)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+3) = machine->pens[0x200+(((state->vga_vram[offs] & 0x03)>>0)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+0) = machine.pens[0x200+(((state->vga_vram[offs] & 0xc0)>>6)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+1) = machine.pens[0x200+(((state->vga_vram[offs] & 0x30)>>4)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+2) = machine.pens[0x200+(((state->vga_vram[offs] & 0x0c)>>2)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+3) = machine.pens[0x200+(((state->vga_vram[offs] & 0x03)>>0)<<1)];
offs++;
}
@@ -180,10 +180,10 @@ static void cga_graphic_bitmap(running_machine *machine,bitmap_t *bitmap,const r
for(y=1;y<200;y+=2)
for(x=0;x<320;x+=4)
{
- *BITMAP_ADDR16(bitmap, y, x+0) = machine->pens[0x200+(((state->vga_vram[offs] & 0xc0)>>6)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+1) = machine->pens[0x200+(((state->vga_vram[offs] & 0x30)>>4)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+2) = machine->pens[0x200+(((state->vga_vram[offs] & 0x0c)>>2)<<1)];
- *BITMAP_ADDR16(bitmap, y, x+3) = machine->pens[0x200+(((state->vga_vram[offs] & 0x03)>>0)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+0) = machine.pens[0x200+(((state->vga_vram[offs] & 0xc0)>>6)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+1) = machine.pens[0x200+(((state->vga_vram[offs] & 0x30)>>4)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+2) = machine.pens[0x200+(((state->vga_vram[offs] & 0x0c)>>2)<<1)];
+ *BITMAP_ADDR16(bitmap, y, x+3) = machine.pens[0x200+(((state->vga_vram[offs] & 0x03)>>0)<<1)];
offs++;
}
@@ -191,9 +191,9 @@ static void cga_graphic_bitmap(running_machine *machine,bitmap_t *bitmap,const r
-static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num)
+static void cga_alphanumeric_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num)
{
- pcxt_state *state = machine->driver_data<pcxt_state>();
+ pcxt_state *state = machine.driver_data<pcxt_state>();
UINT32 offs,x,y,max_x,max_y;
/*define the visible area*/
@@ -221,7 +221,7 @@ static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,
int tile = state->vga_vram[offs] & 0xff;
int color = state->vga_vram[offs+1] & 0xff;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_num],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx_num],
tile,
color,
0,0,
@@ -235,7 +235,7 @@ static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,
static SCREEN_UPDATE( filetto )
{
- pcxt_state *state = screen->machine->driver_data<pcxt_state>();
+ pcxt_state *state = screen->machine().driver_data<pcxt_state>();
/* xx1x xxxx Attribute bit 7. 0=blink, 1=Intesity
xxx1 xxxx 640x200 mode
xxxx 1xxx Enable video signal
@@ -248,16 +248,16 @@ static SCREEN_UPDATE( filetto )
if(state->vga_mode[0] & 8)
{
if(state->vga_mode[0] & 2)
- cga_graphic_bitmap(screen->machine,bitmap,cliprect,0,0x18000);
+ cga_graphic_bitmap(screen->machine(),bitmap,cliprect,0,0x18000);
else
{
switch(state->vga_mode[0] & 1)
{
case 0x00:
- cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_320x200,0x18000,2);
+ cga_alphanumeric_tilemap(screen->machine(),bitmap,cliprect,RES_320x200,0x18000,2);
break;
case 0x01:
- cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_640x200,0x18000,2);
+ cga_alphanumeric_tilemap(screen->machine(),bitmap,cliprect,RES_640x200,0x18000,2);
break;
}
}
@@ -266,11 +266,11 @@ static SCREEN_UPDATE( filetto )
return 0;
}
-static void vga_bitmap_layer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void vga_bitmap_layer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- pcxt_state *state = machine->driver_data<pcxt_state>();
+ pcxt_state *state = machine.driver_data<pcxt_state>();
int x,y,z;
- UINT8 *region = machine->region("user1")->base();
+ UINT8 *region = machine.region("user1")->base();
UINT32 cur_bank;
/*TODO: might be a different descramble algorythm plus plain bg bank*/
@@ -289,24 +289,24 @@ static void vga_bitmap_layer(running_machine *machine, bitmap_t *bitmap,const re
/*S3 Video card,VGA*/
static SCREEN_UPDATE( tetriskr )
{
- pcxt_state *state = screen->machine->driver_data<pcxt_state>();
+ pcxt_state *state = screen->machine().driver_data<pcxt_state>();
bitmap_fill(bitmap, cliprect, 0);
if(state->vga_mode[0] & 8)
{
if(state->vga_mode[0] & 2)
- cga_graphic_bitmap(screen->machine,bitmap,cliprect,0,0x18000);
+ cga_graphic_bitmap(screen->machine(),bitmap,cliprect,0,0x18000);
else
{
- vga_bitmap_layer(screen->machine,bitmap,cliprect);
+ vga_bitmap_layer(screen->machine(),bitmap,cliprect);
switch(state->vga_mode[0] & 1)
{
case 0x00:
- cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_320x200,0x18000,0);
+ cga_alphanumeric_tilemap(screen->machine(),bitmap,cliprect,RES_320x200,0x18000,0);
break;
case 0x01:
- cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_640x200,0x18000,0);
+ cga_alphanumeric_tilemap(screen->machine(),bitmap,cliprect,RES_640x200,0x18000,0);
break;
}
}
@@ -323,7 +323,7 @@ static READ8_HANDLER( vga_regs_r )
static WRITE8_HANDLER( vga_regs_w )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
if(offset == 0)
{
@@ -343,7 +343,7 @@ static WRITE8_HANDLER( vga_regs_w )
static WRITE8_HANDLER( vga_vram_w )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
state->vga_vram[offset] = data;
}
@@ -354,17 +354,17 @@ static WRITE8_HANDLER( vga_vram_w )
static READ8_HANDLER( disk_iobank_r )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
//printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(space->cpu));
- //if(offset == 0) return input_port_read(space->machine, "DSW");
- if(offset == 1) return input_port_read(space->machine, "IN1");
+ //if(offset == 0) return input_port_read(space->machine(), "DSW");
+ if(offset == 1) return input_port_read(space->machine(), "IN1");
return state->disk_data[offset];
}
static WRITE8_HANDLER( disk_iobank_w )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
/*
BIOS does a single out $0310,$F0 on reset
@@ -410,7 +410,7 @@ static WRITE8_HANDLER( disk_iobank_w )
if (newbank != state->bank)
{
state->bank = newbank;
- memory_set_bankptr(space->machine, "bank1",space->machine->region("user1")->base() + 0x10000 * state->bank );
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("user1")->base() + 0x10000 * state->bank );
}
state->lastvalue = data;
@@ -444,7 +444,7 @@ static const struct pit8253_config pc_pit8253_config =
static READ8_DEVICE_HANDLER( port_a_r )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
if(!(state->port_b_data & 0x80))//???
{
/*
@@ -459,7 +459,7 @@ static READ8_DEVICE_HANDLER( port_a_r )
}
else//keyboard emulation
{
- //cputag_set_input_line(device->machine, "maincpu", 1, PULSE_LINE);
+ //cputag_set_input_line(device->machine(), "maincpu", 1, PULSE_LINE);
return 0x00;//Keyboard is disconnected
//return 0xaa;//Keyboard code
}
@@ -467,13 +467,13 @@ static READ8_DEVICE_HANDLER( port_a_r )
static READ8_DEVICE_HANDLER( port_b_r )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
return state->port_b_data;
}
static READ8_DEVICE_HANDLER( port_c_r )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
return state->wss2_data;//???
}
@@ -482,10 +482,10 @@ static READ8_DEVICE_HANDLER( port_c_r )
/* The Korean Tetris uses it as a regular buzzer,probably the sound is all in there...*/
static WRITE8_DEVICE_HANDLER( port_b_w )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
state->port_b_data = data;
-// device_t *beep = device->machine->device("beep");
-// device_t *cvsd = device->machine->device("cvsd");
+// device_t *beep = device->machine().device("beep");
+// device_t *cvsd = device->machine().device("cvsd");
// hc55516_digit_w(cvsd, data);
// popmessage("%02x\n",data);
// beep_set_state(beep, 0);
@@ -495,19 +495,19 @@ static WRITE8_DEVICE_HANDLER( port_b_w )
static WRITE8_DEVICE_HANDLER( wss_1_w )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
state->wss1_data = data;
}
static WRITE8_DEVICE_HANDLER( wss_2_w )
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
state->wss2_data = data;
}
static WRITE8_DEVICE_HANDLER( sys_reset_w )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
@@ -540,7 +540,7 @@ static const ppi8255_interface filetto_ppi8255_intf[2] =
static READ8_HANDLER( fdc765_status_r )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
UINT8 tmp;
// popmessage("Read FDC status @ PC=%05x",cpu_get_pc(space->cpu));
tmp = state->status | 0x80;
@@ -555,21 +555,21 @@ static READ8_HANDLER( fdc765_status_r )
static READ8_HANDLER( fdc765_data_r )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
state->status = (FDC_READ);
return 0xc0;
}
static WRITE8_HANDLER( fdc765_data_w )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
state->status = (FDC_WRITE);
}
static WRITE8_HANDLER( drive_selection_w )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
state->drive_data = data;
/*write to this area then expects that location [43e] has the bit 7 activated*/
state->work_ram[0x3e] = 0x80;
@@ -582,7 +582,7 @@ DMA8237 Controller
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -591,7 +591,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -601,7 +601,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -610,7 +610,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static READ8_HANDLER(dma_page_select_r)
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8) {
@@ -633,7 +633,7 @@ static READ8_HANDLER(dma_page_select_r)
static WRITE8_HANDLER(dma_page_select_w)
{
- pcxt_state *state = space->machine->driver_data<pcxt_state>();
+ pcxt_state *state = space->machine().driver_data<pcxt_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8) {
@@ -654,7 +654,7 @@ static WRITE8_HANDLER(dma_page_select_w)
static void set_dma_channel(device_t *device, int channel, int state)
{
- pcxt_state *drvstate = device->machine->driver_data<pcxt_state>();
+ pcxt_state *drvstate = device->machine().driver_data<pcxt_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -680,7 +680,7 @@ static I8237_INTERFACE( dma8237_1_config )
static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface pic8259_1_config =
@@ -695,7 +695,7 @@ static const struct pic8259_interface pic8259_2_config =
static IRQ_CALLBACK(irq_callback)
{
- pcxt_state *state = device->machine->driver_data<pcxt_state>();
+ pcxt_state *state = device->machine().driver_data<pcxt_state>();
int r = 0;
r = pic8259_acknowledge(state->pic8259_2);
if (r==0)
@@ -943,16 +943,16 @@ static PALETTE_INIT(filetto)
static MACHINE_RESET( filetto )
{
- pcxt_state *state = machine->driver_data<pcxt_state>();
+ pcxt_state *state = machine.driver_data<pcxt_state>();
state->bank = -1;
state->lastvalue = -1;
state->hv_blank = 0;
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
- state->pit8253 = machine->device( "pit8253" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
+ state->pit8253 = machine.device( "pit8253" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
static MACHINE_CONFIG_START( filetto, pcxt_state )
@@ -1102,8 +1102,8 @@ static DRIVER_INIT( tetriskr )
{
int i,j,k;
int index=0;
- UINT8 *region = machine->region("user1")->base();
- UINT8 *gfx = machine->region("gfx2")->base();
+ UINT8 *region = machine.region("user1")->base();
+ UINT8 *gfx = machine.region("gfx2")->base();
for(i=0;i<0x20000;i++)
{
diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c
index 67689e7c42f..ef1574f3830 100644
--- a/src/mame/drivers/pengadvb.c
+++ b/src/mame/drivers/pengadvb.c
@@ -39,9 +39,9 @@ public:
-static void mem_map_banks(running_machine *machine)
+static void mem_map_banks(running_machine &machine)
{
- pengadvb_state *state = machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = machine.driver_data<pengadvb_state>();
int slot_select;
// page 0
@@ -50,15 +50,15 @@ static void mem_map_banks(running_machine *machine)
{
case 0:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
break;
};
case 1:
case 2:
case 3:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x0000, 0x3fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x0000, 0x3fff);
break;
}
}
@@ -69,24 +69,24 @@ static void mem_map_banks(running_machine *machine)
{
case 0:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- memory_set_bankptr(machine, "bank21", machine->region("maincpu")->base() + 0x4000);
- memory_set_bankptr(machine, "bank22", machine->region("maincpu")->base() + 0x4000 + 0x2000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
+ memory_set_bankptr(machine, "bank21", machine.region("maincpu")->base() + 0x4000);
+ memory_set_bankptr(machine, "bank22", machine.region("maincpu")->base() + 0x4000 + 0x2000);
break;
}
case 1:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
- memory_set_bankptr(machine, "bank21", machine->region("game")->base() + state->mem_banks[0]*0x2000);
- memory_set_bankptr(machine, "bank22", machine->region("game")->base() + state->mem_banks[1]*0x2000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x5fff, "bank21" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0x7fff, "bank22" );
+ memory_set_bankptr(machine, "bank21", machine.region("game")->base() + state->mem_banks[0]*0x2000);
+ memory_set_bankptr(machine, "bank22", machine.region("game")->base() + state->mem_banks[1]*0x2000);
break;
}
case 2:
case 3:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
break;
}
}
@@ -97,17 +97,17 @@ static void mem_map_banks(running_machine *machine)
{
case 1:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x9fff, "bank31" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank32" );
- memory_set_bankptr(machine, "bank31", machine->region("game")->base() + state->mem_banks[2]*0x2000);
- memory_set_bankptr(machine, "bank32", machine->region("game")->base() + state->mem_banks[3]*0x2000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0x9fff, "bank31" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xbfff, "bank32" );
+ memory_set_bankptr(machine, "bank31", machine.region("game")->base() + state->mem_banks[2]*0x2000);
+ memory_set_bankptr(machine, "bank32", machine.region("game")->base() + state->mem_banks[3]*0x2000);
break;
}
case 0:
case 2:
case 3:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x8000, 0xbfff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x8000, 0xbfff);
break;
}
}
@@ -121,12 +121,12 @@ static void mem_map_banks(running_machine *machine)
case 1:
case 2:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0xc000, 0xffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0xc000, 0xffff);
break;
}
case 3:
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xffff, "bank4" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xffff, "bank4" );
memory_set_bankptr(machine, "bank4", state->main_mem);
break;
}
@@ -136,7 +136,7 @@ static void mem_map_banks(running_machine *machine)
static WRITE8_HANDLER(mem_w)
{
- pengadvb_state *state = space->machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = space->machine().driver_data<pengadvb_state>();
if (offset >= 0xc000)
{
int slot_select = (state->mem_map >> 6) & 0x03;
@@ -150,10 +150,10 @@ static WRITE8_HANDLER(mem_w)
{
switch(offset)
{
- case 0x4000: state->mem_banks[0] = data; mem_map_banks(space->machine); break;
- case 0x6000: state->mem_banks[1] = data; mem_map_banks(space->machine); break;
- case 0x8000: state->mem_banks[2] = data; mem_map_banks(space->machine); break;
- case 0xa000: state->mem_banks[3] = data; mem_map_banks(space->machine); break;
+ case 0x4000: state->mem_banks[0] = data; mem_map_banks(space->machine()); break;
+ case 0x6000: state->mem_banks[1] = data; mem_map_banks(space->machine()); break;
+ case 0x8000: state->mem_banks[2] = data; mem_map_banks(space->machine()); break;
+ case 0xa000: state->mem_banks[3] = data; mem_map_banks(space->machine()); break;
}
}
}
@@ -197,7 +197,7 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER( pengadvb_psg_port_a_r )
{
- return input_port_read(device->machine, "IN0");
+ return input_port_read(device->machine(), "IN0");
}
static const ay8910_interface pengadvb_ay8910_interface =
@@ -212,15 +212,15 @@ static const ay8910_interface pengadvb_ay8910_interface =
static WRITE8_DEVICE_HANDLER ( pengadvb_ppi_port_a_w )
{
- pengadvb_state *state = device->machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = device->machine().driver_data<pengadvb_state>();
state->mem_map = data;
- mem_map_banks(device->machine);
+ mem_map_banks(device->machine());
}
static READ8_DEVICE_HANDLER( pengadvb_ppi_port_b_r )
{
if ((i8255a_r(device, 2) & 0x0f) == 0)
- return input_port_read(device->machine, "IN1");
+ return input_port_read(device->machine(), "IN1");
return 0xff;
}
@@ -235,7 +235,7 @@ static I8255A_INTERFACE(pengadvb_ppi8255_interface)
DEVCB_NULL
};
-static void vdp_interrupt(running_machine *machine, int i)
+static void vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line(machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
@@ -256,18 +256,18 @@ static STATE_POSTLOAD ( pengadvb )
static MACHINE_START( pengadvb )
{
- pengadvb_state *state = machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = machine.driver_data<pengadvb_state>();
TMS9928A_configure(&tms9928a_interface);
state_save_register_global_pointer(machine, state->main_mem, 0x4000);
state_save_register_global(machine, state->mem_map);
state_save_register_global_array(machine, state->mem_banks);
- machine->state().register_postload(pengadvb, NULL);
+ machine.state().register_postload(pengadvb, NULL);
}
static MACHINE_RESET( pengadvb )
{
- pengadvb_state *state = machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = machine.driver_data<pengadvb_state>();
TMS9928A_reset();
state->mem_map = 0;
@@ -277,7 +277,7 @@ static MACHINE_RESET( pengadvb )
static INTERRUPT_GEN( pengadvb_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
@@ -307,10 +307,10 @@ static MACHINE_CONFIG_START( pengadvb, pengadvb_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
-static void pengadvb_decrypt(running_machine *machine, const char* region)
+static void pengadvb_decrypt(running_machine &machine, const char* region)
{
- UINT8 *mem = machine->region(region)->base();
- int memsize = machine->region(region)->bytes();
+ UINT8 *mem = machine.region(region)->base();
+ int memsize = machine.region(region)->bytes();
UINT8 *buf;
int i;
@@ -333,7 +333,7 @@ static void pengadvb_decrypt(running_machine *machine, const char* region)
static DRIVER_INIT(pengadvb)
{
- pengadvb_state *state = machine->driver_data<pengadvb_state>();
+ pengadvb_state *state = machine.driver_data<pengadvb_state>();
pengadvb_decrypt(machine, "maincpu");
pengadvb_decrypt(machine, "game");
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index 912264ee3c1..2f873cad7a8 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -107,7 +107,7 @@ public:
static WRITE8_HANDLER( pengo_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 1);
+ coin_counter_w(space->machine(), offset, data & 1);
}
@@ -674,9 +674,9 @@ static DRIVER_INIT( penta )
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, /* ...1...1...0.... */
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } /* ...1...1...1.... */
};
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 9da75435d48..44106632ddf 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -246,10 +246,10 @@ static const mc6845_interface mc6845_intf =
* Memory Copy *
***************/
-static void peplus_load_superdata(running_machine *machine, const char *bank_name)
+static void peplus_load_superdata(running_machine &machine, const char *bank_name)
{
- peplus_state *state = machine->driver_data<peplus_state>();
- UINT8 *super_data = machine->region(bank_name)->base();
+ peplus_state *state = machine.driver_data<peplus_state>();
+ UINT8 *super_data = machine.region(bank_name)->base();
/* Distribute Superboard Data */
memcpy(state->s3000_ram, &super_data[0x3000], 0x1000);
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( peplus_bgcolor_w )
{
int i;
- for (i = 0; i < space->machine->total_colors(); i++)
+ for (i = 0; i < space->machine().total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -291,7 +291,7 @@ static WRITE8_HANDLER( peplus_bgcolor_w )
bit2 = 0;
b = 0x21 * bit2 + 0x47 * bit1 + 0x97 * bit0;
- palette_set_color(space->machine, (15 + (i*16)), MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), (15 + (i*16)), MAKE_RGB(r, g, b));
}
}
@@ -300,7 +300,7 @@ static WRITE8_HANDLER( peplus_bgcolor_w )
static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
{
- peplus_state *state = device->machine->driver_data<peplus_state>();
+ peplus_state *state = device->machine().driver_data<peplus_state>();
state->vid_address = address;
}
@@ -316,26 +316,26 @@ static TIMER_CALLBACK(assert_lp_cb)
static void handle_lightpen( device_t *device )
{
- int x_val = input_port_read_safe(device->machine, "TOUCH_X",0x00);
- int y_val = input_port_read_safe(device->machine, "TOUCH_Y",0x00);
- const rectangle &vis_area = device->machine->primary_screen->visible_area();
+ int x_val = input_port_read_safe(device->machine(), "TOUCH_X",0x00);
+ int y_val = input_port_read_safe(device->machine(), "TOUCH_Y",0x00);
+ const rectangle &vis_area = device->machine().primary_screen->visible_area();
int xt, yt;
xt = x_val * (vis_area.max_x - vis_area.min_x) / 1024 + vis_area.min_x;
yt = y_val * (vis_area.max_y - vis_area.min_y) / 1024 + vis_area.min_y;
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(yt, xt), FUNC(assert_lp_cb), 0, device);
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(yt, xt), FUNC(assert_lp_cb), 0, device);
}
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync)
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
handle_lightpen(device);
}
static WRITE8_DEVICE_HANDLER( peplus_crtc_display_w )
{
- peplus_state *state = device->machine->driver_data<peplus_state>();
+ peplus_state *state = device->machine().driver_data<peplus_state>();
UINT8 *videoram = state->videoram;
videoram[state->vid_address] = data;
state->palette_ram[state->vid_address] = state->io_port[1];
@@ -349,7 +349,7 @@ static WRITE8_DEVICE_HANDLER( peplus_crtc_display_w )
static WRITE8_HANDLER( peplus_io_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->io_port[offset] = data;
}
@@ -360,14 +360,14 @@ static WRITE8_HANDLER( peplus_duart_w )
static WRITE8_HANDLER( peplus_cmos_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
char bank_name[6];
/* Test for Wingboard PAL Trigger Condition */
if (offset == 0x1fff && state->wingboard && data < 5)
{
sprintf(bank_name, "user%d", data + 1);
- peplus_load_superdata(space->machine, bank_name);
+ peplus_load_superdata(space->machine(), bank_name);
}
state->cmos_ram[offset] = data;
@@ -375,43 +375,43 @@ static WRITE8_HANDLER( peplus_cmos_w )
static WRITE8_HANDLER( peplus_s3000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->s3000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_s5000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->s5000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_s7000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->s7000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_sb000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->sb000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_sd000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->sd000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_sf000_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
state->sf000_ram[offset] = data;
}
static WRITE8_HANDLER( peplus_output_bank_a_w )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
output_set_value("pe_bnka0",(data >> 0) & 1); /* Coin Lockout */
output_set_value("pe_bnka1",(data >> 1) & 1); /* Diverter */
output_set_value("pe_bnka2",(data >> 2) & 1); /* Bell */
@@ -452,7 +452,7 @@ static WRITE8_HANDLER( peplus_output_bank_c_w )
static WRITE8_DEVICE_HANDLER(i2c_nvram_w)
{
- peplus_state *state = device->machine->driver_data<peplus_state>();
+ peplus_state *state = device->machine().driver_data<peplus_state>();
i2cmem_scl_write(device,BIT(data, 2));
state->sda_dir = BIT(data, 1);
i2cmem_sda_write(device,BIT(data, 0));
@@ -465,7 +465,7 @@ static WRITE8_DEVICE_HANDLER(i2c_nvram_w)
static READ8_HANDLER( peplus_io_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->io_port[offset];
}
@@ -477,50 +477,50 @@ static READ8_HANDLER( peplus_duart_r )
static READ8_HANDLER( peplus_cmos_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->cmos_ram[offset];
}
static READ8_HANDLER( peplus_s3000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->s3000_ram[offset];
}
static READ8_HANDLER( peplus_s5000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->s5000_ram[offset];
}
static READ8_HANDLER( peplus_s7000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->s7000_ram[offset];
}
static READ8_HANDLER( peplus_sb000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->sb000_ram[offset];
}
static READ8_HANDLER( peplus_sd000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->sd000_ram[offset];
}
static READ8_HANDLER( peplus_sf000_r )
{
- peplus_state *state = space->machine->driver_data<peplus_state>();
+ peplus_state *state = space->machine().driver_data<peplus_state>();
return state->sf000_ram[offset];
}
/* Last Color in Every Palette is bgcolor */
static READ8_HANDLER( peplus_bgcolor_r )
{
- return palette_get_color(space->machine, 15); // Return bgcolor from First Palette
+ return palette_get_color(space->machine(), 15); // Return bgcolor from First Palette
}
static READ8_HANDLER( peplus_dropdoor_r )
@@ -535,7 +535,7 @@ static READ8_HANDLER( peplus_watchdog_r )
static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
{
- peplus_state *state = device->machine->driver_data<peplus_state>();
+ peplus_state *state = device->machine().driver_data<peplus_state>();
/*
Bit 0 = COIN DETECTOR A
Bit 1 = COIN DETECTOR B
@@ -549,7 +549,7 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
UINT8 bank_a = 0x50; // Turn Off Low Battery and Hopper Full Statuses
UINT8 coin_optics = 0x00;
UINT8 coin_out = 0x00;
- UINT64 curr_cycles = device->machine->firstcpu->total_cycles();
+ UINT64 curr_cycles = device->machine().firstcpu->total_cycles();
UINT16 door_wait = 500;
UINT8 sda = 0;
@@ -558,16 +558,16 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
sda = i2cmem_sda_read(device);
}
- if ((input_port_read_safe(device->machine, "SENSOR",0x00) & 0x01) == 0x01 && state->coin_state == 0) {
+ if ((input_port_read_safe(device->machine(), "SENSOR",0x00) & 0x01) == 0x01 && state->coin_state == 0) {
state->coin_state = 1; // Start Coin Cycle
- state->last_cycles = device->machine->firstcpu->total_cycles();
+ state->last_cycles = device->machine().firstcpu->total_cycles();
} else {
/* Process Next Coin Optic State */
if (curr_cycles - state->last_cycles > 600000/6 && state->coin_state != 0) {
state->coin_state++;
if (state->coin_state > 5)
state->coin_state = 0;
- state->last_cycles = device->machine->firstcpu->total_cycles();
+ state->last_cycles = device->machine().firstcpu->total_cycles();
}
}
@@ -597,12 +597,12 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
door_wait = 12345;
if (curr_cycles - state->last_door > door_wait) {
- if ((input_port_read_safe(device->machine, "DOOR",0xff) & 0x01) == 0x01) {
+ if ((input_port_read_safe(device->machine(), "DOOR",0xff) & 0x01) == 0x01) {
state->door_open = (!state->door_open & 0x01);
} else {
state->door_open = 1;
}
- state->last_door = device->machine->firstcpu->total_cycles();
+ state->last_door = device->machine().firstcpu->total_cycles();
}
if (curr_cycles - state->last_coin_out > 600000/12 && state->coin_out_state != 0) { // Guessing with 600000
@@ -612,7 +612,7 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
state->coin_out_state = 3; // Coin-Out On
}
- state->last_coin_out = device->machine->firstcpu->total_cycles();
+ state->last_coin_out = device->machine().firstcpu->total_cycles();
}
switch (state->coin_out_state)
@@ -643,7 +643,7 @@ static READ8_DEVICE_HANDLER( peplus_input_bank_a_r )
static TILE_GET_INFO( get_bg_tile_info )
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
UINT8 *videoram = state->videoram;
int pr = state->palette_ram[tile_index];
int pr2 = state->palette_ram2[tile_index];
@@ -664,7 +664,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( peplus )
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
state->palette_ram = auto_alloc_array(machine, UINT8, 0x3000);
memset(state->palette_ram, 0, 0x3000);
@@ -674,7 +674,7 @@ static VIDEO_START( peplus )
static SCREEN_UPDATE( peplus )
{
- peplus_state *state = screen->machine->driver_data<peplus_state>();
+ peplus_state *state = screen->machine().driver_data<peplus_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -690,7 +690,7 @@ static PALETTE_INIT( peplus )
*/
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -799,7 +799,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( peplus_input_r )
{
UINT8 inp_ret = 0x00;
- UINT8 inp_read = input_port_read(field->port->machine, (const char *)param);
+ UINT8 inp_read = input_port_read(field->port->machine(), (const char *)param);
if (inp_read & 0x01) inp_ret = 0x01;
if (inp_read & 0x02) inp_ret = 0x02;
@@ -998,7 +998,7 @@ static MACHINE_RESET( peplus )
{
/* AutoHold Feature Currently Disabled */
#if 0
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
// pepp0158
state->program_ram[0xa19f] = 0x22; // RET - Disable Memory Test
@@ -1064,9 +1064,9 @@ MACHINE_CONFIG_END
*****************/
/* Normal board */
-static void peplus_init(running_machine *machine)
+static void peplus_init(running_machine &machine)
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
/* default : no address to patch in program RAM to enable autohold feature */
state->autohold_addr = 0;
}
@@ -1079,7 +1079,7 @@ static void peplus_init(running_machine *machine)
/* Normal board */
static DRIVER_INIT( peplus )
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
state->wingboard = FALSE;
state->jumper_e16_e17 = FALSE;
peplus_init(machine);
@@ -1088,7 +1088,7 @@ static DRIVER_INIT( peplus )
/* Superboard */
static DRIVER_INIT( peplussb )
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
state->wingboard = FALSE;
state->jumper_e16_e17 = FALSE;
peplus_load_superdata(machine, "user1");
@@ -1099,7 +1099,7 @@ static DRIVER_INIT( peplussb )
/* Superboard with Attached Wingboard */
static DRIVER_INIT( peplussbw )
{
- peplus_state *state = machine->driver_data<peplus_state>();
+ peplus_state *state = machine.driver_data<peplus_state>();
state->wingboard = TRUE;
state->jumper_e16_e17 = TRUE;
peplus_load_superdata(machine, "user1");
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 69b9e975c28..258ced2e9d1 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -302,11 +302,11 @@ Notes:
#include "includes/pgm.h"
UINT16 *pgm_mainram;
-static void IGS022_reset(running_machine* machine);
+static void IGS022_reset(running_machine& machine);
static READ16_HANDLER( pgm_videoram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset < 0x4000 / 2)
return state->bg_videoram[offset&0x7ff];
@@ -319,7 +319,7 @@ static READ16_HANDLER( pgm_videoram_r )
static WRITE16_HANDLER( pgm_videoram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset < 0x4000 / 2)
pgm_bg_videoram_w(space, offset&0x7ff, data, mem_mask);
@@ -331,13 +331,13 @@ static WRITE16_HANDLER( pgm_videoram_w )
static READ16_HANDLER ( z80_ram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
return (state->z80_mainram[offset * 2] << 8) | state->z80_mainram[offset * 2 + 1];
}
static READ32_HANDLER( arm7_latch_arm_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", state->kov2_latchdata_68k_w, mem_mask, cpu_get_pc(space->cpu));
@@ -346,7 +346,7 @@ static READ32_HANDLER( arm7_latch_arm_r )
static WRITE32_HANDLER( arm7_latch_arm_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, cpu_get_pc(space->cpu));
@@ -356,7 +356,7 @@ static WRITE32_HANDLER( arm7_latch_arm_w )
static READ32_HANDLER( arm7_shareram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, state->arm7_shareram[offset], mem_mask, cpu_get_pc(space->cpu));
@@ -365,7 +365,7 @@ static READ32_HANDLER( arm7_shareram_r )
static WRITE32_HANDLER( arm7_shareram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, cpu_get_pc(space->cpu));
@@ -374,7 +374,7 @@ static WRITE32_HANDLER( arm7_shareram_w )
static READ16_HANDLER( arm7_latch_68k_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("M68K: Latch read: %04x (%04x) (%06x)\n", state->kov2_latchdata_arm_w & 0x0000ffff, mem_mask, cpu_get_pc(space->cpu));
@@ -383,20 +383,20 @@ static READ16_HANDLER( arm7_latch_68k_r )
static WRITE16_HANDLER( arm7_latch_68k_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, cpu_get_pc(space->cpu));
COMBINE_DATA(&state->kov2_latchdata_68k_w);
generic_pulse_irq_line(state->prot, ARM7_FIRQ_LINE);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
device_spin_until_time(space->cpu, state->prot->cycles_to_attotime(200)); // give the arm time to respond (just boosting the interleave doesn't help)
}
static READ16_HANDLER( arm7_ram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 *share16 = (UINT16 *)state->arm7_shareram;
if (PGMARM7LOGERROR)
@@ -406,7 +406,7 @@ static READ16_HANDLER( arm7_ram_r )
static WRITE16_HANDLER( arm7_ram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 *share16 = (UINT16 *)state->arm7_shareram;
if (PGMARM7LOGERROR)
@@ -416,7 +416,7 @@ static WRITE16_HANDLER( arm7_ram_w )
static WRITE16_HANDLER ( z80_ram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
int pc = cpu_get_pc(space->cpu);
if (ACCESSING_BITS_8_15)
@@ -431,7 +431,7 @@ static WRITE16_HANDLER ( z80_ram_w )
static WRITE16_HANDLER ( z80_reset_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMLOGERROR)
logerror("Z80: reset %04x @ %04x (%06x)\n", data, mem_mask, cpu_get_pc(space->cpu));
@@ -465,7 +465,7 @@ static WRITE16_HANDLER ( z80_ctrl_w )
static WRITE16_HANDLER ( m68k_l1_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if(ACCESSING_BITS_0_7)
{
@@ -485,7 +485,7 @@ static WRITE8_HANDLER( z80_l3_w )
static void sound_irq( device_t *device, int level )
{
- pgm_state *state = device->machine->driver_data<pgm_state>();
+ pgm_state *state = device->machine().driver_data<pgm_state>();
device_set_input_line(state->soundcpu, 0, level);
}
@@ -504,7 +504,7 @@ static UINT8 bcd( UINT8 data )
static READ16_HANDLER( pgm_calendar_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT8 calr = (state->cal_val & state->cal_mask) ? 1 : 0;
state->cal_mask <<= 1;
@@ -513,9 +513,9 @@ static READ16_HANDLER( pgm_calendar_r )
static WRITE16_HANDLER( pgm_calendar_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
- space->machine->base_datetime(state->systime);
+ space->machine().base_datetime(state->systime);
state->cal_com <<= 1;
state->cal_com |= data & 1;
@@ -566,7 +566,7 @@ static WRITE16_HANDLER( pgm_calendar_w )
break;
case 0xf: //Load Date
- space->machine->base_datetime(state->systime);
+ space->machine().base_datetime(state->systime);
break;
}
}
@@ -750,18 +750,18 @@ ADDRESS_MAP_END
static READ32_HANDLER( kovsh_arm7_protlatch_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
- space->machine->scheduler().synchronize(); // force resync
+ space->machine().scheduler().synchronize(); // force resync
return (state->kovsh_highlatch_68k_w << 16) | (state->kovsh_lowlatch_68k_w);
}
static WRITE32_HANDLER( kovsh_arm7_protlatch_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
- space->machine->scheduler().synchronize(); // force resync
+ space->machine().scheduler().synchronize(); // force resync
if (ACCESSING_BITS_16_31)
{
@@ -777,9 +777,9 @@ static WRITE32_HANDLER( kovsh_arm7_protlatch_w )
static READ16_HANDLER( kovsh_68k_protlatch_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
- space->machine->scheduler().synchronize(); // force resync
+ space->machine().scheduler().synchronize(); // force resync
switch (offset)
{
@@ -791,9 +791,9 @@ static READ16_HANDLER( kovsh_68k_protlatch_r )
static WRITE16_HANDLER( kovsh_68k_protlatch_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
- space->machine->scheduler().synchronize(); // force resync
+ space->machine().scheduler().synchronize(); // force resync
switch (offset)
{
@@ -809,7 +809,7 @@ static WRITE16_HANDLER( kovsh_68k_protlatch_w )
static READ16_HANDLER( kovsh_arm7_ram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 *share16 = (UINT16 *)state->arm7_shareram;
if (PGMARM7LOGERROR)
@@ -819,7 +819,7 @@ static READ16_HANDLER( kovsh_arm7_ram_r )
static WRITE16_HANDLER( kovsh_arm7_ram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 *share16 = (UINT16 *)state->arm7_shareram;
if (PGMARM7LOGERROR)
@@ -862,7 +862,7 @@ ADDRESS_MAP_END
static READ32_HANDLER( kovsh_arm7_unk_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
return state->kovsh_counter++;
}
@@ -887,25 +887,25 @@ ADDRESS_MAP_END
static WRITE32_HANDLER( svg_arm7_ram_sel_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
state->svg_ram_sel = data & 1;
}
static READ32_HANDLER( svg_arm7_shareram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
return state->svg_shareram[state->svg_ram_sel & 1][offset];
}
static WRITE32_HANDLER( svg_arm7_shareram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
COMBINE_DATA(&state->svg_shareram[state->svg_ram_sel & 1][offset]);
}
static READ16_HANDLER( svg_m68k_ram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
int ram_sel = (state->svg_ram_sel & 1) ^ 1;
UINT16 *share16 = (UINT16 *)(state->svg_shareram[ram_sel & 1]);
@@ -914,7 +914,7 @@ static READ16_HANDLER( svg_m68k_ram_r )
static WRITE16_HANDLER( svg_m68k_ram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
int ram_sel = (state->svg_ram_sel & 1) ^ 1;
UINT16 *share16 = (UINT16 *)(state->svg_shareram[ram_sel & 1]);
@@ -928,15 +928,15 @@ static READ16_HANDLER( svg_68k_nmi_r )
static WRITE16_HANDLER( svg_68k_nmi_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
generic_pulse_irq_line(state->prot, ARM7_FIRQ_LINE);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
device_spin_until_time(space->cpu, state->prot->cycles_to_attotime(200)); // give the arm time to respond (just boosting the interleave doesn't help)
}
static WRITE16_HANDLER( svg_latch_68k_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (PGMARM7LOGERROR)
logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, cpu_get_pc(space->cpu));
COMBINE_DATA(&state->kov2_latchdata_68k_w);
@@ -1343,13 +1343,13 @@ static INTERRUPT_GEN( drgw_interrupt )
static MACHINE_START( pgm )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
- machine->base_datetime(state->systime);
+ machine.base_datetime(state->systime);
- state->soundcpu = machine->device<cpu_device>("soundcpu");
- state->prot = machine->device<cpu_device>("prot");
- state->ics = machine->device("ics");
+ state->soundcpu = machine.device<cpu_device>("soundcpu");
+ state->prot = machine.device<cpu_device>("prot");
+ state->ics = machine.device("ics");
state->save_item(NAME(state->cal_val));
state->save_item(NAME(state->cal_mask));
@@ -1359,7 +1359,7 @@ static MACHINE_START( pgm )
static MACHINE_RESET( pgm )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
@@ -1511,7 +1511,7 @@ static MACHINE_START( cavepgm )
{
MACHINE_START_CALL(pgm);
- cavepgm_state *state = machine->driver_data<cavepgm_state>();
+ cavepgm_state *state = machine.driver_data<cavepgm_state>();
state->save_item(NAME(state->value0));
state->save_item(NAME(state->value1));
@@ -4339,13 +4339,13 @@ ROM_END
/* This function expands the 32x32 5-bit data into a format which is easier to
decode in MAME */
-static void expand_32x32x5bpp(running_machine *machine)
+static void expand_32x32x5bpp(running_machine &machine)
{
- UINT8 *src = machine->region( "tiles" )->base();
+ UINT8 *src = machine.region( "tiles" )->base();
gfx_layout glcopy;
glcopy = *(&pgm32_charlayout);
- size_t srcsize = machine->region( "tiles" )->bytes();
+ size_t srcsize = machine.region( "tiles" )->bytes();
int cnt, pix;
size_t gfx2_size_needed = ((srcsize/5)*8)+0x1000;
UINT8 *dst = auto_alloc_array(machine, UINT8, gfx2_size_needed);
@@ -4373,7 +4373,7 @@ static void expand_32x32x5bpp(running_machine *machine)
glcopy.total = (gfx2_size_needed / glcopy.charincrement)*8;
- machine->gfx[1] = gfx_element_alloc(machine, &glcopy, (UINT8 *)dst, 32, 0x400);
+ machine.gfx[1] = gfx_element_alloc(machine, &glcopy, (UINT8 *)dst, 32, 0x400);
}
@@ -4381,11 +4381,11 @@ static void expand_32x32x5bpp(running_machine *machine)
/* This function expands the sprite colour data (in the A Roms) from 3 pixels
in each word to a byte per pixel making it easier to use */
-static void expand_colourdata( running_machine *machine )
+static void expand_colourdata( running_machine &machine )
{
- pgm_state *state = machine->driver_data<pgm_state>();
- UINT8 *src = machine->region( "sprcol" )->base();
- size_t srcsize = machine->region( "sprcol" )->bytes();
+ pgm_state *state = machine.driver_data<pgm_state>();
+ UINT8 *src = machine.region( "sprcol" )->base();
+ size_t srcsize = machine.region( "sprcol" )->bytes();
int cnt;
size_t needed = srcsize / 2 * 3;
@@ -4409,9 +4409,9 @@ static void expand_colourdata( running_machine *machine )
}
-static void pgm_basic_init_nobank( running_machine *machine )
+static void pgm_basic_init_nobank( running_machine &machine )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
expand_32x32x5bpp(machine);
expand_colourdata(machine);
@@ -4422,9 +4422,9 @@ static void pgm_basic_init_nobank( running_machine *machine )
}
-static void pgm_basic_init( running_machine *machine )
+static void pgm_basic_init( running_machine &machine )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0x100000]);
pgm_basic_init_nobank(machine);
@@ -4440,11 +4440,11 @@ static DRIVER_INIT( pgm )
static DRIVER_INIT( orlegend )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
pgm_basic_init(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xC0400e, 0xC0400f, FUNC(pgm_asic3_r), FUNC(pgm_asic3_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xC04000, 0xC04001, FUNC(pgm_asic3_reg_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xC0400e, 0xC0400f, FUNC(pgm_asic3_r), FUNC(pgm_asic3_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xC04000, 0xC04001, FUNC(pgm_asic3_reg_w));
state->asic3_reg = 0;
state->asic3_latch[0] = 0;
@@ -4467,7 +4467,7 @@ static DRIVER_INIT( orlegend )
state->save_item(NAME(state->asic3_hold));
}
-static void drgwld2_common_init(running_machine *machine)
+static void drgwld2_common_init(running_machine &machine)
{
pgm_basic_init(machine);
pgm_dw2_decrypt(machine);
@@ -4477,12 +4477,12 @@ static void drgwld2_common_init(running_machine *machine)
select and after failing in the 2nd stage (probably there are other checks
out there).
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd80000, 0xd80003, FUNC(dw2_d80000_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd80000, 0xd80003, FUNC(dw2_d80000_r));
}
static DRIVER_INIT( drgw2 )
{ /* incomplete? */
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
@@ -4494,7 +4494,7 @@ static DRIVER_INIT( drgw2 )
static DRIVER_INIT( dw2v100x )
{
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
drgwld2_common_init(machine);
mem16[0x131084 / 2] = 0x4e93;
@@ -4504,7 +4504,7 @@ static DRIVER_INIT( dw2v100x )
static DRIVER_INIT( drgw2c )
{
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
@@ -4516,7 +4516,7 @@ static DRIVER_INIT( drgw2c )
static DRIVER_INIT( drgw2j )
{
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
drgwld2_common_init(machine);
/* These ROM patches are not hacks, the protection device
overlays the normal ROM code, this has been confirmed on a real PCB
@@ -4526,9 +4526,9 @@ static DRIVER_INIT( drgw2j )
mem16[0x1303f6 / 2] = 0x4e93;
}
-static void kovsh_latch_init( running_machine *machine )
+static void kovsh_latch_init( running_machine &machine )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
state->kovsh_highlatch_arm_w = 0;
state->kovsh_lowlatch_arm_w = 0;
@@ -4552,7 +4552,7 @@ static DRIVER_INIT( kov )
static DRIVER_INIT( pstar )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
pgm_basic_init(machine);
pgm_pstar_decrypt(machine);
@@ -4617,9 +4617,9 @@ static DRIVER_INIT( oldsplus )
kovsh_latch_init(machine);
}
-static void kov2_latch_init( running_machine *machine )
+static void kov2_latch_init( running_machine &machine )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
state->kov2_latchdata_68k_w = 0;
state->kov2_latchdata_arm_w = 0;
@@ -4682,7 +4682,7 @@ static READ16_HANDLER(ddp2_protram_r)
//logerror("%06x prot_r %04x, %04x\n", pc, offset*2,ddp2_protram[offset]);
- if (offset == 0x02/2) return input_port_read(space->machine, "Region");
+ if (offset == 0x02/2) return input_port_read(space->machine(), "Region");
if (offset == 0x1f00/2) return 0;
@@ -4710,14 +4710,14 @@ static DRIVER_INIT( ddp2 )
// should actually be kov2-like, but keep this simulation for now just to demonstrate it. It will need the internal ARM rom to work properly.
ddp2_protram = auto_alloc_array(machine, UINT16, 0x10000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd00000, 0xd0ffff, FUNC(ddp2_protram_r), FUNC(ddp2_protram_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd10000, 0xd10001, FUNC(ddp2_asic27_0xd10000_r), FUNC(ddp2_asic27_0xd10000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd00000, 0xd0ffff, FUNC(ddp2_protram_r), FUNC(ddp2_protram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd10000, 0xd10001, FUNC(ddp2_asic27_0xd10000_r), FUNC(ddp2_asic27_0xd10000_w));
}
-static void svg_basic_init(running_machine *machine)
+static void svg_basic_init(running_machine &machine)
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
pgm_basic_init(machine);
state->svg_shareram[0] = auto_alloc_array(machine, UINT32, 0x10000 / 4);
@@ -4768,9 +4768,9 @@ static DRIVER_INIT( dmnfrnt )
*/
-static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT16 size, UINT16 mode)
+static void IGS022_do_dma(running_machine& machine, UINT16 src, UINT16 dst, UINT16 size, UINT16 mode)
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
UINT16 param;
/*
P_SRC =0x300290 (offset from prot rom base)
@@ -4842,17 +4842,17 @@ static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT
};
*/
int x;
- UINT16 *PROTROM = (UINT16*)machine->region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
for (x = 0; x < size; x++)
{
- //UINT16 *RAMDUMP = (UINT16*)space->machine->region("user2")->base();
+ //UINT16 *RAMDUMP = (UINT16*)space->machine().region("user2")->base();
//UINT16 dat = RAMDUMP[dst + x];
UINT16 dat2 = PROTROM[src + x];
UINT8 extraoffset = param&0xfe; // the lowest bit changed the table addressing in tests, see 'rawDataOdd' table instead.. it's still related to the main one, not identical
- UINT8* dectable = (UINT8*)machine->region("igs022data")->base();//rawDataEven; // the basic decryption table is at the start of the mcu data rom! at least in killbld
+ UINT8* dectable = (UINT8*)machine.region("igs022data")->base();//rawDataEven; // the basic decryption table is at the start of the mcu data rom! at least in killbld
UINT16 extraxor = ((dectable[((x*2)+0+extraoffset)&0xff]) << 8) | (dectable[((x*2)+1+extraoffset)&0xff] << 0);
dat2 = ((dat2 & 0x00ff)<<8) | ((dat2 & 0xff00)>>8);
@@ -4883,7 +4883,7 @@ static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT
{
/* mode 5 seems to be a straight copy */
int x;
- UINT16 *PROTROM = (UINT16*)machine->region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
for (x = 0; x < size; x++)
{
UINT16 dat = PROTROM[src + x];
@@ -4896,7 +4896,7 @@ static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT
{
/* mode 6 seems to swap bytes and nibbles */
int x;
- UINT16 *PROTROM = (UINT16*)machine->region("igs022data")->base();
+ UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
for (x = 0; x < size; x++)
{
UINT16 dat = PROTROM[src + x];
@@ -4926,11 +4926,11 @@ static void IGS022_do_dma(running_machine* machine, UINT16 src, UINT16 dst, UINT
// the internal MCU boot code automatically does this DMA
// and puts the version # of the data rom in ram
-static void IGS022_reset(running_machine* machine)
+static void IGS022_reset(running_machine& machine)
{
int i;
- UINT16 *PROTROM = (UINT16*)machine->region("igs022data")->base();
- pgm_state *state = machine->driver_data<pgm_state>();
+ UINT16 *PROTROM = (UINT16*)machine.region("igs022data")->base();
+ pgm_state *state = machine.driver_data<pgm_state>();
UINT16 tmp;
// fill ram with A5 patern
@@ -4961,9 +4961,9 @@ static void IGS022_reset(running_machine* machine)
state->sharedprotram[0x2a2/2] = tmp;
}
-static void IGS022_handle_command(running_machine* machine)
+static void IGS022_handle_command(running_machine& machine)
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
UINT16 cmd = state->sharedprotram[0x200/2];
//mame_printf_debug("command %04x\n", cmd);
if (cmd == 0x6d) //Store values to asic ram
@@ -5014,7 +5014,7 @@ static WRITE16_HANDLER( killbld_igs025_prot_w )
{
// mame_printf_debug("killbrd prot r\n");
// return 0;
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
offset &= 0xf;
if (offset == 0)
@@ -5028,7 +5028,7 @@ static WRITE16_HANDLER( killbld_igs025_prot_w )
{
if (data == 1) //Execute cmd
{
- IGS022_handle_command(space->machine);
+ IGS022_handle_command(space->machine());
state->kb_reg++;
}
}
@@ -5042,7 +5042,7 @@ static WRITE16_HANDLER( killbld_igs025_prot_w )
static READ16_HANDLER( killbld_igs025_prot_r )
{
// mame_printf_debug("killbld prot w\n");
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 res ;
offset &= 0xf;
@@ -5069,7 +5069,7 @@ static READ16_HANDLER( killbld_igs025_prot_r )
}
else
{
- UINT32 protvalue = 0x89911400 | input_port_read(space->machine, "Region");
+ UINT32 protvalue = 0x89911400 | input_port_read(space->machine(), "Region");
ret = (protvalue >> (8 * (state->kb_ptr - 1))) & 0xff;
}
@@ -5086,7 +5086,7 @@ static READ16_HANDLER( killbld_igs025_prot_r )
static MACHINE_RESET( killbld )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
MACHINE_RESET_CALL(pgm);
/* fill the protection ram with a5 + auto dma */
@@ -5107,12 +5107,12 @@ static MACHINE_RESET( killbld )
/* ASIC025/ASIC022 don't provide rom patches like the DW2 protection does, the previous dump was bad :-) */
static DRIVER_INIT( killbld )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
pgm_basic_init(machine);
pgm_killbld_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd40000, 0xd40003, FUNC(killbld_igs025_prot_r), FUNC(killbld_igs025_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd40000, 0xd40003, FUNC(killbld_igs025_prot_r), FUNC(killbld_igs025_prot_w));
state->kb_cmd = 0;
state->kb_reg = 0;
@@ -5129,7 +5129,7 @@ static DRIVER_INIT( killbld )
static MACHINE_RESET( dw3 )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
MACHINE_RESET_CALL(pgm);
@@ -5191,7 +5191,7 @@ static int ptr=0;
static UINT8 dw3_swap;
static WRITE16_HANDLER( drgw3_igs025_prot_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
offset&=0xf;
@@ -5218,7 +5218,7 @@ static WRITE16_HANDLER( drgw3_igs025_prot_w )
static READ16_HANDLER( drgw3_igs025_prot_r )
{
// mame_printf_debug("killbld prot w\n");
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 res ;
@@ -5250,7 +5250,7 @@ static READ16_HANDLER( drgw3_igs025_prot_r )
else if(state->kb_cmd==5)
{
UINT32 protvalue;
- protvalue = 0x60000|input_port_read(space->machine, "Region");
+ protvalue = 0x60000|input_port_read(space->machine(), "Region");
res=(protvalue>>(8*(ptr-1)))&0xff;
@@ -5266,11 +5266,11 @@ static DRIVER_INIT( drgw3 )
pgm_basic_init(machine);
/*
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
{
int x;
- UINT16 *RAMDUMP = (UINT16*)machine->region("user2")->base();
+ UINT16 *RAMDUMP = (UINT16*)machine.region("user2")->base();
for (x=0;x<(0x4000/2);x++)
{
state->sharedprotram[x] = RAMDUMP[x];
@@ -5278,7 +5278,7 @@ static DRIVER_INIT( drgw3 )
}
}
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xDA5610, 0xDA5613, FUNC(drgw3_igs025_prot_r), FUNC(drgw3_igs025_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xDA5610, 0xDA5613, FUNC(drgw3_igs025_prot_r), FUNC(drgw3_igs025_prot_w));
pgm_dw3_decrypt(machine);
}
@@ -5289,17 +5289,17 @@ static DRIVER_INIT( puzzli2 )
it uses an arm with no external rom
an acts in a similar way to kov etc. */
- pgm_state *state = machine->driver_data<pgm_state>();
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ pgm_state *state = machine.driver_data<pgm_state>();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
pgm_basic_init(machine);
kovsh_latch_init(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500003, FUNC(asic28_r), FUNC(asic28_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500003, FUNC(asic28_r), FUNC(asic28_w));
/* 0x4f0000 - ? is actually ram shared with the protection device,
the protection device provides the region code */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4fffff, FUNC(sango_protram_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f0000, 0x4fffff, FUNC(sango_protram_r));
pgm_puzzli2_decrypt(machine);
@@ -5335,8 +5335,8 @@ static DRIVER_INIT( puzzli2 )
static DRIVER_INIT( dw2001 )
{
- //pgm_state *state = machine->driver_data<pgm_state>();
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ //pgm_state *state = machine.driver_data<pgm_state>();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
pgm_basic_init(machine);
kovsh_latch_init(machine);
@@ -5403,24 +5403,24 @@ static UINT32 olds_prot_addr( UINT16 addr )
return realaddr;
}
-static UINT32 olds_read_reg( running_machine *machine, UINT16 addr )
+static UINT32 olds_read_reg( running_machine &machine, UINT16 addr )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
UINT32 protaddr = (olds_prot_addr(addr) - 0x400000) / 2;
return state->sharedprotram[protaddr] << 16 | state->sharedprotram[protaddr + 1];
}
-static void olds_write_reg( running_machine *machine, UINT16 addr, UINT32 val )
+static void olds_write_reg( running_machine &machine, UINT16 addr, UINT32 val )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
state->sharedprotram[(olds_prot_addr(addr) - 0x400000) / 2] = val >> 16;
state->sharedprotram[(olds_prot_addr(addr) - 0x400000) / 2 + 1] = val & 0xffff;
}
static MACHINE_RESET( olds )
{
- pgm_state *state = machine->driver_data<pgm_state>();
- UINT16 *mem16 = (UINT16 *)machine->region("user2")->base();
+ pgm_state *state = machine.driver_data<pgm_state>();
+ UINT16 *mem16 = (UINT16 *)machine.region("user2")->base();
int i;
MACHINE_RESET_CALL(pgm);
@@ -5441,7 +5441,7 @@ static MACHINE_RESET( olds )
static READ16_HANDLER( olds_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT16 res = 0;
if (offset == 1)
@@ -5454,7 +5454,7 @@ static READ16_HANDLER( olds_r )
res = state->olds_cmd3;
else if (state->kb_cmd == 5)
{
- UINT32 protvalue = 0x900000 | input_port_read(space->machine, "Region"); // region from protection device.
+ UINT32 protvalue = 0x900000 | input_port_read(space->machine(), "Region"); // region from protection device.
res = (protvalue >> (8 * (state->kb_ptr - 1))) & 0xff; // includes region 1 = taiwan , 2 = china, 3 = japan (title = orlegend special), 4 = korea, 5 = hongkong, 6 = world
}
@@ -5465,7 +5465,7 @@ static READ16_HANDLER( olds_r )
static WRITE16_HANDLER( olds_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset == 0)
state->kb_cmd = data;
else //offset==2
@@ -5500,7 +5500,7 @@ static WRITE16_HANDLER( olds_w )
UINT16 val0 = state->sharedprotram[0x3050 / 2]; //CMD_FORMAT
{
if ((cmd0 & 0xff) == 0x2)
- olds_write_reg(space->machine, val0, olds_read_reg(space->machine, val0) + 0x10000);
+ olds_write_reg(space->machine(), val0, olds_read_reg(space->machine(), val0) + 0x10000);
}
break;
}
@@ -5528,11 +5528,11 @@ static READ16_HANDLER( olds_prot_swap_r )
static DRIVER_INIT( olds )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
pgm_basic_init(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xdcb400, 0xdcb403, FUNC(olds_r), FUNC(olds_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8178f4, 0x8178f5, FUNC(olds_prot_swap_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xdcb400, 0xdcb403, FUNC(olds_r), FUNC(olds_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8178f4, 0x8178f5, FUNC(olds_prot_swap_r));
state->kb_cmd = 0;
state->kb_reg = 0;
@@ -5549,10 +5549,10 @@ static DRIVER_INIT( olds )
-static void pgm_decode_kovlsqh2_tiles( running_machine *machine )
+static void pgm_decode_kovlsqh2_tiles( running_machine &machine )
{
int i, j;
- UINT16 *src = (UINT16 *)(machine->region("tiles")->base() + 0x400000);
+ UINT16 *src = (UINT16 *)(machine.region("tiles")->base() + 0x400000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x800000);
for (i = 0; i < 0x800000 / 2; i++)
@@ -5567,7 +5567,7 @@ static void pgm_decode_kovlsqh2_tiles( running_machine *machine )
auto_free( machine, dst );
}
-static void pgm_decode_kovlsqh2_sprites( running_machine *machine, UINT8 *src )
+static void pgm_decode_kovlsqh2_sprites( running_machine &machine, UINT8 *src )
{
int i, j;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x800000);
@@ -5584,10 +5584,10 @@ static void pgm_decode_kovlsqh2_sprites( running_machine *machine, UINT8 *src )
auto_free( machine, dst );
}
-static void pgm_decode_kovlsqh2_samples( running_machine *machine )
+static void pgm_decode_kovlsqh2_samples( running_machine &machine )
{
int i;
- UINT8 *src = (UINT8 *)(machine->region("ics")->base() + 0x400000);
+ UINT8 *src = (UINT8 *)(machine.region("ics")->base() + 0x400000);
for (i = 0; i < 0x400000; i+=2) {
src[i + 0x000001] = src[i + 0x400001];
@@ -5596,10 +5596,10 @@ static void pgm_decode_kovlsqh2_samples( running_machine *machine )
memcpy( src + 0x400000, src, 0x400000 );
}
-static void pgm_decode_kovqhsgs_program( running_machine *machine )
+static void pgm_decode_kovqhsgs_program( running_machine &machine )
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ UINT16 *src = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x400000);
for (i = 0; i < 0x400000 / 2; i++)
@@ -5614,10 +5614,10 @@ static void pgm_decode_kovqhsgs_program( running_machine *machine )
auto_free( machine, dst );
}
-static void pgm_decode_kovqhsgs2_program( running_machine *machine )
+static void pgm_decode_kovqhsgs2_program( running_machine &machine )
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ UINT16 *src = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
UINT16 *dst = auto_alloc_array(machine, UINT16, 0x400000);
for (i = 0; i < 0x400000 / 2; i++)
@@ -5638,14 +5638,14 @@ static DRIVER_INIT( kovlsqh2 )
pgm_decode_kovqhsgs2_program(machine);
pgm_decode_kovlsqh2_tiles(machine);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x0800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x1000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x1800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x2000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x2800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprmask")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprmask")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0800000);
pgm_decode_kovlsqh2_samples(machine);
pgm_basic_init(machine);
@@ -5657,14 +5657,14 @@ static DRIVER_INIT( kovqhsgs )
pgm_decode_kovqhsgs_program(machine);
pgm_decode_kovlsqh2_tiles(machine);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x0800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x1000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x1800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x2000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprcol")->base() + 0x2800000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprmask")->base() + 0x0000000);
- pgm_decode_kovlsqh2_sprites(machine, machine->region("sprmask")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x0800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x1800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprcol")->base() + 0x2800000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0000000);
+ pgm_decode_kovlsqh2_sprites(machine, machine.region("sprmask")->base() + 0x0800000);
pgm_decode_kovlsqh2_samples(machine);
@@ -5683,7 +5683,7 @@ static DRIVER_INIT( kovqhsgs )
static WRITE16_HANDLER( ddp3_asic_w )
{
- cavepgm_state *state = space->machine->driver_data<cavepgm_state>();
+ cavepgm_state *state = space->machine().driver_data<cavepgm_state>();
if (offset == 0)
{
@@ -5769,7 +5769,7 @@ static WRITE16_HANDLER( ddp3_asic_w )
static READ16_HANDLER( ddp3_asic_r )
{
- cavepgm_state *state = space->machine->driver_data<cavepgm_state>();
+ cavepgm_state *state = space->machine().driver_data<cavepgm_state>();
if (offset == 0)
{
@@ -5794,19 +5794,19 @@ static READ16_HANDLER( ddp3_asic_r )
}
-void install_asic27a_ddp3(running_machine* machine)
+void install_asic27a_ddp3(running_machine& machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x500000, 0x500005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
}
-void install_asic27a_ket(running_machine* machine)
+void install_asic27a_ket(running_machine& machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
}
-void install_asic27a_espgal(running_machine* machine)
+void install_asic27a_espgal(running_machine& machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x400000, 0x400005, FUNC(ddp3_asic_r), FUNC(ddp3_asic_w));
}
diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c
index 54676af5143..c78d7810183 100644
--- a/src/mame/drivers/phoenix.c
+++ b/src/mame/drivers/phoenix.c
@@ -446,7 +446,7 @@ static const ay8910_interface survival_ay8910_interface =
static MACHINE_RESET( phoenix )
{
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x4000);
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x4000);
}
@@ -1056,7 +1056,7 @@ ROM_END
static DRIVER_INIT( condor )
{
/* additional inputs for coinage */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x5000, 0x5000, "DSW1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x5000, 0x5000, "DSW1");
}
diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c
index a0cc9fb7928..25da9f28d09 100644
--- a/src/mame/drivers/photon.c
+++ b/src/mame/drivers/photon.c
@@ -31,10 +31,10 @@ public:
};
-static void pk8000_set_bank(running_machine *machine,UINT8 data)
+static void pk8000_set_bank(running_machine &machine,UINT8 data)
{
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *ram = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *ram = machine.region("maincpu")->base();
UINT8 block1 = data & 3;
UINT8 block2 = (data >> 2) & 3;
UINT8 block3 = (data >> 4) & 3;
@@ -92,7 +92,7 @@ static void pk8000_set_bank(running_machine *machine,UINT8 data)
}
static WRITE8_DEVICE_HANDLER(pk8000_80_porta_w)
{
- pk8000_set_bank(device->machine,data);
+ pk8000_set_bank(device->machine(),data);
}
static READ8_DEVICE_HANDLER(pk8000_80_portb_r)
@@ -102,7 +102,7 @@ static READ8_DEVICE_HANDLER(pk8000_80_portb_r)
static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w)
{
- speaker_level_w(device->machine->device("speaker"), BIT(data,7));
+ speaker_level_w(device->machine().device("speaker"), BIT(data,7));
}
static I8255A_INTERFACE( pk8000_ppi8255_interface_1 )
@@ -190,7 +190,7 @@ static IRQ_CALLBACK(pk8000_irq_callback)
static MACHINE_RESET(pk8000)
{
pk8000_set_bank(machine,0);
- device_set_irq_callback(machine->device("maincpu"), pk8000_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pk8000_irq_callback);
}
static VIDEO_START( photon )
@@ -199,7 +199,7 @@ static VIDEO_START( photon )
static SCREEN_UPDATE( photon )
{
- return pk8000_video_update(screen, bitmap, cliprect, screen->machine->region("maincpu")->base());
+ return pk8000_video_update(screen, bitmap, cliprect, screen->machine().region("maincpu")->base());
}
static MACHINE_CONFIG_START( photon, photon_state )
diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c
index 17f9a568828..7a4a296661b 100644
--- a/src/mame/drivers/photon2.c
+++ b/src/mame/drivers/photon2.c
@@ -81,7 +81,7 @@ static PALETTE_INIT( spectrum )
static VIDEO_START( spectrum )
{
- photon2_state *state = machine->driver_data<photon2_state>();
+ photon2_state *state = machine.driver_data<photon2_state>();
state->spectrum_frame_number = 0;
state->spectrum_flash_invert = 0;
}
@@ -99,7 +99,7 @@ INLINE unsigned char get_display_color (unsigned char color, int invert)
independent of frame skip etc. */
static SCREEN_EOF( spectrum )
{
- photon2_state *state = machine->driver_data<photon2_state>();
+ photon2_state *state = machine.driver_data<photon2_state>();
state->spectrum_frame_number++;
if (state->spectrum_frame_number >= 25)
{
@@ -115,7 +115,7 @@ INLINE void spectrum_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color)
static SCREEN_UPDATE( spectrum )
{
- photon2_state *state = screen->machine->driver_data<photon2_state>();
+ photon2_state *state = screen->machine().driver_data<photon2_state>();
/* for now do a full-refresh */
int x, y, b, scrx, scry;
unsigned short ink, pap;
@@ -187,7 +187,7 @@ static WRITE8_HANDLER(photon2_membank_w)
logerror( "Unknown banking write: %02X\n", data);
}
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x4000*bank );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x4000*bank );
}
static READ8_HANDLER(photon2_fe_r)
@@ -197,8 +197,8 @@ static READ8_HANDLER(photon2_fe_r)
static WRITE8_HANDLER(photon2_fe_w)
{
- photon2_state *state = space->machine->driver_data<photon2_state>();
- device_t *speaker = space->machine->device("speaker");
+ photon2_state *state = space->machine().driver_data<photon2_state>();
+ device_t *speaker = space->machine().device("speaker");
state->spectrum_port_fe = data;
speaker_level_w(speaker, BIT(data,4));
@@ -206,7 +206,7 @@ static WRITE8_HANDLER(photon2_fe_w)
static WRITE8_HANDLER(photon2_misc_w)
{
- photon2_state *state = space->machine->driver_data<photon2_state>();
+ photon2_state *state = space->machine().driver_data<photon2_state>();
state->nmi_enable = !BIT(data,5);
}
@@ -285,7 +285,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( spec_interrupt_hack )
{
- photon2_state *state = device->machine->driver_data<photon2_state>();
+ photon2_state *state = device->machine().driver_data<photon2_state>();
if (cpu_getiloops(device) == 1)
{
device_set_input_line(device, 0, HOLD_LINE);
@@ -294,14 +294,14 @@ static INTERRUPT_GEN( spec_interrupt_hack )
{
if ( state->nmi_enable )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
}
static MACHINE_RESET( photon2 )
{
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
}
static MACHINE_CONFIG_START( photon2, photon2_state )
diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c
index 7aa92336eb2..f5a4c436e21 100644
--- a/src/mame/drivers/photoply.c
+++ b/src/mame/drivers/photoply.c
@@ -56,7 +56,7 @@ public:
visarea.max_x = _x_-1; \
visarea.min_y = 0; \
visarea.max_y = _y_-1; \
- machine->primary_screen->configure(_x_, _y_, visarea, machine->primary_screen->frame_period().attoseconds ); \
+ machine.primary_screen->configure(_x_, _y_, visarea, machine.primary_screen->frame_period().attoseconds ); \
} \
#define RES_320x200 0
@@ -66,9 +66,9 @@ static VIDEO_START(photoply)
{
}
-static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num)
+static void cga_alphanumeric_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 size,UINT32 map_offs,UINT8 gfx_num)
{
- photoply_state *state = machine->driver_data<photoply_state>();
+ photoply_state *state = machine.driver_data<photoply_state>();
UINT32 offs,x,y,max_x,max_y;
int tile,color;
@@ -97,7 +97,7 @@ static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,
tile = (state->vga_vram[offs] & 0x00ff0000)>>16;
color = (state->vga_vram[offs] & 0xff000000)>>24;
- drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num],
+ drawgfx_opaque(bitmap,cliprect,machine.gfx[gfx_num],
tile,
color,
0,0,
@@ -107,7 +107,7 @@ static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,
tile = (state->vga_vram[offs] & 0x000000ff);
color = (state->vga_vram[offs] & 0x0000ff00)>>8;
- drawgfx_opaque(bitmap,cliprect,machine->gfx[gfx_num],
+ drawgfx_opaque(bitmap,cliprect,machine.gfx[gfx_num],
tile,
color,
0,0,
@@ -120,7 +120,7 @@ static void cga_alphanumeric_tilemap(running_machine *machine, bitmap_t *bitmap,
static SCREEN_UPDATE(photoply)
{
- cga_alphanumeric_tilemap(screen->machine,bitmap,cliprect,RES_640x200,0x18000/4,0);
+ cga_alphanumeric_tilemap(screen->machine(),bitmap,cliprect,RES_640x200,0x18000/4,0);
return 0;
}
@@ -132,7 +132,7 @@ DMA8237 Controller
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -141,7 +141,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -151,7 +151,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static READ8_HANDLER(dma_page_select_r)
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8)
@@ -184,7 +184,7 @@ static READ8_HANDLER(dma_page_select_r)
static WRITE8_HANDLER(dma_page_select_w)
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -206,7 +206,7 @@ static WRITE8_HANDLER(dma_page_select_w)
static void set_dma_channel(device_t *device, int channel, int state)
{
- photoply_state *drvstate = device->machine->driver_data<photoply_state>();
+ photoply_state *drvstate = device->machine().driver_data<photoply_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -244,7 +244,7 @@ static I8237_INTERFACE( dma8237_2_config )
static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface pic8259_1_config =
@@ -259,7 +259,7 @@ static const struct pic8259_interface pic8259_2_config =
static IRQ_CALLBACK(irq_callback)
{
- photoply_state *state = device->machine->driver_data<photoply_state>();
+ photoply_state *state = device->machine().driver_data<photoply_state>();
int r = 0;
r = pic8259_acknowledge(state->pic8259_2);
if (r==0)
@@ -271,7 +271,7 @@ static IRQ_CALLBACK(irq_callback)
static WRITE_LINE_DEVICE_HANDLER( at_pit8254_out0_changed )
{
- photoply_state *drvstate = device->machine->driver_data<photoply_state>();
+ photoply_state *drvstate = device->machine().driver_data<photoply_state>();
if ( drvstate->pic8259_1 )
{
pic8259_ir0_w(drvstate->pic8259_1, state);
@@ -316,13 +316,13 @@ ADDRESS_MAP_END
static READ32_HANDLER( kludge_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
/* 3c8-3c9 -> ramdac*/
static WRITE32_HANDLER( vga_ramdac_w )
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
if (ACCESSING_BITS_0_7)
{
//printf("%02x X\n",data);
@@ -344,7 +344,7 @@ static WRITE32_HANDLER( vga_ramdac_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, 0x200+state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), 0x200+state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -354,7 +354,7 @@ static WRITE32_HANDLER( vga_ramdac_w )
static WRITE32_HANDLER( vga_regs_w )
{
- photoply_state *state = space->machine->driver_data<photoply_state>();
+ photoply_state *state = space->machine().driver_data<photoply_state>();
if (ACCESSING_BITS_0_7)
state->vga_address = data;
@@ -474,25 +474,25 @@ static PALETTE_INIT(pcat_286)
//todo: 256 colors
}
-static void photoply_set_keyb_int(running_machine *machine, int state)
+static void photoply_set_keyb_int(running_machine &machine, int state)
{
- photoply_state *drvstate = machine->driver_data<photoply_state>();
+ photoply_state *drvstate = machine.driver_data<photoply_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static MACHINE_START( photoply )
{
- photoply_state *state = machine->driver_data<photoply_state>();
+ photoply_state *state = machine.driver_data<photoply_state>();
// bank = -1;
// lastvalue = -1;
// hv_blank = 0;
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
- state->pit8253 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
+ state->pit8253 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, photoply_set_keyb_int);
}
diff --git a/src/mame/drivers/pingpong.c b/src/mame/drivers/pingpong.c
index 463e3d36b8c..bd184b2e157 100644
--- a/src/mame/drivers/pingpong.c
+++ b/src/mame/drivers/pingpong.c
@@ -15,7 +15,7 @@ Ping Pong (c) 1985 Konami
static WRITE8_HANDLER( cashquiz_question_bank_high_w )
{
- pingpong_state *state = space->machine->driver_data<pingpong_state>();
+ pingpong_state *state = space->machine().driver_data<pingpong_state>();
if( data != 0xff )
{
switch( ~data & 0xff )
@@ -50,14 +50,14 @@ static WRITE8_HANDLER( cashquiz_question_bank_high_w )
static WRITE8_HANDLER( cashquiz_question_bank_low_w )
{
- pingpong_state *state = space->machine->driver_data<pingpong_state>();
+ pingpong_state *state = space->machine().driver_data<pingpong_state>();
if(data >= 0x60 && data <= 0xdf)
{
static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" };
const char *bank = bankname[data & 7];
int bankaddr = state->question_addr_high | ((data - 0x60) * 0x100);
- UINT8 *questions = space->machine->region("user1")->base() + bankaddr;
- memory_set_bankptr(space->machine, bank,questions);
+ UINT8 *questions = space->machine().region("user1")->base() + bankaddr;
+ memory_set_bankptr(space->machine(), bank,questions);
}
}
@@ -65,20 +65,20 @@ static WRITE8_HANDLER( cashquiz_question_bank_low_w )
static WRITE8_HANDLER( coin_w )
{
- pingpong_state *state = space->machine->driver_data<pingpong_state>();
+ pingpong_state *state = space->machine().driver_data<pingpong_state>();
/* bit 2 = irq enable, bit 3 = nmi enable */
state->intenable = data & 0x0c;
/* bit 0/1 = coin counters */
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
/* other bits unknown */
}
static INTERRUPT_GEN( pingpong_interrupt )
{
- pingpong_state *state = device->machine->driver_data<pingpong_state>();
+ pingpong_state *state = device->machine().driver_data<pingpong_state>();
if (cpu_getiloops(device) == 0)
{
if (state->intenable & 0x04) device_set_input_line(device, 0, HOLD_LINE);
@@ -567,7 +567,7 @@ ROM_END
static DRIVER_INIT( merlinmm )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
/* decrypt program code */
@@ -581,38 +581,38 @@ static DRIVER_INIT( cashquiz )
int i;
/* decrypt program code */
- ROM = machine->region("maincpu")->base();
+ ROM = machine.region("maincpu")->base();
for( i = 0; i < 0x4000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
/* decrypt questions */
- ROM = machine->region("user1")->base();
+ ROM = machine.region("user1")->base();
for( i = 0; i < 0x40000; i++ )
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
/* questions banking handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4000, 0x4000, FUNC(cashquiz_question_bank_high_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4001, 0x4001, FUNC(cashquiz_question_bank_low_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4000, 0x4000, FUNC(cashquiz_question_bank_high_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4001, 0x4001, FUNC(cashquiz_question_bank_low_w));
// 8 independents banks for questions
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x50ff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5100, 0x51ff, "bank2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5200, 0x52ff, "bank3");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5300, 0x53ff, "bank4");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5400, 0x54ff, "bank5");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5500, 0x55ff, "bank6");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5600, 0x56ff, "bank7");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x50ff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5100, 0x51ff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5200, 0x52ff, "bank3");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5300, 0x53ff, "bank4");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5400, 0x54ff, "bank5");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5500, 0x55ff, "bank6");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5600, 0x56ff, "bank7");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5700, 0x57ff, "bank8");
// setup default banks
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0x100*0 );
- memory_set_bankptr(machine, "bank2", machine->region("user1")->base() + 0x100*1 );
- memory_set_bankptr(machine, "bank3", machine->region("user1")->base() + 0x100*2 );
- memory_set_bankptr(machine, "bank4", machine->region("user1")->base() + 0x100*3 );
- memory_set_bankptr(machine, "bank5", machine->region("user1")->base() + 0x100*4 );
- memory_set_bankptr(machine, "bank6", machine->region("user1")->base() + 0x100*5 );
- memory_set_bankptr(machine, "bank7", machine->region("user1")->base() + 0x100*6 );
- memory_set_bankptr(machine, "bank8", machine->region("user1")->base() + 0x100*7 );
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0x100*0 );
+ memory_set_bankptr(machine, "bank2", machine.region("user1")->base() + 0x100*1 );
+ memory_set_bankptr(machine, "bank3", machine.region("user1")->base() + 0x100*2 );
+ memory_set_bankptr(machine, "bank4", machine.region("user1")->base() + 0x100*3 );
+ memory_set_bankptr(machine, "bank5", machine.region("user1")->base() + 0x100*4 );
+ memory_set_bankptr(machine, "bank6", machine.region("user1")->base() + 0x100*5 );
+ memory_set_bankptr(machine, "bank7", machine.region("user1")->base() + 0x100*6 );
+ memory_set_bankptr(machine, "bank8", machine.region("user1")->base() + 0x100*7 );
}
diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c
index 9acfeff770f..59370e1e2f5 100644
--- a/src/mame/drivers/pinkiri8.c
+++ b/src/mame/drivers/pinkiri8.c
@@ -122,7 +122,7 @@ device_config *janshi_vdp_device_config::static_alloc_device_config(const machin
device_t *janshi_vdp_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, janshi_vdp_device(machine, *this));
+ return auto_alloc(machine, janshi_vdp_device(machine, *this));
}
void janshi_vdp_device_config::device_config_complete()
@@ -205,15 +205,15 @@ ronjan
static SCREEN_UPDATE( pinkiri8 )
{
- pinkiri8_state *state = screen->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = screen->machine().driver_data<pinkiri8_state>();
int col_bank;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int game_type_hack = 0;
- if (!strcmp(screen->machine->system().name,"janshi")) game_type_hack = 1;
+ if (!strcmp(screen->machine().system().name,"janshi")) game_type_hack = 1;
- if ( input_code_pressed_once(screen->machine, KEYCODE_W) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_W) )
{
int i;
int count2;
@@ -243,7 +243,7 @@ static SCREEN_UPDATE( pinkiri8 )
//popmessage("%02x",state->janshi_crtc_regs[0x0a]);
col_bank = (state->janshi_crtc_regs[0x0a] & 0x40) >> 6;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* FIXME: color is a bit of a mystery */
{
@@ -317,7 +317,7 @@ static SCREEN_UPDATE( pinkiri8 )
if (bit)
{
- //col = screen->machine->rand();
+ //col = screen->machine().rand();
width = 2;
}
else
@@ -417,7 +417,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( output_regs_w )
{
if(data & 0x40)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
//data & 0x80 is probably NMI mask
}
@@ -426,7 +426,7 @@ static WRITE8_HANDLER( output_regs_w )
static WRITE8_HANDLER( pinkiri8_vram_w )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
switch(offset)
{
case 0:
@@ -447,7 +447,7 @@ static WRITE8_HANDLER( pinkiri8_vram_w )
case 3:
- address_space *vdp_space = space->machine->device<janshi_vdp_device>("janshivdp")->space();
+ address_space *vdp_space = space->machine().device<janshi_vdp_device>("janshivdp")->space();
if (LOG_VRAM) printf("%02x ", data);
state->prev_writes++;
@@ -461,20 +461,20 @@ static WRITE8_HANDLER( pinkiri8_vram_w )
static WRITE8_HANDLER( mux_w )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
state->mux_data = data;
}
static READ8_HANDLER( mux_p2_r )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "PL2_01");
- case 0x02: return input_port_read(space->machine, "PL2_02");
- case 0x04: return input_port_read(space->machine, "PL2_03");
- case 0x08: return input_port_read(space->machine, "PL2_04");
- case 0x10: return input_port_read(space->machine, "PL2_05");
+ case 0x01: return input_port_read(space->machine(), "PL2_01");
+ case 0x02: return input_port_read(space->machine(), "PL2_02");
+ case 0x04: return input_port_read(space->machine(), "PL2_03");
+ case 0x08: return input_port_read(space->machine(), "PL2_04");
+ case 0x10: return input_port_read(space->machine(), "PL2_05");
}
return 0xff;
@@ -482,14 +482,14 @@ static READ8_HANDLER( mux_p2_r )
static READ8_HANDLER( mux_p1_r )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "PL1_01");
- case 0x02: return input_port_read(space->machine, "PL1_02");
- case 0x04: return input_port_read(space->machine, "PL1_03");
- case 0x08: return input_port_read(space->machine, "PL1_04");
- case 0x10: return input_port_read(space->machine, "PL1_05");
+ case 0x01: return input_port_read(space->machine(), "PL1_01");
+ case 0x02: return input_port_read(space->machine(), "PL1_02");
+ case 0x04: return input_port_read(space->machine(), "PL1_03");
+ case 0x08: return input_port_read(space->machine(), "PL1_04");
+ case 0x10: return input_port_read(space->machine(), "PL1_05");
}
return 0xff;
@@ -1209,7 +1209,7 @@ ROM_END
static READ8_HANDLER( ronjan_prot_r )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
static const char wing_str[6] = { 'W', 'I', 'N', 'G', '8', '9' };
state->prot_read_index++;
@@ -1222,7 +1222,7 @@ static READ8_HANDLER( ronjan_prot_r )
static WRITE8_HANDLER( ronjan_prot_w )
{
- pinkiri8_state *state = space->machine->driver_data<pinkiri8_state>();
+ pinkiri8_state *state = space->machine().driver_data<pinkiri8_state>();
if(data == 0)
{
@@ -1250,9 +1250,9 @@ static READ8_HANDLER( ronjan_patched_prot_r )
static DRIVER_INIT( ronjan )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x90, 0x90, FUNC(ronjan_prot_r), FUNC(ronjan_prot_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x66, 0x66, FUNC(ronjan_prot_status_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x9f, 0x9f, FUNC(ronjan_patched_prot_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x90, 0x90, FUNC(ronjan_prot_r), FUNC(ronjan_prot_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x66, 0x66, FUNC(ronjan_prot_status_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x9f, 0x9f, FUNC(ronjan_patched_prot_r));
}
GAME( 1992, janshi, 0, pinkiri8, janshi, 0, ROT0, "Eagle", "Janshi", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c
index 23ccde46d7a..09e511a97c2 100644
--- a/src/mame/drivers/pipedrm.c
+++ b/src/mame/drivers/pipedrm.c
@@ -187,7 +187,7 @@ static WRITE8_HANDLER( pipedrm_bankswitch_w )
*/
/* set the memory bank on the Z80 using the low 3 bits */
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
/* map to the fromance gfx register */
fromance_gfxreg_w(space, offset, ((data >> 6) & 0x01) | /* flipscreen */
@@ -197,7 +197,7 @@ static WRITE8_HANDLER( pipedrm_bankswitch_w )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x01);
+ memory_set_bank(space->machine(), "bank2", data & 0x01);
}
@@ -210,7 +210,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
static TIMER_CALLBACK( delayed_command_w )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
state->sound_command = param & 0xff;
state->pending_command = 1;
@@ -224,19 +224,19 @@ static TIMER_CALLBACK( delayed_command_w )
static WRITE8_HANDLER( sound_command_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_command_w), data | 0x100);
+ space->machine().scheduler().synchronize(FUNC(delayed_command_w), data | 0x100);
}
static WRITE8_HANDLER( sound_command_nonmi_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_command_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_command_w), data);
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->pending_command = 0;
device_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -244,14 +244,14 @@ static WRITE8_HANDLER( pending_command_clear_w )
static READ8_HANDLER( pending_command_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
return state->pending_command;
}
static READ8_HANDLER( sound_command_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
return state->sound_command;
}
@@ -558,7 +558,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- fromance_state *state = device->machine->driver_data<fromance_state>();
+ fromance_state *state = device->machine().driver_data<fromance_state>();
device_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -589,16 +589,16 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( pipedrm )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
/* initialize main Z80 bank */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x2000);
memory_set_bank(machine, "bank1", 0);
/* initialize sound bank */
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("sub")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("sub")->base() + 0x10000, 0x8000);
memory_set_bank(machine, "bank2", 0);
/* state save */
@@ -610,7 +610,7 @@ static MACHINE_START( pipedrm )
static MACHINE_RESET( pipedrm )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
int i;
state->pending_command = 0;
@@ -877,19 +877,19 @@ ROM_END
static DRIVER_INIT( pipedrm )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
/* sprite RAM lives at the end of palette RAM */
- state->spriteram = &machine->generic.paletteram.u8[0xc00];
+ state->spriteram = &machine.generic.paletteram.u8[0xc00];
state->spriteram_size = 0x400;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xcc00, 0xcfff, state->spriteram);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xcc00, 0xcfff, state->spriteram);
}
static DRIVER_INIT( hatris )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, FUNC(sound_command_nonmi_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x21, 0x21, FUNC(fromance_gfxreg_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, FUNC(sound_command_nonmi_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x21, 0x21, FUNC(fromance_gfxreg_w));
}
diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c
index f80937d779c..34b2c5f313b 100644
--- a/src/mame/drivers/pipeline.c
+++ b/src/mame/drivers/pipeline.c
@@ -92,7 +92,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- pipeline_state *state = machine->driver_data<pipeline_state>();
+ pipeline_state *state = machine.driver_data<pipeline_state>();
int code = state->vram2[tile_index]+state->vram2[tile_index+0x800]*256;
SET_TILE_INFO(
0,
@@ -103,7 +103,7 @@ static TILE_GET_INFO( get_tile_info )
static TILE_GET_INFO( get_tile_info2 )
{
- pipeline_state *state = machine->driver_data<pipeline_state>();
+ pipeline_state *state = machine.driver_data<pipeline_state>();
int code =state->vram1[tile_index]+((state->vram1[tile_index+0x800]>>4))*256;
int color=((state->vram1[tile_index+0x800])&0xf);
SET_TILE_INFO
@@ -117,7 +117,7 @@ static TILE_GET_INFO( get_tile_info2 )
static VIDEO_START ( pipeline )
{
- pipeline_state *state = machine->driver_data<pipeline_state>();
+ pipeline_state *state = machine.driver_data<pipeline_state>();
state->palram=auto_alloc_array(machine, UINT8, 0x1000);
state->tilemap1 = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,64,32 );
state->tilemap2 = tilemap_create( machine, get_tile_info2,tilemap_scan_rows,8,8,64,32 );
@@ -126,7 +126,7 @@ static VIDEO_START ( pipeline )
static SCREEN_UPDATE( pipeline )
{
- pipeline_state *state = screen->machine->driver_data<pipeline_state>();
+ pipeline_state *state = screen->machine().driver_data<pipeline_state>();
tilemap_draw(bitmap,cliprect,state->tilemap1, 0,0);
tilemap_draw(bitmap,cliprect,state->tilemap2, 0,0);
return 0;
@@ -135,13 +135,13 @@ static SCREEN_UPDATE( pipeline )
static WRITE8_DEVICE_HANDLER(vidctrl_w)
{
- pipeline_state *state = device->machine->driver_data<pipeline_state>();
+ pipeline_state *state = device->machine().driver_data<pipeline_state>();
state->vidctrl=data;
}
static WRITE8_HANDLER(vram2_w)
{
- pipeline_state *state = space->machine->driver_data<pipeline_state>();
+ pipeline_state *state = space->machine().driver_data<pipeline_state>();
if(!(state->vidctrl&1))
{
tilemap_mark_tile_dirty(state->tilemap1,offset&0x7ff);
@@ -153,34 +153,34 @@ static WRITE8_HANDLER(vram2_w)
if(offset<0x300)
{
offset&=0xff;
- palette_set_color_rgb(space->machine, offset, pal6bit(state->palram[offset]), pal6bit(state->palram[offset+0x100]), pal6bit(state->palram[offset+0x200]));
+ palette_set_color_rgb(space->machine(), offset, pal6bit(state->palram[offset]), pal6bit(state->palram[offset+0x100]), pal6bit(state->palram[offset+0x200]));
}
}
}
static WRITE8_HANDLER(vram1_w)
{
- pipeline_state *state = space->machine->driver_data<pipeline_state>();
+ pipeline_state *state = space->machine().driver_data<pipeline_state>();
tilemap_mark_tile_dirty(state->tilemap2,offset&0x7ff);
state->vram1[offset]=data;
}
static READ8_DEVICE_HANDLER(protection_r)
{
- pipeline_state *state = device->machine->driver_data<pipeline_state>();
+ pipeline_state *state = device->machine().driver_data<pipeline_state>();
return state->fromMCU;
}
static TIMER_CALLBACK( protection_deferred_w )
{
- pipeline_state *state = machine->driver_data<pipeline_state>();
+ pipeline_state *state = machine.driver_data<pipeline_state>();
state->toMCU = param;
}
static WRITE8_DEVICE_HANDLER(protection_w)
{
- device->machine->scheduler().synchronize(FUNC(protection_deferred_w), data);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ device->machine().scheduler().synchronize(FUNC(protection_deferred_w), data);
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static ADDRESS_MAP_START( cpu0_mem, AS_PROGRAM, 8 )
@@ -208,19 +208,19 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(mcu_portA_w)
{
- pipeline_state *state = space->machine->driver_data<pipeline_state>();
+ pipeline_state *state = space->machine().driver_data<pipeline_state>();
state->fromMCU=data;
}
static READ8_HANDLER(mcu_portA_r)
{
- pipeline_state *state = space->machine->driver_data<pipeline_state>();
+ pipeline_state *state = space->machine().driver_data<pipeline_state>();
return (state->fromMCU&state->ddrA)|(state->toMCU& ~state->ddrA);
}
static WRITE8_HANDLER(mcu_ddrA_w)
{
- pipeline_state *state = space->machine->driver_data<pipeline_state>();
+ pipeline_state *state = space->machine().driver_data<pipeline_state>();
state->ddrA=data;
}
@@ -365,8 +365,8 @@ static const ym2203_interface ym2203_config =
static PALETTE_INIT(pipeline)
{
int r,g,b,i,c;
- UINT8 *prom1 = &machine->region("proms")->base()[0x000];
- UINT8 *prom2 = &machine->region("proms")->base()[0x100];
+ UINT8 *prom1 = &machine.region("proms")->base()[0x000];
+ UINT8 *prom2 = &machine.region("proms")->base()[0x100];
for(i=0;i<0x100;i++)
{
diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c
index 55a37802e1f..9dce2ea233f 100644
--- a/src/mame/drivers/pirates.c
+++ b/src/mame/drivers/pirates.c
@@ -109,7 +109,7 @@ static WRITE16_HANDLER( pirates_out_w )
{
if (ACCESSING_BITS_0_7)
{
- eeprom_device *eeprom = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
/* bits 0-2 control EEPROM */
eeprom_write_bit(eeprom, data & 0x04);
@@ -117,7 +117,7 @@ static WRITE16_HANDLER( pirates_out_w )
eeprom_set_clock_line(eeprom, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
/* bit 6 selects oki bank */
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x40) ? 0x40000 : 0x00000);
/* bit 7 used (function unknown) */
@@ -132,14 +132,14 @@ static CUSTOM_INPUT( prot_r )
// offs_t pc;
int bit;
-// logerror("%s: IN1_r\n",field->port->machine->describe_context());
+// logerror("%s: IN1_r\n",field->port->machine().describe_context());
#if 0
/* Pirates protection workaround. It more complicated than this... see code at
602e and 62a6 */
/* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */
- pc = cpu_get_pc(field->port->machine->device("main"));
+ pc = cpu_get_pc(field->port->machine().device("main"));
if (pc == 0x6134)
{
bit = prot & 1;
@@ -337,17 +337,17 @@ ROM_END
/* Init */
-static void pirates_decrypt_68k(running_machine *machine)
+static void pirates_decrypt_68k(running_machine &machine)
{
int rom_size;
UINT16 *buf, *rom;
int i;
- rom_size = machine->region("maincpu")->bytes();
+ rom_size = machine.region("maincpu")->bytes();
buf = auto_alloc_array(machine, UINT16, rom_size/2);
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/2; i++)
@@ -366,17 +366,17 @@ static void pirates_decrypt_68k(running_machine *machine)
auto_free (machine, buf);
}
-static void pirates_decrypt_p(running_machine *machine)
+static void pirates_decrypt_p(running_machine &machine)
{
int rom_size;
UINT8 *buf, *rom;
int i;
- rom_size = machine->region("gfx1")->bytes();
+ rom_size = machine.region("gfx1")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -390,17 +390,17 @@ static void pirates_decrypt_p(running_machine *machine)
auto_free (machine, buf);
}
-static void pirates_decrypt_s(running_machine *machine)
+static void pirates_decrypt_s(running_machine &machine)
{
int rom_size;
UINT8 *buf, *rom;
int i;
- rom_size = machine->region("gfx2")->bytes();
+ rom_size = machine.region("gfx2")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine->region("gfx2")->base();
+ rom = machine.region("gfx2")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size/4; i++)
@@ -415,17 +415,17 @@ static void pirates_decrypt_s(running_machine *machine)
}
-static void pirates_decrypt_oki(running_machine *machine)
+static void pirates_decrypt_oki(running_machine &machine)
{
int rom_size;
UINT8 *buf, *rom;
int i;
- rom_size = machine->region("oki")->bytes();
+ rom_size = machine.region("oki")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine->region("oki")->base();
+ rom = machine.region("oki")->base();
memcpy (buf, rom, rom_size);
for (i=0; i<rom_size; i++)
@@ -439,7 +439,7 @@ static void pirates_decrypt_oki(running_machine *machine)
static DRIVER_INIT( pirates )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
pirates_decrypt_68k(machine);
pirates_decrypt_p(machine);
@@ -461,7 +461,7 @@ static DRIVER_INIT( genix )
/* If this value is increased then something has gone wrong and the protection failed */
/* Write-protect it for now */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x109e98, 0x109e9b, FUNC(genix_prot_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x109e98, 0x109e9b, FUNC(genix_prot_r) );
}
diff --git a/src/mame/drivers/pitnrun.c b/src/mame/drivers/pitnrun.c
index 49abd250a5a..41fd74b76ef 100644
--- a/src/mame/drivers/pitnrun.c
+++ b/src/mame/drivers/pitnrun.c
@@ -72,24 +72,24 @@ K1000233A
static INTERRUPT_GEN( pitnrun_nmi_source )
{
- pitnrun_state *state = device->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = device->machine().driver_data<pitnrun_state>();
if(state->nmi) device_set_input_line(device,INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->nmi = data & 1;
}
static WRITE8_HANDLER(pitnrun_hflip_w)
{
- flip_screen_x_set(space->machine, data);
+ flip_screen_x_set(space->machine(), data);
}
static WRITE8_HANDLER(pitnrun_vflip_w)
{
- flip_screen_y_set(space->machine, data);
+ flip_screen_y_set(space->machine(), data);
}
static ADDRESS_MAP_START( pitnrun_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/pkscram.c b/src/mame/drivers/pkscram.c
index 234c33aed73..acd78b1672c 100644
--- a/src/mame/drivers/pkscram.c
+++ b/src/mame/drivers/pkscram.c
@@ -39,21 +39,21 @@ enum { interrupt_scanline=192 };
static WRITE16_HANDLER( pkscramble_fgtilemap_w )
{
- pkscram_state *state = space->machine->driver_data<pkscram_state>();
+ pkscram_state *state = space->machine().driver_data<pkscram_state>();
COMBINE_DATA(&state->pkscramble_fgtilemap_ram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset >> 1);
}
static WRITE16_HANDLER( pkscramble_mdtilemap_w )
{
- pkscram_state *state = space->machine->driver_data<pkscram_state>();
+ pkscram_state *state = space->machine().driver_data<pkscram_state>();
COMBINE_DATA(&state->pkscramble_mdtilemap_ram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap, offset >> 1);
}
static WRITE16_HANDLER( pkscramble_bgtilemap_w )
{
- pkscram_state *state = space->machine->driver_data<pkscram_state>();
+ pkscram_state *state = space->machine().driver_data<pkscram_state>();
COMBINE_DATA(&state->pkscramble_bgtilemap_ram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
}
@@ -62,7 +62,7 @@ static WRITE16_HANDLER( pkscramble_bgtilemap_w )
// it should stay high for some time (currently we cheat keeping the input always active)
static WRITE16_HANDLER( pkscramble_output_w )
{
- pkscram_state *state = space->machine->driver_data<pkscram_state>();
+ pkscram_state *state = space->machine().driver_data<pkscram_state>();
// OUTPUT
// BIT
// 0x0001 -> STL
@@ -87,11 +87,11 @@ static WRITE16_HANDLER( pkscramble_output_w )
if (!(state->out & 0x2000) && state->interrupt_line_active)
{
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
state->interrupt_line_active = 0;
}
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
}
static ADDRESS_MAP_START( pkscramble_map, AS_PROGRAM, 16 )
@@ -183,7 +183,7 @@ INPUT_PORTS_END
static TILE_GET_INFO( get_bg_tile_info )
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
int tile = state->pkscramble_bgtilemap_ram[tile_index*2];
int color = state->pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f;
@@ -192,7 +192,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_md_tile_info )
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
int tile = state->pkscramble_mdtilemap_ram[tile_index*2];
int color = state->pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f;
@@ -201,7 +201,7 @@ static TILE_GET_INFO( get_md_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
int tile = state->pkscramble_fgtilemap_ram[tile_index*2];
int color = state->pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f;
@@ -210,26 +210,26 @@ static TILE_GET_INFO( get_fg_tile_info )
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- pkscram_state *state = timer.machine->driver_data<pkscram_state>();
+ pkscram_state *state = timer.machine().driver_data<pkscram_state>();
if (param == interrupt_scanline)
{
if (state->out & 0x2000)
- cputag_set_input_line(timer.machine, "maincpu", 1, ASSERT_LINE);
- timer.adjust(timer.machine->primary_screen->time_until_pos(param + 1), param+1);
+ cputag_set_input_line(timer.machine(), "maincpu", 1, ASSERT_LINE);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(param + 1), param+1);
state->interrupt_line_active = 1;
}
else
{
if (state->interrupt_line_active)
- cputag_set_input_line(timer.machine, "maincpu", 1, CLEAR_LINE);
- timer.adjust(timer.machine->primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline);
+ cputag_set_input_line(timer.machine(), "maincpu", 1, CLEAR_LINE);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline);
state->interrupt_line_active = 0;
}
}
static VIDEO_START( pkscramble )
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8,32,32);
state->md_tilemap = tilemap_create(machine, get_md_tile_info, tilemap_scan_rows, 8, 8,32,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8,32,32);
@@ -240,7 +240,7 @@ static VIDEO_START( pkscramble )
static SCREEN_UPDATE( pkscramble )
{
- pkscram_state *state = screen->machine->driver_data<pkscram_state>();
+ pkscram_state *state = screen->machine().driver_data<pkscram_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->md_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
@@ -265,9 +265,9 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- pkscram_state *state = device->machine->driver_data<pkscram_state>();
+ pkscram_state *state = device->machine().driver_data<pkscram_state>();
if(state->out & 0x10)
- cputag_set_input_line(device->machine, "maincpu", 2, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 2, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -282,18 +282,18 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( pkscramble)
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
state_save_register_global(machine, state->out);
state_save_register_global(machine, state->interrupt_line_active);
}
static MACHINE_RESET( pkscramble)
{
- pkscram_state *state = machine->driver_data<pkscram_state>();
+ pkscram_state *state = machine.driver_data<pkscram_state>();
state->out = 0;
state->interrupt_line_active=0;
- timer_device *scanline_timer = machine->device<timer_device>("scan_timer");
- scanline_timer->adjust(machine->primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline);
+ timer_device *scanline_timer = machine.device<timer_device>("scan_timer");
+ scanline_timer->adjust(machine.primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline);
}
static MACHINE_CONFIG_START( pkscramble, pkscram_state )
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index 77e7c19485a..f52126b503a 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -319,10 +319,10 @@ static const deco16ic_interface pktgaldx_deco16ic_tilegen1_intf =
static MACHINE_START( pktgaldx )
{
- pktgaldx_state *state = machine->driver_data<pktgaldx_state>();
+ pktgaldx_state *state = machine.driver_data<pktgaldx_state>();
- state->maincpu = machine->device("maincpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state )
diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c
index c7e65255177..cdd6e76cd8a 100644
--- a/src/mame/drivers/playch10.c
+++ b/src/mame/drivers/playch10.c
@@ -309,13 +309,13 @@ Notes & Todo:
static WRITE8_HANDLER( up8w_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->up_8w = data & 1;
}
static READ8_HANDLER( ram_8w_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
if ( offset >= 0x400 && state->up_8w )
return state->ram_8w[offset];
@@ -324,7 +324,7 @@ static READ8_HANDLER( ram_8w_r )
static WRITE8_HANDLER( ram_8w_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
if ( offset >= 0x400 && state->up_8w )
state->ram_8w[offset] = data;
else
@@ -334,14 +334,14 @@ static WRITE8_HANDLER( ram_8w_w )
static WRITE8_HANDLER( sprite_dma_w )
{
int source = ( data & 7 );
- ppu2c0x_spriteram_dma( space, space->machine->device("ppu"), source );
+ ppu2c0x_spriteram_dma( space, space->machine().device("ppu"), source );
}
/* Only used in single monitor bios */
static WRITE8_HANDLER( time_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
if(data == 0xf)
data = 0;
@@ -657,7 +657,7 @@ static GFXDECODE_START( playch10 )
GFXDECODE_END
static INTERRUPT_GEN( playch10_interrupt ) {
- playch10_state *state = device->machine->driver_data<playch10_state>();
+ playch10_state *state = device->machine().driver_data<playch10_state>();
/* LS161A, Sheet 1 - bottom left of Z80 */
if ( !state->pc10_dog_di && !state->pc10_nmi_enable ) {
diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c
index 6ca0bf0e2b0..c5781866704 100644
--- a/src/mame/drivers/playmark.c
+++ b/src/mame/drivers/playmark.c
@@ -53,8 +53,8 @@ static WRITE16_HANDLER( coinctrl_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
}
if (data & 0xfcff)
logerror("Writing %04x to unknown coin control bits\n", data);
@@ -82,15 +82,15 @@ static const eeprom_interface eeprom_intf =
static WRITE16_HANDLER( wbeachvl_coin_eeprom_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
if (ACCESSING_BITS_0_7)
{
/* bits 0-3 are coin counters? (only 0 used?) */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
- coin_counter_w(space->machine, 3, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
+ coin_counter_w(space->machine(), 3, data & 0x08);
/* bits 5-7 control EEPROM */
eeprom_set_cs_line(state->eeprom, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
@@ -101,11 +101,11 @@ static WRITE16_HANDLER( wbeachvl_coin_eeprom_w )
static WRITE16_HANDLER( hotmind_coin_eeprom_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x20);
+ coin_counter_w(space->machine(), 0,data & 0x20);
eeprom_set_cs_line(state->eeprom, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
eeprom_write_bit(state->eeprom, data & 4);
@@ -115,13 +115,13 @@ static WRITE16_HANDLER( hotmind_coin_eeprom_w )
static WRITE16_HANDLER( hrdtimes_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE16_HANDLER( playmark_snd_command_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
if (ACCESSING_BITS_0_7)
{
@@ -133,7 +133,7 @@ static WRITE16_HANDLER( playmark_snd_command_w )
static READ8_HANDLER( playmark_snd_command_r )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
int data = 0;
if ((state->oki_control & 0x38) == 0x30)
@@ -152,7 +152,7 @@ static READ8_HANDLER( playmark_snd_command_r )
static READ8_HANDLER( playmark_snd_flag_r )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
if (state->snd_flag)
{
@@ -166,13 +166,13 @@ static READ8_HANDLER( playmark_snd_flag_r )
static WRITE8_DEVICE_HANDLER( playmark_oki_banking_w )
{
- playmark_state *state = device->machine->driver_data<playmark_state>();
+ playmark_state *state = device->machine().driver_data<playmark_state>();
if (state->old_oki_bank != (data & 7))
{
state->old_oki_bank = data & 7;
- if (((state->old_oki_bank - 1) * 0x40000) < device->machine->region("oki")->bytes())
+ if (((state->old_oki_bank - 1) * 0x40000) < device->machine().region("oki")->bytes())
{
downcast<okim6295_device *>(device)->set_bank_base(0x40000 * (state->old_oki_bank - 1));
}
@@ -181,14 +181,14 @@ static WRITE8_DEVICE_HANDLER( playmark_oki_banking_w )
static WRITE8_HANDLER( playmark_oki_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
state->oki_command = data;
}
static WRITE8_HANDLER( playmark_snd_control_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
-// address_space *space = device->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ playmark_state *state = space->machine().driver_data<playmark_state>();
+// address_space *space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* This port controls communications to and from the 68K, and the OKI
device.
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( playmark_snd_control_w )
if ((data & 0x38) == 0x18)
{
// logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",cpu_get_previouspc(space->cpu),playmark_oki_command,playmark_oki_control,playmark_snd_command);
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->write(*space, 0, state->oki_command);
}
}
@@ -1035,10 +1035,10 @@ GFXDECODE_END
static MACHINE_START( playmark )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
- state->oki = machine->device<okim6295_device>("oki");
- state->eeprom = machine->device("eeprom");
+ state->oki = machine.device<okim6295_device>("oki");
+ state->eeprom = machine.device("eeprom");
state->save_item(NAME(state->bgscrollx));
state->save_item(NAME(state->bgscrolly));
@@ -1057,7 +1057,7 @@ static MACHINE_START( playmark )
static MACHINE_RESET( playmark )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->bgscrollx = 0;
state->bgscrolly = 0;
@@ -1642,9 +1642,9 @@ static UINT8 playmark_asciitohex(UINT8 data)
static DRIVER_INIT( bigtwin )
{
- playmark_state *state = machine->driver_data<playmark_state>();
- UINT8 *playmark_PICROM_HEX = machine->region("user1")->base();
- UINT16 *playmark_PICROM = (UINT16 *)machine->region("audiocpu")->base();
+ playmark_state *state = machine.driver_data<playmark_state>();
+ UINT8 *playmark_PICROM_HEX = machine.region("user1")->base();
+ UINT16 *playmark_PICROM = (UINT16 *)machine.region("audiocpu")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
@@ -1698,7 +1698,7 @@ static DRIVER_INIT( bigtwin )
data_lo = playmark_asciitohex((playmark_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- pic16c5x_set_config(machine->device("audiocpu"), data);
+ pic16c5x_set_config(machine.device("audiocpu"), data);
src_pos = 0x7fff; /* Force Exit */
}
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index d20e941639c..29f6a7cb38f 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -109,8 +109,8 @@ static READ32_DEVICE_HANDLER( polygonet_eeprom_r )
}
else
{
- UINT8 lowInputBits = input_port_read(device->machine, "IN1");
- UINT8 highInputBits = input_port_read(device->machine, "IN0");
+ UINT8 lowInputBits = input_port_read(device->machine(), "IN1");
+ UINT8 highInputBits = input_port_read(device->machine(), "IN0");
return ((highInputBits << 24) | (lowInputBits << 16));
}
@@ -123,7 +123,7 @@ static WRITE32_HANDLER( polygonet_eeprom_w )
{
if (ACCESSING_BITS_24_31)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xffffffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffffffff);
return;
}
@@ -134,7 +134,7 @@ static WRITE32_HANDLER( polygonet_eeprom_w )
static READ32_HANDLER( ttl_rom_r )
{
UINT32 *ROM;
- ROM = (UINT32 *)space->machine->region("gfx1")->base();
+ ROM = (UINT32 *)space->machine().region("gfx1")->base();
return ROM[offset];
}
@@ -143,7 +143,7 @@ static READ32_HANDLER( ttl_rom_r )
static READ32_HANDLER( psac_rom_r )
{
UINT32 *ROM;
- ROM = (UINT32 *)space->machine->region("gfx2")->base();
+ ROM = (UINT32 *)space->machine().region("gfx2")->base();
return ROM[offset];
}
@@ -181,7 +181,7 @@ static WRITE32_HANDLER( sound_w )
static WRITE32_HANDLER( sound_irq_w )
{
- cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, HOLD_LINE);
}
/* DSP communications */
@@ -193,7 +193,7 @@ static READ32_HANDLER( dsp_host_interface_r )
if (mem_mask == 0x0000ff00) { hi_addr++; } /* Low byte */
if (mem_mask == 0xff000000) {} /* High byte */
- value = dsp56k_host_interface_read(space->machine->device("dsp"), hi_addr);
+ value = dsp56k_host_interface_read(space->machine().device("dsp"), hi_addr);
if (mem_mask == 0x0000ff00) { value <<= 8; }
if (mem_mask == 0xff000000) { value <<= 24; }
@@ -205,7 +205,7 @@ static READ32_HANDLER( dsp_host_interface_r )
static WRITE32_HANDLER( shared_ram_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
COMBINE_DATA(&state->shared_ram[offset]) ;
@@ -252,16 +252,16 @@ static WRITE32_HANDLER( dsp_w_lines )
if ((data >> 24) & 0x01)
{
// logerror("RESET CLEARED\n");
- cputag_set_input_line(space->machine, "dsp", DSP56K_IRQ_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", DSP56K_IRQ_RESET, CLEAR_LINE);
}
else
{
// logerror("RESET ASSERTED\n");
- cputag_set_input_line(space->machine, "dsp", DSP56K_IRQ_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", DSP56K_IRQ_RESET, ASSERT_LINE);
/* A little hacky - I can't seem to set these lines anywhere else where reset is asserted, so i do it here */
- cputag_set_input_line(space->machine, "dsp", DSP56K_IRQ_MODA, ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp", DSP56K_IRQ_MODB, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", DSP56K_IRQ_MODA, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", DSP56K_IRQ_MODB, CLEAR_LINE);
}
/* 0x04000000 is the COMBNK line - it switches who has access to the shared RAM - the dsp or the 68020 */
@@ -279,7 +279,7 @@ static WRITE32_HANDLER( dsp_host_interface_w )
if (mem_mask == 0xff000000) { hi_data = (data & 0xff000000) >> 24; }
logerror("write (host-side) %08x %08x %08x (HI %04x)\n", offset, mem_mask, data, hi_addr);
- dsp56k_host_interface_write(space->machine->device("dsp"), hi_addr, hi_data);
+ dsp56k_host_interface_write(space->machine().device("dsp"), hi_addr, hi_data);
}
@@ -293,13 +293,13 @@ static WRITE32_HANDLER( plygonet_palette_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
@@ -395,7 +395,7 @@ static UINT8 dsp56k_bank_num(device_t* cpu, UINT8 bank_group)
/* BANK HANDLERS */
static READ16_HANDLER( dsp56k_ram_bank00_read )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size);
@@ -405,7 +405,7 @@ static READ16_HANDLER( dsp56k_ram_bank00_read )
static WRITE16_HANDLER( dsp56k_ram_bank00_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size);
@@ -416,7 +416,7 @@ static WRITE16_HANDLER( dsp56k_ram_bank00_write )
static READ16_HANDLER( dsp56k_ram_bank01_read )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size);
@@ -426,7 +426,7 @@ static READ16_HANDLER( dsp56k_ram_bank01_read )
static WRITE16_HANDLER( dsp56k_ram_bank01_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size);
@@ -440,7 +440,7 @@ static WRITE16_HANDLER( dsp56k_ram_bank01_write )
static READ16_HANDLER( dsp56k_ram_bank02_read )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size);
@@ -450,7 +450,7 @@ static READ16_HANDLER( dsp56k_ram_bank02_read )
static WRITE16_HANDLER( dsp56k_ram_bank02_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size);
@@ -461,7 +461,7 @@ static WRITE16_HANDLER( dsp56k_ram_bank02_write )
static READ16_HANDLER( dsp56k_shared_ram_read )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size);
@@ -471,7 +471,7 @@ static READ16_HANDLER( dsp56k_shared_ram_read )
static WRITE16_HANDLER( dsp56k_shared_ram_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size);
@@ -491,7 +491,7 @@ static WRITE16_HANDLER( dsp56k_shared_ram_write )
static READ16_HANDLER( dsp56k_ram_bank04_read )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size);
@@ -501,7 +501,7 @@ static READ16_HANDLER( dsp56k_ram_bank04_read )
static WRITE16_HANDLER( dsp56k_ram_bank04_write )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT8 en_group = dsp56k_bank_group(space->cpu);
UINT8 bank_num = dsp56k_bank_num(space->cpu, en_group);
UINT32 driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size);
@@ -554,17 +554,17 @@ ADDRESS_MAP_END
/**********************************************************************************/
-static void reset_sound_region(running_machine *machine)
+static void reset_sound_region(running_machine &machine)
{
- polygonet_state *state = machine->driver_data<polygonet_state>();
- memory_set_bankptr(machine, "bank2", machine->region("soundcpu")->base() + 0x10000 + state->cur_sound_region*0x4000);
+ polygonet_state *state = machine.driver_data<polygonet_state>();
+ memory_set_bankptr(machine, "bank2", machine.region("soundcpu")->base() + 0x10000 + state->cur_sound_region*0x4000);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
state->cur_sound_region = (data & 0x1f);
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static INTERRUPT_GEN(audio_interrupt)
@@ -742,7 +742,7 @@ INPUT_PORTS_END
/**********************************************************************************/
static DRIVER_INIT(polygonet)
{
- polygonet_state *state = machine->driver_data<polygonet_state>();
+ polygonet_state *state = machine.driver_data<polygonet_state>();
/* Set default bankswitch */
state->cur_sound_region = 2;
@@ -756,8 +756,8 @@ static DRIVER_INIT(polygonet)
memset(state->dsp56k_bank04_ram, 0, sizeof(state->dsp56k_bank04_ram));
/* The dsp56k occasionally executes out of mapped memory */
- address_space *space = machine->device<dsp56k_device>("dsp")->space(AS_PROGRAM);
- state->dsp56k_update_handler = space->set_direct_update_handler(direct_update_delegate_create_static(plygonet_dsp56k_direct_handler, *machine));
+ address_space *space = machine.device<dsp56k_device>("dsp")->space(AS_PROGRAM);
+ state->dsp56k_update_handler = space->set_direct_update_handler(direct_update_delegate_create_static(plygonet_dsp56k_direct_handler, machine));
/* save states */
state->save_item(NAME(state->dsp56k_bank00_ram));
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 847deca4f12..c0f1ef1519e 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -159,14 +159,14 @@ static const eeprom_interface eeprom_intf =
static READ16_DEVICE_HANDLER( pntnpuzl_eeprom_r )
{
- pntnpuzl_state *state = device->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = device->machine().driver_data<pntnpuzl_state>();
/* bit 11 is EEPROM data */
- return (state->eeprom & 0xf4ff) | (eeprom_read_bit(device)<<11) | (input_port_read(device->machine, "IN1") & 0x0300);
+ return (state->eeprom & 0xf4ff) | (eeprom_read_bit(device)<<11) | (input_port_read(device->machine(), "IN1") & 0x0300);
}
static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w )
{
- pntnpuzl_state *state = device->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = device->machine().driver_data<pntnpuzl_state>();
state->eeprom = data;
/* bit 12 is data */
@@ -184,13 +184,13 @@ static WRITE16_DEVICE_HANDLER( pntnpuzl_eeprom_w )
/* vid */
static VIDEO_START( pntnpuzl )
{
- pntnpuzl_state *state = machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = machine.driver_data<pntnpuzl_state>();
state->_3a0000ram=auto_alloc_array(machine, UINT16, 0x100000/2);
}
static SCREEN_UPDATE( pntnpuzl )
{
- pntnpuzl_state *state = screen->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = screen->machine().driver_data<pntnpuzl_state>();
int x,y;
int count;
#if 0
@@ -198,37 +198,37 @@ static SCREEN_UPDATE( pntnpuzl )
static int yyy=512;
static int sss=0xa8;
- if ( input_code_pressed_once(screen->machine, KEYCODE_Q) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_Q) )
{
xxx--;
mame_printf_debug("xxx %04x\n",xxx);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_W) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_W) )
{
xxx++;
mame_printf_debug("xxx %04x\n",xxx);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_A) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_A) )
{
yyy--;
mame_printf_debug("yyy %04x\n",yyy);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_S) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_S) )
{
yyy++;
mame_printf_debug("yyy %04x\n",yyy);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_Z) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_Z) )
{
sss--;
mame_printf_debug("sss %04x\n",sss);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_X) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_X) )
{
sss++;
mame_printf_debug("sss %04x\n",sss);
@@ -256,7 +256,7 @@ static SCREEN_UPDATE( pntnpuzl )
static WRITE16_HANDLER( pntnpuzl_palette_w )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
if (ACCESSING_BITS_8_15)
{
@@ -268,7 +268,7 @@ static WRITE16_HANDLER( pntnpuzl_palette_w )
state->rgb[state->sub++] = data & 0xff;
if (state->sub == 3)
{
- palette_set_color_rgb(space->machine,state->indx++,pal6bit(state->rgb[0]),pal6bit(state->rgb[1]),pal6bit(state->rgb[2]));
+ palette_set_color_rgb(space->machine(),state->indx++,pal6bit(state->rgb[0]),pal6bit(state->rgb[1]),pal6bit(state->rgb[2]));
state->sub = 0;
if (state->indx == 256) state->indx = 0;
}
@@ -280,27 +280,27 @@ static WRITE16_HANDLER( pntnpuzl_palette_w )
#ifdef UNUSED_FUNCTION
READ16_HANDLER ( pntnpuzl_random_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
static READ16_HANDLER( pntnpuzl_vid_r )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
// logerror("read_videoram: pc = %06x : offset %04x reg %04x\n",cpu_get_pc(space->cpu),offset*2, state->bank[0]);
return state->_3a0000ram[offset+ (state->bank[0]&0x0001)*0x8000 ];
}
static WRITE16_HANDLER( pntnpuzl_vid_w )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
// logerror("write_to_videoram: pc = %06x : offset %04x data %04x reg %04x\n",cpu_get_pc(space->cpu),offset*2, data, state->bank[0]);
COMBINE_DATA(&state->_3a0000ram[offset+ (state->bank[0]&0x0001)*0x8000 ]);
}
static READ16_HANDLER( pntnpuzl_vblank_r )
{
- return (input_port_read(space->machine, "IN0") & 1) << 11;
+ return (input_port_read(space->machine(), "IN0") & 1) << 11;
}
@@ -329,7 +329,7 @@ write read
static WRITE16_HANDLER( pntnpuzl_200000_w )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
// logerror("200000: %04x\n",data);
// bit 12: set to 1 when going to serial output to 280018
if ((state->pntpzl_200000 & 0x1000) && !(data & 0x1000))
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( pntnpuzl_200000_w )
static WRITE16_HANDLER( pntnpuzl_280018_w )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
// logerror("%04x: 280018: %04x\n",cpu_get_pc(space->cpu),data);
state->serial >>= 1;
if (data & 0x2000)
@@ -353,17 +353,17 @@ static WRITE16_HANDLER( pntnpuzl_280018_w )
static READ16_HANDLER( pntnpuzl_280014_r )
{
- pntnpuzl_state *state = space->machine->driver_data<pntnpuzl_state>();
+ pntnpuzl_state *state = space->machine().driver_data<pntnpuzl_state>();
static const int startup[3] = { 0x80, 0x0c, 0x00 };
int res;
if (state->serial_out == 0x11)
{
- if (input_port_read(space->machine, "IN0") & 0x10)
+ if (input_port_read(space->machine(), "IN0") & 0x10)
{
state->touchscr[0] = 0x1b;
- state->touchscr[2] = BITSWAP8(input_port_read(space->machine, "TOUCHX"),0,1,2,3,4,5,6,7);
- state->touchscr[4] = BITSWAP8(input_port_read(space->machine, "TOUCHY"),0,1,2,3,4,5,6,7);
+ state->touchscr[2] = BITSWAP8(input_port_read(space->machine(), "TOUCHX"),0,1,2,3,4,5,6,7);
+ state->touchscr[4] = BITSWAP8(input_port_read(space->machine(), "TOUCHY"),0,1,2,3,4,5,6,7);
}
else
state->touchscr[0] = 0;
@@ -420,11 +420,11 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( pntnpuzl_irq )
{
- if (input_port_read(device->machine, "IN0") & 0x02) /* coin */
+ if (input_port_read(device->machine(), "IN0") & 0x02) /* coin */
generic_pulse_irq_line(device, 1);
- else if (input_port_read(device->machine, "IN0") & 0x04) /* service */
+ else if (input_port_read(device->machine(), "IN0") & 0x04) /* service */
generic_pulse_irq_line(device, 2);
- else if (input_port_read(device->machine, "IN0") & 0x08) /* coin */
+ else if (input_port_read(device->machine(), "IN0") & 0x08) /* coin */
generic_pulse_irq_line(device, 4);
}
@@ -490,7 +490,7 @@ ROM_END
static DRIVER_INIT(pip)
{
-// UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// rom[0x2696/2] = 0x4e71;
// rom[0x26a0/2] = 0x4e71;
}
diff --git a/src/mame/drivers/pokechmp.c b/src/mame/drivers/pokechmp.c
index 30a14ce69e3..b6735ee7e41 100644
--- a/src/mame/drivers/pokechmp.c
+++ b/src/mame/drivers/pokechmp.c
@@ -53,46 +53,46 @@ ClawGrip, Jul 2006
static WRITE8_HANDLER( pokechmp_bank_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
if (data == 0x00)
{
- memory_set_bankptr(space->machine, "bank1",&RAM[0x10000]);
- memory_set_bankptr(space->machine, "bank2",&RAM[0x12000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x10000]);
+ memory_set_bankptr(space->machine(), "bank2",&RAM[0x12000]);
}
if (data == 0x01)
{
- memory_set_bankptr(space->machine, "bank1",&RAM[0x14000]);
- memory_set_bankptr(space->machine, "bank2",&RAM[0x16000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x14000]);
+ memory_set_bankptr(space->machine(), "bank2",&RAM[0x16000]);
}
if (data == 0x02)
{
- memory_set_bankptr(space->machine, "bank1",&RAM[0x20000]);
- memory_set_bankptr(space->machine, "bank2",&RAM[0x22000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x20000]);
+ memory_set_bankptr(space->machine(), "bank2",&RAM[0x22000]);
}
if (data == 0x03)
{
- memory_set_bankptr(space->machine, "bank1",&RAM[0x04000]);
- memory_set_bankptr(space->machine, "bank2",&RAM[0x06000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x04000]);
+ memory_set_bankptr(space->machine(), "bank2",&RAM[0x06000]);
}
}
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( pokechmp_sound_bank_w )
{
- memory_set_bank(space->machine, "bank3", (data >> 2) & 1);
+ memory_set_bank(space->machine(), "bank3", (data >> 2) & 1);
}
#endif
static WRITE8_HANDLER( pokechmp_sound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
-INLINE void pokechmp_set_color(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void pokechmp_set_color(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
@@ -100,8 +100,8 @@ INLINE void pokechmp_set_color(running_machine *machine, pen_t color, int rshift
static WRITE8_HANDLER( pokechmp_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- pokechmp_set_color(space->machine, offset &0x3ff, 0, 5, 10, (space->machine->generic.paletteram.u8[offset&0x3ff]<<8) | ( space->machine->generic.paletteram.u8[ (offset&0x3ff)+0x400 ] ) );
+ space->machine().generic.paletteram.u8[offset] = data;
+ pokechmp_set_color(space->machine(), offset &0x3ff, 0, 5, 10, (space->machine().generic.paletteram.u8[offset&0x3ff]<<8) | ( space->machine().generic.paletteram.u8[ (offset&0x3ff)+0x400 ] ) );
}
@@ -263,7 +263,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( pokechmp )
{
- memory_configure_bank(machine, "bank3", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank3", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/poker72.c b/src/mame/drivers/poker72.c
index 9a461444033..4d4203abac5 100644
--- a/src/mame/drivers/poker72.c
+++ b/src/mame/drivers/poker72.c
@@ -33,7 +33,7 @@ static VIDEO_START(poker72)
static SCREEN_UPDATE(poker72)
{
- poker72_state *state = screen->machine->driver_data<poker72_state>();
+ poker72_state *state = screen->machine().driver_data<poker72_state>();
int x,y,count;
count = 0;
@@ -49,7 +49,7 @@ static SCREEN_UPDATE(poker72)
tile|= state->tile_bank << 12;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,fx,fy,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,color,fx,fy,x*8,y*8);
count+=2;
}
@@ -60,7 +60,7 @@ static SCREEN_UPDATE(poker72)
static WRITE8_HANDLER( poker72_paletteram_w )
{
- poker72_state *state = space->machine->driver_data<poker72_state>();
+ poker72_state *state = space->machine().driver_data<poker72_state>();
int r,g,b;
state->pal[offset] = data;
@@ -68,27 +68,27 @@ static WRITE8_HANDLER( poker72_paletteram_w )
g = state->pal[(offset & 0x3ff)+0x400] & 0x3f;
b = state->pal[(offset & 0x3ff)+0x800] & 0x3f;
- palette_set_color_rgb( space->machine, offset & 0x3ff, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb( space->machine(), offset & 0x3ff, pal6bit(r), pal6bit(g), pal6bit(b));
}
static WRITE8_HANDLER( output_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
printf("%02x\n",data);
/* if((data & 0xc) == 0xc)
- memory_set_bankptr(space->machine, "bank1", &ROM[0x10000]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[0x10000]);
else*/
if(data & 8)
- memory_set_bankptr(space->machine, "bank1", &ROM[0x08000]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[0x08000]);
else
- memory_set_bankptr(space->machine, "bank1", &ROM[0x00000]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[0x00000]);
}
static WRITE8_HANDLER( tile_bank_w )
{
- poker72_state *state = space->machine->driver_data<poker72_state>();
+ poker72_state *state = space->machine().driver_data<poker72_state>();
state->tile_bank = (data & 4) >> 2;
}
@@ -336,7 +336,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_RESET( poker72 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0]);
}
@@ -391,7 +391,7 @@ ROM_END
static DRIVER_INIT( poker72 )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x4a9] = 0x28;
}
diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c
index dc867be189f..94254e2ac68 100644
--- a/src/mame/drivers/polepos.c
+++ b/src/mame/drivers/polepos.c
@@ -244,7 +244,7 @@ Todo:
static READ16_HANDLER( polepos2_ic25_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
int result;
/* protection states */
@@ -273,15 +273,15 @@ static READ16_HANDLER( polepos2_ic25_r )
static READ8_HANDLER( polepos_adc_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
- return input_port_read(space->machine, state->adc_input ? "ACCEL" : "BRAKE");
+ polepos_state *state = space->machine().driver_data<polepos_state>();
+ return input_port_read(space->machine(), state->adc_input ? "ACCEL" : "BRAKE");
}
static READ8_HANDLER( polepos_ready_r )
{
int ret = 0xff;
- if (space->machine->primary_screen->vpos() >= 128)
+ if (space->machine().primary_screen->vpos() >= 128)
ret ^= 0x02;
ret ^= 0x08; /* ADC End Flag */
@@ -292,15 +292,15 @@ static READ8_HANDLER( polepos_ready_r )
static WRITE8_HANDLER( polepos_latch_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
int bit = data & 1;
switch (offset)
{
case 0x00: /* IRQON */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x01: /* IOSEL */
@@ -308,11 +308,11 @@ static WRITE8_HANDLER( polepos_latch_w )
break;
case 0x02: /* CLSON */
- polepos_sound_enable(space->machine->device("namco"),bit);
+ polepos_sound_enable(space->machine().device("namco"),bit);
if (!bit)
{
- polepos_engine_sound_lsb_w(space->machine->device("polepos"), 0, 0);
- polepos_engine_sound_msb_w(space->machine->device("polepos"), 0, 0);
+ polepos_engine_sound_lsb_w(space->machine().device("polepos"), 0, 0);
+ polepos_engine_sound_msb_w(space->machine().device("polepos"), 0, 0);
}
break;
@@ -321,11 +321,11 @@ static WRITE8_HANDLER( polepos_latch_w )
break;
case 0x04: /* RESB */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x05: /* RESA */
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x06: /* SB0 */
@@ -348,26 +348,26 @@ static WRITE16_HANDLER( polepos_z8002_nvi_enable_w )
}
-static CUSTOM_INPUT( high_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; }
-static CUSTOM_INPUT( low_port_r ) { return input_port_read(field->port->machine, (const char *)param) & 0x0f; }
+static CUSTOM_INPUT( high_port_r ) { return input_port_read(field->port->machine(), (const char *)param) >> 4; }
+static CUSTOM_INPUT( low_port_r ) { return input_port_read(field->port->machine(), (const char *)param) & 0x0f; }
static CUSTOM_INPUT( auto_start_r )
{
- polepos_state *state = field->port->machine->driver_data<polepos_state>();
+ polepos_state *state = field->port->machine().driver_data<polepos_state>();
return state->auto_start_mask;
}
static WRITE8_DEVICE_HANDLER( out_0 )
{
// no start lamps in pole position
-// set_led_status(device->machine, 1,data & 1);
-// set_led_status(device->machine, 0,data & 2);
- coin_counter_w(device->machine, 1,~data & 4);
- coin_counter_w(device->machine, 0,~data & 8);
+// set_led_status(device->machine(), 1,data & 1);
+// set_led_status(device->machine(), 0,data & 2);
+ coin_counter_w(device->machine(), 1,~data & 4);
+ coin_counter_w(device->machine(), 0,~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_1 )
{
- coin_lockout_global_w(device->machine, data & 1);
+ coin_lockout_global_w(device->machine(), data & 1);
}
static const namco_51xx_interface namco_51xx_intf =
@@ -387,9 +387,9 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine->region("52xx")->bytes();
+ UINT32 length = device->machine().region("52xx")->bytes();
logerror("ROM @ %04X\n", offset);
- return (offset < length) ? device->machine->region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
@@ -416,9 +416,9 @@ static READ8_DEVICE_HANDLER( namco_53xx_k_r )
static READ8_DEVICE_HANDLER( steering_changed_r )
{
- polepos_state *state = device->machine->driver_data<polepos_state>();
+ polepos_state *state = device->machine().driver_data<polepos_state>();
/* read the current steering value and update our delta */
- UINT8 steer_new = input_port_read(device->machine, "STEER");
+ UINT8 steer_new = input_port_read(device->machine(), "STEER");
state->steer_accum += (INT8)(steer_new - state->steer_last) * 2;
state->steer_last = steer_new;
@@ -439,7 +439,7 @@ static READ8_DEVICE_HANDLER( steering_changed_r )
static READ8_DEVICE_HANDLER( steering_delta_r )
{
- polepos_state *state = device->machine->driver_data<polepos_state>();
+ polepos_state *state = device->machine().driver_data<polepos_state>();
return state->steer_delta;
}
@@ -458,7 +458,7 @@ static const namco_53xx_interface namco_53xx_intf =
static MACHINE_RESET( polepos )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -466,8 +466,8 @@ static MACHINE_RESET( polepos )
polepos_latch_w(space, i, 0);
/* set the interrupt vectors (this shouldn't be needed) */
- device_set_input_line_vector(machine->device("sub"), 0, Z8000_NVI);
- device_set_input_line_vector(machine->device("sub2"), 0, Z8000_NVI);
+ device_set_input_line_vector(machine.device("sub"), 0, Z8000_NVI);
+ device_set_input_line_vector(machine.device("sub2"), 0, Z8000_NVI);
}
@@ -1986,15 +1986,15 @@ ROM_END
static DRIVER_INIT( topracern )
{
/* extra direct mapped inputs read */
- machine->device("maincpu")->memory().space(AS_IO)->install_read_port(0x02, 0x02, "STEER");
- machine->device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "IN0");
- machine->device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSWA");
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_port(0x02, 0x02, "STEER");
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_port(0x03, 0x03, "IN0");
+ machine.device("maincpu")->memory().space(AS_IO)->install_read_port(0x04, 0x04, "DSWA");
}
static DRIVER_INIT( polepos2 )
{
/* note that the bootleg version doesn't need this custom IC; it has a hacked ROM in its place */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x5fff, FUNC(polepos2_ic25_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x5fff, FUNC(polepos2_ic25_r));
}
diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c
index e9bef09d118..9a7c5a274e9 100644
--- a/src/mame/drivers/policetr.c
+++ b/src/mame/drivers/policetr.c
@@ -109,7 +109,7 @@ static TIMER_CALLBACK( irq5_gen )
static INTERRUPT_GEN( irq4_gen )
{
device_set_input_line(device, R3000_IRQ4, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(0), FUNC(irq5_gen));
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(0), FUNC(irq5_gen));
}
@@ -122,7 +122,7 @@ static INTERRUPT_GEN( irq4_gen )
static WRITE32_HANDLER( control_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
UINT32 old = state->control_data;
// bit $80000000 = BSMT access/ROM read
@@ -137,7 +137,7 @@ static WRITE32_HANDLER( control_w )
/* handle EEPROM I/O */
if (ACCESSING_BITS_16_23)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_write_bit(device, data & 0x00800000);
eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE);
eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE);
@@ -146,7 +146,7 @@ static WRITE32_HANDLER( control_w )
/* toggling BSMT off then on causes a reset */
if (!(old & 0x80000000) && (state->control_data & 0x80000000))
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->reset();
}
@@ -165,9 +165,9 @@ static WRITE32_HANDLER( control_w )
static WRITE32_HANDLER( policetr_bsmt2000_reg_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
if (state->control_data & 0x80000000)
- space->machine->device<bsmt2000_device>("bsmt")->write_data(data);
+ space->machine().device<bsmt2000_device>("bsmt")->write_data(data);
else
COMBINE_DATA(&state->bsmt_data_offset);
}
@@ -175,22 +175,22 @@ static WRITE32_HANDLER( policetr_bsmt2000_reg_w )
static WRITE32_HANDLER( policetr_bsmt2000_data_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
- space->machine->device<bsmt2000_device>("bsmt")->write_reg(data);
+ policetr_state *state = space->machine().driver_data<policetr_state>();
+ space->machine().device<bsmt2000_device>("bsmt")->write_reg(data);
COMBINE_DATA(&state->bsmt_data_bank);
}
static CUSTOM_INPUT( bsmt_status_r )
{
- return field->port->machine->device<bsmt2000_device>("bsmt")->read_status();
+ return field->port->machine().device<bsmt2000_device>("bsmt")->read_status();
}
static READ32_HANDLER( bsmt2000_data_r )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
- return space->machine->region("bsmt")->base()[state->bsmt_data_bank * 0x10000 + state->bsmt_data_offset] << 8;
+ policetr_state *state = space->machine().driver_data<policetr_state>();
+ return space->machine().region("bsmt")->base()[state->bsmt_data_bank * 0x10000 + state->bsmt_data_offset] << 8;
}
@@ -203,13 +203,13 @@ static READ32_HANDLER( bsmt2000_data_r )
static WRITE32_HANDLER( speedup_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
COMBINE_DATA(state->speedup_data);
/* see if the PC matches */
if ((cpu_get_previouspc(space->cpu) & 0x1fffffff) == state->speedup_pc)
{
- UINT64 curr_cycles = space->machine->firstcpu->total_cycles();
+ UINT64 curr_cycles = space->machine().firstcpu->total_cycles();
/* if less than 50 cycles from the last time, count it */
if (curr_cycles - state->last_cycles < 50)
@@ -678,30 +678,30 @@ ROM_END
static DRIVER_INIT( policetr )
{
- policetr_state *state = machine->driver_data<policetr_state>();
- state->speedup_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000fc8, 0x00000fcb, FUNC(speedup_w));
+ policetr_state *state = machine.driver_data<policetr_state>();
+ state->speedup_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000fc8, 0x00000fcb, FUNC(speedup_w));
state->speedup_pc = 0x1fc028ac;
}
static DRIVER_INIT( plctr13b )
{
- policetr_state *state = machine->driver_data<policetr_state>();
- state->speedup_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000fc8, 0x00000fcb, FUNC(speedup_w));
+ policetr_state *state = machine.driver_data<policetr_state>();
+ state->speedup_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000fc8, 0x00000fcb, FUNC(speedup_w));
state->speedup_pc = 0x1fc028bc;
}
static DRIVER_INIT( sshooter )
{
- policetr_state *state = machine->driver_data<policetr_state>();
- state->speedup_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00018fd8, 0x00018fdb, FUNC(speedup_w));
+ policetr_state *state = machine.driver_data<policetr_state>();
+ state->speedup_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00018fd8, 0x00018fdb, FUNC(speedup_w));
state->speedup_pc = 0x1fc03470;
}
static DRIVER_INIT( sshoot12 )
{
- policetr_state *state = machine->driver_data<policetr_state>();
- state->speedup_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00018fd8, 0x00018fdb, FUNC(speedup_w));
+ policetr_state *state = machine.driver_data<policetr_state>();
+ state->speedup_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00018fd8, 0x00018fdb, FUNC(speedup_w));
state->speedup_pc = 0x1fc033e0;
}
diff --git a/src/mame/drivers/polyplay.c b/src/mame/drivers/polyplay.c
index 2d5f8dc7f3b..fffb059897f 100644
--- a/src/mame/drivers/polyplay.c
+++ b/src/mame/drivers/polyplay.c
@@ -104,7 +104,7 @@ static const samples_interface polyplay_samples_interface =
static MACHINE_RESET( polyplay )
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
+ polyplay_state *state = machine.driver_data<polyplay_state>();
state->channel1_active = 0;
state->channel1_const = 0;
state->channel2_active = 0;
@@ -115,7 +115,7 @@ static MACHINE_RESET( polyplay )
polyplay_set_channel2(machine, 0);
polyplay_play_channel2(machine, 0);
- state->timer = machine->device<timer_device>("timer");
+ state->timer = machine.device<timer_device>("timer");
}
@@ -127,9 +127,9 @@ static INTERRUPT_GEN( periodic_interrupt )
static INTERRUPT_GEN( coin_interrupt )
{
- polyplay_state *state = device->machine->driver_data<polyplay_state>();
+ polyplay_state *state = device->machine().driver_data<polyplay_state>();
- if (input_port_read(device->machine, "INPUT") & 0x80)
+ if (input_port_read(device->machine(), "INPUT") & 0x80)
state->last = 0;
else
{
@@ -177,47 +177,47 @@ INPUT_PORTS_END
static WRITE8_HANDLER( polyplay_sound_channel )
{
- polyplay_state *state = space->machine->driver_data<polyplay_state>();
+ polyplay_state *state = space->machine().driver_data<polyplay_state>();
switch(offset) {
case 0x00:
if (state->channel1_const) {
if (data <= 1) {
- polyplay_set_channel1(space->machine, 0);
+ polyplay_set_channel1(space->machine(), 0);
}
state->channel1_const = 0;
- polyplay_play_channel1(space->machine, data*state->prescale1);
+ polyplay_play_channel1(space->machine(), data*state->prescale1);
}
else {
state->prescale1 = (data & 0x20) ? 16 : 1;
if (data & 0x04) {
- polyplay_set_channel1(space->machine, 1);
+ polyplay_set_channel1(space->machine(), 1);
state->channel1_const = 1;
}
if ((data == 0x41) || (data == 0x65) || (data == 0x45)) {
- polyplay_set_channel1(space->machine, 0);
- polyplay_play_channel1(space->machine, 0);
+ polyplay_set_channel1(space->machine(), 0);
+ polyplay_play_channel1(space->machine(), 0);
}
}
break;
case 0x01:
if (state->channel2_const) {
if (data <= 1) {
- polyplay_set_channel2(space->machine, 0);
+ polyplay_set_channel2(space->machine(), 0);
}
state->channel2_const = 0;
- polyplay_play_channel2(space->machine, data*state->prescale2);
+ polyplay_play_channel2(space->machine(), data*state->prescale2);
}
else {
state->prescale2 = (data & 0x20) ? 16 : 1;
if (data & 0x04) {
- polyplay_set_channel2(space->machine, 1);
+ polyplay_set_channel2(space->machine(), 1);
state->channel2_const = 1;
}
if ((data == 0x41) || (data == 0x65) || (data == 0x45)) {
- polyplay_set_channel2(space->machine, 0);
- polyplay_play_channel2(space->machine, 0);
+ polyplay_set_channel2(space->machine(), 0);
+ polyplay_play_channel2(space->machine(), 0);
}
}
break;
@@ -226,7 +226,7 @@ static WRITE8_HANDLER( polyplay_sound_channel )
static WRITE8_HANDLER( polyplay_start_timer2 )
{
- polyplay_state *state = space->machine->driver_data<polyplay_state>();
+ polyplay_state *state = space->machine().driver_data<polyplay_state>();
if (data == 0x03)
state->timer->reset();
@@ -236,7 +236,7 @@ static WRITE8_HANDLER( polyplay_start_timer2 )
static READ8_HANDLER( polyplay_random_read )
{
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
/* graphic structures */
@@ -353,7 +353,7 @@ ROM_END
static TIMER_DEVICE_CALLBACK( polyplay_timer_callback )
{
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0x4c);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0x4c);
}
/* game driver */
diff --git a/src/mame/drivers/poo.c b/src/mame/drivers/poo.c
index af7aff5f2a1..4ecc79fa35a 100644
--- a/src/mame/drivers/poo.c
+++ b/src/mame/drivers/poo.c
@@ -65,10 +65,10 @@ static VIDEO_START(unclepoo)
static SCREEN_UPDATE(unclepoo)
{
- poo_state *state = screen->machine->driver_data<poo_state>();
+ poo_state *state = screen->machine().driver_data<poo_state>();
int y,x;
int count;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
count = 0;
@@ -108,7 +108,7 @@ static SCREEN_UPDATE(unclepoo)
static READ8_HANDLER( unk_inp_r )
{
- return 0x00;//space->machine->rand();
+ return 0x00;//space->machine().rand();
}
#if 0
@@ -120,7 +120,7 @@ static READ8_HANDLER( unk_inp2_r )
static READ8_HANDLER( unk_inp3_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -136,12 +136,12 @@ static WRITE8_HANDLER( unk_w )
static WRITE8_HANDLER( sound_cmd_w )
{
soundlatch_w(space, 0, (data & 0xff));
- cputag_set_input_line(space->machine, "subcpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "subcpu", 0, HOLD_LINE);
}
static WRITE8_HANDLER( poo_vregs_w )
{
- poo_state *state = space->machine->driver_data<poo_state>();
+ poo_state *state = space->machine().driver_data<poo_state>();
// bit 2 used, unknown purpose
state->vram_colbank = data & 0x18;
}
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index 85fa61f6047..8083da47d85 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -14,8 +14,8 @@ Atari Poolshark Driver
static DRIVER_INIT( poolshrk )
{
- UINT8* pSprite = machine->region("gfx1")->base();
- UINT8* pOffset = machine->region("proms")->base();
+ UINT8* pSprite = machine.region("gfx1")->base();
+ UINT8* pOffset = machine.region("proms")->base();
int i;
int j;
@@ -47,7 +47,7 @@ static DRIVER_INIT( poolshrk )
static WRITE8_HANDLER( poolshrk_da_latch_w )
{
- poolshrk_state *state = space->machine->driver_data<poolshrk_state>();
+ poolshrk_state *state = space->machine().driver_data<poolshrk_state>();
state->da_latch = data & 15;
}
@@ -55,9 +55,9 @@ static WRITE8_HANDLER( poolshrk_da_latch_w )
static WRITE8_HANDLER( poolshrk_led_w )
{
if (offset & 2)
- set_led_status(space->machine, 0, offset & 1);
+ set_led_status(space->machine(), 0, offset & 1);
if (offset & 4)
- set_led_status(space->machine, 1, offset & 1);
+ set_led_status(space->machine(), 1, offset & 1);
}
@@ -72,12 +72,12 @@ static WRITE8_HANDLER( poolshrk_watchdog_w )
static READ8_HANDLER( poolshrk_input_r )
{
- poolshrk_state *state = space->machine->driver_data<poolshrk_state>();
+ poolshrk_state *state = space->machine().driver_data<poolshrk_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- UINT8 val = input_port_read(space->machine, portnames[offset & 3]);
+ UINT8 val = input_port_read(space->machine(), portnames[offset & 3]);
- int x = input_port_read(space->machine, (offset & 1) ? "AN1" : "AN0");
- int y = input_port_read(space->machine, (offset & 1) ? "AN3" : "AN2");
+ int x = input_port_read(space->machine(), (offset & 1) ? "AN1" : "AN0");
+ int y = input_port_read(space->machine(), (offset & 1) ? "AN3" : "AN2");
if (x >= state->da_latch) val |= 8;
if (y >= state->da_latch) val |= 4;
@@ -93,7 +93,7 @@ static READ8_HANDLER( poolshrk_input_r )
static READ8_HANDLER( poolshrk_irq_reset_r )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
return 0;
}
diff --git a/src/mame/drivers/pooyan.c b/src/mame/drivers/pooyan.c
index a5d4a3b80e3..5f84aa1b5c5 100644
--- a/src/mame/drivers/pooyan.c
+++ b/src/mame/drivers/pooyan.c
@@ -25,7 +25,7 @@
static INTERRUPT_GEN( pooyan_interrupt )
{
- pooyan_state *state = device->machine->driver_data<pooyan_state>();
+ pooyan_state *state = device->machine().driver_data<pooyan_state>();
if (state->irq_enable)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
@@ -34,7 +34,7 @@ static INTERRUPT_GEN( pooyan_interrupt )
static WRITE8_HANDLER( irq_enable_w )
{
- pooyan_state *state = space->machine->driver_data<pooyan_state>();
+ pooyan_state *state = space->machine().driver_data<pooyan_state>();
state->irq_enable = data & 1;
if (!state->irq_enable)
@@ -208,9 +208,9 @@ GFXDECODE_END
static MACHINE_START( pooyan )
{
- pooyan_state *state = machine->driver_data<pooyan_state>();
+ pooyan_state *state = machine.driver_data<pooyan_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
state->save_item(NAME(state->irq_enable));
}
@@ -218,7 +218,7 @@ static MACHINE_START( pooyan )
static MACHINE_RESET( pooyan )
{
- pooyan_state *state = machine->driver_data<pooyan_state>();
+ pooyan_state *state = machine.driver_data<pooyan_state>();
state->irq_enable = 0;
}
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index 72739186f4f..c68110bbcb3 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -34,7 +34,7 @@ static INTERRUPT_GEN( popeye_interrupt )
static READ8_HANDLER( protection_r )
{
- popeye_state *state = space->machine->driver_data<popeye_state>();
+ popeye_state *state = space->machine().driver_data<popeye_state>();
if (offset == 0)
{
return ((state->prot1 << state->prot_shift) | (state->prot0 >> (8-state->prot_shift))) & 0xff;
@@ -48,7 +48,7 @@ static READ8_HANDLER( protection_r )
static WRITE8_HANDLER( protection_w )
{
- popeye_state *state = space->machine->driver_data<popeye_state>();
+ popeye_state *state = space->machine().driver_data<popeye_state>();
if (offset == 0)
{
/* this is the same as the level number (1-3) */
@@ -395,9 +395,9 @@ GFXDECODE_END
static WRITE8_DEVICE_HANDLER( popeye_portB_w )
{
- popeye_state *state = device->machine->driver_data<popeye_state>();
+ popeye_state *state = device->machine().driver_data<popeye_state>();
/* bit 0 flips screen */
- flip_screen_set(device->machine, data & 1);
+ flip_screen_set(device->machine(), data & 1);
/* bits 1-3 select DSW1 bit to read */
state->dswbit = (data & 0x0e) >> 1;
@@ -405,12 +405,12 @@ static WRITE8_DEVICE_HANDLER( popeye_portB_w )
static READ8_DEVICE_HANDLER( popeye_portA_r )
{
- popeye_state *state = device->machine->driver_data<popeye_state>();
+ popeye_state *state = device->machine().driver_data<popeye_state>();
int res;
- res = input_port_read(device->machine, "DSW0");
- res |= (input_port_read(device->machine, "DSW1") << (7-state->dswbit)) & 0x80;
+ res = input_port_read(device->machine(), "DSW0");
+ res |= (input_port_read(device->machine(), "DSW1") << (7-state->dswbit)) & 0x80;
return res;
}
@@ -621,9 +621,9 @@ ROM_END
static DRIVER_INIT( skyskipr )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
@@ -643,9 +643,9 @@ static DRIVER_INIT( skyskipr )
static DRIVER_INIT( popeye )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int len = 0x10000;
/* decrypt the program ROMs */
diff --git a/src/mame/drivers/popper.c b/src/mame/drivers/popper.c
index 5ff78d70b88..06366ab9a62 100644
--- a/src/mame/drivers/popper.c
+++ b/src/mame/drivers/popper.c
@@ -127,21 +127,21 @@ static READ8_HANDLER( popper_input_ports_r )
switch (offset)
{
// player inputs dsw1 dsw2
- case 0: data = input_port_read(space->machine, "IN0") | ((input_port_read(space->machine, "DSW1") & 0x02) << 5) | ((input_port_read(space->machine, "DSW2") & 0x01) << 4); break;
- case 1: data = input_port_read(space->machine, "IN1") | ((input_port_read(space->machine, "DSW1") & 0x01) << 6) | ((input_port_read(space->machine, "DSW2") & 0x02) << 3); break;
- case 2: data = input_port_read(space->machine, "IN2") | ((input_port_read(space->machine, "DSW1") & 0x08) << 3) | ((input_port_read(space->machine, "DSW2") & 0x04) << 2); break;
- case 3: data = input_port_read(space->machine, "IN3") | ((input_port_read(space->machine, "DSW1") & 0x04) << 4) | ((input_port_read(space->machine, "DSW2") & 0x08) << 1); break;
- case 4: data = ((input_port_read(space->machine, "DSW1") & 0x20) << 2) | ((input_port_read(space->machine, "DSW2") & 0x10) << 1); break;
- case 5: data = ((input_port_read(space->machine, "DSW1") & 0x10) << 3) | ((input_port_read(space->machine, "DSW2") & 0x20) << 0); break;
- case 6: data = ((input_port_read(space->machine, "DSW1") & 0x80) << 0) | ((input_port_read(space->machine, "DSW2") & 0x40) >> 1); break;
- case 7: data = ((input_port_read(space->machine, "DSW1") & 0x40) << 1) | ((input_port_read(space->machine, "DSW2") & 0x80) >> 2); break;
+ case 0: data = input_port_read(space->machine(), "IN0") | ((input_port_read(space->machine(), "DSW1") & 0x02) << 5) | ((input_port_read(space->machine(), "DSW2") & 0x01) << 4); break;
+ case 1: data = input_port_read(space->machine(), "IN1") | ((input_port_read(space->machine(), "DSW1") & 0x01) << 6) | ((input_port_read(space->machine(), "DSW2") & 0x02) << 3); break;
+ case 2: data = input_port_read(space->machine(), "IN2") | ((input_port_read(space->machine(), "DSW1") & 0x08) << 3) | ((input_port_read(space->machine(), "DSW2") & 0x04) << 2); break;
+ case 3: data = input_port_read(space->machine(), "IN3") | ((input_port_read(space->machine(), "DSW1") & 0x04) << 4) | ((input_port_read(space->machine(), "DSW2") & 0x08) << 1); break;
+ case 4: data = ((input_port_read(space->machine(), "DSW1") & 0x20) << 2) | ((input_port_read(space->machine(), "DSW2") & 0x10) << 1); break;
+ case 5: data = ((input_port_read(space->machine(), "DSW1") & 0x10) << 3) | ((input_port_read(space->machine(), "DSW2") & 0x20) << 0); break;
+ case 6: data = ((input_port_read(space->machine(), "DSW1") & 0x80) << 0) | ((input_port_read(space->machine(), "DSW2") & 0x40) >> 1); break;
+ case 7: data = ((input_port_read(space->machine(), "DSW1") & 0x40) << 1) | ((input_port_read(space->machine(), "DSW2") & 0x80) >> 2); break;
}
return data;
}
static READ8_HANDLER( popper_soundcpu_nmi_r )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
return 0;
}
@@ -307,9 +307,9 @@ GFXDECODE_END
static MACHINE_START( popper )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->e002));
@@ -318,7 +318,7 @@ static MACHINE_START( popper )
static MACHINE_RESET( popper )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
state->flipscreen = 0;
state->e002 = 0;
diff --git a/src/mame/drivers/portrait.c b/src/mame/drivers/portrait.c
index b27a36d899e..6803e79a9cc 100644
--- a/src/mame/drivers/portrait.c
+++ b/src/mame/drivers/portrait.c
@@ -94,13 +94,13 @@ static WRITE8_HANDLER( portrait_ctrl_w )
{
/* bits 4 and 5 are unknown */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
/* the 2 lamps near the camera */
- set_led_status(space->machine, 0, data & 0x08);
- set_led_status(space->machine, 1, data & 0x40);
+ set_led_status(space->machine(), 0, data & 0x08);
+ set_led_status(space->machine(), 1, data & 0x40);
/* shows the black and white photo from the camera */
output_set_value("photo", (data >> 7) & 1);
@@ -108,13 +108,13 @@ static WRITE8_HANDLER( portrait_ctrl_w )
static WRITE8_HANDLER( portrait_positive_scroll_w )
{
- portrait_state *state = space->machine->driver_data<portrait_state>();
+ portrait_state *state = space->machine().driver_data<portrait_state>();
state->scroll = data;
}
static WRITE8_HANDLER( portrait_negative_scroll_w )
{
- portrait_state *state = space->machine->driver_data<portrait_state>();
+ portrait_state *state = space->machine().driver_data<portrait_state>();
state->scroll = - (data ^ 0xff);
}
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index 88d64ffeebb..232cdae57f3 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -36,7 +36,7 @@ static WRITE16_DEVICE_HANDLER( magicstk_coin_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(device->machine, 0, data & 0x20);
+ coin_counter_w(device->machine(), 0, data & 0x20);
eeprom_set_cs_line(device, (data & 8) ? CLEAR_LINE : ASSERT_LINE);
eeprom_write_bit(device, data & 2);
@@ -46,7 +46,7 @@ static WRITE16_DEVICE_HANDLER( magicstk_coin_eeprom_w )
static WRITE16_HANDLER( magicstk_bgvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -54,7 +54,7 @@ static WRITE16_HANDLER( magicstk_bgvideoram_w )
static WRITE16_HANDLER( tile_banking_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
if (((data >> 12) & 0x0f) != state->tilebank)
{
@@ -69,7 +69,7 @@ static WRITE16_DEVICE_HANDLER( oki_banking )
{
int addr = 0x40000 * ((data & 3) - 1);
- if (addr < device->machine->region("oki")->bytes())
+ if (addr < device->machine().region("oki")->bytes())
downcast<okim6295_device *>(device)->set_bank_base(addr);
}
}
@@ -377,7 +377,7 @@ INPUT_PORTS_END
static TILE_GET_INFO( powerbal_get_bg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int code = (state->videoram1[tile_index] & 0x07ff) + state->tilebank * 0x800;
int colr = state->videoram1[tile_index] & 0xf000;
@@ -387,12 +387,12 @@ static TILE_GET_INFO( powerbal_get_bg_tile_info )
SET_TILE_INFO(1, code, colr >> 12, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 *spriteram = state->spriteram;
int offs;
- int height = machine->gfx[0]->height;
+ int height = machine.gfx[0]->height;
for (offs = 4; offs < state->spriteram_size / 2; offs += 4)
{
@@ -408,7 +408,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = spriteram[offs + 2];
color = (spriteram[offs + 1] & 0xf000) >> 12;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,0,
@@ -418,7 +418,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_START( powerbal )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->bg_tilemap = tilemap_create(machine, powerbal_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -429,10 +429,10 @@ static VIDEO_START( powerbal )
static SCREEN_UPDATE( powerbal )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -471,14 +471,14 @@ GFXDECODE_END
static MACHINE_START( powerbal )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->save_item(NAME(state->tilebank));
}
static MACHINE_RESET( powerbal )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tilebank = 0;
}
@@ -682,7 +682,7 @@ ROM_END
static DRIVER_INIT( powerbal )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->bg_yoffset = 16;
state->yoffset = -8;
@@ -690,7 +690,7 @@ static DRIVER_INIT( powerbal )
static DRIVER_INIT( magicstk )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->bg_yoffset = 0;
state->yoffset = -5;
diff --git a/src/mame/drivers/powerins.c b/src/mame/drivers/powerins.c
index 5600bc8eba0..e77a7fa0f14 100644
--- a/src/mame/drivers/powerins.c
+++ b/src/mame/drivers/powerins.c
@@ -46,10 +46,10 @@ TODO:
static WRITE16_HANDLER( powerins_okibank_w )
{
- powerins_state *state = space->machine->driver_data<powerins_state>();
+ powerins_state *state = space->machine().driver_data<powerins_state>();
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine->region("oki1")->base();
+ UINT8 *RAM = space->machine().region("oki1")->base();
int new_bank = data & 0x7;
if (new_bank != state->oki_bank)
@@ -315,13 +315,13 @@ GFXDECODE_END
static MACHINE_RESET( powerins )
{
- powerins_state *state = machine->driver_data<powerins_state>();
+ powerins_state *state = machine.driver_data<powerins_state>();
state->oki_bank = -1; // samples bank "unitialised"
}
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index 9a88bbbc7e0..07d30b74c03 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -153,28 +153,28 @@ public:
static WRITE8_HANDLER( ppmast93_fgram_w )
{
- ppmast93_state *state = space->machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = space->machine().driver_data<ppmast93_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset/2);
}
static WRITE8_HANDLER( ppmast93_bgram_w )
{
- ppmast93_state *state = space->machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = space->machine().driver_data<ppmast93_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
}
static WRITE8_HANDLER( ppmast93_port4_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int bank;
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
bank = data & 0x07;
- memory_set_bankptr(space->machine, "bank1",&rom[0x10000+(bank*0x4000)]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[0x10000+(bank*0x4000)]);
}
static ADDRESS_MAP_START( ppmast93_cpu1_map, AS_PROGRAM, 8 )
@@ -210,8 +210,8 @@ static WRITE8_HANDLER(ppmast_sound_w)
switch(offset&0xff)
{
case 0:
- case 1: ym2413_w(space->machine->device("ymsnd"),offset,data); break;
- case 2: dac_data_w(space->machine->device("dac"),data);break;
+ case 1: ym2413_w(space->machine().device("ymsnd"),offset,data); break;
+ case 2: dac_data_w(space->machine().device("dac"),data);break;
default: logerror("%x %x - %x\n",offset,data,cpu_get_previouspc(space->cpu));
}
}
@@ -320,7 +320,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_ppmast93_bg_tile_info )
{
- ppmast93_state *state = machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = machine.driver_data<ppmast93_state>();
int code = (state->bgram[tile_index*2+1] << 8) | state->bgram[tile_index*2];
SET_TILE_INFO(
0,
@@ -331,7 +331,7 @@ static TILE_GET_INFO( get_ppmast93_bg_tile_info )
static TILE_GET_INFO( get_ppmast93_fg_tile_info )
{
- ppmast93_state *state = machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = machine.driver_data<ppmast93_state>();
int code = (state->fgram[tile_index*2+1] << 8) | state->fgram[tile_index*2];
SET_TILE_INFO(
0,
@@ -342,7 +342,7 @@ static TILE_GET_INFO( get_ppmast93_fg_tile_info )
static VIDEO_START( ppmast93 )
{
- ppmast93_state *state = machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = machine.driver_data<ppmast93_state>();
state->bg_tilemap = tilemap_create(machine, get_ppmast93_bg_tile_info,tilemap_scan_rows,8,8,32, 32);
state->fg_tilemap = tilemap_create(machine, get_ppmast93_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
@@ -351,7 +351,7 @@ static VIDEO_START( ppmast93 )
static SCREEN_UPDATE( ppmast93 )
{
- ppmast93_state *state = screen->machine->driver_data<ppmast93_state>();
+ ppmast93_state *state = screen->machine().driver_data<ppmast93_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
diff --git a/src/mame/drivers/prehisle.c b/src/mame/drivers/prehisle.c
index af97377b5a4..63e8bba9ee5 100644
--- a/src/mame/drivers/prehisle.c
+++ b/src/mame/drivers/prehisle.c
@@ -20,7 +20,7 @@
static WRITE16_HANDLER( prehisle_sound16_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
/*******************************************************************************/
@@ -193,7 +193,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index 2742c7a84c5..3ef0ed9184a 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -78,7 +78,7 @@ public:
static VIDEO_START( progolf )
{
- progolf_state *state = machine->driver_data<progolf_state>();
+ progolf_state *state = machine.driver_data<progolf_state>();
state->scrollx_hi = 0;
state->scrollx_lo = 0;
@@ -89,7 +89,7 @@ static VIDEO_START( progolf )
static SCREEN_UPDATE( progolf )
{
- progolf_state *state = screen->machine->driver_data<progolf_state>();
+ progolf_state *state = screen->machine().driver_data<progolf_state>();
UINT8 *videoram = state->videoram;
int count,color,x,y,xi,yi;
@@ -104,9 +104,9 @@ static SCREEN_UPDATE( progolf )
{
int tile = videoram[count];
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,1,0,0,(256-x*8)+scroll,y*8);
/* wrap-around */
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,1,0,0,(256-x*8)+scroll-1024,y*8);
count++;
}
@@ -128,7 +128,7 @@ static SCREEN_UPDATE( progolf )
color = state->fg_fb[(xi+yi*8)+count*0x40];
if((x+yi) <= cliprect->max_x && (256-y+xi) <= cliprect->max_y && color != 0)
- *BITMAP_ADDR16(bitmap, x+yi, 256-y+xi) = screen->machine->pens[(color & 0x7)];
+ *BITMAP_ADDR16(bitmap, x+yi, 256-y+xi) = screen->machine().pens[(color & 0x7)];
}
}
@@ -142,7 +142,7 @@ static SCREEN_UPDATE( progolf )
static WRITE8_HANDLER( progolf_charram_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
int i;
state->fbram[offset] = data;
@@ -165,7 +165,7 @@ static WRITE8_HANDLER( progolf_charram_w )
static WRITE8_HANDLER( progolf_char_vregs_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
state->char_pen = data & 0x07;
state->gfx_switch = data & 0xf0;
state->char_pen_vreg = data & 0x30;
@@ -173,42 +173,42 @@ static WRITE8_HANDLER( progolf_char_vregs_w )
static WRITE8_HANDLER( progolf_scrollx_lo_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
state->scrollx_lo = data;
}
static WRITE8_HANDLER( progolf_scrollx_hi_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
state->scrollx_hi = data;
}
static WRITE8_HANDLER( progolf_flip_screen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
if(data & 0xfe)
printf("$9600 with data = %02x used\n",data);
}
static WRITE8_HANDLER( audio_command_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
state->sound_cmd = data;
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
static READ8_HANDLER( audio_command_r )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ progolf_state *state = space->machine().driver_data<progolf_state>();
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return state->sound_cmd;
}
static READ8_HANDLER( progolf_videoram_r )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
UINT8 *videoram = state->videoram;
- UINT8 *gfx_rom = space->machine->region("gfx1")->base();
+ UINT8 *gfx_rom = space->machine().region("gfx1")->base();
if (offset >= 0x0800)
{
@@ -234,7 +234,7 @@ static READ8_HANDLER( progolf_videoram_r )
static WRITE8_HANDLER( progolf_videoram_w )
{
- progolf_state *state = space->machine->driver_data<progolf_state>();
+ progolf_state *state = space->machine().driver_data<progolf_state>();
UINT8 *videoram = state->videoram;
//if(state->gfx_switch & 0x40)
videoram[offset] = data;
@@ -268,7 +268,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted )
{
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( progolf )
@@ -426,7 +426,7 @@ static PALETTE_INIT( progolf )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -536,8 +536,8 @@ ROM_END
static DRIVER_INIT( progolf )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
@@ -550,8 +550,8 @@ static DRIVER_INIT( progolf )
static DRIVER_INIT( progolfa )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index fdf34128a68..7c7436c02d9 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -79,7 +79,7 @@ This was pointed out by Bart Puype
static CUSTOM_INPUT( z80_nmi_r )
{
- psikyo_state *state = field->port->machine->driver_data<psikyo_state>();
+ psikyo_state *state = field->port->machine().driver_data<psikyo_state>();
int ret = 0x00;
if (state->z80_nmi)
@@ -88,8 +88,8 @@ static CUSTOM_INPUT( z80_nmi_r )
/* main CPU might be waiting for sound CPU to finish NMI,
so set a timer to give sound CPU a chance to run */
- field->port->machine->scheduler().synchronize();
-// logerror("%s - Read coin port during Z80 NMI\n", machine->describe_context());
+ field->port->machine().scheduler().synchronize();
+// logerror("%s - Read coin port during Z80 NMI\n", machine.describe_context());
}
return ret;
@@ -97,7 +97,7 @@ static CUSTOM_INPUT( z80_nmi_r )
static CUSTOM_INPUT( mcu_status_r )
{
- psikyo_state *state = field->port->machine->driver_data<psikyo_state>();
+ psikyo_state *state = field->port->machine().driver_data<psikyo_state>();
int ret = 0x00;
/* Don't know exactly what this bit is, but s1945 and tengai
@@ -126,9 +126,9 @@ static READ32_HANDLER( sngkace_input_r )
{
switch (offset)
{
- case 0x0: return input_port_read(space->machine, "P1_P2");
- case 0x1: return input_port_read(space->machine, "DSW");
- case 0x2: return input_port_read(space->machine, "COIN");
+ case 0x0: return input_port_read(space->machine(), "P1_P2");
+ case 0x1: return input_port_read(space->machine(), "DSW");
+ case 0x2: return input_port_read(space->machine(), "COIN");
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(space->cpu), offset * 2);
return 0;
}
@@ -138,8 +138,8 @@ static READ32_HANDLER( gunbird_input_r )
{
switch (offset)
{
- case 0x0: return input_port_read(space->machine, "P1_P2");
- case 0x1: return input_port_read(space->machine, "DSW");
+ case 0x0: return input_port_read(space->machine(), "P1_P2");
+ case 0x1: return input_port_read(space->machine(), "DSW");
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(space->cpu), offset * 2);
return 0;
}
@@ -148,7 +148,7 @@ static READ32_HANDLER( gunbird_input_r )
static TIMER_CALLBACK( psikyo_soundlatch_callback )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
state->soundlatch = param;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
state->z80_nmi = 1;
@@ -157,7 +157,7 @@ static TIMER_CALLBACK( psikyo_soundlatch_callback )
static WRITE32_HANDLER( psikyo_soundlatch_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(psikyo_soundlatch_callback), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(psikyo_soundlatch_callback), data & 0xff);
}
/***************************************************************************
@@ -167,7 +167,7 @@ static WRITE32_HANDLER( psikyo_soundlatch_w )
static WRITE32_HANDLER( s1945_soundlatch_w )
{
if (ACCESSING_BITS_16_23)
- space->machine->scheduler().synchronize(FUNC(psikyo_soundlatch_callback), (data >> 16) & 0xff);
+ space->machine().scheduler().synchronize(FUNC(psikyo_soundlatch_callback), (data >> 16) & 0xff);
}
static const UINT8 s1945_table[256] = {
@@ -190,7 +190,7 @@ static const UINT8 s1945j_table[256] = {
static WRITE32_HANDLER( s1945_mcu_w )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
// Accesses are always bytes, so resolve it
int suboff;
@@ -213,8 +213,8 @@ static WRITE32_HANDLER( s1945_mcu_w )
state->s1945_mcu_direction = data;
break;
case 0x07:
- psikyo_switch_banks(space->machine, 1, (data >> 6) & 3);
- psikyo_switch_banks(space->machine, 0, (data >> 4) & 3);
+ psikyo_switch_banks(space->machine(), 1, (data >> 6) & 3);
+ psikyo_switch_banks(space->machine(), 0, (data >> 4) & 3);
state->s1945_mcu_bctrl = data;
break;
case 0x0b:
@@ -262,7 +262,7 @@ static WRITE32_HANDLER( s1945_mcu_w )
static READ32_HANDLER( s1945_mcu_r )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
switch (offset)
{
@@ -292,8 +292,8 @@ static READ32_HANDLER( s1945_input_r )
{
switch (offset)
{
- case 0x0: return input_port_read(space->machine, "P1_P2");
- case 0x1: return (input_port_read(space->machine, "DSW") & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
+ case 0x0: return input_port_read(space->machine(), "P1_P2");
+ case 0x1: return (input_port_read(space->machine(), "DSW") & 0xffff000f) | s1945_mcu_r(space, offset - 1, mem_mask);
case 0x2: return s1945_mcu_r(space, offset - 1, mem_mask);
default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(space->cpu), offset * 2);
return 0;
@@ -332,7 +332,7 @@ ADDRESS_MAP_END
static READ32_HANDLER( s1945bl_oki_r )
{
- UINT8 dat = space->machine->device<okim6295_device>("oki")->read(*space, 0);
+ UINT8 dat = space->machine().device<okim6295_device>("oki")->read(*space, 0);
return dat << 24;
}
@@ -340,7 +340,7 @@ static WRITE32_HANDLER( s1945bl_oki_w )
{
if (ACCESSING_BITS_24_31)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->write(*space, 0, data >> 24);
}
@@ -349,7 +349,7 @@ static WRITE32_HANDLER( s1945bl_oki_w )
// not at all sure about this, it seems to write 0 too often
UINT8 bank = (data & 0x00ff0000) >> 16;
if (bank < 4)
- memory_set_bank(space->machine, "okibank", bank);
+ memory_set_bank(space->machine(), "okibank", bank);
}
if (ACCESSING_BITS_8_15)
@@ -393,19 +393,19 @@ ADDRESS_MAP_END
static void sound_irq( device_t *device, int irq )
{
- psikyo_state *state = device->machine->driver_data<psikyo_state>();
+ psikyo_state *state = device->machine().driver_data<psikyo_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_HANDLER( psikyo_soundlatch_r )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
return state->soundlatch;
}
static WRITE8_HANDLER( psikyo_clear_nmi_w )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
state->z80_nmi = 0;
}
@@ -417,7 +417,7 @@ static WRITE8_HANDLER( psikyo_clear_nmi_w )
static WRITE8_HANDLER( sngkace_sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static ADDRESS_MAP_START( sngkace_sound_map, AS_PROGRAM, 8 )
@@ -441,7 +441,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( gunbird_sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", (data >> 4) & 0x03);
+ memory_set_bank(space->machine(), "bank1", (data >> 4) & 0x03);
}
static ADDRESS_MAP_START( gunbird_sound_map, AS_PROGRAM, 8 )
@@ -1029,9 +1029,9 @@ GFXDECODE_END
static MACHINE_START( psikyo )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->soundlatch));
state->save_item(NAME(state->z80_nmi));
@@ -1042,7 +1042,7 @@ static MACHINE_START( psikyo )
static MACHINE_RESET( psikyo )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
state->soundlatch = 0;
state->z80_nmi = 0;
@@ -1194,7 +1194,7 @@ MACHINE_CONFIG_END
static void irqhandler( device_t *device, int linestate )
{
- psikyo_state *state = device->machine->driver_data<psikyo_state>();
+ psikyo_state *state = device->machine().driver_data<psikyo_state>();
device_set_input_line(state->audiocpu, 0, linestate ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1826,11 +1826,11 @@ ROM_END
static DRIVER_INIT( sngkace )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
{
- UINT8 *RAM = machine->region("ymsnd")->base();
- int len = machine->region("ymsnd")->bytes();
+ UINT8 *RAM = machine.region("ymsnd")->base();
+ int len = machine.region("ymsnd")->bytes();
int i;
/* Bit 6&7 of the samples are swapped. Naughty, naughty... */
@@ -1842,21 +1842,21 @@ static DRIVER_INIT( sngkace )
}
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(sngkace_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(sngkace_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(psikyo_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(psikyo_soundlatch_w));
state->ka302c_banking = 0; // SH201B doesn't have any gfx banking
/* setup audiocpu banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
/* Enable other regions */
#if 0
- if (!strcmp(machine->system().name,"sngkace"))
+ if (!strcmp(machine.system().name,"sngkace"))
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x995] = 0x4e;
ROM[0x994] = 0x71;
ROM[0x997] = 0x4e;
@@ -1866,9 +1866,9 @@ static DRIVER_INIT( sngkace )
#endif
}
-static void s1945_mcu_init( running_machine *machine )
+static void s1945_mcu_init( running_machine &machine )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
state->s1945_mcu_direction = 0x00;
state->s1945_mcu_inlatch = 0xff;
state->s1945_mcu_latch1 = 0xff;
@@ -1892,16 +1892,16 @@ static void s1945_mcu_init( running_machine *machine )
static DRIVER_INIT( tengai )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
s1945_mcu_init(machine);
state->s1945_mcu_table = 0;
@@ -1910,39 +1910,39 @@ static DRIVER_INIT( tengai )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( gunbird )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(psikyo_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(psikyo_soundlatch_w));
state->ka302c_banking = 1;
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945 )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
/* protection and tile bank switching */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
s1945_mcu_init(machine);
state->s1945_mcu_table = s1945_table;
@@ -1951,21 +1951,21 @@ static DRIVER_INIT( s1945 )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945a )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
/* protection and tile bank switching */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
s1945_mcu_init(machine);
state->s1945_mcu_table = s1945a_table;
@@ -1974,21 +1974,21 @@ static DRIVER_INIT( s1945a )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945j )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(s1945_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
/* protection and tile bank switching */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00004, 0xc0000b, FUNC(s1945_mcu_w));
s1945_mcu_init(machine);
state->s1945_mcu_table = s1945j_table;
@@ -1997,39 +1997,39 @@ static DRIVER_INIT( s1945j )
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945jn )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
state->ka302c_banking = 1;
/* setup audiocpu banks */
/* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000 + 0x200, 0x8000);
}
static DRIVER_INIT( s1945bl )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00000, 0xc0000b, FUNC(gunbird_input_r));
/* sound latch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00010, 0xc00013, FUNC(s1945_soundlatch_w));
state->ka302c_banking = 1;
- memory_configure_bank(machine, "okibank", 0, 4, machine->region("oki")->base() + 0x30000, 0x10000);
+ memory_configure_bank(machine, "okibank", 0, 4, machine.region("oki")->base() + 0x30000, 0x10000);
memory_set_bank(machine, "okibank", 0);
}
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index 432511cace6..c62577556c9 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -183,7 +183,7 @@ static READ32_DEVICE_HANDLER( ps4_eeprom_r )
{
if (ACCESSING_BITS_16_31)
{
- return input_port_read(device->machine, "JP4");
+ return input_port_read(device->machine(), "JP4");
}
// logerror("Unk EEPROM read mask %x\n", mem_mask);
@@ -198,27 +198,27 @@ static INTERRUPT_GEN(psikyosh_interrupt)
static CUSTOM_INPUT( system_port_r )
{
- return input_port_read(field->port->machine, "SYSTEM");
+ return input_port_read(field->port->machine(), "SYSTEM");
}
static CUSTOM_INPUT( mahjong_ctrl_r ) /* used by hotgmck/hgkairak */
{
- psikyo4_state *state = field->port->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = field->port->machine().driver_data<psikyo4_state>();
int player = (FPTR)param;
int sel = (state->io_select[0] & 0x0000ff00) >> 8;
int ret = 0xff;
- if (sel & 1) ret &= input_port_read(field->port->machine, player ? "KEY4" : "KEY0" );
- if (sel & 2) ret &= input_port_read(field->port->machine, player ? "KEY5" : "KEY1" );
- if (sel & 4) ret &= input_port_read(field->port->machine, player ? "KEY6" : "KEY2" );
- if (sel & 8) ret &= input_port_read(field->port->machine, player ? "KEY7" : "KEY3" );
+ if (sel & 1) ret &= input_port_read(field->port->machine(), player ? "KEY4" : "KEY0" );
+ if (sel & 2) ret &= input_port_read(field->port->machine(), player ? "KEY5" : "KEY1" );
+ if (sel & 4) ret &= input_port_read(field->port->machine(), player ? "KEY6" : "KEY2" );
+ if (sel & 8) ret &= input_port_read(field->port->machine(), player ? "KEY7" : "KEY3" );
return ret;
}
static WRITE32_HANDLER( ps4_paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
int r, g, b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -226,13 +226,13 @@ static WRITE32_HANDLER( ps4_paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_
g = ((state->paletteram[offset] & 0x00ff0000) >> 16);
r = ((state->paletteram[offset] & 0xff000000) >> 24);
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset + 0x800, MAKE_RGB(r, g, b)); // For screen 2
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset + 0x800, MAKE_RGB(r, g, b)); // For screen 2
}
static WRITE32_HANDLER( ps4_bgpen_1_dword_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
int r, g, b;
COMBINE_DATA(&state->bgpen_1[0]);
@@ -240,12 +240,12 @@ static WRITE32_HANDLER( ps4_bgpen_1_dword_w )
g = ((state->bgpen_1[0] & 0x00ff0000) >>16);
r = ((state->bgpen_1[0] & 0xff000000) >>24);
- palette_set_color(space->machine, 0x1000, MAKE_RGB(r, g, b)); // Clear colour for screen 1
+ palette_set_color(space->machine(), 0x1000, MAKE_RGB(r, g, b)); // Clear colour for screen 1
}
static WRITE32_HANDLER( ps4_bgpen_2_dword_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
int r, g, b;
COMBINE_DATA(&state->bgpen_2[0]);
@@ -253,12 +253,12 @@ static WRITE32_HANDLER( ps4_bgpen_2_dword_w )
g = ((state->bgpen_2[0] & 0x00ff0000) >>16);
r = ((state->bgpen_2[0] & 0xff000000) >>24);
- palette_set_color(space->machine, 0x1001, MAKE_RGB(r, g, b)); // Clear colour for screen 2
+ palette_set_color(space->machine(), 0x1001, MAKE_RGB(r, g, b)); // Clear colour for screen 2
}
static WRITE32_HANDLER( ps4_screen1_brt_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
if (ACCESSING_BITS_0_7)
{
@@ -274,7 +274,7 @@ static WRITE32_HANDLER( ps4_screen1_brt_w )
int i;
for (i = 0; i < 0x800; i++)
- palette_set_pen_contrast(space->machine, i, brt1);
+ palette_set_pen_contrast(space->machine(), i, brt1);
state->oldbrt1 = brt1;
}
@@ -289,7 +289,7 @@ static WRITE32_HANDLER( ps4_screen1_brt_w )
static WRITE32_HANDLER( ps4_screen2_brt_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
if (ACCESSING_BITS_0_7)
{
@@ -306,7 +306,7 @@ static WRITE32_HANDLER( ps4_screen2_brt_w )
int i;
for (i = 0x800; i < 0x1000; i++)
- palette_set_pen_contrast(space->machine, i, brt2);
+ palette_set_pen_contrast(space->machine(), i, brt2);
state->oldbrt2 = brt2;
}
@@ -321,7 +321,7 @@ static WRITE32_HANDLER( ps4_screen2_brt_w )
static WRITE32_HANDLER( ps4_vidregs_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
COMBINE_DATA(&state->vidregs[offset]);
#if ROMTEST
@@ -329,8 +329,8 @@ static WRITE32_HANDLER( ps4_vidregs_w )
{
if (ACCESSING_BITS_0_15) // Bank
{
-// memory_set_bank(space->machine, "bank2", state->vidregs[offset] & 0x1fff); /* Bank comes from vidregs */
- memory_set_bankptr(space->machine, "bank2", space->machine->region("gfx1")->base() + 0x2000 * (state->vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */ }
+// memory_set_bank(space->machine(), "bank2", state->vidregs[offset] & 0x1fff); /* Bank comes from vidregs */
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region("gfx1")->base() + 0x2000 * (state->vidregs[offset] & 0x1fff)); /* Bank comes from vidregs */ }
}
#endif
}
@@ -338,26 +338,26 @@ static WRITE32_HANDLER( ps4_vidregs_w )
#if ROMTEST
static READ32_HANDLER( ps4_sample_r ) /* Send sample data for test */
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
- UINT8 *ROM = space->machine->region("ymf")->base();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
+ UINT8 *ROM = space->machine().region("ymf")->base();
return ROM[state->sample_offs++] << 16;
}
#endif
#define PCM_BANK_NO(n) ((state->io_select[0] >> (n * 4 + 24)) & 0x07)
-static void set_hotgmck_pcm_bank( running_machine *machine, int n )
+static void set_hotgmck_pcm_bank( running_machine &machine, int n )
{
- psikyo4_state *state = machine->driver_data<psikyo4_state>();
- UINT8 *ymf_pcmbank = machine->region("ymf")->base() + 0x200000;
- UINT8 *pcm_rom = machine->region("ymfsource")->base();
+ psikyo4_state *state = machine.driver_data<psikyo4_state>();
+ UINT8 *ymf_pcmbank = machine.region("ymf")->base() + 0x200000;
+ UINT8 *pcm_rom = machine.region("ymfsource")->base();
memcpy(ymf_pcmbank + n * 0x100000, pcm_rom + PCM_BANK_NO(n) * 0x100000, 0x100000);
}
static WRITE32_HANDLER( hotgmck_pcm_bank_w )
{
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
int old_bank0 = PCM_BANK_NO(0);
int old_bank1 = PCM_BANK_NO(1);
int new_bank0, new_bank1;
@@ -368,10 +368,10 @@ static WRITE32_HANDLER( hotgmck_pcm_bank_w )
new_bank1 = PCM_BANK_NO(1);
if (old_bank0 != new_bank0)
- set_hotgmck_pcm_bank(space->machine, 0);
+ set_hotgmck_pcm_bank(space->machine(), 0);
if (old_bank1 != new_bank1)
- set_hotgmck_pcm_bank(space->machine, 1);
+ set_hotgmck_pcm_bank(space->machine(), 1);
}
static ADDRESS_MAP_START( ps4_map, AS_PROGRAM, 32 )
@@ -687,7 +687,7 @@ INPUT_PORTS_END
static void irqhandler( device_t *device, int linestate )
{
- psikyo4_state *state = device->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = device->machine().driver_data<psikyo4_state>();
device_set_input_line(state->maincpu, 12, linestate ? ASSERT_LINE : CLEAR_LINE);
}
@@ -699,13 +699,13 @@ static const ymf278b_interface ymf278b_config =
static MACHINE_START( psikyo4 )
{
- psikyo4_state *state = machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = machine.driver_data<psikyo4_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
#if ROMTEST
// FIXME: Too many banks! it cannot be handled in this way, currently
-// memory_configure_bank(machine, "bank2", 0, 0x2000, machine->region("gfx1")->base(), 0x2000);
+// memory_configure_bank(machine, "bank2", 0, 0x2000, machine.region("gfx1")->base(), 0x2000);
state->sample_offs = 0;
state->save_item(NAME(state->sample_offs));
@@ -717,7 +717,7 @@ static MACHINE_START( psikyo4 )
static MACHINE_RESET( psikyo4 )
{
- psikyo4_state *state = machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = machine.driver_data<psikyo4_state>();
state->oldbrt1 = -1;
state->oldbrt2 = -1;
@@ -1009,7 +1009,7 @@ PC :00001B44: MOV.L @R1,R2
PC :00001B46: TST R2,R2
PC :00001B48: BT $00001B3C
*/
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
if (cpu_get_pc(space->cpu) == 0x00001b3e)
device_spin_until_interrupt(space->cpu);
@@ -1028,7 +1028,7 @@ PC :00001B50: MOV.L @R1,R2
PC :00001B52: TST R2,R2
PC :00001B54: BT $00001B48
*/
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
if (cpu_get_pc(space->cpu) == 0x00001b4a)
device_spin_until_interrupt(space->cpu);
@@ -1047,7 +1047,7 @@ PC :000029F4: MOV.L @R1,R3
PC :000029F6: TST R3,R3
PC :000029F8: BT $000029EC
*/
- psikyo4_state *state = space->machine->driver_data<psikyo4_state>();
+ psikyo4_state *state = space->machine().driver_data<psikyo4_state>();
if (cpu_get_pc(space->cpu) == 0x000029ee)
device_spin_until_interrupt(space->cpu);
@@ -1060,11 +1060,11 @@ static STATE_POSTLOAD( hotgmck_pcm_bank_postload )
set_hotgmck_pcm_bank(machine, (FPTR)param);
}
-static void install_hotgmck_pcm_bank(running_machine *machine)
+static void install_hotgmck_pcm_bank(running_machine &machine)
{
- psikyo4_state *state = machine->driver_data<psikyo4_state>();
- UINT8 *ymf_pcm = machine->region("ymf")->base();
- UINT8 *pcm_rom = machine->region("ymfsource")->base();
+ psikyo4_state *state = machine.driver_data<psikyo4_state>();
+ UINT8 *ymf_pcm = machine.region("ymf")->base();
+ UINT8 *pcm_rom = machine.region("ymfsource")->base();
memcpy(ymf_pcm, pcm_rom, 0x200000);
@@ -1072,31 +1072,31 @@ static void install_hotgmck_pcm_bank(running_machine *machine)
set_hotgmck_pcm_bank(machine, 0);
set_hotgmck_pcm_bank(machine, 1);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5800008, 0x580000b, FUNC(hotgmck_pcm_bank_w) );
- machine->state().register_postload(hotgmck_pcm_bank_postload, (void *)0);
- machine->state().register_postload(hotgmck_pcm_bank_postload, (void *)1);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5800008, 0x580000b, FUNC(hotgmck_pcm_bank_w) );
+ machine.state().register_postload(hotgmck_pcm_bank_postload, (void *)0);
+ machine.state().register_postload(hotgmck_pcm_bank_postload, (void *)1);
}
static DRIVER_INIT( hotgmck )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
install_hotgmck_pcm_bank(machine); // Banked PCM ROM
}
static DRIVER_INIT( loderndf )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000020, 0x6000023, FUNC(loderndf_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000020, 0x6000023, FUNC(loderndf_speedup_r) );
}
static DRIVER_INIT( loderdfa )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000020, 0x6000023, FUNC(loderdfa_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000020, 0x6000023, FUNC(loderdfa_speedup_r) );
}
static DRIVER_INIT( hotdebut )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x600001c, 0x600001f, FUNC(hotdebut_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x600001c, 0x600001f, FUNC(hotdebut_speedup_r) );
}
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index 2dcaa61bf5f..67465ac0528 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -337,7 +337,7 @@ static READ32_DEVICE_HANDLER( psh_eeprom_r )
{
if (ACCESSING_BITS_24_31)
{
- return input_port_read(device->machine, "JP4");
+ return input_port_read(device->machine(), "JP4");
}
logerror("Unk EEPROM read mask %x\n", mem_mask);
@@ -354,7 +354,7 @@ static INTERRUPT_GEN(psikyosh_interrupt)
// bit 0 controls game speed on readback, mechanism is a little weird
static WRITE32_HANDLER( psikyosh_irqctrl_w )
{
- psikyosh_state *state = space->machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = space->machine().driver_data<psikyosh_state>();
if (!(data & 0x00c00000))
{
device_set_input_line(state->maincpu, 4, CLEAR_LINE);
@@ -363,7 +363,7 @@ static WRITE32_HANDLER( psikyosh_irqctrl_w )
static WRITE32_HANDLER( paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
{
- psikyosh_state *state = space->machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = space->machine().driver_data<psikyosh_state>();
int r, g, b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -371,25 +371,25 @@ static WRITE32_HANDLER( paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
g = ((state->paletteram[offset] & 0x00ff0000) >>16);
r = ((state->paletteram[offset] & 0xff000000) >>24);
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
static WRITE32_HANDLER( psikyosh_vidregs_w )
{
- psikyosh_state *state = space->machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = space->machine().driver_data<psikyosh_state>();
COMBINE_DATA(&state->vidregs[offset]);
if (offset == 4) /* Configure bank for gfx test */
{
if (ACCESSING_BITS_0_15) // Bank
- memory_set_bank(space->machine, "bank2", state->vidregs[offset] & 0xfff);
+ memory_set_bank(space->machine(), "bank2", state->vidregs[offset] & 0xfff);
}
}
static READ32_HANDLER( psh_sample_r ) /* Send sample data for test */
{
- psikyosh_state *state = space->machine->driver_data<psikyosh_state>();
- UINT8 *ROM = space->machine->region("ymf")->base();
+ psikyosh_state *state = space->machine().driver_data<psikyosh_state>();
+ UINT8 *ROM = space->machine().region("ymf")->base();
return ROM[state->sample_offs++] << 16;
}
@@ -447,8 +447,8 @@ P1KEY11 29|30 P2KEY11
GND 55|56 GND
*/
- UINT32 controls = input_port_read(space->machine, "CONTROLLER");
- UINT32 value = input_port_read(space->machine, "INPUTS");
+ UINT32 controls = input_port_read(space->machine(), "CONTROLLER");
+ UINT32 value = input_port_read(space->machine(), "INPUTS");
if(controls) {
// Clearly has ghosting, game will only recognise one key depressed at once, and keyboard can only represent keys with distinct rows and columns
@@ -493,7 +493,7 @@ P1KEY11 29|30 P2KEY11
KEY11 | KEY6, // Ron
KEY1 | KEY3 // Start
}; // generic Mahjong keyboard encoder, corresponds to ordering in input port
- UINT32 keys = input_port_read(space->machine, "MAHJONG");
+ UINT32 keys = input_port_read(space->machine(), "MAHJONG");
UINT32 which_key = 0x1;
int count = 0;
@@ -788,7 +788,7 @@ INPUT_PORTS_END
static void irqhandler(device_t *device, int linestate)
{
- psikyosh_state *state = device->machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = device->machine().driver_data<psikyosh_state>();
device_set_input_line(state->maincpu, 12, linestate ? ASSERT_LINE : CLEAR_LINE);
}
@@ -800,11 +800,11 @@ static const ymf278b_interface ymf278b_config =
static MACHINE_START( psikyosh )
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
- memory_configure_bank(machine, "bank2", 0, 0x1000, machine->region("gfx1")->base(), 0x20000);
+ memory_configure_bank(machine, "bank2", 0, 0x1000, machine.region("gfx1")->base(), 0x20000);
state->sample_offs = 0;
state->save_item(NAME(state->sample_offs));
@@ -1217,60 +1217,60 @@ ROM_END
static DRIVER_INIT( soldivid )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( s1945ii )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( daraku )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( sbomberb )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( gunbird2 )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( s1945iii )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &RAM[0x100000]);
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( dragnblz )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( gnbarich )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( tgm2 )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
static DRIVER_INIT( mjgtaste )
{
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
/* needs to install mahjong controls too (can select joystick in test mode tho) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x03000000, 0x03000003, FUNC(mjgtaste_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x03000000, 0x03000003, FUNC(mjgtaste_input_r));
}
diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c
index 1da68bd9eaa..d3f0314cd56 100644
--- a/src/mame/drivers/psychic5.c
+++ b/src/mame/drivers/psychic5.c
@@ -318,7 +318,7 @@ The first sprite data is located at f20b,then f21b and so on.
static MACHINE_RESET( psychic5 )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
state->bank_latch = 0xff;
flip_screen_set(machine, 0);
}
@@ -346,47 +346,47 @@ static INTERRUPT_GEN( psychic5_interrupt )
static READ8_HANDLER( psychic5_bankselect_r )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
return state->bank_latch;
}
static WRITE8_HANDLER( psychic5_bankselect_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bankaddress;
if (state->bank_latch != data)
{
state->bank_latch = data;
bankaddress = 0x10000 + ((data & 3) * 0x4000);
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]); /* Select 4 banks of 16k */
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]); /* Select 4 banks of 16k */
}
}
static WRITE8_HANDLER( bombsa_bankselect_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bankaddress;
if (state->bank_latch != data)
{
state->bank_latch = data;
bankaddress = 0x10000 + ((data & 7) * 0x4000);
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
}
}
static WRITE8_HANDLER( psychic5_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
// bit 7 toggles flip screen
if (data & 0x80)
{
- flip_screen_set(space->machine, !flip_screen_get(space->machine));
+ flip_screen_set(space->machine(), !flip_screen_get(space->machine()));
}
}
@@ -395,7 +395,7 @@ static WRITE8_HANDLER( bombsa_flipscreen_w )
// bit 7 toggles flip screen
if (data & 0x80)
{
- flip_screen_set(space->machine, !flip_screen_get(space->machine));
+ flip_screen_set(space->machine(), !flip_screen_get(space->machine()));
}
}
@@ -646,7 +646,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 97140e800de..7c94324a81c 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -113,7 +113,7 @@ static const UINT8 tile_lookup[0x10]=
static TILE_GET_INFO( get_pturn_tile_info )
{
- pturn_state *state = machine->driver_data<pturn_state>();
+ pturn_state *state = machine.driver_data<pturn_state>();
UINT8 *videoram = state->videoram;
int tileno;
tileno = videoram[tile_index];
@@ -127,9 +127,9 @@ static TILE_GET_INFO( get_pturn_tile_info )
static TILE_GET_INFO( get_pturn_bg_tile_info )
{
- pturn_state *state = machine->driver_data<pturn_state>();
+ pturn_state *state = machine.driver_data<pturn_state>();
int tileno,palno;
- tileno = machine->region("user1")->base()[tile_index];
+ tileno = machine.region("user1")->base()[tile_index];
palno=state->bgpalette;
if(palno==1)
{
@@ -140,7 +140,7 @@ static TILE_GET_INFO( get_pturn_bg_tile_info )
static VIDEO_START(pturn)
{
- pturn_state *state = machine->driver_data<pturn_state>();
+ pturn_state *state = machine.driver_data<pturn_state>();
state->fgmap = tilemap_create(machine, get_pturn_tile_info,tilemap_scan_rows,8, 8,32,32);
tilemap_set_transparent_pen(state->fgmap,0);
state->bgmap = tilemap_create(machine, get_pturn_bg_tile_info,tilemap_scan_rows,8, 8,32,32*8);
@@ -149,7 +149,7 @@ static VIDEO_START(pturn)
static SCREEN_UPDATE(pturn)
{
- pturn_state *state = screen->machine->driver_data<pturn_state>();
+ pturn_state *state = screen->machine().driver_data<pturn_state>();
UINT8 *spriteram = state->spriteram;
int offs;
int sx, sy;
@@ -166,13 +166,13 @@ static SCREEN_UPDATE(pturn)
flipy=spriteram[offs+1]&0x80;
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
{
sx = 224 - sx;
flipx ^= 0x40;
}
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
{
flipy ^= 0x80;
sy = 224 - sy;
@@ -180,7 +180,7 @@ static SCREEN_UPDATE(pturn)
if(sx|sy)
{
- drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[2],
spriteram[offs+1] & 0x3f ,
(spriteram[offs+2] & 0x1f),
flipx, flipy,
@@ -205,7 +205,7 @@ READ8_HANDLER (pturn_protection2_r)
static WRITE8_HANDLER( pturn_videoram_w )
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
UINT8 *videoram = state->videoram;
videoram[offset]=data;
tilemap_mark_tile_dirty(state->fgmap,offset);
@@ -214,13 +214,13 @@ static WRITE8_HANDLER( pturn_videoram_w )
static WRITE8_HANDLER( nmi_main_enable_w )
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->nmi_main = data;
}
static WRITE8_HANDLER( nmi_sub_enable_w )
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->nmi_sub = data;
}
@@ -232,13 +232,13 @@ static WRITE8_HANDLER(sound_w)
static WRITE8_HANDLER(bgcolor_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->bgcolor=data;
}
static WRITE8_HANDLER(bg_scrollx_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
tilemap_set_scrolly(state->bgmap, 0, (data>>5)*32*8);
state->bgpalette=data&0x1f;
tilemap_mark_all_tiles_dirty(state->bgmap);
@@ -246,34 +246,34 @@ static WRITE8_HANDLER(bg_scrollx_w)
static WRITE8_HANDLER(fgpalette_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->fgpalette=data&0x1f;
tilemap_mark_all_tiles_dirty(state->fgmap);
}
static WRITE8_HANDLER(bg_scrolly_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
tilemap_set_scrollx(state->bgmap, 0, data);
}
static WRITE8_HANDLER(fgbank_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->fgbank=data&1;
tilemap_mark_all_tiles_dirty(state->fgmap);
}
static WRITE8_HANDLER(bgbank_w)
{
- pturn_state *state = space->machine->driver_data<pturn_state>();
+ pturn_state *state = space->machine().driver_data<pturn_state>();
state->bgbank=data&1;
tilemap_mark_all_tiles_dirty(state->bgmap);
}
static WRITE8_HANDLER(flip_w)
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
@@ -454,7 +454,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( pturn_sub_intgen )
{
- pturn_state *state = device->machine->driver_data<pturn_state>();
+ pturn_state *state = device->machine().driver_data<pturn_state>();
if(state->nmi_sub)
{
device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
@@ -463,7 +463,7 @@ static INTERRUPT_GEN( pturn_sub_intgen )
static INTERRUPT_GEN( pturn_main_intgen )
{
- pturn_state *state = device->machine->driver_data<pturn_state>();
+ pturn_state *state = device->machine().driver_data<pturn_state>();
if (state->nmi_main)
{
device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
@@ -472,7 +472,7 @@ static INTERRUPT_GEN( pturn_main_intgen )
static MACHINE_RESET( pturn )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
soundlatch_clear_w(space,0,0);
}
@@ -552,8 +552,8 @@ ROM_END
static DRIVER_INIT(pturn)
{
/*
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0dd, 0xc0dd, FUNC(pturn_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0db, 0xc0db, FUNC(pturn_protection2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0dd, 0xc0dd, FUNC(pturn_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc0db, 0xc0db, FUNC(pturn_protection2_r));
*/
}
diff --git a/src/mame/drivers/puckpkmn.c b/src/mame/drivers/puckpkmn.c
index a081037a9d4..5df59d2e361 100644
--- a/src/mame/drivers/puckpkmn.c
+++ b/src/mame/drivers/puckpkmn.c
@@ -260,8 +260,8 @@ Screenshots available on my site at http://guru.mameworld.info/oldnews2001.html
static DRIVER_INIT( puckpkmn )
{
- UINT8 *rom = machine->region("maincpu")->base();
- size_t len = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t len = machine.region("maincpu")->bytes();
int i;
for (i = 0; i < len; i++)
diff --git a/src/mame/drivers/punchout.c b/src/mame/drivers/punchout.c
index 62044d2c6e1..15eb329ccd7 100644
--- a/src/mame/drivers/punchout.c
+++ b/src/mame/drivers/punchout.c
@@ -122,7 +122,7 @@ DIP locations verified for:
static CUSTOM_INPUT( punchout_vlm5030_busy_r )
{
/* bit 4 of DSW1 is busy pin level */
- return (vlm5030_bsy(field->port->machine->device("vlm"))) ? 0x00 : 0x01;
+ return (vlm5030_bsy(field->port->machine().device("vlm"))) ? 0x00 : 0x01;
}
static WRITE8_DEVICE_HANDLER( punchout_speech_reset_w )
@@ -143,15 +143,15 @@ static WRITE8_DEVICE_HANDLER( punchout_speech_vcu_w )
static WRITE8_HANDLER( punchout_2a03_reset_w )
{
if (data & 1)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
static READ8_HANDLER( spunchout_rp5c01_r )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
logerror("%04x: prot_r %x\n", cpu_get_previouspc(space->cpu), offset);
if (offset <= 0x0c)
@@ -262,7 +262,7 @@ static READ8_HANDLER( spunchout_rp5c01_r )
static WRITE8_HANDLER( spunchout_rp5c01_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
data &= 0x0f;
logerror("%04x: prot_w %x = %02x\n",cpu_get_previouspc(space->cpu),offset,data);
@@ -918,7 +918,7 @@ static const nes_interface nes_config =
static MACHINE_RESET( punchout )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->rp5c01_mode_sel = 0;
memset(state->rp5c01_mem, 0, sizeof(state->rp5c01_mem));
}
diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c
index 0479c4c071c..6df0ecc7428 100644
--- a/src/mame/drivers/pushman.c
+++ b/src/mame/drivers/pushman.c
@@ -35,9 +35,9 @@ static WRITE16_HANDLER( pushman_flipscreen_w )
{
if (ACCESSING_BITS_8_15)
{
- flip_screen_set(space->machine, data & 0x0200);
- coin_counter_w(space->machine, 0, data & 0x4000);
- coin_counter_w(space->machine, 1, data & 0x8000);
+ flip_screen_set(space->machine(), data & 0x0200);
+ coin_counter_w(space->machine(), 0, data & 0x4000);
+ coin_counter_w(space->machine(), 1, data & 0x8000);
}
}
@@ -49,7 +49,7 @@ static WRITE16_HANDLER( pushman_control_w )
static READ16_HANDLER( pushman_68705_r )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
if (offset == 0)
return state->latch;
@@ -67,7 +67,7 @@ static READ16_HANDLER( pushman_68705_r )
static WRITE16_HANDLER( pushman_68705_w )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
if (ACCESSING_BITS_8_15)
state->shared_ram[2 * offset] = data >> 8;
@@ -85,7 +85,7 @@ static WRITE16_HANDLER( pushman_68705_w )
/* ElSemi - Bouncing balls protection. */
static READ16_HANDLER( bballs_68705_r )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
if (offset == 0)
return state->latch;
@@ -102,7 +102,7 @@ static READ16_HANDLER( bballs_68705_r )
static WRITE16_HANDLER( bballs_68705_w )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
if (ACCESSING_BITS_8_15)
state->shared_ram[2 * offset] = data >> 8;
@@ -131,13 +131,13 @@ static WRITE16_HANDLER( bballs_68705_w )
static READ8_HANDLER( pushman_68000_r )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
return state->shared_ram[offset];
}
static WRITE8_HANDLER( pushman_68000_w )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
if (offset == 2 && (state->shared_ram[2] & 2) == 0 && data & 2)
{
@@ -391,7 +391,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- pushman_state *state = device->machine->driver_data<pushman_state>();
+ pushman_state *state = device->machine().driver_data<pushman_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -408,11 +408,11 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( pushman )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->control));
state->save_item(NAME(state->shared_ram));
@@ -422,7 +422,7 @@ static MACHINE_START( pushman )
static MACHINE_RESET( pushman )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
state->latch = 0;
state->new_latch = 0;
@@ -479,7 +479,7 @@ MACHINE_CONFIG_END
static MACHINE_RESET( bballs )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
MACHINE_RESET_CALL(pushman);
diff --git a/src/mame/drivers/pzletime.c b/src/mame/drivers/pzletime.c
index 9b12348cba5..8e3d38f5726 100644
--- a/src/mame/drivers/pzletime.c
+++ b/src/mame/drivers/pzletime.c
@@ -44,7 +44,7 @@ public:
static TILE_GET_INFO( get_mid_tile_info )
{
- pzletime_state *state = machine->driver_data<pzletime_state>();
+ pzletime_state *state = machine.driver_data<pzletime_state>();
int tileno = state->mid_videoram[tile_index] & 0x0fff;
int colour = state->mid_videoram[tile_index] & 0xf000;
colour = colour >> 12;
@@ -53,7 +53,7 @@ static TILE_GET_INFO( get_mid_tile_info )
static TILE_GET_INFO( get_txt_tile_info )
{
- pzletime_state *state = machine->driver_data<pzletime_state>();
+ pzletime_state *state = machine.driver_data<pzletime_state>();
int tileno = state->txt_videoram[tile_index] & 0x0fff;
int colour = state->txt_videoram[tile_index] & 0xf000;
colour = colour >> 12;
@@ -65,7 +65,7 @@ static TILE_GET_INFO( get_txt_tile_info )
static VIDEO_START( pzletime )
{
- pzletime_state *state = machine->driver_data<pzletime_state>();
+ pzletime_state *state = machine.driver_data<pzletime_state>();
state->mid_tilemap = tilemap_create(machine, get_mid_tile_info, tilemap_scan_cols, 16, 16, 64, 16);
state->txt_tilemap = tilemap_create(machine, get_txt_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -76,11 +76,11 @@ static VIDEO_START( pzletime )
static SCREEN_UPDATE( pzletime )
{
- pzletime_state *state = screen->machine->driver_data<pzletime_state>();
+ pzletime_state *state = screen->machine().driver_data<pzletime_state>();
int count;
int y, x;
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //bg pen
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //bg pen
tilemap_set_scrolly(state->txt_tilemap, 0, state->tilemap_regs[0] - 3);
tilemap_set_scrollx(state->txt_tilemap, 0, state->tilemap_regs[1]);
@@ -122,7 +122,7 @@ static SCREEN_UPDATE( pzletime )
// is spriteram[offs + 0] & 0x200 flipy? it's always set
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
}
}
@@ -135,14 +135,14 @@ static SCREEN_UPDATE( pzletime )
static WRITE16_HANDLER( mid_videoram_w )
{
- pzletime_state *state = space->machine->driver_data<pzletime_state>();
+ pzletime_state *state = space->machine().driver_data<pzletime_state>();
COMBINE_DATA(&state->mid_videoram[offset]);
tilemap_mark_tile_dirty(state->mid_tilemap, offset);
}
static WRITE16_HANDLER( txt_videoram_w )
{
- pzletime_state *state = space->machine->driver_data<pzletime_state>();
+ pzletime_state *state = space->machine().driver_data<pzletime_state>();
COMBINE_DATA(&state->txt_videoram[offset]);
tilemap_mark_tile_dirty(state->txt_tilemap, offset);
}
@@ -159,7 +159,7 @@ static WRITE16_DEVICE_HANDLER( eeprom_w )
static WRITE16_HANDLER( ticket_w )
{
- pzletime_state *state = space->machine->driver_data<pzletime_state>();
+ pzletime_state *state = space->machine().driver_data<pzletime_state>();
if (ACCESSING_BITS_0_7)
state->ticket = data & 1;
@@ -167,7 +167,7 @@ static WRITE16_HANDLER( ticket_w )
static WRITE16_HANDLER( video_regs_w )
{
- pzletime_state *state = space->machine->driver_data<pzletime_state>();
+ pzletime_state *state = space->machine().driver_data<pzletime_state>();
int i;
COMBINE_DATA(&state->video_regs[offset]);
@@ -178,7 +178,7 @@ static WRITE16_HANDLER( video_regs_w )
{
for (i = 0; i < 0x300; i++)
{
- palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)state->video_regs[0]);
+ palette_set_pen_contrast(space->machine(), i, (double)0x8000/(double)state->video_regs[0]);
}
}
}
@@ -188,7 +188,7 @@ static WRITE16_HANDLER( video_regs_w )
{
for (i = 0x300; i < 32768 + 0x300; i++)
{
- palette_set_pen_contrast(space->machine, i, (double)0x8000/(double)state->video_regs[1]);
+ palette_set_pen_contrast(space->machine(), i, (double)0x8000/(double)state->video_regs[1]);
}
}
}
@@ -201,8 +201,8 @@ static WRITE16_DEVICE_HANDLER( oki_bank_w )
static CUSTOM_INPUT( ticket_status_r )
{
- pzletime_state *state = field->port->machine->driver_data<pzletime_state>();
- return (state->ticket && !(field->port->machine->primary_screen->frame_number() % 128));
+ pzletime_state *state = field->port->machine().driver_data<pzletime_state>();
+ return (state->ticket && !(field->port->machine().primary_screen->frame_number() % 128));
}
static ADDRESS_MAP_START( pzletime_map, AS_PROGRAM, 16 )
@@ -294,14 +294,14 @@ static PALETTE_INIT( pzletime )
static MACHINE_START( pzletime )
{
- pzletime_state *state = machine->driver_data<pzletime_state>();
+ pzletime_state *state = machine.driver_data<pzletime_state>();
state->save_item(NAME(state->ticket));
}
static MACHINE_RESET( pzletime )
{
- pzletime_state *state = machine->driver_data<pzletime_state>();
+ pzletime_state *state = machine.driver_data<pzletime_state>();
state->ticket = 0;
}
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index 7722fe28be0..e8a5127900b 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -37,10 +37,10 @@ GP1 HDD data contents:
static CUSTOM_INPUT( inputs_r )
{
- qdrmfgp_state *state = field->port->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = field->port->machine().driver_data<qdrmfgp_state>();
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(field->port->machine, (state->control & 0x0080) ? tag1 : tag2);
+ return input_port_read(field->port->machine(), (state->control & 0x0080) ? tag1 : tag2);
}
static CUSTOM_INPUT( battery_sensor_r )
@@ -52,7 +52,7 @@ static CUSTOM_INPUT( battery_sensor_r )
static WRITE16_HANDLER( gp_control_w )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
/* bit 0 enable irq 1 (sound) */
/* bit 1 enable irq 2 (not used) */
@@ -71,11 +71,11 @@ static WRITE16_HANDLER( gp_control_w )
if (state->control & 0x0100)
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
int vol = state->m_nvram[0x10] & 0xff;
if (vol)
{
- device_t *k054539 = space->machine->device("konami");
+ device_t *k054539 = space->machine().device("konami");
int i;
double gain = vol / 90.0;
@@ -87,7 +87,7 @@ static WRITE16_HANDLER( gp_control_w )
static WRITE16_HANDLER( gp2_control_w )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
/* bit 2 enable irq 3 (sound) */
/* bit 3 enable irq 4 (vblank) */
@@ -104,11 +104,11 @@ static WRITE16_HANDLER( gp2_control_w )
if (state->control & 0x0100)
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
int vol = state->m_nvram[0x8] & 0xff;
if (vol)
{
- device_t *k054539 = space->machine->device("konami");
+ device_t *k054539 = space->machine().device("konami");
int i;
double gain = vol / 90.0;
@@ -121,9 +121,9 @@ static WRITE16_HANDLER( gp2_control_w )
static READ16_HANDLER( v_rom_r )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
- device_t *k056832 = space->machine->device("k056832");
- UINT8 *mem8 = space->machine->region("gfx1")->base();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
+ device_t *k056832 = space->machine().device("k056832");
+ UINT8 *mem8 = space->machine().region("gfx1")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset += bank * 0x800 * 4;
@@ -137,7 +137,7 @@ static READ16_HANDLER( v_rom_r )
static READ16_HANDLER( gp2_vram_r )
{
- device_t *k056832 = space->machine->device("k056832");
+ device_t *k056832 = space->machine().device("k056832");
if (offset < 0x1000 / 2)
return k056832_ram_word_r(k056832, offset * 2 + 1, mem_mask);
@@ -147,7 +147,7 @@ static READ16_HANDLER( gp2_vram_r )
static READ16_HANDLER( gp2_vram_mirror_r )
{
- device_t *k056832 = space->machine->device("k056832");
+ device_t *k056832 = space->machine().device("k056832");
if (offset < 0x1000 / 2)
return k056832_ram_word_r(k056832, offset * 2, mem_mask);
@@ -157,7 +157,7 @@ static READ16_HANDLER( gp2_vram_mirror_r )
static WRITE16_HANDLER( gp2_vram_w )
{
- device_t *k056832 = space->machine->device("k056832");
+ device_t *k056832 = space->machine().device("k056832");
if (offset < 0x1000 / 2)
k056832_ram_word_w(k056832, offset * 2 + 1, data, mem_mask);
@@ -167,7 +167,7 @@ static WRITE16_HANDLER( gp2_vram_w )
static WRITE16_HANDLER( gp2_vram_mirror_w )
{
- device_t *k056832 = space->machine->device("k056832");
+ device_t *k056832 = space->machine().device("k056832");
if (offset < 0x1000 / 2)
k056832_ram_word_w(k056832, offset * 2, data, mem_mask);
@@ -180,7 +180,7 @@ static WRITE16_HANDLER( gp2_vram_mirror_w )
static READ16_HANDLER( sndram_r )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
if (ACCESSING_BITS_0_7)
return state->sndram[offset];
@@ -189,7 +189,7 @@ static READ16_HANDLER( sndram_r )
static WRITE16_HANDLER( sndram_w )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
if (ACCESSING_BITS_0_7)
{
state->sndram[offset] = data & 0xff;
@@ -236,8 +236,8 @@ static WRITE16_DEVICE_HANDLER( ide_alt_w )
static READ16_HANDLER( gp2_ide_std_r )
{
- qdrmfgp_state *state = space->machine->driver_data<qdrmfgp_state>();
- device_t *device = space->machine->device("ide");
+ qdrmfgp_state *state = space->machine().driver_data<qdrmfgp_state>();
+ device_t *device = space->machine().device("ide");
if (offset & 0x01)
{
if (offset == 0x07)
@@ -269,7 +269,7 @@ static READ16_HANDLER( gp2_ide_std_r )
static INTERRUPT_GEN(qdrmfgp_interrupt)
{
- qdrmfgp_state *state = device->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>();
switch (cpu_getiloops(device))
{
case 0:
@@ -287,13 +287,13 @@ static INTERRUPT_GEN(qdrmfgp_interrupt)
static void ide_interrupt(device_t *device, int state)
{
- qdrmfgp_state *drvstate = device->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *drvstate = device->machine().driver_data<qdrmfgp_state>();
if (drvstate->control & 0x0008)
{
if (state != CLEAR_LINE)
- cputag_set_input_line(device->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 4, HOLD_LINE);
else
- cputag_set_input_line(device->machine, "maincpu", 4, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 4, CLEAR_LINE);
}
}
@@ -301,14 +301,14 @@ static void ide_interrupt(device_t *device, int state)
static TIMER_CALLBACK( gp2_timer_callback )
{
- qdrmfgp_state *state = machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
if (state->control & 0x0004)
cputag_set_input_line(machine, "maincpu", 3, HOLD_LINE);
}
static INTERRUPT_GEN(qdrmfgp2_interrupt)
{
- qdrmfgp_state *state = device->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>();
/* trigger V-blank interrupt */
if (state->control & 0x0008)
device_set_input_line(device, 4, HOLD_LINE);
@@ -316,7 +316,7 @@ static INTERRUPT_GEN(qdrmfgp2_interrupt)
static void gp2_ide_interrupt(device_t *device, int state)
{
- qdrmfgp_state *drvstate = device->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *drvstate = device->machine().driver_data<qdrmfgp_state>();
if (drvstate->control & 0x0010)
{
if (state != CLEAR_LINE)
@@ -324,11 +324,11 @@ static void gp2_ide_interrupt(device_t *device, int state)
if (drvstate->gp2_irq_control)
drvstate->gp2_irq_control = 0;
else
- cputag_set_input_line(device->machine, "maincpu", 5, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 5, HOLD_LINE);
}
else
{
- cputag_set_input_line(device->machine, "maincpu", 5, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 5, CLEAR_LINE);
}
}
}
@@ -574,9 +574,9 @@ INPUT_PORTS_END
static void sound_irq(device_t *device)
{
- qdrmfgp_state *state = device->machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>();
if (state->control & 0x0001)
- cputag_set_input_line(device->machine, "maincpu", 1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 1, HOLD_LINE);
}
static const k054539_interface k054539_config =
@@ -613,7 +613,7 @@ static const k056832_interface qdrmfgp2_k056832_intf =
static MACHINE_START( qdrmfgp )
{
- qdrmfgp_state *state = machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
state_save_register_global(machine, state->control);
state_save_register_global(machine, state->pal);
state_save_register_global(machine, state->gp2_irq_control);
@@ -622,15 +622,15 @@ static MACHINE_START( qdrmfgp )
static MACHINE_START( qdrmfgp2 )
{
/* sound irq (CCU? 240Hz) */
- machine->scheduler().timer_pulse(attotime::from_hz(18432000/76800), FUNC(gp2_timer_callback));
+ machine.scheduler().timer_pulse(attotime::from_hz(18432000/76800), FUNC(gp2_timer_callback));
MACHINE_START_CALL( qdrmfgp );
}
static MACHINE_RESET( qdrmfgp )
{
- qdrmfgp_state *state = machine->driver_data<qdrmfgp_state>();
- state->sndram = machine->region("konami")->base() + 0x100000;
+ qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
+ state->sndram = machine.region("konami")->base() + 0x100000;
/* reset the IDE controller */
state->gp2_irq_control = 0;
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index 1cbf4af2147..43fbc5f34ed 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1257,8 +1257,8 @@ static int kram3_decrypt(int address, int value)
static DRIVER_INIT( kram3 )
{
- address_space *mainspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *videospace = machine->device("videocpu")->memory().space(AS_PROGRAM);
+ address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *videospace = machine.device("videocpu")->memory().space(AS_PROGRAM);
//const UINT8 *patch;
UINT8 *rom, *decrypted;
int i;
@@ -1278,8 +1278,8 @@ static DRIVER_INIT( kram3 )
********************************/
i = 0;
- //patch = machine->region("user1")->base();
- rom = machine->region("maincpu")->base();
+ //patch = machine.region("user1")->base();
+ rom = machine.region("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
mainspace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1291,8 +1291,8 @@ static DRIVER_INIT( kram3 )
}
i = 0;
- //patch = machine->region("user2")->base();
- rom = machine->region("videocpu")->base();
+ //patch = machine.region("user2")->base();
+ rom = machine.region("videocpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x6000);
videospace->set_decrypted_region(0xa000, 0xffff, decrypted);
@@ -1308,8 +1308,8 @@ static DRIVER_INIT( kram3 )
static DRIVER_INIT( zookeep )
{
/* configure the banking */
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("videocpu")->base() + 0xa000, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("videocpu")->base() + 0x10000, 0);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("videocpu")->base() + 0xa000, 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("videocpu")->base() + 0x10000, 0);
memory_set_bank(machine, "bank1", 0);
}
diff --git a/src/mame/drivers/quakeat.c b/src/mame/drivers/quakeat.c
index 646906a587a..9a788b80d7b 100644
--- a/src/mame/drivers/quakeat.c
+++ b/src/mame/drivers/quakeat.c
@@ -114,7 +114,7 @@ ADDRESS_MAP_END
static WRITE_LINE_DEVICE_HANDLER( quakeat_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface quakeat_pic8259_1_config =
@@ -136,7 +136,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- quakeat_state *state = device->machine->driver_data<quakeat_state>();
+ quakeat_state *state = device->machine().driver_data<quakeat_state>();
int r = 0;
r = pic8259_acknowledge( state->pic8259_2);
if (r==0)
@@ -148,11 +148,11 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(quakeat)
{
- quakeat_state *state = machine->driver_data<quakeat_state>();
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ quakeat_state *state = machine.driver_data<quakeat_state>();
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
}
/*************************************************************/
diff --git a/src/mame/drivers/quantum.c b/src/mame/drivers/quantum.c
index f0a5e0cc413..4737725b098 100644
--- a/src/mame/drivers/quantum.c
+++ b/src/mame/drivers/quantum.c
@@ -72,19 +72,19 @@ public:
static READ16_HANDLER( trackball_r )
{
- return (input_port_read(space->machine, "TRACKY") << 4) | input_port_read(space->machine, "TRACKX");
+ return (input_port_read(space->machine(), "TRACKY") << 4) | input_port_read(space->machine(), "TRACKX");
}
static READ8_DEVICE_HANDLER( input_1_r )
{
- return (input_port_read(device->machine, "DSW0") << (7 - (offset - POT0_C))) & 0x80;
+ return (input_port_read(device->machine(), "DSW0") << (7 - (offset - POT0_C))) & 0x80;
}
static READ8_DEVICE_HANDLER( input_2_r )
{
- return (input_port_read(device->machine, "DSW1") << (7 - (offset - POT0_C))) & 0x80;
+ return (input_port_read(device->machine(), "DSW1") << (7 - (offset - POT0_C))) & 0x80;
}
@@ -100,14 +100,14 @@ static WRITE16_HANDLER( led_w )
if (ACCESSING_BITS_0_7)
{
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 2);
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 0, data & 2);
+ coin_counter_w(space->machine(), 1, data & 1);
/* bit 3 = select second trackball for cocktail mode? */
/* bits 4 and 5 are LED controls */
- set_led_status(space->machine, 0, data & 0x10);
- set_led_status(space->machine, 1, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x10);
+ set_led_status(space->machine(), 1, data & 0x20);
/* bits 6 and 7 flip screen */
avg_set_flip_x (data & 0x40);
diff --git a/src/mame/drivers/quasar.c b/src/mame/drivers/quasar.c
index 1ce94c29e7b..bef9844d397 100644
--- a/src/mame/drivers/quasar.c
+++ b/src/mame/drivers/quasar.c
@@ -76,19 +76,19 @@ Sound Board 1b11107
static WRITE8_HANDLER( video_page_select_w )
{
- quasar_state *state = space->machine->driver_data<quasar_state>();
+ quasar_state *state = space->machine().driver_data<quasar_state>();
state->page = offset & 0x03;
}
static WRITE8_HANDLER( io_page_select_w )
{
- quasar_state *state = space->machine->driver_data<quasar_state>();
+ quasar_state *state = space->machine().driver_data<quasar_state>();
state->io_page = offset & 0x03;
}
static WRITE8_HANDLER( quasar_video_w )
{
- quasar_state *state = space->machine->driver_data<quasar_state>();
+ quasar_state *state = space->machine().driver_data<quasar_state>();
switch (state->page)
{
@@ -101,15 +101,15 @@ static WRITE8_HANDLER( quasar_video_w )
static READ8_HANDLER( quasar_IO_r )
{
- quasar_state *state = space->machine->driver_data<quasar_state>();
+ quasar_state *state = space->machine().driver_data<quasar_state>();
UINT8 ans = 0;
switch (state->io_page)
{
- case 0: ans = input_port_read(space->machine, "IN0"); break;
- case 1: ans = input_port_read(space->machine, "IN1"); break;
- case 2: ans = input_port_read(space->machine, "DSW0"); break;
- case 3: ans = input_port_read(space->machine, "DSW1"); break;
+ case 0: ans = input_port_read(space->machine(), "IN0"); break;
+ case 1: ans = input_port_read(space->machine(), "IN1"); break;
+ case 2: ans = input_port_read(space->machine(), "DSW0"); break;
+ case 3: ans = input_port_read(space->machine(), "DSW1"); break;
}
return ans;
@@ -117,7 +117,7 @@ static READ8_HANDLER( quasar_IO_r )
static WRITE8_HANDLER( quasar_bullet_w )
{
- quasar_state *state = space->machine->driver_data<quasar_state>();
+ quasar_state *state = space->machine().driver_data<quasar_state>();
state->bullet_ram[offset] = (data ^ 0xff);
}
@@ -134,7 +134,7 @@ static WRITE8_HANDLER( quasar_sh_command_w )
static READ8_HANDLER( quasar_sh_command_r )
{
- return soundlatch_r(space, 0) + (input_port_read(space->machine, "DSW2") & 0x30);
+ return soundlatch_r(space, 0) + (input_port_read(space->machine(), "DSW2") & 0x30);
}
static READ8_HANDLER( audio_t1_r )
@@ -338,7 +338,7 @@ static const s2636_interface s2636_2_config =
static MACHINE_START( quasar )
{
- quasar_state *state = machine->driver_data<quasar_state>();
+ quasar_state *state = machine.driver_data<quasar_state>();
MACHINE_START_CALL(cvs);
@@ -350,7 +350,7 @@ static MACHINE_START( quasar )
static MACHINE_RESET( quasar )
{
- quasar_state *state = machine->driver_data<quasar_state>();
+ quasar_state *state = machine.driver_data<quasar_state>();
MACHINE_RESET_CALL(cvs);
diff --git a/src/mame/drivers/quizdna.c b/src/mame/drivers/quizdna.c
index 6c6db5918d9..7c701b21396 100644
--- a/src/mame/drivers/quizdna.c
+++ b/src/mame/drivers/quizdna.c
@@ -18,14 +18,14 @@ Quiz Gekiretsu Scramble (Gakuen Paradise 2) (c) 1993 Face
static WRITE8_HANDLER( quizdna_rombank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&ROM[0x10000+0x4000*(data & 0x3f)]);
+ UINT8 *ROM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1",&ROM[0x10000+0x4000*(data & 0x3f)]);
}
static WRITE8_HANDLER( gekiretu_rombank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&ROM[0x10000+0x4000*((data & 0x3f) ^ 0x0a)]);
+ UINT8 *ROM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1",&ROM[0x10000+0x4000*((data & 0x3f) ^ 0x0a)]);
}
/****************************************************************************/
diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c
index 3bb7079a5ab..21f7f3eb0b4 100644
--- a/src/mame/drivers/quizo.c
+++ b/src/mame/drivers/quizo.c
@@ -76,7 +76,7 @@ static PALETTE_INIT(quizo)
static SCREEN_UPDATE( quizo )
{
- quizo_state *state = screen->machine->driver_data<quizo_state>();
+ quizo_state *state = screen->machine().driver_data<quizo_state>();
UINT8 *videoram = state->videoram;
int x,y;
for(y=0;y<200;y++)
@@ -108,7 +108,7 @@ static SCREEN_UPDATE( quizo )
static WRITE8_HANDLER(vram_w)
{
- quizo_state *state = space->machine->driver_data<quizo_state>();
+ quizo_state *state = space->machine().driver_data<quizo_state>();
UINT8 *videoram = state->videoram;
int bank=(port70&8)?1:0;
videoram[offset+bank*0x4000]=data;
@@ -127,7 +127,7 @@ static WRITE8_HANDLER(port60_w)
data=0;
}
port60=data;
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("user1")->base()[rombankLookup[data]*0x4000] );
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("user1")->base()[rombankLookup[data]*0x4000] );
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8 )
@@ -258,7 +258,7 @@ ROM_END
static DRIVER_INIT(quizo)
{
- quizo_state *state = machine->driver_data<quizo_state>();
+ quizo_state *state = machine.driver_data<quizo_state>();
state->videoram=auto_alloc_array(machine, UINT8, 0x4000*2);
}
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index 25be35728c6..695a5710c34 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -74,14 +74,14 @@ public:
static TILE_GET_INFO( get_bg_tile_info )
{
- quizpun2_state *state = machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = machine.driver_data<quizpun2_state>();
UINT16 code = state->bg_ram[ tile_index * 2 ] + state->bg_ram[ tile_index * 2 + 1 ] * 256;
SET_TILE_INFO(0, code, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- quizpun2_state *state = machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = machine.driver_data<quizpun2_state>();
UINT16 code = state->fg_ram[ tile_index * 4 ] + state->fg_ram[ tile_index * 4 + 1 ] * 256;
UINT8 color = state->fg_ram[ tile_index * 4 + 2 ];
SET_TILE_INFO(1, code, color & 0x0f, 0);
@@ -89,21 +89,21 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( bg_ram_w )
{
- quizpun2_state *state = space->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
state->bg_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tmap, offset/2);
}
static WRITE8_HANDLER( fg_ram_w )
{
- quizpun2_state *state = space->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
state->fg_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tmap, offset/4);
}
static VIDEO_START(quizpun2)
{
- quizpun2_state *state = machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = machine.driver_data<quizpun2_state>();
state->bg_tmap = tilemap_create( machine, get_bg_tile_info, tilemap_scan_rows, 8,16, 0x20,0x20 );
state->fg_tmap = tilemap_create( machine, get_fg_tile_info, tilemap_scan_rows, 8,16, 0x20,0x20 );
@@ -113,23 +113,23 @@ static VIDEO_START(quizpun2)
static SCREEN_UPDATE(quizpun2)
{
- quizpun2_state *state = screen->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = screen->machine().driver_data<quizpun2_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, state->bg_tmap, TILEMAP_DRAW_OPAQUE, 0);
- else bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ else bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
-bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->fg_tmap, 0, 0);
return 0;
@@ -148,7 +148,7 @@ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
static MACHINE_RESET( quizpun2 )
{
- quizpun2_state *state = machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = machine.driver_data<quizpun2_state>();
struct prot_t &prot = state->prot;
prot.state = STATE_IDLE;
prot.wait_param = 0;
@@ -159,7 +159,7 @@ static MACHINE_RESET( quizpun2 )
static void log_protection( address_space *space, const char *warning )
{
- quizpun2_state *state = space->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
struct prot_t &prot = state->prot;
logerror("%04x: protection - %s (state %x, wait %x, param %02x, cmd %02x, addr %02x)\n", cpu_get_pc(space->cpu), warning,
prot.state,
@@ -172,7 +172,7 @@ static void log_protection( address_space *space, const char *warning )
static READ8_HANDLER( quizpun2_protection_r )
{
- quizpun2_state *state = space->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
struct prot_t &prot = state->prot;
UINT8 ret;
@@ -207,7 +207,7 @@ static READ8_HANDLER( quizpun2_protection_r )
case STATE_EEPROM_R: // EEPROM read
{
- UINT8 *eeprom = space->machine->region("eeprom")->base();
+ UINT8 *eeprom = space->machine().region("eeprom")->base();
ret = eeprom[prot.addr];
break;
}
@@ -228,13 +228,13 @@ static READ8_HANDLER( quizpun2_protection_r )
static WRITE8_HANDLER( quizpun2_protection_w )
{
- quizpun2_state *state = space->machine->driver_data<quizpun2_state>();
+ quizpun2_state *state = space->machine().driver_data<quizpun2_state>();
struct prot_t &prot = state->prot;
switch ( prot.state )
{
case STATE_EEPROM_W:
{
- UINT8 *eeprom = space->machine->region("eeprom")->base();
+ UINT8 *eeprom = space->machine().region("eeprom")->base();
eeprom[prot.addr] = data;
prot.addr++;
if ((prot.addr % 8) == 0)
@@ -301,19 +301,19 @@ static WRITE8_HANDLER( quizpun2_protection_w )
static WRITE8_HANDLER( quizpun2_rombank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1", &ROM[ 0x10000 + 0x2000 * (data & 0x1f) ] );
+ UINT8 *ROM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1", &ROM[ 0x10000 + 0x2000 * (data & 0x1f) ] );
}
static WRITE8_HANDLER( quizpun2_irq_ack )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
}
static WRITE8_HANDLER( quizpun2_soundlatch_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( quizpun2_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index ae5a4fb79a1..ff4f998a38e 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -83,12 +83,12 @@ static WRITE_LINE_DEVICE_HANDLER( flipscreen_w );
static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
{
- device_t *pia0 = device->machine->device("pia_main");
- device_t *pia1 = device->machine->device("pia_audio");
+ device_t *pia0 = device->machine().device("pia_main");
+ device_t *pia1 = device->machine().device("pia_audio");
int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) |
pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -112,7 +112,7 @@ if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", cpu_get_pc
static WRITE8_HANDLER( audio_command_w )
{
soundlatch_w(space, 0, ~data);
- cputag_set_input_line(space->machine, "audiocpu", M6800_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6800_IRQ_LINE, HOLD_LINE);
if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", cpu_get_pc(space->cpu), data^0xff);
}
@@ -134,7 +134,7 @@ static WRITE8_HANDLER( audio_answer_w )
data = 0x00;
soundlatch2_w(space, 0, data);
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", cpu_get_pc(space->cpu), data);
}
@@ -142,7 +142,7 @@ if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", cpu_get_pc
static WRITE8_DEVICE_HANDLER( AY8910_select_w )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
/* not sure what all the bits mean:
D0 - ????? definetely used
D1 - not used?
@@ -152,20 +152,20 @@ static WRITE8_DEVICE_HANDLER( AY8910_select_w )
D5-D7 - not used */
state->AY8910_selected = data;
-if (LOG_AUDIO_COMM) logerror("%s: CPU#1 AY8910_select_w: %x\n", device->machine->describe_context(), data);
+if (LOG_AUDIO_COMM) logerror("%s: CPU#1 AY8910_select_w: %x\n", device->machine().describe_context(), data);
}
static READ8_DEVICE_HANDLER( AY8910_port_r )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
UINT8 ret = 0;
if (state->AY8910_selected & 0x08)
- ret = ay8910_r(device->machine->device("ay1"), 0);
+ ret = ay8910_r(device->machine().device("ay1"), 0);
if (state->AY8910_selected & 0x10)
- ret = ay8910_r(device->machine->device("ay2"), 0);
+ ret = ay8910_r(device->machine().device("ay2"), 0);
return ret;
}
@@ -173,12 +173,12 @@ static READ8_DEVICE_HANDLER( AY8910_port_r )
static WRITE8_DEVICE_HANDLER( AY8910_port_w )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
if (state->AY8910_selected & 0x08)
- ay8910_data_address_w(device->machine->device("ay1"), state->AY8910_selected >> 2, data);
+ ay8910_data_address_w(device->machine().device("ay1"), state->AY8910_selected >> 2, data);
if (state->AY8910_selected & 0x10)
- ay8910_data_address_w(device->machine->device("ay2"), state->AY8910_selected >> 2, data);
+ ay8910_data_address_w(device->machine().device("ay2"), state->AY8910_selected >> 2, data);
}
@@ -219,8 +219,8 @@ static const ay8910_interface ay8910_2_interface =
static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
- device_t *pia = device->machine->device("pia_main");
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
+ device_t *pia = device->machine().device("pia_main");
pia6821_ca1_w(pia, data);
state->ttl74123_output = data;
}
@@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
static CUSTOM_INPUT( get_ttl74123_output )
{
- r2dtank_state *state = field->port->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = field->port->machine().driver_data<r2dtank_state>();
return state->ttl74123_output;
}
@@ -288,7 +288,7 @@ static const pia6821_interface pia_audio_intf =
static MACHINE_START( r2dtank )
{
- r2dtank_state *state = machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = machine.driver_data<r2dtank_state>();
/* setup for save states */
state_save_register_global(machine, state->flipscreen);
state_save_register_global(machine, state->ttl74123_output);
@@ -306,14 +306,14 @@ static MACHINE_START( r2dtank )
static WRITE_LINE_DEVICE_HANDLER( flipscreen_w )
{
- r2dtank_state *drvstate = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *drvstate = device->machine().driver_data<r2dtank_state>();
drvstate->flipscreen = !state;
}
static MC6845_BEGIN_UPDATE( begin_update )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
/* create the pens */
offs_t i;
@@ -328,7 +328,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- r2dtank_state *state = device->machine->driver_data<r2dtank_state>();
+ r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
UINT8 cx;
pen_t *pens = (pen_t *)param;
@@ -378,7 +378,7 @@ static MC6845_UPDATE_ROW( update_row )
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
{
- ttl74123_a_w(device->machine->device("74123"), 0, state);
+ ttl74123_a_w(device->machine().device("74123"), 0, state);
}
@@ -399,7 +399,7 @@ static const mc6845_interface mc6845_intf =
static SCREEN_UPDATE( r2dtank )
{
- device_t *mc6845 = screen->machine->device("crtc");
+ device_t *mc6845 = screen->machine().device("crtc");
mc6845_update(mc6845, bitmap, cliprect);
return 0;
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index ed2ac2b9150..39098d02dde 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -80,9 +80,9 @@ static TILE_GET_INFO( get_tx_tile_info )
}
/* copied from Legionnaire */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
{
- r2dx_v33_state *state = machine->driver_data<r2dx_v33_state>();
+ r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>();
UINT16 *spriteram16 = state->spriteram;
int offs,fx,fy,x,y,color,sprite;
// int cur_pri;
@@ -124,7 +124,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+ax*16,y+ay*16,15);
}
@@ -134,7 +134,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+ax*16,y+(dy-ay-1)*16,15);
}
@@ -147,7 +147,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+(dx-ax-1)*16,y+ay*16,15);
}
@@ -157,7 +157,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+(dx-ax-1)*16,y+(dy-ay-1)*16,15);
}
@@ -181,13 +181,13 @@ static VIDEO_START( rdx_v33 )
static SCREEN_UPDATE( rdx_v33 )
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, md_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
- draw_sprites(screen->machine,bitmap,cliprect,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,0);
tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
@@ -196,23 +196,23 @@ static SCREEN_UPDATE( rdx_v33 )
{
static UINT32 src_addr = 0x100000;
static int frame;
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
- //if(input_code_pressed_once(screen->machine,KEYCODE_A))
+ //if(input_code_pressed_once(screen->machine(),KEYCODE_A))
// src_addr+=0x800;
- //if(input_code_pressed_once(screen->machine,KEYCODE_S))
+ //if(input_code_pressed_once(screen->machine(),KEYCODE_S))
// src_addr-=0x800;
frame++;
popmessage("%08x 0",src_addr);
- //if(input_code_pressed_once(screen->machine,KEYCODE_Z))
+ //if(input_code_pressed_once(screen->machine(),KEYCODE_Z))
if(frame == 5)
{
int i,data;
- static UINT8 *rom = space->machine->region("mainprg")->base();
+ static UINT8 *rom = space->machine().region("mainprg")->base();
for(i=0;i<0x800;i+=2)
{
@@ -267,7 +267,7 @@ WRITE16_HANDLER( mcu_prog_w2 )
{
char tmp[64];
FILE *fp;
- sprintf(tmp,"cop3_%s.data", space->machine->system().name);
+ sprintf(tmp,"cop3_%s.data", space->machine().system().name);
fp=fopen(tmp, "w+b");
if (fp)
@@ -310,7 +310,7 @@ static WRITE16_HANDLER( rdx_tx_vram_w )
static READ16_HANDLER( rdx_v33_unknown_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -719,7 +719,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(rdx_v33)
{
- memory_configure_bank(machine, "bank1", 0, 0x20, machine->region("mainprg")->base(), 0x20000);
+ memory_configure_bank(machine, "bank1", 0, 0x20, machine.region("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
@@ -728,7 +728,7 @@ static DRIVER_INIT(rdx_v33)
static DRIVER_INIT(nzerotea)
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("mainprg")->base(), 0x20000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c
index 9aaa66673d3..74116e3dd5d 100644
--- a/src/mame/drivers/rabbit.c
+++ b/src/mame/drivers/rabbit.c
@@ -116,9 +116,9 @@ public:
/* call with tilesize = 0 for 8x8 or 1 for 16x16 */
-INLINE void get_rabbit_tilemap_info(running_machine *machine, tile_data *tileinfo, int tile_index, int whichtilemap, int tilesize)
+INLINE void get_rabbit_tilemap_info(running_machine &machine, tile_data *tileinfo, int tile_index, int whichtilemap, int tilesize)
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
int tileno,colour,flipxy, depth;
int bank;
depth = (state->tilemap_ram[whichtilemap][tile_index]&0x10000000)>>28;
@@ -185,21 +185,21 @@ static TILE_GET_INFO( get_rabbit_tilemap3_tile_info )
static WRITE32_HANDLER( rabbit_tilemap0_w )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
COMBINE_DATA(&state->tilemap_ram[0][offset]);
tilemap_mark_tile_dirty(state->tilemap[0],offset);
}
static WRITE32_HANDLER( rabbit_tilemap1_w )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
COMBINE_DATA(&state->tilemap_ram[1][offset]);
tilemap_mark_tile_dirty(state->tilemap[1],offset);
}
static WRITE32_HANDLER( rabbit_tilemap2_w )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
COMBINE_DATA(&state->tilemap_ram[2][offset]);
tilemap_mark_tile_dirty(state->tilemap[2],offset);
}
@@ -207,7 +207,7 @@ static WRITE32_HANDLER( rabbit_tilemap2_w )
static WRITE32_HANDLER( rabbit_tilemap3_w )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
COMBINE_DATA(&state->tilemap_ram[3][offset]);
tilemap_mark_tile_dirty(state->tilemap[3],offset);
}
@@ -231,11 +231,11 @@ sprites invisible at the end of a round in rabbit, why?
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
int xpos,ypos,tileno,xflip,yflip, colr;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
int todraw = (state->spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
UINT32 *source = (state->spriteram+ (todraw*2))-2;
@@ -270,9 +270,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
/* the sprite bitmap can probably be handled better than this ... */
-static void rabbit_clearspritebitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void rabbit_clearspritebitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
int startx, starty;
int y;
int amountx,amounty;
@@ -298,9 +298,9 @@ static void rabbit_clearspritebitmap( running_machine *machine, bitmap_t *bitmap
}
/* todo: fix zoom, its inaccurate and this code is ugly */
-static void draw_sprite_bitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprite_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
UINT32 x,y;
UINT16 *srcline;
@@ -354,7 +354,7 @@ static void draw_sprite_bitmap( running_machine *machine, bitmap_t *bitmap, cons
}
static VIDEO_START(rabbit)
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
/* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */
/* or maybe not for this game/hw .... */
state->tilemap_ram[0] = auto_alloc_array_clear(machine, UINT32, 0x20000/4);
@@ -377,7 +377,7 @@ static VIDEO_START(rabbit)
tilemap_map_pen_to_layer(state->tilemap[3], 0, 15, TILEMAP_PIXEL_TRANSPARENT);
tilemap_map_pen_to_layer(state->tilemap[3], 1, 255, TILEMAP_PIXEL_TRANSPARENT);
- state->sprite_bitmap = auto_bitmap_alloc(machine,0x1000,0x1000,machine->primary_screen->format());
+ state->sprite_bitmap = auto_bitmap_alloc(machine,0x1000,0x1000,machine.primary_screen->format());
state->sprite_clip.min_x = 0;
state->sprite_clip.max_x = 0x1000-1;
state->sprite_clip.min_y = 0;
@@ -406,9 +406,9 @@ each line represents the differences on each tilemap for unknown variables
*/
-static void rabbit_drawtilemap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int whichtilemap )
+static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int whichtilemap )
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
INT32 startx, starty, incxx, incxy, incyx, incyy, tran;
startx=((state->tilemap_regs[whichtilemap][1]&0x0000ffff)); // >>4 for nonzoomed pixel scroll value
@@ -432,10 +432,10 @@ static void rabbit_drawtilemap( running_machine *machine, bitmap_t *bitmap, cons
static SCREEN_UPDATE(rabbit)
{
- rabbit_state *state = screen->machine->driver_data<rabbit_state>();
+ rabbit_state *state = screen->machine().driver_data<rabbit_state>();
int prilevel;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
// popmessage("%08x %08x", state->viewregs0[0], state->viewregs0[1]);
// popmessage("%08x %08x %08x %08x %08x %08x", state->tilemap_regs[0][0],state->tilemap_regs[0][1],state->tilemap_regs[0][2],state->tilemap_regs[0][3],state->tilemap_regs[0][4],state->tilemap_regs[0][5]);
@@ -453,16 +453,16 @@ static SCREEN_UPDATE(rabbit)
/* prio isnt certain but seems to work.. */
for (prilevel = 0xf; prilevel >0; prilevel--)
{
- if (prilevel == ((state->tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine,bitmap,cliprect, 3);
- if (prilevel == ((state->tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine,bitmap,cliprect, 2);
- if (prilevel == ((state->tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine,bitmap,cliprect, 1);
- if (prilevel == ((state->tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine,bitmap,cliprect, 0);
+ if (prilevel == ((state->tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 3);
+ if (prilevel == ((state->tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 2);
+ if (prilevel == ((state->tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 1);
+ if (prilevel == ((state->tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(screen->machine(),bitmap,cliprect, 0);
if (prilevel == 0x09) // should it be selectable?
{
- rabbit_clearspritebitmap(screen->machine,bitmap,cliprect);
- draw_sprites(screen->machine,bitmap,cliprect); // render to bitmap
- draw_sprite_bitmap(screen->machine,bitmap,cliprect); // copy bitmap to screen
+ rabbit_clearspritebitmap(screen->machine(),bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect); // render to bitmap
+ draw_sprite_bitmap(screen->machine(),bitmap,cliprect); // copy bitmap to screen
}
}
return 0;
@@ -472,56 +472,56 @@ static SCREEN_UPDATE(rabbit)
static WRITE32_HANDLER( rabbit_paletteram_dword_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x000000ff) >>0);
- r = ((space->machine->generic.paletteram.u32[offset] & 0x0000ff00) >>8);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x00ff0000) >>16);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x000000ff) >>0);
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x0000ff00) >>8);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x00ff0000) >>16);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( rabbit_tilemap0_r )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
return state->tilemap_ram[0][offset];
}
static READ32_HANDLER( rabbit_tilemap1_r )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
return state->tilemap_ram[1][offset];
}
static READ32_HANDLER( rabbit_tilemap2_r )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
return state->tilemap_ram[2][offset];
}
static READ32_HANDLER( rabbit_tilemap3_r )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
return state->tilemap_ram[3][offset];
}
static READ32_HANDLER( randomrabbits )
{
- return space->machine->rand();
+ return space->machine().rand();
}
/* rom bank is used when testing roms, not currently hooked up */
static WRITE32_HANDLER ( rabbit_rombank_w )
{
- UINT8 *dataroms = space->machine->region("gfx1")->base();
+ UINT8 *dataroms = space->machine().region("gfx1")->base();
#if 0
int bank;
printf("rabbit rombank %08x\n",data);
bank = data & 0x3ff;
- memory_set_bankptr(space->machine, "bank1",&dataroms[0x40000*(bank&0x3ff)]);
+ memory_set_bankptr(space->machine(), "bank1",&dataroms[0x40000*(bank&0x3ff)]);
#else
- memory_set_bankptr(space->machine, "bank1",&dataroms[0]);
+ memory_set_bankptr(space->machine(), "bank1",&dataroms[0]);
#endif
}
@@ -607,14 +607,14 @@ if (VERBOSE_AUDIO_LOG)
static TIMER_CALLBACK( rabbit_blit_done )
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
cputag_set_input_line(machine, "maincpu", state->bltirqlevel, HOLD_LINE);
}
-static void rabbit_do_blit(running_machine *machine)
+static void rabbit_do_blit(running_machine &machine)
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
- UINT8 *blt_data = machine->region("gfx1")->base();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
+ UINT8 *blt_data = machine.region("gfx1")->base();
int blt_source = (state->blitterregs[0]&0x000fffff)>>0;
int blt_column = (state->blitterregs[1]&0x00ff0000)>>16;
int blt_line = (state->blitterregs[1]&0x000000ff);
@@ -656,7 +656,7 @@ static void rabbit_do_blit(running_machine *machine)
if (!blt_amount)
{
if(BLITLOG) mame_printf_debug("end of blit list\n");
- machine->scheduler().timer_set(attotime::from_usec(500), FUNC(rabbit_blit_done));
+ machine.scheduler().timer_set(attotime::from_usec(500), FUNC(rabbit_blit_done));
return;
}
@@ -709,12 +709,12 @@ static void rabbit_do_blit(running_machine *machine)
static WRITE32_HANDLER( rabbit_blitter_w )
{
- rabbit_state *state = space->machine->driver_data<rabbit_state>();
+ rabbit_state *state = space->machine().driver_data<rabbit_state>();
COMBINE_DATA(&state->blitterregs[offset]);
if (offset == 0x0c/4)
{
- rabbit_do_blit(space->machine);
+ rabbit_do_blit(space->machine());
}
}
@@ -943,7 +943,7 @@ GFXDECODE_END
static INTERRUPT_GEN( rabbit_interrupts )
{
- rabbit_state *state = device->machine->driver_data<rabbit_state>();
+ rabbit_state *state = device->machine().driver_data<rabbit_state>();
int intlevel = 0;
int line = 262 - cpu_getiloops(device);
@@ -990,7 +990,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(rabbit)
{
- rabbit_state *state = machine->driver_data<rabbit_state>();
+ rabbit_state *state = machine.driver_data<rabbit_state>();
state->banking = 1;
state->vblirqlevel = 6;
state->bltirqlevel = 4;
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index d93e97c18a9..7ce2cbe7125 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -244,7 +244,7 @@ static INTERRUPT_GEN( raiden_interrupt )
static SCREEN_EOF( raiden )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff); /* Could be a memory location instead */
}
@@ -521,7 +521,7 @@ ROM_END
#ifdef SYNC_HACK
static READ16_HANDLER( sub_cpu_spin_r )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
int pc=cpu_get_pc(space->cpu);
int ret=state->shared_ram[0x4];
@@ -540,7 +540,7 @@ static READ16_HANDLER( sub_cpu_spin_r )
static DRIVER_INIT( raiden )
{
#ifdef SYNC_HACK
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4008, 0x4009, FUNC(sub_cpu_spin_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4008, 0x4009, FUNC(sub_cpu_spin_r));
#endif
}
@@ -553,10 +553,10 @@ static DRIVER_INIT( raidenu )
/* This is based on code by Niclas Karlsson Mate, who figured out the
encryption method! The technique is a combination of a XOR table plus
bit-swapping */
-static void common_decrypt(running_machine *machine)
+static void common_decrypt(running_machine &machine)
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x20000; i++)
@@ -568,7 +568,7 @@ static void common_decrypt(running_machine *machine)
RAM[0xc0000/2 + i] = data;
}
- RAM = (UINT16 *)machine->region("sub")->base();
+ RAM = (UINT16 *)machine.region("sub")->base();
for (i = 0; i < 0x20000; i++)
{
diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c
index d9670ed30f8..0a6e4cb35bf 100644
--- a/src/mame/drivers/raiden2.c
+++ b/src/mame/drivers/raiden2.c
@@ -140,14 +140,14 @@ Current Problem(s) - in order of priority
#include "sound/okim6295.h"
#include "includes/raiden2.h"
-static UINT16 rps(running_machine *machine)
+static UINT16 rps(running_machine &machine)
{
- return cpu_get_reg(machine->device("maincpu"), NEC_CS);
+ return cpu_get_reg(machine.device("maincpu"), NEC_CS);
}
-static UINT16 rpc(running_machine *machine)
+static UINT16 rpc(running_machine &machine)
{
- return cpu_get_reg(machine->device("maincpu"), NEC_IP);
+ return cpu_get_reg(machine.device("maincpu"), NEC_IP);
}
WRITE16_MEMBER(raiden2_state::cop_pgm_data_w)
@@ -450,7 +450,7 @@ WRITE16_MEMBER(raiden2_state::cop_reg_low_w)
cop_regs[offset] = (cop_regs[offset] & ~UINT32(mem_mask)) | (data & mem_mask);
}
-UINT8 raiden2_state::cop_calculate_collsion_detection(running_machine *machine)
+UINT8 raiden2_state::cop_calculate_collsion_detection(running_machine &machine)
{
static UINT8 res;
@@ -588,7 +588,7 @@ WRITE16_MEMBER(raiden2_state::cop_cmd_w)
cop_collision_info[0].max_y = cop_collision_info[0].y + (0x10 << 16);
/* do the math */
- cop_hit_status = cop_calculate_collsion_detection(space.machine);
+ cop_hit_status = cop_calculate_collsion_detection(space.machine());
break;
case 0xb900:
@@ -601,17 +601,17 @@ WRITE16_MEMBER(raiden2_state::cop_cmd_w)
cop_collision_info[1].max_y = cop_collision_info[1].y + (0x10 << 16);
/* do the math */
- cop_hit_status = cop_calculate_collsion_detection(space.machine);
+ cop_hit_status = cop_calculate_collsion_detection(space.machine());
break;
default:
- logerror("pcall %04x (%04x:%04x) [%x %x %x %x]\n", data, rps(space.machine), rpc(space.machine), cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3]);
+ logerror("pcall %04x (%04x:%04x) [%x %x %x %x]\n", data, rps(space.machine()), rpc(space.machine()), cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3]);
}
}
// case 0x6ca:
// logerror("select bank %d %04x\n", (data >> 15) & 1, data);
-// memory_set_bank(space.machine, "bank1", (data >> 15) & 1);
+// memory_set_bank(space.machine(), "bank1", (data >> 15) & 1);
static void combine32(UINT32 *val, int offset, UINT16 data, UINT16 mem_mask)
@@ -624,11 +624,11 @@ static void combine32(UINT32 *val, int offset, UINT16 data, UINT16 mem_mask)
/* SPRITE DRAWING (move to video file) */
-void raiden2_state::draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask )
+void raiden2_state::draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask )
{
UINT16 *source = sprites + sprites_cur_start/2 - 4;
- const gfx_element *gfx = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[2];
// static int ytlim = 1;
// static int xtlim = 1;
@@ -811,7 +811,7 @@ WRITE16_MEMBER(raiden2_state::raidendx_cop_bank_2_w)
/* probably bit 3 is from 6c9 */
/* TODO: this doesn't work! */
- memory_set_bank(space.machine, "mainbank", 8 | (cop_bank & 0x7000) >> 12);
+ memory_set_bank(space.machine(), "mainbank", 8 | (cop_bank & 0x7000) >> 12);
}
}
@@ -821,7 +821,7 @@ WRITE16_MEMBER(raiden2_state::raidendx_cop_bank_2_w)
static TILE_GET_INFO( get_back_tile_info )
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
int tile = state->back_data[tile_index];
int color = (tile >> 12) | (0 << 4);
@@ -832,7 +832,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_mid_tile_info )
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
int tile = state->mid_data[tile_index];
int color = (tile >> 12) | (2 << 4);
@@ -843,7 +843,7 @@ static TILE_GET_INFO( get_mid_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
int tile = state->fore_data[tile_index];
int color = (tile >> 12) | (1 << 4);
@@ -854,7 +854,7 @@ static TILE_GET_INFO( get_fore_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
int tile = state->text_data[tile_index];
int color = (tile>>12)&0xf;
@@ -868,7 +868,7 @@ static TILE_GET_INFO( get_text_tile_info )
static VIDEO_START( raiden2 )
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
state->text_layer = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 64,32 );
state->background_layer = tilemap_create(machine, get_back_tile_info, tilemap_scan_rows, 16,16, 32,32 );
state->midground_layer = tilemap_create(machine, get_mid_tile_info, tilemap_scan_rows, 16,16, 32,32 );
@@ -883,34 +883,34 @@ static VIDEO_START( raiden2 )
static SCREEN_UPDATE( raiden2 )
{
- raiden2_state *state = screen->machine->driver_data<raiden2_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ raiden2_state *state = screen->machine().driver_data<raiden2_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- //if (!input_code_pressed(screen->machine, KEYCODE_Q))
+ //if (!input_code_pressed(screen->machine(), KEYCODE_Q))
{
if (!(state->raiden2_tilemap_enable & 1))
tilemap_draw(bitmap, cliprect, state->background_layer, 0, 0);
}
- //if (!input_code_pressed(screen->machine, KEYCODE_W))
+ //if (!input_code_pressed(screen->machine(), KEYCODE_W))
{
if (!(state->raiden2_tilemap_enable & 2))
tilemap_draw(bitmap, cliprect, state->midground_layer, 0, 0);
}
- //if (!input_code_pressed(screen->machine, KEYCODE_E))
+ //if (!input_code_pressed(screen->machine(), KEYCODE_E))
{
if (!(state->raiden2_tilemap_enable & 4))
tilemap_draw(bitmap, cliprect, state->foreground_layer, 0, 0);
}
- //if (!input_code_pressed(screen->machine, KEYCODE_S))
+ //if (!input_code_pressed(screen->machine(), KEYCODE_S))
{
//if (!(raiden2_tilemap_enable & 0x10))
- state->draw_sprites(screen->machine, bitmap, cliprect, 0);
+ state->draw_sprites(screen->machine(), bitmap, cliprect, 0);
}
- //if (!input_code_pressed(screen->machine, KEYCODE_A))
+ //if (!input_code_pressed(screen->machine(), KEYCODE_A))
{
if (!(state->raiden2_tilemap_enable & 8))
tilemap_draw(bitmap, cliprect, state->text_layer, 0, 0);
@@ -1052,7 +1052,7 @@ void raiden2_state::common_reset()
static MACHINE_RESET(raiden2)
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
state->common_reset();
sprcpt_init();
MACHINE_RESET_CALL(seibu_sound);
@@ -1065,7 +1065,7 @@ static MACHINE_RESET(raiden2)
static MACHINE_RESET(raidendx)
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
state->common_reset();
sprcpt_init();
MACHINE_RESET_CALL(seibu_sound);
@@ -1079,7 +1079,7 @@ static MACHINE_RESET(raidendx)
static MACHINE_RESET(zeroteam)
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
state->bg_bank = 0;
state->fg_bank = 2;
state->mid_bank = 1;
@@ -1094,7 +1094,7 @@ static MACHINE_RESET(zeroteam)
static MACHINE_RESET(xsedae)
{
- raiden2_state *state = machine->driver_data<raiden2_state>();
+ raiden2_state *state = machine.driver_data<raiden2_state>();
state->bg_bank = 0;
state->fg_bank = 2;
state->mid_bank = 1;
@@ -1120,7 +1120,7 @@ WRITE16_MEMBER(raiden2_state::raiden2_bank_w)
{
if(ACCESSING_BITS_8_15) {
logerror("select bank %d %04x\n", (data >> 15) & 1, data);
- memory_set_bank(space.machine, "mainbank", !((data >> 15) & 1));
+ memory_set_bank(space.machine(), "mainbank", !((data >> 15) & 1));
prg_bank = ((data >> 15) & 1);
}
}
@@ -2623,25 +2623,25 @@ ROM_END
static DRIVER_INIT (raiden2)
{
- memory_configure_bank(machine, "mainbank", 0, 2, machine->region("mainprg")->base(), 0x20000);
+ memory_configure_bank(machine, "mainbank", 0, 2, machine.region("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (raidendx)
{
- memory_configure_bank(machine, "mainbank", 0, 0x10, machine->region("mainprg")->base(), 0x20000);
+ memory_configure_bank(machine, "mainbank", 0, 0x10, machine.region("mainprg")->base(), 0x20000);
raiden2_decrypt_sprites(machine);
}
static DRIVER_INIT (xsedae)
{
/* doesn't have banking */
- //memory_configure_bank(machine, "mainbank", 0, 2, machine->region("mainprg")->base(), 0x20000);
+ //memory_configure_bank(machine, "mainbank", 0, 2, machine.region("mainprg")->base(), 0x20000);
}
static DRIVER_INIT (zeroteam)
{
- memory_configure_bank(machine, "mainbank", 0, 2, machine->region("mainprg")->base(), 0x20000);
+ memory_configure_bank(machine, "mainbank", 0, 2, machine.region("mainprg")->base(), 0x20000);
zeroteam_decrypt_sprites(machine);
}
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index 8b8095dbb84..d8af3baf10b 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -331,7 +331,7 @@ Stephh's notes (based on the game M68000 code and some tests) :
static WRITE16_HANDLER( jumping_sound_w )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
if (ACCESSING_BITS_0_7)
{
@@ -398,12 +398,12 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( bankswitch_w )
{
- memory_set_bank(device->machine, "bank1", data & 3);
+ memory_set_bank(device->machine(), "bank1", data & 3);
}
static READ8_HANDLER( jumping_latch_r )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
return state->jumping_latch;
}
@@ -627,7 +627,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- rainbow_state *state = device->machine->driver_data<rainbow_state>();
+ rainbow_state *state = device->machine().driver_data<rainbow_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -666,12 +666,12 @@ static const tc0140syt_interface rainbow_tc0140syt_intf =
static MACHINE_START( rainbow )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->pc080sn = machine->device("pc080sn");
- state->pc090oj = machine->device("pc090oj");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->pc080sn = machine.device("pc080sn");
+ state->pc090oj = machine.device("pc090oj");
}
static MACHINE_CONFIG_START( rainbow, rainbow_state )
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT( rainbow )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
@@ -879,7 +879,7 @@ static DRIVER_INIT( rainbow )
static DRIVER_INIT( rainbowe )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
@@ -888,9 +888,9 @@ static DRIVER_INIT( rainbowe )
static DRIVER_INIT( jumping )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
- int i, len = machine->region("gfx2")->bytes();
- UINT8 *rom = machine->region("gfx2")->base();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
+ int i, len = machine.region("gfx2")->bytes();
+ UINT8 *rom = machine.region("gfx2")->base();
/* Sprite colour map is reversed - switch to normal */
diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c
index a29d1d4443c..de17a1acc28 100644
--- a/src/mame/drivers/rallyx.c
+++ b/src/mame/drivers/rallyx.c
@@ -206,7 +206,7 @@ TODO:
static WRITE8_HANDLER( rallyx_interrupt_vector_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
device_set_input_line_vector(state->maincpu, 0, data);
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -215,7 +215,7 @@ static WRITE8_HANDLER( rallyx_interrupt_vector_w )
static WRITE8_HANDLER( rallyx_bang_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
if (data == 0 && state->last_bang != 0)
sample_start(state->samples, 0, 0, 0);
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( rallyx_bang_w )
static WRITE8_HANDLER( rallyx_latch_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
int bit = data & 1;
switch (offset)
@@ -242,28 +242,28 @@ static WRITE8_HANDLER( rallyx_latch_w )
case 0x02: /* SOUND ON */
/* this doesn't work in New Rally X so I'm not supporting it */
-// pacman_sound_enable_w(space->machine->device("namco"), bit);
+// pacman_sound_enable_w(space->machine().device("namco"), bit);
break;
case 0x03: /* FLIP */
- flip_screen_set_no_update(space->machine, bit);
- tilemap_set_flip_all(space->machine, bit * (TILEMAP_FLIPX | TILEMAP_FLIPY));
+ flip_screen_set_no_update(space->machine(), bit);
+ tilemap_set_flip_all(space->machine(), bit * (TILEMAP_FLIPX | TILEMAP_FLIPY));
break;
case 0x04:
- set_led_status(space->machine, 0, bit);
+ set_led_status(space->machine(), 0, bit);
break;
case 0x05:
- set_led_status(space->machine, 1, bit);
+ set_led_status(space->machine(), 1, bit);
break;
case 0x06:
- coin_lockout_w(space->machine, 0, !bit);
+ coin_lockout_w(space->machine(), 0, !bit);
break;
case 0x07:
- coin_counter_w(space->machine, 0, bit);
+ coin_counter_w(space->machine(), 0, bit);
break;
}
}
@@ -271,7 +271,7 @@ static WRITE8_HANDLER( rallyx_latch_w )
static WRITE8_HANDLER( locomotn_latch_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
int bit = data & 1;
switch (offset)
@@ -289,19 +289,19 @@ static WRITE8_HANDLER( locomotn_latch_w )
break;
case 0x03: /* FLIP */
- flip_screen_set_no_update(space->machine, bit);
- tilemap_set_flip_all(space->machine, bit * (TILEMAP_FLIPX | TILEMAP_FLIPY));
+ flip_screen_set_no_update(space->machine(), bit);
+ tilemap_set_flip_all(space->machine(), bit * (TILEMAP_FLIPX | TILEMAP_FLIPY));
break;
case 0x04: /* OUT1 */
- coin_counter_w(space->machine, 0, bit);
+ coin_counter_w(space->machine(), 0, bit);
break;
case 0x05: /* OUT2 */
break;
case 0x06: /* OUT3 */
- coin_counter_w(space->machine, 1,bit);
+ coin_counter_w(space->machine(), 1,bit);
break;
case 0x07: /* STARSON */
@@ -877,10 +877,10 @@ static const samples_interface rallyx_samples_interface =
static MACHINE_START( rallyx )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->last_bang));
state->save_item(NAME(state->stars_enable));
@@ -888,7 +888,7 @@ static MACHINE_START( rallyx )
static MACHINE_RESET( rallyx )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
state->last_bang = 0;
state->stars_enable = 0;
diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c
index 6413d6791b1..85466e9eef5 100644
--- a/src/mame/drivers/rampart.c
+++ b/src/mame/drivers/rampart.c
@@ -38,9 +38,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- rampart_state *state = machine->driver_data<rampart_state>();
+ rampart_state *state = machine.driver_data<rampart_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -49,7 +49,7 @@ static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
if ((scanline & 32) == 0)
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -68,12 +68,12 @@ static MACHINE_START( rampart )
static MACHINE_RESET( rampart )
{
- rampart_state *state = machine->driver_data<rampart_state>();
+ rampart_state *state = machine.driver_data<rampart_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
}
@@ -107,19 +107,19 @@ static WRITE16_HANDLER( latch_w )
{
if (data & 0x1000)
logerror("Color bank set to 1!\n");
- coin_counter_w(space->machine, 0, (data >> 9) & 1);
- coin_counter_w(space->machine, 1, (data >> 8) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 9) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 8) & 1);
}
/* lower byte being modified? */
if (ACCESSING_BITS_0_7)
{
- atarigen_set_oki6295_vol(space->machine, (data & 0x0020) ? 100 : 0);
+ atarigen_set_oki6295_vol(space->machine(), (data & 0x0020) ? 100 : 0);
if (!(data & 0x0010))
- devtag_reset(space->machine, "oki");
- atarigen_set_ym2413_vol(space->machine, ((data >> 1) & 7) * 100 / 7);
+ devtag_reset(space->machine(), "oki");
+ atarigen_set_ym2413_vol(space->machine(), ((data >> 1) & 7) * 100 / 7);
if (!(data & 0x0001))
- devtag_reset(space->machine, "ymsnd");
+ devtag_reset(space->machine(), "ymsnd");
}
}
@@ -479,10 +479,10 @@ ROM_END
static DRIVER_INIT( rampart )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memcpy(&rom[0x140000], &rom[0x40000], 0x8000);
- atarigen_slapstic_init(machine->device("maincpu"), 0x140000, 0x438000, 118);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x140000, 0x438000, 118);
}
diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c
index 92dd3e87890..381945dd2cf 100644
--- a/src/mame/drivers/rastan.c
+++ b/src/mame/drivers/rastan.c
@@ -168,13 +168,13 @@ Stephh's notes (based on the game M68000 code and some tests) :
static WRITE8_DEVICE_HANDLER( rastan_bankswitch_w )
{
- memory_set_bank(device->machine, "bank1", data & 3);
+ memory_set_bank(device->machine(), "bank1", data & 3);
}
static void rastan_msm5205_vck( device_t *device )
{
- rastan_state *state = device->machine->driver_data<rastan_state>();
+ rastan_state *state = device->machine().driver_data<rastan_state>();
if (state->adpcm_data != -1)
{
msm5205_data_w(device, state->adpcm_data & 0x0f);
@@ -182,7 +182,7 @@ static void rastan_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@@ -190,7 +190,7 @@ static void rastan_msm5205_vck( device_t *device )
static WRITE8_HANDLER( rastan_msm5205_address_w )
{
- rastan_state *state = space->machine->driver_data<rastan_state>();
+ rastan_state *state = space->machine().driver_data<rastan_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff) | (data << 8);
}
@@ -201,7 +201,7 @@ static WRITE8_DEVICE_HANDLER( rastan_msm5205_start_w )
static WRITE8_DEVICE_HANDLER( rastan_msm5205_stop_w )
{
- rastan_state *state = device->machine->driver_data<rastan_state>();
+ rastan_state *state = device->machine().driver_data<rastan_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0xff00;
}
@@ -346,7 +346,7 @@ GFXDECODE_END
/* handler called by the YM2151 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- rastan_state *state = device->machine->driver_data<rastan_state>();
+ rastan_state *state = device->machine().driver_data<rastan_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -364,16 +364,16 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( rastan )
{
- rastan_state *state = machine->driver_data<rastan_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ rastan_state *state = machine.driver_data<rastan_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 1, 3, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->pc080sn = machine->device("pc080sn");
- state->pc090oj = machine->device("pc090oj");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->pc080sn = machine.device("pc080sn");
+ state->pc090oj = machine.device("pc090oj");
state->save_item(NAME(state->sprite_ctrl));
state->save_item(NAME(state->sprites_flipscreen));
@@ -384,7 +384,7 @@ static MACHINE_START( rastan )
static MACHINE_RESET( rastan )
{
- rastan_state *state = machine->driver_data<rastan_state>();
+ rastan_state *state = machine.driver_data<rastan_state>();
state->sprite_ctrl = 0;
state->sprites_flipscreen = 0;
diff --git a/src/mame/drivers/rbmk.c b/src/mame/drivers/rbmk.c
index ff4cf21fca5..2e95db02a7e 100644
--- a/src/mame/drivers/rbmk.c
+++ b/src/mame/drivers/rbmk.c
@@ -72,7 +72,7 @@ public:
static READ16_HANDLER( gms_read )
{
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -83,7 +83,7 @@ static WRITE16_HANDLER( gms_write1 )
static WRITE16_HANDLER( gms_write2 )
{
- rbmk_state *state = space->machine->driver_data<rbmk_state>();
+ rbmk_state *state = space->machine().driver_data<rbmk_state>();
state->tilebank=data;
}
@@ -129,10 +129,10 @@ ADDRESS_MAP_END
static READ8_HANDLER( rbmk_mcu_io_r )
{
- rbmk_state *state = space->machine->driver_data<rbmk_state>();
+ rbmk_state *state = space->machine().driver_data<rbmk_state>();
if(state->mux_data & 8)
{
- return ym2151_r(space->machine->device("ymsnd"), offset & 1);
+ return ym2151_r(space->machine().device("ymsnd"), offset & 1);
}
else if(state->mux_data & 4)
{
@@ -148,8 +148,8 @@ static READ8_HANDLER( rbmk_mcu_io_r )
static WRITE8_HANDLER( rbmk_mcu_io_w )
{
- rbmk_state *state = space->machine->driver_data<rbmk_state>();
- if(state->mux_data & 8) { ym2151_w(space->machine->device("ymsnd"), offset & 1, data); }
+ rbmk_state *state = space->machine().driver_data<rbmk_state>();
+ if(state->mux_data & 8) { ym2151_w(space->machine().device("ymsnd"), offset & 1, data); }
else if(state->mux_data & 4)
{
//printf("%02x %02x W\n",offset,data);
@@ -161,7 +161,7 @@ static WRITE8_HANDLER( rbmk_mcu_io_w )
static WRITE8_HANDLER( mcu_io_mux_w )
{
- rbmk_state *state = space->machine->driver_data<rbmk_state>();
+ rbmk_state *state = space->machine().driver_data<rbmk_state>();
state->mux_data = ~data;
}
@@ -492,7 +492,7 @@ static VIDEO_START(rbmk)
static SCREEN_UPDATE(rbmk)
{
- rbmk_state *state = screen->machine->driver_data<rbmk_state>();
+ rbmk_state *state = screen->machine().driver_data<rbmk_state>();
int x,y;
int count = 0;
@@ -501,7 +501,7 @@ static SCREEN_UPDATE(rbmk)
for (x=0;x<64;x++)
{
int tile = state->gms_vidram2[count+0x600];
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],(tile&0xfff)+((state->tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],(tile&0xfff)+((state->tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
count++;
}
}
@@ -513,7 +513,7 @@ static SCREEN_UPDATE(rbmk)
for (x=0;x<64;x++)
{
int tile = state->gms_vidram[count];
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],(tile&0xfff)+((state->tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],(tile&0xfff)+((state->tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
count++;
}
}
@@ -522,7 +522,7 @@ static SCREEN_UPDATE(rbmk)
static INTERRUPT_GEN( mcu_irq )
{
- cputag_set_input_line(device->machine, "mcu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "mcu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_CONFIG_START( rbmk, rbmk_state )
diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c
index ab312e266bf..93afbd936f0 100644
--- a/src/mame/drivers/re900.c
+++ b/src/mame/drivers/re900.c
@@ -104,7 +104,7 @@ public:
static READ8_DEVICE_HANDLER (re_psg_portA_r)
{
- if ((input_port_read(device->machine, "IN0") & 0x01) == 0)
+ if ((input_port_read(device->machine(), "IN0") & 0x01) == 0)
{
output_set_lamp_value(0,1); // Operator Key ON
}
@@ -114,19 +114,19 @@ static READ8_DEVICE_HANDLER (re_psg_portA_r)
output_set_lamp_value(0,0); // Operator Key OFF
}
- return input_port_read(device->machine, "IN0");
+ return input_port_read(device->machine(), "IN0");
}
static READ8_DEVICE_HANDLER (re_psg_portB_r)
{
- re900_state *state = device->machine->driver_data<re900_state>();
+ re900_state *state = device->machine().driver_data<re900_state>();
UINT8 retval = 0xff;
logerror("llamada a re_psg_portB_r\n");
/* This is a hack to select the active player due to Keyboard size restrictions */
output_set_lamp_value(state->player,1);
- if (input_port_read(device->machine, "IN_S"))
+ if (input_port_read(device->machine(), "IN_S"))
{
if (!state->stat_a)
{
@@ -157,12 +157,12 @@ static READ8_DEVICE_HANDLER (re_psg_portB_r)
/* "INA": Unified port to share the player Keys among all players - Key In & Key Out have their own buttons on keyboard. */
switch( state->mux_data )
{
- case 0x01: retval = (input_port_read(device->machine, "IN6") | 0x80 ) - (( state->player == 6 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 6 */
- case 0x02: retval = (input_port_read(device->machine, "IN5") | 0x80 ) - (( state->player == 5 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 5 */
- case 0x04: retval = (input_port_read(device->machine, "IN4") | 0x80 ) - (( state->player == 4 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 4 */
- case 0x08: retval = (input_port_read(device->machine, "IN3") | 0x80 ) - (( state->player == 3 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 3 */
- case 0x10: retval = (input_port_read(device->machine, "IN2") | 0x80 ) - (( state->player == 2 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 2 */
- case 0x20: retval = (input_port_read(device->machine, "IN1") | 0x80 ) - (( state->player == 1 ) ? (input_port_read(device->machine, "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 1 */
+ case 0x01: retval = (input_port_read(device->machine(), "IN6") | 0x80 ) - (( state->player == 6 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 6 */
+ case 0x02: retval = (input_port_read(device->machine(), "IN5") | 0x80 ) - (( state->player == 5 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 5 */
+ case 0x04: retval = (input_port_read(device->machine(), "IN4") | 0x80 ) - (( state->player == 4 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 4 */
+ case 0x08: retval = (input_port_read(device->machine(), "IN3") | 0x80 ) - (( state->player == 3 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 3 */
+ case 0x10: retval = (input_port_read(device->machine(), "IN2") | 0x80 ) - (( state->player == 2 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 2 */
+ case 0x20: retval = (input_port_read(device->machine(), "IN1") | 0x80 ) - (( state->player == 1 ) ? (input_port_read(device->machine(), "INA") | 0x80 ) ^ 0xff: 0x00 ); break; /* Player 1 */
}
return retval;
@@ -170,7 +170,7 @@ static READ8_DEVICE_HANDLER (re_psg_portB_r)
static READ8_HANDLER (rom_r)
{
- re900_state *state = space->machine->driver_data<re900_state>();
+ re900_state *state = space->machine().driver_data<re900_state>();
return state->rom[offset];
}
@@ -181,14 +181,14 @@ static READ8_HANDLER (rom_r)
static WRITE8_DEVICE_HANDLER (re_mux_port_A_w)
{
- re900_state *state = device->machine->driver_data<re900_state>();
+ re900_state *state = device->machine().driver_data<re900_state>();
state->psg_pa = data;
state->mux_data = ((data >> 2) & 0x3f) ^ 0x3f;
}
static WRITE8_DEVICE_HANDLER (re_mux_port_B_w)
{
- re900_state *state = device->machine->driver_data<re900_state>();
+ re900_state *state = device->machine().driver_data<re900_state>();
UINT8 led;
state->psg_pb = data;
led = (state->psg_pa >> 2) & 0x3f;
@@ -241,10 +241,10 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( re900_video_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
-static void vdp_interrupt (running_machine *machine, int state)
+static void vdp_interrupt (running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE );
}
@@ -457,7 +457,7 @@ ROM_END
static DRIVER_INIT( re900 )
{
- re900_state *state = machine->driver_data<re900_state>();
+ re900_state *state = machine.driver_data<re900_state>();
TMS9928A_configure(&tms9928a_interface);
state->player = 1;
state->stat_a = 1;
diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c
index c4cb027d01b..8e95596960b 100644
--- a/src/mame/drivers/realbrk.c
+++ b/src/mame/drivers/realbrk.c
@@ -53,17 +53,17 @@ To Do:
/* Read 4 ten bit dip switches */
static READ16_HANDLER( realbrk_dsw_r )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
UINT16 sel = ~state->dsw_select[0];
- if (sel & 0x01) return (input_port_read(space->machine, "SW1") & 0x00ff) << 8; // DSW1 low bits
- if (sel & 0x02) return (input_port_read(space->machine, "SW2") & 0x00ff) << 8; // DSW2 low bits
- if (sel & 0x04) return (input_port_read(space->machine, "SW3") & 0x00ff) << 8; // DSW3 low bits
- if (sel & 0x08) return (input_port_read(space->machine, "SW4") & 0x00ff) << 8; // DSW4 low bits
+ if (sel & 0x01) return (input_port_read(space->machine(), "SW1") & 0x00ff) << 8; // DSW1 low bits
+ if (sel & 0x02) return (input_port_read(space->machine(), "SW2") & 0x00ff) << 8; // DSW2 low bits
+ if (sel & 0x04) return (input_port_read(space->machine(), "SW3") & 0x00ff) << 8; // DSW3 low bits
+ if (sel & 0x08) return (input_port_read(space->machine(), "SW4") & 0x00ff) << 8; // DSW4 low bits
- if (sel & 0x10) return ((input_port_read(space->machine, "SW1") & 0x0300) << 0) | // DSWs high 2 bits
- ((input_port_read(space->machine, "SW2") & 0x0300) << 2) |
- ((input_port_read(space->machine, "SW3") & 0x0300) << 4) |
- ((input_port_read(space->machine, "SW4") & 0x0300) << 6) ;
+ if (sel & 0x10) return ((input_port_read(space->machine(), "SW1") & 0x0300) << 0) | // DSWs high 2 bits
+ ((input_port_read(space->machine(), "SW2") & 0x0300) << 2) |
+ ((input_port_read(space->machine(), "SW3") & 0x0300) << 4) |
+ ((input_port_read(space->machine(), "SW4") & 0x0300) << 6) ;
logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",cpu_get_pc(space->cpu),state->dsw_select[0]);
return 0xffff;
@@ -75,42 +75,42 @@ static READ16_HANDLER( pkgnsh_input_r )
{
case 0x00/2: return 0xffff;
case 0x02/2: return 0xffff;
- case 0x04/2: return input_port_read(space->machine, "IN0"); /*Service buttons*/
- case 0x06/2: return input_port_read(space->machine, "SW1"); /*DIP 2*/
- case 0x08/2: return input_port_read(space->machine, "SW2"); /*DIP 1*/
- case 0x0a/2: return input_port_read(space->machine, "SW3"); /*DIP 1+2 Hi-Bits*/
- case 0x0c/2: return input_port_read(space->machine, "PADDLE1"); /*Handle 1p*/
- case 0x0e/2: return input_port_read(space->machine, "P1"); /*Buttons 1p*/
- case 0x10/2: return input_port_read(space->machine, "PADDLE2"); /*Handle 2p*/
- case 0x12/2: return input_port_read(space->machine, "P2"); /*Buttons 2p*/
+ case 0x04/2: return input_port_read(space->machine(), "IN0"); /*Service buttons*/
+ case 0x06/2: return input_port_read(space->machine(), "SW1"); /*DIP 2*/
+ case 0x08/2: return input_port_read(space->machine(), "SW2"); /*DIP 1*/
+ case 0x0a/2: return input_port_read(space->machine(), "SW3"); /*DIP 1+2 Hi-Bits*/
+ case 0x0c/2: return input_port_read(space->machine(), "PADDLE1"); /*Handle 1p*/
+ case 0x0e/2: return input_port_read(space->machine(), "P1"); /*Buttons 1p*/
+ case 0x10/2: return input_port_read(space->machine(), "PADDLE2"); /*Handle 2p*/
+ case 0x12/2: return input_port_read(space->machine(), "P2"); /*Buttons 2p*/
}
return 0xffff;
}
static READ16_HANDLER( pkgnshdx_input_r )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
UINT16 sel = ~state->dsw_select[0];
switch(offset)
{
case 0x00/2: return 0xffff;
- case 0x02/2: return input_port_read(space->machine, "IN0"); /*Service buttons*/
+ case 0x02/2: return input_port_read(space->machine(), "IN0"); /*Service buttons*/
/*DSW,same handling as realbrk*/
case 0x04/2:
- if (sel & 0x01) return (input_port_read(space->machine, "SW1") & 0x00ff) << 8; // DSW1 low bits
- if (sel & 0x02) return (input_port_read(space->machine, "SW2") & 0x00ff) << 8; // DSW2 low bits
- if (sel & 0x04) return (input_port_read(space->machine, "SW3") & 0x00ff) << 8; // DSW3 low bits
- if (sel & 0x08) return (input_port_read(space->machine, "SW4") & 0x00ff) << 8; // DSW4 low bits
+ if (sel & 0x01) return (input_port_read(space->machine(), "SW1") & 0x00ff) << 8; // DSW1 low bits
+ if (sel & 0x02) return (input_port_read(space->machine(), "SW2") & 0x00ff) << 8; // DSW2 low bits
+ if (sel & 0x04) return (input_port_read(space->machine(), "SW3") & 0x00ff) << 8; // DSW3 low bits
+ if (sel & 0x08) return (input_port_read(space->machine(), "SW4") & 0x00ff) << 8; // DSW4 low bits
- if (sel & 0x10) return ((input_port_read(space->machine, "SW1") & 0x0300) << 0) | // DSWs high 2 bits
- ((input_port_read(space->machine, "SW2") & 0x0300) << 2) |
- ((input_port_read(space->machine, "SW3") & 0x0300) << 4) |
- ((input_port_read(space->machine, "SW4") & 0x0300) << 6) ;
+ if (sel & 0x10) return ((input_port_read(space->machine(), "SW1") & 0x0300) << 0) | // DSWs high 2 bits
+ ((input_port_read(space->machine(), "SW2") & 0x0300) << 2) |
+ ((input_port_read(space->machine(), "SW3") & 0x0300) << 4) |
+ ((input_port_read(space->machine(), "SW4") & 0x0300) << 6) ;
return 0xffff;
- case 0x06/2: return input_port_read(space->machine, "P2");/*Buttons+Handle 2p*/
- case 0x08/2: return input_port_read(space->machine, "P1");/*Buttons+Handle 1p*/
+ case 0x06/2: return input_port_read(space->machine(), "P2");/*Buttons+Handle 2p*/
+ case 0x08/2: return input_port_read(space->machine(), "P1");/*Buttons+Handle 1p*/
case 0x0a/2: return 0xffff;
case 0x0c/2: return 0xffff;
case 0x0e/2: return 0xffff;
@@ -124,7 +124,7 @@ static READ16_HANDLER( pkgnshdx_input_r )
static READ16_HANDLER( backup_ram_r )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
/*TODO: understand the format & cmds of the backup-ram,maybe it's an
unemulated tmp68301 feature?*/
if(cpu_get_previouspc(space->cpu) == 0x02c08e)
@@ -136,7 +136,7 @@ static READ16_HANDLER( backup_ram_r )
static READ16_HANDLER( backup_ram_dx_r )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
/*TODO: understand the format & cmds of the backup-ram,maybe it's an
unemulated tmp68301 feature?*/
if(cpu_get_previouspc(space->cpu) == 0x02f046)
@@ -147,7 +147,7 @@ static READ16_HANDLER( backup_ram_dx_r )
static WRITE16_HANDLER( backup_ram_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
COMBINE_DATA(&state->backup_ram[offset]);
}
@@ -671,7 +671,7 @@ static INTERRUPT_GEN( realbrk_interrupt )
{
case 0:
/* VBlank is connected to INT1 (external interrupts pin 1) */
- tmp68301_external_interrupt_1(device->machine);
+ tmp68301_external_interrupt_1(device->machine());
break;
}
}
diff --git a/src/mame/drivers/redalert.c b/src/mame/drivers/redalert.c
index 5cea6e48b9c..7ef58843e79 100644
--- a/src/mame/drivers/redalert.c
+++ b/src/mame/drivers/redalert.c
@@ -109,7 +109,7 @@
static INTERRUPT_GEN( redalert_vblank_interrupt )
{
- if( input_port_read(device->machine, "COIN") )
+ if( input_port_read(device->machine(), "COIN") )
/* the service coin as conntected to the CPU's RDY pin as well */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -119,10 +119,10 @@ static INTERRUPT_GEN( redalert_vblank_interrupt )
static READ8_HANDLER( redalert_interrupt_clear_r )
{
- cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
/* the result never seems to be actually used */
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -134,14 +134,14 @@ static WRITE8_HANDLER( redalert_interrupt_clear_w )
static READ8_HANDLER( panther_interrupt_clear_r )
{
- cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
- return input_port_read(space->machine, "STICK0");
+ return input_port_read(space->machine(), "STICK0");
}
static READ8_HANDLER( panther_unk_r )
{
- return ((space->machine->rand() & 0x01) | (input_port_read(space->machine, "C020") & 0xfe));
+ return ((space->machine().rand() & 0x01) | (input_port_read(space->machine(), "C020") & 0xfe));
}
/*************************************
diff --git a/src/mame/drivers/redclash.c b/src/mame/drivers/redclash.c
index c619a2f9c3a..8acabd3a9f4 100644
--- a/src/mame/drivers/redclash.c
+++ b/src/mame/drivers/redclash.c
@@ -27,7 +27,7 @@ TODO:
static WRITE8_HANDLER( irqack_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -78,7 +78,7 @@ ADDRESS_MAP_END
*/
static INPUT_CHANGED( left_coin_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
if(newval)
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
@@ -86,7 +86,7 @@ static INPUT_CHANGED( left_coin_inserted )
static INPUT_CHANGED( right_coin_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
if(newval)
device_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -328,9 +328,9 @@ GFXDECODE_END
static MACHINE_START( redclash )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->star_speed));
state->save_item(NAME(state->gfxbank));
@@ -343,7 +343,7 @@ static MACHINE_START( redclash )
static MACHINE_RESET( redclash )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
state->star_speed = 0;
state->gfxbank = 0;
@@ -545,9 +545,9 @@ ROM_END
static DRIVER_INIT( redclash )
{
int i,j;
- const UINT8 *src = machine->region("gfx2")->base();
- UINT8 *dst = machine->region("gfx3")->base();
- int len = machine->region("gfx3")->bytes();
+ const UINT8 *src = machine.region("gfx2")->base();
+ UINT8 *dst = machine.region("gfx3")->base();
+ int len = machine.region("gfx3")->bytes();
/* rearrange the sprite graphics */
for (i = 0;i < len;i++)
diff --git a/src/mame/drivers/relief.c b/src/mame/drivers/relief.c
index 33eee36b523..b1827f8ed37 100644
--- a/src/mame/drivers/relief.c
+++ b/src/mame/drivers/relief.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- relief_state *state = machine->driver_data<relief_state>();
+ relief_state *state = machine.driver_data<relief_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -47,13 +47,13 @@ static void update_interrupts(running_machine *machine)
static READ16_HANDLER( relief_atarivc_r )
{
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( relief_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
@@ -72,13 +72,13 @@ static MACHINE_START( relief )
static MACHINE_RESET( relief )
{
- relief_state *state = machine->driver_data<relief_state>();
+ relief_state *state = machine.driver_data<relief_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 2);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 2);
- machine->device<okim6295_device>("oki")->set_bank_base(0);
+ machine.device<okim6295_device>("oki")->set_bank_base(0);
state->ym2413_volume = 15;
state->overall_volume = 127;
state->adpcm_bank_base = 0;
@@ -94,10 +94,10 @@ static MACHINE_RESET( relief )
static READ16_HANDLER( special_port2_r )
{
- relief_state *state = space->machine->driver_data<relief_state>();
- int result = input_port_read(space->machine, "260010");
+ relief_state *state = space->machine().driver_data<relief_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->cpu_to_sound_ready) result ^= 0x0020;
- if (!(result & 0x0080) || atarigen_get_hblank(*space->machine->primary_screen)) result ^= 0x0001;
+ if (!(result & 0x0080) || atarigen_get_hblank(*space->machine().primary_screen)) result ^= 0x0001;
return result;
}
@@ -111,29 +111,29 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( audio_control_w )
{
- relief_state *state = space->machine->driver_data<relief_state>();
+ relief_state *state = space->machine().driver_data<relief_state>();
if (ACCESSING_BITS_0_7)
{
state->ym2413_volume = (data >> 1) & 15;
- atarigen_set_ym2413_vol(space->machine, (state->ym2413_volume * state->overall_volume * 100) / (127 * 15));
+ atarigen_set_ym2413_vol(space->machine(), (state->ym2413_volume * state->overall_volume * 100) / (127 * 15));
state->adpcm_bank_base = (0x040000 * ((data >> 6) & 3)) | (state->adpcm_bank_base & 0x100000);
}
if (ACCESSING_BITS_8_15)
state->adpcm_bank_base = (0x100000 * ((data >> 8) & 1)) | (state->adpcm_bank_base & 0x0c0000);
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base(state->adpcm_bank_base);
}
static WRITE16_HANDLER( audio_volume_w )
{
- relief_state *state = space->machine->driver_data<relief_state>();
+ relief_state *state = space->machine().driver_data<relief_state>();
if (ACCESSING_BITS_0_7)
{
state->overall_volume = data & 127;
- atarigen_set_ym2413_vol(space->machine, (state->ym2413_volume * state->overall_volume * 100) / (127 * 15));
- atarigen_set_oki6295_vol(space->machine, state->overall_volume * 100 / 127);
+ atarigen_set_ym2413_vol(space->machine(), (state->ym2413_volume * state->overall_volume * 100) / (127 * 15));
+ atarigen_set_oki6295_vol(space->machine(), state->overall_volume * 100 / 127);
}
}
@@ -447,7 +447,7 @@ ROM_END
static DRIVER_INIT( relief )
{
- UINT8 *sound_base = machine->region("oki")->base();
+ UINT8 *sound_base = machine.region("oki")->base();
/* expand the ADPCM data to avoid lots of memcpy's during gameplay */
/* the upper 128k is fixed, the lower 128k is bankswitched */
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 1d9b40379fe..83fb0ed012d 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -164,8 +164,8 @@ static DEVICE_START( renegade_adpcm )
{
renegade_adpcm_state *state = get_safe_token(device);
state->playing = 0;
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), state, renegade_adpcm_callback);
- state->base = device->machine->region("adpcm")->base();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, renegade_adpcm_callback);
+ state->base = device->machine().region("adpcm")->base();
state->adpcm.reset();
}
@@ -215,7 +215,7 @@ static WRITE8_DEVICE_HANDLER( adpcm_play_w )
static WRITE8_HANDLER( sound_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
}
/********************************************************************************************/
@@ -237,10 +237,10 @@ static const UINT8 kuniokun_xor_table[0x2a] =
0x68, 0x60
};
-static void setbank(running_machine *machine)
+static void setbank(running_machine &machine)
{
- renegade_state *state = machine->driver_data<renegade_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ renegade_state *state = machine.driver_data<renegade_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &RAM[state->bank ? 0x10000 : 0x4000]);
}
@@ -251,36 +251,36 @@ static STATE_POSTLOAD( renegade_postload )
static MACHINE_START( renegade )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
state_save_register_global_array(machine, state->mcu_buffer);
state_save_register_global(machine, state->mcu_input_size);
state_save_register_global(machine, state->mcu_output_byte);
state_save_register_global(machine, state->mcu_key);
state_save_register_global(machine, state->bank);
- machine->state().register_postload(renegade_postload, NULL);
+ machine.state().register_postload(renegade_postload, NULL);
}
static DRIVER_INIT( renegade )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
state->mcu_sim = FALSE;
}
static DRIVER_INIT( kuniokun )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
state->mcu_sim = TRUE;
state->mcu_checksum = 0x85;
state->mcu_encrypt_table = kuniokun_xor_table;
state->mcu_encrypt_table_len = 0x2a;
- machine->device<cpu_device>("mcu")->suspend(SUSPEND_REASON_DISABLE, 1);
+ machine.device<cpu_device>("mcu")->suspend(SUSPEND_REASON_DISABLE, 1);
}
static DRIVER_INIT( kuniokunb )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Remove the MCU handlers */
space->unmap_readwrite(0x3804, 0x3804);
@@ -296,37 +296,37 @@ static DRIVER_INIT( kuniokunb )
READ8_HANDLER( renegade_68705_port_a_r )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( renegade_68705_port_a_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->port_a_out = data;
}
WRITE8_HANDLER( renegade_68705_ddr_a_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->ddr_a = data;
}
READ8_HANDLER( renegade_68705_port_b_r )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( renegade_68705_port_b_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
if ((state->ddr_b & 0x02) && (~data & 0x02) && (state->port_b_out & 0x02))
{
state->port_a_in = state->from_main;
if (state->main_sent)
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
state->main_sent = 0;
}
@@ -341,14 +341,14 @@ WRITE8_HANDLER( renegade_68705_port_b_w )
WRITE8_HANDLER( renegade_68705_ddr_b_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->ddr_b = data;
}
READ8_HANDLER( renegade_68705_port_c_r )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->port_c_in = 0;
if (state->main_sent)
state->port_c_in |= 0x01;
@@ -360,13 +360,13 @@ READ8_HANDLER( renegade_68705_port_c_r )
WRITE8_HANDLER( renegade_68705_port_c_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->port_c_out = data;
}
WRITE8_HANDLER( renegade_68705_ddr_c_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->ddr_c = data;
}
@@ -379,7 +379,7 @@ WRITE8_HANDLER( renegade_68705_ddr_c_w )
static READ8_HANDLER( mcu_reset_r )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
if (state->mcu_sim == TRUE)
{
state->mcu_key = -1;
@@ -388,14 +388,14 @@ static READ8_HANDLER( mcu_reset_r )
}
else
{
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, PULSE_LINE);
}
return 0;
}
static WRITE8_HANDLER( mcu_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
if (state->mcu_sim == TRUE)
{
state->mcu_output_byte = 0;
@@ -419,7 +419,7 @@ static WRITE8_HANDLER( mcu_w )
{
state->from_main = data;
state->main_sent = 1;
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
}
}
@@ -590,7 +590,7 @@ static void mcu_process_command(renegade_state *state)
static READ8_HANDLER( mcu_r )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
if (state->mcu_sim == TRUE)
{
int result = 1;
@@ -612,7 +612,7 @@ static READ8_HANDLER( mcu_r )
static CUSTOM_INPUT( mcu_status_r )
{
- renegade_state *state = field->port->machine->driver_data<renegade_state>();
+ renegade_state *state = field->port->machine().driver_data<renegade_state>();
UINT8 res = 0;
if (state->mcu_sim == TRUE)
@@ -634,11 +634,11 @@ static CUSTOM_INPUT( mcu_status_r )
static WRITE8_HANDLER( bankswitch_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
if ((data & 1) != state->bank)
{
state->bank = data & 1;
- setbank(space->machine);
+ setbank(space->machine());
}
}
@@ -909,7 +909,7 @@ GFXDECODE_END
/* handler called by the 3526 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_FIRQ_LINE, linestate);
}
static const ym3526_interface ym3526_config =
@@ -920,7 +920,7 @@ static const ym3526_interface ym3526_config =
static MACHINE_RESET( renegade )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
state->bank = 0;
setbank(machine);
}
diff --git a/src/mame/drivers/retofinv.c b/src/mame/drivers/retofinv.c
index 73750e72db6..cbe528a2c33 100644
--- a/src/mame/drivers/retofinv.c
+++ b/src/mame/drivers/retofinv.c
@@ -39,65 +39,65 @@ Notes:
static WRITE8_HANDLER( cpu1_reset_w )
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( cpu2_reset_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( mcu_reset_w )
{
/* the bootlegs don't have a MCU, so make sure it's there before trying to reset it */
- if (space->machine->device("68705") != NULL)
- cputag_set_input_line(space->machine, "68705", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
+ if (space->machine().device("68705") != NULL)
+ cputag_set_input_line(space->machine(), "68705", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( cpu2_m6000_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->cpu2_m6000 = data;
}
static READ8_HANDLER( cpu0_mf800_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
return state->cpu2_m6000;
}
static WRITE8_HANDLER( soundcommand_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static WRITE8_HANDLER( irq0_ack_w )
{
int bit = data & 1;
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( irq1_ack_w )
{
int bit = data & 1;
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( coincounter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( coinlockout_w )
{
- coin_lockout_w(space->machine, 0,~data & 1);
+ coin_lockout_w(space->machine(), 0,~data & 1);
}
diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c
index d9993ee8b32..05248a415be 100644
--- a/src/mame/drivers/rgum.c
+++ b/src/mame/drivers/rgum.c
@@ -37,9 +37,9 @@ static VIDEO_START(royalgum)
static SCREEN_UPDATE(royalgum)
{
- rgum_state *state = screen->machine->driver_data<rgum_state>();
+ rgum_state *state = screen->machine().driver_data<rgum_state>();
int x,y,count;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
count = 0;
@@ -81,7 +81,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( rgum_heartbeat_r )
{
- rgum_state *state = field->port->machine->driver_data<rgum_state>();
+ rgum_state *state = field->port->machine().driver_data<rgum_state>();
state->hbeat ^= 1;
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index dde7f556ab3..5aa2c177c19 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -51,21 +51,21 @@ public:
static WRITE8_HANDLER( rmhaihai_videoram_w )
{
- rmhaihai_state *state = space->machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = space->machine().driver_data<rmhaihai_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( rmhaihai_colorram_w )
{
- rmhaihai_state *state = space->machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = space->machine().driver_data<rmhaihai_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- rmhaihai_state *state = machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = machine.driver_data<rmhaihai_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + (state->gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4);
int color = (state->gfxbank << 5) + (attr >> 3);
@@ -75,14 +75,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( rmhaihai )
{
- rmhaihai_state *state = machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = machine.driver_data<rmhaihai_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 64, 32);
}
static SCREEN_UPDATE( rmhaihai )
{
- rmhaihai_state *state = screen->machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = screen->machine().driver_data<rmhaihai_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -92,7 +92,7 @@ static SCREEN_UPDATE( rmhaihai )
static READ8_HANDLER( keyboard_r )
{
- rmhaihai_state *state = space->machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = space->machine().driver_data<rmhaihai_state>();
static const char *const keynames[] = { "KEY0", "KEY1" };
logerror("%04x: keyboard_r\n",cpu_get_pc(space->cpu));
@@ -108,9 +108,9 @@ static READ8_HANDLER( keyboard_r )
for (i = 0; i < 31; i++)
{
- if (input_port_read(space->machine, keynames[i/16]) & (1 << (i & 15))) return i+1;
+ if (input_port_read(space->machine(), keynames[i/16]) & (1 << (i & 15))) return i+1;
}
- if (input_port_read(space->machine, "KEY1") & 0x8000) return 0x80; // coin
+ if (input_port_read(space->machine(), "KEY1") & 0x8000) return 0x80; // coin
return 0;
}
case 0x5c7b: // rmhaihai, rmhaisei, rmhaijin
@@ -143,14 +143,14 @@ static READ8_HANDLER( keyboard_r )
static WRITE8_HANDLER( keyboard_w )
{
- rmhaihai_state *state = space->machine->driver_data<rmhaihai_state>();
+ rmhaihai_state *state = space->machine().driver_data<rmhaihai_state>();
logerror("%04x: keyboard_w %02x\n",cpu_get_pc(space->cpu),data);
state->keyboard_cmd = data;
}
static READ8_HANDLER( samples_r )
{
- return space->machine->region("adpcm")->base()[offset];
+ return space->machine().region("adpcm")->base()[offset];
}
static WRITE8_DEVICE_HANDLER( adpcm_w )
@@ -162,13 +162,13 @@ static WRITE8_DEVICE_HANDLER( adpcm_w )
static WRITE8_HANDLER( ctrl_w )
{
- rmhaihai_state *state = space->machine->driver_data<rmhaihai_state>();
- flip_screen_set(space->machine, data & 0x01);
+ rmhaihai_state *state = space->machine().driver_data<rmhaihai_state>();
+ flip_screen_set(space->machine(), data & 0x01);
// (data & 0x02) is switched on and off in service mode
- coin_lockout_w(space->machine, 0, ~data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
+ coin_lockout_w(space->machine(), 0, ~data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
// (data & 0x10) is medal in service mode
@@ -177,16 +177,16 @@ static WRITE8_HANDLER( ctrl_w )
static WRITE8_HANDLER( themj_rombank_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("maincpu")->base() + 0x10000;
int bank = data & 0x03;
logerror("banksw %d\n",bank);
- memory_set_bankptr(space->machine, "bank1", rom + bank*0x4000);
- memory_set_bankptr(space->machine, "bank2", rom + bank*0x4000 + 0x2000);
+ memory_set_bankptr(space->machine(), "bank1", rom + bank*0x4000);
+ memory_set_bankptr(space->machine(), "bank2", rom + bank*0x4000 + 0x2000);
}
static MACHINE_RESET( themj )
{
- themj_rombank_w(machine->device("maincpu")->memory().space(AS_IO), 0, 0);
+ themj_rombank_w(machine.device("maincpu")->memory().space(AS_IO), 0, 0);
}
@@ -661,8 +661,8 @@ ROM_END
static DRIVER_INIT( rmhaihai )
{
- UINT8 *rom = machine->region("gfx1")->base();
- int size = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int size = machine.region("gfx1")->bytes();
int a,b;
size /= 2;
diff --git a/src/mame/drivers/rockrage.c b/src/mame/drivers/rockrage.c
index 64e531c636f..113052b23d5 100644
--- a/src/mame/drivers/rockrage.c
+++ b/src/mame/drivers/rockrage.c
@@ -58,7 +58,7 @@ Notes:
static INTERRUPT_GEN( rockrage_interrupt )
{
- rockrage_state *state = device->machine->driver_data<rockrage_state>();
+ rockrage_state *state = device->machine().driver_data<rockrage_state>();
if (k007342_is_int_enabled(state->k007342))
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
@@ -66,18 +66,18 @@ static INTERRUPT_GEN( rockrage_interrupt )
static WRITE8_HANDLER( rockrage_bankswitch_w )
{
/* bits 4-6 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0x70) >> 4);
+ memory_set_bank(space->machine(), "bank1", (data & 0x70) >> 4);
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* other bits unknown */
}
static WRITE8_HANDLER( rockrage_sh_irqtrigger_w )
{
- rockrage_state *state = space->machine->driver_data<rockrage_state>();
+ rockrage_state *state = space->machine().driver_data<rockrage_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
}
@@ -273,14 +273,14 @@ static const k007420_interface rockrage_k007420_intf =
static MACHINE_START( rockrage )
{
- rockrage_state *state = machine->driver_data<rockrage_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ rockrage_state *state = machine.driver_data<rockrage_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007342 = machine->device("k007342");
- state->k007420 = machine->device("k007420");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007342 = machine.device("k007342");
+ state->k007420 = machine.device("k007420");
state->save_item(NAME(state->vreg));
state->save_item(NAME(state->layer_colorbase));
@@ -288,7 +288,7 @@ static MACHINE_START( rockrage )
static MACHINE_RESET( rockrage )
{
- rockrage_state *state = machine->driver_data<rockrage_state>();
+ rockrage_state *state = machine.driver_data<rockrage_state>();
state->vreg = 0;
state->layer_colorbase[0] = 0x00;
diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c
index 7533777953d..23ed3b9892c 100644
--- a/src/mame/drivers/rocnrope.c
+++ b/src/mame/drivers/rocnrope.c
@@ -25,7 +25,7 @@
/* Roc'n'Rope has the IRQ vectors in RAM. The rom contains $FFFF at this address! */
static WRITE8_HANDLER( rocnrope_interrupt_vector_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
RAM[0xfff2 + offset] = data;
}
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index afc781fa72e..555c914cb40 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -116,7 +116,7 @@
static READ16_HANDLER( rohga_irq_ack_r )
{
- rohga_state *state = space->machine->driver_data<rohga_state>();
+ rohga_state *state = space->machine().driver_data<rohga_state>();
device_set_input_line(state->maincpu, 6, CLEAR_LINE);
return 0;
@@ -127,7 +127,7 @@ static WRITE16_HANDLER( wizdfire_irq_ack_w )
/* This might actually do more, nitrobal for example sets 0xca->0xffff->0x80 at startup then writes 7 all the time
except when a credit is inserted (writes 6 twice).
Wizard Fire / Dark Seal 2 just writes 1 all the time, so I just don't trust it much for now... -AS */
- rohga_state *state = space->machine->driver_data<rohga_state>();
+ rohga_state *state = space->machine().driver_data<rohga_state>();
device_set_input_line(state->maincpu, 6, CLEAR_LINE);
}
@@ -722,13 +722,13 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- rohga_state *driver_state = device->machine->driver_data<rohga_state>();
+ rohga_state *driver_state = device->machine().driver_data<rohga_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- rohga_state *state = device->machine->driver_data<rohga_state>();
+ rohga_state *state = device->machine().driver_data<rohga_state>();
state->oki1->set_bank_base(BIT(data, 0) * 0x40000);
state->oki2->set_bank_base(BIT(data, 1) * 0x40000);
}
@@ -1540,8 +1540,8 @@ static DRIVER_INIT( nitrobal )
static DRIVER_INIT( schmeisr )
{
- const UINT8 *src = machine->region("gfx2")->base();
- UINT8 *dst = machine->region("gfx1")->base();
+ const UINT8 *src = machine.region("gfx2")->base();
+ UINT8 *dst = machine.region("gfx1")->base();
memcpy(dst, src, 0x20000);
memcpy(dst + 0x20000, src + 0x80000, 0x20000);
diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c
index c6e042016e4..56cd74701f9 100644
--- a/src/mame/drivers/rollerg.c
+++ b/src/mame/drivers/rollerg.c
@@ -23,12 +23,12 @@ static KONAMI_SETLINES_CALLBACK( rollerg_banking );
static WRITE8_HANDLER( rollerg_0010_w )
{
- rollerg_state *state = space->machine->driver_data<rollerg_state>();
+ rollerg_state *state = space->machine().driver_data<rollerg_state>();
logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu), data);
/* bits 0/1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 enables 051316 ROM reading */
state->readzoomroms = data & 0x04;
@@ -41,7 +41,7 @@ static WRITE8_HANDLER( rollerg_0010_w )
static READ8_HANDLER( rollerg_k051316_r )
{
- rollerg_state *state = space->machine->driver_data<rollerg_state>();
+ rollerg_state *state = space->machine().driver_data<rollerg_state>();
if (state->readzoomroms)
return k051316_rom_r(state->k051316, offset);
@@ -58,21 +58,21 @@ static READ8_DEVICE_HANDLER( rollerg_sound_r )
static WRITE8_HANDLER( soundirq_w )
{
- rollerg_state *state = space->machine->driver_data<rollerg_state>();
+ rollerg_state *state = space->machine().driver_data<rollerg_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static TIMER_CALLBACK( nmi_callback )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
- rollerg_state *state = space->machine->driver_data<rollerg_state>();
+ rollerg_state *state = space->machine().driver_data<rollerg_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
}
static READ8_HANDLER( pip_r )
@@ -236,27 +236,27 @@ static const k051316_interface rollerg_k051316_intf =
static MACHINE_START( rollerg )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank1", 6, 2, &ROM[0x10000], 0x4000);
memory_set_bank(machine, "bank1", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053244 = machine->device("k053244");
- state->k051316 = machine->device("k051316");
- state->k053260 = machine->device("k053260");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053244 = machine.device("k053244");
+ state->k051316 = machine.device("k051316");
+ state->k053260 = machine.device("k053260");
state->save_item(NAME(state->readzoomroms));
}
static MACHINE_RESET( rollerg )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
- konami_configure_set_lines(machine->device("maincpu"), rollerg_banking);
+ konami_configure_set_lines(machine.device("maincpu"), rollerg_banking);
state->readzoomroms = 0;
}
@@ -360,7 +360,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( rollerg_banking )
{
- memory_set_bank(device->machine, "bank1", lines & 0x07);
+ memory_set_bank(device->machine(), "bank1", lines & 0x07);
}
diff --git a/src/mame/drivers/rotaryf.c b/src/mame/drivers/rotaryf.c
index e03d288aa38..be799ee2f71 100644
--- a/src/mame/drivers/rotaryf.c
+++ b/src/mame/drivers/rotaryf.c
@@ -40,7 +40,7 @@ public:
static INTERRUPT_GEN( rotaryf_interrupt )
{
- if (device->machine->primary_screen->vblank())
+ if (device->machine().primary_screen->vblank())
device_set_input_line(device, I8085_RST55_LINE, HOLD_LINE);
else
{
@@ -59,7 +59,7 @@ static INTERRUPT_GEN( rotaryf_interrupt )
static SCREEN_UPDATE( rotaryf )
{
- rotaryf_state *state = screen->machine->driver_data<rotaryf_state>();
+ rotaryf_state *state = screen->machine().driver_data<rotaryf_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c
index 6b5979b37e8..d5511df7ea1 100644
--- a/src/mame/drivers/roul.c
+++ b/src/mame/drivers/roul.c
@@ -116,12 +116,12 @@ bit 6 -> ??? (after unknown blitter command : [80][80][08][02])
*/
// return 0x80; // blitter ready
// logerror("Read unknown port $f5 at %04x\n",cpu_get_pc(space->cpu));
- return space->machine->rand() & 0x00c0;
+ return space->machine().rand() & 0x00c0;
}
static WRITE8_HANDLER( blitter_cmd_w )
{
- roul_state *state = space->machine->driver_data<roul_state>();
+ roul_state *state = space->machine().driver_data<roul_state>();
state->reg[offset] = data;
if (offset==2)
{
@@ -164,12 +164,12 @@ static WRITE8_HANDLER( blitter_cmd_w )
static WRITE8_HANDLER( sound_latch_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, HOLD_LINE);
}
static WRITE8_HANDLER( ball_w )
{
- roul_state *state = space->machine->driver_data<roul_state>();
+ roul_state *state = space->machine().driver_data<roul_state>();
int lamp = data;
output_set_lamp_value(data, 1);
@@ -206,13 +206,13 @@ ADDRESS_MAP_END
static VIDEO_START(roul)
{
- roul_state *state = machine->driver_data<roul_state>();
+ roul_state *state = machine.driver_data<roul_state>();
state->videobuf = auto_alloc_array_clear(machine, UINT8, VIDEOBUF_SIZE);
}
static SCREEN_UPDATE(roul)
{
- roul_state *state = screen->machine->driver_data<roul_state>();
+ roul_state *state = screen->machine().driver_data<roul_state>();
int i,j;
for (i = 0; i < 256; i++)
for (j = 0; j < 256; j++)
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index ad3769fa598..f72865b5965 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -90,21 +90,21 @@ static READ8_HANDLER( routex_prot_read );
static READ8_HANDLER( sharedram_r )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( sharedram_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->sharedram[offset] = data;
}
static WRITE8_HANDLER( route16_sharedram_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->sharedram[offset] = data;
// 4313-4319 are used in Route 16 as triggers to wake the other CPU
@@ -157,22 +157,22 @@ static WRITE8_DEVICE_HANDLER( stratvox_sn76477_w )
static WRITE8_HANDLER( ttmahjng_input_port_matrix_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->ttmahjng_port_select = data;
}
static READ8_HANDLER( ttmahjng_input_port_matrix_r )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
UINT8 ret = 0;
switch (state->ttmahjng_port_select)
{
- case 1: ret = input_port_read(space->machine, "KEY0"); break;
- case 2: ret = input_port_read(space->machine, "KEY1"); break;
- case 4: ret = input_port_read(space->machine, "KEY2"); break;
- case 8: ret = input_port_read(space->machine, "KEY3"); break;
+ case 1: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 2: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 4: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 8: ret = input_port_read(space->machine(), "KEY3"); break;
default: break;
}
@@ -192,7 +192,7 @@ static READ8_HANDLER( ttmahjng_input_port_matrix_r )
static READ8_HANDLER ( speakres_in3_r )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
int bit2=4, bit1=2, bit0=1;
/* just using a counter, the constants are the number of reads
@@ -208,7 +208,7 @@ static READ8_HANDLER ( speakres_in3_r )
static WRITE8_HANDLER ( speakres_out2_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->speakres_vrx=0;
}
@@ -966,7 +966,7 @@ static READ8_HANDLER( routex_prot_read )
static DRIVER_INIT( route16 )
{
- UINT8 *ROM = machine->region("cpu1")->base();
+ UINT8 *ROM = machine.region("cpu1")->base();
/* Is this actually a bootleg? some of the protection has
been removed */
@@ -981,7 +981,7 @@ static DRIVER_INIT( route16 )
static DRIVER_INIT( route16a )
{
- UINT8 *ROM = machine->region("cpu1")->base();
+ UINT8 *ROM = machine.region("cpu1")->base();
/* TO DO : Replace these patches with simulation of the protection device */
/* patch the protection */
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index d5cb9142d5e..01aa49ded29 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -128,8 +128,8 @@ public:
static PALETTE_INIT( royalmah )
{
offs_t i;
- const UINT8 *prom = machine->region("proms")->base();
- int len = machine->region("proms")->bytes();
+ const UINT8 *prom = machine.region("proms")->base();
+ int len = machine.region("proms")->bytes();
for (i = 0; i < len; i++)
{
@@ -163,8 +163,8 @@ static PALETTE_INIT( royalmah )
static PALETTE_INIT( mjderngr )
{
offs_t i;
- const UINT8 *prom = machine->region("proms")->base();
- int len = machine->region("proms")->bytes();
+ const UINT8 *prom = machine.region("proms")->base();
+ int len = machine.region("proms")->bytes();
for (i = 0; i < len / 2; i++)
{
@@ -182,9 +182,9 @@ static PALETTE_INIT( mjderngr )
static WRITE8_HANDLER( royalmah_palbank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
/* bit 1 = coin counter */
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
/* bit 2 always set? */
@@ -196,7 +196,7 @@ static WRITE8_HANDLER( royalmah_palbank_w )
static WRITE8_HANDLER( mjderngr_coin_w )
{
/* bit 1 = coin counter */
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
/* bit 2 always set? */
}
@@ -204,14 +204,14 @@ static WRITE8_HANDLER( mjderngr_coin_w )
static WRITE8_HANDLER( mjderngr_palbank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->palette_base = data;
}
static SCREEN_UPDATE( royalmah )
{
- royalmah_state *state = screen->machine->driver_data<royalmah_state>();
+ royalmah_state *state = screen->machine().driver_data<royalmah_state>();
UINT8 *videoram = state->videoram;
offs_t offs;
@@ -254,34 +254,34 @@ static WRITE8_HANDLER( royalmah_rom_w )
static WRITE8_HANDLER( input_port_select_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->input_port_select = data;
}
static READ8_DEVICE_HANDLER( royalmah_player_1_port_r )
{
- royalmah_state *state = device->machine->driver_data<royalmah_state>();
- int ret = (input_port_read(device->machine, "KEY0") & 0xc0) | 0x3f;
+ royalmah_state *state = device->machine().driver_data<royalmah_state>();
+ int ret = (input_port_read(device->machine(), "KEY0") & 0xc0) | 0x3f;
- if ((state->input_port_select & 0x01) == 0) ret &= input_port_read(device->machine, "KEY0");
- if ((state->input_port_select & 0x02) == 0) ret &= input_port_read(device->machine, "KEY1");
- if ((state->input_port_select & 0x04) == 0) ret &= input_port_read(device->machine, "KEY2");
- if ((state->input_port_select & 0x08) == 0) ret &= input_port_read(device->machine, "KEY3");
- if ((state->input_port_select & 0x10) == 0) ret &= input_port_read(device->machine, "KEY4");
+ if ((state->input_port_select & 0x01) == 0) ret &= input_port_read(device->machine(), "KEY0");
+ if ((state->input_port_select & 0x02) == 0) ret &= input_port_read(device->machine(), "KEY1");
+ if ((state->input_port_select & 0x04) == 0) ret &= input_port_read(device->machine(), "KEY2");
+ if ((state->input_port_select & 0x08) == 0) ret &= input_port_read(device->machine(), "KEY3");
+ if ((state->input_port_select & 0x10) == 0) ret &= input_port_read(device->machine(), "KEY4");
return ret;
}
static READ8_DEVICE_HANDLER( royalmah_player_2_port_r )
{
- royalmah_state *state = device->machine->driver_data<royalmah_state>();
- int ret = (input_port_read(device->machine, "KEY5") & 0xc0) | 0x3f;
+ royalmah_state *state = device->machine().driver_data<royalmah_state>();
+ int ret = (input_port_read(device->machine(), "KEY5") & 0xc0) | 0x3f;
- if ((state->input_port_select & 0x01) == 0) ret &= input_port_read(device->machine, "KEY5");
- if ((state->input_port_select & 0x02) == 0) ret &= input_port_read(device->machine, "KEY6");
- if ((state->input_port_select & 0x04) == 0) ret &= input_port_read(device->machine, "KEY7");
- if ((state->input_port_select & 0x08) == 0) ret &= input_port_read(device->machine, "KEY8");
- if ((state->input_port_select & 0x10) == 0) ret &= input_port_read(device->machine, "KEY9");
+ if ((state->input_port_select & 0x01) == 0) ret &= input_port_read(device->machine(), "KEY5");
+ if ((state->input_port_select & 0x02) == 0) ret &= input_port_read(device->machine(), "KEY6");
+ if ((state->input_port_select & 0x04) == 0) ret &= input_port_read(device->machine(), "KEY7");
+ if ((state->input_port_select & 0x08) == 0) ret &= input_port_read(device->machine(), "KEY8");
+ if ((state->input_port_select & 0x10) == 0) ret &= input_port_read(device->machine(), "KEY9");
return ret;
}
@@ -290,12 +290,12 @@ static READ8_DEVICE_HANDLER( royalmah_player_2_port_r )
static READ8_HANDLER ( majs101b_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
switch (state->dsw_select)
{
- case 0x00: return input_port_read(space->machine, "DSW3"); /* DSW3 */
- case 0x20: return input_port_read(space->machine, "DSW4"); /* DSW4 */
- case 0x40: return input_port_read(space->machine, "DSW2"); /* DSW2 */
+ case 0x00: return input_port_read(space->machine(), "DSW3"); /* DSW3 */
+ case 0x20: return input_port_read(space->machine(), "DSW4"); /* DSW4 */
+ case 0x40: return input_port_read(space->machine(), "DSW2"); /* DSW2 */
}
return 0;
}
@@ -304,7 +304,7 @@ static READ8_HANDLER ( majs101b_dsw_r )
static READ8_HANDLER ( suzume_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
if (state->suzume_bank & 0x40)
{
return state->suzume_bank;
@@ -313,9 +313,9 @@ static READ8_HANDLER ( suzume_dsw_r )
{
switch (state->suzume_bank)
{
- case 0x08: return input_port_read(space->machine, "DSW4"); /* DSW4 */
- case 0x10: return input_port_read(space->machine, "DSW3"); /* DSW3 */
- case 0x18: return input_port_read(space->machine, "DSW2"); /* DSW2 */
+ case 0x08: return input_port_read(space->machine(), "DSW4"); /* DSW4 */
+ case 0x10: return input_port_read(space->machine(), "DSW3"); /* DSW3 */
+ case 0x18: return input_port_read(space->machine(), "DSW2"); /* DSW2 */
}
return 0;
}
@@ -323,8 +323,8 @@ static READ8_HANDLER ( suzume_dsw_r )
static WRITE8_HANDLER ( suzume_bank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int address;
state->suzume_bank = data;
@@ -334,37 +334,37 @@ logerror("%04x: bank %02x\n",cpu_get_pc(space->cpu),data);
/* bits 6, 4 and 3 used for something input related? */
address = 0x10000 + (data & 0x07) * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&rom[address]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[address]);
}
static WRITE8_HANDLER ( mjapinky_bank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
state->rombank = data;
- memory_set_bankptr(space->machine, "bank1",ROM + 0x10000 + 0x8000 * data);
+ memory_set_bankptr(space->machine(), "bank1",ROM + 0x10000 + 0x8000 * data);
}
static WRITE8_HANDLER( mjapinky_palbank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- flip_screen_set(space->machine, ~data & 4);
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ flip_screen_set(space->machine(), ~data & 4);
state->palette_base = (data >> 3) & 0x01;
- coin_counter_w(space->machine, 0,data & 2); // in
- coin_counter_w(space->machine, 1,data & 1); // out
+ coin_counter_w(space->machine(), 0,data & 2); // in
+ coin_counter_w(space->machine(), 1,data & 1); // out
}
static READ8_HANDLER( mjapinky_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- if (state->rombank == 0x0e) return input_port_read(space->machine, "DSW3");
- else return *(space->machine->region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank);
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ if (state->rombank == 0x0e) return input_port_read(space->machine(), "DSW3");
+ else return *(space->machine().region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank);
}
static WRITE8_HANDLER ( tontonb_bank_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int address;
logerror("%04x: bank %02x\n",cpu_get_pc(space->cpu),data);
@@ -375,15 +375,15 @@ logerror("%04x: bank %02x\n",cpu_get_pc(space->cpu),data);
address = 0x10000 + data * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&rom[address]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[address]);
}
/* bits 5 and 6 seem to affect which Dip Switch to read in 'majs101b' */
static WRITE8_HANDLER ( dynax_bank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int address;
//logerror("%04x: bank %02x\n",cpu_get_pc(space->cpu),data);
@@ -394,18 +394,18 @@ static WRITE8_HANDLER ( dynax_bank_w )
address = 0x10000 + data * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&rom[address]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[address]);
}
static READ8_HANDLER ( daisyari_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
switch (state->dsw_select)
{
- case 0x00: return input_port_read(space->machine, "DSW4");
- case 0x04: return input_port_read(space->machine, "DSW1");
- case 0x08: return input_port_read(space->machine, "DSW2");
- case 0x0c: return input_port_read(space->machine, "DSW3");
+ case 0x00: return input_port_read(space->machine(), "DSW4");
+ case 0x04: return input_port_read(space->machine(), "DSW1");
+ case 0x08: return input_port_read(space->machine(), "DSW2");
+ case 0x0c: return input_port_read(space->machine(), "DSW3");
}
return 0;
@@ -413,8 +413,8 @@ static READ8_HANDLER ( daisyari_dsw_r )
static WRITE8_HANDLER ( daisyari_bank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int address;
state->dsw_select = (data & 0xc);
@@ -422,20 +422,20 @@ static WRITE8_HANDLER ( daisyari_bank_w )
address = 0x10000 + ((data & 0x30)>>4) * 0x10000 + (data & 0x1) * 0x8000;
// printf("%08x %02x\n",address,data);
- memory_set_bankptr(space->machine, "bank1",&rom[address]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[address]);
/* bit 1 used too but unknown purpose. */
}
static READ8_HANDLER ( mjclub_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
switch (state->dsw_select)
{
-// case 0x00: return input_port_read(space->machine, "DSW4");
- case 0x40: return input_port_read(space->machine, "DSW2");
- case 0x80: return input_port_read(space->machine, "DSW3");
- case 0xc0: return input_port_read(space->machine, "DSW4");
+// case 0x00: return input_port_read(space->machine(), "DSW4");
+ case 0x40: return input_port_read(space->machine(), "DSW2");
+ case 0x80: return input_port_read(space->machine(), "DSW3");
+ case 0xc0: return input_port_read(space->machine(), "DSW4");
}
return 0;
@@ -443,8 +443,8 @@ static READ8_HANDLER ( mjclub_dsw_r )
static WRITE8_HANDLER ( mjclub_bank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int address;
state->dsw_select = data & 0xc0;
@@ -454,7 +454,7 @@ static WRITE8_HANDLER ( mjclub_bank_w )
address = 0x10000 + data * 0x8000;
// printf("%08x\n",address);
- memory_set_bankptr(space->machine, "bank1",&rom[address]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[address]);
/* bit 5 used too but unknown purpose. */
}
@@ -633,18 +633,18 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( jansou_dsw_sel_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->dsw_select = data;
}
static READ8_HANDLER( jansou_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
switch (state->dsw_select & 7)
{
- case 1: return input_port_read(space->machine, "DSW1");
- case 2: return input_port_read(space->machine, "DSW2");
- case 4: return input_port_read(space->machine, "DSW3");
+ case 1: return input_port_read(space->machine(), "DSW1");
+ case 2: return input_port_read(space->machine(), "DSW2");
+ case 4: return input_port_read(space->machine(), "DSW3");
}
return 0xff;
@@ -652,35 +652,35 @@ static READ8_HANDLER( jansou_dsw_r )
static WRITE8_HANDLER( jansou_colortable_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->jansou_colortable[offset] = data;
}
static WRITE8_HANDLER( jansou_6400_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->gfx_adr_l = data;
state->gfx_adr = state->gfx_adr_h*0x10000 + state->gfx_adr_m*0x100 + state->gfx_adr_l;
}
static WRITE8_HANDLER( jansou_6401_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->gfx_adr_m = data;
state->gfx_adr = state->gfx_adr_h*0x10000 + state->gfx_adr_m*0x100 + state->gfx_adr_l;
}
static WRITE8_HANDLER( jansou_6402_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->gfx_adr_h = data & 1;
state->gfx_adr = state->gfx_adr_h*0x10000 + state->gfx_adr_m*0x100 + state->gfx_adr_l;
}
static READ8_HANDLER( jansou_6403_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- UINT8 *GFXROM = space->machine->region("gfx1")->base();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ UINT8 *GFXROM = space->machine().region("gfx1")->base();
int d0 = GFXROM[state->gfx_adr];
int d1 = GFXROM[state->gfx_adr+1];
int c0 = state->jansou_colortable[d1 & 0x0f] & 0x0f;
@@ -700,20 +700,20 @@ static READ8_HANDLER( jansou_6403_r )
static READ8_HANDLER( jansou_6404_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
return state->gfxdata0;
}
static READ8_HANDLER( jansou_6405_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
return state->gfxdata1;
}
static WRITE8_HANDLER( jansou_sound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -761,7 +761,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( janptr96_dswsel_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
// 0x20 = 0 -> hopper on
// 0x40 ?
state->dsw_select = data;
@@ -769,31 +769,31 @@ static WRITE8_HANDLER( janptr96_dswsel_w )
static READ8_HANDLER( janptr96_dswsel_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
return state->dsw_select;
}
static READ8_HANDLER( janptr96_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- if (~state->dsw_select & 0x01) return input_port_read(space->machine, "DSW4");
- if (~state->dsw_select & 0x02) return input_port_read(space->machine, "DSW3");
- if (~state->dsw_select & 0x04) return input_port_read(space->machine, "DSW2");
- if (~state->dsw_select & 0x08) return input_port_read(space->machine, "DSW1");
- if (~state->dsw_select & 0x10) return input_port_read(space->machine, "DSWTOP");
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ if (~state->dsw_select & 0x01) return input_port_read(space->machine(), "DSW4");
+ if (~state->dsw_select & 0x02) return input_port_read(space->machine(), "DSW3");
+ if (~state->dsw_select & 0x04) return input_port_read(space->machine(), "DSW2");
+ if (~state->dsw_select & 0x08) return input_port_read(space->machine(), "DSW1");
+ if (~state->dsw_select & 0x10) return input_port_read(space->machine(), "DSWTOP");
return 0xff;
}
static WRITE8_HANDLER( janptr96_rombank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",ROM + 0x10000 + 0x8000 * data);
+ UINT8 *ROM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1",ROM + 0x10000 + 0x8000 * data);
}
static WRITE8_HANDLER( janptr96_rambank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
- memory_set_bankptr(space->machine, "bank2", state->janptr96_nvram + 0x1000 + 0x1000 * data);
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
+ memory_set_bankptr(space->machine(), "bank2", state->janptr96_nvram + 0x1000 + 0x1000 * data);
}
static READ8_HANDLER( janptr96_unknown_r )
@@ -804,9 +804,9 @@ static READ8_HANDLER( janptr96_unknown_r )
static WRITE8_HANDLER( janptr96_coin_counter_w )
{
- flip_screen_set(space->machine, ~data & 4);
- coin_counter_w(space->machine, 0,data & 2); // in
- coin_counter_w(space->machine, 1,data & 1); // out
+ flip_screen_set(space->machine(), ~data & 4);
+ coin_counter_w(space->machine(), 0,data & 2); // in
+ coin_counter_w(space->machine(), 1,data & 1); // out
}
static ADDRESS_MAP_START( janptr96_iomap, AS_IO, 8 )
@@ -831,25 +831,25 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjifb_coin_counter_w )
{
- flip_screen_set(space->machine, data & 4);
- coin_counter_w(space->machine, 0,data & 2); // in
- coin_counter_w(space->machine, 1,data & 1); // out
+ flip_screen_set(space->machine(), data & 4);
+ coin_counter_w(space->machine(), 0,data & 2); // in
+ coin_counter_w(space->machine(), 1,data & 1); // out
}
static READ8_HANDLER( mjifb_rom_io_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
if (state->mjifb_rom_enable)
- return ((UINT8*)(space->machine->region("maincpu")->base() + 0x10000 + state->rombank * 0x4000))[offset];
+ return ((UINT8*)(space->machine().region("maincpu")->base() + 0x10000 + state->rombank * 0x4000))[offset];
offset += 0x8000;
switch(offset)
{
- case 0x8000: return input_port_read(space->machine, "DSW4"); // dsw 4
- case 0x8200: return input_port_read(space->machine, "DSW3"); // dsw 3
- case 0x9001: return ay8910_r(space->machine->device("aysnd"), 0); // inputs
- case 0x9011: return input_port_read(space->machine, "SYSTEM");
+ case 0x8000: return input_port_read(space->machine(), "DSW4"); // dsw 4
+ case 0x8200: return input_port_read(space->machine(), "DSW3"); // dsw 3
+ case 0x9001: return ay8910_r(space->machine().device("aysnd"), 0); // inputs
+ case 0x9011: return input_port_read(space->machine(), "SYSTEM");
}
logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(space->cpu), offset);
@@ -858,7 +858,7 @@ static READ8_HANDLER( mjifb_rom_io_r )
static WRITE8_HANDLER( mjifb_rom_io_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
UINT8 *videoram = state->videoram;
if (state->mjifb_rom_enable)
{
@@ -871,8 +871,8 @@ static WRITE8_HANDLER( mjifb_rom_io_w )
switch(offset)
{
case 0x8e00: state->palette_base = data & 0x1f; return;
- case 0x9002: ay8910_data_w(space->machine->device("aysnd"),0,data); return;
- case 0x9003: ay8910_address_w(space->machine->device("aysnd"),0,data); return;
+ case 0x9002: ay8910_data_w(space->machine().device("aysnd"),0,data); return;
+ case 0x9003: ay8910_address_w(space->machine().device("aysnd"),0,data); return;
case 0x9010:
mjifb_coin_counter_w(space,0,data);
return;
@@ -887,7 +887,7 @@ static WRITE8_HANDLER( mjifb_rom_io_w )
static WRITE8_HANDLER( mjifb_videoram_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
UINT8 *videoram = state->videoram;
videoram[offset + 0x4000] = data;
}
@@ -902,19 +902,19 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjifb_p3_r )
{
- return input_port_read(space->machine, "PORT3_5") >> 6;
+ return input_port_read(space->machine(), "PORT3_5") >> 6;
}
static READ8_HANDLER( mjifb_p5_r )
{
- return input_port_read(space->machine, "PORT3_5");
+ return input_port_read(space->machine(), "PORT3_5");
}
static READ8_HANDLER( mjifb_p6_r )
{
- return input_port_read(space->machine, "PORT6_7");
+ return input_port_read(space->machine(), "PORT6_7");
}
static READ8_HANDLER( mjifb_p7_r )
{
- return input_port_read(space->machine, "PORT6_7") >> 4;
+ return input_port_read(space->machine(), "PORT6_7") >> 4;
}
static READ8_HANDLER( mjifb_p8_r )
{
@@ -923,17 +923,17 @@ static READ8_HANDLER( mjifb_p8_r )
static WRITE8_HANDLER( mjifb_p3_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0x0f) | ((data & 0x0c) << 2);
}
static WRITE8_HANDLER( mjifb_p4_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0xf0) | (data & 0x0f);
}
static WRITE8_HANDLER( mjifb_p8_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->mjifb_rom_enable = (data & 0x08);
}
@@ -953,18 +953,18 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjdejavu_rom_io_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
if (state->mjifb_rom_enable)
- return ((UINT8*)(space->machine->region("maincpu")->base() + 0x10000 + state->rombank * 0x4000))[offset];
+ return ((UINT8*)(space->machine().region("maincpu")->base() + 0x10000 + state->rombank * 0x4000))[offset];
offset += 0x8000;
switch(offset)
{
- case 0x8000: return input_port_read(space->machine, "DSW2"); // dsw 2
- case 0x8001: return input_port_read(space->machine, "DSW1"); // dsw 1
- case 0x9001: return ay8910_r(space->machine->device("aysnd"), 0); // inputs
- case 0x9011: return input_port_read(space->machine, "SYSTEM");
+ case 0x8000: return input_port_read(space->machine(), "DSW2"); // dsw 2
+ case 0x8001: return input_port_read(space->machine(), "DSW1"); // dsw 1
+ case 0x9001: return ay8910_r(space->machine().device("aysnd"), 0); // inputs
+ case 0x9011: return input_port_read(space->machine(), "SYSTEM");
}
logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(space->cpu), offset);
@@ -973,7 +973,7 @@ static READ8_HANDLER( mjdejavu_rom_io_r )
static WRITE8_HANDLER( mjdejavu_rom_io_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
UINT8 *videoram = state->videoram;
if (state->mjifb_rom_enable)
{
@@ -985,8 +985,8 @@ static WRITE8_HANDLER( mjdejavu_rom_io_w )
switch(offset)
{
case 0x8802: state->palette_base = data & 0x1f; return;
- case 0x9002: ay8910_data_w(space->machine->device("aysnd"),0,data); return;
- case 0x9003: ay8910_address_w(space->machine->device("aysnd"),0,data); return;
+ case 0x9002: ay8910_data_w(space->machine().device("aysnd"),0,data); return;
+ case 0x9003: ay8910_address_w(space->machine().device("aysnd"),0,data); return;
case 0x9010: mjifb_coin_counter_w(space,0,data); return;
case 0x9011: input_port_select_w(space,0,data); return;
case 0x9013:
@@ -1014,22 +1014,22 @@ static READ8_HANDLER( mjtensin_p3_r )
return 0xff;
}
-static void mjtensin_update_rombank(running_machine *machine)
+static void mjtensin_update_rombank(running_machine &machine)
{
- royalmah_state *state = machine->driver_data<royalmah_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000 + state->rombank * 0x8000 );
+ royalmah_state *state = machine.driver_data<royalmah_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000 + state->rombank * 0x8000 );
}
static WRITE8_HANDLER( mjtensin_p4_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0xf0) | (data & 0x0f);
- mjtensin_update_rombank(space->machine);
+ mjtensin_update_rombank(space->machine());
}
static WRITE8_HANDLER( mjtensin_6ff3_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (data << 4) | (state->rombank & 0x0f);
- mjtensin_update_rombank(space->machine);
+ mjtensin_update_rombank(space->machine());
}
static ADDRESS_MAP_START( mjtensin_map, AS_PROGRAM, 8 )
@@ -1058,39 +1058,39 @@ ADDRESS_MAP_END
Mahjong Cafe Time
****************************************************************************/
-static void cafetime_update_rombank(running_machine *machine)
+static void cafetime_update_rombank(running_machine &machine)
{
- royalmah_state *state = machine->driver_data<royalmah_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000 + state->rombank * 0x8000 );
+ royalmah_state *state = machine.driver_data<royalmah_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000 + state->rombank * 0x8000 );
}
static WRITE8_HANDLER( cafetime_p4_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0xf0) | (data & 0x0f);
- cafetime_update_rombank(space->machine);
+ cafetime_update_rombank(space->machine());
}
static WRITE8_HANDLER( cafetime_p3_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0x0f) | ((data & 0x0c) << 2);
- cafetime_update_rombank(space->machine);
+ cafetime_update_rombank(space->machine());
}
static WRITE8_HANDLER( cafetime_dsw_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->dsw_select = data;
}
static READ8_HANDLER( cafetime_dsw_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
switch( state->dsw_select )
{
- case 0x00: return input_port_read(space->machine, "DSW1");
- case 0x01: return input_port_read(space->machine, "DSW2");
- case 0x02: return input_port_read(space->machine, "DSW3");
- case 0x03: return input_port_read(space->machine, "DSW4");
- case 0x04: return input_port_read(space->machine, "DSWTOP");
+ case 0x00: return input_port_read(space->machine(), "DSW1");
+ case 0x01: return input_port_read(space->machine(), "DSW2");
+ case 0x02: return input_port_read(space->machine(), "DSW3");
+ case 0x03: return input_port_read(space->machine(), "DSW4");
+ case 0x04: return input_port_read(space->machine(), "DSWTOP");
}
logerror("%04X: unmapped dsw read %02X\n", cpu_get_pc(space->cpu), state->dsw_select);
return 0xff;
@@ -1136,25 +1136,25 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjvegasa_p4_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0xf8) | ((data & 0x0e) >> 1);
}
static WRITE8_HANDLER( mjvegasa_p3_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0xf7) | ((data & 0x04) << 1);
}
static WRITE8_HANDLER( mjvegasa_rombank_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
state->rombank = (state->rombank & 0x0f) | ((data & 0x0f) << 4);
}
static READ8_HANDLER( mjvegasa_rom_io_r )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
if ((state->rombank & 0x70) != 0x70)
- return space->machine->region("maincpu")->base()[0x10000 + state->rombank * 0x8000 + offset];
+ return space->machine().region("maincpu")->base()[0x10000 + state->rombank * 0x8000 + offset];
offset += 0x8000;
@@ -1177,7 +1177,7 @@ static READ8_HANDLER( mjvegasa_rom_io_r )
case 0x800e:
case 0x800f:
{
- device_t *rtc = space->machine->device("rtc");
+ device_t *rtc = space->machine().device("rtc");
return msm6242_r(rtc, offset-0x8000);
}
}
@@ -1187,7 +1187,7 @@ static READ8_HANDLER( mjvegasa_rom_io_r )
static WRITE8_HANDLER( mjvegasa_rom_io_w )
{
- royalmah_state *state = space->machine->driver_data<royalmah_state>();
+ royalmah_state *state = space->machine().driver_data<royalmah_state>();
UINT8 *videoram = state->videoram;
if ((state->rombank & 0x70) != 0x70)
{
@@ -1216,7 +1216,7 @@ static WRITE8_HANDLER( mjvegasa_rom_io_w )
case 0x800e:
case 0x800f:
{
- device_t *rtc = space->machine->device("rtc");
+ device_t *rtc = space->machine().device("rtc");
msm6242_w(rtc, offset-0x8000, data);
return;
}
@@ -1226,9 +1226,9 @@ static WRITE8_HANDLER( mjvegasa_rom_io_w )
static WRITE8_HANDLER( mjvegasa_coin_counter_w )
{
- flip_screen_set(space->machine, data & 4);
- coin_counter_w(space->machine, 0,data & 2); // in
- coin_counter_w(space->machine, 1,data & 1); // out
+ flip_screen_set(space->machine(), data & 4);
+ coin_counter_w(space->machine(), 0,data & 2); // in
+ coin_counter_w(space->machine(), 1,data & 1); // out
}
// hopper?
@@ -3254,7 +3254,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( suzume_irq )
{
- royalmah_state *state = device->machine->driver_data<royalmah_state>();
+ royalmah_state *state = device->machine().driver_data<royalmah_state>();
if ( state->suzume_bank & 0x40 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -4693,14 +4693,14 @@ ROM_START( jansoua )
ROM_END
-static DRIVER_INIT( ippatsu ) { memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x8000 ); }
+static DRIVER_INIT( ippatsu ) { memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x8000 ); }
static DRIVER_INIT( janptr96 )
{
- royalmah_state *state = machine->driver_data<royalmah_state>();
+ royalmah_state *state = machine.driver_data<royalmah_state>();
state->janptr96_nvram = auto_alloc_array(machine, UINT8, 0x1000 * 9);
memory_set_bankptr(machine, "bank3", state->janptr96_nvram);
- machine->device<nvram_device>("nvram")->set_base(state->janptr96_nvram, 0x1000 * 9);
+ machine.device<nvram_device>("nvram")->set_base(state->janptr96_nvram, 0x1000 * 9);
}
GAME( 1981, royalmj, 0, royalmah, royalmah, 0, ROT0, "Nichibutsu", "Royal Mahjong (Japan, v1.13)", 0 )
diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c
index d93362fc3fa..f74ab4adc8d 100644
--- a/src/mame/drivers/rpunch.c
+++ b/src/mame/drivers/rpunch.c
@@ -124,15 +124,15 @@
static void ym2151_irq_gen(device_t *device, int state)
{
- rpunch_state *drvstate = device->machine->driver_data<rpunch_state>();
+ rpunch_state *drvstate = device->machine().driver_data<rpunch_state>();
drvstate->ym2151_irq = state;
- cputag_set_input_line(device->machine, "audiocpu", 0, (drvstate->ym2151_irq | drvstate->sound_busy) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (drvstate->ym2151_irq | drvstate->sound_busy) ? ASSERT_LINE : CLEAR_LINE);
}
static MACHINE_RESET( rpunch )
{
- UINT8 *snd = machine->region("upd")->base();
+ UINT8 *snd = machine.region("upd")->base();
memcpy(snd, snd + 0x20000, 0x20000);
}
@@ -146,7 +146,7 @@ static MACHINE_RESET( rpunch )
static CUSTOM_INPUT( hi_bits_r )
{
- return input_port_read(field->port->machine, "SERVICE");
+ return input_port_read(field->port->machine(), "SERVICE");
}
@@ -158,7 +158,7 @@ static CUSTOM_INPUT( hi_bits_r )
static TIMER_CALLBACK( sound_command_w_callback )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
state->sound_busy = 1;
state->sound_data = param;
cputag_set_input_line(machine, "audiocpu", 0, (state->ym2151_irq | state->sound_busy) ? ASSERT_LINE : CLEAR_LINE);
@@ -168,22 +168,22 @@ static TIMER_CALLBACK( sound_command_w_callback )
static WRITE16_HANDLER( sound_command_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(sound_command_w_callback), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(sound_command_w_callback), data & 0xff);
}
static READ8_HANDLER( sound_command_r )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
state->sound_busy = 0;
- cputag_set_input_line(space->machine, "audiocpu", 0, (state->ym2151_irq | state->sound_busy) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (state->ym2151_irq | state->sound_busy) ? ASSERT_LINE : CLEAR_LINE);
return state->sound_data;
}
static READ16_HANDLER( sound_busy_r )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
return state->sound_busy;
}
@@ -197,10 +197,10 @@ static READ16_HANDLER( sound_busy_r )
static WRITE8_DEVICE_HANDLER( upd_control_w )
{
- rpunch_state *state = device->machine->driver_data<rpunch_state>();
+ rpunch_state *state = device->machine().driver_data<rpunch_state>();
if ((data & 1) != state->upd_rom_bank)
{
- UINT8 *snd = device->machine->region("upd")->base();
+ UINT8 *snd = device->machine().region("upd")->base();
state->upd_rom_bank = data & 1;
memcpy(snd, snd + 0x20000 * (state->upd_rom_bank + 1), 0x20000);
}
@@ -697,14 +697,14 @@ ROM_END
static DRIVER_INIT( rabiolep )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
state->sprite_palette = 0x300;
}
static DRIVER_INIT( svolley )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
/* the main differences between Super Volleyball and Rabbit Punch are */
/* the lack of direct-mapped bitmap and a different palette base for sprites */
state->sprite_palette = 0x080;
diff --git a/src/mame/drivers/runaway.c b/src/mame/drivers/runaway.c
index fac9970254b..20fc6590955 100644
--- a/src/mame/drivers/runaway.c
+++ b/src/mame/drivers/runaway.c
@@ -19,7 +19,7 @@
static TIMER_CALLBACK( interrupt_callback )
{
- runaway_state *state = machine->driver_data<runaway_state>();
+ runaway_state *state = machine.driver_data<runaway_state>();
/* assume Centipede-style interrupt timing */
int scanline = param;
@@ -30,19 +30,19 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 263)
scanline = 16;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( runaway )
{
- runaway_state *state = machine->driver_data<runaway_state>();
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ runaway_state *state = machine.driver_data<runaway_state>();
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
}
static MACHINE_RESET( runaway )
{
- runaway_state *state = machine->driver_data<runaway_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(16), 16);
+ runaway_state *state = machine.driver_data<runaway_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(16), 16);
}
@@ -50,11 +50,11 @@ static READ8_HANDLER( runaway_input_r )
{
UINT8 val = 0;
- if (input_port_read(space->machine, "3000D7") & (1 << offset))
+ if (input_port_read(space->machine(), "3000D7") & (1 << offset))
{
val |= 0x80;
}
- if (input_port_read(space->machine, "3000D6") & (1 << offset))
+ if (input_port_read(space->machine(), "3000D6") & (1 << offset))
{
val |= 0x40;
}
@@ -65,19 +65,19 @@ static READ8_HANDLER( runaway_input_r )
static READ8_DEVICE_HANDLER( runaway_pot_r )
{
- return (input_port_read(device->machine, "7000") << (7 - offset)) & 0x80;
+ return (input_port_read(device->machine(), "7000") << (7 - offset)) & 0x80;
}
static WRITE8_HANDLER( runaway_led_w )
{
- set_led_status(space->machine, offset, ~data & 1);
+ set_led_status(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( runaway_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index b4637119270..d0358978838 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -66,26 +66,26 @@ static const eeprom_interface eeprom_intf =
static READ16_HANDLER( rng_sysregs_r )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
UINT16 data = 0;
switch (offset)
{
case 0x00/2:
- if (input_port_read(space->machine, "DSW") & 0x20)
- return (input_port_read(space->machine, "P1") | input_port_read(space->machine, "P3") << 8);
+ if (input_port_read(space->machine(), "DSW") & 0x20)
+ return (input_port_read(space->machine(), "P1") | input_port_read(space->machine(), "P3") << 8);
else
{
- data = input_port_read(space->machine, "P1") & input_port_read(space->machine, "P3");
+ data = input_port_read(space->machine(), "P1") & input_port_read(space->machine(), "P3");
return (data << 8 | data);
}
case 0x02/2:
- if (input_port_read(space->machine, "DSW") & 0x20)
- return (input_port_read(space->machine, "P2") | input_port_read(space->machine, "P4") << 8);
+ if (input_port_read(space->machine(), "DSW") & 0x20)
+ return (input_port_read(space->machine(), "P2") | input_port_read(space->machine(), "P4") << 8);
else
{
- data = input_port_read(space->machine, "P2") & input_port_read(space->machine, "P4");
+ data = input_port_read(space->machine(), "P2") & input_port_read(space->machine(), "P4");
return (data << 8 | data);
}
@@ -95,12 +95,12 @@ static READ16_HANDLER( rng_sysregs_r )
bit8 : freeze
bit9 : joysticks layout(auto detect???)
*/
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x06/2:
if (ACCESSING_BITS_0_7)
{
- data = input_port_read(space->machine, "DSW");
+ data = input_port_read(space->machine(), "DSW");
}
return ((state->sysreg[0x06 / 2] & 0xff00) | data);
}
@@ -110,7 +110,7 @@ static READ16_HANDLER( rng_sysregs_r )
static WRITE16_HANDLER( rng_sysregs_w )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
COMBINE_DATA(state->sysreg + offset);
@@ -126,7 +126,7 @@ static WRITE16_HANDLER( rng_sysregs_w )
bit10 : IRQ5 ACK
*/
if (ACCESSING_BITS_0_7)
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
if (!(data & 0x40))
device_set_input_line(state->maincpu, M68K_IRQ_5, CLEAR_LINE);
@@ -158,7 +158,7 @@ static WRITE16_HANDLER( sound_cmd2_w )
static WRITE16_HANDLER( sound_irq_w )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
if (ACCESSING_BITS_8_15)
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
@@ -166,7 +166,7 @@ static WRITE16_HANDLER( sound_irq_w )
static READ16_HANDLER( sound_status_msb_r )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
if (ACCESSING_BITS_8_15)
return(state->sound_status << 8);
@@ -176,7 +176,7 @@ static READ16_HANDLER( sound_status_msb_r )
static INTERRUPT_GEN(rng_interrupt)
{
- rungun_state *state = device->machine->driver_data<rungun_state>();
+ rungun_state *state = device->machine().driver_data<rungun_state>();
if (state->sysreg[0x0c / 2] & 0x09)
device_set_input_line(device, M68K_IRQ_5, ASSERT_LINE);
@@ -215,17 +215,17 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sound_status_w )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
state->sound_status = data;
}
static WRITE8_HANDLER( z80ctrl_w )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
state->z80_control = data;
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
if (data & 0x10)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( z80ctrl_w )
static INTERRUPT_GEN(audio_interrupt)
{
- rungun_state *state = device->machine->driver_data<rungun_state>();
+ rungun_state *state = device->machine().driver_data<rungun_state>();
if (state->z80_control & 0x80)
return;
@@ -361,18 +361,18 @@ static const k053247_interface rng_k055673_intf =
static MACHINE_START( rng )
{
- rungun_state *state = machine->driver_data<rungun_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ rungun_state *state = machine.driver_data<rungun_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->k053936 = machine->device("k053936");
- state->k055673 = machine->device("k055673");
- state->k053252 = machine->device("k053252");
- state->k054539_1 = machine->device("k054539_1");
- state->k054539_2 = machine->device("k054539_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->k053936 = machine.device("k053936");
+ state->k055673 = machine.device("k055673");
+ state->k053252 = machine.device("k053252");
+ state->k054539_1 = machine.device("k054539_1");
+ state->k054539_2 = machine.device("k054539_2");
state->save_item(NAME(state->z80_control));
state->save_item(NAME(state->sound_status));
@@ -382,9 +382,9 @@ static MACHINE_START( rng )
static MACHINE_RESET( rng )
{
- rungun_state *state = machine->driver_data<rungun_state>();
+ rungun_state *state = machine.driver_data<rungun_state>();
- k054539_init_flags(machine->device("k054539_1"), K054539_REVERSE_STEREO);
+ k054539_init_flags(machine.device("k054539_1"), K054539_REVERSE_STEREO);
memset(state->sysreg, 0, 0x20);
memset(state->ttl_vram, 0, 0x1000);
diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c
index b547c762ca8..b1a894a6b21 100644
--- a/src/mame/drivers/safarir.c
+++ b/src/mame/drivers/safarir.c
@@ -77,7 +77,7 @@ public:
static WRITE8_HANDLER( ram_w )
{
- safarir_state *state = space->machine->driver_data<safarir_state>();
+ safarir_state *state = space->machine().driver_data<safarir_state>();
if (state->ram_bank)
state->ram_2[offset] = data;
@@ -90,7 +90,7 @@ static WRITE8_HANDLER( ram_w )
static READ8_HANDLER( ram_r )
{
- safarir_state *state = space->machine->driver_data<safarir_state>();
+ safarir_state *state = space->machine().driver_data<safarir_state>();
return state->ram_bank ? state->ram_2[offset] : state->ram_1[offset];
}
@@ -98,11 +98,11 @@ static READ8_HANDLER( ram_r )
static WRITE8_HANDLER( ram_bank_w )
{
- safarir_state *state = space->machine->driver_data<safarir_state>();
+ safarir_state *state = space->machine().driver_data<safarir_state>();
state->ram_bank = data & 0x01;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
@@ -135,7 +135,7 @@ static PALETTE_INIT( safarir )
{
int i;
- for (i = 0; i < machine->total_colors() / 2; i++)
+ for (i = 0; i < machine.total_colors() / 2; i++)
{
palette_set_color(machine, (i * 2) + 0, RGB_BLACK);
palette_set_color(machine, (i * 2) + 1, MAKE_RGB(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)));
@@ -145,7 +145,7 @@ static PALETTE_INIT( safarir )
static TILE_GET_INFO( get_bg_tile_info )
{
int color;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 code = ram_r(space,tile_index | 0x400);
if (code & 0x80)
@@ -167,7 +167,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
int color, flags;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 code = ram_r(space,tile_index);
@@ -184,7 +184,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( safarir )
{
- safarir_state *state = machine->driver_data<safarir_state>();
+ safarir_state *state = machine.driver_data<safarir_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -195,7 +195,7 @@ static VIDEO_START( safarir )
static SCREEN_UPDATE( safarir )
{
- safarir_state *state = screen->machine->driver_data<safarir_state>();
+ safarir_state *state = screen->machine().driver_data<safarir_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, *state->bg_scroll);
@@ -233,7 +233,7 @@ static SCREEN_UPDATE( safarir )
static WRITE8_HANDLER( safarir_audio_w )
{
- safarir_state *state = space->machine->driver_data<safarir_state>();
+ safarir_state *state = space->machine().driver_data<safarir_state>();
device_t *samples = state->samples;
UINT8 rising_bits = data & ~state->port_last;
@@ -312,13 +312,13 @@ MACHINE_CONFIG_END
static MACHINE_START( safarir )
{
- safarir_state *state = machine->driver_data<safarir_state>();
+ safarir_state *state = machine.driver_data<safarir_state>();
state->ram_1 = auto_alloc_array(machine, UINT8, state->ram_size);
state->ram_2 = auto_alloc_array(machine, UINT8, state->ram_size);
state->port_last = 0;
state->port_last2 = 0;
- state->samples = machine->device("samples");
+ state->samples = machine.device("samples");
/* setup for save states */
state->save_pointer(NAME(state->ram_1), state->ram_size);
diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c
index bd356055e7d..ac132b61846 100644
--- a/src/mame/drivers/sandscrp.c
+++ b/src/mame/drivers/sandscrp.c
@@ -113,9 +113,9 @@ static MACHINE_RESET( sandscrp )
/* Update the IRQ state based on all possible causes */
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- sandscrp_state *state = machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = machine.driver_data<sandscrp_state>();
if (state->vblank_irq || state->sprite_irq || state->unknown_irq)
cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE);
else
@@ -127,16 +127,16 @@ static void update_irq_state(running_machine *machine)
/* Called once/frame to generate the VBLANK interrupt */
static INTERRUPT_GEN( sandscrp_interrupt )
{
- sandscrp_state *state = device->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = device->machine().driver_data<sandscrp_state>();
state->vblank_irq = 1;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
static SCREEN_EOF( sandscrp )
{
- sandscrp_state *state = machine->driver_data<sandscrp_state>();
- device_t *pandora = machine->device("pandora");
+ sandscrp_state *state = machine.driver_data<sandscrp_state>();
+ device_t *pandora = machine.device("pandora");
state->sprite_irq = 1;
update_irq_state(machine);
pandora_eof(pandora);
@@ -145,7 +145,7 @@ static SCREEN_EOF( sandscrp )
/* Reads the cause of the interrupt */
static READ16_HANDLER( sandscrp_irq_cause_r )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
return ( state->sprite_irq ? 0x08 : 0 ) |
( state->unknown_irq ? 0x10 : 0 ) |
( state->vblank_irq ? 0x20 : 0 ) ;
@@ -155,7 +155,7 @@ static READ16_HANDLER( sandscrp_irq_cause_r )
/* Clear the cause of the interrupt */
static WRITE16_HANDLER( sandscrp_irq_cause_w )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
if (ACCESSING_BITS_0_7)
{
kaneko16_sprite_flipx = data & 1;
@@ -166,7 +166,7 @@ static WRITE16_HANDLER( sandscrp_irq_cause_w )
if (data & 0x20) state->vblank_irq = 0;
}
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
}
@@ -179,22 +179,22 @@ static WRITE16_HANDLER( sandscrp_coin_counter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0001);
- coin_counter_w(space->machine, 1, data & 0x0002);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
}
}
static READ16_HANDLER( sandscrp_latchstatus_word_r )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
return (state->latch1_full ? 0x80 : 0) |
(state->latch2_full ? 0x40 : 0) ;
}
static WRITE16_HANDLER( sandscrp_latchstatus_word_w )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
if (ACCESSING_BITS_0_7)
{
state->latch1_full = data & 0x80;
@@ -204,19 +204,19 @@ static WRITE16_HANDLER( sandscrp_latchstatus_word_w )
static READ16_HANDLER( sandscrp_soundlatch_word_r )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
state->latch2_full = 0;
return soundlatch2_r(space,0);
}
static WRITE16_HANDLER( sandscrp_soundlatch_word_w )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
if (ACCESSING_BITS_0_7)
{
state->latch1_full = 1;
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
device_spin_until_time(space->cpu, attotime::from_usec(100)); // Allow the other cpu to reply
}
}
@@ -253,7 +253,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sandscrp_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bank = data & 0x07;
if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(space->cpu),data);
@@ -261,26 +261,26 @@ static WRITE8_HANDLER( sandscrp_bankswitch_w )
if (bank < 3) RAM = &RAM[0x4000 * bank];
else RAM = &RAM[0x4000 * (bank-3) + 0x10000];
- memory_set_bankptr(space->machine, "bank1", RAM);
+ memory_set_bankptr(space->machine(), "bank1", RAM);
}
static READ8_HANDLER( sandscrp_latchstatus_r )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
return (state->latch2_full ? 0x80 : 0) | // swapped!?
(state->latch1_full ? 0x40 : 0) ;
}
static READ8_HANDLER( sandscrp_soundlatch_r )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
state->latch1_full = 0;
return soundlatch_r(space,0);
}
static WRITE8_HANDLER( sandscrp_soundlatch_w )
{
- sandscrp_state *state = space->machine->driver_data<sandscrp_state>();
+ sandscrp_state *state = space->machine().driver_data<sandscrp_state>();
state->latch2_full = 1;
soundlatch2_w(space,0,data);
}
@@ -436,7 +436,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_intf_sandscrp =
diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c
index f3cc75df236..430baecd910 100644
--- a/src/mame/drivers/sangho.c
+++ b/src/mame/drivers/sangho.c
@@ -56,9 +56,9 @@ public:
};
-static void pzlestar_map_banks(running_machine *machine)
+static void pzlestar_map_banks(running_machine &machine)
{
- sangho_state *state = machine->driver_data<sangho_state>();
+ sangho_state *state = machine.driver_data<sangho_state>();
int slot_select;
// page 0
@@ -66,20 +66,20 @@ static void pzlestar_map_banks(running_machine *machine)
switch(slot_select)
{
case 0:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0000, 0x3fff, "bank5");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x0000, 0x3fff, "bank5");
memory_set_bankptr(machine, "bank1", state->ram);
memory_set_bankptr(machine, "bank5", state->ram);
break;
case 2:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base()+ 0x10000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base()+ 0x10000);
break;
case 1:
case 3:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x0000, 0x3fff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x0000, 0x3fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x3fff);
break;
}
@@ -88,24 +88,24 @@ static void pzlestar_map_banks(running_machine *machine)
switch(slot_select)
{
case 0:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x4000, 0x7fff, "bank6");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x4000, 0x7fff, "bank6");
memory_set_bankptr(machine, "bank2", state->ram + 0x4000);
memory_set_bankptr(machine, "bank6", state->ram + 0x4000);
break;
case 2:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- memory_set_bankptr(machine, "bank2", machine->region("user1")->base()+ 0x18000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
+ memory_set_bankptr(machine, "bank2", machine.region("user1")->base()+ 0x18000);
break;
case 3:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
- memory_set_bankptr(machine, "bank2", machine->region("user1")->base()+ 0x20000 + (state->pzlestar_rom_bank*0x8000) + 0x4000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
+ memory_set_bankptr(machine, "bank2", machine.region("user1")->base()+ 0x20000 + (state->pzlestar_rom_bank*0x8000) + 0x4000);
break;
case 1:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x4000, 0x7fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x4000, 0x7fff);
break;
}
@@ -114,20 +114,20 @@ static void pzlestar_map_banks(running_machine *machine)
switch(slot_select)
{
case 0:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x8000, 0xbfff, "bank7");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x8000, 0xbfff, "bank7");
memory_set_bankptr(machine, "bank3", state->ram + 0x8000);
memory_set_bankptr(machine, "bank7", state->ram + 0x8000);
break;
case 3:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
- memory_set_bankptr(machine, "bank3", machine->region("user1")->base()+ 0x20000 + (state->pzlestar_rom_bank*0x8000));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank3");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
+ memory_set_bankptr(machine, "bank3", machine.region("user1")->base()+ 0x20000 + (state->pzlestar_rom_bank*0x8000));
break;
case 1:
case 2:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x8000, 0xbfff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0x8000, 0xbfff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x8000, 0xbfff);
break;
}
@@ -136,16 +136,16 @@ static void pzlestar_map_banks(running_machine *machine)
switch(slot_select)
{
case 0:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xffff, "bank4");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0xc000, 0xffff, "bank8");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xc000, 0xffff, "bank4");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0xc000, 0xffff, "bank8");
memory_set_bankptr(machine, "bank4", state->ram + 0xc000);
memory_set_bankptr(machine, "bank8", state->ram + 0xc000);
break;
case 1:
case 2:
case 3:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0xc000, 0xffff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_read(0xc000, 0xffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xc000, 0xffff);
break;
}
@@ -153,29 +153,29 @@ static void pzlestar_map_banks(running_machine *machine)
static WRITE8_HANDLER(pzlestar_bank_w)
{
- sangho_state *state = space->machine->driver_data<sangho_state>();
+ sangho_state *state = space->machine().driver_data<sangho_state>();
logerror("rom bank %02x\n", data);
state->pzlestar_rom_bank = data;
- pzlestar_map_banks(space->machine);
+ pzlestar_map_banks(space->machine());
}
static WRITE8_HANDLER(pzlestar_mem_bank_w)
{
- sangho_state *state = space->machine->driver_data<sangho_state>();
+ sangho_state *state = space->machine().driver_data<sangho_state>();
logerror("mem bank %02x\n", data);
state->pzlestar_mem_bank = data;
- pzlestar_map_banks(space->machine);
+ pzlestar_map_banks(space->machine());
}
static READ8_HANDLER(pzlestar_mem_bank_r)
{
- sangho_state *state = space->machine->driver_data<sangho_state>();
+ sangho_state *state = space->machine().driver_data<sangho_state>();
return state->pzlestar_mem_bank;
}
-static void sexyboom_map_bank(running_machine *machine, int bank)
+static void sexyboom_map_bank(running_machine &machine, int bank)
{
- sangho_state *state = machine->driver_data<sangho_state>();
+ sangho_state *state = machine.driver_data<sangho_state>();
UINT8 banknum, banktype;
char read_bank_name[6], write_bank_name[6];
@@ -190,25 +190,25 @@ static void sexyboom_map_bank(running_machine *machine, int bank)
{
// ram
memory_set_bankptr(machine, read_bank_name, &state->ram[(banknum & 0x7f) * 0x4000]);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(bank*0x4000, (bank+1)*0x4000 - 1, write_bank_name );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(bank*0x4000, (bank+1)*0x4000 - 1, write_bank_name );
memory_set_bankptr(machine, write_bank_name, &state->ram[(banknum & 0x7f) * 0x4000]);
}
else
{
// rom 0
- memory_set_bankptr(machine, read_bank_name, machine->region("user1")->base()+0x4000*banknum);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
+ memory_set_bankptr(machine, read_bank_name, machine.region("user1")->base()+0x4000*banknum);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
}
else if (banktype == 0x82)
{
- memory_set_bankptr(machine, read_bank_name, machine->region("user1")->base()+0x20000+banknum*0x4000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
+ memory_set_bankptr(machine, read_bank_name, machine.region("user1")->base()+0x20000+banknum*0x4000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else if (banktype == 0x80)
{
- memory_set_bankptr(machine, read_bank_name, machine->region("user1")->base()+0x120000+banknum*0x4000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
+ memory_set_bankptr(machine, read_bank_name, machine.region("user1")->base()+0x120000+banknum*0x4000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(bank*0x4000, (bank+1)*0x4000 - 1);
}
else
{
@@ -218,9 +218,9 @@ static void sexyboom_map_bank(running_machine *machine, int bank)
static WRITE8_HANDLER(sexyboom_bank_w)
{
- sangho_state *state = space->machine->driver_data<sangho_state>();
+ sangho_state *state = space->machine().driver_data<sangho_state>();
state->sexyboom_bank[offset] = data;
- sexyboom_map_bank(space->machine, offset>>1);
+ sexyboom_map_bank(space->machine(), offset>>1);
}
static ADDRESS_MAP_START( sangho_map, AS_PROGRAM, 8 )
@@ -323,7 +323,7 @@ INPUT_PORTS_END
static MACHINE_RESET(pzlestar)
{
- sangho_state *state = machine->driver_data<sangho_state>();
+ sangho_state *state = machine.driver_data<sangho_state>();
state->pzlestar_mem_bank = 2;
pzlestar_map_banks(machine);
@@ -332,7 +332,7 @@ static MACHINE_RESET(pzlestar)
static MACHINE_RESET(sexyboom)
{
- sangho_state *state = machine->driver_data<sangho_state>();
+ sangho_state *state = machine.driver_data<sangho_state>();
state->sexyboom_bank[0] = 0x00;
state->sexyboom_bank[1] = 0x00;
state->sexyboom_bank[2] = 0x01;
@@ -349,7 +349,7 @@ static MACHINE_RESET(sexyboom)
v9938_reset(0);
}
-static void msx_vdp_interrupt(running_machine *machine, int i)
+static void msx_vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line (machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
@@ -358,14 +358,14 @@ static INTERRUPT_GEN( sangho_interrupt )
{
v9938_set_sprite_limit(0, 0);
v9938_set_resolution(0, RENDER_HIGH);
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static VIDEO_START( sangho )
{
VIDEO_START_CALL(generic_bitmapped);
- v9938_init (machine, 0, *machine->primary_screen, machine->generic.tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
+ v9938_init (machine, 0, *machine.primary_screen, machine.generic.tmpbitmap, MODEL_V9938, 0x20000, msx_vdp_interrupt);
}
static MACHINE_CONFIG_START( pzlestar, sangho_state )
@@ -472,7 +472,7 @@ ROM_END
static DRIVER_INIT(sangho)
{
- sangho_state *state = machine->driver_data<sangho_state>();
+ sangho_state *state = machine.driver_data<sangho_state>();
state->ram = auto_alloc_array(machine, UINT8, 0x20000);
}
diff --git a/src/mame/drivers/sauro.c b/src/mame/drivers/sauro.c
index 8c41728fb87..a3b69df7372 100644
--- a/src/mame/drivers/sauro.c
+++ b/src/mame/drivers/sauro.c
@@ -143,19 +143,19 @@ static READ8_HANDLER( sauro_sound_command_r )
static WRITE8_HANDLER( sauro_coin1_w )
{
- coin_counter_w(space->machine, 0, data);
- coin_counter_w(space->machine, 0, 0); // to get the coin counter working in sauro, as it doesn't write 0
+ coin_counter_w(space->machine(), 0, data);
+ coin_counter_w(space->machine(), 0, 0); // to get the coin counter working in sauro, as it doesn't write 0
}
static WRITE8_HANDLER( sauro_coin2_w )
{
- coin_counter_w(space->machine, 1, data);
- coin_counter_w(space->machine, 1, 0); // to get the coin counter working in sauro, as it doesn't write 0
+ coin_counter_w(space->machine(), 1, data);
+ coin_counter_w(space->machine(), 1, 0); // to get the coin counter working in sauro, as it doesn't write 0
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static WRITE8_DEVICE_HANDLER( adpcm_w )
@@ -523,7 +523,7 @@ static DRIVER_INIT( tecfri )
/* This game doesn't like all memory to be initialized to zero, it won't
initialize the high scores */
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memset(&RAM[0xe000], 0, 0x100);
RAM[0xe000] = 1;
diff --git a/src/mame/drivers/sbasketb.c b/src/mame/drivers/sbasketb.c
index 403b0b67d3c..5f3be1509e7 100644
--- a/src/mame/drivers/sbasketb.c
+++ b/src/mame/drivers/sbasketb.c
@@ -52,12 +52,12 @@ CPU/Video Board Parts:
static WRITE8_HANDLER( sbasketb_sh_irqtrigger_w )
{
- device_set_input_line_and_vector(space->machine->device<cpu_device>("audiocpu"), 0, HOLD_LINE, 0xff);
+ device_set_input_line_and_vector(space->machine().device<cpu_device>("audiocpu"), 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sbasketb_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index 43a5316d740..0c81b66b44b 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -64,8 +64,8 @@ public:
static TILE_GET_INFO( get_sb_tile_info )
{
- sbowling_state *state = machine->driver_data<sbowling_state>();
- UINT8 *rom = machine->region("user1")->base();
+ sbowling_state *state = machine.driver_data<sbowling_state>();
+ UINT8 *rom = machine.region("user1")->base();
int tileno = rom[tile_index + state->bgmap * 1024];
SET_TILE_INFO(0, tileno, 0, 0);
@@ -83,8 +83,8 @@ static void plot_pixel_sbw(bitmap_t *tmpbitmap, int x, int y, int col, int flip)
static WRITE8_HANDLER( sbw_videoram_w )
{
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
- int flip = flip_screen_get(space->machine);
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
+ int flip = flip_screen_get(space->machine());
int x,y,i,v1,v2;
state->videoram[offset] = data;
@@ -107,7 +107,7 @@ static WRITE8_HANDLER( sbw_videoram_w )
static SCREEN_UPDATE(sbowling)
{
- sbowling_state *state = screen->machine->driver_data<sbowling_state>();
+ sbowling_state *state = screen->machine().driver_data<sbowling_state>();
bitmap_fill(bitmap, cliprect, 0x18);
tilemap_draw(bitmap, cliprect,state->sb_tilemap, 0, 0);
@@ -117,28 +117,28 @@ static SCREEN_UPDATE(sbowling)
static VIDEO_START(sbowling)
{
- sbowling_state *state = machine->driver_data<sbowling_state>();
+ sbowling_state *state = machine.driver_data<sbowling_state>();
- state->tmpbitmap = auto_bitmap_alloc(machine,32*8,32*8,machine->primary_screen->format());
+ state->tmpbitmap = auto_bitmap_alloc(machine,32*8,32*8,machine.primary_screen->format());
state->sb_tilemap = tilemap_create(machine, get_sb_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static WRITE8_HANDLER( pix_shift_w )
{
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
state->pix_sh = data;
}
static WRITE8_HANDLER( pix_data_w )
{
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
state->pix[0] = state->pix[1];
state->pix[1] = data;
}
static READ8_HANDLER( pix_data_r )
{
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
UINT32 p1, p0;
int res;
int sh = state->pix_sh & 7;
@@ -155,7 +155,7 @@ static READ8_HANDLER( pix_data_r )
static INTERRUPT_GEN( sbw_interrupt )
{
- int vector = device->machine->primary_screen->vblank() ? 0xcf : 0xd7; /* RST 08h/10h */
+ int vector = device->machine().primary_screen->vblank() ? 0xcf : 0xd7; /* RST 08h/10h */
device_set_input_line_and_vector(device, 0, HOLD_LINE, vector);
}
@@ -169,9 +169,9 @@ static WRITE8_HANDLER (system_w)
-----x-- 1 ?
----x--- flip screen/controls
*/
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
- flip_screen_set(space->machine, data&1);
+ flip_screen_set(space->machine(), data&1);
if ((state->sbw_system^data)&1)
{
@@ -192,7 +192,7 @@ static WRITE8_HANDLER(graph_control_w)
xx------ color PROM address lines A4,A3
*/
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
state->color_prom_address = ((data&0x07)<<7) | ((data&0xc0)>>3);
@@ -202,12 +202,12 @@ static WRITE8_HANDLER(graph_control_w)
static READ8_HANDLER (controls_r)
{
- sbowling_state *state = space->machine->driver_data<sbowling_state>();
+ sbowling_state *state = space->machine().driver_data<sbowling_state>();
if (state->sbw_system & 2)
- return input_port_read(space->machine, "TRACKY");
+ return input_port_read(space->machine(), "TRACKY");
else
- return input_port_read(space->machine, "TRACKX");
+ return input_port_read(space->machine(), "TRACKX");
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -343,7 +343,7 @@ static PALETTE_INIT( sbowling )
3, resistances_rg, outputs_g, 0, 100,
2, resistances_b, outputs_b, 0, 100);
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c
index bb3980bb5e9..94b739f78ce 100644
--- a/src/mame/drivers/sbrkout.c
+++ b/src/mame/drivers/sbrkout.c
@@ -85,11 +85,11 @@ static TIMER_CALLBACK( pot_trigger_callback );
static MACHINE_START( sbrkout )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
UINT8 *videoram = state->videoram;
memory_set_bankptr(machine, "bank1", &videoram[0x380]);
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
- state->pot_timer = machine->scheduler().timer_alloc(FUNC(pot_trigger_callback));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
+ state->pot_timer = machine.scheduler().timer_alloc(FUNC(pot_trigger_callback));
state->save_item(NAME(state->sync2_value));
state->save_item(NAME(state->pot_mask));
@@ -99,8 +99,8 @@ static MACHINE_START( sbrkout )
static MACHINE_RESET( sbrkout )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -113,38 +113,38 @@ static MACHINE_RESET( sbrkout )
static TIMER_CALLBACK( scanline_callback )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
UINT8 *videoram = state->videoram;
int scanline = param;
/* force a partial update before anything happens */
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
/* if this is a rising edge of 16V, assert the CPU interrupt */
if (scanline % 32 == 16)
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
/* update the DAC state */
- dac_data_w(machine->device("dac"), (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
+ dac_data_w(machine.device("dac"), (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
/* on the VBLANK, read the pot and schedule an interrupt time for it */
- if (scanline == machine->primary_screen->visible_area().max_y + 1)
+ if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
UINT8 potvalue = input_port_read(machine, "PADDLE");
- state->pot_timer->adjust(machine->primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128));
+ state->pot_timer->adjust(machine.primary_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128));
}
/* call us back in 4 scanlines */
scanline += 4;
- if (scanline >= machine->primary_screen->height())
+ if (scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -157,38 +157,38 @@ static WRITE8_HANDLER( irq_ack_w )
static READ8_HANDLER( switches_r )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
UINT8 result = 0xff;
/* DIP switches are selected by ADR0+ADR1 if ADR3 == 0 */
if ((offset & 0x0b) == 0x00)
- result &= (input_port_read(space->machine, "DIPS") << 6) | 0x3f;
+ result &= (input_port_read(space->machine(), "DIPS") << 6) | 0x3f;
if ((offset & 0x0b) == 0x01)
- result &= (input_port_read(space->machine, "DIPS") << 4) | 0x3f;
+ result &= (input_port_read(space->machine(), "DIPS") << 4) | 0x3f;
if ((offset & 0x0b) == 0x02)
- result &= (input_port_read(space->machine, "DIPS") << 0) | 0x3f;
+ result &= (input_port_read(space->machine(), "DIPS") << 0) | 0x3f;
if ((offset & 0x0b) == 0x03)
- result &= (input_port_read(space->machine, "DIPS") << 2) | 0x3f;
+ result &= (input_port_read(space->machine(), "DIPS") << 2) | 0x3f;
/* other switches are selected by ADR0+ADR1+ADR2 if ADR4 == 0 */
if ((offset & 0x17) == 0x00)
- result &= (input_port_read(space->machine, "SELECT") << 7) | 0x7f;
+ result &= (input_port_read(space->machine(), "SELECT") << 7) | 0x7f;
if ((offset & 0x17) == 0x04)
result &= ((state->pot_trigger[0] & ~state->pot_mask[0]) << 7) | 0x7f;
if ((offset & 0x17) == 0x05)
result &= ((state->pot_trigger[1] & ~state->pot_mask[1]) << 7) | 0x7f;
if ((offset & 0x17) == 0x06)
- result &= input_port_read(space->machine, "SERVE");
+ result &= input_port_read(space->machine(), "SERVE");
if ((offset & 0x17) == 0x07)
- result &= (input_port_read(space->machine, "SELECT") << 6) | 0x7f;
+ result &= (input_port_read(space->machine(), "SELECT") << 6) | 0x7f;
return result;
}
-static void update_nmi_state(running_machine *machine)
+static void update_nmi_state(running_machine &machine)
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
if ((state->pot_trigger[0] & ~state->pot_mask[0]) | (state->pot_trigger[1] & ~state->pot_mask[1]))
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
else
@@ -198,7 +198,7 @@ static void update_nmi_state(running_machine *machine)
static TIMER_CALLBACK( pot_trigger_callback )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
state->pot_trigger[param] = 1;
update_nmi_state(machine);
}
@@ -206,19 +206,19 @@ static TIMER_CALLBACK( pot_trigger_callback )
static WRITE8_HANDLER( pot_mask1_w )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
state->pot_mask[0] = ~offset & 1;
state->pot_trigger[0] = 0;
- update_nmi_state(space->machine);
+ update_nmi_state(space->machine());
}
static WRITE8_HANDLER( pot_mask2_w )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
state->pot_mask[1] = ~offset & 1;
state->pot_trigger[1] = 0;
- update_nmi_state(space->machine);
+ update_nmi_state(space->machine());
}
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( serve_led_w )
static WRITE8_HANDLER( coincount_w )
{
- coin_counter_w(space->machine, 0, offset & 1);
+ coin_counter_w(space->machine(), 0, offset & 1);
}
@@ -268,16 +268,16 @@ static WRITE8_HANDLER( coincount_w )
static READ8_HANDLER( sync_r )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
- int hpos = space->machine->primary_screen->hpos();
- state->sync2_value = (hpos >= 128 && hpos <= space->machine->primary_screen->visible_area().max_x);
- return space->machine->primary_screen->vpos();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
+ int hpos = space->machine().primary_screen->hpos();
+ state->sync2_value = (hpos >= 128 && hpos <= space->machine().primary_screen->visible_area().max_x);
+ return space->machine().primary_screen->vpos();
}
static READ8_HANDLER( sync2_r )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
return (state->sync2_value << 7) | 0x7f;
}
@@ -291,7 +291,7 @@ static READ8_HANDLER( sync2_r )
static TILE_GET_INFO( get_bg_tile_info )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
UINT8 *videoram = state->videoram;
int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0;
SET_TILE_INFO(0, code, 0, 0);
@@ -300,14 +300,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( sbrkout )
{
- sbrkout_state *state = machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = machine.driver_data<sbrkout_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static WRITE8_HANDLER( sbrkout_videoram_w )
{
- sbrkout_state *state = space->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = space->machine().driver_data<sbrkout_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( sbrkout_videoram_w )
static SCREEN_UPDATE( sbrkout )
{
- sbrkout_state *state = screen->machine->driver_data<sbrkout_state>();
+ sbrkout_state *state = screen->machine().driver_data<sbrkout_state>();
UINT8 *videoram = state->videoram;
int ball;
@@ -335,7 +335,7 @@ static SCREEN_UPDATE( sbrkout )
int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2];
int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], code, 0, 0, 0, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], code, 0, 0, 0, sx, sy, 0);
}
return 0;
}
diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c
index 78f6eb54fe5..cc1112989bc 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -208,13 +208,13 @@ ADDRESS_MAP_END
static READ8_HANDLER(scobra_soundram_r)
{
- scobra_state *state = space->machine->driver_data<scobra_state>();
+ scobra_state *state = space->machine().driver_data<scobra_state>();
return state->soundram[offset & 0x03ff];
}
static WRITE8_HANDLER(scobra_soundram_w)
{
- scobra_state *state = space->machine->driver_data<scobra_state>();
+ scobra_state *state = space->machine().driver_data<scobra_state>();
state->soundram[offset & 0x03ff] = data;
}
@@ -264,7 +264,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( stratgyx_coinage_r )
{
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, "IN4") & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(field->port->machine(), "IN4") & bit_mask) ? 0x01 : 0x00;
}
diff --git a/src/mame/drivers/scotrsht.c b/src/mame/drivers/scotrsht.c
index 9701792f22a..3558f09e0b5 100644
--- a/src/mame/drivers/scotrsht.c
+++ b/src/mame/drivers/scotrsht.c
@@ -41,15 +41,15 @@ Stephh's notes (based on the game M6502 code and some tests) :
static WRITE8_HANDLER( ctrl_w )
{
- scotrsht_state *state = space->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = space->machine().driver_data<scotrsht_state>();
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static INTERRUPT_GEN( scotrsht_interrupt )
{
- scotrsht_state *state = device->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = device->machine().driver_data<scotrsht_state>();
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -58,7 +58,7 @@ static INTERRUPT_GEN( scotrsht_interrupt )
static WRITE8_HANDLER( scotrsht_soundlatch_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static ADDRESS_MAP_START( scotrsht_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index 57453210abe..53ff084e803 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -475,7 +475,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( ckongs_coinage_r )
{
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, "FAKE") & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(field->port->machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
}
diff --git a/src/mame/drivers/scregg.c b/src/mame/drivers/scregg.c
index 8554194695b..50ba97eb4c7 100644
--- a/src/mame/drivers/scregg.c
+++ b/src/mame/drivers/scregg.c
@@ -202,9 +202,9 @@ GFXDECODE_END
static MACHINE_START( scregg )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->audiocpu = NULL;
state->save_item(NAME(state->btime_palette));
@@ -215,7 +215,7 @@ static MACHINE_START( scregg )
static MACHINE_RESET( scregg )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
state->btime_palette = 0;
state->bnj_scroll1 = 0;
@@ -391,7 +391,7 @@ static DRIVER_INIT( rockduck )
{
// rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board?
int x;
- UINT8 *src = machine->region( "gfx1" )->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
for (x = 0x2000; x < 0x6000; x++)
{
diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c
index e69895799fb..6c82c0d11ef 100644
--- a/src/mame/drivers/sderby.c
+++ b/src/mame/drivers/sderby.c
@@ -77,7 +77,7 @@ static READ16_HANDLER ( sderby_input_r )
switch (offset)
{
case 0x00 >> 1:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x02 >> 1:
return 0xffff; // to avoid game to reset (needs more work)
}
@@ -92,11 +92,11 @@ static READ16_HANDLER( roulette_input_r )
switch (offset)
{
case 0x00 >> 1:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x02 >> 1:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04 >> 1:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
return 0xffff;
@@ -135,7 +135,7 @@ static READ16_HANDLER( rprot_r )
If someone more skilled in 68K code can help to trace it,
searching for an accurated response, I'll appreciate.
*/
- return space->machine->rand() & 0x1f;
+ return space->machine().rand() & 0x1f;
}
static WRITE16_HANDLER( rprot_w )
@@ -188,7 +188,7 @@ static WRITE16_HANDLER( sderby_out_w )
output_set_lamp_value(2, (data >> 1) & 1); /* Lamp 2 - BET */
output_set_lamp_value(3, (data >> 15) & 1); /* Lamp 3 - END OF RACE */
- coin_counter_w(space->machine, 0, data & 0x2000);
+ coin_counter_w(space->machine(), 0, data & 0x2000);
}
@@ -237,7 +237,7 @@ static WRITE16_HANDLER( scmatto_out_w )
output_set_lamp_value(6, (data >> 5) & 1); /* Lamp 6 - START */
output_set_lamp_value(7, (data >> 6) & 1); /* Lamp 7 - BET */
- coin_counter_w(space->machine, 0, data & 0x2000);
+ coin_counter_w(space->machine(), 0, data & 0x2000);
}
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index 1d494207b8d..3e01aab8839 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -461,13 +461,13 @@ public:
*************************************/
static void vblank_assert(device_t *device, int state);
-static void update_vblank_irq(running_machine *machine);
-static void galileo_reset(running_machine *machine);
+static void update_vblank_irq(running_machine &machine);
+static void galileo_reset(running_machine &machine);
static TIMER_CALLBACK( galileo_timer_callback );
static void galileo_perform_dma(address_space *space, int which);
static void voodoo_stall(device_t *device, int stall);
-static void widget_reset(running_machine *machine);
-static void update_widget_irq(running_machine *machine);
+static void widget_reset(running_machine &machine);
+static void update_widget_irq(running_machine &machine);
@@ -479,7 +479,7 @@ static void update_widget_irq(running_machine *machine);
static SCREEN_UPDATE( seattle )
{
- seattle_state *state = screen->machine->driver_data<seattle_state>();
+ seattle_state *state = screen->machine().driver_data<seattle_state>();
return voodoo_update(state->voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@@ -493,23 +493,23 @@ static SCREEN_UPDATE( seattle )
static MACHINE_START( seattle )
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
int index;
- state->voodoo = machine->device("voodoo");
+ state->voodoo = machine.device("voodoo");
/* allocate timers for the galileo */
- state->galileo.timer[0].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback));
- state->galileo.timer[1].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback));
- state->galileo.timer[2].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback));
- state->galileo.timer[3].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback));
+ state->galileo.timer[0].timer = machine.scheduler().timer_alloc(FUNC(galileo_timer_callback));
+ state->galileo.timer[1].timer = machine.scheduler().timer_alloc(FUNC(galileo_timer_callback));
+ state->galileo.timer[2].timer = machine.scheduler().timer_alloc(FUNC(galileo_timer_callback));
+ state->galileo.timer[3].timer = machine.scheduler().timer_alloc(FUNC(galileo_timer_callback));
/* set the fastest DRC options, but strict verification */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->rambase);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->rambase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
/* register for save states */
state_save_register_global_array(machine, state->galileo.reg);
@@ -545,7 +545,7 @@ static MACHINE_START( seattle )
static MACHINE_RESET( seattle )
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
state->galileo.dma_active = -1;
state->vblank_irq_num = 0;
@@ -553,12 +553,12 @@ static MACHINE_RESET( seattle )
state->cpu_stalled_on_voodoo = FALSE;
/* reset either the DCS2 board or the CAGE board */
- if (machine->device("dcs2") != NULL)
+ if (machine.device("dcs2") != NULL)
{
dcs_reset_w(1);
dcs_reset_w(0);
}
- else if (machine->device("cage") != NULL)
+ else if (machine.device("cage") != NULL)
{
cage_control_w(machine, 0);
cage_control_w(machine, 3);
@@ -580,7 +580,7 @@ static MACHINE_RESET( seattle )
static void ide_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", IDE_IRQ_NUM, state);
+ cputag_set_input_line(device->machine(), "maincpu", IDE_IRQ_NUM, state);
}
@@ -591,9 +591,9 @@ static void ide_interrupt(device_t *device, int state)
*
*************************************/
-static void ethernet_interrupt_machine(running_machine *machine, int state)
+static void ethernet_interrupt_machine(running_machine &machine, int state)
{
- seattle_state *drvstate = machine->driver_data<seattle_state>();
+ seattle_state *drvstate = machine.driver_data<seattle_state>();
drvstate->ethernet_irq_state = state;
if (drvstate->board_config == FLAGSTAFF_CONFIG)
{
@@ -607,7 +607,7 @@ static void ethernet_interrupt_machine(running_machine *machine, int state)
static void ethernet_interrupt(device_t *device, int state)
{
- ethernet_interrupt_machine(device->machine, state);
+ ethernet_interrupt_machine(device->machine(), state);
}
@@ -618,7 +618,7 @@ static void ethernet_interrupt(device_t *device, int state)
*
*************************************/
-static void ioasic_irq(running_machine *machine, int state)
+static void ioasic_irq(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", IOASIC_IRQ_NUM, state);
}
@@ -633,7 +633,7 @@ static void ioasic_irq(running_machine *machine, int state)
static READ32_HANDLER( interrupt_state_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 result = 0;
result |= state->ethernet_irq_state << ETHERNET_IRQ_SHIFT;
result |= state->vblank_latch << VBLANK_IRQ_SHIFT;
@@ -643,7 +643,7 @@ static READ32_HANDLER( interrupt_state_r )
static READ32_HANDLER( interrupt_state2_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 result = interrupt_state_r(space, offset, mem_mask);
result |= state->vblank_state << 8;
return result;
@@ -652,13 +652,13 @@ static READ32_HANDLER( interrupt_state2_r )
static WRITE32_HANDLER( interrupt_config_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
int irq;
COMBINE_DATA(state->interrupt_config);
/* VBLANK: clear anything pending on the old IRQ */
if (state->vblank_irq_num != 0)
- cputag_set_input_line(space->machine, "maincpu", state->vblank_irq_num, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", state->vblank_irq_num, CLEAR_LINE);
/* VBLANK: compute the new IRQ vector */
irq = (*state->interrupt_config >> (2*VBLANK_IRQ_SHIFT)) & 3;
@@ -669,7 +669,7 @@ static WRITE32_HANDLER( interrupt_config_w )
{
/* Widget: clear anything pending on the old IRQ */
if (state->widget.irq_num != 0)
- cputag_set_input_line(space->machine, "maincpu", state->widget.irq_num, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", state->widget.irq_num, CLEAR_LINE);
/* Widget: compute the new IRQ vector */
irq = (*state->interrupt_config >> (2*WIDGET_IRQ_SHIFT)) & 3;
@@ -681,7 +681,7 @@ static WRITE32_HANDLER( interrupt_config_w )
{
/* Ethernet: clear anything pending on the old IRQ */
if (state->ethernet_irq_num != 0)
- cputag_set_input_line(space->machine, "maincpu", state->ethernet_irq_num, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", state->ethernet_irq_num, CLEAR_LINE);
/* Ethernet: compute the new IRQ vector */
irq = (*state->interrupt_config >> (2*ETHERNET_IRQ_SHIFT)) & 3;
@@ -689,22 +689,22 @@ static WRITE32_HANDLER( interrupt_config_w )
}
/* update the states */
- update_vblank_irq(space->machine);
- ethernet_interrupt_machine(space->machine, state->ethernet_irq_state);
+ update_vblank_irq(space->machine());
+ ethernet_interrupt_machine(space->machine(), state->ethernet_irq_state);
}
static WRITE32_HANDLER( seattle_interrupt_enable_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 old = *state->interrupt_enable;
COMBINE_DATA(state->interrupt_enable);
if (old != *state->interrupt_enable)
{
if (state->vblank_latch)
- update_vblank_irq(space->machine);
+ update_vblank_irq(space->machine());
if (state->ethernet_irq_state)
- ethernet_interrupt_machine(space->machine, state->ethernet_irq_state);
+ ethernet_interrupt_machine(space->machine(), state->ethernet_irq_state);
}
}
@@ -716,9 +716,9 @@ static WRITE32_HANDLER( seattle_interrupt_enable_w )
*
*************************************/
-static void update_vblank_irq(running_machine *machine)
+static void update_vblank_irq(running_machine &machine)
{
- seattle_state *drvstate = machine->driver_data<seattle_state>();
+ seattle_state *drvstate = machine.driver_data<seattle_state>();
int state = CLEAR_LINE;
/* skip if no interrupt configured */
@@ -734,16 +734,16 @@ static void update_vblank_irq(running_machine *machine)
static WRITE32_HANDLER( vblank_clear_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
/* clear the latch and update the IRQ */
state->vblank_latch = 0;
- update_vblank_irq(space->machine);
+ update_vblank_irq(space->machine());
}
static void vblank_assert(device_t *device, int state)
{
- seattle_state *drvstate = device->machine->driver_data<seattle_state>();
+ seattle_state *drvstate = device->machine().driver_data<seattle_state>();
/* cache the raw state */
drvstate->vblank_state = state;
@@ -751,7 +751,7 @@ static void vblank_assert(device_t *device, int state)
if ((state && !(*drvstate->interrupt_enable & 0x100)) || (!state && (*drvstate->interrupt_enable & 0x100)))
{
drvstate->vblank_latch = 1;
- update_vblank_irq(device->machine);
+ update_vblank_irq(device->machine());
}
}
@@ -765,7 +765,7 @@ static void vblank_assert(device_t *device, int state)
static UINT32 pci_bridge_r(address_space *space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 result = state->galileo.pci_bridge_regs[reg];
switch (reg)
@@ -787,7 +787,7 @@ static UINT32 pci_bridge_r(address_space *space, UINT8 reg, UINT8 type)
static void pci_bridge_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
state->galileo.pci_bridge_regs[reg] = data;
if (LOG_PCI)
logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", cpu_get_pc(space->cpu), reg, type, data);
@@ -803,7 +803,7 @@ static void pci_bridge_w(address_space *space, UINT8 reg, UINT8 type, UINT32 dat
static UINT32 pci_3dfx_r(address_space *space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 result = state->galileo.pci_3dfx_regs[reg];
switch (reg)
@@ -825,7 +825,7 @@ static UINT32 pci_3dfx_r(address_space *space, UINT8 reg, UINT8 type)
static void pci_3dfx_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
state->galileo.pci_3dfx_regs[reg] = data;
switch (reg)
@@ -854,7 +854,7 @@ static void pci_3dfx_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
static UINT32 pci_ide_r(address_space *space, UINT8 reg, UINT8 type)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
UINT32 result = state->galileo.pci_ide_regs[reg];
switch (reg)
@@ -876,7 +876,7 @@ static UINT32 pci_ide_r(address_space *space, UINT8 reg, UINT8 type)
static void pci_ide_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
state->galileo.pci_ide_regs[reg] = data;
if (LOG_PCI)
logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", cpu_get_pc(space->cpu), reg, type, data);
@@ -890,9 +890,9 @@ static void pci_ide_w(address_space *space, UINT8 reg, UINT8 type, UINT32 data)
*
*************************************/
-static void update_galileo_irqs(running_machine *machine)
+static void update_galileo_irqs(running_machine &machine)
{
- seattle_state *drvstate = machine->driver_data<seattle_state>();
+ seattle_state *drvstate = machine.driver_data<seattle_state>();
int state = CLEAR_LINE;
/* if any unmasked interrupts are live, we generate */
@@ -907,7 +907,7 @@ static void update_galileo_irqs(running_machine *machine)
static TIMER_CALLBACK( galileo_timer_callback )
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
int which = param;
galileo_timer *timer = &state->galileo.timer[which];
@@ -940,7 +940,7 @@ static TIMER_CALLBACK( galileo_timer_callback )
static int galileo_dma_fetch_next(address_space *space, int which)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
galileo_data &galileo = state->galileo;
offs_t address = 0;
UINT32 data;
@@ -955,7 +955,7 @@ static int galileo_dma_fetch_next(address_space *space, int which)
if (galileo.reg[GREG_DMA0_CONTROL + which] & 0x400)
{
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
- update_galileo_irqs(space->machine);
+ update_galileo_irqs(space->machine());
}
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
return 0;
@@ -982,7 +982,7 @@ static int galileo_dma_fetch_next(address_space *space, int which)
static void galileo_perform_dma(address_space *space, int which)
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
galileo_data &galileo = state->galileo;
do
{
@@ -1066,7 +1066,7 @@ static void galileo_perform_dma(address_space *space, int which)
if (!(galileo.reg[GREG_DMA0_CONTROL + which] & 0x400))
{
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
- update_galileo_irqs(space->machine);
+ update_galileo_irqs(space->machine());
}
} while (galileo_dma_fetch_next(space, which));
@@ -1081,16 +1081,16 @@ static void galileo_perform_dma(address_space *space, int which)
*
*************************************/
-static void galileo_reset(running_machine *machine)
+static void galileo_reset(running_machine &machine)
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
memset(&state->galileo.reg, 0, sizeof(state->galileo.reg));
}
static READ32_HANDLER( galileo_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
galileo_data &galileo = state->galileo;
UINT32 result = galileo.reg[offset];
@@ -1173,7 +1173,7 @@ static READ32_HANDLER( galileo_r )
static WRITE32_HANDLER( galileo_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
galileo_data &galileo = state->galileo;
UINT32 oldata = galileo.reg[offset];
COMBINE_DATA(&galileo.reg[offset]);
@@ -1262,7 +1262,7 @@ static WRITE32_HANDLER( galileo_w )
if (LOG_GALILEO)
logerror("%08X:Galileo write to IRQ clear = %08X & %08X\n", offset*4, data, mem_mask);
galileo.reg[offset] = oldata & data;
- update_galileo_irqs(space->machine);
+ update_galileo_irqs(space->machine());
break;
case GREG_CONFIG_DATA:
@@ -1317,7 +1317,7 @@ static WRITE32_HANDLER( galileo_w )
static WRITE32_HANDLER( seattle_voodoo_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
/* if we're not stalled, just write and get out */
if (!state->voodoo_stalled)
{
@@ -1343,7 +1343,7 @@ static WRITE32_HANDLER( seattle_voodoo_w )
static void voodoo_stall(device_t *device, int stall)
{
- seattle_state *state = device->machine->driver_data<seattle_state>();
+ seattle_state *state = device->machine().driver_data<seattle_state>();
/* set the new state */
state->voodoo_stalled = stall;
@@ -1357,8 +1357,8 @@ static void voodoo_stall(device_t *device, int stall)
}
else
{
- if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine->device("maincpu")));
- device_spin_until_trigger(device->machine->device("maincpu"), 45678);
+ if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine().device("maincpu")));
+ device_spin_until_trigger(device->machine().device("maincpu"), 45678);
}
}
@@ -1371,7 +1371,7 @@ static void voodoo_stall(device_t *device, int stall)
for (which = 0; which < 4; which++)
if (state->galileo.dma_stalled_on_voodoo[which])
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
if (LOG_DMA) logerror("Resuming DMA%d on voodoo\n", which);
/* mark this DMA as no longer stalled */
@@ -1392,7 +1392,7 @@ static void voodoo_stall(device_t *device, int stall)
/* resume CPU execution */
if (LOG_DMA) logerror("Resuming CPU on voodoo\n");
- device->machine->scheduler().trigger(45678);
+ device->machine().scheduler().trigger(45678);
}
}
}
@@ -1407,19 +1407,19 @@ static void voodoo_stall(device_t *device, int stall)
static READ32_HANDLER( analog_port_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
return state->pending_analog_read;
}
static WRITE32_HANDLER( analog_port_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(space->cpu), data);
- state->pending_analog_read = input_port_read(space->machine, portnames[data & 7]);
+ state->pending_analog_read = input_port_read(space->machine(), portnames[data & 7]);
}
@@ -1437,39 +1437,39 @@ static READ32_HANDLER( carnevil_gun_r )
switch (offset)
{
case 0: /* low 8 bits of X */
- result = (input_port_read(space->machine, "LIGHT0_X") << 4) & 0xff;
+ result = (input_port_read(space->machine(), "LIGHT0_X") << 4) & 0xff;
break;
case 1: /* upper 4 bits of X */
- result = (input_port_read(space->machine, "LIGHT0_X") >> 4) & 0x0f;
- result |= (input_port_read(space->machine, "FAKE") & 0x03) << 4;
+ result = (input_port_read(space->machine(), "LIGHT0_X") >> 4) & 0x0f;
+ result |= (input_port_read(space->machine(), "FAKE") & 0x03) << 4;
result |= 0x40;
break;
case 2: /* low 8 bits of Y */
- result = (input_port_read(space->machine, "LIGHT0_Y") << 2) & 0xff;
+ result = (input_port_read(space->machine(), "LIGHT0_Y") << 2) & 0xff;
break;
case 3: /* upper 4 bits of Y */
- result = (input_port_read(space->machine, "LIGHT0_Y") >> 6) & 0x03;
+ result = (input_port_read(space->machine(), "LIGHT0_Y") >> 6) & 0x03;
break;
case 4: /* low 8 bits of X */
- result = (input_port_read(space->machine, "LIGHT1_X") << 4) & 0xff;
+ result = (input_port_read(space->machine(), "LIGHT1_X") << 4) & 0xff;
break;
case 5: /* upper 4 bits of X */
- result = (input_port_read(space->machine, "LIGHT1_X") >> 4) & 0x0f;
- result |= (input_port_read(space->machine, "FAKE") & 0x30);
+ result = (input_port_read(space->machine(), "LIGHT1_X") >> 4) & 0x0f;
+ result |= (input_port_read(space->machine(), "FAKE") & 0x30);
result |= 0x40;
break;
case 6: /* low 8 bits of Y */
- result = (input_port_read(space->machine, "LIGHT1_Y") << 2) & 0xff;
+ result = (input_port_read(space->machine(), "LIGHT1_Y") << 2) & 0xff;
break;
case 7: /* upper 4 bits of Y */
- result = (input_port_read(space->machine, "LIGHT1_Y") >> 6) & 0x03;
+ result = (input_port_read(space->machine(), "LIGHT1_Y") >> 6) & 0x03;
break;
}
return result;
@@ -1514,18 +1514,18 @@ static WRITE32_DEVICE_HANDLER( ethernet_w )
*
*************************************/
-static void widget_reset(running_machine *machine)
+static void widget_reset(running_machine &machine)
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
UINT8 saved_irq = state->widget.irq_num;
memset(&state->widget, 0, sizeof(state->widget));
state->widget.irq_num = saved_irq;
}
-static void update_widget_irq(running_machine *machine)
+static void update_widget_irq(running_machine &machine)
{
- seattle_state *drvstate = machine->driver_data<seattle_state>();
+ seattle_state *drvstate = machine.driver_data<seattle_state>();
UINT8 state = drvstate->ethernet_irq_state << WINT_ETHERNET_SHIFT;
UINT8 mask = drvstate->widget.irq_mask;
UINT8 assert = ((mask & state) != 0) && (*drvstate->interrupt_enable & (1 << WIDGET_IRQ_SHIFT));
@@ -1538,7 +1538,7 @@ static void update_widget_irq(running_machine *machine)
static READ32_DEVICE_HANDLER( widget_r )
{
- seattle_state *state = device->machine->driver_data<seattle_state>();
+ seattle_state *state = device->machine().driver_data<seattle_state>();
UINT32 result = ~0;
switch (offset)
@@ -1553,7 +1553,7 @@ static READ32_DEVICE_HANDLER( widget_r )
break;
case WREG_ANALOG:
- result = analog_port_r(device->machine->device("maincpu")->memory().space(AS_PROGRAM), 0, mem_mask);
+ result = analog_port_r(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, mem_mask);
break;
case WREG_ETHER_DATA:
@@ -1569,7 +1569,7 @@ static READ32_DEVICE_HANDLER( widget_r )
static WRITE32_DEVICE_HANDLER( widget_w )
{
- seattle_state *state = device->machine->driver_data<seattle_state>();
+ seattle_state *state = device->machine().driver_data<seattle_state>();
if (LOG_WIDGET)
logerror("Widget write (%02X) = %08X & %08X\n", offset*4, data, mem_mask);
@@ -1581,11 +1581,11 @@ static WRITE32_DEVICE_HANDLER( widget_w )
case WREG_INTERRUPT:
state->widget.irq_mask = data;
- update_widget_irq(device->machine);
+ update_widget_irq(device->machine());
break;
case WREG_ANALOG:
- analog_port_w(device->machine->device("maincpu")->memory().space(AS_PROGRAM), 0, data, mem_mask);
+ analog_port_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, data, mem_mask);
break;
case WREG_ETHER_DATA:
@@ -1604,7 +1604,7 @@ static WRITE32_DEVICE_HANDLER( widget_w )
static WRITE32_HANDLER( cmos_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
if (state->cmos_write_enabled)
COMBINE_DATA(state->m_nvram + offset);
state->cmos_write_enabled = FALSE;
@@ -1613,21 +1613,21 @@ static WRITE32_HANDLER( cmos_w )
static READ32_HANDLER( cmos_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
return state->m_nvram[offset];
}
static WRITE32_HANDLER( cmos_protect_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
state->cmos_write_enabled = TRUE;
}
static READ32_HANDLER( cmos_protect_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
return state->cmos_write_enabled;
}
@@ -1647,29 +1647,29 @@ static WRITE32_HANDLER( seattle_watchdog_w )
static WRITE32_HANDLER( asic_reset_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
COMBINE_DATA(state->asic_reset);
if (!(*state->asic_reset & 0x0002))
- midway_ioasic_reset(space->machine);
+ midway_ioasic_reset(space->machine());
}
static WRITE32_HANDLER( asic_fifo_w )
{
- midway_ioasic_fifo_w(space->machine, data);
+ midway_ioasic_fifo_w(space->machine(), data);
}
static READ32_HANDLER( status_leds_r )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
return state->status_leds | 0xffffff00;
}
static WRITE32_HANDLER( status_leds_w )
{
- seattle_state *state = space->machine->driver_data<seattle_state>();
+ seattle_state *state = space->machine().driver_data<seattle_state>();
if (ACCESSING_BITS_0_7)
state->status_leds = data;
}
@@ -1757,7 +1757,7 @@ static READ32_DEVICE_HANDLER( seattle_ide_r )
{
/* note that blitz times out if we don't have this cycle stealing */
if (offset == 0x3f6/4)
- device_eat_cycles(device->machine->device("maincpu"), 100);
+ device_eat_cycles(device->machine().device("maincpu"), 100);
return ide_controller32_r(device, offset, mem_mask);
}
@@ -2807,9 +2807,9 @@ ROM_END
*
*************************************/
-static void init_common(running_machine *machine, int ioasic, int serialnum, int yearoffs, int config)
+static void init_common(running_machine &machine, int ioasic, int serialnum, int yearoffs, int config)
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
device_t *device;
/* initialize the subsystems */
@@ -2821,22 +2821,22 @@ static void init_common(running_machine *machine, int ioasic, int serialnum, int
{
case PHOENIX_CONFIG:
/* original Phoenix board only has 4MB of RAM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x00400000, 0x007fffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x00400000, 0x007fffff);
break;
case SEATTLE_WIDGET_CONFIG:
/* set up the widget board */
- device = machine->device("ethernet");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x16c00000, 0x16c0001f, FUNC(widget_r), FUNC(widget_w));
+ device = machine.device("ethernet");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x16c00000, 0x16c0001f, FUNC(widget_r), FUNC(widget_w));
break;
case FLAGSTAFF_CONFIG:
/* set up the analog inputs */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x14000000, 0x14000003, FUNC(analog_port_r), FUNC(analog_port_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x14000000, 0x14000003, FUNC(analog_port_r), FUNC(analog_port_w));
/* set up the ethernet controller */
- device = machine->device("ethernet");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x16c00000, 0x16c0003f, FUNC(ethernet_r), FUNC(ethernet_w));
+ device = machine.device("ethernet");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x16c00000, 0x16c0003f, FUNC(ethernet_r), FUNC(ethernet_w));
break;
}
}
@@ -2848,9 +2848,9 @@ static DRIVER_INIT( wg3dh )
init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8004413C, 0x0C0054B4, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80094930, 0x00A2102B, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80092984, 0x3C028011, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8004413C, 0x0C0054B4, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80094930, 0x00A2102B, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80092984, 0x3C028011, 250); /* confirmed */
}
@@ -2860,7 +2860,7 @@ static DRIVER_INIT( mace )
init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800108F8, 0x8C420000, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800108F8, 0x8C420000, 250); /* confirmed */
}
@@ -2870,9 +2870,9 @@ static DRIVER_INIT( sfrush )
init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80059F34, 0x3C028012, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800A5AF4, 0x8E300010, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8004C260, 0x3C028012, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80059F34, 0x3C028012, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800A5AF4, 0x8E300010, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8004C260, 0x3C028012, 250); /* confirmed */
}
@@ -2882,10 +2882,10 @@ static DRIVER_INIT( sfrushrk )
init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800343E8, 0x3C028012, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8008F4F0, 0x3C028012, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800A365C, 0x8E300014, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80051DAC, 0x3C028012, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800343E8, 0x3C028012, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8008F4F0, 0x3C028012, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800A365C, 0x8E300014, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80051DAC, 0x3C028012, 250); /* confirmed */
}
@@ -2896,8 +2896,8 @@ static DRIVER_INIT( calspeed )
midway_ioasic_set_auto_ack(1);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80032534, 0x02221024, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800B1BE4, 0x8E110014, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80032534, 0x02221024, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800B1BE4, 0x8E110014, 250); /* confirmed */
}
@@ -2907,9 +2907,9 @@ static DRIVER_INIT( vaportrx )
init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80049F14, 0x3C028020, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8004859C, 0x3C028020, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8005922C, 0x8E020014, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80049F14, 0x3C028020, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8004859C, 0x3C028020, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8005922C, 0x8E020014, 250); /* confirmed */
}
@@ -2924,7 +2924,7 @@ static DRIVER_INIT( biofreak )
static DRIVER_INIT( blitz )
{
- seattle_state *state = machine->driver_data<seattle_state>();
+ seattle_state *state = machine.driver_data<seattle_state>();
dcs2_init(machine, 2, 0x39c2);
init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG);
@@ -2932,8 +2932,8 @@ static DRIVER_INIT( blitz )
state->rombase[0x934/4] += 4;
/* main CPU speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800087DC, 0x8E820010, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800087DC, 0x8E820010, 250); /* confirmed */
}
@@ -2943,8 +2943,8 @@ static DRIVER_INIT( blitz99 )
init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8014E41C, 0x3C038025, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80011F10, 0x8E020018, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8014E41C, 0x3C038025, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80011F10, 0x8E020018, 250); /* confirmed */
}
@@ -2954,8 +2954,8 @@ static DRIVER_INIT( blitz2k )
init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8015773C, 0x3C038025, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80012CA8, 0x8E020018, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8015773C, 0x3C038025, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80012CA8, 0x8E020018, 250); /* confirmed */
}
@@ -2965,11 +2965,11 @@ static DRIVER_INIT( carnevil )
init_common(machine, MIDWAY_IOASIC_CARNEVIL, 469/* 469 or 486 or 528 */, 80, SEATTLE_CONFIG);
/* set up the gun */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16800000, 0x1680001f, FUNC(carnevil_gun_r), FUNC(carnevil_gun_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16800000, 0x1680001f, FUNC(carnevil_gun_r), FUNC(carnevil_gun_w));
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FBC, 0x8E020018, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8015176C, 0x3C03801A, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80011FBC, 0x8E020018, 250); /* confirmed */
}
@@ -2979,9 +2979,9 @@ static DRIVER_INIT( hyprdriv )
init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x801643BC, 0x3C03801B, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80011FB8, 0x8E020018, 250); /* confirmed */
- //mips3drc_add_hotspot(machine->device("maincpu"), 0x80136A80, 0x3C02801D, 250); /* potential */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x801643BC, 0x3C03801B, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80011FB8, 0x8E020018, 250); /* confirmed */
+ //mips3drc_add_hotspot(machine.device("maincpu"), 0x80136A80, 0x3C02801D, 250); /* potential */
}
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index 49bfe43d498..b620974d558 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -86,7 +86,7 @@
#define LOG_IOCHIP 0
-static void recompute_palette_tables( running_machine *machine );
+static void recompute_palette_tables( running_machine &machine );
/******************************************************************************
Machine init
@@ -99,7 +99,7 @@ static void recompute_palette_tables( running_machine *machine );
static MACHINE_START( segac2 )
{
- segac2_state *state = machine->driver_data<segac2_state>();
+ segac2_state *state = machine.driver_data<segac2_state>();
state_save_register_global_array(machine, state->misc_io_data);
state_save_register_global(machine, state->prot_write_buf);
@@ -109,16 +109,16 @@ static MACHINE_START( segac2 )
static MACHINE_RESET( segac2 )
{
- segac2_state *state = machine->driver_data<segac2_state>();
- megadrive_ram = reinterpret_cast<UINT16 *>(memory_get_shared(*machine, "nvram"));
+ segac2_state *state = machine.driver_data<segac2_state>();
+ megadrive_ram = reinterpret_cast<UINT16 *>(memory_get_shared(machine, "nvram"));
/* set up interrupts and such */
MACHINE_RESET_CALL(megadriv);
/* determine how many sound banks */
state->sound_banks = 0;
- if (machine->region("upd")->base())
- state->sound_banks = machine->region("upd")->bytes() / 0x20000;
+ if (machine.region("upd")->base())
+ state->sound_banks = machine.region("upd")->bytes() / 0x20000;
/* reset the protection */
state->prot_write_buf = 0;
@@ -150,7 +150,7 @@ static MACHINE_RESET( segac2 )
/* handle writes to the UPD7759 */
static WRITE16_DEVICE_HANDLER( segac2_upd7759_w )
{
- segac2_state *state = device->machine->driver_data<segac2_state>();
+ segac2_state *state = device->machine().driver_data<segac2_state>();
/* make sure we have a UPD chip */
if (!state->sound_banks)
@@ -186,7 +186,7 @@ static WRITE16_DEVICE_HANDLER( segac2_upd7759_w )
/* handle reads from the paletteram */
static READ16_HANDLER( palette_r )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
offset &= 0x1ff;
if (state->segac2_alt_palette_mode)
offset = ((offset << 1) & 0x100) | ((offset << 2) & 0x80) | ((~offset >> 2) & 0x40) | ((offset >> 1) & 0x20) | (offset & 0x1f);
@@ -197,7 +197,7 @@ static READ16_HANDLER( palette_r )
/* handle writes to the paletteram */
static WRITE16_HANDLER( palette_w )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
int r, g, b, newword;
int tmpr, tmpg, tmpb;
@@ -217,7 +217,7 @@ static WRITE16_HANDLER( palette_w )
b = ((newword >> 7) & 0x1e) | ((newword >> 14) & 0x01);
/* set the color */
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
megadrive_vdp_palette_lookup[offset] = (b) | (g << 5) | (r << 10);
megadrive_vdp_palette_lookup_sprite[offset] = (b) | (g << 5) | (r << 10);
@@ -265,9 +265,9 @@ static WRITE16_HANDLER( palette_w )
******************************************************************************/
-static void recompute_palette_tables( running_machine *machine )
+static void recompute_palette_tables( running_machine &machine )
{
- segac2_state *state = machine->driver_data<segac2_state>();
+ segac2_state *state = machine.driver_data<segac2_state>();
int i;
for (i = 0; i < 4; i++)
@@ -304,7 +304,7 @@ static void recompute_palette_tables( running_machine *machine )
static READ16_HANDLER( io_chip_r )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
offset &= 0x1f/2;
@@ -325,8 +325,8 @@ static READ16_HANDLER( io_chip_r )
/* otherwise, return an input port */
if (offset == 0x04/2 && state->sound_banks)
- return (input_port_read(space->machine, portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine->device("upd")) << 6);
- return input_port_read(space->machine, portnames[offset]);
+ return (input_port_read(space->machine(), portnames[offset]) & 0xbf) | (upd7759_busy_r(space->machine().device("upd")) << 6);
+ return input_port_read(space->machine(), portnames[offset]);
/* 'SEGA' protection */
case 0x10/2:
@@ -354,7 +354,7 @@ static READ16_HANDLER( io_chip_r )
static WRITE16_HANDLER( io_chip_w )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
UINT8 newbank;
UINT8 old;
@@ -386,10 +386,10 @@ static WRITE16_HANDLER( io_chip_w )
D1 : To CN1 pin J. (Coin meter 2)
D0 : To CN1 pin 8. (Coin meter 1)
*/
-/* coin_lockout_w(space->machine, 1, data & 0x08);
- coin_lockout_w(space->machine, 0, data & 0x04); */
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x01);
+/* coin_lockout_w(space->machine(), 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, data & 0x04); */
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
break;
/* banking */
@@ -407,13 +407,13 @@ static WRITE16_HANDLER( io_chip_w )
newbank = data & 3;
if (newbank != state->palbank)
{
- //space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() + 1);
+ //space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 1);
state->palbank = newbank;
- recompute_palette_tables(space->machine);
+ recompute_palette_tables(space->machine());
}
if (state->sound_banks > 1)
{
- device_t *upd = space->machine->device("upd");
+ device_t *upd = space->machine().device("upd");
newbank = (data >> 2) & (state->sound_banks - 1);
upd7759_set_bank_base(upd, newbank * 0x20000);
}
@@ -423,7 +423,7 @@ static WRITE16_HANDLER( io_chip_w )
case 0x1c/2:
if (state->sound_banks > 1)
{
- device_t *upd = space->machine->device("upd");
+ device_t *upd = space->machine().device("upd");
upd7759_reset_w(upd, (data >> 1) & 1);
}
break;
@@ -443,14 +443,14 @@ static WRITE16_HANDLER( io_chip_w )
static WRITE16_HANDLER( control_w )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
/* skip if not LSB */
if (!ACCESSING_BITS_0_7)
return;
data &= 0x0f;
/* bit 0 controls display enable */
- //segac2_enable_display(space->machine, ~data & 1);
+ //segac2_enable_display(space->machine(), ~data & 1);
state->segac2_enable_display = ~data & 1;
/* bit 1 resets the protection */
@@ -459,7 +459,7 @@ static WRITE16_HANDLER( control_w )
/* bit 2 controls palette shuffling; only ribbit and twinsqua use this feature */
state->segac2_alt_palette_mode = ((~data & 4) >> 2);
- recompute_palette_tables(space->machine);
+ recompute_palette_tables(space->machine());
}
@@ -479,7 +479,7 @@ static WRITE16_HANDLER( control_w )
/* protection chip reads */
static READ16_HANDLER( prot_r )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", cpu_get_previouspc(space->cpu), state->prot_func ? state->prot_read_buf : 0xff);
return state->prot_read_buf | 0xf0;
}
@@ -488,7 +488,7 @@ static READ16_HANDLER( prot_r )
/* protection chip writes */
static WRITE16_HANDLER( prot_w )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
int new_sp_palbase = (data >> 2) & 3;
int new_bg_palbase = data & 3;
int table_index;
@@ -511,11 +511,11 @@ static WRITE16_HANDLER( prot_w )
/* if the palette changed, force an update */
if (new_sp_palbase != state->sp_palbase || new_bg_palbase != state->bg_palbase)
{
- //space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() + 1);
+ //space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 1);
state->sp_palbase = new_sp_palbase;
state->bg_palbase = new_bg_palbase;
- recompute_palette_tables(space->machine);
- if (LOG_PALETTE) logerror("Set palbank: %d/%d (scan=%d)\n", state->bg_palbase, state->sp_palbase, space->machine->primary_screen->vpos());
+ recompute_palette_tables(space->machine());
+ if (LOG_PALETTE) logerror("Set palbank: %d/%d (scan=%d)\n", state->bg_palbase, state->sp_palbase, space->machine().primary_screen->vpos());
}
}
@@ -550,8 +550,8 @@ static WRITE16_HANDLER( counter_timer_w )
break;
case 0x10: /* coin counter */
-// coin_counter_w(space->machine, 0,1);
-// coin_counter_w(space->machine, 0,0);
+// coin_counter_w(space->machine(), 0,1);
+// coin_counter_w(space->machine(), 0,0);
break;
case 0x12: /* set coinage info -- followed by two 4-bit values */
@@ -581,13 +581,13 @@ static WRITE16_HANDLER( counter_timer_w )
static READ16_HANDLER( printer_r )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
return state->cam_data;
}
static WRITE16_HANDLER( print_club_camera_w )
{
- segac2_state *state = space->machine->driver_data<segac2_state>();
+ segac2_state *state = space->machine().driver_data<segac2_state>();
state->cam_data = data;
}
@@ -1296,7 +1296,7 @@ INPUT_PORTS_END
static void segac2_irq2_interrupt(device_t *device, int state)
{
//printf("sound irq %d\n", state);
- cputag_set_input_line(device->machine, "maincpu", 2, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 2, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ym3438_interface ym3438_intf =
{
@@ -1328,10 +1328,10 @@ static VIDEO_START(segac2_new)
static SCREEN_UPDATE(segac2_new)
{
- segac2_state *state = screen->machine->driver_data<segac2_state>();
+ segac2_state *state = screen->machine().driver_data<segac2_state>();
if (!state->segac2_enable_display)
{
- bitmap_fill(bitmap, NULL, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, NULL, get_black_pen(screen->machine()));
return 0;
}
@@ -1816,10 +1816,10 @@ it should be, otherwise I don't see how the formula could be computed.
******************************************************************************/
-static void segac2_common_init(running_machine* machine, int (*func)(int in))
+static void segac2_common_init(running_machine& machine, int (*func)(int in))
{
- segac2_state *state = machine->driver_data<segac2_state>();
- device_t *upd = machine->device("upd");
+ segac2_state *state = machine.driver_data<segac2_state>();
+ device_t *upd = machine.device("upd");
DRIVER_INIT_CALL( megadriv_c2 );
@@ -1830,7 +1830,7 @@ static void segac2_common_init(running_machine* machine, int (*func)(int in))
genesis_other_hacks = 0;
if (upd != NULL)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*upd, 0x880000, 0x880001, 0, 0x13fefe, FUNC(segac2_upd7759_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*upd, 0x880000, 0x880001, 0, 0x13fefe, FUNC(segac2_upd7759_w));
}
@@ -2087,7 +2087,7 @@ static DRIVER_INIT( tfrceacb )
{
/* disable the palette bank switching from the protection chip */
segac2_common_init(machine, NULL);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x800000, 0x800001);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x800000, 0x800001);
}
static DRIVER_INIT( borench )
@@ -2153,7 +2153,7 @@ static DRIVER_INIT( ichirj )
static DRIVER_INIT( ichirjbl )
{
/* when did this actually work? - the protection is patched but the new check fails? */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x390/2] = 0x6600;
segac2_common_init(machine, NULL);
@@ -2174,36 +2174,36 @@ static DRIVER_INIT( pclub )
{
segac2_common_init(machine, prot_func_pclub);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
}
static DRIVER_INIT( pclubjv2 )
{
segac2_common_init(machine, prot_func_pclubjv2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
}
static DRIVER_INIT( pclubjv4 )
{
segac2_common_init(machine, prot_func_pclubjv4);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
}
static DRIVER_INIT( pclubjv5 )
{
segac2_common_init(machine, prot_func_pclubjv5);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880120, 0x880121, FUNC(printer_r) );/*Print Club Vol.1*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x880124, 0x880125, FUNC(printer_r) );/*Print Club Vol.2*/
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x880124, 0x880125, FUNC(print_club_camera_w));
}
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index 9046727d332..7ff900de9fc 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -353,19 +353,19 @@ static WRITE8_HANDLER( systeme_bank_w )
segae_set_vram_banks(data);
- //memcpy(sms_rom+0x8000, space->machine->region("user1")->base()+0x10000+rombank*0x4000, 0x4000);
- memory_set_bank(space->machine, "bank1", rombank);
+ //memcpy(sms_rom+0x8000, space->machine().region("user1")->base()+0x10000+rombank*0x4000, 0x4000);
+ memory_set_bank(space->machine(), "bank1", rombank);
}
-static void init_ports_systeme(running_machine *machine)
+static void init_ports_systeme(running_machine &machine)
{
/* INIT THE PORTS *********************************************************************************************/
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
- device_t *sn1 = machine->device("sn1");
- device_t *sn2 = machine->device("sn2");
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
+ device_t *sn1 = machine.device("sn1");
+ device_t *sn2 = machine.device("sn2");
io->install_legacy_write_handler(*sn2, 0x7b, 0x7b, FUNC(sn76496_w));
io->install_legacy_write_handler(*sn1, 0x7e, 0x7f, FUNC(sn76496_w));
@@ -388,15 +388,15 @@ static void init_ports_systeme(running_machine *machine)
-static void init_systeme_map(running_machine *machine)
+static void init_systeme_map(running_machine &machine)
{
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* alternate way of accessing video ram */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xbfff, FUNC(segasyse_videoram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xbfff, FUNC(segasyse_videoram_w));
/* main ram area */
- sms_mainram = (UINT8 *)machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xc000, 0xffff);
+ sms_mainram = (UINT8 *)machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xc000, 0xffff);
memset(sms_mainram,0x00,0x4000);
init_ports_systeme(machine);
@@ -909,10 +909,10 @@ static READ8_HANDLER (segae_hangonjr_port_f8_r)
temp = 0;
if (port_fa_last == 0x08) /* 0000 1000 */ /* Angle */
- temp = input_port_read(space->machine, "IN2");
+ temp = input_port_read(space->machine(), "IN2");
if (port_fa_last == 0x09) /* 0000 1001 */ /* Accel */
- temp = input_port_read(space->machine, "IN3");
+ temp = input_port_read(space->machine(), "IN3");
return temp;
}
@@ -948,13 +948,13 @@ static WRITE8_HANDLER (segae_ridleofp_port_fa_w)
if (data & 1)
{
- int curr = input_port_read(space->machine, "IN2");
+ int curr = input_port_read(space->machine(), "IN2");
diff1 = ((curr - last1) & 0x0fff) | (curr & 0xf000);
last1 = curr;
}
if (data & 2)
{
- int curr = input_port_read(space->machine, "IN3") & 0x0fff;
+ int curr = input_port_read(space->machine(), "IN3") & 0x0fff;
diff2 = ((curr - last2) & 0x0fff) | (curr & 0xf000);
last2 = curr;
}
@@ -964,8 +964,8 @@ static DRIVER_INIT( ridleofp )
{
DRIVER_INIT_CALL(segasyse);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(segae_ridleofp_port_f8_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xfa, 0xfa, FUNC(segae_ridleofp_port_fa_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(segae_ridleofp_port_f8_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xfa, 0xfa, FUNC(segae_ridleofp_port_fa_w));
}
@@ -973,8 +973,8 @@ static DRIVER_INIT( hangonjr )
{
DRIVER_INIT_CALL(segasyse);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(segae_hangonjr_port_f8_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xfa, 0xfa, FUNC(segae_hangonjr_port_fa_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(segae_hangonjr_port_f8_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xfa, 0xfa, FUNC(segae_hangonjr_port_fa_w));
}
static DRIVER_INIT( opaopa )
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index b4c9ec6d52b..135b7fc3c5a 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -150,7 +150,7 @@ static INPUT_CHANGED( service_switch )
{
/* pressing the service switch sends an NMI */
if (newval)
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -175,7 +175,7 @@ static MACHINE_RESET( pignewt )
static offs_t decrypt_offset(address_space *space, offs_t offset)
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
offs_t pc = cpu_get_previouspc(space->cpu);
@@ -188,7 +188,7 @@ static offs_t decrypt_offset(address_space *space, offs_t offset)
static WRITE8_HANDLER( mainram_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
state->mainram[decrypt_offset(space, offset)] = data;
}
@@ -222,10 +222,10 @@ static READ8_HANDLER( mangled_ports_r )
/* read as two bits from each of 4 ports. For this reason, the input */
/* ports have been organized logically, and are demangled at runtime. */
/* 4 input ports each provide 8 bits of information. */
- UINT8 d7d6 = input_port_read(space->machine, "D7D6");
- UINT8 d5d4 = input_port_read(space->machine, "D5D4");
- UINT8 d3d2 = input_port_read(space->machine, "D3D2");
- UINT8 d1d0 = input_port_read(space->machine, "D1D0");
+ UINT8 d7d6 = input_port_read(space->machine(), "D7D6");
+ UINT8 d5d4 = input_port_read(space->machine(), "D5D4");
+ UINT8 d3d2 = input_port_read(space->machine(), "D3D2");
+ UINT8 d1d0 = input_port_read(space->machine(), "D1D0");
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -237,17 +237,17 @@ static READ8_HANDLER( spaceod_mangled_ports_r )
/* versus cocktail cabinets; we fix this here. The input ports are */
/* coded for cocktail mode; for upright mode, we manually shuffle the */
/* bits around. */
- UINT8 d7d6 = input_port_read(space->machine, "D7D6");
- UINT8 d5d4 = input_port_read(space->machine, "D5D4");
- UINT8 d3d2 = input_port_read(space->machine, "D3D2");
- UINT8 d1d0 = input_port_read(space->machine, "D1D0");
+ UINT8 d7d6 = input_port_read(space->machine(), "D7D6");
+ UINT8 d5d4 = input_port_read(space->machine(), "D5D4");
+ UINT8 d3d2 = input_port_read(space->machine(), "D3D2");
+ UINT8 d1d0 = input_port_read(space->machine(), "D1D0");
int shift = offset & 3;
/* tweak bits for the upright case */
UINT8 upright = d3d2 & 0x04;
if (upright)
{
- UINT8 fc = input_port_read(space->machine, "FC");
+ UINT8 fc = input_port_read(space->machine(), "FC");
d7d6 |= 0x60;
d5d4 = (d5d4 & ~0x1c) |
((~fc & 0x20) >> 3) | /* IPT_BUTTON2 */
@@ -261,8 +261,8 @@ static READ8_HANDLER( spaceod_mangled_ports_r )
static READ8_HANDLER( spaceod_port_fc_r )
{
- UINT8 upright = input_port_read(space->machine, "D3D2") & 0x04;
- UINT8 fc = input_port_read(space->machine, "FC");
+ UINT8 upright = input_port_read(space->machine(), "D3D2") & 0x04;
+ UINT8 fc = input_port_read(space->machine(), "FC");
/* tweak bits for the upright case */
if (upright)
@@ -278,8 +278,8 @@ static READ8_HANDLER( spaceod_port_fc_r )
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, (data >> 7) & 1);
- coin_counter_w(space->machine, 1, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 6) & 1);
}
@@ -293,16 +293,16 @@ static WRITE8_HANDLER( coin_count_w )
static WRITE8_DEVICE_HANDLER( sindbadm_soundport_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, data);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
static WRITE8_DEVICE_HANDLER( sindbadm_misc_w )
{
- coin_counter_w(device->machine, 0, data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x02);
// mame_printf_debug("Unknown = %02X\n", data);
}
@@ -1408,14 +1408,14 @@ ROM_END
*
*************************************/
-static void monsterb_expand_gfx(running_machine *machine, const char *region)
+static void monsterb_expand_gfx(running_machine &machine, const char *region)
{
UINT8 *temp, *dest;
int i;
/* expand the background ROMs; A11/A12 of each ROM is independently controlled via */
/* banking */
- dest = machine->region(region)->base();
+ dest = machine.region(region)->base();
temp = auto_alloc_array(machine, UINT8, 0x4000);
memcpy(temp, dest, 0x4000);
@@ -1438,7 +1438,7 @@ static void monsterb_expand_gfx(running_machine *machine, const char *region)
static DRIVER_INIT( astrob )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-0062 security chip */
state->decrypt = segag80_security(62);
@@ -1447,17 +1447,17 @@ static DRIVER_INIT( astrob )
state->background_pcb = G80_BACKGROUND_NONE;
/* install speech board */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x38, 0x38, FUNC(sega_speech_data_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x3b, 0x3b, FUNC(sega_speech_control_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x38, 0x38, FUNC(sega_speech_data_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x3b, 0x3b, FUNC(sega_speech_control_w));
/* install Astro Blaster sound board */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x3e, 0x3f, FUNC(astrob_sound_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x3e, 0x3f, FUNC(astrob_sound_w));
}
static DRIVER_INIT( 005 )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-0070 security chip */
state->decrypt = segag80_security(70);
@@ -1469,7 +1469,7 @@ static DRIVER_INIT( 005 )
static DRIVER_INIT( spaceod )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-0063 security chip */
state->decrypt = segag80_security(63);
@@ -1478,20 +1478,20 @@ static DRIVER_INIT( spaceod )
state->background_pcb = G80_BACKGROUND_SPACEOD;
/* configure ports for the background board */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x08, 0x0f, FUNC(spaceod_back_port_r), FUNC(spaceod_back_port_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x08, 0x0f, FUNC(spaceod_back_port_r), FUNC(spaceod_back_port_w));
/* install Space Odyssey sound board */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0e, 0x0f, FUNC(spaceod_sound_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0e, 0x0f, FUNC(spaceod_sound_w));
/* install our wacky mangled ports */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xfb, FUNC(spaceod_mangled_ports_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(spaceod_port_fc_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xfb, FUNC(spaceod_mangled_ports_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(spaceod_port_fc_r));
}
static DRIVER_INIT( monsterb )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-0082 security chip */
state->decrypt = segag80_security(82);
@@ -1501,14 +1501,14 @@ static DRIVER_INIT( monsterb )
monsterb_expand_gfx(machine, "gfx1");
/* install background board handlers */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(monsterb_back_port_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(monsterb_vidram_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(monsterb_back_port_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(monsterb_vidram_w));
}
static DRIVER_INIT( monster2 )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-5006 security chip */
spatter_decode(machine, "maincpu");
@@ -1519,15 +1519,15 @@ static DRIVER_INIT( monster2 )
monsterb_expand_gfx(machine, "gfx1");
/* install background board handlers */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb4, 0xb5, FUNC(pignewt_back_color_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(pignewt_back_port_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(pignewt_vidram_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb4, 0xb5, FUNC(pignewt_back_color_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(pignewt_back_port_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(pignewt_vidram_w));
}
static DRIVER_INIT( pignewt )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the 315-0063? security chip */
state->decrypt = segag80_security(63);
@@ -1537,19 +1537,19 @@ static DRIVER_INIT( pignewt )
monsterb_expand_gfx(machine, "gfx1");
/* install background board handlers */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb4, 0xb5, FUNC(pignewt_back_color_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(pignewt_back_port_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(pignewt_vidram_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb4, 0xb5, FUNC(pignewt_back_color_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xb8, 0xbd, FUNC(pignewt_back_port_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(pignewt_vidram_w));
/* install Universal sound board */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd000, 0xdfff, FUNC(sega_usb_ram_r), FUNC(usb_ram_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x3f, 0x3f, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xd000, 0xdfff, FUNC(sega_usb_ram_r), FUNC(usb_ram_w));
}
static DRIVER_INIT( sindbadm )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* configure the encrypted Z80 */
sindbadm_decode(machine, "maincpu");
@@ -1559,8 +1559,8 @@ static DRIVER_INIT( sindbadm )
state->background_pcb = G80_BACKGROUND_SINDBADM;
/* install background board handlers */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x41, FUNC(sindbadm_back_port_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(sindbadm_vidram_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x41, FUNC(sindbadm_back_port_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xffff, FUNC(sindbadm_vidram_w));
}
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index 76f3352b49e..957207b0ced 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -162,13 +162,13 @@ static INPUT_CHANGED( service_switch )
{
/* pressing the service switch sends an NMI */
if (newval)
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_START( g80v )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
+ segag80v_state *state = machine.driver_data<segag80v_state>();
/* register for save states */
state_save_register_global_array(machine, state->mult_data);
state_save_register_global(machine, state->mult_result);
@@ -180,7 +180,7 @@ static MACHINE_START( g80v )
static MACHINE_RESET( g80v )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
+ segag80v_state *state = machine.driver_data<segag80v_state>();
/* if we have a Universal Sound Board, reset it here */
if (state->has_usb)
sega_usb_reset(machine, 0x10);
@@ -196,7 +196,7 @@ static MACHINE_RESET( g80v )
static offs_t decrypt_offset(address_space *space, offs_t offset)
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
offs_t pc = cpu_get_previouspc(space->cpu);
@@ -209,7 +209,7 @@ static offs_t decrypt_offset(address_space *space, offs_t offset)
static WRITE8_HANDLER( mainram_w )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
state->mainram[decrypt_offset(space, offset)] = data;
}
@@ -217,7 +217,7 @@ static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(space, decrypt_offset(space,
static WRITE8_HANDLER( vectorram_w )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
state->vectorram[decrypt_offset(space, offset)] = data;
}
@@ -245,10 +245,10 @@ static READ8_HANDLER( mangled_ports_r )
/* read as two bits from each of 4 ports. For this reason, the input */
/* ports have been organized logically, and are demangled at runtime. */
/* 4 input ports each provide 8 bits of information. */
- UINT8 d7d6 = input_port_read(space->machine, "D7D6");
- UINT8 d5d4 = input_port_read(space->machine, "D5D4");
- UINT8 d3d2 = input_port_read(space->machine, "D3D2");
- UINT8 d1d0 = input_port_read(space->machine, "D1D0");
+ UINT8 d7d6 = input_port_read(space->machine(), "D7D6");
+ UINT8 d5d4 = input_port_read(space->machine(), "D5D4");
+ UINT8 d3d2 = input_port_read(space->machine(), "D3D2");
+ UINT8 d1d0 = input_port_read(space->machine(), "D1D0");
int shift = offset & 3;
return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift);
}
@@ -263,18 +263,18 @@ static READ8_HANDLER( mangled_ports_r )
static WRITE8_HANDLER( spinner_select_w )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
state->spinner_select = data;
}
static READ8_HANDLER( spinner_input_r )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
INT8 delta;
if (state->spinner_select & 1)
- return input_port_read(space->machine, "FC");
+ return input_port_read(space->machine(), "FC");
/*
* The values returned are always increasing. That is, regardless of whether
@@ -284,7 +284,7 @@ static READ8_HANDLER( spinner_input_r )
*/
/* I'm sure this can be further simplified ;-) BW */
- delta = input_port_read(space->machine, "SPINNER");
+ delta = input_port_read(space->machine(), "SPINNER");
if (delta != 0)
{
state->spinner_sign = (delta >> 7) & 1;
@@ -303,13 +303,13 @@ static READ8_HANDLER( spinner_input_r )
static CUSTOM_INPUT( elim4_joint_coin_r )
{
- return (input_port_read(field->port->machine, "COINS") & 0xf) != 0xf;
+ return (input_port_read(field->port->machine(), "COINS") & 0xf) != 0xf;
}
static READ8_HANDLER( elim4_input_r )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
UINT8 result = 0;
/* bit 3 enables demux */
@@ -320,11 +320,11 @@ static READ8_HANDLER( elim4_input_r )
{
case 6:
/* player 3 & 4 controls */
- result = input_port_read(space->machine, "FC");
+ result = input_port_read(space->machine(), "FC");
break;
case 7:
/* the 4 coin inputs */
- result = input_port_read(space->machine, "COINS");
+ result = input_port_read(space->machine(), "COINS");
break;
}
}
@@ -343,7 +343,7 @@ static READ8_HANDLER( elim4_input_r )
static WRITE8_HANDLER( multiply_w )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
state->mult_data[offset] = data;
if (offset == 1)
state->mult_result = state->mult_data[0] * state->mult_data[1];
@@ -352,7 +352,7 @@ static WRITE8_HANDLER( multiply_w )
static READ8_HANDLER( multiply_r )
{
- segag80v_state *state = space->machine->driver_data<segag80v_state>();
+ segag80v_state *state = space->machine().driver_data<segag80v_state>();
UINT8 result = state->mult_result;
state->mult_result >>= 8;
return result;
@@ -368,8 +368,8 @@ static READ8_HANDLER( multiply_r )
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, (data >> 7) & 1);
- coin_counter_w(space->machine, 1, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 6) & 1);
}
@@ -1311,8 +1311,8 @@ ROM_END
static DRIVER_INIT( elim2 )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* configure security */
state->decrypt = segag80_security(70);
@@ -1326,8 +1326,8 @@ static DRIVER_INIT( elim2 )
static DRIVER_INIT( elim4 )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* configure security */
state->decrypt = segag80_security(76);
@@ -1345,8 +1345,8 @@ static DRIVER_INIT( elim4 )
static DRIVER_INIT( spacfury )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* configure security */
state->decrypt = segag80_security(64);
@@ -1362,9 +1362,9 @@ static DRIVER_INIT( spacfury )
static DRIVER_INIT( zektor )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
- device_t *ay = machine->device("aysnd");
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
+ device_t *ay = machine.device("aysnd");
/* configure security */
state->decrypt = segag80_security(82);
@@ -1385,9 +1385,9 @@ static DRIVER_INIT( zektor )
static DRIVER_INIT( tacscan )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *pgmspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *pgmspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* configure security */
state->decrypt = segag80_security(76);
@@ -1405,9 +1405,9 @@ static DRIVER_INIT( tacscan )
static DRIVER_INIT( startrek )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- address_space *pgmspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ address_space *pgmspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* configure security */
state->decrypt = segag80_security(64);
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index 4887c9852e6..7259d0f6edb 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -90,19 +90,19 @@ static const ppi8255_interface hangon_ppi_intf[2] =
*
*************************************/
-static void hangon_generic_init( running_machine *machine )
+static void hangon_generic_init( running_machine &machine )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* reset the custom handlers and other pointers */
state->i8751_vblank_hook = NULL;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->subcpu = machine->device("sub");
- state->mcu = machine->device("mcu");
- state->ppi8255_1 = machine->device("ppi8255_1");
- state->ppi8255_2 = machine->device("ppi8255_2");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->subcpu = machine.device("sub");
+ state->mcu = machine.device("mcu");
+ state->ppi8255_1 = machine.device("ppi8255_1");
+ state->ppi8255_2 = machine.device("ppi8255_2");
state->save_item(NAME(state->adc_select));
}
@@ -110,7 +110,7 @@ static void hangon_generic_init( running_machine *machine )
static TIMER_CALLBACK( suspend_i8751 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
device_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
}
@@ -124,16 +124,16 @@ static TIMER_CALLBACK( suspend_i8751 )
static MACHINE_RESET( hangon )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
- fd1094_machine_init(machine->device("sub"));
+ fd1094_machine_init(machine.device("sub"));
/* reset misc components */
segaic16_tilemap_reset(machine, 0);
/* if we have a fake i8751 handler, disable the actual 8751 */
if (state->i8751_vblank_hook != NULL)
- machine->scheduler().synchronize(FUNC(suspend_i8751));
+ machine.scheduler().synchronize(FUNC(suspend_i8751));
/* reset global state */
state->adc_select = 0;
@@ -159,14 +159,14 @@ static INTERRUPT_GEN( hangon_irq )
static TIMER_CALLBACK( delayed_ppi8255_w )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
ppi8255_w(state->ppi8255_1, param >> 8, param & 0xff);
}
static READ16_HANDLER( hangon_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & 0x3020/2)
{
@@ -176,7 +176,7 @@ static READ16_HANDLER( hangon_io_r )
case 0x1000/2: /* Input ports and DIP switches */
{
static const char *const sysports[] = { "SERVICE", "COINAGE", "DSW", "UNKNOWN" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x3000/2: /* PPI @ 4C */
@@ -185,7 +185,7 @@ static READ16_HANDLER( hangon_io_r )
case 0x3020/2: /* ADC0804 data output */
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine, adcports[state->adc_select], 0);
+ return input_port_read_safe(space->machine(), adcports[state->adc_select], 0);
}
}
@@ -196,7 +196,7 @@ static READ16_HANDLER( hangon_io_r )
static WRITE16_HANDLER( hangon_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (ACCESSING_BITS_0_7)
switch (offset & 0x3020/2)
@@ -204,7 +204,7 @@ static WRITE16_HANDLER( hangon_io_w )
case 0x0000/2: /* PPI @ 4B */
/* the port C handshaking signals control the Z80 NMI, */
/* so we have to sync whenever we access this PPI */
- space->machine->scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
+ space->machine().scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
return;
case 0x3000/2: /* PPI @ 4C */
@@ -221,7 +221,7 @@ static WRITE16_HANDLER( hangon_io_w )
static READ16_HANDLER( sharrier_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & 0x0030/2)
{
@@ -231,7 +231,7 @@ static READ16_HANDLER( sharrier_io_r )
case 0x0010/2: /* Input ports and DIP switches */
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x0020/2: /* PPI @ 4C */
@@ -241,7 +241,7 @@ static READ16_HANDLER( sharrier_io_r )
case 0x0030/2: /* ADC0804 data output */
{
static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine, adcports[state->adc_select], 0);
+ return input_port_read_safe(space->machine(), adcports[state->adc_select], 0);
}
}
@@ -252,7 +252,7 @@ static READ16_HANDLER( sharrier_io_r )
static WRITE16_HANDLER( sharrier_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (ACCESSING_BITS_0_7)
switch (offset & 0x0030/2)
@@ -260,7 +260,7 @@ static WRITE16_HANDLER( sharrier_io_w )
case 0x0000/2:
/* the port C handshaking signals control the Z80 NMI, */
/* so we have to sync whenever we access this PPI */
- space->machine->scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
+ space->machine().scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
return;
case 0x0020/2: /* PPI @ 4C */
@@ -284,7 +284,7 @@ static WRITE16_HANDLER( sharrier_io_w )
static WRITE8_DEVICE_HANDLER( sound_latch_w )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
soundlatch_w(space, offset, data);
}
@@ -300,20 +300,20 @@ static WRITE8_DEVICE_HANDLER( video_lamps_w )
/* D2 : LAMP1 */
/* D1 : COIN2 */
/* D0 : COIN1 */
- segaic16_tilemap_set_flip(device->machine, 0, data & 0x80);
- segaic16_sprites_set_flip(device->machine, 0, data & 0x80);
- segaic16_sprites_set_shadow(device->machine, 0, ~data & 0x40);
- segaic16_set_display_enable(device->machine, data & 0x10);
- set_led_status(device->machine, 1, data & 0x08);
- set_led_status(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x01);
+ segaic16_tilemap_set_flip(device->machine(), 0, data & 0x80);
+ segaic16_sprites_set_flip(device->machine(), 0, data & 0x80);
+ segaic16_sprites_set_shadow(device->machine(), 0, ~data & 0x40);
+ segaic16_set_display_enable(device->machine(), data & 0x10);
+ set_led_status(device->machine(), 1, data & 0x08);
+ set_led_status(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x01);
}
static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
/* Port C : Tilemap origin and audio mute */
/* D7 : Port A handshaking signal /OBF */
@@ -325,15 +325,15 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
/* D1 : SCONT0 - Tilemap origin bit 0 */
/* D0 : MUTE (1= audio on, 0= audio off) */
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
- segaic16_tilemap_set_colscroll(device->machine, 0, ~data & 0x04);
- segaic16_tilemap_set_rowscroll(device->machine, 0, ~data & 0x02);
- device->machine->sound().system_enable(data & 0x01);
+ segaic16_tilemap_set_colscroll(device->machine(), 0, ~data & 0x04);
+ segaic16_tilemap_set_rowscroll(device->machine(), 0, ~data & 0x02);
+ device->machine().sound().system_enable(data & 0x01);
}
static WRITE8_DEVICE_HANDLER( sub_control_adc_w )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
/* Port A : S.CPU control and ADC channel select */
/* D6 : INTR line on second CPU */
@@ -371,11 +371,11 @@ static READ8_DEVICE_HANDLER( adc_status_r )
static INTERRUPT_GEN( i8751_main_cpu_vblank )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
/* if we have a fake 8751 handler, call it on VBLANK */
if (state->i8751_vblank_hook != NULL)
- (*state->i8751_vblank_hook)(device->machine);
+ (*state->i8751_vblank_hook)(device->machine());
irq4_line_hold(device);
}
@@ -387,7 +387,7 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
*
*************************************/
-static void sharrier_i8751_sim(running_machine *machine)
+static void sharrier_i8751_sim(running_machine &machine)
{
workram[0x492/2] = (input_port_read(machine, "ADC0") << 8) | input_port_read(machine, "ADC1");
}
@@ -402,14 +402,14 @@ static void sharrier_i8751_sim(running_machine *machine)
static void sound_irq(device_t *device, int irq)
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
device_set_input_line(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_HANDLER( sound_data_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
/* assert ACK */
ppi8255_set_port_c(state->ppi8255_1, 0x00);
@@ -1840,7 +1840,7 @@ static DRIVER_INIT( hangon )
static DRIVER_INIT( sharrier )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
hangon_generic_init(machine);
state->i8751_vblank_hook = sharrier_i8751_sim;
@@ -1856,8 +1856,8 @@ static DRIVER_INIT( enduror )
static DRIVER_INIT( endurobl )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
@@ -1870,8 +1870,8 @@ static DRIVER_INIT( endurobl )
static DRIVER_INIT( endurob2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
UINT16 *decrypt = auto_alloc_array(machine, UINT16, 0x40000/2);
hangon_generic_init(machine);
diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c
index 6a61b780dce..f41d448163e 100644
--- a/src/mame/drivers/segald.c
+++ b/src/mame/drivers/segald.c
@@ -44,9 +44,9 @@ public:
};
/* VIDEO GOODS */
-static void astron_draw_characters(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void astron_draw_characters(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- segald_state *state = machine->driver_data<segald_state>();
+ segald_state *state = machine.driver_data<segald_state>();
UINT8 characterX, characterY;
for (characterX = 0; characterX < 32; characterX++)
@@ -54,13 +54,13 @@ static void astron_draw_characters(running_machine *machine, bitmap_t *bitmap,co
for (characterY = 0; characterY < 32; characterY++)
{
int current_screen_character = (characterY*32) + characterX;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], state->fix_RAM[current_screen_character],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->fix_RAM[current_screen_character],
1, 0, 0, characterX*8, characterY*8, 0);
}
}
}
-static void astron_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void astron_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Heisted from Daphne */
const UINT8 SPR_Y_TOP = 0;
@@ -72,7 +72,7 @@ static void astron_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
/* const UINT8 SPR_GFXOFS_LO = 6;*/
/* const UINT8 SPR_GFXOFS_HI = 7;*/
- segald_state *state = machine->driver_data<segald_state>();
+ segald_state *state = machine.driver_data<segald_state>();
int sx,sy;
int spr_number;
int spr_base;
@@ -93,8 +93,8 @@ static SCREEN_UPDATE( astron )
{
bitmap_fill(bitmap, cliprect, 0);
- astron_draw_characters(screen->machine, bitmap, cliprect);
- astron_draw_sprites(screen->machine, bitmap, cliprect);
+ astron_draw_characters(screen->machine(), bitmap, cliprect);
+ astron_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -105,7 +105,7 @@ static SCREEN_UPDATE( astron )
/* READS */
static READ8_HANDLER( astron_DISC_read )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
if (state->nmi_enable)
state->ldv1000_input_latch = laserdisc_data_r(state->laserdisc);
@@ -117,7 +117,7 @@ static READ8_HANDLER( astron_DISC_read )
static READ8_HANDLER( astron_OUT_read )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", state->out_RAM[offset], offset, cpu_get_pc(space->cpu));
return state->out_RAM[offset];
@@ -125,7 +125,7 @@ static READ8_HANDLER( astron_OUT_read )
static READ8_HANDLER( astron_OBJ_read )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", state->obj_RAM[offset], offset, cpu_get_pc(space->cpu));
return state->obj_RAM[offset];
@@ -133,7 +133,7 @@ static READ8_HANDLER( astron_OBJ_read )
static READ8_HANDLER( astron_COLOR_read )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", state->color_RAM[offset], offset, cpu_get_pc(space->cpu));
return state->color_RAM[offset];
@@ -143,7 +143,7 @@ static READ8_HANDLER( astron_COLOR_read )
/* WRITES */
static WRITE8_HANDLER( astron_DISC_write )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
logerror("DISC write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(space->cpu));
@@ -155,7 +155,7 @@ static WRITE8_HANDLER( astron_DISC_write )
static WRITE8_HANDLER( astron_OUT_write )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
logerror("OUT write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(space->cpu));
@@ -193,7 +193,7 @@ static WRITE8_HANDLER( astron_OUT_write )
static WRITE8_HANDLER( astron_OBJ_write )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
state->obj_RAM[offset] = data;
logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(space->cpu));
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( astron_OBJ_write )
static WRITE8_HANDLER( astron_COLOR_write )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
UINT8 r, g, b, a;
UINT8 highBits, lowBits;
const UINT8 palIndex = offset >> 1;
@@ -219,13 +219,13 @@ static WRITE8_HANDLER( astron_COLOR_write )
b = (highBits & 0x0f);
a = (highBits & 0x80) ? 0 : 255;
- palette_set_color(space->machine, palIndex, MAKE_ARGB(a, r, g, b));
+ palette_set_color(space->machine(), palIndex, MAKE_ARGB(a, r, g, b));
logerror("COLOR write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(space->cpu));
}
static WRITE8_HANDLER( astron_FIX_write )
{
- segald_state *state = space->machine->driver_data<segald_state>();
+ segald_state *state = space->machine().driver_data<segald_state>();
state->fix_RAM[offset] = data;
/* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(space->cpu)); */
@@ -234,7 +234,7 @@ static WRITE8_HANDLER( astron_FIX_write )
static WRITE8_HANDLER( astron_io_bankswitch_w )
{
logerror("Banking 0x%x\n", data);
- memory_set_bank(space->machine, "bank1", data & 0xff);
+ memory_set_bank(space->machine(), "bank1", data & 0xff);
}
@@ -356,9 +356,9 @@ GFXDECODE_END
static MACHINE_START( astron )
{
- segald_state *state = machine->driver_data<segald_state>();
+ segald_state *state = machine.driver_data<segald_state>();
- state->laserdisc = machine->device("laserdisc");
+ state->laserdisc = machine.device("laserdisc");
}
@@ -596,7 +596,7 @@ ROM_END
static DRIVER_INIT( astron )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x8000], 0x4000);
}
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index 6df606d63f9..33c2b9cbe25 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -366,22 +366,22 @@ static const segaic16_memory_map_entry outrun_info[] =
static TIMER_CALLBACK( delayed_sound_data_w )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, param);
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, ASSERT_LINE);
}
-static void sound_data_w(running_machine *machine, UINT8 data)
+static void sound_data_w(running_machine &machine, UINT8 data)
{
- machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ machine.scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
static READ8_HANDLER( sound_data_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space, offset);
@@ -389,9 +389,9 @@ static READ8_HANDLER( sound_data_r )
-static void outrun_generic_init(running_machine *machine)
+static void outrun_generic_init(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* allocate memory for regions not automatically assigned */
segaic16_spriteram_0 = auto_alloc_array(machine, UINT16, 0x01000/2);
@@ -401,7 +401,7 @@ static void outrun_generic_init(running_machine *machine)
workram = auto_alloc_array(machine, UINT16, 0x08000/2);
/* init the memory mapper */
- segaic16_memory_mapper_init(machine->device("maincpu"), outrun_info, sound_data_w, NULL);
+ segaic16_memory_mapper_init(machine.device("maincpu"), outrun_info, sound_data_w, NULL);
/* init the FD1094 */
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
@@ -411,12 +411,12 @@ static void outrun_generic_init(running_machine *machine)
state->custom_io_w = NULL;
state->custom_map = NULL;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->subcpu = machine->device("sub");
- state->ppi8255 = machine->device("ppi8255");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->subcpu = machine.device("sub");
+ state->ppi8255 = machine.device("ppi8255");
- nvram_device *nvram = machine->device<nvram_device>("nvram");
+ nvram_device *nvram = machine.device<nvram_device>("nvram");
if (nvram != NULL)
nvram->set_base(workram, 0x8000);
@@ -438,22 +438,22 @@ static void outrun_generic_init(running_machine *machine)
*
*************************************/
-static void update_main_irqs(running_machine *machine)
+static void update_main_irqs(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
device_set_input_line(state->maincpu, 2, state->irq2_state ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->maincpu, 4, state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->maincpu, 6, state->vblank_irq_state && state->irq2_state ? ASSERT_LINE : CLEAR_LINE);
if (state->vblank_irq_state || state->irq2_state)
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static TIMER_CALLBACK( irq2_gen )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* set the IRQ2 line */
state->irq2_state = 1;
@@ -463,7 +463,7 @@ static TIMER_CALLBACK( irq2_gen )
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- segas1x_state *state = timer.machine->driver_data<segas1x_state>();
+ segas1x_state *state = timer.machine().driver_data<segas1x_state>();
int scanline = param;
int next_scanline = scanline;
@@ -474,7 +474,7 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
case 65:
case 129:
case 193:
- timer.machine->scheduler().timer_set(timer.machine->primary_screen->time_until_pos(scanline, timer.machine->primary_screen->visible_area().max_x + 1), FUNC(irq2_gen));
+ timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(scanline, timer.machine().primary_screen->visible_area().max_x + 1), FUNC(irq2_gen));
next_scanline = scanline + 1;
break;
@@ -502,10 +502,10 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
}
/* update IRQs on the main CPU */
- update_main_irqs(timer.machine);
+ update_main_irqs(timer.machine());
/* come back at the next targeted scanline */
- timer.adjust(timer.machine->primary_screen->time_until_pos(next_scanline), next_scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(next_scanline), next_scanline);
}
@@ -518,15 +518,15 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
static void outrun_reset(device_t *device)
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, PULSE_LINE);
}
static MACHINE_RESET( outrun )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
- fd1094_machine_init(machine->device("maincpu"));
+ segas1x_state *state = machine.driver_data<segas1x_state>();
+ fd1094_machine_init(machine.device("maincpu"));
/* reset misc components */
segaic16_memory_mapper_reset(machine);
@@ -535,10 +535,10 @@ static MACHINE_RESET( outrun )
segaic16_tilemap_reset(machine, 0);
/* hook the RESET line, which resets CPU #1 */
- m68k_set_reset_callback(machine->device("maincpu"), outrun_reset);
+ m68k_set_reset_callback(machine.device("maincpu"), outrun_reset);
/* start timers to track interrupts */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(223), 223);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(223), 223);
}
@@ -549,18 +549,18 @@ static MACHINE_RESET( outrun )
*
*************************************/
-static void log_unknown_ppi_read( running_machine *machine, unsigned port )
+static void log_unknown_ppi_read( running_machine &machine, unsigned port )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
static const char ports[] = "ABC";
logerror("%06X:read from 8255 port %c\n", cpu_get_pc(state->maincpu), ports[port]);
}
-static void log_unknown_ppi_write( running_machine *machine, unsigned port, UINT8 data )
+static void log_unknown_ppi_write( running_machine &machine, unsigned port, UINT8 data )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
static const char ports[] = "ABC";
logerror("%06X:write %02X to 8255 port %c\n", cpu_get_pc(state->maincpu), data, ports[port]);
@@ -569,40 +569,40 @@ static void log_unknown_ppi_write( running_machine *machine, unsigned port, UINT
static READ8_DEVICE_HANDLER( unknown_porta_r )
{
- log_unknown_ppi_read(device->machine, 0);
+ log_unknown_ppi_read(device->machine(), 0);
return 0;
}
static READ8_DEVICE_HANDLER( unknown_portb_r )
{
- log_unknown_ppi_read(device->machine, 1);
+ log_unknown_ppi_read(device->machine(), 1);
return 0;
}
static READ8_DEVICE_HANDLER( unknown_portc_r )
{
- log_unknown_ppi_read(device->machine, 2);
+ log_unknown_ppi_read(device->machine(), 2);
return 0;
}
static WRITE8_DEVICE_HANDLER( unknown_porta_w )
{
- log_unknown_ppi_write(device->machine, 0, data);
+ log_unknown_ppi_write(device->machine(), 0, data);
}
static WRITE8_DEVICE_HANDLER( unknown_portb_w )
{
- log_unknown_ppi_write(device->machine, 1, data);
+ log_unknown_ppi_write(device->machine(), 1, data);
}
static WRITE8_DEVICE_HANDLER( video_control_w )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
/* Output port:
D7: SG1 -- connects to sprite chip
@@ -612,7 +612,7 @@ static WRITE8_DEVICE_HANDLER( video_control_w )
D1: (CONT) - affects sprite hardware
D0: Sound section reset (1= normal operation, 0= reset)
*/
- segaic16_set_display_enable(device->machine, data & 0x20);
+ segaic16_set_display_enable(device->machine(), data & 0x20);
state->adc_select = (data >> 2) & 7;
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -627,7 +627,7 @@ static WRITE8_DEVICE_HANDLER( video_control_w )
static READ16_HANDLER( misc_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_r)
return state->custom_io_r(space, offset, mem_mask);
@@ -638,7 +638,7 @@ static READ16_HANDLER( misc_io_r )
static WRITE16_HANDLER( misc_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_w)
{
@@ -651,7 +651,7 @@ static WRITE16_HANDLER( misc_io_w )
static READ16_HANDLER( outrun_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x7f/2;
switch (offset & 0x70/2)
@@ -662,13 +662,13 @@ static READ16_HANDLER( outrun_custom_io_r )
case 0x10/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x30/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
- return input_port_read_safe(space->machine, ports[state->adc_select], 0x0010);
+ return input_port_read_safe(space->machine(), ports[state->adc_select], 0x0010);
}
case 0x60/2:
@@ -682,7 +682,7 @@ static READ16_HANDLER( outrun_custom_io_r )
static WRITE16_HANDLER( outrun_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x7f/2;
switch (offset & 0x70/2)
@@ -699,7 +699,7 @@ static WRITE16_HANDLER( outrun_custom_io_w )
D7: /MUTE
D6-D0: unknown
*/
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
}
return;
@@ -721,7 +721,7 @@ static WRITE16_HANDLER( outrun_custom_io_w )
static READ16_HANDLER( shangon_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x303f/2;
switch (offset)
@@ -732,13 +732,13 @@ static READ16_HANDLER( shangon_custom_io_r )
case 0x1006/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x3020/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- return input_port_read_safe(space->machine, ports[state->adc_select], 0x0010);
+ return input_port_read_safe(space->machine(), ports[state->adc_select], 0x0010);
}
}
logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
@@ -748,7 +748,7 @@ static READ16_HANDLER( shangon_custom_io_r )
static WRITE16_HANDLER( shangon_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x303f/2;
switch (offset)
@@ -759,7 +759,7 @@ static WRITE16_HANDLER( shangon_custom_io_w )
D5: Screen display
*/
state->adc_select = (data >> 6) & 3;
- segaic16_set_display_enable(space->machine, (data >> 5) & 1);
+ segaic16_set_display_enable(space->machine(), (data >> 5) & 1);
return;
case 0x0020/2:
@@ -2135,7 +2135,7 @@ ROM_END
static DRIVER_INIT( outrun )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
outrun_generic_init(machine);
state->custom_io_r = outrun_custom_io_r;
@@ -2145,7 +2145,7 @@ static DRIVER_INIT( outrun )
static DRIVER_INIT( outrunb )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
static const UINT8 memory_map[] = { 0x02,0x00,0x0d,0x10,0x00,0x12,0x0c,0x13,0x08,0x14,0x0f,0x20,0x00,0x00,0x00,0x00 };
UINT16 *word;
UINT8 *byte;
@@ -2157,22 +2157,22 @@ static DRIVER_INIT( outrunb )
state->custom_io_w = outrun_custom_io_w;
/* main CPU: swap bits 11,12 and 6,7 */
- word = (UINT16 *)machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes() / 2;
+ word = (UINT16 *)machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 15,14,11,12,13,10,9,8,6,7,5,4,3,2,1,0);
/* sub CPU: swap bits 14,15 and 2,3 */
- word = (UINT16 *)machine->region("sub")->base();
- length = machine->region("sub")->bytes() / 2;
+ word = (UINT16 *)machine.region("sub")->base();
+ length = machine.region("sub")->bytes() / 2;
for (i = 0; i < length; i++)
word[i] = BITSWAP16(word[i], 14,15,13,12,11,10,9,8,7,6,5,4,2,3,1,0);
/* road gfx */
/* rom a-2.bin: swap bits 6,7 */
/* rom a-3.bin: swap bits 5,6 */
- byte = machine->region("gfx3")->base();
- length = machine->region("gfx3")->bytes() / 2;
+ byte = machine.region("gfx3")->base();
+ length = machine.region("gfx3")->bytes() / 2;
for (i = 0; i < length; i++)
{
byte[i] = BITSWAP8(byte[i], 6,7,5,4,3,2,1,0);
@@ -2180,8 +2180,8 @@ static DRIVER_INIT( outrunb )
}
/* Z80 code: swap bits 5,6 */
- byte = machine->region("soundcpu")->base();
- length = machine->region("soundcpu")->bytes();
+ byte = machine.region("soundcpu")->base();
+ length = machine.region("soundcpu")->bytes();
for (i = 0; i < length; i++)
byte[i] = BITSWAP8(byte[i], 7,5,6,4,3,2,1,0);
}
@@ -2189,7 +2189,7 @@ static DRIVER_INIT( outrunb )
static DRIVER_INIT( shangon )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
outrun_generic_init(machine);
state->custom_io_r = shangon_custom_io_r;
@@ -2199,7 +2199,7 @@ static DRIVER_INIT( shangon )
static DRIVER_INIT( shangon3 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
outrun_generic_init(machine);
fd1089b_decrypt(machine);
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index 43d8f8d773c..d9cf1c043a2 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -206,9 +206,9 @@ static const ppi8255_interface single_ppi_intf =
*
*************************************/
-static void system16a_generic_init(running_machine *machine)
+static void system16a_generic_init(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* init the FD1094 */
fd1094_driver_init(machine, "maincpu", NULL);
@@ -219,18 +219,18 @@ static void system16a_generic_init(running_machine *machine)
state->lamp_changed_w = NULL;
state->i8751_vblank_hook = NULL;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->mcu = machine->device("mcu");
- state->ymsnd = machine->device("ymsnd");
- state->ppi8255 = machine->device("ppi8255");
- state->n7751 = machine->device("n7751");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->mcu = machine.device("mcu");
+ state->ymsnd = machine.device("ymsnd");
+ state->ppi8255 = machine.device("ppi8255");
+ state->n7751 = machine.device("n7751");
}
static TIMER_CALLBACK( suspend_i8751 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
device_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
}
@@ -244,7 +244,7 @@ static TIMER_CALLBACK( suspend_i8751 )
static MACHINE_START( system16a )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
state->save_item(NAME(state->video_control));
state->save_item(NAME(state->mcu_control));
@@ -259,13 +259,13 @@ static MACHINE_START( system16a )
static MACHINE_RESET( system16a )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
- fd1094_machine_init(machine->device("maincpu"));
+ fd1094_machine_init(machine.device("maincpu"));
/* if we have a fake i8751 handler, disable the actual 8751 */
if (state->i8751_vblank_hook != NULL)
- machine->scheduler().synchronize(FUNC(suspend_i8751));
+ machine.scheduler().synchronize(FUNC(suspend_i8751));
state->mcu_control = 0x00;
}
@@ -280,14 +280,14 @@ static MACHINE_RESET( system16a )
static TIMER_CALLBACK( delayed_ppi8255_w )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
ppi8255_w(state->ppi8255, param >> 8, param & 0xff);
}
static READ16_HANDLER( standard_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x3fff/2;
switch (offset & (0x3000/2))
{
@@ -297,11 +297,11 @@ static READ16_HANDLER( standard_io_r )
case 0x1000/2:
{
static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x2000/2:
- return input_port_read(space->machine, (offset & 1) ? "DSW2" : "DSW1");
+ return input_port_read(space->machine(), (offset & 1) ? "DSW2" : "DSW1");
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
return 0xffff;
@@ -317,7 +317,7 @@ static WRITE16_HANDLER( standard_io_w )
/* the port C handshaking signals control the Z80 NMI, */
/* so we have to sync whenever we access this PPI */
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
+ space->machine().scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
return;
}
logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(space->cpu), offset * 2, data, mem_mask);
@@ -326,7 +326,7 @@ static WRITE16_HANDLER( standard_io_w )
static READ16_HANDLER( misc_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_r)
return (*state->custom_io_r)(space, offset, mem_mask);
@@ -337,7 +337,7 @@ static READ16_HANDLER( misc_io_r )
static WRITE16_HANDLER( misc_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_w)
(*state->custom_io_w)(space, offset, data, mem_mask);
@@ -368,23 +368,23 @@ static WRITE8_DEVICE_HANDLER( video_control_w )
D0 : Coin meter #1
*/
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
if (((state->video_control ^ data) & 0x0c) && state->lamp_changed_w)
- (*state->lamp_changed_w)(device->machine, state->video_control ^ data, data);
+ (*state->lamp_changed_w)(device->machine(), state->video_control ^ data, data);
state->video_control = data;
- segaic16_tilemap_set_flip(device->machine, 0, data & 0x80);
- segaic16_sprites_set_flip(device->machine, 0, data & 0x80);
+ segaic16_tilemap_set_flip(device->machine(), 0, data & 0x80);
+ segaic16_sprites_set_flip(device->machine(), 0, data & 0x80);
if (state->mcu != NULL)
device_set_input_line(state->mcu, MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
- segaic16_set_display_enable(device->machine, data & 0x10);
- set_led_status(device->machine, 1, data & 0x08);
- set_led_status(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x01);
+ segaic16_set_display_enable(device->machine(), data & 0x10);
+ set_led_status(device->machine(), 1, data & 0x08);
+ set_led_status(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x01);
}
@@ -411,11 +411,11 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
0= Sound is disabled
1= sound is enabled
*/
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
- segaic16_tilemap_set_colscroll(device->machine, 0, ~data & 0x04);
- segaic16_tilemap_set_rowscroll(device->machine, 0, ~data & 0x02);
+ segaic16_tilemap_set_colscroll(device->machine(), 0, ~data & 0x04);
+ segaic16_tilemap_set_rowscroll(device->machine(), 0, ~data & 0x02);
}
@@ -428,7 +428,7 @@ static WRITE8_DEVICE_HANDLER( tilemap_sound_w )
static READ8_HANDLER( sound_data_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
/* assert ACK */
ppi8255_set_port_c(state->ppi8255, 0x00);
@@ -448,9 +448,9 @@ static WRITE8_HANDLER( n7751_command_w )
D1 = /CS for ROM 0
D0 = A14 line to ROMs
*/
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
- int numroms = space->machine->region("n7751data")->bytes() / 0x8000;
+ int numroms = space->machine().region("n7751data")->bytes() / 0x8000;
state->n7751_rom_address &= 0x3fff;
state->n7751_rom_address |= (data & 0x01) << 14;
if (!(data & 0x02) && numroms >= 1) state->n7751_rom_address |= 0x00000;
@@ -469,11 +469,11 @@ static WRITE8_DEVICE_HANDLER( n7751_control_w )
D1 = /RESET line on 7751
D0 = /IRQ line on 7751
*/
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
device_set_input_line(state->n7751, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
device_set_input_line(state->n7751, 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
@@ -483,7 +483,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_offset_w )
/* P5 - address lines 4-7 */
/* P6 - address lines 8-11 */
/* P7 - address lines 12-13 */
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
int mask = (0xf << (4 * offset)) & 0x3fff;
int newdata = (data << (4 * offset)) & mask;
@@ -494,8 +494,8 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_offset_w )
static READ8_HANDLER( n7751_rom_r )
{
/* read from BUS */
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
- return space->machine->region("n7751data")->base()[state->n7751_rom_address];
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
+ return space->machine().region("n7751data")->base()[state->n7751_rom_address];
}
@@ -503,7 +503,7 @@ static READ8_DEVICE_HANDLER( n7751_p2_r )
{
/* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
/* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
return 0x80 | ((state->n7751_command & 0x07) << 4) | (i8243_p2_r(device, offset) & 0x0f);
}
@@ -535,10 +535,10 @@ static READ8_HANDLER( n7751_t1_r )
static INTERRUPT_GEN( i8751_main_cpu_vblank )
{
/* if we have a fake 8751 handler, call it on VBLANK */
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
if (state->i8751_vblank_hook != NULL)
- (*state->i8751_vblank_hook)(device->machine);
+ (*state->i8751_vblank_hook)(device->machine());
}
@@ -549,9 +549,9 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
*
*************************************/
-static void dumpmtmt_i8751_sim(running_machine *machine)
+static void dumpmtmt_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
UINT8 flag = workram[0x200/2] >> 8;
UINT8 tick = workram[0x200/2] & 0xff;
UINT8 sec = workram[0x202/2] >> 8;
@@ -595,9 +595,9 @@ static void dumpmtmt_i8751_sim(running_machine *machine)
}
-static void quartet_i8751_sim(running_machine *machine)
+static void quartet_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
/* signal a VBLANK to the main CPU */
@@ -622,7 +622,7 @@ static void quartet_i8751_sim(running_machine *machine)
static READ16_HANDLER( aceattaa_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
@@ -633,25 +633,25 @@ static READ16_HANDLER( aceattaa_custom_io_r )
{
switch (state->video_control & 0xf)
{
- case 0x00: return input_port_read(space->machine, "P1");
- case 0x04: return input_port_read(space->machine, "ANALOGX1");
- case 0x08: return input_port_read(space->machine, "ANALOGY1");
- case 0x0c: return input_port_read(space->machine, "UNUSED");
+ case 0x00: return input_port_read(space->machine(), "P1");
+ case 0x04: return input_port_read(space->machine(), "ANALOGX1");
+ case 0x08: return input_port_read(space->machine(), "ANALOGY1");
+ case 0x0c: return input_port_read(space->machine(), "UNUSED");
}
break;
}
case 0x02:
- return input_port_read(space->machine, "DIAL1") | (input_port_read(space->machine, "DIAL2") << 4);
+ return input_port_read(space->machine(), "DIAL1") | (input_port_read(space->machine(), "DIAL2") << 4);
case 0x03:
{
switch (state->video_control & 0xf)
{
- case 0x00: return input_port_read(space->machine, "P2");
- case 0x04: return input_port_read(space->machine, "ANALOGX2");
- case 0x08: return input_port_read(space->machine, "ANALOGY2");
- case 0x0c: return input_port_read(space->machine, "POW2");
+ case 0x00: return input_port_read(space->machine(), "P2");
+ case 0x04: return input_port_read(space->machine(), "ANALOGX2");
+ case 0x08: return input_port_read(space->machine(), "ANALOGY2");
+ case 0x0c: return input_port_read(space->machine(), "POW2");
}
break;
}
@@ -672,7 +672,7 @@ static READ16_HANDLER( aceattaa_custom_io_r )
static READ16_HANDLER( mjleague_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
@@ -683,9 +683,9 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* upper bit of the trackball controls */
case 0:
{
- UINT8 buttons = input_port_read(space->machine, "SERVICE");
- UINT8 analog1 = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- UINT8 analog2 = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = input_port_read(space->machine(), "SERVICE");
+ UINT8 analog1 = input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ UINT8 analog2 = input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
buttons |= (analog1 & 0x80) >> 1;
buttons |= (analog2 & 0x80);
return buttons;
@@ -695,8 +695,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 1 select switch mapped to bit 7 */
case 1:
{
- UINT8 buttons = input_port_read(space->machine, "BUTTONS1");
- UINT8 analog = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ UINT8 buttons = input_port_read(space->machine(), "BUTTONS1");
+ UINT8 analog = input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
return (buttons & 0x80) | (analog & 0x7f);
}
@@ -704,11 +704,11 @@ static READ16_HANDLER( mjleague_custom_io_r )
case 2:
{
if (state->video_control & 4)
- return (input_port_read(space->machine, "ANALOGZ1") >> 4) | (input_port_read(space->machine, "ANALOGZ2") & 0xf0);
+ return (input_port_read(space->machine(), "ANALOGZ1") >> 4) | (input_port_read(space->machine(), "ANALOGZ2") & 0xf0);
else
{
- UINT8 buttons1 = input_port_read(space->machine, "BUTTONS1");
- UINT8 buttons2 = input_port_read(space->machine, "BUTTONS2");
+ UINT8 buttons1 = input_port_read(space->machine(), "BUTTONS1");
+ UINT8 buttons2 = input_port_read(space->machine(), "BUTTONS2");
if (!(buttons1 & 0x01))
state->last_buttons1 = 0;
@@ -736,8 +736,8 @@ static READ16_HANDLER( mjleague_custom_io_r )
/* player 2 select switch mapped to bit 7 */
case 3:
{
- UINT8 buttons = input_port_read(space->machine, "BUTTONS2");
- UINT8 analog = input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ UINT8 buttons = input_port_read(space->machine(), "BUTTONS2");
+ UINT8 analog = input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
return (buttons & 0x80) | (analog & 0x7f);
}
}
@@ -756,7 +756,7 @@ static READ16_HANDLER( mjleague_custom_io_r )
static READ16_HANDLER( passsht16a_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
@@ -770,10 +770,10 @@ static READ16_HANDLER( passsht16a_custom_io_r )
case 1:
switch ((state->read_port++) & 3)
{
- case 0: return input_port_read(space->machine, "P1");
- case 1: return input_port_read(space->machine, "P2");
- case 2: return input_port_read(space->machine, "P3");
- case 3: return input_port_read(space->machine, "P4");
+ case 0: return input_port_read(space->machine(), "P1");
+ case 1: return input_port_read(space->machine(), "P2");
+ case 2: return input_port_read(space->machine(), "P3");
+ case 3: return input_port_read(space->machine(), "P4");
}
break;
@@ -793,15 +793,15 @@ static READ16_HANDLER( passsht16a_custom_io_r )
static READ16_HANDLER( sdi_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
case 0x1000/2:
switch (offset & 3)
{
- case 1: return input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
- case 3: return input_port_read(space->machine, (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
+ case 1: return input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY1" : "ANALOGX1");
+ case 3: return input_port_read(space->machine(), (state->video_control & 4) ? "ANALOGY2" : "ANALOGX2");
}
break;
}
@@ -818,7 +818,7 @@ static READ16_HANDLER( sdi_custom_io_r )
static READ16_HANDLER( sjryuko_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" };
switch (offset & (0x3000/2))
@@ -827,12 +827,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff) != 0xff)
+ if (input_port_read_safe(space->machine(), portname[state->mj_input_num], 0xff) != 0xff)
return 0xff & ~(1 << state->mj_input_num);
return 0xff;
case 2:
- return input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff);
+ return input_port_read_safe(space->machine(), portname[state->mj_input_num], 0xff);
}
break;
}
@@ -840,9 +840,9 @@ static READ16_HANDLER( sjryuko_custom_io_r )
}
-static void sjryuko_lamp_changed_w(running_machine *machine, UINT8 changed, UINT8 newval)
+static void sjryuko_lamp_changed_w(running_machine &machine, UINT8 changed, UINT8 newval)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
if ((changed & 4) && (newval & 4))
state->mj_input_num = (state->mj_input_num + 1) % 6;
@@ -856,23 +856,23 @@ static void sjryuko_lamp_changed_w(running_machine *machine, UINT8 changed, UINT
*
*************************************/
-INLINE UINT8 maincpu_byte_r(running_machine *machine, offs_t offset)
+INLINE UINT8 maincpu_byte_r(running_machine &machine, offs_t offset)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
return downcast<cpu_device *>(state->maincpu)->space(AS_PROGRAM)->read_byte(offset);
}
-INLINE void maincpu_byte_w(running_machine *machine, offs_t offset, UINT8 data)
+INLINE void maincpu_byte_w(running_machine &machine, offs_t offset, UINT8 data)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
downcast<cpu_device *>(state->maincpu)->space(AS_PROGRAM)->write_byte(offset, data);
}
static WRITE8_HANDLER( mcu_control_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
int irqline;
/* if we have a fake i8751 handler, ignore writes by the actual 8751 */
@@ -884,10 +884,10 @@ static WRITE8_HANDLER( mcu_control_w )
device_set_input_line(state->maincpu, irqline, ((~data & 7) == irqline) ? ASSERT_LINE : CLEAR_LINE);
if (data & 0x40)
- segaic16_set_display_enable(space->machine, 1);
+ segaic16_set_display_enable(space->machine(), 1);
if ((state->mcu_control ^ data) & 0x40)
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
state->mcu_control = data;
}
@@ -903,15 +903,15 @@ static WRITE8_HANDLER( mcu_io_w )
1.11 0... = checksum #1
1.11 1... = checksum #2
*/
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch ((state->mcu_control >> 3) & 7)
{
case 0:
if (offset >= 0x4000 && offset < 0x8000)
- maincpu_byte_w(space->machine, 0xc70001 ^ (offset & 0x3fff), data);
+ maincpu_byte_w(space->machine(), 0xc70001 ^ (offset & 0x3fff), data);
else if (offset >= 0x8000 && offset < 0xc000)
- maincpu_byte_w(space->machine, 0xc40001 ^ (offset & 0x3fff), data);
+ maincpu_byte_w(space->machine(), 0xc40001 ^ (offset & 0x3fff), data);
else
logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
cpu_get_pc(space->cpu), state->mcu_control, offset, data);
@@ -919,14 +919,14 @@ static WRITE8_HANDLER( mcu_io_w )
case 1:
if (offset >= 0x8000 && offset < 0x9000)
- maincpu_byte_w(space->machine, 0x410001 ^ (offset & 0xfff), data);
+ maincpu_byte_w(space->machine(), 0x410001 ^ (offset & 0xfff), data);
else
logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
cpu_get_pc(space->cpu), state->mcu_control, offset, data);
break;
case 3:
- maincpu_byte_w(space->machine, 0x840001 ^ offset, data);
+ maincpu_byte_w(space->machine(), 0x840001 ^ offset, data);
break;
case 5:
@@ -944,7 +944,7 @@ static WRITE8_HANDLER( mcu_io_w )
static READ8_HANDLER( mcu_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch ((state->mcu_control >> 3) & 7)
{
@@ -952,29 +952,29 @@ static READ8_HANDLER( mcu_io_r )
if (offset >= 0x0000 && offset < 0x3fff)
return watchdog_reset_r(space, 0); /* unsure about this one */
else if (offset >= 0x4000 && offset < 0x8000)
- return maincpu_byte_r(space->machine, 0xc70001 ^ (offset & 0x3fff));
+ return maincpu_byte_r(space->machine(), 0xc70001 ^ (offset & 0x3fff));
else if (offset >= 0x8000 && offset < 0xc000)
- return maincpu_byte_r(space->machine, 0xc40001 ^ (offset & 0x3fff));
+ return maincpu_byte_r(space->machine(), 0xc40001 ^ (offset & 0x3fff));
logerror("%03X: MCU movx read mode %02X offset %04X\n",
cpu_get_pc(space->cpu), state->mcu_control, offset);
return 0xff;
case 1:
if (offset >= 0x8000 && offset < 0x9000)
- return maincpu_byte_r(space->machine, 0x410001 ^ (offset & 0xfff));
+ return maincpu_byte_r(space->machine(), 0x410001 ^ (offset & 0xfff));
logerror("%03X: MCU movx read mode %02X offset %04X\n",
cpu_get_pc(space->cpu), state->mcu_control, offset);
return 0xff;
case 3:
- return maincpu_byte_r(space->machine, 0x840001 ^ offset);
+ return maincpu_byte_r(space->machine(), 0x840001 ^ offset);
case 5:
- return space->machine->region("maincpu")->base()[0x00000 + offset];
+ return space->machine().region("maincpu")->base()[0x00000 + offset];
case 6:
- return space->machine->region("maincpu")->base()[0x10000 + offset];
+ return space->machine().region("maincpu")->base()[0x10000 + offset];
case 7:
- return space->machine->region("maincpu")->base()[0x20000 + offset];
+ return space->machine().region("maincpu")->base()[0x20000 + offset];
default:
logerror("%03X: MCU movx read mode %02X offset %04X\n",
@@ -991,7 +991,7 @@ static INTERRUPT_GEN( mcu_irq_assert )
device_set_input_line(device, MCS51_INT0_LINE, CLEAR_LINE);
/* boost interleave to ensure that the MCU can break the M68000 out of a STOP */
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
@@ -3417,7 +3417,7 @@ static DRIVER_INIT( generic_16a )
static DRIVER_INIT( aceattaa )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
state->custom_io_r = aceattaa_custom_io_r;
@@ -3440,7 +3440,7 @@ static DRIVER_INIT( fd1089b_16a )
static DRIVER_INIT( dumpmtmt )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
state->i8751_vblank_hook = dumpmtmt_i8751_sim;
@@ -3449,7 +3449,7 @@ static DRIVER_INIT( dumpmtmt )
static DRIVER_INIT( mjleague )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
state->custom_io_r = mjleague_custom_io_r;
@@ -3457,7 +3457,7 @@ static DRIVER_INIT( mjleague )
static DRIVER_INIT( passsht16a )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
state->custom_io_r = passsht16a_custom_io_r;
@@ -3465,7 +3465,7 @@ static DRIVER_INIT( passsht16a )
static DRIVER_INIT( quartet )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
state->i8751_vblank_hook = quartet_i8751_sim;
@@ -3482,7 +3482,7 @@ static DRIVER_INIT( fantzonep )
static DRIVER_INIT( sdi )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
fd1089b_decrypt(machine);
@@ -3492,7 +3492,7 @@ static DRIVER_INIT( sdi )
static DRIVER_INIT( sjryukoa )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16a_generic_init(machine);
fd1089b_decrypt(machine);
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index 428d1487f31..d7d53814f35 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -1022,9 +1022,9 @@ static const segaic16_memory_map_entry *const region_info_list[] =
*
*************************************/
-static void sound_w(running_machine *machine, UINT8 data)
+static void sound_w(running_machine &machine, UINT8 data)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
if (state->soundcpu != NULL)
{
@@ -1034,9 +1034,9 @@ static void sound_w(running_machine *machine, UINT8 data)
}
}
-static void system16b_common_init(running_machine* machine, int _rom_board)
+static void system16b_common_init(running_machine& machine, int _rom_board)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* set the ROM board */
state->rom_board = _rom_board;
@@ -1048,13 +1048,13 @@ static void system16b_common_init(running_machine* machine, int _rom_board)
state->i8751_initial_config = NULL;
state->disable_screen_blanking = 0;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->mcu = machine->device("mcu");
- state->ymsnd = machine->device("ymsnd");
- state->_315_5248_1 = machine->device("315_5248");
- state->_315_5250_1 = machine->device("315_5250_1");
- state->_315_5250_2 = machine->device("315_5250_2");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->mcu = machine.device("mcu");
+ state->ymsnd = machine.device("ymsnd");
+ state->_315_5248_1 = machine.device("315_5248");
+ state->_315_5250_1 = machine.device("315_5250_1");
+ state->_315_5250_2 = machine.device("315_5250_2");
state->save_item(NAME(state->disable_screen_blanking));
state->save_item(NAME(state->mj_input_num));
@@ -1065,9 +1065,9 @@ static void system16b_common_init(running_machine* machine, int _rom_board)
}
-static void system16b_generic_init(running_machine *machine, int _rom_board)
+static void system16b_generic_init(running_machine &machine, int _rom_board)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16b_common_init(machine, _rom_board);
@@ -1079,12 +1079,12 @@ static void system16b_generic_init(running_machine *machine, int _rom_board)
workram = auto_alloc_array(machine, UINT16, 0x04000 / 2);
/* init the memory mapper */
- segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, NULL);
+ segaic16_memory_mapper_init(machine.device("maincpu"), region_info_list[state->rom_board], sound_w, NULL);
/* init the FD1094 */
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
- machine->device<nvram_device>("nvram")->set_base(workram, 0x4000);
+ machine.device<nvram_device>("nvram")->set_base(workram, 0x4000);
state_save_register_global_pointer(machine, segaic16_spriteram_0, 0x00800/2);
state_save_register_global_pointer(machine, segaic16_paletteram, 0x01000/2);
@@ -1096,7 +1096,7 @@ static void system16b_generic_init(running_machine *machine, int _rom_board)
static TIMER_CALLBACK( suspend_i8751 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
device_suspend(state->mcu, SUSPEND_REASON_DISABLE, 1);
}
@@ -1110,13 +1110,13 @@ static TIMER_CALLBACK( suspend_i8751 )
static TIMER_CALLBACK( boost_interleave )
{
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(10));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_msec(10));
}
static MACHINE_RESET( system16b )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
int i;
@@ -1126,13 +1126,13 @@ static MACHINE_RESET( system16b )
segaic16_memory_mapper_config(machine, state->i8751_initial_config);
segaic16_tilemap_reset(machine, 0);
- fd1094_machine_init(machine->device("maincpu"));
+ fd1094_machine_init(machine.device("maincpu"));
/* if we have a fake i8751 handler, disable the actual 8751, otherwise crank the interleave */
if (state->i8751_vblank_hook != NULL)
- machine->scheduler().synchronize(FUNC(suspend_i8751));
+ machine.scheduler().synchronize(FUNC(suspend_i8751));
else
- machine->scheduler().synchronize(FUNC(boost_interleave));
+ machine.scheduler().synchronize(FUNC(boost_interleave));
/* configure sprite banks */
for (i = 0; i < 16; i++)
@@ -1142,7 +1142,7 @@ static MACHINE_RESET( system16b )
static TIMER_DEVICE_CALLBACK( atomicp_sound_irq )
{
- segas1x_state *state = timer.machine->driver_data<segas1x_state>();
+ segas1x_state *state = timer.machine().driver_data<segas1x_state>();
if (++state->atomicp_sound_count >= state->atomicp_sound_divisor)
{
@@ -1167,11 +1167,11 @@ static READ16_HANDLER( standard_io_r )
case 0x1000/2:
{
static const char *const sysports[] = { "SERVICE", "P1", "UNUSED", "P2" };
- return input_port_read(space->machine, sysports[offset & 3]);
+ return input_port_read(space->machine(), sysports[offset & 3]);
}
case 0x2000/2:
- return input_port_read(space->machine, (offset & 1) ? "DSW1" : "DSW2");
+ return input_port_read(space->machine(), (offset & 1) ? "DSW1" : "DSW2");
}
logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(space->cpu), offset * 2);
return segaic16_open_bus_r(space, 0, mem_mask);
@@ -1180,7 +1180,7 @@ static READ16_HANDLER( standard_io_r )
static WRITE16_HANDLER( standard_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x1fff;
switch (offset & (0x3000/2))
@@ -1196,14 +1196,14 @@ static WRITE16_HANDLER( standard_io_w )
D1 : (Output to coin counter 2?)
D0 : Output to coin counter 1
*/
- segaic16_tilemap_set_flip(space->machine, 0, data & 0x40);
- segaic16_sprites_set_flip(space->machine, 0, data & 0x40);
+ segaic16_tilemap_set_flip(space->machine(), 0, data & 0x40);
+ segaic16_sprites_set_flip(space->machine(), 0, data & 0x40);
if (!state->disable_screen_blanking)
- segaic16_set_display_enable(space->machine, data & 0x20);
- set_led_status(space->machine, 1, data & 0x08);
- set_led_status(space->machine, 0, data & 0x04);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x01);
+ segaic16_set_display_enable(space->machine(), data & 0x20);
+ set_led_status(space->machine(), 1, data & 0x08);
+ set_led_status(space->machine(), 0, data & 0x04);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
return;
}
logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(space->cpu), offset * 2, data, mem_mask);
@@ -1212,7 +1212,7 @@ static WRITE16_HANDLER( standard_io_w )
static READ16_HANDLER( misc_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_r)
return (*state->custom_io_r)(space, offset, mem_mask);
@@ -1223,7 +1223,7 @@ static READ16_HANDLER( misc_io_r )
static WRITE16_HANDLER( misc_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
if (state->custom_io_w)
(*state->custom_io_w)(space, offset, data, mem_mask);
@@ -1242,13 +1242,13 @@ static WRITE16_HANDLER( misc_io_w )
static WRITE16_HANDLER( rom_5704_bank_w )
{
if (ACCESSING_BITS_0_7)
- segaic16_tilemap_set_bank(space->machine, 0, offset & 1, data & 7);
+ segaic16_tilemap_set_bank(space->machine(), 0, offset & 1, data & 7);
}
static READ16_HANDLER( rom_5797_bank_math_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x1fff;
switch (offset & (0x3000/2))
@@ -1267,7 +1267,7 @@ static READ16_HANDLER( rom_5797_bank_math_r )
static WRITE16_HANDLER( rom_5797_bank_math_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x1fff;
switch (offset & (0x3000/2))
@@ -1284,7 +1284,7 @@ static WRITE16_HANDLER( rom_5797_bank_math_w )
case 0x2000/2:
if (ACCESSING_BITS_0_7)
- segaic16_tilemap_set_bank(space->machine, 0, offset & 1, data & 7);
+ segaic16_tilemap_set_bank(space->machine(), 0, offset & 1, data & 7);
break;
}
}
@@ -1292,7 +1292,7 @@ static WRITE16_HANDLER( rom_5797_bank_math_w )
static READ16_HANDLER( unknown_rgn2_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
logerror("Region 2: read from %04X\n", offset * 2);
return segaic16_compare_timer_r(state->_315_5250_2, offset & 7, mem_mask);
@@ -1301,7 +1301,7 @@ static READ16_HANDLER( unknown_rgn2_r )
static WRITE16_HANDLER( unknown_rgn2_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
logerror("Region 2: write to %04X = %04X & %04X\n", offset * 2, data, mem_mask);
segaic16_compare_timer_w(state->_315_5250_2, offset & 7, data, mem_mask);
@@ -1317,8 +1317,8 @@ static WRITE16_HANDLER( unknown_rgn2_w )
static WRITE8_DEVICE_HANDLER( upd7759_control_w )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
- int size = device->machine->region("soundcpu")->bytes() - 0x10000;
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
+ int size = device->machine().region("soundcpu")->bytes() - 0x10000;
if (size > 0)
{
int bankoffs = 0;
@@ -1375,7 +1375,7 @@ static WRITE8_DEVICE_HANDLER( upd7759_control_w )
bankoffs += (data & 0x07) * 0x04000;
break;
}
- memory_set_bankptr(device->machine, "bank1", device->machine->region("soundcpu")->base() + 0x10000 + (bankoffs % size));
+ memory_set_bankptr(device->machine(), "bank1", device->machine().region("soundcpu")->base() + 0x10000 + (bankoffs % size));
}
}
@@ -1388,7 +1388,7 @@ static READ8_DEVICE_HANDLER( upd7759_status_r )
static void upd7759_generate_nmi(device_t *device, int state)
{
- segas1x_state *driver = device->machine->driver_data<segas1x_state>();
+ segas1x_state *driver = device->machine().driver_data<segas1x_state>();
if (state)
device_set_input_line(driver->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -1398,7 +1398,7 @@ static void upd7759_generate_nmi(device_t *device, int state)
#if 0
static WRITE8_HANDLER( mcu_data_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
state->mcu_data = data;
generic_pulse_irq_line(state->mcu, 1);
}
@@ -1413,11 +1413,11 @@ static WRITE8_HANDLER( mcu_data_w )
static INTERRUPT_GEN( i8751_main_cpu_vblank )
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
/* if we have a fake 8751 handler, call it on VBLANK */
if (state->i8751_vblank_hook != NULL)
- (*state->i8751_vblank_hook)(device->machine);
+ (*state->i8751_vblank_hook)(device->machine());
}
@@ -1428,9 +1428,9 @@ static INTERRUPT_GEN( i8751_main_cpu_vblank )
*
*************************************/
-static void altbeast_common_i8751_sim(running_machine *machine, offs_t soundoffs, offs_t inputoffs)
+static void altbeast_common_i8751_sim(running_machine &machine, offs_t soundoffs, offs_t inputoffs)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT16 temp;
@@ -1452,25 +1452,25 @@ static void altbeast_common_i8751_sim(running_machine *machine, offs_t soundoffs
workram[inputoffs] = ~input_port_read(machine, "SERVICE") << 8;
}
-static void altbeasj_i8751_sim(running_machine *machine)
+static void altbeasj_i8751_sim(running_machine &machine)
{
altbeast_common_i8751_sim(machine, 0x30d4/2, 0x30d0/2);
}
-static void altbeas5_i8751_sim(running_machine *machine)
+static void altbeas5_i8751_sim(running_machine &machine)
{
altbeast_common_i8751_sim(machine, 0x3098/2, 0x3096/2);
}
-static void altbeast_i8751_sim(running_machine *machine)
+static void altbeast_i8751_sim(running_machine &machine)
{
altbeast_common_i8751_sim(machine, 0x30c4/2, 0x30c2/2);
}
-static void ddux_i8751_sim(running_machine *machine)
+static void ddux_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT16 temp;
@@ -1487,9 +1487,9 @@ static void ddux_i8751_sim(running_machine *machine)
}
-static void goldnaxe_i8751_init(running_machine *machine)
+static void goldnaxe_i8751_init(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
static const UINT8 memory_control_5704[0x10] =
{ 0x02,0x00, 0x02,0x08, 0x00,0x1f, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 };
static const UINT8 memory_control_5797[0x10] =
@@ -1506,9 +1506,9 @@ static void goldnaxe_i8751_init(running_machine *machine)
}
}
-static void goldnaxe_i8751_sim(running_machine *machine)
+static void goldnaxe_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT16 temp;
@@ -1538,9 +1538,9 @@ static void goldnaxe_i8751_sim(running_machine *machine)
}
-static void tturf_i8751_sim(running_machine *machine)
+static void tturf_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT16 temp;
@@ -1562,9 +1562,9 @@ static void tturf_i8751_sim(running_machine *machine)
}
-static void wb3_i8751_sim(running_machine *machine)
+static void wb3_i8751_sim(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT16 temp;
@@ -1590,14 +1590,14 @@ static void wb3_i8751_sim(running_machine *machine)
static MACHINE_START( atomicp )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
state->save_item(NAME(state->atomicp_sound_count));
}
static WRITE16_HANDLER( atomicp_sound_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
ym2413_w(state->ymsnd, offset, data >> 8);
}
@@ -1616,14 +1616,14 @@ static READ16_HANDLER( dunkshot_custom_io_r )
case 0x3000/2:
switch ((offset/2) & 7)
{
- case 0: return (input_port_read(space->machine, "ANALOGX1") << 4) >> (8 * (offset & 1));
- case 1: return (input_port_read(space->machine, "ANALOGY1") << 4) >> (8 * (offset & 1));
- case 2: return (input_port_read(space->machine, "ANALOGX2") << 4) >> (8 * (offset & 1));
- case 3: return (input_port_read(space->machine, "ANALOGY2") << 4) >> (8 * (offset & 1));
- case 4: return (input_port_read(space->machine, "ANALOGX3") << 4) >> (8 * (offset & 1));
- case 5: return (input_port_read(space->machine, "ANALOGY3") << 4) >> (8 * (offset & 1));
- case 6: return (input_port_read(space->machine, "ANALOGX4") << 4) >> (8 * (offset & 1));
- case 7: return (input_port_read(space->machine, "ANALOGY4") << 4) >> (8 * (offset & 1));
+ case 0: return (input_port_read(space->machine(), "ANALOGX1") << 4) >> (8 * (offset & 1));
+ case 1: return (input_port_read(space->machine(), "ANALOGY1") << 4) >> (8 * (offset & 1));
+ case 2: return (input_port_read(space->machine(), "ANALOGX2") << 4) >> (8 * (offset & 1));
+ case 3: return (input_port_read(space->machine(), "ANALOGY2") << 4) >> (8 * (offset & 1));
+ case 4: return (input_port_read(space->machine(), "ANALOGX3") << 4) >> (8 * (offset & 1));
+ case 5: return (input_port_read(space->machine(), "ANALOGY3") << 4) >> (8 * (offset & 1));
+ case 6: return (input_port_read(space->machine(), "ANALOGX4") << 4) >> (8 * (offset & 1));
+ case 7: return (input_port_read(space->machine(), "ANALOGY4") << 4) >> (8 * (offset & 1));
}
break;
}
@@ -1640,7 +1640,7 @@ static READ16_HANDLER( dunkshot_custom_io_r )
static READ16_HANDLER( hwchamp_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
UINT16 result;
switch (offset & (0x3000/2))
@@ -1661,7 +1661,7 @@ static READ16_HANDLER( hwchamp_custom_io_r )
static WRITE16_HANDLER( hwchamp_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portname[4] = { "MONITOR", "LEFT", "RIGHT", "DUMMY" };
switch (offset & (0x3000/2))
{
@@ -1669,16 +1669,16 @@ static WRITE16_HANDLER( hwchamp_custom_io_w )
switch (offset & 0x30/2)
{
case 0x20/2:
- state->hwc_input_value = input_port_read_safe(space->machine, portname[offset & 3], 0xff);
+ state->hwc_input_value = input_port_read_safe(space->machine(), portname[offset & 3], 0xff);
break;
case 0x30/2:
/* bit 4 is GONG */
// if (data & 0x10) popmessage("GONG");
/* are the following really lamps? */
- // set_led_status(space->machine, 1,data & 0x20);
- // set_led_status(space->machine, 2,data & 0x40);
- // set_led_status(space->machine, 3,data & 0x80);
+ // set_led_status(space->machine(), 1,data & 0x20);
+ // set_led_status(space->machine(), 2,data & 0x40);
+ // set_led_status(space->machine(), 3,data & 0x80);
break;
}
break;
@@ -1701,10 +1701,10 @@ static READ16_HANDLER( passshtj_custom_io_r )
case 0x3000/2:
switch (offset & 3)
{
- case 0: return input_port_read(space->machine, "P1");
- case 1: return input_port_read(space->machine, "P2");
- case 2: return input_port_read(space->machine, "P3");
- case 3: return input_port_read(space->machine, "P4");
+ case 0: return input_port_read(space->machine(), "P1");
+ case 1: return input_port_read(space->machine(), "P2");
+ case 2: return input_port_read(space->machine(), "P3");
+ case 3: return input_port_read(space->machine(), "P4");
}
break;
}
@@ -1726,10 +1726,10 @@ static READ16_HANDLER( sdi_custom_io_r )
case 0x3000/2:
switch ((offset/2) & 3)
{
- case 0: return input_port_read(space->machine, "ANALOGX1");
- case 1: return input_port_read(space->machine, "ANALOGY1");
- case 2: return input_port_read(space->machine, "ANALOGX2");
- case 3: return input_port_read(space->machine, "ANALOGY2");
+ case 0: return input_port_read(space->machine(), "ANALOGX1");
+ case 1: return input_port_read(space->machine(), "ANALOGY1");
+ case 2: return input_port_read(space->machine(), "ANALOGX2");
+ case 3: return input_port_read(space->machine(), "ANALOGY2");
}
break;
}
@@ -1746,7 +1746,7 @@ static READ16_HANDLER( sdi_custom_io_r )
static READ16_HANDLER( sjryuko_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portname[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5" };
switch (offset & (0x3000/2))
@@ -1755,12 +1755,12 @@ static READ16_HANDLER( sjryuko_custom_io_r )
switch (offset & 3)
{
case 1:
- if (input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff) != 0xff)
+ if (input_port_read_safe(space->machine(), portname[state->mj_input_num], 0xff) != 0xff)
return 0xff & ~(1 << state->mj_input_num);
return 0xff;
case 2:
- return input_port_read_safe(space->machine, portname[state->mj_input_num], 0xff);
+ return input_port_read_safe(space->machine(), portname[state->mj_input_num], 0xff);
}
break;
}
@@ -1770,7 +1770,7 @@ static READ16_HANDLER( sjryuko_custom_io_r )
static WRITE16_HANDLER( sjryuko_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset & (0x3000/2))
{
@@ -6368,7 +6368,7 @@ static DRIVER_INIT( aliensy3_5358 )
static DRIVER_INIT( altbeast_5521 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5521);
state->i8751_vblank_hook = altbeast_i8751_sim;
@@ -6377,7 +6377,7 @@ static DRIVER_INIT( altbeast_5521 )
static DRIVER_INIT( altbeasj_5521 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5521);
state->i8751_vblank_hook = altbeasj_i8751_sim;
@@ -6386,7 +6386,7 @@ static DRIVER_INIT( altbeasj_5521 )
static DRIVER_INIT( altbeas5_5521 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5521);
state->i8751_vblank_hook = altbeas5_i8751_sim;
@@ -6416,7 +6416,7 @@ static DRIVER_INIT( aurailj_5704 )
static DRIVER_INIT( ddux_5704 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5704);
state->i8751_vblank_hook = ddux_i8751_sim;
@@ -6425,7 +6425,7 @@ static DRIVER_INIT( ddux_5704 )
static DRIVER_INIT( dunkshot_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
fd1089a_decrypt(machine);
@@ -6435,7 +6435,7 @@ static DRIVER_INIT( dunkshot_5358 )
static DRIVER_INIT( exctleag_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
state->custom_io_r = sdi_custom_io_r;
@@ -6444,7 +6444,7 @@ static DRIVER_INIT( exctleag_5358 )
static DRIVER_INIT( goldnaxe_5704 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5704);
goldnaxe_i8751_init(machine);
@@ -6454,7 +6454,7 @@ static DRIVER_INIT( goldnaxe_5704 )
static DRIVER_INIT( goldnaxe_5797 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5797);
goldnaxe_i8751_init(machine);
@@ -6464,7 +6464,7 @@ static DRIVER_INIT( goldnaxe_5797 )
static DRIVER_INIT( hwchamp_5521 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5521);
state->custom_io_r = hwchamp_custom_io_r;
@@ -6474,7 +6474,7 @@ static DRIVER_INIT( hwchamp_5521 )
static DRIVER_INIT( sdi_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
state->custom_io_r = sdi_custom_io_r;
@@ -6482,7 +6482,7 @@ static DRIVER_INIT( sdi_5358 )
static DRIVER_INIT( defense_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
fd1089a_decrypt(machine);
@@ -6506,7 +6506,7 @@ static DRIVER_INIT( shinobi3_5358 )
static DRIVER_INIT( sjryuko_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
fd1089b_decrypt(machine);
@@ -6517,7 +6517,7 @@ static DRIVER_INIT( sjryuko_5358 )
static DRIVER_INIT( passshtj_5358 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5358);
state->custom_io_r = passshtj_custom_io_r;
@@ -6526,7 +6526,7 @@ static DRIVER_INIT( passshtj_5358 )
static DRIVER_INIT( tturf_5704 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5704);
state->i8751_vblank_hook = tturf_i8751_sim;
@@ -6535,7 +6535,7 @@ static DRIVER_INIT( tturf_5704 )
static DRIVER_INIT( wb3_5704 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5704);
state->i8751_vblank_hook = wb3_i8751_sim;
@@ -6544,7 +6544,7 @@ static DRIVER_INIT( wb3_5704 )
static DRIVER_INIT( atomicp )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16b_generic_init(machine, ROM_BOARD_ATOMICP);
state->disable_screen_blanking = 1;
@@ -6556,7 +6556,7 @@ static DRIVER_INIT( atomicp )
static DRIVER_INIT( snapper )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
system16b_generic_init(machine, ROM_BOARD_ATOMICP);
state->disable_screen_blanking = 1;
@@ -6720,7 +6720,7 @@ static UINT8 isgsm_read_xor;
static WRITE16_HANDLER( isgsm_sound_w16 )
{
- sound_w(space->machine, data);
+ sound_w(space->machine(), data);
}
static WRITE16_HANDLER( isgsm_cart_addr_high_w )
@@ -6737,8 +6737,8 @@ static WRITE16_HANDLER( isgsm_cart_addr_low_w )
// when reading from this port the data is xored by a fixed value depending on the cart
static READ16_HANDLER( isgsm_cart_data_r )
{
- int size = space->machine->region("gamecart_rgn")->bytes();
- UINT8* rgn = space->machine->region("gamecart_rgn")->base();
+ int size = space->machine().region("gamecart_rgn")->bytes();
+ UINT8* rgn = space->machine().region("gamecart_rgn")->base();
isgsm_cart_addr++;
@@ -6762,16 +6762,16 @@ static WRITE16_HANDLER( isgsm_data_w )
switch (isgsm_type&0x0f)
{
- case 0x0: dest = space->machine->region("gfx2")->base();
+ case 0x0: dest = space->machine().region("gfx2")->base();
break;
- case 0x1: dest = space->machine->region("gfx1")->base();
+ case 0x1: dest = space->machine().region("gfx1")->base();
break;
- case 0x2: dest = space->machine->region("soundcpu")->base();
+ case 0x2: dest = space->machine().region("soundcpu")->base();
break;
- case 0x3: dest = space->machine->region("maincpu")->base();
+ case 0x3: dest = space->machine().region("maincpu")->base();
break;
default: // no other cases?
@@ -6882,11 +6882,11 @@ static WRITE16_HANDLER( isgsm_data_w )
dest[isgsm_addr] = byte;
- if (dest == space->machine->region("gfx1")->base())
+ if (dest == space->machine().region("gfx1")->base())
{
// we need to re-decode the tiles if writing to this area to keep MAME happy
- gfx_element_mark_dirty(space->machine->gfx[0], (isgsm_addr&0x1ffff)/8);
+ gfx_element_mark_dirty(space->machine().gfx[0], (isgsm_addr&0x1ffff)/8);
}
}
}
@@ -6961,13 +6961,13 @@ WRITE16_HANDLER( isgsm_sound_reset_w )
{
if (data==0)
{
- devtag_reset( space->machine, "soundcpu" );
- space->machine->device<cpu_device>( "soundcpu" )->resume(SUSPEND_REASON_HALT );
+ devtag_reset( space->machine(), "soundcpu" );
+ space->machine().device<cpu_device>( "soundcpu" )->resume(SUSPEND_REASON_HALT );
}
else if (data==1)
{
- devtag_reset( space->machine, "soundcpu" );
- space->machine->device<cpu_device>( "soundcpu" )->suspend(SUSPEND_REASON_HALT, 1 );
+ devtag_reset( space->machine(), "soundcpu" );
+ space->machine().device<cpu_device>( "soundcpu" )->suspend(SUSPEND_REASON_HALT, 1 );
}
}
@@ -6976,14 +6976,14 @@ static WRITE16_HANDLER( isgsm_main_bank_change_w )
// other values on real hw have strange results, change memory mapping etc??
if (data==1)
{
- memory_set_bankptr(space->machine,ISGSM_MAIN_BANK, space->machine->region("maincpu")->base());
+ memory_set_bankptr(space->machine(),ISGSM_MAIN_BANK, space->machine().region("maincpu")->base());
}
}
static MACHINE_START( isgsm )
{
- memory_set_bankptr(machine,ISGSM_CART_BANK, machine->region("gamecart_rgn")->base());
- memory_set_bankptr(machine,ISGSM_MAIN_BANK, machine->region("bios")->base());
+ memory_set_bankptr(machine,ISGSM_CART_BANK, machine.region("gamecart_rgn")->base());
+ memory_set_bankptr(machine,ISGSM_MAIN_BANK, machine.region("bios")->base());
}
static ADDRESS_MAP_START( isgsm_map, AS_PROGRAM, 16 )
@@ -7142,8 +7142,8 @@ static MACHINE_RESET( isgsm )
for (int i = 0; i < 16; i++)
segaic16_sprites_set_bank(machine, 0, i, i);
- memory_set_bankptr(machine,ISGSM_CART_BANK, machine->region("gamecart_rgn")->base());
- memory_set_bankptr(machine,ISGSM_MAIN_BANK, machine->region("bios")->base());
+ memory_set_bankptr(machine,ISGSM_CART_BANK, machine.region("gamecart_rgn")->base());
+ memory_set_bankptr(machine,ISGSM_MAIN_BANK, machine.region("bios")->base());
devtag_reset( machine, "maincpu" );
}
@@ -7167,11 +7167,11 @@ DRIVER_INIT( isgsm )
{
system16b_common_init(machine, ROM_BOARD_171_5521);
- machine->device<nvram_device>("nvram")->set_base(workram, 0x4000);
+ machine.device<nvram_device>("nvram")->set_base(workram, 0x4000);
// decrypt the bios...
UINT16* temp = (UINT16*)malloc(0x20000);
- UINT16* rom = (UINT16*)machine->region("bios")->base();
+ UINT16* rom = (UINT16*)machine.region("bios")->base();
int i;
for (i=0;i<0x10000;i++)
@@ -7188,7 +7188,7 @@ DRIVER_INIT( shinfz )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x200000);
- UINT16* rom = (UINT16*)machine->region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
int i;
for (i=0;i<0x100000;i++)
@@ -7208,7 +7208,7 @@ DRIVER_INIT( tetrbx )
DRIVER_INIT_CALL( isgsm );
UINT16* temp = (UINT16*)malloc(0x80000);
- UINT16* rom = (UINT16*)machine->region("gamecart_rgn")->base();
+ UINT16* rom = (UINT16*)machine.region("gamecart_rgn")->base();
int i;
for (i=0;i<0x80000/2;i++)
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index efccf6dbc14..5a36e02b306 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -137,24 +137,24 @@ static const segaic16_memory_map_entry *const region_info_list[] =
*
*************************************/
-static void sound_w(running_machine *machine, UINT8 data)
+static void sound_w(running_machine &machine, UINT8 data)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
}
-static UINT8 sound_r(running_machine *machine)
+static UINT8 sound_r(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
return state->mcu_data;
}
-static void system18_generic_init(running_machine *machine, int _rom_board)
+static void system18_generic_init(running_machine &machine, int _rom_board)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* set the ROM board */
state->rom_board = _rom_board;
@@ -167,7 +167,7 @@ static void system18_generic_init(running_machine *machine, int _rom_board)
workram = auto_alloc_array(machine, UINT16, 0x04000/2);
/* init the memory mapper */
- segaic16_memory_mapper_init(machine->device("maincpu"), region_info_list[state->rom_board], sound_w, sound_r);
+ segaic16_memory_mapper_init(machine.device("maincpu"), region_info_list[state->rom_board], sound_w, sound_r);
/* init the FD1094 */
fd1094_driver_init(machine, "maincpu", segaic16_memory_mapper_set_decrypted);
@@ -176,11 +176,11 @@ static void system18_generic_init(running_machine *machine, int _rom_board)
state->custom_io_r = NULL;
state->custom_io_w = NULL;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->mcu = machine.device("mcu");
- machine->device<nvram_device>("nvram")->set_base(workram, 0x4000);
+ machine.device<nvram_device>("nvram")->set_base(workram, 0x4000);
state->save_item(NAME(state->mcu_data));
state->save_item(NAME(state->lghost_value));
@@ -205,21 +205,21 @@ static void system18_generic_init(running_machine *machine, int _rom_board)
static TIMER_CALLBACK( boost_interleave )
{
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(10));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_msec(10));
}
static MACHINE_RESET( system18 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
segaic16_memory_mapper_reset(machine);
segaic16_tilemap_reset(machine, 0);
- fd1094_machine_init(machine->device("maincpu"));
+ fd1094_machine_init(machine.device("maincpu"));
/* if we are running with a real live 8751, we need to boost the interleave at startup */
if (state->mcu != NULL && state->mcu->type() == I8751)
- machine->scheduler().synchronize(FUNC(boost_interleave));
+ machine.scheduler().synchronize(FUNC(boost_interleave));
}
@@ -232,7 +232,7 @@ static MACHINE_RESET( system18 )
static READ16_HANDLER( io_chip_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
offset &= 0x1f/2;
@@ -252,7 +252,7 @@ static READ16_HANDLER( io_chip_r )
return state->misc_io_data[offset];
/* otherwise, return an input port */
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
/* 'SEGA' protection */
case 0x10/2:
@@ -280,7 +280,7 @@ static READ16_HANDLER( io_chip_r )
static WRITE16_HANDLER( io_chip_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
UINT8 old;
/* generic implementation */
@@ -309,15 +309,15 @@ static WRITE16_HANDLER( io_chip_w )
/* miscellaneous output */
case 0x06/2:
- system18_set_grayscale(space->machine, ~data & 0x40);
- segaic16_tilemap_set_flip(space->machine, 0, data & 0x20);
- segaic16_sprites_set_flip(space->machine, 0, data & 0x20);
+ system18_set_grayscale(space->machine(), ~data & 0x40);
+ segaic16_tilemap_set_flip(space->machine(), 0, data & 0x20);
+ segaic16_sprites_set_flip(space->machine(), 0, data & 0x20);
/* These are correct according to cgfm's docs, but mwalker and ddcrew both
enable the lockout and never turn it off
- coin_lockout_w(space->machine, 1, data & 0x08);
- coin_lockout_w(space->machine, 0, data & 0x04); */
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_lockout_w(space->machine(), 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, data & 0x04); */
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
break;
/* tile banking */
@@ -327,17 +327,17 @@ static WRITE16_HANDLER( io_chip_w )
int i;
for (i = 0; i < 4; i++)
{
- segaic16_tilemap_set_bank(space->machine, 0, 0 + i, (data & 0xf) * 4 + i);
- segaic16_tilemap_set_bank(space->machine, 0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
+ segaic16_tilemap_set_bank(space->machine(), 0, 0 + i, (data & 0xf) * 4 + i);
+ segaic16_tilemap_set_bank(space->machine(), 0, 4 + i, ((data >> 4) & 0xf) * 4 + i);
}
}
break;
/* CNT register */
case 0x1c/2:
- segaic16_set_display_enable(space->machine, data & 2);
+ segaic16_set_display_enable(space->machine(), data & 2);
if ((old ^ data) & 4)
- system18_set_vdp_enable(space->machine, data & 4);
+ system18_set_vdp_enable(space->machine(), data & 4);
break;
}
}
@@ -345,7 +345,7 @@ static WRITE16_HANDLER( io_chip_w )
static READ16_HANDLER( misc_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portnames[] = { "SERVICE", "COINAGE" };
offset &= 0x1fff;
@@ -359,7 +359,7 @@ static READ16_HANDLER( misc_io_r )
/* video control latch */
case 0x2000/2:
- return input_port_read(space->machine, portnames[offset & 1]);
+ return input_port_read(space->machine(), portnames[offset & 1]);
}
if (state->custom_io_r)
return state->custom_io_r(space, offset, mem_mask);
@@ -370,7 +370,7 @@ static READ16_HANDLER( misc_io_r )
static WRITE16_HANDLER( misc_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
offset &= 0x1fff;
switch (offset & (0x3000/2))
@@ -389,7 +389,7 @@ static WRITE16_HANDLER( misc_io_w )
case 0x2000/2:
if (ACCESSING_BITS_0_7)
{
- system18_set_vdp_mixing(space->machine, data & 0xff);
+ system18_set_vdp_mixing(space->machine(), data & 0xff);
return;
}
break;
@@ -420,20 +420,20 @@ static WRITE16_HANDLER( rom_5987_bank_w )
/* tile banking */
if (offset < 8)
{
- int maxbanks = space->machine->gfx[0]->total_elements / 1024;
+ int maxbanks = space->machine().gfx[0]->total_elements / 1024;
if (data >= maxbanks)
data %= maxbanks;
- segaic16_tilemap_set_bank(space->machine, 0, offset, data);
+ segaic16_tilemap_set_bank(space->machine(), 0, offset, data);
}
/* sprite banking */
else
{
- int maxbanks = space->machine->region("gfx2")->bytes() / 0x40000;
+ int maxbanks = space->machine().region("gfx2")->bytes() / 0x40000;
if (data >= maxbanks)
data = 255;
- segaic16_sprites_set_bank(space->machine, 0, (offset - 8) * 2 + 0, data * 2 + 0);
- segaic16_sprites_set_bank(space->machine, 0, (offset - 8) * 2 + 1, data * 2 + 1);
+ segaic16_sprites_set_bank(space->machine(), 0, (offset - 8) * 2 + 0, data * 2 + 0);
+ segaic16_sprites_set_bank(space->machine(), 0, (offset - 8) * 2 + 1, data * 2 + 1);
}
}
@@ -450,13 +450,13 @@ static READ16_HANDLER( ddcrew_custom_io_r )
switch (offset)
{
case 0x3020/2:
- return input_port_read(space->machine, "P3");
+ return input_port_read(space->machine(), "P3");
case 0x3022/2:
- return input_port_read(space->machine, "P4");
+ return input_port_read(space->machine(), "P4");
case 0x3024/2:
- return input_port_read(space->machine, "P34START");
+ return input_port_read(space->machine(), "P34START");
}
return segaic16_open_bus_r(space, 0, mem_mask);
}
@@ -471,7 +471,7 @@ static READ16_HANDLER( ddcrew_custom_io_r )
static READ16_HANDLER( lghost_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
UINT16 result;
switch (offset)
{
@@ -489,24 +489,24 @@ static READ16_HANDLER( lghost_custom_io_r )
static WRITE16_HANDLER( lghost_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset)
{
case 0x3010/2:
- state->lghost_value = 255 - input_port_read(space->machine, "GUNY1");
+ state->lghost_value = 255 - input_port_read(space->machine(), "GUNY1");
break;
case 0x3012/2:
- state->lghost_value = input_port_read(space->machine, "GUNX1");
+ state->lghost_value = input_port_read(space->machine(), "GUNX1");
break;
case 0x3014/2:
- state->lghost_value = 255 - input_port_read(space->machine, state->lghost_select ? "GUNY3" : "GUNY2");
+ state->lghost_value = 255 - input_port_read(space->machine(), state->lghost_select ? "GUNY3" : "GUNY2");
break;
case 0x3016/2:
- state->lghost_value = input_port_read(space->machine, state->lghost_select ? "GUNX3" : "GUNX2");
+ state->lghost_value = input_port_read(space->machine(), state->lghost_select ? "GUNX3" : "GUNX2");
break;
case 0x3020/2:
@@ -525,27 +525,27 @@ static WRITE16_HANDLER( lghost_custom_io_w )
static READ16_HANDLER( wwally_custom_io_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset)
{
case 0x3000/2:
- return (input_port_read(space->machine, "TRACKX1") - state->wwally_last_x[0]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKX1") - state->wwally_last_x[0]) & 0xff;
case 0x3004/2:
- return (input_port_read(space->machine, "TRACKY1") - state->wwally_last_y[0]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKY1") - state->wwally_last_y[0]) & 0xff;
case 0x3008/2:
- return (input_port_read(space->machine, "TRACKX2") - state->wwally_last_x[1]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKX2") - state->wwally_last_x[1]) & 0xff;
case 0x300c/2:
- return (input_port_read(space->machine, "TRACKY2") - state->wwally_last_y[1]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKY2") - state->wwally_last_y[1]) & 0xff;
case 0x3010/2:
- return (input_port_read(space->machine, "TRACKX3") - state->wwally_last_x[2]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKX3") - state->wwally_last_x[2]) & 0xff;
case 0x3014/2:
- return (input_port_read(space->machine, "TRACKY3") - state->wwally_last_y[2]) & 0xff;
+ return (input_port_read(space->machine(), "TRACKY3") - state->wwally_last_y[2]) & 0xff;
}
return segaic16_open_bus_r(space, 0, mem_mask);
}
@@ -553,26 +553,26 @@ static READ16_HANDLER( wwally_custom_io_r )
static WRITE16_HANDLER( wwally_custom_io_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
switch (offset)
{
case 0x3000/2:
case 0x3004/2:
- state->wwally_last_x[0] = input_port_read(space->machine, "TRACKX1");
- state->wwally_last_y[0] = input_port_read(space->machine, "TRACKY1");
+ state->wwally_last_x[0] = input_port_read(space->machine(), "TRACKX1");
+ state->wwally_last_y[0] = input_port_read(space->machine(), "TRACKY1");
break;
case 0x3008/2:
case 0x300c/2:
- state->wwally_last_x[1] = input_port_read(space->machine, "TRACKX2");
- state->wwally_last_y[1] = input_port_read(space->machine, "TRACKY2");
+ state->wwally_last_x[1] = input_port_read(space->machine(), "TRACKX2");
+ state->wwally_last_y[1] = input_port_read(space->machine(), "TRACKY2");
break;
case 0x3010/2:
case 0x3014/2:
- state->wwally_last_x[2] = input_port_read(space->machine, "TRACKX3");
- state->wwally_last_y[2] = input_port_read(space->machine, "TRACKY3");
+ state->wwally_last_x[2] = input_port_read(space->machine(), "TRACKX3");
+ state->wwally_last_y[2] = input_port_read(space->machine(), "TRACKY3");
break;
}
}
@@ -587,13 +587,13 @@ static WRITE16_HANDLER( wwally_custom_io_w )
static WRITE8_HANDLER( soundbank_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("soundcpu")->base() + 0x10000 + 0x2000 * data);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x10000 + 0x2000 * data);
}
static WRITE8_HANDLER( mcu_data_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
state->mcu_data = data;
device_set_input_line(state->mcu, MCS51_INT1_LINE, HOLD_LINE);
}
@@ -2274,7 +2274,7 @@ static DRIVER_INIT( generic_5987 )
static DRIVER_INIT( ddcrew )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5987);
state->custom_io_r = ddcrew_custom_io_r;
@@ -2283,7 +2283,7 @@ static DRIVER_INIT( ddcrew )
static DRIVER_INIT( lghost )
{
has_guns=1;
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5987);
state->custom_io_r = lghost_custom_io_r;
@@ -2292,7 +2292,7 @@ static DRIVER_INIT( lghost )
static DRIVER_INIT( wwally )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
DRIVER_INIT_CALL(generic_5987);
state->custom_io_r = wwally_custom_io_r;
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 840bf83b178..a5fe781ae92 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -348,9 +348,9 @@ Notes:
// Floppy Fisk Controller
-static void fdc_init(running_machine *machine)
+static void fdc_init(running_machine &machine)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
state->fdc_status = 0;
state->fdc_track = 0;
state->fdc_sector = 0;
@@ -363,7 +363,7 @@ static void fdc_init(running_machine *machine)
static READ16_HANDLER( fdc_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(!state->track_size)
return 0xffff;
@@ -399,7 +399,7 @@ static READ16_HANDLER( fdc_r )
static WRITE16_HANDLER( fdc_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(!state->track_size)
return;
@@ -423,7 +423,7 @@ static WRITE16_HANDLER( fdc_w )
break;
case 0x9:
logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, state->fdc_sector, state->fdc_sector+state->fdc_data-1, data & 8 ? 1 : 0, state->fdc_phys_track);
- state->fdc_pt = space->machine->region("floppy")->base() + state->track_size*(2*state->fdc_phys_track+(data & 8 ? 1 : 0));
+ state->fdc_pt = space->machine().region("floppy")->base() + state->track_size*(2*state->fdc_phys_track+(data & 8 ? 1 : 0));
state->fdc_span = state->track_size;
state->fdc_status = 3;
state->fdc_drq = 1;
@@ -431,7 +431,7 @@ static WRITE16_HANDLER( fdc_w )
break;
case 0xb:
logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, state->fdc_sector, state->fdc_sector+state->fdc_data-1, data & 8 ? 1 : 0, state->fdc_phys_track);
- state->fdc_pt = space->machine->region("floppy")->base() + state->track_size*(2*state->fdc_phys_track+(data & 8 ? 1 : 0));
+ state->fdc_pt = space->machine().region("floppy")->base() + state->track_size*(2*state->fdc_phys_track+(data & 8 ? 1 : 0));
state->fdc_span = state->track_size;
state->fdc_status = 3;
state->fdc_drq = 1;
@@ -485,7 +485,7 @@ static WRITE16_HANDLER( fdc_w )
static READ16_HANDLER( fdc_status_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(!state->track_size)
return 0xffff;
@@ -501,7 +501,7 @@ static WRITE16_HANDLER( fdc_ctrl_w )
// I/O Mappers
-static UINT8 hotrod_io_r(running_machine *machine, int port)
+static UINT8 hotrod_io_r(running_machine &machine, int port)
{
switch(port)
{
@@ -525,7 +525,7 @@ static UINT8 hotrod_io_r(running_machine *machine, int port)
return 0x00;
}
-static UINT8 dcclub_io_r(running_machine *machine, int port)
+static UINT8 dcclub_io_r(running_machine &machine, int port)
{
switch(port)
{
@@ -553,9 +553,9 @@ static UINT8 dcclub_io_r(running_machine *machine, int port)
}
-static UINT8 mahmajn_io_r(running_machine *machine, int port)
+static UINT8 mahmajn_io_r(running_machine &machine, int port)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
static const char *const keynames[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5", "P1", "P2" };
switch(port)
@@ -580,9 +580,9 @@ static UINT8 mahmajn_io_r(running_machine *machine, int port)
return 0x00;
}
-static void mahmajn_io_w(running_machine *machine, int port, UINT8 data)
+static void mahmajn_io_w(running_machine &machine, int port, UINT8 data)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
switch(port)
{
case 3:
@@ -590,21 +590,21 @@ static void mahmajn_io_w(running_machine *machine, int port, UINT8 data)
state->cur_input_line = (state->cur_input_line + 1) & 7;
break;
case 7: // DAC
- dac_signed_data_w(machine->device("dac"), data);
+ dac_signed_data_w(machine.device("dac"), data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
}
}
-static void hotrod_io_w(running_machine *machine, int port, UINT8 data)
+static void hotrod_io_w(running_machine &machine, int port, UINT8 data)
{
switch(port)
{
case 3: // Lamps
break;
case 7: // DAC
- dac_signed_data_w(machine->device("dac"), data);
+ dac_signed_data_w(machine.device("dac"), data);
break;
default:
fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
@@ -614,40 +614,40 @@ static void hotrod_io_w(running_machine *machine, int port, UINT8 data)
static WRITE16_HANDLER( hotrod3_ctrl_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
static const char *const portnames[] = { "PEDAL1", "PEDAL2", "PEDAL3", "PEDAL4" };
if(ACCESSING_BITS_0_7)
{
data &= 3;
- state->hotrod_ctrl_cur = input_port_read_safe(space->machine, portnames[data], 0);
+ state->hotrod_ctrl_cur = input_port_read_safe(space->machine(), portnames[data], 0);
}
}
static READ16_HANDLER( hotrod3_ctrl_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(ACCESSING_BITS_0_7)
{
switch(offset)
{
// Steering dials
case 0:
- return input_port_read_safe(space->machine, "DIAL1", 0) & 0xff;
+ return input_port_read_safe(space->machine(), "DIAL1", 0) & 0xff;
case 1:
- return input_port_read_safe(space->machine, "DIAL1", 0) >> 8;
+ return input_port_read_safe(space->machine(), "DIAL1", 0) >> 8;
case 2:
- return input_port_read_safe(space->machine, "DIAL2", 0) & 0xff;
+ return input_port_read_safe(space->machine(), "DIAL2", 0) & 0xff;
case 3:
- return input_port_read_safe(space->machine, "DIAL2", 0) >> 8;
+ return input_port_read_safe(space->machine(), "DIAL2", 0) >> 8;
case 4:
- return input_port_read_safe(space->machine, "DIAL3", 0) & 0xff;
+ return input_port_read_safe(space->machine(), "DIAL3", 0) & 0xff;
case 5:
- return input_port_read_safe(space->machine, "DIAL3", 0) >> 8;
+ return input_port_read_safe(space->machine(), "DIAL3", 0) >> 8;
case 6:
- return input_port_read_safe(space->machine, "DIAL4", 0) & 0xff;
+ return input_port_read_safe(space->machine(), "DIAL4", 0) & 0xff;
case 7:
- return input_port_read_safe(space->machine, "DIAL4", 0) >> 8;
+ return input_port_read_safe(space->machine(), "DIAL4", 0) >> 8;
case 8:
{
@@ -676,9 +676,9 @@ static WRITE16_HANDLER( iod_w )
// Cpu #1 reset control
-static void reset_reset(running_machine *machine)
+static void reset_reset(running_machine &machine)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
int changed = state->resetcontrol ^ state->prev_resetcontrol;
if(changed & 2) {
if(state->resetcontrol & 2) {
@@ -698,20 +698,20 @@ static void reset_reset(running_machine *machine)
static void resetcontrol_w(address_space *space, UINT8 data)
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
state->resetcontrol = data;
logerror("Reset control %02x ('%s':%x)\n", state->resetcontrol, space->cpu->tag(), cpu_get_pc(space->cpu));
- reset_reset(space->machine);
+ reset_reset(space->machine());
}
// Rom board bank access
-static void reset_bank(running_machine *machine)
+static void reset_bank(running_machine &machine)
{
- segas24_state *state = machine->driver_data<segas24_state>();
- if (machine->region("romboard")->base())
+ segas24_state *state = machine.driver_data<segas24_state>();
+ if (machine.region("romboard")->base())
{
memory_set_bank(machine, "bank1", state->curbank & 15);
memory_set_bank(machine, "bank2", state->curbank & 15);
@@ -720,16 +720,16 @@ static void reset_bank(running_machine *machine)
static READ16_HANDLER( curbank_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
return state->curbank;
}
static WRITE16_HANDLER( curbank_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(ACCESSING_BITS_0_7) {
state->curbank = data & 0xff;
- reset_bank(space->machine);
+ reset_bank(space->machine());
}
}
@@ -748,13 +748,13 @@ static const UINT8 dcclub_mlt[8] = { 4, 7, 3, 0, 2, 6, 5, 1 };
static READ16_HANDLER( mlatch_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
return state->mlatch;
}
static WRITE16_HANDLER( mlatch_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(ACCESSING_BITS_0_7) {
int i;
UINT8 mxor = 0;
@@ -791,27 +791,27 @@ enum {
static TIMER_DEVICE_CALLBACK( irq_timer_cb )
{
- segas24_state *state = timer.machine->driver_data<segas24_state>();
+ segas24_state *state = timer.machine().driver_data<segas24_state>();
state->irq_timer_pend0 = state->irq_timer_pend1 = 1;
if(state->irq_allow0 & (1 << IRQ_TIMER))
- cputag_set_input_line(timer.machine, "maincpu", IRQ_TIMER+1, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", IRQ_TIMER+1, ASSERT_LINE);
if(state->irq_allow1 & (1 << IRQ_TIMER))
- cputag_set_input_line(timer.machine, "sub", IRQ_TIMER+1, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "sub", IRQ_TIMER+1, ASSERT_LINE);
}
static TIMER_DEVICE_CALLBACK( irq_timer_clear_cb )
{
- segas24_state *state = timer.machine->driver_data<segas24_state>();
+ segas24_state *state = timer.machine().driver_data<segas24_state>();
state->irq_sprite = state->irq_vblank = 0;
- cputag_set_input_line(timer.machine, "maincpu", IRQ_VBLANK+1, CLEAR_LINE);
- cputag_set_input_line(timer.machine, "maincpu", IRQ_SPRITE+1, CLEAR_LINE);
- cputag_set_input_line(timer.machine, "sub", IRQ_VBLANK+1, CLEAR_LINE);
- cputag_set_input_line(timer.machine, "sub", IRQ_SPRITE+1, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", IRQ_VBLANK+1, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", IRQ_SPRITE+1, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "sub", IRQ_VBLANK+1, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "sub", IRQ_SPRITE+1, CLEAR_LINE);
}
-static void irq_init(running_machine *machine)
+static void irq_init(running_machine &machine)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
state->irq_timera = 0;
state->irq_timerb = 0;
state->irq_allow0 = 0;
@@ -820,13 +820,13 @@ static void irq_init(running_machine *machine)
state->irq_timer_pend1 = 0;
state->irq_vblank = 0;
state->irq_sprite = 0;
- state->irq_timer = machine->device<timer_device>("irq_timer");
- state->irq_timer_clear = machine->device<timer_device>("irq_timer_clear");
+ state->irq_timer = machine.device<timer_device>("irq_timer");
+ state->irq_timer_clear = machine.device<timer_device>("irq_timer_clear");
}
-static void irq_timer_reset(running_machine *machine)
+static void irq_timer_reset(running_machine &machine)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
int freq = (state->irq_timerb << 12) | state->irq_timera;
freq &= 0x1fff;
@@ -836,13 +836,13 @@ static void irq_timer_reset(running_machine *machine)
static WRITE16_HANDLER(irq_w)
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
switch(offset) {
case 0: {
UINT16 old_ta = state->irq_timera;
COMBINE_DATA(&state->irq_timera);
if(old_ta != state->irq_timera)
- irq_timer_reset(space->machine);
+ irq_timer_reset(space->machine());
break;
}
case 1:
@@ -850,31 +850,31 @@ static WRITE16_HANDLER(irq_w)
UINT8 old_tb = state->irq_timerb;
state->irq_timerb = data;
if(old_tb != state->irq_timerb)
- irq_timer_reset(space->machine);
+ irq_timer_reset(space->machine());
}
break;
case 2:
state->irq_allow0 = data;
state->irq_timer_pend0 = 0;
- cputag_set_input_line(space->machine, "maincpu", IRQ_TIMER+1, CLEAR_LINE);
- cputag_set_input_line(space->machine, "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "maincpu", IRQ_VBLANK+1, state->irq_vblank && (state->irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "maincpu", IRQ_SPRITE+1, state->irq_sprite && (state->irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", IRQ_VBLANK+1, state->irq_vblank && (state->irq_allow0 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", IRQ_SPRITE+1, state->irq_sprite && (state->irq_allow0 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
break;
case 3:
state->irq_allow1 = data;
state->irq_timer_pend1 = 0;
- cputag_set_input_line(space->machine, "sub", IRQ_TIMER+1, CLEAR_LINE);
- cputag_set_input_line(space->machine, "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "sub", IRQ_VBLANK+1, state->irq_vblank && (state->irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "sub", IRQ_SPRITE+1, state->irq_sprite && (state->irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", IRQ_TIMER+1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", IRQ_VBLANK+1, state->irq_vblank && (state->irq_allow1 & (1 << IRQ_VBLANK)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", IRQ_SPRITE+1, state->irq_sprite && (state->irq_allow1 & (1 << IRQ_SPRITE)) ? ASSERT_LINE : CLEAR_LINE);
break;
}
}
static READ16_HANDLER(irq_r)
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
switch(offset) {
case 0: {
int pc = cpu_get_pc(space->cpu);
@@ -896,11 +896,11 @@ static READ16_HANDLER(irq_r)
}
case 2:
state->irq_timer_pend0 = 0;
- cputag_set_input_line(space->machine, "maincpu", IRQ_TIMER+1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", IRQ_TIMER+1, CLEAR_LINE);
break;
case 3:
state->irq_timer_pend1 = 0;
- cputag_set_input_line(space->machine, "sub", IRQ_TIMER+1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", IRQ_TIMER+1, CLEAR_LINE);
break;
}
return 0xffff;
@@ -908,7 +908,7 @@ static READ16_HANDLER(irq_r)
static INTERRUPT_GEN(irq_vbl)
{
- segas24_state *state = device->machine->driver_data<segas24_state>();
+ segas24_state *state = device->machine().driver_data<segas24_state>();
int irq, mask;
if(cpu_getiloops(device)) {
@@ -924,10 +924,10 @@ static INTERRUPT_GEN(irq_vbl)
mask = 1 << irq;
if(state->irq_allow0 & mask)
- cputag_set_input_line(device->machine, "maincpu", 1+irq, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 1+irq, ASSERT_LINE);
if(state->irq_allow1 & mask)
- cputag_set_input_line(device->machine, "sub", 1+irq, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "sub", 1+irq, ASSERT_LINE);
if(!cpu_getiloops(device)) {
// Ensure one index pulse every 20 frames
@@ -941,10 +941,10 @@ static INTERRUPT_GEN(irq_vbl)
static void irq_ym(device_t *device, int irq)
{
- segas24_state *state = device->machine->driver_data<segas24_state>();
+ segas24_state *state = device->machine().driver_data<segas24_state>();
state->irq_yms = irq;
- cputag_set_input_line(device->machine, "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(device->machine, "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", IRQ_YM2151+1, state->irq_yms && (state->irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sub", IRQ_YM2151+1, state->irq_yms && (state->irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1073,11 +1073,11 @@ ADDRESS_MAP_END
static MACHINE_START( system24 )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
if (state->track_size)
- machine->device<nvram_device>("floppy_nvram")->set_base(machine->region("floppy")->base(), 2*state->track_size);
+ machine.device<nvram_device>("floppy_nvram")->set_base(machine.region("floppy")->base(), 2*state->track_size);
- UINT8 *usr1 = machine->region("romboard")->base();
+ UINT8 *usr1 = machine.region("romboard")->base();
if (usr1)
{
memory_configure_bank(machine, "bank1", 0, 16, usr1, 0x40000);
@@ -1087,7 +1087,7 @@ static MACHINE_START( system24 )
static MACHINE_RESET( system24 )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
cputag_set_input_line(machine, "sub", INPUT_LINE_HALT, ASSERT_LINE);
state->prev_resetcontrol = state->resetcontrol = 0x06;
fdc_init(machine);
@@ -2161,7 +2161,7 @@ ROM_END
static DRIVER_INIT( qgh )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = qgh_mlt;
state->track_size = 0;
@@ -2169,7 +2169,7 @@ static DRIVER_INIT( qgh )
static DRIVER_INIT( dcclub )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = dcclub_mlt;
state->track_size = 0;
@@ -2177,7 +2177,7 @@ static DRIVER_INIT( dcclub )
static DRIVER_INIT( qrouka )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = qrouka_mlt;
state->track_size = 0;
@@ -2185,7 +2185,7 @@ static DRIVER_INIT( qrouka )
static DRIVER_INIT( quizmeku )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = quizmeku_mlt;
state->track_size = 0;
@@ -2193,7 +2193,7 @@ static DRIVER_INIT( quizmeku )
static DRIVER_INIT( mahmajn )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = mahmajn_mlt;
state->track_size = 0;
@@ -2202,7 +2202,7 @@ static DRIVER_INIT( mahmajn )
static DRIVER_INIT( mahmajn2 )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = mahmajn2_mlt;
state->track_size = 0;
@@ -2211,7 +2211,7 @@ static DRIVER_INIT( mahmajn2 )
static DRIVER_INIT( hotrod )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
@@ -2228,7 +2228,7 @@ static DRIVER_INIT( hotrod )
static DRIVER_INIT( bnzabros )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = bnzabros_mlt;
@@ -2246,7 +2246,7 @@ static DRIVER_INIT( bnzabros )
static DRIVER_INIT( sspirits )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
@@ -2255,7 +2255,7 @@ static DRIVER_INIT( sspirits )
static DRIVER_INIT( sspiritj )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2f00;
@@ -2264,7 +2264,7 @@ static DRIVER_INIT( sspiritj )
static DRIVER_INIT( dcclubfd )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = dcclub_mlt;
state->track_size = 0x2d00;
@@ -2274,7 +2274,7 @@ static DRIVER_INIT( dcclubfd )
static DRIVER_INIT( sgmast )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
@@ -2283,7 +2283,7 @@ static DRIVER_INIT( sgmast )
static DRIVER_INIT( qsww )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
@@ -2292,7 +2292,7 @@ static DRIVER_INIT( qsww )
static DRIVER_INIT( gground )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
@@ -2301,7 +2301,7 @@ static DRIVER_INIT( gground )
static DRIVER_INIT( crkdown )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
@@ -2310,7 +2310,7 @@ static DRIVER_INIT( crkdown )
static DRIVER_INIT( roughrac )
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
system24temp_sys16_io_set_callbacks(machine, hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
state->mlatch_table = 0;
state->track_size = 0x2d00;
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 3fe90d515a7..3b18157a0d7 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -373,8 +373,8 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the
*
*************************************/
-static void signal_v60_irq(running_machine *machine, int data);
-static void signal_sound_irq(running_machine *machine, int which);
+static void signal_v60_irq(running_machine &machine, int data);
+static void signal_sound_irq(running_machine &machine, int which);
@@ -386,13 +386,13 @@ static void signal_sound_irq(running_machine *machine, int which);
static MACHINE_RESET( system32 )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
/* initialize the interrupt controller */
memset(state->v60_irq_control, 0xff, sizeof(state->v60_irq_control));
/* allocate timers */
- state->v60_irq_timer[0] = machine->device<timer_device>("v60_irq0");
- state->v60_irq_timer[1] = machine->device<timer_device>("v60_irq1");
+ state->v60_irq_timer[0] = machine.device<timer_device>("v60_irq0");
+ state->v60_irq_timer[1] = machine.device<timer_device>("v60_irq1");
/* clear IRQ lines */
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
@@ -406,9 +406,9 @@ static MACHINE_RESET( system32 )
*
*************************************/
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
UINT8 effirq = state->v60_irq_control[7] & ~state->v60_irq_control[6] & 0x1f;
int vector;
@@ -427,9 +427,9 @@ static void update_irq_state(running_machine *machine)
}
-static void signal_v60_irq(running_machine *machine, int which)
+static void signal_v60_irq(running_machine &machine, int which)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
int i;
/* see if this interrupt input is mapped to any vectors; if so, mark them */
@@ -442,13 +442,13 @@ static void signal_v60_irq(running_machine *machine, int which)
static TIMER_DEVICE_CALLBACK( signal_v60_irq_callback )
{
- signal_v60_irq(timer.machine, param);
+ signal_v60_irq(timer.machine(), param);
}
static void int_control_w(address_space *space, int offset, UINT8 data)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
int duration;
// logerror("%06X:int_control_w(%X) = %02X\n", cpu_get_pc(space->cpu), offset, data);
@@ -468,12 +468,12 @@ static void int_control_w(address_space *space, int offset, UINT8 data)
case 6: /* mask */
state->v60_irq_control[offset] = data;
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
break;
case 7: /* acknowledge */
state->v60_irq_control[offset] &= data;
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
break;
case 8:
@@ -502,7 +502,7 @@ static void int_control_w(address_space *space, int offset, UINT8 data)
case 13:
case 14:
case 15: /* signal IRQ to sound CPU */
- signal_sound_irq(space->machine, SOUND_IRQ_V60);
+ signal_sound_irq(space->machine(), SOUND_IRQ_V60);
break;
}
}
@@ -571,10 +571,10 @@ static TIMER_CALLBACK( end_of_vblank_int )
static INTERRUPT_GEN( start_of_vblank_int )
{
- segas32_state *state = device->machine->driver_data<segas32_state>();
- signal_v60_irq(device->machine, MAIN_IRQ_VBSTART);
- system32_set_vblank(device->machine, 1);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(0), FUNC(end_of_vblank_int));
+ segas32_state *state = device->machine().driver_data<segas32_state>();
+ signal_v60_irq(device->machine(), MAIN_IRQ_VBSTART);
+ system32_set_vblank(device->machine(), 1);
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(0), FUNC(end_of_vblank_int));
if (state->system32_prot_vblank)
(*state->system32_prot_vblank)(device);
}
@@ -589,7 +589,7 @@ static INTERRUPT_GEN( start_of_vblank_int )
static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, UINT16 mem_mask)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const char *const portnames[2][8] =
{
{ "P1_A", "P2_A", "PORTC_A", "PORTD_A", "SERVICE12_A", "SERVICE34_A", "PORTG_A", "PORTH_A" },
@@ -613,7 +613,7 @@ static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, U
return state->misc_io_data[which][offset];
/* otherwise, return an input port */
- return input_port_read_safe(space->machine, portnames[which][offset], 0xffff);
+ return input_port_read_safe(space->machine(), portnames[which][offset], 0xffff);
/* 'SEGA' protection */
case 0x10/2:
@@ -641,7 +641,7 @@ static UINT16 common_io_chip_r(address_space *space, int which, offs_t offset, U
static void common_io_chip_w(address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
UINT8 old;
/* only LSB matters */
@@ -673,15 +673,15 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
if (which == 0)
{
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_write_bit(device, data & 0x80);
eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
}
-/* coin_lockout_w(space->machine, 1 + 2*which, data & 0x08);
- coin_lockout_w(space->machine, 0 + 2*which, data & 0x04);*/
- coin_counter_w(space->machine, 1 + 2*which, data & 0x02);
- coin_counter_w(space->machine, 0 + 2*which, data & 0x01);
+/* coin_lockout_w(space->machine(), 1 + 2*which, data & 0x08);
+ coin_lockout_w(space->machine(), 0 + 2*which, data & 0x04);*/
+ coin_counter_w(space->machine(), 1 + 2*which, data & 0x02);
+ coin_counter_w(space->machine(), 0 + 2*which, data & 0x01);
break;
/* tile banking */
@@ -691,7 +691,7 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
else
{
/* multi-32 EEPROM access */
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_write_bit(device, data & 0x80);
eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
@@ -702,7 +702,7 @@ static void common_io_chip_w(address_space *space, int which, offs_t offset, UIN
case 0x1c/2:
state->system32_displayenable[which] = (data & 0x02);
if (which == 0)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
break;
}
}
@@ -761,7 +761,7 @@ static WRITE32_HANDLER( io_chip_1_w )
static READ16_HANDLER( io_expansion_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (state->custom_io_r[0])
return (*state->custom_io_r[0])(space, offset, mem_mask);
else
@@ -772,7 +772,7 @@ static READ16_HANDLER( io_expansion_r )
static WRITE16_HANDLER( io_expansion_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
/* only LSB matters */
if (!ACCESSING_BITS_0_7)
return;
@@ -786,7 +786,7 @@ static WRITE16_HANDLER( io_expansion_w )
static READ32_HANDLER( io_expansion_0_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (state->custom_io_r[0])
return (*state->custom_io_r[0])(space, offset*2+0, mem_mask) |
((*state->custom_io_r[0])(space, offset*2+1, mem_mask >> 16) << 16);
@@ -798,7 +798,7 @@ static READ32_HANDLER( io_expansion_0_r )
static WRITE32_HANDLER( io_expansion_0_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
/* only LSB matters */
@@ -826,7 +826,7 @@ static WRITE32_HANDLER( io_expansion_0_w )
static READ32_HANDLER( io_expansion_1_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (state->custom_io_r[1])
return (*state->custom_io_r[1])(space, offset*2+0, mem_mask) |
((*state->custom_io_r[1])(space, offset*2+1, mem_mask >> 16) << 16);
@@ -838,7 +838,7 @@ static READ32_HANDLER( io_expansion_1_r )
static WRITE32_HANDLER( io_expansion_1_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
/* only LSB matters */
if (ACCESSING_BITS_0_7)
{
@@ -866,7 +866,7 @@ static WRITE32_HANDLER( io_expansion_1_w )
static READ16_HANDLER( analog_custom_io_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
UINT16 result;
switch (offset)
{
@@ -885,7 +885,7 @@ static READ16_HANDLER( analog_custom_io_r )
static WRITE16_HANDLER( analog_custom_io_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const char *const names[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4" };
switch (offset)
{
@@ -893,7 +893,7 @@ static WRITE16_HANDLER( analog_custom_io_w )
case 0x12/2:
case 0x14/2:
case 0x16/2:
- state->analog_value[offset & 3] = input_port_read_safe(space->machine, names[offset & 3], 0);
+ state->analog_value[offset & 3] = input_port_read_safe(space->machine(), names[offset & 3], 0);
return;
}
logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(space->cpu), offset*2, data, mem_mask);
@@ -909,7 +909,7 @@ static READ16_HANDLER( extra_custom_io_r )
case 0x22/2:
case 0x24/2:
case 0x26/2:
- return input_port_read_safe(space->machine, names[offset & 3], 0xffff);
+ return input_port_read_safe(space->machine(), names[offset & 3], 0xffff);
}
logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(space->cpu), offset*2, mem_mask);
@@ -919,7 +919,7 @@ static READ16_HANDLER( extra_custom_io_r )
static WRITE16_HANDLER( orunners_custom_io_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const char *const names[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4", "ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" };
switch (offset)
{
@@ -927,7 +927,7 @@ static WRITE16_HANDLER( orunners_custom_io_w )
case 0x12/2:
case 0x14/2:
case 0x16/2:
- state->analog_value[offset & 3] = input_port_read_safe(space->machine, names[state->analog_bank * 4 + (offset & 3)], 0);
+ state->analog_value[offset & 3] = input_port_read_safe(space->machine(), names[state->analog_bank * 4 + (offset & 3)], 0);
return;
case 0x20/2:
@@ -940,7 +940,7 @@ static WRITE16_HANDLER( orunners_custom_io_w )
static READ16_HANDLER( sonic_custom_io_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const char *const names[] = { "TRACKX1", "TRACKY1", "TRACKX2", "TRACKY2", "TRACKX3", "TRACKY3" };
switch (offset)
@@ -951,7 +951,7 @@ static READ16_HANDLER( sonic_custom_io_r )
case 0x0c/2:
case 0x10/2:
case 0x14/2:
- return (UINT8)(input_port_read(space->machine, names[offset/2]) - state->sonic_last[offset/2]);
+ return (UINT8)(input_port_read(space->machine(), names[offset/2]) - state->sonic_last[offset/2]);
}
logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(space->cpu), offset*2, mem_mask);
@@ -961,7 +961,7 @@ static READ16_HANDLER( sonic_custom_io_r )
static WRITE16_HANDLER( sonic_custom_io_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const char *const names[] = { "TRACKX1", "TRACKY1", "TRACKX2", "TRACKY2", "TRACKX3", "TRACKY3" };
switch (offset)
@@ -969,8 +969,8 @@ static WRITE16_HANDLER( sonic_custom_io_w )
case 0x00/2:
case 0x08/2:
case 0x10/2:
- state->sonic_last[offset/2 + 0] = input_port_read(space->machine, names[offset/2 + 0]);
- state->sonic_last[offset/2 + 1] = input_port_read(space->machine, names[offset/2 + 1]);
+ state->sonic_last[offset/2 + 0] = input_port_read(space->machine(), names[offset/2 + 0]);
+ state->sonic_last[offset/2 + 1] = input_port_read(space->machine(), names[offset/2 + 1]);
return;
}
@@ -992,7 +992,7 @@ static WRITE16_HANDLER( random_number_16_w )
static READ16_HANDLER( random_number_16_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE32_HANDLER( random_number_32_w )
@@ -1002,7 +1002,7 @@ static WRITE32_HANDLER( random_number_32_w )
static READ32_HANDLER( random_number_32_r )
{
- return space->machine->rand() ^ (space->machine->rand() << 16);
+ return space->machine().rand() ^ (space->machine().rand() << 16);
}
@@ -1015,14 +1015,14 @@ static READ32_HANDLER( random_number_32_r )
static READ16_HANDLER( shared_ram_16_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->z80_shared_ram[offset*2+0] | (state->z80_shared_ram[offset*2+1] << 8);
}
static WRITE16_HANDLER( shared_ram_16_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (ACCESSING_BITS_0_7)
state->z80_shared_ram[offset*2+0] = data;
if (ACCESSING_BITS_8_15)
@@ -1032,7 +1032,7 @@ static WRITE16_HANDLER( shared_ram_16_w )
static READ32_HANDLER( shared_ram_32_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->z80_shared_ram[offset*4+0] | (state->z80_shared_ram[offset*4+1] << 8) |
(state->z80_shared_ram[offset*4+2] << 16) | (state->z80_shared_ram[offset*4+3] << 24);
}
@@ -1040,7 +1040,7 @@ static READ32_HANDLER( shared_ram_32_r )
static WRITE32_HANDLER( shared_ram_32_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (ACCESSING_BITS_0_7)
state->z80_shared_ram[offset*4+0] = data;
if (ACCESSING_BITS_8_15)
@@ -1059,9 +1059,9 @@ static WRITE32_HANDLER( shared_ram_32_w )
*
*************************************/
-static void update_sound_irq_state(running_machine *machine)
+static void update_sound_irq_state(running_machine &machine)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
UINT8 effirq = state->sound_irq_input & ~state->sound_irq_control[3] & 0x07;
int vector;
@@ -1080,9 +1080,9 @@ static void update_sound_irq_state(running_machine *machine)
}
-static void signal_sound_irq(running_machine *machine, int which)
+static void signal_sound_irq(running_machine &machine, int which)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
int i;
/* see if this interrupt input is mapped to any vectors; if so, mark them */
@@ -1093,9 +1093,9 @@ static void signal_sound_irq(running_machine *machine, int which)
}
-static void clear_sound_irq(running_machine *machine, int which)
+static void clear_sound_irq(running_machine &machine, int which)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
int i;
for (i = 0; i < 3; i++)
if (state->sound_irq_control[i] == which)
@@ -1106,34 +1106,34 @@ static void clear_sound_irq(running_machine *machine, int which)
static WRITE8_HANDLER( sound_int_control_lo_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
/* odd offsets are interrupt acks */
if (offset & 1)
{
state->sound_irq_input &= data;
- update_sound_irq_state(space->machine);
+ update_sound_irq_state(space->machine());
}
/* high offsets signal an IRQ to the v60 */
if (offset & 4)
- signal_v60_irq(space->machine, MAIN_IRQ_SOUND);
+ signal_v60_irq(space->machine(), MAIN_IRQ_SOUND);
}
static WRITE8_HANDLER( sound_int_control_hi_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
state->sound_irq_control[offset] = data;
- update_sound_irq_state(space->machine);
+ update_sound_irq_state(space->machine());
}
static void ym3438_irq_handler(device_t *device, int state)
{
if (state)
- signal_sound_irq(device->machine, SOUND_IRQ_YM3438);
+ signal_sound_irq(device->machine(), SOUND_IRQ_YM3438);
else
- clear_sound_irq(device->machine, SOUND_IRQ_YM3438);
+ clear_sound_irq(device->machine(), SOUND_IRQ_YM3438);
}
@@ -1146,17 +1146,17 @@ static void ym3438_irq_handler(device_t *device, int state)
static WRITE8_HANDLER( sound_bank_lo_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
state->sound_bank = (state->sound_bank & ~0x3f) | (data & 0x3f);
- memory_set_bankptr(space->machine, "bank1", space->machine->region("soundcpu")->base() + 0x100000 + 0x2000 * state->sound_bank);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x100000 + 0x2000 * state->sound_bank);
}
static WRITE8_HANDLER( sound_bank_hi_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
state->sound_bank = (state->sound_bank & 0x3f) | ((data & 0x04) << 4) | ((data & 0x03) << 7);
- memory_set_bankptr(space->machine, "bank1", space->machine->region("soundcpu")->base() + 0x100000 + 0x2000 * state->sound_bank);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("soundcpu")->base() + 0x100000 + 0x2000 * state->sound_bank);
}
@@ -1181,14 +1181,14 @@ static WRITE8_DEVICE_HANDLER( scross_bank_w )
static READ8_HANDLER( sound_dummy_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->sound_dummy_value;
}
static WRITE8_HANDLER( sound_dummy_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
state->sound_dummy_value = data;
}
@@ -2141,13 +2141,13 @@ static const ym3438_interface ym3438_config =
static WRITE16_HANDLER( dual_pcb_comms_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA(&state->dual_pcb_comms[offset]);
}
static READ16_HANDLER( dual_pcb_comms_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->dual_pcb_comms[offset];
}
@@ -3794,9 +3794,9 @@ ROM_END
*
*************************************/
-static void segas32_common_init(running_machine *machine, read16_space_func custom_r, write16_space_func custom_w)
+static void segas32_common_init(running_machine &machine, read16_space_func custom_r, write16_space_func custom_w)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
/* reset the custom handlers and other pointers */
state->custom_io_r[0] = custom_r;
state->custom_io_w[0] = custom_w;
@@ -3991,7 +3991,7 @@ static void scross_sw2_output( int which, UINT16 data )
static DRIVER_INIT( alien3 )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
state->sw1_output = alien3_sw1_output;
}
@@ -4008,16 +4008,16 @@ static READ16_HANDLER( arescue_slavebusy_r )
static DRIVER_INIT( arescue )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00007, FUNC(arescue_dsp_r), FUNC(arescue_dsp_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00007, FUNC(arescue_dsp_r), FUNC(arescue_dsp_w));
state->dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x810000, 0x810001, FUNC(arescue_handshake_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x81000e, 0x81000f, FUNC(arescue_slavebusy_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x810000, 0x810001, FUNC(arescue_handshake_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x81000e, 0x81000f, FUNC(arescue_slavebusy_r));
state->sw1_output = arescue_sw1_output;
}
@@ -4028,30 +4028,30 @@ static DRIVER_INIT( arabfgt )
segas32_common_init(machine, extra_custom_io_r, NULL);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa00100, 0xa0011f, FUNC(arf_wakeup_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00fff, FUNC(arabfgt_protection_r), FUNC(arabfgt_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa00100, 0xa0011f, FUNC(arf_wakeup_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00fff, FUNC(arabfgt_protection_r), FUNC(arabfgt_protection_w));
}
static DRIVER_INIT( brival )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, extra_custom_io_r, NULL);
/* install protection handlers */
state->system32_protram = auto_alloc_array(machine, UINT16, 0x1000/2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20ba00, 0x20ba07, FUNC(brival_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa00000, 0xa00fff, FUNC(brival_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20ba00, 0x20ba07, FUNC(brival_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa00000, 0xa00fff, FUNC(brival_protection_w));
}
static DRIVER_INIT( darkedge )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, extra_custom_io_r, NULL);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa7ffff, FUNC(darkedge_protection_r), FUNC(darkedge_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa7ffff, FUNC(darkedge_protection_r), FUNC(darkedge_protection_w));
state->system32_prot_vblank = darkedge_fd1149_vblank;
}
@@ -4060,7 +4060,7 @@ static DRIVER_INIT( dbzvrvs )
segas32_common_init(machine, NULL, NULL);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa7ffff, FUNC(dbzvrvs_protection_r), FUNC(dbzvrvs_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa7ffff, FUNC(dbzvrvs_protection_r), FUNC(dbzvrvs_protection_w));
}
static WRITE16_HANDLER( f1en_comms_echo_w )
@@ -4072,14 +4072,14 @@ static WRITE16_HANDLER( f1en_comms_echo_w )
static DRIVER_INIT( f1en )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
state->dual_pcb_comms = auto_alloc_array(machine, UINT16, 0x1000/2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x810fff, FUNC(dual_pcb_comms_r), FUNC(dual_pcb_comms_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x818000, 0x818003, FUNC(dual_pcb_masterslave));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x810048, 0x810049, FUNC(f1en_comms_echo_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x810048, 0x810049, FUNC(f1en_comms_echo_w));
state->sw1_output = radm_sw1_output;
}
@@ -4087,7 +4087,7 @@ static DRIVER_INIT( f1en )
static DRIVER_INIT( f1lap )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
state->sw1_output = f1lap_sw1_output;
}
@@ -4098,13 +4098,13 @@ static DRIVER_INIT( ga2 )
segas32_common_init(machine, extra_custom_io_r, NULL);
decrypt_ga2_protrom(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00fff, FUNC(ga2_dpram_r), FUNC(ga2_dpram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa00000, 0xa00fff, FUNC(ga2_dpram_r), FUNC(ga2_dpram_w));
}
static DRIVER_INIT( harddunk )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, extra_custom_io_r, NULL);
state->sw1_output = harddunk_sw1_output;
state->sw2_output = harddunk_sw2_output;
@@ -4120,9 +4120,9 @@ static DRIVER_INIT( holo )
static DRIVER_INIT( jpark )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
- UINT16 *pROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *pROM = (UINT16 *)machine.region("maincpu")->base();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
@@ -4135,7 +4135,7 @@ static DRIVER_INIT( jpark )
static DRIVER_INIT( orunners )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, orunners_custom_io_w);
state->sw1_output = orunners_sw1_output;
state->sw2_output = orunners_sw2_output;
@@ -4144,7 +4144,7 @@ static DRIVER_INIT( orunners )
static DRIVER_INIT( radm )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
state->sw1_output = radm_sw1_output;
state->sw2_output = radm_sw2_output;
@@ -4153,7 +4153,7 @@ static DRIVER_INIT( radm )
static DRIVER_INIT( radr )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
state->sw1_output = radm_sw1_output;
state->sw2_output = radr_sw2_output;
@@ -4162,10 +4162,10 @@ static DRIVER_INIT( radr )
static DRIVER_INIT( scross )
{
- segas32_state *state = machine->driver_data<segas32_state>();
- multipcm_device *multipcm = machine->device<multipcm_device>("sega");
+ segas32_state *state = machine.driver_data<segas32_state>();
+ multipcm_device *multipcm = machine.device<multipcm_device>("sega");
segas32_common_init(machine, analog_custom_io_r, analog_custom_io_w);
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*multipcm, 0xb0, 0xbf, FUNC(scross_bank_w));
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*multipcm, 0xb0, 0xbf, FUNC(scross_bank_w));
state->sw1_output = scross_sw1_output;
state->sw2_output = scross_sw2_output;
@@ -4183,7 +4183,7 @@ static DRIVER_INIT( sonic )
segas32_common_init(machine, sonic_custom_io_r, sonic_custom_io_w);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20E5C4, 0x20E5C5, FUNC(sonic_level_load_protection));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20E5C4, 0x20E5C5, FUNC(sonic_level_load_protection));
}
@@ -4208,13 +4208,13 @@ static DRIVER_INIT( svf )
static DRIVER_INIT( jleague )
{
segas32_common_init(machine, NULL, NULL);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20F700, 0x20F705, FUNC(jleague_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20F700, 0x20F705, FUNC(jleague_protection_w));
}
static DRIVER_INIT( titlef )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
segas32_common_init(machine, NULL, NULL);
state->sw1_output = titlef_sw1_output;
state->sw2_output = titlef_sw2_output;
diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c
index 7c395f4bf96..eca3fdc5baf 100644
--- a/src/mame/drivers/segaxbd.c
+++ b/src/mame/drivers/segaxbd.c
@@ -250,9 +250,9 @@ Notes:
*
*************************************/
-static void xboard_generic_init(running_machine *machine)
+static void xboard_generic_init(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* init the FD1094 */
fd1094_driver_init(machine, "maincpu", NULL);
@@ -267,10 +267,10 @@ static void xboard_generic_init(running_machine *machine)
state->gprider_hack = 0;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->subcpu = machine->device("sub");
- state->_315_5250_1 = machine->device("5250_main");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->subcpu = machine.device("sub");
+ state->_315_5250_1 = machine.device("5250_main");
state->save_item(NAME(state->iochip_force_input));
state->save_item(NAME(state->vblank_irq_state));
@@ -289,9 +289,9 @@ static void xboard_generic_init(running_machine *machine)
*
*************************************/
-static void update_main_irqs(running_machine *machine)
+static void update_main_irqs(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
int irq = 0;
if (state->timer_irq_state)
@@ -313,14 +313,14 @@ static void update_main_irqs(running_machine *machine)
if (irq)
{
device_set_input_line(state->maincpu, irq, ASSERT_LINE);
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
}
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- segas1x_state *state = timer.machine->driver_data<segas1x_state>();
+ segas1x_state *state = timer.machine().driver_data<segas1x_state>();
int scanline = param;
int next_scanline = (scanline + 2) % 262;
@@ -349,16 +349,16 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
/* update IRQs on the main CPU */
if (update)
- update_main_irqs(timer.machine);
+ update_main_irqs(timer.machine());
/* come back in 2 scanlines */
- timer.adjust(timer.machine->primary_screen->time_until_pos(next_scanline), next_scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(next_scanline), next_scanline);
}
-static void timer_ack_callback(running_machine *machine)
+static void timer_ack_callback(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* clear the timer IRQ */
state->timer_irq_state = 0;
@@ -375,7 +375,7 @@ static void timer_ack_callback(running_machine *machine)
static TIMER_CALLBACK( delayed_sound_data_w )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, param);
@@ -383,15 +383,15 @@ static TIMER_CALLBACK( delayed_sound_data_w )
}
-static void sound_data_w(running_machine *machine, UINT8 data)
+static void sound_data_w(running_machine &machine, UINT8 data)
{
- machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ machine.scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
static void sound_cpu_irq(device_t *device, int state)
{
- segas1x_state *driver = device->machine->driver_data<segas1x_state>();
+ segas1x_state *driver = device->machine().driver_data<segas1x_state>();
device_set_input_line(driver->soundcpu, 0, state);
}
@@ -399,7 +399,7 @@ static void sound_cpu_irq(device_t *device, int state)
static READ8_HANDLER( sound_data_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space, offset);
@@ -415,24 +415,24 @@ static READ8_HANDLER( sound_data_r )
static void xboard_reset(device_t *device)
{
- segas1x_state *state = device->machine->driver_data<segas1x_state>();
+ segas1x_state *state = device->machine().driver_data<segas1x_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, PULSE_LINE);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static MACHINE_RESET( xboard )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
- fd1094_machine_init(machine->device("maincpu"));
+ segas1x_state *state = machine.driver_data<segas1x_state>();
+ fd1094_machine_init(machine.device("maincpu"));
segaic16_tilemap_reset(machine, 0);
/* hook the RESET line, which resets CPU #1 */
- m68k_set_reset_callback(machine->device("maincpu"), xboard_reset);
+ m68k_set_reset_callback(machine.device("maincpu"), xboard_reset);
/* start timers to track interrupts */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(1), 1);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
}
@@ -445,12 +445,12 @@ static MACHINE_RESET( xboard )
static READ16_HANDLER( adc_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
int which = (state->iochip_regs[0][2] >> 2) & 7;
/* on the write, latch the selected input port and stash the value */
- int value = input_port_read_safe(space->machine, ports[which], 0x0010);
+ int value = input_port_read_safe(space->machine(), ports[which], 0x0010);
/* reverse some port values */
if (state->adc_reverse[which])
@@ -466,9 +466,9 @@ static WRITE16_HANDLER( adc_w )
}
-INLINE UINT16 iochip_r(running_machine *machine, int which, int port, int inputval)
+INLINE UINT16 iochip_r(running_machine &machine, int which, int port, int inputval)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
UINT16 result = state->iochip_regs[which][port];
/* if there's custom I/O, do that to get the input value */
@@ -511,23 +511,23 @@ static READ16_HANDLER( iochip_0_r )
D6: /INTR of ADC0804
D5-D0: CN C pin 24-19 (switch state 0= open, 1= closed)
*/
- return iochip_r(space->machine, 0, 0, input_port_read(space->machine, "IO0PORTA"));
+ return iochip_r(space->machine(), 0, 0, input_port_read(space->machine(), "IO0PORTA"));
case 1:
/* I/O port: CN C pins 17,15,13,11,9,7,5,3 */
- return iochip_r(space->machine, 0, 1, input_port_read(space->machine, "IO0PORTB"));
+ return iochip_r(space->machine(), 0, 1, input_port_read(space->machine(), "IO0PORTB"));
case 2:
/* Output port */
- return iochip_r(space->machine, 0, 2, 0);
+ return iochip_r(space->machine(), 0, 2, 0);
case 3:
/* Output port */
- return iochip_r(space->machine, 0, 3, 0);
+ return iochip_r(space->machine(), 0, 3, 0);
case 4:
/* Unused */
- return iochip_r(space->machine, 0, 4, 0);
+ return iochip_r(space->machine(), 0, 4, 0);
}
/* everything else returns 0 */
@@ -537,7 +537,7 @@ static READ16_HANDLER( iochip_0_r )
static WRITE16_HANDLER( iochip_0_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
UINT8 oldval;
/* access is via the low 8 bits */
@@ -563,7 +563,7 @@ static WRITE16_HANDLER( iochip_0_w )
D0: Sound section reset (1= normal operation, 0= reset)
*/
if (((oldval ^ data) & 0x40) && !(data & 0x40)) watchdog_reset_w(space,0,0);
- segaic16_set_display_enable(space->machine, data & 0x20);
+ segaic16_set_display_enable(space->machine(), data & 0x20);
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
return;
@@ -572,7 +572,7 @@ static WRITE16_HANDLER( iochip_0_w )
D7: Amplifier mute control (1= sounding, 0= muted)
D6-D0: CN D pin A17-A23 (output level 1= high, 0= low)
*/
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
return;
}
@@ -587,23 +587,23 @@ static READ16_HANDLER( iochip_1_r )
{
case 0:
/* Input port: switches, CN D pin A1-8 (switch state 1= open, 0= closed) */
- return iochip_r(space->machine, 1, 0, input_port_read(space->machine, "IO1PORTA"));
+ return iochip_r(space->machine(), 1, 0, input_port_read(space->machine(), "IO1PORTA"));
case 1:
/* Input port: switches, CN D pin A9-16 (switch state 1= open, 0= closed) */
- return iochip_r(space->machine, 1, 1, input_port_read(space->machine, "IO1PORTB"));
+ return iochip_r(space->machine(), 1, 1, input_port_read(space->machine(), "IO1PORTB"));
case 2:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(space->machine, 1, 2, input_port_read(space->machine, "IO1PORTC"));
+ return iochip_r(space->machine(), 1, 2, input_port_read(space->machine(), "IO1PORTC"));
case 3:
/* Input port: DIP switches (1= off, 0= on) */
- return iochip_r(space->machine, 1, 3, input_port_read(space->machine, "IO1PORTD"));
+ return iochip_r(space->machine(), 1, 3, input_port_read(space->machine(), "IO1PORTD"));
case 4:
/* Unused */
- return iochip_r(space->machine, 1, 4, 0);
+ return iochip_r(space->machine(), 1, 4, 0);
}
/* everything else returns 0 */
@@ -613,7 +613,7 @@ static READ16_HANDLER( iochip_1_r )
static WRITE16_HANDLER( iochip_1_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
/* access is via the low 8 bits */
if (!ACCESSING_BITS_0_7)
@@ -649,7 +649,7 @@ static WRITE16_HANDLER( iocontrol_w )
static WRITE16_HANDLER( aburner2_iochip_0_D_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
/* access is via the low 8 bits */
if (!ACCESSING_BITS_0_7)
@@ -659,10 +659,10 @@ static WRITE16_HANDLER( aburner2_iochip_0_D_w )
output_set_lamp_value(2, (data >> 1) & 0x01); /* altitude warning lamp */
output_set_led_value(0, (data >> 2) & 0x01); /* start lamp */
- coin_counter_w(space->machine, 0, (data >> 4) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 0x01);
output_set_lamp_value(0, (data >> 5) & 0x01); /* lock on lamp */
output_set_lamp_value(1, (data >> 6) & 0x01); /* danger lamp */
- space->machine->sound().system_enable((data >> 7) & 0x01);
+ space->machine().sound().system_enable((data >> 7) & 0x01);
}
@@ -675,10 +675,10 @@ static WRITE16_HANDLER( aburner2_iochip_0_D_w )
static WRITE16_HANDLER( loffire_sync0_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
COMBINE_DATA(&state->loffire_sync[offset]);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
@@ -2816,19 +2816,19 @@ static DRIVER_INIT( generic_xboard )
static DRIVER_INIT( aburner2 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
xboard_generic_init(machine);
state->road_priority = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x140006, 0x140007, 0, 0x00fff0, FUNC(aburner2_iochip_0_D_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x140006, 0x140007, 0, 0x00fff0, FUNC(aburner2_iochip_0_D_w));
}
static DRIVER_INIT( aburner )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
xboard_generic_init(machine);
@@ -2838,26 +2838,26 @@ static DRIVER_INIT( aburner )
static DRIVER_INIT( loffire )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
xboard_generic_init(machine);
state->adc_reverse[1] = state->adc_reverse[3] = 1;
/* install extra synchronization on core shared memory */
- state->loffire_sync = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x29c000, 0x29c011, FUNC(loffire_sync0_w));
+ state->loffire_sync = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x29c000, 0x29c011, FUNC(loffire_sync0_w));
}
static DRIVER_INIT( smgp )
{
xboard_generic_init(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2f0000, 0x2f3fff, FUNC(smgp_excs_r), FUNC(smgp_excs_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2f0000, 0x2f3fff, FUNC(smgp_excs_r), FUNC(smgp_excs_w));
}
static DRIVER_INIT( gprider )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
xboard_generic_init(machine);
state->gprider_hack = 1;
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index 0028065a5e1..204e7b0626d 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -61,9 +61,9 @@ static UINT16 pdrift_bank;
*
*************************************/
-static void yboard_generic_init( running_machine *machine )
+static void yboard_generic_init( running_machine &machine )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* reset globals */
state->vblank_irq_state = 0;
@@ -81,9 +81,9 @@ static void yboard_generic_init( running_machine *machine )
*
*************************************/
-static void update_main_irqs(running_machine *machine)
+static void update_main_irqs(running_machine &machine)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
device_set_input_line(state->maincpu, 2, state->timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->subx, 2, state->timer_irq_state ? ASSERT_LINE : CLEAR_LINE);
@@ -96,7 +96,7 @@ static void update_main_irqs(running_machine *machine)
device_set_input_line(state->suby, 6, state->timer_irq_state && state->vblank_irq_state ? ASSERT_LINE : CLEAR_LINE);
if (state->timer_irq_state || state->vblank_irq_state)
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
@@ -136,7 +136,7 @@ static void update_main_irqs(running_machine *machine)
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- segas1x_state *state = timer.machine->driver_data<segas1x_state>();
+ segas1x_state *state = timer.machine().driver_data<segas1x_state>();
int scanline = param;
/* on scanline 'irq2_scanline' generate an IRQ2 */
@@ -168,10 +168,10 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
}
/* update IRQs on the main CPU */
- update_main_irqs(timer.machine);
+ update_main_irqs(timer.machine());
/* come back at the next appropriate scanline */
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
#if TWEAK_IRQ2_SCANLINE
if (scanline == 223)
@@ -179,10 +179,10 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
int old = state->irq2_scanline;
/* Q = -10 scanlines, W = -1 scanline, E = +1 scanline, R = +10 scanlines */
- if (input_code_pressed(timer->machine, KEYCODE_Q)) { while (input_code_pressed(timer->machine, KEYCODE_Q)) ; state->irq2_scanline -= 10; }
- if (input_code_pressed(timer->machine, KEYCODE_W)) { while (input_code_pressed(timer->machine, KEYCODE_W)) ; state->irq2_scanline -= 1; }
- if (input_code_pressed(timer->machine, KEYCODE_E)) { while (input_code_pressed(timer->machine, KEYCODE_E)) ; state->irq2_scanline += 1; }
- if (input_code_pressed(timer->machine, KEYCODE_R)) { while (input_code_pressed(timer->machine, KEYCODE_R)) ; state->irq2_scanline += 10; }
+ if (input_code_pressed(timer->machine(), KEYCODE_Q)) { while (input_code_pressed(timer->machine(), KEYCODE_Q)) ; state->irq2_scanline -= 10; }
+ if (input_code_pressed(timer->machine(), KEYCODE_W)) { while (input_code_pressed(timer->machine(), KEYCODE_W)) ; state->irq2_scanline -= 1; }
+ if (input_code_pressed(timer->machine(), KEYCODE_E)) { while (input_code_pressed(timer->machine(), KEYCODE_E)) ; state->irq2_scanline += 1; }
+ if (input_code_pressed(timer->machine(), KEYCODE_R)) { while (input_code_pressed(timer->machine(), KEYCODE_R)) ; state->irq2_scanline += 10; }
if (old != state->irq2_scanline)
popmessage("scanline = %d", state->irq2_scanline);
}
@@ -192,12 +192,12 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
static MACHINE_START( yboard )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->subx = machine->device("subx");
- state->suby = machine->device("suby");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->subx = machine.device("subx");
+ state->suby = machine.device("suby");
state->save_item(NAME(state->vblank_irq_state));
state->save_item(NAME(state->timer_irq_state));
@@ -209,11 +209,11 @@ static MACHINE_START( yboard )
static MACHINE_RESET( yboard )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
state->irq2_scanline = 170;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(223), 223);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(223), 223);
}
@@ -226,7 +226,7 @@ static MACHINE_RESET( yboard )
static void sound_cpu_irq(device_t *device, int state)
{
- segas1x_state *driver = device->machine->driver_data<segas1x_state>();
+ segas1x_state *driver = device->machine().driver_data<segas1x_state>();
device_set_input_line(driver->soundcpu, 0, state);
}
@@ -234,7 +234,7 @@ static void sound_cpu_irq(device_t *device, int state)
static TIMER_CALLBACK( delayed_sound_data_w )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, param);
@@ -245,13 +245,13 @@ static TIMER_CALLBACK( delayed_sound_data_w )
static WRITE16_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
}
static READ8_HANDLER( sound_data_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space, offset);
}
@@ -266,7 +266,7 @@ static READ8_HANDLER( sound_data_r )
static READ16_HANDLER( io_chip_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
offset &= 0x1f/2;
@@ -286,7 +286,7 @@ static READ16_HANDLER( io_chip_r )
return state->misc_io_data[offset];
/* otherwise, return an input port */
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
/* 'SEGA' protection */
case 0x10/2:
@@ -314,7 +314,7 @@ static READ16_HANDLER( io_chip_r )
static WRITE16_HANDLER( io_chip_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
UINT8 old;
/* generic implementation */
@@ -352,7 +352,7 @@ static WRITE16_HANDLER( io_chip_w )
D2 = YRES
D1-D0 = ADC0-1
*/
- segaic16_set_display_enable(space->machine, data & 0x80);
+ segaic16_set_display_enable(space->machine(), data & 0x80);
if (((old ^ data) & 0x20) && !(data & 0x20))
watchdog_reset_w(space, 0, 0);
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -368,7 +368,7 @@ static WRITE16_HANDLER( io_chip_w )
/* D7 = /MUTE */
/* D6-D0 = FLT31-25 */
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
break;
/* CNT register */
@@ -386,7 +386,7 @@ static WRITE16_HANDLER( io_chip_w )
static READ16_HANDLER( analog_r )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
int result = 0xff;
if (ACCESSING_BITS_0_7)
{
@@ -399,10 +399,10 @@ static READ16_HANDLER( analog_r )
static WRITE16_HANDLER( analog_w )
{
- segas1x_state *state = space->machine->driver_data<segas1x_state>();
+ segas1x_state *state = space->machine().driver_data<segas1x_state>();
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
int selected = ((offset & 3) == 3) ? (3 + (state->misc_io_data[0x08/2] & 3)) : (offset & 3);
- int value = input_port_read_safe(space->machine, ports[selected], 0xff);
+ int value = input_port_read_safe(space->machine(), ports[selected], 0xff);
state->analog_data[offset & 3] = value;
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 3df0120b958..d1b21647c87 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -743,7 +743,7 @@ Notes:
static UINT8 z80_fifoout_pop(address_space *space)
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
UINT8 r;
if (state->fifoout_wpos == state->fifoout_rpos)
{
@@ -765,7 +765,7 @@ static UINT8 z80_fifoout_pop(address_space *space)
static void z80_fifoout_push(address_space *space, UINT8 data)
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
state->fifoout_data[state->fifoout_wpos++] = data;
if (state->fifoout_wpos == FIFO_SIZE)
{
@@ -781,7 +781,7 @@ static void z80_fifoout_push(address_space *space, UINT8 data)
static UINT8 z80_fifoin_pop(address_space *space)
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
UINT8 r;
if (state->fifoin_wpos == state->fifoin_rpos)
{
@@ -803,7 +803,7 @@ static UINT8 z80_fifoin_pop(address_space *space)
static void z80_fifoin_push(address_space *space, UINT8 data)
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
state->fifoin_data[state->fifoin_wpos++] = data;
if(state->fifoin_wpos == FIFO_SIZE)
{
@@ -819,7 +819,7 @@ static void z80_fifoin_push(address_space *space, UINT8 data)
static READ32_HANDLER( sb_coin_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
UINT8 r = state->sb_coin_latch;
state->sb_coin_latch = 0;
@@ -828,7 +828,7 @@ static READ32_HANDLER( sb_coin_r )
static WRITE8_HANDLER( sb_coin_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (data)
state->sb_coin_latch = 0xa0 | data;
else
@@ -851,7 +851,7 @@ static WRITE32_HANDLER( sound_fifo_w )
static READ32_HANDLER( sound_fifo_status_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
UINT32 r = 0;
if (state->fifoout_read_request)
{
@@ -862,7 +862,7 @@ static READ32_HANDLER( sound_fifo_status_r )
static READ32_HANDLER( spi_int_r )
{
- cputag_set_input_line(space->machine, "maincpu", 0,CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "maincpu", 0,CLEAR_LINE );
return 0xffffffff;
}
@@ -873,11 +873,11 @@ static READ32_HANDLER( spi_unknown_r )
static WRITE32_DEVICE_HANDLER( eeprom_w )
{
- okim6295_device *oki2 = device->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki2 = device->machine().device<okim6295_device>("oki2");
// tile banks
if( ACCESSING_BITS_16_23 ) {
- rf2_set_layer_banks(device->machine, data >> 16);
+ rf2_set_layer_banks(device->machine(), data >> 16);
eeprom_write_bit(device, (data & 0x800000) ? 1 : 0);
eeprom_set_clock_line(device, (data & 0x400000) ? ASSERT_LINE : CLEAR_LINE);
eeprom_set_cs_line(device, (data & 0x200000) ? CLEAR_LINE : ASSERT_LINE);
@@ -890,7 +890,7 @@ static WRITE32_DEVICE_HANDLER( eeprom_w )
static WRITE32_HANDLER( z80_prg_fifo_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if( ACCESSING_BITS_0_7 ) {
if (state->z80_prg_fifo_pos<0x40000) state->z80_rom[state->z80_prg_fifo_pos] = data & 0xff;
state->z80_prg_fifo_pos++;
@@ -899,19 +899,19 @@ static WRITE32_HANDLER( z80_prg_fifo_w )
static WRITE32_HANDLER( z80_enable_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
// tile banks
if( ACCESSING_BITS_16_23 ) {
- rf2_set_layer_banks(space->machine, data >> 16);
+ rf2_set_layer_banks(space->machine(), data >> 16);
}
logerror("z80 data = %08x mask = %08x\n",data,mem_mask);
if( ACCESSING_BITS_0_7 ) {
if( data & 0x1 ) {
state->z80_prg_fifo_pos = 0;
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE );
} else {
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
}
}
}
@@ -920,7 +920,7 @@ static READ32_HANDLER( spi_controls1_r )
{
if( ACCESSING_BITS_0_7 )
{
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
}
return 0xffffffff;
}
@@ -929,28 +929,28 @@ static READ32_HANDLER( spi_controls2_r )
{
if( ACCESSING_BITS_0_7 )
{
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
return 0xffffffff;
}
static CUSTOM_INPUT( ejsakura_keyboard_r )
{
- seibuspi_state *state = field->port->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = field->port->machine().driver_data<seibuspi_state>();
switch(state->ejsakura_input_port)
{
case 0x01:
- return input_port_read(field->port->machine, "INPUT01");
+ return input_port_read(field->port->machine(), "INPUT01");
case 0x02:
- return input_port_read(field->port->machine, "INPUT02");
+ return input_port_read(field->port->machine(), "INPUT02");
case 0x04:
- return input_port_read(field->port->machine, "INPUT04");
+ return input_port_read(field->port->machine(), "INPUT04");
case 0x08:
- return input_port_read(field->port->machine, "INPUT08");
+ return input_port_read(field->port->machine(), "INPUT08");
case 0x10:
- return input_port_read(field->port->machine, "INPUT10");
+ return input_port_read(field->port->machine(), "INPUT10");
default:
- return input_port_read(field->port->machine, "SYSTEM");
+ return input_port_read(field->port->machine(), "SYSTEM");
}
return 0xffffffff;
}
@@ -970,7 +970,7 @@ static WRITE8_HANDLER( z80_soundfifo_w )
static READ8_HANDLER( z80_soundfifo_status_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
UINT8 r = 0;
if (state->fifoin_read_request)
{
@@ -981,28 +981,28 @@ static READ8_HANDLER( z80_soundfifo_status_r )
static WRITE8_HANDLER( z80_bank_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if ((data & 7) != state->z80_lastbank)
{
state->z80_lastbank = (data & 7);
- memory_set_bankptr(space->machine, "bank4", state->z80_rom + (0x8000 * state->z80_lastbank));
+ memory_set_bankptr(space->machine(), "bank4", state->z80_rom + (0x8000 * state->z80_lastbank));
}
}
static READ8_HANDLER( z80_jp1_r )
{
- return input_port_read(space->machine, "JP1");
+ return input_port_read(space->machine(), "JP1");
}
static READ8_HANDLER( z80_coin_r )
{
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
}
static READ32_HANDLER( soundrom_r )
{
- UINT8 *sound = (UINT8*)space->machine->region("user2")->base();
- UINT16 *sound16 = (UINT16*)space->machine->region("user2")->base();
+ UINT8 *sound = (UINT8*)space->machine().region("user2")->base();
+ UINT16 *sound16 = (UINT16*)space->machine().region("user2")->base();
if (mem_mask == 0x000000ff)
{
@@ -1076,7 +1076,7 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( flashrom_read )
{
- seibuspi_state *state = device->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = device->machine().driver_data<seibuspi_state>();
logerror("Flash Read: %08X\n", offset);
if( offset < 0x100000 )
{
@@ -1091,7 +1091,7 @@ static READ8_DEVICE_HANDLER( flashrom_read )
static WRITE8_DEVICE_HANDLER( flashrom_write )
{
- seibuspi_state *state = device->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = device->machine().driver_data<seibuspi_state>();
logerror("Flash Write: %08X, %02X\n", offset, data);
if( offset < 0x100000 )
{
@@ -1106,9 +1106,9 @@ static WRITE8_DEVICE_HANDLER( flashrom_write )
static void irqhandler(device_t *device, int state)
{
if (state)
- cputag_set_input_line_and_vector(device->machine, "soundcpu", 0, ASSERT_LINE, 0xd7); // IRQ is RST10
+ cputag_set_input_line_and_vector(device->machine(), "soundcpu", 0, ASSERT_LINE, 0xd7); // IRQ is RST10
else
- cputag_set_input_line(device->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, CLEAR_LINE);
}
static WRITE32_DEVICE_HANDLER(sys386f2_eeprom_w)
@@ -1152,7 +1152,7 @@ ADDRESS_MAP_END
static WRITE32_HANDLER(input_select_w)
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
state->ejsakura_input_port = data;
}
@@ -1295,7 +1295,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( ejanhs_encode )
{
static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 };
- input_port_value state = input_port_read(field->port->machine, (const char *)param);
+ input_port_value state = input_port_read(field->port->machine(), (const char *)param);
int bit;
for (bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
@@ -1810,25 +1810,25 @@ static IRQ_CALLBACK(spi_irq_callback)
static MACHINE_START( spi )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
state->z80_rom = auto_alloc_array(machine, UINT8, 0x40000);
}
static MACHINE_RESET( spi )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- UINT8 *sound = machine->region("ymf")->base();
+ UINT8 *sound = machine.region("ymf")->base();
- UINT8 *rombase = machine->region("user1")->base();
+ UINT8 *rombase = machine.region("user1")->base();
UINT8 flash_data = rombase[0x1ffffc];
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE );
- device_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), spi_irq_callback);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00000680, 0x00000683, FUNC(sound_fifo_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000688, 0x0000068b, FUNC(z80_prg_fifo_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000068c, 0x0000068f, FUNC(z80_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00000680, 0x00000683, FUNC(sound_fifo_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00000688, 0x0000068b, FUNC(z80_prg_fifo_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000068c, 0x0000068f, FUNC(z80_enable_w));
memory_set_bankptr(machine, "bank4", state->z80_rom);
memory_set_bankptr(machine, "bank5", state->z80_rom);
@@ -1897,24 +1897,24 @@ MACHINE_CONFIG_END
static MACHINE_START( sxx2f )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
state->z80_rom = auto_alloc_array(machine, UINT8, 0x40000);
}
static MACHINE_RESET( sxx2f )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
- UINT8 *rom = machine->region("soundcpu")->base();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
+ UINT8 *rom = machine.region("soundcpu")->base();
memory_set_bankptr(machine, "bank4", state->z80_rom);
memory_set_bankptr(machine, "bank5", state->z80_rom);
memcpy(state->z80_rom, rom, 0x40000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*machine->device("eeprom"), 0x0000068c, 0x0000068f, FUNC(eeprom_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00000680, 0x00000683, FUNC(sb_coin_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*machine.device("eeprom"), 0x0000068c, 0x0000068f, FUNC(eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00000680, 0x00000683, FUNC(sb_coin_r));
- device_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), spi_irq_callback);
state->sb_coin_latch = 0;
}
@@ -1953,21 +1953,21 @@ MACHINE_CONFIG_END
static READ32_HANDLER ( senkyu_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (cpu_get_pc(space->cpu)==0x00305bb2) device_spin_until_interrupt(space->cpu); // idle
return state->spimainram[(0x0018cb4-0x800)/4];
}
static READ32_HANDLER( senkyua_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (cpu_get_pc(space->cpu)== 0x30582e) device_spin_until_interrupt(space->cpu); // idle
return state->spimainram[(0x0018c9c-0x800)/4];
}
static READ32_HANDLER ( batlball_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
// printf("cpu_get_pc(space->cpu) %06x\n", cpu_get_pc(space->cpu));
/* batlbalu */
@@ -1981,7 +1981,7 @@ static READ32_HANDLER ( batlball_speedup_r )
static READ32_HANDLER ( rdft_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
/* rdft */
if (cpu_get_pc(space->cpu)==0x0203f0a) device_spin_until_interrupt(space->cpu); // idle
@@ -2004,7 +2004,7 @@ static READ32_HANDLER ( rdft_speedup_r )
static READ32_HANDLER ( viprp1_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
/* viprp1 */
if (cpu_get_pc(space->cpu)==0x0202769) device_spin_until_interrupt(space->cpu); // idle
@@ -2021,7 +2021,7 @@ static READ32_HANDLER ( viprp1_speedup_r )
static READ32_HANDLER ( viprp1o_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
/* viperp1o */
if (cpu_get_pc(space->cpu)==0x0201f99) device_spin_until_interrupt(space->cpu); // idle
// mame_printf_debug("%08x\n",cpu_get_pc(space->cpu));
@@ -2032,7 +2032,7 @@ static READ32_HANDLER ( viprp1o_speedup_r )
// causes input problems?
READ32_HANDLER ( ejanhs_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
// mame_printf_debug("%08x\n",cpu_get_pc(space->cpu));
if (cpu_get_pc(space->cpu)==0x03032c7) device_spin_until_interrupt(space->cpu); // idle
return state->spimainram[(0x002d224-0x800)/4];
@@ -2041,7 +2041,7 @@ READ32_HANDLER ( ejanhs_speedup_r )
static READ32_HANDLER ( rf2_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
/* rdft22kc */
if (cpu_get_pc(space->cpu)==0x0203926) device_spin_until_interrupt(space->cpu); // idle
@@ -2062,7 +2062,7 @@ static READ32_HANDLER ( rf2_speedup_r )
static READ32_HANDLER ( rfjet_speedup_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
/* rfjet, rfjetu, rfjeta */
if (cpu_get_pc(space->cpu)==0x0206082) device_spin_until_interrupt(space->cpu); // idle
@@ -2073,7 +2073,7 @@ static READ32_HANDLER ( rfjet_speedup_r )
device_spin_until_interrupt(space->cpu); // idle
// Hack to enter test mode
r = state->spimainram[(0x002894c-0x800)/4] & (~0x400);
- return r | (((input_port_read(space->machine, "SYSTEM") ^ 0xff)<<8) & 0x400);
+ return r | (((input_port_read(space->machine(), "SYSTEM") ^ 0xff)<<8) & 0x400);
}
/* rfjetj */
@@ -2085,41 +2085,41 @@ static READ32_HANDLER ( rfjet_speedup_r )
return state->spimainram[(0x002894c-0x800)/4];
}
-static void init_spi(running_machine *machine)
+static void init_spi(running_machine &machine)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
- state->flash[0] = machine->device<intel_e28f008sa_device>("flash0");
- state->flash[1] = machine->device<intel_e28f008sa_device>("flash1");
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
+ state->flash[0] = machine.device<intel_e28f008sa_device>("flash0");
+ state->flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- seibuspi_text_decrypt(machine->region("gfx1")->base());
- seibuspi_bg_decrypt(machine->region("gfx2")->base(), machine->region("gfx2")->bytes());
- seibuspi_sprite_decrypt(machine->region("gfx3")->base(), 0x400000);
+ seibuspi_text_decrypt(machine.region("gfx1")->base());
+ seibuspi_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
+ seibuspi_sprite_decrypt(machine.region("gfx3")->base(), 0x400000);
}
static DRIVER_INIT( rdft )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00298d0, 0x00298d3, FUNC(rdft_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00298d0, 0x00298d3, FUNC(rdft_speedup_r) );
init_spi(machine);
}
static DRIVER_INIT( senkyu )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018cb4, 0x0018cb7, FUNC(senkyu_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018cb4, 0x0018cb7, FUNC(senkyu_speedup_r) );
init_spi(machine);
}
static DRIVER_INIT( senkyua )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018c9c, 0x0018c9f, FUNC(senkyua_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018c9c, 0x0018c9f, FUNC(senkyua_speedup_r) );
init_spi(machine);
}
static DRIVER_INIT( batlball )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018db4, 0x0018db7, FUNC(batlball_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0018db4, 0x0018db7, FUNC(batlball_speedup_r) );
init_spi(machine);
}
@@ -2127,39 +2127,39 @@ static DRIVER_INIT( batlball )
static DRIVER_INIT( ejanhs )
{
// idle skip doesn't work properly?
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x002d224, 0x002d227, FUNC(ejanhs_speedup_r) );
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x002d224, 0x002d227, FUNC(ejanhs_speedup_r) );
init_spi(machine);
}
static DRIVER_INIT( viprp1 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001e2e0, 0x001e2e3, FUNC(viprp1_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001e2e0, 0x001e2e3, FUNC(viprp1_speedup_r) );
init_spi(machine);
}
static DRIVER_INIT( viprp1o )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001d49c, 0x001d49f, FUNC(viprp1o_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001d49c, 0x001d49f, FUNC(viprp1o_speedup_r) );
init_spi(machine);
}
-static void init_rf2(running_machine *machine)
+static void init_rf2(running_machine &machine)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
- state->flash[0] = machine->device<intel_e28f008sa_device>("flash0");
- state->flash[1] = machine->device<intel_e28f008sa_device>("flash1");
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
+ state->flash[0] = machine.device<intel_e28f008sa_device>("flash0");
+ state->flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0282AC, 0x0282AF, FUNC(rf2_speedup_r) );
- seibuspi_rise10_text_decrypt(machine->region("gfx1")->base());
- seibuspi_rise10_bg_decrypt(machine->region("gfx2")->base(), machine->region("gfx2")->bytes());
- seibuspi_rise10_sprite_decrypt(machine->region("gfx3")->base(), 0x600000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0282AC, 0x0282AF, FUNC(rf2_speedup_r) );
+ seibuspi_rise10_text_decrypt(machine.region("gfx1")->base());
+ seibuspi_rise10_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
+ seibuspi_rise10_sprite_decrypt(machine.region("gfx3")->base(), 0x600000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x560, 0x563, FUNC(sprite_dma_start_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x560, 0x563, FUNC(sprite_dma_start_w));
}
static DRIVER_INIT( rdft2 )
@@ -2173,18 +2173,18 @@ static DRIVER_INIT( rdft2us )
}
-static void init_rfjet(running_machine *machine)
+static void init_rfjet(running_machine &machine)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
- state->flash[0] = machine->device<intel_e28f008sa_device>("flash0");
- state->flash[1] = machine->device<intel_e28f008sa_device>("flash1");
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
+ state->flash[0] = machine.device<intel_e28f008sa_device>("flash0");
+ state->flash[1] = machine.device<intel_e28f008sa_device>("flash1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x002894c, 0x002894f, FUNC(rfjet_speedup_r) );
- seibuspi_rise11_text_decrypt(machine->region("gfx1")->base());
- seibuspi_rise11_bg_decrypt(machine->region("gfx2")->base(), machine->region("gfx2")->bytes());
- seibuspi_rise11_sprite_decrypt_rfjet(machine->region("gfx3")->base(), 0x800000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x002894c, 0x002894f, FUNC(rfjet_speedup_r) );
+ seibuspi_rise11_text_decrypt(machine.region("gfx1")->base());
+ seibuspi_rise11_bg_decrypt(machine.region("gfx2")->base(), machine.region("gfx2")->bytes());
+ seibuspi_rise11_sprite_decrypt_rfjet(machine.region("gfx3")->base(), 0x800000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x560, 0x563, FUNC(sprite_dma_start_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x560, 0x563, FUNC(sprite_dma_start_w));
}
static DRIVER_INIT( rfjet )
@@ -2206,7 +2206,7 @@ static DRIVER_INIT( rfjet2k )
static MACHINE_RESET( seibu386 )
{
- device_set_irq_callback(machine->device("maincpu"), spi_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), spi_irq_callback);
}
static MACHINE_CONFIG_START( seibu386, seibuspi_state )
@@ -2247,11 +2247,11 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sys386f2 )
{
int i, j;
- UINT16 *src = (UINT16 *)machine->region("gfx3")->base();
+ UINT16 *src = (UINT16 *)machine.region("gfx3")->base();
UINT16 tmp[0x40 / 2], Offset;
// sprite_reorder() only
- for(i = 0; i < machine->region("gfx3")->bytes() / 0x40; i++)
+ for(i = 0; i < machine.region("gfx3")->bytes() / 0x40; i++)
{
memcpy(tmp, src, 0x40);
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index 5e325dcee24..68c35bb88b2 100644
--- a/src/mame/drivers/seicross.c
+++ b/src/mame/drivers/seicross.c
@@ -51,7 +51,7 @@ This info came from http://www.ne.jp/asahi/cc-sakura/akkun/old/fryski.html
static NVRAM_HANDLER( seicross )
{
- seicross_state *state = machine->driver_data<seicross_state>();
+ seicross_state *state = machine.driver_data<seicross_state>();
UINT8 *nvram = state->nvram;
size_t nvram_size = state->nvram_size;
@@ -83,18 +83,18 @@ static MACHINE_RESET( friskyt )
static READ8_DEVICE_HANDLER( friskyt_portB_r )
{
- seicross_state *state = device->machine->driver_data<seicross_state>();
+ seicross_state *state = device->machine().driver_data<seicross_state>();
- return (state->portb & 0x9f) | (input_port_read_safe(device->machine, "DEBUG", 0) & 0x60);
+ return (state->portb & 0x9f) | (input_port_read_safe(device->machine(), "DEBUG", 0) & 0x60);
}
static WRITE8_DEVICE_HANDLER( friskyt_portB_w )
{
- seicross_state *state = device->machine->driver_data<seicross_state>();
+ seicross_state *state = device->machine().driver_data<seicross_state>();
//logerror("PC %04x: 8910 port B = %02x\n", cpu_get_pc(space->cpu), data);
/* bit 0 is IRQ enable */
- cpu_interrupt_enable(device->machine->device("maincpu"), data & 1);
+ cpu_interrupt_enable(device->machine().device("maincpu"), data & 1);
/* bit 1 flips screen */
@@ -102,8 +102,8 @@ static WRITE8_DEVICE_HANDLER( friskyt_portB_w )
if (((state->portb & 4) == 0) && (data & 4))
{
/* reset and start the protection mcu */
- cputag_set_input_line(device->machine, "mcu", INPUT_LINE_RESET, PULSE_LINE);
- cputag_set_input_line(device->machine, "mcu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "mcu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "mcu", INPUT_LINE_HALT, CLEAR_LINE);
}
/* other bits unknown */
diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c
index 510ac693737..a5cfc649725 100644
--- a/src/mame/drivers/sengokmj.c
+++ b/src/mame/drivers/sengokmj.c
@@ -75,15 +75,15 @@ public:
/* Multiplexer device for the mahjong panel */
static READ16_HANDLER( mahjong_panel_r )
{
- sengokmj_state *state = space->machine->driver_data<sengokmj_state>();
+ sengokmj_state *state = space->machine().driver_data<sengokmj_state>();
switch(state->sengokumj_mux_data)
{
- case 0x0100: return input_port_read(space->machine, "KEY0");
- case 0x0200: return input_port_read(space->machine, "KEY1");
- case 0x0400: return input_port_read(space->machine, "KEY2");
- case 0x0800: return input_port_read(space->machine, "KEY3");
- case 0x1000: return input_port_read(space->machine, "KEY4");
- case 0x2000: return input_port_read(space->machine, "UNUSED");
+ case 0x0100: return input_port_read(space->machine(), "KEY0");
+ case 0x0200: return input_port_read(space->machine(), "KEY1");
+ case 0x0400: return input_port_read(space->machine(), "KEY2");
+ case 0x0800: return input_port_read(space->machine(), "KEY3");
+ case 0x1000: return input_port_read(space->machine(), "KEY4");
+ case 0x2000: return input_port_read(space->machine(), "UNUSED");
}
return 0xffff;
@@ -91,28 +91,28 @@ static READ16_HANDLER( mahjong_panel_r )
static WRITE16_HANDLER( mahjong_panel_w )
{
- sengokmj_state *state = space->machine->driver_data<sengokmj_state>();
+ sengokmj_state *state = space->machine().driver_data<sengokmj_state>();
state->sengokumj_mux_data = data;
}
static WRITE16_HANDLER( sengokmj_out_w )
{
- sengokmj_state *state = space->machine->driver_data<sengokmj_state>();
+ sengokmj_state *state = space->machine().driver_data<sengokmj_state>();
/* ---- ---- ---x ---- J.P. Signal (?)*/
/* ---- ---- ---- -x-- Coin counter (done AFTER that you press start)*/
/* ---- ---- ---- --x- Cash enable (lockout)*/
/* ---- ---- ---- ---x Hopper 10 */
- coin_lockout_w(space->machine, 0,~data & 2);
- coin_lockout_w(space->machine, 1,~data & 2);
- coin_counter_w(space->machine, 0,data & 4);
+ coin_lockout_w(space->machine(), 0,~data & 2);
+ coin_lockout_w(space->machine(), 1,~data & 2);
+ coin_counter_w(space->machine(), 0,data & 4);
state->hopper_io = ((data & 1)<<6);
// popmessage("%02x",state->hopper_io);
}
static READ16_HANDLER( sengokmj_system_r )
{
- sengokmj_state *state = space->machine->driver_data<sengokmj_state>();
- return (input_port_read(space->machine, "SYSTEM") & 0xffbf) | state->hopper_io;
+ sengokmj_state *state = space->machine().driver_data<sengokmj_state>();
+ return (input_port_read(space->machine(), "SYSTEM") & 0xffbf) | state->hopper_io;
}
static ADDRESS_MAP_START( sengokmj_map, AS_PROGRAM, 16 )
diff --git a/src/mame/drivers/senjyo.c b/src/mame/drivers/senjyo.c
index e7767b51e98..9869756d510 100644
--- a/src/mame/drivers/senjyo.c
+++ b/src/mame/drivers/senjyo.c
@@ -77,7 +77,7 @@ I/O read/write
static MACHINE_RESET( senjyo )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
/* we must avoid generating interrupts for the first few frames otherwise */
/* Senjyo locks up. There must be an interrupt enable port somewhere, */
@@ -88,7 +88,7 @@ static MACHINE_RESET( senjyo )
static INTERRUPT_GEN( senjyo_interrupt )
{
- senjyo_state *state = device->machine->driver_data<senjyo_state>();
+ senjyo_state *state = device->machine().driver_data<senjyo_state>();
if (state->int_delay_kludge == 0) device_set_input_line(device, 0, HOLD_LINE);
else state->int_delay_kludge--;
@@ -96,12 +96,12 @@ static INTERRUPT_GEN( senjyo_interrupt )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static WRITE8_DEVICE_HANDLER( sound_cmd_w )
{
- senjyo_state *state = device->machine->driver_data<senjyo_state>();
+ senjyo_state *state = device->machine().driver_data<senjyo_state>();
state->sound_cmd = data;
@@ -165,7 +165,7 @@ ADDRESS_MAP_END
/* are scroll registers 1+2 linked on the bootleg?, only one copy is written */
static WRITE8_HANDLER(starforb_scrolly2)
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->scrolly2[offset] = data;
state->scrolly1[offset] = data;
@@ -173,7 +173,7 @@ static WRITE8_HANDLER(starforb_scrolly2)
static WRITE8_HANDLER(starforb_scrollx2)
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->scrollx2[offset] = data;
state->scrollx1[offset] = data;
@@ -890,14 +890,14 @@ ROM_END
static DRIVER_INIT( starforc )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
state->is_senjyo = 0;
state->scrollhack = 1;
}
static DRIVER_INIT( starfore )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
/* encrypted CPU */
suprloco_decode(machine, "maincpu");
@@ -908,7 +908,7 @@ static DRIVER_INIT( starfore )
static DRIVER_INIT( starfora )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
/* encrypted CPU */
yamato_decode(machine, "maincpu");
@@ -919,7 +919,7 @@ static DRIVER_INIT( starfora )
static DRIVER_INIT( senjyo )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
state->is_senjyo = 1;
state->scrollhack = 0;
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index 230baa5501c..321cf2302cd 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -1326,14 +1326,14 @@ Note: on screen copyright is (c)1998 Coinmaster.
/*------------------------------
update timer
------------------------------*/
-static void uPD71054_update_timer( running_machine *machine, device_t *cpu, int no )
+static void uPD71054_update_timer( running_machine &machine, device_t *cpu, int no )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
uPD71054_state *uPD71054 = &state->uPD71054;
UINT16 max = uPD71054->max[no]&0xffff;
if( max != 0 ) {
- attotime period = attotime::from_hz(machine->device("maincpu")->unscaled_clock()) * (16 * max);
+ attotime period = attotime::from_hz(machine.device("maincpu")->unscaled_clock()) * (16 * max);
uPD71054->timer[no]->adjust( period, no );
} else {
uPD71054->timer[no]->adjust( attotime::never, no);
@@ -1358,9 +1358,9 @@ static TIMER_CALLBACK( uPD71054_timer_callback )
/*------------------------------
initialize
------------------------------*/
-static void uPD71054_timer_init( running_machine *machine )
+static void uPD71054_timer_init( running_machine &machine )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
uPD71054_state *uPD71054 = &state->uPD71054;
int no;
@@ -1370,7 +1370,7 @@ static void uPD71054_timer_init( running_machine *machine )
uPD71054->max[no] = 0xffff;
}
for( no = 0; no < USED_TIMER_NUM; no++ ) {
- uPD71054->timer[no] = machine->scheduler().timer_alloc( FUNC(uPD71054_timer_callback ));
+ uPD71054->timer[no] = machine.scheduler().timer_alloc( FUNC(uPD71054_timer_callback ));
}
}
@@ -1381,7 +1381,7 @@ static void uPD71054_timer_init( running_machine *machine )
------------------------------*/
static WRITE16_HANDLER( timer_regs_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
uPD71054_state *uPD71054 = &state->uPD71054;
data &= 0xff;
@@ -1401,7 +1401,7 @@ static WRITE16_HANDLER( timer_regs_w )
uPD71054->max[offset] = (uPD71054->max[offset]&0x00ff)+(data<<8);
}
if( uPD71054->max[offset] != 0 ) {
- uPD71054_update_timer( space->machine, space->cpu, offset );
+ uPD71054_update_timer( space->machine(), space->cpu, offset );
}
break;
case 0x0003:
@@ -1437,7 +1437,7 @@ static const x1_010_interface seta_sound_intf2 =
static void utoukond_ym3438_interrupt(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, linestate);
}
static const ym3438_interface utoukond_ym3438_intf =
@@ -1465,7 +1465,7 @@ static const ym3438_interface utoukond_ym3438_intf =
static READ16_HANDLER( sharedram_68000_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
return ((UINT16)state->sharedram[offset]) & 0xff;
}
@@ -1474,7 +1474,7 @@ static WRITE16_HANDLER( sharedram_68000_w )
{
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
state->sharedram[offset] = data & 0xff;
}
}
@@ -1495,10 +1495,10 @@ static WRITE16_HANDLER( sub_ctrl_w )
case 0/2: // bit 0: reset sub cpu?
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
if ( !(state->sub_ctrl_data & 1) && (data & 1) )
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, PULSE_LINE);
state->sub_ctrl_data = data;
}
break;
@@ -1521,7 +1521,7 @@ static WRITE16_HANDLER( sub_ctrl_w )
/* DSW reading for 16 bit CPUs */
static READ16_HANDLER( seta_dsw_r )
{
- UINT16 dsw = input_port_read(space->machine, "DSW");
+ UINT16 dsw = input_port_read(space->machine(), "DSW");
if (offset == 0) return (dsw >> 8) & 0xff;
else return (dsw >> 0) & 0xff;
}
@@ -1531,12 +1531,12 @@ static READ16_HANDLER( seta_dsw_r )
static READ8_DEVICE_HANDLER( dsw1_r )
{
- return (input_port_read(device->machine, "DSW") >> 8) & 0xff;
+ return (input_port_read(device->machine(), "DSW") >> 8) & 0xff;
}
static READ8_DEVICE_HANDLER( dsw2_r )
{
- return (input_port_read(device->machine, "DSW") >> 0) & 0xff;
+ return (input_port_read(device->machine(), "DSW") >> 0) & 0xff;
}
@@ -1547,7 +1547,7 @@ static READ8_DEVICE_HANDLER( dsw2_r )
*/
static SCREEN_EOF( seta_buffer_sprites )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
UINT16 *spriteram16 = state->spriteram;
int ctrl2 = spriteram16[ 0x602/2 ];
@@ -1636,15 +1636,15 @@ ADDRESS_MAP_END
static READ16_HANDLER ( calibr50_ip_r )
{
- int dir1 = input_port_read(space->machine, "ROT1"); // analog port
- int dir2 = input_port_read(space->machine, "ROT2"); // analog port
+ int dir1 = input_port_read(space->machine(), "ROT1"); // analog port
+ int dir2 = input_port_read(space->machine(), "ROT2"); // analog port
switch (offset)
{
- case 0x00/2: return input_port_read(space->machine, "P1"); // p1
- case 0x02/2: return input_port_read(space->machine, "P2"); // p2
+ case 0x00/2: return input_port_read(space->machine(), "P1"); // p1
+ case 0x02/2: return input_port_read(space->machine(), "P2"); // p2
- case 0x08/2: return input_port_read(space->machine, "COINS"); // Coins
+ case 0x08/2: return input_port_read(space->machine(), "COINS"); // Coins
case 0x10/2: return (dir1 & 0xff); // lower 8 bits of p1 rotation
case 0x12/2: return (dir1 >> 8); // upper 4 bits of p1 rotation
@@ -1662,7 +1662,7 @@ static WRITE16_HANDLER( calibr50_soundlatch_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_word_w(space, 0, data, mem_mask);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE);
device_spin_until_time(space->cpu, attotime::from_usec(50)); // Allow the other cpu to reply
}
}
@@ -1698,10 +1698,10 @@ static READ16_HANDLER( usclssic_dsw_r )
{
switch (offset)
{
- case 0/2: return (input_port_read(space->machine, "DSW") >> 8) & 0xf;
- case 2/2: return (input_port_read(space->machine, "DSW") >> 12) & 0xf;
- case 4/2: return (input_port_read(space->machine, "DSW") >> 0) & 0xf;
- case 6/2: return (input_port_read(space->machine, "DSW") >> 4) & 0xf;
+ case 0/2: return (input_port_read(space->machine(), "DSW") >> 8) & 0xf;
+ case 2/2: return (input_port_read(space->machine(), "DSW") >> 12) & 0xf;
+ case 4/2: return (input_port_read(space->machine(), "DSW") >> 0) & 0xf;
+ case 6/2: return (input_port_read(space->machine(), "DSW") >> 4) & 0xf;
}
return 0;
}
@@ -1709,12 +1709,12 @@ static READ16_HANDLER( usclssic_dsw_r )
static READ16_HANDLER( usclssic_trackball_x_r )
{
static const char *const portx_name[2] = { "P1X", "P2X" };
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
switch (offset)
{
- case 0/2: return (input_port_read(space->machine, portx_name[state->usclssic_port_select]) >> 0) & 0xff;
- case 2/2: return (input_port_read(space->machine, portx_name[state->usclssic_port_select]) >> 8) & 0xff;
+ case 0/2: return (input_port_read(space->machine(), portx_name[state->usclssic_port_select]) >> 0) & 0xff;
+ case 2/2: return (input_port_read(space->machine(), portx_name[state->usclssic_port_select]) >> 8) & 0xff;
}
return 0;
}
@@ -1722,12 +1722,12 @@ static READ16_HANDLER( usclssic_trackball_x_r )
static READ16_HANDLER( usclssic_trackball_y_r )
{
static const char *const porty_name[2] = { "P1Y", "P2Y" };
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
switch (offset)
{
- case 0/2: return (input_port_read(space->machine, porty_name[state->usclssic_port_select]) >> 0) & 0xff;
- case 2/2: return (input_port_read(space->machine, porty_name[state->usclssic_port_select]) >> 8) & 0xff;
+ case 0/2: return (input_port_read(space->machine(), porty_name[state->usclssic_port_select]) >> 0) & 0xff;
+ case 2/2: return (input_port_read(space->machine(), porty_name[state->usclssic_port_select]) >> 8) & 0xff;
}
return 0;
}
@@ -1737,16 +1737,16 @@ static WRITE16_HANDLER( usclssic_lockout_w )
{
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
int tiles_offset = (data & 0x10) ? 0x4000: 0;
state->usclssic_port_select = (data & 0x40) >> 6;
if (tiles_offset != state->tiles_offset)
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->tiles_offset = tiles_offset;
- seta_coin_lockout_w(space->machine, data);
+ seta_coin_lockout_w(space->machine(), data);
}
}
@@ -1871,16 +1871,16 @@ ADDRESS_MAP_END
static READ16_HANDLER( zombraid_gun_r ) // Serial interface
{
static const char *const portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
- int data = input_port_read(space->machine, portnames[state->gun_input_src]); // Input Ports 5-8
+ int data = input_port_read(space->machine(), portnames[state->gun_input_src]); // Input Ports 5-8
return (data >> state->gun_input_bit) & 1;
}
// Bit 0 is clock, 1 is data, 2 is reset
static WRITE16_HANDLER( zombraid_gun_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
if(data&4) { state->gun_bit_count = 0; return; } // Reset
@@ -2062,7 +2062,7 @@ static const UINT16 keroppi_protection_word[] = {
static READ16_HANDLER( keroppi_protection_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
UINT16 result = keroppi_protection_word[state->keroppi_protection_count];
state->keroppi_protection_count++;
@@ -2074,7 +2074,7 @@ static READ16_HANDLER( keroppi_protection_r )
static READ16_HANDLER( keroppi_protection_init_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
state->keroppi_protection_count = 0;
return 0x00;
@@ -2082,8 +2082,8 @@ static READ16_HANDLER( keroppi_protection_init_r )
static READ16_HANDLER( keroppi_coin_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
- UINT16 result = input_port_read(space->machine, "COINS");
+ seta_state *state = space->machine().driver_data<seta_state>();
+ UINT16 result = input_port_read(space->machine(), "COINS");
if (state->keroppi_prize_hop == 2)
{
@@ -2096,17 +2096,17 @@ static READ16_HANDLER( keroppi_coin_r )
static TIMER_CALLBACK( keroppi_prize_hop_callback )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
state->keroppi_prize_hop = 2;
}
static WRITE16_HANDLER( keroppi_prize_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
if ((data & 0x0010) && !state->keroppi_prize_hop)
{
state->keroppi_prize_hop = 1;
- space->machine->scheduler().timer_set(attotime::from_seconds(3), FUNC(keroppi_prize_hop_callback), 0x20); /* 3 seconds */
+ space->machine().scheduler().timer_set(attotime::from_seconds(3), FUNC(keroppi_prize_hop_callback), 0x20); /* 3 seconds */
}
}
@@ -2133,7 +2133,7 @@ ADDRESS_MAP_END
static MACHINE_START( keroppi )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
state->keroppi_prize_hop = 0;
state->keroppi_protection_count = 0;
}
@@ -2226,44 +2226,44 @@ ADDRESS_MAP_END
static READ16_HANDLER( setaroul_c0_r )
{
- return 0x00;//space->machine->rand();
+ return 0x00;//space->machine().rand();
}
static READ16_HANDLER( setaroul_d4_0_r )
{
- return 0x00;//space->machine->rand();
+ return 0x00;//space->machine().rand();
}
static READ16_HANDLER( setaroul_d4_4_r )
{
- return 0x00;//space->machine->rand();
+ return 0x00;//space->machine().rand();
}
static READ16_HANDLER( setaroul_d4_6_r )
{
- return 0xffff;//space->machine->rand();
+ return 0xffff;//space->machine().rand();
}
static READ16_HANDLER( setaroul_d4_8_r )
{
- return space->machine->rand()&0x000f;
+ return space->machine().rand()&0x000f;
}
static READ16_HANDLER( setaroul_d4_a_r )
{
- return 0x00;//space->machine->rand();
+ return 0x00;//space->machine().rand();
}
static READ16_HANDLER( setaroul_d4_10_r )
{
- return 0x00;// space->machine->rand();
+ return 0x00;// space->machine().rand();
}
// ?? looks like sprite ram access is 8-bit not 16?
static WRITE16_HANDLER( setaroul_spr_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
UINT16 *spriteram16 = state->spriteram;
int realoffs = offset;
@@ -2409,10 +2409,10 @@ ADDRESS_MAP_END
static READ16_HANDLER( krzybowl_input_r )
{
// analog ports
- int dir1x = input_port_read(space->machine, "TRACK1_X") & 0xfff;
- int dir1y = input_port_read(space->machine, "TRACK1_Y") & 0xfff;
- int dir2x = input_port_read(space->machine, "TRACK2_X") & 0xfff;
- int dir2y = input_port_read(space->machine, "TRACK2_Y") & 0xfff;
+ int dir1x = input_port_read(space->machine(), "TRACK1_X") & 0xfff;
+ int dir1y = input_port_read(space->machine(), "TRACK1_Y") & 0xfff;
+ int dir2x = input_port_read(space->machine(), "TRACK2_X") & 0xfff;
+ int dir2y = input_port_read(space->machine(), "TRACK2_Y") & 0xfff;
switch (offset)
{
@@ -2557,7 +2557,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( kiwame_nvram_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
return state->kiwame_nvram[offset] & 0xff;
}
@@ -2565,7 +2565,7 @@ static WRITE16_HANDLER( kiwame_nvram_w )
{
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
COMBINE_DATA( &state->kiwame_nvram[offset] );
}
}
@@ -2581,9 +2581,9 @@ static READ16_HANDLER( kiwame_input_r )
switch( offset )
{
- case 0x00/2: return input_port_read(space->machine, keynames[i]);
+ case 0x00/2: return input_port_read(space->machine(), keynames[i]);
case 0x02/2: return 0xffff;
- case 0x04/2: return input_port_read(space->machine, "COINS");
+ case 0x04/2: return input_port_read(space->machine(), "COINS");
// case 0x06/2:
case 0x08/2: return 0xffff;
@@ -2674,17 +2674,17 @@ ADDRESS_MAP_END
static READ8_HANDLER( wiggie_soundlatch_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
return state->wiggie_soundlatch;
}
static WRITE16_HANDLER( wiggie_soundlatch_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
state->wiggie_soundlatch = data >> 8;
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -2748,7 +2748,7 @@ static WRITE16_HANDLER( utoukond_soundlatch_w )
{
if (ACCESSING_BITS_0_7)
{
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
soundlatch_w(space, 0, data & 0xff);
}
}
@@ -2778,7 +2778,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( pairlove_prot_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
int retdata;
retdata = state->pairslove_protram[offset];
@@ -2789,7 +2789,7 @@ static READ16_HANDLER( pairlove_prot_r )
static WRITE16_HANDLER( pairlove_prot_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
//mame_printf_debug("pairs love protection? write %06x %04x %04x\n",cpu_get_pc(space->cpu), offset,data);
state->pairslove_protram_old[offset] = state->pairslove_protram[offset];
state->pairslove_protram[offset] = data;
@@ -2848,22 +2848,22 @@ ADDRESS_MAP_END
static READ16_HANDLER( inttoote_dsw_r )
{
int shift = offset * 4;
- return ((((input_port_read(space->machine, "DSW1") >> shift) & 0xf)) << 0) |
- ((((input_port_read(space->machine, "DSW2_3") >> shift) & 0xf)) << 4) |
- ((((input_port_read(space->machine, "DSW2_3") >> (shift+8)) & 0xf)) << 8) ;
+ return ((((input_port_read(space->machine(), "DSW1") >> shift) & 0xf)) << 0) |
+ ((((input_port_read(space->machine(), "DSW2_3") >> shift) & 0xf)) << 4) |
+ ((((input_port_read(space->machine(), "DSW2_3") >> (shift+8)) & 0xf)) << 8) ;
}
static READ16_HANDLER( inttoote_key_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
switch( *state->inttoote_key_select )
{
- case 0x08: return input_port_read(space->machine, "BET0");
- case 0x10: return input_port_read(space->machine, "BET1");
- case 0x20: return input_port_read(space->machine, "BET2");
- case 0x40: return input_port_read(space->machine, "BET3");
- case 0x80: return input_port_read(space->machine, "BET4");
+ case 0x08: return input_port_read(space->machine(), "BET0");
+ case 0x10: return input_port_read(space->machine(), "BET1");
+ case 0x20: return input_port_read(space->machine(), "BET2");
+ case 0x40: return input_port_read(space->machine(), "BET3");
+ case 0x80: return input_port_read(space->machine(), "BET4");
}
logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(space->cpu), *state->inttoote_key_select);
@@ -2872,7 +2872,7 @@ static READ16_HANDLER( inttoote_key_r )
static READ16_HANDLER( inttoote_700000_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
return state->inttoote_700000[offset] & 0x3f;
}
@@ -2912,15 +2912,15 @@ ADDRESS_MAP_END
static READ16_HANDLER( jockeyc_mux_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
switch( state->jockeyc_key_select )
{
- case 0x08: return input_port_read(space->machine, "BET0");
- case 0x10: return input_port_read(space->machine, "BET1");
- case 0x20: return input_port_read(space->machine, "BET2");
- case 0x40: return input_port_read(space->machine, "BET3");
- case 0x80: return input_port_read(space->machine, "BET4");
+ case 0x08: return input_port_read(space->machine(), "BET0");
+ case 0x10: return input_port_read(space->machine(), "BET1");
+ case 0x20: return input_port_read(space->machine(), "BET2");
+ case 0x40: return input_port_read(space->machine(), "BET3");
+ case 0x80: return input_port_read(space->machine(), "BET4");
}
return 0xffff;
@@ -2928,7 +2928,7 @@ static READ16_HANDLER( jockeyc_mux_r )
static WRITE16_HANDLER( jockeyc_mux_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
/* other bits used too */
state->jockeyc_key_select = data & 0xf8;
@@ -2936,7 +2936,7 @@ static WRITE16_HANDLER( jockeyc_mux_w )
static READ16_HANDLER( unk_r )
{
- return 0xffff;//space->machine->rand();
+ return 0xffff;//space->machine().rand();
}
/* same as International Toote but without the protection and different RTC hook-up */
@@ -2985,16 +2985,16 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sub_bankswitch_w )
{
- UINT8 *rom = space->machine->region("sub")->base();
+ UINT8 *rom = space->machine().region("sub")->base();
int bank = data >> 4;
- memory_set_bankptr(space->machine, "bank1", &rom[bank * 0x4000 + 0xc000]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[bank * 0x4000 + 0xc000]);
}
static WRITE8_HANDLER( sub_bankswitch_lockout_w )
{
sub_bankswitch_w(space,offset,data);
- seta_coin_lockout_w(space->machine, data);
+ seta_coin_lockout_w(space->machine(), data);
}
@@ -3047,21 +3047,21 @@ ADDRESS_MAP_END
static READ8_HANDLER( downtown_ip_r )
{
- int dir1 = input_port_read(space->machine, "ROT1"); // analog port
- int dir2 = input_port_read(space->machine, "ROT2"); // analog port
+ int dir1 = input_port_read(space->machine(), "ROT1"); // analog port
+ int dir2 = input_port_read(space->machine(), "ROT2"); // analog port
dir1 = (~ (0x800 >> dir1)) & 0xfff;
dir2 = (~ (0x800 >> dir2)) & 0xfff;
switch (offset)
{
- case 0: return (input_port_read(space->machine, "COINS") & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
+ case 0: return (input_port_read(space->machine(), "COINS") & 0xf0) + (dir1 >> 8); // upper 4 bits of p1 rotation + coins
case 1: return (dir1 & 0xff); // lower 8 bits of p1 rotation
- case 2: return input_port_read(space->machine, "P1"); // p1
+ case 2: return input_port_read(space->machine(), "P1"); // p1
case 3: return 0xff; // ?
case 4: return (dir2 >> 8); // upper 4 bits of p2 rotation + ?
case 5: return (dir2 & 0xff); // lower 8 bits of p2 rotation
- case 6: return input_port_read(space->machine, "P2"); // p2
+ case 6: return input_port_read(space->machine(), "P2"); // p2
case 7: return 0xff; // ?
}
@@ -3087,7 +3087,7 @@ ADDRESS_MAP_END
static MACHINE_RESET(calibr50)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
sub_bankswitch_w(space, 0, 0);
}
@@ -10037,7 +10037,7 @@ static READ16_HANDLER( twineagl_debug_r )
/* 2000F8 = A3 enables it, 2000F8 = 00 disables? see downtown too */
static READ16_HANDLER( twineagl_200100_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
// protection check at boot
logerror("%04x: twineagl_200100_r %d\n",cpu_get_pc(space->cpu),offset);
@@ -10049,7 +10049,7 @@ static WRITE16_HANDLER( twineagl_200100_w )
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
state->twineagl_xram[offset] = data & 0xff;
}
}
@@ -10057,17 +10057,17 @@ static WRITE16_HANDLER( twineagl_200100_w )
static DRIVER_INIT( twineagl )
{
/* debug? */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800000, 0x8000ff, FUNC(twineagl_debug_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800000, 0x8000ff, FUNC(twineagl_debug_r));
/* This allows 2 simultaneous players and the use of the "Copyright" Dip Switch. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200100, 0x20010f, FUNC(twineagl_200100_r), FUNC(twineagl_200100_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200100, 0x20010f, FUNC(twineagl_200100_r), FUNC(twineagl_200100_w));
}
/* Protection? NVRAM is handled writing commands here */
static READ16_HANDLER( downtown_protection_r )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
int job = state->downtown_protection[0xf8/2] & 0xff;
switch (job)
@@ -10085,13 +10085,13 @@ static READ16_HANDLER( downtown_protection_r )
static WRITE16_HANDLER( downtown_protection_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
COMBINE_DATA(&state->downtown_protection[offset]);
}
static DRIVER_INIT( downtown )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x2001ff, FUNC(downtown_protection_r), FUNC(downtown_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x2001ff, FUNC(downtown_protection_r), FUNC(downtown_protection_w));
}
@@ -10111,16 +10111,16 @@ static READ16_HANDLER( arbalest_debug_r )
static DRIVER_INIT( arbalest )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x8000f, FUNC(arbalest_debug_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x8000f, FUNC(arbalest_debug_r));
}
static DRIVER_INIT( metafox )
{
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
/* This game uses the 21c000-21ffff area for protection? */
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x21c000, 0x21ffff);
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x21c000, 0x21ffff);
RAM[0x8ab1c/2] = 0x4e71; // patch protection test: "cp error"
RAM[0x8ab1e/2] = 0x4e71;
@@ -10140,7 +10140,7 @@ static DRIVER_INIT ( blandia )
rom_size = 0x80000;
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine->region("gfx2")->base() + 0x40000;
+ rom = machine.region("gfx2")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10149,7 +10149,7 @@ static DRIVER_INIT ( blandia )
memcpy( rom, buf, rom_size );
- rom = machine->region("gfx3")->base() + 0x40000;
+ rom = machine.region("gfx3")->base() + 0x40000;
for (rpos = 0; rpos < rom_size/2; rpos++) {
buf[rpos+0x40000] = rom[rpos*2];
@@ -10164,20 +10164,20 @@ static DRIVER_INIT ( blandia )
static DRIVER_INIT( eightfrc )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x500004, 0x500005); // watchdog??
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x500004, 0x500005); // watchdog??
}
static DRIVER_INIT( zombraid )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf00002, 0xf00003, FUNC(zombraid_gun_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00000, 0xf00001, FUNC(zombraid_gun_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf00002, 0xf00003, FUNC(zombraid_gun_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00000, 0xf00001, FUNC(zombraid_gun_w));
}
static DRIVER_INIT( kiwame )
{
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
/* WARNING: This game writes to the interrupt vector
table. Lev 1 routine address is stored at $100 */
@@ -10189,7 +10189,7 @@ static DRIVER_INIT( kiwame )
static DRIVER_INIT( rezon )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x500006, 0x500007); // irq ack?
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x500006, 0x500007); // irq ack?
}
static DRIVER_INIT( wiggie )
@@ -10199,8 +10199,8 @@ static DRIVER_INIT( wiggie )
UINT8 temp[16];
int i,j;
- src = machine->region("maincpu")->base();
- len = machine->region("maincpu")->bytes();
+ src = machine.region("maincpu")->base();
+ len = machine.region("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -10221,16 +10221,16 @@ static DRIVER_INIT( wiggie )
}
/* X1_010 is not used. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x100000, 0x103fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x100000, 0x103fff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xB00008, 0xB00009, FUNC(wiggie_soundlatch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xB00008, 0xB00009, FUNC(wiggie_soundlatch_w));
}
static DRIVER_INIT( crazyfgt )
{
- seta_state *state = machine->driver_data<seta_state>();
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ seta_state *state = machine.driver_data<seta_state>();
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
// protection check at boot
RAM[0x1078/2] = 0x4e71;
@@ -10247,8 +10247,8 @@ static DRIVER_INIT( crazyfgt )
static DRIVER_INIT( inttoote )
{
- seta_state *state = machine->driver_data<seta_state>();
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ seta_state *state = machine.driver_data<seta_state>();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// missing / unused video regs
state->vregs = auto_alloc_array_clear(machine, UINT16, 3);
@@ -10262,8 +10262,8 @@ static DRIVER_INIT( inttoote )
static DRIVER_INIT( inttootea )
{
- seta_state *state = machine->driver_data<seta_state>();
- //UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ seta_state *state = machine.driver_data<seta_state>();
+ //UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// missing / unused video regs
state->vregs = auto_alloc_array_clear(machine, UINT16, 3);
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 251875efb9d..39249f137f1 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -120,8 +120,8 @@ static WRITE16_HANDLER( seta2_sound_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *ROM = space->machine->region( "x1snd" )->base();
- int banks = (space->machine->region( "x1snd" )->bytes() - 0x100000) / 0x20000;
+ UINT8 *ROM = space->machine().region( "x1snd" )->base();
+ int banks = (space->machine().region( "x1snd" )->bytes() - 0x100000) / 0x20000;
if (data >= banks)
{
logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(space->cpu),data);
@@ -141,8 +141,8 @@ static WRITE16_HANDLER( grdians_lockout_w )
if (ACCESSING_BITS_0_7)
{
// initially 0, then either $25 (coin 1) or $2a (coin 2)
- coin_counter_w(space->machine, 0,data & 0x01); // or 0x04
- coin_counter_w(space->machine, 1,data & 0x02); // or 0x08
+ coin_counter_w(space->machine(), 0,data & 0x01); // or 0x04
+ coin_counter_w(space->machine(), 1,data & 0x02); // or 0x08
}
// popmessage("%04X", data & 0xffff);
}
@@ -213,37 +213,37 @@ ADDRESS_MAP_END
static READ16_HANDLER( mj4simai_p1_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
switch (state->keyboard_row)
{
- case 0x01: return input_port_read(space->machine, "P1_KEY0");
- case 0x02: return input_port_read(space->machine, "P1_KEY1");
- case 0x04: return input_port_read(space->machine, "P1_KEY2");
- case 0x08: return input_port_read(space->machine, "P1_KEY3");
- case 0x10: return input_port_read(space->machine, "P1_KEY4");
+ case 0x01: return input_port_read(space->machine(), "P1_KEY0");
+ case 0x02: return input_port_read(space->machine(), "P1_KEY1");
+ case 0x04: return input_port_read(space->machine(), "P1_KEY2");
+ case 0x08: return input_port_read(space->machine(), "P1_KEY3");
+ case 0x10: return input_port_read(space->machine(), "P1_KEY4");
default: logerror("p1_r with keyboard_row = %02x\n", state->keyboard_row); return 0xffff;
}
}
static READ16_HANDLER( mj4simai_p2_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
switch (state->keyboard_row)
{
- case 0x01: return input_port_read(space->machine, "P2_KEY0");
- case 0x02: return input_port_read(space->machine, "P2_KEY1");
- case 0x04: return input_port_read(space->machine, "P2_KEY2");
- case 0x08: return input_port_read(space->machine, "P2_KEY3");
- case 0x10: return input_port_read(space->machine, "P2_KEY4");
+ case 0x01: return input_port_read(space->machine(), "P2_KEY0");
+ case 0x02: return input_port_read(space->machine(), "P2_KEY1");
+ case 0x04: return input_port_read(space->machine(), "P2_KEY2");
+ case 0x08: return input_port_read(space->machine(), "P2_KEY3");
+ case 0x10: return input_port_read(space->machine(), "P2_KEY4");
default: logerror("p2_r with keyboard_row = %02x\n", state->keyboard_row); return 0xffff;
}
}
static WRITE16_HANDLER( mj4simai_keyboard_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
if (ACCESSING_BITS_0_7)
state->keyboard_row = data & 0xff;
@@ -324,20 +324,20 @@ ADDRESS_MAP_END
static READ16_HANDLER( pzlbowl_protection_r )
{
UINT32 address = (space->read_word(0x20ba16) << 16) | space->read_word(0x20ba18);
- return space->machine->region("maincpu")->base()[address - 2];
+ return space->machine().region("maincpu")->base()[address - 2];
}
static READ16_HANDLER( pzlbowl_coins_r )
{
- return input_port_read(space->machine, "SYSTEM") | (space->machine->rand() & 0x80 );
+ return input_port_read(space->machine(), "SYSTEM") | (space->machine().rand() & 0x80 );
}
static WRITE16_HANDLER( pzlbowl_coin_counter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x10);
- coin_counter_w(space->machine, 1,data & 0x20);
+ coin_counter_w(space->machine(), 0,data & 0x10);
+ coin_counter_w(space->machine(), 1,data & 0x20);
}
}
@@ -394,17 +394,17 @@ static WRITE16_HANDLER( reelquak_leds_w )
{
if (ACCESSING_BITS_0_7)
{
- set_led_status( space->machine, 0, data & 0x0001 ); // start
- set_led_status( space->machine, 1, data & 0x0002 ); // small
- set_led_status( space->machine, 2, data & 0x0004 ); // bet
- set_led_status( space->machine, 3, data & 0x0008 ); // big
- set_led_status( space->machine, 4, data & 0x0010 ); // double up
- set_led_status( space->machine, 5, data & 0x0020 ); // collect
- set_led_status( space->machine, 6, data & 0x0040 ); // bet cancel
+ set_led_status( space->machine(), 0, data & 0x0001 ); // start
+ set_led_status( space->machine(), 1, data & 0x0002 ); // small
+ set_led_status( space->machine(), 2, data & 0x0004 ); // bet
+ set_led_status( space->machine(), 3, data & 0x0008 ); // big
+ set_led_status( space->machine(), 4, data & 0x0010 ); // double up
+ set_led_status( space->machine(), 5, data & 0x0020 ); // collect
+ set_led_status( space->machine(), 6, data & 0x0040 ); // bet cancel
}
if (ACCESSING_BITS_8_15)
{
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x0100) >> 1); // ticket dispenser
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 0x0100) >> 1); // ticket dispenser
}
// popmessage("LED %04X", data);
@@ -414,10 +414,10 @@ static WRITE16_HANDLER( reelquak_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01); // coin in
- coin_counter_w(space->machine, 1, data & 0x02); // coin in
- coin_counter_w(space->machine, 2, data & 0x04); // pay out
- coin_counter_w(space->machine, 3, data & 0x08); // key in
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin in
+ coin_counter_w(space->machine(), 1, data & 0x02); // coin in
+ coin_counter_w(space->machine(), 2, data & 0x04); // pay out
+ coin_counter_w(space->machine(), 3, data & 0x08); // key in
// data & 0x10); // Sound IRQ Ack.? 1->0
// data & 0x20); // Vblank IRQ.? 1
}
@@ -453,11 +453,11 @@ static WRITE16_HANDLER( samshoot_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
// Are these connected? They are set in I/O test
- coin_lockout_w(space->machine, 0,~data & 0x40);
- coin_lockout_w(space->machine, 1,~data & 0x80);
+ coin_lockout_w(space->machine(), 0,~data & 0x40);
+ coin_lockout_w(space->machine(), 1,~data & 0x80);
}
// popmessage("%04x",data);
}
@@ -500,14 +500,14 @@ ADDRESS_MAP_END
// RAM shared with the sub CPU
static READ32_HANDLER( funcube_nvram_dword_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
UINT16 val = state->m_nvram[offset];
return ((val & 0xff00) << 8) | (val & 0x00ff);
}
static WRITE32_HANDLER( funcube_nvram_dword_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
if (ACCESSING_BITS_0_7)
{
state->m_nvram[offset] = (state->m_nvram[offset] & 0xff00) | (data & 0x000000ff);
@@ -520,21 +520,21 @@ static WRITE32_HANDLER( funcube_nvram_dword_w )
static WRITE16_HANDLER( spriteram16_word_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
COMBINE_DATA( &state->spriteram[offset] );
}
static READ16_HANDLER( spriteram16_word_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
return state->spriteram[offset];
}
static READ16_HANDLER( paletteram16_word_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
static READ16BETO32BE( spriteram32_dword, spriteram16_word_r );
@@ -556,22 +556,22 @@ enum {
static WRITE32_HANDLER( coldfire_regs_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
COMBINE_DATA( &state->coldfire_regs[offset] );
}
static READ32_HANDLER( coldfire_regs_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
switch( offset )
{
case CF_MBSR:
- return space->machine->rand();
+ return space->machine().rand();
case CF_PPDAT:
- return input_port_read(space->machine, "BATTERY") << 16;
+ return input_port_read(space->machine(), "BATTERY") << 16;
}
return state->coldfire_regs[offset];
@@ -579,10 +579,10 @@ static READ32_HANDLER( coldfire_regs_r )
static READ32_HANDLER( funcube_debug_r )
{
- UINT32 ret = input_port_read(space->machine,"DEBUG");
+ UINT32 ret = input_port_read(space->machine(),"DEBUG");
// This bits let you move the crosshair in the inputs / touch panel test with a joystick
- if (!(space->machine->primary_screen->frame_number() % 3))
+ if (!(space->machine().primary_screen->frame_number() % 3))
ret |= 0x3f;
return ret;
@@ -638,12 +638,12 @@ ADDRESS_MAP_END
static READ8_HANDLER( funcube_coins_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
- UINT8 ret = input_port_read(space->machine,"SWITCH");
+ seta2_state *state = space->machine().driver_data<seta2_state>();
+ UINT8 ret = input_port_read(space->machine(),"SWITCH");
UINT8 coin_bit0 = 1; // active low
UINT8 coin_bit1 = 1;
- UINT8 hopper_bit = (state->funcube_hopper_motor && !(space->machine->primary_screen->frame_number()%20)) ? 1 : 0;
+ UINT8 hopper_bit = (state->funcube_hopper_motor && !(space->machine().primary_screen->frame_number()%20)) ? 1 : 0;
const UINT64 coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK / (1000/20);
@@ -669,7 +669,7 @@ static READ8_HANDLER( funcube_coins_r )
static READ8_HANDLER( funcube_serial_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
UINT8 ret = 0xff;
switch( state->funcube_serial_count )
@@ -695,25 +695,25 @@ static void funcube_debug_outputs(void)
static WRITE8_HANDLER( funcube_leds_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
*state->funcube_leds = data;
- set_led_status( space->machine, 0, (~data) & 0x01 ); // win lamp (red)
- set_led_status( space->machine, 1, (~data) & 0x02 ); // win lamp (green)
+ set_led_status( space->machine(), 0, (~data) & 0x01 ); // win lamp (red)
+ set_led_status( space->machine(), 1, (~data) & 0x02 ); // win lamp (green)
// Set in a moving pattern: 0111 -> 1011 -> 1101 -> 1110
- set_led_status( space->machine, 2, (~data) & 0x10 );
- set_led_status( space->machine, 3, (~data) & 0x20 );
- set_led_status( space->machine, 4, (~data) & 0x40 );
- set_led_status( space->machine, 5, (~data) & 0x80 );
+ set_led_status( space->machine(), 2, (~data) & 0x10 );
+ set_led_status( space->machine(), 3, (~data) & 0x20 );
+ set_led_status( space->machine(), 4, (~data) & 0x40 );
+ set_led_status( space->machine(), 5, (~data) & 0x80 );
funcube_debug_outputs();
}
static READ8_HANDLER( funcube_outputs_r )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
// Bits 1,2,3 read
return *state->funcube_outputs;
@@ -721,7 +721,7 @@ static READ8_HANDLER( funcube_outputs_r )
static WRITE8_HANDLER( funcube_outputs_w )
{
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
*state->funcube_outputs = data;
@@ -733,7 +733,7 @@ static WRITE8_HANDLER( funcube_outputs_w )
// Bit 1: high on pay out
// Bit 3: low after coining up, blinks on pay out
- set_led_status( space->machine, 6, (~data) & 0x08 );
+ set_led_status( space->machine(), 6, (~data) & 0x08 );
funcube_debug_outputs();
}
@@ -1996,7 +1996,7 @@ static INTERRUPT_GEN( seta2_interrupt )
{
case 0:
/* VBlank is connected to INT0 (external interrupts pin 0) */
- tmp68301_external_interrupt_0(device->machine);
+ tmp68301_external_interrupt_0(device->machine());
break;
}
}
@@ -2006,10 +2006,10 @@ static INTERRUPT_GEN( samshoot_interrupt )
switch ( cpu_getiloops(device) )
{
case 0:
- tmp68301_external_interrupt_0(device->machine); // vblank
+ tmp68301_external_interrupt_0(device->machine()); // vblank
break;
case 1:
- tmp68301_external_interrupt_2(device->machine); // to do: hook up x1-10 interrupts
+ tmp68301_external_interrupt_2(device->machine()); // to do: hook up x1-10 interrupts
break;
}
}
@@ -2171,7 +2171,7 @@ static INTERRUPT_GEN( funcube_interrupt )
static INTERRUPT_GEN( funcube_sub_timer_irq )
{
- seta2_state *state = device->machine->driver_data<seta2_state>();
+ seta2_state *state = device->machine().driver_data<seta2_state>();
if ( state->funcube_serial_count )
{
@@ -2179,14 +2179,14 @@ static INTERRUPT_GEN( funcube_sub_timer_irq )
}
else
{
- UINT8 press = input_port_read(device->machine,"TOUCH_PRESS");
+ UINT8 press = input_port_read(device->machine(),"TOUCH_PRESS");
UINT8 release = state->funcube_press && !press;
if ( press || release )
{
state->funcube_serial_fifo[0] = press ? 0xfe : 0xfd;
- state->funcube_serial_fifo[1] = input_port_read(device->machine,"TOUCH_X");
- state->funcube_serial_fifo[2] = input_port_read(device->machine,"TOUCH_Y");
+ state->funcube_serial_fifo[1] = input_port_read(device->machine(),"TOUCH_X");
+ state->funcube_serial_fifo[2] = input_port_read(device->machine(),"TOUCH_Y");
state->funcube_serial_fifo[3] = 0xff;
state->funcube_serial_count = 4;
}
@@ -2199,7 +2199,7 @@ static INTERRUPT_GEN( funcube_sub_timer_irq )
static MACHINE_RESET( funcube )
{
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
state->funcube_coin_start_cycles = 0;
state->funcube_serial_count = 0;
state->funcube_press = 0;
@@ -2382,8 +2382,8 @@ ROM_END
static DRIVER_INIT( funcube2 )
{
- UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
main_cpu[0x810/4] = 0xe0214e71;
main_cpu[0x814/4] = 0x4e71203c;
@@ -2399,7 +2399,7 @@ static DRIVER_INIT( funcube2 )
// Audio
// The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved
- UINT8* oki = (UINT8*) machine->region("oki")->base();
+ UINT8* oki = (UINT8*) machine.region("oki")->base();
for (int i = 0; i < 0x200000; i++)
{
oki[i] = oki[i+0x200000];
@@ -2409,8 +2409,8 @@ static DRIVER_INIT( funcube2 )
// Note: same as funcube2
static DRIVER_INIT( funcube4 )
{
- UINT32 *main_cpu = (UINT32 *) machine->region("maincpu")->base();
- UINT16 *sub_cpu = (UINT16 *) machine->region("sub")->base();
+ UINT32 *main_cpu = (UINT32 *) machine.region("maincpu")->base();
+ UINT16 *sub_cpu = (UINT16 *) machine.region("sub")->base();
main_cpu[0x810/4] = 0xe0214e71;
main_cpu[0x814/4] = 0x4e71203c;
@@ -2426,7 +2426,7 @@ static DRIVER_INIT( funcube4 )
// Audio
// The first half of the rom appears to be a dupe of the second half with 0xffs destructively interleaved
- UINT8* oki = (UINT8*) machine->region("oki")->base();
+ UINT8* oki = (UINT8*) machine.region("oki")->base();
for (int i = 0; i < 0x200000; i++)
{
oki[i] = oki[i+0x200000];
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 212ee7bfff3..94f94343d51 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -30,18 +30,18 @@ static WRITE16_HANDLER( sf_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_lockout_w(space->machine, 0, ~data & 0x10);
- coin_lockout_w(space->machine, 1, ~data & 0x20);
- coin_lockout_w(space->machine, 2, ~data & 0x40); /* is there a third coin input? */
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_lockout_w(space->machine(), 0, ~data & 0x10);
+ coin_lockout_w(space->machine(), 1, ~data & 0x20);
+ coin_lockout_w(space->machine(), 2, ~data & 0x40); /* is there a third coin input? */
}
}
static WRITE16_HANDLER( soundcmd_w )
{
- sf_state *state = space->machine->driver_data<sf_state>();
+ sf_state *state = space->machine().driver_data<sf_state>();
if (ACCESSING_BITS_0_7)
{
@@ -163,18 +163,18 @@ static const int scale[8] = { 0x00, 0x40, 0xe0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe };
static READ16_HANDLER( button1_r )
{
- return (scale[input_port_read(space->machine, "IN3")] << 8) | scale[input_port_read(space->machine, "IN1")];
+ return (scale[input_port_read(space->machine(), "IN3")] << 8) | scale[input_port_read(space->machine(), "IN1")];
}
static READ16_HANDLER( button2_r )
{
- return (scale[input_port_read(space->machine, "IN4")] << 8) | scale[input_port_read(space->machine, "IN2")];
+ return (scale[input_port_read(space->machine(), "IN4")] << 8) | scale[input_port_read(space->machine(), "IN2")];
}
static WRITE8_HANDLER( sound2_bank_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("audio2")->base() + 0x8000 * (data + 1));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("audio2")->base() + 0x8000 * (data + 1));
}
@@ -789,7 +789,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- sf_state *state = device->machine->driver_data<sf_state>();
+ sf_state *state = device->machine().driver_data<sf_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -806,11 +806,11 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( sf )
{
- sf_state *state = machine->driver_data<sf_state>();
+ sf_state *state = machine.driver_data<sf_state>();
/* devices */
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sf_active));
state->save_item(NAME(state->bgscroll));
@@ -819,7 +819,7 @@ static MACHINE_START( sf )
static MACHINE_RESET( sf )
{
- sf_state *state = machine->driver_data<sf_state>();
+ sf_state *state = machine.driver_data<sf_state>();
state->sf_active = 0;
state->bgscroll = 0;
diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c
index b096df1496a..98603726730 100644
--- a/src/mame/drivers/sfbonus.c
+++ b/src/mame/drivers/sfbonus.c
@@ -625,7 +625,7 @@ INPUT_PORTS_END
static TILE_GET_INFO( get_sfbonus_tile_info )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
int code = state->tilemap_ram[(tile_index*2)+0] | (state->tilemap_ram[(tile_index*2)+1]<<8);
int flipx = (state->tilemap_ram[(tile_index*2)+1] & 0x80)>>7;
int flipy = (state->tilemap_ram[(tile_index*2)+1] & 0x40)>>5;
@@ -639,7 +639,7 @@ static TILE_GET_INFO( get_sfbonus_tile_info )
static TILE_GET_INFO( get_sfbonus_reel_tile_info )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
int code = state->reel_ram[(tile_index*2)+0] | (state->reel_ram[(tile_index*2)+1]<<8);
int flipx = (state->reel_ram[(tile_index*2)+1] & 0x80)>>7;
int flipy = 0;//(state->reel_ram[(tile_index*2)+1] & 0x40)>>5;
@@ -655,7 +655,7 @@ static TILE_GET_INFO( get_sfbonus_reel_tile_info )
static TILE_GET_INFO( get_sfbonus_reel2_tile_info )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
int code = state->reel2_ram[(tile_index*2)+0] | (state->reel2_ram[(tile_index*2)+1]<<8);
int flipx = (state->reel2_ram[(tile_index*2)+1] & 0x80)>>7;
int flipy = 0;//(state->reel2_ram[(tile_index*2)+1] & 0x40)>>5;
@@ -671,7 +671,7 @@ static TILE_GET_INFO( get_sfbonus_reel2_tile_info )
static TILE_GET_INFO( get_sfbonus_reel3_tile_info )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
int code = state->reel3_ram[(tile_index*2)+0] | (state->reel3_ram[(tile_index*2)+1]<<8);
int flipx = (state->reel3_ram[(tile_index*2)+1] & 0x80)>>7;
int flipy = 0;//(state->reel3_ram[(tile_index*2)+1] & 0x40)>>5;
@@ -687,7 +687,7 @@ static TILE_GET_INFO( get_sfbonus_reel3_tile_info )
static TILE_GET_INFO( get_sfbonus_reel4_tile_info )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
int code = state->reel4_ram[(tile_index*2)+0] | (state->reel4_ram[(tile_index*2)+1]<<8);
int flipx = (state->reel4_ram[(tile_index*2)+1] & 0x80)>>7;
int flipy = 0;//(state->reel4_ram[(tile_index*2)+1] & 0x40)>>5;
@@ -704,7 +704,7 @@ static TILE_GET_INFO( get_sfbonus_reel4_tile_info )
static WRITE8_HANDLER( sfbonus_videoram_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
if (offset<0x4000) /* 0x0000 - 0x3fff */
{
state->tilemap_ram[offset] = data;
@@ -756,7 +756,7 @@ static WRITE8_HANDLER( sfbonus_videoram_w )
static VIDEO_START(sfbonus)
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
state->temp_reel_bitmap = auto_bitmap_alloc(machine,1024,512,BITMAP_FORMAT_INDEXED16);
state->tilemap = tilemap_create(machine,get_sfbonus_tile_info,tilemap_scan_rows,8,8, 128, 64);
@@ -783,7 +783,7 @@ static VIDEO_START(sfbonus)
static void sfbonus_draw_reel_layer(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory)
{
- sfbonus_state *state = screen->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = screen->machine().driver_data<sfbonus_state>();
int zz;
int i;
int startclipmin;
@@ -922,7 +922,7 @@ static void sfbonus_draw_reel_layer(screen_device *screen, bitmap_t *bitmap, con
static SCREEN_UPDATE(sfbonus)
{
- sfbonus_state *state = screen->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = screen->machine().driver_data<sfbonus_state>();
int globalyscroll = (state->vregs[2] | state->vregs[3]<<8);
int globalxscroll = (state->vregs[0] | state->vregs[1]<<8);
@@ -934,8 +934,8 @@ static SCREEN_UPDATE(sfbonus)
globalyscroll += 8;
globalxscroll += 8;
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0]);
- bitmap_fill(state->temp_reel_bitmap,cliprect,screen->machine->pens[0]);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0]);
+ bitmap_fill(state->temp_reel_bitmap,cliprect,screen->machine().pens[0]);
/* render reels to bitmap */
sfbonus_draw_reel_layer(screen,state->temp_reel_bitmap,cliprect,0);
@@ -1031,7 +1031,7 @@ static SCREEN_UPDATE(sfbonus)
state->_1800_regs[7]);
#endif
- ipt = screen->machine->system().ipt;
+ ipt = screen->machine().system().ipt;
if ((ipt == INPUT_PORTS_NAME(amcoe2_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe2_reels4))
|| (ipt == INPUT_PORTS_NAME(amcoe2_poker)))
{
@@ -1060,7 +1060,7 @@ static SCREEN_UPDATE(sfbonus)
static WRITE8_HANDLER( paletteram_io_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
switch(offset)
{
case 0:
@@ -1082,7 +1082,7 @@ static WRITE8_HANDLER( paletteram_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -1101,34 +1101,34 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sfbonus_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT8 bank;
bank = data & 7;
- memory_set_bankptr(space->machine, "bank1", &ROM[bank * 0x10000]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bank * 0x10000]);
}
static READ8_HANDLER( sfbonus_2800_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( sfbonus_2801_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( sfbonus_2c00_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( sfbonus_2c01_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( sfbonus_3800_r )
@@ -1140,31 +1140,31 @@ static READ8_HANDLER( sfbonus_3800_r )
// lamps and coin counters
static WRITE8_HANDLER( sfbonus_1800_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
state->_1800_regs[offset] = data;
}
static WRITE8_HANDLER( sfbonus_3800_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
state->_3800_regs[offset] = data;
}
static WRITE8_HANDLER( sfbonus_3000_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
state->_3000_regs[offset] = data;
}
static WRITE8_HANDLER( sfbonus_2801_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
state->_2801_regs[offset] = data;
}
static WRITE8_HANDLER( sfbonus_2c01_w )
{
- sfbonus_state *state = space->machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = space->machine().driver_data<sfbonus_state>();
state->_2c01_regs[offset] = data;
}
@@ -1238,14 +1238,14 @@ GFXDECODE_END
static MACHINE_RESET( sfbonus )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0]);
}
static NVRAM_HANDLER( sfbonus )
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
if (read_or_write)
file->write(state->nvram,state->nvram_size);
else
@@ -1257,12 +1257,12 @@ static NVRAM_HANDLER( sfbonus )
}
else
{
- UINT8* defaultram = machine->region("defaults")->base();
+ UINT8* defaultram = machine.region("defaults")->base();
memset(state->nvram,0x00,state->nvram_size);
if (defaultram)
if ((defaultram[0x02]==0x00) && (defaultram[0x03]==0x00)) // hack! rom region optional regions get cleared with garbage if no rom is present, this is not good!
- memcpy(state->nvram, machine->region("defaults")->base(), machine->region("defaults")->bytes());
+ memcpy(state->nvram, machine.region("defaults")->base(), machine.region("defaults")->bytes());
}
}
}
@@ -5466,7 +5466,7 @@ ROM_END
static DRIVER_INIT( sfbonus_common)
{
- sfbonus_state *state = machine->driver_data<sfbonus_state>();
+ sfbonus_state *state = machine.driver_data<sfbonus_state>();
state->tilemap_ram = auto_alloc_array(machine, UINT8, 0x4000);
memset(state->tilemap_ram, 0xff, 0x4000);
state_save_register_global_pointer(machine, state->tilemap_ram , 0x4000);
@@ -5488,7 +5488,7 @@ static DRIVER_INIT( sfbonus_common)
state_save_register_global_pointer(machine, state->reel4_ram , 0x0800);
// hack, because the debugger is broken
- state->videoram = machine->region("debugram")->base();
+ state->videoram = machine.region("debugram")->base();
if (!state->videoram)
state->videoram = auto_alloc_array(machine, UINT8, 0x10000);
@@ -5498,9 +5498,9 @@ static DRIVER_INIT( sfbonus_common)
// dummy.rom helper
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
- UINT8* ROM2 = machine->region("user1")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
+ UINT8* ROM2 = machine.region("user1")->base();
if (ROM2)
{
@@ -5526,7 +5526,7 @@ static DRIVER_INIT( sfbonus_common)
{
FILE *fp;
char filename[256];
- sprintf(filename,"decr_%s", machine->system().name);
+ sprintf(filename,"decr_%s", machine.system().name);
fp = fopen(filename, "w+b");
if (fp)
{
@@ -5538,7 +5538,7 @@ static DRIVER_INIT( sfbonus_common)
}
}
-static void sfbonus_bitswap( running_machine* machine,
+static void sfbonus_bitswap( running_machine& machine,
UINT8 xor0, UINT8 b00, UINT8 b01, UINT8 b02, UINT8 b03, UINT8 b04, UINT8 b05, UINT8 b06,UINT8 b07,
UINT8 xor1, UINT8 b10, UINT8 b11, UINT8 b12, UINT8 b13, UINT8 b14, UINT8 b15, UINT8 b16,UINT8 b17,
UINT8 xor2, UINT8 b20, UINT8 b21, UINT8 b22, UINT8 b23, UINT8 b24, UINT8 b25, UINT8 b26,UINT8 b27,
@@ -5550,9 +5550,9 @@ static void sfbonus_bitswap( running_machine* machine,
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
- for(i = 0; i < machine->region("maincpu")->bytes(); i++)
+ for(i = 0; i < machine.region("maincpu")->bytes(); i++)
{
UINT8 x = ROM[i];
diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c
index 2112b18c05e..f5c1b00ead9 100644
--- a/src/mame/drivers/sfkick.c
+++ b/src/mame/drivers/sfkick.c
@@ -83,27 +83,27 @@ public:
static READ8_DEVICE_HANDLER( ppi_port_b_r )
{
- sfkick_state *state = device->machine->driver_data<sfkick_state>();
+ sfkick_state *state = device->machine().driver_data<sfkick_state>();
switch(state->input_mux&0x0f)
{
- case 0: return input_port_read(device->machine, "IN0");
- case 1: return input_port_read(device->machine, "IN1");
- case 2: return BITSWAP8(input_port_read(device->machine, "DIAL"),4,5,6,7,3,2,1,0);
- case 3: return input_port_read(device->machine, "DSW2");
- case 4: return input_port_read(device->machine, "DSW1");
+ case 0: return input_port_read(device->machine(), "IN0");
+ case 1: return input_port_read(device->machine(), "IN1");
+ case 2: return BITSWAP8(input_port_read(device->machine(), "DIAL"),4,5,6,7,3,2,1,0);
+ case 3: return input_port_read(device->machine(), "DSW2");
+ case 4: return input_port_read(device->machine(), "DSW1");
}
return 0xff;
}
-static void sfkick_remap_banks(running_machine *machine)
+static void sfkick_remap_banks(running_machine &machine)
{
- sfkick_state *state = machine->driver_data<sfkick_state>();
+ sfkick_state *state = machine.driver_data<sfkick_state>();
/* 0000-3ffff */
switch(state->bank_cfg&3)
{
case 0: /* bios */
{
- UINT8 *mem = machine->region("bios")->base();
+ UINT8 *mem = machine.region("bios")->base();
memory_set_bankptr(machine,"bank1", mem);
memory_set_bankptr(machine,"bank2", mem+0x2000);
}
@@ -111,7 +111,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 1: /* ext rom */
{
- UINT8 *mem = machine->region("extrom")->base();
+ UINT8 *mem = machine.region("extrom")->base();
memory_set_bankptr(machine,"bank1", mem+0x4000);
memory_set_bankptr(machine,"bank2", mem+0x6000);
}
@@ -119,7 +119,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 2: /* banked */
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank1", mem+0x2000*state->bank[0]);
memory_set_bankptr(machine,"bank2", mem+0x2000*state->bank[1]);
}
@@ -127,7 +127,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 3: /* unknown */
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank1", mem+0x18000);
memory_set_bankptr(machine,"bank2", mem+0x18000);
}
@@ -139,7 +139,7 @@ static void sfkick_remap_banks(running_machine *machine)
{
case 0: /* bios - upper part */
{
- UINT8 *mem = machine->region("bios")->base();
+ UINT8 *mem = machine.region("bios")->base();
memory_set_bankptr(machine,"bank3", mem+0x4000);
memory_set_bankptr(machine,"bank4", mem+0x6000);
}
@@ -148,7 +148,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank3", mem+0x18000);
memory_set_bankptr(machine,"bank4", mem+0x18000);
}
@@ -156,7 +156,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 2: /* banked */
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank3", mem+0x2000*state->bank[2]);
memory_set_bankptr(machine,"bank4", mem+0x2000*state->bank[3]);
}
@@ -168,7 +168,7 @@ static void sfkick_remap_banks(running_machine *machine)
{
case 0: /* cartridge */
{
- UINT8 *mem = machine->region("cartridge")->base();
+ UINT8 *mem = machine.region("cartridge")->base();
memory_set_bankptr(machine,"bank5", mem+0x4000);
memory_set_bankptr(machine,"bank6", mem+0x6000);
}
@@ -177,7 +177,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 1: /* unknown */
case 3:
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank5", mem+0x18000);
memory_set_bankptr(machine,"bank6", mem+0x18000);
}
@@ -185,7 +185,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 2: /* banked */
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank5", mem+0x2000*state->bank[4]);
memory_set_bankptr(machine,"bank6", mem+0x2000*state->bank[5]);
}
@@ -198,7 +198,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 0: /* unknown */
case 1:
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank7", mem+0x18000);
memory_set_bankptr(machine,"bank8", mem+0x18000);
}
@@ -206,7 +206,7 @@ static void sfkick_remap_banks(running_machine *machine)
case 2: /* banked */
{
- UINT8 *mem = machine->region("banked")->base();
+ UINT8 *mem = machine.region("banked")->base();
memory_set_bankptr(machine,"bank7", mem+0x2000*state->bank[6]);
memory_set_bankptr(machine,"bank8", mem+0x2000*state->bank[7]);
}
@@ -223,14 +223,14 @@ static void sfkick_remap_banks(running_machine *machine)
static WRITE8_DEVICE_HANDLER ( ppi_port_a_w )
{
- sfkick_state *state = device->machine->driver_data<sfkick_state>();
+ sfkick_state *state = device->machine().driver_data<sfkick_state>();
state->bank_cfg=data;
- sfkick_remap_banks(device->machine);
+ sfkick_remap_banks(device->machine());
}
-static void sfkick_bank_set(running_machine *machine,int num, int data)
+static void sfkick_bank_set(running_machine &machine,int num, int data)
{
- sfkick_state *state = machine->driver_data<sfkick_state>();
+ sfkick_state *state = machine.driver_data<sfkick_state>();
/* ignore bit 1 */
data&=0xf;
num&=5;
@@ -242,64 +242,64 @@ static void sfkick_bank_set(running_machine *machine,int num, int data)
static WRITE8_HANDLER(page0_w)
{
- sfkick_state *state = space->machine->driver_data<sfkick_state>();
+ sfkick_state *state = space->machine().driver_data<sfkick_state>();
if((state->bank_cfg&3)==2)
{
if(offset<0x2000)
{
- sfkick_bank_set(space->machine,0,data);
+ sfkick_bank_set(space->machine(),0,data);
}
else
{
- sfkick_bank_set(space->machine,1,data);
+ sfkick_bank_set(space->machine(),1,data);
}
}
}
static WRITE8_HANDLER(page1_w)
{
- sfkick_state *state = space->machine->driver_data<sfkick_state>();
+ sfkick_state *state = space->machine().driver_data<sfkick_state>();
if(((state->bank_cfg>>2)&3)==2)
{
if(offset<0x2000)
{
- sfkick_bank_set(space->machine,2,data);
+ sfkick_bank_set(space->machine(),2,data);
}
else
{
- sfkick_bank_set(space->machine,3,data);
+ sfkick_bank_set(space->machine(),3,data);
}
}
}
static WRITE8_HANDLER(page2_w)
{
- sfkick_state *state = space->machine->driver_data<sfkick_state>();
+ sfkick_state *state = space->machine().driver_data<sfkick_state>();
if(((state->bank_cfg>>4)&3)==2)
{
if(offset<0x2000)
{
- sfkick_bank_set(space->machine,4,data);
+ sfkick_bank_set(space->machine(),4,data);
}
else
{
- sfkick_bank_set(space->machine,5,data);
+ sfkick_bank_set(space->machine(),5,data);
}
}
}
static WRITE8_HANDLER(page3_w)
{
- sfkick_state *state = space->machine->driver_data<sfkick_state>();
+ sfkick_state *state = space->machine().driver_data<sfkick_state>();
if(((state->bank_cfg>>6)&3)==2)
{
if(offset<0x2000)
{
- sfkick_bank_set(space->machine,6,data);
+ sfkick_bank_set(space->machine(),6,data);
}
else
{
- sfkick_bank_set(space->machine,7,data);
+ sfkick_bank_set(space->machine(),7,data);
}
}
else
@@ -353,7 +353,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER ( ppi_port_c_w )
{
- sfkick_state *state = device->machine->driver_data<sfkick_state>();
+ sfkick_state *state = device->machine().driver_data<sfkick_state>();
state->input_mux=data;
}
@@ -430,7 +430,7 @@ static INPUT_PORTS_START( sfkick )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C ) )
INPUT_PORTS_END
-static void sfkick_vdp_interrupt(running_machine *machine, int i)
+static void sfkick_vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line (machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
@@ -438,13 +438,13 @@ static void sfkick_vdp_interrupt(running_machine *machine, int i)
static VIDEO_START( sfkick )
{
VIDEO_START_CALL(generic_bitmapped);
- v9938_init (machine, 0, *machine->primary_screen, machine->generic.tmpbitmap, MODEL_V9938, 0x80000, sfkick_vdp_interrupt);
+ v9938_init (machine, 0, *machine.primary_screen, machine.generic.tmpbitmap, MODEL_V9938, 0x80000, sfkick_vdp_interrupt);
v9938_reset(0);
}
static MACHINE_RESET(sfkick)
{
- sfkick_state *state = machine->driver_data<sfkick_state>();
+ sfkick_state *state = machine.driver_data<sfkick_state>();
v9938_reset(0);
state->bank_cfg=0;
state->bank[0]=0;
@@ -460,11 +460,11 @@ static MACHINE_RESET(sfkick)
static INTERRUPT_GEN( sfkick_interrupt )
{
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line_and_vector(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
+ cputag_set_input_line_and_vector(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
}
static const ym2203_interface ym2203_config =
@@ -520,7 +520,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(sfkick)
{
- sfkick_state *state = machine->driver_data<sfkick_state>();
+ sfkick_state *state = machine.driver_data<sfkick_state>();
state->main_mem=auto_alloc_array(machine, UINT8, 0x4000);
}
diff --git a/src/mame/drivers/sg1000a.c b/src/mame/drivers/sg1000a.c
index 6bf237ab0d7..0f01bb5abeb 100644
--- a/src/mame/drivers/sg1000a.c
+++ b/src/mame/drivers/sg1000a.c
@@ -236,10 +236,10 @@ INPUT_PORTS_END
static INTERRUPT_GEN( sg1000a_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
-static void vdp_interrupt(running_machine *machine, int state)
+static void vdp_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, state);
}
@@ -254,7 +254,7 @@ static const TMS9928a_interface tms9928a_interface =
static WRITE8_DEVICE_HANDLER( sg1000a_coin_counter_w )
{
- coin_counter_w(device->machine, 0, data & 0x01);
+ coin_counter_w(device->machine(), 0, data & 0x01);
}
static I8255A_INTERFACE( ppi8255_intf )
diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c
index 9212e99369a..c62f6da30a3 100644
--- a/src/mame/drivers/shadfrce.c
+++ b/src/mame/drivers/shadfrce.c
@@ -151,7 +151,7 @@ lev 7 : 0x7c : 0000 11d0 - just rte
static WRITE16_HANDLER( shadfrce_flip_screen )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
@@ -236,22 +236,22 @@ static WRITE16_HANDLER( shadfrce_flip_screen )
static READ16_HANDLER( shadfrce_input_ports_r )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
UINT16 data = 0xffff;
switch (offset)
{
case 0 :
- data = (input_port_read(space->machine, "P1") & 0xff) | ((input_port_read(space->machine, "DSW2") & 0xc0) << 6) | ((input_port_read(space->machine, "SYSTEM") & 0x0f) << 8);
+ data = (input_port_read(space->machine(), "P1") & 0xff) | ((input_port_read(space->machine(), "DSW2") & 0xc0) << 6) | ((input_port_read(space->machine(), "SYSTEM") & 0x0f) << 8);
break;
case 1 :
- data = (input_port_read(space->machine, "P2") & 0xff) | ((input_port_read(space->machine, "DSW2") & 0x3f) << 8);
+ data = (input_port_read(space->machine(), "P2") & 0xff) | ((input_port_read(space->machine(), "DSW2") & 0x3f) << 8);
break;
case 2 :
- data = (input_port_read(space->machine, "EXTRA") & 0xff) | ((input_port_read(space->machine, "DSW1") & 0x3f) << 8);
+ data = (input_port_read(space->machine(), "EXTRA") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0x3f) << 8);
break;
case 3 :
- data = (input_port_read(space->machine, "OTHER") & 0xff) | ((input_port_read(space->machine, "DSW1") & 0xc0) << 2) | ((input_port_read(space->machine, "MISC") & 0x38) << 8) | (state->vblank << 8);
+ data = (input_port_read(space->machine(), "OTHER") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0xc0) << 2) | ((input_port_read(space->machine(), "MISC") & 0x38) << 8) | (state->vblank << 8);
break;
}
@@ -264,7 +264,7 @@ static WRITE16_HANDLER ( shadfrce_sound_brt_w )
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 1, data >> 8);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
else
{
@@ -272,18 +272,18 @@ static WRITE16_HANDLER ( shadfrce_sound_brt_w )
double brt = (data & 0xff) / 255.0;
for (i = 0; i < 0x4000; i++)
- palette_set_pen_contrast(space->machine, i, brt);
+ palette_set_pen_contrast(space->machine(), i, brt);
}
}
static WRITE16_HANDLER( shadfrce_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", offset ^ 3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", offset ^ 3, CLEAR_LINE);
}
static WRITE16_HANDLER( shadfrce_irq_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
state->irqs_enable = data & 1; /* maybe, it's set/unset inside every trap instruction which is executed */
state->video_enable = data & 8; /* probably */
@@ -305,14 +305,14 @@ static WRITE16_HANDLER( shadfrce_irq_w )
static WRITE16_HANDLER( shadfrce_scanline_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
state->raster_scanline = data; /* guess, 0 is always written */
}
static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
{
- shadfrce_state *state = timer.machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = timer.machine().driver_data<shadfrce_state>();
int scanline = param;
/* Vblank is lowered on scanline 0 */
@@ -333,8 +333,8 @@ static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
{
state->raster_scanline = (state->raster_scanline + 1) % 240;
if (state->raster_scanline > 0)
- timer.machine->primary_screen->update_partial(state->raster_scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 1, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(state->raster_scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 1, ASSERT_LINE);
}
}
@@ -344,8 +344,8 @@ static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 2, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, ASSERT_LINE);
}
}
@@ -354,8 +354,8 @@ static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
{
if (scanline == 248)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 3, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 3, ASSERT_LINE);
}
}
}
@@ -548,7 +548,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE );
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c
index 9ef58b1cfb9..42370341463 100644
--- a/src/mame/drivers/shangha3.c
+++ b/src/mame/drivers/shangha3.c
@@ -44,7 +44,7 @@ write read
*/
static READ16_HANDLER( shangha3_prot_r )
{
- shangha3_state *state = space->machine->driver_data<shangha3_state>();
+ shangha3_state *state = space->machine().driver_data<shangha3_state>();
static const int result[] = { 0x0,0x1,0x3,0x7,0xf,0xe,0xc,0x8,0x0};
logerror("PC %04x: read 20004e\n",cpu_get_pc(space->cpu));
@@ -59,7 +59,7 @@ static WRITE16_HANDLER( shangha3_prot_w )
static READ16_HANDLER( heberpop_gfxrom_r )
{
- UINT8 *ROM = space->machine->region("gfx1")->base();
+ UINT8 *ROM = space->machine().region("gfx1")->base();
return ROM[2*offset] | (ROM[2*offset+1] << 8);
}
@@ -70,10 +70,10 @@ static WRITE16_HANDLER( shangha3_coinctrl_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_lockout_w(space->machine, 0,~data & 0x0400);
- coin_lockout_w(space->machine, 1,~data & 0x0400);
- coin_counter_w(space->machine, 0,data & 0x0100);
- coin_counter_w(space->machine, 1,data & 0x0200);
+ coin_lockout_w(space->machine(), 0,~data & 0x0400);
+ coin_lockout_w(space->machine(), 1,~data & 0x0400);
+ coin_counter_w(space->machine(), 0,data & 0x0100);
+ coin_counter_w(space->machine(), 1,data & 0x0200);
}
}
@@ -82,12 +82,12 @@ static WRITE16_HANDLER( heberpop_coinctrl_w )
if (ACCESSING_BITS_0_7)
{
/* the sound ROM bank is selected by the main CPU! */
- space->machine->device<okim6295_device>("oki")->set_bank_base((data & 0x08) ? 0x40000 : 0x00000);
+ space->machine().device<okim6295_device>("oki")->set_bank_base((data & 0x08) ? 0x40000 : 0x00000);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x04);
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x04);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
}
}
@@ -96,12 +96,12 @@ static WRITE16_HANDLER( blocken_coinctrl_w )
if (ACCESSING_BITS_0_7)
{
/* the sound ROM bank is selected by the main CPU! */
- space->machine->device<okim6295_device>("oki")->set_bank_base(((data >> 4) & 3) * 0x40000);
+ space->machine().device<okim6295_device>("oki")->set_bank_base(((data >> 4) & 3) * 0x40000);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x04);
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x04);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
}
}
@@ -111,7 +111,7 @@ static WRITE16_HANDLER( heberpop_sound_command_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff); /* RST 38h */
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff); /* RST 38h */
}
}
@@ -458,7 +458,7 @@ static const ay8910_interface ay8910_config =
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, linestate);
}
static const ym3438_interface ym3438_config =
@@ -657,14 +657,14 @@ ROM_END
static DRIVER_INIT( shangha3 )
{
- shangha3_state *state = machine->driver_data<shangha3_state>();
+ shangha3_state *state = machine.driver_data<shangha3_state>();
state->do_shadows = 1;
}
static DRIVER_INIT( heberpop )
{
- shangha3_state *state = machine->driver_data<shangha3_state>();
+ shangha3_state *state = machine.driver_data<shangha3_state>();
state->do_shadows = 0;
}
diff --git a/src/mame/drivers/shanghai.c b/src/mame/drivers/shanghai.c
index 147c468fa4b..2936efcbd3c 100644
--- a/src/mame/drivers/shanghai.c
+++ b/src/mame/drivers/shanghai.c
@@ -42,7 +42,7 @@ static PALETTE_INIT( shanghai )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -73,7 +73,7 @@ static VIDEO_START( shanghai )
static SCREEN_UPDATE( shanghai )
{
- device_t *hd63484 = screen->machine->device("hd63484");
+ device_t *hd63484 = screen->machine().device("hd63484");
int x, y, b, src;
b = ((hd63484_regs_r(hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, 0xce/2, 0xffff);
@@ -127,8 +127,8 @@ static WRITE16_HANDLER( shanghai_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
}
}
diff --git a/src/mame/drivers/shangkid.c b/src/mame/drivers/shangkid.c
index 5a0759c69ba..c0d2ad53aea 100644
--- a/src/mame/drivers/shangkid.c
+++ b/src/mame/drivers/shangkid.c
@@ -58,59 +58,59 @@ Games by Nihon Game/Culture Brain:
static WRITE8_HANDLER( shangkid_maincpu_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER( shangkid_bbx_enable_w )
{
- cputag_set_input_line(space->machine, "bbx", INPUT_LINE_HALT, data?0:1 );
+ cputag_set_input_line(space->machine(), "bbx", INPUT_LINE_HALT, data?0:1 );
}
static WRITE8_HANDLER( shangkid_cpu_reset_w )
{
if( data == 0 )
{
- cputag_set_input_line(space->machine, "bbx", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "bbx", INPUT_LINE_RESET, PULSE_LINE);
}
else if( data == 1 )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
}
static WRITE8_HANDLER( shangkid_sound_enable_w )
{
- shangkid_state *state = space->machine->driver_data<shangkid_state>();
+ shangkid_state *state = space->machine().driver_data<shangkid_state>();
state->bbx_sound_enable = data;
}
static WRITE8_DEVICE_HANDLER( chinhero_ay8910_porta_w )
{
- shangkid_state *state = device->machine->driver_data<shangkid_state>();
+ shangkid_state *state = device->machine().driver_data<shangkid_state>();
if( state->bbx_sound_enable )
{
if( data == 0x01 )
/* 0->1 transition triggers interrupt on Sound CPU */
- cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", 0, HOLD_LINE );
}
}
static WRITE8_DEVICE_HANDLER( shangkid_ay8910_porta_w )
{
- shangkid_state *state = device->machine->driver_data<shangkid_state>();
+ shangkid_state *state = device->machine().driver_data<shangkid_state>();
if( state->bbx_sound_enable )
{
if( data == 0x01 )
/* 0->1 transition triggers interrupt on Sound CPU */
- cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", 0, HOLD_LINE );
}
else
- memory_set_bank(device->machine, "bank2", data ? 0 : 1);
+ memory_set_bank(device->machine(), "bank2", data ? 0 : 1);
}
static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
{
- shangkid_state *state = device->machine->driver_data<shangkid_state>();
+ shangkid_state *state = device->machine().driver_data<shangkid_state>();
state->sound_latch = data;
}
@@ -118,7 +118,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
static READ8_HANDLER( shangkid_soundlatch_r )
{
- shangkid_state *state = space->machine->driver_data<shangkid_state>();
+ shangkid_state *state = space->machine().driver_data<shangkid_state>();
return state->sound_latch;
}
@@ -126,18 +126,18 @@ static READ8_HANDLER( shangkid_soundlatch_r )
static DRIVER_INIT( chinhero )
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
state->gfx_type = 0;
}
static DRIVER_INIT( shangkid )
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
state->gfx_type = 1;
/* set up banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x8000, 0x8000);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("audiocpu")->base() + 0x0000, 0x10000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x8000, 0x8000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("audiocpu")->base() + 0x0000, 0x10000);
}
/***************************************************************************************/
diff --git a/src/mame/drivers/shaolins.c b/src/mame/drivers/shaolins.c
index 669e9740dba..785d24bf6d2 100644
--- a/src/mame/drivers/shaolins.c
+++ b/src/mame/drivers/shaolins.c
@@ -16,7 +16,7 @@ driver by Allard Van Der Bas
static INTERRUPT_GEN( shaolins_interrupt )
{
- shaolins_state *state = device->machine->driver_data<shaolins_state>();
+ shaolins_state *state = device->machine().driver_data<shaolins_state>();
if (cpu_getiloops(device) == 0) device_set_input_line(device, 0, HOLD_LINE);
else if (cpu_getiloops(device) % 2)
diff --git a/src/mame/drivers/shisen.c b/src/mame/drivers/shisen.c
index 1b71d838fe2..1f1ca2dc425 100644
--- a/src/mame/drivers/shisen.c
+++ b/src/mame/drivers/shisen.c
@@ -15,18 +15,18 @@ driver by Nicola Salmoria
static READ8_HANDLER( sichuan2_dsw1_r )
{
- int ret = input_port_read(space->machine, "DSW1");
+ int ret = input_port_read(space->machine(), "DSW1");
/* Based on the coin mode fill in the upper bits */
- if (input_port_read(space->machine, "DSW2") & 0x04)
+ if (input_port_read(space->machine(), "DSW2") & 0x04)
{
/* Mode 1 */
- ret |= (input_port_read(space->machine, "DSW1") << 4);
+ ret |= (input_port_read(space->machine(), "DSW1") << 4);
}
else
{
/* Mode 2 */
- ret |= (input_port_read(space->machine, "DSW1") & 0xf0);
+ ret |= (input_port_read(space->machine(), "DSW1") & 0xf0);
}
return ret;
@@ -36,8 +36,8 @@ static WRITE8_HANDLER( sichuan2_coin_w )
{
if ((data & 0xf9) != 0x01) logerror("coin ctrl = %02x\n",data);
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
}
diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c
index 05c6c5a1803..d9af8b090ef 100644
--- a/src/mame/drivers/shootout.c
+++ b/src/mame/drivers/shootout.c
@@ -43,23 +43,23 @@
static WRITE8_HANDLER( shootout_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( sound_cpu_command_w )
{
soundlatch_w( space, offset, data );
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
static WRITE8_HANDLER( shootout_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
static WRITE8_HANDLER( shootout_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
/*******************************************************************************/
@@ -107,7 +107,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted )
{
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
static INPUT_PORTS_START( shootout )
@@ -229,12 +229,12 @@ GFXDECODE_END
static void shootout_snd_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static void shootout_snd2_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "maincpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "maincpu", 0, linestate);
}
static const ym2203_interface ym2203_config =
@@ -409,10 +409,10 @@ ROM_END
static DRIVER_INIT( shootout )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- int length = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ int length = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length - 0x8000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -420,13 +420,13 @@ static DRIVER_INIT( shootout )
for (A = 0x8000;A < length;A++)
decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x40) >> 1) | ((rom[A] & 0x20) << 1);
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_configure_bank_decrypted(machine, "bank1", 0, 16, decrypt + 0x8000, 0x4000);
}
static DRIVER_INIT( shootouj )
{
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c
index 5a480906566..2b059da8f1f 100644
--- a/src/mame/drivers/shougi.c
+++ b/src/mame/drivers/shougi.c
@@ -132,7 +132,7 @@ static PALETTE_INIT( shougi )
3, resistances_rg, weights_g, 1000, 0,
2, resistances_b, weights_b, 1000, 0);
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -162,7 +162,7 @@ static PALETTE_INIT( shougi )
static SCREEN_UPDATE( shougi )
{
- shougi_state *state = screen->machine->driver_data<shougi_state>();
+ shougi_state *state = screen->machine().driver_data<shougi_state>();
int offs;
for (offs = 0;offs <0x4000; offs++)
@@ -233,43 +233,43 @@ static WRITE8_HANDLER( shougi_watchdog_reset_w )
static WRITE8_HANDLER( shougi_mcu_halt_off_w )
{
/* logerror("mcu HALT OFF"); */
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_HALT, CLEAR_LINE);
}
static WRITE8_HANDLER( shougi_mcu_halt_on_w )
{
/* logerror("mcu HALT ON"); */
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_HALT,ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_HALT,ASSERT_LINE);
}
static WRITE8_HANDLER( nmi_disable_and_clear_line_w )
{
- shougi_state *state = space->machine->driver_data<shougi_state>();
+ shougi_state *state = space->machine().driver_data<shougi_state>();
state->nmi_enabled = 0; /* disable NMIs */
/* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, CLEAR_LINE);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- shougi_state *state = space->machine->driver_data<shougi_state>();
+ shougi_state *state = space->machine().driver_data<shougi_state>();
state->nmi_enabled = 1; /* enable NMIs */
}
static INTERRUPT_GEN( shougi_vblank_nmi )
{
- shougi_state *state = device->machine->driver_data<shougi_state>();
+ shougi_state *state = device->machine().driver_data<shougi_state>();
if ( state->nmi_enabled == 1 )
{
/* NMI lines are tied together on both CPUs and connected to the LS74 /Q output */
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
- cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "sub", INPUT_LINE_NMI, ASSERT_LINE);
}
}
@@ -305,7 +305,7 @@ ADDRESS_MAP_END
/* sub */
static READ8_HANDLER ( dummy_r )
{
- shougi_state *state = space->machine->driver_data<shougi_state>();
+ shougi_state *state = space->machine().driver_data<shougi_state>();
state->r ^= 1;
if(state->r)
diff --git a/src/mame/drivers/shuuz.c b/src/mame/drivers/shuuz.c
index fe455095b23..20b6e8b1dff 100644
--- a/src/mame/drivers/shuuz.c
+++ b/src/mame/drivers/shuuz.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- shuuz_state *state = machine->driver_data<shuuz_state>();
+ shuuz_state *state = machine.driver_data<shuuz_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -46,13 +46,13 @@ static void update_interrupts(running_machine *machine)
static READ16_HANDLER( shuuz_atarivc_r )
{
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( shuuz_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
@@ -71,11 +71,11 @@ static MACHINE_START( shuuz )
static MACHINE_RESET( shuuz )
{
- shuuz_state *state = machine->driver_data<shuuz_state>();
+ shuuz_state *state = machine.driver_data<shuuz_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 1);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 1);
}
@@ -93,15 +93,15 @@ static WRITE16_HANDLER( latch_w )
static READ16_HANDLER( leta_r )
{
- shuuz_state *state = space->machine->driver_data<shuuz_state>();
+ shuuz_state *state = space->machine().driver_data<shuuz_state>();
/* trackball -- rotated 45 degrees? */
int which = offset & 1;
/* when reading the even ports, do a real analog port update */
if (which == 0)
{
- int dx = (INT8)input_port_read(space->machine, "TRACKX");
- int dy = (INT8)input_port_read(space->machine, "TRACKY");
+ int dx = (INT8)input_port_read(space->machine(), "TRACKX");
+ int dy = (INT8)input_port_read(space->machine(), "TRACKY");
state->cur[0] = dx + dy;
state->cur[1] = dx - dy;
@@ -121,9 +121,9 @@ static READ16_HANDLER( leta_r )
static READ16_HANDLER( special_port0_r )
{
- int result = input_port_read(space->machine, "SYSTEM");
+ int result = input_port_read(space->machine(), "SYSTEM");
- if ((result & 0x0800) && atarigen_get_hblank(*space->machine->primary_screen))
+ if ((result & 0x0800) && atarigen_get_hblank(*space->machine().primary_screen))
result &= ~0x0800;
return result;
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index fd7b6b29b9c..0432f3b5e19 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -44,12 +44,12 @@ Notes:
static WRITE8_HANDLER( sidearms_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
/* bits 0 and 1 select the ROM bank */
bankaddress = 0x10000 + (data & 0x0f) * 0x4000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
@@ -63,7 +63,7 @@ static READ8_HANDLER( turtship_ports_r )
res = 0;
for (i = 0;i < 8;i++)
- res |= ((input_port_read_safe(space->machine, portnames[i], 0) >> offset) & 1) << i;
+ res |= ((input_port_read_safe(space->machine(), portnames[i], 0) >> offset) & 1) << i;
return res;
}
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( whizz_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bank = 0;
switch (data & 0xC0)
@@ -136,7 +136,7 @@ static WRITE8_HANDLER( whizz_bankswitch_w )
}
bankaddress = 0x10000 + bank * 0x4000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
static ADDRESS_MAP_START( whizz_map, AS_PROGRAM, 8 )
@@ -634,7 +634,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -1149,28 +1149,28 @@ ROM_END
static DRIVER_INIT( sidearms )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
state->gameid = 0;
}
static DRIVER_INIT( turtship )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
state->gameid = 1;
}
static DRIVER_INIT( dyger )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
state->gameid = 2;
}
static DRIVER_INIT( whizz )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
state->gameid = 3;
}
diff --git a/src/mame/drivers/sidepckt.c b/src/mame/drivers/sidepckt.c
index b0ef53516ab..dacc6da83f9 100644
--- a/src/mame/drivers/sidepckt.c
+++ b/src/mame/drivers/sidepckt.c
@@ -24,23 +24,23 @@ i8751 protection simluation and other fixes by Bryan McPhail, 15/10/00.
static WRITE8_HANDLER( sound_cpu_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( sidepckt_i8751_r )
{
- sidepckt_state *state = space->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = space->machine().driver_data<sidepckt_state>();
return state->i8751_return;
}
static WRITE8_HANDLER( sidepckt_i8751_w )
{
- sidepckt_state *state = space->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = space->machine().driver_data<sidepckt_state>();
static const int table_1[]={5,3,2};
static const int table_2[]={0x8e,0x42,0xad,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa2,0xff};
static const int table_3[]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff};
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
/* This function takes multiple parameters */
if (state->in_math==1) {
@@ -76,12 +76,12 @@ static WRITE8_HANDLER( sidepckt_i8751_w )
static WRITE8_HANDLER( sidepctj_i8751_w )
{
- sidepckt_state *state = space->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = space->machine().driver_data<sidepckt_state>();
static const int table_1[]={5,3,0};
static const int table_2[]={0x8e,0x42,0xb2,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa7,0xff};
static const int table_3[]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff};
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, HOLD_LINE); /* i8751 triggers FIRQ on main cpu */
/* This function takes multiple parameters */
if (state->in_math==1) {
@@ -249,7 +249,7 @@ GFXDECODE_END
/* handler called by the 3526 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3526_interface ym3526_config =
@@ -379,14 +379,14 @@ ROM_END
static DRIVER_INIT( sidepckt )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3014, 0x3014, FUNC(sidepckt_i8751_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3018, 0x3018, FUNC(sidepckt_i8751_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3014, 0x3014, FUNC(sidepckt_i8751_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3018, 0x3018, FUNC(sidepckt_i8751_w) );
}
static DRIVER_INIT( sidepctj )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3014, 0x3014, FUNC(sidepckt_i8751_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3018, 0x3018, FUNC(sidepctj_i8751_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3014, 0x3014, FUNC(sidepckt_i8751_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3018, 0x3018, FUNC(sidepctj_i8751_w) );
}
diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c
index 3ba85128dd9..8799deb9908 100644
--- a/src/mame/drivers/sigmab52.c
+++ b/src/mame/drivers/sigmab52.c
@@ -158,7 +158,7 @@ static VIDEO_START( jwildb52 )
static SCREEN_UPDATE( jwildb52 )
{
- device_t *hd63484 = screen->machine->device("hd63484");
+ device_t *hd63484 = screen->machine().device("hd63484");
int x, y, b, src;
@@ -166,7 +166,7 @@ static SCREEN_UPDATE( jwildb52 )
//save vram to file
#if 0
- if (input_code_pressed_once(screen->machine, KEYCODE_Q))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_Q))
{
FILE *p = fopen("vram.bin", "wb");
fwrite(&HD63484_ram[0], 1, 0x40000 * 4, p);
@@ -190,7 +190,7 @@ static SCREEN_UPDATE( jwildb52 )
}
}
-if (!input_code_pressed(screen->machine, KEYCODE_O))
+if (!input_code_pressed(screen->machine(), KEYCODE_O))
if ((hd63484_regs_r(hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
{
int sy = (hd63484_regs_r(hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, 0x88/2, 0xffff) >> 8);
@@ -236,8 +236,8 @@ static PALETTE_INIT( jwildb52 )
static WRITE8_HANDLER(acrtc_w)
{
- sigmab52_state *state = space->machine->driver_data<sigmab52_state>();
- device_t *hd63484 = space->machine->device("hd63484");
+ sigmab52_state *state = space->machine().driver_data<sigmab52_state>();
+ device_t *hd63484 = space->machine().device("hd63484");
if(!offset)
{
//address select
@@ -268,7 +268,7 @@ static READ8_HANDLER(acrtc_r)
{
if(offset&1)
{
- device_t *hd63484 = space->machine->device("hd63484");
+ device_t *hd63484 = space->machine().device("hd63484");
return hd63484_data_r(hd63484, 0, 0xff);
}
@@ -290,7 +290,7 @@ static READ8_HANDLER(unk_f700_r)
static WRITE8_HANDLER(unk_f710_w)
{
- memory_set_bankptr(space->machine, "bank1" ,&space->machine->region("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
+ memory_set_bankptr(space->machine(), "bank1" ,&space->machine().region("maincpu")->base()[0x10000 + ((data&0x80)?0x4000:0x0000)]);
}
static READ8_HANDLER(unk_f721_r)
@@ -538,11 +538,11 @@ static INTERRUPT_GEN( timer_irq )
static MACHINE_START(jwildb52)
{
- memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x10000 + 0x0000]);
+ memory_set_bankptr(machine, "bank1", &machine.region("maincpu")->base()[0x10000 + 0x0000]);
- memory_set_bankptr(machine, "bank2", &machine->region("maincpu")->base()[0x10000 + 0xf800]);
+ memory_set_bankptr(machine, "bank2", &machine.region("maincpu")->base()[0x10000 + 0xf800]);
- memory_set_bankptr(machine, "bank3", &machine->region("maincpu")->base()[0x10000 + 0x8000]);
+ memory_set_bankptr(machine, "bank3", &machine.region("maincpu")->base()[0x10000 + 0x8000]);
/*
@@ -556,10 +556,10 @@ static MACHINE_START(jwildb52)
*/
{
- UINT16 *rom = (UINT16*)machine->region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
int i;
- device_t *hd63484 = machine->device("hd63484");
+ device_t *hd63484 = machine.device("hd63484");
for(i = 0; i < 0x40000/2; ++i)
{
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
index d11eb6574b4..4dc861c15b8 100644
--- a/src/mame/drivers/sigmab98.c
+++ b/src/mame/drivers/sigmab98.c
@@ -150,9 +150,9 @@ public:
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
{
- sigmab98_state *state = machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = machine.driver_data<sigmab98_state>();
UINT8 *end = state->spriteram - 0x10;
UINT8 *s = end + state->spriteram_size;
@@ -222,7 +222,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (x = x0; x != x1; x += dx)
{
- drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[gfx],
+ drawgfxzoom_transpen( bitmap, cliprect, machine.gfx[gfx],
code++, color,
flipx, flipy,
(sx + x * dim) / 0x10000, (sy + y * dim) / 0x10000,
@@ -237,24 +237,24 @@ static SCREEN_UPDATE(sigmab98)
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// Draw from priority 3 (bottom, converted to a bitmask) to priority 0 (top)
- draw_sprites(screen->machine, bitmap, cliprect, layers_ctrl & 8);
- draw_sprites(screen->machine, bitmap, cliprect, layers_ctrl & 4);
- draw_sprites(screen->machine, bitmap, cliprect, layers_ctrl & 2);
- draw_sprites(screen->machine, bitmap, cliprect, layers_ctrl & 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 8);
+ draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, layers_ctrl & 1);
return 0;
}
@@ -287,13 +287,13 @@ static WRITE8_HANDLER( regs_w )
case 0x1f:
rombank = data;
if (data >= 0x18)
- logerror("%s: unknown rom bank = %02x\n", space->machine->describe_context(), data);
+ logerror("%s: unknown rom bank = %02x\n", space->machine().describe_context(), data);
else
- memory_set_bank(space->machine, "rombank", data);
+ memory_set_bank(space->machine(), "rombank", data);
break;
default:
- logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data);
+ logerror("%s: unknown reg written: %02x = %02x\n", space->machine().describe_context(), reg, data);
}
}
static READ8_HANDLER( regs_r )
@@ -307,7 +307,7 @@ static READ8_HANDLER( regs_r )
return rombank;
default:
- logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg);
+ logerror("%s: unknown reg read: %02x\n", space->machine().describe_context(), reg);
return 0x00;
}
}
@@ -328,18 +328,18 @@ static WRITE8_HANDLER( regs2_w )
switch (data)
{
case 0x32:
- memory_set_bank(space->machine, "rambank", 0);
+ memory_set_bank(space->machine(), "rambank", 0);
break;
case 0x36:
- memory_set_bank(space->machine, "rambank", 1);
+ memory_set_bank(space->machine(), "rambank", 1);
break;
default:
- logerror("%s: unknown ram bank = %02x\n", space->machine->describe_context(), data);
+ logerror("%s: unknown ram bank = %02x\n", space->machine().describe_context(), data);
}
break;
default:
- logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data);
+ logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine().describe_context(), reg2, data);
}
}
static READ8_HANDLER( regs2_r )
@@ -353,7 +353,7 @@ static READ8_HANDLER( regs2_r )
return rambank;
default:
- logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2);
+ logerror("%s: unknown reg2 read: %02x\n", space->machine().describe_context(), reg2);
return 0x00;
}
}
@@ -390,7 +390,7 @@ static WRITE8_DEVICE_HANDLER( eeprom_w )
// 10 led?
static WRITE8_HANDLER( c4_w )
{
- set_led_status(space->machine, 0, (data & 0x10));
+ set_led_status(space->machine(), 0, (data & 0x10));
c4 = data;
show_outputs();
@@ -404,13 +404,13 @@ static WRITE8_HANDLER( c4_w )
// 20 blinks after coin up
static WRITE8_HANDLER( c6_w )
{
- coin_lockout_w(space->machine, 0, (~data) & 0x02);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x02);
- coin_counter_w(space->machine, 0, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x04);
- set_led_status(space->machine, 1, data & 0x08);
- set_led_status(space->machine, 2, data & 0x10);
- set_led_status(space->machine, 3, data & 0x20); //
+ set_led_status(space->machine(), 1, data & 0x08);
+ set_led_status(space->machine(), 2, data & 0x10);
+ set_led_status(space->machine(), 3, data & 0x20); //
c6 = data;
show_outputs();
@@ -421,7 +421,7 @@ static WRITE8_HANDLER( c6_w )
// 02 hopper motor on (active low)?
static WRITE8_HANDLER( c8_w )
{
- ticket_dispenser_w(space->machine->device("hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80);
+ ticket_dispenser_w(space->machine().device("hopper"), 0, (!(data & 0x02) && (data & 0x01)) ? 0x00 : 0x80);
c8 = data;
show_outputs();
@@ -483,23 +483,23 @@ static WRITE8_HANDLER( animalc_rombank_w )
return;
}
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
switch ( reg )
{
case 0x0f:
rombank = data;
switch (data)
{
- case 0x10: memory_set_bankptr(space->machine, "rombank", rom + 0x400 + 0x4000); break;
- case 0x14: memory_set_bankptr(space->machine, "rombank", rom + 0x400 + 0x8000); break;
- case 0x18: memory_set_bankptr(space->machine, "rombank", rom + 0x400 + 0xc000); break;
+ case 0x10: memory_set_bankptr(space->machine(), "rombank", rom + 0x400 + 0x4000); break;
+ case 0x14: memory_set_bankptr(space->machine(), "rombank", rom + 0x400 + 0x8000); break;
+ case 0x18: memory_set_bankptr(space->machine(), "rombank", rom + 0x400 + 0xc000); break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
default:
- logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data);
+ logerror("%s: unknown reg written: %02x = %02x\n", space->machine().describe_context(), reg, data);
}
}
static READ8_HANDLER( animalc_rombank_r )
@@ -513,7 +513,7 @@ static READ8_HANDLER( animalc_rombank_r )
return rombank;
default:
- logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg);
+ logerror("%s: unknown reg read: %02x\n", space->machine().describe_context(), reg);
return 0x00;
}
}
@@ -540,16 +540,16 @@ static WRITE8_HANDLER( animalc_rambank_w )
case 0x64: bank = 3; break;
case 0x65: bank = 4; break;
default:
- logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine->describe_context(), data, reg2);
+ logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine().describe_context(), data, reg2);
return;
}
- memory_set_bank(space->machine, "rambank", bank);
+ memory_set_bank(space->machine(), "rambank", bank);
if ( (bank == 1) || (bank == 2) || (bank == 3) )
- memory_set_bank(space->machine, "sprbank", bank-1);
+ memory_set_bank(space->machine(), "sprbank", bank-1);
break;
default:
- logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data);
+ logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine().describe_context(), reg2, data);
}
}
static READ8_HANDLER( animalc_rambank_r )
@@ -563,7 +563,7 @@ static READ8_HANDLER( animalc_rambank_r )
return rambank;
default:
- logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2);
+ logerror("%s: unknown reg2 read: %02x\n", space->machine().describe_context(), reg2);
return 0x00;
}
}
@@ -586,7 +586,7 @@ static WRITE8_DEVICE_HANDLER( sammymdl_eeprom_w )
eeprom_set_clock_line(device, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
if (data & 0x8f)
- logerror("%s: unknown eeeprom bits written %02x\n", device->machine->describe_context(), data);
+ logerror("%s: unknown eeeprom bits written %02x\n", device->machine().describe_context(), data);
}
static READ8_HANDLER( unk_34_r )
@@ -624,13 +624,13 @@ static void show_3_outputs()
// Port 31
static WRITE8_HANDLER( sammymdl_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01 ); // coin1 in
- coin_counter_w(space->machine, 1, data & 0x02 ); // coin2 in
- coin_counter_w(space->machine, 2, data & 0x04 ); // medal in
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // coin1 in
+ coin_counter_w(space->machine(), 1, data & 0x02 ); // coin2 in
+ coin_counter_w(space->machine(), 2, data & 0x04 ); // medal in
-// coin_lockout_w(space->machine, 1, (~data) & 0x08 ); // coin2 lockout?
-// coin_lockout_w(space->machine, 0, (~data) & 0x10 ); // coin1 lockout
-// coin_lockout_w(space->machine, 2, (~data) & 0x20 ); // medal lockout?
+// coin_lockout_w(space->machine(), 1, (~data) & 0x08 ); // coin2 lockout?
+// coin_lockout_w(space->machine(), 0, (~data) & 0x10 ); // coin1 lockout
+// coin_lockout_w(space->machine(), 2, (~data) & 0x20 ); // medal lockout?
out[0] = data;
show_3_outputs();
@@ -639,7 +639,7 @@ static WRITE8_HANDLER( sammymdl_coin_w )
// Port 32
static WRITE8_HANDLER( sammymdl_leds_w )
{
- set_led_status(space->machine, 0, data & 0x01); // button
+ set_led_status(space->machine(), 0, data & 0x01); // button
out[1] = data;
show_3_outputs();
@@ -650,7 +650,7 @@ static WRITE8_HANDLER( sammymdl_leds_w )
// 01 hopper motor on (active low)?
static WRITE8_HANDLER( sammymdl_hopper_w )
{
- ticket_dispenser_w(space->machine->device("hopper"), 0, (!(data & 0x01) && (data & 0x02)) ? 0x00 : 0x80);
+ ticket_dispenser_w(space->machine().device("hopper"), 0, (!(data & 0x01) && (data & 0x02)) ? 0x00 : 0x80);
out[2] = data;
show_3_outputs();
@@ -658,9 +658,9 @@ static WRITE8_HANDLER( sammymdl_hopper_w )
static READ8_HANDLER( sammymdl_coin_hopper_r )
{
- UINT8 ret = input_port_read(space->machine, "COIN");
+ UINT8 ret = input_port_read(space->machine(), "COIN");
-// if ( !ticket_dispenser_r(space->machine->device("hopper"), 0) )
+// if ( !ticket_dispenser_r(space->machine().device("hopper"), 0) )
// ret &= ~0x01;
return ret;
@@ -744,12 +744,12 @@ static WRITE8_HANDLER( haekaka_rombank_w )
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
default:
- logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data);
+ logerror("%s: unknown reg written: %02x = %02x\n", space->machine().describe_context(), reg, data);
}
}
static READ8_HANDLER( haekaka_rombank_r )
@@ -763,7 +763,7 @@ static READ8_HANDLER( haekaka_rombank_r )
return rombank;
default:
- logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg);
+ logerror("%s: unknown reg read: %02x\n", space->machine().describe_context(), reg);
return 0x00;
}
}
@@ -787,12 +787,12 @@ static WRITE8_HANDLER( haekaka_rambank_w )
break;
default:
- logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine->describe_context(), data, reg2);
+ logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine().describe_context(), data, reg2);
}
break;
default:
- logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data);
+ logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine().describe_context(), reg2, data);
}
}
static READ8_HANDLER( haekaka_rambank_r )
@@ -806,19 +806,19 @@ static READ8_HANDLER( haekaka_rambank_r )
return rambank;
default:
- logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2);
+ logerror("%s: unknown reg2 read: %02x\n", space->machine().describe_context(), reg2);
return 0x00;
}
}
static READ8_HANDLER( haekaka_vblank_r )
{
- return space->machine->primary_screen->vblank() ? 0 : 0x1c;
+ return space->machine().primary_screen->vblank() ? 0 : 0x1c;
}
static READ8_HANDLER( haekaka_b000_r )
{
- sigmab98_state *state = space->machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = space->machine().driver_data<sigmab98_state>();
switch (rombank)
{
case 0x10: // ROM
@@ -837,7 +837,7 @@ static READ8_HANDLER( haekaka_b000_r )
case 0x1d:
case 0x1e:
case 0x1f:
- return space->machine->region("maincpu")->base()[offset + 0xb400 + 0x1000 * (rombank-0x10)];
+ return space->machine().region("maincpu")->base()[offset + 0xb400 + 0x1000 * (rombank-0x10)];
case 0x65: // SPRITERAM
if (offset < 0x1000)
@@ -845,19 +845,19 @@ static READ8_HANDLER( haekaka_b000_r )
case 0x67: // PALETTERAM + TABLE? + REGS
if (offset < 0x200)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else if (offset == (0xc013-0xb000))
return haekaka_vblank_r(space, offset);
break;
}
- logerror("%s: unknown read from %02x with rombank = %02x\n", space->machine->describe_context(), offset+0xb000, rombank);
+ logerror("%s: unknown read from %02x with rombank = %02x\n", space->machine().describe_context(), offset+0xb000, rombank);
return 0x00;
}
static WRITE8_HANDLER( haekaka_b000_w )
{
- sigmab98_state *state = space->machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = space->machine().driver_data<sigmab98_state>();
switch (rombank)
{
case 0x65: // SPRITERAM
@@ -872,7 +872,7 @@ static WRITE8_HANDLER( haekaka_b000_w )
if (offset < 0x200)
{
paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data);
-// space->machine->generic.paletteram.u8[offset] = data;
+// space->machine().generic.paletteram.u8[offset] = data;
return;
}
else if ((offset >= 0x800) && (offset < 0x880))
@@ -883,20 +883,20 @@ static WRITE8_HANDLER( haekaka_b000_w )
break;
}
- logerror("%s: unknown write to %02x = %02x with rombank = %02x\n", space->machine->describe_context(), offset+0xb000, data, rombank);
+ logerror("%s: unknown write to %02x = %02x with rombank = %02x\n", space->machine().describe_context(), offset+0xb000, data, rombank);
}
static WRITE8_HANDLER( haekaka_leds_w )
{
// All used
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
- set_led_status(space->machine, 4, data & 0x10);
- set_led_status(space->machine, 5, data & 0x20);
- set_led_status(space->machine, 6, data & 0x40);
- set_led_status(space->machine, 7, data & 0x80);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
+ set_led_status(space->machine(), 4, data & 0x10);
+ set_led_status(space->machine(), 5, data & 0x20);
+ set_led_status(space->machine(), 6, data & 0x40);
+ set_led_status(space->machine(), 7, data & 0x80);
out[1] = data;
show_3_outputs();
@@ -904,7 +904,7 @@ static WRITE8_HANDLER( haekaka_leds_w )
static WRITE8_HANDLER( haekaka_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01 ); // medal out
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // medal out
// data & 0x02 ?
// data & 0x04 ?
// data & 0x10 ?
@@ -944,14 +944,14 @@ ADDRESS_MAP_END
// rombank
static WRITE8_HANDLER( itazuram_rombank_w )
{
- sigmab98_state *state = space->machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = space->machine().driver_data<sigmab98_state>();
if (offset == 0)
{
reg = data;
return;
}
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
switch ( reg )
{
case 0x0d:
@@ -959,14 +959,14 @@ static WRITE8_HANDLER( itazuram_rombank_w )
switch (data)
{
case 0x11: // 3800 IS ROM
- memory_set_bankptr(space->machine, "rombank0", rom + 0x4c00);
- memory_set_bankptr(space->machine, "rombank1", rom + 0x5c00);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*4); // scratch
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", rom + 0x4c00);
+ memory_set_bankptr(space->machine(), "rombank1", rom + 0x5c00);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
@@ -975,14 +975,14 @@ static WRITE8_HANDLER( itazuram_rombank_w )
switch (data)
{
case 0x14: // 3800 IS ROM
- memory_set_bankptr(space->machine, "rombank0", rom + 0x8000);
- memory_set_bankptr(space->machine, "rombank1", rom + 0x9000);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*4); // scratch
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", rom + 0x8000);
+ memory_set_bankptr(space->machine(), "rombank1", rom + 0x9000);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
@@ -991,37 +991,37 @@ static WRITE8_HANDLER( itazuram_rombank_w )
switch (data)
{
case 0x0f: // 3800 IS ROM
- memory_set_bankptr(space->machine, "rombank0", rom + 0x3400);
- memory_set_bankptr(space->machine, "rombank1", rom + 0x4400);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*4); // scratch
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", rom + 0x3400);
+ memory_set_bankptr(space->machine(), "rombank1", rom + 0x4400);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
case 0x12: // 3800 IS ROM
- memory_set_bankptr(space->machine, "rombank0", rom + 0x6400);
- memory_set_bankptr(space->machine, "rombank1", rom + 0x7400);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*4); // scratch
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", rom + 0x6400);
+ memory_set_bankptr(space->machine(), "rombank1", rom + 0x7400);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
// used in test mode:
-// case 0x5c: memory_set_bankptr(space->machine, "rombank", rom + 0x400 + 0x0000); break; // 3800 IS RAM! (8000 bytes)
+// case 0x5c: memory_set_bankptr(space->machine(), "rombank", rom + 0x400 + 0x0000); break; // 3800 IS RAM! (8000 bytes)
case 0x5e: // 3800 IS RAM! (1404 bytes)
- memory_set_bankptr(space->machine, "rombank0", state->spriteram + 0x1000*1);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*1);
- memory_set_bankptr(space->machine, "rombank1", state->spriteram + 0x1000*2);
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*2);
+ memory_set_bankptr(space->machine(), "rombank0", state->spriteram + 0x1000*1);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*1);
+ memory_set_bankptr(space->machine(), "rombank1", state->spriteram + 0x1000*2);
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*2);
break;
case 0x6c: // 3800 IS RAM! (1000 bytes) - SPRITERAM
- memory_set_bankptr(space->machine, "rombank0", state->spriteram);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram);
-// memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", state->spriteram);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram);
+// memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
@@ -1030,19 +1030,19 @@ static WRITE8_HANDLER( itazuram_rombank_w )
switch (data)
{
case 0x14: // 3800 IS ROM
- memory_set_bankptr(space->machine, "rombank0", rom + 0x8800);
- memory_set_bankptr(space->machine, "rombank1", rom + 0x9800);
- memory_set_bankptr(space->machine, "sprbank0", state->spriteram + 0x1000*4); // scratch
- memory_set_bankptr(space->machine, "sprbank1", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "rombank0", rom + 0x8800);
+ memory_set_bankptr(space->machine(), "rombank1", rom + 0x9800);
+ memory_set_bankptr(space->machine(), "sprbank0", state->spriteram + 0x1000*4); // scratch
+ memory_set_bankptr(space->machine(), "sprbank1", state->spriteram + 0x1000*4); // scratch
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
default:
- logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data);
+ logerror("%s: unknown reg written: %02x = %02x\n", space->machine().describe_context(), reg, data);
}
}
static READ8_HANDLER( itazuram_rombank_r )
@@ -1060,7 +1060,7 @@ static READ8_HANDLER( itazuram_rombank_r )
return rombank;
default:
- logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg);
+ logerror("%s: unknown reg read: %02x\n", space->machine().describe_context(), reg);
return 0x00;
}
}
@@ -1080,16 +1080,16 @@ static WRITE8_HANDLER( itazuram_rambank_w )
rambank = data;
switch (data)
{
- case 0x52: memory_set_bankptr(space->machine, "palbank", nvram); break;
- case 0x64: memory_set_bankptr(space->machine, "palbank", space->machine->generic.paletteram.u8); break;
+ case 0x52: memory_set_bankptr(space->machine(), "palbank", nvram); break;
+ case 0x64: memory_set_bankptr(space->machine(), "palbank", space->machine().generic.paletteram.u8); break;
default:
- logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine->describe_context(), data, reg2);
+ logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine().describe_context(), data, reg2);
return;
}
break;
default:
- logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data);
+ logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine().describe_context(), reg2, data);
}
}
@@ -1104,7 +1104,7 @@ static READ8_HANDLER( itazuram_rambank_r )
return rambank;
default:
- logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2);
+ logerror("%s: unknown reg2 read: %02x\n", space->machine().describe_context(), reg2);
return 0x00;
}
}
@@ -1114,7 +1114,7 @@ static WRITE8_HANDLER( itazuram_nvram_palette_w )
if (rambank == 0x64)
{
paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data);
-// space->machine->generic.paletteram.u8[offset] = data;
+// space->machine().generic.paletteram.u8[offset] = data;
}
else if (rambank == 0x52)
{
@@ -1122,7 +1122,7 @@ static WRITE8_HANDLER( itazuram_nvram_palette_w )
}
else
{
- logerror("%s: itazuram_nvram_palette_w offset = %03x with unknown bank = %02x\n", space->machine->describe_context(), offset, rambank);
+ logerror("%s: itazuram_nvram_palette_w offset = %03x with unknown bank = %02x\n", space->machine().describe_context(), offset, rambank);
}
}
@@ -1132,16 +1132,16 @@ static WRITE8_HANDLER( itazuram_palette_w )
{
if (offset < 0x200)
paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data);
-// space->machine->generic.paletteram.u8[offset] = data;
+// space->machine().generic.paletteram.u8[offset] = data;
}
else
{
- logerror("%s: itazuram_palette_w offset = %03x with unknown bank = %02x\n", space->machine->describe_context(), offset, rombank);
+ logerror("%s: itazuram_palette_w offset = %03x with unknown bank = %02x\n", space->machine().describe_context(), offset, rombank);
}
}
static READ8_HANDLER( itazuram_palette_r )
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static ADDRESS_MAP_START( itazuram_map, AS_PROGRAM, 8 )
@@ -1227,12 +1227,12 @@ static WRITE8_HANDLER( tdoboon_rombank_w )
break;
default:
- logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine->describe_context(), data, reg);
+ logerror("%s: unknown rom bank = %02x, reg = %02x\n", space->machine().describe_context(), data, reg);
}
break;
default:
- logerror("%s: unknown reg written: %02x = %02x\n", space->machine->describe_context(), reg, data);
+ logerror("%s: unknown reg written: %02x = %02x\n", space->machine().describe_context(), reg, data);
}
}
static READ8_HANDLER( tdoboon_rombank_r )
@@ -1246,7 +1246,7 @@ static READ8_HANDLER( tdoboon_rombank_r )
return rombank;
default:
- logerror("%s: unknown reg read: %02x\n", space->machine->describe_context(), reg);
+ logerror("%s: unknown reg read: %02x\n", space->machine().describe_context(), reg);
return 0x00;
}
}
@@ -1270,12 +1270,12 @@ static WRITE8_HANDLER( tdoboon_rambank_w )
break;
default:
- logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine->describe_context(), data, reg2);
+ logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", space->machine().describe_context(), data, reg2);
}
break;
default:
- logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine->describe_context(), reg2, data);
+ logerror("%s: unknown reg2 written: %02x = %02x\n", space->machine().describe_context(), reg2, data);
}
}
static READ8_HANDLER( tdoboon_rambank_r )
@@ -1289,14 +1289,14 @@ static READ8_HANDLER( tdoboon_rambank_r )
return rambank;
default:
- logerror("%s: unknown reg2 read: %02x\n", space->machine->describe_context(), reg2);
+ logerror("%s: unknown reg2 read: %02x\n", space->machine().describe_context(), reg2);
return 0x00;
}
}
static READ8_HANDLER( tdoboon_c000_r )
{
- sigmab98_state *state = space->machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = space->machine().driver_data<sigmab98_state>();
switch (rombank)
{
case 0x10: // ROM
@@ -1315,7 +1315,7 @@ static READ8_HANDLER( tdoboon_c000_r )
case 0x1d:
case 0x1e:
case 0x1f:
- return space->machine->region("maincpu")->base()[offset + 0xc400 + 0x1000 * (rombank-0x10)];
+ return space->machine().region("maincpu")->base()[offset + 0xc400 + 0x1000 * (rombank-0x10)];
case 0x64: // SPRITERAM
if (offset < 0x1000)
@@ -1324,7 +1324,7 @@ static READ8_HANDLER( tdoboon_c000_r )
case 0x66: // PALETTERAM + TABLE?
if (offset < 0x200)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
break;
case 0x67: // REGS
@@ -1333,13 +1333,13 @@ static READ8_HANDLER( tdoboon_c000_r )
break;
}
- logerror("%s: unknown read from %02x with rombank = %02x\n", space->machine->describe_context(), offset+0xc000, rombank);
+ logerror("%s: unknown read from %02x with rombank = %02x\n", space->machine().describe_context(), offset+0xc000, rombank);
return 0x00;
}
static WRITE8_HANDLER( tdoboon_c000_w )
{
- sigmab98_state *state = space->machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = space->machine().driver_data<sigmab98_state>();
switch (rombank)
{
case 0x64: // SPRITERAM
@@ -1354,7 +1354,7 @@ static WRITE8_HANDLER( tdoboon_c000_w )
if (offset < 0x200)
{
paletteram_xRRRRRGGGGGBBBBB_be_w(space, offset, data);
-// space->machine->generic.paletteram.u8[offset] = data;
+// space->machine().generic.paletteram.u8[offset] = data;
return;
}
else if ((offset >= 0x800) && (offset < 0x880))
@@ -1365,7 +1365,7 @@ static WRITE8_HANDLER( tdoboon_c000_w )
break;
}
- logerror("%s: unknown write to %02x = %02x with rombank = %02x\n", space->machine->describe_context(), offset+0xc000, data, rombank);
+ logerror("%s: unknown write to %02x = %02x with rombank = %02x\n", space->machine().describe_context(), offset+0xc000, data, rombank);
}
static ADDRESS_MAP_START( tdoboon_map, AS_PROGRAM, 8 )
@@ -1599,7 +1599,7 @@ static const eeprom_interface eeprom_interface_93C46_8bit =
static MACHINE_RESET( sammymdl )
{
- cpu_set_reg(machine->device("maincpu"), Z80_PC, 0x400); // code starts at 400 ??? (000 = cart header)
+ cpu_set_reg(machine.device("maincpu"), Z80_PC, 0x400); // code starts at 400 ??? (000 = cart header)
}
static MACHINE_CONFIG_START( sammymdl, sigmab98_state )
@@ -1804,7 +1804,7 @@ ROM_END
static DRIVER_INIT( gegege )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// Protection?
rom[0xbd3] = 0x18;
@@ -1916,7 +1916,7 @@ ROM_END
static DRIVER_INIT( animalc )
{
- sigmab98_state *state = machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = machine.driver_data<sigmab98_state>();
// RAM banks
UINT8 *bankedram = auto_alloc_array(machine, UINT8, 0x1000 * 5);
memory_configure_bank(machine, "rambank", 0, 1, nvram, 0x1000);
@@ -1954,17 +1954,17 @@ ROM_END
static DRIVER_INIT( itazuram )
{
- sigmab98_state *state = machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = machine.driver_data<sigmab98_state>();
// ROM banks
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_set_bankptr(machine, "rombank0", rom + 0x3400);
memory_set_bankptr(machine, "rombank1", rom + 0x4400);
rombank = 0x0f;
// RAM banks
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3000);
- memset(machine->generic.paletteram.u8, 0, 0x3000);
- memory_set_bankptr(machine, "palbank", machine->generic.paletteram.u8);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3000);
+ memset(machine.generic.paletteram.u8, 0, 0x3000);
+ memory_set_bankptr(machine, "palbank", machine.generic.paletteram.u8);
rambank = 0x64;
state->spriteram = auto_alloc_array(machine, UINT8, 0x1000 * 5);
@@ -2070,10 +2070,10 @@ ROM_END
static DRIVER_INIT( haekaka )
{
- sigmab98_state *state = machine->driver_data<sigmab98_state>();
+ sigmab98_state *state = machine.driver_data<sigmab98_state>();
// RAM banks
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- memset(machine->generic.paletteram.u8, 0, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ memset(machine.generic.paletteram.u8, 0, 0x200);
state->spriteram = auto_alloc_array(machine, UINT8, 0x1000);
memset(state->spriteram, 0, 0x1000);
diff --git a/src/mame/drivers/silkroad.c b/src/mame/drivers/silkroad.c
index cbe56fdb979..5359adbc83b 100644
--- a/src/mame/drivers/silkroad.c
+++ b/src/mame/drivers/silkroad.c
@@ -129,8 +129,8 @@ ROM15.BIN MX29F1610, SOP44 Surface Mounted Mask ROM /
static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> (10+16)),pal5bit(space->machine->generic.paletteram.u32[offset] >> (5+16)),pal5bit(space->machine->generic.paletteram.u32[offset] >> (0+16)));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> (10+16)),pal5bit(space->machine().generic.paletteram.u32[offset] >> (5+16)),pal5bit(space->machine().generic.paletteram.u32[offset] >> (0+16)));
}
static WRITE32_DEVICE_HANDLER(silk_6295_bank_w)
@@ -139,7 +139,7 @@ static WRITE32_DEVICE_HANDLER(silk_6295_bank_w)
{
int bank = (data & 0x3000000) >> 24;
if(bank < 3)
- device->machine->device<okim6295_device>("oki1")->set_bank_base(0x40000 * (bank));
+ device->machine().device<okim6295_device>("oki1")->set_bank_base(0x40000 * (bank));
}
}
@@ -147,8 +147,8 @@ static WRITE32_HANDLER(silk_coin_counter_w)
{
if (ACCESSING_BITS_16_23)
{
- coin_counter_w(space->machine, 0, data & 0x10000);
- coin_counter_w(space->machine, 1, data & 0x80000);
+ coin_counter_w(space->machine(), 0, data & 0x10000);
+ coin_counter_w(space->machine(), 1, data & 0x80000);
}
}
@@ -328,7 +328,7 @@ static DRIVER_INIT( silkroad )
verified as correct... problem with the original which the gfx
hardware didn't care about? */
- UINT8 *src = machine->region("gfx1")->base()+0x1000000;
+ UINT8 *src = machine.region("gfx1")->base()+0x1000000;
int len = 0x0200000;
UINT8 *buffer;
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index 21ccafaa03c..598c180f7f8 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -129,9 +129,9 @@ INPUT_PORTS_END
static READ32_HANDLER( simpl156_inputs_read )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
int eep = eeprom_read_bit(state->eeprom);
- UINT32 returndata = input_port_read(space->machine, "IN0") ^ 0xffff0000;
+ UINT32 returndata = input_port_read(space->machine(), "IN0") ^ 0xffff0000;
returndata ^= ((eep << 8));
return returndata;
@@ -139,7 +139,7 @@ static READ32_HANDLER( simpl156_inputs_read )
static READ32_HANDLER( simpl156_palette_r )
{
- return space->machine->generic.paletteram.u16[offset]^0xffff0000;
+ return space->machine().generic.paletteram.u16[offset]^0xffff0000;
}
static WRITE32_HANDLER( simpl156_palette_w )
@@ -150,11 +150,11 @@ static WRITE32_HANDLER( simpl156_palette_w )
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
color = offset;
- dat = space->machine->generic.paletteram.u16[offset] & 0xffff;
- palette_set_color_rgb(space->machine,color,pal5bit(dat >> 0),pal5bit(dat >> 5),pal5bit(dat >> 10));
+ dat = space->machine().generic.paletteram.u16[offset] & 0xffff;
+ palette_set_color_rgb(space->machine(),color,pal5bit(dat >> 0),pal5bit(dat >> 5),pal5bit(dat >> 10));
}
@@ -162,14 +162,14 @@ static READ32_HANDLER( simpl156_system_r )
{
UINT32 returndata;
- returndata = input_port_read(space->machine, "IN1");
+ returndata = input_port_read(space->machine(), "IN1");
return returndata;
}
static WRITE32_HANDLER( simpl156_eeprom_w )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
//int okibank;
//okibank = data & 0x07;
@@ -186,13 +186,13 @@ static WRITE32_HANDLER( simpl156_eeprom_w )
static READ32_HANDLER( simpl156_spriteram_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
return state->spriteram[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( simpl156_spriteram_w )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -202,13 +202,13 @@ static WRITE32_HANDLER( simpl156_spriteram_w )
static READ32_HANDLER( simpl156_mainram_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
return state->mainram[offset]^0xffff0000;
}
static WRITE32_HANDLER( simpl156_mainram_w )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -217,13 +217,13 @@ static WRITE32_HANDLER( simpl156_mainram_w )
static READ32_HANDLER( simpl156_pf1_rowscroll_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
return state->pf1_rowscroll[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( simpl156_pf1_rowscroll_w )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -232,13 +232,13 @@ static WRITE32_HANDLER( simpl156_pf1_rowscroll_w )
static READ32_HANDLER( simpl156_pf2_rowscroll_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
return state->pf2_rowscroll[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( simpl156_pf2_rowscroll_w )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -1033,8 +1033,8 @@ ROM_END
static DRIVER_INIT( simpl156 )
{
- UINT8 *rom = machine->region("okimusic")->base();
- int length = machine->region("okimusic")->bytes();
+ UINT8 *rom = machine.region("okimusic")->base();
+ int length = machine.region("okimusic")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
@@ -1065,7 +1065,7 @@ static DRIVER_INIT( simpl156 )
/* Everything seems more stable if we run the CPU speed x4 and use Idle skips.. maybe it has an internal multipler? */
static READ32_HANDLER( joemacr_speedup_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
if (cpu_get_pc(space->cpu) == 0x284)
device_spin_until_time(space->cpu, attotime::from_usec(400));
return state->systemram[0x18/4];
@@ -1074,13 +1074,13 @@ static READ32_HANDLER( joemacr_speedup_r )
static DRIVER_INIT( joemacr )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201018, 0x020101b, FUNC(joemacr_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201018, 0x020101b, FUNC(joemacr_speedup_r) );
DRIVER_INIT_CALL(simpl156);
}
static READ32_HANDLER( chainrec_speedup_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
if (cpu_get_pc(space->cpu) == 0x2d4)
device_spin_until_time(space->cpu, attotime::from_usec(400));
return state->systemram[0x18/4];
@@ -1088,13 +1088,13 @@ static READ32_HANDLER( chainrec_speedup_r )
static DRIVER_INIT( chainrec )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201018, 0x020101b, FUNC(chainrec_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201018, 0x020101b, FUNC(chainrec_speedup_r) );
DRIVER_INIT_CALL(simpl156);
}
static READ32_HANDLER( prtytime_speedup_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
if (cpu_get_pc(space->cpu) == 0x4f0)
device_spin_until_time(space->cpu, attotime::from_usec(400));
return state->systemram[0xae0/4];
@@ -1102,14 +1102,14 @@ static READ32_HANDLER( prtytime_speedup_r )
static DRIVER_INIT( prtytime )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201ae0, 0x0201ae3, FUNC(prtytime_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201ae0, 0x0201ae3, FUNC(prtytime_speedup_r) );
DRIVER_INIT_CALL(simpl156);
}
static READ32_HANDLER( charlien_speedup_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
if (cpu_get_pc(space->cpu) == 0xc8c8)
device_spin_until_time(space->cpu, attotime::from_usec(400));
return state->systemram[0x10/4];
@@ -1117,13 +1117,13 @@ static READ32_HANDLER( charlien_speedup_r )
static DRIVER_INIT( charlien )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201010, 0x0201013, FUNC(charlien_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201010, 0x0201013, FUNC(charlien_speedup_r) );
DRIVER_INIT_CALL(simpl156);
}
static READ32_HANDLER( osman_speedup_r )
{
- simpl156_state *state = space->machine->driver_data<simpl156_state>();
+ simpl156_state *state = space->machine().driver_data<simpl156_state>();
if (cpu_get_pc(space->cpu) == 0x5974)
device_spin_until_time(space->cpu, attotime::from_usec(400));
return state->systemram[0x10/4];
@@ -1131,7 +1131,7 @@ static READ32_HANDLER( osman_speedup_r )
static DRIVER_INIT( osman )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201010, 0x0201013, FUNC(osman_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0201010, 0x0201013, FUNC(osman_speedup_r) );
DRIVER_INIT_CALL(simpl156);
}
diff --git a/src/mame/drivers/simpsons.c b/src/mame/drivers/simpsons.c
index 114dedebf63..6f5e557f95f 100644
--- a/src/mame/drivers/simpsons.c
+++ b/src/mame/drivers/simpsons.c
@@ -108,13 +108,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( z80_bankswitch_w )
{
- memory_set_bank(space->machine, "bank2", data & 7);
+ memory_set_bank(space->machine(), "bank2", data & 7);
}
#if 0
-static void sound_nmi_callback( running_machine *machine, int param )
+static void sound_nmi_callback( running_machine &machine, int param )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->nmi_enabled) ? CLEAR_LINE : ASSERT_LINE );
state->nmi_enabled = 0;
}
@@ -122,15 +122,15 @@ static void sound_nmi_callback( running_machine *machine, int param )
static TIMER_CALLBACK( nmi_callback )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( z80_arm_nmi_w )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(25), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
+ space->machine().scheduler().timer_set(attotime::from_usec(25), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
}
static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8 )
@@ -227,9 +227,9 @@ INPUT_PORTS_END
***************************************************************************/
-static void simpsons_objdma( running_machine *machine )
+static void simpsons_objdma( running_machine &machine )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
int counter, num_inactive;
UINT16 *src, *dst;
@@ -255,7 +255,7 @@ static void simpsons_objdma( running_machine *machine )
static TIMER_CALLBACK( dmaend_callback )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
if (state->firq_enabled)
device_set_input_line(state->maincpu, KONAMI_FIRQ_LINE, HOLD_LINE);
}
@@ -263,13 +263,13 @@ static TIMER_CALLBACK( dmaend_callback )
static INTERRUPT_GEN( simpsons_irq )
{
- simpsons_state *state = device->machine->driver_data<simpsons_state>();
+ simpsons_state *state = device->machine().driver_data<simpsons_state>();
if (k053246_is_irq_enabled(state->k053246))
{
- simpsons_objdma(device->machine);
+ simpsons_objdma(device->machine());
// 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown
- device->machine->scheduler().timer_set(attotime::from_usec(30), FUNC(dmaend_callback));
+ device->machine().scheduler().timer_set(attotime::from_usec(30), FUNC(dmaend_callback));
}
if (k052109_is_irq_enabled(state->k052109))
diff --git a/src/mame/drivers/skeetsht.c b/src/mame/drivers/skeetsht.c
index 96104527935..792cb915bb2 100644
--- a/src/mame/drivers/skeetsht.c
+++ b/src/mame/drivers/skeetsht.c
@@ -41,10 +41,10 @@ public:
static MACHINE_RESET( skeetsht )
{
- skeetsht_state *state = machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = machine.driver_data<skeetsht_state>();
- state->ay = machine->device("aysnd");
- state->tms = machine->device("tms");
+ state->ay = machine.device("aysnd");
+ state->tms = machine.device("tms");
}
@@ -60,8 +60,8 @@ static VIDEO_START ( skeetsht )
static void skeetsht_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- skeetsht_state *state = screen.machine->driver_data<skeetsht_state>();
- const rgb_t *const pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ skeetsht_state *state = screen.machine().driver_data<skeetsht_state>();
+ const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
UINT16 *vram = &state->tms_vram[(params->rowaddr << 8) & 0x3ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
int coladdr = params->coladdr;
@@ -82,7 +82,7 @@ static READ16_HANDLER( ramdac_r )
if (offset & 8)
offset = (offset & ~8) | 4;
- return tlc34076_r(space->machine->device("tlc34076"), offset);
+ return tlc34076_r(space->machine().device("tlc34076"), offset);
}
static WRITE16_HANDLER( ramdac_w )
@@ -92,7 +92,7 @@ static WRITE16_HANDLER( ramdac_w )
if (offset & 8)
offset = (offset & ~8) | 4;
- tlc34076_w(space->machine->device("tlc34076"), offset, data);
+ tlc34076_w(space->machine().device("tlc34076"), offset, data);
}
@@ -104,13 +104,13 @@ static WRITE16_HANDLER( ramdac_w )
static void skeetsht_tms_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "68hc11", MC68HC11_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "68hc11", MC68HC11_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_HANDLER( tms_w )
{
- skeetsht_state *state = space->machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = space->machine().driver_data<skeetsht_state>();
if ((offset & 1) == 0)
state->lastdataw = data;
@@ -120,7 +120,7 @@ static WRITE8_HANDLER( tms_w )
static READ8_HANDLER( tms_r )
{
- skeetsht_state *state = space->machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = space->machine().driver_data<skeetsht_state>();
if ((offset & 1) == 0)
state->lastdatar = tms34010_host_r(state->tms, offset >> 1);
@@ -137,14 +137,14 @@ static READ8_HANDLER( tms_r )
static READ8_HANDLER( hc11_porta_r )
{
- skeetsht_state *state = space->machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = space->machine().driver_data<skeetsht_state>();
return state->porta_latch;
}
static WRITE8_HANDLER( hc11_porta_w )
{
- skeetsht_state *state = space->machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = space->machine().driver_data<skeetsht_state>();
if (!(data & 0x8) && (state->porta_latch & 8))
state->ay_sel = state->porta_latch & 0x10;
@@ -154,7 +154,7 @@ static WRITE8_HANDLER( hc11_porta_w )
static WRITE8_HANDLER( ay8910_w )
{
- skeetsht_state *state = space->machine->driver_data<skeetsht_state>();
+ skeetsht_state *state = space->machine().driver_data<skeetsht_state>();
if (state->ay_sel)
ay8910_data_w(state->ay, 0, data);
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index e2caed18fd5..c2b5088b885 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -70,7 +70,7 @@ public:
// Set up blit parameters
static WRITE32_HANDLER( skimaxx_blitter_w )
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
UINT32 newdata = COMBINE_DATA( &state->blitter_regs[offset] );
switch (offset)
@@ -102,7 +102,7 @@ static WRITE32_HANDLER( skimaxx_blitter_w )
// A read by the 68030 from this area blits one pixel to the back buffer (at the same offset)
static READ32_HANDLER( skimaxx_blitter_r )
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
UINT32 penaddr = ((state->blitter_src_x >> 8) & 0x1ff) + ((state->blitter_src_y >> 8) << 9);
UINT16 *src = state->blitter_gfx + (penaddr % state->blitter_gfx_len);
UINT32 *dst = state->bg_buffer_back + offset;
@@ -126,9 +126,9 @@ static READ32_HANDLER( skimaxx_blitter_r )
static VIDEO_START( skimaxx )
{
- skimaxx_state *state = machine->driver_data<skimaxx_state>();
- state->blitter_gfx = (UINT16 *) machine->region( "blitter" )->base();
- state->blitter_gfx_len = machine->region( "blitter" )->bytes() / 2;
+ skimaxx_state *state = machine.driver_data<skimaxx_state>();
+ state->blitter_gfx = (UINT16 *) machine.region( "blitter" )->base();
+ state->blitter_gfx_len = machine.region( "blitter" )->bytes() / 2;
state->bg_buffer = auto_alloc_array(machine, UINT32, 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers
state->bg_buffer_back = state->bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0;
@@ -139,7 +139,7 @@ static VIDEO_START( skimaxx )
static SCREEN_UPDATE( skimaxx )
{
-// popmessage("%02x %02x", input_port_read(screen->machine, "X"), input_port_read(screen->machine, "Y") );
+// popmessage("%02x %02x", input_port_read(screen->machine(), "X"), input_port_read(screen->machine(), "Y") );
SCREEN_UPDATE_CALL(tms340x0);
@@ -155,13 +155,13 @@ static SCREEN_UPDATE( skimaxx )
// TODO: Might not be used
static void skimaxx_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
memcpy(shiftreg, &state->fg_buffer[TOWORD(address)], 512 * sizeof(UINT16));
}
static void skimaxx_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
memcpy(&state->fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
}
@@ -174,7 +174,7 @@ static void skimaxx_from_shiftreg(address_space *space, UINT32 address, UINT16 *
static void skimaxx_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- skimaxx_state *state = screen.machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = screen.machine().driver_data<skimaxx_state>();
// TODO: This isn't correct. I just hacked it together quickly so I could see something!
if (params->rowaddr >= 0x220)
@@ -218,12 +218,12 @@ static void skimaxx_scanline_update(screen_device &screen, bitmap_t *bitmap, int
static WRITE32_HANDLER( m68k_tms_w )
{
- tms34010_host_w(space->machine->device("tms"), offset, data);
+ tms34010_host_w(space->machine().device("tms"), offset, data);
}
static READ32_HANDLER( m68k_tms_r )
{
- return tms34010_host_r(space->machine->device("tms"), offset);
+ return tms34010_host_r(space->machine().device("tms"), offset);
}
@@ -244,7 +244,7 @@ static READ32_HANDLER( m68k_tms_r )
static WRITE32_HANDLER( skimaxx_fpga_ctrl_w )
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
UINT32 newdata = COMBINE_DATA( state->fpga_ctrl );
if (ACCESSING_BITS_0_7)
@@ -255,14 +255,14 @@ static WRITE32_HANDLER( skimaxx_fpga_ctrl_w )
state->bg_buffer_back = state->bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * bank_bg_buffer;
state->bg_buffer_front = state->bg_buffer + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * (1 - bank_bg_buffer);
- memory_set_bank(space->machine, "bank1", bank_bg_buffer);
+ memory_set_bank(space->machine(), "bank1", bank_bg_buffer);
}
}
// 0x2000004c: bit 7, bit 0
static READ32_HANDLER( unk_r )
{
- skimaxx_state *state = space->machine->driver_data<skimaxx_state>();
+ skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
return (*state->fpga_ctrl & 0x20) ? 0x80 : 0x00;
}
@@ -281,7 +281,7 @@ static WRITE32_HANDLER( skimaxx_sub_ctrl_w )
// 7e/7f at the start. 3f/7f, related to reads from 1018xxxx
if (ACCESSING_BITS_0_7)
{
- device_t *subcpu = space->machine->device("subcpu");
+ device_t *subcpu = space->machine().device("subcpu");
device_set_input_line(subcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
device_set_input_line(subcpu, INPUT_LINE_HALT, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
@@ -299,7 +299,7 @@ static WRITE32_HANDLER( skimaxx_sub_ctrl_w )
*/
static READ32_HANDLER( skimaxx_analog_r )
{
- return BITSWAP8(input_port_read(space->machine, offset ? "Y" : "X"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(input_port_read(space->machine(), offset ? "Y" : "X"), 0,1,2,3,4,5,6,7);
}
/*************************************
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index e7820859a2d..86043740bc9 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -41,13 +41,13 @@ static void update_interrupts(running_machine *machine)
static TIMER_CALLBACK( irq_gen )
{
- atarigen_scanline_int_gen(machine->device("maincpu"));
+ atarigen_scanline_int_gen(machine.device("maincpu"));
}
static void alpha_row_update(screen_device &screen, int scanline)
{
- skullxbo_state *state = screen.machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = screen.machine().driver_data<skullxbo_state>();
UINT16 *check = &state->alpha[(scanline / 8) * 64 + 42];
/* check for interrupts in the alpha ram */
@@ -56,17 +56,17 @@ static void alpha_row_update(screen_device &screen, int scanline)
{
int width = screen.width();
attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9);
- screen.machine->scheduler().timer_set(period, FUNC(irq_gen));
+ screen.machine().scheduler().timer_set(period, FUNC(irq_gen));
}
/* update the playfield and motion objects */
- skullxbo_scanline_update(screen.machine, scanline);
+ skullxbo_scanline_update(screen.machine(), scanline);
}
static WRITE16_HANDLER( skullxbo_halt_until_hblank_0_w )
{
- atarigen_halt_until_hblank_0(*space->machine->primary_screen);
+ atarigen_halt_until_hblank_0(*space->machine().primary_screen);
}
@@ -78,11 +78,11 @@ static MACHINE_START( skullxbo )
static MACHINE_RESET( skullxbo )
{
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, alpha_row_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, alpha_row_update, 8);
atarijsa_reset();
}
@@ -96,10 +96,10 @@ static MACHINE_RESET( skullxbo )
static READ16_HANDLER( special_port1_r )
{
- skullxbo_state *state = space->machine->driver_data<skullxbo_state>();
- int temp = input_port_read(space->machine, "FF5802");
+ skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
+ int temp = input_port_read(space->machine(), "FF5802");
if (state->cpu_to_sound_ready) temp ^= 0x0040;
- if (atarigen_get_hblank(*space->machine->primary_screen)) temp ^= 0x0010;
+ if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0010;
return temp;
}
@@ -620,7 +620,7 @@ ROM_END
static DRIVER_INIT( skullxbo )
{
atarijsa_init(machine, "FF5802", 0x0080);
- memset(machine->region("gfx1")->base() + 0x170000, 0, 0x20000);
+ memset(machine.region("gfx1")->base() + 0x170000, 0, 0x20000);
}
diff --git a/src/mame/drivers/skyarmy.c b/src/mame/drivers/skyarmy.c
index b1998493b29..3f7e7d0b542 100644
--- a/src/mame/drivers/skyarmy.c
+++ b/src/mame/drivers/skyarmy.c
@@ -45,17 +45,17 @@ public:
static WRITE8_HANDLER( skyarmy_flip_screen_x_w )
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
}
static WRITE8_HANDLER( skyarmy_flip_screen_y_w )
{
- flip_screen_y_set(space->machine, data & 0x01);
+ flip_screen_y_set(space->machine(), data & 0x01);
}
static TILE_GET_INFO( get_skyarmy_tile_info )
{
- skyarmy_state *state = machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = machine.driver_data<skyarmy_state>();
int code = state->videoram[tile_index];
int attr = BITSWAP8(state->colorram[tile_index], 7, 6, 5, 4, 3, 0, 1, 2) & 7;
@@ -64,7 +64,7 @@ static TILE_GET_INFO( get_skyarmy_tile_info )
static WRITE8_HANDLER( skyarmy_videoram_w )
{
- skyarmy_state *state = space->machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = space->machine().driver_data<skyarmy_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
@@ -72,7 +72,7 @@ static WRITE8_HANDLER( skyarmy_videoram_w )
static WRITE8_HANDLER( skyarmy_colorram_w )
{
- skyarmy_state *state = space->machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = space->machine().driver_data<skyarmy_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
@@ -108,7 +108,7 @@ static PALETTE_INIT( skyarmy )
static VIDEO_START( skyarmy )
{
- skyarmy_state *state = machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = machine.driver_data<skyarmy_state>();
state->tilemap = tilemap_create(machine, get_skyarmy_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->tilemap,32);
@@ -117,7 +117,7 @@ static VIDEO_START( skyarmy )
static SCREEN_UPDATE( skyarmy )
{
- skyarmy_state *state = screen->machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = screen->machine().driver_data<skyarmy_state>();
UINT8 *spriteram = state->spriteram;
int sx, sy, flipx, flipy, offs,pal;
int i;
@@ -136,7 +136,7 @@ static SCREEN_UPDATE( skyarmy )
flipy = (spriteram[offs+1]&0x80)>>7;
flipx = (spriteram[offs+1]&0x40)>>6;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
spriteram[offs+1]&0x3f,
pal,
flipx,flipy,
@@ -148,7 +148,7 @@ static SCREEN_UPDATE( skyarmy )
static INTERRUPT_GEN( skyarmy_nmi_source )
{
- skyarmy_state *state = device->machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = device->machine().driver_data<skyarmy_state>();
if(state->nmi) device_set_input_line(device,INPUT_LINE_NMI, PULSE_LINE);
}
@@ -156,7 +156,7 @@ static INTERRUPT_GEN( skyarmy_nmi_source )
static WRITE8_HANDLER( nmi_enable_w )
{
- skyarmy_state *state = space->machine->driver_data<skyarmy_state>();
+ skyarmy_state *state = space->machine().driver_data<skyarmy_state>();
state->nmi=data & 1;
}
diff --git a/src/mame/drivers/skydiver.c b/src/mame/drivers/skydiver.c
index b63ebcec634..cf25e1f9d2b 100644
--- a/src/mame/drivers/skydiver.c
+++ b/src/mame/drivers/skydiver.c
@@ -140,15 +140,15 @@ static PALETTE_INIT( skydiver )
static WRITE8_HANDLER( skydiver_nmion_w )
{
- skydiver_state *state = space->machine->driver_data<skydiver_state>();
+ skydiver_state *state = space->machine().driver_data<skydiver_state>();
state->nmion = offset;
}
static INTERRUPT_GEN( skydiver_interrupt )
{
- skydiver_state *state = device->machine->driver_data<skydiver_state>();
- device_t *discrete = device->machine->device("discrete");
+ skydiver_state *state = device->machine().driver_data<skydiver_state>();
+ device_t *discrete = device->machine().device("discrete");
/* Convert range data to divide value and write to sound */
discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~state->videoram[0x394] & 0x07)) & 0xff); // Range 0-2
diff --git a/src/mame/drivers/skyfox.c b/src/mame/drivers/skyfox.c
index 214f9e9a3e5..a5148dce6eb 100644
--- a/src/mame/drivers/skyfox.c
+++ b/src/mame/drivers/skyfox.c
@@ -84,7 +84,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted )
{
- skyfox_state *state = field->port->machine->driver_data<skyfox_state>();
+ skyfox_state *state = field->port->machine().driver_data<skyfox_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -214,7 +214,7 @@ GFXDECODE_END
static INTERRUPT_GEN( skyfox_interrupt )
{
- skyfox_state *state = device->machine->driver_data<skyfox_state>();
+ skyfox_state *state = device->machine().driver_data<skyfox_state>();
/* Scroll the bg */
state->bg_pos += (state->bg_ctrl >> 1) & 0x7; // maybe..
@@ -222,9 +222,9 @@ static INTERRUPT_GEN( skyfox_interrupt )
static MACHINE_START( skyfox )
{
- skyfox_state *state = machine->driver_data<skyfox_state>();
+ skyfox_state *state = machine.driver_data<skyfox_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->bg_pos));
state->save_item(NAME(state->bg_ctrl));
@@ -232,7 +232,7 @@ static MACHINE_START( skyfox )
static MACHINE_RESET( skyfox )
{
- skyfox_state *state = machine->driver_data<skyfox_state>();
+ skyfox_state *state = machine.driver_data<skyfox_state>();
state->bg_pos = 0;
state->bg_ctrl = 0;
@@ -434,8 +434,8 @@ ROM_END
/* Untangle the graphics: cut each 32x32x8 tile in 16 8x8x8 tiles */
static DRIVER_INIT( skyfox )
{
- UINT8 *RAM = machine->region("gfx1")->base();
- UINT8 *end = RAM + machine->region("gfx1")->bytes();
+ UINT8 *RAM = machine.region("gfx1")->base();
+ UINT8 *end = RAM + machine.region("gfx1")->bytes();
UINT8 buf[32 * 32];
while (RAM < end)
diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c
index 5e73b3f175c..e8f6e9f431a 100644
--- a/src/mame/drivers/skykid.c
+++ b/src/mame/drivers/skykid.c
@@ -22,36 +22,36 @@ Notes:
static WRITE8_HANDLER( inputport_select_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
if ((data & 0xe0) == 0x60)
state->inputport_selected = data & 0x07;
else if ((data & 0xe0) == 0xc0)
{
- coin_lockout_global_w(space->machine, ~data & 1);
- coin_counter_w(space->machine, 0,data & 2);
- coin_counter_w(space->machine, 1,data & 4);
+ coin_lockout_global_w(space->machine(), ~data & 1);
+ coin_counter_w(space->machine(), 0,data & 2);
+ coin_counter_w(space->machine(), 1,data & 4);
}
}
static READ8_HANDLER( inputport_r )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
switch (state->inputport_selected)
{
case 0x00: /* DSW B (bits 0-4) */
- return (input_port_read(space->machine, "DSWB") & 0xf8) >> 3;
+ return (input_port_read(space->machine(), "DSWB") & 0xf8) >> 3;
case 0x01: /* DSW B (bits 5-7), DSW A (bits 0-1) */
- return ((input_port_read(space->machine, "DSWB") & 0x07) << 2) | ((input_port_read(space->machine, "DSWA") & 0xc0) >> 6);
+ return ((input_port_read(space->machine(), "DSWB") & 0x07) << 2) | ((input_port_read(space->machine(), "DSWA") & 0xc0) >> 6);
case 0x02: /* DSW A (bits 2-6) */
- return (input_port_read(space->machine, "DSWA") & 0x3e) >> 1;
+ return (input_port_read(space->machine(), "DSWA") & 0x3e) >> 1;
case 0x03: /* DSW A (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(space->machine, "DSWA") & 0x01) << 4) | (input_port_read(space->machine, "BUTTON2") & 0x0f);
+ return ((input_port_read(space->machine(), "DSWA") & 0x01) << 4) | (input_port_read(space->machine(), "BUTTON2") & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x05: /* 2P controls */
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
case 0x06: /* 1P controls */
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
default:
return 0xff;
}
@@ -59,42 +59,42 @@ static READ8_HANDLER( inputport_r )
static WRITE8_HANDLER( skykid_led_w )
{
- set_led_status(space->machine, 0,data & 0x08);
- set_led_status(space->machine, 1,data & 0x10);
+ set_led_status(space->machine(), 0,data & 0x08);
+ set_led_status(space->machine(), 1,data & 0x10);
}
static WRITE8_HANDLER( skykid_subreset_w )
{
int bit = !BIT(offset,11);
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( skykid_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", !BIT(offset,11));
+ memory_set_bank(space->machine(), "bank1", !BIT(offset,11));
}
static WRITE8_HANDLER( skykid_irq_1_ctrl_w )
{
int bit = !BIT(offset,11);
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( skykid_irq_2_ctrl_w )
{
int bit = !BIT(offset,13);
- cpu_interrupt_enable(space->machine->device("mcu"), bit);
+ cpu_interrupt_enable(space->machine().device("mcu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
}
static MACHINE_START( skykid )
{
- skykid_state *state = machine->driver_data<skykid_state>();
+ skykid_state *state = machine.driver_data<skykid_state>();
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
state_save_register_global(machine, state->inputport_selected);
}
@@ -625,7 +625,7 @@ static DRIVER_INIT( skykid )
int i;
/* unpack the third sprite ROM */
- rom = machine->region("gfx3")->base() + 0x4000;
+ rom = machine.region("gfx3")->base() + 0x4000;
for (i = 0;i < 0x2000;i++)
{
rom[i + 0x4000] = rom[i]; // sprite set #1, plane 3
diff --git a/src/mame/drivers/skylncr.c b/src/mame/drivers/skylncr.c
index fe4f3e45022..45bf032ef72 100644
--- a/src/mame/drivers/skylncr.c
+++ b/src/mame/drivers/skylncr.c
@@ -76,14 +76,14 @@ public:
static WRITE8_HANDLER( skylncr_videoram_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset);
}
static WRITE8_HANDLER( skylncr_colorram_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset);
}
@@ -91,35 +91,35 @@ static WRITE8_HANDLER( skylncr_colorram_w )
static TILE_GET_INFO( get_tile_info )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
UINT16 code = state->videoram[ tile_index ] + (state->colorram[ tile_index ] << 8);
SET_TILE_INFO(0, code, 0, TILE_FLIPYX( 0 ));
}
static TILE_GET_INFO( get_reel_1_tile_info )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
UINT16 code = state->reeltiles_1_ram[ tile_index ] + (state->reeltileshigh_1_ram[ tile_index ] << 8);
SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
}
static TILE_GET_INFO( get_reel_2_tile_info )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
UINT16 code = state->reeltiles_2_ram[ tile_index ] + (state->reeltileshigh_2_ram[ tile_index ] << 8);
SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
}
static TILE_GET_INFO( get_reel_3_tile_info )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
UINT16 code = state->reeltiles_3_ram[ tile_index ] + (state->reeltileshigh_3_ram[ tile_index ] << 8);
SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
}
static TILE_GET_INFO( get_reel_4_tile_info )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
UINT16 code = state->reeltiles_4_ram[ tile_index ] + (state->reeltileshigh_4_ram[ tile_index ] << 8);
SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
}
@@ -127,7 +127,7 @@ static TILE_GET_INFO( get_reel_4_tile_info )
static VIDEO_START( skylncr )
{
- skylncr_state *state = machine->driver_data<skylncr_state>();
+ skylncr_state *state = machine.driver_data<skylncr_state>();
state->tmap = tilemap_create( machine, get_tile_info, tilemap_scan_rows, 8, 8, 0x40, 0x20 );
@@ -156,7 +156,7 @@ static const rectangle visible3 = { 0*8, (20+48)*8-1, 20*8, (20+7)*8-1 };
static SCREEN_UPDATE( skylncr )
{
- skylncr_state *state = screen->machine->driver_data<skylncr_state>();
+ skylncr_state *state = screen->machine().driver_data<skylncr_state>();
int i;
bitmap_fill(bitmap,cliprect,0);
@@ -180,56 +180,56 @@ static SCREEN_UPDATE( skylncr )
static WRITE8_HANDLER( reeltiles_1_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltiles_1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_1_tilemap, offset);
}
static WRITE8_HANDLER( reeltiles_2_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltiles_2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_2_tilemap, offset);
}
static WRITE8_HANDLER( reeltiles_3_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltiles_3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_3_tilemap, offset);
}
static WRITE8_HANDLER( reeltiles_4_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltiles_4_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_4_tilemap, offset);
}
static WRITE8_HANDLER( reeltileshigh_1_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltileshigh_1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_1_tilemap, offset);
}
static WRITE8_HANDLER( reeltileshigh_2_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltileshigh_2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_2_tilemap, offset);
}
static WRITE8_HANDLER( reeltileshigh_3_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltileshigh_3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_3_tilemap, offset);
}
static WRITE8_HANDLER( reeltileshigh_4_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reeltileshigh_4_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel_4_tilemap, offset);
}
@@ -237,7 +237,7 @@ static WRITE8_HANDLER( reeltileshigh_4_w )
static WRITE8_HANDLER( skylncr_paletteram_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
if (offset == 0)
{
@@ -246,23 +246,23 @@ static WRITE8_HANDLER( skylncr_paletteram_w )
else
{
int r,g,b;
- space->machine->generic.paletteram.u8[state->color] = data;
+ space->machine().generic.paletteram.u8[state->color] = data;
- r = space->machine->generic.paletteram.u8[(state->color/3 * 3) + 0];
- g = space->machine->generic.paletteram.u8[(state->color/3 * 3) + 1];
- b = space->machine->generic.paletteram.u8[(state->color/3 * 3) + 2];
+ r = space->machine().generic.paletteram.u8[(state->color/3 * 3) + 0];
+ g = space->machine().generic.paletteram.u8[(state->color/3 * 3) + 1];
+ b = space->machine().generic.paletteram.u8[(state->color/3 * 3) + 2];
r = (r << 2) | (r >> 4);
g = (g << 2) | (g >> 4);
b = (b << 2) | (b >> 4);
- palette_set_color(space->machine, state->color / 3, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), state->color / 3, MAKE_RGB(r, g, b));
state->color = (state->color + 1) % (0x100 * 3);
}
}
static WRITE8_HANDLER( skylncr_paletteram2_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
if (offset == 0)
{
@@ -271,41 +271,41 @@ static WRITE8_HANDLER( skylncr_paletteram2_w )
else
{
int r,g,b;
- space->machine->generic.paletteram2.u8[state->color2] = data;
+ space->machine().generic.paletteram2.u8[state->color2] = data;
- r = space->machine->generic.paletteram2.u8[(state->color2/3 * 3) + 0];
- g = space->machine->generic.paletteram2.u8[(state->color2/3 * 3) + 1];
- b = space->machine->generic.paletteram2.u8[(state->color2/3 * 3) + 2];
+ r = space->machine().generic.paletteram2.u8[(state->color2/3 * 3) + 0];
+ g = space->machine().generic.paletteram2.u8[(state->color2/3 * 3) + 1];
+ b = space->machine().generic.paletteram2.u8[(state->color2/3 * 3) + 2];
r = (r << 2) | (r >> 4);
g = (g << 2) | (g >> 4);
b = (b << 2) | (b >> 4);
- palette_set_color(space->machine, 0x100 + state->color2 / 3, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), 0x100 + state->color2 / 3, MAKE_RGB(r, g, b));
state->color2 = (state->color2 + 1) % (0x100 * 3);
}
}
static WRITE8_HANDLER( reelscroll1_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reelscroll1[offset] = data;
}
static WRITE8_HANDLER( reelscroll2_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reelscroll2[offset] = data;
}
static WRITE8_HANDLER( reelscroll3_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reelscroll3[offset] = data;
}
static WRITE8_HANDLER( reelscroll4_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->reelscroll4[offset] = data;
}
@@ -316,7 +316,7 @@ static WRITE8_HANDLER( reelscroll4_w )
static WRITE8_HANDLER( skylncr_coin_w )
{
- coin_counter_w( space->machine, 0, data & 0x04 );
+ coin_counter_w( space->machine(), 0, data & 0x04 );
}
static READ8_HANDLER( ret_ff )
@@ -333,7 +333,7 @@ static READ8_HANDLER( ret_00 )
static WRITE8_HANDLER( skylncr_nmi_enable_w )
{
- skylncr_state *state = space->machine->driver_data<skylncr_state>();
+ skylncr_state *state = space->machine().driver_data<skylncr_state>();
state->nmi_enable = data & 0x10;
}
@@ -679,7 +679,7 @@ static const ay8910_interface ay8910_config =
// It runs in IM 0, thus needs an opcode on the data bus
static INTERRUPT_GEN( skylncr_vblank_interrupt )
{
- skylncr_state *state = device->machine->driver_data<skylncr_state>();
+ skylncr_state *state = device->machine().driver_data<skylncr_state>();
if (state->nmi_enable) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -856,8 +856,8 @@ ROM_END
static DRIVER_INIT( skylncr )
{
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x100 * 3);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x100 * 3);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x100 * 3);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x100 * 3);
}
diff --git a/src/mame/drivers/skyraid.c b/src/mame/drivers/skyraid.c
index 96452a46dde..73c26fdf5fb 100644
--- a/src/mame/drivers/skyraid.c
+++ b/src/mame/drivers/skyraid.c
@@ -36,12 +36,12 @@ static PALETTE_INIT( skyraid )
static READ8_HANDLER( skyraid_port_0_r )
{
- skyraid_state *state = space->machine->driver_data<skyraid_state>();
- UINT8 val = input_port_read(space->machine, "LANGUAGE");
+ skyraid_state *state = space->machine().driver_data<skyraid_state>();
+ UINT8 val = input_port_read(space->machine(), "LANGUAGE");
- if (input_port_read(space->machine, "STICKY") > state->analog_range)
+ if (input_port_read(space->machine(), "STICKY") > state->analog_range)
val |= 0x40;
- if (input_port_read(space->machine, "STICKX") > state->analog_range)
+ if (input_port_read(space->machine(), "STICKX") > state->analog_range)
val |= 0x80;
return val;
@@ -50,7 +50,7 @@ static READ8_HANDLER( skyraid_port_0_r )
static WRITE8_HANDLER( skyraid_range_w )
{
- skyraid_state *state = space->machine->driver_data<skyraid_state>();
+ skyraid_state *state = space->machine().driver_data<skyraid_state>();
state->analog_range = data & 0x3f;
}
@@ -58,7 +58,7 @@ static WRITE8_HANDLER( skyraid_range_w )
static WRITE8_HANDLER( skyraid_offset_w )
{
- skyraid_state *state = space->machine->driver_data<skyraid_state>();
+ skyraid_state *state = space->machine().driver_data<skyraid_state>();
state->analog_offset = data & 0x3f;
}
@@ -66,7 +66,7 @@ static WRITE8_HANDLER( skyraid_offset_w )
static WRITE8_HANDLER( skyraid_scroll_w )
{
- skyraid_state *state = space->machine->driver_data<skyraid_state>();
+ skyraid_state *state = space->machine().driver_data<skyraid_state>();
state->scroll = data;
}
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index 62ef35bbab0..a517f7a7e41 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -737,7 +737,7 @@ static const ay8910_interface ay8910_interface_2 =
static SCREEN_EOF( perfrman )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
@@ -1742,12 +1742,12 @@ ROM_END
static DRIVER_INIT( tigerh )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(tigerh_mcu_r), FUNC(tigerh_mcu_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(tigerh_mcu_r), FUNC(tigerh_mcu_w) );
}
static DRIVER_INIT( tigerhb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(tigerhb_e803_r), FUNC(tigerhb_e803_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(tigerhb_e803_r), FUNC(tigerhb_e803_w) );
}
@@ -1805,36 +1805,36 @@ static READ8_HANDLER( gtstarb1_port_0_read )
return 0;
}
-static void getstar_init( running_machine *machine )
+static void getstar_init( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(getstar_e803_r), FUNC(getstar_e803_w) );
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(slapfight_port_00_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(getstar_e803_r), FUNC(getstar_e803_w) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(slapfight_port_00_r) );
}
static DRIVER_INIT( getstar )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
state->getstar_id = GETSTAR;
getstar_init(machine);
}
static DRIVER_INIT( getstarj )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
state->getstar_id = GETSTARJ;
getstar_init(machine);
}
static DRIVER_INIT( gtstarb1 )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
state->getstar_id = GTSTARB1;
getstar_init(machine);
/* specific handlers for this bootleg */
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0, 0x0, FUNC(gtstarb1_port_0_read) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0, 0x0, FUNC(gtstarb1_port_0_read) );
/* requires this or it gets stuck with 'rom test' on screen */
/* it is possible the program roms are slighly corrupt like the gfx roms, or
that the bootleg simply shouldn't execute the code due to the modified roms */
@@ -1844,20 +1844,20 @@ static DRIVER_INIT( gtstarb1 )
static DRIVER_INIT( gtstarb2 )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
state->getstar_id = GTSTARB2;
getstar_init(machine);
}
static DRIVER_INIT( slapfigh )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(slapfight_mcu_r), FUNC(slapfight_mcu_w) );
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(slapfight_mcu_status_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe803, 0xe803, FUNC(slapfight_mcu_r), FUNC(slapfight_mcu_w) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(slapfight_mcu_status_r) );
}
static DRIVER_INIT( perfrman )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(perfrman_port_00_r) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(perfrman_port_00_r) );
}
/* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME FLAGS ) */
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index 49f14400998..0dd696c5e4c 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -148,13 +148,13 @@ Region byte at offset 0x031:
static READ16_HANDLER( color_ram_word_r )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
return state->color_ram[offset];
}
static WRITE16_HANDLER( color_ram_word_w )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
int r,g,b;
COMBINE_DATA(&state->color_ram[offset]);
@@ -164,7 +164,7 @@ static WRITE16_HANDLER( color_ram_word_w )
g = (state->color_ram[offset] & 0xff00) >> 8;
b = (state->color_ram[offset] & 0xff);
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r,g,b));
}
}
@@ -175,14 +175,14 @@ static WRITE16_HANDLER( color_ram_word_w )
static TIMER_CALLBACK( slapshot_interrupt6 )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
static INTERRUPT_GEN( slapshot_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(slapshot_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(slapshot_interrupt6));
device_set_input_line(device, 5, HOLD_LINE);
}
@@ -193,12 +193,12 @@ static INTERRUPT_GEN( slapshot_interrupt )
static READ16_HANDLER( slapshot_service_input_r )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
switch (offset)
{
case 0x03:
- return ((input_port_read(space->machine, "SYSTEM") & 0xef) |
- (input_port_read(space->machine, "SERVICE") & 0x10)) << 8; /* IN3 + service switch */
+ return ((input_port_read(space->machine(), "SYSTEM") & 0xef) |
+ (input_port_read(space->machine(), "SERVICE") & 0x10)) << 8; /* IN3 + service switch */
default:
return tc0640fio_r(state->tc0640fio, offset) << 8;
@@ -210,7 +210,7 @@ static READ16_HANDLER( opwolf3_adc_r )
{
static const char *const adcnames[] = { "GUN1X", "GUN1Y", "GUN2X", "GUN2Y" };
- return input_port_read(space->machine, adcnames[offset]) << 8;
+ return input_port_read(space->machine(), adcnames[offset]) << 8;
}
static WRITE16_HANDLER( opwolf3_adc_req_w )
@@ -233,7 +233,7 @@ static WRITE16_HANDLER( opwolf3_adc_req_w )
output_set_value("Player2_Gun_Recoil",0);
break;
}
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
/* 4 writes a frame - one for each analogue port */
device_set_input_line(state->maincpu, 3, HOLD_LINE);
@@ -243,17 +243,17 @@ static WRITE16_HANDLER( opwolf3_adc_req_w )
SOUND
*****************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
@@ -263,7 +263,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
static WRITE16_HANDLER( slapshot_msb_sound_w )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, (data >> 8) & 0xff);
else if (offset == 1)
@@ -277,7 +277,7 @@ static WRITE16_HANDLER( slapshot_msb_sound_w )
static READ16_HANDLER( slapshot_msb_sound_r )
{
- slapshot_state *state = space->machine->driver_data<slapshot_state>();
+ slapshot_state *state = space->machine().driver_data<slapshot_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff) << 8);
else
@@ -492,7 +492,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- slapshot_state *state = device->machine->driver_data<slapshot_state>();
+ slapshot_state *state = device->machine().driver_data<slapshot_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -534,20 +534,20 @@ static STATE_POSTLOAD( slapshot_postload )
static MACHINE_START( slapshot )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->tc0140syt = machine->device("tc0140syt");
- state->tc0480scp = machine->device("tc0480scp");
- state->tc0360pri = machine->device("tc0360pri");
- state->tc0640fio = machine->device("tc0640fio");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->tc0140syt = machine.device("tc0140syt");
+ state->tc0480scp = machine.device("tc0480scp");
+ state->tc0360pri = machine.device("tc0360pri");
+ state->tc0640fio = machine.device("tc0640fio");
state->banknum = 0;
state->save_item(NAME(state->banknum));
- machine->state().register_postload(slapshot_postload, NULL);
+ machine.state().register_postload(slapshot_postload, NULL);
}
@@ -744,8 +744,8 @@ ROM_END
static DRIVER_INIT( slapshot )
{
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx2")->base();
- int size = machine->region("gfx2")->bytes();
+ UINT8 *gfx = machine.region("gfx2")->base();
+ int size = machine.region("gfx2")->bytes();
int data;
offset = size / 2;
diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c
index f4476e7c0ef..79edad7ed6b 100644
--- a/src/mame/drivers/sliver.c
+++ b/src/mame/drivers/sliver.c
@@ -187,14 +187,14 @@ static const int gfxlookup[][4]=
static WRITE16_HANDLER( sliver_RAMDAC_offset_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
state->clr_offset=data*3;
}
static WRITE16_HANDLER( sliver_RAMDAC_color_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
state->colorram[state->clr_offset]=data;
state->clr_offset=(state->clr_offset+1)%768;
@@ -221,9 +221,9 @@ static void plot_pixel_rgb(sliver_state *state, int x, int y, UINT32 r, UINT32 g
}
}
-static void plot_pixel_pal(running_machine *machine, int x, int y, int addr)
+static void plot_pixel_pal(running_machine &machine, int x, int y, int addr)
{
- sliver_state *state = machine->driver_data<sliver_state>();
+ sliver_state *state = machine.driver_data<sliver_state>();
UINT32 r,g,b;
UINT16 color;
@@ -253,7 +253,7 @@ static void plot_pixel_pal(running_machine *machine, int x, int y, int addr)
static WRITE16_HANDLER( fifo_data_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
if (state->tmp_counter < 8)
{
@@ -274,11 +274,11 @@ static WRITE16_HANDLER( fifo_data_w )
}
}
-static void blit_gfx(running_machine *machine)
+static void blit_gfx(running_machine &machine)
{
- sliver_state *state = machine->driver_data<sliver_state>();
+ sliver_state *state = machine.driver_data<sliver_state>();
int tmpptr=0;
- const UINT8 *rom = machine->region("user1")->base();
+ const UINT8 *rom = machine.region("user1")->base();
while (tmpptr < state->fptr)
{
@@ -310,7 +310,7 @@ static void blit_gfx(running_machine *machine)
static WRITE16_HANDLER( fifo_clear_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
bitmap_fill(state->bitmap_fg, 0,0);
state->fptr=0;
@@ -319,20 +319,20 @@ static WRITE16_HANDLER( fifo_clear_w )
static WRITE16_HANDLER( fifo_flush_w )
{
- blit_gfx(space->machine);
+ blit_gfx(space->machine());
}
static WRITE16_HANDLER( jpeg1_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
COMBINE_DATA(&state->jpeg1);
}
-static void render_jpeg(running_machine *machine)
+static void render_jpeg(running_machine &machine)
{
- sliver_state *state = machine->driver_data<sliver_state>();
+ sliver_state *state = machine.driver_data<sliver_state>();
int x, y;
int addr = state->jpeg_addr;
UINT8 *rom;
@@ -343,7 +343,7 @@ static void render_jpeg(running_machine *machine)
return;
}
- rom = machine->region("user3")->base();
+ rom = machine.region("user3")->base();
for (y = 0; y < state->jpeg_h; y++)
{
for (x = 0; x < state->jpeg_w; x++)
@@ -370,7 +370,7 @@ static int find_data(int offset)
static WRITE16_HANDLER( jpeg2_w )
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
int idx;
COMBINE_DATA(&state->jpeg2);
@@ -381,7 +381,7 @@ static WRITE16_HANDLER( jpeg2_w )
state->jpeg_addr = gfxlookup[idx][0];
state->jpeg_w = gfxlookup[idx][2];
state->jpeg_h = gfxlookup[idx][3];
- render_jpeg(space->machine);
+ render_jpeg(space->machine());
}
else
{
@@ -391,14 +391,14 @@ static WRITE16_HANDLER( jpeg2_w )
static WRITE16_HANDLER(io_offset_w)
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
COMBINE_DATA(&state->io_offset);
}
static WRITE16_HANDLER(io_data_w)
{
- sliver_state *state = space->machine->driver_data<sliver_state>();
+ sliver_state *state = space->machine().driver_data<sliver_state>();
if (state->io_offset < IO_SIZE)
{
@@ -412,7 +412,7 @@ static WRITE16_HANDLER(io_data_w)
{
state->jpeg_x = tmpx;
state->jpeg_y = tmpy;
- render_jpeg(space->machine);
+ render_jpeg(space->machine());
}
}
else
@@ -424,7 +424,7 @@ static WRITE16_HANDLER(io_data_w)
static WRITE16_HANDLER(sound_w)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", MCS51_INT0_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", MCS51_INT0_LINE, HOLD_LINE);
}
static ADDRESS_MAP_START( sliver_map, AS_PROGRAM, 16 )
@@ -459,7 +459,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(oki_setbank)
{
- UINT8 *sound = space->machine->region("oki")->base();
+ UINT8 *sound = space->machine().region("oki")->base();
int bank=(data^0xff)&3; //xor or not ?
memcpy(sound+0x20000, sound+0x100000+0x20000*bank, 0x20000);
}
@@ -477,15 +477,15 @@ ADDRESS_MAP_END
static VIDEO_START(sliver)
{
- sliver_state *state = machine->driver_data<sliver_state>();
+ sliver_state *state = machine.driver_data<sliver_state>();
- state->bitmap_bg = machine->primary_screen->alloc_compatible_bitmap();
- state->bitmap_fg = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap_bg = machine.primary_screen->alloc_compatible_bitmap();
+ state->bitmap_fg = machine.primary_screen->alloc_compatible_bitmap();
}
static SCREEN_UPDATE(sliver)
{
- sliver_state *state = screen->machine->driver_data<sliver_state>();
+ sliver_state *state = screen->machine().driver_data<sliver_state>();
copybitmap (bitmap, state->bitmap_bg, 0, 0, 0, 0, cliprect);
copybitmap_trans(bitmap, state->bitmap_fg, 0, 0, 0, 0, cliprect, 0);
@@ -625,7 +625,7 @@ ROM_END
static DRIVER_INIT(sliver)
{
- sliver_state *state = machine->driver_data<sliver_state>();
+ sliver_state *state = machine.driver_data<sliver_state>();
state->jpeg_addr = -1;
state->colorram=auto_alloc_array(machine, UINT8, 256*3);
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 7a939968a63..06fee0e4b39 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -56,7 +56,7 @@ public:
static READ8_HANDLER( palette_r )
{
- slotcarn_state *state = space->machine->driver_data<slotcarn_state>();
+ slotcarn_state *state = space->machine().driver_data<slotcarn_state>();
int co;
co = ((state->ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
@@ -65,10 +65,10 @@ static READ8_HANDLER( palette_r )
static WRITE8_HANDLER( palette_w )
{
- slotcarn_state *state = space->machine->driver_data<slotcarn_state>();
+ slotcarn_state *state = space->machine().driver_data<slotcarn_state>();
int co;
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
data &= 0x0f;
co = ((state->ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
@@ -79,7 +79,7 @@ static WRITE8_HANDLER( palette_w )
static MC6845_BEGIN_UPDATE( begin_update )
{
- slotcarn_state *state = device->machine->driver_data<slotcarn_state>();
+ slotcarn_state *state = device->machine().driver_data<slotcarn_state>();
int i;
int dim, bit0, bit1, bit2;
@@ -98,7 +98,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- slotcarn_state *state = device->machine->driver_data<slotcarn_state>();
+ slotcarn_state *state = device->machine().driver_data<slotcarn_state>();
int extra_video_bank_bit = 0; // not used?
int lscnblk = 0; // not used?
@@ -109,9 +109,9 @@ static MC6845_UPDATE_ROW( update_row )
UINT16 x = 0;
int rlen;
- gfx[0] = device->machine->region("gfx1")->base();
- gfx[1] = device->machine->region("gfx2")->base();
- rlen = device->machine->region("gfx2")->bytes();
+ gfx[0] = device->machine().region("gfx1")->base();
+ gfx[1] = device->machine().region("gfx2")->base();
+ rlen = device->machine().region("gfx2")->bytes();
//ma = ma ^ 0x7ff;
for (cx = 0; cx < x_count; cx++)
@@ -152,12 +152,12 @@ static MC6845_UPDATE_ROW( update_row )
static WRITE_LINE_DEVICE_HANDLER(hsync_changed)
{
/* update any video up to the current scanline */
- device->machine->primary_screen->update_now();
+ device->machine().primary_screen->update_now();
}
static WRITE_LINE_DEVICE_HANDLER(vsync_changed)
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
}
static const mc6845_interface mc6845_intf =
@@ -537,7 +537,7 @@ GFXDECODE_END
static SCREEN_UPDATE( slotcarn )
{
- device_t *mc6845 = screen->machine->device("crtc");
+ device_t *mc6845 = screen->machine().device("crtc");
mc6845_update(mc6845, bitmap, cliprect);
return 0;
@@ -546,7 +546,7 @@ static SCREEN_UPDATE( slotcarn )
static MACHINE_START(merit)
{
- slotcarn_state *state = machine->driver_data<slotcarn_state>();
+ slotcarn_state *state = machine.driver_data<slotcarn_state>();
state->ram_palette = auto_alloc_array(machine, UINT8, RAM_PALETTE_SIZE);
state_save_register_global_pointer(machine, state->ram_palette, RAM_PALETTE_SIZE);
}
diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c
index 952ae1b29cf..d4f7d41a5ae 100644
--- a/src/mame/drivers/sms.c
+++ b/src/mame/drivers/sms.c
@@ -241,7 +241,7 @@ public:
static WRITE8_HANDLER(bankswitch_w)
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
/*************************************
@@ -252,7 +252,7 @@ static WRITE8_HANDLER(bankswitch_w)
static READ8_HANDLER(link_r)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
switch(offset)
{
case 0:
@@ -269,7 +269,7 @@ static READ8_HANDLER(link_r)
static WRITE8_HANDLER(link_w)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
switch(offset)
{
case 0:
@@ -285,13 +285,13 @@ static WRITE8_HANDLER(link_w)
static READ8_HANDLER(z80_8088_r)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
return state->communication_port_status;
}
static READ8_HANDLER(p03_r)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
switch(offset)
{
case 0:
@@ -306,7 +306,7 @@ static READ8_HANDLER(p03_r)
static WRITE8_HANDLER(p03_w)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
switch(offset)
{
case 0:
@@ -401,9 +401,9 @@ static WRITE8_DEVICE_HANDLER(ppi0_b_w)
output_set_lamp_value(8, !BIT(data,7)); /* Stand Light */
output_set_lamp_value(9, !BIT(data,6)); /* Cancel Light */
- coin_counter_w(device->machine, 0, BIT(data,1));
- coin_lockout_w(device->machine, 0, BIT(data,5));
- coin_lockout_w(device->machine, 1, BIT(data,4));
+ coin_counter_w(device->machine(), 0, BIT(data,1));
+ coin_lockout_w(device->machine(), 0, BIT(data,5));
+ coin_lockout_w(device->machine(), 1, BIT(data,4));
}
static const ppi8255_interface ppi8255_intf[2] =
@@ -434,7 +434,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static WRITE8_HANDLER(video_w)
{
- sms_state *state = space->machine->driver_data<sms_state>();
+ sms_state *state = space->machine().driver_data<sms_state>();
state->vid_regs[offset] = data;
if ( offset == 5 )
{
@@ -464,8 +464,8 @@ static WRITE8_HANDLER(video_w)
static VIDEO_START( sms )
{
- sms_state *state = machine->driver_data<sms_state>();
- state->bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ sms_state *state = machine.driver_data<sms_state>();
+ state->bitmap = machine.primary_screen->alloc_compatible_bitmap();
state_save_register_global_array(machine, state->vid_regs);
state_save_register_global_bitmap(machine, state->bitmap);
@@ -473,7 +473,7 @@ static VIDEO_START( sms )
static SCREEN_UPDATE( sms )
{
- sms_state *state = screen->machine->driver_data<sms_state>();
+ sms_state *state = screen->machine().driver_data<sms_state>();
copybitmap(bitmap, state->bitmap, 0, 0, 0, 0, cliprect);
return 0;
}
@@ -531,8 +531,8 @@ ADDRESS_MAP_END
static MACHINE_START( sms )
{
- sms_state *state = machine->driver_data<sms_state>();
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("questions")->base(), 0x4000);
+ sms_state *state = machine.driver_data<sms_state>();
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("questions")->base(), 0x4000);
state_save_register_global(machine, state->communication_port_status);
state_save_register_global_array(machine, state->communication_port);
@@ -540,14 +540,14 @@ static MACHINE_START( sms )
static MACHINE_START( sureshot )
{
- sms_state *state = machine->driver_data<sms_state>();
+ sms_state *state = machine.driver_data<sms_state>();
state_save_register_global(machine, state->communication_port_status);
state_save_register_global_array(machine, state->communication_port);
}
static MACHINE_RESET( sms )
{
- sms_state *state = machine->driver_data<sms_state>();
+ sms_state *state = machine.driver_data<sms_state>();
state->communication_port_status = 0;
}
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index c0dd5c53437..9d2bc9ae578 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -160,9 +160,9 @@ public:
static READ8_HANDLER(sharedram_r)
{
- snesb_state *state = space->machine->driver_data<snesb_state>();
+ snesb_state *state = space->machine().driver_data<snesb_state>();
INT32 coincnt;
- INT32 input = input_port_read(space->machine, "COIN");
+ INT32 input = input_port_read(space->machine(), "COIN");
if(input&3)
{
@@ -181,14 +181,14 @@ static READ8_HANDLER(sharedram_r)
static WRITE8_HANDLER(sharedram_w)
{
- snesb_state *state = space->machine->driver_data<snesb_state>();
+ snesb_state *state = space->machine().driver_data<snesb_state>();
state->shared_ram[offset]=data;
}
static READ8_HANDLER(ffight2b_coin_r)
{
- snesb_state *state = space->machine->driver_data<snesb_state>();
- INT32 input = input_port_read(space->machine, "COIN");
+ snesb_state *state = space->machine().driver_data<snesb_state>();
+ INT32 input = input_port_read(space->machine(), "COIN");
if( ((input&1)==1)&&((state->oldcoin&1)==0))
{
@@ -204,7 +204,7 @@ static READ8_HANDLER(ffight2b_coin_r)
static READ8_HANDLER(sb2b_75bd37_r)
{
- snesb_state *state = space->machine->driver_data<snesb_state>();
+ snesb_state *state = space->machine().driver_data<snesb_state>();
/* protection check */
return ++state->cnt;
}
@@ -229,12 +229,12 @@ static READ8_HANDLER(sb2b_6a6xxx_r)
static READ8_HANDLER(sb2b_770071_r)
{
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
static READ8_HANDLER(sb2b_770079_r)
{
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
}
static READ8_HANDLER(sb2b_7xxx_r)
@@ -246,17 +246,17 @@ static READ8_HANDLER(sb2b_7xxx_r)
static READ8_HANDLER(iron_770071_r)
{
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
}
static READ8_HANDLER(iron_770073_r)
{
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
}
static READ8_HANDLER(iron_770079_r)
{
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
}
@@ -264,12 +264,12 @@ static READ8_HANDLER(iron_770079_r)
static READ8_HANDLER(denseib_770071_r)
{
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
}
static READ8_HANDLER(denseib_770079_r)
{
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
}
@@ -543,9 +543,9 @@ MACHINE_CONFIG_END
static DRIVER_INIT(kinstb)
{
- snesb_state *state = machine->driver_data<snesb_state>();
+ snesb_state *state = machine.driver_data<snesb_state>();
INT32 i;
- UINT8 *rom = machine->region("user3")->base();
+ UINT8 *rom = machine.region("user3")->base();
for (i = 0; i < 0x400000; i++)
{
@@ -553,16 +553,16 @@ static DRIVER_INIT(kinstb)
}
state->shared_ram = auto_alloc_array(machine, INT8, 0x100);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x781000, 0x7810ff, FUNC(sharedram_r), FUNC(sharedram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x781000, 0x7810ff, FUNC(sharedram_r), FUNC(sharedram_w));
DRIVER_INIT_CALL(snes_hirom);
}
static DRIVER_INIT( ffight2b )
{
- snesb_state *state = machine->driver_data<snesb_state>();
+ snesb_state *state = machine.driver_data<snesb_state>();
INT32 i;
- UINT8 *rom = machine->region("user3")->base();
+ UINT8 *rom = machine.region("user3")->base();
for(i = 0; i < 0x200000; i++)
{
@@ -595,7 +595,7 @@ static DRIVER_INIT( ffight2b )
rom[0x7ffc] = 0x54;
state->ffight2b_coins = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7eadce, 0x7eadce, FUNC(ffight2b_coin_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7eadce, 0x7eadce, FUNC(ffight2b_coin_r));
DRIVER_INIT_CALL(snes);
}
@@ -621,8 +621,8 @@ static const UINT8 address_substitution_high[] =
static DRIVER_INIT( sblast2b )
{
int i, cipherText, plainText, newAddress;
- UINT8 *src = machine->region("user7")->base();
- UINT8 *dst = machine->region("user3")->base();
+ UINT8 *src = machine.region("user7")->base();
+ UINT8 *dst = machine.region("user3")->base();
for (i =0; i < 0x80000 * 3; i++)
{
@@ -654,15 +654,15 @@ static DRIVER_INIT( sblast2b )
dst[0xfffd] = 0x7a;
/* protection checks */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x75bd37, 0x75bd37, FUNC(sb2b_75bd37_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6a6000, 0x6a6fff, FUNC(sb2b_6a6xxx_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x75bd37, 0x75bd37, FUNC(sb2b_75bd37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6a6000, 0x6a6fff, FUNC(sb2b_6a6xxx_r));
/* extra inputs */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(sb2b_770071_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(sb2b_770079_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(sb2b_770071_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(sb2b_770079_r));
/* handler to read boot code */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x007000, 0x007fff, FUNC(sb2b_7xxx_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x007000, 0x007fff, FUNC(sb2b_7xxx_r));
DRIVER_INIT_CALL(snes_hirom);
}
@@ -670,7 +670,7 @@ static DRIVER_INIT( sblast2b )
static DRIVER_INIT( iron )
{
INT32 i;
- UINT8 *rom = machine->region("user3")->base();
+ UINT8 *rom = machine.region("user3")->base();
for (i = 0; i < 0x140000; i++)
{
@@ -685,9 +685,9 @@ static DRIVER_INIT( iron )
}
/* extra inputs */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(iron_770071_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770073, 0x770073, FUNC(iron_770073_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(iron_770079_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(iron_770071_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770073, 0x770073, FUNC(iron_770073_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(iron_770079_r));
DRIVER_INIT_CALL(snes);
}
@@ -695,7 +695,7 @@ static DRIVER_INIT( iron )
static DRIVER_INIT( endless )
{
INT32 i;
- UINT8 *rom = machine->region("user3")->base();
+ UINT8 *rom = machine.region("user3")->base();
/* there is more to this, 0x800 based block swaps? */
for (i = 0; i < 0x200000; i++)
@@ -708,7 +708,7 @@ static DRIVER_INIT( endless )
static DRIVER_INIT( denseib )
{
- UINT8 *rom = machine->region("user3")->base();
+ UINT8 *rom = machine.region("user3")->base();
INT32 i;
for (i = 0; i < 0x200000; i++)
@@ -730,8 +730,8 @@ static DRIVER_INIT( denseib )
rom[0xfffd] = 0xf7;
/* extra inputs */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(denseib_770071_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(denseib_770079_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770071, 0x770071, FUNC(denseib_770071_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770079, 0x770079, FUNC(denseib_770079_r));
DRIVER_INIT_CALL(snes_hirom);
}
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index af6f9bec877..a52c7733149 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -89,7 +89,7 @@ Notes:
a bug. The service mode functionality is very limited anyway. To get past the
failed ROM test and see the service mode, use this ROM patch:
- UINT8 *mem = machine->region("maincpu")->base();
+ UINT8 *mem = machine.region("maincpu")->base();
mem[0x3a5d] = mem[0x3a5e] = mem[0x3a5f] = 0;
- The "SNK Wave" custom sound circuitry is only actually used by marvins and
@@ -275,28 +275,28 @@ static READ8_HANDLER ( snk_cpuA_nmi_trigger_r )
{
if(!space->debugger_access())
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
}
return 0xff;
}
static WRITE8_HANDLER( snk_cpuA_nmi_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
}
static READ8_HANDLER ( snk_cpuB_nmi_trigger_r )
{
if(!space->debugger_access())
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, ASSERT_LINE);
}
return 0xff;
}
static WRITE8_HANDLER( snk_cpuB_nmi_ack_w )
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, CLEAR_LINE);
}
/*********************************************************************/
@@ -316,16 +316,16 @@ enum
static WRITE8_HANDLER( marvins_soundlatch_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->marvins_sound_busy_flag = 1;
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static READ8_HANDLER( marvins_soundlatch_r )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->marvins_sound_busy_flag = 0;
return soundlatch_r(space, 0);
@@ -333,14 +333,14 @@ static READ8_HANDLER( marvins_soundlatch_r )
static CUSTOM_INPUT( marvins_sound_busy )
{
- snk_state *state = field->port->machine->driver_data<snk_state>();
+ snk_state *state = field->port->machine().driver_data<snk_state>();
return state->marvins_sound_busy_flag;
}
static READ8_HANDLER( marvins_sound_nmi_ack_r )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
return 0xff;
}
@@ -348,7 +348,7 @@ static READ8_HANDLER( marvins_sound_nmi_ack_r )
static TIMER_CALLBACK( sgladiat_sndirq_update_callback )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
switch(param)
{
@@ -372,24 +372,24 @@ static TIMER_CALLBACK( sgladiat_sndirq_update_callback )
static WRITE8_HANDLER( sgladiat_soundlatch_w )
{
soundlatch_w(space, offset, data);
- space->machine->scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_BUSY_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_BUSY_ASSERT);
}
static READ8_HANDLER( sgladiat_soundlatch_r )
{
- space->machine->scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), BUSY_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), BUSY_CLEAR);
return soundlatch_r(space,0);
}
static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
{
- space->machine->scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_CLEAR);
return 0xff;
}
static READ8_HANDLER( sgladiat_sound_irq_ack_r )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return 0xff;
}
@@ -419,7 +419,7 @@ static READ8_HANDLER( sgladiat_sound_irq_ack_r )
static TIMER_CALLBACK( sndirq_update_callback )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
switch(param)
{
@@ -460,13 +460,13 @@ static TIMER_CALLBACK( sndirq_update_callback )
static void ymirq_callback_1(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_ASSERT);
}
static void ymirq_callback_2(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_ASSERT);
}
@@ -495,12 +495,12 @@ static const y8950_interface y8950_config_2 =
static WRITE8_HANDLER( snk_soundlatch_w )
{
soundlatch_w(space, offset, data);
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_BUSY_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_BUSY_ASSERT);
}
static CUSTOM_INPUT( snk_sound_busy )
{
- snk_state *state = field->port->machine->driver_data<snk_state>();
+ snk_state *state = field->port->machine().driver_data<snk_state>();
return (state->sound_status & 4) ? 1 : 0;
}
@@ -509,7 +509,7 @@ static CUSTOM_INPUT( snk_sound_busy )
static READ8_HANDLER( snk_sound_status_r )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
return state->sound_status;
}
@@ -517,29 +517,29 @@ static READ8_HANDLER( snk_sound_status_r )
static WRITE8_HANDLER( snk_sound_status_w )
{
if (~data & 0x10) // ack YM1 irq
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR);
if (~data & 0x20) // ack YM2 irq
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_CLEAR);
if (~data & 0x40) // clear busy flag
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR);
if (~data & 0x80) // ack command from main cpu
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR);
}
static READ8_HANDLER( tnk3_cmdirq_ack_r )
{
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR);
return 0xff;
}
static READ8_HANDLER( tnk3_ymirq_ack_r )
{
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR);
return 0xff;
}
@@ -547,7 +547,7 @@ static READ8_HANDLER( tnk3_busy_clear_r )
{
// it's uncertain whether the latch should be cleared here or when it's read
soundlatch_clear_w(space, 0, 0);
- space->machine->scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR);
return 0xff;
}
@@ -573,28 +573,28 @@ A trojan could be used on the board to verify the exact behaviour.
static WRITE8_HANDLER( hardflags_scrollx_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->hf_posx = (state->hf_posx & ~0xff) | data;
}
static WRITE8_HANDLER( hardflags_scrolly_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->hf_posy = (state->hf_posy & ~0xff) | data;
}
static WRITE8_HANDLER( hardflags_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->hf_posx = (state->hf_posx & 0xff) | ((data & 0x80) << 1);
state->hf_posy = (state->hf_posy & 0xff) | ((data & 0x40) << 2);
// low 6 bits might indicate radius, but it's not clear
}
-static int hardflags_check(running_machine *machine, int num)
+static int hardflags_check(running_machine &machine, int num)
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
const UINT8 *sr = &state->spriteram[0x800 + 4*num];
int x = sr[2] + ((sr[3] & 0x80) << 1);
int y = sr[0] + ((sr[3] & 0x10) << 4);
@@ -608,7 +608,7 @@ static int hardflags_check(running_machine *machine, int num)
return 1;
}
-static int hardflags_check8(running_machine *machine, int num)
+static int hardflags_check8(running_machine &machine, int num)
{
return
(hardflags_check(machine, num + 0) << 0) |
@@ -621,20 +621,20 @@ static int hardflags_check8(running_machine *machine, int num)
(hardflags_check(machine, num + 7) << 7);
}
-static READ8_HANDLER( hardflags1_r ) { return hardflags_check8(space->machine, 0*8); }
-static READ8_HANDLER( hardflags2_r ) { return hardflags_check8(space->machine, 1*8); }
-static READ8_HANDLER( hardflags3_r ) { return hardflags_check8(space->machine, 2*8); }
-static READ8_HANDLER( hardflags4_r ) { return hardflags_check8(space->machine, 3*8); }
-static READ8_HANDLER( hardflags5_r ) { return hardflags_check8(space->machine, 4*8); }
-static READ8_HANDLER( hardflags6_r ) { return hardflags_check8(space->machine, 5*8); }
+static READ8_HANDLER( hardflags1_r ) { return hardflags_check8(space->machine(), 0*8); }
+static READ8_HANDLER( hardflags2_r ) { return hardflags_check8(space->machine(), 1*8); }
+static READ8_HANDLER( hardflags3_r ) { return hardflags_check8(space->machine(), 2*8); }
+static READ8_HANDLER( hardflags4_r ) { return hardflags_check8(space->machine(), 3*8); }
+static READ8_HANDLER( hardflags5_r ) { return hardflags_check8(space->machine(), 4*8); }
+static READ8_HANDLER( hardflags6_r ) { return hardflags_check8(space->machine(), 5*8); }
static READ8_HANDLER( hardflags7_r )
{
// apparently the startup tests use bits 0&1 while the game uses bits 4&5
return
- (hardflags_check(space->machine, 6*8 + 0) << 0) |
- (hardflags_check(space->machine, 6*8 + 1) << 1) |
- (hardflags_check(space->machine, 6*8 + 0) << 4) |
- (hardflags_check(space->machine, 6*8 + 1) << 5);
+ (hardflags_check(space->machine(), 6*8 + 0) << 0) |
+ (hardflags_check(space->machine(), 6*8 + 1) << 1) |
+ (hardflags_check(space->machine(), 6*8 + 0) << 4) |
+ (hardflags_check(space->machine(), 6*8 + 1) << 5);
}
@@ -657,31 +657,31 @@ A trojan could be used on the board to verify the exact behaviour.
static WRITE8_HANDLER( turbocheck16_1_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tc16_posy = (state->tc16_posy & ~0xff) | data;
}
static WRITE8_HANDLER( turbocheck16_2_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tc16_posx = (state->tc16_posx & ~0xff) | data;
}
static WRITE8_HANDLER( turbocheck32_1_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tc32_posy = (state->tc32_posy & ~0xff) | data;
}
static WRITE8_HANDLER( turbocheck32_2_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tc32_posx = (state->tc32_posx & ~0xff) | data;
}
static WRITE8_HANDLER( turbocheck_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tc16_posx = (state->tc16_posx & 0xff) | ((data & 0x80) << 1);
state->tc16_posy = (state->tc16_posy & 0xff) | ((data & 0x40) << 2);
state->tc32_posx = (state->tc32_posx & 0xff) | ((data & 0x80) << 1);
@@ -690,9 +690,9 @@ static WRITE8_HANDLER( turbocheck_msb_w )
// low 6 bits might indicate radius, but it's not clear
}
-static int turbofront_check(running_machine *machine, int small, int num)
+static int turbofront_check(running_machine &machine, int small, int num)
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
const UINT8 *sr = &state->spriteram[0x800*small + 4*num];
int x = sr[2] + ((sr[3] & 0x80) << 1);
int y = sr[0] + ((sr[3] & 0x10) << 4);
@@ -706,7 +706,7 @@ static int turbofront_check(running_machine *machine, int small, int num)
return 1;
}
-static int turbofront_check8(running_machine *machine, int small, int num)
+static int turbofront_check8(running_machine &machine, int small, int num)
{
return
(turbofront_check(machine, small, num + 0) << 0) |
@@ -719,18 +719,18 @@ static int turbofront_check8(running_machine *machine, int small, int num)
(turbofront_check(machine, small, num + 7) << 7);
}
-static READ8_HANDLER( turbocheck16_1_r ) { return turbofront_check8(space->machine, 1, 0*8); }
-static READ8_HANDLER( turbocheck16_2_r ) { return turbofront_check8(space->machine, 1, 1*8); }
-static READ8_HANDLER( turbocheck16_3_r ) { return turbofront_check8(space->machine, 1, 2*8); }
-static READ8_HANDLER( turbocheck16_4_r ) { return turbofront_check8(space->machine, 1, 3*8); }
-static READ8_HANDLER( turbocheck16_5_r ) { return turbofront_check8(space->machine, 1, 4*8); }
-static READ8_HANDLER( turbocheck16_6_r ) { return turbofront_check8(space->machine, 1, 5*8); }
-static READ8_HANDLER( turbocheck16_7_r ) { return turbofront_check8(space->machine, 1, 6*8); }
-static READ8_HANDLER( turbocheck16_8_r ) { return turbofront_check8(space->machine, 1, 7*8); }
-static READ8_HANDLER( turbocheck32_1_r ) { return turbofront_check8(space->machine, 0, 0*8); }
-static READ8_HANDLER( turbocheck32_2_r ) { return turbofront_check8(space->machine, 0, 1*8); }
-static READ8_HANDLER( turbocheck32_3_r ) { return turbofront_check8(space->machine, 0, 2*8); }
-static READ8_HANDLER( turbocheck32_4_r ) { return turbofront_check8(space->machine, 0, 3*8); }
+static READ8_HANDLER( turbocheck16_1_r ) { return turbofront_check8(space->machine(), 1, 0*8); }
+static READ8_HANDLER( turbocheck16_2_r ) { return turbofront_check8(space->machine(), 1, 1*8); }
+static READ8_HANDLER( turbocheck16_3_r ) { return turbofront_check8(space->machine(), 1, 2*8); }
+static READ8_HANDLER( turbocheck16_4_r ) { return turbofront_check8(space->machine(), 1, 3*8); }
+static READ8_HANDLER( turbocheck16_5_r ) { return turbofront_check8(space->machine(), 1, 4*8); }
+static READ8_HANDLER( turbocheck16_6_r ) { return turbofront_check8(space->machine(), 1, 5*8); }
+static READ8_HANDLER( turbocheck16_7_r ) { return turbofront_check8(space->machine(), 1, 6*8); }
+static READ8_HANDLER( turbocheck16_8_r ) { return turbofront_check8(space->machine(), 1, 7*8); }
+static READ8_HANDLER( turbocheck32_1_r ) { return turbofront_check8(space->machine(), 0, 0*8); }
+static READ8_HANDLER( turbocheck32_2_r ) { return turbofront_check8(space->machine(), 0, 1*8); }
+static READ8_HANDLER( turbocheck32_3_r ) { return turbofront_check8(space->machine(), 0, 2*8); }
+static READ8_HANDLER( turbocheck32_4_r ) { return turbofront_check8(space->machine(), 0, 3*8); }
@@ -752,10 +752,10 @@ hand, always returning 0xf inbetween valid values confuses the game.
static CUSTOM_INPUT( gwar_rotary )
{
- snk_state *state = field->port->machine->driver_data<snk_state>();
+ snk_state *state = field->port->machine().driver_data<snk_state>();
static const char *const ports[] = { "P1ROT", "P2ROT" };
int which = (int)(FPTR)param;
- int value = input_port_read(field->port->machine, ports[which]);
+ int value = input_port_read(field->port->machine(), ports[which]);
if ((state->last_value[which] == 0x5 && value == 0x6) || (state->last_value[which] == 0x6 && value == 0x5))
{
@@ -770,7 +770,7 @@ static CUSTOM_INPUT( gwar_rotary )
static CUSTOM_INPUT( gwarb_rotary )
{
- if (input_port_read(field->port->machine, "JOYSTICK_MODE") == 1)
+ if (input_port_read(field->port->machine(), "JOYSTICK_MODE") == 1)
{
return gwar_rotary(field, param);
}
@@ -785,50 +785,50 @@ static CUSTOM_INPUT( gwarb_rotary )
static WRITE8_HANDLER( athena_coin_counter_w )
{
- coin_counter_w(space->machine, 0, ~data & 2);
- coin_counter_w(space->machine, 1, ~data & 1);
+ coin_counter_w(space->machine(), 0, ~data & 2);
+ coin_counter_w(space->machine(), 1, ~data & 1);
}
static WRITE8_HANDLER( ikari_coin_counter_w )
{
if (~data & 0x80)
{
- coin_counter_w(space->machine, 0, 1);
- coin_counter_w(space->machine, 0, 0);
+ coin_counter_w(space->machine(), 0, 1);
+ coin_counter_w(space->machine(), 0, 0);
}
if (~data & 0x40)
{
- coin_counter_w(space->machine, 1, 1);
- coin_counter_w(space->machine, 1, 0);
+ coin_counter_w(space->machine(), 1, 1);
+ coin_counter_w(space->machine(), 1, 0);
}
}
static WRITE8_HANDLER( tdfever_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE8_HANDLER( countryc_trackball_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->countryc_trackball = data & 1;
}
static CUSTOM_INPUT( countryc_trackball_x )
{
- snk_state *state = field->port->machine->driver_data<snk_state>();
+ snk_state *state = field->port->machine().driver_data<snk_state>();
- return input_port_read(field->port->machine, state->countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1");
+ return input_port_read(field->port->machine(), state->countryc_trackball ? "TRACKBALLX2" : "TRACKBALLX1");
}
static CUSTOM_INPUT( countryc_trackball_y )
{
- snk_state *state = field->port->machine->driver_data<snk_state>();
+ snk_state *state = field->port->machine().driver_data<snk_state>();
- return input_port_read(field->port->machine, state->countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1");
+ return input_port_read(field->port->machine(), state->countryc_trackball ? "TRACKBALLY2" : "TRACKBALLY1");
}
@@ -841,14 +841,14 @@ static CUSTOM_INPUT( snk_bonus_r )
switch (bit_mask)
{
case 0x01: /* older games : "Occurence" Dip Switch (DSW2:1) */
- return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "BONUS") & bit_mask) >> 0);
case 0xc0: /* older games : "Bonus Life" Dip Switches (DSW1:7,8) */
- return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "BONUS") & bit_mask) >> 6);
case 0x04: /* later games : "Occurence" Dip Switch (DSW1:3) */
- return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "BONUS") & bit_mask) >> 2);
case 0x30: /* later games : "Bonus Life" Dip Switches (DSW2:5,6) */
- return ((input_port_read(field->port->machine, "BONUS") & bit_mask) >> 4);
+ return ((input_port_read(field->port->machine(), "BONUS") & bit_mask) >> 4);
default:
logerror("snk_bonus_r : invalid %02X bit_mask\n",bit_mask);
@@ -6253,7 +6253,7 @@ ROM_END
static DRIVER_INIT( countryc )
{
// replace coin counter with trackball select
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc300, 0xc300, FUNC(countryc_trackball_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc300, 0xc300, FUNC(countryc_trackball_w));
}
diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c
index 6a515190246..b6e614ecb21 100644
--- a/src/mame/drivers/snk6502.c
+++ b/src/mame/drivers/snk6502.c
@@ -285,14 +285,14 @@ Stephh's notes (based on the games M6502 code and some tests) :
/* binary counter (1.4MHz update) */
static TIMER_DEVICE_CALLBACK( sasuke_update_counter )
{
- snk6502_state *state = timer.machine->driver_data<snk6502_state>();
+ snk6502_state *state = timer.machine().driver_data<snk6502_state>();
state->sasuke_counter += 0x10;
}
-static void sasuke_start_counter(running_machine *machine)
+static void sasuke_start_counter(running_machine &machine)
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
state->sasuke_counter = 0;
}
@@ -306,12 +306,12 @@ static void sasuke_start_counter(running_machine *machine)
static CUSTOM_INPUT( snk6502_music0_r )
{
- return (snk6502_music0_playing(field->port->machine) ? 0x01 : 0x00);
+ return (snk6502_music0_playing(field->port->machine()) ? 0x01 : 0x00);
}
static CUSTOM_INPUT( sasuke_count_r )
{
- snk6502_state *state = field->port->machine->driver_data<snk6502_state>();
+ snk6502_state *state = field->port->machine().driver_data<snk6502_state>();
return (state->sasuke_counter >> 4);
}
@@ -725,9 +725,9 @@ static INTERRUPT_GEN( satansat_interrupt )
{
if (cpu_getiloops(device) != 0)
{
- UINT8 val = input_port_read(device->machine, "IN2");
+ UINT8 val = input_port_read(device->machine(), "IN2");
- coin_counter_w(device->machine, 0, val & 1);
+ coin_counter_w(device->machine(), 0, val & 1);
/* user asks to insert coin: generate a NMI interrupt. */
if (val & 0x01)
@@ -741,10 +741,10 @@ static INTERRUPT_GEN( snk6502_interrupt )
{
if (cpu_getiloops(device) != 0)
{
- UINT8 val = input_port_read(device->machine, "IN2");
+ UINT8 val = input_port_read(device->machine(), "IN2");
- coin_counter_w(device->machine, 0, val & 1);
- coin_counter_w(device->machine, 1, val & 2);
+ coin_counter_w(device->machine(), 0, val & 1);
+ coin_counter_w(device->machine(), 1, val & 2);
/* user asks to insert coin: generate a NMI interrupt. */
if (val & 0x03)
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index 976dba06112..e7e43760d6f 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -51,50 +51,50 @@ Notes:
static READ16_HANDLER( sound_status_r )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
return (state->sound_status << 8);
}
static WRITE8_HANDLER( sound_status_w )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
state->sound_status = data;
}
static READ16_HANDLER( control_1_r )
{
- return (input_port_read(space->machine, "P1") + (input_port_read(space->machine, "P2") << 8));
+ return (input_port_read(space->machine(), "P1") + (input_port_read(space->machine(), "P2") << 8));
}
static READ16_HANDLER( control_2_r )
{
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
static READ16_HANDLER( rotary_1_r )
{
- return (( ~(1 << input_port_read(space->machine, "ROT1")) )<<8)&0xff00;
+ return (( ~(1 << input_port_read(space->machine(), "ROT1")) )<<8)&0xff00;
}
static READ16_HANDLER( rotary_2_r )
{
- return (( ~(1 << input_port_read(space->machine, "ROT2")) )<<8)&0xff00;
+ return (( ~(1 << input_port_read(space->machine(), "ROT2")) )<<8)&0xff00;
}
static READ16_HANDLER( rotary_lsb_r )
{
- return ((( ~(1 << input_port_read(space->machine, "ROT2")) ) <<4)&0xf000)
- + ((( ~(1 << input_port_read(space->machine, "ROT1")) ) )&0x0f00);
+ return ((( ~(1 << input_port_read(space->machine(), "ROT2")) ) <<4)&0xf000)
+ + ((( ~(1 << input_port_read(space->machine(), "ROT1")) ) )&0x0f00);
}
static READ16_HANDLER( protcontrols_r )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
static const char *const portnames[] = { "P1", "P2", "SYSTEM" };
- return input_port_read(space->machine, portnames[offset]) ^ state->invert_controls;
+ return input_port_read(space->machine(), portnames[offset]) ^ state->invert_controls;
}
static WRITE16_HANDLER( protection_w )
@@ -103,7 +103,7 @@ static WRITE16_HANDLER( protection_w )
/* bottom byte is protection in ikari 3 and streetsm */
if (ACCESSING_BITS_0_7)
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
state->invert_controls = ((data & 0xff) == 0x07) ? 0xff : 0x00;
}
}
@@ -113,7 +113,7 @@ static WRITE16_HANDLER( sound_w )
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, data >> 8);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -580,7 +580,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym3812_interface ym3812_config =
@@ -1001,7 +1001,7 @@ ROM_END
static DRIVER_INIT( searchar )
{
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base());
}
/******************************************************************************/
diff --git a/src/mame/drivers/snookr10.c b/src/mame/drivers/snookr10.c
index 275bbfcd789..ce467cad7b3 100644
--- a/src/mame/drivers/snookr10.c
+++ b/src/mame/drivers/snookr10.c
@@ -390,7 +390,7 @@ static READ8_HANDLER( dsw_port_1_r )
BIT 7 = Complement of DS1, bit 7
---------------------------------
*/
-return input_port_read(space->machine, "SW1");
+return input_port_read(space->machine(), "SW1");
}
@@ -416,7 +416,7 @@ return input_port_read(space->machine, "SW1");
static WRITE8_HANDLER( output_port_0_w )
{
- snookr10_state *state = space->machine->driver_data<snookr10_state>();
+ snookr10_state *state = space->machine().driver_data<snookr10_state>();
/*
----------------------------
PORT 0x5000 ;OUTPUT PORT A
@@ -448,9 +448,9 @@ static WRITE8_HANDLER( output_port_0_w )
output_set_lamp_value(5, state->bit3); /* Lamp 5 - STOP4 */
output_set_lamp_value(6, state->bit4); /* Lamp 6 - STOP5 */
- coin_counter_w(space->machine, 0, data & 0x01); /* Coin in */
- coin_counter_w(space->machine, 1, data & 0x10); /* Key in */
- coin_counter_w(space->machine, 2, data & 0x04); /* Payout x10 */
+ coin_counter_w(space->machine(), 0, data & 0x01); /* Coin in */
+ coin_counter_w(space->machine(), 1, data & 0x10); /* Key in */
+ coin_counter_w(space->machine(), 2, data & 0x04); /* Payout x10 */
// logerror("high: %04x - low: %X \n", state->outporth, state->outportl);
// popmessage("written : %02X", data);
@@ -458,7 +458,7 @@ static WRITE8_HANDLER( output_port_0_w )
static WRITE8_HANDLER( output_port_1_w )
{
- snookr10_state *state = space->machine->driver_data<snookr10_state>();
+ snookr10_state *state = space->machine().driver_data<snookr10_state>();
/*
----------------------------
PORT 0x5001 ;OUTPUT PORT B
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index fefa98c1794..05986856d2a 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -92,13 +92,13 @@ public:
static WRITE16_HANDLER( snowbros_flipscreen_w )
{
if (ACCESSING_BITS_8_15)
- flip_screen_set(space->machine, ~data & 0x8000);
+ flip_screen_set(space->machine(), ~data & 0x8000);
}
static SCREEN_UPDATE( snowbros )
{
- device_t *pandora = screen->machine->device("pandora");
+ device_t *pandora = screen->machine().device("pandora");
/* This clears & redraws the entire screen each pass */
bitmap_fill(bitmap,cliprect,0xf0);
@@ -109,7 +109,7 @@ static SCREEN_UPDATE( snowbros )
static SCREEN_EOF( snowbros )
{
- device_t *pandora = machine->device("pandora");
+ device_t *pandora = machine.device("pandora");
pandora_eof(pandora);
}
@@ -117,17 +117,17 @@ static SCREEN_EOF( snowbros )
static WRITE16_HANDLER( snowbros_irq4_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, CLEAR_LINE);
}
static WRITE16_HANDLER( snowbros_irq3_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE);
}
static WRITE16_HANDLER( snowbros_irq2_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
}
static INTERRUPT_GEN( snowbros_interrupt )
@@ -137,8 +137,8 @@ static INTERRUPT_GEN( snowbros_interrupt )
static INTERRUPT_GEN( snowbro3_interrupt )
{
- snowbros_state *state = device->machine->driver_data<snowbros_state>();
- okim6295_device *adpcm = device->machine->device<okim6295_device>("oki");
+ snowbros_state *state = device->machine().driver_data<snowbros_state>();
+ okim6295_device *adpcm = device->machine().device<okim6295_device>("oki");
int status = adpcm->read_status();
device_set_input_line(device, cpu_getiloops(device) + 2, ASSERT_LINE); /* IRQs 4, 3, and 2 */
@@ -176,7 +176,7 @@ static WRITE16_HANDLER( snowbros_68000_sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -226,7 +226,7 @@ static READ8_HANDLER( prot_io_r )
// probably not endian safe
static WRITE8_HANDLER( prot_io_w )
{
- snowbros_state *state = space->machine->driver_data<snowbros_state>();
+ snowbros_state *state = space->machine().driver_data<snowbros_state>();
switch (offset)
{
case 0x00:
@@ -323,7 +323,7 @@ static WRITE16_HANDLER( twinadv_68000_sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -399,9 +399,9 @@ static READ16_HANDLER( sb3_sound_r )
return 0x0003;
}
-static void sb3_play_music(running_machine *machine, int data)
+static void sb3_play_music(running_machine &machine, int data)
{
- snowbros_state *state = machine->driver_data<snowbros_state>();
+ snowbros_state *state = machine.driver_data<snowbros_state>();
UINT8 *snd;
/* sample is actually played in interrupt function so it loops */
@@ -411,13 +411,13 @@ static void sb3_play_music(running_machine *machine, int data)
{
case 0x23:
case 0x26:
- snd = machine->region("oki")->base();
+ snd = machine.region("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
state->sb3_music_is_playing = 1;
break;
case 0x24:
- snd = machine->region("oki")->base();
+ snd = machine.region("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
state->sb3_music_is_playing = 1;
break;
@@ -430,7 +430,7 @@ static void sb3_play_music(running_machine *machine, int data)
case 0x2b:
case 0x2c:
case 0x2d:
- snd = machine->region("oki")->base();
+ snd = machine.region("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x40000, 0x20000);
state->sb3_music_is_playing = 1;
break;
@@ -466,7 +466,7 @@ static void sb3_play_sound (okim6295_device *oki, int data)
static WRITE16_DEVICE_HANDLER( sb3_sound_w )
{
- snowbros_state *state = device->machine->driver_data<snowbros_state>();
+ snowbros_state *state = device->machine().driver_data<snowbros_state>();
okim6295_device *oki = downcast<okim6295_device *>(device);
if (data == 0x00fe)
{
@@ -484,7 +484,7 @@ static WRITE16_DEVICE_HANDLER( sb3_sound_w )
if (data>=0x22 && data<=0x31)
{
- sb3_play_music(device->machine, data);
+ sb3_play_music(device->machine(), data);
}
if ((data>=0x30) && (data<=0x51))
@@ -494,7 +494,7 @@ static WRITE16_DEVICE_HANDLER( sb3_sound_w )
if (data>=0x52 && data<=0x5f)
{
- sb3_play_music(device->machine, data-0x30);
+ sb3_play_music(device->machine(), data-0x30);
}
}
@@ -1419,7 +1419,7 @@ GFXDECODE_END
/* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
/* SnowBros Sound */
@@ -1439,8 +1439,8 @@ static const ym2151_interface ym2151_config =
static MACHINE_RESET (semiprot)
{
- snowbros_state *state = machine->driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
+ snowbros_state *state = machine.driver_data<snowbros_state>();
+ UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -1449,8 +1449,8 @@ static MACHINE_RESET (semiprot)
static MACHINE_RESET (finalttr)
{
- snowbros_state *state = machine->driver_data<snowbros_state>();
- UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
+ snowbros_state *state = machine.driver_data<snowbros_state>();
+ UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
int i;
for (i = 0;i < 0x200/2;i++)
@@ -2264,23 +2264,23 @@ static READ16_HANDLER ( moremorp_0a_read )
static DRIVER_INIT( moremorp )
{
- //snowbros_state *state = machine->driver_data<snowbros_state>();
-// UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
+ //snowbros_state *state = machine.driver_data<snowbros_state>();
+// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
// int i;
// for (i = 0;i < 0x200/2;i++)
// state->hyperpac_ram[0xf000/2 + i] = PROTDATA[i];
/* explicit check in the code */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(moremorp_0a_read) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(moremorp_0a_read) );
}
static DRIVER_INIT( cookbib2 )
{
- //snowbros_state *state = machine->driver_data<snowbros_state>();
-// UINT16 *HCROM = (UINT16*)machine->region("maincpu")->base();
-// UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
+ //snowbros_state *state = machine.driver_data<snowbros_state>();
+// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
+// UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
// int i;
// state->hyperpac_ram[0xf000/2] = 0x46fc;
// state->hyperpac_ram[0xf002/2] = 0x2700;
@@ -2623,7 +2623,7 @@ static DRIVER_INIT( cookbib2 )
#if 0
static DRIVER_INIT( hyperpac )
{
- snowbros_state *state = machine->driver_data<snowbros_state>();
+ snowbros_state *state = machine.driver_data<snowbros_state>();
UINT16 *hyperpac_ram = state->hyperpac_ram;
/* simulate RAM initialization done by the protection MCU */
/* not verified on real hardware */
@@ -2646,8 +2646,8 @@ static READ16_HANDLER ( _4in1_02_read )
static DRIVER_INIT(4in1boot)
{
UINT8 *buffer;
- UINT8 *src = machine->region("maincpu")->base();
- int len = machine->region("maincpu")->bytes();
+ UINT8 *src = machine.region("maincpu")->base();
+ int len = machine.region("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2661,8 +2661,8 @@ static DRIVER_INIT(4in1boot)
auto_free(machine, buffer);
}
- src = machine->region("soundcpu")->base();
- len = machine->region("soundcpu")->bytes();
+ src = machine.region("soundcpu")->base();
+ len = machine.region("soundcpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2673,14 +2673,14 @@ static DRIVER_INIT(4in1boot)
memcpy(src,buffer,len);
auto_free(machine, buffer);
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(_4in1_02_read) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(_4in1_02_read) );
}
static DRIVER_INIT(snowbro3)
{
UINT8 *buffer;
- UINT8 *src = machine->region("maincpu")->base();
- int len = machine->region("maincpu")->bytes();
+ UINT8 *src = machine.region("maincpu")->base();
+ int len = machine.region("maincpu")->bytes();
/* strange order */
buffer = auto_alloc_array(machine, UINT8, len);
@@ -2700,7 +2700,7 @@ static READ16_HANDLER( _3in1_read )
static DRIVER_INIT( 3in1semi )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(_3in1_read) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(_3in1_read) );
}
static READ16_HANDLER( cookbib3_read )
@@ -2710,12 +2710,12 @@ static READ16_HANDLER( cookbib3_read )
static DRIVER_INIT( cookbib3 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(cookbib3_read) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200001, FUNC(cookbib3_read) );
}
static DRIVER_INIT( pzlbreak )
{
- pandora_set_bg_pen(machine->device("pandora"), 0xc0);
+ pandora_set_bg_pen(machine.device("pandora"), 0xc0);
}
GAME( 1990, snowbros, 0, snowbros, snowbros, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", 0 )
diff --git a/src/mame/drivers/solomon.c b/src/mame/drivers/solomon.c
index 50ca0e72259..13c4e78f29e 100644
--- a/src/mame/drivers/solomon.c
+++ b/src/mame/drivers/solomon.c
@@ -14,7 +14,7 @@ driver by Mirko Buffoni
static WRITE8_HANDLER( solomon_sh_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
/* this is checked on the title screen and when you reach certain scores in the game
diff --git a/src/mame/drivers/sonson.c b/src/mame/drivers/sonson.c
index 898837b7e8b..ed1647eae08 100644
--- a/src/mame/drivers/sonson.c
+++ b/src/mame/drivers/sonson.c
@@ -57,7 +57,7 @@ TODO:
static WRITE8_HANDLER( sonson_sh_irqtrigger_w )
{
- sonson_state *state = space->machine->driver_data<sonson_state>();
+ sonson_state *state = space->machine().driver_data<sonson_state>();
data &= 1;
if (state->last_irq == 0 && data == 1)
@@ -71,12 +71,12 @@ static WRITE8_HANDLER( sonson_sh_irqtrigger_w )
static WRITE8_HANDLER( sonson_coin1_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( sonson_coin2_counter_w )
{
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -229,16 +229,16 @@ GFXDECODE_END
static MACHINE_START( sonson )
{
- sonson_state *state = machine->driver_data<sonson_state>();
+ sonson_state *state = machine.driver_data<sonson_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->last_irq));
}
static MACHINE_RESET( sonson )
{
- sonson_state *state = machine->driver_data<sonson_state>();
+ sonson_state *state = machine.driver_data<sonson_state>();
state->last_irq = 0;
}
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index 73697d4793d..fe0c7140329 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -68,7 +68,7 @@ public:
static WRITE8_HANDLER(bank_w)
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bank=0;
switch(data^0xff)
{
@@ -77,32 +77,32 @@ static WRITE8_HANDLER(bank_w)
case 4: bank=2; break;
case 8: bank=3; break;
}
- memory_set_bankptr(space->machine,"bank1",&RAM[bank*0x4000+0x10000]);
+ memory_set_bankptr(space->machine(),"bank1",&RAM[bank*0x4000+0x10000]);
}
static TIMER_CALLBACK( subcpu_suspend )
{
- machine->device<cpu_device>("sub")->suspend(SUSPEND_REASON_HALT, 1);
+ machine.device<cpu_device>("sub")->suspend(SUSPEND_REASON_HALT, 1);
}
static TIMER_CALLBACK( subcpu_resume )
{
- machine->device<cpu_device>("sub")->resume(SUSPEND_REASON_HALT);
+ machine.device<cpu_device>("sub")->resume(SUSPEND_REASON_HALT);
cputag_set_input_line(machine, "sub", INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( subcpu_halt_set )
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
- space->machine->scheduler().synchronize(FUNC(subcpu_suspend));
+ sothello_state *state = space->machine().driver_data<sothello_state>();
+ space->machine().scheduler().synchronize(FUNC(subcpu_suspend));
state->subcpu_status|=2;
return 0;
}
static READ8_HANDLER( subcpu_halt_clear )
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
- space->machine->scheduler().synchronize(FUNC(subcpu_resume));
+ sothello_state *state = space->machine().driver_data<sothello_state>();
+ space->machine().scheduler().synchronize(FUNC(subcpu_resume));
state->subcpu_status&=~1;
state->subcpu_status&=~2;
return 0;
@@ -110,13 +110,13 @@ static READ8_HANDLER( subcpu_halt_clear )
static READ8_HANDLER(subcpu_comm_status )
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
+ sothello_state *state = space->machine().driver_data<sothello_state>();
return state->subcpu_status;
}
static READ8_HANDLER( soundcpu_status_r )
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
+ sothello_state *state = space->machine().driver_data<sothello_state>();
return state->soundcpu_busy;
}
@@ -162,26 +162,26 @@ static WRITE8_DEVICE_HANDLER(msm_cfg_w)
static WRITE8_HANDLER( msm_data_w )
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
+ sothello_state *state = space->machine().driver_data<sothello_state>();
state->msm_data = data;
}
static WRITE8_HANDLER(soundcpu_busyflag_set_w)
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
+ sothello_state *state = space->machine().driver_data<sothello_state>();
state->soundcpu_busy=1;
}
static WRITE8_HANDLER(soundcpu_busyflag_reset_w)
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
+ sothello_state *state = space->machine().driver_data<sothello_state>();
state->soundcpu_busy=0;
}
static WRITE8_HANDLER(soundcpu_int_clear_w)
{
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE );
}
static ADDRESS_MAP_START( soundcpu_mem_map, AS_PROGRAM, 8 )
@@ -203,8 +203,8 @@ ADDRESS_MAP_END
static void unlock_shared_ram(address_space *space)
{
- sothello_state *state = space->machine->driver_data<sothello_state>();
- if(!space->machine->device<cpu_device>("sub")->suspended(SUSPEND_REASON_HALT))
+ sothello_state *state = space->machine().driver_data<sothello_state>();
+ if(!space->machine().device<cpu_device>("sub")->suspended(SUSPEND_REASON_HALT))
{
state->subcpu_status|=1;
}
@@ -309,25 +309,25 @@ INPUT_PORTS_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "sub", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sub", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
-static void sothello_vdp_interrupt(running_machine *machine, int i)
+static void sothello_vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line(machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
static INTERRUPT_GEN( sothello_interrupt )
{
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static void adpcm_int(device_t *device)
{
- sothello_state *state = device->machine->driver_data<sothello_state>();
+ sothello_state *state = device->machine().driver_data<sothello_state>();
/* only 4 bits are used */
msm5205_data_w( device, state->msm_data & 0x0f );
- cputag_set_input_line(device->machine, "soundcpu", 0, ASSERT_LINE );
+ cputag_set_input_line(device->machine(), "soundcpu", 0, ASSERT_LINE );
}
@@ -340,7 +340,7 @@ static const msm5205_interface msm_interface =
static VIDEO_START( sothello )
{
VIDEO_START_CALL(generic_bitmapped);
- v9938_init (machine, 0, *machine->primary_screen, machine->generic.tmpbitmap, MODEL_V9938, VDP_MEM, sothello_vdp_interrupt);
+ v9938_init (machine, 0, *machine.primary_screen, machine.generic.tmpbitmap, MODEL_V9938, VDP_MEM, sothello_vdp_interrupt);
v9938_reset(0);
}
diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c
index d424c02ad45..72cbf944962 100644
--- a/src/mame/drivers/spacefb.c
+++ b/src/mame/drivers/spacefb.c
@@ -126,11 +126,11 @@
static TIMER_CALLBACK( interrupt_callback )
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
int next_vpos;
/* compute vector and set the interrupt line */
- int vpos = machine->primary_screen->vpos();
+ int vpos = machine.primary_screen->vpos();
UINT8 vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, vector);
@@ -140,21 +140,21 @@ static TIMER_CALLBACK( interrupt_callback )
else
next_vpos = SPACEFB_INT_TRIGGER_COUNT_1;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
}
-static void create_interrupt_timer(running_machine *machine)
+static void create_interrupt_timer(running_machine &machine)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ spacefb_state *state = machine.driver_data<spacefb_state>();
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
}
-static void start_interrupt_timer(running_machine *machine)
+static void start_interrupt_timer(running_machine &machine)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1));
+ spacefb_state *state = machine.driver_data<spacefb_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1));
}
@@ -180,7 +180,7 @@ static MACHINE_START( spacefb )
static MACHINE_RESET( spacefb )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
/* the 3 output ports are cleared on reset */
spacefb_port_0_w(space, 0, 0);
spacefb_port_1_w(space, 0, 0);
diff --git a/src/mame/drivers/spaceg.c b/src/mame/drivers/spaceg.c
index 9dde81381fc..6eb0762d284 100644
--- a/src/mame/drivers/spaceg.c
+++ b/src/mame/drivers/spaceg.c
@@ -220,7 +220,7 @@ static PALETTE_INIT( spaceg )
static WRITE8_HANDLER( zvideoram_w )
{
- spaceg_state *state = space->machine->driver_data<spaceg_state>();
+ spaceg_state *state = space->machine().driver_data<spaceg_state>();
int col = state->colorram[0x400];
int xoff = *state->io9400 >> 5 & 7;
UINT16 offset2 = (offset + 0x100) & 0x1fff;
@@ -262,7 +262,7 @@ static WRITE8_HANDLER( zvideoram_w )
static READ8_HANDLER(spaceg_colorram_r)
{
- spaceg_state *state = space->machine->driver_data<spaceg_state>();
+ spaceg_state *state = space->machine().driver_data<spaceg_state>();
int rgbcolor;
if (offset < 0x400)
@@ -273,13 +273,13 @@ static READ8_HANDLER(spaceg_colorram_r)
{
/* palette 1 */
int col_ind = offset & 0x1f;
- palette_set_color_rgb(space->machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
+ palette_set_color_rgb(space->machine(), 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
}
else if ((offset >= 0x300) && (offset < 0x320)) /* 0xa300- 0xa31f */
{
/* palette 2 */
int col_ind = offset & 0x1f;
- palette_set_color_rgb(space->machine, 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
+ palette_set_color_rgb(space->machine(), 0x10 + 0x00 + col_ind, pal3bit(rgbcolor >> 0), pal3bit(rgbcolor >> 6), pal3bit(rgbcolor >> 3));
}
else
logerror("palette? read from colorram offset = %04x\n",offset);
@@ -294,7 +294,7 @@ static READ8_HANDLER(spaceg_colorram_r)
static SCREEN_UPDATE( spaceg )
{
- spaceg_state *state = screen->machine->driver_data<spaceg_state>();
+ spaceg_state *state = screen->machine().driver_data<spaceg_state>();
offs_t offs;
for (offs = 0; offs < 0x2000; offs++)
diff --git a/src/mame/drivers/spbactn.c b/src/mame/drivers/spbactn.c
index c6414343865..5fa8092b47a 100644
--- a/src/mame/drivers/spbactn.c
+++ b/src/mame/drivers/spbactn.c
@@ -136,7 +136,7 @@ static WRITE16_HANDLER( soundcommand_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -325,7 +325,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/spcforce.c b/src/mame/drivers/spcforce.c
index 50bc787650f..ec1a37fb395 100644
--- a/src/mame/drivers/spcforce.c
+++ b/src/mame/drivers/spcforce.c
@@ -40,43 +40,43 @@ a000-a3ff R/W X/Y scroll position of each character (can be scrolled up
static WRITE8_HANDLER( spcforce_SN76496_latch_w )
{
- spcforce_state *state = space->machine->driver_data<spcforce_state>();
+ spcforce_state *state = space->machine().driver_data<spcforce_state>();
state->sn76496_latch = data;
}
static READ8_HANDLER( spcforce_SN76496_select_r )
{
- spcforce_state *state = space->machine->driver_data<spcforce_state>();
+ spcforce_state *state = space->machine().driver_data<spcforce_state>();
- if (~state->sn76496_select & 0x40) return sn76496_ready_r(space->machine->device("sn1"));
- if (~state->sn76496_select & 0x20) return sn76496_ready_r(space->machine->device("sn2"));
- if (~state->sn76496_select & 0x10) return sn76496_ready_r(space->machine->device("sn3"));
+ if (~state->sn76496_select & 0x40) return sn76496_ready_r(space->machine().device("sn1"));
+ if (~state->sn76496_select & 0x20) return sn76496_ready_r(space->machine().device("sn2"));
+ if (~state->sn76496_select & 0x10) return sn76496_ready_r(space->machine().device("sn3"));
return 0;
}
static WRITE8_HANDLER( spcforce_SN76496_select_w )
{
- spcforce_state *state = space->machine->driver_data<spcforce_state>();
+ spcforce_state *state = space->machine().driver_data<spcforce_state>();
state->sn76496_select = data;
- if (~data & 0x40) sn76496_w(space->machine->device("sn1"), 0, state->sn76496_latch);
- if (~data & 0x20) sn76496_w(space->machine->device("sn2"), 0, state->sn76496_latch);
- if (~data & 0x10) sn76496_w(space->machine->device("sn3"), 0, state->sn76496_latch);
+ if (~data & 0x40) sn76496_w(space->machine().device("sn1"), 0, state->sn76496_latch);
+ if (~data & 0x20) sn76496_w(space->machine().device("sn2"), 0, state->sn76496_latch);
+ if (~data & 0x10) sn76496_w(space->machine().device("sn3"), 0, state->sn76496_latch);
}
static READ8_HANDLER( spcforce_t0_r )
{
/* SN76496 status according to Al - not supported by MAME?? */
- return space->machine->rand() & 1;
+ return space->machine().rand() & 1;
}
static WRITE8_HANDLER( spcforce_soundtrigger_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 67c1b2f004b..316d8d0b284 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -33,14 +33,14 @@ Notes:
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( spd_adpcm_w )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
int chip = offset & 1;
- device_t *adpcm = space->machine->device((chip == 0) ? "msm1" : "msm2");
+ device_t *adpcm = space->machine().device((chip == 0) ? "msm1" : "msm2");
switch (offset/2)
{
@@ -66,7 +66,7 @@ static WRITE8_HANDLER( spd_adpcm_w )
static void spd_adpcm_int(device_t *device)
{
- spdodgeb_state *state = device->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = device->machine().driver_data<spdodgeb_state>();
int chip = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
if (state->adpcm_pos[chip] >= state->adpcm_end[chip] || state->adpcm_pos[chip] >= 0x10000)
{
@@ -80,7 +80,7 @@ static void spd_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
state->adpcm_data[chip] = ROM[state->adpcm_pos[chip]++];
msm5205_data_w(device,state->adpcm_data[chip] >> 4);
@@ -89,9 +89,9 @@ static void spd_adpcm_int(device_t *device)
#if 0 // default - more sensitive (state change and timing measured on real board?)
-static void mcu63705_update_inputs(running_machine *machine)
+static void mcu63705_update_inputs(running_machine &machine)
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
int buttons[2];
int p,j;
@@ -152,9 +152,9 @@ static void mcu63705_update_inputs(running_machine *machine)
state->inputs[3] = state->running[1] | buttons[1];
}
#else // alternate - less sensitive
-static void mcu63705_update_inputs(running_machine *machine)
+static void mcu63705_update_inputs(running_machine &machine)
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
#define DBLTAP_TOLERANCE 5
#define R 0x01
@@ -213,7 +213,7 @@ static void mcu63705_update_inputs(running_machine *machine)
static READ8_HANDLER( mcu63701_r )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
// logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",cpu_get_pc(space->cpu),offset);
if (state->mcu63701_command == 0) return 0x6a;
@@ -224,23 +224,23 @@ static READ8_HANDLER( mcu63701_r )
case 1: return state->inputs[1];
case 2: return state->inputs[2];
case 3: return state->inputs[3];
- case 4: return input_port_read(space->machine, "IN1");
+ case 4: return input_port_read(space->machine(), "IN1");
}
}
static WRITE8_HANDLER( mcu63701_w )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",cpu_get_pc(space->cpu),data);
state->mcu63701_command = data;
- mcu63705_update_inputs(space->machine);
+ mcu63705_update_inputs(space->machine());
}
static READ8_HANDLER( port_0_r )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
- int port = input_port_read(space->machine, "IN0");
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
+ int port = input_port_read(space->machine(), "IN0");
state->toggle^=0x02; /* mcu63701_busy flag */
@@ -384,7 +384,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym3812_interface ym3812_config =
@@ -401,7 +401,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_RESET( spdodgeb )
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
state->toggle = 0;
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
state->adpcm_end[0] = state->adpcm_end[1] = 0;
diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c
index fc6dc7df921..5b5eaf4c8e1 100644
--- a/src/mame/drivers/speedatk.c
+++ b/src/mame/drivers/speedatk.c
@@ -82,7 +82,7 @@ PS / PD : key matrix
#define MASTER_CLOCK XTAL_12MHz
-static UINT8 iox_key_matrix_calc(running_machine *machine, UINT8 p_side)
+static UINT8 iox_key_matrix_calc(running_machine &machine, UINT8 p_side)
{
static const char *const keynames[] = { "P1_ROW0", "P1_ROW1", "P2_ROW0", "P2_ROW1" };
@@ -106,7 +106,7 @@ static UINT8 iox_key_matrix_calc(running_machine *machine, UINT8 p_side)
static READ8_HANDLER( key_matrix_r )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
if(state->coin_impulse > 0)
{
@@ -114,7 +114,7 @@ static READ8_HANDLER( key_matrix_r )
return 0x80;
}
- if((input_port_read(space->machine,"COINS") & 1) || (input_port_read(space->machine,"COINS") & 2))
+ if((input_port_read(space->machine(),"COINS") & 1) || (input_port_read(space->machine(),"COINS") & 2))
{
state->coin_impulse = state->coin_settings;
state->coin_impulse--;
@@ -127,8 +127,8 @@ static READ8_HANDLER( key_matrix_r )
/* both side checks */
if(state->mux_data == 1)
{
- UINT8 p1_side = iox_key_matrix_calc(space->machine,0);
- UINT8 p2_side = iox_key_matrix_calc(space->machine,2);
+ UINT8 p1_side = iox_key_matrix_calc(space->machine(),0);
+ UINT8 p2_side = iox_key_matrix_calc(space->machine(),2);
if(p1_side != 0)
return p1_side;
@@ -137,12 +137,12 @@ static READ8_HANDLER( key_matrix_r )
}
/* check individual input side */
- return iox_key_matrix_calc(space->machine,(state->mux_data == 2) ? 0 : 2);
+ return iox_key_matrix_calc(space->machine(),(state->mux_data == 2) ? 0 : 2);
}
static WRITE8_HANDLER( key_matrix_w )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
state->mux_data = data;
}
@@ -150,7 +150,7 @@ static WRITE8_HANDLER( key_matrix_w )
/* Key matrix status,used for coin settings and I don't know what else... */
static READ8_HANDLER( key_matrix_status_r )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
/* bit 0: busy flag,active low */
return (state->km_status & 0xfe) | 1;
@@ -169,7 +169,7 @@ a1
*/
static WRITE8_HANDLER( key_matrix_status_w )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
state->km_status = data;
if((state->km_status & 0xf0) == 0x80) //coinage setting command
@@ -307,7 +307,7 @@ static const mc6845_interface mc6845_intf =
static WRITE8_DEVICE_HANDLER( speedatk_output_w )
{
- speedatk_state *state = device->machine->driver_data<speedatk_state>();
+ speedatk_state *state = device->machine().driver_data<speedatk_state>();
state->flip_scr = data & 0x80;
diff --git a/src/mame/drivers/speedbal.c b/src/mame/drivers/speedbal.c
index 1217217df72..1c821d6a81a 100644
--- a/src/mame/drivers/speedbal.c
+++ b/src/mame/drivers/speedbal.c
@@ -59,9 +59,9 @@ c1 ??
static WRITE8_HANDLER( speedbal_coincounter_w )
{
- coin_counter_w(space->machine, 0, data & 0x80);
- coin_counter_w(space->machine, 1, data & 0x40);
- flip_screen_set(space->machine, data & 8); // also changes data & 0x10 at the same time too (flipx and flipy?)
+ coin_counter_w(space->machine(), 0, data & 0x80);
+ coin_counter_w(space->machine(), 1, data & 0x40);
+ flip_screen_set(space->machine(), data & 8); // also changes data & 0x10 at the same time too (flipx and flipy?)
/* unknown: (data & 0x10) and (data & 4) */
}
diff --git a/src/mame/drivers/speedspn.c b/src/mame/drivers/speedspn.c
index 70b7daca189..3d116fb5b44 100644
--- a/src/mame/drivers/speedspn.c
+++ b/src/mame/drivers/speedspn.c
@@ -66,7 +66,7 @@ static WRITE8_HANDLER(speedspn_banked_rom_change)
{
/* is this weird banking some form of protection? */
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
int addr;
switch (data)
@@ -86,7 +86,7 @@ static WRITE8_HANDLER(speedspn_banked_rom_change)
break;
}
- memory_set_bankptr(space->machine, "bank1",&rom[addr + 0x8000]);
+ memory_set_bankptr(space->machine(), "bank1",&rom[addr + 0x8000]);
}
/*** SOUND RELATED ***********************************************************/
@@ -94,7 +94,7 @@ static WRITE8_HANDLER(speedspn_banked_rom_change)
static WRITE8_HANDLER(speedspn_sound_w)
{
soundlatch_w(space, 1, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static WRITE8_DEVICE_HANDLER( oki_banking_w )
diff --git a/src/mame/drivers/speglsht.c b/src/mame/drivers/speglsht.c
index 091a581f2e4..00c2aecd44c 100644
--- a/src/mame/drivers/speglsht.c
+++ b/src/mame/drivers/speglsht.c
@@ -151,26 +151,26 @@ ADDRESS_MAP_END
static READ32_HANDLER(shared_r)
{
- speglsht_state *state = space->machine->driver_data<speglsht_state>();
+ speglsht_state *state = space->machine().driver_data<speglsht_state>();
return state->shared[offset];
}
static WRITE32_HANDLER(shared_w)
{
- speglsht_state *state = space->machine->driver_data<speglsht_state>();
+ speglsht_state *state = space->machine().driver_data<speglsht_state>();
state->shared[offset]=data&0xff;
}
static WRITE32_HANDLER(videoreg_w)
{
- speglsht_state *state = space->machine->driver_data<speglsht_state>();
+ speglsht_state *state = space->machine().driver_data<speglsht_state>();
COMBINE_DATA(&state->videoreg);
}
static WRITE32_HANDLER(cop_w)
{
- speglsht_state *state = space->machine->driver_data<speglsht_state>();
+ speglsht_state *state = space->machine().driver_data<speglsht_state>();
COMBINE_DATA(&state->cop_ram[offset]);
if(state->cop_ram[offset]&0x8000) //fix (sign)
@@ -182,7 +182,7 @@ static WRITE32_HANDLER(cop_w)
//matrix * vector
static READ32_HANDLER(cop_r)
{
- speglsht_state *state = space->machine->driver_data<speglsht_state>();
+ speglsht_state *state = space->machine().driver_data<speglsht_state>();
INT32 *cop=(INT32*)&state->cop_ram[0];
union
@@ -217,7 +217,7 @@ static READ32_HANDLER(cop_r)
static READ32_HANDLER(irq_ack_clear)
{
- cputag_set_input_line(space->machine, "sub", R3000_IRQ4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", R3000_IRQ4, CLEAR_LINE);
return 0;
}
@@ -329,13 +329,13 @@ static const r3000_cpu_core r3000_config =
static MACHINE_RESET(speglsht)
{
- speglsht_state *state = machine->driver_data<speglsht_state>();
+ speglsht_state *state = machine.driver_data<speglsht_state>();
memset(state->shared,0,0x1000);
}
static VIDEO_START(speglsht)
{
- speglsht_state *state = machine->driver_data<speglsht_state>();
+ speglsht_state *state = machine.driver_data<speglsht_state>();
state->bitmap = auto_bitmap_alloc(machine, 512, 5122, BITMAP_FORMAT_INDEXED16 );
VIDEO_START_CALL(st0016);
}
@@ -347,7 +347,7 @@ static VIDEO_START(speglsht)
static SCREEN_UPDATE(speglsht)
{
- speglsht_state *state = screen->machine->driver_data<speglsht_state>();
+ speglsht_state *state = screen->machine().driver_data<speglsht_state>();
int x,y,dy;
dy=(state->videoreg&0x20)?(256*512):0; //visible frame
@@ -373,7 +373,7 @@ static SCREEN_UPDATE(speglsht)
{
if(srcline[x])
{
- rgb_t color=palette_get_color(screen->machine, srcline[x]);
+ rgb_t color=palette_get_color(screen->machine(), srcline[x]);
PLOT_PIXEL_RGB(x,y,RGB_RED(color),RGB_GREEN(color),RGB_BLUE(color));
}
}
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index 9463c941675..dc535f79b46 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -223,26 +223,26 @@ static READ8_DEVICE_HANDLER( gfx_rom_r );
static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
{
- device_t *pia1 = device->machine->device("pia1");
- device_t *pia2 = device->machine->device("pia2");
- device_t *pia3 = device->machine->device("pia3");
+ device_t *pia1 = device->machine().device("pia1");
+ device_t *pia2 = device->machine().device("pia2");
+ device_t *pia3 = device->machine().device("pia3");
int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) |
pia6821_get_irq_b(pia2) |
pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3);
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( main_cpu_firq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( audio_cpu_irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6800_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6800_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -271,17 +271,17 @@ static const pia6821_interface pia_1_intf =
static INTERRUPT_GEN( update_pia_1 )
{
- device_t *pia1 = device->machine->device("pia1");
+ device_t *pia1 = device->machine().device("pia1");
/* update the different PIA pins from the input ports */
/* CA1 - copy of PA1 (COIN1) */
- pia6821_ca1_w(pia1, input_port_read(device->machine, "IN0") & 0x02);
+ pia6821_ca1_w(pia1, input_port_read(device->machine(), "IN0") & 0x02);
/* CA2 - copy of PA0 (SERVICE1) */
- pia6821_ca2_w(pia1, input_port_read(device->machine, "IN0") & 0x01);
+ pia6821_ca2_w(pia1, input_port_read(device->machine(), "IN0") & 0x01);
/* CB1 - (crosshatch) */
- pia6821_cb1_w(pia1, input_port_read(device->machine, "XHATCH"));
+ pia6821_cb1_w(pia1, input_port_read(device->machine(), "XHATCH"));
/* CB2 - NOT CONNECTED */
}
@@ -374,7 +374,7 @@ static const pia6821_interface pia_4_intf =
static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed)
{
- device_t *pia2 = device->machine->device("pia2");
+ device_t *pia2 = device->machine().device("pia2");
pia6821_ca1_w(pia2, data);
}
@@ -400,7 +400,7 @@ static const ttl74123_interface ic60_intf =
static MACHINE_START( spiders )
{
- spiders_state *state = machine->driver_data<spiders_state>();
+ spiders_state *state = machine.driver_data<spiders_state>();
/* setup for save states */
state_save_register_global(machine, state->flipscreen);
state_save_register_global(machine, state->gfx_rom_address);
@@ -420,14 +420,14 @@ static MACHINE_START( spiders )
static WRITE_LINE_DEVICE_HANDLER( flipscreen_w )
{
- spiders_state *drvstate = device->machine->driver_data<spiders_state>();
+ spiders_state *drvstate = device->machine().driver_data<spiders_state>();
drvstate->flipscreen = state;
}
static MC6845_BEGIN_UPDATE( begin_update )
{
- spiders_state *state = device->machine->driver_data<spiders_state>();
+ spiders_state *state = device->machine().driver_data<spiders_state>();
/* create the pens */
offs_t i;
@@ -442,7 +442,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- spiders_state *state = device->machine->driver_data<spiders_state>();
+ spiders_state *state = device->machine().driver_data<spiders_state>();
UINT8 cx;
pen_t *pens = (pen_t *)param;
@@ -502,7 +502,7 @@ static MC6845_UPDATE_ROW( update_row )
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
{
- ttl74123_a_w(device->machine->device("ic60"), 0, state);
+ ttl74123_a_w(device->machine().device("ic60"), 0, state);
}
@@ -523,7 +523,7 @@ static const mc6845_interface mc6845_intf =
static SCREEN_UPDATE( spiders )
{
- device_t *mc6845 = screen->machine->device("crtc");
+ device_t *mc6845 = screen->machine().device("crtc");
mc6845_update(mc6845, bitmap, cliprect);
return 0;
@@ -540,7 +540,7 @@ static SCREEN_UPDATE( spiders )
static WRITE8_DEVICE_HANDLER( gfx_rom_intf_w )
{
- spiders_state *state = device->machine->driver_data<spiders_state>();
+ spiders_state *state = device->machine().driver_data<spiders_state>();
state->gfx_rom_ctrl_mode = ( data >> 7) & 0x01;
state->gfx_rom_ctrl_latch = ( data >> 4) & 0x03;
state->gfx_rom_ctrl_data = (~data >> 0) & 0x0f;
@@ -549,12 +549,12 @@ static WRITE8_DEVICE_HANDLER( gfx_rom_intf_w )
static READ8_DEVICE_HANDLER( gfx_rom_r )
{
- spiders_state *state = device->machine->driver_data<spiders_state>();
+ spiders_state *state = device->machine().driver_data<spiders_state>();
UINT8 ret;
if (state->gfx_rom_ctrl_mode)
{
- UINT8 *rom = device->machine->region("gfx1")->base();
+ UINT8 *rom = device->machine().region("gfx1")->base();
ret = rom[state->gfx_rom_address];
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index bab5dd4dadb..284fceb3e38 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -54,7 +54,7 @@ static WRITE16_HANDLER( splash_sh_irqtrigger_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
@@ -63,7 +63,7 @@ static WRITE16_HANDLER( roldf_sh_irqtrigger_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
// give the z80 time to see it
@@ -78,11 +78,11 @@ static WRITE16_HANDLER( splash_coin_w )
{
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w( space->machine, (offset >> 3) & 0x01, (data & 0x0400) >> 8);
+ coin_lockout_w( space->machine(), (offset >> 3) & 0x01, (data & 0x0400) >> 8);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w( space->machine, (offset >> 3) & 0x01, (data & 0x0100) >> 8);
+ coin_counter_w( space->machine(), (offset >> 3) & 0x01, (data & 0x0100) >> 8);
break;
}
}
@@ -107,14 +107,14 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( splash_adpcm_data_w )
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->adpcm_data = data;
}
static void splash_msm5205_int(device_t *device)
{
- splash_state *state = device->machine->driver_data<splash_state>();
+ splash_state *state = device->machine().driver_data<splash_state>();
msm5205_data_w(device, state->adpcm_data >> 4);
state->adpcm_data = (state->adpcm_data << 4) & 0xf0;
@@ -134,7 +134,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( roldfrog_bombs_r )
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->ret ^= 0x100;
return state->ret;
@@ -142,30 +142,30 @@ static READ16_HANDLER( roldfrog_bombs_r )
static WRITE8_HANDLER(sound_bank_w)
{
- memory_set_bank(space->machine, "sound_bank", data & 0xf);
+ memory_set_bank(space->machine(), "sound_bank", data & 0xf);
}
-static void roldfrog_update_irq( running_machine *machine )
+static void roldfrog_update_irq( running_machine &machine )
{
- splash_state * state = machine->driver_data<splash_state>();
+ splash_state * state = machine.driver_data<splash_state>();
int irq = (state->sound_irq ? 0x08 : 0) | ((state->vblank_irq) ? 0x18 : 0);
- device_set_input_line_and_vector(machine->device("audiocpu"), 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq);
+ device_set_input_line_and_vector(machine.device("audiocpu"), 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq);
}
static WRITE8_HANDLER( roldfrog_vblank_ack_w )
{
- splash_state * driver_state = space->machine->driver_data<splash_state>();
+ splash_state * driver_state = space->machine().driver_data<splash_state>();
driver_state->vblank_irq = 0;
- roldfrog_update_irq(space->machine);
+ roldfrog_update_irq(space->machine());
}
static void ym_irq(device_t *device, int state)
{
- splash_state * driver_state = device->machine->driver_data<splash_state>();
+ splash_state * driver_state = device->machine().driver_data<splash_state>();
driver_state->sound_irq = state;
- roldfrog_update_irq(device->machine);
+ roldfrog_update_irq(device->machine());
}
static ADDRESS_MAP_START( roldfrog_map, AS_PROGRAM, 16 )
@@ -214,13 +214,13 @@ ADDRESS_MAP_END
static READ16_HANDLER(spr_read)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
return state->spriteram[offset]|0xff00;
}
static WRITE16_HANDLER(spr_write)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
COMBINE_DATA(&state->spriteram[offset]);
state->spriteram[offset]|=0xff00; /* 8 bit, expected 0xffnn when read as 16 bit */
}
@@ -228,7 +228,7 @@ static WRITE16_HANDLER(spr_write)
static WRITE16_HANDLER( funystrp_sh_irqtrigger_w )
{
soundlatch_w(space, 0, data>>8);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( funystrp_map, AS_PROGRAM, 16 )
@@ -258,13 +258,13 @@ ADDRESS_MAP_END
static READ8_HANDLER(int_source_r)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
return ~state->msm_source;
}
static WRITE8_HANDLER(msm1_data_w)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->msm_data1=data;
state->msm_source&=~1;
state->msm_toggle1=0;
@@ -272,19 +272,19 @@ static WRITE8_HANDLER(msm1_data_w)
static WRITE8_HANDLER(msm1_interrupt_w)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->snd_interrupt_enable1=~data;
}
static WRITE8_HANDLER(msm2_interrupt_w)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->snd_interrupt_enable2=~data;
}
static WRITE8_HANDLER(msm2_data_w)
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
state->msm_data2=data;
state->msm_source&=~2;
state->msm_toggle2=0;
@@ -303,7 +303,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( funystrp )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
state->adpcm_data = 0;
state->ret = 0x100;
@@ -497,7 +497,7 @@ static const msm5205_interface splash_msm5205_interface =
static MACHINE_RESET( splash )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
state->adpcm_data = 0;
state->ret = 0x100;
@@ -555,9 +555,9 @@ static const ym2203_interface ym2203_config =
static INTERRUPT_GEN( roldfrog_interrupt )
{
- splash_state *state = device->machine->driver_data<splash_state>();
+ splash_state *state = device->machine().driver_data<splash_state>();
state->vblank_irq = 1;
- roldfrog_update_irq(device->machine);
+ roldfrog_update_irq(device->machine());
}
static MACHINE_CONFIG_START( roldfrog, splash_state )
@@ -603,7 +603,7 @@ MACHINE_CONFIG_END
static void adpcm_int1( device_t *device )
{
- splash_state *state = device->machine->driver_data<splash_state>();
+ splash_state *state = device->machine().driver_data<splash_state>();
if (state->snd_interrupt_enable1 || state->msm_toggle1 == 1)
{
msm5205_data_w(device, state->msm_data1 >> 4);
@@ -612,14 +612,14 @@ static void adpcm_int1( device_t *device )
if (state->msm_toggle1 == 0)
{
state->msm_source|=1;
- device_set_input_line_and_vector(device->machine->device("audiocpu"), 0, HOLD_LINE, 0x38);
+ device_set_input_line_and_vector(device->machine().device("audiocpu"), 0, HOLD_LINE, 0x38);
}
}
}
static void adpcm_int2( device_t *device )
{
- splash_state *state = device->machine->driver_data<splash_state>();
+ splash_state *state = device->machine().driver_data<splash_state>();
if (state->snd_interrupt_enable2 || state->msm_toggle2 == 1)
{
msm5205_data_w(device, state->msm_data2 >> 4);
@@ -628,7 +628,7 @@ static void adpcm_int2( device_t *device )
if (state->msm_toggle2 == 0)
{
state->msm_source|=2;
- device_set_input_line_and_vector(device->machine->device("audiocpu"), 0, HOLD_LINE, 0x38);
+ device_set_input_line_and_vector(device->machine().device("audiocpu"), 0, HOLD_LINE, 0x38);
}
}
}
@@ -1012,7 +1012,7 @@ ROM_END
static DRIVER_INIT( splash )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
state->bitmap_type = 0;
state->sprite_attr2_shift = 8;
@@ -1020,7 +1020,7 @@ static DRIVER_INIT( splash )
static DRIVER_INIT( splash10 )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
state->bitmap_type = 0;
state->sprite_attr2_shift = 0;
@@ -1028,8 +1028,8 @@ static DRIVER_INIT( splash10 )
static DRIVER_INIT( roldfrog )
{
- splash_state *state = machine->driver_data<splash_state>();
- UINT8 * ROM = (UINT8 *)machine->region("audiocpu")->base();
+ splash_state *state = machine.driver_data<splash_state>();
+ UINT8 * ROM = (UINT8 *)machine.region("audiocpu")->base();
memory_configure_bank(machine, "sound_bank", 0, 16, &ROM[0x10000], 0x8000);
state->bitmap_type = 1;
@@ -1038,8 +1038,8 @@ static DRIVER_INIT( roldfrog )
static DRIVER_INIT( rebus )
{
- splash_state *state = machine->driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ splash_state *state = machine.driver_data<splash_state>();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
state->bitmap_type = 1;
state->sprite_attr2_shift = 0;
@@ -1068,8 +1068,8 @@ static DRIVER_INIT( rebus )
static DRIVER_INIT( funystrp )
{
- splash_state *state = machine->driver_data<splash_state>();
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ splash_state *state = machine.driver_data<splash_state>();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
state->bitmap_type = 0;
state->sprite_attr2_shift = 0;
@@ -1108,7 +1108,7 @@ static DRIVER_INIT( funystrp )
ROM[0x11730/2] = 0x7001;
ROM[0x11f80/2] = 0x7001;
- ROM = (UINT16 *)machine->region("audiocpu")->base();
+ ROM = (UINT16 *)machine.region("audiocpu")->base();
memory_configure_bank(machine, "sound_bank", 0, 16, &ROM[0x00000], 0x8000);
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index b82c09b8188..9f425e7e85b 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -40,7 +40,7 @@ public:
static WRITE8_HANDLER( bg_tile_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
state->bg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -48,21 +48,21 @@ static WRITE8_HANDLER( bg_tile_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- spoker_state *state = machine->driver_data<spoker_state>();
+ spoker_state *state = machine.driver_data<spoker_state>();
int code = state->bg_tile_ram[tile_index];
SET_TILE_INFO(1 + (tile_index & 3), code & 0xff, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- spoker_state *state = machine->driver_data<spoker_state>();
+ spoker_state *state = machine.driver_data<spoker_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
SET_TILE_INFO(0, code, (4*(code >> 14)+3), 0);
}
static WRITE8_HANDLER( fg_tile_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -70,7 +70,7 @@ static WRITE8_HANDLER( fg_tile_w )
static WRITE8_HANDLER( fg_color_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -78,7 +78,7 @@ static WRITE8_HANDLER( fg_color_w )
static VIDEO_START(spoker)
{
- spoker_state *state = machine->driver_data<spoker_state>();
+ spoker_state *state = machine.driver_data<spoker_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 128, 8);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 128, 32);
@@ -87,9 +87,9 @@ static VIDEO_START(spoker)
static SCREEN_UPDATE(spoker)
{
- spoker_state *state = screen->machine->driver_data<spoker_state>();
+ spoker_state *state = screen->machine().driver_data<spoker_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -101,10 +101,10 @@ static SCREEN_UPDATE(spoker)
static CUSTOM_INPUT( hopper_r )
{
- running_machine *machine = field->port->machine;
- spoker_state *state = machine->driver_data<spoker_state>();
+ running_machine &machine = field->port->machine();
+ spoker_state *state = machine.driver_data<spoker_state>();
- if (state->hopper) return !(machine->primary_screen->frame_number()%10);
+ if (state->hopper) return !(machine.primary_screen->frame_number()%10);
return input_code_pressed(machine, KEYCODE_H);
}
@@ -117,7 +117,7 @@ static void show_out(UINT8 *out)
static WRITE8_HANDLER( spoker_nmi_and_coins_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
if ((state->nmi_enable ^ data) & (~0xdd))
{
@@ -125,12 +125,12 @@ static WRITE8_HANDLER( spoker_nmi_and_coins_w )
// popmessage("%02x",data);
}
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin out mech
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin out mech
- set_led_status(space->machine, 6, data & 0x40); // led for coin out / hopper active
+ set_led_status(space->machine(), 6, data & 0x40); // led for coin out / hopper active
state->nmi_enable = data; // data & 0x80 // nmi enable?
@@ -140,10 +140,10 @@ static WRITE8_HANDLER( spoker_nmi_and_coins_w )
static WRITE8_HANDLER( spoker_video_and_leds_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
- set_led_status(space->machine, 4, data & 0x01); // start?
- set_led_status(space->machine, 5, data & 0x04); // l_bet?
+ set_led_status(space->machine(), 4, data & 0x01); // start?
+ set_led_status(space->machine(), 5, data & 0x04); // l_bet?
state->video_enable = data & 0x40;
state->hopper = (~data)& 0x80;
@@ -154,12 +154,12 @@ static WRITE8_HANDLER( spoker_video_and_leds_w )
static WRITE8_HANDLER( spoker_leds_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
- set_led_status(space->machine, 0, data & 0x01); // stop_1
- set_led_status(space->machine, 1, data & 0x02); // stop_2
- set_led_status(space->machine, 2, data & 0x04); // stop_3
- set_led_status(space->machine, 3, data & 0x08); // stop
+ set_led_status(space->machine(), 0, data & 0x01); // stop_1
+ set_led_status(space->machine(), 1, data & 0x02); // stop_2
+ set_led_status(space->machine(), 2, data & 0x04); // stop_3
+ set_led_status(space->machine(), 3, data & 0x08); // stop
// data & 0x10?
state->out[2] = data;
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( spoker_leds_w )
static WRITE8_HANDLER( spoker_magic_w )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
state->igs_magic[offset] = data;
@@ -188,16 +188,16 @@ static WRITE8_HANDLER( spoker_magic_w )
static READ8_HANDLER( spoker_magic_r )
{
- spoker_state *state = space->machine->driver_data<spoker_state>();
+ spoker_state *state = space->machine().driver_data<spoker_state>();
switch(state->igs_magic[0])
{
case 0x00:
- if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine, "DSW1");
- if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine, "DSW2");
- if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine, "DSW3");
- if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine, "DSW4");
- if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine, "DSW5");
+ if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine(), "DSW1");
+ if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine(), "DSW2");
+ if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine(), "DSW3");
+ if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine(), "DSW4");
+ if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine(), "DSW5");
logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(space->cpu), state->igs_magic[1]);
break;
@@ -370,7 +370,7 @@ GFXDECODE_END
static MACHINE_RESET( spoker )
{
- spoker_state *state = machine->driver_data<spoker_state>();
+ spoker_state *state = machine.driver_data<spoker_state>();
state->nmi_enable = 0;
state->hopper = 0;
@@ -379,7 +379,7 @@ static MACHINE_RESET( spoker )
static INTERRUPT_GEN( spoker_interrupt )
{
- spoker_state *state = device->machine->driver_data<spoker_state>();
+ spoker_state *state = device->machine().driver_data<spoker_state>();
if (state->nmi_enable & 0x80)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -424,7 +424,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( spk116it )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c
index 60b5d81d170..ca1142274f0 100644
--- a/src/mame/drivers/spool99.c
+++ b/src/mame/drivers/spool99.c
@@ -108,7 +108,7 @@ public:
static TILE_GET_INFO( get_spool99_tile_info )
{
- spool99_state *state = machine->driver_data<spool99_state>();
+ spool99_state *state = machine.driver_data<spool99_state>();
int code = ((state->vram[tile_index*2+1]<<8) | (state->vram[tile_index*2+0]));
int color = state->cram[tile_index*2+0];
@@ -121,14 +121,14 @@ static TILE_GET_INFO( get_spool99_tile_info )
static VIDEO_START(spool99)
{
- spool99_state *state = machine->driver_data<spool99_state>();
+ spool99_state *state = machine.driver_data<spool99_state>();
state->sc0_tilemap = tilemap_create(machine, get_spool99_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static SCREEN_UPDATE(spool99)
{
- spool99_state *state = screen->machine->driver_data<spool99_state>();
+ spool99_state *state = screen->machine().driver_data<spool99_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
return 0;
@@ -136,7 +136,7 @@ static SCREEN_UPDATE(spool99)
static WRITE8_HANDLER( spool99_vram_w )
{
- spool99_state *state = space->machine->driver_data<spool99_state>();
+ spool99_state *state = space->machine().driver_data<spool99_state>();
state->vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset/2);
@@ -144,7 +144,7 @@ static WRITE8_HANDLER( spool99_vram_w )
static WRITE8_HANDLER( spool99_cram_w )
{
- spool99_state *state = space->machine->driver_data<spool99_state>();
+ spool99_state *state = space->machine().driver_data<spool99_state>();
state->cram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset/2);
@@ -154,29 +154,29 @@ static WRITE8_HANDLER( spool99_cram_w )
static READ8_HANDLER( spool99_io_r )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
// if(!(io_switch))
{
switch(offset+0xaf00)
{
- case 0xafd8: return input_port_read(space->machine,"COIN1");
+ case 0xafd8: return input_port_read(space->machine(),"COIN1");
// case 0xafd9: return 1;
- case 0xafda: return input_port_read(space->machine,"COIN2");
+ case 0xafda: return input_port_read(space->machine(),"COIN2");
case 0xafdb: return 1;
- case 0xafdc: return input_port_read(space->machine,"SERVICE1");//attract mode
- case 0xafdd: return input_port_read(space->machine,"HOLD3");
- case 0xafde: return input_port_read(space->machine,"HOLD4");
- case 0xafdf: return input_port_read(space->machine,"HOLD2");
- case 0xafe0: return input_port_read(space->machine,"HOLD1");
- case 0xafe1: return input_port_read(space->machine,"HOLD5");
- case 0xafe2: return input_port_read(space->machine,"START");
- case 0xafe3: return input_port_read(space->machine,"BET");//system 2
- case 0xafe4: return input_port_read(space->machine,"SERVICE2");//attract mode
+ case 0xafdc: return input_port_read(space->machine(),"SERVICE1");//attract mode
+ case 0xafdd: return input_port_read(space->machine(),"HOLD3");
+ case 0xafde: return input_port_read(space->machine(),"HOLD4");
+ case 0xafdf: return input_port_read(space->machine(),"HOLD2");
+ case 0xafe0: return input_port_read(space->machine(),"HOLD1");
+ case 0xafe1: return input_port_read(space->machine(),"HOLD5");
+ case 0xafe2: return input_port_read(space->machine(),"START");
+ case 0xafe3: return input_port_read(space->machine(),"BET");//system 2
+ case 0xafe4: return input_port_read(space->machine(),"SERVICE2");//attract mode
// case 0xafe5: return 1;
// case 0xafe6: return 1;
- case 0xafe7: return eeprom_read_bit(space->machine->device("eeprom"));
- case 0xaff8: return space->machine->device<okim6295_device>("oki")->read(*space,0);
+ case 0xafe7: return eeprom_read_bit(space->machine().device("eeprom"));
+ case 0xaff8: return space->machine().device<okim6295_device>("oki")->read(*space,0);
}
}
// printf("%04x %d\n",offset+0xaf00,io_switch);
@@ -221,26 +221,26 @@ ADDRESS_MAP_END
static READ8_HANDLER( vcarn_io_r )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
// if(!(io_switch))
{
switch(offset+0xa700)
{
- case 0xa720: return input_port_read(space->machine,"SERVICE1");//attract mode
- case 0xa722: return input_port_read(space->machine,"COIN1");
- case 0xa723: return input_port_read(space->machine,"COIN2");
- case 0xa724: return input_port_read(space->machine,"SERVICE2");//attract mode
- case 0xa725: return input_port_read(space->machine,"HOLD3");
- case 0xa726: return input_port_read(space->machine,"HOLD4");
- case 0xa727: return input_port_read(space->machine,"HOLD2");
- case 0xa780: return space->machine->device<okim6295_device>("oki")->read(*space,0);
- case 0xa7a0: return input_port_read(space->machine,"HOLD1");
- case 0xa7a1: return input_port_read(space->machine,"HOLD5");
- case 0xa7a2: return input_port_read(space->machine,"START");
- case 0xa7a3: return input_port_read(space->machine,"BET");//system 2
-
- case 0xa7a7: return eeprom_read_bit(space->machine->device("eeprom"));
+ case 0xa720: return input_port_read(space->machine(),"SERVICE1");//attract mode
+ case 0xa722: return input_port_read(space->machine(),"COIN1");
+ case 0xa723: return input_port_read(space->machine(),"COIN2");
+ case 0xa724: return input_port_read(space->machine(),"SERVICE2");//attract mode
+ case 0xa725: return input_port_read(space->machine(),"HOLD3");
+ case 0xa726: return input_port_read(space->machine(),"HOLD4");
+ case 0xa727: return input_port_read(space->machine(),"HOLD2");
+ case 0xa780: return space->machine().device<okim6295_device>("oki")->read(*space,0);
+ case 0xa7a0: return input_port_read(space->machine(),"HOLD1");
+ case 0xa7a1: return input_port_read(space->machine(),"HOLD5");
+ case 0xa7a2: return input_port_read(space->machine(),"START");
+ case 0xa7a3: return input_port_read(space->machine(),"BET");//system 2
+
+ case 0xa7a7: return eeprom_read_bit(space->machine().device("eeprom"));
}
}
@@ -410,9 +410,9 @@ ROM_END
static DRIVER_INIT( spool99 )
{
- spool99_state *state = machine->driver_data<spool99_state>();
+ spool99_state *state = machine.driver_data<spool99_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
// vram = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(state->main, ROM, 0x100);
}
diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c
index 104433bfb9e..3d861093dd7 100644
--- a/src/mame/drivers/sprcros2.c
+++ b/src/mame/drivers/sprcros2.c
@@ -65,8 +65,8 @@ Notes:
static WRITE8_HANDLER( sprcros2_m_port7_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
- UINT8 *RAM = space->machine->region("master")->base();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
+ UINT8 *RAM = space->machine().region("master")->base();
//76543210
//x------- unused
@@ -78,17 +78,17 @@ static WRITE8_HANDLER( sprcros2_m_port7_w )
//-------x nmi enable
if((state->m_port7^data)&0x40)
- memory_set_bankptr(space->machine, "bank1",&RAM[0x10000+((data&0x40)<<7)]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x10000+((data&0x40)<<7)]);
- tilemap_set_flip_all( space->machine,data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
+ tilemap_set_flip_all( space->machine(),data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
state->m_port7 = data;
}
static WRITE8_HANDLER( sprcros2_s_port3_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
- UINT8 *RAM = space->machine->region("slave")->base();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
+ UINT8 *RAM = space->machine().region("slave")->base();
//76543210
//xxxx---- unused
@@ -97,7 +97,7 @@ static WRITE8_HANDLER( sprcros2_s_port3_w )
//-------x nmi enable
if((state->s_port3^data)&0x08)
- memory_set_bankptr(space->machine, "bank2",&RAM[0x10000+((data&0x08)<<10)]);
+ memory_set_bankptr(space->machine(), "bank2",&RAM[0x10000+((data&0x08)<<10)]);
state->s_port3 = data;
}
@@ -233,7 +233,7 @@ GFXDECODE_END
static INTERRUPT_GEN( sprcros2_m_interrupt )
{
- sprcros2_state *state = device->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = device->machine().driver_data<sprcros2_state>();
if (cpu_getiloops(device) == 0)
{
@@ -249,7 +249,7 @@ static INTERRUPT_GEN( sprcros2_m_interrupt )
static INTERRUPT_GEN( sprcros2_s_interrupt )
{
- sprcros2_state *state = device->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = device->machine().driver_data<sprcros2_state>();
if(state->s_port3&0x01)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -257,7 +257,7 @@ static INTERRUPT_GEN( sprcros2_s_interrupt )
static MACHINE_START( sprcros2 )
{
- sprcros2_state *state = machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = machine.driver_data<sprcros2_state>();
state->save_item(NAME(state->m_port7));
state->save_item(NAME(state->s_port3));
diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c
index 23e65a0b400..f240a54b069 100644
--- a/src/mame/drivers/sprint2.c
+++ b/src/mame/drivers/sprint2.c
@@ -32,24 +32,24 @@
static DRIVER_INIT( sprint1 )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
state->game = 1;
}
static DRIVER_INIT( sprint2 )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
state->game = 2;
}
static DRIVER_INIT( dominos )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
state->game = 3;
}
-static int service_mode(running_machine *machine)
+static int service_mode(running_machine &machine)
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
UINT8 v = input_port_read(machine, "INB");
if (GAME_IS_SPRINT1)
@@ -71,8 +71,8 @@ static int service_mode(running_machine *machine)
static INTERRUPT_GEN( sprint2 )
{
- sprint2_state *state = device->machine->driver_data<sprint2_state>();
- device_t *discrete = device->machine->device("discrete");
+ sprint2_state *state = device->machine().driver_data<sprint2_state>();
+ device_t *discrete = device->machine().device("discrete");
/* handle steering wheels */
@@ -82,7 +82,7 @@ static INTERRUPT_GEN( sprint2 )
for (i = 0; i < 2; i++)
{
- signed char delta = input_port_read(device->machine, i ? "DIAL_P2" : "DIAL_P1") - state->dial[i];
+ signed char delta = input_port_read(device->machine(), i ? "DIAL_P2" : "DIAL_P1") - state->dial[i];
if (delta < 0)
{
@@ -95,7 +95,7 @@ static INTERRUPT_GEN( sprint2 )
state->dial[i] += delta;
- switch (input_port_read(device->machine, i ? "GEAR_P2" : "GEAR_P1") & 15)
+ switch (input_port_read(device->machine(), i ? "GEAR_P2" : "GEAR_P1") & 15)
{
case 1: state->gear[i] = 1; break;
case 2: state->gear[i] = 2; break;
@@ -111,30 +111,30 @@ static INTERRUPT_GEN( sprint2 )
/* interrupts and watchdog are disabled during service mode */
- watchdog_enable(device->machine, !service_mode(device->machine));
+ watchdog_enable(device->machine(), !service_mode(device->machine()));
- if (!service_mode(device->machine))
+ if (!service_mode(device->machine()))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( sprint2_wram_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
return state->video_ram[0x380 + offset % 0x80];
}
static READ8_HANDLER( sprint2_dip_r )
{
- return (input_port_read(space->machine, "DSW") << (2 * ((offset & 3) ^ 3))) & 0xc0;
+ return (input_port_read(space->machine(), "DSW") << (2 * ((offset & 3) ^ 3))) & 0xc0;
}
static READ8_HANDLER( sprint2_input_A_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
- UINT8 val = input_port_read(space->machine, "INA");
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
+ UINT8 val = input_port_read(space->machine(), "INA");
if (GAME_IS_SPRINT2)
{
@@ -152,8 +152,8 @@ static READ8_HANDLER( sprint2_input_A_r )
static READ8_HANDLER( sprint2_input_B_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
- UINT8 val = input_port_read(space->machine, "INB");
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
+ UINT8 val = input_port_read(space->machine(), "INB");
if (GAME_IS_SPRINT1)
{
@@ -168,19 +168,19 @@ static READ8_HANDLER( sprint2_input_B_r )
static READ8_HANDLER( sprint2_sync_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
UINT8 val = 0;
if (state->attract != 0)
val |= 0x10;
- if (space->machine->primary_screen->vpos() == 261)
+ if (space->machine().primary_screen->vpos() == 261)
val |= 0x20; /* VRESET */
- if (space->machine->primary_screen->vpos() >= 224)
+ if (space->machine().primary_screen->vpos() >= 224)
val |= 0x40; /* VBLANK */
- if (space->machine->primary_screen->vpos() >= 131)
+ if (space->machine().primary_screen->vpos() >= 131)
val |= 0x80; /* 60 Hz? */
return val;
@@ -189,38 +189,38 @@ static READ8_HANDLER( sprint2_sync_r )
static READ8_HANDLER( sprint2_steering1_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
return state->steering[0];
}
static READ8_HANDLER( sprint2_steering2_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
return state->steering[1];
}
static WRITE8_HANDLER( sprint2_steering_reset1_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->steering[0] |= 0x80;
}
static WRITE8_HANDLER( sprint2_steering_reset2_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->steering[1] |= 0x80;
}
static WRITE8_HANDLER( sprint2_wram_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->video_ram[0x380 + offset % 0x80] = data;
}
static WRITE8_DEVICE_HANDLER( sprint2_attract_w )
{
- sprint2_state *state = device->machine->driver_data<sprint2_state>();
+ sprint2_state *state = device->machine().driver_data<sprint2_state>();
state->attract = offset & 1;
// also DOMINOS_ATTRACT_EN
@@ -248,11 +248,11 @@ static WRITE8_DEVICE_HANDLER( sprint2_skid2_w )
static WRITE8_HANDLER( sprint2_lamp1_w )
{
- set_led_status(space->machine, 0, offset & 1);
+ set_led_status(space->machine(), 0, offset & 1);
}
static WRITE8_HANDLER( sprint2_lamp2_w )
{
- set_led_status(space->machine, 1, offset & 1);
+ set_led_status(space->machine(), 1, offset & 1);
}
diff --git a/src/mame/drivers/sprint4.c b/src/mame/drivers/sprint4.c
index 6ac0fe10040..656b6f9b267 100644
--- a/src/mame/drivers/sprint4.c
+++ b/src/mame/drivers/sprint4.c
@@ -19,7 +19,7 @@ Atari Sprint 4 driver
static CUSTOM_INPUT( get_lever )
{
- sprint4_state *state = field->port->machine->driver_data<sprint4_state>();
+ sprint4_state *state = field->port->machine().driver_data<sprint4_state>();
int n = (FPTR) param;
return 4 * state->gear[n] > state->da_latch;
@@ -28,7 +28,7 @@ static CUSTOM_INPUT( get_lever )
static CUSTOM_INPUT( get_wheel )
{
- sprint4_state *state = field->port->machine->driver_data<sprint4_state>();
+ sprint4_state *state = field->port->machine().driver_data<sprint4_state>();
int n = (FPTR) param;
return 8 * state->steer_FF1[n] + 8 * state->steer_FF2[n] > state->da_latch;
@@ -37,7 +37,7 @@ static CUSTOM_INPUT( get_wheel )
static CUSTOM_INPUT( get_collision )
{
- sprint4_state *state = field->port->machine->driver_data<sprint4_state>();
+ sprint4_state *state = field->port->machine().driver_data<sprint4_state>();
int n = (FPTR) param;
return state->collision[n];
@@ -46,7 +46,7 @@ static CUSTOM_INPUT( get_collision )
static TIMER_CALLBACK( nmi_callback )
{
- sprint4_state *state = machine->driver_data<sprint4_state>();
+ sprint4_state *state = machine.driver_data<sprint4_state>();
int scanline = param;
/* MAME updates controls only once per frame but the game checks them on every NMI */
@@ -107,14 +107,14 @@ static TIMER_CALLBACK( nmi_callback )
if (input_port_read(machine, "IN0") & 0x40)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
}
static MACHINE_RESET( sprint4 )
{
- sprint4_state *state = machine->driver_data<sprint4_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(32), FUNC(nmi_callback), 32);
+ sprint4_state *state = machine.driver_data<sprint4_state>();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(32), FUNC(nmi_callback), 32);
memset(state->steer_FF1, 0, sizeof state->steer_FF1);
memset(state->steer_FF2, 0, sizeof state->steer_FF2);
@@ -130,7 +130,7 @@ static MACHINE_RESET( sprint4 )
static READ8_HANDLER( sprint4_wram_r )
{
- sprint4_state *state = space->machine->driver_data<sprint4_state>();
+ sprint4_state *state = space->machine().driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
return videoram[0x380 + offset];
}
@@ -138,27 +138,27 @@ static READ8_HANDLER( sprint4_wram_r )
static READ8_HANDLER( sprint4_analog_r )
{
- return (input_port_read(space->machine, "ANALOG") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "ANALOG") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_coin_r )
{
- return (input_port_read(space->machine, "COIN") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "COIN") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_collision_r )
{
- return (input_port_read(space->machine, "COLLISION") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "COLLISION") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( sprint4_options_r )
{
- return (input_port_read(space->machine, "DIP") >> (2 * (offset & 3))) & 3;
+ return (input_port_read(space->machine(), "DIP") >> (2 * (offset & 3))) & 3;
}
static WRITE8_HANDLER( sprint4_wram_w )
{
- sprint4_state *state = space->machine->driver_data<sprint4_state>();
+ sprint4_state *state = space->machine().driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
videoram[0x380 + offset] = data;
}
@@ -166,28 +166,28 @@ static WRITE8_HANDLER( sprint4_wram_w )
static WRITE8_HANDLER( sprint4_collision_reset_w )
{
- sprint4_state *state = space->machine->driver_data<sprint4_state>();
+ sprint4_state *state = space->machine().driver_data<sprint4_state>();
state->collision[(offset >> 1) & 3] = 0;
}
static WRITE8_HANDLER( sprint4_da_latch_w )
{
- sprint4_state *state = space->machine->driver_data<sprint4_state>();
+ sprint4_state *state = space->machine().driver_data<sprint4_state>();
state->da_latch = data & 15;
}
static WRITE8_HANDLER( sprint4_lamp_w )
{
- set_led_status(space->machine, (offset >> 1) & 3, offset & 1);
+ set_led_status(space->machine(), (offset >> 1) & 3, offset & 1);
}
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( sprint4_lockout_w )
{
- coin_lockout_global_w(space->machine, ~offset & 1);
+ coin_lockout_global_w(space->machine(), ~offset & 1);
}
#endif
diff --git a/src/mame/drivers/sprint8.c b/src/mame/drivers/sprint8.c
index 1e1880eb4e1..73bf8fd05e7 100644
--- a/src/mame/drivers/sprint8.c
+++ b/src/mame/drivers/sprint8.c
@@ -11,9 +11,9 @@ Atari Sprint 8 driver
-void sprint8_set_collision(running_machine *machine, int n)
+void sprint8_set_collision(running_machine &machine, int n)
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
if (state->collision_reset == 0)
{
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
@@ -25,14 +25,14 @@ void sprint8_set_collision(running_machine *machine, int n)
static TIMER_DEVICE_CALLBACK( input_callback )
{
- sprint8_state *state = timer.machine->driver_data<sprint8_state>();
+ sprint8_state *state = timer.machine().driver_data<sprint8_state>();
static const char *const dialnames[] = { "DIAL1", "DIAL2", "DIAL3", "DIAL4", "DIAL5", "DIAL6", "DIAL7", "DIAL8" };
int i;
for (i = 0; i < 8; i++)
{
- UINT8 val = input_port_read(timer.machine, dialnames[i]) >> 4;
+ UINT8 val = input_port_read(timer.machine(), dialnames[i]) >> 4;
signed char delta = (val - state->dial[i]) & 15;
@@ -54,7 +54,7 @@ static TIMER_DEVICE_CALLBACK( input_callback )
static MACHINE_RESET( sprint8 )
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
state->collision_reset = 0;
state->collision_index = 0;
}
@@ -62,16 +62,16 @@ static MACHINE_RESET( sprint8 )
static READ8_HANDLER( sprint8_collision_r )
{
- sprint8_state *state = space->machine->driver_data<sprint8_state>();
+ sprint8_state *state = space->machine().driver_data<sprint8_state>();
return state->collision_index;
}
static READ8_HANDLER( sprint8_input_r )
{
- sprint8_state *state = space->machine->driver_data<sprint8_state>();
+ sprint8_state *state = space->machine().driver_data<sprint8_state>();
static const char *const portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" };
- UINT8 val = input_port_read(space->machine, portnames[offset]);
+ UINT8 val = input_port_read(space->machine(), portnames[offset]);
if (state->steer_dir[offset])
{
@@ -88,17 +88,17 @@ static READ8_HANDLER( sprint8_input_r )
static WRITE8_HANDLER( sprint8_lockout_w )
{
- coin_lockout_w(space->machine, offset, !(data & 1));
+ coin_lockout_w(space->machine(), offset, !(data & 1));
}
static WRITE8_HANDLER( sprint8_int_reset_w )
{
- sprint8_state *state = space->machine->driver_data<sprint8_state>();
+ sprint8_state *state = space->machine().driver_data<sprint8_state>();
state->collision_reset = !(data & 1);
if (state->collision_reset)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index b9847352135..7739f3c6499 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -28,7 +28,7 @@
static INTERRUPT_GEN( spy_interrupt )
{
- spy_state *state = device->machine->driver_data<spy_state>();
+ spy_state *state = device->machine().driver_data<spy_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, 0, HOLD_LINE);
@@ -36,11 +36,11 @@ static INTERRUPT_GEN( spy_interrupt )
static READ8_HANDLER( spy_bankedram1_r )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
if (state->rambank & 1)
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
else if (state->rambank & 2)
{
@@ -61,7 +61,7 @@ static READ8_HANDLER( spy_bankedram1_r )
static WRITE8_HANDLER( spy_bankedram1_w )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
if (state->rambank & 1)
{
@@ -163,17 +163,17 @@ static WRITE8_HANDLER( bankswitch_w )
else
bank = ((data & 0x0e) >> 1);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
-static void spy_collision( running_machine *machine )
+static void spy_collision( running_machine &machine )
{
#define MAX_SPRITES 64
#define DEF_NEAR_PLANE 0x6400
#define NEAR_PLANE_ZOOM 0x0100
#define FAR_PLANE_ZOOM 0x0000
- spy_state *state = machine->driver_data<spy_state>();
+ spy_state *state = machine.driver_data<spy_state>();
int op1, x1, w1, z1, d1, y1, h1;
int op2, x2, w2, z2, d2, y2, h2;
int mode, i, loopend, nearplane;
@@ -251,7 +251,7 @@ static void spy_collision( running_machine *machine )
static WRITE8_HANDLER( spy_3f90_w )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
/*********************************************************************
*
@@ -292,8 +292,8 @@ static WRITE8_HANDLER( spy_3f90_w )
********************************************************************/
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
@@ -325,7 +325,7 @@ static WRITE8_HANDLER( spy_3f90_w )
logerror("\n");
}
}
- spy_collision(space->machine);
+ spy_collision(space->machine());
//ZT
device_set_input_line(state->maincpu, M6809_FIRQ_LINE, HOLD_LINE);
}
@@ -336,13 +336,13 @@ static WRITE8_HANDLER( spy_3f90_w )
static WRITE8_HANDLER( spy_sh_irqtrigger_w )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sound_bank_w )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
int bank_A, bank_B;
bank_A = (data >> 0) & 0x03;
@@ -357,7 +357,7 @@ static WRITE8_HANDLER( sound_bank_w )
static READ8_HANDLER( k052109_051960_r )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -374,7 +374,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- spy_state *state = space->machine->driver_data<spy_state>();
+ spy_state *state = space->machine().driver_data<spy_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -480,7 +480,7 @@ static const k007232_interface spy_k007232_interface =
static void irqhandler( device_t *device, int linestate )
{
- spy_state *state = device->machine->driver_data<spy_state>();
+ spy_state *state = device->machine().driver_data<spy_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, linestate);
}
@@ -508,32 +508,32 @@ static const k051960_interface spy_k051960_intf =
static MACHINE_START( spy )
{
- spy_state *state = machine->driver_data<spy_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ spy_state *state = machine.driver_data<spy_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
memset(state->pmcram, 0, sizeof(state->pmcram));
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
state->save_item(NAME(state->rambank));
state->save_item(NAME(state->pmcbank));
state->save_item(NAME(state->video_enable));
state->save_item(NAME(state->old_3f90));
- state->save_pointer(NAME(machine->generic.paletteram.u8), 0x800);
+ state->save_pointer(NAME(machine.generic.paletteram.u8), 0x800);
state->save_item(NAME(state->pmcram));
}
static MACHINE_RESET( spy )
{
- spy_state *state = machine->driver_data<spy_state>();
+ spy_state *state = machine.driver_data<spy_state>();
state->rambank = 0;
state->pmcbank = 0;
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index bcf0dd51698..374beaf93ed 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -85,7 +85,7 @@ static INTERRUPT_GEN( srmp2_interrupt )
static MACHINE_START( srmp2 )
{
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
iox_t &iox = state->iox;
iox.reset = 0x1f;
@@ -100,7 +100,7 @@ static MACHINE_START( srmp2 )
static MACHINE_START( srmp3 )
{
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
iox_t &iox = state->iox;
iox.reset = 0xc8;
@@ -114,7 +114,7 @@ static MACHINE_START( srmp3 )
static MACHINE_START( rmgoldyh )
{
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
iox_t &iox = state->iox;
iox.reset = 0xc8;
@@ -141,10 +141,10 @@ static WRITE16_HANDLER( srmp2_flags_w )
x--- ---- : Palette Bank
*/
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
- coin_counter_w( space->machine, 0, ((data & 0x01) >> 0) );
- coin_lockout_w( space->machine, 0, (((~data) & 0x10) >> 4) );
+ coin_counter_w( space->machine(), 0, ((data & 0x01) >> 0) );
+ coin_lockout_w( space->machine(), 0, (((~data) & 0x10) >> 4) );
state->adpcm_bank = ( (data & 0x20) >> 5 );
state->color_bank = ( (data & 0x80) >> 7 );
}
@@ -157,8 +157,8 @@ static WRITE16_HANDLER( mjyuugi_flags_w )
---x ---- : Coin Lock Out
*/
- coin_counter_w( space->machine, 0, ((data & 0x01) >> 0) );
- coin_lockout_w( space->machine, 0, (((~data) & 0x10) >> 4) );
+ coin_counter_w( space->machine(), 0, ((data & 0x01) >> 0) );
+ coin_lockout_w( space->machine(), 0, (((~data) & 0x10) >> 4) );
}
@@ -169,7 +169,7 @@ static WRITE16_HANDLER( mjyuugi_adpcm_bank_w )
--xx ---- : GFX Bank
*/
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
state->adpcm_bank = (data & 0x0f);
state->gfx_bank = ((data >> 4) & 0x03);
@@ -185,8 +185,8 @@ static WRITE16_DEVICE_HANDLER( srmp2_adpcm_code_w )
table and plays the ADPCM for itself.
*/
- srmp2_state *state = device->machine->driver_data<srmp2_state>();
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ srmp2_state *state = device->machine().driver_data<srmp2_state>();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_sptr = (ROM[((state->adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->adpcm_eptr = (ROM[((state->adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -209,8 +209,8 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
table and plays the ADPCM for itself.
*/
- srmp2_state *state = device->machine->driver_data<srmp2_state>();
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ srmp2_state *state = device->machine().driver_data<srmp2_state>();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_sptr = (ROM[((state->adpcm_bank * 0x10000) + (data << 2) + 0)] << 8);
state->adpcm_eptr = (ROM[((state->adpcm_bank * 0x10000) + (data << 2) + 1)] << 8);
@@ -226,8 +226,8 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w )
static void srmp2_adpcm_int(device_t *device)
{
- srmp2_state *state = device->machine->driver_data<srmp2_state>();
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ srmp2_state *state = device->machine().driver_data<srmp2_state>();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
if (state->adpcm_sptr)
{
@@ -265,7 +265,7 @@ static READ8_HANDLER( vox_status_r )
}
-static UINT8 iox_key_matrix_calc(running_machine *machine,UINT8 p_side)
+static UINT8 iox_key_matrix_calc(running_machine &machine,UINT8 p_side)
{
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
int i, j, t;
@@ -288,7 +288,7 @@ static UINT8 iox_key_matrix_calc(running_machine *machine,UINT8 p_side)
static READ8_HANDLER( iox_mux_r )
{
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
iox_t &iox = state->iox;
/* first off check any pending protection value */
@@ -316,8 +316,8 @@ static READ8_HANDLER( iox_mux_r )
/* both side checks */
if(iox.mux == 1)
{
- UINT8 p1_side = iox_key_matrix_calc(space->machine,0);
- UINT8 p2_side = iox_key_matrix_calc(space->machine,4);
+ UINT8 p1_side = iox_key_matrix_calc(space->machine(),0);
+ UINT8 p2_side = iox_key_matrix_calc(space->machine(),4);
if(p1_side != 0)
return p1_side;
@@ -326,10 +326,10 @@ static READ8_HANDLER( iox_mux_r )
}
/* check individual input side */
- return iox_key_matrix_calc(space->machine,(iox.mux == 2) ? 0 : 4);
+ return iox_key_matrix_calc(space->machine(),(iox.mux == 2) ? 0 : 4);
}
- return input_port_read(space->machine,"SERVICE") & 0xff;
+ return input_port_read(space->machine(),"SERVICE") & 0xff;
}
static READ8_HANDLER( iox_status_r )
@@ -339,7 +339,7 @@ static READ8_HANDLER( iox_status_r )
static WRITE8_HANDLER( iox_command_w )
{
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
iox_t &iox = state->iox;
/*
bit wise command port apparently
@@ -354,7 +354,7 @@ static WRITE8_HANDLER( iox_command_w )
static WRITE8_HANDLER( iox_data_w )
{
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
iox_t &iox = state->iox;
iox.data = data;
@@ -375,8 +375,8 @@ static WRITE8_HANDLER( srmp3_rombank_w )
xxx- ---- : ADPCM ROM bank
*/
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
int addr;
state->adpcm_bank = ((data & 0xe0) >> 5);
@@ -384,7 +384,7 @@ static WRITE8_HANDLER( srmp3_rombank_w )
if (data & 0x1f) addr = ((0x10000 + (0x2000 * (data & 0x0f))) - 0x8000);
else addr = 0x10000;
- memory_set_bankptr(space->machine, "bank1", &ROM[addr]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[addr]);
}
/**************************************************************************
@@ -448,10 +448,10 @@ static WRITE8_HANDLER( srmp3_flags_w )
xx-- ---- : GFX Bank
*/
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
- coin_counter_w( space->machine, 0, ((data & 0x01) >> 0) );
- coin_lockout_w( space->machine, 0, (((~data) & 0x10) >> 4) );
+ coin_counter_w( space->machine(), 0, ((data & 0x01) >> 0) );
+ coin_lockout_w( space->machine(), 0, (((~data) & 0x10) >> 4) );
state->gfx_bank = (data >> 6) & 0x03;
}
@@ -497,8 +497,8 @@ static WRITE8_HANDLER( rmgoldyh_rombank_w )
xxx- ---- : ADPCM ROM bank
*/
- srmp2_state *state = space->machine->driver_data<srmp2_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ srmp2_state *state = space->machine().driver_data<srmp2_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
int addr;
state->adpcm_bank = ((data & 0xe0) >> 5);
@@ -506,7 +506,7 @@ static WRITE8_HANDLER( rmgoldyh_rombank_w )
if (data & 0x1f) addr = ((0x10000 + (0x2000 * (data & 0x1f))) - 0x8000);
else addr = 0x10000;
- memory_set_bankptr(space->machine, "bank1", &ROM[addr]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[addr]);
}
static ADDRESS_MAP_START( rmgoldyh_io_map, AS_IO, 8 )
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index d98c48978c7..a0078f927ae 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -87,7 +87,7 @@ public:
static SCREEN_UPDATE( srmp5 )
{
- srmp5_state *state = screen->machine->driver_data<srmp5_state>();
+ srmp5_state *state = screen->machine().driver_data<srmp5_state>();
int x,y,address,xs,xs2,ys,ys2,height,width,xw,yw,xb,yb,sizex,sizey;
UINT16 *sprite_list=state->sprram;
UINT16 *sprite_list_end=&state->sprram[0x4000]; //guess
@@ -193,7 +193,7 @@ static SCREEN_UPDATE( srmp5 )
{
if (state->tileduty[i] == 1)
{
- gfx_element_decode(screen->machine->gfx[0], i);
+ gfx_element_decode(screen->machine().gfx[0], i);
state->tileduty[i] = 0;
}
}
@@ -204,35 +204,35 @@ static SCREEN_UPDATE( srmp5 )
static READ32_HANDLER(srmp5_palette_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->palram[offset];
}
static WRITE32_HANDLER(srmp5_palette_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
COMBINE_DATA(&state->palram[offset]);
- palette_set_color(space->machine, offset, MAKE_RGB(data << 3 & 0xFF, data >> 2 & 0xFF, data >> 7 & 0xFF));
+ palette_set_color(space->machine(), offset, MAKE_RGB(data << 3 & 0xFF, data >> 2 & 0xFF, data >> 7 & 0xFF));
}
static WRITE32_HANDLER(bank_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
COMBINE_DATA(&state->databank);
}
static READ32_HANDLER(tileram_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->tileram[offset];
}
static WRITE32_HANDLER(tileram_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->tileram[offset] = data & 0xFFFF; //lower 16bit only
#ifdef DEBUG_CHAR
@@ -242,23 +242,23 @@ static WRITE32_HANDLER(tileram_w)
static READ32_HANDLER(spr_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->sprram[offset];
}
static WRITE32_HANDLER(spr_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->sprram[offset] = data & 0xFFFF; //lower 16bit only
}
static READ32_HANDLER(data_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
UINT32 data;
- const UINT8 *usr = space->machine->region("user2")->base();
+ const UINT8 *usr = space->machine().region("user2")->base();
data=((state->databank>>4)&0xf)*0x100000; //guess
data=usr[data+offset*2]+usr[data+offset*2+1]*256;
@@ -267,30 +267,30 @@ static READ32_HANDLER(data_r)
static WRITE32_HANDLER(input_select_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->input_select = data & 0x0F;
}
static READ32_HANDLER(srmp5_inputs_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
UINT32 ret = 0;
switch (state->input_select)
{
case 0x01:
- ret = input_port_read(space->machine, "IN0");
+ ret = input_port_read(space->machine(), "IN0");
break;
case 0x02:
- ret = input_port_read(space->machine, "IN1");
+ ret = input_port_read(space->machine(), "IN1");
break;
case 0x04:
- ret = input_port_read(space->machine, "IN2");
+ ret = input_port_read(space->machine(), "IN2");
break;
case 0x00:
case 0x08:
- ret = input_port_read(space->machine, "IN3");
+ ret = input_port_read(space->machine(), "IN3");
break;
}
return ret;
@@ -299,7 +299,7 @@ static READ32_HANDLER(srmp5_inputs_r)
//almost all cmds are sound related
static WRITE32_HANDLER(cmd1_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->cmd1 = data & 0xFF;
logerror("cmd1_w %08X\n", data);
@@ -307,7 +307,7 @@ static WRITE32_HANDLER(cmd1_w)
static WRITE32_HANDLER(cmd2_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->cmd2 = data & 0xFF;
state->cmd_stat = 5;
@@ -316,14 +316,14 @@ static WRITE32_HANDLER(cmd2_w)
static READ32_HANDLER(cmd_stat32_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->cmd_stat;
}
static READ32_HANDLER(srmp5_vidregs_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
logerror("vidregs read %08X %08X\n", offset << 2, state->vidregs[offset]);
return state->vidregs[offset];
@@ -331,7 +331,7 @@ static READ32_HANDLER(srmp5_vidregs_r)
static WRITE32_HANDLER(srmp5_vidregs_w)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
COMBINE_DATA(&state->vidregs[offset]);
if(offset != 0x10C / 4)
@@ -340,7 +340,7 @@ static WRITE32_HANDLER(srmp5_vidregs_w)
static READ32_HANDLER(irq_ack_clear)
{
- cputag_set_input_line(space->machine, "sub", R3000_IRQ4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", R3000_IRQ4, CLEAR_LINE);
return 0;
}
@@ -385,7 +385,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(cmd1_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
state->cmd_stat = 0;
return state->cmd1;
@@ -393,14 +393,14 @@ static READ8_HANDLER(cmd1_r)
static READ8_HANDLER(cmd2_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->cmd2;
}
static READ8_HANDLER(cmd_stat8_r)
{
- srmp5_state *state = space->machine->driver_data<srmp5_state>();
+ srmp5_state *state = space->machine().driver_data<srmp5_state>();
return state->cmd_stat;
}
@@ -617,7 +617,7 @@ ROM_END
static DRIVER_INIT(srmp5)
{
- srmp5_state *state = machine->driver_data<srmp5_state>();
+ srmp5_state *state = machine.driver_data<srmp5_state>();
st0016_game = 9;
state->tileram = auto_alloc_array(machine, UINT16, 0x100000/2);
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index 9b39f54ae03..1d484a2db89 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -106,18 +106,18 @@ static const gfx_layout tiles8x8_layout =
8*64
};
-static void update_palette(running_machine *machine)
+static void update_palette(running_machine &machine)
{
- srmp6_state *state = machine->driver_data<srmp6_state>();
+ srmp6_state *state = machine.driver_data<srmp6_state>();
INT8 r, g ,b;
int brg = state->brightness - 0x60;
int i;
for(i = 0; i < 0x800; i++)
{
- r = machine->generic.paletteram.u16[i] >> 0 & 0x1F;
- g = machine->generic.paletteram.u16[i] >> 5 & 0x1F;
- b = machine->generic.paletteram.u16[i] >> 10 & 0x1F;
+ r = machine.generic.paletteram.u16[i] >> 0 & 0x1F;
+ g = machine.generic.paletteram.u16[i] >> 5 & 0x1F;
+ b = machine.generic.paletteram.u16[i] >> 10 & 0x1F;
if(brg < 0) {
r += (r * brg) >> 5;
@@ -141,15 +141,15 @@ static void update_palette(running_machine *machine)
static VIDEO_START(srmp6)
{
- srmp6_state *state = machine->driver_data<srmp6_state>();
+ srmp6_state *state = machine.driver_data<srmp6_state>();
state->tileram = auto_alloc_array_clear(machine, UINT16, 0x100000*16/2);
state->dmaram = auto_alloc_array(machine, UINT16, 0x100/2);
state->sprram_old = auto_alloc_array_clear(machine, UINT16, 0x80000/2);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[0] = gfx_element_alloc(machine, &tiles8x8_layout, (UINT8*)state->tileram, machine->total_colors() / 256, 0);
- machine->gfx[0]->color_granularity=256;
+ machine.gfx[0] = gfx_element_alloc(machine, &tiles8x8_layout, (UINT8*)state->tileram, machine.total_colors() / 256, 0);
+ machine.gfx[0]->color_granularity=256;
state->brightness = 0x60;
}
@@ -160,7 +160,7 @@ static int xixi=0;
static SCREEN_UPDATE(srmp6)
{
- srmp6_state *state = screen->machine->driver_data<srmp6_state>();
+ srmp6_state *state = screen->machine().driver_data<srmp6_state>();
int alpha;
int x,y,tileno,height,width,xw,yw,sprite,xb,yb;
UINT16 *sprite_list = state->sprram_old;
@@ -176,13 +176,13 @@ static SCREEN_UPDATE(srmp6)
#if 0
/* debug */
- if(input_code_pressed_once(screen->machine, KEYCODE_Q))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Q))
{
++xixi;
printf("%x\n",xixi);
}
- if(input_code_pressed_once(screen->machine, KEYCODE_W))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_W))
{
--xixi;
printf("%x\n",xixi);
@@ -259,7 +259,7 @@ static SCREEN_UPDATE(srmp6)
else
yb=y+(height-yw-1)*8+global_y;
- drawgfx_alpha(bitmap,cliprect,screen->machine->gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha);
+ drawgfx_alpha(bitmap,cliprect,screen->machine().gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,0,alpha);
tileno++;
}
}
@@ -273,7 +273,7 @@ static SCREEN_UPDATE(srmp6)
memcpy(state->sprram_old, state->sprram, 0x80000);
- if(input_code_pressed_once(screen->machine, KEYCODE_Q))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Q))
{
FILE *p=fopen("tileram.bin","wb");
fwrite(state->tileram, 1, 0x100000*16, p);
@@ -290,24 +290,24 @@ static SCREEN_UPDATE(srmp6)
static WRITE16_HANDLER( srmp6_input_select_w )
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
state->input_select = data & 0x0f;
}
static READ16_HANDLER( srmp6_inputs_r )
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
if (offset == 0) // DSW
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
switch (state->input_select) // inputs
{
- case 1<<0: return input_port_read(space->machine, "KEY0");
- case 1<<1: return input_port_read(space->machine, "KEY1");
- case 1<<2: return input_port_read(space->machine, "KEY2");
- case 1<<3: return input_port_read(space->machine, "KEY3");
+ case 1<<0: return input_port_read(space->machine(), "KEY0");
+ case 1<<1: return input_port_read(space->machine(), "KEY1");
+ case 1<<2: return input_port_read(space->machine(), "KEY2");
+ case 1<<3: return input_port_read(space->machine(), "KEY3");
}
return 0;
@@ -316,16 +316,16 @@ static READ16_HANDLER( srmp6_inputs_r )
static WRITE16_HANDLER( video_regs_w )
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
switch(offset)
{
case 0x5e/2: // bank switch, used by ROM check
{
- const UINT8 *rom = space->machine->region("nile")->base();
+ const UINT8 *rom = space->machine().region("nile")->base();
LOG(("%x\n",data));
- memory_set_bankptr(space->machine, "bank1",(UINT16 *)(rom + (data & 0x0f)*0x200000));
+ memory_set_bankptr(space->machine(), "bank1",(UINT16 *)(rom + (data & 0x0f)*0x200000));
break;
}
@@ -335,7 +335,7 @@ static WRITE16_HANDLER( video_regs_w )
data = (!data)?0x60:(data == 0x5e)?0x60:data;
if (state->brightness != data) {
state->brightness = data;
- update_palette(space->machine);
+ update_palette(space->machine());
}
break;
@@ -358,7 +358,7 @@ static WRITE16_HANDLER( video_regs_w )
static READ16_HANDLER( video_regs_r )
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
logerror("video_regs_r (PC=%06X): %04x\n", cpu_get_previouspc(space->cpu), offset*2);
return state->video_regs[offset];
@@ -366,9 +366,9 @@ static READ16_HANDLER( video_regs_r )
/* DMA RLE stuff - the same as CPS3 */
-static UINT32 process(running_machine *machine,UINT8 b,UINT32 dst_offset)
+static UINT32 process(running_machine &machine,UINT8 b,UINT32 dst_offset)
{
- srmp6_state *state = machine->driver_data<srmp6_state>();
+ srmp6_state *state = machine.driver_data<srmp6_state>();
int l=0;
UINT8 *tram=(UINT8*)state->tileram;
@@ -381,7 +381,7 @@ static UINT32 process(running_machine *machine,UINT8 b,UINT32 dst_offset)
for(i=0;i<rle;++i)
{
tram[dst_offset + state->destl] = state->lastb;
- gfx_element_mark_dirty(machine->gfx[0], (dst_offset + state->destl)/0x40);
+ gfx_element_mark_dirty(machine.gfx[0], (dst_offset + state->destl)/0x40);
dst_offset++;
++l;
@@ -395,7 +395,7 @@ static UINT32 process(running_machine *machine,UINT8 b,UINT32 dst_offset)
state->lastb2 = state->lastb;
state->lastb = b;
tram[dst_offset + state->destl] = b;
- gfx_element_mark_dirty(machine->gfx[0], (dst_offset + state->destl)/0x40);
+ gfx_element_mark_dirty(machine.gfx[0], (dst_offset + state->destl)/0x40);
return 1;
}
@@ -404,13 +404,13 @@ static UINT32 process(running_machine *machine,UINT8 b,UINT32 dst_offset)
static WRITE16_HANDLER(srmp6_dma_w)
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
UINT16* dmaram = state->dmaram;
COMBINE_DATA(&dmaram[offset]);
if (offset==13 && dmaram[offset]==0x40)
{
- const UINT8 *rom = space->machine->region("nile")->base();
+ const UINT8 *rom = space->machine().region("nile")->base();
UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]);
UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]);
UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG!
@@ -452,13 +452,13 @@ static WRITE16_HANDLER(srmp6_dma_w)
{
UINT8 real_byte;
real_byte = rom[srctab+p*2];
- tempidx+=process(space->machine,real_byte,tempidx);
+ tempidx+=process(space->machine(),real_byte,tempidx);
real_byte = rom[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))];
- tempidx+=process(space->machine,real_byte,tempidx);
+ tempidx+=process(space->machine(),real_byte,tempidx);
}
else
{
- tempidx+=process(space->machine,p,tempidx);
+ tempidx+=process(space->machine(),p,tempidx);
}
ctrl<<=1;
@@ -497,7 +497,7 @@ static WRITE16_HANDLER(tileram_w)
static WRITE16_HANDLER(paletteram_w)
{
- srmp6_state *state = space->machine->driver_data<srmp6_state>();
+ srmp6_state *state = space->machine().driver_data<srmp6_state>();
INT8 r, g, b;
int brg = state->brightness - 0x60;
@@ -526,7 +526,7 @@ static WRITE16_HANDLER(paletteram_w)
if(b > 0x1F) b = 0x1F;
}
- palette_set_color(space->machine, offset, MAKE_RGB(r << 3, g << 3, b << 3));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r << 3, g << 3, b << 3));
}
}
diff --git a/src/mame/drivers/srumbler.c b/src/mame/drivers/srumbler.c
index 8f63e7c2e82..dd47a1f20dc 100644
--- a/src/mame/drivers/srumbler.c
+++ b/src/mame/drivers/srumbler.c
@@ -29,9 +29,9 @@ static WRITE8_HANDLER( srumbler_bankswitch_w )
that as well to be 100% accurate.
*/
int i;
- UINT8 *ROM = space->machine->region("user1")->base();
- UINT8 *prom1 = space->machine->region("proms")->base() + (data & 0xf0);
- UINT8 *prom2 = space->machine->region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
+ UINT8 *ROM = space->machine().region("user1")->base();
+ UINT8 *prom1 = space->machine().region("proms")->base() + (data & 0xf0);
+ UINT8 *prom2 = space->machine().region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
for (i = 0x05;i < 0x10;i++)
{
@@ -40,13 +40,13 @@ static WRITE8_HANDLER( srumbler_bankswitch_w )
/* bit 2 of prom1 selects ROM or RAM - not supported */
sprintf(bankname, "%04x", i*0x1000);
- memory_set_bankptr(space->machine, bankname,&ROM[bank*0x1000]);
+ memory_set_bankptr(space->machine(), bankname,&ROM[bank*0x1000]);
}
}
static MACHINE_RESET( srumbler )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* initialize banked ROM pointers */
srumbler_bankswitch_w(space,0,0);
}
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index f97b8b7ad82..02e5c0fb67c 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -232,13 +232,13 @@ public:
};
-static void PS7500_startTimer0(running_machine *machine);
-static void PS7500_startTimer1(running_machine *machine);
+static void PS7500_startTimer0(running_machine &machine);
+static void PS7500_startTimer1(running_machine &machine);
static SCREEN_UPDATE(ssfindo)
{
- ssfindo_state *state = screen->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = screen->machine().driver_data<ssfindo_state>();
int s,x,y;
if( state->PS7500_IO[VIDCR]&0x20) //video DMA enabled
@@ -264,28 +264,28 @@ static SCREEN_UPDATE(ssfindo)
static WRITE32_HANDLER(FIFO_w)
{
- ssfindo_state *state = space->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = space->machine().driver_data<ssfindo_state>();
state->PS7500_FIFO[data>>28]=data;
if(!(data>>28))
{
- palette_set_color_rgb(space->machine, state->PS7500_FIFO[1]&0xff, data&0xff,(data>>8)&0xff,(data>>16)&0xff);
+ palette_set_color_rgb(space->machine(), state->PS7500_FIFO[1]&0xff, data&0xff,(data>>8)&0xff,(data>>16)&0xff);
state->PS7500_FIFO[1]++; //autoinc
}
}
static TIMER_CALLBACK( PS7500_Timer0_callback )
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
state->PS7500_IO[IRQSTA]|=0x20;
if(state->PS7500_IO[IRQMSKA]&0x20)
{
- generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE);
+ generic_pulse_irq_line(machine.device("maincpu"), ARM7_IRQ_LINE);
}
}
-static void PS7500_startTimer0(running_machine *machine)
+static void PS7500_startTimer0(running_machine &machine)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
int val=((state->PS7500_IO[T0low]&0xff)|((state->PS7500_IO[T0high]&0xff)<<8))>>1;
if(val==0)
@@ -296,17 +296,17 @@ static void PS7500_startTimer0(running_machine *machine)
static TIMER_CALLBACK( PS7500_Timer1_callback )
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
state->PS7500_IO[IRQSTA]|=0x40;
if(state->PS7500_IO[IRQMSKA]&0x40)
{
- generic_pulse_irq_line(machine->device("maincpu"), ARM7_IRQ_LINE);
+ generic_pulse_irq_line(machine.device("maincpu"), ARM7_IRQ_LINE);
}
}
-static void PS7500_startTimer1(running_machine *machine)
+static void PS7500_startTimer1(running_machine &machine)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
int val=((state->PS7500_IO[T1low]&0xff)|((state->PS7500_IO[T1high]&0xff)<<8))>>1;
if(val==0)
state->PS7500timer1->adjust(attotime::never);
@@ -316,7 +316,7 @@ static void PS7500_startTimer1(running_machine *machine)
static INTERRUPT_GEN( ssfindo_interrupt )
{
- ssfindo_state *state = device->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = device->machine().driver_data<ssfindo_state>();
state->PS7500_IO[IRQSTA]|=0x08;
if(state->PS7500_IO[IRQMSKA]&0x08)
{
@@ -324,9 +324,9 @@ static INTERRUPT_GEN( ssfindo_interrupt )
}
}
-static void PS7500_reset(running_machine *machine)
+static void PS7500_reset(running_machine &machine)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
state->PS7500_IO[IOCR] = 0x3f;
state->PS7500_IO[VIDCR] = 0;
@@ -356,11 +356,11 @@ static void ppcar_speedups(address_space* space)
static READ32_HANDLER(PS7500_IO_r)
{
- ssfindo_state *state = space->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = space->machine().driver_data<ssfindo_state>();
switch(offset)
{
case MSECR:
- return space->machine->rand();
+ return space->machine().rand();
case IOLINES: //TODO: eeprom 24c01
#if 0
@@ -370,7 +370,7 @@ static READ32_HANDLER(PS7500_IO_r)
if(state->flashType == 1)
return 0;
else
- return space->machine->rand();
+ return space->machine().rand();
case IRQSTA:
return (state->PS7500_IO[offset] & (~2)) | 0x80;
@@ -383,10 +383,10 @@ static READ32_HANDLER(PS7500_IO_r)
if( state->iocr_hack)
{
- return (input_port_read(space->machine, "PS7500") & 0x80) | 0x34 | (space->machine->rand()&3); //eeprom read ?
+ return (input_port_read(space->machine(), "PS7500") & 0x80) | 0x34 | (space->machine().rand()&3); //eeprom read ?
}
- return (input_port_read(space->machine, "PS7500") & 0x80) | 0x37;
+ return (input_port_read(space->machine(), "PS7500") & 0x80) | 0x37;
case VIDCR:
return (state->PS7500_IO[offset] | 0x50) & 0xfffffff0;
@@ -404,12 +404,12 @@ static READ32_HANDLER(PS7500_IO_r)
}
- return space->machine->rand();//state->PS7500_IO[offset];
+ return space->machine().rand();//state->PS7500_IO[offset];
}
static WRITE32_HANDLER(PS7500_IO_w)
{
- ssfindo_state *state = space->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = space->machine().driver_data<ssfindo_state>();
UINT32 temp=state->PS7500_IO[offset];
COMBINE_DATA(&temp);
@@ -440,11 +440,11 @@ static WRITE32_HANDLER(PS7500_IO_w)
break;
case T1GO:
- PS7500_startTimer1(space->machine);
+ PS7500_startTimer1(space->machine());
break;
case T0GO:
- PS7500_startTimer0(space->machine);
+ PS7500_startTimer0(space->machine());
break;
case VIDEND:
@@ -476,8 +476,8 @@ static WRITE32_HANDLER(PS7500_IO_w)
static READ32_HANDLER(io_r)
{
- ssfindo_state *state = space->machine->driver_data<ssfindo_state>();
- UINT16 *FLASH = (UINT16 *)space->machine->region("user2")->base(); //16 bit - WORD access
+ ssfindo_state *state = space->machine().driver_data<ssfindo_state>();
+ UINT16 *FLASH = (UINT16 *)space->machine().region("user2")->base(); //16 bit - WORD access
int adr=state->flashAdr*0x200+(state->flashOffset);
@@ -504,7 +504,7 @@ static READ32_HANDLER(io_r)
static WRITE32_HANDLER(io_w)
{
- ssfindo_state *state = space->machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = space->machine().driver_data<ssfindo_state>();
UINT32 temp = 0;
COMBINE_DATA(&temp);
@@ -531,17 +531,17 @@ static WRITE32_HANDLER(debug_w)
static READ32_HANDLER(ff4_r)
{
- return space->machine->rand()&0x20;
+ return space->machine().rand()&0x20;
}
static READ32_HANDLER(SIMPLEIO_r)
{
- return space->machine->rand()&1;
+ return space->machine().rand()&1;
}
static READ32_HANDLER(randomized_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( ssfindo_map, AS_PROGRAM, 32 )
@@ -580,7 +580,7 @@ ADDRESS_MAP_END
static READ32_HANDLER(tetfight_unk_r)
{
//sound status ?
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE32_HANDLER(tetfight_unk_w)
@@ -847,16 +847,16 @@ ROM_END
static DRIVER_INIT(common)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
ssfindo_speedup = 0;
- state->PS7500timer0 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer0_callback));
- state->PS7500timer1 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer1_callback));
+ state->PS7500timer0 = machine.scheduler().timer_alloc(FUNC(PS7500_Timer0_callback));
+ state->PS7500timer1 = machine.scheduler().timer_alloc(FUNC(PS7500_Timer1_callback));
}
static DRIVER_INIT(ssfindo)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
DRIVER_INIT_CALL(common);
state->flashType=0;
ssfindo_speedup = ssfindo_speedups;
@@ -865,7 +865,7 @@ static DRIVER_INIT(ssfindo)
static DRIVER_INIT(ppcar)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
DRIVER_INIT_CALL(common);
state->flashType=1;
ssfindo_speedup = ppcar_speedups;
@@ -874,7 +874,7 @@ static DRIVER_INIT(ppcar)
static DRIVER_INIT(tetfight)
{
- ssfindo_state *state = machine->driver_data<ssfindo_state>();
+ ssfindo_state *state = machine.driver_data<ssfindo_state>();
DRIVER_INIT_CALL(common);
state->flashType=0;
state->iocr_hack=1;
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index cb085023a54..b8cafe1513f 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -62,7 +62,7 @@ Stephh's notes (based on the games M68000 code and some tests) :
static WRITE16_HANDLER( sshangha_protection16_w )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
COMBINE_DATA(&state->prot_data[offset]);
logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(space->cpu),offset<<1,data);
@@ -71,15 +71,15 @@ static WRITE16_HANDLER( sshangha_protection16_w )
/* Protection/IO chip 146 */
static READ16_HANDLER( sshangha_protection16_r )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
switch (offset)
{
case 0x050 >> 1:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 0x76a >> 1:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x0ac >> 1:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
// Protection TODO
}
@@ -90,15 +90,15 @@ static READ16_HANDLER( sshangha_protection16_r )
static READ16_HANDLER( sshanghb_protection16_r )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
switch (offset)
{
case 0x050 >> 1:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 0x76a >> 1:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x0ac >> 1:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
return state->prot_data[offset];
@@ -118,7 +118,7 @@ static MACHINE_RESET( sshangha )
/******************************************************************************/
-INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
+INLINE void set_color_888(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
{
palette_set_color_rgb(machine, color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
}
@@ -126,9 +126,9 @@ INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int
WRITE16_HANDLER( paletteram16_xbgr_word_be_sprites2_w )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
COMBINE_DATA(&state->sprite_paletteram2[offset]);
- set_color_888(space->machine, (offset/2)+0x100, 0, 8, 16, state->sprite_paletteram2[(offset) | 1] | (state->sprite_paletteram2[(offset) & ~1] << 16) );
+ set_color_888(space->machine(), (offset/2)+0x100, 0, 8, 16, state->sprite_paletteram2[(offset) | 1] | (state->sprite_paletteram2[(offset) & ~1] << 16) );
}
WRITE16_HANDLER( paletteram16_xbgr_word_be_sprites_w )
@@ -140,23 +140,23 @@ WRITE16_HANDLER( paletteram16_xbgr_word_be_sprites_w )
// maybe related to sprite DMA on the original, or the apparent lack of a 2nd sprite controller on the bootleg.
paletteram16_xbgr_word_be_sprites2_w(space,offset,data,mem_mask);
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
COMBINE_DATA(&state->sprite_paletteram[offset]);
- set_color_888(space->machine, (offset/2)+0x000, 0, 8, 16, state->sprite_paletteram[(offset) | 1] | (state->sprite_paletteram[(offset) & ~1] << 16) );
+ set_color_888(space->machine(), (offset/2)+0x000, 0, 8, 16, state->sprite_paletteram[(offset) | 1] | (state->sprite_paletteram[(offset) & ~1] << 16) );
}
WRITE16_HANDLER( paletteram16_xbgr_word_be_tilelow_w )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
COMBINE_DATA(&state->tile_paletteram1[offset]);
- set_color_888(space->machine, (offset/2)+0x200, 0, 8, 16, state->tile_paletteram1[(offset) | 1] | (state->tile_paletteram1[(offset) & ~1] << 16) );
+ set_color_888(space->machine(), (offset/2)+0x200, 0, 8, 16, state->tile_paletteram1[(offset) | 1] | (state->tile_paletteram1[(offset) & ~1] << 16) );
}
WRITE16_HANDLER( paletteram16_xbgr_word_be_tilehigh_w )
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
COMBINE_DATA(&state->tile_paletteram2[offset]);
- set_color_888(space->machine, (offset/2)+0x300, 0, 8, 16, state->tile_paletteram2[(offset) | 1] | (state->tile_paletteram2[(offset) & ~1] << 16) );
+ set_color_888(space->machine(), (offset/2)+0x300, 0, 8, 16, state->tile_paletteram2[(offset) | 1] | (state->tile_paletteram2[(offset) & ~1] << 16) );
}
static ADDRESS_MAP_START( sshangha_map, AS_PROGRAM, 16 )
@@ -224,13 +224,13 @@ ADDRESS_MAP_END
static READ8_HANDLER(sshangha_sound_shared_r)
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
return state->sound_shared_ram[offset] & 0xff;
}
static WRITE8_HANDLER(sshangha_sound_shared_w)
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
state->sound_shared_ram[offset] = data & 0xff;
}
@@ -367,7 +367,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, state);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, state);
}
static const ym2203_interface ym2203_config =
@@ -502,7 +502,7 @@ static DRIVER_INIT( sshangha )
#if SSHANGHA_HACK
/* This is a hack to allow you to use the extra features
of the first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x000384/2] = 0x4e71;
RAM[0x000386/2] = 0x4e71;
RAM[0x000388/2] = 0x4e71;
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index cd897d85b4f..e2694b9a768 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -177,12 +177,12 @@ static const UINT8 ssingles_colors[NUM_PENS*3]=
static MC6845_UPDATE_ROW( update_row )
{
- ssingles_state *state = device->machine->driver_data<ssingles_state>();
+ ssingles_state *state = device->machine().driver_data<ssingles_state>();
int cx,x;
UINT32 tile_address;
UINT16 cell,palette;
UINT8 b0,b1;
- const UINT8 *gfx = device->machine->region("gfx1")->base();
+ const UINT8 *gfx = device->machine().region("gfx1")->base();
for(cx=0;cx<x_count;++cx)
{
@@ -229,20 +229,20 @@ static const mc6845_interface mc6845_intf =
static WRITE8_HANDLER(ssingles_videoram_w)
{
- ssingles_state *state = space->machine->driver_data<ssingles_state>();
+ ssingles_state *state = space->machine().driver_data<ssingles_state>();
state->videoram[offset]=data;
}
static WRITE8_HANDLER(ssingles_colorram_w)
{
- ssingles_state *state = space->machine->driver_data<ssingles_state>();
+ ssingles_state *state = space->machine().driver_data<ssingles_state>();
state->colorram[offset]=data;
}
static VIDEO_START(ssingles)
{
- ssingles_state *state = machine->driver_data<ssingles_state>();
+ ssingles_state *state = machine.driver_data<ssingles_state>();
{
int i;
@@ -256,7 +256,7 @@ static VIDEO_START(ssingles)
static SCREEN_UPDATE( ssingles )
{
- device_t *mc6845 = screen->machine->device("crtc");
+ device_t *mc6845 = screen->machine().device("crtc");
mc6845_update(mc6845, bitmap, cliprect);
return 0;
@@ -265,14 +265,14 @@ static SCREEN_UPDATE( ssingles )
static READ8_HANDLER(c000_r)
{
- ssingles_state *state = space->machine->driver_data<ssingles_state>();
+ ssingles_state *state = space->machine().driver_data<ssingles_state>();
return state->prot_data;
}
static READ8_HANDLER(c001_r)
{
- ssingles_state *state = space->machine->driver_data<ssingles_state>();
+ ssingles_state *state = space->machine().driver_data<ssingles_state>();
state->prot_data=0xc4;
return 0;
@@ -280,7 +280,7 @@ static READ8_HANDLER(c001_r)
static WRITE8_HANDLER(c001_w)
{
- ssingles_state *state = space->machine->driver_data<ssingles_state>();
+ ssingles_state *state = space->machine().driver_data<ssingles_state>();
state->prot_data^=data^0x11;
}
@@ -288,7 +288,7 @@ static WRITE8_HANDLER(c001_w)
static CUSTOM_INPUT(controls_r)
{
int data = 7;
- switch(input_port_read(field->port->machine, "EXTRA")) //multiplexed
+ switch(input_port_read(field->port->machine(), "EXTRA")) //multiplexed
{
case 0x01: data = 1; break;
case 0x02: data = 2; break;
@@ -547,7 +547,7 @@ ROM_END
static DRIVER_INIT(ssingles)
{
- ssingles_state *state = machine->driver_data<ssingles_state>();
+ ssingles_state *state = machine.driver_data<ssingles_state>();
state->save_item(NAME(state->videoram));
state->save_item(NAME(state->colorram));
diff --git a/src/mame/drivers/sslam.c b/src/mame/drivers/sslam.c
index c0204b0588f..b89f921b622 100644
--- a/src/mame/drivers/sslam.c
+++ b/src/mame/drivers/sslam.c
@@ -216,9 +216,9 @@ static const UINT8 sslam_snd_loop[8][20] =
static TIMER_CALLBACK( music_playback )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
int pattern = 0;
- okim6295_device *device = machine->device<okim6295_device>("oki");
+ okim6295_device *device = machine.device<okim6295_device>("oki");
if ((device->read_status() & 0x08) == 0)
{
@@ -256,7 +256,7 @@ static TIMER_CALLBACK( music_playback )
static void sslam_play(device_t *device, int track, int data)
{
- sslam_state *state = device->machine->driver_data<sslam_state>();
+ sslam_state *state = device->machine().driver_data<sslam_state>();
okim6295_device *oki = downcast<okim6295_device *>(device);
int status = oki->read_status();
@@ -303,9 +303,9 @@ static WRITE16_DEVICE_HANDLER( sslam_snd_w )
{
if (ACCESSING_BITS_0_7)
{
- sslam_state *state = device->machine->driver_data<sslam_state>();
+ sslam_state *state = device->machine().driver_data<sslam_state>();
- logerror("%s Writing %04x to Sound CPU\n",device->machine->describe_context(),data);
+ logerror("%s Writing %04x to Sound CPU\n",device->machine().describe_context(),data);
if (data >= 0x40) {
if (data == 0xfe) {
/* This should reset the sound MCU and stop audio playback, but here, it */
@@ -379,7 +379,7 @@ static WRITE16_DEVICE_HANDLER( sslam_snd_w )
static WRITE16_HANDLER( powerbls_sound_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", MCS51_INT1_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", MCS51_INT1_LINE, HOLD_LINE);
}
/* Memory Maps */
@@ -434,14 +434,14 @@ ADDRESS_MAP_END
static READ8_HANDLER( playmark_snd_command_r )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
UINT8 data = 0;
if ((state->oki_control & 0x38) == 0x30) {
data = soundlatch_r(space,0);
}
else if ((state->oki_control & 0x38) == 0x28) {
- data = (space->machine->device<okim6295_device>("oki")->read(*space,0) & 0x0f);
+ data = (space->machine().device<okim6295_device>("oki")->read(*space,0) & 0x0f);
}
return data;
@@ -449,14 +449,14 @@ static READ8_HANDLER( playmark_snd_command_r )
static WRITE8_HANDLER( playmark_oki_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
state->oki_command = data;
}
static WRITE8_HANDLER( playmark_snd_control_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
state->oki_control = data;
@@ -465,13 +465,13 @@ static WRITE8_HANDLER( playmark_snd_control_w )
if (state->oki_bank != ((data & 3) - 1))
{
state->oki_bank = (data & 3) - 1;
- space->machine->device<okim6295_device>("oki")->set_bank_base(0x40000 * state->oki_bank);
+ space->machine().device<okim6295_device>("oki")->set_bank_base(0x40000 * state->oki_bank);
}
}
if ((data & 0x38) == 0x18)
{
- space->machine->device<okim6295_device>("oki")->write(*space, 0, state->oki_command);
+ space->machine().device<okim6295_device>("oki")->write(*space, 0, state->oki_command);
}
// !(data & 0x80) -> sound enable
@@ -927,7 +927,7 @@ ROM_END
static DRIVER_INIT( sslam )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
state->track = 0;
state->melody = 0;
state->bar = 0;
@@ -937,12 +937,12 @@ static DRIVER_INIT( sslam )
state->save_item(NAME(state->bar));
state->save_item(NAME(state->snd_bank));
- state->music_timer = machine->scheduler().timer_alloc(FUNC(music_playback));
+ state->music_timer = machine.scheduler().timer_alloc(FUNC(music_playback));
}
static DRIVER_INIT( powerbls )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
state->save_item(NAME(state->oki_control));
state->save_item(NAME(state->oki_command));
diff --git a/src/mame/drivers/ssozumo.c b/src/mame/drivers/ssozumo.c
index dc5e7218fd5..085bb3870e2 100644
--- a/src/mame/drivers/ssozumo.c
+++ b/src/mame/drivers/ssozumo.c
@@ -17,7 +17,7 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/10/04
static WRITE8_HANDLER( ssozumo_sh_command_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
}
@@ -51,7 +51,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted )
{
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_PORTS_START( ssozumo )
diff --git a/src/mame/drivers/sspeedr.c b/src/mame/drivers/sspeedr.c
index a6736becb3c..5634a86e64a 100644
--- a/src/mame/drivers/sspeedr.c
+++ b/src/mame/drivers/sspeedr.c
@@ -35,7 +35,7 @@ static PALETTE_INIT( sspeedr )
static WRITE8_HANDLER( sspeedr_int_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -43,7 +43,7 @@ static WRITE8_HANDLER( sspeedr_lamp_w )
{
output_set_value("lampGO", (data >> 0) & 1);
output_set_value("lampEP", (data >> 1) & 1);
- coin_counter_w(space->machine, 0, data & 8);
+ coin_counter_w(space->machine(), 0, data & 8);
}
@@ -53,7 +53,7 @@ static const UINT8 ls48_map[16] =
static WRITE8_HANDLER( sspeedr_time_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
data = data & 15;
output_set_digit_value(0x18 + offset, ls48_map[data]);
state->led_TIME[offset] = data;
@@ -62,7 +62,7 @@ static WRITE8_HANDLER( sspeedr_time_w )
static WRITE8_HANDLER( sspeedr_score_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
char buf[20];
sprintf(buf, "LED%02d", offset);
data = ~data & 15;
diff --git a/src/mame/drivers/ssrj.c b/src/mame/drivers/ssrj.c
index f8ad3f67e7d..474a75c41d9 100644
--- a/src/mame/drivers/ssrj.c
+++ b/src/mame/drivers/ssrj.c
@@ -36,8 +36,8 @@ HW info :
static MACHINE_RESET(ssrj)
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
memset(&rom[0xc000], 0 ,0x3fff); /* req for some control types */
state->oldport = 0x80;
@@ -45,8 +45,8 @@ static MACHINE_RESET(ssrj)
static READ8_HANDLER(ssrj_wheel_r)
{
- ssrj_state *state = space->machine->driver_data<ssrj_state>();
- int port = input_port_read(space->machine, "IN1") - 0x80;
+ ssrj_state *state = space->machine().driver_data<ssrj_state>();
+ int port = input_port_read(space->machine(), "IN1") - 0x80;
int retval = port - state->oldport;
state->oldport = port;
diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c
index 9c781048b0d..72f303eb601 100644
--- a/src/mame/drivers/sstrangr.c
+++ b/src/mame/drivers/sstrangr.c
@@ -35,7 +35,7 @@ public:
static SCREEN_UPDATE( sstrangr )
{
- sstrangr_state *state = screen->machine->driver_data<sstrangr_state>();
+ sstrangr_state *state = screen->machine().driver_data<sstrangr_state>();
offs_t offs;
for (offs = 0; offs < 0x2000; offs++)
@@ -84,14 +84,14 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( sstrngr2 )
{
- sstrangr_state *state = screen->machine->driver_data<sstrangr_state>();
+ sstrangr_state *state = screen->machine().driver_data<sstrangr_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *color_map_base;
get_pens(pens);
- color_map_base = &screen->machine->region("proms")->base()[state->flip_screen ? 0x0000 : 0x0200];
+ color_map_base = &screen->machine().region("proms")->base()[state->flip_screen ? 0x0000 : 0x0200];
for (offs = 0; offs < 0x2000; offs++)
{
@@ -132,7 +132,7 @@ static SCREEN_UPDATE( sstrngr2 )
static WRITE8_HANDLER( port_w )
{
- sstrangr_state *state = space->machine->driver_data<sstrangr_state>();
+ sstrangr_state *state = space->machine().driver_data<sstrangr_state>();
state->flip_screen = data & 0x20;
}
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 54514f0a936..e4c0057c4f4 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -177,16 +177,16 @@ Notes:
***************************************************************************/
/* Update the IRQ state based on all possible causes */
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
cputag_set_input_line(machine, "maincpu", 0, (state->requested_int & state->irq_enable)? ASSERT_LINE : CLEAR_LINE);
}
static IRQ_CALLBACK(ssv_irq_callback)
{
- ssv_state *state = device->machine->driver_data<ssv_state>();
+ ssv_state *state = device->machine().driver_data<ssv_state>();
int i;
for ( i = 0; i <= 7; i++ )
@@ -202,12 +202,12 @@ static IRQ_CALLBACK(ssv_irq_callback)
static WRITE16_HANDLER( ssv_irq_ack_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
int level = ((offset * 2) & 0x70) >> 4;
state->requested_int &= ~(1 << level);
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
}
/*
@@ -230,43 +230,43 @@ static WRITE16_HANDLER( ssv_irq_ack_w )
*/
static WRITE16_HANDLER( ssv_irq_enable_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
COMBINE_DATA(&state->irq_enable);
}
static INTERRUPT_GEN( ssv_interrupt )
{
- ssv_state *state = device->machine->driver_data<ssv_state>();
+ ssv_state *state = device->machine().driver_data<ssv_state>();
if (cpu_getiloops(device))
{
if (state->interrupt_ultrax)
{
state->requested_int |= 1 << 1; // needed by ultrax to coin up, breaks cairblad
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
}
else
{
state->requested_int |= 1 << 3; // vblank
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
}
static INTERRUPT_GEN( gdfs_interrupt )
{
- ssv_state *state = device->machine->driver_data<ssv_state>();
+ ssv_state *state = device->machine().driver_data<ssv_state>();
if (cpu_getiloops(device))
{
state->requested_int |= 1 << 6; // reads lightgun (4 times for 4 axis)
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
else
{
state->requested_int |= 1 << 3; // vblank
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
}
@@ -298,12 +298,12 @@ static WRITE16_HANDLER( ssv_lockout_w )
// popmessage("%02X",data & 0xff);
if (ACCESSING_BITS_0_7)
{
- coin_lockout_w(space->machine, 1,~data & 0x01);
- coin_lockout_w(space->machine, 0,~data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
+ coin_lockout_w(space->machine(), 1,~data & 0x01);
+ coin_lockout_w(space->machine(), 0,~data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
// data & 0x40?
- ssv_enable_video( space->machine, data & 0x80);
+ ssv_enable_video( space->machine(), data & 0x80);
}
}
@@ -313,21 +313,21 @@ static WRITE16_HANDLER( ssv_lockout_inv_w )
// popmessage("%02X",data & 0xff);
if (ACCESSING_BITS_0_7)
{
- coin_lockout_w(space->machine, 1, data & 0x01);
- coin_lockout_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
+ coin_lockout_w(space->machine(), 1, data & 0x01);
+ coin_lockout_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
// data & 0x40?
- ssv_enable_video( space->machine, data & 0x80);
+ ssv_enable_video( space->machine(), data & 0x80);
}
}
static MACHINE_RESET( ssv )
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
state->requested_int = 0;
- device_set_irq_callback(machine->device("maincpu"), ssv_irq_callback);
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base());
+ device_set_irq_callback(machine.device("maincpu"), ssv_irq_callback);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base());
}
@@ -349,21 +349,21 @@ ADDRESS_MAP_END
static READ16_HANDLER( dsp_dr_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
return state->m_dsp->snesdsp_read(true);
}
static WRITE16_HANDLER( dsp_dr_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
state->m_dsp->snesdsp_write(true, data);
}
static READ16_HANDLER( dsp_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 temp = state->m_dsp->dataram_r(offset/2);
UINT16 res;
@@ -381,7 +381,7 @@ static READ16_HANDLER( dsp_r )
static WRITE16_HANDLER( dsp_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 temp = state->m_dsp->dataram_r(offset/2);
if (offset & 1)
@@ -437,7 +437,7 @@ static READ16_HANDLER( fake_r ) { return ssv_scroll[offset]; }
static READ16_HANDLER( drifto94_rand_r )
{
- return space->machine->rand() & 0xffff;
+ return space->machine().rand() & 0xffff;
}
static ADDRESS_MAP_START( drifto94_map, AS_PROGRAM, 16 )
@@ -460,18 +460,18 @@ ADDRESS_MAP_END
static READ16_DEVICE_HANDLER( gdfs_eeprom_r )
{
- ssv_state *state = device->machine->driver_data<ssv_state>();
+ ssv_state *state = device->machine().driver_data<ssv_state>();
static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
- return (((state->gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine, gunnames[state->gdfs_lightgun_select])) | (eeprom_read_bit(device) << 8);
+ return (((state->gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(device->machine(), gunnames[state->gdfs_lightgun_select])) | (eeprom_read_bit(device) << 8);
}
static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w )
{
- ssv_state *state = device->machine->driver_data<ssv_state>();
+ ssv_state *state = device->machine().driver_data<ssv_state>();
if (data & ~0x7b00)
- logerror("%s - Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s - Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if ( ACCESSING_BITS_8_15 )
{
@@ -497,17 +497,17 @@ static WRITE16_DEVICE_HANDLER( gdfs_eeprom_w )
static READ16_HANDLER( gdfs_gfxram_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
return state->eaglshot_gfxram[offset + state->gdfs_gfxram_bank * 0x100000/2];
}
static WRITE16_HANDLER( gdfs_gfxram_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
offset += state->gdfs_gfxram_bank * 0x100000/2;
COMBINE_DATA(&state->eaglshot_gfxram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[2], offset / (16*8/2));
+ gfx_element_mark_dirty(space->machine().gfx[2], offset / (16*8/2));
}
static READ16_HANDLER( gdfs_blitram_r )
@@ -525,7 +525,7 @@ static READ16_HANDLER( gdfs_blitram_r )
static WRITE16_HANDLER( gdfs_blitram_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 *gdfs_blitram = state->gdfs_blitram;
COMBINE_DATA(&gdfs_blitram[offset]);
@@ -555,8 +555,8 @@ static WRITE16_HANDLER( gdfs_blitram_w )
UINT32 dst = (gdfs_blitram[0xc4/2] + (gdfs_blitram[0xc6/2] << 16)) << 4;
UINT32 len = (gdfs_blitram[0xc8/2]) << 4;
- UINT8 *rom = space->machine->region("gfx2")->base();
- size_t size = space->machine->region("gfx2")->bytes();
+ UINT8 *rom = space->machine().region("gfx2")->base();
+ size_t size = space->machine().region("gfx2")->bytes();
if ( (src+len <= size) && (dst+len <= 4 * 0x100000) )
{
@@ -568,7 +568,7 @@ static WRITE16_HANDLER( gdfs_blitram_w )
dst /= 16*8;
while (len--)
{
- gfx_element_mark_dirty(space->machine->gfx[2], dst);
+ gfx_element_mark_dirty(space->machine().gfx[2], dst);
dst++;
}
}
@@ -612,13 +612,13 @@ ADDRESS_MAP_END
static READ16_HANDLER( hypreact_input_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 input_sel = *state->input_sel;
- if (input_sel & 0x0001) return input_port_read(space->machine, "KEY0");
- if (input_sel & 0x0002) return input_port_read(space->machine, "KEY1");
- if (input_sel & 0x0004) return input_port_read(space->machine, "KEY2");
- if (input_sel & 0x0008) return input_port_read(space->machine, "KEY3");
+ if (input_sel & 0x0001) return input_port_read(space->machine(), "KEY0");
+ if (input_sel & 0x0002) return input_port_read(space->machine(), "KEY1");
+ if (input_sel & 0x0004) return input_port_read(space->machine(), "KEY2");
+ if (input_sel & 0x0008) return input_port_read(space->machine(), "KEY3");
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(space->cpu),input_sel);
return 0xffff;
}
@@ -702,14 +702,14 @@ ADDRESS_MAP_END
static READ16_HANDLER( ssv_mainram_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
return state->mainram[offset];
}
static WRITE16_HANDLER( ssv_mainram_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
COMBINE_DATA(&state->mainram[offset]);
}
@@ -740,13 +740,13 @@ ADDRESS_MAP_END
static READ16_HANDLER( srmp4_input_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 input_sel = *state->input_sel;
- if (input_sel & 0x0002) return input_port_read(space->machine, "KEY0");
- if (input_sel & 0x0004) return input_port_read(space->machine, "KEY1");
- if (input_sel & 0x0008) return input_port_read(space->machine, "KEY2");
- if (input_sel & 0x0010) return input_port_read(space->machine, "KEY3");
+ if (input_sel & 0x0002) return input_port_read(space->machine(), "KEY0");
+ if (input_sel & 0x0004) return input_port_read(space->machine(), "KEY1");
+ if (input_sel & 0x0008) return input_port_read(space->machine(), "KEY2");
+ if (input_sel & 0x0010) return input_port_read(space->machine(), "KEY3");
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(space->cpu),input_sel);
return 0xffff;
}
@@ -778,7 +778,7 @@ static WRITE16_HANDLER( srmp7_sound_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("ensoniq");
+ device_t *device = space->machine().device("ensoniq");
int bank = 0x400000/2 * (data & 1); // UINT16 address
int voice;
for (voice = 0; voice < 32; voice++)
@@ -789,13 +789,13 @@ static WRITE16_HANDLER( srmp7_sound_bank_w )
static READ16_HANDLER( srmp7_input_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
UINT16 input_sel = *state->input_sel;
- if (input_sel & 0x0002) return input_port_read(space->machine, "KEY0");
- if (input_sel & 0x0004) return input_port_read(space->machine, "KEY1");
- if (input_sel & 0x0008) return input_port_read(space->machine, "KEY2");
- if (input_sel & 0x0010) return input_port_read(space->machine, "KEY3");
+ if (input_sel & 0x0002) return input_port_read(space->machine(), "KEY0");
+ if (input_sel & 0x0004) return input_port_read(space->machine(), "KEY1");
+ if (input_sel & 0x0008) return input_port_read(space->machine(), "KEY2");
+ if (input_sel & 0x0010) return input_port_read(space->machine(), "KEY3");
logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(space->cpu),input_sel);
return 0xffff;
}
@@ -838,12 +838,12 @@ ADDRESS_MAP_END
static READ16_HANDLER( sxyreact_ballswitch_r )
{
- return input_port_read_safe(space->machine, "SERVICE", 0);
+ return input_port_read_safe(space->machine(), "SERVICE", 0);
}
static READ16_HANDLER( sxyreact_dial_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
return ((state->sxyreact_serial >> 1) & 0x80);
}
@@ -853,10 +853,10 @@ static WRITE16_HANDLER( sxyreact_dial_w )
{
if (ACCESSING_BITS_0_7)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
if (data & 0x20)
- state->sxyreact_serial = input_port_read_safe(space->machine, "PADDLE", 0) & 0xff;
+ state->sxyreact_serial = input_port_read_safe(space->machine(), "PADDLE", 0) & 0xff;
if ( (state->sxyreact_dial & 0x40) && !(data & 0x40) ) // $40 -> $00
state->sxyreact_serial <<= 1; // shift 1 bit
@@ -919,7 +919,7 @@ ADDRESS_MAP_END
static READ32_HANDLER(latch32_r)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
if(!offset)
state->latches[2]&=~2;
@@ -928,17 +928,17 @@ static READ32_HANDLER(latch32_r)
static WRITE32_HANDLER(latch32_w)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
if(!offset)
state->latches[2]|=1;
COMBINE_DATA(&state->latches[offset]);
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static READ16_HANDLER(latch16_r)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
if(!offset)
state->latches[2]&=~1;
@@ -947,12 +947,12 @@ static READ16_HANDLER(latch16_r)
static WRITE16_HANDLER(latch16_w)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
if(!offset)
state->latches[2]|=2;
state->latches[offset]=data;
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static ADDRESS_MAP_START( jsk_map, AS_PROGRAM, 16 )
@@ -979,9 +979,9 @@ ADDRESS_MAP_END
static READ16_HANDLER( eaglshot_gfxrom_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
- UINT8 *rom = space->machine->region("gfx1")->base();
- size_t size = space->machine->region("gfx1")->bytes();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
+ UINT8 *rom = space->machine().region("gfx1")->base();
+ size_t size = space->machine().region("gfx1")->bytes();
offset = offset * 2 + state->gfxrom_select * 0x200000;
@@ -995,22 +995,22 @@ static WRITE16_HANDLER( eaglshot_gfxrom_w )
{
if (ACCESSING_BITS_0_7)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
state->gfxrom_select = data;
}
}
static READ16_HANDLER( eaglshot_trackball_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
switch(state->trackball_select)
{
- case 0x60: return (input_port_read(space->machine, "TRACKX") >> 8) & 0xff;
- case 0x40: return (input_port_read(space->machine, "TRACKX") >> 0) & 0xff;
+ case 0x60: return (input_port_read(space->machine(), "TRACKX") >> 8) & 0xff;
+ case 0x40: return (input_port_read(space->machine(), "TRACKX") >> 0) & 0xff;
- case 0x70: return (input_port_read(space->machine, "TRACKY") >> 8) & 0xff;
- case 0x50: return (input_port_read(space->machine, "TRACKY") >> 0) & 0xff;
+ case 0x70: return (input_port_read(space->machine(), "TRACKY") >> 8) & 0xff;
+ case 0x50: return (input_port_read(space->machine(), "TRACKY") >> 0) & 0xff;
}
return 0;
}
@@ -1019,7 +1019,7 @@ static WRITE16_HANDLER( eaglshot_trackball_w )
{
if (ACCESSING_BITS_0_7)
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
state->trackball_select = data;
}
}
@@ -1028,19 +1028,19 @@ static WRITE16_HANDLER( eaglshot_trackball_w )
static READ16_HANDLER( eaglshot_gfxram_r )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
return state->eaglshot_gfxram[offset + (state->scroll[0x76/2] & 0xf) * 0x40000/2];
}
static WRITE16_HANDLER( eaglshot_gfxram_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
offset += (state->scroll[0x76/2] & 0xf) * 0x40000/2;
COMBINE_DATA(&state->eaglshot_gfxram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[0], offset / (16*8/2));
- gfx_element_mark_dirty(space->machine->gfx[1], offset / (16*8/2));
+ gfx_element_mark_dirty(space->machine().gfx[0], offset / (16*8/2));
+ gfx_element_mark_dirty(space->machine().gfx[1], offset / (16*8/2));
}
@@ -2646,9 +2646,9 @@ static const es5506_interface es5506_config =
***************************************************************************/
-static void init_ssv(running_machine *machine, int interrupt_ultrax)
+static void init_ssv(running_machine &machine, int interrupt_ultrax)
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
int i;
for (i = 0; i < 16; i++)
state->tile_code[i] = ( (i & 8) ? (1 << 16) : 0 ) +
@@ -2659,9 +2659,9 @@ static void init_ssv(running_machine *machine, int interrupt_ultrax)
state->interrupt_ultrax = interrupt_ultrax;
}
-static void init_hypreac2(running_machine *machine)
+static void init_hypreac2(running_machine &machine)
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
int i;
for (i = 0; i < 16; i++)
@@ -2669,11 +2669,11 @@ static void init_hypreac2(running_machine *machine)
}
// massages the data from the BPMicro-compatible dump to runnable form
-static void init_st010(running_machine *machine)
+static void init_st010(running_machine &machine)
{
- UINT8 *dspsrc = (UINT8 *)machine->region("st010")->base();
- UINT32 *dspprg = (UINT32 *)machine->region("dspprg")->base();
- UINT16 *dspdata = (UINT16 *)machine->region("dspdata")->base();
+ UINT8 *dspsrc = (UINT8 *)machine.region("st010")->base();
+ UINT32 *dspprg = (UINT32 *)machine.region("dspprg")->base();
+ UINT16 *dspdata = (UINT16 *)machine.region("dspdata")->base();
// copy DSP program
for (int i = 0; i < 0x10000; i+= 4)
@@ -2700,7 +2700,7 @@ static DRIVER_INIT( meosism ) { init_ssv(machine, 0); }
static DRIVER_INIT( mslider ) { init_ssv(machine, 0); }
static DRIVER_INIT( ryorioh ) { init_ssv(machine, 0); }
static DRIVER_INIT( srmp4 ) { init_ssv(machine, 0);
-// ((UINT16 *)machine->region("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
+// ((UINT16 *)machine.region("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
}
static DRIVER_INIT( srmp7 ) { init_ssv(machine, 0); }
static DRIVER_INIT( stmblade ) { init_ssv(machine, 0); init_st010(machine); }
diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c
index fdf9b42ef0c..d3212c0550c 100644
--- a/src/mame/drivers/st0016.c
+++ b/src/mame/drivers/st0016.c
@@ -47,17 +47,17 @@ static READ8_HANDLER(mux_r)
xxxx - input port #2
xxxx - dip switches (2x8 bits) (multiplexed)
*/
- int retval = input_port_read(space->machine, "SYSTEM") & 0x0f;
+ int retval = input_port_read(space->machine(), "SYSTEM") & 0x0f;
switch(mux_port & 0x30)
{
- case 0x00: retval |= ((input_port_read(space->machine, "DSW1") & 1) << 4) | ((input_port_read(space->machine, "DSW1") & 0x10) << 1)
- | ((input_port_read(space->machine, "DSW2") & 1) << 6) | ((input_port_read(space->machine, "DSW2") & 0x10) <<3); break;
- case 0x10: retval |= ((input_port_read(space->machine, "DSW1") & 2) << 3) | ((input_port_read(space->machine, "DSW1") & 0x20) )
- | ((input_port_read(space->machine, "DSW2") & 2) << 5) | ((input_port_read(space->machine, "DSW2") & 0x20) <<2); break;
- case 0x20: retval |= ((input_port_read(space->machine, "DSW1") & 4) << 2) | ((input_port_read(space->machine, "DSW1") & 0x40) >> 1)
- | ((input_port_read(space->machine, "DSW2") & 4) << 4) | ((input_port_read(space->machine, "DSW2") & 0x40) <<1); break;
- case 0x30: retval |= ((input_port_read(space->machine, "DSW1") & 8) << 1) | ((input_port_read(space->machine, "DSW1") & 0x80) >> 2)
- | ((input_port_read(space->machine, "DSW2") & 8) << 3) | ((input_port_read(space->machine, "DSW2") & 0x80) ); break;
+ case 0x00: retval |= ((input_port_read(space->machine(), "DSW1") & 1) << 4) | ((input_port_read(space->machine(), "DSW1") & 0x10) << 1)
+ | ((input_port_read(space->machine(), "DSW2") & 1) << 6) | ((input_port_read(space->machine(), "DSW2") & 0x10) <<3); break;
+ case 0x10: retval |= ((input_port_read(space->machine(), "DSW1") & 2) << 3) | ((input_port_read(space->machine(), "DSW1") & 0x20) )
+ | ((input_port_read(space->machine(), "DSW2") & 2) << 5) | ((input_port_read(space->machine(), "DSW2") & 0x20) <<2); break;
+ case 0x20: retval |= ((input_port_read(space->machine(), "DSW1") & 4) << 2) | ((input_port_read(space->machine(), "DSW1") & 0x40) >> 1)
+ | ((input_port_read(space->machine(), "DSW2") & 4) << 4) | ((input_port_read(space->machine(), "DSW2") & 0x40) <<1); break;
+ case 0x30: retval |= ((input_port_read(space->machine(), "DSW1") & 8) << 1) | ((input_port_read(space->machine(), "DSW1") & 0x80) >> 2)
+ | ((input_port_read(space->machine(), "DSW2") & 8) << 3) | ((input_port_read(space->machine(), "DSW2") & 0x80) ); break;
}
return retval;
}
@@ -69,7 +69,7 @@ static WRITE8_HANDLER(mux_select_w)
WRITE8_HANDLER(st0016_rom_bank_w)
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + (data* 0x4000) + 0x10000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 );
st0016_rom_bank=data;
}
@@ -111,7 +111,7 @@ static WRITE32_HANDLER(latch32_w)
if(!offset)
latches[2]|=1;
COMBINE_DATA(&latches[offset]);
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static READ8_HANDLER(latch8_r)
@@ -126,7 +126,7 @@ static WRITE8_HANDLER(latch8_w)
if(!offset)
latches[2]|=2;
latches[offset]=data;
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static ADDRESS_MAP_START( v810_mem,AS_PROGRAM, 32 )
@@ -670,13 +670,13 @@ static DRIVER_INIT(nratechu)
static DRIVER_INIT(mayjinsn)
{
st0016_game=4|0x80;
- memory_set_bankptr(machine, "bank2", machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank2", machine.region("user1")->base());
}
static DRIVER_INIT(mayjisn2)
{
st0016_game=4;
- memory_set_bankptr(machine, "bank2", machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank2", machine.region("user1")->base());
}
/*************************************
diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c
index f9d6b88ba37..aa3a7874a6e 100644
--- a/src/mame/drivers/stactics.c
+++ b/src/mame/drivers/stactics.c
@@ -55,7 +55,7 @@ Verify Color PROM resistor values (Last 8 colors)
static CUSTOM_INPUT( get_motor_not_ready )
{
- stactics_state *state = field->port->machine->driver_data<stactics_state>();
+ stactics_state *state = field->port->machine().driver_data<stactics_state>();
/* if the motor is self-centering, but not centered yet */
return ((*state->motor_on & 0x01) == 0) &&
@@ -65,7 +65,7 @@ static CUSTOM_INPUT( get_motor_not_ready )
static READ8_HANDLER( vert_pos_r )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
return 0x70 - state->vert_pos;
}
@@ -73,13 +73,13 @@ static READ8_HANDLER( vert_pos_r )
static READ8_HANDLER( horiz_pos_r )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
return state->horiz_pos + 0x88;
}
-static void move_motor(running_machine *machine, stactics_state *state)
+static void move_motor(running_machine &machine, stactics_state *state)
{
/* monitor motor under joystick control */
if (*state->motor_on & 0x01)
@@ -130,7 +130,7 @@ static void move_motor(running_machine *machine, stactics_state *state)
static CUSTOM_INPUT( get_rng )
{
/* this is a 555 timer, but cannot read one of the resistor values */
- return field->port->machine->rand() & 0x07;
+ return field->port->machine().rand() & 0x07;
}
@@ -143,7 +143,7 @@ static CUSTOM_INPUT( get_rng )
static WRITE8_HANDLER( stactics_coin_lockout_w )
{
- coin_lockout_w(space->machine, offset, ~data & 0x01);
+ coin_lockout_w(space->machine(), offset, ~data & 0x01);
}
@@ -156,9 +156,9 @@ static WRITE8_HANDLER( stactics_coin_lockout_w )
static INTERRUPT_GEN( stactics_interrupt )
{
- stactics_state *state = device->machine->driver_data<stactics_state>();
+ stactics_state *state = device->machine().driver_data<stactics_state>();
- move_motor(device->machine, state);
+ move_motor(device->machine(), state);
device_set_input_line(device, 0, HOLD_LINE);
}
@@ -287,7 +287,7 @@ INPUT_PORTS_END
static MACHINE_START( stactics )
{
- stactics_state *state = machine->driver_data<stactics_state>();
+ stactics_state *state = machine.driver_data<stactics_state>();
state->vert_pos = 0;
state->horiz_pos = 0;
diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c
index 1a248c3fb7f..ef92d5adf85 100644
--- a/src/mame/drivers/stadhero.c
+++ b/src/mame/drivers/stadhero.c
@@ -25,13 +25,13 @@ static READ16_HANDLER( stadhero_control_r )
switch (offset<<1)
{
case 0:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 2:
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
case 4:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(space->cpu),0x30c000+offset);
@@ -46,7 +46,7 @@ static WRITE16_HANDLER( stadhero_control_w )
break;
case 6: /* 6502 sound cpu */
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
default:
logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(space->cpu),data,0x30c010+offset);
@@ -202,7 +202,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/starfire.c b/src/mame/drivers/starfire.c
index e47f6d0dfb0..70488362d42 100644
--- a/src/mame/drivers/starfire.c
+++ b/src/mame/drivers/starfire.c
@@ -57,7 +57,7 @@ starfira has one less rom in total than starfire but everything passes as
static WRITE8_HANDLER( starfire_scratch_w )
{
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* A12 and A3 select video control registers */
if ((offset & 0x1008) == 0x1000)
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( starfire_scratch_w )
static READ8_HANDLER( starfire_scratch_r )
{
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* A11 selects input ports */
if (offset & 0x800)
@@ -104,11 +104,11 @@ static READ8_HANDLER( starfire_input_r )
{
switch (offset & 15)
{
- case 0: return input_port_read(space->machine, "DSW");
- case 1: return input_port_read(space->machine, "SYSTEM"); /* Note: need to loopback sounds lengths on that one */
- case 5: return input_port_read(space->machine, "STICKZ");
- case 6: return input_port_read(space->machine, "STICKX");
- case 7: return input_port_read(space->machine, "STICKY");
+ case 0: return input_port_read(space->machine(), "DSW");
+ case 1: return input_port_read(space->machine(), "SYSTEM"); /* Note: need to loopback sounds lengths on that one */
+ case 5: return input_port_read(space->machine(), "STICKZ");
+ case 6: return input_port_read(space->machine(), "STICKX");
+ case 7: return input_port_read(space->machine(), "STICKY");
default: return 0xff;
}
}
@@ -129,14 +129,14 @@ static READ8_HANDLER( fireone_input_r )
};
int temp;
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
switch (offset & 15)
{
- case 0: return input_port_read(space->machine, "DSW");
- case 1: return input_port_read(space->machine, "SYSTEM");
+ case 0: return input_port_read(space->machine(), "DSW");
+ case 1: return input_port_read(space->machine(), "SYSTEM");
case 2:
- temp = state->fireone_select ? input_port_read(space->machine, "P1") : input_port_read(space->machine, "P2");
+ temp = state->fireone_select ? input_port_read(space->machine(), "P1") : input_port_read(space->machine(), "P2");
temp = (temp & 0xc0) | fireone_paddle_map[temp & 0x3f];
return temp;
default: return 0xff;
@@ -376,14 +376,14 @@ ROM_END
static DRIVER_INIT( starfire )
{
- starfire_state *state = machine->driver_data<starfire_state>();
+ starfire_state *state = machine.driver_data<starfire_state>();
state->input_read = starfire_input_r;
}
static DRIVER_INIT( fireone )
{
- starfire_state *state = machine->driver_data<starfire_state>();
+ starfire_state *state = machine.driver_data<starfire_state>();
state->input_read = fireone_input_r;
diff --git a/src/mame/drivers/starshp1.c b/src/mame/drivers/starshp1.c
index 7937d8ebce6..ec4363d8f01 100644
--- a/src/mame/drivers/starshp1.c
+++ b/src/mame/drivers/starshp1.c
@@ -16,14 +16,14 @@ Atari Starship 1 driver
static INTERRUPT_GEN( starshp1_interrupt )
{
- if ((input_port_read(device->machine, "SYSTEM") & 0x90) != 0x90)
+ if ((input_port_read(device->machine(), "SYSTEM") & 0x90) != 0x90)
generic_pulse_irq_line(device, 0);
}
static WRITE8_DEVICE_HANDLER( starshp1_audio_w )
{
- starshp1_state *state = device->machine->driver_data<starshp1_state>();
+ starshp1_state *state = device->machine().driver_data<starshp1_state>();
data &= 1;
switch (offset & 7)
@@ -53,36 +53,36 @@ static WRITE8_DEVICE_HANDLER( starshp1_audio_w )
break;
}
- coin_lockout_w(device->machine, 0, !state->attract);
- coin_lockout_w(device->machine, 1, !state->attract);
+ coin_lockout_w(device->machine(), 0, !state->attract);
+ coin_lockout_w(device->machine(), 1, !state->attract);
}
static WRITE8_HANDLER( starshp1_collision_reset_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
state->collision_latch = 0;
}
static CUSTOM_INPUT( starshp1_analog_r )
{
- starshp1_state *state = field->port->machine->driver_data<starshp1_state>();
+ starshp1_state *state = field->port->machine().driver_data<starshp1_state>();
int val = 0;
switch (state->analog_in_select)
{
case 0:
- val = input_port_read(field->port->machine, "STICKY");
+ val = input_port_read(field->port->machine(), "STICKY");
break;
case 1:
- val = input_port_read(field->port->machine, "STICKX");
+ val = input_port_read(field->port->machine(), "STICKX");
break;
case 2:
val = 0x20; /* DAC feedback, not used */
break;
case 3:
- val = input_port_read(field->port->machine, "PLAYTIME");
+ val = input_port_read(field->port->machine(), "PLAYTIME");
break;
}
@@ -92,21 +92,21 @@ static CUSTOM_INPUT( starshp1_analog_r )
static CUSTOM_INPUT( collision_latch_r )
{
- starshp1_state *state = field->port->machine->driver_data<starshp1_state>();
+ starshp1_state *state = field->port->machine().driver_data<starshp1_state>();
return state->collision_latch & 0x0f;
}
static WRITE8_HANDLER( starshp1_analog_in_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
state->analog_in_select = offset & 3;
}
static WRITE8_DEVICE_HANDLER( starshp1_analog_out_w )
{
- starshp1_state *state = device->machine->driver_data<starshp1_state>();
+ starshp1_state *state = device->machine().driver_data<starshp1_state>();
switch (offset & 7)
{
case 1:
@@ -136,7 +136,7 @@ static WRITE8_DEVICE_HANDLER( starshp1_analog_out_w )
static WRITE8_HANDLER( starshp1_misc_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
data &= 1;
switch (offset & 7)
@@ -163,7 +163,7 @@ static WRITE8_HANDLER( starshp1_misc_w )
state->mux = data;
break;
case 7:
- set_led_status(space->machine, 0, !data);
+ set_led_status(space->machine(), 0, !data);
break;
}
}
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index 9f47c596438..ce674f00545 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -45,11 +45,11 @@
static MACHINE_RESET( starwars )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
/* ESB-specific */
if (state->is_esb)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* reset the slapstic */
slapstic_reset();
@@ -74,7 +74,7 @@ static MACHINE_RESET( starwars )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE, CLEAR_LINE);
}
@@ -87,7 +87,7 @@ static WRITE8_HANDLER( irq_ack_w )
static void esb_slapstic_tweak(address_space *space, offs_t offset)
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
int new_bank = slapstic_tweak(space, offset);
/* update for the new bank */
@@ -101,7 +101,7 @@ static void esb_slapstic_tweak(address_space *space, offs_t offset)
static READ8_HANDLER( esb_slapstic_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
int result = state->slapstic_base[offset];
esb_slapstic_tweak(space, offset);
return result;
@@ -498,21 +498,21 @@ ROM_END
static DRIVER_INIT( starwars )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
/* prepare the mathbox */
state->is_esb = 0;
starwars_mproc_init(machine);
/* initialize banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
memory_set_bank(machine, "bank1", 0);
}
static DRIVER_INIT( esb )
{
- starwars_state *state = machine->driver_data<starwars_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ starwars_state *state = machine.driver_data<starwars_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
/* init the slapstic */
slapstic_init(machine, 101);
@@ -520,14 +520,14 @@ static DRIVER_INIT( esb )
state->slapstic_base = &rom[0x08000];
/* install an opcode base handler */
- address_space *space = machine->device<m6809_device>("maincpu")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(esb_setdirect, *machine));
+ address_space *space = machine.device<m6809_device>("maincpu")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(esb_setdirect, machine));
/* install read/write handlers for it */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0x9fff, FUNC(esb_slapstic_r), FUNC(esb_slapstic_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0x9fff, FUNC(esb_slapstic_r), FUNC(esb_slapstic_w));
/* install additional banking */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xffff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xa000, 0xffff, "bank2");
/* prepare the matrix processor */
state->is_esb = 1;
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index 152ee52dee2..77a323b0edc 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -104,7 +104,7 @@ public:
static TILE_GET_INFO( horizontal_tile_info )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
UINT8 *videoram = state->videoram;
int code = videoram[0x400+tile_index];
int attr = videoram[tile_index] & 0x3f;
@@ -114,7 +114,7 @@ static TILE_GET_INFO( horizontal_tile_info )
static TILE_GET_INFO( vertical_tile_info )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
UINT8 *videoram = state->videoram;
int code = videoram[0x400+tile_index];
int attr = videoram[tile_index] & 0x3f;
@@ -143,13 +143,13 @@ static PALETTE_INIT( statriv2 )
static VIDEO_START( horizontal )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->tilemap = tilemap_create(machine, horizontal_tile_info ,tilemap_scan_rows, 8,15, 64,16);
}
static VIDEO_START( vertical )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->tilemap = tilemap_create(machine, vertical_tile_info, tilemap_scan_rows, 8,8, 32,32);
}
@@ -163,7 +163,7 @@ static VIDEO_START( vertical )
static WRITE8_HANDLER( statriv2_videoram_w )
{
- statriv2_state *state = space->machine->driver_data<statriv2_state>();
+ statriv2_state *state = space->machine().driver_data<statriv2_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset & 0x3ff);
@@ -179,9 +179,9 @@ static WRITE8_HANDLER( statriv2_videoram_w )
static SCREEN_UPDATE( statriv2 )
{
- statriv2_state *state = screen->machine->driver_data<statriv2_state>();
- if (tms9927_screen_reset(screen->machine->device("tms")))
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ statriv2_state *state = screen->machine().driver_data<statriv2_state>();
+ if (tms9927_screen_reset(screen->machine().device("tms")))
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
else
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
@@ -197,8 +197,8 @@ static SCREEN_UPDATE( statriv2 )
static INTERRUPT_GEN( statriv2_interrupt )
{
- statriv2_state *state = device->machine->driver_data<statriv2_state>();
- UINT8 new_coin = input_port_read(device->machine, "COIN");
+ statriv2_state *state = device->machine().driver_data<statriv2_state>();
+ UINT8 new_coin = input_port_read(device->machine(), "COIN");
/* check the coin inputs once per frame */
state->latched_coin |= new_coin & (new_coin ^ state->last_coin);
@@ -218,9 +218,9 @@ static INTERRUPT_GEN( statriv2_interrupt )
static READ8_HANDLER( question_data_r )
{
- statriv2_state *state = space->machine->driver_data<statriv2_state>();
- const UINT8 *qrom = space->machine->region("questions")->base();
- UINT32 qromsize = space->machine->region("questions")->bytes();
+ statriv2_state *state = space->machine().driver_data<statriv2_state>();
+ const UINT8 *qrom = space->machine().region("questions")->base();
+ UINT32 qromsize = space->machine().region("questions")->bytes();
UINT32 address;
if (state->question_offset_high == 0xff)
@@ -244,14 +244,14 @@ static READ8_HANDLER( question_data_r )
static CUSTOM_INPUT( latched_coin_r )
{
- statriv2_state *state = field->port->machine->driver_data<statriv2_state>();
+ statriv2_state *state = field->port->machine().driver_data<statriv2_state>();
return state->latched_coin;
}
static WRITE8_DEVICE_HANDLER( ppi_portc_hi_w )
{
- statriv2_state *state = device->machine->driver_data<statriv2_state>();
+ statriv2_state *state = device->machine().driver_data<statriv2_state>();
data >>= 4;
if (data != 0x0f)
state->latched_coin = 0;
@@ -1002,7 +1002,7 @@ ROM_END
/* question address is stored as L/H/X (low/high/don't care) */
static DRIVER_INIT( addr_lhx )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->question_offset_low = 0;
state->question_offset_mid = 1;
state->question_offset_high = 0xff;
@@ -1011,7 +1011,7 @@ static DRIVER_INIT( addr_lhx )
/* question address is stored as X/L/H (don't care/low/high) */
static DRIVER_INIT( addr_xlh )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->question_offset_low = 1;
state->question_offset_mid = 2;
state->question_offset_high = 0xff;
@@ -1020,7 +1020,7 @@ static DRIVER_INIT( addr_xlh )
/* question address is stored as X/H/L (don't care/high/low) */
static DRIVER_INIT( addr_xhl )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->question_offset_low = 2;
state->question_offset_mid = 1;
state->question_offset_high = 0xff;
@@ -1029,7 +1029,7 @@ static DRIVER_INIT( addr_xhl )
/* question address is stored as L/M/H (low/mid/high) */
static DRIVER_INIT( addr_lmh )
{
- statriv2_state *state = machine->driver_data<statriv2_state>();
+ statriv2_state *state = machine.driver_data<statriv2_state>();
state->question_offset_low = 0;
state->question_offset_mid = 1;
state->question_offset_high = 2;
@@ -1099,8 +1099,8 @@ static DRIVER_INIT( addr_lmhe )
* *
\***************************************************/
- UINT8 *qrom = machine->region("questions")->base();
- UINT32 length = machine->region("questions")->bytes();
+ UINT8 *qrom = machine.region("questions")->base();
+ UINT32 length = machine.region("questions")->bytes();
UINT32 address;
for (address = 0; address < length; address++)
@@ -1115,18 +1115,18 @@ static READ8_HANDLER( laserdisc_io_r )
UINT8 result = 0x00;
if (offset == 1)
result = 0x18;
- mame_printf_debug("%s:ld read ($%02X) = %02X\n", space->machine->describe_context(), 0x28 + offset, result);
+ mame_printf_debug("%s:ld read ($%02X) = %02X\n", space->machine().describe_context(), 0x28 + offset, result);
return result;
}
static WRITE8_HANDLER( laserdisc_io_w )
{
- mame_printf_debug("%s:ld write ($%02X) = %02X\n", space->machine->describe_context(), 0x28 + offset, data);
+ mame_printf_debug("%s:ld write ($%02X) = %02X\n", space->machine().describe_context(), 0x28 + offset, data);
}
static DRIVER_INIT( laserdisc )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
iospace->install_legacy_readwrite_handler(0x28, 0x2b, FUNC(laserdisc_io_r), FUNC(laserdisc_io_w));
}
diff --git a/src/mame/drivers/stepstag.c b/src/mame/drivers/stepstag.c
index e44e8eda1c4..9a59a337b40 100644
--- a/src/mame/drivers/stepstag.c
+++ b/src/mame/drivers/stepstag.c
@@ -32,17 +32,17 @@ public:
static READ16_HANDLER( unknown_read_0xc00000 )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER( unknown_read_0xd00000 )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER( unknown_read_0xffff00 )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( stepstag_map, AS_PROGRAM, 16 )
@@ -74,7 +74,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( unknown_sub_read_0xbe0004 )
{
- return space->machine->rand();
+ return space->machine().rand();
}
diff --git a/src/mame/drivers/stlforce.c b/src/mame/drivers/stlforce.c
index 9a1aa8e8bf2..8216b5b2a64 100644
--- a/src/mame/drivers/stlforce.c
+++ b/src/mame/drivers/stlforce.c
@@ -362,14 +362,14 @@ ROM_END
static DRIVER_INIT(stlforce)
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
state->sprxoffs = 0;
}
static DRIVER_INIT(twinbrat)
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
state->sprxoffs = 9;
}
diff --git a/src/mame/drivers/strnskil.c b/src/mame/drivers/strnskil.c
index 04316677bbb..6c625b01ae5 100644
--- a/src/mame/drivers/strnskil.c
+++ b/src/mame/drivers/strnskil.c
@@ -41,7 +41,7 @@ static READ8_HANDLER( pettanp_protection_r )
case 0x6066: res = 0xa5; break;
case 0x60dc: res = 0x20; break; /* bits 0-3 unknown */
case 0x615d: res = 0x30; break; /* bits 0-3 unknown */
- case 0x61b9: res = 0x60|(space->machine->rand()&0x0f); break; /* bits 0-3 unknown */
+ case 0x61b9: res = 0x60|(space->machine().rand()&0x0f); break; /* bits 0-3 unknown */
case 0x6219: res = 0x77; break;
case 0x626c: res = 0xb4; break;
default: res = 0xff; break;
@@ -60,7 +60,7 @@ static READ8_HANDLER( banbam_protection_r )
case 0x6094: res = 0xa5; break;
case 0x6118: res = 0x20; break; /* bits 0-3 unknown */
case 0x6199: res = 0x30; break; /* bits 0-3 unknown */
- case 0x61f5: res = 0x60|(space->machine->rand()&0x0f); break; /* bits 0-3 unknown */
+ case 0x61f5: res = 0x60|(space->machine().rand()&0x0f); break; /* bits 0-3 unknown */
case 0x6255: res = 0x77; break;
case 0x62a8: res = 0xb4; break;
default: res = 0xff; break;
@@ -507,16 +507,16 @@ static DRIVER_INIT( pettanp )
// AM_RANGE(0xd806, 0xd806) AM_READ(protection_r) /* protection data read (pettanp) */
/* Fujitsu MB8841 4-Bit MCU */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd806, 0xd806, FUNC(pettanp_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd80d, 0xd80d, FUNC(protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd806, 0xd806, FUNC(pettanp_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd80d, 0xd80d, FUNC(protection_w));
}
static DRIVER_INIT( banbam )
{
/* Fujitsu MB8841 4-Bit MCU */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd806, 0xd806, FUNC(banbam_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd80d, 0xd80d, FUNC(protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd806, 0xd806, FUNC(banbam_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd80d, 0xd80d, FUNC(protection_w));
}
GAME( 1984, strnskil, 0, strnskil, strnskil, 0, ROT0, "Sun Electronics", "Strength & Skill", 0 )
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index ee413eb4511..b6355f28d55 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -257,7 +257,7 @@ static emu_timer *stv_rtc_timer;
/*A-Bus IRQ checks,where they could be located these?*/
#define ABUSIRQ(_irq_,_vector_) \
- { cputag_set_input_line_and_vector(device->machine, "maincpu", _irq_, HOLD_LINE , _vector_); }
+ { cputag_set_input_line_and_vector(device->machine(), "maincpu", _irq_, HOLD_LINE , _vector_); }
#if 0
if(stv_scu[42] & 1)//IRQ ACK
{
@@ -474,10 +474,10 @@ static UINT8 stv_SMPC_r8 (address_space *space, int offset)
return_data = 0x20 ^ 0xff;
if (offset == 0x75)//PDR1 read
- return_data = input_port_read(space->machine, "DSW1");
+ return_data = input_port_read(space->machine(), "DSW1");
if (offset == 0x77)//PDR2 read
- return_data= (0xfe | eeprom_read_bit(space->machine->device("eeprom")));
+ return_data= (0xfe | eeprom_read_bit(space->machine().device("eeprom")));
// if (offset == 0x33) //country code
// return_data = input_port_read(machine, "FAKE");
@@ -494,14 +494,14 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
{
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
// if(LOG_SMPC) logerror ("8-bit SMPC Write to Offset %02x with Data %02x\n", offset, data);
smpc_ram[offset] = data;
if(offset == 0x75)
{
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_set_clock_line(device, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x10);
eeprom_set_cs_line(device, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
@@ -527,13 +527,13 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
if(!(smpc_ram[0x77] & 0x10))
{
if(LOG_SMPC) logerror("SMPC: M68k on\n");
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
en_68k = 1;
}
else
{
if(LOG_SMPC) logerror("SMPC: M68k off\n");
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
en_68k = 0;
}
//if(LOG_SMPC) logerror("SMPC: ram [0x77] = %02x\n",smpc_ram[0x77]);
@@ -562,7 +562,7 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
if(EXLE1 || EXLE2)
{
//if(LOG_SMPC) logerror ("Interrupt: PAD irq at scanline %04x, Vector 0x48 Level 0x08\n",scanline);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 8, (stv_irq.pad) ? HOLD_LINE : CLEAR_LINE, 0x48);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 8, (stv_irq.pad) ? HOLD_LINE : CLEAR_LINE, 0x48);
}
}
@@ -580,21 +580,21 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
smpc_ram[0x5f]=0x02;
#if USE_SLAVE
stv_enable_slave_sh2 = 1;
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, CLEAR_LINE);
#endif
break;
case 0x03:
if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
smpc_ram[0x5f]=0x03;
stv_enable_slave_sh2 = 0;
- space->machine->scheduler().trigger(1000);
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, ASSERT_LINE);
+ space->machine().scheduler().trigger(1000);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, ASSERT_LINE);
break;
case 0x06:
if(LOG_SMPC) logerror ("SMPC: Sound ON\n");
/* wrong? */
smpc_ram[0x5f]=0x06;
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
break;
case 0x07:
if(LOG_SMPC) logerror ("SMPC: Sound OFF\n");
@@ -606,24 +606,24 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
case 0x0d:
if(LOG_SMPC) logerror ("SMPC: System Reset\n");
smpc_ram[0x5f]=0x0d;
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
system_reset();
break;
case 0x0e:
if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n");
smpc_ram[0x5f]=0x0e;
- space->machine->device("maincpu")->set_unscaled_clock(MASTER_CLOCK_352/2);
- space->machine->device("slave")->set_unscaled_clock(MASTER_CLOCK_352/2);
- space->machine->device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_352/5);
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
+ space->machine().device("maincpu")->set_unscaled_clock(MASTER_CLOCK_352/2);
+ space->machine().device("slave")->set_unscaled_clock(MASTER_CLOCK_352/2);
+ space->machine().device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_352/5);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
break;
case 0x0f:
if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n");
smpc_ram[0x5f]=0x0f;
- space->machine->device("maincpu")->set_unscaled_clock(MASTER_CLOCK_320/2);
- space->machine->device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2);
- space->machine->device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_320/5);
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
+ space->machine().device("maincpu")->set_unscaled_clock(MASTER_CLOCK_320/2);
+ space->machine().device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2);
+ space->machine().device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_320/5);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
break;
/*"Interrupt Back"*/
case 0x10:
@@ -640,7 +640,7 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
smpc_ram[0x31]=0x00; //?
- //smpc_ram[0x33]=input_port_read(space->machine, "FAKE");
+ //smpc_ram[0x33]=input_port_read(space->machine(), "FAKE");
smpc_ram[0x35]=0x00;
smpc_ram[0x37]=0x00;
@@ -669,7 +669,7 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
/*System Manager(SMPC) irq*/
{
//if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 8, (stv_irq.smpc) ? HOLD_LINE : CLEAR_LINE, 0x47);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 8, (stv_irq.smpc) ? HOLD_LINE : CLEAR_LINE, 0x47);
}
break;
/* RTC write*/
@@ -693,7 +693,7 @@ static void stv_SMPC_w8 (address_space *space, int offset, UINT8 data)
if(LOG_SMPC) logerror ("SMPC: NMI request\n");
smpc_ram[0x5f]=0x18;
/*NMI is unconditionally requested?*/
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
break;
case 0x19:
if(LOG_SMPC) logerror ("SMPC: NMI Enable\n");
@@ -803,56 +803,56 @@ static READ32_HANDLER ( stv_io_r32 )
case 0x00/4:
switch(port_sel)
{
- case 0x77: return 0xff000000|(input_port_read(space->machine, "P1") << 16) |0x0000ff00|(input_port_read(space->machine, "P2"));
+ case 0x77: return 0xff000000|(input_port_read(space->machine(), "P1") << 16) |0x0000ff00|(input_port_read(space->machine(), "P2"));
case 0x67:
{
switch(mux_data)
{
/*Mahjong panel interface,bit wise(ACTIVE LOW)*/
- case 0xfe: return 0xff000000 | (input_port_read_safe(space->machine, "KEY0", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine, "KEY5", 0));
- case 0xfd: return 0xff000000 | (input_port_read_safe(space->machine, "KEY1", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine, "KEY6", 0));
- case 0xfb: return 0xff000000 | (input_port_read_safe(space->machine, "KEY2", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine, "KEY7", 0));
- case 0xf7: return 0xff000000 | (input_port_read_safe(space->machine, "KEY3", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine, "KEY8", 0));
- case 0xef: return 0xff000000 | (input_port_read_safe(space->machine, "KEY4", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine, "KEY9", 0));
+ case 0xfe: return 0xff000000 | (input_port_read_safe(space->machine(), "KEY0", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine(), "KEY5", 0));
+ case 0xfd: return 0xff000000 | (input_port_read_safe(space->machine(), "KEY1", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine(), "KEY6", 0));
+ case 0xfb: return 0xff000000 | (input_port_read_safe(space->machine(), "KEY2", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine(), "KEY7", 0));
+ case 0xf7: return 0xff000000 | (input_port_read_safe(space->machine(), "KEY3", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine(), "KEY8", 0));
+ case 0xef: return 0xff000000 | (input_port_read_safe(space->machine(), "KEY4", 0) << 16) | 0x0000ff00 | (input_port_read_safe(space->machine(), "KEY9", 0));
/*Joystick panel*/
default:
//popmessage("%02x MUX DATA",mux_data);
- return (input_port_read(space->machine, "P1") << 16) | (input_port_read(space->machine, "P2"));
+ return (input_port_read(space->machine(), "P1") << 16) | (input_port_read(space->machine(), "P2"));
}
}
case 0x47:
{
- if ( strcmp(space->machine->system().name,"critcrsh") == 0 )
+ if ( strcmp(space->machine().system().name,"critcrsh") == 0 )
{
int data1 = 0, data2 = 0;
/* Critter Crusher */
- data1 = input_port_read(space->machine, "LIGHTX");
+ data1 = input_port_read(space->machine(), "LIGHTX");
data1 = BITSWAP8(data1, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
- data1 |= (input_port_read(space->machine, "P1") & 1) ? 0x0 : 0x4;
- data2 = input_port_read(space->machine, "LIGHTY");
+ data1 |= (input_port_read(space->machine(), "P1") & 1) ? 0x0 : 0x4;
+ data2 = input_port_read(space->machine(), "LIGHTY");
data2 = BITSWAP8(data2, 2, 3, 0, 1, 6, 7, 5, 4) & 0xf3;
- data2 |= (input_port_read(space->machine, "P1") & 1) ? 0x0 : 0x4;
+ data2 |= (input_port_read(space->machine(), "P1") & 1) ? 0x0 : 0x4;
return 0xff000000 | data1 << 16 | 0x0000ff00 | data2;
}
}
//default:
- //case 0x40: return space->machine->rand();
+ //case 0x40: return space->machine().rand();
default:
//popmessage("%02x PORT SEL",port_sel);
- return (input_port_read(space->machine, "P1") << 16) | (input_port_read(space->machine, "P2"));
+ return (input_port_read(space->machine(), "P1") << 16) | (input_port_read(space->machine(), "P2"));
}
case 0x04/4:
- if ( strcmp(space->machine->system().name,"critcrsh") == 0 )
- return ((input_port_read(space->machine, "SYSTEM") << 16) & ((input_port_read(space->machine, "P1") & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
+ if ( strcmp(space->machine().system().name,"critcrsh") == 0 )
+ return ((input_port_read(space->machine(), "SYSTEM") << 16) & ((input_port_read(space->machine(), "P1") & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
else
- return (input_port_read(space->machine, "SYSTEM") << 16) | (ioga[1]);
+ return (input_port_read(space->machine(), "SYSTEM") << 16) | (ioga[1]);
case 0x08/4:
switch(port_sel)
{
- case 0x77: return (input_port_read(space->machine, "UNUSED") << 16) | (input_port_read(space->machine, "EXTRA"));
+ case 0x77: return (input_port_read(space->machine(), "UNUSED") << 16) | (input_port_read(space->machine(), "EXTRA"));
case 0x67: return 0xffffffff;/**/
case 0x20: return 0xffff0000 | (ioga[2] & 0xffff);
case 0x10: return ((ioga[2] & 0xffff) << 16) | 0xffff;
@@ -920,10 +920,10 @@ static WRITE32_HANDLER ( stv_io_w32 )
{
/*Why does the BIOS tests these as ACTIVE HIGH? A program bug?*/
ioga[1] = (data) & 0xff;
- coin_counter_w(space->machine, 0,~data & 0x01);
- coin_counter_w(space->machine, 1,~data & 0x02);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x08);
+ coin_counter_w(space->machine(), 0,~data & 0x01);
+ coin_counter_w(space->machine(), 1,~data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x08);
/*
other bits reserved
*/
@@ -1183,14 +1183,14 @@ static WRITE32_HANDLER( stv_scu_w32 )
/*Sound IRQ*/
if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
{
- //cputag_set_input_line_and_vector(space->machine, "maincpu", 9, HOLD_LINE , 0x46);
+ //cputag_set_input_line_and_vector(space->machine(), "maincpu", 9, HOLD_LINE , 0x46);
logerror("SCSP: Main CPU interrupt\n");
#if 0
if((scu_dst_0 & 0x7ffffff) != 0x05a00000)
{
if(!(stv_scu[40] & 0x1000))
{
- cputag_set_input_line_and_vector(space->machine, "maincpu", 3, HOLD_LINE, 0x4c);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 3, HOLD_LINE, 0x4c);
logerror("SCU: Illegal DMA interrupt\n");
}
}
@@ -1244,7 +1244,7 @@ static WRITE32_HANDLER( stv_scu_w32 )
/*Sound IRQ*/
if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
{
- //cputag_set_input_line_and_vector(space->machine, "maincpu", 9, HOLD_LINE , 0x46);
+ //cputag_set_input_line_and_vector(space->machine(), "maincpu", 9, HOLD_LINE , 0x46);
logerror("SCSP: Main CPU interrupt\n");
}
}
@@ -1294,7 +1294,7 @@ static WRITE32_HANDLER( stv_scu_w32 )
/*Sound IRQ*/
if(/*(!(stv_scu[40] & 0x40)) &&*/ scsp_to_main_irq == 1)
{
- //cputag_set_input_line_and_vector(space->machine, "maincpu", 9, HOLD_LINE , 0x46);
+ //cputag_set_input_line_and_vector(space->machine(), "maincpu", 9, HOLD_LINE , 0x46);
logerror("SCSP: Main CPU interrupt\n");
}
}
@@ -1531,7 +1531,7 @@ static void dma_direct_lv0(address_space *space)
if(LOG_SCU) logerror("DMA transfer END\n");
/*TODO: timing of this*/
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended));
if(scu_add_tmp & 0x80000000)
{
@@ -1632,7 +1632,7 @@ static void dma_direct_lv1(address_space *space)
if(LOG_SCU) logerror("DMA transfer END\n");
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended));
if(scu_add_tmp & 0x80000000)
{
@@ -1733,7 +1733,7 @@ static void dma_direct_lv2(address_space *space)
if(LOG_SCU) logerror("DMA transfer END\n");
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended));
if(scu_add_tmp & 0x80000000)
{
@@ -1808,7 +1808,7 @@ static void dma_indirect_lv0(address_space *space)
}while(job_done == 0);
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv0_ended));
}
static void dma_indirect_lv1(address_space *space)
@@ -1877,7 +1877,7 @@ static void dma_indirect_lv1(address_space *space)
}while(job_done == 0);
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv1_ended));
}
static void dma_indirect_lv2(address_space *space)
@@ -1945,7 +1945,7 @@ static void dma_indirect_lv2(address_space *space)
}while(job_done == 0);
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(dma_lv2_ended));
}
@@ -1969,16 +1969,16 @@ static READ32_HANDLER( stv_sh2_soundram_r )
static WRITE32_HANDLER( minit_w )
{
logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
- space->machine->scheduler().boost_interleave(minit_boost_timeslice, attotime::from_usec(minit_boost));
- space->machine->scheduler().trigger(1000);
- sh2_set_frt_input(space->machine->device("slave"), PULSE_LINE);
+ space->machine().scheduler().boost_interleave(minit_boost_timeslice, attotime::from_usec(minit_boost));
+ space->machine().scheduler().trigger(1000);
+ sh2_set_frt_input(space->machine().device("slave"), PULSE_LINE);
}
static WRITE32_HANDLER( sinit_w )
{
logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
- space->machine->scheduler().boost_interleave(sinit_boost_timeslice, attotime::from_usec(sinit_boost));
- sh2_set_frt_input(space->machine->device("maincpu"), PULSE_LINE);
+ space->machine().scheduler().boost_interleave(sinit_boost_timeslice, attotime::from_usec(sinit_boost));
+ sh2_set_frt_input(space->machine().device("maincpu"), PULSE_LINE);
}
@@ -2338,7 +2338,7 @@ DRIVER_INIT ( stv )
{
system_time systime;
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
/* amount of time to boost interleave for on MINIT / SINIT, needed for communication to work */
minit_boost = 400;
@@ -2355,14 +2355,14 @@ DRIVER_INIT ( stv )
// do strict overwrite verification - maruchan and rsgun crash after coinup without this.
// cottonbm needs strict PCREL
// todo: test what games need this and don't turn it on for them...
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
- sh2drc_set_options(machine->device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
+ sh2drc_set_options(machine.device("slave"), SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL);
/* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc44, 0x60ffc47, FUNC(w60ffc44_write) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc48, 0x60ffc4b, FUNC(w60ffc48_write) );
- machine->device("slave")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc44, 0x60ffc47, FUNC(w60ffc44_write) );
- machine->device("slave")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc48, 0x60ffc4b, FUNC(w60ffc48_write) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc44, 0x60ffc47, FUNC(w60ffc44_write) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc48, 0x60ffc4b, FUNC(w60ffc48_write) );
+ machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc44, 0x60ffc47, FUNC(w60ffc44_write) );
+ machine.device("slave")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x60ffc48, 0x60ffc4b, FUNC(w60ffc48_write) );
smpc_ram[0x31] = 0x00; //CTG1=0 CTG0=0 (correct??)
// smpc_ram[0x33] = input_port_read(machine, "FAKE");
@@ -2385,7 +2385,7 @@ DRIVER_INIT ( stv )
#ifdef UNUSED_FUNCTION
static void print_game_info(void)
{
- UINT8 *ROM = machine->region("user1")->base();
+ UINT8 *ROM = machine.region("user1")->base();
static FILE *print_file = NULL;
UINT8 STR[0x100];
UINT32 src_i,dst_i;
@@ -2501,15 +2501,15 @@ static void scsp_irq(device_t *device, int irq)
if (irq > 0)
{
scsp_last_line = irq;
- cputag_set_input_line(device->machine, "audiocpu", irq, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", irq, ASSERT_LINE);
}
else if (irq < 0)
{
- cputag_set_input_line(device->machine, "audiocpu", -irq, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", -irq, CLEAR_LINE);
}
else
{
- cputag_set_input_line(device->machine, "audiocpu", scsp_last_line, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", scsp_last_line, CLEAR_LINE);
}
}
@@ -2591,13 +2591,13 @@ static TIMER_CALLBACK(stv_rtc_increment)
static MACHINE_START( stv )
{
system_time systime;
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
- stv_maincpu = machine->device<cpu_device>("maincpu");
- stv_slave = machine->device<cpu_device>("slave");
- stv_audiocpu = machine->device<cpu_device>("audiocpu");
+ stv_maincpu = machine.device<cpu_device>("maincpu");
+ stv_slave = machine.device<cpu_device>("slave");
+ stv_audiocpu = machine.device<cpu_device>("audiocpu");
- scsp_set_ram_base(machine->device("scsp"), sound_ram);
+ scsp_set_ram_base(machine.device("scsp"), sound_ram);
// save states
state_save_register_global_pointer(machine, smpc_ram, 0x80);
@@ -2623,7 +2623,7 @@ static MACHINE_START( stv )
stv_register_protection_savestates(machine); // machine/stvprot.c
- machine->add_notifier(MACHINE_NOTIFY_EXIT, stvcd_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, stvcd_exit);
smpc_ram[0x23] = DectoBCD(systime.local_time.year /100);
smpc_ram[0x25] = DectoBCD(systime.local_time.year %100);
@@ -2633,7 +2633,7 @@ static MACHINE_START( stv )
smpc_ram[0x2d] = DectoBCD(systime.local_time.minute);
smpc_ram[0x2f] = DectoBCD(systime.local_time.second);
- stv_rtc_timer = machine->scheduler().timer_alloc(FUNC(stv_rtc_increment));
+ stv_rtc_timer = machine.scheduler().timer_alloc(FUNC(stv_rtc_increment));
}
/*
@@ -2661,9 +2661,9 @@ SCU register[40] is for IRQ masking.
It's not tested much either, but I'm aware that timer 1 doesn't work with this for whatever reason ... */
static TIMER_CALLBACK( stv_irq_callback )
{
- int hpos = machine->primary_screen->hpos();
- int vpos = machine->primary_screen->vpos();
- rectangle visarea = *machine->primary_screen->visible_area();
+ int hpos = machine.primary_screen->hpos();
+ int vpos = machine.primary_screen->vpos();
+ rectangle visarea = *machine.primary_screen->visible_area();
h_sync = visarea.max_x+1;//horz
v_sync = visarea.max_y+1;//vert
@@ -2671,12 +2671,12 @@ static TIMER_CALLBACK( stv_irq_callback )
if(vpos == v_sync && hpos == 0)
VBLANK_IN_IRQ;
if(hpos == 0 && vpos == 0)
- VBLANK_OUT_IRQ(timer->machine);
+ VBLANK_OUT_IRQ(timer->machine());
if(hpos == h_sync)
- TIMER_0_IRQ(timer->machine);
+ TIMER_0_IRQ(timer->machine());
if(hpos == h_sync && (vpos != 0 && vpos != v_sync))
{
- HBLANK_IN_IRQ(timer->machine);
+ HBLANK_IN_IRQ(timer->machine());
timer_0++;
}
@@ -2686,14 +2686,14 @@ static TIMER_CALLBACK( stv_irq_callback )
VDP1_IRQ;
if(hpos == timer_1)
- TIMER_1_IRQ(timer->machine);
+ TIMER_1_IRQ(timer->machine());
if(hpos <= h_sync)
- scan_timer->adjust(machine->primary_screen->time_until_pos(vpos, hpos+1));
+ scan_timer->adjust(machine.primary_screen->time_until_pos(vpos, hpos+1));
else if(vpos <= v_sync)
- scan_timer->adjust(machine->primary_screen->time_until_pos(vpos+1));
+ scan_timer->adjust(machine.primary_screen->time_until_pos(vpos+1));
else
- scan_timer->adjust(machine->primary_screen->time_until_pos(0));
+ scan_timer->adjust(machine.primary_screen->time_until_pos(0));
}
#endif
@@ -2713,7 +2713,7 @@ timer_0 = 0; \
#define VBLANK_IN_IRQ \
{ \
/*if(LOG_IRQ) logerror ("Interrupt: VBlank IN Vector 0x40 Level 0x0f\n");*/ \
- cputag_set_input_line_and_vector(device->machine, "maincpu", 0xf, (stv_irq.vblank_in) ? HOLD_LINE : CLEAR_LINE , 0x40); \
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 0xf, (stv_irq.vblank_in) ? HOLD_LINE : CLEAR_LINE , 0x40); \
} \
#define HBLANK_IN_IRQ(m) \
@@ -2757,20 +2757,20 @@ static TIMER_DEVICE_CALLBACK( hblank_in_irq )
{
int scanline = param;
-// h = timer.machine->primary_screen->height();
-// w = timer.machine->primary_screen->width();
+// h = timer.machine().primary_screen->height();
+// w = timer.machine().primary_screen->width();
- HBLANK_IN_IRQ(timer.machine);
- TIMER_0_IRQ(timer.machine);
+ HBLANK_IN_IRQ(timer.machine());
+ TIMER_0_IRQ(timer.machine());
if(scanline+1 < v_sync)
{
if(stv_irq.hblank_in || stv_irq.timer_0)
- scan_timer->adjust(timer.machine->primary_screen->time_until_pos(scanline+1, h_sync), scanline+1);
+ scan_timer->adjust(timer.machine().primary_screen->time_until_pos(scanline+1, h_sync), scanline+1);
/*set the first Timer-1 event*/
cur_scan = scanline+1;
if(stv_irq.timer_1)
- t1_timer->adjust(timer.machine->primary_screen->time_until_pos(scanline+1, timer_1), scanline+1);
+ t1_timer->adjust(timer.machine().primary_screen->time_until_pos(scanline+1, timer_1), scanline+1);
}
timer_0++;
@@ -2780,10 +2780,10 @@ static TIMER_DEVICE_CALLBACK( timer1_irq )
{
int scanline = param;
- TIMER_1_IRQ(timer.machine);
+ TIMER_1_IRQ(timer.machine());
if(stv_irq.timer_1)
- t1_timer->adjust(timer.machine->primary_screen->time_until_pos(scanline+1, timer_1), scanline+1);
+ t1_timer->adjust(timer.machine().primary_screen->time_until_pos(scanline+1, timer_1), scanline+1);
}
static TIMER_CALLBACK( vdp1_irq )
@@ -2793,14 +2793,14 @@ static TIMER_CALLBACK( vdp1_irq )
static TIMER_DEVICE_CALLBACK( vblank_out_irq )
{
- VBLANK_OUT_IRQ(timer.machine);
+ VBLANK_OUT_IRQ(timer.machine());
}
/*V-Blank-IN event*/
static INTERRUPT_GEN( stv_interrupt )
{
// scanline = 0;
- rectangle visarea = device->machine->primary_screen->visible_area();
+ rectangle visarea = device->machine().primary_screen->visible_area();
h_sync = visarea.max_x+1;//horz
v_sync = visarea.max_y+1;//vert
@@ -2809,14 +2809,14 @@ static INTERRUPT_GEN( stv_interrupt )
/*Next V-Blank-OUT event*/
if(stv_irq.vblank_out)
- vblank_out_timer->adjust(device->machine->primary_screen->time_until_pos(0));
+ vblank_out_timer->adjust(device->machine().primary_screen->time_until_pos(0));
/*Set the first Hblank-IN event*/
if(stv_irq.hblank_in || stv_irq.timer_0 || stv_irq.timer_1)
- scan_timer->adjust(device->machine->primary_screen->time_until_pos(0, h_sync));
+ scan_timer->adjust(device->machine().primary_screen->time_until_pos(0, h_sync));
/*TODO: timing of this one (related to the VDP1 speed)*/
/* (NOTE: value shouldn't be at h_sync/v_sync position (will break shienryu))*/
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(0), FUNC(vdp1_irq));
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(0), FUNC(vdp1_irq));
}
static MACHINE_RESET( stv )
@@ -2835,18 +2835,18 @@ static MACHINE_RESET( stv )
port_sel = mux_data = 0;
port_i = -1;
- machine->device("maincpu")->set_unscaled_clock(MASTER_CLOCK_320/2);
- machine->device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2);
- machine->device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_320/5);
+ machine.device("maincpu")->set_unscaled_clock(MASTER_CLOCK_320/2);
+ machine.device("slave")->set_unscaled_clock(MASTER_CLOCK_320/2);
+ machine.device("audiocpu")->set_unscaled_clock(MASTER_CLOCK_320/5);
stvcd_reset(machine);
/* set the first scanline 0 timer to go off */
- scan_timer = machine->device<timer_device>("scan_timer");
- t1_timer = machine->device<timer_device>("t1_timer");
- vblank_out_timer = machine->device<timer_device>("vbout_timer");
- vblank_out_timer->adjust(machine->primary_screen->time_until_pos(0));
- scan_timer->adjust(machine->primary_screen->time_until_pos(224, 352));
+ scan_timer = machine.device<timer_device>("scan_timer");
+ t1_timer = machine.device<timer_device>("t1_timer");
+ vblank_out_timer = machine.device<timer_device>("vbout_timer");
+ vblank_out_timer->adjust(machine.primary_screen->time_until_pos(0));
+ scan_timer->adjust(machine.primary_screen->time_until_pos(224, 352));
stv_rtc_timer->adjust(attotime::zero, 0, attotime::from_seconds(1));
}
@@ -4015,7 +4015,7 @@ by Sega titles,and this is a Sunsoft game)It's likely to be a left-over...
static DRIVER_INIT( sanjeon )
{
- UINT8 *src = machine->region ( "user1" )->base();
+ UINT8 *src = machine.region ( "user1" )->base();
int x;
for (x=0;x<0x3000000;x++)
diff --git a/src/mame/drivers/stvinit.c b/src/mame/drivers/stvinit.c
index dbf94928326..9fe44206672 100644
--- a/src/mame/drivers/stvinit.c
+++ b/src/mame/drivers/stvinit.c
@@ -76,22 +76,22 @@ static const UINT8 stv_default_eeprom[128] = {
*/
-void install_stvbios_speedups(running_machine *machine)
+void install_stvbios_speedups(running_machine &machine)
{
// flushes 0 & 1 on both CPUs are for the BIOS speedups
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60154b2);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6013aee);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60154b2);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6013aee);
- sh2drc_add_pcflush(machine->device("slave"), 0x60154b2);
- sh2drc_add_pcflush(machine->device("slave"), 0x6013aee);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60154b2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6013aee);
}
DRIVER_INIT(shienryu)
{
// master
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c6);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60041c6);
// slave
- sh2drc_add_pcflush(machine->device("slave"), 0x600440e);
+ sh2drc_add_pcflush(machine.device("slave"), 0x600440e);
DRIVER_INIT_CALL(stv);
}
@@ -106,9 +106,9 @@ DRIVER_INIT(prikura)
(loops for 263473 instructions)
*/
// master
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6018640);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6018640);
// slave
- sh2drc_add_pcflush(machine->device("slave"), 0x6018c6e);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6018c6e);
DRIVER_INIT_CALL(stv);
@@ -135,7 +135,7 @@ DRIVER_INIT(hanagumi)
(loops for 288688 instructions)
*/
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6010160);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6010160);
DRIVER_INIT_CALL(stv);
}
@@ -161,9 +161,9 @@ CPU0: Aids Screen
DRIVER_INIT(puyosun)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6021cf0);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6021cf0);
- sh2drc_add_pcflush(machine->device("slave"), 0x60236fe);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60236fe);
DRIVER_INIT_CALL(stv);
@@ -183,7 +183,7 @@ CPU0 Data East Logo:
DRIVER_INIT(mausuke)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60461A0);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60461A0);
DRIVER_INIT_CALL(stv);
@@ -193,8 +193,8 @@ DRIVER_INIT(mausuke)
DRIVER_INIT(cottonbm)
{
-// sh2drc_add_pcflush(machine->device("maincpu"), 0x6030ee2);
-// sh2drc_add_pcflush(machine->device("slave"), 0x6032b52);
+// sh2drc_add_pcflush(machine.device("maincpu"), 0x6030ee2);
+// sh2drc_add_pcflush(machine.device("slave"), 0x6032b52);
DRIVER_INIT_CALL(stv);
@@ -203,8 +203,8 @@ DRIVER_INIT(cottonbm)
DRIVER_INIT(cotton2)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6031c7a);
- sh2drc_add_pcflush(machine->device("slave"), 0x60338ea);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6031c7a);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60338ea);
DRIVER_INIT_CALL(stv);
@@ -214,13 +214,13 @@ DRIVER_INIT(cotton2)
DRIVER_INIT(dnmtdeka)
{
// install all 3 speedups on both master and slave
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c90);
- sh2drc_add_pcflush(machine->device("maincpu"), 0xd04);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6027c90);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0xd04);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60051f2);
- sh2drc_add_pcflush(machine->device("slave"), 0x6027c90);
- sh2drc_add_pcflush(machine->device("slave"), 0xd04);
- sh2drc_add_pcflush(machine->device("slave"), 0x60051f2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6027c90);
+ sh2drc_add_pcflush(machine.device("slave"), 0xd04);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60051f2);
DRIVER_INIT_CALL(stv);
}
@@ -228,33 +228,33 @@ DRIVER_INIT(dnmtdeka)
DRIVER_INIT(diehard)
{
// install all 3 speedups on both master and slave
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6027c98);
- sh2drc_add_pcflush(machine->device("maincpu"), 0xd04);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60051f2);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6027c98);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0xd04);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60051f2);
- sh2drc_add_pcflush(machine->device("slave"), 0x6027c98);
- sh2drc_add_pcflush(machine->device("slave"), 0xd04);
- sh2drc_add_pcflush(machine->device("slave"), 0x60051f2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6027c98);
+ sh2drc_add_pcflush(machine.device("slave"), 0xd04);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60051f2);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(fhboxers)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60041c2);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x600bb0a);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x600b31e);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60041c2);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x600bb0a);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x600b31e);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT( groovef )
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e7c);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6005e86);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60a4970);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6005e7c);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6005e86);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60a4970);
- sh2drc_add_pcflush(machine->device("slave"), 0x60060c2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60060c2);
DRIVER_INIT_CALL(stv);
@@ -264,9 +264,9 @@ DRIVER_INIT( groovef )
DRIVER_INIT( danchih )
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6028b28);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6028c8e);
- sh2drc_add_pcflush(machine->device("slave"), 0x602ae26);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6028b28);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6028c8e);
+ sh2drc_add_pcflush(machine.device("slave"), 0x602ae26);
DRIVER_INIT_CALL(stv);
@@ -305,10 +305,10 @@ static READ32_HANDLER( astrass_hack_r )
DRIVER_INIT( astrass )
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60011b8);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x605b9da);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60011b8);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x605b9da);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x06000770, 0x06000773, FUNC(astrass_hack_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x06000770, 0x06000773, FUNC(astrass_hack_r) );
install_astrass_protection(machine);
@@ -317,9 +317,9 @@ DRIVER_INIT( astrass )
DRIVER_INIT(thunt)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x602A024);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6013EEA);
- sh2drc_add_pcflush(machine->device("slave"), 0x602AAF8);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x602A024);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6013EEA);
+ sh2drc_add_pcflush(machine.device("slave"), 0x602AAF8);
DRIVER_INIT_CALL(stv);
@@ -328,9 +328,9 @@ DRIVER_INIT(thunt)
DRIVER_INIT(sandor)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x602a0f8);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6013fbe);
- sh2drc_add_pcflush(machine->device("slave"), 0x602abcc);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x602a0f8);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6013fbe);
+ sh2drc_add_pcflush(machine.device("slave"), 0x602abcc);
DRIVER_INIT_CALL(stv);
minit_boost_timeslice = sinit_boost_timeslice = attotime::from_usec(1);
@@ -338,8 +338,8 @@ DRIVER_INIT(sandor)
DRIVER_INIT(grdforce)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6041e32);
- sh2drc_add_pcflush(machine->device("slave"), 0x6043aa2);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6041e32);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6043aa2);
DRIVER_INIT_CALL(stv);
@@ -348,8 +348,8 @@ DRIVER_INIT(grdforce)
DRIVER_INIT(batmanfr)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x60121c0);
- sh2drc_add_pcflush(machine->device("slave"), 0x60125bc);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x60121c0);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60125bc);
DRIVER_INIT_CALL(stv);
@@ -359,7 +359,7 @@ DRIVER_INIT(batmanfr)
DRIVER_INIT(colmns97)
{
- sh2drc_add_pcflush(machine->device("slave"), 0x60298a2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60298a2);
DRIVER_INIT_CALL(stv);
@@ -368,8 +368,8 @@ DRIVER_INIT(colmns97)
DRIVER_INIT(winterht)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6098aea);
- sh2drc_add_pcflush(machine->device("slave"), 0x609ae4e);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6098aea);
+ sh2drc_add_pcflush(machine.device("slave"), 0x609ae4e);
DRIVER_INIT_CALL(stv);
@@ -378,8 +378,8 @@ DRIVER_INIT(winterht)
DRIVER_INIT(seabass)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x602cbfa);
- sh2drc_add_pcflush(machine->device("slave"), 0x60321ee);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x602cbfa);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60321ee);
DRIVER_INIT_CALL(stv);
@@ -388,8 +388,8 @@ DRIVER_INIT(seabass)
DRIVER_INIT(vfremix)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x602c30c);
- sh2drc_add_pcflush(machine->device("slave"), 0x604c332);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x602c30c);
+ sh2drc_add_pcflush(machine.device("slave"), 0x604c332);
DRIVER_INIT_CALL(stv);
@@ -398,8 +398,8 @@ DRIVER_INIT(vfremix)
DRIVER_INIT(sss)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6026398);
- sh2drc_add_pcflush(machine->device("slave"), 0x6028cd6);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6026398);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6028cd6);
install_sss_protection(machine);
@@ -410,8 +410,8 @@ DRIVER_INIT(sss)
DRIVER_INIT(othellos)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x602bcbe);
- sh2drc_add_pcflush(machine->device("slave"), 0x602d92e);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x602bcbe);
+ sh2drc_add_pcflush(machine.device("slave"), 0x602d92e);
DRIVER_INIT_CALL(stv);
@@ -420,7 +420,7 @@ DRIVER_INIT(othellos)
DRIVER_INIT(sasissu)
{
- sh2drc_add_pcflush(machine->device("slave"), 0x60710be);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60710be);
DRIVER_INIT_CALL(stv);
@@ -429,14 +429,14 @@ DRIVER_INIT(sasissu)
DRIVER_INIT(gaxeduel)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ee4);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6012ee4);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(suikoenb)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6013f7a);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6013f7a);
DRIVER_INIT_CALL(stv);
}
@@ -451,8 +451,8 @@ DRIVER_INIT(sokyugrt)
DRIVER_INIT(znpwfv)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6012ec2);
- sh2drc_add_pcflush(machine->device("slave"), 0x60175a6);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6012ec2);
+ sh2drc_add_pcflush(machine.device("slave"), 0x60175a6);
DRIVER_INIT_CALL(stv);
minit_boost_timeslice = sinit_boost_timeslice = attotime::from_nsec(500);
@@ -460,8 +460,8 @@ DRIVER_INIT(znpwfv)
DRIVER_INIT(twcup98)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x605edde);
- sh2drc_add_pcflush(machine->device("slave"), 0x6062bca);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x605edde);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6062bca);
DRIVER_INIT_CALL(stv);
install_twcup98_protection(machine);
@@ -471,8 +471,8 @@ DRIVER_INIT(twcup98)
DRIVER_INIT(smleague)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6063bf4);
- sh2drc_add_pcflush(machine->device("slave"), 0x6062bca);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6063bf4);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6062bca);
DRIVER_INIT_CALL(stv);
@@ -481,15 +481,15 @@ DRIVER_INIT(smleague)
DRIVER_INIT(finlarch)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6064d60);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6064d60);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(maruchan)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x601ba46);
- sh2drc_add_pcflush(machine->device("slave"), 0x601ba46);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x601ba46);
+ sh2drc_add_pcflush(machine.device("slave"), 0x601ba46);
DRIVER_INIT_CALL(stv);
@@ -498,22 +498,22 @@ DRIVER_INIT(maruchan)
DRIVER_INIT(pblbeach)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x605eb78);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x605eb78);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(shanhigw)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6020c5c);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6020c5c);
DRIVER_INIT_CALL(stv);
}
DRIVER_INIT(elandore)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x604eac0);
- sh2drc_add_pcflush(machine->device("slave"), 0x605340a);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x604eac0);
+ sh2drc_add_pcflush(machine.device("slave"), 0x605340a);
install_elandore_protection(machine);
@@ -523,8 +523,8 @@ DRIVER_INIT(elandore)
DRIVER_INIT(rsgun)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6034d04);
- sh2drc_add_pcflush(machine->device("slave"), 0x6036152);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6034d04);
+ sh2drc_add_pcflush(machine.device("slave"), 0x6036152);
install_rsgun_protection(machine);
@@ -547,8 +547,8 @@ DRIVER_INIT(decathlt)
DRIVER_INIT(nameclv3)
{
- sh2drc_add_pcflush(machine->device("maincpu"), 0x601eb4c);
- sh2drc_add_pcflush(machine->device("slave"), 0x602b80e);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x601eb4c);
+ sh2drc_add_pcflush(machine.device("slave"), 0x602b80e);
DRIVER_INIT_CALL(stv);
}
diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c
index 0a09dd8f55b..5b971468c26 100644
--- a/src/mame/drivers/sub.c
+++ b/src/mame/drivers/sub.c
@@ -132,9 +132,9 @@ static VIDEO_START(sub)
static SCREEN_UPDATE(sub)
{
- sub_state *state = screen->machine->driver_data<sub_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
- const gfx_element *gfx_1 = screen->machine->gfx[1];
+ sub_state *state = screen->machine().driver_data<sub_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
+ const gfx_element *gfx_1 = screen->machine().gfx[1];
int y,x;
int count = 0;
@@ -238,12 +238,12 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( subm_to_sound_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, HOLD_LINE);
}
static WRITE8_HANDLER( nmi_mask_w )
{
- sub_state *state = space->machine->driver_data<sub_state>();
+ sub_state *state = space->machine().driver_data<sub_state>();
state->nmi_en = data & 1;
}
@@ -381,10 +381,10 @@ GFXDECODE_END
static PALETTE_INIT( sub )
{
int i;
- UINT8* lookup = machine->region("proms2")->base();
+ UINT8* lookup = machine.region("proms2")->base();
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
for (i = 0;i < 0x100;i++)
{
@@ -393,8 +393,8 @@ static PALETTE_INIT( sub )
g = (color_prom[0x100] >> 0);
b = (color_prom[0x200] >> 0);
- //colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(r), pal4bit(g), pal4bit(b)));
+ //colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal4bit(r), pal4bit(g), pal4bit(b)));
color_prom++;
}
@@ -403,7 +403,7 @@ static PALETTE_INIT( sub )
for (i = 0;i < 0x400;i++)
{
UINT8 ctabentry = lookup[i+0x400] | (lookup[i+0x000] << 4);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -411,10 +411,10 @@ static PALETTE_INIT( sub )
static INTERRUPT_GEN( subm_sound_irq )
{
- sub_state *state = device->machine->driver_data<sub_state>();
+ sub_state *state = device->machine().driver_data<sub_state>();
if(state->nmi_en)
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_CONFIG_START( sub, sub_state )
diff --git a/src/mame/drivers/subsino.c b/src/mame/drivers/subsino.c
index b88512c426a..3ccdcba1313 100644
--- a/src/mame/drivers/subsino.c
+++ b/src/mame/drivers/subsino.c
@@ -266,7 +266,7 @@ public:
static WRITE8_HANDLER( subsino_tiles_offset_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->tiles_offset = (data & 1) ? 0x1000: 0;
tilemap_mark_tile_dirty(state->tmap, offset);
// popmessage("gfx %02x",data);
@@ -274,21 +274,21 @@ static WRITE8_HANDLER( subsino_tiles_offset_w )
static WRITE8_HANDLER( subsino_videoram_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset);
}
static WRITE8_HANDLER( subsino_colorram_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset);
}
static TILE_GET_INFO( get_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
UINT16 code = state->videoram[ tile_index ] + (state->colorram[ tile_index ] << 8);
UINT16 color = (code >> 8) & 0x0f;
code = ((code & 0xf000) >> 4) + ((code & 0xff) >> 0);
@@ -298,7 +298,7 @@ static TILE_GET_INFO( get_tile_info )
static TILE_GET_INFO( get_stisub_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
UINT16 code = state->videoram[ tile_index ] + (state->colorram[ tile_index ] << 8);
code&= 0x3fff;
SET_TILE_INFO(0, code, 0, 0);
@@ -307,7 +307,7 @@ static TILE_GET_INFO( get_stisub_tile_info )
static VIDEO_START( subsino )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
state->tmap = tilemap_create( machine, get_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20 );
tilemap_set_transparent_pen( state->tmap, 0 );
state->tiles_offset = 0;
@@ -317,14 +317,14 @@ static VIDEO_START( subsino )
static WRITE8_HANDLER( subsino_reel1_ram_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
static TILE_GET_INFO( get_subsino_reel1_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel1_ram[tile_index];
int colour = (state->out_c&0x7) + 8;
@@ -337,7 +337,7 @@ static TILE_GET_INFO( get_subsino_reel1_tile_info )
static TILE_GET_INFO( get_stisub_reel1_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel1_ram[tile_index];
int attr = state->reel1_attr[tile_index];
@@ -351,14 +351,14 @@ static TILE_GET_INFO( get_stisub_reel1_tile_info )
static WRITE8_HANDLER( subsino_reel2_ram_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static TILE_GET_INFO( get_subsino_reel2_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel2_ram[tile_index];
int colour = (state->out_c&0x7) + 8;
@@ -371,7 +371,7 @@ static TILE_GET_INFO( get_subsino_reel2_tile_info )
static TILE_GET_INFO( get_stisub_reel2_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel2_ram[tile_index];
int attr = state->reel2_attr[tile_index];
@@ -384,14 +384,14 @@ static TILE_GET_INFO( get_stisub_reel2_tile_info )
static WRITE8_HANDLER( subsino_reel3_ram_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
static TILE_GET_INFO( get_subsino_reel3_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel3_ram[tile_index];
int colour = (state->out_c&0x7) + 8;
@@ -404,7 +404,7 @@ static TILE_GET_INFO( get_subsino_reel3_tile_info )
static TILE_GET_INFO( get_stisub_reel3_tile_info )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
int code = state->reel3_ram[tile_index];
int attr = state->reel3_attr[tile_index];
@@ -418,7 +418,7 @@ static TILE_GET_INFO( get_stisub_reel3_tile_info )
static VIDEO_START( subsino_reels )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
VIDEO_START_CALL( subsino );
state->reel1_tilemap = tilemap_create(machine,get_subsino_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
@@ -433,7 +433,7 @@ static VIDEO_START( subsino_reels )
static VIDEO_START( stisub )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
state->tmap = tilemap_create( machine, get_stisub_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20 );
tilemap_set_transparent_pen( state->tmap, 0 );
@@ -451,7 +451,7 @@ static VIDEO_START( stisub )
static SCREEN_UPDATE( subsino )
{
- subsino_state *state = screen->machine->driver_data<subsino_state>();
+ subsino_state *state = screen->machine().driver_data<subsino_state>();
bitmap_fill(bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect, state->tmap, 0, 0);
return 0;
@@ -464,7 +464,7 @@ static const rectangle visible3 = { 0*8, (14+48)*8-1, 18*8, (18+7)*8-1 };
static SCREEN_UPDATE( subsino_reels )
{
- subsino_state *state = screen->machine->driver_data<subsino_state>();
+ subsino_state *state = screen->machine().driver_data<subsino_state>();
int i;
bitmap_fill(bitmap,cliprect,0);
@@ -494,7 +494,7 @@ static const rectangle stisub_visible3 = { 0, 511, 144, 223 };
static SCREEN_UPDATE( stisub_reels )
{
- subsino_state *state = screen->machine->driver_data<subsino_state>();
+ subsino_state *state = screen->machine().driver_data<subsino_state>();
int i;
bitmap_fill(bitmap,cliprect,0);
@@ -623,10 +623,10 @@ static WRITE8_HANDLER( subsino_out_a_w )
output_set_lamp_value(14, (data >> 6) & 1); /* Lamp 14 */
output_set_lamp_value(15, (data >> 7) & 1); /* Lamp 15 */
- coin_counter_w( space->machine, 0, data & 0x01 ); /* coin / keyin */
- coin_counter_w( space->machine, 1, data & 0x02 ); /* keyin / coin */
- coin_counter_w( space->machine, 2, data & 0x10 ); /* keyout */
- coin_counter_w( space->machine, 3, data & 0x20 ); /* payout */
+ coin_counter_w( space->machine(), 0, data & 0x01 ); /* coin / keyin */
+ coin_counter_w( space->machine(), 1, data & 0x02 ); /* keyin / coin */
+ coin_counter_w( space->machine(), 2, data & 0x10 ); /* keyout */
+ coin_counter_w( space->machine(), 3, data & 0x20 ); /* payout */
// popmessage("Out A %02x",data);
@@ -886,7 +886,7 @@ what it is exactly and what it can possibly do.
static READ8_HANDLER( flash_r )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
// printf("R %02x\n",state->flash_val);
if(state->flash_val == 0xff)
@@ -901,7 +901,7 @@ static READ8_HANDLER( flash_r )
static WRITE8_HANDLER( flash_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
switch(state->flash_packet_start)
{
case 0:
@@ -967,7 +967,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( subsino_out_c_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
// not 100% sure on this
// ???? eccc
@@ -1025,7 +1025,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(colordac_w)
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
switch ( offset )
{
case 0:
@@ -1034,7 +1034,7 @@ static WRITE8_HANDLER(colordac_w)
case 1:
state->stisub_colorram[state->colordac_offs] = data;
- palette_set_color_rgb(space->machine, state->colordac_offs/3,
+ palette_set_color_rgb(space->machine(), state->colordac_offs/3,
pal6bit(state->stisub_colorram[(state->colordac_offs/3)*3+0]),
pal6bit(state->stisub_colorram[(state->colordac_offs/3)*3+1]),
pal6bit(state->stisub_colorram[(state->colordac_offs/3)*3+2])
@@ -1054,7 +1054,7 @@ static WRITE8_HANDLER(colordac_w)
static WRITE8_HANDLER( stisub_out_c_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
state->stisub_outc = data;
}
@@ -1063,7 +1063,7 @@ static WRITE8_HANDLER( stisub_out_c_w )
// not 100% sure on the bank bits.. other bits are also set
static WRITE8_HANDLER( reel_scrollattr_w )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
if (state->stisub_outc&0x20)
{
if (offset<0x200)
@@ -1108,7 +1108,7 @@ static WRITE8_HANDLER( reel_scrollattr_w )
static READ8_HANDLER( reel_scrollattr_r )
{
- subsino_state *state = space->machine->driver_data<subsino_state>();
+ subsino_state *state = space->machine().driver_data<subsino_state>();
return state->reel1_attr[offset];
}
@@ -3352,7 +3352,7 @@ ROM_END
static DRIVER_INIT( smoto16 )
{
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
rom[0x12d0] = 0x20; // "ERROR 951010"
}
@@ -3476,11 +3476,11 @@ ROM_END
***************************************************************************/
#if 0
-void dump_decrypted(running_machine* machine, UINT8* decrypt)
+void dump_decrypted(running_machine& machine, UINT8* decrypt)
{
FILE *fp;
char filename[256];
- sprintf(filename,"dat_%s", machine->system().name);
+ sprintf(filename,"dat_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -3545,11 +3545,11 @@ static void sharkpy_bitswaps(UINT8* decrypt, int i)
if ((i&7) == 7) decrypt[i] = BITSWAP8(decrypt[i],3,6,1,4,7,2,5,0);
}
-static void subsino_decrypt(running_machine* machine, void (*bitswaps)(UINT8* decrypt, int i), const UINT8* xors, int size)
+static void subsino_decrypt(running_machine& machine, void (*bitswaps)(UINT8* decrypt, int i), const UINT8* xors, int size)
{
int i;
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8* region = machine->region("maincpu")->base();
+ UINT8* region = machine.region("maincpu")->base();
for (i=0;i<0x10000;i++)
{
@@ -3596,13 +3596,13 @@ static DRIVER_INIT( sharkpye )
static DRIVER_INIT( smoto20 )
{
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
rom[0x12e1] = 0x20; // "ERROR 951010"
}
static DRIVER_INIT( tisub )
{
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3617,7 +3617,7 @@ static DRIVER_INIT( tisub )
static DRIVER_INIT( tisuba )
{
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
DRIVER_INIT_CALL(victor5);
@@ -3632,8 +3632,8 @@ static DRIVER_INIT( tisuba )
static DRIVER_INIT( stisub )
{
- subsino_state *state = machine->driver_data<subsino_state>();
- UINT8 *rom = machine->region( "maincpu" )->base();
+ subsino_state *state = machine.driver_data<subsino_state>();
+ UINT8 *rom = machine.region( "maincpu" )->base();
rom[0x1005] = 0x1d; //patch protection check
rom[0x7ab] = 0x18; //patch "winning protection" check
rom[0x957] = 0x18; //patch "losing protection" check
@@ -3650,7 +3650,7 @@ static DRIVER_INIT( stisub )
static DRIVER_INIT( mtrainnv )
{
- subsino_state *state = machine->driver_data<subsino_state>();
+ subsino_state *state = machine.driver_data<subsino_state>();
state->stisub_colorram = auto_alloc_array(machine, UINT8, 256*3);
state->reel1_scroll = auto_alloc_array(machine, UINT8, 0x40);
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index 01f4c2d419c..a937ec6aeb6 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -102,7 +102,7 @@ public:
Tilemaps Access
***************************************************************************/
-INLINE void ss9601_get_tile_info(layer_t *l, running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
+INLINE void ss9601_get_tile_info(layer_t *l, running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
{
int addr;
UINT16 offs;
@@ -119,26 +119,26 @@ INLINE void ss9601_get_tile_info(layer_t *l, running_machine *machine, tile_data
// Layer 0
static TILE_GET_INFO( ss9601_get_tile_info_0 )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
ss9601_get_tile_info(&state->layers[0], machine, tileinfo, tile_index, param);
}
// Layer 1
static TILE_GET_INFO( ss9601_get_tile_info_1 )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
ss9601_get_tile_info(&state->layers[1], machine, tileinfo, tile_index, param);
}
static WRITE8_HANDLER( ss9601_byte_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_byte_lo = data;
}
static WRITE8_HANDLER( ss9601_byte_lo2_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_byte_lo2 = data;
}
@@ -172,78 +172,78 @@ INLINE void ss9601_videoram_w(layer_t *l, vram_t vram, address_space *space, off
// Layer 0
static WRITE8_HANDLER( ss9601_videoram_0_hi_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[0], VRAM_HI, space, offset, data);
}
static WRITE8_HANDLER( ss9601_videoram_0_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[0], VRAM_LO, space, offset, data);
}
static WRITE8_HANDLER( ss9601_videoram_0_hi_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[0], VRAM_HI, space, offset, data);
ss9601_videoram_w(&state->layers[0], VRAM_LO, space, offset, state->ss9601_byte_lo);
}
static WRITE8_HANDLER( ss9601_videoram_0_hi_lo2_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[0], VRAM_HI, space, offset, data);
ss9601_videoram_w(&state->layers[0], VRAM_LO, space, offset, state->ss9601_byte_lo2);
}
static READ8_HANDLER( ss9601_videoram_0_hi_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[0].videorams[VRAM_HI][offset];
}
static READ8_HANDLER( ss9601_videoram_0_lo_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[0].videorams[VRAM_LO][offset];
}
// Layer 1
static WRITE8_HANDLER( ss9601_videoram_1_hi_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[1], VRAM_HI, space, offset, data);
}
static WRITE8_HANDLER( ss9601_videoram_1_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[1], VRAM_LO, space, offset, data);
}
static WRITE8_HANDLER( ss9601_videoram_1_hi_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[1], VRAM_HI, space, offset, data);
ss9601_videoram_w(&state->layers[1], VRAM_LO, space, offset, state->ss9601_byte_lo);
}
static WRITE8_HANDLER( ss9601_videoram_1_hi_lo2_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
ss9601_videoram_w(&state->layers[1], VRAM_HI, space, offset, data);
ss9601_videoram_w(&state->layers[1], VRAM_LO, space, offset, state->ss9601_byte_lo2);
}
static READ8_HANDLER( ss9601_videoram_1_hi_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[1].videorams[VRAM_HI][offset];
}
static READ8_HANDLER( ss9601_videoram_1_lo_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[1].videorams[VRAM_LO][offset];
}
@@ -251,18 +251,18 @@ static READ8_HANDLER( ss9601_videoram_1_lo_r )
static WRITE8_HANDLER( ss9601_reelram_hi_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_reelrams[VRAM_HI][offset] = data;
state->ss9601_reelrams[VRAM_LO][offset] = state->ss9601_byte_lo;
}
static READ8_HANDLER( ss9601_reelram_hi_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->ss9601_reelrams[VRAM_HI][offset];
}
static READ8_HANDLER( ss9601_reelram_lo_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->ss9601_reelrams[VRAM_LO][offset];
}
@@ -374,13 +374,13 @@ mtrain saklove xtrain, expcard
static WRITE8_HANDLER( ss9601_scrollctrl_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_scrollctrl = data;
}
static WRITE8_HANDLER( ss9601_tilesize_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_tilesize = data;
tilesize_t sizes[2];
@@ -405,7 +405,7 @@ static WRITE8_HANDLER( ss9601_tilesize_w )
sizes[0] = TILE_8x8;
sizes[1] = TILE_8x8;
- logerror("%s: warning, unknown tilesize = %02x\n", space->machine->describe_context(), data);
+ logerror("%s: warning, unknown tilesize = %02x\n", space->machine().describe_context(), data);
popmessage("UNKNOWN TILESIZE %02X", data);
break;
}
@@ -428,7 +428,7 @@ static WRITE8_HANDLER( ss9601_tilesize_w )
static WRITE8_HANDLER( ss9601_scroll_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
layer_t *layers = state->layers;
switch ( offset )
{
@@ -449,64 +449,64 @@ static WRITE8_HANDLER( ss9601_scroll_w )
// Layer 0
static WRITE8_HANDLER( ss9601_scrollram_0_hi_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[0].scrollrams[VRAM_HI][offset] = data;
}
static WRITE8_HANDLER( ss9601_scrollram_0_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[0].scrollrams[VRAM_LO][offset] = data;
}
static WRITE8_HANDLER( ss9601_scrollram_0_hi_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[0].scrollrams[VRAM_HI][offset] = data;
state->layers[0].scrollrams[VRAM_LO][offset] = state->ss9601_byte_lo;
}
static READ8_HANDLER ( ss9601_scrollram_0_hi_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[0].scrollrams[VRAM_HI][offset];
}
static READ8_HANDLER ( ss9601_scrollram_0_lo_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[0].scrollrams[VRAM_LO][offset];
}
// Layer 1
static WRITE8_HANDLER( ss9601_scrollram_1_hi_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[1].scrollrams[VRAM_HI][offset] = data;
}
static WRITE8_HANDLER( ss9601_scrollram_1_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[1].scrollrams[VRAM_LO][offset] = data;
}
static WRITE8_HANDLER( ss9601_scrollram_1_hi_lo_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->layers[1].scrollrams[VRAM_HI][offset] = data;
state->layers[1].scrollrams[VRAM_LO][offset] = state->ss9601_byte_lo;
}
static READ8_HANDLER ( ss9601_scrollram_1_hi_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[1].scrollrams[VRAM_HI][offset];
}
static READ8_HANDLER ( ss9601_scrollram_1_lo_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->layers[1].scrollrams[VRAM_LO][offset];
}
@@ -517,7 +517,7 @@ static READ8_HANDLER ( ss9601_scrollram_1_lo_r )
static WRITE8_HANDLER( ss9601_disable_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_disable = data;
}
@@ -536,7 +536,7 @@ static const rectangle xtrain_reelrects[3] = { { 0, 0, 0x00*8, 0x08*8-1 },
static VIDEO_START( subsino2 )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
state->hm86171_colorram = auto_alloc_array(machine, UINT8, 256*3);
// SS9601 Regs:
@@ -589,30 +589,30 @@ static VIDEO_START( subsino2 )
static VIDEO_START( mtrain )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
VIDEO_START_CALL( subsino2 );
state->ss9601_reelrects = mtrain_reelrects;
}
static VIDEO_START( xtrain )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
VIDEO_START_CALL( subsino2 );
state->ss9601_reelrects = xtrain_reelrects;
}
static SCREEN_UPDATE( subsino2 )
{
- subsino2_state *state = screen->machine->driver_data<subsino2_state>();
+ subsino2_state *state = screen->machine().driver_data<subsino2_state>();
int layers_ctrl = ~state->ss9601_disable;
int y;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
@@ -657,7 +657,7 @@ static SCREEN_UPDATE( subsino2 )
}
}
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (layers_ctrl & 1)
{
@@ -730,7 +730,7 @@ static SCREEN_UPDATE( subsino2 )
static WRITE8_HANDLER( hm86171_colorram_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
switch (offset)
{
case 0:
@@ -739,7 +739,7 @@ static WRITE8_HANDLER( hm86171_colorram_w )
case 1:
state->hm86171_colorram[state->hm86171_offs] = data;
- palette_set_color_rgb(space->machine, state->hm86171_offs/3,
+ palette_set_color_rgb(space->machine(), state->hm86171_offs/3,
pal6bit(state->hm86171_colorram[(state->hm86171_offs/3)*3+0]),
pal6bit(state->hm86171_colorram[(state->hm86171_offs/3)*3+1]),
pal6bit(state->hm86171_colorram[(state->hm86171_offs/3)*3+2])
@@ -763,27 +763,27 @@ static WRITE8_HANDLER( hm86171_colorram_w )
static WRITE8_HANDLER( dsw_mask_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->dsw_mask = data;
}
static READ8_HANDLER( dsw_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
- return ( (input_port_read(space->machine, "DSW1") & state->dsw_mask) ? 0x01 : 0 ) |
- ( (input_port_read(space->machine, "DSW2") & state->dsw_mask) ? 0x02 : 0 ) |
- ( (input_port_read(space->machine, "DSW3") & state->dsw_mask) ? 0x04 : 0 ) |
- ( (input_port_read(space->machine, "DSW4") & state->dsw_mask) ? 0x08 : 0 ) ;
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
+ return ( (input_port_read(space->machine(), "DSW1") & state->dsw_mask) ? 0x01 : 0 ) |
+ ( (input_port_read(space->machine(), "DSW2") & state->dsw_mask) ? 0x02 : 0 ) |
+ ( (input_port_read(space->machine(), "DSW3") & state->dsw_mask) ? 0x04 : 0 ) |
+ ( (input_port_read(space->machine(), "DSW4") & state->dsw_mask) ? 0x08 : 0 ) ;
}
static READ8_HANDLER( vblank_bit2_r )
{
- return space->machine->primary_screen->vblank() ? 0x04 : 0x00;
+ return space->machine().primary_screen->vblank() ? 0x04 : 0x00;
}
static READ8_HANDLER( vblank_bit6_r )
{
- return space->machine->primary_screen->vblank() ? 0x40 : 0x00;
+ return space->machine().primary_screen->vblank() ? 0x40 : 0x00;
}
static WRITE8_DEVICE_HANDLER( oki_bank_bit0_w )
@@ -816,19 +816,19 @@ enum
static READ8_HANDLER( am188em_regs_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return state->am188em_regs[offset];
}
static WRITE8_HANDLER( am188em_regs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->am188em_regs[offset] = data;
}
static MACHINE_RESET( am188em )
{
- subsino2_state *state = machine->driver_data<subsino2_state>();
+ subsino2_state *state = machine.driver_data<subsino2_state>();
// start with masked interrupts
state->am188em_regs[AM188EM_IMASK+0] = 0xfd;
state->am188em_regs[AM188EM_IMASK+1] = 0x07;
@@ -838,7 +838,7 @@ static MACHINE_RESET( am188em )
static INTERRUPT_GEN( am188em_int0_irq )
{
- subsino2_state *state = device->machine->driver_data<subsino2_state>();
+ subsino2_state *state = device->machine().driver_data<subsino2_state>();
if ( ((state->am188em_regs[AM188EM_IMASK+0] & 0x10) == 0) || // IMASK.I0 mask
((state->am188em_regs[AM188EM_I0CON+0] & 0x08) == 0) ) // I0CON.MSK mask
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan)
@@ -846,9 +846,9 @@ static INTERRUPT_GEN( am188em_int0_irq )
static TIMER_DEVICE_CALLBACK( am188em_timer2_irq )
{
- subsino2_state *state = timer.machine->driver_data<subsino2_state>();
+ subsino2_state *state = timer.machine().driver_data<subsino2_state>();
if ((state->am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0x4c/4);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0x4c/4);
}
/***************************************************************************
@@ -858,7 +858,7 @@ static TIMER_DEVICE_CALLBACK( am188em_timer2_irq )
// To be removed when cpu core is updated
static TIMER_DEVICE_CALLBACK( h8_timer_irq )
{
- cputag_set_input_line(timer.machine, "maincpu", H8_METRO_TIMER_HACK, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", H8_METRO_TIMER_HACK, HOLD_LINE);
}
@@ -873,49 +873,49 @@ static TIMER_DEVICE_CALLBACK( h8_timer_irq )
static WRITE16_HANDLER( bishjan_sel_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
if (ACCESSING_BITS_8_15)
state->bishjan_sel = data >> 8;
}
static READ16_HANDLER( bishjan_serial_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
return
- (space->machine->rand() & 0x9800) | // bit 7 - serial communication
+ (space->machine().rand() & 0x9800) | // bit 7 - serial communication
(((state->bishjan_sel==0x12) ? 0x40:0x00) << 8) |
-// (machine->rand() & 0xff);
-// (((space->machine->primary_screen->frame_number()%60)==0)?0x18:0x00);
+// (machine.rand() & 0xff);
+// (((space->machine().primary_screen->frame_number()%60)==0)?0x18:0x00);
0x18;
}
static WRITE16_HANDLER( bishjan_input_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
if (ACCESSING_BITS_8_15)
state->bishjan_input = data >> 8;
}
static READ16_HANDLER( bishjan_input_r )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
int i;
UINT16 res = 0xff;
static const char *const port[] = { "KEYB_0", "KEYB_1", "KEYB_2", "KEYB_3", "KEYB_4" };
for (i = 0; i < 5; i++)
if (state->bishjan_input & (1 << i))
- res = input_port_read(space->machine, port[i]);
+ res = input_port_read(space->machine(), port[i]);
return (res << 8) | // high byte
- input_port_read(space->machine, "SYSTEM") | // low byte
- (ticket_dispenser_r(space->machine->device("hopper"), 0) ? 0x00 : 0x04) // bit 2: hopper sensor
+ input_port_read(space->machine(), "SYSTEM") | // low byte
+ (ticket_dispenser_r(space->machine().device("hopper"), 0) ? 0x00 : 0x04) // bit 2: hopper sensor
;
}
static WRITE16_HANDLER( bishjan_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs16[offset] = data;
switch (offset)
@@ -924,8 +924,8 @@ static WRITE16_HANDLER( bishjan_outputs_w )
if (ACCESSING_BITS_0_7)
{
// coin out data & 0x01;
- ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0002) ? 0x80 : 0); // hopper
- coin_counter_w(space->machine, 0, data & 0x0010 );
+ ticket_dispenser_w(space->machine().device("hopper"), 0, (data & 0x0002) ? 0x80 : 0); // hopper
+ coin_counter_w(space->machine(), 0, data & 0x0010 );
}
break;
}
@@ -988,7 +988,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( expcard_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs[offset] = data;
switch (offset)
@@ -998,21 +998,21 @@ static WRITE8_HANDLER( expcard_outputs_w )
break;
case 1: // C
- set_led_status(space->machine, 0, data & 0x02); // raise
+ set_led_status(space->machine(), 0, data & 0x02); // raise
break;
case 2: // B
- set_led_status(space->machine, 1, data & 0x04); // hold 4 / small & hold 5 / big ?
- set_led_status(space->machine, 2, data & 0x08); // hold 1 / bet
- set_led_status(space->machine, 3, data & 0x10); // hold 2 / take ?
- set_led_status(space->machine, 4, data & 0x20); // hold 3 / double up ?
+ set_led_status(space->machine(), 1, data & 0x04); // hold 4 / small & hold 5 / big ?
+ set_led_status(space->machine(), 2, data & 0x08); // hold 1 / bet
+ set_led_status(space->machine(), 3, data & 0x10); // hold 2 / take ?
+ set_led_status(space->machine(), 4, data & 0x20); // hold 3 / double up ?
break;
case 3: // A
- coin_counter_w(space->machine, 0, data & 0x01 ); // coin in
- coin_counter_w(space->machine, 1, data & 0x02 ); // key in
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // coin in
+ coin_counter_w(space->machine(), 1, data & 0x02 ); // key in
- set_led_status(space->machine, 5, data & 0x10); // start
+ set_led_status(space->machine(), 5, data & 0x10); // start
break;
}
@@ -1025,24 +1025,24 @@ static WRITE8_HANDLER( expcard_outputs_w )
static WRITE8_HANDLER( mtrain_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs[offset] = data;
switch (offset)
{
case 0:
- coin_counter_w(space->machine, 0, data & 0x01 ); // key in
- coin_counter_w(space->machine, 1, data & 0x02 ); // coin in
- coin_counter_w(space->machine, 2, data & 0x10 ); // pay out
-// coin_counter_w(space->machine, 3, data & 0x20 ); // hopper motor
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // key in
+ coin_counter_w(space->machine(), 1, data & 0x02 ); // coin in
+ coin_counter_w(space->machine(), 2, data & 0x10 ); // pay out
+// coin_counter_w(space->machine(), 3, data & 0x20 ); // hopper motor
break;
case 1:
- set_led_status(space->machine, 0, data & 0x01); // stop reel?
- set_led_status(space->machine, 1, data & 0x02); // stop reel? (double or take)
- set_led_status(space->machine, 2, data & 0x04); // start all
- set_led_status(space->machine, 3, data & 0x08); // bet / stop all
- set_led_status(space->machine, 4, data & 0x20); // stop reel? (double or take)
+ set_led_status(space->machine(), 0, data & 0x01); // stop reel?
+ set_led_status(space->machine(), 1, data & 0x02); // stop reel? (double or take)
+ set_led_status(space->machine(), 2, data & 0x04); // start all
+ set_led_status(space->machine(), 3, data & 0x08); // bet / stop all
+ set_led_status(space->machine(), 4, data & 0x20); // stop reel? (double or take)
break;
case 2:
@@ -1057,7 +1057,7 @@ static WRITE8_HANDLER( mtrain_outputs_w )
static WRITE8_HANDLER( mtrain_videoram_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
vram_t vram = (state->ss9601_byte_lo & 0x08) ? VRAM_HI : VRAM_LO;
switch (state->ss9601_byte_lo & (~0x08))
{
@@ -1073,7 +1073,7 @@ static WRITE8_HANDLER( mtrain_videoram_w )
static WRITE8_HANDLER( mtrain_tilesize_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->ss9601_tilesize = data;
tilesize_t sizes[2];
@@ -1093,7 +1093,7 @@ static WRITE8_HANDLER( mtrain_tilesize_w )
sizes[0] = TILE_8x8;
sizes[1] = TILE_8x8;
- logerror("%s: warning, unknown tilesize = %02x\n", space->machine->describe_context(), data);
+ logerror("%s: warning, unknown tilesize = %02x\n", space->machine().describe_context(), data);
popmessage("UNKNOWN TILESIZE %02X", data);
break;
}
@@ -1158,14 +1158,14 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( saklove_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs[offset] = data;
switch (offset)
{
case 0:
- coin_counter_w(space->machine, 0, data & 0x01 ); // coin in
- coin_counter_w(space->machine, 1, data & 0x02 ); // key in
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // coin in
+ coin_counter_w(space->machine(), 1, data & 0x02 ); // key in
break;
case 1:
@@ -1241,7 +1241,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( xplan_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs[offset] = data;
switch (offset)
@@ -1251,22 +1251,22 @@ static WRITE8_HANDLER( xplan_outputs_w )
break;
case 1:
- set_led_status(space->machine, 0, data & 0x02); // raise
+ set_led_status(space->machine(), 0, data & 0x02); // raise
break;
case 2: // B
- set_led_status(space->machine, 1, data & 0x04); // hold 1 / big ?
- set_led_status(space->machine, 2, data & 0x08); // hold 5 / bet
- set_led_status(space->machine, 3, data & 0x10); // hold 4 ?
- set_led_status(space->machine, 4, data & 0x20); // hold 2 / double up
- set_led_status(space->machine, 5, data & 0x40); // hold 3 / small ?
+ set_led_status(space->machine(), 1, data & 0x04); // hold 1 / big ?
+ set_led_status(space->machine(), 2, data & 0x08); // hold 5 / bet
+ set_led_status(space->machine(), 3, data & 0x10); // hold 4 ?
+ set_led_status(space->machine(), 4, data & 0x20); // hold 2 / double up
+ set_led_status(space->machine(), 5, data & 0x40); // hold 3 / small ?
break;
case 3: // A
- coin_counter_w(space->machine, 0, data & 0x01 );
- coin_counter_w(space->machine, 1, data & 0x02 );
+ coin_counter_w(space->machine(), 0, data & 0x01 );
+ coin_counter_w(space->machine(), 1, data & 0x02 );
- set_led_status(space->machine, 6, data & 0x10); // start / take
+ set_led_status(space->machine(), 6, data & 0x10); // start / take
break;
}
@@ -1344,7 +1344,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( xtrain_outputs_w )
{
- subsino2_state *state = space->machine->driver_data<subsino2_state>();
+ subsino2_state *state = space->machine().driver_data<subsino2_state>();
state->outputs[offset] = data;
switch (offset)
@@ -1354,23 +1354,23 @@ static WRITE8_HANDLER( xtrain_outputs_w )
break;
case 1: // C
- set_led_status(space->machine, 0, data & 0x02); // re-double
- set_led_status(space->machine, 1, data & 0x04); // half double
+ set_led_status(space->machine(), 0, data & 0x02); // re-double
+ set_led_status(space->machine(), 1, data & 0x04); // half double
break;
case 2: // B
- set_led_status(space->machine, 2, data & 0x02); // hold 3 / small
- set_led_status(space->machine, 3, data & 0x04); // hold 2 / big
- set_led_status(space->machine, 4, data & 0x08); // bet
- set_led_status(space->machine, 5, data & 0x10); // hold1 / take
- set_led_status(space->machine, 6, data & 0x20); // double up
+ set_led_status(space->machine(), 2, data & 0x02); // hold 3 / small
+ set_led_status(space->machine(), 3, data & 0x04); // hold 2 / big
+ set_led_status(space->machine(), 4, data & 0x08); // bet
+ set_led_status(space->machine(), 5, data & 0x10); // hold1 / take
+ set_led_status(space->machine(), 6, data & 0x20); // double up
break;
case 3: // A
- coin_counter_w(space->machine, 0, data & 0x01 ); // coin in
- coin_counter_w(space->machine, 1, data & 0x02 ); // key in
+ coin_counter_w(space->machine(), 0, data & 0x01 ); // coin in
+ coin_counter_w(space->machine(), 1, data & 0x02 ); // key in
- set_led_status(space->machine, 7, data & 0x10); // start
+ set_led_status(space->machine(), 7, data & 0x10); // start
break;
}
@@ -2217,7 +2217,7 @@ ROM_END
static DRIVER_INIT( bishjan )
{
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x042EA/2] = 0x4008;
@@ -2281,7 +2281,7 @@ ROM_END
static DRIVER_INIT( expcard )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xed4dc-0xc0000] = 0xeb;
@@ -2381,11 +2381,11 @@ static void crsbingo_bitswaps(UINT8* decrypt, int i)
static const unsigned char crsbingo_xors[8] = { 0xbb, 0xcc, 0xcc, 0xdd, 0xaa, 0x11, 0x44, 0xee };
-static void subsino_decrypt(running_machine* machine, void (*bitswaps)(UINT8* decrypt, int i), const UINT8* xors, int size)
+static void subsino_decrypt(running_machine& machine, void (*bitswaps)(UINT8* decrypt, int i), const UINT8* xors, int size)
{
int i;
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8* region = machine->region("maincpu")->base();
+ UINT8* region = machine.region("maincpu")->base();
for (i=0;i<0x10000;i++)
{
@@ -2408,7 +2408,7 @@ DRIVER_INIT( mtrain )
subsino_decrypt(machine, crsbingo_bitswaps, crsbingo_xors, 0x8000);
// patch serial protection test (it always enters test mode on boot otherwise)
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x0cec] = 0x18;
rom[0xb037] = 0x18;
@@ -2462,7 +2462,7 @@ ROM_END
static DRIVER_INIT( saklove )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// patch serial protection test (it always enters test mode on boot otherwise)
rom[0x0e029] = 0xeb;
@@ -2522,7 +2522,7 @@ ROM_END
static DRIVER_INIT( xplan )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xeded9-0xc0000] = 0xeb;
@@ -2582,7 +2582,7 @@ ROM_END
static DRIVER_INIT( xtrain )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// patch protection test (it always enters test mode on boot otherwise)
rom[0xe190f-0xc0000] = 0xeb;
diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c
index 6496e299ad5..29e57a49e04 100644
--- a/src/mame/drivers/suna16.c
+++ b/src/mame/drivers/suna16.c
@@ -53,11 +53,11 @@ static WRITE16_HANDLER( bssoccer_leds_w )
{
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
- coin_counter_w(space->machine, 0, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x10);
}
if (data & ~0x1f) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
}
@@ -67,9 +67,9 @@ static WRITE16_HANDLER( uballoon_leds_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 0, data & 0x02);
- set_led_status(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 0, data & 0x02);
+ set_led_status(space->machine(), 1, data & 0x04);
}
if (data & ~0x07) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
}
@@ -79,7 +79,7 @@ static WRITE16_HANDLER( bestbest_coin_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x04);
}
if (data & ~0x04) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
}
@@ -148,7 +148,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( bestbest_prot_r )
{
- suna16_state *state = space->machine->driver_data<suna16_state>();
+ suna16_state *state = space->machine().driver_data<suna16_state>();
return state->prot;
}
@@ -157,7 +157,7 @@ static WRITE16_HANDLER( bestbest_prot_w )
{
if (ACCESSING_BITS_0_7)
{
- suna16_state *state = space->machine->driver_data<suna16_state>();
+ suna16_state *state = space->machine().driver_data<suna16_state>();
switch (data & 0xff)
{
@@ -263,18 +263,18 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( bssoccer_pcm_1_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("pcm1")->base();
+ UINT8 *RAM = space->machine().region("pcm1")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bankptr(space->machine, "bank1", &RAM[bank * 0x10000 + 0x1000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bank * 0x10000 + 0x1000]);
}
static WRITE8_HANDLER( bssoccer_pcm_2_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("pcm2")->base();
+ UINT8 *RAM = space->machine().region("pcm2")->base();
int bank = data & 7;
if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bankptr(space->machine, "bank2", &RAM[bank * 0x10000 + 0x1000]);
+ memory_set_bankptr(space->machine(), "bank2", &RAM[bank * 0x10000 + 0x1000]);
}
@@ -325,10 +325,10 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( uballoon_pcm_1_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("pcm1")->base();
+ UINT8 *RAM = space->machine().region("pcm1")->base();
int bank = data & 1;
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bankptr(space->machine, "bank1", &RAM[bank * 0x10000 + 0x400]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bank * 0x10000 + 0x400]);
}
/* Memory maps: Yes, *no* RAM */
@@ -348,7 +348,7 @@ ADDRESS_MAP_END
static MACHINE_RESET(uballoon)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
uballoon_pcm_1_bankswitch_w(space, 0, 0);
}
@@ -913,7 +913,7 @@ MACHINE_CONFIG_END
static void bestbest_ym3526_irqhandler(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_IRQ0, state);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_IRQ0, state);
}
static const ym3526_interface bestbest_ym3526_interface =
@@ -1095,7 +1095,7 @@ ROM_END
static DRIVER_INIT( uballoon )
{
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
// Patch out the protection checks
RAM[0x0113c/2] = 0x4e71; // bne $646
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 244ebd3bdf0..1e2cebedb65 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -61,7 +61,7 @@ Notes:
static DRIVER_INIT( hardhead )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x8000; i++)
@@ -76,15 +76,15 @@ static DRIVER_INIT( hardhead )
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0) ^ 0x58;
}
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
/* Non encrypted bootleg */
static DRIVER_INIT( hardhedb )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x48000);
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x48000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -93,11 +93,11 @@ static DRIVER_INIT( hardhedb )
/* !! BRICKZN3 !! */
-static UINT8 *brickzn_decrypt(running_machine *machine)
+static UINT8 *brickzn_decrypt(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *RAM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int i;
@@ -138,7 +138,7 @@ static UINT8 *brickzn_decrypt(running_machine *machine)
static DRIVER_INIT( brickzn )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -163,13 +163,13 @@ static DRIVER_INIT( brickzn )
decrypt[0x24b5] = 0x00; // HALT -> NOP
decrypt[0x2583] = 0x00; // HALT -> NOP
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_configure_bank_decrypted(machine, "bank1", 0, 16, decrypt + 0x10000, 0x4000);
}
static DRIVER_INIT( brickzn3 )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
UINT8 *decrypt = brickzn_decrypt(machine);
int i;
@@ -194,7 +194,7 @@ static DRIVER_INIT( brickzn3 )
decrypt[0x2487] = 0x00; // HALT -> NOP
decrypt[0x256c] = 0x00; // HALT -> NOP
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_configure_bank_decrypted(machine, "bank1", 0, 16, decrypt + 0x10000, 0x4000);
}
@@ -205,9 +205,9 @@ static DRIVER_INIT( brickzn3 )
static DRIVER_INIT( hardhea2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *RAM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -281,7 +281,7 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41;
}
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
memory_configure_bank(machine, "bank2", 0, 2, auto_alloc_array(machine, UINT8, 0x2000 * 2), 0x2000);
}
@@ -292,9 +292,9 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
static DRIVER_INIT( starfigh )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *RAM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -350,7 +350,7 @@ static DRIVER_INIT( starfigh )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x45;
}
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
@@ -360,9 +360,9 @@ static DRIVER_INIT( starfigh )
static DRIVER_INIT( sparkman )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *RAM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
UINT8 x;
int i;
@@ -418,7 +418,7 @@ static DRIVER_INIT( sparkman )
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x44;
}
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -435,7 +435,7 @@ static DRIVER_INIT( sparkman )
static READ8_HANDLER( hardhead_protection_r )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
UINT8 protection_val = state->protection_val;
if (protection_val & 0x80)
@@ -449,7 +449,7 @@ static READ8_HANDLER( hardhead_protection_r )
static WRITE8_HANDLER( hardhead_protection_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
if (data & 0x80) state->protection_val = data;
else state->protection_val = offset & 1;
@@ -470,14 +470,14 @@ static WRITE8_HANDLER( hardhead_protection_w )
static READ8_HANDLER( hardhead_ip_r )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
switch (*state->hardhead_ip)
{
- case 0: return input_port_read(space->machine, "P1");
- case 1: return input_port_read(space->machine, "P2");
- case 2: return input_port_read(space->machine, "DSW1");
- case 3: return input_port_read(space->machine, "DSW2");
+ case 0: return input_port_read(space->machine(), "P1");
+ case 1: return input_port_read(space->machine(), "P2");
+ case 2: return input_port_read(space->machine(), "DSW1");
+ case 3: return input_port_read(space->machine(), "DSW2");
default:
logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n", cpu_get_pc(space->cpu), *state->hardhead_ip);
return 0xff;
@@ -494,7 +494,7 @@ static WRITE8_HANDLER( hardhead_bankswitch_w )
int bank = data & 0x0f;
if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(space->cpu),data);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
@@ -506,9 +506,9 @@ static WRITE8_HANDLER( hardhead_bankswitch_w )
*/
static WRITE8_HANDLER( hardhead_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x04);
- coin_lockout_w ( space->machine, 0, data & 0x08);
- coin_lockout_w ( space->machine, 1, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x04);
+ coin_lockout_w ( space->machine(), 0, data & 0x08);
+ coin_lockout_w ( space->machine(), 1, data & 0x10);
}
static ADDRESS_MAP_START( hardhead_map, AS_PROGRAM, 8 )
@@ -551,11 +551,11 @@ static WRITE8_HANDLER( rranger_bankswitch_w )
if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(space->cpu),data);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
- flip_screen_set(space->machine, data & 0x20);
- coin_lockout_w ( space->machine, 0, data & 0x40);
- coin_lockout_w ( space->machine, 1, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x20);
+ coin_lockout_w ( space->machine(), 0, data & 0x40);
+ coin_lockout_w ( space->machine(), 1, data & 0x80);
}
/*
@@ -618,7 +618,7 @@ static READ8_HANDLER( brickzn_c140_r )
*/
static WRITE8_HANDLER( brickzn_palettebank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->palettebank = (data >> 1) & 1;
if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",cpu_get_pc(space->cpu),data);
@@ -634,16 +634,16 @@ static WRITE8_HANDLER( brickzn_palettebank_w )
*/
static WRITE8_HANDLER( brickzn_spritebank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank = (data >> 1) & 1;
if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(space->cpu),data);
- flip_screen_set(space->machine, data & 0x01 );
+ flip_screen_set(space->machine(), data & 0x01 );
}
static WRITE8_HANDLER( brickzn_unknown_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->unknown = data;
}
@@ -654,12 +654,12 @@ static WRITE8_HANDLER( brickzn_unknown_w )
*/
static WRITE8_HANDLER( brickzn_rombank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
int bank = data & 0x0f;
if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(space->cpu),data);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
state->rombank = data;
}
@@ -690,7 +690,7 @@ ADDRESS_MAP_END
/* Probably wrong: */
static WRITE8_HANDLER( hardhea2_nmi_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->nmi_enable = data & 0x01;
// if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",cpu_get_pc(space->cpu),data);
@@ -702,15 +702,15 @@ static WRITE8_HANDLER( hardhea2_nmi_w )
*/
static WRITE8_HANDLER( hardhea2_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(space->cpu),data);
}
static WRITE8_HANDLER( hardhea2_leds_w )
{
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x04);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x04);
if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(space->cpu),data);
}
@@ -721,7 +721,7 @@ static WRITE8_HANDLER( hardhea2_leds_w )
*/
static WRITE8_HANDLER( hardhea2_spritebank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank = (data >> 1) & 1;
if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(space->cpu),data);
@@ -733,37 +733,37 @@ static WRITE8_HANDLER( hardhea2_spritebank_w )
*/
static WRITE8_HANDLER( hardhea2_rombank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
int bank = data & 0x0f;
if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(space->cpu),data);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
state->rombank = data;
}
static WRITE8_HANDLER( hardhea2_spritebank_0_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank = 0;
}
static WRITE8_HANDLER( hardhea2_spritebank_1_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank = 1;
}
static WRITE8_HANDLER( hardhea2_rambank_0_w )
{
- memory_set_bank(space->machine, "bank2", 0);
+ memory_set_bank(space->machine(), "bank2", 0);
}
static WRITE8_HANDLER( hardhea2_rambank_1_w )
{
- memory_set_bank(space->machine, "bank2", 1);
+ memory_set_bank(space->machine(), "bank2", 1);
}
@@ -814,7 +814,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( starfigh_spritebank_latch_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank_latch = (data >> 2) & 1;
if (data & ~0x04) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(space->cpu),data);
@@ -822,7 +822,7 @@ static WRITE8_HANDLER( starfigh_spritebank_latch_w )
static WRITE8_HANDLER( starfigh_spritebank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spritebank = state->spritebank_latch;
}
@@ -872,7 +872,7 @@ Thrash protection code snippet:
/* This is a command-based protection. */
static WRITE8_HANDLER( sparkman_cmd_prot_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
switch(data)
{
@@ -889,7 +889,7 @@ static WRITE8_HANDLER( sparkman_cmd_prot_w )
static WRITE8_HANDLER( suna8_wram_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
if (!state->trash_prot)
state->wram[offset] = data;
@@ -901,20 +901,20 @@ static WRITE8_HANDLER( suna8_wram_w )
*/
static WRITE8_HANDLER( sparkman_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
//if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(space->cpu),data);
}
static WRITE8_HANDLER( sparkman_leds_w )
{
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
//if (data & ~0x03) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(space->cpu),data);
}
static WRITE8_HANDLER( sparkman_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
}
/*
@@ -924,7 +924,7 @@ static WRITE8_HANDLER( sparkman_coin_counter_w )
*/
static WRITE8_HANDLER( sparkman_spritebank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
if(data == 0xf7) //???
state->spritebank = 0;
@@ -939,24 +939,24 @@ static WRITE8_HANDLER( sparkman_spritebank_w )
*/
static WRITE8_HANDLER( sparkman_rombank_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
int bank = data & 0x0f;
//if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(space->cpu),data);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
state->rombank = data;
}
static READ8_HANDLER( sparkman_c0a3_r )
{
- return (space->machine->primary_screen->frame_number() & 1) ? 0x80 : 0;
+ return (space->machine().primary_screen->frame_number() & 1) ? 0x80 : 0;
}
#if 0
static WRITE8_HANDLER( sparkman_en_trash_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->trash_prot = 1;
}
@@ -1051,7 +1051,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( brickzn_pcm_w )
{
static const char *const dacs[] = { "dac1", "dac2", "dac3", "dac4" };
- dac_signed_data_w( space->machine->device(dacs[offset & 3]), (data & 0xf) * 0x11 );
+ dac_signed_data_w( space->machine().device(dacs[offset & 3]), (data & 0xf) * 0x11 );
}
@@ -1465,7 +1465,7 @@ GFXDECODE_END
static void soundirq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, state);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, state);
}
/* In games with only 2 CPUs, port A&B of the AY8910 are used
@@ -1687,7 +1687,7 @@ static INTERRUPT_GEN( hardhea2_interrupt )
{
if (cpu_getiloops(device))
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if (state->nmi_enable) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
else device_set_input_line(device, 0, HOLD_LINE);
@@ -1695,7 +1695,7 @@ static INTERRUPT_GEN( hardhea2_interrupt )
static MACHINE_RESET( hardhea2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
hardhea2_rambank_0_w(space,0,0);
}
@@ -1777,7 +1777,7 @@ static INTERRUPT_GEN( sparkman_interrupt )
{
if (cpu_getiloops(device))
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if (state->nmi_enable) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
else device_set_input_line(device, 0, HOLD_LINE);
@@ -2383,7 +2383,7 @@ ROM_END
static DRIVER_INIT( suna8 )
{
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
/* Working Games */
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index b7f2a22c7f2..3cf439bc2fe 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -36,11 +36,11 @@ static READ16_HANDLER( supbtime_controls_r )
switch (offset << 1)
{
case 0:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 2:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 8:
- return input_port_read(space->machine, "COIN");
+ return input_port_read(space->machine(), "COIN");
case 10: /* ? Not used for anything */
case 12:
return 0;
@@ -52,7 +52,7 @@ static READ16_HANDLER( supbtime_controls_r )
static WRITE16_HANDLER( sound_w )
{
- supbtime_state *state = space->machine->driver_data<supbtime_state>();
+ supbtime_state *state = space->machine().driver_data<supbtime_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -311,7 +311,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- supbtime_state *driver_state = device->machine->driver_data<supbtime_state>();
+ supbtime_state *driver_state = device->machine().driver_data<supbtime_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -333,11 +333,11 @@ static const deco16ic_interface supbtime_deco16ic_tilegen1_intf =
static MACHINE_START( supbtime )
{
- supbtime_state *state = machine->driver_data<supbtime_state>();
+ supbtime_state *state = machine.driver_data<supbtime_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( supbtime, supbtime_state )
diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c
index 21f21218ee2..c9caf01da2f 100644
--- a/src/mame/drivers/supdrapo.c
+++ b/src/mame/drivers/supdrapo.c
@@ -89,7 +89,7 @@ static VIDEO_START( supdrapo )
static SCREEN_UPDATE( supdrapo )
{
- supdrapo_state *state = screen->machine->driver_data<supdrapo_state>();
+ supdrapo_state *state = screen->machine().driver_data<supdrapo_state>();
int x, y;
int count;
int color;
@@ -104,7 +104,7 @@ static SCREEN_UPDATE( supdrapo )
/* Global Column Coloring, GUESS! */
color = state->col_line[(x*2) + 1] ? (state->col_line[(x*2) + 1] - 1) & 7 : 0;
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], tile,color, 0, 0, x*8, y*8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], tile,color, 0, 0, x*8, y*8);
count++;
}
@@ -149,7 +149,7 @@ static PALETTE_INIT( sdpoker )
static READ8_HANDLER( sdpoker_rng_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( wdog8000_w )
@@ -179,7 +179,7 @@ static WRITE8_HANDLER( wdog8000_w )
Watchdog: 00
*/
- supdrapo_state *state = space->machine->driver_data<supdrapo_state>();
+ supdrapo_state *state = space->machine().driver_data<supdrapo_state>();
if (state->wdog == data)
{
@@ -212,12 +212,12 @@ static WRITE8_HANDLER( debug7c00_w )
static WRITE8_HANDLER( coinin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01); /* Coin In */
+ coin_counter_w(space->machine(), 0, data & 0x01); /* Coin In */
}
static WRITE8_HANDLER( payout_w )
{
- coin_counter_w(space->machine, 1, data & 0x01); /* Payout */
+ coin_counter_w(space->machine(), 1, data & 0x01); /* Payout */
}
@@ -232,7 +232,7 @@ static MACHINE_START( supdrapo )
static MACHINE_RESET( supdrapo )
{
- supdrapo_state *state = machine->driver_data<supdrapo_state>();
+ supdrapo_state *state = machine.driver_data<supdrapo_state>();
state->wdog = 1;
}
diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c
index 8612c21d28c..280cc0a2948 100644
--- a/src/mame/drivers/superchs.c
+++ b/src/mame/drivers/superchs.c
@@ -49,14 +49,14 @@
static READ16_HANDLER( shared_ram_r )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
if ((offset&1)==0) return (state->shared_ram[offset/2]&0xffff0000)>>16;
return (state->shared_ram[offset/2]&0x0000ffff);
}
static WRITE16_HANDLER( shared_ram_w )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
if ((offset&1)==0) {
if (ACCESSING_BITS_8_15)
state->shared_ram[offset/2]=(state->shared_ram[offset/2]&0x00ffffff)|((data&0xff00)<<16);
@@ -83,8 +83,8 @@ static WRITE32_HANDLER( cpua_ctrl_w )
if (ACCESSING_BITS_8_15)
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE);
- if (data&0x8000) cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE); /* Guess */
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, (data &0x200) ? CLEAR_LINE : ASSERT_LINE);
+ if (data&0x8000) cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE); /* Guess */
}
if (ACCESSING_BITS_0_7)
@@ -96,23 +96,23 @@ static WRITE32_HANDLER( cpua_ctrl_w )
static WRITE32_HANDLER( superchs_palette_w )
{
int a,r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- a = space->machine->generic.paletteram.u32[offset];
+ a = space->machine().generic.paletteram.u32[offset];
r = (a &0xff0000) >> 16;
g = (a &0xff00) >> 8;
b = (a &0xff);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( superchs_input_r )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 0x01:
return state->coin_word<<16;
@@ -123,7 +123,7 @@ static READ32_HANDLER( superchs_input_r )
static WRITE32_HANDLER( superchs_input_w )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
#if 0
{
@@ -140,12 +140,12 @@ static WRITE32_HANDLER( superchs_input_w )
{
if (ACCESSING_BITS_24_31) /* $300000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -161,10 +161,10 @@ static WRITE32_HANDLER( superchs_input_w )
{
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0,~data & 0x01000000);
- coin_lockout_w(space->machine, 1,~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x08000000);
+ coin_lockout_w(space->machine(), 0,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1,~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x08000000);
state->coin_word=(data >> 16) &0xffff;
}
}
@@ -173,13 +173,13 @@ static WRITE32_HANDLER( superchs_input_w )
static READ32_HANDLER( superchs_stick_r )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
- int fake = input_port_read(space->machine, "FAKE");
+ superchs_state *state = space->machine().driver_data<superchs_state>();
+ int fake = input_port_read(space->machine(), "FAKE");
int accel;
if (!(fake &0x10)) /* Analogue steer (the real control method) */
{
- state->steer = input_port_read(space->machine, "WHEEL");
+ state->steer = input_port_read(space->machine(), "WHEEL");
}
else /* Digital steer, with smoothing - speed depends on how often stick_r is called */
{
@@ -204,13 +204,13 @@ static READ32_HANDLER( superchs_stick_r )
}
/* Accelerator is an analogue input but the game treats it as digital (on/off) */
- if (input_port_read(space->machine, "FAKE") & 0x1) /* pressing B1 */
+ if (input_port_read(space->machine(), "FAKE") & 0x1) /* pressing B1 */
accel = 0x0;
else
accel = 0xff;
/* Todo: Verify brake - and figure out other input */
- return (state->steer << 24) | (accel << 16) | (input_port_read(space->machine, "SOUND") << 8) | input_port_read(space->machine, "UNKNOWN");
+ return (state->steer << 24) | (accel << 16) | (input_port_read(space->machine(), "SOUND") << 8) | input_port_read(space->machine(), "UNKNOWN");
}
static WRITE32_HANDLER( superchs_stick_w )
@@ -219,7 +219,7 @@ static WRITE32_HANDLER( superchs_stick_w )
different byte in this long word before the RTE. I assume all but the last
(top) byte cause an IRQ with the final one being an ACK. (Total guess but it works). */
if (mem_mask != 0xff000000)
- cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE);
}
/***********************************************************
@@ -444,7 +444,7 @@ ROM_END
static READ32_HANDLER( main_cycle_r )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
if (cpu_get_pc(space->cpu)==0x702)
device_spin_until_interrupt(space->cpu);
@@ -453,7 +453,7 @@ static READ32_HANDLER( main_cycle_r )
static READ16_HANDLER( sub_cycle_r )
{
- superchs_state *state = space->machine->driver_data<superchs_state>();
+ superchs_state *state = space->machine().driver_data<superchs_state>();
if (cpu_get_pc(space->cpu)==0x454)
device_spin_until_interrupt(space->cpu);
@@ -463,8 +463,8 @@ static READ16_HANDLER( sub_cycle_r )
static DRIVER_INIT( superchs )
{
/* Speedup handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100000, 0x100003, FUNC(main_cycle_r));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000a, 0x80000b, FUNC(sub_cycle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100000, 0x100003, FUNC(main_cycle_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000a, 0x80000b, FUNC(sub_cycle_r));
}
GAMEL( 1992, superchs, 0, superchs, superchs, superchs, ROT0, "Taito America Corporation", "Super Chase - Criminal Termination (US)", 0, layout_superchs )
diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c
index ff35d050ef4..cf941c32e6a 100644
--- a/src/mame/drivers/superdq.c
+++ b/src/mame/drivers/superdq.c
@@ -44,7 +44,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- superdq_state *state = machine->driver_data<superdq_state>();
+ superdq_state *state = machine.driver_data<superdq_state>();
int tile = state->videoram[tile_index];
SET_TILE_INFO(0, tile, state->color_bank, 0);
@@ -52,14 +52,14 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( superdq )
{
- superdq_state *state = machine->driver_data<superdq_state>();
+ superdq_state *state = machine.driver_data<superdq_state>();
state->tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( superdq )
{
- superdq_state *state = screen->machine->driver_data<superdq_state>();
+ superdq_state *state = screen->machine().driver_data<superdq_state>();
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
@@ -87,7 +87,7 @@ static PALETTE_INIT( superdq )
2, &resistances[1], bweights, 220, 0);
/* initialize the palette with these colors */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -115,7 +115,7 @@ static PALETTE_INIT( superdq )
static MACHINE_RESET( superdq )
{
- superdq_state *state = machine->driver_data<superdq_state>();
+ superdq_state *state = machine.driver_data<superdq_state>();
state->ld_in_latch = 0;
state->ld_out_latch = 0xff;
@@ -124,7 +124,7 @@ static MACHINE_RESET( superdq )
static INTERRUPT_GEN( superdq_vblank )
{
- superdq_state *state = device->machine->driver_data<superdq_state>();
+ superdq_state *state = device->machine().driver_data<superdq_state>();
/* status is read when the STATUS line from the laserdisc
toggles (600usec after the vblank). We could set up a
@@ -140,7 +140,7 @@ static INTERRUPT_GEN( superdq_vblank )
static WRITE8_HANDLER( superdq_videoram_w )
{
- superdq_state *state = space->machine->driver_data<superdq_state>();
+ superdq_state *state = space->machine().driver_data<superdq_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
@@ -148,15 +148,15 @@ static WRITE8_HANDLER( superdq_videoram_w )
static WRITE8_HANDLER( superdq_io_w )
{
- superdq_state *state = space->machine->driver_data<superdq_state>();
+ superdq_state *state = space->machine().driver_data<superdq_state>();
int i;
static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
if ( data & 0x40 ) /* bit 6 = irqack */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
- coin_counter_w( space->machine, 0, data & 0x08 );
- coin_counter_w( space->machine, 1, data & 0x04 );
+ coin_counter_w( space->machine(), 0, data & 0x08 );
+ coin_counter_w( space->machine(), 1, data & 0x04 );
state->color_bank = ( data & 2 ) ? 1 : 0;
@@ -164,9 +164,9 @@ static WRITE8_HANDLER( superdq_io_w )
{
int index = black_color_entries[i];
if (data & 0x80)
- palette_set_color(space->machine, index, palette_get_color(space->machine, index) & MAKE_ARGB(0,255,255,255));
+ palette_set_color(space->machine(), index, palette_get_color(space->machine(), index) & MAKE_ARGB(0,255,255,255));
else
- palette_set_color(space->machine, index, palette_get_color(space->machine, index) | MAKE_ARGB(255,0,0,0));
+ palette_set_color(space->machine(), index, palette_get_color(space->machine(), index) | MAKE_ARGB(255,0,0,0));
}
/*
@@ -178,14 +178,14 @@ static WRITE8_HANDLER( superdq_io_w )
static READ8_HANDLER( superdq_ld_r )
{
- superdq_state *state = space->machine->driver_data<superdq_state>();
+ superdq_state *state = space->machine().driver_data<superdq_state>();
return state->ld_in_latch;
}
static WRITE8_HANDLER( superdq_ld_w )
{
- superdq_state *state = space->machine->driver_data<superdq_state>();
+ superdq_state *state = space->machine().driver_data<superdq_state>();
state->ld_out_latch = data;
}
@@ -316,9 +316,9 @@ GFXDECODE_END
static MACHINE_START( superdq )
{
- superdq_state *state = machine->driver_data<superdq_state>();
+ superdq_state *state = machine.driver_data<superdq_state>();
- state->laserdisc = machine->device("laserdisc");
+ state->laserdisc = machine.device("laserdisc");
}
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 2517cf04874..bc29d1dea78 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -116,10 +116,10 @@ DSW2 stored @ $f237
static SAMPLES_START( pbillian_sh_start )
{
- superqix_state *state = device->machine->driver_data<superqix_state>();
- running_machine *machine = device->machine;
- UINT8 *src = machine->region("samples")->base();
- int i, len = machine->region("samples")->bytes();
+ superqix_state *state = device->machine().driver_data<superqix_state>();
+ running_machine &machine = device->machine();
+ UINT8 *src = machine.region("samples")->base();
+ int i, len = machine.region("samples")->bytes();
/* convert 8-bit unsigned samples to 8-bit signed */
state->samplebuf = auto_alloc_array(machine, INT16, len);
@@ -129,10 +129,10 @@ static SAMPLES_START( pbillian_sh_start )
static WRITE8_HANDLER( pbillian_sample_trigger_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
- device_t *samples = space->machine->device("samples");
- UINT8 *src = space->machine->region("samples")->base();
- int len = space->machine->region("samples")->bytes();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
+ device_t *samples = space->machine().device("samples");
+ UINT8 *src = space->machine().region("samples")->base();
+ int len = space->machine().region("samples")->bytes();
int start,end;
start = data << 7;
@@ -179,21 +179,21 @@ The MCU acts this way:
static READ8_DEVICE_HANDLER( in4_mcu_r )
{
- superqix_state *state = device->machine->driver_data<superqix_state>();
+ superqix_state *state = device->machine().driver_data<superqix_state>();
// logerror("%04x: in4_mcu_r\n",cpu_get_pc(space->cpu));
- return input_port_read(device->machine, "P2") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
+ return input_port_read(device->machine(), "P2") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
}
static READ8_DEVICE_HANDLER( sqix_from_mcu_r )
{
- superqix_state *state = device->machine->driver_data<superqix_state>();
+ superqix_state *state = device->machine().driver_data<superqix_state>();
// logerror("%04x: read mcu answer (%02x)\n",cpu_get_pc(space->cpu),state->from_mcu);
return state->from_mcu;
}
static TIMER_CALLBACK( mcu_acknowledge_callback )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->from_z80_pending = 1;
state->from_z80 = state->portb;
// logerror("Z80->MCU %02x\n",state->from_z80);
@@ -201,36 +201,36 @@ static TIMER_CALLBACK( mcu_acknowledge_callback )
static READ8_HANDLER( mcu_acknowledge_r )
{
- space->machine->scheduler().synchronize(FUNC(mcu_acknowledge_callback));
+ space->machine().scheduler().synchronize(FUNC(mcu_acknowledge_callback));
return 0;
}
static WRITE8_DEVICE_HANDLER( sqix_z80_mcu_w )
{
- superqix_state *state = device->machine->driver_data<superqix_state>();
+ superqix_state *state = device->machine().driver_data<superqix_state>();
// logerror("%04x: sqix_z80_mcu_w %02x\n",cpu_get_pc(space->cpu),data);
state->portb = data;
}
static WRITE8_HANDLER( bootleg_mcu_p1_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
switch ((data & 0x0e) >> 1)
{
case 0:
// ???
break;
case 1:
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
break;
case 2:
- coin_counter_w(space->machine, 1,data & 1);
+ coin_counter_w(space->machine(), 1,data & 1);
break;
case 3:
- coin_lockout_global_w(space->machine, (data & 1) ^ state->invert_coin_lockout);
+ coin_lockout_global_w(space->machine(), (data & 1) ^ state->invert_coin_lockout);
break;
case 4:
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
break;
case 5:
state->port1 = data;
@@ -256,20 +256,20 @@ static WRITE8_HANDLER( bootleg_mcu_p1_w )
static WRITE8_HANDLER( mcu_p3_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
state->port3 = data;
}
static READ8_HANDLER( bootleg_mcu_p3_r )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
if ((state->port1 & 0x10) == 0)
{
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
}
else if ((state->port1 & 0x20) == 0)
{
- return input_port_read(space->machine, "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
+ return input_port_read(space->machine(), "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
}
else if ((state->port1 & 0x40) == 0)
{
@@ -282,26 +282,26 @@ static READ8_HANDLER( bootleg_mcu_p3_r )
static READ8_HANDLER( sqixu_mcu_p0_r )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
- return input_port_read(space->machine, "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
+ superqix_state *state = space->machine().driver_data<superqix_state>();
+ return input_port_read(space->machine(), "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7);
}
static WRITE8_HANDLER( sqixu_mcu_p2_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
// bit 0 = unknown (clocked often)
// bit 1 = coin cointer 1
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
// bit 2 = coin counter 2
- coin_counter_w(space->machine, 1,data & 4);
+ coin_counter_w(space->machine(), 1,data & 4);
// bit 3 = coin lockout
- coin_lockout_global_w(space->machine, ~data & 8);
+ coin_lockout_global_w(space->machine(), ~data & 8);
// bit 4 = flip screen
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
// bit 5 = unknown (set on startup)
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( sqixu_mcu_p2_w )
static READ8_HANDLER( sqixu_mcu_p3_r )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(space->cpu),state->from_z80);
state->from_z80_pending = 0;
return state->from_z80;
@@ -332,18 +332,18 @@ static READ8_HANDLER( sqixu_mcu_p3_r )
static READ8_HANDLER( nmi_ack_r )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
return 0;
}
static READ8_DEVICE_HANDLER( bootleg_in0_r )
{
- return BITSWAP8(input_port_read(device->machine, "DSW1"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(input_port_read(device->machine(), "DSW1"), 0,1,2,3,4,5,6,7);
}
static WRITE8_HANDLER( bootleg_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
@@ -359,9 +359,9 @@ static WRITE8_HANDLER( bootleg_flipscreen_w )
* connected to the 68705 which acts as a counter.
*/
-static int read_dial(running_machine *machine, int player)
+static int read_dial(running_machine &machine, int player)
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
int newpos;
/* get the new position and adjust the result */
@@ -382,17 +382,17 @@ static int read_dial(running_machine *machine, int player)
static TIMER_CALLBACK( delayed_z80_mcu_w )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
logerror("Z80 sends command %02x\n",param);
state->from_z80 = param;
state->from_mcu_pending = 0;
cputag_set_input_line(machine, "mcu", 0, HOLD_LINE);
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(200));
}
static TIMER_CALLBACK( delayed_mcu_z80_w )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
logerror("68705 sends answer %02x\n",param);
state->from_mcu = param;
state->from_mcu_pending = 1;
@@ -419,26 +419,26 @@ logerror("68705 sends answer %02x\n",param);
static READ8_HANDLER( hotsmash_68705_portA_r )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
//logerror("%04x: 68705 reads port A = %02x\n",cpu_get_pc(space->cpu),state->portA_in);
return state->portA_in;
}
static WRITE8_HANDLER( hotsmash_68705_portB_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
state->portB_out = data;
}
static READ8_HANDLER( hotsmash_68705_portC_r )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
return state->portC;
}
static WRITE8_HANDLER( hotsmash_68705_portC_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
state->portC = data;
if ((data & 0x08) == 0)
@@ -446,11 +446,11 @@ static WRITE8_HANDLER( hotsmash_68705_portC_w )
switch (data & 0x07)
{
case 0x0: // dsw A
- state->portA_in = input_port_read(space->machine, "DSW1");
+ state->portA_in = input_port_read(space->machine(), "DSW1");
break;
case 0x1: // dsw B
- state->portA_in = input_port_read(space->machine, "DSW2");
+ state->portA_in = input_port_read(space->machine(), "DSW2");
break;
case 0x2:
@@ -465,15 +465,15 @@ logerror("%04x: z80 reads command %02x\n",cpu_get_pc(space->cpu),state->from_z80
break;
case 0x5: // answer to Z80
- space->machine->scheduler().synchronize(FUNC(delayed_mcu_z80_w), state->portB_out);
+ space->machine().scheduler().synchronize(FUNC(delayed_mcu_z80_w), state->portB_out);
break;
case 0x6:
- state->portA_in = read_dial(space->machine, 0);
+ state->portA_in = read_dial(space->machine(), 0);
break;
case 0x7:
- state->portA_in = read_dial(space->machine, 1);
+ state->portA_in = read_dial(space->machine(), 1);
break;
}
}
@@ -481,12 +481,12 @@ logerror("%04x: z80 reads command %02x\n",cpu_get_pc(space->cpu),state->from_z80
static WRITE8_HANDLER( hotsmash_z80_mcu_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_z80_mcu_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_z80_mcu_w), data);
}
static READ8_HANDLER(hotsmash_from_mcu_r)
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(space->cpu),state->from_mcu);
state->from_mcu_pending = 0;
return state->from_mcu;
@@ -494,9 +494,9 @@ logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(space->cpu),state->from_mcu)
static READ8_DEVICE_HANDLER(hotsmash_ay_port_a_r)
{
- superqix_state *state = device->machine->driver_data<superqix_state>();
+ superqix_state *state = device->machine().driver_data<superqix_state>();
//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(space->cpu),state->from_mcu_pending);
- return input_port_read(device->machine, "SYSTEM") | ((state->from_mcu_pending^1) << 7);
+ return input_port_read(device->machine(), "SYSTEM") | ((state->from_mcu_pending^1) << 7);
}
/**************************************************************************
@@ -507,20 +507,20 @@ pbillian MCU simulation
static WRITE8_HANDLER( pbillian_z80_mcu_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
state->from_z80 = data;
}
static READ8_HANDLER(pbillian_from_mcu_r)
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
switch (state->from_z80)
{
- case 0x01: return input_port_read(space->machine, state->curr_player ? "PADDLE2" : "PADDLE1");
- case 0x02: return input_port_read(space->machine, state->curr_player ? "DIAL2" : "DIAL1");
- case 0x04: return input_port_read(space->machine, "DSW1");
- case 0x08: return input_port_read(space->machine, "DSW2");
+ case 0x01: return input_port_read(space->machine(), state->curr_player ? "PADDLE2" : "PADDLE1");
+ case 0x02: return input_port_read(space->machine(), state->curr_player ? "DIAL2" : "DIAL1");
+ case 0x04: return input_port_read(space->machine(), "DSW1");
+ case 0x08: return input_port_read(space->machine(), "DSW2");
case 0x80: state->curr_player = 0; return 0;
case 0x81: state->curr_player = 1; return 0;
}
@@ -533,13 +533,13 @@ static READ8_DEVICE_HANDLER(pbillian_ay_port_a_r)
{
// logerror("%04x: ay_port_a_r\n",cpu_get_pc(space->cpu));
/* bits 76------ MCU status bits */
- return (device->machine->rand() & 0xc0) | input_port_read(device->machine, "BUTTONS");
+ return (device->machine().rand() & 0xc0) | input_port_read(device->machine(), "BUTTONS");
}
-static void machine_init_common(running_machine *machine)
+static void machine_init_common(running_machine &machine)
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->save_item(NAME(state->invert_coin_lockout));
state->save_item(NAME(state->from_mcu_pending));
state->save_item(NAME(state->from_z80_pending));
@@ -560,7 +560,7 @@ static void machine_init_common(running_machine *machine)
static MACHINE_START( superqix )
{
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -568,7 +568,7 @@ static MACHINE_START( superqix )
static MACHINE_START( pbillian )
{
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
machine_init_common(machine);
}
@@ -1351,25 +1351,25 @@ ROM_END
static DRIVER_INIT( pbillian )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->pbillian_show_power = 1;
}
static DRIVER_INIT( hotsmash )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->pbillian_show_power = 0;
}
static DRIVER_INIT( sqix )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->invert_coin_lockout = 1;
}
static DRIVER_INIT( sqixa )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->invert_coin_lockout = 0;
}
@@ -1381,8 +1381,8 @@ static DRIVER_INIT( perestro )
int i,j;
/* decrypt program code; the address lines are shuffled around in a non-trivial way */
- src = machine->region("maincpu")->base();
- len = machine->region("maincpu")->bytes();
+ src = machine.region("maincpu")->base();
+ len = machine.region("maincpu")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1401,8 +1401,8 @@ static DRIVER_INIT( perestro )
}
/* decrypt gfx ROMs; simple bit swap on the address lines */
- src = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ src = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1412,8 +1412,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ src = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
@@ -1423,8 +1423,8 @@ static DRIVER_INIT( perestro )
}
}
- src = machine->region("gfx3")->base();
- len = machine->region("gfx3")->bytes();
+ src = machine.region("gfx3")->base();
+ len = machine.region("gfx3")->bytes();
for (i = 0;i < len;i += 16)
{
memcpy(temp,&src[i],16);
diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c
index cf92ac79d5e..6db79ac7600 100644
--- a/src/mame/drivers/supertnk.c
+++ b/src/mame/drivers/supertnk.c
@@ -127,27 +127,27 @@ public:
static WRITE8_HANDLER( supertnk_bankswitch_0_w )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
offs_t bank_address;
state->rom_bank = (state->rom_bank & 0x02) | ((data << 0) & 0x01);
bank_address = 0x10000 + (state->rom_bank * 0x1000);
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[bank_address]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[bank_address]);
}
static WRITE8_HANDLER( supertnk_bankswitch_1_w )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
offs_t bank_address;
state->rom_bank = (state->rom_bank & 0x01) | ((data << 1) & 0x02);
bank_address = 0x10000 + (state->rom_bank * 0x1000);
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[bank_address]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[bank_address]);
}
@@ -167,7 +167,7 @@ static INTERRUPT_GEN( supertnk_interrupt )
static WRITE8_HANDLER( supertnk_interrupt_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -180,9 +180,9 @@ static WRITE8_HANDLER( supertnk_interrupt_ack_w )
static VIDEO_START( supertnk )
{
- supertnk_state *state = machine->driver_data<supertnk_state>();
+ supertnk_state *state = machine.driver_data<supertnk_state>();
offs_t i;
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
for (i = 0; i < NUM_PENS; i++)
{
@@ -199,7 +199,7 @@ static VIDEO_START( supertnk )
static WRITE8_HANDLER( supertnk_videoram_w )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
if (state->bitplane_select > 2)
{
@@ -216,7 +216,7 @@ static WRITE8_HANDLER( supertnk_videoram_w )
static READ8_HANDLER( supertnk_videoram_r )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
UINT8 ret = 0x00;
if (state->bitplane_select < 3)
@@ -228,7 +228,7 @@ static READ8_HANDLER( supertnk_videoram_r )
static WRITE8_HANDLER( supertnk_bitplane_select_0_w )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
state->bitplane_select = (state->bitplane_select & 0x02) | ((data << 0) & 0x01);
}
@@ -236,7 +236,7 @@ static WRITE8_HANDLER( supertnk_bitplane_select_0_w )
static WRITE8_HANDLER( supertnk_bitplane_select_1_w )
{
- supertnk_state *state = space->machine->driver_data<supertnk_state>();
+ supertnk_state *state = space->machine().driver_data<supertnk_state>();
state->bitplane_select = (state->bitplane_select & 0x01) | ((data << 1) & 0x02);
}
@@ -244,7 +244,7 @@ static WRITE8_HANDLER( supertnk_bitplane_select_1_w )
static SCREEN_UPDATE( supertnk )
{
- supertnk_state *state = screen->machine->driver_data<supertnk_state>();
+ supertnk_state *state = screen->machine().driver_data<supertnk_state>();
offs_t offs;
for (offs = 0; offs < 0x2000; offs++)
@@ -284,7 +284,7 @@ static SCREEN_UPDATE( supertnk )
static MACHINE_RESET( supertnk )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
supertnk_bankswitch_0_w(space, 0, 0);
supertnk_bankswitch_1_w(space, 0, 0);
@@ -489,8 +489,8 @@ static DRIVER_INIT( supertnk )
{
/* decode the TMS9980 ROMs */
offs_t offs;
- UINT8 *rom = machine->region("maincpu")->base();
- size_t len = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t len = machine.region("maincpu")->bytes();
for (offs = 0; offs < len; offs++)
{
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index 083a4845e31..6e04d68f54e 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -49,7 +49,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- suprgolf_state *state = machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = machine.driver_data<suprgolf_state>();
int code = state->videoram[tile_index*2]+256*(state->videoram[tile_index*2+1]);
int color = state->videoram[tile_index*2+0x800] & 0x7f;
@@ -62,7 +62,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( suprgolf )
{
- suprgolf_state *state = machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = machine.driver_data<suprgolf_state>();
state->tilemap = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,32,32 );
state->paletteram = auto_alloc_array(machine, UINT8, 0x1000);
@@ -75,9 +75,9 @@ static VIDEO_START( suprgolf )
static SCREEN_UPDATE( suprgolf )
{
- suprgolf_state *state = screen->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = screen->machine().driver_data<suprgolf_state>();
int x,y,count,color;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
{
count = 0;
@@ -89,7 +89,7 @@ static SCREEN_UPDATE( suprgolf )
color = state->bg_fb[count];
if(x <= cliprect->max_x && y <= cliprect->max_y)
- *BITMAP_ADDR16(bitmap, y, x) = screen->machine->pens[(color & 0x7ff)];
+ *BITMAP_ADDR16(bitmap, y, x) = screen->machine().pens[(color & 0x7ff)];
count++;
}
@@ -106,7 +106,7 @@ static SCREEN_UPDATE( suprgolf )
color = state->fg_fb[count];
if(((state->fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect->max_x && y <= cliprect->max_y))
- *BITMAP_ADDR16(bitmap, y, x) = screen->machine->pens[(color & 0x7ff)];
+ *BITMAP_ADDR16(bitmap, y, x) = screen->machine().pens[(color & 0x7ff)];
count++;
}
@@ -120,7 +120,7 @@ static SCREEN_UPDATE( suprgolf )
static READ8_HANDLER( suprgolf_videoram_r )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
if (state->palette_switch)
return state->paletteram[offset];
@@ -130,7 +130,7 @@ static READ8_HANDLER( suprgolf_videoram_r )
static WRITE8_HANDLER( suprgolf_videoram_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
if(state->palette_switch)
{
@@ -143,7 +143,7 @@ static WRITE8_HANDLER( suprgolf_videoram_w )
g = (datax & 0x8000) ? 0 : ((datax)&0x03e0)>>5;
r = (datax & 0x8000) ? 0 : ((datax)&0x7c00)>>10;
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
else
{
@@ -154,14 +154,14 @@ static WRITE8_HANDLER( suprgolf_videoram_w )
static READ8_HANDLER( suprgolf_vregs_r )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
return state->vreg_bank;
}
static WRITE8_HANDLER( suprgolf_vregs_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
//bits 0,1,2 and probably 3 controls the background vram banking
state->vreg_bank = data;
@@ -176,14 +176,14 @@ static WRITE8_HANDLER( suprgolf_vregs_w )
static READ8_HANDLER( suprgolf_bg_vram_r )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
return state->bg_vram[offset+state->bg_bank*0x2000];
}
static WRITE8_HANDLER( suprgolf_bg_vram_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
UINT8 hi_nibble,lo_nibble;
UINT8 hi_dirty_dot,lo_dirty_dot; // helpers
@@ -229,47 +229,47 @@ static WRITE8_HANDLER( suprgolf_bg_vram_w )
static WRITE8_HANDLER( suprgolf_pen_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
state->vreg_pen = data;
}
static WRITE8_HANDLER( adpcm_data_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
state->msm5205next = data;
}
static READ8_HANDLER( rom_bank_select_r )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
return state->rom_bank;
}
static WRITE8_HANDLER( rom_bank_select_w )
{
- suprgolf_state *state = space->machine->driver_data<suprgolf_state>();
- UINT8 *region_base = space->machine->region("user1")->base();
+ suprgolf_state *state = space->machine().driver_data<suprgolf_state>();
+ UINT8 *region_base = space->machine().region("user1")->base();
state->rom_bank = data;
//popmessage("%08x %02x",((data & 0x3f) * 0x4000),data);
mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
- memory_set_bankptr(space->machine, "bank2", region_base + (data&0x3f ) * 0x4000);
+ memory_set_bankptr(space->machine(), "bank2", region_base + (data&0x3f ) * 0x4000);
state->msm_nmi_mask = data & 0x40;
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
static WRITE8_HANDLER( rom2_bank_select_w )
{
- UINT8 *region_base = space->machine->region("user2")->base();
+ UINT8 *region_base = space->machine().region("user2")->base();
mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
- memory_set_bankptr(space->machine, "bank1", region_base + (data&0x0f ) * 0x4000);
+ memory_set_bankptr(space->machine(), "bank1", region_base + (data&0x0f ) * 0x4000);
if(data & 0xf0)
printf("Rom bank select 2 with data %02x activated\n",data);
@@ -279,20 +279,20 @@ static READ8_HANDLER( pedal_extra_bits_r )
{
UINT8 p1_sht_sw,p2_sht_sw;
- p1_sht_sw = (input_port_read(space->machine, "P1_RELEASE") & 0x80)>>7;
- p2_sht_sw = (input_port_read(space->machine, "P2_RELEASE") & 0x80)>>6;
+ p1_sht_sw = (input_port_read(space->machine(), "P1_RELEASE") & 0x80)>>7;
+ p2_sht_sw = (input_port_read(space->machine(), "P2_RELEASE") & 0x80)>>6;
return p1_sht_sw | p2_sht_sw;
}
static READ8_HANDLER( p1_r )
{
- return (input_port_read(space->machine, "P1") & 0xf0) | ((input_port_read(space->machine, "P1_ANALOG") & 0xf));
+ return (input_port_read(space->machine(), "P1") & 0xf0) | ((input_port_read(space->machine(), "P1_ANALOG") & 0xf));
}
static READ8_HANDLER( p2_r )
{
- return (input_port_read(space->machine, "P2") & 0xf0) | ((input_port_read(space->machine, "P2_ANALOG") & 0xf));
+ return (input_port_read(space->machine(), "P2") & 0xf0) | ((input_port_read(space->machine(), "P2_ANALOG") & 0xf));
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -418,7 +418,7 @@ static WRITE8_DEVICE_HANDLER( suprgolf_writeB )
static void irqhandler(device_t *device, int irq)
{
- //cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
+ //cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -436,7 +436,7 @@ static const ym2203_interface ym2203_config =
static void adpcm_int(device_t *device)
{
- suprgolf_state *state = device->machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = device->machine().driver_data<suprgolf_state>();
{
msm5205_reset_w(device,0);
@@ -444,7 +444,7 @@ static void adpcm_int(device_t *device)
if(state->toggle)
{
msm5205_data_w(device, (state->msm5205next & 0xf0) >> 4);
- if(state->msm_nmi_mask) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); }
+ if(state->msm_nmi_mask) { cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); }
}
else
{
@@ -476,7 +476,7 @@ GFXDECODE_END
static MACHINE_RESET( suprgolf )
{
- suprgolf_state *state = machine->driver_data<suprgolf_state>();
+ suprgolf_state *state = machine.driver_data<suprgolf_state>();
state->msm_nmi_mask = 0;
}
@@ -582,7 +582,7 @@ ROM_END
static DRIVER_INIT( suprgolf )
{
- UINT8 *ROM = machine->region("user2")->base();
+ UINT8 *ROM = machine.region("user2")->base();
ROM[0x74f4-0x4000] = 0x00;
ROM[0x74f5-0x4000] = 0x00;
diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c
index 13dcf27705c..256bdfb582e 100644
--- a/src/mame/drivers/suprloco.c
+++ b/src/mame/drivers/suprloco.c
@@ -21,7 +21,7 @@ TODO:
static WRITE8_HANDLER( suprloco_soundport_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
/* spin for a while to let the Z80 read the command (fixes hanging sound in Regulus) */
device_spin_until_time(space->cpu, attotime::from_usec(50));
}
@@ -260,9 +260,9 @@ static DRIVER_INIT( suprloco )
int i, j, k, color_source, color_dest;
UINT8 *source, *dest, *lookup;
- source = machine->region("gfx1")->base();
+ source = machine.region("gfx1")->base();
dest = source + 0x6000;
- lookup = machine->region("proms")->base() + 0x0200;
+ lookup = machine.region("proms")->base() + 0x0200;
for (i = 0; i < 0x80; i++, lookup += 8)
{
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index af04f025d1c..0954208f5be 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -332,7 +332,7 @@ static READ32_HANDLER( skns_hit_r )
switch(adr) {
case 0x28:
case 0x2a:
- return (UINT16)space->machine->rand();
+ return (UINT16)space->machine().rand();
case 0x00:
case 0x10:
return (UINT16)hit.x_in;
@@ -414,12 +414,12 @@ static READ32_HANDLER( skns_hit_r )
static TIMER_DEVICE_CALLBACK( interrupt_callback )
{
- cputag_set_input_line(timer.machine, "maincpu", param, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", param, HOLD_LINE);
}
static MACHINE_RESET(skns)
{
- memory_set_bankptr(machine, "bank1",machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank1",machine.region("user1")->base());
}
@@ -450,7 +450,7 @@ static INTERRUPT_GEN(skns_interrupt)
static CUSTOM_INPUT( paddle_r )
{
const char *tag = (const char *)param;
- return input_port_read(field->port->machine, tag);
+ return input_port_read(field->port->machine(), tag);
}
static INPUT_PORTS_START( skns ) /* 3 buttons, 2 players */
@@ -610,10 +610,10 @@ static WRITE32_HANDLER( skns_io_w )
case 2:
if(ACCESSING_BITS_24_31)
{ /* Coin Lock/Count */
-// coin_counter_w(space->machine, 0, data & 0x01000000);
-// coin_counter_w(space->machine, 1, data & 0x02000000);
-// coin_lockout_w(space->machine, 0, ~data & 0x04000000);
-// coin_lockout_w(space->machine, 1, ~data & 0x08000000); // Works in puzzloop, others behave strange.
+// coin_counter_w(space->machine(), 0, data & 0x01000000);
+// coin_counter_w(space->machine(), 1, data & 0x02000000);
+// coin_lockout_w(space->machine(), 0, ~data & 0x04000000);
+// coin_lockout_w(space->machine(), 1, ~data & 0x08000000); // Works in puzzloop, others behave strange.
}
if(ACCESSING_BITS_16_23)
{ /* Analogue Input Select */
@@ -629,27 +629,27 @@ static WRITE32_HANDLER( skns_io_w )
if(ACCESSING_BITS_8_15)
{ /* Interrupt Clear, do we need these? */
/* if(data&0x01)
- cputag_set_input_line(space->machine, "maincpu",1,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",1,CLEAR_LINE);
if(data&0x02)
- cputag_set_input_line(space->machine, "maincpu",3,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",3,CLEAR_LINE);
if(data&0x04)
- cputag_set_input_line(space->machine, "maincpu",5,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",5,CLEAR_LINE);
if(data&0x08)
- cputag_set_input_line(space->machine, "maincpu",7,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",7,CLEAR_LINE);
if(data&0x10)
- cputag_set_input_line(space->machine, "maincpu",9,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",9,CLEAR_LINE);
if(data&0x20)
- cputag_set_input_line(space->machine, "maincpu",0xb,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",0xb,CLEAR_LINE);
if(data&0x40)
- cputag_set_input_line(space->machine, "maincpu",0xd,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu",0xd,CLEAR_LINE);
if(data&0x80)
- cputag_set_input_line(space->machine, "maincpu",0xf,CLEAR_LINE);*/
+ cputag_set_input_line(space->machine(), "maincpu",0xf,CLEAR_LINE);*/
/* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */
if (cpu_get_pc(space->cpu)==0x04013B42)
{
- if (!strcmp(space->machine->system().name,"vblokbrk") ||
- !strcmp(space->machine->system().name,"sarukani"))
+ if (!strcmp(space->machine().system().name,"vblokbrk") ||
+ !strcmp(space->machine().system().name,"sarukani"))
device_spin_until_interrupt(space->cpu);
}
@@ -671,7 +671,7 @@ static READ32_HANDLER( skns_msm6242_r )
system_time systime;
long value;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
// The clock is not y2k-compatible, wrap back 10 years, screw the leap years
// tm->tm_year -= 10;
@@ -709,12 +709,12 @@ static READ32_HANDLER( skns_msm6242_r )
static WRITE32_HANDLER( skns_v3t_w )
{
- UINT8 *btiles = space->machine->region("gfx3")->base();
+ UINT8 *btiles = space->machine().region("gfx3")->base();
COMBINE_DATA(&skns_v3t_ram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[1], offset/0x40);
- gfx_element_mark_dirty(space->machine->gfx[3], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/0x40);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset/0x20);
data = skns_v3t_ram[offset];
// i think we need to swap around to decode .. endian issues?
@@ -960,39 +960,39 @@ static READ32_HANDLER( sengekij_speedup_r ) // 60006ee 600308e
return skns_main_ram[0xb7380/4];
}
-static void init_skns(running_machine *machine)
+static void init_skns(running_machine &machine)
{
// init DRC to fastest options
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x6f8);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000028, 0x600002b, FUNC(bios_skip_r) );
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x6f8);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000028, 0x600002b, FUNC(bios_skip_r) );
}
-static void set_drc_pcflush(running_machine *machine, UINT32 addr)
+static void set_drc_pcflush(running_machine &machine, UINT32 addr)
{
- sh2drc_add_pcflush(machine->device("maincpu"), addr);
+ sh2drc_add_pcflush(machine.device("maincpu"), addr);
}
-static DRIVER_INIT( galpani4 ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine); }
-static DRIVER_INIT( galpanis ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine); }
-static DRIVER_INIT( cyvern ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x604d3c8, 0x604d3cb, FUNC(cyvern_speedup_r) ); set_drc_pcflush(machine, 0x402ebd2); }
-static DRIVER_INIT( galpans2 ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60fb6bc, 0x60fb6bf, FUNC(galpans2_speedup_r) ); set_drc_pcflush(machine, 0x4049ae2); }
-static DRIVER_INIT( gutsn ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x600c780, 0x600c783, FUNC(gutsn_speedup_r) ); set_drc_pcflush(machine, 0x402206e); }
-static DRIVER_INIT( panicstr ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60f19e4, 0x60f19e7, FUNC(panicstr_speedup_r) ); set_drc_pcflush(machine, 0x404e68a); }
-static DRIVER_INIT( senknow ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60000dc, 0x60000df, FUNC(senknow_speedup_r) ); set_drc_pcflush(machine, 0x4017dce); }
-static DRIVER_INIT( puzzloop ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6081d38, 0x6081d3b, FUNC(puzzloop_speedup_r) ); set_drc_pcflush(machine, 0x401da14); }
-static DRIVER_INIT( puzzloopj ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6086714, 0x6086717, FUNC(puzzloopj_speedup_r) ); set_drc_pcflush(machine, 0x401dca0); }
-static DRIVER_INIT( puzzloopa ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6085bcc, 0x6085bcf, FUNC(puzzloopa_speedup_r) ); set_drc_pcflush(machine, 0x401d9d4); }
-static DRIVER_INIT( puzzloopu ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6085cec, 0x6085cef, FUNC(puzzloopu_speedup_r) ); set_drc_pcflush(machine, 0x401dab0); }
-static DRIVER_INIT( jjparads ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000994, 0x6000997, FUNC(jjparads_speedup_r) ); set_drc_pcflush(machine, 0x4015e84); }
-static DRIVER_INIT( jjparad2 ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000984, 0x6000987, FUNC(jjparad2_speedup_r) ); set_drc_pcflush(machine, 0x401620a); }
-static DRIVER_INIT( ryouran ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000a14, 0x6000a17, FUNC(ryouran_speedup_r) ); set_drc_pcflush(machine, 0x40182ce); }
-static DRIVER_INIT( teljan ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6002fb4, 0x6002fb7, FUNC(teljan_speedup_r) ); set_drc_pcflush(machine, 0x401ba32); }
-static DRIVER_INIT( sengekis ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60b74bc, 0x60b74bf, FUNC(sengekis_speedup_r) ); set_drc_pcflush(machine, 0x60006ec); }
-static DRIVER_INIT( sengekij ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine); machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60b7380, 0x60b7383, FUNC(sengekij_speedup_r) ); set_drc_pcflush(machine, 0x60006ec); }
-static DRIVER_INIT( sarukani ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); set_drc_pcflush(machine, 0x4013b42); } // Speedup is in skns_io_w()
-static DRIVER_INIT( galpans3 ) { machine->device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); }
+static DRIVER_INIT( galpani4 ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine); }
+static DRIVER_INIT( galpanis ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine); }
+static DRIVER_INIT( cyvern ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x604d3c8, 0x604d3cb, FUNC(cyvern_speedup_r) ); set_drc_pcflush(machine, 0x402ebd2); }
+static DRIVER_INIT( galpans2 ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60fb6bc, 0x60fb6bf, FUNC(galpans2_speedup_r) ); set_drc_pcflush(machine, 0x4049ae2); }
+static DRIVER_INIT( gutsn ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x600c780, 0x600c783, FUNC(gutsn_speedup_r) ); set_drc_pcflush(machine, 0x402206e); }
+static DRIVER_INIT( panicstr ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60f19e4, 0x60f19e7, FUNC(panicstr_speedup_r) ); set_drc_pcflush(machine, 0x404e68a); }
+static DRIVER_INIT( senknow ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60000dc, 0x60000df, FUNC(senknow_speedup_r) ); set_drc_pcflush(machine, 0x4017dce); }
+static DRIVER_INIT( puzzloop ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6081d38, 0x6081d3b, FUNC(puzzloop_speedup_r) ); set_drc_pcflush(machine, 0x401da14); }
+static DRIVER_INIT( puzzloopj ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6086714, 0x6086717, FUNC(puzzloopj_speedup_r) ); set_drc_pcflush(machine, 0x401dca0); }
+static DRIVER_INIT( puzzloopa ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6085bcc, 0x6085bcf, FUNC(puzzloopa_speedup_r) ); set_drc_pcflush(machine, 0x401d9d4); }
+static DRIVER_INIT( puzzloopu ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6085cec, 0x6085cef, FUNC(puzzloopu_speedup_r) ); set_drc_pcflush(machine, 0x401dab0); }
+static DRIVER_INIT( jjparads ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000994, 0x6000997, FUNC(jjparads_speedup_r) ); set_drc_pcflush(machine, 0x4015e84); }
+static DRIVER_INIT( jjparad2 ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000984, 0x6000987, FUNC(jjparad2_speedup_r) ); set_drc_pcflush(machine, 0x401620a); }
+static DRIVER_INIT( ryouran ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000a14, 0x6000a17, FUNC(ryouran_speedup_r) ); set_drc_pcflush(machine, 0x40182ce); }
+static DRIVER_INIT( teljan ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6002fb4, 0x6002fb7, FUNC(teljan_speedup_r) ); set_drc_pcflush(machine, 0x401ba32); }
+static DRIVER_INIT( sengekis ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60b74bc, 0x60b74bf, FUNC(sengekis_speedup_r) ); set_drc_pcflush(machine, 0x60006ec); }
+static DRIVER_INIT( sengekij ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine); machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60b7380, 0x60b7383, FUNC(sengekij_speedup_r) ); set_drc_pcflush(machine, 0x60006ec); }
+static DRIVER_INIT( sarukani ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); set_drc_pcflush(machine, 0x4013b42); } // Speedup is in skns_io_w()
+static DRIVER_INIT( galpans3 ) { machine.device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine); }
diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c
index ad6801f96e3..4b2d6525379 100644
--- a/src/mame/drivers/suprridr.c
+++ b/src/mame/drivers/suprridr.c
@@ -93,14 +93,14 @@
static WRITE8_HANDLER( nmi_enable_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
state->nmi_enable = data;
}
static INTERRUPT_GEN( main_nmi_gen )
{
- suprridr_state *state = device->machine->driver_data<suprridr_state>();
+ suprridr_state *state = device->machine().driver_data<suprridr_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -115,7 +115,7 @@ static INTERRUPT_GEN( main_nmi_gen )
static TIMER_CALLBACK( delayed_sound_w )
{
- suprridr_state *state = machine->driver_data<suprridr_state>();
+ suprridr_state *state = machine.driver_data<suprridr_state>();
state->sound_data = param;
cputag_set_input_line(machine, "audiocpu", 0, ASSERT_LINE);
}
@@ -123,20 +123,20 @@ static TIMER_CALLBACK( delayed_sound_w )
static WRITE8_HANDLER( sound_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data);
}
static READ8_DEVICE_HANDLER( sound_data_r )
{
- suprridr_state *state = device->machine->driver_data<suprridr_state>();
+ suprridr_state *state = device->machine().driver_data<suprridr_state>();
return state->sound_data;
}
static WRITE8_HANDLER( sound_irq_ack_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
@@ -150,7 +150,7 @@ static WRITE8_HANDLER( sound_irq_ack_w )
static WRITE8_HANDLER( coin_lock_w )
{
/* cleared when 9 credits are hit, but never reset! */
-/* coin_lockout_global_w(space->machine, ~data & 1); */
+/* coin_lockout_global_w(space->machine(), ~data & 1); */
}
@@ -228,10 +228,10 @@ static CUSTOM_INPUT( suprridr_control_r )
UINT32 ret;
/* screen flip multiplexes controls */
- if (suprridr_is_screen_flipped(field->port->machine))
- ret = input_port_read(field->port->machine, SUPRRIDR_P2_CONTROL_PORT_TAG);
+ if (suprridr_is_screen_flipped(field->port->machine()))
+ ret = input_port_read(field->port->machine(), SUPRRIDR_P2_CONTROL_PORT_TAG);
else
- ret = input_port_read(field->port->machine, SUPRRIDR_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(field->port->machine(), SUPRRIDR_P1_CONTROL_PORT_TAG);
return ret;
}
diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c
index a12dc363bfc..8a61c800d04 100644
--- a/src/mame/drivers/suprslam.c
+++ b/src/mame/drivers/suprslam.c
@@ -92,7 +92,7 @@ EB26IC73.BIN 27C240 / Main Program
static WRITE16_HANDLER( sound_command_w )
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
@@ -104,24 +104,24 @@ static WRITE16_HANDLER( sound_command_w )
#if 0
static READ16_HANDLER( pending_command_r )
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
return pending_command;
}
#endif
static WRITE8_HANDLER( pending_command_clear_w )
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( suprslam_sh_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("audiocpu")->base();
+ UINT8 *RAM = space->machine().region("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
/*** MEMORY MAPS *************************************************************/
@@ -280,7 +280,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- suprslam_state *state = device->machine->driver_data<suprslam_state>();
+ suprslam_state *state = device->machine().driver_data<suprslam_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -298,10 +298,10 @@ static const k053936_interface suprslam_k053936_intf =
static MACHINE_START( suprslam )
{
- suprslam_state *state = machine->driver_data<suprslam_state>();
+ suprslam_state *state = machine.driver_data<suprslam_state>();
- state->audiocpu = machine->device("audiocpu");
- state->k053936 = machine->device("k053936");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936 = machine.device("k053936");
state->save_item(NAME(state->screen_bank));
state->save_item(NAME(state->bg_bank));
@@ -310,7 +310,7 @@ static MACHINE_START( suprslam )
static MACHINE_RESET( suprslam )
{
- suprslam_state *state = machine->driver_data<suprslam_state>();
+ suprslam_state *state = machine.driver_data<suprslam_state>();
state->screen_bank = 0;
state->bg_bank = 0;
diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c
index d76d661c8b9..f3a1b537fcb 100644
--- a/src/mame/drivers/surpratk.c
+++ b/src/mame/drivers/surpratk.c
@@ -20,21 +20,21 @@ static KONAMI_SETLINES_CALLBACK( surpratk_banking );
static INTERRUPT_GEN( surpratk_interrupt )
{
- surpratk_state *state = device->machine->driver_data<surpratk_state>();
+ surpratk_state *state = device->machine().driver_data<surpratk_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, 0, HOLD_LINE);
}
static READ8_HANDLER( bankedram_r )
{
- surpratk_state *state = space->machine->driver_data<surpratk_state>();
+ surpratk_state *state = space->machine().driver_data<surpratk_state>();
if (state->videobank & 0x02)
{
if (state->videobank & 0x04)
- return space->machine->generic.paletteram.u8[offset + 0x0800];
+ return space->machine().generic.paletteram.u8[offset + 0x0800];
else
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
else if (state->videobank & 0x01)
return k053245_r(state->k053244, offset);
@@ -44,7 +44,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- surpratk_state *state = space->machine->driver_data<surpratk_state>();
+ surpratk_state *state = space->machine().driver_data<surpratk_state>();
if (state->videobank & 0x02)
{
@@ -61,7 +61,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( surpratk_videobank_w )
{
- surpratk_state *state = space->machine->driver_data<surpratk_state>();
+ surpratk_state *state = space->machine().driver_data<surpratk_state>();
logerror("%04x: videobank = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0 = select 053245 at 0000-07ff */
@@ -72,14 +72,14 @@ static WRITE8_HANDLER( surpratk_videobank_w )
static WRITE8_HANDLER( surpratk_5fc0_w )
{
- surpratk_state *state = space->machine->driver_data<surpratk_state>();
+ surpratk_state *state = space->machine().driver_data<surpratk_state>();
if ((data & 0xf4) != 0x10)
logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
@@ -170,7 +170,7 @@ INPUT_PORTS_END
static void irqhandler( device_t *device, int linestate )
{
- surpratk_state *state = device->machine->driver_data<surpratk_state>();
+ surpratk_state *state = device->machine().driver_data<surpratk_state>();
device_set_input_line(state->maincpu, KONAMI_FIRQ_LINE, linestate);
}
@@ -200,33 +200,33 @@ static const k05324x_interface surpratk_k05324x_intf =
static MACHINE_START( surpratk )
{
- surpratk_state *state = machine->driver_data<surpratk_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ surpratk_state *state = machine.driver_data<surpratk_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 28, &ROM[0x10000], 0x2000);
memory_configure_bank(machine, "bank1", 28, 4, &ROM[0x08000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
- state->maincpu = machine->device("maincpu");
- state->k053244 = machine->device("k053244");
- state->k053251 = machine->device("k053251");
- state->k052109 = machine->device("k052109");
+ state->maincpu = machine.device("maincpu");
+ state->k053244 = machine.device("k053244");
+ state->k053251 = machine.device("k053251");
+ state->k052109 = machine.device("k052109");
state->save_item(NAME(state->videobank));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
state->save_item(NAME(state->layerpri));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x1000);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x1000);
}
static MACHINE_RESET( surpratk )
{
- surpratk_state *state = machine->driver_data<surpratk_state>();
+ surpratk_state *state = machine.driver_data<surpratk_state>();
int i;
- konami_configure_set_lines(machine->device("maincpu"), surpratk_banking);
+ konami_configure_set_lines(machine.device("maincpu"), surpratk_banking);
for (i = 0; i < 3; i++)
{
@@ -335,7 +335,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( surpratk_banking )
{
logerror("%04x: setlines %02x\n",cpu_get_pc(device), lines);
- memory_set_bank(device->machine, "bank1", lines & 0x1f);
+ memory_set_bank(device->machine(), "bank1", lines & 0x1f);
}
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index 61e18e8d191..8bf1211c292 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -341,16 +341,16 @@ static const UINT8 cc_ex[0x100] = {
static MACHINE_START( system1 )
{
- system1_state *state = machine->driver_data<system1_state>();
- UINT32 numbanks = (machine->region("maincpu")->bytes() - 0x10000) / 0x4000;
+ system1_state *state = machine.driver_data<system1_state>();
+ UINT32 numbanks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
if (numbanks > 0)
- memory_configure_bank(machine, "bank1", 0, numbanks, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, numbanks, machine.region("maincpu")->base() + 0x10000, 0x4000);
else
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("maincpu")->base() + 0x8000, 0);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("maincpu")->base() + 0x8000, 0);
memory_set_bank(machine, "bank1", 0);
- z80_set_cycle_tables(machine->device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
+ z80_set_cycle_tables(machine.device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
state->mute_xor = 0x00;
@@ -363,7 +363,7 @@ static MACHINE_START( system1 )
static MACHINE_START( system2 )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
MACHINE_START_CALL(system1);
state->mute_xor = 0x01;
}
@@ -371,7 +371,7 @@ static MACHINE_START( system2 )
static MACHINE_RESET( system1 )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
state->dakkochn_mux_data = 0;
}
@@ -383,14 +383,14 @@ static MACHINE_RESET( system1 )
*
*************************************/
-static void bank44_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata)
+static void bank44_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 6 and 2 */
memory_set_bank(machine, "bank1", ((data & 0x40) >> 5) | ((data & 0x04) >> 2));
}
-static void bank0c_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata)
+static void bank0c_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 3 and 2 */
memory_set_bank(machine, "bank1", (data & 0x0c) >> 2);
@@ -399,8 +399,8 @@ static void bank0c_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata
static WRITE8_HANDLER( videomode_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- device_t *i8751 = space->machine->device("mcu");
+ system1_state *state = space->machine().driver_data<system1_state>();
+ device_t *i8751 = space->machine().device("mcu");
/* bit 6 is connected to the 8751 IRQ */
if (i8751 != NULL)
@@ -408,11 +408,11 @@ static WRITE8_HANDLER( videomode_w )
/* handle any custom banking or other stuff */
if (state->videomode_custom != NULL)
- (*state->videomode_custom)(space->machine, data, state->videomode_prev);
+ (*state->videomode_custom)(space->machine(), data, state->videomode_prev);
state->videomode_prev = data;
/* bit 0 is for the coin counters */
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
/* remaining signals are video-related */
system1_videomode_w(space, 0, data);
@@ -428,23 +428,23 @@ static WRITE8_HANDLER( videomode_w )
static CUSTOM_INPUT( dakkochn_mux_data_r )
{
- system1_state *state = field->port->machine->driver_data<system1_state>();
+ system1_state *state = field->port->machine().driver_data<system1_state>();
static const char *const ports[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
- return input_port_read(field->port->machine, ports[state->dakkochn_mux_data]);
+ return input_port_read(field->port->machine(), ports[state->dakkochn_mux_data]);
}
static CUSTOM_INPUT( dakkochn_mux_status_r )
{
- system1_state *state = field->port->machine->driver_data<system1_state>();
+ system1_state *state = field->port->machine().driver_data<system1_state>();
/* reads from here indicate which mux port is selected */
return 1 << (state->dakkochn_mux_data);
}
-static void dakkochn_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata)
+static void dakkochn_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
/* bit 1 toggling on clocks the mux; we store the previous state in the high bit of dakkochn_mux_data */
if ((data & 0x02) && !(prevdata & 0x02))
state->dakkochn_mux_data = (state->dakkochn_mux_data + 1) % 7;
@@ -463,14 +463,14 @@ static void dakkochn_custom_w(running_machine *machine, UINT8 data, UINT8 prevda
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- system1_state *state = device->machine->driver_data<system1_state>();
+ system1_state *state = device->machine().driver_data<system1_state>();
/* bit 0 = MUTE (inverted sense on System 2) */
- device->machine->sound().system_mute((data ^ state->mute_xor) & 1);
+ device->machine().sound().system_mute((data ^ state->mute_xor) & 1);
/* bit 6 = feedback from sound board that read occurrred */
/* bit 7 controls the sound CPU's NMI line */
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
/* remaining bits are used for video RAM banking */
system1_videoram_bank_w(device, offset, data);
@@ -479,8 +479,8 @@ static WRITE8_DEVICE_HANDLER( sound_control_w )
static READ8_HANDLER( sound_data_r )
{
- ppi8255_device *ppi = space->machine->device<ppi8255_device>("ppi");
- z80pio_device *pio = space->machine->device<z80pio_device>("pio");
+ ppi8255_device *ppi = space->machine().device<ppi8255_device>("ppi");
+ z80pio_device *pio = space->machine().device<z80pio_device>("pio");
/* if we have an 8255 PPI, get the data from the port and toggle the ack */
if (ppi != NULL)
@@ -508,14 +508,14 @@ static WRITE8_HANDLER( soundport_w )
{
/* boost interleave when communicating with the sound CPU */
soundlatch_w(space, 0, data);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static TIMER_DEVICE_CALLBACK( soundirq_gen )
{
/* sound IRQ is generated on 32V, 96V, ... and auto-acknowledged */
- cputag_set_input_line(timer.machine, "soundcpu", 0, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "soundcpu", 0, HOLD_LINE);
}
@@ -528,7 +528,7 @@ static TIMER_DEVICE_CALLBACK( soundirq_gen )
static WRITE8_HANDLER( mcu_control_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
/*
Bit 7 -> connects to TD62003 pins 5 & 6 @ IC151
Bit 6 -> via PLS153, when high, asserts the BUSREQ signal, halting the Z80
@@ -540,22 +540,22 @@ static WRITE8_HANDLER( mcu_control_w )
Bit 0 -> Directly connected to Z80 /INT line
*/
state->mcu_control = data;
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_HALT, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "maincpu", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_HALT, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( mcu_io_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
switch ((state->mcu_control >> 3) & 3)
{
case 0:
- space->machine->device<z80_device>("maincpu")->space(AS_PROGRAM)->write_byte(offset, data);
+ space->machine().device<z80_device>("maincpu")->space(AS_PROGRAM)->write_byte(offset, data);
break;
case 2:
- space->machine->device<z80_device>("maincpu")->space(AS_IO)->write_byte(offset, data);
+ space->machine().device<z80_device>("maincpu")->space(AS_IO)->write_byte(offset, data);
break;
default:
@@ -568,17 +568,17 @@ static WRITE8_HANDLER( mcu_io_w )
static READ8_HANDLER( mcu_io_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
switch ((state->mcu_control >> 3) & 3)
{
case 0:
- return space->machine->device<z80_device>("maincpu")->space(AS_PROGRAM)->read_byte(offset);
+ return space->machine().device<z80_device>("maincpu")->space(AS_PROGRAM)->read_byte(offset);
case 1:
- return space->machine->region("maincpu")->base()[offset + 0x10000];
+ return space->machine().region("maincpu")->base()[offset + 0x10000];
case 2:
- return space->machine->device<z80_device>("maincpu")->space(AS_IO)->read_byte(offset);
+ return space->machine().device<z80_device>("maincpu")->space(AS_IO)->read_byte(offset);
default:
logerror("%03X: MCU movx read mode %02X offset %04X\n",
@@ -595,7 +595,7 @@ static INTERRUPT_GEN( mcu_irq_assert )
device_set_input_line(device, MCS51_INT0_LINE, CLEAR_LINE);
/* boost interleave to ensure that the MCU can break the Z80 out of a HALT */
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
@@ -605,7 +605,7 @@ static TIMER_DEVICE_CALLBACK( mcu_t0_callback )
enough, the MCU will fail; on shtngmst this happens after 3
VBLANKs without a tick */
- device_t *mcu = timer.machine->device("mcu");
+ device_t *mcu = timer.machine().device("mcu");
device_set_input_line(mcu, MCS51_T0_LINE, ASSERT_LINE);
device_set_input_line(mcu, MCS51_T0_LINE, CLEAR_LINE);
}
@@ -620,7 +620,7 @@ static TIMER_DEVICE_CALLBACK( mcu_t0_callback )
static WRITE8_HANDLER( nob_mcu_control_p2_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
/* bit 0 triggers a read from MCU port 0 */
if (((state->mcu_control ^ data) & 0x01) && !(data & 0x01))
*state->nob_mcu_latch = state->nob_maincpu_latch;
@@ -645,23 +645,23 @@ static WRITE8_HANDLER( nob_mcu_control_p2_w )
static READ8_HANDLER( nob_maincpu_latch_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
return state->nob_maincpu_latch;
}
static WRITE8_HANDLER( nob_maincpu_latch_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
state->nob_maincpu_latch = data;
- cputag_set_input_line(space->machine, "mcu", MCS51_INT0_LINE, ASSERT_LINE);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ cputag_set_input_line(space->machine(), "mcu", MCS51_INT0_LINE, ASSERT_LINE);
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static READ8_HANDLER( nob_mcu_status_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
return *state->nob_mcu_status;
}
@@ -689,14 +689,14 @@ static READ8_HANDLER( nobb_inport22_r )
static READ8_HANDLER( nobb_inport23_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
// logerror("IN $23 : pc = %04x - step = %02x\n",cpu_get_pc(space->cpu),state->nobb_inport23_step);
return(state->nobb_inport23_step);
}
static WRITE8_HANDLER( nobb_outport24_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
// logerror("OUT $24 : pc = %04x - data = %02x\n",cpu_get_pc(space->cpu),data);
state->nobb_inport23_step = data;
}
@@ -4496,18 +4496,18 @@ ROM_END
static DRIVER_INIT( bank00 )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
state->videomode_custom = NULL;
}
static DRIVER_INIT( bank44 )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
state->videomode_custom = bank44_custom_w;
}
static DRIVER_INIT( bank0c )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
state->videomode_custom = bank0c_custom_w;
}
@@ -4541,16 +4541,16 @@ static DRIVER_INIT( wboysys2 ) { DRIVER_INIT_CALL(bank0c); sega_315_5177_decode(
static DRIVER_INIT( dakkochn )
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
state->videomode_custom = dakkochn_custom_w;
mc8123_decrypt_rom(machine, "maincpu", "key", "bank1", 4);
-// machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(dakkochn_port_00_r));
-// machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x03, 0x03, FUNC(dakkochn_port_03_r));
-// machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(dakkochn_port_04_r));
+// machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x00, FUNC(dakkochn_port_00_r));
+// machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x03, 0x03, FUNC(dakkochn_port_03_r));
+// machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x04, FUNC(dakkochn_port_04_r));
-// machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x15, 0x15, FUNC(dakkochn_port_15_w));
+// machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x15, 0x15, FUNC(dakkochn_port_15_w));
}
@@ -4563,12 +4563,12 @@ static DRIVER_INIT( myherok )
/* additionally to the usual protection, all the program ROMs have data lines */
/* D0 and D1 swapped. */
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
for (A = 0;A < 0xc000;A++)
rom[A] = (rom[A] & 0xfc) | ((rom[A] & 1) << 1) | ((rom[A] & 2) >> 1);
/* the tile gfx ROMs are mangled as well: */
- rom = machine->region("tiles")->base();
+ rom = machine.region("tiles")->base();
/* the first ROM has data lines D0 and D6 swapped. */
for (A = 0x0000;A < 0x4000;A++)
@@ -4603,13 +4603,13 @@ static DRIVER_INIT( myherok )
static READ8_HANDLER( nob_start_r )
{
/* in reality, it's likely some M1-dependent behavior */
- return (cpu_get_pc(space->cpu) <= 0x0003) ? 0x80 : space->machine->region("maincpu")->base()[1];
+ return (cpu_get_pc(space->cpu) <= 0x0003) ? 0x80 : space->machine().region("maincpu")->base()[1];
}
static DRIVER_INIT( nob )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
DRIVER_INIT_CALL(bank44);
@@ -4628,7 +4628,7 @@ static DRIVER_INIT( nobb )
/* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */
/* not really needed */
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM)
// ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1)
@@ -4640,8 +4640,8 @@ static DRIVER_INIT( nobb )
// ROM[0x10000 + 0 * 0x8000 + 0x3347] = 0x18; // 'jr' instead of 'jr z'
/* Patch to get sound in later levels(the program enters into a tight loop)*/
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
- UINT8 *ROM2 = machine->region("soundcpu")->base();
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
+ UINT8 *ROM2 = machine.region("soundcpu")->base();
ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr'
@@ -4656,23 +4656,23 @@ static DRIVER_INIT( nobb )
static DRIVER_INIT( bootleg )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x10000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
DRIVER_INIT_CALL(bank00);
}
static DRIVER_INIT( bootsys2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x20000);
- memory_configure_bank_decrypted(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x30000, 0x4000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x20000);
+ memory_configure_bank_decrypted(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x30000, 0x4000);
DRIVER_INIT_CALL(bank0c);
}
static DRIVER_INIT( choplift )
{
- UINT8 *mcurom = machine->region("mcu")->base();
+ UINT8 *mcurom = machine.region("mcu")->base();
/* the ROM dump we have is bad; the following patches make it work */
mcurom[0x100] = 0x55; /* D5 in current dump */
@@ -4684,7 +4684,7 @@ static DRIVER_INIT( choplift )
static DRIVER_INIT( shtngmst )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
iospace->install_read_port(0x12, 0x12, 0x00, 0x00, "TRIGGER");
iospace->install_read_port(0x18, 0x18, 0x00, 0x03, "18");
iospace->install_read_port(0x1c, 0x1c, 0x00, 0x02, "GUNX");
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index d169fd43497..df1a3fa6c4d 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -110,7 +110,7 @@ static INTERRUPT_GEN( sys16_interrupt )
static WRITE16_HANDLER( sound_command_nmi_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -149,7 +149,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( sound_command_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -160,16 +160,16 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( sys16_coinctrl_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
state->coinctrl = data & 0xff;
state->refreshenable = state->coinctrl & 0x20;
- set_led_status(space->machine, 1, state->coinctrl & 0x08);
- set_led_status(space->machine, 0, state->coinctrl & 0x04);
- coin_counter_w(space->machine, 1, state->coinctrl & 0x02);
- coin_counter_w(space->machine, 0, state->coinctrl & 0x01);
+ set_led_status(space->machine(), 1, state->coinctrl & 0x08);
+ set_led_status(space->machine(), 0, state->coinctrl & 0x04);
+ coin_counter_w(space->machine(), 1, state->coinctrl & 0x02);
+ coin_counter_w(space->machine(), 0, state->coinctrl & 0x01);
/* bit 6 is also used (1 most of the time; 0 in dduxbl, sdi, wb3;
tturf has it normally 1 but 0 after coin insertion) */
/* eswat sets bit 4 */
@@ -206,57 +206,57 @@ ADDRESS_MAP_END
static READ16_HANDLER( passht4b_service_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
- UINT16 val = input_port_read(space->machine, "SERVICE");
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
+ UINT16 val = input_port_read(space->machine(), "SERVICE");
- if(!(input_port_read(space->machine, "P1") & 0x40)) val &= 0xef;
- if(!(input_port_read(space->machine, "P2") & 0x40)) val &= 0xdf;
- if(!(input_port_read(space->machine, "P3") & 0x40)) val &= 0xbf;
- if(!(input_port_read(space->machine, "P4") & 0x40)) val &= 0x7f;
+ if(!(input_port_read(space->machine(), "P1") & 0x40)) val &= 0xef;
+ if(!(input_port_read(space->machine(), "P2") & 0x40)) val &= 0xdf;
+ if(!(input_port_read(space->machine(), "P3") & 0x40)) val &= 0xbf;
+ if(!(input_port_read(space->machine(), "P4") & 0x40)) val &= 0x7f;
- state->passht4b_io3_val = (input_port_read(space->machine, "P1") << 4) | (input_port_read(space->machine, "P3") & 0xf);
- state->passht4b_io2_val = (input_port_read(space->machine, "P2") << 4) | (input_port_read(space->machine, "P4") & 0xf);
+ state->passht4b_io3_val = (input_port_read(space->machine(), "P1") << 4) | (input_port_read(space->machine(), "P3") & 0xf);
+ state->passht4b_io2_val = (input_port_read(space->machine(), "P2") << 4) | (input_port_read(space->machine(), "P4") & 0xf);
state->passht4b_io1_val = 0xff;
// player 1 buttons
- if(!(input_port_read(space->machine, "P1") & 0x10)) state->passht4b_io1_val &= 0xfe;
- if(!(input_port_read(space->machine, "P1") & 0x20)) state->passht4b_io1_val &= 0xfd;
- if(!(input_port_read(space->machine, "P1") & 0x80)) state->passht4b_io1_val &= 0xfc;
+ if(!(input_port_read(space->machine(), "P1") & 0x10)) state->passht4b_io1_val &= 0xfe;
+ if(!(input_port_read(space->machine(), "P1") & 0x20)) state->passht4b_io1_val &= 0xfd;
+ if(!(input_port_read(space->machine(), "P1") & 0x80)) state->passht4b_io1_val &= 0xfc;
// player 2 buttons
- if(!(input_port_read(space->machine, "P2") & 0x10)) state->passht4b_io1_val &= 0xfb;
- if(!(input_port_read(space->machine, "P2") & 0x20)) state->passht4b_io1_val &= 0xf7;
- if(!(input_port_read(space->machine, "P2") & 0x80)) state->passht4b_io1_val &= 0xf3;
+ if(!(input_port_read(space->machine(), "P2") & 0x10)) state->passht4b_io1_val &= 0xfb;
+ if(!(input_port_read(space->machine(), "P2") & 0x20)) state->passht4b_io1_val &= 0xf7;
+ if(!(input_port_read(space->machine(), "P2") & 0x80)) state->passht4b_io1_val &= 0xf3;
// player 3 buttons
- if(!(input_port_read(space->machine, "P3") & 0x10)) state->passht4b_io1_val &= 0xef;
- if(!(input_port_read(space->machine, "P3") & 0x20)) state->passht4b_io1_val &= 0xdf;
- if(!(input_port_read(space->machine, "P3") & 0x80)) state->passht4b_io1_val &= 0xcf;
+ if(!(input_port_read(space->machine(), "P3") & 0x10)) state->passht4b_io1_val &= 0xef;
+ if(!(input_port_read(space->machine(), "P3") & 0x20)) state->passht4b_io1_val &= 0xdf;
+ if(!(input_port_read(space->machine(), "P3") & 0x80)) state->passht4b_io1_val &= 0xcf;
// player 4 buttons
- if(!(input_port_read(space->machine, "P4") & 0x10)) state->passht4b_io1_val &= 0xbf;
- if(!(input_port_read(space->machine, "P4") & 0x20)) state->passht4b_io1_val &= 0x7f;
- if(!(input_port_read(space->machine, "P4") & 0x80)) state->passht4b_io1_val &= 0x3f;
+ if(!(input_port_read(space->machine(), "P4") & 0x10)) state->passht4b_io1_val &= 0xbf;
+ if(!(input_port_read(space->machine(), "P4") & 0x20)) state->passht4b_io1_val &= 0x7f;
+ if(!(input_port_read(space->machine(), "P4") & 0x80)) state->passht4b_io1_val &= 0x3f;
return val;
}
static READ16_HANDLER( passht4b_io1_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
return state->passht4b_io1_val;
}
static READ16_HANDLER( passht4b_io2_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
return state->passht4b_io2_val;
}
static READ16_HANDLER( passht4b_io3_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
return state->passht4b_io3_val;
}
@@ -293,7 +293,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( sys16_tilebank_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -366,13 +366,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tturfbl_msm5205_data_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->sample_buffer = data;
}
static void tturfbl_msm5205_callback( device_t *device )
{
- segas1x_bootleg_state *state = device->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = device->machine().driver_data<segas1x_bootleg_state>();
msm5205_data_w(device, (state->sample_buffer >> 4) & 0x0f);
state->sample_buffer <<= 4;
@@ -390,7 +390,7 @@ static const msm5205_interface tturfbl_msm5205_interface =
static READ8_HANDLER( tturfbl_soundbank_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (state->soundbank_ptr)
return state->soundbank_ptr[offset & 0x3fff];
@@ -399,8 +399,8 @@ static READ8_HANDLER( tturfbl_soundbank_r )
static WRITE8_HANDLER( tturfbl_soundbank_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
- UINT8 *mem = space->machine->region("soundcpu")->base();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
+ UINT8 *mem = space->machine().region("soundcpu")->base();
switch(data)
{
@@ -471,11 +471,11 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( upd7759_bank_w ) //*
{
- int offs, size = device->machine->region("soundcpu")->bytes() - 0x10000;
+ int offs, size = device->machine().region("soundcpu")->bytes() - 0x10000;
upd7759_reset_w(device, data & 0x40);
offs = 0x10000 + (data * 0x4000) % size;
- memory_set_bankptr(device->machine, "bank1", device->machine->region("soundcpu")->base() + offs);
+ memory_set_bankptr(device->machine(), "bank1", device->machine().region("soundcpu")->base() + offs);
}
@@ -490,25 +490,25 @@ ADDRESS_MAP_END
/***************************************************************************/
-static void set_tile_bank( running_machine *machine, int data )
+static void set_tile_bank( running_machine &machine, int data )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
state->tile_bank0 = (data >> 4) & 0x0f;
state->tile_bank1 = data & 0x0f;
}
-static void set_fg_page( running_machine *machine, int data )
+static void set_fg_page( running_machine &machine, int data )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
state->fg_page[0] = data >> 12;
state->fg_page[1] = (data >> 8) & 0x0f;
state->fg_page[2] = (data >> 4) & 0x0f;
state->fg_page[3] = data & 0x0f;
}
-static void set_bg_page( running_machine *machine, int data )
+static void set_bg_page( running_machine &machine, int data )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
state->bg_page[0] = data >> 12;
state->bg_page[1] = (data >> 8) & 0x0f;
state->bg_page[2] = (data >> 4) & 0x0f;
@@ -551,22 +551,22 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( s16bl_bgpage_w )
{
- set_bg_page(space->machine, data);
+ set_bg_page(space->machine(), data);
}
static WRITE16_HANDLER( s16bl_fgpage_w )
{
- set_fg_page(space->machine, data);
+ set_fg_page(space->machine(), data);
}
static WRITE16_HANDLER( s16bl_fgscrollx_bank_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0x1ff;
int bank = (data & 0xc000) >> 14;
scroll += 0x200;
- set_tile_bank(space->machine, bank);
+ set_tile_bank(space->machine(), bank);
scroll += 3; // so that the character portraits in attract mode are properly aligned (alighnment on character select no longer matches original tho?)
state->fg_scrollx = -scroll;
@@ -574,7 +574,7 @@ static WRITE16_HANDLER( s16bl_fgscrollx_bank_w )
static WRITE16_HANDLER( s16bl_fgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0x1ff;
scroll += 0x200;
@@ -586,7 +586,7 @@ static WRITE16_HANDLER( s16bl_fgscrollx_w )
static WRITE16_HANDLER( s16bl_fgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0xff;
state->fg_scrolly = scroll;
@@ -594,7 +594,7 @@ static WRITE16_HANDLER( s16bl_fgscrolly_w )
static WRITE16_HANDLER( s16bl_bgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0x1ff;
scroll+= 0x200;
@@ -604,7 +604,7 @@ static WRITE16_HANDLER( s16bl_bgscrollx_w )
static WRITE16_HANDLER( s16bl_bgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0xff;
state->bg_scrolly = scroll;
@@ -656,9 +656,9 @@ static ADDRESS_MAP_START( bayrouteb1_map, AS_PROGRAM, 16 )
AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
ADDRESS_MAP_END
-static void datsu_set_pages( running_machine *machine )
+static void datsu_set_pages( running_machine &machine )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
UINT16 page;
page = ((state->datsu_page[0] & 0x00f0) >>0) |
@@ -679,34 +679,34 @@ static void datsu_set_pages( running_machine *machine )
static WRITE16_HANDLER( datsu_page0_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->datsu_page[0]);
- datsu_set_pages(space->machine);
+ datsu_set_pages(space->machine());
}
static WRITE16_HANDLER( datsu_page1_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->datsu_page[1]);
- datsu_set_pages(space->machine);
+ datsu_set_pages(space->machine());
}
static WRITE16_HANDLER( datsu_page2_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->datsu_page[2]);
- datsu_set_pages(space->machine);
+ datsu_set_pages(space->machine());
}
static WRITE16_HANDLER( datsu_page3_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->datsu_page[3]);
- datsu_set_pages(space->machine);
+ datsu_set_pages(space->machine());
}
static ADDRESS_MAP_START( bayrouteb2_map, AS_PROGRAM, 16 )
@@ -762,11 +762,11 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( goldnaxeb2_fgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0x1ff;
int bank = (data & 0xc000) >> 14;
- set_tile_bank(space->machine, bank);
+ set_tile_bank(space->machine(), bank);
scroll += 0x1f6;
scroll &= 0x3ff;
state->fg_scrollx = -scroll;
@@ -774,7 +774,7 @@ static WRITE16_HANDLER( goldnaxeb2_fgscrollx_w )
static WRITE16_HANDLER( goldnaxeb2_bgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0x1ff;
scroll += 0x1f4;
@@ -785,7 +785,7 @@ static WRITE16_HANDLER( goldnaxeb2_bgscrollx_w )
static WRITE16_HANDLER( goldnaxeb2_fgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0xff;
scroll += 0x1;
@@ -794,7 +794,7 @@ static WRITE16_HANDLER( goldnaxeb2_fgscrolly_w )
static WRITE16_HANDLER( goldnaxeb2_bgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
int scroll = data & 0xff;
scroll += 0x1;
@@ -803,7 +803,7 @@ static WRITE16_HANDLER( goldnaxeb2_bgscrolly_w )
static WRITE16_HANDLER( goldnaxeb2_fgpage_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
UINT16 page;
COMBINE_DATA(&state->goldnaxeb2_fgpage[offset]);
@@ -813,13 +813,13 @@ static WRITE16_HANDLER( goldnaxeb2_fgpage_w )
((state->goldnaxeb2_fgpage[3] & 0xf) << 8) |
((state->goldnaxeb2_fgpage[2] & 0xf) << 12);
- set_fg_page(space->machine, page ^ 0xffff);
+ set_fg_page(space->machine(), page ^ 0xffff);
}
static WRITE16_HANDLER( goldnaxeb2_bgpage_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
UINT16 page;
COMBINE_DATA(&state->goldnaxeb2_bgpage[offset]);
@@ -829,7 +829,7 @@ static WRITE16_HANDLER( goldnaxeb2_bgpage_w )
((state->goldnaxeb2_bgpage[3] & 0xf) << 8) |
((state->goldnaxeb2_bgpage[2] & 0xf) << 12);
- set_bg_page(space->machine, page ^ 0xffff);
+ set_bg_page(space->machine(), page ^ 0xffff);
}
static ADDRESS_MAP_START( goldnaxeb2_map, AS_PROGRAM, 16 )
@@ -893,7 +893,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( eswat_tilebank0_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -959,7 +959,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( beautyb_unkx_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->beautyb_unkx++;
state->beautyb_unkx &= 0x7f;
@@ -1029,7 +1029,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( sys18_refreshenable_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1039,7 +1039,7 @@ static WRITE16_HANDLER( sys18_refreshenable_w )
static WRITE16_HANDLER( sys18_tilebank_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1050,7 +1050,7 @@ static WRITE16_HANDLER( sys18_tilebank_w )
static READ8_HANDLER( system18_bank_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (state->sound_bank != NULL)
return state->sound_bank[offset];
@@ -1070,8 +1070,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sys18_soundbank_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
- UINT8 *mem = space->machine->region("soundcpu")->base();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
+ UINT8 *mem = space->machine().region("soundcpu")->base();
int rom = (data >> 6) & 3;
int bank = (data & 0x3f);
int mask = state->sound_info[rom * 2 + 0];
@@ -1136,7 +1136,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( sound_command_irq_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1206,13 +1206,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( shdancbl_msm5205_data_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->sample_buffer = data;
}
static void shdancbl_msm5205_callback(device_t *device)
{
- segas1x_bootleg_state *state = device->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = device->machine().driver_data<segas1x_bootleg_state>();
msm5205_data_w(device, state->sample_buffer & 0x0f);
state->sample_buffer >>= 4;
@@ -1229,7 +1229,7 @@ static const msm5205_interface shdancbl_msm5205_interface =
static READ8_HANDLER( shdancbl_soundbank_r )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
if (state->soundbank_ptr)
return state->soundbank_ptr[offset & 0x3fff];
@@ -1238,8 +1238,8 @@ static READ8_HANDLER( shdancbl_soundbank_r )
static WRITE8_HANDLER( shdancbl_bankctrl_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
- UINT8 *mem = space->machine->region("soundcpu")->base();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
+ UINT8 *mem = space->machine().region("soundcpu")->base();
switch (data)
{
@@ -2081,7 +2081,7 @@ MACHINE_CONFIG_END
static void sound_cause_nmi( device_t *device, int chip )
{
- segas1x_bootleg_state *state = device->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = device->machine().driver_data<segas1x_bootleg_state>();
/* upd7759 callback */
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -3327,7 +3327,7 @@ ROM_END
static DRIVER_INIT( common )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
state->bg1_trans = 0;
state->splittab_bg_x = 0;
@@ -3347,14 +3347,14 @@ static DRIVER_INIT( common )
state->beautyb_unkx = 0;
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
}
/* Sys16A */
static DRIVER_INIT( shinobl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
@@ -3363,7 +3363,7 @@ static DRIVER_INIT( shinobl )
static DRIVER_INIT( passsht )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
@@ -3373,7 +3373,7 @@ static DRIVER_INIT( passsht )
static DRIVER_INIT( wb3bbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
@@ -3386,11 +3386,11 @@ static DRIVER_INIT( wb3bbl )
/* Sys16B */
static DRIVER_INIT( goldnaxeb1 )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *KEY = machine->region("decryption")->base();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *KEY = machine.region("decryption")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 data[0x1000];
// the decryption key is in a rom (part of an MSDOS executable...)
@@ -3425,14 +3425,14 @@ static DRIVER_INIT( bayrouteb1 )
//
// for now we use the code which is present in the unprotected bootleg set
// and modify the rom to use it
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
UINT16 *ROM2;
UINT16 *decrypted_region2;
// decrypt
DRIVER_INIT_CALL( goldnaxeb1 );
- ROM2 = (UINT16*)machine->region("maincpu")->base();
+ ROM2 = (UINT16*)machine.region("maincpu")->base();
decrypted_region2 = (UINT16*)state->decrypted_region;
// patch interrupt vector
@@ -3447,7 +3447,7 @@ static DRIVER_INIT( bayrouteb1 )
static DRIVER_INIT( bayrouteb2 )
{
- UINT8 *mem = machine->region("soundcpu")->base();
+ UINT8 *mem = machine.region("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3456,7 +3456,7 @@ static DRIVER_INIT( bayrouteb2 )
static DRIVER_INIT( goldnaxeb2 )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
@@ -3465,7 +3465,7 @@ static DRIVER_INIT( goldnaxeb2 )
static DRIVER_INIT( tturfbl )
{
- UINT8 *mem = machine->region("soundcpu")->base();
+ UINT8 *mem = machine.region("soundcpu")->base();
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3479,7 +3479,7 @@ static DRIVER_INIT( dduxbl )
static DRIVER_INIT( eswatbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
//state->splittab_fg_x = &sys16_textram[0x0f80];
@@ -3489,7 +3489,7 @@ static DRIVER_INIT( eswatbl )
static DRIVER_INIT( fpointbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
DRIVER_INIT_CALL(common);
//sys16_video_config(fpoint_update_proc, -0xb8, NULL);
@@ -3501,7 +3501,7 @@ static DRIVER_INIT( fpointbl )
/* Tetris-based */
static DRIVER_INIT( beautyb )
{
- UINT16*rom = (UINT16*)machine->region( "maincpu" )->base();
+ UINT16*rom = (UINT16*)machine.region( "maincpu" )->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -3519,8 +3519,8 @@ static DRIVER_INIT( beautyb )
/* Sys18 */
static DRIVER_INIT( shdancbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
- UINT8 *mem = machine->region("soundcpu")->base();;
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
+ UINT8 *mem = machine.region("soundcpu")->base();;
/* Copy first 32K of IC45 to Z80 address space */
memcpy(mem, mem + 0x10000, 0x8000);
@@ -3534,8 +3534,8 @@ static DRIVER_INIT( shdancbl )
static DRIVER_INIT( mwalkbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine->region("soundcpu")->base();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
+ UINT8 *RAM = machine.region("soundcpu")->base();
static const int mwalk_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
@@ -3556,8 +3556,8 @@ static DRIVER_INIT( mwalkbl )
static DRIVER_INIT( astormbl )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
- UINT8 *RAM = machine->region("soundcpu")->base();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
+ UINT8 *RAM = machine.region("soundcpu")->base();
static const int astormbl_sound_info[] =
{
0x0f, 0x00000, // ROM #1 = 128K
diff --git a/src/mame/drivers/tagteam.c b/src/mame/drivers/tagteam.c
index 6a26050f9ce..fc323601ee6 100644
--- a/src/mame/drivers/tagteam.c
+++ b/src/mame/drivers/tagteam.c
@@ -34,7 +34,7 @@ TODO:
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
}
@@ -66,10 +66,10 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( tagteam_interrupt )
{
- tagteam_state *state = device->machine->driver_data<tagteam_state>();
+ tagteam_state *state = device->machine().driver_data<tagteam_state>();
int port;
- port = input_port_read(device->machine, "P1") & 0xc0;
+ port = input_port_read(device->machine(), "P1") & 0xc0;
if (port != 0xc0) /* Coin */
{
diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c
index 37266421626..a3984bcb079 100644
--- a/src/mame/drivers/tail2nos.c
+++ b/src/mame/drivers/tail2nos.c
@@ -19,7 +19,7 @@
static WRITE16_HANDLER( sound_command_w )
{
- tail2nos_state *state = space->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = space->machine().driver_data<tail2nos_state>();
if (ACCESSING_BITS_0_7)
{
@@ -30,7 +30,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(device->machine, "bank3", data & 0x01);
+ memory_set_bank(device->machine(), "bank3", data & 0x01);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
@@ -180,7 +180,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- tail2nos_state *state = device->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = device->machine().driver_data<tail2nos_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -208,15 +208,15 @@ static const k051316_interface tail2nos_k051316_intf =
static MACHINE_START( tail2nos )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank3", 0, 2, &ROM[0x10000], 0x8000);
memory_set_bank(machine, "bank3", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k051316 = machine->device("k051316");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k051316 = machine.device("k051316");
state->save_item(NAME(state->charbank));
state->save_item(NAME(state->charpalette));
@@ -225,11 +225,11 @@ static MACHINE_START( tail2nos )
static MACHINE_RESET( tail2nos )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
/* point to the extra ROMs */
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base());
- memory_set_bankptr(machine, "bank2", machine->region("user2")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base());
+ memory_set_bankptr(machine, "bank2", machine.region("user2")->base());
state->charbank = 0;
state->charpalette = 0;
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index 42dc4fe8c6d..09206146de8 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -183,130 +183,130 @@ Notes:
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", (data - 1) & 3);
+ memory_set_bank(space->machine(), "bank1", (data - 1) & 3);
}
static TIMER_CALLBACK( rsaga2_interrupt2 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 2, HOLD_LINE);
}
static INTERRUPT_GEN( rastansaga2_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(rsaga2_interrupt2));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(rsaga2_interrupt2));
device_set_input_line(device, 4, HOLD_LINE);
}
static TIMER_CALLBACK( crimec_interrupt3 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 3, HOLD_LINE);
}
static INTERRUPT_GEN( crimec_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(crimec_interrupt3));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(crimec_interrupt3));
device_set_input_line(device, 5, HOLD_LINE);
}
static TIMER_CALLBACK( hitice_interrupt6 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
static INTERRUPT_GEN( hitice_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(hitice_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(hitice_interrupt6));
device_set_input_line(device, 4, HOLD_LINE);
}
static TIMER_CALLBACK( rambo3_interrupt1 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
}
static INTERRUPT_GEN( rambo3_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(rambo3_interrupt1));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(rambo3_interrupt1));
device_set_input_line(device, 6, HOLD_LINE);
}
static TIMER_CALLBACK( pbobble_interrupt5 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE);
}
static INTERRUPT_GEN( pbobble_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(pbobble_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(pbobble_interrupt5));
device_set_input_line(device, 3, HOLD_LINE);
}
static TIMER_CALLBACK( viofight_interrupt1 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
}
static INTERRUPT_GEN( viofight_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(viofight_interrupt1));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(viofight_interrupt1));
device_set_input_line(device, 4, HOLD_LINE);
}
static TIMER_CALLBACK( masterw_interrupt4 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 4, HOLD_LINE);
}
static INTERRUPT_GEN( masterw_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(masterw_interrupt4));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(masterw_interrupt4));
device_set_input_line(device, 5, HOLD_LINE);
}
static TIMER_CALLBACK( silentd_interrupt4 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 4, HOLD_LINE);
}
static INTERRUPT_GEN( silentd_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(silentd_interrupt4));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(silentd_interrupt4));
device_set_input_line(device, 6, HOLD_LINE);
}
static TIMER_CALLBACK( selfeena_interrupt4 )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 4, HOLD_LINE);
}
static INTERRUPT_GEN( selfeena_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(selfeena_interrupt4));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(5000), FUNC(selfeena_interrupt4));
device_set_input_line(device, 6, HOLD_LINE);
}
static TIMER_CALLBACK( sbm_interrupt5 )//4
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE);
}
static INTERRUPT_GEN( sbm_interrupt )//5
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(10000), FUNC(sbm_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(10000), FUNC(sbm_interrupt5));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -314,48 +314,48 @@ static INTERRUPT_GEN( sbm_interrupt )//5
static READ16_HANDLER( tracky1_hi_r )
{
- return input_port_read(space->machine, "TRACKX1");
+ return input_port_read(space->machine(), "TRACKX1");
}
static READ16_HANDLER( tracky1_lo_r )
{
- return (input_port_read(space->machine, "TRACKX1") & 0xff) << 8;
+ return (input_port_read(space->machine(), "TRACKX1") & 0xff) << 8;
}
static READ16_HANDLER( trackx1_hi_r )
{
- return input_port_read(space->machine, "TRACKY1");
+ return input_port_read(space->machine(), "TRACKY1");
}
static READ16_HANDLER( trackx1_lo_r )
{
- return (input_port_read(space->machine, "TRACKY1") & 0xff) << 8;
+ return (input_port_read(space->machine(), "TRACKY1") & 0xff) << 8;
}
static READ16_HANDLER( tracky2_hi_r )
{
- return input_port_read(space->machine, "TRACKX2");
+ return input_port_read(space->machine(), "TRACKX2");
}
static READ16_HANDLER( tracky2_lo_r )
{
- return (input_port_read(space->machine, "TRACKX2") & 0xff) << 8;
+ return (input_port_read(space->machine(), "TRACKX2") & 0xff) << 8;
}
static READ16_HANDLER( trackx2_hi_r )
{
- return input_port_read(space->machine, "TRACKY2");
+ return input_port_read(space->machine(), "TRACKY2");
}
static READ16_HANDLER( trackx2_lo_r )
{
- return (input_port_read(space->machine, "TRACKY2") & 0xff) << 8;
+ return (input_port_read(space->machine(), "TRACKY2") & 0xff) << 8;
}
static WRITE16_HANDLER( gain_control_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
if (ACCESSING_BITS_8_15)
{
if (offset == 0)
@@ -390,13 +390,13 @@ static const eeprom_interface taitob_eeprom_intf =
static READ16_HANDLER( eep_latch_r )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
return state->eep_latch;
}
static WRITE16_HANDLER( eeprom_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
COMBINE_DATA(&state->eep_latch);
@@ -414,7 +414,7 @@ static WRITE16_HANDLER( eeprom_w )
/* bit 7 - set all the time (Chip Select?) */
/* EEPROM */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -431,30 +431,30 @@ static WRITE16_HANDLER( eeprom_w )
static READ16_HANDLER( player_34_coin_ctrl_r )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
return state->coin_word;
}
static WRITE16_HANDLER( player_34_coin_ctrl_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
COMBINE_DATA(&state->coin_word);
/* coin counters and lockout */
- coin_lockout_w(space->machine, 2, ~data & 0x0100);
- coin_lockout_w(space->machine, 3, ~data & 0x0200);
- coin_counter_w(space->machine, 2, data & 0x0400);
- coin_counter_w(space->machine, 3, data & 0x0800);
+ coin_lockout_w(space->machine(), 2, ~data & 0x0100);
+ coin_lockout_w(space->machine(), 3, ~data & 0x0200);
+ coin_counter_w(space->machine(), 2, data & 0x0400);
+ coin_counter_w(space->machine(), 3, data & 0x0800);
}
static READ16_HANDLER( pbobble_input_bypass_r )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
switch (offset)
{
case 0x01:
- return input_port_read(space->machine, "COIN") << 8;
+ return input_port_read(space->machine(), "COIN") << 8;
default:
return tc0640fio_r(state->tc0640fio, offset) << 8;
@@ -463,7 +463,7 @@ static READ16_HANDLER( pbobble_input_bypass_r )
static WRITE16_HANDLER( spacedxo_tc0220ioc_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
if (ACCESSING_BITS_0_7)
tc0220ioc_w(state->tc0220ioc, offset, data & 0xff);
else
@@ -2091,7 +2091,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- taitob_state *state = device->machine->driver_data<taitob_state>();
+ taitob_state *state = device->machine().driver_data<taitob_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2124,9 +2124,9 @@ static const ym2203_interface ym2203_config =
Both ym2610 and ym2610b generate 3 (PSG like) + 2 (fm left,right) channels.
I use mixer_set_volume() to emulate the effect.
*/
-static void mb87078_gain_changed( running_machine *machine, int channel, int percent )
+static void mb87078_gain_changed( running_machine &machine, int channel, int percent )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
if (channel == 1)
{
@@ -2194,15 +2194,15 @@ static const tc0140syt_interface taitob_tc0140syt_intf =
static MACHINE_START( taitob )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mb87078 = machine->device("mb87078");
- state->ym = machine->device("ymsnd");
- state->tc0180vcu = machine->device("tc0180vcu");
- state->tc0640fio = machine->device("tc0640fio");
- state->tc0220ioc = machine->device("tc0220ioc");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mb87078 = machine.device("mb87078");
+ state->ym = machine.device("ymsnd");
+ state->tc0180vcu = machine.device("tc0180vcu");
+ state->tc0640fio = machine.device("tc0640fio");
+ state->tc0220ioc = machine.device("tc0220ioc");
state->save_item(NAME(state->eep_latch));
state->save_item(NAME(state->coin_word));
@@ -2210,7 +2210,7 @@ static MACHINE_START( taitob )
static MACHINE_RESET( taitob )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
state->eep_latch = 0;
state->coin_word = 0;
@@ -2989,7 +2989,7 @@ MACHINE_CONFIG_END
#if 0
static void ryujin_patch(void)
{
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[ 0x62/2 ] = 1;
//0 (already in rom) - Taito Corporation 1993
//1 - Taito America corp with blue FBI logo
@@ -3045,7 +3045,7 @@ MACHINE_CONFIG_END
#if 0
static void sbm_patch(void)
{
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[ 0x7ffff/2 ] = 2; //US version
}
#endif
@@ -3827,7 +3827,7 @@ ROM_END
static DRIVER_INIT( taito_b )
{
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
GAME( 1989, masterw, 0, masterw, masterw, taito_b, ROT270, "Taito Corporation Japan", "Master of Weapon (World)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index 8b7f742894e..39fa4ffbce3 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -282,10 +282,10 @@ static WRITE16_HANDLER( growl_coin_word_w ) /* what about coins 3&4 ?? */
{
if (ACCESSING_BITS_0_7)
{
- coin_lockout_w(space->machine, 0, ~data & 0x01);
- coin_lockout_w(space->machine, 1, ~data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x04);
- coin_counter_w(space->machine, 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x04);
+ coin_counter_w(space->machine(), 1, data & 0x08);
}
}
@@ -293,14 +293,14 @@ static WRITE16_HANDLER( taitof2_4p_coin_word_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_lockout_w(space->machine, 0, ~data & 0x01);
- coin_lockout_w(space->machine, 1, ~data & 0x02);
- coin_lockout_w(space->machine, 2, ~data & 0x04);
- coin_lockout_w(space->machine, 3, ~data & 0x08);
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
- coin_counter_w(space->machine, 2, data & 0x40);
- coin_counter_w(space->machine, 3, data & 0x80);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02);
+ coin_lockout_w(space->machine(), 2, ~data & 0x04);
+ coin_lockout_w(space->machine(), 3, ~data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
+ coin_counter_w(space->machine(), 2, data & 0x40);
+ coin_counter_w(space->machine(), 3, data & 0x80);
}
}
@@ -308,14 +308,14 @@ static WRITE16_HANDLER( ninjak_coin_word_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_lockout_w(space->machine, 0, ~data & 0x0100);
- coin_lockout_w(space->machine, 1, ~data & 0x0200);
- coin_lockout_w(space->machine, 2, ~data & 0x0400);
- coin_lockout_w(space->machine, 3, ~data & 0x0800);
- coin_counter_w(space->machine, 0, data & 0x1000);
- coin_counter_w(space->machine, 1, data & 0x2000);
- coin_counter_w(space->machine, 2, data & 0x4000);
- coin_counter_w(space->machine, 3, data & 0x8000);
+ coin_lockout_w(space->machine(), 0, ~data & 0x0100);
+ coin_lockout_w(space->machine(), 1, ~data & 0x0200);
+ coin_lockout_w(space->machine(), 2, ~data & 0x0400);
+ coin_lockout_w(space->machine(), 3, ~data & 0x0800);
+ coin_counter_w(space->machine(), 0, data & 0x1000);
+ coin_counter_w(space->machine(), 1, data & 0x2000);
+ coin_counter_w(space->machine(), 2, data & 0x4000);
+ coin_counter_w(space->machine(), 3, data & 0x8000);
}
}
@@ -324,25 +324,25 @@ static READ16_HANDLER( ninjak_input_r )
switch (offset)
{
case 0x00:
- return (input_port_read(space->machine, "DSWA") << 8);
+ return (input_port_read(space->machine(), "DSWA") << 8);
case 0x01:
- return (input_port_read(space->machine, "DSWB") << 8);
+ return (input_port_read(space->machine(), "DSWB") << 8);
case 0x02:
- return (input_port_read(space->machine, "IN0") << 8);
+ return (input_port_read(space->machine(), "IN0") << 8);
case 0x03:
- return (input_port_read(space->machine, "IN1") << 8);
+ return (input_port_read(space->machine(), "IN1") << 8);
case 0x04:
- return (input_port_read(space->machine, "IN3") << 8);
+ return (input_port_read(space->machine(), "IN3") << 8);
case 0x05:
- return (input_port_read(space->machine, "IN4") << 8);
+ return (input_port_read(space->machine(), "IN4") << 8);
case 0x06:
- return (input_port_read(space->machine, "IN2") << 8);
+ return (input_port_read(space->machine(), "IN2") << 8);
// case 0x07:
// return (coin_word & mem_mask);
@@ -355,19 +355,19 @@ static READ16_HANDLER( ninjak_input_r )
static READ16_HANDLER( cameltry_paddle_r )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
int curr, res = 0xff;
switch (offset)
{
case 0x00:
- curr = input_port_read(space->machine, "PADDLE1");
+ curr = input_port_read(space->machine(), "PADDLE1");
res = curr - state->last[0];
state->last[0] = curr;
return res;
case 0x02:
- curr = input_port_read(space->machine, "PADDLE2");
+ curr = input_port_read(space->machine(), "PADDLE2");
res = curr - state->last[1];
state->last[1] = curr;
return res;
@@ -384,12 +384,12 @@ static READ16_HANDLER( mjnquest_dsw_r )
{
case 0x00:
{
- return (input_port_read(space->machine, "IN5") << 8) + input_port_read(space->machine, "DSWA"); /* DSW A + coin */
+ return (input_port_read(space->machine(), "IN5") << 8) + input_port_read(space->machine(), "DSWA"); /* DSW A + coin */
}
case 0x01:
{
- return (input_port_read(space->machine, "IN6") << 8) + input_port_read(space->machine, "DSWB"); /* DSW B + coin */
+ return (input_port_read(space->machine(), "IN6") << 8) + input_port_read(space->machine(), "DSWB"); /* DSW B + coin */
}
}
@@ -400,23 +400,23 @@ static READ16_HANDLER( mjnquest_dsw_r )
static READ16_HANDLER( mjnquest_input_r )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
switch (state->mjnquest_input)
{
case 0x01:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x02:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x08:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
case 0x10:
- return input_port_read(space->machine, "IN4");
+ return input_port_read(space->machine(), "IN4");
}
@@ -427,7 +427,7 @@ static READ16_HANDLER( mjnquest_input_r )
static WRITE16_HANDLER( mjnquest_inputselect_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
state->mjnquest_input = (data >> 6);
}
@@ -577,13 +577,13 @@ driftout 8000 0000/8 0000 0000 The first control changes from 8000 to 0000
static TIMER_CALLBACK( taitof2_interrupt6 )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
static INTERRUPT_GEN( taitof2_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(taitof2_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(taitof2_interrupt6));
device_set_input_line(device, 5, HOLD_LINE);
}
@@ -594,7 +594,7 @@ static INTERRUPT_GEN( taitof2_interrupt )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank2", (data - 1) & 7);
+ memory_set_bank(space->machine(), "bank2", (data - 1) & 7);
#ifdef MAME_DEBUG
if (((data - 1) & 7) > 2)
@@ -605,7 +605,7 @@ static WRITE8_HANDLER( sound_bankswitch_w )
static READ8_HANDLER( driveout_sound_command_r)
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
// logerror("sound IRQ OFF (sound command=%02x)\n", state->driveout_sound_latch);
@@ -613,26 +613,26 @@ static READ8_HANDLER( driveout_sound_command_r)
}
-static void reset_driveout_sound_region( running_machine *machine )
+static void reset_driveout_sound_region( running_machine &machine )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->oki->set_bank_base(state->oki_bank * 0x40000);
}
static WRITE8_HANDLER( oki_bank_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
if ((data & 4) && (state->oki_bank != (data & 3)) )
{
state->oki_bank = (data & 3);
}
- reset_driveout_sound_region(space->machine);
+ reset_driveout_sound_region(space->machine());
}
static WRITE16_HANDLER( driveout_sound_command_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
if (ACCESSING_BITS_8_15)
{
@@ -668,7 +668,7 @@ static WRITE16_HANDLER( driveout_sound_command_w )
static WRITE16_HANDLER( cchip2_word_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
logerror("cchip2_w pc: %06x offset %04x: %02x\n", cpu_get_pc(space->cpu), offset, data);
@@ -677,7 +677,7 @@ static WRITE16_HANDLER( cchip2_word_w )
static READ16_HANDLER( cchip2_word_r )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
/* C-Chip ID */
if (offset == 0x401)
@@ -3215,7 +3215,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irq_handler( device_t *device, int irq )
{
- taitof2_state *state = device->machine->driver_data<taitof2_state>();
+ taitof2_state *state = device->machine().driver_data<taitof2_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -3423,23 +3423,23 @@ static const tc0140syt_interface taitof2_tc0140syt_intf =
static MACHINE_START( common )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");;
- state->tc0100scn = machine->device("tc0100scn");;
- state->tc0100scn_1 = machine->device("tc0100scn_1");;
- state->tc0100scn_2 = machine->device("tc0100scn_2");;
- state->tc0360pri = machine->device("tc0360pri");;
- state->tc0280grd = machine->device("tc0280grd");;
- state->tc0430grw = machine->device("tc0430grw");;
- state->tc0480scp = machine->device("tc0480scp");;
+ taitof2_state *state = machine.driver_data<taitof2_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");;
+ state->tc0100scn = machine.device("tc0100scn");;
+ state->tc0100scn_1 = machine.device("tc0100scn_1");;
+ state->tc0100scn_2 = machine.device("tc0100scn_2");;
+ state->tc0360pri = machine.device("tc0360pri");;
+ state->tc0280grd = machine.device("tc0280grd");;
+ state->tc0430grw = machine.device("tc0430grw");;
+ state->tc0480scp = machine.device("tc0480scp");;
}
static MACHINE_START( f2 )
{
MACHINE_START_CALL(common);
- memory_configure_bank(machine, "bank2", 0, 8, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank2", 0, 8, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( taito_f2, taitof2_state )
@@ -5703,7 +5703,7 @@ static DRIVER_INIT( finalb )
int i;
UINT8 data;
UINT32 offset;
- UINT8 *gfx = machine->region("gfx2")->base();
+ UINT8 *gfx = machine.region("gfx2")->base();
offset = 0x100000;
for (i = 0x180000; i < 0x200000; i++)
@@ -5727,7 +5727,7 @@ static DRIVER_INIT( finalb )
static DRIVER_INIT( cameltry )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->last[0] = 0;
state->last[1] = 0;
@@ -5738,9 +5738,9 @@ static DRIVER_INIT( cameltry )
static DRIVER_INIT( mjnquest )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
- int i, len = machine->region("gfx2")->bytes();
- UINT8 *gfx = machine->region("gfx2")->base();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
+ int i, len = machine.region("gfx2")->bytes();
+ UINT8 *gfx = machine.region("gfx2")->base();
/* the bytes in each longword are in reversed order, put them in the
order used by the other games. */
@@ -5765,7 +5765,7 @@ static STATE_POSTLOAD( driveout_postload )
static DRIVER_INIT( driveout )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->driveout_sound_latch = 0;
state->oki_bank = 0;
@@ -5774,7 +5774,7 @@ static DRIVER_INIT( driveout )
state->save_item(NAME(state->driveout_sound_latch));
state->save_item(NAME(state->oki_bank));
state->save_item(NAME(state->nibble));
- machine->state().register_postload(driveout_postload, NULL);
+ machine.state().register_postload(driveout_postload, NULL);
}
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index c91f1e8ca8c..49c4d40e825 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -50,14 +50,14 @@ static CUSTOM_INPUT( f3_analog_r )
const char *tag = (const char *)param;
UINT32 ipt = 0;
- ipt = ((input_port_read(field->port->machine, tag) & 0xf)<<12) | ((input_port_read(field->port->machine, tag) & 0xff0)>>4);
+ ipt = ((input_port_read(field->port->machine(), tag) & 0xf)<<12) | ((input_port_read(field->port->machine(), tag) & 0xff0)>>4);
return ipt;
}
static CUSTOM_INPUT( f3_coin_r )
{
- taito_f3_state *state = field->port->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = field->port->machine().driver_data<taito_f3_state>();
int num = (FPTR)param;
return state->coin_word[num];
}
@@ -67,7 +67,7 @@ static READ32_HANDLER( f3_control_r )
static const char *const iptnames[] = { "IN0", "IN1", "AN0", "AN1", "IN2", "IN3" };
if (offset < 6)
- return input_port_read(space->machine, iptnames[offset]);
+ return input_port_read(space->machine(), iptnames[offset]);
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(space->cpu), offset);
return 0xffffffff;
@@ -75,20 +75,20 @@ static READ32_HANDLER( f3_control_r )
static WRITE32_HANDLER( f3_control_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
switch (offset)
{
case 0x00: /* Watchdog */
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
return;
case 0x01: /* Coin counters & lockouts */
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0,~data & 0x01000000);
- coin_lockout_w(space->machine, 1,~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x08000000);
+ coin_lockout_w(space->machine(), 0,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1,~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x08000000);
state->coin_word[0]=(data>>16)&0xffff;
}
return;
@@ -96,17 +96,17 @@ static WRITE32_HANDLER( f3_control_w )
case 0x04: /* Eeprom */
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
return;
case 0x05: /* Player 3 & 4 coin counters */
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 2,~data & 0x01000000);
- coin_lockout_w(space->machine, 3,~data & 0x02000000);
- coin_counter_w(space->machine, 2, data & 0x04000000);
- coin_counter_w(space->machine, 3, data & 0x08000000);
+ coin_lockout_w(space->machine(), 2,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 3,~data & 0x02000000);
+ coin_counter_w(space->machine(), 2, data & 0x04000000);
+ coin_counter_w(space->machine(), 3, data & 0x08000000);
state->coin_word[1]=(data>>16)&0xffff;
}
return;
@@ -116,19 +116,19 @@ static WRITE32_HANDLER( f3_control_w )
static WRITE32_HANDLER( f3_sound_reset_0_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
static WRITE32_HANDLER( f3_sound_reset_1_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
static WRITE32_HANDLER( f3_sound_bankswitch_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
if (state->f3_game==KIRAMEKI) {
- UINT16 *rom = (UINT16 *)space->machine->region("audiocpu")->base();
+ UINT16 *rom = (UINT16 *)space->machine().region("audiocpu")->base();
UINT32 idx;
idx = (offset << 1) & 0x1e;
@@ -140,7 +140,7 @@ static WRITE32_HANDLER( f3_sound_bankswitch_w )
/* Banks are 0x20000 bytes each, divide by two to get data16
pointer rather than byte pointer */
- memory_set_bankptr(space->machine, "bank2", &rom[(idx*0x20000)/2 + 0x80000]);
+ memory_set_bankptr(space->machine(), "bank2", &rom[(idx*0x20000)/2 + 0x80000]);
} else {
logerror("Sound bankswitch in unsupported game\n");
@@ -362,7 +362,7 @@ static TIMER_CALLBACK( f3_interrupt3 )
static INTERRUPT_GEN( f3_interrupt2 )
{
device_set_input_line(device, 2, HOLD_LINE); // vblank
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(10000), FUNC(f3_interrupt3));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(10000), FUNC(f3_interrupt3));
}
static SOUND_RESET( f3 )
@@ -385,7 +385,7 @@ static const UINT16 recalh_eeprom[64] = {
static MACHINE_START(f3)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state_save_register_global_array(machine, state->coin_word);
}
@@ -3494,12 +3494,12 @@ ROM_END
/******************************************************************************/
-static void tile_decode(running_machine *machine)
+static void tile_decode(running_machine &machine)
{
UINT8 lsb,msb;
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx2")->base();
- int size=machine->region("gfx2")->bytes();
+ UINT8 *gfx = machine.region("gfx2")->base();
+ int size=machine.region("gfx2")->bytes();
int data;
/* Setup ROM formats:
@@ -3531,8 +3531,8 @@ static void tile_decode(running_machine *machine)
offset+=4;
}
- gfx = machine->region("gfx1")->base();
- size=machine->region("gfx1")->bytes();
+ gfx = machine.region("gfx1")->base();
+ size=machine.region("gfx1")->bytes();
offset = size/2;
for (i = size/2+size/4; i<size; i++)
@@ -3556,64 +3556,64 @@ static void tile_decode(running_machine *machine)
static DRIVER_INIT( ringrage )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=RINGRAGE;
tile_decode(machine);
}
static DRIVER_INIT( arabianm )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=ARABIANM;
tile_decode(machine);
}
static DRIVER_INIT( ridingf )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=RIDINGF;
tile_decode(machine);
}
static DRIVER_INIT( gseeker )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=GSEEKER;
tile_decode(machine);
}
static DRIVER_INIT( gunlock )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=GUNLOCK;
tile_decode(machine);
}
static DRIVER_INIT( elvactr )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=EACTION2;
tile_decode(machine);
}
static DRIVER_INIT( cupfinal )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=SCFINALS;
tile_decode(machine);
}
static DRIVER_INIT( trstaroj )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=TRSTAR;
tile_decode(machine);
}
static DRIVER_INIT( scfinals )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine->region("maincpu")->base();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
+ UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
/* Doesn't boot without this - eprom related? */
RAM[0x5af0/4]=0x4e710000|(RAM[0x5af0/4]&0xffff);
@@ -3627,63 +3627,63 @@ static DRIVER_INIT( scfinals )
static DRIVER_INIT( lightbr )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=LIGHTBR;
tile_decode(machine);
}
static DRIVER_INIT( kaiserkn )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=KAISERKN;
tile_decode(machine);
}
static DRIVER_INIT( dariusg )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=DARIUSG;
tile_decode(machine);
}
static DRIVER_INIT( spcinvdj )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=SPCINVDX;
tile_decode(machine);
}
static DRIVER_INIT( qtheater )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=QTHEATER;
tile_decode(machine);
}
static DRIVER_INIT( spcinv95 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=SPCINV95;
tile_decode(machine);
}
static DRIVER_INIT( gekirido )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=GEKIRIDO;
tile_decode(machine);
}
static DRIVER_INIT( ktiger2 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=KTIGER2;
tile_decode(machine);
}
static DRIVER_INIT( bubsymph )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=BUBSYMPH;
tile_decode(machine);
}
@@ -3691,16 +3691,16 @@ static DRIVER_INIT( bubsymph )
static READ32_HANDLER( bubsympb_oki_r )
{
- return space->machine->device<okim6295_device>("oki")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki")->read(*space,0);
}
static WRITE32_HANDLER( bubsympb_oki_w )
{
//printf("write %08x %08x\n",data,mem_mask);
- if (ACCESSING_BITS_0_7) space->machine->device<okim6295_device>("oki")->write(*space, 0,data&0xff);
+ if (ACCESSING_BITS_0_7) space->machine().device<okim6295_device>("oki")->write(*space, 0,data&0xff);
//if (mem_mask==0x000000ff) downcast<okim6295_device *>(device)->write(0,data&0xff);
if (ACCESSING_BITS_16_23)
{
- UINT8 *snd = space->machine->region("oki")->base();
+ UINT8 *snd = space->machine().region("oki")->base();
int bank = (data & 0x000f0000) >> 16;
// almost certainly wrong
memcpy(snd+0x30000, snd+0x80000+0x30000+bank*0x10000, 0x10000);
@@ -3714,14 +3714,14 @@ static WRITE32_HANDLER( bubsympb_oki_w )
static DRIVER_INIT( bubsympb )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=BUBSYMPH;
//tile_decode(machine);
/* expand gfx rom */
{
int i;
- UINT8 *gfx = machine->region("gfx2")->base();
+ UINT8 *gfx = machine.region("gfx2")->base();
for (i=0x200000;i<0x400000; i+=4)
{
@@ -3737,43 +3737,43 @@ static DRIVER_INIT( bubsympb )
}
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4a001c, 0x4a001f, FUNC(bubsympb_oki_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4a001c, 0x4a001f, FUNC(bubsympb_oki_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4a001c, 0x4a001f, FUNC(bubsympb_oki_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4a001c, 0x4a001f, FUNC(bubsympb_oki_w) );
}
static DRIVER_INIT( bubblem )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=BUBBLEM;
tile_decode(machine);
}
static DRIVER_INIT( cleopatr )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=CLEOPATR;
tile_decode(machine);
}
static DRIVER_INIT( popnpop )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=POPNPOP;
tile_decode(machine);
}
static DRIVER_INIT( landmakr )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=LANDMAKR;
tile_decode(machine);
}
static DRIVER_INIT( landmkrp )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
- UINT32 *RAM = (UINT32 *)machine->region("maincpu")->base();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
+ UINT32 *RAM = (UINT32 *)machine.region("maincpu")->base();
/* For some reason the least significant byte in the last 2 long words of
ROM is swapped. As the roms have been verified ok, I assume this is some
@@ -3788,40 +3788,40 @@ static DRIVER_INIT( landmkrp )
static DRIVER_INIT( pbobble3 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=PBOBBLE3;
tile_decode(machine);
}
static DRIVER_INIT( pbobble4 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=PBOBBLE4;
tile_decode(machine);
}
static DRIVER_INIT( quizhuhu )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=QUIZHUHU;
tile_decode(machine);
}
static DRIVER_INIT( pbobble2 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=PBOBBLE2;
tile_decode(machine);
}
static DRIVER_INIT( pbobbl2p )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
// has 040092: beq $30000; (2+)
// which eventually causes the game to crash
// -- protection check?? or some kind of checksum fail?
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
/* protection? */
ROM[0x40090/4]=0x00004e71|(ROM[0x40090/4]&0xffff0000);
@@ -3835,63 +3835,63 @@ static DRIVER_INIT( pbobbl2p )
static DRIVER_INIT( pbobbl2x )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=PBOBBLE2;
tile_decode(machine);
}
static DRIVER_INIT( hthero95 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=HTHERO95;
tile_decode(machine);
}
static DRIVER_INIT( kirameki )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=KIRAMEKI;
tile_decode(machine);
}
static DRIVER_INIT( puchicar )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=PUCHICAR;
tile_decode(machine);
}
static DRIVER_INIT( twinqix )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=TWINQIX;
tile_decode(machine);
}
static DRIVER_INIT( arkretrn )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=ARKRETRN;
tile_decode(machine);
}
static DRIVER_INIT( intcup94 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=SCFINALS;
tile_decode(machine);
}
static DRIVER_INIT( recalh )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=RECALH;
tile_decode(machine);
}
static DRIVER_INIT( commandw )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
state->f3_game=COMMANDW;
tile_decode(machine);
}
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index 80e9ba9ed4f..4af6e6ac66a 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -158,7 +158,7 @@ some kind of zoom table?
/* Handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- taitoh_state *state = device->machine->driver_data<taitoh_state>();
+ taitoh_state *state = device->machine().driver_data<taitoh_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -183,43 +183,43 @@ static READ8_HANDLER( syvalion_input_bypass_r )
{
/* Bypass TC0220IOC controller for analog input */
- taitoh_state *state = space->machine->driver_data<taitoh_state>();
+ taitoh_state *state = space->machine().driver_data<taitoh_state>();
UINT8 port = tc0220ioc_port_r(state->tc0220ioc, 0); /* read port number */
switch( port )
{
case 0x08: /* trackball y coords bottom 8 bits for 2nd player */
- return input_port_read(space->machine, P2TRACKY_PORT_TAG);
+ return input_port_read(space->machine(), P2TRACKY_PORT_TAG);
case 0x09: /* trackball y coords top 8 bits for 2nd player */
- if (input_port_read(space->machine, P2TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (input_port_read(space->machine(), P2TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
return 0xff;
else /* y+ direction (positive value) */
return 0x00;
case 0x0a: /* trackball x coords bottom 8 bits for 2nd player */
- return input_port_read(space->machine, P2TRACKX_PORT_TAG);
+ return input_port_read(space->machine(), P2TRACKX_PORT_TAG);
case 0x0b: /* trackball x coords top 8 bits for 2nd player */
- if (input_port_read(space->machine, P2TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (input_port_read(space->machine(), P2TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
return 0xff;
else /* x+ direction (positive value) */
return 0x00;
case 0x0c: /* trackball y coords bottom 8 bits for 1st player */
- return input_port_read(space->machine, P1TRACKY_PORT_TAG);
+ return input_port_read(space->machine(), P1TRACKY_PORT_TAG);
case 0x0d: /* trackball y coords top 8 bits for 1st player */
- if (input_port_read(space->machine, P1TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
+ if (input_port_read(space->machine(), P1TRACKY_PORT_TAG) & 0x80) /* y- direction (negative value) */
return 0xff;
else /* y+ direction (positive value) */
return 0x00;
case 0x0e: /* trackball x coords bottom 8 bits for 1st player */
- return input_port_read(space->machine, P1TRACKX_PORT_TAG);
+ return input_port_read(space->machine(), P1TRACKX_PORT_TAG);
case 0x0f: /* trackball x coords top 8 bits for 1st player */
- if (input_port_read(space->machine, P1TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
+ if (input_port_read(space->machine(), P1TRACKX_PORT_TAG) & 0x80) /* x- direction (negative value) */
return 0xff;
else /* x+ direction (positive value) */
return 0x00;
@@ -229,17 +229,17 @@ static READ8_HANDLER( syvalion_input_bypass_r )
}
}
-static void reset_sound_region(running_machine *machine)
+static void reset_sound_region(running_machine &machine)
{
- taitoh_state *state = machine->driver_data<taitoh_state>();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
memory_set_bank(machine, "bank1", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- taitoh_state *state = space->machine->driver_data<taitoh_state>();
+ taitoh_state *state = space->machine().driver_data<taitoh_state>();
state->banknum = data & 3;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
@@ -518,23 +518,23 @@ static STATE_POSTLOAD( taitoh_postload )
static MACHINE_RESET( taitoh )
{
- taitoh_state *state = machine->driver_data<taitoh_state>();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
state->banknum = 0;
}
static MACHINE_START( taitoh )
{
- taitoh_state *state = machine->driver_data<taitoh_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
- state->tc0220ioc = machine->device("tc0220ioc");
- state->tc0080vco = machine->device("tc0080vco");
+ state->audiocpu = machine.device("audiocpu");
+ state->tc0220ioc = machine.device("tc0220ioc");
+ state->tc0080vco = machine.device("tc0080vco");
state->save_item(NAME(state->banknum));
- machine->state().register_postload(taitoh_postload, NULL);
+ machine.state().register_postload(taitoh_postload, NULL);
}
diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c
index 26fa75ff95d..022aa8b3436 100644
--- a/src/mame/drivers/taito_l.c
+++ b/src/mame/drivers/taito_l.c
@@ -64,7 +64,7 @@ static const char * const bankname[] = { "bank2", "bank3", "bank4", "bank5" };
static const struct
{
- void (*notifier)(running_machine *, int);
+ void (*notifier)(running_machine &, int);
UINT32 offset;
} rambank_modify_notifiers[12] =
{
@@ -85,9 +85,9 @@ static const struct
};
-static void palette_notifier(running_machine *machine, int addr)
+static void palette_notifier(running_machine &machine, int addr)
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
UINT8 *p = state->palette_ram + (addr & ~1);
UINT8 byte0 = *p++;
UINT8 byte1 = *p;
@@ -96,7 +96,7 @@ static void palette_notifier(running_machine *machine, int addr)
if (addr > 0x200)
{
- logerror("%s:Large palette ? %03x\n", machine->describe_context(), addr);
+ logerror("%s:Large palette ? %03x\n", machine.describe_context(), addr);
}
else
{
@@ -107,9 +107,9 @@ static void palette_notifier(running_machine *machine, int addr)
static const UINT8 puzznic_mcu_reply[] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0x47, 0x05, 0x00 };
-static void state_register( running_machine *machine )
+static void state_register( running_machine &machine )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
state->save_item(NAME(state->irq_adr_table));
state->save_item(NAME(state->irq_enable));
@@ -141,10 +141,10 @@ static void state_register( running_machine *machine )
static MACHINE_START( taito_l )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->rambanks));
state->save_item(NAME(state->palette_ram));
@@ -153,9 +153,9 @@ static MACHINE_START( taito_l )
state_register(machine);
}
-static void machine_reset(running_machine *machine)
+static void machine_reset(running_machine &machine)
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int i;
for (i = 0; i < 3; i++)
@@ -172,9 +172,9 @@ static void machine_reset(running_machine *machine)
}
state->cur_rombank = state->cur_rombank2 = 0;
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000);
- gfx_element_set_source(machine->gfx[2], state->rambanks);
+ gfx_element_set_source(machine.gfx[2], state->rambanks);
state->adpcm_pos = 0;
state->adpcm_data = -1;
@@ -201,7 +201,7 @@ static void machine_reset(running_machine *machine)
static MACHINE_RESET( fhawk )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = NULL;
state->porte1_tag = NULL;
@@ -211,7 +211,7 @@ static MACHINE_RESET( fhawk )
static MACHINE_RESET( raimais )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = NULL;
state->porte1_tag = NULL;
@@ -221,7 +221,7 @@ static MACHINE_RESET( raimais )
static MACHINE_RESET( champwr )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = NULL;
state->porte1_tag = NULL;
@@ -232,7 +232,7 @@ static MACHINE_RESET( champwr )
static MACHINE_RESET( kurikint )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = NULL;
state->porte1_tag = NULL;
@@ -242,7 +242,7 @@ static MACHINE_RESET( kurikint )
static MACHINE_RESET( evilston )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = NULL;
state->porte1_tag = NULL;
@@ -252,7 +252,7 @@ static MACHINE_RESET( evilston )
static MACHINE_RESET( puzznic )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = "DSWA";
state->porte1_tag = "DSWB";
@@ -262,7 +262,7 @@ static MACHINE_RESET( puzznic )
static MACHINE_RESET( plotting )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = "DSWA";
state->porte1_tag = "DSWB";
@@ -272,7 +272,7 @@ static MACHINE_RESET( plotting )
static MACHINE_RESET( palamed )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = "DSWA";
state->porte1_tag = NULL;
@@ -282,7 +282,7 @@ static MACHINE_RESET( palamed )
static MACHINE_RESET( cachat )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = "DSWA";
state->porte1_tag = NULL;
@@ -292,7 +292,7 @@ static MACHINE_RESET( cachat )
static MACHINE_RESET( horshoes )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
machine_reset(machine);
state->porte0_tag = "DSWA";
state->porte1_tag = "DSWB";
@@ -303,13 +303,13 @@ static MACHINE_RESET( horshoes )
static IRQ_CALLBACK( irq_callback )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
return state->irq_adr_table[state->last_irq_level];
}
static INTERRUPT_GEN( vbl_interrupt )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
device_set_irq_callback(device, irq_callback);
/* kludge to make plgirls boot */
@@ -337,20 +337,20 @@ static INTERRUPT_GEN( vbl_interrupt )
static WRITE8_HANDLER( irq_adr_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
//logerror("irq_adr_table[%d] = %02x\n", offset, data);
state->irq_adr_table[offset] = data;
}
static READ8_HANDLER( irq_adr_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->irq_adr_table[offset];
}
static WRITE8_HANDLER( irq_enable_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
//logerror("irq_enable = %02x\n",data);
state->irq_enable = data;
@@ -361,14 +361,14 @@ static WRITE8_HANDLER( irq_enable_w )
static READ8_HANDLER( irq_enable_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->irq_enable;
}
static WRITE8_HANDLER( rombankswitch_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
if (state->cur_rombank != data)
{
@@ -380,13 +380,13 @@ static WRITE8_HANDLER( rombankswitch_w )
//logerror("robs %d, %02x (%04x)\n", offset, data, cpu_get_pc(space->cpu));
state->cur_rombank = data;
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x10000 + 0x2000 * state->cur_rombank);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + 0x2000 * state->cur_rombank);
}
}
static WRITE8_HANDLER( rombank2switch_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
data &= 0xf;
@@ -401,25 +401,25 @@ static WRITE8_HANDLER( rombank2switch_w )
//logerror("robs2 %02x (%04x)\n", data, cpu_get_pc(space->cpu));
state->cur_rombank2 = data;
- memory_set_bankptr(space->machine, "bank6", space->machine->region("slave")->base() + 0x10000 + 0x4000 * state->cur_rombank2);
+ memory_set_bankptr(space->machine(), "bank6", space->machine().region("slave")->base() + 0x10000 + 0x4000 * state->cur_rombank2);
}
}
static READ8_HANDLER( rombankswitch_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->cur_rombank;
}
static READ8_HANDLER( rombank2switch_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->cur_rombank2;
}
static WRITE8_HANDLER( rambankswitch_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
if (state->cur_rambank[offset] != data)
{
@@ -442,25 +442,25 @@ static WRITE8_HANDLER( rambankswitch_w )
state->current_notifier[offset] = 0;
state->current_base[offset] = state->empty_ram;
}
- memory_set_bankptr(space->machine, bankname[offset], state->current_base[offset]);
+ memory_set_bankptr(space->machine(), bankname[offset], state->current_base[offset]);
}
}
static READ8_HANDLER( rambankswitch_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->cur_rambank[offset];
}
static void bank_w(address_space *space, offs_t offset, UINT8 data, int banknum )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
if (state->current_base[banknum][offset] != data)
{
state->current_base[banknum][offset] = data;
if (state->current_notifier[banknum])
- state->current_notifier[banknum](space->machine, offset);
+ state->current_notifier[banknum](space->machine(), offset);
}
}
@@ -486,34 +486,34 @@ static WRITE8_HANDLER( bank3_w )
static WRITE8_HANDLER( control2_w )
{
- coin_lockout_w(space->machine, 0, ~data & 0x01);
- coin_lockout_w(space->machine, 1, ~data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x04);
- coin_counter_w(space->machine, 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x04);
+ coin_counter_w(space->machine(), 1, data & 0x08);
}
static READ8_DEVICE_HANDLER( portA_r )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
- return input_port_read(device->machine, (state->extport == 0) ? state->porte0_tag : state->porte1_tag);
+ taitol_state *state = device->machine().driver_data<taitol_state>();
+ return input_port_read(device->machine(), (state->extport == 0) ? state->porte0_tag : state->porte1_tag);
}
static READ8_DEVICE_HANDLER( portB_r )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
- return input_port_read(device->machine, (state->extport == 0) ? state->portf0_tag : state->portf1_tag);
+ taitol_state *state = device->machine().driver_data<taitol_state>();
+ return input_port_read(device->machine(), (state->extport == 0) ? state->portf0_tag : state->portf1_tag);
}
static READ8_DEVICE_HANDLER( extport_select_and_ym2203_r )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
state->extport = (offset >> 1) & 1;
return ym2203_r(device, offset & 1);
}
static WRITE8_HANDLER( mcu_data_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->last_data = data;
state->last_data_adr = cpu_get_pc(space->cpu);
// logerror("mcu write %02x (%04x)\n", data, cpu_get_pc(space->cpu));
@@ -533,7 +533,7 @@ static WRITE8_HANDLER( mcu_control_w )
static READ8_HANDLER( mcu_data_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
// logerror("mcu read (%04x) [%02x, %04x]\n", cpu_get_pc(space->cpu), last_data, last_data_adr);
if (state->mcu_pos == state->mcu_reply_len)
@@ -557,32 +557,32 @@ static WRITE8_HANDLER( sound_w )
static READ8_HANDLER( shared_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->shared_ram[offset];
}
static WRITE8_HANDLER( shared_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->shared_ram[offset] = data;
}
static READ8_HANDLER( mux_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
switch (state->mux_ctrl)
{
case 0:
- return input_port_read(space->machine, "DSWA");
+ return input_port_read(space->machine(), "DSWA");
case 1:
- return input_port_read(space->machine, "DSWB");
+ return input_port_read(space->machine(), "DSWB");
case 2:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 3:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 7:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
default:
logerror("Mux read from unknown port %d (%04x)\n", state->mux_ctrl, cpu_get_pc(space->cpu));
return 0xff;
@@ -591,7 +591,7 @@ static READ8_HANDLER( mux_r )
static WRITE8_HANDLER( mux_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
switch (state->mux_ctrl)
{
@@ -605,14 +605,14 @@ static WRITE8_HANDLER( mux_w )
static WRITE8_HANDLER( mux_ctrl_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->mux_ctrl = data;
}
static void champwr_msm5205_vck( device_t *device )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
if (state->adpcm_data != -1)
{
@@ -621,7 +621,7 @@ static void champwr_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@@ -629,13 +629,13 @@ static void champwr_msm5205_vck( device_t *device )
static WRITE8_HANDLER( champwr_msm5205_lo_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->adpcm_pos = (state->adpcm_pos & 0xff00ff) | (data << 8);
}
static WRITE8_HANDLER( champwr_msm5205_hi_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->adpcm_pos = ((state->adpcm_pos & 0x00ffff) | (data << 16)) & 0x1ffff;
}
@@ -646,7 +646,7 @@ static WRITE8_DEVICE_HANDLER( champwr_msm5205_start_w )
static WRITE8_DEVICE_HANDLER( champwr_msm5205_stop_w )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0x1ff00;
@@ -661,44 +661,44 @@ static WRITE8_DEVICE_HANDLER( champwr_msm5205_volume_w )
static READ8_HANDLER( horshoes_tracky_reset_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
/* reset the trackball counter */
- state->tracky = input_port_read(space->machine, "AN0");
+ state->tracky = input_port_read(space->machine(), "AN0");
return 0;
}
static READ8_HANDLER( horshoes_trackx_reset_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
/* reset the trackball counter */
- state->trackx = input_port_read(space->machine, "AN1");
+ state->trackx = input_port_read(space->machine(), "AN1");
return 0;
}
static READ8_HANDLER( horshoes_tracky_lo_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
- return (input_port_read(space->machine, "AN0") - state->tracky) & 0xff;
+ taitol_state *state = space->machine().driver_data<taitol_state>();
+ return (input_port_read(space->machine(), "AN0") - state->tracky) & 0xff;
}
static READ8_HANDLER( horshoes_tracky_hi_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
- return (input_port_read(space->machine, "AN0") - state->tracky) >> 8;
+ taitol_state *state = space->machine().driver_data<taitol_state>();
+ return (input_port_read(space->machine(), "AN0") - state->tracky) >> 8;
}
static READ8_HANDLER( horshoes_trackx_lo_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
- return (input_port_read(space->machine, "AN1") - state->trackx) & 0xff;
+ taitol_state *state = space->machine().driver_data<taitol_state>();
+ return (input_port_read(space->machine(), "AN1") - state->trackx) & 0xff;
}
static READ8_HANDLER( horshoes_trackx_hi_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
- return (input_port_read(space->machine, "AN1") - state->trackx) >> 8;
+ taitol_state *state = space->machine().driver_data<taitol_state>();
+ return (input_port_read(space->machine(), "AN1") - state->trackx) >> 8;
}
@@ -773,10 +773,10 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sound_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("audiocpu")->base();
+ UINT8 *RAM = space->machine().region("audiocpu")->base();
int banknum = (data - 1) & 3;
- memory_set_bankptr (space->machine, "bank7", &RAM [0x10000 + (banknum * 0x4000)]);
+ memory_set_bankptr (space->machine(), "bank7", &RAM [0x10000 + (banknum * 0x4000)]);
}
static ADDRESS_MAP_START( raimais_3_map, AS_PROGRAM, 8 )
@@ -928,7 +928,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER (evilston_snd_w)
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
state->shared_ram[0x7fe] = data & 0x7f;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -1940,22 +1940,22 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( portA_w )
{
- taitol_state *state = device->machine->driver_data<taitol_state>();
+ taitol_state *state = device->machine().driver_data<taitol_state>();
if (state->cur_bank != (data & 0x03))
{
int bankaddress;
- UINT8 *RAM = device->machine->region("audiocpu")->base();
+ UINT8 *RAM = device->machine().region("audiocpu")->base();
state->cur_bank = data & 0x03;
bankaddress = 0x10000 + (state->cur_bank - 1) * 0x4000;
- memory_set_bankptr(device->machine, "bank7", &RAM[bankaddress]);
+ memory_set_bankptr(device->machine(), "bank7", &RAM[bankaddress]);
//logerror ("YM2203 bank change val=%02x pc=%04x\n", state->cur_bank, cpu_get_pc(space->cpu) );
}
}
@@ -2886,7 +2886,7 @@ static DRIVER_INIT( plottinga )
v |= 1 << (7 - j);
tab[i] = v;
}
- p = machine->region("maincpu")->base();
+ p = machine.region("maincpu")->base();
for (i = 0; i < 0x20000; i++)
{
*p = tab[*p];
@@ -2896,9 +2896,9 @@ static DRIVER_INIT( plottinga )
static DRIVER_INIT( evilston )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
ROM[0x72] = 0x45; /* reti -> retn ('dead' loop @ $1104 )*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa7fe, 0xa7fe, FUNC(evilston_snd_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa7fe, 0xa7fe, FUNC(evilston_snd_w));
}
diff --git a/src/mame/drivers/taito_o.c b/src/mame/drivers/taito_o.c
index 0e365b75552..a13c09bc904 100644
--- a/src/mame/drivers/taito_o.c
+++ b/src/mame/drivers/taito_o.c
@@ -42,7 +42,7 @@ static WRITE16_HANDLER(io_w)
{
switch(offset)
{
- case 2: watchdog_reset(space->machine); break;
+ case 2: watchdog_reset(space->machine()); break;
default: logerror("IO W %x %x %x\n", offset, data, mem_mask);
}
@@ -54,8 +54,8 @@ static READ16_HANDLER(io_r)
switch(offset)
{
- case 0: retval = input_port_read(space->machine, "IN0") & (clear_hack ? 0xf7ff : 0xffff); break;
- case 1: retval = input_port_read(space->machine, "IN1") & (clear_hack ? 0xfff7 : 0xffff); break;
+ case 0: retval = input_port_read(space->machine(), "IN0") & (clear_hack ? 0xf7ff : 0xffff); break;
+ case 1: retval = input_port_read(space->machine(), "IN1") & (clear_hack ? 0xfff7 : 0xffff); break;
default: logerror("IO R %x %x = %x @ %x\n", offset, mem_mask, retval, cpu_get_pc(space->cpu));
}
return retval;
@@ -240,10 +240,10 @@ static const tc0080vco_interface parentj_intf =
static MACHINE_START( taitoo )
{
- taitoo_state *state = machine->driver_data<taitoo_state>();
+ taitoo_state *state = machine.driver_data<taitoo_state>();
- state->maincpu = machine->device("maincpu");
- state->tc0080vco = machine->device("tc0080vco");
+ state->maincpu = machine.device("maincpu");
+ state->tc0080vco = machine.device("tc0080vco");
}
static MACHINE_CONFIG_START( parentj, taitoo_state )
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 5530d188611..42ed0f5705f 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -335,13 +335,13 @@ static READ16_HANDLER( superman_dsw_input_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "DSWA") & 0x0f;
+ return input_port_read(space->machine(), "DSWA") & 0x0f;
case 0x01:
- return (input_port_read(space->machine, "DSWA") & 0xf0) >> 4;
+ return (input_port_read(space->machine(), "DSWA") & 0xf0) >> 4;
case 0x02:
- return input_port_read(space->machine, "DSWB") & 0x0f;
+ return input_port_read(space->machine(), "DSWB") & 0x0f;
case 0x03:
- return (input_port_read(space->machine, "DSWB") & 0xf0) >> 4;
+ return (input_port_read(space->machine(), "DSWB") & 0xf0) >> 4;
default:
logerror("taitox unknown dsw read offset: %04x\n", offset);
return 0x00;
@@ -353,11 +353,11 @@ static READ16_HANDLER( daisenpu_input_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "IN0"); /* Player 1 controls + START1 */
+ return input_port_read(space->machine(), "IN0"); /* Player 1 controls + START1 */
case 0x01:
- return input_port_read(space->machine, "IN1"); /* Player 2 controls + START2 */
+ return input_port_read(space->machine(), "IN1"); /* Player 2 controls + START2 */
case 0x02:
- return input_port_read(space->machine, "IN2"); /* COINn + SERVICE1 + TILT */
+ return input_port_read(space->machine(), "IN2"); /* COINn + SERVICE1 + TILT */
default:
logerror("taitox unknown input read offset: %04x\n", offset);
@@ -370,10 +370,10 @@ static WRITE16_HANDLER( daisenpu_input_w )
switch (offset)
{
case 0x04: /* coin counters and lockout */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x08);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x08);
//logerror("taitox coin control %04x to offset %04x\n",data,offset);
break;
@@ -388,10 +388,10 @@ static WRITE16_HANDLER( kyustrkr_input_w )
switch (offset)
{
case 0x04: /* coin counters and lockout */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
- coin_lockout_w(space->machine, 0,data & 0x04);
- coin_lockout_w(space->machine, 1,data & 0x08);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
+ coin_lockout_w(space->machine(), 0,data & 0x04);
+ coin_lockout_w(space->machine(), 1,data & 0x08);
//logerror("taitox coin control %04x to offset %04x\n",data,offset);
break;
@@ -403,19 +403,19 @@ static WRITE16_HANDLER( kyustrkr_input_w )
/**************************************************************************/
-static void reset_sound_region(running_machine *machine)
+static void reset_sound_region(running_machine &machine)
{
- taitox_state *state = machine->driver_data<taitox_state>();
+ taitox_state *state = machine.driver_data<taitox_state>();
- memory_set_bankptr(machine, "bank2", machine->region("audiocpu")->base() + (state->banknum * 0x4000) + 0x10000 );
+ memory_set_bankptr(machine, "bank2", machine.region("audiocpu")->base() + (state->banknum * 0x4000) + 0x10000 );
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- taitox_state *state = space->machine->driver_data<taitox_state>();
+ taitox_state *state = space->machine().driver_data<taitox_state>();
state->banknum = (data - 1) & 3;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
@@ -882,7 +882,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -902,11 +902,11 @@ static STATE_POSTLOAD( taitox_postload )
static MACHINE_START( taitox )
{
- taitox_state *state = machine->driver_data<taitox_state>();
+ taitox_state *state = machine.driver_data<taitox_state>();
state->banknum = -1;
state->save_item(NAME(state->banknum));
- machine->state().register_postload(taitox_postload, NULL);
+ machine.state().register_postload(taitox_postload, NULL);
}
static const tc0140syt_interface taitox_tc0140syt_intf =
@@ -1324,7 +1324,7 @@ ROM_END
static DRIVER_INIT( kyustrkr )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x90000f, FUNC(kyustrkr_input_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x90000f, FUNC(kyustrkr_input_w));
}
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 2ef158875c3..6d158d17835 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -890,26 +890,26 @@ J1100256A VIDEO PCB
#include "contcirc.lh"
#include "dblaxle.lh"
-static void parse_control( running_machine *machine )
+static void parse_control( running_machine &machine )
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, (state->cpua_ctrl & 0x1) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( cpua_ctrl_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if ((data & 0xff00) && ((data & 0xff) == 0))
data = data >> 8; /* for Wgp */
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
// Chase HQ: handle the lights
if (state->chasehq_lamps)
@@ -931,7 +931,7 @@ static WRITE16_HANDLER( cpua_ctrl_w )
static TIMER_CALLBACK( taitoz_interrupt6 )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
@@ -939,14 +939,14 @@ static TIMER_CALLBACK( taitoz_interrupt6 )
static TIMER_CALLBACK( taitoz_cpub_interrupt5 )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
device_set_input_line(state->subcpu, 5, HOLD_LINE);
}
#if 0
static TIMER_CALLBACK( taitoz_cpub_interrupt6 )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
device_set_input_line(state->subcpu, 6, HOLD_LINE);
}
#endif
@@ -961,11 +961,11 @@ static INTERRUPT_GEN( sci_interrupt )
causes all sprites to vanish! Spriteram has areas for 2 frames
so in theory only needs updating every other frame. */
- taitoz_state *state = device->machine->driver_data<taitoz_state>();
+ taitoz_state *state = device->machine().driver_data<taitoz_state>();
state->sci_int6 = !state->sci_int6;
if (state->sci_int6)
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -979,11 +979,11 @@ static INTERRUPT_GEN( dblaxle_interrupt )
{
// Unsure how many int6's per frame, copy SCI for now
- taitoz_state *state = device->machine->driver_data<taitoz_state>();
+ taitoz_state *state = device->machine().driver_data<taitoz_state>();
state->dblaxle_int6 = !state->dblaxle_int6;
if (state->dblaxle_int6)
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -991,7 +991,7 @@ static INTERRUPT_GEN( dblaxle_interrupt )
static INTERRUPT_GEN( dblaxle_cpub_interrupt )
{
// Unsure how many int6's per frame
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -1029,14 +1029,14 @@ static const eeprom_interface spacegun_eeprom_intf =
#if 0
static READ16_HANDLER( eep_latch_r )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
return state->eep_latch;
}
#endif
static WRITE16_HANDLER( spacegun_output_bypass_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
switch (offset)
{
@@ -1049,7 +1049,7 @@ static WRITE16_HANDLER( spacegun_output_bypass_w )
x0000000 (unused) */
COMBINE_DATA(&state->eep_latch);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
break;
default:
@@ -1066,15 +1066,15 @@ static READ8_HANDLER( contcirc_input_bypass_r )
{
/* Bypass TC0220IOC controller for analog input */
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
UINT8 port = tc0220ioc_port_r(state->tc0220ioc, 0); /* read port number */
int steer = 0;
- int fake = input_port_read(space->machine, "FAKE");
+ int fake = input_port_read(space->machine(), "FAKE");
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0xc0 */
- steer = ((input_port_read(space->machine, "STEER") - 0x80) * 0xc0) / 0x100;
+ steer = ((input_port_read(space->machine(), "STEER") - 0x80) * 0xc0) / 0x100;
}
else /* Digital steer */
@@ -1107,15 +1107,15 @@ static READ8_HANDLER( chasehq_input_bypass_r )
{
/* Bypass TC0220IOC controller for extra inputs */
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
UINT8 port = tc0220ioc_port_r(state->tc0220ioc, 0); /* read port number */
int steer = 0;
- int fake = input_port_read(space->machine, "FAKE");
+ int fake = input_port_read(space->machine(), "FAKE");
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero */
- steer = input_port_read(space->machine, "STEER") - 0x80;
+ steer = input_port_read(space->machine(), "STEER") - 0x80;
}
else /* Digital steer */
{
@@ -1132,16 +1132,16 @@ static READ8_HANDLER( chasehq_input_bypass_r )
switch (port)
{
case 0x08:
- return input_port_read(space->machine, "UNK1");
+ return input_port_read(space->machine(), "UNK1");
case 0x09:
- return input_port_read(space->machine, "UNK2");
+ return input_port_read(space->machine(), "UNK2");
case 0x0a:
- return input_port_read(space->machine, "UNK3");
+ return input_port_read(space->machine(), "UNK3");
case 0x0b:
- return input_port_read(space->machine, "UNK4");
+ return input_port_read(space->machine(), "UNK4");
case 0x0c:
return steer & 0xff;
@@ -1160,16 +1160,16 @@ static READ16_HANDLER( bshark_stick_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "STICKX");
+ return input_port_read(space->machine(), "STICKX");
case 0x01:
- return input_port_read(space->machine, "X_ADJUST");
+ return input_port_read(space->machine(), "X_ADJUST");
case 0x02:
- return input_port_read(space->machine, "STICKY");
+ return input_port_read(space->machine(), "STICKY");
case 0x03:
- return input_port_read(space->machine, "Y_ADJUST");
+ return input_port_read(space->machine(), "Y_ADJUST");
}
logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(space->cpu), offset);
@@ -1183,16 +1183,16 @@ static READ16_HANDLER( nightstr_stick_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "STICKX");
+ return input_port_read(space->machine(), "STICKX");
case 0x01:
- return input_port_read(space->machine, "STICKY");
+ return input_port_read(space->machine(), "STICKY");
case 0x02:
- return input_port_read(space->machine, "X_ADJUST");
+ return input_port_read(space->machine(), "X_ADJUST");
case 0x03:
- return input_port_read(space->machine, "Y_ADJUST");
+ return input_port_read(space->machine(), "Y_ADJUST");
}
logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(space->cpu), offset);
@@ -1208,19 +1208,19 @@ static WRITE16_HANDLER( bshark_stick_w )
but we don't want CPUA to have an int6 before int4 is over (?)
*/
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(taitoz_interrupt6));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(taitoz_interrupt6));
}
static READ16_HANDLER( sci_steer_input_r )
{
int steer = 0;
- int fake = input_port_read(space->machine, "FAKE");
+ int fake = input_port_read(space->machine(), "FAKE");
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0xc0 */
- steer = ((input_port_read(space->machine, "STEER") - 0x80) * 0xc0) / 0x100;
+ steer = ((input_port_read(space->machine(), "STEER") - 0x80) * 0xc0) / 0x100;
}
else /* Digital steer */
{
@@ -1251,7 +1251,7 @@ static READ16_HANDLER( sci_steer_input_r )
static READ16_HANDLER( spacegun_input_bypass_r )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
switch (offset)
{
@@ -1268,16 +1268,16 @@ static READ16_HANDLER( spacegun_lightgun_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "STICKX1");
+ return input_port_read(space->machine(), "STICKX1");
case 0x01:
- return input_port_read(space->machine, "STICKY1");
+ return input_port_read(space->machine(), "STICKY1");
case 0x02:
- return input_port_read(space->machine, "STICKX2");
+ return input_port_read(space->machine(), "STICKX2");
case 0x03:
- return input_port_read(space->machine, "STICKY2");
+ return input_port_read(space->machine(), "STICKY2");
}
return 0x00;
@@ -1293,7 +1293,7 @@ static WRITE16_HANDLER( spacegun_lightgun_w )
Four lightgun interrupts happen before the collected coords
are moved to shared ram where CPUA can use them. */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(taitoz_cpub_interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(taitoz_cpub_interrupt5));
}
static WRITE16_HANDLER( spacegun_gun_output_w )
@@ -1306,12 +1306,12 @@ static WRITE16_HANDLER( spacegun_gun_output_w )
static READ16_HANDLER( dblaxle_steer_input_r )
{
int steer = 0;
- int fake = input_port_read(space->machine, "FAKE");
+ int fake = input_port_read(space->machine(), "FAKE");
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* center around zero and reduce span to 0x80 */
- steer = ((input_port_read(space->machine, "STEER") - 0x80) * 0x80) / 0x100;
+ steer = ((input_port_read(space->machine(), "STEER") - 0x80) * 0x80) / 0x100;
}
else /* Digital steer */
{
@@ -1345,7 +1345,7 @@ static READ16_HANDLER( chasehq_motor_r )
switch (offset)
{
case 0x0:
- return (space->machine->rand() &0xff); /* motor status ?? */
+ return (space->machine().rand() &0xff); /* motor status ?? */
case 0x101:
return 0x55; /* motor cpu status ? */
@@ -1420,23 +1420,23 @@ static READ16_HANDLER( aquajack_unknown_r )
SOUND
*****************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static WRITE16_HANDLER( taitoz_sound_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, data & 0xff);
@@ -1456,7 +1456,7 @@ static WRITE16_HANDLER( taitoz_sound_w )
static READ16_HANDLER( taitoz_sound_r )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if (offset == 1)
return (tc0140syt_comm_r(state->tc0140syt, 0) & 0xff);
@@ -1467,7 +1467,7 @@ static READ16_HANDLER( taitoz_sound_r )
#if 0
static WRITE16_HANDLER( taitoz_msb_sound_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, (data >> 8) & 0xff);
@@ -1487,7 +1487,7 @@ static WRITE16_HANDLER( taitoz_msb_sound_w )
static READ16_HANDLER( taitoz_msb_sound_r )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff) << 8);
@@ -1500,7 +1500,7 @@ static READ16_HANDLER( taitoz_msb_sound_r )
/**** sound pan control ****/
static WRITE8_HANDLER( taitoz_pancontrol )
{
-// taitoz_state *state = space->machine->driver_data<taitoz_state>();
+// taitoz_state *state = space->machine().driver_data<taitoz_state>();
static const char *const fltname[] = { "2610.1.r", "2610.1.l", "2610.2.r", "2610.2.l" };
offset = offset & 3;
@@ -1508,7 +1508,7 @@ static WRITE8_HANDLER( taitoz_pancontrol )
// state->pandata[offset] = data;
// popmessage(" pan %02x %02x %02x %02x", state->pandata[0], state->pandata[1], state->pandata[2], state->pandata[3] );
- flt_volume_set_volume(space->machine->device(fltname[offset & 3]), data / 255.0f);
+ flt_volume_set_volume(space->machine().device(fltname[offset & 3]), data / 255.0f);
}
static WRITE16_HANDLER( spacegun_pancontrol )
@@ -2804,7 +2804,7 @@ Interface B is for games which lack a Z80 (Spacegun, Bshark).
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- taitoz_state *state = device->machine->driver_data<taitoz_state>();
+ taitoz_state *state = device->machine().driver_data<taitoz_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2812,7 +2812,7 @@ static void irqhandler(device_t *device, int irq)
static void irqhandlerb(device_t *device, int irq)
{
// DG: this is probably specific to Z80 and wrong?
-// taitoz_state *state = device->machine->driver_data<taitoz_state>();
+// taitoz_state *state = device->machine().driver_data<taitoz_state>();
// device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2966,17 +2966,17 @@ static STATE_POSTLOAD( taitoz_postload )
static MACHINE_START( bshark )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
-
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
- state->eeprom = machine->device("eeprom");
- state->tc0100scn = machine->device("tc0100scn");
- state->tc0150rod = machine->device("tc0150rod");
- state->tc0480scp = machine->device("tc0480scp");
- state->tc0220ioc = machine->device("tc0220ioc");
- state->tc0140syt = machine->device("tc0140syt");
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
+ state->eeprom = machine.device("eeprom");
+ state->tc0100scn = machine.device("tc0100scn");
+ state->tc0150rod = machine.device("tc0150rod");
+ state->tc0480scp = machine.device("tc0480scp");
+ state->tc0220ioc = machine.device("tc0220ioc");
+ state->tc0140syt = machine.device("tc0140syt");
state->save_item(NAME(state->cpua_ctrl));
@@ -2990,18 +2990,18 @@ static MACHINE_START( bshark )
static MACHINE_START( taitoz )
{
- int banks = (machine->region("audiocpu")->bytes() - 0xc000) / 0x4000;
+ int banks = (machine.region("audiocpu")->bytes() - 0xc000) / 0x4000;
- memory_configure_bank(machine, "bank10", 0, banks, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, banks, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- machine->state().register_postload(taitoz_postload, NULL);
+ machine.state().register_postload(taitoz_postload, NULL);
MACHINE_START_CALL(bshark);
}
static MACHINE_RESET( taitoz )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->banknum = -1;
state->cpua_ctrl = 0xff;
@@ -4864,14 +4864,14 @@ ROM_END
static DRIVER_INIT( taitoz )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->chasehq_lamps = 0;
state->dblaxle_vibration = 0;
}
static DRIVER_INIT( dblaxle )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->chasehq_lamps = 0;
state->dblaxle_vibration = 1;
}
@@ -4883,18 +4883,18 @@ static STATE_POSTLOAD( bshark_postload )
static DRIVER_INIT( bshark )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->chasehq_lamps = 0;
state->dblaxle_vibration = 0;
state->eep_latch = 0;
- machine->state().register_postload(bshark_postload, NULL);
+ machine.state().register_postload(bshark_postload, NULL);
state->save_item(NAME(state->eep_latch));
}
static DRIVER_INIT( chasehq )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->chasehq_lamps = 1;
state->dblaxle_vibration = 0;
}
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index 352a36d0a9b..1c6ecc6ccd3 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -232,7 +232,7 @@ cpu #2 (PC=0000060E): unmapped memory word read from 0000683A & FFFF
static WRITE16_HANDLER( system_control_w )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
if ((ACCESSING_BITS_0_7 == 0) && ACCESSING_BITS_8_15)
data >>= 8;
@@ -246,13 +246,13 @@ static WRITE16_HANDLER( system_control_w )
static READ16_HANDLER( lineram_r )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
return state->line_ram[offset];
}
static WRITE16_HANDLER( lineram_w )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
state->line_ram[offset] = data;
@@ -260,13 +260,13 @@ static WRITE16_HANDLER( lineram_w )
static READ16_HANDLER( dspram_r )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
return state->dsp_ram[offset];
}
static WRITE16_HANDLER( dspram_w )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
state->dsp_ram[offset] = data;
@@ -274,7 +274,7 @@ static WRITE16_HANDLER( dspram_w )
static READ16_HANDLER( dsp_HOLD_signal_r )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
/* HOLD signal is active low */
// logerror("TMS32025:%04x Reading %01x level from HOLD signal\n", cpu_get_previouspc(space->cpu), state->dsp_hold_signal);
@@ -291,13 +291,13 @@ static WRITE16_HANDLER( dsp_HOLDA_signal_w )
static WRITE16_HANDLER( airsys_paletteram16_w ) /* xxBBBBxRRRRxGGGG */
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
int a;
COMBINE_DATA(&state->paletteram[offset]);
a = state->paletteram[offset];
- palette_set_color_rgb(space->machine, offset, pal4bit(a >> 0), pal4bit(a >> 5), pal4bit(a >> 10));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(a >> 0), pal4bit(a >> 5), pal4bit(a >> 10));
}
@@ -314,16 +314,16 @@ static READ16_HANDLER( stick_input_r )
switch( offset )
{
case 0x00: /* "counter 1" lo */
- return input_port_read(space->machine, STICK1_PORT_TAG);
+ return input_port_read(space->machine(), STICK1_PORT_TAG);
case 0x01: /* "counter 2" lo */
- return input_port_read(space->machine, STICK2_PORT_TAG);
+ return input_port_read(space->machine(), STICK2_PORT_TAG);
case 0x02: /* "counter 1" hi */
- return (input_port_read(space->machine, STICK1_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(space->machine(), STICK1_PORT_TAG) & 0xff00) >> 8;
case 0x03: /* "counter 2" hi */
- return (input_port_read(space->machine, STICK2_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(space->machine(), STICK2_PORT_TAG) & 0xff00) >> 8;
}
return 0;
@@ -334,10 +334,10 @@ static READ16_HANDLER( stick2_input_r )
switch( offset )
{
case 0x00: /* "counter 3" lo */
- return input_port_read(space->machine, STICK3_PORT_TAG);
+ return input_port_read(space->machine(), STICK3_PORT_TAG);
case 0x02: /* "counter 3" hi */
- return (input_port_read(space->machine, STICK3_PORT_TAG) & 0xff00) >> 8;
+ return (input_port_read(space->machine(), STICK3_PORT_TAG) & 0xff00) >> 8;
}
return 0;
@@ -345,18 +345,18 @@ static READ16_HANDLER( stick2_input_r )
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- taitoair_state *state = machine->driver_data<taitoair_state>();
+ taitoair_state *state = machine.driver_data<taitoair_state>();
memory_set_bank(machine, "bank1", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- taitoair_state *state = space->machine->driver_data<taitoair_state>();
+ taitoair_state *state = space->machine().driver_data<taitoair_state>();
state->banknum = data & 3;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
@@ -571,7 +571,7 @@ GFXDECODE_END
/* Handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- taitoair_state *state = device->machine->driver_data<taitoair_state>();
+ taitoair_state *state = device->machine().driver_data<taitoair_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -610,15 +610,15 @@ static STATE_POSTLOAD( taitoair_postload )
static MACHINE_START( taitoair )
{
- taitoair_state *state = machine->driver_data<taitoair_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ taitoair_state *state = machine.driver_data<taitoair_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
int i;
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
- state->dsp = machine->device("dsp");
- state->tc0080vco = machine->device("tc0080vco");
+ state->audiocpu = machine.device("audiocpu");
+ state->dsp = machine.device("dsp");
+ state->tc0080vco = machine.device("tc0080vco");
state->save_item(NAME(state->banknum));
state->save_item(NAME(state->q.col));
@@ -630,12 +630,12 @@ static MACHINE_START( taitoair )
state_save_register_item(machine, "globals", NULL, i, state->q.p[i].y);
}
- machine->state().register_postload(taitoair_postload, NULL);
+ machine.state().register_postload(taitoair_postload, NULL);
}
static MACHINE_RESET( taitoair )
{
- taitoair_state *state = machine->driver_data<taitoair_state>();
+ taitoair_state *state = machine.driver_data<taitoair_state>();
int i;
state->dsp_hold_signal = ASSERT_LINE;
diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c
index 811c40c05bf..ebf0b56aded 100644
--- a/src/mame/drivers/taitogn.c
+++ b/src/mame/drivers/taitogn.c
@@ -359,10 +359,10 @@ public:
// rf5c296 is very inaccurate at that point, it hardcodes the gnet config
-static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8 data)
+static void rf5c296_reg_w(ATTR_UNUSED running_machine &machine, UINT8 reg, UINT8 data)
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
- // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, machine->describe_context());
+ taitogn_state *state = machine.driver_data<taitogn_state>();
+ // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, machine.describe_context());
switch (reg)
{
// Interrupt and General Control Register
@@ -372,7 +372,7 @@ static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8
{
devtag_reset(machine, "card");
state->locked = 0x1ff;
- ide_set_gnet_readlock (machine->device("card"), 1);
+ ide_set_gnet_readlock (machine.device("card"), 1);
}
break;
@@ -381,18 +381,18 @@ static void rf5c296_reg_w(ATTR_UNUSED running_machine *machine, UINT8 reg, UINT8
}
}
-static UINT8 rf5c296_reg_r(ATTR_UNUSED running_machine *machine, UINT8 reg)
+static UINT8 rf5c296_reg_r(ATTR_UNUSED running_machine &machine, UINT8 reg)
{
- // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, machine->describe_context());
+ // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, machine.describe_context());
return 0x00;
}
static WRITE32_HANDLER(rf5c296_io_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
if(offset < 2) {
- ide_controller32_pcmcia_w(space->machine->device("card"), offset, data, mem_mask);
+ ide_controller32_pcmcia_w(space->machine().device("card"), offset, data, mem_mask);
return;
}
@@ -400,16 +400,16 @@ static WRITE32_HANDLER(rf5c296_io_w)
if(ACCESSING_BITS_0_7)
state->rf5c296_reg = data;
if(ACCESSING_BITS_8_15)
- rf5c296_reg_w(space->machine, state->rf5c296_reg, data >> 8);
+ rf5c296_reg_w(space->machine(), state->rf5c296_reg, data >> 8);
}
}
static READ32_HANDLER(rf5c296_io_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
if(offset < 2)
- return ide_controller32_pcmcia_r(space->machine->device("card"), offset, mem_mask);
+ return ide_controller32_pcmcia_r(space->machine().device("card"), offset, mem_mask);
offset *= 4;
@@ -418,7 +418,7 @@ static READ32_HANDLER(rf5c296_io_r)
if(ACCESSING_BITS_0_7)
res |= state->rf5c296_reg;
if(ACCESSING_BITS_8_15)
- res |= rf5c296_reg_r(space->machine, state->rf5c296_reg) << 8;
+ res |= rf5c296_reg_r(space->machine(), state->rf5c296_reg) << 8;
return res;
}
@@ -429,7 +429,7 @@ static READ32_HANDLER(rf5c296_io_r)
static READ32_HANDLER(rf5c296_mem_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
if(offset < 0x80)
return (state->cis[offset*2+1] << 16) | state->cis[offset*2];
@@ -445,7 +445,7 @@ static READ32_HANDLER(rf5c296_mem_r)
static WRITE32_HANDLER(rf5c296_mem_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
if(offset >= 0x140 && offset <= 0x144) {
UINT8 key[5];
@@ -456,14 +456,14 @@ static WRITE32_HANDLER(rf5c296_mem_w)
pos++;
} else
v = data;
- chd_get_metadata(get_disk_handle(space->machine, "card"), HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0);
+ chd_get_metadata(get_disk_handle(space->machine(), "card"), HARD_DISK_KEY_METADATA_TAG, 0, key, 5, 0, 0, 0);
k = pos < 5 ? key[pos] : 0;
if(v == k)
state->locked &= ~(1 << pos);
else
state->locked |= 1 << pos;
if (!state->locked) {
- ide_set_gnet_readlock (space->machine->device("card"), 0);
+ ide_set_gnet_readlock (space->machine().device("card"), 0);
}
}
}
@@ -494,77 +494,77 @@ static void gen_flash_w(intelfsh16_device *device, offs_t offset, UINT32 data, U
static READ32_HANDLER(flash_subbios_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return gen_flash_r(state->biosflash, offset, mem_mask);
}
static WRITE32_HANDLER(flash_subbios_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
gen_flash_w(state->biosflash, offset, data, mem_mask);
}
static READ32_HANDLER(flash_mn102_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return gen_flash_r(state->pgmflash, offset, mem_mask);
}
static WRITE32_HANDLER(flash_mn102_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
gen_flash_w(state->pgmflash, offset, data, mem_mask);
}
static READ32_HANDLER(flash_s1_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return gen_flash_r(state->sndflash[0], offset, mem_mask);
}
static WRITE32_HANDLER(flash_s1_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
gen_flash_w(state->sndflash[0], offset, data, mem_mask);
}
static READ32_HANDLER(flash_s2_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return gen_flash_r(state->sndflash[1], offset, mem_mask);
}
static WRITE32_HANDLER(flash_s2_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
gen_flash_w(state->sndflash[1], offset, data, mem_mask);
}
static READ32_HANDLER(flash_s3_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return gen_flash_r(state->sndflash[2], offset, mem_mask);
}
static WRITE32_HANDLER(flash_s3_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
gen_flash_w(state->sndflash[2], offset, data, mem_mask);
}
-static void install_handlers(running_machine *machine, int mode)
+static void install_handlers(running_machine &machine, int mode)
{
- address_space *a = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *a = machine.device("maincpu")->memory().space(AS_PROGRAM);
if(mode == 0) {
// Mode 0 has access to the subbios, the mn102 flash and the rf5c296 mem zone
a->install_legacy_readwrite_handler(0x1f000000, 0x1f1fffff, FUNC(flash_subbios_r), FUNC(flash_subbios_w));
@@ -584,15 +584,15 @@ static void install_handlers(running_machine *machine, int mode)
static READ32_HANDLER(control_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
- // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, space->machine->describe_context());
+ // fprintf(stderr, "gn_r %08x @ %08x (%s)\n", 0x1fb00000+4*offset, mem_mask, space->machine().describe_context());
return state->control;
}
static WRITE32_HANDLER(control_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
// 20 = watchdog
// 04 = select bank
@@ -601,7 +601,7 @@ static WRITE32_HANDLER(control_w)
// selection too, but they're always 0.
UINT32 p = state->control;
- device_t *mb3773 = space->machine->device("mb3773");
+ device_t *mb3773 = space->machine().device("mb3773");
COMBINE_DATA(&state->control);
@@ -617,30 +617,30 @@ static WRITE32_HANDLER(control_w)
control & 0x04 ? 'f' : '-',
control & 0x02 ? '1' : '0',
control & 0x01 ? '1' : '0',
- space->machine->describe_context());
+ space->machine().describe_context());
#endif
if((p ^ state->control) & 0x04)
- install_handlers(space->machine, state->control & 4 ? 1 : 0);
+ install_handlers(space->machine(), state->control & 4 ? 1 : 0);
}
static WRITE32_HANDLER(control2_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
COMBINE_DATA(&state->control2);
}
static READ32_HANDLER(control3_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return state->control3;
}
static WRITE32_HANDLER(control3_w)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
COMBINE_DATA(&state->control3);
}
@@ -665,7 +665,7 @@ static WRITE32_HANDLER(gn_1fb70000_w)
static READ32_HANDLER(hack1_r)
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
state->v = state->v ^ 8;
// Probably something to do with sound
@@ -681,14 +681,14 @@ static const UINT8 tt16[ 8 ] = { 0xc0, 0x04, 0xf9, 0xe1, 0x60, 0x70, 0xf2, 0x02
static READ32_HANDLER( znsecsel_r )
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return state->m_n_znsecsel;
}
-static void sio_znsec0_handler( running_machine *machine, int n_data )
+static void sio_znsec0_handler( running_machine &machine, int n_data )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -702,9 +702,9 @@ static void sio_znsec0_handler( running_machine *machine, int n_data )
}
}
-static void sio_znsec1_handler( running_machine *machine, int n_data )
+static void sio_znsec1_handler( running_machine &machine, int n_data )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -718,9 +718,9 @@ static void sio_znsec1_handler( running_machine *machine, int n_data )
}
}
-static void sio_pad_handler( running_machine *machine, int n_data )
+static void sio_pad_handler( running_machine &machine, int n_data )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
if( ( n_data & PSX_SIO_OUT_DTR ) != 0 )
{
@@ -734,9 +734,9 @@ static void sio_pad_handler( running_machine *machine, int n_data )
psx_sio_input( machine, 0, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR );
}
-static void sio_dip_handler( running_machine *machine, int n_data )
+static void sio_dip_handler( running_machine &machine, int n_data )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -757,34 +757,34 @@ static void sio_dip_handler( running_machine *machine, int n_data )
static WRITE32_HANDLER( znsecsel_w )
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
COMBINE_DATA( &state->m_n_znsecsel );
if( ( state->m_n_znsecsel & 0x80 ) == 0 )
{
- psx_sio_install_handler( space->machine, 0, sio_pad_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_pad_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else if( ( state->m_n_znsecsel & 0x08 ) == 0 )
{
znsec_start( 1 );
- psx_sio_install_handler( space->machine, 0, sio_znsec1_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_znsec1_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else if( ( state->m_n_znsecsel & 0x04 ) == 0 )
{
znsec_start( 0 );
- psx_sio_install_handler( space->machine, 0, sio_znsec0_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_znsec0_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else
{
state->m_n_dip_bit = 0;
state->m_b_lastclock = 1;
- psx_sio_install_handler( space->machine, 0, sio_dip_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_dip_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
state->dip_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 );
}
@@ -792,13 +792,13 @@ static WRITE32_HANDLER( znsecsel_w )
static TIMER_CALLBACK( dip_timer_fired )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
psx_sio_input( machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
if( param )
{
- state->dip_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(50));
+ state->dip_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(50));
}
}
@@ -830,7 +830,7 @@ static READ32_HANDLER( boardconfig_r )
static WRITE32_HANDLER( coin_w )
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
/* 0x01=counter
0x02=coin lock 1
@@ -843,7 +843,7 @@ static WRITE32_HANDLER( coin_w )
static READ32_HANDLER( coin_r )
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
return state->coin_info;
}
@@ -851,40 +851,40 @@ static READ32_HANDLER( coin_r )
/* mahjong panel handler (for Usagi & Mahjong Oh) */
static READ32_HANDLER( gnet_mahjong_panel_r )
{
- taitogn_state *state = space->machine->driver_data<taitogn_state>();
+ taitogn_state *state = space->machine().driver_data<taitogn_state>();
state->mux_data = state->coin_info;
state->mux_data &= 0xcc;
switch(state->mux_data)
{
- case 0x04: return input_port_read(space->machine, "KEY0");
- case 0x08: return input_port_read(space->machine, "KEY1");
- case 0x40: return input_port_read(space->machine, "KEY2");
- case 0x80: return input_port_read(space->machine, "KEY3");
+ case 0x04: return input_port_read(space->machine(), "KEY0");
+ case 0x08: return input_port_read(space->machine(), "KEY1");
+ case 0x40: return input_port_read(space->machine(), "KEY2");
+ case 0x80: return input_port_read(space->machine(), "KEY3");
}
/* mux disabled */
- return input_port_read(space->machine, "P4");
+ return input_port_read(space->machine(), "P4");
}
// Init and reset
static DRIVER_INIT( coh3002t )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
- state->biosflash = machine->device<intel_te28f160_device>("biosflash");
- state->pgmflash = machine->device<intel_e28f400_device>("pgmflash");
- state->sndflash[0] = machine->device<intel_te28f160_device>("sndflash0");
- state->sndflash[1] = machine->device<intel_te28f160_device>("sndflash1");
- state->sndflash[2] = machine->device<intel_te28f160_device>("sndflash2");
+ state->biosflash = machine.device<intel_te28f160_device>("biosflash");
+ state->pgmflash = machine.device<intel_e28f400_device>("pgmflash");
+ state->sndflash[0] = machine.device<intel_te28f160_device>("sndflash0");
+ state->sndflash[1] = machine.device<intel_te28f160_device>("sndflash1");
+ state->sndflash[2] = machine.device<intel_te28f160_device>("sndflash2");
psx_driver_init(machine);
znsec_init(0, tt10);
znsec_init(1, tt16);
psx_sio_install_handler(machine, 0, sio_pad_handler);
- state->dip_timer = machine->scheduler().timer_alloc( FUNC(dip_timer_fired), NULL );
+ state->dip_timer = machine.scheduler().timer_alloc( FUNC(dip_timer_fired), NULL );
memset(state->cis, 0xff, 512);
if (get_disk_handle(machine, "card") != NULL)
@@ -894,12 +894,12 @@ static DRIVER_INIT( coh3002t )
static DRIVER_INIT( coh3002t_mp )
{
DRIVER_INIT_CALL(coh3002t);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1fa10100, 0x1fa10103, FUNC(gnet_mahjong_panel_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1fa10100, 0x1fa10103, FUNC(gnet_mahjong_panel_r) );
}
static MACHINE_RESET( coh3002t )
{
- taitogn_state *state = machine->driver_data<taitogn_state>();
+ taitogn_state *state = machine.driver_data<taitogn_state>();
state->m_b_lastclock = 1;
state->locked = 0x1ff;
@@ -907,7 +907,7 @@ static MACHINE_RESET( coh3002t )
state->control = 0;
psx_machine_init(machine);
devtag_reset(machine, "card");
- ide_set_gnet_readlock(machine->device("card"), 1);
+ ide_set_gnet_readlock(machine.device("card"), 1);
// halt sound CPU since it has no valid program at start
cputag_set_input_line(machine, "mn10200",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */
@@ -962,7 +962,7 @@ static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c
index 8711ab6278e..371dfccbde8 100644
--- a/src/mame/drivers/taitojc.c
+++ b/src/mame/drivers/taitojc.c
@@ -362,14 +362,14 @@ Notes:
static READ32_HANDLER( taitojc_palette_r )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->palette_ram[offset];
}
static WRITE32_HANDLER( taitojc_palette_w )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
int r, g, b;
UINT32 color;
@@ -380,7 +380,7 @@ static WRITE32_HANDLER( taitojc_palette_w )
g = (color >> 16) & 0xff;
b = (color >> 0) & 0xff;
- palette_set_color(space->machine,offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(),offset, MAKE_RGB(r, g, b));
}
static READ32_HANDLER ( jc_control_r )
@@ -393,7 +393,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= ((input_port_read(space->machine, "COINS") & 0x2) << 2) << 24;
+ r |= ((input_port_read(space->machine(), "COINS") & 0x2) << 2) << 24;
}
return r;
}
@@ -401,7 +401,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "COINS") << 24;
+ r |= input_port_read(space->machine(), "COINS") << 24;
}
return r;
}
@@ -409,7 +409,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "START") << 24;
+ r |= input_port_read(space->machine(), "START") << 24;
}
return r;
}
@@ -417,7 +417,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "UNUSED") << 24;
+ r |= input_port_read(space->machine(), "UNUSED") << 24;
}
return r;
}
@@ -425,7 +425,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- //r |= (space->machine->rand() & 0xff) << 24;
+ //r |= (space->machine().rand() & 0xff) << 24;
}
return r;
}
@@ -433,7 +433,7 @@ static READ32_HANDLER ( jc_control_r )
{
if (ACCESSING_BITS_24_31)
{
- r |= input_port_read(space->machine, "BUTTONS") << 24;
+ r |= input_port_read(space->machine(), "BUTTONS") << 24;
}
return r;
}
@@ -455,7 +455,7 @@ static WRITE32_HANDLER ( jc_control_w )
{
if (ACCESSING_BITS_24_31)
{
- input_port_write(space->machine, "EEPROMOUT", data >> 24, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data >> 24, 0xff);
}
return;
}
@@ -478,7 +478,7 @@ static WRITE32_HANDLER (jc_control1_w)
static UINT8 mcu_comm_reg_r(address_space *space, int reg)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
UINT8 r = 0;
switch (reg)
@@ -505,7 +505,7 @@ static UINT8 mcu_comm_reg_r(address_space *space, int reg)
static void mcu_comm_reg_w(address_space *space, int reg, UINT8 data)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
switch (reg)
{
@@ -582,7 +582,7 @@ static READ32_HANDLER(jc_unknown1_r)
static READ32_HANDLER(dsp_shared_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->dsp_shared_ram[offset] << 16;
}
@@ -594,7 +594,7 @@ static READ32_HANDLER(dsp_shared_r)
static void debug_dsp_command(void)
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
UINT16 *cmd = &dsp_shared_ram[0x7f0];
switch (cmd[0])
@@ -723,7 +723,7 @@ static void debug_dsp_command(void)
static WRITE32_HANDLER(dsp_shared_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
//mame_printf_debug("dsp_shared_ram: %08X, %04X at %08X\n", offset, data >> 16, cpu_get_pc(space->cpu));
if (ACCESSING_BITS_24_31)
@@ -750,20 +750,20 @@ static WRITE32_HANDLER(dsp_shared_w)
{
if (!state->first_dsp_reset)
{
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, CLEAR_LINE);
}
state->first_dsp_reset = 0;
}
else
{
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, ASSERT_LINE);
}
}
}
static READ32_HANDLER(f3_share_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
switch (offset & 3)
{
case 0: return (state->f3_shared_ram[(offset/4)] << 0) & 0xff000000;
@@ -777,7 +777,7 @@ static READ32_HANDLER(f3_share_r)
static WRITE32_HANDLER(f3_share_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
UINT32 d = (data >> 24) & 0xff;
switch (offset & 3)
@@ -824,7 +824,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(hc11_comm_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->mcu_comm_hc11;
}
@@ -835,7 +835,7 @@ static WRITE8_HANDLER(hc11_comm_w)
static READ8_HANDLER(hc11_data_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->mcu_comm_hc11 |= 0x04;
state->mcu_comm_main |= 0x20;
@@ -844,7 +844,7 @@ static READ8_HANDLER(hc11_data_r)
static WRITE8_HANDLER(hc11_data_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->mcu_data_main = data;
}
@@ -854,7 +854,7 @@ static READ8_HANDLER(hc11_analog_r)
static const char *const portnames[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4",
"ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" };
- return input_port_read_safe(space->machine, portnames[offset], 0);
+ return input_port_read_safe(space->machine(), portnames[offset], 0);
}
@@ -875,8 +875,8 @@ ADDRESS_MAP_END
static READ16_HANDLER( dsp_rom_r )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
- UINT16 *rom = (UINT16*)space->machine->region("gfx2")->base();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
+ UINT16 *rom = (UINT16*)space->machine().region("gfx2")->base();
UINT16 data = rom[state->dsp_rom_pos++];
//mame_printf_debug("dsp_rom_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(space->cpu));
@@ -885,7 +885,7 @@ static READ16_HANDLER( dsp_rom_r )
static WRITE16_HANDLER( dsp_rom_w )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
if (offset == 0)
{
@@ -901,7 +901,7 @@ static WRITE16_HANDLER( dsp_rom_w )
static WRITE16_HANDLER( dsp_texture_w )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
int index;
int x, y;
//mame_printf_debug("texture write %08X, %04X\n", dsp_addr1, data);
@@ -920,14 +920,14 @@ static WRITE16_HANDLER( dsp_texture_w )
static READ16_HANDLER( dsp_texaddr_r )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->dsp_tex_address;
}
static WRITE16_HANDLER( dsp_texaddr_w )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->dsp_tex_address = data;
// mame_printf_debug("texaddr = %08X at %08X\n", data, cpu_get_pc(space->cpu));
@@ -940,7 +940,7 @@ static WRITE16_HANDLER( dsp_texaddr_w )
static WRITE16_HANDLER( dsp_polygon_fifo_w )
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->polygon_fifo[state->polygon_fifo_ptr++] = data;
if (state->polygon_fifo_ptr >= POLYGON_FIFO_SIZE)
@@ -958,14 +958,14 @@ static READ16_HANDLER(dsp_unk_r)
static WRITE16_HANDLER(dsp_viewport_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->viewport_data[offset] = (INT16)(data);
}
static WRITE16_HANDLER(dsp_projection_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->projection_data[offset] = (INT16)(data);
@@ -986,7 +986,7 @@ static WRITE16_HANDLER(dsp_projection_w)
static READ16_HANDLER(dsp_projection_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
if (offset == 0)
{
@@ -1002,12 +1002,12 @@ static READ16_HANDLER(dsp_projection_r)
static WRITE16_HANDLER(dsp_unk2_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
if (offset == 0)
{
- taitojc_clear_frame(space->machine);
- taitojc_render_polygons(space->machine, state->polygon_fifo, state->polygon_fifo_ptr);
+ taitojc_clear_frame(space->machine());
+ taitojc_render_polygons(space->machine(), state->polygon_fifo, state->polygon_fifo_ptr);
state->polygon_fifo_ptr = 0;
}
@@ -1015,14 +1015,14 @@ static WRITE16_HANDLER(dsp_unk2_w)
static WRITE16_HANDLER(dsp_intersection_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
state->intersection_data[offset] = (INT32)(INT16)(data);
}
static READ16_HANDLER(dsp_intersection_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return (INT16)((state->intersection_data[0] * state->intersection_data[1]) / state->intersection_data[2]);
}
@@ -1269,7 +1269,7 @@ INPUT_PORTS_END
static MACHINE_RESET( taitojc )
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
state->first_dsp_reset = 1;
@@ -1352,7 +1352,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( taitojc )
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
state->polygon_fifo = auto_alloc_array(machine, UINT16, POLYGON_FIFO_SIZE);
}
diff --git a/src/mame/drivers/taitosj.c b/src/mame/drivers/taitosj.c
index 973d0659c30..e006b3c04b8 100644
--- a/src/mame/drivers/taitosj.c
+++ b/src/mame/drivers/taitosj.c
@@ -173,27 +173,27 @@ TODO:
static WRITE8_DEVICE_HANDLER( taitosj_sndnmi_msk_w )
{
- taitosj_state *state = device->machine->driver_data<taitosj_state>();
+ taitosj_state *state = device->machine().driver_data<taitosj_state>();
state->sndnmi_disable = data & 0x01;
}
static WRITE8_HANDLER( taitosj_soundcommand_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
soundlatch_w(space,offset,data);
- if (!state->sndnmi_disable) cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ if (!state->sndnmi_disable) cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( input_port_4_f0_w )
{
- taitosj_state *state = device->machine->driver_data<taitosj_state>();
+ taitosj_state *state = device->machine().driver_data<taitosj_state>();
state->input_port_4_f0 = data >> 4;
}
static CUSTOM_INPUT( input_port_4_f0_r )
{
- taitosj_state *state = field->port->machine->driver_data<taitosj_state>();
+ taitosj_state *state = field->port->machine().driver_data<taitosj_state>();
return state->input_port_4_f0;
}
@@ -282,7 +282,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( kikstart_gear_r )
{
- taitosj_state *state = field->port->machine->driver_data<taitosj_state>();
+ taitosj_state *state = field->port->machine().driver_data<taitosj_state>();
const char *port_tag;
int player = (int)(FPTR)param;
@@ -293,9 +293,9 @@ static CUSTOM_INPUT( kikstart_gear_r )
port_tag = "GEARP2";
/* gear MUST be 1, 2 or 3 */
- if (input_port_read(field->port->machine, port_tag) & 0x01) state->kikstart_gears[player] = 0x02;
- if (input_port_read(field->port->machine, port_tag) & 0x02) state->kikstart_gears[player] = 0x03;
- if (input_port_read(field->port->machine, port_tag) & 0x04) state->kikstart_gears[player] = 0x01;
+ if (input_port_read(field->port->machine(), port_tag) & 0x01) state->kikstart_gears[player] = 0x02;
+ if (input_port_read(field->port->machine(), port_tag) & 0x02) state->kikstart_gears[player] = 0x03;
+ if (input_port_read(field->port->machine(), port_tag) & 0x04) state->kikstart_gears[player] = 0x01;
return state->kikstart_gears[player];
}
@@ -1736,14 +1736,14 @@ static const UINT8 voltable[256] =
static WRITE8_DEVICE_HANDLER( dac_out_w )
{
- taitosj_state *state = device->machine->driver_data<taitosj_state>();
+ taitosj_state *state = device->machine().driver_data<taitosj_state>();
state->dac_out = data - 0x80;
dac_signed_data_16_w(device,state->dac_out * state->dac_vol + 0x8000);
}
static WRITE8_DEVICE_HANDLER( dac_vol_w )
{
- taitosj_state *state = device->machine->driver_data<taitosj_state>();
+ taitosj_state *state = device->machine().driver_data<taitosj_state>();
state->dac_vol = voltable[data];
dac_signed_data_16_w(device,state->dac_out * state->dac_vol + 0x8000);
}
@@ -2720,16 +2720,16 @@ static void reset_common(running_machine &machine)
state->dac_vol = 0;
}
-static void init_common(running_machine *machine)
+static void init_common(running_machine &machine)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
state->save_item(NAME(state->sndnmi_disable));
state->save_item(NAME(state->input_port_4_f0));
state->save_item(NAME(state->kikstart_gears));
state->save_item(NAME(state->dac_out));
state->save_item(NAME(state->dac_vol));
- machine->add_notifier(MACHINE_NOTIFY_RESET, reset_common);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, reset_common);
}
static DRIVER_INIT( taitosj )
@@ -2742,7 +2742,7 @@ static DRIVER_INIT( spacecr )
init_common(machine);
/* install protection handler */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd48b, 0xd48b, FUNC(spacecr_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd48b, 0xd48b, FUNC(spacecr_prot_r));
}
static DRIVER_INIT( alpine )
@@ -2750,8 +2750,8 @@ static DRIVER_INIT( alpine )
init_common(machine);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd40b, 0xd40b, FUNC(alpine_port_2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd50f, 0xd50f, FUNC(alpine_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd40b, 0xd40b, FUNC(alpine_port_2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd50f, 0xd50f, FUNC(alpine_protection_w));
}
static DRIVER_INIT( alpinea )
@@ -2759,8 +2759,8 @@ static DRIVER_INIT( alpinea )
init_common(machine);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd40b, 0xd40b, FUNC(alpine_port_2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd50e, 0xd50e, FUNC(alpinea_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd40b, 0xd40b, FUNC(alpine_port_2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd50e, 0xd50e, FUNC(alpinea_bankswitch_w));
}
static DRIVER_INIT( junglhbr )
@@ -2768,7 +2768,7 @@ static DRIVER_INIT( junglhbr )
init_common(machine);
/* inverter on bits 0 and 1 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9000, 0xbfff, FUNC(junglhbr_characterram_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x9000, 0xbfff, FUNC(junglhbr_characterram_w));
}
GAME( 1981, spaceskr, 0, nomcu, spaceskr, taitosj, ROT0, "Taito Corporation", "Space Seeker", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 8ad2c26e21d..afbcc6ef327 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -83,9 +83,9 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele
static SCREEN_UPDATE(taitowlf)
{
- taitowlf_state *state = screen->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = screen->machine().driver_data<taitowlf_state>();
int i, j;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
UINT32 *cga = state->cga_ram;
int index = 0;
@@ -134,7 +134,7 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>();
// mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
return state->mxtc_config_reg[reg];
@@ -142,8 +142,8 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function,
static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>();
-// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>();
+// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
switch(reg)
{
@@ -151,11 +151,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- memory_set_bankptr(busdevice->machine, "bank1", state->bios_ram);
+ memory_set_bankptr(busdevice->machine(), "bank1", state->bios_ram);
}
else // disable RAM access (reads go to BIOS ROM)
{
- memory_set_bankptr(busdevice->machine, "bank1", busdevice->machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(busdevice->machine(), "bank1", busdevice->machine().region("user1")->base() + 0x30000);
}
break;
}
@@ -164,9 +164,9 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
state->mxtc_config_reg[reg] = data;
}
-static void intel82439tx_init(running_machine *machine)
+static void intel82439tx_init(running_machine &machine)
{
- taitowlf_state *state = machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = machine.driver_data<taitowlf_state>();
state->mxtc_config_reg[0x60] = 0x02;
state->mxtc_config_reg[0x61] = 0x02;
state->mxtc_config_reg[0x62] = 0x02;
@@ -221,15 +221,15 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>();
// mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
return state->piix4_config_reg[function][reg];
}
static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- taitowlf_state *state = busdevice->machine->driver_data<taitowlf_state>();
-// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ taitowlf_state *state = busdevice->machine().driver_data<taitowlf_state>();
+// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
state->piix4_config_reg[function][reg] = data;
}
@@ -319,7 +319,7 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static WRITE32_HANDLER(bios_ram_w)
{
- taitowlf_state *state = space->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = space->machine().driver_data<taitowlf_state>();
if (state->mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
COMBINE_DATA(state->bios_ram + offset);
@@ -337,7 +337,7 @@ static WRITE32_HANDLER(bios_ram_w)
static READ8_HANDLER(at_page8_r)
{
- taitowlf_state *state = space->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = space->machine().driver_data<taitowlf_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8)
@@ -361,7 +361,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- taitowlf_state *state = space->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = space->machine().driver_data<taitowlf_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -384,7 +384,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -393,7 +393,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- taitowlf_state *state = space->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = space->machine().driver_data<taitowlf_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -403,7 +403,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- taitowlf_state *state = space->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = space->machine().driver_data<taitowlf_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -413,25 +413,25 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static WRITE_LINE_DEVICE_HANDLER( pc_dack0_w )
{
- taitowlf_state *drvstate = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = device->machine().driver_data<taitowlf_state>();
if (state) drvstate->dma_channel = 0;
}
static WRITE_LINE_DEVICE_HANDLER( pc_dack1_w )
{
- taitowlf_state *drvstate = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = device->machine().driver_data<taitowlf_state>();
if (state) drvstate->dma_channel = 1;
}
static WRITE_LINE_DEVICE_HANDLER( pc_dack2_w )
{
- taitowlf_state *drvstate = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = device->machine().driver_data<taitowlf_state>();
if (state) drvstate->dma_channel = 2;
}
static WRITE_LINE_DEVICE_HANDLER( pc_dack3_w )
{
- taitowlf_state *drvstate = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = device->machine().driver_data<taitowlf_state>();
if (state) drvstate->dma_channel = 3;
}
@@ -561,7 +561,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- taitowlf_state *state = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = device->machine().driver_data<taitowlf_state>();
int r = pic8259_acknowledge( state->pic8259_2);
if (r==0)
{
@@ -572,19 +572,19 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(taitowlf)
{
- taitowlf_state *state = machine->driver_data<taitowlf_state>();
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ taitowlf_state *state = machine.driver_data<taitowlf_state>();
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
- state->pit8254 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ state->pit8254 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
static MACHINE_RESET(taitowlf)
{
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0x30000);
}
@@ -596,7 +596,7 @@ static MACHINE_RESET(taitowlf)
static WRITE_LINE_DEVICE_HANDLER( taitowlf_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface taitowlf_pic8259_1_config =
@@ -672,26 +672,26 @@ static MACHINE_CONFIG_START( taitowlf, taitowlf_state )
MCFG_VIDEO_START(taitowlf)
MACHINE_CONFIG_END
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- taitowlf_state *drvstate = machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = machine.driver_data<taitowlf_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static void ide_interrupt(device_t *device, int state)
{
- taitowlf_state *drvstate = device->machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = device->machine().driver_data<taitowlf_state>();
pic8259_ir6_w(drvstate->pic8259_2, state);
}
-static int taitowlf_get_out2(running_machine *machine)
+static int taitowlf_get_out2(running_machine &machine)
{
- taitowlf_state *state = machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = machine.driver_data<taitowlf_state>();
return pit8253_get_output(state->pit8254, 2 );
}
@@ -700,15 +700,15 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, taitowlf_get_out2
};
-static void taitowlf_set_keyb_int(running_machine *machine, int state)
+static void taitowlf_set_keyb_int(running_machine &machine, int state)
{
- taitowlf_state *drvstate = machine->driver_data<taitowlf_state>();
+ taitowlf_state *drvstate = machine.driver_data<taitowlf_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static DRIVER_INIT( taitowlf )
{
- taitowlf_state *state = machine->driver_data<taitowlf_state>();
+ taitowlf_state *state = machine.driver_data<taitowlf_state>();
state->bios_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, taitowlf_set_keyb_int);
diff --git a/src/mame/drivers/tank8.c b/src/mame/drivers/tank8.c
index 2e60c25bb77..097b1ab87b5 100644
--- a/src/mame/drivers/tank8.c
+++ b/src/mame/drivers/tank8.c
@@ -11,9 +11,9 @@ Atari Tank 8 driver
-void tank8_set_collision(running_machine *machine, int index)
+void tank8_set_collision(running_machine &machine, int index)
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
state->collision_index = index;
@@ -22,29 +22,29 @@ void tank8_set_collision(running_machine *machine, int index)
static MACHINE_RESET( tank8 )
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
state->collision_index = 0;
}
static READ8_HANDLER( tank8_collision_r )
{
- tank8_state *state = space->machine->driver_data<tank8_state>();
+ tank8_state *state = space->machine().driver_data<tank8_state>();
return state->collision_index;
}
static WRITE8_HANDLER( tank8_lockout_w )
{
- coin_lockout_w(space->machine, offset, ~data & 1);
+ coin_lockout_w(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( tank8_int_reset_w )
{
- tank8_state *state = space->machine->driver_data<tank8_state>();
+ tank8_state *state = space->machine().driver_data<tank8_state>();
state->collision_index &= ~0x3f;
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( tank8_crash_w )
@@ -467,10 +467,10 @@ ROM_END
static DRIVER_INIT( decode )
{
- const UINT8* DECODE = machine->region("user1")->base();
+ const UINT8* DECODE = machine.region("user1")->base();
- UINT8* p1 = machine->region("maincpu")->base() + 0x00000;
- UINT8* p2 = machine->region("maincpu")->base() + 0x10000;
+ UINT8* p1 = machine.region("maincpu")->base() + 0x00000;
+ UINT8* p2 = machine.region("maincpu")->base() + 0x10000;
int i;
diff --git a/src/mame/drivers/tankbatt.c b/src/mame/drivers/tankbatt.c
index 687ac3448c7..7ca87548181 100644
--- a/src/mame/drivers/tankbatt.c
+++ b/src/mame/drivers/tankbatt.c
@@ -64,14 +64,14 @@ Known issues:
static WRITE8_HANDLER( tankbatt_led_w )
{
- set_led_status(space->machine, offset,data & 1);
+ set_led_status(space->machine(), offset,data & 1);
}
static READ8_HANDLER( tankbatt_in0_r )
{
int val;
- val = input_port_read(space->machine, "P1");
+ val = input_port_read(space->machine(), "P1");
return ((val << (7 - offset)) & 0x80);
}
@@ -79,7 +79,7 @@ static READ8_HANDLER( tankbatt_in1_r )
{
int val;
- val = input_port_read(space->machine, "P2");
+ val = input_port_read(space->machine(), "P2");
return ((val << (7 - offset)) & 0x80);
}
@@ -87,42 +87,42 @@ static READ8_HANDLER( tankbatt_dsw_r )
{
int val;
- val = input_port_read(space->machine, "DSW");
+ val = input_port_read(space->machine(), "DSW");
return ((val << (7 - offset)) & 0x80);
}
static WRITE8_HANDLER( tankbatt_interrupt_enable_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
state->nmi_enable = !data;
state->sound_enable = !data;
/* hack - turn off the engine noise if the normal game nmi's are disabled */
- if (data) sample_stop (space->machine->device("samples"), 2);
+ if (data) sample_stop (space->machine().device("samples"), 2);
// interrupt_enable_w (offset, !data);
}
static WRITE8_HANDLER( tankbatt_demo_interrupt_enable_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
state->nmi_enable = data;
// interrupt_enable_w (offset, data);
}
static WRITE8_HANDLER( tankbatt_sh_expl_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
if (state->sound_enable)
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
sample_start (samples, 1, 3, 0);
}
}
static WRITE8_HANDLER( tankbatt_sh_engine_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
- device_t *samples = space->machine->device("samples");
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
+ device_t *samples = space->machine().device("samples");
if (state->sound_enable)
{
if (data)
@@ -135,10 +135,10 @@ static WRITE8_HANDLER( tankbatt_sh_engine_w )
static WRITE8_HANDLER( tankbatt_sh_fire_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
if (state->sound_enable)
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
sample_start (samples, 0, 0, 0);
}
}
@@ -146,19 +146,19 @@ static WRITE8_HANDLER( tankbatt_sh_fire_w )
static WRITE8_HANDLER( tankbatt_irq_ack_w )
{
/* 0x6e written at the end of the irq routine, could be either irq ack or a coin sample */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( tankbatt_coin_counter_w )
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 1);
}
static WRITE8_HANDLER( tankbatt_coin_lockout_w )
{
- coin_lockout_w(space->machine, 0,data & 1);
- coin_lockout_w(space->machine, 1,data & 1);
+ coin_lockout_w(space->machine(), 0,data & 1);
+ coin_lockout_w(space->machine(), 1,data & 1);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -188,13 +188,13 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( tankbatt_interrupt )
{
- tankbatt_state *state = device->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = device->machine().driver_data<tankbatt_state>();
if (state->nmi_enable) device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
{
- cputag_set_input_line(field->port->machine, "maincpu", 0, ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", 0, ASSERT_LINE);
}
static INPUT_PORTS_START( tankbatt )
diff --git a/src/mame/drivers/tankbust.c b/src/mame/drivers/tankbust.c
index 82099010c13..36ef9707f6e 100644
--- a/src/mame/drivers/tankbust.c
+++ b/src/mame/drivers/tankbust.c
@@ -26,25 +26,25 @@ To do:
static TIMER_CALLBACK( soundlatch_callback )
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
state->latch = param;
}
static WRITE8_HANDLER( tankbust_soundlatch_w )
{
- space->machine->scheduler().synchronize(FUNC(soundlatch_callback), data);
+ space->machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
}
static READ8_DEVICE_HANDLER( tankbust_soundlatch_r )
{
- tankbust_state *state = device->machine->driver_data<tankbust_state>();
+ tankbust_state *state = device->machine().driver_data<tankbust_state>();
return state->latch;
}
//port B of ay8910#0
static READ8_DEVICE_HANDLER( tankbust_soundtimer_r )
{
- tankbust_state *state = device->machine->driver_data<tankbust_state>();
+ tankbust_state *state = device->machine().driver_data<tankbust_state>();
int ret;
state->timer1++;
@@ -64,7 +64,7 @@ static TIMER_CALLBACK( soundirqline_callback )
static WRITE8_HANDLER( tankbust_e0xx_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
state->e0xx_data[offset] = data;
#if 0
@@ -82,11 +82,11 @@ static WRITE8_HANDLER( tankbust_e0xx_w )
break;
case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_w */
- space->machine->scheduler().synchronize(FUNC(soundirqline_callback), data);
+ space->machine().scheduler().synchronize(FUNC(soundirqline_callback), data);
break;
case 2: /* 0xe002 coin counter */
- coin_counter_w(space->machine, 0, data&1);
+ coin_counter_w(space->machine(), 0, data&1);
break;
case 6: /* 0xe006 screen disable ?? or disable screen update */
@@ -100,15 +100,15 @@ static WRITE8_HANDLER( tankbust_e0xx_w )
case 7: /* 0xe007 bankswitch */
/* bank 1 at 0x6000-9fff = from 0x10000 when bit0=0 else from 0x14000 */
/* bank 2 at 0xa000-bfff = from 0x18000 when bit0=0 else from 0x1a000 */
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
- memory_set_bankptr(space->machine, "bank2", space->machine->region("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + ((data&1) * 0x4000) );
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region("maincpu")->base() + 0x18000 + ((data&1) * 0x2000) ); /* verified (the game will reset after the "game over" otherwise) */
break;
}
}
static READ8_HANDLER( debug_output_area_r )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
return state->e0xx_data[offset];
}
@@ -174,7 +174,7 @@ static READ8_HANDLER( read_from_unmapped_memory )
static READ8_HANDLER( some_changing_input )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
state->variable_data += 8;
return state->variable_data;
}
@@ -320,7 +320,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_RESET( tankbust )
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
state->variable_data = 0x11;
}
diff --git a/src/mame/drivers/taotaido.c b/src/mame/drivers/taotaido.c
index 45ca2b3e6ca..570390db8c4 100644
--- a/src/mame/drivers/taotaido.c
+++ b/src/mame/drivers/taotaido.c
@@ -74,19 +74,19 @@ zooming might be wrong
static READ16_HANDLER( pending_command_r )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
/* Only bit 0 is tested */
return state->pending_command;
}
static WRITE16_HANDLER( sound_command_w )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
@@ -120,15 +120,15 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( pending_command_clear_w )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( taotaido_sh_bankswitch_w )
{
- UINT8 *rom = space->machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("audiocpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1",rom + (data & 0x03) * 0x8000);
+ memory_set_bankptr(space->machine(), "bank1",rom + (data & 0x03) * 0x8000);
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
@@ -324,7 +324,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
diff --git a/src/mame/drivers/targeth.c b/src/mame/drivers/targeth.c
index d5c94209d2c..ea5f5f7baf7 100644
--- a/src/mame/drivers/targeth.c
+++ b/src/mame/drivers/targeth.c
@@ -47,7 +47,7 @@ static INTERRUPT_GEN(targeth_interrupt )
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
@@ -56,7 +56,7 @@ static WRITE16_HANDLER( OKIM6295_bankswitch_w )
static WRITE16_HANDLER( targeth_coin_counter_w )
{
- coin_counter_w( space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w( space->machine(), (offset >> 3) & 0x01, data & 0x01);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c
index 50b3a3107f5..2b3faa59583 100644
--- a/src/mame/drivers/tatsumi.c
+++ b/src/mame/drivers/tatsumi.c
@@ -157,56 +157,56 @@
static READ16_HANDLER(cyclwarr_cpu_bb_r)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
return state->cyclwarr_cpub_ram[offset];
}
static WRITE16_HANDLER(cyclwarr_cpu_bb_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->cyclwarr_cpub_ram[offset]);
}
-static READ16_HANDLER(cyclwarr_palette_r) { return space->machine->generic.paletteram.u16[offset]; }
+static READ16_HANDLER(cyclwarr_palette_r) { return space->machine().generic.paletteram.u16[offset]; }
static READ16_HANDLER(cyclwarr_sprite_r) {
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>(); return state->spriteram[offset]; }
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>(); return state->spriteram[offset]; }
static WRITE16_HANDLER(cyclwarr_sprite_w) {
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>(); COMBINE_DATA(&state->spriteram[offset]); }
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>(); COMBINE_DATA(&state->spriteram[offset]); }
static WRITE16_HANDLER(bigfight_a20000_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->bigfight_a20000[offset]);
}
static WRITE16_HANDLER(bigfight_a40000_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->bigfight_a40000[offset]);
}
static WRITE16_HANDLER(bigfight_a60000_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->bigfight_a60000[offset]);
}
static READ16_HANDLER(cyclwarr_input_r)
{
static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
- return input_port_read(space->machine, port[offset]);
+ return input_port_read(space->machine(), port[offset]);
}
static READ16_HANDLER(cyclwarr_input2_r)
{
static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
- return input_port_read(space->machine, port2[offset]);
+ return input_port_read(space->machine(), port2[offset]);
}
static WRITE16_HANDLER(cyclwarr_sound_w)
{
soundlatch_w(space, 0, data >> 8);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
/***************************************************************************/
@@ -847,7 +847,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_IRQ0, state);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_IRQ0, state);
}
static const ym2151_interface ym2151_config =
@@ -862,7 +862,7 @@ static INTERRUPT_GEN( roundup5_interrupt )
static void apache3_68000_reset(device_t *device)
{
- cputag_set_input_line(device->machine, "sub2", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "sub2", INPUT_LINE_RESET, PULSE_LINE);
}
static MACHINE_RESET( apache3 )
@@ -870,7 +870,7 @@ static MACHINE_RESET( apache3 )
cputag_set_input_line(machine, "sub2", INPUT_LINE_RESET, ASSERT_LINE); // TODO
/* Hook the RESET line, which resets the Z80 */
- m68k_set_reset_callback(machine->device("sub"), apache3_68000_reset);
+ m68k_set_reset_callback(machine.device("sub"), apache3_68000_reset);
}
@@ -1293,10 +1293,10 @@ ROM_END
static DRIVER_INIT( apache3 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
- UINT8 *dst = machine->region("gfx1")->base();
- UINT8 *src1 = machine->region("gfx2")->base();
- UINT8 *src2 = machine->region("gfx3")->base();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
+ UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src1 = machine.region("gfx2")->base();
+ UINT8 *src2 = machine.region("gfx3")->base();
int i;
for (i=0; i<0x100000; i+=32) {
@@ -1309,10 +1309,10 @@ static DRIVER_INIT( apache3 )
}
// Copy sprite & palette data out of GFX rom area
- state->rom_sprite_lookup1 = machine->region("gfx2")->base();
- state->rom_sprite_lookup2 = machine->region("gfx3")->base();
- state->rom_clut0 = machine->region("gfx2")->base()+ 0x100000 - 0x800;
- state->rom_clut1 = machine->region("gfx3")->base()+ 0x100000 - 0x800;
+ state->rom_sprite_lookup1 = machine.region("gfx2")->base();
+ state->rom_sprite_lookup2 = machine.region("gfx3")->base();
+ state->rom_clut0 = machine.region("gfx2")->base()+ 0x100000 - 0x800;
+ state->rom_clut1 = machine.region("gfx3")->base()+ 0x100000 - 0x800;
tatsumi_reset(machine);
@@ -1321,10 +1321,10 @@ static DRIVER_INIT( apache3 )
static DRIVER_INIT( roundup5 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
- UINT8 *dst = machine->region("gfx1")->base();
- UINT8 *src1 = machine->region("gfx2")->base();
- UINT8 *src2 = machine->region("gfx3")->base();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
+ UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src1 = machine.region("gfx2")->base();
+ UINT8 *src2 = machine.region("gfx3")->base();
int i;
for (i=0; i<0xc0000; i+=32) {
@@ -1337,22 +1337,22 @@ static DRIVER_INIT( roundup5 )
}
// Copy sprite & palette data out of GFX rom area
- state->rom_sprite_lookup1 = machine->region("gfx2")->base();
- state->rom_sprite_lookup2 = machine->region("gfx3")->base();
- state->rom_clut0 = machine->region("gfx2")->base()+ 0xc0000 - 0x800;
- state->rom_clut1 = machine->region("gfx3")->base()+ 0xc0000 - 0x800;
+ state->rom_sprite_lookup1 = machine.region("gfx2")->base();
+ state->rom_sprite_lookup2 = machine.region("gfx3")->base();
+ state->rom_clut0 = machine.region("gfx2")->base()+ 0xc0000 - 0x800;
+ state->rom_clut1 = machine.region("gfx3")->base()+ 0xc0000 - 0x800;
tatsumi_reset(machine);
}
static DRIVER_INIT( cyclwarr )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
- UINT8 *dst = machine->region("gfx1")->base();
- UINT8 *src1 = machine->region("gfx2")->base();
- int len1 = machine->region("gfx2")->bytes();
- UINT8 *src2 = machine->region("gfx3")->base();
- int len2 = machine->region("gfx3")->bytes();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
+ UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src1 = machine.region("gfx2")->base();
+ int len1 = machine.region("gfx2")->bytes();
+ UINT8 *src2 = machine.region("gfx3")->base();
+ int len2 = machine.region("gfx3")->bytes();
int i;
for (i=0; i<len1; i+=32) {
memcpy(dst,src1,32);
@@ -1363,19 +1363,19 @@ static DRIVER_INIT( cyclwarr )
src2+=32;
}
- dst = machine->region("maincpu")->base();
+ dst = machine.region("maincpu")->base();
memcpy(state->cyclwarr_cpua_ram,dst,8);
memory_set_bankptr(machine, "bank1", dst);
- dst = machine->region("sub")->base();
+ dst = machine.region("sub")->base();
memcpy(state->cyclwarr_cpub_ram,dst,8);
memory_set_bankptr(machine, "bank2", dst);
// Copy sprite & palette data out of GFX rom area
- state->rom_sprite_lookup1 = machine->region("gfx2")->base();
- state->rom_sprite_lookup2 = machine->region("gfx3")->base();
- state->rom_clut0 = machine->region("gfx2")->base() + len1 - 0x1000;
- state->rom_clut1 = machine->region("gfx3")->base() + len2 - 0x1000;
+ state->rom_sprite_lookup1 = machine.region("gfx2")->base();
+ state->rom_sprite_lookup2 = machine.region("gfx3")->base();
+ state->rom_clut0 = machine.region("gfx2")->base() + len1 - 0x1000;
+ state->rom_clut1 = machine.region("gfx3")->base() + len2 - 0x1000;
tatsumi_reset(machine);
}
diff --git a/src/mame/drivers/tattack.c b/src/mame/drivers/tattack.c
index d04208e4baa..fc19559feb1 100644
--- a/src/mame/drivers/tattack.c
+++ b/src/mame/drivers/tattack.c
@@ -37,7 +37,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- tattack_state *state = machine->driver_data<tattack_state>();
+ tattack_state *state = machine.driver_data<tattack_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@@ -55,7 +55,7 @@ static TILE_GET_INFO( get_tile_info )
static SCREEN_UPDATE( tattack )
{
- tattack_state *state = screen->machine->driver_data<tattack_state>();
+ tattack_state *state = screen->machine().driver_data<tattack_state>();
tilemap_mark_all_tiles_dirty(state->tmap);
tilemap_draw(bitmap,cliprect,state->tmap, 0,0);
return 0;
@@ -63,7 +63,7 @@ static SCREEN_UPDATE( tattack )
static VIDEO_START( tattack )
{
- tattack_state *state = machine->driver_data<tattack_state>();
+ tattack_state *state = machine.driver_data<tattack_state>();
state->tmap = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,32,32 );
}
@@ -237,7 +237,7 @@ ROM_END
static DRIVER_INIT(tattack)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x1b4]=0;
rom[0x1b5]=0;
diff --git a/src/mame/drivers/taxidrvr.c b/src/mame/drivers/taxidrvr.c
index 7279ec70301..20e0ec70650 100644
--- a/src/mame/drivers/taxidrvr.c
+++ b/src/mame/drivers/taxidrvr.c
@@ -25,70 +25,70 @@ static WRITE8_DEVICE_HANDLER( p4c_w ) { taxidrvr_spritectrl_w(device,8,data); }
static READ8_DEVICE_HANDLER( p0a_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
return state->latchA;
}
static READ8_DEVICE_HANDLER( p0c_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
return (state->s1 << 7);
}
static WRITE8_DEVICE_HANDLER( p0b_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->latchB = data;
}
static WRITE8_DEVICE_HANDLER( p0c_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->s2 = data & 1;
state->bghide = data & 2;
/* bit 2 toggles during gameplay */
- flip_screen_set(device->machine, data & 8);
+ flip_screen_set(device->machine(), data & 8);
// popmessage("%02x",data&0x0f);
}
static READ8_DEVICE_HANDLER( p1b_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
return state->latchB;
}
static READ8_DEVICE_HANDLER( p1c_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
- return (state->s2 << 7) | (state->s4 << 6) | ((input_port_read(device->machine, "SERVCOIN") & 1) << 4);
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
+ return (state->s2 << 7) | (state->s4 << 6) | ((input_port_read(device->machine(), "SERVCOIN") & 1) << 4);
}
static WRITE8_DEVICE_HANDLER( p1a_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->latchA = data;
}
static WRITE8_DEVICE_HANDLER( p1c_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->s1 = data & 1;
state->s3 = (data & 2) >> 1;
}
static READ8_DEVICE_HANDLER( p8910_0a_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
return state->latchA;
}
static READ8_DEVICE_HANDLER( p8910_1a_r )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
return state->s3;
}
@@ -96,7 +96,7 @@ static READ8_DEVICE_HANDLER( p8910_1a_r )
original, since it works anyway even if the communication is flawed. */
static WRITE8_DEVICE_HANDLER( p8910_0b_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->s4 = data & 1;
}
diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c
index 5be037de665..e234abc5e00 100644
--- a/src/mame/drivers/tbowl.c
+++ b/src/mame/drivers/tbowl.c
@@ -22,7 +22,7 @@ Might be some priority glitches
static WRITE8_HANDLER( tbowl_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
/*** Banking
@@ -34,23 +34,23 @@ note: check this, its borrowed from tecmo.c / wc90.c at the moment and could wel
static WRITE8_HANDLER( tbowlb_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
static WRITE8_HANDLER( tbowlc_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("sub")->base();
+ UINT8 *RAM = space->machine().region("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
- memory_set_bankptr(space->machine, "bank2", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank2", &RAM[bankaddress]);
}
/*** Shared Ram Handlers
@@ -59,20 +59,20 @@ static WRITE8_HANDLER( tbowlc_bankswitch_w )
static READ8_HANDLER( shared_r )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
return state->shared_ram[offset];
}
static WRITE8_HANDLER( shared_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->shared_ram[offset] = data;
}
static WRITE8_HANDLER( tbowl_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -125,7 +125,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER ( tbowl_trigger_nmi )
{
/* trigger NMI on 6206B's Cpu? (guess but seems to work..) */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( 6206C_map, AS_PROGRAM, 8 )
@@ -147,30 +147,30 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tbowl_adpcm_start_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
- device_t *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1");
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
+ device_t *adpcm = space->machine().device((offset & 1) ? "msm2" : "msm1");
state->adpcm_pos[offset & 1] = data << 8;
msm5205_reset_w(adpcm,0);
}
static WRITE8_HANDLER( tbowl_adpcm_end_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->adpcm_end[offset & 1] = (data + 1) << 8;
}
static WRITE8_HANDLER( tbowl_adpcm_vol_w )
{
- device_t *adpcm = space->machine->device((offset & 1) ? "msm2" : "msm1");
+ device_t *adpcm = space->machine().device((offset & 1) ? "msm2" : "msm1");
msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f);
}
static void tbowl_adpcm_int(device_t *device)
{
- tbowl_state *state = device->machine->driver_data<tbowl_state>();
+ tbowl_state *state = device->machine().driver_data<tbowl_state>();
int num = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
if (state->adpcm_pos[num] >= state->adpcm_end[num] ||
- state->adpcm_pos[num] >= device->machine->region("adpcm")->bytes()/2)
+ state->adpcm_pos[num] >= device->machine().region("adpcm")->bytes()/2)
msm5205_reset_w(device,1);
else if (state->adpcm_data[num] != -1)
{
@@ -179,7 +179,7 @@ static void tbowl_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base() + 0x10000 * num;
+ UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * num;
state->adpcm_data[num] = ROM[state->adpcm_pos[num]++];
msm5205_data_w(device,state->adpcm_data[num] >> 4);
@@ -431,7 +431,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
@@ -459,7 +459,7 @@ The game is displayed on 2 monitors
static MACHINE_RESET( tbowl )
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
state->adpcm_end[0] = state->adpcm_end[1] = 0;
state->adpcm_data[0] = state->adpcm_data[1] = -1;
diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c
index 0c28ec59f78..31c1c0867aa 100644
--- a/src/mame/drivers/tceptor.c
+++ b/src/mame/drivers/tceptor.c
@@ -25,13 +25,13 @@
static READ16_HANDLER( m68k_shared_word_r )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
return state->m68k_shared_ram[offset];
}
static WRITE16_HANDLER( m68k_shared_word_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
if (ACCESSING_BITS_0_7)
state->m68k_shared_ram[offset] = data & 0xff;
}
@@ -41,7 +41,7 @@ static WRITE16_HANDLER( m68k_shared_word_w )
static INTERRUPT_GEN( m6809_vb_interrupt )
{
- tceptor_state *state = device->machine->driver_data<tceptor_state>();
+ tceptor_state *state = device->machine().driver_data<tceptor_state>();
if (state->m6809_irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
else
@@ -50,34 +50,34 @@ static INTERRUPT_GEN( m6809_vb_interrupt )
static WRITE8_HANDLER( m6809_irq_enable_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->m6809_irq_enable = 1;
}
static WRITE8_HANDLER( m6809_irq_disable_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->m6809_irq_enable = 0;
}
static INTERRUPT_GEN( m68k_vb_interrupt )
{
- tceptor_state *state = device->machine->driver_data<tceptor_state>();
+ tceptor_state *state = device->machine().driver_data<tceptor_state>();
if (state->m68k_irq_enable)
device_set_input_line(device, M68K_IRQ_1, HOLD_LINE);
}
static WRITE16_HANDLER( m68k_irq_enable_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->m68k_irq_enable = data;
}
static INTERRUPT_GEN( mcu_vb_interrupt )
{
- tceptor_state *state = device->machine->driver_data<tceptor_state>();
+ tceptor_state *state = device->machine().driver_data<tceptor_state>();
if (state->mcu_irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
else
@@ -86,13 +86,13 @@ static INTERRUPT_GEN( mcu_vb_interrupt )
static WRITE8_HANDLER( mcu_irq_enable_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->mcu_irq_enable = 1;
}
static WRITE8_HANDLER( mcu_irq_disable_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->mcu_irq_enable = 0;
}
@@ -138,22 +138,22 @@ static UINT8 fix_input1(UINT8 in1, UINT8 in2)
static READ8_HANDLER( dsw0_r )
{
- return fix_input0(input_port_read(space->machine, "DSW1"), input_port_read(space->machine, "DSW2"));
+ return fix_input0(input_port_read(space->machine(), "DSW1"), input_port_read(space->machine(), "DSW2"));
}
static READ8_HANDLER( dsw1_r )
{
- return fix_input1(input_port_read(space->machine, "DSW1"), input_port_read(space->machine, "DSW2"));
+ return fix_input1(input_port_read(space->machine(), "DSW1"), input_port_read(space->machine(), "DSW2"));
}
static READ8_HANDLER( input0_r )
{
- return fix_input0(input_port_read(space->machine, "BUTTONS"), input_port_read(space->machine, "SERVICE"));
+ return fix_input0(input_port_read(space->machine(), "BUTTONS"), input_port_read(space->machine(), "SERVICE"));
}
static READ8_HANDLER( input1_r )
{
- return fix_input1(input_port_read(space->machine, "BUTTONS"), input_port_read(space->machine, "SERVICE"));
+ return fix_input1(input_port_read(space->machine(), "BUTTONS"), input_port_read(space->machine(), "SERVICE"));
}
static READ8_HANDLER( readFF )
@@ -348,7 +348,7 @@ static const namco_interface namco_config =
static MACHINE_START( tceptor )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
state_save_register_global(machine, state->m6809_irq_enable);
state_save_register_global(machine, state->m68k_irq_enable);
state_save_register_global(machine, state->mcu_irq_enable);
@@ -359,7 +359,7 @@ static MACHINE_START( tceptor )
static MACHINE_RESET( tceptor )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
state->m6809_irq_enable = 0;
state->m68k_irq_enable = 0;
state->mcu_irq_enable = 0;
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index 30c00ecb8ad..efb1c73f82a 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -189,9 +189,9 @@ static DRIVER_INIT(tcl)
{
/* only the first part is decrypted (and verified)*/
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *dest = machine->region("maincpu")->base();
- int len = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *dest = machine.region("maincpu")->base();
+ int len = machine.region("maincpu")->bytes();
UINT8 *src = auto_alloc_array(machine, UINT8, len);
int i,idx=0;
diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c
index 6e7496e562f..b98fcca4e00 100644
--- a/src/mame/drivers/tecmo.c
+++ b/src/mame/drivers/tecmo.c
@@ -55,28 +55,28 @@ f80b ????
static WRITE8_HANDLER( tecmo_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]);
}
static WRITE8_HANDLER( tecmo_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "soundcpu",INPUT_LINE_NMI,PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu",INPUT_LINE_NMI,PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( tecmo_adpcm_start_w )
{
- tecmo_state *state = device->machine->driver_data<tecmo_state>();
+ tecmo_state *state = device->machine().driver_data<tecmo_state>();
state->adpcm_pos = data << 8;
msm5205_reset_w(device, 0);
}
static WRITE8_HANDLER( tecmo_adpcm_end_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->adpcm_end = (data + 1) << 8;
}
static WRITE8_DEVICE_HANDLER( tecmo_adpcm_vol_w )
@@ -85,9 +85,9 @@ static WRITE8_DEVICE_HANDLER( tecmo_adpcm_vol_w )
}
static void tecmo_adpcm_int(device_t *device)
{
- tecmo_state *state = device->machine->driver_data<tecmo_state>();
+ tecmo_state *state = device->machine().driver_data<tecmo_state>();
if (state->adpcm_pos >= state->adpcm_end ||
- state->adpcm_pos >= device->machine->region("adpcm")->bytes())
+ state->adpcm_pos >= device->machine().region("adpcm")->bytes())
msm5205_reset_w(device,1);
else if (state->adpcm_data != -1)
{
@@ -96,7 +96,7 @@ static void tecmo_adpcm_int(device_t *device)
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ROM[state->adpcm_pos++];
msm5205_data_w(device,state->adpcm_data >> 4);
@@ -106,28 +106,28 @@ static void tecmo_adpcm_int(device_t *device)
/* the 8-bit dipswitches are split across addresses */
static READ8_HANDLER( tecmo_dswa_l_r )
{
- UINT8 port = input_port_read(space->machine, "DSWA");
+ UINT8 port = input_port_read(space->machine(), "DSWA");
port &= 0x0f;
return port;
}
static READ8_HANDLER( tecmo_dswa_h_r )
{
- UINT8 port = input_port_read(space->machine, "DSWA");
+ UINT8 port = input_port_read(space->machine(), "DSWA");
port &= 0xf0;
return port>>4;
}
static READ8_HANDLER( tecmo_dswb_l_r )
{
- UINT8 port = input_port_read(space->machine, "DSWB");
+ UINT8 port = input_port_read(space->machine(), "DSWB");
port &= 0x0f;
return port;
}
static READ8_HANDLER( tecmo_dswb_h_r )
{
- UINT8 port = input_port_read(space->machine, "DSWB");
+ UINT8 port = input_port_read(space->machine(), "DSWB");
port &= 0xf0;
return port>>4;
}
@@ -640,7 +640,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "soundcpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "soundcpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
@@ -657,7 +657,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_RESET( rygar )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
state->adpcm_pos = 0;
state->adpcm_end = 0;
state->adpcm_data = -1;
@@ -1156,31 +1156,31 @@ ROM_END
*/
static DRIVER_INIT( rygar )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
state->video_type = 0;
}
static DRIVER_INIT( silkworm )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
state->video_type = 1;
}
static DRIVER_INIT( gemini )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
state->video_type = 2;
}
static DRIVER_INIT( backfirt )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
state->video_type = 2;
/* no MSM */
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xc000, 0xc000);
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xd000, 0xd000);
- machine->device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xe000, 0xe000);
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xc000, 0xc000);
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xd000, 0xd000);
+ machine.device("soundcpu")->memory().space(AS_PROGRAM)->nop_write(0xe000, 0xe000);
}
diff --git a/src/mame/drivers/tecmo16.c b/src/mame/drivers/tecmo16.c
index 47e7189dbeb..4e24ca6b49a 100644
--- a/src/mame/drivers/tecmo16.c
+++ b/src/mame/drivers/tecmo16.c
@@ -37,7 +37,7 @@ static WRITE16_HANDLER( tecmo16_sound_command_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0x00, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -363,7 +363,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c
index 1a8317f9ae2..03e9e888fa7 100644
--- a/src/mame/drivers/tecmosys.c
+++ b/src/mame/drivers/tecmosys.c
@@ -193,7 +193,7 @@ ae500w07.ad1 - M6295 Samples (23c4001)
static TILE_GET_INFO( get_bg0tile_info )
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
SET_TILE_INFO(
1,
@@ -204,14 +204,14 @@ static TILE_GET_INFO( get_bg0tile_info )
static WRITE16_HANDLER( bg0_tilemap_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg0tilemap_ram[offset]);
tilemap_mark_tile_dirty(state->bg0tilemap,offset/2);
}
static TILE_GET_INFO( get_bg1tile_info )
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
SET_TILE_INFO(
2,
@@ -222,14 +222,14 @@ static TILE_GET_INFO( get_bg1tile_info )
static WRITE16_HANDLER( bg1_tilemap_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg1tilemap_ram[offset]);
tilemap_mark_tile_dirty(state->bg1tilemap,offset/2);
}
static TILE_GET_INFO( get_bg2tile_info )
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
SET_TILE_INFO(
3,
@@ -240,14 +240,14 @@ static TILE_GET_INFO( get_bg2tile_info )
static WRITE16_HANDLER( bg2_tilemap_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg2tilemap_ram[offset]);
tilemap_mark_tile_dirty(state->bg2tilemap,offset/2);
}
static TILE_GET_INFO( get_tile_info )
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
SET_TILE_INFO(
0,
@@ -258,7 +258,7 @@ static TILE_GET_INFO( get_tile_info )
static WRITE16_HANDLER( fg_tilemap_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->fgtilemap_ram[offset]);
tilemap_mark_tile_dirty(state->txt_tilemap,offset/2);
}
@@ -280,7 +280,7 @@ static WRITE16_HANDLER( sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0x00, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -296,7 +296,7 @@ static WRITE16_HANDLER( sound_w )
static WRITE16_HANDLER( unk880000_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->_880000regs[offset]);
switch( offset )
@@ -312,7 +312,7 @@ static WRITE16_HANDLER( unk880000_w )
break;
case 0x22/2:
- watchdog_reset( space->machine );
+ watchdog_reset( space->machine() );
//logerror( "watchdog_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, cpu_get_pc(space->cpu) );
break;
@@ -324,7 +324,7 @@ static WRITE16_HANDLER( unk880000_w )
static READ16_HANDLER( unk880000_r )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
//UINT16 ret = state->_880000regs[offset];
logerror( "unk880000_r( %06x ) @ %06x = %04x\n", (offset * 2 ) +0x880000, cpu_get_pc(space->cpu), state->_880000regs[offset] );
@@ -334,7 +334,7 @@ static READ16_HANDLER( unk880000_r )
switch( offset )
{
case 0:
- if ( space->machine->primary_screen->vpos() >= 240) return 0;
+ if ( space->machine().primary_screen->vpos() >= 240) return 0;
else return 1;
default:
@@ -360,7 +360,7 @@ static WRITE16_DEVICE_HANDLER( eeprom_w )
}
-INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
@@ -368,28 +368,28 @@ INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int
static WRITE16_HANDLER( tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->tilemap_paletteram16[offset]);
- set_color_555(space->machine, offset+0x4000, 5, 10, 0, state->tilemap_paletteram16[offset]);
+ set_color_555(space->machine(), offset+0x4000, 5, 10, 0, state->tilemap_paletteram16[offset]);
}
static WRITE16_HANDLER( bg0_tilemap_lineram_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg0tilemap_lineram[offset]);
if (data!=0x0000) popmessage("non 0 write to bg0 lineram %04x %04x",offset,data);
}
static WRITE16_HANDLER( bg1_tilemap_lineram_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg1tilemap_lineram[offset]);
if (data!=0x0000) popmessage("non 0 write to bg1 lineram %04x %04x",offset,data);
}
static WRITE16_HANDLER( bg2_tilemap_lineram_w )
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
COMBINE_DATA(&state->bg2tilemap_lineram[offset]);
if (data!=0x0000) popmessage("non 0 write to bg2 lineram %04x %04x",offset,data);
}
@@ -512,14 +512,14 @@ GFXDECODE_END
static WRITE8_HANDLER( deroon_bankswitch_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("audiocpu")->base() + ((data-2) & 0x0f) * 0x4000 + 0x10000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("audiocpu")->base() + ((data-2) & 0x0f) * 0x4000 + 0x10000 );
}
static WRITE8_HANDLER( tecmosys_oki_bank_w )
{
UINT8 upperbank = (data & 0x30) >> 4;
UINT8 lowerbank = (data & 0x03) >> 0;
- UINT8* region = space->machine->region("oki")->base();
+ UINT8* region = space->machine().region("oki")->base();
memcpy( region+0x00000, region+0x80000 + lowerbank * 0x20000, 0x20000 );
memcpy( region+0x20000, region+0x80000 + upperbank * 0x20000, 0x20000 );
@@ -545,7 +545,7 @@ ADDRESS_MAP_END
static VIDEO_START(deroon)
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
state->sprite_bitmap = auto_bitmap_alloc(machine,320,240,BITMAP_FORMAT_INDEXED16);
bitmap_fill(state->sprite_bitmap, NULL, 0x4000);
@@ -570,10 +570,10 @@ static VIDEO_START(deroon)
}
-static void tecmosys_render_sprites_to_bitmap(running_machine *machine, bitmap_t *bitmap, UINT16 extrax, UINT16 extray )
+static void tecmosys_render_sprites_to_bitmap(running_machine &machine, bitmap_t *bitmap, UINT16 extrax, UINT16 extray )
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
- UINT8 *gfxsrc = machine->region ( "gfx1" )->base();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
+ UINT8 *gfxsrc = machine.region ( "gfx1" )->base();
int i;
/* render sprites (with priority information) to temp bitmap */
@@ -686,10 +686,10 @@ static void tecmosys_tilemap_copy_to_compose(tecmosys_state *state, UINT16 pri)
}
}
-static void tecmosys_do_final_mix(running_machine *machine, bitmap_t* bitmap)
+static void tecmosys_do_final_mix(running_machine &machine, bitmap_t* bitmap)
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
- const pen_t *paldata = machine->pens;
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
+ const pen_t *paldata = machine.pens;
int y,x;
UINT16 *srcptr;
UINT16 *srcptr2;
@@ -720,7 +720,7 @@ static void tecmosys_do_final_mix(running_machine *machine, bitmap_t* bitmap)
if (srcptr2[x]&0x3fff)
{
- penvalue2 = machine->generic.paletteram.u16[srcptr2[x]&0x3fff];
+ penvalue2 = machine.generic.paletteram.u16[srcptr2[x]&0x3fff];
colour2 = paldata[srcptr2[x]&0x3fff];
}
else
@@ -761,9 +761,9 @@ static void tecmosys_do_final_mix(running_machine *machine, bitmap_t* bitmap)
static SCREEN_UPDATE(deroon)
{
- tecmosys_state *state = screen->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = screen->machine().driver_data<tecmosys_state>();
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0x4000]);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0x4000]);
tilemap_set_scrolly( state->bg0tilemap, 0, state->c80000regs[1]+16);
@@ -794,7 +794,7 @@ static SCREEN_UPDATE(deroon)
tecmosys_tilemap_copy_to_compose(state, 0xc000);
- tecmosys_do_final_mix(screen->machine, bitmap);
+ tecmosys_do_final_mix(screen->machine(), bitmap);
/*
popmessage("%04x %04x %04x %04x | %04x %04x %04x %04x | %04x %04x %04x %04x | %04x %04x %04x %04x | %04x %04x %04x %04x | %04x %04x %04x %04x",
@@ -815,7 +815,7 @@ static SCREEN_UPDATE(deroon)
// state->a80000regs[0], state->a80000regs[1], state->a80000regs[2]);
// prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct?
- tecmosys_render_sprites_to_bitmap(screen->machine, bitmap, state->_880000regs[0x0], state->_880000regs[0x1]);
+ tecmosys_render_sprites_to_bitmap(screen->machine(), bitmap, state->_880000regs[0x0], state->_880000regs[0x1]);
return 0;
@@ -859,7 +859,7 @@ static SCREEN_UPDATE(deroon)
static void sound_irq(device_t *device, int irq)
{
/* IRQ */
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ymf262_interface tecmosys_ymf262_interface =
@@ -1046,10 +1046,10 @@ ROM_START( tkdenshoa )
ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) )
ROM_END
-static void tecmosys_decramble(running_machine *machine)
+static void tecmosys_decramble(running_machine &machine)
{
- UINT8 *gfxsrc = machine->region ( "gfx1" )->base();
- size_t srcsize = machine->region( "gfx1" )->bytes();
+ UINT8 *gfxsrc = machine.region ( "gfx1" )->base();
+ size_t srcsize = machine.region( "gfx1" )->bytes();
int i;
for (i=0; i < srcsize; i+=4)
diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c
index 2bfcd9a81b3..46260c545e7 100644
--- a/src/mame/drivers/tehkanwc.c
+++ b/src/mame/drivers/tehkanwc.c
@@ -98,46 +98,46 @@ TO DO :
static WRITE8_HANDLER( sub_cpu_halt_w )
{
if (data)
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE);
}
static READ8_HANDLER( tehkanwc_track_0_r )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
int joy;
- joy = input_port_read(space->machine, "FAKE") >> (2 * offset);
+ joy = input_port_read(space->machine(), "FAKE") >> (2 * offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return input_port_read(space->machine, offset ? "P1Y" : "P1X") - state->track0[offset];
+ return input_port_read(space->machine(), offset ? "P1Y" : "P1X") - state->track0[offset];
}
static READ8_HANDLER( tehkanwc_track_1_r )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
int joy;
- joy = input_port_read(space->machine, "FAKE") >> (4 + 2 * offset);
+ joy = input_port_read(space->machine(), "FAKE") >> (4 + 2 * offset);
if (joy & 1) return -63;
if (joy & 2) return 63;
- return input_port_read(space->machine, offset ? "P2Y" : "P2X") - state->track1[offset];
+ return input_port_read(space->machine(), offset ? "P2Y" : "P2X") - state->track1[offset];
}
static WRITE8_HANDLER( tehkanwc_track_0_reset_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
/* reset the trackball counters */
- state->track0[offset] = input_port_read(space->machine, offset ? "P1Y" : "P1X") + data;
+ state->track0[offset] = input_port_read(space->machine(), offset ? "P1Y" : "P1X") + data;
}
static WRITE8_HANDLER( tehkanwc_track_1_reset_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
/* reset the trackball counters */
- state->track1[offset] = input_port_read(space->machine, offset ? "P2Y" : "P2X") + data;
+ state->track1[offset] = input_port_read(space->machine(), offset ? "P2Y" : "P2X") + data;
}
@@ -145,7 +145,7 @@ static WRITE8_HANDLER( tehkanwc_track_1_reset_w )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static TIMER_CALLBACK( reset_callback )
@@ -159,7 +159,7 @@ static WRITE8_HANDLER( sound_answer_w )
/* in Gridiron, the sound CPU goes in a tight loop after the self test, */
/* probably waiting to be reset by a watchdog */
- if (cpu_get_pc(space->cpu) == 0x08bc) space->machine->scheduler().timer_set(attotime::from_seconds(1), FUNC(reset_callback));
+ if (cpu_get_pc(space->cpu) == 0x08bc) space->machine().scheduler().timer_set(attotime::from_seconds(1), FUNC(reset_callback));
}
@@ -168,25 +168,25 @@ static WRITE8_HANDLER( sound_answer_w )
static READ8_DEVICE_HANDLER( tehkanwc_portA_r )
{
- tehkanwc_state *state = device->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
return state->msm_data_offs & 0xff;
}
static READ8_DEVICE_HANDLER( tehkanwc_portB_r )
{
- tehkanwc_state *state = device->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
return (state->msm_data_offs >> 8) & 0xff;
}
static WRITE8_DEVICE_HANDLER( tehkanwc_portA_w )
{
- tehkanwc_state *state = device->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
state->msm_data_offs = (state->msm_data_offs & 0xff00) | data;
}
static WRITE8_DEVICE_HANDLER( tehkanwc_portB_w )
{
- tehkanwc_state *state = device->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
state->msm_data_offs = (state->msm_data_offs & 0x00ff) | (data << 8);
}
@@ -197,9 +197,9 @@ static WRITE8_DEVICE_HANDLER( msm_reset_w )
static void tehkanwc_adpcm_int(device_t *device)
{
- tehkanwc_state *state = device->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = device->machine().driver_data<tehkanwc_state>();
- UINT8 *SAMPLES = device->machine->region("adpcm")->base();
+ UINT8 *SAMPLES = device->machine().region("adpcm")->base();
int msm_data = SAMPLES[state->msm_data_offs & 0x7fff];
if (state->toggle == 0)
@@ -712,7 +712,7 @@ static DRIVER_INIT( teedoff )
023A: 00 nop
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x0238] = 0x00;
ROM[0x0239] = 0x00;
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index b13ca9bf960..6c0e17819dc 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -308,7 +308,7 @@ public:
static MACHINE_START( tempest )
{
- tempest_state *state = machine->driver_data<tempest_state>();
+ tempest_state *state = machine.driver_data<tempest_state>();
state->save_item(NAME(state->player_select));
}
@@ -320,8 +320,8 @@ static MACHINE_START( tempest )
static WRITE8_HANDLER( wdclr_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
- watchdog_reset(space->machine);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ watchdog_reset(space->machine());
}
/*************************************
@@ -332,15 +332,15 @@ static WRITE8_HANDLER( wdclr_w )
static CUSTOM_INPUT( tempest_knob_r )
{
- tempest_state *state = field->port->machine->driver_data<tempest_state>();
- return input_port_read(field->port->machine, (state->player_select == 0) ?
+ tempest_state *state = field->port->machine().driver_data<tempest_state>();
+ return input_port_read(field->port->machine(), (state->player_select == 0) ?
TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG);
}
static CUSTOM_INPUT( tempest_buttons_r )
{
- tempest_state *state = field->port->machine->driver_data<tempest_state>();
- return input_port_read(field->port->machine, (state->player_select == 0) ?
+ tempest_state *state = field->port->machine().driver_data<tempest_state>();
+ return input_port_read(field->port->machine(), (state->player_select == 0) ?
TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG);
}
@@ -348,19 +348,19 @@ static CUSTOM_INPUT( tempest_buttons_r )
static CUSTOM_INPUT( clock_r )
{
/* Emulate the 3kHz source on bit 7 (divide 1.5MHz by 512) */
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
static READ8_DEVICE_HANDLER( input_port_1_bit_r )
{
- return (input_port_read(device->machine, "IN1/DSW0") & (1 << offset)) ? 0 : 228;
+ return (input_port_read(device->machine(), "IN1/DSW0") & (1 << offset)) ? 0 : 228;
}
static READ8_DEVICE_HANDLER( input_port_2_bit_r )
{
- return (input_port_read(device->machine, "IN2") & (1 << offset)) ? 0 : 228;
+ return (input_port_read(device->machine(), "IN2") & (1 << offset)) ? 0 : 228;
}
@@ -373,9 +373,9 @@ static READ8_DEVICE_HANDLER( input_port_2_bit_r )
static WRITE8_HANDLER( tempest_led_w )
{
- tempest_state *state = space->machine->driver_data<tempest_state>();
- set_led_status(space->machine, 0, ~data & 0x02);
- set_led_status(space->machine, 1, ~data & 0x01);
+ tempest_state *state = space->machine().driver_data<tempest_state>();
+ set_led_status(space->machine(), 0, ~data & 0x02);
+ set_led_status(space->machine(), 1, ~data & 0x01);
/* FLIP is bit 0x04 */
state->player_select = data & 0x04;
}
@@ -383,9 +383,9 @@ static WRITE8_HANDLER( tempest_led_w )
static WRITE8_HANDLER( tempest_coin_w )
{
- coin_counter_w(space->machine, 0, (data & 0x01));
- coin_counter_w(space->machine, 1, (data & 0x02));
- coin_counter_w(space->machine, 2, (data & 0x04));
+ coin_counter_w(space->machine(), 0, (data & 0x01));
+ coin_counter_w(space->machine(), 1, (data & 0x02));
+ coin_counter_w(space->machine(), 2, (data & 0x04));
avg_set_flip_x(data & 0x08);
avg_set_flip_y(data & 0x10);
}
diff --git a/src/mame/drivers/terracre.c b/src/mame/drivers/terracre.c
index 21869b47857..2ba6c3597bd 100644
--- a/src/mame/drivers/terracre.c
+++ b/src/mame/drivers/terracre.c
@@ -134,7 +134,7 @@ static const UINT16 mHoreKidProtData[] =
static READ16_HANDLER( horekid_IN2_r )
{
- int data = input_port_read(space->machine, "IN2");
+ int data = input_port_read(space->machine(), "IN2");
if (!(data & 0x40)) // FAKE button 3 for "Debug Mode"
{
@@ -158,7 +158,7 @@ static READ8_HANDLER( soundlatch_clear_r )
static READ16_HANDLER( amazon_protection_r )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
offset = state->mAmazonProtReg[2];
if( offset<=0x56 )
{
@@ -172,7 +172,7 @@ static READ16_HANDLER( amazon_protection_r )
static WRITE16_HANDLER( amazon_protection_w )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
if( ACCESSING_BITS_0_7 )
{
if( offset==1 )
@@ -191,7 +191,7 @@ static WRITE16_HANDLER( amazon_protection_w )
static MACHINE_START( amazon )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
/* set up for save */
state_save_register_global(machine, state->mAmazonProtCmd);
state_save_register_global_array(machine, state->mAmazonProtReg);
@@ -1016,21 +1016,21 @@ ROM_END
static DRIVER_INIT( amazon )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
state->mpProtData = mAmazonProtData;
}
static DRIVER_INIT( amatelas )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
state->mpProtData = mAmatelasProtData;
}
static DRIVER_INIT( horekid )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
state->mpProtData = mHoreKidProtData;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x44004, 0x44005, FUNC(horekid_IN2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x44004, 0x44005, FUNC(horekid_IN2_r));
}
/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */
diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c
index 68c9c008f23..942b9e6f99a 100644
--- a/src/mame/drivers/tetrisp2.c
+++ b/src/mame/drivers/tetrisp2.c
@@ -52,7 +52,7 @@ Notes:
static WRITE16_HANDLER( tetrisp2_systemregs_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
{
state->systemregs[offset] = data;
@@ -63,7 +63,7 @@ static WRITE16_HANDLER( tetrisp2_systemregs_w )
static WRITE16_HANDLER( rockn_systemregs_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
{
state->systemregs[offset] = data;
@@ -78,7 +78,7 @@ static WRITE16_HANDLER( rockn_systemregs_w )
static WRITE16_HANDLER( rocknms_sub_systemregs_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
{
state->rocknms_sub_systemregs[offset] = data;
@@ -101,14 +101,14 @@ static WRITE16_HANDLER( rocknms_sub_systemregs_w )
static READ16_HANDLER( rockn_adpcmbank_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return ((state->rockn_adpcmbank & 0xf0ff) | (state->rockn_protectdata << 8));
}
static WRITE16_HANDLER( rockn_adpcmbank_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
- UINT8 *SNDROM = space->machine->region("ymz")->base();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
+ UINT8 *SNDROM = space->machine().region("ymz")->base();
int bank;
state->rockn_adpcmbank = data;
@@ -125,8 +125,8 @@ static WRITE16_HANDLER( rockn_adpcmbank_w )
static WRITE16_HANDLER( rockn2_adpcmbank_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
- UINT8 *SNDROM = space->machine->region("ymz")->base();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
+ UINT8 *SNDROM = space->machine().region("ymz")->base();
int bank;
char banktable[9][3]=
@@ -164,24 +164,24 @@ static READ16_HANDLER( rockn_soundvolume_r )
static WRITE16_HANDLER( rockn_soundvolume_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
state->rockn_soundvolume = data;
}
static WRITE16_HANDLER( nndmseal_sound_bank_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
{
- UINT8 *rom = space->machine->region("okisource")->base();
+ UINT8 *rom = space->machine().region("okisource")->base();
if (data & 0x04)
{
state->bank_lo = data & 0x03;
- memcpy(space->machine->region("oki")->base(), rom + (state->bank_lo * 0x80000), 0x20000);
+ memcpy(space->machine().region("oki")->base(), rom + (state->bank_lo * 0x80000), 0x20000);
// logerror("PC:%06X sound bank_lo = %02X\n",cpu_get_pc(space->cpu),state->bank_lo);
}
@@ -189,7 +189,7 @@ static WRITE16_HANDLER( nndmseal_sound_bank_w )
{
state->bank_hi = data & 0x03;
- memcpy(space->machine->region("oki")->base() + 0x20000, rom + (state->bank_lo * 0x80000) + (state->bank_hi * 0x20000), 0x20000);
+ memcpy(space->machine().region("oki")->base() + 0x20000, rom + (state->bank_lo * 0x80000) + (state->bank_hi * 0x20000), 0x20000);
// logerror("PC:%06X sound bank_hi = %02X\n",cpu_get_pc(space->cpu),state->bank_hi);
}
@@ -206,9 +206,9 @@ static WRITE16_HANDLER( nndmseal_sound_bank_w )
static READ16_HANDLER( tetrisp2_ip_1_word_r )
{
- return ( input_port_read(space->machine, "SYSTEM") & 0xfcff ) |
- ( space->machine->rand() & ~0xfcff ) |
- ( 1 << (8 + (space->machine->rand()&1)) );
+ return ( input_port_read(space->machine(), "SYSTEM") & 0xfcff ) |
+ ( space->machine().rand() & ~0xfcff ) |
+ ( 1 << (8 + (space->machine().rand()&1)) );
}
@@ -225,20 +225,20 @@ static READ16_HANDLER( tetrisp2_ip_1_word_r )
/* The game only ever writes even bytes and reads odd bytes */
static READ16_HANDLER( tetrisp2_nvram_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return ( (state->nvram[offset] >> 8) & 0x00ff ) |
( (state->nvram[offset] << 8) & 0xff00 ) ;
}
static WRITE16_HANDLER( tetrisp2_nvram_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->nvram[offset]);
}
static READ16_HANDLER( rockn_nvram_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return state->nvram[offset];
}
@@ -254,26 +254,26 @@ static READ16_HANDLER( rockn_nvram_r )
static READ16_HANDLER( rocknms_main2sub_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return state->rocknms_main2sub;
}
static WRITE16_HANDLER( rocknms_main2sub_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
state->rocknms_main2sub = (data ^ 0xffff);
}
static CUSTOM_INPUT( rocknms_main2sub_status_r )
{
- tetrisp2_state *state = field->port->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = field->port->machine().driver_data<tetrisp2_state>();
return state->rocknms_sub2main & 0x0003;
}
static WRITE16_HANDLER( rocknms_sub2main_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_0_7)
state->rocknms_sub2main = (data ^ 0xffff);
}
@@ -281,7 +281,7 @@ static WRITE16_HANDLER( rocknms_sub2main_w )
static WRITE16_HANDLER( tetrisp2_coincounter_w )
{
- coin_counter_w( space->machine, 0, (data & 0x0001));
+ coin_counter_w( space->machine(), 0, (data & 0x0001));
}
@@ -331,16 +331,16 @@ static WRITE16_HANDLER( nndmseal_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w( space->machine, 0, data & 0x0001 );
+ coin_counter_w( space->machine(), 0, data & 0x0001 );
// data & 0x0004 ?
- coin_lockout_w( space->machine, 0,(~data) & 0x0008 );
+ coin_lockout_w( space->machine(), 0,(~data) & 0x0008 );
}
if (ACCESSING_BITS_8_15)
{
- set_led_status( space->machine, 0, data & 0x1000 ); // +
- set_led_status( space->machine, 1, data & 0x2000 ); // -
- set_led_status( space->machine, 2, data & 0x4000 ); // Cancel
- set_led_status( space->machine, 3, data & 0x8000 ); // OK
+ set_led_status( space->machine(), 0, data & 0x1000 ); // +
+ set_led_status( space->machine(), 1, data & 0x2000 ); // -
+ set_led_status( space->machine(), 2, data & 0x4000 ); // Cancel
+ set_led_status( space->machine(), 3, data & 0x8000 ); // OK
}
// popmessage("%04x",data);
}
@@ -1046,11 +1046,11 @@ static TIMER_CALLBACK( rockn_timer_sub_level1_callback )
cputag_set_input_line(machine, "sub", 1, HOLD_LINE);
}
-static void init_rockn_timer(running_machine *machine)
+static void init_rockn_timer(running_machine &machine)
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
- machine->scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_level1_callback));
- state->rockn_timer_l4 = machine->scheduler().timer_alloc(FUNC(rockn_timer_level4_callback));
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
+ machine.scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_level1_callback));
+ state->rockn_timer_l4 = machine.scheduler().timer_alloc(FUNC(rockn_timer_level4_callback));
state_save_register_global_array(machine, state->systemregs);
state_save_register_global_array(machine, state->rocknms_sub_systemregs);
@@ -1061,32 +1061,32 @@ static void init_rockn_timer(running_machine *machine)
static DRIVER_INIT( rockn )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
init_rockn_timer(machine);
state->rockn_protectdata = 1;
}
static DRIVER_INIT( rockn1 )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
init_rockn_timer(machine);
state->rockn_protectdata = 1;
}
static DRIVER_INIT( rockn2 )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
init_rockn_timer(machine);
state->rockn_protectdata = 2;
}
static DRIVER_INIT( rocknms )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
init_rockn_timer(machine);
- machine->scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_sub_level1_callback));
- state->rockn_timer_sub_l4 = machine->scheduler().timer_alloc(FUNC(rockn_timer_sub_level4_callback));
+ machine.scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_sub_level1_callback));
+ state->rockn_timer_sub_l4 = machine.scheduler().timer_alloc(FUNC(rockn_timer_sub_level4_callback));
state->rockn_protectdata = 3;
@@ -1094,7 +1094,7 @@ static DRIVER_INIT( rocknms )
static DRIVER_INIT( rockn3 )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
init_rockn_timer(machine);
state->rockn_protectdata = 4;
}
diff --git a/src/mame/drivers/tgtpanic.c b/src/mame/drivers/tgtpanic.c
index 61ff1ca9160..d34a0e5211a 100644
--- a/src/mame/drivers/tgtpanic.c
+++ b/src/mame/drivers/tgtpanic.c
@@ -32,7 +32,7 @@ public:
static SCREEN_UPDATE( tgtpanic )
{
- tgtpanic_state *state = screen->machine->driver_data<tgtpanic_state>();
+ tgtpanic_state *state = screen->machine().driver_data<tgtpanic_state>();
UINT32 colors[4];
UINT32 offs;
UINT32 x, y;
@@ -68,8 +68,8 @@ static SCREEN_UPDATE( tgtpanic )
static WRITE8_HANDLER( color_w )
{
- tgtpanic_state *state = space->machine->driver_data<tgtpanic_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ tgtpanic_state *state = space->machine().driver_data<tgtpanic_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->color = data;
}
diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c
index 599ccf49746..8caf2244ea4 100644
--- a/src/mame/drivers/thayers.c
+++ b/src/mame/drivers/thayers.c
@@ -62,9 +62,9 @@ static const UINT8 led_map[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x0
/* Interrupts */
-static void check_interrupt(running_machine *machine)
+static void check_interrupt(running_machine &machine)
{
- thayers_state *state = machine->driver_data<thayers_state>();
+ thayers_state *state = machine.driver_data<thayers_state>();
if (!state->timer_int || !state->data_rdy_int || !state->ssi_data_request)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
@@ -84,14 +84,14 @@ static WRITE8_HANDLER( intrq_w )
{
// T = 1.1 * R30 * C53 = 1.1 * 750K * 0.01uF = 8.25 ms
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, HOLD_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(8250), FUNC(intrq_tick));
+ space->machine().scheduler().timer_set(attotime::from_usec(8250), FUNC(intrq_tick));
}
static READ8_HANDLER( irqstate_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -112,23 +112,23 @@ static READ8_HANDLER( irqstate_r )
static WRITE8_HANDLER( timer_int_ack_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
state->timer_int = 1;
- check_interrupt(space->machine);
+ check_interrupt(space->machine());
}
static WRITE8_HANDLER( data_rdy_int_ack_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
state->data_rdy_int = 1;
- check_interrupt(space->machine);
+ check_interrupt(space->machine());
}
static WRITE8_HANDLER( cop_d_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -150,14 +150,14 @@ static WRITE8_HANDLER( cop_d_w )
state->data_rdy_int = 0;
}
- check_interrupt(space->machine);
+ check_interrupt(space->machine());
}
/* COP Communication */
static READ8_HANDLER( cop_data_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
if (!state->cop_data_latch_enable)
{
return state->cop_data_latch;
@@ -170,13 +170,13 @@ static READ8_HANDLER( cop_data_r )
static WRITE8_HANDLER( cop_data_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
state->cop_data_latch = data;
}
static READ8_HANDLER( cop_l_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
if (!state->cop_data_latch_enable)
{
return state->cop_data_latch;
@@ -189,13 +189,13 @@ static READ8_HANDLER( cop_l_r )
static WRITE8_HANDLER( cop_l_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
state->cop_l = data;
}
static READ8_HANDLER( cop_g_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -212,7 +212,7 @@ static READ8_HANDLER( cop_g_r )
static WRITE8_HANDLER( control_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( control_w )
static WRITE8_HANDLER( cop_g_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -252,7 +252,7 @@ static WRITE8_HANDLER( cop_g_w )
static READ8_HANDLER(cop_si_r)
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/* keyboard data */
/*
@@ -283,7 +283,7 @@ static READ8_HANDLER(cop_si_r)
sprintf(port, "R%d", state->keylatch);
- data = BIT(input_port_read(space->machine, port), state->rx_bit - 5);
+ data = BIT(input_port_read(space->machine(), port), state->rx_bit - 5);
return data;
}
@@ -295,7 +295,7 @@ static READ8_HANDLER(cop_si_r)
static WRITE8_HANDLER( cop_so_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/* keyboard clock */
if (data)
@@ -320,7 +320,7 @@ static WRITE8_HANDLER( cop_so_w )
static WRITE8_HANDLER( control2_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -338,30 +338,30 @@ static WRITE8_HANDLER( control2_w )
if ((!BIT(data, 2)) & state->cart_present)
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, HOLD_LINE);
}
}
static READ8_HANDLER( dsw_b_r )
{
- return (input_port_read(space->machine, "COIN") & 0xf0) | (input_port_read(space->machine, "DSWB") & 0x0f);
+ return (input_port_read(space->machine(), "COIN") & 0xf0) | (input_port_read(space->machine(), "DSWB") & 0x0f);
}
static READ8_HANDLER( laserdsc_data_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
return laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER( laserdsc_data_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
state->laserdisc_data = data;
}
static WRITE8_HANDLER( laserdsc_control_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
/*
bit description
@@ -377,7 +377,7 @@ static WRITE8_HANDLER( laserdsc_control_w )
*/
- coin_counter_w(space->machine, 0, BIT(data, 4));
+ coin_counter_w(space->machine(), 0, BIT(data, 4));
if (BIT(data, 5))
{
@@ -460,14 +460,14 @@ static const char SSI263_PHONEMES[0x40][5] =
static TIMER_CALLBACK( ssi263_phoneme_tick )
{
- thayers_state *state = machine->driver_data<thayers_state>();
+ thayers_state *state = machine.driver_data<thayers_state>();
state->ssi_data_request = 0;
check_interrupt(machine);
}
static WRITE8_HANDLER( ssi263_register_w )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
struct ssi263_t &ssi263 = state->ssi263;
switch (offset)
{
@@ -481,18 +481,18 @@ static WRITE8_HANDLER( ssi263_register_w )
ssi263.p = data & 0x3f;
state->ssi_data_request = 1;
- check_interrupt(space->machine);
+ check_interrupt(space->machine());
switch (ssi263.mode)
{
case 0:
case 1:
// phoneme timing response
- space->machine->scheduler().timer_set(attotime::from_usec(phoneme_time), FUNC(ssi263_phoneme_tick));
+ space->machine().scheduler().timer_set(attotime::from_usec(phoneme_time), FUNC(ssi263_phoneme_tick));
break;
case 2:
// frame timing response
- space->machine->scheduler().timer_set(attotime::from_usec(frame_time), FUNC(ssi263_phoneme_tick));
+ space->machine().scheduler().timer_set(attotime::from_usec(frame_time), FUNC(ssi263_phoneme_tick));
break;
case 3:
// disable A/_R output
@@ -570,7 +570,7 @@ static WRITE8_HANDLER( ssi263_register_w )
static READ8_HANDLER( ssi263_register_r )
{
- thayers_state *state = space->machine->driver_data<thayers_state>();
+ thayers_state *state = space->machine().driver_data<thayers_state>();
// D7 becomes an output, as the inverted state of A/_R. The register address bits are ignored.
return !state->ssi_data_request << 7;
@@ -614,7 +614,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( laserdisc_enter_r )
{
- thayers_state *state = field->port->machine->driver_data<thayers_state>();
+ thayers_state *state = field->port->machine().driver_data<thayers_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -629,7 +629,7 @@ static CUSTOM_INPUT( laserdisc_enter_r )
static CUSTOM_INPUT( laserdisc_ready_r )
{
- thayers_state *state = field->port->machine->driver_data<thayers_state>();
+ thayers_state *state = field->port->machine().driver_data<thayers_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -747,14 +747,14 @@ INPUT_PORTS_END
static MACHINE_START( thayers )
{
- thayers_state *state = machine->driver_data<thayers_state>();
- state->laserdisc = machine->device("laserdisc");
+ thayers_state *state = machine.driver_data<thayers_state>();
+ state->laserdisc = machine.device("laserdisc");
memset(&state->ssi263, 0, sizeof(state->ssi263));
}
static MACHINE_RESET( thayers )
{
- thayers_state *state = machine->driver_data<thayers_state>();
+ thayers_state *state = machine.driver_data<thayers_state>();
int newtype;
state->laserdisc_data = 0;
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index 28a91210cf6..d2ce36e50f4 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -40,21 +40,21 @@ Notes:
static WRITE8_HANDLER( thedeep_nmi_w )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
state->nmi_enable = data;
}
static WRITE8_HANDLER( thedeep_sound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_RESET( thedeep )
{
- thedeep_state *state = machine->driver_data<thedeep_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000 + 0 * 0x4000);
+ thedeep_state *state = machine.driver_data<thedeep_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000 + 0 * 0x4000);
state->scroll[0] = 0;
state->scroll[1] = 0;
state->scroll[2] = 0;
@@ -67,16 +67,16 @@ static MACHINE_RESET( thedeep )
static WRITE8_HANDLER( thedeep_protection_w )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
state->protection_command = data;
switch (state->protection_command)
{
case 0x11:
- flip_screen_set(space->machine, 1);
+ flip_screen_set(space->machine(), 1);
break;
case 0x20:
- flip_screen_set(space->machine, 0);
+ flip_screen_set(space->machine(), 0);
break;
case 0x30:
@@ -88,8 +88,8 @@ static WRITE8_HANDLER( thedeep_protection_w )
int new_rombank = state->protection_command & 3;
if (state->rombank == new_rombank) break;
state->rombank = new_rombank;
- rom = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1", rom + 0x10000 + state->rombank * 0x4000);
+ rom = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1", rom + 0x10000 + state->rombank * 0x4000);
/* there's code which falls through from the fixed ROM to bank #1, I have to */
/* copy it there otherwise the CPU bank switching support will not catch it. */
memcpy(rom + 0x08000, rom + 0x10000 + state->rombank * 0x4000, 0x4000);
@@ -118,7 +118,7 @@ static WRITE8_HANDLER( thedeep_protection_w )
// d166-d174: hl = (hl + 2*a)
// d175-d181: hl *= e (e must be non zero)
// d182-d19a: hl /= de
- state->protection_data = space->machine->region("cpu3")->base()[0x185+state->protection_index++];
+ state->protection_data = space->machine().region("cpu3")->base()[0x185+state->protection_index++];
else
state->protection_data = 0xc9;
@@ -133,13 +133,13 @@ static WRITE8_HANDLER( thedeep_protection_w )
static READ8_HANDLER( thedeep_e004_r )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
return state->protection_irq ? 1 : 0;
}
static READ8_HANDLER( thedeep_protection_r )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
state->protection_irq = 0;
return state->protection_data;
}
@@ -309,7 +309,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface thedeep_ym2203_intf =
@@ -324,12 +324,12 @@ static const ym2203_interface thedeep_ym2203_intf =
static INTERRUPT_GEN( thedeep_interrupt )
{
- thedeep_state *state = device->machine->driver_data<thedeep_state>();
+ thedeep_state *state = device->machine().driver_data<thedeep_state>();
if (cpu_getiloops(device))
{
if (state->protection_command != 0x59)
{
- int coins = input_port_read(device->machine, "MCU");
+ int coins = input_port_read(device->machine(), "MCU");
if (coins & 1) state->protection_data = 1;
else if (coins & 2) state->protection_data = 2;
else if (coins & 4) state->protection_data = 3;
diff --git a/src/mame/drivers/thepit.c b/src/mame/drivers/thepit.c
index 5d9e519b0f4..49728c5b50e 100644
--- a/src/mame/drivers/thepit.c
+++ b/src/mame/drivers/thepit.c
@@ -137,13 +137,13 @@ HT-01B
static READ8_HANDLER( thepit_colorram_r )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
return state->colorram[offset];
}
static WRITE8_HANDLER( thepit_sound_enable_w )
{
- space->machine->sound().system_enable(data);
+ space->machine().sound().system_enable(data);
}
@@ -1035,7 +1035,7 @@ ROM_END
static READ8_HANDLER( rtriv_question_r )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
// Set-up the remap table for every 16 bytes
if((offset & 0xc00) == 0x800)
{
@@ -1050,7 +1050,7 @@ static READ8_HANDLER( rtriv_question_r )
// Read the actual byte from question roms
else if((offset & 0xc00) == 0xc00)
{
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
int real_address;
real_address = (0x8000 * state->question_rom) | state->question_address | (offset & 0x3f0) | state->remap_address[offset & 0x0f];
@@ -1064,7 +1064,7 @@ static READ8_HANDLER( rtriv_question_r )
static DRIVER_INIT( rtriv )
{
// Set-up the weirdest questions read ever done
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x4fff, FUNC(rtriv_question_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x4fff, FUNC(rtriv_question_r));
}
diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c
index 40c72dbcefa..bd716e7e028 100644
--- a/src/mame/drivers/thief.c
+++ b/src/mame/drivers/thief.c
@@ -36,7 +36,7 @@ Credits:
static INTERRUPT_GEN( thief_interrupt )
{
/* SLAM switch causes an NMI if it's pressed */
- if( (input_port_read(device->machine, "P2") & 0x10) == 0 )
+ if( (input_port_read(device->machine(), "P2") & 0x10) == 0 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
else
device_set_input_line(device, 0, HOLD_LINE);
@@ -95,7 +95,7 @@ static void tape_set_motor( device_t *samples, int bOn )
static WRITE8_HANDLER( thief_input_select_w )
{
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
state->input_select = data;
}
@@ -140,13 +140,13 @@ static WRITE8_DEVICE_HANDLER( tape_control_w )
static READ8_HANDLER( thief_io_r )
{
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
switch( state->input_select )
{
- case 0x01: return input_port_read(space->machine, "DSW1");
- case 0x02: return input_port_read(space->machine, "DSW2");
- case 0x04: return input_port_read(space->machine, "P1");
- case 0x08: return input_port_read(space->machine, "P2");
+ case 0x01: return input_port_read(space->machine(), "DSW1");
+ case 0x02: return input_port_read(space->machine(), "DSW2");
+ case 0x04: return input_port_read(space->machine(), "P1");
+ case 0x08: return input_port_read(space->machine(), "P2");
}
return 0x00;
}
@@ -644,8 +644,8 @@ ROM_END
static DRIVER_INIT( thief )
{
- UINT8 *dest = machine->region( "maincpu" )->base();
- const UINT8 *source = machine->region( "cpu1" )->base();
+ UINT8 *dest = machine.region( "maincpu" )->base();
+ const UINT8 *source = machine.region( "cpu1" )->base();
/* C8 is mapped (banked) in CPU1's address space; it contains Z80 code */
memcpy( &dest[0xe010], &source[0x290], 0x20 );
diff --git a/src/mame/drivers/thoop2.c b/src/mame/drivers/thoop2.c
index fa04fc6e1d5..20b6caaed2e 100644
--- a/src/mame/drivers/thoop2.c
+++ b/src/mame/drivers/thoop2.c
@@ -51,7 +51,7 @@ GFXDECODE_END
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
@@ -64,11 +64,11 @@ static WRITE16_HANDLER( thoop2_coin_w )
switch ((offset >> 3)){
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w(space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w(space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
break;
}
}
diff --git a/src/mame/drivers/thunderj.c b/src/mame/drivers/thunderj.c
index c58ed89375f..53fa06e20b6 100644
--- a/src/mame/drivers/thunderj.c
+++ b/src/mame/drivers/thunderj.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "extra", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( thunderj )
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
atarigen_init(machine);
state->save_item(NAME(state->alpha_tile_bank));
@@ -51,11 +51,11 @@ static MACHINE_START( thunderj )
static MACHINE_RESET( thunderj )
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 2);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 2);
atarijsa_reset();
}
@@ -69,8 +69,8 @@ static MACHINE_RESET( thunderj )
static READ16_HANDLER( special_port2_r )
{
- thunderj_state *state = space->machine->driver_data<thunderj_state>();
- int result = input_port_read(space->machine, "260012");
+ thunderj_state *state = space->machine().driver_data<thunderj_state>();
+ int result = input_port_read(space->machine(), "260012");
if (state->sound_to_cpu_ready) result ^= 0x0004;
if (state->cpu_to_sound_ready) result ^= 0x0008;
@@ -82,21 +82,21 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( latch_w )
{
- thunderj_state *state = space->machine->driver_data<thunderj_state>();
+ thunderj_state *state = space->machine().driver_data<thunderj_state>();
/* reset extra CPU */
if (ACCESSING_BITS_0_7)
{
/* 0 means hold CPU 2's reset low */
if (data & 1)
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, ASSERT_LINE);
/* bits 2-5 are the alpha bank */
if (state->alpha_tile_bank != ((data >> 2) & 7))
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
tilemap_mark_all_tiles_dirty(state->alpha_tilemap);
state->alpha_tile_bank = (data >> 2) & 7;
}
@@ -133,13 +133,13 @@ static READ16_HANDLER( thunderj_atarivc_r )
mame_printf_debug("You're screwed!");
#endif
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( thunderj_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c
index ccb7f82fcc8..1c3c181aabf 100644
--- a/src/mame/drivers/thunderx.c
+++ b/src/mame/drivers/thunderx.c
@@ -23,7 +23,7 @@ static KONAMI_SETLINES_CALLBACK( thunderx_banking );
static INTERRUPT_GEN( scontra_interrupt )
{
- thunderx_state *state = device->machine->driver_data<thunderx_state>();
+ thunderx_state *state = device->machine().driver_data<thunderx_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -31,23 +31,23 @@ static INTERRUPT_GEN( scontra_interrupt )
static TIMER_CALLBACK( thunderx_firq_callback )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
device_set_input_line(state->maincpu, KONAMI_FIRQ_LINE, HOLD_LINE);
}
static READ8_HANDLER( scontra_bankedram_r )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( scontra_bankedram_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -57,7 +57,7 @@ static WRITE8_HANDLER( scontra_bankedram_w )
static READ8_HANDLER( thunderx_bankedram_r )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (state->rambank & 0x01)
return state->ram[offset];
@@ -75,12 +75,12 @@ static READ8_HANDLER( thunderx_bankedram_r )
}
}
else
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static WRITE8_HANDLER( thunderx_bankedram_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (state->rambank & 0x01)
state->ram[offset] = data;
@@ -185,9 +185,9 @@ this is the data written to internal ram on startup:
// +3 : x (2 pixel units) of center of object
// +4 : y (2 pixel units) of center of object
-static void run_collisions( running_machine *machine, int s0, int e0, int s1, int e1, int cm, int hm )
+static void run_collisions( running_machine &machine, int s0, int e0, int s1, int e1, int cm, int hm )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
UINT8* p0;
UINT8* p1;
int ii, jj;
@@ -237,9 +237,9 @@ static void run_collisions( running_machine *machine, int s0, int e0, int s1, in
//
// emulates K052591 collision detection
-static void calculate_collisions( running_machine *machine )
+static void calculate_collisions( running_machine &machine )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
int X0,Y0;
int X1,Y1;
int CM,HM;
@@ -291,13 +291,13 @@ static void calculate_collisions( running_machine *machine )
static READ8_HANDLER( thunderx_1f98_r )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
return state->_1f98_data;
}
static WRITE8_HANDLER( thunderx_1f98_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
// logerror("%04x: 1f98_w %02x\n", cpu_get_pc(space->cpu),data);
@@ -310,10 +310,10 @@ static WRITE8_HANDLER( thunderx_1f98_w )
/* bit 2 = do collision detection when 0->1 */
if ((data & 4) && !(state->_1f98_data & 4))
{
- calculate_collisions(space->machine);
+ calculate_collisions(space->machine());
/* 100 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100), FUNC(thunderx_firq_callback));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(100), FUNC(thunderx_firq_callback));
}
state->_1f98_data = data;
@@ -321,22 +321,22 @@ static WRITE8_HANDLER( thunderx_1f98_w )
static WRITE8_HANDLER( scontra_bankswitch_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int offs;
//logerror("%04x: bank switch %02x\n",cpu_get_pc(space->cpu),data);
/* bits 0-3 ROM bank */
offs = 0x10000 + (data & 0x0f)*0x2000;
- memory_set_bankptr(space->machine, "bank1", &RAM[offs] );
+ memory_set_bankptr(space->machine(), "bank1", &RAM[offs] );
/* bit 4 select work RAM or palette RAM at 5800-5fff */
state->palette_selected = ~data & 0x10;
/* bits 5/6 coin counters */
- coin_counter_w(space->machine, 0, data & 0x20);
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x20);
+ coin_counter_w(space->machine(), 1, data & 0x40);
/* bit 7 controls layer priority */
state->priority = data & 0x80;
@@ -344,7 +344,7 @@ static WRITE8_HANDLER( scontra_bankswitch_w )
static WRITE8_HANDLER( thunderx_videobank_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
//logerror("%04x: select video ram bank %02x\n",cpu_get_pc(space->cpu),data);
/* 0x01 = work RAM at 4000-5fff */
/* 0x00 = palette at 5800-5fff */
@@ -352,8 +352,8 @@ static WRITE8_HANDLER( thunderx_videobank_w )
state->rambank = data;
/* bits 1/2 coin counters */
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
/* bit 3 controls layer priority (seems to be always 1) */
state->priority = data & 0x08;
@@ -361,7 +361,7 @@ static WRITE8_HANDLER( thunderx_videobank_w )
static WRITE8_HANDLER( thunderx_sh_irqtrigger_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -377,7 +377,7 @@ static WRITE8_DEVICE_HANDLER( scontra_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -394,7 +394,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- thunderx_state *state = space->machine->driver_data<thunderx_state>();
+ thunderx_state *state = space->machine().driver_data<thunderx_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -627,28 +627,28 @@ static const k051960_interface thunderx_k051960_intf =
static MACHINE_START( scontra )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->priority));
state->save_item(NAME(state->_1f98_data));
state->save_item(NAME(state->palette_selected));
state->save_item(NAME(state->rambank));
state->save_item(NAME(state->pmcbank));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x800);
}
static MACHINE_START( thunderx )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
memory_configure_bank(machine, "bank1", 12, 4, &ROM[0x08000], 0x2000);
@@ -663,7 +663,7 @@ static MACHINE_START( thunderx )
static MACHINE_RESET( scontra )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
state->priority = 0;
state->_1f98_data = 0;
@@ -674,7 +674,7 @@ static MACHINE_RESET( scontra )
static MACHINE_RESET( thunderx )
{
- konami_configure_set_lines(machine->device("maincpu"), thunderx_banking);
+ konami_configure_set_lines(machine.device("maincpu"), thunderx_banking);
MACHINE_RESET_CALL(scontra);
}
@@ -1017,7 +1017,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( thunderx_banking )
{
//logerror("thunderx %04x: bank select %02x\n", cpu_get_pc(device->cpu), lines);
- memory_set_bank(device->machine, "bank1", ((lines & 0x0f) ^ 0x08));
+ memory_set_bank(device->machine(), "bank1", ((lines & 0x0f) ^ 0x08));
}
GAME( 1988, scontra, 0, scontra, scontra, 0, ROT90, "Konami", "Super Contra", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tiamc1.c b/src/mame/drivers/tiamc1.c
index 78219943666..3efc821e824 100644
--- a/src/mame/drivers/tiamc1.c
+++ b/src/mame/drivers/tiamc1.c
@@ -120,14 +120,14 @@
static MACHINE_RESET( tiamc1 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
tiamc1_bankswitch_w(space, 0, 0);
}
static WRITE8_HANDLER( tiamc1_control_w )
{
- coin_lockout_w(space->machine, 0, ~data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x04);
+ coin_lockout_w(space->machine(), 0, ~data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x04);
}
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 52603bd30d4..449edc9b6d5 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -56,9 +56,9 @@ public:
*
*************************************/
-INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
+INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *y)
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
*x = (((input_port_read(machine, player ? "GUNX2" : "GUNX1") & 0xff) * (visarea.max_x - visarea.min_x)) >> 8) + visarea.min_x;
*y = (((input_port_read(machine, player ? "GUNY2" : "GUNY1") & 0xff) * (visarea.max_y - visarea.min_y)) >> 8) + visarea.min_y;
@@ -74,9 +74,9 @@ INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *
static TIMER_CALLBACK( trigger_gun_interrupt )
{
- tickee_state *state = machine->driver_data<tickee_state>();
+ tickee_state *state = machine.driver_data<tickee_state>();
int which = param & 1;
- int beamx = (machine->primary_screen->hpos()/2)-58;
+ int beamx = (machine.primary_screen->hpos()/2)-58;
/* once we're ready to fire, set the X coordinate and assert the line */
state->gunx[which] = beamx;
@@ -95,11 +95,11 @@ static TIMER_CALLBACK( clear_gun_interrupt )
static TIMER_CALLBACK( setup_gun_interrupts )
{
- tickee_state *state = machine->driver_data<tickee_state>();
+ tickee_state *state = machine.driver_data<tickee_state>();
int beamx, beamy;
/* set a timer to do this again next frame */
- state->setup_gun_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->setup_gun_timer->adjust(machine.primary_screen->time_until_pos(0));
/* only do work if the palette is flashed */
if (state->control)
@@ -108,13 +108,13 @@ static TIMER_CALLBACK( setup_gun_interrupts )
/* generate interrupts for player 1's gun */
get_crosshair_xy(machine, 0, &beamx, &beamy);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + state->beamyadd, beamx + state->beamxadd), FUNC(trigger_gun_interrupt), 0);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + state->beamyadd + 1, beamx + state->beamxadd), FUNC(clear_gun_interrupt), 0);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(beamy + state->beamyadd, beamx + state->beamxadd), FUNC(trigger_gun_interrupt), 0);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(beamy + state->beamyadd + 1, beamx + state->beamxadd), FUNC(clear_gun_interrupt), 0);
/* generate interrupts for player 2's gun */
get_crosshair_xy(machine, 1, &beamx, &beamy);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + state->beamyadd, beamx + state->beamxadd), FUNC(trigger_gun_interrupt), 1);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + state->beamyadd + 1, beamx + state->beamxadd), FUNC(clear_gun_interrupt), 1);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(beamy + state->beamyadd, beamx + state->beamxadd), FUNC(trigger_gun_interrupt), 1);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(beamy + state->beamyadd + 1, beamx + state->beamxadd), FUNC(clear_gun_interrupt), 1);
}
@@ -127,10 +127,10 @@ static TIMER_CALLBACK( setup_gun_interrupts )
static VIDEO_START( tickee )
{
- tickee_state *state = machine->driver_data<tickee_state>();
+ tickee_state *state = machine.driver_data<tickee_state>();
/* start a timer going on the first scanline of every frame */
- state->setup_gun_timer = machine->scheduler().timer_alloc(FUNC(setup_gun_interrupts));
- state->setup_gun_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->setup_gun_timer = machine.scheduler().timer_alloc(FUNC(setup_gun_interrupts));
+ state->setup_gun_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -143,10 +143,10 @@ static VIDEO_START( tickee )
static void scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- tickee_state *state = screen.machine->driver_data<tickee_state>();
+ tickee_state *state = screen.machine().driver_data<tickee_state>();
UINT16 *src = &state->vram[(params->rowaddr << 8) & 0x3ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr << 1;
int x;
@@ -169,10 +169,10 @@ static void scanline_update(screen_device &screen, bitmap_t *bitmap, int scanlin
static void rapidfir_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- tickee_state *state = screen.machine->driver_data<tickee_state>();
+ tickee_state *state = screen.machine().driver_data<tickee_state>();
UINT16 *src = &state->vram[(params->rowaddr << 8) & 0x3ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr << 1;
int x;
@@ -206,14 +206,14 @@ static void rapidfir_scanline_update(screen_device &screen, bitmap_t *bitmap, in
static MACHINE_RESET( tickee )
{
- tickee_state *state = machine->driver_data<tickee_state>();
+ tickee_state *state = machine.driver_data<tickee_state>();
state->beamxadd = 50;
state->beamyadd = 0;
}
static MACHINE_RESET( rapidfir )
{
- tickee_state *state = machine->driver_data<tickee_state>();
+ tickee_state *state = machine.driver_data<tickee_state>();
state->beamxadd = 0;
state->beamyadd = -5;
}
@@ -227,7 +227,7 @@ static MACHINE_RESET( rapidfir )
static WRITE16_HANDLER( rapidfir_transparent_w )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
if (!(data & 0xff00)) mem_mask &= 0x00ff;
if (!(data & 0x00ff)) mem_mask &= 0xff00;
COMBINE_DATA(&state->vram[offset]);
@@ -236,14 +236,14 @@ static WRITE16_HANDLER( rapidfir_transparent_w )
static READ16_HANDLER( rapidfir_transparent_r )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
return state->vram[offset];
}
static void rapidfir_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
if (address < 0x800000)
memcpy(shiftreg, &state->vram[TOWORD(address)], TOBYTE(0x2000));
}
@@ -251,7 +251,7 @@ static void rapidfir_to_shiftreg(address_space *space, UINT32 address, UINT16 *s
static void rapidfir_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
if (address < 0x800000)
memcpy(&state->vram[TOWORD(address)], shiftreg, TOBYTE(0x2000));
}
@@ -266,7 +266,7 @@ static void rapidfir_from_shiftreg(address_space *space, UINT32 address, UINT16
static WRITE16_HANDLER( tickee_control_w )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
UINT16 olddata = state->control[offset];
/* offsets:
@@ -280,8 +280,8 @@ static WRITE16_HANDLER( tickee_control_w )
if (offset == 3)
{
- ticket_dispenser_w(space->machine->device("ticket1"), 0, (data & 8) << 4);
- ticket_dispenser_w(space->machine->device("ticket2"), 0, (data & 4) << 5);
+ ticket_dispenser_w(space->machine().device("ticket1"), 0, (data & 8) << 4);
+ ticket_dispenser_w(space->machine().device("ticket2"), 0, (data & 4) << 5);
}
if (olddata != state->control[offset])
@@ -304,14 +304,14 @@ static READ16_HANDLER( ffff_r )
static READ16_HANDLER( rapidfir_gun1_r )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
return state->gunx[0];
}
static READ16_HANDLER( rapidfir_gun2_r )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
return state->gunx[1];
}
@@ -329,7 +329,7 @@ static WRITE16_HANDLER( ff7f_w )
static WRITE16_HANDLER( rapidfir_control_w )
{
- tickee_state *state = space->machine->driver_data<tickee_state>();
+ tickee_state *state = space->machine().driver_data<tickee_state>();
/* other bits like control on tickee? */
if (ACCESSING_BITS_0_7)
state->palette_bank = data & 1;
diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c
index 5a123e6e3d5..91ad5e6e5f7 100644
--- a/src/mame/drivers/tigeroad.c
+++ b/src/mame/drivers/tigeroad.c
@@ -81,7 +81,7 @@ static const int f1dream_2450_lookup[32] = {
static void f1dream_protection_w(address_space *space)
{
- tigeroad_state *state = space->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
int indx;
int value = 255;
int prevpc = cpu_get_previouspc(space->cpu);
@@ -145,7 +145,7 @@ static void f1dream_protection_w(address_space *space)
static WRITE16_HANDLER( f1dream_control_w )
{
- tigeroad_state *state = space->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
logerror("protection write, PC: %04x FFE1 Value:%01x\n",cpu_get_pc(space->cpu), state->ram16[0x3fe0/2]);
f1dream_protection_w(space);
}
@@ -495,7 +495,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -766,12 +766,12 @@ ROM_END
static DRIVER_INIT( tigeroad )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe4002, 0xfe4003, FUNC(tigeroad_soundcmd_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe4002, 0xfe4003, FUNC(tigeroad_soundcmd_w));
}
static DRIVER_INIT( f1dream )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe4002, 0xfe4003, FUNC(f1dream_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe4002, 0xfe4003, FUNC(f1dream_control_w));
}
diff --git a/src/mame/drivers/timelimt.c b/src/mame/drivers/timelimt.c
index 740785776ad..27327f7cc58 100644
--- a/src/mame/drivers/timelimt.c
+++ b/src/mame/drivers/timelimt.c
@@ -25,20 +25,20 @@ static MACHINE_START( timelimt )
static MACHINE_RESET( timelimt )
{
- timelimt_state *state = machine->driver_data<timelimt_state>();
+ timelimt_state *state = machine.driver_data<timelimt_state>();
state->nmi_enabled = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
state->nmi_enabled = data & 1; /* bit 0 = nmi enable */
}
static WRITE8_HANDLER( sound_reset_w )
{
if (data & 1)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
}
/***************************************************************************/
@@ -224,7 +224,7 @@ static const ay8910_interface ay8910_config =
static INTERRUPT_GEN( timelimt_irq )
{
- timelimt_state *state = device->machine->driver_data<timelimt_state>();
+ timelimt_state *state = device->machine().driver_data<timelimt_state>();
if ( state->nmi_enabled )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/timeplt.c b/src/mame/drivers/timeplt.c
index d47a07dd0d2..8a893d111ae 100644
--- a/src/mame/drivers/timeplt.c
+++ b/src/mame/drivers/timeplt.c
@@ -60,7 +60,7 @@
static INTERRUPT_GEN( timeplt_interrupt )
{
- timeplt_state *state = device->machine->driver_data<timeplt_state>();
+ timeplt_state *state = device->machine().driver_data<timeplt_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
@@ -69,7 +69,7 @@ static INTERRUPT_GEN( timeplt_interrupt )
static WRITE8_HANDLER( timeplt_nmi_enable_w )
{
- timeplt_state *state = space->machine->driver_data<timeplt_state>();
+ timeplt_state *state = space->machine().driver_data<timeplt_state>();
state->nmi_enable = data & 1;
if (!state->nmi_enable)
@@ -86,7 +86,7 @@ static WRITE8_HANDLER( timeplt_nmi_enable_w )
static WRITE8_HANDLER( timeplt_coin_counter_w )
{
- coin_counter_w(space->machine, offset >> 1, data);
+ coin_counter_w(space->machine(), offset >> 1, data);
}
@@ -356,14 +356,14 @@ GFXDECODE_END
static MACHINE_START( common )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
}
static MACHINE_START( timeplt )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
MACHINE_START_CALL(common);
@@ -372,7 +372,7 @@ static MACHINE_START( timeplt )
static MACHINE_RESET( timeplt )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
state->nmi_enable = 0;
}
diff --git a/src/mame/drivers/timetrv.c b/src/mame/drivers/timetrv.c
index 41105bed2b2..32a64adcbfb 100644
--- a/src/mame/drivers/timetrv.c
+++ b/src/mame/drivers/timetrv.c
@@ -46,20 +46,20 @@ static VIDEO_START( timetrv )
static SCREEN_UPDATE( timetrv )
{
- timetrv_state *state = screen->machine->driver_data<timetrv_state>();
+ timetrv_state *state = screen->machine().driver_data<timetrv_state>();
popmessage("%s%s",state->led_vram_lo,state->led_vram_hi);
return 0;
}
static READ8_HANDLER( test1_r )
{
- return input_port_read(space->machine, "IN0");//space->machine->rand();
+ return input_port_read(space->machine(), "IN0");//space->machine().rand();
}
static READ8_HANDLER( test2_r )
{
/*bit 7,eeprom read bit*/
- return (input_port_read(space->machine, "IN1") & 0x7f);//space->machine->rand();
+ return (input_port_read(space->machine(), "IN1") & 0x7f);//space->machine().rand();
}
@@ -70,7 +70,7 @@ static READ8_HANDLER( in_r )
static READ8_HANDLER( ld_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( timetrv_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index 9c460606b1b..35fb1a055f7 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -149,7 +149,7 @@ public:
static WRITE16_DEVICE_HANDLER( tmaster_oki_bank_w )
{
- tmaster_state *state = device->machine->driver_data<tmaster_state>();
+ tmaster_state *state = device->machine().driver_data<tmaster_state>();
if (ACCESSING_BITS_8_15)
{
// data & 0x0800?
@@ -171,7 +171,7 @@ static WRITE16_DEVICE_HANDLER( tmaster_oki_bank_w )
static void duart_irq_handler(device_t *device, UINT8 vector)
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 4, HOLD_LINE, vector);
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 4, HOLD_LINE, vector);
};
static void duart_tx(device_t *device, int channel, UINT8 data)
@@ -182,9 +182,9 @@ static void duart_tx(device_t *device, int channel, UINT8 data)
}
};
-static void microtouch_tx(running_machine *machine, UINT8 data)
+static void microtouch_tx(running_machine &machine, UINT8 data)
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
duart68681_rx_data(state->duart68681, 0, data);
}
@@ -205,10 +205,10 @@ static UINT8 binary_to_BCD(UINT8 data)
static READ16_HANDLER(rtc_r)
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
system_time systime;
- space->machine->current_datetime(systime);
+ space->machine().current_datetime(systime);
state->rtc_ram[0x1] = binary_to_BCD(systime.local_time.second);
state->rtc_ram[0x2] = binary_to_BCD(systime.local_time.minute);
state->rtc_ram[0x3] = binary_to_BCD(systime.local_time.hour);
@@ -222,7 +222,7 @@ static READ16_HANDLER(rtc_r)
static WRITE16_HANDLER(rtc_w)
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
if ( offset == 0 )
{
state->rtc_ram[0x0] = data & 0xff;
@@ -290,13 +290,13 @@ static int galgames_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high
static VIDEO_START( tmaster )
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
int layer, buffer;
for (layer = 0; layer < 2; layer++)
{
for (buffer = 0; buffer < 2; buffer++)
{
- state->bitmap[layer][buffer] = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap[layer][buffer] = machine.primary_screen->alloc_compatible_bitmap();
bitmap_fill(state->bitmap[layer][buffer], NULL, 0xff);
}
}
@@ -306,28 +306,28 @@ static VIDEO_START( tmaster )
static VIDEO_START( galgames )
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
VIDEO_START_CALL( tmaster );
state->compute_addr = galgames_compute_addr;
}
static SCREEN_UPDATE( tmaster )
{
- tmaster_state *state = screen->machine->driver_data<tmaster_state>();
+ tmaster_state *state = screen->machine().driver_data<tmaster_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (layers_ctrl & 1) copybitmap_trans(bitmap, state->bitmap[0][(state->regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff);
if (layers_ctrl & 2) copybitmap_trans(bitmap, state->bitmap[1][(state->regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff);
@@ -337,22 +337,22 @@ static SCREEN_UPDATE( tmaster )
static WRITE16_HANDLER( tmaster_color_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
COMBINE_DATA( &state->color );
}
static WRITE16_HANDLER( tmaster_addr_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
COMBINE_DATA( &state->addr );
}
-static void tmaster_draw(running_machine *machine)
+static void tmaster_draw(running_machine &machine)
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, layer,buffer, color;
- UINT8 *gfxdata = machine->region( "blitter" )->base() + state->gfx_offs;
+ UINT8 *gfxdata = machine.region( "blitter" )->base() + state->gfx_offs;
UINT16 pen;
@@ -376,7 +376,7 @@ static void tmaster_draw(running_machine *machine)
#ifdef MAME_DEBUG
#if 0
- logerror("%s: blit w %03x, h %02x, x %03x, y %02x, src %06x, fill/addr %04x, repl/color %04x, mode %02x\n", machine->describe_context(),
+ logerror("%s: blit w %03x, h %02x, x %03x, y %02x, src %06x, fill/addr %04x, repl/color %04x, mode %02x\n", machine.describe_context(),
sw,sh,sx,sy, addr, state->addr, state->color, mode
);
#endif
@@ -401,7 +401,7 @@ static void tmaster_draw(running_machine *machine)
case 0x00: // blit with transparency
if (addr > state->gfx_size - sw*sh)
{
- logerror("%s: blit error, addr %06x out of bounds\n", machine->describe_context(),addr);
+ logerror("%s: blit error, addr %06x out of bounds\n", machine.describe_context(),addr);
addr = state->gfx_size - sw*sh;
}
@@ -464,13 +464,13 @@ static void tmaster_draw(running_machine *machine)
static WRITE16_HANDLER( tmaster_blitter_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
COMBINE_DATA( state->regs + offset );
switch (offset*2)
{
case 0x0e:
- tmaster_draw(space->machine);
- cputag_set_input_line(space->machine, "maincpu", 2, HOLD_LINE);
+ tmaster_draw(space->machine());
+ cputag_set_input_line(space->machine(), "maincpu", 2, HOLD_LINE);
break;
}
}
@@ -492,7 +492,7 @@ static READ16_HANDLER( tmaster_blitter_r )
static READ16_HANDLER( tmaster_coins_r )
{
- return input_port_read(space->machine, "COIN")|(space->machine->rand()&0x0800);
+ return input_port_read(space->machine(), "COIN")|(space->machine().rand()&0x0800);
}
static ADDRESS_MAP_START( tmaster_map, AS_PROGRAM, 16 )
@@ -566,21 +566,21 @@ static const char *const galgames_eeprom_names[5] = { GALGAMES_EEPROM_BIOS, GALG
static READ16_HANDLER( galgames_eeprom_r )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
- device_t *eeprom = space->machine->device(galgames_eeprom_names[state->galgames_cart]);
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
+ device_t *eeprom = space->machine().device(galgames_eeprom_names[state->galgames_cart]);
return eeprom_read_bit(eeprom) ? 0x80 : 0x00;
}
static WRITE16_HANDLER( galgames_eeprom_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
if (data & ~0x0003)
logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(space->cpu),data);
if ( ACCESSING_BITS_0_7 )
{
- device_t *eeprom = space->machine->device(galgames_eeprom_names[state->galgames_cart]);
+ device_t *eeprom = space->machine().device(galgames_eeprom_names[state->galgames_cart]);
// latch the bit
eeprom_write_bit(eeprom, data & 0x0001);
@@ -594,7 +594,7 @@ static WRITE16_HANDLER( galgames_eeprom_w )
static WRITE16_HANDLER( galgames_palette_offset_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
if (ACCESSING_BITS_0_7)
{
state->palette_offset = data & 0xff;
@@ -603,7 +603,7 @@ static WRITE16_HANDLER( galgames_palette_offset_w )
}
static WRITE16_HANDLER( galgames_palette_data_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
if (ACCESSING_BITS_0_7)
{
state->palette_data[state->palette_index] = data & 0xff;
@@ -611,7 +611,7 @@ static WRITE16_HANDLER( galgames_palette_data_w )
{
int palette_base;
for (palette_base = 0; palette_base < 0x1000; palette_base += 0x100)
- palette_set_color(space->machine, state->palette_offset + palette_base, MAKE_RGB(state->palette_data[0], state->palette_data[1], state->palette_data[2]));
+ palette_set_color(space->machine(), state->palette_offset + palette_base, MAKE_RGB(state->palette_data[0], state->palette_data[1], state->palette_data[2]));
state->palette_index = 0;
state->palette_offset++;
}
@@ -621,19 +621,19 @@ static WRITE16_HANDLER( galgames_palette_data_w )
// Sound
static READ16_HANDLER( galgames_okiram_r )
{
- return space->machine->region("oki")->base()[offset] | 0xff00;
+ return space->machine().region("oki")->base()[offset] | 0xff00;
}
static WRITE16_HANDLER( galgames_okiram_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->region("oki")->base()[offset] = data & 0xff;
+ space->machine().region("oki")->base()[offset] = data & 0xff;
}
// Carts (preliminary, PIC communication is not implemented)
-static void galgames_update_rombank(running_machine *machine, UINT32 cart)
+static void galgames_update_rombank(running_machine &machine, UINT32 cart)
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
state->galgames_cart = cart;
state->gfx_offs = 0x200000 * cart;
@@ -656,7 +656,7 @@ static WRITE16_HANDLER( galgames_cart_sel_w )
{
case 0x07: // 7 resets the eeprom
for (i = 0; i < 5; i++)
- eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[i]), ASSERT_LINE);
+ eeprom_set_cs_line(space->machine().device(galgames_eeprom_names[i]), ASSERT_LINE);
break;
case 0x00:
@@ -664,13 +664,13 @@ static WRITE16_HANDLER( galgames_cart_sel_w )
case 0x02:
case 0x03:
case 0x04:
- eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[data & 0xff]), CLEAR_LINE);
- galgames_update_rombank(space->machine, data & 0xff);
+ eeprom_set_cs_line(space->machine().device(galgames_eeprom_names[data & 0xff]), CLEAR_LINE);
+ galgames_update_rombank(space->machine(), data & 0xff);
break;
default:
- eeprom_set_cs_line(space->machine->device(galgames_eeprom_names[0]), CLEAR_LINE);
- galgames_update_rombank(space->machine, 0);
+ eeprom_set_cs_line(space->machine().device(galgames_eeprom_names[0]), CLEAR_LINE);
+ galgames_update_rombank(space->machine(), 0);
logerror("%06x: unknown cart sel = %04x\n", cpu_get_pc(space->cpu), data);
break;
}
@@ -684,7 +684,7 @@ static READ16_HANDLER( galgames_cart_clock_r )
static WRITE16_HANDLER( galgames_cart_clock_w )
{
- tmaster_state *state = space->machine->driver_data<tmaster_state>();
+ tmaster_state *state = space->machine().driver_data<tmaster_state>();
if (ACCESSING_BITS_0_7)
{
// bit 3 = clock
@@ -692,14 +692,14 @@ static WRITE16_HANDLER( galgames_cart_clock_w )
// ROM/RAM banking
if ((data & 0xf7) == 0x05)
{
- memory_set_bank(space->machine, GALGAMES_BANK_000000_R, GALGAMES_RAM); // ram
- galgames_update_rombank(space->machine, state->galgames_cart);
+ memory_set_bank(space->machine(), GALGAMES_BANK_000000_R, GALGAMES_RAM); // ram
+ galgames_update_rombank(space->machine(), state->galgames_cart);
logerror("%06x: romram bank = %04x\n", cpu_get_pc(space->cpu), data);
}
else
{
- memory_set_bank(space->machine, GALGAMES_BANK_000000_R, GALGAMES_ROM0); // rom
- memory_set_bank(space->machine, GALGAMES_BANK_200000_R, GALGAMES_RAM); // ram
+ memory_set_bank(space->machine(), GALGAMES_BANK_000000_R, GALGAMES_ROM0); // rom
+ memory_set_bank(space->machine(), GALGAMES_BANK_200000_R, GALGAMES_RAM); // ram
logerror("%06x: unknown romram bank = %04x\n", cpu_get_pc(space->cpu), data);
}
}
@@ -869,11 +869,11 @@ static MACHINE_START( tmaster )
static MACHINE_RESET( tmaster )
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
state->gfx_offs = 0;
- state->gfx_size = machine->region("blitter")->bytes();
+ state->gfx_size = machine.region("blitter")->bytes();
- state->duart68681 = machine->device( "duart68681" );
+ state->duart68681 = machine.device( "duart68681" );
}
static INTERRUPT_GEN( tm3k_interrupt )
@@ -945,7 +945,7 @@ static INTERRUPT_GEN( galgames_interrupt )
static MACHINE_RESET( galgames )
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
state->gfx_offs = 0;
state->gfx_size = 0x200000;
@@ -959,7 +959,7 @@ static MACHINE_RESET( galgames )
galgames_update_rombank(machine, 0);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
}
static MACHINE_CONFIG_START( galgames, tmaster_state )
@@ -1620,7 +1620,7 @@ ROM_END
static DRIVER_INIT( tm4k )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x834ce/2] = 0x4e75;
@@ -1641,7 +1641,7 @@ Protection resembles that of tm5k rather than tm4ka:
static DRIVER_INIT( tm4ka )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x83476/2] = 0x4e75;
@@ -1663,7 +1663,7 @@ Protection starts:
static DRIVER_INIT( tm4kb )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x82b7a/2] = 0x4e75;
@@ -1684,7 +1684,7 @@ Protection starts:
static DRIVER_INIT( tm5k )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x96002/2] = 0x4e75;
@@ -1707,7 +1707,7 @@ Protection starts:
static DRIVER_INIT( tm5kca )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x95ffe/2] = 0x4e75;
@@ -1719,7 +1719,7 @@ static DRIVER_INIT( tm5kca )
static DRIVER_INIT( tm5ka )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x96b30/2] = 0x4e75;
@@ -1740,7 +1740,7 @@ Protection starts:
static DRIVER_INIT( tm7k )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x81730/2] = 0x4e75;
@@ -1763,7 +1763,7 @@ Protection starts:
static DRIVER_INIT( tm7ka )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x81594/2] = 0x4e75;
@@ -1786,7 +1786,7 @@ Protection starts:
static DRIVER_INIT( tm7keval ) /* kit came with a security key labeled A-21657-004, which is a TM5000 key */
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x8949e/2] = 0x4e75;
@@ -1809,7 +1809,7 @@ Protection starts:
static DRIVER_INIT( tm8k )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// protection
ROM[0x78b70/2] = 0x4e75;
@@ -1832,8 +1832,8 @@ Protection starts:
static DRIVER_INIT( galgames )
{
- tmaster_state *state = machine->driver_data<tmaster_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ tmaster_state *state = machine.driver_data<tmaster_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
int cart;
// RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff
@@ -1855,9 +1855,9 @@ static DRIVER_INIT( galgames )
for (cart = 1; cart <= 4; cart++)
{
- UINT8 *CART = machine->region("maincpu")->base();
+ UINT8 *CART = machine.region("maincpu")->base();
- if (0x200000 * (cart+1) <= machine->region("maincpu")->bytes())
+ if (0x200000 * (cart+1) <= machine.region("maincpu")->bytes())
CART += 0x200000 * cart;
memory_configure_bank(machine, GALGAMES_BANK_200000_R, GALGAMES_ROM0+cart, 1, CART, 0x40000);
@@ -1867,7 +1867,7 @@ static DRIVER_INIT( galgames )
static DRIVER_INIT( galgame2 )
{
- UINT16 *ROM = (UINT16 *)machine->region( "maincpu" )->base();
+ UINT16 *ROM = (UINT16 *)machine.region( "maincpu" )->base();
// Patch BIOS to see the game code as first cartridge (until the PIC therein is emulated)
ROM[0x118da/2] = 0x4a06;
diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c
index 019190b8ede..6e3006bb9c5 100644
--- a/src/mame/drivers/tmmjprd.c
+++ b/src/mame/drivers/tmmjprd.c
@@ -55,7 +55,7 @@ public:
static WRITE32_HANDLER( tmmjprd_tilemap0_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
COMBINE_DATA(&state->tilemap_ram[0][offset]);
}
@@ -63,27 +63,27 @@ static WRITE32_HANDLER( tmmjprd_tilemap0_w )
static WRITE32_HANDLER( tmmjprd_tilemap1_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
COMBINE_DATA(&state->tilemap_ram[1][offset]);
}
static WRITE32_HANDLER( tmmjprd_tilemap2_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
COMBINE_DATA(&state->tilemap_ram[2][offset]);
}
static WRITE32_HANDLER( tmmjprd_tilemap3_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
COMBINE_DATA(&state->tilemap_ram[3][offset]);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int screen)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int screen)
{
- tmmjprd_state *state = machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
int xpos,ypos,tileno,xflip,yflip, colr;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
int xoffs;
// int todraw = (state->spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
@@ -156,7 +156,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
}
-static void ttmjprd_draw_tile(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
+static void ttmjprd_draw_tile(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
{
/* note, it's tile address _NOT_ tile number, 'sub-tile' access is possible, hence using the custom rendering */
int tileaddr = (tiledata&0x000fffff)>>0;
@@ -235,7 +235,7 @@ static void ttmjprd_draw_tile(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void ttmjprd_draw_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
+static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
{
int y,x;
int count;
@@ -278,24 +278,24 @@ static void ttmjprd_draw_tilemap(running_machine *machine, bitmap_t *bitmap, con
static SCREEN_UPDATE( tmmjprd )
{
- tmmjprd_state *state = screen->machine->driver_data<tmmjprd_state>();
- UINT8* gfxroms = screen->machine->region("gfx2")->base();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ tmmjprd_state *state = screen->machine().driver_data<tmmjprd_state>();
+ UINT8* gfxroms = screen->machine().region("gfx2")->base();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (screen == left_screen)
{
- ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, state->tilemap_ram[3], state->tilemap_regs[3], gfxroms );
- draw_sprites(screen->machine,bitmap,cliprect, 1);
- ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, state->tilemap_ram[2], state->tilemap_regs[2], gfxroms );
+ ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->tilemap_ram[3], state->tilemap_regs[3], gfxroms );
+ draw_sprites(screen->machine(),bitmap,cliprect, 1);
+ ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->tilemap_ram[2], state->tilemap_regs[2], gfxroms );
}
if (screen == right_screen)
{
- ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, state->tilemap_ram[1], state->tilemap_regs[1], gfxroms );
- draw_sprites(screen->machine,bitmap,cliprect, 0);
- ttmjprd_draw_tilemap( screen->machine, bitmap, cliprect, state->tilemap_ram[0], state->tilemap_regs[0], gfxroms );
+ ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->tilemap_ram[1], state->tilemap_regs[1], gfxroms );
+ draw_sprites(screen->machine(),bitmap,cliprect, 0);
+ ttmjprd_draw_tilemap( screen->machine(), bitmap, cliprect, state->tilemap_ram[0], state->tilemap_regs[0], gfxroms );
}
/*
@@ -324,7 +324,7 @@ static SCREEN_UPDATE( tmmjprd )
static VIDEO_START(tmmjprd)
{
- tmmjprd_state *state = machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
/* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */
/* or maybe not for this game/hw .... */
state->tilemap_ram[0] = auto_alloc_array_clear(machine, UINT32, 0x8000);
@@ -335,31 +335,31 @@ static VIDEO_START(tmmjprd)
static READ32_HANDLER( tmmjprd_tilemap0_r )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
return state->tilemap_ram[0][offset];
}
static READ32_HANDLER( tmmjprd_tilemap1_r )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
return state->tilemap_ram[1][offset];
}
static READ32_HANDLER( tmmjprd_tilemap2_r )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
return state->tilemap_ram[2][offset];
}
static READ32_HANDLER( tmmjprd_tilemap3_r )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
return state->tilemap_ram[3][offset];
}
static READ32_HANDLER( randomtmmjprds )
{
- return 0x0000;//space->machine->rand();
+ return 0x0000;//space->machine().rand();
}
@@ -372,10 +372,10 @@ static TIMER_CALLBACK( tmmjprd_blit_done )
cputag_set_input_line(machine, "maincpu", 3, HOLD_LINE);
}
-static void tmmjprd_do_blit(running_machine *machine)
+static void tmmjprd_do_blit(running_machine &machine)
{
- tmmjprd_state *state = machine->driver_data<tmmjprd_state>();
- UINT8 *blt_data = machine->region("gfx1")->base();
+ tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
+ UINT8 *blt_data = machine.region("gfx1")->base();
int blt_source = (tmmjprd_blitterregs[0]&0x000fffff)>>0;
int blt_column = (tmmjprd_blitterregs[1]&0x00ff0000)>>16;
int blt_line = (tmmjprd_blitterregs[1]&0x000000ff);
@@ -417,7 +417,7 @@ static void tmmjprd_do_blit(running_machine *machine)
if (!blt_amount)
{
if(BLITLOG) mame_printf_debug("end of blit list\n");
- machine->scheduler().timer_set(attotime::from_usec(500), FUNC(tmmjprd_blit_done));
+ machine.scheduler().timer_set(attotime::from_usec(500), FUNC(tmmjprd_blit_done));
return;
}
@@ -474,7 +474,7 @@ static WRITE32_HANDLER( tmmjprd_blitter_w )
if (offset == 0x0c/4)
{
- tmmjprd_do_blit(space->machine);
+ tmmjprd_do_blit(space->machine());
}
}
#endif
@@ -482,7 +482,7 @@ static WRITE32_HANDLER( tmmjprd_blitter_w )
static WRITE32_DEVICE_HANDLER( tmmjprd_eeprom_write )
{
- tmmjprd_state *state = device->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = device->machine().driver_data<tmmjprd_state>();
// don't disturb the EEPROM if we're not actually writing to it
// (in particular, data & 0x100 here with mask = ffff00ff looks to be the watchdog)
if (mem_mask == 0x000000ff)
@@ -503,17 +503,17 @@ static WRITE32_DEVICE_HANDLER( tmmjprd_eeprom_write )
static READ32_HANDLER( tmmjprd_mux_r )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
- state->system_in = input_port_read(space->machine, "SYSTEM");
+ state->system_in = input_port_read(space->machine(), "SYSTEM");
switch(state->mux_data)
{
- case 0x01: return (state->system_in & 0xff) | (input_port_read(space->machine, "PL1_1")<<8) | (input_port_read(space->machine, "PL2_1")<<16) | 0xff000000;
- case 0x02: return (state->system_in & 0xff) | (input_port_read(space->machine, "PL1_2")<<8) | (input_port_read(space->machine, "PL2_2")<<16) | 0xff000000;
- case 0x04: return (state->system_in & 0xff) | (input_port_read(space->machine, "PL1_3")<<8) | (input_port_read(space->machine, "PL2_3")<<16) | 0xff000000;
- case 0x08: return (state->system_in & 0xff) | (input_port_read(space->machine, "PL1_4")<<8) | (input_port_read(space->machine, "PL2_4")<<16) | 0xff000000;
- case 0x10: return (state->system_in & 0xff) | (input_port_read(space->machine, "PL1_5")<<8) | (input_port_read(space->machine, "PL2_5")<<16) | 0xff000000;
+ case 0x01: return (state->system_in & 0xff) | (input_port_read(space->machine(), "PL1_1")<<8) | (input_port_read(space->machine(), "PL2_1")<<16) | 0xff000000;
+ case 0x02: return (state->system_in & 0xff) | (input_port_read(space->machine(), "PL1_2")<<8) | (input_port_read(space->machine(), "PL2_2")<<16) | 0xff000000;
+ case 0x04: return (state->system_in & 0xff) | (input_port_read(space->machine(), "PL1_3")<<8) | (input_port_read(space->machine(), "PL2_3")<<16) | 0xff000000;
+ case 0x08: return (state->system_in & 0xff) | (input_port_read(space->machine(), "PL1_4")<<8) | (input_port_read(space->machine(), "PL2_4")<<16) | 0xff000000;
+ case 0x10: return (state->system_in & 0xff) | (input_port_read(space->machine(), "PL1_5")<<8) | (input_port_read(space->machine(), "PL2_5")<<16) | 0xff000000;
}
return (state->system_in & 0xff) | 0xffffff00;
@@ -609,13 +609,13 @@ INPUT_PORTS_END
static WRITE32_HANDLER( tmmjprd_paletteram_dword_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x000000ff) >>0);
- r = ((space->machine->generic.paletteram.u32[offset] & 0x0000ff00) >>8);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x00ff0000) >>16);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x000000ff) >>0);
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x0000ff00) >>8);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x00ff0000) >>16);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
@@ -623,7 +623,7 @@ static WRITE32_HANDLER( tmmjprd_paletteram_dword_w )
* My wild guess is that bits 0,1 and 2 controls what palette entries to dim. */
static WRITE32_HANDLER( tmmjprd_brt_1_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
int i;
double brt;
int bank;
@@ -636,13 +636,13 @@ static WRITE32_HANDLER( tmmjprd_brt_1_w )
{
state->old_brt1 = brt;
for (i = bank; i < 0x800+bank; i++)
- palette_set_pen_contrast(space->machine, i, brt);
+ palette_set_pen_contrast(space->machine(), i, brt);
}
}
static WRITE32_HANDLER( tmmjprd_brt_2_w )
{
- tmmjprd_state *state = space->machine->driver_data<tmmjprd_state>();
+ tmmjprd_state *state = space->machine().driver_data<tmmjprd_state>();
int i;
double brt;
int bank;
@@ -655,7 +655,7 @@ static WRITE32_HANDLER( tmmjprd_brt_2_w )
{
state->old_brt2 = brt;
for (i = bank; i < 0x800+bank; i++)
- palette_set_pen_contrast(space->machine, i, brt);
+ palette_set_pen_contrast(space->machine(), i, brt);
}
}
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index fd397d6338f..5f0e5595c35 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -83,7 +83,7 @@ Updates:
static READ16_HANDLER( k052109_word_noA12_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
/* some games have the A12 line not connected, so the chip spans */
/* twice the memory range, with mirroring */
@@ -93,7 +93,7 @@ static READ16_HANDLER( k052109_word_noA12_r )
static WRITE16_HANDLER( k052109_word_noA12_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
/* some games have the A12 line not connected, so the chip spans */
/* twice the memory range, with mirroring */
@@ -103,7 +103,7 @@ static WRITE16_HANDLER( k052109_word_noA12_w )
static WRITE16_HANDLER( punkshot_k052109_word_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
/* it seems that a word write is supposed to affect only the MSB. The */
/* "ROUND 1" text in punkshtj goes lost otherwise. */
@@ -127,7 +127,7 @@ static WRITE16_HANDLER( punkshot_k052109_word_noA12_w )
/* A1, A5 and A6 don't go to the 053245. */
static READ16_HANDLER( k053245_scattered_word_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (offset & 0x0031)
return state->spriteram[offset];
@@ -140,7 +140,7 @@ static READ16_HANDLER( k053245_scattered_word_r )
static WRITE16_HANDLER( k053245_scattered_word_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
COMBINE_DATA(state->spriteram + offset);
@@ -153,7 +153,7 @@ static WRITE16_HANDLER( k053245_scattered_word_w )
static READ16_HANDLER( k053244_word_noA1_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
offset &= ~1; /* handle mirror address */
@@ -162,7 +162,7 @@ static READ16_HANDLER( k053244_word_noA1_r )
static WRITE16_HANDLER( k053244_word_noA1_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
offset &= ~1; /* handle mirror address */
@@ -174,7 +174,7 @@ static WRITE16_HANDLER( k053244_word_noA1_w )
static INTERRUPT_GEN(cuebrick_interrupt)
{
- tmnt_state *state = device->machine->driver_data<tmnt_state>();
+ tmnt_state *state = device->machine().driver_data<tmnt_state>();
// cheap IRQ multiplexing to avoid losing sound IRQs
switch (cpu_getiloops(device))
@@ -192,7 +192,7 @@ static INTERRUPT_GEN(cuebrick_interrupt)
static INTERRUPT_GEN( punkshot_interrupt )
{
- tmnt_state *state = device->machine->driver_data<tmnt_state>();
+ tmnt_state *state = device->machine().driver_data<tmnt_state>();
if (k052109_is_irq_enabled(state->k052109))
irq4_line_hold(device);
@@ -200,7 +200,7 @@ static INTERRUPT_GEN( punkshot_interrupt )
static INTERRUPT_GEN( lgtnfght_interrupt )
{
- tmnt_state *state = device->machine->driver_data<tmnt_state>();
+ tmnt_state *state = device->machine().driver_data<tmnt_state>();
if (k052109_is_irq_enabled(state->k052109))
irq5_line_hold(device);
@@ -223,7 +223,7 @@ static READ8_DEVICE_HANDLER( punkshot_sound_r )
static WRITE8_DEVICE_HANDLER( glfgreat_sound_w )
{
- tmnt_state *state = device->machine->driver_data<tmnt_state>();
+ tmnt_state *state = device->machine().driver_data<tmnt_state>();
k053260_w(device, offset, data);
if (offset)
@@ -249,25 +249,25 @@ static WRITE16_HANDLER( prmrsocr_sound_cmd_w )
static WRITE16_HANDLER( prmrsocr_sound_irq_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( prmrsocr_audio_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 7);
+ memory_set_bank(space->machine(), "bank1", data & 7);
}
static READ8_HANDLER( tmnt_sres_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
return state->tmnt_soundlatch;
}
static WRITE8_HANDLER( tmnt_sres_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
/* bit 1 resets the UPD7795C sound chip */
upd7759_reset_w(state->upd, data & 2);
@@ -296,10 +296,10 @@ static READ8_DEVICE_HANDLER( tmnt_upd_busy_r )
static SAMPLES_START( tmnt_decode_sample )
{
- running_machine *machine = device->machine;
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ running_machine &machine = device->machine();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
int i;
- UINT8 *source = machine->region("title")->base();
+ UINT8 *source = machine.region("title")->base();
state->save_item(NAME(state->sampledata));
@@ -338,16 +338,16 @@ static void sound_nmi_callback( int param )
static TIMER_CALLBACK( nmi_callback )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
// sound_nmi_enabled = 1;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */
}
@@ -357,14 +357,14 @@ static READ16_HANDLER( punkshot_kludge_r )
/* 0xffffff, and returning 0 causes the game to mess up - locking up in a */
/* loop where the ball is continuously bouncing from the basket. Returning */
/* a random number seems to prevent that. */
- return space->machine->rand();
+ return space->machine().rand();
}
/* protection simulation derived from a bootleg */
static READ16_HANDLER( ssriders_protection_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int data = space->read_word(0x105a0a);
int cmd = space->read_word(0x1058fc);
@@ -408,7 +408,7 @@ static READ16_HANDLER( ssriders_protection_r )
static WRITE16_HANDLER( ssriders_protection_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (offset == 1)
{
@@ -454,12 +454,12 @@ static const eeprom_interface eeprom_intf =
static READ16_HANDLER( blswhstl_coin_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int res;
/* bit 3 is service button */
/* bit 6 is ??? VBLANK? OBJMPX? */
- res = input_port_read(space->machine, "COINS");
+ res = input_port_read(space->machine(), "COINS");
state->toggle ^= 0x40;
return res ^ state->toggle;
@@ -467,14 +467,14 @@ static READ16_HANDLER( blswhstl_coin_r )
static READ16_HANDLER( ssriders_eeprom_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int res;
/* bit 0 is EEPROM data */
/* bit 1 is EEPROM ready */
/* bit 2 is VBLANK (???) */
/* bit 7 is service button */
- res = input_port_read(space->machine, "EEPROM");
+ res = input_port_read(space->machine(), "EEPROM");
state->toggle ^= 0x04;
return res ^ state->toggle;
@@ -482,14 +482,14 @@ static READ16_HANDLER( ssriders_eeprom_r )
static READ16_HANDLER( sunsetbl_eeprom_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int res;
/* bit 0 is EEPROM data */
/* bit 1 is EEPROM ready */
/* bit 2 is VBLANK (???) */
/* bit 3 is service button */
- res = input_port_read(space->machine, "EEPROM");
+ res = input_port_read(space->machine(), "EEPROM");
state->toggle ^= 0x04;
return res ^ state->toggle;
@@ -502,7 +502,7 @@ static WRITE16_HANDLER( blswhstl_eeprom_w )
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -519,28 +519,28 @@ static const eeprom_interface thndrx2_eeprom_intf =
static READ16_HANDLER( thndrx2_eeprom_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int res;
/* bit 0 is EEPROM data */
/* bit 1 is EEPROM ready */
/* bit 3 is VBLANK (???) */
/* bit 7 is service button */
- res = input_port_read(space->machine, "P2/EEPROM");
+ res = input_port_read(space->machine(), "P2/EEPROM");
state->toggle ^= 0x0800;
return (res ^ state->toggle);
}
static WRITE16_HANDLER( thndrx2_eeprom_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
/* bit 5 triggers IRQ on sound cpu */
if (state->last == 0 && (data & 0x20) != 0)
@@ -564,25 +564,25 @@ static WRITE16_HANDLER( prmrsocr_eeprom_w )
/* bit 8 is data */
/* bit 9 is cs (active low) */
/* bit 10 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
}
static READ16_HANDLER( cuebrick_nv_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
return state->m_cuebrick_nvram[offset + (state->cuebrick_nvram_bank * 0x400 / 2)];
}
static WRITE16_HANDLER( cuebrick_nv_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
COMBINE_DATA(&state->m_cuebrick_nvram[offset + (state->cuebrick_nvram_bank * 0x400 / 2)]);
}
static WRITE16_HANDLER( cuebrick_nvbank_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
state->cuebrick_nvram_bank = data >> 8;
}
@@ -693,7 +693,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( ssriders_soundkludge_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
/* I think this is more than just a trigger */
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@@ -723,7 +723,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( k053251_glfgreat_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
int i;
if (ACCESSING_BITS_8_15)
@@ -791,9 +791,9 @@ ADDRESS_MAP_END
#if 1
-INLINE UINT32 tmnt2_get_word( running_machine *machine, UINT32 addr )
+INLINE UINT32 tmnt2_get_word( running_machine &machine, UINT32 addr )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
if (addr <= 0x07ffff / 2)
return(state->tmnt2_rom[addr]);
@@ -806,7 +806,7 @@ INLINE UINT32 tmnt2_get_word( running_machine *machine, UINT32 addr )
static void tmnt2_put_word( address_space *space, UINT32 addr, UINT16 data )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
UINT32 offs;
if (addr >= 0x180000 / 2 && addr <= 0x183fff / 2)
@@ -825,7 +825,7 @@ static void tmnt2_put_word( address_space *space, UINT32 addr, UINT16 data )
static WRITE16_HANDLER( tmnt2_1c0800_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
UINT32 src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color;
int xoffs, yoffs, xmod, ymod, zmod, xzoom, yzoom, i;
UINT16 *mcu;
@@ -847,9 +847,9 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
zlock = (mcu[8] & 0xff) == 0x0001;
for (i = 0; i < 4; i++)
- src[i] = tmnt2_get_word(space->machine, src_addr + i);
+ src[i] = tmnt2_get_word(space->machine(), src_addr + i);
for (i = 0; i < 24; i++) mod[i] =
- tmnt2_get_word(space->machine, mod_addr + i);
+ tmnt2_get_word(space->machine(), mod_addr + i);
code = src[0]; // code
@@ -946,7 +946,7 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
#else // for reference; do not remove
static WRITE16_HANDLER( tmnt2_1c0800_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
COMBINE_DATA(state->tmnt2_1c0800 + offset);
if (offset == 0x0008 && (state->tmnt2_1c0800[0x8] & 0xff00) == 0x8200)
{
@@ -961,7 +961,7 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
CellSrc = state->tmnt2_1c0800[0x00] | (state->tmnt2_1c0800[0x01] << 16 );
// if (CellDest >= 0x180000 && CellDest < 0x183fe0) {
CellVar -= 0x104000;
- src = (UINT16 *)(space->machine->region("maincpu")->base() + CellSrc);
+ src = (UINT16 *)(space->machine().region("maincpu")->base() + CellSrc);
CellVar >>= 1;
@@ -2061,7 +2061,7 @@ INPUT_PORTS_END
static void cuebrick_irq_handler( device_t *device, int state )
{
- tmnt_state *tmnt = device->machine->driver_data<tmnt_state>();
+ tmnt_state *tmnt = device->machine().driver_data<tmnt_state>();
tmnt->cuebrick_snd_irqlatch = state;
}
@@ -2231,21 +2231,21 @@ static const k053936_interface prmrsocr_k053936_interface =
static MACHINE_START( common )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k007232 = machine->device("k007232");
- state->k053260 = machine->device("k053260");
- state->k054539 = machine->device("k054539");
- state->upd = machine->device("upd");
- state->samples = machine->device("samples");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k053245 = machine->device("k053245");
- state->k053251 = machine->device("k053251");
- state->k053936 = machine->device("k053936");
- state->k054000 = machine->device("k054000");
+ tmnt_state *state = machine.driver_data<tmnt_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007232 = machine.device("k007232");
+ state->k053260 = machine.device("k053260");
+ state->k054539 = machine.device("k054539");
+ state->upd = machine.device("upd");
+ state->samples = machine.device("samples");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k053245 = machine.device("k053245");
+ state->k053251 = machine.device("k053251");
+ state->k053936 = machine.device("k053936");
+ state->k054000 = machine.device("k054000");
state->save_item(NAME(state->toggle));
state->save_item(NAME(state->last));
@@ -2260,7 +2260,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->toggle = 0;
state->last = 0;
@@ -2356,7 +2356,7 @@ MACHINE_CONFIG_END
static MACHINE_RESET( tmnt )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
/* the UPD7759 control flip-flops are cleared: /ST is 1, /RESET is 0 */
upd7759_start_w(state->upd, 0);
@@ -2616,7 +2616,7 @@ MACHINE_CONFIG_END
static void sound_nmi( device_t *device )
{
- tmnt_state *state = device->machine->driver_data<tmnt_state>();
+ tmnt_state *state = device->machine().driver_data<tmnt_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -2630,7 +2630,7 @@ static const k054539_interface k054539_config =
static MACHINE_START( prmrsocr )
{
MACHINE_START_CALL(common);
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
}
@@ -4111,8 +4111,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ gfxdata = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4132,8 +4132,8 @@ static DRIVER_INIT( mia )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ gfxdata = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4204,8 +4204,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051962 custom IC.
*/
- gfxdata = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ gfxdata = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4225,8 +4225,8 @@ static DRIVER_INIT( tmnt )
be shuffled around because the ROMs are connected differently to the
051937 custom IC.
*/
- gfxdata = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ gfxdata = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (i = 0; i < len; i += 4)
{
for (j = 0; j < 4; j++)
@@ -4243,7 +4243,7 @@ static DRIVER_INIT( tmnt )
temp = auto_alloc_array(machine, UINT8, len);
memcpy(temp, gfxdata, len);
- code_conv_table = &machine->region("proms")->base()[0x0000];
+ code_conv_table = &machine.region("proms")->base()[0x0000];
for (A = 0; A < len / 4; A++)
{
#define CA0 0
@@ -4298,8 +4298,8 @@ static DRIVER_INIT( tmnt )
static DRIVER_INIT( cuebrick )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
- machine->device<nvram_device>("nvram")->set_base(state->m_cuebrick_nvram, sizeof(state->m_cuebrick_nvram));
+ tmnt_state *state = machine.driver_data<tmnt_state>();
+ machine.device<nvram_device>("nvram")->set_base(state->m_cuebrick_nvram, sizeof(state->m_cuebrick_nvram));
}
GAME( 1989, cuebrick, 0, cuebrick, cuebrick, cuebrick, ROT0, "Konami", "Cue Brick (World version D)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 8c29355e416..a82a4351622 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -631,14 +631,14 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06
static SAMPLES_START( kageki_init_samples )
{
- running_machine *machine = device->machine;
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ running_machine &machine = device->machine();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
UINT8 *scan, *src;
INT16 *dest;
int start, size;
int i, n;
- src = machine->region("samples")->base() + 0x0090;
+ src = machine.region("samples")->base() + 0x0090;
for (i = 0; i < MAX_SAMPLES; i++)
{
start = (src[(i * 2) + 1] * 256) + src[(i * 2)];
@@ -676,11 +676,11 @@ static SAMPLES_START( kageki_init_samples )
static READ8_DEVICE_HANDLER( kageki_csport_r )
{
- tnzs_state *state = device->machine->driver_data<tnzs_state>();
+ tnzs_state *state = device->machine().driver_data<tnzs_state>();
int dsw, dsw1, dsw2;
- dsw1 = input_port_read(device->machine, "DSWA");
- dsw2 = input_port_read(device->machine, "DSWB");
+ dsw1 = input_port_read(device->machine(), "DSWA");
+ dsw2 = input_port_read(device->machine(), "DSWB");
switch (state->kageki_csport_sel)
{
@@ -706,7 +706,7 @@ static READ8_DEVICE_HANDLER( kageki_csport_r )
static WRITE8_DEVICE_HANDLER( kageki_csport_w )
{
- tnzs_state *state = device->machine->driver_data<tnzs_state>();
+ tnzs_state *state = device->machine().driver_data<tnzs_state>();
char mess[80];
if (data > 0x3f)
@@ -736,7 +736,7 @@ static WRITE8_DEVICE_HANDLER( kabukiz_sound_bank_w )
{
// to avoid the write when the sound chip is initialized
if (data != 0xff)
- memory_set_bank(device->machine, "bank3", data & 0x07);
+ memory_set_bank(device->machine(), "bank3", data & 0x07);
}
static WRITE8_DEVICE_HANDLER( kabukiz_sample_w )
@@ -805,7 +805,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tnzsb_sound_command_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -870,18 +870,18 @@ static WRITE8_HANDLER( jpopnics_palette_w )
{
int r, g, b;
UINT16 paldata;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
offset = offset >> 1;
- paldata = (space->machine->generic.paletteram.u8[offset * 2] << 8) | space->machine->generic.paletteram.u8[(offset * 2 + 1)];
+ paldata = (space->machine().generic.paletteram.u8[offset * 2] << 8) | space->machine().generic.paletteram.u8[(offset * 2 + 1)];
g = (paldata >> 12) & 0x000f;
r = (paldata >> 4) & 0x000f;
b = (paldata >> 8) & 0x000f;
// the other bits seem to be used, and the colours are wrong..
- palette_set_color_rgb(space->machine, offset, r << 4, g << 4, b << 4);
+ palette_set_color_rgb(space->machine(), offset, r << 4, g << 4, b << 4);
}
static ADDRESS_MAP_START( jpopnics_main_map, AS_PROGRAM, 8 )
@@ -900,7 +900,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( jpopnics_subbankswitch_w )
{
/* bits 0-1 select ROM bank */
- memory_set_bank(space->machine, "bank2", data & 0x03);
+ memory_set_bank(space->machine(), "bank2", data & 0x03);
}
static ADDRESS_MAP_START( jpopnics_sub_map, AS_PROGRAM, 8 )
@@ -1561,7 +1561,7 @@ static const ym2203_interface ym2203_config =
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- tnzs_state *state = device->machine->driver_data<tnzs_state>();
+ tnzs_state *state = device->machine().driver_data<tnzs_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/drivers/toaplan1.c b/src/mame/drivers/toaplan1.c
index 5aede3ddd35..d0080b2b929 100644
--- a/src/mame/drivers/toaplan1.c
+++ b/src/mame/drivers/toaplan1.c
@@ -1500,7 +1500,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index 338eef8c139..c07ec7b5108 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -363,10 +363,10 @@ To Do / Unknowns:
static MACHINE_START( toaplan2 )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
- state->main_cpu = machine->device("maincpu");
- state->sub_cpu = machine->device("audiocpu");
+ state->main_cpu = machine.device("maincpu");
+ state->sub_cpu = machine.device("audiocpu");
state->save_item(NAME(state->mcu_data));
state->save_item(NAME(state->video_status));
@@ -378,7 +378,7 @@ static MACHINE_START( toaplan2 )
static void toaplan2_reset(device_t *device)
{
- toaplan2_state *state = device->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = device->machine().driver_data<toaplan2_state>();
if (state->sub_cpu != NULL)
device_set_input_line(state->sub_cpu, INPUT_LINE_RESET, PULSE_LINE);
@@ -387,7 +387,7 @@ static void toaplan2_reset(device_t *device)
static MACHINE_RESET( toaplan2 )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->mcu_data = 0x00;
@@ -400,7 +400,7 @@ static MACHINE_RESET( toaplan2 )
static MACHINE_RESET( ghox )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
MACHINE_RESET_CALL(toaplan2);
state->old_p1_paddle_h = 0;
@@ -410,7 +410,7 @@ static MACHINE_RESET( ghox )
static DRIVER_INIT( dogyuun )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->v25_reset_line = 0x20;
}
@@ -418,7 +418,7 @@ static DRIVER_INIT( dogyuun )
static DRIVER_INIT( fixeight )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->v25_reset_line = 0x08;
}
@@ -426,7 +426,7 @@ static DRIVER_INIT( fixeight )
static DRIVER_INIT( fixeightbl )
{
- UINT8 *ROM = machine->region("oki")->base();
+ UINT8 *ROM = machine.region("oki")->base();
memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x30000], 0x10000);
}
@@ -434,7 +434,7 @@ static DRIVER_INIT( fixeightbl )
static DRIVER_INIT( vfive )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->v25_reset_line = 0x10;
}
@@ -444,7 +444,7 @@ static DRIVER_INIT( pipibibsbl )
{
int A;
int oldword, newword;
- UINT16 *pipibibi_68k_rom = (UINT16 *)(machine->region("maincpu")->base());
+ UINT16 *pipibibi_68k_rom = (UINT16 *)(machine.region("maincpu")->base());
// unscramble the 68K ROM data
@@ -521,7 +521,7 @@ static DRIVER_INIT( pipibibsbl )
static DRIVER_INIT( bgaregga )
{
- UINT8 *Z80 = machine->region("audiocpu")->base();
+ UINT8 *Z80 = machine.region("audiocpu")->base();
// seems to only use banks 0x0a to 0x0f
memory_configure_bank(machine, "bank1", 8, 8, Z80, 0x4000);
@@ -530,8 +530,8 @@ static DRIVER_INIT( bgaregga )
static DRIVER_INIT( batrider )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
- UINT8 *Z80 = machine->region("audiocpu")->base();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
+ UINT8 *Z80 = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, Z80, 0x4000);
state->sndirq_line = 4;
@@ -540,7 +540,7 @@ static DRIVER_INIT( batrider )
static DRIVER_INIT( bbakraid )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->sndirq_line = 2;
}
@@ -553,20 +553,20 @@ static DRIVER_INIT( bbakraid )
static TIMER_CALLBACK( toaplan2_raise_irq )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
device_set_input_line(state->main_cpu, param, HOLD_LINE);
}
-static void toaplan2_vblank_irq(running_machine *machine, int irq_line)
+static void toaplan2_vblank_irq(running_machine &machine, int irq_line)
{
// the IRQ appears to fire at line 0xe6
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0xe6), FUNC(toaplan2_raise_irq), irq_line);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0xe6), FUNC(toaplan2_raise_irq), irq_line);
}
-static INTERRUPT_GEN( toaplan2_vblank_irq1 ) { toaplan2_vblank_irq(device->machine, 1); }
-static INTERRUPT_GEN( toaplan2_vblank_irq2 ) { toaplan2_vblank_irq(device->machine, 2); }
-static INTERRUPT_GEN( toaplan2_vblank_irq4 ) { toaplan2_vblank_irq(device->machine, 4); }
+static INTERRUPT_GEN( toaplan2_vblank_irq1 ) { toaplan2_vblank_irq(device->machine(), 1); }
+static INTERRUPT_GEN( toaplan2_vblank_irq2 ) { toaplan2_vblank_irq(device->machine(), 2); }
+static INTERRUPT_GEN( toaplan2_vblank_irq4 ) { toaplan2_vblank_irq(device->machine(), 4); }
static READ16_HANDLER( video_count_r )
@@ -577,9 +577,9 @@ static READ16_HANDLER( video_count_r )
/* +---------+---------+--------+---------------------------+ */
/*************** Control Signals are active low ***************/
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
- int hpos = space->machine->primary_screen->hpos();
- int vpos = space->machine->primary_screen->vpos();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
+ int hpos = space->machine().primary_screen->hpos();
+ int vpos = space->machine().primary_screen->vpos();
state->video_status = 0xff00; // Set signals inactive
@@ -601,7 +601,7 @@ static READ16_HANDLER( video_count_r )
else
state->video_status |= 0xff;
-// logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,space->machine->primary_screen->vblank());
+// logerror("VC: vpos=%04x hpos=%04x VBL=%04x\n",vpos,hpos,space->machine().primary_screen->vblank());
return state->video_status;
}
@@ -615,14 +615,14 @@ static WRITE8_HANDLER( toaplan2_coin_w )
if (data & 0x0f)
{
- coin_lockout_w( space->machine, 0, ((data & 4) ? 0 : 1) );
- coin_lockout_w( space->machine, 1, ((data & 8) ? 0 : 1) );
- coin_counter_w( space->machine, 0, (data & 1) );
- coin_counter_w( space->machine, 1, (data & 2) );
+ coin_lockout_w( space->machine(), 0, ((data & 4) ? 0 : 1) );
+ coin_lockout_w( space->machine(), 1, ((data & 8) ? 0 : 1) );
+ coin_counter_w( space->machine(), 0, (data & 1) );
+ coin_counter_w( space->machine(), 1, (data & 2) );
}
else
{
- coin_lockout_global_w(space->machine, 1); // Lock all coin slots
+ coin_lockout_global_w(space->machine(), 1); // Lock all coin slots
}
if (data & 0xe0)
{
@@ -650,7 +650,7 @@ static WRITE16_HANDLER( toaplan2_v25_coin_word_w )
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
toaplan2_coin_w(space, offset, data & 0x0f);
@@ -668,7 +668,7 @@ static WRITE16_HANDLER( shippumd_coin_word_w )
if (ACCESSING_BITS_0_7)
{
toaplan2_coin_w(space, offset, data & 0xff);
- space->machine->device<okim6295_device>("oki")->set_bank_base(((data & 0x10) >> 4) * 0x40000);
+ space->machine().device<okim6295_device>("oki")->set_bank_base(((data & 0x10) >> 4) * 0x40000);
}
if (ACCESSING_BITS_8_15 && (data & 0xff00) )
{
@@ -679,7 +679,7 @@ static WRITE16_HANDLER( shippumd_coin_word_w )
static READ16_HANDLER( shared_ram_r )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
return state->shared_ram[offset];
}
@@ -689,7 +689,7 @@ static WRITE16_HANDLER( shared_ram_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
state->shared_ram[offset] = data;
}
@@ -703,7 +703,7 @@ static WRITE16_HANDLER( toaplan2_hd647180_cpu_w )
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
state->mcu_data = data & 0xff;
logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n", cpu_get_previouspc(space->cpu), state->mcu_data);
@@ -713,7 +713,7 @@ static WRITE16_HANDLER( toaplan2_hd647180_cpu_w )
static CUSTOM_INPUT( c2map_r )
{
- toaplan2_state *state = field->port->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = field->port->machine().driver_data<toaplan2_state>();
// For Teki Paki hardware
// bit 4 high signifies secondary CPU is ready
@@ -726,10 +726,10 @@ static CUSTOM_INPUT( c2map_r )
static READ16_HANDLER( ghox_p1_h_analog_r )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
INT8 value, new_value;
- new_value = input_port_read(space->machine, "PAD1");
+ new_value = input_port_read(space->machine(), "PAD1");
if (new_value == state->old_p1_paddle_h) return 0;
value = new_value - state->old_p1_paddle_h;
state->old_p1_paddle_h = new_value;
@@ -739,10 +739,10 @@ static READ16_HANDLER( ghox_p1_h_analog_r )
static READ16_HANDLER( ghox_p2_h_analog_r )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
INT8 value, new_value;
- new_value = input_port_read(space->machine, "PAD2");
+ new_value = input_port_read(space->machine(), "PAD2");
if (new_value == state->old_p2_paddle_h) return 0;
value = new_value - state->old_p2_paddle_h;
state->old_p2_paddle_h = new_value;
@@ -760,7 +760,7 @@ static WRITE16_HANDLER( ghox_mcu_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
UINT16 *toaplan2_shared_ram16 = state->shared_ram16;
state->mcu_data = data;
@@ -814,7 +814,7 @@ static READ16_HANDLER( ghox_shared_ram_r )
// Offset $44 and $42 are accessed from around PC:0FB52
// Offset $48 and $46 are accessed from around PC:06776
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
return state->shared_ram16[offset] & 0xff;
}
@@ -824,7 +824,7 @@ static WRITE16_HANDLER( ghox_shared_ram_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
state->shared_ram16[offset] = data & 0xff;
}
@@ -833,7 +833,7 @@ static WRITE16_HANDLER( ghox_shared_ram_w )
static WRITE16_HANDLER( fixeight_subcpu_ctrl_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
device_set_input_line(state->sub_cpu, INPUT_LINE_RESET, (data & state->v25_reset_line) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -853,26 +853,26 @@ static WRITE16_HANDLER( fixeightbl_oki_bankswitch_w )
if (ACCESSING_BITS_0_7)
{
data &= 7;
- if (data <= 4) memory_set_bank(space->machine, "bank1", data);
+ if (data <= 4) memory_set_bank(space->machine(), "bank1", data);
}
}
static READ8_HANDLER( v25_dswa_r )
{
- return input_port_read(space->machine, "DSWA") ^ 0xff;
+ return input_port_read(space->machine(), "DSWA") ^ 0xff;
}
static READ8_HANDLER( v25_dswb_r )
{
- return input_port_read(space->machine, "DSWB") ^ 0xff;
+ return input_port_read(space->machine(), "DSWB") ^ 0xff;
}
static READ8_HANDLER( v25_jmpr_r )
{
- return input_port_read(space->machine, "JMPR") ^ 0xff;
+ return input_port_read(space->machine(), "JMPR") ^ 0xff;
}
@@ -884,22 +884,22 @@ static READ8_HANDLER( fixeight_region_r )
// this code, and the default eeproms use should be considered subject
// to change
- if (!strcmp(space->machine->system().name,"fixeightkt")) return 0x00;
- if (!strcmp(space->machine->system().name,"fixeightk")) return 0x01;
- if (!strcmp(space->machine->system().name,"fixeightht")) return 0x02;
- if (!strcmp(space->machine->system().name,"fixeighth")) return 0x03;
- if (!strcmp(space->machine->system().name,"fixeighttwt")) return 0x04;
- if (!strcmp(space->machine->system().name,"fixeighttw")) return 0x05;
- if (!strcmp(space->machine->system().name,"fixeightat")) return 0x06;
- if (!strcmp(space->machine->system().name,"fixeighta")) return 0x07;
- if (!strcmp(space->machine->system().name,"fixeightt")) return 0x08;
- if (!strcmp(space->machine->system().name,"fixeight9")) return 0x09;
- if (!strcmp(space->machine->system().name,"fixeighta")) return 0x0a;
- if (!strcmp(space->machine->system().name,"fixeightu")) return 0x0b;
-// if (!strcmp(space->machine->system().name,"fixeightc")) return 0x0c; // invalid
-// if (!strcmp(space->machine->system().name,"fixeightd")) return 0x0d; // invalid
- if (!strcmp(space->machine->system().name,"fixeightj")) return 0x0e;
- if (!strcmp(space->machine->system().name,"fixeightjt")) return 0x0f;
+ if (!strcmp(space->machine().system().name,"fixeightkt")) return 0x00;
+ if (!strcmp(space->machine().system().name,"fixeightk")) return 0x01;
+ if (!strcmp(space->machine().system().name,"fixeightht")) return 0x02;
+ if (!strcmp(space->machine().system().name,"fixeighth")) return 0x03;
+ if (!strcmp(space->machine().system().name,"fixeighttwt")) return 0x04;
+ if (!strcmp(space->machine().system().name,"fixeighttw")) return 0x05;
+ if (!strcmp(space->machine().system().name,"fixeightat")) return 0x06;
+ if (!strcmp(space->machine().system().name,"fixeighta")) return 0x07;
+ if (!strcmp(space->machine().system().name,"fixeightt")) return 0x08;
+ if (!strcmp(space->machine().system().name,"fixeight9")) return 0x09;
+ if (!strcmp(space->machine().system().name,"fixeighta")) return 0x0a;
+ if (!strcmp(space->machine().system().name,"fixeightu")) return 0x0b;
+// if (!strcmp(space->machine().system().name,"fixeightc")) return 0x0c; // invalid
+// if (!strcmp(space->machine().system().name,"fixeightd")) return 0x0d; // invalid
+ if (!strcmp(space->machine().system().name,"fixeightj")) return 0x0e;
+ if (!strcmp(space->machine().system().name,"fixeightjt")) return 0x0f;
return 0x00;
}
@@ -912,7 +912,7 @@ static READ8_HANDLER( fixeight_region_r )
static WRITE8_HANDLER( raizing_z80_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
@@ -923,7 +923,7 @@ static WRITE8_HANDLER( raizing_z80_bankswitch_w )
static WRITE8_HANDLER( raizing_oki_bankswitch_w )
{
- nmk112_device *nmk112 = space->machine->device<nmk112_device>("nmk112");
+ nmk112_device *nmk112 = space->machine().device<nmk112_device>("nmk112");
nmk112_okibank_w(nmk112, offset, data & 0x0f);
nmk112_okibank_w(nmk112, offset + 1, (data >> 4) & 0x0f);
@@ -934,7 +934,7 @@ static WRITE16_HANDLER( bgaregga_soundlatch_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
soundlatch_w(space, offset, data & 0xff);
device_set_input_line(state->sub_cpu, 0, HOLD_LINE);
@@ -965,7 +965,7 @@ static READ16_HANDLER( batrider_z80_busack_r )
// These accesses are made when the 68K wants to read the Z80
// ROM code. Failure to return the correct status incurrs a Sound Error.
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
return state->z80_busreq; // Loop BUSRQ to BUSAK
}
@@ -975,7 +975,7 @@ static WRITE16_HANDLER( batrider_z80_busreq_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
state->z80_busreq = (data & 0x01); // see batrider_z80_busack_r above
}
@@ -984,7 +984,7 @@ static WRITE16_HANDLER( batrider_z80_busreq_w )
static READ16_HANDLER( batrider_z80rom_r )
{
- UINT8 *Z80 = space->machine->region("audiocpu")->base();
+ UINT8 *Z80 = space->machine().region("audiocpu")->base();
return Z80[offset];
}
@@ -995,7 +995,7 @@ static WRITE16_HANDLER( batrider_soundlatch_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
soundlatch_w(space, offset, data & 0xff);
device_set_input_line(state->sub_cpu, INPUT_LINE_NMI, ASSERT_LINE);
@@ -1007,7 +1007,7 @@ static WRITE16_HANDLER( batrider_soundlatch2_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
soundlatch2_w(space, offset, data & 0xff);
device_set_input_line(state->sub_cpu, INPUT_LINE_NMI, ASSERT_LINE);
@@ -1024,7 +1024,7 @@ static WRITE16_HANDLER( batrider_unknown_sound_w )
static WRITE16_HANDLER( batrider_clear_sndirq_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
// not sure whether this is correct
// the 68K writes here during the sound IRQ handler, and nowhere else...
@@ -1034,7 +1034,7 @@ static WRITE16_HANDLER( batrider_clear_sndirq_w )
static WRITE8_HANDLER( batrider_sndirq_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
// if batrider_clear_sndirq_w() is correct, should this be ASSERT_LINE?
device_set_input_line(state->main_cpu, state->sndirq_line, HOLD_LINE);
@@ -1043,7 +1043,7 @@ static WRITE8_HANDLER( batrider_sndirq_w )
static WRITE8_HANDLER( batrider_clear_nmi_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
device_set_input_line(state->sub_cpu, INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -1068,8 +1068,8 @@ static const eeprom_interface bbakraid_93C66_intf =
static READ16_HANDLER( bbakraid_eeprom_r )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
- eeprom_device *eeprom = space->machine->device<eeprom_device>("eeprom");
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
+ eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
// Bit 0x01 returns the status of BUSAK from the Z80.
// BUSRQ is activated via bit 0x10 on the EEPROM write port.
@@ -1086,13 +1086,13 @@ static READ16_HANDLER( bbakraid_eeprom_r )
static WRITE16_HANDLER( bbakraid_eeprom_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
if (data & ~0x001f)
logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",cpu_get_pc(space->cpu),data);
if ( ACCESSING_BITS_0_7 )
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
state->z80_busreq = data & 0x10; // see bbakraid_eeprom_r above
}
@@ -3083,7 +3083,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
- toaplan2_state *state = device->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = device->machine().driver_data<toaplan2_state>();
if (state->sub_cpu != NULL) // wouldn't tekipaki have problem without this? "mcu" is not generally added
device_set_input_line(state->sub_cpu, 0, linestate);
diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c
index 6eeb74d3c8e..bf278fbb46c 100644
--- a/src/mame/drivers/toki.c
+++ b/src/mame/drivers/toki.c
@@ -46,7 +46,7 @@ for now. Even at 12 this slowdown still happens a little.
static WRITE16_HANDLER( tokib_soundcommand16_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static READ16_HANDLER( pip16_r )
@@ -58,32 +58,32 @@ static READ16_HANDLER( pip16_r )
static void toki_adpcm_int (device_t *device)
{
- toki_state *state = device->machine->driver_data<toki_state>();
+ toki_state *state = device->machine().driver_data<toki_state>();
msm5205_data_w (device, state->msm5205next);
state->msm5205next >>= 4;
state->toggle ^= 1;
if (state->toggle)
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( toki_adpcm_control_w )
{
int bankaddress;
- UINT8 *RAM = device->machine->region("audiocpu")->base();
+ UINT8 *RAM = device->machine().region("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
- memory_set_bankptr(device->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(device->machine(), "bank1",&RAM[bankaddress]);
msm5205_reset_w(device,data & 0x08);
}
static WRITE8_HANDLER( toki_adpcm_data_w )
{
- toki_state *state = space->machine->driver_data<toki_state>();
+ toki_state *state = space->machine().driver_data<toki_state>();
state->msm5205next = data;
}
@@ -741,7 +741,7 @@ ROM_END
static DRIVER_INIT( toki )
{
- UINT8 *ROM = machine->region("oki")->base();
+ UINT8 *ROM = machine.region("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
@@ -764,14 +764,14 @@ static DRIVER_INIT( tokib )
UINT8 *rom;
/* invert the sprite data in the ROMs */
- len = machine->region("gfx2")->bytes();
- rom = machine->region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
for (i = 0; i < len; i++)
rom[i] ^= 0xff;
/* merge background tile graphics together */
- len = machine->region("gfx3")->bytes();
- rom = machine->region("gfx3")->base();
+ len = machine.region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -784,8 +784,8 @@ static DRIVER_INIT( tokib )
memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800);
}
}
- len = machine->region("gfx4")->bytes();
- rom = machine->region("gfx4")->base();
+ len = machine.region("gfx4")->bytes();
+ rom = machine.region("gfx4")->base();
for (offs = 0; offs < len; offs += 0x20000)
{
UINT8 *base = &rom[offs];
@@ -807,7 +807,7 @@ static DRIVER_INIT(jujub)
/* Program ROMs are bitswapped */
{
int i;
- UINT16 *prgrom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *prgrom = (UINT16*)machine.region("maincpu")->base();
for (i = 0; i < 0x60000/2; i++)
{
@@ -820,9 +820,9 @@ static DRIVER_INIT(jujub)
/* Decrypt data for z80 program */
{
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x20000);
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
int i;
memcpy(decrypt,rom,0x20000);
@@ -837,7 +837,7 @@ static DRIVER_INIT(jujub)
}
{
- UINT8 *ROM = machine->region("oki")->base();
+ UINT8 *ROM = machine.region("oki")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x20000);
int i;
diff --git a/src/mame/drivers/tomcat.c b/src/mame/drivers/tomcat.c
index 077a9ddd050..178f07d9c50 100644
--- a/src/mame/drivers/tomcat.c
+++ b/src/mame/drivers/tomcat.c
@@ -54,17 +54,17 @@ public:
static WRITE16_HANDLER(tomcat_adcon_w)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
state->control_num = data;
}
static READ16_HANDLER(tomcat_adcread_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
switch( state->control_num )
{
- case 0: return input_port_read(space->machine, "STICKY");
- case 1: return input_port_read(space->machine, "STICKX");
+ case 0: return input_port_read(space->machine(), "STICKY");
+ case 1: return input_port_read(space->machine(), "STICKX");
default: return 0x7f7f;
}
}
@@ -73,29 +73,29 @@ static READ16_HANDLER(tomcat_inputs_r)
{
UINT16 result = 0;
if (ACCESSING_BITS_8_15)
- result |= input_port_read(space->machine, "IN0") << 8;
+ result |= input_port_read(space->machine(), "IN0") << 8;
return result;
}
static WRITE16_HANDLER(tomcat_led1on_w)
{
- set_led_status(space->machine, 1, 1);
+ set_led_status(space->machine(), 1, 1);
}
static WRITE16_HANDLER(tomcat_led2on_w)
{
- set_led_status(space->machine, 2, 1);
+ set_led_status(space->machine(), 2, 1);
}
static WRITE16_HANDLER(tomcat_led2off_w)
{
- set_led_status(space->machine, 2, 0);
+ set_led_status(space->machine(), 2, 0);
}
static WRITE16_HANDLER(tomcat_led1off_w)
{
- set_led_status(space->machine, 1, 0);
+ set_led_status(space->machine(), 1, 0);
}
static WRITE16_HANDLER(tomcat_lnkmodel_w)
@@ -156,27 +156,27 @@ static WRITE16_HANDLER(tomcat_mresl_w)
{
// 320 Reset Low (Address Strobe)
// Reset TMS320
- device_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, ASSERT_LINE);
+ device_set_input_line(space->machine().device("dsp"), INPUT_LINE_RESET, ASSERT_LINE);
}
static WRITE16_HANDLER(tomcat_mresh_w)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
// 320 Reset high (Address Strobe)
// Release reset of TMS320
state->dsp_BIO = 0;
- device_set_input_line(space->machine->device("dsp"), INPUT_LINE_RESET, CLEAR_LINE);
+ device_set_input_line(space->machine().device("dsp"), INPUT_LINE_RESET, CLEAR_LINE);
}
static WRITE16_HANDLER(tomcat_irqclr_w)
{
// Clear IRQ Latch (Address Strobe)
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
}
static READ16_HANDLER(tomcat_inputs2_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
/*
* D15 LNKFLAG (Game Link)
* D14 PC3 " "
@@ -192,15 +192,15 @@ static READ16_HANDLER(tomcat_inputs2_r)
static READ16_HANDLER(tomcat_320bio_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
state->dsp_BIO = 1;
- space->machine->device<cpu_device>("maincpu")->suspend(SUSPEND_REASON_SPIN, 1);
+ space->machine().device<cpu_device>("maincpu")->suspend(SUSPEND_REASON_SPIN, 1);
return 0;
}
static READ16_HANDLER(dsp_BIO_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
if ( cpu_get_pc(space->cpu) == 0x0001 )
{
if ( state->dsp_idle == 0 )
@@ -216,7 +216,7 @@ static READ16_HANDLER(dsp_BIO_r)
{
state->dsp_idle = 0;
state->dsp_BIO = 0;
- space->machine->device<cpu_device>("maincpu")->resume(SUSPEND_REASON_SPIN );
+ space->machine().device<cpu_device>("maincpu")->resume(SUSPEND_REASON_SPIN );
return 0;
}
else
@@ -233,25 +233,25 @@ static READ16_HANDLER(dsp_BIO_r)
static READ16_HANDLER(tomcat_shared_ram_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
return state->shared_ram[offset];
}
static WRITE16_HANDLER(tomcat_shared_ram_w)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
COMBINE_DATA(&state->shared_ram[offset]);
}
static READ8_HANDLER(tomcat_nvram_r)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
return state->nvram[offset];
}
static WRITE8_HANDLER(tomcat_nvram_w)
{
- tomcat_state *state = space->machine->driver_data<tomcat_state>();
+ tomcat_state *state = space->machine().driver_data<tomcat_state>();
state->nvram[offset] = data;
}
@@ -348,13 +348,13 @@ ROM_END
static MACHINE_START(tomcat)
{
- tomcat_state *state = machine->driver_data<tomcat_state>();
+ tomcat_state *state = machine.driver_data<tomcat_state>();
((UINT16*)state->shared_ram)[0x0000] = 0xf600;
((UINT16*)state->shared_ram)[0x0001] = 0x0000;
((UINT16*)state->shared_ram)[0x0002] = 0xf600;
((UINT16*)state->shared_ram)[0x0003] = 0x0000;
- machine->device<nvram_device>("nvram")->set_base(state->nvram, 0x800);
+ machine.device<nvram_device>("nvram")->set_base(state->nvram, 0x800);
state->save_item(NAME(state->nvram));
state->save_item(NAME(state->control_num));
diff --git a/src/mame/drivers/toobin.c b/src/mame/drivers/toobin.c
index 993874881fe..2b880966fd6 100644
--- a/src/mame/drivers/toobin.c
+++ b/src/mame/drivers/toobin.c
@@ -33,9 +33,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- toobin_state *state = machine->driver_data<toobin_state>();
+ toobin_state *state = machine.driver_data<toobin_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state && state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -50,7 +50,7 @@ static MACHINE_START( toobin )
static MACHINE_RESET( toobin )
{
- toobin_state *state = machine->driver_data<toobin_state>();
+ toobin_state *state = machine.driver_data<toobin_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
@@ -67,7 +67,7 @@ static MACHINE_RESET( toobin )
static WRITE16_HANDLER( interrupt_scan_w )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
+ toobin_state *state = space->machine().driver_data<toobin_state>();
int oldword = state->interrupt_scan[offset];
int newword = oldword;
COMBINE_DATA(&newword);
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( interrupt_scan_w )
if (oldword != newword)
{
state->interrupt_scan[offset] = newword;
- atarigen_scanline_int_set(*space->machine->primary_screen, newword & 0x1ff);
+ atarigen_scanline_int_set(*space->machine().primary_screen, newword & 0x1ff);
}
}
@@ -90,9 +90,9 @@ static WRITE16_HANDLER( interrupt_scan_w )
static READ16_HANDLER( special_port1_r )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
- int result = input_port_read(space->machine, "FF9000");
- if (atarigen_get_hblank(*space->machine->primary_screen)) result ^= 0x8000;
+ toobin_state *state = space->machine().driver_data<toobin_state>();
+ int result = input_port_read(space->machine(), "FF9000");
+ if (atarigen_get_hblank(*space->machine().primary_screen)) result ^= 0x8000;
if (state->cpu_to_sound_ready) result ^= 0x2000;
return result;
}
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index f5c2ee20c0e..869b7851cd3 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -245,35 +245,35 @@ Stephh's notes (based on the game M68000 code and some tests) :
static READ16_HANDLER( sharedram_r )
{
- topspeed_state *state = space->machine->driver_data<topspeed_state>();
+ topspeed_state *state = space->machine().driver_data<topspeed_state>();
return state->sharedram[offset];
}
static WRITE16_HANDLER( sharedram_w )
{
- topspeed_state *state = space->machine->driver_data<topspeed_state>();
+ topspeed_state *state = space->machine().driver_data<topspeed_state>();
COMBINE_DATA(&state->sharedram[offset]);
}
-static void parse_control( running_machine *machine ) /* assumes Z80 sandwiched between 68Ks */
+static void parse_control( running_machine &machine ) /* assumes Z80 sandwiched between 68Ks */
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, (state->cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( cpua_ctrl_w )
{
- topspeed_state *state = space->machine->driver_data<topspeed_state>();
+ topspeed_state *state = space->machine().driver_data<topspeed_state>();
if ((data & 0xff00) && ((data & 0xff) == 0))
data = data >> 8; /* for Wgp */
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data);
}
@@ -287,7 +287,7 @@ static WRITE16_HANDLER( cpua_ctrl_w )
static TIMER_CALLBACK( topspeed_interrupt6 )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
@@ -295,7 +295,7 @@ static TIMER_CALLBACK( topspeed_interrupt6 )
static TIMER_CALLBACK( topspeed_cpub_interrupt6 )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
device_set_input_line(state->subcpu, 6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */
}
@@ -303,14 +303,14 @@ static TIMER_CALLBACK( topspeed_cpub_interrupt6 )
static INTERRUPT_GEN( topspeed_interrupt )
{
/* Unsure how many int6's per frame */
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_interrupt6));
device_set_input_line(device, 5, HOLD_LINE);
}
static INTERRUPT_GEN( topspeed_cpub_interrupt )
{
/* Unsure how many int6's per frame */
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_cpub_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_cpub_interrupt6));
device_set_input_line(device, 5, HOLD_LINE);
}
@@ -325,11 +325,11 @@ static INTERRUPT_GEN( topspeed_cpub_interrupt )
static READ8_HANDLER( topspeed_input_bypass_r )
{
- topspeed_state *state = space->machine->driver_data<topspeed_state>();
+ topspeed_state *state = space->machine().driver_data<topspeed_state>();
UINT8 port = tc0220ioc_port_r(state->tc0220ioc, 0); /* read port number */
int steer = 0;
- int analogue_steer = input_port_read_safe(space->machine, STEER_PORT_TAG, 0x00);
- int fake = input_port_read_safe(space->machine, FAKE_PORT_TAG, 0x00);
+ int analogue_steer = input_port_read_safe(space->machine(), STEER_PORT_TAG, 0x00);
+ int fake = input_port_read_safe(space->machine(), FAKE_PORT_TAG, 0x00);
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
@@ -371,7 +371,7 @@ static READ16_HANDLER( topspeed_motor_r )
switch (offset)
{
case 0x0:
- return (space->machine->rand() & 0xff); /* motor status ?? */
+ return (space->machine().rand() & 0xff); /* motor status ?? */
case 0x101:
return 0x55; /* motor cpu status ? */
@@ -393,22 +393,22 @@ static WRITE16_HANDLER( topspeed_motor_w )
SOUND
*****************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) /* assumes Z80 sandwiched between 68Ks */
{
- topspeed_state *state = device->machine->driver_data<topspeed_state>();
+ topspeed_state *state = device->machine().driver_data<topspeed_state>();
state->banknum = data & 7;
- reset_sound_region(device->machine);
+ reset_sound_region(device->machine());
}
static void topspeed_msm5205_vck( device_t *device )
{
- topspeed_state *state = device->machine->driver_data<topspeed_state>();
+ topspeed_state *state = device->machine().driver_data<topspeed_state>();
if (state->adpcm_data != -1)
{
msm5205_data_w(device, state->adpcm_data & 0x0f);
@@ -416,7 +416,7 @@ static void topspeed_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0x1ffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@@ -424,14 +424,14 @@ static void topspeed_msm5205_vck( device_t *device )
static WRITE8_DEVICE_HANDLER( topspeed_msm5205_address_w )
{
- topspeed_state *state = device->machine->driver_data<topspeed_state>();
+ topspeed_state *state = device->machine().driver_data<topspeed_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff) | (data << 8);
msm5205_reset_w(device, 0);
}
static WRITE8_DEVICE_HANDLER( topspeed_msm5205_stop_w )
{
- topspeed_state *state = device->machine->driver_data<topspeed_state>();
+ topspeed_state *state = device->machine().driver_data<topspeed_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0xff00;
}
@@ -619,7 +619,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq ) /* assumes Z80 sandwiched between 68Ks */
{
- topspeed_state *state = device->machine->driver_data<topspeed_state>();
+ topspeed_state *state = device->machine().driver_data<topspeed_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -648,26 +648,26 @@ static STATE_POSTLOAD( topspeed_postload )
static MACHINE_START( topspeed )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
- state->tc0220ioc = machine->device("tc0220ioc");
- state->pc080sn_1 = machine->device("pc080sn_1");
- state->pc080sn_2 = machine->device("pc080sn_2");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
+ state->tc0220ioc = machine.device("tc0220ioc");
+ state->pc080sn_1 = machine.device("pc080sn_1");
+ state->pc080sn_2 = machine.device("pc080sn_2");
state->save_item(NAME(state->cpua_ctrl));
state->save_item(NAME(state->ioc220_port));
state->save_item(NAME(state->banknum));
- machine->state().register_postload(topspeed_postload, NULL);
+ machine.state().register_postload(topspeed_postload, NULL);
}
static MACHINE_RESET( topspeed )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
state->cpua_ctrl = 0xff;
state->ioc220_port = 0;
diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c
index 9ce30831358..bbf9ec4aae8 100644
--- a/src/mame/drivers/toratora.c
+++ b/src/mame/drivers/toratora.c
@@ -67,7 +67,7 @@ static WRITE_LINE_DEVICE_HANDLER( cb2_u3_w )
static SCREEN_UPDATE( toratora )
{
- toratora_state *state = screen->machine->driver_data<toratora_state>();
+ toratora_state *state = screen->machine().driver_data<toratora_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -100,7 +100,7 @@ static SCREEN_UPDATE( toratora )
static WRITE8_HANDLER( clear_tv_w )
{
- toratora_state *state = space->machine->driver_data<toratora_state>();
+ toratora_state *state = space->machine().driver_data<toratora_state>();
state->clear_tv = 1;
}
@@ -114,9 +114,9 @@ static WRITE8_HANDLER( clear_tv_w )
static WRITE8_DEVICE_HANDLER( port_b_u1_w )
{
if (pia6821_get_port_b_z_mask(device) & 0x20)
- coin_counter_w(device->machine, 0, 1);
+ coin_counter_w(device->machine(), 0, 1);
else
- coin_counter_w(device->machine, 0, data & 0x20);
+ coin_counter_w(device->machine(), 0, data & 0x20);
}
@@ -128,7 +128,7 @@ static WRITE8_DEVICE_HANDLER( port_b_u1_w )
static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
{
- toratora_state *toratora = device->machine->driver_data<toratora_state>();
+ toratora_state *toratora = device->machine().driver_data<toratora_state>();
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
logerror("GEN IRQ: %x\n", combined_state);
@@ -138,32 +138,32 @@ static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq )
static INTERRUPT_GEN( toratora_timer )
{
- toratora_state *state = device->machine->driver_data<toratora_state>();
+ toratora_state *state = device->machine().driver_data<toratora_state>();
state->timer++; /* timer counting at 16 Hz */
/* also, when the timer overflows (16 seconds) watchdog would kick in */
if (state->timer & 0x100)
popmessage("watchdog!");
- if (state->last != (input_port_read(device->machine, "INPUT") & 0x0f))
+ if (state->last != (input_port_read(device->machine(), "INPUT") & 0x0f))
{
- state->last = input_port_read(device->machine, "INPUT") & 0x0f;
+ state->last = input_port_read(device->machine(), "INPUT") & 0x0f;
generic_pulse_irq_line(device, 0);
}
- pia6821_set_input_a(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x0f, 0);
- pia6821_ca1_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x10);
- pia6821_ca2_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x20);
+ pia6821_set_input_a(state->pia_u1, input_port_read(device->machine(), "INPUT") & 0x0f, 0);
+ pia6821_ca1_w(state->pia_u1, input_port_read(device->machine(), "INPUT") & 0x10);
+ pia6821_ca2_w(state->pia_u1, input_port_read(device->machine(), "INPUT") & 0x20);
}
static READ8_HANDLER( timer_r )
{
- toratora_state *state = space->machine->driver_data<toratora_state>();
+ toratora_state *state = space->machine().driver_data<toratora_state>();
return state->timer;
}
static WRITE8_HANDLER( clear_timer_w )
{
- toratora_state *state = space->machine->driver_data<toratora_state>();
+ toratora_state *state = space->machine().driver_data<toratora_state>();
state->timer = 0;
}
@@ -373,12 +373,12 @@ INPUT_PORTS_END
static MACHINE_START( toratora )
{
- toratora_state *state = machine->driver_data<toratora_state>();
+ toratora_state *state = machine.driver_data<toratora_state>();
- state->maincpu = machine->device("maincpu");
- state->pia_u1 = machine->device("pia_u1");
- state->pia_u2 = machine->device("pia_u2");
- state->pia_u3 = machine->device("pia_u3");
+ state->maincpu = machine.device("maincpu");
+ state->pia_u1 = machine.device("pia_u1");
+ state->pia_u2 = machine.device("pia_u2");
+ state->pia_u3 = machine.device("pia_u3");
state->save_item(NAME(state->timer));
state->save_item(NAME(state->last));
@@ -387,7 +387,7 @@ static MACHINE_START( toratora )
static MACHINE_RESET( toratora )
{
- toratora_state *state = machine->driver_data<toratora_state>();
+ toratora_state *state = machine.driver_data<toratora_state>();
state->timer = 0xff;
state->last = 0;
diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c
index 4ffd09d4908..a54009bdb78 100644
--- a/src/mame/drivers/tourtabl.c
+++ b/src/mame/drivers/tourtabl.c
@@ -27,12 +27,12 @@ public:
static WRITE8_DEVICE_HANDLER( tourtabl_led_w )
{
- set_led_status(device->machine, 0, data & 0x40); /* start 1 */
- set_led_status(device->machine, 1, data & 0x20); /* start 2 */
- set_led_status(device->machine, 2, data & 0x10); /* start 4 */
- set_led_status(device->machine, 3, data & 0x80); /* select game */
+ set_led_status(device->machine(), 0, data & 0x40); /* start 1 */
+ set_led_status(device->machine(), 1, data & 0x20); /* start 2 */
+ set_led_status(device->machine(), 2, data & 0x10); /* start 4 */
+ set_led_status(device->machine(), 3, data & 0x80); /* select game */
- coin_lockout_global_w(device->machine, !(data & 0x80));
+ coin_lockout_global_w(device->machine(), !(data & 0x80));
}
@@ -40,7 +40,7 @@ static READ16_HANDLER( tourtabl_read_input_port )
{
static const char *const tianames[] = { "PADDLE4", "PADDLE3", "PADDLE2", "PADDLE1", "TIA_IN4", "TIA_IN5" };
- return input_port_read(space->machine, tianames[offset]);
+ return input_port_read(space->machine(), tianames[offset]);
}
static READ8_HANDLER( tourtabl_get_databus_contents )
@@ -62,7 +62,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( watchdog_w )
{
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
}
static const riot6532_interface r6532_interface_0 =
diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c
index fc4e351e313..1c4ccd4387b 100644
--- a/src/mame/drivers/toypop.c
+++ b/src/mame/drivers/toypop.c
@@ -39,7 +39,7 @@ TODO:
static READ16_HANDLER( toypop_m68000_sharedram_r )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
return state->m68000_sharedram[offset];
}
@@ -47,44 +47,44 @@ static WRITE16_HANDLER( toypop_m68000_sharedram_w )
{
if (ACCESSING_BITS_0_7)
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
state->m68000_sharedram[offset] = data & 0xff;
}
}
static READ8_HANDLER( toypop_main_interrupt_enable_r )
{
- cpu_interrupt_enable(space->machine->device("maincpu"), 1);
+ cpu_interrupt_enable(space->machine().device("maincpu"), 1);
return 0;
}
static WRITE8_HANDLER( toypop_main_interrupt_enable_w )
{
- cpu_interrupt_enable(space->machine->device("maincpu"), 1);
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cpu_interrupt_enable(space->machine().device("maincpu"), 1);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( toypop_main_interrupt_disable_w )
{
- cpu_interrupt_enable(space->machine->device("maincpu"), 0);
+ cpu_interrupt_enable(space->machine().device("maincpu"), 0);
}
static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w )
{
- cpu_interrupt_enable(space->machine->device("audiocpu"), 1);
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cpu_interrupt_enable(space->machine().device("audiocpu"), 1);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( toypop_sound_interrupt_disable_w )
{
- cpu_interrupt_enable(space->machine->device("audiocpu"), 0);
+ cpu_interrupt_enable(space->machine().device("audiocpu"), 0);
}
static TIMER_CALLBACK( namcoio_run )
{
- device_t *io58xx = machine->device("58xx");
- device_t *io56xx_1 = machine->device("56xx_1");
- device_t *io56xx_2 = machine->device("56xx_2");
+ device_t *io58xx = machine.device("58xx");
+ device_t *io56xx_1 = machine.device("56xx_1");
+ device_t *io56xx_2 = machine.device("56xx_2");
switch (param)
{
@@ -102,50 +102,50 @@ static TIMER_CALLBACK( namcoio_run )
static INTERRUPT_GEN( toypop_main_interrupt )
{
- device_t *namcoio_0 = device->machine->device("58xx");
- device_t *namcoio_1 = device->machine->device("56xx_1");
- device_t *namcoio_2 = device->machine->device("56xx_2");
+ device_t *namcoio_0 = device->machine().device("58xx");
+ device_t *namcoio_1 = device->machine().device("56xx_1");
+ device_t *namcoio_2 = device->machine().device("56xx_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_0)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 2);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 2);
}
static WRITE8_HANDLER( toypop_sound_clear_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
static WRITE8_HANDLER( toypop_sound_assert_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
static WRITE8_HANDLER( toypop_m68000_clear_w )
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE);
}
static WRITE8_HANDLER( toypop_m68000_assert_w )
{
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE);
}
static TIMER_CALLBACK( disable_interrupts )
{
- toypop_state *state = machine->driver_data<toypop_state>();
- cpu_interrupt_enable(machine->device("maincpu"), 0);
+ toypop_state *state = machine.driver_data<toypop_state>();
+ cpu_interrupt_enable(machine.device("maincpu"), 0);
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
- cpu_interrupt_enable(machine->device("audiocpu"), 0);
+ cpu_interrupt_enable(machine.device("audiocpu"), 0);
cputag_set_input_line(machine, "audiocpu", 0, CLEAR_LINE);
state->interrupt_enable_68k = 0;
}
@@ -154,25 +154,25 @@ static MACHINE_RESET( toypop )
{
/* we must do this on a timer in order to have it take effect */
/* otherwise, the reset process will override our changes */
- machine->scheduler().synchronize(FUNC(disable_interrupts));
+ machine.scheduler().synchronize(FUNC(disable_interrupts));
}
static INTERRUPT_GEN( toypop_m68000_interrupt )
{
- toypop_state *state = device->machine->driver_data<toypop_state>();
+ toypop_state *state = device->machine().driver_data<toypop_state>();
if (state->interrupt_enable_68k)
device_set_input_line(device, 6, HOLD_LINE);
}
static WRITE16_HANDLER( toypop_m68000_interrupt_enable_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
state->interrupt_enable_68k = 1;
}
static WRITE16_HANDLER( toypop_m68000_interrupt_disable_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
state->interrupt_enable_68k = 0;
}
@@ -491,25 +491,25 @@ static const namco_interface namco_config =
***************************************************************************/
-static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine, "DSW1"); } // dips A
-static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine, "DSW1") >> 4; } // dips A
-static READ8_DEVICE_HANDLER( dipB_l ) { return input_port_read(device->machine, "DSW2"); } // dips B
-static READ8_DEVICE_HANDLER( dipB_h ) { return input_port_read(device->machine, "DSW2") >> 4; } // dips B
+static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine(), "DSW1"); } // dips A
+static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine(), "DSW1") >> 4; } // dips A
+static READ8_DEVICE_HANDLER( dipB_l ) { return input_port_read(device->machine(), "DSW2"); } // dips B
+static READ8_DEVICE_HANDLER( dipB_h ) { return input_port_read(device->machine(), "DSW2") >> 4; } // dips B
static WRITE8_DEVICE_HANDLER( out_coin0 )
{
- coin_lockout_global_w(device->machine, data & 4);
- coin_counter_w(device->machine, 0, ~data & 8);
+ coin_lockout_global_w(device->machine(), data & 4);
+ coin_counter_w(device->machine(), 0, ~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_coin1 )
{
- coin_counter_w(device->machine, 1, ~data & 1);
+ coin_counter_w(device->machine(), 1, ~data & 1);
}
static WRITE8_DEVICE_HANDLER( flip )
{
- flip_screen_set(device->machine, data & 1);
+ flip_screen_set(device->machine(), data & 1);
}
/* chip #0: player inputs, buttons, coins */
diff --git a/src/mame/drivers/tp84.c b/src/mame/drivers/tp84.c
index 10ec62baa5f..1878b27fa48 100644
--- a/src/mame/drivers/tp84.c
+++ b/src/mame/drivers/tp84.c
@@ -76,14 +76,14 @@ C004 76489 #4 trigger
static MACHINE_START( tp84 )
{
- tp84_state *state = machine->driver_data<tp84_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ tp84_state *state = machine.driver_data<tp84_state>();
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
}
static READ8_HANDLER( tp84_sh_timer_r )
{
- tp84_state *state = space->machine->driver_data<tp84_state>();
+ tp84_state *state = space->machine().driver_data<tp84_state>();
/* main xtal 14.318MHz, divided by 4 to get the CPU clock, further */
/* divided by 2048 to get this timer */
/* (divide by (2048/2), and not 1024, because the CPU cycle counter is */
@@ -100,28 +100,28 @@ static WRITE8_HANDLER( tp84_filter_w )
C = 0;
if (offset & 0x008) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x010) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(space->machine->device("filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ filter_rc_set_RC(space->machine().device("filter1"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
/* 76489 #1 (optional) */
C = 0;
if (offset & 0x020) C += 47000; /* 47000pF = 0.047uF */
if (offset & 0x040) C += 470000; /* 470000pF = 0.47uF */
-// filter_rc_set_RC(space->machine->device("filter2"),1000,2200,1000,C);
+// filter_rc_set_RC(space->machine().device("filter2"),1000,2200,1000,C);
/* 76489 #2 */
C = 0;
if (offset & 0x080) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(space->machine->device("filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ filter_rc_set_RC(space->machine().device("filter2"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
/* 76489 #3 */
C = 0;
if (offset & 0x100) C += 470000; /* 470000pF = 0.47uF */
- filter_rc_set_RC(space->machine->device("filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
+ filter_rc_set_RC(space->machine().device("filter3"),FLT_RC_LOWPASS,1000,2200,1000,CAP_P(C));
}
static WRITE8_HANDLER( tp84_sh_irqtrigger_w )
{
- cputag_set_input_line_and_vector(space->machine, "audiocpu",0,HOLD_LINE,0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu",0,HOLD_LINE,0xff);
}
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 3258cffe7a2..f2871be13d0 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -199,27 +199,27 @@ MAIN BOARD:
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, offset, data & 1);
+ coin_counter_w(space->machine(), offset, data & 1);
}
static WRITE8_HANDLER( questions_bank_w )
{
if (!(data & 0x01))
- memory_set_bank(space->machine, "bank1", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
else if (!(data & 0x02))
- memory_set_bank(space->machine, "bank1", 1);
+ memory_set_bank(space->machine(), "bank1", 1);
else if (!(data & 0x04))
- memory_set_bank(space->machine, "bank1", 2);
+ memory_set_bank(space->machine(), "bank1", 2);
else if (!(data & 0x08))
- memory_set_bank(space->machine, "bank1", 3);
+ memory_set_bank(space->machine(), "bank1", 3);
else if (!(data & 0x10))
- memory_set_bank(space->machine, "bank1", 4);
+ memory_set_bank(space->machine(), "bank1", 4);
else if (!(data & 0x20))
- memory_set_bank(space->machine, "bank1", 5);
+ memory_set_bank(space->machine(), "bank1", 5);
else if (!(data & 0x40))
- memory_set_bank(space->machine, "bank1", 6);
+ memory_set_bank(space->machine(), "bank1", 6);
else if (!(data & 0x80))
- memory_set_bank(space->machine, "bank1", 7);
+ memory_set_bank(space->machine(), "bank1", 7);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -863,7 +863,7 @@ GFXDECODE_END
static MACHINE_START( trackfld )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
/* video */
state->save_item(NAME(state->bg_bank));
@@ -874,7 +874,7 @@ static MACHINE_START( trackfld )
static MACHINE_RESET( trackfld )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
state->bg_bank = 0;
state->sprite_bank1 = 0;
@@ -1412,8 +1412,8 @@ static DRIVER_INIT( trackfld )
static DRIVER_INIT( atlantol )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt;
int A;
@@ -1442,7 +1442,7 @@ static DRIVER_INIT( atlantol )
static DRIVER_INIT( mastkin )
{
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
int i;
/* build a fake palette so the screen won't be all black */
@@ -1463,14 +1463,14 @@ static DRIVER_INIT( mastkin )
static DRIVER_INIT( wizzquiz )
{
- UINT8 *ROM = machine->region("maincpu")->base() + 0xe000;
+ UINT8 *ROM = machine.region("maincpu")->base() + 0xe000;
int i;
/* decrypt program rom */
for (i = 0; i < 0x2000; i++)
ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
- ROM = machine->region("user1")->base();
+ ROM = machine.region("user1")->base();
/* decrypt questions roms */
for (i = 0; i < 0x40000; i++)
diff --git a/src/mame/drivers/travrusa.c b/src/mame/drivers/travrusa.c
index 9b22b5119b8..6cd5ef83a5a 100644
--- a/src/mame/drivers/travrusa.c
+++ b/src/mame/drivers/travrusa.c
@@ -291,7 +291,7 @@ GFXDECODE_END
static MACHINE_RESET( travrusa )
{
- travrusa_state *state = machine->driver_data<travrusa_state>();
+ travrusa_state *state = machine.driver_data<travrusa_state>();
state->scrollx[0] = 0;
state->scrollx[1] = 0;
@@ -454,7 +454,7 @@ ROM_END
static DRIVER_INIT( motorace )
{
int A, j;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(buffer, rom, 0x2000);
@@ -472,7 +472,7 @@ static DRIVER_INIT( motorace )
static DRIVER_INIT( shtridra )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* D3/D4 and D5/D6 swapped */
for (A = 0; A < 0x2000; A++)
diff --git a/src/mame/drivers/triplhnt.c b/src/mame/drivers/triplhnt.c
index 1168e68252e..2d4572c09e2 100644
--- a/src/mame/drivers/triplhnt.c
+++ b/src/mame/drivers/triplhnt.c
@@ -19,25 +19,25 @@ To Do:
static DRIVER_INIT( triplhnt )
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
- machine->device<nvram_device>("nvram")->set_base(state->cmos, sizeof(state->cmos));
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
+ machine.device<nvram_device>("nvram")->set_base(state->cmos, sizeof(state->cmos));
}
-void triplhnt_set_collision(running_machine *machine, int code)
+void triplhnt_set_collision(running_machine &machine, int code)
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
state->hit_code = code;
cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
}
-static void triplhnt_update_misc(running_machine *machine, int offset)
+static void triplhnt_update_misc(running_machine &machine, int offset)
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
- device_t *samples = machine->device("samples");
- device_t *discrete = machine->device("discrete");
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
+ device_t *samples = machine.device("samples");
+ device_t *discrete = machine.device("discrete");
UINT8 is_witch_hunt;
UINT8 bit = offset >> 1;
@@ -93,13 +93,13 @@ static void triplhnt_update_misc(running_machine *machine, int offset)
static WRITE8_HANDLER( triplhnt_misc_w )
{
- triplhnt_update_misc(space->machine, offset);
+ triplhnt_update_misc(space->machine(), offset);
}
static READ8_HANDLER( triplhnt_cmos_r )
{
- triplhnt_state *state = space->machine->driver_data<triplhnt_state>();
+ triplhnt_state *state = space->machine().driver_data<triplhnt_state>();
state->cmos_latch = offset;
return state->cmos[state->cmos_latch] ^ 15;
@@ -109,23 +109,23 @@ static READ8_HANDLER( triplhnt_cmos_r )
static READ8_HANDLER( triplhnt_input_port_4_r )
{
watchdog_reset_w(space, 0, 0);
- return input_port_read(space->machine, "0C0B");
+ return input_port_read(space->machine(), "0C0B");
}
static READ8_HANDLER( triplhnt_misc_r )
{
- triplhnt_state *state = space->machine->driver_data<triplhnt_state>();
- triplhnt_update_misc(space->machine, offset);
- return input_port_read(space->machine, "VBLANK") | state->hit_code;
+ triplhnt_state *state = space->machine().driver_data<triplhnt_state>();
+ triplhnt_update_misc(space->machine(), offset);
+ return input_port_read(space->machine(), "VBLANK") | state->hit_code;
}
static READ8_HANDLER( triplhnt_da_latch_r )
{
- triplhnt_state *state = space->machine->driver_data<triplhnt_state>();
- int cross_x = input_port_read(space->machine, "STICKX");
- int cross_y = input_port_read(space->machine, "STICKY");
+ triplhnt_state *state = space->machine().driver_data<triplhnt_state>();
+ int cross_x = input_port_read(space->machine(), "STICKX");
+ int cross_y = input_port_read(space->machine(), "STICKY");
state->da_latch = offset;
diff --git a/src/mame/drivers/truco.c b/src/mame/drivers/truco.c
index 2b24f63176a..3523f0a800b 100644
--- a/src/mame/drivers/truco.c
+++ b/src/mame/drivers/truco.c
@@ -85,7 +85,7 @@ INPUT_PORTS_END
static MACHINE_RESET( truco )
{
- truco_state *state = machine->driver_data<truco_state>();
+ truco_state *state = machine.driver_data<truco_state>();
int a;
/* Setup the data on the battery backed RAM */
@@ -116,10 +116,10 @@ static MACHINE_RESET( truco )
static INTERRUPT_GEN( truco_interrupt )
{
- truco_state *state = device->machine->driver_data<truco_state>();
+ truco_state *state = device->machine().driver_data<truco_state>();
/* coinup */
- if ( input_port_read(device->machine, "COIN") & 1 )
+ if ( input_port_read(device->machine(), "COIN") & 1 )
{
if ( state->trigger == 0 )
{
diff --git a/src/mame/drivers/trucocl.c b/src/mame/drivers/trucocl.c
index 061f55ea208..52aef20ddfd 100644
--- a/src/mame/drivers/trucocl.c
+++ b/src/mame/drivers/trucocl.c
@@ -50,8 +50,8 @@ static TIMER_CALLBACK( dac_irq )
static WRITE8_DEVICE_HANDLER( audio_dac_w )
{
- trucocl_state *state = device->machine->driver_data<trucocl_state>();
- UINT8 *rom = device->machine->region("maincpu")->base();
+ trucocl_state *state = device->machine().driver_data<trucocl_state>();
+ UINT8 *rom = device->machine().region("maincpu")->base();
int dac_address = ( data & 0xf0 ) << 8;
int sel = ( ( (~data) >> 1 ) & 2 ) | ( data & 1 );
@@ -75,7 +75,7 @@ static WRITE8_DEVICE_HANDLER( audio_dac_w )
dac_data_w( device, rom[dac_address+state->cur_dac_address_index] );
- device->machine->scheduler().timer_set( attotime::from_hz( 16000 ), FUNC(dac_irq ));
+ device->machine().scheduler().timer_set( attotime::from_hz( 16000 ), FUNC(dac_irq ));
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -181,7 +181,7 @@ ROM_END
static DRIVER_INIT( trucocl )
{
- trucocl_state *state = machine->driver_data<trucocl_state>();
+ trucocl_state *state = machine.driver_data<trucocl_state>();
state->cur_dac_address = -1;
state->cur_dac_address_index = 0;
}
diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c
index b20782f069b..a483ad66c6c 100644
--- a/src/mame/drivers/trvmadns.c
+++ b/src/mame/drivers/trvmadns.c
@@ -80,7 +80,7 @@ public:
static WRITE8_HANDLER( trvmadns_banking_w )
{
- trvmadns_state *state = space->machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = space->machine().driver_data<trvmadns_state>();
UINT8 *rom;
int address = 0;
@@ -91,7 +91,7 @@ static WRITE8_HANDLER( trvmadns_banking_w )
}
else if((data & 0xf0) == 0x80 || (data & 0xf0) == 0x90)
{
- rom = space->machine->region("user2")->base();
+ rom = space->machine().region("user2")->base();
switch(data & 0xf)
{
@@ -107,8 +107,8 @@ static WRITE8_HANDLER( trvmadns_banking_w )
address |= (data & 0x10) ? 0x10000 : 0;
- memory_set_bankptr(space->machine, "bank1", &rom[address]);
- memory_set_bankptr(space->machine, "bank2", &rom[address + 0x1000]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[address]);
+ memory_set_bankptr(space->machine(), "bank2", &rom[address + 0x1000]);
}
else
{
@@ -119,7 +119,7 @@ static WRITE8_HANDLER( trvmadns_banking_w )
//logerror("port80 = %02X\n",data);
}
- rom = space->machine->region("user1")->base();
+ rom = space->machine().region("user1")->base();
/*
7
@@ -147,29 +147,29 @@ static WRITE8_HANDLER( trvmadns_banking_w )
// logerror("add = %X\n",address);
- memory_set_bankptr(space->machine, "bank1", &rom[address]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[address]);
}
}
static WRITE8_HANDLER( trvmadns_gfxram_w )
{
- trvmadns_state *state = space->machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = space->machine().driver_data<trvmadns_state>();
state->gfxram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], offset/16);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/16);
}
static WRITE8_HANDLER( trvmadns_palette_w )
{
int r,g,b,datax;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
offset>>=1;
- datax=space->machine->generic.paletteram.u8[offset*2+1]+256*space->machine->generic.paletteram.u8[offset*2];
+ datax=space->machine().generic.paletteram.u8[offset*2+1]+256*space->machine().generic.paletteram.u8[offset*2];
b = (((datax & 0x0007)>>0) | ((datax & 0x0200)>>6)) ^ 0xf;
r = (((datax & 0x0038)>>3) | ((datax & 0x0400)>>7)) ^ 0xf;
g = (((datax & 0x01c0)>>6) | ((datax & 0x0800)>>8)) ^ 0xf;
- palette_set_color_rgb(space->machine, offset, pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(r), pal4bit(g), pal4bit(b));
}
@@ -191,12 +191,12 @@ static WRITE8_HANDLER( w3 )
static WRITE8_HANDLER( trvmadns_tileram_w )
{
- trvmadns_state *state = space->machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = space->machine().driver_data<trvmadns_state>();
if(offset==0)
{
if(cpu_get_previouspc(space->cpu)==0x29e9)// || cpu_get_previouspc(space->cpu)==0x1b3f) //29f5
{
- cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, HOLD_LINE);
}
// else
// logerror("%x \n", cpu_get_previouspc(space->cpu));
@@ -256,7 +256,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_bg_tile_info )
{
- trvmadns_state *state = machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = machine.driver_data<trvmadns_state>();
int tile,attr,color,flag;
attr = state->tileram[tile_index*2 + 0];
@@ -277,19 +277,19 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( trvmadns )
{
- trvmadns_state *state = machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = machine.driver_data<trvmadns_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
// tilemap_set_transparent_pen(fg_tilemap,1);
- gfx_element_set_source(machine->gfx[0], state->gfxram);
+ gfx_element_set_source(machine.gfx[0], state->gfxram);
}
static SCREEN_UPDATE( trvmadns )
{
- trvmadns_state *state = screen->machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = screen->machine().driver_data<trvmadns_state>();
int x,y,count;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
bitmap_fill(bitmap,cliprect,0xd);
@@ -334,7 +334,7 @@ static SCREEN_UPDATE( trvmadns )
static MACHINE_RESET( trvmadns )
{
- trvmadns_state *state = machine->driver_data<trvmadns_state>();
+ trvmadns_state *state = machine.driver_data<trvmadns_state>();
state->old_data = -1;
}
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index e9a4d85e3c6..471e9e9bb53 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -43,14 +43,14 @@ Notes:
static READ8_HANDLER( trvquest_question_r )
{
- gameplan_state *state = space->machine->driver_data<gameplan_state>();
+ gameplan_state *state = space->machine().driver_data<gameplan_state>();
- return space->machine->region("questions")->base()[*state->trvquest_question * 0x2000 + offset];
+ return space->machine().region("questions")->base()[*state->trvquest_question * 0x2000 + offset];
}
static WRITE8_DEVICE_HANDLER( trvquest_coin_w )
{
- coin_counter_w(device->machine, 0, ~data & 1);
+ coin_counter_w(device->machine(), 0, ~data & 1);
}
static WRITE8_DEVICE_HANDLER( trvquest_misc_w )
@@ -149,7 +149,7 @@ INPUT_PORTS_END
static TIMER_CALLBACK( via_irq_delayed )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
device_set_input_line(state->maincpu, 0, param);
}
@@ -160,7 +160,7 @@ static void via_irq( device_t *device, int state )
/* Kaos sits in a tight loop polling the VIA irq flags register, but that register is
cleared by the irq handler. Therefore, I wait a bit before triggering the irq to
leave time for the program to see the flag change. */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(via_irq_delayed), state);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(via_irq_delayed), state);
}
@@ -185,9 +185,9 @@ static const via6522_interface via_2_interface =
static MACHINE_START( trvquest )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
/* register for save states */
state->save_item(NAME(state->video_x));
@@ -198,7 +198,7 @@ static MACHINE_START( trvquest )
static MACHINE_RESET( trvquest )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
state->video_x = 0;
state->video_y = 0;
@@ -208,7 +208,7 @@ static MACHINE_RESET( trvquest )
static INTERRUPT_GEN( trvquest_interrupt )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
state->via_2->write_ca1(1);
state->via_2->write_ca1(0);
}
diff --git a/src/mame/drivers/tryout.c b/src/mame/drivers/tryout.c
index 0d4e3e52a21..c541729b94a 100644
--- a/src/mame/drivers/tryout.c
+++ b/src/mame/drivers/tryout.c
@@ -27,29 +27,29 @@ $208 strikes count
static WRITE8_HANDLER( tryout_nmi_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE );
}
static WRITE8_HANDLER( tryout_sound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
/*this is actually irq/nmi mask, polls only four values at start up (81->01->81->01) and then
stays on this state.*/
static WRITE8_HANDLER( tryout_sound_irq_ack_w )
{
-// cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+// cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( tryout_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x01) * 0x2000;
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]);
}
static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8 )
@@ -84,7 +84,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted )
{
if(newval != oldval)
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
}
static INPUT_PORTS_START( tryout )
diff --git a/src/mame/drivers/tsamurai.c b/src/mame/drivers/tsamurai.c
index c217e18656a..dea1361725b 100644
--- a/src/mame/drivers/tsamurai.c
+++ b/src/mame/drivers/tsamurai.c
@@ -51,13 +51,13 @@ TODO:
static WRITE8_HANDLER( nmi_enable_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->nmi_enabled = data;
}
static INTERRUPT_GEN( samurai_interrupt )
{
- tsamurai_state *state = device->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = device->machine().driver_data<tsamurai_state>();
if (state->nmi_enabled) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -88,33 +88,33 @@ static READ8_HANDLER( unknown_d938_r )
static WRITE8_HANDLER( sound_command1_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->sound_command1 = data;
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE );
}
static WRITE8_HANDLER( sound_command2_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->sound_command2 = data;
- cputag_set_input_line(space->machine, "audio2", 0, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "audio2", 0, HOLD_LINE );
}
static WRITE8_HANDLER( sound_command3_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->sound_command3 = data;
- cputag_set_input_line(space->machine, "audio3", 0, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "audio3", 0, HOLD_LINE );
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static WRITE8_HANDLER( tsamurai_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
@@ -205,19 +205,19 @@ ADDRESS_MAP_END
static READ8_HANDLER( sound_command1_r )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
return state->sound_command1;
}
static READ8_HANDLER( sound_command2_r )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
return state->sound_command2;
}
static READ8_HANDLER( sound_command3_r )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
return state->sound_command3;
}
@@ -279,13 +279,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( vsgongf_sound_nmi_enable_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->vsgongf_sound_nmi_enabled = data;
}
static INTERRUPT_GEN( vsgongf_sound_interrupt )
{
- tsamurai_state *state = device->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = device->machine().driver_data<tsamurai_state>();
if (state->vsgongf_sound_nmi_enabled) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -294,9 +294,9 @@ static INTERRUPT_GEN( vsgongf_sound_interrupt )
static READ8_HANDLER( vsgongf_a006_r )
{
/* sound CPU busy? */
- if (!strcmp(space->machine->system().name,"vsgongf")) return 0x80;
- if (!strcmp(space->machine->system().name,"ringfgt")) return 0x80;
- if (!strcmp(space->machine->system().name,"ringfgt2")) return 0xc0;
+ if (!strcmp(space->machine().system().name,"vsgongf")) return 0x80;
+ if (!strcmp(space->machine().system().name,"ringfgt")) return 0x80;
+ if (!strcmp(space->machine().system().name,"ringfgt2")) return 0xc0;
logerror ("unhandled read from a006\n");
return 0x00;
@@ -305,9 +305,9 @@ static READ8_HANDLER( vsgongf_a006_r )
static READ8_HANDLER( vsgongf_a100_r )
{
/* protection? */
- if (!strcmp(space->machine->system().name,"vsgongf")) return 0xaa;
- if (!strcmp(space->machine->system().name,"ringfgt")) return 0x63;
- if (!strcmp(space->machine->system().name,"ringfgt2")) return 0x6a;
+ if (!strcmp(space->machine().system().name,"vsgongf")) return 0xaa;
+ if (!strcmp(space->machine().system().name,"ringfgt")) return 0x63;
+ if (!strcmp(space->machine().system().name,"ringfgt2")) return 0x6a;
logerror ("unhandled read from a100\n");
return 0x00;
@@ -316,7 +316,7 @@ static READ8_HANDLER( vsgongf_a100_r )
static WRITE8_HANDLER( vsgongf_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( vsgongf_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index ae16c1bf21f..e67a04dd0b2 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -62,12 +62,12 @@ static VIDEO_START(ttchamp)
static SCREEN_UPDATE(ttchamp)
{
- ttchamp_state *state = screen->machine->driver_data<ttchamp_state>();
+ ttchamp_state *state = screen->machine().driver_data<ttchamp_state>();
int y,x,count;
// int i;
static const int xxx=320,yyy=204;
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
// for (i=0;i<256;i++)
// {
@@ -95,7 +95,7 @@ static SCREEN_UPDATE(ttchamp)
static WRITE16_HANDLER( paloff_w )
{
- ttchamp_state *state = space->machine->driver_data<ttchamp_state>();
+ ttchamp_state *state = space->machine().driver_data<ttchamp_state>();
COMBINE_DATA(&state->paloff);
}
@@ -103,31 +103,31 @@ static WRITE16_HANDLER( paloff_w )
static WRITE16_HANDLER( pcup_prgbank_w )
{
int bank;
- UINT8 *ROM1 = space->machine->region("user1")->base();
+ UINT8 *ROM1 = space->machine().region("user1")->base();
if (ACCESSING_BITS_0_7)
{
bank = (data>>4) &0x07;
- memory_set_bankptr(space->machine, "bank2",&ROM1[0x80000*(bank)]);
+ memory_set_bankptr(space->machine(), "bank2",&ROM1[0x80000*(bank)]);
}
}
#endif
static WRITE16_HANDLER( paldat_w )
{
- ttchamp_state *state = space->machine->driver_data<ttchamp_state>();
- palette_set_color_rgb(space->machine,state->paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
+ ttchamp_state *state = space->machine().driver_data<ttchamp_state>();
+ palette_set_color_rgb(space->machine(),state->paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
}
static READ16_HANDLER( peno_rand )
{
- return 0xffff;// space->machine->rand();
+ return 0xffff;// space->machine().rand();
}
#ifdef UNUSED_FUNCTION
static READ16_HANDLER( peno_rand2 )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -333,7 +333,7 @@ ROM_END
static DRIVER_INIT (ttchamp)
{
- UINT8 *ROM1 = machine->region("user1")->base();
+ UINT8 *ROM1 = machine.region("user1")->base();
memory_set_bankptr(machine, "bank1",&ROM1[0x120000]);
memory_set_bankptr(machine, "bank2",&ROM1[0x180000]);
}
diff --git a/src/mame/drivers/tubep.c b/src/mame/drivers/tubep.c
index b7ed0eb0dd4..8805fb2400f 100644
--- a/src/mame/drivers/tubep.c
+++ b/src/mame/drivers/tubep.c
@@ -124,7 +124,7 @@ static WRITE8_HANDLER( tubep_LS259_w )
port b0: bit0 - coin 1 counter
port b1 bit0 - coin 2 counter
*/
- coin_counter_w(space->machine, offset,data&1);
+ coin_counter_w(space->machine(), offset,data&1);
break;
case 2:
//something...
@@ -155,8 +155,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( main_cpu_irq_line_clear_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ tubep_state *state = space->machine().driver_data<tubep_state>();
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
logerror("CPU#0 VBLANK int clear at scanline=%3i\n", state->curr_scanline);
return;
}
@@ -164,7 +164,7 @@ static WRITE8_HANDLER( main_cpu_irq_line_clear_w )
static WRITE8_HANDLER( tubep_soundlatch_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->sound_latch = (data&0x7f) | 0x80;
}
@@ -193,8 +193,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( second_cpu_irq_line_clear_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
- cputag_set_input_line(space->machine, "slave", 0, CLEAR_LINE);
+ tubep_state *state = space->machine().driver_data<tubep_state>();
+ cputag_set_input_line(space->machine(), "slave", 0, CLEAR_LINE);
logerror("CPU#1 VBLANK int clear at scanline=%3i\n", state->curr_scanline);
return;
}
@@ -219,7 +219,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( tubep_soundlatch_r )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
int res;
res = state->sound_latch;
@@ -230,7 +230,7 @@ static READ8_HANDLER( tubep_soundlatch_r )
static READ8_HANDLER( tubep_sound_irq_ack )
{
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
return 0;
}
@@ -260,7 +260,7 @@ ADDRESS_MAP_END
static TIMER_CALLBACK( tubep_scanline_callback )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
int scanline = param;
state->curr_scanline = scanline;//for debugging
@@ -308,16 +308,16 @@ static TIMER_CALLBACK( tubep_scanline_callback )
}
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
//debug
- logerror("scanline=%3i scrgetvpos(0)=%3i\n",scanline,machine->primary_screen->vpos());
+ logerror("scanline=%3i scrgetvpos(0)=%3i\n",scanline,machine.primary_screen->vpos());
scanline++;
if (scanline >= 264)
scanline = 0;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
@@ -328,9 +328,9 @@ static TIMER_CALLBACK( tubep_scanline_callback )
*
*************************************/
-static void tubep_setup_save_state(running_machine *machine)
+static void tubep_setup_save_state(running_machine &machine)
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
/* Set up save state */
state_save_register_global(machine, state->sound_latch);
state_save_register_global(machine, state->ls74);
@@ -341,9 +341,9 @@ static void tubep_setup_save_state(running_machine *machine)
static MACHINE_START( tubep )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
/* Create interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(tubep_scanline_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(tubep_scanline_callback));
tubep_setup_save_state(machine);
}
@@ -351,8 +351,8 @@ static MACHINE_START( tubep )
static MACHINE_RESET( tubep )
{
- tubep_state *state = machine->driver_data<tubep_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(0));
+ tubep_state *state = machine.driver_data<tubep_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( rjammer_LS259_w )
{
case 0:
case 1:
- coin_counter_w(space->machine, offset,data&1); /* bit 0 = coin counter */
+ coin_counter_w(space->machine(), offset,data&1); /* bit 0 = coin counter */
break;
case 5:
//screen_flip_w(offset,data&1); /* bit 0 = screen flip, active high */
@@ -399,9 +399,9 @@ static WRITE8_HANDLER( rjammer_LS259_w )
static WRITE8_HANDLER( rjammer_soundlatch_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->sound_latch = data;
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -446,7 +446,7 @@ ADDRESS_MAP_END
static TIMER_CALLBACK( rjammer_scanline_callback )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
int scanline = param;
state->curr_scanline = scanline;//for debugging
@@ -494,31 +494,31 @@ static TIMER_CALLBACK( rjammer_scanline_callback )
}
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
- logerror("scanline=%3i scrgetvpos(0)=%3i\n", scanline, machine->primary_screen->vpos());
+ logerror("scanline=%3i scrgetvpos(0)=%3i\n", scanline, machine.primary_screen->vpos());
scanline++;
if (scanline >= 264)
scanline = 0;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( rjammer )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
/* Create interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(rjammer_scanline_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(rjammer_scanline_callback));
tubep_setup_save_state(machine);
}
static MACHINE_RESET( rjammer )
{
- tubep_state *state = machine->driver_data<tubep_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(0));
+ tubep_state *state = machine.driver_data<tubep_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -531,7 +531,7 @@ static MACHINE_RESET( rjammer )
static READ8_HANDLER( rjammer_soundlatch_r )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
int res = state->sound_latch;
return res;
}
@@ -562,13 +562,13 @@ static WRITE8_DEVICE_HANDLER( rjammer_voice_frequency_select_w )
static void rjammer_adpcm_vck (device_t *device)
{
- tubep_state *state = device->machine->driver_data<tubep_state>();
+ tubep_state *state = device->machine().driver_data<tubep_state>();
state->ls74 = (state->ls74 + 1) & 1;
if (state->ls74 == 1)
{
msm5205_data_w(device, (state->ls377 >> 0) & 15 );
- cputag_set_input_line(device->machine, "soundcpu", 0, ASSERT_LINE );
+ cputag_set_input_line(device->machine(), "soundcpu", 0, ASSERT_LINE );
}
else
{
@@ -580,7 +580,7 @@ static void rjammer_adpcm_vck (device_t *device)
static WRITE8_HANDLER( rjammer_voice_input_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
/* 8 bits of adpcm data for MSM5205 */
/* need to buffer the data, and switch two nibbles on two following interrupts*/
@@ -591,7 +591,7 @@ static WRITE8_HANDLER( rjammer_voice_input_w )
I do it here because this port (0x80) is first one accessed
in the interrupt routine.
*/
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE );
return;
}
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index a7e80913c6e..1b4b9dc4509 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -50,7 +50,7 @@ static PALETTE_INIT( tugboat )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int r,g,b,brt;
@@ -71,13 +71,13 @@ static PALETTE_INIT( tugboat )
because I need the start_addr register to handle scrolling */
static WRITE8_HANDLER( tugboat_hd46505_0_w )
{
- tugboat_state *state = space->machine->driver_data<tugboat_state>();
+ tugboat_state *state = space->machine().driver_data<tugboat_state>();
if (offset == 0) state->reg0 = data & 0x0f;
else if (state->reg0 < 18) state->hd46505_0_reg[state->reg0] = data;
}
static WRITE8_HANDLER( tugboat_hd46505_1_w )
{
- tugboat_state *state = space->machine->driver_data<tugboat_state>();
+ tugboat_state *state = space->machine().driver_data<tugboat_state>();
if (offset == 0) state->reg1 = data & 0x0f;
else if (state->reg1 < 18) state->hd46505_1_reg[state->reg1] = data;
}
@@ -85,15 +85,15 @@ static WRITE8_HANDLER( tugboat_hd46505_1_w )
static WRITE8_HANDLER( tugboat_score_w )
{
- tugboat_state *state = space->machine->driver_data<tugboat_state>();
+ tugboat_state *state = space->machine().driver_data<tugboat_state>();
if (offset>=0x8) state->ram[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f;
if (offset<0x8 ) state->ram[0x291d + 32*offset + 32*9] = data ^ 0x0f;
}
-static void draw_tilemap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,
+static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,
int addr,int gfx0,int gfx1,int transparency)
{
- tugboat_state *state = machine->driver_data<tugboat_state>();
+ tugboat_state *state = machine.driver_data<tugboat_state>();
int x,y;
for (y = 0;y < 32;y++)
@@ -113,7 +113,7 @@ static void draw_tilemap(running_machine *machine, bitmap_t *bitmap,const rectan
rgn = gfx1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[rgn],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[rgn],
code,
color,
0,0,
@@ -127,13 +127,13 @@ static void draw_tilemap(running_machine *machine, bitmap_t *bitmap,const rectan
static SCREEN_UPDATE( tugboat )
{
- tugboat_state *state = screen->machine->driver_data<tugboat_state>();
+ tugboat_state *state = screen->machine().driver_data<tugboat_state>();
int startaddr0 = state->hd46505_0_reg[0x0c]*256 + state->hd46505_0_reg[0x0d];
int startaddr1 = state->hd46505_1_reg[0x0c]*256 + state->hd46505_1_reg[0x0d];
- draw_tilemap(screen->machine, bitmap,cliprect,startaddr0,0,1,FALSE);
- draw_tilemap(screen->machine, bitmap,cliprect,startaddr1,2,3,TRUE);
+ draw_tilemap(screen->machine(), bitmap,cliprect,startaddr0,0,1,FALSE);
+ draw_tilemap(screen->machine(), bitmap,cliprect,startaddr1,2,3,TRUE);
return 0;
}
@@ -141,28 +141,28 @@ static SCREEN_UPDATE( tugboat )
static READ8_DEVICE_HANDLER( tugboat_input_r )
{
- tugboat_state *state = device->machine->driver_data<tugboat_state>();
+ tugboat_state *state = device->machine().driver_data<tugboat_state>();
if (~state->ctrl & 0x80)
- return input_port_read(device->machine, "IN0");
+ return input_port_read(device->machine(), "IN0");
else if (~state->ctrl & 0x40)
- return input_port_read(device->machine, "IN1");
+ return input_port_read(device->machine(), "IN1");
else if (~state->ctrl & 0x20)
- return input_port_read(device->machine, "IN2");
+ return input_port_read(device->machine(), "IN2");
else if (~state->ctrl & 0x10)
- return input_port_read(device->machine, "IN3");
+ return input_port_read(device->machine(), "IN3");
else
- return input_port_read(device->machine, "IN4");
+ return input_port_read(device->machine(), "IN4");
}
static READ8_DEVICE_HANDLER( tugboat_ctrl_r )
{
- tugboat_state *state = device->machine->driver_data<tugboat_state>();
+ tugboat_state *state = device->machine().driver_data<tugboat_state>();
return state->ctrl;
}
static WRITE8_DEVICE_HANDLER( tugboat_ctrl_w )
{
- tugboat_state *state = device->machine->driver_data<tugboat_state>();
+ tugboat_state *state = device->machine().driver_data<tugboat_state>();
state->ctrl = data;
}
@@ -201,12 +201,12 @@ static const pia6821_interface pia1_intf =
static TIMER_CALLBACK( interrupt_gen )
{
cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
- machine->scheduler().timer_set(machine->primary_screen->frame_period(), FUNC(interrupt_gen));
+ machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(interrupt_gen));
}
static MACHINE_RESET( tugboat )
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(30*8+4), FUNC(interrupt_gen));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(30*8+4), FUNC(interrupt_gen));
}
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 44b37766f7f..12cecf540e9 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -328,7 +328,7 @@ static WRITE16_HANDLER( semicom_soundcmd_w );
static WRITE16_HANDLER( tumblepb_oki_w )
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
if (mem_mask == 0xffff)
{
oki->write(*space, 0, data & 0xff);
@@ -350,7 +350,7 @@ static READ16_HANDLER( tumblepb_prot_r )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( tumblepb_sound_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -358,7 +358,7 @@ static WRITE16_HANDLER( tumblepb_sound_w )
static WRITE16_HANDLER( jumppop_sound_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
}
@@ -370,11 +370,11 @@ static READ16_HANDLER( tumblepopb_controls_r )
switch (offset << 1)
{
case 0:
- return input_port_read(space->machine, "PLAYERS");
+ return input_port_read(space->machine(), "PLAYERS");
case 2:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 8:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 10: /* ? */
case 12:
return 0;
@@ -454,7 +454,7 @@ command 1 - stop?
static void tumbleb2_playmusic( device_t *device )
{
- tumbleb_state *state = device->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = device->machine().driver_data<tumbleb_state>();
okim6295_device *oki = downcast<okim6295_device *>(device);
int status = oki->read_status();
@@ -471,7 +471,7 @@ static void tumbleb2_playmusic( device_t *device )
static INTERRUPT_GEN( tumbleb2_interrupt )
{
- tumbleb_state *state = device->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = device->machine().driver_data<tumbleb_state>();
device_set_input_line(device, 6, HOLD_LINE);
tumbleb2_playmusic(state->oki);
}
@@ -497,9 +497,9 @@ static const int tumbleb_sound_lookup[256] = {
};
/* we use channels 1,2,3 for sound effects, and channel 4 for music */
-static void tumbleb2_set_music_bank( running_machine *machine, int bank )
+static void tumbleb2_set_music_bank( running_machine &machine, int bank )
{
- UINT8 *oki = machine->region("oki")->base();
+ UINT8 *oki = machine.region("oki")->base();
memcpy(&oki[0x38000], &oki[0x80000 + 0x38000 + 0x8000 * bank], 0x8000);
}
@@ -538,7 +538,7 @@ static void tumbleb2_play_sound( okim6295_device *oki, int data )
static void process_tumbleb2_music_command( okim6295_device *oki, int data )
{
- tumbleb_state *state = oki->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = oki->machine().driver_data<tumbleb_state>();
int status = oki->read_status();
if (data == 1) // stop?
@@ -628,7 +628,7 @@ static void process_tumbleb2_music_command( okim6295_device *oki, int data )
break;
}
- tumbleb2_set_music_bank(oki->machine, state->music_bank);
+ tumbleb2_set_music_bank(oki->machine(), state->music_bank);
tumbleb2_playmusic(oki);
}
}
@@ -704,7 +704,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( semibase_unknown_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( htchctch_main_map, AS_PROGRAM, 16 )
@@ -743,7 +743,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( jumpkids_sound_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -785,14 +785,14 @@ static WRITE16_HANDLER( semicom_soundcmd_w )
soundlatch_w(space, 0, data & 0xff);
// needed for Super Trio which reads the sound with polling
// device_spin_until_time(space->cpu, attotime::from_usec(100));
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
}
}
static WRITE8_HANDLER( oki_sound_bank_w )
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
memcpy(&oki[0x30000], &oki[(data * 0x10000) + 0x40000], 0x10000);
}
@@ -817,7 +817,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(jumppop_z80_bank_w)
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("audiocpu")->base() + 0x10000 + (0x4000 * data));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("audiocpu")->base() + 0x10000 + (0x4000 * data));
}
static ADDRESS_MAP_START( jumppop_sound_map, AS_PROGRAM, 8 )
@@ -828,7 +828,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(jumppop_z80latch_r)
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, 0);
}
@@ -866,8 +866,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( jumpkids_oki_bank_w )
{
- UINT8* sound1 = space->machine->region("oki")->base();
- UINT8* sound2 = space->machine->region("oki2")->base();
+ UINT8* sound1 = space->machine().region("oki")->base();
+ UINT8* sound2 = space->machine().region("oki2")->base();
int bank = data & 0x03;
memcpy(sound1 + 0x20000, sound2 + bank * 0x20000, 0x20000);
@@ -892,7 +892,7 @@ static READ8_HANDLER( prot_io_r )
// probably not endian safe
static WRITE8_HANDLER( prot_io_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
switch (offset)
{
@@ -2045,11 +2045,11 @@ GFXDECODE_END
static MACHINE_START( tumbleb )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->oki = machine->device("oki");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->oki = machine.device("oki");
state->save_item(NAME(state->music_command));
state->save_item(NAME(state->music_bank));
@@ -2062,7 +2062,7 @@ static MACHINE_START( tumbleb )
static MACHINE_RESET( tumbleb )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->music_command = 0;
state->music_bank = 0;
@@ -2210,7 +2210,7 @@ MACHINE_CONFIG_END
static void semicom_irqhandler( device_t *device, int irq )
{
- tumbleb_state *state = device->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = device->machine().driver_data<tumbleb_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2222,11 +2222,11 @@ static const ym2151_interface semicom_ym2151_interface =
static MACHINE_RESET (htchctch)
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
/* copy protection data every reset */
- UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
- int i, len = machine->region("user1")->bytes();
+ UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ int i, len = machine.region("user1")->bytes();
for (i = 0; i < len / 2; i++)
state->mainram[0x000/2 + i] = PROTDATA[i];
@@ -3345,20 +3345,20 @@ ROM_END
/******************************************************************************/
#if TUMBLEP_HACK
-void tumblepb_patch_code(running_machine *machine, UINT16 offset)
+void tumblepb_patch_code(running_machine &machine, UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
#endif
-static void tumblepb_gfx1_rearrange(running_machine *machine)
+static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
@@ -3387,7 +3387,7 @@ static DRIVER_INIT( tumblepb )
static DRIVER_INIT( tumbleb2 )
{
- device_t *oki = machine->device("oki");
+ device_t *oki = machine.device("oki");
tumblepb_gfx1_rearrange(machine);
@@ -3395,7 +3395,7 @@ static DRIVER_INIT( tumbleb2 )
tumblepb_patch_code(machine, 0x000132);
#endif
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki, 0x100000, 0x100001, FUNC(tumbleb2_soundmcu_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*oki, 0x100000, 0x100001, FUNC(tumbleb2_soundmcu_w) );
}
@@ -3415,7 +3415,7 @@ static DRIVER_INIT( fncywld )
#if FNCYWLD_HACK
/* This is a hack to allow you to use the extra features
of the 2 first "Unused" Dip Switch (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x0005fa/2] = 0x4e71;
RAM[0x00060a/2] = 0x4e71;
#endif
@@ -3427,23 +3427,23 @@ static READ16_HANDLER( bcstory_1a0_read )
//mame_printf_debug("bcstory_io %06x\n",cpu_get_pc(space->cpu));
if (cpu_get_pc(space->cpu)==0x0560) return 0x1a0;
- else return input_port_read(space->machine, "SYSTEM");
+ else return input_port_read(space->machine(), "SYSTEM");
}
static DRIVER_INIT ( bcstory )
{
tumblepb_gfx1_rearrange(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180008, 0x180009, FUNC(bcstory_1a0_read) ); // io should be here??
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180008, 0x180009, FUNC(bcstory_1a0_read) ); // io should be here??
}
static DRIVER_INIT( htchctch )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
-// UINT16 *HCROM = (UINT16*)machine->region("maincpu")->base();
- UINT16 *PROTDATA = (UINT16*)machine->region("user1")->base();
- int i, len = machine->region("user1")->bytes();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
+// UINT16 *HCROM = (UINT16*)machine.region("maincpu")->base();
+ UINT16 *PROTDATA = (UINT16*)machine.region("user1")->base();
+ int i, len = machine.region("user1")->bytes();
/* simulate RAM initialization done by the protection MCU */
/* verified on real hardware */
// static const UINT16 htchctch_mcu68k[] =
@@ -3675,7 +3675,7 @@ static DRIVER_INIT( htchctch )
HCROM[0x1e228/2] = 0x4e75;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x140000, 0x1407ff); // kill palette writes as the interrupt code we don't have controls them
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x140000, 0x1407ff); // kill palette writes as the interrupt code we don't have controls them
{
@@ -3693,9 +3693,9 @@ static DRIVER_INIT( htchctch )
}
-static void suprtrio_decrypt_code(running_machine *machine)
+static void suprtrio_decrypt_code(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x80000/2);
int i;
@@ -3711,9 +3711,9 @@ static void suprtrio_decrypt_code(running_machine *machine)
auto_free(machine, buf);
}
-static void suprtrio_decrypt_gfx(running_machine *machine)
+static void suprtrio_decrypt_gfx(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine->region("gfx1")->base();
+ UINT16 *rom = (UINT16 *)machine.region("gfx1")->base();
UINT16 *buf = auto_alloc_array(machine, UINT16, 0x100000/2);
int i;
@@ -3739,26 +3739,26 @@ static DRIVER_INIT( chokchok )
DRIVER_INIT_CALL(htchctch);
/* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x140000, 0x140fff, FUNC(paletteram16_xxxxBBBBGGGGRRRR_word_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x140000, 0x140fff, FUNC(paletteram16_xxxxBBBBGGGGRRRR_word_w));
/* slightly different banking */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x100002, 0x100003, FUNC(chokchok_tilebank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x100002, 0x100003, FUNC(chokchok_tilebank_w));
}
static DRIVER_INIT( wlstar )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
tumblepb_gfx1_rearrange(machine);
/* slightly different banking */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x100002, 0x100003, FUNC(wlstar_tilebank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x100002, 0x100003, FUNC(wlstar_tilebank_w));
state->protbase = 0x0000;
}
static DRIVER_INIT( wondl96 )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
DRIVER_INIT_CALL( wlstar );
state->protbase = 0x0200;
}
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index 1e6e83faf35..66b99371f35 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -70,7 +70,7 @@ static READ16_HANDLER( tumblep_prot_r )
static WRITE16_HANDLER( tumblep_sound_w )
{
- tumblep_state *state = space->machine->driver_data<tumblep_state>();
+ tumblep_state *state = space->machine().driver_data<tumblep_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -78,7 +78,7 @@ static WRITE16_HANDLER( tumblep_sound_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( jumppop_sound_w )
{
- tumblep_state *state = space->machine->driver_data<tumblep_state>();
+ tumblep_state *state = space->machine().driver_data<tumblep_state>();
soundlatch_w(space, 0, data & 0xff);
cputag_set_input_line(state->audiocpu, 0, ASSERT_LINE );
}
@@ -91,11 +91,11 @@ static READ16_HANDLER( tumblepop_controls_r )
switch (offset << 1)
{
case 0:
- return input_port_read(space->machine, "PLAYERS");
+ return input_port_read(space->machine(), "PLAYERS");
case 2:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 8:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 10: /* ? */
case 12:
return 0;
@@ -276,7 +276,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- tumblep_state *driver_state = device->machine->driver_data<tumblep_state>();
+ tumblep_state *driver_state = device->machine().driver_data<tumblep_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -298,11 +298,11 @@ static const deco16ic_interface tumblep_deco16ic_tilegen1_intf =
static MACHINE_START( tumblep )
{
- tumblep_state *state = machine->driver_data<tumblep_state>();
+ tumblep_state *state = machine.driver_data<tumblep_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( tumblep, tumblep_state )
@@ -392,7 +392,7 @@ ROM_END
void tumblep_patch_code(UINT16 offset)
{
/* A hack which enables all Dip Switches effects */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[(offset + 0)/2] = 0x0240;
RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0
}
diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c
index 73d30683786..3a42993fe62 100644
--- a/src/mame/drivers/tunhunt.c
+++ b/src/mame/drivers/tunhunt.c
@@ -72,12 +72,12 @@ static WRITE8_HANDLER( tunhunt_control_w )
0x40 start LED
0x80 in-game
*/
- tunhunt_state *state = space->machine->driver_data<tunhunt_state>();
+ tunhunt_state *state = space->machine().driver_data<tunhunt_state>();
state->control = data;
- coin_counter_w( space->machine, 0,data&0x01 );
- coin_counter_w( space->machine, 1,data&0x02 );
- set_led_status( space->machine, 0, data&0x40 ); /* start */
+ coin_counter_w( space->machine(), 0,data&0x01 );
+ coin_counter_w( space->machine(), 1,data&0x02 );
+ set_led_status( space->machine(), 0, data&0x40 ); /* start */
}
@@ -90,38 +90,38 @@ static WRITE8_HANDLER( tunhunt_control_w )
static READ8_HANDLER( tunhunt_button_r )
{
- int data = input_port_read(space->machine, "IN0");
+ int data = input_port_read(space->machine(), "IN0");
return ((data>>offset)&1)?0x00:0x80;
}
static READ8_DEVICE_HANDLER( dsw2_0r )
{
- return (input_port_read(device->machine, "DSW")&0x0100)?0x80:0x00;
+ return (input_port_read(device->machine(), "DSW")&0x0100)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_1r )
{
- return (input_port_read(device->machine, "DSW")&0x0200)?0x80:0x00;
+ return (input_port_read(device->machine(), "DSW")&0x0200)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_2r )
{
- return (input_port_read(device->machine, "DSW")&0x0400)?0x80:0x00;
+ return (input_port_read(device->machine(), "DSW")&0x0400)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_3r )
{
- return (input_port_read(device->machine, "DSW")&0x0800)?0x80:0x00;
+ return (input_port_read(device->machine(), "DSW")&0x0800)?0x80:0x00;
}
static READ8_DEVICE_HANDLER( dsw2_4r )
{
- return (input_port_read(device->machine, "DSW")&0x1000)?0x80:0x00;
+ return (input_port_read(device->machine(), "DSW")&0x1000)?0x80:0x00;
}
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 08aee3f364b..177f9b9e522 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -189,7 +189,7 @@ static READ8_DEVICE_HANDLER( turbo_analog_r );
static MACHINE_RESET( buckrog )
{
- turbo_state *state = machine->driver_data<turbo_state>();
+ turbo_state *state = machine.driver_data<turbo_state>();
state->buckrog_command = 0x00;
}
@@ -212,7 +212,7 @@ static MACHINE_RESET( buckrog )
static WRITE8_DEVICE_HANDLER( turbo_ppi0a_w )
{
/* bit0-7 = 0PA0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_opa = data;
}
@@ -220,7 +220,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0a_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi0b_w )
{
/* bit0-7 = 0PB0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_opb = data;
}
@@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0b_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi0c_w )
{
/* bit0-7 = 0PC0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_opc = data;
}
@@ -236,7 +236,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0c_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1a_w )
{
/* bit0-7 = 1PA0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_ipa = data;
}
@@ -244,7 +244,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi1a_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1b_w )
{
/* bit0-7 = 1PB0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_ipb = data;
}
@@ -252,7 +252,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi1b_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1c_w )
{
/* bit0-7 = 1PC0-7 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_ipc = data;
}
@@ -262,7 +262,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi3c_w )
/* bit 0-3 = PLA0-3 */
/* bit 4-6 = COL0-2 */
/* bit 7 = n/c */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->turbo_fbpla = data & 0x0f;
state->turbo_fbcol = (data >> 4) & 0x07;
}
@@ -322,7 +322,7 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0a_w )
{
/* bit 0-3 = PLY0-3 */
/* bit 4-7 = n/c */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->subroc3d_ply = data & 0x0f;
}
@@ -330,7 +330,7 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0a_w )
static WRITE8_DEVICE_HANDLER( subroc3d_ppi0c_w )
{
/* bit 0-3 = COL0-3 */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->subroc3d_col = data & 0x0f;
}
@@ -342,10 +342,10 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0b_w )
/* bit 2 = STLA (START LAMP) */
/* bit 3 = NOUSE (n/c) */
/* bit 4 = FLIP (not really flip, just offset) */
- turbo_state *state = device->machine->driver_data<turbo_state>();
- coin_counter_w(device->machine, 0, data & 0x01);
- coin_counter_w(device->machine, 1, data & 0x02);
- set_led_status(device->machine, 0, data & 0x04);
+ turbo_state *state = device->machine().driver_data<turbo_state>();
+ coin_counter_w(device->machine(), 0, data & 0x01);
+ coin_counter_w(device->machine(), 1, data & 0x02);
+ set_led_status(device->machine(), 0, data & 0x04);
state->subroc3d_flip = (data >> 4) & 1;
}
@@ -381,7 +381,7 @@ static const ppi8255_interface subroc3d_8255_intf[2] =
static WRITE8_DEVICE_HANDLER( buckrog_ppi0a_w )
{
/* bit 0-7 = data to be read on the /IOREQ */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->buckrog_command = data;
}
@@ -390,7 +390,7 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi0b_w )
{
/* bit 0-5 = MOV0-5 */
/* bit 6-7 = n/c */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->buckrog_mov = data & 0x3f;
}
@@ -401,9 +401,9 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi0c_w )
/* bit 3-5 = n/c */
/* bit 6 = /IOREQ on the 2nd CPU */
/* bit 7 = /INT on the 2nd CPU */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->buckrog_fchg = data & 0x07;
- cputag_set_input_line(device->machine, "sub", 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "sub", 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -415,11 +415,11 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi1c_w )
/* bit 5 = COM2 (COIN METER 2) */
/* bit 6 = STLA (START LAMP) */
/* bit 7 = NOUSE (BODY SONIC) */
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->buckrog_obch = data & 0x07;
- coin_counter_w(device->machine, 0, data & 0x10);
- coin_counter_w(device->machine, 1, data & 0x20);
- set_led_status(device->machine, 0, data & 0x40);
+ coin_counter_w(device->machine(), 0, data & 0x10);
+ coin_counter_w(device->machine(), 1, data & 0x20);
+ set_led_status(device->machine(), 0, data & 0x40);
}
@@ -479,7 +479,7 @@ static void update_outputs(i8279_state *chip, UINT16 which)
static READ8_HANDLER( turbo_8279_r )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
+ turbo_state *state = space->machine().driver_data<turbo_state>();
i8279_state *chip = &state->i8279;
UINT8 result = 0xff;
UINT8 addr;
@@ -491,7 +491,7 @@ static READ8_HANDLER( turbo_8279_r )
{
/* read sensor RAM */
case 0x40:
- result = ~input_port_read(space->machine, "DSW1"); /* DSW 1 - inverted! */
+ result = ~input_port_read(space->machine(), "DSW1"); /* DSW 1 - inverted! */
break;
/* read display RAM */
@@ -520,7 +520,7 @@ static READ8_HANDLER( turbo_8279_r )
static WRITE8_HANDLER( turbo_8279_w )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
+ turbo_state *state = space->machine().driver_data<turbo_state>();
i8279_state *chip = &state->i8279;
UINT8 addr;
@@ -624,31 +624,31 @@ static WRITE8_HANDLER( turbo_8279_w )
static READ8_HANDLER( turbo_collision_r )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
- return input_port_read(space->machine, "DSW3") | (state->turbo_collision & 15);
+ turbo_state *state = space->machine().driver_data<turbo_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ return input_port_read(space->machine(), "DSW3") | (state->turbo_collision & 15);
}
static WRITE8_HANDLER( turbo_collision_clear_w )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ turbo_state *state = space->machine().driver_data<turbo_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->turbo_collision = 0;
}
static READ8_DEVICE_HANDLER( turbo_analog_r )
{
- turbo_state *state = device->machine->driver_data<turbo_state>();
- return input_port_read(device->machine, "DIAL") - state->turbo_last_analog;
+ turbo_state *state = device->machine().driver_data<turbo_state>();
+ return input_port_read(device->machine(), "DIAL") - state->turbo_last_analog;
}
static WRITE8_HANDLER( turbo_analog_reset_w )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
- state->turbo_last_analog = input_port_read(space->machine, "DIAL");
+ turbo_state *state = space->machine().driver_data<turbo_state>();
+ state->turbo_last_analog = input_port_read(space->machine(), "DIAL");
}
@@ -657,13 +657,13 @@ static WRITE8_HANDLER( turbo_coin_and_lamp_w )
switch (offset & 7)
{
case 0:
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
break;
case 1:
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
break;
case 3:
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
break;
}
}
@@ -679,16 +679,16 @@ static WRITE8_HANDLER( turbo_coin_and_lamp_w )
static READ8_HANDLER( buckrog_cpu2_command_r )
{
/* assert ACK */
- turbo_state *state = space->machine->driver_data<turbo_state>();
- ppi8255_set_port_c(space->machine->device("ppi8255_0"), 0x00);
+ turbo_state *state = space->machine().driver_data<turbo_state>();
+ ppi8255_set_port_c(space->machine().device("ppi8255_0"), 0x00);
return state->buckrog_command;
}
static READ8_HANDLER( buckrog_port_2_r )
{
- int inp1 = input_port_read(space->machine, "DSW1");
- int inp2 = input_port_read(space->machine, "DSW2");
+ int inp1 = input_port_read(space->machine(), "DSW1");
+ int inp2 = input_port_read(space->machine(), "DSW2");
return (((inp2 >> 6) & 1) << 7) |
(((inp2 >> 4) & 1) << 6) |
@@ -703,8 +703,8 @@ static READ8_HANDLER( buckrog_port_2_r )
static READ8_HANDLER( buckrog_port_3_r )
{
- int inp1 = input_port_read(space->machine, "DSW1");
- int inp2 = input_port_read(space->machine, "DSW2");
+ int inp1 = input_port_read(space->machine(), "DSW1");
+ int inp2 = input_port_read(space->machine(), "DSW2");
return (((inp2 >> 7) & 1) << 7) |
(((inp2 >> 5) & 1) << 6) |
@@ -719,7 +719,7 @@ static READ8_HANDLER( buckrog_port_3_r )
static TIMER_CALLBACK( delayed_ppi8255_w )
{
- ppi8255_w(machine->device("ppi8255_0"), param >> 8, param & 0xff);
+ ppi8255_w(machine.device("ppi8255_0"), param >> 8, param & 0xff);
}
@@ -727,7 +727,7 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi8255_0_w )
{
/* the port C handshaking signals control the sub CPU IRQ, */
/* so we have to sync whenever we access this PPI */
- device->machine->scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
+ device->machine().scheduler().synchronize(FUNC(delayed_ppi8255_w), ((offset & 3) << 8) | (data & 0xff));
}
@@ -1674,7 +1674,7 @@ ROM_END
*
*************************************/
-static void turbo_rom_decode(running_machine *machine)
+static void turbo_rom_decode(running_machine &machine)
{
/*
* The table is arranged this way (second half is mirror image of first)
@@ -1760,7 +1760,7 @@ static void turbo_rom_decode(running_machine *machine)
2,1,2,1 /* 0x5000-0x5fff */
};
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int offs, i, j;
UINT8 src;
diff --git a/src/mame/drivers/tutankhm.c b/src/mame/drivers/tutankhm.c
index e6abb7bdeef..804859afa03 100644
--- a/src/mame/drivers/tutankhm.c
+++ b/src/mame/drivers/tutankhm.c
@@ -63,7 +63,7 @@
static INTERRUPT_GEN( tutankhm_interrupt )
{
- tutankhm_state *state = device->machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = device->machine().driver_data<tutankhm_state>();
/* flip flops cause the interrupt to be signalled every other frame */
state->irq_toggle ^= 1;
@@ -74,7 +74,7 @@ static INTERRUPT_GEN( tutankhm_interrupt )
static WRITE8_HANDLER( irq_enable_w )
{
- tutankhm_state *state = space->machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = space->machine().driver_data<tutankhm_state>();
state->irq_enable = data & 1;
if (!state->irq_enable)
@@ -90,7 +90,7 @@ static WRITE8_HANDLER( irq_enable_w )
static WRITE8_HANDLER( tutankhm_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
@@ -102,13 +102,13 @@ static WRITE8_HANDLER( tutankhm_bankselect_w )
static WRITE8_HANDLER( sound_mute_w )
{
- space->machine->sound().system_mute(data & 1);
+ space->machine().sound().system_mute(data & 1);
}
static WRITE8_HANDLER( tutankhm_coin_counter_w )
{
- coin_counter_w(space->machine, offset ^ 1, data);
+ coin_counter_w(space->machine(), offset ^ 1, data);
}
@@ -197,11 +197,11 @@ INPUT_PORTS_END
static MACHINE_START( tutankhm )
{
- tutankhm_state *state = machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = machine.driver_data<tutankhm_state>();
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
- state->maincpu = machine->device<cpu_device>("maincpu");
+ state->maincpu = machine.device<cpu_device>("maincpu");
state->save_item(NAME(state->irq_toggle));
state->save_item(NAME(state->irq_enable));
@@ -211,7 +211,7 @@ static MACHINE_START( tutankhm )
static MACHINE_RESET( tutankhm )
{
- tutankhm_state *state = machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = machine.driver_data<tutankhm_state>();
state->irq_toggle = 0;
state->irq_enable = 0;
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index c75921c8ae2..8e29c6c32fc 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -61,9 +61,9 @@ Known Issues:
-int twin16_spriteram_process_enable( running_machine *machine )
+int twin16_spriteram_process_enable( running_machine &machine )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
return (state->CPUA_register & 0x40) == 0;
}
@@ -76,45 +76,45 @@ int twin16_spriteram_process_enable( running_machine *machine )
static READ16_HANDLER( videoram16_r )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
UINT16 *videoram = state->videoram;
return videoram[offset];
}
static WRITE16_HANDLER( videoram16_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(videoram + offset);
}
static READ16_HANDLER( extra_rom_r )
{
- return ((UINT16 *)space->machine->region("gfx3")->base())[offset];
+ return ((UINT16 *)space->machine().region("gfx3")->base())[offset];
}
static READ16_HANDLER( twin16_gfx_rom1_r )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
return state->gfx_rom[offset + ((state->CPUB_register&0x04)?0x40000:0)];
}
static READ16_HANDLER( twin16_gfx_rom2_r )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
return state->gfx_rom[offset + 0x80000 + ((state->CPUB_register&0x04)?0x40000:0)];
}
static WRITE16_HANDLER( sound_command_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
COMBINE_DATA(&state->sound_command);
soundlatch_w( space, 0, state->sound_command&0xff );
}
static WRITE16_HANDLER( twin16_CPUA_register_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
/*
7 6 5 4 3 2 1 0
X sprite processing disable
@@ -128,23 +128,23 @@ static WRITE16_HANDLER( twin16_CPUA_register_w )
if (state->CPUA_register != old)
{
if ((old & 0x08) == 0 && (state->CPUA_register & 0x08))
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
if ((old & 0x40) && (state->CPUA_register & 0x40) == 0)
- twin16_spriteram_process(space->machine);
+ twin16_spriteram_process(space->machine());
if ((old & 0x10) == 0 && (state->CPUA_register & 0x10))
- cputag_set_input_line(space->machine, "sub", M68K_IRQ_6, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", M68K_IRQ_6, HOLD_LINE);
- coin_counter_w(space->machine, 0, state->CPUA_register & 0x01);
- coin_counter_w(space->machine, 1, state->CPUA_register & 0x02);
- coin_counter_w(space->machine, 2, state->CPUA_register & 0x04);
+ coin_counter_w(space->machine(), 0, state->CPUA_register & 0x01);
+ coin_counter_w(space->machine(), 1, state->CPUA_register & 0x02);
+ coin_counter_w(space->machine(), 2, state->CPUA_register & 0x04);
}
}
static WRITE16_HANDLER( twin16_CPUB_register_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
/*
7 6 5 4 3 2 1 0
X gfx bank select
@@ -156,13 +156,13 @@ static WRITE16_HANDLER( twin16_CPUB_register_w )
if( state->CPUB_register!=old )
{
if ((old & 0x01) == 0 && (state->CPUB_register & 0x01))
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_6, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_6, HOLD_LINE);
}
}
static WRITE16_HANDLER( fround_CPU_register_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
/*
7 6 5 4 3 2 1 0
X 0->1 trigger IRQ on sound CPU
@@ -173,10 +173,10 @@ static WRITE16_HANDLER( fround_CPU_register_w )
if (state->CPUA_register != old)
{
if ((old & 0x08) == 0 && (state->CPUA_register & 0x08))
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
- coin_counter_w(space->machine, 0, state->CPUA_register & 0x01);
- coin_counter_w(space->machine, 1, state->CPUA_register & 0x02);
+ coin_counter_w(space->machine(), 0, state->CPUA_register & 0x01);
+ coin_counter_w(space->machine(), 1, state->CPUA_register & 0x02);
}
}
@@ -184,13 +184,13 @@ static READ16_HANDLER( twin16_input_r )
{
switch( offset )
{
- case 0x00: return input_port_read(space->machine, "SYSTEM");
- case 0x01: return input_port_read(space->machine, "P1");
- case 0x02: return input_port_read(space->machine, "P2");
- case 0x03: return input_port_read(space->machine, "P3");
- case 0x08: return input_port_read(space->machine, "DSW2");
- case 0x09: return input_port_read(space->machine, "DSW1");
- case 0x0c: return input_port_read(space->machine, "DSW3");
+ case 0x00: return input_port_read(space->machine(), "SYSTEM");
+ case 0x01: return input_port_read(space->machine(), "P1");
+ case 0x02: return input_port_read(space->machine(), "P2");
+ case 0x03: return input_port_read(space->machine(), "P3");
+ case 0x08: return input_port_read(space->machine(), "DSW2");
+ case 0x09: return input_port_read(space->machine(), "DSW1");
+ case 0x0c: return input_port_read(space->machine(), "DSW3");
default: break;
}
return 0;
@@ -213,19 +213,19 @@ static WRITE8_DEVICE_HANDLER( twin16_upd_start_w )
static READ16_HANDLER( cuebrickj_nvram_r )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
return state->cuebrickj_nvram[offset + (state->cuebrickj_nvram_bank * 0x400 / 2)];
}
static WRITE16_HANDLER( cuebrickj_nvram_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
COMBINE_DATA(&state->cuebrickj_nvram[offset + (state->cuebrickj_nvram_bank * 0x400 / 2)]);
}
static WRITE16_HANDLER( cuebrickj_nvram_bank_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
state->cuebrickj_nvram_bank = (data >> 8);
}
@@ -691,13 +691,13 @@ static const k007232_interface k007232_config =
static INTERRUPT_GEN( CPUA_interrupt )
{
- twin16_state *state = device->machine->driver_data<twin16_state>();
+ twin16_state *state = device->machine().driver_data<twin16_state>();
if (CPUA_IRQ_ENABLE) device_set_input_line(device, 5, HOLD_LINE);
}
static INTERRUPT_GEN( CPUB_interrupt )
{
- twin16_state *state = device->machine->driver_data<twin16_state>();
+ twin16_state *state = device->machine().driver_data<twin16_state>();
if (CPUB_IRQ_ENABLE) device_set_input_line(device, 5, HOLD_LINE);
}
@@ -710,7 +710,7 @@ static MACHINE_RESET( twin16 )
static MACHINE_START( twin16 )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
state->CPUA_register=0;
state->CPUB_register=0;
@@ -1305,14 +1305,14 @@ ROM_END
/* Driver Initialization */
-static void gfx_untangle( running_machine *machine )
+static void gfx_untangle( running_machine &machine )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
// sprite, tile data
int i;
UINT16 *temp = auto_alloc_array(machine, UINT16, 0x200000/2);
- state->gfx_rom = (UINT16 *)machine->region("gfx2")->base();
+ state->gfx_rom = (UINT16 *)machine.region("gfx2")->base();
memcpy( temp, state->gfx_rom, 0x200000 );
for( i=0; i<0x080000; i++ )
@@ -1325,24 +1325,24 @@ static void gfx_untangle( running_machine *machine )
static DRIVER_INIT( twin16 )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
gfx_untangle(machine);
state->custom_video = 0;
}
static DRIVER_INIT( fround )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
gfx_untangle(machine);
state->custom_video = 1;
}
static DRIVER_INIT( cuebrickj )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
gfx_untangle(machine);
- machine->device<nvram_device>("nvram")->set_base(state->cuebrickj_nvram, 0x400*0x20);
+ machine.device<nvram_device>("nvram")->set_base(state->cuebrickj_nvram, 0x400*0x20);
}
/* Game Drivers */
diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c
index 27158890775..f9a04dfb5d5 100644
--- a/src/mame/drivers/twincobr.c
+++ b/src/mame/drivers/twincobr.c
@@ -546,7 +546,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index 86e4eeca31c..21c7c2fd576 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -256,7 +256,7 @@ public:
static WRITE32_HANDLER( twinkle_unknown_w )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
/* printf( "set unknown data=%08x\n", data ); */
@@ -265,7 +265,7 @@ static WRITE32_HANDLER( twinkle_unknown_w )
static READ32_HANDLER( twinkle_unknown_r )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
UINT32 data = state->unknown;
/* printf( "get unknown data=%08x\n", data ); */
@@ -435,7 +435,7 @@ static const UINT16 asciicharset[]=
static WRITE32_HANDLER( twinkle_io_w )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
if( ACCESSING_BITS_16_23 )
{
@@ -501,7 +501,7 @@ static WRITE32_HANDLER( twinkle_io_w )
static READ32_HANDLER(twinkle_io_r)
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
UINT32 data = 0;
if( ACCESSING_BITS_0_7 )
@@ -509,27 +509,27 @@ static READ32_HANDLER(twinkle_io_r)
switch( state->io_offset )
{
case 0x07:
- data |= input_port_read( space->machine, "IN0" );
+ data |= input_port_read( space->machine(), "IN0" );
break;
case 0x0f:
- data |= input_port_read( space->machine, "IN1" );
+ data |= input_port_read( space->machine(), "IN1" );
break;
case 0x17:
- data |= input_port_read( space->machine, "IN2" );
+ data |= input_port_read( space->machine(), "IN2" );
break;
case 0x1f:
- data |= input_port_read( space->machine, "IN3" );
+ data |= input_port_read( space->machine(), "IN3" );
break;
case 0x27:
- data |= input_port_read( space->machine, "IN4" );
+ data |= input_port_read( space->machine(), "IN4" );
break;
case 0x2f:
- data |= input_port_read( space->machine, "IN5" );
+ data |= input_port_read( space->machine(), "IN5" );
break;
default:
@@ -593,7 +593,7 @@ static WRITE32_HANDLER(serial_w)
static WRITE32_HANDLER(shared_psx_w)
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
if (mem_mask == 0xff)
{
@@ -613,7 +613,7 @@ static WRITE32_HANDLER(shared_psx_w)
static READ32_HANDLER(shared_psx_r)
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
UINT32 result;
result = state->spu_shared[offset*2] | state->spu_shared[(offset*2)+1]<<16;
@@ -674,11 +674,11 @@ ADDRESS_MAP_END
static void ide_interrupt(device_t *device, int state_)
{
- twinkle_state *state = device->machine->driver_data<twinkle_state>();
+ twinkle_state *state = device->machine().driver_data<twinkle_state>();
if ((state_) && (state->spu_ctrl & 0x0400))
{
- cputag_set_input_line(device->machine, "audiocpu", M68K_IRQ_6, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M68K_IRQ_6, ASSERT_LINE);
}
}
@@ -712,7 +712,7 @@ static WRITE16_DEVICE_HANDLER( twinkle_ide_w )
*/
static WRITE16_HANDLER( twinkle_spu_ctrl_w )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
if ((!(data & 0x0080)) && (state->spu_ctrl & 0x0080))
{
@@ -736,21 +736,21 @@ static WRITE16_HANDLER( twinkle_spu_ctrl_w )
static READ16_HANDLER( twinkle_waveram_r )
{
- UINT16 *waveram = (UINT16 *)space->machine->region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)space->machine().region("rfsnd")->base();
return waveram[offset];
}
static WRITE16_HANDLER( twinkle_waveram_w )
{
- UINT16 *waveram = (UINT16 *)space->machine->region("rfsnd")->base();
+ UINT16 *waveram = (UINT16 *)space->machine().region("rfsnd")->base();
COMBINE_DATA(&waveram[offset]);
}
static READ16_HANDLER( shared_68k_r )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
// printf("shared_68k_r: @ %x, mask %x\n", offset, mem_mask);
@@ -759,7 +759,7 @@ static READ16_HANDLER( shared_68k_r )
static WRITE16_HANDLER( shared_68k_w )
{
- twinkle_state *state = space->machine->driver_data<twinkle_state>();
+ twinkle_state *state = space->machine().driver_data<twinkle_state>();
// printf("shared_68k_w: %x to %x, mask %x\n", data, offset, mem_mask);
@@ -783,9 +783,9 @@ ADDRESS_MAP_END
/* SCSI */
-static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- twinkle_state *state = machine->driver_data<twinkle_state>();
+ twinkle_state *state = machine.driver_data<twinkle_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
int i;
int n_this;
@@ -828,9 +828,9 @@ static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_s
}
}
-static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- twinkle_state *state = machine->driver_data<twinkle_state>();
+ twinkle_state *state = machine.driver_data<twinkle_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
int i;
int n_this;
@@ -863,7 +863,7 @@ static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_
}
}
-static void scsi_irq(running_machine *machine)
+static void scsi_irq(running_machine &machine)
{
psx_irq_set(machine, 0x400);
}
@@ -889,7 +889,7 @@ static DRIVER_INIT( twinkle )
psx_dma_install_read_handler(machine, 5, scsi_dma_read);
psx_dma_install_write_handler(machine, 5, scsi_dma_write);
- device_t *i2cmem = machine->device("security");
+ device_t *i2cmem = machine.device("security");
i2cmem_e0_write( i2cmem, 0 );
i2cmem_e1_write( i2cmem, 0 );
i2cmem_e2_write( i2cmem, 0 );
@@ -901,14 +901,14 @@ static MACHINE_RESET( twinkle )
psx_machine_init(machine);
/* also hook up CDDA audio to the CD-ROM drive */
- cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4));
+ cdda_set_cdrom(machine.device("cdda"), am53cf96_get_device(SCSI_ID_4));
}
static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c
index ce6a4539e15..942a8719a2c 100644
--- a/src/mame/drivers/twins.c
+++ b/src/mame/drivers/twins.c
@@ -78,7 +78,7 @@ static WRITE16_HANDLER( twins_port4_w )
static WRITE16_HANDLER( port6_pal0_w )
{
- twins_state *state = space->machine->driver_data<twins_state>();
+ twins_state *state = space->machine().driver_data<twins_state>();
COMBINE_DATA(&state->pal[state->paloff]);
state->paloff = (state->paloff + 1) & 0xff;
}
@@ -86,7 +86,7 @@ static WRITE16_HANDLER( port6_pal0_w )
/* ??? weird ..*/
static WRITE16_HANDLER( porte_paloff0_w )
{
- twins_state *state = space->machine->driver_data<twins_state>();
+ twins_state *state = space->machine().driver_data<twins_state>();
state->paloff = 0;
}
@@ -106,18 +106,18 @@ ADDRESS_MAP_END
static VIDEO_START(twins)
{
- twins_state *state = machine->driver_data<twins_state>();
+ twins_state *state = machine.driver_data<twins_state>();
state->pal = auto_alloc_array(machine, UINT16, 0x100);
}
static SCREEN_UPDATE(twins)
{
- twins_state *state = screen->machine->driver_data<twins_state>();
+ twins_state *state = screen->machine().driver_data<twins_state>();
int y,x,count;
int i;
static const int xxx=320,yyy=204;
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
for (i=0;i<0x100;i++)
{
@@ -133,7 +133,7 @@ static SCREEN_UPDATE(twins)
b = (dat>>10) & 0x1f;
b = BITSWAP8(b,7,6,5,0,1,2,3,4);
- palette_set_color_rgb(screen->machine,i, pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(screen->machine(),i, pal5bit(r),pal5bit(g),pal5bit(b));
}
count=0;
@@ -213,18 +213,18 @@ MACHINE_CONFIG_END
static VIDEO_START(twinsa)
{
- twins_state *state = machine->driver_data<twins_state>();
+ twins_state *state = machine.driver_data<twins_state>();
state->pal = auto_alloc_array(machine, UINT16, 0x1000);
}
static SCREEN_UPDATE(twinsa)
{
- twins_state *state = screen->machine->driver_data<twins_state>();
+ twins_state *state = screen->machine().driver_data<twins_state>();
int y,x,count;
int i;
static const int xxx=320,yyy=204;
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
for (i=0;i<0x1000-3;i+=3)
{
@@ -233,7 +233,7 @@ static SCREEN_UPDATE(twinsa)
g = state->pal[i+1];
b = state->pal[i+2];
- palette_set_color_rgb(screen->machine,i/3, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(screen->machine(),i/3, pal6bit(r), pal6bit(g), pal6bit(b));
}
count=0;
@@ -250,7 +250,7 @@ static SCREEN_UPDATE(twinsa)
static WRITE16_HANDLER( twinsa_port4_w )
{
- twins_state *state = space->machine->driver_data<twins_state>();
+ twins_state *state = space->machine().driver_data<twins_state>();
state->pal[state->paloff&0xfff] = data;
state->paloff++;
// printf("paloff %04x\n",state->paloff);
diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c
index 0040014ae75..4f3858eecbb 100644
--- a/src/mame/drivers/tx1.c
+++ b/src/mame/drivers/tx1.c
@@ -61,23 +61,23 @@
/* Main CPU and Z80 synchronisation */
static WRITE16_HANDLER( z80_busreq_w )
{
- cputag_set_input_line(space->machine, "audio_cpu", INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audio_cpu", INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( resume_math_w )
{
- cputag_set_input_line(space->machine, "math_cpu", INPUT_LINE_TEST, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "math_cpu", INPUT_LINE_TEST, ASSERT_LINE);
}
static WRITE16_HANDLER( halt_math_w )
{
- cputag_set_input_line(space->machine, "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
}
/* Z80 can trigger its own interrupts */
static WRITE8_HANDLER( z80_intreq_w )
{
- cputag_set_input_line(space->machine, "audio_cpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audio_cpu", 0, HOLD_LINE);
}
/* Periodic Z80 interrupt */
@@ -88,13 +88,13 @@ static INTERRUPT_GEN( z80_irq )
static READ16_HANDLER( z80_shared_r )
{
- address_space *cpu2space = space->machine->device("audio_cpu")->memory().space(AS_PROGRAM);
+ address_space *cpu2space = space->machine().device("audio_cpu")->memory().space(AS_PROGRAM);
return cpu2space->read_byte(offset);
}
static WRITE16_HANDLER( z80_shared_w )
{
- address_space *cpu2space = space->machine->device("audio_cpu")->memory().space(AS_PROGRAM);
+ address_space *cpu2space = space->machine().device("audio_cpu")->memory().space(AS_PROGRAM);
cpu2space->write_byte(offset, data & 0xff);
}
@@ -381,8 +381,8 @@ INPUT_PORTS_END
static READ16_HANDLER( dipswitches_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
- return (input_port_read(space->machine, "DSW") & 0xfffe) | state->ts;
+ tx1_state *state = space->machine().driver_data<tx1_state>();
+ return (input_port_read(space->machine(), "DSW") & 0xfffe) | state->ts;
}
/*
@@ -391,14 +391,14 @@ static READ16_HANDLER( dipswitches_r )
*/
static WRITE8_HANDLER( ts_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
// TS = 1;
state->z80_ram[offset] = data;
}
static READ8_HANDLER( ts_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
// TS = 1;
return state->z80_ram[offset];
}
@@ -406,35 +406,35 @@ static READ8_HANDLER( ts_r )
static WRITE8_DEVICE_HANDLER( tx1_coin_cnt_w )
{
- coin_counter_w(device->machine, 0, data & 0x80);
- coin_counter_w(device->machine, 1, data & 0x40);
-// coin_counter_w(device->machine, 2, data & 0x40);
+ coin_counter_w(device->machine(), 0, data & 0x80);
+ coin_counter_w(device->machine(), 1, data & 0x40);
+// coin_counter_w(device->machine(), 2, data & 0x40);
}
static WRITE8_DEVICE_HANDLER( bb_coin_cnt_w )
{
- coin_counter_w(device->machine, 0, data & 0x01);
- coin_counter_w(device->machine, 1, data & 0x02);
-// coin_counter_w(device->machine, 2, data & 0x04);
+ coin_counter_w(device->machine(), 0, data & 0x01);
+ coin_counter_w(device->machine(), 1, data & 0x02);
+// coin_counter_w(device->machine(), 2, data & 0x04);
}
static WRITE8_HANDLER( tx1_ppi_latch_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
- state->ppi_latch_a = ((input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4) | (input_port_read(space->machine, "AN_ACCELERATOR") & 0xf);
- state->ppi_latch_b = input_port_read(space->machine, "AN_STEERING");
+ tx1_state *state = space->machine().driver_data<tx1_state>();
+ state->ppi_latch_a = ((input_port_read(space->machine(), "AN_BRAKE") & 0xf) << 4) | (input_port_read(space->machine(), "AN_ACCELERATOR") & 0xf);
+ state->ppi_latch_b = input_port_read(space->machine(), "AN_STEERING");
}
static READ8_DEVICE_HANDLER( tx1_ppi_porta_r )
{
- tx1_state *state = device->machine->driver_data<tx1_state>();
+ tx1_state *state = device->machine().driver_data<tx1_state>();
return state->ppi_latch_a;
}
static READ8_DEVICE_HANDLER( tx1_ppi_portb_r )
{
- tx1_state *state = device->machine->driver_data<tx1_state>();
- return input_port_read(device->machine, "PPI_PORTD") | state->ppi_latch_b;
+ tx1_state *state = device->machine().driver_data<tx1_state>();
+ return input_port_read(device->machine(), "PPI_PORTD") | state->ppi_latch_b;
}
@@ -450,17 +450,17 @@ static UINT8 bit_reverse8(UINT8 val)
static READ8_HANDLER( bb_analog_r )
{
if (offset == 0)
- return bit_reverse8(((input_port_read(space->machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine, "AN_STEERING"));
+ return bit_reverse8(((input_port_read(space->machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine(), "AN_STEERING"));
else
- return bit_reverse8((input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4);
+ return bit_reverse8((input_port_read(space->machine(), "AN_BRAKE") & 0xf) << 4);
}
static READ8_HANDLER( bbjr_analog_r )
{
if (offset == 0)
- return ((input_port_read(space->machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine, "AN_STEERING");
+ return ((input_port_read(space->machine(), "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine(), "AN_STEERING");
else
- return (input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4;
+ return (input_port_read(space->machine(), "AN_BRAKE") & 0xf) << 4;
}
diff --git a/src/mame/drivers/uapce.c b/src/mame/drivers/uapce.c
index c7484386f01..c58e6b6977d 100644
--- a/src/mame/drivers/uapce.c
+++ b/src/mame/drivers/uapce.c
@@ -45,15 +45,15 @@ public:
static WRITE8_HANDLER( jamma_if_control_latch_w )
{
- uapce_state *state = space->machine->driver_data<uapce_state>();
+ uapce_state *state = space->machine().driver_data<uapce_state>();
UINT8 diff = data ^ state->jamma_if_control_latch;
state->jamma_if_control_latch = data;
- space->machine->sound().system_enable( (data >> 7) & 1 );
+ space->machine().sound().system_enable( (data >> 7) & 1 );
if ( diff & 0x40 )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
}
// bit 3 - enable 752 Hz (D-3) square wave output
@@ -63,7 +63,7 @@ static WRITE8_HANDLER( jamma_if_control_latch_w )
static READ8_HANDLER( jamma_if_control_latch_r )
{
- uapce_state *state = space->machine->driver_data<uapce_state>();
+ uapce_state *state = space->machine().driver_data<uapce_state>();
return state->jamma_if_control_latch & 0x08;
}
@@ -71,7 +71,7 @@ static READ8_HANDLER( jamma_if_read_dsw )
{
UINT8 dsw_val;
- dsw_val = input_port_read(space->machine, "DSW" );
+ dsw_val = input_port_read(space->machine(), "DSW" );
if ( BIT( offset, 7 ) == 0 )
{
@@ -109,9 +109,9 @@ static READ8_HANDLER( jamma_if_read_dsw )
return dsw_val & 1;
}
-static UINT8 jamma_if_read_joystick( running_machine *machine )
+static UINT8 jamma_if_read_joystick( running_machine &machine )
{
- uapce_state *state = machine->driver_data<uapce_state>();
+ uapce_state *state = machine.driver_data<uapce_state>();
if ( state->jamma_if_control_latch & 0x10 )
{
return input_port_read(machine, "JOY" );
@@ -124,7 +124,7 @@ static UINT8 jamma_if_read_joystick( running_machine *machine )
static MACHINE_RESET( uapce )
{
- uapce_state *state = machine->driver_data<uapce_state>();
+ uapce_state *state = machine.driver_data<uapce_state>();
pce_set_joystick_readinputport_callback( jamma_if_read_joystick );
state->jamma_if_control_latch = 0;
}
diff --git a/src/mame/drivers/ultraman.c b/src/mame/drivers/ultraman.c
index cdf3f232fe2..85f8dfdb85d 100644
--- a/src/mame/drivers/ultraman.c
+++ b/src/mame/drivers/ultraman.c
@@ -25,7 +25,7 @@ static WRITE16_HANDLER( sound_cmd_w )
static WRITE16_HANDLER( sound_irq_trigger_w )
{
- ultraman_state *state = space->machine->driver_data<ultraman_state>();
+ ultraman_state *state = space->machine().driver_data<ultraman_state>();
if (ACCESSING_BITS_0_7)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -193,14 +193,14 @@ static const k051316_interface ultraman_k051316_intf_2 =
static MACHINE_START( ultraman )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k051960 = machine->device("k051960");
- state->k051316_1 = machine->device("k051316_1");
- state->k051316_2 = machine->device("k051316_2");
- state->k051316_3 = machine->device("k051316_3");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k051960 = machine.device("k051960");
+ state->k051316_1 = machine.device("k051316_1");
+ state->k051316_2 = machine.device("k051316_2");
+ state->k051316_3 = machine.device("k051316_3");
state->save_item(NAME(state->bank0));
state->save_item(NAME(state->bank1));
@@ -209,7 +209,7 @@ static MACHINE_START( ultraman )
static MACHINE_RESET( ultraman )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
state->bank0 = -1;
state->bank1 = -1;
diff --git a/src/mame/drivers/ultratnk.c b/src/mame/drivers/ultratnk.c
index eb7c2fae9fc..ed3cffd02de 100644
--- a/src/mame/drivers/ultratnk.c
+++ b/src/mame/drivers/ultratnk.c
@@ -20,15 +20,15 @@ Atari Ultra Tank driver
static CUSTOM_INPUT( get_collision )
{
- ultratnk_state *state = field->port->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = field->port->machine().driver_data<ultratnk_state>();
return state->collision[(FPTR) param];
}
static CUSTOM_INPUT( get_joystick )
{
- ultratnk_state *state = field->port->machine->driver_data<ultratnk_state>();
- UINT8 joy = input_port_read(field->port->machine, (const char *)param) & 3;
+ ultratnk_state *state = field->port->machine().driver_data<ultratnk_state>();
+ UINT8 joy = input_port_read(field->port->machine(), (const char *)param) & 3;
if (joy == 1)
{
@@ -57,19 +57,19 @@ static TIMER_CALLBACK( nmi_callback )
if (input_port_read(machine, "IN0") & 0x40)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline);
}
static MACHINE_RESET( ultratnk )
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(32), FUNC(nmi_callback), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(32), FUNC(nmi_callback), 32);
}
static READ8_HANDLER( ultratnk_wram_r )
{
- ultratnk_state *state = space->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = space->machine().driver_data<ultratnk_state>();
UINT8 *videoram = state->videoram;
return videoram[0x380 + offset];
}
@@ -77,27 +77,27 @@ static READ8_HANDLER( ultratnk_wram_r )
static READ8_HANDLER( ultratnk_analog_r )
{
- return (input_port_read(space->machine, "ANALOG") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "ANALOG") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_coin_r )
{
- return (input_port_read(space->machine, "COIN") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "COIN") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_collision_r )
{
- return (input_port_read(space->machine, "COLLISION") << (~offset & 7)) & 0x80;
+ return (input_port_read(space->machine(), "COLLISION") << (~offset & 7)) & 0x80;
}
static READ8_HANDLER( ultratnk_options_r )
{
- return (input_port_read(space->machine, "DIP") >> (2 * (offset & 3))) & 3;
+ return (input_port_read(space->machine(), "DIP") >> (2 * (offset & 3))) & 3;
}
static WRITE8_HANDLER( ultratnk_wram_w )
{
- ultratnk_state *state = space->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = space->machine().driver_data<ultratnk_state>();
UINT8 *videoram = state->videoram;
videoram[0x380 + offset] = data;
}
@@ -105,31 +105,31 @@ static WRITE8_HANDLER( ultratnk_wram_w )
static WRITE8_HANDLER( ultratnk_collision_reset_w )
{
- ultratnk_state *state = space->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = space->machine().driver_data<ultratnk_state>();
state->collision[(offset >> 1) & 3] = 0;
}
static WRITE8_HANDLER( ultratnk_da_latch_w )
{
- ultratnk_state *state = space->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = space->machine().driver_data<ultratnk_state>();
state->da_latch = data & 15;
}
static WRITE8_HANDLER( ultratnk_led_1_w )
{
- set_led_status(space->machine, 0, offset & 1); /* left player start */
+ set_led_status(space->machine(), 0, offset & 1); /* left player start */
}
static WRITE8_HANDLER( ultratnk_led_2_w )
{
- set_led_status(space->machine, 1, offset & 1); /* right player start */
+ set_led_status(space->machine(), 1, offset & 1); /* right player start */
}
static WRITE8_HANDLER( ultratnk_lockout_w )
{
- coin_lockout_global_w(space->machine, ~offset & 1);
+ coin_lockout_global_w(space->machine(), ~offset & 1);
}
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index d1daa6cef1a..9eeea33462d 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -32,7 +32,7 @@ public:
static SCREEN_UPDATE( ultrsprt )
{
- ultrsprt_state *state = screen->machine->driver_data<ultrsprt_state>();
+ ultrsprt_state *state = screen->machine().driver_data<ultrsprt_state>();
int i, j;
UINT8 *ram = (UINT8 *)state->vram;
@@ -57,11 +57,11 @@ static SCREEN_UPDATE( ultrsprt )
static WRITE32_HANDLER( palette_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
- palette_set_color(space->machine, (offset*2)+0, MAKE_RGB(pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16)));
- palette_set_color(space->machine, (offset*2)+1, MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0)));
+ palette_set_color(space->machine(), (offset*2)+0, MAKE_RGB(pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16)));
+ palette_set_color(space->machine(), (offset*2)+1, MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0)));
}
static READ32_HANDLER( eeprom_r )
@@ -69,7 +69,7 @@ static READ32_HANDLER( eeprom_r )
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
- r |= input_port_read(space->machine, "SERVICE");
+ r |= input_port_read(space->machine(), "SERVICE");
return r;
}
@@ -77,29 +77,29 @@ static READ32_HANDLER( eeprom_r )
static WRITE32_HANDLER( eeprom_w )
{
if (ACCESSING_BITS_24_31)
- input_port_write(space->machine, "EEPROMOUT", data, 0xffffffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffffffff);
}
static CUSTOM_INPUT( analog_ctrl_r )
{
const char *tag = (const char *)param;
- return input_port_read(field->port->machine, tag) & 0xfff;
+ return input_port_read(field->port->machine(), tag) & 0xfff;
}
static WRITE32_HANDLER( int_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
}
static MACHINE_START( ultrsprt )
{
- ultrsprt_state *state = machine->driver_data<ultrsprt_state>();
+ ultrsprt_state *state = machine.driver_data<ultrsprt_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->vram);
- ppcdrc_add_fastram(machine->device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->workram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->vram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->workram);
}
@@ -123,7 +123,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( K056800_68k_r )
{
- device_t *k056800 = space->machine->device("k056800");
+ device_t *k056800 = space->machine().device("k056800");
UINT16 r = 0;
if (ACCESSING_BITS_8_15)
@@ -137,7 +137,7 @@ static READ16_HANDLER( K056800_68k_r )
static WRITE16_HANDLER( K056800_68k_w )
{
- device_t *k056800 = space->machine->device("k056800");
+ device_t *k056800 = space->machine().device("k056800");
if (ACCESSING_BITS_8_15)
k056800_sound_w(k056800, (offset*2)+0, (data >> 8) & 0xff, 0x00ff);
@@ -199,10 +199,10 @@ static INTERRUPT_GEN( ultrsprt_vblank )
device_set_input_line(device, INPUT_LINE_IRQ1, ASSERT_LINE);
}
-static void sound_irq_callback(running_machine *machine, int irq)
+static void sound_irq_callback(running_machine &machine, int irq)
{
if (irq == 0)
- /*generic_pulse_irq_line(machine->device("audiocpu"), INPUT_LINE_IRQ5)*/;
+ /*generic_pulse_irq_line(machine.device("audiocpu"), INPUT_LINE_IRQ5)*/;
else
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_IRQ6, HOLD_LINE);
}
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 54aa77b7985..55a735d6f7d 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -208,15 +208,15 @@ Extract a standard version of this
static WRITE32_HANDLER( color_ram_w )
{
int a,r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
{
- a = space->machine->generic.paletteram.u32[offset];
+ a = space->machine().generic.paletteram.u32[offset];
r = (a & 0xff0000) >> 16;
g = (a & 0xff00) >> 8;
b = (a & 0xff);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
}
@@ -253,23 +253,23 @@ static const eeprom_interface undrfire_eeprom_interface =
static CUSTOM_INPUT(frame_counter_r)
{
- undrfire_state *state = field->port->machine->driver_data<undrfire_state>();
+ undrfire_state *state = field->port->machine().driver_data<undrfire_state>();
return state->frame_counter;
}
static READ32_HANDLER( undrfire_input_r )
{
- undrfire_state *state = space->machine->driver_data<undrfire_state>();
+ undrfire_state *state = space->machine().driver_data<undrfire_state>();
switch (offset)
{
case 0x00:
{
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
}
case 0x01:
{
- return input_port_read(space->machine, "SYSTEM") | (state->coin_word << 16);
+ return input_port_read(space->machine(), "SYSTEM") | (state->coin_word << 16);
}
}
@@ -278,19 +278,19 @@ static READ32_HANDLER( undrfire_input_r )
static WRITE32_HANDLER( undrfire_input_w )
{
- undrfire_state *state = space->machine->driver_data<undrfire_state>();
+ undrfire_state *state = space->machine().driver_data<undrfire_state>();
switch (offset)
{
case 0x00:
{
if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -304,10 +304,10 @@ static WRITE32_HANDLER( undrfire_input_w )
{
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0,~data & 0x01000000);
- coin_lockout_w(space->machine, 1,~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x08000000);
+ coin_lockout_w(space->machine(), 0,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1,~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x08000000);
state->coin_word = (data >> 16) &0xffff;
}
}
@@ -317,14 +317,14 @@ static WRITE32_HANDLER( undrfire_input_w )
static READ16_HANDLER( shared_ram_r )
{
- undrfire_state *state = space->machine->driver_data<undrfire_state>();
+ undrfire_state *state = space->machine().driver_data<undrfire_state>();
if ((offset&1)==0) return (state->shared_ram[offset/2]&0xffff0000)>>16;
return (state->shared_ram[offset/2]&0x0000ffff);
}
static WRITE16_HANDLER( shared_ram_w )
{
- undrfire_state *state = space->machine->driver_data<undrfire_state>();
+ undrfire_state *state = space->machine().driver_data<undrfire_state>();
if ((offset&1)==0) {
if (ACCESSING_BITS_8_15)
state->shared_ram[offset/2]=(state->shared_ram[offset/2]&0x00ffffff)|((data&0xff00)<<16);
@@ -364,7 +364,7 @@ static READ32_HANDLER( unknown_hardware_r )
static WRITE32_HANDLER( unknown_int_req_w )
{
/* 10000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(interrupt5));
}
@@ -381,8 +381,8 @@ static READ32_HANDLER( undrfire_lightgun_r )
case 0x00: /* P1 */
{
- x = input_port_read(space->machine, "GUNX1") << 6;
- y = input_port_read(space->machine, "GUNY1") << 6;
+ x = input_port_read(space->machine(), "GUNX1") << 6;
+ y = input_port_read(space->machine(), "GUNY1") << 6;
return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
| ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
@@ -390,8 +390,8 @@ static READ32_HANDLER( undrfire_lightgun_r )
case 0x01: /* P2 */
{
- x = input_port_read(space->machine, "GUNX2") << 6;
- y = input_port_read(space->machine, "GUNY2") << 6;
+ x = input_port_read(space->machine(), "GUNX2") << 6;
+ y = input_port_read(space->machine(), "GUNY2") << 6;
return ((x << 24) &0xff000000) | ((x << 8) &0xff0000)
| ((y << 8) &0xff00) | ((y >> 8) &0xff) ;
@@ -406,7 +406,7 @@ logerror("CPU #0 PC %06x: warning - read unmapped lightgun offset %06x\n",cpu_ge
static WRITE32_HANDLER( rotate_control_w ) /* only a guess that it's rotation */
{
- undrfire_state *state = space->machine->driver_data<undrfire_state>();
+ undrfire_state *state = space->machine().driver_data<undrfire_state>();
if (ACCESSING_BITS_0_15)
{
state->rotate_ctrl[state->port_sel] = data;
@@ -443,19 +443,19 @@ static WRITE32_HANDLER( cbombers_cpua_ctrl_w )
........ .x...... Vibration
*/
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, (data & 0x1000) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, (data & 0x1000) ? CLEAR_LINE : ASSERT_LINE);
}
static READ32_HANDLER( cbombers_adc_r )
{
- return (input_port_read(space->machine, "STEER") << 24);
+ return (input_port_read(space->machine(), "STEER") << 24);
}
static WRITE32_HANDLER( cbombers_adc_w )
{
/* One interrupt per input port (4 per frame, though only 2 used).
1000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(interrupt5));
}
/***********************************************************
@@ -690,7 +690,7 @@ GFXDECODE_END
static INTERRUPT_GEN( undrfire_interrupt )
{
- undrfire_state *state = device->machine->driver_data<undrfire_state>();
+ undrfire_state *state = device->machine().driver_data<undrfire_state>();
state->frame_counter ^= 1;
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -963,8 +963,8 @@ ROM_END
static DRIVER_INIT( undrfire )
{
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx3")->base();
- int size=machine->region("gfx3")->bytes();
+ UINT8 *gfx = machine.region("gfx3")->base();
+ int size=machine.region("gfx3")->bytes();
int data;
/* make piv tile GFX format suitable for gfxdecode */
@@ -992,8 +992,8 @@ static DRIVER_INIT( undrfire )
static DRIVER_INIT( cbombers )
{
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx3")->base();
- int size=machine->region("gfx3")->bytes();
+ UINT8 *gfx = machine.region("gfx3")->base();
+ int size=machine.region("gfx3")->bytes();
int data;
diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c
index 7579b6d08df..b882fe499c0 100644
--- a/src/mame/drivers/unico.c
+++ b/src/mame/drivers/unico.c
@@ -91,55 +91,55 @@ static WRITE16_HANDLER( zeropnt_sound_bank_w )
contains garbage. Indeed, only banks 0&1 are used */
int bank = (data >> 8 ) & 1;
- UINT8 *dst = space->machine->region("oki")->base();
+ UINT8 *dst = space->machine().region("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
- coin_counter_w(space->machine, 0,data & 0x1000);
- set_led_status(space->machine, 0,data & 0x0800); // Start 1
- set_led_status(space->machine, 1,data & 0x0400); // Start 2
+ coin_counter_w(space->machine(), 0,data & 0x1000);
+ set_led_status(space->machine(), 0,data & 0x0800); // Start 1
+ set_led_status(space->machine(), 1,data & 0x0400); // Start 2
}
}
/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */
static READ16_HANDLER( unico_gunx_0_msb_r )
{
- int x=input_port_read(space->machine, "X0");
+ int x=input_port_read(space->machine(), "X0");
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
else x=((x-0x160) * 0x20)/0x1f;
- return ((x&0xff) ^ (space->machine->primary_screen->frame_number()&1))<<8;
+ return ((x&0xff) ^ (space->machine().primary_screen->frame_number()&1))<<8;
}
static READ16_HANDLER( unico_guny_0_msb_r )
{
- int y=input_port_read(space->machine, "Y0");
+ int y=input_port_read(space->machine(), "Y0");
y=0x18+((y*0xe0)/0xff);
- return ((y&0xff) ^ (space->machine->primary_screen->frame_number()&1))<<8;
+ return ((y&0xff) ^ (space->machine().primary_screen->frame_number()&1))<<8;
}
static READ16_HANDLER( unico_gunx_1_msb_r )
{
- int x=input_port_read(space->machine, "X1");
+ int x=input_port_read(space->machine(), "X1");
x=x*384/256; /* On screen pixel X */
if (x<0x160) x=0x30 + (x*0xd0/0x15f);
else x=((x-0x160) * 0x20)/0x1f;
- return ((x&0xff) ^ (space->machine->primary_screen->frame_number()&1))<<8;
+ return ((x&0xff) ^ (space->machine().primary_screen->frame_number()&1))<<8;
}
static READ16_HANDLER( unico_guny_1_msb_r )
{
- int y=input_port_read(space->machine, "Y1");
+ int y=input_port_read(space->machine(), "Y1");
y=0x18+((y*0xe0)/0xff);
- return ((y&0xff) ^ (space->machine->primary_screen->frame_number()&1))<<8;
+ return ((y&0xff) ^ (space->machine().primary_screen->frame_number()&1))<<8;
}
static ADDRESS_MAP_START( zeropnt_map, AS_PROGRAM, 16 )
@@ -180,7 +180,7 @@ static WRITE32_HANDLER( zeropnt2_sound_bank_w )
if (ACCESSING_BITS_24_31)
{
int bank = ((data >> 24) & 3) % 4;
- UINT8 *dst = space->machine->region("oki1")->base();
+ UINT8 *dst = space->machine().region("oki1")->base();
UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
@@ -190,16 +190,16 @@ static WRITE32_HANDLER( zeropnt2_leds_w )
{
if (ACCESSING_BITS_16_23)
{
- coin_counter_w(space->machine, 0,data & 0x00010000);
- set_led_status(space->machine, 0,data & 0x00800000); // Start 1
- set_led_status(space->machine, 1,data & 0x00400000); // Start 2
+ coin_counter_w(space->machine(), 0,data & 0x00010000);
+ set_led_status(space->machine(), 0,data & 0x00800000); // Start 1
+ set_led_status(space->machine(), 1,data & 0x00400000); // Start 2
}
}
static WRITE32_DEVICE_HANDLER( zeropnt2_eeprom_w )
{
if (data & ~0xfe00000)
- logerror("%s - Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s - Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if ( ACCESSING_BITS_24_31 )
{
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 589512902b0..d130a0e2c68 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -60,9 +60,9 @@ public:
*
*************************************/
-static void upscope_reset(running_machine *machine)
+static void upscope_reset(running_machine &machine)
{
- upscope_state *state = machine->driver_data<upscope_state>();
+ upscope_state *state = machine.driver_data<upscope_state>();
state->prev_cia1_porta = 0xff;
}
@@ -86,16 +86,16 @@ static void upscope_reset(running_machine *machine)
static WRITE8_DEVICE_HANDLER( upscope_cia_0_porta_w )
{
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
}
@@ -117,13 +117,13 @@ static WRITE8_DEVICE_HANDLER( upscope_cia_0_porta_w )
static WRITE8_DEVICE_HANDLER( upscope_cia_0_portb_w )
{
- upscope_state *state = device->machine->driver_data<upscope_state>();
+ upscope_state *state = device->machine().driver_data<upscope_state>();
state->parallel_data = data;
}
static READ8_DEVICE_HANDLER( upscope_cia_0_portb_r )
{
- upscope_state *state = device->machine->driver_data<upscope_state>();
+ upscope_state *state = device->machine().driver_data<upscope_state>();
return state->nvram_data_latch;
}
@@ -146,13 +146,13 @@ static READ8_DEVICE_HANDLER( upscope_cia_0_portb_r )
static READ8_DEVICE_HANDLER( upscope_cia_1_porta_r )
{
- upscope_state *state = device->machine->driver_data<upscope_state>();
+ upscope_state *state = device->machine().driver_data<upscope_state>();
return 0xf8 | (state->prev_cia1_porta & 0x07);
}
static WRITE8_DEVICE_HANDLER( upscope_cia_1_porta_w )
{
- upscope_state *state = device->machine->driver_data<upscope_state>();
+ upscope_state *state = device->machine().driver_data<upscope_state>();
/* on a low transition of POUT, we latch stuff for the NVRAM */
if ((state->prev_cia1_porta & 2) && !(data & 2))
{
@@ -183,7 +183,7 @@ static WRITE8_DEVICE_HANDLER( upscope_cia_1_porta_w )
case 0x02:
/* coin counter */
- coin_counter_w(device->machine, 0, data & 1);
+ coin_counter_w(device->machine(), 0, data & 1);
break;
case 0x03:
@@ -217,7 +217,7 @@ static WRITE8_DEVICE_HANDLER( upscope_cia_1_porta_w )
if (data & 4)
{
if (LOG_IO) logerror("Internal register (%d) read\n", state->nvram_address_latch);
- state->nvram_data_latch = (state->nvram_address_latch == 0) ? input_port_read(device->machine, "IO0") : 0xff;
+ state->nvram_data_latch = (state->nvram_address_latch == 0) ? input_port_read(device->machine(), "IO0") : 0xff;
}
/* if SEL == 0, we read NVRAM */
@@ -385,7 +385,7 @@ ROM_END
static DRIVER_INIT( upscope )
{
- upscope_state *state = machine->driver_data<upscope_state>();
+ upscope_state *state = machine.driver_data<upscope_state>();
static const amiga_machine_interface upscope_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -398,11 +398,11 @@ static DRIVER_INIT( upscope )
amiga_machine_config(machine, &upscope_intf);
/* allocate NVRAM */
- machine->device<nvram_device>("nvram")->set_base(state->m_nvram, sizeof(state->m_nvram));
+ machine.device<nvram_device>("nvram")->set_base(state->m_nvram, sizeof(state->m_nvram));
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
}
diff --git a/src/mame/drivers/usgames.c b/src/mame/drivers/usgames.c
index eb116a49155..fa108260ccc 100644
--- a/src/mame/drivers/usgames.c
+++ b/src/mame/drivers/usgames.c
@@ -33,22 +33,22 @@ Sound: AY-3-8912
static WRITE8_HANDLER( usgames_rombank_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
// logerror ("BANK WRITE? -%02x-\n",data);
//popmessage("%02x",data);
- memory_set_bankptr(space->machine, "bank1",&RAM[ 0x10000 + 0x4000 * data] );
+ memory_set_bankptr(space->machine(), "bank1",&RAM[ 0x10000 + 0x4000 * data] );
}
static WRITE8_HANDLER( lamps1_w )
{
/* button lamps */
- set_led_status(space->machine, 0,data & 0x01);
- set_led_status(space->machine, 1,data & 0x02);
- set_led_status(space->machine, 2,data & 0x04);
- set_led_status(space->machine, 3,data & 0x08);
- set_led_status(space->machine, 4,data & 0x10);
+ set_led_status(space->machine(), 0,data & 0x01);
+ set_led_status(space->machine(), 1,data & 0x02);
+ set_led_status(space->machine(), 2,data & 0x04);
+ set_led_status(space->machine(), 3,data & 0x08);
+ set_led_status(space->machine(), 4,data & 0x10);
/* bit 5 toggles all the time - extra lamp? */
}
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index c1e328db9ff..3ce9484d9f5 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -107,7 +107,7 @@ static WRITE32_DEVICE_HANDLER( finalgdr_eeprom_w )
static WRITE16_HANDLER( flipscreen_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(offset)
{
state->flipscreen = data & state->flip_bit;
@@ -116,13 +116,13 @@ static WRITE16_HANDLER( flipscreen_w )
static WRITE32_HANDLER( flipscreen32_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->flipscreen = data & state->flip_bit;
}
static WRITE16_HANDLER( jmpbreak_flipscreen_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->flipscreen = data & 0x8000;
}
@@ -131,39 +131,39 @@ static WRITE32_HANDLER( paletteram32_w )
{
UINT16 paldata;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- paldata = space->machine->generic.paletteram.u32[offset] & 0xffff;
- palette_set_color_rgb(space->machine, offset*2 + 1, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
+ paldata = space->machine().generic.paletteram.u32[offset] & 0xffff;
+ palette_set_color_rgb(space->machine(), offset*2 + 1, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
- paldata = (space->machine->generic.paletteram.u32[offset] >> 16) & 0xffff;
- palette_set_color_rgb(space->machine, offset*2 + 0, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
+ paldata = (space->machine().generic.paletteram.u32[offset] >> 16) & 0xffff;
+ palette_set_color_rgb(space->machine(), offset*2 + 0, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
}
static READ32_HANDLER( wyvernwg_prot_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->semicom_prot_idx--;
return (state->semicom_prot_data[state->semicom_prot_which] & (1 << state->semicom_prot_idx)) >> state->semicom_prot_idx;
}
static WRITE32_HANDLER( wyvernwg_prot_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->semicom_prot_which = data & 1;
state->semicom_prot_idx = 8;
}
static READ32_HANDLER( finalgdr_prot_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->semicom_prot_idx--;
return (state->semicom_prot_data[state->semicom_prot_which] & (1 << state->semicom_prot_idx)) ? 0x8000 : 0;
}
static WRITE32_HANDLER( finalgdr_prot_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
/*
41C6
967E
@@ -185,19 +185,19 @@ static WRITE32_DEVICE_HANDLER( finalgdr_oki_bank_w )
static WRITE32_HANDLER( finalgdr_backupram_bank_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->finalgdr_backupram_bank = (data & 0xff000000) >> 24;
}
static READ32_HANDLER( finalgdr_backupram_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
return state->finalgdr_backupram[offset + state->finalgdr_backupram_bank * 0x80] << 24;
}
static WRITE32_HANDLER( finalgdr_backupram_w )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
state->finalgdr_backupram[offset + state->finalgdr_backupram_bank * 0x80] = data >> 24;
}
@@ -387,8 +387,8 @@ Offset+3
*/
static void draw_sprites(screen_device *screen, bitmap_t *bitmap)
{
- vamphalf_state *state = screen->machine->driver_data<vamphalf_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ vamphalf_state *state = screen->machine().driver_data<vamphalf_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
UINT32 cnt;
int block, offs;
int code,color,x,y,fx,fy;
@@ -461,8 +461,8 @@ static void draw_sprites(screen_device *screen, bitmap_t *bitmap)
static void draw_sprites_aoh(screen_device *screen, bitmap_t *bitmap)
{
- vamphalf_state *state = screen->machine->driver_data<vamphalf_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ vamphalf_state *state = screen->machine().driver_data<vamphalf_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
UINT32 cnt;
int block, offs;
int code,color,x,y,fx,fy;
@@ -1607,7 +1607,7 @@ static int irq_active(address_space *space)
static READ16_HANDLER( vamphalf_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x82de)
{
if(irq_active(space))
@@ -1621,7 +1621,7 @@ static READ16_HANDLER( vamphalf_speedup_r )
static READ16_HANDLER( vamphafk_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x82de)
{
if(irq_active(space))
@@ -1635,7 +1635,7 @@ static READ16_HANDLER( vamphafk_speedup_r )
static READ16_HANDLER( misncrft_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xecc8)
{
if(irq_active(space))
@@ -1649,7 +1649,7 @@ static READ16_HANDLER( misncrft_speedup_r )
static READ16_HANDLER( coolmini_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x75f7a)
{
if(irq_active(space))
@@ -1663,7 +1663,7 @@ static READ16_HANDLER( coolmini_speedup_r )
static READ16_HANDLER( suplup_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xaf18a )
{
if(irq_active(space))
@@ -1677,7 +1677,7 @@ static READ16_HANDLER( suplup_speedup_r )
static READ16_HANDLER( luplup_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xaefac )
{
if(irq_active(space))
@@ -1691,7 +1691,7 @@ static READ16_HANDLER( luplup_speedup_r )
static READ16_HANDLER( luplup29_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xae6c0 )
{
if(irq_active(space))
@@ -1705,7 +1705,7 @@ static READ16_HANDLER( luplup29_speedup_r )
static READ16_HANDLER( puzlbang_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xae6d2 )
{
if(irq_active(space))
@@ -1719,7 +1719,7 @@ static READ16_HANDLER( puzlbang_speedup_r )
static READ32_HANDLER( wyvernwg_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x10758 )
{
if(irq_active(space))
@@ -1733,7 +1733,7 @@ static READ32_HANDLER( wyvernwg_speedup_r )
static READ32_HANDLER( finalgdr_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x1c212)
{
if(irq_active(space))
@@ -1747,7 +1747,7 @@ static READ32_HANDLER( finalgdr_speedup_r )
static READ32_HANDLER( mrkicker_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
UINT32 pc = cpu_get_pc(space->cpu);
if(pc == 0x469de || pc == 0x46a36)
{
@@ -1763,7 +1763,7 @@ static READ32_HANDLER( mrkicker_speedup_r )
static READ16_HANDLER( dquizgo2_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xaa622)
{
if(irq_active(space))
@@ -1777,7 +1777,7 @@ static READ16_HANDLER( dquizgo2_speedup_r )
static READ32_HANDLER( aoh_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0xb994 )
{
device_eat_cycles(space->cpu, 500);
@@ -1793,7 +1793,7 @@ static READ32_HANDLER( aoh_speedup_r )
static READ16_HANDLER( jmpbreak_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x983c)
{
if(irq_active(space))
@@ -1807,7 +1807,7 @@ static READ16_HANDLER( jmpbreak_speedup_r )
static READ16_HANDLER( mrdig_speedup_r )
{
- vamphalf_state *state = space->machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = space->machine().driver_data<vamphalf_state>();
if(cpu_get_pc(space->cpu) == 0x1710)
{
if(irq_active(space))
@@ -1821,8 +1821,8 @@ static READ16_HANDLER( mrdig_speedup_r )
static DRIVER_INIT( vamphalf )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0004a840, 0x0004a843, FUNC(vamphalf_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0004a840, 0x0004a843, FUNC(vamphalf_speedup_r) );
state->palshift = 0;
state->flip_bit = 0x80;
@@ -1830,8 +1830,8 @@ static DRIVER_INIT( vamphalf )
static DRIVER_INIT( vamphafk )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0004a6d0, 0x0004a6d3, FUNC(vamphafk_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0004a6d0, 0x0004a6d3, FUNC(vamphafk_speedup_r) );
state->palshift = 0;
state->flip_bit = 0x80;
@@ -1839,8 +1839,8 @@ static DRIVER_INIT( vamphafk )
static DRIVER_INIT( misncrft )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00072eb4, 0x00072eb7, FUNC(misncrft_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00072eb4, 0x00072eb7, FUNC(misncrft_speedup_r) );
state->palshift = 0;
state->flip_bit = 1;
@@ -1848,8 +1848,8 @@ static DRIVER_INIT( misncrft )
static DRIVER_INIT( coolmini )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000d2e80, 0x000d2e83, FUNC(coolmini_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000d2e80, 0x000d2e83, FUNC(coolmini_speedup_r) );
state->palshift = 0;
state->flip_bit = 1;
@@ -1857,8 +1857,8 @@ static DRIVER_INIT( coolmini )
static DRIVER_INIT( suplup )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0011605c, 0x0011605f, FUNC(suplup_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0011605c, 0x0011605f, FUNC(suplup_speedup_r) );
state->palshift = 8;
/* no flipscreen */
@@ -1866,8 +1866,8 @@ static DRIVER_INIT( suplup )
static DRIVER_INIT( luplup )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00115e84, 0x00115e87, FUNC(luplup_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00115e84, 0x00115e87, FUNC(luplup_speedup_r) );
state->palshift = 8;
/* no flipscreen */
@@ -1875,8 +1875,8 @@ static DRIVER_INIT( luplup )
static DRIVER_INIT( luplup29 )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00113f08, 0x00113f0b, FUNC(luplup29_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00113f08, 0x00113f0b, FUNC(luplup29_speedup_r) );
state->palshift = 8;
/* no flipscreen */
@@ -1884,8 +1884,8 @@ static DRIVER_INIT( luplup29 )
static DRIVER_INIT( puzlbang )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00113ecc, 0x00113ecf, FUNC(puzlbang_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00113ecc, 0x00113ecf, FUNC(puzlbang_speedup_r) );
state->palshift = 8;
/* no flipscreen */
@@ -1893,8 +1893,8 @@ static DRIVER_INIT( puzlbang )
static DRIVER_INIT( wyvernwg )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00b56fc, 0x00b56ff, FUNC(wyvernwg_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00b56fc, 0x00b56ff, FUNC(wyvernwg_speedup_r) );
state->palshift = 0;
state->flip_bit = 1;
@@ -1906,11 +1906,11 @@ static DRIVER_INIT( wyvernwg )
static DRIVER_INIT( finalgdr )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
state->finalgdr_backupram_bank = 1;
state->finalgdr_backupram = auto_alloc_array(machine, UINT8, 0x80*0x100);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x005e874, 0x005e877, FUNC(finalgdr_speedup_r) );
- machine->device<nvram_device>("nvram")->set_base(state->finalgdr_backupram, 0x80*0x100);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x005e874, 0x005e877, FUNC(finalgdr_speedup_r) );
+ machine.device<nvram_device>("nvram")->set_base(state->finalgdr_backupram, 0x80*0x100);
state->palshift = 0;
state->flip_bit = 1; //?
@@ -1922,12 +1922,12 @@ static DRIVER_INIT( finalgdr )
static DRIVER_INIT( mrkicker )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
// backup ram isn't used
state->finalgdr_backupram_bank = 1;
state->finalgdr_backupram = auto_alloc_array(machine, UINT8, 0x80*0x100);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00701a4, 0x00701a7, FUNC(mrkicker_speedup_r) );
- machine->device<nvram_device>("nvram")->set_base(state->finalgdr_backupram, 0x80*0x100);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00701a4, 0x00701a7, FUNC(mrkicker_speedup_r) );
+ machine.device<nvram_device>("nvram")->set_base(state->finalgdr_backupram, 0x80*0x100);
state->palshift = 0;
state->flip_bit = 1; //?
@@ -1939,8 +1939,8 @@ static DRIVER_INIT( mrkicker )
static DRIVER_INIT( dquizgo2 )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00cde70, 0x00cde73, FUNC(dquizgo2_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00cde70, 0x00cde73, FUNC(dquizgo2_speedup_r) );
state->palshift = 0;
state->flip_bit = 1;
@@ -1948,8 +1948,8 @@ static DRIVER_INIT( dquizgo2 )
static DRIVER_INIT( aoh )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x028a09c, 0x028a09f, FUNC(aoh_speedup_r) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x028a09c, 0x028a09f, FUNC(aoh_speedup_r) );
state->palshift = 0;
/* no flipscreen */
@@ -1957,18 +1957,18 @@ static DRIVER_INIT( aoh )
static DRIVER_INIT( jmpbreak )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00906fc, 0x00906ff, FUNC(jmpbreak_speedup_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0000000, 0xe0000003, FUNC(jmpbreak_flipscreen_w) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00906fc, 0x00906ff, FUNC(jmpbreak_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0000000, 0xe0000003, FUNC(jmpbreak_flipscreen_w) );
state->palshift = 0;
}
static DRIVER_INIT( mrdig )
{
- vamphalf_state *state = machine->driver_data<vamphalf_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00a99c, 0x00a99f, FUNC(mrdig_speedup_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0000000, 0xe0000003, FUNC(jmpbreak_flipscreen_w) );
+ vamphalf_state *state = machine.driver_data<vamphalf_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00a99c, 0x00a99f, FUNC(mrdig_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0000000, 0xe0000003, FUNC(jmpbreak_flipscreen_w) );
state->palshift = 0;
}
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index 12bc40a21c8..d6ddc03ba89 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -22,10 +22,10 @@
static WRITE16_HANDLER( vaportra_sound_w )
{
- vaportra_state *state = space->machine->driver_data<vaportra_state>();
+ vaportra_state *state = space->machine().driver_data<vaportra_state>();
/* Force synchronisation between CPUs with fake timer */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
}
@@ -35,11 +35,11 @@ static READ16_HANDLER( vaportra_control_r )
switch (offset << 1)
{
case 4:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 2:
- return input_port_read(space->machine, "COINS");
+ return input_port_read(space->machine(), "COINS");
case 0:
- return input_port_read(space->machine, "PLAYERS");
+ return input_port_read(space->machine(), "PLAYERS");
}
logerror("Unknown control read at %d\n",offset);
@@ -72,7 +72,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( vaportra_soundlatch_r )
{
- vaportra_state *state = space->machine->driver_data<vaportra_state>();
+ vaportra_state *state = space->machine().driver_data<vaportra_state>();
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
@@ -203,7 +203,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- vaportra_state *driver_state = device->machine->driver_data<vaportra_state>();
+ vaportra_state *driver_state = device->machine().driver_data<vaportra_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -245,19 +245,19 @@ static const deco16ic_interface vaportra_deco16ic_tilegen2_intf =
static MACHINE_START( vaportra )
{
- vaportra_state *state = machine->driver_data<vaportra_state>();
+ vaportra_state *state = machine.driver_data<vaportra_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
- state->deco_tilegen2 = machine->device("tilegen2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
+ state->deco_tilegen2 = machine.device("tilegen2");
state->save_item(NAME(state->priority));
}
static MACHINE_RESET( vaportra )
{
- vaportra_state *state = machine->driver_data<vaportra_state>();
+ vaportra_state *state = machine.driver_data<vaportra_state>();
state->priority[0] = 0;
state->priority[1] = 0;
@@ -858,7 +858,7 @@ C3D54*
static DRIVER_INIT( vaportra )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
for (i = 0x00000; i < 0x80000; i++)
diff --git a/src/mame/drivers/vastar.c b/src/mame/drivers/vastar.c
index 06ac8153852..e3058f0f3e5 100644
--- a/src/mame/drivers/vastar.c
+++ b/src/mame/drivers/vastar.c
@@ -77,28 +77,28 @@ static WRITE8_HANDLER( vastar_hold_cpu2_w )
{
/* I'm not sure that this works exactly like this */
if (data & 1)
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE);
}
static READ8_HANDLER( vastar_sharedram_r )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( vastar_sharedram_w )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
state->sharedram[offset] = data;
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c
index 024c5124897..e601fe90a9b 100644
--- a/src/mame/drivers/vball.c
+++ b/src/mame/drivers/vball.c
@@ -110,28 +110,28 @@ INLINE int scanline_to_vcount(int scanline)
static TIMER_DEVICE_CALLBACK( vball_scanline )
{
- vball_state *state = timer.machine->driver_data<vball_state>();
+ vball_state *state = timer.machine().driver_data<vball_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* Update to the current point */
if (scanline > 0)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
}
/* IRQ fires every on every 8th scanline */
if (!(vcount_old & 8) && (vcount & 8))
{
- cputag_set_input_line(timer.machine, "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", M6502_IRQ_LINE, ASSERT_LINE);
}
/* NMI fires on scanline 248 (VBL) and is latched */
if (vcount == 0xf8)
{
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
}
/* Save the scroll x register value */
@@ -144,10 +144,10 @@ static TIMER_DEVICE_CALLBACK( vball_scanline )
static WRITE8_HANDLER( vball_irq_ack_w )
{
if (offset == 0)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
}
@@ -162,14 +162,14 @@ static WRITE8_HANDLER( vball_irq_ack_w )
*/
static WRITE8_HANDLER( vb_bankswitch_w )
{
- vball_state *state = space->machine->driver_data<vball_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1", &RAM[0x10000 + (0x4000 * (data & 1))]);
+ vball_state *state = space->machine().driver_data<vball_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000 + (0x4000 * (data & 1))]);
if (state->gfxset != ((data & 0x20) ^ 0x20))
{
state->gfxset = (data & 0x20) ^ 0x20;
- vb_mark_all_dirty(space->machine);
+ vb_mark_all_dirty(space->machine());
}
state->vb_scrolly_hi = (data & 0x40) << 2;
}
@@ -178,7 +178,7 @@ static WRITE8_HANDLER( vb_bankswitch_w )
static WRITE8_HANDLER( cpu_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -193,17 +193,17 @@ static WRITE8_HANDLER( cpu_sound_command_w )
*/
static WRITE8_HANDLER( vb_scrollx_hi_w )
{
- vball_state *state = space->machine->driver_data<vball_state>();
- flip_screen_set(space->machine, ~data&1);
+ vball_state *state = space->machine().driver_data<vball_state>();
+ flip_screen_set(space->machine(), ~data&1);
state->vb_scrollx_hi = (data & 0x02) << 7;
- vb_bgprombank_w(space->machine, (data >> 2) & 0x07);
- vb_spprombank_w(space->machine, (data >> 5) & 0x07);
+ vb_bgprombank_w(space->machine(), (data >> 2) & 0x07);
+ vb_spprombank_w(space->machine(), (data >> 5) & 0x07);
//logerror("%04x: vb_scrollx_hi = %d\n", cpu_get_previouspc(space->cpu), state->vb_scrollx_hi);
}
static WRITE8_HANDLER(vb_scrollx_lo_w)
{
- vball_state *state = space->machine->driver_data<vball_state>();
+ vball_state *state = space->machine().driver_data<vball_state>();
state->vb_scrollx_lo = data;
//logerror("%04x: vb_scrollx_lo =%d\n", cpu_get_previouspc(space->cpu), state->vb_scrollx_lo);
}
@@ -410,7 +410,7 @@ GFXDECODE_END
static void vball_irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 60c8ef6b5e3..fada6ec50b8 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -107,10 +107,10 @@ public:
static SCREEN_UPDATE( vcombat )
{
- vcombat_state *state = screen->machine->driver_data<vcombat_state>();
+ vcombat_state *state = screen->machine().driver_data<vcombat_state>();
int y;
- const rgb_t *const pens = tlc34076_get_pens(screen->machine->device("tlc34076"));
- device_t *aux = screen->machine->device("aux");
+ const rgb_t *const pens = tlc34076_get_pens(screen->machine().device("tlc34076"));
+ device_t *aux = screen->machine().device("aux");
UINT16 *m68k_buf = state->m68k_framebuffer[(*state->framebuffer_ctrl & 0x20) ? 1 : 0];
UINT16 *i860_buf = state->i860_framebuffer[(screen == aux) ? 1 : 0][0];
@@ -158,7 +158,7 @@ static SCREEN_UPDATE( vcombat )
static WRITE16_HANDLER( main_video_write )
{
- vcombat_state *state = space->machine->driver_data<vcombat_state>();
+ vcombat_state *state = space->machine().driver_data<vcombat_state>();
int fb = (*state->framebuffer_ctrl & 0x20) ? 0 : 1;
UINT16 old_data = state->m68k_framebuffer[fb][offset];
@@ -183,17 +183,17 @@ static WRITE16_HANDLER( main_video_write )
static READ16_HANDLER( control_1_r )
{
- return (input_port_read(space->machine, "IN0") << 8);
+ return (input_port_read(space->machine(), "IN0") << 8);
}
static READ16_HANDLER( control_2_r )
{
- return (input_port_read(space->machine, "IN1") << 8);
+ return (input_port_read(space->machine(), "IN1") << 8);
}
static READ16_HANDLER( control_3_r )
{
- return (input_port_read(space->machine, "IN2") << 8);
+ return (input_port_read(space->machine(), "IN2") << 8);
}
static void wiggle_i860_common(device_t *device, UINT16 data)
@@ -225,32 +225,32 @@ static void wiggle_i860_common(device_t *device, UINT16 data)
static WRITE16_HANDLER( wiggle_i860p0_pins_w )
{
- wiggle_i860_common(space->machine->device("vid_0"), data);
+ wiggle_i860_common(space->machine().device("vid_0"), data);
}
static WRITE16_HANDLER( wiggle_i860p1_pins_w )
{
- wiggle_i860_common(space->machine->device("vid_1"), data);
+ wiggle_i860_common(space->machine().device("vid_1"), data);
}
static READ16_HANDLER( main_irqiack_r )
{
//fprintf(stderr, "M0: irq iack\n");
- device_set_input_line(space->machine->device("maincpu"), M68K_IRQ_1, CLEAR_LINE);
- //device_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, CLEAR_LINE);
+ device_set_input_line(space->machine().device("maincpu"), M68K_IRQ_1, CLEAR_LINE);
+ //device_set_input_line(space->machine().device("maincpu"), INPUT_LINE_RESET, CLEAR_LINE);
return 0;
}
static READ16_HANDLER( sound_resetmain_r )
{
//fprintf(stderr, "M1: reset line to M0\n");
- //device_set_input_line(space->machine->device("maincpu"), INPUT_LINE_RESET, PULSE_LINE);
+ //device_set_input_line(space->machine().device("maincpu"), INPUT_LINE_RESET, PULSE_LINE);
return 0;
}
static WRITE64_HANDLER( v0_fb_w )
{
- vcombat_state *state = space->machine->driver_data<vcombat_state>();
+ vcombat_state *state = space->machine().driver_data<vcombat_state>();
/* The frame buffer seems to sit on a 32-bit data bus, while the
i860 uses a 64-bit data bus. Adjust accordingly. */
char *p = (char *)(state->i860_framebuffer[0][0]);
@@ -274,7 +274,7 @@ static WRITE64_HANDLER( v0_fb_w )
framebuffer. */
static WRITE64_HANDLER( v1_fb_w )
{
- vcombat_state *state = space->machine->driver_data<vcombat_state>();
+ vcombat_state *state = space->machine().driver_data<vcombat_state>();
/* The frame buffer seems to sit on a 32-bit data bus, while the
i860 uses a 64-bit data bus. Adjust accordingly. */
char *p = (char *)(state->i860_framebuffer[1][0]);
@@ -296,8 +296,8 @@ static WRITE64_HANDLER( v1_fb_w )
static WRITE16_HANDLER( crtc_w )
{
- vcombat_state *state = space->machine->driver_data<vcombat_state>();
- device_t *crtc = space->machine->device("crtc");
+ vcombat_state *state = space->machine().driver_data<vcombat_state>();
+ device_t *crtc = space->machine().device("crtc");
if (crtc == NULL)
return;
@@ -386,17 +386,17 @@ ADDRESS_MAP_END
static MACHINE_RESET( vcombat )
{
- vcombat_state *state = machine->driver_data<vcombat_state>();
- i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1);
- i860_set_pin(machine->device("vid_1"), DEC_PIN_BUS_HOLD, 1);
+ vcombat_state *state = machine.driver_data<vcombat_state>();
+ i860_set_pin(machine.device("vid_0"), DEC_PIN_BUS_HOLD, 1);
+ i860_set_pin(machine.device("vid_1"), DEC_PIN_BUS_HOLD, 1);
state->crtc_select = 0;
}
static MACHINE_RESET( shadfgtr )
{
- vcombat_state *state = machine->driver_data<vcombat_state>();
- i860_set_pin(machine->device("vid_0"), DEC_PIN_BUS_HOLD, 1);
+ vcombat_state *state = machine.driver_data<vcombat_state>();
+ i860_set_pin(machine.device("vid_0"), DEC_PIN_BUS_HOLD, 1);
state->crtc_select = 0;
}
@@ -427,15 +427,15 @@ DIRECT_UPDATE_HANDLER( vcombat_vid_1_direct_handler )
static DRIVER_INIT( vcombat )
{
- vcombat_state *state = machine->driver_data<vcombat_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ vcombat_state *state = machine.driver_data<vcombat_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* The two i860s execute out of RAM */
- address_space *space = machine->device<i860_device>("vid_0")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_0_direct_handler, *machine));
+ address_space *space = machine.device<i860_device>("vid_0")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_0_direct_handler, machine));
- space = machine->device<i860_device>("vid_1")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_1_direct_handler, *machine));
+ space = machine.device<i860_device>("vid_1")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_1_direct_handler, machine));
/* Allocate the 68000 framebuffers */
state->m68k_framebuffer[0] = auto_alloc_array(machine, UINT16, 0x8000);
@@ -467,7 +467,7 @@ static DRIVER_INIT( vcombat )
static DRIVER_INIT( shadfgtr )
{
- vcombat_state *state = machine->driver_data<vcombat_state>();
+ vcombat_state *state = machine.driver_data<vcombat_state>();
/* Allocate th 68000 frame buffers */
state->m68k_framebuffer[0] = auto_alloc_array(machine, UINT16, 0x8000);
state->m68k_framebuffer[1] = auto_alloc_array(machine, UINT16, 0x8000);
@@ -479,8 +479,8 @@ static DRIVER_INIT( shadfgtr )
state->i860_framebuffer[1][1] = NULL;
/* The i860 executes out of RAM */
- address_space *space = machine->device<i860_device>("vid_0")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_0_direct_handler, *machine));
+ address_space *space = machine.device<i860_device>("vid_0")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(vcombat_vid_0_direct_handler, machine));
}
@@ -545,7 +545,7 @@ INPUT_PORTS_END
static WRITE_LINE_DEVICE_HANDLER(sound_update)
{
/* Seems reasonable */
- device_set_input_line(device->machine->device("soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE);
+ device_set_input_line(device->machine().device("soundcpu"), M68K_IRQ_1, state ? ASSERT_LINE : CLEAR_LINE);
}
static const mc6845_interface mc6845_intf =
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 60800acbea3..37552f4ef32 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -107,7 +107,7 @@ UINT8 ascii_to_bin( UINT8 ascii )
DRIVER_INIT(vegaa)
{
UINT8* buf = (UINT8*)malloc(0x10000);
- UINT8* rom = machine->region("maincpu")->base();
+ UINT8* rom = machine.region("maincpu")->base();
int i;
int count = 0;
// last 0xc bytes of file are just some settings, ignore
@@ -135,7 +135,7 @@ DRIVER_INIT(vegaa)
{
FILE *fp;
char filename[256];
- sprintf(filename,"vega_%s", machine->system().name);
+ sprintf(filename,"vega_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c
index 1d9744cc747..9289abe9ab7 100644
--- a/src/mame/drivers/vegaeo.c
+++ b/src/mame/drivers/vegaeo.c
@@ -34,7 +34,7 @@ public:
static WRITE32_HANDLER( vega_vram_w )
{
- vegaeo_state *state = space->machine->driver_data<vegaeo_state>();
+ vegaeo_state *state = space->machine().driver_data<vegaeo_state>();
switch(mem_mask)
{
case 0xffffffff:
@@ -65,7 +65,7 @@ static WRITE32_HANDLER( vega_vram_w )
static READ32_HANDLER( vega_vram_r )
{
- vegaeo_state *state = space->machine->driver_data<vegaeo_state>();
+ vegaeo_state *state = space->machine().driver_data<vegaeo_state>();
return state->vega_vram[offset + (0x14000/4) * state->vega_vbuffer];
}
@@ -73,15 +73,15 @@ static WRITE32_HANDLER( vega_palette_w )
{
UINT16 paldata;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- paldata = space->machine->generic.paletteram.u32[offset] & 0x7fff;
- palette_set_color_rgb(space->machine, offset, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
+ paldata = space->machine().generic.paletteram.u32[offset] & 0x7fff;
+ palette_set_color_rgb(space->machine(), offset, pal5bit(paldata >> 10), pal5bit(paldata >> 5), pal5bit(paldata >> 0));
}
static WRITE32_HANDLER( vega_misc_w )
{
- vegaeo_state *state = space->machine->driver_data<vegaeo_state>();
+ vegaeo_state *state = space->machine().driver_data<vegaeo_state>();
// other bits ???
state->vega_vbuffer = data & 1;
@@ -91,7 +91,7 @@ static WRITE32_HANDLER( vega_misc_w )
static READ32_HANDLER( vegaeo_custom_read )
{
eolith_speedup_read(space);
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
static ADDRESS_MAP_START( vega_map, AS_PROGRAM, 32 )
@@ -143,13 +143,13 @@ INPUT_PORTS_END
static VIDEO_START( vega )
{
- vegaeo_state *state = machine->driver_data<vegaeo_state>();
+ vegaeo_state *state = machine.driver_data<vegaeo_state>();
state->vega_vram = auto_alloc_array(machine, UINT32, 0x14000*2/4);
}
static SCREEN_UPDATE( vega )
{
- vegaeo_state *state = screen->machine->driver_data<vegaeo_state>();
+ vegaeo_state *state = screen->machine().driver_data<vegaeo_state>();
int x,y,count;
int color;
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index 0680c1701e6..86f8b9a2249 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -499,7 +499,7 @@ public:
static STATE_POSTLOAD( vegas_postload );
static TIMER_CALLBACK( nile_timer_callback );
static void ide_interrupt(device_t *device, int state);
-static void remap_dynamic_addresses(running_machine *machine);
+static void remap_dynamic_addresses(running_machine &machine);
@@ -511,7 +511,7 @@ static void remap_dynamic_addresses(running_machine *machine);
static SCREEN_UPDATE( vegas )
{
- vegas_state *state = screen->machine->driver_data<vegas_state>();
+ vegas_state *state = screen->machine().driver_data<vegas_state>();
return voodoo_update(state->voodoo, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@@ -524,29 +524,29 @@ static SCREEN_UPDATE( vegas )
static MACHINE_START( vegas )
{
- vegas_state *state = machine->driver_data<vegas_state>();
- state->voodoo = machine->device("voodoo");
+ vegas_state *state = machine.driver_data<vegas_state>();
+ state->voodoo = machine.device("voodoo");
/* allocate timers for the NILE */
- state->timer[0] = machine->scheduler().timer_alloc(FUNC(NULL));
- state->timer[1] = machine->scheduler().timer_alloc(FUNC(NULL));
- state->timer[2] = machine->scheduler().timer_alloc(FUNC(nile_timer_callback));
- state->timer[3] = machine->scheduler().timer_alloc(FUNC(nile_timer_callback));
+ state->timer[0] = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->timer[1] = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->timer[2] = machine.scheduler().timer_alloc(FUNC(nile_timer_callback));
+ state->timer[3] = machine.scheduler().timer_alloc(FUNC(nile_timer_callback));
/* identify our sound board */
- if (machine->device("dsio") != NULL)
+ if (machine.device("dsio") != NULL)
state->dcs_idma_cs = 6;
- else if (machine->device("denver") != NULL)
+ else if (machine.device("denver") != NULL)
state->dcs_idma_cs = 7;
else
state->dcs_idma_cs = 0;
/* set the fastest DRC options, but strict verification */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, state->ramsize - 1, FALSE, state->rambase);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->ramsize - 1, FALSE, state->rambase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
/* register for save states */
state_save_register_global(machine, state->nile_irq_state);
@@ -562,20 +562,20 @@ static MACHINE_START( vegas )
state_save_register_global(machine, state->sio_led_state);
state_save_register_global(machine, state->pending_analog_read);
state_save_register_global(machine, state->cmos_unlocked);
- machine->state().register_postload(vegas_postload, NULL);
+ machine.state().register_postload(vegas_postload, NULL);
}
static MACHINE_RESET( vegas )
{
- vegas_state *state = machine->driver_data<vegas_state>();
+ vegas_state *state = machine.driver_data<vegas_state>();
/* reset dynamic addressing */
memset(state->nile_regs, 0, 0x1000);
memset(state->pci_ide_regs, 0, sizeof(state->pci_ide_regs));
memset(state->pci_3dfx_regs, 0, sizeof(state->pci_3dfx_regs));
/* reset the DCS system if we have one */
- if (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL)
+ if (machine.device("dcs2") != NULL || machine.device("dsio") != NULL || machine.device("denver") != NULL)
{
dcs_reset_w(1);
dcs_reset_w(0);
@@ -602,14 +602,14 @@ static STATE_POSTLOAD( vegas_postload )
static WRITE32_HANDLER( cmos_unlock_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
state->cmos_unlocked = 1;
}
static WRITE32_HANDLER( timekeeper_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
if (state->cmos_unlocked)
{
if ((mem_mask & 0x000000ff) != 0)
@@ -631,7 +631,7 @@ static WRITE32_HANDLER( timekeeper_w )
static READ32_HANDLER( timekeeper_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 result = 0xffffffff;
if ((mem_mask & 0x000000ff) != 0)
result = (result & ~0x000000ff) | (state->timekeeper->read(offset * 4 + 0) << 0);
@@ -656,7 +656,7 @@ static READ32_HANDLER( timekeeper_r )
static READ32_HANDLER( pci_bridge_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 result = state->pci_bridge_regs[offset];
switch (offset)
@@ -678,7 +678,7 @@ static READ32_HANDLER( pci_bridge_r )
static WRITE32_HANDLER( pci_bridge_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
state->pci_bridge_regs[offset] = data;
if (LOG_PCI)
logerror("%06X:PCI bridge write: reg %d = %08X\n", cpu_get_pc(space->cpu), offset, data);
@@ -694,7 +694,7 @@ static WRITE32_HANDLER( pci_bridge_w )
static READ32_HANDLER( pci_ide_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 result = state->pci_ide_regs[offset];
switch (offset)
@@ -718,29 +718,29 @@ static READ32_HANDLER( pci_ide_r )
static WRITE32_HANDLER( pci_ide_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
state->pci_ide_regs[offset] = data;
switch (offset)
{
case 0x04: /* address register */
state->pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
break;
case 0x05: /* address register */
state->pci_ide_regs[offset] &= 0xfffffffc;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
break;
case 0x08: /* address register */
state->pci_ide_regs[offset] &= 0xfffffff0;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
break;
case 0x14: /* interrupt pending */
if (data & 4)
- ide_interrupt(space->machine->device("ide"), 0);
+ ide_interrupt(space->machine().device("ide"), 0);
break;
}
if (LOG_PCI)
@@ -757,7 +757,7 @@ static WRITE32_HANDLER( pci_ide_w )
static READ32_HANDLER( pci_3dfx_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
int voodoo_type = voodoo_get_type(state->voodoo);
UINT32 result = state->pci_3dfx_regs[offset];
@@ -791,7 +791,7 @@ static READ32_HANDLER( pci_3dfx_r )
static WRITE32_HANDLER( pci_3dfx_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
int voodoo_type = voodoo_get_type(state->voodoo);
state->pci_3dfx_regs[offset] = data;
@@ -803,14 +803,14 @@ static WRITE32_HANDLER( pci_3dfx_w )
state->pci_3dfx_regs[offset] &= 0xff000000;
else
state->pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
break;
case 0x05: /* address register */
if (voodoo_type >= VOODOO_BANSHEE)
{
state->pci_3dfx_regs[offset] &= 0xfe000000;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
}
break;
@@ -818,7 +818,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= VOODOO_BANSHEE)
{
state->pci_3dfx_regs[offset] &= 0xffffff00;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
}
break;
@@ -826,7 +826,7 @@ static WRITE32_HANDLER( pci_3dfx_w )
if (voodoo_type >= VOODOO_BANSHEE)
{
state->pci_3dfx_regs[offset] &= 0xffff0000;
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
}
break;
@@ -847,9 +847,9 @@ static WRITE32_HANDLER( pci_3dfx_w )
*
*************************************/
-static void update_nile_irqs(running_machine *machine)
+static void update_nile_irqs(running_machine &machine)
{
- vegas_state *state = machine->driver_data<vegas_state>();
+ vegas_state *state = machine.driver_data<vegas_state>();
UINT32 intctll = state->nile_regs[NREG_INTCTRL+0];
UINT32 intctlh = state->nile_regs[NREG_INTCTRL+1];
UINT8 irq[6];
@@ -914,7 +914,7 @@ static void update_nile_irqs(running_machine *machine)
static TIMER_CALLBACK( nile_timer_callback )
{
- vegas_state *state = machine->driver_data<vegas_state>();
+ vegas_state *state = machine.driver_data<vegas_state>();
int which = param;
UINT32 *regs = &state->nile_regs[NREG_T0CTRL + which * 4];
if (LOG_TIMERS) logerror("timer %d fired\n", which);
@@ -947,7 +947,7 @@ static TIMER_CALLBACK( nile_timer_callback )
static READ32_HANDLER( nile_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 result = state->nile_regs[offset];
int logit = 1, which;
@@ -1060,7 +1060,7 @@ static READ32_HANDLER( nile_r )
static WRITE32_HANDLER( nile_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 olddata = state->nile_regs[offset];
int logit = 1, which;
@@ -1078,21 +1078,21 @@ static WRITE32_HANDLER( nile_w )
case NREG_INTCTRL+1: /* Interrupt control */
if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine);
+ update_nile_irqs(space->machine());
break;
case NREG_INTSTAT0+0: /* Interrupt status 0 */
case NREG_INTSTAT0+1: /* Interrupt status 0 */
if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine);
+ update_nile_irqs(space->machine());
break;
case NREG_INTSTAT1+0: /* Interrupt status 1 */
case NREG_INTSTAT1+1: /* Interrupt status 1 */
if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
logit = 0;
- update_nile_irqs(space->machine);
+ update_nile_irqs(space->machine());
break;
case NREG_INTCLR+0: /* Interrupt clear */
@@ -1100,7 +1100,7 @@ static WRITE32_HANDLER( nile_w )
if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
logit = 0;
state->nile_irq_state &= ~(state->nile_regs[offset] & ~0xf00);
- update_nile_irqs(space->machine);
+ update_nile_irqs(space->machine());
break;
case NREG_INTPPES+0: /* PCI Interrupt control */
@@ -1121,7 +1121,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_PCIINIT1+0: /* PCI master */
if (((olddata & 0xe) == 0xa) != ((state->nile_regs[offset] & 0xe) == 0xa))
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
logit = 0;
break;
@@ -1175,7 +1175,7 @@ static WRITE32_HANDLER( nile_w )
logit = 0;
break;
case NREG_UARTIER: /* serial interrupt enable */
- update_nile_irqs(space->machine);
+ update_nile_irqs(space->machine());
break;
case NREG_VID:
@@ -1209,7 +1209,7 @@ static WRITE32_HANDLER( nile_w )
case NREG_DCS8:
case NREG_PCIW0:
case NREG_PCIW1:
- remap_dynamic_addresses(space->machine);
+ remap_dynamic_addresses(space->machine());
break;
}
@@ -1227,13 +1227,13 @@ static WRITE32_HANDLER( nile_w )
static void ide_interrupt(device_t *device, int state)
{
- vegas_state *drvstate = device->machine->driver_data<vegas_state>();
+ vegas_state *drvstate = device->machine().driver_data<vegas_state>();
drvstate->ide_irq_state = state;
if (state)
drvstate->nile_irq_state |= 0x800;
else
drvstate->nile_irq_state &= ~0x800;
- update_nile_irqs(device->machine);
+ update_nile_irqs(device->machine());
}
@@ -1244,9 +1244,9 @@ static void ide_interrupt(device_t *device, int state)
*
*************************************/
-static void update_sio_irqs(running_machine *machine)
+static void update_sio_irqs(running_machine &machine)
{
- vegas_state *state = machine->driver_data<vegas_state>();
+ vegas_state *state = machine.driver_data<vegas_state>();
if (state->sio_irq_state & state->sio_irq_enable)
state->nile_irq_state |= 0x400;
else
@@ -1257,11 +1257,11 @@ static void update_sio_irqs(running_machine *machine)
static void vblank_assert(device_t *device, int state)
{
- vegas_state *drvstate = device->machine->driver_data<vegas_state>();
+ vegas_state *drvstate = device->machine().driver_data<vegas_state>();
if (!drvstate->vblank_state && state)
{
drvstate->sio_irq_state |= 0x20;
- update_sio_irqs(device->machine);
+ update_sio_irqs(device->machine());
}
drvstate->vblank_state = state;
@@ -1273,9 +1273,9 @@ static void vblank_assert(device_t *device, int state)
}
-static void ioasic_irq(running_machine *machine, int state)
+static void ioasic_irq(running_machine &machine, int state)
{
- vegas_state *drvstate = machine->driver_data<vegas_state>();
+ vegas_state *drvstate = machine.driver_data<vegas_state>();
if (state)
drvstate->sio_irq_state |= 0x04;
else
@@ -1286,25 +1286,25 @@ static void ioasic_irq(running_machine *machine, int state)
static void ethernet_interrupt(device_t *device, int state)
{
- vegas_state *drvstate = device->machine->driver_data<vegas_state>();
+ vegas_state *drvstate = device->machine().driver_data<vegas_state>();
if (state)
drvstate->sio_irq_state |= 0x10;
else
drvstate->sio_irq_state &= ~0x10;
- update_sio_irqs(device->machine);
+ update_sio_irqs(device->machine());
}
static READ32_HANDLER( sio_irq_clear_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->sio_irq_clear;
}
static WRITE32_HANDLER( sio_irq_clear_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
{
state->sio_irq_clear = data;
@@ -1312,7 +1312,7 @@ static WRITE32_HANDLER( sio_irq_clear_w )
/* bit 0x01 seems to be used to reset the IOASIC */
if (!(data & 0x01))
{
- midway_ioasic_reset(space->machine);
+ midway_ioasic_reset(space->machine());
dcs_reset_w(data & 0x01);
}
@@ -1320,7 +1320,7 @@ static WRITE32_HANDLER( sio_irq_clear_w )
if (!(data & 0x08))
{
state->sio_irq_state &= ~0x20;
- update_sio_irqs(space->machine);
+ update_sio_irqs(space->machine());
}
}
}
@@ -1328,39 +1328,39 @@ static WRITE32_HANDLER( sio_irq_clear_w )
static READ32_HANDLER( sio_irq_enable_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->sio_irq_enable;
}
static WRITE32_HANDLER( sio_irq_enable_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
{
state->sio_irq_enable = data;
- update_sio_irqs(space->machine);
+ update_sio_irqs(space->machine());
}
}
static READ32_HANDLER( sio_irq_cause_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->sio_irq_state & state->sio_irq_enable;
}
static READ32_HANDLER( sio_irq_status_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->sio_irq_state;
}
static WRITE32_HANDLER( sio_led_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7)
state->sio_led_state = data;
}
@@ -1368,7 +1368,7 @@ static WRITE32_HANDLER( sio_led_w )
static READ32_HANDLER( sio_led_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->sio_led_state;
}
@@ -1382,7 +1382,7 @@ static READ32_HANDLER( sio_led_r )
static WRITE32_HANDLER( sio_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
if (ACCESSING_BITS_0_7) offset += 0;
if (ACCESSING_BITS_8_15) offset += 1;
if (ACCESSING_BITS_16_23) offset += 2;
@@ -1398,7 +1398,7 @@ static WRITE32_HANDLER( sio_w )
static READ32_HANDLER( sio_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
UINT32 result = 0;
if (ACCESSING_BITS_0_7) offset += 0;
if (ACCESSING_BITS_8_15) offset += 1;
@@ -1421,19 +1421,19 @@ static READ32_HANDLER( sio_r )
static READ32_HANDLER( analog_port_r )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
return state->pending_analog_read;
}
static WRITE32_HANDLER( analog_port_w )
{
- vegas_state *state = space->machine->driver_data<vegas_state>();
+ vegas_state *state = space->machine().driver_data<vegas_state>();
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(space->cpu), data);
- state->pending_analog_read = input_port_read_safe(space->machine, portnames[data & 7], 0);
+ state->pending_analog_read = input_port_read_safe(space->machine(), portnames[data & 7], 0);
}
@@ -1452,7 +1452,7 @@ static WRITE32_HANDLER( vegas_watchdog_w )
static WRITE32_HANDLER( asic_fifo_w )
{
- midway_ioasic_fifo_w(space->machine, data);
+ midway_ioasic_fifo_w(space->machine(), data);
}
@@ -1502,7 +1502,7 @@ static WRITE32_DEVICE_HANDLER( ethernet_w )
static WRITE32_HANDLER( dcs3_fifo_full_w )
{
- midway_ioasic_fifo_full_w(space->machine, data);
+ midway_ioasic_fifo_full_w(space->machine(), data);
}
@@ -1547,19 +1547,19 @@ INLINE void _add_dynamic_device_address(vegas_state *state, device_t *device, of
}
-static void remap_dynamic_addresses(running_machine *machine)
+static void remap_dynamic_addresses(running_machine &machine)
{
- vegas_state *state = machine->driver_data<vegas_state>();
+ vegas_state *state = machine.driver_data<vegas_state>();
dynamic_address *dynamic = state->dynamic;
- device_t *ethernet = machine->device("ethernet");
- device_t *ide = machine->device("ide");
+ device_t *ethernet = machine.device("ethernet");
+ device_t *ide = machine.device("ide");
int voodoo_type = voodoo_get_type(state->voodoo);
offs_t base;
int addr;
/* unmap everything we know about */
for (addr = 0; addr < state->dynamic_count; addr++)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(dynamic[addr].start, dynamic[addr].end);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(dynamic[addr].start, dynamic[addr].end);
/* the build the list of stuff */
state->dynamic_count = 0;
@@ -1675,14 +1675,14 @@ static void remap_dynamic_addresses(running_machine *machine)
/* now remap everything */
if (LOG_DYNAMIC) logerror("remap_dynamic_addresses:\n");
- address_space *space = const_cast<address_space *>(machine->device<cpu_device>("maincpu")->space(AS_PROGRAM));
+ address_space *space = const_cast<address_space *>(machine.device<cpu_device>("maincpu")->space(AS_PROGRAM));
assert(space != NULL);
for (addr = 0; addr < state->dynamic_count; addr++)
{
if (LOG_DYNAMIC) logerror(" installing: %08X-%08X %s,%s\n", dynamic[addr].start, dynamic[addr].end, dynamic[addr].rdname, dynamic[addr].wrname);
if (dynamic[addr].mread == NOP_HANDLER)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(dynamic[addr].start, dynamic[addr].end);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(dynamic[addr].start, dynamic[addr].end);
else if (dynamic[addr].mread != NULL)
space->install_legacy_read_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].mread, dynamic[addr].rdname);
if (dynamic[addr].mwrite != NULL)
@@ -2467,7 +2467,7 @@ ROM_END
*
*************************************/
-static void init_common(running_machine *machine, int ioasic, int serialnum)
+static void init_common(running_machine &machine, int ioasic, int serialnum)
{
/* initialize the subsystems */
midway_ioasic_init(machine, ioasic, serialnum, 80, ioasic_irq);
@@ -2481,10 +2481,10 @@ static DRIVER_INIT( gauntleg )
init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80015430, 0x8CC38060, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80015464, 0x3C09801E, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8918, 0x8FA2004C, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800C8890, 0x8FA20024, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80015430, 0x8CC38060, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80015464, 0x3C09801E, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800C8918, 0x8FA2004C, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800C8890, 0x8FA20024, 250); /* confirmed */
}
@@ -2494,10 +2494,10 @@ static DRIVER_INIT( gauntdl )
init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800158B8, 0x8CC3CC40, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800158EC, 0x3C0C8022, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800D40C0, 0x8FA2004C, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x800D4038, 0x8FA20024, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800158B8, 0x8CC3CC40, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800158EC, 0x3C0C8022, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800D40C0, 0x8FA2004C, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x800D4038, 0x8FA20024, 250); /* confirmed */
}
@@ -2507,7 +2507,7 @@ static DRIVER_INIT( warfa )
init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8009436C, 0x0C031663, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8009436C, 0x0C031663, 250); /* confirmed */
}
@@ -2517,10 +2517,10 @@ static DRIVER_INIT( tenthdeg )
init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */);
/* speedups */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80051CD8, 0x0C023C15, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8005E674, 0x3C028017, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x8002DBCC, 0x8FA2002C, 250); /* confirmed */
- mips3drc_add_hotspot(machine->device("maincpu"), 0x80015930, 0x8FC20244, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80051CD8, 0x0C023C15, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8005E674, 0x3C028017, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x8002DBCC, 0x8FA2002C, 250); /* confirmed */
+ mips3drc_add_hotspot(machine.device("maincpu"), 0x80015930, 0x8FC20244, 250); /* confirmed */
}
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index b0df20cfdb9..19a6b65813c 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -98,7 +98,7 @@
/* prototypes */
static KONAMI_SETLINES_CALLBACK( vendetta_banking );
-static void vendetta_video_banking( running_machine *machine, int select );
+static void vendetta_video_banking( running_machine &machine, int select );
/***************************************************************************
@@ -128,30 +128,30 @@ static WRITE8_HANDLER( vendetta_eeprom_w )
/* bit 6 - IRQ enable */
/* bit 7 - Unused */
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
if (data == 0xff ) /* this is a bug in the eeprom write code */
return;
/* EEPROM */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
state->irq_enabled = (data >> 6) & 1;
- vendetta_video_banking(space->machine, data & 1);
+ vendetta_video_banking(space->machine(), data & 1);
}
/********************************************/
static READ8_HANDLER( vendetta_K052109_r )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
return k052109_r(state->k052109, offset + 0x2000);
}
static WRITE8_HANDLER( vendetta_K052109_w )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
// *************************************************************************************
// * Escape Kids uses 052109's mirrored Tilemap ROM bank selector, but only during *
@@ -163,17 +163,17 @@ static WRITE8_HANDLER( vendetta_K052109_w )
}
-static void vendetta_video_banking( running_machine *machine, int select )
+static void vendetta_video_banking( running_machine &machine, int select )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ vendetta_state *state = machine.driver_data<vendetta_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (select & 1)
{
space->install_read_bank(state->video_banking_base + 0x2000, state->video_banking_base + 0x2fff, "bank4" );
space->install_legacy_write_handler(state->video_banking_base + 0x2000, state->video_banking_base + 0x2fff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w) );
space->install_legacy_readwrite_handler(*state->k053246, state->video_banking_base + 0x0000, state->video_banking_base + 0x0fff, FUNC(k053247_r), FUNC(k053247_w) );
- memory_set_bankptr(machine, "bank4", machine->generic.paletteram.v);
+ memory_set_bankptr(machine, "bank4", machine.generic.paletteram.v);
}
else
{
@@ -184,11 +184,11 @@ static void vendetta_video_banking( running_machine *machine, int select )
static WRITE8_HANDLER( vendetta_5fe0_w )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
/* bit 0,1 coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 = BRAMBK ?? */
@@ -203,27 +203,27 @@ static WRITE8_HANDLER( vendetta_5fe0_w )
static TIMER_CALLBACK( z80_nmi_callback )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( z80_arm_nmi_w )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(25), FUNC(z80_nmi_callback));
+ space->machine().scheduler().timer_set(attotime::from_usec(25), FUNC(z80_nmi_callback));
}
static WRITE8_HANDLER( z80_irq_w )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static READ8_HANDLER( vendetta_sound_interrupt_r )
{
- vendetta_state *state = space->machine->driver_data<vendetta_state>();
+ vendetta_state *state = space->machine().driver_data<vendetta_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
return 0x00;
}
@@ -411,7 +411,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( vendetta_irq )
{
- vendetta_state *state = device->machine->driver_data<vendetta_state>();
+ vendetta_state *state = device->machine().driver_data<vendetta_state>();
if (state->irq_enabled)
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
}
@@ -454,35 +454,35 @@ static const k053247_interface esckids_k053246_intf =
static MACHINE_START( vendetta )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 28, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
- state->k052109 = machine->device("k052109");
- state->k054000 = machine->device("k054000");
- state->k053260 = machine->device("k053260");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
+ state->k052109 = machine.device("k052109");
+ state->k054000 = machine.device("k054000");
+ state->k053260 = machine.device("k053260");
state->save_item(NAME(state->irq_enabled));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
state->save_item(NAME(state->layerpri));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x1000);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x1000);
}
static MACHINE_RESET( vendetta )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
int i;
- konami_configure_set_lines(machine->device("maincpu"), vendetta_banking);
+ konami_configure_set_lines(machine.device("maincpu"), vendetta_banking);
for (i = 0; i < 3; i++)
{
@@ -783,18 +783,18 @@ static KONAMI_SETLINES_CALLBACK( vendetta_banking )
if (lines >= 0x1c)
logerror("PC = %04x : Unknown bank selected %02x\n", cpu_get_pc(device), lines);
else
- memory_set_bank(device->machine, "bank1", lines);
+ memory_set_bank(device->machine(), "bank1", lines);
}
static DRIVER_INIT( vendetta )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
state->video_banking_base = 0x4000;
}
static DRIVER_INIT( esckids )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
state->video_banking_base = 0x2000;
}
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index fcc3ef48750..9bf6cd29263 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -69,21 +69,21 @@
static TIMER_CALLBACK( clear_coin_status )
{
- vicdual_state *state = machine->driver_data<vicdual_state>();
+ vicdual_state *state = machine.driver_data<vicdual_state>();
state->coin_status = 0;
}
-static void assert_coin_status(running_machine *machine)
+static void assert_coin_status(running_machine &machine)
{
- vicdual_state *state = machine->driver_data<vicdual_state>();
+ vicdual_state *state = machine.driver_data<vicdual_state>();
state->coin_status = 1;
}
static CUSTOM_INPUT( vicdual_read_coin_status )
{
- vicdual_state *state = field->port->machine->driver_data<vicdual_state>();
+ vicdual_state *state = field->port->machine().driver_data<vicdual_state>();
return state->coin_status;
}
@@ -93,13 +93,13 @@ static INPUT_CHANGED( coin_changed )
if (newval && !oldval)
{
/* increment the coin counter */
- coin_counter_w(field->port->machine, 0, 1);
- coin_counter_w(field->port->machine, 0, 0);
+ coin_counter_w(field->port->machine(), 0, 1);
+ coin_counter_w(field->port->machine(), 0, 0);
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
/* simulate the coin switch being closed for a while */
- field->port->machine->scheduler().timer_set(4 * field->port->machine->primary_screen->frame_period(), FUNC(clear_coin_status));
+ field->port->machine().scheduler().timer_set(4 * field->port->machine().primary_screen->frame_period(), FUNC(clear_coin_status));
}
}
@@ -122,13 +122,13 @@ static INPUT_CHANGED( coin_changed )
*
*************************************/
-static int get_vcounter(running_machine *machine)
+static int get_vcounter(running_machine &machine)
{
- int vcounter = machine->primary_screen->vpos();
+ int vcounter = machine.primary_screen->vpos();
/* the vertical synch counter gets incremented at the end of HSYNC,
compensate for this */
- if (machine->primary_screen->hpos() >= VICDUAL_HSEND)
+ if (machine.primary_screen->hpos() >= VICDUAL_HSEND)
vcounter = (vcounter + 1) % VICDUAL_VTOTAL;
return vcounter;
@@ -137,26 +137,26 @@ static int get_vcounter(running_machine *machine)
static CUSTOM_INPUT( vicdual_get_64v )
{
- return (get_vcounter(field->port->machine) >> 6) & 0x01;
+ return (get_vcounter(field->port->machine()) >> 6) & 0x01;
}
static CUSTOM_INPUT( vicdual_get_vblank_comp )
{
- return (get_vcounter(field->port->machine) < VICDUAL_VBSTART);
+ return (get_vcounter(field->port->machine()) < VICDUAL_VBSTART);
}
static CUSTOM_INPUT( vicdual_get_composite_blank_comp )
{
- return (vicdual_get_vblank_comp(field, 0) && !field->port->machine->primary_screen->hblank());
+ return (vicdual_get_vblank_comp(field, 0) && !field->port->machine().primary_screen->hblank());
}
static CUSTOM_INPUT( vicdual_get_timer_value )
{
/* return the state of the timer (old code claims "4MHz square wave", but it was toggled once every 2msec, or 500Hz) */
- return field->port->machine->time().as_ticks(500) & 1;
+ return field->port->machine().time().as_ticks(500) & 1;
}
@@ -169,7 +169,7 @@ static CUSTOM_INPUT( vicdual_get_timer_value )
#define COLOR_BW_PORT_TAG "COLOR_BW"
-int vicdual_is_cabinet_color(running_machine *machine)
+int vicdual_is_cabinet_color(running_machine &machine)
{
return (input_port_read(machine, COLOR_BW_PORT_TAG) == 0);
}
@@ -193,16 +193,16 @@ int vicdual_is_cabinet_color(running_machine *machine)
static WRITE8_HANDLER( vicdual_videoram_w )
{
- vicdual_state *state = space->machine->driver_data<vicdual_state>();
- space->machine->primary_screen->update_now();
+ vicdual_state *state = space->machine().driver_data<vicdual_state>();
+ space->machine().primary_screen->update_now();
state->videoram[offset] = data;
}
static WRITE8_HANDLER( vicdual_characterram_w )
{
- vicdual_state *state = space->machine->driver_data<vicdual_state>();
- space->machine->primary_screen->update_now();
+ vicdual_state *state = space->machine().driver_data<vicdual_state>();
+ space->machine().primary_screen->update_now();
state->characterram[offset] = data;
}
@@ -237,8 +237,8 @@ static READ8_HANDLER( depthch_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN1");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
return ret;
}
@@ -246,7 +246,7 @@ static READ8_HANDLER( depthch_io_r )
static WRITE8_HANDLER( depthch_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x04) depthch_audio_w(space, 0, data);
}
@@ -319,8 +319,8 @@ static READ8_HANDLER( safari_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN1");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
return ret;
}
@@ -328,7 +328,7 @@ static READ8_HANDLER( safari_io_r )
static WRITE8_HANDLER( safari_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) { /* safari_audio_w(0, data) */ }
}
@@ -403,8 +403,8 @@ static READ8_HANDLER( frogs_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN1");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
return ret;
}
@@ -412,7 +412,7 @@ static READ8_HANDLER( frogs_io_r )
static WRITE8_HANDLER( frogs_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) frogs_audio_w(space, 0, data);
}
@@ -511,8 +511,8 @@ static READ8_HANDLER( headon_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN1");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
return ret;
}
@@ -522,9 +522,9 @@ static READ8_HANDLER( sspaceat_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x04) ret = input_port_read(space->machine, "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN2");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x04) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
return ret;
}
@@ -532,7 +532,7 @@ static READ8_HANDLER( sspaceat_io_r )
static WRITE8_HANDLER( headon_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) headon_audio_w(space, 0, data);
if (offset & 0x04) { /* vicdual_palette_bank_w(0, data) */ } /* not written to */
}
@@ -721,10 +721,10 @@ static READ8_HANDLER( headon2_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
if (offset & 0x02) /* schematics show this as in input port, but never read from */
- if (offset & 0x04) ret = input_port_read(space->machine, "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN2");
+ if (offset & 0x04) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
if (offset & 0x12) logerror("********* Read from port %x\n", offset);
return ret;
@@ -733,7 +733,7 @@ static READ8_HANDLER( headon2_io_r )
static WRITE8_HANDLER( headon2_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) headon_audio_w(space, 0, data);
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) { /* schematics show this as going into a shifer circuit, but never written to */ }
@@ -744,7 +744,7 @@ static WRITE8_HANDLER( headon2_io_w )
static WRITE8_HANDLER( digger_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) { /* digger_audio_1_w(0, data) */ }
if (offset & 0x04)
{
@@ -949,7 +949,7 @@ static WRITE8_HANDLER( invho2_io_w )
{
if (offset & 0x01) invho2_audio_w(space, 0, data);
if (offset & 0x02) invinco_audio_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -958,7 +958,7 @@ static WRITE8_HANDLER( invds_io_w )
{
if (offset & 0x01) invinco_audio_w(space, 0, data);
if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -967,7 +967,7 @@ static WRITE8_HANDLER( sspacaho_io_w )
{
if (offset & 0x01) invho2_audio_w(space, 0, data);
if (offset & 0x02) { /* sspaceatt_audio_w(space, 0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -976,7 +976,7 @@ static WRITE8_HANDLER( tranqgun_io_w )
{
if (offset & 0x01) { /* tranqgun_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
}
@@ -984,7 +984,7 @@ static WRITE8_HANDLER( spacetrk_io_w )
{
if (offset & 0x01) { /* spacetrk_audio_w(space, 0, data) */ }
if (offset & 0x02) { /* spacetrk_audio_w(space, 0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -993,7 +993,7 @@ static WRITE8_HANDLER( carnival_io_w )
{
if (offset & 0x01) carnival_audio_1_w(space, 0, data);
if (offset & 0x02) carnival_audio_2_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -1002,7 +1002,7 @@ static WRITE8_HANDLER( brdrline_io_w )
{
if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
}
@@ -1010,7 +1010,7 @@ static WRITE8_HANDLER( pulsar_io_w )
{
if (offset & 0x01) pulsar_audio_1_w(space, 0, data);
if (offset & 0x02) pulsar_audio_2_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -1025,7 +1025,7 @@ static WRITE8_HANDLER( heiankyo_io_w )
/* heiankyo_audio_2_w(0, data & 0x3f); */
}
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
}
@@ -1033,7 +1033,7 @@ static WRITE8_HANDLER( alphaho_io_w )
{
if (offset & 0x01) { /* headon_audio_w(0, data) */ }
if (offset & 0x02) { /* alphaf_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -1632,7 +1632,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( brdrline_lives )
{
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, "FAKE_LIVES") & bit_mask) ? 0x00 : 0x01;
+ return (input_port_read(field->port->machine(), "FAKE_LIVES") & bit_mask) ? 0x00 : 0x01;
}
static INPUT_PORTS_START( brdrline )
@@ -2046,14 +2046,14 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( samurai_protection_w )
{
- vicdual_state *state = space->machine->driver_data<vicdual_state>();
+ vicdual_state *state = space->machine().driver_data<vicdual_state>();
state->samurai_protection_data = data;
}
static CUSTOM_INPUT( samurai_protection_r )
{
- vicdual_state *state = field->port->machine->driver_data<vicdual_state>();
+ vicdual_state *state = field->port->machine().driver_data<vicdual_state>();
int offset = (FPTR)param;
UINT32 answer = 0;
@@ -2069,7 +2069,7 @@ static CUSTOM_INPUT( samurai_protection_r )
static WRITE8_HANDLER( samurai_io_w )
{
if (offset & 0x02) { /* samurai_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine);
+ if (offset & 0x08) assert_coin_status(space->machine());
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -2173,8 +2173,8 @@ static READ8_HANDLER( nsub_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN1");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
return ret;
}
@@ -2182,7 +2182,7 @@ static READ8_HANDLER( nsub_io_r )
static WRITE8_HANDLER( nsub_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) { /* nsub_audio_w(0, data) */ }
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
}
@@ -2268,9 +2268,9 @@ static READ8_HANDLER( invinco_io_r )
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine, "IN0");
- if (offset & 0x02) ret = input_port_read(space->machine, "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine, "IN2");
+ if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x02) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
return ret;
}
@@ -2278,7 +2278,7 @@ static READ8_HANDLER( invinco_io_r )
static WRITE8_HANDLER( invinco_io_w )
{
- if (offset & 0x01) assert_coin_status(space->machine);
+ if (offset & 0x01) assert_coin_status(space->machine());
if (offset & 0x02) invinco_audio_w(space, 0, data);
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
}
diff --git a/src/mame/drivers/victory.c b/src/mame/drivers/victory.c
index 7da7f2b1210..0f9b3f48799 100644
--- a/src/mame/drivers/victory.c
+++ b/src/mame/drivers/victory.c
@@ -110,10 +110,10 @@
static WRITE8_HANDLER( lamp_control_w )
{
- set_led_status(space->machine, 0, data & 0x80);
- set_led_status(space->machine, 1, data & 0x40);
- set_led_status(space->machine, 2, data & 0x20);
- set_led_status(space->machine, 3, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x80);
+ set_led_status(space->machine(), 1, data & 0x40);
+ set_led_status(space->machine(), 2, data & 0x20);
+ set_led_status(space->machine(), 3, data & 0x10);
}
diff --git a/src/mame/drivers/videopin.c b/src/mame/drivers/videopin.c
index 5d4cb9c2107..d46adc9e4b1 100644
--- a/src/mame/drivers/videopin.c
+++ b/src/mame/drivers/videopin.c
@@ -22,22 +22,22 @@ static WRITE8_DEVICE_HANDLER(videopin_out1_w);
static WRITE8_DEVICE_HANDLER(videopin_out2_w);
-static void update_plunger(running_machine *machine)
+static void update_plunger(running_machine &machine)
{
- videopin_state *state = machine->driver_data<videopin_state>();
+ videopin_state *state = machine.driver_data<videopin_state>();
UINT8 val = input_port_read(machine, "IN2");
if (state->prev != val)
{
if (val == 0)
{
- state->time_released = machine->time();
+ state->time_released = machine.time();
if (!state->mask)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
}
else
- state->time_pushed = machine->time();
+ state->time_pushed = machine.time();
state->prev = val;
}
@@ -57,15 +57,15 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 263)
scanline = 32;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
}
static MACHINE_RESET( videopin )
{
- device_t *discrete = machine->device("discrete");
+ device_t *discrete = machine.device("discrete");
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(32), FUNC(interrupt_callback), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(32), FUNC(interrupt_callback), 32);
/* both output latches are cleared on reset */
@@ -74,16 +74,16 @@ static MACHINE_RESET( videopin )
}
-static double calc_plunger_pos(running_machine *machine)
+static double calc_plunger_pos(running_machine &machine)
{
- videopin_state *state = machine->driver_data<videopin_state>();
- return (machine->time().as_double() - state->time_released.as_double()) * (state->time_released.as_double() - state->time_pushed.as_double() + 0.2);
+ videopin_state *state = machine.driver_data<videopin_state>();
+ return (machine.time().as_double() - state->time_released.as_double()) * (state->time_released.as_double() - state->time_pushed.as_double() + 0.2);
}
static READ8_HANDLER( videopin_misc_r )
{
- double plunger = calc_plunger_pos(space->machine);
+ double plunger = calc_plunger_pos(space->machine());
// The plunger of the ball shooter has a black piece of
// plastic (flag) attached to it. When the plunger flag passes
@@ -94,7 +94,7 @@ static READ8_HANDLER( videopin_misc_r )
// signals received. This results in the MPU displaying the
// ball being shot onto the playfield at a certain speed.
- UINT8 val = input_port_read(space->machine, "IN1");
+ UINT8 val = input_port_read(space->machine(), "IN1");
if (plunger >= 0.000 && plunger <= 0.001)
{
@@ -111,7 +111,7 @@ static READ8_HANDLER( videopin_misc_r )
static WRITE8_HANDLER( videopin_led_w )
{
- int i = (space->machine->primary_screen->vpos() >> 5) & 7;
+ int i = (space->machine().primary_screen->vpos() >> 5) & 7;
static const char *const matrix[8][4] =
{
{ "LED26", "LED18", "LED11", "LED13" },
@@ -130,15 +130,15 @@ static WRITE8_HANDLER( videopin_led_w )
output_set_value(matrix[i][3], (data >> 3) & 1);
if (i == 7)
- set_led_status(space->machine, 0, data & 8); /* start button */
+ set_led_status(space->machine(), 0, data & 8); /* start button */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( videopin_out1_w )
{
- videopin_state *state = device->machine->driver_data<videopin_state>();
+ videopin_state *state = device->machine().driver_data<videopin_state>();
/* D0 => OCTAVE0 */
/* D1 => OCTACE1 */
/* D2 => OCTAVE2 */
@@ -151,9 +151,9 @@ static WRITE8_DEVICE_HANDLER( videopin_out1_w )
state->mask = ~data & 0x10;
if (state->mask)
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
- coin_lockout_global_w(device->machine, ~data & 0x08);
+ coin_lockout_global_w(device->machine(), ~data & 0x08);
/* Convert octave data to divide value and write to sound */
discrete_sound_w(device, VIDEOPIN_OCTAVE_DATA, (0x01 << (~data & 0x07)) & 0xfe);
@@ -171,7 +171,7 @@ static WRITE8_DEVICE_HANDLER( videopin_out2_w )
/* D6 => BELL */
/* D7 => ATTRACT */
- coin_counter_w(device->machine, 0, data & 0x10);
+ coin_counter_w(device->machine(), 0, data & 0x10);
discrete_sound_w(device, VIDEOPIN_BELL_EN, data & 0x40); // Bell
discrete_sound_w(device, VIDEOPIN_BONG_EN, data & 0x20); // Bong
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index d61806eb90d..f844b4acac9 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -383,7 +383,7 @@ static PALETTE_INIT( videopkr )
{
int j;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int r, g, b, tr, tg, tb, i;
@@ -409,7 +409,7 @@ static PALETTE_INIT( babypkr )
{
int j;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int r, g, b, tr, tg, tb, i, top;
@@ -439,7 +439,7 @@ static PALETTE_INIT( fortune1 )
{
int j;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int r, g, b, tr, tg, tb, i, c;
@@ -469,7 +469,7 @@ static PALETTE_INIT( fortune1 )
static TILE_GET_INFO( get_bg_tile_info )
{
- videopkr_state *state = machine->driver_data<videopkr_state>();
+ videopkr_state *state = machine.driver_data<videopkr_state>();
int offs = tile_index;
int attr = state->color_ram[offs] + input_port_read(machine, "IN2"); /* Color Switch Action */
int code = state->video_ram[offs];
@@ -480,20 +480,20 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( videopkr )
{
- videopkr_state *state = machine->driver_data<videopkr_state>();
+ videopkr_state *state = machine.driver_data<videopkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static VIDEO_START( vidadcba )
{
- videopkr_state *state = machine->driver_data<videopkr_state>();
+ videopkr_state *state = machine.driver_data<videopkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
}
static SCREEN_UPDATE( videopkr )
{
- videopkr_state *state = screen->machine->driver_data<videopkr_state>();
+ videopkr_state *state = screen->machine().driver_data<videopkr_state>();
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -506,7 +506,7 @@ static SCREEN_UPDATE( videopkr )
static READ8_HANDLER( videopkr_io_r )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
UINT8 valor = 0, hf, co;
UINT16 kbdin;
@@ -515,9 +515,9 @@ static READ8_HANDLER( videopkr_io_r )
{
case 0xef: /* inputs are multiplexed through a diode matrix */
{
- hf = ((input_port_read(space->machine, "IN1") & 0x10 ) >> 4) & 1; /* Hopper full detection */
- co = 0x10 * ((input_port_read(space->machine, "IN1") & 0x20 ) >> 5); /* Coin Out detection */
- kbdin = ((input_port_read(space->machine, "IN1") & 0xaf ) << 8) + input_port_read(space->machine, "IN0");
+ hf = ((input_port_read(space->machine(), "IN1") & 0x10 ) >> 4) & 1; /* Hopper full detection */
+ co = 0x10 * ((input_port_read(space->machine(), "IN1") & 0x20 ) >> 5); /* Coin Out detection */
+ kbdin = ((input_port_read(space->machine(), "IN1") & 0xaf ) << 8) + input_port_read(space->machine(), "IN0");
switch (kbdin)
{
@@ -587,7 +587,7 @@ static READ8_HANDLER( videopkr_io_r )
static WRITE8_HANDLER( videopkr_io_w )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
switch (state->p2)
{
case 0x3c:
@@ -657,19 +657,19 @@ static WRITE8_HANDLER( videopkr_io_w )
static READ8_HANDLER( videopkr_p1_data_r )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->p1;
}
static READ8_HANDLER( videopkr_p2_data_r )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->p2;
}
static WRITE8_HANDLER( videopkr_p1_data_w )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->p1 = data;
output_set_lamp_value(8, (data & 1)); /* Aux_0 - Jackpot mech. counter (Baby Games)*/
@@ -712,20 +712,20 @@ static WRITE8_HANDLER( videopkr_p1_data_w )
static WRITE8_HANDLER( videopkr_p2_data_w )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->p2 = data;
}
static READ8_HANDLER( videopkr_t0_latch )
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->t0_latch;
}
static WRITE8_HANDLER( prog_w )
{
if (!data)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); /* clear interrupt FF */
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE); /* clear interrupt FF */
}
/*************************
@@ -766,7 +766,7 @@ static WRITE8_HANDLER( prog_w )
static READ8_HANDLER(sound_io_r)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
switch (state->vp_sound_p2)
{
case 0xbf:
@@ -789,7 +789,7 @@ static READ8_HANDLER(sound_io_r)
static WRITE8_HANDLER(sound_io_w)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
if (state->vp_sound_p2 == 0x5f || state->vp_sound_p2 == 0xdf)
{
state->dc_40103 = data;
@@ -799,13 +799,13 @@ static WRITE8_HANDLER(sound_io_w)
static READ8_HANDLER(sound_p2_r)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->vp_sound_p2;
}
static WRITE8_HANDLER(sound_p2_w)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->vp_sound_p2 = data;
switch (data)
@@ -838,19 +838,19 @@ static WRITE8_HANDLER(sound_p2_w)
static READ8_HANDLER(baby_sound_p0_r)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->sbp0;
}
static WRITE8_HANDLER(baby_sound_p0_w)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->sbp0 = data;
}
static READ8_HANDLER(baby_sound_p1_r)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->c_io = (state->p1 >> 5) & 1;
state->hp_1 = (~state->p24_data >> 6) & 1;
state->hp_2 = (~state->p24_data >> 5) & 1;
@@ -862,32 +862,32 @@ static READ8_HANDLER(baby_sound_p1_r)
static WRITE8_HANDLER(baby_sound_p1_w)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
state->baby_latch = state->baby_latch | data;
}
static READ8_HANDLER(baby_sound_p2_r)
{
- videopkr_state *state = space->machine->driver_data<videopkr_state>();
+ videopkr_state *state = space->machine().driver_data<videopkr_state>();
return state->sbp2;
}
static WRITE8_DEVICE_HANDLER(baby_sound_p2_w)
{
- videopkr_state *state = device->machine->driver_data<videopkr_state>();
+ videopkr_state *state = device->machine().driver_data<videopkr_state>();
state->sbp2 = data;
dac_data_w(device, data);
}
static READ8_DEVICE_HANDLER(baby_sound_p3_r)
{
- videopkr_state *state = device->machine->driver_data<videopkr_state>();
+ videopkr_state *state = device->machine().driver_data<videopkr_state>();
return state->sbp3;
}
static WRITE8_DEVICE_HANDLER(baby_sound_p3_w)
{
- videopkr_state *state = device->machine->driver_data<videopkr_state>();
+ videopkr_state *state = device->machine().driver_data<videopkr_state>();
UINT8 lmp_ports, ay_intf;
state->sbp3 = data;
lmp_ports = state->sbp3 >> 1 & 0x07;
@@ -920,14 +920,14 @@ static WRITE8_DEVICE_HANDLER(baby_sound_p3_w)
static TIMER_DEVICE_CALLBACK(sound_t1_callback)
{
- videopkr_state *state = timer.machine->driver_data<videopkr_state>();
+ videopkr_state *state = timer.machine().driver_data<videopkr_state>();
if (state->te_40103 == 1)
{
state->dc_40103++;
if (state->dc_40103 == 0)
{
- cputag_set_input_line(timer.machine, "soundcpu", 0, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "soundcpu", 0, ASSERT_LINE);
}
}
}
@@ -1193,7 +1193,7 @@ GFXDECODE_END
static MACHINE_START(videopkr)
{
- videopkr_state *state = machine->driver_data<videopkr_state>();
+ videopkr_state *state = machine.driver_data<videopkr_state>();
state->vp_sound_p2 = 0xff; /* default P2 latch value */
state->sound_latch = 0xff; /* default sound data latch value */
state->p24_data = 0xff;
@@ -1201,7 +1201,7 @@ static MACHINE_START(videopkr)
state->ant_cio = 0;
state->count0 = 0;
- machine->device<nvram_device>("nvram")->set_base(state->data_ram, sizeof(state->data_ram));
+ machine.device<nvram_device>("nvram")->set_base(state->data_ram, sizeof(state->data_ram));
}
static const ay8910_interface ay8910_config =
diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c
index bb4a7f18238..1296fb4e3fa 100644
--- a/src/mame/drivers/vigilant.c
+++ b/src/mame/drivers/vigilant.c
@@ -26,10 +26,10 @@ Buccaneers has a 5.6888 Mhz and a 18.432 Mhz OSC
static WRITE8_HANDLER( vigilant_bank_select_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + (data & 0x07) * 0x4000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
/***************************************************************************
@@ -42,8 +42,8 @@ static WRITE8_HANDLER( vigilant_out2_w )
/* D2 = COB1 = Coin Counter B? */
/* The hardware has both coin counters hooked up to a single meter. */
- coin_counter_w(space->machine, 0,data & 0x02);
- coin_counter_w(space->machine, 1,data & 0x04);
+ coin_counter_w(space->machine(), 0,data & 0x02);
+ coin_counter_w(space->machine(), 1,data & 0x04);
// data & 0x01 cocktail mode
}
@@ -55,8 +55,8 @@ static WRITE8_HANDLER( kikcubic_coin_w )
/* bit 1 is used but unknown */
/* bits 4/5 are coin counters */
- coin_counter_w(space->machine, 0,data & 0x10);
- coin_counter_w(space->machine, 1,data & 0x20);
+ coin_counter_w(space->machine(), 0,data & 0x10);
+ coin_counter_w(space->machine(), 1,data & 0x20);
}
diff --git a/src/mame/drivers/vindictr.c b/src/mame/drivers/vindictr.c
index 165b6c5f7de..700072dd524 100644
--- a/src/mame/drivers/vindictr.c
+++ b/src/mame/drivers/vindictr.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- vindictr_state *state = machine->driver_data<vindictr_state>();
+ vindictr_state *state = machine.driver_data<vindictr_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -46,11 +46,11 @@ static MACHINE_START( vindictr )
static MACHINE_RESET( vindictr )
{
- vindictr_state *state = machine->driver_data<vindictr_state>();
+ vindictr_state *state = machine.driver_data<vindictr_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, vindictr_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, vindictr_scanline_update, 8);
atarijsa_reset();
}
@@ -64,8 +64,8 @@ static MACHINE_RESET( vindictr )
static READ16_HANDLER( port1_r )
{
- vindictr_state *state = space->machine->driver_data<vindictr_state>();
- int result = input_port_read(space->machine, "260010");
+ vindictr_state *state = space->machine().driver_data<vindictr_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->sound_to_cpu_ready) result ^= 0x0004;
if (state->cpu_to_sound_ready) result ^= 0x0008;
result ^= 0x0010;
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index c5862c063e9..138ecb2ca78 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -64,7 +64,7 @@ public:
static SCREEN_UPDATE(viper)
{
- device_t *device = screen->machine->device("voodoo");
+ device_t *device = screen->machine().device("voodoo");
return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
}
@@ -73,7 +73,7 @@ static SCREEN_UPDATE(viper)
static UINT32 mpc8240_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
#ifdef VIPER_DEBUG_LOG
printf("MPC8240: PCI read %d, %02X, %08X\n", function, reg, mem_mask);
#endif
@@ -87,7 +87,7 @@ static UINT32 mpc8240_pci_r(device_t *busdevice, device_t *device, int function,
static void mpc8240_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
#ifdef VIPER_DEBUG_LOG
printf("MPC8240: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask);
#endif
@@ -121,7 +121,7 @@ static WRITE64_DEVICE_HANDLER( pci_config_data_w )
static READ32_HANDLER( epic_r )
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
int reg;
reg = offset * 4;
@@ -149,7 +149,7 @@ static READ32_HANDLER( epic_r )
static WRITE32_HANDLER( epic_w )
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
int reg;
reg = offset * 4;
@@ -213,7 +213,7 @@ static READ64_DEVICE_HANDLER(cf_card_data_r)
default:
{
- fatalerror("%s:cf_card_data_r: IDE reg %02X\n", device->machine->describe_context(), offset & 0xf);
+ fatalerror("%s:cf_card_data_r: IDE reg %02X\n", device->machine().describe_context(), offset & 0xf);
}
}
}
@@ -234,7 +234,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_data_w)
default:
{
- fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", device->machine->describe_context(), offset & 0xf, (UINT16)(data >> 16));
+ fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", device->machine().describe_context(), offset & 0xf, (UINT16)(data >> 16));
}
}
}
@@ -242,7 +242,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_data_w)
static READ64_DEVICE_HANDLER(cf_card_r)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
UINT64 r = 0;
if (ACCESSING_BITS_16_31)
@@ -281,7 +281,7 @@ static READ64_DEVICE_HANDLER(cf_card_r)
default:
{
- printf("%s:compact_flash_r: IDE reg %02X\n", device->machine->describe_context(), offset & 0xf);
+ printf("%s:compact_flash_r: IDE reg %02X\n", device->machine().describe_context(), offset & 0xf);
}
}
}
@@ -297,7 +297,7 @@ static READ64_DEVICE_HANDLER(cf_card_r)
}
else
{
- fatalerror("%s:compact_flash_r: reg %02X\n", device->machine->describe_context(), reg);
+ fatalerror("%s:compact_flash_r: reg %02X\n", device->machine().describe_context(), reg);
}
}
}
@@ -306,9 +306,9 @@ static READ64_DEVICE_HANDLER(cf_card_r)
static WRITE64_DEVICE_HANDLER(cf_card_w)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
#ifdef VIPER_DEBUG_LOG
- printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", device->machine->describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask));
+ printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", device->machine().describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask));
#endif
if (ACCESSING_BITS_16_31)
@@ -347,7 +347,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w)
default:
{
- fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", device->machine->describe_context(), offset & 0xf, (UINT16)((data >> 16) & 0xffff));
+ fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", device->machine().describe_context(), offset & 0xf, (UINT16)((data >> 16) & 0xffff));
}
}
}
@@ -373,7 +373,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w)
}
default:
{
- fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", device->machine->describe_context(), offset, (UINT16)((data >> 16) & 0xffff));
+ fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", device->machine().describe_context(), offset, (UINT16)((data >> 16) & 0xffff));
}
}
}
@@ -382,7 +382,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w)
static WRITE64_HANDLER(unk2_w)
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
if (ACCESSING_BITS_56_63)
{
state->cf_card_ide = 0;
@@ -418,7 +418,7 @@ static WRITE64_DEVICE_HANDLER(ata_w)
static READ64_HANDLER(unk1_r)
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
UINT64 r = 0;
//return 0;//U64(0x0000400000000000);
@@ -432,7 +432,7 @@ static READ64_HANDLER(unk1_r)
static WRITE64_HANDLER(unk1a_w)
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
if (ACCESSING_BITS_56_63)
{
state->unk1_bit = 1;
@@ -441,7 +441,7 @@ static WRITE64_HANDLER(unk1a_w)
static WRITE64_HANDLER(unk1b_w)
{
- viper_state *state = space->machine->driver_data<viper_state>();
+ viper_state *state = space->machine().driver_data<viper_state>();
if (ACCESSING_BITS_56_63)
{
state->unk1_bit = 0;
@@ -450,7 +450,7 @@ static WRITE64_HANDLER(unk1b_w)
static UINT32 voodoo3_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
switch (reg)
{
case 0x00: // PCI Vendor ID (0x121a = 3dfx), Device ID (0x0005 = Voodoo 3)
@@ -483,14 +483,14 @@ static UINT32 voodoo3_pci_r(device_t *busdevice, device_t *device, int function,
}
default:
- fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(device->machine->device("maincpu")));
+ fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(device->machine().device("maincpu")));
}
return 0;
}
static void voodoo3_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
{
- viper_state *state = device->machine->driver_data<viper_state>();
+ viper_state *state = device->machine().driver_data<viper_state>();
// printf("voodoo3_pci_w: %08X, %08X\n", reg, data);
switch (reg)
@@ -552,39 +552,39 @@ static void voodoo3_pci_w(device_t *busdevice, device_t *device, int function, i
}
default:
- fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(device->machine->device("maincpu")));
+ fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(device->machine().device("maincpu")));
}
}
#if 0
static READ64_HANDLER(voodoo3_io_r)
{
- return read64be_with_32le_handler(banshee_io_0_r, space->machine, offset, mem_mask);
+ return read64be_with_32le_handler(banshee_io_0_r, space->machine(), offset, mem_mask);
}
static WRITE64_HANDLER(voodoo3_io_w)
{
// printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(space->cpu));
- write64be_with_32le_handler(banshee_io_0_w, space->machine, offset, data, mem_mask);
+ write64be_with_32le_handler(banshee_io_0_w, space->machine(), offset, data, mem_mask);
}
static READ64_HANDLER(voodoo3_r)
{
- return read64be_with_32le_handler(banshee_0_r, space->machine, offset, mem_mask);
+ return read64be_with_32le_handler(banshee_0_r, space->machine(), offset, mem_mask);
}
static WRITE64_HANDLER(voodoo3_w)
{
// printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(space->cpu));
- write64be_with_32le_handler(banshee_0_w, space->machine, offset, data, mem_mask);
+ write64be_with_32le_handler(banshee_0_w, space->machine(), offset, data, mem_mask);
}
static READ64_HANDLER(voodoo3_lfb_r)
{
- return read64be_with_32le_handler(banshee_fb_0_r, space->machine, offset, mem_mask);
+ return read64be_with_32le_handler(banshee_fb_0_r, space->machine(), offset, mem_mask);
}
static WRITE64_HANDLER(voodoo3_lfb_w)
{
// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(space->cpu));
- write64be_with_32le_handler(banshee_fb_0_w, space->machine, offset, data, mem_mask);
+ write64be_with_32le_handler(banshee_fb_0_w, space->machine(), offset, data, mem_mask);
}
#endif
@@ -674,17 +674,17 @@ MACHINE_CONFIG_END
static DRIVER_INIT(viper)
{
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff200000, 0xff207fff, FUNC(hdd_r), FUNC(hdd_w) ); //TODO
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff200000, 0xff207fff, FUNC(hdd_r), FUNC(hdd_w) ); //TODO
}
static DRIVER_INIT(vipercf)
{
- device_t *ide = machine->device("ide");
+ device_t *ide = machine.device("ide");
DRIVER_INIT_CALL(viper);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff000000, 0xff000fff, FUNC(cf_card_data_r), FUNC(cf_card_data_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff200000, 0xff200fff, FUNC(cf_card_r), FUNC(cf_card_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff000000, 0xff000fff, FUNC(cf_card_data_r), FUNC(cf_card_data_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0xff200000, 0xff200fff, FUNC(cf_card_r), FUNC(cf_card_w) );
}
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index 2b1026d041c..f578101b4e9 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -101,8 +101,8 @@ static READ16_HANDLER ( varia_crom_read )
{
/* game reads the cgrom, result is 7772, verified to be correct on the real board */
- vmetal_state *state = space->machine->driver_data<vmetal_state>();
- UINT8 *cgrom = space->machine->region("gfx1")->base();
+ vmetal_state *state = space->machine().driver_data<vmetal_state>();
+ UINT8 *cgrom = space->machine().region("gfx1")->base();
UINT16 retdat;
offset = offset << 1;
@@ -114,9 +114,9 @@ static READ16_HANDLER ( varia_crom_read )
}
-static void get_vmetal_tlookup(running_machine *machine, UINT16 data, UINT16 *tileno, UINT16 *color)
+static void get_vmetal_tlookup(running_machine &machine, UINT16 data, UINT16 *tileno, UINT16 *color)
{
- vmetal_state *state = machine->driver_data<vmetal_state>();
+ vmetal_state *state = machine.driver_data<vmetal_state>();
int idx = ((data & 0x7fff) >> 4) * 2;
UINT32 lookup = (state->tlookup[idx] << 16) | state->tlookup[idx + 1];
@@ -127,43 +127,43 @@ static void get_vmetal_tlookup(running_machine *machine, UINT16 data, UINT16 *ti
static WRITE16_HANDLER( vmetal_texttileram_w )
{
- vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ vmetal_state *state = space->machine().driver_data<vmetal_state>();
COMBINE_DATA(&state->texttileram[offset]);
tilemap_mark_tile_dirty(state->texttilemap, offset);
}
static WRITE16_HANDLER( vmetal_mid1tileram_w )
{
- vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ vmetal_state *state = space->machine().driver_data<vmetal_state>();
COMBINE_DATA(&state->mid1tileram[offset]);
tilemap_mark_tile_dirty(state->mid1tilemap, offset);
}
static WRITE16_HANDLER( vmetal_mid2tileram_w )
{
- vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ vmetal_state *state = space->machine().driver_data<vmetal_state>();
COMBINE_DATA(&state->mid2tileram[offset]);
tilemap_mark_tile_dirty(state->mid2tilemap, offset);
}
-static READ16_HANDLER ( varia_dips_bit8_r ) { return ((input_port_read(space->machine, "DSW2") & 0x80) << 0) | ((input_port_read(space->machine, "DSW1") & 0x80) >> 1); }
-static READ16_HANDLER ( varia_dips_bit7_r ) { return ((input_port_read(space->machine, "DSW2") & 0x40) << 1) | ((input_port_read(space->machine, "DSW1") & 0x40) >> 0); }
-static READ16_HANDLER ( varia_dips_bit6_r ) { return ((input_port_read(space->machine, "DSW2") & 0x20) << 2) | ((input_port_read(space->machine, "DSW1") & 0x20) << 1); }
-static READ16_HANDLER ( varia_dips_bit5_r ) { return ((input_port_read(space->machine, "DSW2") & 0x10) << 3) | ((input_port_read(space->machine, "DSW1") & 0x10) << 2); }
-static READ16_HANDLER ( varia_dips_bit4_r ) { return ((input_port_read(space->machine, "DSW2") & 0x08) << 4) | ((input_port_read(space->machine, "DSW1") & 0x08) << 3); }
-static READ16_HANDLER ( varia_dips_bit3_r ) { return ((input_port_read(space->machine, "DSW2") & 0x04) << 5) | ((input_port_read(space->machine, "DSW1") & 0x04) << 4); }
-static READ16_HANDLER ( varia_dips_bit2_r ) { return ((input_port_read(space->machine, "DSW2") & 0x02) << 6) | ((input_port_read(space->machine, "DSW1") & 0x02) << 5); }
-static READ16_HANDLER ( varia_dips_bit1_r ) { return ((input_port_read(space->machine, "DSW2") & 0x01) << 7) | ((input_port_read(space->machine, "DSW1") & 0x01) << 6); }
+static READ16_HANDLER ( varia_dips_bit8_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x80) << 0) | ((input_port_read(space->machine(), "DSW1") & 0x80) >> 1); }
+static READ16_HANDLER ( varia_dips_bit7_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x40) << 1) | ((input_port_read(space->machine(), "DSW1") & 0x40) >> 0); }
+static READ16_HANDLER ( varia_dips_bit6_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x20) << 2) | ((input_port_read(space->machine(), "DSW1") & 0x20) << 1); }
+static READ16_HANDLER ( varia_dips_bit5_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x10) << 3) | ((input_port_read(space->machine(), "DSW1") & 0x10) << 2); }
+static READ16_HANDLER ( varia_dips_bit4_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x08) << 4) | ((input_port_read(space->machine(), "DSW1") & 0x08) << 3); }
+static READ16_HANDLER ( varia_dips_bit3_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x04) << 5) | ((input_port_read(space->machine(), "DSW1") & 0x04) << 4); }
+static READ16_HANDLER ( varia_dips_bit2_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x02) << 6) | ((input_port_read(space->machine(), "DSW1") & 0x02) << 5); }
+static READ16_HANDLER ( varia_dips_bit1_r ) { return ((input_port_read(space->machine(), "DSW2") & 0x01) << 7) | ((input_port_read(space->machine(), "DSW1") & 0x01) << 6); }
static WRITE8_DEVICE_HANDLER( vmetal_control_w )
{
/* Lower nibble is the coin control bits shown in
service mode, but in game mode they're different */
- coin_counter_w(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x08); /* 2nd coin schute activates coin 0 counter in game mode?? */
-// coin_lockout_w(device->machine, 0, data & 0x01); /* always on in game mode?? */
- coin_lockout_w(device->machine, 1, data & 0x02); /* never activated in game mode?? */
+ coin_counter_w(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x08); /* 2nd coin schute activates coin 0 counter in game mode?? */
+// coin_lockout_w(device->machine(), 0, data & 0x01); /* always on in game mode?? */
+ coin_lockout_w(device->machine(), 1, data & 0x02); /* never activated in game mode?? */
if ((data & 0x40) == 0)
device->reset();
@@ -176,7 +176,7 @@ static WRITE8_DEVICE_HANDLER( vmetal_control_w )
es8712_set_bank_base(device, 0x000000);
if (data & 0xa0)
- logerror("%s:Writing unknown bits %04x to $200000\n",device->machine->describe_context(),data);
+ logerror("%s:Writing unknown bits %04x to $200000\n",device->machine().describe_context(),data);
}
static WRITE8_DEVICE_HANDLER( vmetal_es8712_w )
@@ -212,7 +212,7 @@ static WRITE8_DEVICE_HANDLER( vmetal_es8712_w )
*/
es8712_w(device, offset, data);
- logerror("%s:Writing %04x to ES8712 offset %02x\n", device->machine->describe_context(), data, offset);
+ logerror("%s:Writing %04x to ES8712 offset %02x\n", device->machine().describe_context(), data, offset);
}
@@ -361,7 +361,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_vmetal_texttilemap_tile_info )
{
- vmetal_state *state = machine->driver_data<vmetal_state>();
+ vmetal_state *state = machine.driver_data<vmetal_state>();
UINT32 tile;
UINT16 color, data = state->texttileram[tile_index];
int idx = ((data & 0x7fff) >> 4) * 2;
@@ -379,7 +379,7 @@ static TILE_GET_INFO( get_vmetal_texttilemap_tile_info )
static TILE_GET_INFO( get_vmetal_mid1tilemap_tile_info )
{
- vmetal_state *state = machine->driver_data<vmetal_state>();
+ vmetal_state *state = machine.driver_data<vmetal_state>();
UINT16 tile, color, data = state->mid1tileram[tile_index];
get_vmetal_tlookup(machine, data, &tile, &color);
@@ -392,7 +392,7 @@ static TILE_GET_INFO( get_vmetal_mid1tilemap_tile_info )
static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
{
- vmetal_state *state = machine->driver_data<vmetal_state>();
+ vmetal_state *state = machine.driver_data<vmetal_state>();
UINT16 tile, color, data = state->mid2tileram[tile_index];
get_vmetal_tlookup(machine, data, &tile, &color);
@@ -405,7 +405,7 @@ static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
static VIDEO_START(varia)
{
- vmetal_state *state = machine->driver_data<vmetal_state>();
+ vmetal_state *state = machine.driver_data<vmetal_state>();
state->texttilemap = tilemap_create(machine, get_vmetal_texttilemap_tile_info, tilemap_scan_rows, 8, 8, 256, 256);
state->mid1tilemap = tilemap_create(machine, get_vmetal_mid1tilemap_tile_info, tilemap_scan_rows, 16, 16, 256, 256);
@@ -418,10 +418,10 @@ static VIDEO_START(varia)
static SCREEN_UPDATE(varia)
{
- vmetal_state *state = screen->machine->driver_data<vmetal_state>();
+ vmetal_state *state = screen->machine().driver_data<vmetal_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_set_scrollx(state->mid2tilemap, 0, state->_videoregs[0x06a/2]-64 /*+ state->_videoregs[0x066/2]*/);
tilemap_set_scrollx(state->mid1tilemap, 0, state->_videoregs[0x07a/2]-64 /*+ state->_videoregs[0x076/2]*/);
@@ -433,7 +433,7 @@ static SCREEN_UPDATE(varia)
tilemap_draw(bitmap, cliprect, state->mid1tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->mid2tilemap, 0, 0);
- metro_draw_sprites(screen->machine, bitmap, cliprect);
+ metro_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->texttilemap, 0, 0);
return 0;
}
diff --git a/src/mame/drivers/volfied.c b/src/mame/drivers/volfied.c
index 1b170889eee..d70fd71aba4 100644
--- a/src/mame/drivers/volfied.c
+++ b/src/mame/drivers/volfied.c
@@ -209,7 +209,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- volfied_state *state = device->machine->driver_data<volfied_state>();
+ volfied_state *state = device->machine().driver_data<volfied_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -233,13 +233,13 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( volfied )
{
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
volfied_cchip_init(machine);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->pc090oj = machine->device("pc090oj");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->pc090oj = machine.device("pc090oj");
}
static MACHINE_RESET( volfied )
diff --git a/src/mame/drivers/vpoker.c b/src/mame/drivers/vpoker.c
index 29e91c0173f..0ea7f5c30e7 100644
--- a/src/mame/drivers/vpoker.c
+++ b/src/mame/drivers/vpoker.c
@@ -125,15 +125,15 @@ public:
static VIDEO_START( vpoker )
{
- vpoker_state *state = machine->driver_data<vpoker_state>();
+ vpoker_state *state = machine.driver_data<vpoker_state>();
state->videoram = auto_alloc_array(machine, UINT8, 0x200);
}
static SCREEN_UPDATE( vpoker )
{
- vpoker_state *state = screen->machine->driver_data<vpoker_state>();
+ vpoker_state *state = screen->machine().driver_data<vpoker_state>();
UINT8 *videoram = state->videoram;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x0000;
int y,x;
@@ -156,14 +156,14 @@ static SCREEN_UPDATE( vpoker )
static READ8_HANDLER( blitter_r )
{
if(offset == 6)
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
return 0;
}
static WRITE8_HANDLER( blitter_w )
{
- vpoker_state *state = space->machine->driver_data<vpoker_state>();
+ vpoker_state *state = space->machine().driver_data<vpoker_state>();
UINT8 *videoram = state->videoram;
state->blit_ram[offset] = data;
@@ -637,7 +637,7 @@ static PALETTE_INIT( vpoker )
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface ptm_intf =
diff --git a/src/mame/drivers/vroulet.c b/src/mame/drivers/vroulet.c
index 63e03ba9f12..3301d0d8524 100644
--- a/src/mame/drivers/vroulet.c
+++ b/src/mame/drivers/vroulet.c
@@ -65,35 +65,35 @@ static WRITE8_HANDLER(vroulet_paletteram_w)
*/
int i,j,a,b;
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
for(i=0;i<32;i++)
{
for(j=0;j<16;j++)
{
- a=space->machine->generic.paletteram.u8[((i*8+j)*2)&0xff ];
- b=space->machine->generic.paletteram.u8[((i*8+j)*2+1)&0xff ];
- palette_set_color_rgb(space->machine,i*16+j,pal4bit(b),pal4bit(b>>4),pal4bit(a));
+ a=space->machine().generic.paletteram.u8[((i*8+j)*2)&0xff ];
+ b=space->machine().generic.paletteram.u8[((i*8+j)*2+1)&0xff ];
+ palette_set_color_rgb(space->machine(),i*16+j,pal4bit(b),pal4bit(b>>4),pal4bit(a));
}
}
}
static WRITE8_HANDLER( vroulet_videoram_w )
{
- vroulet_state *state = space->machine->driver_data<vroulet_state>();
+ vroulet_state *state = space->machine().driver_data<vroulet_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( vroulet_colorram_w )
{
- vroulet_state *state = space->machine->driver_data<vroulet_state>();
+ vroulet_state *state = space->machine().driver_data<vroulet_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- vroulet_state *state = machine->driver_data<vroulet_state>();
+ vroulet_state *state = machine.driver_data<vroulet_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x1f;
@@ -103,16 +103,16 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START(vroulet)
{
- vroulet_state *state = machine->driver_data<vroulet_state>();
+ vroulet_state *state = machine.driver_data<vroulet_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
}
static SCREEN_UPDATE(vroulet)
{
- vroulet_state *state = screen->machine->driver_data<vroulet_state>();
+ vroulet_state *state = screen->machine().driver_data<vroulet_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], 0x320, 1, 0, 0,
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], 0x320, 1, 0, 0,
state->ball[1], state->ball[0] - 12, 0);
return 0;
}
diff --git a/src/mame/drivers/vsnes.c b/src/mame/drivers/vsnes.c
index 71608e1f07e..a6419f3ef65 100644
--- a/src/mame/drivers/vsnes.c
+++ b/src/mame/drivers/vsnes.c
@@ -152,19 +152,19 @@ Changes:
static WRITE8_HANDLER( sprite_dma_0_w )
{
int source = ( data & 7 );
- ppu2c0x_spriteram_dma( space, space->machine->device("ppu1"), source );
+ ppu2c0x_spriteram_dma( space, space->machine().device("ppu1"), source );
}
static WRITE8_HANDLER( sprite_dma_1_w )
{
int source = ( data & 7 );
- ppu2c0x_spriteram_dma( space, space->machine->device("ppu2"), source );
+ ppu2c0x_spriteram_dma( space, space->machine().device("ppu2"), source );
}
static WRITE8_HANDLER( vsnes_coin_counter_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
- coin_counter_w( space->machine, 0, data & 0x01 );
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
+ coin_counter_w( space->machine(), 0, data & 0x01 );
state->coin = data;
//"bnglngby" and "cluclu"
@@ -176,14 +176,14 @@ static WRITE8_HANDLER( vsnes_coin_counter_w )
static READ8_HANDLER( vsnes_coin_counter_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
//only for platoon
return state->coin;
}
static WRITE8_HANDLER( vsnes_coin_counter_1_w )
{
- coin_counter_w( space->machine, 1, data & 0x01 );
+ coin_counter_w( space->machine(), 1, data & 0x01 );
if( data & 0xfe ) //vsbball service mode
{
//do something?
diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c
index 3733ae84a65..ee4ae93e9c1 100644
--- a/src/mame/drivers/wallc.c
+++ b/src/mame/drivers/wallc.c
@@ -102,7 +102,7 @@ static PALETTE_INIT( wallc )
2, resistances_rg, weights_g, 330, 0,
3, resistances_b, weights_b, 330, 655+220);
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit7,r,g,b;
@@ -128,7 +128,7 @@ static PALETTE_INIT( wallc )
static WRITE8_HANDLER( wallc_videoram_w )
{
- wallc_state *state = space->machine->driver_data<wallc_state>();
+ wallc_state *state = space->machine().driver_data<wallc_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -136,27 +136,27 @@ static WRITE8_HANDLER( wallc_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- wallc_state *state = machine->driver_data<wallc_state>();
+ wallc_state *state = machine.driver_data<wallc_state>();
UINT8 *videoram = state->videoram;
SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0);
}
static VIDEO_START( wallc )
{
- wallc_state *state = machine->driver_data<wallc_state>();
+ wallc_state *state = machine.driver_data<wallc_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_y, 8, 8, 32, 32);
}
static SCREEN_UPDATE( wallc )
{
- wallc_state *state = screen->machine->driver_data<wallc_state>();
+ wallc_state *state = screen->machine().driver_data<wallc_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
static WRITE8_HANDLER( wallc_coin_counter_w )
{
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
}
static ADDRESS_MAP_START( wallc_map, AS_PROGRAM, 8 )
@@ -256,7 +256,7 @@ static DRIVER_INIT( wallc )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i=0; i<0x2000*2; i++)
{
@@ -271,7 +271,7 @@ static DRIVER_INIT( wallca )
UINT8 c;
UINT32 i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i=0; i<0x4000; i++)
{
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index 3ec3a0b0dba..921da1fba1d 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -145,14 +145,14 @@ public:
static WRITE8_HANDLER( wardner_ramrom_bank_sw )
{
- wardner_state *state = space->machine->driver_data<wardner_state>();
+ wardner_state *state = space->machine().driver_data<wardner_state>();
if (state->wardner_membank != data) {
int bankaddress = 0;
address_space *mainspace;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
state->wardner_membank = data;
if (data)
@@ -169,7 +169,7 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
case 6: bankaddress = 0x30000; break; /* not used */
default: bankaddress = 0x00000; break; /* not used */
}
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
else
{
@@ -177,18 +177,18 @@ static WRITE8_HANDLER( wardner_ramrom_bank_sw )
mainspace->install_read_bank(0xa000, 0xadff, "bank4");
mainspace->install_read_bank(0xae00, 0xafff, "bank2");
mainspace->install_read_bank(0xc000, 0xc7ff, "bank3");
- memory_set_bankptr(space->machine, "bank1", &RAM[0x0000]);
- memory_set_bankptr(space->machine, "bank2", state->rambase_ae00);
- memory_set_bankptr(space->machine, "bank3", state->rambase_c000);
- memory_set_bankptr(space->machine, "bank4", space->machine->generic.paletteram.v);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x0000]);
+ memory_set_bankptr(space->machine(), "bank2", state->rambase_ae00);
+ memory_set_bankptr(space->machine(), "bank3", state->rambase_c000);
+ memory_set_bankptr(space->machine(), "bank4", space->machine().generic.paletteram.v);
}
}
}
STATE_POSTLOAD( wardner_restore_bank )
{
- wardner_state *state = machine->driver_data<wardner_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ wardner_state *state = machine.driver_data<wardner_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
wardner_ramrom_bank_sw(space,0,1); /* Dummy value to ensure restoration */
wardner_ramrom_bank_sw(space,0,state->wardner_membank);
@@ -383,7 +383,7 @@ static const gfx_layout spritelayout =
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate);
}
static const ym3812_interface ym3812_config =
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index a9e0348aa7f..6078c1da6a0 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -140,15 +140,15 @@ TODO:
static READ8_HANDLER( geebee_in_r )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
int res;
static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3
offset &= 3;
- res = input_port_read_safe(space->machine, portnames[offset], 0);
+ res = input_port_read_safe(space->machine(), portnames[offset], 0);
if (offset == 3)
{
- res = input_port_read(space->machine, (flip_screen_get(space->machine) & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode
+ res = input_port_read(space->machine(), (flip_screen_get(space->machine()) & 1) ? "IN2" : "IN1"); // read player 2 input in cocktail mode
if (state->handle_joystick)
{
/* map digital two-way joystick to two fixed VOLIN values */
@@ -162,7 +162,7 @@ static READ8_HANDLER( geebee_in_r )
static WRITE8_HANDLER( geebee_out6_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
switch (offset & 3)
{
case 0:
@@ -175,42 +175,42 @@ static WRITE8_HANDLER( geebee_out6_w )
/* n.c. */
break;
case 3:
- geebee_sound_w(space->machine->device("geebee"),0,data);
+ geebee_sound_w(space->machine().device("geebee"),0,data);
break;
}
}
static WRITE8_HANDLER( geebee_out7_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
switch (offset & 7)
{
case 0:
- set_led_status(space->machine, 0,data & 1);
+ set_led_status(space->machine(), 0,data & 1);
break;
case 1:
- set_led_status(space->machine, 1,data & 1);
+ set_led_status(space->machine(), 1,data & 1);
break;
case 2:
- set_led_status(space->machine, 2,data & 1);
+ set_led_status(space->machine(), 2,data & 1);
break;
case 3:
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
break;
case 4:
- if (strcmp(space->machine->system().name, "geebeeb"))
- coin_lockout_global_w(space->machine, ~data & 1);
+ if (strcmp(space->machine().system().name, "geebeeb"))
+ coin_lockout_global_w(space->machine(), ~data & 1);
break;
case 5:
if( state->geebee_bgw != (data & 1) )
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->geebee_bgw = data & 1;
break;
case 6:
state->ball_on = data & 1;
break;
case 7:
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
break;
}
}
@@ -219,22 +219,22 @@ static WRITE8_HANDLER( geebee_out7_w )
/* Read Switch Inputs */
static READ8_HANDLER( warpwarp_sw_r )
{
- return (input_port_read(space->machine, "IN0") >> (offset & 7)) & 1;
+ return (input_port_read(space->machine(), "IN0") >> (offset & 7)) & 1;
}
/* Read Dipswitches */
static READ8_DEVICE_HANDLER( warpwarp_dsw1_r )
{
- return (input_port_read(device->machine, "DSW1") >> (offset & 7)) & 1;
+ return (input_port_read(device->machine(), "DSW1") >> (offset & 7)) & 1;
}
/* Read mux Controller Inputs */
static READ8_DEVICE_HANDLER( warpwarp_vol_r )
{
- warpwarp_state *state = device->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = device->machine().driver_data<warpwarp_state>();
int res;
- res = input_port_read(device->machine, (flip_screen_get(device->machine) & 1) ? "VOLIN2" : "VOLIN1");
+ res = input_port_read(device->machine(), (flip_screen_get(device->machine()) & 1) ? "VOLIN2" : "VOLIN1");
if (state->handle_joystick)
{
if (res & 1) return 0x0f;
@@ -248,7 +248,7 @@ static READ8_DEVICE_HANDLER( warpwarp_vol_r )
static WRITE8_HANDLER( warpwarp_out0_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
switch (offset & 3)
{
case 0:
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( warpwarp_out0_w )
state->ball_v = data;
break;
case 2:
- warpwarp_sound_w(space->machine->device("warpwarp"),0,data);
+ warpwarp_sound_w(space->machine().device("warpwarp"),0,data);
break;
case 3:
watchdog_reset_w(space,0,data);
@@ -268,35 +268,35 @@ static WRITE8_HANDLER( warpwarp_out0_w )
static WRITE8_HANDLER( warpwarp_out3_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
switch (offset & 7)
{
case 0:
- set_led_status(space->machine, 0,data & 1);
+ set_led_status(space->machine(), 0,data & 1);
break;
case 1:
- set_led_status(space->machine, 1,data & 1);
+ set_led_status(space->machine(), 1,data & 1);
break;
case 2:
- set_led_status(space->machine, 2,data & 1);
+ set_led_status(space->machine(), 2,data & 1);
break;
case 3:
/* n.c. */
break;
case 4:
- coin_lockout_global_w(space->machine, ~data & 1);
+ coin_lockout_global_w(space->machine(), ~data & 1);
break;
case 5:
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
break;
case 6:
state->ball_on = data & 1;
- cpu_interrupt_enable(space->machine->device("maincpu"), data & 1);
+ cpu_interrupt_enable(space->machine().device("maincpu"), data & 1);
if (~data & 1)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 7:
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
break;
}
}
@@ -921,7 +921,7 @@ ROM_END
static DRIVER_INIT( geebee )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 0;
state->ball_pen = 1;
@@ -931,7 +931,7 @@ static DRIVER_INIT( geebee )
static DRIVER_INIT( navarone )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 1;
state->ball_pen = 1;
@@ -941,7 +941,7 @@ static DRIVER_INIT( navarone )
static DRIVER_INIT( kaitein )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 1;
state->ball_pen = 1;
@@ -951,7 +951,7 @@ static DRIVER_INIT( kaitein )
static DRIVER_INIT( kaitei )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 0;
state->ball_pen = 1;
@@ -961,7 +961,7 @@ static DRIVER_INIT( kaitei )
static DRIVER_INIT( sos )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 1;
state->ball_pen = 0;
@@ -971,7 +971,7 @@ static DRIVER_INIT( sos )
static DRIVER_INIT( bombbee )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 0;
state->ball_pen = 0x200;
@@ -981,7 +981,7 @@ static DRIVER_INIT( bombbee )
static DRIVER_INIT( warpwarp )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->handle_joystick = 1;
state->ball_pen = 0x200;
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index 014b72e0e6d..059caec683a 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -164,23 +164,23 @@ static MACHINE_RESET( taito_dualscreen );
SOUND
***********************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- warriorb_state *state = machine->driver_data<warriorb_state>();
+ warriorb_state *state = machine.driver_data<warriorb_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- warriorb_state *state = space->machine->driver_data<warriorb_state>();
+ warriorb_state *state = space->machine().driver_data<warriorb_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static WRITE16_HANDLER( warriorb_sound_w )
{
- warriorb_state *state = space->machine->driver_data<warriorb_state>();
+ warriorb_state *state = space->machine().driver_data<warriorb_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, data & 0xff);
@@ -190,7 +190,7 @@ static WRITE16_HANDLER( warriorb_sound_w )
static READ16_HANDLER( warriorb_sound_r )
{
- warriorb_state *state = space->machine->driver_data<warriorb_state>();
+ warriorb_state *state = space->machine().driver_data<warriorb_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
@@ -201,7 +201,7 @@ static READ16_HANDLER( warriorb_sound_r )
static WRITE8_HANDLER( warriorb_pancontrol )
{
- warriorb_state *state = space->machine->driver_data<warriorb_state>();
+ warriorb_state *state = space->machine().driver_data<warriorb_state>();
device_t *flt = NULL;
offset &= 3;
@@ -221,7 +221,7 @@ static WRITE8_HANDLER( warriorb_pancontrol )
static WRITE16_HANDLER( tc0100scn_dual_screen_w )
{
- warriorb_state *state = space->machine->driver_data<warriorb_state>();
+ warriorb_state *state = space->machine().driver_data<warriorb_state>();
tc0100scn_word_w(state->tc0100scn_1, offset, data, mem_mask);
tc0100scn_word_w(state->tc0100scn_2, offset, data, mem_mask);
@@ -419,7 +419,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- warriorb_state *state = device->machine->driver_data<warriorb_state>();
+ warriorb_state *state = device->machine().driver_data<warriorb_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -538,37 +538,37 @@ static STATE_POSTLOAD( warriorb_postload )
static MACHINE_START( warriorb )
{
- warriorb_state *state = machine->driver_data<warriorb_state>();
+ warriorb_state *state = machine.driver_data<warriorb_state>();
- memory_configure_bank(machine, "bank10", 0, 8, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 8, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->tc0140syt = machine->device("tc0140syt");
- state->tc0100scn_1 = machine->device("tc0100scn_1");
- state->tc0100scn_2 = machine->device("tc0100scn_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->tc0140syt = machine.device("tc0140syt");
+ state->tc0100scn_1 = machine.device("tc0100scn_1");
+ state->tc0100scn_2 = machine.device("tc0100scn_2");
- state->lscreen = machine->device("lscreen");
- state->rscreen = machine->device("rscreen");
+ state->lscreen = machine.device("lscreen");
+ state->rscreen = machine.device("rscreen");
- state->_2610_1l = machine->device("2610.1.l");
- state->_2610_1r = machine->device("2610.1.r");
- state->_2610_2l = machine->device("2610.2.l");
- state->_2610_2r = machine->device("2610.2.r");
+ state->_2610_1l = machine.device("2610.1.l");
+ state->_2610_1r = machine.device("2610.1.r");
+ state->_2610_2l = machine.device("2610.2.l");
+ state->_2610_2r = machine.device("2610.2.r");
state->save_item(NAME(state->banknum));
state->save_item(NAME(state->pandata));
- machine->state().register_postload(warriorb_postload, NULL);
+ machine.state().register_postload(warriorb_postload, NULL);
}
static MACHINE_RESET( taito_dualscreen )
{
- warriorb_state *state = machine->driver_data<warriorb_state>();
+ warriorb_state *state = machine.driver_data<warriorb_state>();
state->banknum = 0;
/**** mixer control enable ****/
- machine->sound().system_enable(true); /* mixer enabled */
+ machine.sound().system_enable(true); /* mixer enabled */
}
static MACHINE_CONFIG_START( darius2d, warriorb_state )
diff --git a/src/mame/drivers/wc90.c b/src/mame/drivers/wc90.c
index a78b6f97010..1d407112271 100644
--- a/src/mame/drivers/wc90.c
+++ b/src/mame/drivers/wc90.c
@@ -83,27 +83,27 @@ voice.ic82 CRC32 abc61f3d SHA1 c6f123d16a26c4d77c635617dd97bb4b906c463a
static WRITE8_HANDLER( wc90_bankswitch_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress] );
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress] );
}
static WRITE8_HANDLER( wc90_bankswitch1_w )
{
int bankaddress;
- UINT8 *RAM = space->machine->region("sub")->base();
+ UINT8 *RAM = space->machine().region("sub")->base();
bankaddress = 0x10000 + ( ( data & 0xf8 ) << 8 );
- memory_set_bankptr(space->machine, "bank2", &RAM[bankaddress] );
+ memory_set_bankptr(space->machine(), "bank2", &RAM[bankaddress] );
}
static WRITE8_HANDLER( wc90_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -293,7 +293,7 @@ GFXDECODE_END
/* handler called by the 2608 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2608_interface ym2608_config =
diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c
index ee075400834..ab5ed43ec57 100644
--- a/src/mame/drivers/wc90b.c
+++ b/src/mame/drivers/wc90b.c
@@ -99,42 +99,42 @@ Noted added by ClawGrip 28-Mar-2008:
static WRITE8_HANDLER( wc90b_bankswitch_w )
{
int bankaddress;
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
- memory_set_bankptr(space->machine, "bank1",&ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&ROM[bankaddress]);
}
static WRITE8_HANDLER( wc90b_bankswitch1_w )
{
int bankaddress;
- UINT8 *ROM = space->machine->region("sub")->base();
+ UINT8 *ROM = space->machine().region("sub")->base();
bankaddress = 0x10000 + ((data & 0xf8) << 8);
- memory_set_bankptr(space->machine, "bank2",&ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank2",&ROM[bankaddress]);
}
static WRITE8_HANDLER( wc90b_sound_command_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static WRITE8_DEVICE_HANDLER( adpcm_control_w )
{
int bankaddress;
- UINT8 *ROM = device->machine->region("audiocpu")->base();
+ UINT8 *ROM = device->machine().region("audiocpu")->base();
/* the code writes either 2 or 3 in the bottom two bits */
bankaddress = 0x10000 + (data & 0x01) * 0x4000;
- memory_set_bankptr(device->machine, "bank3",&ROM[bankaddress]);
+ memory_set_bankptr(device->machine(), "bank3",&ROM[bankaddress]);
msm5205_reset_w(device,data & 0x08);
}
static WRITE8_HANDLER( adpcm_data_w )
{
- wc90b_state *state = space->machine->driver_data<wc90b_state>();
+ wc90b_state *state = space->machine().driver_data<wc90b_state>();
state->msm5205next = data;
}
@@ -327,7 +327,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
/* NMI writes to MSM ports *only*! -AS */
- //cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
+ //cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -342,13 +342,13 @@ static const ym2203_interface ym2203_config =
static void adpcm_int(device_t *device)
{
- wc90b_state *state = device->machine->driver_data<wc90b_state>();
+ wc90b_state *state = device->machine().driver_data<wc90b_state>();
state->toggle ^= 1;
if(state->toggle)
{
msm5205_data_w(device, (state->msm5205next & 0xf0) >> 4);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
else
msm5205_data_w(device, (state->msm5205next & 0x0f) >> 0);
diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c
index 5c3d3a9ed30..c4325a7c191 100644
--- a/src/mame/drivers/wecleman.c
+++ b/src/mame/drivers/wecleman.c
@@ -287,7 +287,7 @@ TODO:
static READ16_HANDLER( wecleman_protection_r )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
int blend, data0, data1, r0, g0, b0, r1, g1, b1;
data0 = state->protection_ram[0];
@@ -314,7 +314,7 @@ static READ16_HANDLER( wecleman_protection_r )
static WRITE16_HANDLER( wecleman_protection_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
if (offset == 2) state->prot_state = data & 0x2000;
if (!state->prot_state) COMBINE_DATA(state->protection_ram + offset);
}
@@ -342,20 +342,20 @@ static WRITE16_HANDLER( wecleman_protection_w )
*/
static WRITE16_HANDLER( irqctrl_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
if (ACCESSING_BITS_0_7)
{
// logerror("CPU #0 - PC = %06X - $140005 <- %02X (old value: %02X)\n",cpu_get_pc(space->cpu), data&0xFF, old_data&0xFF);
// Bit 0 : SUBINT
if ( (state->irqctrl & 1) && (!(data & 1)) ) // 1->0 transition
- cputag_set_input_line(space->machine, "sub", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 4, HOLD_LINE);
// Bit 1 : NSUBRST
if (data & 2)
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE);
// Bit 2 : SOUND-ON
// Bit 3 : SOUNDRST
@@ -379,19 +379,19 @@ static WRITE16_HANDLER( irqctrl_w )
*/
static WRITE16_HANDLER( selected_ip_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
if (ACCESSING_BITS_0_7) state->selected_ip = data & 0xff; // latch the value
}
/* $140021.b - Return the previously selected input port's value */
static READ16_HANDLER( selected_ip_r )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
switch ( (state->selected_ip >> 5) & 3 )
{ // From WEC Le Mans Schems:
- case 0: return input_port_read(space->machine, "ACCEL"); // Accel - Schems: Accelevr
+ case 0: return input_port_read(space->machine(), "ACCEL"); // Accel - Schems: Accelevr
case 1: return ~0; // ????? - Schems: Not Used
- case 2: return input_port_read(space->machine, "STEER"); // Wheel - Schems: Handlevr
+ case 2: return input_port_read(space->machine(), "STEER"); // Wheel - Schems: Handlevr
case 3: return ~0; // Table - Schems: Turnvr
default: return ~0;
@@ -434,7 +434,7 @@ static READ16_HANDLER( selected_ip_r )
*/
static WRITE16_HANDLER( blitter_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
COMBINE_DATA(&state->blitter_regs[offset]);
/* do a blit if $80010.b has been written */
@@ -604,20 +604,20 @@ WRITE16_HANDLER( wecleman_soundlatch_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xFF);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
/* Protection - an external multiplyer connected to the sound CPU */
static READ8_HANDLER( multiply_r )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
return (state->multiply_reg[0] * state->multiply_reg[1]) & 0xFF;
}
static WRITE8_HANDLER( multiply_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
state->multiply_reg[offset] = data;
}
@@ -666,7 +666,7 @@ static WRITE16_HANDLER( hotchase_soundlatch_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xFF);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
}
}
@@ -676,9 +676,9 @@ static WRITE8_HANDLER( hotchase_sound_control_w )
int reg[8];
- sound[0] = space->machine->device("konami1");
- sound[1] = space->machine->device("konami2");
- sound[2] = space->machine->device("konami3");
+ sound[0] = space->machine().device("konami1");
+ sound[1] = space->machine().device("konami2");
+ sound[2] = space->machine().device("konami3");
reg[offset] = data;
@@ -1028,7 +1028,7 @@ static INTERRUPT_GEN( wecleman_interrupt )
static MACHINE_RESET( wecleman )
{
- k007232_set_bank( machine->device("konami"), 0, 1 );
+ k007232_set_bank( machine.device("konami"), 0, 1 );
}
static MACHINE_CONFIG_START( wecleman, wecleman_state )
@@ -1209,13 +1209,13 @@ ROM_START( wecleman )
ROM_END
-static void wecleman_unpack_sprites(running_machine *machine)
+static void wecleman_unpack_sprites(running_machine &machine)
{
const char *region = "gfx1"; // sprites
- const UINT32 len = machine->region(region)->bytes();
- UINT8 *src = machine->region(region)->base() + len / 2 - 1;
- UINT8 *dst = machine->region(region)->base() + len - 1;
+ const UINT32 len = machine.region(region)->bytes();
+ UINT8 *src = machine.region(region)->base() + len / 2 - 1;
+ UINT8 *dst = machine.region(region)->base() + len - 1;
while(dst > src)
{
@@ -1226,7 +1226,7 @@ static void wecleman_unpack_sprites(running_machine *machine)
}
}
-static void bitswap(running_machine *machine,UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0)
+static void bitswap(running_machine &machine,UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0)
{
UINT8 *buffer = auto_alloc_array(machine, UINT8, len);
int i;
@@ -1243,10 +1243,10 @@ static void bitswap(running_machine *machine,UINT8 *src,size_t len,int _14,int _
/* Unpack sprites data and do some patching */
static DRIVER_INIT( wecleman )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
int i, len;
UINT8 *RAM;
-// UINT16 *RAM1 = (UINT16 *) machine->region("maincpu")->base(); /* Main CPU patches */
+// UINT16 *RAM1 = (UINT16 *) machine.region("maincpu")->base(); /* Main CPU patches */
// RAM1[0x08c2/2] = 0x601e; // faster self test
/* Decode GFX Roms - Compensate for the address lines scrambling */
@@ -1256,8 +1256,8 @@ static DRIVER_INIT( wecleman )
I hope you'll appreciate this effort! */
/* let's swap even and odd *pixels* of the sprites */
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0; i < len; i ++)
{
/* TODO: could be wrong, colors have to be fixed. */
@@ -1266,18 +1266,18 @@ static DRIVER_INIT( wecleman )
RAM[i] = BITSWAP8(RAM[i],7,0,1,2,3,4,5,6);
}
- bitswap(machine, machine->region("gfx1")->base(), machine->region("gfx1")->bytes(),
+ bitswap(machine, machine.region("gfx1")->base(), machine.region("gfx1")->bytes(),
0,1,20,19,18,17,14,9,16,6,4,7,8,15,10,11,13,5,12,3,2);
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
wecleman_unpack_sprites(machine);
/* Bg & Fg & Txt */
- bitswap(machine, machine->region("gfx2")->base(), machine->region("gfx2")->bytes(),
+ bitswap(machine, machine.region("gfx2")->base(), machine.region("gfx2")->bytes(),
20,19,18,17,16,15,12,7,14,4,2,5,6,13,8,9,11,3,10,1,0);
/* Road */
- bitswap(machine, machine->region("gfx3")->base(), machine->region("gfx3")->bytes(),
+ bitswap(machine, machine.region("gfx3")->base(), machine.region("gfx3")->bytes(),
20,19,18,17,16,15,14,7,12,4,2,5,6,13,8,9,11,3,10,1,0);
state->spr_color_offs = 0x40;
@@ -1337,12 +1337,12 @@ ROM_END
in a ROM module definition. This routine unpacks each sprite nibble
into a byte, doubling the memory consumption. */
-static void hotchase_sprite_decode( running_machine *machine, int num16_banks, int bank_size )
+static void hotchase_sprite_decode( running_machine &machine, int num16_banks, int bank_size )
{
UINT8 *base, *temp;
int i;
- base = machine->region("gfx1")->base(); // sprites
+ base = machine.region("gfx1")->base(); // sprites
temp = auto_alloc_array(machine, UINT8, bank_size );
for( i = num16_banks; i >0; i-- ){
@@ -1387,8 +1387,8 @@ static void hotchase_sprite_decode( running_machine *machine, int num16_banks, i
/* Unpack sprites data and do some patching */
static DRIVER_INIT( hotchase )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
-// UINT16 *RAM1 = (UINT16) machine->region("maincpu")->base(); /* Main CPU patches */
+ wecleman_state *state = machine.driver_data<wecleman_state>();
+// UINT16 *RAM1 = (UINT16) machine.region("maincpu")->base(); /* Main CPU patches */
// RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test
UINT8 *RAM;
@@ -1396,13 +1396,13 @@ static DRIVER_INIT( hotchase )
/* Decode GFX Roms */
/* Let's swap even and odd bytes of the sprites gfx roms */
- RAM = machine->region("gfx1")->base();
+ RAM = machine.region("gfx1")->base();
/* Now we can unpack each nibble of the sprites into a pixel (one byte) */
hotchase_sprite_decode(machine,3,0x80000*2); // num banks, bank len
/* Let's copy the second half of the fg layer gfx (charset) over the first */
- RAM = machine->region("gfx3")->base();
+ RAM = machine.region("gfx3")->base();
memcpy(&RAM[0], &RAM[0x10000/2], 0x10000/2);
state->spr_color_offs = 0;
diff --git a/src/mame/drivers/welltris.c b/src/mame/drivers/welltris.c
index e0d2f1513be..f481f8c2560 100644
--- a/src/mame/drivers/welltris.c
+++ b/src/mame/drivers/welltris.c
@@ -322,9 +322,9 @@ TODO:
static WRITE8_HANDLER( welltris_sh_bankswitch_w )
{
- UINT8 *rom = space->machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("audiocpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1",rom + (data & 0x03) * 0x8000);
+ memory_set_bankptr(space->machine(), "bank1",rom + (data & 0x03) * 0x8000);
}
@@ -332,23 +332,23 @@ static WRITE16_HANDLER( sound_command_w )
{
if (ACCESSING_BITS_0_7)
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
state->pending_command = 1;
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
static CUSTOM_INPUT( pending_sound_r )
{
- welltris_state *state = field->port->machine->driver_data<welltris_state>();
+ welltris_state *state = field->port->machine().driver_data<welltris_state>();
return state->pending_command ? 1 : 0;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
state->pending_command = 0;
}
@@ -678,7 +678,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -692,7 +692,7 @@ static DRIVER_INIT( welltris )
{
#if WELLTRIS_4P_HACK
/* A Hack which shows 4 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0xB91C/2] = 0x4e71;
RAM[0xB91E/2] = 0x4e71;
#endif
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 07f0dcce081..d24b0f698cb 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -405,22 +405,22 @@ Stephh's notes (based on the game M68000 code and some tests) :
static READ16_HANDLER( sharedram_r )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
return state->sharedram[offset];
}
static WRITE16_HANDLER( sharedram_w )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
COMBINE_DATA(&state->sharedram[offset]);
}
-static void parse_control(running_machine *machine)
+static void parse_control(running_machine &machine)
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
device_set_input_line(state->subcpu, INPUT_LINE_RESET, (state->cpua_ctrl & 0x1) ? CLEAR_LINE : ASSERT_LINE);
/* bit 1 is "vibration" acc. to test mode */
@@ -428,13 +428,13 @@ static void parse_control(running_machine *machine)
static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
if ((data &0xff00) && ((data &0xff) == 0))
data = data >> 8; /* for Wgp */
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(space->cpu),data);
}
@@ -449,14 +449,14 @@ static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( wgp_interrupt4 )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
device_set_input_line(state->maincpu, 4, HOLD_LINE);
}
#endif
static TIMER_CALLBACK( wgp_interrupt6 )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
device_set_input_line(state->maincpu, 6, HOLD_LINE);
}
@@ -464,7 +464,7 @@ static TIMER_CALLBACK( wgp_interrupt6 )
static TIMER_CALLBACK( wgp_cpub_interrupt6 )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
device_set_input_line(state->subcpu, 6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */
}
@@ -477,7 +477,7 @@ static TIMER_CALLBACK( wgp_cpub_interrupt6 )
static INTERRUPT_GEN( wgp_cpub_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(wgp_cpub_interrupt6));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(wgp_cpub_interrupt6));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -510,7 +510,7 @@ static WRITE16_HANDLER( rotate_port_w )
which contains sets of 4 words (used for ports 0-3).
NB: port 6 is not written.
*/
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
switch (offset)
{
@@ -537,12 +537,12 @@ static WRITE16_HANDLER( rotate_port_w )
static READ16_HANDLER( wgp_adinput_r )
{
int steer = 0x40;
- int fake = input_port_read_safe(space->machine, FAKE_PORT_TAG, 0x00);
+ int fake = input_port_read_safe(space->machine(), FAKE_PORT_TAG, 0x00);
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* Reduce span to 0x80 */
- steer = (input_port_read_safe(space->machine, STEER_PORT_TAG, 0x00) * 0x80) / 0x100;
+ steer = (input_port_read_safe(space->machine(), STEER_PORT_TAG, 0x00) * 0x80) / 0x100;
}
else /* Digital steer */
{
@@ -587,7 +587,7 @@ static READ16_HANDLER( wgp_adinput_r )
}
case 0x05:
- return input_port_read_safe(space->machine, UNKNOWN_PORT_TAG, 0x00); /* unknown */
+ return input_port_read_safe(space->machine(), UNKNOWN_PORT_TAG, 0x00); /* unknown */
}
logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",cpu_get_pc(space->cpu),offset);
@@ -601,7 +601,7 @@ static WRITE16_HANDLER( wgp_adinput_w )
hardware has got the next a/d conversion ready. We set a token
delay of 10000 cycles although our inputs are always ready. */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(wgp_interrupt6));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(wgp_interrupt6));
}
@@ -609,22 +609,22 @@ static WRITE16_HANDLER( wgp_adinput_w )
SOUND
**********************************************************/
-static void reset_sound_region( running_machine *machine ) /* assumes Z80 sandwiched between the 68Ks */
+static void reset_sound_region( running_machine &machine ) /* assumes Z80 sandwiched between the 68Ks */
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
memory_set_bank(machine, "bank10", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
state->banknum = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static WRITE16_HANDLER( wgp_sound_w )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
if (offset == 0)
tc0140syt_port_w(state->tc0140syt, 0, data & 0xff);
@@ -634,7 +634,7 @@ static WRITE16_HANDLER( wgp_sound_w )
static READ16_HANDLER( wgp_sound_r )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
if (offset == 1)
return ((tc0140syt_comm_r(state->tc0140syt, 0) & 0xff));
@@ -905,7 +905,7 @@ GFXDECODE_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq ) // assumes Z80 sandwiched between 68Ks
{
- wgp_state *state = device->machine->driver_data<wgp_state>();
+ wgp_state *state = device->machine().driver_data<wgp_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -931,7 +931,7 @@ static STATE_POSTLOAD( wgp_postload )
static MACHINE_RESET( wgp )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
int i;
state->banknum = 0;
@@ -951,20 +951,20 @@ static MACHINE_RESET( wgp )
static MACHINE_START( wgp )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
- memory_configure_bank(machine, "bank10", 0, 4, machine->region("audiocpu")->base() + 0xc000, 0x4000);
+ memory_configure_bank(machine, "bank10", 0, 4, machine.region("audiocpu")->base() + 0xc000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->tc0140syt = machine->device("tc0140syt");
- state->tc0100scn = machine->device("tc0100scn");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->tc0140syt = machine.device("tc0140syt");
+ state->tc0100scn = machine.device("tc0100scn");
state->save_item(NAME(state->cpua_ctrl));
state->save_item(NAME(state->banknum));
state->save_item(NAME(state->port_sel));
- machine->state().register_postload(wgp_postload, NULL);
+ machine.state().register_postload(wgp_postload, NULL);
}
static const tc0100scn_interface wgp_tc0100scn_intf =
@@ -1270,7 +1270,7 @@ static DRIVER_INIT( wgp )
#if 0
/* Patch for coding error that causes corrupt data in
sprite tilemapping area from $4083c0-847f */
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
ROM[0x25dc / 2] = 0x0602; // faulty value is 0x0206
#endif
}
@@ -1278,7 +1278,7 @@ static DRIVER_INIT( wgp )
static DRIVER_INIT( wgp2 )
{
/* Code patches to prevent failure in memory checks */
- UINT16 *ROM = (UINT16 *)machine->region("sub")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("sub")->base();
ROM[0x8008 / 2] = 0x0;
ROM[0x8010 / 2] = 0x0;
}
diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c
index f6f1ee879cf..06fd2f51f85 100644
--- a/src/mame/drivers/wheelfir.c
+++ b/src/mame/drivers/wheelfir.c
@@ -284,20 +284,20 @@ static READ16_HANDLER( wheelfir_status_r )
---------------x ? eeprom
*/
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
- return state->toggle_bit| (space->machine->rand()&0x2000);
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
+ return state->toggle_bit| (space->machine().rand()&0x2000);
}
static WRITE16_HANDLER( wheelfir_scanline_cnt_w )
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
COMBINE_DATA(&state->scanline_cnt);
}
static WRITE16_HANDLER(wheelfir_blit_w)
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
COMBINE_DATA(&state->blitter_data[offset]);
@@ -368,13 +368,13 @@ static WRITE16_HANDLER(wheelfir_blit_w)
if(offset==0xf && data==0xffff)
{
- cputag_set_input_line(space->machine, "maincpu", 1, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, HOLD_LINE);
{
- UINT8 *rom = space->machine->region("gfx1")->base();
+ UINT8 *rom = space->machine().region("gfx1")->base();
- int width = space->machine->primary_screen->width();
- int height = space->machine->primary_screen->height();
+ int width = space->machine().primary_screen->width();
+ int height = space->machine().primary_screen->height();
int src_x0=(state->blitter_data[0]>>8)+((state->blitter_data[6]&0x100)?256:0);
int src_y0=(state->blitter_data[2]>>8)+((state->blitter_data[6]&0x200)?256:0);
@@ -559,14 +559,14 @@ static WRITE16_HANDLER(wheelfir_blit_w)
static VIDEO_START(wheelfir)
{
- wheelfir_state *state = machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = machine.driver_data<wheelfir_state>();
state->tmp_bitmap[0] = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
state->tmp_bitmap[1] = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_INDEXED16);
}
static SCREEN_UPDATE(wheelfir)
{
- wheelfir_state *state = screen->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = screen->machine().driver_data<wheelfir_state>();
bitmap_fill(bitmap, cliprect,0);
@@ -597,20 +597,20 @@ static SCREEN_UPDATE(wheelfir)
static SCREEN_EOF( wheelfir )
{
- wheelfir_state *state = machine->driver_data<wheelfir_state>();
- bitmap_fill(state->tmp_bitmap[LAYER_FG], &machine->primary_screen->visible_area(),0);
+ wheelfir_state *state = machine.driver_data<wheelfir_state>();
+ bitmap_fill(state->tmp_bitmap[LAYER_FG], &machine.primary_screen->visible_area(),0);
}
static WRITE16_HANDLER( pal_reset_pos_w )
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
state->palpos = 0;
}
static WRITE16_HANDLER( pal_data_w )
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
int color=state->palpos/3;
state->palette[state->palpos] = data & 0xff;
++state->palpos;
@@ -621,7 +621,7 @@ static WRITE16_HANDLER( pal_data_w )
int r = state->palette[color*3];
int g = state->palette[color*3+1];
int b = state->palette[color*3+2];
- palette_set_color(space->machine, color, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), color, MAKE_RGB(r,g,b));
}
}
@@ -633,23 +633,23 @@ static WRITE16_HANDLER(wheelfir_7c0000_w)
static WRITE16_HANDLER(wheelfir_snd_w)
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
COMBINE_DATA(&state->soundlatch);
- cputag_set_input_line(space->machine, "subcpu", 1, HOLD_LINE); /* guess, tested also with periodic interrupts and latch clear*/
- space->machine->scheduler().synchronize();
+ cputag_set_input_line(space->machine(), "subcpu", 1, HOLD_LINE); /* guess, tested also with periodic interrupts and latch clear*/
+ space->machine().scheduler().synchronize();
}
static READ16_HANDLER( wheelfir_snd_r )
{
- wheelfir_state *state = space->machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = space->machine().driver_data<wheelfir_state>();
return state->soundlatch;
}
static WRITE16_HANDLER(coin_cnt_w)
{
/* bits 0/1 coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
@@ -719,8 +719,8 @@ INPUT_PORTS_END
static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
{
- wheelfir_state *state = timer.machine->driver_data<wheelfir_state>();
- timer.machine->scheduler().synchronize();
+ wheelfir_state *state = timer.machine().driver_data<wheelfir_state>();
+ timer.machine().scheduler().synchronize();
state->current_scanline=param;
if(state->current_scanline<NUM_SCANLINES)
@@ -741,7 +741,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
if(state->scanline_cnt==0) //<=0 ?
{
- cputag_set_input_line(timer.machine, "maincpu", 5, HOLD_LINE); // raster IRQ, changes scroll values for road
+ cputag_set_input_line(timer.machine(), "maincpu", 5, HOLD_LINE); // raster IRQ, changes scroll values for road
}
}
@@ -750,7 +750,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
if(state->current_scanline==NUM_SCANLINES) /* vblank */
{
state->toggle_bit = 0x8000;
- cputag_set_input_line(timer.machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 3, HOLD_LINE);
}
}
}
@@ -762,12 +762,12 @@ static MACHINE_RESET( wheelfir )
static MACHINE_START( wheelfir )
{
- wheelfir_state *state = machine->driver_data<wheelfir_state>();
+ wheelfir_state *state = machine.driver_data<wheelfir_state>();
- state->maincpu = machine->device( "maincpu");
- state->subcpu = machine->device( "subcpu");
- state->screen = machine->device( "screen");
- state->eeprom = machine->device( "eeprom");
+ state->maincpu = machine.device( "maincpu");
+ state->subcpu = machine.device( "subcpu");
+ state->screen = machine.device( "screen");
+ state->eeprom = machine.device( "eeprom");
state->zoom_table = auto_alloc_array(machine, INT32, ZOOM_TABLE_SIZE);
state->blitter_data = auto_alloc_array(machine, UINT16, 16);
@@ -781,7 +781,7 @@ static MACHINE_START( wheelfir )
state->zoom_table[i]=-1;
}
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
for(int j=0;j<400;++j)
{
@@ -864,7 +864,7 @@ ROM_END
static DRIVER_INIT(wheelfir)
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0xdd3da/2] = 0x4e71; //hack
}
diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c
index 89e921f12bf..eb027bb54a4 100644
--- a/src/mame/drivers/williams.c
+++ b/src/mame/drivers/williams.c
@@ -527,8 +527,8 @@ ADDRESS_MAP_END
void defender_install_io_space(address_space *space)
{
- device_t *pia_0 = space->machine->device("pia_0");
- device_t *pia_1 = space->machine->device("pia_1");
+ device_t *pia_0 = space->machine().device("pia_0");
+ device_t *pia_1 = space->machine().device("pia_1");
/* this routine dynamically installs the memory mapped above from c000-cfff */
space->install_write_bank (0xc000, 0xc00f, 0, 0x03e0, "bank4");
@@ -539,8 +539,8 @@ void defender_install_io_space(address_space *space)
space->install_legacy_read_handler (0xc800, 0xcbff, 0, 0x03e0, FUNC(williams_video_counter_r));
space->install_legacy_readwrite_handler(*pia_1, 0xcc00, 0xcc03, 0, 0x03e0, FUNC(pia6821_r), FUNC(pia6821_w));
space->install_legacy_readwrite_handler(*pia_0, 0xcc04, 0xcc07, 0, 0x03e0, FUNC(pia6821_r), FUNC(pia6821_w));
- memory_set_bankptr(space->machine, "bank3", space->machine->driver_data<williams_state>()->m_nvram);
- memory_set_bankptr(space->machine, "bank4", space->machine->generic.paletteram.v);
+ memory_set_bankptr(space->machine(), "bank3", space->machine().driver_data<williams_state>()->m_nvram);
+ memory_set_bankptr(space->machine(), "bank4", space->machine().generic.paletteram.v);
}
@@ -2704,15 +2704,15 @@ ROM_END
static DRIVER_INIT( defender )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
}
static DRIVER_INIT( defndjeu )
{
- williams_state *state = machine->driver_data<williams_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ williams_state *state = machine.driver_data<williams_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
@@ -2725,11 +2725,11 @@ static DRIVER_INIT( defndjeu )
static DRIVER_INIT( mayday )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
/* install a handler to catch protection checks */
- state->mayday_protection = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa190, 0xa191, FUNC(mayday_protection_r));
+ state->mayday_protection = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa190, 0xa191, FUNC(mayday_protection_r));
}
@@ -2742,107 +2742,107 @@ static DRIVER_INIT( mayday )
static DRIVER_INIT( stargate )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000);
}
static DRIVER_INIT( robotron )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
}
static DRIVER_INIT( joust )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
}
static DRIVER_INIT( bubbles )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
/* bubbles has a full 8-bit-wide CMOS */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc00, 0xcfff, FUNC(bubbles_cmos_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc00, 0xcfff, FUNC(bubbles_cmos_w));
}
static DRIVER_INIT( splat )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0xc000);
}
static DRIVER_INIT( sinistar )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0x7400);
}
static DRIVER_INIT( playball )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
}
static DRIVER_INIT( blaster )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9700);
}
static DRIVER_INIT( blastkit )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9700);
}
static DRIVER_INIT( spdball )
{
- williams_state *state = machine->driver_data<williams_state>();
- device_t *pia_3 = machine->device("pia_3");
+ williams_state *state = machine.driver_data<williams_state>();
+ device_t *pia_3 = machine.device("pia_3");
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
/* add a third PIA */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*pia_3, 0xc808, 0xc80b, FUNC(pia6821_r), FUNC(pia6821_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*pia_3, 0xc808, 0xc80b, FUNC(pia6821_r), FUNC(pia6821_w));
/* install extra input handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc800, 0xc800, "AN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc801, 0xc801, "AN1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc802, 0xc802, "AN2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc803, 0xc803, "AN3");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc800, 0xc800, "AN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc801, 0xc801, "AN1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc802, 0xc802, "AN2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc803, 0xc803, "AN3");
}
static DRIVER_INIT( alienar )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xcbff, 0xcbff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xcbff, 0xcbff);
}
static DRIVER_INIT( alienaru )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xcbff, 0xcbff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xcbff, 0xcbff);
}
static DRIVER_INIT( lottofun )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000);
}
@@ -2856,7 +2856,7 @@ static DRIVER_INIT( lottofun )
static DRIVER_INIT( mysticm )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_MYSTICM);
}
@@ -2864,7 +2864,7 @@ static DRIVER_INIT( mysticm )
static DRIVER_INIT( tshoot )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT);
}
@@ -2872,7 +2872,7 @@ static DRIVER_INIT( tshoot )
static DRIVER_INIT( inferno )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_TSHOOT);
}
@@ -2880,7 +2880,7 @@ static DRIVER_INIT( inferno )
static DRIVER_INIT( joust2 )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC02, 0x9000);
CONFIGURE_TILEMAP(WILLIAMS_TILEMAP_JOUST2);
}
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index ef896ba4d7e..8d872829c0f 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -32,7 +32,7 @@ public:
static TILE_GET_INFO( get_bg_tile_info )
{
- wink_state *state = machine->driver_data<wink_state>();
+ wink_state *state = machine.driver_data<wink_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
code |= 0x200 * state->tile_bank;
@@ -48,20 +48,20 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( wink )
{
- wink_state *state = machine->driver_data<wink_state>();
+ wink_state *state = machine.driver_data<wink_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( wink )
{
- wink_state *state = screen->machine->driver_data<wink_state>();
+ wink_state *state = screen->machine().driver_data<wink_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
static WRITE8_HANDLER( bgram_w )
{
- wink_state *state = space->machine->driver_data<wink_state>();
+ wink_state *state = space->machine().driver_data<wink_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -75,31 +75,31 @@ static WRITE8_HANDLER( player_mux_w )
static WRITE8_HANDLER( tile_banking_w )
{
- wink_state *state = space->machine->driver_data<wink_state>();
+ wink_state *state = space->machine().driver_data<wink_state>();
state->tile_bank = data & 1;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
static WRITE8_HANDLER( wink_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data & 1);
+ coin_counter_w(space->machine(), offset,data & 1);
}
static READ8_HANDLER( analog_port_r )
{
- return input_port_read(space->machine, /* player_mux ? "DIAL2" : */ "DIAL1");
+ return input_port_read(space->machine(), /* player_mux ? "DIAL2" : */ "DIAL1");
}
static READ8_HANDLER( player_inputs_r )
{
- return input_port_read(space->machine, /* player_mux ? "INPUTS2" : */ "INPUTS1");
+ return input_port_read(space->machine(), /* player_mux ? "INPUTS2" : */ "INPUTS1");
}
static WRITE8_HANDLER( sound_irq_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
//sync with sound cpu (but it still loses some soundlatches...)
- //space->machine->scheduler().synchronize();
+ //space->machine().scheduler().synchronize();
}
static ADDRESS_MAP_START( wink_map, AS_PROGRAM, 8 )
@@ -304,7 +304,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER( sound_r )
{
- wink_state *state = device->machine->driver_data<wink_state>();
+ wink_state *state = device->machine().driver_data<wink_state>();
return state->sound_flag;
}
@@ -321,13 +321,13 @@ static const ay8910_interface ay8912_interface =
//AY portA is fed by an input clock at 15625 Hz
static INTERRUPT_GEN( wink_sound )
{
- wink_state *state = device->machine->driver_data<wink_state>();
+ wink_state *state = device->machine().driver_data<wink_state>();
state->sound_flag ^= 0x80;
}
static MACHINE_RESET( wink )
{
- wink_state *state = machine->driver_data<wink_state>();
+ wink_state *state = machine.driver_data<wink_state>();
state->sound_flag = 0;
}
@@ -404,7 +404,7 @@ ROM_END
static DRIVER_INIT( wink )
{
UINT32 i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x8000);
// protection module reverse engineered by HIGHWAYMAN
diff --git a/src/mame/drivers/wiping.c b/src/mame/drivers/wiping.c
index 76250f6122a..b239f8773bd 100644
--- a/src/mame/drivers/wiping.c
+++ b/src/mame/drivers/wiping.c
@@ -41,25 +41,25 @@ dip: 6.7 7.7
static READ8_HANDLER( shared1_r )
{
- wiping_state *state = space->machine->driver_data<wiping_state>();
+ wiping_state *state = space->machine().driver_data<wiping_state>();
return state->sharedram1[offset];
}
static READ8_HANDLER( shared2_r )
{
- wiping_state *state = space->machine->driver_data<wiping_state>();
+ wiping_state *state = space->machine().driver_data<wiping_state>();
return state->sharedram2[offset];
}
static WRITE8_HANDLER( shared1_w )
{
- wiping_state *state = space->machine->driver_data<wiping_state>();
+ wiping_state *state = space->machine().driver_data<wiping_state>();
state->sharedram1[offset] = data;
}
static WRITE8_HANDLER( shared2_w )
{
- wiping_state *state = space->machine->driver_data<wiping_state>();
+ wiping_state *state = space->machine().driver_data<wiping_state>();
state->sharedram2[offset] = data;
}
@@ -72,7 +72,7 @@ static READ8_HANDLER( ports_r )
res = 0;
for (i = 0; i < 8; i++)
- res |= ((input_port_read(space->machine, portnames[i]) >> offset) & 1) << i;
+ res |= ((input_port_read(space->machine(), portnames[i]) >> offset) & 1) << i;
return res;
}
@@ -80,9 +80,9 @@ static READ8_HANDLER( ports_r )
static WRITE8_HANDLER( subcpu_reset_w )
{
if (data & 1)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index cbbdc70da23..19d9b98f68e 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -222,7 +222,7 @@ public:
static TILE_GET_INFO( get_gfx0b_tile_info )
{
- witch_state *state = machine->driver_data<witch_state>();
+ witch_state *state = machine.driver_data<witch_state>();
int code = state->gfx0_vram[tile_index];
int color = state->gfx0_cram[tile_index];
@@ -242,7 +242,7 @@ static TILE_GET_INFO( get_gfx0b_tile_info )
static TILE_GET_INFO( get_gfx0a_tile_info )
{
- witch_state *state = machine->driver_data<witch_state>();
+ witch_state *state = machine.driver_data<witch_state>();
int code = state->gfx0_vram[tile_index];
int color = state->gfx0_cram[tile_index];
@@ -262,7 +262,7 @@ static TILE_GET_INFO( get_gfx0a_tile_info )
static TILE_GET_INFO( get_gfx1_tile_info )
{
- witch_state *state = machine->driver_data<witch_state>();
+ witch_state *state = machine.driver_data<witch_state>();
int code = state->gfx1_vram[tile_index];
int color = state->gfx1_cram[tile_index];
@@ -275,7 +275,7 @@ static TILE_GET_INFO( get_gfx1_tile_info )
static WRITE8_HANDLER( gfx0_vram_w )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
state->gfx0_vram[offset] = data;
tilemap_mark_tile_dirty(state->gfx0a_tilemap,offset);
tilemap_mark_tile_dirty(state->gfx0b_tilemap,offset);
@@ -283,20 +283,20 @@ static WRITE8_HANDLER( gfx0_vram_w )
static WRITE8_HANDLER( gfx0_cram_w )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
state->gfx0_cram[offset] = data;
tilemap_mark_tile_dirty(state->gfx0a_tilemap,offset);
tilemap_mark_tile_dirty(state->gfx0b_tilemap,offset);
}
static READ8_HANDLER( gfx0_vram_r )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
return state->gfx0_vram[offset];
}
static READ8_HANDLER( gfx0_cram_r )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
return state->gfx0_cram[offset];
}
@@ -305,7 +305,7 @@ static READ8_HANDLER( gfx0_cram_r )
static WRITE8_HANDLER( gfx1_vram_w )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
FIX_OFFSET();
state->gfx1_vram[offset] = data;
tilemap_mark_tile_dirty(state->gfx1_tilemap,offset);
@@ -313,35 +313,35 @@ static WRITE8_HANDLER( gfx1_vram_w )
static WRITE8_HANDLER( gfx1_cram_w )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
FIX_OFFSET();
state->gfx1_cram[offset] = data;
tilemap_mark_tile_dirty(state->gfx1_tilemap,offset);
}
static READ8_HANDLER( gfx1_vram_r )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
FIX_OFFSET();
return state->gfx1_vram[offset];
}
static READ8_HANDLER( gfx1_cram_r )
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
FIX_OFFSET();
return state->gfx1_cram[offset];
}
static READ8_HANDLER(read_a00x)
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
switch(offset)
{
case 0x02: return state->reg_a002;
- case 0x04: return input_port_read(space->machine, "A004");
- case 0x05: return input_port_read(space->machine, "A005");
- case 0x0c: return input_port_read(space->machine, "SERVICE"); // stats / reset
- case 0x0e: return input_port_read(space->machine, "A00E"); // coin/reset
+ case 0x04: return input_port_read(space->machine(), "A004");
+ case 0x05: return input_port_read(space->machine(), "A005");
+ case 0x0c: return input_port_read(space->machine(), "SERVICE"); // stats / reset
+ case 0x0e: return input_port_read(space->machine(), "A00E"); // coin/reset
}
if(offset == 0x00) //muxed with A002?
@@ -349,11 +349,11 @@ static READ8_HANDLER(read_a00x)
switch(state->reg_a002 & 0x3f)
{
case 0x3b:
- return input_port_read(space->machine, "UNK"); //bet10 / pay out
+ return input_port_read(space->machine(), "UNK"); //bet10 / pay out
case 0x3e:
- return input_port_read(space->machine, "INPUTS"); //TODO : trace f564
+ return input_port_read(space->machine(), "INPUTS"); //TODO : trace f564
case 0x3d:
- return input_port_read(space->machine, "A005");
+ return input_port_read(space->machine(), "A005");
default:
logerror("A000 read with mux=0x%02x\n", state->reg_a002 & 0x3f);
}
@@ -363,7 +363,7 @@ static READ8_HANDLER(read_a00x)
static WRITE8_HANDLER(write_a00x)
{
- witch_state *state = space->machine->driver_data<witch_state>();
+ witch_state *state = space->machine().driver_data<witch_state>();
switch(offset)
{
case 0x02: //A002 bit 7&6 = state->bank ????
@@ -374,10 +374,10 @@ static WRITE8_HANDLER(write_a00x)
if(newbank != state->bank)
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
state->bank = newbank;
ROM = &ROM[0x10000+0x8000 * newbank + UNBANKED_SIZE];
- memory_set_bankptr(space->machine, "bank1",ROM);
+ memory_set_bankptr(space->machine(), "bank1",ROM);
}
}
break;
@@ -413,7 +413,7 @@ static READ8_HANDLER(prot_read_700x)
case 0x25e:
return offset;//enough to pass...
}
- return space->machine->region("sub")->base()[0x7000+offset];
+ return space->machine().region("sub")->base()[0x7000+offset];
}
/*
@@ -424,12 +424,12 @@ static READ8_DEVICE_HANDLER(read_8010) { return 0x00; }
static WRITE8_DEVICE_HANDLER(xscroll_w)
{
- witch_state *state = device->machine->driver_data<witch_state>();
+ witch_state *state = device->machine().driver_data<witch_state>();
state->scrollx=data;
}
static WRITE8_DEVICE_HANDLER(yscroll_w)
{
- witch_state *state = device->machine->driver_data<witch_state>();
+ witch_state *state = device->machine().driver_data<witch_state>();
state->scrolly=data;
}
@@ -696,7 +696,7 @@ GFXDECODE_END
static VIDEO_START(witch)
{
- witch_state *state = machine->driver_data<witch_state>();
+ witch_state *state = machine.driver_data<witch_state>();
state->gfx0a_tilemap = tilemap_create(machine, get_gfx0a_tile_info,tilemap_scan_rows,8,8,32,32);
state->gfx0b_tilemap = tilemap_create(machine, get_gfx0b_tile_info,tilemap_scan_rows,8,8,32,32);
state->gfx1_tilemap = tilemap_create(machine, get_gfx1_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -708,9 +708,9 @@ static VIDEO_START(witch)
tilemap_set_palette_offset(state->gfx1_tilemap,0x200);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- witch_state *state = machine->driver_data<witch_state>();
+ witch_state *state = machine.driver_data<witch_state>();
int i,sx,sy,tileno,flags,color;
int flipx=0;
int flipy=0;
@@ -731,22 +731,22 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color = flags & 0x0f;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tileno, color,
flipx, flipy,
sx+8*flipx,sy+8*flipy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tileno+1, color,
flipx, flipy,
sx+8-8*flipx,sy+8*flipy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tileno+2, color,
flipx, flipy,
sx+8*flipx,sy+8-8*flipy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tileno+3, color,
flipx, flipy,
sx+8-8*flipx,sy+8-8*flipy,0);
@@ -758,7 +758,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static SCREEN_UPDATE(witch)
{
- witch_state *state = screen->machine->driver_data<witch_state>();
+ witch_state *state = screen->machine().driver_data<witch_state>();
tilemap_set_scrollx( state->gfx1_tilemap, 0, state->scrollx-7 ); //offset to have it aligned with the sprites
tilemap_set_scrolly( state->gfx1_tilemap, 0, state->scrolly+8 );
@@ -766,7 +766,7 @@ static SCREEN_UPDATE(witch)
tilemap_draw(bitmap,cliprect,state->gfx1_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->gfx0a_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap,cliprect,state->gfx0b_tilemap,0,0);
return 0;
}
@@ -864,11 +864,11 @@ ROM_END
static DRIVER_INIT(witch)
{
- witch_state *state = machine->driver_data<witch_state>();
- UINT8 *ROM = (UINT8 *)machine->region("maincpu")->base();
+ witch_state *state = machine.driver_data<witch_state>();
+ UINT8 *ROM = (UINT8 *)machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0x10000+UNBANKED_SIZE]);
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x700f, FUNC(prot_read_700x));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x700f, FUNC(prot_read_700x));
state->bank = -1;
}
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index 2e94c346ff7..2ad464e5218 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -172,8 +172,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
static WRITE8_HANDLER( sound_command_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
- device_t *discrete = space->machine->device("discrete");
+ wiz_state *state = space->machine().driver_data<wiz_state>();
+ device_t *discrete = space->machine().device("discrete");
switch (offset)
{
@@ -198,7 +198,7 @@ static WRITE8_HANDLER( sound_command_w )
static READ8_HANDLER( wiz_protection_r )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
switch (state->colorram2[0])
{
case 0x35: return 0x25; /* FIX: sudden player death + free play afterwards */
@@ -211,7 +211,7 @@ static READ8_HANDLER( wiz_protection_r )
static WRITE8_HANDLER( wiz_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -677,7 +677,7 @@ DISCRETE_SOUND_END
static MACHINE_RESET( wiz )
{
- wiz_state *state = machine->driver_data<wiz_state>();
+ wiz_state *state = machine.driver_data<wiz_state>();
state->dsc0 = state->dsc1 = 1;
}
@@ -1034,9 +1034,9 @@ static DRIVER_INIT( stinger )
{ 5,3,7, 0x80 },
{ 5,7,3, 0x28 }
};
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
int A;
const UINT8 *tbl;
@@ -1071,13 +1071,13 @@ static DRIVER_INIT( stinger )
static DRIVER_INIT( scion )
{
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->nop_write(0x4000, 0x4001);
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->nop_write(0x4000, 0x4001);
}
static DRIVER_INIT( wiz )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd400, 0xd400, FUNC(wiz_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd400, 0xd400, FUNC(wiz_protection_r));
}
diff --git a/src/mame/drivers/wldarrow.c b/src/mame/drivers/wldarrow.c
index 0fb458c1876..cafeae8b5ea 100644
--- a/src/mame/drivers/wldarrow.c
+++ b/src/mame/drivers/wldarrow.c
@@ -60,7 +60,7 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( wldarrow )
{
- wldarrow_state *state = screen->machine->driver_data<wldarrow_state>();
+ wldarrow_state *state = screen->machine().driver_data<wldarrow_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -124,7 +124,7 @@ static WRITE8_HANDLER( lights_2_w )
static WRITE8_HANDLER( counter_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
@@ -483,7 +483,7 @@ ROM_END
static DRIVER_INIT( wldarrow )
{
offs_t i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < 0x3800; i++)
rom[i] ^= 0xff;
diff --git a/src/mame/drivers/wolfpack.c b/src/mame/drivers/wolfpack.c
index fbe7daf2f52..5750a79455c 100644
--- a/src/mame/drivers/wolfpack.c
+++ b/src/mame/drivers/wolfpack.c
@@ -20,27 +20,27 @@ static TIMER_CALLBACK( periodic_callback )
if (scanline >= 262)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
}
static MACHINE_RESET( wolfpack )
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(periodic_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(periodic_callback));
}
static CUSTOM_INPUT( wolfpack_dial_r )
{
int bit = (FPTR)param;
- return ((input_port_read(field->port->machine, "DIAL") + bit) / 2) & 0x01;
+ return ((input_port_read(field->port->machine(), "DIAL") + bit) / 2) & 0x01;
}
static READ8_HANDLER( wolfpack_misc_r )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
- device_t *device = space->machine->device("speech");
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
+ device_t *device = space->machine().device("speech");
UINT8 val = 0;
/* BIT0 => SPEECH BUSY */
@@ -58,7 +58,7 @@ static READ8_HANDLER( wolfpack_misc_r )
if (!state->collision)
val |= 0x10;
- if (space->machine->primary_screen->vpos() >= 240)
+ if (space->machine().primary_screen->vpos() >= 240)
val |= 0x80;
return val;
@@ -92,19 +92,19 @@ static WRITE8_DEVICE_HANDLER( wolfpack_start_speech_w )
static WRITE8_HANDLER( wolfpack_attract_w )
{
- coin_lockout_global_w(space->machine, !(data & 1));
+ coin_lockout_global_w(space->machine(), !(data & 1));
}
static WRITE8_HANDLER( wolfpack_credit_w )
{
- set_led_status(space->machine, 0, !(data & 1));
+ set_led_status(space->machine(), 0, !(data & 1));
}
static WRITE8_HANDLER( wolfpack_coldetres_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->collision = 0;
}
diff --git a/src/mame/drivers/wrally.c b/src/mame/drivers/wrally.c
index 749c78bf486..f8fb8ba8501 100644
--- a/src/mame/drivers/wrally.c
+++ b/src/mame/drivers/wrally.c
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( dallas_share_r )
{
- wrally_state *state = space->machine->driver_data<wrally_state>();
+ wrally_state *state = space->machine().driver_data<wrally_state>();
UINT8 *shareram = (UINT8 *)state->shareram;
return shareram[BYTE_XOR_LE(offset) ^ 1];
@@ -132,7 +132,7 @@ static READ8_HANDLER( dallas_share_r )
static WRITE8_HANDLER( dallas_share_w )
{
- wrally_state *state = space->machine->driver_data<wrally_state>();
+ wrally_state *state = space->machine().driver_data<wrally_state>();
UINT8 *shareram = (UINT8 *)state->shareram;
shareram[BYTE_XOR_LE(offset) ^ 1] = data;
diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c
index 710fbcdc079..9010ed0a8ba 100644
--- a/src/mame/drivers/wwfsstar.c
+++ b/src/mame/drivers/wwfsstar.c
@@ -194,7 +194,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER ( wwfsstar_scrollwrite )
{
- wwfsstar_state *state = space->machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = space->machine().driver_data<wwfsstar_state>();
switch (offset)
{
@@ -210,21 +210,21 @@ static WRITE16_HANDLER ( wwfsstar_scrollwrite )
static WRITE16_HANDLER ( wwfsstar_soundwrite )
{
soundlatch_w(space, 1, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
static WRITE16_HANDLER( wwfsstar_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static WRITE16_HANDLER( wwfsstar_irqack_w )
{
if (offset == 0)
- cputag_set_input_line(space->machine, "maincpu", 6, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 6, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "maincpu", 5, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 5, CLEAR_LINE);
}
/*
@@ -242,7 +242,7 @@ static WRITE16_HANDLER( wwfsstar_irqack_w )
static TIMER_DEVICE_CALLBACK( wwfsstar_scanline )
{
- wwfsstar_state *state = timer.machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = timer.machine().driver_data<wwfsstar_state>();
int scanline = param;
/* Vblank is lowered on scanline 0 */
@@ -260,21 +260,21 @@ static TIMER_DEVICE_CALLBACK( wwfsstar_scanline )
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 5, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 5, ASSERT_LINE);
}
/* Vblank is raised on scanline 240 */
if (scanline == 240)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 6, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 6, ASSERT_LINE);
}
}
static CUSTOM_INPUT( wwfsstar_vblank_r )
{
- wwfsstar_state *state = field->port->machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = field->port->machine().driver_data<wwfsstar_state>();
return state->vblank;
}
@@ -415,7 +415,7 @@ GFXDECODE_END
static void wwfsstar_ymirq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE );
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index 87dfba7c946..8b0d52334db 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -103,15 +103,15 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( wwfwfest_irq_ack_w )
{
if (offset == 0)
- cputag_set_input_line(space->machine, "maincpu", 3, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
}
static WRITE16_HANDLER( wwfwfest_flipscreen_w )
{
- flip_screen_set(space->machine, data&1);
+ flip_screen_set(space->machine(), data&1);
}
/*- Palette Reads/Writes -*/
@@ -119,7 +119,7 @@ static WRITE16_HANDLER( wwfwfest_flipscreen_w )
static READ16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_r )
{
offset = (offset & 0x000f) | (offset & 0x7fc0) >> 2;
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w )
@@ -133,7 +133,7 @@ static WRITE16_HANDLER( wwfwfest_paletteram16_xxxxBBBBGGGGRRRR_word_w )
static WRITE16_HANDLER( wwfwfest_1410_write )
{
- wwfwfest_state *state = space->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
state->pri = data;
}
@@ -141,7 +141,7 @@ static WRITE16_HANDLER( wwfwfest_1410_write )
static WRITE16_HANDLER( wwfwfest_scroll_write )
{
- wwfwfest_state *state = space->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
switch (offset) {
case 0x00:
state->bg0_scrollx = data;
@@ -168,7 +168,7 @@ static WRITE8_DEVICE_HANDLER( oki_bankswitch_w )
static WRITE16_HANDLER ( wwfwfest_soundwrite )
{
soundlatch_w(space,1,data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
/*******************************************************************************
@@ -181,13 +181,13 @@ static WRITE16_HANDLER ( wwfwfest_soundwrite )
static CUSTOM_INPUT( dsw_3f_r )
{
const char *tag = (const char *)param;
- return input_port_read(field->port->machine, tag) & 0x3f;
+ return input_port_read(field->port->machine(), tag) & 0x3f;
}
static CUSTOM_INPUT( dsw_c0_r )
{
const char *tag = (const char *)param;
- return (input_port_read(field->port->machine, tag) & 0xc0) >> 6;
+ return (input_port_read(field->port->machine(), tag) & 0xc0) >> 6;
}
@@ -353,15 +353,15 @@ static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 2, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, ASSERT_LINE);
}
/* Vblank is raised on scanline 248 */
if (scanline == 248)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
- cputag_set_input_line(timer.machine, "maincpu", 3, ASSERT_LINE);
+ timer.machine().primary_screen->update_partial(scanline - 1);
+ cputag_set_input_line(timer.machine(), "maincpu", 3, ASSERT_LINE);
}
}
@@ -373,7 +373,7 @@ static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
static void dd3_ymirq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE );
}
static const ym2151_interface ym2151_config =
@@ -383,7 +383,7 @@ static const ym2151_interface ym2151_config =
static SCREEN_EOF( wwfwfest )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
}
diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c
index 2b760e00452..e0bd3f762de 100644
--- a/src/mame/drivers/xain.c
+++ b/src/mame/drivers/xain.c
@@ -175,28 +175,28 @@ INLINE int scanline_to_vcount(int scanline)
static TIMER_DEVICE_CALLBACK( xain_scanline )
{
- xain_state *state = timer.machine->driver_data<xain_state>();
+ xain_state *state = timer.machine().driver_data<xain_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
}
/* FIRQ (IMS) fires every on every 8th scanline (except 0) */
if (!(vcount_old & 8) && (vcount & 8))
{
- cputag_set_input_line(timer.machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
}
/* NMI fires on scanline 248 (VBL) and is latched */
if (vcount == 0xf8)
{
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
}
/* VBLANK input bit is held high from scanlines 248-255 */
@@ -212,20 +212,20 @@ static TIMER_DEVICE_CALLBACK( xain_scanline )
static WRITE8_HANDLER( xainCPUA_bankswitch_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->pri = data & 0x7;
- memory_set_bank(space->machine, "bank1", (data >> 3) & 1);
+ memory_set_bank(space->machine(), "bank1", (data >> 3) & 1);
}
static WRITE8_HANDLER( xainCPUB_bankswitch_w )
{
- memory_set_bank(space->machine, "bank2", data & 1);
+ memory_set_bank(space->machine(), "bank2", data & 1);
}
static WRITE8_HANDLER( xain_sound_command_w )
{
soundlatch_w(space,offset,data);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( xain_main_irq_w )
@@ -233,50 +233,50 @@ static WRITE8_HANDLER( xain_main_irq_w )
switch (offset)
{
case 0: /* 0x3a09 - NMI clear */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
break;
case 1: /* 0x3a0a - FIRQ clear */
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
break;
case 2: /* 0x3a0b - IRQ clear */
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE, CLEAR_LINE);
break;
case 3: /* 0x3a0c - IRQB assert */
- cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", M6809_IRQ_LINE, ASSERT_LINE);
break;
}
}
static WRITE8_HANDLER( xain_irqA_assert_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
}
static WRITE8_HANDLER( xain_irqB_clear_w )
{
- cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", M6809_IRQ_LINE, CLEAR_LINE);
}
static READ8_HANDLER( xain_68705_r )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->_mcu_ready = 1;
return state->from_mcu;
}
static WRITE8_HANDLER( xain_68705_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->from_main = data;
state->_mcu_accept = 0;
- if (space->machine->device("mcu") != NULL)
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ if (space->machine().device("mcu") != NULL)
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
}
static CUSTOM_INPUT( xain_vblank_r )
{
- xain_state *state = field->port->machine->driver_data<xain_state>();
+ xain_state *state = field->port->machine().driver_data<xain_state>();
return state->vblank;
}
@@ -289,31 +289,31 @@ static CUSTOM_INPUT( xain_vblank_r )
READ8_HANDLER( xain_68705_port_a_r )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( xain_68705_port_a_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->port_a_out = data;
}
WRITE8_HANDLER( xain_68705_ddr_a_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->ddr_a = data;
}
READ8_HANDLER( xain_68705_port_b_r )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( xain_68705_port_b_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
if ((state->ddr_b & 0x02) && (~data & 0x02))
{
state->port_a_in = state->from_main;
@@ -322,7 +322,7 @@ WRITE8_HANDLER( xain_68705_port_b_w )
else if ((state->ddr_b & 0x02) && (~state->port_b_out & 0x02) && (data & 0x02))
{
state->_mcu_accept = 1;
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
}
/* Rising edge of PB2 */
@@ -337,13 +337,13 @@ WRITE8_HANDLER( xain_68705_port_b_w )
WRITE8_HANDLER( xain_68705_ddr_b_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->ddr_b = data;
}
READ8_HANDLER( xain_68705_port_c_r )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->port_c_in = 0;
if (!state->_mcu_accept)
@@ -356,22 +356,22 @@ READ8_HANDLER( xain_68705_port_c_r )
WRITE8_HANDLER( xain_68705_port_c_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->port_c_out = data;
}
WRITE8_HANDLER( xain_68705_ddr_c_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->ddr_c = data;
}
static CUSTOM_INPUT( mcu_status_r )
{
- xain_state *state = field->port->machine->driver_data<xain_state>();
+ xain_state *state = field->port->machine().driver_data<xain_state>();
UINT8 res = 0;
- if (field->port->machine->device("mcu") != NULL)
+ if (field->port->machine().device("mcu") != NULL)
{
if (state->_mcu_ready == 1)
res |= 0x01;
@@ -388,12 +388,12 @@ static CUSTOM_INPUT( mcu_status_r )
READ8_HANDLER( mcu_comm_reset_r )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->_mcu_ready = 1;
state->_mcu_accept = 1;
- if (space->machine->device("mcu") != NULL)
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ if (space->machine().device("mcu") != NULL)
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
return 0xff;
}
@@ -568,7 +568,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -583,8 +583,8 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( xsleena )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x4000, 0xc000);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("sub")->base() + 0x4000, 0xc000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x4000, 0xc000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("sub")->base() + 0x4000, 0xc000);
memory_set_bank(machine, "bank1", 0);
memory_set_bank(machine, "bank2", 0);
}
diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c
index 7d7cfa87ad2..d1e3e0f0b27 100644
--- a/src/mame/drivers/xexex.c
+++ b/src/mame/drivers/xexex.c
@@ -91,7 +91,7 @@ static const eeprom_interface eeprom_intf =
/* A1, A5 and A6 don't go to the 053247. */
static READ16_HANDLER( K053247_scattered_word_r )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
if (offset & 0x0031)
return state->spriteram[offset];
@@ -104,7 +104,7 @@ static READ16_HANDLER( K053247_scattered_word_r )
static WRITE16_HANDLER( K053247_scattered_word_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
if (offset & 0x0031)
COMBINE_DATA(state->spriteram + offset);
@@ -118,14 +118,14 @@ static WRITE16_HANDLER( K053247_scattered_word_w )
#endif
-static void xexex_objdma( running_machine *machine, int limiter )
+static void xexex_objdma( running_machine &machine, int limiter )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
int counter, num_inactive;
UINT16 *src, *dst;
counter = state->frame;
- state->frame = machine->primary_screen->frame_number();
+ state->frame = machine.primary_screen->frame_number();
if (limiter && counter == state->frame)
return; // make sure we only do DMA transfer once per frame
@@ -154,19 +154,19 @@ static void xexex_objdma( running_machine *machine, int limiter )
static READ16_HANDLER( spriteram_mirror_r )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
return state->spriteram[offset];
}
static WRITE16_HANDLER( spriteram_mirror_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
COMBINE_DATA(state->spriteram + offset);
}
static READ16_HANDLER( xexex_waitskip_r )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
if (cpu_get_pc(space->cpu) == 0x1158)
{
@@ -178,9 +178,9 @@ static READ16_HANDLER( xexex_waitskip_r )
}
-static void parse_control2( running_machine *machine )
+static void parse_control2( running_machine &machine )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
/* bit 0 is data */
/* bit 1 is cs (active low) */
@@ -199,21 +199,21 @@ static void parse_control2( running_machine *machine )
static READ16_HANDLER( control2_r )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
return state->cur_control2;
}
static WRITE16_HANDLER( control2_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
COMBINE_DATA(&state->cur_control2);
- parse_control2(space->machine);
+ parse_control2(space->machine());
}
static WRITE16_HANDLER( sound_cmd1_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
if(ACCESSING_BITS_0_7)
{
@@ -234,7 +234,7 @@ static WRITE16_HANDLER( sound_cmd2_w )
static WRITE16_HANDLER( sound_irq_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -243,22 +243,22 @@ static READ16_HANDLER( sound_status_r )
return soundlatch3_r(space, 0);
}
-static void reset_sound_region(running_machine *machine)
+static void reset_sound_region(running_machine &machine)
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
memory_set_bank(machine, "bank2", state->cur_sound_region & 0x07);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- xexex_state *state = space->machine->driver_data<xexex_state>();
+ xexex_state *state = space->machine().driver_data<xexex_state>();
state->cur_sound_region = data & 7;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
}
static void ym_set_mixing(device_t *device, double left, double right)
{
- xexex_state *state = device->machine->driver_data<xexex_state>();
+ xexex_state *state = device->machine().driver_data<xexex_state>();
flt_volume_set_volume(state->filter1l, (71.0 * left) / 55.0);
flt_volume_set_volume(state->filter1r, (71.0 * right) / 55.0);
flt_volume_set_volume(state->filter2l, (71.0 * left) / 55.0);
@@ -267,7 +267,7 @@ static void ym_set_mixing(device_t *device, double left, double right)
static TIMER_CALLBACK( dmaend_callback )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
if (state->cur_control2 & 0x0040)
{
@@ -275,7 +275,7 @@ static TIMER_CALLBACK( dmaend_callback )
if (state->suspension_active)
{
state->suspension_active = 0;
- machine->scheduler().trigger(state->resume_trigger);
+ machine.scheduler().trigger(state->resume_trigger);
}
// IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered
@@ -286,12 +286,12 @@ static TIMER_CALLBACK( dmaend_callback )
static INTERRUPT_GEN( xexex_interrupt )
{
- xexex_state *state = device->machine->driver_data<xexex_state>();
+ xexex_state *state = device->machine().driver_data<xexex_state>();
if (state->suspension_active)
{
state->suspension_active = 0;
- device->machine->scheduler().trigger(state->resume_trigger);
+ device->machine().scheduler().trigger(state->resume_trigger);
}
switch (cpu_getiloops(device))
@@ -306,7 +306,7 @@ static INTERRUPT_GEN( xexex_interrupt )
if (k053246_is_irq_enabled(state->k053246))
{
// OBJDMA starts at the beginning of V-blank
- xexex_objdma(device->machine, 0);
+ xexex_objdma(device->machine(), 0);
// schedule DMA end interrupt
state->dmadelay_timer->adjust(XE_DMADELAY);
@@ -463,25 +463,25 @@ static STATE_POSTLOAD( xexex_postload )
static MACHINE_START( xexex )
{
- xexex_state *state = machine->driver_data<xexex_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ xexex_state *state = machine.driver_data<xexex_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x10000], 0x4000);
memory_set_bank(machine, "bank2", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053246 = machine->device("k053246");
- state->k053250 = machine->device("k053250");
- state->k053251 = machine->device("k053251");
- state->k053252 = machine->device("k053252");
- state->k056832 = machine->device("k056832");
- state->k054338 = machine->device("k054338");
- state->k054539 = machine->device("k054539");
- state->filter1l = machine->device("filter1l");
- state->filter1r = machine->device("filter1r");
- state->filter2l = machine->device("filter2l");
- state->filter2r = machine->device("filter2r");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053246 = machine.device("k053246");
+ state->k053250 = machine.device("k053250");
+ state->k053251 = machine.device("k053251");
+ state->k053252 = machine.device("k053252");
+ state->k056832 = machine.device("k056832");
+ state->k054338 = machine.device("k054338");
+ state->k054539 = machine.device("k054539");
+ state->filter1l = machine.device("filter1l");
+ state->filter1r = machine.device("filter1r");
+ state->filter2l = machine.device("filter2l");
+ state->filter2r = machine.device("filter2r");
state->save_item(NAME(state->cur_alpha));
state->save_item(NAME(state->sprite_colorbase));
@@ -493,14 +493,14 @@ static MACHINE_START( xexex )
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->cur_sound_region));
- machine->state().register_postload(xexex_postload, NULL);
+ machine.state().register_postload(xexex_postload, NULL);
- state->dmadelay_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ state->dmadelay_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
}
static MACHINE_RESET( xexex )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
int i;
for (i = 0; i < 4; i++)
@@ -516,7 +516,7 @@ static MACHINE_RESET( xexex )
state->suspension_active = 0;
state->resume_trigger = 1000;
state->frame = -1;
- k054539_init_flags(machine->device("k054539"), K054539_REVERSE_STEREO);
+ k054539_init_flags(machine.device("k054539"), K054539_REVERSE_STEREO);
}
static MACHINE_CONFIG_START( xexex, xexex_state )
@@ -687,15 +687,15 @@ ROM_END
static DRIVER_INIT( xexex )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
state->strip_0x1a = 0;
- if (!strcmp(machine->system().name, "xexex"))
+ if (!strcmp(machine.system().name, "xexex"))
{
// Invulnerability
-// *(UINT16 *)(machine->region("maincpu")->base() + 0x648d4) = 0x4a79;
-// *(UINT16 *)(machine->region("maincpu")->base() + 0x00008) = 0x5500;
+// *(UINT16 *)(machine.region("maincpu")->base() + 0x648d4) = 0x4a79;
+// *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x5500;
state->strip_0x1a = 1;
}
}
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 550b467a684..f44834ba245 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -44,18 +44,18 @@ static const eeprom_interface eeprom_intf =
static WRITE16_HANDLER( eeprom_w )
{
- xmen_state *state = space->machine->driver_data<xmen_state>();
+ xmen_state *state = space->machine().driver_data<xmen_state>();
logerror("%06x: write %04x to 108000\n",cpu_get_pc(space->cpu),data);
if (ACCESSING_BITS_0_7)
{
/* bit 0 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
/* bit 2 is data */
/* bit 3 is clock (active high) */
/* bit 4 is cs (active low) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
if (ACCESSING_BITS_8_15)
{
@@ -82,7 +82,7 @@ static WRITE16_HANDLER( sound_cmd_w )
static WRITE16_HANDLER( sound_irq_w )
{
- xmen_state *state = space->machine->driver_data<xmen_state>();
+ xmen_state *state = space->machine().driver_data<xmen_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -95,17 +95,17 @@ static WRITE16_HANDLER( xmen_18fa00_w )
}
}
-static void sound_reset_bank( running_machine *machine )
+static void sound_reset_bank( running_machine &machine )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
memory_set_bank(machine, "bank4", state->sound_curbank & 0x07);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- xmen_state *state = space->machine->driver_data<xmen_state>();
+ xmen_state *state = space->machine().driver_data<xmen_state>();
state->sound_curbank = data;
- sound_reset_bank(space->machine);
+ sound_reset_bank(space->machine());
}
@@ -258,7 +258,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( xmen_frame_r )
{
- xmen_state *state = field->port->machine->driver_data<xmen_state>();
+ xmen_state *state = field->port->machine().driver_data<xmen_state>();
return state->current_frame;
}
@@ -311,31 +311,31 @@ static STATE_POSTLOAD( xmen_postload )
static MACHINE_START( xmen )
{
- xmen_state *state = machine->driver_data<xmen_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ xmen_state *state = machine.driver_data<xmen_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x10000], 0x4000);
memory_set_bank(machine, "bank4", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
- state->k052109 = machine->device("k052109");
- state->k054539 = machine->device("k054539");
- state->lscreen = machine->device("lscreen");
- state->rscreen = machine->device("rscreen");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
+ state->k052109 = machine.device("k052109");
+ state->k054539 = machine.device("k054539");
+ state->lscreen = machine.device("lscreen");
+ state->rscreen = machine.device("rscreen");
state->save_item(NAME(state->sound_curbank));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
state->save_item(NAME(state->layerpri));
- machine->state().register_postload(xmen_postload, NULL);
+ machine.state().register_postload(xmen_postload, NULL);
}
static MACHINE_RESET( xmen )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
int i;
for (i = 0; i < 3; i++)
@@ -412,7 +412,7 @@ MACHINE_CONFIG_END
static MACHINE_START( xmen6p )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
MACHINE_START_CALL(xmen);
@@ -421,7 +421,7 @@ static MACHINE_START( xmen6p )
static MACHINE_RESET( xmen6p )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
state->current_frame = 0x00;
}
diff --git a/src/mame/drivers/xorworld.c b/src/mame/drivers/xorworld.c
index 8e0994466ff..40d8d01b2f7 100644
--- a/src/mame/drivers/xorworld.c
+++ b/src/mame/drivers/xorworld.c
@@ -229,7 +229,7 @@ static DRIVER_INIT( xorworld )
/* patch some strange protection (without this, strange characters appear
after level 5 and some pieces don't rotate properly some times) */
- UINT16 *rom = (UINT16 *)(machine->region("maincpu")->base() + 0x1390);
+ UINT16 *rom = (UINT16 *)(machine.region("maincpu")->base() + 0x1390);
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe196); /* clr.b $ffe196 */
PATCH(0x4239); PATCH(0x00ff); PATCH(0xe197); /* clr.b $ffe197 */
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 00a10a21c14..da04ac574dd 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -36,10 +36,10 @@ public:
static void xtheball_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- xtheball_state *state = screen.machine->driver_data<xtheball_state>();
+ xtheball_state *state = screen.machine().driver_data<xtheball_state>();
UINT16 *srcbg = &state->vram_bg[(params->rowaddr << 8) & 0xff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr;
int x;
@@ -86,25 +86,25 @@ static void xtheball_scanline_update(screen_device &screen, bitmap_t *bitmap, in
static void xtheball_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- xtheball_state *state = space->machine->driver_data<xtheball_state>();
+ xtheball_state *state = space->machine().driver_data<xtheball_state>();
if (address >= 0x01000000 && address <= 0x010fffff)
memcpy(shiftreg, &state->vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(shiftreg, &state->vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
else
- logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine->describe_context(), address);
+ logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine().describe_context(), address);
}
static void xtheball_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- xtheball_state *state = space->machine->driver_data<xtheball_state>();
+ xtheball_state *state = space->machine().driver_data<xtheball_state>();
if (address >= 0x01000000 && address <= 0x010fffff)
memcpy(&state->vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(&state->vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
else
- logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine->describe_context(), address);
+ logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine().describe_context(), address);
}
@@ -117,7 +117,7 @@ static void xtheball_from_shiftreg(address_space *space, UINT32 address, UINT16
static WRITE16_HANDLER( bit_controls_w )
{
- xtheball_state *state = space->machine->driver_data<xtheball_state>();
+ xtheball_state *state = space->machine().driver_data<xtheball_state>();
UINT8 *bitvals = state->bitvals;
if (ACCESSING_BITS_0_7)
{
@@ -128,11 +128,11 @@ static WRITE16_HANDLER( bit_controls_w )
switch (offset)
{
case 7:
- ticket_dispenser_w(space->machine->device("ticket"), 0, data << 7);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, data << 7);
break;
case 8:
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
break;
}
}
@@ -187,7 +187,7 @@ static WRITE16_HANDLER( bit_controls_w )
static READ16_HANDLER( analogx_r )
{
- return (input_port_read(space->machine, "ANALOGX") << 8) | 0x00ff;
+ return (input_port_read(space->machine(), "ANALOGX") << 8) | 0x00ff;
}
@@ -195,7 +195,7 @@ static READ16_HANDLER( analogy_watchdog_r )
{
/* doubles as a watchdog address */
watchdog_reset_w(space,0,0);
- return (input_port_read(space->machine, "ANALOGY") << 8) | 0x00ff;
+ return (input_port_read(space->machine(), "ANALOGY") << 8) | 0x00ff;
}
diff --git a/src/mame/drivers/xxmissio.c b/src/mame/drivers/xxmissio.c
index 84f78dcc7c9..8e0871a80cb 100644
--- a/src/mame/drivers/xxmissio.c
+++ b/src/mame/drivers/xxmissio.c
@@ -17,19 +17,19 @@ XX Mission (c) 1986 UPL
static WRITE8_HANDLER( xxmissio_bank_sel_w )
{
- memory_set_bank(space->machine, "bank1", data & 7);
+ memory_set_bank(space->machine(), "bank1", data & 7);
}
static CUSTOM_INPUT( xxmissio_status_r )
{
- xxmissio_state *state = field->port->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = field->port->machine().driver_data<xxmissio_state>();
int bit_mask = (FPTR)param;
return (state->status & bit_mask) ? 1 : 0;
}
static WRITE8_HANDLER ( xxmissio_status_m_w )
{
- xxmissio_state *state = space->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = space->machine().driver_data<xxmissio_state>();
switch (data)
{
case 0x00:
@@ -38,7 +38,7 @@ static WRITE8_HANDLER ( xxmissio_status_m_w )
case 0x40:
state->status &= ~0x08;
- cputag_set_input_line_and_vector(space->machine, "sub", 0, HOLD_LINE, 0x10);
+ cputag_set_input_line_and_vector(space->machine(), "sub", 0, HOLD_LINE, 0x10);
break;
case 0x80:
@@ -49,7 +49,7 @@ static WRITE8_HANDLER ( xxmissio_status_m_w )
static WRITE8_HANDLER ( xxmissio_status_s_w )
{
- xxmissio_state *state = space->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = space->machine().driver_data<xxmissio_state>();
switch (data)
{
case 0x00:
@@ -62,28 +62,28 @@ static WRITE8_HANDLER ( xxmissio_status_s_w )
case 0x80:
state->status &= ~0x04;
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, HOLD_LINE, 0x10);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, HOLD_LINE, 0x10);
break;
}
}
static INTERRUPT_GEN( xxmissio_interrupt_m )
{
- xxmissio_state *state = device->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
state->status &= ~0x20;
device_set_input_line(device, 0, HOLD_LINE);
}
static INTERRUPT_GEN( xxmissio_interrupt_s )
{
- xxmissio_state *state = device->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
state->status &= ~0x10;
device_set_input_line(device, 0, HOLD_LINE);
}
static MACHINE_START( xxmissio )
{
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("user1")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
}
diff --git a/src/mame/drivers/xybots.c b/src/mame/drivers/xybots.c
index 166dcd30dd9..5018e679e45 100644
--- a/src/mame/drivers/xybots.c
+++ b/src/mame/drivers/xybots.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -47,7 +47,7 @@ static MACHINE_START( xybots )
static MACHINE_RESET( xybots )
{
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
@@ -65,8 +65,8 @@ static MACHINE_RESET( xybots )
static READ16_HANDLER( special_port1_r )
{
- xybots_state *state = space->machine->driver_data<xybots_state>();
- int result = input_port_read(space->machine, "FFE200");
+ xybots_state *state = space->machine().driver_data<xybots_state>();
+ int result = input_port_read(space->machine(), "FFE200");
if (state->cpu_to_sound_ready) result ^= 0x0200;
result ^= state->h256 ^= 0x0400;
@@ -392,9 +392,9 @@ ROM_END
static DRIVER_INIT( xybots )
{
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
state->h256 = 0x0400;
- atarigen_slapstic_init(machine->device("maincpu"), 0x008000, 0, 107);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x008000, 0, 107);
atarijsa_init(machine, "FFE200", 0x0100);
}
diff --git a/src/mame/drivers/xyonix.c b/src/mame/drivers/xyonix.c
index ae54340c2a3..40c8fee4bc9 100644
--- a/src/mame/drivers/xyonix.c
+++ b/src/mame/drivers/xyonix.c
@@ -27,16 +27,16 @@ TODO:
static WRITE8_HANDLER( xyonix_irqack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
/* Inputs ********************************************************************/
-static void handle_coins(running_machine *machine, int coin)
+static void handle_coins(running_machine &machine, int coin)
{
static const int coinage_table[4][2] = {{2,3},{2,1},{1,2},{1,1}};
- xyonix_state *state = machine->driver_data<xyonix_state>();
+ xyonix_state *state = machine.driver_data<xyonix_state>();
int tmp = 0;
//popmessage("Coin %d", state->coin);
@@ -74,7 +74,7 @@ static void handle_coins(running_machine *machine, int coin)
static READ8_HANDLER ( xyonix_io_r )
{
- xyonix_state *state = space->machine->driver_data<xyonix_state>();
+ xyonix_state *state = space->machine().driver_data<xyonix_state>();
int regPC = cpu_get_pc(space->cpu);
if (regPC == 0x27ba)
@@ -90,20 +90,20 @@ static READ8_HANDLER ( xyonix_io_r )
switch (state->e0_data)
{
case 0x81 :
- return input_port_read(space->machine, "P1") & 0x7f;
+ return input_port_read(space->machine(), "P1") & 0x7f;
case 0x82 :
- return input_port_read(space->machine, "P2") & 0x7f;
+ return input_port_read(space->machine(), "P2") & 0x7f;
case 0x91:
/* check coin inputs */
- coin = ((input_port_read(space->machine, "P1") & 0x80) >> 7) | ((input_port_read(space->machine, "P2") & 0x80) >> 6);
+ coin = ((input_port_read(space->machine(), "P1") & 0x80) >> 7) | ((input_port_read(space->machine(), "P2") & 0x80) >> 6);
if (coin ^ state->prev_coin && coin != 3)
{
- if (state->credits < 9) handle_coins(space->machine, coin);
+ if (state->credits < 9) handle_coins(space->machine(), coin);
}
state->prev_coin = coin;
return state->credits;
case 0x92:
- return ((input_port_read(space->machine, "P1") & 0x80) >> 7) | ((input_port_read(space->machine, "P2") & 0x80) >> 6);
+ return ((input_port_read(space->machine(), "P1") & 0x80) >> 7) | ((input_port_read(space->machine(), "P2") & 0x80) >> 6);
case 0xe0: /* reset? */
state->coins = 0;
state->credits = 0;
@@ -112,9 +112,9 @@ static READ8_HANDLER ( xyonix_io_r )
state->credits--;
return 0xff;
case 0xfe: /* Dip Switches 1 to 4 */
- return input_port_read(space->machine, "DSW") & 0x0f;
+ return input_port_read(space->machine(), "DSW") & 0x0f;
case 0xff: /* Dip Switches 5 to 8 */
- return input_port_read(space->machine, "DSW") >> 4;
+ return input_port_read(space->machine(), "DSW") >> 4;
}
}
@@ -126,7 +126,7 @@ static READ8_HANDLER ( xyonix_io_r )
static WRITE8_HANDLER ( xyonix_io_w )
{
- xyonix_state *state = space->machine->driver_data<xyonix_state>();
+ xyonix_state *state = space->machine().driver_data<xyonix_state>();
//logerror ("xyonix_port_e0_w %02x - PC = %04x\n", data, cpu_get_pc(space->cpu));
state->e0_data = data;
diff --git a/src/mame/drivers/yiear.c b/src/mame/drivers/yiear.c
index 00f70494351..a609079fbeb 100644
--- a/src/mame/drivers/yiear.c
+++ b/src/mame/drivers/yiear.c
@@ -111,7 +111,7 @@ static WRITE8_DEVICE_HANDLER( yiear_VLM5030_control_w )
static INTERRUPT_GEN( yiear_nmi_interrupt )
{
- yiear_state *state = device->machine->driver_data<yiear_state>();
+ yiear_state *state = device->machine().driver_data<yiear_state>();
/* can't use nmi_line_pulse() because interrupt_enable_w() effects it */
if (state->yiear_nmi_enable)
@@ -244,14 +244,14 @@ GFXDECODE_END
static MACHINE_START( yiear )
{
- yiear_state *state = machine->driver_data<yiear_state>();
+ yiear_state *state = machine.driver_data<yiear_state>();
state->save_item(NAME(state->yiear_nmi_enable));
}
static MACHINE_RESET( yiear )
{
- yiear_state *state = machine->driver_data<yiear_state>();
+ yiear_state *state = machine.driver_data<yiear_state>();
state->yiear_nmi_enable = 0;
}
diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c
index 132053d5d0b..038329cf9f7 100644
--- a/src/mame/drivers/yunsun16.c
+++ b/src/mame/drivers/yunsun16.c
@@ -106,7 +106,7 @@ static WRITE16_HANDLER( yunsun16_sound_bank_w )
if (ACCESSING_BITS_0_7)
{
int bank = data & 3;
- UINT8 *dst = space->machine->region("oki")->base();
+ UINT8 *dst = space->machine().region("oki")->base();
UINT8 *src = dst + 0x80000 + 0x20000 * bank;
memcpy(dst + 0x20000, src, 0x20000);
}
@@ -139,7 +139,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( magicbub_sound_command_w )
{
- yunsun16_state *state = space->machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = space->machine().driver_data<yunsun16_state>();
if (ACCESSING_BITS_0_7)
{
/*
@@ -157,7 +157,7 @@ number 0 on each voice. That sample is 00000-00000.
static DRIVER_INIT( magicbub )
{
// remove_mem_write16_handler (0, 0x800180, 0x800181 );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800188, 0x800189, FUNC(magicbub_sound_command_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800188, 0x800189, FUNC(magicbub_sound_command_w));
}
/***************************************************************************
@@ -557,9 +557,9 @@ GFXDECODE_END
static MACHINE_START( yunsun16 )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sprites_scrolldx));
state->save_item(NAME(state->sprites_scrolldy));
@@ -567,7 +567,7 @@ static MACHINE_START( yunsun16 )
static MACHINE_RESET( yunsun16 )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
state->sprites_scrolldx = -0x40;
state->sprites_scrolldy = -0x0f;
@@ -579,7 +579,7 @@ static MACHINE_RESET( yunsun16 )
static void soundirq(device_t *device, int state)
{
- yunsun16_state *yunsun16 = device->machine->driver_data<yunsun16_state>();
+ yunsun16_state *yunsun16 = device->machine().driver_data<yunsun16_state>();
device_set_input_line(yunsun16->audiocpu, 0, state);
}
diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c
index f35ae6f2f25..035a4749ff5 100644
--- a/src/mame/drivers/yunsung8.c
+++ b/src/mame/drivers/yunsung8.c
@@ -46,11 +46,11 @@ To Do:
static WRITE8_HANDLER( yunsung8_bankswitch_w )
{
- yunsung8_state *state = space->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = space->machine().driver_data<yunsung8_state>();
state->layers_ctrl = data & 0x30; // Layers enable
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
if (data & ~0x37)
logerror("CPU #0 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
@@ -99,15 +99,15 @@ static WRITE8_DEVICE_HANDLER( yunsung8_sound_bankswitch_w )
{
msm5205_reset_w(device, data & 0x20);
- memory_set_bank(device->machine, "bank2", data & 0x07);
+ memory_set_bank(device->machine(), "bank2", data & 0x07);
if (data != (data & (~0x27)))
- logerror("%s: Bank %02X\n", device->machine->describe_context(), data);
+ logerror("%s: Bank %02X\n", device->machine().describe_context(), data);
}
static WRITE8_HANDLER( yunsung8_adpcm_w )
{
- yunsung8_state *state = space->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = space->machine().driver_data<yunsung8_state>();
/* Swap the nibbles */
state->adpcm = ((data & 0xf) << 4) | ((data >> 4) & 0xf);
@@ -448,7 +448,7 @@ GFXDECODE_END
static void yunsung8_adpcm_int( device_t *device )
{
- yunsung8_state *state = device->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = device->machine().driver_data<yunsung8_state>();
msm5205_data_w(device, state->adpcm >> 4);
state->adpcm <<= 4;
@@ -467,9 +467,9 @@ static const msm5205_interface yunsung8_msm5205_interface =
static MACHINE_START( yunsung8 )
{
- yunsung8_state *state = machine->driver_data<yunsung8_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *AUDIO = machine->region("audiocpu")->base();
+ yunsung8_state *state = machine.driver_data<yunsung8_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *AUDIO = machine.region("audiocpu")->base();
state->videoram_0 = state->videoram + 0x0000; // Ram is banked
state->videoram_1 = state->videoram + 0x2000;
@@ -479,7 +479,7 @@ static MACHINE_START( yunsung8 )
memory_configure_bank(machine, "bank2", 0, 3, &AUDIO[0x00000], 0x4000);
memory_configure_bank(machine, "bank2", 3, 5, &AUDIO[0x10000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->videoram));
state->save_item(NAME(state->layers_ctrl));
@@ -490,7 +490,7 @@ static MACHINE_START( yunsung8 )
static MACHINE_RESET( yunsung8 )
{
- yunsung8_state *state = machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = machine.driver_data<yunsung8_state>();
state->videobank = 0;
state->layers_ctrl = 0;
diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c
index 7d33b6dbab9..2b9b0d40d62 100644
--- a/src/mame/drivers/zaccaria.c
+++ b/src/mame/drivers/zaccaria.c
@@ -50,7 +50,7 @@ Notes:
static WRITE8_DEVICE_HANDLER( zaccaria_dsw_sel_w )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
switch (data & 0xf0)
{
case 0xe0:
@@ -66,17 +66,17 @@ static WRITE8_DEVICE_HANDLER( zaccaria_dsw_sel_w )
break;
default:
- logerror("%s: portsel = %02x\n", device->machine->describe_context(), data);
+ logerror("%s: portsel = %02x\n", device->machine().describe_context(), data);
break;
}
}
static READ8_HANDLER( zaccaria_dsw_r )
{
- zaccaria_state *state = space->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = space->machine().driver_data<zaccaria_state>();
static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
- return input_port_read(space->machine, dswnames[state->dsw]);
+ return input_port_read(space->machine(), dswnames[state->dsw]);
}
@@ -98,41 +98,41 @@ static WRITE8_DEVICE_HANDLER( ay8910_port0a_w )
/* 150 below to scale to volume 100 */
v = (150 * table[ba]) / (4700 + table[ba]);
//printf("dac1w %02d %04d\n", ba, v);
- ay8910_set_volume(device->machine->device("ay2"), 1, v);
+ ay8910_set_volume(device->machine().device("ay2"), 1, v);
}
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0a )
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0b )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, state ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_DEVICE_HANDLER( zaccaria_port0a_r )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
- return ay8910_r(device->machine->device((state->active_8910 == 0) ? "ay1" : "ay2"), 0);
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
+ return ay8910_r(device->machine().device((state->active_8910 == 0) ? "ay1" : "ay2"), 0);
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0a_w )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
state->port0a = data;
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
/* bit 1 goes to 8910 #0 BDIR pin */
if ((state->last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
{
/* bit 0 goes to the 8910 #0 BC1 pin */
- ay8910_data_address_w(device->machine->device("ay1"), state->last_port0b, state->port0a);
+ ay8910_data_address_w(device->machine().device("ay1"), state->last_port0b, state->port0a);
}
else if ((state->last_port0b & 0x02) == 0x00 && (data & 0x02) == 0x02)
{
@@ -144,7 +144,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
if ((state->last_port0b & 0x08) == 0x08 && (data & 0x08) == 0x00)
{
/* bit 2 goes to the 8910 #1 BC1 pin */
- ay8910_data_address_w(device->machine->device("ay2"), state->last_port0b >> 2, state->port0a);
+ ay8910_data_address_w(device->machine().device("ay2"), state->last_port0b >> 2, state->port0a);
}
else if ((state->last_port0b & 0x08) == 0x00 && (data & 0x08) == 0x08)
{
@@ -158,8 +158,8 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
static INTERRUPT_GEN( zaccaria_cb1_toggle )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
- device_t *pia0 = device->machine->device("pia0");
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
+ device_t *pia0 = device->machine().device("pia0");
pia6821_cb1_w(pia0, state->toggle & 1);
state->toggle ^= 1;
@@ -167,8 +167,8 @@ static INTERRUPT_GEN( zaccaria_cb1_toggle )
static WRITE8_DEVICE_HANDLER( zaccaria_port1b_w )
{
- zaccaria_state *state = device->machine->driver_data<zaccaria_state>();
- device_t *tms = device->machine->device("tms");
+ zaccaria_state *state = device->machine().driver_data<zaccaria_state>();
+ device_t *tms = device->machine().device("tms");
// bit 0 = /RS
tms5220_rsq_w(tms, (data >> 0) & 0x01);
@@ -179,19 +179,19 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port1b_w )
state->acs = ~data & 0x08;
// bit 4 = led (for testing?)
- set_led_status(device->machine, 0,~data & 0x10);
+ set_led_status(device->machine(), 0,~data & 0x10);
}
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audio2", 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audio2", 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( sound1_command_w )
{
- device_t *pia0 = space->machine->device("pia0");
+ device_t *pia0 = space->machine().device("pia0");
pia6821_ca1_w(pia0, data & 0x80);
soundlatch2_w(space, 0, data);
}
@@ -215,7 +215,7 @@ static READ8_HANDLER( zaccaria_prot1_r )
return 0x40; /* Jack Rabbit */
case 6:
- if (&space->machine->system() == &GAME_NAME(monymony))
+ if (&space->machine().system() == &GAME_NAME(monymony))
return 0x70; /* Money Money */
return 0xa0; /* Jack Rabbit */
@@ -229,7 +229,7 @@ static READ8_HANDLER( zaccaria_prot2_r )
switch (offset)
{
case 0:
- return input_port_read(space->machine, "COINS"); /* bits 4 and 5 must be 0 in Jack Rabbit */
+ return input_port_read(space->machine(), "COINS"); /* bits 4 and 5 must be 0 in Jack Rabbit */
case 2:
return 0x10; /* Jack Rabbit */
@@ -248,7 +248,7 @@ static READ8_HANDLER( zaccaria_prot2_r )
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
}
static WRITE8_HANDLER( nmienable_w )
@@ -342,7 +342,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( acs_r )
{
- zaccaria_state *state = field->port->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = field->port->machine().driver_data<zaccaria_state>();
return (state->acs & 0x08) ? 1 : 0;
}
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index e53ce9589f9..b0b7aab3fc5 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -293,13 +293,13 @@ static INPUT_CHANGED( service_switch )
{
/* pressing the service switch sends an NMI */
if (newval)
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
static INTERRUPT_GEN( vblank_int )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
if (state->int_enabled)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -308,11 +308,11 @@ static INTERRUPT_GEN( vblank_int )
static WRITE8_HANDLER( int_enable_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
state->int_enabled = data & 1;
if (!state->int_enabled)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -325,7 +325,7 @@ static WRITE8_HANDLER( int_enable_w )
static MACHINE_START( zaxxon )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
/* register for save states */
state->save_item(NAME(state->int_enabled));
@@ -350,7 +350,7 @@ static MACHINE_RESET( razmataz )
static READ8_HANDLER( razmataz_counter_r )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* this behavior is really unknown; however, the code is using this */
/* counter as a sort of timeout when talking to the sound board */
@@ -362,12 +362,12 @@ static READ8_HANDLER( razmataz_counter_r )
static CUSTOM_INPUT( razmataz_dial_r )
{
- zaxxon_state *state = field->port->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = field->port->machine().driver_data<zaxxon_state>();
static const char *const dialname[2] = { "DIAL0", "DIAL1" };
int num = (FPTR)param;
int delta, res;
- delta = input_port_read(field->port->machine, dialname[num]);
+ delta = input_port_read(field->port->machine(), dialname[num]);
if (delta < 0x80)
{
@@ -395,7 +395,7 @@ static CUSTOM_INPUT( razmataz_dial_r )
static WRITE8_HANDLER( zaxxon_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
@@ -403,7 +403,7 @@ static WRITE8_HANDLER( zaxxon_coin_counter_w )
// the coin input, which then needs to be explicitly cleared by the game.
static WRITE8_HANDLER( zaxxon_coin_enable_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
state->coin_enable[offset] = data & 1;
if (!state->coin_enable[offset])
@@ -415,7 +415,7 @@ static INPUT_CHANGED( zaxxon_coin_inserted )
{
if (newval)
{
- zaxxon_state *state = field->port->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = field->port->machine().driver_data<zaxxon_state>();
state->coin_status[(int)(FPTR)param] = state->coin_enable[(int)(FPTR)param];
}
@@ -424,7 +424,7 @@ static INPUT_CHANGED( zaxxon_coin_inserted )
static CUSTOM_INPUT( zaxxon_coin_r )
{
- zaxxon_state *state = field->port->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = field->port->machine().driver_data<zaxxon_state>();
return state->coin_status[(int)(FPTR)param];
}
@@ -1402,7 +1402,7 @@ ROM_END
*
*************************************/
-static void zaxxonj_decode(running_machine *machine, const char *cputag)
+static void zaxxonj_decode(running_machine &machine, const char *cputag)
{
/*
the values vary, but the translation mask is always laid out like this:
@@ -1447,9 +1447,9 @@ static void zaxxonj_decode(running_machine *machine, const char *cputag)
};
int A;
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region(cputag)->base();
- int size = machine->region(cputag)->bytes();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region(cputag)->base();
+ int size = machine.region(cputag)->bytes();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
space->set_decrypted_region(0x0000, size - 1, decrypt);
@@ -1507,20 +1507,20 @@ static DRIVER_INIT( futspy )
static DRIVER_INIT( razmataz )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
nprinces_decode(machine, "maincpu");
/* additional input ports are wired */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc004, 0xc004, 0, 0x18f3, "SW04");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc008, 0xc008, 0, 0x18f3, "SW08");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc00c, 0xc00c, 0, 0x18f3, "SW0C");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc004, 0xc004, 0, 0x18f3, "SW04");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc008, 0xc008, 0, 0x18f3, "SW08");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xc00c, 0xc00c, 0, 0x18f3, "SW0C");
/* unknown behavior expected here */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc80a, 0xc80a, FUNC(razmataz_counter_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc80a, 0xc80a, FUNC(razmataz_counter_r));
/* connect the universal sound board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe03c, 0xe03c, 0, 0x1f00, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe03c, 0xe03c, 0, 0x1f00, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
/* additional state saving */
state->save_item(NAME(state->razmataz_dial_pos));
@@ -1533,7 +1533,7 @@ static DRIVER_INIT( ixion )
szaxxon_decode(machine, "maincpu");
/* connect the universal sound board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe03c, 0xe03c, 0, 0x1f00, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe03c, 0xe03c, 0, 0x1f00, FUNC(sega_usb_status_r), FUNC(sega_usb_data_w));
}
diff --git a/src/mame/drivers/zerozone.c b/src/mame/drivers/zerozone.c
index 95eee0ad1d8..a836b9c8cba 100644
--- a/src/mame/drivers/zerozone.c
+++ b/src/mame/drivers/zerozone.c
@@ -38,13 +38,13 @@ static READ16_HANDLER( zerozone_input_r )
switch (offset)
{
case 0x00:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x01:
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 0x04:
- return input_port_read(space->machine, "DSWB");
+ return input_port_read(space->machine(), "DSWB");
case 0x05:
- return input_port_read(space->machine, "DSWA");
+ return input_port_read(space->machine(), "DSWA");
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", cpu_get_pc(space->cpu), 0x800000 + offset);
@@ -54,7 +54,7 @@ static READ16_HANDLER( zerozone_input_r )
static WRITE16_HANDLER( zerozone_sound_w )
{
- zerozone_state *state = space->machine->driver_data<zerozone_state>();
+ zerozone_state *state = space->machine().driver_data<zerozone_state>();
if (ACCESSING_BITS_8_15)
{
@@ -171,16 +171,16 @@ GFXDECODE_END
static MACHINE_START( zerozone )
{
- zerozone_state *state = machine->driver_data<zerozone_state>();
+ zerozone_state *state = machine.driver_data<zerozone_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->tilebank));
}
static MACHINE_RESET( zerozone )
{
- zerozone_state *state = machine->driver_data<zerozone_state>();
+ zerozone_state *state = machine.driver_data<zerozone_state>();
state->tilebank = 0;
}
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index a93fe643d11..41f3b338346 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -57,7 +57,7 @@ public:
int latch_to_z80;
};
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -66,7 +66,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
}
}
@@ -236,15 +236,15 @@ static const struct
static READ32_HANDLER( znsecsel_r )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
- verboselog( space->machine, 2, "znsecsel_r( %08x, %08x )\n", offset, mem_mask );
+ verboselog( space->machine(), 2, "znsecsel_r( %08x, %08x )\n", offset, mem_mask );
return state->m_n_znsecsel;
}
-static void sio_znsec0_handler( running_machine *machine, int n_data )
+static void sio_znsec0_handler( running_machine &machine, int n_data )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -260,9 +260,9 @@ static void sio_znsec0_handler( running_machine *machine, int n_data )
}
}
-static void sio_znsec1_handler( running_machine *machine, int n_data )
+static void sio_znsec1_handler( running_machine &machine, int n_data )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -278,9 +278,9 @@ static void sio_znsec1_handler( running_machine *machine, int n_data )
}
}
-static void sio_pad_handler( running_machine *machine, int n_data )
+static void sio_pad_handler( running_machine &machine, int n_data )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
if( ( n_data & PSX_SIO_OUT_DTR ) != 0 )
{
@@ -295,9 +295,9 @@ static void sio_pad_handler( running_machine *machine, int n_data )
psx_sio_input( machine, 0, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR, PSX_SIO_IN_DATA | PSX_SIO_IN_DSR );
}
-static void sio_dip_handler( running_machine *machine, int n_data )
+static void sio_dip_handler( running_machine &machine, int n_data )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
if( ( n_data & PSX_SIO_OUT_CLOCK ) == 0 )
{
@@ -319,49 +319,49 @@ static void sio_dip_handler( running_machine *machine, int n_data )
static WRITE32_HANDLER( znsecsel_w )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
COMBINE_DATA( &state->m_n_znsecsel );
if( ( state->m_n_znsecsel & 0x80 ) == 0 )
{
- psx_sio_install_handler( space->machine, 0, sio_pad_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_pad_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else if( ( state->m_n_znsecsel & 0x08 ) == 0 )
{
znsec_start( 1 );
- psx_sio_install_handler( space->machine, 0, sio_znsec1_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_znsec1_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else if( ( state->m_n_znsecsel & 0x04 ) == 0 )
{
znsec_start( 0 );
- psx_sio_install_handler( space->machine, 0, sio_znsec0_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_znsec0_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
}
else
{
state->m_n_dip_bit = 0;
state->m_b_lastclock = 1;
- psx_sio_install_handler( space->machine, 0, sio_dip_handler );
- psx_sio_input( space->machine, 0, PSX_SIO_IN_DSR, 0 );
+ psx_sio_install_handler( space->machine(), 0, sio_dip_handler );
+ psx_sio_input( space->machine(), 0, PSX_SIO_IN_DSR, 0 );
state->dip_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( 100 ), 1 );
}
- verboselog( space->machine, 2, "znsecsel_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 2, "znsecsel_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
}
static TIMER_CALLBACK( dip_timer_fired )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
psx_sio_input( machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
if( param )
{
- state->dip_timer->adjust( machine->device<cpu_device>( "maincpu" )->cycles_to_attotime(50 ) );
+ state->dip_timer->adjust( machine.device<cpu_device>( "maincpu" )->cycles_to_attotime(50 ) );
}
}
@@ -386,7 +386,7 @@ static READ32_HANDLER( boardconfig_r )
111----- rev=5
*/
- if( space->machine->primary_screen->height() == 1024 )
+ if( space->machine().primary_screen->height() == 1024 )
{
return 64|32|8;
}
@@ -398,7 +398,7 @@ static READ32_HANDLER( boardconfig_r )
static READ32_HANDLER( unknown_r )
{
- verboselog( space->machine, 0, "unknown_r( %08x, %08x )\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "unknown_r( %08x, %08x )\n", offset, mem_mask );
return 0xffffffff;
}
@@ -412,7 +412,7 @@ static WRITE32_HANDLER( coin_w )
*/
if( ( data & ~0x23 ) != 0 )
{
- verboselog( space->machine, 0, "coin_w %08x\n", data );
+ verboselog( space->machine(), 0, "coin_w %08x\n", data );
}
}
@@ -462,9 +462,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( link_map, AS_PROGRAM, 8 )
ADDRESS_MAP_END
-static void zn_driver_init( running_machine *machine )
+static void zn_driver_init( running_machine &machine )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
int n_game;
psx_driver_init(machine);
@@ -472,7 +472,7 @@ static void zn_driver_init( running_machine *machine )
n_game = 0;
while( zn_config_table[ n_game ].s_name != NULL )
{
- if( strcmp( machine->system().name, zn_config_table[ n_game ].s_name ) == 0 )
+ if( strcmp( machine.system().name, zn_config_table[ n_game ].s_name ) == 0 )
{
znsec_init( 0, zn_config_table[ n_game ].p_n_mainsec );
znsec_init( 1, zn_config_table[ n_game ].p_n_gamesec );
@@ -482,20 +482,20 @@ static void zn_driver_init( running_machine *machine )
n_game++;
}
- state->dip_timer = machine->scheduler().timer_alloc( FUNC(dip_timer_fired), NULL );
+ state->dip_timer = machine.scheduler().timer_alloc( FUNC(dip_timer_fired), NULL );
}
static void psx_spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
-static void zn_machine_init( running_machine *machine )
+static void zn_machine_init( running_machine &machine )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
state->m_n_dip_bit = 0;
state->m_b_lastclock = 1;
@@ -684,18 +684,18 @@ Notes:
static READ32_HANDLER( capcom_kickharness_r )
{
/* required for buttons 4,5&6 */
- verboselog( space->machine, 2, "capcom_kickharness_r( %08x, %08x )\n", offset, mem_mask );
+ verboselog( space->machine(), 2, "capcom_kickharness_r( %08x, %08x )\n", offset, mem_mask );
return 0xffffffff;
}
static WRITE32_HANDLER( bank_coh1000c_w )
{
- memory_set_bankptr( space->machine, "bank2", space->machine->region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ memory_set_bankptr( space->machine(), "bank2", space->machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
static WRITE8_HANDLER( qsound_bankswitch_w )
{
- memory_set_bankptr( space->machine, "bank10", space->machine->region( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
+ memory_set_bankptr( space->machine(), "bank10", space->machine().region( "audiocpu" )->base() + 0x10000 + ( ( data & 0x0f ) * 0x4000 ) );
}
static INTERRUPT_GEN( qsound_interrupt )
@@ -706,36 +706,36 @@ static INTERRUPT_GEN( qsound_interrupt )
static WRITE32_HANDLER( zn_qsound_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static DRIVER_INIT( coh1000c )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh1000c_w) ); /* bankswitch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(zn_qsound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh1000c_w) ); /* bankswitch */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(zn_qsound_w) );
zn_driver_init(machine);
- if( strcmp( machine->system().name, "glpracr" ) == 0 ||
- strcmp( machine->system().name, "glpracr2l" ) == 0 )
+ if( strcmp( machine.system().name, "glpracr" ) == 0 ||
+ strcmp( machine.system().name, "glpracr2l" ) == 0 )
{
/* disable:
the QSound CPU for glpracr as it doesn't have any roms &
the link cpu for glprac2l as the h/w is not emulated yet. */
- machine->device<cpu_device>( "audiocpu" )->suspend(SUSPEND_REASON_DISABLE, 1 );
+ machine.device<cpu_device>( "audiocpu" )->suspend(SUSPEND_REASON_DISABLE, 1 );
}
}
static MACHINE_RESET( coh1000c )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
- memory_set_bankptr( machine, "bank2", machine->region( "user2" )->base() + 0x400000 ); /* banked game rom */
- memory_set_bankptr( machine, "bank3", machine->region( "user3" )->base() ); /* country rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank2", machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
+ memory_set_bankptr( machine, "bank3", machine.region( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -923,27 +923,27 @@ Notes:
static WRITE32_HANDLER( bank_coh3002c_w )
{
- memory_set_bankptr( space->machine, "bank2", space->machine->region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
+ memory_set_bankptr( space->machine(), "bank2", space->machine().region( "user2" )->base() + 0x400000 + ( data * 0x400000 ) );
}
static DRIVER_INIT( coh3002c )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh3002c_w) ); /* bankswitch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(zn_qsound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" ); /* fixed game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" ); /* banked game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40010, 0x1fb40013, FUNC(capcom_kickharness_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb40020, 0x1fb40023, FUNC(capcom_kickharness_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(bank_coh3002c_w) ); /* bankswitch */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb80000, 0x1fbfffff, "bank3" ); /* country rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb60000, 0x1fb60003, FUNC(zn_qsound_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh3002c )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
- memory_set_bankptr( machine, "bank2", machine->region( "user2" )->base() + 0x400000 ); /* banked game rom */
- memory_set_bankptr( machine, "bank3", machine->region( "user3" )->base() ); /* country rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank2", machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
+ memory_set_bankptr( machine, "bank3", machine.region( "user3" )->base() ); /* country rom */
zn_machine_init(machine);
}
@@ -1181,26 +1181,26 @@ Notes:
static WRITE32_HANDLER( bank_coh1000t_w )
{
- device_t *mb3773 = space->machine->device("mb3773");
+ device_t *mb3773 = space->machine().device("mb3773");
mb3773_set_ck(mb3773, (data & 0x20) >> 5);
- verboselog( space->machine, 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- memory_set_bankptr( space->machine, "bank1", space->machine->region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ verboselog( space->machine(), 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
static WRITE8_HANDLER( fx1a_sound_bankswitch_w )
{
- memory_set_bankptr( space->machine, "bank10", space->machine->region( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
+ memory_set_bankptr( space->machine(), "bank10", space->machine().region( "audiocpu" )->base() + 0x10000 + ( ( ( data - 1 ) & 0x07 ) * 0x4000 ) );
}
static READ32_HANDLER( taitofx1a_ymsound_r )
{
- device_t *tc0140syt = space->machine->device("tc0140syt");
+ device_t *tc0140syt = space->machine().device("tc0140syt");
return tc0140syt_comm_r(tc0140syt, 0) << 16;
}
static WRITE32_HANDLER( taitofx1a_ymsound_w )
{
- device_t *tc0140syt = space->machine->device("tc0140syt");
+ device_t *tc0140syt = space->machine().device("tc0140syt");
if (mem_mask == 0x0000ffff)
{
@@ -1214,22 +1214,22 @@ static WRITE32_HANDLER( taitofx1a_ymsound_w )
static DRIVER_INIT( coh1000ta )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
state->taitofx1_eeprom_size1 = 0x200; state->taitofx1_eeprom1 = auto_alloc_array( machine, UINT8, state->taitofx1_eeprom_size1 );
- machine->device<nvram_device>("eeprom1")->set_base(state->taitofx1_eeprom1, state->taitofx1_eeprom_size1);
+ machine.device<nvram_device>("eeprom1")->set_base(state->taitofx1_eeprom1, state->taitofx1_eeprom_size1);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb80000, 0x1fb80003, FUNC(taitofx1a_ymsound_r), FUNC(taitofx1a_ymsound_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->taitofx1_eeprom_size1 - 1 ), "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb80000, 0x1fb80003, FUNC(taitofx1a_ymsound_r), FUNC(taitofx1a_ymsound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->taitofx1_eeprom_size1 - 1 ), "bank2" );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1000ta )
{
- zn_state *state = machine->driver_data<zn_state>();
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* banked game rom */
+ zn_state *state = machine.driver_data<zn_state>();
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* banked game rom */
memory_set_bankptr( machine, "bank2", state->taitofx1_eeprom1 );
zn_machine_init(machine);
}
@@ -1250,7 +1250,7 @@ ADDRESS_MAP_END
/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -1284,47 +1284,47 @@ MACHINE_CONFIG_END
static WRITE32_HANDLER( taitofx1b_volume_w )
{
- verboselog( space->machine, 1, "taitofx1_volume_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "taitofx1_volume_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
}
static WRITE32_HANDLER( taitofx1b_sound_w )
{
- verboselog( space->machine, 1, "taitofx1_sound_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "taitofx1_sound_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
}
static READ32_HANDLER( taitofx1b_sound_r )
{
UINT32 data = 0; // bit 0 = busy?
- verboselog( space->machine, 1, "taitofx1_sound_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 1, "taitofx1_sound_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
static DRIVER_INIT( coh1000tb )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
state->taitofx1_eeprom_size1 = 0x400; state->taitofx1_eeprom1 = auto_alloc_array( machine, UINT8, state->taitofx1_eeprom_size1 );
state->taitofx1_eeprom_size2 = 0x200; state->taitofx1_eeprom2 = auto_alloc_array( machine, UINT8, state->taitofx1_eeprom_size2 );
- machine->device<nvram_device>("eeprom1")->set_base(state->taitofx1_eeprom1, state->taitofx1_eeprom_size1);
- machine->device<nvram_device>("eeprom2")->set_base(state->taitofx1_eeprom2, state->taitofx1_eeprom_size2);
+ machine.device<nvram_device>("eeprom1")->set_base(state->taitofx1_eeprom1, state->taitofx1_eeprom_size1);
+ machine.device<nvram_device>("eeprom2")->set_base(state->taitofx1_eeprom2, state->taitofx1_eeprom_size2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fb00000, 0x1fb00000 + ( state->taitofx1_eeprom_size1 - 1 ), "bank2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb80000, 0x1fb8ffff, FUNC(taitofx1b_volume_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fba0000, 0x1fbaffff, FUNC(taitofx1b_sound_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbc0000, 0x1fbc0003, FUNC(taitofx1b_sound_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->taitofx1_eeprom_size2 - 1 ), "bank3" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked game rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fb00000, 0x1fb00000 + ( state->taitofx1_eeprom_size1 - 1 ), "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb40000, 0x1fb40003, FUNC(bank_coh1000t_w) ); /* bankswitch */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb80000, 0x1fb8ffff, FUNC(taitofx1b_volume_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fba0000, 0x1fbaffff, FUNC(taitofx1b_sound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbc0000, 0x1fbc0003, FUNC(taitofx1b_sound_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1fbe0000, 0x1fbe0000 + ( state->taitofx1_eeprom_size2 - 1 ), "bank3" );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1000tb )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* banked game rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* banked game rom */
memory_set_bankptr( machine, "bank2", state->taitofx1_eeprom1 );
memory_set_bankptr( machine, "bank3", state->taitofx1_eeprom2 );
zn_machine_init(machine);
@@ -1461,15 +1461,15 @@ static void atpsx_interrupt(device_t *device, int state)
{
if (state)
{
- psx_irq_set(device->machine, 0x400);
+ psx_irq_set(device->machine(), 0x400);
}
}
-static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void atpsx_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
- device_t *ide = machine->device("ide");
+ device_t *ide = machine.device("ide");
logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address);
@@ -1490,27 +1490,27 @@ static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_
}
}
-static void atpsx_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void atpsx_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
logerror("DMA write from %08x for %d bytes\n", n_address, n_size<<2);
}
static DRIVER_INIT( coh1000w )
{
- device_t *ide = machine->device("ide");
+ device_t *ide = machine.device("ide");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f000000, 0x1f000003);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7e4000, 0x1f7e4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite ( 0x1f7e8000, 0x1f7e8003);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7f4000, 0x1f7f4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f000000, 0x1f000003);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7e4000, 0x1f7e4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite ( 0x1f7e8000, 0x1f7e8003);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1f7f4000, 0x1f7f4fff, FUNC(ide_controller32_r), FUNC(ide_controller32_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1000w )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
devtag_reset(machine, "ide");
@@ -1676,29 +1676,29 @@ static WRITE32_HANDLER( coh1002e_bank_w )
{
znsecsel_w( space, offset, data, mem_mask );
- memory_set_bankptr( space->machine, "bank1", space->machine->region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
+ memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ( ( data & 3 ) * 0x800000 ) );
}
static WRITE32_HANDLER( coh1002e_latch_w )
{
if (offset)
- cputag_set_input_line(space->machine, "audiocpu", 2, HOLD_LINE); // irq 2 on the 68k
+ cputag_set_input_line(space->machine(), "audiocpu", 2, HOLD_LINE); // irq 2 on the 68k
else
soundlatch_w(space, 0, data);
}
static DRIVER_INIT( coh1002e )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(coh1002e_bank_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(coh1002e_latch_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(coh1002e_bank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(coh1002e_latch_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1002e )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* banked game rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* banked game rom */
zn_machine_init(machine);
}
@@ -1784,13 +1784,13 @@ static WRITE32_HANDLER( bam2_sec_w )
static WRITE32_HANDLER( bam2_mcu_w )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
if (offset == 0)
{
if (ACCESSING_BITS_0_15)
{
- memory_set_bankptr( space->machine, "bank2", space->machine->region( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
+ memory_set_bankptr( space->machine(), "bank2", space->machine().region( "user2" )->base() + ( ( data & 0xf ) * 0x400000 ) );
}
else if (ACCESSING_BITS_16_31)
{
@@ -1802,7 +1802,7 @@ static WRITE32_HANDLER( bam2_mcu_w )
static READ32_HANDLER( bam2_mcu_r )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
switch (offset)
{
@@ -1833,20 +1833,20 @@ static READ32_HANDLER( bam2_unk_r )
static DRIVER_INIT( bam2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fa20000, 0x1fa20003, FUNC(bam2_unk_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(bam2_sec_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f3fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f400000, 0x1f7fffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fa20000, 0x1fa20003, FUNC(bam2_unk_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fa10300, 0x1fa10303, FUNC(bam2_sec_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00007, FUNC(bam2_mcu_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( bam2 )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
- memory_set_bankptr( machine, "bank2", machine->region( "user2" )->base() + 0x400000 ); /* banked game rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank2", machine.region( "user2" )->base() + 0x400000 ); /* banked game rom */
zn_machine_init(machine);
}
@@ -2030,7 +2030,7 @@ static void jdredd_ide_interrupt(device_t *device, int state)
{
if (state)
{
- psx_irq_set(device->machine, 0x400);
+ psx_irq_set(device->machine(), 0x400);
}
}
@@ -2085,14 +2085,14 @@ static WRITE32_DEVICE_HANDLER( jdredd_ide_w )
static CUSTOM_INPUT( jdredd_gun_mux_read )
{
- zn_state *state = field->port->machine->driver_data<zn_state>();
+ zn_state *state = field->port->machine().driver_data<zn_state>();
return state->jdredd_gun_mux;
}
static INTERRUPT_GEN( jdredd_vblank )
{
- zn_state *state = device->machine->driver_data<zn_state>();
+ zn_state *state = device->machine().driver_data<zn_state>();
int x;
int y;
@@ -2100,19 +2100,19 @@ static INTERRUPT_GEN( jdredd_vblank )
if( state->jdredd_gun_mux == 0 )
{
- x = input_port_read(device->machine, "GUN1X");
- y = input_port_read(device->machine, "GUN1Y");
+ x = input_port_read(device->machine(), "GUN1X");
+ y = input_port_read(device->machine(), "GUN1Y");
}
else
{
- x = input_port_read(device->machine, "GUN2X");
- y = input_port_read(device->machine, "GUN2Y");
+ x = input_port_read(device->machine(), "GUN2X");
+ y = input_port_read(device->machine(), "GUN2Y");
}
if( x > 0x393 && x < 0xcb2 &&
y > 0x02d && y < 0x217 )
{
- psx_lightgun_set( device->machine, x, y );
+ psx_lightgun_set( device->machine(), x, y );
}
psx_vblank( device );
@@ -2120,62 +2120,62 @@ static INTERRUPT_GEN( jdredd_vblank )
static WRITE32_HANDLER( acpsx_00_w )
{
- verboselog( space->machine, 0, "acpsx_00_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 0, "acpsx_00_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
}
static WRITE32_HANDLER( acpsx_10_w )
{
- verboselog( space->machine, 0, "acpsx_10_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 0, "acpsx_10_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
}
static WRITE32_HANDLER( nbajamex_80_w )
{
- verboselog( space->machine, 0, "nbajamex_80_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- psx_irq_set(space->machine, 0x400);
+ verboselog( space->machine(), 0, "nbajamex_80_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ psx_irq_set(space->machine(), 0x400);
}
static READ32_HANDLER( nbajamex_08_r )
{
UINT32 data = 0xffffffff;
- verboselog( space->machine, 0, "nbajamex_08_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 0, "nbajamex_08_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
static READ32_HANDLER( nbajamex_80_r )
{
UINT32 data = 0xffffffff;
- verboselog( space->machine, 0, "nbajamex_80_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ verboselog( space->machine(), 0, "nbajamex_80_r( %08x, %08x, %08x )\n", offset, data, mem_mask );
return data;
}
static DRIVER_INIT( coh1000a )
{
- zn_state *state = machine->driver_data<zn_state>();
+ zn_state *state = machine.driver_data<zn_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff00, 0x1fbfff03, FUNC(acpsx_00_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff10, 0x1fbfff13, FUNC(acpsx_10_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f1fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff00, 0x1fbfff03, FUNC(acpsx_00_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fbfff10, 0x1fbfff13, FUNC(acpsx_10_w) );
- if( strcmp( machine->system().name, "nbajamex" ) == 0 )
+ if( strcmp( machine.system().name, "nbajamex" ) == 0 )
{
state->nbajamex_eeprom_size = 0x8000;
state->nbajamex_eeprom = auto_alloc_array( machine, UINT8, state->nbajamex_eeprom_size );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1f200000, 0x1f200000 + ( state->nbajamex_eeprom_size - 1 ), "bank2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbfff08, 0x1fbfff0b, FUNC(nbajamex_08_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fbfff80, 0x1fbfff83, FUNC(nbajamex_80_r), FUNC(nbajamex_80_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_bank( 0x1f200000, 0x1f200000 + ( state->nbajamex_eeprom_size - 1 ), "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1fbfff08, 0x1fbfff0b, FUNC(nbajamex_08_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fbfff80, 0x1fbfff83, FUNC(nbajamex_80_r), FUNC(nbajamex_80_w) );
memory_set_bankptr( machine, "bank2", state->nbajamex_eeprom ); /* ram/eeprom/?? */
}
- if( ( !strcmp( machine->system().name, "jdredd" ) ) ||
- ( !strcmp( machine->system().name, "jdreddb" ) ) )
+ if( ( !strcmp( machine.system().name, "jdredd" ) ) ||
+ ( !strcmp( machine.system().name, "jdreddb" ) ) )
{
- device_t *ide = machine->device("ide");
+ device_t *ide = machine.device("ide");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( *ide, 0x1fbfff8c, 0x1fbfff8f, FUNC(jdredd_idestat_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1fbfff8c, 0x1fbfff8f);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1fbfff90, 0x1fbfff9f, FUNC(jdredd_ide_r), FUNC(jdredd_ide_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler( *ide, 0x1fbfff8c, 0x1fbfff8f, FUNC(jdredd_idestat_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1fbfff8c, 0x1fbfff8f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( *ide, 0x1fbfff90, 0x1fbfff9f, FUNC(jdredd_ide_r), FUNC(jdredd_ide_w) );
}
zn_driver_init(machine);
@@ -2183,10 +2183,10 @@ static DRIVER_INIT( coh1000a )
static MACHINE_RESET( coh1000a )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
zn_machine_init(machine);
- if( ( !strcmp( machine->system().name, "jdredd" ) ) ||
- ( !strcmp( machine->system().name, "jdreddb" ) ) )
+ if( ( !strcmp( machine.system().name, "jdredd" ) ) ||
+ ( !strcmp( machine.system().name, "jdreddb" ) ) )
{
devtag_reset(machine, "ide");
}
@@ -2325,20 +2325,20 @@ Notes:
static WRITE32_HANDLER( coh1001l_bnk_w )
{
- memory_set_bankptr( space->machine, "bank1", space->machine->region( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
+ memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ( ( ( data >> 16 ) & 3 ) * 0x800000 ) );
}
static DRIVER_INIT( coh1001l )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(coh1001l_bnk_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" ); /* banked rom */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(coh1001l_bnk_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1001l )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* banked rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2367,22 +2367,22 @@ Key: Mother KN01
static WRITE32_HANDLER( coh1002v_bnk_w )
{
- memory_set_bankptr( space->machine, "bank2", space->machine->region( "user3" )->base() + ( data * 0x100000 ) );
+ memory_set_bankptr( space->machine(), "bank2", space->machine().region( "user3" )->base() + ( data * 0x100000 ) );
}
static DRIVER_INIT( coh1002v )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f27ffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb00000, 0x1fbfffff, "bank2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(coh1002v_bnk_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f27ffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1fb00000, 0x1fbfffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1fb00000, 0x1fb00003, FUNC(coh1002v_bnk_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1002v )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() ); /* fixed game rom */
- memory_set_bankptr( machine, "bank2", machine->region( "user3" )->base() ); /* banked rom */
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() ); /* fixed game rom */
+ memory_set_bankptr( machine, "bank2", machine.region( "user3" )->base() ); /* banked rom */
zn_machine_init(machine);
}
@@ -2550,13 +2550,13 @@ Notes:
static WRITE32_HANDLER( coh1002m_bank_w )
{
- verboselog( space->machine, 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
- memory_set_bankptr( space->machine, "bank1", space->machine->region( "user2" )->base() + ((data>>16) * 0x800000) );
+ verboselog( space->machine(), 1, "coh1002m_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
+ memory_set_bankptr( space->machine(), "bank1", space->machine().region( "user2" )->base() + ((data>>16) * 0x800000) );
}
static READ32_HANDLER( cbaj_z80_r )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
int ready = state->cbaj_to_r3k;
state->cbaj_to_r3k &= ~2;
@@ -2566,7 +2566,7 @@ static READ32_HANDLER( cbaj_z80_r )
static WRITE32_HANDLER( cbaj_z80_w )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
state->cbaj_to_z80 |= 2;
state->latch_to_z80 = data;
@@ -2574,22 +2574,22 @@ static WRITE32_HANDLER( cbaj_z80_w )
static DRIVER_INIT( coh1002m )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb00000, 0x1fb00003, FUNC(cbaj_z80_r), FUNC(cbaj_z80_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb00004, 0x1fb00007, FUNC(coh1002m_bank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank ( 0x1f000000, 0x1f7fffff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1fb00000, 0x1fb00003, FUNC(cbaj_z80_r), FUNC(cbaj_z80_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1fb00004, 0x1fb00007, FUNC(coh1002m_bank_w) );
zn_driver_init(machine);
}
static MACHINE_RESET( coh1002m )
{
- memory_set_bankptr( machine, "bank1", machine->region( "user2" )->base() );
+ memory_set_bankptr( machine, "bank1", machine.region( "user2" )->base() );
zn_machine_init(machine);
}
static READ8_HANDLER( cbaj_z80_latch_r )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
state->cbaj_to_z80 &= ~2;
return state->latch_to_z80;
@@ -2597,7 +2597,7 @@ static READ8_HANDLER( cbaj_z80_latch_r )
static WRITE8_HANDLER( cbaj_z80_latch_w )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
state->cbaj_to_r3k |= 2;
soundlatch2_w(space, 0, data);
@@ -2605,7 +2605,7 @@ static WRITE8_HANDLER( cbaj_z80_latch_w )
static READ8_HANDLER( cbaj_z80_ready_r )
{
- zn_state *state = space->machine->driver_data<zn_state>();
+ zn_state *state = space->machine().driver_data<zn_state>();
int ret = state->cbaj_to_z80;
diff --git a/src/mame/drivers/zodiack.c b/src/mame/drivers/zodiack.c
index fbb3c5205ee..73a19388b92 100644
--- a/src/mame/drivers/zodiack.c
+++ b/src/mame/drivers/zodiack.c
@@ -87,7 +87,7 @@ TODO:
static TIMER_CALLBACK( interrupt_disable )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
//interrupt_enable = 0;
cpu_interrupt_enable(state->maincpu, 0);
}
@@ -99,14 +99,14 @@ static WRITE8_HANDLER( zodiac_master_interrupt_enable_w )
static WRITE8_HANDLER( zodiac_sound_nmi_enable_w )
{
- zodiack_state *state = space->machine->driver_data<zodiack_state>();
+ zodiack_state *state = space->machine().driver_data<zodiack_state>();
state->sound_nmi_enabled = data & 1;
}
static INTERRUPT_GEN( zodiac_sound_nmi_gen )
{
- zodiack_state *state = device->machine->driver_data<zodiack_state>();
+ zodiack_state *state = device->machine().driver_data<zodiack_state>();
if (state->sound_nmi_enabled)
nmi_line_pulse(device);
@@ -122,34 +122,34 @@ static INTERRUPT_GEN( zodiac_master_interrupt )
static WRITE8_HANDLER( zodiac_master_soundlatch_w )
{
- zodiack_state *state = space->machine->driver_data<zodiack_state>();
+ zodiack_state *state = space->machine().driver_data<zodiack_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static MACHINE_START( zodiack )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
state->percuss_hardware = 0;
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sound_nmi_enabled));
}
static MACHINE_RESET( zodiack )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
/* we must start with NMI interrupts disabled */
- machine->scheduler().synchronize(FUNC(interrupt_disable));
+ machine.scheduler().synchronize(FUNC(interrupt_disable));
state->sound_nmi_enabled = FALSE;
}
static MACHINE_START( percuss )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
MACHINE_START_CALL( zodiack );
@@ -160,8 +160,8 @@ static MACHINE_START( percuss )
static WRITE8_HANDLER( zodiack_control_w )
{
/* Bit 0-1 - coin counters */
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x01);
/* Bit 2 - ???? */
}
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index 217c97a7ab2..c59a46009c5 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -204,10 +204,10 @@ static VIDEO_START( jetwave )
static SCREEN_UPDATE( jetwave )
{
- zr107_state *state = screen->machine->driver_data<zr107_state>();
- device_t *k001604 = screen->machine->device("k001604");
+ zr107_state *state = screen->machine().driver_data<zr107_state>();
+ device_t *k001604 = screen->machine().device("k001604");
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
K001005_draw(bitmap, cliprect);
@@ -216,7 +216,7 @@ static SCREEN_UPDATE( jetwave )
draw_7segment_led(bitmap, 3, 3, state->led_reg0);
draw_7segment_led(bitmap, 9, 3, state->led_reg1);
- sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
+ sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE);
return 0;
}
@@ -225,22 +225,22 @@ static SCREEN_UPDATE( jetwave )
static WRITE32_HANDLER( paletteram32_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, (offset * 2) + 0, pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16));
- palette_set_color_rgb(space->machine, (offset * 2) + 1, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), (offset * 2) + 0, pal5bit(data >> 26), pal5bit(data >> 21), pal5bit(data >> 16));
+ palette_set_color_rgb(space->machine(), (offset * 2) + 1, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
#define NUM_LAYERS 2
-static void game_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void game_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
*color += layer * 0x40;
}
static VIDEO_START( zr107 )
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_offs(k056832, 0, -29, -27);
k056832_set_layer_offs(k056832, 1, -29, -27);
@@ -257,9 +257,9 @@ static VIDEO_START( zr107 )
static SCREEN_UPDATE( zr107 )
{
- zr107_state *state = screen->machine->driver_data<zr107_state>();
- device_t *k056832 = screen->machine->device("k056832");
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ zr107_state *state = screen->machine().driver_data<zr107_state>();
+ device_t *k056832 = screen->machine().device("k056832");
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
K001005_draw(bitmap, cliprect);
@@ -268,7 +268,7 @@ static SCREEN_UPDATE( zr107 )
draw_7segment_led(bitmap, 3, 3, state->led_reg0);
draw_7segment_led(bitmap, 9, 3, state->led_reg1);
- sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
+ sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE);
return 0;
}
@@ -286,7 +286,7 @@ static READ8_HANDLER( sysreg_r )
case 2: /* I/O port 2 */
case 3: /* System Port 0 */
case 4: /* System Port 1 */
- r = input_port_read(space->machine, portnames[offset]);
+ r = input_port_read(space->machine(), portnames[offset]);
break;
case 5: /* Parallel data port */
@@ -297,7 +297,7 @@ static READ8_HANDLER( sysreg_r )
static WRITE8_HANDLER( sysreg_w )
{
- zr107_state *state = space->machine->driver_data<zr107_state>();
+ zr107_state *state = space->machine().driver_data<zr107_state>();
switch (offset)
{
case 0: /* LED Register 0 */
@@ -323,8 +323,8 @@ static WRITE8_HANDLER( sysreg_w )
0x02 = EEPCLK
0x01 = EEPDI
*/
- input_port_write(space->machine, "EEPROMOUT", data & 0x07, 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ input_port_write(space->machine(), "EEPROMOUT", data & 0x07, 0xff);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
mame_printf_debug("System register 0 = %02X\n", data);
break;
@@ -340,11 +340,11 @@ static WRITE8_HANDLER( sysreg_w )
0x01 = ADDSCLK (ADC SCLK)
*/
if (data & 0x80) /* CG Board 1 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
if (data & 0x40) /* CG Board 0 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
set_cgboard_id((data >> 4) & 3);
- input_port_write(space->machine, "OUT4", data, 0xff);
+ input_port_write(space->machine(), "OUT4", data, 0xff);
mame_printf_debug("System register 1 = %02X\n", data);
break;
@@ -353,7 +353,7 @@ static WRITE8_HANDLER( sysreg_w )
0x01 = AFE
*/
if (data & 0x01)
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
break;
}
@@ -361,7 +361,7 @@ static WRITE8_HANDLER( sysreg_w )
static READ32_HANDLER( ccu_r )
{
- zr107_state *state = space->machine->driver_data<zr107_state>();
+ zr107_state *state = space->machine().driver_data<zr107_state>();
UINT32 r = 0;
switch (offset)
{
@@ -394,12 +394,12 @@ static WRITE32_HANDLER( ccu_w )
static MACHINE_START( zr107 )
{
- zr107_state *state = machine->driver_data<zr107_state>();
+ zr107_state *state = machine.driver_data<zr107_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->workram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->workram);
}
static ADDRESS_MAP_START( zr107_map, AS_PROGRAM, 32 )
@@ -425,9 +425,9 @@ ADDRESS_MAP_END
static WRITE32_HANDLER( jetwave_palette_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static ADDRESS_MAP_START( jetwave_map, AS_PROGRAM, 32 )
@@ -460,9 +460,9 @@ static READ16_HANDLER( dual539_r )
UINT16 ret = 0;
if (ACCESSING_BITS_0_7)
- ret |= k054539_r(space->machine->device("konami2"), offset);
+ ret |= k054539_r(space->machine().device("konami2"), offset);
if (ACCESSING_BITS_8_15)
- ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
+ ret |= k054539_r(space->machine().device("konami1"), offset)<<8;
return ret;
}
@@ -470,9 +470,9 @@ static READ16_HANDLER( dual539_r )
static WRITE16_HANDLER( dual539_w )
{
if (ACCESSING_BITS_0_7)
- k054539_w(space->machine->device("konami2"), offset, data);
+ k054539_w(space->machine().device("konami2"), offset, data);
if (ACCESSING_BITS_8_15)
- k054539_w(space->machine->device("konami1"), offset, data>>8);
+ k054539_w(space->machine().device("konami1"), offset, data>>8);
}
static ADDRESS_MAP_START( sound_memmap, AS_PROGRAM, 16 )
@@ -494,13 +494,13 @@ static const k054539_interface k054539_config =
static READ32_HANDLER( dsp_dataram_r )
{
- zr107_state *state = space->machine->driver_data<zr107_state>();
+ zr107_state *state = space->machine().driver_data<zr107_state>();
return state->sharc_dataram[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram_w )
{
- zr107_state *state = space->machine->driver_data<zr107_state>();
+ zr107_state *state = space->machine().driver_data<zr107_state>();
state->sharc_dataram[offset] = data;
}
@@ -662,11 +662,11 @@ static double adc0838_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * input_port_read(device->machine, "ANALOG1")) / 255.0;
+ return (double)(5 * input_port_read(device->machine(), "ANALOG1")) / 255.0;
case ADC083X_CH1:
- return (double)(5 * input_port_read(device->machine, "ANALOG2")) / 255.0;
+ return (double)(5 * input_port_read(device->machine(), "ANALOG2")) / 255.0;
case ADC083X_CH2:
- return (double)(5 * input_port_read(device->machine, "ANALOG3")) / 255.0;
+ return (double)(5 * input_port_read(device->machine(), "ANALOG3")) / 255.0;
case ADC083X_CH3:
return 0;
case ADC083X_COM:
@@ -690,12 +690,12 @@ static TIMER_CALLBACK( irq_off )
cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
}
-static void sound_irq_callback( running_machine *machine, int irq )
+static void sound_irq_callback( running_machine &machine, int irq )
{
int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
}
static const k056800_interface zr107_k056800_interface =
@@ -851,14 +851,14 @@ MACHINE_CONFIG_END
/*****************************************************************************/
-static void init_zr107(running_machine *machine)
+static void init_zr107(running_machine &machine)
{
- zr107_state *state = machine->driver_data<zr107_state>();
+ zr107_state *state = machine.driver_data<zr107_state>();
state->sharc_dataram = auto_alloc_array(machine, UINT32, 0x100000/4);
state->led_reg0 = state->led_reg1 = 0x7f;
state->ccu_vcth = state->ccu_vctl = 0;
- K001005_preprocess_texture_data(machine->region("gfx1")->base(), machine->region("gfx1")->bytes(), 0);
+ K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 0);
}
static DRIVER_INIT(zr107)
diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h
index 76c9319bc7e..fb9fe2b1fd6 100644
--- a/src/mame/includes/88games.h
+++ b/src/mame/includes/88games.h
@@ -36,8 +36,8 @@ public:
/*----------- defined in video/88games.c -----------*/
-void _88games_sprite_callback(running_machine *machine, int *code, int *color, int *priority, int *shadow);
-void _88games_tile_callback(running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority);
-void _88games_zoom_callback(running_machine *machine, int *code, int *color, int *flags);
+void _88games_sprite_callback(running_machine &machine, int *code, int *color, int *priority, int *shadow);
+void _88games_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority);
+void _88games_zoom_callback(running_machine &machine, int *code, int *color, int *flags);
SCREEN_UPDATE( 88games );
diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h
index 030c78e1fd9..32b9784db83 100644
--- a/src/mame/includes/ajax.h
+++ b/src/mame/includes/ajax.h
@@ -41,6 +41,6 @@ INTERRUPT_GEN( ajax_interrupt );
VIDEO_START( ajax );
SCREEN_UPDATE( ajax );
-extern void ajax_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void ajax_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void ajax_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
+extern void ajax_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void ajax_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void ajax_zoom_callback(running_machine &machine, int *code,int *color,int *flags);
diff --git a/src/mame/includes/aliens.h b/src/mame/includes/aliens.h
index c80f333512e..a2ac5bdd207 100644
--- a/src/mame/includes/aliens.h
+++ b/src/mame/includes/aliens.h
@@ -30,8 +30,8 @@ public:
/*----------- defined in video/aliens.c -----------*/
-extern void aliens_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color, int *flags, int *priority);
-extern void aliens_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void aliens_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color, int *flags, int *priority);
+extern void aliens_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
VIDEO_START( aliens );
SCREEN_UPDATE( aliens );
diff --git a/src/mame/includes/alpha68k.h b/src/mame/includes/alpha68k.h
index 6ec8e3f5536..e7f2e18570c 100644
--- a/src/mame/includes/alpha68k.h
+++ b/src/mame/includes/alpha68k.h
@@ -58,8 +58,8 @@ SCREEN_UPDATE( alpha68k_II );
SCREEN_UPDATE( alpha68k_V );
SCREEN_UPDATE( alpha68k_V_sb );
-void alpha68k_V_video_bank_w(running_machine *machine, int bank);
-void alpha68k_flipscreen_w(running_machine *machine, int flip);
+void alpha68k_V_video_bank_w(running_machine &machine, int bank);
+void alpha68k_flipscreen_w(running_machine &machine, int flip);
WRITE16_HANDLER( alpha68k_paletteram_w );
WRITE16_HANDLER( alpha68k_videoram_w );
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 4cc594efc67..11b5877adcd 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -325,18 +325,18 @@ struct _amiga_machine_interface
{
UINT32 chip_ram_mask;
- UINT16 (*joy0dat_r)(running_machine *machine);
- UINT16 (*joy1dat_r)(running_machine *machine);
- void (*potgo_w)(running_machine *machine, UINT16 data);
+ UINT16 (*joy0dat_r)(running_machine &machine);
+ UINT16 (*joy1dat_r)(running_machine &machine);
+ void (*potgo_w)(running_machine &machine, UINT16 data);
- UINT16 (*dskbytr_r)(running_machine *machine);
- void (*dsklen_w)(running_machine *machine, UINT16 data);
+ UINT16 (*dskbytr_r)(running_machine &machine);
+ void (*dsklen_w)(running_machine &machine, UINT16 data);
- void (*serdat_w)(running_machine *machine, UINT16 data);
+ void (*serdat_w)(running_machine &machine, UINT16 data);
- void (*scanline0_callback)(running_machine *machine);
- void (*reset_callback)(running_machine *machine);
- void (*nmi_callback)(running_machine *machine);
+ void (*scanline0_callback)(running_machine &machine);
+ void (*reset_callback)(running_machine &machine);
+ void (*nmi_callback)(running_machine &machine);
UINT32 flags;
};
@@ -358,10 +358,10 @@ struct _amiga_autoconfig_device
UINT16 mfr_number; /* manufacturers number */
UINT32 serial_number; /* serial number */
UINT16 rom_vector; /* ROM vector offset */
- UINT8 (*int_control_r)(running_machine *machine); /* interrupt control read */
- void (*int_control_w)(running_machine *machine, UINT8 data); /* interrupt control write */
- void (*install)(running_machine *machine, offs_t base); /* memory installation */
- void (*uninstall)(running_machine *machine, offs_t base); /* memory uninstallation */
+ UINT8 (*int_control_r)(running_machine &machine); /* interrupt control read */
+ void (*int_control_w)(running_machine &machine, UINT8 data); /* interrupt control write */
+ void (*install)(running_machine &machine, offs_t base); /* memory installation */
+ void (*uninstall)(running_machine &machine, offs_t base); /* memory uninstallation */
};
typedef struct _autoconfig_device autoconfig_device;
@@ -438,7 +438,7 @@ extern const char *const amiga_custom_names[0x100];
void amiga_chip_ram_w8(amiga_state *state, offs_t offset, UINT8 data);
-void amiga_machine_config(running_machine *machine, const amiga_machine_interface *intf);
+void amiga_machine_config(running_machine &machine, const amiga_machine_interface *intf);
MACHINE_RESET( amiga );
@@ -450,17 +450,17 @@ WRITE16_HANDLER( amiga_cia_w );
READ16_HANDLER( amiga_custom_r );
WRITE16_HANDLER( amiga_custom_w );
-void amiga_serial_in_w(running_machine *machine, UINT16 data);
-attotime amiga_get_serial_char_period(running_machine *machine);
+void amiga_serial_in_w(running_machine &machine, UINT16 data);
+attotime amiga_get_serial_char_period(running_machine &machine);
-void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_device *device);
+void amiga_add_autoconfig(running_machine &machine, const amiga_autoconfig_device *device);
READ16_HANDLER( amiga_autoconfig_r );
WRITE16_HANDLER( amiga_autoconfig_w );
void amiga_cia_0_irq(device_t *device, int state);
void amiga_cia_1_irq(device_t *device, int state);
-const amiga_machine_interface *amiga_get_interface(running_machine *machine);
+const amiga_machine_interface *amiga_get_interface(running_machine &machine);
/*----------- defined in audio/amiga.c -----------*/
@@ -479,22 +479,22 @@ PALETTE_INIT( amiga );
VIDEO_START( amiga );
SCREEN_UPDATE( amiga );
-void amiga_copper_setpc(running_machine *machine, UINT32 pc);
-int amiga_copper_execute_next(running_machine *machine, int xpos);
+void amiga_copper_setpc(running_machine &machine, UINT32 pc);
+int amiga_copper_execute_next(running_machine &machine, int xpos);
UINT32 amiga_gethvpos(screen_device &screen);
-void amiga_set_genlock_color(running_machine *machine, UINT16 color);
-void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline);
-void amiga_sprite_dma_reset(running_machine *machine, int which);
-void amiga_sprite_enable_comparitor(running_machine *machine, int which, int enable);
+void amiga_set_genlock_color(running_machine &machine, UINT16 color);
+void amiga_render_scanline(running_machine &machine, bitmap_t *bitmap, int scanline);
+void amiga_sprite_dma_reset(running_machine &machine, int which);
+void amiga_sprite_enable_comparitor(running_machine &machine, int which, int enable);
/*----------- defined in video/amigaaga.c -----------*/
VIDEO_START( amiga_aga );
SCREEN_UPDATE( amiga_aga );
-void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline);
-void amiga_aga_palette_write(running_machine *machine, int color_reg, UINT16 data);
-void amiga_aga_diwhigh_written(running_machine *machine, int written);
+void amiga_aga_render_scanline(running_machine &machine, bitmap_t *bitmap, int scanline);
+void amiga_aga_palette_write(running_machine &machine, int color_reg, UINT16 data);
+void amiga_aga_diwhigh_written(running_machine &machine, int written);
#endif /* __AMIGA_H__ */
diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h
index cceac00151f..3d67b3b3633 100644
--- a/src/mame/includes/archimds.h
+++ b/src/mame/includes/archimds.h
@@ -38,16 +38,16 @@
extern UINT32 *archimedes_memc_physmem;
-void archimedes_init(running_machine *machine); // call at MACHINE_INIT
-void archimedes_reset(running_machine *machine); // call at MACHINE_RESET
-void archimedes_driver_init(running_machine *machine); // call at DRIVER_INIT
-
-void archimedes_request_irq_a(running_machine *machine, int mask);
-void archimedes_request_irq_b(running_machine *machine, int mask);
-void archimedes_request_fiq(running_machine *machine, int mask);
-void archimedes_clear_irq_a(running_machine *machine, int mask);
-void archimedes_clear_irq_b(running_machine *machine, int mask);
-void archimedes_clear_fiq(running_machine *machine, int mask);
+void archimedes_init(running_machine &machine); // call at MACHINE_INIT
+void archimedes_reset(running_machine &machine); // call at MACHINE_RESET
+void archimedes_driver_init(running_machine &machine); // call at DRIVER_INIT
+
+void archimedes_request_irq_a(running_machine &machine, int mask);
+void archimedes_request_irq_b(running_machine &machine, int mask);
+void archimedes_request_fiq(running_machine &machine, int mask);
+void archimedes_clear_irq_a(running_machine &machine, int mask);
+void archimedes_clear_irq_b(running_machine &machine, int mask);
+void archimedes_clear_fiq(running_machine &machine, int mask);
extern READ32_HANDLER(archimedes_memc_logical_r);
extern WRITE32_HANDLER(archimedes_memc_logical_w);
diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h
index 6502298d19b..83f90a2c648 100644
--- a/src/mame/includes/artmagic.h
+++ b/src/mame/includes/artmagic.h
@@ -20,7 +20,7 @@ public:
UINT8 prot_output_bit;
UINT8 prot_bit_index;
UINT16 prot_save;
- void (*protection_handler)(running_machine *);
+ void (*protection_handler)(running_machine &);
UINT16 *vram0;
UINT16 *vram1;
int _xor[16];
diff --git a/src/mame/includes/asterix.h b/src/mame/includes/asterix.h
index 1ed7bc09f90..0c213e5779d 100644
--- a/src/mame/includes/asterix.h
+++ b/src/mame/includes/asterix.h
@@ -40,5 +40,5 @@ public:
SCREEN_UPDATE( asterix );
WRITE16_HANDLER( asterix_spritebank_w );
-extern void asterix_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
-extern void asterix_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
+extern void asterix_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
+extern void asterix_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h
index b1a19e3311d..98ded5b91a0 100644
--- a/src/mame/includes/atari.h
+++ b/src/mame/includes/atari.h
@@ -24,14 +24,14 @@ READ8_DEVICE_HANDLER(atari_pia_pb_r);
WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w);
/* This is needed in MESS as well for Atari 8bit drivers */
-void atari_machine_start(running_machine *machine);
+void atari_machine_start(running_machine &machine);
MACHINE_START( atarixl );
void atari_interrupt_cb(device_t *device, int mask);
-void a800_handle_keyboard(running_machine *machine);
-void a5200_handle_keypads(running_machine *machine);
+void a800_handle_keyboard(running_machine &machine);
+void a5200_handle_keypads(running_machine &machine);
/* video */
@@ -597,7 +597,7 @@ extern PALETTE_INIT( atari );
/*----------- defined in drivers/maxaflex.c -----------*/
-int atari_input_disabled(running_machine *machine);
+int atari_input_disabled(running_machine &machine);
#endif /* ATARI_H */
diff --git a/src/mame/includes/battlnts.h b/src/mame/includes/battlnts.h
index 89363784421..26da93f5d10 100644
--- a/src/mame/includes/battlnts.h
+++ b/src/mame/includes/battlnts.h
@@ -30,5 +30,5 @@ WRITE8_HANDLER( battlnts_spritebank_w );
SCREEN_UPDATE( battlnts );
-void battlnts_tile_callback(running_machine *machine, int layer, int bank, int *code, int *color, int *flags);
-void battlnts_sprite_callback(running_machine *machine, int *code, int *color);
+void battlnts_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags);
+void battlnts_sprite_callback(running_machine &machine, int *code, int *color);
diff --git a/src/mame/includes/bishi.h b/src/mame/includes/bishi.h
index 612d1b22054..02cc17e21f9 100644
--- a/src/mame/includes/bishi.h
+++ b/src/mame/includes/bishi.h
@@ -34,7 +34,7 @@ public:
/*----------- defined in video/bishi.c -----------*/
-extern void bishi_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+extern void bishi_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
VIDEO_START(bishi);
SCREEN_UPDATE(bishi);
diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h
index af7936c39df..85a5772aecf 100644
--- a/src/mame/includes/bladestl.h
+++ b/src/mame/includes/bladestl.h
@@ -34,5 +34,5 @@ PALETTE_INIT( bladestl );
SCREEN_UPDATE( bladestl );
-void bladestl_tile_callback(running_machine *machine, int layer, int bank, int *code, int *color, int *flags);
-void bladestl_sprite_callback(running_machine *machine, int *code, int *color);
+void bladestl_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags);
+void bladestl_sprite_callback(running_machine &machine, int *code, int *color);
diff --git a/src/mame/includes/blockhl.h b/src/mame/includes/blockhl.h
index 187eb346b29..ea975270087 100644
--- a/src/mame/includes/blockhl.h
+++ b/src/mame/includes/blockhl.h
@@ -30,8 +30,8 @@ public:
/*----------- defined in video/blockhl.c -----------*/
-extern void blockhl_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color, int *flags, int *priority);
-extern void blockhl_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
+extern void blockhl_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color, int *flags, int *priority);
+extern void blockhl_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
VIDEO_START( blockhl );
SCREEN_UPDATE( blockhl );
diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h
index e6b3220cd86..5ddd9a35812 100644
--- a/src/mame/includes/bottom9.h
+++ b/src/mame/includes/bottom9.h
@@ -33,9 +33,9 @@ public:
/*----------- defined in video/bottom9.c -----------*/
-extern void bottom9_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void bottom9_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void bottom9_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
+extern void bottom9_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void bottom9_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void bottom9_zoom_callback(running_machine &machine, int *code,int *color,int *flags);
VIDEO_START( bottom9 );
SCREEN_UPDATE( bottom9 );
diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h
index 6f0210a8576..58fb78ccbff 100644
--- a/src/mame/includes/carpolo.h
+++ b/src/mame/includes/carpolo.h
@@ -81,11 +81,11 @@ WRITE8_HANDLER( carpolo_car_ball_interrupt_clear_w );
WRITE8_HANDLER( carpolo_car_border_interrupt_clear_w );
WRITE8_HANDLER( carpolo_timer_interrupt_clear_w );
-void carpolo_generate_car_car_interrupt(running_machine *machine, int car1, int car2);
-void carpolo_generate_ball_screen_interrupt(running_machine *machine, UINT8 cause);
-void carpolo_generate_car_goal_interrupt(running_machine *machine, int car, int right_goal);
-void carpolo_generate_car_ball_interrupt(running_machine *machine, int car, int car_x, int car_y);
-void carpolo_generate_car_border_interrupt(running_machine *machine, int car, int horizontal_border);
+void carpolo_generate_car_car_interrupt(running_machine &machine, int car1, int car2);
+void carpolo_generate_ball_screen_interrupt(running_machine &machine, UINT8 cause);
+void carpolo_generate_car_goal_interrupt(running_machine &machine, int car, int right_goal);
+void carpolo_generate_car_ball_interrupt(running_machine &machine, int car, int car_x, int car_y);
+void carpolo_generate_car_border_interrupt(running_machine &machine, int car, int horizontal_border);
/*----------- defined in video/carpolo.c -----------*/
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index fa664b22796..e430c3e32d5 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -57,8 +57,8 @@ public:
} blit;
- void (*get_sprite_info)(running_machine *machine);
- void (*sprite_draw)(running_machine *machine, int priority);
+ void (*get_sprite_info)(running_machine &machine);
+ void (*sprite_draw)(running_machine &machine, int priority);
tilemap_t *tilemap_0, *tilemap_1, *tilemap_2, *tilemap_3;
int tiledim_0, old_tiledim_0;
@@ -146,5 +146,5 @@ VIDEO_START( sailormn_3_layers );
SCREEN_UPDATE( cave );
-void cave_get_sprite_info(running_machine *machine);
-void sailormn_tilebank_w(running_machine *machine, int bank);
+void cave_get_sprite_info(running_machine &machine);
+void sailormn_tilebank_w(running_machine &machine, int bank);
diff --git a/src/mame/includes/cd32.h b/src/mame/includes/cd32.h
index fcea03bfc3f..59d6a7a9381 100644
--- a/src/mame/includes/cd32.h
+++ b/src/mame/includes/cd32.h
@@ -17,7 +17,7 @@ public:
UINT16 potgo_value;
int cd32_shifter[2];
- void (*input_hack)(running_machine *machine);
+ void (*input_hack)(running_machine &machine);
int oldstate[2];
};
diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h
index b3eb0c789ad..d56b77d01a1 100644
--- a/src/mame/includes/chqflag.h
+++ b/src/mame/includes/chqflag.h
@@ -35,9 +35,9 @@ public:
/*----------- defined in video/chqflag.c -----------*/
-extern void chqflag_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void chqflag_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags);
-extern void chqflag_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags);
+extern void chqflag_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void chqflag_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags);
+extern void chqflag_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags);
VIDEO_START( chqflag );
SCREEN_UPDATE( chqflag );
diff --git a/src/mame/includes/cinemat.h b/src/mame/includes/cinemat.h
index 726c246fca6..a11660f1ed5 100644
--- a/src/mame/includes/cinemat.h
+++ b/src/mame/includes/cinemat.h
@@ -12,7 +12,7 @@ public:
: driver_device(machine, config) { }
UINT8 sound_control;
- void (*sound_handler)(running_machine *,UINT8 sound_val, UINT8 bits_changed);
+ void (*sound_handler)(running_machine &,UINT8 sound_val, UINT8 bits_changed);
UINT32 current_shift;
UINT32 last_shift;
UINT32 last_shift2;
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index 07fc35f5851..ace50638efc 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -21,7 +21,7 @@ public:
size_t spriteram_size;
/* video-related */
- pen_t (*map_color)(running_machine *machine, UINT8 x, UINT8 y);
+ pen_t (*map_color)(running_machine &machine, UINT8 x, UINT8 y);
int color_registers[3];
int background_enable;
int magspot_pen_mask;
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 834e43573cd..8ba62282928 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -170,9 +170,9 @@ VIDEO_START( cps2 );
SCREEN_UPDATE( cps1 );
SCREEN_EOF( cps1 );
-void cps1_get_video_base(running_machine *machine);
-void cps2_set_sprite_priorities(running_machine *machine);
-void cps2_objram_latch(running_machine *machine);
+void cps1_get_video_base(running_machine &machine);
+void cps2_set_sprite_priorities(running_machine &machine);
+void cps2_objram_latch(running_machine &machine);
/*************************************
@@ -186,21 +186,21 @@ DRIVER_INIT( cps2crpt );
/*----------- defined in machine/kabuki.c -----------*/
-void mgakuen2_decode(running_machine *machine);
-void pang_decode(running_machine *machine);
-void cworld_decode(running_machine *machine);
-void hatena_decode(running_machine *machine);
-void spang_decode(running_machine *machine);
-void spangj_decode(running_machine *machine);
-void sbbros_decode(running_machine *machine);
-void marukin_decode(running_machine *machine);
-void qtono1_decode(running_machine *machine);
-void qsangoku_decode(running_machine *machine);
-void block_decode(running_machine *machine);
-
-void wof_decode(running_machine *machine);
-void dino_decode(running_machine *machine);
-void punisher_decode(running_machine *machine);
-void slammast_decode(running_machine *machine);
+void mgakuen2_decode(running_machine &machine);
+void pang_decode(running_machine &machine);
+void cworld_decode(running_machine &machine);
+void hatena_decode(running_machine &machine);
+void spang_decode(running_machine &machine);
+void spangj_decode(running_machine &machine);
+void sbbros_decode(running_machine &machine);
+void marukin_decode(running_machine &machine);
+void qtono1_decode(running_machine &machine);
+void qsangoku_decode(running_machine &machine);
+void block_decode(running_machine &machine);
+
+void wof_decode(running_machine &machine);
+void dino_decode(running_machine &machine);
+void punisher_decode(running_machine &machine);
+void slammast_decode(running_machine &machine);
#endif
diff --git a/src/mame/includes/crbaloon.h b/src/mame/includes/crbaloon.h
index a1c4bbebdf9..d5f6e325e48 100644
--- a/src/mame/includes/crbaloon.h
+++ b/src/mame/includes/crbaloon.h
@@ -45,5 +45,5 @@ SCREEN_UPDATE( crbaloon );
WRITE8_HANDLER( crbaloon_videoram_w );
WRITE8_HANDLER( crbaloon_colorram_w );
-UINT16 crbaloon_get_collision_address(running_machine *machine);
-void crbaloon_set_clear_collision_address(running_machine *machine, int _crbaloon_collision_address_clear);
+UINT16 crbaloon_get_collision_address(running_machine &machine);
+void crbaloon_set_clear_collision_address(running_machine &machine, int _crbaloon_collision_address_clear);
diff --git a/src/mame/includes/crimfght.h b/src/mame/includes/crimfght.h
index d7e5504977c..f8f52f9219f 100644
--- a/src/mame/includes/crimfght.h
+++ b/src/mame/includes/crimfght.h
@@ -26,8 +26,8 @@ public:
/*----------- defined in video/crimfght.c -----------*/
-extern void crimfght_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void crimfght_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
+extern void crimfght_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void crimfght_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
VIDEO_START( crimfght );
SCREEN_UPDATE( crimfght );
diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h
index 78788b8ee06..b8df9d9fb99 100644
--- a/src/mame/includes/cvs.h
+++ b/src/mame/includes/cvs.h
@@ -105,7 +105,7 @@ WRITE8_HANDLER( cvs_video_fx_w );
READ8_HANDLER( cvs_collision_r );
READ8_HANDLER( cvs_collision_clear );
-void cvs_scroll_stars(running_machine *machine);
+void cvs_scroll_stars(running_machine &machine);
PALETTE_INIT( cvs );
SCREEN_UPDATE( cvs );
diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h
index e60e6eef039..8de555b67e4 100644
--- a/src/mame/includes/cyberbal.h
+++ b/src/mame/includes/cyberbal.h
@@ -32,7 +32,7 @@ public:
/*----------- defined in audio/cyberbal.c -----------*/
-void cyberbal_sound_reset(running_machine *machine);
+void cyberbal_sound_reset(running_machine &machine);
INTERRUPT_GEN( cyberbal_sound_68k_irq_gen );
diff --git a/src/mame/includes/dbz.h b/src/mame/includes/dbz.h
index 5f18ea0c27f..0dcb62c2ddc 100644
--- a/src/mame/includes/dbz.h
+++ b/src/mame/includes/dbz.h
@@ -35,8 +35,8 @@ public:
/*----------- defined in video/dbz.c -----------*/
-extern void dbz_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
-extern void dbz_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+extern void dbz_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
+extern void dbz_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
WRITE16_HANDLER(dbz_bg1_videoram_w);
WRITE16_HANDLER(dbz_bg2_videoram_w);
diff --git a/src/mame/includes/dc.h b/src/mame/includes/dc.h
index 8153950771a..b5036f84980 100644
--- a/src/mame/includes/dc.h
+++ b/src/mame/includes/dc.h
@@ -37,8 +37,8 @@ WRITE32_DEVICE_HANDLER( dc_arm_aica_w );
MACHINE_START( dc );
MACHINE_RESET( dc );
-int dc_compute_interrupt_level(running_machine *machine);
-void dc_update_interrupt_status(running_machine *machine);
+int dc_compute_interrupt_level(running_machine &machine);
+void dc_update_interrupt_status(running_machine &machine);
INPUT_CHANGED( dc_coin_slots_callback );
diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h
index 216739afa74..c7eb1d4e1d7 100644
--- a/src/mame/includes/dcheese.h
+++ b/src/mame/includes/dcheese.h
@@ -35,7 +35,7 @@ public:
/*----------- defined in drivers/dcheese.c -----------*/
-void dcheese_signal_irq(running_machine *machine, int which);
+void dcheese_signal_irq(running_machine &machine, int which);
/*----------- defined in video/dcheese.c -----------*/
diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h
index c6314930620..01a242b8384 100644
--- a/src/mame/includes/dec0.h
+++ b/src/mame/includes/dec0.h
@@ -61,8 +61,8 @@ DRIVER_INIT( baddudes );
DRIVER_INIT( hbarrel );
DRIVER_INIT( birdtry );
-extern void dec0_i8751_write(running_machine *machine, int data);
-extern void dec0_i8751_reset(running_machine *machine);
+extern void dec0_i8751_write(running_machine &machine, int data);
+extern void dec0_i8751_reset(running_machine &machine);
READ8_HANDLER( hippodrm_prot_r );
WRITE8_HANDLER( dec0_mcu_port_w );
READ8_HANDLER( dec0_mcu_port_r );
diff --git a/src/mame/includes/decocrpt.h b/src/mame/includes/decocrpt.h
index f0a3ffd87ac..84c1cf3fed8 100644
--- a/src/mame/includes/decocrpt.h
+++ b/src/mame/includes/decocrpt.h
@@ -1,15 +1,15 @@
/*----------- defined in machine/decocrpt.c -----------*/
-void deco56_decrypt_gfx(running_machine *machine, const char *tag);
-void deco74_decrypt_gfx(running_machine *machine, const char *tag);
-void deco56_remap_gfx(running_machine *machine, const char *tag);
+void deco56_decrypt_gfx(running_machine &machine, const char *tag);
+void deco74_decrypt_gfx(running_machine &machine, const char *tag);
+void deco56_remap_gfx(running_machine &machine, const char *tag);
/*----------- defined in machine/deco102.c -----------*/
-void deco102_decrypt_cpu(running_machine *machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor);
+void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor);
/*----------- defined in machine/deco156.c -----------*/
-void deco156_decrypt(running_machine *machine);
+void deco156_decrypt(running_machine &machine);
diff --git a/src/mame/includes/decoprot.h b/src/mame/includes/decoprot.h
index f486457d581..e51f4e98a35 100644
--- a/src/mame/includes/decoprot.h
+++ b/src/mame/includes/decoprot.h
@@ -20,7 +20,7 @@ WRITE16_HANDLER( deco16_146_nitroball_prot_w );
WRITE16_HANDLER( deco16_104_pktgaldx_prot_w );
WRITE32_HANDLER( deco16_146_fghthist_prot_w );
-void decoprot_reset(running_machine *machine);
+void decoprot_reset(running_machine &machine);
extern UINT16 *deco16_prot_ram;
extern UINT32 *deco32_prot_ram;
diff --git a/src/mame/includes/djmain.h b/src/mame/includes/djmain.h
index 23dc0db9b2d..6a286228f62 100644
--- a/src/mame/includes/djmain.h
+++ b/src/mame/includes/djmain.h
@@ -23,4 +23,4 @@ public:
SCREEN_UPDATE( djmain );
VIDEO_START( djmain );
-void djmain_tile_callback(running_machine* machine, int layer, int *code, int *color, int *flags);
+void djmain_tile_callback(running_machine& machine, int layer, int *code, int *color, int *flags);
diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h
index 2ea7ebde6c3..8198f988dfb 100644
--- a/src/mame/includes/dynax.h
+++ b/src/mame/includes/dynax.h
@@ -17,7 +17,7 @@ public:
UINT8 * ddenlovr_pixmap[8];
/* irq */
- void (*update_irq_func)(running_machine *machine); // some games trigger IRQ at blitter end, some don't
+ void (*update_irq_func)(running_machine &machine); // some games trigger IRQ at blitter end, some don't
UINT8 sound_irq;
UINT8 vblank_irq;
UINT8 blitter_irq, blitter2_irq;
@@ -129,10 +129,10 @@ public:
//----------- defined in drivers/dynax.c -----------
-void sprtmtch_update_irq(running_machine *machine);
-void jantouki_update_irq(running_machine *machine);
-void mjelctrn_update_irq(running_machine *machine);
-void neruton_update_irq(running_machine *machine);
+void sprtmtch_update_irq(running_machine &machine);
+void jantouki_update_irq(running_machine &machine);
+void mjelctrn_update_irq(running_machine &machine);
+void neruton_update_irq(running_machine &machine);
//----------- defined in video/dynax.c -----------
diff --git a/src/mame/includes/eolithsp.h b/src/mame/includes/eolithsp.h
index e3b4fe9a41d..34e6ad40bb1 100644
--- a/src/mame/includes/eolithsp.h
+++ b/src/mame/includes/eolithsp.h
@@ -1,6 +1,6 @@
/*----------- defined in drivers/eolithsp.c -----------*/
void eolith_speedup_read(address_space *space);
-void init_eolith_speedup(running_machine *machine);
+void init_eolith_speedup(running_machine &machine);
INTERRUPT_GEN( eolith_speedup );
CUSTOM_INPUT( eolith_speedup_getvblank );
diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h
index ba13e97a98e..3b701e350b3 100644
--- a/src/mame/includes/esripsys.h
+++ b/src/mame/includes/esripsys.h
@@ -75,4 +75,4 @@ SCREEN_UPDATE( esripsys );
WRITE8_HANDLER( esripsys_bg_intensity_w );
INTERRUPT_GEN( esripsys_vblank_irq );
-int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
+int esripsys_draw(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
diff --git a/src/mame/includes/exidy.h b/src/mame/includes/exidy.h
index 441a879ba16..d2a9059d89c 100644
--- a/src/mame/includes/exidy.h
+++ b/src/mame/includes/exidy.h
@@ -48,7 +48,7 @@ public:
/*----------- defined in video/exidy.c -----------*/
-void exidy_video_config(running_machine *machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp);
+void exidy_video_config(running_machine &machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp);
VIDEO_START( exidy );
SCREEN_UPDATE( exidy );
diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h
index fce8836767c..6c51899c706 100644
--- a/src/mame/includes/exidy440.h
+++ b/src/mame/includes/exidy440.h
@@ -35,7 +35,7 @@ public:
/*----------- defined in drivers/exidy440.c -----------*/
-void exidy440_bank_select(running_machine *machine, UINT8 bank);
+void exidy440_bank_select(running_machine &machine, UINT8 bank);
/*----------- defined in video/exidy440.c -----------*/
diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h
index f0bb69dee64..0f746f55582 100644
--- a/src/mame/includes/fromanc2.h
+++ b/src/mame/includes/fromanc2.h
@@ -68,7 +68,7 @@ WRITE16_HANDLER( fromancr_gfxreg_0_w );
WRITE16_HANDLER( fromancr_gfxreg_1_w );
WRITE16_HANDLER( fromanc2_gfxbank_0_w );
WRITE16_HANDLER( fromanc2_gfxbank_1_w );
-void fromancr_gfxbank_w(running_machine *machine, int data);
+void fromancr_gfxbank_w(running_machine &machine, int data);
WRITE16_HANDLER( fromanc4_gfxreg_0_w );
WRITE16_HANDLER( fromanc4_gfxreg_1_w );
WRITE16_HANDLER( fromanc4_gfxreg_2_w );
diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h
index 7abd3d81692..25a6cbefbd1 100644
--- a/src/mame/includes/galaga.h
+++ b/src/mame/includes/galaga.h
@@ -130,7 +130,7 @@ PALETTE_INIT( battles );
/*----------- defined in machine/xevious.c -----------*/
-void battles_customio_init(running_machine *machine);
+void battles_customio_init(running_machine &machine);
TIMER_DEVICE_CALLBACK( battles_nmi_generate );
READ8_HANDLER( battles_customio0_r );
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 49935c75e7d..f31b344947a 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -67,8 +67,8 @@ TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer );
/* video extension callbacks */
typedef void (*galaxian_extend_tile_info_func)(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
typedef void (*galaxian_extend_sprite_info_func)(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
-typedef void (*galaxian_draw_bullet_func)(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-typedef void (*galaxian_draw_background_func)(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+typedef void (*galaxian_draw_bullet_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
extern galaxian_extend_tile_info_func galaxian_extend_tile_info_ptr;
extern galaxian_extend_sprite_info_func galaxian_extend_sprite_info_ptr;
@@ -76,19 +76,19 @@ extern galaxian_draw_bullet_func galaxian_draw_bullet_ptr;
extern galaxian_draw_background_func galaxian_draw_background_ptr;
/* special purpose background rendering */
-void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-void frogger_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-//void amidar_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-void turtles_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-void scramble_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-void anteater_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-void jumpbug_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+//void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
/* special purpose bullet rendering */
-void galaxian_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-void mshuttle_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-void scramble_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-void theend_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
/* generic extensions */
void upper_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
@@ -131,5 +131,5 @@ void jumpbug_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *
/*----------- defined in drivers/galaxian.c -----------*/
/* Ten Spot extensions */
-void tenspot_set_game_bank(running_machine *machine, int bank, int from_game);
+void tenspot_set_game_bank(running_machine &machine, int bank, int from_game);
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index fe3b4aa45eb..f003b7eedc7 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -85,8 +85,8 @@ VIDEO_START( scorpion );
VIDEO_START( racknrol );
VIDEO_START( ad2083 );
-void galaxold_init_stars(running_machine *machine, int colors_offset);
-void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+void galaxold_init_stars(running_machine &machine, int colors_offset);
+void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
SCREEN_UPDATE( galaxold );
SCREEN_UPDATE( dambustr );
@@ -173,7 +173,7 @@ CUSTOM_INPUT( darkplnt_custom_r );
/*----------- defined in audio/scramble.c -----------*/
-void scramble_sh_init(running_machine *machine);
+void scramble_sh_init(running_machine &machine);
WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback );
WRITE8_HANDLER( scramble_filter_w );
diff --git a/src/mame/includes/gbusters.h b/src/mame/includes/gbusters.h
index 6e86ebe8d62..40471f933a0 100644
--- a/src/mame/includes/gbusters.h
+++ b/src/mame/includes/gbusters.h
@@ -31,8 +31,8 @@ public:
/*----------- defined in video/gbusters.c -----------*/
-extern void gbusters_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags, int *priority);
-extern void gbusters_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
+extern void gbusters_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags, int *priority);
+extern void gbusters_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
VIDEO_START( gbusters );
SCREEN_UPDATE( gbusters );
diff --git a/src/mame/includes/genesis.h b/src/mame/includes/genesis.h
index d50b2eadb48..a1b3f4875b6 100644
--- a/src/mame/includes/genesis.h
+++ b/src/mame/includes/genesis.h
@@ -6,7 +6,7 @@ extern UINT16 genesis_bg_pal_lookup[4];
extern UINT16 genesis_sp_pal_lookup[4];
extern UINT8 genesis_vdp_regs[32];
-void system18_vdp_start(running_machine *machine);
+void system18_vdp_start(running_machine &machine);
void system18_vdp_update(bitmap_t *bitmap, const rectangle *cliprect);
READ16_HANDLER ( genesis_vdp_r );
diff --git a/src/mame/includes/gijoe.h b/src/mame/includes/gijoe.h
index 60a62715653..02618168b74 100644
--- a/src/mame/includes/gijoe.h
+++ b/src/mame/includes/gijoe.h
@@ -35,8 +35,8 @@ public:
/*----------- defined in video/gijoe.c -----------*/
-extern void gijoe_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
-extern void gijoe_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+extern void gijoe_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
+extern void gijoe_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
VIDEO_START( gijoe );
SCREEN_UPDATE( gijoe );
diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h
index 3ce4dcd38c7..5626462d11d 100644
--- a/src/mame/includes/gradius3.h
+++ b/src/mame/includes/gradius3.h
@@ -32,8 +32,8 @@ public:
/*----------- defined in video/gradius3.c -----------*/
-extern void gradius3_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
-extern void gradius3_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void gradius3_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void gradius3_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
READ16_HANDLER( gradius3_gfxrom_r );
WRITE16_HANDLER( gradius3_gfxram_w );
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 7a4b7544f57..985b961feec 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -299,7 +299,7 @@ READ16_HANDLER( hdds3_speedup_r );
/*----------- defined in audio/harddriv.c -----------*/
-void hdsnd_init(running_machine *machine);
+void hdsnd_init(running_machine &machine);
READ16_HANDLER( hd68k_snd_data_r );
READ16_HANDLER( hd68k_snd_status_r );
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index a8ef8a7bb75..350b68e5330 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -100,7 +100,7 @@ public:
/*----------- defined in video/hng64.c -----------*/
WRITE32_HANDLER( hng64_videoram_w );
-void hng64_command3d(running_machine* machine, const UINT16* packet);
+void hng64_command3d(running_machine& machine, const UINT16* packet);
VIDEO_START( hng64 );
SCREEN_UPDATE( hng64 );
diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h
index fd8fa698237..87fb21565a2 100644
--- a/src/mame/includes/irobot.h
+++ b/src/mame/includes/irobot.h
@@ -88,5 +88,5 @@ SCREEN_UPDATE( irobot );
WRITE8_HANDLER( irobot_paletteram_w );
-void irobot_poly_clear(running_machine *machine);
-void irobot_run_video(running_machine *machine);
+void irobot_poly_clear(running_machine &machine);
+void irobot_run_video(running_machine &machine);
diff --git a/src/mame/includes/itech32.h b/src/mame/includes/itech32.h
index c0942ddcf43..34bc1deaea6 100644
--- a/src/mame/includes/itech32.h
+++ b/src/mame/includes/itech32.h
@@ -74,7 +74,7 @@ public:
/*----------- defined in drivers/itech32.c -----------*/
-void itech32_update_interrupts(running_machine *machine, int vint, int xint, int qint);
+void itech32_update_interrupts(running_machine &machine, int vint, int xint, int qint);
/*----------- defined in video/itech32.c -----------*/
diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h
index d29479c8921..93233c358b9 100644
--- a/src/mame/includes/itech8.h
+++ b/src/mame/includes/itech8.h
@@ -57,7 +57,7 @@ public:
/*----------- defined in drivers/itech8.c -----------*/
-void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter);
+void itech8_update_interrupts(running_machine &machine, int periodic, int tms34061, int blitter);
/*----------- defined in machine/slikshot.c -----------*/
diff --git a/src/mame/includes/jackal.h b/src/mame/includes/jackal.h
index 0c21b921a91..1648a192aa2 100644
--- a/src/mame/includes/jackal.h
+++ b/src/mame/includes/jackal.h
@@ -31,7 +31,7 @@ public:
/*----------- defined in video/jackal.c -----------*/
-void jackal_mark_tile_dirty(running_machine *machine, int offset);
+void jackal_mark_tile_dirty(running_machine &machine, int offset);
PALETTE_INIT( jackal );
VIDEO_START( jackal );
diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h
index 31ffc462f84..d74fd15afc8 100644
--- a/src/mame/includes/jaguar.h
+++ b/src/mame/includes/jaguar.h
@@ -30,10 +30,10 @@ extern UINT32 *jaguar_wave_rom;
TIMER_DEVICE_CALLBACK( jaguar_serial_callback );
-void jaguar_dsp_suspend(running_machine *machine);
-void jaguar_dsp_resume(running_machine *machine);
+void jaguar_dsp_suspend(running_machine &machine);
+void jaguar_dsp_resume(running_machine &machine);
-void cojag_sound_init(running_machine *machine);
+void cojag_sound_init(running_machine &machine);
void jaguar_external_int(device_t *device, int state);
@@ -50,8 +50,8 @@ WRITE32_HANDLER( jaguar_serial_w );
extern UINT8 blitter_status;
-void jaguar_gpu_suspend(running_machine *machine);
-void jaguar_gpu_resume(running_machine *machine);
+void jaguar_gpu_suspend(running_machine &machine);
+void jaguar_gpu_resume(running_machine &machine);
void jaguar_gpu_cpu_int(device_t *device);
void jaguar_dsp_cpu_int(device_t *device);
diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h
index 292d2394539..a158e965130 100644
--- a/src/mame/includes/kaneko16.h
+++ b/src/mame/includes/kaneko16.h
@@ -31,13 +31,13 @@ WRITE16_HANDLER( toybox_mcu_com2_w );
WRITE16_HANDLER( toybox_mcu_com3_w );
READ16_HANDLER( toybox_mcu_status_r );
-extern void (*toybox_mcu_run)(running_machine *machine); /* one of the following */
-void bloodwar_mcu_run(running_machine *machine);
-void bonkadv_mcu_run(running_machine *machine);
-void gtmr_mcu_run(running_machine *machine);
-void calc3_mcu_run(running_machine *machine);
+extern void (*toybox_mcu_run)(running_machine &machine); /* one of the following */
+void bloodwar_mcu_run(running_machine &machine);
+void bonkadv_mcu_run(running_machine &machine);
+void gtmr_mcu_run(running_machine &machine);
+void calc3_mcu_run(running_machine &machine);
-void toxboy_handle_04_subcommand(running_machine* machine,UINT8 mcu_subcmd, UINT16*mcu_ram);
+void toxboy_handle_04_subcommand(running_machine& machine,UINT8 mcu_subcmd, UINT16*mcu_ram);
DRIVER_INIT( decrypt_toybox_rom );
DRIVER_INIT( decrypt_toybox_rom_alt );
@@ -80,7 +80,7 @@ extern UINT16 *kaneko16_sprites_regs;
READ16_HANDLER ( kaneko16_sprites_regs_r );
WRITE16_HANDLER( kaneko16_sprites_regs_w );
-void kaneko16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
/* Pixel Layer: */
diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h
index 0130906afe6..6bdc4063e78 100644
--- a/src/mame/includes/karnov.h
+++ b/src/mame/includes/karnov.h
@@ -48,7 +48,7 @@ enum {
WRITE16_HANDLER( karnov_playfield_swap_w );
WRITE16_HANDLER( karnov_videoram_w );
-void karnov_flipscreen_w(running_machine *machine, int data);
+void karnov_flipscreen_w(running_machine &machine, int data);
PALETTE_INIT( karnov );
VIDEO_START( karnov );
diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h
index 0df00ce77d1..db0ef641909 100644
--- a/src/mame/includes/konamigx.h
+++ b/src/mame/includes/konamigx.h
@@ -61,12 +61,12 @@ extern UINT16 konamigx_wrport2;
#define GXSUB_5BPP 0x05 // 32 colors
#define GXSUB_8BPP 0x08 // 256 colors
-void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
tilemap_t *sub1, int sub1flags,
tilemap_t *sub2, int sub2flags,
int mixerflags, bitmap_t* extra_bitmap, int rushingheroes_hack);
-void konamigx_mixer_init(running_machine *machine, int objdma);
+void konamigx_mixer_init(running_machine &machine, int objdma);
void konamigx_mixer_primode(int mode);
@@ -110,4 +110,4 @@ WRITE16_HANDLER( K055550_word_w );
WRITE16_HANDLER( K053990_martchmp_word_w );
void konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode);
-void fantjour_dma_install(running_machine *machine);
+void fantjour_dma_install(running_machine &machine);
diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h
index 9746231a9a4..4048ddcf1db 100644
--- a/src/mame/includes/ladybug.h
+++ b/src/mame/includes/ladybug.h
@@ -75,7 +75,7 @@ SCREEN_UPDATE( redclash );
SCREEN_EOF( redclash );
/* sraider uses the zerohour star generator board */
-void redclash_set_stars_enable(running_machine *machine, UINT8 on);
-void redclash_update_stars_state(running_machine *machine);
-void redclash_set_stars_speed(running_machine *machine, UINT8 speed);
-void redclash_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
+void redclash_set_stars_enable(running_machine &machine, UINT8 on);
+void redclash_update_stars_state(running_machine &machine);
+void redclash_set_stars_speed(running_machine &machine, UINT8 speed);
+void redclash_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index 0c95c724548..8a1889f8846 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -26,8 +26,8 @@ public:
/*----------- defined in video/legionna.c -----------*/
-void heatbrl_setgfxbank(running_machine *machine, UINT16 data);
-void denjinmk_setgfxbank(running_machine *machine, UINT16 data);
+void heatbrl_setgfxbank(running_machine &machine, UINT16 data);
+void denjinmk_setgfxbank(running_machine &machine, UINT16 data);
WRITE16_HANDLER( legionna_background_w );
WRITE16_HANDLER( legionna_foreground_w );
WRITE16_HANDLER( legionna_midground_w );
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index a3ac35c536f..033e05cf869 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -50,7 +50,7 @@ public:
UINT8 sound_port_bank;
UINT8 alternate_bank;
UINT8 master_bank;
- void (*update_master_bank)(running_machine *machine);
+ void (*update_master_bank)(running_machine &machine);
UINT32 xrom1_addr;
UINT32 xrom2_addr;
UINT8 battery_ram_enable;
@@ -106,17 +106,17 @@ MACHINE_RESET( ataxx );
INTERRUPT_GEN( leland_master_interrupt );
WRITE8_HANDLER( leland_master_alt_bankswitch_w );
-void cerberus_bankswitch(running_machine *machine);
-void mayhem_bankswitch(running_machine *machine);
-void dangerz_bankswitch(running_machine *machine);
-void basebal2_bankswitch(running_machine *machine);
-void redline_bankswitch(running_machine *machine);
-void viper_bankswitch(running_machine *machine);
-void offroad_bankswitch(running_machine *machine);
-void ataxx_bankswitch(running_machine *machine);
-
-void leland_init_eeprom(running_machine *machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type);
-void ataxx_init_eeprom(running_machine *machine, const UINT16 *data);
+void cerberus_bankswitch(running_machine &machine);
+void mayhem_bankswitch(running_machine &machine);
+void dangerz_bankswitch(running_machine &machine);
+void basebal2_bankswitch(running_machine &machine);
+void redline_bankswitch(running_machine &machine);
+void viper_bankswitch(running_machine &machine);
+void offroad_bankswitch(running_machine &machine);
+void ataxx_bankswitch(running_machine &machine);
+
+void leland_init_eeprom(running_machine &machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type);
+void ataxx_init_eeprom(running_machine &machine, const UINT16 *data);
READ8_DEVICE_HANDLER( ataxx_eeprom_r );
WRITE8_DEVICE_HANDLER( ataxx_eeprom_w );
@@ -146,7 +146,7 @@ WRITE8_HANDLER( ataxx_slave_banksw_w );
READ8_HANDLER( leland_raster_r );
-void leland_rotate_memory(running_machine *machine, const char *cpuname);
+void leland_rotate_memory(running_machine &machine, const char *cpuname);
/*----------- defined in audio/leland.c -----------*/
diff --git a/src/mame/includes/lethal.h b/src/mame/includes/lethal.h
index e85dbda983d..a1146ecdd55 100644
--- a/src/mame/includes/lethal.h
+++ b/src/mame/includes/lethal.h
@@ -30,8 +30,8 @@ public:
/*----------- defined in video/lethal.c -----------*/
-extern void lethalen_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
-extern void lethalen_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+extern void lethalen_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
+extern void lethalen_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
WRITE8_HANDLER(lethalen_palette_control);
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
index 0e9e58434f4..0dbe2f2163d 100644
--- a/src/mame/includes/lordgun.h
+++ b/src/mame/includes/lordgun.h
@@ -55,7 +55,7 @@ WRITE16_HANDLER( lordgun_vram_2_w );
WRITE16_HANDLER( lordgun_vram_3_w );
float lordgun_crosshair_mapper(const input_field_config *field, float linear_value);
-void lordgun_update_gun(running_machine *machine, int i);
+void lordgun_update_gun(running_machine &machine, int i);
VIDEO_START( lordgun );
SCREEN_UPDATE( lordgun );
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index f365fa62bf1..1797e2248e5 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -38,7 +38,7 @@ public:
/*----------- defined in drivers/m92.c -----------*/
-extern void m92_sprite_interrupt(running_machine *machine);
+extern void m92_sprite_interrupt(running_machine &machine);
/*----------- defined in video/m92.c -----------*/
diff --git a/src/mame/includes/mainevt.h b/src/mame/includes/mainevt.h
index 06fc6b26e99..10cc4c8bca4 100644
--- a/src/mame/includes/mainevt.h
+++ b/src/mame/includes/mainevt.h
@@ -30,10 +30,10 @@ public:
/*----------- defined in video/mainevt.c -----------*/
-extern void mainevt_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void dv_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
-extern void dv_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
+extern void mainevt_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void dv_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void mainevt_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void dv_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
VIDEO_START( mainevt );
VIDEO_START( dv );
diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h
index 6f5d966abef..cc755a7c74b 100644
--- a/src/mame/includes/meadows.h
+++ b/src/mame/includes/meadows.h
@@ -35,8 +35,8 @@ public:
/*----------- defined in audio/meadows.c -----------*/
SAMPLES_START( meadows_sh_start );
-void meadows_sh_dac_w(running_machine *machine, int data);
-void meadows_sh_update(running_machine *machine);
+void meadows_sh_dac_w(running_machine &machine, int data);
+void meadows_sh_update(running_machine &machine);
/*----------- defined in video/meadows.c -----------*/
diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h
index a4a4a44004f..802c121e64e 100644
--- a/src/mame/includes/megadriv.h
+++ b/src/mame/includes/megadriv.h
@@ -40,10 +40,10 @@ extern UINT16* megadriv_backupram;
extern int megadriv_backupram_length;
extern UINT16* megadrive_ram;
-extern UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl);
+extern UINT8 megatech_bios_port_cc_dc_r(running_machine &machine, int offset, int ctrl);
extern void megadriv_stop_scanline_timer(void);
-void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag);
+void megatech_set_megadrive_z80_as_megadrive_z80(running_machine &machine, const char* tag);
extern READ16_HANDLER( megadriv_vdp_r );
extern WRITE16_HANDLER( megadriv_vdp_w );
@@ -58,8 +58,8 @@ extern WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
/* These are needed to create external input handlers (see e.g. MESS) */
/* Regs are also used by Megaplay! */
-extern UINT8 (*megadrive_io_read_data_port_ptr)(running_machine *machine, int offset);
-extern void (*megadrive_io_write_data_port_ptr)(running_machine *machine, int offset, UINT16 data);
+extern UINT8 (*megadrive_io_read_data_port_ptr)(running_machine &machine, int offset);
+extern void (*megadrive_io_write_data_port_ptr)(running_machine &machine, int offset, UINT16 data);
extern UINT8 megadrive_io_data_regs[3];
extern UINT8 megadrive_io_ctrl_regs[3];
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index 9d644647371..802e2b54557 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -93,4 +93,4 @@ VIDEO_START( gstrik2 );
SCREEN_UPDATE( metro );
-void metro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+void metro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index bb7def17349..f5655f0842e 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -132,7 +132,7 @@ WRITE8_HANDLER( micro3d_snd_dac_b );
READ8_HANDLER( micro3d_sound_io_r );
WRITE8_HANDLER( micro3d_sound_io_w );
-void micro3d_noise_sh_w(running_machine *machine, UINT8 data);
+void micro3d_noise_sh_w(running_machine &machine, UINT8 data);
DECLARE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound);
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 90ce638afd5..8ae6a99f78e 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -1,4 +1,4 @@
-typedef void (*tgp_func)(running_machine *machine);
+typedef void (*tgp_func)(running_machine &machine);
enum {FIFO_SIZE = 256};
enum {MAT_STACK_SIZE = 32};
@@ -103,8 +103,8 @@ ADDRESS_MAP_EXTERN( model1_vr_tgp_map, 32 );
MACHINE_START( model1 );
-void model1_vr_tgp_reset( running_machine *machine );
-void model1_tgp_reset(running_machine *machine, int swa);
+void model1_vr_tgp_reset( running_machine &machine );
+void model1_tgp_reset(running_machine &machine, int swa);
/*----------- defined in video/model1.c -----------*/
diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h
index f02f56416b2..3966a1faf64 100644
--- a/src/mame/includes/model2.h
+++ b/src/mame/includes/model2.h
@@ -73,4 +73,4 @@ public:
VIDEO_START(model2);
SCREEN_UPDATE(model2);
-void model2_3d_set_zclip( running_machine *machine, UINT8 clip );
+void model2_3d_set_zclip( running_machine &machine, UINT8 clip );
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index 05463c2310a..f688dde7136 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -103,15 +103,15 @@ public:
/*----------- defined in drivers/model3.c -----------*/
-void model3_set_irq_line(running_machine *machine, UINT8 bit, int state);
+void model3_set_irq_line(running_machine &machine, UINT8 bit, int state);
/*----------- defined in machine/model3.c -----------*/
-void model3_machine_init(running_machine *machine, int step);
-int model3_tap_read(running_machine *machine);
-void model3_tap_write(running_machine *machine, int tck, int tms, int tdi, int trst);
-void model3_tap_reset(running_machine *machine);
+void model3_machine_init(running_machine &machine, int step);
+int model3_tap_read(running_machine &machine);
+void model3_tap_write(running_machine &machine, int tck, int tms, int tdi, int trst);
+void model3_tap_reset(running_machine &machine);
READ32_HANDLER(rtc72421_r);
WRITE32_HANDLER(rtc72421_w);
@@ -133,7 +133,7 @@ SCREEN_UPDATE(model3);
WRITE64_HANDLER(real3d_cmd_w);
WRITE64_HANDLER(real3d_display_list_w);
WRITE64_HANDLER(real3d_polygon_ram_w);
-void real3d_display_list_end(running_machine *machine);
+void real3d_display_list_end(running_machine &machine);
void real3d_display_list1_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
void real3d_display_list2_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
void real3d_vrom_texture_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap);
diff --git a/src/mame/includes/moo.h b/src/mame/includes/moo.h
index fc3637286ca..eb5bbf7f1ab 100644
--- a/src/mame/includes/moo.h
+++ b/src/mame/includes/moo.h
@@ -41,8 +41,8 @@ public:
/*----------- defined in video/moo.c -----------*/
-extern void moo_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
-extern void moo_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
+extern void moo_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
+extern void moo_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
VIDEO_START(moo);
SCREEN_UPDATE(moo);
diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h
index dc29570bc98..5f3dfef2157 100644
--- a/src/mame/includes/mw8080bw.h
+++ b/src/mame/includes/mw8080bw.h
@@ -119,12 +119,12 @@ MACHINE_CONFIG_EXTERN( mw8080bw_root );
MACHINE_CONFIG_EXTERN( invaders );
extern const char layout_invaders[];
-UINT8 tornbase_get_cabinet_type(running_machine *machine);
+UINT8 tornbase_get_cabinet_type(running_machine &machine);
CUSTOM_INPUT( invaders_in1_control_r );
CUSTOM_INPUT( invaders_in2_control_r );
-int invaders_is_cabinet_cocktail(running_machine *machine);
+int invaders_is_cabinet_cocktail(running_machine &machine);
/*----------- defined in machine/mw8080bw.c -----------*/
diff --git a/src/mame/includes/mystston.h b/src/mame/includes/mystston.h
index 037fec5dd13..e19dacb9b82 100644
--- a/src/mame/includes/mystston.h
+++ b/src/mame/includes/mystston.h
@@ -35,7 +35,7 @@ public:
/*----------- defined in drivers/mystston.c -----------*/
-void mystston_on_scanline_interrupt(running_machine *machine);
+void mystston_on_scanline_interrupt(running_machine &machine);
/*----------- defined in video/mystston.c -----------*/
diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h
index 7e059b4f459..a778d6150f9 100644
--- a/src/mame/includes/n64.h
+++ b/src/mame/includes/n64.h
@@ -69,9 +69,9 @@ extern UINT32 n64_vi_vstart;
extern UINT32 n64_vi_xscale;
extern UINT32 n64_vi_yscale;
-extern void dp_full_sync(running_machine *machine);
-extern void signal_rcp_interrupt(running_machine *machine, int interrupt);
-extern void clear_rcp_interrupt(running_machine *machine, int interrupt);
+extern void dp_full_sync(running_machine &machine);
+extern void signal_rcp_interrupt(running_machine &machine, int interrupt);
+extern void clear_rcp_interrupt(running_machine &machine, int interrupt);
/* read/write handlers for the N64 subsystems */
diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h
index 93d77ca2264..c86c001f53c 100644
--- a/src/mame/includes/n8080.h
+++ b/src/mame/includes/n8080.h
@@ -57,7 +57,7 @@ SCREEN_UPDATE( sheriff );
SCREEN_UPDATE( helifire );
SCREEN_EOF( helifire );
-void spacefev_start_red_cannon(running_machine *machine);
+void spacefev_start_red_cannon(running_machine &machine);
/*----------- defined in audio/n8080.c -----------*/
diff --git a/src/mame/includes/namcoic.h b/src/mame/includes/namcoic.h
index fac5c88deaa..c742d73cfe3 100644
--- a/src/mame/includes/namcoic.h
+++ b/src/mame/includes/namcoic.h
@@ -91,8 +91,8 @@ C102 - Controls CPU access to ROZ Memory Area.
/*----------- defined in drivers/namcoic.c -----------*/
void namco_tilemap_init(
- running_machine *machine, int gfxbank, void *pMaskROM,
- void (*cb)( running_machine *machine, UINT16 code, int *gfx, int *mask) );
+ running_machine &machine, int gfxbank, void *pMaskROM,
+ void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) );
void namco_tilemap_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri );
void namco_tilemap_invalidate( void );
WRITE16_HANDLER( namco_tilemapvideoram16_w );
@@ -113,16 +113,16 @@ WRITE32_HANDLER( namco_tilemapcontrol32_le_w );
/***********************************************************************************/
/* Namco System II Sprite Rendering */
-void namcos2_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control );
+void namcos2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control );
-void namcos2_draw_sprites_metalhawk( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
+void namcos2_draw_sprites_metalhawk( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
/***********************************************************************************/
/* C355 Motion Object Emulation */
/* for palXOR, supply either 0x0 (normal) or 0xf (palette mapping reversed) */
-void namco_obj_init( running_machine *machine, int gfxbank, int palXOR, int (*code2tile)( running_machine *machine, int code ) );
-void namco_obj_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
+void namco_obj_init( running_machine &machine, int gfxbank, int palXOR, int (*code2tile)( running_machine &machine, int code ) );
+void namco_obj_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
WRITE16_HANDLER( namco_obj16_w );
READ16_HANDLER( namco_obj16_r );
@@ -141,7 +141,7 @@ READ32_HANDLER( namco_spritepos32_r );
/***********************************************************************************/
/* C169 ROZ Layer Emulation */
-void namco_roz_init( running_machine *machine, int gfxbank, const char *maskregion );
+void namco_roz_init( running_machine &machine, int gfxbank, const char *maskregion );
void namco_roz_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri );
READ16_HANDLER( namco_rozcontrol16_r );
@@ -163,9 +163,9 @@ WRITE32_HANDLER( namco_rozvideoram32_le_w );
/***********************************************************************************/
/* C45 Land (Road) Emulation */
-void namco_road_init( running_machine *machine, int gfxbank );
+void namco_road_init( running_machine &machine, int gfxbank );
void namco_road_set_transparent_color(pen_t pen);
-void namco_road_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
+void namco_road_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
READ16_HANDLER( namco_road16_r );
WRITE16_HANDLER( namco_road16_w );
diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h
index 50123d5abb3..d21c0864a8a 100644
--- a/src/mame/includes/namcos1.h
+++ b/src/mame/includes/namcos1.h
@@ -52,7 +52,7 @@ public:
/*----------- defined in drivers/namcos1.c -----------*/
-void namcos1_init_DACs(running_machine *machine);
+void namcos1_init_DACs(running_machine &machine);
/*----------- defined in machine/namcos1.c -----------*/
diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h
index c2d11bc16a4..83c72da32f5 100644
--- a/src/mame/includes/namcos2.h
+++ b/src/mame/includes/namcos2.h
@@ -108,7 +108,7 @@ extern UINT16 *namcos2_sprite_ram;
WRITE16_HANDLER( namcos2_sprite_ram_w );
READ16_HANDLER( namcos2_sprite_ram_r );
-int namcos2_GetPosIrqScanline( running_machine *machine );
+int namcos2_GetPosIrqScanline( running_machine &machine );
WRITE16_HANDLER( namcos2_gfx_ctrl_w );
READ16_HANDLER( namcos2_gfx_ctrl_r );
@@ -136,7 +136,7 @@ extern UINT16 *namcos2_68k_roz_ram;
/*----------- defined in machine/namcos2.c -----------*/
-extern void (*namcos2_kickstart)(running_machine *machine, int internal);
+extern void (*namcos2_kickstart)(running_machine &machine, int internal);
extern int namcos2_gametype;
MACHINE_START( namcos2 );
@@ -198,7 +198,7 @@ WRITE16_HANDLER( namcos2_68k_gpu_C148_w );
READ16_HANDLER( namcos2_68k_gpu_C148_r );
INTERRUPT_GEN( namcos2_68k_gpu_vblank );
-void namcos2_adjust_posirq_timer( running_machine *machine, int scanline );
+void namcos2_adjust_posirq_timer( running_machine &machine, int scanline );
/**************************************************************/
/* MASTER CPU RAM MEMORY */
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index 2211f905935..bbb8a6f9871 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -81,6 +81,6 @@ SCREEN_UPDATE( namcos22 );
VIDEO_START( namcos22s );
SCREEN_UPDATE( namcos22s );
-void namcos22_draw_direct_poly( running_machine *machine, const UINT16 *pSource );
+void namcos22_draw_direct_poly( running_machine &machine, const UINT16 *pSource );
extern UINT32 namcos22_point_rom_r( offs_t offs );
extern void namcos22_enable_slave_simulation( void );
diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h
index 5f100ff3237..32e0067e678 100644
--- a/src/mame/includes/naomi.h
+++ b/src/mame/includes/naomi.h
@@ -14,7 +14,7 @@ enum {
/*----------- defined in machine/gdcrypt.c -----------*/
-extern void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int length);
+extern void naomi_game_decrypt(running_machine& machine, UINT64 key, UINT8* region, int length);
/*----------- defined in machine/naomi.c -----------*/
diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h
index 18d9675ed8f..f18604131b0 100644
--- a/src/mame/includes/neogeo.h
+++ b/src/mame/includes/neogeo.h
@@ -113,97 +113,97 @@ public:
/*----------- defined in drivers/neogeo.c -----------*/
-void neogeo_set_display_position_interrupt_control(running_machine *machine, UINT16 data);
+void neogeo_set_display_position_interrupt_control(running_machine &machine, UINT16 data);
void neogeo_set_display_counter_msb(address_space *space, UINT16 data);
void neogeo_set_display_counter_lsb(address_space *space, UINT16 data);
-void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data);
+void neogeo_acknowledge_interrupt(running_machine &machine, UINT16 data);
void neogeo_set_main_cpu_bank_address(address_space *space, UINT32 bank_address);
READ16_HANDLER( neogeo_unmapped_r );
/*----------- defined in machine/neocrypt.c -----------*/
-void kof99_neogeo_gfx_decrypt(running_machine *machine, int extra_xor);
-void kof2000_neogeo_gfx_decrypt(running_machine *machine, int extra_xor);
-void cmc42_neogeo_gfx_decrypt(running_machine *machine, int extra_xor);
-void cmc50_neogeo_gfx_decrypt(running_machine *machine, int extra_xor);
-void neogeo_cmc50_m1_decrypt(running_machine *machine);
-void neo_pcm2_snk_1999(running_machine *machine, int value);
-void neo_pcm2_swap(running_machine *machine, int value);
-void neogeo_sfix_decrypt(running_machine *machine);
-void kof99_decrypt_68k(running_machine *machine);
-void garou_decrypt_68k(running_machine *machine);
-void garouo_decrypt_68k(running_machine *machine);
-void mslug3_decrypt_68k(running_machine *machine);
-void kof2000_decrypt_68k(running_machine *machine);
-void kof98_decrypt_68k(running_machine *machine);
-void kof2002_decrypt_68k(running_machine *machine);
-void matrim_decrypt_68k(running_machine *machine);
-void mslug5_decrypt_68k(running_machine *machine);
-void svc_px_decrypt(running_machine *machine);
-void svcpcb_gfx_decrypt(running_machine *machine);
-void svcpcb_s1data_decrypt(running_machine *machine);
-void samsho5_decrypt_68k(running_machine *machine);
-void kf2k3pcb_gfx_decrypt(running_machine *machine);
-void kf2k3pcb_decrypt_68k(running_machine *machine);
-void kf2k3pcb_decrypt_s1data(running_machine *machine);
-void kof2003_decrypt_68k(running_machine *machine);
-void kof2003h_decrypt_68k(running_machine *machine);
-void kof2003biosdecode(running_machine *machine);
-void samsh5sp_decrypt_68k(running_machine *machine);
+void kof99_neogeo_gfx_decrypt(running_machine &machine, int extra_xor);
+void kof2000_neogeo_gfx_decrypt(running_machine &machine, int extra_xor);
+void cmc42_neogeo_gfx_decrypt(running_machine &machine, int extra_xor);
+void cmc50_neogeo_gfx_decrypt(running_machine &machine, int extra_xor);
+void neogeo_cmc50_m1_decrypt(running_machine &machine);
+void neo_pcm2_snk_1999(running_machine &machine, int value);
+void neo_pcm2_swap(running_machine &machine, int value);
+void neogeo_sfix_decrypt(running_machine &machine);
+void kof99_decrypt_68k(running_machine &machine);
+void garou_decrypt_68k(running_machine &machine);
+void garouo_decrypt_68k(running_machine &machine);
+void mslug3_decrypt_68k(running_machine &machine);
+void kof2000_decrypt_68k(running_machine &machine);
+void kof98_decrypt_68k(running_machine &machine);
+void kof2002_decrypt_68k(running_machine &machine);
+void matrim_decrypt_68k(running_machine &machine);
+void mslug5_decrypt_68k(running_machine &machine);
+void svc_px_decrypt(running_machine &machine);
+void svcpcb_gfx_decrypt(running_machine &machine);
+void svcpcb_s1data_decrypt(running_machine &machine);
+void samsho5_decrypt_68k(running_machine &machine);
+void kf2k3pcb_gfx_decrypt(running_machine &machine);
+void kf2k3pcb_decrypt_68k(running_machine &machine);
+void kf2k3pcb_decrypt_s1data(running_machine &machine);
+void kof2003_decrypt_68k(running_machine &machine);
+void kof2003h_decrypt_68k(running_machine &machine);
+void kof2003biosdecode(running_machine &machine);
+void samsh5sp_decrypt_68k(running_machine &machine);
/*----------- defined in machine/neoprot.c -----------*/
-void neogeo_reset_rng(running_machine *machine);
-void fatfury2_install_protection(running_machine *machine);
-void mslugx_install_protection(running_machine *machine);
-void kof99_install_protection(running_machine *machine);
-void garou_install_protection(running_machine *machine);
-void garouo_install_protection(running_machine *machine);
-void mslug3_install_protection(running_machine *machine);
-void kof2000_install_protection(running_machine *machine);
-void install_kof98_protection(running_machine *machine);
-void install_pvc_protection(running_machine *machine);
+void neogeo_reset_rng(running_machine &machine);
+void fatfury2_install_protection(running_machine &machine);
+void mslugx_install_protection(running_machine &machine);
+void kof99_install_protection(running_machine &machine);
+void garou_install_protection(running_machine &machine);
+void garouo_install_protection(running_machine &machine);
+void mslug3_install_protection(running_machine &machine);
+void kof2000_install_protection(running_machine &machine);
+void install_kof98_protection(running_machine &machine);
+void install_pvc_protection(running_machine &machine);
/*----------- defined in machine/neoboot.c -----------*/
-void kog_px_decrypt(running_machine *machine);
-void neogeo_bootleg_cx_decrypt(running_machine *machine);
-void install_kof10th_protection(running_machine *machine);
-void decrypt_kof10th(running_machine *machine);
-void decrypt_kf10thep(running_machine *machine);
-void decrypt_kf2k5uni(running_machine *machine);
-void neogeo_bootleg_sx_decrypt(running_machine *machine, int value);
-void kof2002b_gfx_decrypt(running_machine *machine, UINT8 *src, int size);
-void kf2k2mp_decrypt(running_machine *machine);
-void kf2k2mp2_px_decrypt(running_machine *machine);
-void decrypt_cthd2003(running_machine *machine);
-void patch_cthd2003(running_machine *machine);
-void decrypt_ct2k3sp(running_machine *machine);
-void decrypt_ct2k3sa(running_machine *machine);
-void patch_ct2k3sa(running_machine *machine);
-void decrypt_kof2k4se_68k(running_machine *machine);
-void lans2004_decrypt_68k(running_machine *machine);
-void lans2004_vx_decrypt(running_machine *machine);
-void install_ms5plus_protection(running_machine *machine);
-void svcboot_px_decrypt(running_machine *machine);
-void svcboot_cx_decrypt(running_machine *machine);
-void svcplus_px_decrypt(running_machine *machine);
-void svcplus_px_hack(running_machine *machine);
-void svcplusa_px_decrypt(running_machine *machine);
-void svcsplus_px_decrypt(running_machine *machine);
-void svcsplus_px_hack(running_machine *machine);
-void kf2k3bl_px_decrypt(running_machine *machine);
-void kf2k3bl_install_protection(running_machine *machine);
-void kf2k3pl_px_decrypt(running_machine *machine);
-void kf2k3upl_px_decrypt(running_machine *machine);
-void kf2k3upl_install_protection(running_machine *machine);
-void kf2k3pl_install_protection(running_machine *machine);
-void samsho5b_px_decrypt(running_machine *machine);
-void samsho5b_vx_decrypt(running_machine *machine);
-void matrimbl_decrypt(running_machine *machine);
+void kog_px_decrypt(running_machine &machine);
+void neogeo_bootleg_cx_decrypt(running_machine &machine);
+void install_kof10th_protection(running_machine &machine);
+void decrypt_kof10th(running_machine &machine);
+void decrypt_kf10thep(running_machine &machine);
+void decrypt_kf2k5uni(running_machine &machine);
+void neogeo_bootleg_sx_decrypt(running_machine &machine, int value);
+void kof2002b_gfx_decrypt(running_machine &machine, UINT8 *src, int size);
+void kf2k2mp_decrypt(running_machine &machine);
+void kf2k2mp2_px_decrypt(running_machine &machine);
+void decrypt_cthd2003(running_machine &machine);
+void patch_cthd2003(running_machine &machine);
+void decrypt_ct2k3sp(running_machine &machine);
+void decrypt_ct2k3sa(running_machine &machine);
+void patch_ct2k3sa(running_machine &machine);
+void decrypt_kof2k4se_68k(running_machine &machine);
+void lans2004_decrypt_68k(running_machine &machine);
+void lans2004_vx_decrypt(running_machine &machine);
+void install_ms5plus_protection(running_machine &machine);
+void svcboot_px_decrypt(running_machine &machine);
+void svcboot_cx_decrypt(running_machine &machine);
+void svcplus_px_decrypt(running_machine &machine);
+void svcplus_px_hack(running_machine &machine);
+void svcplusa_px_decrypt(running_machine &machine);
+void svcsplus_px_decrypt(running_machine &machine);
+void svcsplus_px_hack(running_machine &machine);
+void kf2k3bl_px_decrypt(running_machine &machine);
+void kf2k3bl_install_protection(running_machine &machine);
+void kf2k3pl_px_decrypt(running_machine &machine);
+void kf2k3upl_px_decrypt(running_machine &machine);
+void kf2k3upl_install_protection(running_machine &machine);
+void kf2k3pl_install_protection(running_machine &machine);
+void samsho5b_px_decrypt(running_machine &machine);
+void samsho5b_vx_decrypt(running_machine &machine);
+void matrimbl_decrypt(running_machine &machine);
/*----------- defined in video/neogeo.c -----------*/
@@ -215,11 +215,11 @@ SCREEN_UPDATE( neogeo );
READ16_HANDLER( neogeo_video_register_r );
WRITE16_HANDLER( neogeo_video_register_w );
-void neogeo_set_palette_bank(running_machine *machine, UINT8 data);
-void neogeo_set_screen_dark(running_machine *machine, UINT8 data);
+void neogeo_set_palette_bank(running_machine &machine, UINT8 data);
+void neogeo_set_screen_dark(running_machine &machine, UINT8 data);
READ16_HANDLER( neogeo_paletteram_r );
WRITE16_HANDLER( neogeo_paletteram_w );
-void neogeo_set_fixed_layer_source(running_machine *machine, UINT8 data);
+void neogeo_set_fixed_layer_source(running_machine &machine, UINT8 data);
-UINT8 neogeo_get_auto_animation_counter(running_machine *machine);
+UINT8 neogeo_get_auto_animation_counter(running_machine &machine);
diff --git a/src/mame/includes/opwolf.h b/src/mame/includes/opwolf.h
index e013055f703..ff489003ebd 100644
--- a/src/mame/includes/opwolf.h
+++ b/src/mame/includes/opwolf.h
@@ -50,7 +50,7 @@ public:
/*----------- defined in machine/opwolf.c -----------*/
-void opwolf_cchip_init(running_machine *machine);
+void opwolf_cchip_init(running_machine &machine);
READ16_HANDLER( opwolf_cchip_status_r );
READ16_HANDLER( opwolf_cchip_data_r );
diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h
index cf73da3db0a..2d48b509e22 100644
--- a/src/mame/includes/overdriv.h
+++ b/src/mame/includes/overdriv.h
@@ -33,8 +33,8 @@ public:
/*----------- defined in video/overdriv.c -----------*/
-extern void overdriv_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
-extern void overdriv_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags);
-extern void overdriv_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags);
+extern void overdriv_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
+extern void overdriv_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags);
+extern void overdriv_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags);
SCREEN_UPDATE( overdriv );
diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h
index 5a7ab224762..03b91c9244c 100644
--- a/src/mame/includes/pacman.h
+++ b/src/mame/includes/pacman.h
@@ -70,12 +70,12 @@ WRITE8_HANDLER( jrpacman_bgpriority_w );
/*----------- defined in machine/pacplus.c -----------*/
-void pacplus_decode(running_machine *machine);
+void pacplus_decode(running_machine &machine);
/*----------- defined in machine/jumpshot.c -----------*/
-void jumpshot_decode(running_machine *machine);
+void jumpshot_decode(running_machine &machine);
/*----------- defined in machine/theglobp.c -----------*/
diff --git a/src/mame/includes/parodius.h b/src/mame/includes/parodius.h
index 184bbed4fa1..c978c888654 100644
--- a/src/mame/includes/parodius.h
+++ b/src/mame/includes/parodius.h
@@ -33,7 +33,7 @@ public:
/*----------- defined in video/parodius.c -----------*/
-extern void parodius_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void parodius_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+extern void parodius_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void parodius_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
SCREEN_UPDATE( parodius );
diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h
index 6b51524f75c..808f8190f50 100644
--- a/src/mame/includes/pgm.h
+++ b/src/mame/includes/pgm.h
@@ -74,27 +74,27 @@ extern UINT16 *pgm_mainram; // used by nvram handler, we cannot move it to drive
/*----------- defined in machine/pgmcrypt.c -----------*/
-void pgm_kov_decrypt(running_machine *machine);
-void pgm_kovsh_decrypt(running_machine *machine);
-void pgm_kov2_decrypt(running_machine *machine);
-void pgm_kov2p_decrypt(running_machine *machine);
-void pgm_mm_decrypt(running_machine *machine);
-void pgm_dw2_decrypt(running_machine *machine);
-void pgm_photoy2k_decrypt(running_machine *machine);
-void pgm_py2k2_decrypt(running_machine *machine);
-void pgm_dw3_decrypt(running_machine *machine);
-void pgm_killbld_decrypt(running_machine *machine);
-void pgm_pstar_decrypt(running_machine *machine);
-void pgm_puzzli2_decrypt(running_machine *machine);
-void pgm_theglad_decrypt(running_machine *machine);
-void pgm_ddp2_decrypt(running_machine *machine);
-void pgm_dfront_decrypt(running_machine *machine);
-void pgm_oldsplus_decrypt(running_machine *machine);
-void pgm_kovshp_decrypt(running_machine *machine);
-void pgm_killbldp_decrypt(running_machine *machine);
-void pgm_svg_decrypt(running_machine *machine);
-void pgm_ket_decrypt(running_machine *machine);
-void pgm_espgal_decrypt(running_machine *machine);
+void pgm_kov_decrypt(running_machine &machine);
+void pgm_kovsh_decrypt(running_machine &machine);
+void pgm_kov2_decrypt(running_machine &machine);
+void pgm_kov2p_decrypt(running_machine &machine);
+void pgm_mm_decrypt(running_machine &machine);
+void pgm_dw2_decrypt(running_machine &machine);
+void pgm_photoy2k_decrypt(running_machine &machine);
+void pgm_py2k2_decrypt(running_machine &machine);
+void pgm_dw3_decrypt(running_machine &machine);
+void pgm_killbld_decrypt(running_machine &machine);
+void pgm_pstar_decrypt(running_machine &machine);
+void pgm_puzzli2_decrypt(running_machine &machine);
+void pgm_theglad_decrypt(running_machine &machine);
+void pgm_ddp2_decrypt(running_machine &machine);
+void pgm_dfront_decrypt(running_machine &machine);
+void pgm_oldsplus_decrypt(running_machine &machine);
+void pgm_kovshp_decrypt(running_machine &machine);
+void pgm_killbldp_decrypt(running_machine &machine);
+void pgm_svg_decrypt(running_machine &machine);
+void pgm_ket_decrypt(running_machine &machine);
+void pgm_espgal_decrypt(running_machine &machine);
/*----------- defined in machine/pgmprot.c -----------*/
diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h
index c02731f86c3..37ec23524c6 100644
--- a/src/mame/includes/polyplay.h
+++ b/src/mame/includes/polyplay.h
@@ -28,10 +28,10 @@ public:
/*----------- defined in audio/polyplay.c -----------*/
-void polyplay_set_channel1(running_machine *machine, int active);
-void polyplay_set_channel2(running_machine *machine, int active);
-void polyplay_play_channel1(running_machine *machine, int data);
-void polyplay_play_channel2(running_machine *machine, int data);
+void polyplay_set_channel1(running_machine &machine, int active);
+void polyplay_set_channel2(running_machine &machine, int active);
+void polyplay_play_channel1(running_machine &machine, int data);
+void polyplay_play_channel2(running_machine &machine, int data);
SAMPLES_START( polyplay_sh_start );
diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h
index e3dbf5538bf..8e580f5d5e1 100644
--- a/src/mame/includes/psikyo.h
+++ b/src/mame/includes/psikyo.h
@@ -46,7 +46,7 @@ public:
/*----------- defined in video/psikyo.c -----------*/
-void psikyo_switch_banks(running_machine *machine, int tmap, int bank);
+void psikyo_switch_banks(running_machine &machine, int tmap, int bank);
WRITE32_HANDLER( psikyo_vram_0_w );
WRITE32_HANDLER( psikyo_vram_1_w );
diff --git a/src/mame/includes/psx.h b/src/mame/includes/psx.h
index f3746602891..8bcebced7c5 100644
--- a/src/mame/includes/psx.h
+++ b/src/mame/includes/psx.h
@@ -35,9 +35,9 @@
#define PSX_SIO_IN_DSR ( 2 ) /* ACK */
#define PSX_SIO_IN_CTS ( 4 )
-typedef void ( *psx_dma_read_handler )( running_machine *, UINT32, INT32 );
-typedef void ( *psx_dma_write_handler )( running_machine *, UINT32, INT32 );
-typedef void ( *psx_sio_handler )( running_machine *, int );
+typedef void ( *psx_dma_read_handler )( running_machine &, UINT32, INT32 );
+typedef void ( *psx_dma_write_handler )( running_machine &, UINT32, INT32 );
+typedef void ( *psx_sio_handler )( running_machine &, int );
typedef struct _psx_machine psx_machine;
typedef struct _psx_gpu psx_gpu;
@@ -63,12 +63,12 @@ VIDEO_START( psx_type1 );
VIDEO_START( psx_type2 );
SCREEN_UPDATE( psx );
INTERRUPT_GEN( psx_vblank );
-extern void psx_gpu_reset( running_machine *machine );
-extern void psx_gpu_read( running_machine *, UINT32 *p_ram, INT32 n_size );
-extern void psx_gpu_write( running_machine *, UINT32 *p_ram, INT32 n_size );
+extern void psx_gpu_reset( running_machine &machine );
+extern void psx_gpu_read( running_machine &, UINT32 *p_ram, INT32 n_size );
+extern void psx_gpu_write( running_machine &, UINT32 *p_ram, INT32 n_size );
READ32_HANDLER( psx_gpu_r );
WRITE32_HANDLER( psx_gpu_w );
-extern void psx_lightgun_set( running_machine *, int, int );
+extern void psx_lightgun_set( running_machine &, int, int );
/*----------- defined in machine/psx.c -----------*/
@@ -76,22 +76,22 @@ WRITE32_HANDLER( psx_com_delay_w );
READ32_HANDLER( psx_com_delay_r );
WRITE32_HANDLER( psx_irq_w );
READ32_HANDLER( psx_irq_r );
-extern void psx_irq_set( running_machine *, UINT32 );
-extern void psx_dma_install_read_handler( running_machine *, int, psx_dma_read_handler );
-extern void psx_dma_install_write_handler( running_machine *, int, psx_dma_read_handler );
+extern void psx_irq_set( running_machine &, UINT32 );
+extern void psx_dma_install_read_handler( running_machine &, int, psx_dma_read_handler );
+extern void psx_dma_install_write_handler( running_machine &, int, psx_dma_read_handler );
WRITE32_HANDLER( psx_dma_w );
READ32_HANDLER( psx_dma_r );
WRITE32_HANDLER( psx_counter_w );
READ32_HANDLER( psx_counter_r );
WRITE32_HANDLER( psx_sio_w );
READ32_HANDLER( psx_sio_r );
-extern void psx_sio_install_handler( running_machine *, int, psx_sio_handler );
-extern void psx_sio_input( running_machine *, int, int, int );
+extern void psx_sio_install_handler( running_machine &, int, psx_sio_handler );
+extern void psx_sio_input( running_machine &, int, int, int );
WRITE32_HANDLER( psx_mdec_w );
READ32_HANDLER( psx_mdec_r );
-extern void psx_machine_init( running_machine *machine );
-extern void psx_driver_init( running_machine *machine );
+extern void psx_machine_init( running_machine &machine );
+extern void psx_driver_init( running_machine &machine );
#define PSX_H ( 1 )
#endif
diff --git a/src/mame/includes/qdrmfgp.h b/src/mame/includes/qdrmfgp.h
index dbd16cd3b69..c68102bce1a 100644
--- a/src/mame/includes/qdrmfgp.h
+++ b/src/mame/includes/qdrmfgp.h
@@ -19,5 +19,5 @@ VIDEO_START( qdrmfgp );
VIDEO_START( qdrmfgp2 );
SCREEN_UPDATE( qdrmfgp );
-void qdrmfgp_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
-void qdrmfgp2_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+void qdrmfgp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
+void qdrmfgp2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
diff --git a/src/mame/includes/raiden2.h b/src/mame/includes/raiden2.h
index d05462dafe6..a73f7a4552e 100644
--- a/src/mame/includes/raiden2.h
+++ b/src/mame/includes/raiden2.h
@@ -109,13 +109,13 @@ public:
UINT16 cop_hit_status;
- void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask );
- UINT8 cop_calculate_collsion_detection(running_machine *machine);
+ void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask );
+ UINT8 cop_calculate_collsion_detection(running_machine &machine);
};
/*----------- defined in machine/r2crypt.c -----------*/
-void raiden2_decrypt_sprites(running_machine *machine);
-void zeroteam_decrypt_sprites(running_machine *machine);
+void raiden2_decrypt_sprites(running_machine &machine);
+void zeroteam_decrypt_sprites(running_machine &machine);
diff --git a/src/mame/includes/rainbow.h b/src/mame/includes/rainbow.h
index 8bb1664732e..05c87b63fcc 100644
--- a/src/mame/includes/rainbow.h
+++ b/src/mame/includes/rainbow.h
@@ -37,7 +37,7 @@ public:
/*----------- defined in machine/rainbow.c -----------*/
-void rainbow_cchip_init(running_machine *machine, int version);
+void rainbow_cchip_init(running_machine &machine, int version);
READ16_HANDLER( rainbow_cchip_ctrl_r );
READ16_HANDLER( rainbow_cchip_ram_r );
WRITE16_HANDLER( rainbow_cchip_ctrl_w );
diff --git a/src/mame/includes/rockrage.h b/src/mame/includes/rockrage.h
index a5776c9b322..70f6f353e03 100644
--- a/src/mame/includes/rockrage.h
+++ b/src/mame/includes/rockrage.h
@@ -31,5 +31,5 @@ WRITE8_HANDLER( rockrage_vreg_w );
SCREEN_UPDATE( rockrage );
PALETTE_INIT( rockrage );
-void rockrage_tile_callback(running_machine *machine, int layer, int bank, int *code, int *color, int *flags);
-void rockrage_sprite_callback(running_machine *machine, int *code, int *color);
+void rockrage_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags);
+void rockrage_sprite_callback(running_machine &machine, int *code, int *color);
diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h
index 95c9063b31f..28a2736bfad 100644
--- a/src/mame/includes/rollerg.h
+++ b/src/mame/includes/rollerg.h
@@ -29,8 +29,8 @@ public:
/*----------- defined in video/rollerg.c -----------*/
-extern void rollerg_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
-extern void rollerg_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
+extern void rollerg_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
+extern void rollerg_zoom_callback(running_machine &machine, int *code,int *color,int *flags);
VIDEO_START( rollerg );
SCREEN_UPDATE( rollerg );
diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h
index 44e1899b195..93d8bcf576f 100644
--- a/src/mame/includes/rungun.h
+++ b/src/mame/includes/rungun.h
@@ -39,7 +39,7 @@ public:
/*----------- defined in video/rungun.c -----------*/
-extern void rng_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
+extern void rng_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
READ16_HANDLER( rng_ttl_ram_r );
WRITE16_HANDLER( rng_ttl_ram_w );
diff --git a/src/mame/includes/segamsys.h b/src/mame/includes/segamsys.h
index 3031cc7338a..f95a1c03d5e 100644
--- a/src/mame/includes/segamsys.h
+++ b/src/mame/includes/segamsys.h
@@ -24,7 +24,7 @@ extern WRITE8_HANDLER( sms_vdp_data_w );
extern READ8_HANDLER( sms_vdp_ctrl_r );
extern WRITE8_HANDLER( sms_vdp_ctrl_w );
-extern void init_for_megadrive(running_machine *machine);
+extern void init_for_megadrive(running_machine &machine);
extern void segae_md_sms_stop_scanline_timer(void);
@@ -56,7 +56,7 @@ READ8_HANDLER (megatech_sms_ioport_dc_r);
READ8_HANDLER (megatech_sms_ioport_dd_r);
READ8_HANDLER( smsgg_backupram_r );
WRITE8_HANDLER( smsgg_backupram_w );
-extern void megatech_set_genz80_as_sms_standard_map(running_machine *machine, const char* tag, int mapper);
+extern void megatech_set_genz80_as_sms_standard_map(running_machine &machine, const char* tag, int mapper);
MACHINE_CONFIG_EXTERN(sms);
extern DRIVER_INIT(sms);
extern DRIVER_INIT(smspal);
diff --git a/src/mame/includes/segas16.h b/src/mame/includes/segas16.h
index 14876b1570a..da7bbac1ccc 100644
--- a/src/mame/includes/segas16.h
+++ b/src/mame/includes/segas16.h
@@ -29,7 +29,7 @@ public:
UINT8 vblank_irq_state; // segaorun, segaxbd & segaybd
UINT8 misc_io_data[0x10]; // system18 & segaybd
- void (*i8751_vblank_hook)(running_machine *machine);
+ void (*i8751_vblank_hook)(running_machine &machine);
const UINT8 *i8751_initial_config;
read16_space_func custom_io_r;
@@ -51,7 +51,7 @@ public:
UINT8 last_buttons2;
int read_port;
- void (*lamp_changed_w)(running_machine *machine, UINT8 changed, UINT8 newval);
+ void (*lamp_changed_w)(running_machine &machine, UINT8 changed, UINT8 newval);
/* misc system 18 */
UINT8 mcu_data;
@@ -121,9 +121,9 @@ SCREEN_UPDATE( system16b );
VIDEO_START( system18 );
SCREEN_UPDATE( system18 );
-void system18_set_grayscale(running_machine *machine, int enable);
-void system18_set_vdp_enable(running_machine *machine, int eanble);
-void system18_set_vdp_mixing(running_machine *machine, int mixing);
+void system18_set_grayscale(running_machine &machine, int enable);
+void system18_set_vdp_enable(running_machine &machine, int eanble);
+void system18_set_vdp_mixing(running_machine &machine, int mixing);
/*----------- defined in video/segaorun.c -----------*/
@@ -147,4 +147,4 @@ SCREEN_UPDATE( yboard );
void *fd1094_get_decrypted_base(void);
void fd1094_machine_init(device_t *device);
-void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *));
+void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_decrypted)(running_machine &, UINT8 *));
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index bc0cfaa4620..ddcb9b73d64 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -35,8 +35,8 @@ public:
timer_device *irq_timer_clear;
int turns;
UINT16 *system24temp_sys16_shared_ram;
- UINT8 (*system24temp_sys16_io_io_r)(running_machine *machine, int port);
- void (*system24temp_sys16_io_io_w)(running_machine *machine, int port, UINT8 data);
+ UINT8 (*system24temp_sys16_io_io_r)(running_machine &machine, int port);
+ void (*system24temp_sys16_io_io_w)(running_machine &machine, int port, UINT8 data);
void (*system24temp_sys16_io_cnt_w)(address_space *space, UINT8 data);
read16_space_func system24temp_sys16_io_iod_r;
write16_space_func system24temp_sys16_io_iod_w;
@@ -55,9 +55,9 @@ public:
/* New Code */
void system24temp_sys16_io_set_callbacks(
- running_machine *machine,
- UINT8 (*io_r)(running_machine *machine, int port),
- void (*io_w)(running_machine *machine, int port, UINT8 data),
+ running_machine &machine,
+ UINT8 (*io_r)(running_machine &machine, int port),
+ void (*io_w)(running_machine &machine, int port, UINT8 data),
void (*cnt_w)(address_space *space, UINT8 data),
read16_space_func iod_r,
write16_space_func iod_w);
@@ -71,8 +71,8 @@ READ32_HANDLER ( system24temp_sys16_io_dword_r );
/*----------- defined in machine/s24fd.c -----------*/
-extern void s24_fd1094_machine_init(running_machine *machine);
-extern void s24_fd1094_driver_init(running_machine *machine);
+extern void s24_fd1094_machine_init(running_machine &machine);
+extern void s24_fd1094_driver_init(running_machine &machine);
/*----------- defined in video/segas24.c -----------*/
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index d2458360895..e136e229bd1 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -78,7 +78,7 @@ READ16_HANDLER( dbzvrvs_protection_r );
WRITE16_HANDLER( dbzvrvs_protection_w );
extern const UINT8 ga2_v25_opcode_table[];
-void decrypt_ga2_protrom(running_machine *machine);
+void decrypt_ga2_protrom(running_machine &machine);
READ16_HANDLER( ga2_dpram_r );
WRITE16_HANDLER( ga2_dpram_w );
@@ -94,7 +94,7 @@ VIDEO_START(system32);
VIDEO_START(multi32);
SCREEN_UPDATE(system32);
SCREEN_UPDATE(multi32);
-void system32_set_vblank(running_machine *machine, int state);
+void system32_set_vblank(running_machine &machine, int state);
READ16_HANDLER( system32_videoram_r );
WRITE16_HANDLER( system32_videoram_w );
diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h
index 83d38ac7fdf..b37e82c7504 100644
--- a/src/mame/includes/seibuspi.h
+++ b/src/mame/includes/seibuspi.h
@@ -63,7 +63,7 @@ READ32_HANDLER( spi_layer_bank_r );
WRITE32_HANDLER( spi_layer_bank_w );
WRITE32_HANDLER( spi_layer_enable_w );
-void rf2_set_layer_banks(running_machine *machine, int banks);
+void rf2_set_layer_banks(running_machine &machine, int banks);
WRITE32_HANDLER( tilemap_dma_start_w );
WRITE32_HANDLER( palette_dma_start_w );
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index cd3164c8fad..63df77f42ed 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -88,7 +88,7 @@ public:
/*----------- defined in video/seta.c -----------*/
-void seta_coin_lockout_w(running_machine *machine, int data);
+void seta_coin_lockout_w(running_machine &machine, int data);
WRITE16_HANDLER( twineagl_tilebank_w );
diff --git a/src/mame/includes/simpsons.h b/src/mame/includes/simpsons.h
index 765bfc3952c..3e18c1724c9 100644
--- a/src/mame/includes/simpsons.h
+++ b/src/mame/includes/simpsons.h
@@ -40,8 +40,8 @@ MACHINE_START( simpsons );
/*----------- defined in video/simpsons.c -----------*/
-void simpsons_video_banking( running_machine *machine, int select );
+void simpsons_video_banking( running_machine &machine, int select );
SCREEN_UPDATE( simpsons );
-extern void simpsons_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void simpsons_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+extern void simpsons_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void simpsons_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h
index 451eb6f6866..13718a0be5d 100644
--- a/src/mame/includes/skullxbo.h
+++ b/src/mame/includes/skullxbo.h
@@ -24,4 +24,4 @@ WRITE16_HANDLER( skullxbo_mobmsb_w );
VIDEO_START( skullxbo );
SCREEN_UPDATE( skullxbo );
-void skullxbo_scanline_update(running_machine *machine, int param);
+void skullxbo_scanline_update(running_machine &machine, int param);
diff --git a/src/mame/includes/slapstic.h b/src/mame/includes/slapstic.h
index 4ecd3c88a45..4caa8ab3a35 100644
--- a/src/mame/includes/slapstic.h
+++ b/src/mame/includes/slapstic.h
@@ -11,7 +11,7 @@
/*----------- defined in machine/slapstic.c -----------*/
-void slapstic_init(running_machine *machine, int chip);
+void slapstic_init(running_machine &machine, int chip);
void slapstic_reset(void);
int slapstic_bank(void);
diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h
index 8a4df9c0f76..b066c3154bf 100644
--- a/src/mame/includes/snes.h
+++ b/src/mame/includes/snes.h
@@ -398,8 +398,8 @@ struct snes_superscope
int offscreen;
};
-typedef void (*snes_io_read)(running_machine *machine);
-typedef UINT8 (*snes_oldjoy_read)(running_machine *machine);
+typedef void (*snes_io_read)(running_machine &machine);
+typedef UINT8 (*snes_oldjoy_read)(running_machine &machine);
class snes_state : public driver_device
{
@@ -669,7 +669,7 @@ extern struct snes_cart_info snes_cart;
extern struct SNES_PPU_STRUCT snes_ppu;
-extern void snes_latch_counters(running_machine *machine);
+extern void snes_latch_counters(running_machine &machine);
extern VIDEO_START( snes );
extern SCREEN_UPDATE( snes );
diff --git a/src/mame/includes/snk6502.h b/src/mame/includes/snk6502.h
index 3d4537afc88..e53611166ef 100644
--- a/src/mame/includes/snk6502.h
+++ b/src/mame/includes/snk6502.h
@@ -54,9 +54,9 @@ extern WRITE8_HANDLER( fantasy_speech_w );
DECLARE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound);
-void snk6502_set_music_clock(running_machine *machine, double clock_time);
-void snk6502_set_music_freq(running_machine *machine, int freq);
-int snk6502_music0_playing(running_machine *machine);
+void snk6502_set_music_clock(running_machine &machine, double clock_time);
+void snk6502_set_music_freq(running_machine &machine, int freq);
+int snk6502_music0_playing(running_machine &machine);
DISCRETE_SOUND_EXTERN( fantasy );
diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h
index d80ef8f94f1..e2ee61717e9 100644
--- a/src/mame/includes/sprint8.h
+++ b/src/mame/includes/sprint8.h
@@ -25,7 +25,7 @@ public:
/*----------- defined in drivers/sprint8.c -----------*/
-void sprint8_set_collision(running_machine *machine, int n);
+void sprint8_set_collision(running_machine &machine, int n);
/*----------- defined in video/sprint8.c -----------*/
diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h
index aa79648a28f..4165d99271a 100644
--- a/src/mame/includes/spy.h
+++ b/src/mame/includes/spy.h
@@ -35,8 +35,8 @@ public:
/*----------- defined in video/spy.c -----------*/
-extern void spy_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void spy_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void spy_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void spy_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
VIDEO_START( spy );
SCREEN_UPDATE( spy );
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index 776b52a2fdf..5ce47c6c258 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -57,7 +57,7 @@ READ16_HANDLER( ssv_vblank_r );
WRITE16_HANDLER( ssv_scroll_w );
WRITE16_HANDLER( paletteram16_xrgb_swap_word_w );
WRITE16_HANDLER( gdfs_tmapram_w );
-void ssv_enable_video(running_machine *machine, int enable);
+void ssv_enable_video(running_machine &machine, int enable);
VIDEO_START( ssv );
VIDEO_START( eaglshot );
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 85bc429fe84..0a115320a79 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -52,8 +52,8 @@ CUSTOM_INPUT( matrix_flag_r );
READ8_HANDLER( starwars_adc_r );
WRITE8_HANDLER( starwars_adc_select_w );
-void starwars_mproc_init(running_machine *machine);
-void starwars_mproc_reset(running_machine *machine);
+void starwars_mproc_init(running_machine &machine);
+void starwars_mproc_reset(running_machine &machine);
READ8_HANDLER( starwars_prng_r );
READ8_HANDLER( starwars_div_reh_r );
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 604e954a8dc..550b7b177d8 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -17,7 +17,7 @@ DRIVER_INIT ( stv );
/*----------- defined in drivers/stvinit.c -----------*/
-void install_stvbios_speedups(running_machine *machine);
+void install_stvbios_speedups(running_machine &machine);
DRIVER_INIT(mausuke);
DRIVER_INIT(puyosun);
DRIVER_INIT(shienryu);
@@ -66,8 +66,8 @@ extern int stv_framebuffer_double_interlace;
extern int stv_framebuffer_mode;
extern UINT8* stv_vdp1_gfx_decode;
-int stv_vdp1_start ( running_machine *machine );
-void video_update_vdp1(running_machine *machine);
+int stv_vdp1_start ( running_machine &machine );
+void video_update_vdp1(running_machine &machine);
READ32_HANDLER( stv_vdp1_regs_r );
WRITE32_HANDLER( stv_vdp1_regs_w );
@@ -84,7 +84,7 @@ extern UINT32* stv_vdp2_vram;
extern int stv_vblank,stv_hblank;
extern UINT32* stv_vdp2_cram;
-UINT8 stv_get_vblank(running_machine *machine);
+UINT8 stv_get_vblank(running_machine &machine);
WRITE32_HANDLER ( stv_vdp2_vram_w );
READ32_HANDLER ( stv_vdp2_vram_r );
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index 7af45dacbfa..c399a77b9fa 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -17,7 +17,7 @@ extern UINT32 *skns_pal_regs, *skns_v3_regs, *skns_spc_regs;
void skns_sprite_kludge(int x, int y);
void skns_draw_sprites(
- running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+ running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
UINT32* spriteram_source, size_t spriteram_size,
UINT8* gfx_source, size_t gfx_length,
UINT32* sprite_regs );
diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h
index 17755f38bd7..f20c53b2a0c 100644
--- a/src/mame/includes/suprridr.h
+++ b/src/mame/includes/suprridr.h
@@ -33,7 +33,7 @@ WRITE8_HANDLER( suprridr_flipy_w );
WRITE8_HANDLER( suprridr_fgdisable_w );
WRITE8_HANDLER( suprridr_fgscrolly_w );
WRITE8_HANDLER( suprridr_bgscrolly_w );
-int suprridr_is_screen_flipped(running_machine *machine);
+int suprridr_is_screen_flipped(running_machine &machine);
WRITE8_HANDLER( suprridr_fgram_w );
WRITE8_HANDLER( suprridr_bgram_w );
diff --git a/src/mame/includes/surpratk.h b/src/mame/includes/surpratk.h
index 0b8e9ded689..18860e1ac39 100644
--- a/src/mame/includes/surpratk.h
+++ b/src/mame/includes/surpratk.h
@@ -30,7 +30,7 @@ public:
/*----------- defined in video/surpratk.c -----------*/
-extern void surpratk_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void surpratk_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+extern void surpratk_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void surpratk_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
SCREEN_UPDATE( surpratk );
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index fde3b9dcd62..76531fd4a4c 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -5,7 +5,7 @@ public:
: driver_device(machine, config) { }
UINT8 *videoram;
- void (*videomode_custom)(running_machine *machine, UINT8 data, UINT8 prevdata);
+ void (*videomode_custom)(running_machine &machine, UINT8 data, UINT8 prevdata);
UINT8 mute_xor;
UINT8 *ram;
UINT8 dakkochn_mux_data;
diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h
index 28bbfe29f0d..b0f80011861 100644
--- a/src/mame/includes/tail2nos.h
+++ b/src/mame/includes/tail2nos.h
@@ -30,7 +30,7 @@ public:
/*----------- defined in video/tail2nos.c -----------*/
-extern void tail2nos_zoom_callback(running_machine *machine, int *code,int *color,int *flags);
+extern void tail2nos_zoom_callback(running_machine &machine, int *code,int *color,int *flags);
WRITE16_HANDLER( tail2nos_bgvideoram_w );
READ16_HANDLER( tail2nos_zoomdata_r );
diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h
index 4995c996dbc..27adcdf20ab 100644
--- a/src/mame/includes/taito_l.h
+++ b/src/mame/includes/taito_l.h
@@ -19,7 +19,7 @@ public:
int flipscreen;
/* misc */
- void (*current_notifier[4])(running_machine *, int);
+ void (*current_notifier[4])(running_machine &, int);
UINT8 *current_base[4];
int cur_rombank, cur_rombank2, cur_rambank[4];
@@ -60,18 +60,18 @@ SCREEN_EOF( taitol );
VIDEO_START( taitol );
SCREEN_UPDATE( taitol );
-void taitol_chardef14_m(running_machine *machine, int offset);
-void taitol_chardef15_m(running_machine *machine, int offset);
-void taitol_chardef16_m(running_machine *machine, int offset);
-void taitol_chardef17_m(running_machine *machine, int offset);
-void taitol_chardef1c_m(running_machine *machine, int offset);
-void taitol_chardef1d_m(running_machine *machine, int offset);
-void taitol_chardef1e_m(running_machine *machine, int offset);
-void taitol_chardef1f_m(running_machine *machine, int offset);
-void taitol_bg18_m(running_machine *machine, int offset);
-void taitol_bg19_m(running_machine *machine, int offset);
-void taitol_char1a_m(running_machine *machine, int offset);
-void taitol_obj1b_m(running_machine *machine, int offset);
+void taitol_chardef14_m(running_machine &machine, int offset);
+void taitol_chardef15_m(running_machine &machine, int offset);
+void taitol_chardef16_m(running_machine &machine, int offset);
+void taitol_chardef17_m(running_machine &machine, int offset);
+void taitol_chardef1c_m(running_machine &machine, int offset);
+void taitol_chardef1d_m(running_machine &machine, int offset);
+void taitol_chardef1e_m(running_machine &machine, int offset);
+void taitol_chardef1f_m(running_machine &machine, int offset);
+void taitol_bg18_m(running_machine &machine, int offset);
+void taitol_bg19_m(running_machine &machine, int offset);
+void taitol_char1a_m(running_machine &machine, int offset);
+void taitol_obj1b_m(running_machine &machine, int offset);
WRITE8_HANDLER( taitol_control_w );
READ8_HANDLER( taitol_control_r );
diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h
index a8c18206831..7063a33a3fb 100644
--- a/src/mame/includes/taitojc.h
+++ b/src/mame/includes/taitojc.h
@@ -63,8 +63,8 @@ READ32_HANDLER(taitojc_tile_r);
WRITE32_HANDLER(taitojc_tile_w);
READ32_HANDLER(taitojc_char_r);
WRITE32_HANDLER(taitojc_char_w);
-void taitojc_clear_frame(running_machine *machine);
-void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int length);
+void taitojc_clear_frame(running_machine &machine);
+void taitojc_render_polygons(running_machine &machine, UINT16 *polygon_fifo, int length);
VIDEO_START(taitojc);
SCREEN_UPDATE(taitojc);
diff --git a/src/mame/includes/tank8.h b/src/mame/includes/tank8.h
index a2a28856a93..9ba008507c2 100644
--- a/src/mame/includes/tank8.h
+++ b/src/mame/includes/tank8.h
@@ -49,7 +49,7 @@ DISCRETE_SOUND_EXTERN( tank8 );
/*----------- defined in drivers/tank8.c -----------*/
-void tank8_set_collision(running_machine *machine, int index);
+void tank8_set_collision(running_machine &machine, int index);
/*----------- defined in video/tank8.c -----------*/
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index 93173b1fc73..875607ab8b8 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -77,7 +77,7 @@ READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r);
READ8_DEVICE_HANDLER(tatsumi_hack_oki_r);
-void tatsumi_reset(running_machine *machine);
+void tatsumi_reset(running_machine &machine);
/*----------- defined in video/tatsumi.c -----------*/
diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h
index 5d26c96c595..bcca59844e3 100644
--- a/src/mame/includes/tecmosys.h
+++ b/src/mame/includes/tecmosys.h
@@ -41,7 +41,7 @@ public:
/*----------- defined in machine/tecmosys.c -----------*/
-void tecmosys_prot_init(running_machine *machine, int which);
+void tecmosys_prot_init(running_machine &machine, int which);
READ16_HANDLER(tecmosys_prot_status_r);
WRITE16_HANDLER(tecmosys_prot_status_w);
diff --git a/src/mame/includes/thunderx.h b/src/mame/includes/thunderx.h
index 02ccee4cbb0..601b5039a96 100644
--- a/src/mame/includes/thunderx.h
+++ b/src/mame/includes/thunderx.h
@@ -35,8 +35,8 @@ public:
/*----------- defined in video/thunderx.c -----------*/
-extern void thunderx_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void thunderx_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void thunderx_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void thunderx_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
VIDEO_START( scontra );
SCREEN_UPDATE( scontra );
diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h
index 2ba6d488714..bede042a8c8 100644
--- a/src/mame/includes/tmnt.h
+++ b/src/mame/includes/tmnt.h
@@ -55,18 +55,18 @@ public:
/*----------- defined in video/tmnt.c -----------*/
-extern void mia_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void cuebrick_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void tmnt_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void ssbl_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void blswhstl_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void mia_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void tmnt_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void punkshot_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
-extern void thndrx2_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow);
-extern void lgtnfght_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
-extern void blswhstl_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
-extern void prmrsocr_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+extern void mia_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void cuebrick_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void tmnt_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void ssbl_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void blswhstl_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void mia_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void tmnt_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void punkshot_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void thndrx2_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow);
+extern void lgtnfght_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
+extern void blswhstl_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
+extern void prmrsocr_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
WRITE16_HANDLER( tmnt_paletteram_word_w );
WRITE16_HANDLER( tmnt_0a0000_w );
diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h
index 25500ee737f..c5948e0eb5f 100644
--- a/src/mame/includes/toaplan1.h
+++ b/src/mame/includes/toaplan1.h
@@ -111,9 +111,9 @@ MACHINE_RESET( demonwld );
MACHINE_RESET( vimana );
MACHINE_RESET( zerowing ); /* hack for ZeroWing/OutZone. See video */
-void toaplan1_driver_savestate(running_machine *machine);
-void demonwld_driver_savestate(running_machine *machine);
-void vimana_driver_savestate(running_machine *machine);
+void toaplan1_driver_savestate(running_machine &machine);
+void demonwld_driver_savestate(running_machine &machine);
+void vimana_driver_savestate(running_machine &machine);
/*----------- defined in video/toaplan1.c -----------*/
diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h
index 2743bd2b2bd..fcb557f7279 100644
--- a/src/mame/includes/triplhnt.h
+++ b/src/mame/includes/triplhnt.h
@@ -41,7 +41,7 @@ public:
/*----------- defined in drivers/triplhnt.c -----------*/
-void triplhnt_set_collision(running_machine *machine, int data);
+void triplhnt_set_collision(running_machine &machine, int data);
/*----------- defined in audio/triplhnt.c -----------*/
diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h
index 06d37014a1b..51cc4dc627c 100644
--- a/src/mame/includes/tubep.h
+++ b/src/mame/includes/tubep.h
@@ -41,7 +41,7 @@ public:
/*----------- defined in video/tubep.c -----------*/
-void tubep_vblank_end(running_machine *machine);
+void tubep_vblank_end(running_machine &machine);
PALETTE_INIT( tubep );
SCREEN_UPDATE( tubep );
PALETTE_INIT( rjammer );
diff --git a/src/mame/includes/twin16.h b/src/mame/includes/twin16.h
index 37dbb8d3f40..2038791a453 100644
--- a/src/mame/includes/twin16.h
+++ b/src/mame/includes/twin16.h
@@ -29,7 +29,7 @@ public:
/*----------- defined in drivers/twin16.c -----------*/
-int twin16_spriteram_process_enable( running_machine *machine );
+int twin16_spriteram_process_enable( running_machine &machine );
/*----------- defined in video/twin16.c -----------*/
@@ -44,4 +44,4 @@ VIDEO_START( twin16 );
SCREEN_UPDATE( twin16 );
SCREEN_EOF( twin16 );
-void twin16_spriteram_process( running_machine *machine );
+void twin16_spriteram_process( running_machine &machine );
diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h
index 682b5f4f7d5..8fc174ed5f2 100644
--- a/src/mame/includes/twincobr.h
+++ b/src/mame/includes/twincobr.h
@@ -82,8 +82,8 @@ MACHINE_RESET( twincobr );
MACHINE_RESET( fsharkbt );
MACHINE_RESET( wardner );
-extern void twincobr_driver_savestate(running_machine *machine);
-extern void wardner_driver_savestate(running_machine *machine);
+extern void twincobr_driver_savestate(running_machine &machine);
+extern void wardner_driver_savestate(running_machine &machine);
@@ -91,8 +91,8 @@ extern void wardner_driver_savestate(running_machine *machine);
/*----------- defined in video/twincobr.c -----------*/
extern const mc6845_interface twincobr_mc6845_intf;
-extern void twincobr_flipscreen(running_machine *machine, int flip);
-extern void twincobr_display(running_machine *machine, int enable);
+extern void twincobr_flipscreen(running_machine &machine, int flip);
+extern void twincobr_display(running_machine &machine, int enable);
READ16_HANDLER( twincobr_txram_r );
READ16_HANDLER( twincobr_bgram_r );
diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h
index e3cf2b3b046..73550b6eef6 100644
--- a/src/mame/includes/ultraman.h
+++ b/src/mame/includes/ultraman.h
@@ -30,10 +30,10 @@ public:
/*----------- defined in video/ultraman.c -----------*/
-extern void ultraman_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow);
-extern void ultraman_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags);
-extern void ultraman_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags);
-extern void ultraman_zoom_callback_2(running_machine *machine, int *code,int *color,int *flags);
+extern void ultraman_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow);
+extern void ultraman_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags);
+extern void ultraman_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags);
+extern void ultraman_zoom_callback_2(running_machine &machine, int *code,int *color,int *flags);
WRITE16_HANDLER( ultraman_gfxctrl_w );
diff --git a/src/mame/includes/vball.h b/src/mame/includes/vball.h
index 33b92a10914..60aba746fa5 100644
--- a/src/mame/includes/vball.h
+++ b/src/mame/includes/vball.h
@@ -24,8 +24,8 @@ public:
VIDEO_START( vb );
SCREEN_UPDATE( vb );
-void vb_bgprombank_w(running_machine *machine, int bank);
-void vb_spprombank_w(running_machine *machine, int bank);
+void vb_bgprombank_w(running_machine &machine, int bank);
+void vb_spprombank_w(running_machine &machine, int bank);
WRITE8_HANDLER( vb_attrib_w );
WRITE8_HANDLER( vb_videoram_w );
-void vb_mark_all_dirty(running_machine *machine);
+void vb_mark_all_dirty(running_machine &machine);
diff --git a/src/mame/includes/vendetta.h b/src/mame/includes/vendetta.h
index 1bd6cac4cce..79d90d1c0ad 100644
--- a/src/mame/includes/vendetta.h
+++ b/src/mame/includes/vendetta.h
@@ -34,8 +34,8 @@ public:
/*----------- defined in video/vendetta.c -----------*/
-extern void vendetta_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void esckids_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-extern void vendetta_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+extern void vendetta_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void esckids_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+extern void vendetta_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
SCREEN_UPDATE( vendetta );
diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h
index cc665186377..299c1d172f3 100644
--- a/src/mame/includes/vertigo.h
+++ b/src/mame/includes/vertigo.h
@@ -23,7 +23,9 @@ typedef struct _am2901
typedef struct _vector_generator
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
UINT32 sreg; /* shift register */
UINT32 l1; /* latch 1 adder operand only */
UINT32 l2; /* latch 2 adder operand only */
@@ -114,7 +116,7 @@ MACHINE_RESET( vertigo );
/*----------- defined in video/vertigo.c -----------*/
-void vertigo_vproc_init(running_machine *machine);
-void vertigo_vproc_reset(running_machine *machine);
-void vertigo_vproc(running_machine *machine, int cycles, int irq4);
+void vertigo_vproc_init(running_machine &machine);
+void vertigo_vproc_reset(running_machine &machine);
+void vertigo_vproc(running_machine &machine, int cycles, int irq4);
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index a0a3e161104..9deea3f1ced 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -38,7 +38,7 @@ public:
/*----------- defined in drivers/vicdual.c -----------*/
-int vicdual_is_cabinet_color(running_machine *machine);
+int vicdual_is_cabinet_color(running_machine &machine);
/*----------- defined in video/vicdual.c -----------*/
diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h
index f1f6f0ae369..7a24cf6badd 100644
--- a/src/mame/includes/volfied.h
+++ b/src/mame/includes/volfied.h
@@ -34,8 +34,8 @@ public:
/*----------- defined in machine/volfied.c -----------*/
-void volfied_cchip_init(running_machine *machine);
-void volfied_cchip_reset(running_machine *machine);
+void volfied_cchip_init(running_machine &machine);
+void volfied_cchip_reset(running_machine &machine);
READ16_HANDLER( volfied_cchip_ctrl_r );
READ16_HANDLER( volfied_cchip_ram_r );
diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h
index 1aaacdd139f..61ffedced0d 100644
--- a/src/mame/includes/wecleman.h
+++ b/src/mame/includes/wecleman.h
@@ -52,5 +52,5 @@ VIDEO_START( wecleman );
SCREEN_UPDATE( hotchase );
VIDEO_START( hotchase );
-void hotchase_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags);
-void hotchase_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags);
+void hotchase_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags);
+void hotchase_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags);
diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h
index 8249ecb52df..aa8d965bec0 100644
--- a/src/mame/includes/xexex.h
+++ b/src/mame/includes/xexex.h
@@ -46,8 +46,8 @@ public:
/*----------- defined in video/xexex.c -----------*/
-extern void xexex_sprite_callback(running_machine *machine, int *code, int *color, int *priority_mask);
-extern void xexex_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags);
+extern void xexex_sprite_callback(running_machine &machine, int *code, int *color, int *priority_mask);
+extern void xexex_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags);
VIDEO_START( xexex );
SCREEN_UPDATE( xexex );
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index e8038289521..5f0f688ea0b 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -38,8 +38,8 @@ public:
/*----------- defined in video/xmen.c -----------*/
-void xmen_tile_callback(running_machine *machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
-void xmen_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask);
+void xmen_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
+void xmen_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
VIDEO_START( xmen6p );
SCREEN_UPDATE( xmen );
diff --git a/src/mame/machine/acitya.c b/src/mame/machine/acitya.c
index 3044cb5cfec..1c51bf73af0 100644
--- a/src/mame/machine/acitya.c
+++ b/src/mame/machine/acitya.c
@@ -16,13 +16,13 @@ David Widel d_widel@hotmail.com
#include "includes/pacman.h"
-static void acitya_decrypt_rom_8(running_machine *machine)
+static void acitya_decrypt_rom_8(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
@@ -52,13 +52,13 @@ static void acitya_decrypt_rom_8(running_machine *machine)
}
-static void acitya_decrypt_rom_9(running_machine *machine)
+static void acitya_decrypt_rom_9(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -85,13 +85,13 @@ static void acitya_decrypt_rom_9(running_machine *machine)
return;
}
-static void acitya_decrypt_rom_A(running_machine *machine)
+static void acitya_decrypt_rom_A(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -118,13 +118,13 @@ static void acitya_decrypt_rom_A(running_machine *machine)
return;
}
-static void acitya_decrypt_rom_B(running_machine *machine)
+static void acitya_decrypt_rom_B(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -156,7 +156,7 @@ static void acitya_decrypt_rom_B(running_machine *machine)
READ8_HANDLER( acitya_decrypt_rom )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (offset & 0x01)
{
state->counter = (state->counter - 1) & 0x0F;
@@ -168,10 +168,10 @@ READ8_HANDLER( acitya_decrypt_rom )
switch(state->counter)
{
- case 0x08: memory_set_bank (space->machine, "bank1", 0); break;
- case 0x09: memory_set_bank (space->machine, "bank1", 1); break;
- case 0x0A: memory_set_bank (space->machine, "bank1", 2); break;
- case 0x0B: memory_set_bank (space->machine, "bank1", 3); break;
+ case 0x08: memory_set_bank (space->machine(), "bank1", 0); break;
+ case 0x09: memory_set_bank (space->machine(), "bank1", 1); break;
+ case 0x0A: memory_set_bank (space->machine(), "bank1", 2); break;
+ case 0x0B: memory_set_bank (space->machine(), "bank1", 3); break;
default:
logerror("Invalid counter = %02X\n",state->counter);
break;
@@ -183,8 +183,8 @@ READ8_HANDLER( acitya_decrypt_rom )
MACHINE_START( acitya )
{
- pacman_state *state = machine->driver_data<pacman_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ pacman_state *state = machine.driver_data<pacman_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -202,7 +202,7 @@ MACHINE_START( acitya )
MACHINE_RESET( acitya )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
/* The initial state of the counter is 0x0B */
state->counter = 0x0B;
memory_set_bank(machine, "bank1", 3);
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index 63d31b10c55..85f4c529030 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -33,7 +33,7 @@
static WRITE8_HANDLER( ajax_bankswitch_w )
{
- ajax_state *state = space->machine->driver_data<ajax_state>();
+ ajax_state *state = space->machine().driver_data<ajax_state>();
int bank = 0;
/* rom select */
@@ -41,15 +41,15 @@ static WRITE8_HANDLER( ajax_bankswitch_w )
bank += 4;
/* coin counters */
- coin_counter_w(space->machine, 0, data & 0x20);
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x20);
+ coin_counter_w(space->machine(), 1, data & 0x40);
/* priority */
state->priority = data & 0x08;
/* bank # (ROMS N11 and N12) */
bank += (data & 0x07);
- memory_set_bank(space->machine, "bank2", bank);
+ memory_set_bank(space->machine(), "bank2", bank);
}
/* ajax_lamps_w:
@@ -78,14 +78,14 @@ static WRITE8_HANDLER( ajax_bankswitch_w )
static WRITE8_HANDLER( ajax_lamps_w )
{
- set_led_status(space->machine, 1, data & 0x02); /* super weapon lamp */
- set_led_status(space->machine, 2, data & 0x04); /* power up lamps */
- set_led_status(space->machine, 5, data & 0x04); /* power up lamps */
- set_led_status(space->machine, 0, data & 0x20); /* start lamp */
- set_led_status(space->machine, 3, data & 0x40); /* game over lamps */
- set_led_status(space->machine, 6, data & 0x40); /* game over lamps */
- set_led_status(space->machine, 4, data & 0x80); /* game over lamps */
- set_led_status(space->machine, 7, data & 0x80); /* game over lamps */
+ set_led_status(space->machine(), 1, data & 0x02); /* super weapon lamp */
+ set_led_status(space->machine(), 2, data & 0x04); /* power up lamps */
+ set_led_status(space->machine(), 5, data & 0x04); /* power up lamps */
+ set_led_status(space->machine(), 0, data & 0x20); /* start lamp */
+ set_led_status(space->machine(), 3, data & 0x40); /* game over lamps */
+ set_led_status(space->machine(), 6, data & 0x40); /* game over lamps */
+ set_led_status(space->machine(), 4, data & 0x80); /* game over lamps */
+ set_led_status(space->machine(), 7, data & 0x80); /* game over lamps */
}
/* ajax_ls138_f10:
@@ -113,17 +113,17 @@ READ8_HANDLER( ajax_ls138_f10_r )
switch ((offset & 0x01c0) >> 6)
{
case 0x00: /* ??? */
- data = space->machine->rand();
+ data = space->machine().rand();
break;
case 0x04: /* 2P inputs */
- data = input_port_read(space->machine, "P2");
+ data = input_port_read(space->machine(), "P2");
break;
case 0x06: /* 1P inputs + DIPSW #1 & #2 */
index = offset & 0x01;
- data = input_port_read(space->machine, (offset & 0x02) ? portnames[2 + index] : portnames[index]);
+ data = input_port_read(space->machine(), (offset & 0x02) ? portnames[2 + index] : portnames[index]);
break;
case 0x07: /* DIPSW #3 */
- data = input_port_read(space->machine, "DSW3");
+ data = input_port_read(space->machine(), "DSW3");
break;
default:
@@ -135,7 +135,7 @@ READ8_HANDLER( ajax_ls138_f10_r )
WRITE8_HANDLER( ajax_ls138_f10_w )
{
- ajax_state *state = space->machine->driver_data<ajax_state>();
+ ajax_state *state = space->machine().driver_data<ajax_state>();
switch ((offset & 0x01c0) >> 6)
{
@@ -182,7 +182,7 @@ WRITE8_HANDLER( ajax_ls138_f10_w )
WRITE8_HANDLER( ajax_bankswitch_2_w )
{
- ajax_state *state = space->machine->driver_data<ajax_state>();
+ ajax_state *state = space->machine().driver_data<ajax_state>();
/* enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
@@ -194,14 +194,14 @@ WRITE8_HANDLER( ajax_bankswitch_2_w )
state->firq_enable = data & 0x10;
/* bank # (ROMS G16 and I16) */
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
MACHINE_START( ajax )
{
- ajax_state *state = machine->driver_data<ajax_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SUB = machine->region("sub")->base();
+ ajax_state *state = machine.driver_data<ajax_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SUB = machine.region("sub")->base();
memory_configure_bank(machine, "bank1", 0, 9, &SUB[0x10000], 0x2000);
memory_configure_bank(machine, "bank2", 0, 12, &MAIN[0x10000], 0x2000);
@@ -209,14 +209,14 @@ MACHINE_START( ajax )
memory_set_bank(machine, "bank1", 0);
memory_set_bank(machine, "bank2", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k051316 = machine->device("k051316");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k051316 = machine.device("k051316");
state->save_item(NAME(state->priority));
state->save_item(NAME(state->firq_enable));
@@ -224,7 +224,7 @@ MACHINE_START( ajax )
MACHINE_RESET( ajax )
{
- ajax_state *state = machine->driver_data<ajax_state>();
+ ajax_state *state = machine.driver_data<ajax_state>();
state->priority = 0;
state->firq_enable = 0;
@@ -232,7 +232,7 @@ MACHINE_RESET( ajax )
INTERRUPT_GEN( ajax_interrupt )
{
- ajax_state *state = device->machine->driver_data<ajax_state>();
+ ajax_state *state = device->machine().driver_data<ajax_state>();
if (k051960_is_irq_enabled(state->k051960))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c
index 03da3689e6e..ca0efce5707 100644
--- a/src/mame/machine/amiga.c
+++ b/src/mame/machine/amiga.c
@@ -138,8 +138,8 @@ const char *const amiga_custom_names[0x100] =
*
*************************************/
-static void custom_reset(running_machine *machine);
-static void autoconfig_reset(running_machine *machine);
+static void custom_reset(running_machine &machine);
+static void autoconfig_reset(running_machine &machine);
static TIMER_CALLBACK( amiga_irq_proc );
static TIMER_CALLBACK( amiga_blitter_proc );
static TIMER_CALLBACK( scanline_callback );
@@ -233,9 +233,9 @@ void amiga_chip_ram_w8(amiga_state *state, offs_t offset, UINT8 data)
*
*************************************/
-void amiga_machine_config(running_machine *machine, const amiga_machine_interface *intf)
+void amiga_machine_config(running_machine &machine, const amiga_machine_interface *intf)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
state->intf = intf;
/* setup chipmem handlers */
@@ -251,25 +251,25 @@ void amiga_machine_config(running_machine *machine, const amiga_machine_interfac
}
/* setup the timers */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(amiga_irq_proc));
- state->blitter_timer = machine->scheduler().timer_alloc(FUNC(amiga_blitter_proc));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(amiga_irq_proc));
+ state->blitter_timer = machine.scheduler().timer_alloc(FUNC(amiga_blitter_proc));
- state->sound_device = machine->device("amiga");
+ state->sound_device = machine.device("amiga");
}
static void amiga_m68k_reset(device_t *device)
{
- amiga_state *state = device->machine->driver_data<amiga_state>();
+ amiga_state *state = device->machine().driver_data<amiga_state>();
address_space *space = device->memory().space(AS_PROGRAM);
logerror("Executed RESET at PC=%06x\n", cpu_get_pc(space->cpu));
/* Initialize the various chips */
- devtag_reset(device->machine, "cia_0");
- devtag_reset(device->machine, "cia_1");
- custom_reset(device->machine);
- autoconfig_reset(device->machine);
+ devtag_reset(device->machine(), "cia_0");
+ devtag_reset(device->machine(), "cia_1");
+ custom_reset(device->machine());
+ autoconfig_reset(device->machine());
/* set the overlay bit */
if ( IS_AGA(state->intf) )
@@ -285,19 +285,19 @@ static void amiga_m68k_reset(device_t *device)
MACHINE_RESET( amiga )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
/* set m68k reset function */
- m68k_set_reset_callback(machine->device("maincpu"), amiga_m68k_reset);
+ m68k_set_reset_callback(machine.device("maincpu"), amiga_m68k_reset);
- amiga_m68k_reset(machine->device("maincpu"));
+ amiga_m68k_reset(machine.device("maincpu"));
/* call the system-specific callback */
if (state->intf->reset_callback)
(*state->intf->reset_callback)(machine);
/* start the scanline timer */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(scanline_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(scanline_callback));
}
@@ -310,16 +310,16 @@ MACHINE_RESET( amiga )
static TIMER_CALLBACK( scanline_callback )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
int scanline = param;
- device_t *cia_0 = machine->device("cia_0");
- device_t *cia_1 = machine->device("cia_1");
+ device_t *cia_0 = machine.device("cia_0");
+ device_t *cia_1 = machine.device("cia_1");
/* on the first scanline, we do some extra bookkeeping */
if (scanline == 0)
{
/* signal VBLANK IRQ */
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff);
/* clock the first CIA TOD */
mos6526_tod_w(cia_0, 1);
@@ -333,7 +333,7 @@ static TIMER_CALLBACK( scanline_callback )
mos6526_tod_w(cia_1, 1);
/* render up to this scanline */
- if (!machine->primary_screen->update_partial(scanline))
+ if (!machine.primary_screen->update_partial(scanline))
{
if (IS_AGA(state->intf))
amiga_aga_render_scanline(machine, NULL, scanline);
@@ -345,8 +345,8 @@ static TIMER_CALLBACK( scanline_callback )
amiga_audio_update(state->sound_device);
/* set timer for next line */
- scanline = (scanline + 1) % machine->primary_screen->height();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline);
+ scanline = (scanline + 1) % machine.primary_screen->height();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline);
}
@@ -357,9 +357,9 @@ static TIMER_CALLBACK( scanline_callback )
*
*************************************/
-static void update_irqs(running_machine *machine)
+static void update_irqs(running_machine &machine)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
int ints = CUSTOM_REG(REG_INTENA) & CUSTOM_REG(REG_INTREQ);
/* Master interrupt switch */
@@ -397,7 +397,7 @@ static void update_irqs(running_machine *machine)
static TIMER_CALLBACK( amiga_irq_proc )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
update_irqs(machine);
state->irq_timer->reset( );
@@ -413,7 +413,7 @@ static TIMER_CALLBACK( amiga_irq_proc )
CUSTOM_INPUT( amiga_joystick_convert )
{
- UINT8 bits = input_port_read(field->port->machine, (const char *)param);
+ UINT8 bits = input_port_read(field->port->machine(), (const char *)param);
int up = (bits >> 0) & 1;
int down = (bits >> 1) & 1;
int left = (bits >> 2) & 1;
@@ -888,7 +888,7 @@ static UINT32 blit_line(amiga_state *state)
static TIMER_CALLBACK( amiga_blitter_proc )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
UINT32 blitsum = 0;
/* logging */
@@ -934,7 +934,7 @@ static TIMER_CALLBACK( amiga_blitter_proc )
CUSTOM_REG(REG_DMACON) &= ~0x4000;
/* signal an interrupt */
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff);
/* reset the blitter timer */
state->blitter_timer->reset( );
@@ -950,13 +950,13 @@ static TIMER_CALLBACK( amiga_blitter_proc )
static void blitter_setup(address_space *space)
{
- amiga_state *state = space->machine->driver_data<amiga_state>();
+ amiga_state *state = space->machine().driver_data<amiga_state>();
int ticks, width, height, blittime;
/* is there another blitting in progress? */
if (CUSTOM_REG(REG_DMACON) & 0x4000)
{
- logerror("%s - This program is playing tricks with the blitter\n", space->machine->describe_context() );
+ logerror("%s - This program is playing tricks with the blitter\n", space->machine().describe_context() );
return;
}
@@ -1022,14 +1022,14 @@ READ16_HANDLER( amiga_cia_r )
/* offsets 0000-07ff reference CIA B, and are accessed via the MSB */
if ((offset & 0x0800) == 0)
{
- cia = space->machine->device("cia_1");
+ cia = space->machine().device("cia_1");
shift = 8;
}
/* offsets 0800-0fff reference CIA A, and are accessed via the LSB */
else
{
- cia = space->machine->device("cia_0");
+ cia = space->machine().device("cia_0");
shift = 0;
}
@@ -1062,7 +1062,7 @@ WRITE16_HANDLER( amiga_cia_w )
{
if (!ACCESSING_BITS_8_15)
return;
- cia = space->machine->device("cia_1");
+ cia = space->machine().device("cia_1");
data >>= 8;
}
@@ -1071,7 +1071,7 @@ WRITE16_HANDLER( amiga_cia_w )
{
if (!ACCESSING_BITS_0_7)
return;
- cia = space->machine->device("cia_0");
+ cia = space->machine().device("cia_0");
data &= 0xff;
}
@@ -1089,13 +1089,13 @@ WRITE16_HANDLER( amiga_cia_w )
void amiga_cia_0_irq(device_t *device, int state)
{
- amiga_custom_w(device->machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff);
+ amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff);
}
void amiga_cia_1_irq(device_t *device, int state)
{
- amiga_custom_w(device->machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff);
+ amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff);
}
@@ -1106,10 +1106,10 @@ void amiga_cia_1_irq(device_t *device, int state)
*
*************************************/
-static void custom_reset(running_machine *machine)
+static void custom_reset(running_machine &machine)
{
- amiga_state *state = machine->driver_data<amiga_state>();
- int clock = machine->device("maincpu")->unscaled_clock();
+ amiga_state *state = machine.driver_data<amiga_state>();
+ int clock = machine.device("maincpu")->unscaled_clock();
UINT16 vidmode = (clock == AMIGA_68000_NTSC_CLOCK || clock == AMIGA_68EC020_NTSC_CLOCK ) ? 0x1000 : 0x0000; /* NTSC or PAL? */
CUSTOM_REG(REG_DDFSTRT) = 0x18;
@@ -1147,7 +1147,7 @@ static void custom_reset(running_machine *machine)
READ16_HANDLER( amiga_custom_r )
{
- amiga_state *state = space->machine->driver_data<amiga_state>();
+ amiga_state *state = space->machine().driver_data<amiga_state>();
UINT16 temp;
switch (offset & 0xff)
@@ -1160,11 +1160,11 @@ READ16_HANDLER( amiga_custom_r )
case REG_VPOSR:
CUSTOM_REG(REG_VPOSR) &= 0xff00;
- CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos(*space->machine->primary_screen) >> 16;
+ CUSTOM_REG(REG_VPOSR) |= amiga_gethvpos(*space->machine().primary_screen) >> 16;
return CUSTOM_REG(REG_VPOSR);
case REG_VHPOSR:
- return amiga_gethvpos(*space->machine->primary_screen) & 0xffff;
+ return amiga_gethvpos(*space->machine().primary_screen) & 0xffff;
case REG_SERDATR:
CUSTOM_REG(REG_SERDATR) &= ~0x4000;
@@ -1173,29 +1173,29 @@ READ16_HANDLER( amiga_custom_r )
case REG_JOY0DAT:
if (state->intf->joy0dat_r != NULL)
- return (*state->intf->joy0dat_r)(space->machine);
- return input_port_read_safe(space->machine, "JOY0DAT", 0xffff);
+ return (*state->intf->joy0dat_r)(space->machine());
+ return input_port_read_safe(space->machine(), "JOY0DAT", 0xffff);
case REG_JOY1DAT:
if (state->intf->joy1dat_r != NULL)
- return (*state->intf->joy1dat_r)(space->machine);
- return input_port_read_safe(space->machine, "JOY1DAT", 0xffff);
+ return (*state->intf->joy1dat_r)(space->machine());
+ return input_port_read_safe(space->machine(), "JOY1DAT", 0xffff);
case REG_ADKCONR:
return CUSTOM_REG(REG_ADKCON);
case REG_POTGOR:
- return input_port_read_safe(space->machine, "POTGO", 0x5500);
+ return input_port_read_safe(space->machine(), "POTGO", 0x5500);
case REG_POT0DAT:
- return input_port_read_safe(space->machine, "POT0DAT", 0x0000);
+ return input_port_read_safe(space->machine(), "POT0DAT", 0x0000);
case REG_POT1DAT:
- return input_port_read_safe(space->machine, "POT1DAT", 0x0000);
+ return input_port_read_safe(space->machine(), "POT1DAT", 0x0000);
case REG_DSKBYTR:
if (state->intf->dskbytr_r != NULL)
- return (*state->intf->dskbytr_r)(space->machine);
+ return (*state->intf->dskbytr_r)(space->machine());
return 0x0000;
case REG_INTENAR:
@@ -1205,11 +1205,11 @@ READ16_HANDLER( amiga_custom_r )
return CUSTOM_REG(REG_INTREQ);
case REG_COPJMP1:
- amiga_copper_setpc(space->machine, CUSTOM_REG_LONG(REG_COP1LCH));
+ amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP1LCH));
break;
case REG_COPJMP2:
- amiga_copper_setpc(space->machine, CUSTOM_REG_LONG(REG_COP2LCH));
+ amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP2LCH));
break;
case REG_CLXDAT:
@@ -1237,19 +1237,19 @@ READ16_HANDLER( amiga_custom_r )
static TIMER_CALLBACK( finish_serial_write )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
/* mark the transfer buffer empty */
CUSTOM_REG(REG_SERDATR) |= 0x3000;
/* signal an interrupt */
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff);
}
WRITE16_HANDLER( amiga_custom_w )
{
- amiga_state *state = space->machine->driver_data<amiga_state>();
+ amiga_state *state = space->machine().driver_data<amiga_state>();
device_t *cia_0;
device_t *cia_1;
UINT16 temp;
@@ -1269,19 +1269,19 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_DSKLEN:
if (state->intf->dsklen_w != NULL)
- (*state->intf->dsklen_w)(space->machine, data);
+ (*state->intf->dsklen_w)(space->machine(), data);
break;
case REG_POTGO:
if (state->intf->potgo_w != NULL)
- (*state->intf->potgo_w)(space->machine, data);
+ (*state->intf->potgo_w)(space->machine(), data);
break;
case REG_SERDAT:
if (state->intf->serdat_w != NULL)
- (*state->intf->serdat_w)(space->machine, data);
+ (*state->intf->serdat_w)(space->machine(), data);
CUSTOM_REG(REG_SERDATR) &= ~0x3000;
- space->machine->scheduler().timer_set(amiga_get_serial_char_period(space->machine), FUNC(finish_serial_write));
+ space->machine().scheduler().timer_set(amiga_get_serial_char_period(space->machine()), FUNC(finish_serial_write));
break;
case REG_BLTSIZE:
@@ -1325,19 +1325,19 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_SPR0PTL: case REG_SPR1PTL: case REG_SPR2PTL: case REG_SPR3PTL:
case REG_SPR4PTL: case REG_SPR5PTL: case REG_SPR6PTL: case REG_SPR7PTL:
- amiga_sprite_dma_reset(space->machine, (offset - REG_SPR0PTL) / 2);
+ amiga_sprite_dma_reset(space->machine(), (offset - REG_SPR0PTL) / 2);
break;
case REG_SPR0CTL: case REG_SPR1CTL: case REG_SPR2CTL: case REG_SPR3CTL:
case REG_SPR4CTL: case REG_SPR5CTL: case REG_SPR6CTL: case REG_SPR7CTL:
/* disable comparitor on writes here */
- amiga_sprite_enable_comparitor(space->machine, (offset - REG_SPR0CTL) / 4, FALSE);
+ amiga_sprite_enable_comparitor(space->machine(), (offset - REG_SPR0CTL) / 4, FALSE);
break;
case REG_SPR0DATA: case REG_SPR1DATA: case REG_SPR2DATA: case REG_SPR3DATA:
case REG_SPR4DATA: case REG_SPR5DATA: case REG_SPR6DATA: case REG_SPR7DATA:
/* enable comparitor on writes here */
- amiga_sprite_enable_comparitor(space->machine, (offset - REG_SPR0DATA) / 4, TRUE);
+ amiga_sprite_enable_comparitor(space->machine(), (offset - REG_SPR0DATA) / 4, TRUE);
break;
case REG_COP1LCH: case REG_COP2LCH:
@@ -1345,11 +1345,11 @@ WRITE16_HANDLER( amiga_custom_w )
break;
case REG_COPJMP1:
- amiga_copper_setpc(space->machine, CUSTOM_REG_LONG(REG_COP1LCH));
+ amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP1LCH));
break;
case REG_COPJMP2:
- amiga_copper_setpc(space->machine, CUSTOM_REG_LONG(REG_COP2LCH));
+ amiga_copper_setpc(space->machine(), CUSTOM_REG_LONG(REG_COP2LCH));
break;
case REG_DDFSTRT:
@@ -1388,7 +1388,7 @@ WRITE16_HANDLER( amiga_custom_w )
if ( temp & 0x8000 ) /* if we're enabling irq's, delay a bit */
state->irq_timer->adjust( downcast<cpu_device *>(space->cpu)->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
else /* if we're disabling irq's, process right away */
- update_irqs(space->machine);
+ update_irqs(space->machine());
break;
case REG_INTREQ:
@@ -1398,16 +1398,16 @@ WRITE16_HANDLER( amiga_custom_w )
CUSTOM_REG(REG_SERDATR) &= ~0x8000;
data = (data & 0x8000) ? (CUSTOM_REG(offset) | (data & 0x7fff)) : (CUSTOM_REG(offset) & ~(data & 0x7fff));
- cia_0 = space->machine->device("cia_0");
- cia_1 = space->machine->device("cia_1");
+ cia_0 = space->machine().device("cia_0");
+ cia_1 = space->machine().device("cia_1");
if ( mos6526_irq_r( cia_0 ) ) data |= INTENA_PORTS;
if ( mos6526_irq_r( cia_1 ) ) data |= INTENA_EXTER;
CUSTOM_REG(offset) = data;
if ( temp & 0x8000 ) /* if we're generating irq's, delay a bit */
- state->irq_timer->adjust( space->machine->device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
+ state->irq_timer->adjust( space->machine().device<cpu_device>("maincpu")->cycles_to_attotime( AMIGA_IRQ_DELAY_CYCLES ));
else /* if we're clearing irq's, process right away */
- update_irqs(space->machine);
+ update_irqs(space->machine());
break;
case REG_ADKCON:
@@ -1450,7 +1450,7 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_COLOR28: case REG_COLOR29: case REG_COLOR30: case REG_COLOR31:
if (IS_AGA(state->intf))
{
- amiga_aga_palette_write(space->machine, offset - REG_COLOR00, data);
+ amiga_aga_palette_write(space->machine(), offset - REG_COLOR00, data);
}
else
{
@@ -1461,11 +1461,11 @@ WRITE16_HANDLER( amiga_custom_w )
case REG_DIWSTRT:
case REG_DIWSTOP:
if (IS_AGA(state->intf))
- amiga_aga_diwhigh_written(space->machine, 0);
+ amiga_aga_diwhigh_written(space->machine(), 0);
break;
case REG_DIWHIGH:
if (IS_AGA(state->intf))
- amiga_aga_diwhigh_written(space->machine, 1);
+ amiga_aga_diwhigh_written(space->machine(), 1);
break;
default:
@@ -1487,10 +1487,10 @@ WRITE16_HANDLER( amiga_custom_w )
*
*************************************/
-void amiga_serial_in_w(running_machine *machine, UINT16 data)
+void amiga_serial_in_w(running_machine &machine, UINT16 data)
{
- amiga_state *state = machine->driver_data<amiga_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ amiga_state *state = machine.driver_data<amiga_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int mask = (CUSTOM_REG(REG_SERPER) & 0x8000) ? 0x1ff : 0xff;
/* copy the data to the low 8 bits of SERDATR and set RBF */
@@ -1509,11 +1509,11 @@ void amiga_serial_in_w(running_machine *machine, UINT16 data)
}
-attotime amiga_get_serial_char_period(running_machine *machine)
+attotime amiga_get_serial_char_period(running_machine &machine)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
UINT32 divisor = (CUSTOM_REG(REG_SERPER) & 0x7fff) + 1;
- UINT32 baud = machine->device("maincpu")->unscaled_clock() / 2 / divisor;
+ UINT32 baud = machine.device("maincpu")->unscaled_clock() / 2 / divisor;
UINT32 numbits = 2 + ((CUSTOM_REG(REG_SERPER) & 0x8000) ? 9 : 8);
return attotime::from_hz(baud) * numbits;
}
@@ -1526,13 +1526,13 @@ attotime amiga_get_serial_char_period(running_machine *machine)
*
*************************************/
-void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_device *device)
+void amiga_add_autoconfig(running_machine &machine, const amiga_autoconfig_device *device)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
autoconfig_device *dev, **d;
/* validate the data */
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call amiga_add_autoconfig at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call amiga_add_autoconfig at init time!");
assert_always((device->size & (device->size - 1)) == 0, "device->size must be power of 2!");
/* allocate memory and link it in at the end of the list */
@@ -1554,9 +1554,9 @@ void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_devic
*
*************************************/
-static void autoconfig_reset(running_machine *machine)
+static void autoconfig_reset(running_machine &machine)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
autoconfig_device *dev;
/* uninstall any installed devices */
@@ -1581,7 +1581,7 @@ static void autoconfig_reset(running_machine *machine)
READ16_HANDLER( amiga_autoconfig_r )
{
- amiga_state *state = space->machine->driver_data<amiga_state>();
+ amiga_state *state = space->machine().driver_data<amiga_state>();
autoconfig_device *cur_autoconfig = state->cur_autoconfig;
UINT8 byte;
int i;
@@ -1697,7 +1697,7 @@ READ16_HANDLER( amiga_autoconfig_r )
case 0x40/4:
byte = 0x00;
if (cur_autoconfig->device.int_control_r)
- byte = (*cur_autoconfig->device.int_control_r)(space->machine);
+ byte = (*cur_autoconfig->device.int_control_r)(space->machine());
break;
default:
@@ -1720,7 +1720,7 @@ READ16_HANDLER( amiga_autoconfig_r )
WRITE16_HANDLER( amiga_autoconfig_w )
{
- amiga_state *state = space->machine->driver_data<amiga_state>();
+ amiga_state *state = space->machine().driver_data<amiga_state>();
autoconfig_device *cur_autoconfig = state->cur_autoconfig;
int move_to_next = FALSE;
@@ -1758,7 +1758,7 @@ WRITE16_HANDLER( amiga_autoconfig_w )
{
logerror("Install to %06X\n", cur_autoconfig->base);
if (cur_autoconfig->base && cur_autoconfig->device.install)
- (*cur_autoconfig->device.install)(space->machine, cur_autoconfig->base);
+ (*cur_autoconfig->device.install)(space->machine(), cur_autoconfig->base);
state->cur_autoconfig = cur_autoconfig->next;
}
}
@@ -1771,7 +1771,7 @@ WRITE16_HANDLER( amiga_autoconfig_w )
*
*************************************/
-const amiga_machine_interface *amiga_get_interface(running_machine *machine)
+const amiga_machine_interface *amiga_get_interface(running_machine &machine)
{
- return machine->driver_data<amiga_state>()->intf;
+ return machine.driver_data<amiga_state>()->intf;
}
diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c
index 24b1ae5b2de..01d7192ab71 100644
--- a/src/mame/machine/archimds.c
+++ b/src/mame/machine/archimds.c
@@ -61,7 +61,7 @@ static UINT8 vidc_stereo_reg[8];
static emu_timer *timer[4], *snd_timer, *vid_timer;
static emu_timer *vbl_timer;
-void archimedes_request_irq_a(running_machine *machine, int mask)
+void archimedes_request_irq_a(running_machine &machine, int mask)
{
ioc_regs[IRQ_STATUS_A] |= mask;
@@ -71,37 +71,37 @@ void archimedes_request_irq_a(running_machine *machine, int mask)
}
}
-void archimedes_request_irq_b(running_machine *machine, int mask)
+void archimedes_request_irq_b(running_machine &machine, int mask)
{
ioc_regs[IRQ_STATUS_B] |= mask;
if (ioc_regs[IRQ_MASK_B] & mask)
{
- generic_pulse_irq_line(machine->device("maincpu"), ARM_IRQ_LINE);
+ generic_pulse_irq_line(machine.device("maincpu"), ARM_IRQ_LINE);
}
}
-void archimedes_request_fiq(running_machine *machine, int mask)
+void archimedes_request_fiq(running_machine &machine, int mask)
{
ioc_regs[FIQ_STATUS] |= mask;
if (ioc_regs[FIQ_MASK] & mask)
{
- generic_pulse_irq_line(machine->device("maincpu"), ARM_FIRQ_LINE);
+ generic_pulse_irq_line(machine.device("maincpu"), ARM_FIRQ_LINE);
}
}
-void archimedes_clear_irq_a(running_machine *machine, int mask)
+void archimedes_clear_irq_a(running_machine &machine, int mask)
{
ioc_regs[IRQ_STATUS_A] &= ~mask;
}
-void archimedes_clear_irq_b(running_machine *machine, int mask)
+void archimedes_clear_irq_b(running_machine &machine, int mask)
{
ioc_regs[IRQ_STATUS_B] &= ~mask;
}
-void archimedes_clear_fiq(running_machine *machine, int mask)
+void archimedes_clear_fiq(running_machine &machine, int mask)
{
ioc_regs[FIQ_STATUS] &= ~mask;
}
@@ -111,15 +111,15 @@ static TIMER_CALLBACK( vidc_vblank )
archimedes_request_irq_a(machine, ARCHIMEDES_IRQA_VBL);
// set up for next vbl
- vbl_timer->adjust(machine->primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vbl_timer->adjust(machine.primary_screen->time_until_pos(vidc_regs[0xb4]));
}
/* video DMA */
/* TODO: what type of DMA this is, burst or cycle steal? Docs doesn't explain it (4 usec is the DRAM refresh). */
static TIMER_CALLBACK( vidc_video_tick )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- static UINT8 *vram = machine->region("vram")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ static UINT8 *vram = machine.region("vram")->base();
UINT32 size;
size = vidc_vidend-vidc_vidstart+0x10;
@@ -128,7 +128,7 @@ static TIMER_CALLBACK( vidc_video_tick )
vram[vidc_vidcur] = (space->read_byte(vidc_vidstart+vidc_vidcur+vidc_vidinit));
if(video_dma_on)
- vid_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vid_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
else
vid_timer->adjust(attotime::never);
}
@@ -136,7 +136,7 @@ static TIMER_CALLBACK( vidc_video_tick )
/* audio DMA */
static TIMER_CALLBACK( vidc_audio_tick )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 ulaw_comp;
INT16 res;
UINT8 ch;
@@ -150,7 +150,7 @@ static TIMER_CALLBACK( vidc_audio_tick )
res+=(((ulaw_comp>>1)&0xF)<<(ulaw_comp>>5));
if (ulaw_comp&1) res=-res;
- dac_signed_data_16_w(space->machine->device(dac_port[ch & 7]), res);
+ dac_signed_data_16_w(space->machine().device(dac_port[ch & 7]), res);
}
vidc_sndcur+=8;
@@ -164,7 +164,7 @@ static TIMER_CALLBACK( vidc_audio_tick )
{
snd_timer->adjust(attotime::never);
for(ch=0;ch<8;ch++)
- dac_signed_data_16_w(space->machine->device(dac_port[ch & 7]), 0x8000);
+ dac_signed_data_16_w(space->machine().device(dac_port[ch & 7]), 0x8000);
}
}
}
@@ -209,7 +209,7 @@ static TIMER_CALLBACK( ioc_timer )
}
}
-void archimedes_reset(running_machine *machine)
+void archimedes_reset(running_machine &machine)
{
int i;
@@ -227,24 +227,24 @@ void archimedes_reset(running_machine *machine)
ioc_regs[CONTROL] = 0xff;
}
-void archimedes_init(running_machine *machine)
+void archimedes_init(running_machine &machine)
{
memc_pagesize = 0;
- vbl_timer = machine->scheduler().timer_alloc(FUNC(vidc_vblank));
+ vbl_timer = machine.scheduler().timer_alloc(FUNC(vidc_vblank));
vbl_timer->adjust(attotime::never);
- timer[0] = machine->scheduler().timer_alloc(FUNC(ioc_timer));
- timer[1] = machine->scheduler().timer_alloc(FUNC(ioc_timer));
- timer[2] = machine->scheduler().timer_alloc(FUNC(ioc_timer));
- timer[3] = machine->scheduler().timer_alloc(FUNC(ioc_timer));
+ timer[0] = machine.scheduler().timer_alloc(FUNC(ioc_timer));
+ timer[1] = machine.scheduler().timer_alloc(FUNC(ioc_timer));
+ timer[2] = machine.scheduler().timer_alloc(FUNC(ioc_timer));
+ timer[3] = machine.scheduler().timer_alloc(FUNC(ioc_timer));
timer[0]->adjust(attotime::never);
timer[1]->adjust(attotime::never);
timer[2]->adjust(attotime::never);
timer[3]->adjust(attotime::never);
- vid_timer = machine->scheduler().timer_alloc(FUNC(vidc_video_tick));
- snd_timer = machine->scheduler().timer_alloc(FUNC(vidc_audio_tick));
+ vid_timer = machine.scheduler().timer_alloc(FUNC(vidc_video_tick));
+ snd_timer = machine.scheduler().timer_alloc(FUNC(vidc_audio_tick));
snd_timer->adjust(attotime::never);
}
@@ -257,7 +257,7 @@ READ32_HANDLER(archimedes_memc_logical_r)
{
UINT32 *rom;
- rom = (UINT32 *)space->machine->region("maincpu")->base();
+ rom = (UINT32 *)space->machine().region("maincpu")->base();
return rom[offset & 0x1fffff];
}
@@ -323,7 +323,7 @@ DIRECT_UPDATE_HANDLER( a310_setopbase )
// if the boot ROM is mapped in, do some trickery to make it show up
if (memc_latchrom)
{
- direct.explicit_configure(0x000000, 0x1fffff, 0x1fffff, *direct.space().m_machine.region("maincpu"));
+ direct.explicit_configure(0x000000, 0x1fffff, 0x1fffff, *direct.space().machine().region("maincpu"));
}
else // executing from logical memory
{
@@ -337,10 +337,10 @@ DIRECT_UPDATE_HANDLER( a310_setopbase )
}
#endif
-void archimedes_driver_init(running_machine *machine)
+void archimedes_driver_init(running_machine &machine)
{
-// address_space *space = machine->device<arm_device>("maincpu")->space(AS_PROGRAM);
-// space->set_direct_update_handler(direct_update_delegate_create_static(a310_setopbase, *machine));
+// address_space *space = machine.device<arm_device>("maincpu")->space(AS_PROGRAM);
+// space->set_direct_update_handler(direct_update_delegate_create_static(a310_setopbase, machine));
}
static const char *const ioc_regnames[] =
@@ -400,16 +400,16 @@ static READ32_HANDLER( ioc_ctrl_r )
static UINT8 flyback; //internal name for vblank here
int vert_pos;
- vert_pos = space->machine->primary_screen->vpos();
+ vert_pos = space->machine().primary_screen->vpos();
flyback = (vert_pos <= vidc_regs[VIDC_VDSR] || vert_pos >= vidc_regs[VIDC_VDER]) ? 0x80 : 0x00;
- i2c_data = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ i2c_data = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (flyback) | (ioc_regs[CONTROL] & 0x7c) | (i2c_clk<<1) | i2c_data;
}
case KART: // keyboard read
- archimedes_request_irq_b(space->machine, ARCHIMEDES_IRQB_KBD_XMIT_EMPTY);
+ archimedes_request_irq_b(space->machine(), ARCHIMEDES_IRQB_KBD_XMIT_EMPTY);
break;
case IRQ_STATUS_A:
@@ -469,8 +469,8 @@ static WRITE32_HANDLER( ioc_ctrl_w )
{
case CONTROL: // I2C bus control
//logerror("IOC I2C: CLK %d DAT %d\n", (data>>1)&1, data&1);
- i2cmem_sda_write(space->machine->device("i2cmem"), data & 0x01);
- i2cmem_scl_write(space->machine->device("i2cmem"), (data & 0x02) >> 1);
+ i2cmem_sda_write(space->machine().device("i2cmem"), data & 0x01);
+ i2cmem_scl_write(space->machine().device("i2cmem"), (data & 0x02) >> 1);
i2c_clk = (data & 2) >> 1;
break;
@@ -487,10 +487,10 @@ static WRITE32_HANDLER( ioc_ctrl_w )
ioc_regs[IRQ_MASK_A] = data & 0xff;
if(data & 0x80) //force an IRQ
- archimedes_request_irq_a(space->machine,ARCHIMEDES_IRQA_FORCE);
+ archimedes_request_irq_a(space->machine(),ARCHIMEDES_IRQA_FORCE);
if(data & 0x08) //set up the VBLANK timer
- vbl_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vbl_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
break;
@@ -498,7 +498,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
ioc_regs[FIQ_MASK] = data & 0xff;
if(data & 0x80) //force a FIRQ
- archimedes_request_fiq(space->machine,ARCHIMEDES_FIQ_FORCE);
+ archimedes_request_fiq(space->machine(),ARCHIMEDES_FIQ_FORCE);
break;
@@ -509,7 +509,7 @@ static WRITE32_HANDLER( ioc_ctrl_w )
//if (ioc_regs[IRQ_STATUS_A] == 0)
{
//printf("IRQ clear A\n");
- cputag_set_input_line(space->machine, "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
}
break;
@@ -582,7 +582,7 @@ READ32_HANDLER(archimedes_ioc_r)
{
UINT32 ioc_addr;
#ifdef MESS
- device_t *fdc = (device_t *)space->machine->device("wd1772");
+ device_t *fdc = (device_t *)space->machine().device("wd1772");
#endif
ioc_addr = offset*4;
@@ -640,7 +640,7 @@ WRITE32_HANDLER(archimedes_ioc_w)
{
UINT32 ioc_addr;
#ifdef MESS
- device_t *fdc = (device_t *)space->machine->device("wd1772");
+ device_t *fdc = (device_t *)space->machine().device("wd1772");
#endif
ioc_addr = offset*4;
@@ -707,7 +707,7 @@ READ32_HANDLER(archimedes_vidc_r)
return 0;
}
-static void vidc_dynamic_res_change(running_machine *machine)
+static void vidc_dynamic_res_change(running_machine &machine)
{
/* sanity checks - first pass */
/*
@@ -741,7 +741,7 @@ static void vidc_dynamic_res_change(running_machine *machine)
/* FIXME: pixel clock */
refresh = HZ_TO_ATTOSECONDS(pixel_rate[vidc_pixel_clk]*2) * vidc_regs[VIDC_HCR] * vidc_regs[VIDC_VCR];
- machine->primary_screen->configure(vidc_regs[VIDC_HCR], vidc_regs[VIDC_VCR], visarea, refresh);
+ machine.primary_screen->configure(vidc_regs[VIDC_HCR], vidc_regs[VIDC_VCR], visarea, refresh);
}
}
}
@@ -788,7 +788,7 @@ WRITE32_HANDLER(archimedes_vidc_w)
if(reg == 0x40 && val & 0xfff)
logerror("WARNING: border color write here (PC=%08x)!\n",cpu_get_pc(space->cpu));
- palette_set_color_rgb(space->machine, reg >> 2, pal4bit(r), pal4bit(g), pal4bit(b) );
+ palette_set_color_rgb(space->machine(), reg >> 2, pal4bit(r), pal4bit(g), pal4bit(b) );
/* handle 8bpp colors here */
if(reg <= 0x3c)
@@ -801,7 +801,7 @@ WRITE32_HANDLER(archimedes_vidc_w)
g = ((val & 0x030) >> 4) | ((i & 0x20) >> 3) | ((i & 0x40) >> 3);
r = ((val & 0x007) >> 0) | ((i & 0x10) >> 1);
- palette_set_color_rgb(space->machine, (reg >> 2) + 0x100 + i, pal4bit(r), pal4bit(g), pal4bit(b) );
+ palette_set_color_rgb(space->machine(), (reg >> 2) + 0x100 + i, pal4bit(r), pal4bit(g), pal4bit(b) );
}
}
@@ -841,14 +841,14 @@ WRITE32_HANDLER(archimedes_vidc_w)
logerror("VIDC: %s = %d\n", vrnames[(reg-0x80)/4], vidc_regs[reg]);
//#endif
- vidc_dynamic_res_change(space->machine);
+ vidc_dynamic_res_change(space->machine());
}
else if(reg == 0xe0)
{
vidc_bpp_mode = ((val & 0x0c) >> 2);
vidc_interlace = ((val & 0x40) >> 6);
vidc_pixel_clk = (val & 0x03);
- vidc_dynamic_res_change(space->machine);
+ vidc_dynamic_res_change(space->machine());
}
else
{
@@ -897,7 +897,7 @@ WRITE32_HANDLER(archimedes_memc_w)
case 6:
vidc_sndcur = 0;
- archimedes_request_irq_b(space->machine, ARCHIMEDES_IRQB_SOUND_EMPTY);
+ archimedes_request_irq_b(space->machine(), ARCHIMEDES_IRQB_SOUND_EMPTY);
break;
case 7: /* Control */
@@ -911,7 +911,7 @@ WRITE32_HANDLER(archimedes_memc_w)
if ((data>>10)&1)
{
vidc_vidcur = 0;
- vid_timer->adjust(space->machine->primary_screen->time_until_pos(vidc_regs[0xb4]));
+ vid_timer->adjust(space->machine().primary_screen->time_until_pos(vidc_regs[0xb4]));
}
if ((data>>11)&1)
diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c
index 6a773ecaf3f..39914f03e8d 100644
--- a/src/mame/machine/arkanoid.c
+++ b/src/mame/machine/arkanoid.c
@@ -17,7 +17,7 @@
READ8_HANDLER( arkanoid_Z80_mcu_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
/* return the last value the 68705 wrote, and mark that we've read it */
state->m68705write = 0;
@@ -26,7 +26,7 @@ READ8_HANDLER( arkanoid_Z80_mcu_r )
static TIMER_CALLBACK( test )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->z80write = 1;
state->fromz80 = param;
@@ -34,28 +34,28 @@ static TIMER_CALLBACK( test )
WRITE8_HANDLER( arkanoid_Z80_mcu_w )
{
- space->machine->scheduler().synchronize(FUNC(test), data);
+ space->machine().scheduler().synchronize(FUNC(test), data);
/* boost the interleave for a few usecs to make sure it is read successfully */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
READ8_HANDLER( arkanoid_68705_port_a_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( arkanoid_68705_port_a_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
state->port_a_out = data;
}
WRITE8_HANDLER( arkanoid_68705_ddr_a_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
state->ddr_a = data;
}
@@ -63,7 +63,7 @@ WRITE8_HANDLER( arkanoid_68705_ddr_a_w )
READ8_HANDLER( arkanoid_68705_port_c_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
int res = 0;
/* bit 0 is high on a write strobe; clear it once we've detected it */
@@ -79,7 +79,7 @@ READ8_HANDLER( arkanoid_68705_port_c_r )
WRITE8_HANDLER( arkanoid_68705_port_c_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
if ((state->ddr_c & 0x04) && (~data & 0x04) && (state->port_c_out & 0x04))
{
@@ -99,14 +99,14 @@ WRITE8_HANDLER( arkanoid_68705_port_c_w )
WRITE8_HANDLER( arkanoid_68705_ddr_c_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
state->ddr_c = data;
}
CUSTOM_INPUT( arkanoid_68705_input_r )
{
- arkanoid_state *state = field->port->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = field->port->machine().driver_data<arkanoid_state>();
int res = 0;
/* bit 0x40 of comes from the sticky bit */
@@ -122,10 +122,10 @@ CUSTOM_INPUT( arkanoid_68705_input_r )
CUSTOM_INPUT( arkanoid_input_mux )
{
- arkanoid_state *state = field->port->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = field->port->machine().driver_data<arkanoid_state>();
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(field->port->machine, (state->paddle_select == 0) ? tag1 : tag2);
+ return input_port_read(field->port->machine(), (state->paddle_select == 0) ? tag1 : tag2);
}
/*
@@ -191,7 +191,7 @@ TO DO (2006.09.12) :
/* Kludge for some bootlegs that read this address */
READ8_HANDLER( arkanoid_bootleg_f000_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
UINT8 arkanoid_bootleg_val = 0x00;
switch (state->bootleg_id)
@@ -234,7 +234,7 @@ READ8_HANDLER( arkanoid_bootleg_f000_r )
/* Kludge for some bootlegs that read this address */
READ8_HANDLER( arkanoid_bootleg_f002_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
UINT8 arkanoid_bootleg_val = 0x00;
switch (state->bootleg_id)
@@ -322,7 +322,7 @@ READ8_HANDLER( arkanoid_bootleg_f002_r )
/* Kludge for some bootlegs that write this address */
WRITE8_HANDLER( arkanoid_bootleg_d018_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
state->bootleg_cmd = 0x00;
switch (state->bootleg_id)
@@ -578,7 +578,7 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w )
#ifdef UNUSED_CODE
READ8_HANDLER( block2_bootleg_f000_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
return state->bootleg_cmd;
}
#endif
@@ -586,10 +586,10 @@ READ8_HANDLER( block2_bootleg_f000_r )
/* Kludge for some bootlegs that read this address */
READ8_HANDLER( arkanoid_bootleg_d008_r )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
UINT8 arkanoid_bootleg_d008_bit[8];
UINT8 arkanoid_bootleg_d008_val;
- UINT8 arkanoid_paddle_value = input_port_read(space->machine, "MUX");
+ UINT8 arkanoid_paddle_value = input_port_read(space->machine(), "MUX");
int b;
arkanoid_bootleg_d008_bit[4] = arkanoid_bootleg_d008_bit[6] = arkanoid_bootleg_d008_bit[7] = 0; /* untested bits */
diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c
index b2a7a6190f8..79343d05af5 100644
--- a/src/mame/machine/asic65.c
+++ b/src/mame/machine/asic65.c
@@ -119,13 +119,13 @@ static const UINT8 command_map[3][MAX_COMMANDS] =
*
*************************************/
-void asic65_config(running_machine *machine, int asictype)
+void asic65_config(running_machine &machine, int asictype)
{
memset(&asic65, 0, sizeof(asic65));
asic65.type = asictype;
asic65.yorigin = 0x1800;
if (asic65.type == ASIC65_ROMBASED)
- asic65.cpu = machine->device("asic65");
+ asic65.cpu = machine.device("asic65");
}
@@ -136,9 +136,9 @@ void asic65_config(running_machine *machine, int asictype)
*
*************************************/
-void asic65_reset(running_machine *machine, int state)
+void asic65_reset(running_machine &machine, int state)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* rom-based means reset and clear states */
if (asic65.cpu != NULL)
@@ -147,7 +147,7 @@ void asic65_reset(running_machine *machine, int state)
/* otherwise, do it manually */
else
{
- machine->device<cpu_device>("asic65")->suspend(SUSPEND_REASON_DISABLE, 1);
+ machine.device<cpu_device>("asic65")->suspend(SUSPEND_REASON_DISABLE, 1);
/* if reset is being signalled, clear everything */
if (state && !asic65.reset_state)
@@ -191,8 +191,8 @@ WRITE16_HANDLER( asic65_data_w )
/* rom-based use a deferred write mechanism */
if (asic65.type == ASIC65_ROMBASED)
{
- space->machine->scheduler().synchronize(FUNC(m68k_asic65_deferred_w), data | (offset << 16));
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ space->machine().scheduler().synchronize(FUNC(m68k_asic65_deferred_w), data | (offset << 16));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
return;
}
@@ -230,7 +230,7 @@ READ16_HANDLER( asic65_r )
if (asic65.type == ASIC65_ROMBASED)
{
asic65._68full = 0;
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
return asic65._68data;
}
@@ -448,7 +448,7 @@ READ16_HANDLER( asic65_io_r )
/* bit 14 = 68FULL */
/* bit 13 = XFLG */
/* bit 12 = controlled by jumper */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
return (asic65.tfull << 15) | (asic65._68full << 14) | (asic65.xflg << 13) | 0x0000;
}
else
diff --git a/src/mame/machine/asic65.h b/src/mame/machine/asic65.h
index f2011310014..eb5944411ad 100644
--- a/src/mame/machine/asic65.h
+++ b/src/mame/machine/asic65.h
@@ -9,8 +9,8 @@
#define ASIC65_GUARDIANS 2
#define ASIC65_ROMBASED 3
-void asic65_config(running_machine *machine, int asictype);
-void asic65_reset(running_machine *machine, int state);
+void asic65_config(running_machine &machine, int asictype);
+void asic65_reset(running_machine &machine, int state);
WRITE16_HANDLER( asic65_data_w );
READ16_HANDLER( asic65_r );
READ16_HANDLER( asic65_io_r );
diff --git a/src/mame/machine/asteroid.c b/src/mame/machine/asteroid.c
index 9bccca5aee1..9eae17683d6 100644
--- a/src/mame/machine/asteroid.c
+++ b/src/mame/machine/asteroid.c
@@ -16,27 +16,27 @@
INTERRUPT_GEN( asteroid_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (!(input_port_read(device->machine, "IN0") & 0x80))
+ if (!(input_port_read(device->machine(), "IN0") & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( asterock_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if ((input_port_read(device->machine, "IN0") & 0x80))
+ if ((input_port_read(device->machine(), "IN0") & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( llander_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (input_port_read(device->machine, "IN0") & 0x02)
+ if (input_port_read(device->machine(), "IN0") & 0x02)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
READ8_HANDLER( asteroid_IN0_r )
{
- int res = input_port_read(space->machine, "IN0");
+ int res = input_port_read(space->machine(), "IN0");
int bitmask = (1 << offset);
if (res & bitmask)
@@ -50,7 +50,7 @@ READ8_HANDLER( asteroid_IN0_r )
READ8_HANDLER( asterock_IN0_r )
{
- int res = input_port_read(space->machine, "IN0");
+ int res = input_port_read(space->machine(), "IN0");
int bitmask = (1 << offset);
if (res & bitmask)
@@ -68,7 +68,7 @@ READ8_HANDLER( asterock_IN0_r )
READ8_HANDLER( asteroid_IN1_r )
{
- int res = input_port_read(space->machine, "IN1");
+ int res = input_port_read(space->machine(), "IN1");
int bitmask = (1 << (offset & 0x7));
if (res & bitmask)
@@ -85,7 +85,7 @@ READ8_HANDLER( asteroid_DSW1_r )
int res;
int res1;
- res1 = input_port_read(space->machine, "DSW1");
+ res1 = input_port_read(space->machine(), "DSW1");
res = 0xfc | ((res1 >> (2 * (3 - (offset & 0x3)))) & 0x3);
return res;
@@ -94,47 +94,47 @@ READ8_HANDLER( asteroid_DSW1_r )
WRITE8_HANDLER( asteroid_bank_switch_w )
{
- asteroid_state *state = space->machine->driver_data<asteroid_state>();
+ asteroid_state *state = space->machine().driver_data<asteroid_state>();
if (data & 4)
{
- memory_set_bankptr(space->machine, "bank1", state->ram2);
- memory_set_bankptr(space->machine, "bank2", state->ram1);
+ memory_set_bankptr(space->machine(), "bank1", state->ram2);
+ memory_set_bankptr(space->machine(), "bank2", state->ram1);
}
else
{
- memory_set_bankptr(space->machine, "bank1", state->ram1);
- memory_set_bankptr(space->machine, "bank2", state->ram2);
+ memory_set_bankptr(space->machine(), "bank1", state->ram1);
+ memory_set_bankptr(space->machine(), "bank2", state->ram2);
}
- set_led_status (space->machine, 0, ~data & 0x02);
- set_led_status (space->machine, 1, ~data & 0x01);
+ set_led_status (space->machine(), 0, ~data & 0x02);
+ set_led_status (space->machine(), 1, ~data & 0x01);
}
WRITE8_HANDLER( astdelux_bank_switch_w )
{
- asteroid_state *state = space->machine->driver_data<asteroid_state>();
+ asteroid_state *state = space->machine().driver_data<asteroid_state>();
if (data & 0x80)
{
- memory_set_bankptr(space->machine, "bank1", state->ram2);
- memory_set_bankptr(space->machine, "bank2", state->ram1);
+ memory_set_bankptr(space->machine(), "bank1", state->ram2);
+ memory_set_bankptr(space->machine(), "bank2", state->ram1);
}
else
{
- memory_set_bankptr(space->machine, "bank1", state->ram1);
- memory_set_bankptr(space->machine, "bank2", state->ram2);
+ memory_set_bankptr(space->machine(), "bank1", state->ram1);
+ memory_set_bankptr(space->machine(), "bank2", state->ram2);
}
}
WRITE8_HANDLER( astdelux_led_w )
{
- set_led_status(space->machine, offset, (data & 0x80) ? 0 : 1);
+ set_led_status(space->machine(), offset, (data & 0x80) ? 0 : 1);
}
MACHINE_RESET( asteroid )
{
- asteroid_bank_switch_w(machine->device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
- avgdvg_reset_w(machine->device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
+ asteroid_bank_switch_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
+ avgdvg_reset_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
}
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index 7400f4f708a..73cd3dd633f 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -20,7 +20,7 @@
#define VERBOSE_SERIAL 0
#define VERBOSE_TIMERS 0
-static void a600xl_mmu(running_machine *machine, UINT8 new_mmu);
+static void a600xl_mmu(running_machine &machine, UINT8 new_mmu);
static void pokey_reset(running_machine &machine);
@@ -53,7 +53,7 @@ void atari_interrupt_cb(device_t *device, int mask)
logerror("atari interrupt_cb TIMR1\n");
}
- cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, HOLD_LINE);
}
/**************************************************************
@@ -64,15 +64,15 @@ void atari_interrupt_cb(device_t *device, int mask)
READ8_DEVICE_HANDLER(atari_pia_pa_r)
{
- return atari_input_disabled(device->machine) ? 0xFF : input_port_read_safe(device->machine, "djoy_0_1", 0);
+ return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_0_1", 0);
}
READ8_DEVICE_HANDLER(atari_pia_pb_r)
{
- return atari_input_disabled(device->machine) ? 0xFF : input_port_read_safe(device->machine, "djoy_2_3", 0);
+ return atari_input_disabled(device->machine()) ? 0xFF : input_port_read_safe(device->machine(), "djoy_2_3", 0);
}
-WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(device->machine, data); }
+WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(device->machine(), data); }
static WRITE_LINE_DEVICE_HANDLER(atari_pia_cb2_w) { } // This is used by Floppy drive on Atari 8bits Home Computers
@@ -99,20 +99,20 @@ const pia6821_interface atarixl_pia_interface =
*
**************************************************************/
-void a600xl_mmu(running_machine *machine, UINT8 new_mmu)
+void a600xl_mmu(running_machine &machine, UINT8 new_mmu)
{
/* check if self-test ROM changed */
if ( new_mmu & 0x80 )
{
- logerror("%s MMU SELFTEST RAM\n", machine->system().name);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x5000, 0x57ff);
+ logerror("%s MMU SELFTEST RAM\n", machine.system().name);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_readwrite(0x5000, 0x57ff);
}
else
{
- logerror("%s MMU SELFTEST ROM\n", machine->system().name);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5000, 0x57ff);
- memory_set_bankptr(machine, "bank2", machine->region("maincpu")->base() + 0x5000);
+ logerror("%s MMU SELFTEST ROM\n", machine.system().name);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5000, 0x57ff, "bank2");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5000, 0x57ff);
+ memory_set_bankptr(machine, "bank2", machine.region("maincpu")->base() + 0x5000);
}
}
@@ -157,9 +157,9 @@ void a600xl_mmu(running_machine *machine, UINT8 new_mmu)
static int atari_last;
-void a800_handle_keyboard(running_machine *machine)
+void a800_handle_keyboard(running_machine &machine)
{
- device_t *pokey = machine->device("pokey");
+ device_t *pokey = machine.device("pokey");
int atari_code, count, ipt, i;
static const char *const tag[] = {
"keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
@@ -242,9 +242,9 @@ void a800_handle_keyboard(running_machine *machine)
**************************************************************/
-void a5200_handle_keypads(running_machine *machine)
+void a5200_handle_keypads(running_machine &machine)
{
- device_t *pokey = machine->device("pokey");
+ device_t *pokey = machine.device("pokey");
int atari_code, count, ipt, i;
static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" };
@@ -316,13 +316,13 @@ static void pokey_reset(running_machine &machine)
static UINT8 console_read(address_space *space)
{
- return input_port_read(space->machine, "console");
+ return input_port_read(space->machine(), "console");
}
static void console_write(address_space *space, UINT8 data)
{
- device_t *dac = space->machine->device("dac");
+ device_t *dac = space->machine().device("dac");
if (data & 0x08)
dac_data_w(dac, (UINT8)-120);
else
@@ -336,23 +336,23 @@ static void _antic_reset(running_machine &machine)
}
-void atari_machine_start(running_machine *machine)
+void atari_machine_start(running_machine &machine)
{
gtia_interface gtia_intf;
/* GTIA */
memset(&gtia_intf, 0, sizeof(gtia_intf));
- if (machine->port("console") != NULL)
+ if (machine.port("console") != NULL)
gtia_intf.console_read = console_read;
- if (machine->device("dac") != NULL)
+ if (machine.device("dac") != NULL)
gtia_intf.console_write = console_write;
gtia_init(machine, &gtia_intf);
/* pokey */
- machine->add_notifier(MACHINE_NOTIFY_RESET, pokey_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, pokey_reset);
/* ANTIC */
- machine->add_notifier(MACHINE_NOTIFY_RESET, _antic_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, _antic_reset);
/* save states */
state_save_register_global_pointer(machine, ((UINT8 *) &antic.r), sizeof(antic.r));
diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c
index 63cc0e52652..70c9359c498 100644
--- a/src/mame/machine/atarifb.c
+++ b/src/mame/machine/atarifb.c
@@ -12,8 +12,8 @@
WRITE8_HANDLER( atarifb_out1_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
- device_t *discrete = space->machine->device("discrete");
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
+ device_t *discrete = space->machine().device("discrete");
state->CTRLD = data;
@@ -26,8 +26,8 @@ WRITE8_HANDLER( atarifb_out1_w )
WRITE8_HANDLER( atarifb4_out1_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
- device_t *discrete = space->machine->device("discrete");
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
+ device_t *discrete = space->machine().device("discrete");
state->CTRLD = data;
@@ -36,14 +36,14 @@ WRITE8_HANDLER( atarifb4_out1_w )
discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10); // Attract
discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
WRITE8_HANDLER( abaseb_out1_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
- device_t *discrete = space->machine->device("discrete");
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
+ device_t *discrete = space->machine().device("discrete");
state->CTRLD = data;
@@ -55,22 +55,22 @@ WRITE8_HANDLER( abaseb_out1_w )
if (data & 0x80)
{
/* Invert video */
- palette_set_color(space->machine, 1, MAKE_RGB(0x00,0x00,0x00)); /* black */
- palette_set_color(space->machine, 0, MAKE_RGB(0xff,0xff,0xff)); /* white */
+ palette_set_color(space->machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* black */
+ palette_set_color(space->machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* white */
}
else
{
/* Regular video */
- palette_set_color(space->machine, 0, MAKE_RGB(0x00,0x00,0x00)); /* black */
- palette_set_color(space->machine, 1, MAKE_RGB(0xff,0xff,0xff)); /* white */
+ palette_set_color(space->machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* black */
+ palette_set_color(space->machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* white */
}
}
WRITE8_HANDLER( soccer_out1_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
- device_t *discrete = space->machine->device("discrete");
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
+ device_t *discrete = space->machine().device("discrete");
state->CTRLD = data;
@@ -87,30 +87,30 @@ WRITE8_HANDLER( soccer_out1_w )
discrete_sound_w(discrete, ATARIFB_ATTRACT_EN, data & 0x10); // Attract
discrete_sound_w(discrete, ATARIFB_NOISE_EN, data & 0x04); // Noise Enable / Kicker
-// set_led_status(space->machine, 0, data & 0x10); // !!!!!!!!!! Is this correct????
- set_led_status(space->machine, 1, data & 0x80);
+// set_led_status(space->machine(), 0, data & 0x10); // !!!!!!!!!! Is this correct????
+ set_led_status(space->machine(), 1, data & 0x80);
}
WRITE8_HANDLER( atarifb_out2_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd
- coin_counter_w (space->machine, 0, data & 0x10);
+ coin_counter_w (space->machine(), 0, data & 0x10);
}
WRITE8_HANDLER( soccer_out2_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd
- coin_counter_w (space->machine, 0, data & 0x10);
- coin_counter_w (space->machine, 1, data & 0x20);
- coin_counter_w (space->machine, 2, data & 0x40);
+ coin_counter_w (space->machine(), 0, data & 0x10);
+ coin_counter_w (space->machine(), 1, data & 0x20);
+ coin_counter_w (space->machine(), 2, data & 0x40);
}
@@ -123,7 +123,7 @@ WRITE8_HANDLER( soccer_out2_w )
WRITE8_HANDLER( atarifb_out3_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
int loop = cpu_getiloops(state->maincpu);
switch (loop)
@@ -155,7 +155,7 @@ WRITE8_HANDLER( atarifb_out3_w )
READ8_HANDLER( atarifb_in0_r )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
if ((state->CTRLD & 0x20) == 0x00)
{
int val;
@@ -164,7 +164,7 @@ READ8_HANDLER( atarifb_in0_r )
(state->sign_x_2 >> 6) |
(state->sign_y_1 >> 5) |
(state->sign_x_1 >> 4) |
- input_port_read(space->machine, "IN0");
+ input_port_read(space->machine(), "IN0");
return val;
}
else
@@ -172,14 +172,14 @@ READ8_HANDLER( atarifb_in0_r )
int new_x, new_y;
/* Read player 1 trackball */
- new_x = input_port_read(space->machine, "IN3");
+ new_x = input_port_read(space->machine(), "IN3");
if (new_x != state->counter_x_in0)
{
state->sign_x_1 = (new_x - state->counter_x_in0) & 0x80;
state->counter_x_in0 = new_x;
}
- new_y = input_port_read(space->machine, "IN2");
+ new_y = input_port_read(space->machine(), "IN2");
if (new_y != state->counter_y_in0)
{
state->sign_y_1 = (new_y - state->counter_y_in0) & 0x80;
@@ -193,25 +193,25 @@ READ8_HANDLER( atarifb_in0_r )
READ8_HANDLER( atarifb_in2_r )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
if ((state->CTRLD & 0x20) == 0x00)
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else
{
int new_x, new_y;
/* Read player 2 trackball */
- new_x = input_port_read(space->machine, "IN5");
+ new_x = input_port_read(space->machine(), "IN5");
if (new_x != state->counter_x_in2)
{
state->sign_x_2 = (new_x - state->counter_x_in2) & 0x80;
state->counter_x_in2 = new_x;
}
- new_y = input_port_read(space->machine, "IN4");
+ new_y = input_port_read(space->machine(), "IN4");
if (new_y != state->counter_y_in2)
{
state->sign_y_2 = (new_y - state->counter_y_in2) & 0x80;
@@ -224,7 +224,7 @@ READ8_HANDLER( atarifb_in2_r )
READ8_HANDLER( atarifb4_in0_r )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
/* LD1 and LD2 low, return sign bits */
if ((state->CTRLD & 0x60) == 0x00)
@@ -247,14 +247,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x, new_y;
/* Read player 1 trackball */
- new_x = input_port_read(space->machine, "IN3");
+ new_x = input_port_read(space->machine(), "IN3");
if (new_x != state->counter_x_in0)
{
state->sign_x_1 = (new_x - state->counter_x_in0) & 0x80;
state->counter_x_in0 = new_x;
}
- new_y = input_port_read(space->machine, "IN2");
+ new_y = input_port_read(space->machine(), "IN2");
if (new_y != state->counter_y_in0)
{
state->sign_y_1 = (new_y - state->counter_y_in0) & 0x80;
@@ -269,14 +269,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x, new_y;
/* Read player 2 trackball */
- new_x = input_port_read(space->machine, "IN5");
+ new_x = input_port_read(space->machine(), "IN5");
if (new_x != state->counter_x_in0b)
{
state->sign_x_2 = (new_x - state->counter_x_in0b) & 0x80;
state->counter_x_in0b = new_x;
}
- new_y = input_port_read(space->machine, "IN4");
+ new_y = input_port_read(space->machine(), "IN4");
if (new_y != state->counter_y_in0b)
{
state->sign_y_2 = (new_y - state->counter_y_in0b) & 0x80;
@@ -292,11 +292,11 @@ READ8_HANDLER( atarifb4_in0_r )
READ8_HANDLER( atarifb4_in2_r )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
if ((state->CTRLD & 0x40) == 0x00)
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else if ((state->CTRLD & 0x60) == 0x60)
/* LD1 and LD2 both high, return Team 2 right player (player 3) */
@@ -304,14 +304,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x, new_y;
/* Read player 3 trackball */
- new_x = input_port_read(space->machine, "IN7");
+ new_x = input_port_read(space->machine(), "IN7");
if (new_x != state->counter_x_in2)
{
state->sign_x_3 = (new_x - state->counter_x_in2) & 0x80;
state->counter_x_in2 = new_x;
}
- new_y = input_port_read(space->machine, "IN6");
+ new_y = input_port_read(space->machine(), "IN6");
if (new_y != state->counter_y_in2)
{
state->sign_y_3 = (new_y - state->counter_y_in2) & 0x80;
@@ -326,14 +326,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x, new_y;
/* Read player 4 trackball */
- new_x = input_port_read(space->machine, "IN9");
+ new_x = input_port_read(space->machine(), "IN9");
if (new_x != state->counter_x_in2b)
{
state->sign_x_4 = (new_x - state->counter_x_in2b) & 0x80;
state->counter_x_in2b = new_x;
}
- new_y = input_port_read(space->machine, "IN8");
+ new_y = input_port_read(space->machine(), "IN8");
if (new_y != state->counter_y_in2b)
{
state->sign_y_4 = (new_y - state->counter_y_in2b) & 0x80;
diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c
index 471beeba97c..060baa0f8f0 100644
--- a/src/mame/machine/atarigen.c
+++ b/src/mame/machine/atarigen.c
@@ -67,12 +67,12 @@ static STATE_POSTLOAD( slapstic_postload );
static TIMER_CALLBACK( scanline_interrupt_callback );
-static void update_6502_irq(running_machine *machine);
+static void update_6502_irq(running_machine &machine);
static TIMER_CALLBACK( delayed_sound_reset );
static TIMER_CALLBACK( delayed_sound_w );
static TIMER_CALLBACK( delayed_6502_sound_w );
-static void atarigen_set_vol(running_machine *machine, int volume, device_type type);
+static void atarigen_set_vol(running_machine &machine, int volume, device_type type);
static TIMER_CALLBACK( scanline_timer_callback );
@@ -90,7 +90,7 @@ static TIMER_CALLBACK( atarivc_eof_update );
INLINE const atarigen_screen_timer *get_screen_timer(screen_device &screen)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
int i;
/* find the index of the timer that matches the screen */
@@ -108,20 +108,20 @@ INLINE const atarigen_screen_timer *get_screen_timer(screen_device &screen)
OVERALL INIT
***************************************************************************/
-void atarigen_init(running_machine *machine)
+void atarigen_init(running_machine &machine)
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
screen_device *screen;
int i;
/* allocate timers for all screens */
- assert(machine->m_devicelist.count(SCREEN) <= ARRAY_LENGTH(state->screen_timer));
- for (i = 0, screen = machine->first_screen(); screen != NULL; i++, screen = screen->next_screen())
+ assert(machine.m_devicelist.count(SCREEN) <= ARRAY_LENGTH(state->screen_timer));
+ for (i = 0, screen = machine.first_screen(); screen != NULL; i++, screen = screen->next_screen())
{
state->screen_timer[i].screen = screen;
- state->screen_timer[i].scanline_interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_interrupt_callback), (void *)screen);
- state->screen_timer[i].scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_timer_callback), (void *)screen);
- state->screen_timer[i].atarivc_eof_update_timer = machine->scheduler().timer_alloc(FUNC(atarivc_eof_update), (void *)screen);
+ state->screen_timer[i].scanline_interrupt_timer = machine.scheduler().timer_alloc(FUNC(scanline_interrupt_callback), (void *)screen);
+ state->screen_timer[i].scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_timer_callback), (void *)screen);
+ state->screen_timer[i].atarivc_eof_update_timer = machine.scheduler().timer_alloc(FUNC(atarivc_eof_update), (void *)screen);
}
state->save_item(NAME(state->scanline_int_state));
@@ -165,7 +165,7 @@ void atarigen_init(running_machine *machine)
state->save_item(NAME(state->playfield2_latch));
/* need a postload to reset the state */
- machine->state().register_postload(slapstic_postload, NULL);
+ machine.state().register_postload(slapstic_postload, NULL);
}
@@ -195,9 +195,9 @@ void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_in
states.
---------------------------------------------------------------*/
-void atarigen_update_interrupts(running_machine *machine)
+void atarigen_update_interrupts(running_machine &machine)
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
(*state->update_int_callback)(machine);
}
@@ -221,9 +221,9 @@ void atarigen_scanline_int_set(screen_device &screen, int scanline)
INTERRUPT_GEN( atarigen_scanline_int_gen )
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
state->scanline_int_state = 1;
- (*state->update_int_callback)(device->machine);
+ (*state->update_int_callback)(device->machine());
}
@@ -234,16 +234,16 @@ INTERRUPT_GEN( atarigen_scanline_int_gen )
WRITE16_HANDLER( atarigen_scanline_int_ack_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->scanline_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
WRITE32_HANDLER( atarigen_scanline_int_ack32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->scanline_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
@@ -254,9 +254,9 @@ WRITE32_HANDLER( atarigen_scanline_int_ack32_w )
INTERRUPT_GEN( atarigen_sound_int_gen )
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
state->sound_int_state = 1;
- (*state->update_int_callback)(device->machine);
+ (*state->update_int_callback)(device->machine());
}
@@ -267,16 +267,16 @@ INTERRUPT_GEN( atarigen_sound_int_gen )
WRITE16_HANDLER( atarigen_sound_int_ack_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->sound_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
WRITE32_HANDLER( atarigen_sound_int_ack32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->sound_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
@@ -287,9 +287,9 @@ WRITE32_HANDLER( atarigen_sound_int_ack32_w )
INTERRUPT_GEN( atarigen_video_int_gen )
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
state->video_int_state = 1;
- (*state->update_int_callback)(device->machine);
+ (*state->update_int_callback)(device->machine());
}
@@ -300,16 +300,16 @@ INTERRUPT_GEN( atarigen_video_int_gen )
WRITE16_HANDLER( atarigen_video_int_ack_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->video_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
WRITE32_HANDLER( atarigen_video_int_ack32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->video_int_state = 0;
- (*state->update_int_callback)(space->machine);
+ (*state->update_int_callback)(space->machine());
}
@@ -323,7 +323,7 @@ static TIMER_CALLBACK( scanline_interrupt_callback )
emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer;
/* generate the interrupt */
- atarigen_scanline_int_gen(machine->device("maincpu"));
+ atarigen_scanline_int_gen(machine.device("maincpu"));
/* set a new timer to go off at the same scan line next frame */
timer->adjust(screen.frame_period());
@@ -354,13 +354,13 @@ void atarigen_eeprom_reset(atarigen_state *state)
WRITE16_HANDLER( atarigen_eeprom_enable_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->eeprom_unlocked = 1;
}
WRITE32_HANDLER( atarigen_eeprom_enable32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->eeprom_unlocked = 1;
}
@@ -374,7 +374,7 @@ WRITE32_HANDLER( atarigen_eeprom_enable32_w )
WRITE16_HANDLER( atarigen_eeprom_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
if (!state->eeprom_unlocked)
return;
@@ -385,7 +385,7 @@ WRITE16_HANDLER( atarigen_eeprom_w )
WRITE32_HANDLER( atarigen_eeprom32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
if (!state->eeprom_unlocked)
return;
@@ -405,19 +405,19 @@ WRITE32_HANDLER( atarigen_eeprom32_w )
READ16_HANDLER( atarigen_eeprom_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
return state->eeprom[offset] | 0xff00;
}
READ16_HANDLER( atarigen_eeprom_upper_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
return state->eeprom[offset] | 0x00ff;
}
READ32_HANDLER( atarigen_eeprom_upper32_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
return (state->eeprom[offset * 2] << 16) | state->eeprom[offset * 2 + 1] | 0x00ff00ff;
}
@@ -446,7 +446,7 @@ INLINE void update_bank(atarigen_state *state, int bank)
static STATE_POSTLOAD( slapstic_postload )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
update_bank(state, slapstic_bank());
}
@@ -483,7 +483,7 @@ DIRECT_UPDATE_HANDLER( atarigen_slapstic_setdirect )
void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int chipnum)
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
/* reset in case we have no state */
state->slapstic_num = chipnum;
@@ -493,13 +493,13 @@ void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int ch
if (chipnum != 0)
{
/* initialize the slapstic */
- slapstic_init(device->machine, chipnum);
+ slapstic_init(device->machine(), chipnum);
/* install the memory handlers */
state->slapstic = device->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(base, base + 0x7fff, 0, mirror, FUNC(atarigen_slapstic_r), FUNC(atarigen_slapstic_w));
/* allocate memory for a copy of bank 0 */
- state->slapstic_bank0 = auto_alloc_array(device->machine, UINT8, 0x2000);
+ state->slapstic_bank0 = auto_alloc_array(device->machine(), UINT8, 0x2000);
memcpy(state->slapstic_bank0, state->slapstic, 0x2000);
/* ensure we recopy memory for the bank */
@@ -510,7 +510,7 @@ void atarigen_slapstic_init(device_t *device, offs_t base, offs_t mirror, int ch
state->slapstic_mirror = mirror;
address_space *space = downcast<cpu_device *>(device)->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(atarigen_slapstic_setdirect, *device->machine));
+ space->set_direct_update_handler(direct_update_delegate_create_static(atarigen_slapstic_setdirect, device->machine()));
}
}
@@ -538,7 +538,7 @@ void atarigen_slapstic_reset(atarigen_state *state)
WRITE16_HANDLER( atarigen_slapstic_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
update_bank(state, slapstic_tweak(space, offset));
}
@@ -551,7 +551,7 @@ WRITE16_HANDLER( atarigen_slapstic_w )
READ16_HANDLER( atarigen_slapstic_r )
{
/* fetch the result from the current bank first */
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
int result = state->slapstic[offset & 0xfff];
/* then determine the new one */
@@ -571,7 +571,7 @@ READ16_HANDLER( atarigen_slapstic_r )
void atarigen_sound_io_reset(device_t *device)
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
/* remember which CPU is the sound CPU */
state->sound_cpu = device;
@@ -592,9 +592,9 @@ void atarigen_sound_io_reset(device_t *device)
INTERRUPT_GEN( atarigen_6502_irq_gen )
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
state->timed_int = 1;
- update_6502_irq(device->machine);
+ update_6502_irq(device->machine());
}
@@ -605,17 +605,17 @@ INTERRUPT_GEN( atarigen_6502_irq_gen )
READ8_HANDLER( atarigen_6502_irq_ack_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->timed_int = 0;
- update_6502_irq(space->machine);
+ update_6502_irq(space->machine());
return 0;
}
WRITE8_HANDLER( atarigen_6502_irq_ack_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->timed_int = 0;
- update_6502_irq(space->machine);
+ update_6502_irq(space->machine());
}
@@ -626,9 +626,9 @@ WRITE8_HANDLER( atarigen_6502_irq_ack_w )
void atarigen_ym2151_irq_gen(device_t *device, int irq)
{
- atarigen_state *state = device->machine->driver_data<atarigen_state>();
+ atarigen_state *state = device->machine().driver_data<atarigen_state>();
state->ym2151_int = irq;
- update_6502_irq(device->machine);
+ update_6502_irq(device->machine());
}
@@ -639,7 +639,7 @@ void atarigen_ym2151_irq_gen(device_t *device, int irq)
WRITE16_HANDLER( atarigen_sound_reset_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_reset));
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_reset));
}
@@ -648,9 +648,9 @@ WRITE16_HANDLER( atarigen_sound_reset_w )
manually.
---------------------------------------------------------------*/
-void atarigen_sound_reset(running_machine *machine)
+void atarigen_sound_reset(running_machine &machine)
{
- machine->scheduler().synchronize(FUNC(delayed_sound_reset), 1);
+ machine.scheduler().synchronize(FUNC(delayed_sound_reset), 1);
}
@@ -664,19 +664,19 @@ void atarigen_sound_reset(running_machine *machine)
WRITE16_HANDLER( atarigen_sound_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
WRITE16_HANDLER( atarigen_sound_upper_w )
{
if (ACCESSING_BITS_8_15)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 8) & 0xff);
}
WRITE32_HANDLER( atarigen_sound_upper32_w )
{
if (ACCESSING_BITS_24_31)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), (data >> 24) & 0xff);
}
@@ -689,7 +689,7 @@ WRITE32_HANDLER( atarigen_sound_upper32_w )
READ16_HANDLER( atarigen_sound_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->sound_to_cpu_ready = 0;
atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
return state->sound_to_cpu | 0xff00;
@@ -697,7 +697,7 @@ READ16_HANDLER( atarigen_sound_r )
READ16_HANDLER( atarigen_sound_upper_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->sound_to_cpu_ready = 0;
atarigen_sound_int_ack_w(space, 0, 0, 0xffff);
return (state->sound_to_cpu << 8) | 0x00ff;
@@ -705,7 +705,7 @@ READ16_HANDLER( atarigen_sound_upper_r )
READ32_HANDLER( atarigen_sound_upper32_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->sound_to_cpu_ready = 0;
atarigen_sound_int_ack32_w(space, 0, 0, 0xffff);
return (state->sound_to_cpu << 24) | 0x00ffffff;
@@ -719,7 +719,7 @@ READ32_HANDLER( atarigen_sound_upper32_r )
WRITE8_HANDLER( atarigen_6502_sound_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_6502_sound_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_6502_sound_w), data);
}
@@ -730,7 +730,7 @@ WRITE8_HANDLER( atarigen_6502_sound_w )
READ8_HANDLER( atarigen_6502_sound_r )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
state->cpu_to_sound_ready = 0;
device_set_input_line(state->sound_cpu, INPUT_LINE_NMI, CLEAR_LINE);
return state->cpu_to_sound;
@@ -744,9 +744,9 @@ READ8_HANDLER( atarigen_6502_sound_r )
the atarigen_ym2151_irq_gen() callback.
---------------------------------------------------------------*/
-static void update_6502_irq(running_machine *machine)
+static void update_6502_irq(running_machine &machine)
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
if (state->timed_int || state->ym2151_int)
device_set_input_line(state->sound_cpu, M6502_IRQ_LINE, ASSERT_LINE);
else
@@ -761,7 +761,7 @@ static void update_6502_irq(running_machine *machine)
static TIMER_CALLBACK( delayed_sound_reset )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
address_space *space = state->sound_cpu->memory().space(AS_PROGRAM);
/* unhalt and reset the sound CPU */
@@ -777,7 +777,7 @@ static TIMER_CALLBACK( delayed_sound_reset )
/* allocate a high frequency timer until a response is generated */
/* the main CPU is *very* sensistive to the timing of the response */
- machine->scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
+ machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
@@ -788,7 +788,7 @@ static TIMER_CALLBACK( delayed_sound_reset )
static TIMER_CALLBACK( delayed_sound_w )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
/* warn if we missed something */
if (state->cpu_to_sound_ready)
@@ -801,7 +801,7 @@ static TIMER_CALLBACK( delayed_sound_w )
/* allocate a high frequency timer until a response is generated */
/* the main CPU is *very* sensistive to the timing of the response */
- machine->scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
+ machine.scheduler().boost_interleave(SOUND_TIMER_RATE, SOUND_TIMER_BOOST);
}
@@ -812,7 +812,7 @@ static TIMER_CALLBACK( delayed_sound_w )
static TIMER_CALLBACK( delayed_6502_sound_w )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
/* warn if we missed something */
if (state->sound_to_cpu_ready)
@@ -821,7 +821,7 @@ static TIMER_CALLBACK( delayed_6502_sound_w )
/* set up the states and signal the sound interrupt to the main CPU */
state->sound_to_cpu = param;
state->sound_to_cpu_ready = 1;
- atarigen_sound_int_gen(machine->device("maincpu"));
+ atarigen_sound_int_gen(machine.device("maincpu"));
}
@@ -835,10 +835,10 @@ static TIMER_CALLBACK( delayed_6502_sound_w )
changes the volume on all channels associated with it.
---------------------------------------------------------------*/
-void atarigen_set_vol(running_machine *machine, int volume, device_type type)
+void atarigen_set_vol(running_machine &machine, int volume, device_type type)
{
device_sound_interface *sound = NULL;
- for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == type)
sound->set_output_gain(ALL_OUTPUTS, volume / 100.0);
}
@@ -849,27 +849,27 @@ void atarigen_set_vol(running_machine *machine, int volume, device_type type)
of chip.
---------------------------------------------------------------*/
-void atarigen_set_ym2151_vol(running_machine *machine, int volume)
+void atarigen_set_ym2151_vol(running_machine &machine, int volume)
{
atarigen_set_vol(machine, volume, YM2151);
}
-void atarigen_set_ym2413_vol(running_machine *machine, int volume)
+void atarigen_set_ym2413_vol(running_machine &machine, int volume)
{
atarigen_set_vol(machine, volume, YM2413);
}
-void atarigen_set_pokey_vol(running_machine *machine, int volume)
+void atarigen_set_pokey_vol(running_machine &machine, int volume)
{
atarigen_set_vol(machine, volume, POKEY);
}
-void atarigen_set_tms5220_vol(running_machine *machine, int volume)
+void atarigen_set_tms5220_vol(running_machine &machine, int volume)
{
atarigen_set_vol(machine, volume, TMS5220);
}
-void atarigen_set_oki6295_vol(running_machine *machine, int volume)
+void atarigen_set_oki6295_vol(running_machine &machine, int volume)
{
atarigen_set_vol(machine, volume, OKIM6295);
}
@@ -886,7 +886,7 @@ void atarigen_set_oki6295_vol(running_machine *machine, int volume)
void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func update_graphics, int frequency)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
/* set the scanline callback */
state->scanline_callback = update_graphics;
@@ -908,7 +908,7 @@ void atarigen_scanline_timer_reset(screen_device &screen, atarigen_scanline_func
static TIMER_CALLBACK( scanline_timer_callback )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
screen_device &screen = *reinterpret_cast<screen_device *>(ptr);
int scanline = param;
@@ -938,7 +938,7 @@ static TIMER_CALLBACK( scanline_timer_callback )
static TIMER_CALLBACK( atarivc_eof_update )
{
- atarigen_state *state = machine->driver_data<atarigen_state>();
+ atarigen_state *state = machine.driver_data<atarigen_state>();
screen_device &screen = *reinterpret_cast<screen_device *>(ptr);
emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer;
int i;
@@ -985,7 +985,7 @@ static TIMER_CALLBACK( atarivc_eof_update )
void atarivc_reset(screen_device &screen, UINT16 *eof_data, int playfields)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
/* this allows us to manually reset eof_data to NULL if it's not used */
state->atarivc_eof_data = eof_data;
@@ -1015,7 +1015,7 @@ void atarivc_reset(screen_device &screen, UINT16 *eof_data, int playfields)
void atarivc_w(screen_device &screen, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
int oldword = state->atarivc_data[offset];
int newword = oldword;
@@ -1032,7 +1032,7 @@ void atarivc_w(screen_device &screen, offs_t offset, UINT16 data, UINT16 mem_mas
static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newword)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
int oldword = state->atarivc_data[offset];
state->atarivc_data[offset] = newword;
@@ -1123,7 +1123,7 @@ static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newwor
/* scanline IRQ ack here */
case 0x1e:
/* hack: this should be a device */
- atarigen_scanline_int_ack_w(screen.machine->device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
+ atarigen_scanline_int_ack_w(screen.machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
break;
/* log anything else */
@@ -1142,7 +1142,7 @@ static void atarivc_common_w(screen_device &screen, offs_t offset, UINT16 newwor
UINT16 atarivc_r(screen_device &screen, offs_t offset)
{
- atarigen_state *state = screen.machine->driver_data<atarigen_state>();
+ atarigen_state *state = screen.machine().driver_data<atarigen_state>();
logerror("vc_r(%02X)\n", offset);
@@ -1175,14 +1175,14 @@ UINT16 atarivc_r(screen_device &screen, offs_t offset)
WRITE16_HANDLER( atarigen_alpha_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->alpha[offset]);
tilemap_mark_tile_dirty(state->alpha_tilemap, offset);
}
WRITE32_HANDLER( atarigen_alpha32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->alpha32[offset]);
if (ACCESSING_BITS_16_31)
tilemap_mark_tile_dirty(state->alpha_tilemap, offset * 2);
@@ -1192,7 +1192,7 @@ WRITE32_HANDLER( atarigen_alpha32_w )
WRITE16_HANDLER( atarigen_alpha2_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->alpha2[offset]);
tilemap_mark_tile_dirty(state->alpha2_tilemap, offset);
}
@@ -1222,14 +1222,14 @@ void atarigen_set_playfield2_latch(atarigen_state *state, int data)
WRITE16_HANDLER( atarigen_playfield_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset);
}
WRITE32_HANDLER( atarigen_playfield32_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield32[offset]);
if (ACCESSING_BITS_16_31)
tilemap_mark_tile_dirty(state->playfield_tilemap, offset * 2);
@@ -1239,7 +1239,7 @@ WRITE32_HANDLER( atarigen_playfield32_w )
WRITE16_HANDLER( atarigen_playfield2_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield2[offset]);
tilemap_mark_tile_dirty(state->playfield2_tilemap, offset);
}
@@ -1253,7 +1253,7 @@ WRITE16_HANDLER( atarigen_playfield2_w )
WRITE16_HANDLER( atarigen_playfield_large_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset / 2);
}
@@ -1267,7 +1267,7 @@ WRITE16_HANDLER( atarigen_playfield_large_w )
WRITE16_HANDLER( atarigen_playfield_upper_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield_upper[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset);
}
@@ -1281,7 +1281,7 @@ WRITE16_HANDLER( atarigen_playfield_upper_w )
WRITE16_HANDLER( atarigen_playfield_dual_upper_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield_upper[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset);
tilemap_mark_tile_dirty(state->playfield2_tilemap, offset);
@@ -1297,7 +1297,7 @@ WRITE16_HANDLER( atarigen_playfield_dual_upper_w )
WRITE16_HANDLER( atarigen_playfield_latched_lsb_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset);
@@ -1316,7 +1316,7 @@ WRITE16_HANDLER( atarigen_playfield_latched_lsb_w )
WRITE16_HANDLER( atarigen_playfield_latched_msb_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield[offset]);
tilemap_mark_tile_dirty(state->playfield_tilemap, offset);
@@ -1335,7 +1335,7 @@ WRITE16_HANDLER( atarigen_playfield_latched_msb_w )
WRITE16_HANDLER( atarigen_playfield2_latched_msb_w )
{
- atarigen_state *state = space->machine->driver_data<atarigen_state>();
+ atarigen_state *state = space->machine().driver_data<atarigen_state>();
COMBINE_DATA(&state->playfield2[offset]);
tilemap_mark_tile_dirty(state->playfield2_tilemap, offset);
@@ -1370,7 +1370,7 @@ int atarigen_get_hblank(screen_device &screen)
void atarigen_halt_until_hblank_0(screen_device &screen)
{
- device_t *cpu = screen.machine->device("maincpu");
+ device_t *cpu = screen.machine().device("maincpu");
/* halt the CPU until the next HBLANK */
int hpos = screen.hpos();
@@ -1382,7 +1382,7 @@ void atarigen_halt_until_hblank_0(screen_device &screen)
hblank += width;
/* halt and set a timer to wake up */
- screen.machine->scheduler().timer_set(screen.scan_period() * (hblank - hpos) / width, FUNC(unhalt_cpu), 0, (void *)cpu);
+ screen.machine().scheduler().timer_set(screen.scan_period() * (hblank - hpos) / width, FUNC(unhalt_cpu), 0, (void *)cpu);
device_set_input_line(cpu, INPUT_LINE_HALT, ASSERT_LINE);
}
@@ -1395,14 +1395,14 @@ WRITE16_HANDLER( atarigen_666_paletteram_w )
{
int newword, r, g, b;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
r = ((newword >> 9) & 0x3e) | ((newword >> 15) & 1);
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine, offset, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal6bit(r), pal6bit(g), pal6bit(b));
}
@@ -1413,12 +1413,12 @@ WRITE16_HANDLER( atarigen_666_paletteram_w )
WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
if (ACCESSING_BITS_8_15)
{
int palentry = offset / 2;
- int newword = (space->machine->generic.paletteram.u16[palentry * 2] & 0xff00) | (space->machine->generic.paletteram.u16[palentry * 2 + 1] >> 8);
+ int newword = (space->machine().generic.paletteram.u16[palentry * 2] & 0xff00) | (space->machine().generic.paletteram.u16[palentry * 2 + 1] >> 8);
int r, g, b;
@@ -1426,7 +1426,7 @@ WRITE16_HANDLER( atarigen_expanded_666_paletteram_w )
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine, palentry & 0x1ff, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space->machine(), palentry & 0x1ff, pal6bit(r), pal6bit(g), pal6bit(b));
}
}
@@ -1439,28 +1439,28 @@ WRITE32_HANDLER( atarigen_666_paletteram32_w )
{
int newword, r, g, b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
if (ACCESSING_BITS_16_31)
{
- newword = space->machine->generic.paletteram.u32[offset] >> 16;
+ newword = space->machine().generic.paletteram.u32[offset] >> 16;
r = ((newword >> 9) & 0x3e) | ((newword >> 15) & 1);
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine, offset * 2, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2, pal6bit(r), pal6bit(g), pal6bit(b));
}
if (ACCESSING_BITS_0_15)
{
- newword = space->machine->generic.paletteram.u32[offset] & 0xffff;
+ newword = space->machine().generic.paletteram.u32[offset] & 0xffff;
r = ((newword >> 9) & 0x3e) | ((newword >> 15) & 1);
g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 1);
b = ((newword << 1) & 0x3e) | ((newword >> 15) & 1);
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal6bit(r), pal6bit(g), pal6bit(b));
}
}
@@ -1503,10 +1503,10 @@ void atarigen_swap_mem(void *ptr1, void *ptr2, int bytes)
data together to form one. Then frees the second.
---------------------------------------------------------------*/
-void atarigen_blend_gfx(running_machine *machine, int gfx0, int gfx1, int mask0, int mask1)
+void atarigen_blend_gfx(running_machine &machine, int gfx0, int gfx1, int mask0, int mask1)
{
- gfx_element *gx0 = machine->gfx[gfx0];
- gfx_element *gx1 = machine->gfx[gfx1];
+ gfx_element *gx0 = machine.gfx[gfx0];
+ gfx_element *gx1 = machine.gfx[gfx1];
UINT8 *srcdata, *dest;
int c, x, y;
@@ -1535,7 +1535,7 @@ void atarigen_blend_gfx(running_machine *machine, int gfx0, int gfx1, int mask0,
/* free the second graphics element */
gfx_element_free(gx1);
- machine->gfx[gfx1] = NULL;
+ machine.gfx[gfx1] = NULL;
/* create a simple target layout */
gx0->layout.planes = 8;
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index c77fe4e84bd..7fddead265a 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -60,7 +60,7 @@
TYPES & STRUCTURES
***************************************************************************/
-typedef void (*atarigen_int_func)(running_machine *machine);
+typedef void (*atarigen_int_func)(running_machine &machine);
typedef void (*atarigen_scanline_func)(screen_device &screen, int scanline);
@@ -190,7 +190,7 @@ public:
OVERALL INIT
---------------------------------------------------------------*/
-void atarigen_init(running_machine *machine);
+void atarigen_init(running_machine &machine);
/*---------------------------------------------------------------
@@ -198,7 +198,7 @@ void atarigen_init(running_machine *machine);
---------------------------------------------------------------*/
void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int);
-void atarigen_update_interrupts(running_machine *machine);
+void atarigen_update_interrupts(running_machine &machine);
void atarigen_scanline_int_set(screen_device &screen, int scanline);
INTERRUPT_GEN( atarigen_scanline_int_gen );
@@ -261,7 +261,7 @@ READ16_HANDLER( atarigen_sound_upper_r );
WRITE32_HANDLER( atarigen_sound_upper32_w );
READ32_HANDLER( atarigen_sound_upper32_r );
-void atarigen_sound_reset(running_machine *machine);
+void atarigen_sound_reset(running_machine &machine);
WRITE16_HANDLER( atarigen_sound_reset_w );
WRITE8_HANDLER( atarigen_6502_sound_w );
READ8_HANDLER( atarigen_6502_sound_r );
@@ -271,11 +271,11 @@ READ8_HANDLER( atarigen_6502_sound_r );
SOUND HELPERS
---------------------------------------------------------------*/
-void atarigen_set_ym2151_vol(running_machine *machine, int volume);
-void atarigen_set_ym2413_vol(running_machine *machine, int volume);
-void atarigen_set_pokey_vol(running_machine *machine, int volume);
-void atarigen_set_tms5220_vol(running_machine *machine, int volume);
-void atarigen_set_oki6295_vol(running_machine *machine, int volume);
+void atarigen_set_ym2151_vol(running_machine &machine, int volume);
+void atarigen_set_ym2413_vol(running_machine &machine, int volume);
+void atarigen_set_pokey_vol(running_machine &machine, int volume);
+void atarigen_set_tms5220_vol(running_machine &machine, int volume);
+void atarigen_set_oki6295_vol(running_machine &machine, int volume);
/*---------------------------------------------------------------
@@ -331,7 +331,7 @@ WRITE32_HANDLER( atarigen_666_paletteram32_w );
---------------------------------------------------------------*/
void atarigen_swap_mem(void *ptr1, void *ptr2, int bytes);
-void atarigen_blend_gfx(running_machine *machine, int gfx0, int gfx1, int mask0, int mask1);
+void atarigen_blend_gfx(running_machine &machine, int gfx0, int gfx1, int mask0, int mask1);
diff --git a/src/mame/machine/bagman.c b/src/mame/machine/bagman.c
index 3977b14a93b..d88ff99534a 100644
--- a/src/mame/machine/bagman.c
+++ b/src/mame/machine/bagman.c
@@ -201,7 +201,7 @@ UINT8 row, column, val;
WRITE8_HANDLER( bagman_pal16r6_w )
{
- bagman_state *state = space->machine->driver_data<bagman_state>();
+ bagman_state *state = space->machine().driver_data<bagman_state>();
UINT8 line;
line = offset * 4;
@@ -211,8 +211,8 @@ UINT8 line;
MACHINE_RESET( bagman )
{
- bagman_state *state = machine->driver_data<bagman_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ bagman_state *state = machine.driver_data<bagman_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
bagman_pal16r6_w(space, 0, 1); /*pin 2*/
bagman_pal16r6_w(space, 1, 1); /*pin 3*/
bagman_pal16r6_w(space, 2, 1); /*pin 4*/
@@ -226,7 +226,7 @@ MACHINE_RESET( bagman )
READ8_HANDLER( bagman_pal16r6_r )
{
- bagman_state *state = space->machine->driver_data<bagman_state>();
+ bagman_state *state = space->machine().driver_data<bagman_state>();
update_pal(state);
return (state->outvalue[6]) + (state->outvalue[5] << 1) + (state->outvalue[4] << 2) +
(state->outvalue[3] << 3) + (state->outvalue[2] << 4) + (state->outvalue[1] << 5);
diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c
index bdcf57c96a3..fce7643221e 100644
--- a/src/mame/machine/balsente.c
+++ b/src/mame/machine/balsente.c
@@ -16,9 +16,9 @@
/* local prototypes */
-static void poly17_init(running_machine *machine);
-static void counter_set_out(running_machine *machine, int which, int gate);
-static void update_grudge_steering(running_machine *machine);
+static void poly17_init(running_machine &machine);
+static void counter_set_out(running_machine &machine, int which, int gate);
+static void update_grudge_steering(running_machine &machine);
@@ -37,23 +37,23 @@ static TIMER_CALLBACK( irq_off )
TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
{
- balsente_state *state = timer.machine->driver_data<balsente_state>();
+ balsente_state *state = timer.machine().driver_data<balsente_state>();
/* next interrupt after scanline 256 is scanline 64 */
if (param == 256)
- state->scanline_timer->adjust(timer.machine->primary_screen->time_until_pos(64), 64);
+ state->scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(64), 64);
else
- state->scanline_timer->adjust(timer.machine->primary_screen->time_until_pos(param + 64), param + 64);
+ state->scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(param + 64), param + 64);
/* IRQ starts on scanline 0, 64, 128, etc. */
- cputag_set_input_line(timer.machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- timer.machine->scheduler().timer_set(timer.machine->primary_screen->time_until_pos(param, BALSENTE_HBSTART), FUNC(irq_off));
+ timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), FUNC(irq_off));
/* if this is Grudge Match, update the steering */
if (state->grudge_steering_result & 0x80)
- update_grudge_steering(timer.machine);
+ update_grudge_steering(timer.machine());
/* if we're a shooter, we do a little more work */
if (state->shooter)
@@ -63,8 +63,8 @@ TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
/* we latch the beam values on the first interrupt after VBLANK */
if (param == 64)
{
- state->shooter_x = input_port_read(timer.machine, "FAKEX");
- state->shooter_y = input_port_read(timer.machine, "FAKEY");
+ state->shooter_x = input_port_read(timer.machine(), "FAKEX");
+ state->shooter_y = input_port_read(timer.machine(), "FAKEY");
}
/* which bits get returned depends on which scanline we're at */
@@ -78,7 +78,7 @@ TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
MACHINE_START( balsente )
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
int i;
state->cem_device[0] = state->m_cem1;
@@ -139,14 +139,14 @@ MACHINE_START( balsente )
MACHINE_RESET( balsente )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- balsente_state *state = machine->driver_data<balsente_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ balsente_state *state = machine.driver_data<balsente_state>();
int numbanks;
/* reset counters; counter 2's gate is tied high */
memset(state->counter, 0, sizeof(state->counter));
- state->counter[1].timer = machine->device<timer_device>("8253_1_timer");
- state->counter[2].timer = machine->device<timer_device>("8253_2_timer");
+ state->counter[1].timer = machine.device<timer_device>("8253_1_timer");
+ state->counter[2].timer = machine.device<timer_device>("8253_2_timer");
state->counter[2].gate = 1;
/* reset the manual counter 0 clock */
@@ -173,15 +173,15 @@ MACHINE_RESET( balsente )
memset(state->noise_position, 0, sizeof(state->noise_position));
/* point the banks to bank 0 */
- numbanks = (machine->region("maincpu")->bytes() > 0x40000) ? 16 : 8;
- memory_configure_bank(machine, "bank1", 0, numbanks, &machine->region("maincpu")->base()[0x10000], 0x6000);
- memory_configure_bank(machine, "bank2", 0, numbanks, &machine->region("maincpu")->base()[0x12000], 0x6000);
- memory_set_bank(space->machine, "bank1", 0);
- memory_set_bank(space->machine, "bank2", 0);
- machine->device("maincpu")->reset();
+ numbanks = (machine.region("maincpu")->bytes() > 0x40000) ? 16 : 8;
+ memory_configure_bank(machine, "bank1", 0, numbanks, &machine.region("maincpu")->base()[0x10000], 0x6000);
+ memory_configure_bank(machine, "bank2", 0, numbanks, &machine.region("maincpu")->base()[0x12000], 0x6000);
+ memory_set_bank(space->machine(), "bank1", 0);
+ memory_set_bank(space->machine(), "bank2", 0);
+ machine.device("maincpu")->reset();
/* start a timer to generate interrupts */
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -195,9 +195,9 @@ MACHINE_RESET( balsente )
*
*************************************/
-static void poly17_init(running_machine *machine)
+static void poly17_init(running_machine &machine)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
UINT32 i, x = 0;
UINT8 *p, *r;
@@ -220,7 +220,7 @@ static void poly17_init(running_machine *machine)
void balsente_noise_gen(device_t *device, int count, short *buffer)
{
- balsente_state *state = device->machine->driver_data<balsente_state>();
+ balsente_state *state = device->machine().driver_data<balsente_state>();
int chip;
UINT32 step, noise_counter;
@@ -260,11 +260,11 @@ WRITE8_HANDLER( balsente_random_reset_w )
READ8_HANDLER( balsente_random_num_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
UINT32 cc;
/* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */
- cc = space->machine->firstcpu->total_cycles();
+ cc = space->machine().firstcpu->total_cycles();
/* 12.5 = 8 + 4 + 0.5 */
cc = (cc << 3) + (cc << 2) + (cc >> 1);
@@ -282,8 +282,8 @@ READ8_HANDLER( balsente_random_num_r )
WRITE8_HANDLER( balsente_rombank_select_w )
{
/* the bank number comes from bits 4-6 */
- memory_set_bank(space->machine, "bank1", (data >> 4) & 7);
- memory_set_bank(space->machine, "bank2", (data >> 4) & 7);
+ memory_set_bank(space->machine(), "bank1", (data >> 4) & 7);
+ memory_set_bank(space->machine(), "bank2", (data >> 4) & 7);
}
@@ -293,20 +293,20 @@ WRITE8_HANDLER( balsente_rombank2_select_w )
int bank = data & 7;
/* top bit controls which half of the ROMs to use (Name that Tune only) */
- if (space->machine->region("maincpu")->bytes() > 0x40000) bank |= (data >> 4) & 8;
+ if (space->machine().region("maincpu")->bytes() > 0x40000) bank |= (data >> 4) & 8;
/* when they set the AB bank, it appears as though the CD bank is reset */
if (data & 0x20)
{
- memory_set_bank(space->machine, "bank1", bank);
- memory_set_bank(space->machine, "bank2", 6);
+ memory_set_bank(space->machine(), "bank1", bank);
+ memory_set_bank(space->machine(), "bank2", 6);
}
/* set both banks */
else
{
- memory_set_bank(space->machine, "bank1", bank);
- memory_set_bank(space->machine, "bank2", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
+ memory_set_bank(space->machine(), "bank2", bank);
}
}
@@ -331,7 +331,7 @@ WRITE8_HANDLER( balsente_misc_output_w )
}
else
{
-// set_led_status(space->machine, offset, data);
+// set_led_status(space->machine(), offset, data);
}
}
@@ -343,9 +343,9 @@ WRITE8_HANDLER( balsente_misc_output_w )
*
*************************************/
-static void m6850_update_io(running_machine *machine)
+static void m6850_update_io(running_machine &machine)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
UINT8 new_state;
/* sound -> main CPU communications */
@@ -438,7 +438,7 @@ static void m6850_update_io(running_machine *machine)
READ8_HANDLER( balsente_m6850_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
int result;
/* status register is at offset 0 */
@@ -454,7 +454,7 @@ READ8_HANDLER( balsente_m6850_r )
/* clear the overrun and receive buffer full bits */
state->m6850_status &= ~0x21;
- m6850_update_io(space->machine);
+ m6850_update_io(space->machine());
}
return result;
@@ -463,7 +463,7 @@ READ8_HANDLER( balsente_m6850_r )
static TIMER_CALLBACK( m6850_data_ready_callback )
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
/* set the output data byte and indicate that we're ready to go */
state->m6850_output = param;
@@ -474,7 +474,7 @@ static TIMER_CALLBACK( m6850_data_ready_callback )
static TIMER_CALLBACK( m6850_w_callback )
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
/* indicate that the transmit buffer is no longer empty and update the I/O state */
state->m6850_status &= ~0x02;
@@ -482,13 +482,13 @@ static TIMER_CALLBACK( m6850_w_callback )
/* set a timer for 500usec later to actually transmit the data */
/* (this is very important for several games, esp Snacks'n Jaxson) */
- machine->scheduler().timer_set(attotime::from_usec(500), FUNC(m6850_data_ready_callback), param);
+ machine.scheduler().timer_set(attotime::from_usec(500), FUNC(m6850_data_ready_callback), param);
}
WRITE8_HANDLER( balsente_m6850_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* control register is at offset 0 */
if (offset == 0)
@@ -496,12 +496,12 @@ WRITE8_HANDLER( balsente_m6850_w )
state->m6850_control = data;
/* re-update since interrupt enables could have been modified */
- m6850_update_io(space->machine);
+ m6850_update_io(space->machine());
}
/* output register is at offset 1; set a timer to synchronize the CPUs */
else
- space->machine->scheduler().synchronize(FUNC(m6850_w_callback), data);
+ space->machine().scheduler().synchronize(FUNC(m6850_w_callback), data);
}
@@ -514,7 +514,7 @@ WRITE8_HANDLER( balsente_m6850_w )
READ8_HANDLER( balsente_m6850_sound_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
int result;
/* status register is at offset 0 */
@@ -530,7 +530,7 @@ READ8_HANDLER( balsente_m6850_sound_r )
/* clear the overrun and receive buffer full bits */
state->m6850_sound_status &= ~0x21;
- m6850_update_io(space->machine);
+ m6850_update_io(space->machine());
}
return result;
@@ -539,7 +539,7 @@ READ8_HANDLER( balsente_m6850_sound_r )
WRITE8_HANDLER( balsente_m6850_sound_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* control register is at offset 0 */
if (offset == 0)
@@ -553,7 +553,7 @@ WRITE8_HANDLER( balsente_m6850_sound_w )
}
/* re-update since interrupt enables could have been modified */
- m6850_update_io(space->machine);
+ m6850_update_io(space->machine());
}
@@ -566,7 +566,7 @@ WRITE8_HANDLER( balsente_m6850_sound_w )
INTERRUPT_GEN( balsente_update_analog_inputs )
{
- balsente_state *state = device->machine->driver_data<balsente_state>();
+ balsente_state *state = device->machine().driver_data<balsente_state>();
int i;
static const char *const analog[] = { "AN0", "AN1", "AN2", "AN3" };
@@ -575,13 +575,13 @@ INTERRUPT_GEN( balsente_update_analog_inputs )
/* ports are read once a frame, just at varying intervals. To get around this, we */
/* read all the analog inputs at VBLANK time and just return the cached values. */
for (i = 0; i < 4; i++)
- state->analog_input_data[i] = input_port_read(device->machine, analog[i]);
+ state->analog_input_data[i] = input_port_read(device->machine(), analog[i]);
}
static TIMER_CALLBACK( adc_finished )
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
int which = param;
/* analog controls are read in two pieces; the lower port returns the sign */
@@ -616,7 +616,7 @@ static TIMER_CALLBACK( adc_finished )
READ8_HANDLER( balsente_adc_data_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* just return the last value read */
return state->adc_value;
@@ -628,7 +628,7 @@ WRITE8_HANDLER( balsente_adc_select_w )
/* set a timer to go off and read the value after 50us */
/* it's important that we do this for Mini Golf */
logerror("adc_select %d\n", offset & 7);
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(adc_finished), offset & 7);
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(adc_finished), offset & 7);
}
@@ -686,9 +686,9 @@ INLINE void counter_update_count(balsente_state *state, int which)
*
*************************************/
-static void counter_set_gate(running_machine *machine, int which, int gate)
+static void counter_set_gate(running_machine &machine, int which, int gate)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
int oldgate = state->counter[which].gate;
/* remember the gate state */
@@ -720,9 +720,9 @@ static void counter_set_gate(running_machine *machine, int which, int gate)
}
-static void counter_set_out(running_machine *machine, int which, int out)
+static void counter_set_out(running_machine &machine, int which, int out)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
/* OUT on counter 2 is hooked to the /INT line on the Z80 */
if (which == 2)
@@ -739,7 +739,7 @@ static void counter_set_out(running_machine *machine, int which, int out)
TIMER_DEVICE_CALLBACK( balsente_counter_callback )
{
- balsente_state *state = timer.machine->driver_data<balsente_state>();
+ balsente_state *state = timer.machine().driver_data<balsente_state>();
/* reset the counter and the count */
state->counter[param].timer_active = 0;
@@ -748,7 +748,7 @@ TIMER_DEVICE_CALLBACK( balsente_counter_callback )
/* set the state of the OUT line */
/* mode 0 and 1: when firing, transition OUT to high */
if (state->counter[param].mode == 0 || state->counter[param].mode == 1)
- counter_set_out(timer.machine, param, 1);
+ counter_set_out(timer.machine(), param, 1);
/* no other modes handled currently */
}
@@ -765,7 +765,7 @@ TIMER_DEVICE_CALLBACK( balsente_counter_callback )
READ8_HANDLER( balsente_counter_8253_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
int which;
switch (offset & 3)
@@ -800,7 +800,7 @@ READ8_HANDLER( balsente_counter_8253_r )
WRITE8_HANDLER( balsente_counter_8253_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
int which;
switch (offset & 3)
@@ -813,7 +813,7 @@ WRITE8_HANDLER( balsente_counter_8253_w )
/* if the counter is in mode 0, a write here will reset the OUT state */
if (state->counter[which].mode == 0)
- counter_set_out(space->machine, which, 0);
+ counter_set_out(space->machine(), which, 0);
/* write the LSB */
if (state->counter[which].writebyte == 0)
@@ -842,7 +842,7 @@ WRITE8_HANDLER( balsente_counter_8253_w )
/* if the counter is in mode 1, a write here will set the OUT state */
if (state->counter[which].mode == 1)
- counter_set_out(space->machine, which, 1);
+ counter_set_out(space->machine(), which, 1);
}
break;
@@ -853,14 +853,14 @@ WRITE8_HANDLER( balsente_counter_8253_w )
/* if the counter was in mode 0, a write here will reset the OUT state */
if (((state->counter[which].mode >> 1) & 7) == 0)
- counter_set_out(space->machine, which, 0);
+ counter_set_out(space->machine(), which, 0);
/* set the mode */
state->counter[which].mode = (data >> 1) & 7;
/* if the counter is in mode 0, a write here will reset the OUT state */
if (state->counter[which].mode == 0)
- counter_set_out(space->machine, which, 0);
+ counter_set_out(space->machine(), which, 0);
break;
}
}
@@ -875,7 +875,7 @@ WRITE8_HANDLER( balsente_counter_8253_w )
static void set_counter_0_ff(timer_device &timer, int newstate)
{
- balsente_state *state = timer.machine->driver_data<balsente_state>();
+ balsente_state *state = timer.machine().driver_data<balsente_state>();
/* the flip/flop output is inverted, so if we went high to low, that's a clock */
if (state->counter_0_ff && !newstate)
@@ -896,7 +896,7 @@ static void set_counter_0_ff(timer_device &timer, int newstate)
TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff )
{
- balsente_state *state = timer.machine->driver_data<balsente_state>();
+ balsente_state *state = timer.machine().driver_data<balsente_state>();
/* clock the D value through the flip-flop */
set_counter_0_ff(timer, (state->counter_control >> 3) & 1);
@@ -949,7 +949,7 @@ static void update_counter_0_timer(balsente_state *state)
READ8_HANDLER( balsente_counter_state_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* bit D0 is the inverse of the flip-flop state */
int result = !state->counter_0_ff;
@@ -963,7 +963,7 @@ READ8_HANDLER( balsente_counter_state_r )
WRITE8_HANDLER( balsente_counter_control_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
UINT8 diff_counter_control = state->counter_control ^ data;
/* set the new global value */
@@ -992,14 +992,14 @@ WRITE8_HANDLER( balsente_counter_control_w )
}
/* set the actual gate afterwards, since we need to know the old value above */
- counter_set_gate(space->machine, 0, (data >> 1) & 1);
+ counter_set_gate(space->machine(), 0, (data >> 1) & 1);
/* bits D2 and D4 control the clear/reset flags on the flip-flop that feeds counter 0 */
if (!(data & 0x04)) set_counter_0_ff(*state->counter_0_timer, 1);
if (!(data & 0x10)) set_counter_0_ff(*state->counter_0_timer, 0);
/* bit 5 clears the NMI interrupt; recompute the I/O state now */
- m6850_update_io(space->machine);
+ m6850_update_io(space->machine());
}
@@ -1024,7 +1024,7 @@ WRITE8_HANDLER( balsente_chip_select_w )
CEM3394_WAVE_SELECT
};
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
double voltage = (double)state->dac_value * (8.0 / 4096.0) - 4.0;
int diffchip = data ^ state->chip_select, i;
int reg = register_map[state->dac_register];
@@ -1076,7 +1076,7 @@ WRITE8_HANDLER( balsente_chip_select_w )
WRITE8_HANDLER( balsente_dac_data_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* LSB or MSB? */
if (offset & 1)
@@ -1096,7 +1096,7 @@ WRITE8_HANDLER( balsente_dac_data_w )
WRITE8_HANDLER( balsente_register_addr_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
state->dac_register = data & 7;
}
@@ -1110,14 +1110,14 @@ WRITE8_HANDLER( balsente_register_addr_w )
CUSTOM_INPUT( nstocker_bits_r )
{
- balsente_state *state = field->port->machine->driver_data<balsente_state>();
+ balsente_state *state = field->port->machine().driver_data<balsente_state>();
return state->nstocker_bits;
}
WRITE8_HANDLER( spiker_expand_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* offset 0 is the bit pattern */
if (offset == 0)
@@ -1135,7 +1135,7 @@ WRITE8_HANDLER( spiker_expand_w )
READ8_HANDLER( spiker_expand_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
UINT8 left, right;
/* first rotate each nibble */
@@ -1153,9 +1153,9 @@ READ8_HANDLER( spiker_expand_r )
}
-static void update_grudge_steering(running_machine *machine)
+static void update_grudge_steering(running_machine &machine)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
UINT8 wheel[3];
INT8 diff[3];
@@ -1197,8 +1197,8 @@ static void update_grudge_steering(running_machine *machine)
READ8_HANDLER( grudge_steering_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
- logerror("%04X:grudge_steering_r(@%d)\n", cpu_get_pc(space->cpu), space->machine->primary_screen->vpos());
+ balsente_state *state = space->machine().driver_data<balsente_state>();
+ logerror("%04X:grudge_steering_r(@%d)\n", cpu_get_pc(space->cpu), space->machine().primary_screen->vpos());
state->grudge_steering_result |= 0x80;
return state->grudge_steering_result;
}
@@ -1213,7 +1213,7 @@ READ8_HANDLER( grudge_steering_r )
READ8_HANDLER( shrike_shared_6809_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
UINT16 mem_mask = offset & 1 ? 0xff00 : 0x00ff;
switch( offset )
@@ -1228,7 +1228,7 @@ READ8_HANDLER( shrike_shared_6809_r )
WRITE8_HANDLER( shrike_shared_6809_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
UINT16 mem_mask = offset & 1 ? 0xff00 : 0x00ff;
state->shrike_shared[offset >> 1] = ( state->shrike_shared[offset >> 1] & mem_mask ) | ( data << ( mem_mask & 0x8 ) );
}
@@ -1237,13 +1237,13 @@ WRITE8_HANDLER( shrike_shared_6809_w )
// i.e. write 0xdeadbeef to 10000, read 0xde from 10001, 0xad from 10003, 0xbe from 10005...
WRITE16_HANDLER( shrike_io_68k_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
COMBINE_DATA( &state->shrike_io[offset] );
}
READ16_HANDLER( shrike_io_68k_r )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
return ( state->shrike_io[offset] & mem_mask ) >> ( 8 & ~mem_mask );
}
diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c
index 88452239667..f886a16c0e8 100644
--- a/src/mame/machine/beezer.c
+++ b/src/mame/machine/beezer.c
@@ -88,39 +88,39 @@ static READ_LINE_DEVICE_HANDLER( b_via_0_ca2_r )
static READ8_DEVICE_HANDLER( b_via_0_pa_r )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
return (state->banklatch&0x38)<<2; // return X,Y,Z bits TODO: the Z bit connects somewhere else... where?
}
static READ8_DEVICE_HANDLER( b_via_0_pb_r )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
return state->pbus;
}
static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
if ((data & 0x08) == 0)
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
else
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
if ((data & 0x04) == 0)
{
switch (data & 0x03)
{
case 0:
- state->pbus = input_port_read(device->machine, "IN0");
+ state->pbus = input_port_read(device->machine(), "IN0");
break;
case 1:
- state->pbus = input_port_read(device->machine, "IN1") | (input_port_read(device->machine, "IN2") << 4);
+ state->pbus = input_port_read(device->machine(), "IN1") | (input_port_read(device->machine(), "IN2") << 4);
break;
case 2:
- state->pbus = input_port_read(device->machine, "DSWB");
+ state->pbus = input_port_read(device->machine(), "DSWB");
break;
case 3:
- state->pbus = input_port_read(device->machine, "DSWA"); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
+ state->pbus = input_port_read(device->machine(), "DSWA"); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
break;
}
}
@@ -128,48 +128,48 @@ static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
static WRITE8_DEVICE_HANDLER( b_via_0_pb_w )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
state->pbus = data;
}
static READ8_DEVICE_HANDLER( b_via_1_pa_r )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
return state->pbus;
}
static READ8_DEVICE_HANDLER( b_via_1_pb_r )
{
- return 0x1F | (beezer_noise_r(device->machine->device("custom"), 0)?0x40:0);
+ return 0x1F | (beezer_noise_r(device->machine().device("custom"), 0)?0x40:0);
}
static WRITE8_DEVICE_HANDLER( b_via_1_pa_w )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
+ beezer_state *state = device->machine().driver_data<beezer_state>();
state->pbus = data;
}
static WRITE8_DEVICE_HANDLER( b_via_1_pb_w )
{
- beezer_timer1_w(device->machine->device("custom"), 0, data&0x80);
+ beezer_timer1_w(device->machine().device("custom"), 0, data&0x80);
//if ((data&0x1f) != 0x01)
// popmessage("via1 pb low write of 0x%02x is not supported! contact mamedev!", data&0x1f);
}
DRIVER_INIT( beezer )
{
- beezer_state *state = machine->driver_data<beezer_state>();
+ beezer_state *state = machine.driver_data<beezer_state>();
state->pbus = 0;
state->banklatch = 0;
}
WRITE8_HANDLER( beezer_bankswitch_w )
{
- beezer_state *state = space->machine->driver_data<beezer_state>();
+ beezer_state *state = space->machine().driver_data<beezer_state>();
state->banklatch = data&0x3f; // latched 'x,y,z' plus bank bits in ls174 @ 4H
if ((data & 0x07) == 0)
{
- via6522_device *via_0 = space->machine->device<via6522_device>("via6522_0");
+ via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
space->install_legacy_write_handler(0xc600, 0xc7ff, FUNC(watchdog_reset_w));
space->install_legacy_write_handler(0xc800, 0xc9ff, FUNC(beezer_map_w));
space->install_legacy_read_handler(0xca00, 0xcbff, FUNC(beezer_line_r));
@@ -177,7 +177,7 @@ WRITE8_HANDLER( beezer_bankswitch_w )
}
else
{
- UINT8 *rom = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("maincpu")->base() + 0x10000;
space->install_ram(0xc000, 0xcfff, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0));
}
}
diff --git a/src/mame/machine/bigevglf.c b/src/mame/machine/bigevglf.c
index 0d4ef260863..9dc71755ad8 100644
--- a/src/mame/machine/bigevglf.c
+++ b/src/mame/machine/bigevglf.c
@@ -13,31 +13,31 @@
READ8_HANDLER( bigevglf_68705_port_a_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( bigevglf_68705_port_a_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_a_out = data;
}
WRITE8_HANDLER( bigevglf_68705_ddr_a_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->ddr_a = data;
}
READ8_HANDLER( bigevglf_68705_port_b_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( bigevglf_68705_port_b_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
if ((state->ddr_b & 0x02) && (~state->port_b_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */
{
@@ -56,13 +56,13 @@ WRITE8_HANDLER( bigevglf_68705_port_b_w )
WRITE8_HANDLER( bigevglf_68705_ddr_b_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->ddr_b = data;
}
READ8_HANDLER( bigevglf_68705_port_c_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_c_in = 0;
if (state->main_sent)
@@ -75,19 +75,19 @@ READ8_HANDLER( bigevglf_68705_port_c_r )
WRITE8_HANDLER( bigevglf_68705_port_c_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_c_out = data;
}
WRITE8_HANDLER( bigevglf_68705_ddr_c_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->ddr_c = data;
}
WRITE8_HANDLER( bigevglf_mcu_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_a_in = data;
state->main_sent = 1;
@@ -97,7 +97,7 @@ WRITE8_HANDLER( bigevglf_mcu_w )
READ8_HANDLER( bigevglf_mcu_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->mcu_sent = 1;
return state->from_mcu;
@@ -105,7 +105,7 @@ READ8_HANDLER( bigevglf_mcu_r )
READ8_HANDLER( bigevglf_mcu_status_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
int res = 0;
if (!state->main_sent)
diff --git a/src/mame/machine/bonzeadv.c b/src/mame/machine/bonzeadv.c
index afae58e8078..0d18459e6f8 100644
--- a/src/mame/machine/bonzeadv.c
+++ b/src/mame/machine/bonzeadv.c
@@ -302,9 +302,9 @@ static const struct cchip_mapping *const levelData[]=
level08
};
-static void WriteLevelData( running_machine *machine )
+static void WriteLevelData( running_machine &machine )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
int i;
for (i = 0; i < 13; i++)
@@ -316,7 +316,7 @@ static void WriteLevelData( running_machine *machine )
}
}
-static void WriteRestartPos( running_machine *machine, int level )
+static void WriteRestartPos( running_machine &machine, int level )
{
/*
Cval0/1 = scroll x position
@@ -329,7 +329,7 @@ static void WriteRestartPos( running_machine *machine, int level )
for the restart position to be returned.
*/
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
int x = state->cval[0] + 256 * state->cval[1] + state->cval[4] + 256 * state->cval[5];
int y = state->cval[2] + 256 * state->cval[3] + state->cval[6] + 256 * state->cval[7];
@@ -376,13 +376,13 @@ WRITE16_HANDLER( bonzeadv_cchip_ctrl_w )
WRITE16_HANDLER( bonzeadv_cchip_bank_w )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
state->current_bank = data & 7;
}
WRITE16_HANDLER( bonzeadv_cchip_ram_w )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
// if (cpu_get_pc(space->cpu)!=0xa028)
// logerror("%08x: write %04x %04x cchip\n", cpu_get_pc(space->cpu), offset, data);
@@ -393,20 +393,20 @@ WRITE16_HANDLER( bonzeadv_cchip_ram_w )
{
state->cc_port = data;
- coin_lockout_w(space->machine, 1, data & 0x80);
- coin_lockout_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x20);
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_lockout_w(space->machine(), 1, data & 0x80);
+ coin_lockout_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
}
if (offset == 0x0e && data != 0x00)
{
- WriteRestartPos(space->machine, state->current_round);
+ WriteRestartPos(space->machine(), state->current_round);
}
if (offset == 0x0f && data != 0x00)
{
- WriteLevelData(space->machine);
+ WriteLevelData(space->machine());
}
if (offset == 0x10)
@@ -438,7 +438,7 @@ READ16_HANDLER( bonzeadv_cchip_ctrl_r )
READ16_HANDLER( bonzeadv_cchip_ram_r )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
// logerror("%08x: read %04x cchip\n", cpu_get_pc(space->cpu), offset);
@@ -446,10 +446,10 @@ READ16_HANDLER( bonzeadv_cchip_ram_r )
{
switch (offset)
{
- case 0x03: return input_port_read(space->machine, "800007"); /* STARTn + SERVICE1 */
- case 0x04: return input_port_read(space->machine, "800009"); /* COINn */
- case 0x05: return input_port_read(space->machine, "80000B"); /* Player controls + TILT */
- case 0x06: return input_port_read(space->machine, "80000D"); /* Player controls (cocktail) */
+ case 0x03: return input_port_read(space->machine(), "800007"); /* STARTn + SERVICE1 */
+ case 0x04: return input_port_read(space->machine(), "800009"); /* COINn */
+ case 0x05: return input_port_read(space->machine(), "80000B"); /* Player controls + TILT */
+ case 0x06: return input_port_read(space->machine(), "80000D"); /* Player controls (cocktail) */
case 0x08: return state->cc_port;
}
diff --git a/src/mame/machine/bsktball.c b/src/mame/machine/bsktball.c
index d33f3a7398f..0d2c8d0d4a0 100644
--- a/src/mame/machine/bsktball.c
+++ b/src/mame/machine/bsktball.c
@@ -12,7 +12,7 @@
***************************************************************************/
WRITE8_HANDLER( bsktball_nmion_w )
{
- bsktball_state *state = space->machine->driver_data<bsktball_state>();
+ bsktball_state *state = space->machine().driver_data<bsktball_state>();
state->nmi_on = offset & 0x01;
}
@@ -22,7 +22,7 @@ WRITE8_HANDLER( bsktball_nmion_w )
/* NMI every 32V, IRQ every VBLANK */
INTERRUPT_GEN( bsktball_interrupt )
{
- bsktball_state *state = device->machine->driver_data<bsktball_state>();
+ bsktball_state *state = device->machine().driver_data<bsktball_state>();
/* We mod by 8 because we're interrupting 8x per frame, 1 per 32V */
state->i256v = (state->i256v + 1) % 8;
@@ -39,13 +39,13 @@ INTERRUPT_GEN( bsktball_interrupt )
WRITE8_HANDLER( bsktball_ld1_w )
{
- bsktball_state *state = space->machine->driver_data<bsktball_state>();
+ bsktball_state *state = space->machine().driver_data<bsktball_state>();
state->ld1 = (offset & 0x01);
}
WRITE8_HANDLER( bsktball_ld2_w )
{
- bsktball_state *state = space->machine->driver_data<bsktball_state>();
+ bsktball_state *state = space->machine().driver_data<bsktball_state>();
state->ld2 = (offset & 0x01);
}
@@ -56,17 +56,17 @@ WRITE8_HANDLER( bsktball_ld2_w )
READ8_HANDLER( bsktball_in0_r )
{
- bsktball_state *state = space->machine->driver_data<bsktball_state>();
+ bsktball_state *state = space->machine().driver_data<bsktball_state>();
int p1_horiz;
int p1_vert;
int p2_horiz;
int p2_vert;
int temp;
- p1_horiz = input_port_read(space->machine, "TRACK0_X");
- p1_vert = input_port_read(space->machine, "TRACK0_Y");
- p2_horiz = input_port_read(space->machine, "TRACK1_X");
- p2_vert = input_port_read(space->machine, "TRACK1_Y");
+ p1_horiz = input_port_read(space->machine(), "TRACK0_X");
+ p1_vert = input_port_read(space->machine(), "TRACK0_Y");
+ p2_horiz = input_port_read(space->machine(), "TRACK1_X");
+ p2_vert = input_port_read(space->machine(), "TRACK1_Y");
/* Set direction bits */
@@ -151,7 +151,7 @@ READ8_HANDLER( bsktball_in0_r )
}
else
{
- temp = input_port_read(space->machine, "IN0") & 0x0f;
+ temp = input_port_read(space->machine(), "IN0") & 0x0f;
return (temp | state->dir0 | state->dir1 | state->dir2 | state->dir3);
}
@@ -162,10 +162,10 @@ READ8_HANDLER( bsktball_in0_r )
***************************************************************************/
WRITE8_HANDLER( bsktball_led1_w )
{
- set_led_status(space->machine, 0, offset & 0x01);
+ set_led_status(space->machine(), 0, offset & 0x01);
}
WRITE8_HANDLER( bsktball_led2_w )
{
- set_led_status(space->machine, 1, offset & 0x01);
+ set_led_status(space->machine(), 1, offset & 0x01);
}
diff --git a/src/mame/machine/btime.c b/src/mame/machine/btime.c
index a7b24367edc..7eb06cca64a 100644
--- a/src/mame/machine/btime.c
+++ b/src/mame/machine/btime.c
@@ -6,8 +6,8 @@
READ8_HANDLER( mmonkey_protection_r )
{
- btime_state *state = space->machine->driver_data<btime_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ btime_state *state = space->machine().driver_data<btime_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int ret = 0;
if (offset == 0x0000)
@@ -24,8 +24,8 @@ READ8_HANDLER( mmonkey_protection_r )
WRITE8_HANDLER( mmonkey_protection_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ btime_state *state = space->machine().driver_data<btime_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
if (offset == 0)
{
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 158fd734705..3adc182b9de 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -15,10 +15,10 @@
WRITE8_HANDLER( bublbobl_bankswitch_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
/* bits 0-2 select ROM bank */
- memory_set_bank(space->machine, "bank1", (data ^ 4) & 7);
+ memory_set_bank(space->machine(), "bank1", (data ^ 4) & 7);
/* bit 3 n.c. */
@@ -33,13 +33,13 @@ WRITE8_HANDLER( bublbobl_bankswitch_w )
state->video_enable = data & 0x40;
/* bit 7 flips screen */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
WRITE8_HANDLER( tokio_bankswitch_w )
{
/* bits 0-2 select ROM bank */
- memory_set_bank(space->machine, "bank1", data & 7);
+ memory_set_bank(space->machine(), "bank1", data & 7);
/* bits 3-7 unknown */
}
@@ -47,14 +47,14 @@ WRITE8_HANDLER( tokio_bankswitch_w )
WRITE8_HANDLER( tokio_videoctrl_w )
{
/* bit 7 flips screen */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
/* other bits unknown */
}
WRITE8_HANDLER( bublbobl_nmitrigger_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -78,7 +78,7 @@ static const UINT8 tokio_prot_data[] =
READ8_HANDLER( tokio_mcu_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->tokio_prot_count %= sizeof(tokio_prot_data);
return tokio_prot_data[state->tokio_prot_count++];
@@ -92,7 +92,7 @@ READ8_HANDLER( tokiob_mcu_r )
static TIMER_CALLBACK( nmi_callback )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -103,18 +103,18 @@ static TIMER_CALLBACK( nmi_callback )
WRITE8_HANDLER( bublbobl_sound_command_w )
{
soundlatch_w(space, offset, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
WRITE8_HANDLER( bublbobl_sh_nmi_disable_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->sound_nmi_enable = 0;
}
WRITE8_HANDLER( bublbobl_sh_nmi_enable_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -126,19 +126,19 @@ WRITE8_HANDLER( bublbobl_sh_nmi_enable_w )
WRITE8_HANDLER( bublbobl_soundcpu_reset_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE);
}
READ8_HANDLER( bublbobl_sound_status_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return state->sound_status;
}
WRITE8_HANDLER( bublbobl_sound_status_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->sound_status = data;
}
@@ -152,68 +152,68 @@ Bubble Bobble MCU
READ8_HANDLER( bublbobl_mcu_ddr1_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return state->ddr1;
}
WRITE8_HANDLER( bublbobl_mcu_ddr1_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr1 = data;
}
READ8_HANDLER( bublbobl_mcu_ddr2_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return state->ddr2;
}
WRITE8_HANDLER( bublbobl_mcu_ddr2_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr2 = data;
}
READ8_HANDLER( bublbobl_mcu_ddr3_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return state->ddr3;
}
WRITE8_HANDLER( bublbobl_mcu_ddr3_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr3 = data;
}
READ8_HANDLER( bublbobl_mcu_ddr4_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return state->ddr4;
}
WRITE8_HANDLER( bublbobl_mcu_ddr4_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr4 = data;
}
READ8_HANDLER( bublbobl_mcu_port1_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 1 read\n", cpu_get_pc(space->cpu));
- state->port1_in = input_port_read(space->machine, "IN0");
+ state->port1_in = input_port_read(space->machine(), "IN0");
return (state->port1_out & state->ddr1) | (state->port1_in & ~state->ddr1);
}
WRITE8_HANDLER( bublbobl_mcu_port1_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 1 write %02x\n", cpu_get_pc(space->cpu), data);
// bit 4: coin lockout
- coin_lockout_global_w(space->machine, ~data & 0x10);
+ coin_lockout_global_w(space->machine(), ~data & 0x10);
// bit 5: select 1-way or 2-way coin counter
@@ -233,7 +233,7 @@ WRITE8_HANDLER( bublbobl_mcu_port1_w )
READ8_HANDLER( bublbobl_mcu_port2_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 2 read\n", cpu_get_pc(space->cpu));
return (state->port2_out & state->ddr2) | (state->port2_in & ~state->ddr2);
@@ -241,7 +241,7 @@ READ8_HANDLER( bublbobl_mcu_port2_r )
WRITE8_HANDLER( bublbobl_mcu_port2_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 2 write %02x\n", cpu_get_pc(space->cpu), data);
static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
@@ -257,7 +257,7 @@ WRITE8_HANDLER( bublbobl_mcu_port2_w )
{
// read
if ((address & 0x0800) == 0x0000)
- state->port3_in = input_port_read(space->machine, portnames[address & 3]);
+ state->port3_in = input_port_read(space->machine(), portnames[address & 3]);
else if ((address & 0x0c00) == 0x0c00)
state->port3_in = state->mcu_sharedram[address & 0x03ff];
// logerror("reading %02x from shared RAM %04x\n", state->port3_in, address);
@@ -276,28 +276,28 @@ WRITE8_HANDLER( bublbobl_mcu_port2_w )
READ8_HANDLER( bublbobl_mcu_port3_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 3 read\n", cpu_get_pc(space->cpu));
return (state->port3_out & state->ddr3) | (state->port3_in & ~state->ddr3);
}
WRITE8_HANDLER( bublbobl_mcu_port3_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 3 write %02x\n", cpu_get_pc(space->cpu), data);
state->port3_out = data;
}
READ8_HANDLER( bublbobl_mcu_port4_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 4 read\n", cpu_get_pc(space->cpu));
return (state->port4_out & state->ddr4) | (state->port4_in & ~state->ddr4);
}
WRITE8_HANDLER( bublbobl_mcu_port4_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 6801U4 port 4 write %02x\n", cpu_get_pc(space->cpu), data);
// bits 0-7 of shared RAM address
@@ -316,19 +316,19 @@ in boblbobl, so they don't matter. All checks are patched out in sboblbob.
READ8_HANDLER( boblbobl_ic43_a_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
// if (offset >= 2)
// logerror("%04x: ic43_a_r (offs %d) res = %02x\n", cpu_get_pc(space->cpu), offset, res);
if (offset == 0)
return state->ic43_a << 4;
else
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
WRITE8_HANDLER( boblbobl_ic43_a_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
int res = 0;
switch (offset)
@@ -367,7 +367,7 @@ WRITE8_HANDLER( boblbobl_ic43_a_w )
WRITE8_HANDLER( boblbobl_ic43_b_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
static const int xorval[4] = { 4, 1, 8, 2 };
// logerror("%04x: ic43_b_w (offs %d) %02x\n", cpu_get_pc(space->cpu), offset, data);
@@ -376,7 +376,7 @@ WRITE8_HANDLER( boblbobl_ic43_b_w )
READ8_HANDLER( boblbobl_ic43_b_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
// logerror("%04x: ic43_b_r (offs %d)\n", cpu_get_pc(space->cpu), offset);
if (offset == 0)
return state->ic43_b << 4;
@@ -410,21 +410,21 @@ INTERRUPT_GEN( bublbobl_m68705_interrupt )
READ8_HANDLER( bublbobl_68705_port_a_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( bublbobl_68705_port_a_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
}
WRITE8_HANDLER( bublbobl_68705_ddr_a_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr_a = data;
}
@@ -451,13 +451,13 @@ WRITE8_HANDLER( bublbobl_68705_ddr_a_w )
READ8_HANDLER( bublbobl_68705_port_b_r )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( bublbobl_68705_port_b_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
//logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data);
static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
@@ -481,7 +481,7 @@ WRITE8_HANDLER( bublbobl_68705_port_b_w )
if ((state->address & 0x0800) == 0x0000)
{
//logerror("%04x: 68705 read input port %02x\n", cpu_get_pc(space->cpu), state->address);
- state->latch = input_port_read(space->machine, portnames[state->address & 3]);
+ state->latch = input_port_read(space->machine(), portnames[state->address & 3]);
}
else if ((state->address & 0x0c00) == 0x0c00)
{
@@ -505,7 +505,7 @@ WRITE8_HANDLER( bublbobl_68705_port_b_w )
if ((state->ddr_b & 0x20) && (~data & 0x20) && (state->port_b_out & 0x20))
{
/* hack to get random EXTEND letters (who is supposed to do this? 68705? PAL?) */
- state->mcu_sharedram[0x7c] = space->machine->rand() % 6;
+ state->mcu_sharedram[0x7c] = space->machine().rand() % 6;
device_set_input_line_vector(state->maincpu, 0, state->mcu_sharedram[0]);
device_set_input_line(state->maincpu, 0, HOLD_LINE);
@@ -524,7 +524,7 @@ WRITE8_HANDLER( bublbobl_68705_port_b_w )
WRITE8_HANDLER( bublbobl_68705_ddr_b_w )
{
- bublbobl_state *state = space->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = space->machine().driver_data<bublbobl_state>();
state->ddr_b = data;
}
diff --git a/src/mame/machine/buggychl.c b/src/mame/machine/buggychl.c
index 97bcd3593b2..400fe35541f 100644
--- a/src/mame/machine/buggychl.c
+++ b/src/mame/machine/buggychl.c
@@ -191,7 +191,7 @@ static DEVICE_START( buggychl_mcu )
{
buggychl_mcu_state *state = get_safe_token(device);
- state->mcu = device->machine->device("mcu");
+ state->mcu = device->machine().device("mcu");
device->save_item(NAME(state->from_main));
device->save_item(NAME(state->from_mcu));
diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c
index d4e5012b6dc..f577a88ba65 100644
--- a/src/mame/machine/carpolo.c
+++ b/src/mame/machine/carpolo.c
@@ -60,7 +60,7 @@
void carpolo_74148_3s_cb(device_t *device)
{
- cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, ttl74148_output_valid_r(device) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6502_IRQ_LINE, ttl74148_output_valid_r(device) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -90,36 +90,36 @@ WRITE_LINE_DEVICE_HANDLER( carpolo_7474_2u_2_q_cb )
}
-void carpolo_generate_ball_screen_interrupt(running_machine *machine, UINT8 cause)
+void carpolo_generate_ball_screen_interrupt(running_machine &machine, UINT8 cause)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
state->ball_screen_collision_cause = cause;
ttl74148_input_line_w(state->ttl74148_3s, BALL_SCREEN_PRIORITY_LINE, 0);
ttl74148_update(state->ttl74148_3s);
}
-void carpolo_generate_car_car_interrupt(running_machine *machine, int car1, int car2)
+void carpolo_generate_car_car_interrupt(running_machine &machine, int car1, int car2)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
state->car_car_collision_cause = ~((1 << (3 - car1)) | (1 << (3 - car2)));
ttl74148_input_line_w(state->ttl74148_3s, CAR_CAR_PRIORITY_LINE, 0);
ttl74148_update(state->ttl74148_3s);
}
-void carpolo_generate_car_goal_interrupt(running_machine *machine, int car, int right_goal)
+void carpolo_generate_car_goal_interrupt(running_machine &machine, int car, int right_goal)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
state->car_goal_collision_cause = car | (right_goal ? 0x08 : 0x00);
ttl74148_input_line_w(state->ttl74148_3s, CAR_GOAL_PRIORITY_LINE, 0);
ttl74148_update(state->ttl74148_3s);
}
-void carpolo_generate_car_ball_interrupt(running_machine *machine, int car, int car_x, int car_y)
+void carpolo_generate_car_ball_interrupt(running_machine &machine, int car, int car_x, int car_y)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
state->car_ball_collision_cause = car;
state->car_ball_collision_x = car_x;
state->car_ball_collision_y = car_y;
@@ -130,9 +130,9 @@ void carpolo_generate_car_ball_interrupt(running_machine *machine, int car, int
ttl74148_update(state->ttl74148_3s);
}
-void carpolo_generate_car_border_interrupt(running_machine *machine, int car, int horizontal_border)
+void carpolo_generate_car_border_interrupt(running_machine &machine, int car, int horizontal_border)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
state->car_border_collision_cause = car | (horizontal_border ? 0x04 : 0x00);
state->priority_0_extension = CAR_BORDER_EXTRA_BITS;
@@ -144,7 +144,7 @@ void carpolo_generate_car_border_interrupt(running_machine *machine, int car, in
READ8_HANDLER( carpolo_ball_screen_collision_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* bit 0 - 0=ball collided with border
bit 1 - 0=ball collided with goal
bit 2 - 0=ball collided with score area
@@ -154,21 +154,21 @@ READ8_HANDLER( carpolo_ball_screen_collision_cause_r )
READ8_HANDLER( carpolo_car_ball_collision_x_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* the x coordinate of the colliding pixel */
return state->car_ball_collision_x;
}
READ8_HANDLER( carpolo_car_ball_collision_y_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* the y coordinate of the colliding pixel */
return state->car_ball_collision_y;
}
READ8_HANDLER( carpolo_car_car_collision_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* bit 0 - car 4 collided
bit 1 - car 3 collided
bit 2 - car 2 collided
@@ -178,7 +178,7 @@ READ8_HANDLER( carpolo_car_car_collision_cause_r )
READ8_HANDLER( carpolo_car_goal_collision_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* bit 0-1 - which car collided
bit 2 - horizontal timing bit 1TEC4 (not accessed)
bit 3 - which goal collided (0=left, 1=right) */
@@ -187,7 +187,7 @@ READ8_HANDLER( carpolo_car_goal_collision_cause_r )
READ8_HANDLER( carpolo_car_ball_collision_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* bit 0-1 - which car collided
bit 2-3 - unconnected */
return state->car_ball_collision_cause;
@@ -195,7 +195,7 @@ READ8_HANDLER( carpolo_car_ball_collision_cause_r )
READ8_HANDLER( carpolo_car_border_collision_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* bit 0-1 - which car collided
bit 2 - 0=vertical border, 1=horizontal border */
return state->car_border_collision_cause;
@@ -204,7 +204,7 @@ READ8_HANDLER( carpolo_car_border_collision_cause_r )
READ8_HANDLER( carpolo_interrupt_cause_r )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
/* the output of the 148 goes to bits 1-3 (which is priority ^ 7) */
return (ttl74148_output_r(state->ttl74148_3s) << 1) | state->priority_0_extension;
}
@@ -212,7 +212,7 @@ READ8_HANDLER( carpolo_interrupt_cause_r )
INTERRUPT_GEN( carpolo_timer_interrupt )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
UINT8 port_value;
int player;
@@ -225,7 +225,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* check the coins here as well - they drive the clock of the flip-flops */
- port_value = input_port_read(device->machine, "IN0");
+ port_value = input_port_read(device->machine(), "IN0");
ttl7474_clock_w(state->ttl7474_2s_1, (port_value & 0x01) >> 0);
ttl7474_clock_w(state->ttl7474_2s_2, (port_value & 0x02) >> 1);
@@ -248,7 +248,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
case 3: movement_flip_flop = state->ttl7474_1a_1; dir_flip_flop = state->ttl7474_1a_2; break;
}
- port_value = input_port_read(device->machine, portnames[player]);
+ port_value = input_port_read(device->machine(), portnames[player]);
if (port_value != state->last_wheel_value[player])
{
@@ -266,7 +266,7 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
/* finally read the accelerator pedals */
- port_value = input_port_read(device->machine, "PEDALS");
+ port_value = input_port_read(device->machine(), "PEDALS");
for (player = 0; player < 4; player++)
{
@@ -298,66 +298,66 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
static WRITE_LINE_DEVICE_HANDLER( coin1_interrupt_clear_w )
{
- carpolo_state *drvstate = device->machine->driver_data<carpolo_state>();
+ carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
ttl7474_clear_w(drvstate->ttl7474_2s_1, state);
}
static WRITE_LINE_DEVICE_HANDLER( coin2_interrupt_clear_w )
{
- carpolo_state *drvstate = device->machine->driver_data<carpolo_state>();
+ carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
ttl7474_clear_w(drvstate->ttl7474_2s_2, state);
}
static WRITE_LINE_DEVICE_HANDLER( coin3_interrupt_clear_w )
{
- carpolo_state *drvstate = device->machine->driver_data<carpolo_state>();
+ carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
ttl7474_clear_w(drvstate->ttl7474_2u_1, state);
}
static WRITE_LINE_DEVICE_HANDLER( coin4_interrupt_clear_w )
{
- carpolo_state *drvstate = device->machine->driver_data<carpolo_state>();
+ carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
ttl7474_clear_w(drvstate->ttl7474_2u_2, state);
}
WRITE8_HANDLER( carpolo_ball_screen_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, BALL_SCREEN_PRIORITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
WRITE8_HANDLER( carpolo_car_car_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, CAR_CAR_PRIORITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
WRITE8_HANDLER( carpolo_car_goal_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, CAR_GOAL_PRIORITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
WRITE8_HANDLER( carpolo_car_ball_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, PRI0_PRIORTITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
WRITE8_HANDLER( carpolo_car_border_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, PRI0_PRIORTITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
WRITE8_HANDLER( carpolo_timer_interrupt_clear_w )
{
- carpolo_state *state = space->machine->driver_data<carpolo_state>();
+ carpolo_state *state = space->machine().driver_data<carpolo_state>();
ttl74148_input_line_w(state->ttl74148_3s, PRI0_PRIORTITY_LINE, 1);
ttl74148_update(state->ttl74148_3s);
}
@@ -371,7 +371,7 @@ WRITE8_HANDLER( carpolo_timer_interrupt_clear_w )
static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
/* bit 0 - Coin counter
bit 1 - Player 4 crash sound
bit 2 - Player 3 crash sound
@@ -381,7 +381,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
bit 6 - Player 1 crash sound
bit 7 - Ball hit pulse sound */
- coin_counter_w(device->machine, 0, data & 0x01);
+ coin_counter_w(device->machine(), 0, data & 0x01);
ttl7474_clear_w(state->ttl7474_1f_1, (data & 0x08) >> 3);
@@ -393,7 +393,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
/* bit 0 - Strobe speed bits sound
bit 1 - Speed bit 0 sound
bit 2 - Speed bit 1 sound
@@ -409,7 +409,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
static READ8_DEVICE_HANDLER( pia_0_port_b_r )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
/* bit 4 - Pedal bit 0
bit 5 - Pedal bit 1 */
@@ -420,7 +420,7 @@ static READ8_DEVICE_HANDLER( pia_0_port_b_r )
static READ8_DEVICE_HANDLER( pia_1_port_a_r )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 0 - Player 4 steering input (left or right)
@@ -436,7 +436,7 @@ static READ8_DEVICE_HANDLER( pia_1_port_a_r )
(ttl7474_output_r(state->ttl7474_1c_2) ? 0x02 : 0x00) |
(ttl7474_output_r(state->ttl7474_1d_2) ? 0x04 : 0x00) |
(ttl7474_output_r(state->ttl7474_1f_2) ? 0x08 : 0x00) |
- (input_port_read(device->machine, "IN2") & 0xf0);
+ (input_port_read(device->machine(), "IN2") & 0xf0);
return ret;
}
@@ -444,7 +444,7 @@ static READ8_DEVICE_HANDLER( pia_1_port_a_r )
static READ8_DEVICE_HANDLER( pia_1_port_b_r )
{
- carpolo_state *state = device->machine->driver_data<carpolo_state>();
+ carpolo_state *state = device->machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 4 - Player 4 steering input (wheel moving or stopped)
@@ -496,23 +496,23 @@ const pia6821_interface carpolo_pia1_intf =
MACHINE_START( carpolo )
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
/* find flip-flops */
- state->ttl7474_2s_1 = machine->device("7474_2s_1");
- state->ttl7474_2s_2 = machine->device("7474_2s_2");
- state->ttl7474_2u_1 = machine->device("7474_2u_1");
- state->ttl7474_2u_2 = machine->device("7474_2u_2");
- state->ttl7474_1f_1 = machine->device("7474_1f_1");
- state->ttl7474_1f_2 = machine->device("7474_1f_2");
- state->ttl7474_1d_1 = machine->device("7474_1d_1");
- state->ttl7474_1d_2 = machine->device("7474_1d_2");
- state->ttl7474_1c_1 = machine->device("7474_1c_1");
- state->ttl7474_1c_2 = machine->device("7474_1c_2");
- state->ttl7474_1a_1 = machine->device("7474_1a_1");
- state->ttl7474_1a_2 = machine->device("7474_1a_2");
-
- state->ttl74148_3s = machine->device("74148_3s");
- state->ttl74153_1k = machine->device("74153_1k");
+ state->ttl7474_2s_1 = machine.device("7474_2s_1");
+ state->ttl7474_2s_2 = machine.device("7474_2s_2");
+ state->ttl7474_2u_1 = machine.device("7474_2u_1");
+ state->ttl7474_2u_2 = machine.device("7474_2u_2");
+ state->ttl7474_1f_1 = machine.device("7474_1f_1");
+ state->ttl7474_1f_2 = machine.device("7474_1f_2");
+ state->ttl7474_1d_1 = machine.device("7474_1d_1");
+ state->ttl7474_1d_2 = machine.device("7474_1d_2");
+ state->ttl7474_1c_1 = machine.device("7474_1c_1");
+ state->ttl7474_1c_2 = machine.device("7474_1c_2");
+ state->ttl7474_1a_1 = machine.device("7474_1a_1");
+ state->ttl7474_1a_2 = machine.device("7474_1a_2");
+
+ state->ttl74148_3s = machine.device("74148_3s");
+ state->ttl74153_1k = machine.device("74153_1k");
state_save_register_global(machine, state->ball_screen_collision_cause);
state_save_register_global(machine, state->car_ball_collision_x);
@@ -527,7 +527,7 @@ MACHINE_START( carpolo )
MACHINE_RESET( carpolo )
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
/* set up the priority encoder */
ttl74148_enable_input_w(state->ttl74148_3s, 0); /* always enabled */
diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c
index 40e46d53d10..f9c70409d2e 100644
--- a/src/mame/machine/cchip.c
+++ b/src/mame/machine/cchip.c
@@ -83,10 +83,10 @@ WRITE16_HANDLER( cchip1_ram_w )
{
cc_port = data;
- coin_lockout_w(space->machine, 1, data & 0x08);
- coin_lockout_w(space->machine, 0, data & 0x04);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_lockout_w(space->machine(), 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, data & 0x04);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
}
else
{
@@ -117,9 +117,9 @@ READ16_HANDLER( cchip1_ram_r )
{
switch (offset)
{
- case 0x00: return input_port_read(space->machine, "IN0"); /* Player 1 controls + START1 */
- case 0x01: return input_port_read(space->machine, "IN1"); /* Player 2 controls + START2 */
- case 0x02: return input_port_read(space->machine, "IN2"); /* COINn + SERVICE1 + TILT */
+ case 0x00: return input_port_read(space->machine(), "IN0"); /* Player 1 controls + START1 */
+ case 0x01: return input_port_read(space->machine(), "IN1"); /* Player 2 controls + START2 */
+ case 0x02: return input_port_read(space->machine(), "IN2"); /* COINn + SERVICE1 + TILT */
case 0x03: return cc_port;
}
}
diff --git a/src/mame/machine/cclimber.c b/src/mame/machine/cclimber.c
index 87d9e4d9c82..b71b87cb1fc 100644
--- a/src/mame/machine/cclimber.c
+++ b/src/mame/machine/cclimber.c
@@ -4,10 +4,10 @@
/* set to 1 to fix protection check after bonus round (see notes in pacman.c driver) */
#define CANNONB_HACK 0
-static void cclimber_decode(running_machine *machine, const UINT8 convtable[8][16])
+static void cclimber_decode(running_machine &machine, const UINT8 convtable[8][16])
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
@@ -68,7 +68,7 @@ DRIVER_INIT( cclimberj )
DRIVER_INIT( ckongb )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0x0000;A < 0x6000;A++) /* all the program ROMs are encrypted */
{
@@ -77,9 +77,9 @@ DRIVER_INIT( ckongb )
}
#if CANNONB_HACK
-static void cannonb_patch(running_machine *machine)
+static void cannonb_patch(running_machine &machine)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x2ba0] = 0x21;
rom[0x2ba1] = 0xfb;
@@ -91,7 +91,7 @@ static void cannonb_patch(running_machine *machine)
DRIVER_INIT( cannonb )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0x0000;A < 0x1000;A++) /* only first ROM is encrypted */
{
diff --git a/src/mame/machine/cd32.c b/src/mame/machine/cd32.c
index fb5b596e260..90a06ac2691 100644
--- a/src/mame/machine/cd32.c
+++ b/src/mame/machine/cd32.c
@@ -29,7 +29,9 @@ TODO: Add CDDA support
typedef struct _akiko_state akiko_state;
struct _akiko_state
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
address_space *space;
/* chunky to planar converter */
@@ -95,11 +97,11 @@ static DEVICE_STOP( akiko )
static DEVICE_RESET( akiko )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
akiko_state *state = get_safe_token(device);
device_t *cddevice;
- cddevice = machine->device("cdrom");
+ cddevice = machine.device("cdrom");
if (cddevice!=NULL)
{
// MESS case
@@ -167,11 +169,11 @@ static DEVICE_RESET( akiko )
static DEVICE_START( akiko )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
akiko_state *state = get_safe_token(device);
- state->machine = machine;
- state->space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ state->m_machine = &machine;
+ state->space = machine.device("maincpu")->memory().space(AS_PROGRAM);
state->c2p_input_index = 0;
state->c2p_output_index = 0;
@@ -196,9 +198,9 @@ static DEVICE_START( akiko )
state->cdrom_cmd_resp = 0;
state->cdrom_toc = NULL;
- state->dma_timer = machine->scheduler().timer_alloc(FUNC(akiko_dma_proc), state);
- state->frame_timer = machine->scheduler().timer_alloc(FUNC(akiko_frame_proc), state);
- state->i2cmem = machine->device("i2cmem");
+ state->dma_timer = machine.scheduler().timer_alloc(FUNC(akiko_dma_proc), state);
+ state->frame_timer = machine.scheduler().timer_alloc(FUNC(akiko_frame_proc), state);
+ state->i2cmem = machine.device("i2cmem");
}
@@ -319,7 +321,7 @@ static const char* get_akiko_reg_name(int reg)
static void akiko_cdda_stop(akiko_state *state)
{
- device_t *cdda = cdda_from_cdrom(state->machine, state->cdrom);
+ device_t *cdda = cdda_from_cdrom(state->machine(), state->cdrom);
if (cdda != NULL)
{
@@ -330,7 +332,7 @@ static void akiko_cdda_stop(akiko_state *state)
static void akiko_cdda_play(akiko_state *state, UINT32 lba, UINT32 num_blocks)
{
- device_t *cdda = cdda_from_cdrom(state->machine, state->cdrom);
+ device_t *cdda = cdda_from_cdrom(state->machine(), state->cdrom);
if (cdda != NULL)
{
cdda_start_audio(cdda, lba, num_blocks);
@@ -340,7 +342,7 @@ static void akiko_cdda_play(akiko_state *state, UINT32 lba, UINT32 num_blocks)
static void akiko_cdda_pause(akiko_state *state, int pause)
{
- device_t *cdda = cdda_from_cdrom(state->machine, state->cdrom);
+ device_t *cdda = cdda_from_cdrom(state->machine(), state->cdrom);
if (cdda != NULL)
{
if (cdda_audio_active(cdda) && cdda_audio_paused(cdda) != pause )
@@ -361,7 +363,7 @@ static void akiko_cdda_pause(akiko_state *state, int pause)
static UINT8 akiko_cdda_getstatus(akiko_state *state, UINT32 *lba)
{
- device_t *cdda = cdda_from_cdrom(state->machine, state->cdrom);
+ device_t *cdda = cdda_from_cdrom(state->machine(), state->cdrom);
if ( lba ) *lba = 0;
@@ -447,7 +449,7 @@ static TIMER_CALLBACK(akiko_dma_proc)
if ( state->cdrom_readreqmask & ( 1 << index ) )
{
- amiga_state *amiga = machine->driver_data<amiga_state>();
+ amiga_state *amiga = machine.driver_data<amiga_state>();
UINT32 track = cdrom_get_track( state->cdrom, state->cdrom_lba_cur );
UINT32 datasize = cdrom_get_toc( state->cdrom )->tracks[track].datasize;
UINT32 subsize = cdrom_get_toc( state->cdrom )->tracks[track].subsize;
@@ -664,7 +666,7 @@ static void akiko_update_cdrom(akiko_state *state)
if ( cmdbuf[7] == 0x80 )
{
- if (LOG_AKIKO_CD) logerror( "%s:AKIKO CD: Data read - start lba: %08x - end lba: %08x\n", state->machine->describe_context(), startpos, endpos );
+ if (LOG_AKIKO_CD) logerror( "%s:AKIKO CD: Data read - start lba: %08x - end lba: %08x\n", state->machine().describe_context(), startpos, endpos );
state->cdrom_speed = (cmdbuf[8] & 0x40) ? 2 : 1;
state->cdrom_lba_start = startpos;
state->cdrom_lba_end = endpos;
@@ -701,7 +703,7 @@ static void akiko_update_cdrom(akiko_state *state)
{
state->cdrom_cmd_start = (state->cdrom_cmd_start+3) & 0xff;
- state->machine->scheduler().timer_set( attotime::from_msec(1), FUNC(akiko_cd_delayed_cmd ), resp[0], state);
+ state->machine().scheduler().timer_set( attotime::from_msec(1), FUNC(akiko_cd_delayed_cmd ), resp[0], state);
break;
}
@@ -782,7 +784,7 @@ READ32_DEVICE_HANDLER( amiga_akiko32_r )
switch( offset )
{
case 0x00/4: /* ID */
- if ( state->cdrom != NULL ) cdda_set_cdrom(space->machine->device("cdda"), state->cdrom);
+ if ( state->cdrom != NULL ) cdda_set_cdrom(space->machine().device("cdda"), state->cdrom);
return 0x0000cafe;
case 0x04/4: /* CDROM STATUS 1 */
diff --git a/src/mame/machine/cdi070.c b/src/mame/machine/cdi070.c
index 9245169edd5..ee560bf96b1 100644
--- a/src/mame/machine/cdi070.c
+++ b/src/mame/machine/cdi070.c
@@ -25,7 +25,7 @@ TODO:
#include "includes/cdi.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -34,7 +34,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
@@ -60,19 +60,19 @@ static void scc68070_set_timer_callback(scc68070_regs_t *scc68070, int channel)
}
}
-void scc68070_set_quizard_mcu_ack(running_machine *machine, UINT8 ack)
+void scc68070_set_quizard_mcu_ack(running_machine &machine, UINT8 ack)
{
mcu_ack = ack;
}
-void scc68070_set_quizard_mcu_value(running_machine *machine, UINT16 value)
+void scc68070_set_quizard_mcu_value(running_machine &machine, UINT16 value)
{
mcu_value = value;
}
TIMER_CALLBACK( scc68070_timer0_callback )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
scc68070->timers.timer0 = scc68070->timers.reload_register;
@@ -83,7 +83,7 @@ TIMER_CALLBACK( scc68070_timer0_callback )
scc68070->timers.timer_status_register |= TSR_OV0;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
}
@@ -91,7 +91,7 @@ TIMER_CALLBACK( scc68070_timer0_callback )
scc68070_set_timer_callback(&state->scc68070_regs, 0);
}
-static void scc68070_uart_rx_check(running_machine *machine, scc68070_regs_t *scc68070)
+static void scc68070_uart_rx_check(running_machine &machine, scc68070_regs_t *scc68070)
{
if((scc68070->uart.command_register & 3) == 1)
{
@@ -105,7 +105,7 @@ static void scc68070_uart_rx_check(running_machine *machine, scc68070_regs_t *sc
}
}
-static void scc68070_uart_tx_check(running_machine *machine, scc68070_regs_t *scc68070)
+static void scc68070_uart_tx_check(running_machine &machine, scc68070_regs_t *scc68070)
{
if(((scc68070->uart.command_register >> 2) & 3) == 1)
{
@@ -130,7 +130,7 @@ static void scc68070_uart_tx_check(running_machine *machine, scc68070_regs_t *sc
}
}
-void scc68070_uart_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data)
+void scc68070_uart_rx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data)
{
//printf("%d: %02x\n", scc68070->uart.receive_pointer + 1, data);
scc68070->uart.receive_pointer++;
@@ -138,7 +138,7 @@ void scc68070_uart_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8
scc68070_uart_rx_check(machine, scc68070);
}
-void scc68070_uart_tx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data)
+void scc68070_uart_tx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data)
{
scc68070->uart.transmit_pointer++;
scc68070->uart.transmit_buffer[scc68070->uart.transmit_pointer] = data;
@@ -147,7 +147,7 @@ void scc68070_uart_tx(running_machine *machine, scc68070_regs_t *scc68070, UINT8
TIMER_CALLBACK( scc68070_rx_callback )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
if((scc68070->uart.command_register & 3) == 1)
@@ -170,7 +170,7 @@ TIMER_CALLBACK( scc68070_rx_callback )
UINT8 interrupt = (scc68070->picr2 >> 4) & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
@@ -194,7 +194,7 @@ TIMER_CALLBACK( scc68070_rx_callback )
static UINT16 seeds[10] = { 0 };
static UINT8 g_state[8] = { 0 };
-void scc68070_quizard_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data)
+void scc68070_quizard_rx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data)
{
scc68070_uart_rx(machine, scc68070, 0x5a);
scc68070_uart_rx(machine, scc68070, data);
@@ -214,7 +214,7 @@ static void quizard_set_seeds(UINT8 *rx)
seeds[9] = (rx[19] << 8) | rx[18];
}
-static void quizard_calculate_state(running_machine *machine, scc68070_regs_t *scc68070)
+static void quizard_calculate_state(running_machine &machine, scc68070_regs_t *scc68070)
{
const UINT16 desired_bitfield = mcu_value;
const UINT16 field0 = 0x00ff;
@@ -254,21 +254,21 @@ static void quizard_calculate_state(running_machine *machine, scc68070_regs_t *s
INTERRUPT_GEN( scc68070_mcu_frame )
{
- cdi_state *state = device->machine->driver_data<cdi_state>();
+ cdi_state *state = device->machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
if(0)//mcu_active)
{
- quizard_calculate_state(device->machine, scc68070);
- scc68070_uart_rx(device->machine, scc68070, 0x5a);
+ quizard_calculate_state(device->machine(), scc68070);
+ scc68070_uart_rx(device->machine(), scc68070, 0x5a);
for(int index = 0; index < 8; index++)
{
- scc68070_uart_rx(device->machine, scc68070, g_state[index]);
+ scc68070_uart_rx(device->machine(), scc68070, g_state[index]);
}
}
}
-static void quizard_handle_byte_tx(running_machine *machine, scc68070_regs_t *scc68070)
+static void quizard_handle_byte_tx(running_machine &machine, scc68070_regs_t *scc68070)
{
static int state = 0;
static UINT8 rx[0x100];
@@ -364,7 +364,7 @@ static void quizard_handle_byte_tx(running_machine *machine, scc68070_regs_t *sc
TIMER_CALLBACK( scc68070_tx_callback )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
if(((scc68070->uart.command_register >> 2) & 3) == 1)
@@ -372,7 +372,7 @@ TIMER_CALLBACK( scc68070_tx_callback )
UINT8 interrupt = scc68070->picr2 & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
@@ -406,7 +406,7 @@ TIMER_CALLBACK( scc68070_tx_callback )
READ16_HANDLER( scc68070_periphs_r )
{
- cdi_state *state = space->machine->driver_data<cdi_state>();
+ cdi_state *state = space->machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
switch(offset)
@@ -419,31 +419,31 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2000/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", scc68070->i2c.data_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", scc68070->i2c.data_register, mem_mask);
}
return scc68070->i2c.data_register;
case 0x2002/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", scc68070->i2c.address_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", scc68070->i2c.address_register, mem_mask);
}
return scc68070->i2c.address_register;
case 0x2004/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", scc68070->i2c.status_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", scc68070->i2c.status_register, mem_mask);
}
return scc68070->i2c.status_register;
case 0x2006/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", scc68070->i2c.control_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", scc68070->i2c.control_register, mem_mask);
}
return scc68070->i2c.control_register;
case 0x2008/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", scc68070->i2c.clock_control_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", scc68070->i2c.clock_control_register, mem_mask);
}
return scc68070->i2c.clock_control_register;
@@ -451,32 +451,32 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2010/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Mode Register: %04x & %04x\n", scc68070->uart.mode_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Mode Register: %04x & %04x\n", scc68070->uart.mode_register, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.mode_register | 0x20;
case 0x2012/2:
scc68070->uart.status_register |= (1 << 1);
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Status Register: %04x & %04x\n", scc68070->uart.status_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Status Register: %04x & %04x\n", scc68070->uart.status_register, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
if((scc68070->picr2 >> 4) & 7)
{
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), ASSERT_LINE);
}
if(scc68070->picr2 & 7)
{
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + ((scc68070->picr2 & 7) - 1), ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + ((scc68070->picr2 & 7) - 1), ASSERT_LINE);
}
return scc68070->uart.status_register;
@@ -484,45 +484,45 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2014/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Clock Select: %04x & %04x\n", scc68070->uart.clock_select, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Clock Select: %04x & %04x\n", scc68070->uart.clock_select, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.clock_select | 0x08;
case 0x2016/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Command Register: %02x & %04x\n", scc68070->uart.command_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Command Register: %02x & %04x\n", scc68070->uart.command_register, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.command_register | 0x80;
case 0x2018/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Transmit Holding Register: %02x & %04x\n", scc68070->uart.transmit_holding_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Transmit Holding Register: %02x & %04x\n", scc68070->uart.transmit_holding_register, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
return scc68070->uart.transmit_holding_register;
case 0x201a/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: UART Receive Holding Register: %02x & %04x\n", scc68070->uart.receive_holding_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: UART Receive Holding Register: %02x & %04x\n", scc68070->uart.receive_holding_register, mem_mask);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
}
if((scc68070->picr2 >> 4) & 7)
{
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + (((scc68070->picr2 >> 4) & 7) - 1), CLEAR_LINE);
}
scc68070->uart.receive_holding_register = scc68070->uart.receive_buffer[0];
@@ -541,31 +541,31 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2020/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: Timer Control Register: %02x & %04x\n", scc68070->timers.timer_control_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Timer Control Register: %02x & %04x\n", scc68070->timers.timer_control_register, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 12, "scc68070_periphs_r: Timer Status Register: %02x & %04x\n", scc68070->timers.timer_status_register, mem_mask);
+ verboselog(space->machine(), 12, "scc68070_periphs_r: Timer Status Register: %02x & %04x\n", scc68070->timers.timer_status_register, mem_mask);
}
return (scc68070->timers.timer_status_register << 8) | scc68070->timers.timer_control_register;
case 0x2022/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: Timer Reload Register: %04x & %04x\n", scc68070->timers.reload_register, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Timer Reload Register: %04x & %04x\n", scc68070->timers.reload_register, mem_mask);
return scc68070->timers.reload_register;
case 0x2024/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: Timer 0: %04x & %04x\n", scc68070->timers.timer0, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 0: %04x & %04x\n", scc68070->timers.timer0, mem_mask);
return scc68070->timers.timer0;
case 0x2026/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: Timer 1: %04x & %04x\n", scc68070->timers.timer1, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 1: %04x & %04x\n", scc68070->timers.timer1, mem_mask);
return scc68070->timers.timer1;
case 0x2028/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: Timer 2: %04x & %04x\n", scc68070->timers.timer2, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Timer 2: %04x & %04x\n", scc68070->timers.timer2, mem_mask);
return scc68070->timers.timer2;
// PICR1: 80002045
case 0x2044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 1: %02x & %04x\n", scc68070->picr1, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 1: %02x & %04x\n", scc68070->picr1, mem_mask);
}
return scc68070->picr1;
@@ -573,7 +573,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x2046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 2: %02x & %04x\n", scc68070->picr2, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: Peripheral Interrupt Control Register 2: %02x & %04x\n", scc68070->picr2, mem_mask);
}
return scc68070->picr2 & 0x77;
@@ -582,65 +582,65 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x4040/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Error Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_error, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Error Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_error, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Status Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_status, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Status Register: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_status, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].channel_status << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].channel_error;
case 0x4004/2:
case 0x4044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Operation Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].operation_control, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Operation Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].operation_control, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Device Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_control, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_control, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].device_control << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].operation_control;
case 0x4006/2:
case 0x4046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Channel Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_control, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Channel Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].channel_control, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Sequence Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Sequence Control Register: %02x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control, mem_mask);
}
return (scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control << 8) | scc68070->dma.channel[(offset - 0x2000) / 32].channel_control;
case 0x400a/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter;
case 0x400c/2:
case 0x404c/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16), mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16), mem_mask);
return (scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter >> 16);
case 0x400e/2:
case 0x404e/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter;
case 0x4014/2:
case 0x4054/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16), mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16), mem_mask);
return (scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter >> 16);
case 0x4016/2:
case 0x4056/2:
- verboselog(space->machine, 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter, mem_mask);
return scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter;
// MMU: 80008000 to 8000807f
case 0x8000/2: // Status / Control register
if(ACCESSING_BITS_0_7)
{ // Control
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU Control: %02x & %04x\n", scc68070->mmu.control, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU Control: %02x & %04x\n", scc68070->mmu.control, mem_mask);
return scc68070->mmu.control;
} // Status
else
{
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU Status: %02x & %04x\n", scc68070->mmu.status, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU Status: %02x & %04x\n", scc68070->mmu.status, mem_mask);
return scc68070->mmu.status;
}
break;
@@ -652,7 +652,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x8068/2:
case 0x8070/2:
case 0x8078/2: // Attributes (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].attr, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].attr, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].attr;
case 0x8042/2:
case 0x804a/2:
@@ -662,7 +662,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x806a/2:
case 0x8072/2:
case 0x807a/2: // Segment Length (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].length, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].length, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].length;
case 0x8044/2:
case 0x804c/2:
@@ -674,7 +674,7 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x807c/2: // Segment Number (SD0-7, A0=1 only)
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU descriptor %d segment: %02x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].segment, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d segment: %02x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].segment, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].segment;
}
break;
@@ -686,10 +686,10 @@ READ16_HANDLER( scc68070_periphs_r )
case 0x806e/2:
case 0x8076/2:
case 0x807e/2: // Base Address (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_r: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].base, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_r: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, scc68070->mmu.desc[(offset - 0x4020) / 4].base, mem_mask);
return scc68070->mmu.desc[(offset - 0x4020) / 4].base;
default:
- verboselog(space->machine, 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_r: Unknown address: %04x & %04x\n", offset * 2, mem_mask);
break;
}
@@ -698,14 +698,14 @@ READ16_HANDLER( scc68070_periphs_r )
WRITE16_HANDLER( scc68070_periphs_w )
{
- cdi_state *state = space->machine->driver_data<cdi_state>();
+ cdi_state *state = space->machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
switch(offset)
{
// Interupts: 80001001
case 0x1000/2: // LIR priority level
- verboselog(space->machine, 2, "scc68070_periphs_w: LIR: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: LIR: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->lir);
break;
@@ -713,35 +713,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2000/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Data Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.data_register = data & 0x00ff;
}
break;
case 0x2002/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Address Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.address_register = data & 0x00ff;
}
break;
case 0x2004/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Status Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.status_register = data & 0x00ff;
}
break;
case 0x2006/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Control Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.control_register = data & 0x00ff;
}
break;
case 0x2008/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: I2C Clock Control Register: %04x & %04x\n", data, mem_mask);
scc68070->i2c.clock_control_register = data & 0x00ff;
}
break;
@@ -750,70 +750,70 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2010/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Mode Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Mode Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.mode_register = data & 0x00ff;
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2012/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Status Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.status_register = data & 0x00ff;
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2014/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Clock Select: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Clock Select: %04x & %04x\n", data, mem_mask);
scc68070->uart.clock_select = data & 0x00ff;
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2016/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Command Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Command Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.command_register = data & 0x00ff;
- scc68070_uart_rx_check(space->machine, scc68070);
- scc68070_uart_tx_check(space->machine, scc68070);
+ scc68070_uart_rx_check(space->machine(), scc68070);
+ scc68070_uart_tx_check(space->machine(), scc68070);
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x2018/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Transmit Holding Register: %04x & %04x: %c\n", data, mem_mask, (data >= 0x20 && data < 0x7f) ? (data & 0x00ff) : ' ');
- scc68070_uart_tx(space->machine, scc68070, data & 0x00ff);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Transmit Holding Register: %04x & %04x: %c\n", data, mem_mask, (data >= 0x20 && data < 0x7f) ? (data & 0x00ff) : ' ');
+ scc68070_uart_tx(space->machine(), scc68070, data & 0x00ff);
scc68070->uart.transmit_holding_register = data & 0x00ff;
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
case 0x201a/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: UART Receive Holding Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: UART Receive Holding Register: %04x & %04x\n", data, mem_mask);
scc68070->uart.receive_holding_register = data & 0x00ff;
}
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
}
break;
@@ -821,35 +821,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2020/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: Timer Control Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Timer Control Register: %04x & %04x\n", data, mem_mask);
scc68070->timers.timer_control_register = data & 0x00ff;
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 12, "scc68070_periphs_w: Timer Status Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 12, "scc68070_periphs_w: Timer Status Register: %04x & %04x\n", data, mem_mask);
scc68070->timers.timer_status_register &= ~(data >> 8);
if(!scc68070->timers.timer_status_register)
{
UINT8 interrupt = scc68070->picr1 & 7;
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + (interrupt - 1), CLEAR_LINE);
}
}
break;
case 0x2022/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: Timer Reload Register: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Timer Reload Register: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.reload_register);
break;
case 0x2024/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: Timer 0: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 0: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer0);
scc68070_set_timer_callback(&state->scc68070_regs, 0);
break;
case 0x2026/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: Timer 1: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 1: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer1);
break;
case 0x2028/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: Timer 2: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Timer 2: %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&scc68070->timers.timer2);
break;
@@ -857,7 +857,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 1: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 1: %04x & %04x\n", data, mem_mask);
scc68070->picr1 = data & 0x00ff;
}
break;
@@ -866,7 +866,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x2046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 2: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: Peripheral Interrupt Control Register 2: %04x & %04x\n", data, mem_mask);
scc68070->picr2 = data & 0x00ff;
}
break;
@@ -876,11 +876,11 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4040/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Error (invalid): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Error (invalid): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Status: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Status: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].channel_status &= ~(data & 0xb0);
}
break;
@@ -888,12 +888,12 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4044/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Operation Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Operation Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].operation_control = data & 0x00ff;
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Device Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_control = data >> 8;
}
break;
@@ -901,7 +901,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x4046/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Channel Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Channel Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].channel_control = data & 0x007f;
if(data & CCR_SO)
{
@@ -910,35 +910,35 @@ WRITE16_HANDLER( scc68070_periphs_w )
}
if(ACCESSING_BITS_8_15)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Sequence Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Sequence Control Register: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].sequence_control = data >> 8;
}
break;
case 0x400a/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Transfer Counter: %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
COMBINE_DATA(&scc68070->dma.channel[(offset - 0x2000) / 32].transfer_counter);
break;
case 0x400c/2:
case 0x404c/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter &= ~(mem_mask << 16);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter |= data << 16;
break;
case 0x400e/2:
case 0x404e/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Memory Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter &= ~mem_mask;
scc68070->dma.channel[(offset - 0x2000) / 32].memory_address_counter |= data;
break;
case 0x4014/2:
case 0x4054/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (High Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter &= ~(mem_mask << 16);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter |= data << 16;
break;
case 0x4016/2:
case 0x4056/2:
- verboselog(space->machine, 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: DMA(%d) Device Address Counter (Low Word): %04x & %04x\n", (offset - 0x2000) / 32, data, mem_mask);
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter &= ~mem_mask;
scc68070->dma.channel[(offset - 0x2000) / 32].device_address_counter |= data;
break;
@@ -947,12 +947,12 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x8000/2: // Status / Control register
if(ACCESSING_BITS_0_7)
{ // Control
- verboselog(space->machine, 2, "scc68070_periphs_w: MMU Control: %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: MMU Control: %04x & %04x\n", data, mem_mask);
scc68070->mmu.control = data & 0x00ff;
} // Status
else
{
- verboselog(space->machine, 0, "scc68070_periphs_w: MMU Status (invalid): %04x & %04x\n", data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: MMU Status (invalid): %04x & %04x\n", data, mem_mask);
}
break;
case 0x8040/2:
@@ -963,7 +963,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x8068/2:
case 0x8070/2:
case 0x8078/2: // Attributes (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_w: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d attributes: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].attr);
break;
case 0x8042/2:
@@ -974,7 +974,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x806a/2:
case 0x8072/2:
case 0x807a/2: // Segment Length (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_w: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d length: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].length);
break;
case 0x8044/2:
@@ -987,7 +987,7 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x807c/2: // Segment Number (SD0-7, A0=1 only)
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 2, "scc68070_periphs_w: MMU descriptor %d segment: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d segment: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
scc68070->mmu.desc[(offset - 0x4020) / 4].segment = data & 0x00ff;
}
break;
@@ -999,16 +999,16 @@ WRITE16_HANDLER( scc68070_periphs_w )
case 0x806e/2:
case 0x8076/2:
case 0x807e/2: // Base Address (SD0-7)
- verboselog(space->machine, 2, "scc68070_periphs_w: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
+ verboselog(space->machine(), 2, "scc68070_periphs_w: MMU descriptor %d base: %04x & %04x\n", (offset - 0x4020) / 4, data, mem_mask);
COMBINE_DATA(&scc68070->mmu.desc[(offset - 0x4020) / 4].base);
break;
default:
- verboselog(space->machine, 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
+ verboselog(space->machine(), 0, "scc68070_periphs_w: Unknown address: %04x = %04x & %04x\n", offset * 2, data, mem_mask);
break;
}
}
-void scc68070_init(running_machine *machine, scc68070_regs_t *scc68070)
+void scc68070_init(running_machine &machine, scc68070_regs_t *scc68070)
{
int index = 0;
scc68070->lir = 0;
@@ -1062,7 +1062,7 @@ void scc68070_init(running_machine *machine, scc68070_regs_t *scc68070)
}
}
-void scc68070_register_globals(running_machine *machine, scc68070_regs_t *scc68070)
+void scc68070_register_globals(running_machine &machine, scc68070_regs_t *scc68070)
{
state_save_register_global(machine, scc68070->lir);
@@ -1143,13 +1143,13 @@ void scc68070_register_globals(running_machine *machine, scc68070_regs_t *scc680
state_save_register_global(machine, scc68070->mmu.desc[7].segment);
state_save_register_global(machine, scc68070->mmu.desc[7].base);
- scc68070->timers.timer0_timer = machine->scheduler().timer_alloc(FUNC(scc68070_timer0_callback));
+ scc68070->timers.timer0_timer = machine.scheduler().timer_alloc(FUNC(scc68070_timer0_callback));
scc68070->timers.timer0_timer->adjust(attotime::never);
- scc68070->uart.rx_timer = machine->scheduler().timer_alloc(FUNC(scc68070_rx_callback));
+ scc68070->uart.rx_timer = machine.scheduler().timer_alloc(FUNC(scc68070_rx_callback));
scc68070->uart.rx_timer->adjust(attotime::never);
- scc68070->uart.tx_timer = machine->scheduler().timer_alloc(FUNC(scc68070_tx_callback));
+ scc68070->uart.tx_timer = machine.scheduler().timer_alloc(FUNC(scc68070_tx_callback));
scc68070->uart.tx_timer->adjust(attotime::never);
}
diff --git a/src/mame/machine/cdi070.h b/src/mame/machine/cdi070.h
index 583ce27493f..f488d56e933 100644
--- a/src/mame/machine/cdi070.h
+++ b/src/mame/machine/cdi070.h
@@ -238,15 +238,15 @@ READ16_HANDLER( scc68070_periphs_r );
WRITE16_HANDLER( scc68070_periphs_w );
//READ16_HANDLER( uart_loopback_enable );
-void scc68070_init(running_machine *machine, scc68070_regs_t *scc68070);
-void scc68070_uart_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data);
-void scc68070_uart_tx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data);
-void scc68070_register_globals(running_machine *machine, scc68070_regs_t *scc68070);
+void scc68070_init(running_machine &machine, scc68070_regs_t *scc68070);
+void scc68070_uart_rx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data);
+void scc68070_uart_tx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data);
+void scc68070_register_globals(running_machine &machine, scc68070_regs_t *scc68070);
// UART Access for Quizard
-void scc68070_set_quizard_mcu_value(running_machine *machine, UINT16 value);
-void scc68070_set_quizard_mcu_ack(running_machine *machine, UINT8 ack);
-void scc68070_quizard_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data);
+void scc68070_set_quizard_mcu_value(running_machine &machine, UINT16 value);
+void scc68070_set_quizard_mcu_ack(running_machine &machine, UINT8 ack);
+void scc68070_quizard_rx(running_machine &machine, scc68070_regs_t *scc68070, UINT8 data);
INTERRUPT_GEN( scc68070_mcu_frame );
diff --git a/src/mame/machine/cdicdic.c b/src/mame/machine/cdicdic.c
index 71272ef5f53..ba2d51adc60 100644
--- a/src/mame/machine/cdicdic.c
+++ b/src/mame/machine/cdicdic.c
@@ -28,7 +28,7 @@ TODO:
#include "imagedev/chd_cd.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -37,7 +37,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
@@ -122,7 +122,7 @@ device_config *cdicdic_device_config::static_alloc_device_config(const machine_c
device_t *cdicdic_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cdicdic_device(machine, *this));
+ return auto_alloc(machine, cdicdic_device(machine, *this));
}
@@ -460,7 +460,7 @@ void cdicdic_device::decode_audio_sector(const UINT8 *xa, INT32 triggered)
return;
}
- verboselog(&m_machine, 0, "decode_audio_sector, got header type %02x\n", hdr[2] );
+ verboselog(m_machine, 0, "decode_audio_sector, got header type %02x\n", hdr[2] );
switch(hdr[2] & 0x3f) // ignore emphasis and reserved bits
{
@@ -565,7 +565,7 @@ void cdicdic_device::decode_audio_sector(const UINT8 *xa, INT32 triggered)
// After an appropriate delay for decoding to take place...
TIMER_CALLBACK( cdicdic_device::audio_sample_trigger )
{
- cdicdic_device *cdic = static_cast<cdicdic_device *>(machine->device("cdic"));
+ cdicdic_device *cdic = static_cast<cdicdic_device *>(machine.device("cdic"));
cdic->sample_trigger();
}
@@ -573,7 +573,7 @@ void cdicdic_device::sample_trigger()
{
if(m_decode_addr == 0xffff)
{
- verboselog(&m_machine, 0, "Decode stop requested, stopping playback\n" );
+ verboselog(m_machine, 0, "Decode stop requested, stopping playback\n" );
m_audio_sample_timer->adjust(attotime::never);
return;
}
@@ -581,13 +581,13 @@ void cdicdic_device::sample_trigger()
if(!m_decode_delay)
{
// Indicate that data has been decoded
- verboselog(&m_machine, 0, "Flagging that audio data has been decoded\n" );
+ verboselog(m_machine, 0, "Flagging that audio data has been decoded\n" );
m_audio_buffer |= 0x8000;
// Set the CDIC interrupt line
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
}
else
{
@@ -596,7 +596,7 @@ void cdicdic_device::sample_trigger()
if(CDIC_IS_VALID_SAMPLE_BUF(m_ram, m_decode_addr & 0x3ffe))
{
- verboselog(&m_machine, 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr );
+ verboselog(m_machine, 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr );
// Decode the data at Z+4, the same offset as a normal CD sector.
decode_audio_sector(((UINT8*)m_ram) + (m_decode_addr & 0x3ffe) + 4, 1);
@@ -604,10 +604,10 @@ void cdicdic_device::sample_trigger()
// Swap buffer positions to indicate our new buffer position at the next read
m_decode_addr ^= 0x1a00;
- verboselog(&m_machine, 0, "Updated m_decode_addr, new value is %04x\n", m_decode_addr );
+ verboselog(m_machine, 0, "Updated m_decode_addr, new value is %04x\n", m_decode_addr );
//// Delay for Frequency * (18*28*2*size in bytes) before requesting more data
- verboselog(&m_machine, 0, "Data is valid, setting up a new callback\n" );
+ verboselog(m_machine, 0, "Data is valid, setting up a new callback\n" );
m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram, m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram, m_decode_addr & 0x3ffe));
m_audio_sample_timer->adjust(m_decode_period);
//dmadac_enable(&dmadac[0], 2, 0);
@@ -617,7 +617,7 @@ void cdicdic_device::sample_trigger()
// Swap buffer positions to indicate our new buffer position at the next read
m_decode_addr ^= 0x1a00;
- verboselog(&m_machine, 0, "Data is not valid, indicating to shut down on the next audio sample\n" );
+ verboselog(m_machine, 0, "Data is not valid, indicating to shut down on the next audio sample\n" );
m_decode_addr = 0xffff;
m_audio_sample_timer->adjust(m_decode_period);
}
@@ -625,7 +625,7 @@ void cdicdic_device::sample_trigger()
TIMER_CALLBACK( cdicdic_device::trigger_readback_int )
{
- cdicdic_device *cdic = static_cast<cdicdic_device *>(machine->device("cdic"));
+ cdicdic_device *cdic = static_cast<cdicdic_device *>(machine.device("cdic"));
cdic->process_delayed_command();
}
@@ -686,7 +686,7 @@ void cdicdic_device::process_delayed_command()
lba = nybbles[0] + nybbles[1]*10 + ((nybbles[2] + nybbles[3]*10)*75) + ((nybbles[4] + nybbles[5]*10)*75*60);
//printf( "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
- verboselog(&m_machine, 0, "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
+ verboselog(m_machine, 0, "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
cdrom_read_data(m_cd, lba, buffer, CD_TRACK_RAW_DONTCARE);
@@ -725,7 +725,7 @@ void cdicdic_device::process_delayed_command()
if(((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_FORM | CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == (CDIC_SUBMODE_FORM | CDIC_SUBMODE_AUDIO)) &&
(m_channel & m_audio_channel & (1 << buffer[CDIC_SECTOR_CHAN2])))
{
- verboselog(&m_machine, 0, "Audio sector\n" );
+ verboselog(m_machine, 0, "Audio sector\n" );
m_x_buffer |= 0x8000;
//m_data_buffer |= 0x4000;
@@ -739,9 +739,9 @@ void cdicdic_device::process_delayed_command()
decode_audio_sector(((UINT8*)m_ram) + ((m_data_buffer & 5) * 0xa00 + 4), 0);
//printf( "Setting CDIC interrupt line\n" );
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for audio sector\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for audio sector\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
}
else if((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == 0x00)
{
@@ -758,13 +758,13 @@ void cdicdic_device::process_delayed_command()
(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == CDIC_SUBMODE_EOF)
{
//printf( "Setting CDIC interrupt line\n" );
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for message sector\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for message sector\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
}
else
{
- verboselog(&m_machine, 0, "Message sector, ignored\n" );
+ verboselog(m_machine, 0, "Message sector, ignored\n" );
}
}
else
@@ -778,9 +778,9 @@ void cdicdic_device::process_delayed_command()
}
//printf( "Setting CDIC interrupt line\n" );
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for data sector\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for data sector\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
}
if((buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == 0 && m_command != 0x23)
@@ -842,7 +842,7 @@ void cdicdic_device::process_delayed_command()
if(!(msf & 0x0000ff))
{
next_lba = next_nybbles[0] + next_nybbles[1]*10 + ((next_nybbles[2] + next_nybbles[3]*10)*75) + ((next_nybbles[4] + next_nybbles[5]*10)*75*60);
- verboselog(&m_machine, 0, "Playing CDDA sector from MSF location %06x\n", m_time | 2 );
+ verboselog(m_machine, 0, "Playing CDDA sector from MSF location %06x\n", m_time | 2 );
cdda_start_audio(m_machine.device("cdda"), lba, rounded_next_msf);
}
@@ -873,9 +873,9 @@ void cdicdic_device::process_delayed_command()
m_ram[(m_data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
}
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for CDDA sector\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for CDDA sector\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
break;
}
case 0x2c: // Seek
@@ -924,9 +924,9 @@ void cdicdic_device::process_delayed_command()
m_time = next_msf << 8;
- verboselog(&m_machine, 0, "Setting CDIC interrupt line for Seek sector\n" );
+ verboselog(m_machine, 0, "Setting CDIC interrupt line for Seek sector\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
break;
}
}
@@ -944,31 +944,31 @@ UINT16 cdicdic_device::register_read(const UINT32 offset, const UINT16 mem_mask)
switch(addr)
{
case 0x3c00/2: // Command register
- verboselog(&m_machine, 0, "cdic_r: Command Register = %04x & %04x\n", m_command, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Command Register = %04x & %04x\n", m_command, mem_mask);
return m_command;
case 0x3c02/2: // Time register (MSW)
- verboselog(&m_machine, 0, "cdic_r: Time Register (MSW) = %04x & %04x\n", m_time >> 16, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Time Register (MSW) = %04x & %04x\n", m_time >> 16, mem_mask);
return m_time >> 16;
case 0x3c04/2: // Time register (LSW)
- verboselog(&m_machine, 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (UINT16)(m_time & 0x0000ffff), mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (UINT16)(m_time & 0x0000ffff), mem_mask);
return m_time & 0x0000ffff;
case 0x3c06/2: // File register
- verboselog(&m_machine, 0, "cdic_r: File Register = %04x & %04x\n", m_file, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: File Register = %04x & %04x\n", m_file, mem_mask);
return m_file;
case 0x3c08/2: // Channel register (MSW)
- verboselog(&m_machine, 0, "cdic_r: Channel Register (MSW) = %04x & %04x\n", m_channel >> 16, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Channel Register (MSW) = %04x & %04x\n", m_channel >> 16, mem_mask);
return m_channel >> 16;
case 0x3c0a/2: // Channel register (LSW)
- verboselog(&m_machine, 0, "cdic_r: Channel Register (LSW) = %04x & %04x\n", m_channel & 0x0000ffff, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Channel Register (LSW) = %04x & %04x\n", m_channel & 0x0000ffff, mem_mask);
return m_channel & 0x0000ffff;
case 0x3c0c/2: // Audio Channel register
- verboselog(&m_machine, 0, "cdic_r: Audio Channel Register = %04x & %04x\n", m_audio_channel, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Audio Channel Register = %04x & %04x\n", m_audio_channel, mem_mask);
return m_audio_channel;
case 0x3ff4/2: // ABUF
@@ -977,11 +977,11 @@ UINT16 cdicdic_device::register_read(const UINT32 offset, const UINT16 mem_mask)
m_audio_buffer &= 0x7fff;
if(!((m_audio_buffer | m_x_buffer) & 0x8000))
{
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
- verboselog(&m_machine, 0, "Clearing CDIC interrupt line\n" );
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
+ verboselog(m_machine, 0, "Clearing CDIC interrupt line\n" );
////printf("Clearing CDIC interrupt line\n" );
}
- verboselog(&m_machine, 0, "cdic_r: Audio Buffer Register = %04x & %04x\n", temp, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Audio Buffer Register = %04x & %04x\n", temp, mem_mask);
return temp;
}
@@ -991,11 +991,11 @@ UINT16 cdicdic_device::register_read(const UINT32 offset, const UINT16 mem_mask)
m_x_buffer &= 0x7fff;
if(!((m_audio_buffer | m_x_buffer) & 0x8000))
{
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
- verboselog(&m_machine, 0, "Clearing CDIC interrupt line\n" );
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
+ verboselog(m_machine, 0, "Clearing CDIC interrupt line\n" );
////printf("Clearing CDIC interrupt line\n" );
}
- verboselog(&m_machine, 0, "cdic_r: X-Buffer Register = %04x & %04x\n", temp, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: X-Buffer Register = %04x & %04x\n", temp, mem_mask);
return temp;
}
@@ -1005,17 +1005,17 @@ UINT16 cdicdic_device::register_read(const UINT32 offset, const UINT16 mem_mask)
{
m_z_buffer ^= 0x0001;
}
- verboselog(&m_machine, 0, "cdic_r: Z-Buffer Register = %04x & %04x\n", m_z_buffer, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Z-Buffer Register = %04x & %04x\n", m_z_buffer, mem_mask);
return m_z_buffer;
}
case 0x3ffe/2:
{
- verboselog(&m_machine, 0, "cdic_r: Data buffer Register = %04x & %04x\n", m_data_buffer, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: Data buffer Register = %04x & %04x\n", m_data_buffer, mem_mask);
return m_data_buffer;
}
default:
- verboselog(&m_machine, 0, "cdic_r: UNIMPLEMENTED: Unknown address: %04x & %04x\n", addr*2, mem_mask);
+ verboselog(m_machine, 0, "cdic_r: UNIMPLEMENTED: Unknown address: %04x & %04x\n", addr*2, mem_mask);
return 0;
}
}
@@ -1034,51 +1034,51 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
switch(addr)
{
case 0x3c00/2: // Command register
- verboselog(&m_machine, 0, "cdic_w: Command Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Command Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_command);
break;
case 0x3c02/2: // Time register (MSW)
m_time &= ~(mem_mask << 16);
m_time |= (data & mem_mask) << 16;
- verboselog(&m_machine, 0, "cdic_w: Time Register (MSW) = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Time Register (MSW) = %04x & %04x\n", data, mem_mask);
break;
case 0x3c04/2: // Time register (LSW)
m_time &= ~mem_mask;
m_time |= data & mem_mask;
- verboselog(&m_machine, 0, "cdic_w: Time Register (LSW) = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Time Register (LSW) = %04x & %04x\n", data, mem_mask);
break;
case 0x3c06/2: // File register
- verboselog(&m_machine, 0, "cdic_w: File Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: File Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_file);
break;
case 0x3c08/2: // Channel register (MSW)
m_channel &= ~(mem_mask << 16);
m_channel |= (data & mem_mask) << 16;
- verboselog(&m_machine, 0, "cdic_w: Channel Register (MSW) = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Channel Register (MSW) = %04x & %04x\n", data, mem_mask);
break;
case 0x3c0a/2: // Channel register (LSW)
m_channel &= ~mem_mask;
m_channel |= data & mem_mask;
- verboselog(&m_machine, 0, "cdic_w: Channel Register (LSW) = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Channel Register (LSW) = %04x & %04x\n", data, mem_mask);
break;
case 0x3c0c/2: // Audio Channel register
- verboselog(&m_machine, 0, "cdic_w: Audio Channel Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Audio Channel Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_audio_channel);
break;
case 0x3ff4/2:
- verboselog(&m_machine, 0, "cdic_w: Audio Buffer Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Audio Buffer Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_audio_buffer);
break;
case 0x3ff6/2:
- verboselog(&m_machine, 0, "cdic_w: X Buffer Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: X Buffer Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_x_buffer);
break;
@@ -1090,9 +1090,9 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
UINT32 index = 0;
UINT32 device_index = (data & 0x3fff) >> 1;
UINT16 *memory = state->planea;
- verboselog(&m_machine, 0, "memory address counter: %08x\n", scc68070->dma.channel[0].memory_address_counter);
- verboselog(&m_machine, 0, "cdic_w: DMA Control Register = %04x & %04x\n", data, mem_mask);
- verboselog(&m_machine, 0, "Doing copy, transferring %04x bytes\n", count * 2 );
+ verboselog(m_machine, 0, "memory address counter: %08x\n", scc68070->dma.channel[0].memory_address_counter);
+ verboselog(m_machine, 0, "cdic_w: DMA Control Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "Doing copy, transferring %04x bytes\n", count * 2 );
////printf("Doing copy, transferring %04x bytes\n", count * 2 );
if((start & 0x00f00000) == 0x00200000)
{
@@ -1116,7 +1116,7 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
case 0x3ffa/2:
{
- verboselog(&m_machine, 0, "cdic_w: Z-Buffer Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Z-Buffer Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_z_buffer);
if(m_z_buffer & 0x2000)
{
@@ -1136,12 +1136,12 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
break;
}
case 0x3ffc/2:
- verboselog(&m_machine, 0, "cdic_w: Interrupt Vector Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Interrupt Vector Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_interrupt_vector);
break;
case 0x3ffe/2:
{
- verboselog(&m_machine, 0, "cdic_w: Data Buffer Register = %04x & %04x\n", data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: Data Buffer Register = %04x & %04x\n", data, mem_mask);
COMBINE_DATA(&m_data_buffer);
if(m_data_buffer & 0x8000)
{
@@ -1180,7 +1180,7 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
break;
}
default:
- verboselog(&m_machine, 0, "Unknown CDIC command: %02x\n", m_command );
+ verboselog(m_machine, 0, "Unknown CDIC command: %02x\n", m_command );
break;
}
}
@@ -1188,7 +1188,7 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
break;
}
default:
- verboselog(&m_machine, 0, "cdic_w: UNIMPLEMENTED: Unknown address: %04x = %04x & %04x\n", addr*2, data, mem_mask);
+ verboselog(m_machine, 0, "cdic_w: UNIMPLEMENTED: Unknown address: %04x = %04x & %04x\n", addr*2, data, mem_mask);
break;
}
}
@@ -1222,7 +1222,7 @@ void cdicdic_device::device_start()
m_audio_sample_timer = m_machine.scheduler().timer_alloc(FUNC(audio_sample_trigger));
m_audio_sample_timer->adjust(attotime::never);
- m_ram = auto_alloc_array(&m_machine, UINT16, 0x3c00/2);
+ m_ram = auto_alloc_array(m_machine, UINT16, 0x3c00/2);
}
//-------------------------------------------------
@@ -1243,7 +1243,7 @@ void cdicdic_device::device_reset()
else
{
// MAME case
- m_cd = cdrom_open(get_disk_handle(&m_machine, "cdrom"));
+ m_cd = cdrom_open(get_disk_handle(m_machine, "cdrom"));
cdda_set_cdrom(m_machine.device("cdda"), m_cd);
}
}
@@ -1294,7 +1294,7 @@ WRITE16_DEVICE_HANDLER( cdic_ram_w )
void cdicdic_device::ram_write(const UINT32 offset, const UINT16 data, const UINT16 mem_mask)
{
- verboselog(&m_machine, 5, "cdic_ram_w: %08x = %04x & %04x\n", 0x00300000 + offset*2, data, mem_mask);
+ verboselog(m_machine, 5, "cdic_ram_w: %08x = %04x & %04x\n", 0x00300000 + offset*2, data, mem_mask);
COMBINE_DATA(&m_ram[offset]);
}
@@ -1305,7 +1305,7 @@ READ16_DEVICE_HANDLER( cdic_ram_r )
UINT16 cdicdic_device::ram_read(const UINT32 offset, const UINT16 mem_mask)
{
- verboselog(&m_machine, 5, "cdic_ram_r: %08x = %04x & %04x\n", 0x00300000 + offset * 2, m_ram[offset], mem_mask);
+ verboselog(m_machine, 5, "cdic_ram_r: %08x = %04x & %04x\n", 0x00300000 + offset * 2, m_ram[offset], mem_mask);
return m_ram[offset];
}
diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c
index 037668088cf..60f741a2aad 100644
--- a/src/mame/machine/cdislave.c
+++ b/src/mame/machine/cdislave.c
@@ -26,7 +26,7 @@ TODO:
#include "includes/cdi.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -35,7 +35,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
@@ -74,7 +74,7 @@ device_config *cdislave_device_config::static_alloc_device_config(const machine_
device_t *cdislave_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cdislave_device(machine, *this));
+ return auto_alloc(machine, cdislave_device(machine, *this));
}
@@ -84,15 +84,15 @@ device_t *cdislave_device_config::alloc_device(running_machine &machine) const
TIMER_CALLBACK( cdislave_device::trigger_readback_int )
{
- cdislave_device *slave = static_cast<cdislave_device *>(machine->device("slave"));
+ cdislave_device *slave = static_cast<cdislave_device *>(machine.device("slave"));
slave->readback_trigger();
}
void cdislave_device::readback_trigger()
{
- verboselog(&m_machine, 0, "Asserting IRQ2\n" );
+ verboselog(m_machine, 0, "Asserting IRQ2\n" );
device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_2, 26);
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_2, ASSERT_LINE);
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_2, ASSERT_LINE);
m_interrupt_timer->adjust(attotime::never);
}
@@ -111,9 +111,9 @@ void cdislave_device::prepare_readback(attotime delay, UINT8 channel, UINT8 coun
void cdislave_device::perform_mouse_update()
{
- UINT16 x = input_port_read(&m_machine, "MOUSEX");
- UINT16 y = input_port_read(&m_machine, "MOUSEY");
- UINT8 buttons = input_port_read(&m_machine, "MOUSEBTN");
+ UINT16 x = input_port_read(m_machine, "MOUSEX");
+ UINT16 y = input_port_read(m_machine, "MOUSEY");
+ UINT8 buttons = input_port_read(m_machine, "MOUSEBTN");
UINT16 old_mouse_x = m_real_mouse_x;
UINT16 old_mouse_y = m_real_mouse_y;
@@ -151,7 +151,7 @@ void cdislave_device::perform_mouse_update()
INPUT_CHANGED( cdislave_device::mouse_update )
{
- cdislave_device *slave = static_cast<cdislave_device *>(field->port->machine->device("slave"));
+ cdislave_device *slave = static_cast<cdislave_device *>(field->port->machine().device("slave"));
slave->perform_mouse_update();
}
@@ -165,7 +165,7 @@ UINT16 cdislave_device::register_read(const UINT32 offset, const UINT16 mem_mask
if(m_channel[offset].m_out_count)
{
UINT8 ret = m_channel[offset].m_out_buf[m_channel[offset].m_out_index];
- verboselog(&m_machine, 0, "slave_r: Channel %d: %d, %02x\n", offset, m_channel[offset].m_out_index, ret );
+ verboselog(m_machine, 0, "slave_r: Channel %d: %d, %02x\n", offset, m_channel[offset].m_out_index, ret );
if(m_channel[offset].m_out_index == 0)
{
switch(m_channel[offset].m_out_cmd)
@@ -176,8 +176,8 @@ UINT16 cdislave_device::register_read(const UINT32 offset, const UINT16 mem_mask
case 0xf3:
case 0xf4:
case 0xf7:
- verboselog(&m_machine, 0, "slave_r: De-asserting IRQ2\n" );
- cputag_set_input_line(&m_machine, "maincpu", M68K_IRQ_2, CLEAR_LINE);
+ verboselog(m_machine, 0, "slave_r: De-asserting IRQ2\n" );
+ cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_2, CLEAR_LINE);
break;
}
}
@@ -191,7 +191,7 @@ UINT16 cdislave_device::register_read(const UINT32 offset, const UINT16 mem_mask
}
return ret;
}
- verboselog(&m_machine, 0, "slave_r: Channel %d: %d\n", offset, m_channel[offset].m_out_index );
+ verboselog(m_machine, 0, "slave_r: Channel %d: %d\n", offset, m_channel[offset].m_out_index );
return 0xff;
}
@@ -227,7 +227,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
case 0:
if(m_in_index)
{
- verboselog(&m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
m_in_buf[m_in_index] = data & 0x00ff;
m_in_index++;
if(m_in_index == m_in_count)
@@ -264,11 +264,11 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
- verboselog(&m_machine, 0, "slave_w: Channel %d: Update Mouse Position (0x%02x)\n", offset, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Update Mouse Position (0x%02x)\n", offset, data & 0x00ff );
m_in_count = 3;
break;
default:
- verboselog(&m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
m_in_index = 0;
break;
}
@@ -277,7 +277,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
case 1:
if(m_in_index)
{
- verboselog(&m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
m_in_buf[m_in_index] = data & 0x00ff;
m_in_index++;
if(m_in_index == m_in_count)
@@ -303,7 +303,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
switch(data & 0x00ff)
{
default:
- verboselog(&m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
memset(m_in_buf, 0, 17);
m_in_index = 0;
m_in_count = 0;
@@ -314,7 +314,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
case 2:
if(m_in_index)
{
- verboselog(&m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
m_in_buf[m_in_index] = data & 0x00ff;
m_in_index++;
if(m_in_index == m_in_count)
@@ -340,24 +340,24 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
switch(data & 0x00ff)
{
case 0x82: // Mute Audio
- verboselog(&m_machine, 0, "slave_w: Channel %d: Mute Audio (0x82)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Mute Audio (0x82)\n", offset );
dmadac_enable(&state->dmadac[0], 2, 0);
m_in_index = 0;
m_in_count = 0;
//cdic->audio_sample_timer->adjust(attotime::never);
break;
case 0x83: // Unmute Audio
- verboselog(&m_machine, 0, "slave_w: Channel %d: Unmute Audio (0x83)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Unmute Audio (0x83)\n", offset );
dmadac_enable(&state->dmadac[0], 2, 1);
m_in_index = 0;
m_in_count = 0;
break;
case 0xf0: // Set Front Panel LCD
- verboselog(&m_machine, 0, "slave_w: Channel %d: Set Front Panel LCD (0xf0)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Set Front Panel LCD (0xf0)\n", offset );
m_in_count = 17;
break;
default:
- verboselog(&m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
memset(m_in_buf, 0, 17);
m_in_index = 0;
m_in_count = 0;
@@ -368,7 +368,7 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
case 3:
if(m_in_index)
{
- verboselog(&m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
m_in_buf[m_in_index] = data & 0x00ff;
m_in_index++;
if(m_in_index == m_in_count)
@@ -402,45 +402,45 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
switch(data & 0x00ff)
{
case 0xb0: // Request Disc Status
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request Disc Status (0xb0)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request Disc Status (0xb0)\n", offset );
m_in_count = 4;
break;
case 0xb1: // Request Disc Base
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request Disc Base (0xb1)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request Disc Base (0xb1)\n", offset );
m_in_count = 4;
break;
case 0xf0: // Request SLAVE Revision
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request SLAVE Revision (0xf0)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request SLAVE Revision (0xf0)\n", offset );
prepare_readback(attotime::from_hz(10000), 2, 2, 0xf0, 0x32, 0x31, 0, 0xf0);
m_in_index = 0;
break;
case 0xf3: // Request Pointer Type
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request Pointer Type (0xf3)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request Pointer Type (0xf3)\n", offset );
m_in_index = 0;
prepare_readback(attotime::from_hz(10000), 2, 2, 0xf3, 1, 0, 0, 0xf3);
break;
case 0xf4: // Request Test Plug Status
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request Test Plug Status (0xf4)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request Test Plug Status (0xf4)\n", offset );
m_in_index = 0;
prepare_readback(attotime::from_hz(10000), 2, 2, 0xf4, 0, 0, 0, 0xf4);
break;
case 0xf6: // Request NTSC/PAL Status
- verboselog(&m_machine, 0, "slave_w: Channel %d: Request NTSC/PAL Status (0xf6)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Request NTSC/PAL Status (0xf6)\n", offset );
prepare_readback(attotime::never, 2, 2, 0xf6, 2, 0, 0, 0xf6);
m_in_index = 0;
break;
case 0xf7: // Enable Input Polling
- verboselog(&m_machine, 0, "slave_w: Channel %d: Activate Input Polling (0xf7)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Activate Input Polling (0xf7)\n", offset );
m_polling_active = 1;
m_in_index = 0;
break;
case 0xfa: // Enable X-Bus Interrupts
- verboselog(&m_machine, 0, "slave_w: Channel %d: X-Bus Interrupt Enable (0xfa)\n", offset );
+ verboselog(m_machine, 0, "slave_w: Channel %d: X-Bus Interrupt Enable (0xfa)\n", offset );
m_xbus_interrupt_enable = 1;
m_in_index = 0;
break;
default:
- verboselog(&m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
+ verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
memset(m_in_buf, 0, 17);
m_in_index = 0;
m_in_count = 0;
diff --git a/src/mame/machine/chaknpop.c b/src/mame/machine/chaknpop.c
index eab8c73e7ae..c7a788c8c39 100644
--- a/src/mame/machine/chaknpop.c
+++ b/src/mame/machine/chaknpop.c
@@ -45,9 +45,9 @@ static const UINT8 mcu_data[256] = {
0x10, 0xfc, 0x3e, 0x01, 0x32, 0x5b, 0x81, 0xc9
};
-static void mcu_update_seed( running_machine *machine, UINT8 data )
+static void mcu_update_seed( running_machine &machine, UINT8 data )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
if (!(data & 0x80))
{
@@ -67,7 +67,7 @@ static void mcu_update_seed( running_machine *machine, UINT8 data )
READ8_HANDLER( chaknpop_mcu_port_a_r )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
//logerror("%04x: MCU port_a read\n", cpu_get_pc(space->cpu));
return state->mcu_result;
}
@@ -88,7 +88,7 @@ READ8_HANDLER( chaknpop_mcu_port_c_r )
WRITE8_HANDLER( chaknpop_mcu_port_a_w )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
UINT8 mcu_command;
mcu_command = data + state->mcu_seed;
@@ -96,29 +96,29 @@ WRITE8_HANDLER( chaknpop_mcu_port_a_w )
if (mcu_command < 0x08)
{
- mcu_update_seed(space->machine, data);
+ mcu_update_seed(space->machine(), data);
state->mcu_result = mcu_data[state->mcu_select * 8 + mcu_command];
state->mcu_result -= state->mcu_seed;
- mcu_update_seed(space->machine, state->mcu_result);
+ mcu_update_seed(space->machine(), state->mcu_result);
logerror("%04x: MCU command 0x%02x, result 0x%02x\n", cpu_get_pc(space->cpu), mcu_command, state->mcu_result);
}
else if (mcu_command >= 0x28 && mcu_command <= 0x2a)
{
- mcu_update_seed(space->machine, data);
+ mcu_update_seed(space->machine(), data);
state->mcu_result = state->mcu_ram[0x380 + mcu_command];
state->mcu_result -= state->mcu_seed;
- mcu_update_seed(space->machine, state->mcu_result);
+ mcu_update_seed(space->machine(), state->mcu_result);
logerror("%04x: MCU command 0x%02x, result 0x%02x\n", cpu_get_pc(space->cpu), mcu_command, state->mcu_result);
}
else if (mcu_command < 0x80)
{
- mcu_update_seed(space->machine, data);
+ mcu_update_seed(space->machine(), data);
if (mcu_command >= 0x40 && mcu_command < 0x60)
{
@@ -129,7 +129,7 @@ WRITE8_HANDLER( chaknpop_mcu_port_a_w )
}
else if (mcu_command == 0x9c|| mcu_command == 0xde)
{
- mcu_update_seed(space->machine, data);
+ mcu_update_seed(space->machine(), data);
logerror("%04x: MCU command 0x%02x\n", cpu_get_pc(space->cpu), mcu_command);
}
diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c
index abfed40517b..51d418ca9fa 100644
--- a/src/mame/machine/cps2crpt.c
+++ b/src/mame/machine/cps2crpt.c
@@ -630,11 +630,11 @@ static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in)
-static void cps2_decrypt(running_machine *machine, const UINT32 *master_key, UINT32 upper_limit)
+static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UINT32 upper_limit)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
UINT16 *dec = auto_alloc_array(machine, UINT16, length/2);
int i;
UINT32 key1[4];
@@ -721,7 +721,7 @@ static void cps2_decrypt(running_machine *machine, const UINT32 *master_key, UIN
}
space->set_decrypted_region(0x000000, length - 1, dec);
- m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length);
+ m68k_set_encrypted_opcode_range(machine.device("maincpu"), 0, length);
}
@@ -989,7 +989,7 @@ static const struct game_keys keys_table[] =
DRIVER_INIT( cps2crpt )
{
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
const struct game_keys *k = &keys_table[0];
while (k->name)
diff --git a/src/mame/machine/cx4fn.c b/src/mame/machine/cx4fn.c
index 1f795f9c818..050e9be6a9a 100644
--- a/src/mame/machine/cx4fn.c
+++ b/src/mame/machine/cx4fn.c
@@ -92,7 +92,7 @@ static void CX4_C4TransfWireFrame2(void)
cx4.C4WFYVal = (INT16)(cx4.c4y * cx4.C4WFScale / 0x100);
}
-static void CX4_C4DrawWireFrame(running_machine *machine)
+static void CX4_C4DrawWireFrame(running_machine &machine)
{
UINT32 line = CX4_readl(0x1f80);
UINT32 point1, point2;
@@ -101,7 +101,7 @@ static void CX4_C4DrawWireFrame(running_machine *machine)
UINT8 Color;
INT32 i;
- address_space *space = machine->device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i = cx4.ram[0x0295]; i > 0; i--, line += 5)
{
if(space->read_byte(line) == 0xff &&
diff --git a/src/mame/machine/cx4oam.c b/src/mame/machine/cx4oam.c
index 74aa559864c..c0cafe07017 100644
--- a/src/mame/machine/cx4oam.c
+++ b/src/mame/machine/cx4oam.c
@@ -9,7 +9,7 @@
***************************************************************************/
//Build OAM
-static void CX4_op00_00(running_machine *machine)
+static void CX4_op00_00(running_machine &machine)
{
INT32 i;
@@ -44,7 +44,7 @@ static void CX4_op00_00(running_machine *machine)
offset = (cx4.ram[0x626] & 3) * 2;
srcptr = 0x220;
- address_space *space = machine->device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i = cx4.ram[0x620]; i > 0 && sprcount > 0; i--, srcptr += 16)
{
UINT32 spraddr = CX4_readl(srcptr + 7);
@@ -133,7 +133,7 @@ static void CX4_op00_03(void)
}
//Transform Lines
-static void CX4_op00_05(running_machine *machine)
+static void CX4_op00_05(running_machine &machine)
{
INT32 i;
UINT32 ptr = 0, ptr2 = 0;
@@ -185,13 +185,13 @@ static void CX4_op00_07(void)
}
//Draw Wireframe
-static void CX4_op00_08(running_machine *machine)
+static void CX4_op00_08(running_machine &machine)
{
CX4_C4DrawWireFrame(machine);
}
//Disintegrate
-static void CX4_op00_0b(running_machine *machine)
+static void CX4_op00_0b(running_machine &machine)
{
UINT8 width, height;
UINT32 startx, starty;
@@ -241,7 +241,7 @@ static void CX4_op00_0b(running_machine *machine)
}
//Bitplane Wave
-static void CX4_op00_0c(running_machine *machine)
+static void CX4_op00_0c(running_machine &machine)
{
int i, j;
UINT32 destptr = 0;
diff --git a/src/mame/machine/cx4ops.c b/src/mame/machine/cx4ops.c
index 87050abca3b..e33de9b1835 100644
--- a/src/mame/machine/cx4ops.c
+++ b/src/mame/machine/cx4ops.c
@@ -9,7 +9,7 @@
***************************************************************************/
//Sprite Functions
-static void CX4_op00(running_machine* machine)
+static void CX4_op00(running_machine& machine)
{
switch(cx4.reg[0x4d])
{
@@ -24,14 +24,14 @@ static void CX4_op00(running_machine* machine)
}
//Draw Wireframe
-static void CX4_op01(running_machine* machine)
+static void CX4_op01(running_machine& machine)
{
memset(cx4.ram + 0x300, 0, 2304);
CX4_C4DrawWireFrame(machine);
}
//Propulsion
-static void CX4_op05(running_machine *machine)
+static void CX4_op05(running_machine &machine)
{
INT32 temp = 0x10000;
if(CX4_readw(0x1f83))
@@ -42,7 +42,7 @@ static void CX4_op05(running_machine *machine)
}
//Set Vector length
-static void CX4_op0d(running_machine *machine)
+static void CX4_op0d(running_machine &machine)
{
cx4.C41FXVal = CX4_readw(0x1f80);
cx4.C41FYVal = CX4_readw(0x1f83);
@@ -108,7 +108,7 @@ static void CX4_op13(void)
}
//Pythagorean
-static void CX4_op15(running_machine *machine)
+static void CX4_op15(running_machine &machine)
{
double temp = 0.0;
cx4.C41FXVal = CX4_readw(0x1f80);
@@ -119,7 +119,7 @@ static void CX4_op15(running_machine *machine)
}
//Calculate distance
-static void CX4_op1f(running_machine *machine)
+static void CX4_op1f(running_machine &machine)
{
cx4.C41FXVal = CX4_readw(0x1f80);
cx4.C41FYVal = CX4_readw(0x1f83);
@@ -208,7 +208,7 @@ static void CX4_op25(void)
}
//Transform Coords
-static void CX4_op2d(running_machine *machine)
+static void CX4_op2d(running_machine &machine)
{
cx4.C4WFXVal = CX4_readw(0x1f81);
cx4.C4WFYVal = CX4_readw(0x1f84);
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index 729b90bd33c..9a09a6247e7 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -265,7 +265,7 @@ static void wave_dma_execute(address_space *space)
wave_dma.flag = (wave_dma.indirect & 1) ? 1 : 0;
/* Note: if you trigger an instant DMA IRQ trigger, sfz3upper doesn't play any bgm. */
/* TODO: timing of this */
- space->machine->scheduler().timer_set(attotime::from_usec(300), FUNC(aica_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(300), FUNC(aica_dma_irq));
}
static void pvr_dma_execute(address_space *space)
@@ -303,13 +303,13 @@ static void pvr_dma_execute(address_space *space)
}
/* Note: do not update the params, since this DMA type doesn't support it. */
/* TODO: timing of this */
- space->machine->scheduler().timer_set(attotime::from_usec(250), FUNC(pvr_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(250), FUNC(pvr_dma_irq));
}
// register decode helpers
// this accepts only 32-bit accesses
-INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
+INLINE int decode_reg32_64(running_machine &machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
{
int reg = offset * 2;
@@ -318,7 +318,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m
// non 32-bit accesses have not yet been seen here, we need to know when they are
if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
- mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context());
+ mame_printf_verbose("%s:Wrong mask!\n", machine.describe_context());
// debugger_break(machine);
}
@@ -332,7 +332,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m
}
// this accepts only 32 and 16 bit accesses
-INLINE int decode_reg3216_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
+INLINE int decode_reg3216_64(running_machine &machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift)
{
int reg = offset * 2;
@@ -342,7 +342,7 @@ INLINE int decode_reg3216_64(running_machine *machine, UINT32 offset, UINT64 mem
if ((mem_mask != U64(0x0000ffff00000000)) && (mem_mask != U64(0x000000000000ffff)) &&
(mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff)))
{
- mame_printf_verbose("%s:Wrong mask!\n", machine->describe_context());
+ mame_printf_verbose("%s:Wrong mask!\n", machine.describe_context());
// debugger_break(machine);
}
@@ -355,7 +355,7 @@ INLINE int decode_reg3216_64(running_machine *machine, UINT32 offset, UINT64 mem
return reg;
}
-int dc_compute_interrupt_level(running_machine *machine)
+int dc_compute_interrupt_level(running_machine &machine)
{
UINT32 ln,lx,le;
@@ -386,7 +386,7 @@ int dc_compute_interrupt_level(running_machine *machine)
return 0;
}
-void dc_update_interrupt_status(running_machine *machine)
+void dc_update_interrupt_status(running_machine &machine)
{
int level;
@@ -409,14 +409,14 @@ void dc_update_interrupt_status(running_machine *machine)
}
level=dc_compute_interrupt_level(machine);
- sh4_set_irln_input(machine->device("maincpu"), 15-level);
+ sh4_set_irln_input(machine.device("maincpu"), 15-level);
/* Wave DMA HW trigger */
if(wave_dma.flag && ((wave_dma.sel & 2) == 2))
{
if((dc_sysctrl_regs[SB_G2DTNRM] & dc_sysctrl_regs[SB_ISTNRM]) || (dc_sysctrl_regs[SB_G2DTEXT] & dc_sysctrl_regs[SB_ISTEXT]))
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
printf("Wave DMA HW trigger\n");
wave_dma_execute(space);
@@ -428,7 +428,7 @@ void dc_update_interrupt_status(running_machine *machine)
{
if((dc_sysctrl_regs[SB_PDTNRM] & dc_sysctrl_regs[SB_ISTNRM]) || (dc_sysctrl_regs[SB_PDTEXT] & dc_sysctrl_regs[SB_ISTEXT]))
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
printf("PVR-DMA HW trigger\n");
pvr_dma_execute(space);
@@ -487,7 +487,7 @@ static int jvsboard_init(int pos)
return 13;
}
-static int jvsboard_indirect_read(running_machine *machine, int pos)
+static int jvsboard_indirect_read(running_machine &machine, int pos)
{
// report1,jvsbytes repeated for each function
//1 digital inputs
@@ -545,7 +545,7 @@ static int jvsboard_indirect_read(running_machine *machine, int pos)
return 17;
}
-static int jvsboard_direct_read(running_machine *machine)
+static int jvsboard_direct_read(running_machine &machine)
{
/* valid data check*/
maple0x86data2[0x11] = 0x00;
@@ -620,7 +620,7 @@ READ64_HANDLER( dc_sysctrl_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
#if DEBUG_SYSCTRL
if ((reg != 0x40) && (reg != 0x41) && (reg != 0x42) && (reg != 0x23) && (reg > 2)) // filter out IRQ status reads
@@ -640,7 +640,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
UINT32 address;
struct sh4_ddt_dma ddtdata;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = dc_sysctrl_regs[reg];
dc_sysctrl_regs[reg] = dat; // 5f6800+off*4=dat
@@ -663,7 +663,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
ddtdata.direction=0;
ddtdata.channel=2;
ddtdata.mode=25; //011001
- sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
#if DEBUG_SYSCTRL
if ((address >= 0x11000000) && (address <= 0x11FFFFFF))
if (dc_sysctrl_regs[SB_LMMODE0])
@@ -689,26 +689,26 @@ WRITE64_HANDLER( dc_sysctrl_w )
dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length;
/* 200 usecs breaks sfz3upper */
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(ch2_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(ch2_dma_irq));
/* simulate YUV FIFO processing here */
if((address & 0x1800000) == 0x0800000)
- space->machine->scheduler().timer_set(attotime::from_usec(500), FUNC(yuv_fifo_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(yuv_fifo_irq));
}
break;
case SB_ISTNRM:
dc_sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro
- dc_update_interrupt_status(space->machine);
+ dc_update_interrupt_status(space->machine());
break;
case SB_ISTEXT:
dc_sysctrl_regs[SB_ISTEXT] = old;
- dc_update_interrupt_status(space->machine);
+ dc_update_interrupt_status(space->machine());
break;
case SB_ISTERR:
dc_sysctrl_regs[SB_ISTERR] = old & ~dat;
- dc_update_interrupt_status(space->machine);
+ dc_update_interrupt_status(space->machine());
break;
case SB_SDST:
if(dat & 1)
@@ -718,7 +718,7 @@ WRITE64_HANDLER( dc_sysctrl_w )
dc_sysctrl_regs[SB_SDST] = 0;
dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_SORT;
- dc_update_interrupt_status(space->machine);
+ dc_update_interrupt_status(space->machine());
}
break;
}
@@ -737,7 +737,7 @@ READ64_HANDLER( naomi_maple_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
#if DEBUG_MAPLE_REGS
mame_printf_verbose("MAPLE: Unmapped read %08x\n", 0x5f6c00+reg*4);
@@ -759,7 +759,7 @@ WRITE64_HANDLER( naomi_maple_w )
int a;
int off,len/*,func*/;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = maple_regs[reg];
@@ -793,7 +793,7 @@ WRITE64_HANDLER( naomi_maple_w )
ddtdata.direction=0; // 0 source to buffer, 1 buffer to source
ddtdata.channel= -1; // not used
ddtdata.mode= -1; // copy from/to buffer
- sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"), &ddtdata);
endflag=buff[0] & 0x80000000;
port=(buff[0] >> 16) & 3;
@@ -832,7 +832,7 @@ WRITE64_HANDLER( naomi_maple_w )
ddtdata.direction=0;
ddtdata.channel= -1;
ddtdata.mode=-1;
- sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
chk=0;
for (a=1;a < length;a++)
{
@@ -850,7 +850,7 @@ WRITE64_HANDLER( naomi_maple_w )
break;
case 0x82: // get license string
for (a=0;a < 16;a++)
- buff[a] = (input_port_read(space->machine, "DSW") & 1) ? maple0x82answer_31kHz[a] : maple0x82answer_15kHz[a];
+ buff[a] = (input_port_read(space->machine(), "DSW") & 1) ? maple0x82answer_31kHz[a] : maple0x82answer_15kHz[a];
ddtdata.length=16;
break;
case 0x86:
@@ -858,7 +858,7 @@ WRITE64_HANDLER( naomi_maple_w )
ddtdata.direction=0;
ddtdata.channel= -1;
ddtdata.mode=-1;
- sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
subcommand = buff[0] & 0xff;
#if DEBUG_MAPLE
@@ -909,7 +909,7 @@ WRITE64_HANDLER( naomi_maple_w )
maple0x86data2[3] = maple0x86data2[3] | 0x0c;
maple0x86data2[6] = maple0x86data2[6] & 0xcf;
- a = input_port_read(space->machine, "IN0"); // put keys here
+ a = input_port_read(space->machine(), "IN0"); // put keys here
maple0x86data2[6] = maple0x86data2[6] | (a << 4);
pos = 0x11;
tocopy = 17;
@@ -971,7 +971,7 @@ WRITE64_HANDLER( naomi_maple_w )
break;
case -1: // special case to read controls
case -2:
- jvsboard_indirect_read(space->machine,pos);
+ jvsboard_indirect_read(space->machine(),pos);
if (jvs_command == -1)
{
// ?
@@ -1015,10 +1015,10 @@ WRITE64_HANDLER( naomi_maple_w )
maple0x86data2[3] = maple0x86data2[3] | 0x0c;
maple0x86data2[6] = maple0x86data2[6] & 0xcf;
- a = input_port_read(space->machine, "IN0"); // put keys here
+ a = input_port_read(space->machine(), "IN0"); // put keys here
maple0x86data2[6] = maple0x86data2[6] | (a << 4);
- tocopy = jvsboard_direct_read(space->machine);
+ tocopy = jvsboard_direct_read(space->machine());
// command end flag
maple0x86data2[0x18] = (jvs_command == -1) ? 19 : 17;
@@ -1062,11 +1062,11 @@ WRITE64_HANDLER( naomi_maple_w )
ddtdata.destination=destination;
ddtdata.buffer=buff;
ddtdata.direction=1;
- sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
if (endflag)
{
- space->machine->scheduler().timer_set(attotime::from_usec(200), FUNC(maple_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(200), FUNC(maple_dma_irq));
break;
}
// skip fixed packet header
@@ -1088,7 +1088,7 @@ READ64_HANDLER( dc_maple_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
#if DEBUG_MAPLE_REGS
mame_printf_verbose("MAPLE: Unmapped read %08x\n", 0x5f6c00+reg*4);
@@ -1105,7 +1105,7 @@ WRITE64_HANDLER( dc_maple_w )
UINT32 buff[512];
UINT32 endflag,port,pattern,length,command,dap,sap,destination;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = maple_regs[reg];
@@ -1139,7 +1139,7 @@ WRITE64_HANDLER( dc_maple_w )
ddtdata.direction=0; // 0 source to buffer, 1 buffer to source
ddtdata.channel= -1; // not used
ddtdata.mode= -1; // copy from/to buffer
- sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"), &ddtdata);
endflag=buff[0] & 0x80000000;
port=(buff[0] >> 16) & 3;
@@ -1194,7 +1194,7 @@ WRITE64_HANDLER( dc_maple_w )
sprintf(pH, "P%dH", port+1);
buff[1] = func;
- buff[2] = input_port_read(space->machine, pH)<<8 | input_port_read(space->machine, pL) | 0xffff0000;
+ buff[2] = input_port_read(space->machine(), pH)<<8 | input_port_read(space->machine(), pL) | 0xffff0000;
buff[3] = 0xffffffff;
ddtdata.length=(8/4)+1;
break;
@@ -1211,11 +1211,11 @@ WRITE64_HANDLER( dc_maple_w )
ddtdata.destination=destination;
ddtdata.buffer=buff;
ddtdata.direction=1;
- sh4_dma_ddt(space->machine->device("maincpu"),&ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"),&ddtdata);
if (endflag)
{
- space->machine->scheduler().timer_set(attotime::from_usec(200), FUNC(maple_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(200), FUNC(maple_dma_irq));
break;
}
// skip fixed packet header
@@ -1283,7 +1283,7 @@ READ64_HANDLER( dc_g1_ctrl_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
mame_printf_verbose("G1CTRL: Unmapped read %08x\n", 0x5f7400+reg*4);
return (UINT64)g1bus_regs[reg] << shift;
}
@@ -1297,7 +1297,7 @@ WRITE64_HANDLER( dc_g1_ctrl_w )
UINT8 *ROM;
UINT32 dmaoffset;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = g1bus_regs[reg];
@@ -1316,8 +1316,8 @@ WRITE64_HANDLER( dc_g1_ctrl_w )
}
g1bus_regs[SB_GDST] = dat & 1;
// printf("ROM board DMA to %x len %x (PC %x)\n", g1bus_regs[SB_GDSTAR], g1bus_regs[SB_GDLEN], cpu_get_pc(space->cpu));
- ROM = (UINT8 *)naomibd_get_memory(space->machine->device("rom_board"));
- dmaoffset = naomibd_get_dmaoffset(space->machine->device("rom_board"));
+ ROM = (UINT8 *)naomibd_get_memory(space->machine().device("rom_board"));
+ dmaoffset = naomibd_get_dmaoffset(space->machine().device("rom_board"));
ddtdata.destination=g1bus_regs[SB_GDSTAR]; // destination address
ddtdata.length=g1bus_regs[SB_GDLEN] >> 5; // words to transfer
/* data in the lower 5 bits makes the length size to round by 32 bytes, this'll be needed by Virtua Tennis to boot (according to Deunan) */
@@ -1330,10 +1330,10 @@ WRITE64_HANDLER( dc_g1_ctrl_w )
ddtdata.channel= -1; // not used
ddtdata.mode= -1; // copy from/to buffer
mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dmaoffset, g1bus_regs[SB_GDSTAR]);
- sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata);
+ sh4_dma_ddt(space->machine().device("maincpu"), &ddtdata);
/* Note: KOF Neowave definitely wants this to be delayed (!) */
/* FIXME: timing of this */
- space->machine->scheduler().timer_set(attotime::from_usec(500), FUNC(gdrom_dma_irq));
+ space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(gdrom_dma_irq));
}
break;
}
@@ -1344,7 +1344,7 @@ READ64_HANDLER( dc_g2_ctrl_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
mame_printf_verbose("G2CTRL: Unmapped read %08x\n", 0x5f7800+reg*4);
return (UINT64)g2bus_regs[reg] << shift;
}
@@ -1356,7 +1356,7 @@ WRITE64_HANDLER( dc_g2_ctrl_w )
UINT32 dat;
UINT8 old;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
g2bus_regs[reg] = dat; // 5f7800+reg*4=dat
@@ -1499,7 +1499,7 @@ READ64_HANDLER( dc_modem_r )
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
// from ElSemi: this makes Atomiswave do it's "verbose boot" with a Sammy logo and diagnostics instead of just running the cart.
// our PVR emulation is apparently not good enough for that to work yet though.
@@ -1518,7 +1518,7 @@ WRITE64_HANDLER( dc_modem_w )
UINT64 shift;
UINT32 dat;
- reg = decode_reg32_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
mame_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask);
}
@@ -1528,7 +1528,7 @@ READ64_HANDLER( dc_rtc_r )
int reg;
UINT64 shift;
- reg = decode_reg3216_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg3216_64(space->machine(), offset, mem_mask, &shift);
mame_printf_verbose("RTC: Unmapped read %08x\n", 0x710000+reg*4);
return (UINT64)dc_rtcregister[reg] << shift;
@@ -1540,7 +1540,7 @@ WRITE64_HANDLER( dc_rtc_w )
UINT64 shift;
UINT32 old,dat;
- reg = decode_reg3216_64(space->machine, offset, mem_mask, &shift);
+ reg = decode_reg3216_64(space->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
old = dc_rtcregister[reg];
dc_rtcregister[reg] = dat & 0xFFFF; // 5f6c00+off*4=dat
@@ -1573,13 +1573,13 @@ static TIMER_CALLBACK(dc_rtc_increment)
}
/* fill the RTC registers with the proper start-up values */
-static void rtc_initial_setup(running_machine *machine)
+static void rtc_initial_setup(running_machine &machine)
{
static UINT32 current_time;
static int year_count,cur_year,i;
static const int month_to_day_conversion[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
system_time systime;
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
@@ -1609,7 +1609,7 @@ static void rtc_initial_setup(running_machine *machine)
dc_rtcregister[RTC2] = current_time & 0x0000ffff;
dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16;
- dc_rtc_timer = machine->scheduler().timer_alloc(FUNC(dc_rtc_increment));
+ dc_rtc_timer = machine.scheduler().timer_alloc(FUNC(dc_rtc_increment));
}
MACHINE_START( dc )
@@ -1638,7 +1638,7 @@ READ64_DEVICE_HANDLER( dc_aica_reg_r )
//int reg;
UINT64 shift;
- /*reg = */decode_reg32_64(device->machine, offset, mem_mask, &shift);
+ /*reg = */decode_reg32_64(device->machine(), offset, mem_mask, &shift);
// mame_printf_verbose("AICA REG: [%08x] read %" I64FMT "x, mask %" I64FMT "x\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
@@ -1651,7 +1651,7 @@ WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
UINT64 shift;
UINT32 dat;
- reg = decode_reg32_64(device->machine, offset, mem_mask, &shift);
+ reg = decode_reg32_64(device->machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
if (reg == (0x2c00/4))
@@ -1659,12 +1659,12 @@ WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
if (dat & 1)
{
/* halt the ARM7 */
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
}
else
{
/* it's alive ! */
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
}
}
diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c
index ff5eac4947e..d575d81320e 100644
--- a/src/mame/machine/dec0.c
+++ b/src/mame/machine/dec0.c
@@ -16,17 +16,17 @@ Data East machine functions - Bryan McPhail, mish@tendril.co.uk
READ16_HANDLER( dec0_controls_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
switch (offset<<1)
{
case 0: /* Player 1 & 2 joystick & buttons */
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 2: /* Credits, start buttons */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */
//logerror("CPU #0 PC %06x: warning - read i8751 %06x - %04x\n", cpu_get_pc(space->cpu), 0x30c000+offset, state->i8751_return);
@@ -44,10 +44,10 @@ READ16_HANDLER( dec0_rotary_r )
switch (offset<<1)
{
case 0: /* Player 1 rotary */
- return ~(1 << input_port_read(space->machine, "AN0"));
+ return ~(1 << input_port_read(space->machine(), "AN0"));
case 8: /* Player 2 rotary */
- return ~(1 << input_port_read(space->machine, "AN1"));
+ return ~(1 << input_port_read(space->machine(), "AN1"));
default:
logerror("Unknown rotary read at 300000 %02x\n", offset);
@@ -63,19 +63,19 @@ READ16_HANDLER( midres_controls_r )
switch (offset<<1)
{
case 0: /* Player 1 Joystick + start, Player 2 Joystick + start */
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 2: /* Dipswitches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 4: /* Player 1 rotary */
- return ~(1 << input_port_read(space->machine, "AN0"));
+ return ~(1 << input_port_read(space->machine(), "AN0"));
case 6: /* Player 2 rotary */
- return ~(1 << input_port_read(space->machine, "AN1"));
+ return ~(1 << input_port_read(space->machine(), "AN1"));
case 8: /* Credits, start buttons */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 12:
return 0; /* ?? watchdog ?? */
@@ -92,7 +92,7 @@ READ16_HANDLER( midres_controls_r )
READ8_HANDLER( hippodrm_prot_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
//logerror("6280 PC %06x - Read %06x\n",cpu_getpc(),offset+0x1d0000);
if (state->hippodrm_lsb==0x45) return 0x4e;
if (state->hippodrm_lsb==0x92) return 0x15;
@@ -101,7 +101,7 @@ READ8_HANDLER( hippodrm_prot_r )
WRITE8_HANDLER( hippodrm_prot_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
switch (offset) {
case 4: state->hippodrm_msb=data; break;
case 5: state->hippodrm_lsb=data; break;
@@ -111,26 +111,26 @@ WRITE8_HANDLER( hippodrm_prot_w )
READ8_HANDLER( hippodrm_shared_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
return state->share[offset];
}
WRITE8_HANDLER( hippodrm_shared_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->share[offset]=data;
}
static READ16_HANDLER( hippodrm_68000_share_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
if (offset==0) device_yield(space->cpu); /* A wee helper */
return state->share[offset]&0xff;
}
static WRITE16_HANDLER( hippodrm_68000_share_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->share[offset]=data&0xff;
}
@@ -173,7 +173,7 @@ static WRITE16_HANDLER( hippodrm_68000_share_w )
READ8_HANDLER(dec0_mcu_port_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
int latchEnable=state->i8751_ports[2]>>4;
// P0 connected to 4 latches
@@ -194,15 +194,15 @@ READ8_HANDLER(dec0_mcu_port_r )
WRITE8_HANDLER(dec0_mcu_port_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->i8751_ports[offset]=data;
if (offset==2)
{
if ((data&0x4)==0)
- cputag_set_input_line(space->machine, "maincpu", 5, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 5, HOLD_LINE);
if ((data&0x8)==0)
- cputag_set_input_line(space->machine, "mcu", MCS51_INT1_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", MCS51_INT1_LINE, CLEAR_LINE);
if ((data&0x40)==0)
state->i8751_return=(state->i8751_return&0xff00)|(state->i8751_ports[0]);
if ((data&0x80)==0)
@@ -210,9 +210,9 @@ WRITE8_HANDLER(dec0_mcu_port_w )
}
}
-static void baddudes_i8751_write(running_machine *machine, int data)
+static void baddudes_i8751_write(running_machine &machine, int data)
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->i8751_return=0;
switch (data&0xffff) {
@@ -234,13 +234,13 @@ static void baddudes_i8751_write(running_machine *machine, int data)
case 0x75b: state->i8751_return=0x70f; break;
}
- if (!state->i8751_return) logerror("%s: warning - write unknown command %02x to 8571\n",machine->describe_context(),data);
+ if (!state->i8751_return) logerror("%s: warning - write unknown command %02x to 8571\n",machine.describe_context(),data);
cputag_set_input_line(machine, "maincpu", 5, HOLD_LINE);
}
-static void birdtry_i8751_write(running_machine *machine, int data)
+static void birdtry_i8751_write(running_machine &machine, int data)
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
static int pwr,
hgt;
@@ -305,14 +305,14 @@ static void birdtry_i8751_write(running_machine *machine, int data)
/*These are activated after a shot (???)*/
case 0x6ca: state->i8751_return = 0xff; break;
case 0x7ff: state->i8751_return = 0x200; break;
- default: logerror("%s: warning - write unknown command %02x to 8571\n",machine->describe_context(),data);
+ default: logerror("%s: warning - write unknown command %02x to 8571\n",machine.describe_context(),data);
}
cputag_set_input_line(machine, "maincpu", 5, HOLD_LINE);
}
-void dec0_i8751_write(running_machine *machine, int data)
+void dec0_i8751_write(running_machine &machine, int data)
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->i8751_command=data;
/* Writes to this address cause an IRQ to the i8751 microcontroller */
@@ -320,12 +320,12 @@ void dec0_i8751_write(running_machine *machine, int data)
if (state->GAME == 2) baddudes_i8751_write(machine, data);
if (state->GAME == 3) birdtry_i8751_write(machine, data);
- //logerror("%s: warning - write %02x to i8751\n",machine->describe_context(),data);
+ //logerror("%s: warning - write %02x to i8751\n",machine.describe_context(),data);
}
-void dec0_i8751_reset(running_machine *machine)
+void dec0_i8751_reset(running_machine &machine)
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->i8751_return=state->i8751_command=0;
}
@@ -333,7 +333,7 @@ void dec0_i8751_reset(running_machine *machine)
static WRITE16_HANDLER( sprite_mirror_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
COMBINE_DATA(&state->spriteram[offset]);
}
@@ -341,7 +341,7 @@ static WRITE16_HANDLER( sprite_mirror_w )
static READ16_HANDLER( robocop_68000_share_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
//logerror("%08x: Share read %04x\n",cpu_get_pc(space->cpu),offset);
return state->robocop_shared_ram[offset];
@@ -349,21 +349,21 @@ static READ16_HANDLER( robocop_68000_share_r )
static WRITE16_HANDLER( robocop_68000_share_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
// logerror("%08x: Share write %04x %04x\n",cpu_get_pc(space->cpu),offset,data);
state->robocop_shared_ram[offset]=data&0xff;
if (offset == 0x7ff) /* A control address - not standard ram */
- cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, HOLD_LINE);
}
/******************************************************************************/
-static void h6280_decrypt(running_machine *machine, const char *cputag)
+static void h6280_decrypt(running_machine &machine, const char *cputag)
{
int i;
- UINT8 *RAM = machine->region(cputag)->base();
+ UINT8 *RAM = machine.region(cputag)->base();
/* Read each byte, decrypt it */
for (i = 0x00000; i < 0x10000; i++)
@@ -372,10 +372,10 @@ static void h6280_decrypt(running_machine *machine, const char *cputag)
DRIVER_INIT( hippodrm )
{
- UINT8 *RAM = machine->region("sub")->base();
+ UINT8 *RAM = machine.region("sub")->base();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x180000, 0x180fff, FUNC(hippodrm_68000_share_r), FUNC(hippodrm_68000_share_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xffc800, 0xffcfff, FUNC(sprite_mirror_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x180000, 0x180fff, FUNC(hippodrm_68000_share_r), FUNC(hippodrm_68000_share_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xffc800, 0xffcfff, FUNC(sprite_mirror_w));
h6280_decrypt(machine, "sub");
@@ -388,7 +388,7 @@ DRIVER_INIT( hippodrm )
DRIVER_INIT( slyspy )
{
- UINT8 *RAM = machine->region("audiocpu")->base();
+ UINT8 *RAM = machine.region("audiocpu")->base();
h6280_decrypt(machine, "audiocpu");
@@ -399,30 +399,30 @@ DRIVER_INIT( slyspy )
DRIVER_INIT( robocop )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x180000, 0x180fff, FUNC(robocop_68000_share_r), FUNC(robocop_68000_share_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x180000, 0x180fff, FUNC(robocop_68000_share_r), FUNC(robocop_68000_share_w));
}
DRIVER_INIT( baddudes )
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->GAME = 2;
}
DRIVER_INIT( hbarrel )
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->GAME = 1;
}
DRIVER_INIT( birdtry )
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
UINT8 *src, tmp;
int i, j, k;
state->GAME=3;
- src = machine->region("gfx4")->base();
+ src = machine.region("gfx4")->base();
/* some parts of the graphic have bytes swapped */
for (k = 0;k < 0x70000;k += 0x20000)
diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c
index 6ad2c5fb5de..619c48f81d2 100644
--- a/src/mame/machine/deco102.c
+++ b/src/mame/machine/deco102.c
@@ -47,19 +47,19 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor)
bs[8],bs[9],bs[10],bs[11],bs[12],bs[13],bs[14],bs[15]);
}
-void deco102_decrypt_cpu(running_machine *machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor)
+void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor)
{
int i;
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region(cputag)->base();
- int size = machine->region(cputag)->bytes();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region(cputag)->base();
+ int size = machine.region(cputag)->bytes();
UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2);
UINT16 *buf = auto_alloc_array(machine, UINT16, size / 2);
memcpy(buf, rom, size);
space->set_decrypted_region(0, size - 1, opcodes);
- m68k_set_encrypted_opcode_range(machine->device(cputag), 0, size);
+ m68k_set_encrypted_opcode_range(machine.device(cputag), 0, size);
for (i = 0; i < size / 2; i++)
{
diff --git a/src/mame/machine/deco156.c b/src/mame/machine/deco156.c
index 3435089026b..68d464758c7 100644
--- a/src/mame/machine/deco156.c
+++ b/src/mame/machine/deco156.c
@@ -122,10 +122,10 @@ static void decrypt(UINT32 *src, UINT32 *dst, int length)
}
-void deco156_decrypt(running_machine *machine)
+void deco156_decrypt(running_machine &machine)
{
- UINT32 *rom = (UINT32 *)machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ UINT32 *rom = (UINT32 *)machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
UINT32 *buf = auto_alloc_array(machine, UINT32, length/4);
memcpy(buf, rom, length);
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 4c80f42b347..925a2f537e5 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -58,7 +58,7 @@ WRITE8_HANDLER( decocass_coin_counter_w )
WRITE8_HANDLER( decocass_sound_command_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(2,("CPU %s sound command -> $%02x\n", space->cpu->tag(), data));
soundlatch_w(space, 0, data);
state->sound_ack |= 0x80;
@@ -76,7 +76,7 @@ READ8_HANDLER( decocass_sound_data_r )
READ8_HANDLER( decocass_sound_ack_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data = state->sound_ack; /* D6+D7 */
LOG(4,("CPU %s sound ack <- $%02x\n", space->cpu->tag(), data));
return data;
@@ -84,7 +84,7 @@ READ8_HANDLER( decocass_sound_ack_r )
WRITE8_HANDLER( decocass_sound_data_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(2,("CPU %s sound data -> $%02x\n", space->cpu->tag(), data));
soundlatch2_w(space, 0, data);
state->sound_ack |= 0x40;
@@ -92,7 +92,7 @@ WRITE8_HANDLER( decocass_sound_data_w )
READ8_HANDLER( decocass_sound_command_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data = soundlatch_r(space, 0);
LOG(4,("CPU %s sound command <- $%02x\n", space->cpu->tag(), data));
device_set_input_line(state->audiocpu, M6502_IRQ_LINE, CLEAR_LINE);
@@ -102,7 +102,7 @@ READ8_HANDLER( decocass_sound_command_r )
TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
{
- decocass_state *state = timer.machine->driver_data<decocass_state>();
+ decocass_state *state = timer.machine().driver_data<decocass_state>();
int scanline = param;
state->audio_nmi_state = scanline & 8;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
@@ -110,14 +110,14 @@ TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
WRITE8_HANDLER( decocass_sound_nmi_enable_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->audio_nmi_enabled = 1;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
}
READ8_HANDLER( decocass_sound_nmi_enable_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->audio_nmi_enabled = 1;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
return 0xff;
@@ -125,7 +125,7 @@ READ8_HANDLER( decocass_sound_nmi_enable_r )
READ8_HANDLER( decocass_sound_data_ack_reset_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data = 0xff;
LOG(2,("CPU %s sound ack rst <- $%02x\n", space->cpu->tag(), data));
state->sound_ack &= ~0x40;
@@ -134,26 +134,26 @@ READ8_HANDLER( decocass_sound_data_ack_reset_r )
WRITE8_HANDLER( decocass_sound_data_ack_reset_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(2,("CPU %s sound ack rst -> $%02x\n", space->cpu->tag(), data));
state->sound_ack &= ~0x40;
}
WRITE8_HANDLER( decocass_nmi_reset_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE );
}
WRITE8_HANDLER( decocass_quadrature_decoder_reset_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
/* just latch the analog controls here */
- state->quadrature_decoder[0] = input_port_read(space->machine, "AN0");
- state->quadrature_decoder[1] = input_port_read(space->machine, "AN1");
- state->quadrature_decoder[2] = input_port_read(space->machine, "AN2");
- state->quadrature_decoder[3] = input_port_read(space->machine, "AN3");
+ state->quadrature_decoder[0] = input_port_read(space->machine(), "AN0");
+ state->quadrature_decoder[1] = input_port_read(space->machine(), "AN1");
+ state->quadrature_decoder[2] = input_port_read(space->machine(), "AN2");
+ state->quadrature_decoder[3] = input_port_read(space->machine(), "AN3");
}
WRITE8_HANDLER( decocass_adc_w )
@@ -172,14 +172,14 @@ WRITE8_HANDLER( decocass_adc_w )
*/
READ8_HANDLER( decocass_input_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data = 0xff;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
switch (offset & 7)
{
case 0: case 1: case 2:
- data = input_port_read(space->machine, portnames[offset & 7]);
+ data = input_port_read(space->machine(), portnames[offset & 7]);
break;
case 3: case 4: case 5: case 6:
data = state->quadrature_decoder[(offset & 7) - 3];
@@ -207,8 +207,8 @@ READ8_HANDLER( decocass_input_r )
WRITE8_HANDLER( decocass_reset_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
- LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ decocass_state *state = space->machine().driver_data<decocass_state>();
+ LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->decocass_reset = data;
/* CPU #1 active high reset */
@@ -227,9 +227,9 @@ WRITE8_HANDLER( decocass_reset_w )
#ifdef MAME_DEBUG
-static void decocass_fno( running_machine *machine, offs_t offset, UINT8 data )
+static void decocass_fno( running_machine &machine, offs_t offset, UINT8 data )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
/* 8041ENA/ and is this a FNO write (function number)? */
if (0 == (state->i8041_p2 & 0x01))
{
@@ -276,7 +276,7 @@ static void decocass_fno( running_machine *machine, offs_t offset, UINT8 data )
static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -288,7 +288,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -296,7 +296,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
if (state->firsttime)
{
@@ -336,7 +336,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -356,7 +356,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r )
static READ8_HANDLER( decocass_type1_pass_136_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -368,7 +368,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -376,7 +376,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
if (state->firsttime)
{
@@ -416,7 +416,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -436,7 +436,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r )
static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -448,7 +448,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -456,7 +456,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
if (state->firsttime)
{
@@ -496,7 +496,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
(((state->latch1 >> MAP7(state->type1_inmap)) & 1) << MAP7(state->type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -516,7 +516,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r )
static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -528,7 +528,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -536,7 +536,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
if (state->firsttime)
{
@@ -576,7 +576,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -598,7 +598,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r )
static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -610,7 +610,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c;
LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data,
(data & 1) ? "OBF" : "-",
(data & 2) ? "IBF" : "-"));
}
@@ -618,7 +618,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
{
offs_t promaddr;
UINT8 save;
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
if (state->firsttime)
{
@@ -658,7 +658,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
(((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap));
LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n",
- space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
state->latch1 = save; /* latch the data for the next A0 == 0 read */
}
@@ -679,16 +679,16 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r )
***************************************************************************/
static READ8_HANDLER( decocass_type2_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == state->type2_xx_latch)
{
if (1 == (offset & 1))
{
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
data = prom[256 * state->type2_d2_latch + state->type2_promaddr];
- LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, 256 * state->type2_d2_latch + state->type2_promaddr));
+ LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, 256 * state->type2_d2_latch + state->type2_promaddr));
}
else
{
@@ -702,30 +702,30 @@ static READ8_HANDLER( decocass_type2_r )
else
data = offset & 0xff;
- LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "STATUS" : "DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "STATUS" : "DATA"));
}
return data;
}
static WRITE8_HANDLER( decocass_type2_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (1 == state->type2_xx_latch)
{
if (1 == (offset & 1))
{
- LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
state->type2_promaddr = data;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type2_promaddr));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type2_promaddr));
return;
}
}
else
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
}
if (1 == (offset & 1))
{
@@ -739,7 +739,7 @@ static WRITE8_HANDLER( decocass_type2_w )
upi41_master_w(state->mcu, offset & 1, data);
#ifdef MAME_DEBUG
- decocass_fno(space->machine, offset, data);
+ decocass_fno(space->machine(), offset, data);
#endif
}
@@ -761,16 +761,16 @@ static WRITE8_HANDLER( decocass_type2_w )
***************************************************************************/
static READ8_HANDLER( decocass_type3_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data, save;
if (1 == (offset & 1))
{
if (1 == state->type3_pal_19)
{
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
data = prom[state->type3_ctrs];
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type3_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type3_ctrs));
if (++state->type3_ctrs == 4096)
state->type3_ctrs = 0;
}
@@ -779,12 +779,12 @@ static READ8_HANDLER( decocass_type3_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
}
@@ -793,7 +793,7 @@ static READ8_HANDLER( decocass_type3_r )
if (1 == state->type3_pal_19)
{
save = data = 0xff; /* open data bus? */
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
@@ -924,7 +924,7 @@ static READ8_HANDLER( decocass_type3_r )
(BIT(save, 7) << 7);
}
state->type3_d0_latch = save & 1;
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
}
else
{
@@ -938,7 +938,7 @@ static READ8_HANDLER( decocass_type3_r )
(BIT(save, 5) << 5) |
(BIT(save, 6) << 7) |
(BIT(save, 7) << 6);
- LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
state->type3_d0_latch = save & 1;
}
}
@@ -949,13 +949,13 @@ static READ8_HANDLER( decocass_type3_r )
static WRITE8_HANDLER( decocass_type3_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->type3_pal_19)
{
state->type3_ctrs = data << 4;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "LDCTRS"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "LDCTRS"));
return;
}
else
@@ -967,11 +967,11 @@ static WRITE8_HANDLER( decocass_type3_w )
if (1 == state->type3_pal_19)
{
/* write nowhere?? */
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->mcu, offset, data);
}
@@ -989,7 +989,7 @@ static WRITE8_HANDLER( decocass_type3_w )
static READ8_HANDLER( decocass_type4_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -997,22 +997,22 @@ static READ8_HANDLER( decocass_type4_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
else
{
if (state->type4_latch)
{
- UINT8 *prom = space->machine->region("dongle")->base();
+ UINT8 *prom = space->machine().region("dongle")->base();
data = prom[state->type4_ctrs];
- LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.', state->type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.', state->type4_ctrs));
state->type4_ctrs = (state->type4_ctrs + 1) & 0x7fff;
}
else
@@ -1020,12 +1020,12 @@ static READ8_HANDLER( decocass_type4_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
}
@@ -1035,13 +1035,13 @@ static READ8_HANDLER( decocass_type4_r )
static WRITE8_HANDLER( decocass_type4_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->type4_latch)
{
state->type4_ctrs = (state->type4_ctrs & 0x00ff) | ((data & 0x7f) << 8);
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type4_ctrs));
return;
}
else
@@ -1055,11 +1055,11 @@ static WRITE8_HANDLER( decocass_type4_w )
if (state->type4_latch)
{
state->type4_ctrs = (state->type4_ctrs & 0xff00) | data;
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type4_ctrs));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, state->type4_ctrs));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->mcu, offset, data);
}
@@ -1074,7 +1074,7 @@ static WRITE8_HANDLER( decocass_type4_w )
static READ8_HANDLER( decocass_type5_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -1082,12 +1082,12 @@ static READ8_HANDLER( decocass_type5_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
else
@@ -1095,19 +1095,19 @@ static READ8_HANDLER( decocass_type5_r )
if (state->type5_latch)
{
data = 0x55; /* Only a fixed value? It looks like this is all we need to do */
- LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
}
else
{
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
}
@@ -1117,12 +1117,12 @@ static READ8_HANDLER( decocass_type5_r )
static WRITE8_HANDLER( decocass_type5_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (1 == (offset & 1))
{
if (1 == state->type5_latch)
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "latch #2??"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "latch #2??"));
return;
}
else
@@ -1134,11 +1134,11 @@ static WRITE8_HANDLER( decocass_type5_w )
if (state->type5_latch)
{
/* write nowhere?? */
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
return;
}
}
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->mcu, offset, data);
}
@@ -1152,7 +1152,7 @@ static WRITE8_HANDLER( decocass_type5_w )
static READ8_HANDLER( decocass_nodong_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
if (1 == (offset & 1))
@@ -1160,12 +1160,12 @@ static READ8_HANDLER( decocass_nodong_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 1);
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
else
@@ -1173,12 +1173,12 @@ static READ8_HANDLER( decocass_nodong_r )
if (0 == (offset & E5XX_MASK))
{
data = upi41_master_r(state->mcu, 0);
- LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
+ LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
}
else
{
data = 0xff; /* open data bus? */
- LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
@@ -1193,7 +1193,7 @@ static READ8_HANDLER( decocass_nodong_r )
READ8_HANDLER( decocass_e5xx_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
/* E5x2-E5x3 and mirrors */
@@ -1212,7 +1212,7 @@ READ8_HANDLER( decocass_e5xx_r )
(!tape_is_present(state->cassette) << 7); /* D7 = cassette present */
LOG(4,("%10s 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n",
- space->machine->time().as_string(6),
+ space->machine().time().as_string(6),
cpu_get_previouspc(space->cpu),
offset, data,
data & 0x01 ? "" : "REQ/",
@@ -1236,7 +1236,7 @@ READ8_HANDLER( decocass_e5xx_r )
WRITE8_HANDLER( decocass_e5xx_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (state->dongle_w)
{
(*state->dongle_w)(space, offset, data);
@@ -1245,15 +1245,15 @@ WRITE8_HANDLER( decocass_e5xx_w )
if (0 == (offset & E5XX_MASK))
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
upi41_master_w(state->mcu, offset & 1, data);
#ifdef MAME_DEBUG
- decocass_fno(space->machine, offset, data);
+ decocass_fno(space->machine(), offset, data);
#endif
}
else
{
- LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", space->machine->time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
+ LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", space->machine().time().as_string(6), cpu_get_previouspc(space->cpu), offset, data));
}
}
@@ -1271,9 +1271,9 @@ WRITE8_HANDLER( decocass_e5xx_w )
WRITE8_HANDLER( decocass_e900_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->de0091_enable = data & 1;
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
/* Perhaps the second row of ROMs is enabled by another bit.
* There is no way to verify this yet, so for now just look
* at bit 0 to enable the daughter board at reads between
@@ -1283,7 +1283,7 @@ WRITE8_HANDLER( decocass_e900_w )
WRITE8_HANDLER( decocass_de0091_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
/* don't allow writes to the ROMs */
if (!state->de0091_enable)
decocass_charram_w(space, offset, data);
@@ -1295,9 +1295,9 @@ WRITE8_HANDLER( decocass_de0091_w )
*
***************************************************************************/
/* To be called once from driver_init, i.e. decocass_init */
-void decocass_machine_state_save_init( running_machine *machine )
+void decocass_machine_state_save_init( running_machine &machine )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
state->save_item(NAME(state->firsttime));
state->save_item(NAME(state->decocass_reset));
state->save_item(NAME(state->i8041_p1));
@@ -1335,17 +1335,17 @@ void decocass_machine_state_save_init( running_machine *machine )
MACHINE_START( decocass )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
- state->cassette = machine->device("cassette");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
+ state->cassette = machine.device("cassette");
}
-static void decocass_reset_common( running_machine *machine )
+static void decocass_reset_common( running_machine &machine )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
state->firsttime = 1;
state->latch1 = 0;
@@ -1404,7 +1404,7 @@ MACHINE_RESET( decocass )
MACHINE_RESET( ctsttape )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061)\n"));
state->dongle_r = decocass_type1_pass_136_r;
@@ -1412,7 +1412,7 @@ MACHINE_RESET( ctsttape )
MACHINE_RESET( chwy )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
state->dongle_r = decocass_type1_latch_27_pass_3_inv_2_r;
@@ -1420,7 +1420,7 @@ MACHINE_RESET( chwy )
MACHINE_RESET( clocknch )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 flip 2-3)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1430,7 +1430,7 @@ MACHINE_RESET( clocknch )
MACHINE_RESET( ctisland )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 flip 0-2)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1440,7 +1440,7 @@ MACHINE_RESET( ctisland )
MACHINE_RESET( csuperas )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 flip 4-5)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1450,7 +1450,7 @@ MACHINE_RESET( csuperas )
MACHINE_RESET( castfant )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061)\n"));
state->dongle_r = decocass_type1_latch_16_pass_3_inv_1_r;
@@ -1458,7 +1458,7 @@ MACHINE_RESET( castfant )
MACHINE_RESET( cluckypo )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 flip 1-3)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1468,7 +1468,7 @@ MACHINE_RESET( cluckypo )
MACHINE_RESET( cterrani )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 straight)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1478,7 +1478,7 @@ MACHINE_RESET( cterrani )
MACHINE_RESET( cexplore )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
state->dongle_r = decocass_type1_latch_26_pass_5_inv_2_r;
@@ -1486,7 +1486,7 @@ MACHINE_RESET( cexplore )
MACHINE_RESET( cprogolf )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #1 (DE-0061 flip 0-1)\n"));
state->dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
@@ -1496,7 +1496,7 @@ MACHINE_RESET( cprogolf )
MACHINE_RESET( cmissnx )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #2 (CS82-007)\n"));
state->dongle_r = decocass_type2_r;
@@ -1505,7 +1505,7 @@ MACHINE_RESET( cmissnx )
MACHINE_RESET( cdiscon1 )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #2 (CS82-007)\n"));
state->dongle_r = decocass_type2_r;
@@ -1514,7 +1514,7 @@ MACHINE_RESET( cdiscon1 )
MACHINE_RESET( cptennis )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #2 (CS82-007)\n"));
state->dongle_r = decocass_type2_r;
@@ -1523,7 +1523,7 @@ MACHINE_RESET( cptennis )
MACHINE_RESET( ctornado )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #2 (CS82-007)\n"));
state->dongle_r = decocass_type2_r;
@@ -1532,7 +1532,7 @@ MACHINE_RESET( ctornado )
MACHINE_RESET( cbnj )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1542,7 +1542,7 @@ MACHINE_RESET( cbnj )
MACHINE_RESET( cburnrub )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1552,7 +1552,7 @@ MACHINE_RESET( cburnrub )
MACHINE_RESET( cbtime )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1562,7 +1562,7 @@ MACHINE_RESET( cbtime )
MACHINE_RESET( cgraplop )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1572,7 +1572,7 @@ MACHINE_RESET( cgraplop )
MACHINE_RESET( cgraplop2 )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1582,7 +1582,7 @@ MACHINE_RESET( cgraplop2 )
MACHINE_RESET( clapapa )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1592,7 +1592,7 @@ MACHINE_RESET( clapapa )
MACHINE_RESET( cfghtice )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1602,7 +1602,7 @@ MACHINE_RESET( cfghtice )
MACHINE_RESET( cprobowl )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1612,7 +1612,7 @@ MACHINE_RESET( cprobowl )
MACHINE_RESET( cnightst )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1622,7 +1622,7 @@ MACHINE_RESET( cnightst )
MACHINE_RESET( cprosocc )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1632,7 +1632,7 @@ MACHINE_RESET( cprosocc )
MACHINE_RESET( cppicf )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1642,7 +1642,7 @@ MACHINE_RESET( cppicf )
MACHINE_RESET( cscrtry )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #4 (32K ROM)\n"));
state->dongle_r = decocass_type4_r;
@@ -1651,7 +1651,7 @@ MACHINE_RESET( cscrtry )
MACHINE_RESET( cbdash )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("dongle type #5 (NOP)\n"));
state->dongle_r = decocass_type5_r;
@@ -1660,7 +1660,7 @@ MACHINE_RESET( cbdash )
MACHINE_RESET( cflyball )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
decocass_reset_common(machine);
LOG(0,("no dongle\n"));
state->dongle_r = decocass_nodong_r;
@@ -1668,8 +1668,8 @@ MACHINE_RESET( cflyball )
MACHINE_RESET( czeroize )
{
- decocass_state *state = machine->driver_data<decocass_state>();
- UINT8 *mem = machine->region("dongle")->base();
+ decocass_state *state = machine.driver_data<decocass_state>();
+ UINT8 *mem = machine.region("dongle")->base();
decocass_reset_common(machine);
LOG(0,("dongle type #3 (PAL)\n"));
state->dongle_r = decocass_type3_r;
@@ -1698,11 +1698,11 @@ MACHINE_RESET( czeroize )
WRITE8_HANDLER( i8041_p1_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data != state->i8041_p1_write_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine->time().as_string(6),
+ space->machine().time().as_string(6),
cpu_get_previouspc(space->cpu),
data,
data & 0x01 ? "" : "DATA-WRT",
@@ -1733,13 +1733,13 @@ WRITE8_HANDLER( i8041_p1_w )
READ8_HANDLER( i8041_p1_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data = state->i8041_p1;
if (data != state->i8041_p1_read_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine->time().as_string(6),
+ space->machine().time().as_string(6),
cpu_get_previouspc(space->cpu),
data,
data & 0x01 ? "" : "DATA-WRT",
@@ -1757,11 +1757,11 @@ READ8_HANDLER( i8041_p1_r )
WRITE8_HANDLER( i8041_p2_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data != state->i8041_p2_write_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine->time().as_string(6),
+ space->machine().time().as_string(6),
cpu_get_previouspc(space->cpu),
data,
data & 0x01 ? "" : "FNO/",
@@ -1779,7 +1779,7 @@ WRITE8_HANDLER( i8041_p2_w )
READ8_HANDLER( i8041_p2_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
UINT8 data;
data = (state->i8041_p2 & ~0xe0) | tape_get_status_bits(state->cassette);
@@ -1787,7 +1787,7 @@ READ8_HANDLER( i8041_p2_r )
if (data != state->i8041_p2_read_latch)
{
LOG(4,("%10s 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n",
- space->machine->time().as_string(6),
+ space->machine().time().as_string(6),
cpu_get_previouspc(space->cpu),
data,
data & 0x01 ? "" : "FNO/",
@@ -2174,10 +2174,9 @@ static DEVICE_START( decocass_tape )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() == NULL);
- assert(device->machine != NULL);
/* fetch the data pointer */
- tape->timer = device->machine->scheduler().timer_alloc(FUNC(tape_clock_callback), (void *)device);
+ tape->timer = device->machine().scheduler().timer_alloc(FUNC(tape_clock_callback), (void *)device);
if (device->region() == NULL)
return;
UINT8 *regionbase = *device->region();
diff --git a/src/mame/machine/decocass.h b/src/mame/machine/decocass.h
index a79bb3472c0..f7d0a03f223 100644
--- a/src/mame/machine/decocass.h
+++ b/src/mame/machine/decocass.h
@@ -170,7 +170,7 @@ READ8_HANDLER( i8041_p1_r );
WRITE8_HANDLER( i8041_p2_w );
READ8_HANDLER( i8041_p2_r );
-void decocass_machine_state_save_init(running_machine *machine);
+void decocass_machine_state_save_init(running_machine &machine);
/*----------- defined in video/decocass.c -----------*/
@@ -199,4 +199,4 @@ WRITE8_HANDLER( decocass_center_v_shift_w );
VIDEO_START( decocass );
SCREEN_UPDATE( decocass );
-void decocass_video_state_save_init(running_machine *machine);
+void decocass_video_state_save_init(running_machine &machine);
diff --git a/src/mame/machine/decocrpt.c b/src/mame/machine/decocrpt.c
index edbf238a6b4..6315a8ee136 100644
--- a/src/mame/machine/decocrpt.c
+++ b/src/mame/machine/decocrpt.c
@@ -598,10 +598,10 @@ static const UINT8 deco74_swap_table[0x800] =
4,7,2,2,1,3,4,4,1,7,0,2,5,4,7,3,7,6,1,5,6,0,7,4,1,1,5,2,2,6,7,2,
};
-static void deco_decrypt(running_machine *machine,const char *rgntag,const UINT8 *xor_table,const UINT16 *address_table,const UINT8 *swap_table,int remap_only)
+static void deco_decrypt(running_machine &machine,const char *rgntag,const UINT8 *xor_table,const UINT16 *address_table,const UINT8 *swap_table,int remap_only)
{
- UINT16 *rom = (UINT16 *)machine->region(rgntag)->base();
- int len = machine->region(rgntag)->bytes()/2;
+ UINT16 *rom = (UINT16 *)machine.region(rgntag)->base();
+ int len = machine.region(rgntag)->bytes()/2;
UINT16 *buffer = auto_alloc_array(machine, UINT16, len);
int i;
@@ -647,17 +647,17 @@ static void deco_decrypt(running_machine *machine,const char *rgntag,const UINT8
rom[i] = BIG_ENDIANIZE_INT16(rom[i]);
}
-void deco56_decrypt_gfx(running_machine *machine, const char *tag)
+void deco56_decrypt_gfx(running_machine &machine, const char *tag)
{
deco_decrypt(machine,tag,deco56_xor_table,deco56_address_table,deco56_swap_table, 0);
}
-void deco74_decrypt_gfx(running_machine *machine, const char *tag)
+void deco74_decrypt_gfx(running_machine &machine, const char *tag)
{
deco_decrypt(machine,tag,deco74_xor_table,deco74_address_table,deco74_swap_table, 0);
}
-void deco56_remap_gfx(running_machine *machine, const char *tag)
+void deco56_remap_gfx(running_machine &machine, const char *tag)
{
// Apply address remap, but not XOR/shift
deco_decrypt(machine,tag,deco56_xor_table,deco56_address_table,deco56_swap_table, 1);
diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c
index 719750b8566..dacb2344bc3 100644
--- a/src/mame/machine/decoprot.c
+++ b/src/mame/machine/decoprot.c
@@ -88,7 +88,7 @@ UINT32 *deco32_prot_ram;
/***************************************************************************/
-void decoprot_reset(running_machine *machine)
+void decoprot_reset(running_machine &machine)
{
deco16_xor=0;
deco16_mask=0xffff;
@@ -111,7 +111,7 @@ WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */
if (offset == (0x150 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
@@ -129,16 +129,16 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */
{
switch (offset<<1) {
case 0x110: /* Player input */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x36c: /* Coins */
case 0x334: /* Probably also, c6, 2c0, 2e0, 4b2, 46a, 4da, rohga is 44c */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x0dc:
- return input_port_read(space->machine, "IN1")<<4;
+ return input_port_read(space->machine(), "IN1")<<4;
case 0x494: /* Dips */
- return input_port_read(space->machine, "DSW1_2");
+ return input_port_read(space->machine(), "DSW1_2");
case 0x244:
return deco16_prot_ram[0];
@@ -230,7 +230,7 @@ WRITE16_HANDLER( deco16_60_prot_w ) /* Edward Randy */
if (offset == (0x64 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
COMBINE_DATA(&deco16_prot_ram[offset]);
@@ -362,9 +362,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
/* Player 1 & 2 controls, read in IRQ then written *back* to protection device */
case 0x50: /* written to 9e byte */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x6f8: /* written to 76 byte */
- return (input_port_read(space->machine, "IN0")>>8)|(input_port_read(space->machine, "IN0")<<8); /* byte swap IN0 */
+ return (input_port_read(space->machine(), "IN0")>>8)|(input_port_read(space->machine(), "IN0")<<8); /* byte swap IN0 */
case 0x5c: /* After coin insert, high 0x8000 bit set starts game */
return deco16_prot_ram[0x3b];
@@ -374,9 +374,9 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return ((deco16_prot_ram[0x9e/2]&0xff00)>>8) | ((deco16_prot_ram[0x9e/2]&0x00ff)<<8);
case 0xac: /* Dip switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0xc2:
- return input_port_read(space->machine, "DSW") ^ deco16_prot_ram[0x2c/2];
+ return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
case 0x5d4: /* The state of the dips last frame */
return deco16_prot_ram[0x34/2];
@@ -388,7 +388,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0]&0xfff0)>>0) | ((deco16_prot_ram[0]&0x000c)>>2) | ((deco16_prot_ram[0]&0x0003)<<2)) & (~deco16_prot_ram[0x36/2]);
case 0x76a: /* Coins */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x284: /* Bit shifting with inverted mask register */
return (((deco16_prot_ram[0x40/2]&0xfff0)>>0) | ((deco16_prot_ram[0x40/2]&0x0007)<<1) | ((deco16_prot_ram[0x40/2]&0x0008)>>3)) & (~deco16_prot_ram[0x36/2]);
@@ -402,7 +402,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */
return (((deco16_prot_ram[0x6a/2]&0x00f0)<<4) | ((deco16_prot_ram[0x6a/2]&0x0f00)<<4) | ((deco16_prot_ram[0x6a/2]&0x0007)<<5) | ((deco16_prot_ram[0x6a/2]&0x0008)<<1)) & (~deco16_prot_ram[0x36/2]);
case 0x7d6: /* XOR IN0 */
- return input_port_read(space->machine, "IN0") ^ deco16_prot_ram[0x2c/2];
+ return input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
case 0x4b4:
return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11);
}
@@ -420,7 +420,7 @@ WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */
if (offset == (0x64 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
@@ -464,15 +464,15 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */
switch (offset*2) {
case 0xac: /* Dip switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0xc2: /* Dip switches */
- return input_port_read(space->machine, "DSW") ^ deco16_prot_ram[0x2c/2];
+ return input_port_read(space->machine(), "DSW") ^ deco16_prot_ram[0x2c/2];
case 0x46: /* Coins */
- return input_port_read(space->machine, "IN1") ^ deco16_prot_ram[0x2c/2];
+ return input_port_read(space->machine(), "IN1") ^ deco16_prot_ram[0x2c/2];
case 0x50: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x63c: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0") ^ deco16_prot_ram[0x2c/2];
+ return input_port_read(space->machine(), "IN0") ^ deco16_prot_ram[0x2c/2];
case 0x5f4:
return deco16_prot_ram[0x18/2];
@@ -607,7 +607,7 @@ WRITE16_HANDLER( deco16_104_cninja_prot_w )
if (offset == (0xa8 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
@@ -648,13 +648,13 @@ READ16_HANDLER( deco16_104_cninja_prot_r )
return deco16_prot_ram[15];
case 0x36: /* Dip switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x1c8: /* Coins */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x22c: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(space->cpu),offset);
@@ -670,7 +670,7 @@ WRITE16_HANDLER( deco16_146_funkyjet_prot_w )
if (offset == (0x10a >> 1))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
}
@@ -745,15 +745,15 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r )
return ((deco16_prot_ram[0x78e>>1]>>4)&0xff00) | (deco16_prot_ram[0x78e>>1]&0x000f) | ((deco16_prot_ram[0x78e>>1]<<8)&0xf000);
case 0x00c >> 1: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 0x778 >> 1: /* Credits */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x382 >> 1: /* DIPS */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
if (cpu_get_pc(space->cpu)!=0xc0ea)
- logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(space->cpu), offset<<1, input_port_read(space->machine, "INPUTS"));
+ logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(space->cpu), offset<<1, input_port_read(space->machine(), "INPUTS"));
return 0;
}
@@ -790,7 +790,7 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w )
if (offset == (0xa8 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
@@ -863,13 +863,13 @@ READ16_HANDLER( deco16_104_rohga_prot_r )
switch (offset) {
case 0x88/2: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x36c/2:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x44c/2:
- return ((input_port_read(space->machine, "IN1") & 0x7)<<13)|((input_port_read(space->machine, "IN1") & 0x8)<<9);
+ return ((input_port_read(space->machine(), "IN1") & 0x7)<<13)|((input_port_read(space->machine(), "IN1") & 0x8)<<9);
case 0x292/2: /* Dips */
- return input_port_read(space->machine, "DSW1_2");
+ return input_port_read(space->machine(), "DSW1_2");
case 0x44/2:
return ((((DECO_PORT(0x2c)&0x000f)<<12)) ^ deco16_xor) & (~deco16_mask);
@@ -1220,7 +1220,7 @@ static WRITE16_HANDLER( deco16_146_core_prot_w )
if (writeport == sndport)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
@@ -1247,11 +1247,11 @@ static READ16_HANDLER( deco16_146_core_prot_r )
switch (offset)
{
case 0x582: /* Player 1 & Player 2 */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x04c: /* Coins/VBL */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x672: /* Dip switches */
- return input_port_read(space->machine, "DSW1_2");
+ return input_port_read(space->machine(), "DSW1_2");
case 0x13a:
return ((DECO_PORT(0x190)&0x00f0)<<8) | ((DECO_PORT(0x190)&0x0003)<<10) | ((DECO_PORT(0x190)&0x000c)<<6);
@@ -1309,9 +1309,9 @@ static READ16_HANDLER( deco16_146_core_prot_r )
/*********************************************************************************/
-// case 0x582: return input_port_read(space->machine, "IN0"); /* IN0 */
-// case 0x672: return input_port_read(space->machine, "IN1"); /* IN1 */
-// case 0x04c: return eeprom_read_bit(space->machine->device("eeprom"));
+// case 0x582: return input_port_read(space->machine(), "IN0"); /* IN0 */
+// case 0x672: return input_port_read(space->machine(), "IN1"); /* IN1 */
+// case 0x04c: return eeprom_read_bit(space->machine().device("eeprom"));
case 0x468:
val=DECO_PORT(0x570);
@@ -1658,9 +1658,9 @@ READ32_HANDLER( deco16_146_fghthist_prot_r )
/* Special case inputs, because this is the only game with an eprom */
switch (addr)
{
- case 0x582: return (input_port_read(space->machine, "IN0")<<16) | 0xffff; /* IN0 */
- case 0x672: return (input_port_read(space->machine, "IN1")<<16) | 0xffff; /* IN1 */
- case 0x04c: return (eeprom_read_bit(space->machine->device("eeprom"))<<16) | 0xffff;
+ case 0x582: return (input_port_read(space->machine(), "IN0")<<16) | 0xffff; /* IN0 */
+ case 0x672: return (input_port_read(space->machine(), "IN1")<<16) | 0xffff; /* IN1 */
+ case 0x04c: return (eeprom_read_bit(space->machine().device("eeprom"))<<16) | 0xffff;
}
/* Handle 'one shots' - writing data to an address, then immediately reading it back */
@@ -1734,9 +1734,9 @@ READ16_HANDLER( dietgo_104_prot_r )
{
switch (offset * 2)
{
- case 0x298: return input_port_read(space->machine, "IN0");
- case 0x342: return input_port_read(space->machine, "IN1");
- case 0x506: return input_port_read(space->machine, "DSW");
+ case 0x298: return input_port_read(space->machine(), "IN0");
+ case 0x342: return input_port_read(space->machine(), "IN1");
+ case 0x506: return input_port_read(space->machine(), "DSW");
}
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(space->cpu), offset<<1);
@@ -1749,7 +1749,7 @@ WRITE16_HANDLER( dietgo_104_prot_w )
if (offset == (0x380 / 2))
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
}
logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n", cpu_get_pc(space->cpu), offset << 1, data);
@@ -1762,9 +1762,9 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r )
const UINT16* prot_ram=deco16_prot_ram;
switch (offset * 2)
{
- case 0x5b2: return input_port_read(space->machine, "SYSTEM");
- case 0x44c: return input_port_read(space->machine, "DSW");
- case 0x042: return input_port_read(space->machine, "INPUTS");
+ case 0x5b2: return input_port_read(space->machine(), "SYSTEM");
+ case 0x44c: return input_port_read(space->machine(), "DSW");
+ case 0x042: return input_port_read(space->machine(), "INPUTS");
case 0x510: return DECO_PORT(0);
case 0x51a: return DECO_PORT(2);
diff --git a/src/mame/machine/docastle.c b/src/mame/machine/docastle.c
index e5cdde9c6cd..a2bcb987a39 100644
--- a/src/mame/machine/docastle.c
+++ b/src/mame/machine/docastle.c
@@ -29,7 +29,7 @@ if it was a small shared buffer. The order of operations is:
*/
READ8_HANDLER( docastle_shared0_r )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
if (offset == 8) logerror("CPU #0 shared0r clock = %d\n", (UINT32)state->maincpu->total_cycles());
return state->buffer0[offset];
}
@@ -37,7 +37,7 @@ READ8_HANDLER( docastle_shared0_r )
READ8_HANDLER( docastle_shared1_r )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
if (offset == 8) logerror("CPU #1 shared1r clock = %d\n", (UINT32)state->slave->total_cycles());
return state->buffer1[offset];
}
@@ -45,7 +45,7 @@ READ8_HANDLER( docastle_shared1_r )
WRITE8_HANDLER( docastle_shared0_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
if (offset == 8) logerror("CPU #1 shared0w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n",
state->buffer0[0], state->buffer0[1], state->buffer0[2], state->buffer0[3],
state->buffer0[4], state->buffer0[5], state->buffer0[6], state->buffer0[7],
@@ -55,13 +55,13 @@ WRITE8_HANDLER( docastle_shared0_w )
if (offset == 8)
/* awake the master CPU */
- space->machine->scheduler().trigger(500);
+ space->machine().scheduler().trigger(500);
}
WRITE8_HANDLER( docastle_shared1_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
state->buffer1[offset] = data;
if (offset == 8)
@@ -80,6 +80,6 @@ WRITE8_HANDLER( docastle_shared1_w )
WRITE8_HANDLER( docastle_nmitrigger_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/machine/fd1089.c b/src/mame/machine/fd1089.c
index 55b5c75542a..17f32117f59 100644
--- a/src/mame/machine/fd1089.c
+++ b/src/mame/machine/fd1089.c
@@ -402,15 +402,15 @@ static void clear_decrypted(running_machine &machine)
decrypted = NULL;
}
-static void sys16_decrypt(running_machine *machine, const UINT8 *key,int cputype)
+static void sys16_decrypt(running_machine &machine, const UINT8 *key,int cputype)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int A;
decrypted = auto_alloc_array(machine, UINT16, size/2);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, clear_decrypted);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, clear_decrypted);
space->set_decrypted_region(0x000000, size - 1, decrypted);
for (A = 0;A < size;A+=2)
@@ -430,13 +430,13 @@ void *fd1089_get_decrypted_base(void)
return decrypted;
}
-void fd1089a_decrypt(running_machine *machine)
+void fd1089a_decrypt(running_machine &machine)
{
- sys16_decrypt(machine, machine->region("fd1089a")->base(), FD1089A);
+ sys16_decrypt(machine, machine.region("fd1089a")->base(), FD1089A);
}
-void fd1089b_decrypt(running_machine *machine)
+void fd1089b_decrypt(running_machine &machine)
{
- sys16_decrypt(machine, machine->region("fd1089b")->base(), FD1089B);
+ sys16_decrypt(machine, machine.region("fd1089b")->base(), FD1089B);
}
diff --git a/src/mame/machine/fd1089.h b/src/mame/machine/fd1089.h
index 22690b92084..263e2388ae4 100644
--- a/src/mame/machine/fd1089.h
+++ b/src/mame/machine/fd1089.h
@@ -1,4 +1,4 @@
void *fd1089_get_decrypted_base(void);
-void fd1089a_decrypt(running_machine *machine);
-void fd1089b_decrypt(running_machine *machine);
+void fd1089a_decrypt(running_machine &machine);
+void fd1089b_decrypt(running_machine &machine);
diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c
index 88a0ff739c7..4f0b11a8479 100644
--- a/src/mame/machine/fddebug.c
+++ b/src/mame/machine/fddebug.c
@@ -246,7 +246,7 @@ static UINT16 * keystatus;
static UINT32 keystatus_words;
/* key changed callback */
-static void (*key_changed)(running_machine *);
+static void (*key_changed)(running_machine &);
@@ -254,39 +254,39 @@ static void (*key_changed)(running_machine *);
FUNCTION PROTOTYPES
***************************************************************************/
-static void set_default_key_params(running_machine *machine);
-static void load_overlay_file(running_machine *machine);
-static void save_overlay_file(running_machine *machine);
+static void set_default_key_params(running_machine &machine);
+static void load_overlay_file(running_machine &machine);
+static void save_overlay_file(running_machine &machine);
static int instruction_hook(device_t &device, offs_t curpc);
-static void execute_fdsave(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdoutput(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdseed(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdlockguess(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdeliminate(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdunlock(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdignore(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdundo(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdstatus(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdstate(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdpc(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdsearch(running_machine *machine, int ref, int params, const char **param);
-static void execute_fddasm(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdcset(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdclist(running_machine *machine, int ref, int params, const char **param);
-static void execute_fdcsearch(running_machine *machine, int ref, int params, const char **param);
+static void execute_fdsave(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdoutput(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdseed(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdlockguess(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdeliminate(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdunlock(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdignore(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdundo(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdstatus(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdstate(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdpc(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdsearch(running_machine &machine, int ref, int params, const char **param);
+static void execute_fddasm(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdcset(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdclist(running_machine &machine, int ref, int params, const char **param);
+static void execute_fdcsearch(running_machine &machine, int ref, int params, const char **param);
static fd1094_possibility *try_all_possibilities(address_space *space, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata);
-static void tag_possibility(running_machine *machine, fd1094_possibility *possdata, UINT8 status);
+static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, UINT8 status);
-static void perform_constrained_search(running_machine *machine);
+static void perform_constrained_search(running_machine &machine);
static UINT32 find_global_key_matches(UINT32 startwith, UINT16 *output);
static int find_constraint_sequence(UINT32 global, int quick);
static int does_key_work_for_constraints(const UINT16 *base, UINT8 *key);
static UINT32 reconstruct_base_seed(int keybaseaddr, UINT32 startseed);
-static void build_optable(running_machine *machine);
+static void build_optable(running_machine &machine);
static int validate_ea(address_space *space, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags);
static int validate_opcode(address_space *space, UINT32 pc, const UINT8 *opdata, int maxwords);
@@ -414,7 +414,7 @@ INLINE void set_constraint(fd1094_constraint *constraint, UINT32 pc, UINT16 stat
for a given address
-----------------------------------------------*/
-INLINE void print_possibilities(running_machine *machine)
+INLINE void print_possibilities(running_machine &machine)
{
int i;
@@ -476,17 +476,17 @@ INLINE int addr_is_valid(address_space *space, UINT32 addr, UINT32 flags)
fd1094_init_debugging - set up debugging
-----------------------------------------------*/
-void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine *))
+void fd1094_init_debugging(running_machine &machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine &))
{
/* set the key changed callback */
key_changed = changed;
/* set up the regions */
- coderegion = (UINT16 *)machine->region(cpureg)->base();
- coderegion_words = machine->region(cpureg)->bytes() / 2;
- keyregion = (UINT8 *)machine->region(keyreg)->base();
- keystatus = (UINT16 *)machine->region(statreg)->base();
- keystatus_words = machine->region(statreg)->bytes() / 2;
+ coderegion = (UINT16 *)machine.region(cpureg)->base();
+ coderegion_words = machine.region(cpureg)->bytes() / 2;
+ keyregion = (UINT8 *)machine.region(keyreg)->base();
+ keystatus = (UINT16 *)machine.region(statreg)->base();
+ keystatus_words = machine.region(statreg)->bytes() / 2;
assert(coderegion_words == keystatus_words);
/* allocate memory for the ignore table */
@@ -535,7 +535,7 @@ void fd1094_init_debugging(running_machine *machine, const char *cpureg, const c
debug_console_register_command(machine, "fdcsearch", CMDFLAG_NONE, 0, 0, 0, execute_fdcsearch);
/* set up the instruction hook */
- machine->device("maincpu")->debug()->set_instruction_hook(instruction_hook);
+ machine.device("maincpu")->debug()->set_instruction_hook(instruction_hook);
/* regenerate the key */
if (keydirty)
@@ -548,7 +548,7 @@ void fd1094_init_debugging(running_machine *machine, const char *cpureg, const c
name, set some defaults
-----------------------------------------------*/
-static void set_default_key_params(running_machine *machine)
+static void set_default_key_params(running_machine &machine)
{
static const struct
{
@@ -564,7 +564,7 @@ static void set_default_key_params(running_machine *machine)
/* look for a matching game and set the key appropriately */
for (keynum = 0; keynum < ARRAY_LENGTH(default_keys); keynum++)
- if (strcmp(machine->system().name, default_keys[keynum].gamename) == 0)
+ if (strcmp(machine.system().name, default_keys[keynum].gamename) == 0)
{
fd1094_global = default_keys[keynum].global;
fd1094_seed = default_keys[keynum].seed;
@@ -579,13 +579,13 @@ static void set_default_key_params(running_machine *machine)
file
-----------------------------------------------*/
-static void load_overlay_file(running_machine *machine)
+static void load_overlay_file(running_machine &machine)
{
int pcaddr;
/* determine the filename and open the file */
emu_file file(OPEN_FLAG_READ);
- file_error filerr = file.open(machine->system().name, ".kov");
+ file_error filerr = file.open(machine.system().name, ".kov");
if (filerr == FILERR_NONE)
{
file.read(keystatus, keystatus_words * 2);
@@ -605,13 +605,13 @@ static void load_overlay_file(running_machine *machine)
file
-----------------------------------------------*/
-static void save_overlay_file(running_machine *machine)
+static void save_overlay_file(running_machine &machine)
{
int pcaddr;
/* determin the filename and open the file */
emu_file file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE);
- file_error filerr = file.open(machine->system().name, ".kov");
+ file_error filerr = file.open(machine.system().name, ".kov");
if (filerr == FILERR_NONE)
{
/* convert to big-endian */
@@ -634,7 +634,7 @@ static void save_overlay_file(running_machine *machine)
data
-----------------------------------------------*/
-void fd1094_regenerate_key(running_machine *machine)
+void fd1094_regenerate_key(running_machine &machine)
{
int reps = keystatus_words / KEY_SIZE;
int keyaddr, repnum;
@@ -668,8 +668,8 @@ void fd1094_regenerate_key(running_machine *machine)
(*key_changed)(machine);
/* force all memory and disassembly views to update */
- machine->debug_view().update_all(DVT_MEMORY);
- machine->debug_view().update_all(DVT_DISASSEMBLY);
+ machine.debug_view().update_all(DVT_MEMORY);
+ machine.debug_view().update_all(DVT_DISASSEMBLY);
/* reset keydirty */
keydirty = FALSE;
@@ -714,18 +714,18 @@ static int instruction_hook(device_t &device, offs_t curpc)
/* try all possible decodings at the current pc */
posscount = try_all_possibilities(device.memory().space(AS_PROGRAM), curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
if (keydirty)
- fd1094_regenerate_key(device.machine);
+ fd1094_regenerate_key(device.machine());
/* if we only ended up with one possibility, mark that one as good */
if (posscount == 1)
{
- tag_possibility(device.machine, &posslist[0], STATUS_LOCKED);
- fd1094_regenerate_key(device.machine);
+ tag_possibility(device.machine(), &posslist[0], STATUS_LOCKED);
+ fd1094_regenerate_key(device.machine());
return 0;
}
/* print possibilities and break */
- print_possibilities(device.machine);
+ print_possibilities(device.machine());
return 1;
}
@@ -734,7 +734,7 @@ static int instruction_hook(device_t &device, offs_t curpc)
execute_fdsave - handle the 'fdsave' command
-----------------------------------------------*/
-static void execute_fdsave(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdsave(running_machine &machine, int ref, int params, const char **param)
{
save_overlay_file(machine);
debug_console_printf(machine, "File saved\n");
@@ -746,7 +746,7 @@ static void execute_fdsave(running_machine *machine, int ref, int params, const
to a file
-----------------------------------------------*/
-static void execute_fdoutput(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdoutput(running_machine &machine, int ref, int params, const char **param)
{
/* make sure we're up-to-date */
if (keydirty)
@@ -766,7 +766,7 @@ static void execute_fdoutput(running_machine *machine, int ref, int params, cons
execute_fdseed - handle the 'fdseed' command
-----------------------------------------------*/
-static void execute_fdseed(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdseed(running_machine &machine, int ref, int params, const char **param)
{
UINT64 num1, num2;
@@ -793,7 +793,7 @@ static void execute_fdseed(running_machine *machine, int ref, int params, const
and 'fdguess' commands
-----------------------------------------------*/
-static void execute_fdlockguess(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdlockguess(running_machine &machine, int ref, int params, const char **param)
{
UINT64 num1;
@@ -822,7 +822,7 @@ static void execute_fdlockguess(running_machine *machine, int ref, int params, c
'fdeliminate' command
-----------------------------------------------*/
-static void execute_fdeliminate(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdeliminate(running_machine &machine, int ref, int params, const char **param)
{
int pnum, posssrc, possdst;
int plist[10];
@@ -873,7 +873,7 @@ static void execute_fdeliminate(running_machine *machine, int ref, int params, c
command
-----------------------------------------------*/
-static void execute_fdunlock(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdunlock(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = debug_cpu_get_visible_cpu(machine);
int reps = keystatus_words / KEY_SIZE;
@@ -911,7 +911,7 @@ static void execute_fdunlock(running_machine *machine, int ref, int params, cons
command
-----------------------------------------------*/
-static void execute_fdignore(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdignore(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = debug_cpu_get_visible_cpu(machine);
UINT64 offset;
@@ -945,7 +945,7 @@ static void execute_fdignore(running_machine *machine, int ref, int params, cons
command
-----------------------------------------------*/
-static void execute_fdundo(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdundo(running_machine &machine, int ref, int params, const char **param)
{
/* copy the undobuffer back and regenerate the key */
memcpy(keystatus, undobuff, keystatus_words * 2);
@@ -959,7 +959,7 @@ static void execute_fdundo(running_machine *machine, int ref, int params, const
command
-----------------------------------------------*/
-static void execute_fdstatus(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdstatus(running_machine &machine, int ref, int params, const char **param)
{
int numreps = keystatus_words / KEY_SIZE;
int locked = 4, nomatter = 0, guesses = 0;
@@ -991,7 +991,7 @@ static void execute_fdstatus(running_machine *machine, int ref, int params, cons
command
-----------------------------------------------*/
-static void execute_fdstate(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdstate(running_machine &machine, int ref, int params, const char **param)
{
UINT64 newstate;
@@ -1002,8 +1002,8 @@ static void execute_fdstate(running_machine *machine, int ref, int params, const
return;
fd1094_set_state(keyregion, newstate);
fd1094_regenerate_key(machine);
- machine->debug_view().update_all(DVT_MEMORY);
- machine->debug_view().update_all(DVT_DISASSEMBLY);
+ machine.debug_view().update_all(DVT_MEMORY);
+ machine.debug_view().update_all(DVT_DISASSEMBLY);
}
/* 0 parameters displays the current state */
@@ -1016,7 +1016,7 @@ static void execute_fdstate(running_machine *machine, int ref, int params, const
command
-----------------------------------------------*/
-static void execute_fdpc(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdpc(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = debug_cpu_get_visible_cpu(machine);
UINT64 newpc;
@@ -1038,7 +1038,7 @@ static void execute_fdpc(running_machine *machine, int ref, int params, const ch
command
-----------------------------------------------*/
-static void execute_fdsearch(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdsearch(running_machine &machine, int ref, int params, const char **param)
{
address_space *space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
int pc = cpu_get_pc(space->cpu);
@@ -1164,7 +1164,7 @@ static void execute_fdsearch(running_machine *machine, int ref, int params, cons
command
-----------------------------------------------*/
-static void execute_fddasm(running_machine *machine, int ref, int params, const char **param)
+static void execute_fddasm(running_machine &machine, int ref, int params, const char **param)
{
address_space *space = debug_cpu_get_visible_cpu(machine)->memory().space(AS_PROGRAM);
int origstate = fd1094_set_state(keyregion, -1);
@@ -1280,7 +1280,7 @@ static void execute_fddasm(running_machine *machine, int ref, int params, const
command
-----------------------------------------------*/
-static void execute_fdcset(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdcset(running_machine &machine, int ref, int params, const char **param)
{
UINT64 pc, value, mask = 0xffff, state = FD1094_STATE_RESET;
int cnum;
@@ -1338,7 +1338,7 @@ static void execute_fdcset(running_machine *machine, int ref, int params, const
command
-----------------------------------------------*/
-static void execute_fdclist(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdclist(running_machine &machine, int ref, int params, const char **param)
{
int cnum;
@@ -1357,7 +1357,7 @@ static void execute_fdclist(running_machine *machine, int ref, int params, const
command
-----------------------------------------------*/
-static void execute_fdcsearch(running_machine *machine, int ref, int params, const char **param)
+static void execute_fdcsearch(running_machine &machine, int ref, int params, const char **param)
{
// debug_console_printf(machine, "Searching for possible global keys....\n");
perform_constrained_search(machine);
@@ -1495,7 +1495,7 @@ static fd1094_possibility *try_all_possibilities(address_space *space, int basep
with the specified status
-----------------------------------------------*/
-static void tag_possibility(running_machine *machine, fd1094_possibility *possdata, UINT8 status)
+static void tag_possibility(running_machine &machine, fd1094_possibility *possdata, UINT8 status)
{
int curfdstate = fd1094_set_state(keyregion, -1);
int nomatter = 0, locked = 0, guessed = 0;
@@ -1569,7 +1569,7 @@ static void tag_possibility(running_machine *machine, fd1094_possibility *possda
given sequence/mask pair
-----------------------------------------------*/
-static void perform_constrained_search(running_machine *machine)
+static void perform_constrained_search(running_machine &machine)
{
UINT32 global;
@@ -2074,7 +2074,7 @@ static const struct
build_optable - build up the opcode table
-----------------------------------------------*/
-static void build_optable(running_machine *machine)
+static void build_optable(running_machine &machine)
{
int opnum, inum;
diff --git a/src/mame/machine/fddebug.h b/src/mame/machine/fddebug.h
index 21680b00c35..52b9c9e3787 100644
--- a/src/mame/machine/fddebug.h
+++ b/src/mame/machine/fddebug.h
@@ -1,4 +1,4 @@
-void fd1094_regenerate_key(running_machine *machine);
-void fd1094_init_debugging(running_machine *machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine *));
+void fd1094_regenerate_key(running_machine &machine);
+void fd1094_init_debugging(running_machine &machine, const char *cpureg, const char *keyreg, const char *statreg, void (*changed)(running_machine &));
diff --git a/src/mame/machine/flstory.c b/src/mame/machine/flstory.c
index f81a19a5373..659c74c79ab 100644
--- a/src/mame/machine/flstory.c
+++ b/src/mame/machine/flstory.c
@@ -22,7 +22,7 @@
READ8_HANDLER( flstory_68705_port_a_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
@@ -30,7 +30,7 @@ READ8_HANDLER( flstory_68705_port_a_r )
WRITE8_HANDLER( flstory_68705_port_a_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
@@ -38,7 +38,7 @@ WRITE8_HANDLER( flstory_68705_port_a_w )
WRITE8_HANDLER( flstory_68705_ddr_a_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->ddr_a = data;
}
@@ -55,13 +55,13 @@ WRITE8_HANDLER( flstory_68705_ddr_a_w )
READ8_HANDLER( flstory_68705_port_b_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( flstory_68705_port_b_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(space->cpu),data);
if ((state->ddr_b & 0x02) && (~data & 0x02) && (state->port_b_out & 0x02))
@@ -84,14 +84,14 @@ WRITE8_HANDLER( flstory_68705_port_b_w )
WRITE8_HANDLER( flstory_68705_ddr_b_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->ddr_b = data;
}
READ8_HANDLER( flstory_68705_port_c_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->port_c_in = 0;
if (state->main_sent)
@@ -106,20 +106,20 @@ READ8_HANDLER( flstory_68705_port_c_r )
WRITE8_HANDLER( flstory_68705_port_c_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data);
state->port_c_out = data;
}
WRITE8_HANDLER( flstory_68705_ddr_c_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->ddr_c = data;
}
WRITE8_HANDLER( flstory_mcu_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_main = data;
@@ -129,7 +129,7 @@ WRITE8_HANDLER( flstory_mcu_w )
READ8_HANDLER( flstory_mcu_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu), state->from_mcu);
state->mcu_sent = 0;
@@ -138,7 +138,7 @@ READ8_HANDLER( flstory_mcu_r )
READ8_HANDLER( flstory_mcu_status_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
int res = 0;
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
@@ -154,7 +154,7 @@ READ8_HANDLER( flstory_mcu_status_r )
WRITE8_HANDLER( onna34ro_mcu_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
UINT16 score_adr = state->workram[0x29e] * 0x100 + state->workram[0x29d];
switch (data)
@@ -184,7 +184,7 @@ WRITE8_HANDLER( onna34ro_mcu_w )
READ8_HANDLER( onna34ro_mcu_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
return state->from_mcu;
}
@@ -236,7 +236,7 @@ static const UINT8 victnine_mcu_data[0x100] =
WRITE8_HANDLER( victnine_mcu_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
UINT8 seed = VICTNINE_MCU_SEED;
if (!seed && (data & 0x37) == 0x37)
@@ -273,7 +273,7 @@ WRITE8_HANDLER( victnine_mcu_w )
READ8_HANDLER( victnine_mcu_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//logerror("%04x: mcu read (0x%02x)\n", cpu_get_previouspc(space->cpu), state->from_mcu);
return state->from_mcu - VICTNINE_MCU_SEED;
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index e17b205ee5e..88e9075c9b2 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -18,15 +18,15 @@
***************************************************************************/
-static void gaelco2_ROM16_split_gfx(running_machine *machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2)
+static void gaelco2_ROM16_split_gfx(running_machine &machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2)
{
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine->region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine->region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length/2; i++){
@@ -140,33 +140,33 @@ DRIVER_INIT( snowboar )
WRITE16_HANDLER( gaelco2_coin_w )
{
/* Coin Lockouts */
- coin_lockout_w(space->machine, 0, ~data & 0x01);
- coin_lockout_w(space->machine, 1, ~data & 0x02);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02);
/* Coin Counters */
- coin_counter_w(space->machine, 0, data & 0x04);
- coin_counter_w(space->machine, 1, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x04);
+ coin_counter_w(space->machine(), 1, data & 0x08);
}
WRITE16_HANDLER( gaelco2_coin2_w )
{
/* coin counters */
- coin_counter_w(space->machine, offset & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), offset & 0x01, data & 0x01);
}
WRITE16_HANDLER( wrally2_coin_w )
{
/* coin counters */
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
}
WRITE16_HANDLER( touchgo_coin_w )
{
if ((offset >> 2) == 0){
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
- coin_counter_w(space->machine, 3, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
+ coin_counter_w(space->machine(), 3, data & 0x08);
}
}
@@ -179,19 +179,19 @@ WRITE16_HANDLER( touchgo_coin_w )
DRIVER_INIT( bang )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
state->clr_gun_int = 0;
}
WRITE16_HANDLER( bang_clr_gun_int_w )
{
- gaelco2_state *state = space->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = space->machine().driver_data<gaelco2_state>();
state->clr_gun_int = 1;
}
INTERRUPT_GEN( bang_interrupt )
{
- gaelco2_state *state = device->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = device->machine().driver_data<gaelco2_state>();
if (cpu_getiloops(device) == 0){
device_set_input_line(device, 2, HOLD_LINE);
@@ -223,7 +223,7 @@ INTERRUPT_GEN( bang_interrupt )
CUSTOM_INPUT( wrally2_analog_bit_r )
{
- gaelco2_state *state = field->port->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = field->port->machine().driver_data<gaelco2_state>();
int which = (FPTR)param;
return (state->analog_ports[which] >> 7) & 0x01;
}
@@ -231,7 +231,7 @@ CUSTOM_INPUT( wrally2_analog_bit_r )
WRITE16_HANDLER( wrally2_adc_clk )
{
- gaelco2_state *state = space->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = space->machine().driver_data<gaelco2_state>();
/* a zero/one combo is written here to clock the next analog port bit */
if (ACCESSING_BITS_0_7)
{
@@ -248,14 +248,14 @@ WRITE16_HANDLER( wrally2_adc_clk )
WRITE16_HANDLER( wrally2_adc_cs )
{
- gaelco2_state *state = space->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = space->machine().driver_data<gaelco2_state>();
/* a zero is written here to read the analog ports, and a one is written when finished */
if (ACCESSING_BITS_0_7)
{
if (!(data & 0xff))
{
- state->analog_ports[0] = input_port_read_safe(space->machine, "ANALOG0", 0);
- state->analog_ports[1] = input_port_read_safe(space->machine, "ANALOG1", 0);
+ state->analog_ports[0] = input_port_read_safe(space->machine(), "ANALOG0", 0);
+ state->analog_ports[1] = input_port_read_safe(space->machine(), "ANALOG1", 0);
}
}
else
@@ -310,7 +310,7 @@ READ16_HANDLER( snowboar_protection_r )
WRITE16_HANDLER( snowboar_protection_w )
{
- gaelco2_state *state = space->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = space->machine().driver_data<gaelco2_state>();
COMBINE_DATA(&state->snowboar_protection[offset]);
logerror("%06x: protection write %04x to %04x\n", cpu_get_pc(space->cpu), data, offset*2);
diff --git a/src/mame/machine/gaelco3d.c b/src/mame/machine/gaelco3d.c
index e78c859d724..b81249cf623 100644
--- a/src/mame/machine/gaelco3d.c
+++ b/src/mame/machine/gaelco3d.c
@@ -246,7 +246,7 @@ static TIMER_CALLBACK( set_status_cb )
static void set_status(gaelco_serial_state *state, UINT8 mask, UINT8 set, int wait)
{
- state->device->machine->scheduler().timer_set(attotime::from_hz(wait), FUNC(set_status_cb), (mask << 8)|set,
+ state->device->machine().scheduler().timer_set(attotime::from_hz(wait), FUNC(set_status_cb), (mask << 8)|set,
state);
}
@@ -436,7 +436,7 @@ static DEVICE_START( gaelco_serial )
state->device = device;
devcb_resolve_write_line(&state->irq_func, &intf->irq_func, device);
- state->sync_timer = device->machine->scheduler().timer_alloc(FUNC(link_cb), state);
+ state->sync_timer = device->machine().scheduler().timer_alloc(FUNC(link_cb), state);
/* register for save states */
//device->save_item(NAME(earom->offset));
diff --git a/src/mame/machine/gaelcrpt.c b/src/mame/machine/gaelcrpt.c
index 807139bc712..6dfc05f164e 100644
--- a/src/mame/machine/gaelcrpt.c
+++ b/src/mame/machine/gaelcrpt.c
@@ -146,7 +146,7 @@ UINT16 gaelco_decrypt(address_space *space, int offset, int data, int param1, in
lastdecword = data;
-// logerror("%s : data1 = %4x > %4x @ %8x\n",space->machine->describe_context(),savedata,data,lastoffset);
+// logerror("%s : data1 = %4x > %4x @ %8x\n",space->machine().describe_context(),savedata,data,lastoffset);
}
return data;
}
diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c
index 06144f13905..c91d714a0a1 100644
--- a/src/mame/machine/galaxold.c
+++ b/src/mame/machine/galaxold.c
@@ -20,12 +20,12 @@ static IRQ_CALLBACK(hunchbkg_irq_callback)
/* for some reason a call to cputag_set_input_line
* is significantly delayed ....
*
- * cputag_set_input_line(device->machine, "maincpu", 0, CLEAR_LINE);
+ * cputag_set_input_line(device->machine(), "maincpu", 0, CLEAR_LINE);
*
* Therefore we reset the line without any detour ....
*/
- device_set_input_line(device->machine->firstcpu, 0, CLEAR_LINE);
- //cpu_set_info(device->machine->firstcpu, CPUINFO_INT_INPUT_STATE + irq_line, CLEAR_LINE);
+ device_set_input_line(device->machine().firstcpu, 0, CLEAR_LINE);
+ //cpu_set_info(device->machine().firstcpu, CPUINFO_INT_INPUT_STATE + irq_line, CLEAR_LINE);
return 0x03;
}
@@ -40,19 +40,19 @@ WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_2_q_callback )
WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback )
{
/* Q goes to the NMI line */
- cputag_set_input_line(device->machine, "maincpu", irq_line, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", irq_line, state ? CLEAR_LINE : ASSERT_LINE);
}
WRITE8_HANDLER( galaxold_nmi_enable_w )
{
- device_t *target = space->machine->device("7474_9m_1");
+ device_t *target = space->machine().device("7474_9m_1");
ttl7474_preset_w(target, data ? 1 : 0);
}
TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
{
- device_t *target = timer.machine->device("7474_9m_2");
+ device_t *target = timer.machine().device("7474_9m_2");
/* 128V, 64V and 32V go to D */
ttl7474_d_w(target, ((param & 0xe0) != 0xe0) ? 1 : 0);
@@ -62,14 +62,14 @@ TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
param = (param + 0x10) & 0xff;
- timer.adjust(timer.machine->primary_screen->time_until_pos(param), param);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(param), param);
}
-static void machine_reset_common(running_machine *machine, int line)
+static void machine_reset_common(running_machine &machine, int line)
{
- device_t *ttl7474_9m_1 = machine->device("7474_9m_1");
- device_t *ttl7474_9m_2 = machine->device("7474_9m_2");
+ device_t *ttl7474_9m_1 = machine.device("7474_9m_1");
+ device_t *ttl7474_9m_2 = machine.device("7474_9m_2");
irq_line = line;
/* initalize main CPU interrupt generator flip-flops */
@@ -81,8 +81,8 @@ static void machine_reset_common(running_machine *machine, int line)
ttl7474_preset_w(ttl7474_9m_1, 0);
/* start a timer to generate interrupts */
- timer_device *int_timer = machine->device<timer_device>("int_timer");
- int_timer->adjust(machine->primary_screen->time_until_pos(0));
+ timer_device *int_timer = machine.device<timer_device>("int_timer");
+ int_timer->adjust(machine.primary_screen->time_until_pos(0));
}
MACHINE_RESET( galaxold )
@@ -98,34 +98,34 @@ MACHINE_RESET( devilfsg )
MACHINE_RESET( hunchbkg )
{
machine_reset_common(machine, 0);
- device_set_irq_callback(machine->device("maincpu"), hunchbkg_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), hunchbkg_irq_callback);
}
WRITE8_HANDLER( galaxold_coin_lockout_w )
{
- coin_lockout_global_w(space->machine, ~data & 1);
+ coin_lockout_global_w(space->machine(), ~data & 1);
}
WRITE8_HANDLER( galaxold_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
WRITE8_HANDLER( galaxold_coin_counter_1_w )
{
- coin_counter_w(space->machine, 1, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x01);
}
WRITE8_HANDLER( galaxold_coin_counter_2_w )
{
- coin_counter_w(space->machine, 2, data & 0x01);
+ coin_counter_w(space->machine(), 2, data & 0x01);
}
WRITE8_HANDLER( galaxold_leds_w )
{
- set_led_status(space->machine, offset,data & 1);
+ set_led_status(space->machine(), offset,data & 1);
}
@@ -154,19 +154,19 @@ WRITE8_HANDLER( zigzag_sillyprotection_w )
if (data)
{
/* swap ROM 2 and 3! */
- memory_set_bank(space->machine, "bank1", 1);
- memory_set_bank(space->machine, "bank2", 0);
+ memory_set_bank(space->machine(), "bank1", 1);
+ memory_set_bank(space->machine(), "bank2", 0);
}
else
{
- memory_set_bank(space->machine, "bank1", 0);
- memory_set_bank(space->machine, "bank2", 1);
+ memory_set_bank(space->machine(), "bank1", 0);
+ memory_set_bank(space->machine(), "bank2", 1);
}
}
DRIVER_INIT( zigzag )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &RAM[0x2000], 0x1000);
memory_configure_bank(machine, "bank2", 0, 2, &RAM[0x2000], 0x1000);
memory_set_bank(machine, "bank1", 0);
@@ -194,7 +194,7 @@ static READ8_HANDLER( dingoe_3001_r )
DRIVER_INIT( dingoe )
{
offs_t i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < 0x3000; i++)
{
@@ -217,7 +217,7 @@ DRIVER_INIT( dingoe )
rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4);
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3001, 0x3001, FUNC(dingoe_3001_r)); /* Protection check */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3001, 0x3001, FUNC(dingoe_3001_r)); /* Protection check */
}
#endif
@@ -251,7 +251,7 @@ WRITE8_HANDLER( _4in1_bank_w )
{
_4in1_bank = data & 0x03;
galaxold_gfxbank_w(space, 0, _4in1_bank);
- memory_set_bank(space->machine, "bank1", _4in1_bank);
+ memory_set_bank(space->machine(), "bank1", _4in1_bank);
}
CUSTOM_INPUT( _4in1_fake_port_r )
@@ -259,26 +259,26 @@ CUSTOM_INPUT( _4in1_fake_port_r )
static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, portnames[_4in1_bank]) & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(field->port->machine(), portnames[_4in1_bank]) & bit_mask) ? 0x01 : 0x00;
}
#ifdef UNUSED_FUNCTION
DRIVER_INIT( pisces )
{
/* the coin lockout was replaced */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6002, 0x6002, FUNC(galaxold_gfxbank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6002, 0x6002, FUNC(galaxold_gfxbank_w));
}
DRIVER_INIT( checkmaj )
{
/* for the title screen */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(checkmaj_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(checkmaj_protection_r));
}
DRIVER_INIT( dingo )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(dingo_3000_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3035, 0x3035, FUNC(dingo_3035_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(dingo_3000_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3035, 0x3035, FUNC(dingo_3035_r));
}
@@ -296,13 +296,13 @@ static UINT8 decode_mooncrst(UINT8 data,offs_t addr)
DRIVER_INIT( mooncrsu )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa000, 0xa002, FUNC(galaxold_gfxbank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa000, 0xa002, FUNC(galaxold_gfxbank_w));
}
DRIVER_INIT( mooncrst )
{
- offs_t i, len = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ offs_t i, len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0;i < len;i++)
@@ -313,14 +313,14 @@ DRIVER_INIT( mooncrst )
DRIVER_INIT( mooncrgx )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0x6002, FUNC(galaxold_gfxbank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0x6002, FUNC(galaxold_gfxbank_w));
}
DRIVER_INIT( moonqsr )
{
offs_t i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -378,8 +378,8 @@ Pin layout is such that links can replace the PAL if encryption is not used.
{ 1,4,1,4 }
};
- offs_t i, len = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ offs_t i, len = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
for (i = 0; i < len; i++)
@@ -397,9 +397,9 @@ Pin layout is such that links can replace the PAL if encryption is not used.
DRIVER_INIT( 4in1 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- offs_t i, len = machine->region("maincpu")->bytes();
- UINT8 *RAM = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ offs_t i, len = machine.region("maincpu")->bytes();
+ UINT8 *RAM = machine.region("maincpu")->base();
/* Decrypt Program Roms */
for (i = 0; i < len; i++)
@@ -421,5 +421,5 @@ INTERRUPT_GEN( hunchbks_vh_interrupt )
DRIVER_INIT( ladybugg )
{
/* Doesn't actually use the bank, but it mustn't have a coin lock! */
-machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6002, 0x6002, FUNC(galaxold_gfxbank_w));
+machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6002, 0x6002, FUNC(galaxold_gfxbank_w));
}
diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c
index a0eab8b0ecc..ce61e679925 100644
--- a/src/mame/machine/gaplus.c
+++ b/src/mame/machine/gaplus.c
@@ -20,8 +20,8 @@
WRITE8_HANDLER( gaplus_customio_3_w )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
- device_t *samples = space->machine->device("samples");
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
+ device_t *samples = space->machine().device("samples");
if ((offset == 0x09) && (data >= 0x0f))
sample_start(samples,0,0,0);
@@ -31,13 +31,13 @@ WRITE8_HANDLER( gaplus_customio_3_w )
READ8_HANDLER( gaplus_customio_3_r )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
int mode = state->customio_3[8];
switch (offset)
{
case 0:
- return input_port_read(space->machine, "IN2"); /* cabinet & test mode */
+ return input_port_read(space->machine(), "IN2"); /* cabinet & test mode */
case 1:
return (mode == 2) ? state->customio_3[offset] : 0x0f;
case 2:
diff --git a/src/mame/machine/gdcrypt.c b/src/mame/machine/gdcrypt.c
index 5f5dfb69086..19a52102610 100644
--- a/src/mame/machine/gdcrypt.c
+++ b/src/mame/machine/gdcrypt.c
@@ -334,7 +334,7 @@ static void write_from_qword(UINT8* region, UINT64 qword)
}
}
-void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int length)
+void naomi_game_decrypt(running_machine& machine, UINT64 key, UINT8* region, int length)
{
int i;
@@ -345,7 +345,7 @@ void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int
{
FILE *fp;
char filename[256];
- sprintf(filename,"encrypted %s", machine->system().name);
+ sprintf(filename,"encrypted %s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -370,7 +370,7 @@ void naomi_game_decrypt(running_machine* machine, UINT64 key, UINT8* region, int
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted %s", machine->system().name);
+ sprintf(filename,"decrypted %s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index 5860133d279..bd6c51853a8 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -37,7 +37,7 @@
*************************************/
-static void hd68k_update_interrupts(running_machine *machine);
+static void hd68k_update_interrupts(running_machine &machine);
@@ -54,20 +54,20 @@ static void hd68k_update_interrupts(running_machine *machine);
MACHINE_START( harddriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
atarigen_init(machine);
/* predetermine memory regions */
- state->sim_memory = (UINT16 *)machine->region("user1")->base();
- state->sim_memory_size = machine->region("user1")->bytes() / 2;
+ state->sim_memory = (UINT16 *)machine.region("user1")->base();
+ state->sim_memory_size = machine.region("user1")->bytes() / 2;
state->adsp_pgm_memory_word = (UINT16 *)((UINT8 *)state->adsp_pgm_memory + 1);
}
MACHINE_RESET( harddriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* generic reset */
atarigen_eeprom_reset(state);
@@ -109,9 +109,9 @@ MACHINE_RESET( harddriv )
*
*************************************/
-static void hd68k_update_interrupts(running_machine *machine)
+static void hd68k_update_interrupts(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
device_set_input_line(state->maincpu, 1, state->msp_irq_state ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->maincpu, 2, state->adsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->maincpu, 3, state->gsp_irq_state ? ASSERT_LINE : CLEAR_LINE);
@@ -123,33 +123,33 @@ static void hd68k_update_interrupts(running_machine *machine)
INTERRUPT_GEN( hd68k_irq_gen )
{
- harddriv_state *state = device->machine->driver_data<harddriv_state>();
+ harddriv_state *state = device->machine().driver_data<harddriv_state>();
state->irq_state = 1;
- atarigen_update_interrupts(device->machine);
+ atarigen_update_interrupts(device->machine());
}
WRITE16_HANDLER( hd68k_irq_ack_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->irq_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
}
void hdgsp_irq_gen(device_t *device, int irqstate)
{
- harddriv_state *state = device->machine->driver_data<harddriv_state>();
+ harddriv_state *state = device->machine().driver_data<harddriv_state>();
state->gsp_irq_state = irqstate;
- atarigen_update_interrupts(device->machine);
+ atarigen_update_interrupts(device->machine());
}
void hdmsp_irq_gen(device_t *device, int irqstate)
{
- harddriv_state *state = device->machine->driver_data<harddriv_state>();
+ harddriv_state *state = device->machine().driver_data<harddriv_state>();
state->msp_irq_state = irqstate;
- atarigen_update_interrupts(device->machine);
+ atarigen_update_interrupts(device->machine());
}
@@ -162,7 +162,7 @@ void hdmsp_irq_gen(device_t *device, int irqstate)
READ16_HANDLER( hd68k_gsp_io_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT16 result;
offset = (offset / 2) ^ 1;
state->hd34010_host_access = TRUE;
@@ -174,7 +174,7 @@ READ16_HANDLER( hd68k_gsp_io_r )
WRITE16_HANDLER( hd68k_gsp_io_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
offset = (offset / 2) ^ 1;
state->hd34010_host_access = TRUE;
tms34010_host_w(state->gsp, offset, data);
@@ -191,7 +191,7 @@ WRITE16_HANDLER( hd68k_gsp_io_w )
READ16_HANDLER( hd68k_msp_io_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT16 result;
offset = (offset / 2) ^ 1;
state->hd34010_host_access = TRUE;
@@ -203,7 +203,7 @@ READ16_HANDLER( hd68k_msp_io_r )
WRITE16_HANDLER( hd68k_msp_io_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
offset = (offset / 2) ^ 1;
if (state->msp != NULL)
{
@@ -238,8 +238,8 @@ READ16_HANDLER( hd68k_port0_r )
.....
0x8000 = SW1 #1
*/
- int temp = input_port_read(space->machine, "IN0");
- if (atarigen_get_hblank(*space->machine->primary_screen)) temp ^= 0x0002;
+ int temp = input_port_read(space->machine(), "IN0");
+ if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0002;
temp ^= 0x0018; /* both EOCs always high for now */
return temp;
}
@@ -247,8 +247,8 @@ READ16_HANDLER( hd68k_port0_r )
READ16_HANDLER( hdc68k_port1_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
- UINT16 result = input_port_read(space->machine, "a80000");
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ UINT16 result = input_port_read(space->machine(), "a80000");
UINT16 diff = result ^ state->hdc68k_last_port1;
/* if a new shifter position is selected, use it */
@@ -276,8 +276,8 @@ READ16_HANDLER( hdc68k_port1_r )
READ16_HANDLER( hda68k_port1_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
- UINT16 result = input_port_read(space->machine, "a80000");
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
+ UINT16 result = input_port_read(space->machine(), "a80000");
/* merge in the wheel edge latch bit */
if (state->hdc68k_wheel_edge)
@@ -289,13 +289,13 @@ READ16_HANDLER( hda68k_port1_r )
READ16_HANDLER( hdc68k_wheel_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* grab the new wheel value and upconvert to 12 bits */
- UINT16 new_wheel = input_port_read(space->machine, "12BADC0") << 4;
+ UINT16 new_wheel = input_port_read(space->machine(), "12BADC0") << 4;
/* hack to display the wheel position */
- if (input_code_pressed(space->machine, KEYCODE_LSHIFT))
+ if (input_code_pressed(space->machine(), KEYCODE_LSHIFT))
popmessage("%04X", new_wheel);
/* if we crossed the center line, latch the edge bit */
@@ -310,21 +310,21 @@ READ16_HANDLER( hdc68k_wheel_r )
READ16_HANDLER( hd68k_adc8_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->adc8_data;
}
READ16_HANDLER( hd68k_adc12_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->adc12_byte ? ((state->adc12_data >> 8) & 0x0f) : (state->adc12_data & 0xff);
}
READ16_HANDLER( hd68k_sound_reset_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->jsacpu != NULL)
atarijsa_reset();
return ~0;
@@ -342,7 +342,7 @@ WRITE16_HANDLER( hd68k_adc_control_w )
{
static const char *const adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
static const char *const adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->adc_control);
@@ -350,14 +350,14 @@ WRITE16_HANDLER( hd68k_adc_control_w )
if (state->adc_control & 0x08)
{
state->adc8_select = state->adc_control & 0x07;
- state->adc8_data = input_port_read(space->machine, adc8names[state->adc8_select]);
+ state->adc8_data = input_port_read(space->machine(), adc8names[state->adc8_select]);
}
/* handle a write to the 12-bit ADC address select */
if (state->adc_control & 0x40)
{
state->adc12_select = (state->adc_control >> 4) & 0x03;
- state->adc12_data = input_port_read(space->machine, adc12names[state->adc12_select]) << 4;
+ state->adc12_data = input_port_read(space->machine(), adc12names[state->adc12_select]) << 4;
}
/* bit 7 selects which byte of the 12 bit data to read */
@@ -384,7 +384,7 @@ WRITE16_HANDLER( hd68k_wr0_write )
case 6: /* CC1 */
case 7: /* CC2 */
- coin_counter_w(space->machine, offset - 6, data);
+ coin_counter_w(space->machine(), offset - 6, data);
break;
}
}
@@ -408,7 +408,7 @@ WRITE16_HANDLER( hd68k_wr2_write )
WRITE16_HANDLER( hd68k_nwr_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
data = (offset >> 3) & 1;
@@ -419,7 +419,7 @@ WRITE16_HANDLER( hd68k_nwr_w )
{
case 0: /* CR2 */
case 1: /* CR1 */
- set_led_status(space->machine, offset, data);
+ set_led_status(space->machine(), offset, data);
break;
case 2: /* LC1 */
break;
@@ -448,7 +448,7 @@ WRITE16_HANDLER( hd68k_nwr_w )
WRITE16_HANDLER( hdc68k_wheel_edge_reset_w )
{
/* reset the edge latch */
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->hdc68k_wheel_edge = 0;
}
@@ -462,14 +462,14 @@ WRITE16_HANDLER( hdc68k_wheel_edge_reset_w )
READ16_HANDLER( hd68k_zram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->eeprom[offset];
}
WRITE16_HANDLER( hd68k_zram_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->m68k_zp1 == 0 && state->m68k_zp2 == 1)
COMBINE_DATA(&state->eeprom[offset]);
}
@@ -525,14 +525,14 @@ INLINE attotime duart_clock_period(harddriv_state *state)
TIMER_DEVICE_CALLBACK( hd68k_duart_callback )
{
- harddriv_state *state = timer.machine->driver_data<harddriv_state>();
+ harddriv_state *state = timer.machine().driver_data<harddriv_state>();
logerror("DUART timer fired\n");
if (state->duart_write_data[0x05] & 0x08)
{
logerror("DUART interrupt generated\n");
state->duart_read_data[0x05] |= 0x08;
state->duart_irq_state = (state->duart_read_data[0x05] & state->duart_write_data[0x05]) != 0;
- atarigen_update_interrupts(timer.machine);
+ atarigen_update_interrupts(timer.machine());
}
timer.adjust(duart_clock_period(state) * 65536);
}
@@ -540,7 +540,7 @@ TIMER_DEVICE_CALLBACK( hd68k_duart_callback )
READ16_HANDLER( hd68k_duart_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
switch (offset)
{
case 0x00: /* Mode Register A (MR1A, MR2A) */
@@ -576,7 +576,7 @@ READ16_HANDLER( hd68k_duart_r )
}
state->duart_read_data[0x05] &= ~0x08;
state->duart_irq_state = (state->duart_read_data[0x05] & state->duart_write_data[0x05]) != 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
return 0x00ff;
}
return 0x00ff;
@@ -585,7 +585,7 @@ READ16_HANDLER( hd68k_duart_r )
WRITE16_HANDLER( hd68k_duart_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (ACCESSING_BITS_8_15)
{
int newdata = (data >> 8) & 0xff;
@@ -631,7 +631,7 @@ WRITE16_HANDLER( hd68k_duart_w )
WRITE16_HANDLER( hdgsp_io_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* detect an enabling of the shift register and force yielding */
if (offset == REG_DPYCTL)
@@ -647,7 +647,7 @@ WRITE16_HANDLER( hdgsp_io_w )
/* detect changes to HEBLNK and HSBLNK and force an update before they change */
if ((offset == REG_HEBLNK || offset == REG_HSBLNK) && data != tms34010_io_register_r(space, offset, 0xffff))
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
tms34010_io_register_w(space, offset, data, mem_mask);
}
@@ -662,7 +662,7 @@ WRITE16_HANDLER( hdgsp_io_w )
WRITE16_HANDLER( hdgsp_protection_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* this memory address is incremented whenever a protection check fails */
/* after it reaches a certain value, the GSP will randomly trash a */
@@ -680,7 +680,7 @@ WRITE16_HANDLER( hdgsp_protection_w )
static TIMER_CALLBACK( stmsp_sync_update )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
int which = param >> 28;
offs_t offset = (param >> 16) & 0xfff;
UINT16 data = param;
@@ -691,13 +691,13 @@ static TIMER_CALLBACK( stmsp_sync_update )
INLINE void stmsp_sync_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT16 newdata = state->stmsp_sync[which][offset];
COMBINE_DATA(&newdata);
/* if being written from the 68000, synchronize on it */
if (state->hd34010_host_access)
- space->machine->scheduler().synchronize(FUNC(stmsp_sync_update), newdata | (offset << 16) | (which << 28));
+ space->machine().scheduler().synchronize(FUNC(stmsp_sync_update), newdata | (offset << 16) | (which << 28));
/* otherwise, just update */
else
@@ -737,7 +737,7 @@ WRITE16_HANDLER( stmsp_sync2_w )
READ16_HANDLER( hd68k_adsp_program_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 word = state->adsp_pgm_memory[offset/2];
return (!(offset & 1)) ? (word >> 16) : (word & 0xffff);
}
@@ -745,7 +745,7 @@ READ16_HANDLER( hd68k_adsp_program_r )
WRITE16_HANDLER( hd68k_adsp_program_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 *base = &state->adsp_pgm_memory[offset/2];
UINT32 oldword = *base;
UINT16 temp;
@@ -775,14 +775,14 @@ WRITE16_HANDLER( hd68k_adsp_program_w )
READ16_HANDLER( hd68k_adsp_data_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->adsp_data_memory[offset];
}
WRITE16_HANDLER( hd68k_adsp_data_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->adsp_data_memory[offset]);
@@ -790,7 +790,7 @@ WRITE16_HANDLER( hd68k_adsp_data_w )
if (offset == 0x1fff)
{
logerror("%06X:ADSP sync address written (%04X)\n", cpu_get_previouspc(space->cpu), data);
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
device_triggerint(state->adsp);
}
else
@@ -807,7 +807,7 @@ WRITE16_HANDLER( hd68k_adsp_data_w )
READ16_HANDLER( hd68k_adsp_buffer_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* logerror("hd68k_adsp_buffer_r(%04X)\n", offset);*/
return state->som_memory[state->m68k_adsp_buffer_bank * 0x2000 + offset];
}
@@ -815,7 +815,7 @@ READ16_HANDLER( hd68k_adsp_buffer_r )
WRITE16_HANDLER( hd68k_adsp_buffer_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->som_memory[state->m68k_adsp_buffer_bank * 0x2000 + offset]);
}
@@ -829,7 +829,7 @@ WRITE16_HANDLER( hd68k_adsp_buffer_w )
static TIMER_CALLBACK( deferred_adsp_bank_switch )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
if (LOG_COMMANDS && state->m68k_adsp_buffer_bank != param && input_code_pressed(machine, KEYCODE_L))
{
static FILE *commands;
@@ -881,7 +881,7 @@ static TIMER_CALLBACK( deferred_adsp_bank_switch )
WRITE16_HANDLER( hd68k_adsp_control_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
int val = (offset >> 3) & 1;
@@ -897,7 +897,7 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
case 3:
logerror("ADSP bank = %d (deferred)\n", val);
- space->machine->scheduler().synchronize(FUNC(deferred_adsp_bank_switch), val);
+ space->machine().scheduler().synchronize(FUNC(deferred_adsp_bank_switch), val);
break;
case 5:
@@ -949,16 +949,16 @@ WRITE16_HANDLER( hd68k_adsp_control_w )
WRITE16_HANDLER( hd68k_adsp_irq_clear_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
logerror("%06X:68k clears ADSP interrupt\n", cpu_get_previouspc(space->cpu));
state->adsp_irq_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
}
READ16_HANDLER( hd68k_adsp_irq_state_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int result = 0xfffd;
if (state->adsp_xflag) result ^= 2;
if (state->adsp_irq_state) result ^= 1;
@@ -976,7 +976,7 @@ READ16_HANDLER( hd68k_adsp_irq_state_r )
READ16_HANDLER( hdadsp_special_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
switch (offset & 7)
{
case 0: /* /SIMBUF */
@@ -1004,7 +1004,7 @@ READ16_HANDLER( hdadsp_special_r )
WRITE16_HANDLER( hdadsp_special_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
switch (offset & 7)
{
case 1: /* /SIMCLK */
@@ -1026,7 +1026,7 @@ WRITE16_HANDLER( hdadsp_special_w )
case 6: /* /GINT */
logerror("%04X:ADSP signals interrupt\n", cpu_get_previouspc(space->cpu));
state->adsp_irq_state = 1;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
break;
case 7: /* /MP */
@@ -1064,7 +1064,7 @@ static void update_ds3_irq(harddriv_state *state)
WRITE16_HANDLER( hd68k_ds3_control_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
switch (offset & 7)
@@ -1129,7 +1129,7 @@ WRITE16_HANDLER( hd68k_ds3_control_w )
READ16_HANDLER( hd68k_ds3_girq_state_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int result = 0x0fff;
if (state->ds3_g68flag) result ^= 0x8000;
if (state->ds3_gflag) result ^= 0x4000;
@@ -1141,7 +1141,7 @@ READ16_HANDLER( hd68k_ds3_girq_state_r )
READ16_HANDLER( hd68k_ds3_gdata_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
offs_t pc = cpu_get_pc(space->cpu);
state->ds3_gflag = 0;
@@ -1181,7 +1181,7 @@ READ16_HANDLER( hd68k_ds3_gdata_r )
/* it is important that all the CPUs be in sync before we continue, so spin a little */
/* while to let everyone else catch up */
device_spin_until_trigger(space->cpu, DS3_TRIGGER);
- space->machine->scheduler().trigger(DS3_TRIGGER, attotime::from_usec(5));
+ space->machine().scheduler().trigger(DS3_TRIGGER, attotime::from_usec(5));
return state->ds3_gdata;
}
@@ -1189,7 +1189,7 @@ READ16_HANDLER( hd68k_ds3_gdata_r )
WRITE16_HANDLER( hd68k_ds3_gdata_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
logerror("%06X:hd68k_ds3_gdata_w(%04X)\n", cpu_get_previouspc(space->cpu), state->ds3_gdata);
@@ -1233,7 +1233,7 @@ WRITE16_HANDLER( hd68k_ds3_sdata_w )
READ16_HANDLER( hdds3_special_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int result;
switch (offset & 7)
@@ -1263,7 +1263,7 @@ READ16_HANDLER( hdds3_special_r )
WRITE16_HANDLER( hdds3_special_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* IMPORTANT! these data values also write through to the underlying RAM */
state->adsp_data_memory[offset] = data;
@@ -1277,13 +1277,13 @@ WRITE16_HANDLER( hdds3_special_w )
update_ds3_irq(state);
/* once we've written data, trigger the main CPU to wake up again */
- space->machine->scheduler().trigger(DS3_TRIGGER);
+ space->machine().scheduler().trigger(DS3_TRIGGER);
break;
case 1:
logerror("%04X:ADSP sets interrupt = %d\n", cpu_get_previouspc(space->cpu), (data >> 1) & 1);
state->adsp_irq_state = (data >> 1) & 1;
- hd68k_update_interrupts(space->machine);
+ hd68k_update_interrupts(space->machine());
break;
case 2:
@@ -1330,7 +1330,7 @@ WRITE16_HANDLER( hdds3_control_w )
READ16_HANDLER( hd68k_ds3_program_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 *base = &state->adsp_pgm_memory[offset & 0x1fff];
UINT32 word = *base;
return (!(offset & 0x2000)) ? (word >> 8) : (word & 0xff);
@@ -1339,7 +1339,7 @@ READ16_HANDLER( hd68k_ds3_program_r )
WRITE16_HANDLER( hd68k_ds3_program_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 *base = &state->adsp_pgm_memory[offset & 0x1fff];
UINT32 oldword = *base;
UINT16 temp;
@@ -1374,9 +1374,9 @@ WRITE16_HANDLER( hd68k_ds3_program_w )
void hddsk_update_pif(dsp32c_device &device, UINT32 pins)
{
- atarigen_state *atarigen = device.machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = device.machine().driver_data<atarigen_state>();
atarigen->sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0);
- hd68k_update_interrupts(device.machine);
+ hd68k_update_interrupts(device.machine());
}
@@ -1389,7 +1389,7 @@ void hddsk_update_pif(dsp32c_device &device, UINT32 pins)
WRITE16_HANDLER( hd68k_dsk_control_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
switch (offset & 7)
{
@@ -1408,7 +1408,7 @@ WRITE16_HANDLER( hd68k_dsk_control_w )
break;
case 4: /* ASIC65 reset */
- asic65_reset(space->machine, !val);
+ asic65_reset(space->machine(), !val);
break;
case 7: /* LED */
@@ -1430,42 +1430,42 @@ WRITE16_HANDLER( hd68k_dsk_control_w )
READ16_HANDLER( hd68k_dsk_ram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->dsk_ram[offset];
}
WRITE16_HANDLER( hd68k_dsk_ram_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->dsk_ram[offset]);
}
READ16_HANDLER( hd68k_dsk_zram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->dsk_zram[offset];
}
WRITE16_HANDLER( hd68k_dsk_zram_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->dsk_zram[offset]);
}
READ16_HANDLER( hd68k_dsk_small_rom_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->dsk_rom[offset & 0x1ffff];
}
READ16_HANDLER( hd68k_dsk_rom_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->dsk_rom[offset];
}
@@ -1479,7 +1479,7 @@ READ16_HANDLER( hd68k_dsk_rom_r )
WRITE16_HANDLER( hd68k_dsk_dsp32_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->dsk_pio_access = TRUE;
state->dsp32->pio_w(offset, data);
state->dsk_pio_access = FALSE;
@@ -1488,7 +1488,7 @@ WRITE16_HANDLER( hd68k_dsk_dsp32_w )
READ16_HANDLER( hd68k_dsk_dsp32_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT16 result;
state->dsk_pio_access = TRUE;
result = state->dsp32->pio_r(offset);
@@ -1505,14 +1505,14 @@ READ16_HANDLER( hd68k_dsk_dsp32_r )
static TIMER_CALLBACK( rddsp32_sync_cb )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
*state->dataptr[param] = state->dataval[param];
}
WRITE32_HANDLER( rddsp32_sync0_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->dsk_pio_access)
{
UINT32 *dptr = &state->rddsp32_sync[0][offset];
@@ -1520,7 +1520,7 @@ WRITE32_HANDLER( rddsp32_sync0_w )
COMBINE_DATA(&newdata);
state->dataptr[state->next_msp_sync % MAX_MSP_SYNC] = dptr;
state->dataval[state->next_msp_sync % MAX_MSP_SYNC] = newdata;
- space->machine->scheduler().synchronize(FUNC(rddsp32_sync_cb), state->next_msp_sync++ % MAX_MSP_SYNC);
+ space->machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->next_msp_sync++ % MAX_MSP_SYNC);
}
else
COMBINE_DATA(&state->rddsp32_sync[0][offset]);
@@ -1529,7 +1529,7 @@ WRITE32_HANDLER( rddsp32_sync0_w )
WRITE32_HANDLER( rddsp32_sync1_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->dsk_pio_access)
{
UINT32 *dptr = &state->rddsp32_sync[1][offset];
@@ -1537,7 +1537,7 @@ WRITE32_HANDLER( rddsp32_sync1_w )
COMBINE_DATA(&newdata);
state->dataptr[state->next_msp_sync % MAX_MSP_SYNC] = dptr;
state->dataval[state->next_msp_sync % MAX_MSP_SYNC] = newdata;
- space->machine->scheduler().synchronize(FUNC(rddsp32_sync_cb), state->next_msp_sync++ % MAX_MSP_SYNC);
+ space->machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->next_msp_sync++ % MAX_MSP_SYNC);
}
else
COMBINE_DATA(&state->rddsp32_sync[1][offset]);
@@ -1562,7 +1562,7 @@ WRITE16_HANDLER( hddspcom_control_w )
switch (offset & 7)
{
case 2: /* ASIC65 reset */
- asic65_reset(space->machine, !val);
+ asic65_reset(space->machine(), !val);
break;
default:
@@ -1592,7 +1592,7 @@ WRITE16_HANDLER( rd68k_slapstic_w )
READ16_HANDLER( rd68k_slapstic_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int bank = slapstic_tweak(space, offset & 0x3fff) * 0x4000;
return state->m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1634,14 +1634,14 @@ static int st68k_sloop_tweak(harddriv_state *state, offs_t offset)
WRITE16_HANDLER( st68k_sloop_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
st68k_sloop_tweak(state, offset & 0x3fff);
}
READ16_HANDLER( st68k_sloop_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int bank = st68k_sloop_tweak(state, offset) * 0x4000;
return state->m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1649,7 +1649,7 @@ READ16_HANDLER( st68k_sloop_r )
READ16_HANDLER( st68k_sloop_alt_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->st68k_last_alt_sloop_offset == 0x00fe)
{
switch (offset*2)
@@ -1702,14 +1702,14 @@ static int st68k_protosloop_tweak(harddriv_state *state, offs_t offset)
WRITE16_HANDLER( st68k_protosloop_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
st68k_protosloop_tweak(state, offset & 0x3fff);
}
READ16_HANDLER( st68k_protosloop_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int bank = st68k_protosloop_tweak(state, offset) * 0x4000;
return state->m68k_slapstic_base[bank + (offset & 0x3fff)];
}
@@ -1732,7 +1732,7 @@ READ16_HANDLER( st68k_protosloop_r )
READ16_HANDLER( hdgsp_speedup_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int result = state->gsp_speedup_addr[0][offset];
/* if both this address and the other important address are not $ffff */
@@ -1750,7 +1750,7 @@ READ16_HANDLER( hdgsp_speedup_r )
WRITE16_HANDLER( hdgsp_speedup1_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->gsp_speedup_addr[0][offset]);
@@ -1762,7 +1762,7 @@ WRITE16_HANDLER( hdgsp_speedup1_w )
WRITE16_HANDLER( hdgsp_speedup2_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->gsp_speedup_addr[1][offset]);
@@ -1783,7 +1783,7 @@ WRITE16_HANDLER( hdgsp_speedup2_w )
READ16_HANDLER( rdgsp_speedup1_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int result = state->gsp_speedup_addr[0][offset];
/* if this address is equal to $f000, spin until something gets written */
@@ -1800,7 +1800,7 @@ READ16_HANDLER( rdgsp_speedup1_r )
WRITE16_HANDLER( rdgsp_speedup1_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->gsp_speedup_addr[0][offset]);
if (space->cpu != state->gsp)
device_triggerint(state->gsp);
@@ -1821,7 +1821,7 @@ WRITE16_HANDLER( rdgsp_speedup1_w )
READ16_HANDLER( hdmsp_speedup_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int data = state->msp_speedup_addr[offset];
if (data == 0 && space->cpu == state->msp && cpu_get_pc(space->cpu) == state->msp_speedup_pc)
@@ -1836,7 +1836,7 @@ READ16_HANDLER( hdmsp_speedup_r )
WRITE16_HANDLER( hdmsp_speedup_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->msp_speedup_addr[offset]);
if (offset == 0 && state->msp_speedup_addr[offset] != 0)
device_triggerint(state->msp);
@@ -1845,7 +1845,7 @@ WRITE16_HANDLER( hdmsp_speedup_w )
READ16_HANDLER( stmsp_speedup_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* assumes: stmsp_sync[0] -> $80010, stmsp_sync[1] -> $99680, stmsp_sync[2] -> $99d30 */
if (state->stmsp_sync[0][0] == 0 && /* 80010 */
@@ -1882,7 +1882,7 @@ READ16_HANDLER( stmsp_speedup_r )
READ16_HANDLER( hdadsp_speedup_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int data = state->adsp_data_memory[0x1fff];
if (data == 0xffff && space->cpu == state->adsp && cpu_get_pc(space->cpu) <= 0x3b)
@@ -1897,7 +1897,7 @@ READ16_HANDLER( hdadsp_speedup_r )
READ16_HANDLER( hdds3_speedup_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int data = *state->ds3_speedup_addr;
if (data != 0 && space->cpu == state->adsp && cpu_get_pc(space->cpu) == state->ds3_speedup_pc)
diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c
index ef0939081a9..882f68eb3df 100644
--- a/src/mame/machine/irobot.c
+++ b/src/mame/machine/irobot.c
@@ -25,10 +25,10 @@
#define IR_CPU_STATE(m) \
logerror(\
- "%s, scanline: %d\n", m->describe_context(), (m)->primary_screen->vpos())
+ "%s, scanline: %d\n", (m).describe_context(), (m).primary_screen->vpos())
-static void irmb_run(running_machine *machine);
+static void irmb_run(running_machine &machine);
/***********************************************************************/
@@ -37,7 +37,7 @@ static void irmb_run(running_machine *machine);
READ8_HANDLER( irobot_sharedmem_r )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
if (state->outx == 3)
return state->mbRAM[BYTE_XOR_BE(offset)];
@@ -56,7 +56,7 @@ READ8_HANDLER( irobot_sharedmem_r )
/* Comment out the mbRAM =, comRAM2 = or comRAM1 = and it will start working */
WRITE8_HANDLER( irobot_sharedmem_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
if (state->outx == 3)
state->mbRAM[BYTE_XOR_BE(offset)] = data;
@@ -66,59 +66,59 @@ WRITE8_HANDLER( irobot_sharedmem_w )
TIMER_DEVICE_CALLBACK( irobot_irvg_done_callback )
{
- irobot_state *state = timer.machine->driver_data<irobot_state>();
+ irobot_state *state = timer.machine().driver_data<irobot_state>();
logerror("vg done. ");
state->irvg_running = 0;
}
WRITE8_HANDLER( irobot_statwr_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
logerror("write %2x ", data);
- IR_CPU_STATE(space->machine);
+ IR_CPU_STATE(space->machine());
state->combase = state->comRAM[data >> 7];
state->combase_mb = state->comRAM[(data >> 7) ^ 1];
state->bufsel = data & 0x02;
if (((data & 0x01) == 0x01) && (state->vg_clear == 0))
- irobot_poly_clear(space->machine);
+ irobot_poly_clear(space->machine());
state->vg_clear = data & 0x01;
if ((data & 0x04) && !(state->statwr & 0x04))
{
- irobot_run_video(space->machine);
+ irobot_run_video(space->machine());
#if IR_TIMING
if (state->irvg_running == 0)
logerror("vg start ");
else
logerror("vg start [busy!] ");
- IR_CPU_STATE(space->machine);
+ IR_CPU_STATE(space->machine());
state->irvg_timer->adjust(attotime::from_msec(10));
#endif
state->irvg_running=1;
}
if ((data & 0x10) && !(state->statwr & 0x10))
- irmb_run(space->machine);
+ irmb_run(space->machine());
state->statwr = data;
}
WRITE8_HANDLER( irobot_out0_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
state->out0 = data;
switch (data & 0x60)
{
case 0:
- memory_set_bankptr(space->machine, "bank2", &RAM[0x1C000]);
+ memory_set_bankptr(space->machine(), "bank2", &RAM[0x1C000]);
break;
case 0x20:
- memory_set_bankptr(space->machine, "bank2", &RAM[0x1C800]);
+ memory_set_bankptr(space->machine(), "bank2", &RAM[0x1C800]);
break;
case 0x40:
- memory_set_bankptr(space->machine, "bank2", &RAM[0x1D000]);
+ memory_set_bankptr(space->machine(), "bank2", &RAM[0x1D000]);
break;
}
state->outx = (data & 0x18) >> 3;
@@ -128,36 +128,36 @@ WRITE8_HANDLER( irobot_out0_w )
WRITE8_HANDLER( irobot_rom_banksel_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
switch ((data & 0x0E) >> 1)
{
case 0:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x10000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000]);
break;
case 1:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x12000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x12000]);
break;
case 2:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x14000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x14000]);
break;
case 3:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x16000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x16000]);
break;
case 4:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x18000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x18000]);
break;
case 5:
- memory_set_bankptr(space->machine, "bank1", &RAM[0x1A000]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x1A000]);
break;
}
- set_led_status(space->machine, 0,data & 0x10);
- set_led_status(space->machine, 1,data & 0x20);
+ set_led_status(space->machine(), 0,data & 0x10);
+ set_led_status(space->machine(), 1,data & 0x20);
}
static TIMER_CALLBACK( scanline_callback )
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
int scanline = param;
if (scanline == 0) state->irvg_vblank=0;
@@ -169,13 +169,13 @@ static TIMER_CALLBACK( scanline_callback )
/* set a callback for the next 32-scanline increment */
scanline += 32;
if (scanline >= 256) scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline);
}
MACHINE_RESET( irobot )
{
- irobot_state *state = machine->driver_data<irobot_state>();
- UINT8 *MB = machine->region("mathbox")->base();
+ irobot_state *state = machine.driver_data<irobot_state>();
+ UINT8 *MB = machine.region("mathbox")->base();
/* initialize the memory regions */
state->mbROM = MB + 0x00000;
@@ -185,15 +185,15 @@ MACHINE_RESET( irobot )
state->irvg_vblank=0;
state->irvg_running = 0;
- state->irvg_timer = machine->device<timer_device>("irvg_timer");
+ state->irvg_timer = machine.device<timer_device>("irvg_timer");
state->irmb_running = 0;
- state->irmb_timer = machine->device<timer_device>("irmb_timer");
+ state->irmb_timer = machine.device<timer_device>("irmb_timer");
/* set an initial timer to go off on scanline 0 */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(scanline_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(scanline_callback));
- irobot_rom_banksel_w(machine->device("maincpu")->memory().space(AS_PROGRAM),0,0);
- irobot_out0_w(machine->device("maincpu")->memory().space(AS_PROGRAM),0,0);
+ irobot_rom_banksel_w(machine.device("maincpu")->memory().space(AS_PROGRAM),0,0);
+ irobot_out0_w(machine.device("maincpu")->memory().space(AS_PROGRAM),0,0);
state->combase = state->comRAM[0];
state->combase_mb = state->comRAM[1];
state->outx = 0;
@@ -201,19 +201,19 @@ MACHINE_RESET( irobot )
WRITE8_HANDLER( irobot_control_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
state->control_num = offset & 0x03;
}
READ8_HANDLER( irobot_control_r )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
if (state->control_num == 0)
- return input_port_read(space->machine, "AN0");
+ return input_port_read(space->machine(), "AN0");
else if (state->control_num == 1)
- return input_port_read(space->machine, "AN1");
+ return input_port_read(space->machine(), "AN1");
return 0;
}
@@ -222,11 +222,11 @@ READ8_HANDLER( irobot_control_r )
them to simulate the mathbox and vector generator running in real time */
READ8_HANDLER( irobot_status_r )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
int d=0;
logerror("status read. ");
- IR_CPU_STATE(space->machine);
+ IR_CPU_STATE(space->machine());
if (!state->irmb_running) d |= 0x20;
if (state->irvg_running) d |= 0x40;
@@ -337,10 +337,10 @@ static void irmb_dout(irobot_state *state, const irmb_ops *curop, UINT32 d)
/* Convert microcode roms to a more usable form */
-static void load_oproms(running_machine *machine)
+static void load_oproms(running_machine &machine)
{
- irobot_state *state = machine->driver_data<irobot_state>();
- UINT8 *MB = machine->region("proms")->base() + 0x20;
+ irobot_state *state = machine.driver_data<irobot_state>();
+ UINT8 *MB = machine.region("proms")->base() + 0x20;
int i;
/* allocate RAM */
@@ -412,7 +412,7 @@ static void load_oproms(running_machine *machine)
/* Init mathbox (only called once) */
DRIVER_INIT( irobot )
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
int i;
for (i = 0; i < 16; i++)
{
@@ -425,10 +425,10 @@ DRIVER_INIT( irobot )
TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback )
{
- irobot_state *state = timer.machine->driver_data<irobot_state>();
+ irobot_state *state = timer.machine().driver_data<irobot_state>();
logerror("mb done. ");
state->irmb_running = 0;
- cputag_set_input_line(timer.machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
}
@@ -545,9 +545,9 @@ TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback )
/* Run mathbox */
-static void irmb_run(running_machine *machine)
+static void irmb_run(running_machine &machine)
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
const irmb_ops *prevop = &state->mbops[0];
const irmb_ops *curop = &state->mbops[0];
diff --git a/src/mame/machine/jalcrpt.c b/src/mame/machine/jalcrpt.c
index 77ecb9e8956..d8ac6389c01 100644
--- a/src/mame/machine/jalcrpt.c
+++ b/src/mame/machine/jalcrpt.c
@@ -2,10 +2,10 @@
#include "machine/jalcrpt.h"
-void phantasm_rom_decode(running_machine *machine, const char *region)
+void phantasm_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine->region(region)->base();
- int i, size = machine->region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.region(region)->base();
+ int i, size = machine.region(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -36,10 +36,10 @@ void phantasm_rom_decode(running_machine *machine, const char *region)
}
-void astyanax_rom_decode(running_machine *machine, const char *region)
+void astyanax_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine->region(region)->base();
- int i, size = machine->region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.region(region)->base();
+ int i, size = machine.region(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -70,10 +70,10 @@ void astyanax_rom_decode(running_machine *machine, const char *region)
}
}
-void rodland_rom_decode(running_machine *machine, const char *region)
+void rodland_rom_decode(running_machine &machine, const char *region)
{
- UINT16 *RAM = (UINT16 *) machine->region(region)->base();
- int i, size = machine->region(region)->bytes();
+ UINT16 *RAM = (UINT16 *) machine.region(region)->base();
+ int i, size = machine.region(region)->bytes();
if (size > 0x40000) size = 0x40000;
for (i = 0 ; i < size/2 ; i++)
@@ -116,7 +116,7 @@ void rodland_rom_decode(running_machine *machine, const char *region)
/* SS92048-01: p47aces, 47pie2, 47pie2o */
-void ms32_rearrange_sprites(running_machine *machine, const char *region)
+void ms32_rearrange_sprites(running_machine &machine, const char *region)
{
/* sprites are not encrypted, but we need to move the data around to handle them as 256x256 tiles */
int i;
@@ -125,8 +125,8 @@ void ms32_rearrange_sprites(running_machine *machine, const char *region)
UINT8 *result_data;
- source_data = machine->region ( region )->base();
- source_size = machine->region( region )->bytes();
+ source_data = machine.region ( region )->base();
+ source_size = machine.region( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
@@ -142,7 +142,7 @@ void ms32_rearrange_sprites(running_machine *machine, const char *region)
}
-void decrypt_ms32_tx(running_machine *machine, int addr_xor,int data_xor, const char *region)
+void decrypt_ms32_tx(running_machine &machine, int addr_xor,int data_xor, const char *region)
{
int i;
UINT8 *source_data;
@@ -150,8 +150,8 @@ void decrypt_ms32_tx(running_machine *machine, int addr_xor,int data_xor, const
UINT8 *result_data;
- source_data = machine->region ( region )->base();
- source_size = machine->region( region )->bytes();
+ source_data = machine.region ( region )->base();
+ source_size = machine.region( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
@@ -196,7 +196,7 @@ void decrypt_ms32_tx(running_machine *machine, int addr_xor,int data_xor, const
auto_free (machine, result_data);
}
-void decrypt_ms32_bg(running_machine *machine, int addr_xor,int data_xor, const char *region)
+void decrypt_ms32_bg(running_machine &machine, int addr_xor,int data_xor, const char *region)
{
int i;
UINT8 *source_data;
@@ -204,8 +204,8 @@ void decrypt_ms32_bg(running_machine *machine, int addr_xor,int data_xor, const
UINT8 *result_data;
- source_data = machine->region ( region )->base();
- source_size = machine->region( region )->bytes();
+ source_data = machine.region ( region )->base();
+ source_size = machine.region( region )->bytes();
result_data = auto_alloc_array(machine, UINT8, source_size);
diff --git a/src/mame/machine/jalcrpt.h b/src/mame/machine/jalcrpt.h
index 1547f50831e..c52f552e964 100644
--- a/src/mame/machine/jalcrpt.h
+++ b/src/mame/machine/jalcrpt.h
@@ -1,7 +1,7 @@
-void astyanax_rom_decode(running_machine *machine, const char *region);
-void phantasm_rom_decode(running_machine *machine, const char *region);
-void rodland_rom_decode (running_machine *machine, const char *region);
+void astyanax_rom_decode(running_machine &machine, const char *region);
+void phantasm_rom_decode(running_machine &machine, const char *region);
+void rodland_rom_decode (running_machine &machine, const char *region);
-void ms32_rearrange_sprites(running_machine *machine, const char *region);
-void decrypt_ms32_tx(running_machine *machine, int addr_xor,int data_xor, const char *region);
-void decrypt_ms32_bg(running_machine *machine, int addr_xor,int data_xor, const char *region);
+void ms32_rearrange_sprites(running_machine &machine, const char *region);
+void decrypt_ms32_tx(running_machine &machine, int addr_xor,int data_xor, const char *region);
+void decrypt_ms32_bg(running_machine &machine, int addr_xor,int data_xor, const char *region);
diff --git a/src/mame/machine/jumpshot.c b/src/mame/machine/jumpshot.c
index 5ee552ccff8..744d895e5fa 100644
--- a/src/mame/machine/jumpshot.c
+++ b/src/mame/machine/jumpshot.c
@@ -39,14 +39,14 @@ static UINT8 decrypt(int addr, UINT8 e)
}
-void jumpshot_decode(running_machine *machine)
+void jumpshot_decode(running_machine &machine)
{
int i;
UINT8 *RAM;
/* CPU ROMs */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = decrypt(i,RAM[i]);
diff --git a/src/mame/machine/kabuki.c b/src/mame/machine/kabuki.c
index 990ed67e80d..1f54be88f95 100644
--- a/src/mame/machine/kabuki.c
+++ b/src/mame/machine/kabuki.c
@@ -159,12 +159,12 @@ static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data,
-static void mitchell_decode(running_machine *machine, int swap_key1,int swap_key2,int addr_key,int xor_key)
+static void mitchell_decode(running_machine &machine, int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine->region("maincpu")->bytes());
- int numbanks = (machine->region("maincpu")->bytes() - 0x10000) / 0x4000;
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.region("maincpu")->bytes());
+ int numbanks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
int i;
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -187,30 +187,30 @@ static void mitchell_decode(running_machine *machine, int swap_key1,int swap_key
*/
}
-void mgakuen2_decode(running_machine *machine) { mitchell_decode(machine,0x76543210,0x01234567,0xaa55,0xa5); }
-void pang_decode(running_machine *machine) { mitchell_decode(machine,0x01234567,0x76543210,0x6548,0x24); }
-void cworld_decode(running_machine *machine) { mitchell_decode(machine,0x04152637,0x40516273,0x5751,0x43); }
-void hatena_decode(running_machine *machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5751,0x43); }
-void spang_decode(running_machine *machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5852,0x43); }
-void spangj_decode(running_machine *machine) { mitchell_decode(machine,0x45123670,0x67012345,0x55aa,0x5a); }
-void sbbros_decode(running_machine *machine) { mitchell_decode(machine,0x45670123,0x45670123,0x2130,0x12); }
-void marukin_decode(running_machine *machine) { mitchell_decode(machine,0x54321076,0x54321076,0x4854,0x4f); }
-void qtono1_decode(running_machine *machine) { mitchell_decode(machine,0x12345670,0x12345670,0x1111,0x11); }
-void qsangoku_decode(running_machine *machine) { mitchell_decode(machine,0x23456701,0x23456701,0x1828,0x18); }
-void block_decode(running_machine *machine) { mitchell_decode(machine,0x02461357,0x64207531,0x0002,0x01); }
+void mgakuen2_decode(running_machine &machine) { mitchell_decode(machine,0x76543210,0x01234567,0xaa55,0xa5); }
+void pang_decode(running_machine &machine) { mitchell_decode(machine,0x01234567,0x76543210,0x6548,0x24); }
+void cworld_decode(running_machine &machine) { mitchell_decode(machine,0x04152637,0x40516273,0x5751,0x43); }
+void hatena_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5751,0x43); }
+void spang_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5852,0x43); }
+void spangj_decode(running_machine &machine) { mitchell_decode(machine,0x45123670,0x67012345,0x55aa,0x5a); }
+void sbbros_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x2130,0x12); }
+void marukin_decode(running_machine &machine) { mitchell_decode(machine,0x54321076,0x54321076,0x4854,0x4f); }
+void qtono1_decode(running_machine &machine) { mitchell_decode(machine,0x12345670,0x12345670,0x1111,0x11); }
+void qsangoku_decode(running_machine &machine) { mitchell_decode(machine,0x23456701,0x23456701,0x1828,0x18); }
+void block_decode(running_machine &machine) { mitchell_decode(machine,0x02461357,0x64207531,0x0002,0x01); }
-static void cps1_decode(running_machine *machine,int swap_key1,int swap_key2,int addr_key,int xor_key)
+static void cps1_decode(running_machine &machine,int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
}
-void wof_decode(running_machine *machine) { cps1_decode(machine,0x01234567,0x54163072,0x5151,0x51); }
-void dino_decode(running_machine *machine) { cps1_decode(machine,0x76543210,0x24601357,0x4343,0x43); }
-void punisher_decode(running_machine *machine) { cps1_decode(machine,0x67452103,0x75316024,0x2222,0x22); }
-void slammast_decode(running_machine *machine) { cps1_decode(machine,0x54321076,0x65432107,0x3131,0x19); }
+void wof_decode(running_machine &machine) { cps1_decode(machine,0x01234567,0x54163072,0x5151,0x51); }
+void dino_decode(running_machine &machine) { cps1_decode(machine,0x76543210,0x24601357,0x4343,0x43); }
+void punisher_decode(running_machine &machine) { cps1_decode(machine,0x67452103,0x75316024,0x2222,0x22); }
+void slammast_decode(running_machine &machine) { cps1_decode(machine,0x54321076,0x65432107,0x3131,0x19); }
diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c
index 8db76e273e5..7df9909f443 100644
--- a/src/mame/machine/kaneko16.c
+++ b/src/mame/machine/kaneko16.c
@@ -92,7 +92,7 @@ READ16_HANDLER(galpanib_calc_r) /* Simulation of the CALC1 MCU */
return (((UINT32)hit.mult_a * (UINT32)hit.mult_b) & 0xffff);
case 0x14/2:
- return (space->machine->rand() & 0xffff);
+ return (space->machine().rand() & 0xffff);
default:
logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x\n",cpu_get_pc(space->cpu),offset<<1);
@@ -125,7 +125,7 @@ WRITE16_HANDLER(galpanib_calc_w)
WRITE16_HANDLER(bloodwar_calc_w)
{
- int isbrap = ( !strcmp(space->machine->system().name,"brapboysj") || !strcmp(space->machine->system().name,"brapboys"));
+ int isbrap = ( !strcmp(space->machine().system().name,"brapboysj") || !strcmp(space->machine().system().name,"brapboys"));
/* our implementation is incomplete, b.rap boys requires some modifications */
if (isbrap)
@@ -200,7 +200,7 @@ READ16_HANDLER(bloodwar_calc_r)
INT16 x_coll, y_coll;
/* our implementation is incomplete, b.rap boys requires some modifications */
- int isbrap = ( !strcmp(space->machine->system().name,"brapboysj") || !strcmp(space->machine->system().name,"brapboys"));
+ int isbrap = ( !strcmp(space->machine().system().name,"brapboysj") || !strcmp(space->machine().system().name,"brapboys"));
if (isbrap)
{
@@ -243,7 +243,7 @@ READ16_HANDLER(bloodwar_calc_r)
return data;
case 0x14/2:
- return (space->machine->rand() & 0xffff);
+ return (space->machine().rand() & 0xffff);
case 0x20/2: return hit.x1p;
case 0x22/2: return hit.x1s;
@@ -488,7 +488,7 @@ static READ16_HANDLER(shogwarr_calc_r)
return shogwarr_hit.flags;
case 0x28:
- return (space->machine->rand() & 0xffff);
+ return (space->machine().rand() & 0xffff);
case 0x40: return shogwarr_hit.x1po;
case 0x44: return shogwarr_hit.x1so;
@@ -561,7 +561,7 @@ void calc3_mcu_init(void)
WRITE16_HANDLER( calc3_mcu_ram_w )
{
COMBINE_DATA(&kaneko16_mcu_ram[offset]);
- //calc3_mcu_run(space->machine);
+ //calc3_mcu_run(space->machine());
}
#define CALC3_MCU_COM_W(_n_) \
@@ -1708,14 +1708,14 @@ static UINT8 shift_bits(UINT8 dat, int bits)
}
// endian safe? you're having a laugh
-static int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset)
+static int calc3_decompress_table(running_machine& machine, int tabnum, UINT8* dstram, int dstoffset)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8* rom = machine->region("cpu1")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8* rom = machine.region("cpu1")->base();
UINT8 numregions;
UINT16 length;
int local_counter=0;
@@ -1814,7 +1814,7 @@ static int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* d
//printf("save to eeprom\n");
{
- address_space *eeprom_space = space->machine->device<eeprom_device>("eeprom")->space();
+ address_space *eeprom_space = space->machine().device<eeprom_device>("eeprom")->space();
for (i=0;i<0x80;i++)
{
@@ -2024,7 +2024,7 @@ static int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* d
DRIVER_INIT(calc3_scantables)
{
- UINT8* rom = machine->region("cpu1")->base();
+ UINT8* rom = machine.region("cpu1")->base();
UINT8 numregions;
int x;
@@ -2057,13 +2057,13 @@ DRIVER_INIT(calc3_scantables)
if (calc3_blocksize_offset==3)
{
sprintf(filename,"data_%s_table_%04x k%02x m%02x u%02x length %04x",
- machine->system().name,
+ machine.system().name,
x, calc3_decryption_key_byte, calc3_mode, calc3_alternateswaps, length);
}
else
{
sprintf(filename,"data_%s_table_%04x k%02x (use indirect size %02x) m%02x u%02x length %04x",
- machine->system().name,
+ machine.system().name,
x, calc3_decryption_key_byte, calc3_blocksize_offset-3, calc3_mode, calc3_alternateswaps, length);
}
@@ -2089,7 +2089,7 @@ DRIVER_INIT(calc3_scantables)
char filename[256];
sprintf(filename,"data_%s_finalblock",
- machine->system().name);
+ machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
@@ -2103,11 +2103,11 @@ DRIVER_INIT(calc3_scantables)
-void calc3_mcu_run(running_machine *machine)
+void calc3_mcu_run(running_machine &machine)
{
UINT16 mcu_command;
int i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if ( calc3_mcu_status != (1|2|4|8) ) return;
@@ -2121,7 +2121,7 @@ void calc3_mcu_run(running_machine *machine)
if (mcu_command == 0) return;
logerror("%s : MCU executed command at %04X: %04X\n",
- machine->describe_context(),calc3_mcu_command_offset,mcu_command);
+ machine.describe_context(),calc3_mcu_command_offset,mcu_command);
if (mcu_command>0)
@@ -2164,7 +2164,7 @@ void calc3_mcu_run(running_machine *machine)
*/
{
- address_space *eeprom_space = space->machine->device<eeprom_device>("eeprom")->space();
+ address_space *eeprom_space = space->machine().device<eeprom_device>("eeprom")->space();
for (i=0;i<0x80;i++)
{
@@ -2336,7 +2336,7 @@ static const UINT8 toybox_mcu_decryption_table_alt[0x100] = {
DRIVER_INIT( decrypt_toybox_rom )
{
- UINT8 *src = (UINT8 *)machine->region("mcudata" )->base();
+ UINT8 *src = (UINT8 *)machine.region("mcudata" )->base();
int i;
@@ -2349,7 +2349,7 @@ DRIVER_INIT( decrypt_toybox_rom )
{
FILE *fp;
char filename[256];
- sprintf(filename,"%s.mcudata", machine->system().name);
+ sprintf(filename,"%s.mcudata", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -2363,7 +2363,7 @@ DRIVER_INIT( decrypt_toybox_rom )
DRIVER_INIT( decrypt_toybox_rom_alt )
{
- UINT8 *src = (UINT8 *)machine->region("mcudata" )->base();
+ UINT8 *src = (UINT8 *)machine.region("mcudata" )->base();
int i;
@@ -2373,9 +2373,9 @@ DRIVER_INIT( decrypt_toybox_rom_alt )
}
}
-void toxboy_handle_04_subcommand(running_machine* machine,UINT8 mcu_subcmd, UINT16*mcu_ram)
+void toxboy_handle_04_subcommand(running_machine& machine,UINT8 mcu_subcmd, UINT16*mcu_ram)
{
- UINT8 *src = (UINT8 *)machine->region("mcudata")->base()+0x10000;
+ UINT8 *src = (UINT8 *)machine.region("mcudata")->base()+0x10000;
UINT8* dst = (UINT8 *)mcu_ram;
int offs = (mcu_subcmd&0x3f)*8;
@@ -2396,7 +2396,7 @@ void toxboy_handle_04_subcommand(running_machine* machine,UINT8 mcu_subcmd, UINT
}
-void (*toybox_mcu_run)(running_machine *machine);
+void (*toybox_mcu_run)(running_machine &machine);
static UINT16 toybox_mcu_com[4];
@@ -2415,7 +2415,7 @@ WRITE16_HANDLER( toybox_mcu_com##_n_##_w ) \
if (toybox_mcu_com[3] != 0xFFFF) return; \
\
memset(toybox_mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- toybox_mcu_run(space->machine); \
+ toybox_mcu_run(space->machine()); \
}
TOYBOX_MCU_COM_W(0)
@@ -2437,7 +2437,7 @@ READ16_HANDLER( toybox_mcu_status_r )
Blood Warrior
***************************************************************************/
-void bloodwar_mcu_run(running_machine *machine)
+void bloodwar_mcu_run(running_machine &machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
@@ -2448,27 +2448,27 @@ void bloodwar_mcu_run(running_machine *machine)
case 0x02: // Read from NVRAM
{
memcpy(&kaneko16_mcu_ram[mcu_offset], kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
- logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x42: // Write to NVRAM
{
memcpy(kaneko16_nvram_save, &kaneko16_mcu_ram[mcu_offset], sizeof(kaneko16_nvram_save));
- logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x03: // DSW
{
kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x04: // Protection
{
- logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data);
+ logerror("%s : MCU executed command: %04X %04X %04X\n", machine.describe_context(), mcu_command, mcu_offset*2, mcu_data);
toxboy_handle_04_subcommand(machine, mcu_data, kaneko16_mcu_ram);
@@ -2476,7 +2476,7 @@ void bloodwar_mcu_run(running_machine *machine)
break;
default:
- logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data);
+ logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine.describe_context(), mcu_command, mcu_offset*2, mcu_data);
break;
}
}
@@ -2485,7 +2485,7 @@ void bloodwar_mcu_run(running_machine *machine)
Bonk's Adventure
***************************************************************************/
-void bonkadv_mcu_run(running_machine *machine)
+void bonkadv_mcu_run(running_machine &machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
@@ -2497,34 +2497,34 @@ void bonkadv_mcu_run(running_machine *machine)
case 0x02: // Read from NVRAM
{
memcpy(&kaneko16_mcu_ram[mcu_offset], kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
- logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (load NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x42: // Write to NVRAM
{
memcpy(kaneko16_nvram_save, &kaneko16_mcu_ram[mcu_offset], sizeof(kaneko16_nvram_save));
- logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (save NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x43: // Initialize NVRAM - MCU writes Default Data Set directly to NVRAM
{
memcpy(kaneko16_nvram_save, bonkadv_mcu_43, sizeof(bonkadv_mcu_43));
- logerror("%s : MCU executed command: %04X %04X (restore default NVRAM settings)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (restore default NVRAM settings)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x03: // DSW
{
kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
case 0x04: // Protection
{
- logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data);
+ logerror("%s : MCU executed command: %04X %04X %04X\n", machine.describe_context(), mcu_command, mcu_offset*2, mcu_data);
switch(mcu_data)
@@ -2546,7 +2546,7 @@ void bonkadv_mcu_run(running_machine *machine)
break;
default:
- logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data);
+ logerror("%s : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", machine.describe_context(), mcu_command, mcu_offset*2, mcu_data);
break;
}
}
@@ -2563,13 +2563,13 @@ void bonkadv_mcu_run(running_machine *machine)
- Read the DSWs
*/
-void gtmr_mcu_run(running_machine *machine)
+void gtmr_mcu_run(running_machine &machine)
{
UINT16 mcu_command = kaneko16_mcu_ram[0x0010/2];
UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2;
UINT16 mcu_data = kaneko16_mcu_ram[0x0014/2];
- logerror("%s : MCU executed command: %04X %04X %04X\n", machine->describe_context(), mcu_command, mcu_offset*2, mcu_data);
+ logerror("%s : MCU executed command: %04X %04X %04X\n", machine.describe_context(), mcu_command, mcu_offset*2, mcu_data);
switch (mcu_command >> 8)
{
diff --git a/src/mame/machine/konami1.c b/src/mame/machine/konami1.c
index 6a96968a439..a7b5f39928c 100644
--- a/src/mame/machine/konami1.c
+++ b/src/mame/machine/konami1.c
@@ -40,11 +40,11 @@ static UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address )
-UINT8 *konami1_decode(running_machine *machine, const char *cpu)
+UINT8 *konami1_decode(running_machine &machine, const char *cpu)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
- const UINT8 *rom = machine->region(cpu)->base();
- int size = machine->region(cpu)->bytes();
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
+ const UINT8 *rom = machine.region(cpu)->base();
+ int size = machine.region(cpu)->bytes();
int A;
UINT8 *decrypted = auto_alloc_array(machine, UINT8, size);
diff --git a/src/mame/machine/konami1.h b/src/mame/machine/konami1.h
index 2ba323ee90e..1137e7a58cc 100644
--- a/src/mame/machine/konami1.h
+++ b/src/mame/machine/konami1.h
@@ -1 +1 @@
-UINT8 *konami1_decode(running_machine *machine, const char *cpu);
+UINT8 *konami1_decode(running_machine &machine, const char *cpu);
diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c
index b1c7f507b31..ba675d06aed 100644
--- a/src/mame/machine/konamigx.c
+++ b/src/mame/machine/konamigx.c
@@ -137,7 +137,7 @@ WRITE16_HANDLER( K055550_word_w )
else
if (dy < 0) i = 0x80;
else
- i = space->machine->rand() & 0xff; // vector direction indeterminate
+ i = space->machine().rand() & 0xff; // vector direction indeterminate
prot_data[0x10] = i;
break;
@@ -439,10 +439,10 @@ if((data1=obj[0])&0x80000000)\
static UINT32 fantjour_dma[8];
-void fantjour_dma_install(running_machine *machine)
+void fantjour_dma_install(running_machine &machine)
{
state_save_register_global_array(machine, fantjour_dma);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xdb0000, 0xdb001f, FUNC(fantjour_dma_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xdb0000, 0xdb001f, FUNC(fantjour_dma_w));
memset(fantjour_dma, 0, sizeof(fantjour_dma));
}
diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c
index 7ed257acdb5..32afb541b45 100644
--- a/src/mame/machine/konppc.c
+++ b/src/mame/machine/konppc.c
@@ -39,7 +39,7 @@ static UINT32 *nwk_ram[MAX_CG_BOARDS];
/*****************************************************************************/
-void init_konami_cgboard(running_machine *machine, int num_boards, int type)
+void init_konami_cgboard(running_machine &machine, int num_boards, int type)
{
int i;
num_cgboards = num_boards;
@@ -114,7 +114,7 @@ int get_cgboard_id(void)
}
}
-void set_cgboard_texture_bank(running_machine *machine, int board, const char *bank, UINT8 *rom)
+void set_cgboard_texture_bank(running_machine &machine, int board, const char *bank, UINT8 *rom)
{
texture_bank[board] = bank;
@@ -142,8 +142,8 @@ WRITE32_HANDLER( cgboard_dsp_comm_w_ppc )
{
const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2";
const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2";
- device_t *dsp = space->machine->device(dsptag);
- device_t *k033906 = space->machine->device(pcitag);
+ device_t *dsp = space->machine().device(dsptag);
+ device_t *k033906 = space->machine().device(pcitag);
// mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(space->cpu));
if (cgboard_id < MAX_CG_BOARDS)
@@ -198,7 +198,7 @@ WRITE32_HANDLER( cgboard_dsp_shared_w_ppc )
{
if (cgboard_id < MAX_CG_BOARDS)
{
- space->machine->scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround)
+ space->machine().scheduler().trigger(10000); // Remove the timeout (a part of the GTI Club FIFO test workaround)
COMBINE_DATA(dsp_shared_ram[cgboard_id] + (offset + (dsp_shared_ram_bank[cgboard_id] * DSP_BANK_SIZE_WORD)));
}
}
@@ -225,12 +225,12 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
case CGBOARD_TYPE_GTICLUB:
{
//cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG0, ASSERT_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 0, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 0, ASSERT_LINE);
if (offset == 1)
{
if (data & 0x03)
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_IRQ2, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_IRQ2, ASSERT_LINE);
}
break;
}
@@ -239,7 +239,7 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
case CGBOARD_TYPE_HANGPLT:
{
const char *dsptag = (board == 0) ? "dsp" : "dsp2";
- device_t *device = space->machine->device(dsptag);
+ device_t *device = space->machine().device(dsptag);
if (offset == 1)
{
@@ -254,7 +254,7 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
{
int offset = (data & 0x08) ? 1 : 0;
- memory_set_bank(space->machine, texture_bank[board], offset);
+ memory_set_bank(space->machine(), texture_bank[board], offset);
}
}
break;
@@ -268,14 +268,14 @@ static void dsp_comm_sharc_w(address_space *space, int board, int offset, UINT32
{
int offset = (data & 0x08) ? 1 : 0;
- memory_set_bank(space->machine, texture_bank[board], offset);
+ memory_set_bank(space->machine(), texture_bank[board], offset);
}
}
break;
}
}
-// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", space->machine->describe_context(), data, offset, mem_mask);
+// printf("%s:cgboard_dsp_comm_w_sharc: %08X, %08X, %08X\n", space->machine().describe_context(), data, offset, mem_mask);
dsp_comm_sharc[board][offset] = data;
}
@@ -354,7 +354,7 @@ WRITE32_HANDLER( cgboard_1_shared_sharc_w )
static UINT32 nwk_fifo_r(address_space *space, int board)
{
const char *dsptag = (board == 0) ? "dsp" : "dsp2";
- device_t *device = space->machine->device(dsptag);
+ device_t *device = space->machine().device(dsptag);
UINT32 data;
if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r)
@@ -382,10 +382,10 @@ static UINT32 nwk_fifo_r(address_space *space, int board)
return data;
}
-static void nwk_fifo_w(running_machine *machine, int board, UINT32 data)
+static void nwk_fifo_w(running_machine &machine, int board, UINT32 data)
{
const char *dsptag = (board == 0) ? "dsp" : "dsp2";
- device_t *device = machine->device(dsptag);
+ device_t *device = machine.device(dsptag);
if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w)
{
@@ -409,7 +409,7 @@ static void nwk_fifo_w(running_machine *machine, int board, UINT32 data)
READ32_HANDLER( K033906_0_r )
{
- device_t *k033906_1 = space->machine->device("k033906_1");
+ device_t *k033906_1 = space->machine().device("k033906_1");
if (nwk_device_sel[0] & 0x01)
return nwk_fifo_r(space, 0);
else
@@ -418,13 +418,13 @@ READ32_HANDLER( K033906_0_r )
WRITE32_HANDLER( K033906_0_w )
{
- device_t *k033906_1 = space->machine->device("k033906_1");
+ device_t *k033906_1 = space->machine().device("k033906_1");
k033906_w(k033906_1, offset, data, mem_mask);
}
READ32_HANDLER( K033906_1_r )
{
- device_t *k033906_2 = space->machine->device("k033906_2");
+ device_t *k033906_2 = space->machine().device("k033906_2");
if (nwk_device_sel[1] & 0x01)
return nwk_fifo_r(space, 1);
else
@@ -433,7 +433,7 @@ READ32_HANDLER( K033906_1_r )
WRITE32_HANDLER(K033906_1_w)
{
- device_t *k033906_2 = space->machine->device("k033906_2");
+ device_t *k033906_2 = space->machine().device("k033906_2");
k033906_w(k033906_2, offset, data, mem_mask);
}
@@ -443,7 +443,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
- nwk_fifo_w(device->machine, 0, data);
+ nwk_fifo_w(device->machine(), 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@@ -460,7 +460,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
- nwk_fifo_w(device->machine, 1, data);
+ nwk_fifo_w(device->machine(), 1, data);
}
else if (nwk_device_sel[1] & 0x02)
{
@@ -501,7 +501,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
- nwk_fifo_w(device->machine, 0, data);
+ nwk_fifo_w(device->machine(), 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@@ -518,7 +518,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
- nwk_fifo_w(device->machine, 1, data);
+ nwk_fifo_w(device->machine(), 1, data);
}
else if (nwk_device_sel[1] & 0x02)
{
diff --git a/src/mame/machine/konppc.h b/src/mame/machine/konppc.h
index 5e691f101b7..ea33e08aeea 100644
--- a/src/mame/machine/konppc.h
+++ b/src/mame/machine/konppc.h
@@ -7,10 +7,10 @@
#define CGBOARD_TYPE_HORNET 3
#define CGBOARD_TYPE_HANGPLT 4
-void init_konami_cgboard(running_machine *machine, int board_id, int type);
+void init_konami_cgboard(running_machine &machine, int board_id, int type);
void set_cgboard_id(int board_id);
int get_cgboard_id(void);
-void set_cgboard_texture_bank(running_machine *machine, int board, const char *bank, UINT8 *rom);
+void set_cgboard_texture_bank(running_machine &machine, int board, const char *bank, UINT8 *rom);
READ32_HANDLER( cgboard_dsp_comm_r_ppc );
WRITE32_HANDLER( cgboard_dsp_comm_w_ppc );
diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c
index 82c4f36ddd9..b44741471c3 100644
--- a/src/mame/machine/leland.c
+++ b/src/mame/machine/leland.c
@@ -44,9 +44,9 @@ static TIMER_CALLBACK( ataxx_interrupt_callback );
*
*************************************/
-static int dial_compute_value(running_machine *machine, int new_val, int indx)
+static int dial_compute_value(running_machine &machine, int new_val, int indx)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
int delta = new_val - (int)state->dial_last_input[indx];
UINT8 result = state->dial_last_result[indx] & 0x80;
@@ -83,16 +83,16 @@ static int dial_compute_value(running_machine *machine, int new_val, int indx)
READ8_HANDLER( cerberus_dial_1_r )
{
- int original = input_port_read(space->machine, "IN0");
- int modified = dial_compute_value(space->machine, input_port_read(space->machine, "AN0"), 0);
+ int original = input_port_read(space->machine(), "IN0");
+ int modified = dial_compute_value(space->machine(), input_port_read(space->machine(), "AN0"), 0);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
READ8_HANDLER( cerberus_dial_2_r )
{
- int original = input_port_read(space->machine, "IN0");
- int modified = dial_compute_value(space->machine, input_port_read(space->machine, "AN1"), 1);
+ int original = input_port_read(space->machine(), "IN0");
+ int modified = dial_compute_value(space->machine(), input_port_read(space->machine(), "AN1"), 1);
return (original & 0xc0) | ((modified & 0x80) >> 2) | (modified & 0x1f);
}
@@ -107,7 +107,7 @@ READ8_HANDLER( cerberus_dial_2_r )
WRITE8_HANDLER( alleymas_joystick_kludge )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
/* catch the case where they clear this memory location at PC $1827 and change */
/* the value written to be a 1 */
if (cpu_get_previouspc(space->cpu) == 0x1827)
@@ -134,9 +134,9 @@ WRITE8_HANDLER( alleymas_joystick_kludge )
*
*************************************/
-static void update_dangerz_xy(running_machine *machine)
+static void update_dangerz_xy(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
UINT8 newy = input_port_read(machine, "AN0");
UINT8 newx = input_port_read(machine, "AN1");
int deltay = newy - state->dial_last_input[0];
@@ -161,24 +161,24 @@ static void update_dangerz_xy(running_machine *machine)
READ8_HANDLER( dangerz_input_y_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
- update_dangerz_xy(space->machine);
+ leland_state *state = space->machine().driver_data<leland_state>();
+ update_dangerz_xy(space->machine());
return state->dangerz_y & 0xff;
}
READ8_HANDLER( dangerz_input_x_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
- update_dangerz_xy(space->machine);
+ leland_state *state = space->machine().driver_data<leland_state>();
+ update_dangerz_xy(space->machine());
return state->dangerz_x & 0xff;
}
READ8_HANDLER( dangerz_input_upper_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
- update_dangerz_xy(space->machine);
+ leland_state *state = space->machine().driver_data<leland_state>();
+ update_dangerz_xy(space->machine());
return ((state->dangerz_y >> 2) & 0xc0) | ((state->dangerz_x >> 8) & 0x03);
}
@@ -194,27 +194,27 @@ static const UINT8 redline_pedal_value[8] = { 0xf0, 0xe0, 0xc0, 0xd0, 0x90, 0xb0
READ8_HANDLER( redline_pedal_1_r )
{
- int pedal = input_port_read(space->machine, "IN0");
+ int pedal = input_port_read(space->machine(), "IN0");
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_HANDLER( redline_pedal_2_r )
{
- int pedal = input_port_read(space->machine, "IN2");
+ int pedal = input_port_read(space->machine(), "IN2");
return redline_pedal_value[pedal >> 5] | 0x0f;
}
READ8_HANDLER( redline_wheel_1_r )
{
- return dial_compute_value(space->machine, input_port_read(space->machine, "AN0"), 0);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), "AN0"), 0);
}
READ8_HANDLER( redline_wheel_2_r )
{
- return dial_compute_value(space->machine, input_port_read(space->machine, "AN1"), 1);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), "AN1"), 1);
}
@@ -227,19 +227,19 @@ READ8_HANDLER( redline_wheel_2_r )
READ8_HANDLER( offroad_wheel_1_r )
{
- return dial_compute_value(space->machine, input_port_read(space->machine, "AN3"), 0);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), "AN3"), 0);
}
READ8_HANDLER( offroad_wheel_2_r )
{
- return dial_compute_value(space->machine, input_port_read(space->machine, "AN4"), 1);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), "AN4"), 1);
}
READ8_HANDLER( offroad_wheel_3_r )
{
- return dial_compute_value(space->machine, input_port_read(space->machine, "AN5"), 2);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), "AN5"), 2);
}
@@ -254,7 +254,7 @@ READ8_HANDLER( ataxx_trackball_r )
{
static const char *const tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
- return dial_compute_value(space->machine, input_port_read(space->machine, tracknames[offset]), offset);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), tracknames[offset]), offset);
}
@@ -269,13 +269,13 @@ READ8_HANDLER( indyheat_wheel_r )
{
static const char *const tracknames[] = { "AN0", "AN1", "AN2" };
- return dial_compute_value(space->machine, input_port_read(space->machine, tracknames[offset]), offset);
+ return dial_compute_value(space->machine(), input_port_read(space->machine(), tracknames[offset]), offset);
}
READ8_HANDLER( indyheat_analog_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
switch (offset)
{
case 0:
@@ -297,13 +297,13 @@ READ8_HANDLER( indyheat_analog_r )
WRITE8_HANDLER( indyheat_analog_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
static const char *const tracknames[] = { "AN3", "AN4", "AN5" };
switch (offset)
{
case 3:
- state->analog_result = input_port_read(space->machine, tracknames[data]);
+ state->analog_result = input_port_read(space->machine(), tracknames[data]);
break;
case 0:
@@ -324,23 +324,23 @@ WRITE8_HANDLER( indyheat_analog_w )
MACHINE_START( leland )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* allocate extra stuff */
- state->battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(*machine, "battery"));
+ state->battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(machine, "battery"));
/* start scanline interrupts going */
- state->master_int_timer = machine->scheduler().timer_alloc(FUNC(leland_interrupt_callback));
+ state->master_int_timer = machine.scheduler().timer_alloc(FUNC(leland_interrupt_callback));
}
MACHINE_RESET( leland )
{
- leland_state *state = machine->driver_data<leland_state>();
- state->master_int_timer->adjust(machine->primary_screen->time_until_pos(8), 8);
+ leland_state *state = machine.driver_data<leland_state>();
+ state->master_int_timer->adjust(machine.primary_screen->time_until_pos(8), 8);
/* reset globals */
state->gfx_control = 0x00;
- leland_sound_port_w(machine->device("ay8910.1"), 0, 0xff);
+ leland_sound_port_w(machine.device("ay8910.1"), 0, 0xff);
state->wcol_enable = 0;
state->dangerz_x = 512;
@@ -360,13 +360,13 @@ MACHINE_RESET( leland )
state->alternate_bank = 0;
/* initialize the master banks */
- state->master_length = machine->region("master")->bytes();
- state->master_base = machine->region("master")->base();
+ state->master_length = machine.region("master")->bytes();
+ state->master_base = machine.region("master")->base();
(*state->update_master_bank)(machine);
/* initialize the slave banks */
- state->slave_length = machine->region("slave")->bytes();
- state->slave_base = machine->region("slave")->base();
+ state->slave_length = machine.region("slave")->bytes();
+ state->slave_base = machine.region("slave")->base();
if (state->slave_length > 0x10000)
memory_set_bankptr(machine, "bank3", &state->slave_base[0x10000]);
}
@@ -374,25 +374,25 @@ MACHINE_RESET( leland )
MACHINE_START( ataxx )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* set the odd data banks */
- state->battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(*machine, "battery"));
+ state->battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(machine, "battery"));
state->extra_tram = auto_alloc_array(machine, UINT8, ATAXX_EXTRA_TRAM_SIZE);
/* start scanline interrupts going */
- state->master_int_timer = machine->scheduler().timer_alloc(FUNC(ataxx_interrupt_callback));
+ state->master_int_timer = machine.scheduler().timer_alloc(FUNC(ataxx_interrupt_callback));
}
MACHINE_RESET( ataxx )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
memset(state->extra_tram, 0, ATAXX_EXTRA_TRAM_SIZE);
- state->master_int_timer->adjust(machine->primary_screen->time_until_pos(8), 8);
+ state->master_int_timer->adjust(machine.primary_screen->time_until_pos(8), 8);
/* initialize the XROM */
- state->xrom_length = machine->region("user1")->bytes();
- state->xrom_base = machine->region("user1")->base();
+ state->xrom_length = machine.region("user1")->bytes();
+ state->xrom_base = machine.region("user1")->base();
state->xrom1_addr = 0;
state->xrom2_addr = 0;
@@ -406,13 +406,13 @@ MACHINE_RESET( ataxx )
state->master_bank = 0;
/* initialize the master banks */
- state->master_length = machine->region("master")->bytes();
- state->master_base = machine->region("master")->base();
+ state->master_length = machine.region("master")->bytes();
+ state->master_base = machine.region("master")->base();
ataxx_bankswitch(machine);
/* initialize the slave banks */
- state->slave_length = machine->region("slave")->bytes();
- state->slave_base = machine->region("slave")->base();
+ state->slave_length = machine.region("slave")->bytes();
+ state->slave_base = machine.region("slave")->base();
if (state->slave_length > 0x10000)
memory_set_bankptr(machine, "bank3", &state->slave_base[0x10000]);
}
@@ -427,7 +427,7 @@ MACHINE_RESET( ataxx )
static TIMER_CALLBACK( leland_interrupt_callback )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
int scanline = param;
/* interrupts generated on the VA10 line, which is every */
@@ -438,27 +438,27 @@ static TIMER_CALLBACK( leland_interrupt_callback )
scanline += 16;
if (scanline > 248)
scanline = 8;
- state->master_int_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->master_int_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static TIMER_CALLBACK( ataxx_interrupt_callback )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
int scanline = param;
/* interrupts generated according to the interrupt control register */
cputag_set_input_line(machine, "master", 0, HOLD_LINE);
/* set a timer for the next one */
- state->master_int_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->master_int_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
INTERRUPT_GEN( leland_master_interrupt )
{
/* check for coins here */
- if ((input_port_read(device->machine, "IN1") & 0x0e) != 0x0e)
+ if ((input_port_read(device->machine(), "IN1") & 0x0e) != 0x0e)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
}
@@ -472,30 +472,30 @@ INTERRUPT_GEN( leland_master_interrupt )
WRITE8_HANDLER( leland_master_alt_bankswitch_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
/* update any bankswitching */
if (LOG_BANKSWITCHING_M)
if ((state->alternate_bank ^ data) & 0x0f)
logerror("%04X:alternate_bank = %02X\n", cpu_get_pc(space->cpu), data & 0x0f);
state->alternate_bank = data & 15;
- (*state->update_master_bank)(space->machine);
+ (*state->update_master_bank)(space->machine());
/* sound control is in the rest */
- leland_80186_control_w(space->machine->device("custom"), offset, data);
+ leland_80186_control_w(space->machine().device("custom"), offset, data);
}
/* bankswitching for Cerberus */
-void cerberus_bankswitch(running_machine *machine)
+void cerberus_bankswitch(running_machine &machine)
{
/* no bankswitching */
}
/* bankswitching for Mayhem 2002, Power Play, World Series Baseball, and Alley Master */
-void mayhem_bankswitch(running_machine *machine)
+void mayhem_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
UINT8 *address;
state->battery_ram_enable = ((state->sound_port_bank & 0x24) == 0);
@@ -509,9 +509,9 @@ void mayhem_bankswitch(running_machine *machine)
/* bankswitching for Danger Zone */
-void dangerz_bankswitch(running_machine *machine)
+void dangerz_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
UINT8 *address;
state->battery_ram_enable = ((state->top_board_bank & 0x80) != 0);
@@ -525,9 +525,9 @@ void dangerz_bankswitch(running_machine *machine)
/* bankswitching for Baseball the Season II, Super Baseball, and Strike Zone */
-void basebal2_bankswitch(running_machine *machine)
+void basebal2_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
UINT8 *address;
state->battery_ram_enable = (state->top_board_bank & 0x80);
@@ -544,9 +544,9 @@ void basebal2_bankswitch(running_machine *machine)
/* bankswitching for Red Line Racer */
-void redline_bankswitch(running_machine *machine)
+void redline_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
static const UINT32 bank_list[] = { 0x10000, 0x18000, 0x02000, 0x02000 };
UINT8 *address;
@@ -561,9 +561,9 @@ void redline_bankswitch(running_machine *machine)
/* bankswitching for Viper, Quarterback, Team Quarterback, and All American Football */
-void viper_bankswitch(running_machine *machine)
+void viper_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
static const UINT32 bank_list[] = { 0x02000, 0x10000, 0x18000, 0x02000 };
UINT8 *address;
@@ -572,7 +572,7 @@ void viper_bankswitch(running_machine *machine)
address = &state->master_base[bank_list[state->alternate_bank & 3]];
if (bank_list[state->alternate_bank & 3] >= state->master_length)
{
- logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), state->alternate_bank & 3);
+ logerror("%s:Master bank %02X out of range!\n", machine.describe_context(), state->alternate_bank & 3);
address = &state->master_base[bank_list[0]];
}
memory_set_bankptr(machine, "bank1", address);
@@ -583,9 +583,9 @@ void viper_bankswitch(running_machine *machine)
/* bankswitching for Super Offroad, Super Offroad Track Pack, and Pig Out */
-void offroad_bankswitch(running_machine *machine)
+void offroad_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
static const UINT32 bank_list[] = { 0x02000, 0x02000, 0x10000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000 };
UINT8 *address;
@@ -594,7 +594,7 @@ void offroad_bankswitch(running_machine *machine)
address = &state->master_base[bank_list[state->alternate_bank & 7]];
if (bank_list[state->alternate_bank & 7] >= state->master_length)
{
- logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), state->alternate_bank & 7);
+ logerror("%s:Master bank %02X out of range!\n", machine.describe_context(), state->alternate_bank & 7);
address = &state->master_base[bank_list[0]];
}
memory_set_bankptr(machine, "bank1", address);
@@ -605,9 +605,9 @@ void offroad_bankswitch(running_machine *machine)
/* bankswitching for Ataxx, WSF, Indy Heat, and Brute Force */
-void ataxx_bankswitch(running_machine *machine)
+void ataxx_bankswitch(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
static const UINT32 bank_list[] =
{
0x02000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000, 0x40000, 0x48000,
@@ -620,7 +620,7 @@ void ataxx_bankswitch(running_machine *machine)
address = &state->master_base[bank_list[state->master_bank & 15]];
if (bank_list[state->master_bank & 15] >= state->master_length)
{
- logerror("%s:Master bank %02X out of range!\n", machine->describe_context(), state->master_bank & 15);
+ logerror("%s:Master bank %02X out of range!\n", machine.describe_context(), state->master_bank & 15);
address = &state->master_base[bank_list[0]];
}
memory_set_bankptr(machine, "bank1", address);
@@ -644,7 +644,7 @@ void ataxx_bankswitch(running_machine *machine)
*
*************************************/
-void leland_init_eeprom(running_machine *machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type)
+void leland_init_eeprom(running_machine &machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type)
{
UINT8 xorval = (serial_type == SERIAL_TYPE_ADD_XOR || serial_type == SERIAL_TYPE_ENCRYPT_XOR) ? 0xff : 0x00;
UINT8 eeprom_data[64*2];
@@ -755,7 +755,7 @@ void leland_init_eeprom(running_machine *machine, UINT8 default_val, const UINT1
*
*************************************/
-void ataxx_init_eeprom(running_machine *machine, const UINT16 *data)
+void ataxx_init_eeprom(running_machine &machine, const UINT16 *data)
{
UINT8 eeprom_data[128*2];
UINT8 serial_offset = 0;
@@ -831,15 +831,15 @@ void ataxx_init_eeprom(running_machine *machine, const UINT16 *data)
READ8_DEVICE_HANDLER( ataxx_eeprom_r )
{
- int port = input_port_read(device->machine, "IN2");
- if (LOG_EEPROM) logerror("%s:EE read\n", device->machine->describe_context());
+ int port = input_port_read(device->machine(), "IN2");
+ if (LOG_EEPROM) logerror("%s:EE read\n", device->machine().describe_context());
return port;
}
WRITE8_DEVICE_HANDLER( ataxx_eeprom_w )
{
- if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", device->machine->describe_context(),
+ if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", device->machine().describe_context(),
(data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
eeprom_write_bit (device, (data & 0x10) >> 4);
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
@@ -856,7 +856,7 @@ WRITE8_DEVICE_HANDLER( ataxx_eeprom_w )
WRITE8_HANDLER( leland_battery_ram_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->battery_ram_enable)
{
if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", cpu_get_pc(space->cpu), offset, data);
@@ -869,7 +869,7 @@ WRITE8_HANDLER( leland_battery_ram_w )
WRITE8_HANDLER( ataxx_battery_ram_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->battery_ram_enable)
{
if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", cpu_get_pc(space->cpu), offset, data);
@@ -931,12 +931,12 @@ WRITE8_HANDLER( ataxx_battery_ram_w )
--------------------------------------------------------------------*/
-static int keycard_r(running_machine *machine)
+static int keycard_r(running_machine &machine)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
int result = 0;
- if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_r)\n", machine->describe_context());
+ if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_r)\n", machine.describe_context());
/* if we have a valid keycard read state, we're reading from the keycard */
if (state->keycard_state & 0x80)
@@ -955,13 +955,13 @@ static int keycard_r(running_machine *machine)
return result;
}
-static void keycard_w(running_machine *machine, int data)
+static void keycard_w(running_machine &machine, int data)
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
int new_state = data & 0xb0;
int new_clock = data & 0x40;
- if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_w=%02X)\n", machine->describe_context(), data);
+ if (LOG_KEYCARDS_FULL) logerror(" (%s:keycard_w=%02X)\n", machine.describe_context(), data);
/* check for going active */
if (!state->keycard_state && new_state)
@@ -1033,7 +1033,7 @@ static void keycard_w(running_machine *machine, int data)
READ8_HANDLER( leland_master_analog_key_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
int result = 0;
switch (offset)
@@ -1048,7 +1048,7 @@ READ8_HANDLER( leland_master_analog_key_r )
break;
case 0x02: /* FF = keycard serial data read */
- result = keycard_r(space->machine);
+ result = keycard_r(space->machine());
/* bit 7 indicates the analog input is busy for some games */
result &= ~0x80;
@@ -1061,7 +1061,7 @@ READ8_HANDLER( leland_master_analog_key_r )
WRITE8_HANDLER( leland_master_analog_key_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
switch (offset)
@@ -1070,18 +1070,18 @@ WRITE8_HANDLER( leland_master_analog_key_w )
break;
case 0x01: /* FE = analog port select/bankswitch */
- state->analog_result = input_port_read(space->machine, portnames[data & 15]);
+ state->analog_result = input_port_read(space->machine(), portnames[data & 15]);
/* update top board banking for some games */
if (LOG_BANKSWITCHING_M)
if ((state->top_board_bank ^ data) & 0xc0)
logerror("%04X:top_board_bank = %02X\n", cpu_get_pc(space->cpu), data & 0xc0);
state->top_board_bank = data & 0xc0;
- (*state->update_master_bank)(space->machine);
+ (*state->update_master_bank)(space->machine());
break;
case 0x02: /* FF = keycard data write */
- keycard_w(space->machine, data);
+ keycard_w(space->machine(), data);
break;
}
}
@@ -1101,31 +1101,31 @@ READ8_HANDLER( leland_master_input_r )
switch (offset)
{
case 0x00: /* /GIN0 */
- result = input_port_read(space->machine, "IN0");
+ result = input_port_read(space->machine(), "IN0");
break;
case 0x01: /* /GIN1 */
- result = input_port_read(space->machine, "IN1");
- if (cpu_get_reg(space->machine->device("slave"), Z80_HALT))
+ result = input_port_read(space->machine(), "IN1");
+ if (cpu_get_reg(space->machine().device("slave"), Z80_HALT))
result ^= 0x01;
break;
case 0x02: /* /GIN2 */
case 0x12:
- cputag_set_input_line(space->machine, "master", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "master", INPUT_LINE_NMI, CLEAR_LINE);
break;
case 0x03: /* /IGID */
case 0x13:
- result = ay8910_r(space->machine->device("ay8910.1"), offset);
+ result = ay8910_r(space->machine().device("ay8910.1"), offset);
break;
case 0x10: /* /GIN0 */
- result = input_port_read(space->machine, "IN2");
+ result = input_port_read(space->machine(), "IN2");
break;
case 0x11: /* /GIN1 */
- result = input_port_read(space->machine, "IN3");
+ result = input_port_read(space->machine(), "IN3");
if (LOG_EEPROM) logerror("%04X:EE read\n", cpu_get_pc(space->cpu));
break;
@@ -1139,18 +1139,18 @@ READ8_HANDLER( leland_master_input_r )
WRITE8_HANDLER( leland_master_output_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
device_t *eeprom;
switch (offset)
{
case 0x09: /* /MCONT */
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
state->wcol_enable = (data & 0x02);
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
- eeprom = space->machine->device("eeprom");
+ eeprom = space->machine().device("eeprom");
if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", cpu_get_pc(space->cpu),
(data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
eeprom_write_bit (eeprom, (data & 0x10) >> 4);
@@ -1160,7 +1160,7 @@ WRITE8_HANDLER( leland_master_output_w )
case 0x0a: /* /OGIA */
case 0x0b: /* /OGID */
- ay8910_address_data_w(space->machine->device("ay8910.1"), offset, data);
+ ay8910_address_data_w(space->machine().device("ay8910.1"), offset, data);
break;
case 0x0c: /* /BKXL */
@@ -1184,12 +1184,12 @@ READ8_HANDLER( ataxx_master_input_r )
switch (offset)
{
case 0x06: /* /GIN0 */
- result = input_port_read(space->machine, "IN0");
+ result = input_port_read(space->machine(), "IN0");
break;
case 0x07: /* /SLVBLK */
- result = input_port_read(space->machine, "IN1");
- if (cpu_get_reg(space->machine->device("slave"), Z80_HALT))
+ result = input_port_read(space->machine(), "IN1");
+ if (cpu_get_reg(space->machine().device("slave"), Z80_HALT))
result ^= 0x01;
break;
@@ -1203,7 +1203,7 @@ READ8_HANDLER( ataxx_master_input_r )
WRITE8_HANDLER( ataxx_master_output_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
switch (offset)
{
case 0x00: /* /BKXL */
@@ -1218,17 +1218,17 @@ WRITE8_HANDLER( ataxx_master_output_w )
if ((state->master_bank ^ data) & 0xff)
logerror("%04X:master_bank = %02X\n", cpu_get_pc(space->cpu), data & 0xff);
state->master_bank = data;
- ataxx_bankswitch(space->machine);
+ ataxx_bankswitch(space->machine());
break;
case 0x05: /* /SLV0 */
- cputag_set_input_line(space->machine, "slave", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x08: /* */
- state->master_int_timer->adjust(space->machine->primary_screen->time_until_pos(data + 1), data + 1);
+ state->master_int_timer->adjust(space->machine().primary_screen->time_until_pos(data + 1), data + 1);
break;
default:
@@ -1247,7 +1247,7 @@ WRITE8_HANDLER( ataxx_master_output_w )
WRITE8_HANDLER( leland_gated_paletteram_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->wcol_enable)
paletteram_BBGGGRRR_w(space, offset, data);
}
@@ -1255,16 +1255,16 @@ WRITE8_HANDLER( leland_gated_paletteram_w )
READ8_HANDLER( leland_gated_paletteram_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->wcol_enable)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
return 0xff;
}
WRITE8_HANDLER( ataxx_paletteram_and_misc_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->wcol_enable)
paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset, data);
else if (offset == 0x7f8 || offset == 0x7f9)
@@ -1296,9 +1296,9 @@ WRITE8_HANDLER( ataxx_paletteram_and_misc_w )
READ8_HANDLER( ataxx_paletteram_and_misc_r )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
if (state->wcol_enable)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else if (offset == 0x7fc || offset == 0x7fd)
{
int result = state->xrom_base[0x00000 | state->xrom1_addr | ((offset & 1) << 16)];
@@ -1325,14 +1325,14 @@ READ8_HANDLER( ataxx_paletteram_and_misc_r )
READ8_DEVICE_HANDLER( leland_sound_port_r )
{
- leland_state *state = device->machine->driver_data<leland_state>();
+ leland_state *state = device->machine().driver_data<leland_state>();
return state->gfx_control;
}
WRITE8_DEVICE_HANDLER( leland_sound_port_w )
{
- leland_state *state = device->machine->driver_data<leland_state>();
+ leland_state *state = device->machine().driver_data<leland_state>();
/* update the graphics banking */
leland_gfx_port_w(device, 0, data);
@@ -1343,9 +1343,9 @@ WRITE8_DEVICE_HANDLER( leland_sound_port_w )
/* some bankswitching occurs here */
if (LOG_BANKSWITCHING_M)
if ((state->sound_port_bank ^ data) & 0x24)
- logerror("%s:sound_port_bank = %02X\n", device->machine->describe_context(), data & 0x24);
+ logerror("%s:sound_port_bank = %02X\n", device->machine().describe_context(), data & 0x24);
state->sound_port_bank = data & 0x24;
- (*state->update_master_bank)(device->machine);
+ (*state->update_master_bank)(device->machine());
}
@@ -1358,7 +1358,7 @@ WRITE8_DEVICE_HANDLER( leland_sound_port_w )
WRITE8_HANDLER( leland_slave_small_banksw_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
int bankaddress = 0x10000 + 0xc000 * (data & 1);
if (bankaddress >= state->slave_length)
@@ -1366,7 +1366,7 @@ WRITE8_HANDLER( leland_slave_small_banksw_w )
logerror("%04X:Slave bank %02X out of range!", cpu_get_pc(space->cpu), data & 1);
bankaddress = 0x10000;
}
- memory_set_bankptr(space->machine, "bank3", &state->slave_base[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank3", &state->slave_base[bankaddress]);
if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", cpu_get_pc(space->cpu), data & 1, bankaddress);
}
@@ -1374,7 +1374,7 @@ WRITE8_HANDLER( leland_slave_small_banksw_w )
WRITE8_HANDLER( leland_slave_large_banksw_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
int bankaddress = 0x10000 + 0x8000 * (data & 15);
if (bankaddress >= state->slave_length)
@@ -1382,7 +1382,7 @@ WRITE8_HANDLER( leland_slave_large_banksw_w )
logerror("%04X:Slave bank %02X out of range!", cpu_get_pc(space->cpu), data & 15);
bankaddress = 0x10000;
}
- memory_set_bankptr(space->machine, "bank3", &state->slave_base[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank3", &state->slave_base[bankaddress]);
if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", cpu_get_pc(space->cpu), data & 15, bankaddress);
}
@@ -1390,7 +1390,7 @@ WRITE8_HANDLER( leland_slave_large_banksw_w )
WRITE8_HANDLER( ataxx_slave_banksw_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
+ leland_state *state = space->machine().driver_data<leland_state>();
int bankaddress, bank = data & 15;
if (bank == 0)
@@ -1407,7 +1407,7 @@ WRITE8_HANDLER( ataxx_slave_banksw_w )
logerror("%04X:Slave bank %02X out of range!", cpu_get_pc(space->cpu), data & 0x3f);
bankaddress = 0x2000;
}
- memory_set_bankptr(space->machine, "bank3", &state->slave_base[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank3", &state->slave_base[bankaddress]);
if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", cpu_get_pc(space->cpu), data, bankaddress);
}
@@ -1422,7 +1422,7 @@ WRITE8_HANDLER( ataxx_slave_banksw_w )
READ8_HANDLER( leland_raster_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -1434,11 +1434,11 @@ READ8_HANDLER( leland_raster_r )
*************************************/
/* also called by Ataxx */
-void leland_rotate_memory(running_machine *machine, const char *cpuname)
+void leland_rotate_memory(running_machine &machine, const char *cpuname)
{
int startaddr = 0x10000;
- int banks = (machine->region(cpuname)->bytes() - startaddr) / 0x8000;
- UINT8 *ram = machine->region(cpuname)->base();
+ int banks = (machine.region(cpuname)->bytes() - startaddr) / 0x8000;
+ UINT8 *ram = machine.region(cpuname)->base();
UINT8 temp[0x2000];
int i;
diff --git a/src/mame/machine/lkage.c b/src/mame/machine/lkage.c
index fb35ceac173..c2f01d46895 100644
--- a/src/mame/machine/lkage.c
+++ b/src/mame/machine/lkage.c
@@ -22,7 +22,7 @@
READ8_HANDLER( lkage_68705_port_a_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
@@ -30,7 +30,7 @@ READ8_HANDLER( lkage_68705_port_a_r )
WRITE8_HANDLER( lkage_68705_port_a_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
@@ -38,7 +38,7 @@ WRITE8_HANDLER( lkage_68705_port_a_w )
WRITE8_HANDLER( lkage_68705_ddr_a_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->ddr_a = data;
}
@@ -55,13 +55,13 @@ WRITE8_HANDLER( lkage_68705_ddr_a_w )
READ8_HANDLER( lkage_68705_port_b_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( lkage_68705_port_b_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
//logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data);
@@ -87,7 +87,7 @@ WRITE8_HANDLER( lkage_68705_port_b_w )
WRITE8_HANDLER( lkage_68705_ddr_b_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->ddr_b = data;
}
@@ -95,7 +95,7 @@ WRITE8_HANDLER( lkage_68705_ddr_b_w )
READ8_HANDLER( lkage_68705_port_c_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->port_c_in = 0;
if (state->main_sent)
@@ -109,7 +109,7 @@ READ8_HANDLER( lkage_68705_port_c_r )
WRITE8_HANDLER( lkage_68705_port_c_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data);
state->port_c_out = data;
@@ -117,14 +117,14 @@ WRITE8_HANDLER( lkage_68705_port_c_w )
WRITE8_HANDLER( lkage_68705_ddr_c_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->ddr_c = data;
}
WRITE8_HANDLER( lkage_mcu_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_main = data;
@@ -134,7 +134,7 @@ WRITE8_HANDLER( lkage_mcu_w )
READ8_HANDLER( lkage_mcu_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
logerror("%04x: mcu_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu);
state->mcu_sent = 0;
@@ -143,7 +143,7 @@ READ8_HANDLER( lkage_mcu_r )
READ8_HANDLER( lkage_mcu_status_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
int res = 0;
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
diff --git a/src/mame/machine/lsasquad.c b/src/mame/machine/lsasquad.c
index 42b03107316..cefe78f1e1f 100644
--- a/src/mame/machine/lsasquad.c
+++ b/src/mame/machine/lsasquad.c
@@ -10,7 +10,7 @@
static TIMER_CALLBACK( nmi_callback )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -20,13 +20,13 @@ static TIMER_CALLBACK( nmi_callback )
WRITE8_HANDLER( lsasquad_sh_nmi_disable_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_nmi_enable = 0;
}
WRITE8_HANDLER( lsasquad_sh_nmi_enable_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -38,17 +38,17 @@ WRITE8_HANDLER( lsasquad_sh_nmi_enable_w )
WRITE8_HANDLER( lsasquad_sound_command_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_pending |= 0x01;
state->sound_cmd = data;
//logerror("%04x: sound cmd %02x\n", cpu_get_pc(space->cpu), data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
READ8_HANDLER( lsasquad_sh_sound_command_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_pending &= ~0x01;
//logerror("%04x: read sound cmd %02x\n", cpu_get_pc(space->cpu), state->sound_cmd);
return state->sound_cmd;
@@ -56,7 +56,7 @@ READ8_HANDLER( lsasquad_sh_sound_command_r )
WRITE8_HANDLER( lsasquad_sh_result_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_pending |= 0x02;
//logerror("%04x: sound res %02x\n", cpu_get_pc(space->cpu), data);
state->sound_result = data;
@@ -64,7 +64,7 @@ WRITE8_HANDLER( lsasquad_sh_result_w )
READ8_HANDLER( lsasquad_sound_result_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_pending &= ~0x02;
//logerror("%04x: read sound res %02x\n", cpu_get_pc(space->cpu), state->sound_result);
return state->sound_result;
@@ -72,7 +72,7 @@ READ8_HANDLER( lsasquad_sound_result_r )
READ8_HANDLER( lsasquad_sound_status_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
/* bit 0: message pending for sound cpu */
/* bit 1: message pending for main cpu */
@@ -82,7 +82,7 @@ READ8_HANDLER( lsasquad_sound_status_r )
READ8_HANDLER( daikaiju_sh_sound_command_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->sound_pending &= ~0x01;
state->sound_pending |= 0x02;
//logerror("%04x: read sound cmd %02x\n", cpu_get_pc(space->cpu), state->sound_cmd);
@@ -91,7 +91,7 @@ READ8_HANDLER( daikaiju_sh_sound_command_r )
READ8_HANDLER( daikaiju_sound_status_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
/* bit 0: message pending for sound cpu */
/* bit 1: message pending for main cpu */
@@ -109,7 +109,7 @@ READ8_HANDLER( daikaiju_sound_status_r )
READ8_HANDLER( lsasquad_68705_port_a_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
@@ -117,7 +117,7 @@ READ8_HANDLER( lsasquad_68705_port_a_r )
WRITE8_HANDLER( lsasquad_68705_port_a_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
@@ -125,7 +125,7 @@ WRITE8_HANDLER( lsasquad_68705_port_a_w )
WRITE8_HANDLER( lsasquad_68705_ddr_a_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->ddr_a = data;
}
@@ -142,13 +142,13 @@ WRITE8_HANDLER( lsasquad_68705_ddr_a_w )
READ8_HANDLER( lsasquad_68705_port_b_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( lsasquad_68705_port_b_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
//logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data);
@@ -173,13 +173,13 @@ WRITE8_HANDLER( lsasquad_68705_port_b_w )
WRITE8_HANDLER( lsasquad_68705_ddr_b_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
state->ddr_b = data;
}
WRITE8_HANDLER( lsasquad_mcu_w )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
//logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_main = data;
@@ -189,7 +189,7 @@ WRITE8_HANDLER( lsasquad_mcu_w )
READ8_HANDLER( lsasquad_mcu_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
//logerror("%04x: mcu_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu);
state->mcu_sent = 0;
@@ -198,8 +198,8 @@ READ8_HANDLER( lsasquad_mcu_r )
READ8_HANDLER( lsasquad_mcu_status_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
- int res = input_port_read(space->machine, "MCU");
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
+ int res = input_port_read(space->machine(), "MCU");
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
/* bit 1 = when 0, mcu has sent data to the main cpu */
@@ -214,8 +214,8 @@ READ8_HANDLER( lsasquad_mcu_status_r )
READ8_HANDLER( daikaiju_mcu_status_r )
{
- lsasquad_state *state = space->machine->driver_data<lsasquad_state>();
- int res = input_port_read(space->machine, "MCU");
+ lsasquad_state *state = space->machine().driver_data<lsasquad_state>();
+ int res = input_port_read(space->machine(), "MCU");
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
/* bit 1 = when 0, mcu has sent data to the main cpu */
diff --git a/src/mame/machine/maniach.c b/src/mame/machine/maniach.c
index bf2df2a7d3b..3e654f7e13e 100644
--- a/src/mame/machine/maniach.c
+++ b/src/mame/machine/maniach.c
@@ -21,7 +21,7 @@
READ8_HANDLER( maniach_68705_port_a_r )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
@@ -29,7 +29,7 @@ READ8_HANDLER( maniach_68705_port_a_r )
WRITE8_HANDLER( maniach_68705_port_a_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
@@ -37,7 +37,7 @@ WRITE8_HANDLER( maniach_68705_port_a_w )
WRITE8_HANDLER( maniach_68705_ddr_a_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
state->ddr_a = data;
}
@@ -54,13 +54,13 @@ WRITE8_HANDLER( maniach_68705_ddr_a_w )
READ8_HANDLER( maniach_68705_port_b_r )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( maniach_68705_port_b_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data);
@@ -82,14 +82,14 @@ WRITE8_HANDLER( maniach_68705_port_b_w )
WRITE8_HANDLER( maniach_68705_ddr_b_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
state->ddr_b = data;
}
READ8_HANDLER( maniach_68705_port_c_r )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
state->port_c_in = 0;
@@ -106,7 +106,7 @@ READ8_HANDLER( maniach_68705_port_c_r )
WRITE8_HANDLER( maniach_68705_port_c_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data);
state->port_c_out = data;
@@ -114,14 +114,14 @@ WRITE8_HANDLER( maniach_68705_port_c_w )
WRITE8_HANDLER( maniach_68705_ddr_c_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
state->ddr_c = data;
}
WRITE8_HANDLER( maniach_mcu_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 3040_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_main = data;
@@ -130,7 +130,7 @@ WRITE8_HANDLER( maniach_mcu_w )
READ8_HANDLER( maniach_mcu_r )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
//logerror("%04x: 3040_r %02x\n", cpu_get_pc(space->cpu), state->from_mcu);
state->mcu_sent = 0;
@@ -139,7 +139,7 @@ READ8_HANDLER( maniach_mcu_r )
READ8_HANDLER( maniach_mcu_status_r )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
int res = 0;
/* bit 0 = when 0, mcu has sent data to the main cpu */
diff --git a/src/mame/machine/mc8123.c b/src/mame/machine/mc8123.c
index 728759e09da..7628c2cb8be 100644
--- a/src/mame/machine/mc8123.c
+++ b/src/mame/machine/mc8123.c
@@ -375,14 +375,14 @@ static UINT8 mc8123_decrypt(offs_t addr,UINT8 val,const UINT8 *key,int opcode)
}
-void mc8123_decrypt_rom(running_machine *machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks)
+void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
int fixed_length = numbanks == 1 ? 0xc000 : 0x8000;
UINT8 *decrypted1 = auto_alloc_array(machine, UINT8, fixed_length);
UINT8 *decrypted2 = numbanks > 1 ? auto_alloc_array(machine, UINT8, 0x4000 * numbanks) : 0;
- UINT8 *rom = machine->region(cpu)->base();
- UINT8 *key = machine->region(keyrgn)->base();
+ UINT8 *rom = machine.region(cpu)->base();
+ UINT8 *key = machine.region(keyrgn)->base();
int A, bank;
space->set_decrypted_region(0x0000, fixed_length-1, decrypted1);
diff --git a/src/mame/machine/mc8123.h b/src/mame/machine/mc8123.h
index e8b27bd4577..4dd82a78cdd 100644
--- a/src/mame/machine/mc8123.h
+++ b/src/mame/machine/mc8123.h
@@ -2,4 +2,4 @@
// an arbitrary amount of banks at 8000-BFFF.
// numbanks may be 0, meaning there is no ROM to decrypt at 8000-BFFF,
// or 1, meaning 0000-BFFF will be decrypted as a single unit.
-void mc8123_decrypt_rom(running_machine *machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks);
+void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks);
diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c
index 622105d1aa9..3c74716320d 100644
--- a/src/mame/machine/mcr.c
+++ b/src/mame/machine/mcr.c
@@ -137,7 +137,7 @@ Z80PIO_INTERFACE( nflfoot_pio_intf )
static WRITE_LINE_DEVICE_HANDLER( ipu_ctc_interrupt )
{
- cputag_set_input_line(device->machine, "ipu", 0, state);
+ cputag_set_input_line(device->machine(), "ipu", 0, state);
}
@@ -167,7 +167,7 @@ MACHINE_START( mcr )
MACHINE_START( nflfoot )
{
/* allocate a timer for the IPU watchdog */
- ipu_watchdog_timer = machine->scheduler().timer_alloc(FUNC(ipu_watchdog_reset));
+ ipu_watchdog_timer = machine.scheduler().timer_alloc(FUNC(ipu_watchdog_reset));
}
@@ -190,7 +190,7 @@ MACHINE_RESET( mcr )
INTERRUPT_GEN( mcr_interrupt )
{
- device_t *ctc = device->machine->device("ctc");
+ device_t *ctc = device->machine().device("ctc");
/* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */
/* for the 30Hz interlaced display */
@@ -209,7 +209,7 @@ INTERRUPT_GEN( mcr_interrupt )
INTERRUPT_GEN( mcr_ipu_interrupt )
{
- device_t *ctc = device->machine->device("ipu_ctc");
+ device_t *ctc = device->machine().device("ipu_ctc");
/* CTC line 3 is connected to 493, which is signalled once every */
/* frame at 30Hz */
@@ -241,9 +241,9 @@ WRITE8_HANDLER( mcr_control_port_w )
D0 = coin meter 1
*/
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
- coin_counter_w(space->machine, 1, (data >> 1) & 1);
- coin_counter_w(space->machine, 2, (data >> 2) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 1) & 1);
+ coin_counter_w(space->machine(), 2, (data >> 2) & 1);
mcr_cocktail_flip = (data >> 6) & 1;
}
diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c
index e99a3a13d9a..cafcf2c4287 100644
--- a/src/mame/machine/mcr68.c
+++ b/src/mame/machine/mcr68.c
@@ -18,7 +18,7 @@
*
*************************************/
-static void subtract_from_counter(running_machine *machine, int counter, int count);
+static void subtract_from_counter(running_machine &machine, int counter, int count);
static TIMER_CALLBACK( mcr68_493_callback );
static TIMER_CALLBACK( zwackery_493_callback );
@@ -40,7 +40,7 @@ static TIMER_CALLBACK( counter_fired_callback );
static READ8_DEVICE_HANDLER( zwackery_port_1_r )
{
- UINT8 ret = input_port_read(device->machine, "IN1");
+ UINT8 ret = input_port_read(device->machine(), "IN1");
pia6821_set_port_a_z_mask(device, ret);
@@ -50,7 +50,7 @@ static READ8_DEVICE_HANDLER( zwackery_port_1_r )
static READ8_DEVICE_HANDLER( zwackery_port_3_r )
{
- UINT8 ret = input_port_read(device->machine, "IN3");
+ UINT8 ret = input_port_read(device->machine(), "IN3");
pia6821_set_port_a_z_mask(device, ret);
@@ -118,14 +118,14 @@ const pia6821_interface zwackery_pia2_intf =
MACHINE_START( mcr68 )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
int i;
for (i = 0; i < 3; i++)
{
struct counter_state *m6840 = &state->m6840_state[i];
- m6840->timer = machine->scheduler().timer_alloc(FUNC(counter_fired_callback));
+ m6840->timer = machine.scheduler().timer_alloc(FUNC(counter_fired_callback));
state_save_register_item(machine, "m6840", NULL, i, m6840->control);
state_save_register_item(machine, "m6840", NULL, i, m6840->latch);
@@ -143,9 +143,9 @@ MACHINE_START( mcr68 )
}
-static void mcr68_common_init(running_machine *machine)
+static void mcr68_common_init(running_machine &machine)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
int i;
/* reset the 6840's */
@@ -169,7 +169,7 @@ static void mcr68_common_init(running_machine *machine)
}
/* initialize the clock */
- state->m6840_internal_counter_period = attotime::from_hz(machine->device("maincpu")->unscaled_clock() / 10);
+ state->m6840_internal_counter_period = attotime::from_hz(machine.device("maincpu")->unscaled_clock() / 10);
/* initialize the sound */
mcr_sound_reset(machine);
@@ -178,7 +178,7 @@ static void mcr68_common_init(running_machine *machine)
MACHINE_RESET( mcr68 )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
/* for the most part all MCR/68k games are the same */
mcr68_common_init(machine);
state->v493_callback = mcr68_493_callback;
@@ -197,7 +197,7 @@ MACHINE_START( zwackery )
MACHINE_RESET( zwackery )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
/* for the most part all MCR/68k games are the same */
mcr68_common_init(machine);
state->v493_callback = zwackery_493_callback;
@@ -217,17 +217,17 @@ MACHINE_RESET( zwackery )
INTERRUPT_GEN( mcr68_interrupt )
{
- mcr68_state *state = device->machine->driver_data<mcr68_state>();
+ mcr68_state *state = device->machine().driver_data<mcr68_state>();
/* update the 6840 VBLANK clock */
if (!state->m6840_state[0].timer_active)
- subtract_from_counter(device->machine, 0, 1);
+ subtract_from_counter(device->machine(), 0, 1);
logerror("--- VBLANK ---\n");
/* also set a timer to generate the 493 signal at a specific time before the next VBLANK */
/* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */
/* VBLANK and 493 using counter 2 */
- device->machine->scheduler().timer_set(attotime::from_hz(30) - state->timing_factor, FUNC(state->v493_callback));
+ device->machine().scheduler().timer_set(attotime::from_hz(30) - state->timing_factor, FUNC(state->v493_callback));
}
@@ -238,9 +238,9 @@ INTERRUPT_GEN( mcr68_interrupt )
*
*************************************/
-static void update_mcr68_interrupts(running_machine *machine)
+static void update_mcr68_interrupts(running_machine &machine)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
cputag_set_input_line(machine, "maincpu", state->v493_irq_vector, state->v493_irq_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", state->m6840_irq_vector, state->m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -248,7 +248,7 @@ static void update_mcr68_interrupts(running_machine *machine)
static TIMER_CALLBACK( mcr68_493_off_callback )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
state->v493_irq_state = 0;
update_mcr68_interrupts(machine);
}
@@ -256,10 +256,10 @@ static TIMER_CALLBACK( mcr68_493_off_callback )
static TIMER_CALLBACK( mcr68_493_callback )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
state->v493_irq_state = 1;
update_mcr68_interrupts(machine);
- machine->scheduler().timer_set(machine->primary_screen->scan_period(), FUNC(mcr68_493_off_callback));
+ machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(mcr68_493_off_callback));
logerror("--- (INT1) ---\n");
}
@@ -274,7 +274,7 @@ static TIMER_CALLBACK( mcr68_493_callback )
WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
{
/* bit 7 is the watchdog */
- if (!(data & 0x80)) watchdog_reset(device->machine);
+ if (!(data & 0x80)) watchdog_reset(device->machine());
/* bits 5 and 6 control hflip/vflip */
/* bits 3 and 4 control coin counters? */
@@ -284,40 +284,40 @@ WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
WRITE8_DEVICE_HANDLER( zwackery_pia1_w )
{
- mcr68_state *state = device->machine->driver_data<mcr68_state>();
+ mcr68_state *state = device->machine().driver_data<mcr68_state>();
state->zwackery_sound_data = (data >> 4) & 0x0f;
}
WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w )
{
- mcr68_state *drvstate = device->machine->driver_data<mcr68_state>();
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ mcr68_state *drvstate = device->machine().driver_data<mcr68_state>();
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
csdeluxe_data_w(space, 0, (state << 4) | drvstate->zwackery_sound_data);
}
static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq )
{
- mcr68_state *drvstate = device->machine->driver_data<mcr68_state>();
+ mcr68_state *drvstate = device->machine().driver_data<mcr68_state>();
drvstate->v493_irq_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
- update_mcr68_interrupts(device->machine);
+ update_mcr68_interrupts(device->machine());
}
static TIMER_CALLBACK( zwackery_493_off_callback )
{
- device_t *pia = machine->device("pia0");
+ device_t *pia = machine.device("pia0");
pia6821_ca1_w(pia, 0);
}
static TIMER_CALLBACK( zwackery_493_callback )
{
- device_t *pia = machine->device("pia0");
+ device_t *pia = machine.device("pia0");
pia6821_ca1_w(pia, 1);
- machine->scheduler().timer_set(machine->primary_screen->scan_period(), FUNC(zwackery_493_off_callback));
+ machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(zwackery_493_off_callback));
}
@@ -328,9 +328,9 @@ static TIMER_CALLBACK( zwackery_493_callback )
*
*************************************/
-INLINE void update_interrupts(running_machine *machine)
+INLINE void update_interrupts(running_machine &machine)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
state->m6840_status &= ~0x80;
if ((state->m6840_status & 0x01) && (state->m6840_state[0].control & 0x40)) state->m6840_status |= 0x80;
@@ -342,9 +342,9 @@ INLINE void update_interrupts(running_machine *machine)
}
-static void subtract_from_counter(running_machine *machine, int counter, int count)
+static void subtract_from_counter(running_machine &machine, int counter, int count)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
struct counter_state *m6840 = &state->m6840_state[counter];
/* dual-byte mode */
@@ -407,7 +407,7 @@ static void subtract_from_counter(running_machine *machine, int counter, int cou
static TIMER_CALLBACK( counter_fired_callback )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
int count = param >> 2;
int counter = param & 3;
struct counter_state *m6840 = &state->m6840_state[counter];
@@ -499,7 +499,7 @@ static UINT16 compute_counter(mcr68_state *state, int counter)
static WRITE8_HANDLER( mcr68_6840_w_common )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
int i;
/* offsets 0 and 1 are control registers */
@@ -532,7 +532,7 @@ static WRITE8_HANDLER( mcr68_6840_w_common )
}
state->m6840_status = 0;
- update_interrupts(space->machine);
+ update_interrupts(space->machine());
}
/* changing the clock source? (needed for Zwackery) */
@@ -558,7 +558,7 @@ static WRITE8_HANDLER( mcr68_6840_w_common )
/* clear the interrupt */
state->m6840_status &= ~(1 << counter);
- update_interrupts(space->machine);
+ update_interrupts(space->machine());
/* reload the count if in an appropriate mode */
if (!(m6840->control & 0x10))
@@ -571,7 +571,7 @@ static WRITE8_HANDLER( mcr68_6840_w_common )
static READ16_HANDLER( mcr68_6840_r_common )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
/* offset 0 is a no-op */
if (offset == 0)
return 0;
@@ -593,7 +593,7 @@ static READ16_HANDLER( mcr68_6840_r_common )
/* clear the interrupt if the status has been read */
if (state->m6840_status_read_since_int & (1 << counter))
state->m6840_status &= ~(1 << counter);
- update_interrupts(space->machine);
+ update_interrupts(space->machine());
state->m6840_lsb_buffer = result & 0xff;
diff --git a/src/mame/machine/md_cart.c b/src/mame/machine/md_cart.c
index d0f74a01af8..f97515b50ee 100644
--- a/src/mame/machine/md_cart.c
+++ b/src/mame/machine/md_cart.c
@@ -193,8 +193,8 @@ static int md_get_pcb_id(const char *pcb)
*************************************/
static WRITE16_HANDLER( genesis_ssf2_bank_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if ((state->md_cart.ssf2_lastoff != offset) || (state->md_cart.ssf2_lastdata != data))
{
@@ -240,20 +240,20 @@ static WRITE16_HANDLER( genesis_ssf2_bank_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( l3alt_pdat_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.l3alt_pdat = data;
}
static WRITE16_HANDLER( l3alt_pcmd_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.l3alt_pcmd = data;
}
#endif
static READ16_HANDLER( l3alt_prot_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
int retdata = 0;
offset &= 0x07;
@@ -300,7 +300,7 @@ static READ16_HANDLER( l3alt_prot_r )
static WRITE16_HANDLER( l3alt_prot_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
offset &= 0x7;
switch (offset)
@@ -325,7 +325,7 @@ static WRITE16_HANDLER( l3alt_bank_w )
{
case 0:
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
/* printf("%06x data %04x\n",activecpu_get_pc(), data); */
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + (data & 0xffff) * 0x8000], 0x8000);
}
@@ -345,17 +345,17 @@ static WRITE16_HANDLER( l3alt_bank_w )
*************************************/
static WRITE16_HANDLER( realtec_402000_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.realtec_bank_addr = 0;
state->md_cart.realtec_bank_size = (data >> 8) & 0x1f;
}
static WRITE16_HANDLER( realtec_400000_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
int bankdata = (data >> 9) & 0x7;
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
state->md_cart.realtec_old_bank_addr = state->md_cart.realtec_bank_addr;
state->md_cart.realtec_bank_addr = (state->md_cart.realtec_bank_addr & 0x7) | bankdata << 3;
@@ -366,9 +366,9 @@ static WRITE16_HANDLER( realtec_400000_w )
static WRITE16_HANDLER( realtec_404000_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
int bankdata = (data >> 8) & 0x3;
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
state->md_cart.realtec_old_bank_addr = state->md_cart.realtec_bank_addr;
state->md_cart.realtec_bank_addr = (state->md_cart.realtec_bank_addr & 0xf8) | bankdata;
@@ -385,7 +385,7 @@ static WRITE16_HANDLER( realtec_404000_w )
*************************************/
static WRITE16_HANDLER( chifi3_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if (data == 0xf100) // *hit player
{
@@ -452,11 +452,11 @@ static READ16_HANDLER( chifi3_prot_r )
}
else if (cpu_get_pc(space->cpu) == 0x10c4a) // unknown
{
- return space->machine->rand();
+ return space->machine().rand();
}
else if (cpu_get_pc(space->cpu) == 0x10c50) // unknown
{
- return space->machine->rand();
+ return space->machine().rand();
}
else if (cpu_get_pc(space->cpu) == 0x10c52) // relates to the game speed..
{
@@ -489,7 +489,7 @@ static READ16_HANDLER( chifi3_prot_r )
*************************************/
static WRITE16_HANDLER( s19in1_bank )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + ((offset << 1) * 0x10000), 0x80000);
}
@@ -498,7 +498,7 @@ static WRITE16_HANDLER( s19in1_bank )
*************************************/
static WRITE16_HANDLER( kaiju_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
memcpy(ROM + 0x000000, ROM + 0x400000 + (data & 0x7f) * 0x8000, 0x8000);
}
@@ -605,7 +605,7 @@ static READ16_HANDLER( kof99_A13000_r )
static READ16_HANDLER( radica_bank_select )
{
int bank = offset & 0x3f;
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
memcpy(ROM, ROM + 0x400000 + (bank * 0x10000), 0x400000);
return 0;
}
@@ -628,13 +628,13 @@ static READ16_HANDLER( redclif_prot2_r )
*************************************/
static READ16_HANDLER( squirrel_king_extra_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
return state->md_cart.squirrel_king_extra;
}
static WRITE16_HANDLER( squirrel_king_extra_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.squirrel_king_extra = data;
}
@@ -643,25 +643,25 @@ static WRITE16_HANDLER( squirrel_king_extra_w )
*************************************/
static READ16_HANDLER( lion2_prot1_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
return state->md_cart.lion2_prot1_data;
}
static READ16_HANDLER( lion2_prot2_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
return state->md_cart.lion2_prot2_data;
}
static WRITE16_HANDLER ( lion2_prot1_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.lion2_prot1_data = data;
}
static WRITE16_HANDLER ( lion2_prot2_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.lion2_prot2_data = data;
}
@@ -760,7 +760,7 @@ static READ16_HANDLER( topfig_6F5344_r ) // after char select
if (cpu_get_pc(space->cpu)==0x4C94E)
{
- return cpu_get_reg(space->machine->device("maincpu"), (M68K_D0)) & 0xff;
+ return cpu_get_reg(space->machine().device("maincpu"), (M68K_D0)) & 0xff;
}
else
{
@@ -772,7 +772,7 @@ static READ16_HANDLER( topfig_6F5344_r ) // after char select
static WRITE16_HANDLER( topfig_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if (data == 0x002a)
{
memcpy(ROM + 0x060000, ROM + 0x570000, 0x8000); // == 0x2e*0x8000?!
@@ -819,7 +819,7 @@ static READ16_HANDLER( topfig_645B44_r )
*************************************/
static WRITE16_HANDLER( mc_12in1_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
logerror("offset %06x", offset << 17);
memcpy(ROM + 0x000000, ROM + VIRGIN_COPY_GEN + ((offset & 0x3f) << 17), 0x100000);
}
@@ -846,7 +846,7 @@ static WRITE16_HANDLER( genesis_TMSS_bank_w )
*************************************/
static READ16_HANDLER( genesis_sram_read )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
UINT8 *ROM;
int rom_offset;
@@ -854,7 +854,7 @@ static READ16_HANDLER( genesis_sram_read )
return state->md_cart.sram[offset];
else
{
- ROM = space->machine->region("maincpu")->base();
+ ROM = space->machine().region("maincpu")->base();
rom_offset = state->md_cart.sram_start + (offset << 1);
return (UINT16) ROM[rom_offset] | (ROM[rom_offset + 1] << 8);
@@ -863,7 +863,7 @@ static READ16_HANDLER( genesis_sram_read )
static WRITE16_HANDLER( genesis_sram_write )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
if (state->md_cart.sram_active)
{
if (!state->md_cart.sram_readonly)
@@ -871,10 +871,10 @@ static WRITE16_HANDLER( genesis_sram_write )
}
}
-static void install_sram_rw_handlers(running_machine *machine, bool mask_addr)
+static void install_sram_rw_handlers(running_machine &machine, bool mask_addr)
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
- device_image_interface *image = dynamic_cast<device_image_interface *>(machine->device("cart"));
+ md_cons_state *state = machine.driver_data<md_cons_state>();
+ device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart"));
// if sram_start/end come from the cart header, they might be incorrect! from softlist, they are fine.
UINT32 mask = mask_addr ? 0x3fffff : 0xffffff;
@@ -883,14 +883,14 @@ static void install_sram_rw_handlers(running_machine *machine, bool mask_addr)
image->battery_load(state->md_cart.sram, state->md_cart.sram_end - state->md_cart.sram_start + 1, 0xff); // Dino Dini's Soccer needs backup RAM to be 1fill
memcpy(megadriv_backupram, state->md_cart.sram, state->md_cart.sram_end - state->md_cart.sram_start + 1);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(state->md_cart.sram_start & mask, state->md_cart.sram_end & mask, FUNC(genesis_sram_read));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(state->md_cart.sram_start & mask, state->md_cart.sram_end & mask, FUNC(genesis_sram_write));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(state->md_cart.sram_start & mask, state->md_cart.sram_end & mask, FUNC(genesis_sram_read));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(state->md_cart.sram_start & mask, state->md_cart.sram_end & mask, FUNC(genesis_sram_write));
state->md_cart.sram_handlers_installed = 1;
}
static WRITE16_HANDLER( genesis_sram_toggle )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
/* unsure if this is actually supposed to toggle or just switch on?
Yet to encounter game that utilizes */
@@ -898,18 +898,18 @@ static WRITE16_HANDLER( genesis_sram_toggle )
state->md_cart.sram_readonly = (data & 2) ? 1 : 0;
if (state->md_cart.sram_active && !state->md_cart.sram_handlers_installed)
- install_sram_rw_handlers(space->machine, TRUE);
+ install_sram_rw_handlers(space->machine(), TRUE);
}
static READ16_HANDLER( sega_6658a_reg_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
return state->md_cart.sram_active;
}
static WRITE16_HANDLER( sega_6658a_reg_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
if (data == 1)
state->md_cart.sram_active = 1;
if (data == 0)
@@ -924,88 +924,88 @@ static WRITE16_HANDLER( sega_6658a_reg_w )
static READ16_HANDLER( nba_jam_eeprom_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
-// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return state->md_cart.i2c_mem & 1;
}
static WRITE16_HANDLER( nba_jam_eeprom_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.i2c_clk = (data & 0x0002) >> 1;
state->md_cart.i2c_mem = (data & 0x0001);
-// i2cmem_sda_write(space->machine->device("i2cmem"), state->md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine->device("i2cmem"), state->md_cart.i2c_mem);
+// i2cmem_sda_write(space->machine().device("i2cmem"), state->md_cart.i2c_clk);
+// i2cmem_scl_write(space->machine().device("i2cmem"), state->md_cart.i2c_mem);
}
static READ16_HANDLER( nba_jam_te_eeprom_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
-// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (state->md_cart.i2c_mem & 1);
}
static WRITE16_HANDLER( nba_jam_te_eeprom_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.i2c_clk = ((data & 0x0100) >> 8);
state->md_cart.i2c_mem = data & 0x0001;
-// i2cmem_sda_write(space->machine->device("i2cmem"), state->md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine->device("i2cmem"), state->md_cart.i2c_mem);
+// i2cmem_sda_write(space->machine().device("i2cmem"), state->md_cart.i2c_clk);
+// i2cmem_scl_write(space->machine().device("i2cmem"), state->md_cart.i2c_mem);
}
static READ16_HANDLER( ea_nhlpa_eeprom_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
-// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (state->md_cart.i2c_mem & 1) << 7;
}
static WRITE16_HANDLER( ea_nhlpa_eeprom_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.i2c_clk = ((data & 0x0040) >> 6);
state->md_cart.i2c_mem = ((data & 0x0080) >> 7);
-// i2cmem_sda_write(space->machine->device("i2cmem"), state->md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine->device("i2cmem"), state->md_cart.i2c_mem);
+// i2cmem_sda_write(space->machine().device("i2cmem"), state->md_cart.i2c_clk);
+// i2cmem_scl_write(space->machine().device("i2cmem"), state->md_cart.i2c_mem);
}
/* TODO: identical as NBA Jam, used as kludge */
static READ16_HANDLER( wboy_v_eeprom_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
-// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return ~state->md_cart.i2c_mem & 1;
}
static WRITE16_HANDLER( wboy_v_eeprom_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.i2c_clk = (data & 0x0002) >> 1;
state->md_cart.i2c_mem = (data & 0x0001);
-// i2cmem_sda_write(space->machine->device("i2cmem"), state->md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine->device("i2cmem"), state->md_cart.i2c_mem);
+// i2cmem_sda_write(space->machine().device("i2cmem"), state->md_cart.i2c_clk);
+// i2cmem_scl_write(space->machine().device("i2cmem"), state->md_cart.i2c_mem);
}
static READ16_HANDLER( codemasters_eeprom_r )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
-// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
+// state->md_cart.i2c_mem = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (state->md_cart.i2c_mem & 1) << 7;
}
static WRITE16_HANDLER( codemasters_eeprom_w )
{
- md_cons_state *state = space->machine->driver_data<md_cons_state>();
+ md_cons_state *state = space->machine().driver_data<md_cons_state>();
state->md_cart.i2c_clk = (data & 0x0200) >> 9;
state->md_cart.i2c_mem = (data & 0x0100) >> 8;
-// i2cmem_sda_write(space->machine->device("i2cmem"), state->md_cart.i2c_clk);
-// i2cmem_scl_write(space->machine->device("i2cmem"), state->md_cart.i2c_mem);
+// i2cmem_sda_write(space->machine().device("i2cmem"), state->md_cart.i2c_clk);
+// i2cmem_scl_write(space->machine().device("i2cmem"), state->md_cart.i2c_mem);
}
/*************************************
@@ -1014,19 +1014,19 @@ static WRITE16_HANDLER( codemasters_eeprom_w )
*
*************************************/
-static void setup_megadriv_custom_mappers(running_machine *machine)
+static void setup_megadriv_custom_mappers(running_machine &machine)
{
- md_cons_state *state = machine->driver_data<md_cons_state>();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
UINT32 mirroraddr;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
switch (state->md_cart.type)
{
case CM_JCART:
case CM_JCART_SEPROM:
/* Codemasters PCB (J-Carts) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x38fffe, 0x38ffff, FUNC(jcart_ctrl_w));
break;
case SSF2:
@@ -1034,7 +1034,7 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000);
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130ff, FUNC(genesis_ssf2_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130ff, FUNC(genesis_ssf2_bank_w));
break;
case LIONK3:
@@ -1043,8 +1043,8 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */
memcpy(&ROM[0x200000], &ROM[VIRGIN_COPY_GEN], 0x200000); /* default rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
break;
case SDK99:
@@ -1053,13 +1053,13 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x300000); /* default rom */
memcpy(&ROM[0x300000], &ROM[VIRGIN_COPY_GEN], 0x100000); /* default rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x600000, 0x6fffff, FUNC(l3alt_prot_r), FUNC(l3alt_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(l3alt_bank_w));
break;
case REDCLIFF:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
break;
case REDCL_EN:
@@ -1067,8 +1067,8 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
ROM[x] ^= 0x40;
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN + 4], 0x200000); /* default rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(redclif_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(redclif_prot_r));
break;
case RADICA:
@@ -1076,43 +1076,43 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // keep a copy for later banking.. making use of huge ROM_REGION allocated to genesis driver
memcpy(&ROM[0x800000], &ROM[VIRGIN_COPY_GEN], 0x400000); // wraparound banking (from hazemd code)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa1307f, FUNC(radica_bank_select));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa1307f, FUNC(radica_bank_select));
break;
case KOF99:
//memcpy(&ROM[0x000000],&ROM[VIRGIN_COPY_GEN],0x300000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(kof99_A13000_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13002, 0xa13003, FUNC(kof99_A13002_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa1303e, 0xa1303f, FUNC(kof99_00A1303E_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(kof99_A13000_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13002, 0xa13003, FUNC(kof99_A13002_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa1303e, 0xa1303f, FUNC(kof99_00A1303E_r));
break;
case SOULBLAD:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(soulb_400002_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(soulb_400004_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(soulb_400006_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(soulb_400002_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(soulb_400004_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(soulb_400006_r));
break;
case MJLOVER:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(mjlovr_prot_1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x401000, 0x401001, FUNC(mjlovr_prot_2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(mjlovr_prot_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x401000, 0x401001, FUNC(mjlovr_prot_2_r));
break;
case SQUIRRELK:
state->md_cart.squirrel_king_extra = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400007, FUNC(squirrel_king_extra_w));
break;
case SMOUSE:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, FUNC(smous_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400007, FUNC(smous_prot_r));
break;
case SMB:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smbro_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smbro_prot_r));
break;
case SMB2:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smb2_extra_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(smb2_extra_r));
break;
case KAIJU:
@@ -1120,7 +1120,7 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000);
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(kaiju_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(kaiju_bank_w));
break;
case CHINFIGHT3:
@@ -1128,48 +1128,48 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
memcpy(&ROM[0x600000], &ROM[VIRGIN_COPY_GEN], 0x200000);
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x200000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x4fffff, FUNC(chifi3_prot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x600000, 0x6fffff, FUNC(chifi3_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x4fffff, FUNC(chifi3_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x600000, 0x6fffff, FUNC(chifi3_bank_w));
break;
case LIONK2:
state->md_cart.lion2_prot1_data = state->md_cart.lion2_prot2_data = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(lion2_prot1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(lion2_prot2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(lion2_prot1_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400004, 0x400005, FUNC(lion2_prot2_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(lion2_prot1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(lion2_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(lion2_prot1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400004, 0x400005, FUNC(lion2_prot2_w));
break;
case BUGSLIFE:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(bugl_extra_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(bugl_extra_r));
break;
case ELFWOR:
/* It return (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). It is probably best to add handlers for all 4 addresses. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(elfwor_400000_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(elfwor_400002_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(elfwor_400004_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(elfwor_400006_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(elfwor_400000_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(elfwor_400002_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400004, 0x400005, FUNC(elfwor_400004_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400006, 0x400007, FUNC(elfwor_400006_r));
break;
case ROCKMANX3:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(rx3_extra_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa13000, 0xa13001, FUNC(rx3_extra_r));
break;
case SBUBBOB:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(sbub_extra1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(sbub_extra2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(sbub_extra1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400002, 0x400003, FUNC(sbub_extra2_r));
break;
case KOF98:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x480000, 0x480001, FUNC(kof98_aa_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4800e0, 0x4800e1, FUNC(kof98_aa_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4824a0, 0x4824a1, FUNC(kof98_aa_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x488880, 0x488881, FUNC(kof98_aa_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x480000, 0x480001, FUNC(kof98_aa_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4800e0, 0x4800e1, FUNC(kof98_aa_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4824a0, 0x4824a1, FUNC(kof98_aa_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x488880, 0x488881, FUNC(kof98_aa_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4a8820, 0x4a8821, FUNC(kof98_0a_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f8820, 0x4f8821, FUNC(kof98_00_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4a8820, 0x4a8821, FUNC(kof98_0a_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4f8820, 0x4f8821, FUNC(kof98_00_r));
break;
case REALTEC:
@@ -1182,38 +1182,38 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
for (mirroraddr = 0; mirroraddr < 0x400000; mirroraddr += 0x2000)
memcpy(ROM + mirroraddr, ROM + VIRGIN_COPY_GEN + 0x7e000, 0x002000); /* copy last 8kb across the whole rom region */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(realtec_400000_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x402000, 0x402001, FUNC(realtec_402000_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x404000, 0x404001, FUNC(realtec_404000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(realtec_400000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x402000, 0x402001, FUNC(realtec_402000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x404000, 0x404001, FUNC(realtec_404000_w));
break;
case MC_SUP19IN1:
memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x400000); // allow hard reset to menu
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
break;
case MC_SUP15IN1:
memcpy(&ROM[0x400000], &ROM[VIRGIN_COPY_GEN], 0x200000); // allow hard reset to menu
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa13039, FUNC(s19in1_bank));
break;
case MC_12IN1:
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); /* default rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa1303f, FUNC(mc_12in1_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa13000, 0xa1303f, FUNC(mc_12in1_bank_w));
break;
case TOPFIGHTER:
memcpy(&ROM[0x000000], &ROM[VIRGIN_COPY_GEN], 0x400000); /* default rom */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6f5344, 0x6f5345, FUNC(topfig_6F5344_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6bd294, 0x6bd295, FUNC(topfig_6BD294_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x645b44, 0x645b45, FUNC(topfig_645B44_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6f5344, 0x6f5345, FUNC(topfig_6F5344_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6bd294, 0x6bd295, FUNC(topfig_6BD294_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x645b44, 0x645b45, FUNC(topfig_645B44_r) );
/* readd */
- //machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x689b80, 0x689b81, FUNC(MWA16_NOP));
- //machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6d8b02, 0x6d8b03, FUNC(MWA16_NOP));
+ //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x689b80, 0x689b81, FUNC(MWA16_NOP));
+ //machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6d8b02, 0x6d8b03, FUNC(MWA16_NOP));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(topfig_bank_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x700000, 0x7fffff, FUNC(topfig_bank_w) );
break;
}
@@ -1235,7 +1235,7 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
you need to return 1 @ 0xa13002 and 0???1f @ 0xa1303E (it does word reads).
*/
- UINT16 *ROM16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
ROM16[0x0dd19e/2] = 0x47F8;
ROM16[0x0dd1a0/2] = 0xFFF0;
@@ -1254,7 +1254,7 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
002476:6022
*/
- UINT16 *ROM16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
ROM16[0x06036/2] = 0xE000;
ROM16[0x02540/2] = 0x6026;
@@ -1274,20 +1274,20 @@ static void setup_megadriv_custom_mappers(running_machine *machine)
// ROM[0x01ED0/2] = 0xE000;
// ROM[0x02540/2] = 0xE000;
- UINT16 *ROM16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM16 = (UINT16 *)machine.region("maincpu")->base();
ROM16[0x06036/2] = 0xE000;
}
/* install NOP handler for TMSS */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa14000, 0xa14003, FUNC(genesis_TMSS_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa14000, 0xa14003, FUNC(genesis_TMSS_bank_w));
}
static void setup_megadriv_sram(device_image_interface &image)
{
- running_machine *machine = image.device().machine;
- md_cons_state *state = machine->driver_data<md_cons_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ running_machine &machine = image.device().machine();
+ md_cons_state *state = machine.driver_data<md_cons_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
megadriv_backupram = NULL;
state->md_cart.sram = NULL;
state->md_cart.sram_start = state->md_cart.sram_end = 0;
@@ -1308,7 +1308,7 @@ static void setup_megadriv_sram(device_image_interface &image)
state->md_cart.sram_end = state->md_cart.sram_start + image.get_software_region_length("sram") - 1;
state->md_cart.sram_detected = 1;
megadriv_backupram = (UINT16*) (ROM + state->md_cart.sram_start);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
if (state->md_cart.last_loaded_image_length <= state->md_cart.sram_start)
{
state->md_cart.sram_active = 1;
@@ -1330,39 +1330,39 @@ static void setup_megadriv_sram(device_image_interface &image)
state->md_cart.sram_end = state->md_cart.sram_start + image.get_software_region_length("fram") - 1;
state->md_cart.sram_detected = 1;
megadriv_backupram = (UINT16*) (ROM + state->md_cart.sram_start);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(sega_6658a_reg_w));
install_sram_rw_handlers(machine, FALSE);
break;
// These types might come either from xml or from old-styele loading
case SEGA_EEPROM:
state->md_cart.has_serial_eeprom = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(wboy_v_eeprom_r), FUNC(wboy_v_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(wboy_v_eeprom_r), FUNC(wboy_v_eeprom_w));
break;
case NBA_JAM:
state->md_cart.has_serial_eeprom = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_eeprom_r), FUNC(nba_jam_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_eeprom_r), FUNC(nba_jam_eeprom_w));
break;
case NBA_JAM_TE:
case NFL_QB_96:
case C_SLAM: // same handling but different sizes
state->md_cart.has_serial_eeprom = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_te_eeprom_r), FUNC(nba_jam_te_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(nba_jam_te_eeprom_r), FUNC(nba_jam_te_eeprom_w));
break;
case EA_NHLPA:
state->md_cart.has_serial_eeprom = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(ea_nhlpa_eeprom_r), FUNC(ea_nhlpa_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x200001, FUNC(ea_nhlpa_eeprom_r), FUNC(ea_nhlpa_eeprom_w));
break;
case CODE_MASTERS:
case CM_JCART_SEPROM:
state->md_cart.has_serial_eeprom = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300001, FUNC(codemasters_eeprom_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x380000, 0x380001, FUNC(codemasters_eeprom_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300001, FUNC(codemasters_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x380000, 0x380001, FUNC(codemasters_eeprom_r));
break;
}
@@ -1414,7 +1414,7 @@ static void setup_megadriv_sram(device_image_interface &image)
if (state->md_cart.last_loaded_image_length <= state->md_cart.sram_start)
state->md_cart.sram_active = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa130f0, 0xa130f1, FUNC(genesis_sram_toggle));
//printf("res: start %x, end %x, det %d, active %d\n", state->md_cart.sram_start, state->md_cart.sram_end, state->md_cart.sram_detected, state->md_cart.sram_active);
/* Sonic 1 included in Sonic Classics doesn't have SRAM and
@@ -1538,7 +1538,7 @@ static int genesis_is_SMD(unsigned char *buf,unsigned int len)
static int megadrive_load_nonlist(device_image_interface &image)
{
- md_cons_state *state = image.device().machine->driver_data<md_cons_state>();
+ md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
unsigned char *ROM, *rawROM, *tmpROMnew, *tmpROM, *secondhalf;
int relocate, length, ptr, x;
#ifdef LSB_FIRST
@@ -1546,7 +1546,7 @@ static int megadrive_load_nonlist(device_image_interface &image)
#endif
// STEP 1: determine the file type (SMD? MD? BIN?)
- rawROM = image.device().machine->region("maincpu")->base();
+ rawROM = image.device().machine().region("maincpu")->base();
ROM = rawROM /*+ 512 */;
state->md_cart.last_loaded_image_length = -1;
@@ -1839,7 +1839,7 @@ static void megadrive_check_compat_list(device_image_interface &image)
if (chips)
{
- if(!strcmp(chips, "SVP") && (image.device().machine->device<cpu_device>("svp") == NULL))
+ if(!strcmp(chips, "SVP") && (image.device().machine().device<cpu_device>("svp") == NULL))
{
mame_printf_warning("This software requires emulation of the SVP CPU to work.\n");
mame_printf_warning("It might not work in the system you are using.\n");
@@ -1877,8 +1877,8 @@ static void megadrive_check_compat_list(device_image_interface &image)
static int megadrive_load_list(device_image_interface &image)
{
- md_cons_state *state = image.device().machine->driver_data<md_cons_state>();
- UINT8 *ROM = image.device().machine->region("maincpu")->base();
+ md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
+ UINT8 *ROM = image.device().machine().region("maincpu")->base();
UINT32 length = image.get_software_region_length("rom");
const char *pcb_name;
memcpy(ROM, image.get_software_region("rom"), length);
@@ -1899,7 +1899,7 @@ static int megadrive_load_list(device_image_interface &image)
static DEVICE_IMAGE_LOAD( genesis_cart )
{
- md_cons_state *state = image.device().machine->driver_data<md_cons_state>();
+ md_cons_state *state = image.device().machine().driver_data<md_cons_state>();
state->md_cart.type = SEGA_STD;
int res;
@@ -1916,7 +1916,7 @@ static DEVICE_IMAGE_LOAD( genesis_cart )
if (res == IMAGE_INIT_PASS)
{
// STEP 3: install memory handlers for this type of cart
- setup_megadriv_custom_mappers(image.device().machine);
+ setup_megadriv_custom_mappers(image.device().machine());
// STEP 4: take care of SRAM.
setup_megadriv_sram(image);
@@ -1944,7 +1944,7 @@ static void genesis_machine_stop(running_machine &machine)
MACHINE_START( md_sram )
{
- machine->add_notifier(MACHINE_NOTIFY_EXIT, genesis_machine_stop);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, genesis_machine_stop);
}
/******* 32X image loading *******/
@@ -1962,31 +1962,31 @@ static DEVICE_IMAGE_LOAD( _32x_cart )
if (image.software_entry() == NULL)
{
length = image.length();
- temp_copy = auto_alloc_array(image.device().machine, UINT8, length);
+ temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
image.fread( temp_copy, length);
}
else
{
length = image.get_software_region_length("rom");
- temp_copy = auto_alloc_array(image.device().machine, UINT8, length);
+ temp_copy = auto_alloc_array(image.device().machine(), UINT8, length);
memcpy(temp_copy, image.get_software_region("rom"), length);
}
/* Copy the cart image in the locations the driver expects */
// Notice that, by using pick_integer, we are sure the code works on both LE and BE machines
- ROM16 = (UINT16 *) image.device().machine->region("gamecart")->base();
+ ROM16 = (UINT16 *) image.device().machine().region("gamecart")->base();
for (i = 0; i < length; i += 2)
ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
- ROM32 = (UINT32 *) image.device().machine->region("gamecart_sh2")->base();
+ ROM32 = (UINT32 *) image.device().machine().region("gamecart_sh2")->base();
for (i = 0; i < length; i += 4)
ROM32[i / 4] = pick_integer_be(temp_copy, i, 4);
- ROM16 = (UINT16 *) image.device().machine->region("maincpu")->base();
+ ROM16 = (UINT16 *) image.device().machine().region("maincpu")->base();
for (i = 0x00; i < length; i += 2)
ROM16[i / 2] = pick_integer_be(temp_copy, i, 2);
- auto_free(image.device().machine, temp_copy);
+ auto_free(image.device().machine(), temp_copy);
return IMAGE_INIT_PASS;
}
diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c
index b3b399bd3af..7563e56b227 100644
--- a/src/mame/machine/megadriv.c
+++ b/src/mame/machine/megadriv.c
@@ -320,7 +320,7 @@ static int sh2_slave_vint_pending;
static int _32x_fb_swap;
static int _32x_hcount_reg,_32x_hcount_compare_val;
-void _32x_check_irqs(running_machine* machine);
+void _32x_check_irqs(running_machine& machine);
#define SH2_VRES_IRQ_LEVEL 14
#define SH2_VINT_IRQ_LEVEL 12
@@ -400,7 +400,7 @@ static UINT16* segacd_font_bits;
static UINT16 scd_rammode;
static UINT32 scd_mode_dmna_ret_flags ;
-static void segacd_mark_tiles_dirty(running_machine* machine, int offset);
+static void segacd_mark_tiles_dirty(running_machine& machine, int offset);
static struct genesis_z80_vars
{
@@ -629,7 +629,7 @@ static void vdp_vsram_write(UINT16 data)
megadrive_vdp_address &=0xffff;
}
-static void write_cram_value(running_machine *machine, int offset, int data)
+static void write_cram_value(running_machine &machine, int offset, int data)
{
megadrive_vdp_cram[offset] = data;
@@ -648,7 +648,7 @@ static void write_cram_value(running_machine *machine, int offset, int data)
}
}
-static void vdp_cram_write(running_machine *machine, UINT16 data)
+static void vdp_cram_write(running_machine &machine, UINT16 data)
{
int offset;
offset = (megadrive_vdp_address&0x7e)>>1;
@@ -661,7 +661,7 @@ static void vdp_cram_write(running_machine *machine, UINT16 data)
}
-static void megadriv_vdp_data_port_w(running_machine *machine, int data)
+static void megadriv_vdp_data_port_w(running_machine &machine, int data)
{
megadrive_vdp_command_pending = 0;
@@ -757,7 +757,7 @@ static void megadriv_vdp_data_port_w(running_machine *machine, int data)
-static void megadrive_vdp_set_register(running_machine *machine, int regnum, UINT8 value)
+static void megadrive_vdp_set_register(running_machine &machine, int regnum, UINT8 value)
{
megadrive_vdp_register[regnum] = value;
@@ -804,7 +804,7 @@ static void megadrive_vdp_set_register(running_machine *machine, int regnum, UIN
// if (regnum == 0x0a)
// mame_printf_debug("Set HINT Reload Register to %d on scanline %d\n",value, genesis_scanline_counter);
-// mame_printf_debug("%s: Setting VDP Register #%02x to %02x\n",machine->describe_context(), regnum,value);
+// mame_printf_debug("%s: Setting VDP Register #%02x to %02x\n",machine.describe_context(), regnum,value);
}
static void update_megadrive_vdp_code_and_address(void)
@@ -816,14 +816,14 @@ static void update_megadrive_vdp_code_and_address(void)
((megadrive_vdp_command_part2 & 0x0003) << 14);
}
-static UINT16 (*vdp_get_word_from_68k_mem)(running_machine *machine, UINT32 source);
+static UINT16 (*vdp_get_word_from_68k_mem)(running_machine &machine, UINT32 source);
-static UINT16 vdp_get_word_from_68k_mem_default(running_machine *machine, UINT32 source)
+static UINT16 vdp_get_word_from_68k_mem_default(running_machine &machine, UINT32 source)
{
// should we limit the valid areas here?
// how does this behave with the segacd etc?
// note, the RV bit on 32x is important for this to work, because it causes a normal cart mapping - see tempo
- address_space *space68k = machine->device<legacy_cpu_device>("maincpu")->space();
+ address_space *space68k = machine.device<legacy_cpu_device>("maincpu")->space();
//printf("vdp_get_word_from_68k_mem_default %08x\n", source);
@@ -850,7 +850,7 @@ static UINT16 vdp_get_word_from_68k_mem_default(running_machine *machine, UINT32
else
{
printf("DMA Read unmapped %06x\n",source);
- return machine->rand();
+ return machine.rand();
}
@@ -909,14 +909,14 @@ static void megadrive_do_insta_vram_copy(UINT32 source, UINT16 length)
}
/* Instant, but we pause the 68k a bit */
-static void megadrive_do_insta_68k_to_vram_dma(running_machine *machine, UINT32 source,int length)
+static void megadrive_do_insta_68k_to_vram_dma(running_machine &machine, UINT32 source,int length)
{
int count;
if (length==0x00) length = 0xffff;
/* This is a hack until real DMA timings are implemented */
- device_spin_until_time(machine->device("maincpu"), attotime::from_nsec(length * 1000 / 3500));
+ device_spin_until_time(machine.device("maincpu"), attotime::from_nsec(length * 1000 / 3500));
for (count = 0;count<(length>>1);count++)
{
@@ -936,7 +936,7 @@ static void megadrive_do_insta_68k_to_vram_dma(running_machine *machine, UINT32
}
-static void megadrive_do_insta_68k_to_cram_dma(running_machine *machine,UINT32 source,UINT16 length)
+static void megadrive_do_insta_68k_to_cram_dma(running_machine &machine,UINT32 source,UINT16 length)
{
int count;
@@ -964,7 +964,7 @@ static void megadrive_do_insta_68k_to_cram_dma(running_machine *machine,UINT32 s
}
-static void megadrive_do_insta_68k_to_vsram_dma(running_machine *machine,UINT32 source,UINT16 length)
+static void megadrive_do_insta_68k_to_vsram_dma(running_machine &machine,UINT32 source,UINT16 length)
{
int count;
@@ -992,7 +992,7 @@ static void megadrive_do_insta_68k_to_vsram_dma(running_machine *machine,UINT32
}
/* This can be simplified quite a lot.. */
-static void handle_dma_bits(running_machine *machine)
+static void handle_dma_bits(running_machine &machine)
{
if (megadrive_vdp_code&0x20)
@@ -1001,7 +1001,7 @@ static void handle_dma_bits(running_machine *machine)
UINT16 length;
source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0xff)<<16))<<1;
length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1;
- // mame_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine->describe_context(), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC);
+ // mame_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine.describe_context(), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC);
}
@@ -1124,7 +1124,7 @@ static void handle_dma_bits(running_machine *machine)
}
}
-static void megadriv_vdp_ctrl_port_w(running_machine *machine, int data)
+static void megadriv_vdp_ctrl_port_w(running_machine &machine, int data)
{
// logerror("write to vdp control port %04x\n",data);
megadrive_vram_fill_pending = 0; // ??
@@ -1181,13 +1181,13 @@ WRITE16_HANDLER( megadriv_vdp_w )
data = (data&0xff00) | data>>8;
// mame_printf_debug("8-bit write VDP data port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
}
- megadriv_vdp_data_port_w(space->machine, data);
+ megadriv_vdp_data_port_w(space->machine(), data);
break;
case 0x04:
case 0x06:
if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit write VDP control port access, offset %04x data %04x mem_mask %04x\n",offset,data,mem_mask);
- megadriv_vdp_ctrl_port_w(space->machine, data);
+ megadriv_vdp_ctrl_port_w(space->machine(), data);
break;
case 0x08:
@@ -1201,8 +1201,8 @@ WRITE16_HANDLER( megadriv_vdp_w )
case 0x12:
case 0x14:
case 0x16:
- if (ACCESSING_BITS_0_7) sn76496_w(space->machine->device("snsnd"), 0, data & 0xff);
- //if (ACCESSING_BITS_8_15) sn76496_w(space->machine->device("snsnd"), 0, (data >>8) & 0xff);
+ if (ACCESSING_BITS_0_7) sn76496_w(space->machine().device("snsnd"), 0, data & 0xff);
+ //if (ACCESSING_BITS_8_15) sn76496_w(space->machine().device("snsnd"), 0, (data >>8) & 0xff);
break;
default:
@@ -1226,11 +1226,11 @@ static UINT16 vdp_cram_r(void)
return megadrive_vdp_cram[(megadrive_vdp_address&0x7e)>>1];
}
-static UINT16 megadriv_vdp_data_port_r(running_machine *machine)
+static UINT16 megadriv_vdp_data_port_r(running_machine &machine)
{
UINT16 retdata=0;
- //return machine->rand();
+ //return machine.rand();
megadrive_vdp_command_pending = 0;
@@ -1244,12 +1244,12 @@ static UINT16 megadriv_vdp_data_port_r(running_machine *machine)
case 0x0001:
logerror("Attempting to READ from DATA PORT in VRAM WRITE MODE\n");
- retdata = machine->rand();
+ retdata = machine.rand();
break;
case 0x0003:
logerror("Attempting to READ from DATA PORT in CRAM WRITE MODE\n");
- retdata = machine->rand();
+ retdata = machine.rand();
break;
case 0x0004:
@@ -1270,7 +1270,7 @@ static UINT16 megadriv_vdp_data_port_r(running_machine *machine)
default:
logerror("Attempting to READ from DATA PORT in #UNDEFINED# MODE\n");
- retdata = machine->rand();
+ retdata = machine.rand();
break;
}
@@ -1570,14 +1570,14 @@ READ16_HANDLER( megadriv_vdp_r )
case 0x00:
case 0x02:
if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read data port access, offset %04x mem_mask %04x\n",offset,mem_mask);
- retvalue = megadriv_vdp_data_port_r(space->machine);
+ retvalue = megadriv_vdp_data_port_r(space->machine());
break;
case 0x04:
case 0x06:
// if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read control port access, offset %04x mem_mask %04x\n",offset,mem_mask);
retvalue = megadriv_vdp_ctrl_port_r();
- // retvalue = space->machine->rand();
+ // retvalue = space->machine().rand();
// mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",cpu_get_pc(space->cpu),genesis_scanline_counter, get_hposition(),retvalue);
break;
@@ -1587,7 +1587,7 @@ READ16_HANDLER( megadriv_vdp_r )
case 0x0e:
// if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask);
retvalue = megadriv_read_hv_counters();
- // retvalue = space->machine->rand();
+ // retvalue = space->machine().rand();
// mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",cpu_get_pc(space->cpu),genesis_scanline_counter, get_hposition(),retvalue);
break;
@@ -1611,7 +1611,7 @@ READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
}
else
{
- logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", device->machine->describe_context());
+ logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", device->machine().describe_context());
return 0;
}
@@ -1629,7 +1629,7 @@ WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
}
else
{
- logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", device->machine->describe_context());
+ logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", device->machine().describe_context());
}
}
@@ -1642,19 +1642,19 @@ static TIMER_CALLBACK( io_timeout_timer_callback )
io_stage[(int)(FPTR)ptr] = -1;
}
-static void init_megadri6_io(running_machine *machine)
+static void init_megadri6_io(running_machine &machine)
{
int i;
for (i=0; i<3; i++)
{
- io_timeout[i] = machine->scheduler().timer_alloc(FUNC(io_timeout_timer_callback), (void*)(FPTR)i);
+ io_timeout[i] = machine.scheduler().timer_alloc(FUNC(io_timeout_timer_callback), (void*)(FPTR)i);
}
}
/* pointers to our io data read/write functions */
-UINT8 (*megadrive_io_read_data_port_ptr)(running_machine *machine, int offset);
-void (*megadrive_io_write_data_port_ptr)(running_machine *machine, int offset, UINT16 data);
+UINT8 (*megadrive_io_read_data_port_ptr)(running_machine &machine, int offset);
+void (*megadrive_io_write_data_port_ptr)(running_machine &machine, int offset, UINT16 data);
/*
@@ -1756,7 +1756,7 @@ UINT8 megadrive_io_ctrl_regs[3];
static UINT8 megadrive_io_tx_regs[3];
int megadrive_6buttons_pad = 0;
-static void megadrive_reset_io(running_machine *machine)
+static void megadrive_reset_io(running_machine &machine)
{
int i;
@@ -1777,7 +1777,7 @@ static void megadrive_reset_io(running_machine *machine)
}
/************* 6 buttons version **************************/
-static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int portnum)
+static UINT8 megadrive_io_read_data_port_6button(running_machine &machine, int portnum)
{
UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs
static const char *const pad3names[] = { "PAD1", "PAD2", "IN0", "UNK" };
@@ -1829,7 +1829,7 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
/************* 3 buttons version **************************/
-static UINT8 megadrive_io_read_data_port_3button(running_machine *machine, int portnum)
+static UINT8 megadrive_io_read_data_port_3button(running_machine &machine, int portnum)
{
UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from megadrive_io_data_regs
static const char *const pad3names[] = { "PAD1", "PAD2", "IN0", "UNK" };
@@ -1852,7 +1852,7 @@ static UINT8 megadrive_io_read_data_port_3button(running_machine *machine, int p
}
/* used by megatech bios, the test mode accesses the joypad/stick inputs like this */
-UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl)
+UINT8 megatech_bios_port_cc_dc_r(running_machine &machine, int offset, int ctrl)
{
UINT8 retdata;
@@ -1921,7 +1921,7 @@ READ16_HANDLER( megadriv_68k_io_read )
D0 : Bit 0 of version number
*/
- //return (space->machine->rand()&0x0f0f)|0xf0f0;//0x0000;
+ //return (space->machine().rand()&0x0f0f)|0xf0f0;//0x0000;
switch (offset)
{
case 0:
@@ -1942,7 +1942,7 @@ READ16_HANDLER( megadriv_68k_io_read )
case 0x2:
case 0x3:
// retdata = megadrive_io_read_data_port(offset-1);
- retdata = megadrive_io_read_data_port_ptr(space->machine, offset-1);
+ retdata = megadrive_io_read_data_port_ptr(space->machine(), offset-1);
break;
case 0x4:
@@ -1971,7 +1971,7 @@ READ16_HANDLER( megadriv_68k_io_read )
}
-static void megadrive_io_write_data_port_3button(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_data_port_3button(running_machine &machine, int portnum, UINT16 data)
{
megadrive_io_data_regs[portnum] = data;
//mame_printf_debug("Writing IO Data Register #%d data %04x\n",portnum,data);
@@ -1981,14 +1981,14 @@ static void megadrive_io_write_data_port_3button(running_machine *machine, int p
/****************************** 6 buttons version*****************************/
-static void megadrive_io_write_data_port_6button(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_data_port_6button(running_machine &machine, int portnum, UINT16 data)
{
if (megadrive_io_ctrl_regs[portnum]&0x40)
{
if (((megadrive_io_data_regs[portnum]&0x40)==0x00) && ((data&0x40) == 0x40))
{
io_stage[portnum]++;
- io_timeout[portnum]->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ io_timeout[portnum]->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
}
@@ -2001,23 +2001,23 @@ static void megadrive_io_write_data_port_6button(running_machine *machine, int p
/*************************** 3 buttons version ****************************/
-static void megadrive_io_write_ctrl_port(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_ctrl_port(running_machine &machine, int portnum, UINT16 data)
{
megadrive_io_ctrl_regs[portnum] = data;
// mame_printf_debug("Setting IO Control Register #%d data %04x\n",portnum,data);
}
-static void megadrive_io_write_tx_port(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_tx_port(running_machine &machine, int portnum, UINT16 data)
{
megadrive_io_tx_regs[portnum] = data;
}
-static void megadrive_io_write_rx_port(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_rx_port(running_machine &machine, int portnum, UINT16 data)
{
}
-static void megadrive_io_write_sctrl_port(running_machine *machine, int portnum, UINT16 data)
+static void megadrive_io_write_sctrl_port(running_machine &machine, int portnum, UINT16 data)
{
}
@@ -2040,30 +2040,30 @@ WRITE16_HANDLER( megadriv_68k_io_write )
case 0x2:
case 0x3:
// megadrive_io_write_data_port(offset-1,data);
- megadrive_io_write_data_port_ptr(space->machine, offset-1,data);
+ megadrive_io_write_data_port_ptr(space->machine(), offset-1,data);
break;
case 0x4:
case 0x5:
case 0x6:
- megadrive_io_write_ctrl_port(space->machine,offset-4,data);
+ megadrive_io_write_ctrl_port(space->machine(),offset-4,data);
break;
/* Serial I/O Registers */
- case 0x7: megadrive_io_write_tx_port(space->machine,0,data); break;
- case 0x8: megadrive_io_write_rx_port(space->machine,0,data); break;
- case 0x9: megadrive_io_write_sctrl_port(space->machine,0,data); break;
+ case 0x7: megadrive_io_write_tx_port(space->machine(),0,data); break;
+ case 0x8: megadrive_io_write_rx_port(space->machine(),0,data); break;
+ case 0x9: megadrive_io_write_sctrl_port(space->machine(),0,data); break;
- case 0xa: megadrive_io_write_tx_port(space->machine,1,data); break;
- case 0xb: megadrive_io_write_rx_port(space->machine,1,data); break;
- case 0xc: megadrive_io_write_sctrl_port(space->machine,1,data); break;
+ case 0xa: megadrive_io_write_tx_port(space->machine(),1,data); break;
+ case 0xb: megadrive_io_write_rx_port(space->machine(),1,data); break;
+ case 0xc: megadrive_io_write_sctrl_port(space->machine(),1,data); break;
break;
- case 0xd: megadrive_io_write_tx_port(space->machine,2,data); break;
- case 0xe: megadrive_io_write_rx_port(space->machine,2,data); break;
- case 0xf: megadrive_io_write_sctrl_port(space->machine,2,data); break;
+ case 0xd: megadrive_io_write_tx_port(space->machine(),2,data); break;
+ case 0xe: megadrive_io_write_rx_port(space->machine(),2,data); break;
+ case 0xf: megadrive_io_write_sctrl_port(space->machine(),2,data); break;
break;
}
@@ -2114,7 +2114,7 @@ static READ16_HANDLER( megadriv_68k_read_z80_ram )
else
{
logerror("%06x: 68000 attempting to access Z80 (read) address space without bus\n", cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
}
@@ -2156,7 +2156,7 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus )
the value is never zero. Time Killers is the most fussy, and doesn't like the
read_next_instruction function from system16, so I just return a random value
in the unused bits */
- UINT16 nextvalue = space->machine->rand();//read_next_instruction(space)&0xff00;
+ UINT16 nextvalue = space->machine().rand();//read_next_instruction(space)&0xff00;
/* Check if the 68k has the z80 bus */
@@ -2195,7 +2195,7 @@ static TIMER_CALLBACK( megadriv_z80_run_state )
if ( genz80.z80_is_reset )
{
devtag_reset( machine, "genesis_snd_z80" );
- machine->device<cpu_device>( "genesis_snd_z80" )->suspend(SUSPEND_REASON_HALT, 1 );
+ machine.device<cpu_device>( "genesis_snd_z80" )->suspend(SUSPEND_REASON_HALT, 1 );
devtag_reset( machine, "ymsnd" );
}
else
@@ -2203,11 +2203,11 @@ static TIMER_CALLBACK( megadriv_z80_run_state )
/* Check if z80 has the bus */
if ( genz80.z80_has_bus )
{
- machine->device<cpu_device>( "genesis_snd_z80" )->resume(SUSPEND_REASON_HALT );
+ machine.device<cpu_device>( "genesis_snd_z80" )->resume(SUSPEND_REASON_HALT );
}
else
{
- machine->device<cpu_device>( "genesis_snd_z80" )->suspend(SUSPEND_REASON_HALT, 1 );
+ machine.device<cpu_device>( "genesis_snd_z80" )->suspend(SUSPEND_REASON_HALT, 1 );
}
}
}
@@ -2258,7 +2258,7 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus )
/* If the z80 is running, sync the z80 execution state */
if ( ! genz80.z80_is_reset )
- space->machine->scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
+ space->machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
}
static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
@@ -2302,7 +2302,7 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
genz80.z80_is_reset = 1;
}
}
- space->machine->scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
+ space->machine().scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
}
@@ -2312,14 +2312,14 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset )
// z80 area of the 68k if games misbehave
static READ8_HANDLER( z80_read_68k_banked_data )
{
- address_space *space68k = space->machine->device<legacy_cpu_device>("maincpu")->space();
+ address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
UINT8 ret = space68k->read_byte(genz80.z80_bank_addr+offset);
return ret;
}
static WRITE8_HANDLER( z80_write_68k_banked_data )
{
- address_space *space68k = space->machine->device<legacy_cpu_device>("maincpu")->space();
+ address_space *space68k = space->machine().device<legacy_cpu_device>("maincpu")->space();
space68k->write_byte(genz80.z80_bank_addr+offset,data);
}
@@ -2332,7 +2332,7 @@ static WRITE8_HANDLER( megadriv_z80_vdp_write )
case 0x13:
case 0x15:
case 0x17:
- sn76496_w(space->machine->device("snsnd"), 0, data);
+ sn76496_w(space->machine().device("snsnd"), 0, data);
break;
default:
@@ -2346,7 +2346,7 @@ static WRITE8_HANDLER( megadriv_z80_vdp_write )
static READ8_HANDLER( megadriv_z80_vdp_read )
{
mame_printf_debug("megadriv_z80_vdp_read %02x\n",offset);
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( megadriv_z80_unmapped_read )
@@ -2441,7 +2441,7 @@ static WRITE16_HANDLER( _32x_68k_palette_w )
_32x_palette_lookup[offset] = (r << 10) | (g << 5) | (b << 0) | (p << 15);
- palette_set_color_rgb(space->machine,offset+0x40,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offset+0x40,pal5bit(r),pal5bit(g),pal5bit(b));
}
@@ -2561,7 +2561,7 @@ static WRITE16_HANDLER( _32x_68k_a15106_w )
// install the game rom in the normal 0x000000-0x03fffff space used by the genesis - this allows VDP DMA operations to work as they have to be from this area or RAM
// it should also UNMAP the banked rom area...
- space->install_rom(0x0000100, 0x03fffff, space->machine->region("gamecart")->base() + 0x100);
+ space->install_rom(0x0000100, 0x03fffff, space->machine().region("gamecart")->base() + 0x100);
}
else
{
@@ -2569,7 +2569,7 @@ static WRITE16_HANDLER( _32x_68k_a15106_w )
// this is actually blank / nop area
// we should also map the banked area back (we don't currently unmap it tho)
- space->install_rom(0x0000100, 0x03fffff, space->machine->region("maincpu")->base()+0x100);
+ space->install_rom(0x0000100, 0x03fffff, space->machine().region("maincpu")->base()+0x100);
}
if((a15106_reg & 4) == 0) // clears the FIFO state
@@ -2602,7 +2602,7 @@ static UINT16 dreq_src_addr[2],dreq_dst_addr[2],dreq_size;
static READ16_HANDLER( _32x_dreq_common_r )
{
- address_space* _68kspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* _68kspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
switch (offset)
{
@@ -2673,7 +2673,7 @@ static READ16_HANDLER( _32x_dreq_common_r )
static WRITE16_HANDLER( _32x_dreq_common_w )
{
- address_space* _68kspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* _68kspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
switch (offset)
{
@@ -2759,8 +2759,8 @@ static WRITE16_HANDLER( _32x_dreq_common_w )
current_fifo_block = fifo_block_b;
current_fifo_readblock = fifo_block_a;
// incase we have a stalled DMA in progress, let the SH2 know there is data available
- sh2_notify_dma_data_available(space->machine->device("32x_master_sh2"));
- sh2_notify_dma_data_available(space->machine->device("32x_slave_sh2"));
+ sh2_notify_dma_data_available(space->machine().device("32x_master_sh2"));
+ sh2_notify_dma_data_available(space->machine().device("32x_slave_sh2"));
}
current_fifo_write_pos = 0;
@@ -2774,8 +2774,8 @@ static WRITE16_HANDLER( _32x_dreq_common_w )
current_fifo_block = fifo_block_a;
current_fifo_readblock = fifo_block_b;
// incase we have a stalled DMA in progress, let the SH2 know there is data available
- sh2_notify_dma_data_available(space->machine->device("32x_master_sh2"));
- sh2_notify_dma_data_available(space->machine->device("32x_slave_sh2"));
+ sh2_notify_dma_data_available(space->machine().device("32x_master_sh2"));
+ sh2_notify_dma_data_available(space->machine().device("32x_slave_sh2"));
}
@@ -2861,12 +2861,12 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
if (data & 0x01)
{
_32x_adapter_enabled = 1;
- space->install_rom(0x0880000, 0x08fffff, space->machine->region("gamecart")->base()); // 'fixed' 512kb rom bank
+ space->install_rom(0x0880000, 0x08fffff, space->machine().region("gamecart")->base()); // 'fixed' 512kb rom bank
space->install_read_bank(0x0900000, 0x09fffff, "bank12"); // 'bankable' 1024kb rom bank
- memory_set_bankptr(space->machine, "bank12", space->machine->region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
+ memory_set_bankptr(space->machine(), "bank12", space->machine().region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
- space->install_rom(0x0000000, 0x03fffff, space->machine->region("32x_68k_bios")->base());
+ space->install_rom(0x0000000, 0x03fffff, space->machine().region("32x_68k_bios")->base());
/* VDP area */
space->install_legacy_readwrite_handler(0x0a15180, 0x0a1518b, FUNC(_32x_common_vdp_regs_r), FUNC(_32x_common_vdp_regs_w)); // common / shared VDP regs
@@ -2876,14 +2876,14 @@ static WRITE16_HANDLER( _32x_68k_a15100_w )
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
}
else
{
_32x_adapter_enabled = 0;
- space->install_rom(0x0000000, 0x03fffff, space->machine->region("gamecart")->base());
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
+ space->install_rom(0x0000000, 0x03fffff, space->machine().region("gamecart")->base());
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
}
}
@@ -2950,7 +2950,7 @@ static WRITE16_HANDLER( _32x_68k_a15104_w )
_32x_68k_a15104_reg = (_32x_68k_a15104_reg & 0x00ff) | (data & 0xff00);
}
- memory_set_bankptr(space->machine, "bank12", space->machine->region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
+ memory_set_bankptr(space->machine(), "bank12", space->machine().region("gamecart")->base()+((_32x_68k_a15104_reg&0x3)*0x100000) );
}
/**********************************************************************************************/
@@ -2966,7 +2966,7 @@ static UINT16 commsram[8];
// reads
static READ16_HANDLER( _32x_68k_commsram_r )
{
- if (_32X_COMMS_PORT_SYNC) space->machine->scheduler().synchronize();
+ if (_32X_COMMS_PORT_SYNC) space->machine().scheduler().synchronize();
return commsram[offset];
}
@@ -2974,7 +2974,7 @@ static READ16_HANDLER( _32x_68k_commsram_r )
static WRITE16_HANDLER( _32x_68k_commsram_w )
{
COMBINE_DATA(&commsram[offset]);
- if (_32X_COMMS_PORT_SYNC) space->machine->scheduler().synchronize();
+ if (_32X_COMMS_PORT_SYNC) space->machine().scheduler().synchronize();
}
/**********************************************************************************************/
@@ -3026,8 +3026,8 @@ static TIMER_CALLBACK( _32x_pwm_callback )
switch(pwm_ctrl & 3)
{
case 0: lch_index_r++; /*Speaker OFF*/ break;
- case 1: dac_signed_data_16_w(machine->device("lch_pwm"), cur_lch[lch_index_r++]); break;
- case 2: dac_signed_data_16_w(machine->device("rch_pwm"), cur_lch[lch_index_r++]); break;
+ case 1: dac_signed_data_16_w(machine.device("lch_pwm"), cur_lch[lch_index_r++]); break;
+ case 2: dac_signed_data_16_w(machine.device("rch_pwm"), cur_lch[lch_index_r++]); break;
case 3: popmessage("Undefined PWM Lch value 3, contact MESSdev"); break;
}
@@ -3041,8 +3041,8 @@ static TIMER_CALLBACK( _32x_pwm_callback )
switch((pwm_ctrl & 0xc) >> 2)
{
case 0: rch_index_r++; /*Speaker OFF*/ break;
- case 1: dac_signed_data_16_w(machine->device("rch_pwm"), cur_rch[rch_index_r++]); break;
- case 2: dac_signed_data_16_w(machine->device("lch_pwm"), cur_rch[rch_index_r++]); break;
+ case 1: dac_signed_data_16_w(machine.device("rch_pwm"), cur_rch[rch_index_r++]); break;
+ case 2: dac_signed_data_16_w(machine.device("lch_pwm"), cur_rch[rch_index_r++]); break;
case 3: popmessage("Undefined PWM Rch value 3, contact MESSdev"); break;
}
@@ -3241,7 +3241,7 @@ static WRITE16_HANDLER( _32x_common_vdp_regs_w )
{
// what happens if the z80 accesses it, what authorization do we use? which address space do we get?? the z80 *can* write here and to the framebuffer via the window
- address_space* _68kspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* _68kspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
if (space!= _68kspace)
{
@@ -3401,7 +3401,7 @@ static WRITE16_HANDLER( _32x_sh2_master_4000_w )
//if (sh2_master_hint_enable) printf("sh2_master_hint_enable enable!\n");
//if (sh2_master_pwmint_enable) printf("sh2_master_pwn_enable enable!\n");
- _32x_check_irqs(space->machine);
+ _32x_check_irqs(space->machine());
}
}
@@ -3439,7 +3439,7 @@ static WRITE16_HANDLER( _32x_sh2_slave_4000_w )
//if (sh2_slave_hint_enable) printf("sh2_slave_hint_enable enable!\n");
//if (sh2_slave_pwmint_enable) printf("sh2_slave_pwm_enable enable!\n");
- _32x_check_irqs(space->machine);
+ _32x_check_irqs(space->machine());
}
}
@@ -3508,8 +3508,8 @@ static WRITE16_HANDLER( _32x_sh2_slave_4014_w ) { device_set_input_line(_32x_sla
// VINT (vertical interrupt) clear
/**********************************************************************************************/
-static WRITE16_HANDLER( _32x_sh2_master_4016_w ){ sh2_master_vint_pending = 0; _32x_check_irqs(space->machine); }
-static WRITE16_HANDLER( _32x_sh2_slave_4016_w ) { sh2_slave_vint_pending = 0; _32x_check_irqs(space->machine); }
+static WRITE16_HANDLER( _32x_sh2_master_4016_w ){ sh2_master_vint_pending = 0; _32x_check_irqs(space->machine()); }
+static WRITE16_HANDLER( _32x_sh2_slave_4016_w ) { sh2_slave_vint_pending = 0; _32x_check_irqs(space->machine()); }
/**********************************************************************************************/
// SH2 side 4018
@@ -3967,7 +3967,7 @@ UINT16* segacd_dataram;
-INLINE void write_pixel(running_machine* machine, UINT8 pix, int pixeloffset )
+INLINE void write_pixel(running_machine& machine, UINT8 pix, int pixeloffset )
{
int shift = 12-(4*(pixeloffset&0x3));
@@ -4003,7 +4003,7 @@ INLINE void write_pixel(running_machine* machine, UINT8 pix, int pixeloffset )
default:
case 0x03:
- pix = machine->rand() & 0x000f;
+ pix = machine.rand() & 0x000f;
segacd_dataram[offset] = segacd_dataram[offset] &~ datamask;
segacd_dataram[offset] |= pix << shift;
break;
@@ -4028,7 +4028,7 @@ UINT16 segacd_1meg_mode_word_read(int offset, UINT16 mem_mask)
}
-void segacd_1meg_mode_word_write(running_machine* machine, int offset, UINT16 data, UINT16 mem_mask, int use_pm)
+void segacd_1meg_mode_word_write(running_machine& machine, int offset, UINT16 data, UINT16 mem_mask, int use_pm)
{
offset *= 2;
@@ -4205,7 +4205,7 @@ void CDC_UpdateHEAD(void)
}
-void scd_ctrl_checks(running_machine* machine)
+void scd_ctrl_checks(running_machine& machine)
{
CDC_STATB0 = 0x80;
@@ -4231,7 +4231,7 @@ void scd_advance_current_readpos(void)
CDC_PT &= 0x7fff;
}
-int Read_LBA_To_Buffer(running_machine* machine)
+int Read_LBA_To_Buffer(running_machine& machine)
{
bool data_track = false;
if (CDD_CONTROL & 0x0100) data_track = true;
@@ -4273,7 +4273,7 @@ int Read_LBA_To_Buffer(running_machine* machine)
return 0;
}
-static void CheckCommand(running_machine* machine)
+static void CheckCommand(running_machine& machine)
{
if (CDD_DONE)
{
@@ -4299,14 +4299,14 @@ void CDD_GetStatus(void)
}
-void CDD_Stop(running_machine *machine)
+void CDD_Stop(running_machine &machine)
{
CLEAR_CDD_RESULT
STOP_CDC_READ
SCD_STATUS = CDD_STOPPED;
CDD_STATUS = 0x0000;
SET_CDD_DATA_MODE
- cdda_stop_audio( machine->device( "cdda" ) ); //stop any pending CD-DA
+ cdda_stop_audio( machine.device( "cdda" ) ); //stop any pending CD-DA
}
@@ -4422,7 +4422,7 @@ static UINT32 getmsf_from_regs(void)
return msf;
}
-void CDD_Play(running_machine *machine)
+void CDD_Play(running_machine &machine)
{
CLEAR_CDD_RESULT
UINT32 msf = getmsf_from_regs();
@@ -4436,7 +4436,7 @@ void CDD_Play(running_machine *machine)
printf("%d Track played\n",SCD_CURTRK);
CDD_MIN = to_bcd(SCD_CURTRK, false);
if(!(CURRENT_TRACK_IS_DATA))
- cdda_start_audio( machine->device( "cdda" ), SCD_CURLBA, end_msf - SCD_CURLBA );
+ cdda_start_audio( machine.device( "cdda" ), SCD_CURLBA, end_msf - SCD_CURLBA );
SET_CDC_READ
}
@@ -4455,7 +4455,7 @@ void CDD_Seek(void)
}
-void CDD_Pause(running_machine *machine)
+void CDD_Pause(running_machine &machine)
{
CLEAR_CDD_RESULT
STOP_CDC_READ
@@ -4463,12 +4463,12 @@ void CDD_Pause(running_machine *machine)
CDD_STATUS = SCD_STATUS;
SET_CDD_DATA_MODE
- //segacd.current_frame = cdda_get_audio_lba( machine->device( "cdda" ) );
+ //segacd.current_frame = cdda_get_audio_lba( machine.device( "cdda" ) );
//if(!(CURRENT_TRACK_IS_DATA))
- cdda_pause_audio( machine->device( "cdda" ), 1 );
+ cdda_pause_audio( machine.device( "cdda" ), 1 );
}
-void CDD_Resume(running_machine *machine)
+void CDD_Resume(running_machine &machine)
{
CLEAR_CDD_RESULT
STOP_CDC_READ
@@ -4479,17 +4479,17 @@ void CDD_Resume(running_machine *machine)
CDD_MIN = to_bcd (SCD_CURTRK, false);
SET_CDC_READ
//if(!(CURRENT_TRACK_IS_DATA))
- cdda_pause_audio( machine->device( "cdda" ), 0 );
+ cdda_pause_audio( machine.device( "cdda" ), 0 );
}
-void CDD_FF(running_machine *machine)
+void CDD_FF(running_machine &machine)
{
fatalerror("Fast Forward unsupported\n");
}
-void CDD_RW(running_machine *machine)
+void CDD_RW(running_machine &machine)
{
fatalerror("Fast Rewind unsupported\n");
}
@@ -4564,7 +4564,7 @@ void lc89510_Reset(void)
CDC_REG0 = CDC_REG1 = CDC_DMA_ADDR = SCD_STATUS_CDC = CDD_DONE = 0;
}
-void CDC_End_Transfer(running_machine* machine)
+void CDC_End_Transfer(running_machine& machine)
{
STOP_CDC_DMA
CDC_REG0 |= 0x8000;
@@ -4578,9 +4578,9 @@ void CDC_End_Transfer(running_machine* machine)
}
}
-void CDC_Do_DMA(running_machine* machine, int rate)
+void CDC_Do_DMA(running_machine& machine, int rate)
{
- address_space* space = machine->device("segacd_68k")->memory().space(AS_PROGRAM);
+ address_space* space = machine.device("segacd_68k")->memory().space(AS_PROGRAM);
UINT32 dstoffset, length;
UINT8 *dest;
@@ -4661,7 +4661,7 @@ void CDC_Do_DMA(running_machine* machine, int rate)
dest[dstoffset+1] = data >>8;
dest[dstoffset+0] = data&0xff;
- segacd_mark_tiles_dirty(space->machine, dstoffset/2);
+ segacd_mark_tiles_dirty(space->machine(), dstoffset/2);
}
else
{
@@ -4669,11 +4669,11 @@ void CDC_Do_DMA(running_machine* machine, int rate)
if (!(scd_rammode & 1))
{
- segacd_1meg_mode_word_write(space->machine,(dstoffset+0x20000)/2, data, 0xffff, 0);
+ segacd_1meg_mode_word_write(space->machine(),(dstoffset+0x20000)/2, data, 0xffff, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine,(dstoffset+0x00000)/2, data, 0xffff, 0);
+ segacd_1meg_mode_word_write(space->machine(),(dstoffset+0x00000)/2, data, 0xffff, 0);
}
}
@@ -4712,7 +4712,7 @@ void CDC_Do_DMA(running_machine* machine, int rate)
-UINT16 CDC_Host_r(running_machine* machine, UINT16 type)
+UINT16 CDC_Host_r(running_machine& machine, UINT16 type)
{
UINT16 destination = CDC_REG0 & 0x0700;
@@ -4838,7 +4838,7 @@ void CDC_Reg_w(UINT8 data)
}
}
-void CDD_Process(running_machine* machine, int reason)
+void CDD_Process(running_machine& machine, int reason)
{
CDD_Export();
CHECK_SCD_LV4_INTERRUPT
@@ -4881,7 +4881,7 @@ static const char *const CDD_import_cmdnames[] =
"<undefined>" // F
};
-void CDD_Import(running_machine* machine)
+void CDD_Import(running_machine& machine)
{
if(CDD_TX[1] != 2 && CDD_TX[1] != 0)
printf("%s\n",CDD_import_cmdnames[CDD_TX[1]]);
@@ -4927,7 +4927,7 @@ static tilemap_t *segacd_stampmap[4];
static WRITE16_HANDLER( scd_a12000_halt_reset_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
UINT16 old_halt = a12000_halt_reset_reg;
@@ -4938,24 +4938,24 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
// reset line
if (a12000_halt_reset_reg&0x0001)
{
- cputag_set_input_line(space->machine, "segacd_68k", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "segacd_68k", INPUT_LINE_RESET, CLEAR_LINE);
if (!(old_halt&0x0001)) printf("clear reset slave\n");
}
else
{
- cputag_set_input_line(space->machine, "segacd_68k", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "segacd_68k", INPUT_LINE_RESET, ASSERT_LINE);
if ((old_halt&0x0001)) printf("assert reset slave\n");
}
// request BUS
if (a12000_halt_reset_reg&0x0002)
{
- cputag_set_input_line(space->machine, "segacd_68k", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "segacd_68k", INPUT_LINE_HALT, ASSERT_LINE);
if (!(old_halt&0x0002)) printf("halt slave\n");
}
else
{
- cputag_set_input_line(space->machine, "segacd_68k", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "segacd_68k", INPUT_LINE_HALT, CLEAR_LINE);
if ((old_halt&0x0002)) printf("resume slave\n");
}
}
@@ -4964,7 +4964,7 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
{
if (a12000_halt_reset_reg&0x0100)
{
- running_machine* machine = space->machine;
+ running_machine& machine = space->machine();
CHECK_SCD_LV2_INTERRUPT
}
@@ -4980,7 +4980,7 @@ static WRITE16_HANDLER( scd_a12000_halt_reset_w )
static READ16_HANDLER( scd_a12000_halt_reset_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return a12000_halt_reset_reg;
}
@@ -4999,7 +4999,7 @@ static READ16_HANDLER( scd_a12000_halt_reset_r )
static READ16_HANDLER( scd_a12002_memory_mode_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
int temp = scd_rammode;
int temp2 = 0;
@@ -5037,7 +5037,7 @@ static WRITE8_HANDLER( scd_a12002_memory_mode_w_8_15 )
static WRITE8_HANDLER( scd_a12002_memory_mode_w_0_7 )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
//printf("scd_a12002_memory_mode_w_0_7 %04x\n",data);
@@ -5063,7 +5063,7 @@ static WRITE8_HANDLER( scd_a12002_memory_mode_w_0_7 )
static WRITE16_HANDLER( scd_a12002_memory_mode_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
scd_a12002_memory_mode_w_8_15(space, 0, data>>8);
@@ -5077,7 +5077,7 @@ static WRITE16_HANDLER( scd_a12002_memory_mode_w )
static READ16_HANDLER( segacd_sub_memory_mode_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
int temp = scd_rammode;
int temp2 = 0;
@@ -5099,7 +5099,7 @@ WRITE8_HANDLER( segacd_sub_memory_mode_w_8_15 )
WRITE8_HANDLER( segacd_sub_memory_mode_w_0_7 )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
segacd_memory_priority_mode = (data&0x0018)>>3;
@@ -5159,7 +5159,7 @@ WRITE8_HANDLER( segacd_sub_memory_mode_w_0_7 )
static WRITE16_HANDLER( segacd_sub_memory_mode_w )
{
//printf("segacd_sub_memory_mode_w %04x %04x\n", data, mem_mask);
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
segacd_sub_memory_mode_w_8_15(space, 0, data>>8);
@@ -5182,13 +5182,13 @@ static UINT16 segacd_comms_flags = 0x0000;
static READ16_HANDLER( segacd_comms_flags_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_comms_flags;
}
static WRITE16_HANDLER( segacd_comms_flags_subcpu_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15) // Dragon's Lair
{
@@ -5204,7 +5204,7 @@ static WRITE16_HANDLER( segacd_comms_flags_subcpu_w )
static WRITE16_HANDLER( segacd_comms_flags_maincpu_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
if (ACCESSING_BITS_8_15)
{
@@ -5244,7 +5244,7 @@ static IRQ_CALLBACK(segacd_sub_int_callback)
{
// clear this bit
a12000_halt_reset_reg &= ~0x0100;
- cputag_set_input_line(device->machine, "segacd_68k", 2, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "segacd_68k", 2, CLEAR_LINE);
}
return (0x60+irqline*4)/4; // vector address
@@ -5255,19 +5255,19 @@ UINT16 segacd_comms_part2[0x8];
static READ16_HANDLER( segacd_comms_main_part1_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_comms_part1[offset];
}
static WRITE16_HANDLER( segacd_comms_main_part1_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
COMBINE_DATA(&segacd_comms_part1[offset]);
}
static READ16_HANDLER( segacd_comms_main_part2_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_comms_part2[offset];
}
@@ -5279,7 +5279,7 @@ static WRITE16_HANDLER( segacd_comms_main_part2_w )
static READ16_HANDLER( segacd_comms_sub_part1_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_comms_part1[offset];
}
@@ -5290,13 +5290,13 @@ static WRITE16_HANDLER( segacd_comms_sub_part1_w )
static READ16_HANDLER( segacd_comms_sub_part2_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_comms_part2[offset];
}
static WRITE16_HANDLER( segacd_comms_sub_part2_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
COMBINE_DATA(&segacd_comms_part2[offset]);
}
@@ -5414,7 +5414,7 @@ static WRITE16_HANDLER( segacd_main_dataram_part1_w )
if (!(scd_rammode&1))
{
COMBINE_DATA(&segacd_dataram[offset]);
- segacd_mark_tiles_dirty(space->machine, offset);
+ segacd_mark_tiles_dirty(space->machine(), offset);
}
else
{
@@ -5432,11 +5432,11 @@ static WRITE16_HANDLER( segacd_main_dataram_part1_w )
// ret bit set by sub cpu determines which half of WorkRAM we have access to?
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine, offset+0x20000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space->machine(), offset+0x20000/2, data, mem_mask, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine, offset+0x00000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space->machine(), offset+0x00000/2, data, mem_mask, 0);
}
}
else
@@ -5465,13 +5465,13 @@ static READ16_HANDLER( scd_hint_vector_r )
static READ16_HANDLER( scd_a12006_hint_register_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_hint_register;
}
static WRITE16_HANDLER( scd_a12006_hint_register_w )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
COMBINE_DATA(&segacd_hint_register);
}
@@ -5673,25 +5673,25 @@ _32x32_START
_32x32_END
-static void segacd_mark_tiles_dirty(running_machine* machine, int offset)
+static void segacd_mark_tiles_dirty(running_machine& machine, int offset)
{
- gfx_element_mark_dirty(machine->gfx[0], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[1], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[2], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[3], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[4], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[5], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[6], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[7], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[0], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[1], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[2], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[3], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[4], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[5], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[6], (offset*2)/(SEGACD_BYTES_PER_TILE16));
+ gfx_element_mark_dirty(machine.gfx[7], (offset*2)/(SEGACD_BYTES_PER_TILE16));
- gfx_element_mark_dirty(machine->gfx[8], (offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[9], (offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[10],(offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[11],(offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[12],(offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[13],(offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[14],(offset*2)/(SEGACD_BYTES_PER_TILE32));
- gfx_element_mark_dirty(machine->gfx[15],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[8], (offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[9], (offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[10],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[11],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[12],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[13],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[14],(offset*2)/(SEGACD_BYTES_PER_TILE32));
+ gfx_element_mark_dirty(machine.gfx[15],(offset*2)/(SEGACD_BYTES_PER_TILE32));
}
@@ -5806,7 +5806,7 @@ static TILE_GET_INFO( get_stampmap_32x32_16x16_tile_info )
// non-tilemap functions to get a pixel from a 'tilemap' based on the above, but looking up each pixel, as to avoid the heavy cache bitmap
-INLINE UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine* machine, int xpos, int ypos)
+INLINE UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos)
{
const int tilesize = 4; // 0xf pixels
const int tilemapsize = 0x0f;
@@ -5836,7 +5836,7 @@ INLINE UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine* machine, in
int tile_region, tileno;
SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index);
- const gfx_element *gfx = machine->gfx[tile_region];
+ const gfx_element *gfx = machine.gfx[tile_region];
tileno %= gfx->total_elements;
if (tileno==0) return 0x00;
@@ -5845,7 +5845,7 @@ INLINE UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine* machine, in
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-INLINE UINT8 get_stampmap_32x32_1x1_tile_info_pixel(running_machine* machine, int xpos, int ypos)
+INLINE UINT8 get_stampmap_32x32_1x1_tile_info_pixel(running_machine& machine, int xpos, int ypos)
{
const int tilesize = 5; // 0x1f pixels
const int tilemapsize = 0x07;
@@ -5875,7 +5875,7 @@ INLINE UINT8 get_stampmap_32x32_1x1_tile_info_pixel(running_machine* machine, in
int tile_region, tileno;
SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index);
- const gfx_element *gfx = machine->gfx[tile_region];
+ const gfx_element *gfx = machine.gfx[tile_region];
tileno %= gfx->total_elements;
if (tileno==0) return 0x00; // does this apply in this mode?
@@ -5884,7 +5884,7 @@ INLINE UINT8 get_stampmap_32x32_1x1_tile_info_pixel(running_machine* machine, in
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-INLINE UINT8 get_stampmap_16x16_16x16_tile_info_pixel(running_machine* machine, int xpos, int ypos)
+INLINE UINT8 get_stampmap_16x16_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos)
{
const int tilesize = 4; // 0xf pixels
const int tilemapsize = 0xff;
@@ -5914,7 +5914,7 @@ INLINE UINT8 get_stampmap_16x16_16x16_tile_info_pixel(running_machine* machine,
int tile_region, tileno;
SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index);
- const gfx_element *gfx = machine->gfx[tile_region];
+ const gfx_element *gfx = machine.gfx[tile_region];
tileno %= gfx->total_elements;
if (tileno==0) return 0x00; // does this apply in this mode
@@ -5923,7 +5923,7 @@ INLINE UINT8 get_stampmap_16x16_16x16_tile_info_pixel(running_machine* machine,
return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))];
}
-INLINE UINT8 get_stampmap_32x32_16x16_tile_info_pixel(running_machine* machine, int xpos, int ypos)
+INLINE UINT8 get_stampmap_32x32_16x16_tile_info_pixel(running_machine& machine, int xpos, int ypos)
{
const int tilesize = 5; // 0x1f pixels
const int tilemapsize = 0x7f;
@@ -5953,7 +5953,7 @@ INLINE UINT8 get_stampmap_32x32_16x16_tile_info_pixel(running_machine* machine,
int tile_region, tileno;
SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index);
- const gfx_element *gfx = machine->gfx[tile_region];
+ const gfx_element *gfx = machine.gfx[tile_region];
tileno %= gfx->total_elements;
if (tileno==0) return 0x00;
@@ -5969,12 +5969,12 @@ static TIMER_CALLBACK( segacd_access_timer_callback )
READ16_HANDLER( cdc_data_sub_r )
{
- return CDC_Host_r(space->machine, READ_SUB);
+ return CDC_Host_r(space->machine(), READ_SUB);
}
READ16_HANDLER( cdc_data_main_r )
{
- return CDC_Host_r(space->machine, READ_MAIN);
+ return CDC_Host_r(space->machine(), READ_MAIN);
}
@@ -5996,9 +5996,9 @@ READ16_HANDLER( segacd_stopwatch_timer_r )
/* main CPU map set up in INIT */
-void segacd_init_main_cpu( running_machine* machine )
+void segacd_init_main_cpu( running_machine& machine )
{
- address_space* space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
segacd_4meg_prgbank = 0;
@@ -6006,67 +6006,67 @@ void segacd_init_main_cpu( running_machine* machine )
space->unmap_readwrite (0x020000,0x3fffff);
// space->install_read_bank(0x0020000, 0x003ffff, "scd_4m_prgbank");
-// memory_set_bankptr(space->machine, "scd_4m_prgbank", segacd_4meg_prgram + segacd_4meg_prgbank * 0x20000 );
+// memory_set_bankptr(space->machine(), "scd_4m_prgbank", segacd_4meg_prgram + segacd_4meg_prgbank * 0x20000 );
space->install_legacy_read_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_r) );
space->install_legacy_write_handler (0x0020000, 0x003ffff, FUNC(scd_4m_prgbank_ram_w) );
segacd_wordram_mapped = 1;
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x23ffff, FUNC(segacd_main_dataram_part1_r), FUNC(segacd_main_dataram_part1_w)); // RAM shared with sub
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x23ffff, FUNC(segacd_main_dataram_part1_r), FUNC(segacd_main_dataram_part1_w)); // RAM shared with sub
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect
- //space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w));
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU
- //space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r));
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12000, 0xa12001, FUNC(scd_a12000_halt_reset_r), FUNC(scd_a12000_halt_reset_w)); // sub-cpu control
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12002, 0xa12003, FUNC(scd_a12002_memory_mode_r), FUNC(scd_a12002_memory_mode_w)); // memory mode / write protect
+ //space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12004, 0xa12005, FUNC(segacd_cdc_mode_address_r), FUNC(segacd_cdc_mode_address_w));
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12006, 0xa12007, FUNC(scd_a12006_hint_register_r), FUNC(scd_a12006_hint_register_w)); // where HINT points on main CPU
+ //space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0xa12008, 0xa12009, FUNC(cdc_data_main_r));
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200c, 0xa1200d, FUNC(segacd_stopwatch_timer_r), FUNC(segacd_stopwatch_timer_w)); // starblad
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200c, 0xa1200d, FUNC(segacd_stopwatch_timer_r), FUNC(segacd_stopwatch_timer_w)); // starblad
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200e, 0xa1200f, FUNC(segacd_comms_flags_r), FUNC(segacd_comms_flags_maincpu_w)); // communication flags block
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1200e, 0xa1200f, FUNC(segacd_comms_flags_r), FUNC(segacd_comms_flags_maincpu_w)); // communication flags block
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w));
- space->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w));
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12010, 0xa1201f, FUNC(segacd_comms_main_part1_r), FUNC(segacd_comms_main_part1_w));
+ space->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa12020, 0xa1202f, FUNC(segacd_comms_main_part2_r), FUNC(segacd_comms_main_part2_w));
- device_set_irq_callback(machine->device("segacd_68k"), segacd_sub_int_callback);
+ device_set_irq_callback(machine.device("segacd_68k"), segacd_sub_int_callback);
space->install_legacy_read_handler (0x0000070, 0x0000073, FUNC(scd_hint_vector_r) );
- segacd_gfx_conversion_timer = machine->scheduler().timer_alloc(FUNC(segacd_gfx_conversion_timer_callback));
+ segacd_gfx_conversion_timer = machine.scheduler().timer_alloc(FUNC(segacd_gfx_conversion_timer_callback));
segacd_gfx_conversion_timer->adjust(attotime::never);
- //segacd_dmna_ret_timer = machine->scheduler().timer_alloc(FUNC(segacd_dmna_ret_timer_callback));
+ //segacd_dmna_ret_timer = machine.scheduler().timer_alloc(FUNC(segacd_dmna_ret_timer_callback));
segacd_gfx_conversion_timer->adjust(attotime::never);
- segacd_hock_timer = machine->scheduler().timer_alloc(FUNC(segacd_access_timer_callback));
+ segacd_hock_timer = machine.scheduler().timer_alloc(FUNC(segacd_access_timer_callback));
// segacd_hock_timer->adjust( attotime::from_nsec(20000000), 0, attotime::from_nsec(20000000));
segacd_hock_timer->adjust( attotime::from_hz(75),0, attotime::from_hz(75));
- segacd_irq3_timer = machine->scheduler().timer_alloc(FUNC(segacd_irq3_timer_callback));
+ segacd_irq3_timer = machine.scheduler().timer_alloc(FUNC(segacd_irq3_timer_callback));
segacd_irq3_timer->adjust(attotime::never);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[0] = gfx_element_alloc(machine, &sega_16x16_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[1] = gfx_element_alloc(machine, &sega_16x16_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[2] = gfx_element_alloc(machine, &sega_16x16_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[3] = gfx_element_alloc(machine, &sega_16x16_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[4] = gfx_element_alloc(machine, &sega_16x16_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[5] = gfx_element_alloc(machine, &sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[6] = gfx_element_alloc(machine, &sega_16x16_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[7] = gfx_element_alloc(machine, &sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
-
- machine->gfx[8] = gfx_element_alloc(machine, &sega_32x32_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[9] = gfx_element_alloc(machine, &sega_32x32_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[10]= gfx_element_alloc(machine, &sega_32x32_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[11]= gfx_element_alloc(machine, &sega_32x32_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[12]= gfx_element_alloc(machine, &sega_32x32_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[13]= gfx_element_alloc(machine, &sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[14]= gfx_element_alloc(machine, &sega_32x32_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
- machine->gfx[15]= gfx_element_alloc(machine, &sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[0] = gfx_element_alloc(machine, &sega_16x16_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[1] = gfx_element_alloc(machine, &sega_16x16_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[2] = gfx_element_alloc(machine, &sega_16x16_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[3] = gfx_element_alloc(machine, &sega_16x16_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[4] = gfx_element_alloc(machine, &sega_16x16_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[5] = gfx_element_alloc(machine, &sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[6] = gfx_element_alloc(machine, &sega_16x16_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[7] = gfx_element_alloc(machine, &sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+
+ machine.gfx[8] = gfx_element_alloc(machine, &sega_32x32_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[9] = gfx_element_alloc(machine, &sega_32x32_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[10]= gfx_element_alloc(machine, &sega_32x32_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[11]= gfx_element_alloc(machine, &sega_32x32_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[12]= gfx_element_alloc(machine, &sega_32x32_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[13]= gfx_element_alloc(machine, &sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[14]= gfx_element_alloc(machine, &sega_32x32_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
+ machine.gfx[15]= gfx_element_alloc(machine, &sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0);
segacd_stampmap[0] = tilemap_create(machine, get_stampmap_16x16_1x1_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
segacd_stampmap[1] = tilemap_create(machine, get_stampmap_32x32_1x1_tile_info, tilemap_scan_rows, 32, 32, 8, 8);
@@ -6083,7 +6083,7 @@ static TIMER_DEVICE_CALLBACK( scd_dma_timer_callback )
#define RATE 256
if (sega_cd_connected)
- CDC_Do_DMA(timer.machine, RATE);
+ CDC_Do_DMA(timer.machine(), RATE);
// timed reset of flags
scd_mode_dmna_ret_flags |= 0x0021;
@@ -6106,15 +6106,15 @@ static MACHINE_RESET( segacd )
{
device_t *device;
- device = machine->device("cdrom");
+ device = machine.device("cdrom");
if ( device )
{
segacd.cd = cd_get_cdrom_file(device);
if ( segacd.cd )
{
segacd.toc = cdrom_get_toc( segacd.cd );
- cdda_set_cdrom( machine->device("cdda"), segacd.cd );
- cdda_stop_audio( machine->device( "cdda" ) ); //stop any pending CD-DA
+ cdda_set_cdrom( machine.device("cdda"), segacd.cd );
+ cdda_stop_audio( machine.device( "cdda" ) ); //stop any pending CD-DA
}
}
}
@@ -6128,7 +6128,7 @@ static MACHINE_RESET( segacd )
hock_cmd = 0;
- stopwatch_timer = machine->device<timer_device>("sw_timer");
+ stopwatch_timer = machine.device<timer_device>("sw_timer");
scd_dma_timer->adjust(attotime::zero);
@@ -6238,7 +6238,7 @@ static WRITE16_HANDLER( segacd_sub_dataram_part1_w )
if (scd_rammode&1)
{
COMBINE_DATA(&segacd_dataram[offset]);
- segacd_mark_tiles_dirty(space->machine, offset);
+ segacd_mark_tiles_dirty(space->machine(), offset);
}
else
{
@@ -6265,11 +6265,11 @@ static WRITE16_HANDLER( segacd_sub_dataram_part1_w )
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine, offset/2+0x00000/2, data , mem_mask, 1);
+ segacd_1meg_mode_word_write(space->machine(), offset/2+0x00000/2, data , mem_mask, 1);
}
else
{
- segacd_1meg_mode_word_write(space->machine, offset/2+0x20000/2, data, mem_mask, 1);
+ segacd_1meg_mode_word_write(space->machine(), offset/2+0x20000/2, data, mem_mask, 1);
}
// printf("Unspported: segacd_sub_dataram_part1_w in mode 1 (Word RAM Expander - 1 Byte Per Pixel) %04x\n", data);
@@ -6313,11 +6313,11 @@ static WRITE16_HANDLER( segacd_sub_dataram_part2_w )
// ret bit set by sub cpu determines which half of WorkRAM we have access to?
if (scd_rammode&1)
{
- segacd_1meg_mode_word_write(space->machine,offset+0x00000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space->machine(),offset+0x00000/2, data, mem_mask, 0);
}
else
{
- segacd_1meg_mode_word_write(space->machine,offset+0x20000/2, data, mem_mask, 0);
+ segacd_1meg_mode_word_write(space->machine(),offset+0x20000/2, data, mem_mask, 0);
}
}
@@ -6327,7 +6327,7 @@ static WRITE16_HANDLER( segacd_sub_dataram_part2_w )
static READ16_HANDLER( segacd_irq_mask_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return segacd_irq_mask;
}
@@ -6336,7 +6336,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
if (ACCESSING_BITS_0_7)
{
UINT16 control = CDD_CONTROL;
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
// printf("segacd_irq_mask_w %04x %04x (CDD control is %04x)\n",data, mem_mask, control);
if (data & 0x10)
@@ -6346,7 +6346,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
if (!(segacd_irq_mask & 0x10))
{
segacd_irq_mask = data & 0x7e;
- CDD_Process(space->machine, 0);
+ CDD_Process(space->machine(), 0);
return;
}
}
@@ -6364,7 +6364,7 @@ static WRITE16_HANDLER( segacd_irq_mask_w )
static READ16_HANDLER( segacd_cdd_ctrl_r )
{
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
return CDD_CONTROL;
}
@@ -6374,7 +6374,7 @@ static WRITE16_HANDLER( segacd_cdd_ctrl_w )
if (ACCESSING_BITS_0_7)
{
UINT16 control = CDD_CONTROL;
- if (SEGACD_FORCE_SYNCS) space->machine->scheduler().synchronize();
+ if (SEGACD_FORCE_SYNCS) space->machine().scheduler().synchronize();
//printf("segacd_cdd_ctrl_w %04x %04x (control %04x irq %04x\n", data, mem_mask, control, segacd_irq_mask);
@@ -6386,7 +6386,7 @@ static WRITE16_HANDLER( segacd_cdd_ctrl_w )
{
if (segacd_irq_mask&0x10)
{
- CDD_Process(space->machine, 1);
+ CDD_Process(space->machine(), 1);
}
}
}
@@ -6412,7 +6412,7 @@ static WRITE8_HANDLER( segacd_cdd_tx_w )
if(offset == 9)
{
- CDD_Import(space->machine);
+ CDD_Import(space->machine());
}
}
@@ -6460,12 +6460,12 @@ static WRITE16_HANDLER( segacd_stampsize_w )
// the lower 3 bits of segacd_imagebuffer_hdot_size are set
// this really needs to be doing it's own lookups rather than depending on the inefficient MAME cache..
-INLINE UINT8 read_pixel_from_stampmap( running_machine* machine, bitmap_t* srcbitmap, int x, int y)
+INLINE UINT8 read_pixel_from_stampmap( running_machine& machine, bitmap_t* srcbitmap, int x, int y)
{
/*
if (!srcbitmap)
{
- return machine->rand();
+ return machine.rand();
}
if (x >= srcbitmap->width) return 0;
@@ -6545,7 +6545,7 @@ WRITE16_HANDLER( segacd_trace_vector_base_address_w )
//int i;
UINT8 pix = 0x0;
- pix = read_pixel_from_stampmap(space->machine, srcbitmap, xbase>>(3+8), ybase>>(3+8));
+ pix = read_pixel_from_stampmap(space->machine(), srcbitmap, xbase>>(3+8), ybase>>(3+8));
xbase += deltax;
ybase += deltay;
@@ -6565,10 +6565,10 @@ WRITE16_HANDLER( segacd_trace_vector_base_address_w )
offset+=countx & 0x7;
- write_pixel( space->machine, pix, offset );
+ write_pixel( space->machine(), pix, offset );
- segacd_mark_tiles_dirty(space->machine, (offset>>3));
- segacd_mark_tiles_dirty(space->machine, (offset>>3)+1);
+ segacd_mark_tiles_dirty(space->machine(), (offset>>3));
+ segacd_mark_tiles_dirty(space->machine(), (offset>>3)+1);
}
@@ -6719,7 +6719,7 @@ WRITE16_HANDLER( segacd_cdfader_w )
//printf("%f\n",cdfader_vol);
- cdda_set_volume(space->machine->device("cdda"), cdfader_vol);
+ cdda_set_volume(space->machine().device("cdda"), cdfader_vol);
}
READ16_HANDLER( segacd_backupram_r )
@@ -6871,7 +6871,7 @@ INLINE void overwrite_write(UINT16 *dst, UINT16 d)
static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
if (state->emu_status & SSP_PMC_SET)
{
state->pmac_read[write ? reg + 6 : reg] = state->pmc.d;
@@ -6925,7 +6925,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
int addr = state->pmac_read[reg]&0xffff;
if ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
{
- UINT16 *ROM = (UINT16 *) space->machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *) space->machine().region("maincpu")->base();
state->pmac_read[reg] += 1;
d = ROM[addr|((mode&0xf)<<16)];
}
@@ -6954,7 +6954,7 @@ static UINT32 pm_io(address_space *space, int reg, int write, UINT32 d)
static READ16_HANDLER( read_PM0 )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 d = pm_io(space, 0, 0, 0);
if (d != (UINT32)-1) return d;
d = state->XST2;
@@ -6964,7 +6964,7 @@ static READ16_HANDLER( read_PM0 )
static WRITE16_HANDLER( write_PM0 )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 r = pm_io(space, 0, 1, data);
if (r != (UINT32)-1) return;
state->XST2 = data; // ?
@@ -7002,7 +7002,7 @@ static WRITE16_HANDLER( write_PM2 )
static READ16_HANDLER( read_XST )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 d = pm_io(space, 3, 0, 0);
if (d != (UINT32)-1) return d;
@@ -7011,7 +7011,7 @@ static READ16_HANDLER( read_XST )
static WRITE16_HANDLER( write_XST )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 r = pm_io(space, 3, 1, data);
if (r != (UINT32)-1) return;
@@ -7031,7 +7031,7 @@ static WRITE16_HANDLER( write_PM4 )
static READ16_HANDLER( read_PMC )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
if (state->emu_status & SSP_PMC_HAVE_ADDR) {
state->emu_status |= SSP_PMC_SET;
state->emu_status &= ~SSP_PMC_HAVE_ADDR;
@@ -7044,7 +7044,7 @@ static READ16_HANDLER( read_PMC )
static WRITE16_HANDLER( write_PMC )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
if (state->emu_status & SSP_PMC_HAVE_ADDR) {
state->emu_status |= SSP_PMC_SET;
state->emu_status &= ~SSP_PMC_HAVE_ADDR;
@@ -7057,7 +7057,7 @@ static WRITE16_HANDLER( write_PMC )
static READ16_HANDLER( read_AL )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
state->emu_status &= ~(SSP_PMC_SET|SSP_PMC_HAVE_ADDR);
return 0;
}
@@ -7070,7 +7070,7 @@ static WRITE16_HANDLER( write_AL )
static READ16_HANDLER( svp_68k_io_r )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 d;
switch (offset)
{
@@ -7086,7 +7086,7 @@ static READ16_HANDLER( svp_68k_io_r )
static WRITE16_HANDLER( svp_68k_io_w )
{
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
switch (offset)
{
// 0xa15000, 0xa15002
@@ -7101,7 +7101,7 @@ static WRITE16_HANDLER( svp_68k_io_w )
static READ16_HANDLER( svp_68k_cell1_r )
{
// this is rewritten 68k test code
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 a1 = offset;
a1 = (a1 & 0x7001) | ((a1 & 0x3e) << 6) | ((a1 & 0xfc0) >> 5);
return ((UINT16 *)state->dram)[a1];
@@ -7110,7 +7110,7 @@ static READ16_HANDLER( svp_68k_cell1_r )
static READ16_HANDLER( svp_68k_cell2_r )
{
// this is rewritten 68k test code
- mdsvp_state *state = space->machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = space->machine().driver_data<mdsvp_state>();
UINT32 a1 = offset;
a1 = (a1 & 0x7801) | ((a1 & 0x1e) << 6) | ((a1 & 0x7e0) >> 4);
return ((UINT16 *)state->dram)[a1];
@@ -7134,7 +7134,7 @@ ADDRESS_MAP_END
/* emulate testmode plug */
-static UINT8 megadrive_io_read_data_port_svp(running_machine *machine, int portnum)
+static UINT8 megadrive_io_read_data_port_svp(running_machine &machine, int portnum)
{
if (portnum == 0 && input_port_read_safe(machine, "MEMORY_TEST", 0x00))
{
@@ -7151,9 +7151,9 @@ static READ16_HANDLER( svp_speedup_r )
}
-static void svp_init(running_machine *machine)
+static void svp_init(running_machine &machine)
{
- mdsvp_state *state = machine->driver_data<mdsvp_state>();
+ mdsvp_state *state = machine.driver_data<mdsvp_state>();
UINT8 *ROM;
memset(state->pmac_read, 0, ARRAY_LENGTH(state->pmac_read));
@@ -7167,18 +7167,18 @@ static void svp_init(running_machine *machine)
/* SVP stuff */
state->dram = auto_alloc_array(machine, UINT8, 0x20000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x300000, 0x31ffff, state->dram);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x300000, 0x31ffff, state->dram);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15000, 0xa150ff, FUNC(svp_68k_io_r), FUNC(svp_68k_io_w));
// "cell arrange" 1 and 2
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r));
- machine->device("svp")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r));
+ machine.device("svp")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r));
state->iram = auto_alloc_array(machine, UINT8, 0x800);
memory_set_bankptr(machine, "bank3", state->iram);
/* SVP ROM just shares m68k region.. */
- ROM = machine->region("maincpu")->base();
+ ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank4", ROM + 0x800);
megadrive_io_read_data_port_ptr = megadrive_io_read_data_port_svp;
@@ -7227,7 +7227,7 @@ VIDEO_START(megadriv)
{
int x;
- render_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ render_bitmap = machine.primary_screen->alloc_compatible_bitmap();
megadrive_vdp_vram = auto_alloc_array(machine, UINT16, 0x10000/2);
megadrive_vdp_cram = auto_alloc_array(machine, UINT16, 0x80/2);
@@ -7284,7 +7284,7 @@ SCREEN_UPDATE(megadriv)
/* reference */
// time_elapsed_since_crap = frame_timer->time_elapsed();
-// xxx = screen->machine->device<device>("maincpu")->attotime_to_cycles(time_elapsed_since_crap);
+// xxx = screen->machine().device<device>("maincpu")->attotime_to_cycles(time_elapsed_since_crap);
// mame_printf_debug("update cycles %d, %08x %08x\n",xxx, (UINT32)(time_elapsed_since_crap.attoseconds>>32),(UINT32)(time_elapsed_since_crap.attoseconds&0xffffffff));
return 0;
@@ -8552,7 +8552,7 @@ static void genesis_render_videoline_to_videobuffer(int scanline)
static UINT32 _32x_linerender[320+258]; // tmp buffer (bigger than it needs to be to simplify RLE decode)
/* This converts our render buffer to real screen colours */
-static void genesis_render_videobuffer_to_screenbuffer(running_machine *machine, int scanline)
+static void genesis_render_videobuffer_to_screenbuffer(running_machine &machine, int scanline)
{
UINT16*lineptr;
int x;
@@ -8774,7 +8774,7 @@ static void genesis_render_videobuffer_to_screenbuffer(running_machine *machine,
case 0x1a000: // (sprite)shadow set, highlight set - not possible
case 0x1e000: // (sprite)shadow set, highlight set, normal set, not possible
default:
- lineptr[x] = machine->rand()&0x3f;
+ lineptr[x] = machine.rand()&0x3f;
break;
}
}
@@ -8805,7 +8805,7 @@ static void genesis_render_videobuffer_to_screenbuffer(running_machine *machine,
}
}
-static void genesis_render_scanline(running_machine *machine, int scanline)
+static void genesis_render_scanline(running_machine &machine, int scanline)
{
//if (MEGADRIVE_REG01_DMA_ENABLE==0) mame_printf_debug("off\n");
genesis_render_spriteline_to_spritebuffer(genesis_scanline_counter);
@@ -9115,11 +9115,11 @@ static TIMER_DEVICE_CALLBACK( render_timer_callback )
{
if (genesis_scanline_counter>=0 && genesis_scanline_counter<megadrive_visible_scanlines)
{
- genesis_render_scanline(timer.machine, genesis_scanline_counter);
+ genesis_render_scanline(timer.machine(), genesis_scanline_counter);
}
}
-void _32x_check_irqs(running_machine* machine)
+void _32x_check_irqs(running_machine& machine)
{
if (sh2_master_vint_enable && sh2_master_vint_pending) device_set_input_line(_32x_master_cpu,SH2_VINT_IRQ_LEVEL,ASSERT_LINE);
@@ -9137,7 +9137,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
top-left of the screen. The first scanline is scanline 0 (we set scanline to -1 in
VIDEO_EOF) */
- timer.machine->scheduler().synchronize();
+ timer.machine().scheduler().synchronize();
/* Compensate for some rounding errors
When the counter reaches 261 we should have reached the end of the frame, however due
@@ -9164,7 +9164,7 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
{
sh2_master_vint_pending = 1;
sh2_slave_vint_pending = 1;
- _32x_check_irqs(timer.machine);
+ _32x_check_irqs(timer.machine());
}
}
@@ -9220,16 +9220,16 @@ static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
}
- if (timer.machine->device("genesis_snd_z80") != NULL)
+ if (timer.machine().device("genesis_snd_z80") != NULL)
{
if (genesis_scanline_counter == megadrive_z80irq_scanline)
{
if ((genz80.z80_has_bus == 1) && (genz80.z80_is_reset == 0))
- cputag_set_input_line(timer.machine, "genesis_snd_z80", 0, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "genesis_snd_z80", 0, HOLD_LINE);
}
if (genesis_scanline_counter == megadrive_z80irq_scanline + 1)
{
- cputag_set_input_line(timer.machine, "genesis_snd_z80", 0, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "genesis_snd_z80", 0, CLEAR_LINE);
}
}
@@ -9248,14 +9248,14 @@ static TIMER_DEVICE_CALLBACK( irq6_on_callback )
{
// megadrive_irq6_pending = 1;
if (MEGADRIVE_REG01_IRQ6_ENABLE || genesis_always_irq6)
- cputag_set_input_line(timer.machine, "maincpu", 6, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 6, HOLD_LINE);
}
}
static TIMER_DEVICE_CALLBACK( irq4_on_callback )
{
//mame_printf_debug("irq4 active on %d\n",genesis_scanline_counter);
- cputag_set_input_line(timer.machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 4, HOLD_LINE);
}
/*****************************************************************************************/
@@ -9311,25 +9311,25 @@ MACHINE_RESET( megadriv )
break;
}
- if (machine->device("genesis_snd_z80") != NULL)
+ if (machine.device("genesis_snd_z80") != NULL)
{
genz80.z80_is_reset = 1;
genz80.z80_has_bus = 1;
genz80.z80_bank_addr = 0;
genesis_scanline_counter = -1;
- machine->scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
+ machine.scheduler().timer_set( attotime::zero, FUNC(megadriv_z80_run_state ));
}
megadrive_imode = 0;
megadrive_reset_io(machine);
- frame_timer = machine->device<timer_device>("frame_timer");
- scanline_timer = machine->device<timer_device>("scanline_timer");
- render_timer = machine->device<timer_device>("render_timer");
+ frame_timer = machine.device<timer_device>("frame_timer");
+ scanline_timer = machine.device<timer_device>("scanline_timer");
+ render_timer = machine.device<timer_device>("render_timer");
- irq6_on_timer = machine->device<timer_device>("irq6_timer");
- irq4_on_timer = machine->device<timer_device>("irq4_timer");
+ irq6_on_timer = machine.device<timer_device>("irq6_timer");
+ irq4_on_timer = machine.device<timer_device>("irq4_timer");
frame_timer->adjust(attotime::zero);
scanline_timer->adjust(attotime::zero);
@@ -9337,7 +9337,7 @@ MACHINE_RESET( megadriv )
if (genesis_other_hacks)
{
// set_refresh_rate(megadriv_framerate);
- // machine->device("maincpu")->set_clock_scale(0.9950f); /* Fatal Rewind is very fussy... (and doesn't work now anyway, so don't bother with this) */
+ // machine.device("maincpu")->set_clock_scale(0.9950f); /* Fatal Rewind is very fussy... (and doesn't work now anyway, so don't bother with this) */
memset(megadrive_ram,0x00,0x10000);
}
@@ -9483,7 +9483,7 @@ int megadrive_z80irq_hpos = 320;
visarea.min_y = 0;
visarea.max_y = megadrive_visible_scanlines-1;
- machine->primary_screen->configure(scr_width, megadrive_visible_scanlines, visarea, HZ_TO_ATTOSECONDS(megadriv_framerate));
+ machine.primary_screen->configure(scr_width, megadrive_visible_scanlines, visarea, HZ_TO_ATTOSECONDS(megadriv_framerate));
if (0)
{
@@ -9494,7 +9494,7 @@ int megadrive_z80irq_hpos = 320;
frametime = ATTOSECONDS_PER_SECOND/megadriv_framerate;
//time_elapsed_since_crap = frame_timer->time_elapsed();
- //xxx = machine->device<cpudevice>("maincpu")->attotime_to_cycles(time_elapsed_since_crap);
+ //xxx = machine.device<cpudevice>("maincpu")->attotime_to_cycles(time_elapsed_since_crap);
//mame_printf_debug("---------- cycles %d, %08x %08x\n",xxx, (UINT32)(time_elapsed_since_crap.attoseconds>>32),(UINT32)(time_elapsed_since_crap.attoseconds&0xffffffff));
//mame_printf_debug("---------- framet %d, %08x %08x\n",xxx, (UINT32)(frametime>>32),(UINT32)(frametime&0xffffffff));
frame_timer->adjust(attotime::zero);
@@ -9527,7 +9527,7 @@ static NVRAM_HANDLER( megadriv )
{
int x;
for (x=0;x<megadriv_backupram_length/2;x++)
- megadriv_backupram[x]=0xffff;//machine->rand(); // dino dini's needs 0xff or game rules are broken
+ megadriv_backupram[x]=0xffff;//machine.rand(); // dino dini's needs 0xff or game rules are broken
}
}
}
@@ -9850,10 +9850,10 @@ static int megadriv_tas_callback(device_t *device)
return 0; // writeback not allowed
}
-static void megadriv_init_common(running_machine *machine)
+static void megadriv_init_common(running_machine &machine)
{
/* Look to see if this system has the standard Sound Z80 */
- _genesis_snd_z80_cpu = machine->device<cpu_device>("genesis_snd_z80");
+ _genesis_snd_z80_cpu = machine.device<cpu_device>("genesis_snd_z80");
if (_genesis_snd_z80_cpu != NULL)
{
//printf("GENESIS Sound Z80 cpu found '%s'\n", _genesis_snd_z80_cpu->tag() );
@@ -9863,14 +9863,14 @@ static void megadriv_init_common(running_machine *machine)
}
/* Look to see if this system has the 32x Master SH2 */
- _32x_master_cpu = machine->device<cpu_device>("32x_master_sh2");
+ _32x_master_cpu = machine.device<cpu_device>("32x_master_sh2");
if (_32x_master_cpu != NULL)
{
printf("32x MASTER SH2 cpu found '%s'\n", _32x_master_cpu->tag() );
}
/* Look to see if this system has the 32x Slave SH2 */
- _32x_slave_cpu = machine->device<cpu_device>("32x_slave_sh2");
+ _32x_slave_cpu = machine.device<cpu_device>("32x_slave_sh2");
if (_32x_slave_cpu != NULL)
{
printf("32x SLAVE SH2 cpu found '%s'\n", _32x_slave_cpu->tag() );
@@ -9887,35 +9887,35 @@ static void megadriv_init_common(running_machine *machine)
if(_32x_is_connected)
{
- _32x_pwm_timer = machine->scheduler().timer_alloc(FUNC(_32x_pwm_callback));
+ _32x_pwm_timer = machine.scheduler().timer_alloc(FUNC(_32x_pwm_callback));
_32x_pwm_timer->adjust(attotime::never);
}
sega_cd_connected = 0;
segacd_wordram_mapped = 0;
- _segacd_68k_cpu = machine->device<cpu_device>("segacd_68k");
+ _segacd_68k_cpu = machine.device<cpu_device>("segacd_68k");
if (_segacd_68k_cpu != NULL)
{
printf("Sega CD secondary 68k cpu found '%s'\n", _segacd_68k_cpu->tag() );
sega_cd_connected = 1;
segacd_init_main_cpu(machine);
- scd_dma_timer = machine->device<timer_device>("scd_dma_timer");
+ scd_dma_timer = machine.device<timer_device>("scd_dma_timer");
}
- _svp_cpu = machine->device<cpu_device>("svp");
+ _svp_cpu = machine.device<cpu_device>("svp");
if (_svp_cpu != NULL)
{
printf("SVP (cpu) found '%s'\n", _svp_cpu->tag() );
}
- device_set_irq_callback(machine->device("maincpu"), genesis_int_callback);
+ device_set_irq_callback(machine.device("maincpu"), genesis_int_callback);
megadriv_backupram = NULL;
megadriv_backupram_length = 0;
vdp_get_word_from_68k_mem = vdp_get_word_from_68k_mem_default;
- m68k_set_tas_callback(machine->device("maincpu"), megadriv_tas_callback);
+ m68k_set_tas_callback(machine.device("maincpu"), megadriv_tas_callback);
// the drivers which need 6 buttons pad set this to 1 in their init befare calling the megadrive init
if (megadrive_6buttons_pad)
@@ -9936,7 +9936,7 @@ static void megadriv_init_common(running_machine *machine)
some games specify a single address, (start 200001, end 200001)
this usually means there is serial eeprom instead */
int i;
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
mame_printf_debug("DEBUG:: Header: Backup RAM string (ignore for games without)\n");
for (i=0;i<12;i++)
@@ -10041,32 +10041,32 @@ static WRITE8_HANDLER( z80_unmapped_w )
/* sets the megadrive z80 to it's normal ports / map */
-void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag)
+void megatech_set_megadrive_z80_as_megadrive_z80(running_machine &machine, const char* tag)
{
- device_t *ym = machine->device("ymsnd");
+ device_t *ym = machine.device("ymsnd");
/* INIT THE PORTS *********************************************************************************************/
- machine->device(tag)->memory().space(AS_IO)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_port_r), FUNC(z80_unmapped_port_w));
+ machine.device(tag)->memory().space(AS_IO)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_port_r), FUNC(z80_unmapped_port_w));
/* catch any addresses that don't get mapped */
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x1fff, "bank1");
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x1fff, "bank1");
memory_set_bankptr(machine, "bank1", genz80.z80_prgram );
- machine->device(tag)->memory().space(AS_PROGRAM)->install_ram(0x0000, 0x1fff, genz80.z80_prgram);
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_ram(0x0000, 0x1fff, genz80.z80_prgram);
// not allowed??
-// machine->device(tag)->memory().space(AS_PROGRAM)->install_readwrite_bank(0x2000, 0x3fff, "bank1");
+// machine.device(tag)->memory().space(AS_PROGRAM)->install_readwrite_bank(0x2000, 0x3fff, "bank1");
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*ym, 0x4000, 0x4003, FUNC(ym2612_r), FUNC(ym2612_w));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6000, 0x6000, FUNC(megadriv_z80_z80_bank_w));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6001, 0x6001, FUNC(megadriv_z80_z80_bank_w));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x6100, 0x7eff, FUNC(megadriv_z80_unmapped_read));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7f00, 0x7fff, FUNC(megadriv_z80_vdp_read), FUNC(megadriv_z80_vdp_write));
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(z80_read_68k_banked_data), FUNC(z80_write_68k_banked_data));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*ym, 0x4000, 0x4003, FUNC(ym2612_r), FUNC(ym2612_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6000, 0x6000, FUNC(megadriv_z80_z80_bank_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler (0x6001, 0x6001, FUNC(megadriv_z80_z80_bank_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x6100, 0x7eff, FUNC(megadriv_z80_unmapped_read));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7f00, 0x7fff, FUNC(megadriv_z80_vdp_read), FUNC(megadriv_z80_vdp_write));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(z80_read_68k_banked_data), FUNC(z80_write_68k_banked_data));
}
// these are tests for 'special case' hardware to make sure I don't break anything while rearranging things
@@ -10096,24 +10096,24 @@ DRIVER_INIT( _32x )
if (_32x_adapter_enabled == 0)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_rom(0x0000000, 0x03fffff, machine->region("gamecart")->base());
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_rom(0x0000000, 0x03fffff, machine.region("gamecart")->base());
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x000070, 0x000073, FUNC(_32x_68k_hint_vector_r), FUNC(_32x_68k_hint_vector_w)); // h interrupt vector
};
a15100_reg = 0x0000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15100, 0xa15101, FUNC(_32x_68k_a15100_r), FUNC(_32x_68k_a15100_w)); // framebuffer control regs
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15102, 0xa15103, FUNC(_32x_68k_a15102_r), FUNC(_32x_68k_a15102_w)); // send irq to sh2
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15104, 0xa15105, FUNC(_32x_68k_a15104_r), FUNC(_32x_68k_a15104_w)); // 68k BANK rom set
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15106, 0xa15107, FUNC(_32x_68k_a15106_r), FUNC(_32x_68k_a15106_w)); // dreq stuff
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15108, 0xa15113, FUNC(_32x_dreq_common_r), FUNC(_32x_dreq_common_w)); // dreq src / dst / length /fifo
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15100, 0xa15101, FUNC(_32x_68k_a15100_r), FUNC(_32x_68k_a15100_w)); // framebuffer control regs
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15102, 0xa15103, FUNC(_32x_68k_a15102_r), FUNC(_32x_68k_a15102_w)); // send irq to sh2
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15104, 0xa15105, FUNC(_32x_68k_a15104_r), FUNC(_32x_68k_a15104_w)); // 68k BANK rom set
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15106, 0xa15107, FUNC(_32x_68k_a15106_r), FUNC(_32x_68k_a15106_w)); // dreq stuff
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15108, 0xa15113, FUNC(_32x_dreq_common_r), FUNC(_32x_dreq_common_w)); // dreq src / dst / length /fifo
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1511a, 0xa1511b, FUNC(_32x_68k_a1511a_r), FUNC(_32x_68k_a1511a_w)); // SEGA TV
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa1511a, 0xa1511b, FUNC(_32x_68k_a1511a_r), FUNC(_32x_68k_a1511a_w)); // SEGA TV
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15120, 0xa1512f, FUNC(_32x_68k_commsram_r), FUNC(_32x_68k_commsram_w)); // comms reg 0-7
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15130, 0xa1513f, FUNC(_32x_pwm_r), FUNC(_32x_68k_pwm_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15120, 0xa1512f, FUNC(_32x_68k_commsram_r), FUNC(_32x_68k_commsram_w)); // comms reg 0-7
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xa15130, 0xa1513f, FUNC(_32x_pwm_r), FUNC(_32x_68k_pwm_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0a130ec, 0x0a130ef, FUNC(_32x_68k_MARS_r)); // system ID
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0a130ec, 0x0a130ef, FUNC(_32x_68k_MARS_r)); // system ID
/* Interrupts are masked / disabled at first */
@@ -10138,8 +10138,8 @@ DRIVER_INIT( _32x )
_32x_240mode = 0;
// checking if these help brutal, they don't.
- sh2drc_set_options(machine->device("32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
- sh2drc_set_options(machine->device("32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
+ sh2drc_set_options(machine.device("32x_master_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
+ sh2drc_set_options(machine.device("32x_slave_sh2"), SH2DRC_COMPATIBLE_OPTIONS);
DRIVER_INIT_CALL(megadriv);
}
diff --git a/src/mame/machine/meters.c b/src/mame/machine/meters.c
index c89eca21ac7..a6ad61e4eee 100644
--- a/src/mame/machine/meters.c
+++ b/src/mame/machine/meters.c
@@ -27,7 +27,7 @@ static TIMER_CALLBACK( meter_callback )
meter_info[param].count++;
}
-void MechMtr_config(running_machine *machine, int number)
+void MechMtr_config(running_machine &machine, int number)
{
int i;
@@ -39,7 +39,7 @@ void MechMtr_config(running_machine *machine, int number)
meter_info[i].state = 0;
meter_info[i].count = 0;
meter_info[i].on = 0;
- meter_info[i].meter_timer = machine->scheduler().timer_alloc(FUNC(meter_callback), (void*)(FPTR)i);
+ meter_info[i].meter_timer = machine.scheduler().timer_alloc(FUNC(meter_callback), (void*)(FPTR)i);
meter_info[i].meter_timer->reset();
}
number_mtr = number;
diff --git a/src/mame/machine/meters.h b/src/mame/machine/meters.h
index 66485d61bb8..4a54fea55ec 100644
--- a/src/mame/machine/meters.h
+++ b/src/mame/machine/meters.h
@@ -19,7 +19,7 @@
#define METERREACTTIME 0.025 // number of seconds meter has to be active to tick
-void MechMtr_config(running_machine *machine, int number);
+void MechMtr_config(running_machine &machine, int number);
int MechMtr_GetNumberMeters(void);
diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c
index b8898e0bdd2..86407821d44 100644
--- a/src/mame/machine/mexico86.c
+++ b/src/mame/machine/mexico86.c
@@ -15,7 +15,7 @@ bit 0 = ? (unused?)
*/
WRITE8_HANDLER( mexico86_f008_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE);
@@ -44,9 +44,9 @@ WRITE8_HANDLER( mexico86_f008_w )
***************************************************************************/
-static void mcu_simulate( running_machine *machine )
+static void mcu_simulate( running_machine &machine )
{
- mexico86_state *state = machine->driver_data<mexico86_state>();
+ mexico86_state *state = machine.driver_data<mexico86_state>();
if (!state->mcu_initialised)
{
@@ -154,10 +154,10 @@ static void mcu_simulate( running_machine *machine )
INTERRUPT_GEN( kikikai_interrupt )
{
- mexico86_state *state = device->machine->driver_data<mexico86_state>();
+ mexico86_state *state = device->machine().driver_data<mexico86_state>();
if (state->mcu_running)
- mcu_simulate(device->machine);
+ mcu_simulate(device->machine());
device_set_input_line_vector(device, 0, state->protection_ram[0]);
device_set_input_line(device, 0, HOLD_LINE);
@@ -177,9 +177,9 @@ INTERRUPT_GEN( kikikai_interrupt )
#define DCWIDTH 0
#define DCHEIGHT 0
-static void kiki_clogic(running_machine *machine, int address, int latch)
+static void kiki_clogic(running_machine &machine, int address, int latch)
{
- mexico86_state *state = machine->driver_data<mexico86_state>();
+ mexico86_state *state = machine.driver_data<mexico86_state>();
static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00};
int sy, sx, hw, i, qptr, diff1, diff2;
@@ -234,7 +234,7 @@ INTERRUPT_GEN( mexico86_m68705_interrupt )
READ8_HANDLER( mexico86_68705_port_a_r )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
//logerror("%04x: 68705 port A read %02x\n", cpu_get_pc(space->cpu), state->port_a_in);
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
@@ -242,7 +242,7 @@ READ8_HANDLER( mexico86_68705_port_a_r )
WRITE8_HANDLER( mexico86_68705_port_a_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
//logerror("%04x: 68705 port A write %02x\n", cpu_get_pc(space->cpu), data);
state->port_a_out = data;
@@ -250,7 +250,7 @@ WRITE8_HANDLER( mexico86_68705_port_a_w )
WRITE8_HANDLER( mexico86_68705_ddr_a_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
state->ddr_a = data;
}
@@ -274,13 +274,13 @@ WRITE8_HANDLER( mexico86_68705_ddr_a_w )
READ8_HANDLER( mexico86_68705_port_b_r )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( mexico86_68705_port_b_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
//logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data);
if (BIT(state->ddr_b, 0) && BIT(~data, 0) && BIT(state->port_b_out, 0))
@@ -306,7 +306,7 @@ WRITE8_HANDLER( mexico86_68705_port_b_w )
else
{
//logerror("%04x: 68705 read input port %04x\n", cpu_get_pc(space->cpu), state->address);
- state->latch = input_port_read(space->machine, (state->address & 1) ? "IN2" : "IN1");
+ state->latch = input_port_read(space->machine(), (state->address & 1) ? "IN2" : "IN1");
}
}
else /* write */
@@ -337,6 +337,6 @@ WRITE8_HANDLER( mexico86_68705_port_b_w )
WRITE8_HANDLER( mexico86_68705_ddr_b_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
state->ddr_b = data;
}
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index 338cc427602..1d64be2e63d 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -18,14 +18,14 @@
TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock )
{
- mhavoc_state *state = timer.machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = timer.machine().driver_data<mhavoc_state>();
/* clock the LS161 driving the alpha CPU IRQ */
if (state->alpha_irq_clock_enable)
{
state->alpha_irq_clock++;
if ((state->alpha_irq_clock & 0x0c) == 0x0c)
{
- cputag_set_input_line(timer.machine, "alpha", 0, ASSERT_LINE);
+ cputag_set_input_line(timer.machine(), "alpha", 0, ASSERT_LINE);
state->alpha_irq_clock_enable = 0;
}
}
@@ -34,16 +34,16 @@ TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock )
if (state->has_gamma_cpu)
{
state->gamma_irq_clock++;
- cputag_set_input_line(timer.machine, "gamma", 0, (state->gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "gamma", 0, (state->gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
}
}
WRITE8_HANDLER( mhavoc_alpha_irq_ack_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
/* clear the line and reset the clock */
- cputag_set_input_line(space->machine, "alpha", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "alpha", 0, CLEAR_LINE);
state->alpha_irq_clock = 0;
state->alpha_irq_clock_enable = 1;
}
@@ -51,9 +51,9 @@ WRITE8_HANDLER( mhavoc_alpha_irq_ack_w )
WRITE8_HANDLER( mhavoc_gamma_irq_ack_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
/* clear the line and reset the clock */
- cputag_set_input_line(space->machine, "gamma", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "gamma", 0, CLEAR_LINE);
state->gamma_irq_clock = 0;
}
@@ -67,7 +67,7 @@ WRITE8_HANDLER( mhavoc_gamma_irq_ack_w )
MACHINE_START( mhavoc )
{
- mhavoc_state *state = machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = machine.driver_data<mhavoc_state>();
state_save_register_item(machine, "misc", NULL, 0, state->alpha_data);
state_save_register_item(machine, "misc", NULL, 0, state->alpha_rcvd);
state_save_register_item(machine, "misc", NULL, 0, state->alpha_xmtd);
@@ -85,13 +85,13 @@ MACHINE_START( mhavoc )
MACHINE_RESET( mhavoc )
{
- mhavoc_state *state = machine->driver_data<mhavoc_state>();
- address_space *space = machine->device("alpha")->memory().space(AS_PROGRAM);
- state->has_gamma_cpu = (machine->device("gamma") != NULL);
+ mhavoc_state *state = machine.driver_data<mhavoc_state>();
+ address_space *space = machine.device("alpha")->memory().space(AS_PROGRAM);
+ state->has_gamma_cpu = (machine.device("gamma") != NULL);
memory_configure_bank(machine, "bank1", 0, 1, state->zram0, 0);
memory_configure_bank(machine, "bank1", 1, 1, state->zram1, 0);
- memory_configure_bank(machine, "bank2", 0, 4, machine->region("alpha")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank2", 0, 4, machine.region("alpha")->base() + 0x10000, 0x2000);
/* reset RAM/ROM banks to 0 */
mhavoc_ram_banksel_w(space, 0, 0);
@@ -126,7 +126,7 @@ MACHINE_RESET( mhavoc )
static TIMER_CALLBACK( delayed_gamma_w )
{
- mhavoc_state *state = machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = machine.driver_data<mhavoc_state>();
/* mark the data received */
state->gamma_rcvd = 0;
state->alpha_xmtd = 1;
@@ -136,21 +136,21 @@ static TIMER_CALLBACK( delayed_gamma_w )
cputag_set_input_line(machine, "gamma", INPUT_LINE_NMI, PULSE_LINE);
/* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */
- machine->scheduler().timer_set(attotime::from_usec(250), FUNC(NULL));
+ machine.scheduler().timer_set(attotime::from_usec(250), FUNC(NULL));
}
WRITE8_HANDLER( mhavoc_gamma_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
logerror(" writing to gamma processor: %02x (%d %d)\n", data, state->gamma_rcvd, state->alpha_xmtd);
- space->machine->scheduler().synchronize(FUNC(delayed_gamma_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_gamma_w), data);
}
READ8_HANDLER( mhavoc_alpha_r )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
logerror("\t\t\t\t\treading from alpha processor: %02x (%d %d)\n", state->alpha_data, state->gamma_rcvd, state->alpha_xmtd);
state->gamma_rcvd = 1;
state->alpha_xmtd = 0;
@@ -167,7 +167,7 @@ READ8_HANDLER( mhavoc_alpha_r )
WRITE8_HANDLER( mhavoc_alpha_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
logerror("\t\t\t\t\twriting to alpha processor: %02x %d %d\n", data, state->alpha_rcvd, state->gamma_xmtd);
state->alpha_rcvd = 0;
state->gamma_xmtd = 1;
@@ -177,7 +177,7 @@ WRITE8_HANDLER( mhavoc_alpha_w )
READ8_HANDLER( mhavoc_gamma_r )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
logerror(" reading from gamma processor: %02x (%d %d)\n", state->gamma_data, state->alpha_rcvd, state->gamma_xmtd);
state->alpha_rcvd = 1;
state->gamma_xmtd = 0;
@@ -194,13 +194,13 @@ READ8_HANDLER( mhavoc_gamma_r )
WRITE8_HANDLER( mhavoc_ram_banksel_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
WRITE8_HANDLER( mhavoc_rom_banksel_w )
{
- memory_set_bank(space->machine, "bank2", data & 3);
+ memory_set_bank(space->machine(), "bank2", data & 3);
}
@@ -213,41 +213,41 @@ WRITE8_HANDLER( mhavoc_rom_banksel_w )
CUSTOM_INPUT( tms5220_r )
{
- return tms5220_readyq_r(field->port->machine->device("tms")) ? 1 : 0;
+ return tms5220_readyq_r(field->port->machine().device("tms")) ? 1 : 0;
}
CUSTOM_INPUT( mhavoc_bit67_r )
{
- mhavoc_state *state = field->port->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = field->port->machine().driver_data<mhavoc_state>();
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(field->port->machine, state->player_1 ? tag2 : tag1) & 0x03;
+ return input_port_read(field->port->machine(), state->player_1 ? tag2 : tag1) & 0x03;
}
CUSTOM_INPUT( gamma_rcvd_r )
{
- mhavoc_state *state = field->port->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = field->port->machine().driver_data<mhavoc_state>();
/* Gamma rcvd flag */
return state->gamma_rcvd;
}
CUSTOM_INPUT( gamma_xmtd_r )
{
- mhavoc_state *state = field->port->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = field->port->machine().driver_data<mhavoc_state>();
/* Gamma xmtd flag */
return state->gamma_xmtd;
}
CUSTOM_INPUT( alpha_rcvd_r )
{
- mhavoc_state *state = field->port->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = field->port->machine().driver_data<mhavoc_state>();
/* Alpha rcvd flag */
return (state->has_gamma_cpu && state->alpha_rcvd);
}
CUSTOM_INPUT( alpha_xmtd_r )
{
- mhavoc_state *state = field->port->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = field->port->machine().driver_data<mhavoc_state>();
/* Alpha xmtd flag */
return (state->has_gamma_cpu && state->alpha_xmtd);
}
@@ -260,7 +260,7 @@ CUSTOM_INPUT( alpha_xmtd_r )
WRITE8_HANDLER( mhavoc_out_0_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
/* Bit 7 = Invert Y -- unemulated */
/* Bit 6 = Invert X -- unemulated */
@@ -268,7 +268,7 @@ WRITE8_HANDLER( mhavoc_out_0_w )
state->player_1 = (data >> 5) & 1;
/* Bit 3 = Gamma reset */
- cputag_set_input_line(space->machine, "gamma", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "gamma", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
if (!(data & 0x08))
{
logerror("\t\t\t\t*** resetting gamma processor. ***\n");
@@ -279,23 +279,23 @@ WRITE8_HANDLER( mhavoc_out_0_w )
}
/* Bit 0 = Roller light (Blinks on fatal errors) */
- set_led_status(space->machine, 0, data & 0x01);
+ set_led_status(space->machine(), 0, data & 0x01);
}
WRITE8_HANDLER( alphaone_out_0_w )
{
/* Bit 5 = P2 lamp */
- set_led_status(space->machine, 0, ~data & 0x20);
+ set_led_status(space->machine(), 0, ~data & 0x20);
/* Bit 4 = P1 lamp */
- set_led_status(space->machine, 1, ~data & 0x10);
+ set_led_status(space->machine(), 1, ~data & 0x10);
/* Bit 1 = right coin counter */
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* Bit 0 = left coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
logerror("alphaone_out_0_w(%02X)\n", data);
}
@@ -304,10 +304,10 @@ logerror("alphaone_out_0_w(%02X)\n", data);
WRITE8_HANDLER( mhavoc_out_1_w )
{
/* Bit 1 = left coin counter */
- coin_counter_w(space->machine, 0, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x02);
/* Bit 0 = right coin counter */
- coin_counter_w(space->machine, 1, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x01);
}
/*************************************
@@ -318,15 +318,15 @@ WRITE8_HANDLER( mhavoc_out_1_w )
static WRITE8_HANDLER( mhavocrv_speech_data_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
state->speech_write_buffer = data;
}
static WRITE8_HANDLER( mhavocrv_speech_strobe_w )
{
- mhavoc_state *state = space->machine->driver_data<mhavoc_state>();
- device_t *tms = space->machine->device("tms");
+ mhavoc_state *state = space->machine().driver_data<mhavoc_state>();
+ device_t *tms = space->machine().device("tms");
tms5220_data_w(tms, 0, state->speech_write_buffer);
}
@@ -340,6 +340,6 @@ DRIVER_INIT( mhavocrv )
{
/* install the speech support that was only optionally stuffed for use */
/* in the Return to Vax hack */
- machine->device("gamma")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5800, 0x5800, FUNC(mhavocrv_speech_data_w));
- machine->device("gamma")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5900, 0x5900, FUNC(mhavocrv_speech_strobe_w));
+ machine.device("gamma")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5800, 0x5800, FUNC(mhavocrv_speech_data_w));
+ machine.device("gamma")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5900, 0x5900, FUNC(mhavocrv_speech_strobe_w));
}
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index 41f5d809bd2..0293de57592 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -31,12 +31,12 @@
void micro3d_duart_irq_handler(device_t *device, UINT8 vector)
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 3, HOLD_LINE, vector);
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 3, HOLD_LINE, vector);
};
void micro3d_duart_tx(device_t *device, int channel, UINT8 data)
{
- micro3d_state *state = device->machine->driver_data<micro3d_state>();
+ micro3d_state *state = device->machine().driver_data<micro3d_state>();
if (channel == 0)
{
@@ -47,21 +47,21 @@ void micro3d_duart_tx(device_t *device, int channel, UINT8 data)
else
{
state->m68681_tx0 = data;
- cputag_set_input_line(device->machine, "audiocpu", MCS51_RX_LINE, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", MCS51_RX_LINE, ASSERT_LINE);
// TODO: next line should be behind a timer callback which lasts one audiocpu clock cycle
- cputag_set_input_line(device->machine, "audiocpu", MCS51_RX_LINE, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", MCS51_RX_LINE, CLEAR_LINE);
}
};
static int data_to_i8031(device_t *device)
{
- micro3d_state *state = device->machine->driver_data<micro3d_state>();
+ micro3d_state *state = device->machine().driver_data<micro3d_state>();
return state->m68681_tx0;
}
static void data_from_i8031(device_t *device, int data)
{
- micro3d_state *state = device->machine->driver_data<micro3d_state>();
+ micro3d_state *state = device->machine().driver_data<micro3d_state>();
duart68681_rx_data(state->duart68681, 1, data);
}
@@ -84,7 +84,7 @@ UINT8 micro3d_duart_input_r(device_t *device)
*/
void micro3d_duart_output_w(device_t *device, UINT8 data)
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_RESET, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
}
@@ -102,7 +102,7 @@ enum
WRITE16_HANDLER( micro3d_ti_uart_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
switch (offset)
{
@@ -160,7 +160,7 @@ WRITE16_HANDLER( micro3d_ti_uart_w )
READ16_HANDLER( micro3d_ti_uart_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
switch (offset)
{
@@ -231,12 +231,12 @@ READ32_HANDLER( micro3d_scc_r )
READ16_HANDLER( micro3d_tms_host_r )
{
- return tms34010_host_r(space->machine->device("vgb"), offset);
+ return tms34010_host_r(space->machine().device("vgb"), offset);
}
WRITE16_HANDLER( micro3d_tms_host_w )
{
- tms34010_host_w(space->machine->device("vgb"), offset, data);
+ tms34010_host_w(space->machine().device("vgb"), offset, data);
}
@@ -264,7 +264,7 @@ INLINE INT64 normalised_multiply(INT32 a, INT32 b)
static TIMER_CALLBACK( mac_done_callback )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
cputag_set_input_line(machine, "drmath", AM29000_INTR0, ASSERT_LINE);
state->mac_stat = 0;
@@ -273,7 +273,7 @@ static TIMER_CALLBACK( mac_done_callback )
WRITE32_HANDLER( micro3d_mac1_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->vtx_addr = (data & 0x3ffff);
state->sram_w_addr = (data >> 18) & 0xfff;
@@ -281,14 +281,14 @@ WRITE32_HANDLER( micro3d_mac1_w )
READ32_HANDLER( micro3d_mac2_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
return (state->mac_inst << 1) | state->mac_stat;
}
WRITE32_HANDLER( micro3d_mac2_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
UINT32 cnt = data & 0xff;
UINT32 inst = (data >> 8) & 0x1f;
@@ -312,7 +312,7 @@ WRITE32_HANDLER( micro3d_mac2_w )
mac_sram = state->mac_sram;
if (data & (1 << 14))
- cputag_set_input_line(space->machine, "drmath", AM29000_INTR0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "drmath", AM29000_INTR0, CLEAR_LINE);
switch (inst)
{
@@ -325,7 +325,7 @@ WRITE32_HANDLER( micro3d_mac2_w )
case 0x08:
{
int i;
- const UINT16 *rom = (UINT16*)space->machine->region("vertex")->base();
+ const UINT16 *rom = (UINT16*)space->machine().region("vertex")->base();
for (i = 0; i <= cnt; ++i)
{
@@ -364,7 +364,7 @@ WRITE32_HANDLER( micro3d_mac2_w )
case 0x0c:
{
int i;
- const UINT16 *rom = (UINT16*)space->machine->region("vertex")->base();
+ const UINT16 *rom = (UINT16*)space->machine().region("vertex")->base();
for (i = 0; i <= cnt; ++i)
{
@@ -397,7 +397,7 @@ WRITE32_HANDLER( micro3d_mac2_w )
case 0x0f:
{
int i;
- const UINT16 *rom = (UINT16*)space->machine->region("vertex")->base();
+ const UINT16 *rom = (UINT16*)space->machine().region("vertex")->base();
for (i = 0; i <= cnt; ++i, vtx_addr += 4)
{
@@ -476,7 +476,7 @@ WRITE32_HANDLER( micro3d_mac2_w )
/* TODO: Calculate a better estimate for timing */
if (state->mac_stat)
- space->machine->scheduler().timer_set(attotime::from_hz(MAC_CLK) * mac_cycles, FUNC(mac_done_callback));
+ space->machine().scheduler().timer_set(attotime::from_hz(MAC_CLK) * mac_cycles, FUNC(mac_done_callback));
state->mrab11 = mrab11;
state->vtx_addr = vtx_addr;
@@ -493,23 +493,23 @@ WRITE32_HANDLER( micro3d_mac2_w )
READ16_HANDLER( micro3d_encoder_h_r )
{
- UINT16 x_encoder = input_port_read_safe(space->machine, "JOYSTICK_X", 0);
- UINT16 y_encoder = input_port_read_safe(space->machine, "JOYSTICK_Y", 0);
+ UINT16 x_encoder = input_port_read_safe(space->machine(), "JOYSTICK_X", 0);
+ UINT16 y_encoder = input_port_read_safe(space->machine(), "JOYSTICK_Y", 0);
return (y_encoder & 0xf00) | ((x_encoder & 0xf00) >> 8);
}
READ16_HANDLER( micro3d_encoder_l_r )
{
- UINT16 x_encoder = input_port_read_safe(space->machine, "JOYSTICK_X", 0);
- UINT16 y_encoder = input_port_read_safe(space->machine, "JOYSTICK_Y", 0);
+ UINT16 x_encoder = input_port_read_safe(space->machine(), "JOYSTICK_X", 0);
+ UINT16 y_encoder = input_port_read_safe(space->machine(), "JOYSTICK_Y", 0);
return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff);
}
static TIMER_CALLBACK( adc_done_callback )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
switch (param)
{
@@ -526,7 +526,7 @@ static TIMER_CALLBACK( adc_done_callback )
READ16_HANDLER( micro3d_adc_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
return state->adc_val;
}
@@ -540,19 +540,19 @@ WRITE16_HANDLER( micro3d_adc_w )
return;
}
- space->machine->scheduler().timer_set(attotime::from_usec(40), FUNC(adc_done_callback), data & ~4);
+ space->machine().scheduler().timer_set(attotime::from_usec(40), FUNC(adc_done_callback), data & ~4);
}
CUSTOM_INPUT( botssa_hwchk_r )
{
- micro3d_state *state = field->port->machine->driver_data<micro3d_state>();
+ micro3d_state *state = field->port->machine().driver_data<micro3d_state>();
return state->botssa_latch;
}
READ16_HANDLER( botssa_140000_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->botssa_latch = 0;
return 0xffff;
@@ -560,7 +560,7 @@ READ16_HANDLER( botssa_140000_r )
READ16_HANDLER( botssa_180000_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->botssa_latch = 1;
return 0xffff;
@@ -575,15 +575,15 @@ READ16_HANDLER( botssa_180000_r )
WRITE16_HANDLER( micro3d_reset_w )
{
data >>= 8;
- cputag_set_input_line(space->machine, "drmath", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "vgb", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "drmath", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "vgb", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
/* TODO: Joystick reset? */
}
WRITE16_HANDLER( host_drmath_int_w )
{
- cputag_set_input_line(space->machine, "drmath", AM29000_INTR2, ASSERT_LINE);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ cputag_set_input_line(space->machine(), "drmath", AM29000_INTR2, ASSERT_LINE);
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
@@ -595,7 +595,7 @@ WRITE16_HANDLER( host_drmath_int_w )
WRITE32_HANDLER( micro3d_shared_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->shared_ram[offset * 2 + 1] = data & 0xffff;
state->shared_ram[offset * 2 + 0] = data >> 16;
@@ -603,19 +603,19 @@ WRITE32_HANDLER( micro3d_shared_w )
READ32_HANDLER( micro3d_shared_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
return (state->shared_ram[offset * 2] << 16) | state->shared_ram[offset * 2 + 1];
}
WRITE32_HANDLER( drmath_int_w )
{
- cputag_set_input_line(space->machine, "maincpu", 5, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 5, HOLD_LINE);
}
WRITE32_HANDLER( drmath_intr2_ack )
{
- cputag_set_input_line(space->machine, "drmath", AM29000_INTR2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "drmath", AM29000_INTR2, CLEAR_LINE);
}
@@ -627,13 +627,13 @@ WRITE32_HANDLER( drmath_intr2_ack )
DRIVER_INIT( micro3d )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
- address_space *space = machine->device("drmath")->memory().space(AS_DATA);
+ micro3d_state *state = machine.driver_data<micro3d_state>();
+ address_space *space = machine.device("drmath")->memory().space(AS_DATA);
- i8051_set_serial_tx_callback(machine->device("audiocpu"), data_from_i8031);
- i8051_set_serial_rx_callback(machine->device("audiocpu"), data_to_i8031);
+ i8051_set_serial_tx_callback(machine.device("audiocpu"), data_from_i8031);
+ i8051_set_serial_rx_callback(machine.device("audiocpu"), data_to_i8031);
- state->duart68681 = machine->device("duart68681");
+ state->duart68681 = machine.device("duart68681");
/* The Am29000 program seems to rely on RAM from 0x00470000 onwards being
non-zero on a reset, otherwise the 3D object data doesn't get uploaded! */
@@ -642,12 +642,12 @@ DRIVER_INIT( micro3d )
/* TODO? BOTSS crashes when starting the final stage because the 68000
overwrites memory in use by the Am29000. Slowing down the 68000 slightly
avoids this */
- machine->device("maincpu")->set_clock_scale(0.945f);
+ machine.device("maincpu")->set_clock_scale(0.945f);
}
DRIVER_INIT( botssa )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Required to pass the hardware version check */
space->install_legacy_read_handler(0x140000, 0x140001, FUNC(botssa_140000_r) );
@@ -658,7 +658,7 @@ DRIVER_INIT( botssa )
MACHINE_RESET( micro3d )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
state->ti_uart[STATUS] = 1;
diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c
index 7be4c876e7c..407206f5fe9 100644
--- a/src/mame/machine/midtunit.c
+++ b/src/mame/machine/midtunit.c
@@ -49,7 +49,7 @@ static UINT8 jdredd_prot_max;
*
*************************************/
-static void register_state_saving(running_machine *machine)
+static void register_state_saving(running_machine &machine)
{
state_save_register_global(machine, cmos_write_enable);
state_save_register_global(machine, fake_sound_state);
@@ -79,7 +79,7 @@ WRITE16_HANDLER( midtunit_cmos_w )
{
if (1)/*cmos_write_enable)*/
{
- midtunit_state *state = space->machine->driver_data<midtunit_state>();
+ midtunit_state *state = space->machine().driver_data<midtunit_state>();
COMBINE_DATA(state->m_nvram+offset);
cmos_write_enable = 0;
}
@@ -93,7 +93,7 @@ WRITE16_HANDLER( midtunit_cmos_w )
READ16_HANDLER( midtunit_cmos_r )
{
- midtunit_state *state = space->machine->driver_data<midtunit_state>();
+ midtunit_state *state = space->machine().driver_data<midtunit_state>();
return state->m_nvram[offset];
}
@@ -109,7 +109,7 @@ READ16_HANDLER( midtunit_input_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
@@ -184,7 +184,7 @@ static READ16_HANDLER( mkturbo_prot_r )
{
/* the security GAL overlays a counter of some sort at 0xfffff400 in ROM space.
* A startup protection check expects to read back two different values in succession */
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -411,7 +411,7 @@ static READ16_HANDLER( jdredd_hack_r )
*
*************************************/
-static void init_tunit_generic(running_machine *machine, int sound)
+static void init_tunit_generic(running_machine &machine, int sound)
{
offs_t gfx_chunk = midtunit_gfx_rom_size / 4;
UINT8 *base;
@@ -421,7 +421,7 @@ static void init_tunit_generic(running_machine *machine, int sound)
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- base = machine->region("gfx1")->base();
+ base = machine.region("gfx1")->base();
for (i = 0; i < midtunit_gfx_rom_size; i += 4)
{
midtunit_gfx_rom[i + 0] = base[0 * gfx_chunk + i / 4];
@@ -464,22 +464,22 @@ DRIVER_INIT( mktunit )
init_tunit_generic(machine, SOUND_ADPCM);
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b00000, 0x1b6ffff, FUNC(mk_prot_r), FUNC(mk_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b00000, 0x1b6ffff, FUNC(mk_prot_r), FUNC(mk_prot_w));
/* sound chip protection (hidden RAM) */
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfb9c, 0xfbc6);
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfb9c, 0xfbc6);
}
DRIVER_INIT( mkturbo )
{
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfffff400, 0xfffff40f, FUNC(mkturbo_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfffff400, 0xfffff40f, FUNC(mkturbo_prot_r));
DRIVER_INIT_CALL(mktunit);
}
-static void init_nbajam_common(running_machine *machine, int te_protection)
+static void init_nbajam_common(running_machine &machine, int te_protection)
{
/* common init */
init_tunit_generic(machine, SOUND_ADPCM_LARGE);
@@ -488,20 +488,20 @@ static void init_nbajam_common(running_machine *machine, int te_protection)
if (!te_protection)
{
nbajam_prot_table = nbajam_prot_values;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b14020, 0x1b2503f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b14020, 0x1b2503f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
}
else
{
nbajam_prot_table = nbajamte_prot_values;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b15f40, 0x1b37f5f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b95f40, 0x1bb7f5f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b15f40, 0x1b37f5f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b95f40, 0x1bb7f5f, FUNC(nbajam_prot_r), FUNC(nbajam_prot_w));
}
/* sound chip protection (hidden RAM) */
if (!te_protection)
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbaa, 0xfbd4);
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbaa, 0xfbd4);
else
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbec, 0xfc16);
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(0xfbec, 0xfc16);
}
DRIVER_INIT( nbajam )
@@ -520,19 +520,19 @@ DRIVER_INIT( jdreddp )
init_tunit_generic(machine, SOUND_ADPCM_LARGE);
/* looks like the watchdog needs to be disabled */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x01d81060, 0x01d8107f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x01d81060, 0x01d8107f);
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b00000, 0x1bfffff, FUNC(jdredd_prot_r), FUNC(jdredd_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x1b00000, 0x1bfffff, FUNC(jdredd_prot_r), FUNC(jdredd_prot_w));
/* sound chip protection (hidden RAM) */
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_read_bank(0xfbcf, 0xfbf9, "bank7");
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_write_bank(0xfbcf, 0xfbf9, "bank9");
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_read_bank(0xfbcf, 0xfbf9, "bank7");
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_write_bank(0xfbcf, 0xfbf9, "bank9");
memory_set_bankptr(machine, "bank9", auto_alloc_array(machine, UINT8, 0x80));
#if ENABLE_ALL_JDREDD_LEVELS
/* how about the final levels? */
- jdredd_hack = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFBA7FF0, 0xFFBA7FFf, FUNC(jdredd_hack_r));
+ jdredd_hack = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFBA7FF0, 0xFFBA7FFf, FUNC(jdredd_hack_r));
#endif
}
@@ -553,13 +553,13 @@ DRIVER_INIT( mk2 )
midtunit_gfx_rom_large = 1;
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00f20c60, 0x00f20c7f, FUNC(mk2_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00f42820, 0x00f4283f, FUNC(mk2_prot_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a190e0, 0x01a190ff, FUNC(mk2_prot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a191c0, 0x01a191df, FUNC(mk2_prot_shift_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a3d0c0, 0x01a3d0ff, FUNC(mk2_prot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01d9d1e0, 0x01d9d1ff, FUNC(mk2_prot_const_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01def920, 0x01def93f, FUNC(mk2_prot_const_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00f20c60, 0x00f20c7f, FUNC(mk2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00f42820, 0x00f4283f, FUNC(mk2_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a190e0, 0x01a190ff, FUNC(mk2_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a191c0, 0x01a191df, FUNC(mk2_prot_shift_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01a3d0c0, 0x01a3d0ff, FUNC(mk2_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01d9d1e0, 0x01d9d1ff, FUNC(mk2_prot_const_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01def920, 0x01def93f, FUNC(mk2_prot_const_r));
}
diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c
index 748df91066d..91d6d02f2a3 100644
--- a/src/mame/machine/midwayic.c
+++ b/src/mame/machine/midwayic.c
@@ -73,7 +73,7 @@ struct ioasic_state
UINT8 shuffle_type;
UINT8 shuffle_active;
const UINT8 * shuffle_map;
- void (*irq_callback)(running_machine *, int);
+ void (*irq_callback)(running_machine &, int);
UINT8 irq_state;
UINT16 sound_irq_state;
UINT8 auto_ack;
@@ -107,9 +107,9 @@ static struct ioasic_state ioasic;
*
*************************************/
-static void generate_serial_data(running_machine *machine, int upper)
+static void generate_serial_data(running_machine &machine, int upper)
{
- int year = atoi(machine->system().year), month = 12, day = 11;
+ int year = atoi(machine.system().year), month = 12, day = 11;
UINT32 serial_number, temp;
UINT8 serial_digit[9];
@@ -126,8 +126,8 @@ static void generate_serial_data(running_machine *machine, int upper)
serial_digit[7] = (serial_number / 10) % 10;
serial_digit[8] = (serial_number / 1) % 10;
- serial.data[12] = machine->rand() & 0xff;
- serial.data[13] = machine->rand() & 0xff;
+ serial.data[12] = machine.rand() & 0xff;
+ serial.data[13] = machine.rand() & 0xff;
serial.data[14] = 0; /* ??? */
serial.data[15] = 0; /* ??? */
@@ -170,7 +170,7 @@ static void generate_serial_data(running_machine *machine, int upper)
*
*************************************/
-static void serial_register_state(running_machine *machine)
+static void serial_register_state(running_machine &machine)
{
state_save_register_global_array(machine, serial.data);
state_save_register_global(machine, serial.buffer);
@@ -181,7 +181,7 @@ static void serial_register_state(running_machine *machine)
}
-void midway_serial_pic_init(running_machine *machine, int upper)
+void midway_serial_pic_init(running_machine &machine, int upper)
{
serial_register_state(machine);
generate_serial_data(machine, upper);
@@ -207,7 +207,7 @@ UINT8 midway_serial_pic_status_r(void)
UINT8 midway_serial_pic_r(address_space *space)
{
- logerror("%s:security R = %04X\n", space->machine->describe_context(), serial.buffer);
+ logerror("%s:security R = %04X\n", space->machine().describe_context(), serial.buffer);
serial.status = 1;
return serial.buffer;
}
@@ -215,7 +215,7 @@ UINT8 midway_serial_pic_r(address_space *space)
void midway_serial_pic_w(address_space *space, UINT8 data)
{
- logerror("%s:security W = %04X\n", space->machine->describe_context(), data);
+ logerror("%s:security W = %04X\n", space->machine().describe_context(), data);
/* status seems to reflect the clock bit */
serial.status = (data >> 4) & 1;
@@ -255,7 +255,7 @@ static TIMER_CALLBACK( reset_timer )
}
-static void pic_register_state(running_machine *machine)
+static void pic_register_state(running_machine &machine)
{
state_save_register_global(machine, pic.latch);
state_save_register_global(machine, pic.latch_expire_time);
@@ -273,14 +273,14 @@ static void pic_register_state(running_machine *machine)
}
-void midway_serial_pic2_init(running_machine *machine, int upper, int yearoffs)
+void midway_serial_pic2_init(running_machine &machine, int upper, int yearoffs)
{
serial_register_state(machine);
pic_register_state(machine);
pic.yearoffs = yearoffs;
pic.time_just_written = 0;
- pic.time_write_timer = machine->scheduler().timer_alloc(FUNC(reset_timer));
+ pic.time_write_timer = machine.scheduler().timer_alloc(FUNC(reset_timer));
memset(pic.default_nvram, 0xff, sizeof(pic.default_nvram));
generate_serial_data(machine, upper);
}
@@ -299,14 +299,14 @@ UINT8 midway_serial_pic2_status_r(address_space *space)
/* if we're still holding the data ready bit high, do it */
if (pic.latch & 0xf00)
{
- if (space->machine->time() > pic.latch_expire_time)
+ if (space->machine().time() > pic.latch_expire_time)
pic.latch &= 0xff;
else
pic.latch -= 0x100;
result = 1;
}
- logerror("%s:PIC status %d\n", space->machine->describe_context(), result);
+ logerror("%s:PIC status %d\n", space->machine().describe_context(), result);
return result;
}
@@ -316,7 +316,7 @@ UINT8 midway_serial_pic2_r(address_space *space)
UINT8 result = 0;
/* PIC data register */
- logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", space->machine->describe_context(), pic.index, pic.total, pic.latch);
+ logerror("%s:PIC data read (index=%d total=%d latch=%03X) =", space->machine().describe_context(), pic.index, pic.total, pic.latch);
/* return the current result */
if (pic.latch & 0xf00)
@@ -333,20 +333,20 @@ UINT8 midway_serial_pic2_r(address_space *space)
void midway_serial_pic2_w(address_space *space, UINT8 data)
{
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
static FILE *nvramlog;
if (LOG_NVRAM && !nvramlog)
nvramlog = fopen("nvram.log", "w");
/* PIC command register */
if (pic.state == 0)
- logerror("%s:PIC command %02X\n", machine->describe_context(), data);
+ logerror("%s:PIC command %02X\n", machine.describe_context(), data);
else
- logerror("%s:PIC data %02X\n", machine->describe_context(), data);
+ logerror("%s:PIC data %02X\n", machine.describe_context(), data);
/* store in the latch, along with a bit to indicate we have data */
pic.latch = (data & 0x00f) | 0x480;
- pic.latch_expire_time = machine->time() + attotime::from_msec(1);
+ pic.latch_expire_time = machine.time() + attotime::from_msec(1);
if (data & 0x10)
{
int cmd = pic.state ? (pic.state & 0x0f) : (pic.latch & 0x0f);
@@ -383,7 +383,7 @@ void midway_serial_pic2_w(address_space *space, UINT8 data)
if (!pic.time_just_written)
{
system_time systime;
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
pic.buffer[pic.total++] = make_bcd(systime.local_time.second);
pic.buffer[pic.total++] = make_bcd(systime.local_time.minute);
@@ -559,13 +559,13 @@ enum
static UINT16 ioasic_fifo_r(device_t *device);
static UINT16 ioasic_fifo_status_r(device_t *device);
-static void ioasic_input_empty(running_machine *machine, int state);
-static void ioasic_output_full(running_machine *machine, int state);
-static void update_ioasic_irq(running_machine *machine);
-static void cage_irq_handler(running_machine *machine, int state);
+static void ioasic_input_empty(running_machine &machine, int state);
+static void ioasic_output_full(running_machine &machine, int state);
+static void update_ioasic_irq(running_machine &machine);
+static void cage_irq_handler(running_machine &machine, int state);
-static void ioasic_register_state(running_machine *machine)
+static void ioasic_register_state(running_machine &machine)
{
state_save_register_global_array(machine, ioasic.reg);
state_save_register_global(machine, ioasic.shuffle_active);
@@ -581,7 +581,7 @@ static void ioasic_register_state(running_machine *machine)
}
-void midway_ioasic_init(running_machine *machine, int shuffle, int upper, int yearoffs, void (*irq_callback)(running_machine *, int))
+void midway_ioasic_init(running_machine &machine, int shuffle, int upper, int yearoffs, void (*irq_callback)(running_machine &, int))
{
static const UINT8 shuffle_maps[][16] =
{
@@ -599,13 +599,13 @@ void midway_ioasic_init(running_machine *machine, int shuffle, int upper, int ye
ioasic_register_state(machine);
/* do we have a DCS2 sound chip connected? (most likely) */
- ioasic.has_dcs = (machine->device("dcs2") != NULL || machine->device("dsio") != NULL || machine->device("denver") != NULL);
- ioasic.has_cage = (machine->device("cage") != NULL);
- ioasic.dcs_cpu = machine->device("dcs2");
+ ioasic.has_dcs = (machine.device("dcs2") != NULL || machine.device("dsio") != NULL || machine.device("denver") != NULL);
+ ioasic.has_cage = (machine.device("cage") != NULL);
+ ioasic.dcs_cpu = machine.device("dcs2");
if (ioasic.dcs_cpu == NULL)
- ioasic.dcs_cpu = machine->device("dsio");
+ ioasic.dcs_cpu = machine.device("dsio");
if (ioasic.dcs_cpu == NULL)
- ioasic.dcs_cpu = machine->device("denver");
+ ioasic.dcs_cpu = machine.device("denver");
ioasic.shuffle_type = shuffle;
ioasic.shuffle_map = &shuffle_maps[shuffle][0];
ioasic.auto_ack = 0;
@@ -644,7 +644,7 @@ void midway_ioasic_set_shuffle_state(int state)
}
-void midway_ioasic_reset(running_machine *machine)
+void midway_ioasic_reset(running_machine &machine)
{
ioasic.shuffle_active = 0;
ioasic.sound_irq_state = 0x0080;
@@ -656,7 +656,7 @@ void midway_ioasic_reset(running_machine *machine)
}
-static void update_ioasic_irq(running_machine *machine)
+static void update_ioasic_irq(running_machine &machine)
{
UINT16 fifo_state = ioasic_fifo_status_r(NULL);
UINT16 irqbits = 0x2000;
@@ -682,7 +682,7 @@ static void update_ioasic_irq(running_machine *machine)
}
-static void cage_irq_handler(running_machine *machine, int reason)
+static void cage_irq_handler(running_machine &machine, int reason)
{
logerror("CAGE irq handler: %d\n", reason);
ioasic.sound_irq_state = 0;
@@ -694,7 +694,7 @@ static void cage_irq_handler(running_machine *machine, int reason)
}
-static void ioasic_input_empty(running_machine *machine, int state)
+static void ioasic_input_empty(running_machine &machine, int state)
{
// logerror("ioasic_input_empty(%d)\n", state);
if (state)
@@ -705,7 +705,7 @@ static void ioasic_input_empty(running_machine *machine, int state)
}
-static void ioasic_output_full(running_machine *machine, int state)
+static void ioasic_output_full(running_machine &machine, int state)
{
// logerror("ioasic_output_full(%d)\n", state);
if (state)
@@ -733,7 +733,7 @@ static UINT16 ioasic_fifo_r(device_t *device)
/* fetch the data from the buffer and update the IOASIC state */
result = ioasic.fifo[ioasic.fifo_out++ % FIFO_SIZE];
ioasic.fifo_bytes--;
- update_ioasic_irq(device->machine);
+ update_ioasic_irq(device->machine());
if (LOG_FIFO && (ioasic.fifo_bytes < 4 || ioasic.fifo_bytes >= FIFO_SIZE - 4))
logerror("fifo_r(%04X): FIFO bytes = %d!\n", result, ioasic.fifo_bytes);
@@ -788,7 +788,7 @@ static UINT16 ioasic_fifo_status_r(device_t *device)
}
-void midway_ioasic_fifo_reset_w(running_machine *machine, int state)
+void midway_ioasic_fifo_reset_w(running_machine &machine, int state)
{
/* on the high state, reset the FIFO data */
if (state)
@@ -800,11 +800,11 @@ void midway_ioasic_fifo_reset_w(running_machine *machine, int state)
update_ioasic_irq(machine);
}
if (LOG_FIFO)
- logerror("%s:fifo_reset(%d)\n", machine->describe_context(), state);
+ logerror("%s:fifo_reset(%d)\n", machine.describe_context(), state);
}
-void midway_ioasic_fifo_w(running_machine *machine, UINT16 data)
+void midway_ioasic_fifo_w(running_machine &machine, UINT16 data)
{
/* if we have room, add it to the FIFO buffer */
if (ioasic.fifo_bytes < FIFO_SIZE)
@@ -824,7 +824,7 @@ void midway_ioasic_fifo_w(running_machine *machine, UINT16 data)
}
-void midway_ioasic_fifo_full_w(running_machine *machine, UINT16 data)
+void midway_ioasic_fifo_full_w(running_machine &machine, UINT16 data)
{
if (LOG_FIFO)
logerror("fifo_full_w(%04X)\n", data);
@@ -862,7 +862,7 @@ READ32_HANDLER( midway_ioasic_r )
switch (offset)
{
case IOASIC_PORT0:
- result = input_port_read(space->machine, "DIPS");
+ result = input_port_read(space->machine(), "DIPS");
/* bit 0 seems to be a ready flag before shuffling happens */
if (!ioasic.shuffle_active)
{
@@ -874,15 +874,15 @@ READ32_HANDLER( midway_ioasic_r )
break;
case IOASIC_PORT1:
- result = input_port_read(space->machine, "SYSTEM");
+ result = input_port_read(space->machine(), "SYSTEM");
break;
case IOASIC_PORT2:
- result = input_port_read(space->machine, "IN1");
+ result = input_port_read(space->machine(), "IN1");
break;
case IOASIC_PORT3:
- result = input_port_read(space->machine, "IN2");
+ result = input_port_read(space->machine(), "IN2");
break;
case IOASIC_UARTIN:
@@ -984,7 +984,7 @@ WRITE32_HANDLER( midway_ioasic_w )
{
/* we're in loopback mode -- copy to the input */
ioasic.reg[IOASIC_UARTIN] = (newreg & 0x00ff) | 0x1000;
- update_ioasic_irq(space->machine);
+ update_ioasic_irq(space->machine());
}
else if (PRINTF_DEBUG)
mame_printf_debug("%c", data & 0xff);
@@ -1000,14 +1000,14 @@ WRITE32_HANDLER( midway_ioasic_w )
{
if ((oldreg ^ newreg) & 1)
{
- cage_control_w(space->machine, 0);
+ cage_control_w(space->machine(), 0);
if (!(~newreg & 1))
- cage_control_w(space->machine, 3);
+ cage_control_w(space->machine(), 3);
}
}
/* FIFO reset? */
- midway_ioasic_fifo_reset_w(space->machine, ~newreg & 4);
+ midway_ioasic_fifo_reset_w(space->machine(), ~newreg & 4);
break;
case IOASIC_SOUNDOUT:
@@ -1040,7 +1040,7 @@ WRITE32_HANDLER( midway_ioasic_w )
/* bit 14 = LED? */
if ((oldreg ^ newreg) & 0x3ff6)
logerror("IOASIC int control = %04X\n", data);
- update_ioasic_irq(space->machine);
+ update_ioasic_irq(space->machine());
break;
default:
diff --git a/src/mame/machine/midwayic.h b/src/mame/machine/midwayic.h
index 23522f9c828..61cfda69cdd 100644
--- a/src/mame/machine/midwayic.h
+++ b/src/mame/machine/midwayic.h
@@ -6,7 +6,7 @@
/* 1st generation Midway serial PIC */
-void midway_serial_pic_init(running_machine *machine, int upper);
+void midway_serial_pic_init(running_machine &machine, int upper);
void midway_serial_pic_reset_w(int state);
UINT8 midway_serial_pic_status_r(void);
UINT8 midway_serial_pic_r(address_space *space);
@@ -14,7 +14,7 @@ void midway_serial_pic_w(address_space *space, UINT8 data);
/* 2nd generation Midway serial/NVRAM/RTC PIC */
-void midway_serial_pic2_init(running_machine *machine, int upper, int yearoffs);
+void midway_serial_pic2_init(running_machine &machine, int upper, int yearoffs);
void midway_serial_pic2_set_default_nvram(const UINT8 *nvram);
UINT8 midway_serial_pic2_status_r(address_space *space);
UINT8 midway_serial_pic2_r(address_space *space);
@@ -23,13 +23,13 @@ NVRAM_HANDLER( midway_serial_pic2 );
/* I/O ASIC connected to 2nd generation PIC */
-void midway_ioasic_init(running_machine *machine, int shuffle, int upper, int yearoffs, void (*irq_callback)(running_machine *, int));
+void midway_ioasic_init(running_machine &machine, int shuffle, int upper, int yearoffs, void (*irq_callback)(running_machine &, int));
void midway_ioasic_set_auto_ack(int auto_ack);
void midway_ioasic_set_shuffle_state(int state);
-void midway_ioasic_reset(running_machine *machine);
-void midway_ioasic_fifo_w(running_machine *machine, UINT16 data);
-void midway_ioasic_fifo_reset_w(running_machine *machine, int state);
-void midway_ioasic_fifo_full_w(running_machine *machine, UINT16 data);
+void midway_ioasic_reset(running_machine &machine);
+void midway_ioasic_fifo_w(running_machine &machine, UINT16 data);
+void midway_ioasic_fifo_reset_w(running_machine &machine, int state);
+void midway_ioasic_fifo_full_w(running_machine &machine, UINT16 data);
READ32_HANDLER( midway_ioasic_r );
WRITE32_HANDLER( midway_ioasic_w );
READ32_HANDLER( midway_ioasic_packed_r );
diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c
index b5337d88e1a..60ee7185353 100644
--- a/src/mame/machine/midwunit.c
+++ b/src/mame/machine/midwunit.c
@@ -24,9 +24,9 @@ static READ16_HANDLER( midwunit_sound_state_r );
*
*************************************/
-static void register_state_saving(running_machine *machine)
+static void register_state_saving(running_machine &machine)
{
- midwunit_state *state = machine->driver_data<midwunit_state>();
+ midwunit_state *state = machine.driver_data<midwunit_state>();
state_save_register_global(machine, state->cmos_write_enable);
state_save_register_global_array(machine, state->iodata);
state_save_register_global_array(machine, state->ioshuffle);
@@ -44,17 +44,17 @@ static void register_state_saving(running_machine *machine)
WRITE16_HANDLER( midwunit_cmos_enable_w )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
state->cmos_write_enable = 1;
}
WRITE16_HANDLER( midwunit_cmos_w )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
if (state->cmos_write_enable)
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
COMBINE_DATA(state->m_nvram+offset);
state->cmos_write_enable = 0;
}
@@ -69,7 +69,7 @@ WRITE16_HANDLER( midwunit_cmos_w )
READ16_HANDLER( midwunit_cmos_r )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
return state->m_nvram[offset];
}
@@ -83,7 +83,7 @@ READ16_HANDLER( midwunit_cmos_r )
WRITE16_HANDLER( midwunit_io_w )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
int oldword, newword;
offset %= 8;
@@ -126,7 +126,7 @@ WRITE16_HANDLER( midwunit_io_w )
READ16_HANDLER( midwunit_io_r )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
static const char *const portnames[] = { "IN0", "IN1", "DSW", "IN2" };
/* apply I/O shuffling */
@@ -138,7 +138,7 @@ READ16_HANDLER( midwunit_io_r )
case 1:
case 2:
case 3:
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
case 4:
return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(space,0,0xffff);
@@ -158,9 +158,9 @@ READ16_HANDLER( midwunit_io_r )
*
*************************************/
-static void init_wunit_generic(running_machine *machine)
+static void init_wunit_generic(running_machine &machine)
{
- midwunit_state *state = machine->driver_data<midwunit_state>();
+ midwunit_state *state = machine.driver_data<midwunit_state>();
UINT8 *base;
int i, j, len;
@@ -168,8 +168,8 @@ static void init_wunit_generic(running_machine *machine)
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ midtunit_gfx_rom = base = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0; i < len / 0x400000; i++)
{
memcpy(state->decode_memory, base, 0x400000);
@@ -202,7 +202,7 @@ static void init_wunit_generic(running_machine *machine)
static WRITE16_HANDLER( umk3_palette_hack_w )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
/*
UMK3 uses a circular buffer to hold pending palette changes; the buffer holds 17 entries
total, and the buffer is processed/cleared during the video interrupt. Most of the time,
@@ -226,7 +226,7 @@ static WRITE16_HANDLER( umk3_palette_hack_w )
/* printf("in=%04X%04X out=%04X%04X\n", state->umk3_palette[3], state->umk3_palette[2], state->umk3_palette[1], state->umk3_palette[0]); */
}
-static void init_mk3_common(running_machine *machine)
+static void init_mk3_common(running_machine &machine)
{
/* common init */
init_wunit_generic(machine);
@@ -252,16 +252,16 @@ DRIVER_INIT( mk3r10 )
DRIVER_INIT( umk3 )
{
- midwunit_state *state = machine->driver_data<midwunit_state>();
+ midwunit_state *state = machine.driver_data<midwunit_state>();
init_mk3_common(machine);
- state->umk3_palette = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0106a060, 0x0106a09f, FUNC(umk3_palette_hack_w));
+ state->umk3_palette = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0106a060, 0x0106a09f, FUNC(umk3_palette_hack_w));
}
DRIVER_INIT( umk3r11 )
{
- midwunit_state *state = machine->driver_data<midwunit_state>();
+ midwunit_state *state = machine.driver_data<midwunit_state>();
init_mk3_common(machine);
- state->umk3_palette = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0106a060, 0x0106a09f, FUNC(umk3_palette_hack_w));
+ state->umk3_palette = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0106a060, 0x0106a09f, FUNC(umk3_palette_hack_w));
}
@@ -293,7 +293,7 @@ DRIVER_INIT( nbahangt )
static WRITE16_HANDLER( wwfmania_io_0_w )
{
- midwunit_state *state = space->machine->driver_data<midwunit_state>();
+ midwunit_state *state = space->machine().driver_data<midwunit_state>();
int i;
/* start with the originals */
@@ -347,7 +347,7 @@ DRIVER_INIT( wwfmania )
init_wunit_generic(machine);
/* enable I/O shuffling */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01800000, 0x0180000f, FUNC(wwfmania_io_0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01800000, 0x0180000f, FUNC(wwfmania_io_0_w));
/* serial prefixes 430, 528 */
midway_serial_pic_init(machine, 528);
@@ -374,7 +374,7 @@ DRIVER_INIT( rmpgwt )
MACHINE_RESET( midwunit )
{
- midwunit_state *state = machine->driver_data<midwunit_state>();
+ midwunit_state *state = machine.driver_data<midwunit_state>();
int i;
/* reset sound */
diff --git a/src/mame/machine/midxunit.c b/src/mame/machine/midxunit.c
index 80e6f984b49..21308387ec2 100644
--- a/src/mame/machine/midxunit.c
+++ b/src/mame/machine/midxunit.c
@@ -15,7 +15,7 @@
/* prototype */
static READ16_HANDLER( midxunit_sound_state_r );
-static void midxunit_dcs_output_full(running_machine *machine, int state);
+static void midxunit_dcs_output_full(running_machine &machine, int state);
@@ -25,9 +25,9 @@ static void midxunit_dcs_output_full(running_machine *machine, int state);
*
*************************************/
-static void register_state_saving(running_machine *machine)
+static void register_state_saving(running_machine &machine)
{
- midxunit_state *state = machine->driver_data<midxunit_state>();
+ midxunit_state *state = machine.driver_data<midxunit_state>();
state_save_register_global(machine, state->cmos_write_enable);
state_save_register_global_array(machine, state->iodata);
state_save_register_global_array(machine, state->ioshuffle);
@@ -46,13 +46,13 @@ static void register_state_saving(running_machine *machine)
READ16_HANDLER( midxunit_cmos_r )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
return state->m_nvram[offset];
}
WRITE16_HANDLER( midxunit_cmos_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
COMBINE_DATA(state->m_nvram+offset);
}
@@ -65,7 +65,7 @@ WRITE16_HANDLER( midxunit_cmos_w )
WRITE16_HANDLER( midxunit_io_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
int oldword, newword;
offset = (offset / 2) % 8;
@@ -130,7 +130,7 @@ READ16_HANDLER( midxunit_io_r )
case 1:
case 2:
case 3:
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
default:
logerror("%08X:Unknown I/O read from %d\n", cpu_get_pc(space->cpu), offset);
@@ -142,16 +142,16 @@ READ16_HANDLER( midxunit_io_r )
READ16_HANDLER( midxunit_analog_r )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
- return input_port_read(space->machine, portnames[state->analog_port]);
+ return input_port_read(space->machine(), portnames[state->analog_port]);
}
WRITE16_HANDLER( midxunit_analog_select_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
if (offset == 0 && ACCESSING_BITS_0_7)
state->analog_port = data - 8;
}
@@ -171,9 +171,9 @@ READ16_HANDLER( midxunit_status_r )
*
*************************************/
-static void midxunit_dcs_output_full(running_machine *machine, int state)
+static void midxunit_dcs_output_full(running_machine &machine, int state)
{
- midxunit_state *drvstate = machine->driver_data<midxunit_state>();
+ midxunit_state *drvstate = machine.driver_data<midxunit_state>();
/* only signal if not in loopback state */
if (drvstate->uart[1] != 0x66)
cputag_set_input_line(machine, "maincpu", 1, state ? ASSERT_LINE : CLEAR_LINE);
@@ -182,7 +182,7 @@ static void midxunit_dcs_output_full(running_machine *machine, int state)
READ16_HANDLER( midxunit_uart_r )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
int result = 0;
/* convert to a byte offset */
@@ -209,7 +209,7 @@ READ16_HANDLER( midxunit_uart_r )
int temp = midxunit_sound_state_r(space, 0, 0xffff);
result |= (temp & 0x800) >> 9;
result |= (~temp & 0x400) >> 10;
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
break;
@@ -236,7 +236,7 @@ READ16_HANDLER( midxunit_uart_r )
int temp = midxunit_sound_state_r(space, 0, 0xffff);
result |= (temp & 0x800) >> 11;
result |= (~temp & 0x400) >> 8;
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
break;
@@ -252,7 +252,7 @@ READ16_HANDLER( midxunit_uart_r )
WRITE16_HANDLER( midxunit_uart_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
/* convert to a byte offset, ignoring MSB writes */
if ((offset & 1) || !ACCESSING_BITS_0_7)
return;
@@ -299,7 +299,7 @@ WRITE16_HANDLER( midxunit_uart_w )
DRIVER_INIT( revx )
{
- midxunit_state *state = machine->driver_data<midxunit_state>();
+ midxunit_state *state = machine.driver_data<midxunit_state>();
UINT8 *base;
int i, j, len;
@@ -307,8 +307,8 @@ DRIVER_INIT( revx )
register_state_saving(machine);
/* load the graphics ROMs -- quadruples */
- midtunit_gfx_rom = base = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ midtunit_gfx_rom = base = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
for (i = 0; i < len / 0x200000; i++)
{
memcpy(state->decode_memory, base, 0x200000);
@@ -338,7 +338,7 @@ DRIVER_INIT( revx )
MACHINE_RESET( midxunit )
{
- midxunit_state *state = machine->driver_data<midxunit_state>();
+ midxunit_state *state = machine.driver_data<midxunit_state>();
int i;
/* reset sound */
@@ -367,7 +367,7 @@ READ16_HANDLER( midxunit_security_r )
WRITE16_HANDLER( midxunit_security_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
if (ACCESSING_BITS_0_7)
state->security_bits = data & 0x0f;
}
@@ -375,7 +375,7 @@ WRITE16_HANDLER( midxunit_security_w )
WRITE16_HANDLER( midxunit_security_clock_w )
{
- midxunit_state *state = space->machine->driver_data<midxunit_state>();
+ midxunit_state *state = space->machine().driver_data<midxunit_state>();
if (offset == 0 && ACCESSING_BITS_0_7)
midway_serial_pic_w(space, ((~data & 2) << 3) | state->security_bits);
}
diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c
index f48fd83791b..121fbbbcaf9 100644
--- a/src/mame/machine/midyunit.c
+++ b/src/mame/machine/midyunit.c
@@ -28,7 +28,7 @@
WRITE16_HANDLER( midyunit_cmos_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
logerror("%08x:CMOS Write @ %05X\n", cpu_get_pc(space->cpu), offset);
COMBINE_DATA(&state->cmos_ram[offset + state->cmos_page]);
}
@@ -36,7 +36,7 @@ WRITE16_HANDLER( midyunit_cmos_w )
READ16_HANDLER( midyunit_cmos_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
return state->cmos_ram[offset + state->cmos_page];
}
@@ -50,7 +50,7 @@ READ16_HANDLER( midyunit_cmos_r )
WRITE16_HANDLER( midyunit_cmos_enable_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
state->cmos_w_enable = (~data >> 9) & 1;
logerror("%08x:Protection write = %04X\n", cpu_get_pc(space->cpu), data);
@@ -101,7 +101,7 @@ WRITE16_HANDLER( midyunit_cmos_enable_w )
READ16_HANDLER( midyunit_protection_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
/* return the most recently clocked value */
logerror("%08X:Protection read = %04X\n", cpu_get_pc(space->cpu), state->prot_result);
return state->prot_result;
@@ -119,7 +119,7 @@ READ16_HANDLER( midyunit_input_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
@@ -132,25 +132,25 @@ READ16_HANDLER( midyunit_input_r )
static READ16_HANDLER( term2_input_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
static const char *const portnames[] = { "IN0", "IN1", NULL, "DSW", "UNK0", "UNK1" };
if (offset != 2)
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
switch (state->term2_analog_select)
{
default:
- case 0: return input_port_read(space->machine, "STICK0_X");
- case 1: return input_port_read(space->machine, "STICK0_Y");
- case 2: return input_port_read(space->machine, "STICK1_X");
- case 3: return input_port_read(space->machine, "STICK1_Y");
+ case 0: return input_port_read(space->machine(), "STICK0_X");
+ case 1: return input_port_read(space->machine(), "STICK0_Y");
+ case 2: return input_port_read(space->machine(), "STICK1_X");
+ case 3: return input_port_read(space->machine(), "STICK1_Y");
}
}
static WRITE16_HANDLER( term2_sound_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
/* Flash Lamp Output Data */
if ( ((data & 0x800) != 0x800) && ((data & 0x400) == 0x400 ) )
{
@@ -192,7 +192,7 @@ static WRITE16_HANDLER( term2_sound_w )
static WRITE16_HANDLER( term2_hack_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
if (offset == 1 && cpu_get_pc(space->cpu) == 0xffce6520)
{
state->t2_hack_mem[offset] = 0;
@@ -203,7 +203,7 @@ static WRITE16_HANDLER( term2_hack_w )
static WRITE16_HANDLER( term2la3_hack_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
if (offset == 0 && cpu_get_pc(space->cpu) == 0xffce5230)
{
state->t2_hack_mem[offset] = 0;
@@ -214,7 +214,7 @@ static WRITE16_HANDLER( term2la3_hack_w )
static WRITE16_HANDLER( term2la2_hack_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
if (offset == 0 && cpu_get_pc(space->cpu) == 0xffce4b80)
{
state->t2_hack_mem[offset] = 0;
@@ -225,7 +225,7 @@ static WRITE16_HANDLER( term2la2_hack_w )
static WRITE16_HANDLER( term2la1_hack_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
if (offset == 0 && cpu_get_pc(space->cpu) == 0xffce33f0)
{
state->t2_hack_mem[offset] = 0;
@@ -244,7 +244,7 @@ static WRITE16_HANDLER( term2la1_hack_w )
static WRITE8_HANDLER( cvsd_protection_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
/* because the entire CVSD ROM is banked, we have to make sure that writes */
/* go to the proper location (i.e., bank 0); currently bank 0 always lives */
/* in the 0x10000-0x17fff space, so we just need to add 0x8000 to get the */
@@ -253,16 +253,16 @@ static WRITE8_HANDLER( cvsd_protection_w )
}
-static void init_generic(running_machine *machine, int bpp, int sound, int prot_start, int prot_end)
+static void init_generic(running_machine &machine, int bpp, int sound, int prot_start, int prot_end)
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
offs_t gfx_chunk = state->gfx_rom_size / 4;
UINT8 d1, d2, d3, d4, d5, d6;
UINT8 *base;
int i;
/* load graphics ROMs */
- base = machine->region("gfx1")->base();
+ base = machine.region("gfx1")->base();
switch (bpp)
{
case 4:
@@ -310,23 +310,23 @@ static void init_generic(running_machine *machine, int bpp, int sound, int prot_
{
case SOUND_CVSD_SMALL:
williams_cvsd_init(machine);
- machine->device("cvsdcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(prot_start, prot_end, FUNC(cvsd_protection_w));
- state->cvsd_protection_base = machine->region("cvsdcpu")->base() + 0x10000 + (prot_start - 0x8000);
+ machine.device("cvsdcpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(prot_start, prot_end, FUNC(cvsd_protection_w));
+ state->cvsd_protection_base = machine.region("cvsdcpu")->base() + 0x10000 + (prot_start - 0x8000);
break;
case SOUND_CVSD:
williams_cvsd_init(machine);
- machine->device("cvsdcpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("cvsdcpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_ADPCM:
williams_adpcm_init(machine);
- machine->device("adpcm")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("adpcm")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_NARC:
williams_narc_init(machine);
- machine->device("narc1cpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
+ machine.device("narc1cpu")->memory().space(AS_PROGRAM)->install_ram(prot_start, prot_end);
break;
case SOUND_YAWDIM:
@@ -366,7 +366,7 @@ DRIVER_INIT( narc )
DRIVER_INIT( trog )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data trog_protection_data =
{
@@ -396,7 +396,7 @@ DRIVER_INIT( smashtv )
DRIVER_INIT( hiimpact )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data hiimpact_protection_data =
{
@@ -415,7 +415,7 @@ DRIVER_INIT( hiimpact )
DRIVER_INIT( shimpact )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data shimpact_protection_data =
{
@@ -434,7 +434,7 @@ DRIVER_INIT( shimpact )
DRIVER_INIT( strkforc )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data strkforc_protection_data =
{
@@ -461,7 +461,7 @@ DRIVER_INIT( strkforc )
DRIVER_INIT( mkyunit )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data mk_protection_data =
{
@@ -493,22 +493,22 @@ static READ16_HANDLER( mkturbo_prot_r )
{
/* the security GAL overlays a counter of some sort at 0xfffff400 in ROM space.
* A startup protection check expects to read back two different values in succession */
- return space->machine->rand();
+ return space->machine().rand();
}
DRIVER_INIT( mkyturbo )
{
/* protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfffff400, 0xfffff40f, FUNC(mkturbo_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfffff400, 0xfffff40f, FUNC(mkturbo_prot_r));
DRIVER_INIT_CALL(mkyunit);
}
/********************** Terminator 2 **********************/
-static void term2_init_common(running_machine *machine, write16_space_func hack_w)
+static void term2_init_common(running_machine &machine, write16_space_func hack_w)
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data term2_protection_data =
{
@@ -521,12 +521,12 @@ static void term2_init_common(running_machine *machine, write16_space_func hack_
init_generic(machine, 6, SOUND_ADPCM, 0xfa8d, 0xfa9c);
/* special inputs */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01c00000, 0x01c0005f, FUNC(term2_input_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01e00000, 0x01e0001f, FUNC(term2_sound_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01c00000, 0x01c0005f, FUNC(term2_input_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01e00000, 0x01e0001f, FUNC(term2_sound_w));
/* HACK: this prevents the freeze on the movies */
/* until we figure whats causing it, this is better than nothing */
- state->t2_hack_mem = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x010aa0e0, 0x010aa0ff, FUNC(hack_w));
+ state->t2_hack_mem = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x010aa0e0, 0x010aa0ff, FUNC(hack_w));
}
DRIVER_INIT( term2 ) { term2_init_common(machine, term2_hack_w); }
@@ -540,7 +540,7 @@ DRIVER_INIT( term2la1 ) { term2_init_common(machine, term2la1_hack_w); }
DRIVER_INIT( totcarn )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* protection */
static const struct protection_data totcarn_protection_data =
{
@@ -564,7 +564,7 @@ DRIVER_INIT( totcarn )
MACHINE_RESET( midyunit )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* reset sound */
switch (state->chip_type)
{
@@ -599,7 +599,7 @@ MACHINE_RESET( midyunit )
WRITE16_HANDLER( midyunit_sound_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
/* check for out-of-bounds accesses */
if (offset)
{
@@ -618,7 +618,7 @@ WRITE16_HANDLER( midyunit_sound_w )
case SOUND_CVSD_SMALL:
case SOUND_CVSD:
williams_cvsd_reset_w((~data & 0x100) >> 8);
- williams_cvsd_data_w(space->machine, (data & 0xff) | ((data & 0x200) >> 1));
+ williams_cvsd_data_w(space->machine(), (data & 0xff) | ((data & 0x200) >> 1));
break;
case SOUND_ADPCM:
@@ -628,7 +628,7 @@ WRITE16_HANDLER( midyunit_sound_w )
case SOUND_YAWDIM:
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
}
}
diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c
index 627b926086d..9179ce6e5e9 100644
--- a/src/mame/machine/model1.c
+++ b/src/mame/machine/model1.c
@@ -8,12 +8,12 @@
#include "cpu/v60/v60.h"
#include "includes/model1.h"
-#define TGP_FUNCTION(name) void name(running_machine *machine)
+#define TGP_FUNCTION(name) void name(running_machine &machine)
static UINT32 fifoout_pop(address_space *space)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
UINT32 v;
if(state->fifoout_wpos == state->fifoout_rpos) {
fatalerror("TGP FIFOOUT underflow (%x)", cpu_get_pc(space->cpu));
@@ -59,7 +59,7 @@ static UINT32 fifoin_pop(model1_state *state)
static void fifoin_push(address_space *space, UINT32 data)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
// logerror("TGP FIFOIN write %08x (%x)\n", data, cpu_get_pc(space->cpu));
state->fifoin_data[state->fifoin_wpos++] = data;
if(state->fifoin_wpos == FIFO_SIZE)
@@ -68,7 +68,7 @@ static void fifoin_push(address_space *space, UINT32 data)
logerror("TGP FIFOIN overflow\n");
state->fifoin_cbcount--;
if(!state->fifoin_cbcount)
- state->fifoin_cb(space->machine);
+ state->fifoin_cb(space->machine());
}
static float fifoin_pop_f(model1_state *state)
@@ -121,7 +121,7 @@ static float ram_get_f(model1_state *state)
static TGP_FUNCTION( fadd )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float r = a+b;
@@ -132,7 +132,7 @@ static TGP_FUNCTION( fadd )
static TGP_FUNCTION( fsub )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float r = a-b;
@@ -144,7 +144,7 @@ static TGP_FUNCTION( fsub )
static TGP_FUNCTION( fmul )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float r = a*b;
@@ -155,7 +155,7 @@ static TGP_FUNCTION( fmul )
static TGP_FUNCTION( fdiv )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
// float r = !b ? 1e39 : a/b;
@@ -167,7 +167,7 @@ static TGP_FUNCTION( fdiv )
static TGP_FUNCTION( matrix_push )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
if(state->mat_stack_pos != MAT_STACK_SIZE) {
memcpy(state->mat_stack[state->mat_stack_pos], state->cmat, sizeof(state->cmat));
state->mat_stack_pos++;
@@ -178,7 +178,7 @@ static TGP_FUNCTION( matrix_push )
static TGP_FUNCTION( matrix_pop )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
if(state->mat_stack_pos) {
state->mat_stack_pos--;
memcpy(state->cmat, state->mat_stack[state->mat_stack_pos], sizeof(state->cmat));
@@ -189,7 +189,7 @@ static TGP_FUNCTION( matrix_pop )
static TGP_FUNCTION( matrix_write )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int i;
for(i=0; i<12; i++)
state->cmat[i] = fifoin_pop_f(state);
@@ -201,7 +201,7 @@ static TGP_FUNCTION( matrix_write )
static TGP_FUNCTION( clear_stack )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP clear_stack (%x)\n", state->pushpc);
state->mat_stack_pos = 0;
next_fn(state);
@@ -209,7 +209,7 @@ static TGP_FUNCTION( clear_stack )
static TGP_FUNCTION( matrix_mul )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float m[12];
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
@@ -243,7 +243,7 @@ static TGP_FUNCTION( matrix_mul )
static TGP_FUNCTION( anglev )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
logerror("TGP anglev %f, %f (%x)\n", a, b, state->pushpc);
@@ -264,7 +264,7 @@ static TGP_FUNCTION( anglev )
static TGP_FUNCTION( f11 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -292,7 +292,7 @@ static TGP_FUNCTION( f11 )
static TGP_FUNCTION( normalize )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -306,7 +306,7 @@ static TGP_FUNCTION( normalize )
static TGP_FUNCTION( acc_seti )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT32 a = fifoin_pop(state);
state->dump = 1;
logerror("TGP acc_seti %d (%x)\n", a, state->pushpc);
@@ -316,7 +316,7 @@ static TGP_FUNCTION( acc_seti )
static TGP_FUNCTION( track_select )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT32 a = fifoin_pop(state);
logerror("TGP track_select %d (%x)\n", a, state->pushpc);
state->tgp_vr_select = a;
@@ -325,7 +325,7 @@ static TGP_FUNCTION( track_select )
static TGP_FUNCTION( f14 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->tgp_vr_base[0] = fifoin_pop_f(state);
state->tgp_vr_base[1] = fifoin_pop_f(state);
state->tgp_vr_base[2] = fifoin_pop_f(state);
@@ -336,7 +336,7 @@ static TGP_FUNCTION( f14 )
static TGP_FUNCTION( f15_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f15_swa (%x)\n", state->pushpc);
next_fn(state);
@@ -344,7 +344,7 @@ static TGP_FUNCTION( f15_swa )
static TGP_FUNCTION( anglep )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -369,7 +369,7 @@ static TGP_FUNCTION( anglep )
static TGP_FUNCTION( matrix_ident )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP matrix_ident (%x)\n", state->pushpc);
memset(state->cmat, 0, sizeof(state->cmat));
state->cmat[0] = 1.0;
@@ -380,7 +380,7 @@ static TGP_FUNCTION( matrix_ident )
static TGP_FUNCTION( matrix_read )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int i;
logerror("TGP matrix_read (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f) (%x)\n",
state->cmat[0], state->cmat[1], state->cmat[2], state->cmat[3], state->cmat[4], state->cmat[5], state->cmat[6], state->cmat[7], state->cmat[8], state->cmat[9], state->cmat[10], state->cmat[11], state->pushpc);
@@ -391,7 +391,7 @@ static TGP_FUNCTION( matrix_read )
static TGP_FUNCTION( matrix_trans )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -404,7 +404,7 @@ static TGP_FUNCTION( matrix_trans )
static TGP_FUNCTION( matrix_scale )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -423,7 +423,7 @@ static TGP_FUNCTION( matrix_scale )
static TGP_FUNCTION( matrix_rotx )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float s = tsin(a);
float c = tcos(a);
@@ -446,7 +446,7 @@ static TGP_FUNCTION( matrix_rotx )
static TGP_FUNCTION( matrix_roty )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float s = tsin(a);
float c = tcos(a);
@@ -470,7 +470,7 @@ static TGP_FUNCTION( matrix_roty )
static TGP_FUNCTION( matrix_rotz )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float s = tsin(a);
float c = tcos(a);
@@ -494,8 +494,8 @@ static TGP_FUNCTION( matrix_rotz )
static TGP_FUNCTION( track_read_quad )
{
- model1_state *state = machine->driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine->region("user2")->base();
+ model1_state *state = machine.driver_data<model1_state>();
+ const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
UINT32 a = fifoin_pop(state);
int offd;
@@ -519,7 +519,7 @@ static TGP_FUNCTION( track_read_quad )
static TGP_FUNCTION( f24_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -541,7 +541,7 @@ static TGP_FUNCTION( f24_swa )
static TGP_FUNCTION( transform_point )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float x = fifoin_pop_f(state);
float y = fifoin_pop_f(state);
float z = fifoin_pop_f(state);
@@ -555,7 +555,7 @@ static TGP_FUNCTION( transform_point )
static TGP_FUNCTION( fcos_m1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
logerror("TGP fcos %d (%x)\n", a, state->pushpc);
fifoout_push_f(state, tcos(a));
@@ -564,7 +564,7 @@ static TGP_FUNCTION( fcos_m1 )
static TGP_FUNCTION( fsin_m1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
logerror("TGP fsin %d (%x)\n", a, state->pushpc);
fifoout_push_f(state, tsin(a));
@@ -573,7 +573,7 @@ static TGP_FUNCTION( fsin_m1 )
static TGP_FUNCTION( fcosm_m1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float b = fifoin_pop_f(state);
logerror("TGP fcosm %d, %f (%x)\n", a, b, state->pushpc);
@@ -583,7 +583,7 @@ static TGP_FUNCTION( fcosm_m1 )
static TGP_FUNCTION( fsinm_m1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float b = fifoin_pop_f(state);
state->dump = 1;
@@ -594,7 +594,7 @@ static TGP_FUNCTION( fsinm_m1 )
static TGP_FUNCTION( distance3 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -611,7 +611,7 @@ static TGP_FUNCTION( distance3 )
static TGP_FUNCTION( ftoi )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP ftoi %f (%x)\n", a, state->pushpc);
fifoout_push(state, (int)a);
@@ -620,7 +620,7 @@ static TGP_FUNCTION( ftoi )
static TGP_FUNCTION( itof )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT32 a = fifoin_pop(state);
logerror("TGP itof %d (%x)\n", a, state->pushpc);
fifoout_push_f(state, a);
@@ -629,7 +629,7 @@ static TGP_FUNCTION( itof )
static TGP_FUNCTION( acc_set )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP acc_set %f (%x)\n", a, state->pushpc);
state->acc = a;
@@ -638,7 +638,7 @@ static TGP_FUNCTION( acc_set )
static TGP_FUNCTION( acc_get )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP acc_get (%x)\n", state->pushpc);
fifoout_push_f(state, state->acc);
next_fn(state);
@@ -646,7 +646,7 @@ static TGP_FUNCTION( acc_get )
static TGP_FUNCTION( acc_add )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP acc_add %f (%x)\n", a, state->pushpc);
state->acc += a;
@@ -655,7 +655,7 @@ static TGP_FUNCTION( acc_add )
static TGP_FUNCTION( acc_sub )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP acc_sub %f (%x)\n", a, state->pushpc);
state->acc -= a;
@@ -664,7 +664,7 @@ static TGP_FUNCTION( acc_sub )
static TGP_FUNCTION( acc_mul )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP acc_mul %f (%x)\n", a, state->pushpc);
state->acc *= a;
@@ -673,7 +673,7 @@ static TGP_FUNCTION( acc_mul )
static TGP_FUNCTION( acc_div )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
logerror("TGP acc_div %f (%x)\n", a, state->pushpc);
state->acc /= a;
@@ -682,7 +682,7 @@ static TGP_FUNCTION( acc_div )
static TGP_FUNCTION( f42 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -690,7 +690,7 @@ static TGP_FUNCTION( f42 )
(void)b;
(void)c;
logerror("TGP f42 %f, %f, %f (%x)\n", a, b, c, state->pushpc);
- // fifoout_push_f((machine->rand() % 1000) - 500);
+ // fifoout_push_f((machine.rand() % 1000) - 500);
fifoout_push_f(state, 0);
fifoout_push_f(state, 0);
fifoout_push_f(state, 0);
@@ -705,7 +705,7 @@ static TGP_FUNCTION( f42 )
static TGP_FUNCTION( xyz2rqf )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -744,7 +744,7 @@ static TGP_FUNCTION( xyz2rqf )
static TGP_FUNCTION( f43 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -767,7 +767,7 @@ static TGP_FUNCTION( f43 )
static TGP_FUNCTION( f43_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
int b = fifoin_pop(state);
int c = fifoin_pop(state);
@@ -783,7 +783,7 @@ static TGP_FUNCTION( f43_swa )
static TGP_FUNCTION( f44 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
(void)a;
logerror("TGP f44 %f (%x)\n", a, state->pushpc);
@@ -795,7 +795,7 @@ static TGP_FUNCTION( f44 )
static TGP_FUNCTION( matrix_sdir )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -846,7 +846,7 @@ static TGP_FUNCTION( matrix_sdir )
static TGP_FUNCTION( f45 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
(void)a;
logerror("TGP f45 %f (%x)\n", a, state->pushpc);
@@ -856,7 +856,7 @@ static TGP_FUNCTION( f45 )
static TGP_FUNCTION( vlength )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state) - state->tgp_vr_base[0];
float b = fifoin_pop_f(state) - state->tgp_vr_base[1];
float c = fifoin_pop_f(state) - state->tgp_vr_base[2];
@@ -872,7 +872,7 @@ static TGP_FUNCTION( vlength )
static TGP_FUNCTION( f47 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -884,8 +884,8 @@ static TGP_FUNCTION( f47 )
static TGP_FUNCTION( track_read_info )
{
- model1_state *state = machine->driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine->region("user2")->base();
+ model1_state *state = machine.driver_data<model1_state>();
+ const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
UINT16 a = fifoin_pop(state);
int offd;
@@ -898,7 +898,7 @@ static TGP_FUNCTION( track_read_info )
static TGP_FUNCTION( colbox_set )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -929,7 +929,7 @@ static TGP_FUNCTION( colbox_set )
static TGP_FUNCTION( colbox_test )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -946,7 +946,7 @@ static TGP_FUNCTION( colbox_test )
static TGP_FUNCTION( f49_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -965,7 +965,7 @@ static TGP_FUNCTION( f49_swa )
static TGP_FUNCTION( f50_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -981,14 +981,14 @@ static TGP_FUNCTION( f50_swa )
static TGP_FUNCTION( f52 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f52 (%x)\n", state->pushpc);
next_fn(state);
}
static TGP_FUNCTION( matrix_rdir )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1038,8 +1038,8 @@ static void tri_calc_pq(float ax, float ay, float bx, float by, float cx, float
static TGP_FUNCTION( track_lookup )
{
- model1_state *state = machine->driver_data<model1_state>();
- const UINT32 *tgp_data = (const UINT32 *)machine->region("user2")->base();
+ model1_state *state = machine.driver_data<model1_state>();
+ const UINT32 *tgp_data = (const UINT32 *)machine.region("user2")->base();
float a = fifoin_pop_f(state);
UINT32 b = fifoin_pop(state);
float c = fifoin_pop_f(state);
@@ -1097,7 +1097,7 @@ static TGP_FUNCTION( track_lookup )
static TGP_FUNCTION( f56 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1120,7 +1120,7 @@ static TGP_FUNCTION( f56 )
static TGP_FUNCTION( f57 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f57 (%x)\n", state->pushpc);
fifoout_push_f(state, 0);
fifoout_push_f(state, 0);
@@ -1130,7 +1130,7 @@ static TGP_FUNCTION( f57 )
static TGP_FUNCTION( matrix_readt )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP matrix_readt (%x)\n", state->pushpc);
fifoout_push_f(state, state->cmat[9]);
fifoout_push_f(state, state->cmat[10]);
@@ -1140,7 +1140,7 @@ static TGP_FUNCTION( matrix_readt )
static TGP_FUNCTION( acc_geti )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP acc_geti (%x)\n", state->pushpc);
fifoout_push(state, (int)state->acc);
next_fn(state);
@@ -1148,7 +1148,7 @@ static TGP_FUNCTION( acc_geti )
static TGP_FUNCTION( f60 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f60 (%x)\n", state->pushpc);
fifoout_push_f(state, 0);
fifoout_push_f(state, 0);
@@ -1158,7 +1158,7 @@ static TGP_FUNCTION( f60 )
static TGP_FUNCTION( col_setcirc )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1171,7 +1171,7 @@ static TGP_FUNCTION( col_setcirc )
static TGP_FUNCTION( col_testpt )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float x, y;
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
@@ -1184,7 +1184,7 @@ static TGP_FUNCTION( col_testpt )
static TGP_FUNCTION( push_and_ident )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
if(state->mat_stack_pos != MAT_STACK_SIZE) {
memcpy(state->mat_stack[state->mat_stack_pos], state->cmat, sizeof(state->cmat));
state->mat_stack_pos++;
@@ -1199,7 +1199,7 @@ static TGP_FUNCTION( push_and_ident )
static TGP_FUNCTION( catmull_rom )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1234,7 +1234,7 @@ static TGP_FUNCTION( catmull_rom )
static TGP_FUNCTION( distance )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1248,7 +1248,7 @@ static TGP_FUNCTION( distance )
static TGP_FUNCTION( car_move )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
INT16 a = fifoin_pop(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1268,7 +1268,7 @@ static TGP_FUNCTION( car_move )
static TGP_FUNCTION( cpa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float dv_x, dv_y, dv_z, dv2, dw_x, dw_y, dw_z, dt;
float a = fifoin_pop_f(state);
@@ -1313,7 +1313,7 @@ static TGP_FUNCTION( cpa )
static TGP_FUNCTION( vmat_store )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
if(a<21)
memcpy(state->mat_vector[a], state->cmat, sizeof(state->cmat));
@@ -1325,7 +1325,7 @@ static TGP_FUNCTION( vmat_store )
static TGP_FUNCTION( vmat_restore )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
if(a<21)
memcpy(state->cmat, state->mat_vector[a], sizeof(state->cmat));
@@ -1337,7 +1337,7 @@ static TGP_FUNCTION( vmat_restore )
static TGP_FUNCTION( vmat_mul )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
UINT32 b = fifoin_pop(state);
if(a<21 && b<21) {
@@ -1361,7 +1361,7 @@ static TGP_FUNCTION( vmat_mul )
static TGP_FUNCTION( vmat_read )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
logerror("TGP vmat_read %d (%x)\n", a, state->pushpc);
if(a<21) {
@@ -1379,7 +1379,7 @@ static TGP_FUNCTION( vmat_read )
static TGP_FUNCTION( matrix_rtrans )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP matrix_rtrans (%x)\n", state->pushpc);
fifoout_push_f(state, state->cmat[ 9]);
fifoout_push_f(state, state->cmat[10]);
@@ -1389,7 +1389,7 @@ static TGP_FUNCTION( matrix_rtrans )
static TGP_FUNCTION( matrix_unrot )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP matrix_unrot (%x)\n", state->pushpc);
memset(state->cmat, 0, 9*sizeof(state->cmat[0]));
state->cmat[0] = 1.0;
@@ -1400,7 +1400,7 @@ static TGP_FUNCTION( matrix_unrot )
static TGP_FUNCTION( f80 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f80 (%x)\n", state->pushpc);
// state->cmat[9] = state->cmat[10] = state->cmat[11] = 0;
next_fn(state);
@@ -1408,7 +1408,7 @@ static TGP_FUNCTION( f80 )
static TGP_FUNCTION( vmat_save )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
int i;
logerror("TGP vmat_save 0x%x (%x)\n", a, state->pushpc);
@@ -1419,7 +1419,7 @@ static TGP_FUNCTION( vmat_save )
static TGP_FUNCTION( vmat_load )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
int i;
logerror("TGP vmat_load 0x%x (%x)\n", a, state->pushpc);
@@ -1430,7 +1430,7 @@ static TGP_FUNCTION( vmat_load )
static TGP_FUNCTION( ram_setadr )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->ram_scanadr = fifoin_pop(state) - 0x8000;
logerror("TGP f0 ram_setadr 0x%x (%x)\n", state->ram_scanadr+0x8000, state->pushpc);
next_fn(state);
@@ -1438,7 +1438,7 @@ static TGP_FUNCTION( ram_setadr )
static TGP_FUNCTION( groundbox_test )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int out_x, out_y, out_z;
float x, /*y,*/ z;
float a = fifoin_pop_f(state);
@@ -1462,7 +1462,7 @@ static TGP_FUNCTION( groundbox_test )
static TGP_FUNCTION( f89 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
UINT32 b = fifoin_pop(state);
UINT32 c = fifoin_pop(state);
@@ -1477,7 +1477,7 @@ static TGP_FUNCTION( f89 )
static TGP_FUNCTION( f92 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1492,7 +1492,7 @@ static TGP_FUNCTION( f92 )
static TGP_FUNCTION( f93 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
(void)a;
logerror("TGP f93 %f (%x)\n", a, state->pushpc);
@@ -1501,7 +1501,7 @@ static TGP_FUNCTION( f93 )
static TGP_FUNCTION( f94 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
(void)a;
logerror("TGP f94 %d (%x)\n", a, state->pushpc);
@@ -1510,7 +1510,7 @@ static TGP_FUNCTION( f94 )
static TGP_FUNCTION( vmat_flatten )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int i;
float m[12];
logerror("TGP vmat_flatten (%x)\n", state->pushpc);
@@ -1537,7 +1537,7 @@ static TGP_FUNCTION( vmat_flatten )
static TGP_FUNCTION( vmat_load1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
logerror("TGP vmat_load1 0x%x (%x)\n", a, state->pushpc);
memcpy(state->cmat, state->ram_data+a, sizeof(state->cmat));
@@ -1546,7 +1546,7 @@ static TGP_FUNCTION( vmat_load1 )
static TGP_FUNCTION( ram_trans )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = ram_get_f(state);
float b = ram_get_f(state);
float c = ram_get_f(state);
@@ -1559,7 +1559,7 @@ static TGP_FUNCTION( ram_trans )
static TGP_FUNCTION( f98_load )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int i;
for(i=0; i<state->list_length; i++) {
float f = fifoin_pop_f(state);
@@ -1571,7 +1571,7 @@ static TGP_FUNCTION( f98_load )
static TGP_FUNCTION( f98 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 a = fifoin_pop(state);
(void)a;
logerror("TGP load list start %d (%x)\n", a, state->pushpc);
@@ -1581,24 +1581,24 @@ static TGP_FUNCTION( f98 )
static TGP_FUNCTION( f99 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP f99 (%x)\n", state->pushpc);
next_fn(state);
}
static TGP_FUNCTION( f100 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
int i;
logerror("TGP f100 get list (%x)\n", state->pushpc);
for(i=0; i<state->list_length; i++)
- fifoout_push_f(state, (machine->rand() % 1000)/100.0);
+ fifoout_push_f(state, (machine.rand() % 1000)/100.0);
next_fn(state);
}
static TGP_FUNCTION( groundbox_set )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
float c = fifoin_pop_f(state);
@@ -1620,7 +1620,7 @@ static TGP_FUNCTION( groundbox_set )
static TGP_FUNCTION( f102 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
float px, py, pz;
float a = fifoin_pop_f(state);
float b = fifoin_pop_f(state);
@@ -1673,7 +1673,7 @@ static TGP_FUNCTION( f102 )
static TGP_FUNCTION( f103 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->ram_scanadr = fifoin_pop(state) - 0x8000;
logerror("TGP f0 mve_setadr 0x%x (%x)\n", state->ram_scanadr, state->pushpc);
ram_get_i(state);
@@ -1881,7 +1881,7 @@ static const struct function ftab_swa[] = {
static TGP_FUNCTION( dump )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
logerror("TGP FIFOIN write %08x (%x)\n", fifoin_pop(state), state->pushpc);
state->fifoin_cbcount = 1;
state->fifoin_cb = dump;
@@ -1889,7 +1889,7 @@ static TGP_FUNCTION( dump )
static TGP_FUNCTION( function_get_vf )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 f = fifoin_pop(state) >> 23;
if(state->fifoout_rpos != state->fifoout_wpos) {
@@ -1913,7 +1913,7 @@ static TGP_FUNCTION( function_get_vf )
static TGP_FUNCTION( function_get_swa )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
UINT32 f = fifoin_pop(state);
if(state->fifoout_rpos != state->fifoout_wpos) {
@@ -1937,7 +1937,7 @@ static TGP_FUNCTION( function_get_swa )
READ16_HANDLER( model1_tgp_copro_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if(!offset) {
state->copro_r = fifoout_pop(space);
return state->copro_r;
@@ -1947,7 +1947,7 @@ READ16_HANDLER( model1_tgp_copro_r )
WRITE16_HANDLER( model1_tgp_copro_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if(offset) {
state->copro_w = (state->copro_w & 0x0000ffff) | (data << 16);
state->pushpc = cpu_get_pc(space->cpu);
@@ -1958,19 +1958,19 @@ WRITE16_HANDLER( model1_tgp_copro_w )
READ16_HANDLER( model1_tgp_copro_adr_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
return state->ram_adr;
}
WRITE16_HANDLER( model1_tgp_copro_adr_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(&state->ram_adr);
}
READ16_HANDLER( model1_tgp_copro_ram_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if(!offset) {
logerror("TGP f0 ram read %04x, %08x (%f) (%x)\n", state->ram_adr, state->ram_data[state->ram_adr], u2f(state->ram_data[state->ram_adr]), cpu_get_pc(space->cpu));
return state->ram_data[state->ram_adr];
@@ -1980,7 +1980,7 @@ READ16_HANDLER( model1_tgp_copro_ram_r )
WRITE16_HANDLER( model1_tgp_copro_ram_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->ram_latch+offset);
if(offset) {
UINT32 v = state->ram_latch[0]|(state->ram_latch[1]<<16);
@@ -1992,7 +1992,7 @@ WRITE16_HANDLER( model1_tgp_copro_ram_w )
MACHINE_START( model1 )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->ram_data = auto_alloc_array(machine, UINT32, 0x10000);
state_save_register_global_pointer(machine, state->ram_data, 0x10000);
@@ -2013,9 +2013,9 @@ MACHINE_START( model1 )
state_save_register_global(machine, state->list_length);
}
-void model1_tgp_reset(running_machine *machine, int swa)
+void model1_tgp_reset(running_machine &machine, int swa)
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->ram_adr = 0;
memset(state->ram_data, 0, 0x10000*4);
@@ -2039,9 +2039,9 @@ void model1_tgp_reset(running_machine *machine, int swa)
/*********************************** Virtua Racing ***********************************/
-void model1_vr_tgp_reset( running_machine *machine )
+void model1_vr_tgp_reset( running_machine &machine )
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
state->ram_adr = 0;
memset(state->ram_data, 0, 0x8000*4);
@@ -2056,7 +2056,7 @@ void model1_vr_tgp_reset( running_machine *machine )
/* FIFO */
static int copro_fifoin_pop(device_t *device, UINT32 *result)
{
- model1_state *state = device->machine->driver_data<model1_state>();
+ model1_state *state = device->machine().driver_data<model1_state>();
UINT32 r;
if (state->copro_fifoin_num == 0)
@@ -2080,7 +2080,7 @@ static int copro_fifoin_pop(device_t *device, UINT32 *result)
static void copro_fifoin_push(address_space *space, UINT32 data)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if (state->copro_fifoin_num == FIFO_SIZE)
{
fatalerror("Copro FIFOIN overflow (at %08X)", cpu_get_pc(space->cpu));
@@ -2099,15 +2099,15 @@ static void copro_fifoin_push(address_space *space, UINT32 data)
static UINT32 copro_fifoout_pop(address_space *space)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
UINT32 r;
if (state->copro_fifoout_num == 0)
{
// Reading from empty FIFO causes the v60 to enter wait state
- v60_stall(space->machine->device("maincpu"));
+ v60_stall(space->machine().device("maincpu"));
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return 0;
}
@@ -2126,7 +2126,7 @@ static UINT32 copro_fifoout_pop(address_space *space)
static void copro_fifoout_push(device_t *device, UINT32 data)
{
- model1_state *state = device->machine->driver_data<model1_state>();
+ model1_state *state = device->machine().driver_data<model1_state>();
if (state->copro_fifoout_num == FIFO_SIZE)
{
fatalerror("Copro FIFOOUT overflow (at %08X)", cpu_get_pc(device));
@@ -2145,19 +2145,19 @@ static void copro_fifoout_push(device_t *device, UINT32 data)
static READ32_HANDLER(copro_ram_r)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
return state->ram_data[offset & 0x7fff];
}
static WRITE32_HANDLER(copro_ram_w)
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
state->ram_data[offset&0x7fff] = data;
}
READ16_HANDLER( model1_tgp_vr_adr_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if ( state->ram_adr == 0 && state->copro_fifoin_num != 0 )
{
/* spin the main cpu and let the TGP catch up */
@@ -2169,13 +2169,13 @@ READ16_HANDLER( model1_tgp_vr_adr_r )
WRITE16_HANDLER( model1_tgp_vr_adr_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(&state->ram_adr);
}
READ16_HANDLER( model1_vr_tgp_ram_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
UINT16 r;
if (!offset)
@@ -2201,7 +2201,7 @@ READ16_HANDLER( model1_vr_tgp_ram_r )
WRITE16_HANDLER( model1_vr_tgp_ram_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->ram_latch+offset);
if (offset)
@@ -2215,7 +2215,7 @@ WRITE16_HANDLER( model1_vr_tgp_ram_w )
READ16_HANDLER( model1_vr_tgp_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if (!offset)
{
state->vr_r = copro_fifoout_pop(space);
@@ -2227,7 +2227,7 @@ READ16_HANDLER( model1_vr_tgp_r )
WRITE16_HANDLER( model1_vr_tgp_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if (offset)
{
state->vr_w = (state->vr_w & 0x0000ffff) | (data << 16);
diff --git a/src/mame/machine/model3.c b/src/mame/machine/model3.c
index c8692331d3a..d8eb39ed2a6 100644
--- a/src/mame/machine/model3.c
+++ b/src/mame/machine/model3.c
@@ -122,9 +122,9 @@ static int shift(UINT8 *data, INT32 num_bits)
* TDO.
*/
-int model3_tap_read(running_machine *machine)
+int model3_tap_read(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
return state->tdo;
}
@@ -141,9 +141,9 @@ int model3_tap_read(running_machine *machine)
* trst = Reset.
*/
-void model3_tap_write(running_machine *machine, int tck, int tms, int tdi, int trst)
+void model3_tap_write(running_machine &machine, int tck, int tms, int tdi, int trst)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
if (!tck)
return;
@@ -252,9 +252,9 @@ void model3_tap_write(running_machine *machine, int tck, int tms, int tdi, int t
* Resets the TAP (simulating a power up or SCAN_RST signal.)
*/
-void model3_tap_reset(running_machine *machine)
+void model3_tap_reset(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
state->id_size = 197; // 197 bits
state->tap_state = 0; // test-logic/reset
@@ -267,20 +267,20 @@ void model3_tap_reset(running_machine *machine)
*
*/
-void model3_machine_init(running_machine *machine, int step)
+void model3_machine_init(running_machine &machine, int step)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
state->m3_step = step;
}
/*****************************************************************************/
/* Epson RTC-72421 */
-static UINT8 rtc_get_reg(running_machine *machine, int reg)
+static UINT8 rtc_get_reg(running_machine &machine, int reg)
{
system_time systime;
- machine->current_datetime(systime);
+ machine.current_datetime(systime);
switch(reg)
{
@@ -342,7 +342,7 @@ READ32_HANDLER(rtc72421_r)
{
int reg = offset;
UINT32 data;
- data = rtc_get_reg(space->machine, reg) << 24;
+ data = rtc_get_reg(space->machine(), reg) << 24;
data |= 0x30000; /* these bits are set to pass the battery voltage test */
return data;
}
diff --git a/src/mame/machine/mw8080bw.c b/src/mame/machine/mw8080bw.c
index 99b420f0327..e0e521e7ab4 100644
--- a/src/mame/machine/mw8080bw.c
+++ b/src/mame/machine/mw8080bw.c
@@ -44,13 +44,13 @@ static int vysnc_chain_counter_to_vpos( UINT8 counter, int vblank )
static TIMER_CALLBACK( mw8080bw_interrupt_callback )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
UINT8 next_counter;
int next_vpos;
int next_vblank;
/* compute vector and set the interrupt line */
- int vpos = machine->primary_screen->vpos();
+ int vpos = machine.primary_screen->vpos();
UINT8 counter = vpos_to_vysnc_chain_counter(vpos);
UINT8 vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3);
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, vector);
@@ -68,22 +68,22 @@ static TIMER_CALLBACK( mw8080bw_interrupt_callback )
}
next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_vblank);
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
}
-static void mw8080bw_create_interrupt_timer( running_machine *machine )
+static void mw8080bw_create_interrupt_timer( running_machine &machine )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(mw8080bw_interrupt_callback));
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(mw8080bw_interrupt_callback));
}
-static void mw8080bw_start_interrupt_timer( running_machine *machine )
+static void mw8080bw_start_interrupt_timer( running_machine &machine )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
int vpos = vysnc_chain_counter_to_vpos(MW8080BW_INT_TRIGGER_COUNT_1, MW8080BW_INT_TRIGGER_VBLANK_1);
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -96,19 +96,19 @@ static void mw8080bw_start_interrupt_timer( running_machine *machine )
MACHINE_START( mw8080bw )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
mw8080bw_create_interrupt_timer(machine);
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
- state->samples1 = machine->device("samples1");
- state->samples2 = machine->device("samples2");
- state->sn = machine->device("snsnd");
- state->sn1 = machine->device("sn1");
- state->sn2 = machine->device("sn2");
- state->discrete = machine->device("discrete");
- state->mb14241 = machine->device("mb14241");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
+ state->samples1 = machine.device("samples1");
+ state->samples2 = machine.device("samples2");
+ state->sn = machine.device("snsnd");
+ state->sn1 = machine.device("sn1");
+ state->sn2 = machine.device("sn2");
+ state->discrete = machine.device("discrete");
+ state->mb14241 = machine.device("mb14241");
}
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index f38177e740f..50ab51b87e9 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -67,7 +67,7 @@ WRITE32_HANDLER( n64_mi_reg_w )
if (data & MI_SET_RDRAM) mi_mode |= MI_MODE_RDRAM;
if (data & MI_CLR_DP_INTR)
{
- clear_rcp_interrupt(space->machine, DP_INTERRUPT);
+ clear_rcp_interrupt(space->machine(), DP_INTERRUPT);
}
break;
@@ -136,7 +136,7 @@ WRITE32_HANDLER( n64_mi_reg_w )
static dmadac_sound_device *dmadac[2];
-void signal_rcp_interrupt(running_machine *machine, int interrupt)
+void signal_rcp_interrupt(running_machine &machine, int interrupt)
{
if (mi_intr_mask & interrupt)
{
@@ -146,7 +146,7 @@ void signal_rcp_interrupt(running_machine *machine, int interrupt)
}
}
-void clear_rcp_interrupt(running_machine *machine, int interrupt)
+void clear_rcp_interrupt(running_machine &machine, int interrupt)
{
mi_interrupt &= ~interrupt;
@@ -334,9 +334,9 @@ static int sp_dma_skip;
static UINT32 sp_semaphore;
static UINT32 dp_clock = 0;
-static void sp_dma(running_machine *machine, int direction)
+static void sp_dma(running_machine &machine, int direction)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, c;
if (sp_dma_length == 0)
@@ -430,7 +430,7 @@ static void sp_set_status(device_t *device, UINT32 status)
{
if (status & 0x1)
{
- //device->machine->scheduler().trigger(6789);
+ //device->machine().scheduler().trigger(6789);
device_set_input_line(device, INPUT_LINE_HALT, ASSERT_LINE);
cpu_set_reg(device, RSP_SR, cpu_get_reg(device, RSP_SR) | RSP_STATUS_HALT);
@@ -443,7 +443,7 @@ static void sp_set_status(device_t *device, UINT32 status)
if (cpu_get_reg(device, RSP_SR) & RSP_STATUS_INTR_BREAK)
{
- signal_rcp_interrupt(device->machine, SP_INTERRUPT);
+ signal_rcp_interrupt(device->machine(), SP_INTERRUPT);
}
}
}
@@ -524,14 +524,14 @@ WRITE32_DEVICE_HANDLER( n64_sp_reg_w )
sp_dma_length = data & 0xfff;
sp_dma_count = (data >> 12) & 0xff;
sp_dma_skip = (data >> 20) & 0xfff;
- sp_dma(device->machine, 0);
+ sp_dma(device->machine(), 0);
break;
case 0x0c/4: // SP_WR_LEN_REG
sp_dma_length = data & 0xfff;
sp_dma_count = (data >> 12) & 0xff;
sp_dma_skip = (data >> 20) & 0xfff;
- sp_dma(device->machine, 1);
+ sp_dma(device->machine(), 1);
break;
case 0x10/4: // RSP_STATUS_REG
@@ -571,11 +571,11 @@ WRITE32_DEVICE_HANDLER( n64_sp_reg_w )
}
if (data & 0x00000008) // clear interrupt
{
- clear_rcp_interrupt(device->machine, SP_INTERRUPT);
+ clear_rcp_interrupt(device->machine(), SP_INTERRUPT);
}
if (data & 0x00000010) // set interrupt
{
- signal_rcp_interrupt(device->machine, SP_INTERRUPT);
+ signal_rcp_interrupt(device->machine(), SP_INTERRUPT);
}
if (data & 0x00000020)
{
@@ -725,14 +725,14 @@ WRITE32_DEVICE_HANDLER( n64_sp_reg_w )
// RDP Interface
-void dp_full_sync(running_machine *machine)
+void dp_full_sync(running_machine &machine)
{
signal_rcp_interrupt(machine, DP_INTERRUPT);
}
READ32_DEVICE_HANDLER( n64_dp_reg_r )
{
- _n64_state *state = device->machine->driver_data<_n64_state>();
+ _n64_state *state = device->machine().driver_data<_n64_state>();
//printf("%08x\n", offset);
switch (offset)
@@ -759,7 +759,7 @@ READ32_DEVICE_HANDLER( n64_dp_reg_r )
WRITE32_DEVICE_HANDLER( n64_dp_reg_w )
{
- _n64_state *state = device->machine->driver_data<_n64_state>();
+ _n64_state *state = device->machine().driver_data<_n64_state>();
//printf("%08x: %08x\n", offset, data);
switch (offset)
@@ -819,9 +819,9 @@ static UINT32 n64_vi_burst, n64_vi_vsync, n64_vi_hsync, n64_vi_leap;
static UINT32 n64_vi_intr, n64_vi_vburst;
-static void n64_vi_recalculate_resolution(running_machine *machine)
+static void n64_vi_recalculate_resolution(running_machine &machine)
{
- _n64_state *state = machine->driver_data<_n64_state>();
+ _n64_state *state = machine.driver_data<_n64_state>();
int x_start = (n64_vi_hstart & 0x03ff0000) >> 16;
int x_end = n64_vi_hstart & 0x000003ff;
@@ -829,8 +829,8 @@ static void n64_vi_recalculate_resolution(running_machine *machine)
int y_end = (n64_vi_vstart & 0x000003ff) / 2;
int width = ((n64_vi_xscale & 0x00000fff) * (x_end - x_start)) / 0x400;
int height = ((n64_vi_yscale & 0x00000fff) * (y_end - y_start)) / 0x400;
- rectangle visarea = machine->primary_screen->visible_area();
- attoseconds_t period = machine->primary_screen->frame_period().attoseconds;
+ rectangle visarea = machine.primary_screen->visible_area();
+ attoseconds_t period = machine.primary_screen->frame_period().attoseconds;
if (width == 0 || height == 0)
{
@@ -862,7 +862,7 @@ static void n64_vi_recalculate_resolution(running_machine *machine)
visarea.max_x = width - 1;
visarea.max_y = height - 1;
- machine->primary_screen->configure(width, 525, visarea, period);
+ machine.primary_screen->configure(width, 525, visarea, period);
}
READ32_HANDLER( n64_vi_reg_r )
@@ -882,7 +882,7 @@ READ32_HANDLER( n64_vi_reg_r )
return n64_vi_intr;
case 0x10/4: // VI_CURRENT_REG
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
case 0x14/4: // VI_BURST_REG
return n64_vi_burst;
@@ -920,13 +920,13 @@ READ32_HANDLER( n64_vi_reg_r )
WRITE32_HANDLER( n64_vi_reg_w )
{
- _n64_state *state = space->machine->driver_data<_n64_state>();
+ _n64_state *state = space->machine().driver_data<_n64_state>();
switch (offset)
{
case 0x00/4: // VI_CONTROL_REG
n64_vi_control = data;
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
break;
case 0x04/4: // VI_ORIGIN_REG
@@ -936,7 +936,7 @@ WRITE32_HANDLER( n64_vi_reg_w )
case 0x08/4: // VI_WIDTH_REG
if (n64_vi_width != data && data > 0)
{
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
}
n64_vi_width = data;
state->m_rdp.GetMiscState()->m_fb_width = data;
@@ -947,7 +947,7 @@ WRITE32_HANDLER( n64_vi_reg_w )
break;
case 0x10/4: // VI_CURRENT_REG
- clear_rcp_interrupt(space->machine, VI_INTERRUPT);
+ clear_rcp_interrupt(space->machine(), VI_INTERRUPT);
break;
case 0x14/4: // VI_BURST_REG
@@ -968,12 +968,12 @@ WRITE32_HANDLER( n64_vi_reg_w )
case 0x24/4: // VI_H_START_REG
n64_vi_hstart = data;
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
break;
case 0x28/4: // VI_V_START_REG
n64_vi_vstart = data;
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
break;
case 0x2c/4: // VI_V_BURST_REG
@@ -982,12 +982,12 @@ WRITE32_HANDLER( n64_vi_reg_w )
case 0x30/4: // VI_X_SCALE_REG
n64_vi_xscale = data;
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
break;
case 0x34/4: // VI_Y_SCALE_REG
n64_vi_yscale = data;
- n64_vi_recalculate_resolution(space->machine);
+ n64_vi_recalculate_resolution(space->machine());
break;
/*
@@ -1016,7 +1016,7 @@ static emu_timer *audio_timer;
#define AUDIO_DMA_DEPTH 2
-static void start_audio_dma(running_machine *machine);
+static void start_audio_dma(running_machine &machine);
typedef struct
{
@@ -1029,7 +1029,7 @@ static int audio_fifo_wpos = 0;
static int audio_fifo_rpos = 0;
static int audio_fifo_num = 0;
-static void audio_fifo_push(running_machine *machine, UINT32 address, UINT32 length)
+static void audio_fifo_push(running_machine &machine, UINT32 address, UINT32 length)
{
AUDIO_DMA *current;
@@ -1064,7 +1064,7 @@ static void audio_fifo_push(running_machine *machine, UINT32 address, UINT32 len
}
}
-static void audio_fifo_pop(running_machine *machine)
+static void audio_fifo_pop(running_machine &machine)
{
audio_fifo_rpos++;
audio_fifo_num--;
@@ -1100,7 +1100,7 @@ static AUDIO_DMA *audio_fifo_get_top(void)
#define N64_ATTOTIME_NORMALIZE(a) do { while ((a).attoseconds >= ATTOSECONDS_PER_SECOND) { (a).seconds++; (a).attoseconds -= ATTOSECONDS_PER_SECOND; } } while (0)
-static void start_audio_dma(running_machine *machine)
+static void start_audio_dma(running_machine &machine)
{
INT16 *ram = (INT16*)rdram;
AUDIO_DMA *current = audio_fifo_get_top();
@@ -1117,8 +1117,8 @@ static void start_audio_dma(running_machine *machine)
// mame_printf_debug("DACDMA: %x for %x bytes\n", current->address, current->length);
- dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ dmadac[1] = machine.device<dmadac_sound_device>("dac2");
dmadac_transfer(&dmadac[0], 2, 1, 2, current->length/4, ram);
ai_status |= 0x40000000;
@@ -1156,7 +1156,7 @@ READ32_HANDLER( n64_ai_reg_r )
}
else if (ai_status & 0x40000000)
{
- double secs_left = (audio_timer->expire() - space->machine->time()).as_double();
+ double secs_left = (audio_timer->expire() - space->machine().time()).as_double();
unsigned int samples_left = secs_left * DACRATE_NTSC / (ai_dacrate + 1);
return samples_left * 4;
}
@@ -1188,7 +1188,7 @@ WRITE32_HANDLER( n64_ai_reg_w )
case 0x04/4: // AI_LEN_REG
// mame_printf_debug("ai_len = %08X at %08X\n", data, cpu_get_pc(space->cpu));
ai_len = data & 0x3ffff; // Hardware v2.0 has 18 bits, v1.0 has 15 bits
- audio_fifo_push(space->machine, ai_dram_addr, ai_len);
+ audio_fifo_push(space->machine(), ai_dram_addr, ai_len);
break;
case 0x08/4: // AI_CONTROL_REG
@@ -1197,7 +1197,7 @@ WRITE32_HANDLER( n64_ai_reg_w )
break;
case 0x0c/4:
- clear_rcp_interrupt(space->machine, AI_INTERRUPT);
+ clear_rcp_interrupt(space->machine(), AI_INTERRUPT);
break;
case 0x10/4: // AI_DACRATE_REG
@@ -1319,7 +1319,7 @@ WRITE32_HANDLER( n64_pi_reg_w )
}
}
- signal_rcp_interrupt(space->machine, PI_INTERRUPT);
+ signal_rcp_interrupt(space->machine(), PI_INTERRUPT);
break;
}
@@ -1351,7 +1351,7 @@ WRITE32_HANDLER( n64_pi_reg_w )
pi_dram_addr += 1;
}
}
- signal_rcp_interrupt(space->machine, PI_INTERRUPT);
+ signal_rcp_interrupt(space->machine(), PI_INTERRUPT);
if (pi_first_dma)
{
@@ -1368,7 +1368,7 @@ WRITE32_HANDLER( n64_pi_reg_w )
{
if (data & 0x2)
{
- clear_rcp_interrupt(space->machine, PI_INTERRUPT);
+ clear_rcp_interrupt(space->machine(), PI_INTERRUPT);
}
break;
}
@@ -1553,7 +1553,7 @@ static UINT8 calc_mempack_crc(UINT8 *buffer, int length)
return crc;
}
-static int pif_channel_handle_command(running_machine *machine, int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata)
+static int pif_channel_handle_command(running_machine &machine, int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata)
{
int i;
UINT8 command = sdata[0];
@@ -1783,7 +1783,7 @@ static int pif_channel_handle_command(running_machine *machine, int channel, int
return 0;
}
-static void handle_pif(running_machine *machine)
+static void handle_pif(running_machine &machine)
{
int j;
@@ -1875,7 +1875,7 @@ static void handle_pif(running_machine *machine)
*/
}
-static void pif_dma(running_machine *machine, int direction)
+static void pif_dma(running_machine &machine, int direction)
{
int i;
UINT32 *src, *dst;
@@ -1948,19 +1948,19 @@ WRITE32_HANDLER( n64_si_reg_w )
// PIF RAM -> RDRAM
si_pif_addr = data;
si_pif_addr_rd64b = data;
- pif_dma(space->machine, 0);
+ pif_dma(space->machine(), 0);
break;
case 0x10/4: // SI_PIF_ADDR_WR64B_REG
// RDRAM -> PIF RAM
si_pif_addr = data;
si_pif_addr_wr64b = data;
- pif_dma(space->machine, 1);
+ pif_dma(space->machine(), 1);
break;
case 0x18/4: // SI_STATUS_REG
si_status &= ~0x1000;
- clear_rcp_interrupt(space->machine, SI_INTERRUPT);
+ clear_rcp_interrupt(space->machine(), SI_INTERRUPT);
break;
default:
@@ -2008,28 +2008,28 @@ WRITE32_HANDLER( n64_pif_ram_w )
pif_ram[offset*4+3] = ( data >> 0 ) & 0x000000ff;
}
- signal_rcp_interrupt(space->machine, SI_INTERRUPT);
+ signal_rcp_interrupt(space->machine(), SI_INTERRUPT);
}
//static UINT16 crc_seed = 0x3f;
MACHINE_START( n64 )
{
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x007fffff, FALSE, rdram);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, rdram);
- rspdrc_set_options(machine->device("rsp"), RSPDRC_STRICT_VERIFY);
- rspdrc_flush_drc_cache(machine->device("rsp"));
+ rspdrc_set_options(machine.device("rsp"), RSPDRC_STRICT_VERIFY);
+ rspdrc_flush_drc_cache(machine.device("rsp"));
- audio_timer = machine->scheduler().timer_alloc(FUNC(audio_timer_callback));
+ audio_timer = machine.scheduler().timer_alloc(FUNC(audio_timer_callback));
}
MACHINE_RESET( n64 )
{
int i;
- UINT32 *cart = (UINT32*)machine->region("user2")->base();
+ UINT32 *cart = (UINT32*)machine.region("user2")->base();
UINT64 boot_checksum;
mi_version = 0;
diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c
index 3ee4a3fe327..6316ac1a4d6 100644
--- a/src/mame/machine/namco06.c
+++ b/src/mame/machine/namco06.c
@@ -136,11 +136,11 @@ READ8_DEVICE_HANDLER( namco_06xx_data_r )
UINT8 result = 0xff;
int devnum;
- LOG(("%s: 06XX '%s' read offset %d\n",device->machine->describe_context(),device->tag(),offset));
+ LOG(("%s: 06XX '%s' read offset %d\n",device->machine().describe_context(),device->tag(),offset));
if (!(state->control & 0x10))
{
- logerror("%s: 06XX '%s' read in write mode %02x\n",device->machine->describe_context(),device->tag(),state->control);
+ logerror("%s: 06XX '%s' read in write mode %02x\n",device->machine().describe_context(),device->tag(),state->control);
return 0;
}
@@ -157,11 +157,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",device->machine->describe_context(),device->tag(),offset,data));
+ LOG(("%s: 06XX '%s' write offset %d = %02x\n",device->machine().describe_context(),device->tag(),offset,data));
if (state->control & 0x10)
{
- logerror("%s: 06XX '%s' write in read mode %02x\n",device->machine->describe_context(),device->tag(),state->control);
+ logerror("%s: 06XX '%s' write in read mode %02x\n",device->machine().describe_context(),device->tag(),state->control);
return;
}
@@ -174,7 +174,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",device->machine->describe_context(),device->tag()));
+ LOG(("%s: 06XX '%s' ctrl_r\n",device->machine().describe_context(),device->tag()));
return state->control;
}
@@ -183,7 +183,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",device->machine->describe_context(),device->tag(),data));
+ LOG(("%s: 06XX '%s' control %02x\n",device->machine().describe_context(),device->tag(),data));
state->control = data;
@@ -227,17 +227,17 @@ static DEVICE_START( namco_06xx )
assert(config != NULL);
/* resolve our CPU */
- state->nmicpu = device->machine->device<cpu_device>(config->nmicpu);
+ state->nmicpu = device->machine().device<cpu_device>(config->nmicpu);
assert(state->nmicpu != NULL);
/* resolve our devices */
- state->device[0] = (config->chip0 != NULL) ? device->machine->device(config->chip0) : NULL;
+ state->device[0] = (config->chip0 != NULL) ? device->machine().device(config->chip0) : NULL;
assert(state->device[0] != NULL || config->chip0 == NULL);
- state->device[1] = (config->chip1 != NULL) ? device->machine->device(config->chip1) : NULL;
+ state->device[1] = (config->chip1 != NULL) ? device->machine().device(config->chip1) : NULL;
assert(state->device[1] != NULL || config->chip1 == NULL);
- state->device[2] = (config->chip2 != NULL) ? device->machine->device(config->chip2) : NULL;
+ state->device[2] = (config->chip2 != NULL) ? device->machine().device(config->chip2) : NULL;
assert(state->device[2] != NULL || config->chip2 == NULL);
- state->device[3] = (config->chip3 != NULL) ? device->machine->device(config->chip3) : NULL;
+ state->device[3] = (config->chip3 != NULL) ? device->machine().device(config->chip3) : NULL;
assert(state->device[3] != NULL || config->chip3 == NULL);
/* loop over devices and set their read/write handlers */
@@ -271,7 +271,7 @@ static DEVICE_START( namco_06xx )
}
/* allocate a timer */
- state->nmi_timer = device->machine->scheduler().timer_alloc(FUNC(nmi_generate), (void *)device);
+ state->nmi_timer = device->machine().scheduler().timer_alloc(FUNC(nmi_generate), (void *)device);
device->save_item(NAME(state->control));
}
diff --git a/src/mame/machine/namco50.c b/src/mame/machine/namco50.c
index 56a1bd965a3..464648b4df0 100644
--- a/src/mame/machine/namco50.c
+++ b/src/mame/machine/namco50.c
@@ -219,12 +219,12 @@ static void namco_50xx_irq_set(device_t *device)
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
- device->machine->scheduler().timer_set(attotime::from_usec(21), FUNC(namco_50xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_50xx_irq_clear), 0, (void *)device);
}
WRITE8_DEVICE_HANDLER( namco_50xx_write )
{
- device->machine->scheduler().synchronize(FUNC(namco_50xx_latch_callback), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_50xx_latch_callback), data, (void *)device);
namco_50xx_irq_set(device);
}
@@ -232,7 +232,7 @@ WRITE8_DEVICE_HANDLER( namco_50xx_write )
void namco_50xx_read_request(device_t *device)
{
- device->machine->scheduler().synchronize(FUNC(namco_50xx_readrequest_callback), 0, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_50xx_readrequest_callback), 0, (void *)device);
namco_50xx_irq_set(device);
}
diff --git a/src/mame/machine/namco51.c b/src/mame/machine/namco51.c
index bed2e66f05e..f0c556316df 100644
--- a/src/mame/machine/namco51.c
+++ b/src/mame/machine/namco51.c
@@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( namco_51xx_write )
data &= 0x07;
- LOG(("%s: custom 51XX write %02x\n",device->machine->describe_context(),data));
+ LOG(("%s: custom 51XX write %02x\n",device->machine().describe_context(),data));
if (state->coincred_mode)
{
@@ -128,9 +128,9 @@ WRITE8_DEVICE_HANDLER( namco_51xx_write )
static int namcoio_51XX_kludge = 0;
/* Only compute namcoio_51XX_kludge when gamedrv changes */
- if (namcoio_51XX_driver != &device->machine->system())
+ if (namcoio_51XX_driver != &device->machine().system())
{
- namcoio_51XX_driver = &device->machine->system();
+ namcoio_51XX_driver = &device->machine().system();
if (strcmp(namcoio_51XX_driver->name, "xevious") == 0 ||
strcmp(namcoio_51XX_driver->parent, "xevious") == 0)
namcoio_51XX_kludge = 1;
@@ -196,7 +196,7 @@ READ8_DEVICE_HANDLER( namco_51xx_read )
{
namco_51xx_state *state = get_safe_token(device);
- LOG(("%s: custom 51XX read\n",device->machine->describe_context()));
+ LOG(("%s: custom 51XX read\n",device->machine().describe_context()));
if (state->mode == 0) /* switch mode */
{
@@ -263,7 +263,7 @@ READ8_DEVICE_HANDLER( namco_51xx_read )
if (state->mode == 1)
{
- int on = (device->machine->primary_screen->frame_number() & 0x10) >> 4;
+ int on = (device->machine().primary_screen->frame_number() & 0x10) >> 4;
if (state->credits >= 2)
WRITE_PORT(state,0,0x0c | 3*on); // lamps
diff --git a/src/mame/machine/namco53.c b/src/mame/machine/namco53.c
index 878cd8c18ee..aef50ee2d42 100644
--- a/src/mame/machine/namco53.c
+++ b/src/mame/machine/namco53.c
@@ -126,7 +126,7 @@ void namco_53xx_read_request(device_t *device)
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
- device->machine->scheduler().timer_set(attotime::from_usec(21), FUNC(namco_53xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_53xx_irq_clear), 0, (void *)device);
}
READ8_DEVICE_HANDLER( namco_53xx_read )
diff --git a/src/mame/machine/namcond1.c b/src/mame/machine/namcond1.c
index f0b91977abc..bdc0cba0533 100644
--- a/src/mame/machine/namcond1.c
+++ b/src/mame/machine/namcond1.c
@@ -19,15 +19,15 @@
MACHINE_START( namcond1 )
{
- namcond1_state *state = machine->driver_data<namcond1_state>();
+ namcond1_state *state = machine.driver_data<namcond1_state>();
state_save_register_global(machine, state->h8_irq5_enabled);
}
MACHINE_RESET( namcond1 )
{
- namcond1_state *state = machine->driver_data<namcond1_state>();
+ namcond1_state *state = machine.driver_data<namcond1_state>();
#ifdef MAME_DEBUG
- /*UINT8 *ROM = machine->region(REGION_CPU1)->base();*/
+ /*UINT8 *ROM = machine.region(REGION_CPU1)->base();*/
/*UINT32 debug_trigger_addr;*/
/*int i;*/
@@ -55,7 +55,7 @@ MACHINE_RESET( namcond1 )
READ16_HANDLER( namcond1_shared_ram_r )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
return state->shared_ram[offset];
}
@@ -80,7 +80,7 @@ READ16_HANDLER( namcond1_cuskey_r )
WRITE16_HANDLER( namcond1_shared_ram_w )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
switch( offset )
{
@@ -92,14 +92,14 @@ WRITE16_HANDLER( namcond1_shared_ram_w )
WRITE16_HANDLER( namcond1_cuskey_w )
{
- namcond1_state *state = space->machine->driver_data<namcond1_state>();
+ namcond1_state *state = space->machine().driver_data<namcond1_state>();
switch( offset )
{
case (0x0a>>1):
// this is a kludge until we emulate the h8
if ((state->h8_irq5_enabled == 0) && (data != 0x0000))
{
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, CLEAR_LINE);
}
state->h8_irq5_enabled = ( data != 0x0000 );
break;
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index ea3d030ee72..766b7c9f933 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -14,7 +14,7 @@
INLINE UINT8 bank_r(address_space *space, offs_t offset, int bank)
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
return (*state->active_bank[bank].bank_handler_r )(space, offset + state->active_bank[bank].bank_offset);
}
@@ -37,7 +37,7 @@ static READ8_HANDLER( bank16_r ) { return bank_r(space, offset, 15); }
INLINE void bank_w(address_space *space, offs_t offset, UINT8 data, int bank)
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
(*state->active_bank[bank].bank_handler_w )(space, offset + state->active_bank[bank].bank_offset, data);
}
@@ -199,7 +199,7 @@ CPU #0 PC e3d4: keychip read 0003 [AND #$37 = key no.]
*/
static READ8_HANDLER( key_type1_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
if (offset < 3)
@@ -231,7 +231,7 @@ static READ8_HANDLER( key_type1_r )
static WRITE8_HANDLER( key_type1_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
if (offset < 4)
@@ -384,7 +384,7 @@ CPU #0 PC e574: keychip read 0001
static READ8_HANDLER( key_type2_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
state->key_numerator_high_word = 0;
@@ -404,7 +404,7 @@ static READ8_HANDLER( key_type2_r )
static WRITE8_HANDLER( key_type2_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
if (offset < 5)
@@ -512,7 +512,7 @@ CPU #0 PC e45a: keychip read 0030 [discarded]
static READ8_HANDLER( key_type3_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
int op;
// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
@@ -526,7 +526,7 @@ static READ8_HANDLER( key_type3_r )
op = (offset & 0x70) >> 4;
if (op == state->key_reg) return state->key_id;
- if (op == state->key_rng) return space->machine->rand();
+ if (op == state->key_rng) return space->machine().rand();
if (op == state->key_swap4) return (state->key[state->key_swap4_arg] << 4) | (state->key[state->key_swap4_arg] >> 4);
if (op == state->key_bottom4) return (offset << 4) | (state->key[state->key_swap4_arg] & 0x0f);
if (op == state->key_top4) return (offset << 4) | (state->key[state->key_swap4_arg] >> 4);
@@ -538,7 +538,7 @@ static READ8_HANDLER( key_type3_r )
static WRITE8_HANDLER( key_type3_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
state->key[(offset & 0x70) >> 4] = data;
@@ -554,10 +554,10 @@ static WRITE8_HANDLER( key_type3_w )
WRITE8_HANDLER( namcos1_sound_bankswitch_w )
{
- UINT8 *rom = space->machine->region("audiocpu")->base() + 0xc000;
+ UINT8 *rom = space->machine().region("audiocpu")->base() + 0xc000;
int bank = (data & 0x70) >> 4;
- memory_set_bankptr(space->machine, "bank17",rom + 0x4000 * bank);
+ memory_set_bankptr(space->machine(), "bank17",rom + 0x4000 * bank);
}
@@ -571,7 +571,7 @@ WRITE8_HANDLER( namcos1_sound_bankswitch_w )
WRITE8_HANDLER( namcos1_cpu_control_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
// logerror("reset control pc=%04x %02x\n",cpu_get_pc(space->cpu),data);
if ((data & 1) ^ state->reset)
{
@@ -579,21 +579,21 @@ WRITE8_HANDLER( namcos1_cpu_control_w )
state->reset = data & 1;
}
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
WRITE8_HANDLER( namcos1_watchdog_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
- if (space->cpu == space->machine->device("maincpu"))
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
+ if (space->cpu == space->machine().device("maincpu"))
state->wdog |= 1;
- else if (space->cpu == space->machine->device("sub"))
+ else if (space->cpu == space->machine().device("sub"))
state->wdog |= 2;
- else if (space->cpu == space->machine->device("audiocpu"))
+ else if (space->cpu == space->machine().device("audiocpu"))
state->wdog |= 4;
if (state->wdog == 7 || !state->reset)
@@ -607,13 +607,13 @@ WRITE8_HANDLER( namcos1_watchdog_w )
static READ8_HANDLER( soundram_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
if (offset < 0x1000)
{
offset &= 0x3ff;
/* CUS 30 */
- return namcos1_cus30_r(space->machine->device("namco"),offset);
+ return namcos1_cus30_r(space->machine().device("namco"),offset);
}
else
{
@@ -626,13 +626,13 @@ static READ8_HANDLER( soundram_r )
static WRITE8_HANDLER( soundram_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
if (offset < 0x1000)
{
offset &= 0x3ff;
/* CUS 30 */
- namcos1_cus30_w(space->machine->device("namco"),offset,data);
+ namcos1_cus30_w(space->machine().device("namco"),offset,data);
}
else
{
@@ -666,15 +666,15 @@ static WRITE8_HANDLER( unknown_w )
}
/* Main bankswitching routine */
-static void set_bank(running_machine *machine, int banknum, const bankhandler *handler)
+static void set_bank(running_machine &machine, int banknum, const bankhandler *handler)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
static const char *const banktags[] = {
"bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8",
"bank9", "bank10", "bank11", "bank12", "bank13", "bank14", "bank15", "bank16"
};
static const char *const cputags[] = { "maincpu", "sub" };
- address_space *space = machine->device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cputags[(banknum >> 3) & 1])->memory().space(AS_PROGRAM);
int bankstart = (banknum & 7) * 0x2000;
/* for BANK handlers , memory direct and OP-code base */
@@ -712,9 +712,9 @@ static void set_bank(running_machine *machine, int banknum, const bankhandler *h
state->active_bank[banknum] = *handler;
}
-static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset, UINT8 data)
+static void namcos1_bankswitch(running_machine &machine, int cpu, offs_t offset, UINT8 data)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
int bank = (cpu*8) + (( offset >> 9) & 0x07);
if (offset & 1)
@@ -733,8 +733,8 @@ static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset,
/* unmapped bank warning */
if( state->active_bank[bank].bank_handler_r == unknown_r)
{
- logerror("%s:warning unknown chip selected bank %x=$%04x\n", machine->describe_context(), bank , state->chip[bank] );
-// if (state->chip) popmessage("%s:unknown chip selected bank %x=$%04x", cpu , machine->describe_context(), bank , state->chip[bank] );
+ logerror("%s:warning unknown chip selected bank %x=$%04x\n", machine.describe_context(), bank , state->chip[bank] );
+// if (state->chip) popmessage("%s:unknown chip selected bank %x=$%04x", cpu , machine.describe_context(), bank , state->chip[bank] );
}
}
@@ -742,7 +742,7 @@ WRITE8_HANDLER( namcos1_bankswitch_w )
{
// logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag(), offset, data);
- namcos1_bankswitch(space->machine, (space->cpu == space->machine->device("maincpu")) ? 0 : 1, offset, data);
+ namcos1_bankswitch(space->machine(), (space->cpu == space->machine().device("maincpu")) ? 0 : 1, offset, data);
}
/* Sub cpu set start bank port */
@@ -751,8 +751,8 @@ WRITE8_HANDLER( namcos1_subcpu_bank_w )
// logerror("namcos1_subcpu_bank_w offset %04x data %02x\n",offset,data);
/* Prepare code for CPU 1 */
- namcos1_bankswitch( space->machine, 1, 0x0e00, 0x03 );
- namcos1_bankswitch( space->machine, 1, 0x0e01, data );
+ namcos1_bankswitch( space->machine(), 1, 0x0e00, 0x03 );
+ namcos1_bankswitch( space->machine(), 1, 0x0e01, data );
}
/*******************************************************************************
@@ -778,9 +778,9 @@ static void namcos1_install_bank(namcos1_state *state, int start,int end,read8_s
-static void namcos1_build_banks(running_machine *machine,read8_space_func key_r,write8_space_func key_w)
+static void namcos1_build_banks(running_machine &machine,read8_space_func key_r,write8_space_func key_w)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
int i;
/**** kludge alert ****/
@@ -825,7 +825,7 @@ static void namcos1_build_banks(running_machine *machine,read8_space_func key_r,
/* PRG0-PRG7 */
{
- UINT8 *rom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("user1")->base();
namcos1_install_bank(state,0x200,0x3ff,0,rom_w,0,rom);
@@ -844,7 +844,7 @@ static void namcos1_build_banks(running_machine *machine,read8_space_func key_r,
MACHINE_RESET( namcos1 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
static const bankhandler unknown_handler = { unknown_r, unknown_w, 0, NULL };
int bank;
@@ -869,7 +869,7 @@ MACHINE_RESET( namcos1 )
namcos1_bankswitch(machine, 1, 0x0e01, 0xff);
/* reset Cpu 0 and stop all other CPUs */
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, ASSERT_LINE);
@@ -918,7 +918,7 @@ WRITE8_HANDLER( namcos1_mcu_bankswitch_w )
/* bit 0-1 : address line A15-A16 */
addr += (data & 3) * 0x8000;
- memory_set_bankptr(space->machine, "bank20", space->machine->region("mcu")->base() + addr);
+ memory_set_bankptr(space->machine(), "bank20", space->machine().region("mcu")->base() + addr);
}
@@ -937,7 +937,7 @@ WRITE8_HANDLER( namcos1_mcu_bankswitch_w )
WRITE8_HANDLER( namcos1_mcu_patch_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
//logerror("mcu C000 write pc=%04x data=%02x\n",cpu_get_pc(space->cpu),data);
if (state->mcu_patch_data == 0xa6) return;
state->mcu_patch_data = data;
@@ -965,9 +965,9 @@ struct namcos1_specific
int key_reg6;
};
-static void namcos1_driver_init( running_machine *machine, const struct namcos1_specific *specific )
+static void namcos1_driver_init( running_machine &machine, const struct namcos1_specific *specific )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
static const struct namcos1_specific no_key =
{
no_key_r,no_key_w
@@ -1125,7 +1125,7 @@ DRIVER_INIT( bakutotu )
static const UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
UINT8 *rombase, *srcptr, *endptr, *scanptr;
- rombase = machine->region("user1")->base();
+ rombase = machine.region("user1")->base();
srcptr = rombase + 0x1e000;
endptr = srcptr + 0xa000;
@@ -1216,7 +1216,7 @@ DRIVER_INIT( tankfrc4 )
};
namcos1_driver_init(machine, &tankfrce_specific);
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r));
}
/*******************************************************************************
@@ -1281,9 +1281,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (input_port_read(space->machine, "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine, "PADDLE0")&0x0f);
+ ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE0")&0x0f);
else
- ret = (input_port_read(space->machine, "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine, "PADDLE1")&0x0f);
+ ret = (input_port_read(space->machine(), "CONTROL0")&0x90) | qstrobe | (input_port_read(space->machine(), "PADDLE1")&0x0f);
qstrobe ^= 0x40;
@@ -1294,9 +1294,9 @@ static READ8_HANDLER( quester_paddle_r )
int ret;
if (!qnum)
- ret = (input_port_read(space->machine, "CONTROL1")&0x90) | qnum | (input_port_read(space->machine, "PADDLE0")>>4);
+ ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE0")>>4);
else
- ret = (input_port_read(space->machine, "CONTROL1")&0x90) | qnum | (input_port_read(space->machine, "PADDLE1")>>4);
+ ret = (input_port_read(space->machine(), "CONTROL1")&0x90) | qnum | (input_port_read(space->machine(), "PADDLE1")>>4);
if (!qstrobe) qnum ^= 0x20;
@@ -1307,7 +1307,7 @@ static READ8_HANDLER( quester_paddle_r )
DRIVER_INIT( quester )
{
namcos1_driver_init(machine, NULL);
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(quester_paddle_r));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(quester_paddle_r));
}
@@ -1326,7 +1326,7 @@ static READ8_HANDLER( berabohm_buttons_r )
{
int inp = input_count;
- if (inp == 4) res = input_port_read(space->machine, "CONTROL0");
+ if (inp == 4) res = input_port_read(space->machine(), "CONTROL0");
else
{
char portname[40];
@@ -1335,7 +1335,7 @@ static READ8_HANDLER( berabohm_buttons_r )
static int counter[4];
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = input_port_read(space->machine, portname);
+ res = input_port_read(space->machine(), portname);
if (res & 0x80)
{
if (counter[inp] >= 0)
@@ -1359,7 +1359,7 @@ static READ8_HANDLER( berabohm_buttons_r )
counter[inp] = -1;
#else
sprintf(portname,"IN%d",inp); /* IN0-IN3 */
- res = input_port_read(space->machine, portname);
+ res = input_port_read(space->machine(), portname);
if (res & 1) res = 0x7f; /* weak */
else if (res & 2) res = 0x48; /* medium */
else if (res & 4) res = 0x40; /* strong */
@@ -1370,7 +1370,7 @@ static READ8_HANDLER( berabohm_buttons_r )
}
else
{
- res = input_port_read(space->machine, "CONTROL1") & 0x8f;
+ res = input_port_read(space->machine(), "CONTROL1") & 0x8f;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1396,7 +1396,7 @@ static READ8_HANDLER( berabohm_buttons_r )
DRIVER_INIT( berabohm )
{
namcos1_driver_init(machine, NULL);
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(berabohm_buttons_r));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(berabohm_buttons_r));
}
@@ -1412,13 +1412,13 @@ static READ8_HANDLER( faceoff_inputs_r )
if (offset == 0)
{
- res = (input_port_read(space->machine, "CONTROL0") & 0x80) | stored_input[0];
+ res = (input_port_read(space->machine(), "CONTROL0") & 0x80) | stored_input[0];
return res;
}
else
{
- res = input_port_read(space->machine, "CONTROL1") & 0x80;
+ res = input_port_read(space->machine(), "CONTROL1") & 0x80;
/* the strobe cannot happen too often, otherwise the MCU will waste too
much time reading the inputs and won't have enough cycles to play two
@@ -1433,17 +1433,17 @@ static READ8_HANDLER( faceoff_inputs_r )
switch (input_count)
{
case 0:
- stored_input[0] = input_port_read(space->machine, "IN0") & 0x1f;
- stored_input[1] = (input_port_read(space->machine, "IN3") & 0x07) << 3;
+ stored_input[0] = input_port_read(space->machine(), "IN0") & 0x1f;
+ stored_input[1] = (input_port_read(space->machine(), "IN3") & 0x07) << 3;
break;
case 3:
- stored_input[0] = input_port_read(space->machine, "IN2") & 0x1f;
+ stored_input[0] = input_port_read(space->machine(), "IN2") & 0x1f;
break;
case 4:
- stored_input[0] = input_port_read(space->machine, "IN1") & 0x1f;
- stored_input[1] = input_port_read(space->machine, "IN3") & 0x18;
+ stored_input[0] = input_port_read(space->machine(), "IN1") & 0x1f;
+ stored_input[1] = input_port_read(space->machine(), "IN3") & 0x18;
break;
default:
@@ -1466,5 +1466,5 @@ static READ8_HANDLER( faceoff_inputs_r )
DRIVER_INIT( faceoff )
{
namcos1_driver_init(machine, NULL);
- machine->device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r));
+ machine.device("mcu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1400, 0x1401, FUNC(faceoff_inputs_r));
}
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index f040167132a..33f90474ffe 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -20,7 +20,7 @@ static void InitC148(void);
static emu_timer *namcos2_posirq_timer;
-void (*namcos2_kickstart)(running_machine *machine, int internal);
+void (*namcos2_kickstart)(running_machine &machine, int internal);
int namcos2_gametype;
static unsigned mFinalLapProtCount;
@@ -82,7 +82,7 @@ READ16_HANDLER( namcos2_flap_prot_r )
#define namcos2_eeprom_size 0x2000
static void
-ResetAllSubCPUs( running_machine *machine, int state )
+ResetAllSubCPUs( running_machine &machine, int state )
{
cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, state);
cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, state);
@@ -107,13 +107,13 @@ MACHINE_START( namcos2 )
{
namcos2_kickstart = NULL;
namcos2_eeprom = auto_alloc_array(machine, UINT8, namcos2_eeprom_size);
- machine->device<nvram_device>("nvram")->set_base(namcos2_eeprom, namcos2_eeprom_size);
- namcos2_posirq_timer = machine->scheduler().timer_alloc(FUNC(namcos2_posirq_tick));
+ machine.device<nvram_device>("nvram")->set_base(namcos2_eeprom, namcos2_eeprom_size);
+ namcos2_posirq_timer = machine.scheduler().timer_alloc(FUNC(namcos2_posirq_tick));
}
MACHINE_RESET( namcos2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
mFinalLapProtCount = 0;
namcos2_mcu_analog_ctrl = 0;
namcos2_mcu_analog_data = 0xaa;
@@ -154,7 +154,7 @@ READ16_HANDLER( namcos2_68k_eeprom_r ){
/* 68000 Shared memory area - Data ROM area */
/*************************************************************/
READ16_HANDLER( namcos2_68k_data_rom_r ){
- UINT16 *ROM = (UINT16 *)space->machine->region("user1")->base();
+ UINT16 *ROM = (UINT16 *)space->machine().region("user1")->base();
return ROM[offset];
}
@@ -344,7 +344,7 @@ READ16_HANDLER( namcos2_68k_key_r )
// case 3: return 0x142;
case 4: return 0x142;
// case 3: popmessage("blah %08x",cpu_get_pc(space->cpu));
- default: return space->machine->rand();
+ default: return space->machine().rand();
}
break;
@@ -401,7 +401,7 @@ READ16_HANDLER( namcos2_68k_key_r )
- return space->machine->rand()&0xffff;
+ return space->machine().rand()&0xffff;
}
WRITE16_HANDLER( namcos2_68k_key_w )
@@ -474,22 +474,22 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
UINT16 *pC148RegAlt = NULL;
UINT16 result = 0;
- if (space->cpu == space->machine->device("maincpu"))
+ if (space->cpu == space->machine().device("maincpu"))
{
pC148Reg = namcos2_68k_master_C148;
- altcpu = space->machine->device("slave");
+ altcpu = space->machine().device("slave");
pC148RegAlt = namcos2_68k_slave_C148;
}
- else if (space->cpu == space->machine->device("slave"))
+ else if (space->cpu == space->machine().device("slave"))
{
pC148Reg = namcos2_68k_slave_C148;
- altcpu = space->machine->device("maincpu");
+ altcpu = space->machine().device("maincpu");
pC148RegAlt = namcos2_68k_master_C148;
}
- else if (space->cpu == space->machine->device("gpu"))
+ else if (space->cpu == space->machine().device("gpu"))
{
pC148Reg = namcos2_68k_gpu_C148;
- altcpu = space->machine->device("maincpu");
+ altcpu = space->machine().device("maincpu");
pC148RegAlt = namcos2_68k_master_C148;
}
@@ -564,42 +564,42 @@ ReadWriteC148( address_space *space, offs_t offset, UINT16 data, int bWrite )
break;
case 0x1e2000: /* Sound CPU Reset control */
- if (space->cpu == space->machine->device("maincpu")) /* ? */
+ if (space->cpu == space->machine().device("maincpu")) /* ? */
{
if (data & 0x01)
{
/* Resume execution */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
device_yield(space->cpu);
}
else
{
/* Suspend execution */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
}
if (namcos2_kickstart != NULL)
{
//printf( "dspkick=0x%x\n", data );
if (data & 0x04)
{
- (*namcos2_kickstart)(space->machine, 1);
+ (*namcos2_kickstart)(space->machine(), 1);
}
}
}
break;
case 0x1e4000: /* Alt 68000 & IO CPU Reset */
- if (space->cpu == space->machine->device("maincpu")) /* ? */
+ if (space->cpu == space->machine().device("maincpu")) /* ? */
{
if (data & 0x01)
{ /* Resume execution */
- ResetAllSubCPUs(space->machine, CLEAR_LINE);
+ ResetAllSubCPUs(space->machine(), CLEAR_LINE);
/* Give the new CPU an immediate slice of the action */
device_yield(space->cpu);
}
else
{ /* Suspend execution */
- ResetAllSubCPUs(space->machine, ASSERT_LINE);
+ ResetAllSubCPUs(space->machine(), ASSERT_LINE);
}
}
break;
@@ -645,7 +645,7 @@ READ16_HANDLER( namcos2_68k_gpu_C148_r )
}
-static int GetPosIRQScanline( running_machine *machine )
+static int GetPosIRQScanline( running_machine &machine )
{
if (IsSystem21()) return 0;
return namcos2_GetPosIrqScanline(machine);
@@ -655,44 +655,44 @@ static TIMER_CALLBACK( namcos2_posirq_tick )
{
if (IsSystem21()) {
if (namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ]) {
- machine->primary_screen->update_partial(param);
+ machine.primary_screen->update_partial(param);
cputag_set_input_line(machine, "gpu", namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
}
return;
}
if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]|namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) {
- machine->primary_screen->update_partial(param);
+ machine.primary_screen->update_partial(param);
if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) cputag_set_input_line(machine, "maincpu", namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) cputag_set_input_line(machine, "slave", namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
}
}
-void namcos2_adjust_posirq_timer( running_machine *machine, int scanline )
+void namcos2_adjust_posirq_timer( running_machine &machine, int scanline )
{
- namcos2_posirq_timer->adjust(machine->primary_screen->time_until_pos(scanline, 80), scanline);
+ namcos2_posirq_timer->adjust(machine.primary_screen->time_until_pos(scanline, 80), scanline);
}
INTERRUPT_GEN( namcos2_68k_master_vblank )
{
- if (!IsSystem21()) namcos2_adjust_posirq_timer(device->machine, GetPosIRQScanline(device->machine));
+ if (!IsSystem21()) namcos2_adjust_posirq_timer(device->machine(), GetPosIRQScanline(device->machine()));
device_set_input_line(device, namcos2_68k_master_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
}
INTERRUPT_GEN( namcos2_68k_slave_vblank )
{
- if (!IsSystem21()) namcos2_adjust_posirq_timer(device->machine, GetPosIRQScanline(device->machine));
+ if (!IsSystem21()) namcos2_adjust_posirq_timer(device->machine(), GetPosIRQScanline(device->machine()));
device_set_input_line(device, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
}
INTERRUPT_GEN( namcos2_68k_gpu_vblank )
{
/* only used by namcos21 */
- int scanline = GetPosIRQScanline(device->machine);
+ int scanline = GetPosIRQScanline(device->machine());
scanline = 0x50+0x89; /* HACK for Winning Run */
//printf( "namcos2_68k_gpu_vblank(%d)\n",namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] );
- namcos2_adjust_posirq_timer(device->machine, scanline);
+ namcos2_adjust_posirq_timer(device->machine(), scanline);
device_set_input_line(device, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
}
@@ -702,10 +702,10 @@ INTERRUPT_GEN( namcos2_68k_gpu_vblank )
WRITE8_HANDLER( namcos2_sound_bankselect_w )
{
- UINT8 *RAM=space->machine->region("audiocpu")->base();
- UINT32 max = (space->machine->region("audiocpu")->bytes() - 0x10000) / 0x4000;
+ UINT8 *RAM=space->machine().region("audiocpu")->base();
+ UINT32 max = (space->machine().region("audiocpu")->bytes() - 0x10000) / 0x4000;
int bank = ( data >> 4 ) % max; /* 991104.CAB */
- memory_set_bankptr(space->machine, BANKED_SOUND_ROM, &RAM[ 0x10000 + ( 0x4000 * bank ) ] );
+ memory_set_bankptr(space->machine(), BANKED_SOUND_ROM, &RAM[ 0x10000 + ( 0x4000 * bank ) ] );
}
/**************************************************************/
@@ -729,28 +729,28 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
switch((data>>2) & 0x07)
{
case 0:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN0");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN0");
break;
case 1:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN1");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN1");
break;
case 2:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN2");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN2");
break;
case 3:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN3");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN3");
break;
case 4:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN4");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN4");
break;
case 5:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN5");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN5");
break;
case 6:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN6");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN6");
break;
case 7:
- namcos2_mcu_analog_data=input_port_read(space->machine, "AN7");
+ namcos2_mcu_analog_data=input_port_read(space->machine(), "AN7");
break;
default:
output_set_value("anunk",data);
@@ -767,7 +767,7 @@ WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
/* If the interrupt enable bit is set trigger an A/D IRQ */
if(data & 0x20)
{
- generic_pulse_irq_line(space->machine->device("mcu"), HD63705_INT_ADCONV);
+ generic_pulse_irq_line(space->machine().device("mcu"), HD63705_INT_ADCONV);
}
}
}
@@ -808,14 +808,14 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
int data = 0;
/* Read/convert the bits one at a time */
- if(input_port_read(space->machine, "AN0") > threshold) data |= 0x01;
- if(input_port_read(space->machine, "AN1") > threshold) data |= 0x02;
- if(input_port_read(space->machine, "AN2") > threshold) data |= 0x04;
- if(input_port_read(space->machine, "AN3") > threshold) data |= 0x08;
- if(input_port_read(space->machine, "AN4") > threshold) data |= 0x10;
- if(input_port_read(space->machine, "AN5") > threshold) data |= 0x20;
- if(input_port_read(space->machine, "AN6") > threshold) data |= 0x40;
- if(input_port_read(space->machine, "AN7") > threshold) data |= 0x80;
+ if(input_port_read(space->machine(), "AN0") > threshold) data |= 0x01;
+ if(input_port_read(space->machine(), "AN1") > threshold) data |= 0x02;
+ if(input_port_read(space->machine(), "AN2") > threshold) data |= 0x04;
+ if(input_port_read(space->machine(), "AN3") > threshold) data |= 0x08;
+ if(input_port_read(space->machine(), "AN4") > threshold) data |= 0x10;
+ if(input_port_read(space->machine(), "AN5") > threshold) data |= 0x20;
+ if(input_port_read(space->machine(), "AN6") > threshold) data |= 0x40;
+ if(input_port_read(space->machine(), "AN7") > threshold) data |= 0x80;
/* Return the result */
return data;
@@ -823,18 +823,18 @@ READ8_HANDLER( namcos2_mcu_port_d_r )
READ8_HANDLER( namcos2_input_port_0_r )
{
- int data = input_port_read(space->machine, "MCUB");
+ int data = input_port_read(space->machine(), "MCUB");
return data;
}
READ8_HANDLER( namcos2_input_port_10_r )
{
- int data = input_port_read(space->machine, "MCUH");
+ int data = input_port_read(space->machine(), "MCUH");
return data;
}
READ8_HANDLER( namcos2_input_port_12_r )
{
- int data = input_port_read(space->machine, "MCUDI0");
+ int data = input_port_read(space->machine(), "MCUDI0");
return data;
}
diff --git a/src/mame/machine/naomi.c b/src/mame/machine/naomi.c
index 740374253b1..1a36a740057 100644
--- a/src/mame/machine/naomi.c
+++ b/src/mame/machine/naomi.c
@@ -63,12 +63,12 @@ static UINT8 asciihex_to_dec(UINT8 in)
}
// development helper function
-static void create_pic_from_retdat(running_machine* machine)
+static void create_pic_from_retdat(running_machine& machine)
{
{
- UINT8* hexregion = machine->region("pichex")->base();
- UINT8* retregion = machine->region("picreturn")->base();
- UINT8* newregion = machine->region("pic")->base();
+ UINT8* hexregion = machine.region("pichex")->base();
+ UINT8* retregion = machine.region("picreturn")->base();
+ UINT8* newregion = machine.region("pic")->base();
int outcount = 0;
if (hexregion && retregion && newregion)
@@ -149,7 +149,7 @@ static void create_pic_from_retdat(running_machine* machine)
{
FILE *fp;
char filename[256];
- sprintf(filename,"picbin_%s", machine->system().name);
+ sprintf(filename,"picbin_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -171,7 +171,7 @@ static void create_pic_from_retdat(running_machine* machine)
DRIVER_INIT(naomi)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_bios_idle_skip_r)); // rev e bios
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_bios_idle_skip_r)); // rev e bios
jvsboard_type = JVSBD_DEFAULT;
actel_id = 0xffff;
@@ -188,7 +188,7 @@ DRIVER_INIT(naomi2)
DRIVER_INIT(naomi_mp)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_bios_idle_skip_r)); // rev e bios
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc2ad238, 0xc2ad23f, FUNC(naomi_bios_idle_skip_r)); // rev e bios
jvsboard_type = JVSBD_MAHJONG;
actel_id = 0xffff;
@@ -205,7 +205,7 @@ static READ64_HANDLER( naomigd_ggxxsla_idle_skip_r )
DRIVER_INIT( ggxxsla )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc1aae18, 0xc1aae1f, FUNC(naomigd_ggxxsla_idle_skip_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc1aae18, 0xc1aae1f, FUNC(naomigd_ggxxsla_idle_skip_r));
DRIVER_INIT_CALL(naomi);
}
@@ -220,7 +220,7 @@ static READ64_HANDLER( naomigd_ggxx_idle_skip_r )
DRIVER_INIT( ggxx )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc1837b8, 0xc1837bf, FUNC(naomigd_ggxx_idle_skip_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc1837b8, 0xc1837bf, FUNC(naomigd_ggxx_idle_skip_r));
DRIVER_INIT_CALL(naomi);
}
@@ -236,7 +236,7 @@ static READ64_HANDLER( naomigd_ggxxrl_idle_skip_r )
DRIVER_INIT( ggxxrl )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc18d6c8, 0xc18d6cf, FUNC(naomigd_ggxxrl_idle_skip_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc18d6c8, 0xc18d6cf, FUNC(naomigd_ggxxrl_idle_skip_r));
DRIVER_INIT_CALL(naomi);
}
@@ -251,7 +251,7 @@ static READ64_HANDLER( naomigd_sfz3ugd_idle_skip_r )
DRIVER_INIT( sfz3ugd )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc5dc900, 0xc5dc907, FUNC(naomigd_sfz3ugd_idle_skip_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc5dc900, 0xc5dc907, FUNC(naomigd_sfz3ugd_idle_skip_r));
DRIVER_INIT_CALL(naomi);
}
diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c
index 45baf3326eb..3bcfb211638 100644
--- a/src/mame/machine/naomibd.c
+++ b/src/mame/machine/naomibd.c
@@ -793,7 +793,7 @@ static void init_save_state(device_t *device)
{
naomibd_state *v = get_safe_token(device);
- device->machine->state().register_postload(naomibd_postload, v);
+ device->machine().state().register_postload(naomibd_postload, v);
/* register states */
device->save_item(NAME(v->rom_offset));
@@ -945,13 +945,13 @@ READ64_DEVICE_HANDLER( naomibd_r )
{
UINT64 ret;
- ret = device->machine->device<x76f100_device>("naomibd_eeprom")->sda_r() << 15;
+ ret = device->machine().device<x76f100_device>("naomibd_eeprom")->sda_r() << 15;
return ret << 32;
}
else
{
- //mame_printf_verbose("%s:ROM: read mask %" I64FMT "x @ %x\n", machine->describe_context(), mem_mask, offset);
+ //mame_printf_verbose("%s:ROM: read mask %" I64FMT "x @ %x\n", machine.describe_context(), mem_mask, offset);
}
return U64(0xffffffffffffffff);
@@ -1098,7 +1098,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w )
v->prot_key = data;
#if NAOMIBD_PRINTF_PROTECTION
- printf("Protection: set up read @ %x, key %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->rom_offset, v->dma_offset, device->machine->describe_context());
+ printf("Protection: set up read @ %x, key %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->rom_offset, v->dma_offset, device->machine().describe_context());
#endif
// if dc_gamekey isn't -1, we can live-decrypt this one
@@ -1197,7 +1197,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w )
{
if(ACCESSING_BITS_0_15)
{
- x76f100_device *x76f100 = device->machine->device<x76f100_device>("naomibd_eeprom");
+ x76f100_device *x76f100 = device->machine().device<x76f100_device>("naomibd_eeprom");
// NAOMI_BOARDID_WRITE
x76f100->cs_w((data >> 2) & 1);
x76f100->rst_w((data >> 3) & 1);
@@ -1207,7 +1207,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w )
}
break;
default:
- mame_printf_verbose("%s: ROM: write %" I64FMT "x to %x, mask %" I64FMT "x\n", device->machine->describe_context(), data, offset, mem_mask);
+ mame_printf_verbose("%s: ROM: write %" I64FMT "x to %x, mask %" I64FMT "x\n", device->machine().describe_context(), data, offset, mem_mask);
break;
}
}
@@ -1222,7 +1222,7 @@ WRITE64_DEVICE_HANDLER( naomibd_w )
#define FILENAME_LENGTH 24
-static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
+static void load_rom_gdrom(running_machine& machine, naomibd_state *v)
{
UINT32 result;
cdrom_file *gdromfile;
@@ -1236,7 +1236,7 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
memset(name,'\0',128);
- realpic = machine->region("pic")->base();
+ realpic = machine.region("pic")->base();
if (realpic)
{
@@ -1397,7 +1397,7 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
}
}
// get des key
- realpic = machine->region("pic")->base();
+ realpic = machine.region("pic")->base();
if (realpic)
{
@@ -2014,7 +2014,6 @@ static DEVICE_START( naomibd )
/* validate some basic stuff */
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* validate configuration */
assert(config->type >= ROM_BOARD && config->type < MAX_NAOMIBD_TYPES);
@@ -2026,7 +2025,7 @@ static DEVICE_START( naomibd )
for (i=0; i<ARRAY_LENGTH(naomibd_translate_tbl); i++)
{
- if (!strcmp(device->machine->system().name, naomibd_translate_tbl[i].name))
+ if (!strcmp(device->machine().system().name, naomibd_translate_tbl[i].name))
{
v->dc_gamekey = naomibd_translate_tbl[i].m2m3_key;
v->dc_dmakey = naomibd_translate_tbl[i].m1_key;
@@ -2038,19 +2037,19 @@ static DEVICE_START( naomibd )
switch (config->type)
{
case ROM_BOARD:
- v->memory = (UINT8 *)device->machine->region(config->regiontag)->base();
+ v->memory = (UINT8 *)device->machine().region(config->regiontag)->base();
break;
case AW_ROM_BOARD:
- v->memory = (UINT8 *)device->machine->region(config->regiontag)->base();
+ v->memory = (UINT8 *)device->machine().region(config->regiontag)->base();
break;
case DIMM_BOARD:
- v->memory = (UINT8 *)auto_alloc_array_clear(device->machine, UINT8, 0x40000000); // 0x40000000 is needed for some Chihiro sets, Naomi should be less, we should pass as device param
- v->gdromchd = get_disk_handle(device->machine, config->gdromregiontag);
- v->picdata = (UINT8 *)device->machine->region(config->picregiontag)->base();
+ v->memory = (UINT8 *)auto_alloc_array_clear(device->machine(), UINT8, 0x40000000); // 0x40000000 is needed for some Chihiro sets, Naomi should be less, we should pass as device param
+ v->gdromchd = get_disk_handle(device->machine(), config->gdromregiontag);
+ v->picdata = (UINT8 *)device->machine().region(config->picregiontag)->base();
if (v->memory != NULL && v->gdromchd != NULL && v->picdata != NULL)
- load_rom_gdrom(device->machine, v);
+ load_rom_gdrom(device->machine(), v);
break;
default:
@@ -2059,7 +2058,7 @@ static DEVICE_START( naomibd )
}
/* set the type */
- v->index = device->machine->m_devicelist.indexof(device->type(), device->tag());
+ v->index = device->machine().m_devicelist.indexof(device->type(), device->tag());
v->type = config->type;
/* initialize some registers */
diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c
index 6f309e663c0..7ec3b270388 100644
--- a/src/mame/machine/nb1413m3.c
+++ b/src/mame/machine/nb1413m3.c
@@ -43,7 +43,7 @@ static int nb1413m3_outcoin_flag;
#define NB1413M3_TIMER_BASE 20000000
static TIMER_CALLBACK( nb1413m3_timer_callback )
{
- machine->scheduler().timer_set(attotime::from_hz(NB1413M3_TIMER_BASE) * 256, FUNC(nb1413m3_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(NB1413M3_TIMER_BASE) * 256, FUNC(nb1413m3_timer_callback));
nb1413m3_74ls193_counter++;
nb1413m3_74ls193_counter &= 0x0f;
@@ -140,7 +140,7 @@ MACHINE_RESET( nb1413m3 )
nb1413m3_74ls193_counter = 0;
- machine->scheduler().synchronize(FUNC(nb1413m3_timer_callback));
+ machine.scheduler().synchronize(FUNC(nb1413m3_timer_callback));
}
WRITE8_HANDLER( nb1413m3_nmi_clock_w )
@@ -315,8 +315,8 @@ READ8_HANDLER( nb1413m3_sndrom_r )
popmessage("Sound ROM %02X:%05X [B1:%02X B2:%02X]", rombank, offset, nb1413m3_sndrombank1, nb1413m3_sndrombank2);
#endif
- if (offset < space->machine->region(nb1413m3_sndromrgntag)->bytes())
- return space->machine->region(nb1413m3_sndromrgntag)->base()[offset];
+ if (offset < space->machine().region(nb1413m3_sndromrgntag)->bytes())
+ return space->machine().region(nb1413m3_sndromrgntag)->base()[offset];
else
{
popmessage("read past sound ROM length (%05x[%02X])",offset, rombank);
@@ -339,7 +339,7 @@ WRITE8_HANDLER( nb1413m3_sndrombank2_w )
READ8_HANDLER( nb1413m3_gfxrom_r )
{
- UINT8 *GFXROM = space->machine->region("gfx1")->base();
+ UINT8 *GFXROM = space->machine().region("gfx1")->base();
return GFXROM[(0x20000 * (nb1413m3_gfxrombank | ((nb1413m3_sndrombank1 & 0x02) << 3))) + ((0x0200 * nb1413m3_gfxradr_h) + (0x0002 * nb1413m3_gfxradr_l)) + (offset & 0x01)];
}
@@ -382,7 +382,7 @@ CUSTOM_INPUT( nb1413m3_outcoin_flag_r )
READ8_HANDLER( nb1413m3_inputport0_r )
{
- return ((input_port_read(space->machine, "SYSTEM") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
+ return ((input_port_read(space->machine(), "SYSTEM") & 0xfd) | ((nb1413m3_outcoin_flag & 0x01) << 1));
}
READ8_HANDLER( nb1413m3_inputport1_r )
@@ -393,44 +393,44 @@ READ8_HANDLER( nb1413m3_inputport1_r )
case NB1413M3_HYHOO2:
switch ((nb1413m3_inputport ^ 0xff) & 0x07)
{
- case 0x01: return input_port_read(space->machine, "IN0");
- case 0x02: return input_port_read(space->machine, "IN1");
+ case 0x01: return input_port_read(space->machine(), "IN0");
+ case 0x02: return input_port_read(space->machine(), "IN1");
case 0x04: return 0xff;
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (input_port_read(space->machine, "DSWA") & 0x80)
+ if (input_port_read(space->machine(), "DSWA") & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine, "KEY0");
- case 0x02: return input_port_read(space->machine, "KEY1");
- case 0x04: return input_port_read(space->machine, "KEY2");
- case 0x08: return input_port_read(space->machine, "KEY3");
- case 0x10: return input_port_read(space->machine, "KEY4");
- default: return (input_port_read(space->machine, "KEY0") & input_port_read(space->machine, "KEY1") & input_port_read(space->machine, "KEY2")
- & input_port_read(space->machine, "KEY3") & input_port_read(space->machine, "KEY4"));
+ case 0x01: return input_port_read(space->machine(), "KEY0");
+ case 0x02: return input_port_read(space->machine(), "KEY1");
+ case 0x04: return input_port_read(space->machine(), "KEY2");
+ case 0x08: return input_port_read(space->machine(), "KEY3");
+ case 0x10: return input_port_read(space->machine(), "KEY4");
+ default: return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
+ & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
}
}
- else return input_port_read(space->machine, "JAMMA2");
+ else return input_port_read(space->machine(), "JAMMA2");
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
case NB1413M3_OHPAIPEE:
case NB1413M3_TOGENKYO:
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine, "KEY0");
- case 0x02: return input_port_read(space->machine, "KEY1");
- case 0x04: return input_port_read(space->machine, "KEY2");
- case 0x08: return input_port_read(space->machine, "KEY3");
- case 0x10: return input_port_read(space->machine, "KEY4");
- default: return (input_port_read(space->machine, "KEY0") & input_port_read(space->machine, "KEY1") & input_port_read(space->machine, "KEY2")
- & input_port_read(space->machine, "KEY3") & input_port_read(space->machine, "KEY4"));
+ case 0x01: return input_port_read(space->machine(), "KEY0");
+ case 0x02: return input_port_read(space->machine(), "KEY1");
+ case 0x04: return input_port_read(space->machine(), "KEY2");
+ case 0x08: return input_port_read(space->machine(), "KEY3");
+ case 0x10: return input_port_read(space->machine(), "KEY4");
+ default: return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") & input_port_read(space->machine(), "KEY2")
+ & input_port_read(space->machine(), "KEY3") & input_port_read(space->machine(), "KEY4"));
}
break;
}
@@ -446,42 +446,42 @@ READ8_HANDLER( nb1413m3_inputport2_r )
{
case 0x01: return 0xff;
case 0x02: return 0xff;
- case 0x04: return input_port_read(space->machine, "IN2");
+ case 0x04: return input_port_read(space->machine(), "IN2");
default: return 0xff;
}
break;
case NB1413M3_MSJIKEN:
case NB1413M3_TELMAHJN:
- if (input_port_read(space->machine, "DSWA") & 0x80)
+ if (input_port_read(space->machine(), "DSWA") & 0x80)
{
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine, "KEY5");
- case 0x02: return input_port_read(space->machine, "KEY6");
- case 0x04: return input_port_read(space->machine, "KEY7");
- case 0x08: return input_port_read(space->machine, "KEY8");
- case 0x10: return input_port_read(space->machine, "KEY9");
- default: return (input_port_read(space->machine, "KEY5") & input_port_read(space->machine, "KEY6") & input_port_read(space->machine, "KEY7")
- & input_port_read(space->machine, "KEY8") & input_port_read(space->machine, "KEY9"));
+ case 0x01: return input_port_read(space->machine(), "KEY5");
+ case 0x02: return input_port_read(space->machine(), "KEY6");
+ case 0x04: return input_port_read(space->machine(), "KEY7");
+ case 0x08: return input_port_read(space->machine(), "KEY8");
+ case 0x10: return input_port_read(space->machine(), "KEY9");
+ default: return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
+ & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
}
}
- else return input_port_read(space->machine, "JAMMA1");
+ else return input_port_read(space->machine(), "JAMMA1");
break;
case NB1413M3_PAIRSNB:
case NB1413M3_PAIRSTEN:
case NB1413M3_OHPAIPEE:
case NB1413M3_TOGENKYO:
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
default:
switch ((nb1413m3_inputport ^ 0xff) & 0x1f)
{
- case 0x01: return input_port_read(space->machine, "KEY5");
- case 0x02: return input_port_read(space->machine, "KEY6");
- case 0x04: return input_port_read(space->machine, "KEY7");
- case 0x08: return input_port_read(space->machine, "KEY8");
- case 0x10: return input_port_read(space->machine, "KEY9");
- default: return (input_port_read(space->machine, "KEY5") & input_port_read(space->machine, "KEY6") & input_port_read(space->machine, "KEY7")
- & input_port_read(space->machine, "KEY8") & input_port_read(space->machine, "KEY9"));
+ case 0x01: return input_port_read(space->machine(), "KEY5");
+ case 0x02: return input_port_read(space->machine(), "KEY6");
+ case 0x04: return input_port_read(space->machine(), "KEY7");
+ case 0x08: return input_port_read(space->machine(), "KEY8");
+ case 0x10: return input_port_read(space->machine(), "KEY9");
+ default: return (input_port_read(space->machine(), "KEY5") & input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7")
+ & input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
}
break;
}
@@ -516,14 +516,14 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return input_port_read(space->machine, "DSWB");
+ return input_port_read(space->machine(), "DSWB");
case NB1413M3_TAIWANMB:
- return ((input_port_read(space->machine, "DSWA") & 0xf0) | ((input_port_read(space->machine, "DSWB") & 0xf0) >> 4));
+ return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return (((input_port_read(space->machine, "DSWA") & 0x0f) << 4) | (input_port_read(space->machine, "DSWB") & 0x0f));
+ return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
case NB1413M3_MJFOCUSM:
@@ -534,7 +534,7 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return ((input_port_read(space->machine, "DSWA") & 0x0f) | ((input_port_read(space->machine, "DSWB") & 0x0f) << 4));
+ return ((input_port_read(space->machine(), "DSWA") & 0x0f) | ((input_port_read(space->machine(), "DSWB") & 0x0f) << 4));
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
case NB1413M3_PSTADIUM:
@@ -544,12 +544,12 @@ READ8_HANDLER( nb1413m3_dipsw1_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((input_port_read(space->machine, "DSWB") & 0x01) >> 0) | ((input_port_read(space->machine, "DSWB") & 0x04) >> 1) |
- ((input_port_read(space->machine, "DSWB") & 0x10) >> 2) | ((input_port_read(space->machine, "DSWB") & 0x40) >> 3) |
- ((input_port_read(space->machine, "DSWA") & 0x01) << 4) | ((input_port_read(space->machine, "DSWA") & 0x04) << 3) |
- ((input_port_read(space->machine, "DSWA") & 0x10) << 2) | ((input_port_read(space->machine, "DSWA") & 0x40) << 1));
+ return (((input_port_read(space->machine(), "DSWB") & 0x01) >> 0) | ((input_port_read(space->machine(), "DSWB") & 0x04) >> 1) |
+ ((input_port_read(space->machine(), "DSWB") & 0x10) >> 2) | ((input_port_read(space->machine(), "DSWB") & 0x40) >> 3) |
+ ((input_port_read(space->machine(), "DSWA") & 0x01) << 4) | ((input_port_read(space->machine(), "DSWA") & 0x04) << 3) |
+ ((input_port_read(space->machine(), "DSWA") & 0x10) << 2) | ((input_port_read(space->machine(), "DSWA") & 0x40) << 1));
default:
- return input_port_read(space->machine, "DSWA");
+ return input_port_read(space->machine(), "DSWA");
}
}
@@ -559,14 +559,14 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
{
case NB1413M3_KANATUEN:
case NB1413M3_KYUHITO:
- return input_port_read(space->machine, "DSWA");
+ return input_port_read(space->machine(), "DSWA");
case NB1413M3_TAIWANMB:
- return (((input_port_read(space->machine, "DSWA") & 0x0f) << 4) | (input_port_read(space->machine, "DSWB") & 0x0f));
+ return (((input_port_read(space->machine(), "DSWA") & 0x0f) << 4) | (input_port_read(space->machine(), "DSWB") & 0x0f));
case NB1413M3_OTONANO:
case NB1413M3_MJCAMERA:
case NB1413M3_IDHIMITU:
case NB1413M3_KAGUYA2:
- return ((input_port_read(space->machine, "DSWA") & 0xf0) | ((input_port_read(space->machine, "DSWB") & 0xf0) >> 4));
+ return ((input_port_read(space->machine(), "DSWA") & 0xf0) | ((input_port_read(space->machine(), "DSWB") & 0xf0) >> 4));
case NB1413M3_SCANDAL:
case NB1413M3_SCANDALM:
case NB1413M3_MJFOCUSM:
@@ -577,7 +577,7 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_UCHUUAI:
case NB1413M3_TOKIMBSJ:
case NB1413M3_TOKYOGAL:
- return (((input_port_read(space->machine, "DSWA") & 0xf0) >> 4) | (input_port_read(space->machine, "DSWB") & 0xf0));
+ return (((input_port_read(space->machine(), "DSWA") & 0xf0) >> 4) | (input_port_read(space->machine(), "DSWB") & 0xf0));
case NB1413M3_TRIPLEW1:
case NB1413M3_NTOPSTAR:
case NB1413M3_PSTADIUM:
@@ -587,23 +587,23 @@ READ8_HANDLER( nb1413m3_dipsw2_r )
case NB1413M3_MJLSTORY:
case NB1413M3_QMHAYAKU:
case NB1413M3_MJGOTTUB:
- return (((input_port_read(space->machine, "DSWB") & 0x02) >> 1) | ((input_port_read(space->machine, "DSWB") & 0x08) >> 2) |
- ((input_port_read(space->machine, "DSWB") & 0x20) >> 3) | ((input_port_read(space->machine, "DSWB") & 0x80) >> 4) |
- ((input_port_read(space->machine, "DSWA") & 0x02) << 3) | ((input_port_read(space->machine, "DSWA") & 0x08) << 2) |
- ((input_port_read(space->machine, "DSWA") & 0x20) << 1) | ((input_port_read(space->machine, "DSWA") & 0x80) << 0));
+ return (((input_port_read(space->machine(), "DSWB") & 0x02) >> 1) | ((input_port_read(space->machine(), "DSWB") & 0x08) >> 2) |
+ ((input_port_read(space->machine(), "DSWB") & 0x20) >> 3) | ((input_port_read(space->machine(), "DSWB") & 0x80) >> 4) |
+ ((input_port_read(space->machine(), "DSWA") & 0x02) << 3) | ((input_port_read(space->machine(), "DSWA") & 0x08) << 2) |
+ ((input_port_read(space->machine(), "DSWA") & 0x20) << 1) | ((input_port_read(space->machine(), "DSWA") & 0x80) << 0));
default:
- return input_port_read(space->machine, "DSWB");
+ return input_port_read(space->machine(), "DSWB");
}
}
READ8_HANDLER( nb1413m3_dipsw3_l_r )
{
- return ((input_port_read(space->machine, "DSWC") & 0xf0) >> 4);
+ return ((input_port_read(space->machine(), "DSWC") & 0xf0) >> 4);
}
READ8_HANDLER( nb1413m3_dipsw3_h_r )
{
- return ((input_port_read(space->machine, "DSWC") & 0x0f) >> 0);
+ return ((input_port_read(space->machine(), "DSWC") & 0x0f) >> 0);
}
WRITE8_HANDLER( nb1413m3_outcoin_w )
@@ -644,7 +644,7 @@ WRITE8_HANDLER( nb1413m3_outcoin_w )
break;
}
- set_led_status(space->machine, 2, nb1413m3_outcoin_flag); // out coin
+ set_led_status(space->machine(), 2, nb1413m3_outcoin_flag); // out coin
}
WRITE8_HANDLER( nb1413m3_vcrctrl_w )
@@ -652,11 +652,11 @@ WRITE8_HANDLER( nb1413m3_vcrctrl_w )
if (data & 0x08)
{
popmessage(" ** VCR CONTROL ** ");
- set_led_status(space->machine, 2, 1);
+ set_led_status(space->machine(), 2, 1);
}
else
{
- set_led_status(space->machine, 2, 0);
+ set_led_status(space->machine(), 2, 0);
}
}
diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c
index 5a81580dd53..dcd4e41c0fc 100644
--- a/src/mame/machine/neoboot.c
+++ b/src/mame/machine/neoboot.c
@@ -19,11 +19,11 @@
/* General Bootleg Functions - used by more than 1 game */
-void neogeo_bootleg_cx_decrypt( running_machine *machine )
+void neogeo_bootleg_cx_decrypt( running_machine &machine )
{
int i;
- int cx_size = machine->region( "sprites" )->bytes();
- UINT8 *rom = machine->region( "sprites" )->base();
+ int cx_size = machine.region( "sprites" )->bytes();
+ UINT8 *rom = machine.region( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, cx_size );
memcpy( buf, rom, cx_size );
@@ -36,10 +36,10 @@ void neogeo_bootleg_cx_decrypt( running_machine *machine )
}
-void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
+void neogeo_bootleg_sx_decrypt( running_machine &machine, int value )
{
- int sx_size = machine->region( "fixed" )->bytes();
- UINT8 *rom = machine->region( "fixed" )->base();
+ int sx_size = machine.region( "fixed" )->bytes();
+ UINT8 *rom = machine.region( "fixed" )->base();
int i;
if (value == 1)
@@ -68,12 +68,12 @@ void neogeo_bootleg_sx_decrypt( running_machine *machine, int value )
/* The protection patching here may be incomplete
Thanks to Razoola for the info */
-void kog_px_decrypt( running_machine *machine )
+void kog_px_decrypt( running_machine &machine )
{
/* the protection chip does some *very* strange things to the rom */
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000 );
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
int i;
static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD };
@@ -155,10 +155,10 @@ static READ16_HANDLER( kof10th_RAMB_r )
static WRITE16_HANDLER( kof10th_custom_w )
{
if (!kof10thExtraRAMB[0xFFE]) { // Write to RAM bank A
- UINT16 *prom = (UINT16*)space->machine->region( "maincpu" )->base();
+ UINT16 *prom = (UINT16*)space->machine().region( "maincpu" )->base();
COMBINE_DATA(&prom[(0xE0000/2) + (offset & 0xFFFF)]);
} else { // Write S data on-the-fly
- UINT8 *srom = space->machine->region( "fixed" )->base();
+ UINT8 *srom = space->machine().region( "fixed" )->base();
srom[offset] = BITSWAP8(data,7,6,0,4,3,2,1,5);
}
}
@@ -169,25 +169,25 @@ static WRITE16_HANDLER( kof10th_bankswitch_w )
if (offset == 0x5FFF8) { // Standard bankswitch
kof10thBankswitch(space, data);
} else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch
- UINT8 *src = space->machine->region( "maincpu" )->base();
+ UINT8 *src = space->machine().region( "maincpu" )->base();
memcpy (src + 0x10000, src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
}
COMBINE_DATA(&kof10thExtraRAMB[offset & 0xFFF]);
}
}
-void install_kof10th_protection ( running_machine *machine )
+void install_kof10th_protection ( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe000, 0x2fffff, FUNC(kof10th_RAMB_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200000, 0x23ffff, FUNC(kof10th_custom_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x240000, 0x2fffff, FUNC(kof10th_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe000, 0x2fffff, FUNC(kof10th_RAMB_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200000, 0x23ffff, FUNC(kof10th_custom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x240000, 0x2fffff, FUNC(kof10th_bankswitch_w));
}
-void decrypt_kof10th(running_machine *machine)
+void decrypt_kof10th(running_machine &machine)
{
int i, j;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x900000);
- UINT8 *src = machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
memcpy(dst + 0x000000, src + 0x700000, 0x100000); // Correct (Verified in Uni-bios)
memcpy(dst + 0x100000, src + 0x000000, 0x800000);
@@ -212,13 +212,13 @@ void decrypt_kof10th(running_machine *machine)
/* The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg) */
-void decrypt_kf10thep(running_machine *machine)
+void decrypt_kf10thep(running_machine &machine)
{
int i;
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
- UINT8 *src = machine->region("maincpu")->base();
- UINT16 *buf = (UINT16*)machine->region("audiocrypt")->base();
- UINT8 *srom = (UINT8*)machine->region("fixed")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
+ UINT16 *buf = (UINT16*)machine.region("audiocrypt")->base();
+ UINT8 *srom = (UINT8*)machine.region("fixed")->base();
UINT8 *sbuf = auto_alloc_array(machine, UINT8, 0x20000);
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x200000);
@@ -253,10 +253,10 @@ void decrypt_kf10thep(running_machine *machine)
/* The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg) */
-static void kf2k5uni_px_decrypt( running_machine *machine )
+static void kf2k5uni_px_decrypt( running_machine &machine )
{
int i, j, ofst;
- UINT8 *src = machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x80);
for (i = 0; i < 0x800000; i+=0x80)
@@ -273,25 +273,25 @@ static void kf2k5uni_px_decrypt( running_machine *machine )
memcpy(src, src + 0x600000, 0x100000); // Seems to be the same as kof10th
}
-static void kf2k5uni_sx_decrypt( running_machine *machine )
+static void kf2k5uni_sx_decrypt( running_machine &machine )
{
int i;
- UINT8 *srom = machine->region( "fixed" )->base();
+ UINT8 *srom = machine.region( "fixed" )->base();
for (i = 0; i < 0x20000; i++)
srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3);
}
-static void kf2k5uni_mx_decrypt( running_machine *machine )
+static void kf2k5uni_mx_decrypt( running_machine &machine )
{
int i;
- UINT8 *mrom = machine->region( "audiocpu" )->base();
+ UINT8 *mrom = machine.region( "audiocpu" )->base();
for (i = 0; i < 0x30000; i++)
mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3);
}
-void decrypt_kf2k5uni( running_machine *machine )
+void decrypt_kf2k5uni( running_machine &machine )
{
kf2k5uni_px_decrypt(machine);
kf2k5uni_sx_decrypt(machine);
@@ -303,7 +303,7 @@ void decrypt_kf2k5uni( running_machine *machine )
// Thanks to IQ_132 for the info
-void kof2002b_gfx_decrypt(running_machine *machine, UINT8 *src, int size)
+void kof2002b_gfx_decrypt(running_machine &machine, UINT8 *src, int size)
{
int i, j;
int t[ 8 ][ 10 ] =
@@ -339,11 +339,11 @@ void kof2002b_gfx_decrypt(running_machine *machine, UINT8 *src, int size)
/* The King of Fighters 2002 Magic Plus (bootleg) */
-void kf2k2mp_decrypt( running_machine *machine )
+void kf2k2mp_decrypt( running_machine &machine )
{
int i,j;
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x80);
memmove(src, src + 0x300000, 0x500000);
@@ -364,9 +364,9 @@ void kf2k2mp_decrypt( running_machine *machine )
/* The King of Fighters 2002 Magic Plus II (bootleg) */
-void kf2k2mp2_px_decrypt( running_machine *machine )
+void kf2k2mp2_px_decrypt( running_machine &machine )
{
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000);
memcpy (dst + 0x000000, src + 0x1C0000, 0x040000);
@@ -382,13 +382,13 @@ void kf2k2mp2_px_decrypt( running_machine *machine )
/* descrambling information from razoola */
-static void cthd2003_neogeo_gfx_address_fix_do(running_machine *machine, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift)
+static void cthd2003_neogeo_gfx_address_fix_do(running_machine &machine, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift)
{
int i,j;
int tilesize=128;
UINT8* rom = auto_alloc_array(machine, UINT8, 16*tilesize); // 16 tiles buffer
- UINT8* realrom = machine->region("sprites")->base() + start*tilesize;
+ UINT8* realrom = machine.region("sprites")->base() + start*tilesize;
for (i = 0; i < (end-start)/16; i++) {
for (j = 0; j < 16; j++) {
@@ -405,7 +405,7 @@ static void cthd2003_neogeo_gfx_address_fix_do(running_machine *machine, int sta
auto_free(machine, rom);
}
-static void cthd2003_neogeo_gfx_address_fix(running_machine *machine, int start, int end)
+static void cthd2003_neogeo_gfx_address_fix(running_machine &machine, int start, int end)
{
cthd2003_neogeo_gfx_address_fix_do(machine, start+512*0, end+512*0, 0,3,2,1);
cthd2003_neogeo_gfx_address_fix_do(machine, start+512*1, end+512*1, 1,0,3,2);
@@ -416,7 +416,7 @@ static void cthd2003_neogeo_gfx_address_fix(running_machine *machine, int start,
cthd2003_neogeo_gfx_address_fix_do(machine, start+512*7, end+512*7, 0,2,3,1);
}
-static void cthd2003_c(running_machine *machine, int pow)
+static void cthd2003_c(running_machine &machine, int pow)
{
int i;
@@ -439,9 +439,9 @@ static void cthd2003_c(running_machine *machine, int pow)
cthd2003_neogeo_gfx_address_fix(machine, i*512,i*512+512);
}
-void decrypt_cthd2003( running_machine *machine )
+void decrypt_cthd2003( running_machine &machine )
{
- UINT8 *romdata = machine->region("fixed")->base();
+ UINT8 *romdata = machine.region("fixed")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
@@ -450,7 +450,7 @@ void decrypt_cthd2003( running_machine *machine )
memcpy(tmp+8*96*128, romdata+8*96*128, 8*32*128);
memcpy(romdata, tmp, 8*128*128);
- romdata = machine->region("audiocpu")->base()+0x10000;
+ romdata = machine.region("audiocpu")->base()+0x10000;
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
memcpy(tmp+8*64*128, romdata+8*32*128, 8*32*128);
@@ -478,14 +478,14 @@ static WRITE16_HANDLER ( cthd2003_bankswitch_w )
}
}
-void patch_cthd2003( running_machine *machine )
+void patch_cthd2003( running_machine &machine )
{
/* patches thanks to razoola */
int i;
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
/* special ROM banking handler */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2fffff, FUNC(cthd2003_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2fffff, FUNC(cthd2003_bankswitch_w));
// theres still a problem on the character select screen but it seems to be related to cpu core timing issues,
// overclocking the 68k prevents it.
@@ -523,10 +523,10 @@ void patch_cthd2003( running_machine *machine )
/* Crouching Tiger Hidden Dragon 2003 Super Plus (bootleg of King of Fighters 2001) */
-static void ct2k3sp_sx_decrypt( running_machine *machine )
+static void ct2k3sp_sx_decrypt( running_machine &machine )
{
- int rom_size = machine->region( "fixed" )->bytes();
- UINT8 *rom = machine->region( "fixed" )->base();
+ int rom_size = machine.region( "fixed" )->bytes();
+ UINT8 *rom = machine.region( "fixed" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
int i;
int ofst;
@@ -553,9 +553,9 @@ static void ct2k3sp_sx_decrypt( running_machine *machine )
auto_free( machine, buf );
}
-void decrypt_ct2k3sp( running_machine *machine )
+void decrypt_ct2k3sp( running_machine &machine )
{
- UINT8 *romdata = machine->region("audiocpu")->base()+0x10000;
+ UINT8 *romdata = machine.region("audiocpu")->base()+0x10000;
UINT8*tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -573,9 +573,9 @@ void decrypt_ct2k3sp( running_machine *machine )
/* Crouching Tiger Hidden Dragon 2003 Super Plus alternate (bootleg of King of Fighters 2001) */
-void decrypt_ct2k3sa( running_machine *machine )
+void decrypt_ct2k3sa( running_machine &machine )
{
- UINT8 *romdata = machine->region("audiocpu")->base()+0x10000;
+ UINT8 *romdata = machine.region("audiocpu")->base()+0x10000;
UINT8*tmp = auto_alloc_array(machine, UINT8, 8*128*128);
memcpy(tmp+8*0*128, romdata+8*0*128, 8*32*128);
memcpy(tmp+8*32*128, romdata+8*64*128, 8*32*128);
@@ -588,11 +588,11 @@ void decrypt_ct2k3sa( running_machine *machine )
cthd2003_c(machine, 0);
}
-void patch_ct2k3sa( running_machine *machine )
+void patch_ct2k3sa( running_machine &machine )
{
/* patches thanks to razoola - same as for cthd2003*/
int i;
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
// theres still a problem on the character select screen but it seems to be related to cpu core timing issues,
// overclocking the 68k prevents it.
@@ -631,9 +631,9 @@ void patch_ct2k3sa( running_machine *machine )
/* King of Fighters Special Edition 2004 (bootleg of King of Fighters 2002) */
-void decrypt_kof2k4se_68k( running_machine *machine )
+void decrypt_kof2k4se_68k( running_machine &machine )
{
- UINT8 *src = machine->region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.region("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
int i;
static const int sec[] = {0x300000,0x200000,0x100000,0x000000};
@@ -650,20 +650,20 @@ void decrypt_kof2k4se_68k( running_machine *machine )
/* Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg) */
-void lans2004_vx_decrypt( running_machine *machine )
+void lans2004_vx_decrypt( running_machine &machine )
{
int i;
- UINT8 *rom = machine->region( "ymsnd" )->base();
+ UINT8 *rom = machine.region( "ymsnd" )->base();
for (i = 0; i < 0xA00000; i++)
rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7);
}
-void lans2004_decrypt_68k( running_machine *machine )
+void lans2004_decrypt_68k( running_machine &machine )
{
/* Descrambling P ROMs - Thanks to Razoola for the info */
int i;
- UINT8 *src = machine->region( "maincpu" )->base();
- UINT16 *rom = (UINT16*)machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
+ UINT16 *rom = (UINT16*)machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x600000);
{
@@ -726,24 +726,24 @@ static WRITE16_HANDLER ( ms5plus_bankswitch_w )
}
}
-void install_ms5plus_protection(running_machine *machine)
+void install_ms5plus_protection(running_machine &machine)
{
// special ROM banking handler / additional protection
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2ffff0, 0x2fffff,FUNC(mslug5_prot_r), FUNC(ms5plus_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2ffff0, 0x2fffff,FUNC(mslug5_prot_r), FUNC(ms5plus_bankswitch_w));
}
/* SNK vs. CAPCOM SVC CHAOS (bootleg) */
-void svcboot_px_decrypt( running_machine *machine )
+void svcboot_px_decrypt( running_machine &machine )
{
static const UINT8 sec[] = {
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
int i;
- int size = machine->region( "maincpu" )->bytes();
- UINT8 *src = machine->region( "maincpu" )->base();
+ int size = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int ofst;
for( i = 0; i < size / 0x100000; i++ ){
@@ -757,7 +757,7 @@ void svcboot_px_decrypt( running_machine *machine )
auto_free( machine, dst );
}
-void svcboot_cx_decrypt( running_machine *machine )
+void svcboot_cx_decrypt( running_machine &machine )
{
static const UINT8 idx_tbl[ 0x10 ] = {
0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5,
@@ -771,8 +771,8 @@ void svcboot_cx_decrypt( running_machine *machine )
{ 3, 0, 2, 1 },
};
int i;
- int size = machine->region( "sprites" )->bytes();
- UINT8 *src = machine->region( "sprites" )->base();
+ int size = machine.region( "sprites" )->bytes();
+ UINT8 *src = machine.region( "sprites" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int ofst;
memcpy( dst, src, size );
@@ -793,13 +793,13 @@ void svcboot_cx_decrypt( running_machine *machine )
/* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1) */
-void svcplus_px_decrypt( running_machine *machine )
+void svcplus_px_decrypt( running_machine &machine )
{
static const int sec[] = {
0x00, 0x03, 0x02, 0x05, 0x04, 0x01
};
- int size = machine->region( "maincpu" )->bytes();
- UINT8 *src = machine->region( "maincpu" )->base();
+ int size = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int i;
int ofst;
@@ -819,10 +819,10 @@ void svcplus_px_decrypt( running_machine *machine )
auto_free( machine, dst );
}
-void svcplus_px_hack( running_machine *machine )
+void svcplus_px_hack( running_machine &machine )
{
/* patched by the protection chip? */
- UINT8 *src = machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
src[ 0x0f8010 ] = 0x40;
src[ 0x0f8011 ] = 0x04;
src[ 0x0f8012 ] = 0x00;
@@ -837,14 +837,14 @@ void svcplus_px_hack( running_machine *machine )
/* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2) */
-void svcplusa_px_decrypt( running_machine *machine )
+void svcplusa_px_decrypt( running_machine &machine )
{
int i;
static const int sec[] = {
0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = machine->region( "maincpu" )->bytes();
- UINT8 *src = machine->region( "maincpu" )->base();
+ int size = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
memcpy( dst, src, size );
for( i = 0; i < 6; i++ ){
@@ -857,13 +857,13 @@ void svcplusa_px_decrypt( running_machine *machine )
/* SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg) */
-void svcsplus_px_decrypt( running_machine *machine )
+void svcsplus_px_decrypt( running_machine &machine )
{
static const int sec[] = {
0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};
- int size = machine->region( "maincpu" )->bytes();
- UINT8 *src = machine->region( "maincpu" )->base();
+ int size = machine.region( "maincpu" )->bytes();
+ UINT8 *src = machine.region( "maincpu" )->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, size );
int i;
int ofst;
@@ -879,10 +879,10 @@ void svcsplus_px_decrypt( running_machine *machine )
auto_free( machine, dst );
}
-void svcsplus_px_hack( running_machine *machine )
+void svcsplus_px_hack( running_machine &machine )
{
/* patched by the protection chip? */
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
mem16[0x9e90/2] = 0x000f;
mem16[0x9e92/2] = 0xc9c0;
mem16[0xa10c/2] = 0x4eb9;
@@ -924,7 +924,7 @@ static WRITE16_HANDLER( kof2003_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine->region("maincpu")->base();
+ UINT8* mem = (UINT8 *)space->machine().region("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] = 0xa0;
cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
@@ -942,7 +942,7 @@ static WRITE16_HANDLER( kof2003p_w )
UINT8* cr = (UINT8 *)kof2003_tbl;
UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)];
UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)];
- UINT8* mem = (UINT8 *)space->machine->region("maincpu")->base();
+ UINT8* mem = (UINT8 *)space->machine().region("maincpu")->base();
cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
@@ -952,7 +952,7 @@ static WRITE16_HANDLER( kof2003p_w )
}
}
-void kf2k3bl_px_decrypt( running_machine *machine )
+void kf2k3bl_px_decrypt( running_machine &machine )
{
int i;
static const UINT8 sec[] = {
@@ -960,7 +960,7 @@ void kf2k3bl_px_decrypt( running_machine *machine )
};
int rom_size = 0x800000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
memcpy( buf, rom, rom_size );
@@ -970,19 +970,19 @@ void kf2k3bl_px_decrypt( running_machine *machine )
auto_free( machine, buf );
}
-void kf2k3bl_install_protection(running_machine *machine)
+void kf2k3bl_install_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) );
}
/* The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg) */
-void kf2k3pl_px_decrypt( running_machine *machine )
+void kf2k3pl_px_decrypt( running_machine &machine )
{
UINT16*tmp = auto_alloc_array(machine, UINT16, 0x100000/2);
- UINT16*rom = (UINT16*)machine->region( "maincpu" )->base();
+ UINT16*rom = (UINT16*)machine.region( "maincpu" )->base();
int j;
int i;
@@ -998,19 +998,19 @@ void kf2k3pl_px_decrypt( running_machine *machine )
rom[0xf38ac/2] = 0x4e75;
}
-void kf2k3pl_install_protection(running_machine *machine)
+void kf2k3pl_install_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003p_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003p_w) );
}
/* The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg) */
-void kf2k3upl_px_decrypt( running_machine *machine )
+void kf2k3upl_px_decrypt( running_machine &machine )
{
{
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
memmove(src+0x100000, src, 0x600000);
memmove(src, src+0x700000, 0x100000);
}
@@ -1019,8 +1019,8 @@ void kf2k3upl_px_decrypt( running_machine *machine )
int ofst;
int i;
- UINT8 *rom = machine->region( "maincpu" )->base() + 0xfe000;
- UINT8 *buf = machine->region( "maincpu" )->base() + 0xd0610;
+ UINT8 *rom = machine.region( "maincpu" )->base() + 0xfe000;
+ UINT8 *buf = machine.region( "maincpu" )->base() + 0xd0610;
for( i = 0; i < 0x2000 / 2; i++ ){
ofst = (i & 0xff00) + BITSWAP8( (i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5 );
@@ -1029,19 +1029,19 @@ void kf2k3upl_px_decrypt( running_machine *machine )
}
}
-void kf2k3upl_install_protection(running_machine *machine)
+void kf2k3upl_install_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(kof2003_r), FUNC(kof2003_w) );
}
/* Samurai Shodown V / Samurai Spirits Zero (bootleg) */
-void samsho5b_px_decrypt( running_machine *machine )
+void samsho5b_px_decrypt( running_machine &machine )
{
- int px_size = machine->region( "maincpu" )->bytes();
- UINT8 *rom = machine->region( "maincpu" )->base();
+ int px_size = machine.region( "maincpu" )->bytes();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, px_size );
int ofst;
int i;
@@ -1065,10 +1065,10 @@ void samsho5b_px_decrypt( running_machine *machine )
}
-void samsho5b_vx_decrypt( running_machine *machine )
+void samsho5b_vx_decrypt( running_machine &machine )
{
- int vx_size = machine->region( "ymsnd" )->bytes();
- UINT8 *rom = machine->region( "ymsnd" )->base();
+ int vx_size = machine.region( "ymsnd" )->bytes();
+ UINT8 *rom = machine.region( "ymsnd" )->base();
int i;
for( i = 0; i < vx_size; i++ )
@@ -1081,10 +1081,10 @@ void samsho5b_vx_decrypt( running_machine *machine )
#define MATRIMBLZ80( i ) ( i^(BITSWAP8(i&0x3,4,3,1,2,0,7,6,5)<<8) )
-void matrimbl_decrypt( running_machine *machine )
+void matrimbl_decrypt( running_machine &machine )
{
/* decrypt Z80 */
- UINT8 *rom = machine->region( "audiocpu" )->base()+0x10000;
+ UINT8 *rom = machine.region( "audiocpu" )->base()+0x10000;
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x20000 );
int i, j=0;
memcpy( buf, rom, 0x20000 );
diff --git a/src/mame/machine/neocrypt.c b/src/mame/machine/neocrypt.c
index f51add63cb0..49fb9f4a55e 100644
--- a/src/mame/machine/neocrypt.c
+++ b/src/mame/machine/neocrypt.c
@@ -528,18 +528,18 @@ static void decrypt(UINT8 *r0, UINT8 *r1,
}
-static void neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
+static void neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
{
int rom_size;
UINT8 *buf;
UINT8 *rom;
int rpos;
- rom_size = machine->region("sprites")->bytes();
+ rom_size = machine.region("sprites")->bytes();
buf = auto_alloc_array(machine, UINT8, rom_size);
- rom = machine->region("sprites")->base();
+ rom = machine.region("sprites")->base();
// Data xor
for (rpos = 0;rpos < rom_size/4;rpos++)
@@ -592,13 +592,13 @@ static void neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* the S data comes from the end of the C data */
-void neogeo_sfix_decrypt(running_machine *machine)
+void neogeo_sfix_decrypt(running_machine &machine)
{
int i;
- int rom_size = machine->region("sprites")->bytes();
- int tx_size = machine->region("fixed")->bytes();
- UINT8 *src = machine->region("sprites")->base()+rom_size-tx_size;
- UINT8 *dst = machine->region("fixed")->base();
+ int rom_size = machine.region("sprites")->bytes();
+ int tx_size = machine.region("fixed")->bytes();
+ UINT8 *src = machine.region("sprites")->base()+rom_size-tx_size;
+ UINT8 *dst = machine.region("fixed")->base();
for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
@@ -606,7 +606,7 @@ void neogeo_sfix_decrypt(running_machine *machine)
/* CMC42 protection chip */
-void kof99_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
+void kof99_neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
{
type0_t03 = kof99_type0_t03;
type0_t12 = kof99_type0_t12;
@@ -623,7 +623,7 @@ void kof99_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* CMC50 protection chip */
-void kof2000_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
+void kof2000_neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
{
type0_t03 = kof2000_type0_t03;
type0_t12 = kof2000_type0_t12;
@@ -640,7 +640,7 @@ void kof2000_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* CMC42 protection chip */
-void cmc42_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
+void cmc42_neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
{
type0_t03 = kof99_type0_t03;
type0_t12 = kof99_type0_t12;
@@ -656,7 +656,7 @@ void cmc42_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* CMC50 protection chip */
-void cmc50_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
+void cmc50_neogeo_gfx_decrypt(running_machine &machine, int extra_xor)
{
type0_t03 = kof2000_type0_t03;
type0_t12 = kof2000_type0_t12;
@@ -672,13 +672,13 @@ void cmc50_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* ms5pcb and svcpcb have an additional scramble on top of the standard CMC scrambling */
-void svcpcb_gfx_decrypt(running_machine *machine)
+void svcpcb_gfx_decrypt(running_machine &machine)
{
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
- int rom_size = machine->region( "sprites" )->bytes();
- UINT8 *rom = machine->region( "sprites" )->base();
+ int rom_size = machine.region( "sprites" )->bytes();
+ UINT8 *rom = machine.region( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < rom_size; i++ )
@@ -707,11 +707,11 @@ void svcpcb_gfx_decrypt(running_machine *machine)
/* and a further swap on the s1 data */
-void svcpcb_s1data_decrypt(running_machine *machine)
+void svcpcb_s1data_decrypt(running_machine &machine)
{
int i;
- UINT8 *s1 = machine->region( "fixed" )->base();
- size_t s1_size = machine->region( "fixed" )->bytes();
+ UINT8 *s1 = machine.region( "fixed" )->base();
+ size_t s1_size = machine.region( "fixed" )->bytes();
for( i = 0; i < s1_size; i++ ) // Decrypt S
{
@@ -722,13 +722,13 @@ void svcpcb_s1data_decrypt(running_machine *machine)
/* kf2k3pcb has an additional scramble on top of the standard CMC scrambling */
/* Thanks to Razoola & Halrin for the info */
-void kf2k3pcb_gfx_decrypt(running_machine *machine)
+void kf2k3pcb_gfx_decrypt(running_machine &machine)
{
static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
- int rom_size = machine->region( "sprites" )->bytes();
- UINT8 *rom = machine->region( "sprites" )->base();
+ int rom_size = machine.region( "sprites" )->bytes();
+ UINT8 *rom = machine.region( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for ( i = 0; i < rom_size; i++ )
@@ -753,31 +753,31 @@ void kf2k3pcb_gfx_decrypt(running_machine *machine)
/* and a further swap on the s1 data */
-void kf2k3pcb_decrypt_s1data(running_machine *machine)
+void kf2k3pcb_decrypt_s1data(running_machine &machine)
{
UINT8 *src;
UINT8 *dst;
int i;
- int tx_size = machine->region( "fixed" )->bytes();
- int srom_size = machine->region( "sprites" )->bytes();
+ int tx_size = machine.region( "fixed" )->bytes();
+ int srom_size = machine.region( "sprites" )->bytes();
- src = machine->region( "sprites" )->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S
- dst = machine->region( "fixed" )->base();
+ src = machine.region( "sprites" )->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S
+ dst = machine.region( "fixed" )->base();
for( i = 0; i < tx_size / 2; i++ )
{
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}
- src = machine->region( "sprites" )->base() + srom_size - 0x80000;
- dst = machine->region( "fixed" )->base() + 0x80000;
+ src = machine.region( "sprites" )->base() + srom_size - 0x80000;
+ dst = machine.region( "fixed" )->base() + 0x80000;
for( i = 0; i < tx_size / 2; i++ )
{
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}
- dst = machine->region( "fixed" )->base();
+ dst = machine.region( "fixed" )->base();
for( i = 0; i < tx_size; i++ )
{
@@ -885,11 +885,11 @@ static int m1_address_scramble(int address, UINT16 key)
}
-void neogeo_cmc50_m1_decrypt(running_machine *machine)
+void neogeo_cmc50_m1_decrypt(running_machine &machine)
{
- UINT8* rom = machine->region("audiocrypt")->base();
+ UINT8* rom = machine.region("audiocrypt")->base();
size_t rom_size = 0x80000;
- UINT8* rom2 = machine->region("audiocpu")->base();
+ UINT8* rom2 = machine.region("audiocpu")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, rom_size);
@@ -912,7 +912,7 @@ void neogeo_cmc50_m1_decrypt(running_machine *machine)
#if 0
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_m1.dump", gamename);
@@ -929,7 +929,7 @@ void neogeo_cmc50_m1_decrypt(running_machine *machine)
#if 0
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_m1extra.dump", gamename);
@@ -954,9 +954,9 @@ NeoGeo 'P' ROM encryption
/* Kof98 uses an early encryption, quite different from the others */
-void kof98_decrypt_68k(running_machine *machine)
+void kof98_decrypt_68k(running_machine &machine)
{
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x200000);
int i, j, k;
static const UINT32 sec[]={0x000000,0x100000,0x000004,0x100004,0x10000a,0x00000a,0x10000e,0x00000e};
@@ -1001,12 +1001,12 @@ void kof98_decrypt_68k(running_machine *machine)
/* kof99, garou, garouo, mslug3 and kof2000 have and SMA chip which contains program code and decrypts the 68k roms */
-void kof99_decrypt_68k(running_machine *machine)
+void kof99_decrypt_68k(running_machine &machine)
{
UINT16 *rom;
int i,j;
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1025,7 +1025,7 @@ void kof99_decrypt_68k(running_machine *machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x700000/2 + BITSWAP24(i,23,22,21,20,19,18,11,6,14,17,16,5,8,10,12,0,4,3,2,7,9,15,13,1)];
@@ -1033,13 +1033,13 @@ void kof99_decrypt_68k(running_machine *machine)
}
-void garou_decrypt_68k(running_machine *machine)
+void garou_decrypt_68k(running_machine &machine)
{
UINT16 *rom;
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1047,14 +1047,14 @@ void garou_decrypt_68k(running_machine *machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x710000/2 + BITSWAP24(i,23,22,21,20,19,18,4,5,16,14,7,9,6,13,17,15,3,1,2,12,11,8,10,0)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x8000/2)
{
UINT16 buffer[0x8000/2];
@@ -1067,13 +1067,13 @@ void garou_decrypt_68k(running_machine *machine)
}
-void garouo_decrypt_68k(running_machine *machine)
+void garouo_decrypt_68k(running_machine &machine)
{
UINT16 *rom;
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1081,14 +1081,14 @@ void garouo_decrypt_68k(running_machine *machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x7f8000/2 + BITSWAP24(i,23,22,21,20,19,18,5,16,11,2,6,7,17,3,12,8,14,4,0,9,1,10,15,13)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x8000/2)
{
UINT16 buffer[0x8000/2];
@@ -1101,13 +1101,13 @@ void garouo_decrypt_68k(running_machine *machine)
}
-void mslug3_decrypt_68k(running_machine *machine)
+void mslug3_decrypt_68k(running_machine &machine)
{
UINT16 *rom;
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1115,14 +1115,14 @@ void mslug3_decrypt_68k(running_machine *machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x5d0000/2 + BITSWAP24(i,23,22,21,20,19,18,15,2,1,13,3,0,9,6,16,4,11,5,7,12,17,14,10,8)];
}
/* swap address lines for the banked part */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
for (i = 0;i < 0x800000/2;i+=0x10000/2)
{
UINT16 buffer[0x10000/2];
@@ -1135,13 +1135,13 @@ void mslug3_decrypt_68k(running_machine *machine)
}
-void kof2000_decrypt_68k(running_machine *machine)
+void kof2000_decrypt_68k(running_machine &machine)
{
UINT16 *rom;
int i,j;
/* thanks to Razoola and Mr K for the info */
- rom = (UINT16 *)(machine->region("maincpu")->base() + 0x100000);
+ rom = (UINT16 *)(machine.region("maincpu")->base() + 0x100000);
/* swap data lines on the whole ROMs */
for (i = 0;i < 0x800000/2;i++)
{
@@ -1160,7 +1160,7 @@ void kof2000_decrypt_68k(running_machine *machine)
}
/* swap address lines & relocate fixed part */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < 0x0c0000/2;i++)
{
rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)];
@@ -1169,11 +1169,11 @@ void kof2000_decrypt_68k(running_machine *machine)
/* kof2002, matrim, samsho5, samsh5sp have some simple block swapping */
-void kof2002_decrypt_68k(running_machine *machine)
+void kof2002_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
- UINT8 *src = machine->region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.region("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
memcpy( dst, src, 0x400000 );
for( i=0; i<8; ++i )
@@ -1184,11 +1184,11 @@ void kof2002_decrypt_68k(running_machine *machine)
}
-void matrim_decrypt_68k(running_machine *machine)
+void matrim_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};
- UINT8 *src = machine->region("maincpu")->base()+0x100000;
+ UINT8 *src = machine.region("maincpu")->base()+0x100000;
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x400000);
memcpy( dst, src, 0x400000);
for( i=0; i<8; ++i )
@@ -1199,11 +1199,11 @@ void matrim_decrypt_68k(running_machine *machine)
}
-void samsho5_decrypt_68k(running_machine *machine)
+void samsho5_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x000000,0x080000,0x700000,0x680000,0x500000,0x180000,0x200000,0x480000,0x300000,0x780000,0x600000,0x280000,0x100000,0x580000,0x400000,0x380000};
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x800000);
memcpy( dst, src, 0x800000 );
@@ -1215,11 +1215,11 @@ void samsho5_decrypt_68k(running_machine *machine)
}
-void samsh5sp_decrypt_68k(running_machine *machine)
+void samsh5sp_decrypt_68k(running_machine &machine)
{
int i;
static const int sec[]={0x000000,0x080000,0x500000,0x480000,0x600000,0x580000,0x700000,0x280000,0x100000,0x680000,0x400000,0x780000,0x200000,0x380000,0x300000,0x180000};
- UINT8 *src = machine->region("maincpu")->base();
+ UINT8 *src = machine.region("maincpu")->base();
UINT8 *dst = auto_alloc_array(machine, UINT8, 0x800000);
memcpy( dst, src, 0x800000 );
@@ -1232,14 +1232,14 @@ void samsh5sp_decrypt_68k(running_machine *machine)
/* kf2k3pcb, kof2003, kof2003h, mslug5 and svc have updated P rom scramble */
-void mslug5_decrypt_68k(running_machine *machine)
+void mslug5_decrypt_68k(running_machine &machine)
{
static const UINT8 xor1[ 0x20 ] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 };
static const UINT8 xor2[ 0x20 ] = { 0x36, 0x09, 0xb0, 0x64, 0x95, 0x0f, 0x90, 0x42, 0x6e, 0x0f, 0x30, 0xf6, 0xe5, 0x08, 0x30, 0x64, 0x08, 0x04, 0x00, 0x2f, 0x72, 0x09, 0xa0, 0x13, 0xc9, 0x0b, 0xa0, 0x3e, 0xc2, 0x00, 0x40, 0x2b };
int i;
int ofst;
int rom_size = 0x800000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < 0x100000; i++ )
@@ -1277,14 +1277,14 @@ void mslug5_decrypt_68k(running_machine *machine)
}
-void svc_px_decrypt(running_machine *machine)
+void svc_px_decrypt(running_machine &machine)
{
static const UINT8 xor1[ 0x20 ] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f };
static const UINT8 xor2[ 0x20 ] = { 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4, 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26 };
int i;
int ofst;
int rom_size = 0x800000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for( i = 0; i < 0x100000; i++ )
@@ -1322,13 +1322,13 @@ void svc_px_decrypt(running_machine *machine)
}
-void kf2k3pcb_decrypt_68k(running_machine *machine)
+void kf2k3pcb_decrypt_68k(running_machine &machine)
{
static const UINT8 xor2[ 0x20 ] = { 0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa, 0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0b, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9 };
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1364,14 +1364,14 @@ void kf2k3pcb_decrypt_68k(running_machine *machine)
}
-void kof2003_decrypt_68k(running_machine *machine)
+void kof2003_decrypt_68k(running_machine &machine)
{
static const UINT8 xor1[0x20] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f };
static const UINT8 xor2[0x20] = { 0x2f, 0x02, 0x60, 0xbb, 0x77, 0x01, 0x30, 0x08, 0xd8, 0x01, 0xa0, 0xdf, 0x37, 0x0a, 0xf0, 0x65, 0x28, 0x03, 0xd0, 0x23, 0xd3, 0x03, 0x70, 0x42, 0xbb, 0x06, 0xf0, 0x28, 0xba, 0x0f, 0xf0, 0x7a };
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1412,14 +1412,14 @@ void kof2003_decrypt_68k(running_machine *machine)
// Thanks to IQ_132 for the info
-void kof2003h_decrypt_68k(running_machine *machine)
+void kof2003h_decrypt_68k(running_machine &machine)
{
static const UINT8 xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 };
static const UINT8 xor2[0x20] = { 0x2b, 0x09, 0xd0, 0x7f, 0x51, 0x0b, 0x10, 0x4c, 0x5b, 0x07, 0x70, 0x9d, 0x3e, 0x0b, 0xb0, 0xb6, 0x54, 0x09, 0xe0, 0xcc, 0x3d, 0x0d, 0x80, 0x99, 0x87, 0x03, 0x90, 0x82, 0xfe, 0x04, 0x20, 0x18 };
int i;
int ofst;
int rom_size = 0x900000;
- UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT8 *rom = machine.region( "maincpu" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, rom_size );
for (i = 0; i < 0x100000; i++)
@@ -1467,10 +1467,10 @@ NeoGeo 'V' (PCM) ROM encryption
***************************************************************************/
/* Neo-Pcm2 Drivers for Encrypted V Roms */
-void neo_pcm2_snk_1999(running_machine *machine, int value)
+void neo_pcm2_snk_1999(running_machine &machine, int value)
{ /* thanks to Elsemi for the NEO-PCM2 info */
- UINT16 *rom = (UINT16 *)machine->region("ymsnd")->base();
- int size = machine->region("ymsnd")->bytes();
+ UINT16 *rom = (UINT16 *)machine.region("ymsnd")->base();
+ int size = machine.region("ymsnd")->bytes();
int i, j;
if( rom != NULL )
@@ -1491,7 +1491,7 @@ void neo_pcm2_snk_1999(running_machine *machine, int value)
/* the later PCM2 games have additional scrambling */
-void neo_pcm2_swap(running_machine *machine, int value)
+void neo_pcm2_swap(running_machine &machine, int value)
{
static const UINT32 addrs[7][2]={
{0x000000,0xa5000},
@@ -1509,7 +1509,7 @@ void neo_pcm2_swap(running_machine *machine, int value)
{0xcb,0x29,0x7d,0x43,0xd2,0x3a,0xc2,0xb4},
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62},
{0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}};
- UINT8 *src = machine->region("ymsnd")->base();
+ UINT8 *src = machine.region("ymsnd")->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x1000000);
int i, j, d;
@@ -1533,7 +1533,7 @@ NeoGeo 'SP1' (BIOS) ROM encryption
/* only found on kf2k3pcb */
-void kof2003biosdecode(running_machine *machine)
+void kof2003biosdecode(running_machine &machine)
{
static const UINT8 address[0x80]={
0xb9,0xb8,0x36,0x37,0x3d,0x3c,0xb2,0xb3,
@@ -1553,7 +1553,7 @@ void kof2003biosdecode(running_machine *machine)
0xd3,0xd2,0x5c,0x5d,0x57,0x56,0xd8,0xd9,
0xd3,0xd2,0x5c,0x5d,0x57,0x56,0xd8,0xd9,
};
- UINT16*src= (UINT16*)machine->region( "mainbios" )->base();
+ UINT16*src= (UINT16*)machine.region( "mainbios" )->base();
UINT16*buf= auto_alloc_array(machine, UINT16, 0x80000/2);
int a,addr;
diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c
index 9f0926561ed..3251e8e9059 100644
--- a/src/mame/machine/neoprot.c
+++ b/src/mame/machine/neoprot.c
@@ -24,7 +24,7 @@
static READ16_HANDLER( fatfury2_protection_16_r )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
UINT16 res = state->fatfury2_prot_data >> 24;
switch (offset)
@@ -50,7 +50,7 @@ static READ16_HANDLER( fatfury2_protection_16_r )
static WRITE16_HANDLER( fatfury2_protection_16_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
switch (offset)
{
@@ -95,13 +95,13 @@ static WRITE16_HANDLER( fatfury2_protection_16_w )
}
-void fatfury2_install_protection( running_machine *machine )
+void fatfury2_install_protection( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
/* the protection involves reading and writing addresses in the */
/* 0x2xxxxx range. There are several checks all around the code. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x2fffff, FUNC(fatfury2_protection_16_r), FUNC(fatfury2_protection_16_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x200000, 0x2fffff, FUNC(fatfury2_protection_16_r), FUNC(fatfury2_protection_16_w));
state->fatfury2_prot_data = 0;
@@ -119,7 +119,7 @@ void fatfury2_install_protection( running_machine *machine )
static WRITE16_HANDLER ( kof98_prot_w )
{
/* info from razoola */
- UINT16* mem16 = (UINT16*)space->machine->region("maincpu")->base();
+ UINT16* mem16 = (UINT16*)space->machine().region("maincpu")->base();
switch (data)
{
@@ -142,11 +142,11 @@ static WRITE16_HANDLER ( kof98_prot_w )
}
-void install_kof98_protection( running_machine *machine )
+void install_kof98_protection( running_machine &machine )
{
/* when 0x20aaaa contains 0x0090 (word) then 0x100 (normally the neogeo header) should return 0x00c200fd worked out using real hw */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20aaaa, 0x20aaab, FUNC(kof98_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20aaaa, 0x20aaab, FUNC(kof98_prot_w));
}
@@ -157,10 +157,10 @@ void install_kof98_protection( running_machine *machine )
Also found on this special board is a QFP144 labeled with 0103
***************************************************************/
-void mslugx_install_protection( running_machine *machine )
+void mslugx_install_protection( running_machine &machine )
{
int i;
- UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
for (i = 0;i < (0x100000/2) - 4;i++)
{
@@ -375,7 +375,7 @@ static READ16_HANDLER( prot_9a37_r )
static READ16_HANDLER( sma_random_r )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
UINT16 old = state->neogeo_rng;
UINT16 newbit = ((state->neogeo_rng >> 2) ^
@@ -393,63 +393,63 @@ static READ16_HANDLER( sma_random_r )
}
-void neogeo_reset_rng( running_machine *machine )
+void neogeo_reset_rng( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->neogeo_rng = 0x2345;
}
-static void sma_install_random_read_handler( running_machine *machine, int addr1, int addr2 )
+static void sma_install_random_read_handler( running_machine &machine, int addr1, int addr2 )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->save_item(NAME(state->neogeo_rng));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr1, addr1 + 1, FUNC(sma_random_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr2, addr2 + 1, FUNC(sma_random_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr1, addr1 + 1, FUNC(sma_random_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(addr2, addr2 + 1, FUNC(sma_random_r));
}
-void kof99_install_protection( running_machine *machine )
+void kof99_install_protection( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2ffff1, FUNC(kof99_bankswitch_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ffff0, 0x2ffff1, FUNC(kof99_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa);
}
-void garou_install_protection( running_machine *machine )
+void garou_install_protection( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garou_bankswitch_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garou_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0);
}
-void garouo_install_protection( running_machine *machine )
+void garouo_install_protection( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garouo_bankswitch_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffc0, 0x2fffc1, FUNC(garouo_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
sma_install_random_read_handler(machine, 0x2fffcc, 0x2ffff0);
}
-void mslug3_install_protection( running_machine *machine )
+void mslug3_install_protection( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffe4, 0x2fffe5, FUNC(mslug3_bankswitch_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffe4, 0x2fffe5, FUNC(mslug3_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
// sma_install_random_read_handler(machine, 0x2ffff8, 0x2ffffa);
}
-void kof2000_install_protection( running_machine *machine )
+void kof2000_install_protection( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffec, 0x2fffed, FUNC(kof2000_bankswitch_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2fffec, 0x2fffed, FUNC(kof2000_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2fe446, 0x2fe447, FUNC(prot_9a37_r));
sma_install_random_read_handler(machine, 0x2fffd8, 0x2fffda);
}
@@ -460,21 +460,21 @@ void kof2000_install_protection( running_machine *machine )
mslug5, svcchaos, kof2003
***************************************************************/
-static void pvc_w8( running_machine *machine, offs_t offset, UINT8 data )
+static void pvc_w8( running_machine &machine, offs_t offset, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
*(((UINT8*)state->pvc_cartridge_ram) + BYTE_XOR_LE(offset)) = data;
}
-static UINT8 pvc_r8( running_machine *machine, offs_t offset )
+static UINT8 pvc_r8( running_machine &machine, offs_t offset )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
return *(((UINT8*)state->pvc_cartridge_ram) + BYTE_XOR_LE(offset));
}
-static void pvc_prot1( running_machine *machine )
+static void pvc_prot1( running_machine &machine )
{
UINT8 b1, b2;
@@ -487,7 +487,7 @@ static void pvc_prot1( running_machine *machine )
}
-static void pvc_prot2( running_machine *machine ) // on writes to e8/e9/ea/eb
+static void pvc_prot2( running_machine &machine ) // on writes to e8/e9/ea/eb
{
UINT8 b1, b2, b3, b4;
@@ -502,7 +502,7 @@ static void pvc_prot2( running_machine *machine ) // on writes to e8/e9/ea/eb
static void pvc_write_bankswitch( address_space *space )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
UINT32 bankaddress;
bankaddress = ((state->pvc_cartridge_ram[0xff8] >> 8)|(state->pvc_cartridge_ram[0xff9] << 8));
@@ -515,30 +515,30 @@ static void pvc_write_bankswitch( address_space *space )
static READ16_HANDLER( pvc_prot_r )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
return state->pvc_cartridge_ram[offset];
}
static WRITE16_HANDLER( pvc_prot_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
COMBINE_DATA(&state->pvc_cartridge_ram[offset] );
if (offset == 0xff0)
- pvc_prot1(space->machine);
+ pvc_prot1(space->machine());
else if(offset >= 0xff4 && offset <= 0xff5)
- pvc_prot2(space->machine);
+ pvc_prot2(space->machine());
else if(offset >= 0xff8)
pvc_write_bankswitch(space);
}
-void install_pvc_protection( running_machine *machine )
+void install_pvc_protection( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->pvc_cartridge_ram = auto_alloc_array(machine, UINT16, 0x2000 / 2);
state->save_pointer(NAME(state->pvc_cartridge_ram), 0x2000 / 2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(pvc_prot_r), FUNC(pvc_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2fe000, 0x2fffff, FUNC(pvc_prot_r), FUNC(pvc_prot_w));
}
diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c
index 5759bacb39b..94e7ad0e740 100644
--- a/src/mame/machine/nitedrvr.c
+++ b/src/mame/machine/nitedrvr.c
@@ -18,9 +18,9 @@ because D6 and D7 are apparently checked at different times, and a
change in-between can affect the direction you move.
***************************************************************************/
-static int nitedrvr_steering( running_machine *machine )
+static int nitedrvr_steering( running_machine &machine )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
int this_val = input_port_read(machine, "STEER");
int delta = this_val - state->last_steering_val;
@@ -58,14 +58,14 @@ nitedrvr_steering_reset
READ8_HANDLER( nitedrvr_steering_reset_r )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
state->steering_val = 0;
return 0;
}
WRITE8_HANDLER( nitedrvr_steering_reset_w )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
state->steering_val = 0;
}
@@ -100,8 +100,8 @@ Fill in the steering and gear bits in a special way.
READ8_HANDLER( nitedrvr_in0_r )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
- int gear = input_port_read(space->machine, "GEARS");
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
+ int gear = input_port_read(space->machine(), "GEARS");
if (gear & 0x10) state->gear = 1;
else if (gear & 0x20) state->gear = 2;
@@ -111,9 +111,9 @@ READ8_HANDLER( nitedrvr_in0_r )
switch (offset & 0x03)
{
case 0x00: /* No remapping necessary */
- return input_port_read(space->machine, "DSW0");
+ return input_port_read(space->machine(), "DSW0");
case 0x01: /* No remapping necessary */
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
case 0x02: /* Remap our gear shift */
if (state->gear == 1)
return 0xe0;
@@ -124,7 +124,7 @@ READ8_HANDLER( nitedrvr_in0_r )
else
return 0x70;
case 0x03: /* Remap our steering */
- return (input_port_read(space->machine, "DSW2") | nitedrvr_steering(space->machine));
+ return (input_port_read(space->machine(), "DSW2") | nitedrvr_steering(space->machine()));
default:
return 0xff;
}
@@ -164,8 +164,8 @@ Fill in the track difficulty switch and special signal in a special way.
READ8_HANDLER( nitedrvr_in1_r )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
- int port = input_port_read(space->machine, "IN0");
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
+ int port = input_port_read(space->machine(), "IN0");
state->ac_line = (state->ac_line + 1) % 3;
@@ -212,7 +212,7 @@ D5 = SKID2
WRITE8_HANDLER( nitedrvr_out0_w )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
discrete_sound_w(state->discrete, NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data
discrete_sound_w(state->discrete, NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable
@@ -232,9 +232,9 @@ D5 = Spare (Not used)
WRITE8_HANDLER( nitedrvr_out1_w )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
- set_led_status(space->machine, 0, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x10);
state->crash_en = data & 0x01;
@@ -247,8 +247,8 @@ WRITE8_HANDLER( nitedrvr_out1_w )
state->crash_data_en = 1;
state->crash_data = 0x0f;
/* Invert video */
- palette_set_color(space->machine, 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(space->machine, 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ palette_set_color(space->machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ palette_set_color(space->machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
}
discrete_sound_w(state->discrete, NITEDRVR_BANG_DATA, state->crash_data_en ? state->crash_data : 0); // Crash Volume
}
@@ -256,7 +256,7 @@ WRITE8_HANDLER( nitedrvr_out1_w )
TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback )
{
- nitedrvr_state *state = timer.machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = timer.machine().driver_data<nitedrvr_state>();
if (state->crash_en && state->crash_data_en)
{
@@ -268,24 +268,24 @@ TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback )
if (state->crash_data & 0x01)
{
/* Invert video */
- palette_set_color(timer.machine, 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(timer.machine, 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ palette_set_color(timer.machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ palette_set_color(timer.machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
}
else
{
/* Normal video */
- palette_set_color(timer.machine, 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- palette_set_color(timer.machine, 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ palette_set_color(timer.machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ palette_set_color(timer.machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
}
}
}
MACHINE_START( nitedrvr )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
- state->maincpu = machine->device("maincpu");
- state->discrete = machine->device("discrete");
+ state->maincpu = machine.device("maincpu");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->gear));
state->save_item(NAME(state->track));
@@ -300,7 +300,7 @@ MACHINE_START( nitedrvr )
MACHINE_RESET( nitedrvr )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
state->gear = 1;
state->track = 0;
diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c
index 406bf7f13ed..3f582e7008f 100644
--- a/src/mame/machine/nmk004.c
+++ b/src/mame/machine/nmk004.c
@@ -90,12 +90,14 @@ struct effects_control
static struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
const UINT8 *rom; // NMK004 data ROM
UINT8 from_main; // command from main CPU
UINT8 to_main; // answer to main CPU
int protection_check;
- running_machine *machine;
+ running_machine *m_machine;
device_t *ymdevice;
okim6295_device *oki1device;
okim6295_device *oki2device;
@@ -167,7 +169,7 @@ static void oki_play_sample(int sample_no)
if (sample != 0)
{
- UINT8 *rom = NMK004_state.machine->region((chip == 0) ? "oki1" : "oki2")->base();
+ UINT8 *rom = NMK004_state.machine().region((chip == 0) ? "oki1" : "oki2")->base();
int bank = (byte2 & 0x0c) >> 2;
int vol = (byte2 & 0x70) >> 4;
@@ -1020,12 +1022,12 @@ static TIMER_CALLBACK( real_nmk004_init )
memset(&NMK004_state, 0, sizeof(NMK004_state));
- NMK004_state.machine = machine;
- NMK004_state.ymdevice = machine->device("ymsnd");
- NMK004_state.oki1device = machine->device<okim6295_device>("oki1");
- NMK004_state.oki2device = machine->device<okim6295_device>("oki2");
+ NMK004_state.m_machine = &machine;
+ NMK004_state.ymdevice = machine.device("ymsnd");
+ NMK004_state.oki1device = machine.device<okim6295_device>("oki1");
+ NMK004_state.oki2device = machine.device<okim6295_device>("oki2");
- NMK004_state.rom = machine->region("audiocpu")->base();
+ NMK004_state.rom = machine.region("audiocpu")->base();
ym2203_control_port_w(NMK004_state.ymdevice, 0, 0x2f);
@@ -1043,10 +1045,10 @@ static TIMER_CALLBACK( real_nmk004_init )
NMK004_state.protection_check = 0;
}
-void NMK004_init(running_machine *machine)
+void NMK004_init(running_machine &machine)
{
/* we have to do this via a timer because we get called before the sound reset */
- machine->scheduler().synchronize(FUNC(real_nmk004_init));
+ machine.scheduler().synchronize(FUNC(real_nmk004_init));
}
diff --git a/src/mame/machine/nmk004.h b/src/mame/machine/nmk004.h
index 86ca6f95e59..9f29f5df366 100644
--- a/src/mame/machine/nmk004.h
+++ b/src/mame/machine/nmk004.h
@@ -1,4 +1,4 @@
-void NMK004_init(running_machine *machine);
+void NMK004_init(running_machine &machine);
void NMK004_irq(device_t *device, int irq);
READ16_HANDLER( NMK004_r );
WRITE16_HANDLER( NMK004_w );
diff --git a/src/mame/machine/nmk112.c b/src/mame/machine/nmk112.c
index 269f6be37a0..57b9ef2ba9b 100644
--- a/src/mame/machine/nmk112.c
+++ b/src/mame/machine/nmk112.c
@@ -122,8 +122,8 @@ static DEVICE_START( nmk112 )
}
else
{
- nmk112->rom0 = device->machine->region(intf->rgn0)->base();
- nmk112->size0 = device->machine->region(intf->rgn0)->bytes() - 0x40000;
+ nmk112->rom0 = device->machine().region(intf->rgn0)->base();
+ nmk112->size0 = device->machine().region(intf->rgn0)->bytes() - 0x40000;
}
if (intf->rgn1 == NULL)
@@ -133,14 +133,14 @@ static DEVICE_START( nmk112 )
}
else
{
- nmk112->rom1 = device->machine->region(intf->rgn1)->base();
- nmk112->size1 = device->machine->region(intf->rgn1)->bytes() - 0x40000;
+ nmk112->rom1 = device->machine().region(intf->rgn1)->base();
+ nmk112->size1 = device->machine().region(intf->rgn1)->bytes() - 0x40000;
}
nmk112->page_mask = ~intf->disable_page_mask;
device->save_item(NAME(nmk112->current_bank));
- device->machine->state().register_postload(nmk112_postload_bankswitch, nmk112);
+ device->machine().state().register_postload(nmk112_postload_bankswitch, nmk112);
}
static DEVICE_RESET( nmk112 )
diff --git a/src/mame/machine/nycaptor.c b/src/mame/machine/nycaptor.c
index 458233cfc7f..bcc7d54afd3 100644
--- a/src/mame/machine/nycaptor.c
+++ b/src/mame/machine/nycaptor.c
@@ -12,19 +12,19 @@
READ8_HANDLER( nycaptor_68705_port_a_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
WRITE8_HANDLER( nycaptor_68705_port_a_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->port_a_out = data;
}
WRITE8_HANDLER( nycaptor_68705_ddr_a_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->ddr_a = data;
}
@@ -39,13 +39,13 @@ WRITE8_HANDLER( nycaptor_68705_ddr_a_w )
READ8_HANDLER( nycaptor_68705_port_b_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
WRITE8_HANDLER( nycaptor_68705_port_b_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
if (BIT(state->ddr_b, 1) && BIT(~data, 1) && BIT(state->port_b_out, 1))
{
@@ -68,14 +68,14 @@ WRITE8_HANDLER( nycaptor_68705_port_b_w )
WRITE8_HANDLER( nycaptor_68705_ddr_b_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->ddr_b = data;
}
READ8_HANDLER( nycaptor_68705_port_c_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->port_c_in = 0;
if (state->main_sent)
@@ -88,19 +88,19 @@ READ8_HANDLER( nycaptor_68705_port_c_r )
WRITE8_HANDLER( nycaptor_68705_port_c_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->port_c_out = data;
}
WRITE8_HANDLER( nycaptor_68705_ddr_c_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->ddr_c = data;
}
WRITE8_HANDLER( nycaptor_mcu_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->from_main = data;
state->main_sent = 1;
@@ -109,7 +109,7 @@ WRITE8_HANDLER( nycaptor_mcu_w )
READ8_HANDLER( nycaptor_mcu_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->mcu_sent = 0;
return state->from_mcu;
@@ -117,7 +117,7 @@ READ8_HANDLER( nycaptor_mcu_r )
READ8_HANDLER( nycaptor_mcu_status_r1 )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
/* bit 1 = when 1, mcu has sent data to the main cpu */
return state->mcu_sent ? 2 : 0;
@@ -125,7 +125,7 @@ READ8_HANDLER( nycaptor_mcu_status_r1 )
READ8_HANDLER( nycaptor_mcu_status_r2 )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
/* bit 0 = when 1, mcu is ready to receive data from main cpu */
return state->main_sent ? 0 : 1;
diff --git a/src/mame/machine/opwolf.c b/src/mame/machine/opwolf.c
index e2ce25d2ec9..02ba2d908d3 100644
--- a/src/mame/machine/opwolf.c
+++ b/src/mame/machine/opwolf.c
@@ -275,7 +275,7 @@ static const UINT16 *const level_data_lookup[] =
static TIMER_CALLBACK( opwolf_timer_callback )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
// Level data command
if (state->current_cmd == 0xf5)
@@ -314,9 +314,9 @@ static TIMER_CALLBACK( opwolf_timer_callback )
state->current_cmd = 0;
}
-static void updateDifficulty( running_machine *machine, int mode )
+static void updateDifficulty( running_machine &machine, int mode )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
// The game is made up of 6 rounds, when you complete the
// sixth you return to the start but with harder difficulty.
@@ -394,22 +394,22 @@ WRITE16_HANDLER( opwolf_cchip_status_w )
// We use it to setup some initial state (it's not clear if the real
// c-chip sets this here, or if it's as a side-effect of the other
// init sequence data).
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
state->cchip_ram[0x3d] = 1;
state->cchip_ram[0x7a] = 1;
- updateDifficulty(space->machine, 0);
+ updateDifficulty(space->machine(), 0);
}
WRITE16_HANDLER( opwolf_cchip_bank_w )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
state->current_bank = data & 7;
}
WRITE16_HANDLER( opwolf_cchip_data_w )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
state->cchip_ram[(state->current_bank * 0x400) + offset] = data & 0xff;
@@ -423,7 +423,7 @@ WRITE16_HANDLER( opwolf_cchip_data_w )
if (offset == 0x14)
{
#if OPWOLF_READ_COINAGE_FROM_ROM
- UINT16* rom = (UINT16*)space->machine->region("maincpu")->base();
+ UINT16* rom = (UINT16*)space->machine().region("maincpu")->base();
UINT32 coin_table[2] = {0, 0};
UINT8 coin_offset[2];
int slot;
@@ -491,7 +491,7 @@ WRITE16_HANDLER( opwolf_cchip_data_w )
// Dip switch B
if (offset == 0x15)
{
- updateDifficulty(space->machine, 0);
+ updateDifficulty(space->machine(), 0);
}
}
}
@@ -514,7 +514,7 @@ READ16_HANDLER( opwolf_cchip_status_r )
READ16_HANDLER( opwolf_cchip_data_r )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
// if (offset!=0x7f && offset!=0x1c && offset!=0x1d && offset!=0x1e && offset!=0x1f && offset!=0x20 && cpu_get_pc(space->cpu)!=0xc18 && cpu_get_pc(space->cpu)!=0xc2e && cpu_get_pc(space->cpu)!=0xc9e && offset!=0x50 && offset!=0x51 && offset!=0x52 && offset!=0x53 && offset!=0x5 && offset!=0x13 && offset!=0x79 && offset!=0x12 && offset!=0x34)
// logerror("%08x: opwolf c read %04x (bank %04x)\n", cpu_get_pc(space->cpu), offset, state->current_bank);
@@ -530,7 +530,7 @@ READ16_HANDLER( opwolf_cchip_data_r )
static TIMER_CALLBACK( cchip_timer )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
// Update input ports, these are used by both the 68k directly and by the c-chip
state->cchip_ram[0x4] = input_port_read(machine, "IN0");
@@ -695,7 +695,7 @@ static TIMER_CALLBACK( cchip_timer )
{
// Simulate time for command to execute (exact timing unknown, this is close)
state->current_cmd = 0xf5;
- machine->scheduler().timer_set(state->maincpu->cycles_to_attotime(80000), FUNC(opwolf_timer_callback));
+ machine.scheduler().timer_set(state->maincpu->cycles_to_attotime(80000), FUNC(opwolf_timer_callback));
}
state->cchip_last_7a = state->cchip_ram[0x7a];
@@ -718,9 +718,9 @@ static TIMER_CALLBACK( cchip_timer )
*
*************************************/
-void opwolf_cchip_init( running_machine *machine )
+void opwolf_cchip_init( running_machine &machine )
{
- opwolf_state *state = machine->driver_data<opwolf_state>();
+ opwolf_state *state = machine.driver_data<opwolf_state>();
state->cchip_ram = auto_alloc_array_clear(machine, UINT8, 0x400 * 8);
@@ -752,5 +752,5 @@ void opwolf_cchip_init( running_machine *machine )
state->cchip_coins_for_credit[1] = 1;
state->cchip_credits_for_coin[1] = 1;
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer));
}
diff --git a/src/mame/machine/pacplus.c b/src/mame/machine/pacplus.c
index 7508350d7d6..6cbcfe3a64e 100644
--- a/src/mame/machine/pacplus.c
+++ b/src/mame/machine/pacplus.c
@@ -39,14 +39,14 @@ static UINT8 decrypt(int addr, UINT8 e)
}
-void pacplus_decode(running_machine *machine)
+void pacplus_decode(running_machine &machine)
{
int i;
UINT8 *RAM;
/* CPU ROMs */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0; i < 0x4000; i++)
{
RAM[i] = decrypt(i,RAM[i]);
diff --git a/src/mame/machine/pcecommn.c b/src/mame/machine/pcecommn.c
index c88e0f4888e..7cb1425ad95 100644
--- a/src/mame/machine/pcecommn.c
+++ b/src/mame/machine/pcecommn.c
@@ -17,7 +17,7 @@ struct pce_struct pce;
static int joystick_port_select; /* internal index of joystick ports */
static int joystick_data_select; /* which nibble of joystick data we want */
-static UINT8 (*pce_joystick_readinputport_callback)(running_machine *) = NULL;
+static UINT8 (*pce_joystick_readinputport_callback)(running_machine &) = NULL;
DRIVER_INIT( pce ) {
pce.io_port_options = PCE_JOY_SIG | CONST_SIG;
@@ -53,11 +53,11 @@ READ8_HANDLER ( pce_joystick_r )
if ( pce_joystick_readinputport_callback != NULL )
{
- data = pce_joystick_readinputport_callback(space->machine);
+ data = pce_joystick_readinputport_callback(space->machine());
}
else
{
- data = input_port_read(space->machine, "JOY");
+ data = input_port_read(space->machine(), "JOY");
}
if(joystick_data_select) data >>= 4;
ret = (data & 0x0F) | pce.io_port_options;
@@ -67,7 +67,7 @@ READ8_HANDLER ( pce_joystick_r )
return (ret);
}
-void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine *))
+void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine &))
{
pce_joystick_readinputport_callback = joy_read;
}
diff --git a/src/mame/machine/pcecommn.h b/src/mame/machine/pcecommn.h
index 61b9dac4327..4ec9bb07e64 100644
--- a/src/mame/machine/pcecommn.h
+++ b/src/mame/machine/pcecommn.h
@@ -30,5 +30,5 @@ extern struct pce_struct pce;
DRIVER_INIT( pce );
MACHINE_RESET( pce );
-void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine *));
+void pce_set_joystick_readinputport_callback( UINT8 (*joy_read)(running_machine &));
#endif
diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c
index 5ea87829e44..843beeb9b75 100644
--- a/src/mame/machine/pckeybrd.c
+++ b/src/mame/machine/pckeybrd.c
@@ -305,13 +305,13 @@ static const extended_keyboard_code at_keyboard_extended_codes_set_2_3[]=
static void at_keyboard_queue_insert(UINT8 data);
static int at_keyboard_queue_size(void);
-static int at_keyboard_queue_chars(running_machine *machine, const unicode_char *text, size_t text_len);
-static int at_keyboard_accept_char(running_machine *machine, unicode_char ch);
-static int at_keyboard_charqueue_empty(running_machine *machine);
+static int at_keyboard_queue_chars(running_machine &machine, const unicode_char *text, size_t text_len);
+static int at_keyboard_accept_char(running_machine &machine, unicode_char ch);
+static int at_keyboard_charqueue_empty(running_machine &machine);
-void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type)
+void at_keyboard_init(running_machine &machine, AT_KEYBOARD_TYPE type)
{
int i;
@@ -336,7 +336,7 @@ void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type)
{
astring buf;
buf.printf("pc_keyboard_%d", i);
- keyboard.ports[i] = machine->port(buf);
+ keyboard.ports[i] = machine.port(buf);
}
inputx_setup_natural_keyboard(machine,
@@ -347,7 +347,7 @@ void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type)
-void at_keyboard_reset(running_machine *machine)
+void at_keyboard_reset(running_machine &machine)
{
keyboard.head = keyboard.tail = 0;
keyboard.input_state = 0;
@@ -666,7 +666,7 @@ Note: each command is acknowledged by FAh (ACK), if not mentioned otherwise.
SeeAlso: #P046
*/
-void at_keyboard_write(running_machine *machine, UINT8 data)
+void at_keyboard_write(running_machine &machine, UINT8 data)
{
if (LOG_KEYBOARD)
logerror("keyboard write %.2x\n",data);
@@ -968,7 +968,7 @@ static UINT8 unicode_char_to_at_keycode(unicode_char ch)
at_keyboard_queue_chars
***************************************************************************/
-static int at_keyboard_queue_chars(running_machine *machine, const unicode_char *text, size_t text_len)
+static int at_keyboard_queue_chars(running_machine &machine, const unicode_char *text, size_t text_len)
{
int i;
UINT8 b;
@@ -1237,14 +1237,14 @@ INPUT_PORTS_END
Inputx stuff
***************************************************************************/
-static int at_keyboard_accept_char(running_machine *machine, unicode_char ch)
+static int at_keyboard_accept_char(running_machine &machine, unicode_char ch)
{
return unicode_char_to_at_keycode(ch) != 0;
}
-static int at_keyboard_charqueue_empty(running_machine *machine)
+static int at_keyboard_charqueue_empty(running_machine &machine)
{
return at_keyboard_queue_size() == 0;
}
diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c
index 4392d16e3e9..cba85f9b6c2 100644
--- a/src/mame/machine/pcshare.c
+++ b/src/mame/machine/pcshare.c
@@ -31,11 +31,11 @@
#define VERBOSE_DBG 0 /* general debug messages */
#define DBG_LOG(N,M,A) \
- if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",pc_keyb.machine->time().as_double(),(char*)M ); logerror A; }
+ if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",pc_keyb.machine().time().as_double(),(char*)M ); logerror A; }
#define VERBOSE_JOY 0 /* JOY (joystick port) */
#define JOY_LOG(N,M,A) \
- if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",pc_keyb.machine->time().as_double(),(char*)M ); logerror A; }
+ if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",pc_keyb.machine().time().as_double(),(char*)M ); logerror A; }
static TIMER_CALLBACK( pc_keyb_timer );
@@ -47,8 +47,10 @@ static TIMER_CALLBACK( pc_keyb_timer );
*/
static struct {
- running_machine *machine;
- void (*int_cb)(running_machine *, int);
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
+ void (*int_cb)(running_machine &, int);
emu_timer *timer;
UINT8 data;
int on;
@@ -57,7 +59,7 @@ static struct {
-void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int))
+void init_pc_common(running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int))
{
/* PC-XT keyboard */
if (flags & PCCOMMON_KEYBOARD_AT)
@@ -67,9 +69,9 @@ void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_
at_keyboard_set_scan_code_set(1);
memset(&pc_keyb, 0, sizeof(pc_keyb));
- pc_keyb.machine = machine;
+ pc_keyb.m_machine = &machine;
pc_keyb.int_cb = set_keyb_int_func;
- pc_keyb.timer = machine->scheduler().timer_alloc(FUNC(pc_keyb_timer));
+ pc_keyb.timer = machine.scheduler().timer_alloc(FUNC(pc_keyb_timer));
}
UINT8 pc_keyb_read(void)
@@ -119,7 +121,7 @@ void pc_keyb_clear(void)
{
pc_keyb.data = 0;
if ( pc_keyb.int_cb ) {
- pc_keyb.int_cb(pc_keyb.machine, 0);
+ pc_keyb.int_cb(pc_keyb.machine(), 0);
}
}
@@ -135,7 +137,7 @@ void pc_keyboard(void)
pc_keyb.data = data;
DBG_LOG(1,"KB_scancode",("$%02x\n", pc_keyb.data));
if ( pc_keyb.int_cb ) {
- pc_keyb.int_cb(pc_keyb.machine, 1);
+ pc_keyb.int_cb(pc_keyb.machine(), 1);
}
pc_keyb.self_test = 0;
}
@@ -152,7 +154,7 @@ static UINT8 at_pages[0x10];
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -259,7 +261,7 @@ static I8237_INTERFACE( dma8237_2_config )
static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface pic8259_1_config =
@@ -275,19 +277,19 @@ static const struct pic8259_interface pic8259_2_config =
IRQ_CALLBACK(pcat_irq_callback)
{
int r = 0;
- r = pic8259_acknowledge(device->machine->device("pic8259_2"));
+ r = pic8259_acknowledge(device->machine().device("pic8259_2"));
if (r==0)
{
- r = pic8259_acknowledge(device->machine->device("pic8259_1"));
+ r = pic8259_acknowledge(device->machine().device("pic8259_1"));
}
return r;
}
static WRITE_LINE_DEVICE_HANDLER( at_pit8254_out0_changed )
{
- if ( device->machine->device("pic8259_1") )
+ if ( device->machine().device("pic8259_1") )
{
- pic8259_ir0_w(device->machine->device("pic8259_1"), state);
+ pic8259_ir0_w(device->machine().device("pic8259_1"), state);
}
}
diff --git a/src/mame/machine/pgmcrypt.c b/src/mame/machine/pgmcrypt.c
index 5a483764b17..c6409349de9 100644
--- a/src/mame/machine/pgmcrypt.c
+++ b/src/mame/machine/pgmcrypt.c
@@ -23,11 +23,11 @@ static const UINT8 kov_tab[256] = {
0x80, 0xe6, 0xba, 0xb3, 0x08, 0xd8, 0x30, 0x5b, 0x5f, 0xf2, 0x5a, 0xfb, 0x63, 0xb0, 0xa4, 0x41
};
-void pgm_kov_decrypt(running_machine *machine)
+void pgm_kov_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -85,11 +85,11 @@ static const UINT8 kovsh_tab[256] = {
};
-void pgm_kovsh_decrypt(running_machine *machine)
+void pgm_kovsh_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -126,11 +126,11 @@ void pgm_kovsh_decrypt(running_machine *machine)
}
}
-void pgm_dw2_decrypt(running_machine *machine)
+void pgm_dw2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x80000;
@@ -168,11 +168,11 @@ static const UINT8 photoy2k_tab[256] = {
0x92, 0x14, 0x23, 0xae, 0x4b, 0x80, 0xae, 0x6a, 0x56, 0x01, 0xac, 0x55, 0xf7, 0x6d, 0x9b, 0x6d,
};
-void pgm_photoy2k_decrypt(running_machine *machine)
+void pgm_photoy2k_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -228,11 +228,11 @@ static const UINT8 pstar[256] = {
0x62, 0x51, 0xf6, 0xe3, 0xa6, 0xea, 0x32, 0x86, 0x67, 0xcc, 0x4a, 0x46, 0x4d, 0x37, 0x45, 0xd5,
};
-void pgm_pstar_decrypt(running_machine *machine)
+void pgm_pstar_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -265,14 +265,14 @@ void pgm_pstar_decrypt(running_machine *machine)
}
}
-void pgm_dw3_decrypt(running_machine *machine)
+void pgm_dw3_decrypt(running_machine &machine)
{
// int i;
// UINT16 *src=(UINT16 *) (OP_ROM+0x100000);
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -297,14 +297,14 @@ void pgm_dw3_decrypt(running_machine *machine)
}
}
-void pgm_killbld_decrypt(running_machine *machine)
+void pgm_killbld_decrypt(running_machine &machine)
{
// int i;
// UINT16 *src=(UINT16 *) (OP_ROM+0x100000);
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x200000;
@@ -340,10 +340,10 @@ static const UINT8 dfront_tab[256] = {
0x08, 0x75, 0xa1, 0x33, 0xab, 0xd2, 0xda, 0x81, 0xbf, 0x7a, 0x3b, 0x3f, 0x4a, 0xfd, 0x25, 0x36,
};
-void pgm_dfront_decrypt(running_machine *machine)
+void pgm_dfront_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x400000;
@@ -400,10 +400,10 @@ static const UINT8 ddp2_tab[256] = {
0xdc, 0xca, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x2f, 0x2d, 0x2a, 0xec, 0x1f
};
-void pgm_ddp2_decrypt(running_machine *machine)
+void pgm_ddp2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -454,10 +454,10 @@ static const UINT8 mm_tab[256] = {
0x7c, 0x01, 0x43, 0xdb, 0x53, 0x85, 0xfe, 0x78, 0x91, 0x40, 0xa3, 0xdf, 0x4f, 0xff, 0x10, 0x6c,
};
-void pgm_mm_decrypt(running_machine *machine) // and dw2001
+void pgm_mm_decrypt(running_machine &machine) // and dw2001
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -513,10 +513,10 @@ static const UINT8 kov2_tab[256] = {
0x9c, 0xc8, 0xd4, 0xda, 0xcd, 0xd2, 0x83, 0xca, 0xeb, 0x4f, 0xf2, 0x0f, 0x0d, 0x2a, 0xec, 0x1f,
};
-void pgm_kov2_decrypt(running_machine *machine)
+void pgm_kov2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -569,10 +569,10 @@ static const UINT8 kov2p_tab[256] = {
0x46, 0xdb, 0x30, 0x26, 0xd0, 0xdf, 0x7a, 0x86, 0x3e, 0x2e, 0x04, 0xbf, 0x49, 0x2a, 0xf9, 0x66,
};
-void pgm_kov2p_decrypt(running_machine *machine)
+void pgm_kov2p_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -628,10 +628,10 @@ static const UINT8 puzzli2_tab[256] = {
0x1d, 0x18, 0xa2, 0xb6, 0xb2, 0xa9, 0xac, 0xab, 0xae, 0x91, 0x98, 0x8d, 0x91, 0xbb, 0xb1, 0xc0,
};
-void pgm_puzzli2_decrypt(running_machine *machine)
+void pgm_puzzli2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x100000;
@@ -687,10 +687,10 @@ static const UINT8 theglad_tab[256] = {
0x19, 0x4C, 0xB0, 0x45, 0xDE, 0x48, 0x55, 0xAE, 0x82, 0xAB, 0xBC, 0xAB, 0x0C, 0x5E, 0xCE, 0x07,
};
-void pgm_theglad_decrypt(running_machine *machine)
+void pgm_theglad_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -747,10 +747,10 @@ static const UINT8 oldsplus_tab[256] = {
0x55, 0x31, 0x96, 0xEA, 0x78, 0x45, 0x3A, 0x33, 0x23, 0xC5, 0xD1, 0x3C, 0xA3, 0x86, 0x88, 0x38,
};
-void pgm_oldsplus_decrypt(running_machine *machine)
+void pgm_oldsplus_decrypt(running_machine &machine)
{
int i;
- unsigned short *src = (unsigned short *)(machine->region("maincpu")->base()+0x100000);
+ unsigned short *src = (unsigned short *)(machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -807,10 +807,10 @@ static const UINT8 kovshp_tab[256] = {
0x42, 0xE2, 0x4F, 0x3C, 0x25, 0x35, 0x93, 0x6C, 0x9B, 0x56, 0xBE, 0xC1, 0x5B, 0x65, 0xDE, 0x27,
};
-void pgm_kovshp_decrypt(running_machine *machine)
+void pgm_kovshp_decrypt(running_machine &machine)
{
int i;
- unsigned short *src = (unsigned short *)(machine->region("maincpu")->base()+0x100000);
+ unsigned short *src = (unsigned short *)(machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -867,10 +867,10 @@ static const UINT8 killbldp_tab[256] = {
0xF0, 0xF3, 0x4A, 0x9F, 0x54, 0xB4, 0xB1, 0xCC, 0xD4, 0xFF, 0xD6, 0xFF, 0xC9, 0xEE, 0x86, 0x39,
};
-void pgm_killbldp_decrypt(running_machine *machine)
+void pgm_killbldp_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x200000;
@@ -908,10 +908,10 @@ void pgm_killbldp_decrypt(running_machine *machine)
}
-void pgm_svg_decrypt(running_machine *machine)
+void pgm_svg_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)(machine->region("user1")->base());
+ UINT16 *src = (UINT16 *)(machine.region("user1")->base());
int rom_size = 0x800000;
@@ -965,10 +965,10 @@ static const UINT8 py2k2_tab[256] = {
0x19, 0xc6, 0x75, 0xe8, 0x6c, 0x54, 0x7e, 0x63, 0xdd, 0xae, 0x07, 0x5a, 0xb7, 0x00, 0xb5, 0x5e
};
-void pgm_py2k2_decrypt(running_machine *machine) // and ddpdoj/ddpdojbl
+void pgm_py2k2_decrypt(running_machine &machine) // and ddpdoj/ddpdojbl
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base()+0x100000);
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base()+0x100000);
int rom_size = 0x400000;
@@ -1011,10 +1011,10 @@ static const unsigned char ket_tab[256] = {
0x55, 0x5a, 0xa1, 0xd7, 0x73, 0x2b, 0x76, 0xe9, 0x5b, 0xe4, 0x0c, 0x2e, 0x60, 0xcb, 0x4b, 0x72
};
-void pgm_ket_decrypt(running_machine *machine)
+void pgm_ket_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x400000;
@@ -1057,10 +1057,10 @@ static const unsigned char espgal_tab[256] = {
0xdc, 0x43, 0xcc, 0xc3, 0xc5, 0x25, 0xab, 0x45, 0x6e, 0x63, 0x7e, 0x45, 0x40, 0x63, 0x67, 0xd2
};
-void pgm_espgal_decrypt(running_machine *machine)
+void pgm_espgal_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x400000;
diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c
index 3ae9b54ccd4..2f3cfd403a1 100644
--- a/src/mame/machine/pgmprot.c
+++ b/src/mame/machine/pgmprot.c
@@ -108,10 +108,10 @@ static const int pstar_80[0x1a3]={
READ16_HANDLER( pstars_protram_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset == 4) //region
- return input_port_read(space->machine, "Region");
+ return input_port_read(space->machine(), "Region");
else if (offset >= 0x10) //timer
{
logerror("PSTARS ACCESS COUNTER %6X\n", state->pstar_ram[offset - 0x10]);
@@ -122,7 +122,7 @@ READ16_HANDLER( pstars_protram_r )
READ16_HANDLER( pstars_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset == 0)
{
@@ -147,7 +147,7 @@ READ16_HANDLER( pstars_r )
WRITE16_HANDLER( pstars_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset == 0)
{
@@ -274,9 +274,9 @@ WRITE16_HANDLER( pstars_w )
/*** ASIC 3 (oriental legends protection) ****************************************/
-static void asic3_compute_hold(running_machine *machine)
+static void asic3_compute_hold(running_machine &machine)
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
// The mode is dependent on the region
static const int modes[4] = { 1, 1, 3, 2 };
@@ -313,15 +313,15 @@ static void asic3_compute_hold(running_machine *machine)
READ16_HANDLER( pgm_asic3_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT8 res = 0;
/* region is supplied by the protection device */
switch (state->asic3_reg)
{
- case 0x00: res = (state->asic3_latch[0] & 0xf7) | ((input_port_read(space->machine, "Region") << 3) & 0x08); break;
+ case 0x00: res = (state->asic3_latch[0] & 0xf7) | ((input_port_read(space->machine(), "Region") << 3) & 0x08); break;
case 0x01: res = state->asic3_latch[1]; break;
- case 0x02: res = (state->asic3_latch[2] & 0x7f) | ((input_port_read(space->machine, "Region") << 6) & 0x80); break;
+ case 0x02: res = (state->asic3_latch[2] & 0x7f) | ((input_port_read(space->machine(), "Region") << 6) & 0x80); break;
case 0x03:
res = (BIT(state->asic3_hold, 15) << 0)
| (BIT(state->asic3_hold, 12) << 1)
@@ -357,7 +357,7 @@ READ16_HANDLER( pgm_asic3_r )
WRITE16_HANDLER( pgm_asic3_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if(ACCESSING_BITS_0_7)
{
@@ -386,14 +386,14 @@ WRITE16_HANDLER( pgm_asic3_w )
{
state->asic3_y = state->asic3_reg & 7;
state->asic3_z = data;
- asic3_compute_hold(space->machine);
+ asic3_compute_hold(space->machine());
}
}
}
WRITE16_HANDLER( pgm_asic3_reg_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if(ACCESSING_BITS_0_7)
state->asic3_reg = data & 0xff;
@@ -432,7 +432,7 @@ READ16_HANDLER( sango_protram_r )
// 5 = world
if (offset == 4)
- return input_port_read(space->machine, "Region");
+ return input_port_read(space->machine(), "Region");
// otherwise it doesn't seem to use the ram for anything important, we return 0 to avoid test mode corruption
// kovplus reads from offset 000e a lot ... why?
@@ -457,7 +457,7 @@ READ16_HANDLER( sango_protram_r )
READ16_HANDLER( asic28_r )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
UINT32 val = (state->asic28_regs[1] << 16) | (state->asic28_regs[0]);
//logerror("Asic28 Read PC = %06x Command = %02x ??\n", cpu_get_pc(space->cpu), state->asic28_regs[1]);
@@ -599,7 +599,7 @@ READ16_HANDLER( asic28_r )
WRITE16_HANDLER( asic28_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
if (offset == 0)
{
diff --git a/src/mame/machine/pitnrun.c b/src/mame/machine/pitnrun.c
index 5dbca22aecb..5a568b098bf 100644
--- a/src/mame/machine/pitnrun.c
+++ b/src/mame/machine/pitnrun.c
@@ -14,7 +14,7 @@
MACHINE_RESET( pitnrun )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->zaccept = 1;
state->zready = 0;
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
@@ -22,20 +22,20 @@ MACHINE_RESET( pitnrun )
static TIMER_CALLBACK( pitnrun_mcu_real_data_r )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->zaccept = 1;
}
READ8_HANDLER( pitnrun_mcu_data_r )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
- space->machine->scheduler().synchronize(FUNC(pitnrun_mcu_real_data_r));
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
+ space->machine().scheduler().synchronize(FUNC(pitnrun_mcu_real_data_r));
return state->toz80;
}
static TIMER_CALLBACK( pitnrun_mcu_real_data_w )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->zready = 1;
cputag_set_input_line(machine, "mcu", 0, ASSERT_LINE);
state->fromz80 = param;
@@ -43,13 +43,13 @@ static TIMER_CALLBACK( pitnrun_mcu_real_data_w )
WRITE8_HANDLER( pitnrun_mcu_data_w )
{
- space->machine->scheduler().synchronize(FUNC(pitnrun_mcu_real_data_w), data);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
+ space->machine().scheduler().synchronize(FUNC(pitnrun_mcu_real_data_w), data);
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
}
READ8_HANDLER( pitnrun_mcu_status_r )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
/* mcu synchronization */
/* bit 0 = the 68705 has read data from the Z80 */
/* bit 1 = the 68705 has written data for the Z80 */
@@ -59,13 +59,13 @@ READ8_HANDLER( pitnrun_mcu_status_r )
READ8_HANDLER( pitnrun_68705_portA_r )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
return state->portA_in;
}
WRITE8_HANDLER( pitnrun_68705_portA_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->portA_out = data;
}
@@ -97,32 +97,32 @@ READ8_HANDLER( pitnrun_68705_portB_r )
static TIMER_CALLBACK( pitnrun_mcu_data_real_r )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->zready = 0;
}
static TIMER_CALLBACK( pitnrun_mcu_status_real_w )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->toz80 = param;
state->zaccept = 0;
}
WRITE8_HANDLER( pitnrun_68705_portB_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
- address_space *cpu0space = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
+ address_space *cpu0space = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
if (~data & 0x02)
{
/* 68705 is going to read data from the Z80 */
- space->machine->scheduler().synchronize(FUNC(pitnrun_mcu_data_real_r));
- cputag_set_input_line(space->machine, "mcu",0,CLEAR_LINE);
+ space->machine().scheduler().synchronize(FUNC(pitnrun_mcu_data_real_r));
+ cputag_set_input_line(space->machine(), "mcu",0,CLEAR_LINE);
state->portA_in = state->fromz80;
}
if (~data & 0x04)
{
/* 68705 is writing data for the Z80 */
- space->machine->scheduler().synchronize(FUNC(pitnrun_mcu_status_real_w), state->portA_out);
+ space->machine().scheduler().synchronize(FUNC(pitnrun_mcu_status_real_w), state->portA_out);
}
if (~data & 0x10)
{
@@ -154,6 +154,6 @@ WRITE8_HANDLER( pitnrun_68705_portB_w )
READ8_HANDLER( pitnrun_68705_portC_r )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
return (state->zready << 0) | (state->zaccept << 1);
}
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index ef247b248a1..73c6caf68e6 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -10,8 +10,8 @@ static WRITE8_HANDLER( pc10_nt_w );
static READ8_HANDLER( pc10_nt_r );
static WRITE8_HANDLER( pc10_chr_w );
static READ8_HANDLER( pc10_chr_r );
-static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size );
-static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size );
+static void pc10_set_videorom_bank( running_machine &machine, int first, int count, int bank, int size );
+static void set_videoram_bank( running_machine &machine, int first, int count, int bank, int size );
/*************************************
@@ -22,8 +22,8 @@ static void set_videoram_bank( running_machine *machine, int first, int count, i
MACHINE_RESET( pc10 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- device_t *rp5h01 = machine->device("rp5h01");
+ playch10_state *state = machine.driver_data<playch10_state>();
+ device_t *rp5h01 = machine.device("rp5h01");
/* initialize latches and flip-flops */
state->pc10_nmi_enable = state->pc10_dog_di = state->pc10_dispmask = state->pc10_sdcs = state->pc10_int_detect = 0;
@@ -50,29 +50,29 @@ MACHINE_RESET( pc10 )
MACHINE_START( pc10 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- state->vrom = machine->region("gfx2")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ state->vrom = machine.region("gfx2")->base();
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(pc10_chr_r), FUNC(pc10_chr_w));
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(pc10_nt_r), FUNC(pc10_nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(pc10_chr_r), FUNC(pc10_chr_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(pc10_nt_r), FUNC(pc10_nt_w));
if (NULL != state->vram)
set_videoram_bank(machine, 0, 8, 0, 8);
else pc10_set_videorom_bank(machine, 0, 8, 0, 8);
- nvram_device *nvram = machine->device<nvram_device>("nvram");
+ nvram_device *nvram = machine.device<nvram_device>("nvram");
if (nvram != NULL)
- nvram->set_base(machine->region("cart" )->base() + 0x6000, 0x1000);
+ nvram->set_base(machine.region("cart" )->base() + 0x6000, 0x1000);
}
MACHINE_START( playch10_hboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- state->vrom = machine->region("gfx2")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ state->vrom = machine.region("gfx2")->base();
/* allocate 4K of nametable ram here */
/* move to individual boards as documentation of actual boards allows */
@@ -81,8 +81,8 @@ MACHINE_START( playch10_hboard )
state->vram = auto_alloc_array(machine, UINT8, 0x2000);
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(pc10_chr_r), FUNC(pc10_chr_w));
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(pc10_nt_r), FUNC(pc10_nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(pc10_chr_r), FUNC(pc10_chr_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(pc10_nt_r), FUNC(pc10_nt_w));
}
/*************************************
@@ -93,13 +93,13 @@ MACHINE_START( playch10_hboard )
CUSTOM_INPUT( pc10_int_detect_r )
{
- playch10_state *state = field->port->machine->driver_data<playch10_state>();
+ playch10_state *state = field->port->machine().driver_data<playch10_state>();
return ~state->pc10_int_detect & 1;
}
WRITE8_HANDLER( pc10_SDCS_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
/*
Hooked to CLR on LS194A - Sheet 2, bottom left.
Drives character and color code to 0.
@@ -111,13 +111,13 @@ WRITE8_HANDLER( pc10_SDCS_w )
WRITE8_HANDLER( pc10_CNTRLMASK_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->cntrl_mask = ~data & 1;
}
WRITE8_HANDLER( pc10_DISPMASK_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->pc10_dispmask = ~data & 1;
}
@@ -128,35 +128,35 @@ WRITE8_HANDLER( pc10_SOUNDMASK_w )
WRITE8_HANDLER( pc10_NMIENABLE_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->pc10_nmi_enable = data & 1;
}
WRITE8_HANDLER( pc10_DOGDI_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->pc10_dog_di = data & 1;
}
WRITE8_HANDLER( pc10_GAMERES_w )
{
- cputag_set_input_line(space->machine, "cart", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
+ cputag_set_input_line(space->machine(), "cart", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
}
WRITE8_HANDLER( pc10_GAMESTOP_w )
{
- cputag_set_input_line(space->machine, "cart", INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
+ cputag_set_input_line(space->machine(), "cart", INPUT_LINE_HALT, (data & 1) ? CLEAR_LINE : ASSERT_LINE );
}
WRITE8_HANDLER( pc10_PPURES_w )
{
if (data & 1)
- devtag_reset(space->machine, "ppu");
+ devtag_reset(space->machine(), "ppu");
}
READ8_HANDLER( pc10_detectclr_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->pc10_int_detect = 0;
return 0;
@@ -164,7 +164,7 @@ READ8_HANDLER( pc10_detectclr_r )
WRITE8_HANDLER( pc10_CARTSEL_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
state->cart_sel &= ~(1 << offset);
state->cart_sel |= (data & 1) << offset;
}
@@ -178,8 +178,8 @@ WRITE8_HANDLER( pc10_CARTSEL_w )
READ8_HANDLER( pc10_prot_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
- device_t *rp5h01 = space->machine->device("rp5h01");
+ playch10_state *state = space->machine().driver_data<playch10_state>();
+ device_t *rp5h01 = space->machine().device("rp5h01");
int data = 0xe7;
/* we only support a single cart connected at slot 0 */
@@ -195,8 +195,8 @@ READ8_HANDLER( pc10_prot_r )
WRITE8_HANDLER( pc10_prot_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
- device_t *rp5h01 = space->machine->device("rp5h01");
+ playch10_state *state = space->machine().driver_data<playch10_state>();
+ device_t *rp5h01 = space->machine().device("rp5h01");
/* we only support a single cart connected at slot 0 */
if (state->cart_sel == 0)
{
@@ -211,7 +211,7 @@ WRITE8_HANDLER( pc10_prot_w )
/* is the actual protection memory area */
/* setting the whole 0x2000 region every time is a waste */
/* so we just set $ffff with the current value */
- space->machine->region("maincpu")->base()[0xffff] = pc10_prot_r(space, 0);
+ space->machine().region("maincpu")->base()[0xffff] = pc10_prot_r(space, 0);
}
}
@@ -224,14 +224,14 @@ WRITE8_HANDLER( pc10_prot_w )
WRITE8_HANDLER( pc10_in0_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
/* Toggling bit 0 high then low resets both controllers */
if (data & 1)
return;
/* load up the latches */
- state->input_latch[0] = input_port_read(space->machine, "P1");
- state->input_latch[1] = input_port_read(space->machine, "P2");
+ state->input_latch[0] = input_port_read(space->machine(), "P1");
+ state->input_latch[1] = input_port_read(space->machine(), "P2");
/* apply any masking from the BIOS */
if (state->cntrl_mask)
@@ -243,7 +243,7 @@ WRITE8_HANDLER( pc10_in0_w )
READ8_HANDLER( pc10_in0_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int ret = (state->input_latch[0]) & 1;
/* shift */
@@ -258,7 +258,7 @@ READ8_HANDLER( pc10_in0_r )
READ8_HANDLER( pc10_in1_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int ret = (state->input_latch[1]) & 1;
/* shift */
@@ -267,10 +267,10 @@ READ8_HANDLER( pc10_in1_r )
/* do the gun thing */
if (state->pc10_gun_controller)
{
- device_t *ppu = space->machine->device("ppu");
- int trigger = input_port_read(space->machine, "P1");
- int x = input_port_read(space->machine, "GUNX");
- int y = input_port_read(space->machine, "GUNY");
+ device_t *ppu = space->machine().device("ppu");
+ int trigger = input_port_read(space->machine(), "P1");
+ int x = input_port_read(space->machine(), "GUNX");
+ int y = input_port_read(space->machine(), "GUNY");
UINT32 pix, color_base;
/* no sprite hit (yet) */
@@ -310,21 +310,21 @@ READ8_HANDLER( pc10_in1_r )
static WRITE8_HANDLER( pc10_nt_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int page = ((offset & 0xc00) >> 10);
state->nametable[page][offset & 0x3ff] = data;
}
static READ8_HANDLER( pc10_nt_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int page = ((offset & 0xc00) >> 10);
return state->nametable[page][offset & 0x3ff];
}
static WRITE8_HANDLER( pc10_chr_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int bank = offset >> 10;
if (state->chr_page[bank].writable)
{
@@ -334,7 +334,7 @@ static WRITE8_HANDLER( pc10_chr_w )
static READ8_HANDLER( pc10_chr_r )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int bank = offset >> 10;
return state->chr_page[bank].chr[offset & 0x3ff];
}
@@ -379,9 +379,9 @@ static void pc10_set_mirroring( playch10_state *state, int mirroring )
* 64 1 *
\*****************/
-static void pc10_set_videorom_bank( running_machine *machine, int first, int count, int bank, int size )
+static void pc10_set_videorom_bank( running_machine &machine, int first, int count, int bank, int size )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
int i, len;
/* first = first bank to map */
/* count = number of 1K banks to map */
@@ -392,7 +392,7 @@ static void pc10_set_videorom_bank( running_machine *machine, int first, int cou
/* yeah, this is probably a horrible assumption to make.*/
/* but the driver is 100% consistant */
- len = machine->region("gfx2")->bytes();
+ len = machine.region("gfx2")->bytes();
len /= 0x400; // convert to KB
len /= size; // convert to bank resolution
len--; // convert to mask
@@ -405,9 +405,9 @@ static void pc10_set_videorom_bank( running_machine *machine, int first, int cou
}
}
-static void set_videoram_bank( running_machine *machine, int first, int count, int bank, int size )
+static void set_videoram_bank( running_machine &machine, int first, int count, int bank, int size )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
int i;
/* first = first bank to map */
/* count = number of 1K banks to map */
@@ -434,7 +434,7 @@ static void set_videoram_bank( running_machine *machine, int first, int count, i
DRIVER_INIT( playch10 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
state->vram = NULL;
/* set the controller to default */
@@ -454,7 +454,7 @@ DRIVER_INIT( playch10 )
DRIVER_INIT( pc_gun )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -470,7 +470,7 @@ DRIVER_INIT( pc_gun )
DRIVER_INIT( pc_hrz )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -483,7 +483,7 @@ DRIVER_INIT( pc_hrz )
static WRITE8_HANDLER( mmc1_rom_switch_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
/* basically, a MMC1 mapper from the nes */
static int size16k, switchlow, vrom4k;
@@ -553,25 +553,25 @@ static WRITE8_HANDLER( mmc1_rom_switch_w )
case 1: /* video rom banking - bank 0 - 4k or 8k */
if (state->vram)
- set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
+ set_videoram_bank(space->machine(), 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
else
- pc10_set_videorom_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
+ pc10_set_videorom_bank(space->machine(), 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
break;
case 2: /* video rom banking - bank 1 - 4k only */
if (vrom4k)
{
if (state->vram)
- set_videoram_bank(space->machine, 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
+ set_videoram_bank(space->machine(), 0, (vrom4k) ? 4 : 8, (state->mmc1_shiftreg & 0x1f), 4);
else
- pc10_set_videorom_bank(space->machine, 4, 4, (state->mmc1_shiftreg & 0x1f), 4);
+ pc10_set_videorom_bank(space->machine(), 4, 4, (state->mmc1_shiftreg & 0x1f), 4);
}
break;
case 3: /* program banking */
{
int bank = (state->mmc1_shiftreg & state->mmc1_rom_mask) * 0x4000;
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
if (!size16k)
{
@@ -603,14 +603,14 @@ static WRITE8_HANDLER( mmc1_rom_switch_w )
static WRITE8_HANDLER( aboard_vrom_switch_w )
{
- pc10_set_videorom_bank(space->machine, 0, 8, (data & 3), 8);
+ pc10_set_videorom_bank(space->machine(), 0, 8, (data & 3), 8);
}
DRIVER_INIT( pcaboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* switches vrom with writes to the $803e-$8041 area */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8fff, FUNC(aboard_vrom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8fff, FUNC(aboard_vrom_switch_w) );
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -628,22 +628,22 @@ DRIVER_INIT( pcaboard )
static WRITE8_HANDLER( bboard_rom_switch_w )
{
int bankoffset = 0x10000 + ((data & 7) * 0x4000);
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
memcpy(&prg[0x08000], &prg[bankoffset], 0x4000);
}
DRIVER_INIT( pcbboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
/* Roms are banked at $8000 to $bfff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(bboard_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(bboard_rom_switch_w) );
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -662,14 +662,14 @@ DRIVER_INIT( pcbboard )
static WRITE8_HANDLER( cboard_vrom_switch_w )
{
- pc10_set_videorom_bank(space->machine, 0, 8, ((data >> 1) & 1), 8);
+ pc10_set_videorom_bank(space->machine(), 0, 8, ((data >> 1) & 1), 8);
}
DRIVER_INIT( pccboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* switches vrom with writes to $6000 */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0x6000, FUNC(cboard_vrom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0x6000, FUNC(cboard_vrom_switch_w) );
/* we have no vram, make sure switching games doesn't point to an old allocation */
state->vram = NULL;
@@ -683,8 +683,8 @@ DRIVER_INIT( pccboard )
DRIVER_INIT( pcdboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
@@ -693,7 +693,7 @@ DRIVER_INIT( pcdboard )
state->mmc1_rom_mask = 0x07;
/* MMC mapper at writes to $8000-$ffff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
/* common init */
@@ -708,9 +708,9 @@ DRIVER_INIT( pcdboard )
DRIVER_INIT( pcdboard_2 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* extra ram at $6000-$7fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
/* common init */
DRIVER_INIT_CALL(pcdboard);
@@ -727,40 +727,40 @@ DRIVER_INIT( pcdboard_2 )
/* callback for the ppu_latch */
static void mapper9_latch( device_t *ppu, offs_t offset )
{
- playch10_state *state = ppu->machine->driver_data<playch10_state>();
+ playch10_state *state = ppu->machine().driver_data<playch10_state>();
if((offset & 0x1ff0) == 0x0fd0 && state->MMC2_bank_latch[0] != 0xfd)
{
state->MMC2_bank_latch[0] = 0xfd;
- pc10_set_videorom_bank(ppu->machine, 0, 4, state->MMC2_bank[0], 4);
+ pc10_set_videorom_bank(ppu->machine(), 0, 4, state->MMC2_bank[0], 4);
}
else if((offset & 0x1ff0) == 0x0fe0 && state->MMC2_bank_latch[0] != 0xfe)
{
state->MMC2_bank_latch[0] = 0xfe;
- pc10_set_videorom_bank(ppu->machine, 0, 4, state->MMC2_bank[1], 4);
+ pc10_set_videorom_bank(ppu->machine(), 0, 4, state->MMC2_bank[1], 4);
}
else if((offset & 0x1ff0) == 0x1fd0 && state->MMC2_bank_latch[1] != 0xfd)
{
state->MMC2_bank_latch[1] = 0xfd;
- pc10_set_videorom_bank(ppu->machine, 4, 4, state->MMC2_bank[2], 4);
+ pc10_set_videorom_bank(ppu->machine(), 4, 4, state->MMC2_bank[2], 4);
}
else if((offset & 0x1ff0) == 0x1fe0 && state->MMC2_bank_latch[1] != 0xfe)
{
state->MMC2_bank_latch[1] = 0xfe;
- pc10_set_videorom_bank(ppu->machine, 4, 4, state->MMC2_bank[3], 4);
+ pc10_set_videorom_bank(ppu->machine(), 4, 4, state->MMC2_bank[3], 4);
}
}
static WRITE8_HANDLER( eboard_rom_switch_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
/* a variation of mapper 9 on a nes */
switch (offset & 0x7000)
{
case 0x2000: /* code bank switching */
{
int bankoffset = 0x10000 + (data & 0x0f) * 0x2000;
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
memcpy(&prg[0x08000], &prg[bankoffset], 0x2000);
}
break;
@@ -768,25 +768,25 @@ static WRITE8_HANDLER( eboard_rom_switch_w )
case 0x3000: /* gfx bank 0 - 4k */
state->MMC2_bank[0] = data;
if (state->MMC2_bank_latch[0] == 0xfd)
- pc10_set_videorom_bank(space->machine, 0, 4, data, 4);
+ pc10_set_videorom_bank(space->machine(), 0, 4, data, 4);
break;
case 0x4000: /* gfx bank 0 - 4k */
state->MMC2_bank[1] = data;
if (state->MMC2_bank_latch[0] == 0xfe)
- pc10_set_videorom_bank(space->machine, 0, 4, data, 4);
+ pc10_set_videorom_bank(space->machine(), 0, 4, data, 4);
break;
case 0x5000: /* gfx bank 1 - 4k */
state->MMC2_bank[2] = data;
if (state->MMC2_bank_latch[1] == 0xfd)
- pc10_set_videorom_bank(space->machine, 4, 4, data, 4);
+ pc10_set_videorom_bank(space->machine(), 4, 4, data, 4);
break;
case 0x6000: /* gfx bank 1 - 4k */
state->MMC2_bank[3] = data;
if (state->MMC2_bank_latch[1] == 0xfe)
- pc10_set_videorom_bank(space->machine, 4, 4, data, 4);
+ pc10_set_videorom_bank(space->machine(), 4, 4, data, 4);
break;
case 0x7000: /* mirroring */
@@ -798,8 +798,8 @@ static WRITE8_HANDLER( eboard_rom_switch_w )
DRIVER_INIT( pceboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* we have no vram, make sure switching games doesn't point to an old allocation */
state->vram = NULL;
@@ -809,13 +809,13 @@ DRIVER_INIT( pceboard )
memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
/* basically a mapper 9 on a nes */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(eboard_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(eboard_rom_switch_w) );
/* ppu_latch callback */
- ppu2c0x_set_latch(machine->device("ppu"), mapper9_latch);
+ ppu2c0x_set_latch(machine.device("ppu"), mapper9_latch);
/* nvram at $6000-$6fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x6fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x6fff);
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -826,8 +826,8 @@ DRIVER_INIT( pceboard )
DRIVER_INIT( pcfboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* we have no vram, make sure switching games doesn't point to an old allocation */
state->vram = NULL;
@@ -839,7 +839,7 @@ DRIVER_INIT( pcfboard )
state->mmc1_rom_mask = 0x07;
/* MMC mapper at writes to $8000-$ffff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -849,9 +849,9 @@ DRIVER_INIT( pcfboard )
DRIVER_INIT( pcfboard_2 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
/* extra ram at $6000-$6fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x6fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x6fff);
state->vram = NULL;
@@ -865,21 +865,21 @@ DRIVER_INIT( pcfboard_2 )
static void gboard_scanline_cb( device_t *device, int scanline, int vblank, int blanked )
{
- playch10_state *state = device->machine->driver_data<playch10_state>();
+ playch10_state *state = device->machine().driver_data<playch10_state>();
if (!vblank && !blanked)
{
if (--state->gboard_scanline_counter == -1)
{
state->gboard_scanline_counter = state->gboard_scanline_latch;
- generic_pulse_irq_line(device->machine->device("cart"), 0);
+ generic_pulse_irq_line(device->machine().device("cart"), 0);
}
}
}
static WRITE8_HANDLER( gboard_rom_switch_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
- device_t *ppu = space->machine->device("ppu");
+ playch10_state *state = space->machine().driver_data<playch10_state>();
+ device_t *ppu = space->machine().device("ppu");
/* basically, a MMC3 mapper from the nes */
@@ -891,7 +891,7 @@ static WRITE8_HANDLER( gboard_rom_switch_w )
if (state->gboard_last_bank != (data & 0xc0))
{
int bank;
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
/* reset the banks */
if (state->gboard_command & 0x40)
@@ -931,7 +931,7 @@ static WRITE8_HANDLER( gboard_rom_switch_w )
case 1: /* char banking */
data &= 0xfe;
page ^= (cmd << 1);
- pc10_set_videorom_bank(space->machine, page, 2, data, 1);
+ pc10_set_videorom_bank(space->machine(), page, 2, data, 1);
break;
case 2: /* char banking */
@@ -939,12 +939,12 @@ static WRITE8_HANDLER( gboard_rom_switch_w )
case 4: /* char banking */
case 5: /* char banking */
page ^= cmd + 2;
- pc10_set_videorom_bank(space->machine, page, 1, data, 1);
+ pc10_set_videorom_bank(space->machine(), page, 1, data, 1);
break;
case 6: /* program banking */
{
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
if (state->gboard_command & 0x40)
{
/* high bank */
@@ -969,7 +969,7 @@ static WRITE8_HANDLER( gboard_rom_switch_w )
case 7: /* program banking */
{
/* mid bank */
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
state->gboard_banks[1] = data & 0x1f;
bank = state->gboard_banks[1] * 0x2000 + 0x10000;
@@ -1014,8 +1014,8 @@ static WRITE8_HANDLER( gboard_rom_switch_w )
DRIVER_INIT( pcgboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
state->vram = NULL;
/* We do manual banking, in case the code falls through */
@@ -1024,10 +1024,10 @@ DRIVER_INIT( pcgboard )
memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000);
/* MMC3 mapper at writes to $8000-$ffff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(gboard_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(gboard_rom_switch_w) );
/* extra ram at $6000-$7fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
state->gboard_banks[0] = 0x1e;
state->gboard_banks[1] = 0x1f;
@@ -1041,7 +1041,7 @@ DRIVER_INIT( pcgboard )
DRIVER_INIT( pcgboard_type2 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
state->vram = NULL;
/* common init */
DRIVER_INIT_CALL(pcgboard);
@@ -1055,9 +1055,9 @@ DRIVER_INIT( pcgboard_type2 )
static WRITE8_HANDLER( iboard_rom_switch_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
int bank = data & 7;
- UINT8 *prg = space->machine->region("cart")->base();
+ UINT8 *prg = space->machine().region("cart")->base();
if (data & 0x10)
pc10_set_mirroring(state, PPU_MIRROR_HIGH);
@@ -1069,15 +1069,15 @@ static WRITE8_HANDLER( iboard_rom_switch_w )
DRIVER_INIT( pciboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
memcpy(&prg[0x08000], &prg[0x10000], 0x8000);
/* Roms are banked at $8000 to $bfff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(iboard_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(iboard_rom_switch_w) );
/* common init */
DRIVER_INIT_CALL(playch10);
@@ -1093,7 +1093,7 @@ DRIVER_INIT( pciboard )
static WRITE8_HANDLER( hboard_rom_switch_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
switch (offset & 0x7001)
{
case 0x0001:
@@ -1109,11 +1109,11 @@ static WRITE8_HANDLER( hboard_rom_switch_w )
page ^= (cmd << 1);
if (data & 0x40)
{
- set_videoram_bank(space->machine, page, 2, data, 1);
+ set_videoram_bank(space->machine(), page, 2, data, 1);
}
else
{
- pc10_set_videorom_bank(space->machine, page, 2, data, 1);
+ pc10_set_videorom_bank(space->machine(), page, 2, data, 1);
}
return;
@@ -1124,11 +1124,11 @@ static WRITE8_HANDLER( hboard_rom_switch_w )
page ^= cmd + 2;
if (data & 0x40)
{
- set_videoram_bank(space->machine, page, 1, data, 1);
+ set_videoram_bank(space->machine(), page, 1, data, 1);
}
else
{
- pc10_set_videorom_bank(space->machine, page, 1, data, 1);
+ pc10_set_videorom_bank(space->machine(), page, 1, data, 1);
}
return;
}
@@ -1140,16 +1140,16 @@ static WRITE8_HANDLER( hboard_rom_switch_w )
DRIVER_INIT( pchboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
memcpy(&prg[0x08000], &prg[0x4c000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x4c000], 0x4000);
/* Roms are banked at $8000 to $bfff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(hboard_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(hboard_rom_switch_w) );
/* extra ram at $6000-$7fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
state->gboard_banks[0] = 0x1e;
state->gboard_banks[1] = 0x1f;
@@ -1167,8 +1167,8 @@ DRIVER_INIT( pchboard )
DRIVER_INIT( pckboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- UINT8 *prg = machine->region("cart")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ UINT8 *prg = machine.region("cart")->base();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
@@ -1177,10 +1177,10 @@ DRIVER_INIT( pckboard )
state->mmc1_rom_mask = 0x0f;
/* extra ram at $6000-$7fff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
/* Roms are banked at $8000 to $bfff */
- machine->device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
+ machine.device("cart")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mmc1_rom_switch_w) );
/* common init */
DRIVER_INIT_CALL(playch10);
diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c
index e7c1408fe64..352a44a5684 100644
--- a/src/mame/machine/psx.c
+++ b/src/mame/machine/psx.c
@@ -108,7 +108,9 @@ struct _psx_mdec
struct _psx_machine
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
UINT32 *p_n_psxram;
size_t n_psxramsize;
@@ -137,7 +139,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( psx_machine *p_psx, int n_level, const
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", p_psx->machine->describe_context(), buf );
+ logerror( "%s: %s", p_psx->machine().describe_context(), buf );
}
}
@@ -155,7 +157,7 @@ INLINE UINT16 psxreadword( UINT32 *p_n_psxram, UINT32 n_address )
WRITE32_HANDLER( psx_com_delay_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
COMBINE_DATA( &p_psx->n_com_delay );
verboselog( p_psx, 1, "psx_com_delay_w( %08x %08x )\n", data, mem_mask );
@@ -163,7 +165,7 @@ WRITE32_HANDLER( psx_com_delay_w )
READ32_HANDLER( psx_com_delay_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
verboselog( p_psx, 1, "psx_com_delay_r( %08x )\n", mem_mask );
return p_psx->n_com_delay;
@@ -176,18 +178,18 @@ static void psx_irq_update( psx_machine *p_psx )
if( ( p_psx->n_irqdata & p_psx->n_irqmask ) != 0 )
{
verboselog( p_psx, 2, "psx irq assert\n" );
- cputag_set_input_line( p_psx->machine, "maincpu", PSXCPU_IRQ0, ASSERT_LINE );
+ cputag_set_input_line( p_psx->machine(), "maincpu", PSXCPU_IRQ0, ASSERT_LINE );
}
else
{
verboselog( p_psx, 2, "psx irq clear\n" );
- cputag_set_input_line( p_psx->machine, "maincpu", PSXCPU_IRQ0, CLEAR_LINE );
+ cputag_set_input_line( p_psx->machine(), "maincpu", PSXCPU_IRQ0, CLEAR_LINE );
}
}
WRITE32_HANDLER( psx_irq_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
switch( offset )
{
@@ -213,7 +215,7 @@ WRITE32_HANDLER( psx_irq_w )
READ32_HANDLER( psx_irq_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
switch( offset )
{
@@ -230,9 +232,9 @@ READ32_HANDLER( psx_irq_r )
return 0;
}
-void psx_irq_set( running_machine *machine, UINT32 data )
+void psx_irq_set( running_machine &machine, UINT32 data )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
verboselog( p_psx, 2, "psx_irq_set %08x\n", data );
p_psx->n_irqdata |= data;
@@ -284,7 +286,7 @@ static void dma_interrupt_update( psx_machine *p_psx )
{
verboselog( p_psx, 2, "dma_interrupt_update( %02x, %02x ) interrupt triggered\n", n_int, n_mask );
p_psx->n_dicr |= 0x80000000;
- psx_irq_set( p_psx->machine, PSX_IRQ_DMA );
+ psx_irq_set( p_psx->machine(), PSX_IRQ_DMA );
}
else if( n_int != 0 )
{
@@ -329,7 +331,7 @@ static void dma_finished(psx_machine *p_psx, int n_channel)
n_address &= n_adrmask;
n_nextaddress = p_n_psxram[ n_address / 4 ];
n_size = n_nextaddress >> 24;
- (*dma->fn_write)( p_psx->machine, n_address + 4, n_size );
+ (*dma->fn_write)( p_psx->machine(), n_address + 4, n_size );
//FIXME:
// The following conditions will cause an endless loop.
// If stopping the transfer is correct I cannot judge
@@ -357,28 +359,28 @@ static void dma_finished(psx_machine *p_psx, int n_channel)
static TIMER_CALLBACK( dma_finished_callback )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
dma_finished(p_psx, param);
}
-void psx_dma_install_read_handler( running_machine *machine, int n_channel, psx_dma_read_handler p_fn_dma_read )
+void psx_dma_install_read_handler( running_machine &machine, int n_channel, psx_dma_read_handler p_fn_dma_read )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
p_psx->channel[ n_channel ].fn_read = p_fn_dma_read;
}
-void psx_dma_install_write_handler( running_machine *machine, int n_channel, psx_dma_read_handler p_fn_dma_write )
+void psx_dma_install_write_handler( running_machine &machine, int n_channel, psx_dma_read_handler p_fn_dma_write )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
p_psx->channel[ n_channel ].fn_write = p_fn_dma_write;
}
WRITE32_HANDLER( psx_dma_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
UINT32 *p_n_psxram = p_psx->p_n_psxram;
int n_channel = offset / 4;
psx_dma_channel *dma = &p_psx->channel[ n_channel ];
@@ -424,7 +426,7 @@ WRITE32_HANDLER( psx_dma_w )
dma->fn_read != NULL )
{
verboselog( p_psx, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size );
- (*dma->fn_read)( space->machine, n_address, n_size );
+ (*dma->fn_read)( space->machine(), n_address, n_size );
dma_finished( p_psx, n_channel );
}
else if( dma->n_channelcontrol == 0x11000000 && // CD DMA
@@ -437,14 +439,14 @@ WRITE32_HANDLER( psx_dma_w )
oursize = (oursize > 1) ? oursize : 1;
oursize *= (dma->n_blockcontrol&0xffff);
- (*dma->fn_read)( space->machine, n_address, oursize );
+ (*dma->fn_read)( space->machine(), n_address, oursize );
dma_finished( p_psx, n_channel );
}
else if( dma->n_channelcontrol == 0x01000200 &&
dma->fn_read != NULL )
{
verboselog( p_psx, 1, "dma %d read block %08x %08x\n", n_channel, n_address, n_size );
- (*dma->fn_read)( space->machine, n_address, n_size );
+ (*dma->fn_read)( space->machine(), n_address, n_size );
if( n_channel == 1 )
{
dma_start_timer( p_psx, n_channel, 26000 );
@@ -458,7 +460,7 @@ WRITE32_HANDLER( psx_dma_w )
dma->fn_write != NULL )
{
verboselog( p_psx, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- (*dma->fn_write)( space->machine, n_address, n_size );
+ (*dma->fn_write)( space->machine(), n_address, n_size );
dma_finished( p_psx, n_channel );
}
else if( dma->n_channelcontrol == 0x11050100 &&
@@ -466,7 +468,7 @@ WRITE32_HANDLER( psx_dma_w )
{
/* todo: check this is a write not a read... */
verboselog( p_psx, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- (*dma->fn_write)( space->machine, n_address, n_size );
+ (*dma->fn_write)( space->machine(), n_address, n_size );
dma_finished( p_psx, n_channel );
}
else if( dma->n_channelcontrol == 0x11150100 &&
@@ -474,7 +476,7 @@ WRITE32_HANDLER( psx_dma_w )
{
/* todo: check this is a write not a read... */
verboselog( p_psx, 1, "dma %d write block %08x %08x\n", n_channel, n_address, n_size );
- (*dma->fn_write)( space->machine, n_address, n_size );
+ (*dma->fn_write)( space->machine(), n_address, n_size );
dma_finished( p_psx, n_channel );
}
else if( dma->n_channelcontrol == 0x01000401 &&
@@ -551,7 +553,7 @@ WRITE32_HANDLER( psx_dma_w )
READ32_HANDLER( psx_dma_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
int n_channel = offset / 4;
psx_dma_channel *dma = &p_psx->channel[ n_channel ];
@@ -596,7 +598,7 @@ READ32_HANDLER( psx_dma_r )
static UINT64 psxcpu_gettotalcycles( psx_machine *p_psx )
{
/* TODO: should return the start of the current tick. */
- return p_psx->machine->firstcpu->total_cycles() * 2;
+ return p_psx->machine().firstcpu->total_cycles() * 2;
}
static int root_divider( psx_machine *p_psx, int n_counter )
@@ -681,7 +683,7 @@ static void root_timer_adjust( psx_machine *p_psx, int n_counter )
static TIMER_CALLBACK( root_finished )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
int n_counter = param;
psx_root *root = &p_psx->root[ n_counter ];
@@ -705,7 +707,7 @@ static TIMER_CALLBACK( root_finished )
WRITE32_HANDLER( psx_counter_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
int n_counter = offset / 4;
psx_root *root = &p_psx->root[ n_counter ];
@@ -751,7 +753,7 @@ WRITE32_HANDLER( psx_counter_w )
READ32_HANDLER( psx_counter_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
int n_counter = offset / 4;
psx_root *root = &p_psx->root[ n_counter ];
UINT32 data;
@@ -785,11 +787,11 @@ static void sio_interrupt( psx_machine *p_psx, int n_port )
sio->n_status |= SIO_STATUS_IRQ;
if( n_port == 0 )
{
- psx_irq_set( p_psx->machine, PSX_IRQ_SIO0 );
+ psx_irq_set( p_psx->machine(), PSX_IRQ_SIO0 );
}
else
{
- psx_irq_set( p_psx->machine, PSX_IRQ_SIO1 );
+ psx_irq_set( p_psx->machine(), PSX_IRQ_SIO1 );
}
}
@@ -839,7 +841,7 @@ static void sio_timer_adjust( psx_machine *p_psx, int n_port )
static TIMER_CALLBACK( sio_clock )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
int n_port = param;
psx_sio *sio = &p_psx->sio[ n_port ];
verboselog( p_psx, 2, "sio tick\n" );
@@ -909,9 +911,9 @@ static TIMER_CALLBACK( sio_clock )
sio_timer_adjust( p_psx, n_port );
}
-void psx_sio_input( running_machine *machine, int n_port, int n_mask, int n_data )
+void psx_sio_input( running_machine &machine, int n_port, int n_mask, int n_data )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
psx_sio *sio = &p_psx->sio[ n_port ];
verboselog( p_psx, 1, "psx_sio_input( %d, %02x, %02x )\n", n_port, n_mask, n_data );
sio->n_rx = ( sio->n_rx & ~n_mask ) | ( n_data & n_mask );
@@ -934,7 +936,7 @@ void psx_sio_input( running_machine *machine, int n_port, int n_mask, int n_data
WRITE32_HANDLER( psx_sio_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
int n_port = offset / 4;
psx_sio *sio = &p_psx->sio[ n_port ];
@@ -986,7 +988,7 @@ WRITE32_HANDLER( psx_sio_w )
{
if( sio->fn_handler != NULL )
{
- (*sio->fn_handler)( space->machine, sio->n_tx );
+ (*sio->fn_handler)( space->machine(), sio->n_tx );
}
}
sio->n_tx_prev = sio->n_tx;
@@ -1012,7 +1014,7 @@ WRITE32_HANDLER( psx_sio_w )
READ32_HANDLER( psx_sio_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
int n_port = offset / 4;
psx_sio *sio = &p_psx->sio[ n_port ];
UINT32 data;
@@ -1066,9 +1068,9 @@ READ32_HANDLER( psx_sio_r )
return data;
}
-void psx_sio_install_handler( running_machine *machine, int n_port, psx_sio_handler p_f_sio_handler )
+void psx_sio_install_handler( running_machine &machine, int n_port, psx_sio_handler p_f_sio_handler )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
p_psx->sio[ n_port ].fn_handler = p_f_sio_handler;
}
@@ -1415,9 +1417,9 @@ static void mdec_yuv2_to_rgb24( psx_machine *p_psx )
p_psx->mdec.n_decoded = ( 24 * 16 ) / 2;
}
-static void mdec0_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void mdec0_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
UINT32 *p_n_psxram = p_psx->p_n_psxram;
int n_index;
@@ -1473,9 +1475,9 @@ static void mdec0_write( running_machine *machine, UINT32 n_address, INT32 n_siz
}
}
-static void mdec1_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void mdec1_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
UINT32 *p_n_psxram = p_psx->p_n_psxram;
UINT32 n_this;
UINT32 n_nextaddress;
@@ -1536,7 +1538,7 @@ static void mdec1_read( running_machine *machine, UINT32 n_address, INT32 n_size
WRITE32_HANDLER( psx_mdec_w )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
switch( offset )
{
@@ -1553,7 +1555,7 @@ WRITE32_HANDLER( psx_mdec_w )
READ32_HANDLER( psx_mdec_r )
{
- psx_machine *p_psx = space->machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = space->machine().driver_data<psx_state>()->p_psx;
switch( offset )
{
@@ -1567,25 +1569,25 @@ READ32_HANDLER( psx_mdec_r )
return 0;
}
-static void gpu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void gpu_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
UINT32 *p_n_psxram = p_psx->p_n_psxram;
psx_gpu_read( machine, &p_n_psxram[ n_address / 4 ], n_size );
}
-static void gpu_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void gpu_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
UINT32 *p_n_psxram = p_psx->p_n_psxram;
psx_gpu_write( machine, &p_n_psxram[ n_address / 4 ], n_size );
}
-void psx_machine_init( running_machine *machine )
+void psx_machine_init( running_machine &machine )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
int n;
/* irq */
@@ -1630,7 +1632,7 @@ void psx_machine_init( running_machine *machine )
static STATE_POSTLOAD( psx_postload )
{
- psx_machine *p_psx = machine->driver_data<psx_state>()->p_psx;
+ psx_machine *p_psx = machine.driver_data<psx_state>()->p_psx;
int n;
psx_irq_update(p_psx);
@@ -1653,34 +1655,34 @@ static STATE_POSTLOAD( psx_postload )
mdec_cos_precalc(p_psx);
}
-void psx_driver_init( running_machine *machine )
+void psx_driver_init( running_machine &machine )
{
- psx_state *state = machine->driver_data<psx_state>();
+ psx_state *state = machine.driver_data<psx_state>();
psx_machine *p_psx = auto_alloc_clear(machine, psx_machine);
int n;
state->p_psx = p_psx;
- state->p_n_psxram = (UINT32 *)memory_get_shared(*machine, "share1", state->n_psxramsize);
+ state->p_n_psxram = (UINT32 *)memory_get_shared(machine, "share1", state->n_psxramsize);
- p_psx->machine = machine;
+ p_psx->m_machine = &machine;
p_psx->p_n_psxram = state->p_n_psxram;
p_psx->n_psxramsize = state->n_psxramsize;
for( n = 0; n < 7; n++ )
{
- p_psx->channel[ n ].timer = machine->scheduler().timer_alloc( FUNC(dma_finished_callback), machine );
+ p_psx->channel[ n ].timer = machine.scheduler().timer_alloc( FUNC(dma_finished_callback), &machine );
p_psx->channel[ n ].fn_read = NULL;
p_psx->channel[ n ].fn_write = NULL;
}
for( n = 0; n < 3; n++ )
{
- p_psx->root[ n ].timer = machine->scheduler().timer_alloc( FUNC(root_finished ));
+ p_psx->root[ n ].timer = machine.scheduler().timer_alloc( FUNC(root_finished ));
}
for( n = 0; n < 2; n++ )
{
- p_psx->sio[ n ].timer = machine->scheduler().timer_alloc( FUNC(sio_clock ));
+ p_psx->sio[ n ].timer = machine.scheduler().timer_alloc( FUNC(sio_clock ));
p_psx->sio[ n ].fn_handler = NULL;
}
@@ -1756,5 +1758,5 @@ void psx_driver_init( running_machine *machine )
state_save_register_global_array( machine, p_psx->mdec.p_n_quantize_uv );
state_save_register_global_array( machine, p_psx->mdec.p_n_cos );
- machine->state().register_postload( psx_postload, NULL );
+ machine.state().register_postload( psx_postload, NULL );
}
diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c
index d8291260fb4..44f70d45ee8 100644
--- a/src/mame/machine/qix.c
+++ b/src/mame/machine/qix.c
@@ -226,7 +226,7 @@ const pia6821_interface slither_pia_2_intf =
MACHINE_RESET( qix )
{
- qix_state *state = machine->driver_data<qix_state>();
+ qix_state *state = machine.driver_data<qix_state>();
/* reset the coin counter register */
state->coinctrl = 0x00;
@@ -235,7 +235,7 @@ MACHINE_RESET( qix )
MACHINE_START( qixmcu )
{
- qix_state *state = machine->driver_data<qix_state>();
+ qix_state *state = machine.driver_data<qix_state>();
/* set up save states */
state->save_item(NAME(state->_68705_port_in));
@@ -252,7 +252,7 @@ MACHINE_START( qixmcu )
WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed )
{
- device_t *pia = device->machine->device("sndpia0");
+ device_t *pia = device->machine().device("sndpia0");
pia6821_cb1_w(pia, state);
}
@@ -266,7 +266,7 @@ WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed )
WRITE8_HANDLER( zookeep_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", (data >> 2) & 1);
+ memory_set_bank(space->machine(), "bank1", (data >> 2) & 1);
/* not necessary, but technically correct */
qix_palettebank_w(space, offset, data);
}
@@ -281,26 +281,26 @@ WRITE8_HANDLER( zookeep_bankswitch_w )
WRITE8_HANDLER( qix_data_firq_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
}
WRITE8_HANDLER( qix_data_firq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
READ8_HANDLER( qix_data_firq_r )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
return 0xff;
}
READ8_HANDLER( qix_data_firq_ack_r )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
return 0xff;
}
@@ -314,26 +314,26 @@ READ8_HANDLER( qix_data_firq_ack_r )
WRITE8_HANDLER( qix_video_firq_w )
{
- cputag_set_input_line(space->machine, "videocpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "videocpu", M6809_FIRQ_LINE, ASSERT_LINE);
}
WRITE8_HANDLER( qix_video_firq_ack_w )
{
- cputag_set_input_line(space->machine, "videocpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "videocpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
READ8_HANDLER( qix_video_firq_r )
{
- cputag_set_input_line(space->machine, "videocpu", M6809_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "videocpu", M6809_FIRQ_LINE, ASSERT_LINE);
return 0xff;
}
READ8_HANDLER( qix_video_firq_ack_r )
{
- cputag_set_input_line(space->machine, "videocpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "videocpu", M6809_FIRQ_LINE, CLEAR_LINE);
return 0xff;
}
@@ -347,7 +347,7 @@ READ8_HANDLER( qix_video_firq_ack_r )
READ8_DEVICE_HANDLER( qixmcu_coin_r )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
logerror("6809:qixmcu_coin_r = %02X\n", state->_68705_port_out[0]);
return state->_68705_port_out[0];
@@ -356,7 +356,7 @@ READ8_DEVICE_HANDLER( qixmcu_coin_r )
static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
logerror("6809:qixmcu_coin_w = %02X\n", data);
/* this is a callback called by pia6821_w(), so I don't need to synchronize */
@@ -367,18 +367,18 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
/* if (!(data & 0x04)) */
if (data & 0x04)
{
- cputag_set_input_line(device->machine, "mcu", M68705_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "mcu", M68705_IRQ_LINE, ASSERT_LINE);
/* temporarily boost the interleave to sync things up */
/* note: I'm using 50 because 30 is not enough for space dungeon at game over */
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
else
- cputag_set_input_line(device->machine, "mcu", M68705_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "mcu", M68705_IRQ_LINE, CLEAR_LINE);
/* this is a callback called by pia6821_w(), so I don't need to synchronize */
/* the CPUs - they have already been synchronized by qix_pia_w() */
@@ -396,7 +396,7 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
READ8_HANDLER( qix_68705_portA_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
UINT8 ddr = state->_68705_ddr[0];
UINT8 out = state->_68705_port_out[0];
@@ -408,22 +408,22 @@ READ8_HANDLER( qix_68705_portA_r )
READ8_HANDLER( qix_68705_portB_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
UINT8 ddr = state->_68705_ddr[1];
UINT8 out = state->_68705_port_out[1];
- UINT8 in = (input_port_read(space->machine, "COIN") & 0x0f) | ((input_port_read(space->machine, "COIN") & 0x80) >> 3);
+ UINT8 in = (input_port_read(space->machine(), "COIN") & 0x0f) | ((input_port_read(space->machine(), "COIN") & 0x80) >> 3);
return (out & ddr) | (in & ~ddr);
}
READ8_HANDLER( qix_68705_portC_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
UINT8 ddr = state->_68705_ddr[2];
UINT8 out = state->_68705_port_out[2];
- UINT8 in = (state->coinctrl & 0x08) | ((input_port_read(space->machine, "COIN") & 0x70) >> 4);
+ UINT8 in = (state->coinctrl & 0x08) | ((input_port_read(space->machine(), "COIN") & 0x70) >> 4);
return (out & ddr) | (in & ~ddr);
}
@@ -437,7 +437,7 @@ READ8_HANDLER( qix_68705_portC_r )
WRITE8_HANDLER( qix_68705_portA_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
logerror("68705:portA_w = %02X\n", data);
state->_68705_port_out[0] = data;
@@ -446,17 +446,17 @@ WRITE8_HANDLER( qix_68705_portA_w )
WRITE8_HANDLER( qix_68705_portB_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
state->_68705_port_out[1] = data;
- coin_lockout_w(space->machine, 0, (~data >> 6) & 1);
- coin_counter_w(space->machine, 0, (data >> 7) & 1);
+ coin_lockout_w(space->machine(), 0, (~data >> 6) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 7) & 1);
}
WRITE8_HANDLER( qix_68705_portC_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
state->_68705_port_out[2] = data;
}
@@ -480,7 +480,7 @@ WRITE8_DEVICE_HANDLER( qix_pia_w )
{
/* make all the CPUs synchronize, and only AFTER that write the command to the PIA */
/* otherwise the 68705 will miss commands */
- device->machine->scheduler().synchronize(FUNC(pia_w_callback), data | (offset << 8), (void *)device);
+ device->machine().scheduler().synchronize(FUNC(pia_w_callback), data | (offset << 8), (void *)device);
}
@@ -493,8 +493,8 @@ WRITE8_DEVICE_HANDLER( qix_pia_w )
static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
{
- coin_lockout_w(device->machine, 0, (~data >> 2) & 1);
- coin_counter_w(device->machine, 0, (data >> 1) & 1);
+ coin_lockout_w(device->machine(), 0, (~data >> 2) & 1);
+ coin_counter_w(device->machine(), 0, (data >> 1) & 1);
}
@@ -508,7 +508,7 @@ static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
static WRITE8_DEVICE_HANDLER( slither_76489_0_w )
{
/* write to the sound chip */
- sn76496_w(device->machine->device("sn1"), 0, data);
+ sn76496_w(device->machine().device("sn1"), 0, data);
/* clock the ready line going back into CB1 */
pia6821_cb1_w(device, 0);
@@ -519,7 +519,7 @@ static WRITE8_DEVICE_HANDLER( slither_76489_0_w )
static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
{
/* write to the sound chip */
- sn76496_w(device->machine->device("sn2"), 0, data);
+ sn76496_w(device->machine().device("sn2"), 0, data);
/* clock the ready line going back into CB1 */
pia6821_cb1_w(device, 0);
@@ -536,15 +536,15 @@ static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
static READ8_DEVICE_HANDLER( slither_trak_lr_r )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
- return input_port_read(device->machine, state->flip ? "AN3" : "AN1");
+ return input_port_read(device->machine(), state->flip ? "AN3" : "AN1");
}
static READ8_DEVICE_HANDLER( slither_trak_ud_r )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
- return input_port_read(device->machine, state->flip ? "AN2" : "AN0");
+ return input_port_read(device->machine(), state->flip ? "AN2" : "AN0");
}
diff --git a/src/mame/machine/r2crypt.c b/src/mame/machine/r2crypt.c
index 84e5dd051f0..c3053802f77 100644
--- a/src/mame/machine/r2crypt.c
+++ b/src/mame/machine/r2crypt.c
@@ -248,10 +248,10 @@ static UINT32 trans(UINT32 v, UINT32 x)
return r;
}
-void raiden2_decrypt_sprites(running_machine *machine)
+void raiden2_decrypt_sprites(running_machine &machine)
{
int i;
- UINT32 *data = (UINT32 *)machine->region("gfx3")->base();
+ UINT32 *data = (UINT32 *)machine.region("gfx3")->base();
for(i=0; i<0x800000/4; i++) {
UINT32 x1, v1, y1;
@@ -277,7 +277,7 @@ void raiden2_decrypt_sprites(running_machine *machine)
}
}
-void zeroteam_decrypt_sprites(running_machine *machine)
+void zeroteam_decrypt_sprites(running_machine &machine)
{
// TODO!
}
diff --git a/src/mame/machine/rainbow.c b/src/mame/machine/rainbow.c
index fd78a0d3658..7c03688702c 100644
--- a/src/mame/machine/rainbow.c
+++ b/src/mame/machine/rainbow.c
@@ -642,9 +642,9 @@ static const UINT32 cchip_round_address[] =
0x042C60, 0x042D38
};
-static void request_round_data( running_machine *machine )
+static void request_round_data( running_machine &machine )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
int round = state->CRAM[1][0x141]; /* 0...49 */
memcpy(state->CRAM[1], CROM_BANK1, sizeof CROM_BANK1);
@@ -663,9 +663,9 @@ static void request_round_data( running_machine *machine )
state->CRAM[1][0x148] = (round >= 40 || round % 4 == 3);
}
-static void request_world_data( running_machine *machine )
+static void request_world_data( running_machine &machine )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
int world = state->CRAM[0][0x00d] / 4; /* 0...9 */
/* the extra version has the world data swapped around */
@@ -711,10 +711,10 @@ static void request_world_data( running_machine *machine )
}
}
-static void request_goalin_data( running_machine *machine )
+static void request_goalin_data( running_machine &machine )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
- int n = machine->rand() % 15;
+ rainbow_state *state = machine.driver_data<rainbow_state>();
+ int n = machine.rand() % 15;
state->CRAM[1][0x14B] = 0x00; /* x coordinates */
state->CRAM[1][0x14D] = 0x10;
@@ -733,7 +733,7 @@ static void request_goalin_data( running_machine *machine )
static TIMER_CALLBACK( cchip_timer )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
if (state->CRAM[1][0x100] == 1)
{
@@ -780,13 +780,13 @@ WRITE16_HANDLER( rainbow_cchip_ctrl_w )
WRITE16_HANDLER( rainbow_cchip_bank_w )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
state->current_bank = data & 7;
}
WRITE16_HANDLER( rainbow_cchip_ram_w )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
state->CRAM[state->current_bank][offset] = data;
}
@@ -807,7 +807,7 @@ READ16_HANDLER( rainbow_cchip_ctrl_r )
READ16_HANDLER( rainbow_cchip_ram_r )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
return state->CRAM[state->current_bank][offset];
}
@@ -817,9 +817,9 @@ READ16_HANDLER( rainbow_cchip_ram_r )
*
*************************************/
-void rainbow_cchip_init( running_machine *machine, int version )
+void rainbow_cchip_init( running_machine &machine, int version )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
int i;
state->extra_version = version;
@@ -833,5 +833,5 @@ void rainbow_cchip_init( running_machine *machine, int version )
state_save_register_item(machine, "cchip", NULL, 0, state->current_bank);
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer));
}
diff --git a/src/mame/machine/retofinv.c b/src/mame/machine/retofinv.c
index 4b90ae9f066..ecc260fd55e 100644
--- a/src/mame/machine/retofinv.c
+++ b/src/mame/machine/retofinv.c
@@ -12,21 +12,21 @@
READ8_HANDLER( retofinv_68705_portA_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),state->portA_in);
return (state->portA_out & state->ddrA) | (state->portA_in & ~state->ddrA);
}
WRITE8_HANDLER( retofinv_68705_portA_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data);
state->portA_out = data;
}
WRITE8_HANDLER( retofinv_68705_ddrA_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->ddrA = data;
}
@@ -44,19 +44,19 @@ WRITE8_HANDLER( retofinv_68705_ddrA_w )
READ8_HANDLER( retofinv_68705_portB_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
return (state->portB_out & state->ddrB) | (state->portB_in & ~state->ddrB);
}
WRITE8_HANDLER( retofinv_68705_portB_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(space->cpu),data);
if ((state->ddrB & 0x02) && (~data & 0x02) && (state->portB_out & 0x02))
{
state->portA_in = state->from_main;
- if (state->main_sent) cputag_set_input_line(space->machine, "68705", 0, CLEAR_LINE);
+ if (state->main_sent) cputag_set_input_line(space->machine(), "68705", 0, CLEAR_LINE);
state->main_sent = 0;
//logerror("read command %02x from main cpu\n",state->portA_in);
}
@@ -72,7 +72,7 @@ WRITE8_HANDLER( retofinv_68705_portB_w )
WRITE8_HANDLER( retofinv_68705_ddrB_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->ddrB = data;
}
@@ -89,7 +89,7 @@ WRITE8_HANDLER( retofinv_68705_ddrB_w )
READ8_HANDLER( retofinv_68705_portC_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->portC_in = 0;
if (state->main_sent) state->portC_in |= 0x01;
if (!state->mcu_sent) state->portC_in |= 0x02;
@@ -99,30 +99,30 @@ READ8_HANDLER( retofinv_68705_portC_r )
WRITE8_HANDLER( retofinv_68705_portC_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(space->cpu),data);
state->portC_out = data;
}
WRITE8_HANDLER( retofinv_68705_ddrC_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->ddrC = data;
}
WRITE8_HANDLER( retofinv_mcu_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
logerror("%04x: mcu_w %02x\n",cpu_get_pc(space->cpu),data);
state->from_main = data;
state->main_sent = 1;
- cputag_set_input_line(space->machine, "68705", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "68705", 0, ASSERT_LINE);
}
READ8_HANDLER( retofinv_mcu_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu),state->from_mcu);
state->mcu_sent = 0;
return state->from_mcu;
@@ -130,7 +130,7 @@ logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu),state->from_mcu);
READ8_HANDLER( retofinv_mcu_status_r )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
int res = 0;
/* bit 4 = when 1, mcu is ready to receive data from main cpu */
diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c
index fb0a7458ab0..76f53708e1b 100644
--- a/src/mame/machine/s16fd.c
+++ b/src/mame/machine/s16fd.c
@@ -31,7 +31,7 @@ static int fd1094_selected_state;
static char fd1094_cputag[64];
-static void (*fd1094_set_decrypted)(running_machine *, UINT8 *);
+static void (*fd1094_set_decrypted)(running_machine &, UINT8 *);
void *fd1094_get_decrypted_base(void)
{
@@ -40,19 +40,19 @@ void *fd1094_get_decrypted_base(void)
return fd1094_userregion;
}
-static void set_decrypted_region(running_machine *machine)
+static void set_decrypted_region(running_machine &machine)
{
if (fd1094_set_decrypted != NULL)
(*fd1094_set_decrypted)(machine, (UINT8 *)fd1094_userregion);
else
- machine->device<cpu_device>(fd1094_cputag)->space(AS_PROGRAM)->set_decrypted_region(0, fd1094_cpuregionsize - 1, fd1094_userregion);
+ machine.device<cpu_device>(fd1094_cputag)->space(AS_PROGRAM)->set_decrypted_region(0, fd1094_cpuregionsize - 1, fd1094_userregion);
}
/* this function checks the cache to see if the current state is cached,
if it is then it copies the cached data to the user region where code is
executed from, if its not cached then it gets decrypted to the current
cache position using the functions in fd1094.c */
-static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
+static void fd1094_setstate_and_decrypt(running_machine &machine, int state)
{
int i;
UINT32 addr;
@@ -67,7 +67,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
fd1094_state = state;
- cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
+ cpu_set_reg(machine.device(fd1094_cputag), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
/* set the FD1094 state ready to decrypt.. */
state = fd1094_set_state(fd1094_key, state) & 0xff;
@@ -80,7 +80,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
/* copy cached state */
fd1094_userregion = fd1094_cacheregion[i];
set_decrypted_region(machine);
- m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize);
+ m68k_set_encrypted_opcode_range(machine.device(fd1094_cputag), 0, fd1094_cpuregionsize);
return;
}
@@ -99,7 +99,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state)
/* copy newly decrypted data to user region */
fd1094_userregion = fd1094_cacheregion[fd1094_current_cacheposition];
set_decrypted_region(machine);
- m68k_set_encrypted_opcode_range(machine->device(fd1094_cputag), 0, fd1094_cpuregionsize);
+ m68k_set_encrypted_opcode_range(machine.device(fd1094_cputag), 0, fd1094_cpuregionsize);
fd1094_current_cacheposition++;
@@ -115,20 +115,20 @@ static void fd1094_cmp_callback(device_t *device, UINT32 val, UINT8 reg)
{
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
{
- fd1094_setstate_and_decrypt(device->machine, (val & 0xffff0000) >> 16);
+ fd1094_setstate_and_decrypt(device->machine(), (val & 0xffff0000) >> 16);
}
}
/* Callback when the FD1094 enters interrupt code */
static IRQ_CALLBACK(fd1094_int_callback)
{
- fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_IRQ);
+ fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_IRQ);
return (0x60+irqline*4)/4; // vector address
}
static void fd1094_rte_callback (device_t *device)
{
- fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE);
+ fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RTE);
}
@@ -149,7 +149,7 @@ void fd1094_machine_init(device_t *device)
if (!fd1094_key)
return;
- fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RESET);
+ fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RESET);
fd1094_kludge_reset_values();
m68k_set_cmpild_callback(device, fd1094_cmp_callback);
@@ -166,7 +166,7 @@ static STATE_POSTLOAD( fd1094_postload )
int selected_state = fd1094_selected_state;
int state = fd1094_state;
- fd1094_machine_init(machine->device(fd1094_cputag));
+ fd1094_machine_init(machine.device(fd1094_cputag));
fd1094_setstate_and_decrypt(machine, selected_state);
fd1094_setstate_and_decrypt(machine, state);
@@ -174,7 +174,7 @@ static STATE_POSTLOAD( fd1094_postload )
}
-static void key_changed(running_machine *machine)
+static void key_changed(running_machine &machine)
{
int addr;
@@ -192,20 +192,20 @@ static void key_changed(running_machine *machine)
fd1094_current_cacheposition = 1;
/* flush the prefetch queue */
- cpu_set_reg(machine->device(fd1094_cputag), M68K_PREF_ADDR, 0x0010);
+ cpu_set_reg(machine.device(fd1094_cputag), M68K_PREF_ADDR, 0x0010);
}
/* startup function, to be called from DRIVER_INIT (once on startup) */
-void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *))
+void fd1094_driver_init(running_machine &machine, const char* tag, void (*set_decrypted)(running_machine &, UINT8 *))
{
int i;
strcpy(fd1094_cputag, tag);
- fd1094_cpuregion = (UINT16*)machine->region(fd1094_cputag)->base();
- fd1094_cpuregionsize = machine->region(fd1094_cputag)->bytes();
- fd1094_key = machine->region("user1")->base();
+ fd1094_cpuregion = (UINT16*)machine.region(fd1094_cputag)->base();
+ fd1094_cpuregionsize = machine.region(fd1094_cputag)->bytes();
+ fd1094_key = machine.region("user1")->base();
fd1094_set_decrypted = set_decrypted;
/* punt if no key; this allows us to be called even for non-FD1094 games */
@@ -221,12 +221,12 @@ void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_de
fd1094_state = -1;
/* key debugging */
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0 && machine->region("user2")->base() != NULL)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0 && machine.region("user2")->base() != NULL)
{
fd1094_init_debugging(machine, fd1094_cputag, "user1", "user2", key_changed);
}
state_save_register_global(machine, fd1094_selected_state);
state_save_register_global(machine, fd1094_state);
- machine->state().register_postload(fd1094_postload, NULL);
+ machine.state().register_postload(fd1094_postload, NULL);
}
diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c
index 3643f3d9a90..e948d7a4c10 100644
--- a/src/mame/machine/s24fd.c
+++ b/src/mame/machine/s24fd.c
@@ -28,7 +28,7 @@ static int fd1094_selected_state;
if it is then it copies the cached data to the user region where code is
executed from, if its not cached then it gets decrypted to the current
cache position using the functions in s24_fd1094.c */
-static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state)
+static void s24_fd1094_setstate_and_decrypt(running_machine &machine, int state)
{
int i;
UINT32 addr;
@@ -43,7 +43,7 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state)
fd1094_state = state;
- cpu_set_reg(machine->device("sub"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
+ cpu_set_reg(machine.device("sub"), M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache
/* set the s24_fd1094 state ready to decrypt.. */
state = fd1094_set_state(s24_fd1094_key,state) & 0xff;
@@ -55,8 +55,8 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state)
{
/* copy cached state */
s24_fd1094_userregion = s24_fd1094_cacheregion[i];
- machine->device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
- m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize);
+ machine.device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
+ m68k_set_encrypted_opcode_range(machine.device("sub"), 0, s24_fd1094_cpuregionsize);
return;
}
@@ -76,8 +76,8 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state)
/* copy newly decrypted data to user region */
s24_fd1094_userregion = s24_fd1094_cacheregion[fd1094_current_cacheposition];
- machine->device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
- m68k_set_encrypted_opcode_range(machine->device("sub"), 0, s24_fd1094_cpuregionsize);
+ machine.device<cpu_device>("sub")->space(AS_PROGRAM)->set_decrypted_region(0, s24_fd1094_cpuregionsize - 1, s24_fd1094_userregion);
+ m68k_set_encrypted_opcode_range(machine.device("sub"), 0, s24_fd1094_cpuregionsize);
fd1094_current_cacheposition++;
@@ -93,20 +93,20 @@ static void s24_fd1094_cmp_callback(device_t *device, UINT32 val, UINT8 reg)
{
if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ?
{
- s24_fd1094_setstate_and_decrypt(device->machine, (val & 0xffff0000) >> 16);
+ s24_fd1094_setstate_and_decrypt(device->machine(), (val & 0xffff0000) >> 16);
}
}
/* Callback when the s24_fd1094 enters interrupt code */
static IRQ_CALLBACK(s24_fd1094_int_callback)
{
- s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_IRQ);
+ s24_fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_IRQ);
return (0x60+irqline*4)/4; // vector address
}
static void s24_fd1094_rte_callback (device_t *device)
{
- s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE);
+ s24_fd1094_setstate_and_decrypt(device->machine(), FD1094_STATE_RTE);
}
@@ -121,7 +121,7 @@ static void s24_fd1094_kludge_reset_values(void)
/* function, to be called from MACHINE_RESET (every reset) */
-void s24_fd1094_machine_init(running_machine *machine)
+void s24_fd1094_machine_init(running_machine &machine)
{
/* punt if no key; this allows us to be called even for non-s24_fd1094 games */
if (!s24_fd1094_key)
@@ -130,11 +130,11 @@ void s24_fd1094_machine_init(running_machine *machine)
s24_fd1094_setstate_and_decrypt(machine, FD1094_STATE_RESET);
s24_fd1094_kludge_reset_values();
- m68k_set_cmpild_callback(machine->device("sub"), s24_fd1094_cmp_callback);
- m68k_set_rte_callback(machine->device("sub"), s24_fd1094_rte_callback);
- device_set_irq_callback(machine->device("sub"), s24_fd1094_int_callback);
+ m68k_set_cmpild_callback(machine.device("sub"), s24_fd1094_cmp_callback);
+ m68k_set_rte_callback(machine.device("sub"), s24_fd1094_rte_callback);
+ device_set_irq_callback(machine.device("sub"), s24_fd1094_int_callback);
- machine->device("sub")->reset();
+ machine.device("sub")->reset();
}
static STATE_POSTLOAD( s24_fd1094_postload )
@@ -152,13 +152,13 @@ static STATE_POSTLOAD( s24_fd1094_postload )
}
/* startup function, to be called from DRIVER_INIT (once on startup) */
-void s24_fd1094_driver_init(running_machine *machine)
+void s24_fd1094_driver_init(running_machine &machine)
{
int i;
- s24_fd1094_cpuregion = (UINT16*)memory_get_shared(*machine, "share2");
+ s24_fd1094_cpuregion = (UINT16*)memory_get_shared(machine, "share2");
s24_fd1094_cpuregionsize = 0x40000;
- s24_fd1094_key = machine->region("fd1094key")->base();
+ s24_fd1094_key = machine.region("fd1094key")->base();
/* punt if no key; this allows us to be called even for non-s24_fd1094 games */
if (!s24_fd1094_key)
@@ -179,5 +179,5 @@ void s24_fd1094_driver_init(running_machine *machine)
state_save_register_global(machine, fd1094_selected_state);
state_save_register_global(machine, fd1094_state);
- machine->state().register_postload(s24_fd1094_postload, NULL);
+ machine.state().register_postload(s24_fd1094_postload, NULL);
}
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index 4d96081fcf6..13940f705ca 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -20,7 +20,7 @@ MACHINE_RESET( scramble )
{
MACHINE_RESET_CALL(galaxold);
- if (machine->device("audiocpu") != NULL)
+ if (machine.device("audiocpu") != NULL)
scramble_sh_init(machine);
security_2B_counter = 0;
@@ -28,7 +28,7 @@ MACHINE_RESET( scramble )
MACHINE_RESET( explorer )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
RAM[0x47ff] = 0; /* If not set, it doesn't reset after the 1st time */
MACHINE_RESET_CALL(galaxold);
@@ -45,7 +45,7 @@ CUSTOM_INPUT( darkplnt_custom_r )
0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
- UINT8 val = input_port_read(field->port->machine, (const char *)param);
+ UINT8 val = input_port_read(field->port->machine(), (const char *)param);
return remap[val >> 2];
}
@@ -60,7 +60,7 @@ static WRITE8_DEVICE_HANDLER( scramble_protection_w )
static READ8_DEVICE_HANDLER( scramble_protection_r )
{
- switch (cpu_get_pc(device->machine->device("maincpu")))
+ switch (cpu_get_pc(device->machine().device("maincpu")))
{
case 0x00a8: return 0xf0;
case 0x00be: return 0xb0;
@@ -71,7 +71,7 @@ static READ8_DEVICE_HANDLER( scramble_protection_r )
case 0x1ca2: return 0x00; /* I don't think it's checked */
case 0x1d7e: return 0xb0;
default:
- logerror("%s: read protection\n",device->machine->describe_context());
+ logerror("%s: read protection\n",device->machine().describe_context());
return 0;
}
}
@@ -105,7 +105,7 @@ READ8_HANDLER( triplep_pap_r )
-static void cavelon_banksw(running_machine *machine)
+static void cavelon_banksw(running_machine &machine)
{
/* any read/write access in the 0x8000-0xffff region causes a bank switch.
Only the lower 0x2000 is switched but we switch the whole region
@@ -117,24 +117,24 @@ static void cavelon_banksw(running_machine *machine)
static READ8_HANDLER( cavelon_banksw_r )
{
- cavelon_banksw(space->machine);
+ cavelon_banksw(space->machine());
if ((offset >= 0x0100) && (offset <= 0x0103))
- return ppi8255_r(space->machine->device("ppi8255_0"), offset - 0x0100);
+ return ppi8255_r(space->machine().device("ppi8255_0"), offset - 0x0100);
else if ((offset >= 0x0200) && (offset <= 0x0203))
- return ppi8255_r(space->machine->device("ppi8255_1"), offset - 0x0200);
+ return ppi8255_r(space->machine().device("ppi8255_1"), offset - 0x0200);
return 0xff;
}
static WRITE8_HANDLER( cavelon_banksw_w )
{
- cavelon_banksw(space->machine);
+ cavelon_banksw(space->machine());
if ((offset >= 0x0100) && (offset <= 0x0103))
- ppi8255_w(space->machine->device("ppi8255_0"), offset - 0x0100, data);
+ ppi8255_w(space->machine().device("ppi8255_0"), offset - 0x0100, data);
else if ((offset >= 0x0200) && (offset <= 0x0203))
- ppi8255_w(space->machine->device("ppi8255_1"), offset - 0x0200, data);
+ ppi8255_w(space->machine().device("ppi8255_1"), offset - 0x0200, data);
}
@@ -208,13 +208,13 @@ DRIVER_INIT( scramble_ppi )
static DRIVER_INIT( scobra )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa803, 0xa803, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa803, 0xa803, FUNC(scrambold_background_enable_w));
}
#ifdef UNUSED_FUNCTION
DRIVER_INIT( atlantis )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6803, 0x6803, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6803, 0x6803, FUNC(scrambold_background_enable_w));
}
DRIVER_INIT( scramble )
@@ -225,14 +225,14 @@ DRIVER_INIT( scramble )
DRIVER_INIT( stratgyx )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb000, 0xb000, FUNC(scrambold_background_green_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb002, 0xb002, FUNC(scrambold_background_blue_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb00a, 0xb00a, FUNC(scrambold_background_red_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb000, 0xb000, FUNC(scrambold_background_green_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb002, 0xb002, FUNC(scrambold_background_blue_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb00a, 0xb00a, FUNC(scrambold_background_red_w));
}
DRIVER_INIT( tazmani2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb002, 0xb002, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb002, 0xb002, FUNC(scrambold_background_enable_w));
}
DRIVER_INIT( ckongs )
@@ -242,15 +242,15 @@ DRIVER_INIT( ckongs )
DRIVER_INIT( mariner )
{
/* extra ROM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5800, 0x67ff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5800, 0x67ff);
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x5800);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x5800, 0x67ff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x5800, 0x67ff);
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x5800);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9008, 0x9008, FUNC(mariner_protection_2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb401, 0xb401, FUNC(mariner_protection_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x9008, 0x9008, FUNC(mariner_protection_2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb401, 0xb401, FUNC(mariner_protection_1_r));
/* ??? (it's NOT a background enable) */
- /*machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x6803, 0x6803);*/
+ /*machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x6803, 0x6803);*/
}
#ifdef UNUSED_FUNCTION
@@ -260,12 +260,12 @@ DRIVER_INIT( frogger )
UINT8 *ROM;
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
- ROM = machine->region("audiocpu")->base();
+ ROM = machine.region("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
/* likewise, the 2nd gfx ROM has data lines D0 and D1 swapped. Decode it. */
- ROM = machine->region("gfx1")->base();
+ ROM = machine.region("gfx1")->base();
for (A = 0x0800;A < 0x1000;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
}
@@ -276,7 +276,7 @@ DRIVER_INIT( froggers )
UINT8 *ROM;
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
- ROM = machine->region("audiocpu")->base();
+ ROM = machine.region("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
ROM[A] = BITSWAP8(ROM[A],7,6,5,4,3,2,0,1);
}
@@ -294,7 +294,7 @@ DRIVER_INIT( devilfsh )
/* A2 -> A3 */
/* A3 -> A1 */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0; i < 0x10000; i += 16)
{
offs_t j;
@@ -320,23 +320,23 @@ DRIVER_INIT( hotshock )
{
/* protection??? The game jumps into never-neverland here. I think
it just expects a RET there */
- machine->region("maincpu")->base()[0x2ef9] = 0xc9;
+ machine.region("maincpu")->base()[0x2ef9] = 0xc9;
}
DRIVER_INIT( cavelon )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* banked ROM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x00000], 0x10000);
cavelon_banksw(machine);
/* A15 switches memory banks */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(cavelon_banksw_r), FUNC(cavelon_banksw_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(cavelon_banksw_r), FUNC(cavelon_banksw_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x2000, 0x2000); /* ??? */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x3800, 0x3801); /* looks suspicously like
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x2000, 0x2000); /* ??? */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x3800, 0x3801); /* looks suspicously like
an AY8910, but not sure */
state_save_register_global(machine, cavelon_bank);
}
@@ -345,7 +345,7 @@ DRIVER_INIT( cavelon )
DRIVER_INIT( darkplnt )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb00a, 0xb00a, FUNC(darkplnt_bullet_color_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb00a, 0xb00a, FUNC(darkplnt_bullet_color_w));
}
DRIVER_INIT( mimonkey )
@@ -370,7 +370,7 @@ DRIVER_INIT( mimonkey )
{ 0x80,0x87,0x81,0x87,0x83,0x00,0x84,0x01,0x01,0x86,0x86,0x80,0x86,0x00,0x86,0x86 }
};
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int A, ctr = 0, line, col;
for( A = 0; A < 0x4000; A++ )
@@ -381,17 +381,17 @@ DRIVER_INIT( mimonkey )
ctr++;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa804, 0xa804, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa804, 0xa804, FUNC(scrambold_background_enable_w));
}
DRIVER_INIT( mimonsco )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa804, 0xa804, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa804, 0xa804, FUNC(scrambold_background_enable_w));
}
DRIVER_INIT( mimonscr )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6804, 0x6804, FUNC(scrambold_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6804, 0x6804, FUNC(scrambold_background_enable_w));
}
@@ -416,8 +416,8 @@ DRIVER_INIT( anteater )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
scratch = alloc_array_or_die(UINT8, len);
@@ -454,8 +454,8 @@ DRIVER_INIT( rescue )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
scratch = auto_alloc_array(machine, UINT8, len);
@@ -490,8 +490,8 @@ DRIVER_INIT( minefld )
* Code To Decode Minefield by Mike Balfour and Nicola Salmoria
*/
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
scratch = auto_alloc_array(machine, UINT8, len);
@@ -529,8 +529,8 @@ DRIVER_INIT( losttomb )
* Optimizations done by Fabio Buffoni
*/
- RAM = machine->region("gfx1")->base();
- len = machine->region("gfx1")->bytes();
+ RAM = machine.region("gfx1")->base();
+ len = machine.region("gfx1")->bytes();
scratch = alloc_array_or_die(UINT8, len);
@@ -556,7 +556,7 @@ DRIVER_INIT( losttomb )
DRIVER_INIT( hustler )
{
offs_t A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x4000;A++)
@@ -584,7 +584,7 @@ DRIVER_INIT( hustler )
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
{
- rom = machine->region("audiocpu")->base();
+ rom = machine.region("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -596,7 +596,7 @@ DRIVER_INIT( hustlerd )
{
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
offs_t A;
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -606,7 +606,7 @@ DRIVER_INIT( hustlerd )
DRIVER_INIT( billiard )
{
offs_t A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x4000;A++)
@@ -636,7 +636,7 @@ DRIVER_INIT( billiard )
/* the first ROM of the second CPU has data lines D0 and D1 swapped. Decode it. */
{
- rom = machine->region("audiocpu")->base();
+ rom = machine.region("audiocpu")->base();
for (A = 0;A < 0x0800;A++)
@@ -664,8 +664,8 @@ DRIVER_INIT( mrkougb )
DRIVER_INIT( ad2083 )
{
UINT8 c;
- int i, len = machine->region("maincpu")->bytes();
- UINT8 *ROM = machine->region("maincpu")->base();
+ int i, len = machine.region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i=0; i<len; i++)
{
diff --git a/src/mame/machine/scudsp.c b/src/mame/machine/scudsp.c
index bc51e3ce800..994bf29d5b8 100644
--- a/src/mame/machine/scudsp.c
+++ b/src/mame/machine/scudsp.c
@@ -317,7 +317,7 @@ void dsp_prg_ctrl(address_space *space, UINT32 data)
if(LEF) dsp_reg.pc = (data & 0xff);
if(EXF) dsp_execute_program(space);
if(EF && (!(stv_scu[40] & 0x0020)))
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0xa, HOLD_LINE , 0x45);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0xa, HOLD_LINE , 0x45);
}
void dsp_prg_data(UINT32 data)
diff --git a/src/mame/machine/segacrp2.c b/src/mame/machine/segacrp2.c
index 46a7d4f1549..ea0db96f5e3 100644
--- a/src/mame/machine/segacrp2.c
+++ b/src/mame/machine/segacrp2.c
@@ -45,7 +45,7 @@
#include "segacrp2.h"
-static void sega_decode_2(running_machine *machine,const char *cputag,
+static void sega_decode_2(running_machine &machine,const char *cputag,
const UINT8 xor_table[128],const int swap_table[128])
{
int A;
@@ -60,8 +60,8 @@ static void sega_decode_2(running_machine *machine,const char *cputag,
};
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region(cputag)->base();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypted);
@@ -92,7 +92,7 @@ static void sega_decode_2(running_machine *machine,const char *cputag,
-void sega_315_5162_decode(running_machine *machine, const char *cputag)
+void sega_315_5162_decode(running_machine &machine, const char *cputag)
{
static const UINT8 xor_table[128] =
{
@@ -125,7 +125,7 @@ void sega_315_5162_decode(running_machine *machine, const char *cputag)
}
-void sega_315_5177_decode(running_machine *machine, const char *cputag)
+void sega_315_5177_decode(running_machine &machine, const char *cputag)
{
static const UINT8 xor_table[128] =
{
@@ -182,7 +182,7 @@ void sega_315_5177_decode(running_machine *machine, const char *cputag)
}
-void sega_315_5178_decode(running_machine *machine, const char *cputag)
+void sega_315_5178_decode(running_machine &machine, const char *cputag)
{
static const UINT8 xor_table[128] =
{
@@ -229,7 +229,7 @@ void sega_315_5178_decode(running_machine *machine, const char *cputag)
}
-void sega_315_5179_decode(running_machine *machine, const char *cputag)
+void sega_315_5179_decode(running_machine &machine, const char *cputag)
{
static const UINT8 xor_table[128] =
{
@@ -279,7 +279,7 @@ void sega_315_5179_decode(running_machine *machine, const char *cputag)
******************************************************************************/
-static void sega_decode_317(running_machine *machine, const char *cputag, int shift)
+static void sega_decode_317(running_machine &machine, const char *cputag, int shift)
{
static const UINT8 xor_table[128+3] =
{
@@ -310,7 +310,7 @@ static void sega_decode_317(running_machine *machine, const char *cputag, int sh
sega_decode_2( machine, cputag, xor_table + shift, swap_table + shift );
}
-void sega_317_0004_decode(running_machine *machine, const char *cputag) { sega_decode_317( machine, cputag, 0 ); }
-void sega_317_0005_decode(running_machine *machine, const char *cputag) { sega_decode_317( machine, cputag, 1 ); }
-void sega_317_0006_decode(running_machine *machine, const char *cputag) { sega_decode_317( machine, cputag, 2 ); }
-void sega_317_0007_decode(running_machine *machine, const char *cputag) { sega_decode_317( machine, cputag, 3 ); }
+void sega_317_0004_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 0 ); }
+void sega_317_0005_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 1 ); }
+void sega_317_0006_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 2 ); }
+void sega_317_0007_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 3 ); }
diff --git a/src/mame/machine/segacrp2.h b/src/mame/machine/segacrp2.h
index e605df4e0ac..df42f0dcad2 100644
--- a/src/mame/machine/segacrp2.h
+++ b/src/mame/machine/segacrp2.h
@@ -1,9 +1,9 @@
-void sega_315_5162_decode(running_machine *machine, const char *cputag);
-void sega_315_5177_decode(running_machine *machine, const char *cputag);
-void sega_315_5178_decode(running_machine *machine, const char *cputag);
-void sega_315_5179_decode(running_machine *machine, const char *cputag);
-void sega_317_0004_decode(running_machine *machine, const char *cputag);
-void sega_317_0005_decode(running_machine *machine, const char *cputag);
-void sega_317_0006_decode(running_machine *machine, const char *cputag);
-void sega_317_0007_decode(running_machine *machine, const char *cputag);
+void sega_315_5162_decode(running_machine &machine, const char *cputag);
+void sega_315_5177_decode(running_machine &machine, const char *cputag);
+void sega_315_5178_decode(running_machine &machine, const char *cputag);
+void sega_315_5179_decode(running_machine &machine, const char *cputag);
+void sega_317_0004_decode(running_machine &machine, const char *cputag);
+void sega_317_0005_decode(running_machine &machine, const char *cputag);
+void sega_317_0006_decode(running_machine &machine, const char *cputag);
+void sega_317_0007_decode(running_machine &machine, const char *cputag);
diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c
index 1d9a1b1cdf3..b26447a6920 100644
--- a/src/mame/machine/segacrpt.c
+++ b/src/mame/machine/segacrpt.c
@@ -159,7 +159,7 @@
static void lfkp(int mask)
{
int A;
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
for (A = 0x0000;A < 0x8000-14;A++)
@@ -213,14 +213,14 @@ static void look_for_known_plaintext(void)
}
#endif
-static void sega_decode(running_machine *machine, const char *cputag, const UINT8 convtable[32][4])
+static void sega_decode(running_machine &machine, const char *cputag, const UINT8 convtable[32][4])
{
int A;
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- int length = machine->region(cputag)->bytes();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ int length = machine.region(cputag)->bytes();
int cryptlen = MIN(length, 0x8000);
- UINT8 *rom = machine->region(cputag)->base();
+ UINT8 *rom = machine.region(cputag)->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0xc000);
space->set_decrypted_region(0x0000, cryptlen - 1, decrypted);
@@ -266,7 +266,7 @@ static void sega_decode(running_machine *machine, const char *cputag, const UINT
-void buckrog_decode(running_machine *machine, const char *cputag)
+void buckrog_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -295,7 +295,7 @@ void buckrog_decode(running_machine *machine, const char *cputag)
}
-void pengo_decode(running_machine *machine, const char *cputag)
+void pengo_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -324,7 +324,7 @@ void pengo_decode(running_machine *machine, const char *cputag)
}
-void szaxxon_decode(running_machine *machine, const char *cputag)
+void szaxxon_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -353,7 +353,7 @@ void szaxxon_decode(running_machine *machine, const char *cputag)
}
-void suprloco_decode(running_machine *machine, const char *cputag)
+void suprloco_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -382,7 +382,7 @@ void suprloco_decode(running_machine *machine, const char *cputag)
}
-void yamato_decode(running_machine *machine, const char *cputag)
+void yamato_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -410,7 +410,7 @@ void yamato_decode(running_machine *machine, const char *cputag)
sega_decode(machine, cputag, convtable);
}
-void toprollr_decode(running_machine *machine, const char *cputag, const char *regiontag)
+void toprollr_decode(running_machine &machine, const char *cputag, const char *regiontag)
{
/* same tables as in Yamato, but encrypted ROM is banked */
UINT8 *decrypted;
@@ -439,8 +439,8 @@ void toprollr_decode(running_machine *machine, const char *cputag, const char *r
int A;
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region(regiontag)->base();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region(regiontag)->base();
int bankstart;
decrypted = auto_alloc_array(machine, UINT8, 0x6000*3);
@@ -471,14 +471,14 @@ void toprollr_decode(running_machine *machine, const char *cputag, const char *r
rom[A+bankstart] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
- memory_configure_bank(machine, "bank1",0,3, machine->region(regiontag)->base(),0x6000);
+ memory_configure_bank(machine, "bank1",0,3, machine.region(regiontag)->base(),0x6000);
memory_configure_bank_decrypted(machine, "bank1",0,3,decrypted,0x6000);
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
- memory_set_bank(space->machine, "bank1", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
}
-void sindbadm_decode(running_machine *machine, const char *cputag)
+void sindbadm_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -507,7 +507,7 @@ void sindbadm_decode(running_machine *machine, const char *cputag)
}
-void regulus_decode(running_machine *machine, const char *cputag)
+void regulus_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -536,7 +536,7 @@ void regulus_decode(running_machine *machine, const char *cputag)
}
-void mrviking_decode(running_machine *machine, const char *cputag)
+void mrviking_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -565,7 +565,7 @@ void mrviking_decode(running_machine *machine, const char *cputag)
}
-void swat_decode(running_machine *machine, const char *cputag)
+void swat_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -594,7 +594,7 @@ void swat_decode(running_machine *machine, const char *cputag)
}
-void flicky_decode(running_machine *machine, const char *cputag)
+void flicky_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -623,7 +623,7 @@ void flicky_decode(running_machine *machine, const char *cputag)
}
-void futspy_decode(running_machine *machine, const char *cputag)
+void futspy_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -652,7 +652,7 @@ void futspy_decode(running_machine *machine, const char *cputag)
}
-void wmatch_decode(running_machine *machine, const char *cputag)
+void wmatch_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -681,7 +681,7 @@ void wmatch_decode(running_machine *machine, const char *cputag)
}
-void bullfgtj_decode(running_machine *machine, const char *cputag)
+void bullfgtj_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -710,7 +710,7 @@ void bullfgtj_decode(running_machine *machine, const char *cputag)
}
-void pbaction_decode(running_machine *machine, const char *cputag)
+void pbaction_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -739,7 +739,7 @@ void pbaction_decode(running_machine *machine, const char *cputag)
}
-void spatter_decode(running_machine *machine, const char *cputag)
+void spatter_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -768,7 +768,7 @@ void spatter_decode(running_machine *machine, const char *cputag)
}
-void jongkyo_decode(running_machine *machine, const char *cputag)
+void jongkyo_decode(running_machine &machine, const char *cputag)
{
/* encrypted ROM is banked */
UINT8 *decrypted;
@@ -797,8 +797,8 @@ void jongkyo_decode(running_machine *machine, const char *cputag)
int A;
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region(cputag)->base();
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region(cputag)->base();
decrypted = auto_alloc_array(machine, UINT8, 0x9000);
for (A = 0x0000;A < 0x9000;A++)
@@ -830,14 +830,14 @@ void jongkyo_decode(running_machine *machine, const char *cputag)
rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
- memory_configure_bank(machine, "bank1",0,8, machine->region(cputag)->base()+0x7000,0x0400);
+ memory_configure_bank(machine, "bank1",0,8, machine.region(cputag)->base()+0x7000,0x0400);
memory_configure_bank_decrypted(machine, "bank1",0,8,decrypted+0x7000,0x0400);
space->set_decrypted_region(0x0000, 0x6bff, decrypted);
- memory_set_bank(space->machine, "bank1", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
}
-void pitfall2_decode(running_machine *machine, const char *cputag)
+void pitfall2_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -866,7 +866,7 @@ void pitfall2_decode(running_machine *machine, const char *cputag)
}
-void nprinces_decode(running_machine *machine, const char *cputag)
+void nprinces_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -895,7 +895,7 @@ void nprinces_decode(running_machine *machine, const char *cputag)
}
-void seganinj_decode(running_machine *machine, const char *cputag)
+void seganinj_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -924,7 +924,7 @@ void seganinj_decode(running_machine *machine, const char *cputag)
}
-void imsorry_decode(running_machine *machine, const char *cputag)
+void imsorry_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -953,7 +953,7 @@ void imsorry_decode(running_machine *machine, const char *cputag)
}
-void teddybb_decode(running_machine *machine, const char *cputag)
+void teddybb_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -982,7 +982,7 @@ void teddybb_decode(running_machine *machine, const char *cputag)
}
-void myheroj_decode(running_machine *machine, const char *cputag)
+void myheroj_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -1011,7 +1011,7 @@ void myheroj_decode(running_machine *machine, const char *cputag)
}
-void hvymetal_decode(running_machine *machine, const char *cputag)
+void hvymetal_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
@@ -1040,7 +1040,7 @@ void hvymetal_decode(running_machine *machine, const char *cputag)
}
-void lvcards_decode(running_machine *machine, const char *cputag)
+void lvcards_decode(running_machine &machine, const char *cputag)
{
static const UINT8 convtable[32][4] =
{
diff --git a/src/mame/machine/segacrpt.h b/src/mame/machine/segacrpt.h
index 522b2ed0cd8..d49414c7e28 100644
--- a/src/mame/machine/segacrpt.h
+++ b/src/mame/machine/segacrpt.h
@@ -1,25 +1,25 @@
-void buckrog_decode(running_machine *machine, const char *cputag);
-void pengo_decode(running_machine *machine, const char *cputag);
-void szaxxon_decode(running_machine *machine, const char *cputag);
-void suprloco_decode(running_machine *machine, const char *cputag);
-void yamato_decode(running_machine *machine, const char *cputag);
-void toprollr_decode(running_machine *machine, const char *cputag, const char *regiontag);
-void sindbadm_decode(running_machine *machine, const char *cputag);
-void regulus_decode(running_machine *machine, const char *cputag);
-void mrviking_decode(running_machine *machine, const char *cputag);
-void swat_decode(running_machine *machine, const char *cputag);
-void flicky_decode(running_machine *machine, const char *cputag);
-void futspy_decode(running_machine *machine, const char *cputag);
-void wmatch_decode(running_machine *machine, const char *cputag);
-void bullfgtj_decode(running_machine *machine, const char *cputag);
-void pbaction_decode(running_machine *machine, const char *cputag);
-void spatter_decode(running_machine *machine, const char *cputag);
-void jongkyo_decode(running_machine *machine, const char *cputag);
-void pitfall2_decode(running_machine *machine, const char *cputag);
-void nprinces_decode(running_machine *machine, const char *cputag);
-void seganinj_decode(running_machine *machine, const char *cputag);
-void imsorry_decode(running_machine *machine, const char *cputag);
-void teddybb_decode(running_machine *machine, const char *cputag);
-void myheroj_decode(running_machine *machine, const char *cputag);
-void hvymetal_decode(running_machine *machine, const char *cputag);
-void lvcards_decode(running_machine *machine, const char *cputag);
+void buckrog_decode(running_machine &machine, const char *cputag);
+void pengo_decode(running_machine &machine, const char *cputag);
+void szaxxon_decode(running_machine &machine, const char *cputag);
+void suprloco_decode(running_machine &machine, const char *cputag);
+void yamato_decode(running_machine &machine, const char *cputag);
+void toprollr_decode(running_machine &machine, const char *cputag, const char *regiontag);
+void sindbadm_decode(running_machine &machine, const char *cputag);
+void regulus_decode(running_machine &machine, const char *cputag);
+void mrviking_decode(running_machine &machine, const char *cputag);
+void swat_decode(running_machine &machine, const char *cputag);
+void flicky_decode(running_machine &machine, const char *cputag);
+void futspy_decode(running_machine &machine, const char *cputag);
+void wmatch_decode(running_machine &machine, const char *cputag);
+void bullfgtj_decode(running_machine &machine, const char *cputag);
+void pbaction_decode(running_machine &machine, const char *cputag);
+void spatter_decode(running_machine &machine, const char *cputag);
+void jongkyo_decode(running_machine &machine, const char *cputag);
+void pitfall2_decode(running_machine &machine, const char *cputag);
+void nprinces_decode(running_machine &machine, const char *cputag);
+void seganinj_decode(running_machine &machine, const char *cputag);
+void imsorry_decode(running_machine &machine, const char *cputag);
+void teddybb_decode(running_machine &machine, const char *cputag);
+void myheroj_decode(running_machine &machine, const char *cputag);
+void hvymetal_decode(running_machine &machine, const char *cputag);
+void lvcards_decode(running_machine &machine, const char *cputag);
diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c
index 697816a9f79..a8022dad835 100644
--- a/src/mame/machine/segaic16.c
+++ b/src/mame/machine/segaic16.c
@@ -35,8 +35,8 @@ struct memory_mapper_chip
UINT8 regs[0x20];
device_t *cpu;
const segaic16_memory_map_entry *map;
- void (*sound_w)(running_machine *, UINT8);
- UINT8 (*sound_r)(running_machine *);
+ void (*sound_w)(running_machine &, UINT8);
+ UINT8 (*sound_r)(running_machine &);
};
@@ -55,7 +55,7 @@ static struct memory_mapper_chip memory_mapper;
*
*************************************/
-static void update_memory_mapping(running_machine *machine, struct memory_mapper_chip *chip, int decrypt);
+static void update_memory_mapping(running_machine &machine, struct memory_mapper_chip *chip, int decrypt);
/*************************************
@@ -96,7 +96,7 @@ READ16_HANDLER( segaic16_open_bus_r )
*
*************************************/
-void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *))
+void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine &, UINT8), UINT8 (*sound_r_callback)(running_machine &))
{
struct memory_mapper_chip *chip = &memory_mapper;
@@ -108,12 +108,12 @@ void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry
chip->sound_r = sound_r_callback;
/* create the initial regions */
- update_memory_mapping(cpu->machine, chip, 0);
+ update_memory_mapping(cpu->machine(), chip, 0);
- state_save_register_item_array(cpu->machine, "segaic16_mapper", NULL, 0, chip->regs);
+ state_save_register_item_array(cpu->machine(), "segaic16_mapper", NULL, 0, chip->regs);
}
-void segaic16_memory_mapper_reset(running_machine *machine)
+void segaic16_memory_mapper_reset(running_machine &machine)
{
struct memory_mapper_chip *chip = &memory_mapper;
@@ -123,7 +123,7 @@ void segaic16_memory_mapper_reset(running_machine *machine)
}
-void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_data)
+void segaic16_memory_mapper_config(running_machine &machine, const UINT8 *map_data)
{
struct memory_mapper_chip *chip = &memory_mapper;
@@ -133,7 +133,7 @@ void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_da
}
-void segaic16_memory_mapper_set_decrypted(running_machine *machine, UINT8 *decrypted)
+void segaic16_memory_mapper_set_decrypted(running_machine &machine, UINT8 *decrypted)
{
struct memory_mapper_chip *chip = &memory_mapper;
offs_t romsize = chip->cpu->region()->bytes();
@@ -193,7 +193,7 @@ static void memory_mapper_w(address_space *space, struct memory_mapper_chip *chi
case 0x03:
if (chip->sound_w)
- (*chip->sound_w)(space->machine, data);
+ (*chip->sound_w)(space->machine(), data);
break;
case 0x04:
@@ -244,7 +244,7 @@ static void memory_mapper_w(address_space *space, struct memory_mapper_chip *chi
case 0x1c: case 0x1d:
case 0x1e: case 0x1f:
if (oldval != data)
- update_memory_mapping(space->machine, chip, 1);
+ update_memory_mapping(space->machine(), chip, 1);
break;
default:
@@ -281,7 +281,7 @@ static UINT16 memory_mapper_r(struct memory_mapper_chip *chip, offs_t offset, UI
case 0x03:
/* this returns data that the sound CPU writes */
if (chip->sound_r)
- return (*chip->sound_r)(chip->cpu->machine);
+ return (*chip->sound_r)(chip->cpu->machine());
return 0xff;
default:
@@ -292,7 +292,7 @@ static UINT16 memory_mapper_r(struct memory_mapper_chip *chip, offs_t offset, UI
}
-static void update_memory_mapping(running_machine *machine, struct memory_mapper_chip *chip, int decrypt)
+static void update_memory_mapping(running_machine &machine, struct memory_mapper_chip *chip, int decrypt)
{
int rgnum;
address_space *space = chip->cpu->memory().space(AS_PROGRAM);
@@ -725,7 +725,7 @@ static void timer_interrupt_ack( device_t *device )
ic_315_5250_state *ic_315_5250 = _315_5250_get_safe_token(device);
if (ic_315_5250->timer_ack)
- (*ic_315_5250->timer_ack)(device->machine);
+ (*ic_315_5250->timer_ack)(device->machine());
}
@@ -775,7 +775,7 @@ WRITE16_DEVICE_HANDLER ( segaic16_compare_timer_w )
case 0xf:
COMBINE_DATA(&ic_315_5250->regs[11]);
if (ic_315_5250->sound_w)
- (*ic_315_5250->sound_w)(device->machine, ic_315_5250->regs[11]);
+ (*ic_315_5250->sound_w)(device->machine(), ic_315_5250->regs[11]);
break;
}
}
diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h
index e3b105983e2..4aa70f9492b 100644
--- a/src/mame/machine/segaic16.h
+++ b/src/mame/machine/segaic16.h
@@ -26,10 +26,10 @@ struct _segaic16_memory_map_entry
const char * name; /* friendly name for debugging */
};
-void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *));
-void segaic16_memory_mapper_reset(running_machine *machine);
-void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_data);
-void segaic16_memory_mapper_set_decrypted(running_machine *machine, UINT8 *decrypted);
+void segaic16_memory_mapper_init(device_t *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine &, UINT8), UINT8 (*sound_r_callback)(running_machine &));
+void segaic16_memory_mapper_reset(running_machine &machine);
+void segaic16_memory_mapper_config(running_machine &machine, const UINT8 *map_data);
+void segaic16_memory_mapper_set_decrypted(running_machine &machine, UINT8 *decrypted);
READ8_HANDLER( segaic16_memory_mapper_r );
WRITE8_HANDLER( segaic16_memory_mapper_w );
READ16_HANDLER( segaic16_memory_mapper_lsb_r );
@@ -43,8 +43,8 @@ WRITE16_HANDLER( segaic16_memory_mapper_lsb_w );
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*_315_5250_sound_callback)(running_machine *, UINT8);
-typedef void (*_315_5250_timer_ack_callback)(running_machine *);
+typedef void (*_315_5250_sound_callback)(running_machine &, UINT8);
+typedef void (*_315_5250_timer_ack_callback)(running_machine &);
typedef struct _ic_315_5250_interface ic_315_5250_interface;
struct _ic_315_5250_interface
diff --git a/src/mame/machine/segamsys.c b/src/mame/machine/segamsys.c
index 72a2c6a860c..9cad67d5416 100644
--- a/src/mame/machine/segamsys.c
+++ b/src/mame/machine/segamsys.c
@@ -300,12 +300,12 @@ enum
GEN_VDP = 3 // Genesis VDP running in SMS2 Mode
};
-static int sms_vdp_null_irq_callback(running_machine *machine, int status)
+static int sms_vdp_null_irq_callback(running_machine &machine, int status)
{
return -1;
}
-static int sms_vdp_cpu0_irq_callback(running_machine *machine, int status)
+static int sms_vdp_cpu0_irq_callback(running_machine &machine, int status)
{
if (status == 1)
cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
@@ -315,7 +315,7 @@ static int sms_vdp_cpu0_irq_callback(running_machine *machine, int status)
return 0;
}
-static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status)
+static int sms_vdp_cpu1_irq_callback(running_machine &machine, int status)
{
if (status == 1)
cputag_set_input_line(machine, "genesis_snd_z80", 0, HOLD_LINE);
@@ -326,7 +326,7 @@ static int sms_vdp_cpu1_irq_callback(running_machine *machine, int status)
}
-static int sms_vdp_cpu2_irq_callback(running_machine *machine, int status)
+static int sms_vdp_cpu2_irq_callback(running_machine &machine, int status)
{
if (status == 1)
cputag_set_input_line(machine, "mtbios", 0, HOLD_LINE);
@@ -378,13 +378,13 @@ struct sms_vdp
int sms_framerate;
emu_timer* sms_scanline_timer;
UINT16* cram_mamecolours; // for use on RGB_DIRECT screen
- int (*set_irq)(running_machine *machine, int state);
+ int (*set_irq)(running_machine &machine, int state);
};
-static void *start_vdp(running_machine *machine, int type)
+static void *start_vdp(running_machine &machine, int type)
{
struct sms_vdp *chip;
@@ -438,7 +438,7 @@ static void *start_vdp(running_machine *machine, int type)
chip->writemode = 0;
chip->r_bitmap = auto_bitmap_alloc(machine, 256, 256, BITMAP_FORMAT_RGB15);
- chip->sms_scanline_timer = machine->scheduler().timer_alloc(FUNC(sms_scanline_timer_callback), chip);
+ chip->sms_scanline_timer = machine.scheduler().timer_alloc(FUNC(sms_scanline_timer_callback), chip);
return chip;
}
@@ -521,7 +521,7 @@ static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
r = (palword & 0x000f)>>0;
g = (palword & 0x00f0)>>4;
b = (palword & 0x0f00)>>8;
- palette_set_color_rgb(space->machine,(chip->addr_reg&0x3e)/2, pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(),(chip->addr_reg&0x3e)/2, pal4bit(r), pal4bit(g), pal4bit(b));
chip->cram_mamecolours[(chip->addr_reg&0x3e)/2]=(b<<1)|(g<<6)|(r<<11);
}
}
@@ -536,7 +536,7 @@ static void vdp_data_w(address_space *space, UINT8 data, struct sms_vdp* chip)
r = (data & 0x03)>>0;
g = (data & 0x0c)>>2;
b = (data & 0x30)>>4;
- palette_set_color_rgb(space->machine,chip->addr_reg&0x1f, pal2bit(r), pal2bit(g), pal2bit(b));
+ palette_set_color_rgb(space->machine(),chip->addr_reg&0x1f, pal2bit(r), pal2bit(g), pal2bit(b));
chip->cram_mamecolours[chip->addr_reg&0x1f]=(b<<3)|(g<<8)|(r<<13);
}
@@ -563,7 +563,7 @@ static UINT8 vdp_ctrl_r(address_space *space, struct sms_vdp *chip)
chip->sprite_collision = 0;
chip->sprite_overflow = 0;
- (chip->set_irq)(space->machine, 0); // clear IRQ;
+ (chip->set_irq)(space->machine(), 0); // clear IRQ;
return retvalue;
@@ -576,7 +576,7 @@ static void vdp_update_code_addr_regs(struct sms_vdp *chip)
chip->cmd_reg = (chip->cmd_part2&0xc0)>>6;
}
-static void vdp_set_register(running_machine *machine, struct sms_vdp *chip)
+static void vdp_set_register(running_machine &machine, struct sms_vdp *chip)
{
UINT8 reg = chip->cmd_part2&0x0f;
chip->regs[reg] = chip->cmd_part1;
@@ -634,7 +634,7 @@ static void vdp_ctrl_w(address_space *space, UINT8 data, struct sms_vdp *chip)
break;
case 0x2: /* REG setting */
- vdp_set_register(space->machine, chip);
+ vdp_set_register(space->machine(), chip);
chip->writemode = 0;
break;
@@ -1137,7 +1137,7 @@ static void show_tiles(struct sms_vdp* chip)
Even though some games set bit 7, it does nothing.
*/
-static void end_of_frame(running_machine *machine, struct sms_vdp *chip)
+static void end_of_frame(running_machine &machine, struct sms_vdp *chip)
{
UINT8 m1 = (chip->regs[0x1]&0x10)>>4;
UINT8 m2 = (chip->regs[0x0]&0x02)>>1;
@@ -1155,7 +1155,7 @@ static void end_of_frame(running_machine *machine, struct sms_vdp *chip)
visarea.min_y = 0;
visarea.max_y = sms_mode_table[chip->screen_mode].sms2_height-1;
- if (chip->chip_id==3) machine->primary_screen->configure(256, 256, visarea, HZ_TO_ATTOSECONDS(chip->sms_framerate));
+ if (chip->chip_id==3) machine.primary_screen->configure(256, 256, visarea, HZ_TO_ATTOSECONDS(chip->sms_framerate));
}
else /* 160x144 */
@@ -1166,7 +1166,7 @@ static void end_of_frame(running_machine *machine, struct sms_vdp *chip)
visarea.min_y = (192-144)/2;
visarea.max_y = (192-144)/2+144-1;
- machine->primary_screen->configure(256, 256, visarea, HZ_TO_ATTOSECONDS(chip->sms_framerate));
+ machine.primary_screen->configure(256, 256, visarea, HZ_TO_ATTOSECONDS(chip->sms_framerate));
}
@@ -1379,7 +1379,7 @@ WRITE8_HANDLER( sms_vdp_2_ctrl_w )
}
-void init_for_megadrive(running_machine *machine)
+void init_for_megadrive(running_machine &machine)
{
md_sms_vdp = (struct sms_vdp *)start_vdp(machine, GEN_VDP);
md_sms_vdp->set_irq = sms_vdp_cpu1_irq_callback;
@@ -1457,7 +1457,7 @@ DRIVER_INIT( sms )
smsgg_backupram = 0;
}
-static UINT8 ioport_gg00_r(running_machine* machine)
+static UINT8 ioport_gg00_r(running_machine& machine)
{
UINT8 GG_START_BUTTON = input_port_read_safe(machine,"GGSTART",0x00);
@@ -1474,13 +1474,13 @@ static UINT8 ioport_gg00_r(running_machine* machine)
READ8_HANDLER( sms_ioport_gg00_r )
{
- return ioport_gg00_r(space->machine);
+ return ioport_gg00_r(space->machine());
}
-void init_extra_gg_ports(running_machine* machine, const char* tag)
+void init_extra_gg_ports(running_machine& machine, const char* tag)
{
- address_space *io = machine->device(tag)->memory().space(AS_IO);
+ address_space *io = machine.device(tag)->memory().space(AS_IO);
io->install_legacy_read_handler (0x00, 0x00, FUNC(sms_ioport_gg00_r));
}
@@ -1559,7 +1559,7 @@ static UINT8* sms_rom;
/* the SMS inputs should be more complex, like the megadrive ones */
READ8_HANDLER (megatech_sms_ioport_dc_r)
{
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 4: TL-A; bit 5: TR-A */
return (input_port_read(machine, "PAD1") & 0x3f) | ((input_port_read(machine, "PAD2") & 0x03) << 6);
@@ -1567,7 +1567,7 @@ READ8_HANDLER (megatech_sms_ioport_dc_r)
READ8_HANDLER (megatech_sms_ioport_dd_r)
{
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
/* 2009-05 FP: would it be worth to give separate inputs to SMS? SMS has only 2 keys A,B (which are B,C on megadrive) */
/* bit 2: TL-B; bit 3: TR-B; bit 4: RESET; bit 5: unused; bit 6: TH-A; bit 7: TH-B*/
return ((input_port_read(machine, "PAD2") & 0x3c) >> 2) | 0x10;
@@ -1608,13 +1608,13 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
//printf("bank ram??\n");
break;
case 1:
- memcpy(sms_rom+0x0000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 2:
- memcpy(sms_rom+0x4000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
break;
case 3:
- memcpy(sms_rom+0x8000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
break;
}
@@ -1623,28 +1623,28 @@ static WRITE8_HANDLER( mt_sms_standard_rom_bank_w )
static WRITE8_HANDLER( codemasters_rom_bank_0000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x0000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x0000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_4000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x4000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x4000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
}
static WRITE8_HANDLER( codemasters_rom_bank_8000_w )
{
int bank = data&0x1f;
- memcpy(sms_rom+0x8000, space->machine->region("maincpu")->base()+bank*0x4000, 0x4000);
+ memcpy(sms_rom+0x8000, space->machine().region("maincpu")->base()+bank*0x4000, 0x4000);
}
-static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine, const char* tag)
+static void megatech_set_genz80_as_sms_standard_ports(running_machine &machine, const char* tag)
{
/* INIT THE PORTS *********************************************************************************************/
- address_space *io = machine->device(tag)->memory().space(AS_IO);
- device_t *sn = machine->device("snsnd");
+ address_space *io = machine.device(tag)->memory().space(AS_IO);
+ device_t *sn = machine.device("snsnd");
io->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_port_r), FUNC(z80_unmapped_port_w));
@@ -1661,36 +1661,36 @@ static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine,
io->install_legacy_read_handler (0xdf, 0xdf, FUNC(megatech_sms_ioport_dd_r)); // adams family
}
-void megatech_set_genz80_as_sms_standard_map(running_machine *machine, const char* tag, int mapper)
+void megatech_set_genz80_as_sms_standard_map(running_machine &machine, const char* tag, int mapper)
{
/* INIT THE MEMMAP / BANKING *********************************************************************************/
/* catch any addresses that don't get mapped */
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0000, 0xffff, FUNC(z80_unmapped_r), FUNC(z80_unmapped_w));
/* main ram area */
- sms_mainram = (UINT8 *)machine->device(tag)->memory().space(AS_PROGRAM)->install_ram(0xc000, 0xdfff, 0, 0x2000);
+ sms_mainram = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM)->install_ram(0xc000, 0xdfff, 0, 0x2000);
memset(sms_mainram,0x00,0x2000);
megatech_set_genz80_as_sms_standard_ports(machine, tag);
/* fixed rom bank area */
- sms_rom = (UINT8 *)machine->device(tag)->memory().space(AS_PROGRAM)->install_rom(0x0000, 0xbfff, NULL);
+ sms_rom = (UINT8 *)machine.device(tag)->memory().space(AS_PROGRAM)->install_rom(0x0000, 0xbfff, NULL);
- memcpy(sms_rom, machine->region("maincpu")->base(), 0xc000);
+ memcpy(sms_rom, machine.region("maincpu")->base(), 0xc000);
if (mapper == MAPPER_STANDARD )
{
- machine->device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfffc, 0xffff, FUNC(mt_sms_standard_rom_bank_w));
+ machine.device(tag)->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfffc, 0xffff, FUNC(mt_sms_standard_rom_bank_w));
}
else if (mapper == MAPPER_CODEMASTERS )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000, 0x0000, FUNC(codemasters_rom_bank_0000_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4000, 0x4000, FUNC(codemasters_rom_bank_4000_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8000, FUNC(codemasters_rom_bank_8000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000, 0x0000, FUNC(codemasters_rom_bank_0000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4000, 0x4000, FUNC(codemasters_rom_bank_4000_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0x8000, FUNC(codemasters_rom_bank_8000_w));
}
// smsgg_backupram = NULL;
}
diff --git a/src/mame/machine/segas24.c b/src/mame/machine/segas24.c
index 5dafe40966f..384ec37d927 100644
--- a/src/mame/machine/segas24.c
+++ b/src/mame/machine/segas24.c
@@ -9,13 +9,13 @@
#ifdef UNUSED_FUNCTION
READ16_HANDLER( system24temp_sys16_shared_ram_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
return state->system24temp_sys16_shared_ram[offset];
}
WRITE16_HANDLER( system24temp_sys16_shared_ram_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
COMBINE_DATA(state->system24temp_sys16_shared_ram + offset);
}
#endif
@@ -27,14 +27,14 @@ WRITE16_HANDLER( system24temp_sys16_shared_ram_w )
*/
void system24temp_sys16_io_set_callbacks(
- running_machine *machine,
- UINT8 (*io_r)(running_machine *machine, int port),
- void (*io_w)(running_machine *machine, int port, UINT8 data),
+ running_machine &machine,
+ UINT8 (*io_r)(running_machine &machine, int port),
+ void (*io_w)(running_machine &machine, int port, UINT8 data),
void (*cnt_w)(address_space *space, UINT8 data),
read16_space_func iod_r,
write16_space_func iod_w)
{
- segas24_state *state = machine->driver_data<segas24_state>();
+ segas24_state *state = machine.driver_data<segas24_state>();
state->system24temp_sys16_io_io_r = io_r;
state->system24temp_sys16_io_io_w = io_w;
state->system24temp_sys16_io_cnt_w = cnt_w;
@@ -46,10 +46,10 @@ void system24temp_sys16_io_set_callbacks(
READ16_HANDLER ( system24temp_sys16_io_r )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
// logerror("IO read %02x (%s:%x)\n", offset, space->cpu->tag(), cpu_get_pc(space->cpu));
if(offset < 8)
- return state->system24temp_sys16_io_io_r ? state->system24temp_sys16_io_io_r(space->machine,offset) : 0xff;
+ return state->system24temp_sys16_io_io_r ? state->system24temp_sys16_io_io_r(space->machine(),offset) : 0xff;
else if (offset < 0x20) {
switch(offset) {
case 0x8:
@@ -80,7 +80,7 @@ READ32_HANDLER(system24temp_sys16_io_dword_r)
WRITE16_HANDLER( system24temp_sys16_io_w )
{
- segas24_state *state = space->machine->driver_data<segas24_state>();
+ segas24_state *state = space->machine().driver_data<segas24_state>();
if(ACCESSING_BITS_0_7) {
if(offset < 8) {
if(!(state->system24temp_sys16_io_dir & (1 << offset))) {
@@ -88,7 +88,7 @@ WRITE16_HANDLER( system24temp_sys16_io_w )
return;
}
if(state->system24temp_sys16_io_io_w)
- state->system24temp_sys16_io_io_w(space->machine, offset, data);
+ state->system24temp_sys16_io_io_w(space->machine(), offset, data);
} else if (offset < 0x20) {
switch(offset) {
case 0xe:
diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c
index 5904450ab9c..12ad0624d6f 100644
--- a/src/mame/machine/segas32.c
+++ b/src/mame/machine/segas32.c
@@ -33,10 +33,10 @@ const UINT8 ga2_v25_opcode_table[256] = {
#undef xxxx
-void decrypt_ga2_protrom(running_machine *machine)
+void decrypt_ga2_protrom(running_machine &machine)
{
int i;
- UINT8 *rom = machine->region("mcu")->base();
+ UINT8 *rom = machine.region("mcu")->base();
UINT8* temp = auto_alloc_array(machine, UINT8, 0x100000);
// make copy of ROM so original can be overwritten
@@ -56,7 +56,7 @@ WRITE16_HANDLER( ga2_dpram_w )
READ16_HANDLER( ga2_dpram_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return (state->ga2_dpram[offset])|(state->ga2_dpram[offset+1]<<8);
}
@@ -103,7 +103,7 @@ READ16_HANDLER(ga2_wakeup_protection_r)
WRITE16_HANDLER(sonic_level_load_protection)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
UINT16 level;
//Perform write
state->system32_workram[CLEARED_LEVELS / 2] = (data & mem_mask) | (state->system32_workram[CLEARED_LEVELS / 2] & ~mem_mask);
@@ -115,7 +115,7 @@ WRITE16_HANDLER(sonic_level_load_protection)
}
else
{
- const UINT8 *ROM = space->machine->region("maincpu")->base();
+ const UINT8 *ROM = space->machine().region("maincpu")->base();
level = *((ROM + LEVEL_ORDER_ARRAY) + (state->system32_workram[CLEARED_LEVELS / 2] * 2) - 1);
level |= *((ROM + LEVEL_ORDER_ARRAY) + (state->system32_workram[CLEARED_LEVELS / 2] * 2) - 2) << 8;
}
@@ -138,7 +138,7 @@ WRITE16_HANDLER(sonic_level_load_protection)
// and can write things into work RAM. we simulate that here for burning rival.
READ16_HANDLER(brival_protection_r)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (mem_mask == 0xffff) // only trap on word-wide reads
{
switch (offset)
@@ -155,7 +155,7 @@ READ16_HANDLER(brival_protection_r)
WRITE16_HANDLER(brival_protection_w)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
static const int protAddress[6][2] =
{
{ 0x109517, 0x00/2 },
@@ -167,7 +167,7 @@ WRITE16_HANDLER(brival_protection_w)
};
char ret[32];
int curProtType;
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
switch (offset)
{
@@ -307,7 +307,7 @@ READ16_HANDLER(arf_wakeup_protection_r)
******************************************************************************/
WRITE16_HANDLER( jleague_protection_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA( &state->system32_workram[0xf700/2 + offset ] );
switch( offset )
@@ -351,7 +351,7 @@ WRITE16_HANDLER( jleague_protection_w )
READ16_HANDLER( arescue_dsp_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if( offset == 4/2 )
{
switch( state->arescue_dsp_io[0] )
@@ -381,7 +381,7 @@ READ16_HANDLER( arescue_dsp_r )
WRITE16_HANDLER( arescue_dsp_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA(&state->arescue_dsp_io[offset]);
}
diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c
index ad48da6a477..37566a4c05c 100644
--- a/src/mame/machine/seicop.c
+++ b/src/mame/machine/seicop.c
@@ -1433,7 +1433,7 @@ static UINT8 cop_rng_max_value;
static UINT16 copd2_offs = 0;
-static void copd2_set_tableoffset(running_machine *machine, UINT16 data)
+static void copd2_set_tableoffset(running_machine &machine, UINT16 data)
{
//logerror("mcu_offs %04x\n", data);
copd2_offs = data;
@@ -1450,7 +1450,7 @@ static void copd2_set_tableoffset(running_machine *machine, UINT16 data)
{
FILE *fp;
char filename[256];
- sprintf(filename,"copdat_%s.table2", machine->system().name);
+ sprintf(filename,"copdat_%s.table2", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -1461,7 +1461,7 @@ static void copd2_set_tableoffset(running_machine *machine, UINT16 data)
{
FILE *fp;
char filename[256];
- sprintf(filename,"copdat_%s.table3", machine->system().name);
+ sprintf(filename,"copdat_%s.table3", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -1472,7 +1472,7 @@ static void copd2_set_tableoffset(running_machine *machine, UINT16 data)
{
FILE *fp;
char filename[256];
- sprintf(filename,"copdat_%s.table4", machine->system().name);
+ sprintf(filename,"copdat_%s.table4", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -1505,7 +1505,7 @@ static void copd2_set_tableoffset(running_machine *machine, UINT16 data)
}
-static void copd2_set_tabledata(running_machine *machine, UINT16 data)
+static void copd2_set_tabledata(running_machine &machine, UINT16 data)
{
copd2_table[copd2_offs] = data;
//logerror("mcu_data %04x\n", data);
@@ -1513,7 +1513,7 @@ static void copd2_set_tabledata(running_machine *machine, UINT16 data)
{
FILE *fp;
char filename[256];
- sprintf(filename,"copdat_%s.data", machine->system().name);
+ sprintf(filename,"copdat_%s.data", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -1529,12 +1529,12 @@ static UINT16 seibu_vregs[0x50/2];
static WRITE16_HANDLER( seibu_common_video_regs_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&seibu_vregs[offset]);
switch(offset)
{
- case (0x01a/2): { flip_screen_set(space->machine, seibu_vregs[offset] & 0x01); break; }
+ case (0x01a/2): { flip_screen_set(space->machine(), seibu_vregs[offset] & 0x01); break; }
case (0x01c/2): { state->layer_disable = seibu_vregs[offset]; break; }
case (0x020/2): { state->scrollram16[0] = seibu_vregs[offset]; break; }
case (0x022/2): { state->scrollram16[1] = seibu_vregs[offset]; break; }
@@ -1680,17 +1680,17 @@ READ16_HANDLER( copdxbl_0_r )
//case (0x5b4/2):
// return cop_mcu_ram[offset];
- case (0x700/2): return input_port_read(space->machine, "DSW1");
- case (0x704/2): return input_port_read(space->machine, "PLAYERS12");
- case (0x708/2): return input_port_read(space->machine, "PLAYERS34");
- case (0x70c/2): return input_port_read(space->machine, "SYSTEM");
- case (0x71c/2): return input_port_read(space->machine, "DSW2");
+ case (0x700/2): return input_port_read(space->machine(), "DSW1");
+ case (0x704/2): return input_port_read(space->machine(), "PLAYERS12");
+ case (0x708/2): return input_port_read(space->machine(), "PLAYERS34");
+ case (0x70c/2): return input_port_read(space->machine(), "SYSTEM");
+ case (0x71c/2): return input_port_read(space->machine(), "DSW2");
}
}
WRITE16_HANDLER( copdxbl_0_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&cop_mcu_ram[offset]);
switch(offset)
@@ -1714,7 +1714,7 @@ WRITE16_HANDLER( copdxbl_0_w )
case (0x740/2):
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
break;
}
}
@@ -1814,7 +1814,7 @@ static UINT16 u1,u2;
u1 == _u1_ && u2 == _u2_) \
-static UINT8 cop_calculate_collsion_detection(running_machine *machine)
+static UINT8 cop_calculate_collsion_detection(running_machine &machine)
{
static UINT8 res;
@@ -1885,7 +1885,7 @@ static READ16_HANDLER( generic_cop_r )
case 0x1a2/2:
case 0x1a4/2:
case 0x1a6/2:
- return space->machine->firstcpu->total_cycles() % (cop_rng_max_value+1);
+ return space->machine().firstcpu->total_cycles() % (cop_rng_max_value+1);
case 0x1b0/2:
return cop_status;
@@ -1983,8 +1983,8 @@ static WRITE16_HANDLER( generic_cop_w )
break;
/* Command tables for 0x500 / 0x502 commands */
- case (0x032/2): { copd2_set_tabledata(space->machine, data); break; }
- case (0x034/2): { copd2_set_tableoffset(space->machine, data); break; }
+ case (0x032/2): { copd2_set_tabledata(space->machine(), data); break; }
+ case (0x034/2): { copd2_set_tableoffset(space->machine(), data); break; }
case (0x038/2): { cop_438 = data; break; }
case (0x03a/2): { cop_43a = data; break; }
case (0x03c/2): { cop_43c = data; break; }
@@ -2342,7 +2342,7 @@ static WRITE16_HANDLER( generic_cop_w )
cop_collision_info[0].max_y = cop_collision_info[0].y + (0x10 << 16);
}
/* do the math */
- cop_hit_status = cop_calculate_collsion_detection(space->machine);
+ cop_hit_status = cop_calculate_collsion_detection(space->machine());
return;
}
@@ -2368,7 +2368,7 @@ static WRITE16_HANDLER( generic_cop_w )
//popmessage("0: %08x %08x %08x 1: %08x %08x %08x",cop_collision_info[0].x,cop_collision_info[0].y,cop_collision_info[0].hitbox,cop_collision_info[1].x,cop_collision_info[1].y,cop_collision_info[1].hitbox);
/* do the math */
- cop_hit_status = cop_calculate_collsion_detection(space->machine);
+ cop_hit_status = cop_calculate_collsion_detection(space->machine());
return;
}
@@ -2734,7 +2734,7 @@ READ16_HANDLER( heatbrl_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
return generic_cop_r(space, offset, mem_mask);
@@ -2747,7 +2747,7 @@ WRITE16_HANDLER( heatbrl_mcu_w )
/* external pin register, used for banking */
if(offset == 0x070/2)
{
- heatbrl_setgfxbank(space->machine, cop_mcu_ram[offset]);
+ heatbrl_setgfxbank(space->machine(), cop_mcu_ram[offset]);
return;
}
@@ -2784,12 +2784,12 @@ READ16_HANDLER( cupsoc_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
}
return generic_cop_r(space, offset, mem_mask);
@@ -2826,12 +2826,12 @@ READ16_HANDLER( cupsocs_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
if(offset == 0x31c/2)
{
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
}
return generic_cop_r(space, offset, mem_mask);
@@ -2878,7 +2878,7 @@ READ16_HANDLER( godzilla_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
return generic_cop_r(space, offset, mem_mask);
@@ -2890,7 +2890,7 @@ WRITE16_HANDLER( godzilla_mcu_w )
if(offset == 0x070/2)
{
- denjinmk_setgfxbank(space->machine, cop_mcu_ram[offset]);
+ denjinmk_setgfxbank(space->machine(), cop_mcu_ram[offset]);
return;
}
@@ -2925,12 +2925,12 @@ READ16_HANDLER( denjinmk_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
}
return generic_cop_r(space, offset, mem_mask);
@@ -2945,7 +2945,7 @@ WRITE16_HANDLER( denjinmk_mcu_w )
if(offset == 0x070/2)
{
- denjinmk_setgfxbank(space->machine, cop_mcu_ram[offset]);
+ denjinmk_setgfxbank(space->machine(), cop_mcu_ram[offset]);
return;
}
@@ -2977,12 +2977,12 @@ READ16_HANDLER( grainbow_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "PLAYERS34", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
if(offset == 0x35c/2)
{
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
}
return generic_cop_r(space, offset, mem_mask);
@@ -3025,7 +3025,7 @@ READ16_HANDLER( legionna_mcu_r )
{
static const char *const portnames[] = { "DSW1", "PLAYERS12", "UNK", "SYSTEM" };
- return input_port_read(space->machine, portnames[(offset >> 1) & 3]);
+ return input_port_read(space->machine(), portnames[(offset >> 1) & 3]);
}
return generic_cop_r(space, offset, mem_mask);
diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c
index d1ccf45afcc..25081463a4e 100644
--- a/src/mame/machine/simpsons.c
+++ b/src/mame/machine/simpsons.c
@@ -13,15 +13,15 @@
WRITE8_HANDLER( simpsons_eeprom_w )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
if (data == 0xff)
return;
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
state->video_bank = data & 0x03;
- simpsons_video_banking(space->machine, state->video_bank);
+ simpsons_video_banking(space->machine(), state->video_bank);
state->firq_enabled = data & 0x04;
}
@@ -34,11 +34,11 @@ WRITE8_HANDLER( simpsons_eeprom_w )
WRITE8_HANDLER( simpsons_coin_counter_w )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
/* bit 0,1 coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 selects mono or stereo sound */
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
@@ -49,7 +49,7 @@ WRITE8_HANDLER( simpsons_coin_counter_w )
READ8_HANDLER( simpsons_sound_interrupt_r )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff );
return 0x00;
}
@@ -68,48 +68,48 @@ READ8_DEVICE_HANDLER( simpsons_sound_r )
static KONAMI_SETLINES_CALLBACK( simpsons_banking )
{
- memory_set_bank(device->machine, "bank1", lines & 0x3f);
+ memory_set_bank(device->machine(), "bank1", lines & 0x3f);
}
static STATE_POSTLOAD( simpsons_postload )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
simpsons_video_banking(machine, state->video_bank);
}
MACHINE_START( simpsons )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x1000);
state->xtraram = auto_alloc_array_clear(machine, UINT8, 0x1000);
state->spriteram = auto_alloc_array_clear(machine, UINT16, 0x1000 / 2);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053260 = machine->device("k053260");
- state->k052109 = machine->device("k052109");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053260 = machine.device("k053260");
+ state->k052109 = machine.device("k052109");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->firq_enabled));
state->save_item(NAME(state->video_bank));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
state->save_item(NAME(state->layerpri));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x1000);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x1000);
state->save_pointer(NAME(state->xtraram), 0x1000);
state->save_pointer(NAME(state->spriteram), 0x1000 / 2);
- machine->state().register_postload(simpsons_postload, NULL);
+ machine.state().register_postload(simpsons_postload, NULL);
}
MACHINE_RESET( simpsons )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
int i;
- konami_configure_set_lines(machine->device("maincpu"), simpsons_banking);
+ konami_configure_set_lines(machine.device("maincpu"), simpsons_banking);
for (i = 0; i < 3; i++)
{
@@ -122,11 +122,11 @@ MACHINE_RESET( simpsons )
state->video_bank = 0;
/* init the default banks */
- memory_configure_bank(machine, "bank1", 0, 64, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 64, machine.region("maincpu")->base() + 0x10000, 0x2000);
memory_set_bank(machine, "bank1", 0);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0);
- memory_configure_bank(machine, "bank2", 2, 6, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0);
+ memory_configure_bank(machine, "bank2", 2, 6, machine.region("audiocpu")->base() + 0x10000, 0x4000);
memory_set_bank(machine, "bank2", 0);
simpsons_video_banking(machine, 0);
diff --git a/src/mame/machine/slapfght.c b/src/mame/machine/slapfght.c
index afe6b0d5e86..5066da93e03 100644
--- a/src/mame/machine/slapfght.c
+++ b/src/mame/machine/slapfght.c
@@ -14,7 +14,7 @@
/* Perform basic machine initialisation */
MACHINE_RESET( slapfight )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
/* MAIN CPU */
state->slapfight_status_state=0;
@@ -39,15 +39,15 @@ MACHINE_RESET( slapfight )
/* Reset and hold sound CPU */
WRITE8_HANDLER( slapfight_port_00_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
state->getstar_sh_intenabled = 0;
}
/* Release reset on sound CPU */
WRITE8_HANDLER( slapfight_port_01_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
/* Disable and clear hardware interrupt */
@@ -64,23 +64,23 @@ WRITE8_HANDLER( slapfight_port_07_w )
WRITE8_HANDLER( slapfight_port_08_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&RAM[0x10000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x10000]);
}
WRITE8_HANDLER( slapfight_port_09_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&RAM[0x14000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x14000]);
}
/* Status register */
READ8_HANDLER( slapfight_port_00_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
static const int states[3]={ 0xc7, 0x55, 0x00 };
state->slapfight_status = states[state->slapfight_status_state];
@@ -93,37 +93,37 @@ READ8_HANDLER( slapfight_port_00_r )
READ8_HANDLER( slapfight_68705_portA_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
return (state->portA_out & state->ddrA) | (state->portA_in & ~state->ddrA);
}
WRITE8_HANDLER( slapfight_68705_portA_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portA_out = data;
}
WRITE8_HANDLER( slapfight_68705_ddrA_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrA = data;
}
READ8_HANDLER( slapfight_68705_portB_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
return (state->portB_out & state->ddrB) | (state->portB_in & ~state->ddrB);
}
WRITE8_HANDLER( slapfight_68705_portB_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
if ((state->ddrB & 0x02) && (~data & 0x02) && (state->portB_out & 0x02))
{
state->portA_in = state->from_main;
if (state->main_sent)
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
state->main_sent = 0;
}
@@ -146,13 +146,13 @@ WRITE8_HANDLER( slapfight_68705_portB_w )
WRITE8_HANDLER( slapfight_68705_ddrB_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrB = data;
}
READ8_HANDLER( slapfight_68705_portC_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portC_in = 0;
if (state->main_sent)
@@ -165,34 +165,34 @@ READ8_HANDLER( slapfight_68705_portC_r )
WRITE8_HANDLER( slapfight_68705_portC_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portC_out = data;
}
WRITE8_HANDLER( slapfight_68705_ddrC_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrC = data;
}
WRITE8_HANDLER( slapfight_mcu_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->from_main = data;
state->main_sent = 1;
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
}
READ8_HANDLER( slapfight_mcu_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->mcu_sent = 0;
return state->from_mcu;
}
READ8_HANDLER( slapfight_mcu_status_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
int res = 0;
if (!state->main_sent)
@@ -211,7 +211,7 @@ READ8_HANDLER( slapfight_mcu_status_r )
READ8_HANDLER( getstar_e803_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
UINT16 tmp = 0; /* needed for values computed on 16 bits */
UINT8 getstar_val = 0;
UINT8 phase_lookup_table[] = {0x00, 0x01, 0x03, 0xff, 0xff, 0x02, 0x05, 0xff, 0xff, 0x05}; /* table at 0x0e05 in 'gtstarb1' */
@@ -313,7 +313,7 @@ READ8_HANDLER( getstar_e803_r )
WRITE8_HANDLER( getstar_e803_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
switch (state->getstar_id)
{
case GETSTAR:
@@ -769,7 +769,7 @@ WRITE8_HANDLER( getstar_e803_w )
/* Enable hardware interrupt of sound cpu */
WRITE8_HANDLER( getstar_sh_intenable_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->getstar_sh_intenabled = 1;
logerror("cpu #1 PC=%d: %d written to a0e0\n",cpu_get_pc(space->cpu),data);
}
@@ -779,7 +779,7 @@ WRITE8_HANDLER( getstar_sh_intenable_w )
/* Generate interrups only if they have been enabled */
INTERRUPT_GEN( getstar_interrupt )
{
- slapfght_state *state = device->machine->driver_data<slapfght_state>();
+ slapfght_state *state = device->machine().driver_data<slapfght_state>();
if (state->getstar_sh_intenabled)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -800,13 +800,13 @@ WRITE8_HANDLER( getstar_port_04_w )
READ8_HANDLER( tigerh_68705_portA_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
return (state->portA_out & state->ddrA) | (state->portA_in & ~state->ddrA);
}
WRITE8_HANDLER( tigerh_68705_portA_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portA_out = data;//?
state->from_mcu = state->portA_out;
state->mcu_sent = 1;
@@ -814,24 +814,24 @@ WRITE8_HANDLER( tigerh_68705_portA_w )
WRITE8_HANDLER( tigerh_68705_ddrA_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrA = data;
}
READ8_HANDLER( tigerh_68705_portB_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
return (state->portB_out & state->ddrB) | (state->portB_in & ~state->ddrB);
}
WRITE8_HANDLER( tigerh_68705_portB_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
if ((state->ddrB & 0x02) && (~data & 0x02) && (state->portB_out & 0x02))
{
state->portA_in = state->from_main;
- if (state->main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ if (state->main_sent) cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
state->main_sent = 0;
}
if ((state->ddrB & 0x04) && (data & 0x04) && (~state->portB_out & 0x04))
@@ -845,14 +845,14 @@ WRITE8_HANDLER( tigerh_68705_portB_w )
WRITE8_HANDLER( tigerh_68705_ddrB_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrB = data;
}
READ8_HANDLER( tigerh_68705_portC_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portC_in = 0;
if (!state->main_sent) state->portC_in |= 0x01;
if (state->mcu_sent) state->portC_in |= 0x02;
@@ -861,35 +861,35 @@ READ8_HANDLER( tigerh_68705_portC_r )
WRITE8_HANDLER( tigerh_68705_portC_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->portC_out = data;
}
WRITE8_HANDLER( tigerh_68705_ddrC_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->ddrC = data;
}
WRITE8_HANDLER( tigerh_mcu_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->from_main = data;
state->main_sent = 1;
state->mcu_sent = 0;
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
}
READ8_HANDLER( tigerh_mcu_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->mcu_sent = 0;
return state->from_mcu;
}
READ8_HANDLER( tigerh_mcu_status_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
int res = 0;
if (!state->main_sent) res |= 0x02;
if (!state->mcu_sent) res |= 0x04;
@@ -899,7 +899,7 @@ READ8_HANDLER( tigerh_mcu_status_r )
READ8_HANDLER( tigerhb_e803_r )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
UINT8 tigerhb_val = 0;
switch (state->tigerhb_cmd)
{
@@ -915,7 +915,7 @@ READ8_HANDLER( tigerhb_e803_r )
WRITE8_HANDLER( tigerhb_e803_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
switch (data)
{
/* hardware test */
@@ -939,5 +939,5 @@ WRITE8_HANDLER( tigerhb_e803_w )
READ8_HANDLER( perfrman_port_00_r )
{
/* TODO */
- return space->machine->rand() & 1;
+ return space->machine().rand() & 1;
}
diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c
index af2457f6ef0..990ccd27467 100644
--- a/src/mame/machine/slapstic.c
+++ b/src/mame/machine/slapstic.c
@@ -795,7 +795,7 @@ static UINT8 bit_xor;
static struct slapstic_data slapstic;
-static void slapstic_log(running_machine *machine, offs_t offset);
+static void slapstic_log(running_machine &machine, offs_t offset);
static FILE *slapsticlog;
@@ -805,9 +805,9 @@ static FILE *slapsticlog;
*
*************************************/
-void slapstic_init(running_machine *machine, int chip)
+void slapstic_init(running_machine &machine, int chip)
{
- device_type cputype = machine->device("maincpu")->type();
+ device_type cputype = machine.device("maincpu")->type();
/* only a small number of chips are known to exist */
if (chip < 101 || chip > 118)
@@ -1121,7 +1121,7 @@ int slapstic_tweak(address_space *space, offs_t offset)
/* log this access */
if (LOG_SLAPSTIC)
- slapstic_log(space->machine, offset);
+ slapstic_log(space->machine(), offset);
/* return the active bank */
return current_bank;
@@ -1135,7 +1135,7 @@ int slapstic_tweak(address_space *space, offs_t offset)
*
*************************************/
-static void slapstic_log(running_machine *machine, offs_t offset)
+static void slapstic_log(running_machine &machine, offs_t offset)
{
static attotime last_time;
@@ -1143,13 +1143,13 @@ static void slapstic_log(running_machine *machine, offs_t offset)
slapsticlog = fopen("slapstic.log", "w");
if (slapsticlog)
{
- attotime time = machine->time();
+ attotime time = machine.time();
if ((time - last_time) > attotime::from_seconds(1))
fprintf(slapsticlog, "------------------------------------\n");
last_time = time;
- fprintf(slapsticlog, "%s: %04X B=%d ", machine->describe_context(), offset, current_bank);
+ fprintf(slapsticlog, "%s: %04X B=%d ", machine.describe_context(), offset, current_bank);
switch (state)
{
case DISABLED:
diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c
index 6c971af637e..37e8df9c279 100644
--- a/src/mame/machine/slikshot.c
+++ b/src/mame/machine/slikshot.c
@@ -382,9 +382,9 @@ static void words_to_sensors(UINT16 word1, UINT16 word2, UINT16 word3, UINT8 bea
*
*************************************/
-static void compute_sensors(running_machine *machine)
+static void compute_sensors(running_machine &machine)
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
UINT16 inter1, inter2, inter3;
UINT16 word1 = 0, word2 = 0, word3 = 0;
UINT8 beams;
@@ -398,7 +398,7 @@ static void compute_sensors(running_machine *machine)
inters_to_words(inter1, inter2, inter3, &beams, &word1, &word2, &word3);
words_to_sensors(word1, word2, word3, beams, &state->sensor0, &state->sensor1, &state->sensor2, &state->sensor3);
- logerror("%15f: Sensor values: %04x %04x %04x %04x\n", machine->time().as_double(), state->sensor0, state->sensor1, state->sensor2, state->sensor3);
+ logerror("%15f: Sensor values: %04x %04x %04x %04x\n", machine.time().as_double(), state->sensor0, state->sensor1, state->sensor2, state->sensor3);
}
@@ -411,7 +411,7 @@ static void compute_sensors(running_machine *machine)
READ8_HANDLER( slikz80_port_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
int result = 0;
/* if we have nothing, return 0x03 */
@@ -442,7 +442,7 @@ READ8_HANDLER( slikz80_port_r )
WRITE8_HANDLER( slikz80_port_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
state->z80_port_val = data;
state->z80_clear_to_send = 0;
}
@@ -457,7 +457,7 @@ WRITE8_HANDLER( slikz80_port_w )
READ8_HANDLER( slikshot_z80_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
/* allow the Z80 to send us stuff now */
state->z80_clear_to_send = 1;
return state->z80_port_val;
@@ -473,7 +473,7 @@ READ8_HANDLER( slikshot_z80_r )
READ8_HANDLER( slikshot_z80_control_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
return state->z80_ctrl;
}
@@ -487,14 +487,14 @@ READ8_HANDLER( slikshot_z80_control_r )
static TIMER_CALLBACK( delayed_z80_control_w )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
int data = param;
/* bit 4 controls the reset line on the Z80 */
/* this is a big kludge: only allow a reset if the Z80 is stopped */
/* at its endpoint; otherwise, we never get a result from the Z80 */
- if ((data & 0x10) || cpu_get_reg(machine->device("sub"), Z80_PC) == 0x13a)
+ if ((data & 0x10) || cpu_get_reg(machine.device("sub"), Z80_PC) == 0x13a)
{
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -504,7 +504,7 @@ static TIMER_CALLBACK( delayed_z80_control_w )
}
/* boost the interleave whenever this is written to */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
/* stash the new value */
state->z80_ctrl = data;
@@ -513,7 +513,7 @@ static TIMER_CALLBACK( delayed_z80_control_w )
WRITE8_HANDLER( slikshot_z80_control_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_z80_control_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_z80_control_w), data);
}
@@ -527,7 +527,7 @@ WRITE8_HANDLER( slikshot_z80_control_w )
VIDEO_START( slikshot )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
VIDEO_START_CALL( itech8 );
state->z80_ctrl = 0;
@@ -551,7 +551,7 @@ VIDEO_START( slikshot )
SCREEN_UPDATE( slikshot )
{
- itech8_state *state = screen->machine->driver_data<itech8_state>();
+ itech8_state *state = screen->machine().driver_data<itech8_state>();
int totaldy, totaldx;
int temp, i;
@@ -559,8 +559,8 @@ SCREEN_UPDATE( slikshot )
SCREEN_UPDATE_CALL(itech8_2page);
/* add the current X,Y positions to the list */
- state->xbuffer[state->ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine, "FAKEX", 0);
- state->ybuffer[state->ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine, "FAKEY", 0);
+ state->xbuffer[state->ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine(), "FAKEX", 0);
+ state->ybuffer[state->ybuffer_next % YBUFFER_COUNT] = input_port_read_safe(screen->machine(), "FAKEY", 0);
state->ybuffer_next++;
/* determine where to draw the starting point */
@@ -595,7 +595,7 @@ SCREEN_UPDATE( slikshot )
if (temp >= 0x90) temp = 0x90;
state->curx = temp;
- compute_sensors(screen->machine);
+ compute_sensors(screen->machine());
// popmessage("V=%02x,%02x X=%02x", state->curvx, state->curvy, state->curx);
state->crosshair_vis = 0;
}
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 3d1ffd9ad77..12e8315723d 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -101,7 +101,7 @@ void st010_write_ram(snes_state *state, UINT16 addr, UINT8 data)
static TIMER_CALLBACK( snes_nmi_tick )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
// pull NMI
device_set_input_line(state->maincpu, G65816_LINE_NMI, ASSERT_LINE);
@@ -110,9 +110,9 @@ static TIMER_CALLBACK( snes_nmi_tick )
state->nmi_timer->adjust(attotime::never);
}
-static void snes_hirq_tick( running_machine *machine )
+static void snes_hirq_tick( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
// latch the counters and pull IRQ
// (don't need to switch to the 65816 context, we don't do anything dependant on it)
@@ -131,7 +131,7 @@ static TIMER_CALLBACK( snes_hirq_tick_callback )
static TIMER_CALLBACK( snes_reset_oam_address )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
// make sure we're in the 65816's context since we're messing with the OAM and stuff
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
@@ -145,16 +145,16 @@ static TIMER_CALLBACK( snes_reset_oam_address )
static TIMER_CALLBACK( snes_reset_hdma )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
address_space *cpu0space = state->maincpu->memory().space(AS_PROGRAM);
snes_hdma_init(cpu0space);
}
static TIMER_CALLBACK( snes_update_io )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
address_space *cpu0space = state->maincpu->memory().space(AS_PROGRAM);
- state->io_read(cpu0space->machine);
+ state->io_read(cpu0space->machine());
snes_ram[HVBJOY] &= 0xfe; /* Clear busy bit */
state->io_timer->adjust(attotime::never);
@@ -162,10 +162,10 @@ static TIMER_CALLBACK( snes_update_io )
static TIMER_CALLBACK( snes_scanline_tick )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
/* Increase current line - we want to latch on this line during it, not after it */
- snes_ppu.beam.current_vert = machine->primary_screen->vpos();
+ snes_ppu.beam.current_vert = machine.primary_screen->vpos();
// not in hblank
snes_ram[HVBJOY] &= ~0x40;
@@ -205,7 +205,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
}
else
{
- state->hirq_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * state->htmult));
+ state->hirq_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * state->htmult));
}
}
}
@@ -213,7 +213,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
/* Start of VBlank */
if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line)
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, 10), FUNC(snes_reset_oam_address));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, 10), FUNC(snes_reset_oam_address));
snes_ram[HVBJOY] |= 0x81; /* Set vblank bit to on & indicate controllers being read */
snes_ram[RDNMI] |= 0x80; /* Set NMI occured bit */
@@ -225,7 +225,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
}
/* three lines after start of vblank we update the controllers (value from snes9x) */
- state->io_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, state->hblank_offset * state->htmult));
+ state->io_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, state->hblank_offset * state->htmult));
}
// hdma reset happens at scanline 0, H=~6
@@ -246,7 +246,7 @@ static TIMER_CALLBACK( snes_scanline_tick )
}
state->scanline_timer->adjust(attotime::never);
- state->hblank_timer->adjust(machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert, state->hblank_offset * state->htmult));
+ state->hblank_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, state->hblank_offset * state->htmult));
// printf("%02x %d\n",snes_ram[HVBJOY],snes_ppu.beam.current_vert);
}
@@ -254,11 +254,11 @@ static TIMER_CALLBACK( snes_scanline_tick )
/* This is called at the start of hblank *before* the scanline indicated in current_vert! */
static TIMER_CALLBACK( snes_hblank_tick )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
address_space *cpu0space = state->maincpu->memory().space(AS_PROGRAM);
int nextscan;
- snes_ppu.beam.current_vert = machine->primary_screen->vpos();
+ snes_ppu.beam.current_vert = machine.primary_screen->vpos();
/* make sure we halt */
state->hblank_timer->adjust(attotime::never);
@@ -266,13 +266,13 @@ static TIMER_CALLBACK( snes_hblank_tick )
/* draw a scanline */
if (snes_ppu.beam.current_vert <= snes_ppu.beam.last_visible_line)
{
- if (machine->primary_screen->vpos() > 0)
+ if (machine.primary_screen->vpos() > 0)
{
/* Do HDMA */
if (snes_ram[HDMAEN])
snes_hdma(cpu0space);
- machine->primary_screen->update_partial((snes_ppu.interlace == 2) ? (snes_ppu.beam.current_vert * snes_ppu.interlace) : snes_ppu.beam.current_vert - 1);
+ machine.primary_screen->update_partial((snes_ppu.interlace == 2) ? (snes_ppu.beam.current_vert * snes_ppu.interlace) : snes_ppu.beam.current_vert - 1);
}
}
@@ -286,7 +286,7 @@ static TIMER_CALLBACK( snes_hblank_tick )
nextscan = 0;
}
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(nextscan));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(nextscan));
}
/* FIXME: multiplication should take 8 CPU cycles & division 16 CPU cycles, but
@@ -348,7 +348,7 @@ READ8_HANDLER( snes_open_bus_r )
/* read & write to DMA addresses are defined separately, to be called by snessdd1 handlers */
static READ8_HANDLER( snes_io_dma_r )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
switch (offset)
{
@@ -396,7 +396,7 @@ static READ8_HANDLER( snes_io_dma_r )
static WRITE8_HANDLER( snes_io_dma_w )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
switch (offset)
{
@@ -462,7 +462,7 @@ static WRITE8_HANDLER( snes_io_dma_w )
*/
READ8_HANDLER( snes_r_io )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0;
// PPU accesses are from 2100 to 213f
@@ -527,14 +527,14 @@ READ8_HANDLER( snes_r_io )
if (snes_ram[offset] & 0x1)
return 0 | (snes_open_bus_r(space, 0) & 0xfc); //correct?
- value = state->oldjoy1_read(space->machine);
+ value = state->oldjoy1_read(space->machine());
return (value & 0x03) | (snes_open_bus_r(space, 0) & 0xfc); //correct?
case OLDJOY2: /* Data for old NES controllers (JOYSER2) */
if (snes_ram[OLDJOY1] & 0x1)
return 0 | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
- value = state->oldjoy2_read(space->machine);
+ value = state->oldjoy2_read(space->machine());
return value | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
case RDNMI: /* NMI flag by v-blank and version number */
@@ -548,7 +548,7 @@ READ8_HANDLER( snes_r_io )
return value;
case HVBJOY: /* H/V blank and joypad controller enable */
// electronics test says hcounter 272 is start of hblank, which is beampos 363
-// if (space->machine->primary_screen->hpos() >= 363) snes_ram[offset] |= 0x40;
+// if (space->machine().primary_screen->hpos() >= 363) snes_ram[offset] |= 0x40;
// else snes_ram[offset] &= ~0x40;
return (snes_ram[offset] & 0xc1) | (snes_open_bus_r(space, 0) & 0x3e);
case RDIO: /* Programmable I/O port - echos back what's written to WRIO */
@@ -577,7 +577,7 @@ READ8_HANDLER( snes_r_io )
#ifndef MESS
case 0x4100: /* NSS Dip-Switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
// case 0x4101: //PC: a104 - a10e - a12a //only nss_actr
// case 0x420c: //PC: 9c7d - 8fab //only nss_ssoc
@@ -602,7 +602,7 @@ READ8_HANDLER( snes_r_io )
*/
WRITE8_HANDLER( snes_w_io )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
// PPU accesses are from 2100 to 213f
if (offset >= INIDISP && offset < APU00)
@@ -616,7 +616,7 @@ WRITE8_HANDLER( snes_w_io )
{
// printf("816: %02x to APU @ %d (PC=%06x)\n", data, offset & 3,cpu_get_pc(space->cpu));
spc_port_in(state->spc700, offset & 0x3, data);
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
return;
}
@@ -632,7 +632,7 @@ WRITE8_HANDLER( snes_w_io )
{
if (offset == 0x2800 || offset == 0x2801)
{
- srtc_write(space->machine, offset, data);
+ srtc_write(space->machine(), offset, data);
return;
}
}
@@ -654,7 +654,7 @@ WRITE8_HANDLER( snes_w_io )
UINT16 limit = (state->has_addon_chip == HAS_SPC7110_RTC) ? 0x4842 : 0x483f;
if (offset >= 0x4800 && offset <= limit)
{
- spc7110_mmio_write(space->machine, (UINT32)offset, data);
+ spc7110_mmio_write(space->machine(), (UINT32)offset, data);
return;
}
}
@@ -704,7 +704,7 @@ WRITE8_HANDLER( snes_w_io )
if (!(snes_ram[WRIO] & 0x80) && (data & 0x80))
{
// external latch
- snes_latch_counters(space->machine);
+ snes_latch_counters(space->machine());
}
break;
case WRMPYA: /* Multiplier A */
@@ -766,7 +766,7 @@ WRITE8_HANDLER( snes_w_io )
break;
case HDMAEN: /* HDMA channel designation */
if (data) //if a HDMA is enabled, data is inited at the next scanline
- space->machine->scheduler().timer_set(space->machine->primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), FUNC(snes_reset_hdma));
+ space->machine().scheduler().timer_set(space->machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), FUNC(snes_reset_hdma));
break;
case MEMSEL: /* Access cycle designation in memory (2) area */
/* FIXME: Need to adjust the speed only during access of banks 0x80+
@@ -809,7 +809,7 @@ WRITE8_HANDLER( snes_w_io )
WRITE_LINE_DEVICE_HANDLER( snes_extern_irq_w )
{
- snes_state *driver_state = device->machine->driver_data<snes_state>();
+ snes_state *driver_state = device->machine().driver_data<snes_state>();
device_set_input_line(driver_state->maincpu, G65816_LINE_IRQ, state);
}
@@ -890,7 +890,7 @@ address | | | | | | |
#if USE_CYCLE_STEAL
/*FIXME: missing work RAM access steal / we need to do this less "aggressive" otherwise we lose too much CPU horsepower, why? */
-static int snes_bank_0x00_0x3f_cycles(running_machine *machine,UINT32 offset)
+static int snes_bank_0x00_0x3f_cycles(running_machine &machine,UINT32 offset)
{
/*
$00-$3F | $0000-$1FFF | Slow | Address Bus A + /WRAM (mirror $7E:0000-$1FFF)
@@ -918,7 +918,7 @@ static int snes_bank_0x00_0x3f_cycles(running_machine *machine,UINT32 offset)
return 0; //TODO: 6
}
-static int snes_bank_0x80_0xbf_cycles(running_machine *machine,UINT32 offset)
+static int snes_bank_0x80_0xbf_cycles(running_machine &machine,UINT32 offset)
{
/*
$80-$BF | $0000-$1FFF | Slow | Address Bus A + /WRAM (mirror $7E:0000-$1FFF)
@@ -955,7 +955,7 @@ static int snes_bank_0x80_0xbf_cycles(running_machine *machine,UINT32 offset)
/* 0x000000 - 0x2fffff */
READ8_HANDLER( snes_r_bank1 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -1005,7 +1005,7 @@ READ8_HANDLER( snes_r_bank1 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine(), offset));
#endif
return value;
@@ -1014,7 +1014,7 @@ READ8_HANDLER( snes_r_bank1 )
/* 0x300000 - 0x3fffff */
READ8_HANDLER( snes_r_bank2 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -1071,7 +1071,7 @@ READ8_HANDLER( snes_r_bank2 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine(), offset));
#endif
return value;
@@ -1080,7 +1080,7 @@ READ8_HANDLER( snes_r_bank2 )
/* 0x400000 - 0x5fffff */
READ8_HANDLER( snes_r_bank3 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -1123,7 +1123,7 @@ READ8_HANDLER( snes_r_bank3 )
/* 0x600000 - 0x6fffff */
READ8_HANDLER( snes_r_bank4 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0xff;
UINT16 address = offset & 0xffff;
@@ -1172,7 +1172,7 @@ READ8_HANDLER( snes_r_bank4 )
/* 0x700000 - 0x7dffff */
READ8_HANDLER( snes_r_bank5 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value;
UINT16 address = offset & 0xffff;
@@ -1210,7 +1210,7 @@ READ8_HANDLER( snes_r_bank5 )
/* 0x800000 - 0xbfffff */
READ8_HANDLER( snes_r_bank6 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0;
UINT16 address = offset & 0xffff;
@@ -1251,7 +1251,7 @@ READ8_HANDLER( snes_r_bank6 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine(), offset));
#endif
return value;
@@ -1260,7 +1260,7 @@ READ8_HANDLER( snes_r_bank6 )
/* 0xc00000 - 0xffffff */
READ8_HANDLER( snes_r_bank7 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value = 0;
UINT16 address = offset & 0xffff;
@@ -1291,7 +1291,7 @@ READ8_HANDLER( snes_r_bank7 )
else if ((state->has_addon_chip == HAS_SPC7110 || state->has_addon_chip == HAS_SPC7110_RTC) && offset >= 0x100000)
value = spc7110_bank7_read(space, offset);
else if (state->has_addon_chip == HAS_SDD1)
- value = sdd1_read(space->machine, offset);
+ value = sdd1_read(space->machine(), offset);
else if (state->has_addon_chip == HAS_ST010 || state->has_addon_chip == HAS_ST011)
{
if (offset >= 0x280000 && offset < 0x300000 && address < 0x1000)
@@ -1325,7 +1325,7 @@ READ8_HANDLER( snes_r_bank7 )
/* 0x000000 - 0x2fffff */
WRITE8_HANDLER( snes_w_bank1 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
@@ -1346,7 +1346,7 @@ WRITE8_HANDLER( snes_w_bank1 )
else if ((state->cart[0].mode == SNES_MODE_21) && (state->has_addon_chip == HAS_DSP1) && (offset < 0x100000))
dsp_set_dr(data);
else if (state->has_addon_chip == HAS_CX4)
- CX4_write(space->machine, address - 0x6000, data);
+ CX4_write(space->machine(), address - 0x6000, data);
else if (state->has_addon_chip == HAS_SPC7110 || state->has_addon_chip == HAS_SPC7110_RTC)
{
if (offset < 0x10000)
@@ -1374,14 +1374,14 @@ WRITE8_HANDLER( snes_w_bank1 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine(), offset));
#endif
}
/* 0x300000 - 0x3fffff */
WRITE8_HANDLER( snes_w_bank2 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (address < 0x2000) /* Mirror of Low RAM */
@@ -1400,7 +1400,7 @@ WRITE8_HANDLER( snes_w_bank2 )
else if (state->has_addon_chip == HAS_OBC1)
obc1_write(space, offset, data);
else if (state->has_addon_chip == HAS_CX4)
- CX4_write(space->machine, address - 0x6000, data);
+ CX4_write(space->machine(), address - 0x6000, data);
else if (state->has_addon_chip == HAS_SPC7110 || state->has_addon_chip == HAS_SPC7110_RTC)
{
if (offset < 0x10000)
@@ -1435,14 +1435,14 @@ WRITE8_HANDLER( snes_w_bank2 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine(), offset));
#endif
}
/* 0x600000 - 0x6fffff */
WRITE8_HANDLER( snes_w_bank4 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->has_addon_chip == HAS_SUPERFX)
@@ -1483,7 +1483,7 @@ WRITE8_HANDLER( snes_w_bank4 )
/* 0x700000 - 0x7dffff */
WRITE8_HANDLER( snes_w_bank5 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->has_addon_chip == HAS_SUPERFX)
@@ -1511,7 +1511,7 @@ WRITE8_HANDLER( snes_w_bank5 )
/* 0x800000 - 0xbfffff */
WRITE8_HANDLER( snes_w_bank6 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->has_addon_chip == HAS_SUPERFX)
@@ -1519,7 +1519,7 @@ WRITE8_HANDLER( snes_w_bank6 )
else if (address < 0x8000)
{
if ((state->has_addon_chip == HAS_CX4) && (address >= 0x6000))
- CX4_write(space->machine, address - 0x6000, data);
+ CX4_write(space->machine(), address - 0x6000, data);
else if (state->cart[0].mode != SNES_MODE_25)
space->write_byte(offset, data);
else /* Mode 25 has SRAM not mirrored from lower banks */
@@ -1559,7 +1559,7 @@ WRITE8_HANDLER( snes_w_bank6 )
#if USE_CYCLE_STEAL
if(!space->debugger_access())
- device_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
+ device_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine(), offset));
#endif
}
@@ -1567,7 +1567,7 @@ WRITE8_HANDLER( snes_w_bank6 )
/* 0xc00000 - 0xffffff */
WRITE8_HANDLER( snes_w_bank7 )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 address = offset & 0xffff;
if (state->has_addon_chip == HAS_SUPERFX)
@@ -1625,9 +1625,9 @@ WRITE8_HANDLER( snes_w_bank7 )
*************************************/
-static void nss_io_read( running_machine *machine )
+static void nss_io_read( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
static const char *const portnames[2][4] =
{
{ "SERIAL1_DATA1_L", "SERIAL1_DATA1_H", "SERIAL1_DATA2_L", "SERIAL1_DATA2_H" },
@@ -1671,9 +1671,9 @@ static void nss_io_read( running_machine *machine )
}
-static UINT8 nss_oldjoy1_read( running_machine *machine )
+static UINT8 nss_oldjoy1_read( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
UINT8 res;
if (state->read_idx[0] >= 16)
@@ -1684,9 +1684,9 @@ static UINT8 nss_oldjoy1_read( running_machine *machine )
return res;
}
-static UINT8 nss_oldjoy2_read( running_machine *machine )
+static UINT8 nss_oldjoy2_read( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
UINT8 res;
if (state->read_idx[1] >= 16)
@@ -1703,36 +1703,36 @@ static UINT8 nss_oldjoy2_read( running_machine *machine )
*************************************/
-static void snes_init_timers( running_machine *machine )
+static void snes_init_timers( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
/* init timers and stop them */
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(snes_scanline_tick));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(snes_scanline_tick));
state->scanline_timer->adjust(attotime::never);
- state->hblank_timer = machine->scheduler().timer_alloc(FUNC(snes_hblank_tick));
+ state->hblank_timer = machine.scheduler().timer_alloc(FUNC(snes_hblank_tick));
state->hblank_timer->adjust(attotime::never);
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(snes_nmi_tick));
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(snes_nmi_tick));
state->nmi_timer->adjust(attotime::never);
- state->hirq_timer = machine->scheduler().timer_alloc(FUNC(snes_hirq_tick_callback));
+ state->hirq_timer = machine.scheduler().timer_alloc(FUNC(snes_hirq_tick_callback));
state->hirq_timer->adjust(attotime::never);
- state->div_timer = machine->scheduler().timer_alloc(FUNC(snes_div_callback));
+ state->div_timer = machine.scheduler().timer_alloc(FUNC(snes_div_callback));
state->div_timer->adjust(attotime::never);
- state->mult_timer = machine->scheduler().timer_alloc(FUNC(snes_mult_callback));
+ state->mult_timer = machine.scheduler().timer_alloc(FUNC(snes_mult_callback));
state->mult_timer->adjust(attotime::never);
- state->io_timer = machine->scheduler().timer_alloc(FUNC(snes_update_io));
+ state->io_timer = machine.scheduler().timer_alloc(FUNC(snes_update_io));
state->io_timer->adjust(attotime::never);
// SNES hcounter has a 0-339 range. hblank starts at counter 260.
// clayfighter sets an HIRQ at 260, apparently it wants it to be before hdma kicks off, so we'll delay 2 pixels.
state->hblank_offset = 274;
- state->hblank_timer->adjust(machine->primary_screen->time_until_pos(((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC - 1 : SNES_VTOTAL_PAL - 1, state->hblank_offset));
+ state->hblank_timer->adjust(machine.primary_screen->time_until_pos(((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC - 1 : SNES_VTOTAL_PAL - 1, state->hblank_offset));
}
-static void snes_init_ram( running_machine *machine )
+static void snes_init_ram( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
- address_space *cpu0space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ snes_state *state = machine.driver_data<snes_state>();
+ address_space *cpu0space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Init work RAM - 0x55 isn't exactly right but it's close */
@@ -1760,7 +1760,7 @@ static void snes_init_ram( running_machine *machine )
snes_ram[VMAIN] = 0x80;
// see if there's a uPD7725 DSP in the machine config
- state->upd7725 = machine->device<upd7725_device>("dsp");
+ state->upd7725 = machine.device<upd7725_device>("dsp");
// if we have a DSP, halt it for the moment
if (state->upd7725)
@@ -1769,7 +1769,7 @@ static void snes_init_ram( running_machine *machine )
}
// ditto for a uPD96050 (Seta ST-010 or ST-011)
- state->upd96050 = machine->device<upd96050_device>("setadsp");
+ state->upd96050 = machine.device<upd96050_device>("setadsp");
if (state->upd96050)
{
cputag_set_input_line(machine, "setadsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -1824,7 +1824,7 @@ static void snes_init_ram( running_machine *machine )
}
// init frame counter so first line is 0
- if (ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds) >= 59)
+ if (ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds) >= 59)
snes_ppu.beam.current_vert = SNES_VTOTAL_NTSC;
else
snes_ppu.beam.current_vert = SNES_VTOTAL_PAL;
@@ -1845,16 +1845,16 @@ DIRECT_UPDATE_HANDLER( snes_direct )
MACHINE_START( snes )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
int i;
- state->maincpu = machine->device<_5a22_device>("maincpu");
- state->soundcpu = machine->device<spc700_device>("soundcpu");
- state->spc700 = machine->device<snes_sound_device>("spc700");
- state->superfx = machine->device<cpu_device>("superfx");
+ state->maincpu = machine.device<_5a22_device>("maincpu");
+ state->soundcpu = machine.device<spc700_device>("soundcpu");
+ state->spc700 = machine.device<snes_sound_device>("spc700");
+ state->superfx = machine.device<cpu_device>("superfx");
- state->maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(snes_direct, *machine));
- state->soundcpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(snes_spc_direct, *machine));
+ state->maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(snes_direct, machine));
+ state->soundcpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(snes_spc_direct, machine));
// power-on sets these registers like this
snes_ram[WRIO] = 0xff;
@@ -1947,7 +1947,7 @@ MACHINE_START( snes )
MACHINE_RESET( snes )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
int i;
snes_init_ram(machine);
@@ -1967,9 +1967,9 @@ MACHINE_RESET( snes )
}
/* Set STAT78 to NTSC or PAL */
- if (ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds) >= 59.0f)
+ if (ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds) >= 59.0f)
snes_ram[STAT78] = SNES_NTSC;
- else /* if (ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds) == 50.0f) */
+ else /* if (ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds) == 50.0f) */
snes_ram[STAT78] = SNES_PAL;
// reset does this to these registers
@@ -1986,12 +1986,12 @@ MACHINE_RESET( snes )
/* for mame we use an init, maybe we will need more for the different games */
DRIVER_INIT( snes )
{
- snes_state *state = machine->driver_data<snes_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ snes_state *state = machine.driver_data<snes_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine->region("user3")->base();
+ rom = machine.region("user3")->base();
snes_ram = auto_alloc_array_clear(machine, UINT8, 0x1400000);
/* all NSS games seem to use MODE 20 */
@@ -2000,7 +2000,7 @@ DRIVER_INIT( snes )
state->has_addon_chip = HAS_NONE;
/* Find the number of blocks in this ROM */
- total_blocks = (machine->region("user3")->bytes() / 0x8000);
+ total_blocks = (machine.region("user3")->bytes() / 0x8000);
read_blocks = 0;
/* Loading all the data blocks from cart, we only partially cover banks 0x00 to 0x7f. Therefore, we
@@ -2052,12 +2052,12 @@ DRIVER_INIT( snes )
DRIVER_INIT( snes_hirom )
{
- snes_state *state = machine->driver_data<snes_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ snes_state *state = machine.driver_data<snes_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 total_blocks, read_blocks;
UINT8 *rom;
- rom = machine->region("user3")->base();
+ rom = machine.region("user3")->base();
snes_ram = auto_alloc_array(machine, UINT8, 0x1400000);
memset(snes_ram, 0, 0x1400000);
@@ -2066,7 +2066,7 @@ DRIVER_INIT( snes_hirom )
state->has_addon_chip = HAS_NONE;
/* Find the number of blocks in this ROM */
- total_blocks = (machine->region("user3")->bytes() / 0x10000);
+ total_blocks = (machine.region("user3")->bytes() / 0x10000);
read_blocks = 0;
/* See above for details about the way we fill banks 0x00 to 0x7f */
@@ -2137,7 +2137,7 @@ INLINE UINT8 snes_abus_read( address_space *space, UINT32 abus )
INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UINT16 bbus )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
#if USE_CYCLE_STEAL
/* every byte transfer takes 8 master cycles */
@@ -2181,21 +2181,21 @@ INLINE void snes_dma_transfer( address_space *space, UINT8 dma, UINT32 abus, UIN
/* WIP: These have the advantage to automatically update the address, but then we would need to
check again if the transfer is direct/indirect at each step... is it worth? */
-INLINE UINT32 snes_get_hdma_addr( running_machine *machine, int dma )
+INLINE UINT32 snes_get_hdma_addr( running_machine &machine, int dma )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
return (state->dma_channel[dma].bank << 16) | (state->dma_channel[dma].hdma_addr++);
}
-INLINE UINT32 snes_get_hdma_iaddr( running_machine *machine, int dma )
+INLINE UINT32 snes_get_hdma_iaddr( running_machine &machine, int dma )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
return (state->dma_channel[dma].ibank << 16) | (state->dma_channel[dma].trans_size++);
}
-INLINE int is_last_active_channel( running_machine *machine, int dma )
+INLINE int is_last_active_channel( running_machine &machine, int dma )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
int i;
for (i = dma + 1; i < 8; i++)
@@ -2210,8 +2210,8 @@ INLINE int is_last_active_channel( running_machine *machine, int dma )
static void snes_hdma_update( address_space *space, int dma )
{
- snes_state *state = space->machine->driver_data<snes_state>();
- UINT32 abus = snes_get_hdma_addr(space->machine, dma);
+ snes_state *state = space->machine().driver_data<snes_state>();
+ UINT32 abus = snes_get_hdma_addr(space->machine(), dma);
state->dma_channel[dma].hdma_line_counter = snes_abus_read(space, abus);
@@ -2221,13 +2221,13 @@ static void snes_hdma_update( address_space *space, int dma )
one byte for Address, and use the $00 for the low byte. So Address ends up incremented one less than
otherwise expected */
- abus = snes_get_hdma_addr(space->machine, dma);
+ abus = snes_get_hdma_addr(space->machine(), dma);
state->dma_channel[dma].trans_size = snes_abus_read(space, abus) << 8;
- if (state->dma_channel[dma].hdma_line_counter || !is_last_active_channel(space->machine, dma))
+ if (state->dma_channel[dma].hdma_line_counter || !is_last_active_channel(space->machine(), dma))
{
// we enter here if we have more transfers to be done or if there are other active channels after this one
- abus = snes_get_hdma_addr(space->machine, dma);
+ abus = snes_get_hdma_addr(space->machine(), dma);
state->dma_channel[dma].trans_size >>= 8;
state->dma_channel[dma].trans_size |= snes_abus_read(space, abus) << 8;
}
@@ -2241,7 +2241,7 @@ static void snes_hdma_update( address_space *space, int dma )
static void snes_hdma_init( address_space *space )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
int i;
state->hdmaen = snes_ram[HDMAEN];
@@ -2257,7 +2257,7 @@ static void snes_hdma_init( address_space *space )
static void snes_hdma( address_space *space )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT16 bbus;
UINT32 abus;
int i;
@@ -2341,7 +2341,7 @@ static void snes_hdma( address_space *space )
static void snes_dma( address_space *space, UINT8 channels )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
int i;
INT8 increment;
UINT16 bbus;
diff --git a/src/mame/machine/snes7110.c b/src/mame/machine/snes7110.c
index 1f4284ab147..437f39243e5 100644
--- a/src/mame/machine/snes7110.c
+++ b/src/mame/machine/snes7110.c
@@ -120,7 +120,9 @@ static const UINT8 spc7110_mode2_context_table[32][2] =
typedef struct
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
UINT32 decomp_mode;
UINT32 decomp_offset;
@@ -142,9 +144,9 @@ typedef struct
UINT32 rom_size;
} SPC7110Decomp;
-static SPC7110Decomp* SPC7110Decomp_ctor(running_machine *machine, UINT32 size);
+static SPC7110Decomp* SPC7110Decomp_ctor(running_machine &machine, UINT32 size);
static void SPC7110Decomp_reset(SPC7110Decomp *thisptr);
-static void SPC7110Decomp_init(SPC7110Decomp *thisptr, running_machine *machine, UINT32 mode, UINT32 offset, UINT32 index);
+static void SPC7110Decomp_init(SPC7110Decomp *thisptr, running_machine &machine, UINT32 mode, UINT32 offset, UINT32 index);
static UINT8 SPC7110Decomp_read(SPC7110Decomp *thisptr);
static void SPC7110Decomp_write(SPC7110Decomp *thisptr, UINT8 data);
static UINT8 SPC7110Decomp_dataread(SPC7110Decomp *thisptr);
@@ -158,7 +160,7 @@ static UINT8 SPC7110Decomp_toggle_invert(SPC7110Decomp *thisptr, UINT32 n);
static UINT32 SPC7110Decomp_morton_2x8(SPC7110Decomp *thisptr, UINT32 data);
static UINT32 SPC7110Decomp_morton_4x8(SPC7110Decomp *thisptr, UINT32 data);
-static SPC7110Decomp* SPC7110Decomp_ctor(running_machine *machine, UINT32 size)
+static SPC7110Decomp* SPC7110Decomp_ctor(running_machine &machine, UINT32 size)
{
UINT32 i;
SPC7110Decomp* newclass = (SPC7110Decomp*)auto_alloc_array(machine, UINT8, sizeof(SPC7110Decomp));
@@ -201,11 +203,11 @@ static void SPC7110Decomp_reset(SPC7110Decomp *thisptr)
thisptr->decomp_buffer_length = 0;
}
-static void SPC7110Decomp_init(SPC7110Decomp *thisptr, running_machine *machine, UINT32 mode, UINT32 offset, UINT32 index)
+static void SPC7110Decomp_init(SPC7110Decomp *thisptr, running_machine &machine, UINT32 mode, UINT32 offset, UINT32 index)
{
UINT32 i;
- thisptr->machine = machine;
+ thisptr->m_machine = &machine;
thisptr->decomp_mode = mode;
thisptr->decomp_offset = offset;
@@ -274,7 +276,7 @@ static void SPC7110Decomp_write(SPC7110Decomp *thisptr, UINT8 data)
static UINT8 SPC7110Decomp_dataread(SPC7110Decomp *thisptr)
{
- UINT8 *ROM = thisptr->machine->region("cart")->base();
+ UINT8 *ROM = thisptr->machine().region("cart")->base();
UINT32 size = thisptr->rom_size - 0x100000;
while(thisptr->decomp_offset >= size)
{
@@ -766,9 +768,9 @@ static UINT32 SPC7110Decomp_morton_4x8(SPC7110Decomp *thisptr, UINT32 data)
+ thisptr->morton32[2][(data >> 16) & 255] + thisptr->morton32[3][(data >> 24) & 255];
}
-static void spc7110_mmio_write(running_machine *machine, UINT32 addr, UINT8 data);
+static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data);
static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr);
-static void spc7110_update_time(running_machine *machine, UINT8 offset);
+static void spc7110_update_time(running_machine &machine, UINT8 offset);
enum RTC_State
{
@@ -873,9 +875,9 @@ typedef struct
static _snes_spc7110_t snes_spc7110;
-static void spc7110_init(running_machine* machine)
+static void spc7110_init(running_machine& machine)
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
snes_spc7110.r4801 = 0x00;
snes_spc7110.r4802 = 0x00;
@@ -935,7 +937,7 @@ static void spc7110_init(running_machine* machine)
snes_spc7110.decomp = SPC7110Decomp_ctor(machine, snes_spc7110.size);
}
-static void spc7110rtc_init(running_machine* machine)
+static void spc7110rtc_init(running_machine& machine)
{
spc7110_init(machine);
@@ -990,10 +992,10 @@ static void spc7110_set_data_adjust(UINT32 addr)
// we should probably keep track internally of the time rather than updating
// to the system time at each call with a "offset" tracking as we do now...
// (and indeed current code fails to pass Tengai Makyou Zero tests)
-static void spc7110_update_time(running_machine *machine, UINT8 offset)
+static void spc7110_update_time(running_machine &machine, UINT8 offset)
{
system_time curtime, *systime = &curtime;
- machine->current_datetime(curtime);
+ machine.current_datetime(curtime);
int update = 1;
snes_spc7110.rtc_offset += offset;
@@ -1068,8 +1070,8 @@ static void spc7110_update_time(running_machine *machine, UINT8 offset)
static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr)
{
- running_machine *machine = space->machine;
- UINT8 *ROM = machine->region("cart")->base();
+ running_machine &machine = space->machine();
+ UINT8 *ROM = machine.region("cart")->base();
addr &= 0xffff;
@@ -1253,9 +1255,9 @@ static UINT8 spc7110_mmio_read(address_space *space, UINT32 addr)
return snes_open_bus_r(space, 0);
}
-static void spc7110_mmio_write(running_machine *machine, UINT32 addr, UINT8 data)
+static void spc7110_mmio_write(running_machine &machine, UINT32 addr, UINT8 data)
{
- UINT8 *ROM = machine->region("cart")->base();
+ UINT8 *ROM = machine.region("cart")->base();
addr &= 0xffff;
@@ -1641,7 +1643,7 @@ static void spc7110_mmio_write(running_machine *machine, UINT32 addr, UINT8 data
static UINT8 spc7110_bank7_read(address_space *space, UINT32 offset)
{
- UINT8 *ROM = space->machine->region("cart")->base();
+ UINT8 *ROM = space->machine().region("cart")->base();
UINT32 addr = offset & 0x0fffff;
switch (offset & 0xf00000)
diff --git a/src/mame/machine/snesbsx.c b/src/mame/machine/snesbsx.c
index 27a5ecd472d..3a3266faee5 100644
--- a/src/mame/machine/snesbsx.c
+++ b/src/mame/machine/snesbsx.c
@@ -48,7 +48,7 @@ static struct _snes_bsx_state bsx_state;
static void bsx_update_memory_map(void)
{
bsx_state.ram_source = BIT(bsx_state.cart_regs[0x01], 7) ? SNES_BSX_PRAM : SNES_BSX_FLASH;
-// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space->machine->region("flash")->base() : bsx_state.pram;
+// UINT8 *RAM = (bsx_state.cart_regs[0x01] & 0x80) == 0x00 ? space->machine().region("flash")->base() : bsx_state.pram;
logerror("BSX: updated memory map, current RAM: %d", bsx_state.ram_source);
if (!BIT(bsx_state.cart_regs[0x02], 7))
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( bsx_write )
}
}
-static void bsx_init( running_machine *machine )
+static void bsx_init( running_machine &machine )
{
memset(bsx_state.cart_regs, 0, ARRAY_LENGTH(bsx_state.cart_regs));
@@ -149,7 +149,7 @@ static void bsx_init( running_machine *machine )
#ifdef UNUSED_FUNCTION
static READ8_HANDLER( bsx_flash_read )
{
- UINT8 *FLASH = space->machine->region("flash")->base();
+ UINT8 *FLASH = space->machine().region("flash")->base();
if (offset == 0x0002)
{
diff --git a/src/mame/machine/snescx4.c b/src/mame/machine/snescx4.c
index 3702102871a..93686a4a657 100644
--- a/src/mame/machine/snescx4.c
+++ b/src/mame/machine/snescx4.c
@@ -19,9 +19,9 @@ static UINT8 CX4_read(UINT32 addr);
static UINT16 CX4_readw(UINT16 addr);
static UINT32 CX4_readl(UINT16 addr);
-static void CX4_write(running_machine *machine, UINT32 addr, UINT8 data);
-static void CX4_writew(running_machine *machine, UINT16 addr, UINT16 data);
-//static void CX4_writel(running_machine *machine, UINT16 addr, UINT32 data);
+static void CX4_write(running_machine &machine, UINT32 addr, UINT8 data);
+static void CX4_writew(running_machine &machine, UINT16 addr, UINT16 data);
+//static void CX4_writel(running_machine &machine, UINT16 addr, UINT32 data);
static void CX4_C4DrawLine(INT32 X1, INT32 Y1, INT16 Z1, INT32 X2, INT32 Y2, INT16 Z2, UINT8 Color);
@@ -98,7 +98,7 @@ static void CX4_immediate_reg(UINT32 start)
CX4_str(0, cx4.r0);
}
-static void CX4_transfer_data(running_machine *machine)
+static void CX4_transfer_data(running_machine &machine)
{
UINT32 src;
UINT16 dest, count;
@@ -108,7 +108,7 @@ static void CX4_transfer_data(running_machine *machine)
count = (cx4.reg[0x43]) | (cx4.reg[0x44] << 8);
dest = (cx4.reg[0x45]) | (cx4.reg[0x46] << 8);
- address_space *space = machine->device<cpu_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<cpu_device>("maincpu")->space(AS_PROGRAM);
for(i=0;i<count;i++)
{
CX4_write(machine, dest++, space->read_byte(src++));
@@ -118,7 +118,7 @@ static void CX4_transfer_data(running_machine *machine)
#include "cx4oam.c"
#include "cx4ops.c"
-static void CX4_write(running_machine *machine, UINT32 addr, UINT8 data)
+static void CX4_write(running_machine &machine, UINT32 addr, UINT8 data)
{
addr &= 0x1fff;
@@ -193,20 +193,20 @@ static void CX4_write(running_machine *machine, UINT32 addr, UINT8 data)
}
#ifdef UNUSED_FUNCTION
-void CX4_writeb(running_machine *machine, UINT16 addr, UINT8 data)
+void CX4_writeb(running_machine &machine, UINT16 addr, UINT8 data)
{
CX4_write(machine, addr, data);
}
#endif
-static void CX4_writew(running_machine *machine, UINT16 addr, UINT16 data)
+static void CX4_writew(running_machine &machine, UINT16 addr, UINT16 data)
{
CX4_write(machine, addr + 0, data >> 0);
CX4_write(machine, addr + 1, data >> 8);
}
#ifdef UNUSED_FUNCTION
-void CX4_writel(running_machine *machine, UINT16 addr, UINT32 data)
+void CX4_writel(running_machine &machine, UINT16 addr, UINT32 data)
{
CX4_write(machine, addr + 0, data >> 0);
CX4_write(machine, addr + 1, data >> 8);
diff --git a/src/mame/machine/snesobc1.c b/src/mame/machine/snesobc1.c
index 4720effa0cb..b12c01f0679 100644
--- a/src/mame/machine/snesobc1.c
+++ b/src/mame/machine/snesobc1.c
@@ -104,7 +104,7 @@ static WRITE8_HANDLER( obc1_write )
}
}
-static void obc1_init( running_machine *machine )
+static void obc1_init( running_machine &machine )
{
obc1_state.offset = (snes_ram[0x1ff5] & 0x01) ? 0x1800 : 0x1c00;
obc1_state.address = (snes_ram[0x1ff6] & 0x7f);
diff --git a/src/mame/machine/snesrtc.c b/src/mame/machine/snesrtc.c
index 3c1a21fef90..31f415db131 100644
--- a/src/mame/machine/snesrtc.c
+++ b/src/mame/machine/snesrtc.c
@@ -39,10 +39,10 @@ static const UINT8 srtc_months[12] =
31, 30, 31
};
-static void srtc_update_time( running_machine *machine )
+static void srtc_update_time( running_machine &machine )
{
system_time curtime, *systime = &curtime;
- machine->current_datetime(curtime);
+ machine.current_datetime(curtime);
rtc_state.ram[0] = systime->local_time.second % 10;
rtc_state.ram[1] = systime->local_time.second / 10;
rtc_state.ram[2] = systime->local_time.minute % 10;
@@ -122,7 +122,7 @@ static UINT8 srtc_read( address_space *space, UINT16 addr )
if (rtc_state.index < 0)
{
- srtc_update_time(space->machine);
+ srtc_update_time(space->machine());
rtc_state.index++;
return 0x0f;
}
@@ -140,7 +140,7 @@ static UINT8 srtc_read( address_space *space, UINT16 addr )
return snes_open_bus_r(space, 0);
}
-static void srtc_write( running_machine *machine, UINT16 addr, UINT8 data )
+static void srtc_write( running_machine &machine, UINT16 addr, UINT8 data )
{
addr &= 0xffff;
@@ -210,7 +210,7 @@ static void srtc_write( running_machine *machine, UINT16 addr, UINT8 data )
}
}
-static void srtc_init( running_machine *machine )
+static void srtc_init( running_machine &machine )
{
rtc_state.mode = RTCM_Read;
rtc_state.index = -1;
diff --git a/src/mame/machine/snessdd1.c b/src/mame/machine/snessdd1.c
index f7e5bc8fbaa..ebc8f1dcc42 100644
--- a/src/mame/machine/snessdd1.c
+++ b/src/mame/machine/snessdd1.c
@@ -8,19 +8,21 @@
***************************************************************************/
-static UINT8 sdd1_read(running_machine* machine, UINT32 addr);
+static UINT8 sdd1_read(running_machine& machine, UINT32 addr);
typedef struct //Input Manager
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
UINT32 byte_ptr;
UINT8 bit_count;
} SDD1_IM;
-static SDD1_IM* SDD1_IM_ctor(running_machine* machine)
+static SDD1_IM* SDD1_IM_ctor(running_machine& machine)
{
SDD1_IM* newclass = (SDD1_IM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_IM));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
return newclass;
}
@@ -34,13 +36,13 @@ static UINT8 SDD1_IM_getCodeword(SDD1_IM* thisptr, const UINT8 code_len)
{
UINT8 codeword;
- codeword = sdd1_read(thisptr->machine, thisptr->byte_ptr) << thisptr->bit_count;
+ codeword = sdd1_read(thisptr->machine(), thisptr->byte_ptr) << thisptr->bit_count;
++thisptr->bit_count;
if (codeword & 0x80)
{
- codeword |= sdd1_read(thisptr->machine, thisptr->byte_ptr + 1) >> (9 - thisptr->bit_count);
+ codeword |= sdd1_read(thisptr->machine(), thisptr->byte_ptr + 1) >> (9 - thisptr->bit_count);
thisptr->bit_count += code_len;
}
@@ -55,14 +57,16 @@ static UINT8 SDD1_IM_getCodeword(SDD1_IM* thisptr, const UINT8 code_len)
typedef struct //Golomb-Code Decoder
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
SDD1_IM* IM;
} SDD1_GCD;
-static SDD1_GCD* SDD1_GCD_ctor(running_machine* machine, SDD1_IM* associatedIM)
+static SDD1_GCD* SDD1_GCD_ctor(running_machine& machine, SDD1_IM* associatedIM)
{
SDD1_GCD* newclass = (SDD1_GCD*)auto_alloc_array(machine, UINT8, sizeof(SDD1_GCD));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->IM = associatedIM;
return newclass;
}
@@ -120,17 +124,19 @@ static void SDD1_GCD_getRunCount(SDD1_GCD* thisptr, UINT8 code_num, UINT8* MPSco
typedef struct // Bits Generator
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
UINT8 code_num;
UINT8 MPScount;
UINT8 LPSind;
SDD1_GCD* GCD;
} SDD1_BG;
-static SDD1_BG* SDD1_BG_ctor(running_machine* machine, SDD1_GCD* associatedGCD, UINT8 code)
+static SDD1_BG* SDD1_BG_ctor(running_machine& machine, SDD1_GCD* associatedGCD, UINT8 code)
{
SDD1_BG* newclass = (SDD1_BG*)auto_alloc_array(machine, UINT8, sizeof(SDD1_BG));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->code_num = code;
newclass->GCD = associatedGCD;
return newclass;
@@ -227,19 +233,21 @@ typedef struct
typedef struct //Probability Estimation Module
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
SDD1_PEM_ContextInfo contextInfo[32];
SDD1_BG* BG[8];
} SDD1_PEM;
-static SDD1_PEM* SDD1_PEM_ctor(running_machine* machine,
+static SDD1_PEM* SDD1_PEM_ctor(running_machine& machine,
SDD1_BG* associatedBG0, SDD1_BG* associatedBG1,
SDD1_BG* associatedBG2, SDD1_BG* associatedBG3,
SDD1_BG* associatedBG4, SDD1_BG* associatedBG5,
SDD1_BG* associatedBG6, SDD1_BG* associatedBG7)
{
SDD1_PEM* newclass = (SDD1_PEM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_PEM));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->BG[0] = associatedBG0;
newclass->BG[1] = associatedBG1;
newclass->BG[2] = associatedBG2;
@@ -294,7 +302,9 @@ static UINT8 SDD1_PEM_getBit(SDD1_PEM* thisptr, UINT8 context)
typedef struct
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
UINT8 bitplanesInfo;
UINT8 contextBitsInfo;
UINT8 bit_number;
@@ -303,10 +313,10 @@ typedef struct
SDD1_PEM* PEM;
} SDD1_CM;
-static SDD1_CM* SDD1_CM_ctor(running_machine* machine, SDD1_PEM* associatedPEM)
+static SDD1_CM* SDD1_CM_ctor(running_machine& machine, SDD1_PEM* associatedPEM)
{
SDD1_CM* newclass = (SDD1_CM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_CM));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->PEM = associatedPEM;
return newclass;
}
@@ -314,8 +324,8 @@ static SDD1_CM* SDD1_CM_ctor(running_machine* machine, SDD1_PEM* associatedPEM)
static void SDD1_CM_prepareDecomp(SDD1_CM* thisptr, UINT32 first_byte)
{
INT32 i = 0;
- thisptr->bitplanesInfo = sdd1_read(thisptr->machine, first_byte) & 0xc0;
- thisptr->contextBitsInfo = sdd1_read(thisptr->machine, first_byte) & 0x30;
+ thisptr->bitplanesInfo = sdd1_read(thisptr->machine(), first_byte) & 0xc0;
+ thisptr->contextBitsInfo = sdd1_read(thisptr->machine(), first_byte) & 0x30;
thisptr->bit_number = 0;
for (i = 0; i < 8; i++)
{
@@ -396,24 +406,26 @@ static UINT8 SDD1_CM_getBit(SDD1_CM* thisptr)
typedef struct
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
UINT8 bitplanesInfo;
UINT16 length;
UINT8* buffer;
SDD1_CM* CM;
} SDD1_OL;
-static SDD1_OL* SDD1_OL_ctor(running_machine* machine, SDD1_CM* associatedCM)
+static SDD1_OL* SDD1_OL_ctor(running_machine& machine, SDD1_CM* associatedCM)
{
SDD1_OL* newclass = (SDD1_OL*)auto_alloc_array(machine, UINT8, sizeof(SDD1_OL));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->CM = associatedCM;
return newclass;
}
static void SDD1_OL_prepareDecomp(SDD1_OL* thisptr, UINT32 first_byte, UINT16 out_len, UINT8 *out_buf)
{
- thisptr->bitplanesInfo = sdd1_read(thisptr->machine, first_byte) & 0xc0;
+ thisptr->bitplanesInfo = sdd1_read(thisptr->machine(), first_byte) & 0xc0;
thisptr->length = out_len;
thisptr->buffer = out_buf;
}
@@ -471,7 +483,9 @@ static void SDD1_OL_launch(SDD1_OL* thisptr)
typedef struct
{
- running_machine* machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine* m_machine;
SDD1_IM* IM;
SDD1_GCD* GCD;
SDD1_BG* BG0; SDD1_BG* BG1; SDD1_BG* BG2; SDD1_BG* BG3;
@@ -481,10 +495,10 @@ typedef struct
SDD1_OL* OL;
} SDD1emu;
-static SDD1emu* SDD1emu_ctor(running_machine *machine)
+static SDD1emu* SDD1emu_ctor(running_machine &machine)
{
SDD1emu* newclass = (SDD1emu*)auto_alloc_array(machine, UINT8, sizeof(SDD1emu));
- newclass->machine = machine;
+ newclass->m_machine = &machine;
newclass->IM = SDD1_IM_ctor(machine);
newclass->GCD = SDD1_GCD_ctor(machine, newclass->IM);
@@ -545,7 +559,7 @@ typedef struct
static _snes_sdd1_t snes_sdd1;
-static void sdd1_init(running_machine* machine)
+static void sdd1_init(running_machine& machine)
{
UINT8 i;
@@ -648,9 +662,9 @@ static void sdd1_mmio_write(address_space *space, UINT32 addr, UINT8 data)
}
}
-static UINT8 sdd1_read(running_machine* machine, UINT32 addr)
+static UINT8 sdd1_read(running_machine& machine, UINT32 addr)
{
- unsigned char *ROM = machine->region("cart")->base();
+ unsigned char *ROM = machine.region("cart")->base();
if(snes_sdd1.sdd1_enable & snes_sdd1.xfer_enable)
{
@@ -699,6 +713,6 @@ static UINT8 sdd1_read(running_machine* machine, UINT32 addr)
return ROM[snes_sdd1.mmc[(addr >> 20) & 3] + (addr & 0x0fffff)];
}
-static void sdd1_reset(running_machine *machine)
+static void sdd1_reset(running_machine &machine)
{
}
diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c
index 9f864a02820..a307b6181ea 100644
--- a/src/mame/machine/starwars.c
+++ b/src/mame/machine/starwars.c
@@ -37,7 +37,7 @@
static TIMER_CALLBACK( math_run_clear )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
state->math_run = 0;
}
@@ -50,9 +50,9 @@ static TIMER_CALLBACK( math_run_clear )
WRITE8_HANDLER( starwars_nstore_w )
{
- space->machine->device<x2212_device>("x2212")->store(0);
- space->machine->device<x2212_device>("x2212")->store(1);
- space->machine->device<x2212_device>("x2212")->store(0);
+ space->machine().device<x2212_device>("x2212")->store(0);
+ space->machine().device<x2212_device>("x2212")->store(1);
+ space->machine().device<x2212_device>("x2212")->store(0);
}
/*************************************
@@ -63,39 +63,39 @@ WRITE8_HANDLER( starwars_nstore_w )
WRITE8_HANDLER( starwars_out_w )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
switch (offset & 7)
{
case 0: /* Coin counter 1 */
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
break;
case 1: /* Coin counter 2 */
- coin_counter_w(space->machine, 1, data);
+ coin_counter_w(space->machine(), 1, data);
break;
case 2: /* LED 3 */
- set_led_status(space->machine, 2, ~data & 0x80);
+ set_led_status(space->machine(), 2, ~data & 0x80);
break;
case 3: /* LED 2 */
- set_led_status(space->machine, 1, ~data & 0x80);
+ set_led_status(space->machine(), 1, ~data & 0x80);
break;
case 4: /* bank switch */
- memory_set_bank(space->machine, "bank1", (data >> 7) & 1);
+ memory_set_bank(space->machine(), "bank1", (data >> 7) & 1);
if (state->is_esb)
- memory_set_bank(space->machine, "bank2", (data >> 7) & 1);
+ memory_set_bank(space->machine(), "bank2", (data >> 7) & 1);
break;
case 5: /* reset PRNG */
break;
case 6: /* LED 1 */
- set_led_status(space->machine, 0, ~data & 0x80);
+ set_led_status(space->machine(), 0, ~data & 0x80);
break;
case 7: /* NVRAM array recall */
- space->machine->device<x2212_device>("x2212")->recall(~data & 0x80);
+ space->machine().device<x2212_device>("x2212")->recall(~data & 0x80);
break;
}
}
@@ -110,7 +110,7 @@ WRITE8_HANDLER( starwars_out_w )
CUSTOM_INPUT( matrix_flag_r )
{
- starwars_state *state = field->port->machine->driver_data<starwars_state>();
+ starwars_state *state = field->port->machine().driver_data<starwars_state>();
/* set the matrix processor flag */
return state->math_run ? 1 : 0;
}
@@ -125,14 +125,14 @@ CUSTOM_INPUT( matrix_flag_r )
READ8_HANDLER( starwars_adc_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
/* pitch */
if (state->control_num == kPitch)
- return input_port_read(space->machine, "STICKY");
+ return input_port_read(space->machine(), "STICKY");
/* yaw */
else if (state->control_num == kYaw)
- return input_port_read(space->machine, "STICKX");
+ return input_port_read(space->machine(), "STICKX");
/* default to unused thrust */
else
@@ -142,7 +142,7 @@ READ8_HANDLER( starwars_adc_r )
WRITE8_HANDLER( starwars_adc_select_w )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
state->control_num = offset;
}
@@ -154,10 +154,10 @@ WRITE8_HANDLER( starwars_adc_select_w )
*
*************************************/
-void starwars_mproc_init(running_machine *machine)
+void starwars_mproc_init(running_machine &machine)
{
- starwars_state *state = machine->driver_data<starwars_state>();
- UINT8 *src = machine->region("user2")->base();
+ starwars_state *state = machine.driver_data<starwars_state>();
+ UINT8 *src = machine.region("user2")->base();
int cnt, val;
state->PROM_STR = auto_alloc_array(machine, UINT8, 1024);
@@ -178,7 +178,7 @@ void starwars_mproc_init(running_machine *machine)
state->PROM_AM[cnt] = (val >> 7) & 0x0001;
}
- state->math_timer = machine->scheduler().timer_alloc(FUNC(math_run_clear));
+ state->math_timer = machine.scheduler().timer_alloc(FUNC(math_run_clear));
}
@@ -189,9 +189,9 @@ void starwars_mproc_init(running_machine *machine)
*
*************************************/
-void starwars_mproc_reset(running_machine *machine)
+void starwars_mproc_reset(running_machine &machine)
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
state->MPA = state->BIC = 0;
state->math_run = 0;
}
@@ -204,9 +204,9 @@ void starwars_mproc_reset(running_machine *machine)
*
*************************************/
-static void run_mproc(running_machine *machine)
+static void run_mproc(running_machine &machine)
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
int RAMWORD = 0;
int MA_byte;
@@ -386,7 +386,7 @@ READ8_HANDLER( starwars_prng_r )
*/
/* Use MAME's PRNG for now */
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -399,21 +399,21 @@ READ8_HANDLER( starwars_prng_r )
READ8_HANDLER( starwars_div_reh_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
return (state->quotient_shift & 0xff00) >> 8;
}
READ8_HANDLER( starwars_div_rel_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
return state->quotient_shift & 0x00ff;
}
WRITE8_HANDLER( starwars_math_w )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
int i;
data &= 0xff; /* ASG 971002 -- make sure we only get bytes here */
@@ -421,7 +421,7 @@ WRITE8_HANDLER( starwars_math_w )
{
case 0: /* mw0 */
state->MPA = data << 2; /* Set starting PROM address */
- run_mproc(space->machine); /* and run the Matrix Processor */
+ run_mproc(space->machine()); /* and run the Matrix Processor */
break;
case 1: /* mw1 */
diff --git a/src/mame/machine/steppers.c b/src/mame/machine/steppers.c
index c63e1794a03..4f5f173e064 100644
--- a/src/mame/machine/steppers.c
+++ b/src/mame/machine/steppers.c
@@ -91,9 +91,9 @@ const stepper_interface starpoint_interface_48step =
};
///////////////////////////////////////////////////////////////////////////
-void stepper_config(running_machine *machine, int which, const stepper_interface *intf)
+void stepper_config(running_machine &machine, int which, const stepper_interface *intf)
{
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call stepper_config at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call stepper_config at init time!");
assert_always((which >= 0) && (which < MAX_STEPPERS), "stepper_config called on an invalid stepper motor!");
assert_always(intf, "stepper_config called with an invalid interface!");
diff --git a/src/mame/machine/steppers.h b/src/mame/machine/steppers.h
index 6ed042497bf..0e6250b3f7b 100644
--- a/src/mame/machine/steppers.h
+++ b/src/mame/machine/steppers.h
@@ -38,7 +38,7 @@ struct _stepper_interface
extern const stepper_interface starpoint_interface_48step;
-void stepper_config(running_machine *machine, int which, const stepper_interface *intf);
+void stepper_config(running_machine &machine, int which, const stepper_interface *intf);
void stepper_reset_position(int id); /* reset a motor to position 0 */
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index 58848b72acb..05bf5f6e019 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -38,9 +38,9 @@ Encryption PAL 16R4 on CPU board
DRIVER_INIT( empcity )
{
- stfight_state *state = machine->driver_data<stfight_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ stfight_state *state = machine.driver_data<stfight_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
state->decrypt = auto_alloc_array(machine, UINT8, 0x8000);
@@ -70,7 +70,7 @@ DRIVER_INIT( empcity )
DRIVER_INIT( stfight )
{
- stfight_state *state = machine->driver_data<stfight_state>();
+ stfight_state *state = machine.driver_data<stfight_state>();
DRIVER_INIT_CALL(empcity);
/* patch out a tight loop during startup - is the code waiting */
@@ -84,8 +84,8 @@ DRIVER_INIT( stfight )
MACHINE_RESET( stfight )
{
- stfight_state *state = machine->driver_data<stfight_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ stfight_state *state = machine.driver_data<stfight_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
state->adpcm_data_offs = state->adpcm_data_end = 0;
state->toggle = 0;
state->fm_data = 0;
@@ -103,9 +103,9 @@ MACHINE_RESET( stfight )
// - in fact I don't even know how/where it's switched in!
static WRITE8_HANDLER( stfight_bank_w )
{
- UINT8 *ROM2 = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *ROM2 = space->machine().region("maincpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1", &ROM2[data<<14] );
+ memory_set_bankptr(space->machine(), "bank1", &ROM2[data<<14] );
}
/*
@@ -122,7 +122,7 @@ INTERRUPT_GEN( stfight_vb_interrupt )
{
// Do a RST10
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7);
- device->machine->scheduler().timer_set(attotime::from_hz(120), FUNC(stfight_interrupt_1));
+ device->machine().scheduler().timer_set(attotime::from_hz(120), FUNC(stfight_interrupt_1));
}
/*
@@ -132,12 +132,12 @@ INTERRUPT_GEN( stfight_vb_interrupt )
// Perhaps define dipswitches as active low?
READ8_HANDLER( stfight_dsw_r )
{
- return( ~input_port_read(space->machine, offset ? "DSW1" : "DSW0") );
+ return( ~input_port_read(space->machine(), offset ? "DSW1" : "DSW0") );
}
READ8_HANDLER( stfight_coin_r )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
int coin_mech_data;
int i;
@@ -155,7 +155,7 @@ READ8_HANDLER( stfight_coin_r )
* since it's read by the 30Hz interrupt ISR
*/
- coin_mech_data = input_port_read(space->machine, "COIN");
+ coin_mech_data = input_port_read(space->machine(), "COIN");
for( i=0; i<2; i++ )
{
@@ -171,7 +171,7 @@ READ8_HANDLER( stfight_coin_r )
WRITE8_HANDLER( stfight_coin_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
// interrogate coin mech
state->coin_mech_query_active = 1;
state->coin_mech_query = data;
@@ -193,8 +193,8 @@ static const int sampleLimits[] =
void stfight_adpcm_int(device_t *device)
{
- stfight_state *state = device->machine->driver_data<stfight_state>();
- UINT8 *SAMPLES = device->machine->region("adpcm")->base();
+ stfight_state *state = device->machine().driver_data<stfight_state>();
+ UINT8 *SAMPLES = device->machine().region("adpcm")->base();
int adpcm_data = SAMPLES[state->adpcm_data_offs & 0x7fff];
// finished playing sample?
@@ -217,7 +217,7 @@ void stfight_adpcm_int(device_t *device)
WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w )
{
- stfight_state *state = device->machine->driver_data<stfight_state>();
+ stfight_state *state = device->machine().driver_data<stfight_state>();
if( data < 0x08 )
{
state->adpcm_data_offs = sampleLimits[data];
@@ -237,14 +237,14 @@ WRITE8_HANDLER( stfight_e800_w )
WRITE8_HANDLER( stfight_fm_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
// the sound cpu ignores any fm data without bit 7 set
state->fm_data = 0x80 | data;
}
READ8_HANDLER( stfight_fm_r )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
int data = state->fm_data;
// clear the latch?!?
diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c
index 0c0197676ef..3b7668c8186 100644
--- a/src/mame/machine/stvcd.c
+++ b/src/mame/machine/stvcd.c
@@ -137,8 +137,8 @@ static UINT32 fadstoplay = 0;
static int buffull, sectorstore, freeblocks;
// iso9660 utilities
-static void read_new_dir(running_machine *machine, UINT32 fileno);
-static void make_dir_current(running_machine *machine, UINT32 fad);
+static void read_new_dir(running_machine &machine, UINT32 fileno);
+static void make_dir_current(running_machine &machine, UINT32 fad);
static direntryT curroot; // root entry of current filesystem
static direntryT *curdir; // current directory
@@ -200,7 +200,7 @@ TIMER_DEVICE_CALLBACK( stv_sector_cb )
}
// global functions
-void stvcd_reset(running_machine *machine)
+void stvcd_reset(running_machine &machine)
{
INT32 i, j;
@@ -256,7 +256,7 @@ void stvcd_reset(running_machine *machine)
}
#ifdef MESS
- cdrom = cd_get_cdrom_file(machine->device( "cdrom" ));
+ cdrom = cd_get_cdrom_file(machine.device( "cdrom" ));
#else
cdrom = cdrom_open(get_disk_handle(machine, "cdrom"));
#endif
@@ -271,7 +271,7 @@ void stvcd_reset(running_machine *machine)
cd_stat = CD_STAT_OPEN;
}
- sector_timer = machine->device<timer_device>("sector_timer");
+ sector_timer = machine.device<timer_device>("sector_timer");
sector_timer->adjust(attotime::from_hz(150)); // 150 sectors / second = 300kBytes/second
}
@@ -443,7 +443,7 @@ static UINT16 cd_readWord(UINT32 addr)
return rv;
default:
- CDROM_LOG(("%s:CD: RW %08x\n", machine->describe_context(), addr))
+ CDROM_LOG(("%s:CD: RW %08x\n", machine.describe_context(), addr))
return 0xffff;
}
@@ -517,12 +517,12 @@ static UINT32 cd_readLong(UINT32 addr)
return rv;
default:
- CDROM_LOG(("%s:CD: RL %08x\n", machine->describe_context(), addr))
+ CDROM_LOG(("%s:CD: RL %08x\n", machine.describe_context(), addr))
return 0xffff;
}
}
-static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
+static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
{
UINT32 temp;
@@ -530,7 +530,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
{
case 0x0008:
case 0x000a:
-// CDROM_LOG(("%s:WW HIRQ: %04x & %04x => %04x\n", machine->describe_context(), hirqreg, data, hirqreg & data))
+// CDROM_LOG(("%s:WW HIRQ: %04x & %04x => %04x\n", machine.describe_context(), hirqreg, data, hirqreg & data))
hirqreg &= data;
return;
case 0x000c:
@@ -573,7 +573,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
switch (cr1 & 0xff00)
{
case 0x0000:
- CDROM_LOG(("%s:CD: Get Status\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get Status\n", machine.describe_context()))
// values taken from a US saturn with a disc in and the lid closed
hirqreg |= CMOK;
@@ -585,7 +585,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x0100:
- CDROM_LOG(("%s:CD: Get Hardware Info\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get Hardware Info\n", machine.describe_context()))
hirqreg |= CMOK;
cr1 = cd_stat;
cr2 = 0x0201;
@@ -594,7 +594,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x200: // Get TOC
- CDROM_LOG(("%s:CD: Get TOC\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get TOC\n", machine.describe_context()))
cd_readTOC();
cd_stat = CD_STAT_TRANS|CD_STAT_PAUSE;
cr2 = 102*2; // TOC length in words (102 entries @ 2 words/4bytes each)
@@ -608,7 +608,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
// bios is interested in returns in cr3 and cr4
// cr3 should be data track #
// cr4 must be > 1 and < 100 or bios gets angry.
- CDROM_LOG(("%s:CD: Get Session Info\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get Session Info\n", machine.describe_context()))
cd_readTOC();
switch (cr1 & 0xff)
{
@@ -639,7 +639,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
// CR1 & 4 = don't confirm mode 2 subheader
// CR1 & 8 = retry reading mode 2 sectors
// CR1 & 10 = force single-speed
- CDROM_LOG(("%s:CD: Initialize CD system\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Initialize CD system\n", machine.describe_context()))
hirqreg |= (CMOK|DRDY|ESEL);
cd_stat = CD_STAT_PAUSE;
cd_curfad = 150;
@@ -653,7 +653,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
case 0x0600: // end data transfer
// returns # of bytes transfered (24 bits) in
// low byte of cr1 (MSB) and cr2 (middle byte, LSB)
- CDROM_LOG(("%s:CD: End data transfer (%d bytes xfer'd)\n", machine->describe_context(), xferdnum))
+ CDROM_LOG(("%s:CD: End data transfer (%d bytes xfer'd)\n", machine.describe_context(), xferdnum))
// clear the "transfer" flag
cd_stat &= ~CD_STAT_TRANS;
@@ -730,7 +730,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x1000: // Play Disk. FAD is in lowest 7 bits of cr1 and all of cr2.
- CDROM_LOG(("%s:CD: Play Disk\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Play Disk\n", machine.describe_context()))
cd_stat = CD_STAT_PLAY; //|0x80; // set "cd-rom" bit?
cd_curfad = ((cr1&0xff)<<16) | cr2;
fadstoplay = ((cr3&0xff)<<16) | cr4;
@@ -768,7 +768,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x1100: // disk seek
- CDROM_LOG(("%s:CD: Disk seek\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Disk seek\n", machine.describe_context()))
if (cr1 & 0x80)
{
temp = (cr1&0x7f)<<16; // get FAD to seek to
@@ -814,7 +814,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
// get operation
parm = cr3>>8;
- CDROM_LOG(("%s:CD: Set CD Device Connection filter # %x\n", machine->describe_context(), parm))
+ CDROM_LOG(("%s:CD: Set CD Device Connection filter # %x\n", machine.describe_context(), parm))
cddevicenum = parm;
@@ -840,7 +840,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
{
UINT8 fnum = (cr3>>8)&0xff;
- CDROM_LOG(("%s:CD: Set Filter Range\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Set Filter Range\n", machine.describe_context()))
filters[fnum].fad = ((cr1 & 0xff)<<16) | cr2;
filters[fnum].range = ((cr3 & 0xff)<<16) | cr4;
@@ -856,7 +856,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
{
UINT8 fnum = (cr3>>8)&0xff;
- CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", machine->describe_context(), fnum, cr1&0xff, cr2, cr3&0xff, cr4))
+ CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", machine.describe_context(), fnum, cr1&0xff, cr2, cr3&0xff, cr4))
filters[fnum].chan = cr1 & 0xff;
filters[fnum].smmask = (cr2>>8)&0xff;
@@ -887,7 +887,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
filters[fnum].mode = mode;
}
- CDROM_LOG(("%s:CD: Set Filter Mode filt %x mode %x\n", machine->describe_context(), fnum, mode))
+ CDROM_LOG(("%s:CD: Set Filter Mode filt %x mode %x\n", machine.describe_context(), fnum, mode))
hirqreg |= (CMOK|ESEL|DRDY);
cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte
cr3 = 0x0100|((cd_curfad>>16)&0xff);
@@ -899,7 +899,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
{
UINT8 fnum = (cr3>>8)&0xff;
- CDROM_LOG(("%s:CD: Set Filter Connection %x => mode %x parm %04x\n", machine->describe_context(), fnum, cr1 & 0xf, cr2))
+ CDROM_LOG(("%s:CD: Set Filter Connection %x => mode %x parm %04x\n", machine.describe_context(), fnum, cr1 & 0xf, cr2))
// set true condition?
if (cr1 & 1)
@@ -919,7 +919,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x4800: // Reset Selector
- CDROM_LOG(("%s:CD: Reset Selector\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Reset Selector\n", machine.describe_context()))
hirqreg |= (CMOK|ESEL|DRDY);
cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte
cr3 = 0x0100|((cd_curfad>>16)&0xff);
@@ -933,7 +933,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
cr3 = 0x1800;
cr4 = 200;
- CDROM_LOG(("%s:CD: Get Buffer Size = %d\n", cr2, machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get Buffer Size = %d\n", cr2, machine.describe_context()))
hirqreg |= (CMOK|ESEL|DRDY); // DRDY is probably wrong
break;
@@ -951,7 +951,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
cr4 = partitions[bufnum].numblks;
}
- CDROM_LOG(("%s:CD: Get Sector Number (bufno %d) = %d blocks\n", machine->describe_context(), bufnum, cr4))
+ CDROM_LOG(("%s:CD: Get Sector Number (bufno %d) = %d blocks\n", machine.describe_context(), bufnum, cr4))
cr2 = 0;
cr3 = 0;
@@ -965,7 +965,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
UINT32 sectoffs = cr2;
UINT32 numsect = cr4;
- CDROM_LOG(("%s:CD: Calculate actual size: buf %x offs %x numsect %x\n", machine->describe_context(), bufnum, sectoffs, numsect))
+ CDROM_LOG(("%s:CD: Calculate actual size: buf %x offs %x numsect %x\n", machine.describe_context(), bufnum, sectoffs, numsect))
calcsize = 0;
if (partitions[bufnum].size != -1)
@@ -990,7 +990,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x5300: // get actual block size
- CDROM_LOG(("%s:CD: Get actual block size\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get actual block size\n", machine.describe_context()))
hirqreg |= (CMOK|ESEL);
cr1 = cd_stat | ((calcsize>>16)&0xff);
cr2 = (calcsize & 0xffff);
@@ -999,7 +999,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x6000: // set sector length
- CDROM_LOG(("%s:CD: Set sector length\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Set sector length\n", machine.describe_context()))
hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY);
switch (cr1 & 0xff)
@@ -1041,7 +1041,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
UINT32 sectofs = cr2;
UINT32 bufnum = cr3>>8;
- CDROM_LOG(("%s:CD: Get sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum))
+ CDROM_LOG(("%s:CD: Get sector data (SN %d SO %d BN %d)\n", machine.describe_context(), sectnum, sectofs, bufnum))
if (bufnum >= MAX_FILTERS)
{
@@ -1081,7 +1081,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
UINT32 bufnum = cr3>>8;
INT32 i;
- CDROM_LOG(("%s:CD: Delete sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum))
+ CDROM_LOG(("%s:CD: Delete sector data (SN %d SO %d BN %d)\n", machine.describe_context(), sectnum, sectofs, bufnum))
if (bufnum >= MAX_FILTERS)
{
@@ -1124,7 +1124,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
UINT32 sectofs = cr2;
UINT32 bufnum = cr3>>8;
- CDROM_LOG(("%s:CD: Get and delete sector data (SN %d SO %d BN %d)\n", machine->describe_context(), sectnum, sectofs, bufnum))
+ CDROM_LOG(("%s:CD: Get and delete sector data (SN %d SO %d BN %d)\n", machine.describe_context(), sectnum, sectofs, bufnum))
if (bufnum >= MAX_FILTERS)
{
@@ -1158,12 +1158,12 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x6700: // get copy error
- CDROM_LOG(("%s:CD: Get copy error\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get copy error\n", machine.describe_context()))
hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY);
break;
case 0x7000: // change directory
- CDROM_LOG(("%s:CD: Change Directory\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Change Directory\n", machine.describe_context()))
hirqreg |= (CMOK|EFLS);
temp = (cr3&0xff)<<16;
@@ -1172,7 +1172,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x7100: // Read directory entry
- CDROM_LOG(("%s:CD: Read Directory Entry\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Read Directory Entry\n", machine.describe_context()))
hirqreg |= (CMOK|DRDY);
temp = (cr3&0xff)<<16;
@@ -1183,7 +1183,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x7200: // Get file system scope
- CDROM_LOG(("%s:CD: Get file system scope(PC=%x)\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get file system scope(PC=%x)\n", machine.describe_context()))
hirqreg |= (CMOK|DRDY);
cr2 = numfiles; // # of files in directory
cr3 = 0x0100; // report directory held
@@ -1191,7 +1191,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x7300: // Get File Info
- CDROM_LOG(("%s:CD: Get File Info\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get File Info\n", machine.describe_context()))
cd_stat |= CD_STAT_TRANS;
cd_stat &= 0xff00; // clear top byte of return value
hirqreg |= (CMOK|DRDY);
@@ -1245,7 +1245,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x7400: // Read File
- CDROM_LOG(("%s:CD: Read File\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Read File\n", machine.describe_context()))
temp = (cr3&0xff)<<16;
temp |= cr4;
@@ -1276,14 +1276,14 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0x7500:
- CDROM_LOG(("%s:CD: Abort File\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Abort File\n", machine.describe_context()))
// bios expects "2bc" mask to work against this
hirqreg |= (CMOK|EFLS|EHST|ESEL|DCHG|PEND|BFUL|CSCT|DRDY);
cd_stat = CD_STAT_PERI|CD_STAT_PAUSE; // force to pause
break;
case 0xe000: // appears to be copy protection check. needs only to return OK.
- CDROM_LOG(("%s:CD: Verify copy protection\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Verify copy protection\n", machine.describe_context()))
cd_stat = CD_STAT_PAUSE;
cr1 = cd_stat; // necessary to pass
cr2 = 0x4;
@@ -1293,7 +1293,7 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
case 0xe100: // get disc region
- CDROM_LOG(("%s:CD: Get disc region\n", machine->describe_context()))
+ CDROM_LOG(("%s:CD: Get disc region\n", machine.describe_context()))
cd_stat = CD_STAT_PAUSE;
cr1 = cd_stat; // necessary to pass
cr2 = 0x4; // (must return this value to pass bios checks)
@@ -1301,14 +1301,14 @@ static void cd_writeWord(running_machine *machine, UINT32 addr, UINT16 data)
break;
default:
- CDROM_LOG(("%s:CD: Unknown command %04x\n", cr1, machine->describe_context()))
+ CDROM_LOG(("%s:CD: Unknown command %04x\n", cr1, machine.describe_context()))
hirqreg |= (CMOK);
break;
}
// CDROM_LOG(("ret: %04x %04x %04x %04x %04x\n", hirqreg, cr1, cr2, cr3, cr4))
break;
default:
- CDROM_LOG(("%s:CD: WW %08x %04x\n", addr, data, machine->describe_context()))
+ CDROM_LOG(("%s:CD: WW %08x %04x\n", addr, data, machine.describe_context()))
break;
}
}
@@ -1383,7 +1383,7 @@ WRITE32_HANDLER( stvcd_w )
case 0x90022:
case 0x90024:
case 0x90026:
- cd_writeWord(space->machine, offset, data>>16);
+ cd_writeWord(space->machine(), offset, data>>16);
break;
default:
@@ -1393,7 +1393,7 @@ WRITE32_HANDLER( stvcd_w )
}
// iso9660 parsing
-static void read_new_dir(running_machine *machine, UINT32 fileno)
+static void read_new_dir(running_machine &machine, UINT32 fileno)
{
int foundpd, i;
UINT32 cfad, dirfad;
@@ -1471,7 +1471,7 @@ static void read_new_dir(running_machine *machine, UINT32 fileno)
}
// makes the directory pointed to by FAD current
-static void make_dir_current(running_machine *machine, UINT32 fad)
+static void make_dir_current(running_machine &machine, UINT32 fad)
{
int i;
UINT32 nextent, numentries;
@@ -1540,7 +1540,7 @@ void stvcd_exit(running_machine& machine)
{
if (curdir != (direntryT *)NULL)
{
- auto_free(&machine, curdir);
+ auto_free(machine, curdir);
curdir = (direntryT *)NULL;
}
diff --git a/src/mame/machine/stvcd.h b/src/mame/machine/stvcd.h
index e4477ce2c23..d987a3599cb 100644
--- a/src/mame/machine/stvcd.h
+++ b/src/mame/machine/stvcd.h
@@ -9,7 +9,7 @@
#ifndef __STVCD_H__
#define __STVCD_H__
-void stvcd_reset(running_machine* machine);
+void stvcd_reset(running_machine& machine);
void stvcd_exit(running_machine& machine);
TIMER_DEVICE_CALLBACK( stv_sector_cb );
diff --git a/src/mame/machine/stvprot.c b/src/mame/machine/stvprot.c
index 6f028bf850e..fe3e53ab9ba 100644
--- a/src/mame/machine/stvprot.c
+++ b/src/mame/machine/stvprot.c
@@ -114,7 +114,7 @@ static UINT8 char_offset; //helper to jump the decoding of the NULL chars.
static READ32_HANDLER( twcup98_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -160,9 +160,9 @@ static WRITE32_HANDLER ( twcup98_prot_w )
//popmessage("%04x %04x",data,offset/4);
}
-void install_twcup98_protection(running_machine *machine)
+void install_twcup98_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(twcup98_prot_r), FUNC(twcup98_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(twcup98_prot_r), FUNC(twcup98_prot_w));
}
/**************************
@@ -173,7 +173,7 @@ void install_twcup98_protection(running_machine *machine)
static READ32_HANDLER( sss_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -225,9 +225,9 @@ static WRITE32_HANDLER ( sss_prot_w )
}
}
-void install_sss_protection(running_machine *machine)
+void install_sss_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(sss_prot_r), FUNC(sss_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(sss_prot_r), FUNC(sss_prot_w));
}
/*************************************
@@ -238,7 +238,7 @@ void install_sss_protection(running_machine *machine)
static READ32_HANDLER( rsgun_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -290,9 +290,9 @@ static WRITE32_HANDLER ( rsgun_prot_w )
//popmessage("%04x %04x",data,offset/4);
}
-void install_rsgun_protection(running_machine *machine)
+void install_rsgun_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(rsgun_prot_r), FUNC(rsgun_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(rsgun_prot_r), FUNC(rsgun_prot_w));
}
/*************************
@@ -313,7 +313,7 @@ void install_rsgun_protection(running_machine *machine)
static READ32_HANDLER( elandore_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -385,9 +385,9 @@ static WRITE32_HANDLER ( elandore_prot_w )
//popmessage("%04x %04x",data,offset/4);
}
-void install_elandore_protection(running_machine *machine)
+void install_elandore_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(elandore_prot_r), FUNC(elandore_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(elandore_prot_r), FUNC(elandore_prot_w));
}
/*************************
@@ -420,7 +420,7 @@ static const UINT32 vector_prot[] = { 0x0603B1B2,0x234 };
static READ32_HANDLER( ffreveng_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(a_bus[0] & 0x00010000)//protection calculation is activated
{
@@ -469,9 +469,9 @@ static WRITE32_HANDLER ( ffreveng_prot_w )
//popmessage("%04x %04x",data,offset/4);
}
-void install_ffreveng_protection(running_machine *machine)
+void install_ffreveng_protection(running_machine &machine)
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(ffreveng_prot_r), FUNC(ffreveng_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(ffreveng_prot_r), FUNC(ffreveng_prot_w));
}
/************************
@@ -485,11 +485,11 @@ static READ32_HANDLER(astrass_prot_r)
if ( offset == 3 && ctrl_index != -1 )
{
UINT32 data = 0;
- UINT32 *prot_data = (UINT32 *)space->machine->region("user2")->base();
+ UINT32 *prot_data = (UINT32 *)space->machine().region("user2")->base();
data = prot_data[ctrl_index++];
- if ( ctrl_index >= space->machine->region("user2")->bytes()/4 )
+ if ( ctrl_index >= space->machine().region("user2")->bytes()/4 )
{
ctrl_index = -1;
}
@@ -508,10 +508,10 @@ static WRITE32_HANDLER(astrass_prot_w)
}
}
-void install_astrass_protection(running_machine *machine)
+void install_astrass_protection(running_machine &machine)
{
ctrl_index = -1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(astrass_prot_r), FUNC(astrass_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4fffff0, 0x4ffffff, FUNC(astrass_prot_r), FUNC(astrass_prot_w));
}
/**************************
@@ -531,7 +531,7 @@ static UINT16 decathlt_prottable2[128];
static READ32_HANDLER( decathlt_prot_r )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if (offset==2)
{
@@ -654,7 +654,7 @@ static WRITE32_HANDLER( decathlt_prot_w )
}
-void install_decathlt_protection(running_machine *machine)
+void install_decathlt_protection(running_machine &machine)
{
/* It uploads 2 tables here, then performs what looks like a number of transfers, setting
a source address of some kind (scrambled?) and then making many reads from a single address */
@@ -663,12 +663,12 @@ void install_decathlt_protection(running_machine *machine)
decathlt_prot_uploadmode = 0;
decathlt_prot_uploadoffset = 0;
decathlt_part = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x37FFFF0, 0x37FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x37FFFF0, 0x37FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot_w));
/* It uploads 2 tables here too, but nothing else, mirror? unused? */
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x27FFFF0, 0x27FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot_w));
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x27FFFF0, 0x27FFFFF, FUNC(decathlt_prot_r), FUNC(decathlt_prot_w));
}
-void stv_register_protection_savestates(running_machine *machine)
+void stv_register_protection_savestates(running_machine &machine)
{
state_save_register_global_array(machine, a_bus);
state_save_register_global(machine, ctrl_index);
diff --git a/src/mame/machine/stvprot.h b/src/mame/machine/stvprot.h
index 0aabb7cf515..d69978642db 100644
--- a/src/mame/machine/stvprot.h
+++ b/src/mame/machine/stvprot.h
@@ -1,12 +1,12 @@
/* stvprot.h */
-void install_twcup98_protection(running_machine *machine);
-void install_sss_protection(running_machine *machine);
-void install_decathlt_protection(running_machine *machine);
-void install_astrass_protection(running_machine *machine);
-void install_rsgun_protection(running_machine *machine);
-void install_elandore_protection(running_machine *machine);
-void install_ffreveng_protection(running_machine *machine);
+void install_twcup98_protection(running_machine &machine);
+void install_sss_protection(running_machine &machine);
+void install_decathlt_protection(running_machine &machine);
+void install_astrass_protection(running_machine &machine);
+void install_rsgun_protection(running_machine &machine);
+void install_elandore_protection(running_machine &machine);
+void install_ffreveng_protection(running_machine &machine);
-void stv_register_protection_savestates(running_machine *machine);
+void stv_register_protection_savestates(running_machine &machine);
diff --git a/src/mame/machine/subs.c b/src/mame/machine/subs.c
index 55242fe59df..5d9d8f3b50d 100644
--- a/src/mame/machine/subs.c
+++ b/src/mame/machine/subs.c
@@ -13,7 +13,7 @@ subs_init_machine
***************************************************************************/
MACHINE_RESET( subs )
{
- subs_state *state = machine->driver_data<subs_state>();
+ subs_state *state = machine.driver_data<subs_state>();
state->steering_buf1 = 0;
state->steering_buf2 = 0;
state->steering_val1 = 0x00;
@@ -26,7 +26,7 @@ subs_interrupt
INTERRUPT_GEN( subs_interrupt )
{
/* only do NMI interrupt if not in TEST mode */
- if ((input_port_read(device->machine, "IN1") & 0x40)==0x40)
+ if ((input_port_read(device->machine(), "IN1") & 0x40)==0x40)
device_set_input_line(device,INPUT_LINE_NMI,PULSE_LINE);
}
@@ -37,9 +37,9 @@ When D7 is high, the steering wheel has moved.
If D6 is high, it moved left. If D6 is low, it moved right.
Be sure to keep returning a direction until steer_reset is called.
***************************************************************************/
-static int subs_steering_1(running_machine *machine)
+static int subs_steering_1(running_machine &machine)
{
- subs_state *state = machine->driver_data<subs_state>();
+ subs_state *state = machine.driver_data<subs_state>();
int this_val;
int delta;
@@ -66,9 +66,9 @@ static int subs_steering_1(running_machine *machine)
return state->steering_val1;
}
-static int subs_steering_2(running_machine *machine)
+static int subs_steering_2(running_machine &machine)
{
- subs_state *state = machine->driver_data<subs_state>();
+ subs_state *state = machine.driver_data<subs_state>();
int this_val;
int delta;
@@ -100,7 +100,7 @@ subs_steer_reset
***************************************************************************/
WRITE8_HANDLER( subs_steer_reset_w )
{
- subs_state *state = space->machine->driver_data<subs_state>();
+ subs_state *state = space->machine().driver_data<subs_state>();
state->steering_val1 = 0x00;
state->steering_val2 = 0x00;
}
@@ -110,7 +110,7 @@ subs_control_r
***************************************************************************/
READ8_HANDLER( subs_control_r )
{
- int inport = input_port_read(space->machine, "IN0");
+ int inport = input_port_read(space->machine(), "IN0");
switch (offset & 0x07)
{
@@ -118,10 +118,10 @@ READ8_HANDLER( subs_control_r )
case 0x01: return ((inport & 0x02) << 6); /* diag hold */
case 0x02: return ((inport & 0x04) << 5); /* slam */
case 0x03: return ((inport & 0x08) << 4); /* spare */
- case 0x04: return ((subs_steering_1(space->machine) & 0x40) << 1); /* steer dir 1 */
- case 0x05: return ((subs_steering_1(space->machine) & 0x80) << 0); /* steer flag 1 */
- case 0x06: return ((subs_steering_2(space->machine) & 0x40) << 1); /* steer dir 2 */
- case 0x07: return ((subs_steering_2(space->machine) & 0x80) << 0); /* steer flag 2 */
+ case 0x04: return ((subs_steering_1(space->machine()) & 0x40) << 1); /* steer dir 1 */
+ case 0x05: return ((subs_steering_1(space->machine()) & 0x80) << 0); /* steer flag 1 */
+ case 0x06: return ((subs_steering_2(space->machine()) & 0x40) << 1); /* steer dir 2 */
+ case 0x07: return ((subs_steering_2(space->machine()) & 0x80) << 0); /* steer flag 2 */
}
return 0;
@@ -132,7 +132,7 @@ subs_coin_r
***************************************************************************/
READ8_HANDLER( subs_coin_r )
{
- int inport = input_port_read(space->machine, "IN1");
+ int inport = input_port_read(space->machine(), "IN1");
switch (offset & 0x07)
{
@@ -154,7 +154,7 @@ subs_options_r
***************************************************************************/
READ8_HANDLER( subs_options_r )
{
- int opts = input_port_read(space->machine, "DSW");
+ int opts = input_port_read(space->machine(), "DSW");
switch (offset & 0x03)
{
@@ -172,7 +172,7 @@ subs_lamp1_w
***************************************************************************/
WRITE8_HANDLER( subs_lamp1_w )
{
- set_led_status(space->machine, 0,~offset & 1);
+ set_led_status(space->machine(), 0,~offset & 1);
}
/***************************************************************************
@@ -180,5 +180,5 @@ subs_lamp2_w
***************************************************************************/
WRITE8_HANDLER( subs_lamp2_w )
{
- set_led_status(space->machine, 1,~offset & 1);
+ set_led_status(space->machine(), 1,~offset & 1);
}
diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c
index 014d2e32a2f..d2615a87ad8 100644
--- a/src/mame/machine/tait8741.c
+++ b/src/mame/machine/tait8741.c
@@ -177,7 +177,7 @@ static void taito8741_update(address_space *space, int num)
else
{ /* port select */
st->parallelselect = data & 0x07;
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? input_port_read(space->machine, st->portName) : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
}
}
}
@@ -188,7 +188,7 @@ static void taito8741_update(address_space *space, int num)
case -1: /* no command data */
break;
case 0x00: /* read from parallel port */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine, st->portName) : 0 );
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0 );
break;
case 0x01: /* read receive buffer 0 */
case 0x02: /* read receive buffer 1 */
@@ -201,10 +201,10 @@ static void taito8741_update(address_space *space, int num)
taito8741_hostdata_w(st,st->rxd[data-1]);
break;
case 0x08: /* latch received serial data */
- st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine, st->portName) : 0;
+ st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine(), st->portName) : 0;
if( sst )
{
- space->machine->scheduler().synchronize(FUNC(taito8741_serial_tx), num);
+ space->machine().scheduler().synchronize(FUNC(taito8741_serial_tx), num);
st->serial_out = 0;
st->status |= 0x04;
st->phase = CMD_08;
@@ -277,7 +277,7 @@ static int I8741_status_r(address_space *space, int num)
{
I8741 *st = &taito8741[num];
taito8741_update(space, num);
- LOG(("%s:8741-%d ST Read %02x\n",space->machine->describe_context(),num,st->status));
+ LOG(("%s:8741-%d ST Read %02x\n",space->machine().describe_context(),num,st->status));
return st->status;
}
@@ -287,7 +287,7 @@ static int I8741_data_r(address_space *space, int num)
I8741 *st = &taito8741[num];
int ret = st->toData;
st->status &= 0xfe;
- LOG(("%s:8741-%d DATA Read %02x\n",space->machine->describe_context(),num,ret));
+ LOG(("%s:8741-%d DATA Read %02x\n",space->machine().describe_context(),num,ret));
/* update chip */
taito8741_update(space, num);
@@ -295,7 +295,7 @@ static int I8741_data_r(address_space *space, int num)
switch( st->mode )
{
case TAITO8741_PORT: /* parallel data */
- taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? input_port_read(space->machine, st->portName) : 0);
+ taito8741_hostdata_w(st,st->portHandler ? st->portHandler(space, st->parallelselect) : st->portName ? input_port_read(space->machine(), st->portName) : 0);
break;
}
return ret;
@@ -305,7 +305,7 @@ static int I8741_data_r(address_space *space, int num)
static void I8741_data_w(address_space *space, int num, int data)
{
I8741 *st = &taito8741[num];
- LOG(("%s:8741-%d DATA Write %02x\n",space->machine->describe_context(),num,data));
+ LOG(("%s:8741-%d DATA Write %02x\n",space->machine().describe_context(),num,data));
st->fromData = data;
st->status |= 0x02;
/* update chip */
@@ -316,7 +316,7 @@ static void I8741_data_w(address_space *space, int num, int data)
static void I8741_command_w(address_space *space, int num, int data)
{
I8741 *st = &taito8741[num];
- LOG(("%s:8741-%d CMD Write %02x\n",space->machine->describe_context(),num,data));
+ LOG(("%s:8741-%d CMD Write %02x\n",space->machine().describe_context(),num,data));
st->fromCmd = data;
st->status |= 0x04;
/* update chip */
@@ -435,12 +435,12 @@ static TIMER_CALLBACK( josvolly_8741_tx )
dst->sts |= 0x01; /* RX ready ? */
}
-static void josvolly_8741_do(running_machine *machine, int num)
+static void josvolly_8741_do(running_machine &machine, int num)
{
if( (i8741[num].sts & 0x02) )
{
/* transmit data */
- machine->scheduler().timer_set (attotime::from_usec(1), FUNC(josvolly_8741_tx), num);
+ machine.scheduler().timer_set (attotime::from_usec(1), FUNC(josvolly_8741_tx), num);
}
}
@@ -450,7 +450,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
if(offset==1)
{
- LOG(("%s:8741[%d] CW %02X\n", space->machine->describe_context(), num, data));
+ LOG(("%s:8741[%d] CW %02X\n", space->machine().describe_context(), num, data));
/* read pointer */
mcu->cmd = data;
@@ -472,7 +472,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
break;
case 2:
#if 1
- mcu->rxd = input_port_read(space->machine, "DSW2");
+ mcu->rxd = input_port_read(space->machine(), "DSW2");
mcu->sts |= 0x01; /* RD ready */
#endif
break;
@@ -488,7 +488,7 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
else
{
/* data */
- LOG(("%s:8741[%d] DW %02X\n", space->machine->describe_context(), num, data));
+ LOG(("%s:8741[%d] DW %02X\n", space->machine().describe_context(), num, data));
mcu->txd = data ^ 0x40; /* parity reverce ? */
mcu->sts |= 0x02; /* TXD busy */
@@ -498,13 +498,13 @@ static void josvolly_8741_w(address_space *space, int num, int offset, int data)
{
if(josvolly_nmi_enable)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
josvolly_nmi_enable = 0;
}
}
#endif
}
- josvolly_8741_do(space->machine, num);
+ josvolly_8741_do(space->machine(), num);
}
static INT8 josvolly_8741_r(address_space *space,int num,int offset)
@@ -515,16 +515,16 @@ static INT8 josvolly_8741_r(address_space *space,int num,int offset)
if(offset==1)
{
if(mcu->rst)
- mcu->rxd = input_port_read(space->machine, mcu->initReadPort); /* port in */
+ mcu->rxd = input_port_read(space->machine(), mcu->initReadPort); /* port in */
ret = mcu->sts;
- LOG(("%s:8741[%d] SR %02X\n",space->machine->describe_context(),num,ret));
+ LOG(("%s:8741[%d] SR %02X\n",space->machine().describe_context(),num,ret));
}
else
{
/* clear status port */
mcu->sts &= ~0x01; /* RD ready */
ret = mcu->rxd;
- LOG(("%s:8741[%d] DR %02X\n",space->machine->describe_context(),num,ret));
+ LOG(("%s:8741[%d] DR %02X\n",space->machine().describe_context(),num,ret));
mcu->rst = 0;
}
return ret;
@@ -547,7 +547,7 @@ static struct
UINT8 rst;
}cyclemb_mcu;
-void cyclemb_8741_reset(running_machine *machine)
+void cyclemb_8741_reset(running_machine &machine)
{
cyclemb_mcu.txd = 0;
cyclemb_mcu.rst = 1;
@@ -579,11 +579,11 @@ static void cyclemb_8741_w(address_space *space, int num, int offset, int data)
cyclemb_mcu.rst = 0;
break;
case 2:
- cyclemb_mcu.rxd = (input_port_read(space->machine, "DSW2") & 0x1f) << 2;
+ cyclemb_mcu.rxd = (input_port_read(space->machine(), "DSW2") & 0x1f) << 2;
cyclemb_mcu.rst = 0;
break;
case 3:
- //cyclemb_mcu.rxd = input_port_read(space->machine, "DSW2");
+ //cyclemb_mcu.rxd = input_port_read(space->machine(), "DSW2");
cyclemb_mcu.rst = 1;
break;
}
@@ -613,15 +613,15 @@ static INT8 cyclemb_8741_r(address_space *space,int num,int offset)
/* FIXME: remove cpu_get_pc hack */
switch(cpu_get_pc(space->cpu))
{
- case 0x760: cyclemb_mcu.rxd = ((input_port_read(space->machine,"DSW1") & 0x1f) << 2); break;
+ case 0x760: cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW1") & 0x1f) << 2); break;
case 0x35c:
{
static UINT8 mux_r;
mux_r^=0x20;
if(mux_r & 0x20)
- cyclemb_mcu.rxd = ((input_port_read(space->machine,"DSW3")) & 0x9f) | (mux_r) | (space->machine->rand() & 0x40);
+ cyclemb_mcu.rxd = ((input_port_read(space->machine(),"DSW3")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
else
- cyclemb_mcu.rxd = ((input_port_read(space->machine,"IN0")) & 0x9f) | (mux_r) | (space->machine->rand() & 0x40);
+ cyclemb_mcu.rxd = ((input_port_read(space->machine(),"IN0")) & 0x9f) | (mux_r) | (space->machine().rand() & 0x40);
}
break;
}
diff --git a/src/mame/machine/tait8741.h b/src/mame/machine/tait8741.h
index 0a99ea39eba..54fa5b153f9 100644
--- a/src/mame/machine/tait8741.h
+++ b/src/mame/machine/tait8741.h
@@ -53,7 +53,7 @@ WRITE8_HANDLER( josvolly_nmi_enable_w );
Cycle Mahbou set.
****************************************************************************/
-void cyclemb_8741_reset(running_machine *machine);
+void cyclemb_8741_reset(running_machine &machine);
WRITE8_HANDLER( cyclemb_8741_0_w );
//WRITE8_HANDLER( cyclemb_8741_1_w );
READ8_HANDLER( cyclemb_8741_0_r );
diff --git a/src/mame/machine/taitoio.c b/src/mame/machine/taitoio.c
index 3ef25648b5b..6f97d94cb00 100644
--- a/src/mame/machine/taitoio.c
+++ b/src/mame/machine/taitoio.c
@@ -127,15 +127,15 @@ WRITE8_DEVICE_HANDLER( tc0220ioc_w )
{
case 0x00:
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
break;
case 0x04: /* coin counters and lockout, hi nibble irrelevant */
- coin_lockout_w(device->machine, 0, ~data & 0x01);
- coin_lockout_w(device->machine, 1, ~data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x08);
+ coin_lockout_w(device->machine(), 0, ~data & 0x01);
+ coin_lockout_w(device->machine(), 1, ~data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x08);
//if (data & 0xf0)
//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",cpu_get_pc(space->cpu),data,offset);
@@ -284,14 +284,14 @@ WRITE8_DEVICE_HANDLER( tc0510nio_w )
switch (offset)
{
case 0x00:
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
break;
case 0x04: /* coin counters and lockout */
- coin_lockout_w(device->machine, 0, ~data & 0x01);
- coin_lockout_w(device->machine, 1, ~data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x08);
+ coin_lockout_w(device->machine(), 0, ~data & 0x01);
+ coin_lockout_w(device->machine(), 1, ~data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x08);
break;
default:
@@ -435,14 +435,14 @@ WRITE8_DEVICE_HANDLER( tc0640fio_w )
{
case 0x00:
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
break;
case 0x04: /* coin counters and lockout */
- coin_lockout_w(device->machine, 0, ~data & 0x01);
- coin_lockout_w(device->machine, 1, ~data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x04);
- coin_counter_w(device->machine, 1, data & 0x08);
+ coin_lockout_w(device->machine(), 0, ~data & 0x01);
+ coin_lockout_w(device->machine(), 1, ~data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x04);
+ coin_counter_w(device->machine(), 1, data & 0x08);
break;
default:
diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c
index 39136441b27..beb1c863038 100644
--- a/src/mame/machine/taitosj.c
+++ b/src/mame/machine/taitosj.c
@@ -18,9 +18,9 @@
MACHINE_START( taitosj )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("maincpu")->base() + 0x6000, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("maincpu")->base() + 0x10000, 0);
+ taitosj_state *state = machine.driver_data<taitosj_state>();
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("maincpu")->base() + 0x6000, 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("maincpu")->base() + 0x10000, 0);
state->save_item(NAME(state->fromz80));
state->save_item(NAME(state->toz80));
@@ -37,8 +37,8 @@ MACHINE_START( taitosj )
MACHINE_RESET( taitosj )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ taitosj_state *state = machine.driver_data<taitosj_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* set the default ROM bank (many games only have one bank and */
/* never write to the bank selector register) */
taitosj_bankswitch_w(space, 0, 0);
@@ -47,7 +47,7 @@ MACHINE_RESET( taitosj )
state->zaccept = 1;
state->zready = 0;
state->busreq = 0;
- if (machine->device("mcu") != NULL)
+ if (machine.device("mcu") != NULL)
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
state->spacecr_prot_value = 0;
@@ -56,10 +56,10 @@ MACHINE_RESET( taitosj )
WRITE8_HANDLER( taitosj_bankswitch_w )
{
- coin_lockout_global_w(space->machine, ~data & 1);
+ coin_lockout_global_w(space->machine(), ~data & 1);
- if(data & 0x80) memory_set_bank(space->machine, "bank1", 1);
- else memory_set_bank(space->machine, "bank1", 0);
+ if(data & 0x80) memory_set_bank(space->machine(), "bank1", 1);
+ else memory_set_bank(space->machine(), "bank1", 0);
}
@@ -98,7 +98,7 @@ READ8_HANDLER( taitosj_fake_status_r )
/* timer callback : */
READ8_HANDLER( taitosj_mcu_data_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
LOG(("%04x: protection read %02x\n",cpu_get_pc(space->cpu),state->toz80));
state->zaccept = 1;
return state->toz80;
@@ -107,7 +107,7 @@ READ8_HANDLER( taitosj_mcu_data_r )
/* timer callback : */
static TIMER_CALLBACK( taitosj_mcu_real_data_w )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
state->zready = 1;
cputag_set_input_line(machine, "mcu", 0, ASSERT_LINE);
state->fromz80 = param;
@@ -116,16 +116,16 @@ static TIMER_CALLBACK( taitosj_mcu_real_data_w )
WRITE8_HANDLER( taitosj_mcu_data_w )
{
LOG(("%04x: protection write %02x\n",cpu_get_pc(space->cpu),data));
- space->machine->scheduler().synchronize(FUNC(taitosj_mcu_real_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(taitosj_mcu_real_data_w), data);
/* temporarily boost the interleave to sync things up */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
READ8_HANDLER( taitosj_mcu_status_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
/* temporarily boost the interleave to sync things up */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
/* bit 0 = the 68705 has read data from the Z80 */
/* bit 1 = the 68705 has written data for the Z80 */
@@ -134,14 +134,14 @@ READ8_HANDLER( taitosj_mcu_status_r )
READ8_HANDLER( taitosj_68705_portA_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
LOG(("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),state->portA_in));
return state->portA_in;
}
WRITE8_HANDLER( taitosj_68705_portA_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
LOG(("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data));
state->portA_out = data;
}
@@ -176,21 +176,21 @@ READ8_HANDLER( taitosj_68705_portB_r )
/* timer callback : 68705 is going to read data from the Z80 */
static TIMER_CALLBACK( taitosj_mcu_data_real_r )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
state->zready = 0;
}
/* timer callback : 68705 is writing data for the Z80 */
static TIMER_CALLBACK( taitosj_mcu_status_real_w )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
state->toz80 = param;
state->zaccept = 0;
}
WRITE8_HANDLER( taitosj_68705_portB_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
LOG(("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data));
if (~data & 0x01)
@@ -200,8 +200,8 @@ WRITE8_HANDLER( taitosj_68705_portB_w )
if (~data & 0x02)
{
/* 68705 is going to read data from the Z80 */
- space->machine->scheduler().synchronize(FUNC(taitosj_mcu_data_real_r));
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ space->machine().scheduler().synchronize(FUNC(taitosj_mcu_data_real_r));
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
state->portA_in = state->fromz80;
LOG(("%04x: 68705 <- Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_in));
}
@@ -214,11 +214,11 @@ WRITE8_HANDLER( taitosj_68705_portB_w )
LOG(("%04x: 68705 -> Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_out));
/* 68705 is writing data for the Z80 */
- space->machine->scheduler().synchronize(FUNC(taitosj_mcu_status_real_w), state->portA_out);
+ space->machine().scheduler().synchronize(FUNC(taitosj_mcu_status_real_w), state->portA_out);
}
if (~data & 0x10)
{
- address_space *cpu0space = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *cpu0space = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
LOG(("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(space->cpu), state->portA_out, state->address));
cpu0space->write_byte(state->address, state->portA_out);
@@ -228,7 +228,7 @@ WRITE8_HANDLER( taitosj_68705_portB_w )
}
if (~data & 0x20)
{
- address_space *cpu0space = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *cpu0space = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
state->portA_in = cpu0space->read_byte(state->address);
LOG(("%04x: 68705 read %02x from address %04x\n", cpu_get_pc(space->cpu), state->portA_in, state->address));
}
@@ -256,7 +256,7 @@ WRITE8_HANDLER( taitosj_68705_portB_w )
READ8_HANDLER( taitosj_68705_portC_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
int res;
res = (state->zready << 0) | (state->zaccept << 1) | ((state->busreq^1) << 2);
@@ -269,7 +269,7 @@ READ8_HANDLER( taitosj_68705_portC_r )
READ8_HANDLER( spacecr_prot_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
int pc = cpu_get_pc(space->cpu);
if( pc != 0x368A && pc != 0x36A6 )
@@ -285,7 +285,7 @@ READ8_HANDLER( spacecr_prot_r )
WRITE8_HANDLER( alpine_protection_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
switch (data)
{
case 0x05:
@@ -310,13 +310,13 @@ WRITE8_HANDLER( alpine_protection_w )
WRITE8_HANDLER( alpinea_bankswitch_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
taitosj_bankswitch_w(space, offset, data);
state->protection_value = data >> 2;
}
READ8_HANDLER( alpine_port_2_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
- return input_port_read(space->machine, "IN2") | state->protection_value;
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
+ return input_port_read(space->machine(), "IN2") | state->protection_value;
}
diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c
index 9a9619a3f65..2cfd234dc78 100644
--- a/src/mame/machine/tatsumi.c
+++ b/src/mame/machine/tatsumi.c
@@ -6,9 +6,9 @@
/******************************************************************************/
-void tatsumi_reset(running_machine *machine)
+void tatsumi_reset(running_machine &machine)
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
state->last_control = 0;
state->control_word = 0;
state->apache3_adc = 0;
@@ -23,13 +23,13 @@ void tatsumi_reset(running_machine *machine)
READ16_HANDLER( apache3_bank_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
return state->control_word;
}
WRITE16_HANDLER( apache3_bank_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
/*
0x8000 - Set when accessing palette ram (not implemented, perhaps blank screen?)
0x0080 - Set when accessing IO cpu RAM/ROM (implemented as halt cpu)
@@ -43,18 +43,18 @@ WRITE16_HANDLER( apache3_bank_w )
if (state->control_word & 0x7f00)
{
logerror("Unknown control Word: %04x\n",state->control_word);
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_HALT, CLEAR_LINE); // ?
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_HALT, CLEAR_LINE); // ?
}
if (state->control_word & 0x10)
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, CLEAR_LINE);
if (state->control_word & 0x80)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_HALT, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_HALT, CLEAR_LINE);
state->last_control=state->control_word;
}
@@ -63,13 +63,13 @@ WRITE16_HANDLER( apache3_bank_w )
// D0 = /GRDACC - Allow 68000 access to road pattern RAM
WRITE16_HANDLER( apache3_z80_ctrl_w )
{
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_HALT, data & 2 ? ASSERT_LINE : CLEAR_LINE);
}
READ16_HANDLER( apache3_v30_v20_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
- address_space *targetspace = space->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
+ address_space *targetspace = space->machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* Each V20 byte maps to a V30 word */
if ((state->control_word & 0xe0) == 0xe0)
@@ -85,8 +85,8 @@ READ16_HANDLER( apache3_v30_v20_r )
WRITE16_HANDLER( apache3_v30_v20_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
- address_space *targetspace = space->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
+ address_space *targetspace = space->machine().device("audiocpu")->memory().space(AS_PROGRAM);
if ((state->control_word & 0xe0) != 0x80)
logerror("%08x: write unmapped v30 rom %08x\n", cpu_get_pc(space->cpu), offset);
@@ -100,27 +100,27 @@ WRITE16_HANDLER( apache3_v30_v20_w )
READ16_HANDLER( apache3_z80_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
return state->apache3_z80_ram[offset];
}
WRITE16_HANDLER( apache3_z80_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
state->apache3_z80_ram[offset] = data & 0xff;
}
READ8_HANDLER( apache3_adc_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
switch (state->apache3_adc)
{
- case 0: return input_port_read(space->machine, "STICK_X");
- case 1: return input_port_read(space->machine, "STICK_Y");
+ case 0: return input_port_read(space->machine(), "STICK_X");
+ case 1: return input_port_read(space->machine(), "STICK_Y");
case 2: return 0; // VSP1
case 3: return 0;
- case 4: return (UINT8)((255./100) * (100 - input_port_read(space->machine, "VR1")));
- case 5: return input_port_read(space->machine, "THROTTLE");
+ case 4: return (UINT8)((255./100) * (100 - input_port_read(space->machine(), "VR1")));
+ case 5: return input_port_read(space->machine(), "THROTTLE");
case 6: return 0; // RPSNC
case 7: return 0; // LPSNC
}
@@ -130,7 +130,7 @@ READ8_HANDLER( apache3_adc_r )
WRITE8_HANDLER( apache3_adc_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
state->apache3_adc = offset;
}
@@ -142,7 +142,7 @@ WRITE8_HANDLER( apache3_adc_w )
*/
WRITE16_HANDLER( apache3_rotate_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
state->apache3_rotate_ctrl[state->apache3_rot_idx] = data;
state->apache3_rot_idx = (state->apache3_rot_idx + 1) % 12;
}
@@ -151,8 +151,8 @@ WRITE16_HANDLER( apache3_rotate_w )
READ16_HANDLER( roundup_v30_z80_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
- address_space *targetspace = space->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
+ address_space *targetspace = space->machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* Each Z80 byte maps to a V30 word */
if (state->control_word & 0x20)
@@ -163,8 +163,8 @@ READ16_HANDLER( roundup_v30_z80_r )
WRITE16_HANDLER( roundup_v30_z80_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
- address_space *targetspace = space->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
+ address_space *targetspace = space->machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */
if (ACCESSING_BITS_0_7)
@@ -179,18 +179,18 @@ WRITE16_HANDLER( roundup_v30_z80_w )
WRITE16_HANDLER( roundup5_control_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->control_word);
if (state->control_word & 0x10)
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, CLEAR_LINE);
if (state->control_word & 0x4)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_HALT, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_HALT, CLEAR_LINE);
// if (offset == 1 && (tatsumi_control_w & 0xfeff) != (last_bank & 0xfeff))
// logerror("%08x: Changed bank to %04x (%d)\n", cpu_get_pc(space->cpu), tatsumi_control_w,offset);
@@ -216,7 +216,7 @@ WRITE16_HANDLER( roundup5_control_w )
*/
if ((state->control_word & 0x8) == 0 && !(state->last_control & 0x8))
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ4, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_IRQ4, ASSERT_LINE);
// if (tatsumi_control_w&0x200)
// cpu_set_reset_line(1, CLEAR_LINE);
// else
@@ -238,20 +238,20 @@ WRITE16_HANDLER( roundup5_control_w )
WRITE16_HANDLER( roundup5_d0000_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->roundup5_d0000_ram[offset]);
// logerror("d_68k_d0000_w %06x %04x\n", cpu_get_pc(space->cpu), data);
}
WRITE16_HANDLER( roundup5_e0000_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
/* Bit 0x10 is road bank select,
Bit 0x100 is used, but unknown
*/
COMBINE_DATA(&state->roundup5_e0000_ram[offset]);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong
// logerror("d_68k_e0000_w %06x %04x\n", cpu_get_pc(space->cpu), data);
}
@@ -260,14 +260,14 @@ WRITE16_HANDLER( roundup5_e0000_w )
READ16_HANDLER(cyclwarr_control_r)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
// logerror("%08x: control_r\n", cpu_get_pc(space->cpu));
return state->control_word;
}
WRITE16_HANDLER(cyclwarr_control_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->control_word);
// if ((state->control_word&0xfe) != (state->last_control&0xfe))
@@ -285,13 +285,13 @@ WRITE16_HANDLER(cyclwarr_control_w)
if ((state->control_word & 4) == 4 && (state->last_control & 4) == 0)
{
// logerror("68k 2 halt\n");
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, ASSERT_LINE);
}
if ((state->control_word & 4) == 0 && (state->last_control & 4) == 4)
{
// logerror("68k 2 irq go\n");
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_HALT, CLEAR_LINE);
}
@@ -309,8 +309,8 @@ WRITE16_HANDLER(cyclwarr_control_w)
READ16_HANDLER( tatsumi_v30_68000_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
- const UINT16* rom=(UINT16*)space->machine->region("sub")->base();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
+ const UINT16* rom=(UINT16*)space->machine().region("sub")->base();
logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(space->cpu), offset*2, state->control_word);
/* Read from 68k RAM */
@@ -319,7 +319,7 @@ logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(space->cpu), offset*2, state
// hack to make roundup 5 boot
if (cpu_get_pc(space->cpu)==0xec575)
{
- UINT8 *dst = space->machine->region("maincpu")->base();
+ UINT8 *dst = space->machine().region("maincpu")->base();
dst[BYTE_XOR_LE(0xec57a)]=0x46;
dst[BYTE_XOR_LE(0xec57b)]=0x46;
@@ -342,7 +342,7 @@ logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(space->cpu), offset*2, state
WRITE16_HANDLER( tatsumi_v30_68000_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
if ((state->control_word&0x1f)!=0x18)
logerror("68k write in bank %05x\n",state->control_word);
@@ -355,7 +355,7 @@ WRITE16_HANDLER( tatsumi_v30_68000_w )
// self-test in Tatsumi games. Needs fixed, but hack it here for now.
READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r)
{
- address_space *space = device->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
int r=ym2151_status_port_r(device,0);
if (cpu_get_pc(space->cpu)==0x2aca || cpu_get_pc(space->cpu)==0x29fe
@@ -369,7 +369,7 @@ READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r)
// Mame really should emulate the OKI status reads even with Mame sound off.
READ8_DEVICE_HANDLER(tatsumi_hack_oki_r)
{
- address_space *space = device->machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
int r=downcast<okim6295_device *>(device)->read(*space,0);
if (cpu_get_pc(space->cpu)==0x2b70 || cpu_get_pc(space->cpu)==0x2bb5
diff --git a/src/mame/machine/tecmosys.c b/src/mame/machine/tecmosys.c
index eb57bf43985..991aee84f5f 100644
--- a/src/mame/machine/tecmosys.c
+++ b/src/mame/machine/tecmosys.c
@@ -111,9 +111,9 @@ static void tecmosys_prot_reset(running_machine &machine)
state->device_value = 0xff;
}
-void tecmosys_prot_init(running_machine *machine, int which)
+void tecmosys_prot_init(running_machine &machine, int which)
{
- tecmosys_state *state = machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = machine.driver_data<tecmosys_state>();
switch (which)
{
case 0: state->device_data = &deroon_data; break;
@@ -121,7 +121,7 @@ void tecmosys_prot_init(running_machine *machine, int which)
case 2: state->device_data = &tkdensha_data; break;
}
- machine->add_notifier(MACHINE_NOTIFY_RESET, tecmosys_prot_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, tecmosys_prot_reset);
}
READ16_HANDLER(tecmosys_prot_status_r)
@@ -144,7 +144,7 @@ WRITE16_HANDLER(tecmosys_prot_status_w)
READ16_HANDLER(tecmosys_prot_data_r)
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
// prot appears to be read-ready for two consecutive reads
// but returns 0xff for subsequent reads.
UINT8 ret = state->device_value;
@@ -156,7 +156,7 @@ READ16_HANDLER(tecmosys_prot_data_r)
WRITE16_HANDLER(tecmosys_prot_data_w)
{
- tecmosys_state *state = space->machine->driver_data<tecmosys_state>();
+ tecmosys_state *state = space->machine().driver_data<tecmosys_state>();
// Only LSB
data >>= 8;
diff --git a/src/mame/machine/theglobp.c b/src/mame/machine/theglobp.c
index 2051edf806b..48b330e4b4b 100644
--- a/src/mame/machine/theglobp.c
+++ b/src/mame/machine/theglobp.c
@@ -65,13 +65,13 @@
#include "includes/pacman.h"
-static void theglobp_decrypt_rom_8(running_machine *machine)
+static void theglobp_decrypt_rom_8(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
@@ -102,13 +102,13 @@ static void theglobp_decrypt_rom_8(running_machine *machine)
}
-static void theglobp_decrypt_rom_9(running_machine *machine)
+static void theglobp_decrypt_rom_9(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -137,13 +137,13 @@ static void theglobp_decrypt_rom_9(running_machine *machine)
return;
}
-static void theglobp_decrypt_rom_A(running_machine *machine)
+static void theglobp_decrypt_rom_A(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -172,13 +172,13 @@ static void theglobp_decrypt_rom_A(running_machine *machine)
return;
}
-static void theglobp_decrypt_rom_B(running_machine *machine)
+static void theglobp_decrypt_rom_B(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -210,7 +210,7 @@ static void theglobp_decrypt_rom_B(running_machine *machine)
READ8_HANDLER( theglobp_decrypt_rom )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (offset & 0x01)
{
state->counter = (state->counter - 1) & 0x0F;
@@ -222,10 +222,10 @@ READ8_HANDLER( theglobp_decrypt_rom )
switch(state->counter)
{
- case 0x08: memory_set_bank (space->machine, "bank1", 0); break;
- case 0x09: memory_set_bank (space->machine, "bank1", 1); break;
- case 0x0A: memory_set_bank (space->machine, "bank1", 2); break;
- case 0x0B: memory_set_bank (space->machine, "bank1", 3); break;
+ case 0x08: memory_set_bank (space->machine(), "bank1", 0); break;
+ case 0x09: memory_set_bank (space->machine(), "bank1", 1); break;
+ case 0x0A: memory_set_bank (space->machine(), "bank1", 2); break;
+ case 0x0B: memory_set_bank (space->machine(), "bank1", 3); break;
default:
logerror("Invalid counter = %02X\n",state->counter);
break;
@@ -237,8 +237,8 @@ READ8_HANDLER( theglobp_decrypt_rom )
MACHINE_START( theglobp )
{
- pacman_state *state = machine->driver_data<pacman_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ pacman_state *state = machine.driver_data<pacman_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -256,7 +256,7 @@ MACHINE_START( theglobp )
MACHINE_RESET( theglobp )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
/* The initial state of the counter is 0x0A */
state->counter = 0x0A;
memory_set_bank(machine, "bank1", 2);
diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c
index a5df5fc2992..ac49d152bf5 100644
--- a/src/mame/machine/ticket.c
+++ b/src/mame/machine/ticket.c
@@ -69,7 +69,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle )
READ8_DEVICE_HANDLER( ticket_dispenser_r )
{
ticket_state *state = get_safe_token(device);
- LOG(("%s: Ticket Status Read = %02X\n", device->machine->describe_context(), state->status));
+ LOG(("%s: Ticket Status Read = %02X\n", device->machine().describe_context(), state->status));
return state->status;
}
@@ -90,7 +90,7 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w )
{
if (!state->power)
{
- LOG(("%s: Ticket Power On\n", device->machine->describe_context()));
+ LOG(("%s: Ticket Power On\n", device->machine().describe_context()));
state->timer->adjust(attotime::from_msec(state->time_msec));
state->power = 1;
@@ -101,9 +101,9 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w )
{
if (state->power)
{
- LOG(("%s: Ticket Power Off\n", device->machine->describe_context()));
+ LOG(("%s: Ticket Power Off\n", device->machine().describe_context()));
state->timer->adjust(attotime::never);
- set_led_status(device->machine, 2,0);
+ set_led_status(device->machine(), 2,0);
state->power = 0;
}
}
@@ -133,7 +133,7 @@ static DEVICE_START( ticket )
state->ticketdispensed = config->statushigh ? state->active_bit : 0;
state->ticketnotdispensed = state->ticketdispensed ^ state->active_bit;
- state->timer = device->machine->scheduler().timer_alloc(FUNC(ticket_dispenser_toggle), (void *)device);
+ state->timer = device->machine().scheduler().timer_alloc(FUNC(ticket_dispenser_toggle), (void *)device);
device->save_item(NAME(state->status));
device->save_item(NAME(state->power));
diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c
index 8d989884fba..72d7d154c41 100644
--- a/src/mame/machine/tnzs.c
+++ b/src/mame/machine/tnzs.c
@@ -19,7 +19,7 @@
static READ8_HANDLER( mcu_tnzs_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
UINT8 data;
data = upi41_master_r(state->mcu, offset & 1);
@@ -32,7 +32,7 @@ static READ8_HANDLER( mcu_tnzs_r )
static WRITE8_HANDLER( mcu_tnzs_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
// logerror("PC %04x: write %02x to mcu $c00%01x\n", cpu_get_previouspc(space->cpu), data, offset);
upi41_master_w(state->mcu, offset & 1, data);
@@ -41,14 +41,14 @@ static WRITE8_HANDLER( mcu_tnzs_w )
READ8_HANDLER( tnzs_port1_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
int data = 0;
switch (state->input_select & 0x0f)
{
- case 0x0a: data = input_port_read(space->machine, "IN2"); break;
- case 0x0c: data = input_port_read(space->machine, "IN0"); break;
- case 0x0d: data = input_port_read(space->machine, "IN1"); break;
+ case 0x0a: data = input_port_read(space->machine(), "IN2"); break;
+ case 0x0c: data = input_port_read(space->machine(), "IN0"); break;
+ case 0x0d: data = input_port_read(space->machine(), "IN1"); break;
default: data = 0xff; break;
}
@@ -59,7 +59,7 @@ READ8_HANDLER( tnzs_port1_r )
READ8_HANDLER( tnzs_port2_r )
{
- int data = input_port_read(space->machine, "IN2");
+ int data = input_port_read(space->machine(), "IN2");
// logerror("I8742:%04x Read %02x from port 2\n", cpu_get_previouspc(space->cpu), data);
@@ -68,13 +68,13 @@ READ8_HANDLER( tnzs_port2_r )
WRITE8_HANDLER( tnzs_port2_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
// logerror("I8742:%04x Write %02x to port 2\n", cpu_get_previouspc(space->cpu), data);
- coin_lockout_w(space->machine, 0, (data & 0x40));
- coin_lockout_w(space->machine, 1, (data & 0x80));
- coin_counter_w(space->machine, 0, (~data & 0x10));
- coin_counter_w(space->machine, 1, (~data & 0x20));
+ coin_lockout_w(space->machine(), 0, (data & 0x40));
+ coin_lockout_w(space->machine(), 1, (data & 0x80));
+ coin_counter_w(space->machine(), 0, (~data & 0x10));
+ coin_counter_w(space->machine(), 1, (~data & 0x20));
state->input_select = data;
}
@@ -87,7 +87,7 @@ READ8_HANDLER( arknoid2_sh_f000_r )
// logerror("PC %04x: read input %04x\n", cpu_get_pc(space->cpu), 0xf000 + offset);
- val = input_port_read_safe(space->machine, (offset / 2) ? "AN2" : "AN1", 0);
+ val = input_port_read_safe(space->machine(), (offset / 2) ? "AN2" : "AN1", 0);
if (offset & 1)
return ((val >> 8) & 0xff);
else
@@ -95,9 +95,9 @@ READ8_HANDLER( arknoid2_sh_f000_r )
}
-static void mcu_reset( running_machine *machine )
+static void mcu_reset( running_machine &machine )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_initializing = 3;
state->mcu_coinage_init = 0;
@@ -112,9 +112,9 @@ static void mcu_reset( running_machine *machine )
state->mcu_command = 0;
}
-static void mcu_handle_coins( running_machine *machine, int coin )
+static void mcu_handle_coins( running_machine &machine, int coin )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
/* The coin inputs and coin counters are managed by the i8742 mcu. */
/* Here we simulate it. */
@@ -189,7 +189,7 @@ static void mcu_handle_coins( running_machine *machine, int coin )
static READ8_HANDLER( mcu_arknoid2_r )
{
static const char mcu_startup[] = "\x55\xaa\x5a";
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
// logerror("PC %04x: read mcu %04x\n", cpu_get_pc(space->cpu), 0xc000 + offset);
@@ -219,7 +219,7 @@ static READ8_HANDLER( mcu_arknoid2_r )
}
else return state->mcu_credits;
}
- else return input_port_read(space->machine, "IN0"); /* buttons */
+ else return input_port_read(space->machine(), "IN0"); /* buttons */
default:
logerror("error, unknown mcu command\n");
@@ -250,7 +250,7 @@ static READ8_HANDLER( mcu_arknoid2_r )
static WRITE8_HANDLER( mcu_arknoid2_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
if (offset == 0)
{
// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(space->cpu), data, 0xc000 + offset);
@@ -296,7 +296,7 @@ static WRITE8_HANDLER( mcu_arknoid2_w )
static READ8_HANDLER( mcu_extrmatn_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
static const char mcu_startup[] = "\x5a\xa5\x55";
// logerror("PC %04x: read mcu %04x\n", cpu_get_pc(space->cpu), 0xc000 + offset);
@@ -313,16 +313,16 @@ static READ8_HANDLER( mcu_extrmatn_r )
switch (state->mcu_command)
{
case 0x01:
- return input_port_read(space->machine, "IN0") ^ 0xff; /* player 1 joystick + buttons */
+ return input_port_read(space->machine(), "IN0") ^ 0xff; /* player 1 joystick + buttons */
case 0x02:
- return input_port_read(space->machine, "IN1") ^ 0xff; /* player 2 joystick + buttons */
+ return input_port_read(space->machine(), "IN1") ^ 0xff; /* player 2 joystick + buttons */
case 0x1a:
- return (input_port_read(space->machine, "COIN1") | (input_port_read(space->machine, "COIN2") << 1));
+ return (input_port_read(space->machine(), "COIN1") | (input_port_read(space->machine(), "COIN2") << 1));
case 0x21:
- return input_port_read(space->machine, "IN2") & 0x0f;
+ return input_port_read(space->machine(), "IN2") & 0x0f;
case 0x41:
return state->mcu_credits;
@@ -350,7 +350,7 @@ static READ8_HANDLER( mcu_extrmatn_r )
else return state->mcu_credits;
}
/* buttons */
- else return ((input_port_read(space->machine, "IN0") & 0xf0) | (input_port_read(space->machine, "IN1") >> 4)) ^ 0xff;
+ else return ((input_port_read(space->machine(), "IN0") & 0xf0) | (input_port_read(space->machine(), "IN1") >> 4)) ^ 0xff;
default:
logerror("error, unknown mcu command\n");
@@ -381,7 +381,7 @@ static READ8_HANDLER( mcu_extrmatn_r )
static WRITE8_HANDLER( mcu_extrmatn_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
if (offset == 0)
{
// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(space->cpu), data, 0xc000 + offset);
@@ -484,7 +484,7 @@ static TIMER_CALLBACK( kludge_callback )
static WRITE8_HANDLER( tnzs_sync_kludge_w )
{
- space->machine->scheduler().synchronize(FUNC(kludge_callback), data);
+ space->machine().scheduler().synchronize(FUNC(kludge_callback), data);
}
*/
@@ -492,58 +492,58 @@ static WRITE8_HANDLER( tnzs_sync_kludge_w )
DRIVER_INIT( plumpop )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_PLUMPOP;
}
DRIVER_INIT( extrmatn )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_EXTRMATN;
}
DRIVER_INIT( arknoid2 )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_ARKANOID;
}
DRIVER_INIT( drtoppel )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_DRTOPPEL;
/* drtoppel writes to the palette RAM area even if it has PROMs! We have to patch it out. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xf800, 0xfbff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xf800, 0xfbff);
}
DRIVER_INIT( chukatai )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_CHUKATAI;
}
DRIVER_INIT( tnzs )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_TNZS;
/* we need to install a kludge to avoid problems with a bug in the original code */
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w));
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w));
}
DRIVER_INIT( tnzsb )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_NONE_TNZSB;
/* we need to install a kludge to avoid problems with a bug in the original code */
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w));
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xef10, 0xef10, FUNC(tnzs_sync_kludge_w));
}
DRIVER_INIT( kabukiz )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
- UINT8 *SOUND = machine->region("audiocpu")->base();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
+ UINT8 *SOUND = machine.region("audiocpu")->base();
state->mcu_type = MCU_NONE_KABUKIZ;
memory_configure_bank(machine, "bank3", 0, 8, &SOUND[0x10000], 0x4000);
@@ -551,25 +551,25 @@ DRIVER_INIT( kabukiz )
DRIVER_INIT( insectx )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_NONE_INSECTX;
/* this game has no mcu, replace the handler with plain input port handlers */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc000, 0xc000, "IN0" );
- machine->device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc001, 0xc001, "IN1" );
- machine->device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc002, 0xc002, "IN2" );
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc000, 0xc000, "IN0" );
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc001, 0xc001, "IN1" );
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_read_port(0xc002, 0xc002, "IN2" );
}
DRIVER_INIT( kageki )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->mcu_type = MCU_NONE_KAGEKI;
}
READ8_HANDLER( tnzs_mcu_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
switch (state->mcu_type)
{
case MCU_TNZS:
@@ -588,7 +588,7 @@ READ8_HANDLER( tnzs_mcu_r )
WRITE8_HANDLER( tnzs_mcu_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
switch (state->mcu_type)
{
case MCU_TNZS:
@@ -610,7 +610,7 @@ WRITE8_HANDLER( tnzs_mcu_w )
INTERRUPT_GEN( arknoid2_interrupt )
{
- tnzs_state *state = device->machine->driver_data<tnzs_state>();
+ tnzs_state *state = device->machine().driver_data<tnzs_state>();
int coin;
switch (state->mcu_type)
@@ -620,11 +620,11 @@ INTERRUPT_GEN( arknoid2_interrupt )
case MCU_DRTOPPEL:
case MCU_PLUMPOP:
coin = 0;
- coin |= ((input_port_read(device->machine, "COIN1") & 1) << 0);
- coin |= ((input_port_read(device->machine, "COIN2") & 1) << 1);
- coin |= ((input_port_read(device->machine, "IN2") & 3) << 2);
+ coin |= ((input_port_read(device->machine(), "COIN1") & 1) << 0);
+ coin |= ((input_port_read(device->machine(), "COIN2") & 1) << 1);
+ coin |= ((input_port_read(device->machine(), "IN2") & 3) << 2);
coin ^= 0x0c;
- mcu_handle_coins(device->machine, coin);
+ mcu_handle_coins(device->machine(), coin);
break;
default:
break;
@@ -635,7 +635,7 @@ INTERRUPT_GEN( arknoid2_interrupt )
MACHINE_RESET( tnzs )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
/* initialize the mcu simulation */
switch (state->mcu_type)
{
@@ -658,7 +658,7 @@ MACHINE_RESET( tnzs )
MACHINE_RESET( jpopnics )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
state->screenflip = 0;
state->mcu_type = -1;
@@ -666,8 +666,8 @@ MACHINE_RESET( jpopnics )
static STATE_POSTLOAD( tnzs_postload )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ tnzs_state *state = machine.driver_data<tnzs_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
memory_set_bank(machine, "bank1", state->bank1);
memory_set_bank(machine, "bank2", state->bank2);
@@ -680,9 +680,9 @@ static STATE_POSTLOAD( tnzs_postload )
MACHINE_START( tnzs )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *SUB = machine->region("sub")->base();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *SUB = machine.region("sub")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank2", 0, 4, &SUB[0x10000], 0x2000);
@@ -693,9 +693,9 @@ MACHINE_START( tnzs )
state->bank1 = 2;
state->bank2 = 0;
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->mcu = machine->device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->screenflip));
state->save_item(NAME(state->kageki_csport_sel));
@@ -713,19 +713,19 @@ MACHINE_START( tnzs )
state->save_item(NAME(state->bank1));
state->save_item(NAME(state->bank2));
- machine->state().register_postload(tnzs_postload, NULL);
+ machine.state().register_postload(tnzs_postload, NULL);
}
MACHINE_START( jpopnics )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *SUB = machine->region("sub")->base();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *SUB = machine.region("sub")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank2", 0, 4, &SUB[0x10000], 0x2000);
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->mcu = NULL;
state->bank1 = 2;
@@ -735,13 +735,13 @@ MACHINE_START( jpopnics )
state->save_item(NAME(state->bank1));
state->save_item(NAME(state->bank2));
- machine->state().register_postload(tnzs_postload, NULL);
+ machine.state().register_postload(tnzs_postload, NULL);
}
WRITE8_HANDLER( tnzs_bankswitch_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
// logerror("PC %04x: writing %02x to bankswitch\n", cpu_get_pc(space->cpu),data);
@@ -753,7 +753,7 @@ WRITE8_HANDLER( tnzs_bankswitch_w )
/* bits 0-2 select RAM/ROM bank */
state->bank1 = data & 0x07;
- memory_set_bank(space->machine, "bank1", state->bank1);
+ memory_set_bank(space->machine(), "bank1", state->bank1);
if (state->bank1 <= 1)
space->install_write_bank(0x8000, 0xbfff, "bank1");
@@ -763,7 +763,7 @@ WRITE8_HANDLER( tnzs_bankswitch_w )
WRITE8_HANDLER( tnzs_bankswitch1_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ tnzs_state *state = space->machine().driver_data<tnzs_state>();
// logerror("PC %04x: writing %02x to bankswitch 1\n", cpu_get_pc(space->cpu),data);
switch (state->mcu_type)
@@ -779,22 +779,22 @@ WRITE8_HANDLER( tnzs_bankswitch1_w )
/* Coin count and lockout is handled by the i8742 */
break;
case MCU_NONE_INSECTX:
- coin_lockout_w(space->machine, 0, (~data & 0x04));
- coin_lockout_w(space->machine, 1, (~data & 0x08));
- coin_counter_w(space->machine, 0, (data & 0x10));
- coin_counter_w(space->machine, 1, (data & 0x20));
+ coin_lockout_w(space->machine(), 0, (~data & 0x04));
+ coin_lockout_w(space->machine(), 1, (~data & 0x08));
+ coin_counter_w(space->machine(), 0, (data & 0x10));
+ coin_counter_w(space->machine(), 1, (data & 0x20));
break;
case MCU_NONE_TNZSB:
case MCU_NONE_KABUKIZ:
- coin_lockout_w(space->machine, 0, (~data & 0x10));
- coin_lockout_w(space->machine, 1, (~data & 0x20));
- coin_counter_w(space->machine, 0, (data & 0x04));
- coin_counter_w(space->machine, 1, (data & 0x08));
+ coin_lockout_w(space->machine(), 0, (~data & 0x10));
+ coin_lockout_w(space->machine(), 1, (~data & 0x20));
+ coin_counter_w(space->machine(), 0, (data & 0x04));
+ coin_counter_w(space->machine(), 1, (data & 0x08));
break;
case MCU_NONE_KAGEKI:
- coin_lockout_global_w(space->machine, (~data & 0x20));
- coin_counter_w(space->machine, 0, (data & 0x04));
- coin_counter_w(space->machine, 1, (data & 0x08));
+ coin_lockout_global_w(space->machine(), (~data & 0x20));
+ coin_counter_w(space->machine(), 0, (data & 0x04));
+ coin_counter_w(space->machine(), 1, (data & 0x08));
break;
case MCU_ARKANOID:
case MCU_EXTRMATN:
@@ -802,7 +802,7 @@ WRITE8_HANDLER( tnzs_bankswitch1_w )
case MCU_PLUMPOP:
/* bit 2 resets the mcu */
if (data & 0x04)
- mcu_reset(space->machine);
+ mcu_reset(space->machine());
break;
default:
break;
@@ -810,5 +810,5 @@ WRITE8_HANDLER( tnzs_bankswitch1_w )
/* bits 0-1 select ROM bank */
state->bank2 = data & 0x03;
- memory_set_bank(space->machine, "bank2", state->bank2);
+ memory_set_bank(space->machine(), "bank2", state->bank2);
}
diff --git a/src/mame/machine/toaplan1.c b/src/mame/machine/toaplan1.c
index 92d55817fd2..5fb0ecf9820 100644
--- a/src/mame/machine/toaplan1.c
+++ b/src/mame/machine/toaplan1.c
@@ -41,7 +41,7 @@ static const UINT8 toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER+1][2][4] =
INTERRUPT_GEN( toaplan1_interrupt )
{
- toaplan1_state *state = device->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = device->machine().driver_data<toaplan1_state>();
if (state->intenable)
device_set_input_line(device, 4, HOLD_LINE);
@@ -51,7 +51,7 @@ WRITE16_HANDLER( toaplan1_intenable_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
state->intenable = data & 0xff;
}
}
@@ -59,7 +59,7 @@ WRITE16_HANDLER( toaplan1_intenable_w )
WRITE16_HANDLER( demonwld_dsp_addrsel_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
/* This sets the main CPU RAM address the DSP should */
/* read/write, via the DSP IO port 0 */
@@ -78,12 +78,12 @@ READ16_HANDLER( demonwld_dsp_r )
{
/* DSP can read data from main CPU RAM via DSP IO port 1 */
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
address_space *mainspace;
UINT16 input_data = 0;
switch (state->main_ram_seg) {
- case 0xc00000: mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ case 0xc00000: mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
input_data = mainspace->read_word(state->main_ram_seg + state->dsp_addr_w);
break;
default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n", cpu_get_previouspc(space->cpu), state->main_ram_seg + state->dsp_addr_w);
@@ -94,14 +94,14 @@ READ16_HANDLER( demonwld_dsp_r )
WRITE16_HANDLER( demonwld_dsp_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
address_space *mainspace;
/* Data written to main CPU RAM via DSP IO port 1 */
state->dsp_execute = 0;
switch (state->main_ram_seg) {
case 0xc00000: if ((state->dsp_addr_w < 3) && (data == 0)) state->dsp_execute = 1;
- mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
mainspace->write_word(state->main_ram_seg + state->dsp_addr_w, data);
break;
default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n", cpu_get_previouspc(space->cpu), state->main_ram_seg + state->dsp_addr_w);
@@ -117,7 +117,7 @@ WRITE16_HANDLER( demonwld_dsp_bio_w )
/* data 0x0000 means set DSP BIO line active and disable */
/* communication to main processor*/
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
logerror("DSP PC:%04x IO write %04x at port 3\n", cpu_get_previouspc(space->cpu), data);
if (data & 0x8000) {
@@ -126,7 +126,7 @@ WRITE16_HANDLER( demonwld_dsp_bio_w )
if (data == 0) {
if (state->dsp_execute) {
logerror("Turning 68000 on\n");
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
state->dsp_execute = 0;
}
state->dsp_BIO = ASSERT_LINE;
@@ -135,15 +135,15 @@ WRITE16_HANDLER( demonwld_dsp_bio_w )
READ16_HANDLER ( demonwld_BIO_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->dsp_BIO;
}
-static void demonwld_dsp(running_machine *machine, int enable)
+static void demonwld_dsp(running_machine &machine, int enable)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->dsp_on = enable;
if (enable)
@@ -163,7 +163,7 @@ static void demonwld_dsp(running_machine *machine, int enable)
static STATE_POSTLOAD( demonwld_restore_dsp )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
demonwld_dsp(machine, state->dsp_on);
}
@@ -177,8 +177,8 @@ WRITE16_HANDLER( demonwld_dsp_ctrl_w )
{
switch (data)
{
- case 0x00: demonwld_dsp(space->machine, 1); break; /* Enable the INT line to the DSP */
- case 0x01: demonwld_dsp(space->machine, 0); break; /* Inhibit the INT line to the DSP */
+ case 0x00: demonwld_dsp(space->machine(), 1); break; /* Enable the INT line to the DSP */
+ case 0x01: demonwld_dsp(space->machine(), 0); break; /* Inhibit the INT line to the DSP */
default: logerror("68000:%04x Writing unknown command %08x to %08x\n",cpu_get_previouspc(space->cpu) ,data ,0xe0000a + offset); break;
}
}
@@ -193,7 +193,7 @@ READ16_HANDLER( samesame_port_6_word_r )
{
/* Bit 0x80 is secondary CPU (HD647180) ready signal */
logerror("PC:%04x Warning !!! IO reading from $14000a\n",cpu_get_previouspc(space->cpu));
- return (0x80 | input_port_read(space->machine, "TJUMP")) & 0xff;
+ return (0x80 | input_port_read(space->machine(), "TJUMP")) & 0xff;
}
READ16_HANDLER ( vimana_system_port_r )
@@ -206,13 +206,13 @@ READ16_HANDLER ( vimana_system_port_r )
TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_JAPAN
};
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
int data, p, r, d, slot, reg, dsw;
slot = -1;
- d = input_port_read(space->machine, "DSWA");
- r = input_port_read(space->machine, "TJUMP");
- p = input_port_read(space->machine, "SYSTEM");
+ d = input_port_read(space->machine(), "DSWA");
+ r = input_port_read(space->machine(), "TJUMP");
+ p = input_port_read(space->machine(), "SYSTEM");
state->vimana_latch ^= p;
data = (state->vimana_latch & p);
@@ -253,15 +253,15 @@ READ16_HANDLER ( vimana_system_port_r )
state->vimana_credits += toaplan1_credits_for_coin[reg][slot][dsw];
state->vimana_coins[slot] -= toaplan1_coins_for_credit[reg][slot][dsw];
}
- coin_counter_w(space->machine, slot, 1);
- coin_counter_w(space->machine, slot, 0);
+ coin_counter_w(space->machine(), slot, 1);
+ coin_counter_w(space->machine(), slot, 0);
}
if (state->vimana_credits >= 9)
state->vimana_credits = 9;
}
- coin_lockout_global_w(space->machine, (state->vimana_credits >= 9));
+ coin_lockout_global_w(space->machine(), (state->vimana_credits >= 9));
state->vimana_latch = p;
@@ -277,7 +277,7 @@ READ16_HANDLER( vimana_mcu_r )
case 1: data = 0x00; break;
case 2:
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
data = state->vimana_credits;
break;
}
@@ -294,9 +294,9 @@ WRITE16_HANDLER( vimana_mcu_w )
case 2:
if (ACCESSING_BITS_0_7)
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
state->vimana_credits = data & 0xff;
- coin_lockout_global_w(space->machine, (state->vimana_credits >= 9));
+ coin_lockout_global_w(space->machine(), (state->vimana_credits >= 9));
}
break;
}
@@ -304,7 +304,7 @@ WRITE16_HANDLER( vimana_mcu_w )
READ16_HANDLER( toaplan1_shared_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->sharedram[offset] & 0xff;
}
@@ -312,7 +312,7 @@ WRITE16_HANDLER( toaplan1_shared_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
state->sharedram[offset] = data & 0xff;
}
}
@@ -325,8 +325,8 @@ WRITE16_HANDLER( toaplan1_reset_sound )
if (ACCESSING_BITS_0_7 && (data == 0))
{
logerror("PC:%04x Resetting Sound CPU and Sound chip (%08x)\n", cpu_get_previouspc(space->cpu), data);
- devtag_reset(space->machine, "ymsnd");
- device_t *audiocpu = space->machine->device("audiocpu");
+ devtag_reset(space->machine(), "ymsnd");
+ device_t *audiocpu = space->machine().device("audiocpu");
if (audiocpu != NULL && audiocpu->type() == Z80)
device_set_input_line(audiocpu, INPUT_LINE_RESET, PULSE_LINE);
}
@@ -335,17 +335,17 @@ WRITE16_HANDLER( toaplan1_reset_sound )
WRITE8_HANDLER( rallybik_coin_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
switch (data) {
- case 0x08: if (state->coin_count) { coin_counter_w(space->machine, 0, 1); coin_counter_w(space->machine, 0, 0); } break;
- case 0x09: if (state->coin_count) { coin_counter_w(space->machine, 2, 1); coin_counter_w(space->machine, 2, 0); } break;
- case 0x0a: if (state->coin_count) { coin_counter_w(space->machine, 1, 1); coin_counter_w(space->machine, 1, 0); } break;
- case 0x0b: if (state->coin_count) { coin_counter_w(space->machine, 3, 1); coin_counter_w(space->machine, 3, 0); } break;
- case 0x0c: coin_lockout_w(space->machine, 0, 1); coin_lockout_w(space->machine, 2, 1); break;
- case 0x0d: coin_lockout_w(space->machine, 0, 0); coin_lockout_w(space->machine, 2, 0); break;
- case 0x0e: coin_lockout_w(space->machine, 1, 1); coin_lockout_w(space->machine, 3, 1); break;
- case 0x0f: coin_lockout_w(space->machine, 1, 0); coin_lockout_w(space->machine, 3, 0); state->coin_count=1; break;
+ case 0x08: if (state->coin_count) { coin_counter_w(space->machine(), 0, 1); coin_counter_w(space->machine(), 0, 0); } break;
+ case 0x09: if (state->coin_count) { coin_counter_w(space->machine(), 2, 1); coin_counter_w(space->machine(), 2, 0); } break;
+ case 0x0a: if (state->coin_count) { coin_counter_w(space->machine(), 1, 1); coin_counter_w(space->machine(), 1, 0); } break;
+ case 0x0b: if (state->coin_count) { coin_counter_w(space->machine(), 3, 1); coin_counter_w(space->machine(), 3, 0); } break;
+ case 0x0c: coin_lockout_w(space->machine(), 0, 1); coin_lockout_w(space->machine(), 2, 1); break;
+ case 0x0d: coin_lockout_w(space->machine(), 0, 0); coin_lockout_w(space->machine(), 2, 0); break;
+ case 0x0e: coin_lockout_w(space->machine(), 1, 1); coin_lockout_w(space->machine(), 3, 1); break;
+ case 0x0f: coin_lockout_w(space->machine(), 1, 0); coin_lockout_w(space->machine(), 3, 0); state->coin_count=1; break;
default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",cpu_get_previouspc(space->cpu),data); break;
}
}
@@ -358,24 +358,24 @@ WRITE8_HANDLER( toaplan1_coin_w )
/* Are some outputs for lights ? (no space on JAMMA for it though) */
switch (data) {
- case 0xee: coin_counter_w(space->machine, 1,1); coin_counter_w(space->machine, 1,0); break; /* Count slot B */
- case 0xed: coin_counter_w(space->machine, 0,1); coin_counter_w(space->machine, 0,0); break; /* Count slot A */
+ case 0xee: coin_counter_w(space->machine(), 1,1); coin_counter_w(space->machine(), 1,0); break; /* Count slot B */
+ case 0xed: coin_counter_w(space->machine(), 0,1); coin_counter_w(space->machine(), 0,0); break; /* Count slot A */
/* The following are coin counts after coin-lock active (faulty coin-lock ?) */
- case 0xe2: coin_counter_w(space->machine, 1,1); coin_counter_w(space->machine, 1,0); coin_lockout_w(space->machine, 1,1); break;
- case 0xe1: coin_counter_w(space->machine, 0,1); coin_counter_w(space->machine, 0,0); coin_lockout_w(space->machine, 0,1); break;
+ case 0xe2: coin_counter_w(space->machine(), 1,1); coin_counter_w(space->machine(), 1,0); coin_lockout_w(space->machine(), 1,1); break;
+ case 0xe1: coin_counter_w(space->machine(), 0,1); coin_counter_w(space->machine(), 0,0); coin_lockout_w(space->machine(), 0,1); break;
- case 0xec: coin_lockout_global_w(space->machine, 0); break; /* ??? count games played */
+ case 0xec: coin_lockout_global_w(space->machine(), 0); break; /* ??? count games played */
case 0xe8: break; /* ??? Maximum credits reached with coin/credit ratio */
case 0xe4: break; /* ??? Reset coin system */
- case 0x0c: coin_lockout_global_w(space->machine, 0); break; /* Unlock all coin slots */
- case 0x08: coin_lockout_w(space->machine, 2,0); break; /* Unlock coin slot C */
- case 0x09: coin_lockout_w(space->machine, 0,0); break; /* Unlock coin slot A */
- case 0x0a: coin_lockout_w(space->machine, 1,0); break; /* Unlock coin slot B */
+ case 0x0c: coin_lockout_global_w(space->machine(), 0); break; /* Unlock all coin slots */
+ case 0x08: coin_lockout_w(space->machine(), 2,0); break; /* Unlock coin slot C */
+ case 0x09: coin_lockout_w(space->machine(), 0,0); break; /* Unlock coin slot A */
+ case 0x0a: coin_lockout_w(space->machine(), 1,0); break; /* Unlock coin slot B */
- case 0x02: coin_lockout_w(space->machine, 1,1); break; /* Lock coin slot B */
- case 0x01: coin_lockout_w(space->machine, 0,1); break; /* Lock coin slot A */
- case 0x00: coin_lockout_global_w(space->machine, 1); break; /* Lock all coin slots */
+ case 0x02: coin_lockout_w(space->machine(), 1,1); break; /* Lock coin slot B */
+ case 0x01: coin_lockout_w(space->machine(), 0,1); break; /* Lock coin slot A */
+ case 0x00: coin_lockout_global_w(space->machine(), 1); break; /* Lock all coin slots */
default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",cpu_get_previouspc(space->cpu),data); break;
}
}
@@ -395,7 +395,7 @@ WRITE16_HANDLER( samesame_coin_w )
MACHINE_RESET( toaplan1 )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->intenable = 0;
state->coin_count = 0;
@@ -403,9 +403,9 @@ MACHINE_RESET( toaplan1 )
coin_lockout_global_w(machine, 0);
}
-void toaplan1_driver_savestate(running_machine *machine)
+void toaplan1_driver_savestate(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->save_item(NAME(state->intenable));
state->save_item(NAME(state->coin_count));
@@ -414,7 +414,7 @@ void toaplan1_driver_savestate(running_machine *machine)
MACHINE_RESET( zerowing ) /* Hack for ZeroWing and OutZone. See the video driver */
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
MACHINE_RESET_CALL(toaplan1);
state->unk_reset_port = 1;
@@ -422,7 +422,7 @@ MACHINE_RESET( zerowing ) /* Hack for ZeroWing and OutZone. See the video driver
MACHINE_RESET( demonwld )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
MACHINE_RESET_CALL(toaplan1);
state->dsp_addr_w = 0;
@@ -430,21 +430,21 @@ MACHINE_RESET( demonwld )
state->dsp_execute = 0;
}
-void demonwld_driver_savestate(running_machine *machine)
+void demonwld_driver_savestate(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->save_item(NAME(state->dsp_on));
state->save_item(NAME(state->dsp_addr_w));
state->save_item(NAME(state->main_ram_seg));
state->save_item(NAME(state->dsp_BIO));
state->save_item(NAME(state->dsp_execute));
- machine->state().register_postload(demonwld_restore_dsp, NULL);
+ machine.state().register_postload(demonwld_restore_dsp, NULL);
}
MACHINE_RESET( vimana )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
MACHINE_RESET_CALL(toaplan1);
state->vimana_coins[0] = state->vimana_coins[1] = 0;
@@ -452,9 +452,9 @@ MACHINE_RESET( vimana )
state->vimana_latch = 0;
}
-void vimana_driver_savestate(running_machine *machine)
+void vimana_driver_savestate(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->save_item(NAME(state->vimana_coins[0]));
state->save_item(NAME(state->vimana_coins[1]));
diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c
index 3809864cc8b..6f1bfe9bba0 100644
--- a/src/mame/machine/twincobr.c
+++ b/src/mame/machine/twincobr.c
@@ -20,7 +20,7 @@ static const int toaplan_port_type[2] = { 0x7800c, 0x5c };
INTERRUPT_GEN( twincobr_interrupt )
{
- twincobr_state *state = device->machine->driver_data<twincobr_state>();
+ twincobr_state *state = device->machine().driver_data<twincobr_state>();
if (state->intenable) {
state->intenable = 0;
device_set_input_line(device, M68K_IRQ_4, HOLD_LINE);
@@ -29,7 +29,7 @@ INTERRUPT_GEN( twincobr_interrupt )
INTERRUPT_GEN( wardner_interrupt )
{
- twincobr_state *state = device->machine->driver_data<twincobr_state>();
+ twincobr_state *state = device->machine().driver_data<twincobr_state>();
if (state->intenable) {
state->intenable = 0;
device_set_input_line(device, 0, HOLD_LINE);
@@ -39,7 +39,7 @@ INTERRUPT_GEN( wardner_interrupt )
WRITE16_HANDLER( twincobr_dsp_addrsel_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* This sets the main CPU RAM address the DSP should */
/* read/write, via the DSP IO port 0 */
/* Top three bits of data need to be shifted left 3 places */
@@ -56,7 +56,7 @@ WRITE16_HANDLER( twincobr_dsp_addrsel_w )
READ16_HANDLER( twincobr_dsp_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* DSP can read data from main CPU RAM via DSP IO port 1 */
address_space *mainspace;
@@ -64,7 +64,7 @@ READ16_HANDLER( twincobr_dsp_r )
switch (state->main_ram_seg) {
case 0x30000:
case 0x40000:
- case 0x50000: mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ case 0x50000: mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
input_data = mainspace->read_word(state->main_ram_seg + state->dsp_addr_w);
break;
default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",cpu_get_previouspc(space->cpu),state->main_ram_seg + state->dsp_addr_w); break;
@@ -75,7 +75,7 @@ READ16_HANDLER( twincobr_dsp_r )
WRITE16_HANDLER( twincobr_dsp_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
address_space *mainspace;
/* Data written to main CPU RAM via DSP IO port 1 */
@@ -83,7 +83,7 @@ WRITE16_HANDLER( twincobr_dsp_w )
switch (state->main_ram_seg) {
case 0x30000: if ((state->dsp_addr_w < 3) && (data == 0)) state->dsp_execute = 1;
case 0x40000:
- case 0x50000: mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ case 0x50000: mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
mainspace->write_word(state->main_ram_seg + state->dsp_addr_w, data);
break;
default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",cpu_get_previouspc(space->cpu),state->main_ram_seg + state->dsp_addr_w); break;
@@ -93,7 +93,7 @@ WRITE16_HANDLER( twincobr_dsp_w )
WRITE16_HANDLER( wardner_dsp_addrsel_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* This sets the main CPU RAM address the DSP should */
/* read/write, via the DSP IO port 0 */
/* Lower twelve bits of this data is shifted left one position */
@@ -109,7 +109,7 @@ WRITE16_HANDLER( wardner_dsp_addrsel_w )
READ16_HANDLER( wardner_dsp_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* DSP can read data from main CPU RAM via DSP IO port 1 */
address_space *mainspace;
@@ -117,7 +117,7 @@ READ16_HANDLER( wardner_dsp_r )
switch (state->main_ram_seg) {
case 0x7000:
case 0x8000:
- case 0xa000: mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ case 0xa000: mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
input_data = mainspace->read_byte(state->main_ram_seg + (state->dsp_addr_w + 0))
| (mainspace->read_byte(state->main_ram_seg + (state->dsp_addr_w + 1)) << 8);
break;
@@ -129,7 +129,7 @@ READ16_HANDLER( wardner_dsp_r )
WRITE16_HANDLER( wardner_dsp_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
address_space *mainspace;
/* Data written to main CPU RAM via DSP IO port 1 */
@@ -137,7 +137,7 @@ WRITE16_HANDLER( wardner_dsp_w )
switch (state->main_ram_seg) {
case 0x7000: if ((state->dsp_addr_w < 3) && (data == 0)) state->dsp_execute = 1;
case 0x8000:
- case 0xa000: mainspace = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ case 0xa000: mainspace = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
mainspace->write_byte(state->main_ram_seg + (state->dsp_addr_w + 0), (data & 0xff));
mainspace->write_byte(state->main_ram_seg + (state->dsp_addr_w + 1), ((data >> 8) & 0xff));
break;
@@ -148,7 +148,7 @@ WRITE16_HANDLER( wardner_dsp_w )
WRITE16_HANDLER( twincobr_dsp_bio_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* data 0xffff means inhibit BIO line to DSP and enable */
/* communication to main processor */
/* Actually only DSP data bit 15 controls this */
@@ -161,7 +161,7 @@ WRITE16_HANDLER( twincobr_dsp_bio_w )
if (data == 0) {
if (state->dsp_execute) {
LOG(("Turning the main CPU on\n"));
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
state->dsp_execute = 0;
}
state->dsp_BIO = ASSERT_LINE;
@@ -170,7 +170,7 @@ WRITE16_HANDLER( twincobr_dsp_bio_w )
READ16_HANDLER( fsharkbt_dsp_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
/* IO Port 2 used by Flying Shark bootleg */
/* DSP reads data from an extra MCU (8741) at IO port 2 */
/* Port is read three times during startup. First and last data */
@@ -184,21 +184,21 @@ WRITE16_HANDLER( fsharkbt_dsp_w )
{
/* Flying Shark bootleg DSP writes data to an extra MCU (8741) at IO port 2 */
#if 0
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
logerror("DSP PC:%04x IO write from DSP RAM:%04x to 8741 MCU (port 2)\n",cpu_get_previouspc(space->cpu),state->fsharkbt_8741);
#endif
}
READ16_HANDLER ( twincobr_BIO_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
return state->dsp_BIO;
}
-static void twincobr_dsp(running_machine *machine, int enable)
+static void twincobr_dsp(running_machine &machine, int enable)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state->dsp_on = enable;
if (enable) {
LOG(("Turning DSP on and main CPU off\n"));
@@ -215,15 +215,15 @@ static void twincobr_dsp(running_machine *machine, int enable)
static STATE_POSTLOAD( twincobr_restore_dsp )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
twincobr_dsp(machine, state->dsp_on);
}
-static void toaplan0_control_w(running_machine *machine, int offset, int data)
+static void toaplan0_control_w(running_machine &machine, int offset, int data)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
- LOG(("%s:Writing %08x to %08x.\n",machine->describe_context(),data,toaplan_port_type[state->toaplan_main_cpu] - offset));
+ twincobr_state *state = machine.driver_data<twincobr_state>();
+ LOG(("%s:Writing %08x to %08x.\n",machine.describe_context(),data,toaplan_port_type[state->toaplan_main_cpu] - offset));
if (state->toaplan_main_cpu == 1) {
if (data == 0x0c) { data = 0x1c; state->wardner_sprite_hack=0; } /* Z80 ? */
@@ -250,25 +250,25 @@ WRITE16_HANDLER( twincobr_control_w )
{
if (ACCESSING_BITS_0_7)
{
- toaplan0_control_w(space->machine, offset, data & 0xff);
+ toaplan0_control_w(space->machine(), offset, data & 0xff);
}
}
WRITE8_HANDLER( wardner_control_w )
{
- toaplan0_control_w(space->machine, offset, data);
+ toaplan0_control_w(space->machine(), offset, data);
}
READ16_HANDLER( twincobr_sharedram_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
return state->sharedram[offset];
}
WRITE16_HANDLER( twincobr_sharedram_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
if (ACCESSING_BITS_0_7)
{
state->sharedram[offset] = data & 0xff;
@@ -278,29 +278,29 @@ WRITE16_HANDLER( twincobr_sharedram_w )
static void toaplan0_coin_dsp_w(address_space *space, int offset, int data)
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
if (data > 1)
- LOG(("%s:Writing %08x to %08x.\n",space->machine->describe_context(),data,toaplan_port_type[state->toaplan_main_cpu] - offset));
+ LOG(("%s:Writing %08x to %08x.\n",space->machine().describe_context(),data,toaplan_port_type[state->toaplan_main_cpu] - offset));
switch (data) {
- case 0x08: coin_counter_w(space->machine, 0,0); break;
- case 0x09: coin_counter_w(space->machine, 0,1); break;
- case 0x0a: coin_counter_w(space->machine, 1,0); break;
- case 0x0b: coin_counter_w(space->machine, 1,1); break;
- case 0x0c: coin_lockout_w(space->machine, 0,1); break;
- case 0x0d: coin_lockout_w(space->machine, 0,0); break;
- case 0x0e: coin_lockout_w(space->machine, 1,1); break;
- case 0x0f: coin_lockout_w(space->machine, 1,0); break;
+ case 0x08: coin_counter_w(space->machine(), 0,0); break;
+ case 0x09: coin_counter_w(space->machine(), 0,1); break;
+ case 0x0a: coin_counter_w(space->machine(), 1,0); break;
+ case 0x0b: coin_counter_w(space->machine(), 1,1); break;
+ case 0x0c: coin_lockout_w(space->machine(), 0,1); break;
+ case 0x0d: coin_lockout_w(space->machine(), 0,0); break;
+ case 0x0e: coin_lockout_w(space->machine(), 1,1); break;
+ case 0x0f: coin_lockout_w(space->machine(), 1,0); break;
/****** The following apply to Flying Shark/Wardner only ******/
case 0x00: /* This means assert the INT line to the DSP */
LOG(("Turning DSP on and main CPU off\n"));
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_HALT, CLEAR_LINE);
- cputag_set_input_line(space->machine, "dsp", 0, ASSERT_LINE); /* TMS32010 INT */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", 0, ASSERT_LINE); /* TMS32010 INT */
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_HALT, ASSERT_LINE);
break;
case 0x01: /* This means inhibit the INT line to the DSP */
LOG(("Turning DSP off\n"));
- cputag_set_input_line(space->machine, "dsp", 0, CLEAR_LINE); /* TMS32010 INT */
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp", 0, CLEAR_LINE); /* TMS32010 INT */
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_HALT, ASSERT_LINE);
break;
}
}
@@ -327,7 +327,7 @@ WRITE8_HANDLER( wardner_coin_dsp_w )
MACHINE_RESET( twincobr )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state->toaplan_main_cpu = 0; /* 68000 */
twincobr_display(machine, 0);
state->intenable = 0;
@@ -338,14 +338,14 @@ MACHINE_RESET( twincobr )
}
MACHINE_RESET( fsharkbt )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
MACHINE_RESET_CALL(twincobr);
state->fsharkbt_8741 = -1; /* Reset the Flying Shark Bootleg MCU */
}
-void twincobr_driver_savestate(running_machine *machine)
+void twincobr_driver_savestate(running_machine &machine)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state_save_register_global(machine, state->toaplan_main_cpu);
state_save_register_global(machine, state->intenable);
state_save_register_global(machine, state->dsp_on);
@@ -354,12 +354,12 @@ void twincobr_driver_savestate(running_machine *machine)
state_save_register_global(machine, state->dsp_BIO);
state_save_register_global(machine, state->dsp_execute);
state_save_register_global(machine, state->fsharkbt_8741);
- machine->state().register_postload(twincobr_restore_dsp, NULL);
+ machine.state().register_postload(twincobr_restore_dsp, NULL);
}
MACHINE_RESET( wardner )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state->toaplan_main_cpu = 1; /* Z80 */
twincobr_display(machine, 1);
state->intenable = 0;
@@ -369,9 +369,9 @@ MACHINE_RESET( wardner )
state->dsp_BIO = CLEAR_LINE;
state->wardner_membank = 0;
}
-void wardner_driver_savestate(running_machine *machine)
+void wardner_driver_savestate(running_machine &machine)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state_save_register_global(machine, state->toaplan_main_cpu);
state_save_register_global(machine, state->intenable);
state_save_register_global(machine, state->dsp_on);
@@ -380,6 +380,6 @@ void wardner_driver_savestate(running_machine *machine)
state_save_register_global(machine, state->dsp_BIO);
state_save_register_global(machine, state->dsp_execute);
state_save_register_global(machine, state->wardner_membank);
- machine->state().register_postload(wardner_restore_bank, NULL); /* Restore the Main CPU bank */
- machine->state().register_postload(twincobr_restore_dsp, NULL);
+ machine.state().register_postload(wardner_restore_bank, NULL); /* Restore the Main CPU bank */
+ machine.state().register_postload(twincobr_restore_dsp, NULL);
}
diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c
index ea733dc0dc5..805659f5076 100644
--- a/src/mame/machine/tx1.c
+++ b/src/mame/machine/tx1.c
@@ -53,9 +53,9 @@ static const UINT8 state_table[16][8] =
{ -1, -1, -1, -1, -1, -1, -1, -1 },
};
-static void sn_multiply(running_machine *machine)
+static void sn_multiply(running_machine &machine)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
sn74s516_t &SN74S516 = state->sn74s516;
switch (SN74S516.code)
@@ -125,16 +125,16 @@ static void sn_multiply(running_machine *machine)
SN74S516.ZWfl = 0;
}
-static void sn_divide(running_machine *machine)
+static void sn_divide(running_machine &machine)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
sn74s516_t &SN74S516 = state->sn74s516;
INT32 Z = 0;
INT32 W = 0;
if (SN74S516.X == 0)
{
- mame_printf_debug("%s:SN74S516 tried to divide by zero\n", machine->describe_context());
+ mame_printf_debug("%s:SN74S516 tried to divide by zero\n", machine.describe_context());
SN74S516.ZW.Z = (INT16)0xffff;
SN74S516.ZW.W = 0xffff;
SN74S516.ZWfl = 0;
@@ -176,9 +176,9 @@ static void sn_divide(running_machine *machine)
SN74S516.ZWfl = 0;
}
-static void sn74s516_update(running_machine *machine, int ins)
+static void sn74s516_update(running_machine &machine, int ins)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
sn74s516_t &SN74S516 = state->sn74s516;
SN74S516.state = state_table[SN74S516.state][ins];
@@ -194,9 +194,9 @@ static void sn74s516_update(running_machine *machine, int ins)
}
}
-static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins)
+static void kick_sn74s516(running_machine &machine, UINT16 *data, const int ins)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
sn74s516_t &SN74S516 = state->sn74s516;
math_t &math = state->math;
@@ -281,7 +281,7 @@ static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins)
if (SN74S516.code == 0x6666)
{
CLEAR_SEQUENCE;
- mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", machine->describe_context(), math.promaddr);
+ mame_printf_debug("%s:Code 6666: PROMADDR:%x\n", machine.describe_context(), math.promaddr);
}
UPDATE_SEQUENCE;
@@ -368,7 +368,7 @@ static void kick_sn74s516(running_machine *machine, UINT16 *data, const int ins)
}
math.dbgaddr = math.promaddr;
- math.dbgpc = cpu_get_previouspc(machine->device("math_cpu"));
+ math.dbgpc = cpu_get_previouspc(machine.device("math_cpu"));
}
@@ -413,15 +413,15 @@ INLINE UINT16 get_tx1_datarom_addr(math_t &math)
return addr & 0x3fff;
}
-static void tx1_update_state(running_machine *machine)
+static void tx1_update_state(running_machine &machine)
{
#define LHIEN(a) !(a & 0x80)
#define LLOEN(a) !(a & 0x40)
#define GO_EN(a) !(a & 0x4000)
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
math_t &math = state->math;
- const UINT16 *prom = (UINT16*)machine->region("au_data")->base() + (0x8000 >> 1);
+ const UINT16 *prom = (UINT16*)machine.region("au_data")->base() + (0x8000 >> 1);
for (;;)
{
@@ -479,7 +479,7 @@ static void tx1_update_state(running_machine *machine)
data = math.muxlatch;
else if (dsel == 1)
{
- UINT16 *romdata = (UINT16*)machine->region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine.region("au_data")->base();
UINT16 addr = get_tx1_datarom_addr(math);
data = romdata[addr];
}
@@ -599,7 +599,7 @@ static void tx1_update_state(running_machine *machine)
READ16_HANDLER( tx1_math_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
offset = offset << 1;
@@ -619,7 +619,7 @@ READ16_HANDLER( tx1_math_r )
}
/* TODO What do we return? */
- kick_sn74s516(space->machine, &math.retval, ins);
+ kick_sn74s516(space->machine(), &math.retval, ins);
}
/* /PPSEN */
else if (offset < 0x800)
@@ -657,7 +657,7 @@ READ16_HANDLER( tx1_math_r )
TODO make this constant somewhere
e.g. math.retval = math.romptr[ get_tx1_datarom_addr() ];
*/
- UINT16 *romdata = (UINT16*)space->machine->region("au_data")->base();
+ UINT16 *romdata = (UINT16*)space->machine().region("au_data")->base();
UINT16 addr = get_tx1_datarom_addr(math);
math.retval = romdata[addr];
}
@@ -684,7 +684,7 @@ READ16_HANDLER( tx1_math_r )
if (math.mux != TX1_SEL_ILDEN)
{
INC_PROM_ADDR;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
// MUST RETURN HERE?
return math.retval;
@@ -703,12 +703,12 @@ READ16_HANDLER( tx1_math_r )
if (offset & TX1_INSLD)
{
math.promaddr = (offset << 2) & 0x1ff;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
else if (offset & TX1_CNTST)
{
INC_PROM_ADDR;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
return math.retval;
@@ -716,7 +716,7 @@ READ16_HANDLER( tx1_math_r )
WRITE16_HANDLER( tx1_math_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
math.cpulatch = data;
offset <<= 1;
@@ -738,7 +738,7 @@ WRITE16_HANDLER( tx1_math_w )
ins = (offset >> 1) & 7;
}
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
/* /PPSEN */
else if ((offset & 0xc00) == 0x400)
@@ -794,20 +794,20 @@ WRITE16_HANDLER( tx1_math_w )
if (offset & TX1_INSLD)
{
math.promaddr = (offset << 2) & 0x1ff;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
else if (offset & TX1_CNTST)
{
INC_PROM_ADDR;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
}
READ16_HANDLER( tx1_spcs_rom_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
- math.cpulatch = *(UINT16*)((UINT8*)space->machine->region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
+ math.cpulatch = *(UINT16*)((UINT8*)space->machine().region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
if (math.mux == TX1_SEL_ILDEN)
{
@@ -818,7 +818,7 @@ READ16_HANDLER( tx1_spcs_rom_r )
int ins = math.inslatch & 7;
TX1_SET_INS0_BIT;
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
else if (math.mux == TX1_SEL_PPSEN)
{
@@ -860,7 +860,7 @@ READ16_HANDLER( tx1_spcs_rom_r )
if (math.mux != TX1_SEL_ILDEN)
{
INC_PROM_ADDR;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
return math.cpulatch;
@@ -869,7 +869,7 @@ READ16_HANDLER( tx1_spcs_rom_r )
READ16_HANDLER( tx1_spcs_ram_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
math.cpulatch = state->math_ram[offset];
@@ -884,7 +884,7 @@ READ16_HANDLER( tx1_spcs_ram_r )
int ins = math.inslatch & 7;
TX1_SET_INS0_BIT;
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
else if (math.mux == TX1_SEL_PPSEN)
{
@@ -924,7 +924,7 @@ READ16_HANDLER( tx1_spcs_ram_r )
if (math.mux != TX1_SEL_ILDEN)
{
INC_PROM_ADDR;
- tx1_update_state(space->machine);
+ tx1_update_state(space->machine());
}
return math.cpulatch;
@@ -933,7 +933,7 @@ READ16_HANDLER( tx1_spcs_ram_r )
/* Should never occur */
WRITE16_HANDLER( tx1_spcs_ram_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
mame_printf_debug("Write to /SPCS RAM?");
COMBINE_DATA(&state->math_ram[offset]);
}
@@ -981,15 +981,15 @@ INLINE UINT16 get_bb_datarom_addr(math_t &math)
return addr & 0x3fff;
}
-static void buggyboy_update_state(running_machine *machine)
+static void buggyboy_update_state(running_machine &machine)
{
#define LHIEN(a) !(a & 0x80)
#define LLOEN(a) !(a & 0x40)
#define GO_EN(a) !(a & 0x4000)
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
math_t &math = state->math;
- const UINT16 *prom = (UINT16*)machine->region("au_data")->base() + (0x8000 >> 1);
+ const UINT16 *prom = (UINT16*)machine.region("au_data")->base() + (0x8000 >> 1);
for (;;)
{
@@ -1022,7 +1022,7 @@ static void buggyboy_update_state(running_machine *machine)
if (math.mux == BB_MUX_DPROE)
{
- UINT16 *romdata = (UINT16*)machine->region("au_data")->base();
+ UINT16 *romdata = (UINT16*)machine.region("au_data")->base();
UINT16 addr = get_bb_datarom_addr(math);
kick_sn74s516(machine, &romdata[addr], ins);
}
@@ -1105,7 +1105,7 @@ static void buggyboy_update_state(running_machine *machine)
READ16_HANDLER( buggyboy_math_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
offset = offset << 1;
@@ -1125,7 +1125,7 @@ READ16_HANDLER( buggyboy_math_r )
}
/* TODO What do we return? */
- kick_sn74s516(space->machine, &math.retval, ins);
+ kick_sn74s516(space->machine(), &math.retval, ins);
/* TODO */
//if (math.mux == BB_MUX_PPSEN)
@@ -1139,7 +1139,7 @@ READ16_HANDLER( buggyboy_math_r )
/* /DPROE */
else if ((offset & 0xc00) == 0xc00)
{
- UINT16 *romdata = (UINT16*)space->machine->region("au_data")->base();
+ UINT16 *romdata = (UINT16*)space->machine().region("au_data")->base();
UINT16 addr = get_bb_datarom_addr(math);
math.retval = romdata[addr];
@@ -1154,7 +1154,7 @@ READ16_HANDLER( buggyboy_math_r )
if (math.mux != BB_MUX_ILDEN)
{
INC_PROM_ADDR;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
}
}
@@ -1170,12 +1170,12 @@ READ16_HANDLER( buggyboy_math_r )
if (offset & BB_INSLD)
{
math.promaddr = (offset << 2) & 0x1ff;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
else if (offset & BB_CNTST)
{
INC_PROM_ADDR;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
return math.retval;
@@ -1183,7 +1183,7 @@ READ16_HANDLER( buggyboy_math_r )
WRITE16_HANDLER( buggyboy_math_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
math.cpulatch = data;
@@ -1204,7 +1204,7 @@ WRITE16_HANDLER( buggyboy_math_w )
ins = (offset >> 1) & 7;
}
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
/* /PPSEN */
else if ((offset & 0xc00) == 0x400)
@@ -1246,24 +1246,24 @@ WRITE16_HANDLER( buggyboy_math_w )
else
{
mame_printf_debug("BB_DSEL was not 3 for P->S load!\n");
- debugger_break(space->machine);
+ debugger_break(space->machine());
}
}
else
{
mame_printf_debug("Buggy Boy unknown math state!\n");
- debugger_break(space->machine);
+ debugger_break(space->machine());
}
if (offset & BB_INSLD)
{
math.promaddr = (offset << 2) & 0x1ff;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
else if (offset & BB_CNTST)
{
INC_PROM_ADDR;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
}
@@ -1272,9 +1272,9 @@ WRITE16_HANDLER( buggyboy_math_w )
*/
READ16_HANDLER( buggyboy_spcs_rom_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
- math.cpulatch = *(UINT16*)((UINT8*)space->machine->region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
+ math.cpulatch = *(UINT16*)((UINT8*)space->machine().region("math_cpu")->base() + 0xfc000 + 0x1000 + offset*2);
if (math.mux == BB_MUX_ILDEN)
{
@@ -1285,7 +1285,7 @@ READ16_HANDLER( buggyboy_spcs_rom_r )
int ins = math.inslatch & 7;
BB_SET_INS0_BIT;
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
else if (math.mux == BB_MUX_PPSEN)
{
@@ -1327,7 +1327,7 @@ READ16_HANDLER( buggyboy_spcs_rom_r )
if (math.mux != BB_MUX_ILDEN)
{
INC_PROM_ADDR;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
return math.cpulatch;
@@ -1335,13 +1335,13 @@ READ16_HANDLER( buggyboy_spcs_rom_r )
WRITE16_HANDLER( buggyboy_spcs_ram_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
COMBINE_DATA(&state->math_ram[offset]);
}
READ16_HANDLER( buggyboy_spcs_ram_r )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
math_t &math = state->math;
math.cpulatch = state->math_ram[offset];
@@ -1356,7 +1356,7 @@ READ16_HANDLER( buggyboy_spcs_ram_r )
int ins = math.inslatch & 7;
BB_SET_INS0_BIT;
- kick_sn74s516(space->machine, &math.cpulatch, ins);
+ kick_sn74s516(space->machine(), &math.cpulatch, ins);
}
else if (math.mux == BB_MUX_PPSEN)
{
@@ -1398,7 +1398,7 @@ READ16_HANDLER( buggyboy_spcs_ram_r )
if (math.mux != BB_MUX_ILDEN)
{
INC_PROM_ADDR;
- buggyboy_update_state(space->machine);
+ buggyboy_update_state(space->machine());
}
return math.cpulatch;
@@ -1414,12 +1414,12 @@ READ16_HANDLER( buggyboy_spcs_ram_r )
MACHINE_RESET( buggyboy )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
memset(&state->math, 0, sizeof(state->math));
}
MACHINE_RESET( tx1 )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
memset(&state->math, 0, sizeof(state->math));
}
diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c
index 3796de3d3b2..da088bcb066 100644
--- a/src/mame/machine/vertigo.c
+++ b/src/mame/machine/vertigo.c
@@ -68,20 +68,20 @@ const struct pit8253_config vertigo_pit8254_config =
void vertigo_update_irq(device_t *device)
{
- vertigo_state *state = device->machine->driver_data<vertigo_state>();
+ vertigo_state *state = device->machine().driver_data<vertigo_state>();
if (state->irq_state < 7)
- cputag_set_input_line(device->machine, "maincpu", state->irq_state ^ 7, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", state->irq_state ^ 7, CLEAR_LINE);
state->irq_state = ttl74148_output_r(device);
if (state->irq_state < 7)
- cputag_set_input_line(device->machine, "maincpu", state->irq_state ^ 7, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", state->irq_state ^ 7, ASSERT_LINE);
}
-static void update_irq_encoder(running_machine *machine, int line, int state)
+static void update_irq_encoder(running_machine &machine, int line, int state)
{
- vertigo_state *drvstate = machine->driver_data<vertigo_state>();
+ vertigo_state *drvstate = machine.driver_data<vertigo_state>();
ttl74148_input_line_w(drvstate->ttl74148, line, !state);
ttl74148_update(drvstate->ttl74148);
}
@@ -89,19 +89,19 @@ static void update_irq_encoder(running_machine *machine, int line, int state)
static WRITE_LINE_DEVICE_HANDLER( v_irq4_w )
{
- vertigo_state *drvstate = device->machine->driver_data<vertigo_state>();
- update_irq_encoder(device->machine, INPUT_LINE_IRQ4, state);
- vertigo_vproc(device->machine, device->machine->device<cpu_device>("maincpu")->attotime_to_cycles(device->machine->time() - drvstate->irq4_time), state);
- drvstate->irq4_time = device->machine->time();
+ vertigo_state *drvstate = device->machine().driver_data<vertigo_state>();
+ update_irq_encoder(device->machine(), INPUT_LINE_IRQ4, state);
+ vertigo_vproc(device->machine(), device->machine().device<cpu_device>("maincpu")->attotime_to_cycles(device->machine().time() - drvstate->irq4_time), state);
+ drvstate->irq4_time = device->machine().time();
}
static WRITE_LINE_DEVICE_HANDLER( v_irq3_w )
{
if (state)
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_IRQ0, ASSERT_LINE);
- update_irq_encoder(device->machine, INPUT_LINE_IRQ3, state);
+ update_irq_encoder(device->machine(), INPUT_LINE_IRQ3, state);
}
@@ -114,39 +114,39 @@ static WRITE_LINE_DEVICE_HANDLER( v_irq3_w )
READ16_HANDLER( vertigo_io_convert )
{
- vertigo_state *state = space->machine->driver_data<vertigo_state>();
+ vertigo_state *state = space->machine().driver_data<vertigo_state>();
static const char *const adcnames[] = { "P1X", "P1Y", "PADDLE" };
if (offset > 2)
state->adc_result = 0;
else
- state->adc_result = input_port_read(space->machine, adcnames[offset]);
+ state->adc_result = input_port_read(space->machine(), adcnames[offset]);
- update_irq_encoder(space->machine, INPUT_LINE_IRQ2, ASSERT_LINE);
+ update_irq_encoder(space->machine(), INPUT_LINE_IRQ2, ASSERT_LINE);
return 0;
}
READ16_HANDLER( vertigo_io_adc )
{
- vertigo_state *state = space->machine->driver_data<vertigo_state>();
- update_irq_encoder(space->machine, INPUT_LINE_IRQ2, CLEAR_LINE);
+ vertigo_state *state = space->machine().driver_data<vertigo_state>();
+ update_irq_encoder(space->machine(), INPUT_LINE_IRQ2, CLEAR_LINE);
return state->adc_result;
}
READ16_HANDLER( vertigo_coin_r )
{
- update_irq_encoder(space->machine, INPUT_LINE_IRQ6, CLEAR_LINE);
- return (input_port_read(space->machine, "COIN"));
+ update_irq_encoder(space->machine(), INPUT_LINE_IRQ6, CLEAR_LINE);
+ return (input_port_read(space->machine(), "COIN"));
}
INTERRUPT_GEN( vertigo_interrupt )
{
/* Coin inputs cause IRQ6 */
- if ((input_port_read(device->machine, "COIN") & 0x7) < 0x7)
- update_irq_encoder(device->machine, INPUT_LINE_IRQ6, ASSERT_LINE);
+ if ((input_port_read(device->machine(), "COIN") & 0x7) < 0x7)
+ update_irq_encoder(device->machine(), INPUT_LINE_IRQ6, ASSERT_LINE);
}
@@ -161,9 +161,9 @@ WRITE16_HANDLER( vertigo_wsot_w )
{
/* Reset sound cpu */
if ((data & 2) == 0)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
}
@@ -175,14 +175,14 @@ static TIMER_CALLBACK( sound_command_w )
quickly. Otherwise the main CPU gives up with sound. Boosting
the interleave for a while helps. */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
WRITE16_HANDLER( vertigo_audio_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(sound_command_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(sound_command_w), data & 0xff);
}
@@ -201,7 +201,7 @@ READ16_HANDLER( vertigo_sio_r )
MACHINE_START( vertigo )
{
- vertigo_state *state = machine->driver_data<vertigo_state>();
+ vertigo_state *state = machine.driver_data<vertigo_state>();
state_save_register_global(machine, state->irq_state);
state_save_register_global(machine, state->adc_result);
state_save_register_global(machine, state->irq4_time);
@@ -211,10 +211,10 @@ MACHINE_START( vertigo )
MACHINE_RESET( vertigo )
{
- vertigo_state *state = machine->driver_data<vertigo_state>();
+ vertigo_state *state = machine.driver_data<vertigo_state>();
int i;
- state->ttl74148 = machine->device("74148");
+ state->ttl74148 = machine.device("74148");
ttl74148_enable_input_w(state->ttl74148, 0);
for (i = 0; i < 8; i++)
@@ -223,7 +223,7 @@ MACHINE_RESET( vertigo )
ttl74148_update(state->ttl74148);
vertigo_vproc_reset(machine);
- state->irq4_time = machine->time();
+ state->irq4_time = machine.time();
state->irq_state = 7;
}
diff --git a/src/mame/machine/volfied.c b/src/mame/machine/volfied.c
index 750107936d5..52dea0dbe2a 100644
--- a/src/mame/machine/volfied.c
+++ b/src/mame/machine/volfied.c
@@ -280,7 +280,7 @@ static const UINT16 *const palette_data_lookup[] =
static TIMER_CALLBACK( volfied_timer_callback )
{
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
// Palette commands - palette data written to bank 0: $10 - $af
if (state->current_cmd >= 0x1 && state->current_cmd < 0x12)
@@ -335,13 +335,13 @@ WRITE16_HANDLER( volfied_cchip_ctrl_w )
WRITE16_HANDLER( volfied_cchip_bank_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
state->current_bank = data & 7;
}
WRITE16_HANDLER( volfied_cchip_ram_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
state->cchip_ram[(state->current_bank * 0x400) + offset] = data;
@@ -354,10 +354,10 @@ WRITE16_HANDLER( volfied_cchip_ram_w )
{
state->cc_port = data;
- coin_lockout_w(space->machine, 1, data & 0x80);
- coin_lockout_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x20);
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_lockout_w(space->machine(), 1, data & 0x80);
+ coin_lockout_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
}
if (offset == 0x3fe)
@@ -392,12 +392,12 @@ WRITE16_HANDLER( volfied_cchip_ram_w )
// Palette request cmd - verified to take around 122242 68000 cycles to complete
if (state->current_cmd >= 0x1 && state->current_cmd < 0x12)
{
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(122242), FUNC(volfied_timer_callback));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(122242), FUNC(volfied_timer_callback));
}
// Unknown cmd - verified to take around 105500 68000 cycles to complete
else if (state->current_cmd >= 0x81 && state->current_cmd < 0x92)
{
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(105500), FUNC(volfied_timer_callback));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(105500), FUNC(volfied_timer_callback));
}
else
{
@@ -432,17 +432,17 @@ READ16_HANDLER( volfied_cchip_ctrl_r )
READ16_HANDLER( volfied_cchip_ram_r )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
/* Check for input ports */
if (state->current_bank == 0)
{
switch (offset)
{
- case 0x03: return input_port_read(space->machine, "F00007"); /* STARTn + SERVICE1 */
- case 0x04: return input_port_read(space->machine, "F00009"); /* COINn */
- case 0x05: return input_port_read(space->machine, "F0000B"); /* Player controls + TILT */
- case 0x06: return input_port_read(space->machine, "F0000D"); /* Player controls (cocktail) */
+ case 0x03: return input_port_read(space->machine(), "F00007"); /* STARTn + SERVICE1 */
+ case 0x04: return input_port_read(space->machine(), "F00009"); /* COINn */
+ case 0x05: return input_port_read(space->machine(), "F0000B"); /* Player controls + TILT */
+ case 0x06: return input_port_read(space->machine(), "F0000D"); /* Player controls (cocktail) */
case 0x08: return state->cc_port;
}
}
@@ -485,9 +485,9 @@ READ16_HANDLER( volfied_cchip_ram_r )
*
*************************************/
-void volfied_cchip_init( running_machine *machine )
+void volfied_cchip_init( running_machine &machine )
{
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
state->cchip_ram = auto_alloc_array_clear(machine, UINT8, 0x400 * 8);
@@ -498,9 +498,9 @@ void volfied_cchip_init( running_machine *machine )
state->save_pointer(NAME(state->cchip_ram), 0x400 * 8);
}
-void volfied_cchip_reset( running_machine *machine )
+void volfied_cchip_reset( running_machine &machine )
{
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
state->current_bank = 0;
state->current_flag = 0;
diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c
index ffed506cf50..4f4c1733814 100644
--- a/src/mame/machine/vsnes.c
+++ b/src/mame/machine/vsnes.c
@@ -34,26 +34,26 @@ static const char * const chr_banknames[] = { "bank2", "bank3", "bank4", "bank5"
WRITE8_HANDLER( vsnes_in0_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
/* Toggling bit 0 high then low resets both controllers */
if (data & 1)
{
/* load up the latches */
- state->input_latch[0] = input_port_read(space->machine, "IN0");
- state->input_latch[1] = input_port_read(space->machine, "IN1");
+ state->input_latch[0] = input_port_read(space->machine(), "IN0");
+ state->input_latch[1] = input_port_read(space->machine(), "IN1");
}
}
static READ8_HANDLER( gun_in0_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int ret = (state->input_latch[0]) & 1;
/* shift */
state->input_latch[0] >>= 1;
- ret |= input_port_read(space->machine, "COINS"); /* merge coins, etc */
- ret |= (input_port_read(space->machine, "DSW0") & 3) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read(space->machine(), "COINS"); /* merge coins, etc */
+ ret |= (input_port_read(space->machine(), "DSW0") & 3) << 3; /* merge 2 dipswitches */
/* The gun games expect a 1 returned on every 5th read after sound_fix is reset*/
/* Info Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */
@@ -71,15 +71,15 @@ static READ8_HANDLER( gun_in0_r )
READ8_HANDLER( vsnes_in0_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int ret = (state->input_latch[0]) & 1;
/* shift */
state->input_latch[0] >>= 1;
- ret |= input_port_read(space->machine, "COINS"); /* merge coins, etc */
- ret |= (input_port_read(space->machine, "DSW0") & 3) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read(space->machine(), "COINS"); /* merge coins, etc */
+ ret |= (input_port_read(space->machine(), "DSW0") & 3) << 3; /* merge 2 dipswitches */
return ret;
@@ -87,10 +87,10 @@ READ8_HANDLER( vsnes_in0_r )
READ8_HANDLER( vsnes_in1_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int ret = (state->input_latch[1]) & 1;
- ret |= input_port_read(space->machine, "DSW0") & ~3; /* merge the rest of the dipswitches */
+ ret |= input_port_read(space->machine(), "DSW0") & ~3; /* merge the rest of the dipswitches */
/* shift */
state->input_latch[1] >>= 1;
@@ -100,35 +100,35 @@ READ8_HANDLER( vsnes_in1_r )
WRITE8_HANDLER( vsnes_in0_1_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
/* Toggling bit 0 high then low resets both controllers */
if (data & 1)
{
/* load up the latches */
- state->input_latch[2] = input_port_read(space->machine, "IN2");
- state->input_latch[3] = input_port_read(space->machine, "IN3");
+ state->input_latch[2] = input_port_read(space->machine(), "IN2");
+ state->input_latch[3] = input_port_read(space->machine(), "IN3");
}
}
READ8_HANDLER( vsnes_in0_1_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int ret = (state->input_latch[2]) & 1;
/* shift */
state->input_latch[2] >>= 1;
- ret |= input_port_read(space->machine, "COINS2"); /* merge coins, etc */
- ret |= (input_port_read(space->machine, "DSW1") & 3) << 3; /* merge 2 dipswitches */
+ ret |= input_port_read(space->machine(), "COINS2"); /* merge coins, etc */
+ ret |= (input_port_read(space->machine(), "DSW1") & 3) << 3; /* merge 2 dipswitches */
return ret;
}
READ8_HANDLER( vsnes_in1_1_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int ret = (state->input_latch[3]) & 1;
- ret |= input_port_read(space->machine, "DSW1") & ~3; /* merge the rest of the dipswitches */
+ ret |= input_port_read(space->machine(), "DSW1") & ~3; /* merge the rest of the dipswitches */
/* shift */
state->input_latch[3] >>= 1;
@@ -145,7 +145,7 @@ READ8_HANDLER( vsnes_in1_1_r )
MACHINE_RESET( vsnes )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
state->last_bank = 0xff;
state->sound_fix = 0;
@@ -162,7 +162,7 @@ MACHINE_RESET( vsnes )
MACHINE_RESET( vsdual )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
state->input_latch[0] = state->input_latch[1] = 0;
state->input_latch[2] = state->input_latch[3] = 0;
@@ -175,9 +175,9 @@ MACHINE_RESET( vsdual )
*
*************************************/
-static void v_set_videorom_bank( running_machine* machine, int start, int count, int vrom_start_bank )
+static void v_set_videorom_bank( running_machine& machine, int start, int count, int vrom_start_bank )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
int i;
assert(start + count <= 8);
@@ -195,8 +195,8 @@ static void v_set_videorom_bank( running_machine* machine, int start, int count,
MACHINE_START( vsnes )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
- address_space *ppu1_space = machine->device("ppu1")->memory().space(AS_PROGRAM);
+ vsnes_state *state = machine.driver_data<vsnes_state>();
+ address_space *ppu1_space = machine.device("ppu1")->memory().space(AS_PROGRAM);
int i;
/* establish nametable ram */
@@ -209,8 +209,8 @@ MACHINE_START( vsnes )
ppu1_space->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(vsnes_nt0_r), FUNC(vsnes_nt0_w));
- state->vrom[0] = machine->region("gfx1")->base();
- state->vrom_size[0] = machine->region("gfx1")->bytes();
+ state->vrom[0] = machine.region("gfx1")->base();
+ state->vrom_size[0] = machine.region("gfx1")->bytes();
state->vrom_banks = state->vrom_size[0] / 0x400;
/* establish chr banks */
@@ -233,11 +233,11 @@ MACHINE_START( vsnes )
MACHINE_START( vsdual )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
- state->vrom[0] = machine->region("gfx1")->base();
- state->vrom[1] = machine->region("gfx2")->base();
- state->vrom_size[0] = machine->region("gfx1")->bytes();
- state->vrom_size[1] = machine->region("gfx2")->bytes();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
+ state->vrom[0] = machine.region("gfx1")->base();
+ state->vrom[1] = machine.region("gfx2")->base();
+ state->vrom_size[0] = machine.region("gfx1")->bytes();
+ state->vrom_size[1] = machine.region("gfx2")->bytes();
/* establish nametable ram */
state->nt_ram[0] = auto_alloc_array(machine, UINT8, 0x1000);
@@ -252,12 +252,12 @@ MACHINE_START( vsdual )
state->nt_page[1][2] = state->nt_ram[1] + 0x800;
state->nt_page[1][3] = state->nt_ram[1] + 0xc00;
- machine->device("ppu1")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(vsnes_nt0_r), FUNC(vsnes_nt0_w));
- machine->device("ppu2")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(vsnes_nt1_r), FUNC(vsnes_nt1_w));
+ machine.device("ppu1")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(vsnes_nt0_r), FUNC(vsnes_nt0_w));
+ machine.device("ppu2")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(vsnes_nt1_r), FUNC(vsnes_nt1_w));
// read only!
- machine->device("ppu1")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank2");
+ machine.device("ppu1")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank2");
// read only!
- machine->device("ppu2")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank3");
+ machine.device("ppu2")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank3");
memory_configure_bank(machine, "bank2", 0, state->vrom_size[0] / 0x2000, state->vrom[0], 0x2000);
memory_configure_bank(machine, "bank3", 0, state->vrom_size[1] / 0x2000, state->vrom[1], 0x2000);
memory_set_bank(machine, "bank2", 0);
@@ -272,28 +272,28 @@ MACHINE_START( vsdual )
static WRITE8_HANDLER( vsnes_nt0_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int page = ((offset & 0xc00) >> 10);
state->nt_page[0][page][offset & 0x3ff] = data;
}
static WRITE8_HANDLER( vsnes_nt1_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int page = ((offset & 0xc00) >> 10);
state->nt_page[1][page][offset & 0x3ff] = data;
}
static READ8_HANDLER( vsnes_nt0_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int page = ((offset&0xc00) >> 10);
return state->nt_page[0][page][offset & 0x3ff];
}
static READ8_HANDLER( vsnes_nt1_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int page = ((offset & 0xc00) >> 10);
return state->nt_page[1][page][offset & 0x3ff];
}
@@ -343,7 +343,7 @@ static void v_set_mirroring( vsnes_state *state, int ppu, int mirroring )
static WRITE8_HANDLER( vsnormal_vrom_banking )
{
/* switch vrom */
- v_set_videorom_bank(space->machine, 0, 8, (data & 4) ? 8 : 0);
+ v_set_videorom_bank(space->machine(), 0, 8, (data & 4) ? 8 : 0);
/* bit 1 ( data & 2 ) enables writes to extra ram, we ignore it */
@@ -354,7 +354,7 @@ static WRITE8_HANDLER( vsnormal_vrom_banking )
DRIVER_INIT( vsnormal )
{
/* vrom switching is enabled with bit 2 of $4016 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsnormal_vrom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsnormal_vrom_banking));
}
/**********************************************************************************/
@@ -362,13 +362,13 @@ DRIVER_INIT( vsnormal )
static WRITE8_HANDLER( gun_in0_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
- device_t *ppu1 = space->machine->device("ppu1");
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
+ device_t *ppu1 = space->machine().device("ppu1");
if (state->do_vrom_bank)
{
/* switch vrom */
- v_set_videorom_bank(space->machine, 0, 8, (data & 4) ? 8 : 0);
+ v_set_videorom_bank(space->machine(), 0, 8, (data & 4) ? 8 : 0);
}
/* here we do things a little different */
@@ -376,11 +376,11 @@ static WRITE8_HANDLER( gun_in0_w )
{
/* load up the latches */
- state->input_latch[0] = input_port_read(space->machine, "IN0");
+ state->input_latch[0] = input_port_read(space->machine(), "IN0");
/* do the gun thing */
- int x = input_port_read(space->machine, "GUNX");
- int y = input_port_read(space->machine, "GUNY");
+ int x = input_port_read(space->machine(), "GUNX");
+ int y = input_port_read(space->machine(), "GUNY");
UINT32 pix, color_base;
/* get the pixel at the gun position */
@@ -396,7 +396,7 @@ static WRITE8_HANDLER( gun_in0_w )
state->input_latch[0] |= 0x40;
}
- state->input_latch[1] = input_port_read(space->machine, "IN1");
+ state->input_latch[1] = input_port_read(space->machine(), "IN1");
}
if ((state->zapstore & 1) && (!(data & 1)))
@@ -410,9 +410,9 @@ static WRITE8_HANDLER( gun_in0_w )
DRIVER_INIT( vsgun )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
/* VROM switching is enabled with bit 2 of $4016 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(gun_in0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(gun_in0_w));
state->do_vrom_bank = 1;
}
@@ -430,17 +430,17 @@ static WRITE8_HANDLER( vskonami_rom_banking )
case 2: /* code bank 1 */
case 4: /* code bank 2 */
{
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
memcpy(&prg[0x08000 + reg * 0x1000], &prg[bankoffset], 0x2000);
}
break;
case 6: /* vrom bank 0 */
- v_set_videorom_bank(space->machine, 0, 4, data * 4);
+ v_set_videorom_bank(space->machine(), 0, 4, data * 4);
break;
case 7: /* vrom bank 1 */
- v_set_videorom_bank(space->machine, 4, 4, data * 4);
+ v_set_videorom_bank(space->machine(), 4, 4, data * 4);
break;
}
}
@@ -449,11 +449,11 @@ DRIVER_INIT( vskonami )
{
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x18000], 0x8000);
/* banking is done with writes to the $8000-$ffff area */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(vskonami_rom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(vskonami_rom_banking));
}
/***********************************************************************/
@@ -461,11 +461,11 @@ DRIVER_INIT( vskonami )
static WRITE8_HANDLER( vsgshoe_gun_in0_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
int addr;
if((data & 0x04) != state->old_bank)
{
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
state->old_bank = data & 0x04;
addr = state->old_bank ? 0x12000: 0x10000;
memcpy(&prg[0x08000], &prg[addr], 0x2000);
@@ -476,13 +476,13 @@ static WRITE8_HANDLER( vsgshoe_gun_in0_w )
DRIVER_INIT( vsgshoe )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
/* set up the default bank */
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
memcpy (&prg[0x08000], &prg[0x12000], 0x2000);
/* vrom switching is enabled with bit 2 of $4016 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(vsgshoe_gun_in0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(vsgshoe_gun_in0_w));
state->do_vrom_bank = 1;
}
@@ -493,7 +493,7 @@ DRIVER_INIT( vsgshoe )
static WRITE8_HANDLER( drmario_rom_banking )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
/* basically, a MMC1 mapper from the nes */
int reg = (offset >> 13);
@@ -563,18 +563,18 @@ static WRITE8_HANDLER( drmario_rom_banking )
case 1: /* video rom banking - bank 0 - 4k or 8k */
if (!state->vram)
- v_set_videorom_bank(space->machine, 0, (state->vrom4k) ? 4 : 8, state->drmario_shiftreg * 4);
+ v_set_videorom_bank(space->machine(), 0, (state->vrom4k) ? 4 : 8, state->drmario_shiftreg * 4);
break;
case 2: /* video rom banking - bank 1 - 4k only */
if (state->vrom4k && !state->vram)
- v_set_videorom_bank(space->machine, 4, 4, state->drmario_shiftreg * 4);
+ v_set_videorom_bank(space->machine(), 4, 4, state->drmario_shiftreg * 4);
break;
case 3: /* program banking */
{
int bank = (state->drmario_shiftreg & 0x03) * 0x4000;
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
if (!state->size16k)
{
@@ -605,15 +605,15 @@ static WRITE8_HANDLER( drmario_rom_banking )
DRIVER_INIT( drmario )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
/* We do manual banking, in case the code falls through */
/* Copy the initial banks */
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x1c000], 0x4000);
/* MMC1 mapper at writes to $8000-$ffff */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(drmario_rom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(drmario_rom_banking));
state->drmario_shiftreg = 0;
state->drmario_shiftcount = 0;
@@ -625,20 +625,20 @@ DRIVER_INIT( drmario )
static WRITE8_HANDLER( vsvram_rom_banking )
{
int rombank = 0x10000 + (data & 7) * 0x4000;
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
memcpy(&prg[0x08000], &prg[rombank], 0x4000);
}
DRIVER_INIT( vsvram )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
/* when starting the game, the 1st 16k and the last 16k are loaded into the 2 banks */
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x28000], 0x8000);
/* banking is done with writes to the $8000-$ffff area */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(vsvram_rom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(vsvram_rom_banking));
/* allocate state->vram */
state->vram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -647,10 +647,10 @@ DRIVER_INIT( vsvram )
/**********************************************************************************/
-static void mapper4_set_prg( running_machine *machine )
+static void mapper4_set_prg( running_machine &machine )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
- UINT8 *prg = machine->region("maincpu")->base();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
+ UINT8 *prg = machine.region("maincpu")->base();
UINT8 prg_flip = (state->MMC3_cmd & 0x40) ? 2 : 0;
memcpy(&prg[0x8000], &prg[0x2000 * (state->MMC3_prg_bank[0 ^ prg_flip] & state->MMC3_prg_mask) + 0x10000], 0x2000);
@@ -659,9 +659,9 @@ static void mapper4_set_prg( running_machine *machine )
memcpy(&prg[0xe000], &prg[0x2000 * (state->MMC3_prg_bank[3] & state->MMC3_prg_mask) + 0x10000], 0x2000);
}
-static void mapper4_set_chr( running_machine *machine )
+static void mapper4_set_chr( running_machine &machine )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
UINT8 chr_page = (state->MMC3_cmd & 0x80) >> 5;
v_set_videorom_bank(machine, chr_page ^ 0, 1, state->MMC3_chr_bank[0] & ~0x01);
@@ -679,7 +679,7 @@ static void mapper4_set_chr( running_machine *machine )
static void mapper4_irq( device_t *device, int scanline, int vblank, int blanked )
{
- vsnes_state *state = device->machine->driver_data<vsnes_state>();
+ vsnes_state *state = device->machine().driver_data<vsnes_state>();
if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
{
int priorCount = state->IRQ_count;
@@ -692,15 +692,15 @@ static void mapper4_irq( device_t *device, int scanline, int vblank, int blanked
if (state->IRQ_enable && !blanked && (state->IRQ_count == 0) && priorCount)
{
- cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, HOLD_LINE);
}
}
}
static WRITE8_HANDLER( mapper4_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
- device_t *ppu1 = space->machine->device("ppu1");
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
+ device_t *ppu1 = space->machine().device("ppu1");
UINT8 MMC3_helper, cmd;
switch (offset & 0x6001)
@@ -711,11 +711,11 @@ static WRITE8_HANDLER( mapper4_w )
/* Has PRG Mode changed? */
if (MMC3_helper & 0x40)
- mapper4_set_prg(space->machine);
+ mapper4_set_prg(space->machine());
/* Has CHR Mode changed? */
if (MMC3_helper & 0x80)
- mapper4_set_chr(space->machine);
+ mapper4_set_chr(space->machine());
break;
case 0x0001: /* $8001 */
@@ -725,12 +725,12 @@ static WRITE8_HANDLER( mapper4_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->MMC3_chr_bank[cmd] = data;
- mapper4_set_chr(space->machine);
+ mapper4_set_chr(space->machine());
break;
case 6:
case 7:
state->MMC3_prg_bank[cmd - 6] = data;
- mapper4_set_prg(space->machine);
+ mapper4_set_prg(space->machine());
break;
}
break;
@@ -785,10 +785,10 @@ static WRITE8_HANDLER( mapper4_w )
DRIVER_INIT( MMC3 )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
- UINT8 *prg = machine->region("maincpu")->base();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
+ UINT8 *prg = machine.region("maincpu")->base();
state->IRQ_enable = state->IRQ_count = state->IRQ_count_latch = 0;
- int MMC3_prg_chunks = (machine->region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int MMC3_prg_chunks = (machine.region("maincpu")->bytes() - 0x10000) / 0x4000;
state->MMC3_prg_bank[0] = state->MMC3_prg_bank[2] = 0xfe;
state->MMC3_prg_bank[1] = state->MMC3_prg_bank[3] = 0xff;
@@ -802,17 +802,17 @@ DRIVER_INIT( MMC3 )
memcpy(&prg[0xe000], &prg[(MMC3_prg_chunks - 1) * 0x4000 + 0x12000], 0x2000);
/* MMC3 mapper at writes to $8000-$ffff */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mapper4_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mapper4_w));
/* extra ram at $6000-$7fff */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
}
/* Vs. RBI Baseball */
static READ8_HANDLER( rbi_hack_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
/* Supplied by Ben Parnell <xodnizel@home.com> of FCE Ultra fame */
@@ -843,7 +843,7 @@ DRIVER_INIT( rbibb )
DRIVER_INIT_CALL(MMC3);
/* RBI Base ball hack */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5e00, 0x5e01, FUNC(rbi_hack_r)) ;
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5e00, 0x5e01, FUNC(rbi_hack_r)) ;
}
/* Vs. Super Xevious */
@@ -856,7 +856,7 @@ static READ8_HANDLER( supxevs_read_prot_1_r )
static READ8_HANDLER( supxevs_read_prot_2_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
if (state->supxevs_prot_index)
return 0;
else
@@ -865,7 +865,7 @@ static READ8_HANDLER( supxevs_read_prot_2_r )
static READ8_HANDLER( supxevs_read_prot_3_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
if (state->supxevs_prot_index)
return 0xd1;
else
@@ -874,7 +874,7 @@ static READ8_HANDLER( supxevs_read_prot_3_r )
static READ8_HANDLER( supxevs_read_prot_4_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
if (state->supxevs_prot_index)
{
state->supxevs_prot_index = 0;
@@ -893,17 +893,17 @@ DRIVER_INIT( supxevs )
DRIVER_INIT_CALL(MMC3);
/* Vs. Super Xevious Protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x54ff, 0x54ff, FUNC(supxevs_read_prot_1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5678, 0x5678, FUNC(supxevs_read_prot_2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x578f, 0x578f, FUNC(supxevs_read_prot_3_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5567, 0x5567, FUNC(supxevs_read_prot_4_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x54ff, 0x54ff, FUNC(supxevs_read_prot_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5678, 0x5678, FUNC(supxevs_read_prot_2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x578f, 0x578f, FUNC(supxevs_read_prot_3_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5567, 0x5567, FUNC(supxevs_read_prot_4_r));
}
/* Vs. TKO Boxing */
static READ8_HANDLER( tko_security_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
static const UINT8 security_data[] = {
0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f,
0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14,
@@ -926,17 +926,17 @@ DRIVER_INIT( tkoboxng )
DRIVER_INIT_CALL(MMC3);
/* security device at $5e00-$5e01 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5e00, 0x5e01, FUNC(tko_security_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5e00, 0x5e01, FUNC(tko_security_r));
}
/* Vs. Freedom Force */
DRIVER_INIT( vsfdf )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
+ vsnes_state *state = machine.driver_data<vsnes_state>();
DRIVER_INIT_CALL(MMC3);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(gun_in0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x4016, 0x4016, FUNC(gun_in0_r), FUNC(gun_in0_w));
state->do_vrom_bank = 0;
}
@@ -949,25 +949,25 @@ static WRITE8_HANDLER( mapper68_rom_banking )
switch (offset & 0x7000)
{
case 0x0000:
- v_set_videorom_bank(space->machine, 0, 2, data * 2);
+ v_set_videorom_bank(space->machine(), 0, 2, data * 2);
break;
case 0x1000:
- v_set_videorom_bank(space->machine, 2, 2, data * 2);
+ v_set_videorom_bank(space->machine(), 2, 2, data * 2);
break;
case 0x2000:
- v_set_videorom_bank(space->machine, 4, 2, data * 2);
+ v_set_videorom_bank(space->machine(), 4, 2, data * 2);
break;
case 0x3000: /* ok? */
- v_set_videorom_bank(space->machine, 6, 2, data * 2);
+ v_set_videorom_bank(space->machine(), 6, 2, data * 2);
break;
case 0x7000:
{
- UINT8 *prg = space->machine->region("maincpu")->base();
+ UINT8 *prg = space->machine().region("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000 + data * 0x4000], 0x4000);
}
break;
@@ -982,11 +982,11 @@ DRIVER_INIT( platoon )
/* when starting a mapper 68 game the first 16K ROM bank in the cart is loaded into $8000
the LAST 16K ROM bank is loaded into $C000. The last 16K of ROM cannot be swapped. */
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
memcpy(&prg[0x08000], &prg[0x10000], 0x4000);
memcpy(&prg[0x0c000], &prg[0x2c000], 0x4000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mapper68_rom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8000, 0xffff, FUNC(mapper68_rom_banking));
}
/**********************************************************************************/
@@ -994,26 +994,26 @@ DRIVER_INIT( platoon )
static WRITE8_HANDLER( set_bnglngby_irq_w )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
state->ret = data;
- cputag_set_input_line(space->machine, "maincpu", 0, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
/* other values ??? */
/* 0, 4, 84 */
}
static READ8_HANDLER( set_bnglngby_irq_r )
{
- vsnes_state *state = space->machine->driver_data<vsnes_state>();
+ vsnes_state *state = space->machine().driver_data<vsnes_state>();
return state->ret;
}
DRIVER_INIT( bnglngby )
{
- vsnes_state *state = machine->driver_data<vsnes_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0231, 0x0231, FUNC(set_bnglngby_irq_r), FUNC(set_bnglngby_irq_w));
+ vsnes_state *state = machine.driver_data<vsnes_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x0231, 0x0231, FUNC(set_bnglngby_irq_r), FUNC(set_bnglngby_irq_w));
/* extra ram */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff);
state->ret = 0;
@@ -1026,16 +1026,16 @@ DRIVER_INIT( bnglngby )
static WRITE8_HANDLER( vsdual_vrom_banking )
{
- device_t *other_cpu = (space->cpu == space->machine->device("maincpu")) ? space->machine->device("sub") : space->machine->device("maincpu");
+ device_t *other_cpu = (space->cpu == space->machine().device("maincpu")) ? space->machine().device("sub") : space->machine().device("maincpu");
/* switch vrom */
- (space->cpu == space->machine->device("maincpu")) ? memory_set_bank(space->machine, "bank2", BIT(data, 2)) : memory_set_bank(space->machine, "bank3", BIT(data, 2));
+ (space->cpu == space->machine().device("maincpu")) ? memory_set_bank(space->machine(), "bank2", BIT(data, 2)) : memory_set_bank(space->machine(), "bank3", BIT(data, 2));
/* bit 1 ( data & 2 ) triggers irq on the other cpu */
device_set_input_line(other_cpu, 0, (data & 2) ? CLEAR_LINE : ASSERT_LINE);
/* move along */
- if (space->cpu == space->machine->device("maincpu"))
+ if (space->cpu == space->machine().device("maincpu"))
vsnes_in0_w(space, offset, data);
else
vsnes_in0_1_w(space, offset, data);
@@ -1043,14 +1043,14 @@ static WRITE8_HANDLER( vsdual_vrom_banking )
DRIVER_INIT( vsdual )
{
- UINT8 *prg = machine->region("maincpu")->base();
+ UINT8 *prg = machine.region("maincpu")->base();
/* vrom switching is enabled with bit 2 of $4016 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsdual_vrom_banking));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsdual_vrom_banking));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsdual_vrom_banking));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4016, 0x4016, FUNC(vsdual_vrom_banking));
/* shared ram at $6000 */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]);
- machine->device("sub")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]);
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_ram(0x6000, 0x7fff, &prg[0x6000]);
}
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 8c3a321bcec..92bd5e948f2 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -239,7 +239,7 @@ const pia6821_interface joust2_pia_1_intf =
TIMER_DEVICE_CALLBACK( williams_va11_callback )
{
- pia6821_device *pia_1 = timer.machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
int scanline = param;
/* the IRQ signal comes into CB1, and is set to VA11 */
@@ -248,13 +248,13 @@ TIMER_DEVICE_CALLBACK( williams_va11_callback )
/* set a timer for the next update */
scanline += 0x20;
if (scanline >= 256) scanline = 0;
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
}
static TIMER_CALLBACK( williams_count240_off_callback )
{
- pia6821_device *pia_1 = machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = machine.device<pia6821_device>("pia_1");
/* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
pia6821_ca1_w(pia_1, 0);
@@ -263,43 +263,43 @@ static TIMER_CALLBACK( williams_count240_off_callback )
TIMER_DEVICE_CALLBACK( williams_count240_callback )
{
- pia6821_device *pia_1 = timer.machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
/* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
pia6821_ca1_w(pia_1, 1);
/* set a timer to turn it off once the scanline counter resets */
- timer.machine->scheduler().timer_set(timer.machine->primary_screen->time_until_pos(0), FUNC(williams_count240_off_callback));
+ timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(0), FUNC(williams_count240_off_callback));
/* set a timer for next frame */
- timer.adjust(timer.machine->primary_screen->time_until_pos(240));
+ timer.adjust(timer.machine().primary_screen->time_until_pos(240));
}
static void williams_main_irq(device_t *device, int state)
{
- pia6821_device *pia_1 = device->machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_1 = device->machine().device<pia6821_device>("pia_1");
int combined_state = pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1);
/* IRQ to the main CPU */
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
static void williams_main_firq(device_t *device, int state)
{
/* FIRQ to the main CPU */
- cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static void williams_snd_irq(device_t *device, int state)
{
- pia6821_device *pia_2 = device->machine->device<pia6821_device>("pia_2");
+ pia6821_device *pia_2 = device->machine().device<pia6821_device>("pia_2");
int combined_state = pia6821_get_irq_a(pia_2) | pia6821_get_irq_b(pia_2);
/* IRQ to the sound CPU */
- cputag_set_input_line(device->machine, "soundcpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -312,23 +312,23 @@ static void williams_snd_irq(device_t *device, int state)
static void mysticm_main_irq(device_t *device, int state)
{
- pia6821_device *pia_0 = device->machine->device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = device->machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_0 = device->machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = device->machine().device<pia6821_device>("pia_1");
int combined_state = pia6821_get_irq_b(pia_0) | pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1);
/* IRQ to the main CPU */
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
static void tshoot_main_irq(device_t *device, int state)
{
- pia6821_device *pia_0 = device->machine->device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = device->machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_0 = device->machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = device->machine().device<pia6821_device>("pia_1");
int combined_state = pia6821_get_irq_a(pia_0) | pia6821_get_irq_b(pia_0) | pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1);
/* IRQ to the main CPU */
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -341,10 +341,10 @@ static void tshoot_main_irq(device_t *device, int state)
static MACHINE_START( williams_common )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
/* configure the memory bank */
memory_configure_bank(machine, "bank1", 0, 1, state->videoram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("maincpu")->base() + 0x10000, 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("maincpu")->base() + 0x10000, 0);
state_save_register_global(machine, state->vram_bank);
}
@@ -353,12 +353,12 @@ static MACHINE_START( williams_common )
static MACHINE_RESET( williams_common )
{
/* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
- timer_device *scan_timer = machine->device<timer_device>("scan_timer");
- scan_timer->adjust(machine->primary_screen->time_until_pos(0));
+ timer_device *scan_timer = machine.device<timer_device>("scan_timer");
+ scan_timer->adjust(machine.primary_screen->time_until_pos(0));
/* also set a timer to go off on scanline 240 */
- timer_device *l240_timer = machine->device<timer_device>("240_timer");
- l240_timer->adjust(machine->primary_screen->time_until_pos(240));
+ timer_device *l240_timer = machine.device<timer_device>("240_timer");
+ l240_timer->adjust(machine.primary_screen->time_until_pos(240));
}
@@ -383,8 +383,8 @@ MACHINE_RESET( williams )
TIMER_DEVICE_CALLBACK( williams2_va11_callback )
{
- pia6821_device *pia_0 = timer.machine->device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = timer.machine->device<pia6821_device>("pia_1");
+ pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
int scanline = param;
/* the IRQ signal comes into CB1, and is set to VA11 */
@@ -394,13 +394,13 @@ TIMER_DEVICE_CALLBACK( williams2_va11_callback )
/* set a timer for the next update */
scanline += 0x20;
if (scanline >= 256) scanline = 0;
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
}
static TIMER_CALLBACK( williams2_endscreen_off_callback )
{
- pia6821_device *pia_0 = machine->device<pia6821_device>("pia_0");
+ pia6821_device *pia_0 = machine.device<pia6821_device>("pia_0");
/* the /ENDSCREEN signal comes into CA1 */
pia6821_ca1_w(pia_0, 1);
@@ -409,16 +409,16 @@ static TIMER_CALLBACK( williams2_endscreen_off_callback )
TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
{
- pia6821_device *pia_0 = timer.machine->device<pia6821_device>("pia_0");
+ pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
/* the /ENDSCREEN signal comes into CA1 */
pia6821_ca1_w(pia_0, 0);
/* set a timer to turn it off once the scanline counter resets */
- timer.machine->scheduler().timer_set(timer.machine->primary_screen->time_until_pos(8), FUNC(williams2_endscreen_off_callback));
+ timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(8), FUNC(williams2_endscreen_off_callback));
/* set a timer for next frame */
- timer.adjust(timer.machine->primary_screen->time_until_pos(254));
+ timer.adjust(timer.machine().primary_screen->time_until_pos(254));
}
@@ -431,39 +431,39 @@ TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
static STATE_POSTLOAD( williams2_postload )
{
- williams_state *state = machine->driver_data<williams_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ williams_state *state = machine.driver_data<williams_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
williams2_bank_select_w(space, 0, state->vram_bank);
}
MACHINE_START( williams2 )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
/* configure memory banks */
memory_configure_bank(machine, "bank1", 0, 1, state->videoram, 0);
- memory_configure_bank(machine, "bank1", 1, 4, machine->region("maincpu")->base() + 0x10000, 0x10000);
+ memory_configure_bank(machine, "bank1", 1, 4, machine.region("maincpu")->base() + 0x10000, 0x10000);
/* register for save states */
state_save_register_global(machine, state->vram_bank);
- machine->state().register_postload(williams2_postload, NULL);
+ machine.state().register_postload(williams2_postload, NULL);
}
MACHINE_RESET( williams2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* make sure our banking is reset */
williams2_bank_select_w(space, 0, 0);
/* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
- timer_device *scan_timer = machine->device<timer_device>("scan_timer");
- scan_timer->adjust(machine->primary_screen->time_until_pos(0));
+ timer_device *scan_timer = machine.device<timer_device>("scan_timer");
+ scan_timer->adjust(machine.primary_screen->time_until_pos(0));
/* also set a timer to go off on scanline 254 */
- timer_device *l254_timer = machine->device<timer_device>("254_timer");
- l254_timer->adjust(machine->primary_screen->time_until_pos(254));
+ timer_device *l254_timer = machine.device<timer_device>("254_timer");
+ l254_timer->adjust(machine.primary_screen->time_until_pos(254));
}
@@ -476,10 +476,10 @@ MACHINE_RESET( williams2 )
WRITE8_HANDLER( williams_vram_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* VRAM/ROM banking from bit 0 */
state->vram_bank = data & 0x01;
- memory_set_bank(space->machine, "bank1", state->vram_bank);
+ memory_set_bank(space->machine(), "bank1", state->vram_bank);
/* cocktail flip from bit 1 */
state->cocktail = data & 0x02;
@@ -488,7 +488,7 @@ WRITE8_HANDLER( williams_vram_select_w )
WRITE8_HANDLER( williams2_bank_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->vram_bank = data & 0x07;
/* the low two bits control the paging */
@@ -498,8 +498,8 @@ WRITE8_HANDLER( williams2_bank_select_w )
case 0:
space->install_read_bank(0x0000, 0x8fff, "bank1");
space->install_write_bank(0x8000, 0x87ff, "bank4");
- memory_set_bank(space->machine, "bank1", 0);
- memory_set_bankptr(space->machine, "bank4", &state->videoram[0x8000]);
+ memory_set_bank(space->machine(), "bank1", 0);
+ memory_set_bankptr(space->machine(), "bank4", &state->videoram[0x8000]);
break;
/* pages 1 and 2 are ROM */
@@ -507,16 +507,16 @@ WRITE8_HANDLER( williams2_bank_select_w )
case 2:
space->install_read_bank(0x0000, 0x8fff, "bank1");
space->install_write_bank(0x8000, 0x87ff, "bank4");
- memory_set_bank(space->machine, "bank1", 1 + ((state->vram_bank & 6) >> 1));
- memory_set_bankptr(space->machine, "bank4", &state->videoram[0x8000]);
+ memory_set_bank(space->machine(), "bank1", 1 + ((state->vram_bank & 6) >> 1));
+ memory_set_bankptr(space->machine(), "bank4", &state->videoram[0x8000]);
break;
/* page 3 accesses palette RAM; the remaining areas are as if page 1 ROM was selected */
case 3:
space->install_read_bank(0x8000, 0x87ff, "bank4");
space->install_legacy_write_handler(0x8000, 0x87ff, FUNC(williams2_paletteram_w));
- memory_set_bank(space->machine, "bank1", 1 + ((state->vram_bank & 4) >> 1));
- memory_set_bankptr(space->machine, "bank4", space->machine->generic.paletteram.v);
+ memory_set_bank(space->machine(), "bank1", 1 + ((state->vram_bank & 4) >> 1));
+ memory_set_bankptr(space->machine(), "bank4", space->machine().generic.paletteram.v);
break;
}
}
@@ -531,7 +531,7 @@ WRITE8_HANDLER( williams2_bank_select_w )
static TIMER_CALLBACK( williams_deferred_snd_cmd_w )
{
- pia6821_device *pia_2 = machine->device<pia6821_device>("pia_2");
+ pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
pia6821_portb_w(pia_2, 0, param);
pia6821_cb1_w(pia_2, (param == 0xff) ? 0 : 1);
@@ -540,25 +540,25 @@ static TIMER_CALLBACK( williams_deferred_snd_cmd_w )
WRITE8_DEVICE_HANDLER( williams_snd_cmd_w )
{
/* the high two bits are set externally, and should be 1 */
- device->machine->scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data | 0xc0);
+ device->machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data | 0xc0);
}
WRITE8_DEVICE_HANDLER( playball_snd_cmd_w )
{
- device->machine->scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data);
+ device->machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data);
}
static TIMER_CALLBACK( williams2_deferred_snd_cmd_w )
{
- pia6821_device *pia_2 = machine->device<pia6821_device>("pia_2");
+ pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
pia6821_porta_w(pia_2, 0, param);
}
static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
{
- device->machine->scheduler().synchronize(FUNC(williams2_deferred_snd_cmd_w), data);
+ device->machine().scheduler().synchronize(FUNC(williams2_deferred_snd_cmd_w), data);
}
@@ -571,19 +571,19 @@ static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
WRITE8_DEVICE_HANDLER( williams_port_select_w )
{
- williams_state *state = device->machine->driver_data<williams_state>();
+ williams_state *state = device->machine().driver_data<williams_state>();
state->port_select = data;
}
CUSTOM_INPUT( williams_mux_r )
{
- williams_state *state = field->port->machine->driver_data<williams_state>();
+ williams_state *state = field->port->machine().driver_data<williams_state>();
const char *tag = (const char *)param;
if (state->port_select != 0)
tag += strlen(tag) + 1;
- return input_port_read(field->port->machine, tag);
+ return input_port_read(field->port->machine(), tag);
}
/*
@@ -614,17 +614,17 @@ CUSTOM_INPUT( williams_mux_r )
READ8_DEVICE_HANDLER( williams_49way_port_0_r )
{
static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
- return (translate49[input_port_read(device->machine, "49WAYX") >> 4] << 4) | translate49[input_port_read(device->machine, "49WAYY") >> 4];
+ return (translate49[input_port_read(device->machine(), "49WAYX") >> 4] << 4) | translate49[input_port_read(device->machine(), "49WAYY") >> 4];
}
READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r )
{
- williams_state *state = device->machine->driver_data<williams_state>();
+ williams_state *state = device->machine().driver_data<williams_state>();
if (state->port_select)
return williams_49way_port_0_r(device, 0);
else
- return input_port_read(device->machine, "IN3");
+ return input_port_read(device->machine(), "IN3");
}
@@ -638,7 +638,7 @@ READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r )
WRITE8_HANDLER( williams_cmos_w )
{
/* only 4 bits are valid */
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->m_nvram[offset] = data | 0xf0;
}
@@ -646,7 +646,7 @@ WRITE8_HANDLER( williams_cmos_w )
WRITE8_HANDLER( bubbles_cmos_w )
{
/* bubbles has additional CMOS for a full 8 bits */
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->m_nvram[offset] = data;
}
@@ -724,8 +724,8 @@ WRITE8_HANDLER( williams2_7segment_w )
static STATE_POSTLOAD( defender_postload )
{
- williams_state *state = machine->driver_data<williams_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ williams_state *state = machine.driver_data<williams_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
defender_bank_select_w(space, 0, state->vram_bank);
}
@@ -735,15 +735,15 @@ MACHINE_START( defender )
MACHINE_START_CALL(williams_common);
/* configure the banking and make sure it is reset to 0 */
- memory_configure_bank(machine, "bank1", 0, 9, &machine->region("maincpu")->base()[0x10000], 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 9, &machine.region("maincpu")->base()[0x10000], 0x1000);
- machine->state().register_postload(defender_postload, NULL);
+ machine.state().register_postload(defender_postload, NULL);
}
MACHINE_RESET( defender )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
MACHINE_RESET_CALL(williams_common);
@@ -753,14 +753,14 @@ MACHINE_RESET( defender )
WRITE8_HANDLER( defender_video_control_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->cocktail = data & 0x01;
}
WRITE8_HANDLER( defender_bank_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->vram_bank = data & 0x0f;
/* set bank address */
@@ -783,7 +783,7 @@ WRITE8_HANDLER( defender_bank_select_w )
case 9:
space->install_read_bank(0xc000, 0xcfff, "bank1");
space->unmap_write(0xc000, 0xcfff);
- memory_set_bank(space->machine, "bank1", state->vram_bank - 1);
+ memory_set_bank(space->machine(), "bank1", state->vram_bank - 1);
break;
/* pages A-F are not connected */
@@ -803,11 +803,11 @@ WRITE8_HANDLER( defender_bank_select_w )
READ8_HANDLER( mayday_protection_r )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* Mayday does some kind of protection check that is not currently understood */
/* However, the results of that protection check are stored at $a190 and $a191 */
/* These are compared against $a193 and $a194, respectively. Thus, to prevent */
- /* the protection from resetting the space->machine, we just return $a193 for $a190, */
+ /* the protection from resetting the space->machine(), we just return $a193 for $a190, */
/* and $a194 for $a191. */
return state->mayday_protection[offset + 3];
}
@@ -822,7 +822,7 @@ READ8_HANDLER( mayday_protection_r )
WRITE8_HANDLER( sinistar_vram_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* low two bits are standard */
williams_vram_select_w(space, offset, data);
@@ -840,15 +840,15 @@ WRITE8_HANDLER( sinistar_vram_select_w )
MACHINE_START( blaster )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
MACHINE_START_CALL(williams_common);
/* banking is different for blaster */
memory_configure_bank(machine, "bank1", 0, 1, state->videoram, 0);
- memory_configure_bank(machine, "bank1", 1, 16, machine->region("maincpu")->base() + 0x18000, 0x4000);
+ memory_configure_bank(machine, "bank1", 1, 16, machine.region("maincpu")->base() + 0x18000, 0x4000);
memory_configure_bank(machine, "bank2", 0, 1, state->videoram + 0x4000, 0);
- memory_configure_bank(machine, "bank2", 1, 16, machine->region("maincpu")->base() + 0x10000, 0x0000);
+ memory_configure_bank(machine, "bank2", 1, 16, machine.region("maincpu")->base() + 0x10000, 0x0000);
state_save_register_global(machine, state->blaster_bank);
}
@@ -860,9 +860,9 @@ MACHINE_RESET( blaster )
}
-INLINE void update_blaster_banking(running_machine *machine)
+INLINE void update_blaster_banking(running_machine &machine)
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
memory_set_bank(machine, "bank1", state->vram_bank * (state->blaster_bank + 1));
memory_set_bank(machine, "bank2", state->vram_bank * (state->blaster_bank + 1));
}
@@ -870,10 +870,10 @@ INLINE void update_blaster_banking(running_machine *machine)
WRITE8_HANDLER( blaster_vram_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* VRAM/ROM banking from bit 0 */
state->vram_bank = data & 0x01;
- update_blaster_banking(space->machine);
+ update_blaster_banking(space->machine());
/* cocktail flip from bit 1 */
state->cocktail = data & 0x02;
@@ -885,9 +885,9 @@ WRITE8_HANDLER( blaster_vram_select_w )
WRITE8_HANDLER( blaster_bank_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->blaster_bank = data & 15;
- update_blaster_banking(space->machine);
+ update_blaster_banking(space->machine());
}
@@ -900,7 +900,7 @@ WRITE8_HANDLER( blaster_bank_select_w )
static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
{
- coin_lockout_global_w(device->machine, data & 1); /* bit 5 of PIC control port A */
+ coin_lockout_global_w(device->machine(), data & 1); /* bit 5 of PIC control port A */
}
@@ -914,7 +914,7 @@ static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
{
/* merge in the gun inputs with the standard data */
- int data = input_port_read(device->machine, "IN0");
+ int data = input_port_read(device->machine(), "IN0");
int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1);
return (data & 0xc0) | gun;
@@ -926,7 +926,7 @@ static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
static WRITE8_DEVICE_HANDLER( tshoot_maxvol_w )
{
/* something to do with the sound volume */
- logerror("tshoot maxvol = %d (%s)\n", data, device->machine->describe_context());
+ logerror("tshoot maxvol = %d (%s)\n", data, device->machine().describe_context());
}
@@ -953,7 +953,7 @@ static WRITE8_DEVICE_HANDLER( tshoot_lamp_w )
MACHINE_START( joust2 )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
MACHINE_START_CALL(williams2);
williams_cvsd_init(machine);
state_save_register_global(machine, state->joust2_current_sound_data);
@@ -962,7 +962,7 @@ MACHINE_START( joust2 )
MACHINE_RESET( joust2 )
{
- pia6821_device *pia_3 = machine->device<pia6821_device>("cvsdpia");
+ pia6821_device *pia_3 = machine.device<pia6821_device>("cvsdpia");
/* standard init */
MACHINE_RESET_CALL(williams2);
@@ -972,15 +972,15 @@ MACHINE_RESET( joust2 )
static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
{
- pia6821_device *pia_2 = machine->device<pia6821_device>("pia_2");
+ pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
pia6821_porta_w(pia_2, 0, param & 0xff);
}
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
{
- williams_state *state = device->machine->driver_data<williams_state>();
- pia6821_device *pia_3 = device->machine->device<pia6821_device>("cvsdpia");
+ williams_state *state = device->machine().driver_data<williams_state>();
+ pia6821_device *pia_3 = device->machine().device<pia6821_device>("cvsdpia");
state->joust2_current_sound_data = (state->joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
pia6821_cb1_w(pia_3, data);
@@ -989,8 +989,8 @@ static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w )
{
- williams_state *state = device->machine->driver_data<williams_state>();
+ williams_state *state = device->machine().driver_data<williams_state>();
state->joust2_current_sound_data = (state->joust2_current_sound_data & ~0xff) | (data & 0xff);
- williams_cvsd_data_w(device->machine, state->joust2_current_sound_data);
- device->machine->scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->joust2_current_sound_data);
+ williams_cvsd_data_w(device->machine(), state->joust2_current_sound_data);
+ device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->joust2_current_sound_data);
}
diff --git a/src/mame/machine/wrally.c b/src/mame/machine/wrally.c
index dca8d5eda30..fe9b5bd427c 100644
--- a/src/mame/machine/wrally.c
+++ b/src/mame/machine/wrally.c
@@ -20,7 +20,7 @@
WRITE16_HANDLER( wrally_vram_w )
{
- wrally_state *state = space->machine->driver_data<wrally_state>();
+ wrally_state *state = space->machine().driver_data<wrally_state>();
data = gaelco_decrypt(space, offset, data, 0x1f, 0x522a);
COMBINE_DATA(&state->videoram[offset]);
@@ -29,12 +29,12 @@ WRITE16_HANDLER( wrally_vram_w )
WRITE16_HANDLER( wrally_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7){
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f)*0x10000], 0x10000);
@@ -43,11 +43,11 @@ WRITE16_HANDLER( OKIM6295_bankswitch_w )
WRITE16_HANDLER( wrally_coin_counter_w )
{
- coin_counter_w( space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w( space->machine(), (offset >> 3) & 0x01, data & 0x01);
}
WRITE16_HANDLER( wrally_coin_lockout_w )
{
- coin_lockout_w( space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w( space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
}
diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c
index 4f91a43ec69..e691c4d228b 100644
--- a/src/mame/machine/xevious.c
+++ b/src/mame/machine/xevious.c
@@ -25,7 +25,7 @@ static char battles_customio_data;
static char battles_sound_played;
-void battles_customio_init(running_machine *machine)
+void battles_customio_init(running_machine &machine)
{
battles_customio_command = 0;
battles_customio_prev_command = 0;
@@ -44,18 +44,18 @@ TIMER_DEVICE_CALLBACK( battles_nmi_generate )
{
if( battles_customio_command_count == 0 )
{
- cputag_set_input_line(timer.machine, "sub3", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "sub3", INPUT_LINE_NMI, PULSE_LINE);
}
else
{
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
- cputag_set_input_line(timer.machine, "sub3", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "sub3", INPUT_LINE_NMI, PULSE_LINE);
}
}
else
{
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
- cputag_set_input_line(timer.machine, "sub3", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "sub3", INPUT_LINE_NMI, PULSE_LINE);
}
battles_customio_command_count++;
}
@@ -89,7 +89,7 @@ READ8_HANDLER( battles_customio3_r )
WRITE8_HANDLER( battles_customio0_w )
{
- timer_device *timer = space->machine->device<timer_device>("battles_nmi");
+ timer_device *timer = space->machine().device<timer_device>("battles_nmi");
logerror("CPU0 %04x: custom I/O Write = %02x\n",cpu_get_pc(space->cpu),data);
@@ -144,12 +144,12 @@ WRITE8_HANDLER( battles_customio_data3_w )
WRITE8_HANDLER( battles_CPU4_coin_w )
{
- set_led_status(space->machine, 0,data & 0x02); // Start 1
- set_led_status(space->machine, 1,data & 0x01); // Start 2
+ set_led_status(space->machine(), 0,data & 0x02); // Start 1
+ set_led_status(space->machine(), 1,data & 0x01); // Start 2
- coin_counter_w(space->machine, 0,data & 0x20);
- coin_counter_w(space->machine, 1,data & 0x10);
- coin_lockout_global_w(space->machine, ~data & 0x04);
+ coin_counter_w(space->machine(), 0,data & 0x20);
+ coin_counter_w(space->machine(), 1,data & 0x10);
+ coin_lockout_global_w(space->machine(), ~data & 0x04);
}
@@ -157,7 +157,7 @@ WRITE8_HANDLER( battles_noise_sound_w )
{
logerror("CPU3 %04x: 50%02x Write = %02x\n",cpu_get_pc(space->cpu),offset,data);
if( (battles_sound_played == 0) && (data == 0xFF) ){
- samples_device *samples = space->machine->device<samples_device>("samples");
+ samples_device *samples = space->machine().device<samples_device>("samples");
if( customio[0] == 0x40 ){
sample_start (samples, 0, 0, 0);
}
@@ -174,10 +174,10 @@ READ8_HANDLER( battles_input_port_r )
switch ( offset )
{
default:
- case 0: return ~BITSWAP8(input_port_read(space->machine, "IN0H"),7,6,5,4,2,3,1,0);
- case 1: return ~input_port_read(space->machine, "IN1L");
- case 2: return ~input_port_read(space->machine, "IN1H");
- case 3: return ~input_port_read(space->machine, "IN0L");
+ case 0: return ~BITSWAP8(input_port_read(space->machine(), "IN0H"),7,6,5,4,2,3,1,0);
+ case 1: return ~input_port_read(space->machine(), "IN1L");
+ case 2: return ~input_port_read(space->machine(), "IN1H");
+ case 3: return ~input_port_read(space->machine(), "IN0L");
}
}
diff --git a/src/mame/machine/zs01.c b/src/mame/machine/zs01.c
index 8eaac340dc7..0a9e6b8e8d4 100644
--- a/src/mame/machine/zs01.c
+++ b/src/mame/machine/zs01.c
@@ -22,7 +22,7 @@ inline void ATTR_PRINTF(3,4) zs01_device::verboselog(int n_level, const char *s_
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("zs01 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("zs01 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -46,7 +46,7 @@ device_config *zs01_device_config::static_alloc_device_config(const machine_conf
device_t *zs01_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, zs01_device(machine, *this));
+ return auto_alloc(machine, zs01_device(machine, *this));
}
zs01_device::zs01_device(running_machine &_machine, const zs01_device_config &_config)
@@ -427,7 +427,7 @@ void zs01_device::scl_1()
switch(write_buffer[1]) {
case 0xfd: {
/* TODO: use read/write to talk to the ds2401, which will require a timer. */
- ds2401_device *ds2401 = machine->device<ds2401_device>(config.ds2401_tag);
+ ds2401_device *ds2401 = m_machine.device<ds2401_device>(config.ds2401_tag);
for(int i = 0; i < SIZE_DATA_BUFFER; i++)
read_buffer[2+i] = ds2401->direct_read(SIZE_DATA_BUFFER-i-1);
break;
diff --git a/src/mame/video/1942.c b/src/mame/video/1942.c
index d8fa80b55fc..3e0efd6e10a 100644
--- a/src/mame/video/1942.c
+++ b/src/mame/video/1942.c
@@ -90,7 +90,7 @@ PALETTE_INIT( 1942 )
static TILE_GET_INFO( get_fg_tile_info )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
int code, color;
code = state->fg_videoram[tile_index];
@@ -104,7 +104,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
int code, color;
tile_index = (tile_index & 0x0f) | ((tile_index & 0x01f0) << 1);
@@ -126,7 +126,7 @@ static TILE_GET_INFO( get_bg_tile_info )
***************************************************************************/
VIDEO_START( 1942 )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 16);
@@ -142,7 +142,7 @@ VIDEO_START( 1942 )
WRITE8_HANDLER( c1942_fgvideoram_w )
{
- _1942_state *state = space->machine->driver_data<_1942_state>();
+ _1942_state *state = space->machine().driver_data<_1942_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
@@ -150,7 +150,7 @@ WRITE8_HANDLER( c1942_fgvideoram_w )
WRITE8_HANDLER( c1942_bgvideoram_w )
{
- _1942_state *state = space->machine->driver_data<_1942_state>();
+ _1942_state *state = space->machine().driver_data<_1942_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, (offset & 0x0f) | ((offset >> 1) & 0x01f0));
@@ -159,7 +159,7 @@ WRITE8_HANDLER( c1942_bgvideoram_w )
WRITE8_HANDLER( c1942_palette_bank_w )
{
- _1942_state *state = space->machine->driver_data<_1942_state>();
+ _1942_state *state = space->machine().driver_data<_1942_state>();
if (state->palette_bank != data)
{
@@ -170,7 +170,7 @@ WRITE8_HANDLER( c1942_palette_bank_w )
WRITE8_HANDLER( c1942_scroll_w )
{
- _1942_state *state = space->machine->driver_data<_1942_state>();
+ _1942_state *state = space->machine().driver_data<_1942_state>();
state->scroll[offset] = data;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll[0] | (state->scroll[1] << 8));
@@ -179,16 +179,16 @@ WRITE8_HANDLER( c1942_scroll_w )
WRITE8_HANDLER( c1942_c804_w )
{
- _1942_state *state = space->machine->driver_data<_1942_state>();
+ _1942_state *state = space->machine().driver_data<_1942_state>();
/* bit 7: flip screen
bit 4: cpu B reset
bit 0: coin counter */
- coin_counter_w(space->machine, 0,data & 0x01);
+ coin_counter_w(space->machine(), 0,data & 0x01);
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
@@ -198,9 +198,9 @@ WRITE8_HANDLER( c1942_c804_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -228,7 +228,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code + i,col,
flip_screen_get(machine),flip_screen_get(machine),
sx,sy + 16 * i * dir,15);
@@ -242,10 +242,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( 1942 )
{
- _1942_state *state = screen->machine->driver_data<_1942_state>();
+ _1942_state *state = screen->machine().driver_data<_1942_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/1943.c b/src/mame/video/1943.c
index fa5fb9dd4e9..76064d73bd7 100644
--- a/src/mame/video/1943.c
+++ b/src/mame/video/1943.c
@@ -50,7 +50,7 @@ PALETTE_INIT( 1943 )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
for (i = 0; i < 0x100; i++)
{
@@ -78,7 +78,7 @@ PALETTE_INIT( 1943 )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -88,7 +88,7 @@ PALETTE_INIT( 1943 )
for (i = 0x00; i < 0x80; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x40;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* foreground tiles use colors 0x00-0x3f */
@@ -96,7 +96,7 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x200 + (i - 0x080)] & 0x03) << 4) |
((color_prom[0x100 + (i - 0x080)] & 0x0f) << 0);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* background tiles also use colors 0x00-0x3f */
@@ -104,7 +104,7 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x400 + (i - 0x180)] & 0x03) << 4) |
((color_prom[0x300 + (i - 0x180)] & 0x0f) << 0);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 0x80-0xff
@@ -114,13 +114,13 @@ PALETTE_INIT( 1943 )
{
UINT8 ctabentry = ((color_prom[0x600 + (i - 0x280)] & 0x07) << 4) |
((color_prom[0x500 + (i - 0x280)] & 0x0f) << 0) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( c1943_videoram_w )
{
- _1943_state *state = space->machine->driver_data<_1943_state>();
+ _1943_state *state = space->machine().driver_data<_1943_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -128,7 +128,7 @@ WRITE8_HANDLER( c1943_videoram_w )
WRITE8_HANDLER( c1943_colorram_w )
{
- _1943_state *state = space->machine->driver_data<_1943_state>();
+ _1943_state *state = space->machine().driver_data<_1943_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -136,24 +136,24 @@ WRITE8_HANDLER( c1943_colorram_w )
WRITE8_HANDLER( c1943_c804_w )
{
- _1943_state *state = space->machine->driver_data<_1943_state>();
+ _1943_state *state = space->machine().driver_data<_1943_state>();
int bank;
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bits 2, 3 and 4 select the ROM bank */
bank = data & 0x1c;
- memory_set_bank(space->machine, "bank1", bank);
- memory_set_bank(space->machine, "bank2", bank);
- memory_set_bank(space->machine, "bank3", bank);
- memory_set_bank(space->machine, "bank4", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
+ memory_set_bank(space->machine(), "bank2", bank);
+ memory_set_bank(space->machine(), "bank3", bank);
+ memory_set_bank(space->machine(), "bank4", bank);
/* bit 5 resets the sound CPU - we ignore it */
/* bit 6 flips screen */
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
/* bit 7 enables characters */
state->char_on = data & 0x80;
@@ -161,7 +161,7 @@ WRITE8_HANDLER( c1943_c804_w )
WRITE8_HANDLER( c1943_d806_w )
{
- _1943_state *state = space->machine->driver_data<_1943_state>();
+ _1943_state *state = space->machine().driver_data<_1943_state>();
/* bit 4 enables bg 1 */
state->bg1_on = data & 0x10;
@@ -175,7 +175,7 @@ WRITE8_HANDLER( c1943_d806_w )
static TILE_GET_INFO( c1943_get_bg2_tile_info )
{
- UINT8 *tilerom = machine->region("gfx5")->base() + 0x8000;
+ UINT8 *tilerom = machine.region("gfx5")->base() + 0x8000;
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
@@ -188,7 +188,7 @@ static TILE_GET_INFO( c1943_get_bg2_tile_info )
static TILE_GET_INFO( c1943_get_bg_tile_info )
{
- UINT8 *tilerom = machine->region("gfx5")->base();
+ UINT8 *tilerom = machine.region("gfx5")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
@@ -202,7 +202,7 @@ static TILE_GET_INFO( c1943_get_bg_tile_info )
static TILE_GET_INFO( c1943_get_fg_tile_info )
{
- _1943_state *state = machine->driver_data<_1943_state>();
+ _1943_state *state = machine.driver_data<_1943_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xe0) << 3);
int color = attr & 0x1f;
@@ -212,12 +212,12 @@ static TILE_GET_INFO( c1943_get_fg_tile_info )
VIDEO_START( 1943 )
{
- _1943_state *state = machine->driver_data<_1943_state>();
+ _1943_state *state = machine.driver_data<_1943_state>();
state->bg2_tilemap = tilemap_create(machine, c1943_get_bg2_tile_info, tilemap_scan_cols, 32, 32, 2048, 8);
state->bg_tilemap = tilemap_create(machine, c1943_get_bg_tile_info, tilemap_scan_cols, 32, 32, 2048, 8);
state->fg_tilemap = tilemap_create(machine, c1943_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[1], 0x0f);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[1], 0x0f);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
state->save_item(NAME(state->char_on));
@@ -226,9 +226,9 @@ VIDEO_START( 1943 )
state->save_item(NAME(state->bg2_on));
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- _1943_state *state = machine->driver_data<_1943_state>();
+ _1943_state *state = machine.driver_data<_1943_state>();
int offs;
for (offs = state->spriteram_size - 32; offs >= 0; offs -= 32)
@@ -249,19 +249,19 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (priority)
{
if (color != 0x0a && color != 0x0b)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
}
else
{
if (color == 0x0a || color == 0x0b)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
}
}
}
SCREEN_UPDATE( 1943 )
{
- _1943_state *state = screen->machine->driver_data<_1943_state>();
+ _1943_state *state = screen->machine().driver_data<_1943_state>();
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bgscrollx[0] + 256 * state->bgscrollx[1]);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0] + 256 * state->scrollx[1]);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[0]);
@@ -269,16 +269,16 @@ SCREEN_UPDATE( 1943 )
if (state->bg2_on)
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->obj_on)
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
if (state->bg1_on)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if (state->obj_on)
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
if (state->char_on)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/20pacgal.c b/src/mame/video/20pacgal.c
index 8f78ee64ed1..684bd759a77 100644
--- a/src/mame/video/20pacgal.c
+++ b/src/mame/video/20pacgal.c
@@ -22,10 +22,10 @@
*
*************************************/
-static void get_pens(running_machine *machine, const _20pacgal_state *state, pen_t *pens)
+static void get_pens(running_machine &machine, const _20pacgal_state *state, pen_t *pens)
{
offs_t offs;
- UINT8 *color_prom = machine->region("proms")->base() + (NUM_PENS * state->game_selected);
+ UINT8 *color_prom = machine.region("proms")->base() + (NUM_PENS * state->game_selected);
for (offs = 0; offs < NUM_PENS ;offs++)
{
@@ -73,7 +73,7 @@ static void get_pens(running_machine *machine, const _20pacgal_state *state, pen
}
-static void do_pen_lookup(running_machine *machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle *cliprect)
+static void do_pen_lookup(running_machine &machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle *cliprect)
{
int y, x;
pen_t pens[NUM_PENS + NUM_STAR_PENS];
@@ -93,7 +93,7 @@ static void do_pen_lookup(running_machine *machine, const _20pacgal_state *state
*
*************************************/
-static void draw_sprite(running_machine* machine, const _20pacgal_state *state, bitmap_t *bitmap, int y, int x,
+static void draw_sprite(running_machine& machine, const _20pacgal_state *state, bitmap_t *bitmap, int y, int x,
UINT8 code, UINT8 color, int flip_y, int flip_x)
{
int sy;
@@ -163,7 +163,7 @@ static void draw_sprite(running_machine* machine, const _20pacgal_state *state,
}
-static void draw_sprites(running_machine* machine,const _20pacgal_state *state, bitmap_t *bitmap)
+static void draw_sprites(running_machine& machine,const _20pacgal_state *state, bitmap_t *bitmap)
{
int offs;
@@ -408,13 +408,13 @@ static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle
static SCREEN_UPDATE( 20pacgal )
{
- _20pacgal_state *state = screen->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = screen->machine().driver_data<_20pacgal_state>();
bitmap_fill(bitmap,cliprect,0);
draw_stars(state, bitmap,cliprect);
draw_chars(state, bitmap);
- draw_sprites(screen->machine,state, bitmap);
- do_pen_lookup(screen->machine, state, bitmap, cliprect);
+ draw_sprites(screen->machine(),state, bitmap);
+ do_pen_lookup(screen->machine(), state, bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c
index ef2a7938610..c12d85bb833 100644
--- a/src/mame/video/40love.c
+++ b/src/mame/video/40love.c
@@ -14,7 +14,7 @@ PALETTE_INIT( fortyl )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -26,17 +26,17 @@ PALETTE_INIT( fortyl )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine, i, MAKE_RGB(r,g,b));
@@ -63,7 +63,7 @@ colorram format (2 bytes per one tilemap character line, 8 pixels height):
static TILE_GET_INFO( get_bg_tile_info )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int tile_number = state->videoram[tile_index];
int tile_attrib = state->colorram[(tile_index / 64) * 2];
int tile_h_bank = (tile_attrib & 0x40) << 3; /* 0x40->0x200 */
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static STATE_POSTLOAD( redraw_pixels )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
state->pix_redraw = 1;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -102,12 +102,12 @@ static STATE_POSTLOAD( redraw_pixels )
VIDEO_START( fortyl )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
state->pixram1 = auto_alloc_array_clear(machine, UINT8, 0x4000);
state->pixram2 = auto_alloc_array_clear(machine, UINT8, 0x4000);
- state->tmp_bitmap1 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
- state->tmp_bitmap2 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
+ state->tmp_bitmap1 = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
+ state->tmp_bitmap2 = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -123,7 +123,7 @@ VIDEO_START( fortyl )
state->save_item(NAME(*state->tmp_bitmap1));
state->save_item(NAME(*state->tmp_bitmap2));
state->save_item(NAME(state->pixram_sel));
- machine->state().register_postload(redraw_pixels, NULL);
+ machine.state().register_postload(redraw_pixels, NULL);
}
@@ -133,9 +133,9 @@ VIDEO_START( fortyl )
***************************************************************************/
-static void fortyl_set_scroll_x( running_machine *machine, int offset )
+static void fortyl_set_scroll_x( running_machine &machine, int offset )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int i = offset & ~1;
int x = ((state->colorram[i] & 0x80) << 1) | state->colorram[i + 1]; /* 9 bits signed */
@@ -152,7 +152,7 @@ static void fortyl_set_scroll_x( running_machine *machine, int offset )
WRITE8_HANDLER( fortyl_pixram_sel_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
int offs;
int f = data & 0x01;
@@ -161,26 +161,26 @@ WRITE8_HANDLER( fortyl_pixram_sel_w )
if (state->flipscreen != f)
{
state->flipscreen = f;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
state->pix_redraw = 1;
for (offs = 0; offs < 32; offs++)
- fortyl_set_scroll_x(space->machine, offs * 2);
+ fortyl_set_scroll_x(space->machine(), offs * 2);
}
}
READ8_HANDLER( fortyl_pixram_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
if (state->pixram_sel)
return state->pixram2[offset];
else
return state->pixram1[offset];
}
-static void fortyl_plot_pix( running_machine *machine, int offset )
+static void fortyl_plot_pix( running_machine &machine, int offset )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int x, y, i, c, d1, d2;
x = (offset & 0x1f) * 8;
@@ -209,32 +209,32 @@ static void fortyl_plot_pix( running_machine *machine, int offset )
WRITE8_HANDLER( fortyl_pixram_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
if (state->pixram_sel)
state->pixram2[offset] = data;
else
state->pixram1[offset] = data;
- fortyl_plot_pix(space->machine, offset & 0x1fff);
+ fortyl_plot_pix(space->machine(), offset & 0x1fff);
}
WRITE8_HANDLER( fortyl_bg_videoram_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
READ8_HANDLER( fortyl_bg_videoram_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( fortyl_bg_colorram_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
if (state->colorram[offset] != data)
{
int i;
@@ -243,13 +243,13 @@ WRITE8_HANDLER( fortyl_bg_colorram_w )
for (i = (offset / 2) * 64; i < (offset / 2) * 64 + 64; i++)
tilemap_mark_tile_dirty(state->bg_tilemap, i);
- fortyl_set_scroll_x(space->machine, offset);
+ fortyl_set_scroll_x(space->machine(), offset);
}
}
READ8_HANDLER( fortyl_bg_colorram_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->colorram[offset];
}
@@ -274,9 +274,9 @@ spriteram format (4 bytes per sprite):
offset 3 xxxxxxxx x position
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -300,9 +300,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color = (spriteram[offs + 2] & 0x07) + 0x08;
if (spriteram[offs + 2] & 0xe0)
- color = machine->rand() & 0xf;
+ color = machine.rand() & 0xf;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -328,9 +328,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color = (spriteram_2[offs + 2] & 0x07) + 0x08;
if (spriteram_2[offs + 2] & 0xe0)
- color = machine->rand() & 0xf;
+ color = machine.rand() & 0xf;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -338,9 +338,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_pixram( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int offs;
int f = state->flipscreen ^ 1;
@@ -360,12 +360,12 @@ static void draw_pixram( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( fortyl )
{
- fortyl_state *state = screen->machine->driver_data<fortyl_state>();
- draw_pixram(screen->machine, bitmap, cliprect);
+ fortyl_state *state = screen->machine().driver_data<fortyl_state>();
+ draw_pixram(screen->machine(), bitmap, cliprect);
tilemap_set_scrolldy(state->bg_tilemap, - state->video_ctrl[1] + 1, - state->video_ctrl[1] - 1 );
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/4enraya.c b/src/mame/video/4enraya.c
index 2506f89b604..d36269a171a 100644
--- a/src/mame/video/4enraya.c
+++ b/src/mame/video/4enraya.c
@@ -11,7 +11,7 @@
WRITE8_HANDLER( fenraya_videoram_w )
{
- _4enraya_state *state = space->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
state->videoram[(offset & 0x3ff) * 2] = data;
state->videoram[(offset & 0x3ff) * 2 + 1] = (offset & 0xc00) >> 10;
@@ -20,7 +20,7 @@ WRITE8_HANDLER( fenraya_videoram_w )
static TILE_GET_INFO( get_tile_info )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
int code = state->videoram[tile_index * 2] + (state->videoram[tile_index * 2 + 1] << 8);
SET_TILE_INFO(
@@ -32,14 +32,14 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( 4enraya )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
SCREEN_UPDATE( 4enraya )
{
- _4enraya_state *state = screen->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = screen->machine().driver_data<_4enraya_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/8080bw.c b/src/mame/video/8080bw.c
index 7640a1df7f2..dc43bcee14c 100644
--- a/src/mame/video/8080bw.c
+++ b/src/mame/video/8080bw.c
@@ -15,7 +15,7 @@
MACHINE_START( extra_8080bw_vh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
state->save_item(NAME(state->c8080bw_flip_screen));
state->save_item(NAME(state->color_map));
@@ -63,9 +63,9 @@ static void cosmo_get_pens( pen_t *pens )
}
-INLINE void set_pixel( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT8 x, pen_t *pens, UINT8 color )
+INLINE void set_pixel( running_machine &machine, bitmap_t *bitmap, UINT8 y, UINT8 x, pen_t *pens, UINT8 color )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
if (y >= MW8080BW_VCOUNTER_START_NO_VBLANK)
{
@@ -77,7 +77,7 @@ INLINE void set_pixel( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT
}
-INLINE void set_8_pixels( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, pen_t *pens, UINT8 fore_color, UINT8 back_color )
+INLINE void set_8_pixels( running_machine &machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, pen_t *pens, UINT8 fore_color, UINT8 back_color )
{
int i;
@@ -92,9 +92,9 @@ INLINE void set_8_pixels( running_machine *machine, bitmap_t *bitmap, UINT8 y, U
/* this is needed as this driver doesn't emulate the shift register like mw8080bw does */
-static void clear_extra_columns( running_machine *machine, bitmap_t *bitmap, pen_t *pens, UINT8 color )
+static void clear_extra_columns( running_machine &machine, bitmap_t *bitmap, pen_t *pens, UINT8 color )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
UINT8 x;
for (x = 0; x < 4; x++)
@@ -114,7 +114,7 @@ static void clear_extra_columns( running_machine *machine, bitmap_t *bitmap, pen
SCREEN_UPDATE( invadpt2 )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *prom;
@@ -122,7 +122,7 @@ SCREEN_UPDATE( invadpt2 )
invadpt2_get_pens(pens);
- prom = screen->machine->region("proms")->base();
+ prom = screen->machine().region("proms")->base();
color_map_base = state->color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->main_ram_size; offs++)
@@ -135,10 +135,10 @@ SCREEN_UPDATE( invadpt2 )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = state->screen_red ? 1 : color_map_base[color_address] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -146,7 +146,7 @@ SCREEN_UPDATE( invadpt2 )
SCREEN_UPDATE( ballbomb )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *color_map_base;
@@ -154,7 +154,7 @@ SCREEN_UPDATE( ballbomb )
invadpt2_get_pens(pens);
- prom = screen->machine->region("proms")->base();
+ prom = screen->machine().region("proms")->base();
color_map_base = state->color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->main_ram_size; offs++)
@@ -168,10 +168,10 @@ SCREEN_UPDATE( ballbomb )
UINT8 fore_color = state->screen_red ? 1 : color_map_base[color_address] & 0x07;
/* blue background */
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 2);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 2);
}
- clear_extra_columns(screen->machine, bitmap, pens, 2);
+ clear_extra_columns(screen->machine(), bitmap, pens, 2);
return 0;
}
@@ -179,14 +179,14 @@ SCREEN_UPDATE( ballbomb )
SCREEN_UPDATE( schaser )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *background_map_base;
invadpt2_get_pens(pens);
- background_map_base = screen->machine->region("proms")->base();
+ background_map_base = screen->machine().region("proms")->base();
for (offs = 0; offs < state->main_ram_size; offs++)
{
@@ -209,10 +209,10 @@ SCREEN_UPDATE( schaser )
back_color = (((back_data & 0x0c) == 0x0c) && state->schaser_background_select) ? 4 : 2;
}
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, back_color);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, back_color);
}
- clear_extra_columns(screen->machine, bitmap, pens, state->schaser_background_disable ? 0 : 2);
+ clear_extra_columns(screen->machine(), bitmap, pens, state->schaser_background_disable ? 0 : 2);
return 0;
}
@@ -220,7 +220,7 @@ SCREEN_UPDATE( schaser )
SCREEN_UPDATE( schasercv )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -235,10 +235,10 @@ SCREEN_UPDATE( schasercv )
UINT8 fore_color = state->colorram[offs & 0x1f9f] & 0x07;
/* blue background */
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 2);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 2);
}
- clear_extra_columns(screen->machine, bitmap, pens, 2);
+ clear_extra_columns(screen->machine(), bitmap, pens, 2);
return 0;
}
@@ -246,7 +246,7 @@ SCREEN_UPDATE( schasercv )
SCREEN_UPDATE( rollingc )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -260,10 +260,10 @@ SCREEN_UPDATE( rollingc )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = state->colorram[offs & 0x1f1f] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -271,7 +271,7 @@ SCREEN_UPDATE( rollingc )
SCREEN_UPDATE( polaris )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *color_map_base;
@@ -279,8 +279,8 @@ SCREEN_UPDATE( polaris )
invadpt2_get_pens(pens);
- color_map_base = screen->machine->region("proms")->base();
- cloud_gfx = screen->machine->region("user1")->base();
+ color_map_base = screen->machine().region("proms")->base();
+ cloud_gfx = screen->machine().region("user1")->base();
for (offs = 0; offs < state->main_ram_size; offs++)
{
@@ -304,7 +304,7 @@ SCREEN_UPDATE( polaris )
if ((color_map_base[color_address] & 0x08) || (cloud_y >= 64))
{
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, back_color);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, back_color);
}
else
{
@@ -327,7 +327,7 @@ SCREEN_UPDATE( polaris )
color = (cloud_gfx[cloud_gfx_offs] & bit) ? 7 : back_color;
}
- set_pixel(screen->machine, bitmap, y, x, pens, color);
+ set_pixel(screen->machine(), bitmap, y, x, pens, color);
x = x + 1;
data = data >> 1;
@@ -335,7 +335,7 @@ SCREEN_UPDATE( polaris )
}
}
- clear_extra_columns(screen->machine, bitmap, pens, 6);
+ clear_extra_columns(screen->machine(), bitmap, pens, 6);
return 0;
}
@@ -343,7 +343,7 @@ SCREEN_UPDATE( polaris )
SCREEN_UPDATE( lupin3 )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -357,10 +357,10 @@ SCREEN_UPDATE( lupin3 )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = ~state->colorram[offs & 0x1f9f] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -368,7 +368,7 @@ SCREEN_UPDATE( lupin3 )
SCREEN_UPDATE( cosmo )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -384,10 +384,10 @@ SCREEN_UPDATE( cosmo )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = state->colorram[color_address] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -395,7 +395,7 @@ SCREEN_UPDATE( cosmo )
SCREEN_UPDATE( indianbt )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
UINT8 *color_map_base;
@@ -403,7 +403,7 @@ SCREEN_UPDATE( indianbt )
cosmo_get_pens(pens);
- prom = screen->machine->region("proms")->base();
+ prom = screen->machine().region("proms")->base();
color_map_base = state->color_map ? &prom[0x0400] : &prom[0x0000];
for (offs = 0; offs < state->main_ram_size; offs++)
@@ -416,10 +416,10 @@ SCREEN_UPDATE( indianbt )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = color_map_base[color_address] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -427,7 +427,7 @@ SCREEN_UPDATE( indianbt )
SCREEN_UPDATE( shuttlei )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[2] = { RGB_BLACK, RGB_WHITE };
offs_t offs;
@@ -450,7 +450,7 @@ SCREEN_UPDATE( shuttlei )
}
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
@@ -458,7 +458,7 @@ SCREEN_UPDATE( shuttlei )
SCREEN_UPDATE( sflush )
{
- _8080bw_state *state = screen->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = screen->machine().driver_data<_8080bw_state>();
pen_t pens[NUM_PENS];
offs_t offs;
@@ -472,10 +472,10 @@ SCREEN_UPDATE( sflush )
UINT8 data = state->main_ram[offs];
UINT8 fore_color = state->colorram[offs & 0x1f9f] & 0x07;
- set_8_pixels(screen->machine, bitmap, y, x, data, pens, fore_color, 0);
+ set_8_pixels(screen->machine(), bitmap, y, x, data, pens, fore_color, 0);
}
- clear_extra_columns(screen->machine, bitmap, pens, 0);
+ clear_extra_columns(screen->machine(), bitmap, pens, 0);
return 0;
}
diff --git a/src/mame/video/88games.c b/src/mame/video/88games.c
index afd430be495..df975383057 100644
--- a/src/mame/video/88games.c
+++ b/src/mame/video/88games.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void _88games_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void _88games_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
*code |= ((*color & 0x0f) << 8) | (bank << 12);
*color = state->layer_colorbase[layer] + ((*color & 0xf0) >> 4);
@@ -24,9 +24,9 @@ void _88games_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void _88games_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void _88games_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
*priority = (*color & 0x20) >> 5; /* ??? */
*color = state->sprite_colorbase + (*color & 0x0f);
@@ -39,9 +39,9 @@ void _88games_sprite_callback( running_machine *machine, int *code, int *color,
***************************************************************************/
-void _88games_zoom_callback( running_machine *machine, int *code, int *color, int *flags )
+void _88games_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
*flags = (*color & 0x40) ? TILE_FLIPX : 0;
*code |= ((*color & 0x07) << 8);
@@ -56,7 +56,7 @@ void _88games_zoom_callback( running_machine *machine, int *code, int *color, in
SCREEN_UPDATE( 88games )
{
- _88games_state *state = screen->machine->driver_data<_88games_state>();
+ _88games_state *state = screen->machine().driver_data<_88games_state>();
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/actfancr.c b/src/mame/video/actfancr.c
index c700a575e7e..36c1fcd5125 100644
--- a/src/mame/video/actfancr.c
+++ b/src/mame/video/actfancr.c
@@ -11,9 +11,9 @@
/******************************************************************************/
-static void register_savestate( running_machine *machine )
+static void register_savestate( running_machine &machine )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
state->save_item(NAME(state->flipscreen));
}
@@ -26,15 +26,15 @@ VIDEO_START( actfancr )
SCREEN_UPDATE( actfancr )
{
- actfancr_state *state = screen->machine->driver_data<actfancr_state>();
+ actfancr_state *state = screen->machine().driver_data<actfancr_state>();
/* Draw playfield */
//state->flipscreen = state->control_2[0] & 0x80;
- //tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ //tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index 4aae104c8b0..2b2260cf38e 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -23,7 +23,7 @@
static TILE_GET_INFO( get_tile_info )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
UINT8 code = state->videoram[tile_index];
SET_TILE_INFO(
0,
@@ -42,7 +42,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( aeroboto )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 64);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
@@ -81,15 +81,15 @@ VIDEO_START( aeroboto )
READ8_HANDLER( aeroboto_in0_r )
{
- return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
+ return input_port_read(space->machine(), flip_screen_get(space->machine()) ? "P2" : "P1");
}
WRITE8_HANDLER( aeroboto_3000_w )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
/* bit 0 selects both flip screen and player1/player2 controls */
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
/* bit 1 = char bank select */
if (state->charbank != ((data & 0x02) >> 1))
@@ -104,7 +104,7 @@ WRITE8_HANDLER( aeroboto_3000_w )
WRITE8_HANDLER( aeroboto_videoram_w )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -112,7 +112,7 @@ WRITE8_HANDLER( aeroboto_videoram_w )
WRITE8_HANDLER( aeroboto_tilecolor_w )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
if (state->tilecolor[offset] != data)
{
@@ -129,9 +129,9 @@ WRITE8_HANDLER( aeroboto_tilecolor_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -145,7 +145,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = 240 - y;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
state->spriteram[offs + 1],
state->spriteram[offs + 2] & 0x07,
flip_screen_get(machine), flip_screen_get(machine),
@@ -156,7 +156,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( aeroboto )
{
- aeroboto_state *state = screen->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = screen->machine().driver_data<aeroboto_state>();
static const rectangle splitrect1 = { 0, 255, 0, 39 };
static const rectangle splitrect2 = { 0, 255, 40, 255 };
@@ -220,7 +220,7 @@ SCREEN_UPDATE( aeroboto )
tilemap_set_scrolly(state->bg_tilemap, 0, *state->vscroll);
tilemap_draw(bitmap, &splitrect2, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
// the status display behaves more closely to a 40-line splitscreen than an overlay
tilemap_set_scrolly(state->bg_tilemap, 0, 0);
diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c
index 13a5f74ebe1..3f39f3fe319 100644
--- a/src/mame/video/aerofgt.c
+++ b/src/mame/video/aerofgt.c
@@ -9,7 +9,7 @@
static TILE_GET_INFO( get_pspikes_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg1videoram[tile_index];
int bank = (code & 0x1000) >> 12;
SET_TILE_INFO(
@@ -21,7 +21,7 @@ static TILE_GET_INFO( get_pspikes_tile_info )
static TILE_GET_INFO( karatblz_bg1_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg1videoram[tile_index];
SET_TILE_INFO(
0,
@@ -33,7 +33,7 @@ static TILE_GET_INFO( karatblz_bg1_tile_info )
/* also spinlbrk */
static TILE_GET_INFO( karatblz_bg2_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg2videoram[tile_index];
SET_TILE_INFO(
1,
@@ -44,7 +44,7 @@ static TILE_GET_INFO( karatblz_bg2_tile_info )
static TILE_GET_INFO( spinlbrk_bg1_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg1videoram[tile_index];
SET_TILE_INFO(
0,
@@ -55,7 +55,7 @@ static TILE_GET_INFO( spinlbrk_bg1_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg1videoram[tile_index];
int bank = (code & 0x1800) >> 11;
SET_TILE_INFO(
@@ -67,7 +67,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
UINT16 code = state->bg2videoram[tile_index];
int bank = 4 + ((code & 0x1800) >> 11);
SET_TILE_INFO(
@@ -84,9 +84,9 @@ static TILE_GET_INFO( get_bg2_tile_info )
***************************************************************************/
-static void aerofgt_register_state_globals( running_machine *machine )
+static void aerofgt_register_state_globals( running_machine &machine )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->save_item(NAME(state->gfxbank));
state->save_item(NAME(state->bank));
state->save_item(NAME(state->bg1scrollx));
@@ -99,7 +99,7 @@ static void aerofgt_register_state_globals( running_machine *machine )
VIDEO_START( pspikes )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->bg1_tilemap = tilemap_create(machine, get_pspikes_tile_info,tilemap_scan_rows,8,8,64,32);
/* no bg2 in this game */
@@ -112,7 +112,7 @@ VIDEO_START( pspikes )
VIDEO_START( karatblz )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->bg1_tilemap = tilemap_create(machine, karatblz_bg1_tile_info,tilemap_scan_rows, 8,8,64,64);
state->bg2_tilemap = tilemap_create(machine, karatblz_bg2_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -125,7 +125,7 @@ VIDEO_START( karatblz )
VIDEO_START( spinlbrk )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int i;
state->bg1_tilemap = tilemap_create(machine, spinlbrk_bg1_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -139,7 +139,7 @@ VIDEO_START( spinlbrk )
/* sprite maps are hardcoded in this game */
/* enemy sprites use ROM instead of RAM */
- state->spriteram2 = (UINT16 *)machine->region("gfx5")->base();
+ state->spriteram2 = (UINT16 *)machine.region("gfx5")->base();
state->spriteram2_size = 0x20000;
/* front sprites are direct maps */
@@ -156,7 +156,7 @@ VIDEO_START( spinlbrk )
VIDEO_START( turbofrc )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -170,7 +170,7 @@ VIDEO_START( turbofrc )
VIDEO_START( wbbc97 )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->bg1_tilemap = tilemap_create(machine, get_pspikes_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
/* no bg2 in this game */
@@ -191,22 +191,22 @@ VIDEO_START( wbbc97 )
WRITE16_HANDLER( aerofgt_bg1videoram_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg1videoram[offset]);
tilemap_mark_tile_dirty(state->bg1_tilemap, offset);
}
WRITE16_HANDLER( aerofgt_bg2videoram_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg2videoram[offset]);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
}
-static void setbank( running_machine *machine, tilemap_t *tmap, int num, int bank )
+static void setbank( running_machine &machine, tilemap_t *tmap, int num, int bank )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
if (state->gfxbank[num] != bank)
{
state->gfxbank[num] = bank;
@@ -216,100 +216,100 @@ static void setbank( running_machine *machine, tilemap_t *tmap, int num, int ban
WRITE16_HANDLER( pspikes_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
- setbank(space->machine, state->bg1_tilemap, 0, (data & 0xf0) >> 4);
- setbank(space->machine, state->bg1_tilemap, 1, data & 0x0f);
+ setbank(space->machine(), state->bg1_tilemap, 0, (data & 0xf0) >> 4);
+ setbank(space->machine(), state->bg1_tilemap, 1, data & 0x0f);
}
}
WRITE16_HANDLER( pspikesb_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->rasterram[0x200 / 2]);
- setbank(space->machine, state->bg1_tilemap, 0, (data & 0xf000) >> 12);
- setbank(space->machine, state->bg1_tilemap, 1, (data & 0x0f00) >> 8);
+ setbank(space->machine(), state->bg1_tilemap, 0, (data & 0xf000) >> 12);
+ setbank(space->machine(), state->bg1_tilemap, 1, (data & 0x0f00) >> 8);
}
WRITE16_HANDLER( spikes91_lookup_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
state->spikes91_lookup = data & 1;
}
WRITE16_HANDLER( karatblz_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_8_15)
{
- setbank(space->machine, state->bg1_tilemap, 0, (data & 0x0100) >> 8);
- setbank(space->machine, state->bg2_tilemap, 1, (data & 0x0800) >> 11);
+ setbank(space->machine(), state->bg1_tilemap, 0, (data & 0x0100) >> 8);
+ setbank(space->machine(), state->bg2_tilemap, 1, (data & 0x0800) >> 11);
}
}
WRITE16_HANDLER( spinlbrk_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
- setbank(space->machine, state->bg1_tilemap, 0, (data & 0x07));
- setbank(space->machine, state->bg2_tilemap, 1, (data & 0x38) >> 3);
+ setbank(space->machine(), state->bg1_tilemap, 0, (data & 0x07));
+ setbank(space->machine(), state->bg2_tilemap, 1, (data & 0x38) >> 3);
}
}
WRITE16_HANDLER( turbofrc_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
tilemap_t *tmap = (offset == 0) ? state->bg1_tilemap : state->bg2_tilemap;
data = COMBINE_DATA(&state->bank[offset]);
- setbank(space->machine, tmap, 4 * offset + 0, (data >> 0) & 0x0f);
- setbank(space->machine, tmap, 4 * offset + 1, (data >> 4) & 0x0f);
- setbank(space->machine, tmap, 4 * offset + 2, (data >> 8) & 0x0f);
- setbank(space->machine, tmap, 4 * offset + 3, (data >> 12) & 0x0f);
+ setbank(space->machine(), tmap, 4 * offset + 0, (data >> 0) & 0x0f);
+ setbank(space->machine(), tmap, 4 * offset + 1, (data >> 4) & 0x0f);
+ setbank(space->machine(), tmap, 4 * offset + 2, (data >> 8) & 0x0f);
+ setbank(space->machine(), tmap, 4 * offset + 3, (data >> 12) & 0x0f);
}
WRITE16_HANDLER( aerofgt_gfxbank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
tilemap_t *tmap = (offset < 2) ? state->bg1_tilemap : state->bg2_tilemap;
data = COMBINE_DATA(&state->bank[offset]);
- setbank(space->machine, tmap, 2 * offset + 0, (data >> 8) & 0xff);
- setbank(space->machine, tmap, 2 * offset + 1, (data >> 0) & 0xff);
+ setbank(space->machine(), tmap, 2 * offset + 0, (data >> 8) & 0xff);
+ setbank(space->machine(), tmap, 2 * offset + 1, (data >> 0) & 0xff);
}
WRITE16_HANDLER( aerofgt_bg1scrollx_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg1scrollx);
}
WRITE16_HANDLER( aerofgt_bg1scrolly_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg1scrolly);
}
WRITE16_HANDLER( aerofgt_bg2scrollx_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg2scrollx);
}
WRITE16_HANDLER( aerofgt_bg2scrolly_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->bg2scrolly);
}
WRITE16_HANDLER( pspikes_palette_bank_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
state->spritepalettebank = data & 0x03;
@@ -323,7 +323,7 @@ WRITE16_HANDLER( pspikes_palette_bank_w )
WRITE16_HANDLER( wbbc97_bitmap_enable_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
COMBINE_DATA(&state->wbbc97_bitmap_enable);
}
@@ -333,9 +333,9 @@ WRITE16_HANDLER( wbbc97_bitmap_enable_w )
***************************************************************************/
-static void aerofgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void aerofgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int offs;
priority <<= 12;
@@ -390,7 +390,7 @@ static void aerofgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
else
code = state->spriteram2[map_start & 0x1fff] & 0x1fff;
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + (map_start >= 0x2000 ? 1 : 0)],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + (map_start >= 0x2000 ? 1 : 0)],
code,
color,
flipx,flipy,
@@ -404,9 +404,9 @@ static void aerofgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
}
}
-static void turbofrc_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
+static void turbofrc_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int attr_start, base, first;
base = chip * 0x0200;
first = 4 * state->spriteram3[0x1fe + base];
@@ -471,13 +471,13 @@ static void turbofrc_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
else
code = state->spriteram2[map_start % (state->spriteram2_size/2)];
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + chip],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + chip],
code,
color,
flipx,flipy,
sx,sy,
zoomx << 11, zoomy << 11,
- machine->priority_bitmap,pri ? 0 : 2,15);
+ machine.priority_bitmap,pri ? 0 : 2,15);
map_start++;
}
@@ -489,9 +489,9 @@ static void turbofrc_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void spinlbrk_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
+static void spinlbrk_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int attr_start, base, first;
base = chip * 0x0200;
first = 4 * state->spriteram3[0x1fe + base];
@@ -555,13 +555,13 @@ static void spinlbrk_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
else
code = state->spriteram2[map_start % (state->spriteram2_size/2)];
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + chip],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + chip],
code,
color,
flipx,flipy,
sx,sy,
zoomx << 11, zoomy << 11,
- machine->priority_bitmap,pri ? 2 : 0,15);
+ machine.priority_bitmap,pri ? 2 : 0,15);
map_start++;
}
@@ -573,9 +573,9 @@ static void spinlbrk_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void aerfboo2_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
+static void aerfboo2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int attr_start, base, first;
base = chip * 0x0200;
@@ -640,13 +640,13 @@ static void aerfboo2_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
else
code = state->spriteram2[map_start % (state->spriteram2_size/2)];
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + chip],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + chip],
code,
color,
flipx,flipy,
sx,sy,
zoomx << 11, zoomy << 11,
- machine->priority_bitmap,pri ? 0 : 2,15);
+ machine.priority_bitmap,pri ? 0 : 2,15);
map_start++;
}
@@ -658,9 +658,9 @@ static void aerfboo2_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void pspikesb_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void pspikesb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int i;
for (i = 4; i < state->spriteram3_size / 2; i += 4)
@@ -677,14 +677,14 @@ static void pspikesb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
flipx = state->spriteram3[i + 1] & 0x0800;
color = state->spriteram3[i + 1] & 0x000f;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx],
code,
color,
flipx,flipy,
xpos,ypos,15);
/* wrap around y */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx],
code,
color,
flipx,flipy,
@@ -693,12 +693,12 @@ static void pspikesb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void spikes91_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void spikes91_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int i;
UINT8 *lookup;
- lookup = machine->region("user1")->base();
+ lookup = machine.region("user1")->base();
state->spritepalettebank = 1;
for (i = state->spriteram3_size / 2 - 4; i >= 4; i -= 4)
@@ -720,14 +720,14 @@ static void spikes91_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
realcode = (lookup[code] << 8) + lookup[0x10000 + code];
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx],
realcode,
color,
flipx,flipy,
xpos,ypos,15);
/* wrap around y */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx],
realcode,
color,
flipx,flipy,
@@ -735,9 +735,9 @@ static void spikes91_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void aerfboot_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void aerfboot_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int attr_start, last;
last = ((state->rasterram[0x404 / 2] << 5) - 0x8000) / 2;
@@ -768,13 +768,13 @@ static void aerfboot_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sx = ((ox + 16 + 3) & 0x1ff) - 16;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + (code >= 0x1000 ? 0 : 1)],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + (code >= 0x1000 ? 0 : 1)],
code,
color,
flipx,flipy,
sx,sy,
zoomx << 11,zoomy << 11,
- machine->priority_bitmap,pri ? 0 : 2,15);
+ machine.priority_bitmap,pri ? 0 : 2,15);
}
@@ -806,20 +806,20 @@ static void aerfboot_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sx = ((ox + 16 + 3) & 0x1ff) - 16;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[state->sprite_gfx + (code >= 0x1000 ? 0 : 1)],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[state->sprite_gfx + (code >= 0x1000 ? 0 : 1)],
code,
color,
flipx,flipy,
sx,sy,
zoomx << 11,zoomy << 11,
- machine->priority_bitmap,pri ? 0 : 2,15);
+ machine.priority_bitmap,pri ? 0 : 2,15);
}
}
-static void wbbc97_draw_bitmap( running_machine *machine, bitmap_t *bitmap )
+static void wbbc97_draw_bitmap( running_machine &machine, bitmap_t *bitmap )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
int x, y, count;
count = 16; // weird, the bitmap doesn't start at 0?
@@ -840,7 +840,7 @@ static void wbbc97_draw_bitmap( running_machine *machine, bitmap_t *bitmap )
SCREEN_UPDATE( pspikes )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 256);
@@ -849,17 +849,17 @@ SCREEN_UPDATE( pspikes )
tilemap_set_scrollx(state->bg1_tilemap, (i + scrolly) & 0xff, state->rasterram[i]);
tilemap_set_scrolly(state->bg1_tilemap, 0, scrolly);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, -1);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0);
return 0;
}
SCREEN_UPDATE( pspikesb )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 256);
@@ -869,17 +869,17 @@ SCREEN_UPDATE( pspikesb )
tilemap_set_scrolly(state->bg1_tilemap, 0, scrolly);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- pspikesb_draw_sprites(screen->machine, bitmap, cliprect);
+ pspikesb_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( spikes91 )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
int y, x;
int count;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
tilemap_set_scroll_rows(state->bg1_tilemap, 256);
scrolly = state->bg1scrolly;
@@ -889,7 +889,7 @@ SCREEN_UPDATE( spikes91 )
tilemap_set_scrolly(state->bg1_tilemap, 0, scrolly);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- spikes91_draw_sprites(screen->machine, bitmap, cliprect);
+ spikes91_draw_sprites(screen->machine(), bitmap, cliprect);
/* we could use a tilemap, but it's easier to just do it here */
count = 0;
@@ -916,28 +916,28 @@ SCREEN_UPDATE( spikes91 )
SCREEN_UPDATE( karatblz )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
tilemap_set_scrollx(state->bg1_tilemap, 0, state->bg1scrollx - 8);
tilemap_set_scrolly(state->bg1_tilemap, 0, state->bg1scrolly);
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bg2scrollx - 4);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
/* we use the priority buffer so sprites are drawn front to back */
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 1, -1);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 1, 0);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, -1);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0);
return 0;
}
SCREEN_UPDATE( spinlbrk )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 512);
@@ -948,22 +948,22 @@ SCREEN_UPDATE( spinlbrk )
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bg2scrollx - 4);
// tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- spinlbrk_draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
- spinlbrk_draw_sprites(screen->machine, bitmap, cliprect, 0, -1);
- spinlbrk_draw_sprites(screen->machine, bitmap, cliprect, 1, 0);
- spinlbrk_draw_sprites(screen->machine, bitmap, cliprect, 1, -1);
+ spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0);
+ spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1);
+ spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0);
+ spinlbrk_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1);
return 0;
}
SCREEN_UPDATE( turbofrc )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 512);
@@ -975,45 +975,45 @@ SCREEN_UPDATE( turbofrc )
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bg2scrollx - 7);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly + 2);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 1, -1); //ship
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 1, 0); //intro
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, -1); //enemy
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, 0); //enemy
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); //ship
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); //intro
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); //enemy
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); //enemy
return 0;
}
SCREEN_UPDATE( aerofgt )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
tilemap_set_scrollx(state->bg1_tilemap, 0, state->rasterram[0x0000] - 18);
tilemap_set_scrolly(state->bg1_tilemap, 0, state->bg1scrolly);
tilemap_set_scrollx(state->bg2_tilemap, 0, state->rasterram[0x0200] - 20);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- aerofgt_draw_sprites(screen->machine, bitmap, cliprect, 0);
- aerofgt_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- aerofgt_draw_sprites(screen->machine, bitmap, cliprect, 2);
- aerofgt_draw_sprites(screen->machine, bitmap, cliprect, 3);
+ aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 2);
+ aerofgt_draw_sprites(screen->machine(), bitmap, cliprect, 3);
return 0;
}
SCREEN_UPDATE( aerfboot )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 512);
@@ -1024,19 +1024,19 @@ SCREEN_UPDATE( aerfboot )
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bg2scrollx + 172);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly + 2);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- aerfboot_draw_sprites(screen->machine, bitmap, cliprect);
+ aerfboot_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( aerfboo2 )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 512);
@@ -1048,22 +1048,22 @@ SCREEN_UPDATE( aerfboo2 )
tilemap_set_scrollx(state->bg2_tilemap, 0, state->bg2scrollx - 7);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg2scrolly + 2);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- aerfboo2_draw_sprites(screen->machine, bitmap, cliprect, 1, -1); //ship
- aerfboo2_draw_sprites(screen->machine, bitmap, cliprect, 1, 0); //intro
- aerfboo2_draw_sprites(screen->machine, bitmap, cliprect, 0, -1); //enemy
- aerfboo2_draw_sprites(screen->machine, bitmap, cliprect, 0, 0); //enemy
+ aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 1, -1); //ship
+ aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0); //intro
+ aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1); //enemy
+ aerfboo2_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0); //enemy
return 0;
}
SCREEN_UPDATE( wbbc97 )
{
- aerofgt_state *state = screen->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = screen->machine().driver_data<aerofgt_state>();
int i, scrolly;
tilemap_set_scroll_rows(state->bg1_tilemap, 256);
@@ -1072,11 +1072,11 @@ SCREEN_UPDATE( wbbc97 )
tilemap_set_scrollx(state->bg1_tilemap, (i + scrolly) & 0xff, state->rasterram[i]);
tilemap_set_scrolly(state->bg1_tilemap, 0, scrolly);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->wbbc97_bitmap_enable)
{
- wbbc97_draw_bitmap(screen->machine, bitmap);
+ wbbc97_draw_bitmap(screen->machine(), bitmap);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
}
else
@@ -1084,7 +1084,7 @@ SCREEN_UPDATE( wbbc97 )
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, TILEMAP_DRAW_OPAQUE, 0);
}
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, -1);
- turbofrc_draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, -1);
+ turbofrc_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/airbustr.c b/src/mame/video/airbustr.c
index d1e2bf51774..eae33365975 100644
--- a/src/mame/video/airbustr.c
+++ b/src/mame/video/airbustr.c
@@ -36,28 +36,28 @@
WRITE8_HANDLER( airbustr_videoram_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( airbustr_colorram_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( airbustr_videoram2_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( airbustr_colorram2_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -76,7 +76,7 @@ WRITE8_HANDLER( airbustr_colorram2_w )
WRITE8_HANDLER( airbustr_scrollregs_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
switch (offset) // offset 0 <-> port 4
{
case 0x00: state->fg_scrolly = data; break; // low 8 bits
@@ -96,7 +96,7 @@ WRITE8_HANDLER( airbustr_scrollregs_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
int attr = state->colorram2[tile_index];
int code = state->videoram2[tile_index] + ((attr & 0x0f) << 8);
int color = attr >> 4;
@@ -106,7 +106,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x0f) << 8);
int color = (attr >> 4) + 16;
@@ -116,12 +116,12 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
- state->sprites_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->sprites_bitmap = machine.primary_screen->alloc_compatible_bitmap();
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_set_scrolldx(state->bg_tilemap, 0x094, 0x06a);
@@ -135,7 +135,7 @@ VIDEO_START( airbustr )
SCREEN_UPDATE( airbustr )
{
- airbustr_state *state = screen->machine->driver_data<airbustr_state>();
+ airbustr_state *state = screen->machine().driver_data<airbustr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -148,7 +148,7 @@ SCREEN_UPDATE( airbustr )
SCREEN_EOF( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
// update the sprite bitmap
pandora_eof(state->pandora);
diff --git a/src/mame/video/ajax.c b/src/mame/video/ajax.c
index 25dd17850cf..d33d25c0e04 100644
--- a/src/mame/video/ajax.c
+++ b/src/mame/video/ajax.c
@@ -17,9 +17,9 @@
***************************************************************************/
-void ajax_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void ajax_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- ajax_state *state = machine->driver_data<ajax_state>();
+ ajax_state *state = machine.driver_data<ajax_state>();
*code |= ((*color & 0x0f) << 8) | (bank << 12);
*color = state->layer_colorbase[layer] + ((*color & 0xf0) >> 4);
}
@@ -31,7 +31,7 @@ void ajax_tile_callback( running_machine *machine, int layer, int bank, int *cod
***************************************************************************/
-void ajax_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void ajax_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
/* priority bits:
4 over zoom (0 = have priority)
@@ -39,7 +39,7 @@ void ajax_sprite_callback( running_machine *machine, int *code, int *color, int
6 over A (1 = have priority)
never over F
*/
- ajax_state *state = machine->driver_data<ajax_state>();
+ ajax_state *state = machine.driver_data<ajax_state>();
*priority = 0xff00; /* F = 8 */
if ( *color & 0x10) *priority |= 0xf0f0; /* Z = 4 */
if (~*color & 0x40) *priority |= 0xcccc; /* A = 2 */
@@ -54,9 +54,9 @@ void ajax_sprite_callback( running_machine *machine, int *code, int *color, int
***************************************************************************/
-void ajax_zoom_callback( running_machine *machine, int *code, int *color, int *flags )
+void ajax_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
- ajax_state *state = machine->driver_data<ajax_state>();
+ ajax_state *state = machine.driver_data<ajax_state>();
*code |= ((*color & 0x07) << 8);
*color = state->zoom_colorbase + ((*color & 0x08) >> 3);
}
@@ -70,7 +70,7 @@ void ajax_zoom_callback( running_machine *machine, int *code, int *color, int *f
VIDEO_START( ajax )
{
- ajax_state *state = machine->driver_data<ajax_state>();
+ ajax_state *state = machine.driver_data<ajax_state>();
state->layer_colorbase[0] = 64;
state->layer_colorbase[1] = 0;
@@ -89,13 +89,13 @@ VIDEO_START( ajax )
SCREEN_UPDATE( ajax )
{
- ajax_state *state = screen->machine->driver_data<ajax_state>();
+ ajax_state *state = screen->machine().driver_data<ajax_state>();
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 2, 0, 1);
if (state->priority)
{
diff --git a/src/mame/video/aliens.c b/src/mame/video/aliens.c
index cfbe1b62d95..711a5ef57b6 100644
--- a/src/mame/video/aliens.c
+++ b/src/mame/video/aliens.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void aliens_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void aliens_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- aliens_state *state = machine->driver_data<aliens_state>();
+ aliens_state *state = machine.driver_data<aliens_state>();
*code |= ((*color & 0x3f) << 8) | (bank << 14);
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
@@ -23,9 +23,9 @@ void aliens_tile_callback( running_machine *machine, int layer, int bank, int *c
***************************************************************************/
-void aliens_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask, int *shadow )
+void aliens_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask, int *shadow )
{
- aliens_state *state = machine->driver_data<aliens_state>();
+ aliens_state *state = machine.driver_data<aliens_state>();
/* The PROM allows for mixed priorities, where sprites would have */
/* priority over text but not on one or both of the other two planes. */
@@ -55,16 +55,16 @@ void aliens_sprite_callback( running_machine *machine, int *code, int *color, in
VIDEO_START( aliens )
{
- aliens_state *state = machine->driver_data<aliens_state>();
+ aliens_state *state = machine.driver_data<aliens_state>();
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400);
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 4;
state->layer_colorbase[2] = 8;
state->sprite_colorbase = 16;
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x400);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x400);
}
@@ -77,11 +77,11 @@ VIDEO_START( aliens )
SCREEN_UPDATE( aliens )
{
- aliens_state *state = screen->machine->driver_data<aliens_state>();
+ aliens_state *state = screen->machine().driver_data<aliens_state>();
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, state->layer_colorbase[1] * 16);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 1, 0, 1);
diff --git a/src/mame/video/alpha68k.c b/src/mame/video/alpha68k.c
index 9ef7e4fe0b7..3ea1987af4f 100644
--- a/src/mame/video/alpha68k.c
+++ b/src/mame/video/alpha68k.c
@@ -8,21 +8,21 @@
#include "includes/alpha68k.h"
-void alpha68k_flipscreen_w( running_machine *machine, int flip )
+void alpha68k_flipscreen_w( running_machine &machine, int flip )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->flipscreen = flip;
}
-void alpha68k_V_video_bank_w( running_machine *machine, int bank )
+void alpha68k_V_video_bank_w( running_machine &machine, int bank )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->bank_base = bank & 0xf;
}
WRITE16_HANDLER( alpha68k_paletteram_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int newword;
int r, g, b;
@@ -33,14 +33,14 @@ WRITE16_HANDLER( alpha68k_paletteram_w )
g = ((newword >> 3) & 0x1e) | ((newword >> 13) & 0x01);
b = ((newword << 1) & 0x1e) | ((newword >> 12) & 0x01);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
/******************************************************************************/
static TILE_GET_INFO( get_tile_info )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
int tile = state->videoram[2 * tile_index] & 0xff;
int color = state->videoram[2 * tile_index + 1] & 0x0f;
@@ -51,7 +51,7 @@ static TILE_GET_INFO( get_tile_info )
WRITE16_HANDLER( alpha68k_videoram_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
/* Doh. */
if(ACCESSING_BITS_0_7)
if(ACCESSING_BITS_8_15)
@@ -66,7 +66,7 @@ WRITE16_HANDLER( alpha68k_videoram_w )
VIDEO_START( alpha68k )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->fix_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fix_tilemap, 0);
@@ -75,9 +75,9 @@ VIDEO_START( alpha68k )
/******************************************************************************/
//AT
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
int offs, mx, my, color, tile, fx, fy, i;
@@ -112,7 +112,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
if (color)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tile,
color,
fx,fy,
@@ -130,20 +130,20 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( alpha68k_II )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
if (state->last_bank != state->bank_base)
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
state->last_bank = state->bank_base;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
bitmap_fill(bitmap, cliprect, 2047);
//AT
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0x07c0, 0x0800);
- draw_sprites(screen->machine, bitmap, cliprect, 1, 0x0000, 0x0800);
- draw_sprites(screen->machine, bitmap, cliprect, 2, 0x0000, 0x0800);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0x0000, 0x07c0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0);
//ZT
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
@@ -171,7 +171,7 @@ SCREEN_UPDATE( alpha68k_II )
WRITE16_HANDLER( alpha68k_II_video_bank_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
switch (offset)
{
case 0x10: /* Reset */
@@ -221,9 +221,9 @@ WRITE16_HANDLER( alpha68k_V_video_control_w )
}
}
-static void draw_sprites_V( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e, int fx_mask, int fy_mask, int sprite_mask )
+static void draw_sprites_V( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e, int fx_mask, int fy_mask, int sprite_mask )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
int offs, mx, my, color, tile, fx, fy, i;
@@ -261,7 +261,7 @@ static void draw_sprites_V( running_machine *machine, bitmap_t *bitmap, const re
}
if (color)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
tile,
color,
fx,fy,
@@ -277,39 +277,39 @@ static void draw_sprites_V( running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( alpha68k_V )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
if (state->last_bank != state->bank_base)
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
state->last_bank = state->bank_base;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
bitmap_fill(bitmap, cliprect, 4095);
/* This appears to be correct priority */
if (state->microcontroller_id == 0x8814) /* Sky Adventure */
{
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
//AT: *KLUDGE* fixes priest priority in level 1(could be a game bug)
if (spriteram[0x1bde] == 0x24 && (spriteram[0x1bdf] >> 8) == 0x3b)
{
- draw_sprites_V(screen->machine, bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x03c0, 0x0800, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x03c0, 0, 0x8000, 0x7fff);
}
else
- draw_sprites_V(screen->machine, bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0, 0x8000, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0, 0x8000, 0x7fff);
}
else /* gangwars */
{
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x8000, 0, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x8000, 0, 0x7fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x8000, 0, 0x7fff);
}
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
@@ -318,21 +318,21 @@ SCREEN_UPDATE( alpha68k_V )
SCREEN_UPDATE( alpha68k_V_sb )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
if (state->last_bank != state->bank_base)
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
state->last_bank = state->bank_base;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
bitmap_fill(bitmap, cliprect, 4095);
/* This appears to be correct priority */
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
- draw_sprites_V(screen->machine, bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 1, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 2, 0x0000, 0x0800, 0x4000, 0x8000, 0x3fff);
+ draw_sprites_V(screen->machine(), bitmap, cliprect, 0, 0x0000, 0x07c0, 0x4000, 0x8000, 0x3fff);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
@@ -340,13 +340,13 @@ SCREEN_UPDATE( alpha68k_V_sb )
/******************************************************************************/
//AT
-static void draw_sprites_I( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d, int yshift )
+static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d, int yshift )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
int data, offs, mx, my, tile, color, fy, i;
- UINT8 *color_prom = machine->region("user1")->base();
- gfx_element *gfx = machine->gfx[0];
+ UINT8 *color_prom = machine.region("user1")->base();
+ gfx_element *gfx = machine.gfx[0];
for (offs = 0; offs < 0x400; offs += 0x20)
{
@@ -370,15 +370,15 @@ static void draw_sprites_I( running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( alpha68k_I )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
int yshift = (state->microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* This appears to be correct priority */
- draw_sprites_I(screen->machine, bitmap, cliprect, 2, 0x0800, yshift);
- draw_sprites_I(screen->machine, bitmap, cliprect, 3, 0x0c00, yshift);
- draw_sprites_I(screen->machine, bitmap, cliprect, 1, 0x0400, yshift);
+ draw_sprites_I(screen->machine(), bitmap, cliprect, 2, 0x0800, yshift);
+ draw_sprites_I(screen->machine(), bitmap, cliprect, 3, 0x0c00, yshift);
+ draw_sprites_I(screen->machine(), bitmap, cliprect, 1, 0x0400, yshift);
return 0;
}
//ZT
@@ -389,7 +389,7 @@ PALETTE_INIT( kyros )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -398,7 +398,7 @@ PALETTE_INIT( kyros )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -407,7 +407,7 @@ PALETTE_INIT( kyros )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = ((color_prom[i] & 0x0f) << 4) | (color_prom[i + 0x100] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -416,7 +416,7 @@ PALETTE_INIT( paddlem )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -425,7 +425,7 @@ PALETTE_INIT( paddlem )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -434,7 +434,7 @@ PALETTE_INIT( paddlem )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = ((color_prom[i + 0x400] & 0x0f) << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -448,13 +448,13 @@ static void jongbou_video_banking(int *bank, int data)
*bank = (data >> 11 & 4) | (data >> 10 & 3);
}
-static void kyros_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
+static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
int offs, mx, my, color, tile, i, bank, fy, fx;
int data;
- UINT8 *color_prom = machine->region("user1")->base();
+ UINT8 *color_prom = machine.region("user1")->base();
//AT
for (offs = 0; offs < 0x400; offs += 0x20)
@@ -489,7 +489,7 @@ static void kyros_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
else
jongbou_video_banking(&bank, data);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], tile, color, fx, fy, mx, my, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], tile, color, fx, fy, mx, my, 0);
}
}
//ZT
@@ -503,22 +503,22 @@ static void kyros_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( kyros )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
- colortable_entry_set_value(screen->machine->colortable, 0x100, *state->videoram & 0xff);
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
+ colortable_entry_set_value(screen->machine().colortable, 0x100, *state->videoram & 0xff);
bitmap_fill(bitmap, cliprect, 0x100); //AT
- kyros_draw_sprites(screen->machine, bitmap, cliprect, 2, 0x0800);
- kyros_draw_sprites(screen->machine, bitmap, cliprect, 3, 0x0c00);
- kyros_draw_sprites(screen->machine, bitmap, cliprect, 1, 0x0400);
+ kyros_draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0800);
+ kyros_draw_sprites(screen->machine(), bitmap, cliprect, 3, 0x0c00);
+ kyros_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0400);
return 0;
}
/******************************************************************************/
-static void sstingry_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
+static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
{
//AT
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
UINT16 *spriteram = state->spriteram;
int data, offs, mx, my, color, tile, i, bank, fy, fx;
@@ -550,7 +550,7 @@ static void sstingry_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
color = (data >> 7 & 0x18) | (data >> 13 & 7);
tile = data & 0x3ff;
bank = data >> 10 & 3;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], tile, color, fx, fy, mx, my, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], tile, color, fx, fy, mx, my, 0);
}
//ZT
if(state->flipscreen)
@@ -563,12 +563,12 @@ static void sstingry_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( sstingry )
{
- alpha68k_state *state = screen->machine->driver_data<alpha68k_state>();
- colortable_entry_set_value(screen->machine->colortable, 0x100, *state->videoram & 0xff);
+ alpha68k_state *state = screen->machine().driver_data<alpha68k_state>();
+ colortable_entry_set_value(screen->machine().colortable, 0x100, *state->videoram & 0xff);
bitmap_fill(bitmap, cliprect, 0x100); //AT
- sstingry_draw_sprites(screen->machine, bitmap, cliprect, 2, 0x0800);
- sstingry_draw_sprites(screen->machine, bitmap, cliprect, 3, 0x0c00);
- sstingry_draw_sprites(screen->machine, bitmap, cliprect, 1, 0x0400);
+ sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 2, 0x0800);
+ sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 3, 0x0c00);
+ sstingry_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x0400);
return 0;
}
diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c
index 121d0646cdb..1b0a757e68f 100644
--- a/src/mame/video/ambush.c
+++ b/src/mame/video/ambush.c
@@ -22,7 +22,7 @@ PALETTE_INIT( ambush )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -47,9 +47,9 @@ PALETTE_INIT( ambush )
}
-static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- ambush_state *state = machine->driver_data<ambush_state>();
+ ambush_state *state = machine.driver_data<ambush_state>();
int offs, transpen;
transpen = (priority == 0) ? -1 : 0;
@@ -78,7 +78,7 @@ static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectan
scroll = ~scroll - 1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
(col & 0x0f) | ((*state->colorbank & 0x03) << 4),
flip_screen_get(machine), flip_screen_get(machine),
@@ -89,13 +89,13 @@ static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( ambush )
{
- ambush_state *state = screen->machine->driver_data<ambush_state>();
+ ambush_state *state = screen->machine().driver_data<ambush_state>();
int offs;
bitmap_fill(bitmap, cliprect, 0);
/* Draw the characters */
- draw_chars(screen->machine, bitmap, cliprect, 0x00);
+ draw_chars(screen->machine(), bitmap, cliprect, 0x00);
/* Draw the sprites. */
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -119,7 +119,7 @@ SCREEN_UPDATE( ambush )
/* 16x16 sprites */
gfx = 1;
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
sy = 240 - sy;
else
sx = 240 - sx;
@@ -130,7 +130,7 @@ SCREEN_UPDATE( ambush )
gfx = 0;
code <<= 2;
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
sy = 248 - sy;
else
sx = 248 - sx;
@@ -140,19 +140,19 @@ SCREEN_UPDATE( ambush )
flipx = state->spriteram[offs + 1] & 0x40;
flipy = state->spriteram[offs + 1] & 0x80;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
flipx = !flipx;
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx],
code, col | ((*state->colorbank & 0x03) << 4),
flipx, flipy,
sx,sy,0);
}
/* Draw the foreground priority characters over the sprites */
- draw_chars(screen->machine, bitmap, cliprect, 0x10);
+ draw_chars(screen->machine(), bitmap, cliprect, 0x10);
return 0;
}
diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c
index 385c91e3518..7518b48d213 100644
--- a/src/mame/video/amiga.c
+++ b/src/mame/video/amiga.c
@@ -112,7 +112,7 @@ PALETTE_INIT( amiga )
VIDEO_START( amiga )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
int j;
/* generate tables that produce the correct playfield color for dual playfield mode */
@@ -145,9 +145,9 @@ VIDEO_START( amiga )
UINT32 amiga_gethvpos(screen_device &screen)
{
- amiga_state *state = screen.machine->driver_data<amiga_state>();
+ amiga_state *state = screen.machine().driver_data<amiga_state>();
UINT32 hvpos = (state->last_scanline << 8) | (screen.hpos() >> 2);
- UINT32 latchedpos = input_port_read_safe(screen.machine, "HVPOS", 0);
+ UINT32 latchedpos = input_port_read_safe(screen.machine(), "HVPOS", 0);
/* if there's no latched position, or if we are in the active display area */
/* but before the latching point, return the live HV position */
@@ -166,9 +166,9 @@ UINT32 amiga_gethvpos(screen_device &screen)
*
*************************************/
-void amiga_set_genlock_color(running_machine *machine, UINT16 color)
+void amiga_set_genlock_color(running_machine &machine, UINT16 color)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
state->genlock_color = color;
}
@@ -181,9 +181,9 @@ void amiga_set_genlock_color(running_machine *machine, UINT16 color)
*
*************************************/
-void amiga_copper_setpc(running_machine *machine, UINT32 pc)
+void amiga_copper_setpc(running_machine &machine, UINT32 pc)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
if (LOG_COPPER)
logerror("copper_setpc(%06x)\n", pc);
@@ -193,9 +193,9 @@ void amiga_copper_setpc(running_machine *machine, UINT32 pc)
}
-int amiga_copper_execute_next(running_machine *machine, int xpos)
+int amiga_copper_execute_next(running_machine &machine, int xpos)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
int word0, word1;
/* bail if not enabled */
@@ -207,7 +207,7 @@ int amiga_copper_execute_next(running_machine *machine, int xpos)
{
if (LOG_COPPER)
logerror("%02X.%02X: Write to %s = %04x\n", state->last_scanline, xpos / 2, amiga_custom_names[state->copper_pending_offset & 0xff], state->copper_pending_data);
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), state->copper_pending_offset, state->copper_pending_data, 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), state->copper_pending_offset, state->copper_pending_data, 0xffff);
state->copper_pending_offset = 0;
}
@@ -263,7 +263,7 @@ int amiga_copper_execute_next(running_machine *machine, int xpos)
{
if (LOG_COPPER)
logerror("%02X.%02X: Write to %s = %04x\n", state->last_scanline, xpos / 2, amiga_custom_names[word0 & 0xff], word1);
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), word0, word1, 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), word0, word1, 0xffff);
}
else // additional 2 cycles needed for non-Agnus registers
{
@@ -335,9 +335,9 @@ int amiga_copper_execute_next(running_machine *machine, int xpos)
*
*************************************/
-void amiga_sprite_dma_reset(running_machine *machine, int which)
+void amiga_sprite_dma_reset(running_machine &machine, int which)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
if (LOG_SPRITE_DMA) logerror("sprite %d dma reset\n", which );
state->sprite_dma_reload_mask |= 1 << which;
@@ -345,9 +345,9 @@ void amiga_sprite_dma_reset(running_machine *machine, int which)
}
-void amiga_sprite_enable_comparitor(running_machine *machine, int which, int enable)
+void amiga_sprite_enable_comparitor(running_machine &machine, int which, int enable)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
if (LOG_SPRITE_DMA) logerror("sprite %d comparitor %sable\n", which, enable ? "en" : "dis" );
if (enable)
@@ -619,9 +619,9 @@ INLINE int update_ham(amiga_state *state, int newpix)
*
*************************************/
-void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline)
+void amiga_render_scanline(running_machine &machine, bitmap_t *bitmap, int scanline)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
UINT16 save_color0 = CUSTOM_REG(REG_COLOR00);
int ddf_start_pixel = 0, ddf_stop_pixel = 0;
int hires = 0, dualpf = 0, lace = 0, ham = 0;
@@ -944,7 +944,7 @@ void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanl
}
#if 0
- if ( machine->primary_screen->frame_number() % 64 == 0 && scanline == 100 )
+ if ( machine.primary_screen->frame_number() % 64 == 0 && scanline == 100 )
{
const char *m_lores = "LORES";
const char *m_hires = "HIRES";
@@ -981,7 +981,7 @@ void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanl
CUSTOM_REG(REG_COLOR00) = save_color0;
#if GUESS_COPPER_OFFSET
- if (machine->primary_screen->frame_number() % 64 == 0 && scanline == 0)
+ if (machine.primary_screen->frame_number() % 64 == 0 && scanline == 0)
{
if (input_code_pressed(machine, KEYCODE_Q))
popmessage("%d", state->wait_offset -= 1);
@@ -1005,7 +1005,7 @@ SCREEN_UPDATE( amiga )
/* render each scanline in the visible region */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
- amiga_render_scanline(screen->machine, bitmap, y);
+ amiga_render_scanline(screen->machine(), bitmap, y);
return 0;
}
diff --git a/src/mame/video/amigaaga.c b/src/mame/video/amigaaga.c
index dec912cee0b..aa16e29af4c 100644
--- a/src/mame/video/amigaaga.c
+++ b/src/mame/video/amigaaga.c
@@ -34,9 +34,9 @@ To do:
*
*************************************/
-void amiga_aga_palette_write(running_machine *machine, int color_reg, UINT16 data)
+void amiga_aga_palette_write(running_machine &machine, int color_reg, UINT16 data)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
pen_t *aga_palette = state->aga_palette;
int r,g,b;
int cr,cg,cb;
@@ -73,7 +73,7 @@ void amiga_aga_palette_write(running_machine *machine, int color_reg, UINT16 dat
VIDEO_START( amiga_aga )
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
VIDEO_START_CALL( amiga );
@@ -400,9 +400,9 @@ INLINE void fetch_bitplane_data(amiga_state *state, int plane)
}
}
-void amiga_aga_diwhigh_written(running_machine *machine, int written)
+void amiga_aga_diwhigh_written(running_machine &machine, int written)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
state->aga_diwhigh_written = written;
}
@@ -444,9 +444,9 @@ INLINE int update_ham(amiga_state *state, int newpix)
*
*************************************/
-void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline)
+void amiga_aga_render_scanline(running_machine &machine, bitmap_t *bitmap, int scanline)
{
- amiga_state *state = machine->driver_data<amiga_state>();
+ amiga_state *state = machine.driver_data<amiga_state>();
UINT16 save_color0 = CUSTOM_REG(REG_COLOR00);
int ddf_start_pixel = 0, ddf_stop_pixel = 0;
int hires = 0, dualpf = 0, lace = 0, ham = 0;
@@ -804,7 +804,7 @@ void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int s
}
#if 0
- if ( machine->primary_screen->frame_number() % 16 == 0 && scanline == 250 )
+ if ( machine.primary_screen->frame_number() % 16 == 0 && scanline == 250 )
{
const char *m_lores = "LORES";
const char *m_hires = "HIRES";
@@ -842,7 +842,7 @@ void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int s
CUSTOM_REG(REG_COLOR00) = save_color0;
#if GUESS_COPPER_OFFSET
- if (machine->primary_screen->frame_number() % 64 == 0 && scanline == 0)
+ if (machine.primary_screen->frame_number() % 64 == 0 && scanline == 0)
{
if (input_code_pressed(machine, KEYCODE_Q))
popmessage("%d", wait_offset -= 1);
@@ -866,7 +866,7 @@ SCREEN_UPDATE( amiga_aga )
/* render each scanline in the visible region */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
- amiga_aga_render_scanline(screen->machine, bitmap, y);
+ amiga_aga_render_scanline(screen->machine(), bitmap, y);
return 0;
}
diff --git a/src/mame/video/ampoker2.c b/src/mame/video/ampoker2.c
index 909283a5f6a..1afbfbf8b98 100644
--- a/src/mame/video/ampoker2.c
+++ b/src/mame/video/ampoker2.c
@@ -88,7 +88,7 @@ PALETTE_INIT( ampoker2 )
2, resistances_b, weights_b, 0, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -113,7 +113,7 @@ PALETTE_INIT( ampoker2 )
WRITE8_HANDLER( ampoker2_videoram_w )
{
- ampoker2_state *state = space->machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = space->machine().driver_data<ampoker2_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -121,7 +121,7 @@ WRITE8_HANDLER( ampoker2_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- ampoker2_state *state = machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = machine.driver_data<ampoker2_state>();
UINT8 *videoram = state->videoram;
int offs = tile_index * 2;
int attr = videoram[offs + 1];
@@ -135,7 +135,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( s2k_get_bg_tile_info )
{
- ampoker2_state *state = machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = machine.driver_data<ampoker2_state>();
UINT8 *videoram = state->videoram;
int offs = tile_index * 2;
int attr = videoram[offs + 1];
@@ -149,21 +149,21 @@ static TILE_GET_INFO( s2k_get_bg_tile_info )
VIDEO_START(ampoker2)
{
- ampoker2_state *state = machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = machine.driver_data<ampoker2_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 64, 32);
}
VIDEO_START(sigma2k)
{
- ampoker2_state *state = machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = machine.driver_data<ampoker2_state>();
state->bg_tilemap = tilemap_create(machine, s2k_get_bg_tile_info, tilemap_scan_rows,
8, 8, 64, 32);
}
SCREEN_UPDATE(ampoker2)
{
- ampoker2_state *state = screen->machine->driver_data<ampoker2_state>();
+ ampoker2_state *state = screen->machine().driver_data<ampoker2_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/amspdwy.c b/src/mame/video/amspdwy.c
index 02519433446..388416b0919 100644
--- a/src/mame/video/amspdwy.c
+++ b/src/mame/video/amspdwy.c
@@ -25,9 +25,9 @@ WRITE8_HANDLER( amspdwy_paletteram_w )
WRITE8_HANDLER( amspdwy_flipscreen_w )
{
- amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
state->flipscreen ^= 1;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
}
/***************************************************************************
@@ -45,7 +45,7 @@ WRITE8_HANDLER( amspdwy_flipscreen_w )
static TILE_GET_INFO( get_tile_info )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
UINT8 code = state->videoram[tile_index];
UINT8 color = state->colorram[tile_index];
SET_TILE_INFO(
@@ -57,14 +57,14 @@ static TILE_GET_INFO( get_tile_info )
WRITE8_HANDLER( amspdwy_videoram_w )
{
- amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( amspdwy_colorram_w )
{
- amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -79,7 +79,7 @@ static TILEMAP_MAPPER( tilemap_scan_cols_back )
VIDEO_START( amspdwy )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols_back, 8, 8, 0x20, 0x20);
}
@@ -103,13 +103,13 @@ Offset: Format: Value:
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
UINT8 *spriteram = state->spriteram;
int i;
- int max_x = machine->primary_screen->width() - 1;
- int max_y = machine->primary_screen->height() - 1;
+ int max_x = machine.primary_screen->width() - 1;
+ int max_y = machine.primary_screen->height() - 1;
for (i = 0; i < state->spriteram_size ; i += 4)
{
@@ -128,7 +128,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
// code + ((attr & 0x18)<<5),
code + ((attr & 0x08)<<5),
attr,
@@ -148,8 +148,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( amspdwy )
{
- amspdwy_state *state = screen->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = screen->machine().driver_data<amspdwy_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/angelkds.c b/src/mame/video/angelkds.c
index 4b21fabb249..aabaeed25dd 100644
--- a/src/mame/video/angelkds.c
+++ b/src/mame/video/angelkds.c
@@ -16,7 +16,7 @@ enable / disable tilemap bits might be wrong
static TILE_GET_INFO( get_tx_tile_info )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
int tileno;
tileno = state->txvideoram[tile_index] + (state->txbank * 0x100);
@@ -25,7 +25,7 @@ static TILE_GET_INFO( get_tx_tile_info )
WRITE8_HANDLER( angelkds_txvideoram_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -33,7 +33,7 @@ WRITE8_HANDLER( angelkds_txvideoram_w )
WRITE8_HANDLER( angelkds_txbank_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
if (state->txbank != data)
{
@@ -48,7 +48,7 @@ WRITE8_HANDLER( angelkds_txbank_write )
static TILE_GET_INFO( get_bgtop_tile_info )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
int tileno;
tileno = state->bgtopvideoram[tile_index];
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_bgtop_tile_info )
WRITE8_HANDLER( angelkds_bgtopvideoram_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->bgtopvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bgtop_tilemap, offset);
@@ -67,7 +67,7 @@ WRITE8_HANDLER( angelkds_bgtopvideoram_w )
WRITE8_HANDLER( angelkds_bgtopbank_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
if (state->bgtopbank != data)
{
@@ -78,7 +78,7 @@ WRITE8_HANDLER( angelkds_bgtopbank_write )
WRITE8_HANDLER( angelkds_bgtopscroll_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
tilemap_set_scrollx(state->bgtop_tilemap, 0, data);
}
@@ -89,7 +89,7 @@ WRITE8_HANDLER( angelkds_bgtopscroll_write )
static TILE_GET_INFO( get_bgbot_tile_info )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
int tileno;
tileno = state->bgbotvideoram[tile_index];
@@ -100,7 +100,7 @@ static TILE_GET_INFO( get_bgbot_tile_info )
WRITE8_HANDLER( angelkds_bgbotvideoram_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->bgbotvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bgbot_tilemap, offset);
@@ -109,7 +109,7 @@ WRITE8_HANDLER( angelkds_bgbotvideoram_w )
WRITE8_HANDLER( angelkds_bgbotbank_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
if (state->bgbotbank != data)
{
@@ -120,7 +120,7 @@ WRITE8_HANDLER( angelkds_bgbotbank_write )
WRITE8_HANDLER( angelkds_bgbotscroll_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
tilemap_set_scrollx(state->bgbot_tilemap, 0, data);
}
@@ -128,7 +128,7 @@ WRITE8_HANDLER( angelkds_bgbotscroll_write )
WRITE8_HANDLER( angelkds_layer_ctrl_write )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->layer_ctrl = data;
}
@@ -140,12 +140,12 @@ a split down the middle of the screen
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int enable_n)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int enable_n)
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
const UINT8 *source = state->spriteram + 0x100 - 4;
const UINT8 *finish = state->spriteram;
- const gfx_element *gfx = machine->gfx[3];
+ const gfx_element *gfx = machine.gfx[3];
while (source >= finish)
{
@@ -243,13 +243,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
WRITE8_HANDLER( angelkds_paletteram_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
int no;
state->paletteram[offset] = data;
no = offset & 0xff;
- palette_set_color_rgb(space->machine, no, pal4bit(state->paletteram[no]), pal4bit(state->paletteram[no]>>4), pal4bit(state->paletteram[no + 0x100]));
+ palette_set_color_rgb(space->machine(), no, pal4bit(state->paletteram[no]), pal4bit(state->paletteram[no]>>4), pal4bit(state->paletteram[no + 0x100]));
}
/*** Video Start & Update
@@ -258,7 +258,7 @@ WRITE8_HANDLER( angelkds_paletteram_w )
VIDEO_START( angelkds )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->tx_tilemap, 0);
@@ -274,7 +274,7 @@ VIDEO_START( angelkds )
SCREEN_UPDATE( angelkds )
{
- angelkds_state *state = screen->machine->driver_data<angelkds_state>();
+ angelkds_state *state = screen->machine().driver_data<angelkds_state>();
const rectangle &visarea = screen->visible_area();
rectangle clip;
@@ -289,7 +289,7 @@ SCREEN_UPDATE( angelkds )
if ((state->layer_ctrl & 0x80) == 0x00)
tilemap_draw(bitmap, &clip, state->bgtop_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, &clip, 0x80);
+ draw_sprites(screen->machine(), bitmap, &clip, 0x80);
if ((state->layer_ctrl & 0x20) == 0x00)
tilemap_draw(bitmap, &clip, state->tx_tilemap, 0, 0);
@@ -303,7 +303,7 @@ SCREEN_UPDATE( angelkds )
if ((state->layer_ctrl & 0x40) == 0x00)
tilemap_draw(bitmap, &clip, state->bgbot_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, &clip, 0x40);
+ draw_sprites(screen->machine(), bitmap, &clip, 0x40);
if ((state->layer_ctrl & 0x20) == 0x00)
tilemap_draw(bitmap, &clip, state->tx_tilemap, 0, 0);
diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c
index 08bf963bf87..2e2c29fa177 100644
--- a/src/mame/video/antic.c
+++ b/src/mame/video/antic.c
@@ -90,7 +90,7 @@ READ8_HANDLER ( atari_antic_r )
data = antic.r.antic09;
break;
case 10: /* WSYNC read */
- device_spin_until_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC);
+ device_spin_until_trigger(space->machine().device("maincpu"), TRIGGER_HSYNC);
antic.w.wsync = 1;
data = antic.r.antic0a;
break;
@@ -200,7 +200,7 @@ WRITE8_HANDLER ( atari_antic_w )
break;
case 10: /* WSYNC write */
LOG(("ANTIC 0A write WSYNC $%02X\n", data));
- device_spin_until_trigger(space->machine->device("maincpu"), TRIGGER_HSYNC);
+ device_spin_until_trigger(space->machine().device("maincpu"), TRIGGER_HSYNC);
antic.w.wsync = 1;
break;
case 11:
diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c
index b9113974b56..6f1c7b65eff 100644
--- a/src/mame/video/appoooh.c
+++ b/src/mame/video/appoooh.c
@@ -24,7 +24,7 @@ PALETTE_INIT( appoooh )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen;
int bit0, bit1, bit2, r, g, b;
@@ -62,7 +62,7 @@ PALETTE_INIT( robowres )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -100,7 +100,7 @@ PALETTE_INIT( robowres )
static TILE_GET_INFO( get_fg_tile_info )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
int code = state->fg_videoram[tile_index] + 256 * ((state->fg_colorram[tile_index] >> 5) & 7);
SET_TILE_INFO(
@@ -113,7 +113,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
int code = state->bg_videoram[tile_index] + 256 * ((state->bg_colorram[tile_index] >> 5) & 7);
SET_TILE_INFO(
@@ -132,7 +132,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( appoooh )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -147,47 +147,47 @@ VIDEO_START( appoooh )
WRITE8_HANDLER( appoooh_scroll_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->scroll_x = data;
}
WRITE8_HANDLER( appoooh_fg_videoram_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( appoooh_fg_colorram_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->fg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( appoooh_bg_videoram_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( appoooh_bg_colorram_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->bg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( appoooh_out_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
/* bit 0 controls NMI */
interrupt_enable_w(space,0,data & 0x01);
/* bit 1 flip screen */
- flip_screen_set(space->machine, data & 0x02);
+ flip_screen_set(space->machine(), data & 0x02);
/* bits 2-3 unknown */
@@ -199,9 +199,9 @@ WRITE8_HANDLER( appoooh_out_w )
/* bit 6 ROM bank select */
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&RAM[data&0x40 ? 0x10000 : 0x0a000]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[data&0x40 ? 0x10000 : 0x0a000]);
}
/* bit 7 unknown (used) */
@@ -210,7 +210,7 @@ WRITE8_HANDLER( appoooh_out_w )
static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect, const gfx_element *gfx, UINT8 *sprite )
{
int offs;
- int flipy = flip_screen_get(gfx->machine);
+ int flipy = flip_screen_get(gfx->machine());
for (offs = 0x20 - 4; offs >= 0; offs -= 4)
{
@@ -241,7 +241,7 @@ static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect,
static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect, const gfx_element *gfx, UINT8 *sprite )
{
int offs;
- int flipy = flip_screen_get(gfx->machine);
+ int flipy = flip_screen_get(gfx->machine());
for (offs = 0x20 - 4; offs >= 0; offs -= 4)
{
@@ -272,7 +272,7 @@ static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect
SCREEN_UPDATE( appoooh )
{
- appoooh_state *state = screen->machine->driver_data<appoooh_state>();
+ appoooh_state *state = screen->machine().driver_data<appoooh_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if (state->priority == 0) /* fg behind sprites */
@@ -282,16 +282,16 @@ SCREEN_UPDATE( appoooh )
if (state->priority == 1)
{
/* sprite set #1 */
- appoooh_draw_sprites(bitmap, cliprect, screen->machine->gfx[2], state->spriteram);
+ appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->spriteram);
/* sprite set #2 */
- appoooh_draw_sprites(bitmap, cliprect, screen->machine->gfx[3], state->spriteram_2);
+ appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->spriteram_2);
}
else
{
/* sprite set #2 */
- appoooh_draw_sprites(bitmap, cliprect, screen->machine->gfx[3], state->spriteram_2);
+ appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->spriteram_2);
/* sprite set #1 */
- appoooh_draw_sprites(bitmap, cliprect, screen->machine->gfx[2], state->spriteram);
+ appoooh_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->spriteram);
}
if (state->priority != 0) /* fg in front of sprites */
@@ -302,7 +302,7 @@ SCREEN_UPDATE( appoooh )
SCREEN_UPDATE( robowres )
{
- appoooh_state *state = screen->machine->driver_data<appoooh_state>();
+ appoooh_state *state = screen->machine().driver_data<appoooh_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if (state->priority == 0) /* fg behind sprites */
@@ -312,16 +312,16 @@ SCREEN_UPDATE( robowres )
if (state->priority == 1)
{
/* sprite set #1 */
- robowres_draw_sprites(bitmap, cliprect, screen->machine->gfx[2], state->spriteram);
+ robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->spriteram);
/* sprite set #2 */
- robowres_draw_sprites(bitmap, cliprect, screen->machine->gfx[3], state->spriteram_2);
+ robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->spriteram_2);
}
else
{
/* sprite set #2 */
- robowres_draw_sprites(bitmap, cliprect, screen->machine->gfx[3], state->spriteram_2);
+ robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[3], state->spriteram_2);
/* sprite set #1 */
- robowres_draw_sprites(bitmap, cliprect, screen->machine->gfx[2], state->spriteram);
+ robowres_draw_sprites(bitmap, cliprect, screen->machine().gfx[2], state->spriteram);
}
if (state->priority != 0) /* fg in front of sprites */
diff --git a/src/mame/video/aquarium.c b/src/mame/video/aquarium.c
index 901eaee21be..175f19dbdeb 100644
--- a/src/mame/video/aquarium.c
+++ b/src/mame/video/aquarium.c
@@ -4,9 +4,9 @@
#include "includes/aquarium.h"
/* gcpinbal.c modified */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
int offs, chain_pos;
int x, y, curx, cury;
UINT8 col, flipx, flipy, chain;
@@ -43,14 +43,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
for (chain_pos = chain; chain_pos >= 0; chain_pos--)
{
- drawgfx_transpen(bitmap, cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect,machine.gfx[0],
code,
col,
flipx, flipy,
curx,cury,0);
/* wrap around y */
- drawgfx_transpen(bitmap, cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect,machine.gfx[0],
code,
col,
flipx, flipy,
@@ -88,7 +88,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
/* TXT Layer */
static TILE_GET_INFO( get_aquarium_txt_tile_info )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
int tileno, colour;
tileno = (state->txt_videoram[tile_index] & 0x0fff);
@@ -98,7 +98,7 @@ static TILE_GET_INFO( get_aquarium_txt_tile_info )
WRITE16_HANDLER( aquarium_txt_videoram_w )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
state->txt_videoram[offset] = data;
tilemap_mark_tile_dirty(state->txt_tilemap, offset);
}
@@ -106,7 +106,7 @@ WRITE16_HANDLER( aquarium_txt_videoram_w )
/* MID Layer */
static TILE_GET_INFO( get_aquarium_mid_tile_info )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
int tileno, colour, flag;
tileno = (state->mid_videoram[tile_index * 2] & 0x0fff);
@@ -120,7 +120,7 @@ static TILE_GET_INFO( get_aquarium_mid_tile_info )
WRITE16_HANDLER( aquarium_mid_videoram_w )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
state->mid_videoram[offset] = data;
tilemap_mark_tile_dirty(state->mid_tilemap, offset / 2);
}
@@ -128,7 +128,7 @@ WRITE16_HANDLER( aquarium_mid_videoram_w )
/* BAK Layer */
static TILE_GET_INFO( get_aquarium_bak_tile_info )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
int tileno, colour, flag;
tileno = (state->bak_videoram[tile_index * 2] & 0x0fff);
@@ -142,14 +142,14 @@ static TILE_GET_INFO( get_aquarium_bak_tile_info )
WRITE16_HANDLER( aquarium_bak_videoram_w )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
state->bak_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bak_tilemap, offset / 2);
}
VIDEO_START(aquarium)
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
state->txt_tilemap = tilemap_create(machine, get_aquarium_txt_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->bak_tilemap = tilemap_create(machine, get_aquarium_bak_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->mid_tilemap = tilemap_create(machine, get_aquarium_mid_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -160,7 +160,7 @@ VIDEO_START(aquarium)
SCREEN_UPDATE(aquarium)
{
- aquarium_state *state = screen->machine->driver_data<aquarium_state>();
+ aquarium_state *state = screen->machine().driver_data<aquarium_state>();
tilemap_set_scrollx(state->mid_tilemap, 0, state->scroll[0]);
tilemap_set_scrolly(state->mid_tilemap, 0, state->scroll[1]);
tilemap_set_scrollx(state->bak_tilemap, 0, state->scroll[2]);
@@ -171,7 +171,7 @@ SCREEN_UPDATE(aquarium)
tilemap_draw(bitmap, cliprect, state->bak_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 16);
+ draw_sprites(screen->machine(), bitmap, cliprect, 16);
tilemap_draw(bitmap, cliprect, state->bak_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, state->mid_tilemap, 1, 0);
diff --git a/src/mame/video/arabian.c b/src/mame/video/arabian.c
index f0d81f84ad8..225de3876c2 100644
--- a/src/mame/video/arabian.c
+++ b/src/mame/video/arabian.c
@@ -153,8 +153,8 @@ PALETTE_INIT( arabian )
VIDEO_START( arabian )
{
- arabian_state *state = machine->driver_data<arabian_state>();
- UINT8 *gfxbase = machine->region("gfx1")->base();
+ arabian_state *state = machine.driver_data<arabian_state>();
+ UINT8 *gfxbase = machine.region("gfx1")->base();
int offs;
/* allocate a common bitmap to use for both planes */
@@ -220,9 +220,9 @@ VIDEO_START( arabian )
*
*************************************/
-static void blit_area( running_machine *machine, UINT8 plane, UINT16 src, UINT8 x, UINT8 y, UINT8 sx, UINT8 sy )
+static void blit_area( running_machine &machine, UINT8 plane, UINT16 src, UINT8 x, UINT8 y, UINT8 sx, UINT8 sy )
{
- arabian_state *state = machine->driver_data<arabian_state>();
+ arabian_state *state = machine.driver_data<arabian_state>();
UINT8 *srcdata = &state->converted_gfx[src * 4];
int i,j;
@@ -269,7 +269,7 @@ static void blit_area( running_machine *machine, UINT8 plane, UINT16 src, UINT8
WRITE8_HANDLER( arabian_blitter_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
/* write the data */
state->blitter[offset] = data;
@@ -286,7 +286,7 @@ WRITE8_HANDLER( arabian_blitter_w )
int sy = state->blitter[5];
/* blit it */
- blit_area(space->machine, plane, src, x, y, sx, sy);
+ blit_area(space->machine(), plane, src, x, y, sx, sy);
}
}
@@ -300,7 +300,7 @@ WRITE8_HANDLER( arabian_blitter_w )
WRITE8_HANDLER( arabian_videoram_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 *base;
UINT8 x, y;
@@ -370,8 +370,8 @@ WRITE8_HANDLER( arabian_videoram_w )
SCREEN_UPDATE( arabian )
{
- arabian_state *state = screen->machine->driver_data<arabian_state>();
- const pen_t *pens = &screen->machine->pens[(state->video_control >> 3) << 8];
+ arabian_state *state = screen->machine().driver_data<arabian_state>();
+ const pen_t *pens = &screen->machine().pens[(state->video_control >> 3) << 8];
int y;
/* render the screen from the bitmap */
diff --git a/src/mame/video/arcadecl.c b/src/mame/video/arcadecl.c
index e0df3341ec6..9d7be114e4b 100644
--- a/src/mame/video/arcadecl.c
+++ b/src/mame/video/arcadecl.c
@@ -12,7 +12,7 @@
#include "includes/arcadecl.h"
-static void arcadecl_bitmap_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
/*************************************
*
@@ -58,7 +58,7 @@ VIDEO_START( arcadecl )
0, /* resulting value to indicate "special" */
0, /* callback routine for special entries */
};
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
/* initialize the motion objects */
atarimo_init(machine, 0, &modesc);
@@ -66,7 +66,7 @@ VIDEO_START( arcadecl )
/* set the intial scroll offset */
atarimo_set_xscroll(0, -12);
atarimo_set_yscroll(0, 0x110);
- state->has_mo = (machine->gfx[0]->total_elements > 10);
+ state->has_mo = (machine.gfx[0]->total_elements > 10);
}
@@ -79,10 +79,10 @@ VIDEO_START( arcadecl )
SCREEN_UPDATE( arcadecl )
{
- arcadecl_state *state = screen->machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = screen->machine().driver_data<arcadecl_state>();
/* draw the playfield */
- arcadecl_bitmap_render(screen->machine, bitmap, cliprect);
+ arcadecl_bitmap_render(screen->machine(), bitmap, cliprect);
/* draw and merge the MO */
if (state->has_mo)
@@ -120,9 +120,9 @@ SCREEN_UPDATE( arcadecl )
*
*************************************/
-static void arcadecl_bitmap_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
int x, y;
/* update any dirty scanlines */
diff --git a/src/mame/video/archimds.c b/src/mame/video/archimds.c
index 1afc19830ec..7216197b6a3 100644
--- a/src/mame/video/archimds.c
+++ b/src/mame/video/archimds.c
@@ -20,7 +20,7 @@ SCREEN_UPDATE( archimds_vidc )
const UINT8 x_step[4] = { 5, 7, 11, 19 };
/* border color */
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x10]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x10]);
/* define X display area thru BPP mode register */
calc_dxs = (vidc_regs[VIDC_HDSR]*2)+x_step[vidc_bpp_mode & 3];
@@ -43,7 +43,7 @@ SCREEN_UPDATE( archimds_vidc )
int count;
int x,y,xi;
UINT8 pen;
- static UINT8 *vram = screen->machine->region("vram")->base();
+ static UINT8 *vram = screen->machine().region("vram")->base();
count = (0);
@@ -67,18 +67,18 @@ SCREEN_UPDATE( archimds_vidc )
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend)
- *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine->pens[(pen>>(xi))&0x1];
+ *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen>>(xi))&0x1];
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y+1) <= screen->visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend)
- *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine->pens[(pen>>(xi))&0x1];
+ *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine().pens[(pen>>(xi))&0x1];
}
else
{
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend)
- *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine->pens[(pen>>(xi))&0x1];
+ *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen>>(xi))&0x1];
}
}
@@ -103,18 +103,18 @@ SCREEN_UPDATE( archimds_vidc )
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend)
- *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine->pens[(pen&0xff)+0x100];
+ *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen&0xff)+0x100];
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y+1) <= screen->visible_area().max_y && (res_x) <= xend && (res_y+1) <= yend)
- *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine->pens[(pen&0xff)+0x100];
+ *BITMAP_ADDR32(bitmap, res_y+1, res_x) = screen->machine().pens[(pen&0xff)+0x100];
}
else
{
if ((res_x) >= 0 &&
(res_y) >= 0 &&
(res_x) <= screen->visible_area().max_x && (res_y) <= screen->visible_area().max_y && (res_x) <= xend && (res_y) <= yend)
- *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine->pens[(pen&0xff)+0x100];
+ *BITMAP_ADDR32(bitmap, res_y, res_x) = screen->machine().pens[(pen&0xff)+0x100];
}
count++;
diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c
index 7bc534c1e45..e070a5e328c 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -124,7 +124,7 @@ BG0 palette intensity ( $C47F, $C4FF )
static TILE_GET_INFO( argus_get_tx_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index <<= 1;
@@ -141,7 +141,7 @@ static TILE_GET_INFO( argus_get_tx_tile_info )
static TILE_GET_INFO( argus_get_bg0_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index <<= 1;
@@ -158,7 +158,7 @@ static TILE_GET_INFO( argus_get_bg0_tile_info )
static TILE_GET_INFO( argus_get_bg1_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index <<= 1;
@@ -175,7 +175,7 @@ static TILE_GET_INFO( argus_get_bg1_tile_info )
static TILE_GET_INFO( valtric_get_tx_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index <<= 1;
@@ -192,7 +192,7 @@ static TILE_GET_INFO( valtric_get_tx_tile_info )
static TILE_GET_INFO( valtric_get_bg_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index <<= 1;
@@ -209,7 +209,7 @@ static TILE_GET_INFO( valtric_get_bg_tile_info )
static TILE_GET_INFO( butasan_get_tx_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
tile_index ^= 0x3e0;
@@ -227,7 +227,7 @@ static TILE_GET_INFO( butasan_get_tx_tile_info )
static TILE_GET_INFO( butasan_get_bg0_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 hi, lo;
int attrib;
@@ -247,7 +247,7 @@ static TILE_GET_INFO( butasan_get_bg0_tile_info )
static TILE_GET_INFO( butasan_get_bg1_tile_info )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
int attrib, tile;
attrib = (tile_index & 0x00f) | ((tile_index & 0x3e0) >> 1) | ((tile_index & 0x010) << 5);
@@ -267,9 +267,9 @@ static TILE_GET_INFO( butasan_get_bg1_tile_info )
Initialize and destroy video hardware emulation
***************************************************************************/
-static void reset_common(running_machine *machine)
+static void reset_common(running_machine &machine)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
state->bg_status = 0x01;
state->flipscreen = 0;
state->palette_intensity = 0;
@@ -277,7 +277,7 @@ static void reset_common(running_machine *machine)
VIDEO_START( argus )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
state->bg0_tilemap = tilemap_create(machine, argus_get_bg0_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
state->bg1_tilemap = tilemap_create(machine, argus_get_bg1_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
@@ -294,7 +294,7 @@ VIDEO_START( argus )
VIDEO_RESET( argus )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
state->lowbitscroll = 0;
state->prvscrollx = 0;
state->bg0_scrollx[0] = 0;
@@ -305,28 +305,28 @@ VIDEO_RESET( argus )
VIDEO_START( valtric )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
state->bg1_tilemap = tilemap_create(machine, valtric_get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
state->tx_tilemap = tilemap_create(machine, valtric_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->tx_tilemap, 15);
- state->mosaicbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->mosaicbitmap = machine.primary_screen->alloc_compatible_bitmap();
jal_blend_init(machine, 1);
}
VIDEO_RESET( valtric )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
state->valtric_mosaic = 0x0f;
reset_common(machine);
}
VIDEO_START( butasan )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
/* info offset w h col row */
state->bg0_tilemap = tilemap_create(machine, butasan_get_bg0_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->bg1_tilemap = tilemap_create(machine, butasan_get_bg1_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -348,7 +348,7 @@ VIDEO_START( butasan )
VIDEO_RESET( butasan )
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
state->butasan_page_latch = 0;
state->butasan_bg1_status = 0x01;
memset(state->butasan_pagedram[0], 0, 0x1000);
@@ -362,15 +362,15 @@ VIDEO_RESET( butasan )
***************************************************************************/
/* Write bg0 pattern data to dummy bg0 ram */
-static void argus_write_dummy_rams(running_machine *machine, int dramoffs, int vromoffs)
+static void argus_write_dummy_rams(running_machine &machine, int dramoffs, int vromoffs)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
int i;
int voffs;
int offs;
- UINT8 *VROM1 = machine->region("user1")->base(); /* "ag_15.bin" */
- UINT8 *VROM2 = machine->region("user2")->base(); /* "ag_16.bin" */
+ UINT8 *VROM1 = machine.region("user1")->base(); /* "ag_15.bin" */
+ UINT8 *VROM2 = machine.region("user2")->base(); /* "ag_16.bin" */
/* offset in pattern data */
offs = VROM1[vromoffs] | (VROM1[vromoffs + 1] << 8);
@@ -387,18 +387,18 @@ static void argus_write_dummy_rams(running_machine *machine, int dramoffs, int v
}
}
-static void argus_change_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
+static void argus_change_palette(running_machine &machine, int color, int lo_offs, int hi_offs)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 lo = state->paletteram[lo_offs];
UINT8 hi = state->paletteram[hi_offs];
jal_blend_set(color, hi & 0x0f);
palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
}
-static void argus_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
+static void argus_change_bg_palette(running_machine &machine, int color, int lo_offs, int hi_offs)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 r,g,b,lo,hi,ir,ig,ib,ix;
rgb_t rgb,irgb;
@@ -441,39 +441,39 @@ static void argus_change_bg_palette(running_machine *machine, int color, int lo_
WRITE8_HANDLER( valtric_mosaic_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->valtric_mosaic = data;
}
READ8_HANDLER( argus_txram_r )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
return state->txram[offset];
}
WRITE8_HANDLER( argus_txram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->txram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset >> 1);
}
READ8_HANDLER( argus_bg1ram_r )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
return state->bg1ram[offset];
}
WRITE8_HANDLER( argus_bg1ram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->bg1ram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap, offset >> 1);
}
WRITE8_HANDLER( argus_bg_status_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
if (state->bg_status != data)
{
state->bg_status = data;
@@ -485,7 +485,7 @@ WRITE8_HANDLER( argus_bg_status_w )
for (offs = 0x400; offs < 0x500; offs++)
{
- argus_change_bg_palette(space->machine, (offs - 0x400) + 0x080, offs, offs + 0x400);
+ argus_change_bg_palette(space->machine(), (offs - 0x400) + 0x080, offs, offs + 0x400);
}
}
}
@@ -493,7 +493,7 @@ WRITE8_HANDLER( argus_bg_status_w )
WRITE8_HANDLER( valtric_bg_status_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
if (state->bg_status != data)
{
state->bg_status = data;
@@ -505,7 +505,7 @@ WRITE8_HANDLER( valtric_bg_status_w )
for (offs = 0x400; offs < 0x600; offs += 2)
{
- argus_change_bg_palette(space->machine, ((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1);
+ argus_change_bg_palette(space->machine(), ((offs - 0x400) >> 1) + 0x100, offs & ~1, offs | 1);
}
}
}
@@ -513,13 +513,13 @@ WRITE8_HANDLER( valtric_bg_status_w )
WRITE8_HANDLER( butasan_bg0_status_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->bg_status = data;
}
WRITE8_HANDLER( butasan_bg1_status_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
if (state->butasan_bg1_status != data)
{
state->butasan_bg1_status = data;
@@ -531,19 +531,19 @@ WRITE8_HANDLER( butasan_bg1_status_w )
WRITE8_HANDLER( argus_flipscreen_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->flipscreen = data & 0x80;
}
READ8_HANDLER( argus_paletteram_r )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
return state->paletteram[offset];
}
WRITE8_HANDLER( argus_paletteram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
int offs;
state->paletteram[offset] = data;
@@ -552,14 +552,14 @@ WRITE8_HANDLER( argus_paletteram_w )
{
offset &= 0x07f;
- argus_change_palette(space->machine, offset, offset, offset + 0x080);
+ argus_change_palette(space->machine(), offset, offset, offset + 0x080);
if (offset == 0x07f || offset == 0x0ff)
{
state->palette_intensity = state->paletteram[0x0ff] | (state->paletteram[0x07f] << 8);
for (offs = 0x400; offs < 0x500; offs++)
- argus_change_bg_palette(space->machine, (offs & 0xff) + 0x080, offs, offs + 0x400);
+ argus_change_bg_palette(space->machine(), (offs & 0xff) + 0x080, offs, offs + 0x400);
}
}
else if ((offset >= 0x400 && offset <= 0x4ff) ||
@@ -568,7 +568,7 @@ WRITE8_HANDLER( argus_paletteram_w )
offs = offset & 0xff;
offset = offs | 0x400;
- argus_change_bg_palette(space->machine, offs + 0x080, offset, offset + 0x400);
+ argus_change_bg_palette(space->machine(), offs + 0x080, offset, offset + 0x400);
}
else if ((offset >= 0x500 && offset <= 0x5ff) ||
(offset >= 0x900 && offset <= 0x9ff)) /* BG1 color */
@@ -576,7 +576,7 @@ WRITE8_HANDLER( argus_paletteram_w )
offs = offset & 0xff;
offset = offs | 0x500;
- argus_change_palette(space->machine, offs + 0x180, offset, offset + 0x400);
+ argus_change_palette(space->machine(), offs + 0x180, offset, offset + 0x400);
}
else if ((offset >= 0x700 && offset <= 0x7ff) ||
(offset >= 0xb00 && offset <= 0xbff)) /* text color */
@@ -584,18 +584,18 @@ WRITE8_HANDLER( argus_paletteram_w )
offs = offset & 0xff;
offset = offs | 0x700;
- argus_change_palette(space->machine, offs + 0x280, offset, offset + 0x400);
+ argus_change_palette(space->machine(), offs + 0x280, offset, offset + 0x400);
}
}
WRITE8_HANDLER( valtric_paletteram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->paletteram[offset] = data;
if (offset <= 0x1ff) /* Sprite color */
{
- argus_change_palette(space->machine, offset >> 1, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), offset >> 1, offset & ~1, offset | 1);
if (offset == 0x1fe || offset == 0x1ff)
{
@@ -604,62 +604,62 @@ WRITE8_HANDLER( valtric_paletteram_w )
state->palette_intensity = state->paletteram[0x1ff] | (state->paletteram[0x1fe] << 8);
for (offs = 0x400; offs < 0x600; offs += 2)
- argus_change_bg_palette(space->machine, ((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1);
+ argus_change_bg_palette(space->machine(), ((offs & 0x1ff) >> 1) + 0x100, offs & ~1, offs | 1);
}
}
else if (offset >= 0x400 && offset <= 0x5ff) /* BG color */
{
- argus_change_bg_palette(space->machine, ((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1);
+ argus_change_bg_palette(space->machine(), ((offset & 0x1ff) >> 1) + 0x100, offset & ~1, offset | 1);
}
else if (offset >= 0x600 && offset <= 0x7ff) /* Text color */
{
- argus_change_palette(space->machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
}
}
WRITE8_HANDLER( butasan_paletteram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->paletteram[offset] = data;
if (offset <= 0x1ff) /* BG0 color */
{
- argus_change_palette(space->machine, (offset >> 1) + 0x100, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), (offset >> 1) + 0x100, offset & ~1, offset | 1);
}
else if (offset <= 0x23f) /* BG1 color */
{
- argus_change_palette(space->machine, ((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), ((offset & 0x3f) >> 1) + 0x0c0, offset & ~1, offset | 1);
}
else if (offset >= 0x400 && offset <= 0x47f) /* Sprite color */
{ /* 16 colors */
- argus_change_palette(space->machine, (offset & 0x7f) >> 1, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), (offset & 0x7f) >> 1, offset & ~1, offset | 1);
}
else if (offset >= 0x480 && offset <= 0x4ff) /* Sprite color */
{ /* 8 colors */
int offs = (offset & 0x070) | ((offset & 0x00f) >> 1);
- argus_change_palette(space->machine, offs + 0x040, offset & ~1, offset | 1);
- argus_change_palette(space->machine, offs + 0x048, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), offs + 0x040, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), offs + 0x048, offset & ~1, offset | 1);
}
else if (offset >= 0x600 && offset <= 0x7ff) /* Text color */
{
- argus_change_palette(space->machine, ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), ((offset & 0x1ff) >> 1) + 0x200, offset & ~1, offset | 1);
}
else if (offset >= 0x240 && offset <= 0x25f) // dummy
- argus_change_palette(space->machine, ((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), ((offset & 0x1f) >> 1) + 0xe0, offset & ~1, offset | 1);
else if (offset >= 0x500 && offset <= 0x51f) // dummy
- argus_change_palette(space->machine, ((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1);
+ argus_change_palette(space->machine(), ((offset & 0x1f) >> 1) + 0xf0, offset & ~1, offset | 1);
}
READ8_HANDLER( butasan_bg1ram_r )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
return state->butasan_bg1ram[offset];
}
WRITE8_HANDLER( butasan_bg1ram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
int idx;
state->butasan_bg1ram[offset] = data;
@@ -672,19 +672,19 @@ WRITE8_HANDLER( butasan_bg1ram_w )
WRITE8_HANDLER( butasan_pageselect_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->butasan_page_latch = data & 1;
}
READ8_HANDLER( butasan_pagedram_r )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
return state->butasan_pagedram[state->butasan_page_latch][offset];
}
WRITE8_HANDLER( butasan_pagedram_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->butasan_pagedram[state->butasan_page_latch][offset] = data;
if (!state->butasan_page_latch)
@@ -706,13 +706,13 @@ WRITE8_HANDLER( butasan_pagedram_w )
WRITE8_HANDLER( valtric_unknown_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->valtric_unknown = data;
}
WRITE8_HANDLER( butasan_unknown_w )
{
- argus_state *state = space->machine->driver_data<argus_state>();
+ argus_state *state = space->machine().driver_data<argus_state>();
state->butasan_unknown = data;
}
@@ -726,9 +726,9 @@ WRITE8_HANDLER( butasan_unknown_w )
#define bg1_scrollx (state->bg1_scrollx[0] | (state->bg1_scrollx[1] << 8))
#define bg1_scrolly (state->bg1_scrolly[0] | (state->bg1_scrolly[1] << 8))
-static void bg_setting(running_machine *machine)
+static void bg_setting(running_machine &machine)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
tilemap_set_flip_all(machine, state->flipscreen ? TILEMAP_FLIPY|TILEMAP_FLIPX : 0);
if (!state->flipscreen)
@@ -753,9 +753,9 @@ static void bg_setting(running_machine *machine)
}
}
-static void argus_bg0_scroll_handle(running_machine *machine)
+static void argus_bg0_scroll_handle(running_machine &machine)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
int delta;
int dcolumn;
@@ -848,9 +848,9 @@ static void argus_bg0_scroll_handle(running_machine *machine)
}
}
-static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void argus_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -880,7 +880,7 @@ static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
if (priority != pri)
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -893,7 +893,7 @@ static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
#if 1
static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
{
- argus_state *state = screen.machine->driver_data<argus_state>();
+ argus_state *state = screen.machine().driver_data<argus_state>();
if (state->valtric_mosaic!=0x80)
{
@@ -942,7 +942,7 @@ static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const r
#else
static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
{
- argus_state *state = screen.machine->driver_data<argus_state>();
+ argus_state *state = screen.machine().driver_data<argus_state>();
int step = 0x10 - (state->valtric_mosaic & 0x0f);
if (step == 1)
@@ -981,9 +981,9 @@ static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const r
}
#endif
-static void valtric_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void valtric_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -1011,7 +1011,7 @@ static void valtric_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
}
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -1021,9 +1021,9 @@ static void valtric_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
}
}
-static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void butasan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -1063,7 +1063,7 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
if ((offs >= 0x100 && offs <= 0x2ff) || (offs >= 0x400 && offs <= 0x57f))
{
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -1077,7 +1077,7 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
td = (fx) ? (1 - i) : i;
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile + td,
color,
flipx, flipy,
@@ -1097,7 +1097,7 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
td = (fx) ? (i * 2) + 1 - j : i * 2 + j;
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile + td,
color,
flipx, flipy,
@@ -1118,7 +1118,7 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
td = (fx) ? (i * 4) + 3 - j : i * 4 + j;
jal_blend_drawgfx(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
tile + td,
color,
flipx, flipy,
@@ -1132,10 +1132,10 @@ static void butasan_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
}
-static void butasan_log_vram(running_machine *machine)
+static void butasan_log_vram(running_machine &machine)
{
#ifdef MAME_DEBUG
- argus_state *state = machine->driver_data<argus_state>();
+ argus_state *state = machine.driver_data<argus_state>();
int offs;
if (input_code_pressed(machine, KEYCODE_M))
@@ -1188,48 +1188,48 @@ static void butasan_log_vram(running_machine *machine)
SCREEN_UPDATE( argus )
{
- argus_state *state = screen->machine->driver_data<argus_state>();
- bg_setting(screen->machine);
+ argus_state *state = screen->machine().driver_data<argus_state>();
+ bg_setting(screen->machine());
/* scroll BG0 and render tile at proper position */
- argus_bg0_scroll_handle(screen->machine);
+ argus_bg0_scroll_handle(screen->machine());
tilemap_draw(bitmap, cliprect, state->bg0_tilemap, 0, 0);
- argus_draw_sprites(screen->machine, bitmap, cliprect, 0);
+ argus_draw_sprites(screen->machine(), bitmap, cliprect, 0);
if (state->bg_status & 1) /* Backgound enable */
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- argus_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ argus_draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( valtric )
{
- argus_state *state = screen->machine->driver_data<argus_state>();
- bg_setting(screen->machine);
+ argus_state *state = screen->machine().driver_data<argus_state>();
+ bg_setting(screen->machine());
if (state->bg_status & 1) /* Backgound enable */
valtric_draw_mosaic(*screen, bitmap, cliprect);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- valtric_draw_sprites(screen->machine, bitmap, cliprect);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ valtric_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( butasan )
{
- argus_state *state = screen->machine->driver_data<argus_state>();
- bg_setting(screen->machine);
+ argus_state *state = screen->machine().driver_data<argus_state>();
+ bg_setting(screen->machine());
if (state->bg_status & 1) /* Backgound enable */
tilemap_draw(bitmap, cliprect, state->bg0_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- butasan_draw_sprites(screen->machine, bitmap, cliprect);
+ butasan_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
- butasan_log_vram(screen->machine);
+ butasan_log_vram(screen->machine());
return 0;
}
diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c
index 09ee246aad1..b9b3d4269f9 100644
--- a/src/mame/video/arkanoid.c
+++ b/src/mame/video/arkanoid.c
@@ -12,26 +12,26 @@
WRITE8_HANDLER( arkanoid_videoram_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( arkanoid_d008_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
int bank;
/* bits 0 and 1 flip X and Y, I don't know which is which */
- if (flip_screen_x_get(space->machine) != (data & 0x01))
+ if (flip_screen_x_get(space->machine()) != (data & 0x01))
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- if (flip_screen_y_get(space->machine) != (data & 0x02))
+ if (flip_screen_y_get(space->machine()) != (data & 0x02))
{
- flip_screen_y_set(space->machine, data & 0x02);
+ flip_screen_y_set(space->machine(), data & 0x02);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -39,8 +39,8 @@ WRITE8_HANDLER( arkanoid_d008_w )
state->paddle_select = data & 0x04;
/* bit 3 is coin lockout (but not the service coin) */
- coin_lockout_w(space->machine, 0, !(data & 0x08));
- coin_lockout_w(space->machine, 1, !(data & 0x08));
+ coin_lockout_w(space->machine(), 0, !(data & 0x08));
+ coin_lockout_w(space->machine(), 1, !(data & 0x08));
/* bit 4 is unknown */
@@ -75,19 +75,19 @@ WRITE8_HANDLER( arkanoid_d008_w )
/* different hook-up, everything except for bits 0-1 and 7 aren't tested afaik. */
WRITE8_HANDLER( tetrsark_d008_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
int bank;
/* bits 0 and 1 flip X and Y, I don't know which is which */
- if (flip_screen_x_get(space->machine) != (data & 0x01))
+ if (flip_screen_x_get(space->machine()) != (data & 0x01))
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- if (flip_screen_y_get(space->machine) != (data & 0x02))
+ if (flip_screen_y_get(space->machine()) != (data & 0x02))
{
- flip_screen_y_set(space->machine, data & 0x02);
+ flip_screen_y_set(space->machine(), data & 0x02);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -115,33 +115,33 @@ WRITE8_HANDLER( tetrsark_d008_w )
}
/* bit 7 is coin lockout (but not the service coin) */
- coin_lockout_w(space->machine, 0, !(data & 0x80));
- coin_lockout_w(space->machine, 1, !(data & 0x80));
+ coin_lockout_w(space->machine(), 0, !(data & 0x80));
+ coin_lockout_w(space->machine(), 1, !(data & 0x80));
}
WRITE8_HANDLER( hexa_d008_w )
{
- arkanoid_state *state = space->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = space->machine().driver_data<arkanoid_state>();
/* bit 0 = flipx (or y?) */
- if (flip_screen_x_get(space->machine) != (data & 0x01))
+ if (flip_screen_x_get(space->machine()) != (data & 0x01))
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
/* bit 1 = flipy (or x?) */
- if (flip_screen_y_get(space->machine) != (data & 0x02))
+ if (flip_screen_y_get(space->machine()) != (data & 0x02))
{
- flip_screen_y_set(space->machine, data & 0x02);
+ flip_screen_y_set(space->machine(), data & 0x02);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
/* bit 2 - 3 unknown */
/* bit 4 could be the ROM bank selector for 8000-bfff (not sure) */
- memory_set_bank(space->machine, "bank1", ((data & 0x10) >> 4));
+ memory_set_bank(space->machine(), "bank1", ((data & 0x10) >> 4));
/* bit 5 = gfx bank */
if (state->gfxbank != ((data & 0x20) >> 5))
@@ -155,7 +155,7 @@ WRITE8_HANDLER( hexa_d008_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
int offs = tile_index * 2;
int code = state->videoram[offs + 1] + ((state->videoram[offs] & 0x07) << 8) + 2048 * state->gfxbank;
int color = ((state->videoram[offs] & 0xf8) >> 3) + 32 * state->palettebank;
@@ -165,14 +165,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( arkanoid )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -188,12 +188,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = state->spriteram[offs + 3] + ((state->spriteram[offs + 2] & 0x03) << 8) + 1024 * state->gfxbank;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code,
((state->spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->palettebank,
flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code + 1,
((state->spriteram[offs + 2] & 0xf8) >> 3) + 32 * state->palettebank,
flip_screen_x_get(machine),flip_screen_y_get(machine),
@@ -204,16 +204,16 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( arkanoid )
{
- arkanoid_state *state = screen->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = screen->machine().driver_data<arkanoid_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( hexa )
{
- arkanoid_state *state = screen->machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = screen->machine().driver_data<arkanoid_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/armedf.c b/src/mame/video/armedf.c
index 7a954fab801..499ff86d24d 100644
--- a/src/mame/video/armedf.c
+++ b/src/mame/video/armedf.c
@@ -27,7 +27,7 @@ static TILEMAP_MAPPER( armedf_scan_type3 )
static TILE_GET_INFO( get_tx_tile_info )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
int tile_number = state->text_videoram[tile_index] & 0xff;
int attributes;
@@ -45,7 +45,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( get_legion_tx_tile_info )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
int tile_number = state->text_videoram[tile_index] & 0xff;
@@ -76,7 +76,7 @@ static TILE_GET_INFO( get_legion_tx_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
int data = state->fg_videoram[tile_index];
SET_TILE_INFO(
1,
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
int data = state->bg_videoram[tile_index];
SET_TILE_INFO(
2,
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->oldmode = -1;
if (state->scroll_type == 4 || /* cclimbr2 */
@@ -154,7 +154,7 @@ VIDEO_START( armedf )
WRITE16_HANDLER( armedf_text_videoram_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->text_videoram[offset]);
if (state->scroll_type == 1)
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
@@ -174,21 +174,21 @@ WRITE16_HANDLER( armedf_text_videoram_w )
WRITE16_HANDLER( armedf_fg_videoram_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE16_HANDLER( armedf_bg_videoram_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE16_HANDLER( terraf_fg_scrollx_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
if (ACCESSING_BITS_8_15)
{
state->fg_scrollx = data >> 8;
@@ -198,7 +198,7 @@ WRITE16_HANDLER( terraf_fg_scrollx_w )
WRITE16_HANDLER( terraf_fg_scrolly_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
if (ACCESSING_BITS_8_15)
{
if (state->waiting_msb)
@@ -210,40 +210,40 @@ WRITE16_HANDLER( terraf_fg_scrolly_w )
WRITE16_HANDLER( terraf_fg_scroll_msb_arm_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
if (ACCESSING_BITS_8_15)
state->waiting_msb = 0;
}
WRITE16_HANDLER( armedf_fg_scrollx_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->fg_scrollx);
}
WRITE16_HANDLER( armedf_fg_scrolly_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->fg_scrolly);
}
WRITE16_HANDLER( armedf_bg_scrollx_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->bg_scrollx);
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
}
WRITE16_HANDLER( armedf_bg_scrolly_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->bg_scrolly);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
}
WRITE16_HANDLER( armedf_mcu_cmd )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->mcu_mode);
}
@@ -255,13 +255,13 @@ WRITE16_HANDLER( armedf_mcu_cmd )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
- armedf_state *state = machine->driver_data<armedf_state>();
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
+ armedf_state *state = machine.driver_data<armedf_state>();
int offs;
- for (offs = 0; offs < machine->generic.spriteram_size / 2; offs += 4)
+ for (offs = 0; offs < machine.generic.spriteram_size / 2; offs += 4)
{
int code = buffered_spriteram[offs + 1]; /* ??YX?TTTTTTTTTTT */
int flipx = code & 0x2000;
@@ -280,7 +280,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (((buffered_spriteram[offs + 0] & 0x3000) >> 12) == priority)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & 0xfff,
color,
flipx,flipy,
@@ -289,7 +289,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void copy_textmap(running_machine *machine, int index)
+static void copy_textmap(running_machine &machine, int index)
{
/*
(not simulated)
@@ -307,8 +307,8 @@ static void copy_textmap(running_machine *machine, int index)
*/
- armedf_state *state = machine->driver_data<armedf_state>();
- UINT8 * data = (UINT8 *)machine->region("gfx5")->base();
+ armedf_state *state = machine.driver_data<armedf_state>();
+ UINT8 * data = (UINT8 *)machine.region("gfx5")->base();
for(int i=0;i<0x400;++i)
{
@@ -331,7 +331,7 @@ static void copy_textmap(running_machine *machine, int index)
SCREEN_UPDATE( armedf )
{
- armedf_state *state = screen->machine->driver_data<armedf_state>();
+ armedf_state *state = screen->machine().driver_data<armedf_state>();
int sprite_enable = state->vreg & 0x200;
tilemap_set_enable(state->bg_tilemap, state->vreg & 0x800);
@@ -414,7 +414,7 @@ SCREEN_UPDATE( armedf )
}
else
{
- bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine) & 0x0f);
+ bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine()) & 0x0f);
}
#endif
@@ -422,7 +422,7 @@ SCREEN_UPDATE( armedf )
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
if (sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
if ((state->mcu_mode & 0x0030) == 0x0020)
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -433,13 +433,13 @@ SCREEN_UPDATE( armedf )
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
if (sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
if ((state->mcu_mode & 0x0030) == 0x0000)
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
if (sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
if(state->scroll_type == 3) /* legion */
{
@@ -450,9 +450,9 @@ SCREEN_UPDATE( armedf )
state->oldmode=mode;
switch(mode)
{
- case 0x01: copy_textmap(screen->machine, 4); break; /* title screen */
- case 0x06: copy_textmap(screen->machine, 7); break; /* portraits on title screen */
- case 0x1c: copy_textmap(screen->machine, 5); break; /* bottom, in-game layer */
+ case 0x01: copy_textmap(screen->machine(), 4); break; /* title screen */
+ case 0x06: copy_textmap(screen->machine(), 7); break; /* portraits on title screen */
+ case 0x1c: copy_textmap(screen->machine(), 5); break; /* bottom, in-game layer */
default: logerror("unknown mode %d\n", mode); break;
}
}
@@ -466,7 +466,7 @@ SCREEN_UPDATE( armedf )
SCREEN_EOF( armedf )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c
index a0b054a63c1..aa214a1f162 100644
--- a/src/mame/video/artmagic.c
+++ b/src/mame/video/artmagic.c
@@ -41,9 +41,9 @@ INLINE UINT16 *address_to_vram(artmagic_state *state, offs_t *address)
VIDEO_START( artmagic )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
- state->blitter_base = (UINT16 *)machine->region("gfx1")->base();
- state->blitter_mask = machine->region("gfx1")->bytes()/2 - 1;
+ artmagic_state *state = machine.driver_data<artmagic_state>();
+ state->blitter_base = (UINT16 *)machine.region("gfx1")->base();
+ state->blitter_mask = machine.region("gfx1")->bytes()/2 - 1;
state_save_register_global_array(machine, state->_xor);
state_save_register_global(machine, state->is_stoneball);
@@ -61,7 +61,7 @@ VIDEO_START( artmagic )
void artmagic_to_shiftreg(address_space *space, offs_t address, UINT16 *data)
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
UINT16 *vram = address_to_vram(state, &address);
if (vram)
memcpy(data, &vram[address], TOBYTE(0x2000));
@@ -70,7 +70,7 @@ void artmagic_to_shiftreg(address_space *space, offs_t address, UINT16 *data)
void artmagic_from_shiftreg(address_space *space, offs_t address, UINT16 *data)
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
UINT16 *vram = address_to_vram(state, &address);
if (vram)
memcpy(&vram[address], data, TOBYTE(0x2000));
@@ -84,9 +84,9 @@ void artmagic_from_shiftreg(address_space *space, offs_t address, UINT16 *data)
*
*************************************/
-static void execute_blit(running_machine *machine)
+static void execute_blit(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
UINT16 *dest = state->blitter_page ? state->vram0 : state->vram1;
int offset = ((state->blitter_data[1] & 0xff) << 16) | state->blitter_data[0];
int color = (state->blitter_data[1] >> 4) & 0xf0;
@@ -105,7 +105,7 @@ static void execute_blit(running_machine *machine)
static FILE *f;
logerror("%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n",
- machine->describe_context(), offset, x, y, w, h,
+ machine.describe_context(), offset, x, y, w, h,
state->blitter_data[0], state->blitter_data[1],
state->blitter_data[2], state->blitter_data[3],
state->blitter_data[4], state->blitter_data[5],
@@ -123,7 +123,7 @@ static void execute_blit(running_machine *machine)
fprintf(f, "----------------------\n"
"%s:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n",
- machine->describe_context(), offset, x, y, w, h,
+ machine.describe_context(), offset, x, y, w, h,
state->blitter_data[0], state->blitter_data[1],
state->blitter_data[2], state->blitter_data[3],
state->blitter_data[4], state->blitter_data[5],
@@ -295,14 +295,14 @@ static void execute_blit(running_machine *machine)
g_profiler.stop();
#if (!INSTANT_BLIT)
- state->blitter_busy_until = machine->time() + attotime::from_nsec(w*h*20);
+ state->blitter_busy_until = machine.time() + attotime::from_nsec(w*h*20);
#endif
}
READ16_HANDLER( artmagic_blitter_r )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
/*
bit 1 is a busy flag; loops tightly if clear
bit 2 is tested in a similar fashion
@@ -310,7 +310,7 @@ READ16_HANDLER( artmagic_blitter_r )
*/
UINT16 result = 0xffef | (state->blitter_page << 4);
#if (!INSTANT_BLIT)
- if (attotime_compare(space->machine->time(), state->blitter_busy_until) < 0)
+ if (attotime_compare(space->machine().time(), state->blitter_busy_until) < 0)
result ^= 6;
#endif
return result;
@@ -319,12 +319,12 @@ READ16_HANDLER( artmagic_blitter_r )
WRITE16_HANDLER( artmagic_blitter_w )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
COMBINE_DATA(&state->blitter_data[offset]);
/* offset 3 triggers the blit */
if (offset == 3)
- execute_blit(space->machine);
+ execute_blit(space->machine());
/* offset 4 contains the target page */
else if (offset == 4)
@@ -341,11 +341,11 @@ WRITE16_HANDLER( artmagic_blitter_w )
void artmagic_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- artmagic_state *state = screen.machine->driver_data<artmagic_state>();
+ artmagic_state *state = screen.machine().driver_data<artmagic_state>();
offs_t offset = (params->rowaddr << 12) & 0x7ff000;
UINT16 *vram = address_to_vram(state, &offset);
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr << 1;
int x;
diff --git a/src/mame/video/ashnojoe.c b/src/mame/video/ashnojoe.c
index 0262559c1f9..0f3e4c77722 100644
--- a/src/mame/video/ashnojoe.c
+++ b/src/mame/video/ashnojoe.c
@@ -11,7 +11,7 @@
static TILE_GET_INFO( get_joe_tile_info )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram[tile_index];
SET_TILE_INFO(
@@ -23,7 +23,7 @@ static TILE_GET_INFO( get_joe_tile_info )
static TILE_GET_INFO( get_joe_tile_info_2 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_2[tile_index * 2];
int attr = state->tileram_2[tile_index * 2 + 1];
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_joe_tile_info_2 )
static TILE_GET_INFO( get_joe_tile_info_3 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_3[tile_index];
SET_TILE_INFO(
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_joe_tile_info_3 )
static TILE_GET_INFO( get_joe_tile_info_4 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_4[tile_index];
SET_TILE_INFO(
@@ -60,7 +60,7 @@ static TILE_GET_INFO( get_joe_tile_info_4 )
static TILE_GET_INFO( get_joe_tile_info_5 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_5[tile_index * 2];
int attr = state->tileram_5[tile_index * 2 + 1];
@@ -73,7 +73,7 @@ static TILE_GET_INFO( get_joe_tile_info_5 )
static TILE_GET_INFO( get_joe_tile_info_6 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_6[tile_index * 2];
int attr = state->tileram_6[tile_index * 2 + 1];
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_joe_tile_info_6 )
static TILE_GET_INFO( get_joe_tile_info_7 )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
int code = state->tileram_7[tile_index * 2];
int attr = state->tileram_7[tile_index * 2 + 1];
@@ -100,7 +100,7 @@ static TILE_GET_INFO( get_joe_tile_info_7 )
WRITE16_HANDLER( ashnojoe_tileram_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap, offset);
@@ -109,7 +109,7 @@ WRITE16_HANDLER( ashnojoe_tileram_w )
WRITE16_HANDLER( ashnojoe_tileram2_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_2[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap2, offset / 2);
@@ -117,7 +117,7 @@ WRITE16_HANDLER( ashnojoe_tileram2_w )
WRITE16_HANDLER( ashnojoe_tileram3_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_3[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap3, offset);
@@ -125,7 +125,7 @@ WRITE16_HANDLER( ashnojoe_tileram3_w )
WRITE16_HANDLER( ashnojoe_tileram4_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_4[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap4, offset);
@@ -133,7 +133,7 @@ WRITE16_HANDLER( ashnojoe_tileram4_w )
WRITE16_HANDLER( ashnojoe_tileram5_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_5[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap5, offset / 2);
@@ -141,7 +141,7 @@ WRITE16_HANDLER( ashnojoe_tileram5_w )
WRITE16_HANDLER( ashnojoe_tileram6_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_6[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap6, offset / 2);
@@ -149,7 +149,7 @@ WRITE16_HANDLER( ashnojoe_tileram6_w )
WRITE16_HANDLER( ashnojoe_tileram7_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->tileram_7[offset] = data;
tilemap_mark_tile_dirty(state->joetilemap7, offset / 2);
@@ -157,7 +157,7 @@ WRITE16_HANDLER( ashnojoe_tileram7_w )
WRITE16_HANDLER( joe_tilemaps_xscroll_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
switch( offset )
{
@@ -182,7 +182,7 @@ WRITE16_HANDLER( joe_tilemaps_xscroll_w )
WRITE16_HANDLER( joe_tilemaps_yscroll_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
switch( offset )
{
@@ -207,7 +207,7 @@ WRITE16_HANDLER( joe_tilemaps_yscroll_w )
VIDEO_START( ashnojoe )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
state->joetilemap = tilemap_create(machine, get_joe_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->joetilemap2 = tilemap_create(machine, get_joe_tile_info_2, tilemap_scan_rows, 16, 16, 32, 32);
@@ -226,11 +226,11 @@ VIDEO_START( ashnojoe )
SCREEN_UPDATE( ashnojoe )
{
- ashnojoe_state *state = screen->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = screen->machine().driver_data<ashnojoe_state>();
//state->tilemap_reg[0] & 0x10 // ?? on coin insertion
- flip_screen_set(screen->machine, state->tilemap_reg[0] & 1);
+ flip_screen_set(screen->machine(), state->tilemap_reg[0] & 1);
if(state->tilemap_reg[0] & 0x02)
tilemap_draw(bitmap, cliprect, state->joetilemap7, 0, 0);
diff --git a/src/mame/video/asterix.c b/src/mame/video/asterix.c
index 6b286a6bea3..dd084a4d6cf 100644
--- a/src/mame/video/asterix.c
+++ b/src/mame/video/asterix.c
@@ -3,9 +3,9 @@
#include "includes/asterix.h"
-static void reset_spritebank( running_machine *machine )
+static void reset_spritebank( running_machine &machine )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
k053244_bankselect(state->k053244, state->spritebank & 7);
state->spritebanks[0] = (state->spritebank << 12) & 0x7000;
state->spritebanks[1] = (state->spritebank << 9) & 0x7000;
@@ -15,14 +15,14 @@ static void reset_spritebank( running_machine *machine )
WRITE16_HANDLER( asterix_spritebank_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
COMBINE_DATA(&state->spritebank);
- reset_spritebank(space->machine);
+ reset_spritebank(space->machine());
}
-void asterix_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void asterix_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
int pri = (*color & 0x00e0) >> 2;
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -37,9 +37,9 @@ void asterix_sprite_callback( running_machine *machine, int *code, int *color, i
}
-void asterix_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void asterix_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
*flags = *code & 0x1000 ? TILE_FLIPX : 0;
*color = (state->layer_colorbase[layer] + ((*code & 0xe000) >> 13)) & 0x7f;
@@ -48,7 +48,7 @@ void asterix_tile_callback( running_machine *machine, int layer, int *code, int
SCREEN_UPDATE( asterix )
{
- asterix_state *state = screen->machine->driver_data<asterix_state>();
+ asterix_state *state = screen->machine().driver_data<asterix_state>();
static const int K053251_CI[4] = { K053251_CI0, K053251_CI2, K053251_CI3, K053251_CI4 };
int layer[3], plane, new_colorbase;
@@ -96,7 +96,7 @@ SCREEN_UPDATE( asterix )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
k056832_tilemap_draw(state->k056832, bitmap, cliprect, layer[0], 0, 1);
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index ab0b1b85e66..1832f3d9d36 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -90,9 +90,9 @@ static UINT8 profpac_vw;
*
*************************************/
-static void init_savestate(running_machine *machine);
+static void init_savestate(running_machine &machine);
static TIMER_CALLBACK( scanline_callback );
-static void init_sparklestar(running_machine *machine);
+static void init_sparklestar(running_machine &machine);
@@ -222,8 +222,8 @@ PALETTE_INIT( profpac )
VIDEO_START( astrocde )
{
/* allocate a per-scanline timer */
- scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
- scanline_timer->adjust(machine->primary_screen->time_until_pos(1), 1);
+ scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
+ scanline_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
/* register for save states */
init_savestate(machine);
@@ -237,8 +237,8 @@ VIDEO_START( astrocde )
VIDEO_START( profpac )
{
/* allocate a per-scanline timer */
- scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
- scanline_timer->adjust(machine->primary_screen->time_until_pos(1), 1);
+ scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
+ scanline_timer->adjust(machine.primary_screen->time_until_pos(1), 1);
/* allocate videoram */
profpac_videoram = auto_alloc_array(machine, UINT16, 0x4000 * 4);
@@ -261,7 +261,7 @@ VIDEO_START( profpac )
}
-static void init_savestate(running_machine *machine)
+static void init_savestate(running_machine &machine)
{
state_save_register_global_array(machine, astrocade_sparkle);
@@ -303,7 +303,7 @@ static void init_savestate(running_machine *machine)
SCREEN_UPDATE( astrocde )
{
- astrocde_state *state = screen->machine->driver_data<astrocde_state>();
+ astrocde_state *state = screen->machine().driver_data<astrocde_state>();
UINT8 *videoram = state->videoram;
UINT32 sparklebase = 0;
const int colormask = (astrocade_video_config & AC_MONITOR_BW) ? 0 : 0x1f0;
@@ -434,7 +434,7 @@ static TIMER_CALLBACK( interrupt_off )
}
-static void astrocade_trigger_lightpen(running_machine *machine, UINT8 vfeedback, UINT8 hfeedback)
+static void astrocade_trigger_lightpen(running_machine &machine, UINT8 vfeedback, UINT8 hfeedback)
{
/* both bits 1 and 4 enable lightpen interrupts; bit 4 enables them even in horizontal */
/* blanking regions; we treat them both the same here */
@@ -444,14 +444,14 @@ static void astrocade_trigger_lightpen(running_machine *machine, UINT8 vfeedback
if ((interrupt_enable & 0x01) == 0)
{
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, interrupt_vector & 0xf0);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(vfeedback), FUNC(interrupt_off));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(vfeedback), FUNC(interrupt_off));
}
/* mode 1 means assert for 1 instruction */
else
{
cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, interrupt_vector & 0xf0);
- machine->scheduler().timer_set(machine->device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off));
+ machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off));
}
/* latch the feedback registers */
@@ -475,7 +475,7 @@ static TIMER_CALLBACK( scanline_callback )
/* force an update against the current scanline */
if (scanline > 0)
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
/* generate a scanline interrupt if it's time */
if (astrocade_scanline == interrupt_scanline && (interrupt_enable & 0x08) != 0)
@@ -484,14 +484,14 @@ static TIMER_CALLBACK( scanline_callback )
if ((interrupt_enable & 0x04) == 0)
{
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, interrupt_vector);
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_end(), FUNC(interrupt_off));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_end(), FUNC(interrupt_off));
}
/* mode 1 means assert for 1 instruction */
else
{
cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, interrupt_vector);
- machine->scheduler().timer_set(machine->device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off));
+ machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off));
}
}
@@ -501,9 +501,9 @@ static TIMER_CALLBACK( scanline_callback )
/* advance to the next scanline */
scanline++;
- if (scanline >= machine->primary_screen->height())
+ if (scanline >= machine.primary_screen->height())
scanline = 0;
- scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
@@ -535,51 +535,51 @@ READ8_HANDLER( astrocade_data_chip_register_r )
break;
case 0x10: /* player 1 handle */
- result = input_port_read_safe(space->machine, "P1HANDLE", 0xff);
+ result = input_port_read_safe(space->machine(), "P1HANDLE", 0xff);
break;
case 0x11: /* player 2 handle */
- result = input_port_read_safe(space->machine, "P2HANDLE", 0xff);
+ result = input_port_read_safe(space->machine(), "P2HANDLE", 0xff);
break;
case 0x12: /* player 3 handle */
- result = input_port_read_safe(space->machine, "P3HANDLE", 0xff);
+ result = input_port_read_safe(space->machine(), "P3HANDLE", 0xff);
break;
case 0x13: /* player 4 handle */
- result = input_port_read_safe(space->machine, "P4HANDLE", 0xff);
+ result = input_port_read_safe(space->machine(), "P4HANDLE", 0xff);
break;
case 0x14: /* keypad column 0 */
- result = input_port_read_safe(space->machine, "KEYPAD0", 0xff);
+ result = input_port_read_safe(space->machine(), "KEYPAD0", 0xff);
break;
case 0x15: /* keypad column 1 */
- result = input_port_read_safe(space->machine, "KEYPAD1", 0xff);
+ result = input_port_read_safe(space->machine(), "KEYPAD1", 0xff);
break;
case 0x16: /* keypad column 2 */
- result = input_port_read_safe(space->machine, "KEYPAD2", 0xff);
+ result = input_port_read_safe(space->machine(), "KEYPAD2", 0xff);
break;
case 0x17: /* keypad column 3 */
- result = input_port_read_safe(space->machine, "KEYPAD3", 0xff);
+ result = input_port_read_safe(space->machine(), "KEYPAD3", 0xff);
break;
case 0x1c: /* player 1 knob */
- result = input_port_read_safe(space->machine, "P1_KNOB", 0xff);
+ result = input_port_read_safe(space->machine(), "P1_KNOB", 0xff);
break;
case 0x1d: /* player 2 knob */
- result = input_port_read_safe(space->machine, "P2_KNOB", 0xff);
+ result = input_port_read_safe(space->machine(), "P2_KNOB", 0xff);
break;
case 0x1e: /* player 3 knob */
- result = input_port_read_safe(space->machine, "P3_KNOB", 0xff);
+ result = input_port_read_safe(space->machine(), "P3_KNOB", 0xff);
break;
case 0x1f: /* player 4 knob */
- result = input_port_read_safe(space->machine, "P4_KNOB", 0xff);
+ result = input_port_read_safe(space->machine(), "P4_KNOB", 0xff);
break;
}
@@ -649,7 +649,7 @@ WRITE8_HANDLER( astrocade_data_chip_register_w )
case 0x17: /* noise volume register */
case 0x18: /* sound block transfer */
if (astrocade_video_config & AC_SOUND_PRESENT)
- astrocade_sound_w(space->machine->device("astrocade1"), offset, data);
+ astrocade_sound_w(space->machine().device("astrocade1"), offset, data);
break;
case 0x19: /* expand register */
@@ -960,7 +960,7 @@ WRITE8_HANDLER( astrocade_pattern_board_w )
relative to the beginning of time and use that, mod RNG_PERIOD.
*/
-static void init_sparklestar(running_machine *machine)
+static void init_sparklestar(running_machine &machine)
{
UINT32 shiftreg;
int i;
diff --git a/src/mame/video/asuka.c b/src/mame/video/asuka.c
index c7fb30ecf87..e0aa7e03c49 100644
--- a/src/mame/video/asuka.c
+++ b/src/mame/video/asuka.c
@@ -8,7 +8,7 @@
WRITE16_HANDLER( asuka_spritectrl_w )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
/* Bits 2-5 are color bank; in asuka games bit 0 is global priority */
pc090oj_set_sprite_ctrl(state->pc090oj, ((data & 0x3c) >> 2) | ((data & 0x1) << 15));
@@ -21,7 +21,7 @@ WRITE16_HANDLER( asuka_spritectrl_w )
SCREEN_UPDATE( asuka )
{
- asuka_state *state = screen->machine->driver_data<asuka_state>();
+ asuka_state *state = screen->machine().driver_data<asuka_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -30,7 +30,7 @@ SCREEN_UPDATE( asuka )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -47,7 +47,7 @@ SCREEN_UPDATE( asuka )
SCREEN_UPDATE( bonzeadv )
{
- asuka_state *state = screen->machine->driver_data<asuka_state>();
+ asuka_state *state = screen->machine().driver_data<asuka_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -56,7 +56,7 @@ SCREEN_UPDATE( bonzeadv )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index 441159bf13d..a01fc5ab455 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -742,7 +742,7 @@ VIDEO_START( atari )
/* reset the ANTIC color tables */
for( i = 0; i < 256; i ++ )
- antic.color_lookup[i] = (machine->pens[0] << 8) + machine->pens[0];
+ antic.color_lookup[i] = (machine.pens[0] << 8) + machine.pens[0];
LOG(("atari cclk_init\n"));
cclk_init();
@@ -755,7 +755,7 @@ VIDEO_START( atari )
LOG(("atari prio_init\n"));
prio_init();
- for( i = 0; i < machine->primary_screen->height(); i++ )
+ for( i = 0; i < machine.primary_screen->height(); i++ )
{
antic.video[i] = auto_alloc_clear(machine, VIDEO);
}
@@ -774,7 +774,7 @@ SCREEN_UPDATE( atari )
SCREEN_UPDATE_CALL(generic_bitmapped);
- new_tv_artifacts = input_port_read_safe(screen->machine, "artifacts", 0);
+ new_tv_artifacts = input_port_read_safe(screen->machine(), "artifacts", 0);
if( tv_artifacts != new_tv_artifacts )
{
tv_artifacts = new_tv_artifacts;
@@ -938,7 +938,7 @@ static void artifacts_txt(UINT8 * src, UINT8 * dst, int width)
}
-static void antic_linerefresh(running_machine *machine)
+static void antic_linerefresh(running_machine &machine)
{
int x, y;
UINT8 *src;
@@ -946,7 +946,7 @@ static void antic_linerefresh(running_machine *machine)
UINT32 scanline[4 + (HCHARS * 2) + 4];
/* increment the scanline */
- if( ++antic.scanline == machine->primary_screen->height() )
+ if( ++antic.scanline == machine.primary_screen->height() )
{
/* and return to the top if the frame was complete */
antic.scanline = 0;
@@ -1043,20 +1043,20 @@ static void antic_linerefresh(running_machine *machine)
dst[2] = antic.color_lookup[PBK] | antic.color_lookup[PBK] << 16;
dst[3] = antic.color_lookup[PBK] | antic.color_lookup[PBK] << 16;
- draw_scanline8(machine->generic.tmpbitmap, 12, y, MIN(machine->generic.tmpbitmap->width - 12, sizeof(scanline)), (const UINT8 *) scanline, NULL);
+ draw_scanline8(machine.generic.tmpbitmap, 12, y, MIN(machine.generic.tmpbitmap->width - 12, sizeof(scanline)), (const UINT8 *) scanline, NULL);
}
-static int cycle(running_machine *machine)
+static int cycle(running_machine &machine)
{
- return machine->primary_screen->hpos() * CYCLES_PER_LINE / machine->primary_screen->width();
+ return machine.primary_screen->hpos() * CYCLES_PER_LINE / machine.primary_screen->width();
}
-static void after(running_machine *machine, int cycles, timer_expired_func function, const char *funcname)
+static void after(running_machine &machine, int cycles, timer_expired_func function, const char *funcname)
{
- attotime duration = machine->primary_screen->scan_period() * cycles / CYCLES_PER_LINE;
+ attotime duration = machine.primary_screen->scan_period() * cycles / CYCLES_PER_LINE;
(void)funcname;
LOG((" after %3d (%5.1f us) %s\n", cycles, duration.as_double() * 1.0e6, funcname));
- machine->scheduler().timer_set(duration, function, funcname);
+ machine.scheduler().timer_set(duration, function, funcname);
}
static TIMER_CALLBACK( antic_issue_dli )
@@ -1134,13 +1134,13 @@ static TIMER_CALLBACK( antic_line_done )
{
LOG((" @cycle #%3d release WSYNC\n", cycle(machine)));
/* release the CPU if it was actually waiting for HSYNC */
- machine->scheduler().trigger(TRIGGER_HSYNC);
+ machine.scheduler().trigger(TRIGGER_HSYNC);
/* and turn off the 'wait for hsync' flag */
antic.w.wsync = 0;
}
LOG((" @cycle #%3d release CPU\n", cycle(machine)));
/* release the CPU (held for emulating cycles stolen by ANTIC DMA) */
- machine->scheduler().trigger(TRIGGER_STEAL);
+ machine.scheduler().trigger(TRIGGER_STEAL);
/* refresh the display (translate color clocks to pixels) */
antic_linerefresh(machine);
@@ -1160,7 +1160,7 @@ static TIMER_CALLBACK( antic_steal_cycles )
LOG((" @cycle #%3d steal %d cycles\n", cycle(machine), antic.steal_cycles));
after(machine, antic.steal_cycles, FUNC(antic_line_done));
antic.steal_cycles = 0;
- device_spin_until_trigger( machine->device("maincpu"), TRIGGER_STEAL );
+ device_spin_until_trigger( machine.device("maincpu"), TRIGGER_STEAL );
}
@@ -1174,7 +1174,7 @@ static TIMER_CALLBACK( antic_steal_cycles )
*****************************************************************************/
static TIMER_CALLBACK( antic_scanline_render )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
VIDEO *video = antic.video[antic.scanline];
LOG((" @cycle #%3d render mode $%X lines to go #%d\n", cycle(machine), (antic.cmd & 0x0f), antic.modelines));
@@ -1234,7 +1234,7 @@ static TIMER_CALLBACK( antic_scanline_render )
-INLINE void LMS(running_machine *machine, int new_cmd)
+INLINE void LMS(running_machine &machine, int new_cmd)
{
/**************************************************************
* If the LMS bit (load memory scan) of the current display
@@ -1244,7 +1244,7 @@ INLINE void LMS(running_machine *machine, int new_cmd)
**************************************************************/
if( new_cmd & ANTIC_LMS )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int addr = RDANTIC(space);
antic.doffs = (antic.doffs + 1) & DOFFS;
addr += 256 * RDANTIC(space);
@@ -1267,9 +1267,9 @@ INLINE void LMS(running_machine *machine, int new_cmd)
* if so, read a new command and set up the renderer function
*
*****************************************************************************/
-static void antic_scanline_dma(running_machine *machine, int param)
+static void antic_scanline_dma(running_machine &machine, int param)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
LOG((" @cycle #%3d DMA fetch\n", cycle(machine)));
if (antic.scanline == VBL_END)
antic.r.nmist &= ~VBL_NMI;
@@ -1354,7 +1354,7 @@ static void antic_scanline_dma(running_machine *machine, int param)
/* produce empty scanlines until vblank start */
antic.modelines = VBL_START + 1 - antic.scanline;
if( antic.modelines < 0 )
- antic.modelines = machine->primary_screen->height() - antic.scanline;
+ antic.modelines = machine.primary_screen->height() - antic.scanline;
LOG((" JVB $%04x\n", antic.dpage|antic.doffs));
}
else
@@ -1487,7 +1487,7 @@ static void antic_scanline_dma(running_machine *machine, int param)
*
*****************************************************************************/
-static void generic_atari_interrupt(running_machine *machine, void (*handle_keyboard)(running_machine *machine), int button_count)
+static void generic_atari_interrupt(running_machine &machine, void (*handle_keyboard)(running_machine &machine), int button_count)
{
int button_port, i;
@@ -1521,7 +1521,7 @@ static void generic_atari_interrupt(running_machine *machine, void (*handle_keyb
handle_keyboard(machine);
/* do nothing new for the rest of the frame */
- antic.modelines = machine->primary_screen->height() - VBL_START;
+ antic.modelines = machine.primary_screen->height() - VBL_START;
antic.renderer = antic_mode_0_xx;
/* if the CPU want's to be interrupted at vertical blank... */
@@ -1542,22 +1542,22 @@ static void generic_atari_interrupt(running_machine *machine, void (*handle_keyb
INTERRUPT_GEN( a400_interrupt )
{
- generic_atari_interrupt(device->machine, a800_handle_keyboard, 4);
+ generic_atari_interrupt(device->machine(), a800_handle_keyboard, 4);
}
INTERRUPT_GEN( a800_interrupt )
{
- generic_atari_interrupt(device->machine, a800_handle_keyboard, 4);
+ generic_atari_interrupt(device->machine(), a800_handle_keyboard, 4);
}
INTERRUPT_GEN( a800xl_interrupt )
{
- generic_atari_interrupt(device->machine, a800_handle_keyboard, 2);
+ generic_atari_interrupt(device->machine(), a800_handle_keyboard, 2);
}
INTERRUPT_GEN( a5200_interrupt )
{
- generic_atari_interrupt(device->machine, a5200_handle_keypads, 4);
+ generic_atari_interrupt(device->machine(), a5200_handle_keypads, 4);
}
/**************************************************************
diff --git a/src/mame/video/atarifb.c b/src/mame/video/atarifb.c
index 52495e23fb7..5642df160f6 100644
--- a/src/mame/video/atarifb.c
+++ b/src/mame/video/atarifb.c
@@ -14,7 +14,7 @@
*
*************************************/
-static void get_tile_info_common( running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, UINT8 *alpha_videoram )
+static void get_tile_info_common( running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, UINT8 *alpha_videoram )
{
int code = alpha_videoram[tile_index] & 0x3f;
int flip = alpha_videoram[tile_index] & 0x40;
@@ -29,21 +29,21 @@ static void get_tile_info_common( running_machine *machine, tile_data *tileinfo,
static TILE_GET_INFO( alpha1_get_tile_info )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
get_tile_info_common(machine, tileinfo, tile_index, state->alphap1_videoram);
}
static TILE_GET_INFO( alpha2_get_tile_info )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
get_tile_info_common(machine, tileinfo, tile_index, state->alphap2_videoram);
}
static TILE_GET_INFO( field_get_tile_info )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
int code = state->field_videoram[tile_index] & 0x3f;
int flipyx = state->field_videoram[tile_index] >> 6;
@@ -61,7 +61,7 @@ static TILE_GET_INFO( field_get_tile_info )
WRITE8_HANDLER( atarifb_alpha1_videoram_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
state->alphap1_videoram[offset] = data;
tilemap_mark_tile_dirty(state->alpha1_tilemap, offset);
@@ -70,7 +70,7 @@ WRITE8_HANDLER( atarifb_alpha1_videoram_w )
WRITE8_HANDLER( atarifb_alpha2_videoram_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
state->alphap2_videoram[offset] = data;
tilemap_mark_tile_dirty(state->alpha2_tilemap, offset);
@@ -79,7 +79,7 @@ WRITE8_HANDLER( atarifb_alpha2_videoram_w )
WRITE8_HANDLER( atarifb_field_videoram_w )
{
- atarifb_state *state = space->machine->driver_data<atarifb_state>();
+ atarifb_state *state = space->machine().driver_data<atarifb_state>();
state->field_videoram[offset] = data;
tilemap_mark_tile_dirty(state->field_tilemap, offset);
@@ -95,7 +95,7 @@ WRITE8_HANDLER( atarifb_field_videoram_w )
VIDEO_START( atarifb )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
state->alpha1_tilemap = tilemap_create(machine, alpha1_get_tile_info, tilemap_scan_cols, 8, 8, 3, 32);
state->alpha2_tilemap = tilemap_create(machine, alpha2_get_tile_info, tilemap_scan_cols, 8, 8, 3, 32);
@@ -104,9 +104,9 @@ VIDEO_START( atarifb )
-static void draw_playfield_and_alpha( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int playfield_x_offset, int playfield_y_offset )
+static void draw_playfield_and_alpha( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int playfield_x_offset, int playfield_y_offset )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
static const rectangle bigfield_area = { 4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1 };
int scroll_x[1];
@@ -121,9 +121,9 @@ static void draw_playfield_and_alpha( running_machine *machine, bitmap_t *bitmap
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int gfx, int is_soccer )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int gfx, int is_soccer )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
static const rectangle bigfield_area = { 4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1 };
int obj;
@@ -152,14 +152,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
shade = ((state->spriteram[obj * 2 + 1 + 0x20]) & 0x07);
- drawgfx_transpen(bitmap, &bigfield_area, machine->gfx[gfx + 1],
+ drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx + 1],
charcode, shade,
flipx, flipy, sx, sy, 0);
shade = ((state->spriteram[obj * 2 + 1 + 0x20]) & 0x08) >> 3;
}
- drawgfx_transpen(bitmap, &bigfield_area, machine->gfx[gfx],
+ drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx],
charcode, shade,
flipx, flipy, sx, sy, 0);
@@ -171,7 +171,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ((charcode == 0x11) && (sy == 0x07))
{
sy = 0xf1; /* When multiplexed, it's 0x10...why? */
- drawgfx_transpen(bitmap, &bigfield_area, machine->gfx[gfx],
+ drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx],
charcode, 0,
flipx, flipy, sx, sy, 0);
}
@@ -182,9 +182,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( atarifb )
{
- draw_playfield_and_alpha(screen->machine, bitmap, cliprect, 0, 0);
+ draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, 0);
return 0;
}
@@ -192,9 +192,9 @@ SCREEN_UPDATE( atarifb )
SCREEN_UPDATE( abaseb )
{
- draw_playfield_and_alpha(screen->machine, bitmap, cliprect, -8, 0);
+ draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, -8, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, 0);
return 0;
}
@@ -202,9 +202,9 @@ SCREEN_UPDATE( abaseb )
SCREEN_UPDATE( soccer )
{
- draw_playfield_and_alpha(screen->machine, bitmap, cliprect, 0, 8);
+ draw_playfield_and_alpha(screen->machine(), bitmap, cliprect, 0, 8);
- draw_sprites(screen->machine, bitmap, cliprect, 2, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2, 1);
return 0;
}
diff --git a/src/mame/video/atarig1.c b/src/mame/video/atarig1.c
index 8a0a8be32cf..f4a627cac6c 100644
--- a/src/mame/video/atarig1.c
+++ b/src/mame/video/atarig1.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
UINT16 data = state->playfield[tile_index];
int code = (state->playfield_tile_bank << 12) | (data & 0xfff);
int color = (data >> 12) & 7;
@@ -46,7 +46,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
VIDEO_START( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
/* blend the playfields and free the temporary one */
atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x10);
@@ -55,7 +55,7 @@ VIDEO_START( atarig1 )
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,64);
/* initialize the motion objects */
- state->rle = machine->device("rle");
+ state->rle = machine.device("rle");
/* initialize the alphanumerics */
state->alpha_tilemap = tilemap_create(machine, get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
@@ -81,9 +81,9 @@ VIDEO_START( atarig1 )
WRITE16_HANDLER( atarig1_mo_control_w )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine->primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->current_control);
@@ -92,7 +92,7 @@ WRITE16_HANDLER( atarig1_mo_control_w )
void atarig1_scanline_update(screen_device &screen, int scanline)
{
- atarig1_state *state = screen.machine->driver_data<atarig1_state>();
+ atarig1_state *state = screen.machine().driver_data<atarig1_state>();
UINT16 *base = &state->alpha[(scanline / 8) * 64 + 48];
int i;
@@ -153,7 +153,7 @@ void atarig1_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( atarig1 )
{
- atarig1_state *state = screen->machine->driver_data<atarig1_state>();
+ atarig1_state *state = screen->machine().driver_data<atarig1_state>();
/* draw the playfield */
tilemap_draw(bitmap, cliprect, state->playfield_tilemap, 0, 0);
@@ -168,7 +168,7 @@ SCREEN_UPDATE( atarig1 )
SCREEN_EOF( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
atarirle_eof(state->rle);
}
diff --git a/src/mame/video/atarig42.c b/src/mame/video/atarig42.c
index 0274d706f87..59e278fd112 100644
--- a/src/mame/video/atarig42.c
+++ b/src/mame/video/atarig42.c
@@ -33,7 +33,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
UINT16 data = state->playfield[tile_index];
int code = (state->playfield_tile_bank << 12) | (data & 0xfff);
int color = (state->playfield_base >> 5) + ((state->playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7);
@@ -69,7 +69,7 @@ static TILEMAP_MAPPER( atarig42_playfield_scan )
VIDEO_START( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
/* blend the playfields and free the temporary one */
atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
@@ -78,7 +78,7 @@ VIDEO_START( atarig42 )
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, atarig42_playfield_scan, 8,8, 128,64);
/* initialize the motion objects */
- state->rle = machine->device("rle");
+ state->rle = machine.device("rle");
/* initialize the alphanumerics */
state->alpha_tilemap = tilemap_create(machine, get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
@@ -102,9 +102,9 @@ VIDEO_START( atarig42 )
WRITE16_HANDLER( atarig42_mo_control_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine->primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->current_control);
@@ -113,7 +113,7 @@ WRITE16_HANDLER( atarig42_mo_control_w )
void atarig42_scanline_update(screen_device &screen, int scanline)
{
- atarig42_state *state = screen.machine->driver_data<atarig42_state>();
+ atarig42_state *state = screen.machine().driver_data<atarig42_state>();
UINT16 *base = &state->alpha[(scanline / 8) * 64 + 48];
int i;
@@ -182,8 +182,8 @@ void atarig42_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( atarig42 )
{
- atarig42_state *state = screen->machine->driver_data<atarig42_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ atarig42_state *state = screen->machine().driver_data<atarig42_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
/* draw the playfield */
bitmap_fill(priority_bitmap, cliprect, 0);
@@ -229,7 +229,7 @@ SCREEN_UPDATE( atarig42 )
SCREEN_EOF( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarirle_eof(state->rle);
}
diff --git a/src/mame/video/atarigt.c b/src/mame/video/atarigt.c
index 2291a205c34..b7b3f5019a3 100644
--- a/src/mame/video/atarigt.c
+++ b/src/mame/video/atarigt.c
@@ -44,7 +44,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
UINT16 data = state->alpha32[tile_index / 2] >> (16 * (~tile_index & 1));
int code = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
UINT16 data = state->playfield32[tile_index / 2] >> (16 * (~tile_index & 1));
int code = (state->playfield_tile_bank << 12) | (data & 0xfff);
int color = (data >> 12) & 7;
@@ -78,7 +78,7 @@ static TILEMAP_MAPPER( atarigt_playfield_scan )
VIDEO_START( atarigt )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
pen_t *substitute_pens;
int i, width, height;
@@ -89,23 +89,23 @@ VIDEO_START( atarigt )
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, atarigt_playfield_scan, 8,8, 128,64);
/* initialize the motion objects */
- state->rle = machine->device("rle");
+ state->rle = machine.device("rle");
/* initialize the alphanumerics */
state->alpha_tilemap = tilemap_create(machine, get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
/* allocate temp bitmaps */
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->pf_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
state->an_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
/* map pens 1:1 */
substitute_pens = auto_alloc_array(machine, pen_t, 65536);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
substitute_pens[i] = i;
- machine->pens = substitute_pens;
+ machine.pens = substitute_pens;
/* reset statics */
memset(state->colorram, 0, 0x80000);
@@ -167,7 +167,7 @@ UINT16 atarigt_colorram_r(atarigt_state *state, offs_t address)
void atarigt_scanline_update(screen_device &screen, int scanline)
{
- atarigt_state *state = screen.machine->driver_data<atarigt_state>();
+ atarigt_state *state = screen.machine().driver_data<atarigt_state>();
UINT32 *base = &state->alpha32[(scanline / 8) * 32 + 24];
int i;
@@ -508,7 +508,7 @@ PrimRage GALs:
SCREEN_UPDATE( atarigt )
{
- atarigt_state *state = screen->machine->driver_data<atarigt_state>();
+ atarigt_state *state = screen->machine().driver_data<atarigt_state>();
bitmap_t *mo_bitmap = atarirle_get_vram(state->rle, 0);
bitmap_t *tm_bitmap = atarirle_get_vram(state->rle, 1);
UINT16 *cram, *tram;
@@ -634,7 +634,7 @@ SCREEN_UPDATE( atarigt )
SCREEN_EOF( atarigt )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
atarirle_eof(state->rle);
}
diff --git a/src/mame/video/atarigx2.c b/src/mame/video/atarigx2.c
index c0d6592e81c..951d0abb58d 100644
--- a/src/mame/video/atarigx2.c
+++ b/src/mame/video/atarigx2.c
@@ -33,7 +33,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
UINT16 data = state->alpha32[tile_index / 2] >> (16 * (~tile_index & 1));
int code = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
UINT16 data = state->playfield32[tile_index / 2] >> (16 * (~tile_index & 1));
int code = (state->playfield_tile_bank << 12) | (data & 0xfff);
int color = (state->playfield_base >> 5) + ((state->playfield_color_bank << 3) & 0x18) + ((data >> 12) & 7);
@@ -69,7 +69,7 @@ static TILEMAP_MAPPER( atarigx2_playfield_scan )
VIDEO_START( atarigx2 )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
/* blend the playfields and free the temporary one */
atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
@@ -78,7 +78,7 @@ VIDEO_START( atarigx2 )
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, atarigx2_playfield_scan, 8,8, 128,64);
/* initialize the motion objects */
- state->rle = machine->device("rle");
+ state->rle = machine.device("rle");
/* initialize the alphanumerics */
state->alpha_tilemap = tilemap_create(machine, get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
@@ -102,9 +102,9 @@ VIDEO_START( atarigx2 )
WRITE16_HANDLER( atarigx2_mo_control_w )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
- logerror("MOCONT = %d (scan = %d)\n", data, space->machine->primary_screen->vpos());
+ logerror("MOCONT = %d (scan = %d)\n", data, space->machine().primary_screen->vpos());
/* set the control value */
COMBINE_DATA(&state->current_control);
@@ -113,7 +113,7 @@ WRITE16_HANDLER( atarigx2_mo_control_w )
void atarigx2_scanline_update(screen_device &screen, int scanline)
{
- atarigx2_state *state = screen.machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = screen.machine().driver_data<atarigx2_state>();
UINT32 *base = &state->alpha32[(scanline / 8) * 32 + 24];
int i;
@@ -180,8 +180,8 @@ void atarigx2_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( atarigx2 )
{
- atarigx2_state *state = screen->machine->driver_data<atarigx2_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ atarigx2_state *state = screen->machine().driver_data<atarigx2_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
/* draw the playfield */
bitmap_fill(priority_bitmap, cliprect, 0);
@@ -222,7 +222,7 @@ SCREEN_UPDATE( atarigx2 )
SCREEN_EOF( atarigx2 )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarirle_eof(state->rle);
}
diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c
index 47a5b54f5e6..b891953ffbf 100644
--- a/src/mame/video/atarimo.c
+++ b/src/mame/video/atarimo.c
@@ -27,7 +27,9 @@ struct _atarimo_mask
typedef struct _atarimo_data atarimo_data;
struct _atarimo_data
{
- running_machine * machine; /* pointer back to the machine */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* pointer back to the machine */
UINT32 gfxchanged; /* true if the gfx info has changed */
gfx_element gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */
@@ -239,7 +241,7 @@ INLINE int convert_mask(const atarimo_entry *input, atarimo_mask *result)
INLINE void init_gfxelement(atarimo_data *mo, int idx)
{
- mo->gfxelement[idx] = *mo->machine->gfx[idx];
+ mo->gfxelement[idx] = *mo->machine().gfx[idx];
mo->gfxgranularity[idx] = mo->gfxelement[idx].color_granularity;
mo->gfxelement[idx].color_granularity = 1;
mo->gfxelement[idx].color_base = 0;
@@ -251,7 +253,7 @@ INLINE void init_gfxelement(atarimo_data *mo, int idx)
init_savestate: Initialize save states
---------------------------------------------------------------*/
-static void init_savestate(running_machine *machine, int index, atarimo_data *mo)
+static void init_savestate(running_machine &machine, int index, atarimo_data *mo)
{
state_save_register_item(machine, "atarimo", NULL, index, mo->gfxchanged);
state_save_register_item(machine, "atarimo", NULL, index, mo->palettebase);
@@ -295,9 +297,9 @@ static void init_savestate(running_machine *machine, int index, atarimo_data *mo
state_save_register_item(machine, "atarimo", NULL, index, mo->dirtyheight);
#endif
- machine->state().save_item("atarimo", NULL, index, *mo->bitmap, "bitmap");
+ machine.state().save_item("atarimo", NULL, index, *mo->bitmap, "bitmap");
- machine->state().save_memory("atarimo", NULL, index, "spriteram", mo->spriteram, sizeof(atarimo_entry), mo->spriteramsize);
+ machine.state().save_memory("atarimo", NULL, index, "spriteram", mo->spriteram, sizeof(atarimo_entry), mo->spriteramsize);
state_save_register_item_pointer(machine, "atarimo", NULL, index, mo->codelookup, round_to_powerof2(mo->codemask.mask));
@@ -318,12 +320,12 @@ static TIMER_CALLBACK( force_update )
int scanline = param;
if (scanline > 0)
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
scanline += 64;
- if (scanline >= machine->primary_screen->visible_area().max_y)
+ if (scanline >= machine.primary_screen->visible_area().max_y)
scanline = 0;
- force_update_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ force_update_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
/*---------------------------------------------------------------
@@ -332,9 +334,9 @@ static TIMER_CALLBACK( force_update )
the attribute lookup table.
---------------------------------------------------------------*/
-void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
+void atarimo_init(running_machine &machine, int map, const atarimo_desc *desc)
{
- gfx_element *gfx = machine->gfx[desc->gfxindex];
+ gfx_element *gfx = machine.gfx[desc->gfxindex];
atarimo_data *mo = &atarimo[map];
int i;
@@ -357,7 +359,7 @@ void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
convert_mask(&desc->absolutemask, &mo->absolutemask);
/* copy in the basic data */
- mo->machine = machine;
+ mo->m_machine = &machine;
mo->gfxchanged = FALSE;
mo->linked = desc->linked;
@@ -404,7 +406,7 @@ void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
mo->slipram = (map == 0) ? &atarimo_0_slipram : &atarimo_1_slipram;
/* allocate the temp bitmap */
- mo->bitmap = auto_bitmap_alloc(machine, machine->primary_screen->width(), machine->primary_screen->height(), BITMAP_FORMAT_INDEXED16);
+ mo->bitmap = auto_bitmap_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height(), BITMAP_FORMAT_INDEXED16);
bitmap_fill(mo->bitmap, NULL, desc->transpen);
/* allocate the spriteram */
@@ -425,8 +427,8 @@ void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
mo->colorlookup[i] = i;
/* allocate dirty grid */
- mo->dirtywidth = (machine->primary_screen->width() >> mo->tilexshift) + 2;
- mo->dirtyheight = (machine->primary_screen->height() >> mo->tileyshift) + 2;
+ mo->dirtywidth = (machine.primary_screen->width() >> mo->tilexshift) + 2;
+ mo->dirtyheight = (machine.primary_screen->height() >> mo->tileyshift) + 2;
mo->dirtygrid = auto_alloc_array(machine, UINT8, mo->dirtywidth * mo->dirtyheight);
/* allocate the gfx lookup */
@@ -440,8 +442,8 @@ void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc)
init_gfxelement(mo, desc->gfxindex);
/* start a timer to update a few times during refresh */
- force_update_timer = machine->scheduler().timer_alloc(FUNC(force_update));
- force_update_timer->adjust(machine->primary_screen->time_until_pos(0));
+ force_update_timer = machine.scheduler().timer_alloc(FUNC(force_update));
+ force_update_timer->adjust(machine.primary_screen->time_until_pos(0));
init_savestate(machine, map, mo);
@@ -689,7 +691,7 @@ bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *
/* compute minimum Y and wrap around if necessary */
bandclip.min_y = ((band << mo->slipshift) - mo->yscroll + mo->slipoffset) & mo->bitmapymask;
- if (bandclip.min_y > mo->machine->primary_screen->visible_area().max_y)
+ if (bandclip.min_y > mo->machine().primary_screen->visible_area().max_y)
bandclip.min_y -= mo->bitmapheight;
/* maximum Y is based on the minimum */
@@ -807,8 +809,8 @@ if ((temp & 0xff00) == 0xc800)
/* adjust the final coordinates */
xpos &= mo->bitmapxmask;
ypos &= mo->bitmapymask;
- if (xpos > mo->machine->primary_screen->visible_area().max_x) xpos -= mo->bitmapwidth;
- if (ypos > mo->machine->primary_screen->visible_area().max_y) ypos -= mo->bitmapheight;
+ if (xpos > mo->machine().primary_screen->visible_area().max_x) xpos -= mo->bitmapwidth;
+ if (ypos > mo->machine().primary_screen->visible_area().max_y) ypos -= mo->bitmapheight;
/* is this one special? */
if (mo->specialmask.mask != 0 && EXTRACT_DATA(entry, mo->specialmask) == mo->specialvalue)
diff --git a/src/mame/video/atarimo.h b/src/mame/video/atarimo.h
index 7774aca2936..2955322131b 100644
--- a/src/mame/video/atarimo.h
+++ b/src/mame/video/atarimo.h
@@ -94,7 +94,7 @@ struct _atarimo_rect_list
***************************************************************************/
/* setup/shutdown */
-void atarimo_init(running_machine *machine, int map, const atarimo_desc *desc);
+void atarimo_init(running_machine &machine, int map, const atarimo_desc *desc);
UINT16 *atarimo_get_code_lookup(int map, int *size);
UINT8 *atarimo_get_color_lookup(int map, int *size);
UINT8 *atarimo_get_gfx_lookup(int map, int *size);
diff --git a/src/mame/video/atarirle.c b/src/mame/video/atarirle.c
index ac7404bead9..bf1d830c39a 100644
--- a/src/mame/video/atarirle.c
+++ b/src/mame/video/atarirle.c
@@ -126,10 +126,10 @@ static UINT16 *rle_table[8];
STATIC FUNCTION DECLARATIONS
***************************************************************************/
-static void build_rle_tables(running_machine *machine);
+static void build_rle_tables(running_machine &machine);
static int count_objects(const UINT16 *base, int length);
static void prescan_rle(const atarirle_data *mo, int which);
-static void sort_and_render(running_machine *machine, atarirle_data *mo);
+static void sort_and_render(running_machine &machine, atarirle_data *mo);
static void compute_checksum(atarirle_data *mo);
static void draw_rle(atarirle_data *mo, bitmap_t *bitmap, int code, int color, int hflip, int vflip,
int x, int y, int xscale, int yscale, const rectangle *clip);
@@ -271,9 +271,9 @@ INLINE int convert_mask(const atarirle_entry *input, atarirle_mask *result)
static DEVICE_START( atarirle )
{
atarirle_data *mo = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
const atarirle_desc *desc = (const atarirle_desc *)device->baseconfig().static_config();
- const UINT16 *base = (const UINT16 *)machine->region(desc->region)->base();
+ const UINT16 *base = (const UINT16 *)machine.region(desc->region)->base();
int i, width, height;
/* build and allocate the generic tables */
@@ -303,10 +303,10 @@ static DEVICE_START( atarirle )
mo->maxcolors = desc->maxcolors / 16;
mo->rombase = base;
- mo->romlength = machine->region(desc->region)->bytes();
+ mo->romlength = machine.region(desc->region)->bytes();
mo->objectcount = count_objects(base, mo->romlength);
- mo->cliprect = machine->primary_screen->visible_area();
+ mo->cliprect = machine.primary_screen->visible_area();
if (desc->rightclip)
{
mo->cliprect.min_x = desc->leftclip;
@@ -335,8 +335,8 @@ static DEVICE_START( atarirle )
mo->spriteram = auto_alloc_array_clear(machine, atarirle_entry, mo->spriteramsize);
/* allocate bitmaps */
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
mo->vram[0][0] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
mo->vram[0][1] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -399,7 +399,7 @@ DEFINE_LEGACY_DEVICE(ATARIRLE, atarirle);
void atarirle_control_w(device_t *device, UINT8 bits)
{
atarirle_data *mo = get_safe_token(device);
- int scanline = device->machine->primary_screen->vpos();
+ int scanline = device->machine().primary_screen->vpos();
int oldbits = mo->control_bits;
//logerror("atarirle_control_w(%d)\n", bits);
@@ -409,7 +409,7 @@ void atarirle_control_w(device_t *device, UINT8 bits)
return;
/* force a partial update first */
- device->machine->primary_screen->update_partial(scanline);
+ device->machine().primary_screen->update_partial(scanline);
/* if the erase flag was set, erase the front map */
if (oldbits & ATARIRLE_CONTROL_ERASE)
@@ -437,7 +437,7 @@ void atarirle_control_w(device_t *device, UINT8 bits)
if (!(oldbits & ATARIRLE_CONTROL_MOGO) && (bits & ATARIRLE_CONTROL_MOGO))
{
if (mo->command == ATARIRLE_COMMAND_DRAW)
- sort_and_render(device->machine, mo);
+ sort_and_render(device->machine(), mo);
else if (mo->command == ATARIRLE_COMMAND_CHECKSUM)
compute_checksum(mo);
}
@@ -579,7 +579,7 @@ bitmap_t *atarirle_get_vram(device_t *device, int idx)
build_rle_tables: Builds internal table for RLE mapping.
---------------------------------------------------------------*/
-static void build_rle_tables(running_machine *machine)
+static void build_rle_tables(running_machine &machine)
{
UINT16 *base;
int i;
@@ -773,7 +773,7 @@ static void compute_checksum(atarirle_data *mo)
sort_and_render: Render all motion objects in order.
---------------------------------------------------------------*/
-static void sort_and_render(running_machine *machine, atarirle_data *mo)
+static void sort_and_render(running_machine &machine, atarirle_data *mo)
{
bitmap_t *bitmap1 = mo->vram[0][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2];
bitmap_t *bitmap2 = mo->vram[1][(~mo->control_bits & ATARIRLE_CONTROL_FRAME) >> 2];
@@ -882,7 +882,7 @@ if (hilite)
do
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int scaled_width = (scale * info->width + 0x7fff) >> 12;
int scaled_height = (scale * info->height + 0x7fff) >> 12;
int ex, ey, sx = x, sy = y, tx, ty;
@@ -921,13 +921,13 @@ if (hilite)
for (ty = sy; ty <= ey; ty++)
{
- *BITMAP_ADDR16(bitmap1, ty, sx) = machine->rand() & 0xff;
- *BITMAP_ADDR16(bitmap1, ty, ex) = machine->rand() & 0xff;
+ *BITMAP_ADDR16(bitmap1, ty, sx) = machine.rand() & 0xff;
+ *BITMAP_ADDR16(bitmap1, ty, ex) = machine.rand() & 0xff;
}
for (tx = sx; tx <= ex; tx++)
{
- *BITMAP_ADDR16(bitmap1, sy, tx) = machine->rand() & 0xff;
- *BITMAP_ADDR16(bitmap1, ey, tx) = machine->rand() & 0xff;
+ *BITMAP_ADDR16(bitmap1, sy, tx) = machine.rand() & 0xff;
+ *BITMAP_ADDR16(bitmap1, ey, tx) = machine.rand() & 0xff;
}
} while (0);
fprintf(stderr, " Sprite: c=%04X l=%04X h=%d X=%4d (o=%4d w=%3d) Y=%4d (o=%4d h=%d) s=%04X\n",
diff --git a/src/mame/video/atarisy1.c b/src/mame/video/atarisy1.c
index c9b711781f6..2a00e59593a 100644
--- a/src/mame/video/atarisy1.c
+++ b/src/mame/video/atarisy1.c
@@ -79,9 +79,9 @@ static const gfx_layout objlayout_6bpp =
*
*************************************/
-static void update_timers(running_machine *machine, int scanline);
-static void decode_gfx(running_machine *machine, UINT16 *pflookup, UINT16 *molookup);
-static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp);
+static void update_timers(running_machine &machine, int scanline);
+static void decode_gfx(running_machine &machine, UINT16 *pflookup, UINT16 *molookup);
+static int get_bank(running_machine &machine, UINT8 prom1, UINT8 prom2, int bpp);
@@ -93,7 +93,7 @@ static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = (data >> 10) & 0x07;
@@ -104,7 +104,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
UINT16 data = state->playfield[tile_index];
UINT16 lookup = state->playfield_lookup[((data >> 8) & 0x7f) | (state->playfield_tile_bank << 7)];
int gfxindex = (lookup >> 8) & 15;
@@ -160,7 +160,7 @@ VIDEO_START( atarisy1 )
0 /* callback routine for special entries */
};
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
UINT16 motable[256];
UINT16 *codelookup;
UINT8 *colorlookup, *gfxlookup;
@@ -213,10 +213,10 @@ VIDEO_START( atarisy1 )
WRITE16_HANDLER( atarisy1_bankselect_w )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
UINT16 oldselect = *state->bankselect;
UINT16 newselect = oldselect, diff;
- int scanline = space->machine->primary_screen->vpos();
+ int scanline = space->machine().primary_screen->vpos();
/* update memory */
COMBINE_DATA(&newselect);
@@ -225,17 +225,17 @@ WRITE16_HANDLER( atarisy1_bankselect_w )
/* sound CPU reset */
if (diff & 0x0080)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
- if (!(newselect & 0x0080)) atarigen_sound_reset(space->machine);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (newselect & 0x0080) ? CLEAR_LINE : ASSERT_LINE);
+ if (!(newselect & 0x0080)) atarigen_sound_reset(space->machine());
}
/* if MO or playfield banks change, force a partial update */
if (diff & 0x003c)
- space->machine->primary_screen->update_partial(scanline);
+ space->machine().primary_screen->update_partial(scanline);
/* motion object bank select */
atarimo_set_bank(0, (newselect >> 3) & 7);
- update_timers(space->machine, scanline);
+ update_timers(space->machine(), scanline);
/* playfield bank select */
if (diff & 0x0004)
@@ -258,14 +258,14 @@ WRITE16_HANDLER( atarisy1_bankselect_w )
WRITE16_HANDLER( atarisy1_priority_w )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
UINT16 oldpens = state->playfield_priority_pens;
UINT16 newpens = oldpens;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newpens);
if (oldpens != newpens)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->playfield_priority_pens = newpens;
}
@@ -279,14 +279,14 @@ WRITE16_HANDLER( atarisy1_priority_w )
WRITE16_HANDLER( atarisy1_xscroll_w )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
UINT16 oldscroll = *state->xscroll;
UINT16 newscroll = oldscroll;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newscroll);
if (oldscroll != newscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* set the new scroll value */
tilemap_set_scrollx(state->playfield_tilemap, 0, newscroll);
@@ -305,33 +305,33 @@ WRITE16_HANDLER( atarisy1_xscroll_w )
TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback )
{
- atarisy1_state *state = timer.machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
tilemap_set_scrolly(state->playfield_tilemap, 0, param);
}
WRITE16_HANDLER( atarisy1_yscroll_w )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
UINT16 oldscroll = *state->yscroll;
UINT16 newscroll = oldscroll;
- int scanline = space->machine->primary_screen->vpos();
+ int scanline = space->machine().primary_screen->vpos();
int adjusted_scroll;
/* force a partial update in case this changes mid-screen */
COMBINE_DATA(&newscroll);
- space->machine->primary_screen->update_partial(scanline);
+ space->machine().primary_screen->update_partial(scanline);
/* because this latches a new value into the scroll base,
we need to adjust for the scanline */
adjusted_scroll = newscroll;
- if (scanline <= space->machine->primary_screen->visible_area().max_y)
+ if (scanline <= space->machine().primary_screen->visible_area().max_y)
adjusted_scroll -= (scanline + 1);
tilemap_set_scrolly(state->playfield_tilemap, 0, adjusted_scroll);
/* but since we've adjusted it, we must reset it to the normal value
once we hit scanline 0 again */
- state->yscroll_reset_timer->adjust(space->machine->primary_screen->time_until_pos(0), newscroll);
+ state->yscroll_reset_timer->adjust(space->machine().primary_screen->time_until_pos(0), newscroll);
/* update the data */
*state->yscroll = newscroll;
@@ -361,7 +361,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
{
/* if the timer is in the active bank, update the display list */
atarimo_0_spriteram_w(space, offset, data, 0xffff);
- update_timers(space->machine, space->machine->primary_screen->vpos());
+ update_timers(space->machine(), space->machine().primary_screen->vpos());
}
/* if we're about to modify data in the active sprite bank, make sure the video is up-to-date */
@@ -369,7 +369,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
/* renders the next scanline's sprites to the line buffers, but Road Runner still glitches */
/* without the extra +1 */
else
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() + 2);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() + 2);
}
/* let the MO handler do the basic work */
@@ -386,7 +386,7 @@ WRITE16_HANDLER( atarisy1_spriteram_w )
TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback )
{
- address_space *space = timer.machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
/* clear the state */
atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
@@ -395,18 +395,18 @@ TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback )
TIMER_DEVICE_CALLBACK( atarisy1_int3_callback )
{
- atarisy1_state *state = timer.machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
int scanline = param;
/* update the state */
- atarigen_scanline_int_gen(timer.machine->device("maincpu"));
+ atarigen_scanline_int_gen(timer.machine().device("maincpu"));
/* set a timer to turn it off */
- state->int3off_timer->adjust(timer.machine->primary_screen->scan_period());
+ state->int3off_timer->adjust(timer.machine().primary_screen->scan_period());
/* determine the time of the next one */
state->next_timer_scanline = -1;
- update_timers(timer.machine, scanline);
+ update_timers(timer.machine(), scanline);
}
@@ -419,7 +419,7 @@ TIMER_DEVICE_CALLBACK( atarisy1_int3_callback )
READ16_HANDLER( atarisy1_int3state_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
return atarigen->scanline_int_state ? 0x0080 : 0x0000;
}
@@ -431,9 +431,9 @@ READ16_HANDLER( atarisy1_int3state_r )
*
*************************************/
-static void update_timers(running_machine *machine, int scanline)
+static void update_timers(running_machine &machine, int scanline)
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
UINT16 *base = &atarimo_0_spriteram[atarimo_get_bank(0) * 64 * 4];
int link = 0, best = scanline, found = 0;
UINT8 spritevisit[64];
@@ -483,7 +483,7 @@ static void update_timers(running_machine *machine, int scanline)
/* set a new one */
if (best != -1)
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(best), best);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(best), best);
else
state->scanline_timer->reset();
}
@@ -499,7 +499,7 @@ static void update_timers(running_machine *machine, int scanline)
SCREEN_UPDATE( atarisy1 )
{
- atarisy1_state *state = screen->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = screen->machine().driver_data<atarisy1_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
@@ -551,11 +551,11 @@ SCREEN_UPDATE( atarisy1 )
*
*************************************/
-static void decode_gfx(running_machine *machine, UINT16 *pflookup, UINT16 *molookup)
+static void decode_gfx(running_machine &machine, UINT16 *pflookup, UINT16 *molookup)
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
- UINT8 *prom1 = &machine->region("proms")->u8(0x000);
- UINT8 *prom2 = &machine->region("proms")->u8(0x200);
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
+ UINT8 *prom1 = &machine.region("proms")->u8(0x000);
+ UINT8 *prom2 = &machine.region("proms")->u8(0x200);
int obj, i;
/* reset the globals */
@@ -614,9 +614,9 @@ static void decode_gfx(running_machine *machine, UINT16 *pflookup, UINT16 *moloo
*
*************************************/
-static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
+static int get_bank(running_machine &machine, UINT8 prom1, UINT8 prom2, int bpp)
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
const UINT8 *srcdata;
int bank_index, gfx_index;
@@ -646,13 +646,13 @@ static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
return state->bank_gfx[bpp - 4][bank_index];
/* if the bank is out of range, call it 0 */
- const memory_region *tiles = machine->region("tiles");
+ const memory_region *tiles = machine.region("tiles");
if (0x80000 * (bank_index - 1) >= tiles->bytes())
return 0;
/* don't have one? let's make it ... first find any empty slot */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == NULL)
+ if (machine.gfx[gfx_index] == NULL)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -661,15 +661,15 @@ static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
switch (bpp)
{
case 4:
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_4bpp, srcdata, 0x40, 256);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_4bpp, srcdata, 0x40, 256);
break;
case 5:
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_5bpp, srcdata, 0x40, 256);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_5bpp, srcdata, 0x40, 256);
break;
case 6:
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_6bpp, srcdata, 0x40, 256);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &objlayout_6bpp, srcdata, 0x40, 256);
break;
default:
@@ -677,7 +677,7 @@ static int get_bank(running_machine *machine, UINT8 prom1, UINT8 prom2, int bpp)
}
/* set the color information */
- machine->gfx[gfx_index]->color_granularity = 8;
+ machine.gfx[gfx_index]->color_granularity = 8;
state->bank_color_shift[gfx_index] = bpp - 3;
/* set the entry and return it */
diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c
index 8777fc77a89..3621796470d 100644
--- a/src/mame/video/atarisy2.c
+++ b/src/mame/video/atarisy2.c
@@ -28,7 +28,7 @@ static TIMER_CALLBACK( reset_yscroll_callback );
static TILE_GET_INFO( get_alpha_tile_info )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = (data >> 13) & 0x07;
@@ -38,7 +38,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
UINT16 data = state->playfield[tile_index];
int code = state->playfield_tile_bank[(data >> 10) & 1] + (data & 0x3ff);
int color = (data >> 11) & 7;
@@ -92,7 +92,7 @@ VIDEO_START( atarisy2 )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
/* initialize banked memory */
state->alpha = &state->vram[0x0000];
@@ -110,7 +110,7 @@ VIDEO_START( atarisy2 )
tilemap_set_transparent_pen(state->alpha_tilemap, 0);
/* reset the statics */
- state->yscroll_reset_timer = machine->scheduler().timer_alloc(FUNC(reset_yscroll_callback));
+ state->yscroll_reset_timer = machine.scheduler().timer_alloc(FUNC(reset_yscroll_callback));
state->videobank = 0;
/* save states */
@@ -129,14 +129,14 @@ VIDEO_START( atarisy2 )
WRITE16_HANDLER( atarisy2_xscroll_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
UINT16 oldscroll = *state->xscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* update the playfield scrolling - hscroll is clocked on the following scanline */
tilemap_set_scrollx(state->playfield_tilemap, 0, newscroll >> 6);
@@ -155,27 +155,27 @@ WRITE16_HANDLER( atarisy2_xscroll_w )
static TIMER_CALLBACK( reset_yscroll_callback )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
tilemap_set_scrolly(state->playfield_tilemap, 0, param);
}
WRITE16_HANDLER( atarisy2_yscroll_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
UINT16 oldscroll = *state->yscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* if bit 4 is zero, the scroll value is clocked in right away */
if (!(newscroll & 0x10))
- tilemap_set_scrolly(state->playfield_tilemap, 0, (newscroll >> 6) - space->machine->primary_screen->vpos());
+ tilemap_set_scrolly(state->playfield_tilemap, 0, (newscroll >> 6) - space->machine().primary_screen->vpos());
else
- state->yscroll_reset_timer->adjust(space->machine->primary_screen->time_until_pos(0), newscroll >> 6);
+ state->yscroll_reset_timer->adjust(space->machine().primary_screen->time_until_pos(0), newscroll >> 6);
/* update the playfield banking */
if (state->playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400)
@@ -213,14 +213,14 @@ WRITE16_HANDLER( atarisy2_paletteram_w )
int newword, inten, red, green, blue;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
inten = intensity_table[newword & 15];
red = (color_table[(newword >> 12) & 15] * inten) >> 4;
green = (color_table[(newword >> 8) & 15] * inten) >> 4;
blue = (color_table[(newword >> 4) & 15] * inten) >> 4;
- palette_set_color(space->machine, offset, MAKE_RGB(red, green, blue));
+ palette_set_color(space->machine(), offset, MAKE_RGB(red, green, blue));
}
@@ -233,7 +233,7 @@ WRITE16_HANDLER( atarisy2_paletteram_w )
READ16_HANDLER( atarisy2_slapstic_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
int result = state->slapstic_base[offset];
slapstic_tweak(space, offset);
@@ -245,7 +245,7 @@ READ16_HANDLER( atarisy2_slapstic_r )
WRITE16_HANDLER( atarisy2_slapstic_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
slapstic_tweak(space, offset);
@@ -263,14 +263,14 @@ WRITE16_HANDLER( atarisy2_slapstic_w )
READ16_HANDLER( atarisy2_videoram_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
return state->vram[offset | state->videobank];
}
WRITE16_HANDLER( atarisy2_videoram_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
int offs = offset | state->videobank;
/* alpharam? */
@@ -285,7 +285,7 @@ WRITE16_HANDLER( atarisy2_videoram_w )
{
/* force an update if the link of object 0 is about to change */
if (offs == 0x0c03)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
atarimo_0_spriteram_w(space, offs - 0x0c00, data, mem_mask);
}
@@ -314,8 +314,8 @@ WRITE16_HANDLER( atarisy2_videoram_w )
SCREEN_UPDATE( atarisy2 )
{
- atarisy2_state *state = screen->machine->driver_data<atarisy2_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ atarisy2_state *state = screen->machine().driver_data<atarisy2_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/atetris.c b/src/mame/video/atetris.c
index 836618f0e8e..c4edcbff5ae 100644
--- a/src/mame/video/atetris.c
+++ b/src/mame/video/atetris.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_tile_info )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index * 2] | ((videoram[tile_index * 2 + 1] & 7) << 8);
int color = (videoram[tile_index * 2 + 1] & 0xf0) >> 4;
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_tile_info )
WRITE8_HANDLER( atetris_videoram_w )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -51,7 +51,7 @@ WRITE8_HANDLER( atetris_videoram_w )
VIDEO_START( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 64,32);
}
@@ -66,7 +66,7 @@ VIDEO_START( atetris )
SCREEN_UPDATE( atetris )
{
- atetris_state *state = screen->machine->driver_data<atetris_state>();
+ atetris_state *state = screen->machine().driver_data<atetris_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0,0);
return 0;
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index ba3998b7660..59cf315a97a 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -69,7 +69,9 @@ struct _vgvector
typedef struct _vgdata vgdata;
struct _vgdata
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
UINT16 pc;
UINT8 sp;
@@ -170,7 +172,7 @@ static void avg_apply_flipping(int *x, int *y)
*
*************************************/
-static void vg_flush (running_machine *machine)
+static void vg_flush (running_machine &machine)
{
int i = 0;
@@ -482,7 +484,7 @@ static void mhavoc_data(vgdata *vg)
if (vg->pc & 0x2000)
{
- bank = &vg->machine->region("alpha")->base()[0x18000];
+ bank = &vg->machine().region("alpha")->base()[0x18000];
vg->data = bank[(vg->map << 13) | ((vg->pc ^ 1) & 0x1fff)];
}
else
@@ -758,7 +760,7 @@ static int avg_common_strobe2(vgdata *vg)
*/
vector_clear_list();
- vg_flush(vg->machine);
+ vg_flush(vg->machine());
}
}
else
@@ -811,7 +813,7 @@ static int mhavoc_strobe2(vgdata *vg)
| ((vg->dvy >> 1) & 2)
| ((vg->dvy << 1) & 4)
| ((vg->dvy << 2) & 8)
- | ((vg->machine->rand() & 0x7) << 4);
+ | ((vg->machine().rand() & 0x7) << 4);
}
else
{
@@ -1204,7 +1206,7 @@ static TIMER_CALLBACK( vg_set_halt_callback )
static TIMER_CALLBACK( run_state_machine )
{
int cycles = 0;
- UINT8 *state_prom = machine->region("user1")->base();
+ UINT8 *state_prom = machine.region("user1")->base();
while (cycles < VGSLICE)
{
@@ -1257,7 +1259,7 @@ WRITE8_HANDLER( avgdvg_go_w )
*/
vector_clear_list();
}
- vg_flush(space->machine);
+ vg_flush(space->machine());
vg_set_halt(0);
vg_run_timer->adjust(attotime::zero);
@@ -1288,7 +1290,7 @@ WRITE16_HANDLER( avgdvg_reset_word_w )
MACHINE_RESET( avgdvg )
{
- avgdvg_reset_w (machine->device("maincpu")->memory().space(AS_PROGRAM),0,0);
+ avgdvg_reset_w (machine.device("maincpu")->memory().space(AS_PROGRAM),0,0);
}
@@ -1448,7 +1450,7 @@ static const vgconf avg_tomcat =
*
************************************/
-static void register_state (running_machine *machine)
+static void register_state (running_machine &machine)
{
state_save_register_item(machine, "AVG", NULL, 0, vg->pc);
state_save_register_item(machine, "AVG", NULL, 0, vg->sp);
@@ -1489,10 +1491,10 @@ static void register_state (running_machine *machine)
static VIDEO_START( avg_common )
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
vg = &vgd;
- vg->machine = machine;
+ vg->m_machine = &machine;
xmin = visarea.min_x;
ymin = visarea.min_y;
@@ -1504,8 +1506,8 @@ static VIDEO_START( avg_common )
flip_x = flip_y = 0;
- vg_halt_timer = machine->scheduler().timer_alloc(FUNC(vg_set_halt_callback));
- vg_run_timer = machine->scheduler().timer_alloc(FUNC(run_state_machine));
+ vg_halt_timer = machine.scheduler().timer_alloc(FUNC(vg_set_halt_callback));
+ vg_run_timer = machine.scheduler().timer_alloc(FUNC(run_state_machine));
/*
* The x and y DACs use 10 bit of the counter values which are in
@@ -1521,17 +1523,17 @@ static VIDEO_START( avg_common )
VIDEO_START( dvg )
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
vgc = &dvg_default;
vg = &vgd;
- vg->machine = machine;
+ vg->m_machine = &machine;
xmin = visarea.min_x;
ymin = visarea.min_y;
- vg_halt_timer = machine->scheduler().timer_alloc(FUNC(vg_set_halt_callback));
- vg_run_timer = machine->scheduler().timer_alloc(FUNC(run_state_machine));
+ vg_halt_timer = machine.scheduler().timer_alloc(FUNC(vg_set_halt_callback));
+ vg_run_timer = machine.scheduler().timer_alloc(FUNC(run_state_machine));
register_state (machine);
diff --git a/src/mame/video/aztarac.c b/src/mame/video/aztarac.c
index caee2e5b1db..04e15092b71 100644
--- a/src/mame/video/aztarac.c
+++ b/src/mame/video/aztarac.c
@@ -24,7 +24,7 @@ INLINE void read_vectorram(UINT16 *vectorram, int addr, int *x, int *y, int *c)
WRITE16_HANDLER( aztarac_ubr_w )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
UINT16 *vectorram = state->vectorram;
int x, y, c, intensity, xoffset, yoffset, color;
int defaddr, objaddr=0, ndefs;
@@ -44,7 +44,7 @@ WRITE16_HANDLER( aztarac_ubr_w )
if ((c & 0x2000) == 0)
{
defaddr = (c >> 1) & 0x7ff;
- AVECTOR (space->machine, xoffset, yoffset, 0, 0);
+ AVECTOR (space->machine(), xoffset, yoffset, 0, 0);
read_vectorram(vectorram, defaddr, &x, &ndefs, &c);
ndefs++;
@@ -59,9 +59,9 @@ WRITE16_HANDLER( aztarac_ubr_w )
defaddr++;
read_vectorram(vectorram, defaddr, &x, &y, &c);
if ((c & 0xff00) == 0)
- AVECTOR (space->machine, x + xoffset, y + yoffset, 0, 0);
+ AVECTOR (space->machine(), x + xoffset, y + yoffset, 0, 0);
else
- AVECTOR (space->machine, x + xoffset, y + yoffset, color, intensity);
+ AVECTOR (space->machine(), x + xoffset, y + yoffset, color, intensity);
}
}
else
@@ -72,7 +72,7 @@ WRITE16_HANDLER( aztarac_ubr_w )
defaddr++;
read_vectorram(vectorram, defaddr, &x, &y, &c);
color = VECTOR_COLOR222(c & 0x3f);
- AVECTOR (space->machine, x + xoffset, y + yoffset, color, c >> 8);
+ AVECTOR (space->machine(), x + xoffset, y + yoffset, color, c >> 8);
}
}
}
@@ -83,8 +83,8 @@ WRITE16_HANDLER( aztarac_ubr_w )
VIDEO_START( aztarac )
{
- aztarac_state *state = machine->driver_data<aztarac_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ aztarac_state *state = machine.driver_data<aztarac_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int xmin = visarea.min_x;
int ymin = visarea.min_y;
diff --git a/src/mame/video/badlands.c b/src/mame/video/badlands.c
index 714c4bc3512..229709940bf 100644
--- a/src/mame/video/badlands.c
+++ b/src/mame/video/badlands.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
UINT16 data = state->playfield[tile_index];
int code = (data & 0x1fff) + ((data & 0x1000) ? (state->playfield_tile_bank << 12) : 0);
int color = (data >> 13) & 0x07;
@@ -70,7 +70,7 @@ VIDEO_START( badlands )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,32);
@@ -92,11 +92,11 @@ VIDEO_START( badlands )
WRITE16_HANDLER( badlands_pf_bank_w )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
if (ACCESSING_BITS_0_7)
if (state->playfield_tile_bank != (data & 1))
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->playfield_tile_bank = data & 1;
tilemap_mark_all_tiles_dirty(state->playfield_tilemap);
}
@@ -112,7 +112,7 @@ WRITE16_HANDLER( badlands_pf_bank_w )
SCREEN_UPDATE( badlands )
{
- badlands_state *state = screen->machine->driver_data<badlands_state>();
+ badlands_state *state = screen->machine().driver_data<badlands_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c
index 50c1b3a0ef1..cde49a547e9 100644
--- a/src/mame/video/bagman.c
+++ b/src/mame/video/bagman.c
@@ -13,14 +13,14 @@
WRITE8_HANDLER( bagman_videoram_w )
{
- bagman_state *state = space->machine->driver_data<bagman_state>();
+ bagman_state *state = space->machine().driver_data<bagman_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( bagman_colorram_w )
{
- bagman_state *state = space->machine->driver_data<bagman_state>();
+ bagman_state *state = space->machine().driver_data<bagman_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -58,7 +58,7 @@ PALETTE_INIT( bagman )
2, resistances_b, weights_b, 470, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -83,18 +83,18 @@ PALETTE_INIT( bagman )
WRITE8_HANDLER( bagman_flipscreen_w )
{
- bagman_state *state = space->machine->driver_data<bagman_state>();
- if ((flip_screen_get(space->machine) ^ data) & 1)
+ bagman_state *state = space->machine().driver_data<bagman_state>();
+ if ((flip_screen_get(space->machine()) ^ data) & 1)
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- bagman_state *state = machine->driver_data<bagman_state>();
- int gfxbank = (machine->gfx[2] && (state->colorram[tile_index] & 0x10)) ? 2 : 0;
+ bagman_state *state = machine.driver_data<bagman_state>();
+ int gfxbank = (machine.gfx[2] && (state->colorram[tile_index] & 0x10)) ? 2 : 0;
int code = state->videoram[tile_index] + 8 * (state->colorram[tile_index] & 0x20);
int color = state->colorram[tile_index] & 0x0f;
@@ -103,7 +103,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( bagman )
{
- bagman_state *state = machine->driver_data<bagman_state>();
+ bagman_state *state = machine.driver_data<bagman_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -111,9 +111,9 @@ VIDEO_START( bagman )
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- bagman_state *state = machine->driver_data<bagman_state>();
+ bagman_state *state = machine.driver_data<bagman_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -138,7 +138,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (spriteram[offs + 2] && spriteram[offs + 3])
drawgfx_transpen(bitmap,
- cliprect,machine->gfx[1],
+ cliprect,machine.gfx[1],
(spriteram[offs] & 0x3f) + 2 * (spriteram[offs + 1] & 0x20),
spriteram[offs + 1] & 0x1f,
flipx,flipy,
@@ -148,12 +148,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( bagman )
{
- bagman_state *state = screen->machine->driver_data<bagman_state>();
+ bagman_state *state = screen->machine().driver_data<bagman_state>();
bitmap_fill(bitmap,cliprect,0);
if (*state->video_enable == 0)
return 0;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/balsente.c b/src/mame/video/balsente.c
index 0a60eac6998..d07d8b6f5c6 100644
--- a/src/mame/video/balsente.c
+++ b/src/mame/video/balsente.c
@@ -18,16 +18,16 @@
VIDEO_START( balsente )
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
/* reset the system */
state->palettebank_vis = 0;
- state->sprite_bank[0] = machine->region("gfx1")->base();
- state->sprite_bank[1] = machine->region("gfx1")->base() + 0x10000;
+ state->sprite_bank[0] = machine.region("gfx1")->base();
+ state->sprite_bank[1] = machine.region("gfx1")->base() + 0x10000;
/* determine sprite size */
- state->sprite_data = machine->region("gfx1")->base();
- state->sprite_mask = machine->region("gfx1")->bytes() - 1;
+ state->sprite_data = machine.region("gfx1")->base();
+ state->sprite_mask = machine.region("gfx1")->bytes() - 1;
/* register for saving */
state->save_item(NAME(state->expanded_videoram));
@@ -44,7 +44,7 @@ VIDEO_START( balsente )
WRITE8_HANDLER( balsente_videoram_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* expand the two pixel values into two bytes */
state->videoram[offset] = data;
@@ -63,17 +63,17 @@ WRITE8_HANDLER( balsente_videoram_w )
WRITE8_HANDLER( balsente_palette_select_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
/* only update if changed */
if (state->palettebank_vis != (data & 3))
{
/* update the scanline palette */
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1 + BALSENTE_VBEND);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1 + BALSENTE_VBEND);
state->palettebank_vis = data & 3;
}
- logerror("balsente_palette_select_w(%d) scanline=%d\n", data & 3, space->machine->primary_screen->vpos());
+ logerror("balsente_palette_select_w(%d) scanline=%d\n", data & 3, space->machine().primary_screen->vpos());
}
@@ -88,13 +88,13 @@ WRITE8_HANDLER( balsente_paletteram_w )
{
int r, g, b;
- space->machine->generic.paletteram.u8[offset] = data & 0x0f;
+ space->machine().generic.paletteram.u8[offset] = data & 0x0f;
- r = space->machine->generic.paletteram.u8[(offset & ~3) + 0];
- g = space->machine->generic.paletteram.u8[(offset & ~3) + 1];
- b = space->machine->generic.paletteram.u8[(offset & ~3) + 2];
+ r = space->machine().generic.paletteram.u8[(offset & ~3) + 0];
+ g = space->machine().generic.paletteram.u8[(offset & ~3) + 1];
+ b = space->machine().generic.paletteram.u8[(offset & ~3) + 2];
- palette_set_color_rgb(space->machine, offset / 4, pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), offset / 4, pal4bit(r), pal4bit(g), pal4bit(b));
}
@@ -107,11 +107,11 @@ WRITE8_HANDLER( balsente_paletteram_w )
WRITE8_HANDLER( shrike_sprite_select_w )
{
- balsente_state *state = space->machine->driver_data<balsente_state>();
+ balsente_state *state = space->machine().driver_data<balsente_state>();
if( state->sprite_data != state->sprite_bank[(data & 0x80 >> 7) ^ 1 ])
{
logerror( "shrike_sprite_select_w( 0x%02x )\n", data );
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1 + BALSENTE_VBEND);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1 + BALSENTE_VBEND);
state->sprite_data = state->sprite_bank[(data & 0x80 >> 7) ^ 1];
}
@@ -126,9 +126,9 @@ WRITE8_HANDLER( shrike_sprite_select_w )
*
*************************************/
-static void draw_one_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sprite)
+static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sprite)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
int flags = sprite[0];
int image = sprite[1] | ((flags & 7) << 8);
int ypos = sprite[2] + 17 + BALSENTE_VBEND;
@@ -145,7 +145,7 @@ static void draw_one_sprite(running_machine *machine, bitmap_t *bitmap, const re
{
if (ypos >= (16 + BALSENTE_VBEND) && ypos >= cliprect->min_y && ypos <= cliprect->max_y)
{
- const pen_t *pens = &machine->pens[state->palettebank_vis * 256];
+ const pen_t *pens = &machine.pens[state->palettebank_vis * 256];
UINT8 *old = &state->expanded_videoram[(ypos - BALSENTE_VBEND) * 256 + xpos];
int currx = xpos;
@@ -212,8 +212,8 @@ static void draw_one_sprite(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( balsente )
{
- balsente_state *state = screen->machine->driver_data<balsente_state>();
- const pen_t *pens = &screen->machine->pens[state->palettebank_vis * 256];
+ balsente_state *state = screen->machine().driver_data<balsente_state>();
+ const pen_t *pens = &screen->machine().pens[state->palettebank_vis * 256];
int y, i;
/* draw scanlines from the VRAM directly */
@@ -222,7 +222,7 @@ SCREEN_UPDATE( balsente )
/* draw the sprite images */
for (i = 0; i < 40; i++)
- draw_one_sprite(screen->machine, bitmap, cliprect, &state->spriteram[(0xe0 + i * 4) & 0xff]);
+ draw_one_sprite(screen->machine(), bitmap, cliprect, &state->spriteram[(0xe0 + i * 4) & 0xff]);
return 0;
}
diff --git a/src/mame/video/bankp.c b/src/mame/video/bankp.c
index 62f7799a5f7..cc816a30c63 100644
--- a/src/mame/video/bankp.c
+++ b/src/mame/video/bankp.c
@@ -38,7 +38,7 @@ PALETTE_INIT( bankp )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
for (i = 0; i < 32; i++)
{
@@ -60,7 +60,7 @@ PALETTE_INIT( bankp )
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -68,28 +68,28 @@ PALETTE_INIT( bankp )
/* color_prom now points to the beginning of the lookup table */
/* charset #1 lookup table */
- for (i = 0; i < machine->gfx[0]->total_colors * machine->gfx[0]->color_granularity; i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i, *color_prom++ & 0x0f);
+ for (i = 0; i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity; i++)
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, *color_prom++ & 0x0f);
color_prom += 128; /* skip the bottom half of the PROM - seems to be not used */
/* charset #2 lookup table */
- for (i = 0; i < machine->gfx[1]->total_colors * machine->gfx[1]->color_granularity; i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + i, *color_prom++ & 0x0f);
+ for (i = 0; i < machine.gfx[1]->total_colors * machine.gfx[1]->color_granularity; i++)
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i, *color_prom++ & 0x0f);
/* the bottom half of the PROM seems to be not used */
}
WRITE8_HANDLER( bankp_scroll_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
state->scroll_x = data;
}
WRITE8_HANDLER( bankp_videoram_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -97,7 +97,7 @@ WRITE8_HANDLER( bankp_videoram_w )
WRITE8_HANDLER( bankp_colorram_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -105,7 +105,7 @@ WRITE8_HANDLER( bankp_colorram_w )
WRITE8_HANDLER( bankp_videoram2_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -113,7 +113,7 @@ WRITE8_HANDLER( bankp_videoram2_w )
WRITE8_HANDLER( bankp_colorram2_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -121,7 +121,7 @@ WRITE8_HANDLER( bankp_colorram2_w )
WRITE8_HANDLER( bankp_out_w )
{
- bankp_state *state = space->machine->driver_data<bankp_state>();
+ bankp_state *state = space->machine().driver_data<bankp_state>();
/* bits 0-1 are playfield priority */
/* TODO: understand how this works */
state->priority = data & 0x03;
@@ -132,14 +132,14 @@ WRITE8_HANDLER( bankp_out_w )
interrupt_enable_w(space, 0, (data & 0x10) >> 4);
/* bit 5 controls screen flip */
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
/* bits 6-7 unknown */
}
static TILE_GET_INFO( get_bg_tile_info )
{
- bankp_state *state = machine->driver_data<bankp_state>();
+ bankp_state *state = machine.driver_data<bankp_state>();
int code = state->videoram2[tile_index] + 256 * (state->colorram2[tile_index] & 0x07);
int color = state->colorram2[tile_index] >> 4;
int flags = (state->colorram2[tile_index] & 0x08) ? TILE_FLIPX : 0;
@@ -150,7 +150,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bankp_state *state = machine->driver_data<bankp_state>();
+ bankp_state *state = machine.driver_data<bankp_state>();
int code = state->videoram[tile_index] + 256 * ((state->colorram[tile_index] & 3) >> 0);
int color = state->colorram[tile_index] >> 3;
int flags = (state->colorram[tile_index] & 0x04) ? TILE_FLIPX : 0;
@@ -161,13 +161,13 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( bankp )
{
- bankp_state *state = machine->driver_data<bankp_state>();
+ bankp_state *state = machine.driver_data<bankp_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[1], 0);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[1], 0);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 0);
state->save_item(NAME(state->scroll_x));
state->save_item(NAME(state->priority));
@@ -175,9 +175,9 @@ VIDEO_START( bankp )
SCREEN_UPDATE( bankp )
{
- bankp_state *state = screen->machine->driver_data<bankp_state>();
+ bankp_state *state = screen->machine().driver_data<bankp_state>();
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
tilemap_set_scrollx(state->fg_tilemap, 0, -state->scroll_x);
tilemap_set_scrollx(state->bg_tilemap, 0, 0);
diff --git a/src/mame/video/baraduke.c b/src/mame/video/baraduke.c
index 29d5a5c74e0..f225d34af3f 100644
--- a/src/mame/video/baraduke.c
+++ b/src/mame/video/baraduke.c
@@ -73,7 +73,7 @@ static TILEMAP_MAPPER( tx_tilemap_scan )
static TILE_GET_INFO( tx_get_tile_info )
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
SET_TILE_INFO(
0,
state->textram[tile_index],
@@ -83,7 +83,7 @@ static TILE_GET_INFO( tx_get_tile_info )
static TILE_GET_INFO( get_tile_info0 )
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
int code = state->videoram[2*tile_index];
int attr = state->videoram[2*tile_index + 1];
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_tile_info0 )
static TILE_GET_INFO( get_tile_info1 )
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
int code = state->videoram[0x1000 + 2*tile_index];
int attr = state->videoram[0x1000 + 2*tile_index + 1];
@@ -117,7 +117,7 @@ static TILE_GET_INFO( get_tile_info1 )
VIDEO_START( baraduke )
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
state->tx_tilemap = tilemap_create(machine, tx_get_tile_info,tx_tilemap_scan,8,8,36,28);
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1,tilemap_scan_rows,8,8,64,32);
@@ -140,26 +140,26 @@ VIDEO_START( baraduke )
READ8_HANDLER( baraduke_videoram_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( baraduke_videoram_w )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap[offset/0x1000],(offset&0xfff)/2);
}
READ8_HANDLER( baraduke_textram_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
return state->textram[offset];
}
WRITE8_HANDLER( baraduke_textram_w )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x3ff);
}
@@ -167,7 +167,7 @@ WRITE8_HANDLER( baraduke_textram_w )
static void scroll_w(address_space *space, int layer, int offset, int data)
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
switch (offset)
{
case 0: /* high scroll x */
@@ -195,13 +195,13 @@ WRITE8_HANDLER( baraduke_scroll1_w )
READ8_HANDLER( baraduke_spriteram_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
return state->spriteram[offset];
}
WRITE8_HANDLER( baraduke_spriteram_w )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
state->spriteram[offset] = data;
/* a write to this offset tells the sprite chip to buffer the sprite list */
@@ -217,9 +217,9 @@ WRITE8_HANDLER( baraduke_spriteram_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
UINT8 *spriteram = state->spriteram + 0x1800;
const UINT8 *source = &spriteram[0x0000];
const UINT8 *finish = &spriteram[0x0800-16]; /* the last is NOT a sprite */
@@ -278,7 +278,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transpen( bitmap, cliprect,machine->gfx[3],
+ drawgfx_transpen( bitmap, cliprect,machine.gfx[3],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
@@ -293,9 +293,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void set_scroll(running_machine *machine, int layer)
+static void set_scroll(running_machine &machine, int layer)
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
static const int xdisp[2] = { 26, 24 };
int scrollx, scrolly;
@@ -314,16 +314,16 @@ static void set_scroll(running_machine *machine, int layer)
SCREEN_UPDATE( baraduke )
{
- baraduke_state *state = screen->machine->driver_data<baraduke_state>();
+ baraduke_state *state = screen->machine().driver_data<baraduke_state>();
UINT8 *spriteram = state->spriteram + 0x1800;
int back;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */
- flip_screen_set_no_update(screen->machine, spriteram[0x07f6] & 0x01);
- tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
- set_scroll(screen->machine, 0);
- set_scroll(screen->machine, 1);
+ /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */
+ flip_screen_set_no_update(screen->machine(), spriteram[0x07f6] & 0x01);
+ tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ set_scroll(screen->machine(), 0);
+ set_scroll(screen->machine(), 1);
if (((state->xscroll[0] & 0x0e00) >> 9) == 6)
back = 1;
@@ -331,9 +331,9 @@ SCREEN_UPDATE( baraduke )
back = 0;
tilemap_draw(bitmap,cliprect,state->bg_tilemap[back],TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap[back ^ 1],0,0);
- draw_sprites(screen->machine, bitmap,cliprect,1);
+ draw_sprites(screen->machine(), bitmap,cliprect,1);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -342,7 +342,7 @@ SCREEN_UPDATE( baraduke )
SCREEN_EOF( baraduke )
{
- baraduke_state *state = machine->driver_data<baraduke_state>();
+ baraduke_state *state = machine.driver_data<baraduke_state>();
if (state->copy_sprites)
{
UINT8 *spriteram = state->spriteram + 0x1800;
diff --git a/src/mame/video/batman.c b/src/mame/video/batman.c
index 7cdedb77ac2..8d3f8bafbac 100644
--- a/src/mame/video/batman.c
+++ b/src/mame/video/batman.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
UINT16 data = state->alpha[tile_index];
int code = ((data & 0x400) ? (state->alpha_tile_bank * 0x400) : 0) + (data & 0x3ff);
int color = (data >> 11) & 0x0f;
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] & 0xff;
int code = data1 & 0x7fff;
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
static TILE_GET_INFO( get_playfield2_tile_info )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
UINT16 data1 = state->playfield2[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -95,7 +95,7 @@ VIDEO_START( batman )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -122,7 +122,7 @@ VIDEO_START( batman )
void batman_scanline_update(screen_device &screen, int scanline)
{
- batman_state *state = screen.machine->driver_data<batman_state>();
+ batman_state *state = screen.machine().driver_data<batman_state>();
/* update the scanline parameters */
if (scanline <= screen.visible_area().max_y && state->atarivc_state.rowscroll_enable)
@@ -195,8 +195,8 @@ void batman_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( batman )
{
- batman_state *state = screen->machine->driver_data<batman_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ batman_state *state = screen->machine().driver_data<batman_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/battlane.c b/src/mame/video/battlane.c
index 87977bdb362..35d65a5d397 100644
--- a/src/mame/video/battlane.c
+++ b/src/mame/video/battlane.c
@@ -17,7 +17,7 @@
WRITE8_HANDLER( battlane_palette_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
int r, g, b;
int bit0, bit1, bit2;
@@ -42,37 +42,37 @@ WRITE8_HANDLER( battlane_palette_w )
bit2 = (~data >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
WRITE8_HANDLER( battlane_scrollx_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->video_ctrl & 0x01) << 8) + data);
}
WRITE8_HANDLER( battlane_scrolly_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->cpu_control & 0x01) << 8) + data);
}
WRITE8_HANDLER( battlane_tileram_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
state->tileram[offset] = data;
//tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( battlane_spriteram_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
state->spriteram[offset] = data;
}
WRITE8_HANDLER( battlane_bitmap_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
int i, orval;
orval = (~state->video_ctrl >> 1) & 0x07;
@@ -95,13 +95,13 @@ WRITE8_HANDLER( battlane_bitmap_w )
WRITE8_HANDLER( battlane_video_ctrl_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
state->video_ctrl = data;
}
static TILE_GET_INFO( get_tile_info_bg )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
int code = state->tileram[tile_index];
int attr = state->tileram[tile_index + 0x400];
int gfxn = (attr & 0x01) + 1;
@@ -143,14 +143,14 @@ static TILEMAP_MAPPER( battlane_tilemap_scan_rows_2x2 )
VIDEO_START( battlane )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, battlane_tilemap_scan_rows_2x2, 16, 16, 32, 32);
state->screen_bitmap = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
int offs, attr, code, color, sx, sy, flipx, flipy, dy;
for (offs = 0; offs < 0x100; offs += 4)
@@ -191,7 +191,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code,
color,
flipx, flipy,
@@ -202,7 +202,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
dy = flipy ? 16 : -16;
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code + 1,
color,
flipx, flipy,
@@ -212,9 +212,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_fg_bitmap( running_machine *machine, bitmap_t *bitmap )
+static void draw_fg_bitmap( running_machine &machine, bitmap_t *bitmap )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
int x, y, data;
for (y = 0; y < 32 * 8; y++)
@@ -236,12 +236,12 @@ static void draw_fg_bitmap( running_machine *machine, bitmap_t *bitmap )
SCREEN_UPDATE( battlane )
{
- battlane_state *state = screen->machine->driver_data<battlane_state>();
+ battlane_state *state = screen->machine().driver_data<battlane_state>();
tilemap_mark_all_tiles_dirty(state->bg_tilemap); // HACK
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_fg_bitmap(screen->machine, bitmap);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_fg_bitmap(screen->machine(), bitmap);
return 0;
}
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
index 710e4d6dea7..b3aa9d49dcb 100644
--- a/src/mame/video/battlera.c
+++ b/src/mame/video/battlera.c
@@ -17,24 +17,24 @@
VIDEO_START( battlera )
{
- battlera_state *state = machine->driver_data<battlera_state>();
+ battlera_state *state = machine.driver_data<battlera_state>();
state->HuC6270_vram=auto_alloc_array(machine, UINT8, 0x20000);
state->vram_dirty=auto_alloc_array(machine, UINT8, 0x1000);
memset(state->HuC6270_vram,0,0x20000);
memset(state->vram_dirty,1,0x1000);
- state->tile_bitmap=auto_bitmap_alloc(machine,512,512,machine->primary_screen->format());
- state->front_bitmap=auto_bitmap_alloc(machine,512,512,machine->primary_screen->format());
+ state->tile_bitmap=auto_bitmap_alloc(machine,512,512,machine.primary_screen->format());
+ state->front_bitmap=auto_bitmap_alloc(machine,512,512,machine.primary_screen->format());
state->vram_ptr=0;
state->inc_value=1;
state->current_scanline=0;
state->irq_enable=state->rcr_enable=state->sb_enable=state->bb_enable=0;
- gfx_element_set_source(machine->gfx[0], state->HuC6270_vram);
- gfx_element_set_source(machine->gfx[1], state->HuC6270_vram);
- gfx_element_set_source(machine->gfx[2], state->blank_tile);
+ gfx_element_set_source(machine.gfx[0], state->HuC6270_vram);
+ gfx_element_set_source(machine.gfx[1], state->HuC6270_vram);
+ gfx_element_set_source(machine.gfx[2], state->blank_tile);
}
/******************************************************************************/
@@ -43,29 +43,29 @@ WRITE8_HANDLER( battlera_palette_w )
{
int pal_word;
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
if (offset%2) offset-=1;
- pal_word=space->machine->generic.paletteram.u8[offset] | (space->machine->generic.paletteram.u8[offset+1]<<8);
- palette_set_color_rgb(space->machine, offset/2, pal3bit(pal_word >> 3), pal3bit(pal_word >> 6), pal3bit(pal_word >> 0));
+ pal_word=space->machine().generic.paletteram.u8[offset] | (space->machine().generic.paletteram.u8[offset+1]<<8);
+ palette_set_color_rgb(space->machine(), offset/2, pal3bit(pal_word >> 3), pal3bit(pal_word >> 6), pal3bit(pal_word >> 0));
}
/******************************************************************************/
READ8_HANDLER( HuC6270_debug_r )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
return state->HuC6270_vram[offset];
}
WRITE8_HANDLER( HuC6270_debug_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
state->HuC6270_vram[offset]=data;
}
READ8_HANDLER( HuC6270_register_r )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
int rr;
if ((state->current_scanline+56)==state->HuC6270_registers[6]) rr=1; else rr=0;
@@ -82,7 +82,7 @@ READ8_HANDLER( HuC6270_register_r )
WRITE8_HANDLER( HuC6270_register_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
switch (offset) {
case 0: /* Select data region */
state->VDC_register=data;
@@ -97,7 +97,7 @@ WRITE8_HANDLER( HuC6270_register_w )
#ifdef UNUSED_FUNCTION
READ8_HANDLER( HuC6270_data_r )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
int result;
switch (offset) {
@@ -116,7 +116,7 @@ READ8_HANDLER( HuC6270_data_r )
WRITE8_HANDLER( HuC6270_data_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
switch (offset) {
case 0: /* LSB */
switch (state->VDC_register) {
@@ -132,8 +132,8 @@ WRITE8_HANDLER( HuC6270_data_w )
case 2: /* VRAM */
if (state->HuC6270_vram[(state->HuC6270_registers[0]<<1)|1]!=data) {
state->HuC6270_vram[(state->HuC6270_registers[0]<<1)|1]=data;
- gfx_element_mark_dirty(space->machine->gfx[0], state->HuC6270_registers[0]>>4);
- gfx_element_mark_dirty(space->machine->gfx[1], state->HuC6270_registers[0]>>6);
+ gfx_element_mark_dirty(space->machine().gfx[0], state->HuC6270_registers[0]>>4);
+ gfx_element_mark_dirty(space->machine().gfx[1], state->HuC6270_registers[0]>>6);
}
if (state->HuC6270_registers[0]<0x1000) state->vram_dirty[state->HuC6270_registers[0]]=1;
return;
@@ -192,8 +192,8 @@ WRITE8_HANDLER( HuC6270_data_w )
case 2: /* VWR - VRAM */
if (state->HuC6270_vram[(state->HuC6270_registers[0]<<1)|0]!=data) {
state->HuC6270_vram[(state->HuC6270_registers[0]<<1)|0]=data;
- gfx_element_mark_dirty(space->machine->gfx[0], state->HuC6270_registers[0]>>4);
- gfx_element_mark_dirty(space->machine->gfx[1], state->HuC6270_registers[0]>>6);
+ gfx_element_mark_dirty(space->machine().gfx[0], state->HuC6270_registers[0]>>4);
+ gfx_element_mark_dirty(space->machine().gfx[1], state->HuC6270_registers[0]>>6);
if (state->HuC6270_registers[0]<0x1000) state->vram_dirty[state->HuC6270_registers[0]]=1;
}
state->HuC6270_registers[0]+=state->inc_value;
@@ -242,9 +242,9 @@ WRITE8_HANDLER( HuC6270_data_w )
/******************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *clip,int pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *clip,int pri)
{
- battlera_state *state = machine->driver_data<battlera_state>();
+ battlera_state *state = machine.driver_data<battlera_state>();
int offs,my,mx,code,code2,fx,fy,cgy=0,cgx,colour,i,yinc;
/* Draw sprites, starting at SATB, draw in _reverse_ order */
@@ -283,14 +283,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (fy) { my += 16*(cgy-1); yinc = -16; } /* Swap tile order on Y flips */
for (i=0; i<cgy; i++) {
- drawgfx_transpen(bitmap,clip,machine->gfx[1],
+ drawgfx_transpen(bitmap,clip,machine.gfx[1],
code,
colour,
fx,fy,
mx,my,0);
if (cgx)
- drawgfx_transpen(bitmap,clip,machine->gfx[1],
+ drawgfx_transpen(bitmap,clip,machine.gfx[1],
code2,
colour,
fx,fy,
@@ -309,13 +309,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( battlera )
{
- battlera_state *state = screen->machine->driver_data<battlera_state>();
+ battlera_state *state = screen->machine().driver_data<battlera_state>();
int offs,code,scrollx,scrolly,mx,my;
/* if any tiles changed, redraw the VRAM */
- if (screen->machine->gfx[0]->dirtyseq != state->tile_dirtyseq)
+ if (screen->machine().gfx[0]->dirtyseq != state->tile_dirtyseq)
{
- state->tile_dirtyseq = screen->machine->gfx[0]->dirtyseq;
+ state->tile_dirtyseq = screen->machine().gfx[0]->dirtyseq;
memset(state->vram_dirty, 1, 0x1000);
}
@@ -330,17 +330,17 @@ SCREEN_UPDATE( battlera )
/* If this tile was changed OR tilemap was changed, redraw */
if (state->vram_dirty[offs/2]) {
state->vram_dirty[offs/2]=0;
- drawgfx_opaque(state->tile_bitmap,0,screen->machine->gfx[0],
+ drawgfx_opaque(state->tile_bitmap,0,screen->machine().gfx[0],
code,
state->HuC6270_vram[offs] >> 4,
0,0,
8*mx,8*my);
- drawgfx_opaque(state->front_bitmap,0,screen->machine->gfx[2],
+ drawgfx_opaque(state->front_bitmap,0,screen->machine().gfx[2],
0,
0, /* fill the spot with pen 256 */
0,0,
8*mx,8*my);
- drawgfx_transmask(state->front_bitmap,0,screen->machine->gfx[0],
+ drawgfx_transmask(state->front_bitmap,0,screen->machine().gfx[0],
code,
state->HuC6270_vram[offs] >> 4,
0,0,
@@ -357,13 +357,13 @@ SCREEN_UPDATE( battlera )
/* Todo: Background enable (not used anyway) */
/* Render low priority sprites, if enabled */
- if (state->sb_enable) draw_sprites(screen->machine,bitmap,cliprect,0);
+ if (state->sb_enable) draw_sprites(screen->machine(),bitmap,cliprect,0);
/* Render background over sprites */
copyscrollbitmap_trans(bitmap,state->front_bitmap,1,&scrollx,1,&scrolly,cliprect,256);
/* Render high priority sprites, if enabled */
- if (state->sb_enable) draw_sprites(screen->machine,bitmap,cliprect,1);
+ if (state->sb_enable) draw_sprites(screen->machine(),bitmap,cliprect,1);
return 0;
}
@@ -372,19 +372,19 @@ SCREEN_UPDATE( battlera )
INTERRUPT_GEN( battlera_interrupt )
{
- battlera_state *state = device->machine->driver_data<battlera_state>();
+ battlera_state *state = device->machine().driver_data<battlera_state>();
state->current_scanline=255-cpu_getiloops(device); /* 8 lines clipped at top */
/* If raster interrupt occurs, refresh screen _up_ to this point */
if (state->rcr_enable && (state->current_scanline+56)==state->HuC6270_registers[6]) {
- device->machine->primary_screen->update_partial(state->current_scanline);
+ device->machine().primary_screen->update_partial(state->current_scanline);
device_set_input_line(device, 0, HOLD_LINE); /* RCR interrupt */
}
/* Start of vblank */
else if (state->current_scanline==240) {
state->bldwolf_vblank=1;
- device->machine->primary_screen->update_partial(240);
+ device->machine().primary_screen->update_partial(240);
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE); /* VBL */
}
diff --git a/src/mame/video/battlex.c b/src/mame/video/battlex.c
index db9190150dd..b5ece4a3939 100644
--- a/src/mame/video/battlex.c
+++ b/src/mame/video/battlex.c
@@ -10,18 +10,18 @@
WRITE8_HANDLER( battlex_palette_w )
{
- palette_set_color_rgb(space->machine, offset, pal1bit(data >> 0), pal1bit(data >> 2), pal1bit(data >> 1));
+ palette_set_color_rgb(space->machine(), offset, pal1bit(data >> 0), pal1bit(data >> 2), pal1bit(data >> 1));
}
WRITE8_HANDLER( battlex_scroll_x_lsb_w )
{
- battlex_state *state = space->machine->driver_data<battlex_state>();
+ battlex_state *state = space->machine().driver_data<battlex_state>();
state->scroll_lsb = data;
}
WRITE8_HANDLER( battlex_scroll_x_msb_w )
{
- battlex_state *state = space->machine->driver_data<battlex_state>();
+ battlex_state *state = space->machine().driver_data<battlex_state>();
state->scroll_msb = data;
}
@@ -31,27 +31,27 @@ WRITE8_HANDLER( battlex_scroll_starfield_w )
WRITE8_HANDLER( battlex_videoram_w )
{
- battlex_state *state = space->machine->driver_data<battlex_state>();
+ battlex_state *state = space->machine().driver_data<battlex_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( battlex_flipscreen_w )
{
- battlex_state *state = space->machine->driver_data<battlex_state>();
+ battlex_state *state = space->machine().driver_data<battlex_state>();
state->starfield_enabled = data & 0x10;
- if (flip_screen_get(space->machine) != (data >> 7))
+ if (flip_screen_get(space->machine()) != (data >> 7))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
int tile = state->videoram[tile_index * 2] | (((state->videoram[tile_index * 2 + 1] & 0x01)) << 8);
int color = (state->videoram[tile_index * 2 + 1] & 0x0e) >> 1; // high bits unused
@@ -60,14 +60,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( battlex )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- battlex_state *state = machine->driver_data<battlex_state>();
- const gfx_element *gfx = machine->gfx[1];
+ battlex_state *state = machine.driver_data<battlex_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *source = state->spriteram;
UINT8 *finish = state->spriteram + 0x200;
@@ -97,11 +97,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE(battlex)
{
- battlex_state *state = screen->machine->driver_data<battlex_state>();
+ battlex_state *state = screen->machine().driver_data<battlex_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_lsb | (state->scroll_msb << 8));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/battlnts.c b/src/mame/video/battlnts.c
index f62483c791d..61b4866c7a7 100644
--- a/src/mame/video/battlnts.c
+++ b/src/mame/video/battlnts.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void battlnts_tile_callback(running_machine *machine, int layer, int bank, int *code, int *color, int *flags)
+void battlnts_tile_callback(running_machine &machine, int layer, int bank, int *code, int *color, int *flags)
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
*code |= ((*color & 0x0f) << 9) | ((*color & 0x40) << 2);
*color = state->layer_colorbase[layer];
@@ -22,9 +22,9 @@ void battlnts_tile_callback(running_machine *machine, int layer, int bank, int *
***************************************************************************/
-void battlnts_sprite_callback(running_machine *machine, int *code,int *color)
+void battlnts_sprite_callback(running_machine &machine, int *code,int *color)
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
*code |= ((*color & 0xc0) << 2) | state->spritebank;
*code = (*code << 2) | ((*color & 0x30) >> 4);
@@ -33,7 +33,7 @@ void battlnts_sprite_callback(running_machine *machine, int *code,int *color)
WRITE8_HANDLER( battlnts_spritebank_w )
{
- battlnts_state *state = space->machine->driver_data<battlnts_state>();
+ battlnts_state *state = space->machine().driver_data<battlnts_state>();
state->spritebank = 1024 * (data & 1);
}
@@ -45,12 +45,12 @@ WRITE8_HANDLER( battlnts_spritebank_w )
SCREEN_UPDATE( battlnts )
{
- battlnts_state *state = screen->machine->driver_data<battlnts_state>();
+ battlnts_state *state = screen->machine().driver_data<battlnts_state>();
k007342_tilemap_update(state->k007342);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE ,0);
- k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine->gfx[1]);
+ k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine().gfx[1]);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE ,0);
return 0;
}
diff --git a/src/mame/video/bbusters.c b/src/mame/video/bbusters.c
index fef7305185f..caa71bf1ad5 100644
--- a/src/mame/video/bbusters.c
+++ b/src/mame/video/bbusters.c
@@ -29,7 +29,7 @@
static TILE_GET_INFO( get_bbusters_tile_info )
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
UINT16 tile = state->videoram[tile_index];
SET_TILE_INFO(0,tile&0xfff,tile>>12,0);
@@ -37,7 +37,7 @@ static TILE_GET_INFO( get_bbusters_tile_info )
static TILE_GET_INFO( get_pf1_tile_info )
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
UINT16 tile = state->pf1_data[tile_index];
SET_TILE_INFO(3,tile&0xfff,tile>>12,0);
@@ -45,7 +45,7 @@ static TILE_GET_INFO( get_pf1_tile_info )
static TILE_GET_INFO( get_pf2_tile_info )
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
UINT16 tile = state->pf2_data[tile_index];
SET_TILE_INFO(4,tile&0xfff,tile>>12,0);
@@ -53,7 +53,7 @@ static TILE_GET_INFO( get_pf2_tile_info )
WRITE16_HANDLER( bbusters_video_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->fix_tilemap, offset);
@@ -61,7 +61,7 @@ WRITE16_HANDLER( bbusters_video_w )
WRITE16_HANDLER( bbusters_pf1_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap, offset);
@@ -69,7 +69,7 @@ WRITE16_HANDLER( bbusters_pf1_w )
WRITE16_HANDLER( bbusters_pf2_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
COMBINE_DATA(&state->pf2_data[offset]);
tilemap_mark_tile_dirty(state->pf2_tilemap, offset);
@@ -79,7 +79,7 @@ WRITE16_HANDLER( bbusters_pf2_w )
VIDEO_START( bbuster )
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
state->fix_tilemap = tilemap_create(machine, get_bbusters_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_cols, 16, 16, 128, 32);
@@ -91,7 +91,7 @@ VIDEO_START( bbuster )
VIDEO_START( mechatt )
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
state->fix_tilemap = tilemap_create(machine, get_bbusters_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_cols, 16, 16, 256, 32);
@@ -156,10 +156,10 @@ INLINE const UINT8 *get_source_ptr(gfx_element *gfx, UINT32 sprite, int dx, int
return gfx_element_get_data(gfx, (sprite+code) % gfx->total_elements) + ((dy%16) * gfx->line_modulo);
}
-static void bbusters_draw_block(running_machine *machine, bitmap_t *dest,int x,int y,int size,int flipx,int flipy,UINT32 sprite,int color,int bank,int block)
+static void bbusters_draw_block(running_machine &machine, bitmap_t *dest,int x,int y,int size,int flipx,int flipy,UINT32 sprite,int color,int bank,int block)
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
- gfx_element *gfx = machine->gfx[bank];
+ bbusters_state *state = machine.driver_data<bbusters_state>();
+ gfx_element *gfx = machine.gfx[bank];
pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
UINT32 xinc=(state->scale_line_count * 0x10000 ) / size;
UINT8 pixel;
@@ -203,10 +203,10 @@ static void bbusters_draw_block(running_machine *machine, bitmap_t *dest,int x,i
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const UINT16 *source, int bank, int colval, int colmask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const UINT16 *source, int bank, int colval, int colmask)
{
- bbusters_state *state = machine->driver_data<bbusters_state>();
- const UINT8 *scale_table=machine->region("user1")->base();
+ bbusters_state *state = machine.driver_data<bbusters_state>();
+ const UINT8 *scale_table=machine.region("user1")->base();
int offs;
for (offs = 0;offs <0x800 ;offs += 4) {
@@ -281,7 +281,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const UINT1
SCREEN_UPDATE( bbuster )
{
- bbusters_state *state = screen->machine->driver_data<bbusters_state>();
+ bbusters_state *state = screen->machine().driver_data<bbusters_state>();
tilemap_set_scrollx(state->pf1_tilemap, 0, state->pf1_scroll_data[0]);
tilemap_set_scrolly(state->pf1_tilemap, 0, state->pf1_scroll_data[1]);
@@ -289,17 +289,17 @@ SCREEN_UPDATE( bbuster )
tilemap_set_scrolly(state->pf2_tilemap, 0, state->pf2_scroll_data[1]);
tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0);
- //draw_sprites(screen->machine, bitmap, screen->machine->generic.buffered_spriteram2.u16, 2, 0x8, 0x8);
+ //draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram2.u16, 2, 0x8, 0x8);
tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, screen->machine->generic.buffered_spriteram2.u16, 2, 0, 0);
- draw_sprites(screen->machine, bitmap, screen->machine->generic.buffered_spriteram.u16, 1, 0, 0);
+ draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram2.u16, 2, 0, 0);
+ draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram.u16, 1, 0, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( mechatt )
{
- bbusters_state *state = screen->machine->driver_data<bbusters_state>();
+ bbusters_state *state = screen->machine().driver_data<bbusters_state>();
tilemap_set_scrollx(state->pf1_tilemap, 0, state->pf1_scroll_data[0]);
tilemap_set_scrolly(state->pf1_tilemap, 0, state->pf1_scroll_data[1]);
@@ -308,7 +308,7 @@ SCREEN_UPDATE( mechatt )
tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->pf1_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, screen->machine->generic.buffered_spriteram.u16, 1, 0, 0);
+ draw_sprites(screen->machine(), bitmap, screen->machine().generic.buffered_spriteram.u16, 1, 0, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/beathead.c b/src/mame/video/beathead.c
index f4d5cf47ad1..ac4d1ad8ae2 100644
--- a/src/mame/video/beathead.c
+++ b/src/mame/video/beathead.c
@@ -17,11 +17,11 @@
void beathead_state::video_start()
{
- state_save_register_global(&m_machine, m_finescroll);
- state_save_register_global(&m_machine, m_vram_latch_offset);
- state_save_register_global(&m_machine, m_hsyncram_offset);
- state_save_register_global(&m_machine, m_hsyncram_start);
- state_save_register_global_array(&m_machine, m_hsyncram);
+ state_save_register_global(m_machine, m_finescroll);
+ state_save_register_global(m_machine, m_vram_latch_offset);
+ state_save_register_global(m_machine, m_hsyncram_offset);
+ state_save_register_global(m_machine, m_hsyncram_start);
+ state_save_register_global_array(m_machine, m_hsyncram);
}
@@ -86,10 +86,10 @@ WRITE32_MEMBER( beathead_state::finescroll_w )
UINT32 newword = COMBINE_DATA(&m_finescroll);
/* if VBLANK is going off on a scanline other than the last, suspend time */
- if ((oldword & 8) && !(newword & 8) && space.machine->primary_screen->vpos() != 261)
+ if ((oldword & 8) && !(newword & 8) && space.machine().primary_screen->vpos() != 261)
{
- logerror("Suspending time! (scanline = %d)\n", space.machine->primary_screen->vpos());
- cputag_set_input_line(space.machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE);
+ logerror("Suspending time! (scanline = %d)\n", space.machine().primary_screen->vpos());
+ cputag_set_input_line(space.machine(), "maincpu", INPUT_LINE_HALT, ASSERT_LINE);
}
}
@@ -107,7 +107,7 @@ WRITE32_MEMBER( beathead_state::palette_w )
int r = ((newword >> 9) & 0x3e) | ((newword >> 15) & 0x01);
int g = ((newword >> 4) & 0x3e) | ((newword >> 15) & 0x01);
int b = ((newword << 1) & 0x3e) | ((newword >> 15) & 0x01);
- palette_set_color_rgb(space.machine, offset, pal6bit(r), pal6bit(g), pal6bit(b));
+ palette_set_color_rgb(space.machine(), offset, pal6bit(r), pal6bit(g), pal6bit(b));
}
diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c
index 164d16dff02..c96a86564fe 100644
--- a/src/mame/video/beezer.c
+++ b/src/mame/video/beezer.c
@@ -6,8 +6,8 @@
INTERRUPT_GEN( beezer_interrupt )
{
- beezer_state *state = device->machine->driver_data<beezer_state>();
- via6522_device *via_0 = device->machine->device<via6522_device>("via6522_0");
+ beezer_state *state = device->machine().driver_data<beezer_state>();
+ via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
state->scanline = (state->scanline + 1) % 0x80;
via_0->write_ca2((state->scanline & 0x10) ? 1 : 0);
@@ -19,7 +19,7 @@ INTERRUPT_GEN( beezer_interrupt )
SCREEN_UPDATE( beezer )
{
- beezer_state *state = screen->machine->driver_data<beezer_state>();
+ beezer_state *state = screen->machine().driver_data<beezer_state>();
UINT8 *videoram = state->videoram;
int x,y;
@@ -63,12 +63,12 @@ WRITE8_HANDLER( beezer_map_w )
bit1 = (data >> 7) & 0x01;
b = 0x5f * bit0 + 0xa0 * bit1;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
READ8_HANDLER( beezer_line_r )
{
- beezer_state *state = space->machine->driver_data<beezer_state>();
+ beezer_state *state = space->machine().driver_data<beezer_state>();
return (state->scanline & 0xfe) << 1;
}
diff --git a/src/mame/video/bfm_adr2.c b/src/mame/video/bfm_adr2.c
index 33445c26a8d..ab3476cfdc2 100644
--- a/src/mame/video/bfm_adr2.c
+++ b/src/mame/video/bfm_adr2.c
@@ -186,7 +186,7 @@ VIDEO_RESET( adder2 )
adder2_data_to_sc2 = 0;
{
- UINT8 *rom = machine->region("adder2")->base();
+ UINT8 *rom = machine.region("adder2")->base();
memory_configure_bank(machine, "bank2", 0, 4, &rom[0x00000], 0x08000);
@@ -289,7 +289,7 @@ static WRITE8_HANDLER( screen_ram_w )
r = ((data & 0x18)>>3) * 85; // 00011000b = 0x18
g = ((data & 0x06)>>1) * 85; // 00000110b = 0x06
b = ((data & 0x01) ) * 255;
- palette_set_color(space->machine, pal, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), pal, MAKE_RGB(r,g,b));
}
if ( adder2_screen_page_reg & SL_ACCESS )
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( normal_ram_w )
static WRITE8_HANDLER( adder2_rom_page_w )
{
- memory_set_bank(space->machine, "bank2",data&0x03);
+ memory_set_bank(space->machine(), "bank2",data&0x03);
}
///////////////////////////////////////////////////////////////////////////
@@ -448,11 +448,11 @@ int adder2_status()
// //
////////////////////////////////////////////////////////////////////
-void adder2_decode_char_roms(running_machine *machine)
+void adder2_decode_char_roms(running_machine &machine)
{
UINT8 *p;
- p = machine->region("gfx1")->base();
+ p = machine.region("gfx1")->base();
if ( p )
{
diff --git a/src/mame/video/bfm_adr2.h b/src/mame/video/bfm_adr2.h
index 9c083bbab16..03eefc36122 100644
--- a/src/mame/video/bfm_adr2.h
+++ b/src/mame/video/bfm_adr2.h
@@ -6,7 +6,7 @@ void adder2_send(int data);
int adder2_status(void);
GFXDECODE_EXTERN( adder2 );
-void adder2_decode_char_roms(running_machine *machine);
+void adder2_decode_char_roms(running_machine &machine);
MACHINE_RESET( adder2 );
INTERRUPT_GEN( adder2_vbl );
diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c
index e0bf2aad9dc..f3bf44b2dbf 100644
--- a/src/mame/video/bfm_dm01.c
+++ b/src/mame/video/bfm_dm01.c
@@ -38,8 +38,8 @@ Standard dm01 memorymap
#include "bfm_dm01.h"
// local prototypes ///////////////////////////////////////////////////////
-extern void Scorpion2_SetSwitchState(running_machine *machine, int strobe, int data, int state);
-extern int Scorpion2_GetSwitchState(running_machine *machine, int strobe, int data);
+extern void Scorpion2_SetSwitchState(running_machine &machine, int strobe, int data, int state);
+extern int Scorpion2_GetSwitchState(running_machine &machine, int strobe, int data);
// local vars /////////////////////////////////////////////////////////////
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( control_w )
if ( data & 8 ) busy = 0;
else busy = 1;
- Scorpion2_SetSwitchState(space->machine, FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1);
+ Scorpion2_SetSwitchState(space->machine(), FEEDBACK_STROBE,FEEDBACK_DATA, busy?0:1);
}
}
@@ -209,7 +209,7 @@ static READ8_HANDLER( unknown_r )
static WRITE8_HANDLER( unknown_w )
{
- cputag_set_input_line(space->machine, "matrix", INPUT_LINE_NMI, CLEAR_LINE ); //?
+ cputag_set_input_line(space->machine(), "matrix", INPUT_LINE_NMI, CLEAR_LINE ); //?
}
///////////////////////////////////////////////////////////////////////////
@@ -225,7 +225,7 @@ ADDRESS_MAP_END
///////////////////////////////////////////////////////////////////////////
-void BFM_dm01_writedata(running_machine *machine, UINT8 data)
+void BFM_dm01_writedata(running_machine &machine, UINT8 data)
{
comdata = data;
data_avail = 1;
@@ -247,7 +247,7 @@ int BFM_dm01_busy(void)
return data_avail;
}
-void BFM_dm01_reset(running_machine *machine)
+void BFM_dm01_reset(running_machine &machine)
{
busy = 0;
control = 0;
diff --git a/src/mame/video/bfm_dm01.h b/src/mame/video/bfm_dm01.h
index cc6fa10d9a3..b16a6dd0bac 100644
--- a/src/mame/video/bfm_dm01.h
+++ b/src/mame/video/bfm_dm01.h
@@ -10,9 +10,9 @@ ADDRESS_MAP_EXTERN( bfm_dm01_memmap,8 );
INTERRUPT_GEN( bfm_dm01_vbl );
-void BFM_dm01_reset(running_machine *machine);
+void BFM_dm01_reset(running_machine &machine);
-void BFM_dm01_writedata(running_machine *machine,UINT8 data);
+void BFM_dm01_writedata(running_machine &machine,UINT8 data);
int BFM_dm01_busy(void);
diff --git a/src/mame/video/bigevglf.c b/src/mame/video/bigevglf.c
index d2a6eb47e45..de76fee079c 100644
--- a/src/mame/video/bigevglf.c
+++ b/src/mame/video/bigevglf.c
@@ -11,17 +11,17 @@
WRITE8_HANDLER(bigevglf_palette_w)
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
int color;
state->paletteram[offset] = data;
color = state->paletteram[offset & 0x3ff] | (state->paletteram[0x400 + (offset & 0x3ff)] << 8);
- palette_set_color_rgb(space->machine, offset & 0x3ff, pal4bit(color >> 4), pal4bit(color >> 0), pal4bit(color >> 8));
+ palette_set_color_rgb(space->machine(), offset & 0x3ff, pal4bit(color >> 4), pal4bit(color >> 0), pal4bit(color >> 8));
}
WRITE8_HANDLER( bigevglf_gfxcontrol_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* bits used: 0,1,2,3
0 and 2 select plane,
@@ -33,13 +33,13 @@ WRITE8_HANDLER( bigevglf_gfxcontrol_w )
WRITE8_HANDLER( bigevglf_vidram_addr_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->vidram_bank = (data & 0xff) * 0x100;
}
WRITE8_HANDLER( bigevglf_vidram_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
UINT32 x, y, o;
o = state->vidram_bank + offset;
state->vidram[o + 0x10000 * state->plane_selected] = data;
@@ -50,18 +50,18 @@ WRITE8_HANDLER( bigevglf_vidram_w )
READ8_HANDLER( bigevglf_vidram_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
return state->vidram[0x10000 * state->plane_selected + state->vidram_bank + offset];
}
VIDEO_START( bigevglf )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
- state->tmp_bitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmp_bitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmp_bitmap[2] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmp_bitmap[3] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap[1] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap[2] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap[3] = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->tmp_bitmap[0]));
state->save_item(NAME(*state->tmp_bitmap[1]));
state->save_item(NAME(*state->tmp_bitmap[2]));
@@ -72,9 +72,9 @@ VIDEO_START( bigevglf )
state->save_pointer(NAME(state->vidram), 0x100 * 0x100 * 4);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
int i, j;
for (i = 0xc0-4; i >= 0; i-= 4)
{
@@ -83,7 +83,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sx = state->spriteram2[i + 3];
sy = 200 - state->spriteram2[i];
for (j = 0; j < 16; j++)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
state->spriteram1[(code << 4) + j] + ((state->spriteram1[0x400 + (code << 4) + j] & 0xf) << 8),
state->spriteram2[i + 2] & 0xf,
0,0,
@@ -93,9 +93,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( bigevglf )
{
- bigevglf_state *state = screen->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = screen->machine().driver_data<bigevglf_state>();
copybitmap(bitmap, state->tmp_bitmap[state->plane_visible], 0, 0, 0, 0, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/bigstrkb.c b/src/mame/video/bigstrkb.c
index ea6e71a8a70..e3655244f55 100644
--- a/src/mame/video/bigstrkb.c
+++ b/src/mame/video/bigstrkb.c
@@ -6,7 +6,7 @@
/* Sprites */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/*- SPR RAM Format -**
@@ -16,8 +16,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
( rest unused )
**- End of Comments -*/
- bigstrkb_state *state = machine->driver_data<bigstrkb_state>();
- const gfx_element *gfx = machine->gfx[2];
+ bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
+ const gfx_element *gfx = machine.gfx[2];
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x800/2;
@@ -61,7 +61,7 @@ static TILEMAP_MAPPER( bsb_bg_scan )
static TILE_GET_INFO( get_bsb_tile_info )
{
- bigstrkb_state *state = machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
int tileno,col;
tileno = state->videoram[tile_index] & 0x0fff;
@@ -72,14 +72,14 @@ static TILE_GET_INFO( get_bsb_tile_info )
WRITE16_HANDLER( bsb_videoram_w )
{
- bigstrkb_state *state = space->machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = space->machine().driver_data<bigstrkb_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
}
static TILE_GET_INFO( get_bsb_tile2_info )
{
- bigstrkb_state *state = machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
int tileno,col;
tileno = state->videoram2[tile_index] & 0x0fff;
@@ -90,7 +90,7 @@ static TILE_GET_INFO( get_bsb_tile2_info )
WRITE16_HANDLER( bsb_videoram2_w )
{
- bigstrkb_state *state = space->machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = space->machine().driver_data<bigstrkb_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->tilemap2,offset);
}
@@ -98,7 +98,7 @@ WRITE16_HANDLER( bsb_videoram2_w )
static TILE_GET_INFO( get_bsb_tile3_info )
{
- bigstrkb_state *state = machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
int tileno,col;
tileno = state->videoram3[tile_index] & 0x0fff;
@@ -109,7 +109,7 @@ static TILE_GET_INFO( get_bsb_tile3_info )
WRITE16_HANDLER( bsb_videoram3_w )
{
- bigstrkb_state *state = space->machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = space->machine().driver_data<bigstrkb_state>();
state->videoram3[offset] = data;
tilemap_mark_tile_dirty(state->tilemap3,offset);
}
@@ -118,7 +118,7 @@ WRITE16_HANDLER( bsb_videoram3_w )
VIDEO_START(bigstrkb)
{
- bigstrkb_state *state = machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = machine.driver_data<bigstrkb_state>();
state->tilemap = tilemap_create(machine, get_bsb_tile_info,tilemap_scan_cols, 8, 8,64,32);
state->tilemap2 = tilemap_create(machine, get_bsb_tile2_info,bsb_bg_scan, 16, 16,128,64);
state->tilemap3 = tilemap_create(machine, get_bsb_tile3_info,bsb_bg_scan, 16, 16,128,64);
@@ -130,9 +130,9 @@ VIDEO_START(bigstrkb)
SCREEN_UPDATE(bigstrkb)
{
- bigstrkb_state *state = screen->machine->driver_data<bigstrkb_state>();
+ bigstrkb_state *state = screen->machine().driver_data<bigstrkb_state>();
-// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_set_scrollx(state->tilemap2,0, state->vidreg1[0]+(256-14));
tilemap_set_scrolly(state->tilemap2,0, state->vidreg2[0]);
@@ -143,7 +143,7 @@ SCREEN_UPDATE(bigstrkb)
tilemap_draw(bitmap,cliprect,state->tilemap2,0,0);
tilemap_draw(bitmap,cliprect,state->tilemap3,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
// popmessage ("Regs %08x %08x %08x %08x",bsb_vidreg2[0],bsb_vidreg2[1],bsb_vidreg2[2],bsb_vidreg2[3]);
diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c
index 765d96054d3..4215a67c68a 100644
--- a/src/mame/video/bionicc.c
+++ b/src/mame/video/bionicc.c
@@ -35,7 +35,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
int attr = state->bgvideoram[2 * tile_index + 1];
SET_TILE_INFO(
@@ -47,7 +47,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
int attr = state->fgvideoram[2 * tile_index + 1];
int flags;
@@ -74,7 +74,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
int attr = state->txvideoram[tile_index + 0x400];
SET_TILE_INFO(
@@ -94,7 +94,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( bionicc )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
@@ -116,7 +116,7 @@ VIDEO_START( bionicc )
WRITE16_HANDLER( bionicc_bgvideoram_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
COMBINE_DATA(&state->bgvideoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -124,7 +124,7 @@ WRITE16_HANDLER( bionicc_bgvideoram_w )
WRITE16_HANDLER( bionicc_fgvideoram_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
COMBINE_DATA(&state->fgvideoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
@@ -132,7 +132,7 @@ WRITE16_HANDLER( bionicc_fgvideoram_w )
WRITE16_HANDLER( bionicc_txvideoram_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
COMBINE_DATA(&state->txvideoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x3ff);
@@ -140,7 +140,7 @@ WRITE16_HANDLER( bionicc_txvideoram_w )
WRITE16_HANDLER( bionicc_paletteram_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
int r, g, b, bright;
data = COMBINE_DATA(&state->paletteram[offset]);
@@ -157,12 +157,12 @@ WRITE16_HANDLER( bionicc_paletteram_w )
b = b * (0x07 + bright) / 0x0e;
}
- palette_set_color (space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color (space->machine(), offset, MAKE_RGB(r, g, b));
}
WRITE16_HANDLER( bionicc_scroll_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
data = COMBINE_DATA(&state->scroll[offset]);
@@ -185,17 +185,17 @@ WRITE16_HANDLER( bionicc_scroll_w )
WRITE16_HANDLER( bionicc_gfxctrl_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
if (ACCESSING_BITS_8_15)
{
- flip_screen_set(space->machine, data & 0x0100);
+ flip_screen_set(space->machine(), data & 0x0100);
tilemap_set_enable(state->bg_tilemap, data & 0x2000); /* guess */
tilemap_set_enable(state->fg_tilemap, data & 0x1000); /* guess */
- coin_counter_w(space->machine, 0, data & 0x8000);
- coin_counter_w(space->machine, 1, data & 0x4000);
+ coin_counter_w(space->machine(), 0, data & 0x8000);
+ coin_counter_w(space->machine(), 1, data & 0x4000);
}
}
@@ -207,14 +207,14 @@ WRITE16_HANDLER( bionicc_gfxctrl_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
-// bionicc_state *state = machine->driver_data<bionicc_state>();
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
+// bionicc_state *state = machine.driver_data<bionicc_state>();
int offs;
- const gfx_element *gfx = machine->gfx[3];
+ const gfx_element *gfx = machine.gfx[3];
- for (offs = (machine->generic.spriteram_size - 8) / 2; offs >= 0; offs -= 4)
+ for (offs = (machine.generic.spriteram_size - 8) / 2; offs >= 0; offs -= 4)
{
int tile_number = buffered_spriteram[offs] & 0x7ff;
if( tile_number != 0x7ff )
@@ -248,13 +248,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( bionicc )
{
- bionicc_state *state = screen->machine->driver_data<bionicc_state>();
+ bionicc_state *state = screen->machine().driver_data<bionicc_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0); /* nothing in FRONT */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
@@ -262,7 +262,7 @@ SCREEN_UPDATE( bionicc )
SCREEN_EOF( bionicc )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
diff --git a/src/mame/video/bishi.c b/src/mame/video/bishi.c
index ade40aaad00..d152c21de65 100644
--- a/src/mame/video/bishi.c
+++ b/src/mame/video/bishi.c
@@ -12,9 +12,9 @@
#include "includes/bishi.h"
-void bishi_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void bishi_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
// *code -= '0';
// *color = state->layer_colorbase[layer] | (*color>>2 & 0x0f);
@@ -26,9 +26,9 @@ void bishi_tile_callback( running_machine *machine, int layer, int *code, int *c
VIDEO_START( bishi )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
- assert(machine->primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
k056832_set_layer_association(state->k056832, 0);
@@ -46,7 +46,7 @@ VIDEO_START( bishi )
SCREEN_UPDATE(bishi)
{
- bishi_state *state = screen->machine->driver_data<bishi_state>();
+ bishi_state *state = screen->machine().driver_data<bishi_state>();
int layers[4], layerpri[4], i;/*, old;*/
/* int bg_colorbase, new_colorbase, plane, dirty; */
static const int pris[4] = { K55_PRIINP_0, K55_PRIINP_3, K55_PRIINP_6, K55_PRIINP_7 };
@@ -63,7 +63,7 @@ SCREEN_UPDATE(bishi)
konami_sortlayers4(layers, layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
for (i = 0; i < 4; i++)
{
diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c
index abb3cb4d34c..8dbc85bb2fa 100644
--- a/src/mame/video/bking.c
+++ b/src/mame/video/bking.c
@@ -41,7 +41,7 @@ PALETTE_INIT( bking )
3, &resistances_rg[0], gweights, 0, 0,
2, &resistances_b[0], bweights, 0, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT16 pen;
int bit0, bit1, bit2, r, g, b;
@@ -84,44 +84,44 @@ PALETTE_INIT( bking )
WRITE8_HANDLER( bking_xld1_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->xld1 = -data;
}
WRITE8_HANDLER( bking_yld1_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->yld1 = -data;
}
WRITE8_HANDLER( bking_xld2_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->xld2 = -data;
}
WRITE8_HANDLER( bking_yld2_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->yld2 = -data;
}
WRITE8_HANDLER( bking_xld3_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->xld3 = -data;
}
WRITE8_HANDLER( bking_yld3_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->yld3 = -data;
}
WRITE8_HANDLER( bking_cont1_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
/* D0 = COIN LOCK */
/* D1 = BALL 5 (Controller selection) */
@@ -129,11 +129,11 @@ WRITE8_HANDLER( bking_cont1_w )
/* D3 = Not Connected */
/* D4-D7 = CROW0-CROW3 (selects crow picture) */
- coin_lockout_global_w(space->machine, ~data & 0x01);
+ coin_lockout_global_w(space->machine(), ~data & 0x01);
- flip_screen_set_no_update(space->machine, data & 0x04);
+ flip_screen_set_no_update(space->machine(), data & 0x04);
- tilemap_set_flip_all(space->machine, flip_screen_get(space->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_set_flip_all(space->machine(), flip_screen_get(space->machine()) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
state->controller = data & 0x02;
@@ -142,7 +142,7 @@ WRITE8_HANDLER( bking_cont1_w )
WRITE8_HANDLER( bking_cont2_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
/* D0-D2 = BALL10 - BALL12 (Selects player 1 ball picture) */
/* D3-D5 = BALL20 - BALL22 (Selects player 2 ball picture) */
@@ -157,7 +157,7 @@ WRITE8_HANDLER( bking_cont2_w )
WRITE8_HANDLER( bking_cont3_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
/* D0 = CROW INV (inverts Crow picture and coordinates) */
/* D1-D2 = COLOR 0 - COLOR 1 (switches 4 color palettes, global across all graphics) */
@@ -172,20 +172,20 @@ WRITE8_HANDLER( bking_cont3_w )
state->palette_bank = (data >> 1) & 0x03;
- space->machine->sound().system_mute(data & 0x08);
+ space->machine().sound().system_mute(data & 0x08);
}
WRITE8_HANDLER( bking_msk_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->pc3259_mask++;
}
WRITE8_HANDLER( bking_hitclr_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->pc3259_mask = 0;
state->pc3259_output[0] = 0;
@@ -197,7 +197,7 @@ WRITE8_HANDLER( bking_hitclr_w )
WRITE8_HANDLER( bking_playfield_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->playfield_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
@@ -205,26 +205,26 @@ WRITE8_HANDLER( bking_playfield_w )
READ8_HANDLER( bking_input_port_5_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
- return input_port_read(space->machine, state->controller ? "TRACK1_X" : "TRACK0_X");
+ bking_state *state = space->machine().driver_data<bking_state>();
+ return input_port_read(space->machine(), state->controller ? "TRACK1_X" : "TRACK0_X");
}
READ8_HANDLER( bking_input_port_6_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
- return input_port_read(space->machine, state->controller ? "TRACK1_Y" : "TRACK0_Y");
+ bking_state *state = space->machine().driver_data<bking_state>();
+ return input_port_read(space->machine(), state->controller ? "TRACK1_Y" : "TRACK0_Y");
}
READ8_HANDLER( bking_pos_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
return state->pc3259_output[offset / 8] << 4;
}
static TILE_GET_INFO( get_tile_info )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
UINT8 code0 = state->playfield_ram[2 * tile_index + 0];
UINT8 code1 = state->playfield_ram[2 * tile_index + 1];
@@ -239,10 +239,10 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- state->tmp_bitmap1 = machine->primary_screen->alloc_compatible_bitmap();
- state->tmp_bitmap2 = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap2 = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->tmp_bitmap1));
state->save_item(NAME(*state->tmp_bitmap2));
@@ -251,25 +251,25 @@ VIDEO_START( bking )
SCREEN_UPDATE( bking )
{
- bking_state *state = screen->machine->driver_data<bking_state>();
+ bking_state *state = screen->machine().driver_data<bking_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the balls */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2],
state->ball1_pic,
state->palette_bank,
0, 0,
state->xld1, state->yld1, 0);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3],
state->ball2_pic,
state->palette_bank,
0, 0,
state->xld2, state->yld2, 0);
/* draw the crow */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->crow_pic,
state->palette_bank,
state->crow_flip, state->crow_flip,
@@ -280,7 +280,7 @@ SCREEN_UPDATE( bking )
SCREEN_EOF( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
static const rectangle rect = { 0, 7, 0, 15 };
int xld = 0;
@@ -293,7 +293,7 @@ SCREEN_EOF( bking )
xld = state->xld1;
yld = state->yld1;
- drawgfx_opaque(state->tmp_bitmap2, &rect, machine->gfx[2],
+ drawgfx_opaque(state->tmp_bitmap2, &rect, machine.gfx[2],
state->ball1_pic,
0,
0, 0,
@@ -307,7 +307,7 @@ SCREEN_EOF( bking )
xld = state->xld2;
yld = state->yld2;
- drawgfx_opaque(state->tmp_bitmap2, &rect, machine->gfx[3],
+ drawgfx_opaque(state->tmp_bitmap2, &rect, machine.gfx[3],
state->ball2_pic,
0,
0, 0,
@@ -326,7 +326,7 @@ SCREEN_EOF( bking )
if (latch != 0)
{
- const UINT8* MASK = machine->region("user1")->base() + 8 * state->hit;
+ const UINT8* MASK = machine.region("user1")->base() + 8 * state->hit;
int x;
int y;
diff --git a/src/mame/video/bladestl.c b/src/mame/video/bladestl.c
index baf5a35d7d3..48de55d4476 100644
--- a/src/mame/video/bladestl.c
+++ b/src/mame/video/bladestl.c
@@ -8,24 +8,24 @@ PALETTE_INIT( bladestl )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x30);
+ machine.colortable = colortable_alloc(machine, 0x30);
/* characters use pens 0x00-0x1f, no look-up table */
for (i = 0; i < 0x20; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites use pens 0x20-0x2f */
for (i = 0x20; i < 0x120; i++)
{
UINT8 ctabentry = (color_prom[i - 0x20] & 0x0f) | 0x20;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
int i;
for (i = 0x00; i < 0x60; i += 2)
@@ -34,7 +34,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -46,9 +46,9 @@ static void set_pens( running_machine *machine )
***************************************************************************/
-void bladestl_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags )
+void bladestl_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
*code |= ((*color & 0x0f) << 8) | ((*color & 0x40) << 6);
*color = state->layer_colorbase[layer];
@@ -60,9 +60,9 @@ void bladestl_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void bladestl_sprite_callback( running_machine *machine, int *code,int *color )
+void bladestl_sprite_callback( running_machine &machine, int *code,int *color )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
*code |= ((*color & 0xc0) << 2) + state->spritebank;
*code = (*code << 2) | ((*color & 0x30) >> 4);
@@ -78,13 +78,13 @@ void bladestl_sprite_callback( running_machine *machine, int *code,int *color )
SCREEN_UPDATE( bladestl )
{
- bladestl_state *state = screen->machine->driver_data<bladestl_state>();
- set_pens(screen->machine);
+ bladestl_state *state = screen->machine().driver_data<bladestl_state>();
+ set_pens(screen->machine());
k007342_tilemap_update(state->k007342);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE ,0);
- k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine->gfx[1]);
+ k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine().gfx[1]);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 1, 1 | TILEMAP_DRAW_OPAQUE ,0);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, 0 ,0);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, 1 ,0);
diff --git a/src/mame/video/blktiger.c b/src/mame/video/blktiger.c
index cf1ce384961..8c081ddd526 100644
--- a/src/mame/video/blktiger.c
+++ b/src/mame/video/blktiger.c
@@ -26,7 +26,7 @@ static TILEMAP_MAPPER( bg4x8_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
/* the tile priority table is a guess compiled by looking at the game. It
was not derived from a PROM so it could be wrong. */
static const UINT8 split_table[16] =
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
UINT8 attr = state->txvideoram[tile_index + 0x400];
SET_TILE_INFO(
0,
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( blktiger )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
state->chon = 1;
state->bgon = 1;
@@ -103,20 +103,20 @@ VIDEO_START( blktiger )
WRITE8_HANDLER( blktiger_txvideoram_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x3ff);
}
READ8_HANDLER( blktiger_bgvideoram_r )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
return state->scroll_ram[offset + state->scroll_bank];
}
WRITE8_HANDLER( blktiger_bgvideoram_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
offset += state->scroll_bank;
state->scroll_ram[offset] = data;
@@ -126,14 +126,14 @@ WRITE8_HANDLER( blktiger_bgvideoram_w )
WRITE8_HANDLER( blktiger_bgvideoram_bank_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
state->scroll_bank = (data % BGRAM_BANKS) * BGRAM_BANK_SIZE;
}
WRITE8_HANDLER( blktiger_scrolly_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
int scrolly;
state->scroll_y[offset] = data;
@@ -144,7 +144,7 @@ WRITE8_HANDLER( blktiger_scrolly_w )
WRITE8_HANDLER( blktiger_scrollx_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
int scrollx;
state->scroll_x[offset] = data;
@@ -156,16 +156,16 @@ WRITE8_HANDLER( blktiger_scrollx_w )
WRITE8_HANDLER( blktiger_video_control_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
/* bit 5 resets the sound CPU */
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
/* bit 6 flips screen */
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
/* bit 7 enables characters? Just a guess */
state->chon = ~data & 0x80;
@@ -173,7 +173,7 @@ WRITE8_HANDLER( blktiger_video_control_w )
WRITE8_HANDLER( blktiger_video_enable_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
/* not sure which is which, but I think that bit 1 and 2 enable background and sprites */
/* bit 1 enables bg ? */
@@ -185,7 +185,7 @@ WRITE8_HANDLER( blktiger_video_enable_w )
WRITE8_HANDLER( blktiger_screen_layout_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
state->screen_layout = data;
tilemap_set_enable(state->bg_tilemap8x4, state->screen_layout);
tilemap_set_enable(state->bg_tilemap4x8, !state->screen_layout);
@@ -199,14 +199,14 @@ WRITE8_HANDLER( blktiger_screen_layout_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
-// blktiger_state *state = machine->driver_data<blktiger_state>();
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+// blktiger_state *state = machine.driver_data<blktiger_state>();
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
/* Draw the sprites. */
- for (offs = machine->generic.spriteram_size - 4;offs >= 0;offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4;offs >= 0;offs -= 4)
{
int attr = buffered_spriteram[offs+1];
int sx = buffered_spriteram[offs + 3] - ((attr & 0x10) << 4);
@@ -222,7 +222,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx = !flipx;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flip_screen_get(machine),
@@ -232,7 +232,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( blktiger )
{
- blktiger_state *state = screen->machine->driver_data<blktiger_state>();
+ blktiger_state *state = screen->machine().driver_data<blktiger_state>();
bitmap_fill(bitmap, cliprect, 1023);
@@ -240,7 +240,7 @@ SCREEN_UPDATE( blktiger )
tilemap_draw(bitmap, cliprect, state->screen_layout ? state->bg_tilemap8x4 : state->bg_tilemap4x8, TILEMAP_DRAW_LAYER1, 0);
if (state->objon)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (state->bgon)
tilemap_draw(bitmap, cliprect, state->screen_layout ? state->bg_tilemap8x4 : state->bg_tilemap4x8, TILEMAP_DRAW_LAYER0, 0);
@@ -253,7 +253,7 @@ SCREEN_UPDATE( blktiger )
SCREEN_EOF( blktiger )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/blmbycar.c b/src/mame/video/blmbycar.c
index 5fe8cba33e6..16a56bdab8b 100644
--- a/src/mame/video/blmbycar.c
+++ b/src/mame/video/blmbycar.c
@@ -44,10 +44,10 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE16_HANDLER( blmbycar_palette_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
data = COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb( space->machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
+ palette_set_color_rgb( space->machine(), offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
}
@@ -73,7 +73,7 @@ WRITE16_HANDLER( blmbycar_palette_w )
static TILE_GET_INFO( get_tile_info_0 )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
UINT16 code = state->vram_0[tile_index * 2 + 0];
UINT16 attr = state->vram_0[tile_index * 2 + 1];
SET_TILE_INFO(
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
UINT16 code = state->vram_1[tile_index * 2 + 0];
UINT16 attr = state->vram_1[tile_index * 2 + 1];
SET_TILE_INFO(
@@ -102,14 +102,14 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE16_HANDLER( blmbycar_vram_0_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0, offset / 2);
}
WRITE16_HANDLER( blmbycar_vram_1_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset / 2);
}
@@ -125,7 +125,7 @@ WRITE16_HANDLER( blmbycar_vram_1_w )
VIDEO_START( blmbycar )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 16, 16, DIM_NX, DIM_NY );
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 16, 16, DIM_NX, DIM_NY );
@@ -165,9 +165,9 @@ VIDEO_START( blmbycar )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
UINT16 *source, *finish;
source = state->spriteram + 0x6 / 2; // !
@@ -200,12 +200,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
x = (x & 0x1ff) - 0x10;
y = 0xf0 - ((y & 0xff) - (y & 0x100));
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[0],
code,
0x20 + (attr & 0xf),
flipx, flipy,
x, y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,0);
}
}
@@ -221,7 +221,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( blmbycar )
{
- blmbycar_state *state = screen->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = screen->machine().driver_data<blmbycar_state>();
int i, layers_ctrl = -1;
tilemap_set_scrolly(state->tilemap_0, 0, state->scroll_0[0]);
@@ -231,19 +231,19 @@ SCREEN_UPDATE( blmbycar )
tilemap_set_scrollx(state->tilemap_1, 0, state->scroll_1[1] + 5);
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
-// if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+// if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (layers_ctrl & 1)
for (i = 0; i <= 1; i++)
@@ -256,7 +256,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
tilemap_draw(bitmap, cliprect, state->tilemap_1, i, i);
if (layers_ctrl & 8)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/blockade.c b/src/mame/video/blockade.c
index 376165d5097..cecae9c5179 100644
--- a/src/mame/video/blockade.c
+++ b/src/mame/video/blockade.c
@@ -3,20 +3,20 @@
WRITE8_HANDLER( blockade_videoram_w )
{
- blockade_state *state = space->machine->driver_data<blockade_state>();
+ blockade_state *state = space->machine().driver_data<blockade_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
- if (input_port_read(space->machine, "IN3") & 0x80)
+ if (input_port_read(space->machine(), "IN3") & 0x80)
{
- logerror("blockade_videoram_w: scanline %d\n", space->machine->primary_screen->vpos());
+ logerror("blockade_videoram_w: scanline %d\n", space->machine().primary_screen->vpos());
device_spin_until_interrupt(space->cpu);
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(0, code, 0, 0);
@@ -24,13 +24,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( blockade )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
SCREEN_UPDATE( blockade )
{
- blockade_state *state = screen->machine->driver_data<blockade_state>();
+ blockade_state *state = screen->machine().driver_data<blockade_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/blockhl.c b/src/mame/video/blockhl.c
index e00b72ee02d..7e92ab75cf0 100644
--- a/src/mame/video/blockhl.c
+++ b/src/mame/video/blockhl.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void blockhl_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void blockhl_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
*code |= ((*color & 0x0f) << 8);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
@@ -22,9 +22,9 @@ void blockhl_tile_callback( running_machine *machine, int layer, int bank, int *
***************************************************************************/
-void blockhl_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void blockhl_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
if(*color & 0x10)
*priority = 0xfe; // under K052109_tilemap[0]
@@ -43,23 +43,23 @@ void blockhl_sprite_callback( running_machine *machine, int *code, int *color, i
VIDEO_START( blockhl )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x800);
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 16;
state->layer_colorbase[2] = 32;
state->sprite_colorbase = 48;
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x800);
}
SCREEN_UPDATE( blockhl )
{
- blockhl_state *state = screen->machine->driver_data<blockhl_state>();
+ blockhl_state *state = screen->machine().driver_data<blockhl_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/blockout.c b/src/mame/video/blockout.c
index 1c605d9782b..664d36f6331 100644
--- a/src/mame/video/blockout.c
+++ b/src/mame/video/blockout.c
@@ -8,7 +8,7 @@
#include "includes/blockout.h"
-static void setcolor( running_machine *machine, int color, int rgb )
+static void setcolor( running_machine &machine, int color, int rgb )
{
int bit0, bit1, bit2, bit3;
int r, g, b;
@@ -40,18 +40,18 @@ static void setcolor( running_machine *machine, int color, int rgb )
WRITE16_HANDLER( blockout_paletteram_w )
{
- blockout_state *state = space->machine->driver_data<blockout_state>();
+ blockout_state *state = space->machine().driver_data<blockout_state>();
COMBINE_DATA(&state->paletteram[offset]);
- setcolor(space->machine, offset, state->paletteram[offset]);
+ setcolor(space->machine(), offset, state->paletteram[offset]);
}
WRITE16_HANDLER( blockout_frontcolor_w )
{
- blockout_state *state = space->machine->driver_data<blockout_state>();
+ blockout_state *state = space->machine().driver_data<blockout_state>();
COMBINE_DATA(&state->color);
- setcolor(space->machine, 512, state->color);
+ setcolor(space->machine(), 512, state->color);
}
@@ -63,19 +63,19 @@ WRITE16_HANDLER( blockout_frontcolor_w )
***************************************************************************/
VIDEO_START( blockout )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
/* Allocate temporary bitmaps */
- state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->tmpbitmap));
}
-static void update_pixels( running_machine *machine, int x, int y )
+static void update_pixels( running_machine &machine, int x, int y )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
UINT16 front, back;
int color;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
if (x < visarea.min_x || x > visarea.max_x || y < visarea.min_y || y > visarea.max_y)
return;
@@ -102,17 +102,17 @@ static void update_pixels( running_machine *machine, int x, int y )
WRITE16_HANDLER( blockout_videoram_w )
{
- blockout_state *state = space->machine->driver_data<blockout_state>();
+ blockout_state *state = space->machine().driver_data<blockout_state>();
COMBINE_DATA(&state->videoram[offset]);
- update_pixels(space->machine, (offset % 256) * 2, (offset / 256) % 256);
+ update_pixels(space->machine(), (offset % 256) * 2, (offset / 256) % 256);
}
SCREEN_UPDATE( blockout )
{
- blockout_state *state = screen->machine->driver_data<blockout_state>();
+ blockout_state *state = screen->machine().driver_data<blockout_state>();
int x, y;
pen_t color = 512;
diff --git a/src/mame/video/bloodbro.c b/src/mame/video/bloodbro.c
index 96c1c07a49b..2fb0d1336b5 100644
--- a/src/mame/video/bloodbro.c
+++ b/src/mame/video/bloodbro.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
int code = state->bgvideoram[tile_index];
SET_TILE_INFO(
1,
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
int code = state->fgvideoram[tile_index];
SET_TILE_INFO(
2,
@@ -38,7 +38,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
int code = state->txvideoram[tile_index];
SET_TILE_INFO(
0,
@@ -57,7 +57,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( bloodbro )
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 16,16,32,16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,16,16,32,16);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
@@ -76,21 +76,21 @@ VIDEO_START( bloodbro )
WRITE16_HANDLER( bloodbro_bgvideoram_w )
{
- bloodbro_state *state = space->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = space->machine().driver_data<bloodbro_state>();
COMBINE_DATA(&state->bgvideoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE16_HANDLER( bloodbro_fgvideoram_w )
{
- bloodbro_state *state = space->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = space->machine().driver_data<bloodbro_state>();
COMBINE_DATA(&state->fgvideoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE16_HANDLER( bloodbro_txvideoram_w )
{
- bloodbro_state *state = space->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = space->machine().driver_data<bloodbro_state>();
COMBINE_DATA(&state->txvideoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
@@ -145,9 +145,9 @@ WRITE16_HANDLER( bloodbro_txvideoram_w )
-------X XXXXXXXX
-------- YYYYYYYY */
-static void bloodbro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void bloodbro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
for (offs = 0;offs < state->spriteram_size/2;offs += 4)
@@ -174,12 +174,12 @@ static void bloodbro_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
{
for (y = 0;y <= height;y++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
tile_number++,
color,
flipx,flipy,
flipx ? (sx + 16*(width-x)) : (sx + 16*x),flipy ? (sy + 16*(height-y)) : (sy + 16*y),
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,15);
}
}
@@ -194,9 +194,9 @@ static void bloodbro_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
-------X XXXXXXXX
*/
-static void weststry_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- bloodbro_state *state = machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = machine.driver_data<bloodbro_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -220,12 +220,12 @@ static void weststry_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
/* Remap code 0x800 <-> 0x1000 */
code = (code&0x7ff) | ((code&0x800)<<1) | ((code&0x1000)>>1);
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,15);
}
}
@@ -234,34 +234,34 @@ static void weststry_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( bloodbro )
{
- bloodbro_state *state = screen->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = screen->machine().driver_data<bloodbro_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll[0x10]); /* ? */
tilemap_set_scrolly(state->bg_tilemap,0,state->scroll[0x11]); /* ? */
tilemap_set_scrollx(state->fg_tilemap,0,state->scroll[0x12]);
tilemap_set_scrolly(state->fg_tilemap,0,state->scroll[0x13]);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,1);
- bloodbro_draw_sprites(screen->machine,bitmap,cliprect);
+ bloodbro_draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
SCREEN_UPDATE( weststry )
{
- bloodbro_state *state = screen->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = screen->machine().driver_data<bloodbro_state>();
// tilemap_set_scrollx(state->bg_tilemap,0,state->scroll[0x10]); /* ? */
// tilemap_set_scrolly(state->bg_tilemap,0,state->scroll[0x11]); /* ? */
// tilemap_set_scrollx(state->fg_tilemap,0,state->scroll[0x12]);
// tilemap_set_scrolly(state->fg_tilemap,0,state->scroll[0x13]);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,1);
- weststry_draw_sprites(screen->machine,bitmap,cliprect);
+ weststry_draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
@@ -269,17 +269,17 @@ SCREEN_UPDATE( weststry )
SCREEN_UPDATE( skysmash )
{
- bloodbro_state *state = screen->machine->driver_data<bloodbro_state>();
+ bloodbro_state *state = screen->machine().driver_data<bloodbro_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll[0x08]);
tilemap_set_scrolly(state->bg_tilemap,0,state->scroll[0x09]); /* ? */
tilemap_set_scrollx(state->fg_tilemap,0,state->scroll[0x0a]);
tilemap_set_scrolly(state->fg_tilemap,0,state->scroll[0x0b]); /* ? */
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,1);
- bloodbro_draw_sprites(screen->machine,bitmap,cliprect);
+ bloodbro_draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c
index 90aa5c17432..27aa197b65e 100644
--- a/src/mame/video/blstroid.c
+++ b/src/mame/video/blstroid.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
UINT16 data = state->playfield[tile_index];
int code = data & 0x1fff;
int color = (data >> 13) & 0x07;
@@ -71,7 +71,7 @@ VIDEO_START( blstroid )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_rows, 16,8, 64,64);
@@ -90,7 +90,7 @@ VIDEO_START( blstroid )
static TIMER_CALLBACK( irq_off )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* clear the interrupt */
atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
@@ -100,14 +100,14 @@ static TIMER_CALLBACK( irq_off )
static TIMER_CALLBACK( irq_on )
{
/* generate the interrupt */
- atarigen_scanline_int_gen(machine->device("maincpu"));
+ atarigen_scanline_int_gen(machine.device("maincpu"));
atarigen_update_interrupts(machine);
}
void blstroid_scanline_update(screen_device &screen, int scanline)
{
- blstroid_state *state = screen.machine->driver_data<blstroid_state>();
+ blstroid_state *state = screen.machine().driver_data<blstroid_state>();
int offset = (scanline / 8) * 64 + 40;
/* check for interrupts */
@@ -130,8 +130,8 @@ void blstroid_scanline_update(screen_device &screen, int scanline)
period_on = screen.time_until_pos(vpos + 7, width * 0.9);
period_off = screen.time_until_pos(vpos + 8, width * 0.9);
- screen.machine->scheduler().timer_set(period_on, FUNC(irq_on));
- screen.machine->scheduler().timer_set(period_off, FUNC(irq_off));
+ screen.machine().scheduler().timer_set(period_on, FUNC(irq_on));
+ screen.machine().scheduler().timer_set(period_off, FUNC(irq_off));
}
}
@@ -145,7 +145,7 @@ void blstroid_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( blstroid )
{
- blstroid_state *state = screen->machine->driver_data<blstroid_state>();
+ blstroid_state *state = screen->machine().driver_data<blstroid_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/blueprnt.c b/src/mame/video/blueprnt.c
index 433beb14236..18e8742fac5 100644
--- a/src/mame/video/blueprnt.c
+++ b/src/mame/video/blueprnt.c
@@ -24,7 +24,7 @@ PALETTE_INIT( blueprnt )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen;
int r, g, b;
@@ -48,7 +48,7 @@ PALETTE_INIT( blueprnt )
WRITE8_HANDLER( blueprnt_videoram_w )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -56,7 +56,7 @@ WRITE8_HANDLER( blueprnt_videoram_w )
WRITE8_HANDLER( blueprnt_colorram_w )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -64,20 +64,20 @@ WRITE8_HANDLER( blueprnt_colorram_w )
WRITE8_HANDLER( blueprnt_flipscreen_w )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
- flip_screen_set(space->machine, ~data & 0x02);
+ flip_screen_set(space->machine(), ~data & 0x02);
if (state->gfx_bank != ((data & 0x04) >> 2))
{
state->gfx_bank = ((data & 0x04) >> 2);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 256 * state->gfx_bank;
int color = attr & 0x7f;
@@ -89,7 +89,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( blueprnt )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
@@ -98,9 +98,9 @@ VIDEO_START( blueprnt )
state->save_item(NAME(state->gfx_bank));
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -120,25 +120,25 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
// sprites are slightly misplaced, regardless of the screen flip
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, 0, flipx, flipy, 2 + sx, sy - 1, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, 0, flipx, flipy, 2 + sx, sy - 1, 0);
}
}
SCREEN_UPDATE( blueprnt )
{
- blueprnt_state *state = screen->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = screen->machine().driver_data<blueprnt_state>();
int i;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
for (i = 0; i < 32; i++)
tilemap_set_scrolly(state->bg_tilemap, i, state->scrollram[32 - i]);
else
for (i = 0; i < 32; i++)
tilemap_set_scrolly(state->bg_tilemap, i, state->scrollram[30 - i]);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
return 0;
}
diff --git a/src/mame/video/bogeyman.c b/src/mame/video/bogeyman.c
index 3c1a683a2ce..1a86a330083 100644
--- a/src/mame/video/bogeyman.c
+++ b/src/mame/video/bogeyman.c
@@ -37,7 +37,7 @@ PALETTE_INIT( bogeyman )
WRITE8_HANDLER( bogeyman_videoram_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -45,7 +45,7 @@ WRITE8_HANDLER( bogeyman_videoram_w )
WRITE8_HANDLER( bogeyman_colorram_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -53,7 +53,7 @@ WRITE8_HANDLER( bogeyman_colorram_w )
WRITE8_HANDLER( bogeyman_videoram2_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -61,7 +61,7 @@ WRITE8_HANDLER( bogeyman_videoram2_w )
WRITE8_HANDLER( bogeyman_colorram2_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -75,7 +75,7 @@ WRITE8_HANDLER( bogeyman_paletteram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
int attr = state->colorram[tile_index];
int gfxbank = ((((attr & 0x01) << 8) + state->videoram[tile_index]) / 0x80) + 3;
int code = state->videoram[tile_index] & 0x7f;
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
int attr = state->colorram2[tile_index];
int tile = state->videoram2[tile_index] | ((attr & 0x03) << 8);
int gfxbank = tile / 0x200;
@@ -97,16 +97,16 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( bogeyman )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -134,7 +134,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -142,7 +142,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (multi)
{
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code + 1, color,
flipx, flipy,
sx, sy + (flip_screen_get(machine) ? -16 : 16), 0);
@@ -153,10 +153,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( bogeyman )
{
- bogeyman_state *state = screen->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = screen->machine().driver_data<bogeyman_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/bombjack.c b/src/mame/video/bombjack.c
index 0f1ccbd7bc5..aacda99f0c2 100644
--- a/src/mame/video/bombjack.c
+++ b/src/mame/video/bombjack.c
@@ -11,21 +11,21 @@
WRITE8_HANDLER( bombjack_videoram_w )
{
- bombjack_state *state = space->machine->driver_data<bombjack_state>();
+ bombjack_state *state = space->machine().driver_data<bombjack_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( bombjack_colorram_w )
{
- bombjack_state *state = space->machine->driver_data<bombjack_state>();
+ bombjack_state *state = space->machine().driver_data<bombjack_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( bombjack_background_w )
{
- bombjack_state *state = space->machine->driver_data<bombjack_state>();
+ bombjack_state *state = space->machine().driver_data<bombjack_state>();
if (state->background_image != data)
{
@@ -36,17 +36,17 @@ WRITE8_HANDLER( bombjack_background_w )
WRITE8_HANDLER( bombjack_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
- UINT8 *tilerom = machine->region("gfx4")->base();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
+ UINT8 *tilerom = machine.region("gfx4")->base();
int offs = (state->background_image & 0x07) * 0x200 + tile_index;
int code = (state->background_image & 0x10) ? tilerom[offs] : 0;
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
int code = state->videoram[tile_index] + 16 * (state->colorram[tile_index] & 0x10);
int color = state->colorram[tile_index] & 0x0f;
@@ -68,16 +68,16 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( bombjack )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -125,7 +125,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[(state->spriteram[offs] & 0x80) ? 3 : 2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[(state->spriteram[offs] & 0x80) ? 3 : 2],
state->spriteram[offs] & 0x7f,
state->spriteram[offs + 1] & 0x0f,
flipx,flipy,
@@ -135,9 +135,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( bombjack )
{
- bombjack_state *state = screen->machine->driver_data<bombjack_state>();
+ bombjack_state *state = screen->machine().driver_data<bombjack_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/boogwing.c b/src/mame/video/boogwing.c
index 537aa43d022..516f93c88ac 100644
--- a/src/mame/video/boogwing.c
+++ b/src/mame/video/boogwing.c
@@ -3,9 +3,9 @@
#include "video/deco16ic.h"
#include "video/decocomn.h"
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram_base, int gfx_region )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram_base, int gfx_region )
{
- boogwing_state *state = machine->driver_data<boogwing_state>();
+ boogwing_state *state = machine.driver_data<boogwing_state>();
int offs;
int flipscreen = !flip_screen_get(machine);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
@@ -21,7 +21,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = spriteram_base[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = spriteram_base[offs + 2];
@@ -126,7 +126,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
decocomn_pdrawgfx(
state->decocomn,
- bitmap, cliprect, machine->gfx[gfx_region],
+ bitmap, cliprect, machine.gfx[gfx_region],
sprite - multi * inc,
colour,
fx,fy,
@@ -140,18 +140,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( boogwing )
{
- boogwing_state *state = screen->machine->driver_data<boogwing_state>();
+ boogwing_state *state = screen->machine().driver_data<boogwing_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
decocomn_clear_sprite_priority_bitmap(state->decocomn);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x400]); /* pen not confirmed */
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x400]); /* pen not confirmed */
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
// bit&0x8 is definitely some kind of palette effect
// bit&0x4 combines playfields
@@ -182,8 +182,8 @@ SCREEN_UPDATE( boogwing )
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 32);
}
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 4);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index 45b872ce23c..afd95ac868c 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -18,7 +18,7 @@ PALETTE_INIT( bosco )
{
int i;
- machine->colortable = colortable_alloc(machine, 32+64);
+ machine.colortable = colortable_alloc(machine, 32+64);
/* core palette */
for (i = 0;i < 32;i++)
@@ -39,7 +39,7 @@ PALETTE_INIT( bosco )
bit2 = ((*color_prom) >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -56,24 +56,24 @@ PALETTE_INIT( bosco )
bits = (i >> 4) & 0x03;
b = map[bits];
- colortable_palette_set_color(machine->colortable,32 + i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,32 + i,MAKE_RGB(r,g,b));
}
/* characters / sprites */
for (i = 0;i < 64*4;i++)
{
- colortable_entry_set_value(machine->colortable, i, (color_prom[i] & 0x0f) + 0x10); /* chars */
- colortable_entry_set_value(machine->colortable, i+64*4, color_prom[i] & 0x0f); /* sprites */
+ colortable_entry_set_value(machine.colortable, i, (color_prom[i] & 0x0f) + 0x10); /* chars */
+ colortable_entry_set_value(machine.colortable, i+64*4, color_prom[i] & 0x0f); /* sprites */
}
/* bullets lookup table */
/* they use colors 28-31, I think - PAL 5A controls it */
for (i = 0;i < 4;i++)
- colortable_entry_set_value(machine->colortable, 64*4+64*4+i, 31-i);
+ colortable_entry_set_value(machine.colortable, 64*4+64*4+i, 31-i);
/* now the stars */
for (i = 0;i < 64;i++)
- colortable_entry_set_value(machine->colortable, 64*4+64*4+4+i, 32 + i);
+ colortable_entry_set_value(machine.colortable, 64*4+64*4+4+i, 32 + i);
}
@@ -91,9 +91,9 @@ static TILEMAP_MAPPER( fg_tilemap_scan )
}
-INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs)
+INLINE void get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int ram_offs)
{
- bosco_state *state = machine->driver_data<bosco_state>();
+ bosco_state *state = machine.driver_data<bosco_state>();
UINT8 attr = state->videoram[ram_offs + tile_index + 0x800];
tileinfo->category = (attr & 0x20) >> 5;
@@ -125,19 +125,19 @@ static TILE_GET_INFO( fg_get_tile_info )
VIDEO_START( bosco )
{
- bosco_state *state = machine->driver_data<bosco_state>();
+ bosco_state *state = machine.driver_data<bosco_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info,fg_tilemap_scan, 8,8, 8,32);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 0x1f);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0x1f);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 0x1f);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 0x1f);
tilemap_set_scrolldx(state->bg_tilemap,3,3);
- machine->generic.spriteram_size = 0x0c;
- machine->generic.spriteram.u8 = state->videoram + 0x03d4;
- machine->generic.spriteram2.u8 = machine->generic.spriteram.u8 + 0x0800;
+ machine.generic.spriteram_size = 0x0c;
+ machine.generic.spriteram.u8 = state->videoram + 0x03d4;
+ machine.generic.spriteram2.u8 = machine.generic.spriteram.u8 + 0x0800;
state->bosco_radarx = state->videoram + 0x03f0;
state->bosco_radary = state->bosco_radarx + 0x0800;
@@ -156,7 +156,7 @@ VIDEO_START( bosco )
WRITE8_HANDLER( bosco_videoram_w )
{
- bosco_state *state = space->machine->driver_data<bosco_state>();
+ bosco_state *state = space->machine().driver_data<bosco_state>();
state->videoram[offset] = data;
if (offset & 0x400)
@@ -167,14 +167,14 @@ WRITE8_HANDLER( bosco_videoram_w )
WRITE8_HANDLER( bosco_scrollx_w )
{
- bosco_state *state = space->machine->driver_data<bosco_state>();
+ bosco_state *state = space->machine().driver_data<bosco_state>();
tilemap_set_scrollx(state->bg_tilemap,0,data);
}
WRITE8_HANDLER( bosco_scrolly_w )
{
- bosco_state *state = space->machine->driver_data<bosco_state>();
+ bosco_state *state = space->machine().driver_data<bosco_state>();
tilemap_set_scrolly(state->bg_tilemap,0,data);
}
@@ -190,13 +190,13 @@ WRITE8_HANDLER( bosco_starclr_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT8 *spriteram = machine->generic.spriteram.u8;
- UINT8 *spriteram_2 = machine->generic.spriteram2.u8;
+ UINT8 *spriteram = machine.generic.spriteram.u8;
+ UINT8 *spriteram_2 = machine.generic.spriteram2.u8;
int offs;
- for (offs = 0;offs < machine->generic.spriteram_size;offs += 2)
+ for (offs = 0;offs < machine.generic.spriteram_size;offs += 2)
{
int sx = spriteram[offs + 1] - 1;
int sy = 240 - spriteram_2[offs];
@@ -205,19 +205,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int color = spriteram_2[offs + 1] & 0x3f;
if (flip_screen_get(machine)) sx += 32-2;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
(spriteram[offs] & 0xfc) >> 2,
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x0f));
}
}
-static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- bosco_state *state = machine->driver_data<bosco_state>();
+ bosco_state *state = machine.driver_data<bosco_state>();
int offs;
for (offs = 4; offs < 0x10;offs++)
@@ -228,7 +228,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
y = 253 - state->bosco_radary[offs];
if (flip_screen_get(machine)) x -= 3;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
((state->bosco_radarattr[offs] & 0x0e) >> 1) ^ 0x07,
0,
0,0,
@@ -237,9 +237,9 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- bosco_state *state = machine->driver_data<bosco_state>();
+ bosco_state *state = machine.driver_data<bosco_state>();
if (1)
{
@@ -275,13 +275,13 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
SCREEN_UPDATE( bosco )
{
- bosco_state *state = screen->machine->driver_data<bosco_state>();
+ bosco_state *state = screen->machine().driver_data<bosco_state>();
/* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
the screen, and clip it to only the position where it is supposed to be shown */
rectangle fg_clip = *cliprect;
rectangle bg_clip = *cliprect;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
bg_clip.min_x = 8*8;
fg_clip.max_x = 8*8-1;
@@ -292,19 +292,19 @@ SCREEN_UPDATE( bosco )
fg_clip.min_x = 28*8;
}
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- draw_stars(screen->machine,bitmap,cliprect,flip_screen_get(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ draw_stars(screen->machine(),bitmap,cliprect,flip_screen_get(screen->machine()));
tilemap_draw(bitmap,&bg_clip,state->bg_tilemap,0,0);
tilemap_draw(bitmap,&fg_clip,state->fg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
/* draw the high priority characters */
tilemap_draw(bitmap,&bg_clip,state->bg_tilemap,1,0);
tilemap_draw(bitmap,&fg_clip,state->fg_tilemap,1,0);
- draw_bullets(screen->machine, bitmap,cliprect);
+ draw_bullets(screen->machine(), bitmap,cliprect);
return 0;
}
@@ -312,7 +312,7 @@ SCREEN_UPDATE( bosco )
SCREEN_EOF( bosco )
{
- bosco_state *state = machine->driver_data<bosco_state>();
+ bosco_state *state = machine.driver_data<bosco_state>();
static const int speedsx[8] = { -1, -2, -3, 0, 3, 2, 1, 0 };
static const int speedsy[8] = { 0, -1, -2, -3, 0, 3, 2, 1 };
diff --git a/src/mame/video/bottom9.c b/src/mame/video/bottom9.c
index a10d483a6a6..3f59feb16c8 100644
--- a/src/mame/video/bottom9.c
+++ b/src/mame/video/bottom9.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void bottom9_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void bottom9_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
*code |= (*color & 0x3f) << 8;
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
@@ -23,11 +23,11 @@ void bottom9_tile_callback( running_machine *machine, int layer, int bank, int *
***************************************************************************/
-void bottom9_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void bottom9_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
/* bit 4 = priority over zoom (0 = have priority) */
/* bit 5 = priority over B (1 = have priority) */
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
*priority = (*color & 0x30) >> 4;
*color = state->sprite_colorbase + (*color & 0x0f);
}
@@ -39,9 +39,9 @@ void bottom9_sprite_callback( running_machine *machine, int *code, int *color, i
***************************************************************************/
-void bottom9_zoom_callback( running_machine *machine, int *code, int *color, int *flags )
+void bottom9_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
*flags = (*color & 0x40) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8);
*color = state->zoom_colorbase + ((*color & 0x3c) >> 2);
@@ -56,7 +56,7 @@ void bottom9_zoom_callback( running_machine *machine, int *code, int *color, int
VIDEO_START( bottom9 )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
state->layer_colorbase[0] = 0; /* not used */
state->layer_colorbase[1] = 0;
@@ -75,7 +75,7 @@ VIDEO_START( bottom9 )
SCREEN_UPDATE( bottom9 )
{
- bottom9_state *state = screen->machine->driver_data<bottom9_state>();
+ bottom9_state *state = screen->machine().driver_data<bottom9_state>();
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c
index f6a33f4cdbc..8364d647ea8 100644
--- a/src/mame/video/brkthru.c
+++ b/src/mame/video/brkthru.c
@@ -36,7 +36,7 @@ PALETTE_INIT( brkthru )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -50,10 +50,10 @@ PALETTE_INIT( brkthru )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine, i, MAKE_RGB(r,g,b));
@@ -72,7 +72,7 @@ PALETTE_INIT( brkthru )
static TILE_GET_INFO( get_bg_tile_info )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
/* BG RAM format
0 1
---- -c-- ---- ---- = Color
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_bg_tile_info )
WRITE8_HANDLER( brkthru_bgram_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -97,14 +97,14 @@ WRITE8_HANDLER( brkthru_bgram_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
UINT8 code = state->fg_videoram[tile_index];
SET_TILE_INFO(0, code, 0, 0);
}
WRITE8_HANDLER( brkthru_fgram_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -112,7 +112,7 @@ WRITE8_HANDLER( brkthru_fgram_w )
VIDEO_START( brkthru )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 16);
@@ -124,14 +124,14 @@ VIDEO_START( brkthru )
WRITE8_HANDLER( brkthru_1800_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
if (offset == 0) /* low 8 bits of scroll */
state->bgscroll = (state->bgscroll & 0x100) | data;
else if (offset == 1)
{
/* bit 0-2 = ROM bank select */
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
/* bit 3-5 = background tiles color code */
if (((data & 0x38) >> 2) != state->bgbasecolor)
@@ -166,9 +166,9 @@ static void show_register( bitmap_t *bitmap, int x, int y, UINT32 data )
#endif
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int prio )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int prio )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
int offs;
/* Draw the sprites. Note that it is important to draw them exactly in this */
/* order, to have the correct priorities. */
@@ -206,24 +206,24 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (state->spriteram[offs] & 0x10) /* double height */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code & ~1,
color,
state->flipscreen, state->flipscreen,
sx, state->flipscreen ? sy + 16 : sy - 16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code | 1,
color,
state->flipscreen, state->flipscreen,
sx,sy,0);
/* redraw with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code & ~1,
color,
state->flipscreen, state->flipscreen,
sx,(state->flipscreen ? sy + 16 : sy - 16) + 256,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code | 1,
color,
state->flipscreen, state->flipscreen,
@@ -232,14 +232,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code,
color,
state->flipscreen, state->flipscreen,
sx,sy,0);
/* redraw with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[9],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[9],
code,
color,
state->flipscreen, state->flipscreen,
@@ -252,19 +252,19 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( brkthru )
{
- brkthru_state *state = screen->machine->driver_data<brkthru_state>();
+ brkthru_state *state = screen->machine().driver_data<brkthru_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bgscroll);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
/* low priority sprites */
- draw_sprites(screen->machine, bitmap, cliprect, 0x01);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x01);
/* draw background over low priority sprites */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* high priority sprites */
- draw_sprites(screen->machine, bitmap, cliprect, 0x09);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x09);
/* fg layer */
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/bsktball.c b/src/mame/video/bsktball.c
index 02cb1b1a533..14620afeccf 100644
--- a/src/mame/video/bsktball.c
+++ b/src/mame/video/bsktball.c
@@ -10,7 +10,7 @@
WRITE8_HANDLER( bsktball_videoram_w )
{
- bsktball_state *state = space->machine->driver_data<bsktball_state>();
+ bsktball_state *state = space->machine().driver_data<bsktball_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -18,7 +18,7 @@ WRITE8_HANDLER( bsktball_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
int attr = state->videoram[tile_index];
int code = ((attr & 0x0f) << 2) | ((attr & 0x30) >> 4);
int color = (attr & 0x40) >> 6;
@@ -29,13 +29,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( bsktball )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
int mot;
for (mot = 0; mot < 16; mot++)
@@ -49,15 +49,15 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rec
pic = (pic & 0x3f);
color = (color & 0x3f);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], pic, color, flipx, 0, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], pic, color, flipx, 0, sx, sy, 0);
}
}
SCREEN_UPDATE( bsktball )
{
- bsktball_state *state = screen->machine->driver_data<bsktball_state>();
+ bsktball_state *state = screen->machine().driver_data<bsktball_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index cd70d75745d..bf89250fdad 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -37,7 +37,7 @@ PALETTE_INIT( btime )
/* This function is also used by Eggs. */
if (color_prom == 0) return;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -82,7 +82,7 @@ PALETTE_INIT( lnc )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -114,22 +114,22 @@ Start the video hardware emulation.
VIDEO_START( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
- if (machine->gfx[0]->srcdata == NULL)
- gfx_element_set_source(machine->gfx[0], state->deco_charram);
- if (machine->gfx[1]->srcdata == NULL)
- gfx_element_set_source(machine->gfx[1], state->deco_charram);
+ if (machine.gfx[0]->srcdata == NULL)
+ gfx_element_set_source(machine.gfx[0], state->deco_charram);
+ if (machine.gfx[1]->srcdata == NULL)
+ gfx_element_set_source(machine.gfx[1], state->deco_charram);
}
VIDEO_START( bnj )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
/* the background area is twice as wide as the screen */
int width = 256;
int height = 256;
- bitmap_format format = machine->primary_screen->format();
+ bitmap_format format = machine.primary_screen->format();
state->background_bitmap = auto_bitmap_alloc(machine, 2 * width, height, format);
state->save_item(NAME(*state->background_bitmap));
@@ -146,14 +146,14 @@ WRITE8_HANDLER( btime_paletteram_w )
WRITE8_HANDLER( lnc_videoram_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
state->videoram[offset] = data;
state->colorram[offset] = *state->lnc_charbank;
}
READ8_HANDLER( btime_mirrorvideoram_r )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
int x, y;
/* swap x and y coordinates */
@@ -166,7 +166,7 @@ READ8_HANDLER( btime_mirrorvideoram_r )
READ8_HANDLER( btime_mirrorcolorram_r )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
int x, y;
/* swap x and y coordinates */
@@ -179,7 +179,7 @@ READ8_HANDLER( btime_mirrorcolorram_r )
WRITE8_HANDLER( btime_mirrorvideoram_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
int x, y;
/* swap x and y coordinates */
@@ -204,7 +204,7 @@ WRITE8_HANDLER( lnc_mirrorvideoram_w )
WRITE8_HANDLER( btime_mirrorcolorram_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
int x, y;
/* swap x and y coordinates */
@@ -217,7 +217,7 @@ WRITE8_HANDLER( btime_mirrorcolorram_w )
WRITE8_HANDLER( deco_charram_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (state->deco_charram[offset] == data)
return;
@@ -226,27 +226,27 @@ WRITE8_HANDLER( deco_charram_w )
offset &= 0x1fff;
/* dirty sprite */
- gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset >> 5);
/* diry char */
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 3);
}
WRITE8_HANDLER( bnj_background_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
state->bnj_backgroundram[offset] = data;
}
WRITE8_HANDLER( bnj_scroll1_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
state->bnj_scroll1 = data;
}
WRITE8_HANDLER( bnj_scroll2_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
state->bnj_scroll2 = data;
}
@@ -257,7 +257,7 @@ WRITE8_HANDLER( btime_video_control_w )
// Bit 0 = Flip screen
// Bit 1-7 = Unknown
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
WRITE8_HANDLER( bnj_video_control_w )
@@ -272,13 +272,13 @@ WRITE8_HANDLER( bnj_video_control_w )
/* For now we just check 0x40 in DSW1, and ignore the write if we */
/* are in upright controls mode. */
- if (input_port_read(space->machine, "DSW1") & 0x40) /* cocktail mode */
+ if (input_port_read(space->machine(), "DSW1") & 0x40) /* cocktail mode */
btime_video_control_w(space, offset, data);
}
WRITE8_HANDLER( zoar_video_control_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
// Zoar video control
//
// Bit 0-2 = Unknown (always 0). Marked as MCOL on schematics
@@ -287,23 +287,23 @@ WRITE8_HANDLER( zoar_video_control_w )
state->btime_palette = (data & 0x30) >> 3;
- if (input_port_read(space->machine, "DSW1") & 0x40) /* cocktail mode */
- flip_screen_set(space->machine, data & 0x80);
+ if (input_port_read(space->machine(), "DSW1") & 0x40) /* cocktail mode */
+ flip_screen_set(space->machine(), data & 0x80);
}
WRITE8_HANDLER( disco_video_control_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
state->btime_palette = (data >> 2) & 0x03;
- if (!(input_port_read(space->machine, "DSW1") & 0x40)) /* cocktail mode */
- flip_screen_set(space->machine, data & 0x01);
+ if (!(input_port_read(space->machine(), "DSW1") & 0x40)) /* cocktail mode */
+ flip_screen_set(space->machine(), data & 0x01);
}
-static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 transparency, UINT8 color, int priority )
+static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 transparency, UINT8 color, int priority )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -323,7 +323,7 @@ static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectan
y = 33 - y;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flip_screen_get(machine),flip_screen_get(machine),
@@ -332,7 +332,7 @@ static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectan
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 color,
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 color,
UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen,
UINT8 *sprite_ram, offs_t interleave )
{
@@ -364,7 +364,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = y - sprite_y_adjust;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite_ram[offs + interleave],
color,
flipx,flipy,
@@ -373,7 +373,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = y + (flip_screen_get(machine) ? -256 : 256);
// Wrap around
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite_ram[offs + interleave],
color,
flipx,flipy,
@@ -382,11 +382,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* tmap, UINT8 color )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* tmap, UINT8 color )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
int i;
- const UINT8 *gfx = machine->region("bg_map")->base();
+ const UINT8 *gfx = machine.region("bg_map")->base();
int scroll = -(state->bnj_scroll2 | ((state->bnj_scroll1 & 0x03) << 8));
// One extra iteration for wrap around
@@ -412,7 +412,7 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
y = 256 - y;
}
- drawgfx_opaque(bitmap, cliprect,machine->gfx[2],
+ drawgfx_opaque(bitmap, cliprect,machine.gfx[2],
gfx[tileoffset + offs],
color,
flip_screen_get(machine),flip_screen_get(machine),
@@ -424,13 +424,13 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
SCREEN_UPDATE( btime )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
+ btime_state *state = screen->machine().driver_data<btime_state>();
if (state->bnj_scroll1 & 0x10)
{
int i, start;
// Generate tile map
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
start = 0;
else
start = 1;
@@ -441,13 +441,13 @@ SCREEN_UPDATE( btime )
start = (start + 1) & 0x03;
}
- draw_background(screen->machine, bitmap, cliprect, state->btime_tilemap, 0);
- draw_chars(screen->machine, bitmap, cliprect, TRUE, 0, -1);
+ draw_background(screen->machine(), bitmap, cliprect, state->btime_tilemap, 0);
+ draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, -1);
}
else
- draw_chars(screen->machine, bitmap, cliprect, FALSE, 0, -1);
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 1, 0, state->videoram, 0x20);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 0, state->videoram, 0x20);
return 0;
}
@@ -455,9 +455,9 @@ SCREEN_UPDATE( btime )
SCREEN_UPDATE( eggs )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
- draw_chars(screen->machine, bitmap, cliprect, FALSE, 0, -1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
+ btime_state *state = screen->machine().driver_data<btime_state>();
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
return 0;
}
@@ -465,9 +465,9 @@ SCREEN_UPDATE( eggs )
SCREEN_UPDATE( lnc )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
- draw_chars(screen->machine, bitmap, cliprect, FALSE, 0, -1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 1, 2, state->videoram, 0x20);
+ btime_state *state = screen->machine().driver_data<btime_state>();
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 2, state->videoram, 0x20);
return 0;
}
@@ -475,18 +475,18 @@ SCREEN_UPDATE( lnc )
SCREEN_UPDATE( zoar )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
+ btime_state *state = screen->machine().driver_data<btime_state>();
if (state->bnj_scroll1 & 0x04)
{
- draw_background(screen->machine, bitmap, cliprect, state->zoar_scrollram, state->btime_palette);
- draw_chars(screen->machine, bitmap, cliprect, TRUE, state->btime_palette + 1, -1);
+ draw_background(screen->machine(), bitmap, cliprect, state->zoar_scrollram, state->btime_palette);
+ draw_chars(screen->machine(), bitmap, cliprect, TRUE, state->btime_palette + 1, -1);
}
else
- draw_chars(screen->machine, bitmap, cliprect, FALSE, state->btime_palette + 1, -1);
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, state->btime_palette + 1, -1);
/* The order is important for correct priorities */
- draw_sprites(screen->machine, bitmap, cliprect, state->btime_palette + 1, 1, 2, state->videoram + 0x1f, 0x20);
- draw_sprites(screen->machine, bitmap, cliprect, state->btime_palette + 1, 1, 2, state->videoram, 0x20);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->btime_palette + 1, 1, 2, state->videoram + 0x1f, 0x20);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->btime_palette + 1, 1, 2, state->videoram, 0x20);
return 0;
}
@@ -494,7 +494,7 @@ SCREEN_UPDATE( zoar )
SCREEN_UPDATE( bnj )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
+ btime_state *state = screen->machine().driver_data<btime_state>();
if (state->bnj_scroll1)
{
int scroll, offs;
@@ -507,35 +507,35 @@ SCREEN_UPDATE( bnj )
sy = 16 * (((offs % 0x100) < 0x80) ? offs % 8 : (offs % 8) + 8);
sx = 496 - sx;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 496 - sx;
sy = 256 - sy;
}
- drawgfx_opaque(state->background_bitmap, 0, screen->machine->gfx[2],
+ drawgfx_opaque(state->background_bitmap, 0, screen->machine().gfx[2],
(state->bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
0,
- flip_screen_get(screen->machine), flip_screen_get(screen->machine),
+ flip_screen_get(screen->machine()), flip_screen_get(screen->machine()),
sx, sy);
}
/* copy the background bitmap to the screen */
scroll = (state->bnj_scroll1 & 0x02) * 128 + 511 - state->bnj_scroll2;
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
scroll = 767 - scroll;
copyscrollbitmap(bitmap, state->background_bitmap, 1, &scroll, 0, 0, cliprect);
/* copy the low priority characters followed by the sprites
then the high priority characters */
- draw_chars(screen->machine, bitmap, cliprect, TRUE, 0, 1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
- draw_chars(screen->machine, bitmap, cliprect, TRUE, 0, 0);
+ draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
+ draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, 0);
}
else
{
- draw_chars(screen->machine, bitmap, cliprect, FALSE, 0, -1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, 0, -1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0, 0, state->videoram, 0x20);
}
return 0;
@@ -544,7 +544,7 @@ SCREEN_UPDATE( bnj )
SCREEN_UPDATE( cookrace )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
+ btime_state *state = screen->machine().driver_data<btime_state>();
int offs;
for (offs = state->bnj_backgroundram_size - 1; offs >=0; offs--)
@@ -554,21 +554,21 @@ SCREEN_UPDATE( cookrace )
sx = 31 - (offs / 32);
sy = offs % 32;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 31 - sx;
sy = 33 - sy;
}
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[2],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[2],
state->bnj_backgroundram[offs],
0,
- flip_screen_get(screen->machine), flip_screen_get(screen->machine),
+ flip_screen_get(screen->machine()), flip_screen_get(screen->machine()),
8*sx,8*sy);
}
- draw_chars(screen->machine, bitmap, cliprect, TRUE, 0, -1);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 1, 0, state->videoram, 0x20);
+ draw_chars(screen->machine(), bitmap, cliprect, TRUE, 0, -1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 1, 0, state->videoram, 0x20);
return 0;
}
@@ -576,9 +576,9 @@ SCREEN_UPDATE( cookrace )
SCREEN_UPDATE( disco )
{
- btime_state *state = screen->machine->driver_data<btime_state>();
- draw_chars(screen->machine, bitmap, cliprect, FALSE, state->btime_palette, -1);
- draw_sprites(screen->machine, bitmap, cliprect, state->btime_palette, 0, 0, state->spriteram, 1);
+ btime_state *state = screen->machine().driver_data<btime_state>();
+ draw_chars(screen->machine(), bitmap, cliprect, FALSE, state->btime_palette, -1);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->btime_palette, 0, 0, state->spriteram, 1);
return 0;
}
diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c
index 40ad05b0f29..53fcb855837 100644
--- a/src/mame/video/btoads.c
+++ b/src/mame/video/btoads.c
@@ -24,7 +24,7 @@
VIDEO_START( btoads )
{
- btoads_state *state = machine->driver_data<btoads_state>();
+ btoads_state *state = machine.driver_data<btoads_state>();
/* initialize the swapped pointers */
state->vram_fg_draw = (UINT8 *)state->vram_fg0;
state->vram_fg_display = (UINT8 *)state->vram_fg1;
@@ -50,23 +50,23 @@ VIDEO_START( btoads )
WRITE16_HANDLER( btoads_misc_control_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
COMBINE_DATA(&state->misc_control);
/* bit 3 controls sound reset line */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (state->misc_control & 8) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (state->misc_control & 8) ? CLEAR_LINE : ASSERT_LINE);
}
WRITE16_HANDLER( btoads_display_control_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
if (ACCESSING_BITS_8_15)
{
/* allow multiple changes during display */
- int scanline = space->machine->primary_screen->vpos();
+ int scanline = space->machine().primary_screen->vpos();
if (scanline > 0)
- space->machine->primary_screen->update_partial(scanline - 1);
+ space->machine().primary_screen->update_partial(scanline - 1);
/* bit 15 controls which page is rendered and which page is displayed */
if (data & 0x8000)
@@ -95,9 +95,9 @@ WRITE16_HANDLER( btoads_display_control_w )
WRITE16_HANDLER( btoads_scroll0_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
/* allow multiple changes during display */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* upper bits are Y scroll, lower bits are X scroll */
if (ACCESSING_BITS_8_15)
@@ -109,9 +109,9 @@ WRITE16_HANDLER( btoads_scroll0_w )
WRITE16_HANDLER( btoads_scroll1_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
/* allow multiple changes during display */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* upper bits are Y scroll, lower bits are X scroll */
if (ACCESSING_BITS_8_15)
@@ -130,13 +130,13 @@ WRITE16_HANDLER( btoads_scroll1_w )
WRITE16_HANDLER( btoads_paletteram_w )
{
- tlc34076_w(space->machine->device("tlc34076"), offset/2, data);
+ tlc34076_w(space->machine().device("tlc34076"), offset/2, data);
}
READ16_HANDLER( btoads_paletteram_r )
{
- return tlc34076_r(space->machine->device("tlc34076"), offset/2);
+ return tlc34076_r(space->machine().device("tlc34076"), offset/2);
}
@@ -149,28 +149,28 @@ READ16_HANDLER( btoads_paletteram_r )
WRITE16_HANDLER( btoads_vram_bg0_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
COMBINE_DATA(&state->vram_bg0[offset & 0x3fcff]);
}
WRITE16_HANDLER( btoads_vram_bg1_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
COMBINE_DATA(&state->vram_bg1[offset & 0x3fcff]);
}
READ16_HANDLER( btoads_vram_bg0_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->vram_bg0[offset & 0x3fcff];
}
READ16_HANDLER( btoads_vram_bg1_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->vram_bg1[offset & 0x3fcff];
}
@@ -184,7 +184,7 @@ READ16_HANDLER( btoads_vram_bg1_r )
WRITE16_HANDLER( btoads_vram_fg_display_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
if (ACCESSING_BITS_0_7)
state->vram_fg_display[offset] = data;
}
@@ -192,7 +192,7 @@ WRITE16_HANDLER( btoads_vram_fg_display_w )
WRITE16_HANDLER( btoads_vram_fg_draw_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
if (ACCESSING_BITS_0_7)
state->vram_fg_draw[offset] = data;
}
@@ -200,14 +200,14 @@ WRITE16_HANDLER( btoads_vram_fg_draw_w )
READ16_HANDLER( btoads_vram_fg_display_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->vram_fg_display[offset];
}
READ16_HANDLER( btoads_vram_fg_draw_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->vram_fg_draw[offset];
}
@@ -274,7 +274,7 @@ static void render_sprite_row(btoads_state *state, UINT16 *sprite_source, UINT32
void btoads_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
address &= ~0x40000000;
/* reads from this first region are usual shift register reads */
@@ -296,13 +296,13 @@ void btoads_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
}
else
- logerror("%s:btoads_to_shiftreg(%08X)\n", space->machine->describe_context(), address);
+ logerror("%s:btoads_to_shiftreg(%08X)\n", space->machine().describe_context(), address);
}
void btoads_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
address &= ~0x40000000;
/* writes to this first region are usual shift register writes */
@@ -322,7 +322,7 @@ void btoads_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg
render_sprite_row(state, shiftreg, address);
else
- logerror("%s:btoads_from_shiftreg(%08X)\n", space->machine->describe_context(), address);
+ logerror("%s:btoads_from_shiftreg(%08X)\n", space->machine().describe_context(), address);
}
@@ -335,13 +335,13 @@ void btoads_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg
void btoads_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- btoads_state *state = screen.machine->driver_data<btoads_state>();
+ btoads_state *state = screen.machine().driver_data<btoads_state>();
UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 4;
UINT16 *bg0_base = &state->vram_bg0[(fulladdr + (state->yscroll0 << 10)) & 0x3fc00];
UINT16 *bg1_base = &state->vram_bg1[(fulladdr + (state->yscroll1 << 10)) & 0x3fc00];
UINT8 *spr_base = &state->vram_fg_display[fulladdr & 0x3fc00];
UINT32 *dst = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = fulladdr & 0x3ff;
int x;
@@ -515,13 +515,13 @@ void btoads_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanlin
#if BT_DEBUG
popmessage("screen_control = %02X", state->screen_control & 0x7f);
- if (input_code_pressed(screen.machine, KEYCODE_X))
+ if (input_code_pressed(screen.machine(), KEYCODE_X))
{
char name[10];
FILE *f;
int i;
- while (input_code_pressed(screen.machine, KEYCODE_X)) ;
+ while (input_code_pressed(screen.machine(), KEYCODE_X)) ;
sprintf(name, "disp%d.log", state->xcount++);
f = fopen(name, "w");
diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c
index f85dbf52ec5..94b8063e640 100644
--- a/src/mame/video/bublbobl.c
+++ b/src/mame/video/bublbobl.c
@@ -12,7 +12,7 @@
SCREEN_UPDATE( bublbobl )
{
- bublbobl_state *state = screen->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = screen->machine().driver_data<bublbobl_state>();
int offs;
int sx, sy, xc, yc;
int gfx_num, gfx_attr, gfx_offs;
@@ -32,7 +32,7 @@ SCREEN_UPDATE( bublbobl )
sx = 0;
- prom = screen->machine->region("proms")->base();
+ prom = screen->machine().region("proms")->base();
for (offs = 0; offs < state->objectram_size; offs += 4)
{
/* skip empty sprites */
@@ -73,7 +73,7 @@ SCREEN_UPDATE( bublbobl )
x = sx + xc * 8;
y = (sy + yc * 8) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
x = 248 - x;
y = 248 - y;
@@ -81,7 +81,7 @@ SCREEN_UPDATE( bublbobl )
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
color,
flipx,flipy,
diff --git a/src/mame/video/buggychl.c b/src/mame/video/buggychl.c
index 230966e2ee3..801e314926d 100644
--- a/src/mame/video/buggychl.c
+++ b/src/mame/video/buggychl.c
@@ -14,43 +14,43 @@ PALETTE_INIT( buggychl )
VIDEO_START( buggychl )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
- state->tmp_bitmap1 = machine->primary_screen->alloc_compatible_bitmap();
- state->tmp_bitmap2 = machine->primary_screen->alloc_compatible_bitmap();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
+ state->tmp_bitmap1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmp_bitmap2 = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->tmp_bitmap1));
state->save_item(NAME(*state->tmp_bitmap2));
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
}
WRITE8_HANDLER( buggychl_chargen_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
if (state->charram[offset] != data)
{
state->charram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], (offset / 8) & 0xff);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset / 8) & 0xff);
}
}
WRITE8_HANDLER( buggychl_sprite_lookup_bank_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sl_bank = (data & 0x10) << 8;
}
WRITE8_HANDLER( buggychl_sprite_lookup_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sprite_lookup[offset + state->sl_bank] = data;
}
WRITE8_HANDLER( buggychl_ctrl_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
/*
bit7 = lamp
bit6 = lockout
@@ -61,21 +61,21 @@ WRITE8_HANDLER( buggychl_ctrl_w )
bit0 = VINV
*/
- flip_screen_y_set(space->machine, data & 0x01);
- flip_screen_x_set(space->machine, data & 0x02);
+ flip_screen_y_set(space->machine(), data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x02);
state->bg_on = data & 0x04;
state->sky_on = data & 0x08;
state->sprite_color_base = (data & 0x10) ? 1 * 16 : 3 * 16;
- coin_lockout_global_w(space->machine, (~data & 0x40) >> 6);
- set_led_status(space->machine, 0, ~data & 0x80);
+ coin_lockout_global_w(space->machine(), (~data & 0x40) >> 6);
+ set_led_status(space->machine(), 0, ~data & 0x80);
}
WRITE8_HANDLER( buggychl_bg_scrollx_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->bg_scrollx = -(data - 0x12);
}
@@ -90,9 +90,9 @@ static void draw_sky( bitmap_t *bitmap, const rectangle *cliprect )
}
-static void draw_bg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
int offs;
int scroll[256];
@@ -113,7 +113,7 @@ static void draw_bg( running_machine *machine, bitmap_t *bitmap, const rectangle
if (flip_screen_y_get(machine))
sy = 31 - sy;
- drawgfx_opaque(state->tmp_bitmap1, NULL, machine->gfx[0],
+ drawgfx_opaque(state->tmp_bitmap1, NULL, machine.gfx[0],
code,
2,
flip_screen_x_get(machine),flip_screen_y_get(machine),
@@ -134,9 +134,9 @@ static void draw_bg( running_machine *machine, bitmap_t *bitmap, const rectangle
}
-static void draw_fg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
int offs;
for (offs = 0; offs < 0x400; offs++)
@@ -153,7 +153,7 @@ static void draw_fg( running_machine *machine, bitmap_t *bitmap, const rectangle
if (flipy)
sy = 31 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
0,
flipx,flipy,
@@ -163,16 +163,16 @@ static void draw_fg( running_machine *machine, bitmap_t *bitmap, const rectangle
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
UINT8 *spriteram = state->spriteram;
int offs;
const UINT8 *gfx;
g_profiler.start(PROFILER_USER1);
- gfx = machine->region("gfx2")->base();
+ gfx = machine.region("gfx2")->base();
for (offs = 0; offs < state->spriteram_size; offs += 4)
{
int sx, sy, flipy, zoom, ch, x, px, y;
@@ -211,7 +211,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8));
realflipy = (lookup[pos + 1] & 0x80) ? !flipy : flipy;
code += (realflipy ? (charline ^ 7) : charline);
- pendata = gfx_element_get_data(machine->gfx[1], code);
+ pendata = gfx_element_get_data(machine.gfx[1], code);
for (x = 0; x < 16; x++)
{
@@ -238,7 +238,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( buggychl )
{
- buggychl_state *state = screen->machine->driver_data<buggychl_state>();
+ buggychl_state *state = screen->machine().driver_data<buggychl_state>();
if (state->sky_on)
draw_sky(bitmap, cliprect);
@@ -246,11 +246,11 @@ SCREEN_UPDATE( buggychl )
bitmap_fill(bitmap, cliprect, 0);
if (state->bg_on)
- draw_bg(screen->machine, bitmap, cliprect);
+ draw_bg(screen->machine(), bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
- draw_fg(screen->machine, bitmap, cliprect);
+ draw_fg(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index 85da2c20b23..199ba870377 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -57,13 +57,13 @@ const gfx_layout bwing_tilelayout =
WRITE8_HANDLER( bwing_spriteram_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->spriteram[offset] = data;
}
WRITE8_HANDLER( bwing_videoram_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->charmap, offset);
}
@@ -71,7 +71,7 @@ WRITE8_HANDLER( bwing_videoram_w )
READ8_HANDLER ( bwing_scrollram_r )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
int offs;
if (!state->srbank)
@@ -85,7 +85,7 @@ READ8_HANDLER ( bwing_scrollram_r )
WRITE8_HANDLER( bwing_scrollram_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
int offs;
if (!state->srbank)
@@ -100,9 +100,9 @@ WRITE8_HANDLER( bwing_scrollram_w )
{
offs = offset;
if (offset < 0x1000)
- gfx_element_mark_dirty(space->machine->gfx[2], offset / 32);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset / 32);
else
- gfx_element_mark_dirty(space->machine->gfx[3], offset / 32);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset / 32);
}
(state->srbase[state->srbank])[offs] = data;
@@ -111,7 +111,7 @@ WRITE8_HANDLER( bwing_scrollram_w )
WRITE8_HANDLER( bwing_scrollreg_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->sreg[offset] = data;
switch (offset)
@@ -124,20 +124,20 @@ WRITE8_HANDLER( bwing_scrollreg_w )
state->srbank = data >> 6;
#if BW_DEBUG
- logerror("(%s)%04x: w=%02x a=%04x f=%d\n", space->cpu->tag, cpu_get_pc(space->cpu), data, 0x1b00 + offset, space->machine->primary_screen->frame_number());
+ logerror("(%s)%04x: w=%02x a=%04x f=%d\n", space->cpu->tag, cpu_get_pc(space->cpu), data, 0x1b00 + offset, space->machine().primary_screen->frame_number());
#endif
break;
}
#if BW_DEBUG
- (space->machine->region(REGION_CPU1)->base())[0x1b10 + offset] = data;
+ (space->machine().region(REGION_CPU1)->base())[0x1b10 + offset] = data;
#endif
}
WRITE8_HANDLER( bwing_paletteram_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
static const float rgb[4][3] = {
{0.85f, 0.95f, 1.00f},
{0.90f, 1.00f, 1.00f},
@@ -156,7 +156,7 @@ WRITE8_HANDLER( bwing_paletteram_w )
g = ((g << 5) + (g << 2) + (g >> 1));
b = ((b << 5) + (b << 2) + (b >> 1));
- if ((i = input_port_read(space->machine, "EXTRA")) < 4)
+ if ((i = input_port_read(space->machine(), "EXTRA")) < 4)
{
r = (float)r * rgb[i][0];
g = (float)g * rgb[i][1];
@@ -166,7 +166,7 @@ WRITE8_HANDLER( bwing_paletteram_w )
if (b > 0xff) b = 0xff;
}
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
#if BW_DEBUG
state->paletteram[offset + 0x40] = state->palatch;
@@ -178,21 +178,21 @@ WRITE8_HANDLER( bwing_paletteram_w )
static TILE_GET_INFO( get_fgtileinfo )
{
- bwing_state *state = machine->driver_data<bwing_state>();
- tileinfo->pen_data = gfx_element_get_data(machine->gfx[2], state->fgdata[tile_index] & (BW_NTILES - 1));
- tileinfo->palette_base = machine->gfx[2]->color_base + ((state->fgdata[tile_index] >> 7) << 3);
+ bwing_state *state = machine.driver_data<bwing_state>();
+ tileinfo->pen_data = gfx_element_get_data(machine.gfx[2], state->fgdata[tile_index] & (BW_NTILES - 1));
+ tileinfo->palette_base = machine.gfx[2]->color_base + ((state->fgdata[tile_index] >> 7) << 3);
}
static TILE_GET_INFO( get_bgtileinfo )
{
- bwing_state *state = machine->driver_data<bwing_state>();
- tileinfo->pen_data = gfx_element_get_data(machine->gfx[3], state->bgdata[tile_index] & (BW_NTILES - 1));
- tileinfo->palette_base = machine->gfx[3]->color_base + ((state->bgdata[tile_index] >> 7) << 3);
+ bwing_state *state = machine.driver_data<bwing_state>();
+ tileinfo->pen_data = gfx_element_get_data(machine.gfx[3], state->bgdata[tile_index] & (BW_NTILES - 1));
+ tileinfo->palette_base = machine.gfx[3]->color_base + ((state->bgdata[tile_index] >> 7) << 3);
}
static TILE_GET_INFO( get_charinfo )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
SET_TILE_INFO(0, state->videoram[tile_index], 0, 0);
}
@@ -204,7 +204,7 @@ static TILEMAP_MAPPER( bwing_scan_cols )
VIDEO_START( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
UINT32 *dwptr;
int i;
@@ -220,7 +220,7 @@ VIDEO_START( bwing )
fill_srxlat(state->srxlat);
- state->fgdata = machine->region("gpu")->base();
+ state->fgdata = machine.region("gpu")->base();
state->bgdata = state->fgdata + 0x1000;
for (i = 0; i < 4; i++)
@@ -229,13 +229,13 @@ VIDEO_START( bwing )
for (i = 0; i < 8; i++)
state->sreg[i] = 0;
-// state->fgfx = machine->gfx[2];
- gfx_element_set_source(machine->gfx[2], state->srbase[1]);
+// state->fgfx = machine.gfx[2];
+ gfx_element_set_source(machine.gfx[2], state->srbase[1]);
-// state->bgfx = machine->gfx[3];
- gfx_element_set_source(machine->gfx[3], state->srbase[1] + 0x1000);
+// state->bgfx = machine.gfx[3];
+ gfx_element_set_source(machine.gfx[3], state->srbase[1] + 0x1000);
- dwptr = machine->gfx[2]->pen_usage;
+ dwptr = machine.gfx[2]->pen_usage;
if (dwptr)
{
dwptr[0] = 0;
@@ -247,11 +247,11 @@ VIDEO_START( bwing )
//****************************************************************************
// Realtime
-static void draw_sprites( running_machine *machine, bitmap_t *bmp, const rectangle *clip, UINT8 *ram, int pri )
+static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectangle *clip, UINT8 *ram, int pri )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
int attrib, fx, fy, code, x, y, color, i;
- gfx_element *gfx = machine->gfx[1];
+ gfx_element *gfx = machine.gfx[1];
for (i = 0; i < 0x200; i += 4)
{
@@ -291,7 +291,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bmp, const rectang
SCREEN_UPDATE( bwing )
{
- bwing_state *state = screen->machine->driver_data<bwing_state>();
+ bwing_state *state = screen->machine().driver_data<bwing_state>();
unsigned x, y, shiftx;
if (state->mapmask & 0x20)
@@ -316,10 +316,10 @@ SCREEN_UPDATE( bwing )
tilemap_draw(bitmap, cliprect, state->bgmap, 0, 0);
}
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// draw low priority sprites
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0);
// draw foreground
if (!(state->mapmask & 2))
@@ -333,7 +333,7 @@ SCREEN_UPDATE( bwing )
}
// draw high priority sprites
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 1);
// draw text layer
// if (state->mapmask & 4)
diff --git a/src/mame/video/cabal.c b/src/mame/video/cabal.c
index 482f9eb9d5f..4d93d032300 100644
--- a/src/mame/video/cabal.c
+++ b/src/mame/video/cabal.c
@@ -11,7 +11,7 @@
static TILE_GET_INFO( get_back_tile_info )
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
int tile = state->videoram[tile_index];
int color = (tile>>12)&0xf;
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
int tile = state->colorram[tile_index];
int color = (tile>>10);
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( cabal )
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows,16,16,16,16);
state->text_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows, 8,8,32,32);
@@ -60,25 +60,25 @@ WRITE16_HANDLER( cabal_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
int flip = (data & 0x20) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
tilemap_set_flip(state->background_layer,flip);
tilemap_set_flip(state->text_layer,flip);
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
}
}
WRITE16_HANDLER( cabal_background_videoram16_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->background_layer,offset);
}
WRITE16_HANDLER( cabal_text_videoram16_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
COMBINE_DATA(&state->colorram[offset]);
tilemap_mark_tile_dirty(state->text_layer,offset);
}
@@ -105,9 +105,9 @@ WRITE16_HANDLER( cabal_text_videoram16_w )
********************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
int offs,data0,data1,data2;
UINT16 *spriteram16 = state->spriteram;
@@ -136,7 +136,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen( bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen( bitmap,cliprect,machine.gfx[2],
tile_number,
color,
flipx,flipy,
@@ -148,9 +148,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( cabal )
{
- cabal_state *state = screen->machine->driver_data<cabal_state>();
+ cabal_state *state = screen->machine().driver_data<cabal_state>();
tilemap_draw(bitmap,cliprect,state->background_layer,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->text_layer,0,0);
return 0;
}
diff --git a/src/mame/video/calomega.c b/src/mame/video/calomega.c
index 5474e69eaba..f4482c87524 100644
--- a/src/mame/video/calomega.c
+++ b/src/mame/video/calomega.c
@@ -19,21 +19,21 @@
WRITE8_HANDLER( calomega_videoram_w )
{
- calomega_state *state = space->machine->driver_data<calomega_state>();
+ calomega_state *state = space->machine().driver_data<calomega_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( calomega_colorram_w )
{
- calomega_state *state = space->machine->driver_data<calomega_state>();
+ calomega_state *state = space->machine().driver_data<calomega_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- calomega_state *state = machine->driver_data<calomega_state>();
+ calomega_state *state = machine.driver_data<calomega_state>();
/* - bits -
7654 3210
--xx xx-- tiles color.
@@ -59,13 +59,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( calomega )
{
- calomega_state *state = machine->driver_data<calomega_state>();
+ calomega_state *state = machine.driver_data<calomega_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 31);
}
SCREEN_UPDATE( calomega )
{
- calomega_state *state = screen->machine->driver_data<calomega_state>();
+ calomega_state *state = screen->machine().driver_data<calomega_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -84,7 +84,7 @@ PALETTE_INIT( calomega )
/* 00000BGR */
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, r, g, b;
diff --git a/src/mame/video/canyon.c b/src/mame/video/canyon.c
index 6188f0d49a3..c49a9c88a76 100644
--- a/src/mame/video/canyon.c
+++ b/src/mame/video/canyon.c
@@ -10,7 +10,7 @@ Atari Canyon Bomber video emulation
WRITE8_HANDLER( canyon_videoram_w )
{
- canyon_state *state = space->machine->driver_data<canyon_state>();
+ canyon_state *state = space->machine().driver_data<canyon_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -18,7 +18,7 @@ WRITE8_HANDLER( canyon_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- canyon_state *state = machine->driver_data<canyon_state>();
+ canyon_state *state = machine.driver_data<canyon_state>();
UINT8 code = state->videoram[tile_index];
SET_TILE_INFO(0, code & 0x3f, code >> 7, 0);
@@ -27,15 +27,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( canyon )
{
- canyon_state *state = machine->driver_data<canyon_state>();
+ canyon_state *state = machine.driver_data<canyon_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle* cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle* cliprect )
{
- canyon_state *state = machine->driver_data<canyon_state>();
+ canyon_state *state = machine.driver_data<canyon_state>();
int i;
for (i = 0; i < 2; i++)
@@ -45,7 +45,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int c = state->videoram[0x3d0 + 2 * i + 0x9];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
c >> 3,
i,
!(c & 0x80), 0,
@@ -55,9 +55,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void draw_bombs( running_machine *machine, bitmap_t *bitmap, const rectangle* cliprect )
+static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectangle* cliprect )
{
- canyon_state *state = machine->driver_data<canyon_state>();
+ canyon_state *state = machine.driver_data<canyon_state>();
int i;
for (i = 0; i < 2; i++)
@@ -84,16 +84,16 @@ static void draw_bombs( running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( canyon )
{
- canyon_state *state = screen->machine->driver_data<canyon_state>();
+ canyon_state *state = screen->machine().driver_data<canyon_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
- draw_bombs(screen->machine, bitmap, cliprect);
+ draw_bombs(screen->machine(), bitmap, cliprect);
/* watchdog is disabled during service mode */
- watchdog_enable(screen->machine, !(input_port_read(screen->machine, "IN2") & 0x10));
+ watchdog_enable(screen->machine(), !(input_port_read(screen->machine(), "IN2") & 0x10));
return 0;
}
diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c
index cb575c12c7f..91fe7c1df20 100644
--- a/src/mame/video/capbowl.c
+++ b/src/mame/video/capbowl.c
@@ -16,9 +16,9 @@
*
*************************************/
-static void generate_interrupt( running_machine *machine, int state )
+static void generate_interrupt( running_machine &machine, int state )
{
- capbowl_state *driver = machine->driver_data<capbowl_state>();
+ capbowl_state *driver = machine.driver_data<capbowl_state>();
device_set_input_line(driver->maincpu, M6809_FIRQ_LINE, state);
}
@@ -54,7 +54,7 @@ VIDEO_START( capbowl )
WRITE8_HANDLER( capbowl_tms34061_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
int func = (offset >> 8) & 3;
int col = offset & 0xff;
@@ -70,7 +70,7 @@ WRITE8_HANDLER( capbowl_tms34061_w )
READ8_HANDLER( capbowl_tms34061_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
int func = (offset >> 8) & 3;
int col = offset & 0xff;
@@ -93,7 +93,7 @@ READ8_HANDLER( capbowl_tms34061_r )
WRITE8_HANDLER( bowlrama_blitter_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
switch (offset)
{
@@ -118,8 +118,8 @@ WRITE8_HANDLER( bowlrama_blitter_w )
READ8_HANDLER( bowlrama_blitter_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
- UINT8 data = space->machine->region("gfx1")->base()[state->blitter_addr];
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
+ UINT8 data = space->machine().region("gfx1")->base()[state->blitter_addr];
UINT8 result = 0;
switch (offset)
@@ -176,7 +176,7 @@ SCREEN_UPDATE( capbowl )
/* if we're blanked, just fill with black */
if (state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
diff --git a/src/mame/video/carjmbre.c b/src/mame/video/carjmbre.c
index 7130204ac67..c4a3bdd301a 100644
--- a/src/mame/video/carjmbre.c
+++ b/src/mame/video/carjmbre.c
@@ -36,7 +36,7 @@ PALETTE_INIT( carjmbre )
rgb = compute_res_net_all(machine, color_prom, &carjmbre_decode_info, &carjmbre_net_info);
palette_set_colors(machine, 0, rgb, 64);
- palette_normalize_range(machine->palette, 0, 63, 0, 255);
+ palette_normalize_range(machine.palette, 0, 63, 0, 255);
auto_free(machine, rgb);
}
@@ -44,15 +44,15 @@ PALETTE_INIT( carjmbre )
WRITE8_HANDLER( carjmbre_flipscreen_w )
{
- carjmbre_state *state = space->machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
state->flipscreen = (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
- tilemap_set_flip_all(space->machine, state->flipscreen);
+ tilemap_set_flip_all(space->machine(), state->flipscreen);
}
WRITE8_HANDLER( carjmbre_bgcolor_w )
{
- carjmbre_state *state = space->machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
data = ~data & 0x3f;
if (data != state->bgcolor)
@@ -62,11 +62,11 @@ WRITE8_HANDLER( carjmbre_bgcolor_w )
state->bgcolor = data;
if (data & 3)
for (i = 0; i < 64; i += 4)
- palette_set_color(space->machine, i, palette_get_color(space->machine, data));
+ palette_set_color(space->machine(), i, palette_get_color(space->machine(), data));
else
// restore to initial state (black)
for (i = 0; i < 64; i += 4)
- palette_set_color(space->machine, i, RGB_BLACK);
+ palette_set_color(space->machine(), i, RGB_BLACK);
}
}
@@ -77,7 +77,7 @@ WRITE8_HANDLER( carjmbre_8806_w )
WRITE8_HANDLER( carjmbre_videoram_w )
{
- carjmbre_state *state = space->machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = space->machine().driver_data<carjmbre_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->cj_tilemap, offset & 0x3ff);
@@ -87,7 +87,7 @@ WRITE8_HANDLER( carjmbre_videoram_w )
static TILE_GET_INFO( get_carjmbre_tile_info )
{
- carjmbre_state *state = machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = machine.driver_data<carjmbre_state>();
UINT32 tile_number = state->videoram[tile_index] & 0xff;
UINT8 attr = state->videoram[tile_index + 0x400];
tile_number += (attr & 0x80) << 1; /* bank */
@@ -101,7 +101,7 @@ static TILE_GET_INFO( get_carjmbre_tile_info )
VIDEO_START( carjmbre )
{
- carjmbre_state *state = machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = machine.driver_data<carjmbre_state>();
state->cj_tilemap = tilemap_create(machine, get_carjmbre_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->save_item(NAME(state->flipscreen));
@@ -110,7 +110,7 @@ VIDEO_START( carjmbre )
SCREEN_UPDATE( carjmbre )
{
- carjmbre_state *state = screen->machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = screen->machine().driver_data<carjmbre_state>();
int offs, troffs, sx, sy, flipx, flipy;
//colorram
@@ -153,7 +153,7 @@ SCREEN_UPDATE( carjmbre )
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->spriteram[troffs + 1],
state->spriteram[troffs + 2] & 0xf,
flipx,flipy,
diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c
index fb7fcdbef46..ee9c6affbb2 100644
--- a/src/mame/video/carpolo.c
+++ b/src/mame/video/carpolo.c
@@ -90,7 +90,7 @@ PALETTE_INIT( carpolo )
};
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen, r, g, b;
@@ -142,8 +142,8 @@ PALETTE_INIT( carpolo )
VIDEO_START( carpolo )
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
- bitmap_format format = machine->primary_screen->format();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
+ bitmap_format format = machine.primary_screen->format();
state->sprite_sprite_collision_bitmap1 = auto_bitmap_alloc(machine, SPRITE_WIDTH*2, SPRITE_HEIGHT*2, format);
state->sprite_sprite_collision_bitmap2 = auto_bitmap_alloc(machine, SPRITE_WIDTH*2, SPRITE_HEIGHT*2, format);
@@ -167,10 +167,10 @@ VIDEO_START( carpolo )
*
*************************************/
-static void draw_alpha_line(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void draw_alpha_line(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
int alpha_line, int video_line)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
int x;
for (x = 0; x < 32; x++)
@@ -180,7 +180,7 @@ static void draw_alpha_line(running_machine *machine, bitmap_t *bitmap, const re
code = state->alpharam[alpha_line * 32 + x] >> 2;
col = state->alpharam[alpha_line * 32 + x] & 0x03;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,col,
0,0,
x*8,video_line*8,0);
@@ -188,9 +188,9 @@ static void draw_alpha_line(running_machine *machine, bitmap_t *bitmap, const re
}
-static void remap_sprite_code(running_machine *machine, int bank, int code, int *remapped_code, int *flipy)
+static void remap_sprite_code(running_machine &machine, int bank, int code, int *remapped_code, int *flipy)
{
- UINT8* PROM = machine->region("user1")->base();
+ UINT8* PROM = machine.region("user1")->base();
code = (bank << 4) | code;
*remapped_code = PROM[code] & 0x0f;
@@ -198,7 +198,7 @@ static void remap_sprite_code(running_machine *machine, int bank, int code, int
}
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
UINT8 x, UINT8 y, int bank, int code, int col)
{
int remapped_code, flipy;
@@ -208,13 +208,13 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap, const rectan
x = 240 - x;
y = 240 - y;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
remapped_code, col,
0, flipy,
x, y,0);
/* draw with wrap around */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
remapped_code, col,
0, flipy,
(INT16)x - 256, y,0);
@@ -223,7 +223,7 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( carpolo )
{
- carpolo_state *state = screen->machine->driver_data<carpolo_state>();
+ carpolo_state *state = screen->machine().driver_data<carpolo_state>();
/* draw the playfield elements in the correct priority order */
/* score area - position determined by bit 4 of the vertical timing PROM */
@@ -233,7 +233,7 @@ SCREEN_UPDATE( carpolo )
plot_box(bitmap,0,TOP_BORDER,RIGHT_BORDER+1,BOTTOM_BORDER-TOP_BORDER+1,FIELD_PEN);
/* car 1 */
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x00], state->spriteram[0x01],
0, state->spriteram[0x0c] & 0x0f, CAR1_COLOR);
@@ -244,35 +244,35 @@ SCREEN_UPDATE( carpolo )
plot_box(bitmap,RIGHT_BORDER,TOP_BORDER,1,BOTTOM_BORDER-TOP_BORDER+1,LINE_PEN);
/* car 4 */
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x06], state->spriteram[0x07],
0, state->spriteram[0x0d] >> 4, CAR4_COLOR);
/* car 3 */
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x04], state->spriteram[0x05],
0, state->spriteram[0x0d] & 0x0f, CAR3_COLOR);
/* car 2 */
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x02], state->spriteram[0x03],
0, state->spriteram[0x0c] >> 4, CAR2_COLOR);
/* ball */
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x08], state->spriteram[0x09],
1, state->spriteram[0x0e] & 0x0f, BALL_COLOR);
/* left goal - position determined by bit 6 of the
horizontal and vertical timing PROMs */
- drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,screen->machine().gfx[1],
0,0,
0,0,
LEFT_GOAL_X,GOAL_Y,
0x20000,0x20000,0);
/* right goal */
- drawgfxzoom_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,screen->machine().gfx[1],
0,1,
1,0,
RIGHT_GOAL_X,GOAL_Y,
@@ -284,7 +284,7 @@ SCREEN_UPDATE( carpolo )
popmessage("WIDE!\n");
if (state->spriteram[0x0f] & 0x01)
- draw_sprite(screen->machine, bitmap, cliprect,
+ draw_sprite(screen->machine(), bitmap, cliprect,
state->spriteram[0x0a], state->spriteram[0x0b],
1, state->spriteram[0x0e] >> 4, SPECIAL_CHAR_COLOR);
@@ -295,14 +295,14 @@ SCREEN_UPDATE( carpolo )
and bit 3 of the vertical timing PROM controls in
which quadrant the line will actually appear */
- draw_alpha_line(screen->machine, bitmap, cliprect, 0, (0*4+0)*2 );
- draw_alpha_line(screen->machine, bitmap, cliprect, 1, (0*4+0)*2+1);
- draw_alpha_line(screen->machine, bitmap, cliprect, 2, (3*4+1)*2 );
- draw_alpha_line(screen->machine, bitmap, cliprect, 3, (3*4+1)*2+1);
- draw_alpha_line(screen->machine, bitmap, cliprect, 4, (1*4+2)*2 );
- draw_alpha_line(screen->machine, bitmap, cliprect, 5, (1*4+2)*2+1);
- draw_alpha_line(screen->machine, bitmap, cliprect, 6, (0*4+3)*2 );
- draw_alpha_line(screen->machine, bitmap, cliprect, 7, (0*4+3)*2+1);
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 0, (0*4+0)*2 );
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 1, (0*4+0)*2+1);
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 2, (3*4+1)*2 );
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 3, (3*4+1)*2+1);
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 4, (1*4+2)*2 );
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 5, (1*4+2)*2+1);
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 6, (0*4+3)*2 );
+ draw_alpha_line(screen->machine(), bitmap, cliprect, 7, (0*4+3)*2+1);
return 0;
}
@@ -340,12 +340,12 @@ static void normalize_coordinates(int *x1, int *y1, int *x2, int *y2)
}
-static int check_sprite_sprite_collision(running_machine *machine,
+static int check_sprite_sprite_collision(running_machine &machine,
int x1, int y1, int code1, int flipy1,
int x2, int y2, int code2, int flipy2,
int *col_x, int *col_y)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
int collided = 0;
x1 = 240 - x1;
@@ -363,12 +363,12 @@ static int check_sprite_sprite_collision(running_machine *machine,
bitmap_fill(state->sprite_sprite_collision_bitmap1, 0, 0);
bitmap_fill(state->sprite_sprite_collision_bitmap2, 0, 0);
- drawgfx_opaque(state->sprite_sprite_collision_bitmap1,0,machine->gfx[0],
+ drawgfx_opaque(state->sprite_sprite_collision_bitmap1,0,machine.gfx[0],
code1,0,
0,flipy1,
x1,y1);
- drawgfx_opaque(state->sprite_sprite_collision_bitmap2,0,machine->gfx[0],
+ drawgfx_opaque(state->sprite_sprite_collision_bitmap2,0,machine.gfx[0],
code2,0,
0,flipy2,
x2,y2);
@@ -393,9 +393,9 @@ static int check_sprite_sprite_collision(running_machine *machine,
/* returns 1 for collision with goal post,
2 for collision with scoring area */
-static int check_sprite_left_goal_collision(running_machine *machine, int x1, int y1, int code1, int flipy1, int goalpost_only)
+static int check_sprite_left_goal_collision(running_machine &machine, int x1, int y1, int code1, int flipy1, int goalpost_only)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
int collided = 0;
x1 = 240 - x1;
@@ -417,12 +417,12 @@ static int check_sprite_left_goal_collision(running_machine *machine, int x1, in
bitmap_fill(state->sprite_goal_collision_bitmap1, 0, 0);
bitmap_fill(state->sprite_goal_collision_bitmap2, 0, 0);
- drawgfx_opaque(state->sprite_goal_collision_bitmap1,0,machine->gfx[0],
+ drawgfx_opaque(state->sprite_goal_collision_bitmap1,0,machine.gfx[0],
code1,0,
0,flipy1,
x1,y1);
- drawgfxzoom_transpen(state->sprite_goal_collision_bitmap2,0,machine->gfx[1],
+ drawgfxzoom_transpen(state->sprite_goal_collision_bitmap2,0,machine.gfx[1],
0,0,
0,0,
x2,y2,
@@ -452,9 +452,9 @@ static int check_sprite_left_goal_collision(running_machine *machine, int x1, in
}
-static int check_sprite_right_goal_collision(running_machine *machine, int x1, int y1, int code1, int flipy1, int goalpost_only)
+static int check_sprite_right_goal_collision(running_machine &machine, int x1, int y1, int code1, int flipy1, int goalpost_only)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
int collided = 0;
x1 = 240 - x1;
@@ -475,12 +475,12 @@ static int check_sprite_right_goal_collision(running_machine *machine, int x1, i
bitmap_fill(state->sprite_goal_collision_bitmap1, 0, 0);
bitmap_fill(state->sprite_goal_collision_bitmap2, 0, 0);
- drawgfx_opaque(state->sprite_goal_collision_bitmap1,0,machine->gfx[0],
+ drawgfx_opaque(state->sprite_goal_collision_bitmap1,0,machine.gfx[0],
code1,0,
0,flipy1,
x1,y1);
- drawgfxzoom_transpen(state->sprite_goal_collision_bitmap2,0,machine->gfx[1],
+ drawgfxzoom_transpen(state->sprite_goal_collision_bitmap2,0,machine.gfx[1],
0,1,
1,0,
x2,y2,
@@ -512,16 +512,16 @@ static int check_sprite_right_goal_collision(running_machine *machine, int x1, i
/* returns 1 for collision with vertical border,
2 for collision with horizontal border */
-static int check_sprite_border_collision(running_machine *machine, UINT8 x1, UINT8 y1, int code1, int flipy1)
+static int check_sprite_border_collision(running_machine &machine, UINT8 x1, UINT8 y1, int code1, int flipy1)
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
UINT8 x,y;
int collided = 0;
x1 = 240 - x1;
y1 = 240 - y1;
- drawgfx_opaque(state->sprite_border_collision_bitmap,0,machine->gfx[0],
+ drawgfx_opaque(state->sprite_border_collision_bitmap,0,machine.gfx[0],
code1,0,
0,flipy1,
0,0);
@@ -551,7 +551,7 @@ static int check_sprite_border_collision(running_machine *machine, UINT8 x1, UIN
SCREEN_EOF( carpolo )
{
- carpolo_state *state = machine->driver_data<carpolo_state>();
+ carpolo_state *state = machine.driver_data<carpolo_state>();
int col_x, col_y;
int car1_x, car2_x, car3_x, car4_x, ball_x;
int car1_y, car2_y, car3_y, car4_y, ball_y;
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index 19512eccb2d..066343bc20b 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -57,11 +57,11 @@ Note: if MAME_DEBUG is defined, pressing:
#define SWAP(X,Y) { int temp = X; X = Y; Y = temp; }
-static void sprite_init_cave(running_machine *machine);
-static void sprite_draw_cave(running_machine *machine, int priority);
-static void sprite_draw_cave_zbuf(running_machine *machine, int priority);
-static void sprite_draw_donpachi(running_machine *machine, int priority);
-static void sprite_draw_donpachi_zbuf(running_machine *machine, int priority);
+static void sprite_init_cave(running_machine &machine);
+static void sprite_draw_cave(running_machine &machine, int priority);
+static void sprite_draw_cave_zbuf(running_machine &machine, int priority);
+static void sprite_draw_donpachi(running_machine &machine, int priority);
+static void sprite_draw_donpachi_zbuf(running_machine &machine, int priority);
static STATE_POSTLOAD(cave_sprite_postload);
/***************************************************************************
@@ -75,20 +75,20 @@ static STATE_POSTLOAD(cave_sprite_postload);
PALETTE_INIT( cave )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int maxpen = state->paletteram_size / 2;
int pen;
/* create a 1:1 palette map covering everything */
- state->palette_map = auto_alloc_array(machine, UINT16, machine->total_colors());
+ state->palette_map = auto_alloc_array(machine, UINT16, machine.total_colors());
- for (pen = 0; pen < machine->total_colors(); pen++)
+ for (pen = 0; pen < machine.total_colors(); pen++)
state->palette_map[pen] = pen % maxpen;
}
PALETTE_INIT( dfeveron )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
/* Fill the 0-3fff range, used by sprites ($40 color codes * $100 pens)
@@ -105,7 +105,7 @@ PALETTE_INIT( dfeveron )
PALETTE_INIT( ddonpach )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
/* Fill the 8000-83ff range ($40 color codes * $10 pens) for
@@ -122,7 +122,7 @@ PALETTE_INIT( ddonpach )
PALETTE_INIT( mazinger )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
PALETTE_INIT_CALL(cave);
@@ -141,7 +141,7 @@ PALETTE_INIT( mazinger )
PALETTE_INIT( sailormn )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
PALETTE_INIT_CALL(cave);
@@ -160,7 +160,7 @@ PALETTE_INIT( sailormn )
PALETTE_INIT( pwrinst2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
PALETTE_INIT_CALL(cave);
@@ -175,7 +175,7 @@ PALETTE_INIT( pwrinst2 )
PALETTE_INIT( korokoro )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int color, pen;
PALETTE_INIT_CALL(cave);
@@ -186,12 +186,12 @@ PALETTE_INIT( korokoro )
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int pen;
- for (pen = 0; pen < machine->total_colors(); pen++)
+ for (pen = 0; pen < machine.total_colors(); pen++)
{
UINT16 data = state->paletteram[state->palette_map[pen]];
@@ -225,7 +225,7 @@ static void set_pens( running_machine *machine )
***************************************************************************/
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int GFX, UINT16 *VRAM, int TDIM )
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int GFX, UINT16 *VRAM, int TDIM )
{
UINT32 code, color, pri, tile;
@@ -257,9 +257,9 @@ INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int ti
/* Sailormn: the lower 2 Megabytes of tiles banked */
-void sailormn_tilebank_w( running_machine *machine, int bank )
+void sailormn_tilebank_w( running_machine &machine, int bank )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->sailormn_tilebank != bank)
{
state->sailormn_tilebank = bank;
@@ -269,7 +269,7 @@ void sailormn_tilebank_w( running_machine *machine, int bank )
static TILE_GET_INFO( sailormn_get_tile_info_2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
UINT32 code, color, pri;
if (state->tiledim_2)
@@ -337,56 +337,56 @@ INLINE void vram_8x8_w( UINT16 *VRAM, tilemap_t *TILEMAP, ATTR_UNUSED offs_t off
}
-static TILE_GET_INFO( get_tile_info_0 ) { cave_state *state = machine->driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 0, state->vram_0, state->tiledim_0); }
-static TILE_GET_INFO( get_tile_info_1 ) { cave_state *state = machine->driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 1, state->vram_1, state->tiledim_1); }
-static TILE_GET_INFO( get_tile_info_2 ) { cave_state *state = machine->driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 2, state->vram_2, state->tiledim_2); }
-static TILE_GET_INFO( get_tile_info_3 ) { cave_state *state = machine->driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 3, state->vram_3, state->tiledim_3); }
+static TILE_GET_INFO( get_tile_info_0 ) { cave_state *state = machine.driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 0, state->vram_0, state->tiledim_0); }
+static TILE_GET_INFO( get_tile_info_1 ) { cave_state *state = machine.driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 1, state->vram_1, state->tiledim_1); }
+static TILE_GET_INFO( get_tile_info_2 ) { cave_state *state = machine.driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 2, state->vram_2, state->tiledim_2); }
+static TILE_GET_INFO( get_tile_info_3 ) { cave_state *state = machine.driver_data<cave_state>(); get_tile_info(machine, tileinfo, tile_index, 3, state->vram_3, state->tiledim_3); }
WRITE16_HANDLER( cave_vram_0_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_0_8x8_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_8x8_w(state->vram_0, state->tilemap_0, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_1_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_1_8x8_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_8x8_w(state->vram_1, state->tilemap_1, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_2_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_2_8x8_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_8x8_w(state->vram_2, state->tilemap_2, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_3_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
}
WRITE16_HANDLER( cave_vram_3_8x8_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
vram_8x8_w(state->vram_3, state->tilemap_3, offset, data, mem_mask);
}
@@ -400,9 +400,9 @@ WRITE16_HANDLER( cave_vram_3_8x8_w )
***************************************************************************/
-static void cave_vh_start( running_machine *machine, int num )
+static void cave_vh_start( running_machine &machine, int num )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
assert(state->palette_map != NULL);
@@ -468,9 +468,9 @@ static void cave_vh_start( running_machine *machine, int num )
state->row_effect_offs_n = -1;
state->row_effect_offs_f = 1;
- state->background_color = machine->config().m_gfxdecodeinfo[0].color_codes_start +
- (machine->config().m_gfxdecodeinfo[0].total_color_codes - 1) *
- machine->gfx[0]->color_granularity;
+ state->background_color = machine.config().m_gfxdecodeinfo[0].color_codes_start +
+ (machine.config().m_gfxdecodeinfo[0].total_color_codes - 1) *
+ machine.gfx[0]->color_granularity;
switch (state->kludge)
{
@@ -496,7 +496,7 @@ VIDEO_START( cave_4_layers ) { cave_vh_start(machine, 4); }
VIDEO_START( sailormn_3_layers )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
cave_vh_start(machine, 2);
/* Layer 2 (8x8) needs to be handled differently */
@@ -539,12 +539,12 @@ VIDEO_START( sailormn_3_layers )
***************************************************************************/
-static void get_sprite_info_cave( running_machine *machine )
+static void get_sprite_info_cave( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine->region("sprites")->base();
- int code_max = machine->region("sprites")->bytes() / (16*16);
+ const UINT8 *base_gfx = machine.region("sprites")->base();
+ int code_max = machine.region("sprites")->bytes() / (16*16);
UINT16 *source;
UINT16 *finish;
@@ -553,8 +553,8 @@ static void get_sprite_info_cave( running_machine *machine )
int glob_flipx = state->videoregs[0] & 0x8000;
int glob_flipy = state->videoregs[1] & 0x8000;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
source = state->spriteram + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
@@ -668,12 +668,12 @@ static void get_sprite_info_cave( running_machine *machine )
state->num_sprites = sprite - state->sprite;
}
-static void get_sprite_info_donpachi( running_machine *machine )
+static void get_sprite_info_donpachi( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
pen_t base_pal = 0;
- const UINT8 *base_gfx = machine->region("sprites")->base();
- int code_max = machine->region("sprites")->bytes() / (16*16);
+ const UINT8 *base_gfx = machine.region("sprites")->base();
+ int code_max = machine.region("sprites")->bytes() / (16*16);
UINT16 *source;
UINT16 *finish;
@@ -683,8 +683,8 @@ static void get_sprite_info_donpachi( running_machine *machine )
int glob_flipx = state->videoregs[0] & 0x8000;
int glob_flipy = state->videoregs[1] & 0x8000;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
source = state->spriteram + ((state->spriteram_size / 2) / 2) * state->spriteram_bank;
@@ -755,11 +755,11 @@ static void get_sprite_info_donpachi( running_machine *machine )
}
-static void sprite_init_cave( running_machine *machine )
+static void sprite_init_cave( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
- int screen_width = machine->primary_screen->width();
- int screen_height = machine->primary_screen->height();
+ cave_state *state = machine.driver_data<cave_state>();
+ int screen_width = machine.primary_screen->width();
+ int screen_height = machine.primary_screen->height();
if (state->spritetype[0] == 0 || state->spritetype[0] == 2) // most of the games
{
@@ -794,12 +794,12 @@ static void sprite_init_cave( running_machine *machine )
state->save_item(NAME(state->blit.clip_top));
state->save_item(NAME(state->blit.clip_bottom));
- machine->state().register_postload(cave_sprite_postload, NULL);
+ machine.state().register_postload(cave_sprite_postload, NULL);
}
static void cave_sprite_check( screen_device &screen, const rectangle *clip )
{
- cave_state *state = screen.machine->driver_data<cave_state>();
+ cave_state *state = screen.machine().driver_data<cave_state>();
{ /* set clip */
int left = clip->min_x;
@@ -875,10 +875,10 @@ static void cave_sprite_check( screen_device &screen, const rectangle *clip )
}
}
-static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_cave *sprite )
+static void do_blit_zoom16_cave( running_machine &machine, const struct sprite_cave *sprite )
{
/* assumes SPRITE_LIST_RAW_DATA flag is set */
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int x1, x2, y1, y2, dx, dy;
int xcount0 = 0x10000 + sprite->xcount0, ycount0 = 0x10000 + sprite->ycount0;
@@ -1008,10 +1008,10 @@ static void do_blit_zoom16_cave( running_machine *machine, const struct sprite_c
}
-static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprite_cave *sprite )
+static void do_blit_zoom16_cave_zb( running_machine &machine, const struct sprite_cave *sprite )
{
/* assumes SPRITE_LIST_RAW_DATA flag is set */
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int x1, x2, y1, y2, dx, dy;
int xcount0 = 0x10000 + sprite->xcount0, ycount0 = 0x10000 + sprite->ycount0;
@@ -1144,10 +1144,10 @@ static void do_blit_zoom16_cave_zb( running_machine *machine, const struct sprit
}
}
-static void do_blit_16_cave( running_machine *machine, const struct sprite_cave *sprite )
+static void do_blit_16_cave( running_machine &machine, const struct sprite_cave *sprite )
{
/* assumes SPRITE_LIST_RAW_DATA flag is set */
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int x1, x2, y1, y2, dx, dy;
int xcount0 = 0, ycount0 = 0;
@@ -1240,10 +1240,10 @@ static void do_blit_16_cave( running_machine *machine, const struct sprite_cave
}
-static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_cave *sprite )
+static void do_blit_16_cave_zb( running_machine &machine, const struct sprite_cave *sprite )
{
/* assumes SPRITE_LIST_RAW_DATA flag is set */
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int x1, x2, y1, y2, dx, dy;
int xcount0 = 0, ycount0 = 0;
@@ -1344,9 +1344,9 @@ static void do_blit_16_cave_zb( running_machine *machine, const struct sprite_c
}
-static void sprite_draw_cave( running_machine *machine, int priority )
+static void sprite_draw_cave( running_machine &machine, int priority )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int i = 0;
while (state->sprite_table[priority][i])
{
@@ -1358,9 +1358,9 @@ static void sprite_draw_cave( running_machine *machine, int priority )
}
}
-static void sprite_draw_cave_zbuf( running_machine *machine, int priority )
+static void sprite_draw_cave_zbuf( running_machine &machine, int priority )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int i = 0;
while (state->sprite_table[priority][i])
{
@@ -1372,17 +1372,17 @@ static void sprite_draw_cave_zbuf( running_machine *machine, int priority )
}
}
-static void sprite_draw_donpachi( running_machine *machine, int priority )
+static void sprite_draw_donpachi( running_machine &machine, int priority )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int i = 0;
while (state->sprite_table[priority][i])
do_blit_16_cave(machine, state->sprite_table[priority][i++]);
}
-static void sprite_draw_donpachi_zbuf( running_machine *machine, int priority )
+static void sprite_draw_donpachi_zbuf( running_machine &machine, int priority )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int i = 0;
while (state->sprite_table[priority][i])
do_blit_16_cave_zb(machine, state->sprite_table[priority][i++]);
@@ -1446,11 +1446,11 @@ static void sprite_draw_donpachi_zbuf( running_machine *machine, int priority )
***************************************************************************/
INLINE void cave_tilemap_draw(
- running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+ running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
tilemap_t *TILEMAP, UINT16 *VRAM, UINT16 *VCTRL,
UINT32 flags, UINT32 priority, UINT32 priority2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
int sx, sy, flipx, flipy, offs_x, offs_y, offs_row;
/* Bail out if ... */
@@ -1565,38 +1565,38 @@ INLINE void cave_tilemap_draw(
}
}
-static void cave_tilemap_0_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
+static void cave_tilemap_0_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_0, state->vram_0, state->vctrl_0, flags, priority, priority2);
}
-static void cave_tilemap_1_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
+static void cave_tilemap_1_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_1, state->vram_1, state->vctrl_1, flags, priority, priority2);
}
-static void cave_tilemap_2_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
+static void cave_tilemap_2_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_2, state->vram_2, state->vctrl_2, flags, priority, priority2);
}
-static void cave_tilemap_3_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
+static void cave_tilemap_3_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 priority, UINT32 priority2 )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
cave_tilemap_draw(machine, bitmap, cliprect, state->tilemap_3, state->vram_3, state->vctrl_3, flags, priority, priority2);
}
SCREEN_UPDATE( cave )
{
- cave_state *state = screen->machine->driver_data<cave_state>();
+ cave_state *state = screen->machine().driver_data<cave_state>();
int pri, pri2;
int layers_ctrl = -1;
- set_pens(screen->machine);
+ set_pens(screen->machine());
state->blit.baseaddr = (UINT8 *)bitmap->base;
state->blit.line_offset = bitmap->rowpixels * bitmap->bpp / 8;
@@ -1637,22 +1637,22 @@ SCREEN_UPDATE( cave )
#ifdef MAME_DEBUG
{
- if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) || input_code_pressed(screen->machine, KEYCODE_C) ||
- input_code_pressed(screen->machine, KEYCODE_V) || input_code_pressed(screen->machine, KEYCODE_B) )
+ if ( input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X) || input_code_pressed(screen->machine(), KEYCODE_C) ||
+ input_code_pressed(screen->machine(), KEYCODE_V) || input_code_pressed(screen->machine(), KEYCODE_B) )
{
int msk = 0, val = 0;
- if (input_code_pressed(screen->machine, KEYCODE_X)) val = 1; // priority 0 only
- if (input_code_pressed(screen->machine, KEYCODE_C)) val = 2; // "" 1
- if (input_code_pressed(screen->machine, KEYCODE_V)) val = 4; // "" 2
- if (input_code_pressed(screen->machine, KEYCODE_B)) val = 8; // "" 3
- if (input_code_pressed(screen->machine, KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities
-
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= val << 0; // for layer 0
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= val << 4; // for layer 1
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= val << 8; // for layer 2
- if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= val << 12; // for layer 3
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= val << 16; // for sprites
+ if (input_code_pressed(screen->machine(), KEYCODE_X)) val = 1; // priority 0 only
+ if (input_code_pressed(screen->machine(), KEYCODE_C)) val = 2; // "" 1
+ if (input_code_pressed(screen->machine(), KEYCODE_V)) val = 4; // "" 2
+ if (input_code_pressed(screen->machine(), KEYCODE_B)) val = 8; // "" 3
+ if (input_code_pressed(screen->machine(), KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities
+
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= val << 0; // for layer 0
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= val << 4; // for layer 1
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= val << 8; // for layer 2
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) msk |= val << 12; // for layer 3
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= val << 16; // for sprites
if (msk != 0) layers_ctrl &= msk;
#if 1
@@ -1720,14 +1720,14 @@ SCREEN_UPDATE( cave )
*/
for (pri = 0; pri <= 3; pri++) // tile / sprite priority
{
- if (layers_ctrl & (1 << (pri + 16))) (*state->sprite_draw)(screen->machine, pri);
+ if (layers_ctrl & (1 << (pri + 16))) (*state->sprite_draw)(screen->machine(), pri);
for (pri2 = 0; pri2 <= 3; pri2++) // priority of the whole layer
{
- if (layers_ctrl & (1 << (pri + 0))) cave_tilemap_0_draw(screen->machine, bitmap, cliprect, pri, 0, pri2);
- if (layers_ctrl & (1 << (pri + 4))) cave_tilemap_1_draw(screen->machine, bitmap, cliprect, pri, 0, pri2);
- if (layers_ctrl & (1 << (pri + 8))) cave_tilemap_2_draw(screen->machine, bitmap, cliprect, pri, 0, pri2);
- if (layers_ctrl & (1 << (pri + 12))) cave_tilemap_3_draw(screen->machine, bitmap, cliprect, pri, 0, pri2);
+ if (layers_ctrl & (1 << (pri + 0))) cave_tilemap_0_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2);
+ if (layers_ctrl & (1 << (pri + 4))) cave_tilemap_1_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2);
+ if (layers_ctrl & (1 << (pri + 8))) cave_tilemap_2_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2);
+ if (layers_ctrl & (1 << (pri + 12))) cave_tilemap_3_draw(screen->machine(), bitmap, cliprect, pri, 0, pri2);
}
}
return 0;
@@ -1737,12 +1737,12 @@ SCREEN_UPDATE( cave )
/**************************************************************/
-void cave_get_sprite_info( running_machine *machine )
+void cave_get_sprite_info( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->kludge == 3) /* mazinger metmqstr */
{
- if (machine->video().skip_this_frame() == 0)
+ if (machine.video().skip_this_frame() == 0)
{
state->spriteram_bank = state->spriteram_bank_delay;
(*state->get_sprite_info)(machine);
@@ -1751,7 +1751,7 @@ void cave_get_sprite_info( running_machine *machine )
}
else
{
- if (machine->video().skip_this_frame() == 0)
+ if (machine.video().skip_this_frame() == 0)
{
state->spriteram_bank = state->videoregs[4] & 1;
(*state->get_sprite_info)(machine);
diff --git a/src/mame/video/cbasebal.c b/src/mame/video/cbasebal.c
index b6fc11d1561..3ceedd57395 100644
--- a/src/mame/video/cbasebal.c
+++ b/src/mame/video/cbasebal.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
UINT8 attr = state->scrollram[2 * tile_index + 1];
SET_TILE_INFO(
1,
@@ -21,7 +21,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
UINT8 attr = state->textram[tile_index + 0x800];
SET_TILE_INFO(
0,
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( cbasebal )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
state->textram = auto_alloc_array(machine, UINT8, 0x1000);
state->scrollram = auto_alloc_array(machine, UINT8, 0x1000);
@@ -64,7 +64,7 @@ VIDEO_START( cbasebal )
WRITE8_HANDLER( cbasebal_textram_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x7ff);
@@ -72,13 +72,13 @@ WRITE8_HANDLER( cbasebal_textram_w )
READ8_HANDLER( cbasebal_textram_r )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
return state->textram[offset];
}
WRITE8_HANDLER( cbasebal_scrollram_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
state->scrollram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -86,19 +86,19 @@ WRITE8_HANDLER( cbasebal_scrollram_w )
READ8_HANDLER( cbasebal_scrollram_r )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
return state->scrollram[offset];
}
WRITE8_HANDLER( cbasebal_gfxctrl_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
/* bit 0 is unknown - toggles continuously */
/* bit 1 is flip screen */
state->flipscreen = data & 0x02;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* bit 2 is unknown - unused? */
@@ -124,14 +124,14 @@ WRITE8_HANDLER( cbasebal_gfxctrl_w )
WRITE8_HANDLER( cbasebal_scrollx_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
state->scroll_x[offset] = data;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x[0] + 256 * state->scroll_x[1]);
}
WRITE8_HANDLER( cbasebal_scrolly_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
state->scroll_y[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y[0] + 256 * state->scroll_y[1]);
}
@@ -144,9 +144,9 @@ WRITE8_HANDLER( cbasebal_scrolly_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
UINT8 *spriteram = state->spriteram;
int offs, sx, sy;
@@ -170,7 +170,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx = !flipx;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,state->flipscreen,
@@ -180,7 +180,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( cbasebal )
{
- cbasebal_state *state = screen->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = screen->machine().driver_data<cbasebal_state>();
if (state->bg_on)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -188,7 +188,7 @@ SCREEN_UPDATE( cbasebal )
bitmap_fill(bitmap, cliprect, 768);
if (state->obj_on)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (state->text_on)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/cbuster.c b/src/mame/video/cbuster.c
index 42af76303d6..c583d991565 100644
--- a/src/mame/video/cbuster.c
+++ b/src/mame/video/cbuster.c
@@ -13,27 +13,27 @@
/* maybe the game should just use generic palette handling, and have a darker palette by design... */
-static void update_24bitcol( running_machine *machine, int offset )
+static void update_24bitcol( running_machine &machine, int offset )
{
UINT8 r, g, b; /* The highest palette value seems to be 0x8e */
- r = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 0) & 0xff) * 1.75);
- g = (UINT8)((float)((machine->generic.paletteram.u16[offset] >> 8) & 0xff) * 1.75);
- b = (UINT8)((float)((machine->generic.paletteram2.u16[offset] >> 0) & 0xff) * 1.75);
+ r = (UINT8)((float)((machine.generic.paletteram.u16[offset] >> 0) & 0xff) * 1.75);
+ g = (UINT8)((float)((machine.generic.paletteram.u16[offset] >> 8) & 0xff) * 1.75);
+ b = (UINT8)((float)((machine.generic.paletteram2.u16[offset] >> 0) & 0xff) * 1.75);
palette_set_color(machine, offset, MAKE_RGB(r, g, b));
}
WRITE16_HANDLER( twocrude_palette_24bit_rg_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
WRITE16_HANDLER( twocrude_palette_24bit_b_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
@@ -44,17 +44,17 @@ WRITE16_HANDLER( twocrude_palette_24bit_b_w )
VIDEO_START( twocrude )
{
- machine->device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
}
SCREEN_UPDATE( twocrude )
{
- cbuster_state *state = screen->machine->driver_data<cbuster_state>();
+ cbuster_state *state = screen->machine().driver_data<cbuster_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, !BIT(flip, 7));
+ flip_screen_set(screen->machine(), !BIT(flip, 7));
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffer, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16_buffer, 0x400);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
@@ -62,8 +62,8 @@ SCREEN_UPDATE( twocrude )
/* Draw playfields & sprites */
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0900, 0x100, 0x0ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0900, 0x0900, 0x500, 0x0ff);
if (state->pri)
{
@@ -76,8 +76,8 @@ SCREEN_UPDATE( twocrude )
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
}
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0900, 0x100, 0x0ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0100, 0x0900, 0x500, 0x0ff);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/ccastles.c b/src/mame/video/ccastles.c
index 8ac0ccad4c3..3418133618c 100644
--- a/src/mame/video/ccastles.c
+++ b/src/mame/video/ccastles.c
@@ -17,13 +17,13 @@
VIDEO_START( ccastles )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
static const int resistances[3] = { 22000, 10000, 4700 };
/* get pointers to our PROMs */
- state->syncprom = machine->region("proms")->base() + 0x000;
- state->wpprom = machine->region("proms")->base() + 0x200;
- state->priprom = machine->region("proms")->base() + 0x300;
+ state->syncprom = machine.region("proms")->base() + 0x000;
+ state->wpprom = machine.region("proms")->base() + 0x200;
+ state->priprom = machine.region("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
@@ -32,7 +32,7 @@ VIDEO_START( ccastles )
3, resistances, state->bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- state->spritebitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->spritebitmap = machine.primary_screen->alloc_compatible_bitmap();
/* register for savestates */
state->save_item(NAME(state->video_control));
@@ -51,22 +51,22 @@ VIDEO_START( ccastles )
WRITE8_HANDLER( ccastles_hscroll_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->hscroll = data;
}
WRITE8_HANDLER( ccastles_vscroll_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->vscroll = data;
}
WRITE8_HANDLER( ccastles_video_control_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
/* only D3 matters */
state->video_control[offset] = (data >> 3) & 1;
}
@@ -81,7 +81,7 @@ WRITE8_HANDLER( ccastles_video_control_w )
WRITE8_HANDLER( ccastles_paletteram_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
int bit0, bit1, bit2;
int r, g, b;
@@ -108,7 +108,7 @@ WRITE8_HANDLER( ccastles_paletteram_w )
bit2 = (~b >> 2) & 0x01;
b = combine_3_weights(state->bweights, bit0, bit1, bit2);
- palette_set_color(space->machine, offset & 0x1f, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset & 0x1f, MAKE_RGB(r, g, b));
}
@@ -120,9 +120,9 @@ WRITE8_HANDLER( ccastles_paletteram_w )
*
*************************************/
-INLINE void ccastles_write_vram( running_machine *machine, UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba )
+INLINE void ccastles_write_vram( running_machine &machine, UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
UINT8 *dest = &state->videoram[addr & 0x7ffe];
UINT8 promaddr = 0;
UINT8 wpbits;
@@ -167,9 +167,9 @@ INLINE void ccastles_write_vram( running_machine *machine, UINT16 addr, UINT8 da
*
*************************************/
-INLINE void bitmode_autoinc( running_machine *machine )
+INLINE void bitmode_autoinc( running_machine &machine )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
/* auto increment in the x-direction if it's enabled */
if (!state->video_control[0]) /* /AX */
@@ -201,7 +201,7 @@ INLINE void bitmode_autoinc( running_machine *machine )
WRITE8_HANDLER( ccastles_videoram_w )
{
/* direct writes to VRAM go through the write protect PROM as well */
- ccastles_write_vram(space->machine, offset, data, 0, 0);
+ ccastles_write_vram(space->machine(), offset, data, 0, 0);
}
@@ -214,7 +214,7 @@ WRITE8_HANDLER( ccastles_videoram_w )
READ8_HANDLER( ccastles_bitmode_r )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
/* in bitmode, the address comes from the autoincrement latches */
UINT16 addr = (state->bitmode_addr[1] << 7) | (state->bitmode_addr[0] >> 1);
@@ -223,7 +223,7 @@ READ8_HANDLER( ccastles_bitmode_r )
UINT8 result = state->videoram[addr] << ((~state->bitmode_addr[0] & 1) * 4);
/* autoincrement because /BITMD was selected */
- bitmode_autoinc(space->machine);
+ bitmode_autoinc(space->machine());
/* the low 4 bits of the data lines are not driven so make them all 1's */
return result | 0x0f;
@@ -232,7 +232,7 @@ READ8_HANDLER( ccastles_bitmode_r )
WRITE8_HANDLER( ccastles_bitmode_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
/* in bitmode, the address comes from the autoincrement latches */
UINT16 addr = (state->bitmode_addr[1] << 7) | (state->bitmode_addr[0] >> 1);
@@ -241,19 +241,19 @@ WRITE8_HANDLER( ccastles_bitmode_w )
data = (data & 0xf0) | (data >> 4);
/* write through the generic VRAM routine, passing the low 2 X bits as PIXB/PIXA */
- ccastles_write_vram(space->machine, addr, data, 1, state->bitmode_addr[0] & 3);
+ ccastles_write_vram(space->machine(), addr, data, 1, state->bitmode_addr[0] & 3);
/* autoincrement because /BITMD was selected */
- bitmode_autoinc(space->machine);
+ bitmode_autoinc(space->machine());
}
WRITE8_HANDLER( ccastles_bitmode_addr_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
/* write through to video RAM and also to the addressing latches */
- ccastles_write_vram(space->machine, offset, data, 0, 0);
+ ccastles_write_vram(space->machine(), offset, data, 0, 0);
state->bitmode_addr[offset] = data;
}
@@ -267,10 +267,10 @@ WRITE8_HANDLER( ccastles_bitmode_addr_w )
SCREEN_UPDATE( ccastles )
{
- ccastles_state *state = screen->machine->driver_data<ccastles_state>();
+ ccastles_state *state = screen->machine().driver_data<ccastles_state>();
UINT8 *spriteaddr = &state->spriteram[state->video_control[7] * 0x100]; /* BUF1/BUF2 */
int flip = state->video_control[4] ? 0xff : 0x00; /* PLAYER2 */
- pen_t black = get_black_pen(screen->machine);
+ pen_t black = get_black_pen(screen->machine());
int x, y, offs;
/* draw the sprites */
@@ -282,7 +282,7 @@ SCREEN_UPDATE( ccastles )
int which = spriteaddr[offs];
int color = spriteaddr[offs + 2] >> 7;
- drawgfx_transpen(state->spritebitmap, cliprect, screen->machine->gfx[0], which, color, flip, flip, x, y, 7);
+ drawgfx_transpen(state->spritebitmap, cliprect, screen->machine().gfx[0], which, color, flip, flip, x, y, 7);
}
/* draw the bitmap to the screen, looping over Y */
diff --git a/src/mame/video/cchasm.c b/src/mame/video/cchasm.c
index 7763c118379..7cf7ee267ca 100644
--- a/src/mame/video/cchasm.c
+++ b/src/mame/video/cchasm.c
@@ -24,9 +24,9 @@ static TIMER_CALLBACK( cchasm_refresh_end )
cputag_set_input_line (machine, "maincpu", 2, ASSERT_LINE);
}
-static void cchasm_refresh (running_machine *machine)
+static void cchasm_refresh (running_machine &machine)
{
- cchasm_state *state = machine->driver_data<cchasm_state>();
+ cchasm_state *state = machine.driver_data<cchasm_state>();
int pc = 0;
int done = 0;
@@ -99,7 +99,7 @@ static void cchasm_refresh (running_machine *machine)
}
}
/* Refresh processor runs with 6 MHz */
- machine->scheduler().timer_set (attotime::from_hz(6000000) * total_length, FUNC(cchasm_refresh_end));
+ machine.scheduler().timer_set (attotime::from_hz(6000000) * total_length, FUNC(cchasm_refresh_end));
}
@@ -110,10 +110,10 @@ WRITE16_HANDLER( cchasm_refresh_control_w )
switch (data >> 8)
{
case 0x37:
- cchasm_refresh(space->machine);
+ cchasm_refresh(space->machine());
break;
case 0xf7:
- cputag_set_input_line (space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line (space->machine(), "maincpu", 2, CLEAR_LINE);
break;
}
}
@@ -121,8 +121,8 @@ WRITE16_HANDLER( cchasm_refresh_control_w )
VIDEO_START( cchasm )
{
- cchasm_state *state = machine->driver_data<cchasm_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ cchasm_state *state = machine.driver_data<cchasm_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
state->xcenter=((visarea.max_x + visarea.min_x)/2) << 16;
state->ycenter=((visarea.max_y + visarea.min_y)/2) << 16;
diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c
index b9929ec61af..2df78b32518 100644
--- a/src/mame/video/cclimber.c
+++ b/src/mame/video/cclimber.c
@@ -49,7 +49,7 @@ PALETTE_INIT( cclimber )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -296,9 +296,9 @@ PALETTE_INIT( toprollr )
***************************************************************************/
-static void swimmer_set_background_pen(running_machine *machine)
+static void swimmer_set_background_pen(running_machine &machine)
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int bit0, bit1, bit2;
int r, g, b;
@@ -327,7 +327,7 @@ static void swimmer_set_background_pen(running_machine *machine)
WRITE8_HANDLER( cclimber_colorram_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
/* A5 is not connected, there is only 0x200 bytes of RAM */
state->colorram[offset & ~0x20] = data;
state->colorram[offset | 0x20] = data;
@@ -336,7 +336,7 @@ WRITE8_HANDLER( cclimber_colorram_w )
WRITE8_HANDLER( cannonb_flip_screen_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->flip_screen[0] = data;
state->flip_screen[1] = data;
}
@@ -344,7 +344,7 @@ WRITE8_HANDLER( cannonb_flip_screen_w )
static TILE_GET_INFO( cclimber_get_pf_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code, color;
int flags = TILE_FLIPYX(state->colorram[tile_index] >> 6);
@@ -365,7 +365,7 @@ static TILE_GET_INFO( cclimber_get_pf_tile_info )
static TILE_GET_INFO( swimmer_get_pf_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code, color;
int flags = TILE_FLIPYX(state->colorram[tile_index] >> 6);
@@ -383,7 +383,7 @@ static TILE_GET_INFO( swimmer_get_pf_tile_info )
static TILE_GET_INFO( toprollr_get_pf_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code, attr, color;
attr = tile_index & 0x10 ? state->colorram[tile_index & ~0x20] : state->colorram[tile_index];
@@ -396,7 +396,7 @@ static TILE_GET_INFO( toprollr_get_pf_tile_info )
static TILE_GET_INFO( cclimber_get_bs_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code, color;
/* only the lower right is visible */
@@ -414,7 +414,7 @@ static TILE_GET_INFO( cclimber_get_bs_tile_info )
static TILE_GET_INFO( toprollr_get_bs_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code, color;
/* only the lower right is visible */
@@ -432,7 +432,7 @@ static TILE_GET_INFO( toprollr_get_bs_tile_info )
static TILE_GET_INFO( toproller_get_bg_tile_info )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int code = ((state->toprollr_bg_coloram[tile_index] & 0x40) << 2) | state->toprollr_bg_videoram[tile_index];
int color = state->toprollr_bg_coloram[tile_index] & 0x0f;
@@ -442,7 +442,7 @@ static TILE_GET_INFO( toproller_get_bg_tile_info )
VIDEO_START( cclimber )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
state->pf_tilemap = tilemap_create(machine, cclimber_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->pf_tilemap, 0);
tilemap_set_scroll_cols(state->pf_tilemap, 32);
@@ -457,7 +457,7 @@ VIDEO_START( cclimber )
VIDEO_START( swimmer )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
state->pf_tilemap = tilemap_create(machine, swimmer_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->pf_tilemap, 0);
tilemap_set_scroll_cols(state->pf_tilemap, 32);
@@ -472,7 +472,7 @@ VIDEO_START( swimmer )
VIDEO_START( toprollr )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
state->pf_tilemap = tilemap_create(machine, toprollr_get_pf_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->pf_tilemap, 0);
@@ -487,9 +487,9 @@ VIDEO_START( toprollr )
}
-static void draw_playfield(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_playfield(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
int i;
tilemap_mark_all_tiles_dirty(state->pf_tilemap);
@@ -502,9 +502,9 @@ static void draw_playfield(running_machine *machine, bitmap_t *bitmap, const rec
}
-static void cclimber_draw_bigsprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void cclimber_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
UINT8 x = state->bigsprite_control[3] - 8;
UINT8 y = state->bigsprite_control[2];
int bigsprite_flip_x = (state->bigsprite_control[1] & 0x10) >> 4;
@@ -528,9 +528,9 @@ static void cclimber_draw_bigsprite(running_machine *machine, bitmap_t *bitmap,
}
-static void toprollr_draw_bigsprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void toprollr_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
UINT8 x = state->bigsprite_control[3] - 8;
UINT8 y = state->bigsprite_control[2];
@@ -547,7 +547,7 @@ static void toprollr_draw_bigsprite(running_machine *machine, bitmap_t *bitmap,
static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
{
- cclimber_state *state = gfx->machine->driver_data<cclimber_state>();
+ cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
@@ -588,7 +588,7 @@ static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, c
static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
{
- cclimber_state *state = gfx->machine->driver_data<cclimber_state>();
+ cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
@@ -626,7 +626,7 @@ static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, c
static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
{
- cclimber_state *state = gfx->machine->driver_data<cclimber_state>();
+ cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
@@ -664,22 +664,22 @@ static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, co
SCREEN_UPDATE( cclimber )
{
- cclimber_state *state = screen->machine->driver_data<cclimber_state>();
+ cclimber_state *state = screen->machine().driver_data<cclimber_state>();
bitmap_fill(bitmap, cliprect, CCLIMBER_BG_PEN);
- draw_playfield(screen->machine, bitmap, cliprect);
+ draw_playfield(screen->machine(), bitmap, cliprect);
/* draw the "big sprite" under the regular sprites */
if ((state->bigsprite_control[0] & 0x01))
{
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
- cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
+ cclimber_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
}
/* draw the "big sprite" over the regular sprites */
else
{
- cclimber_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
+ cclimber_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
}
return 0;
@@ -688,9 +688,9 @@ SCREEN_UPDATE( cclimber )
SCREEN_UPDATE( yamato )
{
- cclimber_state *state = screen->machine->driver_data<cclimber_state>();
+ cclimber_state *state = screen->machine().driver_data<cclimber_state>();
int i;
- UINT8 *sky_rom = screen->machine->region("user1")->base() + 0x1200;
+ UINT8 *sky_rom = screen->machine().region("user1")->base() + 0x1200;
for (i = 0; i < 0x100; i++)
{
@@ -701,20 +701,20 @@ SCREEN_UPDATE( yamato )
*BITMAP_ADDR16(bitmap, j, (i - 8) & 0xff) = pen;
}
- draw_playfield(screen->machine, bitmap, cliprect);
+ draw_playfield(screen->machine(), bitmap, cliprect);
/* draw the "big sprite" under the regular sprites */
if ((state->bigsprite_control[0] & 0x01))
{
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
- toprollr_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
+ toprollr_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
}
/* draw the "big sprite" over the regular sprites */
else
{
- toprollr_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
+ toprollr_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
}
return 0;
@@ -723,8 +723,8 @@ SCREEN_UPDATE( yamato )
SCREEN_UPDATE( swimmer )
{
- cclimber_state *state = screen->machine->driver_data<cclimber_state>();
- swimmer_set_background_pen(screen->machine);
+ cclimber_state *state = screen->machine().driver_data<cclimber_state>();
+ swimmer_set_background_pen(screen->machine());
if (*state->swimmer_side_background_enabled & 0x01)
{
@@ -754,20 +754,20 @@ SCREEN_UPDATE( swimmer )
else
bitmap_fill(bitmap, cliprect, CCLIMBER_BG_PEN);
- draw_playfield(screen->machine, bitmap, cliprect);
+ draw_playfield(screen->machine(), bitmap, cliprect);
/* draw the "big sprite" under the regular sprites */
if ((state->bigsprite_control[0] & 0x01))
{
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
- swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
+ swimmer_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
}
/* draw the "big sprite" over the regular sprites */
else
{
- swimmer_draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
- cclimber_draw_bigsprite(screen->machine, bitmap, cliprect);
+ swimmer_draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
+ cclimber_draw_bigsprite(screen->machine(), bitmap, cliprect);
}
return 0;
@@ -776,7 +776,7 @@ SCREEN_UPDATE( swimmer )
SCREEN_UPDATE( toprollr )
{
- cclimber_state *state = screen->machine->driver_data<cclimber_state>();
+ cclimber_state *state = screen->machine().driver_data<cclimber_state>();
rectangle scroll_area_clip = *cliprect;
scroll_area_clip.min_x = 4*8;
scroll_area_clip.max_x = 29*8-1;
@@ -792,15 +792,15 @@ SCREEN_UPDATE( toprollr )
/* draw the "big sprite" over the regular sprites */
if ((state->bigsprite_control[1] & 0x20))
{
- toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1]);
- toprollr_draw_bigsprite(screen->machine, bitmap, &scroll_area_clip);
+ toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine().gfx[1]);
+ toprollr_draw_bigsprite(screen->machine(), bitmap, &scroll_area_clip);
}
/* draw the "big sprite" under the regular sprites */
else
{
- toprollr_draw_bigsprite(screen->machine, bitmap, &scroll_area_clip);
- toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine->gfx[1]);
+ toprollr_draw_bigsprite(screen->machine(), bitmap, &scroll_area_clip);
+ toprollr_draw_sprites(bitmap, &scroll_area_clip, screen->machine().gfx[1]);
}
tilemap_mark_all_tiles_dirty(state->pf_tilemap);
diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c
index db193a7bcab..207fdc3c014 100644
--- a/src/mame/video/centiped.c
+++ b/src/mame/video/centiped.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( centiped_get_tile_info )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index];
@@ -26,7 +26,7 @@ static TILE_GET_INFO( centiped_get_tile_info )
static TILE_GET_INFO( warlords_get_tile_info )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index];
int color = ((tile_index & 0x10) >> 4) | ((tile_index & 0x200) >> 8) | (state->flipscreen >> 5);
@@ -37,7 +37,7 @@ static TILE_GET_INFO( warlords_get_tile_info )
static TILE_GET_INFO( milliped_get_tile_info )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index];
int bank = (data >> 6) & 1;
@@ -51,7 +51,7 @@ static TILE_GET_INFO( milliped_get_tile_info )
static TILE_GET_INFO( bullsdrt_get_tile_info )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index];
int bank = state->bullsdrt_tiles_bankram[tile_index & 0x1f] & 0x0f;
@@ -67,9 +67,9 @@ static TILE_GET_INFO( bullsdrt_get_tile_info )
*
*************************************/
-static void init_penmask(running_machine *machine)
+static void init_penmask(running_machine &machine)
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
int i;
for (i = 0; i < 64; i++)
@@ -92,7 +92,7 @@ static void init_penmask(running_machine *machine)
VIDEO_START( centiped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->bg_tilemap = tilemap_create(machine, centiped_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
init_penmask(machine);
@@ -106,7 +106,7 @@ VIDEO_START( centiped )
VIDEO_START( warlords )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->bg_tilemap = tilemap_create(machine, warlords_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -116,7 +116,7 @@ VIDEO_START( warlords )
VIDEO_START( milliped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->bg_tilemap = tilemap_create(machine, milliped_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -130,7 +130,7 @@ VIDEO_START( milliped )
VIDEO_START( bullsdrt )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->bg_tilemap = tilemap_create(machine, bullsdrt_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -149,7 +149,7 @@ VIDEO_START( bullsdrt )
WRITE8_HANDLER( centiped_videoram_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -166,7 +166,7 @@ WRITE8_HANDLER( centiped_videoram_w )
WRITE8_HANDLER( centiped_flip_screen_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->flipscreen = data >> 7;
}
@@ -181,7 +181,7 @@ WRITE8_HANDLER( centiped_flip_screen_w )
WRITE8_HANDLER( bullsdrt_tilesbank_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->bullsdrt_tiles_bankram[offset] = data;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -197,7 +197,7 @@ WRITE8_HANDLER( bullsdrt_tilesbank_w )
WRITE8_HANDLER( bullsdrt_sprites_bank_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->bullsdrt_sprites_bank = data;
}
@@ -229,7 +229,7 @@ WRITE8_HANDLER( bullsdrt_sprites_bank_w )
WRITE8_HANDLER( centiped_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
/* bit 2 of the output palette RAM is always pulled high, so we ignore */
/* any palette changes unless the write is to a palette RAM address */
@@ -254,7 +254,7 @@ WRITE8_HANDLER( centiped_paletteram_w )
/* character colors, set directly */
if ((offset & 0x08) == 0)
- palette_set_color(space->machine, offset & 0x03, color);
+ palette_set_color(space->machine(), offset & 0x03, color);
/* sprite colors - set all the applicable ones */
else
@@ -266,13 +266,13 @@ WRITE8_HANDLER( centiped_paletteram_w )
for (i = 0; i < 0x100; i += 4)
{
if (offset == ((i >> 2) & 0x03))
- palette_set_color(space->machine, i + 4 + 1, color);
+ palette_set_color(space->machine(), i + 4 + 1, color);
if (offset == ((i >> 4) & 0x03))
- palette_set_color(space->machine, i + 4 + 2, color);
+ palette_set_color(space->machine(), i + 4 + 2, color);
if (offset == ((i >> 6) & 0x03))
- palette_set_color(space->machine, i + 4 + 3, color);
+ palette_set_color(space->machine(), i + 4 + 3, color);
}
}
}
@@ -296,7 +296,7 @@ PALETTE_INIT( warlords )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen;
int r, g, b;
@@ -351,7 +351,7 @@ PALETTE_INIT( warlords )
***************************************************************************/
-static void melliped_mazeinv_set_color(running_machine *machine, offs_t offset, UINT8 data)
+static void melliped_mazeinv_set_color(running_machine &machine, offs_t offset, UINT8 data)
{
rgb_t color;
int bit0, bit1, bit2;
@@ -407,18 +407,18 @@ static void melliped_mazeinv_set_color(running_machine *machine, offs_t offset,
WRITE8_HANDLER( milliped_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
- melliped_mazeinv_set_color(space->machine, offset, data);
+ melliped_mazeinv_set_color(space->machine(), offset, data);
}
WRITE8_HANDLER( mazeinv_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
/* the value passed in is a look-up index into the color PROM */
- melliped_mazeinv_set_color(space->machine, offset, ~space->machine->region("proms")->base()[~data & 0x0f]);
+ melliped_mazeinv_set_color(space->machine(), offset, ~space->machine().region("proms")->base()[~data & 0x0f]);
}
@@ -431,7 +431,7 @@ WRITE8_HANDLER( mazeinv_paletteram_w )
SCREEN_UPDATE( centiped )
{
- centiped_state *state = screen->machine->driver_data<centiped_state>();
+ centiped_state *state = screen->machine().driver_data<centiped_state>();
UINT8 *spriteram = state->spriteram;
rectangle spriteclip = *cliprect;
int offs;
@@ -455,7 +455,7 @@ SCREEN_UPDATE( centiped )
int x = spriteram[offs + 0x20];
int y = 240 - spriteram[offs + 0x10];
- drawgfx_transmask(bitmap, &spriteclip, screen->machine->gfx[1], code, color, flipx, flipy, x, y, state->penmask[color & 0x3f]);
+ drawgfx_transmask(bitmap, &spriteclip, screen->machine().gfx[1], code, color, flipx, flipy, x, y, state->penmask[color & 0x3f]);
}
return 0;
}
@@ -463,9 +463,9 @@ SCREEN_UPDATE( centiped )
SCREEN_UPDATE( warlords )
{
- centiped_state *state = screen->machine->driver_data<centiped_state>();
+ centiped_state *state = screen->machine().driver_data<centiped_state>();
UINT8 *spriteram = state->spriteram;
- int upright_mode = input_port_read(screen->machine, "IN0") & 0x80;
+ int upright_mode = input_port_read(screen->machine(), "IN0") & 0x80;
int offs;
/* if the cocktail/upright switch flipped, force refresh */
@@ -501,7 +501,7 @@ SCREEN_UPDATE( warlords )
flipx = !flipx;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], code, color, flipx, flipy, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], code, color, flipx, flipy, x, y, 0);
}
return 0;
}
@@ -509,7 +509,7 @@ SCREEN_UPDATE( warlords )
SCREEN_UPDATE( bullsdrt )
{
- centiped_state *state = screen->machine->driver_data<centiped_state>();
+ centiped_state *state = screen->machine().driver_data<centiped_state>();
UINT8 *spriteram = state->spriteram;
rectangle spriteclip = *cliprect;
@@ -533,7 +533,7 @@ SCREEN_UPDATE( bullsdrt )
int x = spriteram[offs + 0x20];
int y = 240 - spriteram[offs + 0x10];
- drawgfx_transpen(bitmap, &spriteclip, screen->machine->gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
+ drawgfx_transpen(bitmap, &spriteclip, screen->machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
}
return 0;
}
@@ -544,7 +544,7 @@ SCREEN_UPDATE( bullsdrt )
*/
SCREEN_UPDATE( milliped )
{
- centiped_state *state = screen->machine->driver_data<centiped_state>();
+ centiped_state *state = screen->machine().driver_data<centiped_state>();
UINT8 *spriteram = state->spriteram;
rectangle spriteclip = *cliprect;
int offs;
@@ -571,7 +571,7 @@ SCREEN_UPDATE( milliped )
flipy = !flipy;
}
- drawgfx_transmask(bitmap, &spriteclip, screen->machine->gfx[1], code, color, flipx, flipy, x, y, state->penmask[color & 0x3f]);
+ drawgfx_transmask(bitmap, &spriteclip, screen->machine().gfx[1], code, color, flipx, flipy, x, y, state->penmask[color & 0x3f]);
}
return 0;
}
diff --git a/src/mame/video/chaknpop.c b/src/mame/video/chaknpop.c
index dd9a2d62049..e8869084bf6 100644
--- a/src/mame/video/chaknpop.c
+++ b/src/mame/video/chaknpop.c
@@ -59,9 +59,9 @@ PALETTE_INIT( chaknpop )
Memory handlers
***************************************************************************/
-static void tx_tilemap_mark_all_dirty( running_machine *machine )
+static void tx_tilemap_mark_all_dirty( running_machine &machine )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
tilemap_mark_all_tiles_dirty(state->tx_tilemap);
tilemap_set_flip(state->tx_tilemap, state->flip_x | state->flip_y);
@@ -69,20 +69,20 @@ static void tx_tilemap_mark_all_dirty( running_machine *machine )
READ8_HANDLER( chaknpop_gfxmode_r )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
return state->gfxmode;
}
WRITE8_HANDLER( chaknpop_gfxmode_w )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
if (state->gfxmode != data)
{
int all_dirty = 0;
state->gfxmode = data;
- memory_set_bank(space->machine, "bank1", (state->gfxmode & GFX_VRAM_BANK) ? 1 : 0); /* Select 2 banks of 16k */
+ memory_set_bank(space->machine(), "bank1", (state->gfxmode & GFX_VRAM_BANK) ? 1 : 0); /* Select 2 banks of 16k */
if (state->flip_x != (state->gfxmode & GFX_FLIP_X))
{
@@ -97,13 +97,13 @@ WRITE8_HANDLER( chaknpop_gfxmode_w )
}
if (all_dirty)
- tx_tilemap_mark_all_dirty(space->machine);
+ tx_tilemap_mark_all_dirty(space->machine());
}
}
WRITE8_HANDLER( chaknpop_txram_w )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
state->tx_ram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -111,14 +111,14 @@ WRITE8_HANDLER( chaknpop_txram_w )
WRITE8_HANDLER( chaknpop_attrram_w )
{
- chaknpop_state *state = space->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = space->machine().driver_data<chaknpop_state>();
if (state->attr_ram[offset] != data)
{
state->attr_ram[offset] = data;
if (offset == TX_COLOR1 || offset == TX_COLOR2)
- tx_tilemap_mark_all_dirty(space->machine);
+ tx_tilemap_mark_all_dirty(space->machine());
}
}
@@ -133,7 +133,7 @@ WRITE8_HANDLER( chaknpop_attrram_w )
static TILE_GET_INFO( chaknpop_get_tx_tile_info )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
int tile = state->tx_ram[tile_index];
int tile_h_bank = (state->gfxmode & GFX_TX_BANK2) << 2; /* 0x00-0xff -> 0x200-0x2ff */
int color = state->attr_ram[TX_COLOR2];
@@ -162,8 +162,8 @@ static STATE_POSTLOAD( chaknpop_postload )
VIDEO_START( chaknpop )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
/* info offset type w h col row */
state->tx_tilemap = tilemap_create(machine, chaknpop_get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -181,7 +181,7 @@ VIDEO_START( chaknpop )
memory_set_bank(machine, "bank1", 0);
tx_tilemap_mark_all_dirty(machine);
- machine->state().register_postload(chaknpop_postload, NULL);
+ machine.state().register_postload(chaknpop_postload, NULL);
}
@@ -189,9 +189,9 @@ VIDEO_START( chaknpop )
Screen refresh
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
int offs;
/* Draw the sprites */
@@ -216,7 +216,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -224,9 +224,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
int dx = state->flip_x ? -1 : 1;
int offs, i;
@@ -266,10 +266,10 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( chaknpop )
{
- chaknpop_state *state = screen->machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = screen->machine().driver_data<chaknpop_state>();
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/champbas.c b/src/mame/video/champbas.c
index 57770666e82..72cbfd149cf 100644
--- a/src/mame/video/champbas.c
+++ b/src/mame/video/champbas.c
@@ -34,7 +34,7 @@ PALETTE_INIT( champbas )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -59,7 +59,7 @@ PALETTE_INIT( champbas )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
color_prom += 0x20;
@@ -67,7 +67,7 @@ PALETTE_INIT( champbas )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i & 0xff] & 0x0f) | ((i & 0x100) >> 4);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -77,7 +77,7 @@ PALETTE_INIT( exctsccr )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -103,7 +103,7 @@ PALETTE_INIT( exctsccr )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -114,14 +114,14 @@ PALETTE_INIT( exctsccr )
{
int swapped_i = BITSWAP8(i, 2, 7, 6, 5, 4, 3, 1, 0);
UINT8 ctabentry = (color_prom[swapped_i] & 0x0f) | ((i & 0x80) >> 3);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites (4bpp) */
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[0x100 + i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i + 0x100, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x100, ctabentry);
}
}
@@ -129,7 +129,7 @@ PALETTE_INIT( exctsccr )
static TILE_GET_INFO( champbas_get_bg_tile_info )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
int code = state->bg_videoram[tile_index] | (state->gfx_bank << 8);
int color = (state->bg_videoram[tile_index + 0x400] & 0x1f) | 0x20;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( champbas_get_bg_tile_info )
static TILE_GET_INFO( exctsccr_get_bg_tile_info )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
int code = state->bg_videoram[tile_index] | (state->gfx_bank << 8);
int color = state->bg_videoram[tile_index + 0x400] & 0x0f;
@@ -149,13 +149,13 @@ static TILE_GET_INFO( exctsccr_get_bg_tile_info )
VIDEO_START( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->bg_tilemap = tilemap_create(machine, champbas_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
VIDEO_START( exctsccr )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->bg_tilemap = tilemap_create(machine, exctsccr_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -163,14 +163,14 @@ VIDEO_START( exctsccr )
WRITE8_HANDLER( champbas_bg_videoram_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( champbas_gfxbank_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
data &= 1;
if (state->gfx_bank != data)
{
@@ -181,23 +181,23 @@ WRITE8_HANDLER( champbas_gfxbank_w )
WRITE8_HANDLER( champbas_palette_bank_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
state->palette_bank = data & 1;
tilemap_set_palette_offset(state->bg_tilemap, state->palette_bank << 8);
}
WRITE8_HANDLER( champbas_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
-static void champbas_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void champbas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
int offs;
- const gfx_element* const gfx = machine->gfx[1];
+ const gfx_element* const gfx = machine.gfx[1];
for (offs = state->spriteram_size - 2; offs >= 0; offs -= 2)
{
@@ -213,7 +213,7 @@ static void champbas_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
code, color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
+ colortable_get_transpen_mask(machine.colortable, gfx, color, 0));
// wraparound
drawgfx_transmask(bitmap, cliprect,
@@ -221,13 +221,13 @@ static void champbas_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
code, color,
flipx, flipy,
sx + 256, sy,
- colortable_get_transpen_mask(machine->colortable, gfx, color, 0));
+ colortable_get_transpen_mask(machine.colortable, gfx, color, 0));
}
}
-static void exctsccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
int offs;
UINT8 *obj1, *obj2;
@@ -248,7 +248,7 @@ static void exctsccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
bank = ((obj1[offs + 1] >> 4) & 1);
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code + (bank << 6),
color,
flipx, flipy,
@@ -271,12 +271,12 @@ static void exctsccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
color = (obj1[offs + 1]) & 0x0f;
drawgfx_transmask(bitmap,cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code,
color,
flipx, flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0x10));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0x10));
}
}
@@ -284,16 +284,16 @@ static void exctsccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( champbas )
{
- champbas_state *state = screen->machine->driver_data<champbas_state>();
+ champbas_state *state = screen->machine().driver_data<champbas_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- champbas_draw_sprites(screen->machine, bitmap, cliprect);
+ champbas_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( exctsccr )
{
- champbas_state *state = screen->machine->driver_data<champbas_state>();
+ champbas_state *state = screen->machine().driver_data<champbas_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- exctsccr_draw_sprites(screen->machine, bitmap, cliprect);
+ exctsccr_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/changela.c b/src/mame/video/changela.c
index 7c6ee2d9efe..54fba41254f 100644
--- a/src/mame/video/changela.c
+++ b/src/mame/video/changela.c
@@ -19,18 +19,18 @@ static TIMER_CALLBACK( changela_scanline_callback );
VIDEO_START( changela )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
state->memory_devices = auto_alloc_array(machine, UINT8, 4 * 0x800); /* 0 - not connected, 1,2,3 - RAMs*/
state->tree_ram = auto_alloc_array(machine, UINT8, 2 * 0x20);
- state->obj0_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->river_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->tree0_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->tree1_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->obj0_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->river_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->tree0_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->tree1_bitmap = machine.primary_screen->alloc_compatible_bitmap();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(changela_scanline_callback));
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(30), 30);
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(changela_scanline_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(30), 30);
state->save_pointer(NAME(state->memory_devices), 4 * 0x800);
state->save_pointer(NAME(state->tree_ram), 2 * 0x20);
@@ -42,12 +42,12 @@ VIDEO_START( changela )
***************************************************************************/
-static void draw_obj0( running_machine *machine, bitmap_t *bitmap, int sy )
+static void draw_obj0( running_machine &machine, bitmap_t *bitmap, int sy )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
int sx, i;
- UINT8* ROM = machine->region("user1")->base();
+ UINT8* ROM = machine.region("user1")->base();
UINT8* RAM = state->spriteram;
for (sx = 0; sx < 256; sx++)
@@ -105,12 +105,12 @@ static void draw_obj0( running_machine *machine, bitmap_t *bitmap, int sy )
***************************************************************************/
-static void draw_obj1( running_machine *machine, bitmap_t *bitmap )
+static void draw_obj1( running_machine &machine, bitmap_t *bitmap )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
int sx, sy;
- UINT8* ROM = machine->region("gfx2")->base();
+ UINT8* ROM = machine.region("gfx2")->base();
UINT8* RAM = state->videoram;
UINT8 reg[4] = { 0 }; /* 4x4-bit registers (U58, U59) */
@@ -170,16 +170,16 @@ static void draw_obj1( running_machine *machine, bitmap_t *bitmap )
***************************************************************************/
-static void draw_river( running_machine *machine, bitmap_t *bitmap, int sy )
+static void draw_river( running_machine &machine, bitmap_t *bitmap, int sy )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
int sx, i, j;
- UINT8* ROM = machine->region("user2")->base();
+ UINT8* ROM = machine.region("user2")->base();
UINT8* RAM = state->memory_devices + 0x800;
- UINT8* TILE_ROM = machine->region("gfx1")->base();
+ UINT8* TILE_ROM = machine.region("gfx1")->base();
UINT8* TILE_RAM = state->memory_devices + 0x1000;
- UINT8* PROM = machine->region("proms")->base();
+ UINT8* PROM = machine.region("proms")->base();
int preload = ((sy < 32) ? 1 : 0);
@@ -349,20 +349,20 @@ static void draw_river( running_machine *machine, bitmap_t *bitmap, int sy )
***************************************************************************/
-static void draw_tree( running_machine *machine, bitmap_t *bitmap, int sy, int tree_num )
+static void draw_tree( running_machine &machine, bitmap_t *bitmap, int sy, int tree_num )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
int sx, i, j;
/* State machine */
- UINT8* ROM = machine->region("user2")->base();
+ UINT8* ROM = machine.region("user2")->base();
UINT8* RAM = state->memory_devices + 0x840 + 0x40 * tree_num;
- UINT8* PROM = machine->region("proms")->base();
+ UINT8* PROM = machine.region("proms")->base();
/* Tree Data */
UINT8* RAM2 = state->tree_ram + 0x20 * tree_num;
- UINT8* TILE_ROM = (tree_num ? (machine->region("user3")->base() + 0x1000) : (machine->region("gfx1")->base() + 0x2000));
- UINT8* TILE_RAM = (tree_num ? (machine->region("user3")->base()) : (state->memory_devices + 0x1800));
+ UINT8* TILE_ROM = (tree_num ? (machine.region("user3")->base() + 0x1000) : (machine.region("gfx1")->base() + 0x2000));
+ UINT8* TILE_RAM = (tree_num ? (machine.region("user3")->base()) : (state->memory_devices + 0x1800));
int preload = ((sy < 32) ? 1 : 0);
@@ -647,7 +647,7 @@ e:|7 6 5 4 3 2 1 0 Hex|/RAMw /RAMr /ROM /AdderOutput AdderInput TrainInputs|
static TIMER_CALLBACK( changela_scanline_callback )
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
int sy = param;
int sx;
@@ -719,17 +719,17 @@ static TIMER_CALLBACK( changela_scanline_callback )
sy++;
if (sy > 256) sy = 30;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(sy), sy);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(sy), sy);
}
SCREEN_UPDATE( changela )
{
- changela_state *state = screen->machine->driver_data<changela_state>();
+ changela_state *state = screen->machine().driver_data<changela_state>();
copybitmap(bitmap, state->river_bitmap, 0, 0, 0, 0, cliprect);
copybitmap_trans(bitmap, state->obj0_bitmap, 0, 0, 0, 0, cliprect, 0);
copybitmap_trans(bitmap, state->tree0_bitmap, 0, 0, 0, 0, cliprect, 0);
copybitmap_trans(bitmap, state->tree1_bitmap, 0, 0, 0, 0, cliprect, 0);
- draw_obj1(screen->machine, bitmap);
+ draw_obj1(screen->machine(), bitmap);
return 0;
}
@@ -767,30 +767,30 @@ WRITE8_HANDLER( changela_colors_w )
g = color_table[(c >> 3) & 0x07];
b = color_table[(c >> 6) & 0x07];
- palette_set_color_rgb(space->machine,color_index,r,g,b);
+ palette_set_color_rgb(space->machine(),color_index,r,g,b);
}
WRITE8_HANDLER( changela_mem_device_select_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->mem_dev_selected = (data & 0x07) * 0x800;
state->tree_en = (data & 0x30) >> 4;
/*
(data & 0x07) possible settings:
0 - not connected (no device)
- 1 - ADR1 is 2114 RAM at U59 (state space->machine) (accessible range: 0x0000-0x003f)
+ 1 - ADR1 is 2114 RAM at U59 (state space->machine()) (accessible range: 0x0000-0x003f)
2 - ADR2 is 2128 RAM at U109 (River RAM) (accessible range: 0x0000-0x07ff)
3 - ADR3 is 2128 RAM at U114 (Tree RAM) (accessible range: 0x0000-0x07ff)
4 - ADR4 is 2732 ROM at U7 (Tree ROM) (accessible range: 0x0000-0x07ff)
- 5 - SLOPE is ROM at U44 (state space->machine) (accessible range: 0x0000-0x07ff)
+ 5 - SLOPE is ROM at U44 (state space->machine()) (accessible range: 0x0000-0x07ff)
*/
}
WRITE8_HANDLER( changela_mem_device_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->memory_devices[state->mem_dev_selected + offset] = data;
if (state->mem_dev_selected == 0x800)
@@ -803,20 +803,20 @@ WRITE8_HANDLER( changela_mem_device_w )
READ8_HANDLER( changela_mem_device_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return state->memory_devices[state->mem_dev_selected + offset];
}
WRITE8_HANDLER( changela_slope_rom_addr_hi_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->slopeROM_bank = (data & 0x03) << 9;
}
WRITE8_HANDLER( changela_slope_rom_addr_lo_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->horizon = data;
}
diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c
index bc6dd0e0bb9..b77f946e23d 100644
--- a/src/mame/video/cheekyms.c
+++ b/src/mame/video/cheekyms.c
@@ -41,7 +41,7 @@ PALETTE_INIT( cheekyms )
WRITE8_HANDLER( cheekyms_port_40_w )
{
- cheekyms_state *state = space->machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = space->machine().driver_data<cheekyms_state>();
/* the lower bits probably trigger sound samples */
dac_data_w(state->dac, data ? 0x80 : 0);
@@ -50,7 +50,7 @@ WRITE8_HANDLER( cheekyms_port_40_w )
WRITE8_HANDLER( cheekyms_port_80_w )
{
- cheekyms_state *state = space->machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = space->machine().driver_data<cheekyms_state>();
/* d0-d1 - sound enables, not sure which bit is which */
/* d3-d5 - man scroll amount */
@@ -66,7 +66,7 @@ WRITE8_HANDLER( cheekyms_port_80_w )
static TILE_GET_INFO( cheekyms_get_tile_info )
{
- cheekyms_state *state = machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = machine.driver_data<cheekyms_state>();
int color;
int x = tile_index & 0x1f;
@@ -96,11 +96,11 @@ static TILE_GET_INFO( cheekyms_get_tile_info )
VIDEO_START( cheekyms )
{
- cheekyms_state *state = machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = machine.driver_data<cheekyms_state>();
int width, height;
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->bitmap_buffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
state->cm_tilemap = tilemap_create(machine, cheekyms_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -108,9 +108,9 @@ VIDEO_START( cheekyms )
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip )
{
- cheekyms_state *state = machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = machine.driver_data<cheekyms_state>();
offs_t offs;
for (offs = 0; offs < 0x20; offs += 4)
@@ -150,19 +150,19 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( cheekyms )
{
- cheekyms_state *state = screen->machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = screen->machine().driver_data<cheekyms_state>();
int y, x;
int scrolly = ((*state->port_80 >> 3) & 0x07);
int flip = *state->port_80 & 0x80;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
- tilemap_set_flip_all(screen->machine, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
+ tilemap_set_flip_all(screen->machine(), flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
bitmap_fill(bitmap, cliprect, 0);
bitmap_fill(state->bitmap_buffer, cliprect, 0);
/* sprites go under the playfield */
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->gfx[1], flip);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().gfx[1], flip);
/* draw the tilemap to a temp bitmap */
tilemap_draw(state->bitmap_buffer, cliprect, state->cm_tilemap, 0, 0);
diff --git a/src/mame/video/chqflag.c b/src/mame/video/chqflag.c
index 99bcfae07a4..768a6fe6797 100644
--- a/src/mame/video/chqflag.c
+++ b/src/mame/video/chqflag.c
@@ -17,9 +17,9 @@
***************************************************************************/
-void chqflag_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void chqflag_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
*priority = (*color & 0x10) >> 4;
*color = state->sprite_colorbase + (*color & 0x0f);
}
@@ -31,16 +31,16 @@ void chqflag_sprite_callback( running_machine *machine, int *code, int *color, i
***************************************************************************/
-void chqflag_zoom_callback_0( running_machine *machine, int *code, int *color, int *flags )
+void chqflag_zoom_callback_0( running_machine &machine, int *code, int *color, int *flags )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
*code |= ((*color & 0x03) << 8);
*color = state->zoom_colorbase[0] + ((*color & 0x3c) >> 2);
}
-void chqflag_zoom_callback_1( running_machine *machine, int *code, int *color, int *flags )
+void chqflag_zoom_callback_1( running_machine &machine, int *code, int *color, int *flags )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
*code |= ((*color & 0x0f) << 8);
*color = state->zoom_colorbase[1] + ((*color & 0x10) >> 4);
@@ -54,15 +54,15 @@ void chqflag_zoom_callback_1( running_machine *machine, int *code, int *color, i
VIDEO_START( chqflag )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x800);
state->sprite_colorbase = 0;
state->zoom_colorbase[0] = 0x10;
state->zoom_colorbase[1] = 0x02;
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x800);
}
/***************************************************************************
@@ -73,7 +73,7 @@ VIDEO_START( chqflag )
SCREEN_UPDATE( chqflag )
{
- chqflag_state *state = screen->machine->driver_data<chqflag_state>();
+ chqflag_state *state = screen->machine().driver_data<chqflag_state>();
bitmap_fill(bitmap, cliprect, 0);
diff --git a/src/mame/video/cidelsa.c b/src/mame/video/cidelsa.c
index 5addf815802..25557bfab98 100644
--- a/src/mame/video/cidelsa.c
+++ b/src/mame/video/cidelsa.c
@@ -38,7 +38,7 @@ WRITE8_MEMBER( cidelsa_state::cdp1869_w )
static CDP1869_CHAR_RAM_READ( cidelsa_charram_r )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT8 column = BIT(pma, 10) ? 0xff : pmd;
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -51,7 +51,7 @@ static CDP1869_CHAR_RAM_READ( cidelsa_charram_r )
static CDP1869_CHAR_RAM_WRITE( cidelsa_charram_w )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT8 column = BIT(pma, 10) ? 0xff : pmd;
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -62,7 +62,7 @@ static CDP1869_CHAR_RAM_WRITE( cidelsa_charram_w )
static CDP1869_CHAR_RAM_READ( draco_charram_r )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT16 addr = ((pmd << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -74,7 +74,7 @@ static CDP1869_CHAR_RAM_READ( draco_charram_r )
static CDP1869_CHAR_RAM_WRITE( draco_charram_w )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT16 addr = ((pmd << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -86,7 +86,7 @@ static CDP1869_CHAR_RAM_WRITE( draco_charram_w )
static CDP1869_PCB_READ( cidelsa_pcb_r )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT16 addr = ((pmd << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -95,7 +95,7 @@ static CDP1869_PCB_READ( cidelsa_pcb_r )
static CDP1869_PCB_READ( draco_pcb_r )
{
- cidelsa_state *state = device->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = device->machine().driver_data<cidelsa_state>();
UINT16 addr = ((pmd << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -163,13 +163,13 @@ static CDP1869_INTERFACE( draco_cdp1869_intf )
void cidelsa_state::video_start()
{
// allocate memory
- m_pcbram = auto_alloc_array(machine, UINT8, CIDELSA_CHARRAM_SIZE);
- m_charram = auto_alloc_array(machine, UINT8, CIDELSA_CHARRAM_SIZE);
+ m_pcbram = auto_alloc_array(m_machine, UINT8, CIDELSA_CHARRAM_SIZE);
+ m_charram = auto_alloc_array(m_machine, UINT8, CIDELSA_CHARRAM_SIZE);
// register for state saving
- state_save_register_global(machine, m_cdp1869_pcb);
- state_save_register_global_pointer(machine, m_pcbram, CIDELSA_CHARRAM_SIZE);
- state_save_register_global_pointer(machine, m_charram, CIDELSA_CHARRAM_SIZE);
+ state_save_register_global(m_machine, m_cdp1869_pcb);
+ state_save_register_global_pointer(m_machine, m_pcbram, CIDELSA_CHARRAM_SIZE);
+ state_save_register_global_pointer(m_machine, m_charram, CIDELSA_CHARRAM_SIZE);
}
/* AY-3-8910 */
diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c
index f3abc1f3a50..23605c0c3e1 100644
--- a/src/mame/video/cinemat.c
+++ b/src/mame/video/cinemat.c
@@ -35,8 +35,8 @@ enum
void cinemat_vector_callback(device_t *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift)
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
- const rectangle &visarea = device->machine->primary_screen->visible_area();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
+ const rectangle &visarea = device->machine().primary_screen->visible_area();
int intensity = 0xff;
/* adjust for slop */
@@ -51,10 +51,10 @@ void cinemat_vector_callback(device_t *device, INT16 sx, INT16 sy, INT16 ex, INT
/* move to the starting position if we're not there already */
if (sx != state->lastx || sy != state->lasty)
- vector_add_point(device->machine, sx << 16, sy << 16, 0, 0);
+ vector_add_point(device->machine(), sx << 16, sy << 16, 0, 0);
/* draw the vector */
- vector_add_point(device->machine, ex << 16, ey << 16, state->vector_color, intensity);
+ vector_add_point(device->machine(), ex << 16, ey << 16, state->vector_color, intensity);
/* remember the last point */
state->lastx = ex;
@@ -71,9 +71,9 @@ void cinemat_vector_callback(device_t *device, INT16 sx, INT16 sy, INT16 ex, INT
WRITE8_HANDLER(cinemat_vector_control_w)
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
int r, g, b, i;
- cpu_device *cpu = space->machine->device<cpu_device>("maincpu");
+ cpu_device *cpu = space->machine().device<cpu_device>("maincpu");
switch (state->color_mode)
{
@@ -168,7 +168,7 @@ WRITE8_HANDLER(cinemat_vector_control_w)
VIDEO_START( cinemat_bilevel )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->color_mode = COLOR_BILEVEL;
VIDEO_START_CALL(vector);
}
@@ -176,7 +176,7 @@ VIDEO_START( cinemat_bilevel )
VIDEO_START( cinemat_16level )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->color_mode = COLOR_16LEVEL;
VIDEO_START_CALL(vector);
}
@@ -184,7 +184,7 @@ VIDEO_START( cinemat_16level )
VIDEO_START( cinemat_64level )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->color_mode = COLOR_64LEVEL;
VIDEO_START_CALL(vector);
}
@@ -192,7 +192,7 @@ VIDEO_START( cinemat_64level )
VIDEO_START( cinemat_color )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->color_mode = COLOR_RGB;
VIDEO_START_CALL(vector);
}
@@ -200,7 +200,7 @@ VIDEO_START( cinemat_color )
VIDEO_START( cinemat_qb3color )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->color_mode = COLOR_QB3;
VIDEO_START_CALL(vector);
}
@@ -218,7 +218,7 @@ SCREEN_UPDATE( cinemat )
SCREEN_UPDATE_CALL(vector);
vector_clear_list();
- ccpu_wdt_timer_trigger(screen->machine->device("maincpu"));
+ ccpu_wdt_timer_trigger(screen->machine().device("maincpu"));
return 0;
}
@@ -233,7 +233,7 @@ SCREEN_UPDATE( cinemat )
SCREEN_UPDATE( spacewar )
{
- int sw_option = input_port_read(screen->machine, "INPUTS");
+ int sw_option = input_port_read(screen->machine(), "INPUTS");
SCREEN_UPDATE_CALL(cinemat);
diff --git a/src/mame/video/circus.c b/src/mame/video/circus.c
index ea4c1d72408..0e784ec7de9 100644
--- a/src/mame/video/circus.c
+++ b/src/mame/video/circus.c
@@ -13,26 +13,26 @@
WRITE8_HANDLER( circus_videoram_w )
{
- circus_state *state = space->machine->driver_data<circus_state>();
+ circus_state *state = space->machine().driver_data<circus_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( circus_clown_x_w )
{
- circus_state *state = space->machine->driver_data<circus_state>();
+ circus_state *state = space->machine().driver_data<circus_state>();
state->clown_x = 240 - data;
}
WRITE8_HANDLER( circus_clown_y_w )
{
- circus_state *state = space->machine->driver_data<circus_state>();
+ circus_state *state = space->machine().driver_data<circus_state>();
state->clown_y = 240 - data;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(0, code, 0, 0);
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -63,10 +63,10 @@ static void draw_line( bitmap_t *bitmap, const rectangle *cliprect, int x1, int
*BITMAP_ADDR16(bitmap, y1, count) = 1;
}
-static void draw_sprite_collision( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprite_collision( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- circus_state *state = machine->driver_data<circus_state>();
- const gfx_element *sprite_gfx = machine->gfx[1];
+ circus_state *state = machine.driver_data<circus_state>();
+ const gfx_element *sprite_gfx = machine.gfx[1];
const UINT8 *sprite_data = gfx_element_get_data(sprite_gfx, state->clown_z);
int sx, sy, dx, dy;
int pixel, collision = 0;
@@ -86,7 +86,7 @@ static void draw_sprite_collision( running_machine *machine, bitmap_t *bitmap, c
if (pixel)
{
collision |= *BITMAP_ADDR16(bitmap, dy, dx);
- *BITMAP_ADDR16(bitmap, dy, dx) = machine->pens[pixel];
+ *BITMAP_ADDR16(bitmap, dy, dx) = machine.pens[pixel];
}
}
}
@@ -97,7 +97,7 @@ static void draw_sprite_collision( running_machine *machine, bitmap_t *bitmap, c
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
}
-static void circus_draw_fg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* The sync generator hardware is used to */
/* draw the border and diving boards */
@@ -115,10 +115,10 @@ static void circus_draw_fg( running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( circus )
{
- circus_state *state = screen->machine->driver_data<circus_state>();
+ circus_state *state = screen->machine().driver_data<circus_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- circus_draw_fg(screen->machine, bitmap, cliprect);
- draw_sprite_collision(screen->machine, bitmap, cliprect);
+ circus_draw_fg(screen->machine(), bitmap, cliprect);
+ draw_sprite_collision(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -173,11 +173,11 @@ static void robotbwl_draw_bowling_alley( bitmap_t *bitmap, const rectangle *clip
draw_line(bitmap, cliprect, 144, 17, 144, 203, 1);
}
-static void robotbwl_draw_ball( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
drawgfx_transpen(bitmap,/* Y is horizontal position */
- cliprect,machine->gfx[1],
+ cliprect,machine.gfx[1],
state->clown_z,
0,
0,0,
@@ -186,19 +186,19 @@ static void robotbwl_draw_ball( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( robotbwl )
{
- circus_state *state = screen->machine->driver_data<circus_state>();
+ circus_state *state = screen->machine().driver_data<circus_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
robotbwl_draw_scoreboard(bitmap, cliprect);
robotbwl_draw_bowling_alley(bitmap, cliprect);
- robotbwl_draw_ball(screen->machine, bitmap, cliprect);
+ robotbwl_draw_ball(screen->machine(), bitmap, cliprect);
return 0;
}
-static void crash_draw_car( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
drawgfx_transpen(bitmap,/* Y is horizontal position */
- cliprect,machine->gfx[1],
+ cliprect,machine.gfx[1],
state->clown_z,
0,
0,0,
@@ -207,16 +207,16 @@ static void crash_draw_car( running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( crash )
{
- circus_state *state = screen->machine->driver_data<circus_state>();
+ circus_state *state = screen->machine().driver_data<circus_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- crash_draw_car(screen->machine, bitmap, cliprect);
+ crash_draw_car(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( ripcord )
{
- circus_state *state = screen->machine->driver_data<circus_state>();
+ circus_state *state = screen->machine().driver_data<circus_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprite_collision(screen->machine, bitmap, cliprect);
+ draw_sprite_collision(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/circusc.c b/src/mame/video/circusc.c
index 0a80d975f75..27f397beaf8 100644
--- a/src/mame/video/circusc.c
+++ b/src/mame/video/circusc.c
@@ -44,7 +44,7 @@ PALETTE_INIT( circusc )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -69,7 +69,7 @@ PALETTE_INIT( circusc )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,14 +79,14 @@ PALETTE_INIT( circusc )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
}
/* sprites map to the lower 16 palette entries */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -100,7 +100,7 @@ PALETTE_INIT( circusc )
static TILE_GET_INFO( get_tile_info )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
UINT8 attr = state->colorram[tile_index];
tileinfo->category = (attr & 0x10) >> 4;
@@ -120,7 +120,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( circusc )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
@@ -136,21 +136,21 @@ VIDEO_START( circusc )
WRITE8_HANDLER( circusc_videoram_w )
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( circusc_colorram_w )
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( circusc_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -161,9 +161,9 @@ WRITE8_HANDLER( circusc_flipscreen_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
int offs;
UINT8 *sr;
@@ -190,17 +190,17 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
code, color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
SCREEN_UPDATE( circusc )
{
- circusc_state *state = screen->machine->driver_data<circusc_state>();
+ circusc_state *state = screen->machine().driver_data<circusc_state>();
int i;
for (i = 0; i < 10; i++)
@@ -210,7 +210,7 @@ SCREEN_UPDATE( circusc )
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index f1fffefbeec..24176ca4ed9 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -131,7 +131,7 @@ static void prepare_shadows(cischeat_state *state)
INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->scrollram[which][offset]);
if (offset < 0x40000/2 && state->tmap[which])
{
@@ -169,7 +169,7 @@ static TILEMAP_MAPPER( cischeat_scan_16x16 )
static TILE_GET_INFO( cischeat_get_scroll_tile_info_8x8 )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int tmap = (FPTR)param;
UINT16 code = state->scrollram[tmap][tile_index];
SET_TILE_INFO(tmap, (code & 0xfff), code >> (16 - state->bits_per_color_code), 0);
@@ -177,15 +177,15 @@ static TILE_GET_INFO( cischeat_get_scroll_tile_info_8x8 )
static TILE_GET_INFO( cischeat_get_scroll_tile_info_16x16 )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int tmap = (FPTR)param;
UINT16 code = state->scrollram[tmap][tile_index/4];
SET_TILE_INFO(tmap, (code & 0xfff) * 4 + (tile_index & 3), code >> (16 - state->bits_per_color_code), 0);
}
-static void create_tilemaps(running_machine *machine)
+static void create_tilemaps(running_machine &machine)
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int layer, i;
for (layer = 0; layer < 3; layer++)
@@ -232,7 +232,7 @@ static void cischeat_set_vreg_flag(cischeat_state *state, int which, int data)
/* 32 colour codes for the tiles */
VIDEO_START( cischeat )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int i;
state->shift_ret = 1;
@@ -263,7 +263,7 @@ VIDEO_START( cischeat )
/* 16 colour codes for the tiles */
VIDEO_START( f1gpstar )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
VIDEO_START_CALL(cischeat);
@@ -294,8 +294,8 @@ VIDEO_START( bigrun )
CUSTOM_INPUT( cischeat_shift_r )
{
- cischeat_state *state = field->port->machine->driver_data<cischeat_state>();
- switch ( (input_port_read(field->port->machine, "FAKE") >> 2) & 3 )
+ cischeat_state *state = field->port->machine().driver_data<cischeat_state>();
+ switch ( (input_port_read(field->port->machine(), "FAKE") >> 2) & 3 )
{
case 1 : state->shift_ret = 1; break; // low shift: button 3
case 2 : state->shift_ret = 0; break; // high shift: button 4
@@ -312,7 +312,7 @@ CUSTOM_INPUT( cischeat_shift_r )
We support just 2 values for now..
*/
-static int read_accelerator(running_machine *machine)
+static int read_accelerator(running_machine &machine)
{
if (input_port_read(machine, "FAKE") & 1) return 0x00; // pedal pressed
else return 0xff;
@@ -325,28 +325,28 @@ static int read_accelerator(running_machine *machine)
READ16_HANDLER( bigrun_vregs_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
switch (offset)
{
- case 0x0000/2 : return input_port_read(space->machine, "IN1"); // Coins
- case 0x0002/2 : return input_port_read(space->machine, "IN2"); // Buttons
- case 0x0004/2 : return input_port_read(space->machine, "IN3"); // Motor Limit Switches
- case 0x0006/2 : return input_port_read(space->machine, "IN4"); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read(space->machine(), "IN1"); // Coins
+ case 0x0002/2 : return input_port_read(space->machine(), "IN2"); // Buttons
+ case 0x0004/2 : return input_port_read(space->machine(), "IN3"); // Motor Limit Switches
+ case 0x0006/2 : return input_port_read(space->machine(), "IN4"); // DSW 1 & 2
case 0x0008/2 : return soundlatch2_word_r(space,0,0xffff); // From sound cpu
case 0x0010/2 :
switch (state->ip_select & 0x3)
{
- case 0 : return input_port_read(space->machine, "IN6"); // Driving Wheel
+ case 0 : return input_port_read(space->machine(), "IN6"); // Driving Wheel
case 1 : return 0xffff; // Cockpit: Up / Down Position
case 2 : return 0xffff; // Cockpit: Left / Right Position?
- case 3 : return ~read_accelerator(space->machine); // Accelerator (Pedal)
+ case 3 : return ~read_accelerator(space->machine()); // Accelerator (Pedal)
default: return 0xffff;
}
- case 0x2200/2 : return input_port_read(space->machine, "IN5"); // DSW 3 (4 bits)
+ case 0x2200/2 : return input_port_read(space->machine(), "IN5"); // DSW 3 (4 bits)
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return state->vregs[offset];
@@ -355,7 +355,7 @@ READ16_HANDLER( bigrun_vregs_r )
WRITE16_HANDLER( bigrun_vregs_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
@@ -364,10 +364,10 @@ WRITE16_HANDLER( bigrun_vregs_w )
case 0x0000/2 : // leds
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,new_data & 0x01);
- coin_counter_w(space->machine, 1,new_data & 0x02);
- set_led_status(space->machine, 0,new_data & 0x10); // start button
- set_led_status(space->machine, 1,new_data & 0x20); // ?
+ coin_counter_w(space->machine(), 0,new_data & 0x01);
+ coin_counter_w(space->machine(), 1,new_data & 0x02);
+ set_led_status(space->machine(), 0,new_data & 0x10); // start button
+ set_led_status(space->machine(), 1,new_data & 0x20); // ?
}
break;
@@ -376,7 +376,7 @@ WRITE16_HANDLER( bigrun_vregs_w )
case 0x0004/2 : // motor (seat?)
if (ACCESSING_BITS_0_7)
- set_led_status(space->machine, 2, (new_data != old_data) ? 1 : 0);
+ set_led_status(space->machine(), 2, (new_data != old_data) ? 1 : 0);
break;
case 0x0006/2 : // motor (wheel?)
@@ -407,9 +407,9 @@ WRITE16_HANDLER( bigrun_vregs_w )
case 0x2208/2 : break; // watchdog reset
/* Not sure about this one.. */
- case 0x2308/2 : cputag_set_input_line(space->machine, "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
+ case 0x2308/2 : cputag_set_input_line(space->machine(), "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
@@ -423,24 +423,24 @@ WRITE16_HANDLER( bigrun_vregs_w )
READ16_HANDLER( cischeat_vregs_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
switch (offset)
{
- case 0x0000/2 : return input_port_read(space->machine, "IN1"); // Coins
- case 0x0002/2 : return input_port_read(space->machine, "IN2"); // Buttons
- case 0x0004/2 : return input_port_read(space->machine, "IN3"); // Motor Limit Switches
- case 0x0006/2 : return input_port_read(space->machine, "IN4"); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read(space->machine(), "IN1"); // Coins
+ case 0x0002/2 : return input_port_read(space->machine(), "IN2"); // Buttons
+ case 0x0004/2 : return input_port_read(space->machine(), "IN3"); // Motor Limit Switches
+ case 0x0006/2 : return input_port_read(space->machine(), "IN4"); // DSW 1 & 2
case 0x0010/2 :
switch (state->ip_select & 0x3)
{
- case 0 : return input_port_read(space->machine, "IN6"); // Driving Wheel
+ case 0 : return input_port_read(space->machine(), "IN6"); // Driving Wheel
case 1 : return ~0; // Cockpit: Up / Down Position?
case 2 : return ~0; // Cockpit: Left / Right Position?
default: return ~0;
}
- case 0x2200/2 : return input_port_read(space->machine, "IN5"); // DSW 3 (4 bits)
+ case 0x2200/2 : return input_port_read(space->machine(), "IN5"); // DSW 3 (4 bits)
case 0x2300/2 : return soundlatch2_r(space,0); // From sound cpu
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
@@ -450,7 +450,7 @@ READ16_HANDLER( cischeat_vregs_r )
WRITE16_HANDLER( cischeat_vregs_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
@@ -459,10 +459,10 @@ WRITE16_HANDLER( cischeat_vregs_w )
case 0x0000/2 : // leds
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,new_data & 0x01);
- coin_counter_w(space->machine, 1,new_data & 0x02);
- set_led_status(space->machine, 0,new_data & 0x10); // start button
- set_led_status(space->machine, 1,new_data & 0x20); // ?
+ coin_counter_w(space->machine(), 0,new_data & 0x01);
+ coin_counter_w(space->machine(), 1,new_data & 0x02);
+ set_led_status(space->machine(), 0,new_data & 0x10); // start button
+ set_led_status(space->machine(), 1,new_data & 0x20); // ?
}
break;
@@ -471,7 +471,7 @@ WRITE16_HANDLER( cischeat_vregs_w )
case 0x0004/2 : // motor (seat?)
if (ACCESSING_BITS_0_7)
- set_led_status(space->machine, 2, (new_data != old_data) ? 1 : 0);
+ set_led_status(space->machine(), 2, (new_data != old_data) ? 1 : 0);
break;
case 0x0006/2 : // motor (wheel?)
@@ -497,13 +497,13 @@ WRITE16_HANDLER( cischeat_vregs_w )
case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */
soundlatch_word_w(space, 0, new_data, 0xffff);
- cputag_set_input_line(space->machine, "soundcpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 4, HOLD_LINE);
break;
/* Not sure about this one.. */
- case 0x2308/2 : cputag_set_input_line(space->machine, "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
+ case 0x2308/2 : cputag_set_input_line(space->machine(), "cpu2", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
@@ -518,23 +518,23 @@ WRITE16_HANDLER( cischeat_vregs_w )
READ16_HANDLER( f1gpstar_vregs_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
switch (offset)
{
- case 0x0000/2 : return input_port_read(space->machine, "IN1"); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read(space->machine(), "IN1"); // DSW 1 & 2
// case 0x0002/2 : return 0xFFFF;
- case 0x0004/2 : return input_port_read(space->machine, "IN2"); // Buttons
+ case 0x0004/2 : return input_port_read(space->machine(), "IN2"); // Buttons
- case 0x0006/2 : return input_port_read(space->machine, "IN3"); // ? Read at boot only
+ case 0x0006/2 : return input_port_read(space->machine(), "IN3"); // ? Read at boot only
case 0x0008/2 : return soundlatch2_r(space,0); // From sound cpu
- case 0x000c/2 : return input_port_read(space->machine, "IN4"); // DSW 3
+ case 0x000c/2 : return input_port_read(space->machine(), "IN4"); // DSW 3
case 0x0010/2 : // Accel + Driving Wheel
- return (read_accelerator(space->machine) & 0xff) + ((input_port_read(space->machine, "IN5") & 0xff)<<8);
+ return (read_accelerator(space->machine()) & 0xff) + ((input_port_read(space->machine(), "IN5") & 0xff)<<8);
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return state->vregs[offset];
@@ -543,7 +543,7 @@ READ16_HANDLER( f1gpstar_vregs_r )
READ16_HANDLER( f1gpstr2_vregs_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
if ((offset >= 0x1000/2) && (offset < 0x2000/2))
return state->vregs[offset];
@@ -563,20 +563,20 @@ READ16_HANDLER( f1gpstr2_vregs_r )
READ16_HANDLER( wildplt_vregs_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
if ((offset >= 0x1000/2) && (offset < 0x2000/2))
return state->vregs[offset];
switch (offset)
{
- case 0x0000/2 : return input_port_read(space->machine, "IN0"); // DSW 1 & 2
+ case 0x0000/2 : return input_port_read(space->machine(), "IN0"); // DSW 1 & 2
- case 0x0004/2 : return input_port_read(space->machine, "IN1"); // Buttons
+ case 0x0004/2 : return input_port_read(space->machine(), "IN1"); // Buttons
case 0x0008/2 : return soundlatch2_r(space,0); // From sound cpu
case 0x0010/2 : // X, Y
- return input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN3")<<8);
+ return input_port_read(space->machine(), "IN2") | (input_port_read(space->machine(), "IN3")<<8);
case 0x0018/2 :
return (state->f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
@@ -589,7 +589,7 @@ READ16_HANDLER( wildplt_vregs_r )
WRITE16_HANDLER( f1gpstar_vregs_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
// UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
@@ -604,19 +604,19 @@ CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
case 0x0004/2 :
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,new_data & 0x01);
- coin_counter_w(space->machine, 1,new_data & 0x02);
- set_led_status(space->machine, 0,new_data & 0x04); // start button
- set_led_status(space->machine, 1,new_data & 0x20); // ?
+ coin_counter_w(space->machine(), 0,new_data & 0x01);
+ coin_counter_w(space->machine(), 1,new_data & 0x02);
+ set_led_status(space->machine(), 0,new_data & 0x04); // start button
+ set_led_status(space->machine(), 1,new_data & 0x20); // ?
// wheel | seat motor
- set_led_status(space->machine, 2, ((new_data >> 3) | (new_data >> 4)) & 1 );
+ set_led_status(space->machine(), 2, ((new_data >> 3) | (new_data >> 4)) & 1 );
}
break;
case 0x0014/2 : break;
/* Usually written in sequence, but not always */
case 0x0008/2 : soundlatch_word_w(space, 0, new_data, 0xffff); break;
- case 0x0018/2 : cputag_set_input_line(space->machine, "soundcpu", 4, HOLD_LINE); break;
+ case 0x0018/2 : cputag_set_input_line(space->machine(), "soundcpu", 4, HOLD_LINE); break;
case 0x0010/2 : break;
@@ -636,9 +636,9 @@ CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
case 0x2208/2 : break; // watchdog reset
/* Not sure about this one. Values: $10 then 0, $7 then 0 */
- case 0x2308/2 : cputag_set_input_line(space->machine, "cpu2", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE );
+ case 0x2308/2 : cputag_set_input_line(space->machine(), "cpu2", INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "cpu3", INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
@@ -647,7 +647,7 @@ CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
WRITE16_HANDLER( f1gpstr2_vregs_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
// UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
@@ -659,8 +659,8 @@ WRITE16_HANDLER( f1gpstr2_vregs_w )
case 0x0000/2 :
if (ACCESSING_BITS_0_7)
{
- cputag_set_input_line(space->machine, "cpu5", 4, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE);
- cputag_set_input_line(space->machine, "cpu5", 2, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "cpu5", 4, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "cpu5", 2, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE);
}
break;
@@ -676,7 +676,7 @@ WRITE16_HANDLER( f1gpstr2_vregs_w )
WRITE16_HANDLER( scudhamm_vregs_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
// int old_data = state->vregs[offset];
int new_data = COMBINE_DATA(&state->vregs[offset]);
@@ -741,14 +741,14 @@ WRITE16_HANDLER( scudhamm_vregs_w )
/* Draw the road in the given bitmap. The priority1 and priority2 parameters
specify the range of lines to draw */
-static void cischeat_draw_road(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
+static void cischeat_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int curr_code,sx,sy;
int min_priority, max_priority;
rectangle rect = *cliprect;
- gfx_element *gfx = machine->gfx[(road_num & 1)?5:4];
+ gfx_element *gfx = machine.gfx[(road_num & 1)?5:4];
UINT16 *roadram = state->roadram[road_num & 1];
@@ -831,15 +831,15 @@ static void cischeat_draw_road(running_machine *machine, bitmap_t *bitmap, const
/* Draw the road in the given bitmap. The priority1 and priority2 parameters
specify the range of lines to draw */
-static void f1gpstar_draw_road(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
+static void f1gpstar_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int sx,sy;
int xstart;
int min_priority, max_priority;
rectangle rect = *cliprect;
- gfx_element *gfx = machine->gfx[(road_num & 1)?5:4];
+ gfx_element *gfx = machine.gfx[(road_num & 1)?5:4];
UINT16 *roadram = state->roadram[road_num & 1];
@@ -947,9 +947,9 @@ static void f1gpstar_draw_road(running_machine *machine, bitmap_t *bitmap, const
sprites whose priority nibble is between 0 and 15 and whose
colour code's high bit is set. */
-static void cischeat_draw_sprites(running_machine *machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
+static void cischeat_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc;
int y, sy, flipy, yzoom, yscale, ydim, ynum, ystart, yend, yinc;
int code, attr, color, size, shadow;
@@ -1049,12 +1049,12 @@ if ( (state->debugsprites) && ( ((attr & 0x0300)>>8) != (state->debugsprites-1)
{
for (x = xstart; x != xend; x += xinc)
{
- drawgfxzoom_transtable(bitmap,cliprect,machine->gfx[3],
+ drawgfxzoom_transtable(bitmap,cliprect,machine.gfx[3],
code++,
color,
flipx,flipy,
(sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000,
- xscale, yscale, state->drawmode_table, machine->shadow_table);
+ xscale, yscale, state->drawmode_table, machine.shadow_table);
}
}
#ifdef MAME_DEBUG
@@ -1103,9 +1103,9 @@ if (input_code_pressed(machine, KEYCODE_X))
***************************************************************************/
-static void bigrun_draw_sprites(running_machine *machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
+static void bigrun_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc;
int y, sy, flipy, yzoom, yscale, ydim, ynum, ystart, yend, yinc;
int code, attr, color, size, shadow;
@@ -1204,12 +1204,12 @@ if ( (state->debugsprites) && ( ((attr & 0x0300)>>8) != (state->debugsprites-1)
{
for (x = xstart; x != xend; x += xinc)
{
- drawgfxzoom_transtable(bitmap,cliprect,machine->gfx[3],
+ drawgfxzoom_transtable(bitmap,cliprect,machine.gfx[3],
code++,
color,
flipx,flipy,
(sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000,
- xscale, yscale, state->drawmode_table, machine->shadow_table);
+ xscale, yscale, state->drawmode_table, machine.shadow_table);
}
}
#ifdef MAME_DEBUG
@@ -1236,24 +1236,24 @@ if (input_code_pressed(machine, KEYCODE_X))
#ifdef MAME_DEBUG
#define CISCHEAT_LAYERSCTRL \
state->debugsprites = 0; \
-if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) \
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X) ) \
{ \
int msk = 0; \
- if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x01;} \
- if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x02;} \
- if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x04;} \
- if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x08; state->debugsprites = 1;} \
- if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x08; state->debugsprites = 2;} \
- if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x08; state->debugsprites = 3;} \
- if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x08; state->debugsprites = 4;} \
- if (input_code_pressed(screen->machine, KEYCODE_R)) { msk |= 0x10;} \
- if (input_code_pressed(screen->machine, KEYCODE_T)) { msk |= 0x20;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) { msk |= 0x01;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) { msk |= 0x02;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) { msk |= 0x04;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) { msk |= 0x08; state->debugsprites = 1;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) { msk |= 0x08; state->debugsprites = 2;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) { msk |= 0x08; state->debugsprites = 3;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) { msk |= 0x08; state->debugsprites = 4;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) { msk |= 0x10;} \
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) { msk |= 0x20;} \
\
if (msk != 0) state->active_layers &= msk; \
} \
\
{ \
- if ( input_code_pressed(screen->machine, KEYCODE_Z) && input_code_pressed_once(screen->machine, KEYCODE_U) ) \
+ if ( input_code_pressed(screen->machine(), KEYCODE_Z) && input_code_pressed_once(screen->machine(), KEYCODE_U) ) \
state->show_unknown ^= 1; \
if (state->show_unknown) \
popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \
@@ -1269,7 +1269,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen
SCREEN_UPDATE( bigrun )
{
- cischeat_state *state = screen->machine->driver_data<cischeat_state>();
+ cischeat_state *state = screen->machine().driver_data<cischeat_state>();
int i;
int active_layers1, flag;
@@ -1295,8 +1295,8 @@ SCREEN_UPDATE( bigrun )
for (i = 7; i >= 4; i--)
{ /* bitmap, road, min_priority, max_priority, transparency */
- if (state->active_layers & 0x10) cischeat_draw_road(screen->machine,bitmap,cliprect,0,i,i,FALSE);
- if (state->active_layers & 0x20) cischeat_draw_road(screen->machine,bitmap,cliprect,1,i,i,TRUE);
+ if (state->active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,i,i,FALSE);
+ if (state->active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,i,i,TRUE);
}
flag = 0;
@@ -1305,11 +1305,11 @@ SCREEN_UPDATE( bigrun )
for (i = 3; i >= 0; i--)
{ /* bitmap, road, min_priority, max_priority, transparency */
- if (state->active_layers & 0x10) cischeat_draw_road(screen->machine,bitmap,cliprect,0,i,i,TRUE);
- if (state->active_layers & 0x20) cischeat_draw_road(screen->machine,bitmap,cliprect,1,i,i,TRUE);
+ if (state->active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,i,i,TRUE);
+ if (state->active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,i,i,TRUE);
}
- if (state->active_layers & 0x08) bigrun_draw_sprites(screen->machine,bitmap,cliprect,15,0);
+ if (state->active_layers & 0x08) bigrun_draw_sprites(screen->machine(),bitmap,cliprect,15,0);
cischeat_tmap_DRAW(2)
@@ -1324,7 +1324,7 @@ SCREEN_UPDATE( bigrun )
SCREEN_UPDATE( cischeat )
{
- cischeat_state *state = screen->machine->driver_data<cischeat_state>();
+ cischeat_state *state = screen->machine().driver_data<cischeat_state>();
int active_layers1, flag;
#ifdef MAME_DEBUG
@@ -1348,25 +1348,25 @@ SCREEN_UPDATE( cischeat )
bitmap_fill(bitmap,cliprect,0);
/* bitmap, road, priority, transparency */
- if (state->active_layers & 0x10) cischeat_draw_road(screen->machine,bitmap,cliprect,0,7,5,FALSE);
- if (state->active_layers & 0x20) cischeat_draw_road(screen->machine,bitmap,cliprect,1,7,5,TRUE);
+ if (state->active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,7,5,FALSE);
+ if (state->active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,7,5,TRUE);
flag = 0;
cischeat_tmap_DRAW(0)
// else bitmap_fill(bitmap,cliprect,0);
cischeat_tmap_DRAW(1)
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,15,3);
- if (state->active_layers & 0x10) cischeat_draw_road(screen->machine,bitmap,cliprect,0,4,1,TRUE);
- if (state->active_layers & 0x20) cischeat_draw_road(screen->machine,bitmap,cliprect,1,4,1,TRUE);
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,2,2);
- if (state->active_layers & 0x10) cischeat_draw_road(screen->machine,bitmap,cliprect,0,0,0,TRUE);
- if (state->active_layers & 0x20) cischeat_draw_road(screen->machine,bitmap,cliprect,1,0,0,TRUE);
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,1,0);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,15,3);
+ if (state->active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,4,1,TRUE);
+ if (state->active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,4,1,TRUE);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,2,2);
+ if (state->active_layers & 0x10) cischeat_draw_road(screen->machine(),bitmap,cliprect,0,0,0,TRUE);
+ if (state->active_layers & 0x20) cischeat_draw_road(screen->machine(),bitmap,cliprect,1,0,0,TRUE);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,1,0);
cischeat_tmap_DRAW(2)
/* for the map screen */
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,0+16,0+16);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0+16,0+16);
state->active_layers = active_layers1;
@@ -1381,7 +1381,7 @@ SCREEN_UPDATE( cischeat )
SCREEN_UPDATE( f1gpstar )
{
- cischeat_state *state = screen->machine->driver_data<cischeat_state>();
+ cischeat_state *state = screen->machine().driver_data<cischeat_state>();
int active_layers1, flag;
#ifdef MAME_DEBUG
@@ -1407,8 +1407,8 @@ SCREEN_UPDATE( f1gpstar )
/* 1: clouds 5, grad 7, road 0 2: clouds 5, grad 7, road 0, tunnel roof 0 */
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
- if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine,bitmap,cliprect,1,6,7,TRUE);
- if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine,bitmap,cliprect,0,6,7,TRUE);
+ if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,6,7,TRUE);
+ if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,6,7,TRUE);
flag = 0;
cischeat_tmap_DRAW(0)
@@ -1416,18 +1416,18 @@ SCREEN_UPDATE( f1gpstar )
cischeat_tmap_DRAW(1)
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
- if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine,bitmap,cliprect,1,1,5,TRUE);
- if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine,bitmap,cliprect,0,1,5,TRUE);
+ if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,1,5,TRUE);
+ if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,1,5,TRUE);
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,15,2);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,15,2);
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
- if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine,bitmap,cliprect,1,0,0,TRUE);
- if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine,bitmap,cliprect,0,0,0,TRUE);
+ if (state->active_layers & 0x20) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,1,0,0,TRUE);
+ if (state->active_layers & 0x10) f1gpstar_draw_road(screen->machine(),bitmap,cliprect,0,0,0,TRUE);
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,1,1);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,1,1);
cischeat_tmap_DRAW(2)
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,0,0);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0,0);
state->active_layers = active_layers1;
@@ -1442,28 +1442,28 @@ SCREEN_UPDATE( f1gpstar )
SCREEN_UPDATE( scudhamm )
{
- cischeat_state *state = screen->machine->driver_data<cischeat_state>();
+ cischeat_state *state = screen->machine().driver_data<cischeat_state>();
int active_layers1, flag;
active_layers1 = state->active_layers;
state->active_layers = 0x0d;
#ifdef MAME_DEBUG
state->debugsprites = 0;
-if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x1;}
- if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x2;}
- if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x4;}
- if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x8; state->debugsprites = 1;}
- if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x8; state->debugsprites = 2;}
- if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x8; state->debugsprites = 3;}
- if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x8; state->debugsprites = 4;}
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) { msk |= 0x1;}
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) { msk |= 0x2;}
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) { msk |= 0x4;}
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) { msk |= 0x8; state->debugsprites = 1;}
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) { msk |= 0x8; state->debugsprites = 2;}
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) { msk |= 0x8; state->debugsprites = 3;}
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) { msk |= 0x8; state->debugsprites = 4;}
if (msk != 0) state->active_layers &= msk;
#if 1
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
popmessage("Cmd: %04X Pos:%04X Lim:%04X Inp:%04X",
state->scudhamm_motor_command,
@@ -1484,7 +1484,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen
flag = 0;
cischeat_tmap_DRAW(0)
// no layer 1
- if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine,bitmap,cliprect,0,15);
+ if (state->active_layers & 0x08) cischeat_draw_sprites(screen->machine(),bitmap,cliprect,0,15);
cischeat_tmap_DRAW(2)
state->active_layers = active_layers1;
diff --git a/src/mame/video/citycon.c b/src/mame/video/citycon.c
index 2dd06cb8bf2..25d55025909 100644
--- a/src/mame/video/citycon.c
+++ b/src/mame/video/citycon.c
@@ -24,7 +24,7 @@ static TILEMAP_MAPPER( citycon_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
SET_TILE_INFO(
0,
state->videoram[tile_index],
@@ -34,8 +34,8 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- citycon_state *state = machine->driver_data<citycon_state>();
- UINT8 *rom = machine->region("gfx4")->base();
+ citycon_state *state = machine.driver_data<citycon_state>();
+ UINT8 *rom = machine.region("gfx4")->base();
int code = rom[0x1000 * state->bg_image + tile_index];
SET_TILE_INFO(
3 + state->bg_image,
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( citycon )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, citycon_scan, 8, 8, 128, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, citycon_scan, 8, 8, 128, 32);
@@ -72,7 +72,7 @@ VIDEO_START( citycon )
WRITE8_HANDLER( citycon_videoram_w )
{
- citycon_state *state = space->machine->driver_data<citycon_state>();
+ citycon_state *state = space->machine().driver_data<citycon_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -80,14 +80,14 @@ WRITE8_HANDLER( citycon_videoram_w )
WRITE8_HANDLER( citycon_linecolor_w )
{
- citycon_state *state = space->machine->driver_data<citycon_state>();
+ citycon_state *state = space->machine().driver_data<citycon_state>();
state->linecolor[offset] = data;
}
WRITE8_HANDLER( citycon_background_w )
{
- citycon_state *state = space->machine->driver_data<citycon_state>();
+ citycon_state *state = space->machine().driver_data<citycon_state>();
/* bits 4-7 control the background image */
if (state->bg_image != (data >> 4))
@@ -98,7 +98,7 @@ WRITE8_HANDLER( citycon_background_w )
/* bit 0 flips screen */
/* it is also used to multiplex player 1 and player 2 controls */
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
/* bits 1-3 are unknown */
// if ((data & 0x0e) != 0) logerror("background register = %02x\n", data);
@@ -106,9 +106,9 @@ WRITE8_HANDLER( citycon_background_w )
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -125,7 +125,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx = !flipx;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[state->spriteram[offs + 1] & 0x80 ? 2 : 1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[state->spriteram[offs + 1] & 0x80 ? 2 : 1],
state->spriteram[offs + 1] & 0x7f,
state->spriteram[offs + 2] & 0x0f,
flipx,flip_screen_get(machine),
@@ -134,15 +134,15 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-INLINE void changecolor_RRRRGGGGBBBBxxxx( running_machine *machine, int color, int indx )
+INLINE void changecolor_RRRRGGGGBBBBxxxx( running_machine &machine, int color, int indx )
{
- int data = machine->generic.paletteram.u8[2 * indx | 1] | (machine->generic.paletteram.u8[2 * indx] << 8);
+ int data = machine.generic.paletteram.u8[2 * indx | 1] | (machine.generic.paletteram.u8[2 * indx] << 8);
palette_set_color_rgb(machine, color, pal4bit(data >> 12), pal4bit(data >> 8), pal4bit(data >> 4));
}
SCREEN_UPDATE( citycon )
{
- citycon_state *state = screen->machine->driver_data<citycon_state>();
+ citycon_state *state = screen->machine().driver_data<citycon_state>();
int offs, scroll;
/* Update the virtual palette to support text color code changing on every scanline. */
@@ -152,7 +152,7 @@ SCREEN_UPDATE( citycon )
int i;
for (i = 0; i < 4; i++)
- changecolor_RRRRGGGGBBBBxxxx(screen->machine, 640 + 4 * offs + i, 512 + 4 * indx + i);
+ changecolor_RRRRGGGGBBBBxxxx(screen->machine(), 640 + 4 * offs + i, 512 + 4 * indx + i);
}
@@ -163,6 +163,6 @@ SCREEN_UPDATE( citycon )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/cloak.c b/src/mame/video/cloak.c
index 776875dbaa9..d7aae475493 100644
--- a/src/mame/video/cloak.c
+++ b/src/mame/video/cloak.c
@@ -40,14 +40,14 @@
WRITE8_HANDLER( cloak_paletteram_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
state->palette_ram[offset & 0x3f] = ((offset & 0x40) << 2) | data;
}
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
UINT16 *palette_ram = state->palette_ram;
static const int resistances[3] = { 10000, 4700, 2200 };
double weights[3];
@@ -95,9 +95,9 @@ static void set_current_bitmap_videoram_pointer(cloak_state *state)
WRITE8_HANDLER( cloak_clearbmp_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
state->bitmap_videoram_selected = data & 0x01;
set_current_bitmap_videoram_pointer(state);
@@ -120,7 +120,7 @@ static void adjust_xy(cloak_state *state, int offset)
READ8_HANDLER( graph_processor_r )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
UINT8 ret = state->current_bitmap_videoram_displayed[(state->bitmap_videoram_address_y << 8) | state->bitmap_videoram_address_x];
adjust_xy(state, offset);
@@ -130,7 +130,7 @@ READ8_HANDLER( graph_processor_r )
WRITE8_HANDLER( graph_processor_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
switch (offset)
{
@@ -146,7 +146,7 @@ WRITE8_HANDLER( graph_processor_w )
WRITE8_HANDLER( cloak_videoram_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -155,12 +155,12 @@ WRITE8_HANDLER( cloak_videoram_w )
WRITE8_HANDLER( cloak_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
@@ -169,14 +169,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static STATE_POSTLOAD( cloak_postload )
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
set_current_bitmap_videoram_pointer(state);
}
VIDEO_START( cloak )
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -192,12 +192,12 @@ VIDEO_START( cloak )
state->save_pointer(NAME(state->bitmap_videoram1), 256*256);
state->save_pointer(NAME(state->bitmap_videoram2), 256*256);
state->save_pointer(NAME(state->palette_ram), NUM_PENS);
- machine->state().register_postload(cloak_postload, NULL);
+ machine.state().register_postload(cloak_postload, NULL);
}
-static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
int x, y;
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -210,9 +210,9 @@ static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectan
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- cloak_state *state = machine->driver_data<cloak_state>();
+ cloak_state *state = machine.driver_data<cloak_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -232,16 +232,16 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
}
}
SCREEN_UPDATE( cloak )
{
- cloak_state *state = screen->machine->driver_data<cloak_state>();
- set_pens(screen->machine);
+ cloak_state *state = screen->machine().driver_data<cloak_state>();
+ set_pens(screen->machine());
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/cloud9.c b/src/mame/video/cloud9.c
index cfc17cc40a9..689166aec7b 100644
--- a/src/mame/video/cloud9.c
+++ b/src/mame/video/cloud9.c
@@ -17,7 +17,7 @@
VIDEO_START( cloud9 )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
static const int resistances[3] = { 22000, 10000, 4700 };
/* allocate second bank of videoram */
@@ -25,9 +25,9 @@ VIDEO_START( cloud9 )
memory_set_bankptr(machine, "bank1", state->videoram);
/* get pointers to our PROMs */
- state->syncprom = machine->region("proms")->base() + 0x000;
- state->wpprom = machine->region("proms")->base() + 0x200;
- state->priprom = machine->region("proms")->base() + 0x300;
+ state->syncprom = machine.region("proms")->base() + 0x000;
+ state->wpprom = machine.region("proms")->base() + 0x200;
+ state->priprom = machine.region("proms")->base() + 0x300;
/* compute the color output resistor weights at startup */
compute_resistor_weights(0, 255, -1.0,
@@ -36,7 +36,7 @@ VIDEO_START( cloud9 )
3, resistances, state->bweights, 1000, 0);
/* allocate a bitmap for drawing sprites */
- state->spritebitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->spritebitmap = machine.primary_screen->alloc_compatible_bitmap();
/* register for savestates */
state->save_pointer(NAME(state->videoram), 0x8000);
@@ -54,7 +54,7 @@ VIDEO_START( cloud9 )
WRITE8_HANDLER( cloud9_video_control_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
/* only D7 matters */
state->video_control[offset] = (data >> 7) & 1;
@@ -70,7 +70,7 @@ WRITE8_HANDLER( cloud9_video_control_w )
WRITE8_HANDLER( cloud9_paletteram_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
int bit0, bit1, bit2;
int r, g, b;
@@ -97,7 +97,7 @@ WRITE8_HANDLER( cloud9_paletteram_w )
bit2 = (~b >> 2) & 0x01;
b = combine_3_weights(state->bweights, bit0, bit1, bit2);
- palette_set_color(space->machine, offset & 0x3f, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset & 0x3f, MAKE_RGB(r, g, b));
}
@@ -109,9 +109,9 @@ WRITE8_HANDLER( cloud9_paletteram_w )
*
*************************************/
-INLINE void cloud9_write_vram( running_machine *machine, UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba )
+INLINE void cloud9_write_vram( running_machine &machine, UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
UINT8 *dest = &state->videoram[0x0000 | (addr & 0x3fff)];
UINT8 *dest2 = &state->videoram[0x4000 | (addr & 0x3fff)];
UINT8 promaddr = 0;
@@ -159,9 +159,9 @@ INLINE void cloud9_write_vram( running_machine *machine, UINT16 addr, UINT8 data
*
*************************************/
-INLINE void bitmode_autoinc( running_machine *machine )
+INLINE void bitmode_autoinc( running_machine &machine )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
/* auto increment in the x-direction if it's enabled */
if (!state->video_control[0]) /* /AX */
@@ -183,7 +183,7 @@ INLINE void bitmode_autoinc( running_machine *machine )
WRITE8_HANDLER( cloud9_videoram_w )
{
/* direct writes to VRAM go through the write protect PROM as well */
- cloud9_write_vram(space->machine, offset, data, 0, 0);
+ cloud9_write_vram(space->machine(), offset, data, 0, 0);
}
@@ -196,7 +196,7 @@ WRITE8_HANDLER( cloud9_videoram_w )
READ8_HANDLER( cloud9_bitmode_r )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
/* in bitmode, the address comes from the autoincrement latches */
UINT16 addr = (state->bitmode_addr[1] << 6) | (state->bitmode_addr[0] >> 2);
@@ -205,7 +205,7 @@ READ8_HANDLER( cloud9_bitmode_r )
UINT8 result = state->videoram[((~state->bitmode_addr[0] & 2) << 13) | addr] << ((state->bitmode_addr[0] & 1) * 4);
/* autoincrement because /BITMD was selected */
- bitmode_autoinc(space->machine);
+ bitmode_autoinc(space->machine());
/* the upper 4 bits of the data lines are not driven so make them all 1's */
return (result >> 4) | 0xf0;
@@ -214,7 +214,7 @@ READ8_HANDLER( cloud9_bitmode_r )
WRITE8_HANDLER( cloud9_bitmode_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
/* in bitmode, the address comes from the autoincrement latches */
UINT16 addr = (state->bitmode_addr[1] << 6) | (state->bitmode_addr[0] >> 2);
@@ -223,19 +223,19 @@ WRITE8_HANDLER( cloud9_bitmode_w )
data = (data & 0x0f) | (data << 4);
/* write through the generic VRAM routine, passing the low 2 X bits as PIXB/PIXA */
- cloud9_write_vram(space->machine, addr, data, 1, state->bitmode_addr[0] & 3);
+ cloud9_write_vram(space->machine(), addr, data, 1, state->bitmode_addr[0] & 3);
/* autoincrement because /BITMD was selected */
- bitmode_autoinc(space->machine);
+ bitmode_autoinc(space->machine());
}
WRITE8_HANDLER( cloud9_bitmode_addr_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
/* write through to video RAM and also to the addressing latches */
- cloud9_write_vram(space->machine, offset, data, 0, 0);
+ cloud9_write_vram(space->machine(), offset, data, 0, 0);
state->bitmode_addr[offset] = data;
}
@@ -249,10 +249,10 @@ WRITE8_HANDLER( cloud9_bitmode_addr_w )
SCREEN_UPDATE( cloud9 )
{
- cloud9_state *state = screen->machine->driver_data<cloud9_state>();
+ cloud9_state *state = screen->machine().driver_data<cloud9_state>();
UINT8 *spriteaddr = state->spriteram;
int flip = state->video_control[5] ? 0xff : 0x00; /* PLAYER2 */
- pen_t black = get_black_pen(screen->machine);
+ pen_t black = get_black_pen(screen->machine());
int x, y, offs;
/* draw the sprites */
@@ -267,9 +267,9 @@ SCREEN_UPDATE( cloud9 )
int which = spriteaddr[offs + 0x20];
int color = 0;
- drawgfx_transpen(state->spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x, y, 0);
+ drawgfx_transpen(state->spritebitmap, cliprect, screen->machine().gfx[0], which, color, xflip, yflip, x, y, 0);
if (x >= 256 - 16)
- drawgfx_transpen(state->spritebitmap, cliprect, screen->machine->gfx[0], which, color, xflip, yflip, x - 256, y, 0);
+ drawgfx_transpen(state->spritebitmap, cliprect, screen->machine().gfx[0], which, color, xflip, yflip, x - 256, y, 0);
}
/* draw the bitmap to the screen, looping over Y */
diff --git a/src/mame/video/clshroad.c b/src/mame/video/clshroad.c
index d8453b2d9f1..06d8579fd3d 100644
--- a/src/mame/video/clshroad.c
+++ b/src/mame/video/clshroad.c
@@ -36,7 +36,7 @@
WRITE8_HANDLER( clshroad_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1 );
+ flip_screen_set(space->machine(), data & 1 );
}
@@ -54,7 +54,7 @@ PALETTE_INIT( firebatl )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -63,20 +63,20 @@ PALETTE_INIT( firebatl )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
color_prom += 0x300;
for (i = 0; i < 0x200; i++)
- colortable_entry_set_value(machine->colortable, i, i & 0xff);
+ colortable_entry_set_value(machine.colortable, i, i & 0xff);
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = ((color_prom[(i - 0x200) + 0x000] & 0x0f) << 4) |
(color_prom[(i - 0x200) + 0x100] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -104,7 +104,7 @@ Offset:
static TILE_GET_INFO( get_tile_info_0a )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
UINT8 code;
tile_index = (tile_index & 0x1f) + (tile_index & ~0x1f)*2;
code = state->vram_0[ tile_index * 2 + 0x40 ];
@@ -118,7 +118,7 @@ static TILE_GET_INFO( get_tile_info_0a )
static TILE_GET_INFO( get_tile_info_0b )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
UINT8 code;
tile_index = (tile_index & 0x1f) + (tile_index & ~0x1f)*2;
code = state->vram_0[ tile_index * 2 + 0x00 ];
@@ -132,7 +132,7 @@ static TILE_GET_INFO( get_tile_info_0b )
WRITE8_HANDLER( clshroad_vram_0_w )
{
- clshroad_state *state = space->machine->driver_data<clshroad_state>();
+ clshroad_state *state = space->machine().driver_data<clshroad_state>();
int tile_index = offset / 2;
int tile = (tile_index & 0x1f) + (tile_index & ~0x3f)/2;
state->vram_0[offset] = data;
@@ -177,7 +177,7 @@ static TILEMAP_MAPPER( tilemap_scan_rows_extra )
static TILE_GET_INFO( get_tile_info_fb1 )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
UINT8 code = state->vram_1[ tile_index + 0x000 ];
UINT8 color = state->vram_1[ tile_index + 0x400 ] & 0x3f;
tileinfo->group = color;
@@ -190,7 +190,7 @@ static TILE_GET_INFO( get_tile_info_fb1 )
static TILE_GET_INFO( get_tile_info_1 )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
UINT8 code = state->vram_1[ tile_index + 0x000 ];
UINT8 color = state->vram_1[ tile_index + 0x400 ];
SET_TILE_INFO(
@@ -202,7 +202,7 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE8_HANDLER( clshroad_vram_1_w )
{
- clshroad_state *state = space->machine->driver_data<clshroad_state>();
+ clshroad_state *state = space->machine().driver_data<clshroad_state>();
state->vram_1[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_1, offset % 0x400);
}
@@ -210,7 +210,7 @@ WRITE8_HANDLER( clshroad_vram_1_w )
VIDEO_START( firebatl )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
/* These 2 use the graphics and scroll value */
state->tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10);
state->tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10);
@@ -229,12 +229,12 @@ VIDEO_START( firebatl )
tilemap_set_scrolldx( state->tilemap_0b, -0x30, -0xb5);
tilemap_set_transparent_pen( state->tilemap_0b, 0 );
- colortable_configure_tilemap_groups(machine->colortable, state->tilemap_1, machine->gfx[2], 0x0f);
+ colortable_configure_tilemap_groups(machine.colortable, state->tilemap_1, machine.gfx[2], 0x0f);
}
VIDEO_START( clshroad )
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
/* These 2 use the graphics and scroll value */
state->tilemap_0a = tilemap_create(machine, get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10);
state->tilemap_0b = tilemap_create(machine, get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10);
@@ -286,9 +286,9 @@ Offset: Format: Value:
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- clshroad_state *state = machine->driver_data<clshroad_state>();
+ clshroad_state *state = machine.driver_data<clshroad_state>();
UINT8 *spriteram = state->spriteram;
int i;
@@ -310,7 +310,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
attr & 0x0f,
flipx,flipy,
@@ -329,7 +329,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( clshroad )
{
- clshroad_state *state = screen->machine->driver_data<clshroad_state>();
+ clshroad_state *state = screen->machine().driver_data<clshroad_state>();
int scrollx = state->vregs[ 0 ] + (state->vregs[ 1 ] << 8);
// int priority = state->vregs[ 2 ];
@@ -339,7 +339,7 @@ SCREEN_UPDATE( clshroad )
tilemap_draw(bitmap,cliprect,state->tilemap_0a,0,0); // Opaque
tilemap_draw(bitmap,cliprect,state->tilemap_0b,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tilemap_1,0,0);
return 0;
}
diff --git a/src/mame/video/cninja.c b/src/mame/video/cninja.c
index 7b830ea3c52..5c7a161bb39 100644
--- a/src/mame/video/cninja.c
+++ b/src/mame/video/cninja.c
@@ -14,7 +14,7 @@
VIDEO_START( stoneage )
{
- cninja_state *state = machine->driver_data<cninja_state>();
+ cninja_state *state = machine.driver_data<cninja_state>();
/* The bootleg has broken scroll registers */
deco16ic_set_scrolldx(state->deco_tilegen1, 3, 0, -10, -10); /* pf4 16x16 tilemap */
@@ -26,9 +26,9 @@ VIDEO_START( stoneage )
/* The bootleg sprites are in a different format! */
-static void cninjabl_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
int offs;
int endoffs;
@@ -68,7 +68,7 @@ static void cninjabl_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
colour = (x >> 9) & 0x1f;
@@ -110,12 +110,12 @@ static void cninjabl_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (multi >= 0)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
multi--;
}
@@ -126,68 +126,68 @@ static void cninjabl_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( cninja )
{
- cninja_state *state = screen->machine->driver_data<cninja_state>();
+ cninja_state *state = screen->machine().driver_data<cninja_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 512);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
SCREEN_UPDATE( cninjabl )
{
- cninja_state *state = screen->machine->driver_data<cninja_state>();
+ cninja_state *state = screen->machine().driver_data<cninja_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 512);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4);
- cninjabl_draw_sprites(screen->machine, bitmap, cliprect);
+ cninjabl_draw_sprites(screen->machine(), bitmap, cliprect);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
SCREEN_UPDATE( edrandy )
{
- cninja_state *state = screen->machine->driver_data<cninja_state>();
+ cninja_state *state = screen->machine().driver_data<cninja_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
SCREEN_UPDATE( robocop2 )
{
- cninja_state *state = screen->machine->driver_data<cninja_state>();
+ cninja_state *state = screen->machine().driver_data<cninja_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
@@ -206,12 +206,12 @@ SCREEN_UPDATE( robocop2 )
}
/* Update playfields */
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0x200);
if ((priority & 4) == 0)
@@ -231,35 +231,35 @@ SCREEN_UPDATE( robocop2 )
break;
}
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
VIDEO_START( mutantf )
{
- machine->device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
- machine->device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
}
SCREEN_UPDATE( mutantf )
{
- cninja_state *state = screen->machine->driver_data<cninja_state>();
+ cninja_state *state = screen->machine().driver_data<cninja_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
bitmap_fill(bitmap, cliprect, 0x400); /* Confirmed */
- screen->machine->device<decospr_device>("spritegen1")->set_alt_format(true);
- screen->machine->device<decospr_device>("spritegen2")->set_alt_format(true);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 0x400, true);
- screen->machine->device<decospr_device>("spritegen1")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400, true);
+ screen->machine().device<decospr_device>("spritegen1")->set_alt_format(true);
+ screen->machine().device<decospr_device>("spritegen2")->set_alt_format(true);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 0x400, true);
+ screen->machine().device<decospr_device>("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400, true);
/* There is no priority prom on this board, but there is a
@@ -280,13 +280,13 @@ SCREEN_UPDATE( mutantf )
if (priority & 1)
{
- screen->machine->device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
- screen->machine->device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
+ screen->machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
}
else
{
- screen->machine->device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
- screen->machine->device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer?
+ screen->machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff);
}
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c
index de85a832d70..9c95805f073 100644
--- a/src/mame/video/combatsc.c
+++ b/src/mame/video/combatsc.c
@@ -15,7 +15,7 @@ PALETTE_INIT( combatsc )
int pal;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x80);
+ machine.colortable = colortable_alloc(machine, 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -54,7 +54,7 @@ PALETTE_INIT( combatsc )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
}
}
}
@@ -65,7 +65,7 @@ PALETTE_INIT( combatscb )
int pal;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x80);
+ machine.colortable = colortable_alloc(machine, 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -82,15 +82,15 @@ PALETTE_INIT( combatscb )
/* chars - no lookup? */
ctabentry = (pal << 4) | (i & 0x0f); /* no lookup? */
- colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
}
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
int i;
for (i = 0x00; i < 0x100; i += 2)
@@ -99,7 +99,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -113,7 +113,7 @@ static void set_pens( running_machine *machine )
static TILE_GET_INFO( get_tile_info0 )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_1, 6);
UINT8 attributes = state->page[0][tile_index];
int bank = 4 * ((state->vreg & 0x0f) - 1);
@@ -148,7 +148,7 @@ static TILE_GET_INFO( get_tile_info0 )
static TILE_GET_INFO( get_tile_info1 )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_2, 6);
UINT8 attributes = state->page[1][tile_index];
int bank = 4 * ((state->vreg >> 4) - 1);
@@ -183,7 +183,7 @@ static TILE_GET_INFO( get_tile_info1 )
static TILE_GET_INFO( get_text_info )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
UINT8 attributes = state->page[0][tile_index + 0x800];
int number = state->page[0][tile_index + 0xc00];
int color = 16 + (attributes & 0x0f);
@@ -198,7 +198,7 @@ static TILE_GET_INFO( get_text_info )
static TILE_GET_INFO( get_tile_info0_bootleg )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
UINT8 attributes = state->page[0][tile_index];
int bank = 4 * ((state->vreg & 0x0f) - 1);
int number, pal, color;
@@ -231,7 +231,7 @@ static TILE_GET_INFO( get_tile_info0_bootleg )
static TILE_GET_INFO( get_tile_info1_bootleg )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
UINT8 attributes = state->page[1][tile_index];
int bank = 4*((state->vreg >> 4) - 1);
int number, pal, color;
@@ -264,7 +264,7 @@ static TILE_GET_INFO( get_tile_info1_bootleg )
static TILE_GET_INFO( get_text_info_bootleg )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
// UINT8 attributes = state->page[0][tile_index + 0x800];
int number = state->page[0][tile_index + 0xc00];
int color = 16;// + (attributes & 0x0f);
@@ -284,7 +284,7 @@ static TILE_GET_INFO( get_text_info_bootleg )
VIDEO_START( combatsc )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32);
@@ -305,7 +305,7 @@ VIDEO_START( combatsc )
VIDEO_START( combatscb )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0_bootleg, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1_bootleg, tilemap_scan_rows, 8, 8, 32, 32);
@@ -333,13 +333,13 @@ VIDEO_START( combatscb )
READ8_HANDLER( combatsc_video_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( combatsc_video_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->videoram[offset] = data;
if (offset < 0x800)
@@ -357,7 +357,7 @@ WRITE8_HANDLER( combatsc_video_w )
WRITE8_HANDLER( combatsc_pf_control_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
device_t *k007121 = state->video_circuit ? state->k007121_2 : state->k007121_1;
k007121_ctrl_w(k007121, offset, data);
@@ -375,13 +375,13 @@ WRITE8_HANDLER( combatsc_pf_control_w )
READ8_HANDLER( combatsc_scrollram_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
return state->scrollram[offset];
}
WRITE8_HANDLER( combatsc_scrollram_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->scrollram[offset] = data;
}
@@ -393,22 +393,22 @@ WRITE8_HANDLER( combatsc_scrollram_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit, UINT32 pri_mask )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit, UINT32 pri_mask )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
+ combatsc_state *state = machine.driver_data<combatsc_state>();
device_t *k007121 = circuit ? state->k007121_2 : state->k007121_1;
int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, 6) & 0x10) * 2;
- k007121_sprites_draw(k007121, bitmap, cliprect, machine->gfx[circuit], machine->colortable, source, base_color, 0, 0, pri_mask);
+ k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[circuit], machine.colortable, source, base_color, 0, 0, pri_mask);
}
SCREEN_UPDATE( combatsc )
{
- combatsc_state *state = screen->machine->driver_data<combatsc_state>();
+ combatsc_state *state = screen->machine().driver_data<combatsc_state>();
int i;
- set_pens(screen->machine);
+ set_pens(screen->machine());
if (k007121_ctrlram_r(state->k007121_1, 1) & 0x02)
{
@@ -437,7 +437,7 @@ SCREEN_UPDATE( combatsc )
tilemap_set_scrolly(state->bg_tilemap[0], 0, k007121_ctrlram_r(state->k007121_1, 2));
tilemap_set_scrolly(state->bg_tilemap[1], 0, k007121_ctrlram_r(state->k007121_2, 2));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->priority == 0)
{
@@ -447,8 +447,8 @@ SCREEN_UPDATE( combatsc )
tilemap_draw(bitmap, cliprect, state->bg_tilemap[0], 1, 2);
/* we use the priority buffer so sprites are drawn front to back */
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram[1], 1, 0x0f00);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram[0], 0, 0x4444);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram[1], 1, 0x0f00);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram[0], 0, 0x4444);
}
else
{
@@ -458,8 +458,8 @@ SCREEN_UPDATE( combatsc )
tilemap_draw(bitmap, cliprect, state->bg_tilemap[1], 0, 8);
/* we use the priority buffer so sprites are drawn front to back */
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram[1], 1, 0x0f00);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram[0], 0, 0x4444);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram[1], 1, 0x0f00);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram[0], 0, 0x4444);
}
if (k007121_ctrlram_r(state->k007121_1, 1) & 0x08)
@@ -515,10 +515,10 @@ byte #4:
***************************************************************************/
-static void bootleg_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit )
+static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- const gfx_element *gfx = machine->gfx[circuit + 2];
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ const gfx_element *gfx = machine.gfx[circuit + 2];
int limit = circuit ? (space->read_byte(0xc2) * 256 + space->read_byte(0xc3)) : (space->read_byte(0xc0) * 256 + space->read_byte(0xc1));
const UINT8 *finish;
@@ -563,10 +563,10 @@ static void bootleg_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( combatscb )
{
- combatsc_state *state = screen->machine->driver_data<combatsc_state>();
+ combatsc_state *state = screen->machine().driver_data<combatsc_state>();
int i;
- set_pens(screen->machine);
+ set_pens(screen->machine());
for (i = 0; i < 32; i++)
{
@@ -579,16 +579,16 @@ SCREEN_UPDATE( combatscb )
if (state->priority == 0)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap[1], TILEMAP_DRAW_OPAQUE, 0);
- bootleg_draw_sprites(screen->machine, bitmap,cliprect, state->page[0], 0);
+ bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->page[0], 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[0], 0 ,0);
- bootleg_draw_sprites(screen->machine, bitmap,cliprect, state->page[1], 1);
+ bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->page[1], 1);
}
else
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap[0], TILEMAP_DRAW_OPAQUE, 0);
- bootleg_draw_sprites(screen->machine, bitmap,cliprect, state->page[0], 0);
+ bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->page[0], 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[1], 0, 0);
- bootleg_draw_sprites(screen->machine, bitmap,cliprect, state->page[1], 1);
+ bootleg_draw_sprites(screen->machine(), bitmap,cliprect, state->page[1], 1);
}
tilemap_draw(bitmap, cliprect, state->textlayer, 0, 0);
diff --git a/src/mame/video/commando.c b/src/mame/video/commando.c
index f452df2150b..45b14a3eec3 100644
--- a/src/mame/video/commando.c
+++ b/src/mame/video/commando.c
@@ -12,7 +12,7 @@
WRITE8_HANDLER( commando_videoram_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -20,7 +20,7 @@ WRITE8_HANDLER( commando_videoram_w )
WRITE8_HANDLER( commando_colorram_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -28,7 +28,7 @@ WRITE8_HANDLER( commando_colorram_w )
WRITE8_HANDLER( commando_videoram2_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -36,7 +36,7 @@ WRITE8_HANDLER( commando_videoram2_w )
WRITE8_HANDLER( commando_colorram2_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -44,7 +44,7 @@ WRITE8_HANDLER( commando_colorram2_w )
WRITE8_HANDLER( commando_scrollx_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->scroll_x[offset] = data;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x[0] | (state->scroll_x[1] << 8));
@@ -52,7 +52,7 @@ WRITE8_HANDLER( commando_scrollx_w )
WRITE8_HANDLER( commando_scrolly_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
state->scroll_y[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y[0] | (state->scroll_y[1] << 8));
@@ -60,22 +60,22 @@ WRITE8_HANDLER( commando_scrolly_w )
WRITE8_HANDLER( commando_c804_w )
{
- commando_state *state = space->machine->driver_data<commando_state>();
+ commando_state *state = space->machine().driver_data<commando_state>();
// bits 0 and 1 are coin counters
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
// bit 4 resets the sound CPU
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
// bit 7 flips screen
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x0f;
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
int attr = state->colorram2[tile_index];
int code = state->videoram2[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x0f;
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( commando )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -105,12 +105,12 @@ VIDEO_START( commando )
tilemap_set_transparent_pen(state->fg_tilemap, 3);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
- for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4; offs >= 0; offs -= 4)
{
// bit 1 of attr is not used
int attr = buffered_spriteram[offs + 1];
@@ -131,23 +131,23 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
if (bank < 3)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 15);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2], code, color, flipx, flipy, sx, sy, 15);
}
}
SCREEN_UPDATE( commando )
{
- commando_state *state = screen->machine->driver_data<commando_state>();
+ commando_state *state = screen->machine().driver_data<commando_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
SCREEN_EOF( commando )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/compgolf.c b/src/mame/video/compgolf.c
index 0de45a35df5..cd23a0b417a 100644
--- a/src/mame/video/compgolf.c
+++ b/src/mame/video/compgolf.c
@@ -13,7 +13,7 @@ PALETTE_INIT( compgolf )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0,bit1,bit2,r,g,b;
bit0 = (color_prom[i] >> 0) & 0x01;
@@ -35,21 +35,21 @@ PALETTE_INIT( compgolf )
WRITE8_HANDLER( compgolf_video_w )
{
- compgolf_state *state = space->machine->driver_data<compgolf_state>();
+ compgolf_state *state = space->machine().driver_data<compgolf_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->text_tilemap, offset / 2);
}
WRITE8_HANDLER( compgolf_back_w )
{
- compgolf_state *state = space->machine->driver_data<compgolf_state>();
+ compgolf_state *state = space->machine().driver_data<compgolf_state>();
state->bg_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_text_info )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
tile_index <<= 1;
SET_TILE_INFO(2, state->videoram[tile_index + 1] | (state->videoram[tile_index] << 8), state->videoram[tile_index] >> 2, 0);
}
@@ -62,7 +62,7 @@ static TILEMAP_MAPPER( back_scan )
static TILE_GET_INFO( get_back_info )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
int attr = state->bg_ram[tile_index * 2];
int code = state->bg_ram[tile_index * 2 + 1] + ((attr & 1) << 8);
int color = (attr & 0x3e) >> 1;
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_back_info )
VIDEO_START( compgolf )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
state->bg_tilemap = tilemap_create(machine, get_back_info, back_scan, 16, 16, 32, 32);
state->text_tilemap = tilemap_create(machine, get_text_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -90,9 +90,9 @@ xx------ xxxxxxxx -------- -------- sprite code
-----x-- -------- -------- -------- Flip X
-------- -------- -------- -------- Flip Y(used?)
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
int offs, fx, fy, x, y, color, sprite;
for (offs = 0; offs < 0x60; offs += 4)
@@ -104,14 +104,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
fx = state->spriteram[offs] & 4;
fy = 0; /* ? */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite,
color,fx,fy,x,y,0);
/* Double Height */
if(state->spriteram[offs] & 0x10)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite + 1,
color, fx, fy, x, y + 16, 0);
}
@@ -120,7 +120,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( compgolf )
{
- compgolf_state *state = screen->machine->driver_data<compgolf_state>();
+ compgolf_state *state = screen->machine().driver_data<compgolf_state>();
int scrollx = state->scrollx_hi + state->scrollx_lo;
int scrolly = state->scrolly_hi + state->scrolly_lo;
@@ -129,6 +129,6 @@ SCREEN_UPDATE( compgolf )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c
index 14ccb41f208..f5a98566f73 100644
--- a/src/mame/video/contra.c
+++ b/src/mame/video/contra.c
@@ -25,7 +25,7 @@ PALETTE_INIT( contra )
int chip;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x80);
+ machine.colortable = colortable_alloc(machine, 0x80);
for (chip = 0; chip < 2; chip++)
{
@@ -45,16 +45,16 @@ PALETTE_INIT( contra )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
int i;
for (i = 0x00; i < 0x100; i += 2)
@@ -63,7 +63,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -77,7 +77,7 @@ static void set_pens( running_machine *machine )
static TILE_GET_INFO( get_fg_tile_info )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121_1, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121_1, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121_1, 5);
@@ -106,7 +106,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121_2, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121_2, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121_2, 5);
@@ -136,7 +136,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121_1, 5);
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_1, 6);
int attr = state->tx_cram[tile_index];
@@ -166,7 +166,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( contra )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -175,12 +175,12 @@ VIDEO_START( contra )
state->buffered_spriteram = auto_alloc_array(machine, UINT8, 0x800);
state->buffered_spriteram_2 = auto_alloc_array(machine, UINT8, 0x800);
- state->bg_clip = machine->primary_screen->visible_area();
+ state->bg_clip = machine.primary_screen->visible_area();
state->bg_clip.min_x += 40;
state->fg_clip = state->bg_clip;
- state->tx_clip = machine->primary_screen->visible_area();
+ state->tx_clip = machine.primary_screen->visible_area();
state->tx_clip.max_x = 39;
state->tx_clip.min_x = 0;
@@ -199,7 +199,7 @@ VIDEO_START( contra )
WRITE8_HANDLER( contra_fg_vram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->fg_vram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -207,7 +207,7 @@ WRITE8_HANDLER( contra_fg_vram_w )
WRITE8_HANDLER( contra_fg_cram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->fg_cram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -215,7 +215,7 @@ WRITE8_HANDLER( contra_fg_cram_w )
WRITE8_HANDLER( contra_bg_vram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->bg_vram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -223,7 +223,7 @@ WRITE8_HANDLER( contra_bg_vram_w )
WRITE8_HANDLER( contra_bg_cram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->bg_cram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -231,7 +231,7 @@ WRITE8_HANDLER( contra_bg_cram_w )
WRITE8_HANDLER( contra_text_vram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->tx_vram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -239,7 +239,7 @@ WRITE8_HANDLER( contra_text_vram_w )
WRITE8_HANDLER( contra_text_cram_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
state->tx_cram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -247,7 +247,7 @@ WRITE8_HANDLER( contra_text_cram_w )
WRITE8_HANDLER( contra_K007121_ctrl_0_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_1, 6);
if (offset == 3)
@@ -272,7 +272,7 @@ WRITE8_HANDLER( contra_K007121_ctrl_0_w )
WRITE8_HANDLER( contra_K007121_ctrl_1_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_2, 6);
if (offset == 3)
@@ -301,9 +301,9 @@ WRITE8_HANDLER( contra_K007121_ctrl_1_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank )
{
- contra_state *state = machine->driver_data<contra_state>();
+ contra_state *state = machine.driver_data<contra_state>();
device_t *k007121 = bank ? state->k007121_2 : state->k007121_1;
int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
const UINT8 *source;
@@ -313,12 +313,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
else
source = state->buffered_spriteram_2;
- k007121_sprites_draw(k007121, bitmap, cliprect, machine->gfx[bank], machine->colortable, source, base_color, 40, 0, (UINT32)-1);
+ k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[bank], machine.colortable, source, base_color, 40, 0, (UINT32)-1);
}
SCREEN_UPDATE( contra )
{
- contra_state *state = screen->machine->driver_data<contra_state>();
+ contra_state *state = screen->machine().driver_data<contra_state>();
UINT8 ctrl_1_0 = k007121_ctrlram_r(state->k007121_1, 0);
UINT8 ctrl_1_2 = k007121_ctrlram_r(state->k007121_1, 2);
UINT8 ctrl_2_0 = k007121_ctrlram_r(state->k007121_2, 0);
@@ -331,7 +331,7 @@ SCREEN_UPDATE( contra )
sect_rect(&fg_finalclip, cliprect);
sect_rect(&tx_finalclip, cliprect);
- set_pens(screen->machine);
+ set_pens(screen->machine());
tilemap_set_scrollx(state->fg_tilemap, 0, ctrl_1_0 - 40);
tilemap_set_scrolly(state->fg_tilemap, 0, ctrl_1_2);
@@ -340,8 +340,8 @@ SCREEN_UPDATE( contra )
tilemap_draw(bitmap, &bg_finalclip, state->bg_tilemap, 0 ,0);
tilemap_draw(bitmap, &fg_finalclip, state->fg_tilemap, 0 ,0);
- draw_sprites(screen->machine,bitmap,cliprect, 0);
- draw_sprites(screen->machine,bitmap,cliprect, 1);
+ draw_sprites(screen->machine(),bitmap,cliprect, 0);
+ draw_sprites(screen->machine(),bitmap,cliprect, 1);
tilemap_draw(bitmap, &tx_finalclip, state->tx_tilemap, 0 ,0);
return 0;
}
diff --git a/src/mame/video/cop01.c b/src/mame/video/cop01.c
index e322f3849ad..13d4855affb 100644
--- a/src/mame/video/cop01.c
+++ b/src/mame/video/cop01.c
@@ -15,7 +15,7 @@ PALETTE_INIT( cop01 )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -24,7 +24,7 @@ PALETTE_INIT( cop01 )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -32,7 +32,7 @@ PALETTE_INIT( cop01 )
/* characters use colors 0x00-0x0f (or 0x00-0x7f, but the eight rows are identical) */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* background tiles use colors 0xc0-0xff */
/* I don't know how much of the lookup table PROM is hooked up, */
@@ -41,14 +41,14 @@ PALETTE_INIT( cop01 )
{
UINT8 ctabentry = 0xc0 | ((i - 0x10) & 0x30) |
(color_prom[(((i - 0x10) & 0x40) >> 2) | ((i - 0x10) & 0x0f)] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 0x80-0x8f (or 0x80-0xbf, but the four rows are identical) */
for (i = 0x90; i < 0x190; i++)
{
UINT8 ctabentry = 0x80 | (color_prom[i - 0x90 + 0x100] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -62,7 +62,7 @@ PALETTE_INIT( cop01 )
static TILE_GET_INFO( get_bg_tile_info )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
int tile = state->bgvideoram[tile_index];
int attr = state->bgvideoram[tile_index + 0x800];
int pri = (attr & 0x80) >> 7;
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
int tile = state->fgvideoram[tile_index];
SET_TILE_INFO(0, tile, 0, 0);
}
@@ -101,7 +101,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( cop01 )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows, 8, 8, 32, 32);
@@ -122,14 +122,14 @@ VIDEO_START( cop01 )
WRITE8_HANDLER( cop01_background_w )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x7ff);
}
WRITE8_HANDLER( cop01_foreground_w )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -147,14 +147,14 @@ WRITE8_HANDLER( cop01_vreg_w )
* -------x msb xscroll
* 0x43: xxxxxxxx yscroll
*/
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
state->vreg[offset] = data;
if (offset == 0)
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
- flip_screen_set(space->machine, data & 4);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
+ flip_screen_set(space->machine(), data & 4);
}
}
@@ -166,9 +166,9 @@ WRITE8_HANDLER( cop01_vreg_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
int offs, code, attr, sx, sy, flipx, flipy, color;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -197,7 +197,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (code & 0x80)
code += (state->vreg[0] & 0x30) << 3;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -208,12 +208,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( cop01 )
{
- cop01_state *state = screen->machine->driver_data<cop01_state>();
+ cop01_state *state = screen->machine().driver_data<cop01_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->vreg[1] + 256 * (state->vreg[2] & 1));
tilemap_set_scrolly(state->bg_tilemap, 0, state->vreg[3]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0 );
return 0;
diff --git a/src/mame/video/copsnrob.c b/src/mame/video/copsnrob.c
index 9c770da51bb..46c3cd3d573 100644
--- a/src/mame/video/copsnrob.c
+++ b/src/mame/video/copsnrob.c
@@ -10,7 +10,7 @@
SCREEN_UPDATE( copsnrob )
{
- copsnrob_state *state = screen->machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = screen->machine().driver_data<copsnrob_state>();
int offs, x, y;
/* redrawing the entire display is faster in this case */
@@ -22,7 +22,7 @@ SCREEN_UPDATE( copsnrob )
sx = 31 - (offs % 32);
sy = offs / 32;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs] & 0x3f,0,
0,0,
8*sx,8*sy);
@@ -31,25 +31,25 @@ SCREEN_UPDATE( copsnrob )
/* Draw the cars. Positioning was based on a screen shot */
if (state->cary[0])
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->carimage[0],0,
1,0,
0xe4,256 - state->cary[0],0);
if (state->cary[1])
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->carimage[1],0,
1,0,
0xc4,256 - state->cary[1],0);
if (state->cary[2])
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->carimage[2],0,
0,0,
0x24,256 - state->cary[2],0);
if (state->cary[3])
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->carimage[3],0,
0,0,
0x04,256 - state->cary[3],0);
@@ -78,7 +78,7 @@ SCREEN_UPDATE( copsnrob )
{
/* We've hit a truck's back end, so draw the truck. The front
end may be off the top of the screen, but we don't care. */
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
0,0,
0,0,
0x80,256 - (y + 31),0);
@@ -90,7 +90,7 @@ SCREEN_UPDATE( copsnrob )
{
/* We missed a truck's back end (it was off the bottom of the
screen) but have hit its front end, so draw the truck. */
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
0,0,
0,0,
0x80,256 - y,0);
diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c
index bb99addf543..61e0c240233 100644
--- a/src/mame/video/cosmic.c
+++ b/src/mame/video/cosmic.c
@@ -12,16 +12,16 @@
WRITE8_HANDLER( cosmic_color_register_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
state->color_registers[offset] = data ? 1 : 0;
}
-static pen_t panic_map_color( running_machine *machine, UINT8 x, UINT8 y )
+static pen_t panic_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->color_registers[0] << 9) | (state->color_registers[2] << 10) | ((x >> 4) << 5) | (y >> 3);
- pen_t pen = machine->region("user1")->base()[offs];
+ pen_t pen = machine.region("user1")->base()[offs];
if (state->color_registers[1])
pen >>= 4;
@@ -29,11 +29,11 @@ static pen_t panic_map_color( running_machine *machine, UINT8 x, UINT8 y )
return pen & 0x0f;
}
-static pen_t cosmica_map_color( running_machine *machine, UINT8 x, UINT8 y )
+static pen_t cosmica_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->color_registers[0] << 9) | ((x >> 4) << 5) | (y >> 3);
- pen_t pen = machine->region("user1")->base()[offs];
+ pen_t pen = machine.region("user1")->base()[offs];
if (state->color_registers[1]) // 0 according to the schematics, but that breaks alien formation colors
pen >>= 4;
@@ -41,21 +41,21 @@ static pen_t cosmica_map_color( running_machine *machine, UINT8 x, UINT8 y )
return pen & 0x07;
}
-static pen_t cosmicg_map_color( running_machine *machine, UINT8 x, UINT8 y )
+static pen_t cosmicg_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->color_registers[0] << 8) | (state->color_registers[1] << 9) | ((y >> 4) << 4) | (x >> 4);
- pen_t pen = machine->region("user1")->base()[offs];
+ pen_t pen = machine.region("user1")->base()[offs];
/* the upper 4 bits are for cocktail mode support */
return pen & 0x0f;
}
-static pen_t magspot_map_color( running_machine *machine, UINT8 x, UINT8 y )
+static pen_t magspot_map_color( running_machine &machine, UINT8 x, UINT8 y )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs = (state->color_registers[0] << 9) | ((x >> 3) << 4) | (y >> 4);
- pen_t pen = machine->region("user1")->base()[offs];
+ pen_t pen = machine.region("user1")->base()[offs];
if (state->color_registers[1])
pen >>= 4;
@@ -78,11 +78,11 @@ static pen_t magspot_map_color( running_machine *machine, UINT8 x, UINT8 y )
PALETTE_INIT( panic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -91,18 +91,18 @@ PALETTE_INIT( panic )
int g = pal1bit(i >> 1);
int b = ((i & 0x0c) == 0x08) ? 0xaa : pal1bit(i >> 2);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* background uses colors 0x00-0x0f */
for (i = 0; i < 0x0f; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites use colors 0x00-0x07 */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
state->map_color = panic_map_color;
@@ -120,32 +120,32 @@ PALETTE_INIT( panic )
PALETTE_INIT( cosmica )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x08);
+ machine.colortable = colortable_alloc(machine, 0x08);
/* create a lookup table for the palette */
for (i = 0; i < 0x08; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine->colortable, i, color);
+ colortable_palette_set_color(machine.colortable, i, color);
}
/* background and sprites use colors 0x00-0x07 */
for (i = 0; i < 0x08; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
for (i = 0x08; i < 0x28; i++)
{
UINT8 ctabentry;
ctabentry = (color_prom[i - 0x08] >> 0) & 0x07;
- colortable_entry_set_value(machine->colortable, i + 0x00, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x00, ctabentry);
ctabentry = (color_prom[i - 0x08] >> 4) & 0x07;
- colortable_entry_set_value(machine->colortable, i + 0x20, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x20, ctabentry);
}
state->map_color = cosmica_map_color;
@@ -163,10 +163,10 @@ PALETTE_INIT( cosmica )
*/
PALETTE_INIT( cosmicg )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int r = (i > 8) ? 0xff : 0xaa * ((i >> 0) & 1);
int g = 0xaa * ((i >> 1) & 1);
@@ -181,11 +181,11 @@ PALETTE_INIT( cosmicg )
PALETTE_INIT( magspot )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -194,18 +194,18 @@ PALETTE_INIT( magspot )
int g = pal1bit(i >> 1);
int b = pal1bit(i >> 2);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* background uses colors 0x00-0x0f */
for (i = 0; i < 0x0f; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites use colors 0x00-0x0f */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
state->map_color = magspot_map_color;
@@ -215,28 +215,28 @@ PALETTE_INIT( magspot )
PALETTE_INIT( nomnlnd )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine->colortable, i, color);
+ colortable_palette_set_color(machine.colortable, i, color);
}
/* background uses colors 0x00-0x07 */
for (i = 0; i < 0x07; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites use colors 0x00-0x07 */
for (i = 0x10; i < 0x30; i++)
{
UINT8 ctabentry = color_prom[i - 0x10] & 0x07;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
state->map_color = magspot_map_color;
@@ -246,14 +246,14 @@ PALETTE_INIT( nomnlnd )
WRITE8_HANDLER( cosmic_background_enable_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
state->background_enable = data;
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -283,9 +283,9 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int extra_sprites )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int extra_sprites )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
int offs;
for (offs = state->spriteram_size - 4;offs >= 0;offs -= 4)
@@ -302,13 +302,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (state->spriteram[offs] & 0x80)
/* 16x16 sprite */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code, color,
0, ~state->spriteram[offs] & 0x40,
256-state->spriteram[offs + 2],state->spriteram[offs + 1],0);
else
/* 32x32 sprite */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code >> 2, color,
0, ~state->spriteram[offs] & 0x40,
256-state->spriteram[offs + 2],state->spriteram[offs + 1],0);
@@ -321,7 +321,7 @@ static void cosmica_draw_starfield( screen_device *screen, bitmap_t *bitmap, con
{
UINT8 y = 0;
UINT8 map = 0;
- UINT8 *PROM = screen->machine->region("user2")->base();
+ UINT8 *PROM = screen->machine().region("user2")->base();
while (1)
{
@@ -335,7 +335,7 @@ static void cosmica_draw_starfield( screen_device *screen, bitmap_t *bitmap, con
UINT8 x1;
int hc, hb_;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
x1 = x - screen->frame_number();
else
x1 = x + screen->frame_number();
@@ -366,11 +366,11 @@ static void cosmica_draw_starfield( screen_device *screen, bitmap_t *bitmap, con
}
-static void devzone_draw_grid( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
UINT8 y;
- UINT8 *horz_PROM = machine->region("user2")->base();
- UINT8 *vert_PROM = machine->region("user3")->base();
+ UINT8 *horz_PROM = machine.region("user2")->base();
+ UINT8 *vert_PROM = machine.region("user3")->base();
offs_t horz_addr = 0;
UINT8 count = 0;
@@ -428,7 +428,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co
{
UINT8 y = 0;
UINT8 water = screen->frame_number();
- UINT8 *PROM = screen->machine->region("user2")->base();
+ UINT8 *PROM = screen->machine().region("user2")->base();
/* all positioning is via logic gates:
@@ -491,7 +491,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co
if ((!hd_) & hc_ & (!hb_))
{
offs_t offs = ((x >> 3) & 0x03) | ((y & 0x1f) << 2) |
- (flip_screen_get(screen->machine) ? 0x80 : 0);
+ (flip_screen_get(screen->machine()) ? 0x80 : 0);
UINT8 plane1 = PROM[offs ] << (x & 0x07);
UINT8 plane2 = PROM[offs | 0x0400] << (x & 0x07);
@@ -525,7 +525,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co
if (color != 0)
{
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
*BITMAP_ADDR16(bitmap, 255-y, 255-x) = color;
else
*BITMAP_ADDR16(bitmap, y, x) = color;
@@ -549,7 +549,7 @@ static void nomnlnd_draw_background( screen_device *screen, bitmap_t *bitmap, co
SCREEN_UPDATE( cosmicg )
{
bitmap_fill(bitmap, cliprect, 0);
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -557,8 +557,8 @@ SCREEN_UPDATE( cosmicg )
SCREEN_UPDATE( panic )
{
bitmap_fill(bitmap, cliprect, 0);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0x07, 1);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 1);
return 0;
}
@@ -567,8 +567,8 @@ SCREEN_UPDATE( cosmica )
{
bitmap_fill(bitmap, cliprect, 0);
cosmica_draw_starfield(screen, bitmap, cliprect);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0f, 0);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0);
return 0;
}
@@ -576,37 +576,37 @@ SCREEN_UPDATE( cosmica )
SCREEN_UPDATE( magspot )
{
bitmap_fill(bitmap, cliprect, 0);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0x07, 0);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0);
return 0;
}
SCREEN_UPDATE( devzone )
{
- cosmic_state *state = screen->machine->driver_data<cosmic_state>();
+ cosmic_state *state = screen->machine().driver_data<cosmic_state>();
bitmap_fill(bitmap, cliprect, 0);
if (state->background_enable)
- devzone_draw_grid(screen->machine, bitmap, cliprect);
+ devzone_draw_grid(screen->machine(), bitmap, cliprect);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0x07, 0);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0);
return 0;
}
SCREEN_UPDATE( nomnlnd )
{
- cosmic_state *state = screen->machine->driver_data<cosmic_state>();
+ cosmic_state *state = screen->machine().driver_data<cosmic_state>();
/* according to the video summation logic on pg4, the trees and river
have the highest priority */
bitmap_fill(bitmap, cliprect, 0);
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0x07, 0);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x07, 0);
if (state->background_enable)
nomnlnd_draw_background(screen, bitmap, cliprect);
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index 3d638ee7b59..e8daeb5a38a 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -1463,13 +1463,13 @@ CPS1 VIDEO RENDERER
#define CPS2_OBJ_YOFFS 0x0a /* Y offset (always 0x0010) */
-static void cps1_build_palette(running_machine *machine, const UINT16* const palette_base);
+static void cps1_build_palette(running_machine &machine, const UINT16* const palette_base);
static MACHINE_RESET( cps )
{
- cps_state *state = machine->driver_data<cps_state>();
- const char *gamename = machine->system().name;
+ cps_state *state = machine.driver_data<cps_state>();
+ const char *gamename = machine.system().name;
const struct CPS1config *pCFG = &cps1_config_table[0];
while (pCFG->name)
@@ -1501,14 +1501,14 @@ static MACHINE_RESET( cps )
if (strcmp(gamename, "sf2rb") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0xe5464 / 2] = 0x6012;
}
if (strcmp(gamename, "sf2rb2") == 0)
{
/* Patch out protection check */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0xe5332 / 2] = 0x6014;
}
@@ -1519,13 +1519,13 @@ static MACHINE_RESET( cps )
by the cpu core as a 32-bit branch. This branch would make the
game crash (address error, since it would branch to an odd address)
if location 180ca6 (outside ROM space) isn't 0. Protection check? */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x11756 / 2] = 0x4e71;
}
else if (strcmp(gamename, "ghouls") == 0)
{
/* Patch out self-test... it takes forever */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x61964 / 2] = 0x4ef9;
rom[0x61966 / 2] = 0x0000;
rom[0x61968 / 2] = 0x0400;
@@ -1534,9 +1534,9 @@ static MACHINE_RESET( cps )
}
-INLINE UINT16 *cps1_base( running_machine *machine, int offset, int boundary )
+INLINE UINT16 *cps1_base( running_machine &machine, int offset, int boundary )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int base = state->cps_a_regs[offset] * 256;
/*
@@ -1555,7 +1555,7 @@ INLINE UINT16 *cps1_base( running_machine *machine, int offset, int boundary )
WRITE16_HANDLER( cps1_cps_a_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
data = COMBINE_DATA(&state->cps_a_regs[offset]);
/*
@@ -1567,7 +1567,7 @@ WRITE16_HANDLER( cps1_cps_a_w )
fixes glitches in the ghouls intro, but it might happen at next vblank.
*/
if (offset == CPS1_PALETTE_BASE)
- cps1_build_palette(space->machine, cps1_base(space->machine, CPS1_PALETTE_BASE, state->palette_align));
+ cps1_build_palette(space->machine(), cps1_base(space->machine(), CPS1_PALETTE_BASE, state->palette_align));
// pzloop2 write to register 24 on startup. This is probably just a bug.
if (offset == 0x24 / 2 && state->cps_version == 2)
@@ -1582,7 +1582,7 @@ WRITE16_HANDLER( cps1_cps_a_w )
READ16_HANDLER( cps1_cps_b_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
/* Some games interrogate a couple of registers on bootup. */
/* These are CPS1 board B self test checks. They wander from game to */
@@ -1602,10 +1602,10 @@ READ16_HANDLER( cps1_cps_b_r )
state->cps_b_regs[state->game_config->mult_factor2 / 2]) >> 16;
if (offset == state->game_config->in2_addr / 2) /* Extra input ports (on C-board) */
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
if (offset == state->game_config->in3_addr / 2) /* Player 4 controls (on C-board) ("Captain Commando") */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
if (state->cps_version == 2)
{
@@ -1626,7 +1626,7 @@ READ16_HANDLER( cps1_cps_b_r )
WRITE16_HANDLER( cps1_cps_b_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
data = COMBINE_DATA(&state->cps_b_regs[offset]);
if (state->cps_version == 2)
@@ -1657,15 +1657,15 @@ WRITE16_HANDLER( cps1_cps_b_w )
{
if (state->game_config->cpsb_value == 0x0402) // Mercs (CN2 connector)
{
- coin_lockout_w(space->machine, 2, ~data & 0x01);
- set_led_status(space->machine, 0, data & 0x02);
- set_led_status(space->machine, 1, data & 0x04);
- set_led_status(space->machine, 2, data & 0x08);
+ coin_lockout_w(space->machine(), 2, ~data & 0x01);
+ set_led_status(space->machine(), 0, data & 0x02);
+ set_led_status(space->machine(), 1, data & 0x04);
+ set_led_status(space->machine(), 2, data & 0x08);
}
else // kod, captcomm, knights
{
- coin_lockout_w(space->machine, 2, ~data & 0x02);
- coin_lockout_w(space->machine, 3, ~data & 0x08);
+ coin_lockout_w(space->machine(), 2, ~data & 0x02);
+ coin_lockout_w(space->machine(), 3, ~data & 0x08);
}
}
}
@@ -1691,18 +1691,18 @@ WRITE16_HANDLER( cps1_cps_b_w )
-INLINE int cps2_port( running_machine *machine, int offset )
+INLINE int cps2_port( running_machine &machine, int offset )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
return state->output[offset / 2];
}
-static void cps1_gfx_decode( running_machine *machine )
+static void cps1_gfx_decode( running_machine &machine )
{
- int size = machine->region("gfx")->bytes();
+ int size = machine.region("gfx")->bytes();
int i, j, gfxsize;
- UINT8 *cps1_gfx = machine->region("gfx")->base();
+ UINT8 *cps1_gfx = machine.region("gfx")->base();
gfxsize = size / 4;
@@ -1753,14 +1753,14 @@ static void unshuffle( UINT64 *buf, int len )
}
}
-static void cps2_gfx_decode( running_machine *machine )
+static void cps2_gfx_decode( running_machine &machine )
{
const int banksize = 0x200000;
- int size = machine->region("gfx")->bytes();
+ int size = machine.region("gfx")->bytes();
int i;
for (i = 0; i < size; i += banksize)
- unshuffle((UINT64 *)(machine->region("gfx")->base() + i), banksize / 8);
+ unshuffle((UINT64 *)(machine.region("gfx")->base() + i), banksize / 8);
cps1_gfx_decode(machine);
}
@@ -1768,7 +1768,7 @@ static void cps2_gfx_decode( running_machine *machine )
DRIVER_INIT( cps1 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
cps1_gfx_decode(machine);
@@ -1784,7 +1784,7 @@ DRIVER_INIT( cps1 )
DRIVER_INIT( cps2_video )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
cps2_gfx_decode(machine);
@@ -1798,9 +1798,9 @@ DRIVER_INIT( cps2_video )
}
-void cps1_get_video_base( running_machine *machine )
+void cps1_get_video_base( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int layercontrol, videocontrol, scroll1xoff, scroll2xoff, scroll3xoff;
/* Re-calculate the VIDEO RAM base */
@@ -1893,7 +1893,7 @@ void cps1_get_video_base( running_machine *machine )
WRITE16_HANDLER( cps1_gfxram_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
int page = (offset >> 7) & 0x3c0;
COMBINE_DATA(&state->gfxram[offset]);
@@ -1909,9 +1909,9 @@ WRITE16_HANDLER( cps1_gfxram_w )
-static int gfxrom_bank_mapper( running_machine *machine, int type, int code )
+static int gfxrom_bank_mapper( running_machine &machine, int type, int code )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
const struct gfx_range *range = state->game_config->bank_mapper;
int shift = 0;
@@ -1980,7 +1980,7 @@ static TILEMAP_MAPPER( tilemap2_scan )
static TILE_GET_INFO( get_tile0_info )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int code = state->scroll1[2 * tile_index];
int attr = state->scroll1[2 * tile_index + 1];
int gfxset;
@@ -2007,7 +2007,7 @@ static TILE_GET_INFO( get_tile0_info )
static TILE_GET_INFO( get_tile1_info )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int code = state->scroll2[2 * tile_index];
int attr = state->scroll2[2 * tile_index + 1];
@@ -2027,7 +2027,7 @@ static TILE_GET_INFO( get_tile1_info )
static TILE_GET_INFO( get_tile2_info )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int code = state->scroll3[2 * tile_index] & 0x3fff;
int attr = state->scroll3[2 * tile_index + 1];
@@ -2048,9 +2048,9 @@ static TILE_GET_INFO( get_tile2_info )
-static void cps1_update_transmasks( running_machine *machine )
+static void cps1_update_transmasks( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int i;
for (i = 0; i < 4; i++)
@@ -2076,7 +2076,7 @@ static STATE_POSTLOAD( cps_postload )
static VIDEO_START( cps )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int i;
MACHINE_RESET_CALL(cps);
@@ -2170,12 +2170,12 @@ static VIDEO_START( cps )
state->save_pointer(NAME(state->cps2_buffered_obj), state->cps2_obj_size / 2);
}
- machine->state().register_postload(cps_postload, NULL);
+ machine.state().register_postload(cps_postload, NULL);
}
VIDEO_START( cps1 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
state->cps_version = 1;
VIDEO_START_CALL(cps);
@@ -2183,7 +2183,7 @@ VIDEO_START( cps1 )
VIDEO_START( cps2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
state->cps_version = 2;
VIDEO_START_CALL(cps);
@@ -2197,9 +2197,9 @@ VIDEO_START( cps2 )
***************************************************************************/
-static void cps1_build_palette( running_machine *machine, const UINT16* const palette_base )
+static void cps1_build_palette( running_machine &machine, const UINT16* const palette_base )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int offset, page;
const UINT16 *palette_ram = palette_base;
int ctrl = state->cps_b_regs[state->game_config->palette_control/2];
@@ -2275,9 +2275,9 @@ static void cps1_build_palette( running_machine *machine, const UINT16* const pa
***************************************************************************/
-static void cps1_find_last_sprite( running_machine *machine ) /* Find the offset of last sprite */
+static void cps1_find_last_sprite( running_machine &machine ) /* Find the offset of last sprite */
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int offset = 0;
/* Locate the end of table marker */
while (offset < state->obj_size / 2)
@@ -2297,26 +2297,26 @@ static void cps1_find_last_sprite( running_machine *machine ) /* Find the off
}
-static void cps1_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void cps1_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \
{ \
if (flip_screen_get(machine)) \
pdrawgfx_transpen(bitmap,\
- cliprect,machine->gfx[2], \
+ cliprect,machine.gfx[2], \
CODE, \
COLOR, \
!(FLIPX),!(FLIPY), \
- 511-16-(SX),255-16-(SY), machine->priority_bitmap,0x02,15); \
+ 511-16-(SX),255-16-(SY), machine.priority_bitmap,0x02,15); \
else \
pdrawgfx_transpen(bitmap,\
- cliprect,machine->gfx[2], \
+ cliprect,machine.gfx[2], \
CODE, \
COLOR, \
FLIPX,FLIPY, \
- SX,SY, machine->priority_bitmap,0x02,15); \
+ SX,SY, machine.priority_bitmap,0x02,15); \
}
@@ -2458,7 +2458,7 @@ static void cps1_render_sprites( running_machine *machine, bitmap_t *bitmap, con
WRITE16_HANDLER( cps2_objram_bank_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
state->objram_bank = data & 1;
@@ -2466,7 +2466,7 @@ WRITE16_HANDLER( cps2_objram_bank_w )
READ16_HANDLER( cps2_objram1_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->objram_bank & 1)
return state->objram2[offset];
else
@@ -2475,7 +2475,7 @@ READ16_HANDLER( cps2_objram1_r )
READ16_HANDLER( cps2_objram2_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->objram_bank & 1)
return state->objram1[offset];
else
@@ -2484,7 +2484,7 @@ READ16_HANDLER( cps2_objram2_r )
WRITE16_HANDLER( cps2_objram1_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->objram_bank & 1)
COMBINE_DATA(&state->objram2[offset]);
else
@@ -2493,16 +2493,16 @@ WRITE16_HANDLER( cps2_objram1_w )
WRITE16_HANDLER( cps2_objram2_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->objram_bank & 1)
COMBINE_DATA(&state->objram1[offset]);
else
COMBINE_DATA(&state->objram2[offset]);
}
-static UINT16 *cps2_objbase( running_machine *machine )
+static UINT16 *cps2_objbase( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int baseptr;
baseptr = 0x7000;
@@ -2518,9 +2518,9 @@ static UINT16 *cps2_objbase( running_machine *machine )
}
-static void cps2_find_last_sprite( running_machine *machine ) /* Find the offset of last sprite */
+static void cps2_find_last_sprite( running_machine &machine ) /* Find the offset of last sprite */
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int offset = 0;
UINT16 *base = state->cps2_buffered_obj;
@@ -2540,26 +2540,26 @@ static void cps2_find_last_sprite( running_machine *machine ) /* Find the off
state->cps2_last_sprite_offset = state->cps2_obj_size / 2 - 4;
}
-static void cps2_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks )
+static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
#define DRAWSPRITE(CODE,COLOR,FLIPX,FLIPY,SX,SY) \
{ \
if (flip_screen_get(machine)) \
pdrawgfx_transpen(bitmap,\
- cliprect,machine->gfx[2], \
+ cliprect,machine.gfx[2], \
CODE, \
COLOR, \
!(FLIPX),!(FLIPY), \
- 511-16-(SX),255-16-(SY), machine->priority_bitmap,primasks[priority],15); \
+ 511-16-(SX),255-16-(SY), machine.priority_bitmap,primasks[priority],15); \
else \
pdrawgfx_transpen(bitmap,\
- cliprect,machine->gfx[2], \
+ cliprect,machine.gfx[2], \
CODE, \
COLOR, \
FLIPX,FLIPY, \
- SX,SY, machine->priority_bitmap,primasks[priority],15); \
+ SX,SY, machine.priority_bitmap,primasks[priority],15); \
}
int i;
@@ -2691,9 +2691,9 @@ static void cps2_render_sprites( running_machine *machine, bitmap_t *bitmap, con
static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int offs;
- UINT8 *stars_rom = screen->machine->region("stars")->base();
+ UINT8 *stars_rom = screen->machine().region("stars")->base();
if (!stars_rom && (state->stars_enabled[0] || state->stars_enabled[1]))
{
@@ -2714,7 +2714,7 @@ static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const re
int sy = (offs % 256);
sx = (sx - state->stars2x + (col & 0x1f)) & 0x1ff;
sy = (sy - state->stars2y) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 511 - sx;
sy = 255 - sy;
@@ -2740,7 +2740,7 @@ static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const re
int sy = (offs % 256);
sx = (sx - state->stars1x + (col & 0x1f)) & 0x1ff;
sy = (sy - state->stars1y) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 511 - sx;
sy = 255 - sy;
@@ -2757,9 +2757,9 @@ static void cps1_render_stars( screen_device *screen, bitmap_t *bitmap, const re
}
-static void cps1_render_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
+static void cps1_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
case 0:
@@ -2773,9 +2773,9 @@ static void cps1_render_layer( running_machine *machine, bitmap_t *bitmap, const
}
}
-static void cps1_render_high_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
case 0:
@@ -2798,26 +2798,26 @@ static void cps1_render_high_layer( running_machine *machine, bitmap_t *bitmap,
SCREEN_UPDATE( cps1 )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int layercontrol, l0, l1, l2, l3;
int videocontrol = state->cps_a_regs[CPS1_VIDEOCONTROL];
- flip_screen_set(screen->machine, videocontrol & 0x8000);
+ flip_screen_set(screen->machine(), videocontrol & 0x8000);
layercontrol = state->cps_b_regs[state->game_config->layer_control / 2];
/* Get video memory base registers */
- cps1_get_video_base(screen->machine);
+ cps1_get_video_base(screen->machine());
/* Find the offset of the last sprite in the sprite table */
- cps1_find_last_sprite(screen->machine);
+ cps1_find_last_sprite(screen->machine());
if (state->cps_version == 2)
{
- cps2_find_last_sprite(screen->machine);
+ cps2_find_last_sprite(screen->machine());
}
- cps1_update_transmasks(screen->machine);
+ cps1_update_transmasks(screen->machine());
tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x);
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y);
@@ -2859,7 +2859,7 @@ SCREEN_UPDATE( cps1 )
// Maybe Capcom changed the background handling due to the problems that
// it caused on several monitors (because the background extended into the
// blanking area instead of going black, causing the monitor to clip).
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
}
cps1_render_stars(screen, bitmap, cliprect);
@@ -2869,26 +2869,26 @@ SCREEN_UPDATE( cps1 )
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->cps_version == 1)
{
- cps1_render_layer(screen->machine, bitmap, cliprect, l0, 0);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l0, 0);
if (l1 == 0)
- cps1_render_high_layer(screen->machine, bitmap, cliprect, l0); /* prepare mask for sprites */
+ cps1_render_high_layer(screen->machine(), bitmap, cliprect, l0); /* prepare mask for sprites */
- cps1_render_layer(screen->machine, bitmap, cliprect, l1, 0);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l1, 0);
if (l2 == 0)
- cps1_render_high_layer(screen->machine, bitmap, cliprect, l1); /* prepare mask for sprites */
+ cps1_render_high_layer(screen->machine(), bitmap, cliprect, l1); /* prepare mask for sprites */
- cps1_render_layer(screen->machine, bitmap, cliprect, l2, 0);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l2, 0);
if (l3 == 0)
- cps1_render_high_layer(screen->machine, bitmap, cliprect, l2); /* prepare mask for sprites */
+ cps1_render_high_layer(screen->machine(), bitmap, cliprect, l2); /* prepare mask for sprites */
- cps1_render_layer(screen->machine, bitmap, cliprect, l3, 0);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l3, 0);
}
else
{
@@ -2900,15 +2900,15 @@ SCREEN_UPDATE( cps1 )
l3pri = (state->pri_ctrl >> 4 * l3) & 0x0f;
#if 0
-if ( (cps2_port(screen->machine, CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen->machine, CPS2_OBJ_BASE) != 0x7000) ||
- cps2_port(screen->machine, CPS2_OBJ_UK1) != 0x807d ||
- (cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen->machine, CPS2_OBJ_UK2) != 0x0001))
+if ( (cps2_port(screen->machine(), CPS2_OBJ_BASE) != 0x7080 && cps2_port(screen->machine(), CPS2_OBJ_BASE) != 0x7000) ||
+ cps2_port(screen->machine(), CPS2_OBJ_UK1) != 0x807d ||
+ (cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x0000 && cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x1101 && cps2_port(screen->machine(), CPS2_OBJ_UK2) != 0x0001))
popmessage("base %04x uk1 %04x uk2 %04x",
- cps2_port(screen->machine, CPS2_OBJ_BASE),
- cps2_port(screen->machine, CPS2_OBJ_UK1),
- cps2_port(screen->machine, CPS2_OBJ_UK2));
+ cps2_port(screen->machine(), CPS2_OBJ_BASE),
+ cps2_port(screen->machine(), CPS2_OBJ_UK1),
+ cps2_port(screen->machine(), CPS2_OBJ_UK2));
-if (0 && input_code_pressed(screen->machine, KEYCODE_Z))
+if (0 && input_code_pressed(screen->machine(), KEYCODE_Z))
popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri);
#endif
@@ -2939,10 +2939,10 @@ if (0 && input_code_pressed(screen->machine, KEYCODE_Z))
}
}
- cps1_render_layer(screen->machine, bitmap, cliprect, l0, 1);
- cps1_render_layer(screen->machine, bitmap, cliprect, l1, 2);
- cps1_render_layer(screen->machine, bitmap, cliprect, l2, 4);
- cps2_render_sprites(screen->machine, bitmap, cliprect, primasks);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l0, 1);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l1, 2);
+ cps1_render_layer(screen->machine(), bitmap, cliprect, l2, 4);
+ cps2_render_sprites(screen->machine(), bitmap, cliprect, primasks);
}
return 0;
@@ -2950,7 +2950,7 @@ if (0 && input_code_pressed(screen->machine, KEYCODE_Z))
SCREEN_EOF( cps1 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
/* Get video memory base registers */
cps1_get_video_base(machine);
@@ -2962,15 +2962,15 @@ SCREEN_EOF( cps1 )
}
}
-void cps2_set_sprite_priorities( running_machine *machine )
+void cps2_set_sprite_priorities( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
state->pri_ctrl = cps2_port(machine, CPS2_OBJ_PRI);
}
-void cps2_objram_latch( running_machine *machine )
+void cps2_objram_latch( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
cps2_set_sprite_priorities(machine);
memcpy(state->cps2_buffered_obj, cps2_objbase(machine), state->cps2_obj_size);
}
diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c
index f9ba08903db..a73bfb3a9b4 100644
--- a/src/mame/video/crbaloon.c
+++ b/src/mame/video/crbaloon.c
@@ -27,7 +27,7 @@ PALETTE_INIT( crbaloon )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
UINT8 pen;
int h, r, g, b;
@@ -49,21 +49,21 @@ PALETTE_INIT( crbaloon )
WRITE8_HANDLER( crbaloon_videoram_w )
{
- crbaloon_state *state = space->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = space->machine().driver_data<crbaloon_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( crbaloon_colorram_w )
{
- crbaloon_state *state = space->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = space->machine().driver_data<crbaloon_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index] & 0x0f;
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( crbaloon )
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32);
state->save_item(NAME(state->collision_address));
@@ -80,30 +80,30 @@ VIDEO_START( crbaloon )
}
-UINT16 crbaloon_get_collision_address(running_machine *machine)
+UINT16 crbaloon_get_collision_address(running_machine &machine)
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
return state->collision_address_clear ? 0xffff : state->collision_address;
}
-void crbaloon_set_clear_collision_address(running_machine *machine, int _crbaloon_collision_address_clear)
+void crbaloon_set_clear_collision_address(running_machine &machine, int _crbaloon_collision_address_clear)
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
state->collision_address_clear = !_crbaloon_collision_address_clear; /* active LO */
}
-static void draw_sprite_and_check_collision(running_machine *machine, bitmap_t *bitmap)
+static void draw_sprite_and_check_collision(running_machine &machine, bitmap_t *bitmap)
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
int y;
UINT8 code = state->spriteram[0] & 0x0f;
UINT8 color = state->spriteram[0] >> 4;
UINT8 sy = state->spriteram[2] - 32;
- UINT8 *gfx = machine->region("gfx2")->base() + (code << 7);
+ UINT8 *gfx = machine.region("gfx2")->base() + (code << 7);
if (flip_screen_get(machine))
@@ -150,10 +150,10 @@ static void draw_sprite_and_check_collision(running_machine *machine, bitmap_t *
SCREEN_UPDATE( crbaloon )
{
- crbaloon_state *state = screen->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = screen->machine().driver_data<crbaloon_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprite_and_check_collision(screen->machine, bitmap);
+ draw_sprite_and_check_collision(screen->machine(), bitmap);
return 0;
}
diff --git a/src/mame/video/crgolf.c b/src/mame/video/crgolf.c
index 8bbfbe0580d..5b95b2b2558 100644
--- a/src/mame/video/crgolf.c
+++ b/src/mame/video/crgolf.c
@@ -20,7 +20,7 @@
WRITE8_HANDLER( crgolf_videoram_w )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
if (*state->screen_select & 1)
state->videoram_b[offset] = data;
@@ -31,7 +31,7 @@ WRITE8_HANDLER( crgolf_videoram_w )
READ8_HANDLER( crgolf_videoram_r )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
UINT8 ret;
if (*state->screen_select & 1)
@@ -50,10 +50,10 @@ READ8_HANDLER( crgolf_videoram_r )
*
*************************************/
-static void get_pens( running_machine *machine, pen_t *pens )
+static void get_pens( running_machine &machine, pen_t *pens )
{
offs_t offs;
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
for (offs = 0; offs < NUM_PENS; offs++)
{
@@ -92,7 +92,7 @@ static void get_pens( running_machine *machine, pen_t *pens )
static VIDEO_START( crgolf )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
/* allocate memory for the two bitmaps */
state->videoram_a = auto_alloc_array(machine, UINT8, VIDEORAM_SIZE);
@@ -113,13 +113,13 @@ static VIDEO_START( crgolf )
static SCREEN_UPDATE( crgolf )
{
- crgolf_state *state = screen->machine->driver_data<crgolf_state>();
+ crgolf_state *state = screen->machine().driver_data<crgolf_state>();
int flip = *state->screen_flip & 1;
offs_t offs;
pen_t pens[NUM_PENS];
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
/* for each byte in the video RAM */
for (offs = 0; offs < VIDEORAM_SIZE / 3; offs++)
diff --git a/src/mame/video/crimfght.c b/src/mame/video/crimfght.c
index 59959fee6f2..93045a8ff8c 100644
--- a/src/mame/video/crimfght.c
+++ b/src/mame/video/crimfght.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void crimfght_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void crimfght_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- crimfght_state *state = machine->driver_data<crimfght_state>();
+ crimfght_state *state = machine.driver_data<crimfght_state>();
*flags = (*color & 0x20) ? TILE_FLIPX : 0;
*code |= ((*color & 0x1f) << 8) | (bank << 13);
@@ -24,13 +24,13 @@ void crimfght_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void crimfght_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void crimfght_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
/* Weird priority scheme. Why use three bits when two would suffice? */
/* The PROM allows for mixed priorities, where sprites would have */
/* priority over text but not on one or both of the other two planes. */
/* Luckily, this isn't used by the game. */
- crimfght_state *state = machine->driver_data<crimfght_state>();
+ crimfght_state *state = machine.driver_data<crimfght_state>();
switch (*color & 0x70)
{
@@ -57,16 +57,16 @@ void crimfght_sprite_callback( running_machine *machine, int *code, int *color,
VIDEO_START( crimfght )
{
- crimfght_state *state = machine->driver_data<crimfght_state>();
+ crimfght_state *state = machine.driver_data<crimfght_state>();
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400);
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 4;
state->layer_colorbase[2] = 8;
state->sprite_colorbase = 16;
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x400);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x400);
}
@@ -79,7 +79,7 @@ VIDEO_START( crimfght )
SCREEN_UPDATE( crimfght )
{
- crimfght_state *state = screen->machine->driver_data<crimfght_state>();
+ crimfght_state *state = screen->machine().driver_data<crimfght_state>();
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/crospang.c b/src/mame/video/crospang.c
index d2531318f9f..4e82aed58db 100644
--- a/src/mame/video/crospang.c
+++ b/src/mame/video/crospang.c
@@ -14,7 +14,7 @@
WRITE16_HANDLER( bestri_tilebank_w)
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
state->bestri_tilebank = (data>>10) & 0xf;
//printf("bestri %04x\n", data);
@@ -26,7 +26,7 @@ WRITE16_HANDLER( bestri_tilebank_w)
WRITE16_HANDLER ( bestri_bg_scrolly_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
/* Very Strange */
int scroll = (data & 0x3ff) ^ 0x0155;
@@ -35,7 +35,7 @@ WRITE16_HANDLER ( bestri_bg_scrolly_w )
WRITE16_HANDLER ( bestri_fg_scrolly_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
/* Very Strange */
int scroll = (data & 0x3ff) ^ 0x00ab;
@@ -44,7 +44,7 @@ WRITE16_HANDLER ( bestri_fg_scrolly_w )
WRITE16_HANDLER ( bestri_fg_scrollx_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
// printf("fg_layer x %04x\n",data);
tilemap_set_scrollx(state->fg_layer, 0, data + 32);
@@ -52,7 +52,7 @@ WRITE16_HANDLER ( bestri_fg_scrollx_w )
WRITE16_HANDLER ( bestri_bg_scrollx_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
// printf("bg_layer x %04x\n",data);
tilemap_set_scrollx(state->bg_layer, 0, data - 60);
@@ -61,46 +61,46 @@ WRITE16_HANDLER ( bestri_bg_scrollx_w )
WRITE16_HANDLER ( crospang_fg_scrolly_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
tilemap_set_scrolly(state->fg_layer, 0, data + 8);
}
WRITE16_HANDLER ( crospang_bg_scrolly_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
tilemap_set_scrolly(state->bg_layer, 0, data + 8);
}
WRITE16_HANDLER ( crospang_fg_scrollx_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
tilemap_set_scrollx(state->fg_layer, 0, data);
}
WRITE16_HANDLER ( crospang_bg_scrollx_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
tilemap_set_scrollx(state->bg_layer, 0, data + 4);
}
WRITE16_HANDLER ( crospang_fg_videoram_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_layer, offset);
}
WRITE16_HANDLER ( crospang_bg_videoram_w )
{
- crospang_state *state = space->machine->driver_data<crospang_state>();
+ crospang_state *state = space->machine().driver_data<crospang_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_layer, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
int data = state->bg_videoram[tile_index];
int tile = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -110,7 +110,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
int data = state->fg_videoram[tile_index];
int tile = data & 0xfff;
int color = (data >> 12) & 0x0f;
@@ -140,9 +140,9 @@ static TILE_GET_INFO( get_fg_tile_info )
*/
/* jumpkids / tumbleb.c! */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
int offs;
int flipscreen = 0;
@@ -156,7 +156,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = state->spriteram[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = state->spriteram[offs + 2];
@@ -195,7 +195,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
while (multi >= 0)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite - multi * inc,
colour,
fx, fy,
@@ -208,7 +208,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
VIDEO_START( crospang )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
state->bg_layer = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_layer = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -217,9 +217,9 @@ VIDEO_START( crospang )
SCREEN_UPDATE( crospang )
{
- crospang_state *state = screen->machine->driver_data<crospang_state>();
+ crospang_state *state = screen->machine().driver_data<crospang_state>();
tilemap_draw(bitmap, cliprect, state->bg_layer, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_layer, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/crshrace.c b/src/mame/video/crshrace.c
index 03eb9a18ef6..285f8e527fe 100644
--- a/src/mame/video/crshrace.c
+++ b/src/mame/video/crshrace.c
@@ -11,7 +11,7 @@
static TILE_GET_INFO( get_tile_info1 )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
int code = state->videoram1[tile_index];
SET_TILE_INFO(1, (code & 0xfff) + (state->roz_bank << 12), code >> 12, 0);
@@ -19,7 +19,7 @@ static TILE_GET_INFO( get_tile_info1 )
static TILE_GET_INFO( get_tile_info2 )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
int code = state->videoram2[tile_index];
SET_TILE_INFO(0, code, 0, 0);
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_tile_info2 )
VIDEO_START( crshrace )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
state->tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 16, 16, 64, 64);
state->tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8, 8, 64, 64);
@@ -52,7 +52,7 @@ VIDEO_START( crshrace )
WRITE16_HANDLER( crshrace_videoram1_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->tilemap1, offset);
@@ -60,7 +60,7 @@ WRITE16_HANDLER( crshrace_videoram1_w )
WRITE16_HANDLER( crshrace_videoram2_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->tilemap2, offset);
@@ -68,7 +68,7 @@ WRITE16_HANDLER( crshrace_videoram2_w )
WRITE16_HANDLER( crshrace_roz_bank_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
if (ACCESSING_BITS_0_7)
{
@@ -83,7 +83,7 @@ WRITE16_HANDLER( crshrace_roz_bank_w )
WRITE16_HANDLER( crshrace_gfxctrl_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
if (ACCESSING_BITS_0_7)
{
@@ -99,11 +99,11 @@ WRITE16_HANDLER( crshrace_gfxctrl_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
- UINT16 *buffered_spriteram_2 = machine->generic.buffered_spriteram2.u16;
+ crshrace_state *state = machine.driver_data<crshrace_state>();
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram_2 = machine.generic.buffered_spriteram2.u16;
int offs;
offs = 0;
@@ -132,7 +132,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
zoomx = 16 - zoomtable[zoomx] / 8;
zoomy = 16 - zoomtable[zoomy] / 8;
- if (buffered_spriteram[attr_start + 2] & 0x20ff) color = machine->rand();
+ if (buffered_spriteram[attr_start + 2] & 0x20ff) color = machine.rand();
for (y = 0; y <= ysize; y++)
{
@@ -152,14 +152,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
map_start++;
if (state->flipscreen)
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
!flipx,!flipy,
304-sx,208-sy,
0x1000 * zoomx,0x1000 * zoomy,15);
else
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -171,27 +171,27 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
-static void draw_bg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
tilemap_draw(bitmap, cliprect, state->tilemap2, 0, 0);
}
-static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->tilemap1, 0, 0, 1);
}
SCREEN_UPDATE( crshrace )
{
- crshrace_state *state = screen->machine->driver_data<crshrace_state>();
+ crshrace_state *state = screen->machine().driver_data<crshrace_state>();
if (state->gfxctrl & 0x04) /* display disable? */
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -200,15 +200,15 @@ SCREEN_UPDATE( crshrace )
switch (state->gfxctrl & 0xfb)
{
case 0x00: /* high score screen */
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bg(screen->machine, bitmap, cliprect);
- draw_fg(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bg(screen->machine(), bitmap, cliprect);
+ draw_fg(screen->machine(), bitmap, cliprect);
break;
case 0x01:
case 0x02:
- draw_bg(screen->machine, bitmap, cliprect);
- draw_fg(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_bg(screen->machine(), bitmap, cliprect);
+ draw_fg(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
break;
default:
popmessage("gfxctrl = %02x", state->gfxctrl);
@@ -219,7 +219,7 @@ SCREEN_UPDATE( crshrace )
SCREEN_EOF( crshrace )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
buffer_spriteram16_2_w(space, 0, 0, 0xffff);
diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c
index c988d1526bb..09de78e667e 100644
--- a/src/mame/video/cvs.c
+++ b/src/mame/video/cvs.c
@@ -32,7 +32,7 @@ PALETTE_INIT( cvs )
int i, attr;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* color mapping PROM */
for (attr = 0; attr < 0x100; attr++)
@@ -44,31 +44,31 @@ PALETTE_INIT( cvs )
/* bits 0 and 2 are swapped */
ctabentry = BITSWAP8(ctabentry,7,6,5,4,3,0,1,2);
- colortable_entry_set_value(machine->colortable, (attr << 3) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (attr << 3) | i, ctabentry);
}
}
/* background collision map */
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine->colortable, 0x800 + i, 0);
- colortable_entry_set_value(machine->colortable, 0x808 + i, i & 0x04);
- colortable_entry_set_value(machine->colortable, 0x810 + i, i & 0x02);
- colortable_entry_set_value(machine->colortable, 0x818 + i, i & 0x06);
+ colortable_entry_set_value(machine.colortable, 0x800 + i, 0);
+ colortable_entry_set_value(machine.colortable, 0x808 + i, i & 0x04);
+ colortable_entry_set_value(machine.colortable, 0x810 + i, i & 0x02);
+ colortable_entry_set_value(machine.colortable, 0x818 + i, i & 0x06);
}
/* sprites */
for (i = 0; i < 8; i++)
- colortable_entry_set_value(machine->colortable, SPRITE_PEN_BASE + i, i | 0x08);
+ colortable_entry_set_value(machine.colortable, SPRITE_PEN_BASE + i, i | 0x08);
/* bullet */
- colortable_entry_set_value(machine->colortable, BULLET_STAR_PEN, 7);
+ colortable_entry_set_value(machine.colortable, BULLET_STAR_PEN, 7);
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
int i;
for (i = 0; i < 0x10; i++)
@@ -77,7 +77,7 @@ static void set_pens( running_machine *machine )
int g = pal3bit(~state->palette_ram[i] >> 2);
int b = pal3bit(~state->palette_ram[i] >> 5);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
}
@@ -85,7 +85,7 @@ static void set_pens( running_machine *machine )
WRITE8_HANDLER( cvs_video_fx_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (data & 0xce)
logerror("%4x : CVS: Unimplemented CVS video fx = %2x\n",cpu_get_pc(space->cpu), data & 0xce);
@@ -96,8 +96,8 @@ WRITE8_HANDLER( cvs_video_fx_w )
if (data & 0x04) logerror(" SCREEN ROTATE\n");
if (data & 0x08) logerror(" SHADE BRIGHTER TO LEFT\n");
- set_led_status(space->machine, 1, data & 0x10); /* lamp 1 */
- set_led_status(space->machine, 2, data & 0x20); /* lamp 2 */
+ set_led_status(space->machine(), 1, data & 0x10); /* lamp 1 */
+ set_led_status(space->machine(), 2, data & 0x20); /* lamp 2 */
if (data & 0x40) logerror(" SHADE BRIGHTER TO BOTTOM\n");
if (data & 0x80) logerror(" SHADE BRIGHTER TO TOP\n");
@@ -107,13 +107,13 @@ WRITE8_HANDLER( cvs_video_fx_w )
READ8_HANDLER( cvs_collision_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
return state->collision_register;
}
READ8_HANDLER( cvs_collision_clear )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
state->collision_register = 0;
return 0;
}
@@ -121,14 +121,14 @@ READ8_HANDLER( cvs_collision_clear )
WRITE8_HANDLER( cvs_scroll_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
state->scroll_reg = 255 - data;
}
VIDEO_START( cvs )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
int generator = 0;
int y;
@@ -169,9 +169,9 @@ VIDEO_START( cvs )
}
/* create helper bitmaps */
- state->background_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->collision_background = machine->primary_screen->alloc_compatible_bitmap();
- state->scrolled_collision_background = machine->primary_screen->alloc_compatible_bitmap();
+ state->background_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->collision_background = machine.primary_screen->alloc_compatible_bitmap();
+ state->scrolled_collision_background = machine.primary_screen->alloc_compatible_bitmap();
/* register save */
state->save_item(NAME(*state->background_bitmap));
@@ -180,22 +180,22 @@ VIDEO_START( cvs )
}
-void cvs_scroll_stars( running_machine *machine )
+void cvs_scroll_stars( running_machine &machine )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
state->stars_scroll++;
}
SCREEN_UPDATE( cvs )
{
- cvs_state *state = screen->machine->driver_data<cvs_state>();
+ cvs_state *state = screen->machine().driver_data<cvs_state>();
static const int ram_based_char_start_indices[] = { 0xe0, 0xc0, 0x100, 0x80 };
offs_t offs;
int scroll[8];
bitmap_t *s2636_0_bitmap, *s2636_1_bitmap, *s2636_2_bitmap;
- set_pens(screen->machine);
+ set_pens(screen->machine());
/* draw the background */
for (offs = 0; offs < 0x0400; offs++)
@@ -209,7 +209,7 @@ SCREEN_UPDATE( cvs )
int gfxnum = (code < ram_based_char_start_indices[state->character_banking_mode]) ? 0 : 1;
- drawgfx_opaque(state->background_bitmap, 0, screen->machine->gfx[gfxnum],
+ drawgfx_opaque(state->background_bitmap, 0, screen->machine().gfx[gfxnum],
code, color,
0, 0,
x, y);
@@ -225,7 +225,7 @@ SCREEN_UPDATE( cvs )
collision_color = 0x102;
}
- drawgfx_opaque(state->collision_background, 0, screen->machine->gfx[gfxnum],
+ drawgfx_opaque(state->collision_background, 0, screen->machine().gfx[gfxnum],
code, collision_color,
0, 0,
x, y);
@@ -267,7 +267,7 @@ SCREEN_UPDATE( cvs )
state->collision_register |= 0x08;
/* Bullet/Background Collision */
- if (colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(state->scrolled_collision_background, offs, bx)))
+ if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->scrolled_collision_background, offs, bx)))
state->collision_register |= 0x80;
*BITMAP_ADDR16(bitmap, offs, bx) = BULLET_STAR_PEN;
@@ -302,7 +302,7 @@ SCREEN_UPDATE( cvs )
if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) state->collision_register |= 0x04;
/* S2636 vs. background collision detection */
- if (colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(state->scrolled_collision_background, y, x)))
+ if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->scrolled_collision_background, y, x)))
{
if (S2636_IS_PIXEL_DRAWN(pixel0)) state->collision_register |= 0x10;
if (S2636_IS_PIXEL_DRAWN(pixel1)) state->collision_register |= 0x20;
@@ -323,14 +323,14 @@ SCREEN_UPDATE( cvs )
if ((y & 1) ^ ((x >> 4) & 1))
{
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
x = ~x;
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
y = ~y;
if ((y >= cliprect->min_y) && (y <= cliprect->max_y) &&
- (colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0))
+ (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0))
*BITMAP_ADDR16(bitmap, y, x) = BULLET_STAR_PEN;
}
}
diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c
index a1e8461ba38..0a87ee0e44c 100644
--- a/src/mame/video/cyberbal.c
+++ b/src/mame/video/cyberbal.c
@@ -21,7 +21,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0xfff;
int color = (data >> 12) & 0x07;
@@ -31,7 +31,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_alpha2_tile_info )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
UINT16 data = state->alpha2[tile_index];
int code = data & 0xfff;
int color = (data >> 12) & 0x07;
@@ -41,7 +41,7 @@ static TILE_GET_INFO( get_alpha2_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
UINT16 data = state->playfield[tile_index];
int code = data & 0x1fff;
int color = (data >> 11) & 0x0f;
@@ -51,7 +51,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
static TILE_GET_INFO( get_playfield2_tile_info )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
UINT16 data = state->playfield2[tile_index];
int code = data & 0x1fff;
int color = (data >> 11) & 0x0f;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_playfield2_tile_info )
*
*************************************/
-static void video_start_cyberbal_common(running_machine* machine, int screens)
+static void video_start_cyberbal_common(running_machine &machine, int screens)
{
static const atarimo_desc mo0desc =
{
@@ -141,7 +141,7 @@ static void video_start_cyberbal_common(running_machine* machine, int screens)
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
/* set the slip variables */
atarimo_0_slipram = &state->current_slip[0];
@@ -207,7 +207,7 @@ VIDEO_START( cyberbal2p )
*
*************************************/
-INLINE void set_palette_entry(running_machine *machine, int entry, UINT16 value)
+INLINE void set_palette_entry(running_machine &machine, int entry, UINT16 value)
{
int r, g, b;
@@ -228,28 +228,28 @@ INLINE void set_palette_entry(running_machine *machine, int entry, UINT16 value)
WRITE16_HANDLER( cyberbal_paletteram_0_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
COMBINE_DATA(&state->paletteram_0[offset]);
- set_palette_entry(space->machine, offset, state->paletteram_0[offset]);
+ set_palette_entry(space->machine(), offset, state->paletteram_0[offset]);
}
READ16_HANDLER( cyberbal_paletteram_0_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
return state->paletteram_0[offset];
}
WRITE16_HANDLER( cyberbal_paletteram_1_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
COMBINE_DATA(&state->paletteram_1[offset]);
- set_palette_entry(space->machine, offset + 0x800, state->paletteram_1[offset]);
+ set_palette_entry(space->machine(), offset + 0x800, state->paletteram_1[offset]);
}
READ16_HANDLER( cyberbal_paletteram_1_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
return state->paletteram_1[offset];
}
@@ -263,12 +263,12 @@ READ16_HANDLER( cyberbal_paletteram_1_r )
void cyberbal_scanline_update(screen_device &screen, int scanline)
{
- cyberbal_state *state = screen.machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = screen.machine().driver_data<cyberbal_state>();
int i;
screen_device *update_screen;
/* loop over screens */
- for (i = 0, update_screen = screen.machine->first_screen(); update_screen != NULL; i++, update_screen = update_screen->next_screen())
+ for (i = 0, update_screen = screen.machine().first_screen(); update_screen != NULL; i++, update_screen = update_screen->next_screen())
{
UINT16 *vram = i ? state->alpha2 : state->alpha;
UINT16 *base = &vram[((scanline - 8) / 8) * 64 + 47];
@@ -335,7 +335,7 @@ void cyberbal_scanline_update(screen_device &screen, int scanline)
static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
{
- cyberbal_state *state = screen.machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = screen.machine().driver_data<cyberbal_state>();
atarimo_rect_list rectlist;
rectangle tempclip = *cliprect;
bitmap_t *mobitmap;
@@ -343,9 +343,9 @@ static void update_one_screen(screen_device &screen, bitmap_t *bitmap, const rec
rectangle visarea = screen.visible_area();
/* for 2p games, the left screen is the main screen */
- device_t *left_screen = screen.machine->device("lscreen");
+ device_t *left_screen = screen.machine().device("lscreen");
if (left_screen == NULL)
- left_screen = screen.machine->device("screen");
+ left_screen = screen.machine().device("screen");
/* draw the playfield */
tilemap_draw(bitmap, cliprect, (&screen == left_screen) ? state->playfield_tilemap : state->playfield2_tilemap, 0, 0);
diff --git a/src/mame/video/darius.c b/src/mame/video/darius.c
index e78e9119325..c763a4bcbe8 100644
--- a/src/mame/video/darius.c
+++ b/src/mame/video/darius.c
@@ -4,7 +4,7 @@
/***************************************************************************/
-INLINE void actual_get_fg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum )
+INLINE void actual_get_fg_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum )
{
UINT16 code = (ram[tile_index + 0x2000] & 0x7ff);
UINT16 attr = ram[tile_index];
@@ -18,7 +18,7 @@ INLINE void actual_get_fg_tile_info( running_machine *machine, tile_data *tilein
static TILE_GET_INFO( get_fg_tile_info )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
actual_get_fg_tile_info(machine, tileinfo, tile_index, state->fg_ram, 2);
}
@@ -26,7 +26,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( darius )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,128,64);
@@ -37,7 +37,7 @@ VIDEO_START( darius )
WRITE16_HANDLER( darius_fg_layer_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
COMBINE_DATA(&state->fg_ram[offset]);
if (offset < 0x4000)
@@ -46,9 +46,9 @@ WRITE16_HANDLER( darius_fg_layer_w )
/***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
UINT16 *spriteram = state->spriteram;
int offs, curx, cury;
UINT16 code, data, sx, sy;
@@ -82,7 +82,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (curx > 900) curx -= 1024;
if (cury > 400) cury -= 512;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code, color,
flipx, flipy,
curx, cury, 0);
@@ -94,7 +94,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( darius )
{
- darius_state *state = screen->machine->driver_data<darius_state>();
+ darius_state *state = screen->machine().driver_data<darius_state>();
int xoffs = 0;
if (screen == state->lscreen)
@@ -110,12 +110,12 @@ SCREEN_UPDATE( darius )
pc080sn_tilemap_draw_offset(state->pc080sn, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0, -xoffs, 0);
/* Sprites can be under/over the layer below text layer */
- draw_sprites(screen->machine, bitmap, cliprect, 0, xoffs, -8); // draw sprites with priority 0 which are under the mid layer
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, xoffs, -8); // draw sprites with priority 0 which are under the mid layer
// draw middle layer
pc080sn_tilemap_draw_offset(state->pc080sn, bitmap, cliprect, 1, 0, 0, -xoffs, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1, xoffs, -8); // draw sprites with priority 1 which are over the mid layer
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, xoffs, -8); // draw sprites with priority 1 which are over the mid layer
/* top(text) layer is in fixed position */
tilemap_set_scrollx(state->fg_tilemap, 0, 0 + xoffs);
diff --git a/src/mame/video/darkmist.c b/src/mame/video/darkmist.c
index c1d99e69eeb..29d376699f2 100644
--- a/src/mame/video/darkmist.c
+++ b/src/mame/video/darkmist.c
@@ -15,8 +15,8 @@ static TILE_GET_INFO( get_bgtile_info )
{
int code,attr,pal;
- code=machine->region("user1")->base()[tile_index]; /* TTTTTTTT */
- attr=machine->region("user2")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
+ code=machine.region("user1")->base()[tile_index]; /* TTTTTTTT */
+ attr=machine.region("user2")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
code+=(attr&3)<<8;
pal=(attr>>4);
@@ -31,8 +31,8 @@ static TILE_GET_INFO( get_fgtile_info )
{
int code,attr,pal;
- code=machine->region("user3")->base()[tile_index]; /* TTTTTTTT */
- attr=machine->region("user4")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
+ code=machine.region("user3")->base()[tile_index]; /* TTTTTTTT */
+ attr=machine.region("user4")->base()[tile_index]; /* -PPP--TT - FIXED BITS (0xxx00xx) */
pal=attr>>4;
code+=(attr&3)<<8;
@@ -50,7 +50,7 @@ static TILE_GET_INFO( get_fgtile_info )
static TILE_GET_INFO( get_txttile_info )
{
- darkmist_state *state = machine->driver_data<darkmist_state>();
+ darkmist_state *state = machine.driver_data<darkmist_state>();
UINT8 *videoram = state->videoram;
int code,attr,pal;
@@ -74,7 +74,7 @@ PALETTE_INIT(darkmist)
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x101);
+ machine.colortable = colortable_alloc(machine, 0x101);
for (i = 0; i < 0x400; i++)
{
@@ -95,31 +95,31 @@ PALETTE_INIT(darkmist)
}
}
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
int i;
for (i = 0; i < 0x100; i++)
{
- int r = pal4bit(machine->generic.paletteram.u8[i | 0x200] >> 0);
- int g = pal4bit(machine->generic.paletteram.u8[i | 0x000] >> 4);
- int b = pal4bit(machine->generic.paletteram.u8[i | 0x000] >> 0);
+ int r = pal4bit(machine.generic.paletteram.u8[i | 0x200] >> 0);
+ int g = pal4bit(machine.generic.paletteram.u8[i | 0x000] >> 4);
+ int b = pal4bit(machine.generic.paletteram.u8[i | 0x000] >> 0);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
- colortable_palette_set_color(machine->colortable, 0x100, RGB_BLACK);
+ colortable_palette_set_color(machine.colortable, 0x100, RGB_BLACK);
}
VIDEO_START(darkmist)
{
- darkmist_state *state = machine->driver_data<darkmist_state>();
+ darkmist_state *state = machine.driver_data<darkmist_state>();
state->bgtilemap = tilemap_create( machine, get_bgtile_info,tilemap_scan_rows,16,16,512,64 );
state->fgtilemap = tilemap_create( machine, get_fgtile_info,tilemap_scan_rows,16,16,64,256 );
state->txtilemap = tilemap_create( machine, get_txttile_info,tilemap_scan_rows,8,8,32,32 );
@@ -129,19 +129,19 @@ VIDEO_START(darkmist)
SCREEN_UPDATE( darkmist)
{
- darkmist_state *state = screen->machine->driver_data<darkmist_state>();
+ darkmist_state *state = screen->machine().driver_data<darkmist_state>();
UINT8 *spriteram = state->spriteram;
#define DM_GETSCROLL(n) (((state->scroll[(n)]<<1)&0xff) + ((state->scroll[(n)]&0x80)?1:0) +( ((state->scroll[(n)-1]<<4) | (state->scroll[(n)-1]<<12) )&0xff00))
- set_pens(screen->machine);
+ set_pens(screen->machine());
tilemap_set_scrollx(state->bgtilemap, 0, DM_GETSCROLL(0x2));
tilemap_set_scrolly(state->bgtilemap, 0, DM_GETSCROLL(0x6));
tilemap_set_scrollx(state->fgtilemap, 0, DM_GETSCROLL(0xa));
tilemap_set_scrolly(state->fgtilemap, 0, DM_GETSCROLL(0xe));
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if(state->hw & DISPLAY_BG)
tilemap_draw(bitmap,cliprect,state->bgtilemap, 0,0);
@@ -176,13 +176,13 @@ SCREEN_UPDATE( darkmist)
palette=((spriteram[i+1])>>1)&0xf;
if(spriteram[i+1]&0x1)
- palette=screen->machine->rand()&15;
+ palette=screen->machine().rand()&15;
palette+=32;
drawgfx_transpen(
bitmap,cliprect,
- screen->machine->gfx[2],
+ screen->machine().gfx[2],
tile,
palette,
fx,fy,
diff --git a/src/mame/video/darkseal.c b/src/mame/video/darkseal.c
index 4b09caddb15..3d229bb5c1d 100644
--- a/src/mame/video/darkseal.c
+++ b/src/mame/video/darkseal.c
@@ -27,27 +27,27 @@
/******************************************************************************/
-static void update_24bitcol(running_machine *machine, int offset)
+static void update_24bitcol(running_machine &machine, int offset)
{
int r,g,b;
- r = (machine->generic.paletteram.u16[offset] >> 0) & 0xff;
- g = (machine->generic.paletteram.u16[offset] >> 8) & 0xff;
- b = (machine->generic.paletteram2.u16[offset] >> 0) & 0xff;
+ r = (machine.generic.paletteram.u16[offset] >> 0) & 0xff;
+ g = (machine.generic.paletteram.u16[offset] >> 8) & 0xff;
+ b = (machine.generic.paletteram2.u16[offset] >> 0) & 0xff;
palette_set_color(machine,offset,MAKE_RGB(r,g,b));
}
WRITE16_HANDLER( darkseal_palette_24bit_rg_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
WRITE16_HANDLER( darkseal_palette_24bit_b_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
/******************************************************************************/
@@ -61,10 +61,10 @@ VIDEO_START( darkseal )
SCREEN_UPDATE( darkseal )
{
- darkseal_state *state = screen->machine->driver_data<darkseal_state>();
- tilemap_set_flip_all(screen->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ darkseal_state *state = screen->machine().driver_data<darkseal_state>();
+ tilemap_set_flip_all(screen->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf1_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf3_rowscroll);
@@ -73,7 +73,7 @@ SCREEN_UPDATE( darkseal )
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0x400);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/dassault.c b/src/mame/video/dassault.c
index 1d598690443..383b20ca7ce 100644
--- a/src/mame/video/dassault.c
+++ b/src/mame/video/dassault.c
@@ -11,10 +11,10 @@
/******************************************************************************/
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int pf_priority )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int pf_priority )
{
- dassault_state *state = machine->driver_data<dassault_state>();
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
+ dassault_state *state = machine.driver_data<dassault_state>();
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
int x, y, sprite, colour, multi, fx, fy, inc, flash, mult;
int offs, bank, gfxbank;
const UINT16 *spritebase;
@@ -34,7 +34,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
}
else
{
- spritebase = machine->generic.buffered_spriteram2.u16;
+ spritebase = machine.generic.buffered_spriteram2.u16;
gfxbank = 4;
}
@@ -50,7 +50,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
y = spritebase[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
colour = (x >> 9) & 0x1f;
if (y & 0x8000)
@@ -158,7 +158,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
{
decocomn_pdrawgfx(
state->decocomn,
- bitmap,cliprect,machine->gfx[gfxbank],
+ bitmap,cliprect,machine.gfx[gfxbank],
sprite - multi * inc,
colour,
fx, fy,
@@ -175,19 +175,19 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( dassault )
{
- dassault_state *state = screen->machine->driver_data<dassault_state>();
+ dassault_state *state = screen->machine().driver_data<dassault_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
/* Update tilemaps */
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, 0, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, 0, state->pf4_rowscroll);
/* Draw playfields/update priority bitmap */
decocomn_clear_sprite_priority_bitmap(state->decocomn);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[3072]);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[3072]);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
/* The middle playfields can be swapped priority-wise */
@@ -212,7 +212,7 @@ SCREEN_UPDATE( dassault )
}
/* Draw sprites - two sprite generators, with selectable priority */
- draw_sprites(screen->machine, bitmap, cliprect, priority);
+ draw_sprites(screen->machine(), bitmap, cliprect, priority);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/dbz.c b/src/mame/video/dbz.c
index 50651935bb0..40cfcbb55cb 100644
--- a/src/mame/video/dbz.c
+++ b/src/mame/video/dbz.c
@@ -13,15 +13,15 @@
#include "includes/dbz.h"
-void dbz_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void dbz_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
*color = (state->layer_colorbase[layer] << 1) + ((*color & 0x3c) >> 2);
}
-void dbz_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void dbz_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
int pri = (*color & 0x3c0) >> 5;
if (pri <= state->layerpri[3])
@@ -40,14 +40,14 @@ void dbz_sprite_callback( running_machine *machine, int *code, int *color, int *
WRITE16_HANDLER( dbz_bg2_videoram_w )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
COMBINE_DATA(&state->bg2_videoram[offset]);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset / 2);
}
static TILE_GET_INFO( get_dbz_bg2_tile_info )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
int tileno, colour, flag;
tileno = state->bg2_videoram[tile_index * 2 + 1] & 0x7fff;
@@ -59,14 +59,14 @@ static TILE_GET_INFO( get_dbz_bg2_tile_info )
WRITE16_HANDLER( dbz_bg1_videoram_w )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
COMBINE_DATA(&state->bg1_videoram[offset]);
tilemap_mark_tile_dirty(state->bg1_tilemap, offset / 2);
}
static TILE_GET_INFO( get_dbz_bg1_tile_info )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
int tileno, colour, flag;
tileno = state->bg1_videoram[tile_index * 2 + 1] & 0x7fff;
@@ -78,7 +78,7 @@ static TILE_GET_INFO( get_dbz_bg1_tile_info )
VIDEO_START( dbz )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
state->bg1_tilemap = tilemap_create(machine, get_dbz_bg1_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
state->bg2_tilemap = tilemap_create(machine, get_dbz_bg2_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
@@ -86,7 +86,7 @@ VIDEO_START( dbz )
tilemap_set_transparent_pen(state->bg1_tilemap, 0);
tilemap_set_transparent_pen(state->bg2_tilemap, 0);
- if (!strcmp(machine->system().name, "dbz"))
+ if (!strcmp(machine.system().name, "dbz"))
k056832_set_layer_offs(state->k056832, 0, -34, -16);
else
k056832_set_layer_offs(state->k056832, 0, -35, -16);
@@ -99,7 +99,7 @@ VIDEO_START( dbz )
SCREEN_UPDATE( dbz )
{
- dbz_state *state = screen->machine->driver_data<dbz_state>();
+ dbz_state *state = screen->machine().driver_data<dbz_state>();
static const int K053251_CI[6] = { K053251_CI3, K053251_CI4, K053251_CI4, K053251_CI4, K053251_CI2, K053251_CI1 };
int layer[5], plane, new_colorbase;
@@ -135,7 +135,7 @@ SCREEN_UPDATE( dbz )
konami_sortlayers5(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
for (plane = 0; plane < 5; plane++)
{
diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c
index 41961825431..975e53faaea 100644
--- a/src/mame/video/dc.c
+++ b/src/mame/video/dc.c
@@ -148,7 +148,7 @@ static int scanline,next_y;
// the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer
// our implementation is not currently tile based, and thus the accumulation buffer is screen sized
static bitmap_t *fake_accumulationbuffer_bitmap;
-static void render_to_accumulation_buffer(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect);
+static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect);
typedef struct texinfo {
UINT32 address, vqbase;
@@ -980,19 +980,19 @@ READ64_HANDLER( pvr_ta_r )
{
UINT8 fieldnum,vsync,hsync,blank;
- fieldnum = (space->machine->primary_screen->frame_number() & 1) ? 1 : 0;
+ fieldnum = (space->machine().primary_screen->frame_number() & 1) ? 1 : 0;
- vsync = space->machine->primary_screen->vblank() ? 1 : 0;
+ vsync = space->machine().primary_screen->vblank() ? 1 : 0;
if(spg_vsync_pol) { vsync^=1; }
- hsync = space->machine->primary_screen->hblank() ? 1 : 0;
+ hsync = space->machine().primary_screen->hblank() ? 1 : 0;
if(spg_hsync_pol) { hsync^=1; }
/* FIXME: following is just a wild guess */
- blank = (space->machine->primary_screen->vblank() | space->machine->primary_screen->hblank()) ? 0 : 1;
+ blank = (space->machine().primary_screen->vblank() | space->machine().primary_screen->hblank()) ? 0 : 1;
if(spg_blank_pol) { blank^=1; }
- pvrta_regs[reg] = (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (space->machine->primary_screen->vpos() & 0x3ff);
+ pvrta_regs[reg] = (vsync << 13) | (hsync << 12) | (blank << 11) | (fieldnum << 10) | (space->machine().primary_screen->vpos() & 0x3ff);
break;
}
case SPG_TRIGGER_POS:
@@ -1090,7 +1090,7 @@ WRITE64_HANDLER( pvr_ta_w )
// we've got a request to draw, so, draw to the accumulation buffer!
// this should really be done for each tile!
- render_to_accumulation_buffer(space->machine,fake_accumulationbuffer_bitmap,&clip);
+ render_to_accumulation_buffer(space->machine(),fake_accumulationbuffer_bitmap,&clip);
endofrender_timer_isp->adjust(attotime::from_usec(4000) ); // hack, make sure render takes some amount of time
@@ -1232,7 +1232,7 @@ WRITE64_HANDLER( pvr_ta_w )
// hack, this interrupt is generated after transfering a set amount of data
//dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV;
- //dc_update_interrupt_status(space->machine);
+ //dc_update_interrupt_status(space->machine());
break;
case TA_YUV_TEX_CTRL:
@@ -1244,8 +1244,8 @@ WRITE64_HANDLER( pvr_ta_w )
vbin_timer->adjust(attotime::never);
vbout_timer->adjust(attotime::never);
- vbin_timer->adjust(space->machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
- vbout_timer->adjust(space->machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
+ vbin_timer->adjust(space->machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
+ vbout_timer->adjust(space->machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
break;
/* TODO: timer adjust for SPG_HBLANK_INT too */
case TA_LIST_CONT:
@@ -1264,7 +1264,7 @@ WRITE64_HANDLER( pvr_ta_w )
case VO_STARTX:
case VO_STARTY:
{
- rectangle visarea = space->machine->primary_screen->visible_area();
+ rectangle visarea = space->machine().primary_screen->visible_area();
/* FIXME: right visible area calculations aren't known yet*/
visarea.min_x = 0;
visarea.max_x = ((spg_hbstart - spg_hbend - vo_horz_start_pos) <= 0x180 ? 320 : 640) - 1;
@@ -1272,7 +1272,7 @@ WRITE64_HANDLER( pvr_ta_w )
visarea.max_y = ((spg_vbstart - spg_vbend - vo_vert_start_pos_f1) <= 0x100 ? 240 : 480) - 1;
- space->machine->primary_screen->configure(spg_hbstart, spg_vbstart, visarea, space->machine->primary_screen->frame_period().attoseconds );
+ space->machine().primary_screen->configure(spg_hbstart, spg_vbstart, visarea, space->machine().primary_screen->frame_period().attoseconds );
}
break;
}
@@ -1313,7 +1313,7 @@ static TIMER_CALLBACK( transfer_punch_through_list_irq )
dc_update_interrupt_status(machine);
}
-static void process_ta_fifo(running_machine* machine)
+static void process_ta_fifo(running_machine& machine)
{
/* first byte in the buffer is the Parameter Control Word
@@ -1399,11 +1399,11 @@ static void process_ta_fifo(running_machine* machine)
/* FIXME: timing of these */
switch (state_ta.tafifo_listtype)
{
- case 0: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_list_irq)); break;
- case 1: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_modifier_volume_list_irq)); break;
- case 2: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_list_irq)); break;
- case 3: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_modifier_volume_list_irq)); break;
- case 4: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_punch_through_list_irq)); break;
+ case 0: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_list_irq)); break;
+ case 1: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_modifier_volume_list_irq)); break;
+ case 2: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_list_irq)); break;
+ case 3: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_modifier_volume_list_irq)); break;
+ case 4: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_punch_through_list_irq)); break;
}
state_ta.tafifo_listtype= -1; // no list being received
state_ta.listtype_used |= (2+8);
@@ -1626,7 +1626,7 @@ WRITE64_HANDLER( ta_fifo_poly_w )
// if the command is complete, process it
if (state_ta.tafifo_pos == 0)
- process_ta_fifo(space->machine);
+ process_ta_fifo(space->machine());
}
@@ -1947,9 +1947,9 @@ static void render_tri(bitmap_t *bitmap, texinfo *ti, const vert *v)
render_tri_sorted(bitmap, ti, v+i0, v+i1, v+i2);
}
-static void render_to_accumulation_buffer(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect)
+static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int cs,rs,ns;
UINT32 c;
#if 0
@@ -2359,7 +2359,7 @@ static void pvr_drawframebuffer(bitmap_t *bitmap,const rectangle *cliprect)
#if DEBUG_PALRAM
-static void debug_paletteram(running_machine *machine)
+static void debug_paletteram(running_machine &machine)
{
UINT64 pal;
UINT32 r,g,b;
@@ -2451,7 +2451,7 @@ static TIMER_CALLBACK(vbin)
dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt
dc_update_interrupt_status(machine);
- vbin_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
+ vbin_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
}
static TIMER_CALLBACK(vbout)
@@ -2459,7 +2459,7 @@ static TIMER_CALLBACK(vbout)
dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt
dc_update_interrupt_status(machine);
- vbout_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
+ vbout_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
}
static TIMER_CALLBACK(hbin)
@@ -2489,7 +2489,7 @@ static TIMER_CALLBACK(hbin)
next_y = spg_line_comp_val;
}
- hbin_timer->adjust(machine->primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1));
+ hbin_timer->adjust(machine.primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1));
}
@@ -2551,21 +2551,21 @@ VIDEO_START(dc)
computedilated();
- vbout_timer = machine->scheduler().timer_alloc(FUNC(vbout));
- vbout_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
+ vbout_timer = machine.scheduler().timer_alloc(FUNC(vbout));
+ vbout_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
- vbin_timer = machine->scheduler().timer_alloc(FUNC(vbin));
- vbin_timer->adjust(machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
+ vbin_timer = machine.scheduler().timer_alloc(FUNC(vbin));
+ vbin_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
- hbin_timer = machine->scheduler().timer_alloc(FUNC(hbin));
- hbin_timer->adjust(machine->primary_screen->time_until_pos(0, spg_hblank_in_irq-1));
+ hbin_timer = machine.scheduler().timer_alloc(FUNC(hbin));
+ hbin_timer->adjust(machine.primary_screen->time_until_pos(0, spg_hblank_in_irq-1));
scanline = 0;
next_y = 0;
- endofrender_timer_isp = machine->scheduler().timer_alloc(FUNC(endofrender_isp));
- endofrender_timer_tsp = machine->scheduler().timer_alloc(FUNC(endofrender_tsp));
- endofrender_timer_video = machine->scheduler().timer_alloc(FUNC(endofrender_video));
+ endofrender_timer_isp = machine.scheduler().timer_alloc(FUNC(endofrender_isp));
+ endofrender_timer_tsp = machine.scheduler().timer_alloc(FUNC(endofrender_tsp));
+ endofrender_timer_video = machine.scheduler().timer_alloc(FUNC(endofrender_video));
endofrender_timer_isp->adjust(attotime::never);
endofrender_timer_tsp->adjust(attotime::never);
@@ -2596,7 +2596,7 @@ SCREEN_UPDATE(dc)
//printf("videoupdate\n");
#if DEBUG_PALRAM
- debug_paletteram(screen->machine);
+ debug_paletteram(screen->machine());
#endif
// copy our fake framebuffer bitmap (where things have been rendered) to the screen
@@ -2618,7 +2618,7 @@ SCREEN_UPDATE(dc)
pvr_drawframebuffer(bitmap,cliprect);
// update this here so we only do string lookup once per frame
- debug_dip_status = input_port_read(screen->machine, "MAMEDEBUG");
+ debug_dip_status = input_port_read(screen->machine(), "MAMEDEBUG");
return 0;
}
diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c
index f8c3d40e1b9..6bf6b443046 100644
--- a/src/mame/video/dcheese.c
+++ b/src/mame/video/dcheese.c
@@ -27,7 +27,7 @@
PALETTE_INIT( dcheese )
{
- const UINT16 *src = (UINT16 *)machine->region("user1")->base();
+ const UINT16 *src = (UINT16 *)machine.region("user1")->base();
int i;
/* really 65536 colors, but they don't use the later ones so we can stay */
@@ -47,9 +47,9 @@ PALETTE_INIT( dcheese )
*
*************************************/
-static void update_scanline_irq( running_machine *machine )
+static void update_scanline_irq( running_machine &machine )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
/* if not in range, don't bother */
if (state->blitter_vidparam[0x22/2] <= state->blitter_vidparam[0x1e/2])
@@ -63,9 +63,9 @@ static void update_scanline_irq( running_machine *machine )
effscan += state->blitter_vidparam[0x1e/2];
/* determine the time; if it's in this scanline, bump to the next frame */
- time = machine->primary_screen->time_until_pos(effscan);
- if (time < machine->primary_screen->scan_period())
- time += machine->primary_screen->frame_period();
+ time = machine.primary_screen->time_until_pos(effscan);
+ if (time < machine.primary_screen->scan_period())
+ time += machine.primary_screen->frame_period();
state->blitter_timer->adjust(time);
}
}
@@ -92,13 +92,13 @@ static TIMER_CALLBACK( dcheese_signal_irq_callback )
VIDEO_START( dcheese )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
/* the destination bitmap is not directly accessible to the CPU */
- state->dstbitmap = auto_bitmap_alloc(machine, DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine->primary_screen->format());
+ state->dstbitmap = auto_bitmap_alloc(machine, DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine.primary_screen->format());
/* create a timer */
- state->blitter_timer = machine->scheduler().timer_alloc(FUNC(blitter_scanline_callback));
+ state->blitter_timer = machine.scheduler().timer_alloc(FUNC(blitter_scanline_callback));
/* register for saving */
state->save_item(NAME(state->blitter_color));
@@ -118,7 +118,7 @@ VIDEO_START( dcheese )
SCREEN_UPDATE( dcheese )
{
- dcheese_state *state = screen->machine->driver_data<dcheese_state>();
+ dcheese_state *state = screen->machine().driver_data<dcheese_state>();
int x, y;
/* update the pixels */
@@ -141,9 +141,9 @@ SCREEN_UPDATE( dcheese )
*
*************************************/
-static void do_clear( running_machine *machine )
+static void do_clear( running_machine &machine )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
int y;
/* clear the requested scanlines */
@@ -151,13 +151,13 @@ static void do_clear( running_machine *machine )
memset(BITMAP_ADDR16(state->dstbitmap, y % DSTBITMAP_HEIGHT, 0), 0, DSTBITMAP_WIDTH * 2);
/* signal an IRQ when done (timing is just a guess) */
- machine->scheduler().timer_set(machine->primary_screen->scan_period(), FUNC(dcheese_signal_irq_callback), 1);
+ machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(dcheese_signal_irq_callback), 1);
}
-static void do_blit( running_machine *machine )
+static void do_blit( running_machine &machine )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
INT32 srcminx = state->blitter_xparam[0] << 12;
INT32 srcmaxx = state->blitter_xparam[1] << 12;
INT32 srcminy = state->blitter_yparam[0] << 12;
@@ -168,8 +168,8 @@ static void do_blit( running_machine *machine )
INT32 dxdy = (INT32)(((state->blitter_xparam[6] & 0x0fff) | ((state->blitter_xparam[7] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydx = (INT32)(((state->blitter_yparam[4] & 0x0fff) | ((state->blitter_yparam[5] & 0x0fff) << 12)) << 12) >> 12;
INT32 dydy = (INT32)(((state->blitter_yparam[6] & 0x0fff) | ((state->blitter_yparam[7] & 0x0fff) << 12)) << 12) >> 12;
- UINT8 *src = machine->region("gfx1")->base();
- UINT32 pagemask = (machine->region("gfx1")->bytes() - 1) / 0x40000;
+ UINT8 *src = machine.region("gfx1")->base();
+ UINT32 pagemask = (machine.region("gfx1")->bytes() - 1) / 0x40000;
int xstart = state->blitter_xparam[14];
int xend = state->blitter_xparam[15] + 1;
int ystart = state->blitter_yparam[14];
@@ -206,13 +206,13 @@ static void do_blit( running_machine *machine )
}
/* signal an IRQ when done (timing is just a guess) */
- machine->scheduler().timer_set(machine->primary_screen->scan_period() / 2, FUNC(dcheese_signal_irq_callback), 2);
+ machine.scheduler().timer_set(machine.primary_screen->scan_period() / 2, FUNC(dcheese_signal_irq_callback), 2);
/* these extra parameters are written but they are always zero, so I don't know what they do */
if (state->blitter_xparam[8] != 0 || state->blitter_xparam[9] != 0 || state->blitter_xparam[10] != 0 || state->blitter_xparam[11] != 0 ||
state->blitter_yparam[8] != 0 || state->blitter_yparam[9] != 0 || state->blitter_yparam[10] != 0 || state->blitter_yparam[11] != 0)
{
- logerror("%s:blit! (%04X)\n", machine->describe_context(), state->blitter_color[0]);
+ logerror("%s:blit! (%04X)\n", machine.describe_context(), state->blitter_color[0]);
logerror(" %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n",
state->blitter_xparam[0], state->blitter_xparam[1], state->blitter_xparam[2], state->blitter_xparam[3],
state->blitter_xparam[4], state->blitter_xparam[5], state->blitter_xparam[6], state->blitter_xparam[7],
@@ -236,28 +236,28 @@ static void do_blit( running_machine *machine )
WRITE16_HANDLER( madmax_blitter_color_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
COMBINE_DATA(&state->blitter_color[offset]);
}
WRITE16_HANDLER( madmax_blitter_xparam_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
COMBINE_DATA(&state->blitter_xparam[offset]);
}
WRITE16_HANDLER( madmax_blitter_yparam_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
COMBINE_DATA(&state->blitter_yparam[offset]);
}
WRITE16_HANDLER( madmax_blitter_vidparam_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
COMBINE_DATA(&state->blitter_vidparam[offset]);
switch (offset)
@@ -274,7 +274,7 @@ WRITE16_HANDLER( madmax_blitter_vidparam_w )
break;
case 0x22/2: /* scanline interrupt */
- update_scanline_irq(space->machine);
+ update_scanline_irq(space->machine());
break;
case 0x24/2: /* writes here after writing to 0x28 */
@@ -286,11 +286,11 @@ WRITE16_HANDLER( madmax_blitter_vidparam_w )
break;
case 0x38/2: /* blit */
- do_blit(space->machine);
+ do_blit(space->machine());
break;
case 0x3e/2: /* clear */
- do_clear(space->machine);
+ do_clear(space->machine());
break;
default:
@@ -311,9 +311,9 @@ READ16_HANDLER( madmax_blitter_vidparam_r )
{
/* analog inputs seem to be hooked up here -- might not actually map to blitter */
if (offset == 0x02/2)
- return input_port_read(space->machine, "2a0002");
+ return input_port_read(space->machine(), "2a0002");
if (offset == 0x0e/2)
- return input_port_read(space->machine, "2a000e");
+ return input_port_read(space->machine(), "2a000e");
/* early code polls on this bit, wants it to be 0 */
if (offset == 0x36/2)
diff --git a/src/mame/video/dcon.c b/src/mame/video/dcon.c
index e2d52e787f5..c86114b6140 100644
--- a/src/mame/video/dcon.c
+++ b/src/mame/video/dcon.c
@@ -12,13 +12,13 @@
READ16_HANDLER( dcon_control_r )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
return state->enable;
}
WRITE16_HANDLER( dcon_control_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
if (ACCESSING_BITS_0_7)
{
state->enable=data;
@@ -41,7 +41,7 @@ WRITE16_HANDLER( dcon_control_w )
WRITE16_HANDLER( dcon_gfxbank_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
if (data&1)
state->gfx_bank_select=0x1000;
else
@@ -50,35 +50,35 @@ WRITE16_HANDLER( dcon_gfxbank_w )
WRITE16_HANDLER( dcon_background_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
COMBINE_DATA(&state->back_data[offset]);
tilemap_mark_tile_dirty(state->background_layer,offset);
}
WRITE16_HANDLER( dcon_foreground_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
COMBINE_DATA(&state->fore_data[offset]);
tilemap_mark_tile_dirty(state->foreground_layer,offset);
}
WRITE16_HANDLER( dcon_midground_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
COMBINE_DATA(&state->mid_data[offset]);
tilemap_mark_tile_dirty(state->midground_layer,offset);
}
WRITE16_HANDLER( dcon_text_w )
{
- dcon_state *state = space->machine->driver_data<dcon_state>();
+ dcon_state *state = space->machine().driver_data<dcon_state>();
COMBINE_DATA(&state->textram[offset]);
tilemap_mark_tile_dirty(state->text_layer,offset);
}
static TILE_GET_INFO( get_back_tile_info )
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
int tile=state->back_data[tile_index];
int color=(tile>>12)&0xf;
@@ -93,7 +93,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
int tile=state->fore_data[tile_index];
int color=(tile>>12)&0xf;
@@ -108,7 +108,7 @@ static TILE_GET_INFO( get_fore_tile_info )
static TILE_GET_INFO( get_mid_tile_info )
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
int tile=state->mid_data[tile_index];
int color=(tile>>12)&0xf;
@@ -123,7 +123,7 @@ static TILE_GET_INFO( get_mid_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
int tile = state->textram[tile_index];
int color=(tile>>12)&0xf;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( dcon )
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows, 16,16,32,32);
state->foreground_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
state->midground_layer = tilemap_create(machine, get_mid_tile_info, tilemap_scan_rows,16,16,32,32);
@@ -151,9 +151,9 @@ VIDEO_START( dcon )
state->gfx_bank_select = 0;
}
-static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- dcon_state *state = machine->driver_data<dcon_state>();
+ dcon_state *state = machine.driver_data<dcon_state>();
UINT16 *spriteram16 = state->spriteram;
int offs,fx,fy,x,y,color,sprite;
int dx,dy,ax,ay,inc,pri_mask = 0;
@@ -197,79 +197,79 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
for (ay=0; ay<dy; ay++) {
if (!fx && !fy)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+ay*16,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+ay*16 + 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+ay*16 - 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
else if (fx && !fy)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+ay*16,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+ay*16 + 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+ay*16 - 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
else if (!fx && fy)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+(dy-1-ay)*16,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+(dy-1-ay)*16 + 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+ax*16,y+(dy-1-ay)*16 - 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
else
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 + 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
// wrap around y
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
sprite + inc,
color,fx,fy,x+(dx-1-ax)*16,y+(dy-1-ay)*16 - 512,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
inc++;
@@ -279,8 +279,8 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( dcon )
{
- dcon_state *state = screen->machine->driver_data<dcon_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ dcon_state *state = screen->machine().driver_data<dcon_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
/* Setup the tilemaps */
tilemap_set_scrollx( state->background_layer,0, state->scroll_ram[0] );
@@ -299,15 +299,15 @@ SCREEN_UPDATE( dcon )
tilemap_draw(bitmap,cliprect,state->foreground_layer,0,2);
tilemap_draw(bitmap,cliprect,state->text_layer,0,4);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( sdgndmps )
{
- dcon_state *state = screen->machine->driver_data<dcon_state>();
+ dcon_state *state = screen->machine().driver_data<dcon_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
/* Gfx banking */
if (state->last_gfx_bank!=state->gfx_bank_select)
@@ -335,6 +335,6 @@ SCREEN_UPDATE( sdgndmps )
tilemap_draw(bitmap,cliprect,state->foreground_layer,0,2);
tilemap_draw(bitmap,cliprect,state->text_layer,0,4);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c
index 9587ea80380..90125650707 100644
--- a/src/mame/video/dday.c
+++ b/src/mame/video/dday.c
@@ -20,26 +20,26 @@
READ8_HANDLER( dday_countdown_timer_r )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
return ((state->timer_value / 10) << 4) | (state->timer_value % 10);
}
static TIMER_CALLBACK( countdown_timer_callback )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
state->timer_value--;
if (state->timer_value < 0)
state->timer_value = 99;
}
-static void start_countdown_timer(running_machine *machine)
+static void start_countdown_timer(running_machine &machine)
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
state->timer_value = 0;
- machine->scheduler().timer_pulse(attotime::from_seconds(1), FUNC(countdown_timer_callback));
+ machine.scheduler().timer_pulse(attotime::from_seconds(1), FUNC(countdown_timer_callback));
}
@@ -56,7 +56,7 @@ PALETTE_INIT( dday )
palette_set_shadow_factor(machine, 1.0 / 8);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -65,85 +65,85 @@ PALETTE_INIT( dday )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* HACK!!! This table is handgenerated, but it matches the screenshot.
I have no clue how it really works */
- colortable_entry_set_value(machine->colortable, 0*8+0+0, 0x00);
- colortable_entry_set_value(machine->colortable, 0*8+0+1, 0x01);
- colortable_entry_set_value(machine->colortable, 0*8+0+2, 0x15);
- colortable_entry_set_value(machine->colortable, 0*8+0+3, 0x02);
- colortable_entry_set_value(machine->colortable, 0*8+4+0, 0x00);
- colortable_entry_set_value(machine->colortable, 0*8+4+1, 0x01);
- colortable_entry_set_value(machine->colortable, 0*8+4+2, 0x15);
- colortable_entry_set_value(machine->colortable, 0*8+4+3, 0x02);
-
- colortable_entry_set_value(machine->colortable, 1*8+0+0, 0x04);
- colortable_entry_set_value(machine->colortable, 1*8+0+1, 0x05);
- colortable_entry_set_value(machine->colortable, 1*8+0+2, 0x03);
- colortable_entry_set_value(machine->colortable, 1*8+0+3, 0x07);
- colortable_entry_set_value(machine->colortable, 1*8+4+0, 0x04);
- colortable_entry_set_value(machine->colortable, 1*8+4+1, 0x05);
- colortable_entry_set_value(machine->colortable, 1*8+4+2, 0x03);
- colortable_entry_set_value(machine->colortable, 1*8+4+3, 0x07);
-
- colortable_entry_set_value(machine->colortable, 2*8+0+0, 0x08);
- colortable_entry_set_value(machine->colortable, 2*8+0+1, 0x15);
- colortable_entry_set_value(machine->colortable, 2*8+0+2, 0x0a);
- colortable_entry_set_value(machine->colortable, 2*8+0+3, 0x03);
- colortable_entry_set_value(machine->colortable, 2*8+4+0, 0x08);
- colortable_entry_set_value(machine->colortable, 2*8+4+1, 0x15);
- colortable_entry_set_value(machine->colortable, 2*8+4+2, 0x0a);
- colortable_entry_set_value(machine->colortable, 2*8+4+3, 0x03);
-
- colortable_entry_set_value(machine->colortable, 3*8+0+0, 0x08);
- colortable_entry_set_value(machine->colortable, 3*8+0+1, 0x15);
- colortable_entry_set_value(machine->colortable, 3*8+0+2, 0x0a);
- colortable_entry_set_value(machine->colortable, 3*8+0+3, 0x03);
- colortable_entry_set_value(machine->colortable, 3*8+4+0, 0x08);
- colortable_entry_set_value(machine->colortable, 3*8+4+1, 0x15);
- colortable_entry_set_value(machine->colortable, 3*8+4+2, 0x0a);
- colortable_entry_set_value(machine->colortable, 3*8+4+3, 0x03);
-
- colortable_entry_set_value(machine->colortable, 4*8+0+0, 0x10);
- colortable_entry_set_value(machine->colortable, 4*8+0+1, 0x11);
- colortable_entry_set_value(machine->colortable, 4*8+0+2, 0x12);
- colortable_entry_set_value(machine->colortable, 4*8+0+3, 0x07);
- colortable_entry_set_value(machine->colortable, 4*8+4+0, 0x10);
- colortable_entry_set_value(machine->colortable, 4*8+4+1, 0x11);
- colortable_entry_set_value(machine->colortable, 4*8+4+2, 0x12);
- colortable_entry_set_value(machine->colortable, 4*8+4+3, 0x07);
-
- colortable_entry_set_value(machine->colortable, 5*8+0+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 5*8+0+1, 0x15);
- colortable_entry_set_value(machine->colortable, 5*8+0+2, 0x16);
- colortable_entry_set_value(machine->colortable, 5*8+0+3, 0x1b);
- colortable_entry_set_value(machine->colortable, 5*8+4+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 5*8+4+1, 0x15);
- colortable_entry_set_value(machine->colortable, 5*8+4+2, 0x16);
- colortable_entry_set_value(machine->colortable, 5*8+4+3, 0x1b);
-
- colortable_entry_set_value(machine->colortable, 6*8+0+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 6*8+0+1, 0x15);
- colortable_entry_set_value(machine->colortable, 6*8+0+2, 0x1a);
- colortable_entry_set_value(machine->colortable, 6*8+0+3, 0x1b);
- colortable_entry_set_value(machine->colortable, 6*8+4+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 6*8+4+1, 0x15);
- colortable_entry_set_value(machine->colortable, 6*8+4+2, 0x1a);
- colortable_entry_set_value(machine->colortable, 6*8+4+3, 0x1b);
-
- colortable_entry_set_value(machine->colortable, 7*8+0+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 7*8+0+1, 0x02);
- colortable_entry_set_value(machine->colortable, 7*8+0+2, 0x04);
- colortable_entry_set_value(machine->colortable, 7*8+0+3, 0x1b);
- colortable_entry_set_value(machine->colortable, 7*8+4+0, 0x1d);
- colortable_entry_set_value(machine->colortable, 7*8+4+1, 0x02);
- colortable_entry_set_value(machine->colortable, 7*8+4+2, 0x04);
- colortable_entry_set_value(machine->colortable, 7*8+4+3, 0x1b);
+ colortable_entry_set_value(machine.colortable, 0*8+0+0, 0x00);
+ colortable_entry_set_value(machine.colortable, 0*8+0+1, 0x01);
+ colortable_entry_set_value(machine.colortable, 0*8+0+2, 0x15);
+ colortable_entry_set_value(machine.colortable, 0*8+0+3, 0x02);
+ colortable_entry_set_value(machine.colortable, 0*8+4+0, 0x00);
+ colortable_entry_set_value(machine.colortable, 0*8+4+1, 0x01);
+ colortable_entry_set_value(machine.colortable, 0*8+4+2, 0x15);
+ colortable_entry_set_value(machine.colortable, 0*8+4+3, 0x02);
+
+ colortable_entry_set_value(machine.colortable, 1*8+0+0, 0x04);
+ colortable_entry_set_value(machine.colortable, 1*8+0+1, 0x05);
+ colortable_entry_set_value(machine.colortable, 1*8+0+2, 0x03);
+ colortable_entry_set_value(machine.colortable, 1*8+0+3, 0x07);
+ colortable_entry_set_value(machine.colortable, 1*8+4+0, 0x04);
+ colortable_entry_set_value(machine.colortable, 1*8+4+1, 0x05);
+ colortable_entry_set_value(machine.colortable, 1*8+4+2, 0x03);
+ colortable_entry_set_value(machine.colortable, 1*8+4+3, 0x07);
+
+ colortable_entry_set_value(machine.colortable, 2*8+0+0, 0x08);
+ colortable_entry_set_value(machine.colortable, 2*8+0+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 2*8+0+2, 0x0a);
+ colortable_entry_set_value(machine.colortable, 2*8+0+3, 0x03);
+ colortable_entry_set_value(machine.colortable, 2*8+4+0, 0x08);
+ colortable_entry_set_value(machine.colortable, 2*8+4+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 2*8+4+2, 0x0a);
+ colortable_entry_set_value(machine.colortable, 2*8+4+3, 0x03);
+
+ colortable_entry_set_value(machine.colortable, 3*8+0+0, 0x08);
+ colortable_entry_set_value(machine.colortable, 3*8+0+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 3*8+0+2, 0x0a);
+ colortable_entry_set_value(machine.colortable, 3*8+0+3, 0x03);
+ colortable_entry_set_value(machine.colortable, 3*8+4+0, 0x08);
+ colortable_entry_set_value(machine.colortable, 3*8+4+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 3*8+4+2, 0x0a);
+ colortable_entry_set_value(machine.colortable, 3*8+4+3, 0x03);
+
+ colortable_entry_set_value(machine.colortable, 4*8+0+0, 0x10);
+ colortable_entry_set_value(machine.colortable, 4*8+0+1, 0x11);
+ colortable_entry_set_value(machine.colortable, 4*8+0+2, 0x12);
+ colortable_entry_set_value(machine.colortable, 4*8+0+3, 0x07);
+ colortable_entry_set_value(machine.colortable, 4*8+4+0, 0x10);
+ colortable_entry_set_value(machine.colortable, 4*8+4+1, 0x11);
+ colortable_entry_set_value(machine.colortable, 4*8+4+2, 0x12);
+ colortable_entry_set_value(machine.colortable, 4*8+4+3, 0x07);
+
+ colortable_entry_set_value(machine.colortable, 5*8+0+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 5*8+0+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 5*8+0+2, 0x16);
+ colortable_entry_set_value(machine.colortable, 5*8+0+3, 0x1b);
+ colortable_entry_set_value(machine.colortable, 5*8+4+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 5*8+4+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 5*8+4+2, 0x16);
+ colortable_entry_set_value(machine.colortable, 5*8+4+3, 0x1b);
+
+ colortable_entry_set_value(machine.colortable, 6*8+0+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 6*8+0+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 6*8+0+2, 0x1a);
+ colortable_entry_set_value(machine.colortable, 6*8+0+3, 0x1b);
+ colortable_entry_set_value(machine.colortable, 6*8+4+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 6*8+4+1, 0x15);
+ colortable_entry_set_value(machine.colortable, 6*8+4+2, 0x1a);
+ colortable_entry_set_value(machine.colortable, 6*8+4+3, 0x1b);
+
+ colortable_entry_set_value(machine.colortable, 7*8+0+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 7*8+0+1, 0x02);
+ colortable_entry_set_value(machine.colortable, 7*8+0+2, 0x04);
+ colortable_entry_set_value(machine.colortable, 7*8+0+3, 0x1b);
+ colortable_entry_set_value(machine.colortable, 7*8+4+0, 0x1d);
+ colortable_entry_set_value(machine.colortable, 7*8+4+1, 0x02);
+ colortable_entry_set_value(machine.colortable, 7*8+4+2, 0x04);
+ colortable_entry_set_value(machine.colortable, 7*8+4+3, 0x1b);
}
@@ -155,7 +155,7 @@ PALETTE_INIT( dday )
static TILE_GET_INFO( get_bg_tile_info )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
int code;
code = state->bgvideoram[tile_index];
@@ -164,7 +164,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
int code, flipx;
flipx = state->colorram[tile_index & 0x03e0] & 0x01;
@@ -174,7 +174,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
int code;
code = state->textvideoram[tile_index];
@@ -183,11 +183,11 @@ static TILE_GET_INFO( get_text_tile_info )
static TILE_GET_INFO( get_sl_tile_info )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
int code, sl_flipx, flipx;
UINT8* sl_map;
- sl_map = &machine->region("user1")->base()[(state->sl_image & 0x07) * 0x0200];
+ sl_map = &machine.region("user1")->base()[(state->sl_image & 0x07) * 0x0200];
flipx = (tile_index >> 4) & 0x01;
sl_flipx = (state->sl_image >> 3) & 0x01;
@@ -213,13 +213,13 @@ static TILE_GET_INFO( get_sl_tile_info )
VIDEO_START( dday )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->text_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->sl_tilemap = tilemap_create(machine, get_sl_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- state->main_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->main_bitmap = machine.primary_screen->alloc_compatible_bitmap();
tilemap_set_transmask(state->bg_tilemap, 0, 0x00f0, 0xff0f); /* pens 0-3 have priority over the foreground layer */
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -230,7 +230,7 @@ VIDEO_START( dday )
WRITE8_HANDLER( dday_bgvideoram_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -238,7 +238,7 @@ WRITE8_HANDLER( dday_bgvideoram_w )
WRITE8_HANDLER( dday_fgvideoram_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -247,7 +247,7 @@ WRITE8_HANDLER( dday_fgvideoram_w )
WRITE8_HANDLER( dday_textvideoram_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
state->textvideoram[offset] = data;
tilemap_mark_tile_dirty(state->text_tilemap, offset);
@@ -255,7 +255,7 @@ WRITE8_HANDLER( dday_textvideoram_w )
WRITE8_HANDLER( dday_colorram_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
int i;
offset &= 0x03e0;
@@ -268,14 +268,14 @@ WRITE8_HANDLER( dday_colorram_w )
READ8_HANDLER( dday_colorram_r )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
return state->colorram[offset & 0x03e0];
}
WRITE8_HANDLER( dday_sl_control_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
if (state->sl_image != data)
{
@@ -287,21 +287,21 @@ WRITE8_HANDLER( dday_sl_control_w )
WRITE8_HANDLER( dday_control_w )
{
- dday_state *state = space->machine->driver_data<dday_state>();
+ dday_state *state = space->machine().driver_data<dday_state>();
//if (data & 0xac) logerror("Control = %02X\n", data & 0xac);
/* bit 0 is coin counter 1 */
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
/* bit 1 is coin counter 2 */
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 4 is sound enable */
if (!(data & 0x10) && (state->control & 0x10))
state->ay1->reset();
- space->machine->sound().system_enable(data & 0x10);
+ space->machine().sound().system_enable(data & 0x10);
/* bit 6 is search light enable */
state->sl_enable = data & 0x40;
@@ -317,7 +317,7 @@ WRITE8_HANDLER( dday_control_w )
SCREEN_UPDATE( dday )
{
- dday_state *state = screen->machine->driver_data<dday_state>();
+ dday_state *state = screen->machine().driver_data<dday_state>();
tilemap_draw(state->main_bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
tilemap_draw(state->main_bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -337,7 +337,7 @@ SCREEN_UPDATE( dday )
UINT16 src_pixel = *BITMAP_ADDR16(state->main_bitmap, y, x);
if (*BITMAP_ADDR16(sl_bitmap, y, x) == 0xff)
- src_pixel += screen->machine->total_colors();
+ src_pixel += screen->machine().total_colors();
*BITMAP_ADDR16(bitmap, y, x) = src_pixel;
}
diff --git a/src/mame/video/ddragon.c b/src/mame/video/ddragon.c
index 54b11b2d235..b746b370a93 100644
--- a/src/mame/video/ddragon.c
+++ b/src/mame/video/ddragon.c
@@ -58,7 +58,7 @@ static TILEMAP_MAPPER( background_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
UINT8 attr = state->bgvideoram[2 * tile_index];
SET_TILE_INFO(
2,
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
UINT8 attr = state->fgvideoram[2 * tile_index];
SET_TILE_INFO(
0,
@@ -80,7 +80,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_fg_16color_tile_info )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
UINT8 attr = state->fgvideoram[2 * tile_index];
SET_TILE_INFO(
0,
@@ -98,7 +98,7 @@ static TILE_GET_INFO( get_fg_16color_tile_info )
VIDEO_START( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, background_scan, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -112,7 +112,7 @@ VIDEO_START( ddragon )
VIDEO_START( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,background_scan, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_16color_tile_info,tilemap_scan_rows, 8, 8, 32, 32);
@@ -131,14 +131,14 @@ VIDEO_START( chinagat )
WRITE8_HANDLER( ddragon_bgvideoram_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( ddragon_fgvideoram_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
@@ -154,10 +154,10 @@ WRITE8_HANDLER( ddragon_fgvideoram_w )
cliprect,gfx, \
(which + order),color,flipx,flipy,sx,sy,0);
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
- const gfx_element *gfx = machine->gfx[1];
+ ddragon_state *state = machine.driver_data<ddragon_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *src;
int i;
@@ -242,7 +242,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( ddragon )
{
- ddragon_state *state = screen->machine->driver_data<ddragon_state>();
+ ddragon_state *state = screen->machine().driver_data<ddragon_state>();
int scrollx = (state->scrollx_hi << 8) | *state->scrollx_lo;
int scrolly = (state->scrolly_hi << 8) | *state->scrolly_lo;
@@ -251,7 +251,7 @@ SCREEN_UPDATE( ddragon )
tilemap_set_scrolly(state->bg_tilemap, 0, scrolly);
tilemap_draw(bitmap,cliprect, state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/ddragon3.c b/src/mame/video/ddragon3.c
index 1a2ca6da299..4a2517e4efa 100644
--- a/src/mame/video/ddragon3.c
+++ b/src/mame/video/ddragon3.c
@@ -9,7 +9,7 @@
WRITE16_HANDLER( ddragon3_scroll_w )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
switch (offset)
{
@@ -18,7 +18,7 @@ WRITE16_HANDLER( ddragon3_scroll_w )
case 2: COMBINE_DATA(&state->bg_scrollx); break; // Scroll X, BG0
case 3: COMBINE_DATA(&state->bg_scrolly); break; // Scroll Y, BG0
case 4: break; // Unknown write
- case 5: flip_screen_set(space->machine, data & 0x01); break; // Flip Screen
+ case 5: flip_screen_set(space->machine(), data & 0x01); break; // Flip Screen
case 6:
COMBINE_DATA(&state->bg_tilebase); // BG Tile Base
state->bg_tilebase &= 0x1ff;
@@ -29,7 +29,7 @@ WRITE16_HANDLER( ddragon3_scroll_w )
READ16_HANDLER( ddragon3_scroll_r )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
switch (offset)
{
@@ -37,7 +37,7 @@ READ16_HANDLER( ddragon3_scroll_r )
case 1: return state->fg_scrolly;
case 2: return state->bg_scrollx;
case 3: return state->bg_scrolly;
- case 5: return flip_screen_get(space->machine);
+ case 5: return flip_screen_get(space->machine());
case 6: return state->bg_tilebase;
}
@@ -46,21 +46,21 @@ READ16_HANDLER( ddragon3_scroll_r )
WRITE16_HANDLER( ddragon3_bg_videoram_w )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE16_HANDLER( ddragon3_fg_videoram_w )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
UINT16 attr = state->bg_videoram[tile_index];
int code = (attr & 0x0fff) | ((state->bg_tilebase & 0x01) << 12);
int color = ((attr & 0xf000) >> 12) + 16;
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
int offs = tile_index * 2;
UINT16 attr = state->fg_videoram[offs];
int code = state->fg_videoram[offs + 1] & 0x1fff;
@@ -82,7 +82,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( ddragon3 )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -116,9 +116,9 @@ VIDEO_START( ddragon3 )
* 6,7| unused
*/
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x800;
@@ -153,7 +153,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
for (i = 0; i <= height; i++)
{
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1], code + i, color, flipx, flipy,
+ machine.gfx[1], code + i, color, flipx, flipy,
sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), 0);
}
}
@@ -164,7 +164,7 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ddragon3 )
{
- ddragon3_state *state = screen->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = screen->machine().driver_data<ddragon3_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
@@ -175,18 +175,18 @@ SCREEN_UPDATE( ddragon3 )
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
else if ((state->vreg & 0x60) == 0x60)
{
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
else
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
return 0;
@@ -194,7 +194,7 @@ SCREEN_UPDATE( ddragon3 )
SCREEN_UPDATE( ctribe )
{
- ddragon3_state *state = screen->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = screen->machine().driver_data<ddragon3_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
@@ -204,14 +204,14 @@ SCREEN_UPDATE( ctribe )
if(state->vreg & 8)
{
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
else
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
return 0;
}
diff --git a/src/mame/video/ddribble.c b/src/mame/video/ddribble.c
index 7e6897b52a2..66611debb78 100644
--- a/src/mame/video/ddribble.c
+++ b/src/mame/video/ddribble.c
@@ -15,23 +15,23 @@ PALETTE_INIT( ddribble )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x40);
+ machine.colortable = colortable_alloc(machine, 0x40);
for (i = 0x10; i < 0x40; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprite #2 uses pens 0x00-0x0f */
for (i = 0x40; i < 0x140; i++)
{
UINT8 ctabentry = color_prom[i - 0x40] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
int i;
for (i = 0x00; i < 0x80; i += 2)
@@ -39,14 +39,14 @@ static void set_pens( running_machine *machine )
UINT16 data = state->paletteram[i | 1] | (state->paletteram[i] << 8);
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
WRITE8_HANDLER( K005885_0_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
switch (offset)
{
case 0x03: /* char bank selection for set 1 */
@@ -65,7 +65,7 @@ WRITE8_HANDLER( K005885_0_w )
WRITE8_HANDLER( K005885_1_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
switch (offset)
{
case 0x03: /* char bank selection for set 2 */
@@ -96,7 +96,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
UINT8 attr = state->fg_videoram[tile_index];
int num = state->fg_videoram[tile_index + 0x400] + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5) + ((state->charbank[0] & 2) << 10);
SET_TILE_INFO(
@@ -108,7 +108,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
UINT8 attr = state->bg_videoram[tile_index];
int num = state->bg_videoram[tile_index + 0x400] + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5) + (state->charbank[1] << 11);
SET_TILE_INFO(
@@ -126,7 +126,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( ddribble )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan, 8, 8, 64, 32);
@@ -142,14 +142,14 @@ VIDEO_START( ddribble )
WRITE8_HANDLER( ddribble_fg_videoram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0xbff);
}
WRITE8_HANDLER( ddribble_bg_videoram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0xbff);
}
@@ -176,9 +176,9 @@ byte #4: attributes
***************************************************************************/
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* source, int lenght, int gfxset, int flipscreen )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* source, int lenght, int gfxset, int flipscreen )
{
- gfx_element *gfx = machine->gfx[gfxset];
+ gfx_element *gfx = machine.gfx[gfxset];
const UINT8 *finish = source + lenght;
while (source < finish)
@@ -252,8 +252,8 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ddribble )
{
- ddribble_state *state = screen->machine->driver_data<ddribble_state>();
- set_pens(screen->machine);
+ ddribble_state *state = screen->machine().driver_data<ddribble_state>();
+ set_pens(screen->machine());
tilemap_set_flip(state->fg_tilemap, (state->vregs[0][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
tilemap_set_flip(state->bg_tilemap, (state->vregs[1][4] & 0x08) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
@@ -265,8 +265,8 @@ SCREEN_UPDATE( ddribble )
tilemap_set_scrolly(state->bg_tilemap, 0, state->vregs[1][0]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x07d, 2, state->vregs[0][4] & 0x08);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x140, 3, state->vregs[1][4] & 0x08);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_1, 0x07d, 2, state->vregs[0][4] & 0x08);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_2, 0x140, 3, state->vregs[1][4] & 0x08);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/deadang.c b/src/mame/video/deadang.c
index 70c1281417a..ea39a2121f3 100644
--- a/src/mame/video/deadang.c
+++ b/src/mame/video/deadang.c
@@ -6,14 +6,14 @@
WRITE16_HANDLER( deadang_foreground_w )
{
- deadang_state *state = space->machine->driver_data<deadang_state>();
+ deadang_state *state = space->machine().driver_data<deadang_state>();
COMBINE_DATA(&state->video_data[offset]);
tilemap_mark_tile_dirty( state->pf1_layer, offset );
}
WRITE16_HANDLER( deadang_text_w )
{
- deadang_state *state = space->machine->driver_data<deadang_state>();
+ deadang_state *state = space->machine().driver_data<deadang_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty( state->text_layer, offset );
@@ -21,7 +21,7 @@ WRITE16_HANDLER( deadang_text_w )
WRITE16_HANDLER( deadang_bank_w )
{
- deadang_state *state = space->machine->driver_data<deadang_state>();
+ deadang_state *state = space->machine().driver_data<deadang_state>();
if (ACCESSING_BITS_0_7)
{
state->deadangle_tilebank = data&1;
@@ -42,21 +42,21 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( get_pf3_tile_info )
{
- const UINT16 *bgMap = (const UINT16 *)machine->region("gfx6")->base();
+ const UINT16 *bgMap = (const UINT16 *)machine.region("gfx6")->base();
int code= bgMap[tile_index];
SET_TILE_INFO(4,code&0x7ff,code>>12,0);
}
static TILE_GET_INFO( get_pf2_tile_info )
{
- const UINT16 *bgMap = (const UINT16 *)machine->region("gfx7")->base();
+ const UINT16 *bgMap = (const UINT16 *)machine.region("gfx7")->base();
int code= bgMap[tile_index];
SET_TILE_INFO(3,code&0x7ff,code>>12,0);
}
static TILE_GET_INFO( get_pf1_tile_info )
{
- deadang_state *state = machine->driver_data<deadang_state>();
+ deadang_state *state = machine.driver_data<deadang_state>();
int tile=state->video_data[tile_index];
int color=tile >> 12;
tile=tile&0xfff;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_pf1_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- deadang_state *state = machine->driver_data<deadang_state>();
+ deadang_state *state = machine.driver_data<deadang_state>();
UINT16 *videoram = state->videoram;
int tile=(videoram[tile_index] & 0xff) | ((videoram[tile_index] >> 6) & 0x300);
int color=(videoram[tile_index] >> 8)&0xf;
@@ -76,7 +76,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( deadang )
{
- deadang_state *state = machine->driver_data<deadang_state>();
+ deadang_state *state = machine.driver_data<deadang_state>();
state->pf3_layer = tilemap_create(machine, get_pf3_tile_info,bg_scan, 16,16,128,256);
state->pf2_layer = tilemap_create(machine, get_pf2_tile_info,bg_scan, 16,16,128,256);
state->pf1_layer = tilemap_create(machine, get_pf1_tile_info,tilemap_scan_cols,16,16, 32, 32);
@@ -87,9 +87,9 @@ VIDEO_START( deadang )
tilemap_set_transparent_pen(state->text_layer, 15);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- deadang_state *state = machine->driver_data<deadang_state>();
+ deadang_state *state = machine.driver_data<deadang_state>();
UINT16 *spriteram16 = state->spriteram;
int offs,fx,fy,x,y,color,sprite,pri;
@@ -123,16 +123,16 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (fy) fy=0; else fy=1;
}
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
color,fx,fy,x,y,
- machine->priority_bitmap,pri,15);
+ machine.priority_bitmap,pri,15);
}
}
SCREEN_UPDATE( deadang )
{
- deadang_state *state = screen->machine->driver_data<deadang_state>();
+ deadang_state *state = screen->machine().driver_data<deadang_state>();
/* Setup the tilemaps */
tilemap_set_scrolly( state->pf3_layer,0, ((state->scroll_ram[0x01]&0xf0)<<4)+((state->scroll_ram[0x02]&0x7f)<<1)+((state->scroll_ram[0x02]&0x80)>>7) );
tilemap_set_scrollx( state->pf3_layer,0, ((state->scroll_ram[0x09]&0xf0)<<4)+((state->scroll_ram[0x0a]&0x7f)<<1)+((state->scroll_ram[0x0a]&0x80)>>7) );
@@ -154,14 +154,14 @@ SCREEN_UPDATE( deadang )
tilemap_set_enable(state->pf3_layer,!(state->scroll_ram[0x34]&1));
tilemap_set_enable(state->pf1_layer,!(state->scroll_ram[0x34]&2));
tilemap_set_enable(state->pf2_layer,!(state->scroll_ram[0x34]&4));
- flip_screen_set(screen->machine, state->scroll_ram[0x34]&0x40 );
+ flip_screen_set(screen->machine(), state->scroll_ram[0x34]&0x40 );
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->pf3_layer,0,1);
tilemap_draw(bitmap,cliprect,state->pf1_layer,0,2);
tilemap_draw(bitmap,cliprect,state->pf2_layer,0,4);
- if (!(state->scroll_ram[0x34]&0x10)) draw_sprites(screen->machine,bitmap,cliprect);
+ if (!(state->scroll_ram[0x34]&0x10)) draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->text_layer,0,0);
return 0;
}
diff --git a/src/mame/video/dec0.c b/src/mame/video/dec0.c
index 72a37ba3eb3..f631620c26b 100644
--- a/src/mame/video/dec0.c
+++ b/src/mame/video/dec0.c
@@ -13,33 +13,33 @@
WRITE16_HANDLER( dec0_update_sprites_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
memcpy(state->buffered_spriteram,state->spriteram,0x800);
}
/******************************************************************************/
-static void update_24bitcol(running_machine *machine, int offset)
+static void update_24bitcol(running_machine &machine, int offset)
{
int r,g,b;
- r = (machine->generic.paletteram.u16[offset] >> 0) & 0xff;
- g = (machine->generic.paletteram.u16[offset] >> 8) & 0xff;
- b = (machine->generic.paletteram2.u16[offset] >> 0) & 0xff;
+ r = (machine.generic.paletteram.u16[offset] >> 0) & 0xff;
+ g = (machine.generic.paletteram.u16[offset] >> 8) & 0xff;
+ b = (machine.generic.paletteram2.u16[offset] >> 0) & 0xff;
palette_set_color(machine,offset,MAKE_RGB(r,g,b));
}
WRITE16_HANDLER( dec0_paletteram_rg_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
WRITE16_HANDLER( dec0_paletteram_b_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
/******************************************************************************/
@@ -47,18 +47,18 @@ WRITE16_HANDLER( dec0_paletteram_b_w )
SCREEN_UPDATE( hbarrel )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, 0x08, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, 0x08, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
/* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -66,38 +66,38 @@ SCREEN_UPDATE( hbarrel )
SCREEN_UPDATE( baddudes )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
/* WARNING: inverted wrt Midnight Resistance */
if ((state->pri & 0x01) == 0)
{
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 2)
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
if (state->pri & 4)
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
}
else
{
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 2)
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
if (state->pri & 4)
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
}
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -105,10 +105,10 @@ SCREEN_UPDATE( baddudes )
SCREEN_UPDATE( robocop )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
int trans;
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
if (state->pri & 0x04)
trans = 0x08;
@@ -121,29 +121,29 @@ SCREEN_UPDATE( robocop )
/* Robocop uses it only for the title screen, so this might be just */
/* completely wrong. The top 8 bits of the register might mean */
/* something (they are 0x80 in midres, 0x00 here) */
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans^0x08, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans^0x08, 0x0f);
else
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -151,16 +151,16 @@ SCREEN_UPDATE( robocop )
SCREEN_UPDATE( birdtry )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
/* This game doesn't have the extra playfield chip on the game board, but
the palette does show through. */
- bitmap_fill(bitmap,cliprect,screen->machine->pens[768]);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[768]);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -168,22 +168,22 @@ SCREEN_UPDATE( birdtry )
SCREEN_UPDATE( hippodrm )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
if (state->pri & 0x01)
{
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -191,19 +191,19 @@ SCREEN_UPDATE( hippodrm )
SCREEN_UPDATE( slyspy )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
/* Redraw top 8 pens of top 8 palettes over sprites */
if (state->pri&0x80)
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
@@ -211,10 +211,10 @@ SCREEN_UPDATE( slyspy )
SCREEN_UPDATE( midres )
{
- dec0_state *state = screen->machine->driver_data<dec0_state>();
+ dec0_state *state = screen->machine().driver_data<dec0_state>();
int trans;
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
if (state->pri & 0x04)
trans = 0x00;
@@ -222,48 +222,48 @@ SCREEN_UPDATE( midres )
if (state->pri & 0x01)
{
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
else
{
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
}
if (state->pri & 0x02)
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
else
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
WRITE16_HANDLER( dec0_priority_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
COMBINE_DATA(&state->pri);
}
VIDEO_START( dec0_nodma )
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
state->buffered_spriteram = state->spriteram;
}
VIDEO_START( dec0 )
{
- dec0_state *state = machine->driver_data<dec0_state>();
+ dec0_state *state = machine.driver_data<dec0_state>();
VIDEO_START_CALL(dec0_nodma);
state->buffered_spriteram = auto_alloc_array(machine, UINT16, 0x800/2);
}
diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c
index a8e1f09b23d..9f3dfbfb944 100644
--- a/src/mame/video/dec8.c
+++ b/src/mame/video/dec8.c
@@ -78,7 +78,7 @@ PALETTE_INIT( ghostb )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -92,10 +92,10 @@ PALETTE_INIT( ghostb )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine, i, MAKE_RGB(r, g, b));
@@ -104,28 +104,28 @@ PALETTE_INIT( ghostb )
WRITE8_HANDLER( dec8_bg_data_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->bg_data[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
READ8_HANDLER( dec8_bg_data_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
return state->bg_data[offset];
}
WRITE8_HANDLER( dec8_videoram_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fix_tilemap, offset / 2);
}
WRITE8_HANDLER( srdarwin_videoram_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fix_tilemap, offset);
}
@@ -133,18 +133,18 @@ WRITE8_HANDLER( srdarwin_videoram_w )
WRITE8_HANDLER( dec8_scroll2_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->scroll2[offset] = data;
}
WRITE8_HANDLER( srdarwin_control_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
case 0: /* Top 3 bits - bank switch, bottom 4 - scroll MSB */
- memory_set_bank(space->machine, "bank1", (data >> 5));
+ memory_set_bank(space->machine(), "bank1", (data >> 5));
state->scroll2[0] = data & 0xf;
return;
@@ -156,7 +156,7 @@ WRITE8_HANDLER( srdarwin_control_w )
WRITE8_HANDLER( lastmisn_control_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/*
Bit 0x0f - ROM bank switch.
@@ -165,7 +165,7 @@ WRITE8_HANDLER( lastmisn_control_w )
Bit 0x40 - Y scroll MSB
Bit 0x80 - Hold subcpu reset line high if clear, else low
*/
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
state->scroll2[0] = (data >> 5) & 1;
state->scroll2[2] = (data >> 6) & 1;
@@ -178,10 +178,10 @@ WRITE8_HANDLER( lastmisn_control_w )
WRITE8_HANDLER( shackled_control_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/* Bottom 4 bits - bank switch, Bits 4 & 5 - Scroll MSBs */
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
state->scroll2[0] = (data >> 5) & 1;
state->scroll2[2] = (data >> 6) & 1;
@@ -189,19 +189,19 @@ WRITE8_HANDLER( shackled_control_w )
WRITE8_HANDLER( lastmisn_scrollx_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->scroll2[1] = data;
}
WRITE8_HANDLER( lastmisn_scrolly_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->scroll2[3] = data;
}
WRITE8_HANDLER( gondo_scroll_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
case 0x0:
@@ -221,9 +221,9 @@ WRITE8_HANDLER( gondo_scroll_w )
/******************************************************************************/
/* 'Karnov' sprites, used by Gondomania, Last Mission, Shackled, Ghostbusters */
-static void draw_sprites1( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites1( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs, x, y, sprite, sprite2, colour, extra, fx, fy;
for (offs = 0; offs < 0x800; offs += 8)
@@ -272,22 +272,22 @@ static void draw_sprites1( running_machine* machine, bitmap_t *bitmap, const rec
else
sprite2 = sprite + 1;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
colour,fx,fy,x,y,0);
/* 1 more sprite drawn underneath */
if (extra)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite2,
colour,fx,fy,x,y+16,0);
}
}
-static void srdarwin_draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
/* Sprites */
@@ -319,13 +319,13 @@ static void srdarwin_draw_sprites( running_machine* machine, bitmap_t *bitmap, c
}
else sy2 = sy + 16;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
fx,flip_screen_get(machine),
sx,sy,0);
if (multi)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code+1,
color,
fx,flip_screen_get(machine),
@@ -337,14 +337,14 @@ static void srdarwin_draw_sprites( running_machine* machine, bitmap_t *bitmap, c
SCREEN_UPDATE( cobracom )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
- flip_screen_set(screen->machine, state->bg_control[0] >> 7);
+ flip_screen_set(screen->machine(), state->bg_control[0] >> 7);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram16, 0x04, 0x00, 0x03);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram16, 0x04, 0x04, 0x03);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram16, 0x04, 0x00, 0x03);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram16, 0x04, 0x04, 0x03);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
@@ -354,7 +354,7 @@ SCREEN_UPDATE( cobracom )
static TILE_GET_INFO( get_cobracom_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index << 1;
int tile = state->videoram[offs + 1] + (state->videoram[offs] << 8);
int color = (tile & 0xe000) >> 13;
@@ -368,14 +368,14 @@ static TILE_GET_INFO( get_cobracom_fix_tile_info )
VIDEO_START( cobracom )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->fix_tilemap = tilemap_create(machine, get_cobracom_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fix_tilemap, 0);
state->game_uses_priority = 0;
- machine->device<deco_bac06_device>("tilegen1")->set_colmask(0x3);
- machine->device<deco_bac06_device>("tilegen2")->set_colmask(0x3);
+ machine.device<deco_bac06_device>("tilegen1")->set_colmask(0x3);
+ machine.device<deco_bac06_device>("tilegen2")->set_colmask(0x3);
}
@@ -383,16 +383,16 @@ VIDEO_START( cobracom )
SCREEN_UPDATE( ghostb )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- draw_sprites1(screen->machine, bitmap, cliprect, 0);
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
static TILE_GET_INFO( get_ghostb_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index << 1;
int tile = state->videoram[offs + 1] + (state->videoram[offs] << 8);
int color = (tile & 0xc00) >> 10;
@@ -406,32 +406,32 @@ static TILE_GET_INFO( get_ghostb_fix_tile_info )
VIDEO_START( ghostb )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->fix_tilemap = tilemap_create(machine, get_ghostb_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fix_tilemap, 0);
state->game_uses_priority = 0;
- machine->device<deco_bac06_device>("tilegen1")->set_colmask(0xf);
+ machine.device<deco_bac06_device>("tilegen1")->set_colmask(0xf);
}
/******************************************************************************/
SCREEN_UPDATE( oscar )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
- flip_screen_set(screen->machine, state->bg_control[1] >> 7);
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
+ flip_screen_set(screen->machine(), state->bg_control[1] >> 7);
// we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->buffered_spriteram16, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->buffered_spriteram16, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x08,0x08,0x08,0x08);
tilemap_draw(bitmap,cliprect, state->fix_tilemap, 0, 0);
return 0;
}
static TILE_GET_INFO( get_oscar_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index << 1;
int tile = state->videoram[offs + 1] + (state->videoram[offs] << 8);
int color = (tile & 0xf000) >> 14;
@@ -445,13 +445,13 @@ static TILE_GET_INFO( get_oscar_fix_tile_info )
VIDEO_START( oscar )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->fix_tilemap = tilemap_create(machine, get_oscar_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fix_tilemap, 0);
state->game_uses_priority = 1;
- machine->device<deco_bac06_device>("tilegen1")->set_colmask(0x7);
+ machine.device<deco_bac06_device>("tilegen1")->set_colmask(0x7);
}
@@ -459,26 +459,26 @@ VIDEO_START( oscar )
SCREEN_UPDATE( lastmisn )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->scroll2[0] << 8)+ state->scroll2[1]));
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->scroll2[2] << 8)+ state->scroll2[3]));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites1(screen->machine, bitmap, cliprect, 0);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( shackled )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->scroll2[0] << 8) + state->scroll2[1]));
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->scroll2[2] << 8) + state->scroll2[3]));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
- draw_sprites1(screen->machine, bitmap, cliprect, 0);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
@@ -492,7 +492,7 @@ static TILEMAP_MAPPER( lastmisn_scan_rows )
static TILE_GET_INFO( get_lastmisn_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index * 2;
int tile = state->bg_data[offs + 1] + (state->bg_data[offs] << 8);
int color = tile >> 12;
@@ -511,7 +511,7 @@ static TILE_GET_INFO( get_lastmisn_tile_info )
static TILE_GET_INFO( get_lastmisn_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index << 1;
int tile = state->videoram[offs + 1] + (state->videoram[offs] << 8);
int color = (tile & 0xc000) >> 14;
@@ -525,7 +525,7 @@ static TILE_GET_INFO( get_lastmisn_fix_tile_info )
VIDEO_START( lastmisn )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->bg_tilemap = tilemap_create(machine, get_lastmisn_tile_info, lastmisn_scan_rows, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_lastmisn_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -535,7 +535,7 @@ VIDEO_START( lastmisn )
VIDEO_START( shackled )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->bg_tilemap = tilemap_create(machine, get_lastmisn_tile_info, lastmisn_scan_rows, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_lastmisn_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -548,20 +548,20 @@ VIDEO_START( shackled )
SCREEN_UPDATE( srdarwin )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, (state->scroll2[0] << 8) + state->scroll2[1]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- srdarwin_draw_sprites(screen->machine, bitmap, cliprect, 0); //* (srdarwin37b5gre)
+ srdarwin_draw_sprites(screen->machine(), bitmap, cliprect, 0); //* (srdarwin37b5gre)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- srdarwin_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ srdarwin_draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
static TILE_GET_INFO( get_srdarwin_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int tile = state->videoram[tile_index];
int color = 0; /* ? */
@@ -580,7 +580,7 @@ static TILE_GET_INFO( get_srdarwin_fix_tile_info )
//AT: improved priority and fixed stage 4+ crashes caused by bank overflow
static TILE_GET_INFO( get_srdarwin_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int tile = state->bg_data[2 * tile_index + 1] + (state->bg_data[2 * tile_index] << 8);
int color = tile >> 12 & 3;
int bank;
@@ -598,7 +598,7 @@ static TILE_GET_INFO( get_srdarwin_tile_info )
VIDEO_START( srdarwin )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->bg_tilemap = tilemap_create(machine, get_srdarwin_tile_info, tilemap_scan_rows, 16, 16, 32, 16);
state->fix_tilemap = tilemap_create(machine, get_srdarwin_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -613,26 +613,26 @@ VIDEO_START( srdarwin )
SCREEN_UPDATE( gondo )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->scroll2[0] << 8) + state->scroll2[1]));
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->scroll2[2] << 8) + state->scroll2[3]));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites1(screen->machine, bitmap, cliprect, 2);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- draw_sprites1(screen->machine, bitmap, cliprect, 1);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( garyoret )
{
- dec8_state *state = screen->machine->driver_data<dec8_state>();
+ dec8_state *state = screen->machine().driver_data<dec8_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->scroll2[0] << 8) + state->scroll2[1]));
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->scroll2[2] << 8) + state->scroll2[3]));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites1(screen->machine, bitmap, cliprect, 0);
+ draw_sprites1(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
@@ -640,7 +640,7 @@ SCREEN_UPDATE( garyoret )
static TILE_GET_INFO( get_gondo_fix_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index * 2;
int tile = state->videoram[offs + 1] + (state->videoram[offs] << 8);
int color = (tile & 0x7000) >> 12;
@@ -654,7 +654,7 @@ static TILE_GET_INFO( get_gondo_fix_tile_info )
static TILE_GET_INFO( get_gondo_tile_info )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int offs = tile_index * 2;
int tile = state->bg_data[offs + 1] + (state->bg_data[offs] << 8);
int color = tile>> 12;
@@ -673,7 +673,7 @@ static TILE_GET_INFO( get_gondo_tile_info )
VIDEO_START( gondo )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->fix_tilemap = tilemap_create(machine, get_gondo_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_gondo_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -684,7 +684,7 @@ VIDEO_START( gondo )
VIDEO_START( garyoret )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->fix_tilemap = tilemap_create(machine, get_gondo_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_gondo_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
diff --git a/src/mame/video/decbac06.c b/src/mame/video/decbac06.c
index ade2e97c4f7..390bc9c7b2f 100644
--- a/src/mame/video/decbac06.c
+++ b/src/mame/video/decbac06.c
@@ -76,7 +76,7 @@ device_config *deco_bac06_device_config::static_alloc_device_config(const machin
device_t *deco_bac06_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, deco_bac06_device(machine, *this));
+ return auto_alloc(machine, deco_bac06_device(machine, *this));
}
void deco_bac06_device_config::set_gfx_region_wide(device_config *device, int region8x8, int region16x16, int wide)
@@ -188,9 +188,9 @@ void deco_bac06_device::create_tilemaps(int region8x8, int region16x16)
void deco_bac06_device::device_start()
{
- pf_data = auto_alloc_array_clear(this->machine, UINT16, 0x4000 / 2); // 0x2000 is the maximum needed, some games / chip setups map less and mirror - stadium hero banks this to 0x4000?!
- pf_rowscroll = auto_alloc_array_clear(this->machine, UINT16, 0x2000 / 2);
- pf_colscroll = auto_alloc_array_clear(this->machine, UINT16, 0x2000 / 2);
+ pf_data = auto_alloc_array_clear(this->machine(), UINT16, 0x4000 / 2); // 0x2000 is the maximum needed, some games / chip setups map less and mirror - stadium hero banks this to 0x4000?!
+ pf_rowscroll = auto_alloc_array_clear(this->machine(), UINT16, 0x2000 / 2);
+ pf_colscroll = auto_alloc_array_clear(this->machine(), UINT16, 0x2000 / 2);
create_tilemaps(m_gfxregion8x8, m_gfxregion16x16);
m_gfxcolmask = 0x0f;
@@ -206,7 +206,7 @@ void deco_bac06_device::device_reset()
}
-void deco_bac06_device::custom_tilemap_draw(running_machine *machine,
+void deco_bac06_device::custom_tilemap_draw(running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
tilemap_t *tilemap_ptr,
@@ -304,7 +304,7 @@ void deco_bac06_device::custom_tilemap_draw(running_machine *machine,
}
}
-void deco_bac06_device::deco_bac06_pf_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
+void deco_bac06_device::deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
{
tilemap_t* tm = 0;
@@ -338,7 +338,7 @@ void deco_bac06_device::deco_bac06_pf_draw(running_machine *machine,bitmap_t *bi
}
// used for pocket gal bootleg, which doesn't set registers properly and simply expects a fixed size tilemap.
-void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type)
+void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type)
{
tilemap_t* tm = 0;
if (!mode) tm = pf8x8_tilemap[type];
@@ -363,7 +363,7 @@ WRITE16_DEVICE_HANDLER( deco_bac06_pf_control_0_w )
{
// I don't know WHY Stadium Hero uses this as a bank but the RAM test expects it..
// I'm curious as to if anything else sets it tho
- if (strcmp(dev->machine->system().name,"stadhero"))
+ if (strcmp(dev->machine().system().name,"stadhero"))
printf("tilemap ram bank change to %d\n", newbank&1);
dev->m_rambank = newbank&1;
diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h
index 679f2971f16..ecdf8752601 100644
--- a/src/mame/video/decbac06.h
+++ b/src/mame/video/decbac06.h
@@ -34,8 +34,8 @@ public:
UINT16 pf_control_0[8];
UINT16 pf_control_1[8];
- void deco_bac06_pf_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
- void deco_bac06_pf_draw_bootleg(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type);
+ void deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
+ void deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type);
UINT8 get_flip_state(void) { return pf_control_0[0]&0x80; };
void set_colmask(int data) { m_gfxcolmask = data; }
@@ -55,7 +55,7 @@ protected:
UINT8 m_bppmult;
UINT8 m_bppmask;
- void custom_tilemap_draw(running_machine *machine,
+ void custom_tilemap_draw(running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
tilemap_t *tilemap_ptr,
diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c
index 838d6425ea0..6b87eaafdc5 100644
--- a/src/mame/video/decmxc06.c
+++ b/src/mame/video/decmxc06.c
@@ -53,7 +53,7 @@ device_config *deco_mxc06_device_config::static_alloc_device_config(const machin
device_t *deco_mxc06_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, deco_mxc06_device(machine, *this));
+ return auto_alloc(machine, deco_mxc06_device(machine, *this));
}
void deco_mxc06_device_config::set_gfx_region(device_config *device, int region)
@@ -72,7 +72,7 @@ deco_mxc06_device::deco_mxc06_device(running_machine &_machine, const deco_mxc06
/* this implementation was originally from Mad Motor */
-void deco_mxc06_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask )
+void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask )
{
int offs;
@@ -130,7 +130,7 @@ void deco_mxc06_device::draw_sprites( running_machine *machine, bitmap_t *bitmap
if (spriteram[offs] & 0x8000)
{
int draw = 0;
- if (!flash || (machine->primary_screen->frame_number() & 1))
+ if (!flash || (machine.primary_screen->frame_number() & 1))
{
if (m_priority_type==0) // most cases
@@ -154,7 +154,7 @@ void deco_mxc06_device::draw_sprites( running_machine *machine, bitmap_t *bitmap
if (draw)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
code - y * incy + h * x,
color & col_mask,
flipx,flipy,
diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h
index 30f7e843c1f..3b66120d210 100644
--- a/src/mame/video/decmxc06.h
+++ b/src/mame/video/decmxc06.h
@@ -20,7 +20,7 @@ class deco_mxc06_device : public device_t
deco_mxc06_device(running_machine &_machine, const deco_mxc06_device_config &config);
public:
void set_gfxregion(int region) { m_gfxregion = region; };
- void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
+ void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
void set_pri_type( int type ) { m_priority_type = type; }
protected:
virtual void device_start();
diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c
index 74690e6d550..c411ceb959e 100644
--- a/src/mame/video/deco16ic.c
+++ b/src/mame/video/deco16ic.c
@@ -376,7 +376,7 @@ static void custom_tilemap_draw(
int is_tattoo
)
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
tilemap_t *tilemap0 = BIT(control1, 7) ? tilemap0_8x8 : tilemap0_16x16;
tilemap_t *tilemap1 = BIT(control1, 7) ? tilemap1_8x8 : tilemap1_16x16;
const bitmap_t *src_bitmap0 = tilemap0 ? tilemap_get_pixmap(tilemap0) : NULL;
@@ -430,10 +430,10 @@ static void custom_tilemap_draw(
if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask))
{
- *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p];
- if (machine->priority_bitmap)
+ *BITMAP_ADDR16(bitmap, y, x) = machine.pens[p];
+ if (machine.priority_bitmap)
{
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
pri[x] |= priority;
}
}
@@ -468,10 +468,10 @@ static void custom_tilemap_draw(
if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask))
{
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[p];
- if (machine->priority_bitmap)
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[p];
+ if (machine.priority_bitmap)
{
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
pri[x] |= priority;
}
}
@@ -592,7 +592,7 @@ WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w )
{
deco16ic_state *deco16ic = get_safe_token(device);
COMBINE_DATA(&deco16ic->pf12_control[offset]);
- device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
+ device->machine().primary_screen->update_partial(device->machine().primary_screen->vpos());
}
READ16_DEVICE_HANDLER( deco16ic_pf_control_r )
@@ -836,7 +836,7 @@ void deco16ic_print_debug_info(device_t *device, bitmap_t *bitmap)
deco16ic_state *deco16ic = get_safe_token(device);
char buf[64*5];
- if (input_code_pressed(device->machine, KEYCODE_O))
+ if (input_code_pressed(device->machine(), KEYCODE_O))
return;
if (deco16ic->pf12_control)
@@ -847,7 +847,7 @@ void deco16ic_print_debug_info(device_t *device, bitmap_t *bitmap)
else
sprintf(buf, "\n\n");
- ui_draw_text(&device->machine->render().ui_container(), buf, 60, 40);
+ ui_draw_text(&device->machine().render().ui_container(), buf, 60, 40);
}
/*****************************************************************************************/
@@ -951,9 +951,9 @@ static DEVICE_START( deco16ic )
deco16ic->pf1_8bpp_mode = 0;
- deco16ic->pf1_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2);
- deco16ic->pf2_data = auto_alloc_array_clear(device->machine, UINT16, 0x2000 / 2);
- deco16ic->pf12_control = auto_alloc_array_clear(device->machine, UINT16, 0x10 / 2);
+ deco16ic->pf1_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
+ deco16ic->pf2_data = auto_alloc_array_clear(device->machine(), UINT16, 0x2000 / 2);
+ deco16ic->pf12_control = auto_alloc_array_clear(device->machine(), UINT16, 0x10 / 2);
device->save_item(NAME(deco16ic->use_custom_pf1));
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index 12cf4012b7d..6053f47fb9b 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -7,26 +7,26 @@
WRITE32_HANDLER( deco32_pri_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
state->pri=data;
}
WRITE32_HANDLER( dragngun_sprite_control_w )
{
- dragngun_state *state = space->machine->driver_data<dragngun_state>();
+ dragngun_state *state = space->machine().driver_data<dragngun_state>();
state->dragngun_sprite_ctrl=data;
}
WRITE32_HANDLER( dragngun_spriteram_dma_w )
{
/* DMA spriteram to private sprite chip area, and clear cpu ram */
- memcpy(space->machine->generic.buffered_spriteram.u32,space->machine->generic.spriteram.u32,space->machine->generic.spriteram_size);
- memset(space->machine->generic.spriteram.u32,0,0x2000);
+ memcpy(space->machine().generic.buffered_spriteram.u32,space->machine().generic.spriteram.u32,space->machine().generic.spriteram_size);
+ memset(space->machine().generic.spriteram.u32,0,0x2000);
}
WRITE32_HANDLER( deco32_ace_ram_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
/* Some notes pieced together from Tattoo Assassins info:
Bytes 0 to 0x58 - object alpha control?
@@ -64,9 +64,9 @@ WRITE32_HANDLER( deco32_ace_ram_w )
COMBINE_DATA(&state->ace_ram[offset]);
}
-static void updateAceRam(running_machine* machine)
+static void updateAceRam(running_machine& machine)
{
- deco32_state *state = machine->driver_data<deco32_state>();
+ deco32_state *state = machine.driver_data<deco32_state>();
int r,g,b,i;
UINT8 fadeptr=state->ace_ram[0x20];
UINT8 fadeptg=state->ace_ram[0x21];
@@ -81,9 +81,9 @@ static void updateAceRam(running_machine* machine)
for (i=0; i<2048; i++)
{
/* Lerp palette entry to 'fadept' according to 'fadeps' */
- b = (machine->generic.paletteram.u32[i] >>16) & 0xff;
- g = (machine->generic.paletteram.u32[i] >> 8) & 0xff;
- r = (machine->generic.paletteram.u32[i] >> 0) & 0xff;
+ b = (machine.generic.paletteram.u32[i] >>16) & 0xff;
+ g = (machine.generic.paletteram.u32[i] >> 8) & 0xff;
+ r = (machine.generic.paletteram.u32[i] >> 0) & 0xff;
if (i>255) /* Screenshots seem to suggest ACE fades do not affect playfield 1 palette (0-255) */
{
@@ -106,26 +106,26 @@ WRITE32_HANDLER( deco32_nonbuffered_palette_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- b = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- r = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
WRITE32_HANDLER( deco32_buffered_palette_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
state->dirty_palette[offset]=1;
}
WRITE32_HANDLER( deco32_palette_dma_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- const int m=space->machine->total_colors();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ const int m=space->machine().total_colors();
int r,g,b,i;
for (i=0; i<m; i++) {
@@ -138,11 +138,11 @@ WRITE32_HANDLER( deco32_palette_dma_w )
}
else
{
- b = (space->machine->generic.paletteram.u32[i] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[i] >> 8) & 0xff;
- r = (space->machine->generic.paletteram.u32[i] >> 0) & 0xff;
+ b = (space->machine().generic.paletteram.u32[i] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[i] >> 8) & 0xff;
+ r = (space->machine().generic.paletteram.u32[i] >> 0) & 0xff;
- palette_set_color(space->machine,i,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),i,MAKE_RGB(r,g,b));
}
}
}
@@ -187,7 +187,7 @@ INLINE void dragngun_drawgfxzoom(
{
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
if (sprite_screen_width && sprite_screen_height)
@@ -352,9 +352,9 @@ INLINE void dragngun_drawgfxzoom(
}
}
-static void dragngun_draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata)
+static void dragngun_draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata)
{
- dragngun_state *state = machine->driver_data<dragngun_state>();
+ dragngun_state *state = machine.driver_data<dragngun_state>();
const UINT32 *layout_ram;
const UINT32 *lookup_ram;
int offs;
@@ -500,7 +500,7 @@ static void dragngun_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
if (zoomx!=0x10000 || zoomy!=0x10000)
dragngun_drawgfxzoom(
- bitmap,cliprect,machine->gfx[bank],
+ bitmap,cliprect,machine.gfx[bank],
sprite,
colour,
fx,fy,
@@ -508,7 +508,7 @@ static void dragngun_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
15,zoomx,zoomy,NULL,0,
((xpos+(zoomx<<4))>>16) - (xpos>>16), ((ypos+(zoomy<<4))>>16) - (ypos>>16), alpha );
else
- drawgfx_alpha(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[bank],
sprite,
colour,
fx,fy,
@@ -532,21 +532,21 @@ static void dragngun_draw_sprites(running_machine* machine, bitmap_t *bitmap, co
VIDEO_START( captaven )
{
- deco32_state *state = machine->driver_data<deco32_state>();
+ deco32_state *state = machine.driver_data<deco32_state>();
state->has_ace_ram=0;
}
VIDEO_START( fghthist )
{
- deco32_state *state = machine->driver_data<deco32_state>();
+ deco32_state *state = machine.driver_data<deco32_state>();
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
- machine->device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(machine);
state->has_ace_ram=0;
}
VIDEO_START( dragngun )
{
- dragngun_state *state = machine->driver_data<dragngun_state>();
+ dragngun_state *state = machine.driver_data<dragngun_state>();
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
memset(state->dirty_palette,0,4096);
@@ -557,7 +557,7 @@ VIDEO_START( dragngun )
VIDEO_START( lockload )
{
- dragngun_state *state = machine->driver_data<dragngun_state>();
+ dragngun_state *state = machine.driver_data<dragngun_state>();
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
memset(state->dirty_palette,0,4096);
@@ -568,14 +568,14 @@ VIDEO_START( lockload )
VIDEO_START( nslasher )
{
- deco32_state *state = machine->driver_data<deco32_state>();
+ deco32_state *state = machine.driver_data<deco32_state>();
int width, height;
state->dirty_palette = auto_alloc_array(machine, UINT8, 4096);
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->tilemap_alpha_bitmap=auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16 );
- machine->device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
- machine->device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
memset(state->dirty_palette,0,4096);
state_save_register_global(machine, state->pri);
state->has_ace_ram=1;
@@ -598,14 +598,14 @@ SCREEN_EOF( dragngun )
SCREEN_UPDATE( captaven )
{
- deco32_state *state = screen->machine->driver_data<deco32_state>();
- state->deco_tilegen1 = screen->machine->device("tilegen1");
- state->deco_tilegen2 = screen->machine->device("tilegen2");
+ deco32_state *state = screen->machine().driver_data<deco32_state>();
+ state->deco_tilegen1 = screen->machine().device("tilegen1");
+ state->deco_tilegen2 = screen->machine().device("tilegen2");
- tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0x000]); // Palette index not confirmed
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0x000]); // Palette index not confirmed
deco16ic_set_pf1_8bpp_mode(state->deco_tilegen2, 1);
@@ -627,19 +627,19 @@ SCREEN_UPDATE( captaven )
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->set_alt_format(true);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->set_alt_format(true);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16_buffered, 0x400);
return 0;
}
SCREEN_UPDATE( dragngun )
{
- deco32_state *state = screen->machine->driver_data<deco32_state>();
- state->deco_tilegen1 = screen->machine->device("tilegen1");
- state->deco_tilegen2 = screen->machine->device("tilegen2");
+ deco32_state *state = screen->machine().driver_data<deco32_state>();
+ state->deco_tilegen1 = screen->machine().device("tilegen1");
+ state->deco_tilegen2 = screen->machine().device("tilegen2");
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
@@ -668,7 +668,7 @@ SCREEN_UPDATE( dragngun )
clip.min_y = 8;
clip.max_y = 247;
- dragngun_draw_sprites(screen->machine,bitmap,&clip,screen->machine->generic.buffered_spriteram.u32);
+ dragngun_draw_sprites(screen->machine(),bitmap,&clip,screen->machine().generic.buffered_spriteram.u32);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, &clip, 0, 0);
}
@@ -679,17 +679,17 @@ SCREEN_UPDATE( dragngun )
SCREEN_UPDATE( fghthist )
{
- deco32_state *state = screen->machine->driver_data<deco32_state>();
- state->deco_tilegen1 = screen->machine->device("tilegen1");
- state->deco_tilegen2 = screen->machine->device("tilegen2");
+ deco32_state *state = screen->machine().driver_data<deco32_state>();
+ state->deco_tilegen1 = screen->machine().device("tilegen1");
+ state->deco_tilegen2 = screen->machine().device("tilegen2");
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0x000]); // Palette index not confirmed
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0x000]); // Palette index not confirmed
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x800, true);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16_buffered, 0x800, true);
/* Draw screen */
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 1);
@@ -697,17 +697,17 @@ SCREEN_UPDATE( fghthist )
if(state->pri&1)
{
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 4);
}
else
{
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
}
- screen->machine->device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
@@ -723,20 +723,20 @@ SCREEN_UPDATE( fghthist )
*/
static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
{
- deco32_state *state = gfx0->machine->driver_data<deco32_state>();
- running_machine *machine = gfx0->machine;
- const pen_t *pens = machine->pens;
+ deco32_state *state = gfx0->machine().driver_data<deco32_state>();
+ running_machine &machine = gfx0->machine();
+ const pen_t *pens = machine.pens;
const pen_t *pal0 = &pens[gfx0->color_base];
const pen_t *pal1 = &pens[gfx1->color_base];
- const pen_t *pal2 = &pens[machine->gfx[(state->pri&1) ? 1 : 2]->color_base];
+ const pen_t *pal2 = &pens[machine.gfx[(state->pri&1) ? 1 : 2]->color_base];
int x,y;
- bitmap_t* sprite0_mix_bitmap = machine->device<decospr_device>("spritegen1")->get_sprite_temp_bitmap();
- bitmap_t* sprite1_mix_bitmap = machine->device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
+ bitmap_t* sprite0_mix_bitmap = machine.device<decospr_device>("spritegen1")->get_sprite_temp_bitmap();
+ bitmap_t* sprite1_mix_bitmap = machine.device<decospr_device>("spritegen2")->get_sprite_temp_bitmap();
/* Mix sprites into main bitmap, based on priority & alpha */
for (y=8; y<248; y++) {
- UINT8* tilemapPri=BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8* tilemapPri=BITMAP_ADDR8(machine.priority_bitmap, y, 0);
UINT16* sprite0=BITMAP_ADDR16(sprite0_mix_bitmap, y, 0);
UINT16* sprite1=BITMAP_ADDR16(sprite1_mix_bitmap, y, 0);
UINT32* destLine=BITMAP_ADDR32(bitmap, y, 0);
@@ -856,10 +856,10 @@ static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, con
SCREEN_UPDATE( nslasher )
{
- deco32_state *state = screen->machine->driver_data<deco32_state>();
+ deco32_state *state = screen->machine().driver_data<deco32_state>();
int alphaTilemap=0;
- state->deco_tilegen1 = screen->machine->device("tilegen1");
- state->deco_tilegen2 = screen->machine->device("tilegen2");
+ state->deco_tilegen1 = screen->machine().device("tilegen1");
+ state->deco_tilegen2 = screen->machine().device("tilegen2");
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
@@ -869,18 +869,18 @@ SCREEN_UPDATE( nslasher )
alphaTilemap=1;
if (state->ace_ram_dirty)
- updateAceRam(screen->machine);
+ updateAceRam(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0x200]);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0x200]);
/* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */
- screen->machine->device<decospr_device>("spritegen1")->set_pix_raw_shift(8);
- screen->machine->device<decospr_device>("spritegen2")->set_pix_raw_shift(8);
+ screen->machine().device<decospr_device>("spritegen1")->set_pix_raw_shift(8);
+ screen->machine().device<decospr_device>("spritegen2")->set_pix_raw_shift(8);
- screen->machine->device<decospr_device>("spritegen1")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_buffered, 0x800, true);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram16_2_buffered, 0x800, true);
+ screen->machine().device<decospr_device>("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16_buffered, 0x800, true);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram16_2_buffered, 0x800, true);
/* Render alpha-blended tilemap to seperate buffer for proper mixing */
@@ -913,7 +913,7 @@ SCREEN_UPDATE( nslasher )
}
}
- mixDualAlphaSprites(bitmap, cliprect, screen->machine->gfx[3], screen->machine->gfx[4], alphaTilemap);
+ mixDualAlphaSprites(bitmap, cliprect, screen->machine().gfx[3], screen->machine().gfx[4], alphaTilemap);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/deco_mlc.c b/src/mame/video/deco_mlc.c
index a70b8192757..ac438602b4b 100644
--- a/src/mame/video/deco_mlc.c
+++ b/src/mame/video/deco_mlc.c
@@ -19,10 +19,10 @@
VIDEO_START( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
- if (machine->gfx[0]->color_granularity==16)
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
+ if (machine.gfx[0]->color_granularity==16)
state->colour_mask=0x7f;
- else if (machine->gfx[0]->color_granularity==32)
+ else if (machine.gfx[0]->color_granularity==32)
state->colour_mask=0x3f;
else
state->colour_mask=0x1f;
@@ -32,9 +32,9 @@ VIDEO_START( mlc )
}
#ifdef UNUSED_FUNCTION
-static void blitRaster(running_machine *machine, bitmap_t *bitmap, int rasterMode)
+static void blitRaster(running_machine &machine, bitmap_t *bitmap, int rasterMode)
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
int x,y;
for (y=0; y<256; y++) //todo
{
@@ -97,7 +97,7 @@ static void mlc_drawgfxzoom(
{
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base1 = gfx_element_get_data(gfx, code1 % gfx->total_elements);
const UINT8 *code_base2 = gfx_element_get_data(gfx, code2 % gfx->total_elements);
@@ -225,14 +225,14 @@ static void mlc_drawgfxzoom(
}
}
-static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
UINT32 *index_ptr=0;
int offs,fx=0,fy=0,x,y,color,colorOffset,sprite,indx,h,w,bx,by,fx1,fy1;
int xoffs,yoffs;
- UINT8 *rom = machine->region("gfx2")->base() + 0x20000, *index_ptr8;
- UINT8 *rawrom = machine->region("gfx2")->base();
+ UINT8 *rom = machine.region("gfx2")->base() + 0x20000, *index_ptr8;
+ UINT8 *rawrom = machine.region("gfx2")->base();
int blockIsTilemapIndex=0;
int sprite2=0,indx2=0,use8bppMode=0;
int yscale,xscale;
@@ -252,7 +252,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
{
if ((mlc_spriteram[offs+0]&0x8000)==0)
continue;
- if ((mlc_spriteram[offs+1]&0x2000) && (machine->primary_screen->frame_number() & 1))
+ if ((mlc_spriteram[offs+1]&0x2000) && (machine.primary_screen->frame_number() & 1))
continue;
/*
@@ -482,7 +482,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
// rasterDirty=1;
mlc_drawgfxzoom(
- /*rasterMode ? temp_bitmap : */bitmap,&user_clip,machine->gfx[0],
+ /*rasterMode ? temp_bitmap : */bitmap,&user_clip,machine.gfx[0],
tile,tile2,
color + colorOffset,fx,fy,xbase,ybase,
0,
@@ -511,7 +511,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap,const rectan
SCREEN_EOF( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
/* Spriteram is definitely double buffered, as the vram lookup tables
are often updated a frame after spriteram is setup to point to a new
lookup table. Without buffering incorrect one frame glitches are seen
@@ -523,7 +523,7 @@ SCREEN_EOF( mlc )
SCREEN_UPDATE( mlc )
{
// bitmap_fill(temp_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0]); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
- draw_sprites(screen->machine,bitmap,cliprect);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0]); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/decocass.c b/src/mame/video/decocass.c
index 1843a0a3bbc..2759956f7c4 100644
--- a/src/mame/video/decocass.c
+++ b/src/mame/video/decocass.c
@@ -46,9 +46,9 @@ static const UINT32 tile_offset[32*32] = {
/********************************************
state saving setup
********************************************/
-void decocass_video_state_save_init( running_machine *machine )
+void decocass_video_state_save_init( running_machine &machine )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
state->save_item(NAME(state->watchdog_count));
state->save_item(NAME(state->watchdog_flip));
@@ -82,7 +82,7 @@ static TILEMAP_MAPPER( bgvideoram_scan_cols )
static TILE_GET_INFO( get_bg_l_tile_info )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
int color = (state->color_center_bot >> 7) & 1;
SET_TILE_INFO(
2,
@@ -93,7 +93,7 @@ static TILE_GET_INFO( get_bg_l_tile_info )
static TILE_GET_INFO( get_bg_r_tile_info )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
int color = (state->color_center_bot >> 7) & 1;
SET_TILE_INFO(
2,
@@ -104,7 +104,7 @@ static TILE_GET_INFO( get_bg_r_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
UINT8 code = state->fgvideoram[tile_index];
UINT8 attr = state->colorram[tile_index];
SET_TILE_INFO(
@@ -118,9 +118,9 @@ static TILE_GET_INFO( get_fg_tile_info )
big object
********************************************/
-static void draw_object( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_object( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
int sx, sy, color;
if (0 == (state->mode_set & 0x80)) /* part_h_enable off? */
@@ -135,15 +135,15 @@ static void draw_object( running_machine* machine, bitmap_t *bitmap, const recta
else
sx = 91 - (state->part_h_shift & 0x7f);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 0, color, 0, 0, sx + 64, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 1, color, 0, 0, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 0, color, 0, 1, sx + 64, sy - 64, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], 1, color, 0, 1, sx, sy - 64, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 0, color, 0, 0, sx + 64, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 1, color, 0, 0, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 0, color, 0, 1, sx + 64, sy - 64, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 1, color, 0, 1, sx, sy - 64, 0);
}
-static void draw_center( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_center( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
int sx, sy, x, y, color;
color = 0;
@@ -180,37 +180,37 @@ WRITE8_HANDLER( decocass_paletteram_w )
* (ME/ input on 1st paletteram, inverter -> ME/ on 2nd)
*/
offset = (offset & 31) ^ 16;
- colortable_palette_set_color(space->machine->colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
+ colortable_palette_set_color(space->machine().colortable, offset, MAKE_RGB(pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6)));
}
WRITE8_HANDLER( decocass_charram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->charram[offset] = data;
/* dirty sprite */
- gfx_element_mark_dirty(space->machine->gfx[1], (offset >> 5) & 255);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset >> 5) & 255);
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[0], (offset >> 3) & 1023);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset >> 3) & 1023);
}
WRITE8_HANDLER( decocass_fgvideoram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( decocass_colorram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
-static void mark_bg_tile_dirty( running_machine *machine, offs_t offset )
+static void mark_bg_tile_dirty( running_machine &machine, offs_t offset )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
if (offset & 0x80)
tilemap_mark_tile_dirty(state->bg_tilemap_r, offset);
else
@@ -219,49 +219,49 @@ static void mark_bg_tile_dirty( running_machine *machine, offs_t offset )
WRITE8_HANDLER( decocass_tileram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->tileram[offset] = data;
/* dirty tile (64 bytes per tile) */
- gfx_element_mark_dirty(space->machine->gfx[2], (offset / 64) & 15);
+ gfx_element_mark_dirty(space->machine().gfx[2], (offset / 64) & 15);
/* first 1KB of tile RAM is shared with tilemap RAM */
if (offset < state->bgvideoram_size)
- mark_bg_tile_dirty(space->machine, offset);
+ mark_bg_tile_dirty(space->machine(), offset);
}
WRITE8_HANDLER( decocass_objectram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->objectram[offset] = data;
/* dirty the object */
- gfx_element_mark_dirty(space->machine->gfx[3], 0);
- gfx_element_mark_dirty(space->machine->gfx[3], 1);
+ gfx_element_mark_dirty(space->machine().gfx[3], 0);
+ gfx_element_mark_dirty(space->machine().gfx[3], 1);
}
WRITE8_HANDLER( decocass_bgvideoram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->bgvideoram[offset] = data;
- mark_bg_tile_dirty(space->machine, offset);
+ mark_bg_tile_dirty(space->machine(), offset);
}
/* The watchdog is a 4bit counter counting down every frame */
WRITE8_HANDLER( decocass_watchdog_count_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(1,("decocass_watchdog_count_w: $%02x\n", data));
state->watchdog_count = data & 0x0f;
}
WRITE8_HANDLER( decocass_watchdog_flip_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(1,("decocass_watchdog_flip_w: $%02x\n", data));
state->watchdog_flip = data;
}
WRITE8_HANDLER( decocass_color_missiles_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(1,("decocass_color_missiles_w: $%02x\n", data));
/* only bits D0-D2 and D4-D6 are connected to
* the color RAM demux:
@@ -283,7 +283,7 @@ WRITE8_HANDLER( decocass_color_missiles_w )
*/
WRITE8_HANDLER( decocass_mode_set_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->mode_set)
return;
LOG(1,("decocass_mode_set_w: $%02x (%s%s%s%s%s%s%s%s)\n", data,
@@ -301,7 +301,7 @@ WRITE8_HANDLER( decocass_mode_set_w )
WRITE8_HANDLER( decocass_color_center_bot_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->color_center_bot)
return;
LOG(1,("decocass_color_center_bot_w: $%02x (color:%d, center_bot:%d)\n", data, data & 3, data >> 4));
@@ -328,7 +328,7 @@ WRITE8_HANDLER( decocass_color_center_bot_w )
WRITE8_HANDLER( decocass_back_h_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->back_h_shift)
return;
LOG(1,("decocass_back_h_shift_w: $%02x\n", data));
@@ -337,7 +337,7 @@ WRITE8_HANDLER( decocass_back_h_shift_w )
WRITE8_HANDLER( decocass_back_vl_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->back_vl_shift)
return;
LOG(1,("decocass_back_vl_shift_w: $%02x\n", data));
@@ -346,7 +346,7 @@ WRITE8_HANDLER( decocass_back_vl_shift_w )
WRITE8_HANDLER( decocass_back_vr_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->back_vr_shift)
return;
LOG(1,("decocass_back_vr_shift_w: $%02x\n", data));
@@ -355,7 +355,7 @@ WRITE8_HANDLER( decocass_back_vr_shift_w )
WRITE8_HANDLER( decocass_part_h_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->part_v_shift )
return;
LOG(1,("decocass_part_h_shift_w: $%02x\n", data));
@@ -364,7 +364,7 @@ WRITE8_HANDLER( decocass_part_h_shift_w )
WRITE8_HANDLER( decocass_part_v_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->part_v_shift )
return;
LOG(1,("decocass_part_v_shift_w: $%02x\n", data));
@@ -373,7 +373,7 @@ WRITE8_HANDLER( decocass_part_v_shift_w )
WRITE8_HANDLER( decocass_center_h_shift_space_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
if (data == state->center_h_shift_space)
return;
LOG(1,("decocass_center_h_shift_space_w: $%02x\n", data));
@@ -382,7 +382,7 @@ WRITE8_HANDLER( decocass_center_h_shift_space_w )
WRITE8_HANDLER( decocass_center_v_shift_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
LOG(1,("decocass_center_v_shift_w: $%02x\n", data));
state->center_v_shift = data;
}
@@ -391,7 +391,7 @@ WRITE8_HANDLER( decocass_center_v_shift_w )
memory handlers
********************************************/
-static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int color,
+static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int color,
int sprite_y_adjust, int sprite_y_adjust_flip_screen,
UINT8 *sprite_ram, int interleave)
{
@@ -422,7 +422,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
sy -= sprite_y_adjust;
- drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
sprite_ram[offs + interleave],
color,
flipx,flipy,
@@ -431,7 +431,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
sy += (flip_screen_get(machine) ? -256 : 256);
// Wrap around
- drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
sprite_ram[offs + interleave],
color,
flipx,flipy,
@@ -440,11 +440,11 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
}
-static void draw_missiles(running_machine *machine,bitmap_t *bitmap, const rectangle *cliprect,
+static void draw_missiles(running_machine &machine,bitmap_t *bitmap, const rectangle *cliprect,
int missile_y_adjust, int missile_y_adjust_flip_screen,
UINT8 *missile_ram, int interleave)
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
int i, offs, x;
/* Draw the missiles (16 of them) seemingly with alternating colors
@@ -490,7 +490,7 @@ static void draw_missiles(running_machine *machine,bitmap_t *bitmap, const recta
VIDEO_START( decocass )
{
- decocass_state *state = machine->driver_data<decocass_state>();
+ decocass_state *state = machine.driver_data<decocass_state>();
state->bg_tilemap_l = tilemap_create(machine, get_bg_l_tile_info, bgvideoram_scan_cols, 16, 16, 32, 32);
state->bg_tilemap_r = tilemap_create(machine, get_bg_r_tile_info, bgvideoram_scan_cols, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, fgvideoram_scan_cols, 8, 8, 32, 32);
@@ -499,43 +499,43 @@ VIDEO_START( decocass )
tilemap_set_transparent_pen(state->bg_tilemap_r, 0);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- state->bg_tilemap_l_clip = machine->primary_screen->visible_area();
+ state->bg_tilemap_l_clip = machine.primary_screen->visible_area();
state->bg_tilemap_l_clip.max_y = 256 / 2 - 1;
- state->bg_tilemap_r_clip = machine->primary_screen->visible_area();
+ state->bg_tilemap_r_clip = machine.primary_screen->visible_area();
state->bg_tilemap_r_clip.min_y = 256 / 2;
/* background videroam bits D0-D3 are shared with the tileram */
state->bgvideoram = state->tileram;
state->bgvideoram_size = 0x0400; /* d000-d3ff */
- gfx_element_set_source(machine->gfx[0], state->charram);
- gfx_element_set_source(machine->gfx[1], state->charram);
- gfx_element_set_source(machine->gfx[2], state->tileram);
- gfx_element_set_source(machine->gfx[3], state->objectram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[1], state->charram);
+ gfx_element_set_source(machine.gfx[2], state->tileram);
+ gfx_element_set_source(machine.gfx[3], state->objectram);
/* This should ensure that the fake 17th tile is left blank
* now that dirty-tile tracking is handled by the core */
- gfx_element_decode(machine->gfx[2], 16);
+ gfx_element_decode(machine.gfx[2], 16);
}
SCREEN_UPDATE( decocass )
{
- decocass_state *state = screen->machine->driver_data<decocass_state>();
+ decocass_state *state = screen->machine().driver_data<decocass_state>();
int scrollx, scrolly_l, scrolly_r;
rectangle clip;
- if (0xc0 != (input_port_read(screen->machine, "IN2") & 0xc0)) /* coin slots assert an NMI */
+ if (0xc0 != (input_port_read(screen->machine(), "IN2") & 0xc0)) /* coin slots assert an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, ASSERT_LINE);
if (0 == (state->watchdog_flip & 0x04))
- watchdog_reset(screen->machine);
+ watchdog_reset(screen->machine());
else if (state->watchdog_count-- > 0)
- watchdog_reset(screen->machine);
+ watchdog_reset(screen->machine());
#ifdef MAME_DEBUG
{
- if (input_code_pressed_once(screen->machine, KEYCODE_I))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_I))
state->showmsg ^= 1;
if (state->showmsg)
popmessage("mode:$%02x cm:$%02x ccb:$%02x h:$%02x vl:$%02x vr:$%02x ph:$%02x pv:$%02x ch:$%02x cv:$%02x",
@@ -591,13 +591,13 @@ SCREEN_UPDATE( decocass )
if (state->mode_set & 0x20)
{
- draw_object(screen->machine, bitmap, cliprect);
- draw_center(screen->machine, bitmap, cliprect);
+ draw_object(screen->machine(), bitmap, cliprect);
+ draw_center(screen->machine(), bitmap, cliprect);
}
else
{
- draw_object(screen->machine, bitmap, cliprect);
- draw_center(screen->machine, bitmap, cliprect);
+ draw_object(screen->machine(), bitmap, cliprect);
+ draw_center(screen->machine(), bitmap, cliprect);
if (state->mode_set & 0x08) /* bkg_ena on ? */
{
clip = state->bg_tilemap_l_clip;
@@ -610,7 +610,7 @@ SCREEN_UPDATE( decocass )
}
}
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, (state->color_center_bot >> 1) & 1, 0, 0, state->fgvideoram, 0x20);
- draw_missiles(screen->machine, bitmap, cliprect, 1, 0, state->colorram, 0x20);
+ draw_sprites(screen->machine(), bitmap, cliprect, (state->color_center_bot >> 1) & 1, 0, 0, state->fgvideoram, 0x20);
+ draw_missiles(screen->machine(), bitmap, cliprect, 1, 0, state->colorram, 0x20);
return 0;
}
diff --git a/src/mame/video/decocomn.c b/src/mame/video/decocomn.c
index e14735f53c5..ee70a81acb3 100644
--- a/src/mame/video/decocomn.c
+++ b/src/mame/video/decocomn.c
@@ -50,21 +50,21 @@ WRITE16_DEVICE_HANDLER( decocomn_nonbuffered_palette_w )
{
int r,g,b;
- COMBINE_DATA(&device->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&device->machine().generic.paletteram.u16[offset]);
if (offset&1) offset--;
- b = (device->machine->generic.paletteram.u16[offset] >> 0) & 0xff;
- g = (device->machine->generic.paletteram.u16[offset + 1] >> 8) & 0xff;
- r = (device->machine->generic.paletteram.u16[offset + 1] >> 0) & 0xff;
+ b = (device->machine().generic.paletteram.u16[offset] >> 0) & 0xff;
+ g = (device->machine().generic.paletteram.u16[offset + 1] >> 8) & 0xff;
+ r = (device->machine().generic.paletteram.u16[offset + 1] >> 0) & 0xff;
- palette_set_color(device->machine, offset / 2, MAKE_RGB(r,g,b));
+ palette_set_color(device->machine(), offset / 2, MAKE_RGB(r,g,b));
}
WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w )
{
decocomn_state *decocomn = get_safe_token(device);
- COMBINE_DATA(&device->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&device->machine().generic.paletteram.u16[offset]);
decocomn->dirty_palette[offset / 2] = 1;
}
@@ -72,7 +72,7 @@ WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w )
WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w )
{
decocomn_state *decocomn = get_safe_token(device);
- const int m = device->machine->total_colors();
+ const int m = device->machine().total_colors();
int r, g, b, i;
for (i = 0; i < m; i++)
@@ -81,11 +81,11 @@ WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w )
{
decocomn->dirty_palette[i] = 0;
- b = (device->machine->generic.paletteram.u16[i * 2] >> 0) & 0xff;
- g = (device->machine->generic.paletteram.u16[i * 2 + 1] >> 8) & 0xff;
- r = (device->machine->generic.paletteram.u16[i * 2 + 1] >> 0) & 0xff;
+ b = (device->machine().generic.paletteram.u16[i * 2] >> 0) & 0xff;
+ g = (device->machine().generic.paletteram.u16[i * 2 + 1] >> 8) & 0xff;
+ r = (device->machine().generic.paletteram.u16[i * 2 + 1] >> 0) & 0xff;
- palette_set_color(device->machine, i, MAKE_RGB(r,g,b));
+ palette_set_color(device->machine(), i, MAKE_RGB(r,g,b));
}
}
}
@@ -133,8 +133,8 @@ void decocomn_pdrawgfx(
decocomn_state *decocomn = get_safe_token(device);
int ox, oy, cx, cy;
int x_index, y_index, x, y;
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
/* check bounds */
@@ -205,14 +205,14 @@ static DEVICE_START( decocomn )
const decocomn_interface *intf = get_interface(device);
int width, height;
- decocomn->screen = device->machine->device<screen_device>(intf->screen);
+ decocomn->screen = device->machine().device<screen_device>(intf->screen);
width = decocomn->screen->width();
height = decocomn->screen->height();
- decocomn->sprite_priority_bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED8);
+ decocomn->sprite_priority_bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED8);
- decocomn->dirty_palette = auto_alloc_array_clear(device->machine, UINT8, 4096);
- decocomn->raster_display_list = auto_alloc_array_clear(device->machine, UINT16, 20 * 256 / 2);
+ decocomn->dirty_palette = auto_alloc_array_clear(device->machine(), UINT8, 4096);
+ decocomn->raster_display_list = auto_alloc_array_clear(device->machine(), UINT16, 20 * 256 / 2);
diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c
index 99954f77a03..b9a095af9c1 100644
--- a/src/mame/video/decospr.c
+++ b/src/mame/video/decospr.c
@@ -131,7 +131,7 @@ device_config *decospr_device_config::static_alloc_device_config(const machine_c
device_t *decospr_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, decospr_device(machine, *this));
+ return auto_alloc(machine, decospr_device(machine, *this));
}
void decospr_device_config::set_gfx_region(device_config *device, int gfxregion)
@@ -179,9 +179,9 @@ void decospr_device::decospr_sprite_kludge(int x, int y)
}
*/
-void decospr_device::alloc_sprite_bitmap(running_machine* machine)
+void decospr_device::alloc_sprite_bitmap(running_machine& machine)
{
- m_sprite_bitmap = auto_bitmap_alloc(machine, machine->primary_screen->width(), machine->primary_screen->height(), BITMAP_FORMAT_INDEXED16);
+ m_sprite_bitmap = auto_bitmap_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height(), BITMAP_FORMAT_INDEXED16);
}
void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
@@ -192,7 +192,7 @@ void decospr_device::set_pri_callback(decospr_priority_callback_func callback)
-void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
+void decospr_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
{
//printf("cliprect %04x, %04x\n", cliprect->min_y, cliprect->max_y);
@@ -237,7 +237,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
w = y & 0x0800;
- if (!(flash && (machine->primary_screen->frame_number() & 1)))
+ if (!(flash && (machine.primary_screen->frame_number() & 1)))
{
x = spriteram[offs + 2];
@@ -321,14 +321,14 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
{
if (m_pricallback)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite - multi * inc,
colour,
fx,fy,
x,ypos,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
else
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite - multi * inc,
colour,
fx,fy,
@@ -340,14 +340,14 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if (w)
{
if (m_pricallback)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
(sprite - multi * inc)-mult2,
colour,
fx,fy,
x-16,ypos,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
else
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
(sprite - multi * inc)-mult2,
colour,
fx,fy,
@@ -358,7 +358,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
else
{
// if we have a sprite bitmap draw raw data to it for manual mixing
- drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
sprite - multi * inc,
colour<<m_raw_shift,
fx,fy,
@@ -366,7 +366,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
0);
if (w)
{
- drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
(sprite - multi * inc)-mult2,
colour<<m_raw_shift,
fx,fy,
@@ -395,7 +395,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
x = spriteram[offs+1];
- if (!((y&0x2000) && (machine->primary_screen->frame_number() & 1)));
+ if (!((y&0x2000) && (machine.primary_screen->frame_number() & 1)));
{
if (!m_sprite_bitmap)
colour = (spriteram[offs+2] >>0) & 0x1f;
@@ -446,24 +446,24 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour,
fx,fy,
x + mult * (w-xx),ypos,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
}
ypos -= 512; // wrap-around y
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour,
fx,fy,
x + mult * (w-xx),ypos,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
}
}
@@ -473,7 +473,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour,
fx,fy,
@@ -485,7 +485,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour,
fx,fy,
@@ -500,7 +500,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
{
- drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour<<m_raw_shift,
fx,fy,
@@ -512,7 +512,7 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
{
- drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine->gfx[m_gfxregion],
+ drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
sprite + yy + h * xx,
colour<<m_raw_shift,
fx,fy,
@@ -531,13 +531,13 @@ void decospr_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, c
// inefficient, we should be able to mix in a single pass by comparing the existing priority bitmap from the tilemaps
-void decospr_device::inefficient_copy_sprite_bitmap(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha)
+void decospr_device::inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha)
{
if (!m_sprite_bitmap)
fatalerror("decospr_device::inefficient_copy_sprite_bitmap with no m_sprite_bitmap");
int y, x;
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
UINT16* srcline;
UINT32* dstline;
diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h
index 9a493280fa5..96cb36dc383 100644
--- a/src/mame/video/decospr.h
+++ b/src/mame/video/decospr.h
@@ -22,14 +22,14 @@ class decospr_device : public device_t
decospr_device(running_machine &_machine, const decospr_device_config &config);
public:
//void decospr_sprite_kludge(int x, int y);
- void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
+ void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
void set_pri_callback(decospr_priority_callback_func callback);
void set_gfxregion(int region) { m_gfxregion = region; };
void set_alt_format(bool alt) { m_alt_format = alt; };
void set_pix_mix_mask(UINT16 mask) { m_pixmask = mask; };
void set_pix_raw_shift(UINT16 shift) { m_raw_shift = shift; };
- void alloc_sprite_bitmap(running_machine* machine);
- void inefficient_copy_sprite_bitmap(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
+ void alloc_sprite_bitmap(running_machine& machine);
+ void inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
bitmap_t* get_sprite_temp_bitmap(void) { return m_sprite_bitmap; };
protected:
diff --git a/src/mame/video/deniam.c b/src/mame/video/deniam.c
index a469b3493cd..ccb5591fd00 100644
--- a/src/mame/video/deniam.c
+++ b/src/mame/video/deniam.c
@@ -2,9 +2,9 @@
#include "includes/deniam.h"
-static void deniam_common_init( running_machine *machine )
+static void deniam_common_init( running_machine &machine )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int i;
state->bg_scrollx_reg = 0x00a4/2;
@@ -26,7 +26,7 @@ static void deniam_common_init( running_machine *machine )
DRIVER_INIT( logicpro )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
deniam_common_init(machine);
@@ -38,7 +38,7 @@ DRIVER_INIT( logicpro )
DRIVER_INIT( karianx )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
deniam_common_init(machine);
@@ -64,7 +64,7 @@ static TILEMAP_MAPPER( scan_pages )
static TILE_GET_INFO( get_bg_tile_info )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int page = tile_index >> 11;
UINT16 attr = state->videoram[state->bg_page[page] * 0x0800 + (tile_index & 0x7ff)];
SET_TILE_INFO(
@@ -76,7 +76,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int page = tile_index >> 11;
UINT16 attr = state->videoram[state->fg_page[page] * 0x0800 + (tile_index & 0x7ff)];
SET_TILE_INFO(
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
UINT16 attr = state->textram[tile_index];
SET_TILE_INFO(
0,
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( deniam )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, scan_pages, 8, 8, 128, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, scan_pages, 8, 8, 128, 64);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -126,7 +126,7 @@ VIDEO_START( deniam )
WRITE16_HANDLER( deniam_videoram_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
int page, i;
COMBINE_DATA(&state->videoram[offset]);
@@ -143,7 +143,7 @@ WRITE16_HANDLER( deniam_videoram_w )
WRITE16_HANDLER( deniam_textram_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
COMBINE_DATA(&state->textram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
@@ -151,7 +151,7 @@ WRITE16_HANDLER( deniam_textram_w )
WRITE16_HANDLER( deniam_palette_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
int r, g, b;
data = COMBINE_DATA(&state->paletteram[offset]);
@@ -159,22 +159,22 @@ WRITE16_HANDLER( deniam_palette_w )
r = ((data << 1) & 0x1e) | ((data >> 12) & 0x01);
g = ((data >> 3) & 0x1e) | ((data >> 13) & 0x01);
b = ((data >> 7) & 0x1e) | ((data >> 14) & 0x01);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
READ16_HANDLER( deniam_coinctrl_r )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
return state->coinctrl;
}
WRITE16_HANDLER( deniam_coinctrl_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
COMBINE_DATA(&state->coinctrl);
/* bit 0 is coin counter */
- coin_counter_w(space->machine, 0, state->coinctrl & 0x01);
+ coin_counter_w(space->machine(), 0, state->coinctrl & 0x01);
/* bit 6 is display enable (0 freezes screen) */
state->display_enable = state->coinctrl & 0x20;
@@ -214,11 +214,11 @@ WRITE16_HANDLER( deniam_coinctrl_w )
* c | ---------------- | zoomy like in System 16?
* e | ---------------- |
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int offs;
- UINT8 *gfx = machine->region("gfx2")->base();
+ UINT8 *gfx = machine.region("gfx2")->base();
for (offs = state->spriteram_size / 2 - 8; offs >= 0; offs -= 8)
{
@@ -272,9 +272,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) & primask) == 0)
+ if ((*BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx + x) = color * 16 + (rom[i] & 0x0f);
- *BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) = 8;
+ *BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) = 8;
}
}
x++;
@@ -292,9 +292,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) & primask) == 0)
+ if ((*BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx + x) = color * 16+(rom[i] >> 4);
- *BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) = 8;
+ *BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) = 8;
}
}
x++;
@@ -316,9 +316,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) & primask) == 0)
+ if ((*BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx + x) = color * 16 + (rom[i] >> 4);
- *BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) = 8;
+ *BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) = 8;
}
}
x++;
@@ -336,9 +336,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
y >= cliprect->min_y && y <= cliprect->max_y)
{
- if ((*BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) & primask) == 0)
+ if ((*BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) & primask) == 0)
*BITMAP_ADDR16(bitmap, y, sx + x) = color * 16 + (rom[i] & 0x0f);
- *BITMAP_ADDR8(machine->priority_bitmap, y, sx + x) = 8;
+ *BITMAP_ADDR8(machine.priority_bitmap, y, sx + x) = 8;
}
}
x++;
@@ -351,9 +351,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void set_bg_page( running_machine *machine, int page, int value )
+static void set_bg_page( running_machine &machine, int page, int value )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int tile_index;
if (state->bg_page[page] != value)
@@ -364,9 +364,9 @@ static void set_bg_page( running_machine *machine, int page, int value )
}
}
-static void set_fg_page( running_machine *machine, int page, int value )
+static void set_fg_page( running_machine &machine, int page, int value )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
int tile_index;
if (state->fg_page[page] != value)
@@ -379,7 +379,7 @@ static void set_fg_page( running_machine *machine, int page, int value )
SCREEN_UPDATE( deniam )
{
- deniam_state *state = screen->machine->driver_data<deniam_state>();
+ deniam_state *state = screen->machine().driver_data<deniam_state>();
int bg_scrollx, bg_scrolly, fg_scrollx, fg_scrolly;
int page;
@@ -389,30 +389,30 @@ SCREEN_UPDATE( deniam )
bg_scrollx = state->textram[state->bg_scrollx_reg] - state->bg_scrollx_offs;
bg_scrolly = (state->textram[state->bg_scrolly_reg] & 0xff) - state->bg_scrolly_offs;
page = state->textram[state->bg_page_reg];
- set_bg_page(screen->machine, 3, (page >>12) & 0x0f);
- set_bg_page(screen->machine, 2, (page >> 8) & 0x0f);
- set_bg_page(screen->machine, 1, (page >> 4) & 0x0f);
- set_bg_page(screen->machine, 0, (page >> 0) & 0x0f);
+ set_bg_page(screen->machine(), 3, (page >>12) & 0x0f);
+ set_bg_page(screen->machine(), 2, (page >> 8) & 0x0f);
+ set_bg_page(screen->machine(), 1, (page >> 4) & 0x0f);
+ set_bg_page(screen->machine(), 0, (page >> 0) & 0x0f);
fg_scrollx = state->textram[state->fg_scrollx_reg] - state->fg_scrollx_offs;
fg_scrolly = (state->textram[state->fg_scrolly_reg] & 0xff) - state->fg_scrolly_offs;
page = state->textram[state->fg_page_reg];
- set_fg_page(screen->machine, 3, (page >>12) & 0x0f);
- set_fg_page(screen->machine, 2, (page >> 8) & 0x0f);
- set_fg_page(screen->machine, 1, (page >> 4) & 0x0f);
- set_fg_page(screen->machine, 0, (page >> 0) & 0x0f);
+ set_fg_page(screen->machine(), 3, (page >>12) & 0x0f);
+ set_fg_page(screen->machine(), 2, (page >> 8) & 0x0f);
+ set_fg_page(screen->machine(), 1, (page >> 4) & 0x0f);
+ set_fg_page(screen->machine(), 0, (page >> 0) & 0x0f);
tilemap_set_scrollx(state->bg_tilemap, 0, bg_scrollx & 0x1ff);
tilemap_set_scrolly(state->bg_tilemap, 0, bg_scrolly & 0x0ff);
tilemap_set_scrollx(state->fg_tilemap, 0, fg_scrollx & 0x1ff);
tilemap_set_scrolly(state->fg_tilemap, 0, fg_scrolly & 0x0ff);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/dietgo.c b/src/mame/video/dietgo.c
index e10a34fecb9..f005d55229b 100644
--- a/src/mame/video/dietgo.c
+++ b/src/mame/video/dietgo.c
@@ -5,10 +5,10 @@
SCREEN_UPDATE( dietgo )
{
- dietgo_state *state = screen->machine->driver_data<dietgo_state>();
+ dietgo_state *state = screen->machine().driver_data<dietgo_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 256); /* not verified */
@@ -16,6 +16,6 @@ SCREEN_UPDATE( dietgo )
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
return 0;
}
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index a9145044d78..cd1bdd7ef5c 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -25,7 +25,7 @@ PALETTE_INIT( digdug )
{
int i;
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
for (i = 0;i < 32;i++)
{
@@ -43,24 +43,24 @@ PALETTE_INIT( digdug )
bit1 = (*color_prom >> 6) & 0x01;
bit2 = (*color_prom >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* characters - direct mapping */
for (i = 0; i < 16; i++)
{
- colortable_entry_set_value(machine->colortable, i*2+0, 0);
- colortable_entry_set_value(machine->colortable, i*2+1, i);
+ colortable_entry_set_value(machine.colortable, i*2+0, 0);
+ colortable_entry_set_value(machine.colortable, i*2+1, i);
}
/* sprites */
for (i = 0;i < 0x100;i++)
- colortable_entry_set_value(machine->colortable, 16*2+i, (*color_prom++ & 0x0f) + 0x10);
+ colortable_entry_set_value(machine.colortable, 16*2+i, (*color_prom++ & 0x0f) + 0x10);
/* bg_select */
for (i = 0;i < 0x100;i++)
- colortable_entry_set_value(machine->colortable, 16*2+256+i, *color_prom++ & 0x0f);
+ colortable_entry_set_value(machine.colortable, 16*2+256+i, *color_prom++ & 0x0f);
}
@@ -89,8 +89,8 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( bg_get_tile_info )
{
- UINT8 *rom = machine->region("gfx4")->base();
- digdug_state *state = machine->driver_data<digdug_state>();
+ UINT8 *rom = machine.region("gfx4")->base();
+ digdug_state *state = machine.driver_data<digdug_state>();
int code = rom[tile_index | (state->bg_select << 10)];
/* when the background is "disabled", it is actually still drawn, but using
@@ -108,7 +108,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( tx_get_tile_info )
{
- digdug_state *state = machine->driver_data<digdug_state>();
+ digdug_state *state = machine.driver_data<digdug_state>();
UINT8 code = state->videoram[tile_index];
int color;
@@ -144,7 +144,7 @@ static TILE_GET_INFO( tx_get_tile_info )
VIDEO_START( digdug )
{
- digdug_state *state = machine->driver_data<digdug_state>();
+ digdug_state *state = machine.driver_data<digdug_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan, 8,8,36,28);
state->fg_tilemap = tilemap_create(machine, tx_get_tile_info,tilemap_scan,8,8,36,28);
@@ -167,7 +167,7 @@ VIDEO_START( digdug )
WRITE8_HANDLER( digdug_videoram_w )
{
- digdug_state *state = space->machine->driver_data<digdug_state>();
+ digdug_state *state = space->machine().driver_data<digdug_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
@@ -175,7 +175,7 @@ WRITE8_HANDLER( digdug_videoram_w )
WRITE8_HANDLER( digdug_PORT_w )
{
- digdug_state *state = space->machine->driver_data<digdug_state>();
+ digdug_state *state = space->machine().driver_data<digdug_state>();
switch (offset)
{
@@ -227,7 +227,7 @@ WRITE8_HANDLER( digdug_PORT_w )
break;
case 7: /* FLIP */
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
break;
}
}
@@ -246,9 +246,9 @@ static const rectangle spritevisiblearea =
0*8, 28*8-1
};
-static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- digdug_state *state = machine->driver_data<digdug_state>();
+ digdug_state *state = machine.driver_data<digdug_state>();
UINT8 *spriteram = state->digdug_objram + 0x380;
UINT8 *spriteram_2 = state->digdug_posram + 0x380;
UINT8 *spriteram_3 = state->digdug_flpram + 0x380;
@@ -287,14 +287,14 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
{
for (x = 0;x <= size;x++)
{
- UINT32 transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x1f);
- drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
+ UINT32 transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x1f);
+ drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
color,
flipx,flipy,
((sx + 16*x) & 0xff), sy + 16*y,transmask);
/* wraparound */
- drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
+ drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
color,
flipx,flipy,
@@ -307,10 +307,10 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( digdug )
{
- digdug_state *state = screen->machine->driver_data<digdug_state>();
+ digdug_state *state = screen->machine().driver_data<digdug_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/djboy.c b/src/mame/video/djboy.c
index 6ec36659a6a..c968b1e4a50 100644
--- a/src/mame/video/djboy.c
+++ b/src/mame/video/djboy.c
@@ -9,19 +9,19 @@
WRITE8_HANDLER( djboy_scrollx_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->scrollx = data;
}
WRITE8_HANDLER( djboy_scrolly_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->scrolly = data;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
UINT8 attr = state->videoram[tile_index + 0x800];
int code = state->videoram[tile_index] + (attr & 0xf) * 256;
int color = attr >> 4;
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_bg_tile_info )
WRITE8_HANDLER( djboy_videoram_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->background, offset & 0x7ff);
@@ -42,20 +42,20 @@ WRITE8_HANDLER( djboy_videoram_w )
VIDEO_START( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
}
WRITE8_HANDLER( djboy_paletteram_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
int val;
state->paletteram[offset] = data;
offset &= ~1;
val = (state->paletteram[offset] << 8) | state->paletteram[offset + 1];
- palette_set_color_rgb(space->machine, offset / 2, pal4bit(val >> 8), pal4bit(val >> 4), pal4bit(val >> 0));
+ palette_set_color_rgb(space->machine(), offset / 2, pal4bit(val >> 8), pal4bit(val >> 4), pal4bit(val >> 0));
}
SCREEN_UPDATE( djboy )
@@ -66,7 +66,7 @@ SCREEN_UPDATE( djboy )
* ---x---- flipscreen?
* ----xxxx ROM bank
*/
- djboy_state *state = screen->machine->driver_data<djboy_state>();
+ djboy_state *state = screen->machine().driver_data<djboy_state>();
int scroll;
scroll = state->scrollx | ((state->videoreg & 0xc0) << 2);
@@ -83,6 +83,6 @@ SCREEN_UPDATE( djboy )
SCREEN_EOF( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
pandora_eof(state->pandora);
}
diff --git a/src/mame/video/djmain.c b/src/mame/video/djmain.c
index f78cef9bdfa..8b372e1aaae 100644
--- a/src/mame/video/djmain.c
+++ b/src/mame/video/djmain.c
@@ -12,14 +12,14 @@
-static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- djmain_state *state = machine->driver_data<djmain_state>();
- device_t *k055555 = machine->device("k055555");
+ djmain_state *state = machine.driver_data<djmain_state>();
+ device_t *k055555 = machine.device("k055555");
int offs, pri_code;
int sortedlist[NUM_SPRITES];
- machine->gfx[0]->color_base = k055555_read_register(k055555, K55_PALBASE_SUB2) * 0x400;
+ machine.gfx[0]->color_base = k055555_read_register(k055555, K55_PALBASE_SUB2) * 0x400;
for (offs = 0; offs < NUM_SPRITES; offs++)
sortedlist[offs] = -1;
@@ -98,7 +98,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
drawgfxzoom_transpen(bitmap,
cliprect,
- machine->gfx[0],
+ machine.gfx[0],
c,
color,
flipx,
@@ -116,7 +116,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
drawgfx_transpen(bitmap,
cliprect,
- machine->gfx[0],
+ machine.gfx[0],
c,
color,
flipx,
@@ -130,13 +130,13 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
}
-void djmain_tile_callback(running_machine* machine, int layer, int *code, int *color, int *flags)
+void djmain_tile_callback(running_machine& machine, int layer, int *code, int *color, int *flags)
{
}
VIDEO_START( djmain )
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_offs(k056832, 0, -92, -27);
// k056832_set_layer_offs(k056832, 1, -87, -27);
@@ -145,8 +145,8 @@ VIDEO_START( djmain )
SCREEN_UPDATE( djmain )
{
- device_t *k056832 = screen->machine->device("k056832");
- device_t *k055555 = screen->machine->device("k055555");
+ device_t *k056832 = screen->machine().device("k056832");
+ device_t *k055555 = screen->machine().device("k055555");
int enables = k055555_read_register(k055555, K55_INPUT_ENABLES);
int pri[NUM_LAYERS + 1];
int order[NUM_LAYERS + 1];
@@ -169,7 +169,7 @@ SCREEN_UPDATE( djmain )
order[j] = temp;
}
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
for (i = 0; i < NUM_LAYERS + 1; i++)
{
@@ -178,7 +178,7 @@ SCREEN_UPDATE( djmain )
if (layer == NUM_LAYERS)
{
if (enables & K55_INP_SUB2)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
else
{
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index e634801865b..9fcc414cb8e 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -201,7 +201,7 @@ static const res_net_info radarscp_grid_net_info =
PALETTE_INIT( dkong2b)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
rgb_t *rgb;
int i;
@@ -220,7 +220,7 @@ PALETTE_INIT( dkong2b)
palette_set_color_rgb(machine,i,r,g,b);
}
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
color_prom += 512;
/* color_prom now points to the beginning of the character color codes */
@@ -231,7 +231,7 @@ PALETTE_INIT( dkong2b)
#ifdef UNUSED_FUNCTION
PALETTE_INIT( dkong4b )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -260,7 +260,7 @@ PALETTE_INIT( dkong4b )
palette_set_color_rgb(machine,i,r,g,b);
}
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
color_prom += 256;
/* color_prom now points to the beginning of the character color codes */
@@ -270,7 +270,7 @@ PALETTE_INIT( dkong4b )
PALETTE_INIT( radarscp )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -325,7 +325,7 @@ PALETTE_INIT( radarscp )
palette_set_color_rgb(machine,RADARSCP_GRID_COL_OFFSET + i,r,g,b);
}
- palette_normalize_range(machine->palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
+ palette_normalize_range(machine.palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
color_prom += 256;
/* color_prom now points to the beginning of the character color codes */
@@ -334,7 +334,7 @@ PALETTE_INIT( radarscp )
PALETTE_INIT( radarscp1 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int i;
int r,g,b;
@@ -388,7 +388,7 @@ PALETTE_INIT( radarscp1 )
palette_set_color_rgb(machine,RADARSCP_GRID_COL_OFFSET + i,r,g,b);
}
- palette_normalize_range(machine->palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
+ palette_normalize_range(machine.palette, 0, RADARSCP_GRID_COL_OFFSET+7, 0, 255);
color_prom += 512;
/* color_prom now points to the beginning of the character color codes */
@@ -434,12 +434,12 @@ PALETTE_INIT( radarscp1 )
PALETTE_INIT( dkong3 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &dkong3_decode_info, &dkong3_net_info);
palette_set_colors(machine, 0, rgb, 256);
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
auto_free(machine, rgb);
color_prom += 1024;
@@ -449,7 +449,7 @@ PALETTE_INIT( dkong3 )
static TILE_GET_INFO( dkong_bg_tile_info )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
int color = (state->color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * state->palette_bank;
@@ -458,7 +458,7 @@ static TILE_GET_INFO( dkong_bg_tile_info )
static TILE_GET_INFO( radarscp1_bg_tile_info )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
int color = (state->color_codes[tile_index % 32] & 0x0f);
color = color | (state->palette_bank<<4);
@@ -474,7 +474,7 @@ static TILE_GET_INFO( radarscp1_bg_tile_info )
WRITE8_HANDLER( dkong_videoram_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (state->video_ram[offset] != data)
{
@@ -485,7 +485,7 @@ WRITE8_HANDLER( dkong_videoram_w )
WRITE8_HANDLER( dkongjr_gfxbank_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (state->gfx_bank != (data & 0x01))
{
@@ -496,7 +496,7 @@ WRITE8_HANDLER( dkongjr_gfxbank_w )
WRITE8_HANDLER( dkong3_gfxbank_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (state->gfx_bank != (~data & 0x01))
{
@@ -507,7 +507,7 @@ WRITE8_HANDLER( dkong3_gfxbank_w )
WRITE8_HANDLER( dkong_palettebank_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
int newbank;
newbank = state->palette_bank;
@@ -526,14 +526,14 @@ WRITE8_HANDLER( dkong_palettebank_w )
WRITE8_HANDLER( radarscp_grid_enable_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
state->grid_on = data & 0x01;
}
WRITE8_HANDLER( radarscp_grid_color_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
state->grid_col = (data & 0x07) ^ 0x07;
/* popmessage("Gridcol: %d", state->grid_col); */
@@ -541,14 +541,14 @@ WRITE8_HANDLER( radarscp_grid_color_w )
WRITE8_HANDLER( dkong_flipscreen_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
state->flip = ~data & 0x01;
}
WRITE8_HANDLER( dkong_spritebank_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
state->sprite_bank = data & 0x01;
}
@@ -559,9 +559,9 @@ WRITE8_HANDLER( dkong_spritebank_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 mask_bank, UINT32 shift_bits)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 mask_bank, UINT32 shift_bits)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int offs;
int scanline_vf; /* buffering scanline including flip */
int scanline_vfc; /* line buffering scanline including flip - this is the cached scanline_vf*/
@@ -651,7 +651,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (state->flip)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
(state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
!(state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
@@ -659,7 +659,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(state->sprite_ram[offs + 1] & 0x7f) + ((state->sprite_ram[offs + 2] & mask_bank) << shift_bits),
(state->sprite_ram[offs + 2] & 0x0f) + 16 * state->palette_bank,
(state->sprite_ram[offs + 2] & 0x80),(state->sprite_ram[offs + 1] & 0x80),
@@ -689,9 +689,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
* TODO: This should be part of the vblank routine
*/
-INLINE double CD4049(running_machine *machine, double x)
+INLINE double CD4049(running_machine &machine, double x)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
if (x>0)
return exp(-state->cd4049_a * pow(x,state->cd4049_b));
@@ -711,9 +711,9 @@ INLINE double CD4049(running_machine *machine, double x)
#define dt (1./60./(double) VTOTAL)
#define period2 (((INT64)(PIXEL_CLOCK) * ( 33L * 68L )) / (INT32)10000000L / 3) /* period/2 in pixel ... */
-static void radarscp_step(running_machine *machine, int line_cnt)
+static void radarscp_step(running_machine &machine, int line_cnt)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
/* Condensator is illegible in schematics for TRS2 board.
* TRS1 board states 3.3u.
@@ -736,7 +736,7 @@ static void radarscp_step(running_machine *machine, int line_cnt)
if (line_cnt>=512)
line_cnt=512-VTOTAL;
- if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (machine->rand() > RAND_MAX/2))
+ if ( ( !(line_cnt & 0x40) && ((line_cnt+1) & 0x40) ) && (machine.rand() > RAND_MAX/2))
state->sig30Hz = (1-state->sig30Hz);
/* Now mix with SND02 (sound 2) line - on 74ls259, bit2 */
@@ -805,7 +805,7 @@ static void radarscp_step(running_machine *machine, int line_cnt)
}
-static void radarscp_draw_background(running_machine *machine, dkong_state *state, bitmap_t *bitmap, const rectangle *cliprect)
+static void radarscp_draw_background(running_machine &machine, dkong_state *state, bitmap_t *bitmap, const rectangle *cliprect)
{
const UINT8 *htable = NULL;
int x,y;
@@ -833,14 +833,14 @@ static void radarscp_draw_background(running_machine *machine, dkong_state *stat
}
}
-static void radarscp_scanline(running_machine *machine, int scanline)
+static void radarscp_scanline(running_machine &machine, int scanline)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
const UINT8 *table = state->gfx3;
int table_len = state->gfx3_len;
int x,y,offset;
UINT16 *pixel;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
y = scanline;
radarscp_step(machine, y);
@@ -848,7 +848,7 @@ static void radarscp_scanline(running_machine *machine, int scanline)
state->counter = 0;
offset = (state->flip ^ state->rflip_sig) ? 0x000 : 0x400;
x = 0;
- while (x < machine->primary_screen->width())
+ while (x < machine.primary_screen->width())
{
pixel = BITMAP_ADDR16(state->bg_bits, y, x);
if ((state->counter < table_len) && (x == 4 * (table[state->counter|offset] & 0x7f)))
@@ -871,27 +871,27 @@ static void radarscp_scanline(running_machine *machine, int scanline)
static TIMER_CALLBACK( scanline_callback )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
int scanline = param;
if ((state->hardware_type == HARDWARE_TRS02) || (state->hardware_type == HARDWARE_TRS01))
radarscp_scanline(machine, scanline);
/* update any video up to the current scanline */
- machine->primary_screen->update_now();
+ machine.primary_screen->update_now();
scanline = (scanline+1) % VTOTAL;
/* come back at the next appropriate scanline */
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
-static void check_palette(running_machine *machine)
+static void check_palette(running_machine &machine)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
const input_port_config *port;
int newset;
- port = machine->port("VIDHW");
+ port = machine.port("VIDHW");
if (port != NULL)
{
newset = input_port_read_direct(port);
@@ -902,11 +902,11 @@ static void check_palette(running_machine *machine)
switch (newset)
{
case 0x00:
- color_prom = machine->region("proms")->base();
+ color_prom = machine.region("proms")->base();
PALETTE_INIT_CALL(radarscp);
break;
case 0x01:
- color_prom = machine->region("proms")->base();
+ color_prom = machine.region("proms")->base();
PALETTE_INIT_CALL(dkong2b);
break;
}
@@ -916,7 +916,7 @@ static void check_palette(running_machine *machine)
static VIDEO_START( dkong_base )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
state->cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
state->cd4049_a = log(0.0 - log(cd4049_al)) - state->cd4049_b * log(cd4049_vh);
@@ -937,19 +937,19 @@ static VIDEO_START( dkong_base )
VIDEO_START( dkong )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
VIDEO_START_CALL(dkong_base);
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
switch (state->hardware_type)
{
case HARDWARE_TRS02:
- state->bg_bits = machine->primary_screen->alloc_compatible_bitmap();
- state->gfx3 = machine->region("gfx3")->base();
- state->gfx3_len = machine->region("gfx3")->bytes();
+ state->bg_bits = machine.primary_screen->alloc_compatible_bitmap();
+ state->gfx3 = machine.region("gfx3")->base();
+ state->gfx3_len = machine.region("gfx3")->bytes();
/* fall through */
case HARDWARE_TKG04:
case HARDWARE_TKG02:
@@ -960,10 +960,10 @@ VIDEO_START( dkong )
state->bg_tilemap = tilemap_create(machine, radarscp1_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
- state->bg_bits = machine->primary_screen->alloc_compatible_bitmap();
- state->gfx4 = machine->region("gfx4")->base();
- state->gfx3 = machine->region("gfx3")->base();
- state->gfx3_len = machine->region("gfx3")->bytes();
+ state->bg_bits = machine.primary_screen->alloc_compatible_bitmap();
+ state->gfx4 = machine.region("gfx4")->base();
+ state->gfx3 = machine.region("gfx3")->base();
+ state->gfx3_len = machine.region("gfx3")->bytes();
break;
default:
@@ -973,9 +973,9 @@ VIDEO_START( dkong )
SCREEN_UPDATE( dkong )
{
- dkong_state *state = screen->machine->driver_data<dkong_state>();
+ dkong_state *state = screen->machine().driver_data<dkong_state>();
- tilemap_set_flip_all(screen->machine, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_set_flip_all(screen->machine(), state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_set_scrollx(state->bg_tilemap, 0, state->flip ? 0 : 0);
tilemap_set_scrolly(state->bg_tilemap, 0, state->flip ? -8 : 0);
@@ -983,15 +983,15 @@ SCREEN_UPDATE( dkong )
{
case HARDWARE_TKG02:
case HARDWARE_TKG04:
- check_palette(screen->machine);
+ check_palette(screen->machine());
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x40, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x40, 1);
break;
case HARDWARE_TRS01:
case HARDWARE_TRS02:
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x40, 1);
- radarscp_draw_background(screen->machine, state, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x40, 1);
+ radarscp_draw_background(screen->machine(), state, bitmap, cliprect);
break;
default:
fatalerror("Invalid hardware type in dkong_video_update");
@@ -1001,7 +1001,7 @@ SCREEN_UPDATE( dkong )
SCREEN_UPDATE( pestplce )
{
- dkong_state *state = screen->machine->driver_data<dkong_state>();
+ dkong_state *state = screen->machine().driver_data<dkong_state>();
int offs;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -1011,7 +1011,7 @@ SCREEN_UPDATE( pestplce )
{
if (state->sprite_ram[offs])
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->sprite_ram[offs + 2],
(state->sprite_ram[offs + 1] & 0x0f) + 16 * state->palette_bank,
state->sprite_ram[offs + 1] & 0x80,state->sprite_ram[offs + 1] & 0x40,
@@ -1023,11 +1023,11 @@ SCREEN_UPDATE( pestplce )
SCREEN_UPDATE( spclforc )
{
- dkong_state *state = screen->machine->driver_data<dkong_state>();
+ dkong_state *state = screen->machine().driver_data<dkong_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* it uses sprite_ram[offs + 2] & 0x10 for sprite bank */
- draw_sprites(screen->machine, bitmap, cliprect, 0x10, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x10, 3);
return 0;
}
diff --git a/src/mame/video/docastle.c b/src/mame/video/docastle.c
index 139bb8d3510..9f6b7420805 100644
--- a/src/mame/video/docastle.c
+++ b/src/mame/video/docastle.c
@@ -64,60 +64,60 @@ PALETTE_INIT( docastle )
WRITE8_HANDLER( docastle_videoram_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->do_tilemap, offset);
}
WRITE8_HANDLER( docastle_colorram_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
+ docastle_state *state = space->machine().driver_data<docastle_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->do_tilemap, offset);
}
READ8_HANDLER( docastle_flipscreen_off_r )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
- flip_screen_set(space->machine, 0);
+ docastle_state *state = space->machine().driver_data<docastle_state>();
+ flip_screen_set(space->machine(), 0);
tilemap_mark_all_tiles_dirty(state->do_tilemap);
return 0;
}
READ8_HANDLER( docastle_flipscreen_on_r )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
- flip_screen_set(space->machine, 1);
+ docastle_state *state = space->machine().driver_data<docastle_state>();
+ flip_screen_set(space->machine(), 1);
tilemap_mark_all_tiles_dirty(state->do_tilemap);
return 1;
}
WRITE8_HANDLER( docastle_flipscreen_off_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
- flip_screen_set(space->machine, 0);
+ docastle_state *state = space->machine().driver_data<docastle_state>();
+ flip_screen_set(space->machine(), 0);
tilemap_mark_all_tiles_dirty(state->do_tilemap);
}
WRITE8_HANDLER( docastle_flipscreen_on_w )
{
- docastle_state *state = space->machine->driver_data<docastle_state>();
- flip_screen_set(space->machine, 1);
+ docastle_state *state = space->machine().driver_data<docastle_state>();
+ flip_screen_set(space->machine(), 1);
tilemap_mark_all_tiles_dirty(state->do_tilemap);
}
static TILE_GET_INFO( get_tile_info )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
int code = state->videoram[tile_index] + 8 * (state->colorram[tile_index] & 0x20);
int color = state->colorram[tile_index] & 0x1f;
SET_TILE_INFO(0, code, color, 0);
}
-static void video_start_common( running_machine *machine, UINT32 tile_transmask )
+static void video_start_common( running_machine &machine, UINT32 tile_transmask )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
state->do_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transmask(state->do_tilemap, 0, tile_transmask, 0x0000);
}
@@ -132,18 +132,18 @@ VIDEO_START( dorunrun )
video_start_common(machine, 0xff00);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
int offs;
- bitmap_fill(machine->priority_bitmap, NULL, 1);
+ bitmap_fill(machine.priority_bitmap, NULL, 1);
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
{
int sx, sy, flipx, flipy, code, color;
- if (machine->gfx[1]->total_elements > 256)
+ if (machine.gfx[1]->total_elements > 256)
{
/* spriteram
@@ -205,31 +205,31 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
/* first draw the sprite, visible */
- pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transmask(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
0x00,0x80ff);
/* then draw the mask, behind the background but obscuring following sprites */
- pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transmask(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
0x02,0x7fff);
}
}
SCREEN_UPDATE( docastle )
{
- docastle_state *state = screen->machine->driver_data<docastle_state>();
+ docastle_state *state = screen->machine().driver_data<docastle_state>();
tilemap_draw(bitmap, cliprect, state->do_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->do_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c
index 79ce4ff524f..4e3b0f71d9a 100644
--- a/src/mame/video/dogfgt.c
+++ b/src/mame/video/dogfgt.c
@@ -50,7 +50,7 @@ PALETTE_INIT( dogfgt )
static TILE_GET_INFO( get_tile_info )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
SET_TILE_INFO(
0,
state->bgvideoram[tile_index],
@@ -67,13 +67,13 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( dogfgt )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->bitmapram = auto_alloc_array(machine, UINT8, BITMAPRAM_SIZE);
state->save_pointer(NAME(state->bitmapram), BITMAPRAM_SIZE);
- state->pixbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->pixbitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->pixbitmap));
}
@@ -86,14 +86,14 @@ VIDEO_START( dogfgt )
WRITE8_HANDLER( dogfgt_plane_select_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->bm_plane = data;
}
READ8_HANDLER( dogfgt_bitmapram_r )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
if (state->bm_plane > 2)
{
@@ -106,7 +106,7 @@ READ8_HANDLER( dogfgt_bitmapram_r )
static WRITE8_HANDLER( internal_bitmapram_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
int x, y, subx;
state->bitmapram[offset] = data;
@@ -122,7 +122,7 @@ static WRITE8_HANDLER( internal_bitmapram_w )
for (i = 0; i < 3; i++)
color |= ((state->bitmapram[offset + BITMAPRAM_SIZE / 3 * i] >> subx) & 1) << i;
- if (flip_screen_get(space->machine))
+ if (flip_screen_get(space->machine()))
*BITMAP_ADDR16(state->pixbitmap, y ^ 0xff, (x + subx) ^ 0xff) = PIXMAP_COLOR_BASE + 8 * state->pixcolor + color;
else
*BITMAP_ADDR16(state->pixbitmap, y, x + subx) = PIXMAP_COLOR_BASE + 8 * state->pixcolor + color;
@@ -131,7 +131,7 @@ static WRITE8_HANDLER( internal_bitmapram_w )
WRITE8_HANDLER( dogfgt_bitmapram_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
if (state->bm_plane > 2)
{
@@ -144,7 +144,7 @@ WRITE8_HANDLER( dogfgt_bitmapram_w )
WRITE8_HANDLER( dogfgt_bgvideoram_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff);
@@ -152,7 +152,7 @@ WRITE8_HANDLER( dogfgt_bgvideoram_w )
WRITE8_HANDLER( dogfgt_scroll_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->scroll[offset] = data;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll[0] + 256 * state->scroll[1] + 256);
@@ -161,17 +161,17 @@ WRITE8_HANDLER( dogfgt_scroll_w )
WRITE8_HANDLER( dogfgt_1800_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
/* bits 0 and 1 are probably text color (not verified because PROM is missing) */
state->pixcolor = ((data & 0x01) << 1) | ((data & 0x02) >> 1);
/* bits 4 and 5 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
/* bit 7 is screen flip */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
/* other bits unused? */
logerror("PC %04x: 1800 = %02x\n", cpu_get_pc(space->cpu), data);
@@ -184,9 +184,9 @@ WRITE8_HANDLER( dogfgt_1800_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -207,7 +207,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
state->spriteram[offs + 1] + ((state->spriteram[offs] & 0x30) << 4),
(state->spriteram[offs] & 0x08) >> 3,
flipx,flipy,
@@ -219,14 +219,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( dogfgt )
{
- dogfgt_state *state = screen->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = screen->machine().driver_data<dogfgt_state>();
int offs;
- if (state->lastflip != flip_screen_get(screen->machine) || state->lastpixcolor != state->pixcolor)
+ if (state->lastflip != flip_screen_get(screen->machine()) || state->lastpixcolor != state->pixcolor)
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
- state->lastflip = flip_screen_get(screen->machine);
+ state->lastflip = flip_screen_get(screen->machine());
state->lastpixcolor = state->pixcolor;
for (offs = 0; offs < BITMAPRAM_SIZE; offs++)
@@ -236,7 +236,7 @@ SCREEN_UPDATE( dogfgt )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
copybitmap_trans(bitmap, state->pixbitmap, 0, 0, 0, 0, cliprect, PIXMAP_COLOR_BASE + 8 * state->pixcolor);
return 0;
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index b7796dffbd4..f5a33bfff74 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -48,25 +48,25 @@ INLINE void dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_
WRITE8_HANDLER( dooyong_bgscroll8_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
dooyong_scroll8_w(offset, data, state->bgscroll8, state->bg_tilemap);
}
static WRITE8_HANDLER( dooyong_bg2scroll8_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
dooyong_scroll8_w(offset, data, state->bg2scroll8, state->bg2_tilemap);
}
WRITE8_HANDLER( dooyong_fgscroll8_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
dooyong_scroll8_w(offset, data, state->fgscroll8, state->fg_tilemap);
}
WRITE8_HANDLER( dooyong_fg2scroll8_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
dooyong_scroll8_w(offset, data, state->fg2scroll8, state->fg2_tilemap);
}
@@ -97,7 +97,7 @@ WRITE16_HANDLER( dooyong_fg2scroll16_w )
WRITE8_HANDLER( dooyong_txvideoram8_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
if (state->txvideoram[offset] != data)
{
state->txvideoram[offset] = data;
@@ -113,10 +113,10 @@ WRITE8_HANDLER( dooyong_txvideoram8_w )
WRITE8_HANDLER( lastday_ctrl_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 3 is used but unknown */
@@ -124,17 +124,17 @@ WRITE8_HANDLER( lastday_ctrl_w )
state->sprites_disabled = data & 0x10;
/* bit 6 is flip screen */
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
WRITE8_HANDLER( pollux_ctrl_w )
{
/* bit 0 is flip screen */
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
/* bits 6 and 7 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x80);
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x80);
+ coin_counter_w(space->machine(), 1, data & 0x40);
/* bit 1 is used but unknown */
@@ -144,15 +144,15 @@ WRITE8_HANDLER( pollux_ctrl_w )
WRITE8_HANDLER( primella_ctrl_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
/* bits 0-2 select ROM bank */
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
/* bit 3 disables tx layer */
state->tx_pri = data & 0x08;
/* bit 4 flips screen */
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
/* bit 5 used but unknown */
@@ -161,21 +161,21 @@ WRITE8_HANDLER( primella_ctrl_w )
WRITE8_HANDLER( paletteram_flytiger_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
if (state->flytiger_palette_bank)
{
UINT16 value;
state->paletteram_flytiger[offset] = data;
value = state->paletteram_flytiger[offset & ~1] | (state->paletteram_flytiger[offset | 1] << 8);
- palette_set_color_rgb(space->machine, offset/2, pal5bit(value >> 10), pal5bit(value >> 5), pal5bit(value >> 0));
+ palette_set_color_rgb(space->machine(), offset/2, pal5bit(value >> 10), pal5bit(value >> 5), pal5bit(value >> 0));
}
}
WRITE8_HANDLER( flytiger_ctrl_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
/* bit 0 is flip screen */
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
/* bits 1, 2 used but unknown */
@@ -189,11 +189,11 @@ WRITE8_HANDLER( flytiger_ctrl_w )
WRITE16_HANDLER( rshark_ctrl_w )
{
- dooyong_state *state = space->machine->driver_data<dooyong_state>();
+ dooyong_state *state = space->machine().driver_data<dooyong_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0 flips screen */
- flip_screen_set(space->machine, data & 0x0001);
+ flip_screen_set(space->machine(), data & 0x0001);
/* bit 4 changes tilemaps priority */
state->rshark_pri = data & 0x0010;
@@ -213,7 +213,7 @@ WRITE16_HANDLER( rshark_ctrl_w )
when the x scroll moves out of range (trying to decode the whole lot
at once uses hundreds of megabytes of RAM). */
-INLINE void lastday_get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,
+INLINE void lastday_get_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index,
const UINT8 *tilerom, UINT8 *scroll, int graphics)
{
int offs = (tile_index + ((int)scroll[1] << 6)) * 2;
@@ -251,7 +251,7 @@ INLINE void lastday_get_tile_info(running_machine *machine, tile_data *tileinfo,
SET_TILE_INFO(graphics, code, color, flags);
}
-INLINE void rshark_get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index,
+INLINE void rshark_get_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index,
const UINT8 *tilerom1, const UINT8 *tilerom2, UINT8 *scroll, int graphics)
{
/* Tiles take two bytes in tile ROM 1:
@@ -273,7 +273,7 @@ INLINE void rshark_get_tile_info(running_machine *machine, tile_data *tileinfo,
static TILE_GET_INFO( get_bg_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
if (state->bg_tilerom2 != NULL)
rshark_get_tile_info(machine, tileinfo, tile_index, state->bg_tilerom, state->bg_tilerom2, state->bgscroll8, state->bg_gfx);
else
@@ -282,7 +282,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
if (state->bg2_tilerom2 != NULL)
rshark_get_tile_info(machine, tileinfo, tile_index, state->bg2_tilerom, state->bg2_tilerom2, state->bg2scroll8, state->bg2_gfx);
else
@@ -291,7 +291,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
if (state->fg_tilerom2 != NULL)
rshark_get_tile_info(machine, tileinfo, tile_index, state->fg_tilerom, state->fg_tilerom2, state->fgscroll8, state->fg_gfx);
else
@@ -300,7 +300,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_fg2_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
if (state->fg2_tilerom2 != NULL)
rshark_get_tile_info(machine, tileinfo, tile_index, state->fg2_tilerom, state->fg2_tilerom2, state->fg2scroll8, state->fg2_gfx);
else
@@ -311,7 +311,7 @@ static TILE_GET_INFO( get_fg2_tile_info )
static TILE_GET_INFO( flytiger_get_fg_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
const UINT8 *tilerom = state->fg_tilerom;
int offs = (tile_index + (state->fgscroll8[1] << 6)) * 2;
@@ -325,7 +325,7 @@ static TILE_GET_INFO( flytiger_get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Each tile takes two bytes of memory:
MSB LSB
[offs + 0x00] cccc cccc (bits 7-0 of gfx code)
@@ -350,7 +350,7 @@ static TILE_GET_INFO( get_tx_tile_info )
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pollux_extensions)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pollux_extensions)
{
/* Sprites take 32 bytes each in memory:
MSB LSB
@@ -375,10 +375,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
height only used by pollux, bluehawk and flytiger
x flip and y flip only used by pollux and flytiger */
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
- for (offs = 0; offs < machine->generic.spriteram_size; offs += 32)
+ for (offs = 0; offs < machine.generic.spriteram_size; offs += 32)
{
int sx, sy, code, color, pri;
int flipx = 0, flipy = 0, height = 0, y;
@@ -429,20 +429,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (y = 0; y <= height; y++)
{
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code + y,
color,
flipx, flipy,
sx, sy + (16 * (flipy ? (height - y) : y)),
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri, 15);
}
}
}
-static void rshark_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
/* Sprites take 8 16-bit words each in memory:
MSB LSB
@@ -465,7 +465,7 @@ static void rshark_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
int offs;
- for (offs = (machine->generic.spriteram_size / 2) - 8; offs >= 0; offs -= 8)
+ for (offs = (machine.generic.spriteram_size / 2) - 8; offs >= 0; offs -= 8)
{
if (buffered_spriteram16[offs] & 0x0001) /* enable */
{
@@ -497,12 +497,12 @@ static void rshark_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
for (x = 0; x <= width; x++)
{
int _x = sx + (16 * (flipx ? (width - x) : x));
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[0],
code,
color,
flipx, flipy,
_x, _y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri, 15);
code++;
}
@@ -514,52 +514,52 @@ static void rshark_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( lastday )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
if (!state->sprites_disabled)
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
SCREEN_UPDATE( gulfstrm )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
return 0;
}
SCREEN_UPDATE( pollux )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
return 0;
}
SCREEN_UPDATE( flytiger )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->flytiger_pri)
{
@@ -573,30 +573,30 @@ SCREEN_UPDATE( flytiger )
}
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, 4);
return 0;
}
SCREEN_UPDATE( bluehawk )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->fg2_tilemap, 0, 4);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
return 0;
}
SCREEN_UPDATE( primella )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if (state->tx_pri) tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -607,38 +607,38 @@ SCREEN_UPDATE( primella )
SCREEN_UPDATE( rshark )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, (state->rshark_pri ? 2 : 1));
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
tilemap_draw(bitmap, cliprect, state->fg2_tilemap, 0, 2);
- rshark_draw_sprites(screen->machine, bitmap, cliprect);
+ rshark_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( popbingo )
{
- dooyong_state *state = screen->machine->driver_data<dooyong_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ dooyong_state *state = screen->machine().driver_data<dooyong_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
- rshark_draw_sprites(screen->machine, bitmap, cliprect);
+ rshark_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
VIDEO_START( lastday )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx5")->base();
- state->fg_tilerom = machine->region("gfx6")->base();
+ state->bg_tilerom = machine.region("gfx5")->base();
+ state->fg_tilerom = machine.region("gfx6")->base();
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->bg_gfx = 2;
@@ -675,10 +675,10 @@ VIDEO_START( lastday )
VIDEO_START( gulfstrm )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx5")->base();
- state->fg_tilerom = machine->region("gfx6")->base();
+ state->bg_tilerom = machine.region("gfx5")->base();
+ state->fg_tilerom = machine.region("gfx6")->base();
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->bg_gfx = 2;
@@ -714,10 +714,10 @@ VIDEO_START( gulfstrm )
VIDEO_START( pollux )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx5")->base();
- state->fg_tilerom = machine->region("gfx6")->base();
+ state->bg_tilerom = machine.region("gfx5")->base();
+ state->fg_tilerom = machine.region("gfx6")->base();
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->bg_gfx = 2;
@@ -750,11 +750,11 @@ VIDEO_START( pollux )
VIDEO_START( bluehawk )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx3")->base() + 0x78000;
- state->fg_tilerom = machine->region("gfx4")->base() + 0x78000;
- state->fg2_tilerom = machine->region("gfx5")->base() + 0x38000;
+ state->bg_tilerom = machine.region("gfx3")->base() + 0x78000;
+ state->fg_tilerom = machine.region("gfx4")->base() + 0x78000;
+ state->fg2_tilerom = machine.region("gfx5")->base() + 0x38000;
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->fg2_tilerom2 = NULL;
@@ -791,10 +791,10 @@ VIDEO_START( bluehawk )
VIDEO_START( flytiger )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx3")->base() + 0x78000;
- state->fg_tilerom = machine->region("gfx4")->base() + 0x78000;
+ state->bg_tilerom = machine.region("gfx3")->base() + 0x78000;
+ state->fg_tilerom = machine.region("gfx4")->base() + 0x78000;
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->bg_gfx = 2;
@@ -827,10 +827,10 @@ VIDEO_START( flytiger )
VIDEO_START( primella )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx2")->base() + machine->region("gfx2")->bytes() - 0x8000;
- state->fg_tilerom = machine->region("gfx3")->base() + machine->region("gfx3")->bytes() - 0x8000;
+ state->bg_tilerom = machine.region("gfx2")->base() + machine.region("gfx2")->bytes() - 0x8000;
+ state->fg_tilerom = machine.region("gfx3")->base() + machine.region("gfx3")->bytes() - 0x8000;
state->bg_tilerom2 = NULL;
state->fg_tilerom2 = NULL;
state->bg_gfx = 1;
@@ -862,16 +862,16 @@ VIDEO_START( primella )
VIDEO_START( rshark )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx5")->base();
- state->bg2_tilerom = machine->region("gfx4")->base();
- state->fg_tilerom = machine->region("gfx3")->base();
- state->fg2_tilerom = machine->region("gfx2")->base();
- state->bg_tilerom2 = machine->region("gfx6")->base() + 0x60000;
- state->bg2_tilerom2 = machine->region("gfx6")->base() + 0x40000;
- state->fg_tilerom2 = machine->region("gfx6")->base() + 0x20000;
- state->fg2_tilerom2 = machine->region("gfx6")->base() + 0x00000;
+ state->bg_tilerom = machine.region("gfx5")->base();
+ state->bg2_tilerom = machine.region("gfx4")->base();
+ state->fg_tilerom = machine.region("gfx3")->base();
+ state->fg2_tilerom = machine.region("gfx2")->base();
+ state->bg_tilerom2 = machine.region("gfx6")->base() + 0x60000;
+ state->bg2_tilerom2 = machine.region("gfx6")->base() + 0x40000;
+ state->fg_tilerom2 = machine.region("gfx6")->base() + 0x20000;
+ state->fg2_tilerom2 = machine.region("gfx6")->base() + 0x00000;
state->bg_gfx = 4;
state->bg2_gfx = 3;
state->fg_gfx = 2;
@@ -907,9 +907,9 @@ VIDEO_START( rshark )
VIDEO_START( popbingo )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
/* Configure tilemap callbacks */
- state->bg_tilerom = machine->region("gfx2")->base();
+ state->bg_tilerom = machine.region("gfx2")->base();
state->bg_gfx = 1;
/* Create tilemaps */
@@ -933,14 +933,14 @@ VIDEO_START( popbingo )
SCREEN_EOF( dooyong )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
SCREEN_EOF( rshark )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
diff --git a/src/mame/video/dragrace.c b/src/mame/video/dragrace.c
index 7f8ec1d1511..558bc3af853 100644
--- a/src/mame/video/dragrace.c
+++ b/src/mame/video/dragrace.c
@@ -10,7 +10,7 @@ Atari Drag Race video emulation
static TILE_GET_INFO( get_tile_info )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
UINT8 code = state->playfield_ram[tile_index];
int num = 0;
int col = 0;
@@ -42,14 +42,14 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( dragrace )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
}
SCREEN_UPDATE( dragrace )
{
- dragrace_state *state = screen->machine->driver_data<dragrace_state>();
+ dragrace_state *state = screen->machine().driver_data<dragrace_state>();
int y;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
diff --git a/src/mame/video/drgnmst.c b/src/mame/video/drgnmst.c
index dd6fc98020d..61d48eab6a3 100644
--- a/src/mame/video/drgnmst.c
+++ b/src/mame/video/drgnmst.c
@@ -8,7 +8,7 @@
static TILE_GET_INFO( get_drgnmst_fg_tile_info )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
int tileno, colour, flipyx;
tileno = state->fg_videoram[tile_index * 2] & 0xfff;
colour = state->fg_videoram[tile_index * 2 + 1] & 0x1f;
@@ -19,14 +19,14 @@ static TILE_GET_INFO( get_drgnmst_fg_tile_info )
WRITE16_HANDLER( drgnmst_fg_videoram_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_drgnmst_bg_tile_info )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
int tileno, colour, flipyx;
tileno = (state->bg_videoram[tile_index * 2]& 0x1fff) + 0x800;
colour = state->bg_videoram[tile_index * 2 + 1] & 0x1f;
@@ -37,14 +37,14 @@ static TILE_GET_INFO( get_drgnmst_bg_tile_info )
WRITE16_HANDLER( drgnmst_bg_videoram_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_drgnmst_md_tile_info )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
int tileno, colour, flipyx;
tileno = (state->md_videoram[tile_index * 2] & 0x7fff) - 0x2000;
colour = state->md_videoram[tile_index * 2 + 1] & 0x1f;
@@ -55,15 +55,15 @@ static TILE_GET_INFO( get_drgnmst_md_tile_info )
WRITE16_HANDLER( drgnmst_md_videoram_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
COMBINE_DATA(&state->md_videoram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap, offset / 2);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
- const gfx_element *gfx = machine->gfx[0];
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x800 / 2;
@@ -125,7 +125,7 @@ static TILEMAP_MAPPER( drgnmst_bg_tilemap_scan_cols )
VIDEO_START(drgnmst)
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->fg_tilemap = tilemap_create(machine, get_drgnmst_fg_tile_info, drgnmst_fg_tilemap_scan_cols, 8, 8, 64,64);
tilemap_set_transparent_pen(state->fg_tilemap, 15);
@@ -141,7 +141,7 @@ VIDEO_START(drgnmst)
SCREEN_UPDATE(drgnmst)
{
- drgnmst_state *state = screen->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = screen->machine().driver_data<drgnmst_state>();
int y, rowscroll_bank;
tilemap_set_scrollx(state->bg_tilemap, 0, state->vidregs[10] - 18); // verify
@@ -194,7 +194,7 @@ SCREEN_UPDATE(drgnmst)
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
// popmessage ("x %04x x %04x x %04x x %04x x %04x", state->vidregs2[0], state->vidregs[12], state->vidregs[13], state->vidregs[14], state->vidregs[15]);
// popmessage ("x %04x x %04x y %04x y %04x z %04x z %04x",state->vidregs[0],state->vidregs[1],state->vidregs[2],state->vidregs[3],state->vidregs[4],state->vidregs[5]);
diff --git a/src/mame/video/dribling.c b/src/mame/video/dribling.c
index 8190aba8728..cbb48052ee1 100644
--- a/src/mame/video/dribling.c
+++ b/src/mame/video/dribling.c
@@ -17,7 +17,7 @@
PALETTE_INIT( dribling )
{
- const UINT8 *prom = machine->region("proms")->base() + 0x400;
+ const UINT8 *prom = machine.region("proms")->base() + 0x400;
int i;
for (i = 0; i < 256; i++)
@@ -44,7 +44,7 @@ PALETTE_INIT( dribling )
WRITE8_HANDLER( dribling_colorram_w )
{
- dribling_state *state = space->machine->driver_data<dribling_state>();
+ dribling_state *state = space->machine().driver_data<dribling_state>();
/* it is very important that we mask off the two bits here */
state->colorram[offset & 0x1f9f] = data;
@@ -60,9 +60,9 @@ WRITE8_HANDLER( dribling_colorram_w )
SCREEN_UPDATE( dribling )
{
- dribling_state *state = screen->machine->driver_data<dribling_state>();
- UINT8 *prombase = screen->machine->region("proms")->base();
- UINT8 *gfxbase = screen->machine->region("gfx1")->base();
+ dribling_state *state = screen->machine().driver_data<dribling_state>();
+ UINT8 *prombase = screen->machine().region("proms")->base();
+ UINT8 *gfxbase = screen->machine().region("gfx1")->base();
int x, y;
/* loop over rows */
diff --git a/src/mame/video/drmicro.c b/src/mame/video/drmicro.c
index 9e7cd1d9897..65526d7d163 100644
--- a/src/mame/video/drmicro.c
+++ b/src/mame/video/drmicro.c
@@ -15,7 +15,7 @@ Video hardware
WRITE8_HANDLER( drmicro_videoram_w )
{
- drmicro_state *state = space->machine->driver_data<drmicro_state>();
+ drmicro_state *state = space->machine().driver_data<drmicro_state>();
state->videoram[offset] = data;
if (offset < 0x800)
@@ -29,7 +29,7 @@ WRITE8_HANDLER( drmicro_videoram_w )
static TILE_GET_INFO( get_bg1_tile_info )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
int code, col, flags;
code = state->videoram[tile_index + 0x0800];
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
int code, col, flags;
code = state->videoram[tile_index + 0x0000];
@@ -64,7 +64,7 @@ PALETTE_INIT( drmicro )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -90,7 +90,7 @@ PALETTE_INIT( drmicro )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -99,13 +99,13 @@ PALETTE_INIT( drmicro )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
VIDEO_START( drmicro)
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
state->videoram = auto_alloc_array(machine, UINT8, 0x1000);
state->save_pointer(NAME(state->videoram), 0x1000);
@@ -118,7 +118,7 @@ VIDEO_START( drmicro)
SCREEN_UPDATE( drmicro )
{
- drmicro_state *state = screen->machine->driver_data<drmicro_state>();
+ drmicro_state *state = screen->machine().driver_data<drmicro_state>();
int offs, adr, g;
int chr, col, attr;
int x, y, fx, fy;
@@ -150,7 +150,7 @@ SCREEN_UPDATE( drmicro )
else
x = (240 - x) & 0xff;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3-g],
chr,
col,
fx,fy,
@@ -158,7 +158,7 @@ SCREEN_UPDATE( drmicro )
if (x > 240)
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3-g],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3-g],
chr,
col,
fx,fy,
diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c
index d0a91b15e19..b15a8161bb8 100644
--- a/src/mame/video/dynax.c
+++ b/src/mame/video/dynax.c
@@ -30,7 +30,7 @@ PALETTE_INIT( sprtmtch )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int x = (color_prom[i] << 8) + color_prom[0x200 + i];
/* The bits are in reverse order! */
@@ -57,13 +57,13 @@ PALETTE_INIT( sprtmtch )
WRITE8_HANDLER( dynax_extra_scrollx_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->extra_scroll_x = data;
}
WRITE8_HANDLER( dynax_extra_scrolly_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->extra_scroll_y = data;
}
@@ -71,14 +71,14 @@ WRITE8_HANDLER( dynax_extra_scrolly_w )
/* Destination Pen */
WRITE8_HANDLER( dynax_blit_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_pen = data;
LOG(("P=%02X ", data));
}
WRITE8_HANDLER( dynax_blit2_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit2_pen = data;
LOG(("P'=%02X ", data));
}
@@ -87,7 +87,7 @@ WRITE8_HANDLER( dynax_blit2_pen_w )
/* Destination Layers */
WRITE8_HANDLER( dynax_blit_dest_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_dest = data;
if (state->layer_layout == LAYOUT_HNORIDUR)
state->blit_dest = BITSWAP8(state->blit_dest ^ 0x0f, 7, 6, 5, 4, 0, 1, 2, 3);
@@ -97,7 +97,7 @@ WRITE8_HANDLER( dynax_blit_dest_w )
WRITE8_HANDLER( dynax_blit2_dest_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit2_dest = data;
LOG(("D'=%02X ", data));
}
@@ -111,7 +111,7 @@ WRITE8_HANDLER( tenkai_blit_dest_w )
/* Background Color */
WRITE8_HANDLER( dynax_blit_backpen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_backpen = data;
LOG(("B=%02X ", data));
}
@@ -120,7 +120,7 @@ WRITE8_HANDLER( dynax_blit_backpen_w )
/* Layers 0&1 Palettes (Low Bits) */
WRITE8_HANDLER( dynax_blit_palette01_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->layer_layout == LAYOUT_HNORIDUR)
state->blit_palettes = (state->blit_palettes & 0x00ff) | ((data & 0x0f) << 12) | ((data & 0xf0) << 4);
else
@@ -130,7 +130,7 @@ WRITE8_HANDLER( dynax_blit_palette01_w )
WRITE8_HANDLER( tenkai_blit_palette01_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_palettes = (state->blit_palettes & 0xff00) | data;
LOG(("P01=%02X ", data));
}
@@ -139,7 +139,7 @@ WRITE8_HANDLER( tenkai_blit_palette01_w )
/* Layers 4&5 Palettes (Low Bits) */
WRITE8_HANDLER( dynax_blit_palette45_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->layer_layout == LAYOUT_HNORIDUR)
state->blit2_palettes = (state->blit2_palettes & 0x00ff) | ((data & 0x0f) << 12) | ((data & 0xf0) << 4);
@@ -152,7 +152,7 @@ WRITE8_HANDLER( dynax_blit_palette45_w )
/* Layer 2&3 Palettes (Low Bits) */
WRITE8_HANDLER( dynax_blit_palette23_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->layer_layout == LAYOUT_HNORIDUR)
state->blit_palettes = (state->blit_palettes & 0xff00) | ((data & 0x0f) << 4) | ((data & 0xf0) >> 4);
@@ -163,7 +163,7 @@ WRITE8_HANDLER( dynax_blit_palette23_w )
WRITE8_HANDLER( tenkai_blit_palette23_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_palettes = (state->blit_palettes & 0x00ff) | ((data & 0x0f) << 12) | ((data & 0xf0) << 4);
LOG(("P23=%02X ", data));
}
@@ -172,7 +172,7 @@ WRITE8_HANDLER( tenkai_blit_palette23_w )
/* Layer 6&7 Palettes (Low Bits) */
WRITE8_HANDLER( dynax_blit_palette67_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->layer_layout == LAYOUT_HNORIDUR)
state->blit2_palettes = (state->blit2_palettes & 0xff00) | ((data & 0x0f) << 4) | ((data & 0xf0) >> 4);
@@ -185,14 +185,14 @@ WRITE8_HANDLER( dynax_blit_palette67_w )
/* Layers Palettes (High Bits) */
WRITE8_HANDLER( dynax_blit_palbank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit_palbank = data;
LOG(("PB=%02X ", data));
}
WRITE8_HANDLER( dynax_blit2_palbank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blit2_palbank = data;
LOG(("PB'=%02X ", data));
}
@@ -201,7 +201,7 @@ WRITE8_HANDLER( dynax_blit2_palbank_w )
/* Which half of the layers to write two (interleaved games only) */
WRITE8_HANDLER( hanamai_layer_half_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hanamai_layer_half = (~data) & 1;
LOG(("H=%02X ", data));
}
@@ -210,14 +210,14 @@ WRITE8_HANDLER( hanamai_layer_half_w )
/* Write to both halves of the layers (interleaved games only) */
WRITE8_HANDLER( hnoridur_layer_half2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hnoridur_layer_half2 = (~data) & 1;
LOG(("H2=%02X ", data));
}
WRITE8_HANDLER( mjdialq2_blit_dest_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int mask = (2 >> offset); /* 1 or 2 */
state->blit_dest &= ~mask;
@@ -230,14 +230,14 @@ WRITE8_HANDLER( mjdialq2_blit_dest_w )
/* Layers Enable */
WRITE8_HANDLER( dynax_layer_enable_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->layer_enable = data;
LOG(("E=%02X ", data));
}
WRITE8_HANDLER( jantouki_layer_enable_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int mask = 1 << (7 - offset);
state->layer_enable = (state->layer_enable & ~mask) | ((data & 1) ? mask : 0);
state->layer_enable |= 1;
@@ -245,7 +245,7 @@ WRITE8_HANDLER( jantouki_layer_enable_w )
WRITE8_HANDLER( mjdialq2_layer_enable_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int mask = (2 >> offset); /* 1 or 2 */
state->layer_enable &= ~mask;
@@ -256,7 +256,7 @@ WRITE8_HANDLER( mjdialq2_layer_enable_w )
WRITE8_HANDLER( dynax_flipscreen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->flipscreen = data & 1;
if (data & ~1)
logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", cpu_get_pc(space->cpu), data);
@@ -268,7 +268,7 @@ static const char *const gfxregions[] = { "gfx1", "gfx2", "gfx3", "gfx4", "gfx5"
WRITE8_HANDLER( dynax_blit_romregion_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (data < ARRAY_LENGTH(gfxregions))
state->blit_romregion = data;
LOG(("GFX%X ", data + 1));
@@ -276,7 +276,7 @@ WRITE8_HANDLER( dynax_blit_romregion_w )
WRITE8_HANDLER( dynax_blit2_romregion_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (data + 1 < ARRAY_LENGTH(gfxregions))
state->blit2_romregion = data + 1;
LOG(("GFX%X' ", data + 2));
@@ -310,9 +310,9 @@ WRITE8_HANDLER( dynax_blit2_romregion_w )
/* Plot a pixel (in the pixmaps specified by dynax_blit_dest) */
-INLINE void blitter_plot_pixel( running_machine *machine, int layer, int mask, int x, int y, int pen, int wrap, int flags )
+INLINE void blitter_plot_pixel( running_machine &machine, int layer, int mask, int x, int y, int pen, int wrap, int flags )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int addr;
if ((y > 0xff) && (!(wrap & 2))) return; // fixes mjdialq2 & mjangels title screens
@@ -375,12 +375,12 @@ INLINE void blitter_plot_pixel( running_machine *machine, int layer, int mask, i
}
-static int blitter_drawgfx( running_machine *machine, int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags )
+static int blitter_drawgfx( running_machine &machine, int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
UINT8 cmd;
- UINT8 *ROM = machine->region(gfx)->base();
- size_t ROM_size = machine->region(gfx)->bytes();
+ UINT8 *ROM = machine.region(gfx)->base();
+ size_t ROM_size = machine.region(gfx)->bytes();
int sx;
@@ -529,9 +529,9 @@ static int blitter_drawgfx( running_machine *machine, int layer, int mask, const
-static void dynax_blitter_start( running_machine *machine, int flags )
+static void dynax_blitter_start( running_machine &machine, int flags )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int blit_newsrc;
LOG(("XY=%X,%X SRC=%X BLIT=%X\n", state->blit_x, state->blit_y, state->blit_src, flags));
@@ -558,9 +558,9 @@ static void dynax_blitter_start( running_machine *machine, int flags )
}
}
-static void jantouki_blitter_start( running_machine *machine, int flags )
+static void jantouki_blitter_start( running_machine &machine, int flags )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int blit_newsrc;
LOG(("XY=%X,%X SRC=%X BLIT=%X\n", state->blit_x, state->blit_y, state->blit_src, flags));
@@ -587,9 +587,9 @@ static void jantouki_blitter_start( running_machine *machine, int flags )
}
}
-static void jantouki_blitter2_start( running_machine *machine, int flags )
+static void jantouki_blitter2_start( running_machine &machine, int flags )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int blit2_newsrc;
LOG(("XY'=%X,%X SRC'=%X BLIT'=%02X\n", state->blit2_x, state->blit2_y, state->blit2_src, flags));
@@ -620,7 +620,7 @@ static void jantouki_blitter2_start( running_machine *machine, int flags )
static WRITE8_HANDLER( dynax_blit_scroll_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->blit_src & 0xc00000)
{
@@ -640,7 +640,7 @@ static WRITE8_HANDLER( dynax_blit_scroll_w )
// inverted scroll values
static WRITE8_HANDLER( tenkai_blit_scroll_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->blit_src & 0xc00000)
{
@@ -659,7 +659,7 @@ static WRITE8_HANDLER( tenkai_blit_scroll_w )
static WRITE8_HANDLER( dynax_blit2_scroll_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->blit2_src & 0xc00000)
{
@@ -678,11 +678,11 @@ static WRITE8_HANDLER( dynax_blit2_scroll_w )
WRITE8_HANDLER( dynax_blitter_rev2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
- case 0: dynax_blitter_start(space->machine, data); break;
+ case 0: dynax_blitter_start(space->machine(), data); break;
case 1: state->blit_x = data; break;
case 2: state->blit_y = data; break;
case 3: state->blit_src = (state->blit_src & 0xffff00) | (data << 0); break;
@@ -695,11 +695,11 @@ WRITE8_HANDLER( dynax_blitter_rev2_w )
// different scroll_w
WRITE8_HANDLER( tenkai_blitter_rev2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
- case 0: dynax_blitter_start(space->machine, data); break;
+ case 0: dynax_blitter_start(space->machine(), data); break;
case 1: state->blit_x = data; break;
case 2: state->blit_y = data; break;
case 3: state->blit_src = (state->blit_src & 0xffff00) | (data << 0); break;
@@ -712,11 +712,11 @@ WRITE8_HANDLER( tenkai_blitter_rev2_w )
WRITE8_HANDLER( jantouki_blitter_rev2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
- case 0: jantouki_blitter_start(space->machine, data); break;
+ case 0: jantouki_blitter_start(space->machine(), data); break;
case 1: state->blit_x = data; break;
case 2: state->blit_y = data; break;
case 3: state->blit_src = (state->blit_src & 0xffff00) | (data << 0); break;
@@ -728,11 +728,11 @@ WRITE8_HANDLER( jantouki_blitter_rev2_w )
WRITE8_HANDLER( jantouki_blitter2_rev2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
- case 0: jantouki_blitter2_start(space->machine,data); break;
+ case 0: jantouki_blitter2_start(space->machine(),data); break;
case 1: state->blit2_x = data; break;
case 2: state->blit2_y = data; break;
case 3: state->blit2_src = (state->blit2_src & 0xffff00) | (data << 0); break;
@@ -757,9 +757,9 @@ static const int priority_mcnpshnt[8] = { 0x3210, 0x2103, 0x3102, 0x2031, 0x3021
static const int priority_mjelctrn[8] = { 0x0231, 0x0321, 0x2031, 0x2301, 0x3021, 0x3201 ,0x0000, 0x0000 }; // this game doesn't use (hasn't?) layer 1
-static void dynax_common_reset( running_machine *machine )
+static void dynax_common_reset( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->blit_romregion = 0;
state->blit2_romregion = 0;
@@ -832,7 +832,7 @@ static void dynax_common_reset( running_machine *machine )
VIDEO_START( hanamai )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
state->pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -858,7 +858,7 @@ VIDEO_START( hanamai )
VIDEO_START( hnoridur )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
state->pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -886,7 +886,7 @@ VIDEO_START( hnoridur )
VIDEO_START( mcnpshnt )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(hnoridur);
state->priority_table = priority_mcnpshnt;
@@ -894,7 +894,7 @@ VIDEO_START( mcnpshnt )
VIDEO_START( sprtmtch )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
state->pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -916,7 +916,7 @@ VIDEO_START( sprtmtch )
VIDEO_START( jantouki )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
state->pixmap[0][1] = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -959,7 +959,7 @@ VIDEO_START( jantouki )
VIDEO_START( mjdialq2 )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->pixmap[0][0] = auto_alloc_array(machine, UINT8, 256 * 256);
state->pixmap[1][0] = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -974,7 +974,7 @@ VIDEO_START( mjdialq2 )
VIDEO_START( mjelctrn )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(hnoridur);
@@ -984,7 +984,7 @@ VIDEO_START( mjelctrn )
VIDEO_START( neruton )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(hnoridur);
@@ -1000,9 +1000,9 @@ VIDEO_START( neruton )
***************************************************************************/
-static void hanamai_copylayer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
+static void hanamai_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int color;
int scrollx, scrolly;
@@ -1064,9 +1064,9 @@ static void hanamai_copylayer( running_machine *machine, bitmap_t *bitmap, const
}
-static void jantouki_copylayer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int y )
+static void jantouki_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int y )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int color, scrollx, scrolly, palettes, palbank;
if (i < 4)
@@ -1139,9 +1139,9 @@ static void jantouki_copylayer( running_machine *machine, bitmap_t *bitmap, cons
}
-static void mjdialq2_copylayer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
+static void mjdialq2_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int color;
int scrollx, scrolly;
@@ -1191,17 +1191,17 @@ static void mjdialq2_copylayer( running_machine *machine, bitmap_t *bitmap, cons
WRITE8_HANDLER( hanamai_priority_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hanamai_priority = data;
}
WRITE8_HANDLER( tenkai_priority_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hanamai_priority = BITSWAP8(data, 3, 2, 1, 0, 4, 7, 5, 6);
}
-static int debug_mask( running_machine *machine )
+static int debug_mask( running_machine &machine )
{
#ifdef MAME_DEBUG
int msk = 0;
@@ -1227,7 +1227,7 @@ static int debug_mask( running_machine *machine )
I,O - Change palette (-,+)
J,K & N,M - Change "tile" (-,+, slow & fast)
R - move "tile" to the next 1/8th of the gfx */
-static int debug_viewer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
#ifdef MAME_DEBUG
@@ -1235,9 +1235,9 @@ static int debug_viewer( running_machine *machine, bitmap_t *bitmap, const recta
if (input_code_pressed_once(machine, KEYCODE_T)) toggle = 1 - toggle;
if (toggle)
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *RAM = machine->region( "gfx1" )->base();
- size_t size = machine->region( "gfx1" )->bytes();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *RAM = machine.region( "gfx1" )->base();
+ size_t size = machine.region( "gfx1" )->bytes();
static int i = 0, c = 0, r = 0;
if (input_code_pressed_once(machine, KEYCODE_I)) c = (c - 1) & 0x1f;
@@ -1280,14 +1280,14 @@ static int debug_viewer( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( hanamai )
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layers_ctrl = ~state->layer_enable;
int lay[4];
- if (debug_viewer(screen->machine, bitmap, cliprect))
+ if (debug_viewer(screen->machine(), bitmap, cliprect))
return 0;
- layers_ctrl &= debug_mask(screen->machine);
+ layers_ctrl &= debug_mask(screen->machine());
bitmap_fill(bitmap, cliprect, (state->blit_backpen & 0xff) + (state->blit_palbank & 1) * 256);
@@ -1306,25 +1306,25 @@ SCREEN_UPDATE( hanamai )
case 0x15: lay[0] = 0; lay[1] = 2; lay[2] = 3; lay[3] = 1; break;
}
- if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[0]);
- if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[1]);
- if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[2]);
- if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[3]);
+ if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[0]);
+ if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[1]);
+ if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[2]);
+ if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[3]);
return 0;
}
SCREEN_UPDATE( hnoridur )
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layers_ctrl = ~BITSWAP8(state->hanamai_priority, 7, 6, 5, 4, 0, 1, 2, 3);
int lay[4];
int pri;
- if (debug_viewer(screen->machine, bitmap, cliprect))
+ if (debug_viewer(screen->machine(), bitmap, cliprect))
return 0;
- layers_ctrl &= debug_mask(screen->machine);
+ layers_ctrl &= debug_mask(screen->machine());
bitmap_fill(bitmap, cliprect, (state->blit_backpen & 0xff) + (state->blit_palbank & 0x0f) * 256);
@@ -1342,10 +1342,10 @@ SCREEN_UPDATE( hnoridur )
lay[2] = (pri >> 4) & 3;
lay[3] = (pri >> 0) & 3;
- if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[0]);
- if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[1]);
- if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[2]);
- if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine, bitmap, cliprect, lay[3]);
+ if (BIT(layers_ctrl, lay[0])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[0]);
+ if (BIT(layers_ctrl, lay[1])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[1]);
+ if (BIT(layers_ctrl, lay[2])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[2]);
+ if (BIT(layers_ctrl, lay[3])) hanamai_copylayer(screen->machine(), bitmap, cliprect, lay[3]);
return 0;
}
@@ -1353,48 +1353,48 @@ SCREEN_UPDATE( hnoridur )
SCREEN_UPDATE( sprtmtch )
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layers_ctrl = ~state->layer_enable;
- if (debug_viewer(screen->machine,bitmap,cliprect))
+ if (debug_viewer(screen->machine(),bitmap,cliprect))
return 0;
- layers_ctrl &= debug_mask(screen->machine);
+ layers_ctrl &= debug_mask(screen->machine());
bitmap_fill(bitmap, cliprect, (state->blit_backpen & 0xff) + (state->blit_palbank & 1) * 256);
- if (BIT(layers_ctrl, 0)) hanamai_copylayer(screen->machine, bitmap, cliprect, 0);
- if (BIT(layers_ctrl, 1)) hanamai_copylayer(screen->machine, bitmap, cliprect, 1);
- if (BIT(layers_ctrl, 2)) hanamai_copylayer(screen->machine, bitmap, cliprect, 2);
+ if (BIT(layers_ctrl, 0)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 0);
+ if (BIT(layers_ctrl, 1)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 1);
+ if (BIT(layers_ctrl, 2)) hanamai_copylayer(screen->machine(), bitmap, cliprect, 2);
return 0;
}
SCREEN_UPDATE( jantouki )
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layers_ctrl = state->layer_enable;
- if (debug_viewer(screen->machine, bitmap, cliprect))
+ if (debug_viewer(screen->machine(), bitmap, cliprect))
return 0;
- layers_ctrl &= debug_mask(screen->machine);
+ layers_ctrl &= debug_mask(screen->machine());
bitmap_fill(bitmap, cliprect, (state->blit_backpen & 0xff) + (state->blit_palbank & 1) * 256);
if (screen == state->top_scr)
{
- // if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine, bitmap, cliprect, 3, 0);
- if (BIT(layers_ctrl, 1)) jantouki_copylayer(screen->machine, bitmap, cliprect, 2, 0);
- if (BIT(layers_ctrl, 2)) jantouki_copylayer(screen->machine, bitmap, cliprect, 1, 0);
- if (BIT(layers_ctrl, 3)) jantouki_copylayer(screen->machine, bitmap, cliprect, 0, 0);
+ // if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 3, 0);
+ if (BIT(layers_ctrl, 1)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 2, 0);
+ if (BIT(layers_ctrl, 2)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 1, 0);
+ if (BIT(layers_ctrl, 3)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 0, 0);
}
else if (screen == state->bot_scr)
{
- if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine, bitmap, cliprect, 3, 0);
- if (BIT(layers_ctrl, 4)) jantouki_copylayer(screen->machine, bitmap, cliprect, 7, 0);
- if (BIT(layers_ctrl, 5)) jantouki_copylayer(screen->machine, bitmap, cliprect, 6, 0);
- if (BIT(layers_ctrl, 6)) jantouki_copylayer(screen->machine, bitmap, cliprect, 5, 0);
- if (BIT(layers_ctrl, 7)) jantouki_copylayer(screen->machine, bitmap, cliprect, 4, 0);
+ if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 3, 0);
+ if (BIT(layers_ctrl, 4)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 7, 0);
+ if (BIT(layers_ctrl, 5)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 6, 0);
+ if (BIT(layers_ctrl, 6)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 5, 0);
+ if (BIT(layers_ctrl, 7)) jantouki_copylayer(screen->machine(), bitmap, cliprect, 4, 0);
}
return 0;
}
@@ -1402,18 +1402,18 @@ SCREEN_UPDATE( jantouki )
SCREEN_UPDATE( mjdialq2 )
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layers_ctrl = ~state->layer_enable;
- if (debug_viewer(screen->machine, bitmap, cliprect))
+ if (debug_viewer(screen->machine(), bitmap, cliprect))
return 0;
- layers_ctrl &= debug_mask(screen->machine);
+ layers_ctrl &= debug_mask(screen->machine());
bitmap_fill(bitmap, cliprect, (state->blit_backpen & 0xff) + (state->blit_palbank & 1) * 256);
- if (BIT(layers_ctrl, 0)) mjdialq2_copylayer(screen->machine, bitmap, cliprect, 0);
- if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(screen->machine, bitmap, cliprect, 1);
+ if (BIT(layers_ctrl, 0)) mjdialq2_copylayer(screen->machine(), bitmap, cliprect, 0);
+ if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(screen->machine(), bitmap, cliprect, 1);
return 0;
}
@@ -1427,7 +1427,7 @@ VIDEO_START(htengoku)
SCREEN_UPDATE(htengoku)
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
int layer, x, y;
// render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c"
@@ -1435,7 +1435,7 @@ SCREEN_UPDATE(htengoku)
for (layer = 0; layer < 4; layer++)
{
bitmap_fill(bitmap, cliprect, 0);
- hanamai_copylayer(screen->machine, bitmap, cliprect, layer);
+ hanamai_copylayer(screen->machine(), bitmap, cliprect, layer);
for (y = 0; y < 256; y++)
for (x = 0; x < 512; x++)
diff --git a/src/mame/video/dynduke.c b/src/mame/video/dynduke.c
index b9cbd890542..49b0ce7d02a 100644
--- a/src/mame/video/dynduke.c
+++ b/src/mame/video/dynduke.c
@@ -9,28 +9,28 @@ WRITE16_HANDLER( dynduke_paletteram_w )
{
int color;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- color=space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine,offset,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ color=space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(),offset,pal4bit(color >> 0),pal4bit(color >> 4),pal4bit(color >> 8));
}
WRITE16_HANDLER( dynduke_background_w )
{
- dynduke_state *state = space->machine->driver_data<dynduke_state>();
+ dynduke_state *state = space->machine().driver_data<dynduke_state>();
COMBINE_DATA(&state->back_data[offset]);
tilemap_mark_tile_dirty(state->bg_layer,offset);
}
WRITE16_HANDLER( dynduke_foreground_w )
{
- dynduke_state *state = space->machine->driver_data<dynduke_state>();
+ dynduke_state *state = space->machine().driver_data<dynduke_state>();
COMBINE_DATA(&state->fore_data[offset]);
tilemap_mark_tile_dirty(state->fg_layer,offset);
}
WRITE16_HANDLER( dynduke_text_w )
{
- dynduke_state *state = space->machine->driver_data<dynduke_state>();
+ dynduke_state *state = space->machine().driver_data<dynduke_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->tx_layer,offset);
@@ -38,7 +38,7 @@ WRITE16_HANDLER( dynduke_text_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
+ dynduke_state *state = machine.driver_data<dynduke_state>();
int tile=state->back_data[tile_index];
int color=tile >> 12;
@@ -53,7 +53,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
+ dynduke_state *state = machine.driver_data<dynduke_state>();
int tile=state->fore_data[tile_index];
int color=tile >> 12;
@@ -68,7 +68,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
+ dynduke_state *state = machine.driver_data<dynduke_state>();
UINT16 *videoram = state->videoram;
int tile=videoram[tile_index];
int color=(tile >> 8) & 0x0f;
@@ -84,7 +84,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( dynduke )
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
+ dynduke_state *state = machine.driver_data<dynduke_state>();
state->bg_layer = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols, 16,16,32,32);
state->fg_layer = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,16,16,32,32);
state->tx_layer = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
@@ -95,7 +95,7 @@ VIDEO_START( dynduke )
WRITE16_HANDLER( dynduke_gfxbank_w )
{
- dynduke_state *state = space->machine->driver_data<dynduke_state>();
+ dynduke_state *state = space->machine().driver_data<dynduke_state>();
if (ACCESSING_BITS_0_7)
{
@@ -115,7 +115,7 @@ WRITE16_HANDLER( dynduke_gfxbank_w )
WRITE16_HANDLER( dynduke_control_w )
{
- dynduke_state *state = space->machine->driver_data<dynduke_state>();
+ dynduke_state *state = space->machine().driver_data<dynduke_state>();
if (ACCESSING_BITS_0_7)
{
@@ -133,14 +133,14 @@ WRITE16_HANDLER( dynduke_control_w )
if (data&0x4) state->txt_enable = 0; else state->txt_enable = 1;
if (data&0x8) state->sprite_enable=0; else state->sprite_enable=1;
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ dynduke_state *state = machine.driver_data<dynduke_state>();
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
int offs,fx,fy,x,y,color,sprite;
if (!state->sprite_enable) return;
@@ -169,15 +169,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (fy) fy=0; else fy=1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite,
color,fx,fy,x,y,15);
}
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- dynduke_state *state = machine->driver_data<dynduke_state>();
+ dynduke_state *state = machine.driver_data<dynduke_state>();
/* The transparency / palette handling on the background layer is very strange */
bitmap_t *bm = tilemap_get_pixmap(state->bg_layer);
int scrolly, scrollx;
@@ -217,7 +217,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
if ((srcdat & 0x20) == pri)
{
if (srcdat & 0x10) srcdat += 0x400;
- //if (srcdat & 0x10) srcdat += machine->rand()&0x1f;
+ //if (srcdat & 0x10) srcdat += machine.rand()&0x1f;
srcdat = (srcdat & 0x000f) | ((srcdat & 0xffc0) >> 2);
dst[x] = srcdat;
@@ -230,7 +230,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( dynduke )
{
- dynduke_state *state = screen->machine->driver_data<dynduke_state>();
+ dynduke_state *state = screen->machine().driver_data<dynduke_state>();
/* Setup the tilemaps */
tilemap_set_scrolly( state->fg_layer,0, ((state->scroll_ram[0x11]&0x30)<<4)+((state->scroll_ram[0x12]&0x7f)<<1)+((state->scroll_ram[0x12]&0x80)>>7) );
tilemap_set_scrollx( state->fg_layer,0, ((state->scroll_ram[0x19]&0x30)<<4)+((state->scroll_ram[0x1a]&0x7f)<<1)+((state->scroll_ram[0x1a]&0x80)>>7) );
@@ -238,14 +238,14 @@ SCREEN_UPDATE( dynduke )
tilemap_set_enable( state->tx_layer,state->txt_enable);
- draw_background(screen->machine, bitmap, cliprect,0x00);
- draw_sprites(screen->machine,bitmap,cliprect,0); // Untested: does anything use it? Could be behind background
- draw_sprites(screen->machine,bitmap,cliprect,1);
- draw_background(screen->machine, bitmap, cliprect,0x20);
+ draw_background(screen->machine(), bitmap, cliprect,0x00);
+ draw_sprites(screen->machine(),bitmap,cliprect,0); // Untested: does anything use it? Could be behind background
+ draw_sprites(screen->machine(),bitmap,cliprect,1);
+ draw_background(screen->machine(), bitmap, cliprect,0x20);
- draw_sprites(screen->machine,bitmap,cliprect,2);
+ draw_sprites(screen->machine(),bitmap,cliprect,2);
tilemap_draw(bitmap,cliprect,state->fg_layer,0,0);
- draw_sprites(screen->machine,bitmap,cliprect,3);
+ draw_sprites(screen->machine(),bitmap,cliprect,3);
tilemap_draw(bitmap,cliprect,state->tx_layer,0,0);
return 0;
@@ -253,7 +253,7 @@ SCREEN_UPDATE( dynduke )
SCREEN_EOF( dynduke )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff); // Could be a memory location instead
}
diff --git a/src/mame/video/eolith.c b/src/mame/video/eolith.c
index 88a0dc921ea..afa8ad8c804 100644
--- a/src/mame/video/eolith.c
+++ b/src/mame/video/eolith.c
@@ -4,7 +4,7 @@
WRITE32_HANDLER( eolith_vram_w )
{
- eolith_state *state = space->machine->driver_data<eolith_state>();
+ eolith_state *state = space->machine().driver_data<eolith_state>();
UINT32 *dest = &state->vram[offset+(0x40000/4)*state->buffer];
if (mem_mask == 0xffffffff)
@@ -23,19 +23,19 @@ WRITE32_HANDLER( eolith_vram_w )
READ32_HANDLER( eolith_vram_r )
{
- eolith_state *state = space->machine->driver_data<eolith_state>();
+ eolith_state *state = space->machine().driver_data<eolith_state>();
return state->vram[offset+(0x40000/4)*state->buffer];
}
VIDEO_START( eolith )
{
- eolith_state *state = machine->driver_data<eolith_state>();
+ eolith_state *state = machine.driver_data<eolith_state>();
state->vram = auto_alloc_array(machine, UINT32, 0x40000*2/4);
}
SCREEN_UPDATE( eolith )
{
- eolith_state *state = screen->machine->driver_data<eolith_state>();
+ eolith_state *state = screen->machine().driver_data<eolith_state>();
int y;
for (y = 0; y < 240; y++)
diff --git a/src/mame/video/epos.c b/src/mame/video/epos.c
index 99cb7ba0139..26ec6717868 100644
--- a/src/mame/video/epos.c
+++ b/src/mame/video/epos.c
@@ -22,11 +22,11 @@
***************************************************************************/
-static void get_pens( running_machine *machine, pen_t *pens )
+static void get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
- const UINT8 *prom = machine->region("proms")->base();
- int len = machine->region("proms")->bytes();
+ const UINT8 *prom = machine.region("proms")->base();
+ int len = machine.region("proms")->bytes();
for (i = 0; i < len; i++)
{
@@ -55,7 +55,7 @@ static void get_pens( running_machine *machine, pen_t *pens )
WRITE8_HANDLER( epos_port_1_w )
{
- epos_state *state = space->machine->driver_data<epos_state>();
+ epos_state *state = space->machine().driver_data<epos_state>();
/* D0 - start light #1
D1 - start light #2
D2 - coin counter
@@ -63,10 +63,10 @@ WRITE8_HANDLER( epos_port_1_w )
D4-D7 - unused
*/
- set_led_status(space->machine, 0, (data >> 0) & 0x01);
- set_led_status(space->machine, 1, (data >> 1) & 0x01);
+ set_led_status(space->machine(), 0, (data >> 0) & 0x01);
+ set_led_status(space->machine(), 1, (data >> 1) & 0x01);
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
state->palette = (data >> 3) & 0x01;
}
@@ -74,11 +74,11 @@ WRITE8_HANDLER( epos_port_1_w )
SCREEN_UPDATE( epos )
{
- epos_state *state = screen->machine->driver_data<epos_state>();
+ epos_state *state = screen->machine().driver_data<epos_state>();
pen_t pens[0x20];
offs_t offs;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (offs = 0; offs < state->videoram_size; offs++)
{
diff --git a/src/mame/video/eprom.c b/src/mame/video/eprom.c
index fd365ce6871..b77feaab8eb 100644
--- a/src/mame/video/eprom.c
+++ b/src/mame/video/eprom.c
@@ -14,15 +14,15 @@
*
*************************************/
-static void update_palette(running_machine *machine)
+static void update_palette(running_machine &machine)
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
int color;
for (color = 0; color < 0x800; ++color)
{
int i, r, g, b;
- UINT16 const data = machine->generic.paletteram.u16[color];
+ UINT16 const data = machine.generic.paletteram.u16[color];
/* FIXME this is only a very crude approximation of the palette output.
* The circuit involves a dozen transistors and probably has an output
@@ -52,7 +52,7 @@ static void update_palette(running_machine *machine)
static TILE_GET_INFO( get_alpha_tile_info )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
@@ -63,7 +63,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -74,7 +74,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
static TILE_GET_INFO( guts_get_playfield_tile_info )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -128,7 +128,7 @@ VIDEO_START( eprom )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -184,7 +184,7 @@ VIDEO_START( guts )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, guts_get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -211,7 +211,7 @@ VIDEO_START( guts )
void eprom_scanline_update(screen_device &screen, int scanline)
{
- eprom_state *state = screen.machine->driver_data<eprom_state>();
+ eprom_state *state = screen.machine().driver_data<eprom_state>();
/* update the playfield */
if (scanline == 0)
@@ -235,18 +235,18 @@ void eprom_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( eprom )
{
- eprom_state *state = screen->machine->driver_data<eprom_state>();
+ eprom_state *state = screen->machine().driver_data<eprom_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
if (state->video_disable)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
- update_palette(screen->machine);
+ update_palette(screen->machine());
/* draw the playfield */
tilemap_draw(bitmap, cliprect, state->playfield_tilemap, 0, 0);
@@ -390,18 +390,18 @@ SCREEN_UPDATE( eprom )
SCREEN_UPDATE( guts )
{
- eprom_state *state = screen->machine->driver_data<eprom_state>();
+ eprom_state *state = screen->machine().driver_data<eprom_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
if (state->video_disable)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
- update_palette(screen->machine);
+ update_palette(screen->machine());
/* draw the playfield */
tilemap_draw(bitmap, cliprect, state->playfield_tilemap, 0, 0);
diff --git a/src/mame/video/equites.c b/src/mame/video/equites.c
index c8420f90b5a..96a94b22e10 100644
--- a/src/mame/video/equites.c
+++ b/src/mame/video/equites.c
@@ -12,44 +12,44 @@ PALETTE_INIT( equites )
{
int i;
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
for (i = 0; i < 256; i++)
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
// point to the CLUT
color_prom += 0x380;
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i + 0x100, color_prom[i]);
+ colortable_entry_set_value(machine.colortable, i + 0x100, color_prom[i]);
}
PALETTE_INIT( splndrbt )
{
int i;
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
for (i = 0; i < 0x100; i++)
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal4bit(color_prom[i]), pal4bit(color_prom[i + 0x100]), pal4bit(color_prom[i + 0x200])));
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
// point to the bg CLUT
color_prom += 0x300;
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i + 0x100, color_prom[i] + 0x10);
+ colortable_entry_set_value(machine.colortable, i + 0x100, color_prom[i] + 0x10);
// point to the sprite CLUT
color_prom += 0x100;
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i + 0x180, color_prom[i]);
+ colortable_entry_set_value(machine.colortable, i + 0x180, color_prom[i]);
}
@@ -62,7 +62,7 @@ PALETTE_INIT( splndrbt )
static TILE_GET_INFO( equites_fg_info )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
int tile = state->fg_videoram[2 * tile_index];
int color = state->fg_videoram[2 * tile_index + 1] & 0x1f;
@@ -73,7 +73,7 @@ static TILE_GET_INFO( equites_fg_info )
static TILE_GET_INFO( splndrbt_fg_info )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
int tile = state->fg_videoram[2 * tile_index] + (state->fg_char_bank << 8);
int color = state->fg_videoram[2 * tile_index + 1] & 0x3f;
@@ -84,7 +84,7 @@ static TILE_GET_INFO( splndrbt_fg_info )
static TILE_GET_INFO( equites_bg_info )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
int data = state->bg_videoram[tile_index];
int tile = data & 0x1ff;
int color = (data & 0xf000) >> 12;
@@ -95,7 +95,7 @@ static TILE_GET_INFO( equites_bg_info )
static TILE_GET_INFO( splndrbt_bg_info )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
int data = state->bg_videoram[tile_index];
int tile = data & 0x1ff;
int color = (data & 0xf800) >> 11;
@@ -115,7 +115,7 @@ static TILE_GET_INFO( splndrbt_bg_info )
VIDEO_START( equites )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
state->fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
state->save_pointer(NAME(state->fg_videoram), 0x800);
@@ -129,8 +129,8 @@ VIDEO_START( equites )
VIDEO_START( splndrbt )
{
- equites_state *state = machine->driver_data<equites_state>();
- assert(machine->primary_screen->format() == BITMAP_FORMAT_INDEXED16);
+ equites_state *state = machine.driver_data<equites_state>();
+ assert(machine.primary_screen->format() == BITMAP_FORMAT_INDEXED16);
state->fg_videoram = auto_alloc_array(machine, UINT8, 0x800);
state->save_pointer(NAME(state->fg_videoram), 0x800);
@@ -140,7 +140,7 @@ VIDEO_START( splndrbt )
tilemap_set_scrolldx(state->fg_tilemap, 8, -8);
state->bg_tilemap = tilemap_create(machine, splndrbt_bg_info, tilemap_scan_rows, 16, 16, 32, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[1], 0x10);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[1], 0x10);
}
@@ -153,13 +153,13 @@ VIDEO_START( splndrbt )
READ16_HANDLER(equites_fg_videoram_r)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
return 0xff00 | state->fg_videoram[offset];
}
WRITE16_HANDLER(equites_fg_videoram_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_0_7)
{
state->fg_videoram[offset] = data & 0xff;
@@ -170,7 +170,7 @@ WRITE16_HANDLER(equites_fg_videoram_w)
WRITE16_HANDLER(equites_bg_videoram_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
COMBINE_DATA(state->bg_videoram + offset);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -178,14 +178,14 @@ WRITE16_HANDLER(equites_bg_videoram_w)
WRITE16_HANDLER(equites_bgcolor_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_8_15)
state->bgcolor = data >> 8;
}
WRITE16_HANDLER(equites_scrollreg_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_0_7)
tilemap_set_scrolly(state->bg_tilemap, 0, data & 0xff);
@@ -195,7 +195,7 @@ WRITE16_HANDLER(equites_scrollreg_w)
WRITE16_HANDLER(splndrbt_selchar0_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (state->fg_char_bank != 0)
{
state->fg_char_bank = 0;
@@ -205,7 +205,7 @@ WRITE16_HANDLER(splndrbt_selchar0_w)
WRITE16_HANDLER(splndrbt_selchar1_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (state->fg_char_bank != 1)
{
state->fg_char_bank = 1;
@@ -215,19 +215,19 @@ WRITE16_HANDLER(splndrbt_selchar1_w)
WRITE16_HANDLER(equites_flip0_w)
{
- flip_screen_set(space->machine, 0);
+ flip_screen_set(space->machine(), 0);
}
WRITE16_HANDLER(equites_flip1_w)
{
- flip_screen_set(space->machine, 1);
+ flip_screen_set(space->machine(), 1);
}
WRITE16_HANDLER(splndrbt_flip0_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_0_7)
- flip_screen_set(space->machine, 0);
+ flip_screen_set(space->machine(), 0);
if (ACCESSING_BITS_8_15)
state->bgcolor = data >> 8;
@@ -236,18 +236,18 @@ WRITE16_HANDLER(splndrbt_flip0_w)
WRITE16_HANDLER(splndrbt_flip1_w)
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(space->machine, 1);
+ flip_screen_set(space->machine(), 1);
}
WRITE16_HANDLER(splndrbt_bg_scrollx_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
COMBINE_DATA(&state->splndrbt_bg_scrollx);
}
WRITE16_HANDLER(splndrbt_bg_scrolly_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
COMBINE_DATA(&state->splndrbt_bg_scrolly);
}
@@ -258,9 +258,9 @@ WRITE16_HANDLER(splndrbt_bg_scrolly_w)
*
*************************************/
-static void equites_draw_sprites_block( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end )
+static void equites_draw_sprites_block( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
int offs;
for (offs = end - 2; offs >= start; offs -= 2)
@@ -274,7 +274,7 @@ static void equites_draw_sprites_block( running_machine *machine, bitmap_t *bitm
int color = (~attr & 0xf000) >> 12;
int sx = (state->spriteram[offs] & 0xff00) >> 8;
int sy = (state->spriteram[offs] & 0x00ff);
- int transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0);
+ int transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0);
if (flip_screen_get(machine))
{
@@ -290,7 +290,7 @@ static void equites_draw_sprites_block( running_machine *machine, bitmap_t *bitm
// sprites are 16x14 centered in a 16x16 square, so skip the first line
sy += 1;
- drawgfx_transmask(bitmap,cliprect, machine->gfx[2],
+ drawgfx_transmask(bitmap,cliprect, machine.gfx[2],
tile,
color,
fx, fy,
@@ -299,7 +299,7 @@ static void equites_draw_sprites_block( running_machine *machine, bitmap_t *bitm
}
}
-static void equites_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void equites_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
// note that we draw the sprites in three blocks; in each blocks, sprites at
// a lower address have priority. This gives good priorities in gekisou.
@@ -332,12 +332,12 @@ Also, note that sprites are 30x30, not 32x32.
03020303 03030303 03030303 03030303
*/
-static void splndrbt_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void splndrbt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- equites_state *state = machine->driver_data<equites_state>();
- const UINT8 * const xrom = machine->region("user2")->base();
+ equites_state *state = machine.driver_data<equites_state>();
+ const UINT8 * const xrom = machine.region("user2")->base();
const UINT8 * const yrom = xrom + 0x100;
- const gfx_element* const gfx = machine->gfx[2];
+ const gfx_element* const gfx = machine.gfx[2];
int offs;
// note that sprites are actually 30x30, contained in 32x32 squares. The outer edge is not used.
@@ -354,12 +354,12 @@ static void splndrbt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
int sx = data2 & 0x00ff;
int sy = state->spriteram_2[offs + 0] & 0x00ff;
int scalex = state->spriteram_2[offs + 1] & 0x000f;
- int transmask = colortable_get_transpen_mask(machine->colortable, gfx, color, 0);
+ int transmask = colortable_get_transpen_mask(machine.colortable, gfx, color, 0);
// const UINT8 * const xromline = xrom + (scalex << 4);
const UINT8 * const yromline = yrom + (scaley << 4) + (15 - scaley);
const UINT8* const srcgfx = gfx_element_get_data(gfx, tile);
- const pen_t *paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
+ const pen_t *paldata = &machine.pens[gfx->color_base + gfx->color_granularity * color];
int x,yy;
sy += 16;
@@ -408,12 +408,12 @@ static void splndrbt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
-static void splndrbt_copy_bg( running_machine *machine, bitmap_t *dst_bitmap, const rectangle *cliprect )
+static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, const rectangle *cliprect )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
bitmap_t * const src_bitmap = tilemap_get_pixmap(state->bg_tilemap);
bitmap_t * const flags_bitmap = tilemap_get_flagsmap(state->bg_tilemap);
- const UINT8 * const xrom = machine->region("user1")->base();
+ const UINT8 * const xrom = machine.region("user1")->base();
const UINT8 * const yrom = xrom + 0x2000;
int scroll_x = state->splndrbt_bg_scrollx;
int scroll_y = state->splndrbt_bg_scrolly;
@@ -465,12 +465,12 @@ static void splndrbt_copy_bg( running_machine *machine, bitmap_t *dst_bitmap, co
SCREEN_UPDATE( equites )
{
- equites_state *state = screen->machine->driver_data<equites_state>();
+ equites_state *state = screen->machine().driver_data<equites_state>();
bitmap_fill(bitmap, cliprect, state->bgcolor);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- equites_draw_sprites(screen->machine, bitmap, cliprect);
+ equites_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -479,15 +479,15 @@ SCREEN_UPDATE( equites )
SCREEN_UPDATE( splndrbt )
{
- equites_state *state = screen->machine->driver_data<equites_state>();
+ equites_state *state = screen->machine().driver_data<equites_state>();
bitmap_fill(bitmap, cliprect, state->bgcolor);
- splndrbt_copy_bg(screen->machine, bitmap, cliprect);
+ splndrbt_copy_bg(screen->machine(), bitmap, cliprect);
if (state->fg_char_bank)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- splndrbt_draw_sprites(screen->machine, bitmap, cliprect);
+ splndrbt_draw_sprites(screen->machine(), bitmap, cliprect);
if (!state->fg_char_bank)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/esd16.c b/src/mame/video/esd16.c
index bb0acaa70ff..7a111d5ab57 100644
--- a/src/mame/video/esd16.c
+++ b/src/mame/video/esd16.c
@@ -52,7 +52,7 @@ Note: if MAME_DEBUG is defined, pressing Z with:
static TILE_GET_INFO( get_tile_info_0 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
UINT16 code = state->vram_0[tile_index];
SET_TILE_INFO(
1,
@@ -63,7 +63,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_0_16x16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
UINT16 code = state->vram_0[tile_index];
SET_TILE_INFO(
2,
@@ -75,7 +75,7 @@ static TILE_GET_INFO( get_tile_info_0_16x16 )
static TILE_GET_INFO( get_tile_info_1 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
UINT16 code = state->vram_1[tile_index];
SET_TILE_INFO(
1,
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_tile_info_1 )
static TILE_GET_INFO( get_tile_info_1_16x16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
UINT16 code = state->vram_1[tile_index];
SET_TILE_INFO(
2,
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_tile_info_1_16x16 )
WRITE16_HANDLER( esd16_vram_0_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0, offset);
tilemap_mark_tile_dirty(state->tilemap_0_16x16, offset);
@@ -105,7 +105,7 @@ WRITE16_HANDLER( esd16_vram_0_w )
WRITE16_HANDLER( esd16_vram_1_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset);
tilemap_mark_tile_dirty(state->tilemap_1_16x16, offset);
@@ -113,11 +113,11 @@ WRITE16_HANDLER( esd16_vram_1_w )
WRITE16_HANDLER( esd16_tilemap0_color_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
state->tilemap0_color = data & 3;
tilemap_mark_all_tiles_dirty(state->tilemap_0);
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
@@ -132,7 +132,7 @@ WRITE16_HANDLER( esd16_tilemap0_color_w )
VIDEO_START( esd16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
state->tilemap_0 = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows, 8, 8, 0x80, 0x40);
state->tilemap_1 = tilemap_create( machine, get_tile_info_1, tilemap_scan_rows, 8, 8, 0x80, 0x40);
@@ -183,13 +183,13 @@ VIDEO_START( esd16 )
***************************************************************************/
-static void esd16_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void esd16_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
int offs;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
for (offs = state->spriteram_size / 2 - 8 / 2; offs >= 0 ; offs -= 8 / 2)
{
@@ -210,7 +210,7 @@ static void esd16_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
int pri_mask;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
if (sx & 0x8000)
@@ -236,24 +236,24 @@ static void esd16_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
for (y = starty ; y != endy ; y += incy)
{
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[0],
code++,
color,
flipx, flipy,
sx, y,
- machine->priority_bitmap, pri_mask, 0);
+ machine.priority_bitmap, pri_mask, 0);
}
}
}
/* note, check if i can re-merge this with the other or if its really different */
-static void hedpanic_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
int offs;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
for (offs = state->spriteram_size / 2 - 8 / 2; offs >= 0 ; offs -= 8 / 2)
{
@@ -274,7 +274,7 @@ static void hedpanic_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
int pri_mask;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
if (sx & 0x8000)
@@ -303,12 +303,12 @@ static void hedpanic_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
for (y = starty ; y != endy ; y += incy)
{
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[0],
code++,
color,
flipx, flipy,
sx, y,
- machine->priority_bitmap, pri_mask, 0);
+ machine.priority_bitmap, pri_mask, 0);
}
}
}
@@ -325,10 +325,10 @@ static void hedpanic_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( esd16 )
{
- esd16_state *state = screen->machine->driver_data<esd16_state>();
+ esd16_state *state = screen->machine().driver_data<esd16_state>();
int layers_ctrl = -1;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_set_scrollx(state->tilemap_0, 0, state->scroll_0[0]);
tilemap_set_scrolly(state->tilemap_0, 0, state->scroll_0[1]);
@@ -337,12 +337,12 @@ SCREEN_UPDATE( esd16 )
tilemap_set_scrolly(state->tilemap_1, 0, state->scroll_1[1]);
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 4;
if (msk != 0) layers_ctrl &= msk;
}
#endif
@@ -352,25 +352,25 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 1);
- if (layers_ctrl & 4) esd16_draw_sprites(screen->machine, bitmap, cliprect);
+ if (layers_ctrl & 4) esd16_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( hedpanic )
{
- esd16_state *state = screen->machine->driver_data<esd16_state>();
+ esd16_state *state = screen->machine().driver_data<esd16_state>();
int layers_ctrl = -1;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 4;
if (msk != 0) layers_ctrl &= msk;
}
#endif
@@ -413,7 +413,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
}
- if (layers_ctrl & 4) hedpanic_draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 4) hedpanic_draw_sprites(screen->machine(),bitmap,cliprect);
// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]);
return 0;
@@ -422,18 +422,18 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
// uses older style sprites
SCREEN_UPDATE( hedpanio )
{
- esd16_state *state = screen->machine->driver_data<esd16_state>();
+ esd16_state *state = screen->machine().driver_data<esd16_state>();
int layers_ctrl = -1;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
#ifdef MAME_DEBUG
-if ( input_code_pressed(screen->machine, KEYCODE_Z) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 4;
if (msk != 0) layers_ctrl &= msk;
}
#endif
@@ -476,7 +476,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
}
- if (layers_ctrl & 4) esd16_draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 4) esd16_draw_sprites(screen->machine(),bitmap,cliprect);
// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]);
return 0;
diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c
index c9a13ed6a0a..2070e2df6aa 100644
--- a/src/mame/video/espial.c
+++ b/src/mame/video/espial.c
@@ -33,7 +33,7 @@ PALETTE_INIT( espial )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -44,13 +44,13 @@ PALETTE_INIT( espial )
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* blue component */
bit0 = 0;
- bit1 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette_set_color(machine, i, MAKE_RGB(r,g,b));
@@ -67,7 +67,7 @@ PALETTE_INIT( espial )
static TILE_GET_INFO( get_tile_info )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
UINT8 code = state->videoram[tile_index];
UINT8 col = state->colorram[tile_index];
UINT8 attr = state->attributeram[tile_index];
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( espial )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
@@ -97,7 +97,7 @@ VIDEO_START( espial )
VIDEO_START( netwars )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
/* Net Wars has a tile map that's twice as big as Espial's */
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 64);
@@ -117,7 +117,7 @@ VIDEO_START( netwars )
WRITE8_HANDLER( espial_videoram_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -126,7 +126,7 @@ WRITE8_HANDLER( espial_videoram_w )
WRITE8_HANDLER( espial_colorram_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -135,7 +135,7 @@ WRITE8_HANDLER( espial_colorram_w )
WRITE8_HANDLER( espial_attributeram_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->attributeram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -144,7 +144,7 @@ WRITE8_HANDLER( espial_attributeram_w )
WRITE8_HANDLER( espial_scrollram_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->scrollram[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, offset, data);
@@ -153,7 +153,7 @@ WRITE8_HANDLER( espial_scrollram_w )
WRITE8_HANDLER( espial_flipscreen_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->flipscreen = data;
tilemap_set_flip(state->bg_tilemap, state->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
@@ -166,9 +166,9 @@ WRITE8_HANDLER( espial_flipscreen_w )
*
*************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
int offs;
/* Note that it is important to draw them exactly in this */
@@ -199,11 +199,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
if (state->flipscreen)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,color,
flipx,flipy,
sx,sy + 16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + 1,
color,
flipx,flipy,
@@ -211,11 +211,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,color,
flipx,flipy,
sx,sy - 16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + 1,color,
flipx,flipy,
sx,sy,0);
@@ -223,7 +223,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,color,
flipx,flipy,
sx,sy,0);
@@ -234,9 +234,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( espial )
{
- espial_state *state = screen->machine->driver_data<espial_state>();
+ espial_state *state = screen->machine().driver_data<espial_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/esripsys.c b/src/mame/video/esripsys.c
index 4c173fd8bef..01aed3d38de 100644
--- a/src/mame/video/esripsys.c
+++ b/src/mame/video/esripsys.c
@@ -11,15 +11,15 @@
INTERRUPT_GEN( esripsys_vblank_irq )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
- cputag_set_input_line(device->machine, "game_cpu", M6809_IRQ_LINE, ASSERT_LINE);
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
+ cputag_set_input_line(device->machine(), "game_cpu", M6809_IRQ_LINE, ASSERT_LINE);
state->frame_vbl = 0;
}
static TIMER_CALLBACK( hblank_start_callback )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- int v = machine->primary_screen->vpos();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ int v = machine.primary_screen->vpos();
if (state->video_firq)
{
@@ -39,27 +39,27 @@ static TIMER_CALLBACK( hblank_start_callback )
v = 0;
/* Set end of HBLANK timer */
- state->hblank_end_timer->adjust(machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v);
+ state->hblank_end_timer->adjust(machine.primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v);
state->hblank = 0;
}
static TIMER_CALLBACK( hblank_end_callback )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- int v = machine->primary_screen->vpos();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ int v = machine.primary_screen->vpos();
if (v > 0)
- machine->primary_screen->update_partial(v - 1);
+ machine.primary_screen->update_partial(v - 1);
state->_12sel ^= 1;
- state->hblank_start_timer->adjust(machine->primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START));
+ state->hblank_start_timer->adjust(machine.primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START));
state->hblank = 1;
}
VIDEO_START( esripsys )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
struct line_buffer_t *line_buffer = state->line_buffer;
int i;
@@ -73,9 +73,9 @@ VIDEO_START( esripsys )
line_buffer[1].priority_buf = auto_alloc_array(machine, UINT8, 512);
/* Create and initialise the HBLANK timers */
- state->hblank_start_timer = machine->scheduler().timer_alloc(FUNC(hblank_start_callback));
- state->hblank_end_timer = machine->scheduler().timer_alloc(FUNC(hblank_end_callback));
- state->hblank_start_timer->adjust(machine->primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
+ state->hblank_start_timer = machine.scheduler().timer_alloc(FUNC(hblank_start_callback));
+ state->hblank_end_timer = machine.scheduler().timer_alloc(FUNC(hblank_end_callback));
+ state->hblank_start_timer->adjust(machine.primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
/* Create the sprite scaling table */
state->scale_table = auto_alloc_array(machine, UINT8, 64 * 64);
@@ -153,7 +153,7 @@ VIDEO_START( esripsys )
SCREEN_UPDATE( esripsys )
{
- esripsys_state *state = screen->machine->driver_data<esripsys_state>();
+ esripsys_state *state = screen->machine().driver_data<esripsys_state>();
struct line_buffer_t *line_buffer = state->line_buffer;
int x, y;
@@ -187,14 +187,14 @@ SCREEN_UPDATE( esripsys )
WRITE8_HANDLER( esripsys_bg_intensity_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->bg_intensity = data & 0xf;
}
/* Draw graphics to a line buffer */
-int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank)
+int esripsys_draw(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank)
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
struct line_buffer_t *line_buffer = state->line_buffer;
UINT8 *colour_buf = line_buffer[state->_12sel ? 1 : 0].colour_buf;
UINT8 *intensity_buf = line_buffer[state->_12sel ? 1 : 0].intensity_buf;
@@ -226,13 +226,13 @@ int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int
if (x_flip)
{
- rom_l = machine->region("8bpp_r")->base();
- rom_r = machine->region("8bpp_l")->base();
+ rom_l = machine.region("8bpp_r")->base();
+ rom_r = machine.region("8bpp_l")->base();
}
else
{
- rom_l = machine->region("8bpp_l")->base();
- rom_r = machine->region("8bpp_r")->base();
+ rom_l = machine.region("8bpp_l")->base();
+ rom_r = machine.region("8bpp_r")->base();
}
for (cnt = 0; cnt <= fig; cnt++)
@@ -295,7 +295,7 @@ int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int
/* 4bpp case */
else
{
- const UINT8* const rom = machine->region("4bpp")->base();
+ const UINT8* const rom = machine.region("4bpp")->base();
int ptr = 0;
int cnt;
UINT32 lpos = l;
diff --git a/src/mame/video/exedexes.c b/src/mame/video/exedexes.c
index 2c58593afaa..3fb6338952b 100644
--- a/src/mame/video/exedexes.c
+++ b/src/mame/video/exedexes.c
@@ -10,8 +10,8 @@
#include "includes/exedexes.h"
-#define TileMap(offs) (machine->region("gfx5")->base()[offs])
-#define BackTileMap(offs) (machine->region("gfx5")->base()[offs+0x4000])
+#define TileMap(offs) (machine.region("gfx5")->base()[offs])
+#define BackTileMap(offs) (machine.region("gfx5")->base()[offs+0x4000])
/***************************************************************************
@@ -36,7 +36,7 @@ PALETTE_INIT( exedexes )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -45,7 +45,7 @@ PALETTE_INIT( exedexes )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -55,34 +55,34 @@ PALETTE_INIT( exedexes )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] | 0xc0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* 32x32 tiles use colors 0-0x0f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* 16x16 tiles use colors 0x40-0x4f */
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] | 0x40;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 0x80-0xbf in four banks */
for (i = 0x300; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i] | (color_prom[i + 0x100] << 4) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( exedexes_videoram_w )
{
- exedexes_state *state = space->machine->driver_data<exedexes_state>();
+ exedexes_state *state = space->machine().driver_data<exedexes_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -90,7 +90,7 @@ WRITE8_HANDLER( exedexes_videoram_w )
WRITE8_HANDLER( exedexes_colorram_w )
{
- exedexes_state *state = space->machine->driver_data<exedexes_state>();
+ exedexes_state *state = space->machine().driver_data<exedexes_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -98,14 +98,14 @@ WRITE8_HANDLER( exedexes_colorram_w )
WRITE8_HANDLER( exedexes_c804_w )
{
- exedexes_state *state = space->machine->driver_data<exedexes_state>();
+ exedexes_state *state = space->machine().driver_data<exedexes_state>();
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
- coin_lockout_w(space->machine, 0, data & 0x04);
- coin_lockout_w(space->machine, 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, data & 0x04);
+ coin_lockout_w(space->machine(), 1, data & 0x08);
/* bit 7 is text enable */
state->chon = data & 0x80;
@@ -115,7 +115,7 @@ WRITE8_HANDLER( exedexes_c804_w )
WRITE8_HANDLER( exedexes_gfxctrl_w )
{
- exedexes_state *state = space->machine->driver_data<exedexes_state>();
+ exedexes_state *state = space->machine().driver_data<exedexes_state>();
/* bit 4 is bg enable */
state->sc2on = data & 0x10;
@@ -132,7 +132,7 @@ WRITE8_HANDLER( exedexes_gfxctrl_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *tilerom = machine->region("gfx5")->base();
+ UINT8 *tilerom = machine.region("gfx5")->base();
int attr = tilerom[tile_index];
int code = attr & 0x3f;
@@ -144,14 +144,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- int code = machine->region("gfx5")->base()[tile_index];
+ int code = machine.region("gfx5")->base()[tile_index];
SET_TILE_INFO(2, code, 0, 0);
}
static TILE_GET_INFO( get_tx_tile_info )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
int code = state->videoram[tile_index] + 2 * (state->colorram[tile_index] & 0x80);
int color = state->colorram[tile_index] & 0x3f;
@@ -174,20 +174,20 @@ static TILEMAP_MAPPER( exedexes_fg_tilemap_scan )
VIDEO_START( exedexes )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, exedexes_bg_tilemap_scan, 32, 32, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, exedexes_fg_tilemap_scan, 16, 16, 128, 128);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- colortable_configure_tilemap_groups(machine->colortable, state->tx_tilemap, machine->gfx[0], 0xcf);
+ colortable_configure_tilemap_groups(machine.colortable, state->tx_tilemap, machine.gfx[0], 0xcf);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ exedexes_state *state = machine.driver_data<exedexes_state>();
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
if (!state->objon)
@@ -195,7 +195,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
priority = priority ? 0x40 : 0x00;
- for (offs = machine->generic.spriteram_size - 32;offs >= 0;offs -= 32)
+ for (offs = machine.generic.spriteram_size - 32;offs >= 0;offs -= 32)
{
if ((buffered_spriteram[offs + 1] & 0x40) == priority)
{
@@ -208,7 +208,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sx = buffered_spriteram[offs + 3] - ((buffered_spriteram[offs + 1] & 0x80) << 1);
sy = buffered_spriteram[offs + 2];
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
flipx,flipy,
@@ -219,7 +219,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( exedexes )
{
- exedexes_state *state = screen->machine->driver_data<exedexes_state>();
+ exedexes_state *state = screen->machine().driver_data<exedexes_state>();
if (state->sc2on)
{
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->bg_scroll[1]) << 8) + state->bg_scroll[0]);
@@ -228,7 +228,7 @@ SCREEN_UPDATE( exedexes )
else
bitmap_fill(bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
if (state->sc1on)
{
@@ -237,7 +237,7 @@ SCREEN_UPDATE( exedexes )
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
if (state->chon)
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -247,7 +247,7 @@ SCREEN_UPDATE( exedexes )
SCREEN_EOF( exedexes )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/exerion.c b/src/mame/video/exerion.c
index 9117bb28f47..b834a28e72c 100644
--- a/src/mame/video/exerion.c
+++ b/src/mame/video/exerion.c
@@ -48,7 +48,7 @@ PALETTE_INIT( exerion )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -73,7 +73,7 @@ PALETTE_INIT( exerion )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -83,7 +83,7 @@ PALETTE_INIT( exerion )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = 0x10 | (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bg chars (this is not the full story... there are four layers mixed */
@@ -91,7 +91,7 @@ PALETTE_INIT( exerion )
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -105,12 +105,12 @@ PALETTE_INIT( exerion )
VIDEO_START( exerion )
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
int i;
UINT8 *gfx;
/* get pointers to the mixing and lookup PROMs */
- state->background_mixer = machine->region("proms")->base() + 0x320;
+ state->background_mixer = machine.region("proms")->base() + 0x320;
/* allocate memory for the decoded background graphics */
state->background_gfx[0] = auto_alloc_array(machine, UINT16, 256 * 256 * 4);
@@ -135,7 +135,7 @@ VIDEO_START( exerion )
* Where AA,BB,CC,DD are the 2bpp data for the pixel,and a,b,c,d are the OR
* of these two bits together.
*/
- gfx = machine->region("gfx3")->base();
+ gfx = machine.region("gfx3")->base();
for (i = 0; i < 4; i++)
{
int y;
@@ -185,7 +185,7 @@ VIDEO_START( exerion )
WRITE8_HANDLER( exerion_videoreg_w )
{
- exerion_state *state = space->machine->driver_data<exerion_state>();
+ exerion_state *state = space->machine().driver_data<exerion_state>();
/* bit 0 = flip screen and joystick input multiplexer */
state->cocktail_flip = data & 1;
@@ -205,10 +205,10 @@ WRITE8_HANDLER( exerion_videoreg_w )
WRITE8_HANDLER( exerion_video_latch_w )
{
- exerion_state *state = space->machine->driver_data<exerion_state>();
- int scanline = space->machine->primary_screen->vpos();
+ exerion_state *state = space->machine().driver_data<exerion_state>();
+ int scanline = space->machine().primary_screen->vpos();
if (scanline > 0)
- space->machine->primary_screen->update_partial(scanline - 1);
+ space->machine().primary_screen->update_partial(scanline - 1);
state->background_latches[offset] = data;
}
@@ -218,13 +218,13 @@ READ8_HANDLER( exerion_video_timing_r )
/* bit 0 is the SNMI signal, which is the negated value of H6, if H7=1 & H8=1 & VBLANK=0, otherwise 1 */
/* bit 1 is VBLANK */
- UINT16 hcounter = space->machine->primary_screen->hpos() + EXERION_HCOUNT_START;
+ UINT16 hcounter = space->machine().primary_screen->hpos() + EXERION_HCOUNT_START;
UINT8 snmi = 1;
- if (((hcounter & 0x180) == 0x180) && !space->machine->primary_screen->vblank())
+ if (((hcounter & 0x180) == 0x180) && !space->machine().primary_screen->vblank())
snmi = !((hcounter >> 6) & 0x01);
- return (space->machine->primary_screen->vblank() << 1) | snmi;
+ return (space->machine().primary_screen->vblank() << 1) | snmi;
}
@@ -234,9 +234,9 @@ READ8_HANDLER( exerion_video_timing_r )
*
*************************************/
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
int x, y;
/* loop over all visible scanlines */
@@ -352,11 +352,11 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
SCREEN_UPDATE( exerion )
{
- exerion_state *state = screen->machine->driver_data<exerion_state>();
+ exerion_state *state = screen->machine().driver_data<exerion_state>();
int sx, sy, offs, i;
/* draw background */
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
/* draw sprites */
for (i = 0; i < state->spriteram_size; i += 4)
@@ -373,7 +373,7 @@ SCREEN_UPDATE( exerion )
int code2 = code;
int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->sprite_palette * 16);
- const gfx_element *gfx = doubled ? screen->machine->gfx[2] : screen->machine->gfx[1];
+ const gfx_element *gfx = doubled ? screen->machine().gfx[2] : screen->machine().gfx[1];
if (state->cocktail_flip)
{
@@ -392,11 +392,11 @@ SCREEN_UPDATE( exerion )
code &= ~0x10, code2 |= 0x10;
drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height,
- colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10));
+ colortable_get_transpen_mask(screen->machine().colortable, gfx, color, 0x10));
}
drawgfx_transmask(bitmap, cliprect, gfx, code, color, xflip, yflip, x, y,
- colortable_get_transpen_mask(screen->machine->colortable, gfx, color, 0x10));
+ colortable_get_transpen_mask(screen->machine().colortable, gfx, color, 0x10));
if (doubled) i += 4;
}
@@ -409,7 +409,7 @@ SCREEN_UPDATE( exerion )
int y = state->cocktail_flip ? (31*8 - 8*sy) : 8*sy;
offs = sx + sy * 64;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->videoram[offs] + 256 * state->char_bank,
((state->videoram[offs] & 0xf0) >> 4) + state->char_palette * 16,
state->cocktail_flip, state->cocktail_flip, x, y, 0);
diff --git a/src/mame/video/exidy.c b/src/mame/video/exidy.c
index bccad6a5cf2..909fe4c92c9 100644
--- a/src/mame/video/exidy.c
+++ b/src/mame/video/exidy.c
@@ -16,9 +16,9 @@
*
*************************************/
-void exidy_video_config(running_machine *machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp)
+void exidy_video_config(running_machine &machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
state->collision_mask = _collision_mask;
state->collision_invert = _collision_invert;
state->is_2bpp = _is_2bpp;
@@ -34,10 +34,10 @@ void exidy_video_config(running_machine *machine, UINT8 _collision_mask, UINT8 _
VIDEO_START( exidy )
{
- exidy_state *state = machine->driver_data<exidy_state>();
- bitmap_format format = machine->primary_screen->format();
+ exidy_state *state = machine.driver_data<exidy_state>();
+ bitmap_format format = machine.primary_screen->format();
- state->background_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->background_bitmap = machine.primary_screen->alloc_compatible_bitmap();
state->motion_object_1_vid = auto_bitmap_alloc(machine, 16, 16, format);
state->motion_object_2_vid = auto_bitmap_alloc(machine, 16, 16, format);
state->motion_object_2_clip = auto_bitmap_alloc(machine, 16, 16, format);
@@ -60,9 +60,9 @@ VIDEO_START( exidy )
*
*************************************/
-INLINE void latch_condition(running_machine *machine, int collision)
+INLINE void latch_condition(running_machine &machine, int collision)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
collision ^= state->collision_invert;
state->int_condition = (input_port_read(machine, "INTSOURCE") & ~0x1c) | (collision & state->collision_mask);
}
@@ -70,9 +70,9 @@ INLINE void latch_condition(running_machine *machine, int collision)
INTERRUPT_GEN( exidy_vblank_interrupt )
{
- exidy_state *state = device->machine->driver_data<exidy_state>();
+ exidy_state *state = device->machine().driver_data<exidy_state>();
/* latch the current condition */
- latch_condition(device->machine, 0);
+ latch_condition(device->machine(), 0);
state->int_condition &= ~0x80;
/* set the IRQ line */
@@ -93,9 +93,9 @@ INTERRUPT_GEN( teetert_vblank_interrupt )
READ8_HANDLER( exidy_interrupt_r )
{
- exidy_state *state = space->machine->driver_data<exidy_state>();
+ exidy_state *state = space->machine().driver_data<exidy_state>();
/* clear any interrupts */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
/* return the latched condition */
return state->int_condition;
@@ -109,16 +109,16 @@ READ8_HANDLER( exidy_interrupt_r )
*
*************************************/
-INLINE void set_1_color(running_machine *machine, int index, int which)
+INLINE void set_1_color(running_machine &machine, int index, int which)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
palette_set_color_rgb(machine, index,
pal1bit(state->color_latch[2] >> which),
pal1bit(state->color_latch[1] >> which),
pal1bit(state->color_latch[0] >> which));
}
-static void set_colors(running_machine *machine)
+static void set_colors(running_machine &machine)
{
/* motion object 1 */
set_1_color(machine, 0, 0);
@@ -143,9 +143,9 @@ static void set_colors(running_machine *machine)
*
*************************************/
-static void draw_background(running_machine *machine)
+static void draw_background(running_machine &machine)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
offs_t offs;
pen_t off_pen = 0;
@@ -226,16 +226,16 @@ INLINE int sprite_1_enabled(exidy_state *state)
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
/* draw sprite 2 first */
int sprite_set_2 = ((*state->sprite_enable & 0x40) != 0);
int sx = 236 - *state->sprite2_xpos - 4;
int sy = 244 - *state->sprite2_ypos - 4;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
((*state->spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1,
0, 0, sx, sy, 0);
@@ -249,7 +249,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (sy < 0) sy = 0;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
(*state->spriteno & 0x0f) + 16 * sprite_set_1, 0,
0, 0, sx, sy, 0);
}
@@ -286,9 +286,9 @@ static TIMER_CALLBACK( collision_irq_callback )
}
-static void check_collision(running_machine *machine)
+static void check_collision(running_machine &machine)
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
UINT8 sprite_set_1 = ((*state->sprite_enable & 0x20) != 0);
UINT8 sprite_set_2 = ((*state->sprite_enable & 0x40) != 0);
static const rectangle clip = { 0, 15, 0, 15 };
@@ -307,7 +307,7 @@ static void check_collision(running_machine *machine)
{
org_1_x = 236 - *state->sprite1_xpos - 4;
org_1_y = 244 - *state->sprite1_ypos - 4;
- drawgfx_transpen(state->motion_object_1_vid, &clip, machine->gfx[0],
+ drawgfx_transpen(state->motion_object_1_vid, &clip, machine.gfx[0],
(*state->spriteno & 0x0f) + 16 * sprite_set_1, 0,
0, 0, 0, 0, 0);
}
@@ -316,7 +316,7 @@ static void check_collision(running_machine *machine)
bitmap_fill(state->motion_object_2_vid, &clip, 0xff);
org_2_x = 236 - *state->sprite2_xpos - 4;
org_2_y = 244 - *state->sprite2_ypos - 4;
- drawgfx_transpen(state->motion_object_2_vid, &clip, machine->gfx[0],
+ drawgfx_transpen(state->motion_object_2_vid, &clip, machine.gfx[0],
((*state->spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
0, 0, 0, 0, 0);
@@ -326,7 +326,7 @@ static void check_collision(running_machine *machine)
{
sx = org_2_x - org_1_x;
sy = org_2_y - org_1_y;
- drawgfx_transpen(state->motion_object_2_clip, &clip, machine->gfx[0],
+ drawgfx_transpen(state->motion_object_2_clip, &clip, machine.gfx[0],
((*state->spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
0, 0, sx, sy, 0);
}
@@ -349,7 +349,7 @@ static void check_collision(running_machine *machine)
/* if we got one, trigger an interrupt */
if ((current_collision_mask & state->collision_mask) && (count++ < 128))
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), FUNC(collision_irq_callback), current_collision_mask);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), FUNC(collision_irq_callback), current_collision_mask);
}
if (*BITMAP_ADDR16(state->motion_object_2_vid, sy, sx) != 0xff)
@@ -357,7 +357,7 @@ static void check_collision(running_machine *machine)
/* check for background collision (M2CHAR) */
if (*BITMAP_ADDR16(state->background_bitmap, org_2_y + sy, org_2_x + sx) != 0)
if ((state->collision_mask & 0x08) && (count++ < 128))
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), FUNC(collision_irq_callback), 0x08);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), FUNC(collision_irq_callback), 0x08);
}
}
}
@@ -372,19 +372,19 @@ static void check_collision(running_machine *machine)
SCREEN_UPDATE( exidy )
{
- exidy_state *state = screen->machine->driver_data<exidy_state>();
+ exidy_state *state = screen->machine().driver_data<exidy_state>();
/* refresh the colors from the palette (static or dynamic) */
- set_colors(screen->machine);
+ set_colors(screen->machine());
/* update the background and draw it */
- draw_background(screen->machine);
+ draw_background(screen->machine());
copybitmap(bitmap, state->background_bitmap, 0, 0, 0, 0, cliprect);
/* draw the sprites */
- draw_sprites(screen->machine, bitmap, NULL);
+ draw_sprites(screen->machine(), bitmap, NULL);
/* check for collision, this will set the appropriate bits in collision_mask */
- check_collision(screen->machine);
+ check_collision(screen->machine());
return 0;
}
diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c
index 604f2bfe026..dc4d9aa28b3 100644
--- a/src/mame/video/exidy440.c
+++ b/src/mame/video/exidy440.c
@@ -27,7 +27,7 @@
/* function prototypes */
-static void exidy440_update_firq(running_machine *machine);
+static void exidy440_update_firq(running_machine &machine);
@@ -39,7 +39,7 @@ static void exidy440_update_firq(running_machine *machine);
static VIDEO_START( exidy440 )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
/* reset the system */
state->firq_enable = 0;
state->firq_select = 0;
@@ -60,7 +60,7 @@ static VIDEO_START( exidy440 )
static VIDEO_START( topsecex )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
VIDEO_START_CALL(exidy440);
*state->topsecex_yscroll = 0;
@@ -76,7 +76,7 @@ static VIDEO_START( topsecex )
READ8_HANDLER( exidy440_videoram_r )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
UINT8 *base = &state->local_videoram[(*state->scanline * 256 + offset) * 2];
/* combine the two pixel values into one byte */
@@ -86,7 +86,7 @@ READ8_HANDLER( exidy440_videoram_r )
WRITE8_HANDLER( exidy440_videoram_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
UINT8 *base = &state->local_videoram[(*state->scanline * 256 + offset) * 2];
/* expand the two pixel values into two bytes */
@@ -104,14 +104,14 @@ WRITE8_HANDLER( exidy440_videoram_w )
READ8_HANDLER( exidy440_paletteram_r )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
return state->local_paletteram[state->palettebank_io * 512 + offset];
}
WRITE8_HANDLER( exidy440_paletteram_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* update palette ram in the I/O bank */
state->local_paletteram[state->palettebank_io * 512 + offset] = data;
@@ -125,7 +125,7 @@ WRITE8_HANDLER( exidy440_paletteram_w )
word = (state->local_paletteram[offset] << 8) + state->local_paletteram[offset + 1];
/* extract the 5-5-5 RGB colors */
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
}
}
@@ -139,10 +139,10 @@ WRITE8_HANDLER( exidy440_paletteram_w )
READ8_HANDLER( exidy440_horizontal_pos_r )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* clear the FIRQ on a read here */
state->firq_beam = 0;
- exidy440_update_firq(space->machine);
+ exidy440_update_firq(space->machine());
/* according to the schems, this value is only latched on an FIRQ
* caused by collision or beam */
@@ -158,7 +158,7 @@ READ8_HANDLER( exidy440_vertical_pos_r )
* caused by collision or beam, ORed together with CHRCLK,
* which probably goes off once per scanline; for now, we just
* always return the current scanline */
- result = space->machine->primary_screen->vpos();
+ result = space->machine().primary_screen->vpos();
return (result < 255) ? result : 255;
}
@@ -172,8 +172,8 @@ READ8_HANDLER( exidy440_vertical_pos_r )
WRITE8_HANDLER( exidy440_spriteram_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->spriteram[offset] = data;
}
@@ -187,18 +187,18 @@ WRITE8_HANDLER( exidy440_spriteram_w )
WRITE8_HANDLER( exidy440_control_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
int oldvis = state->palettebank_vis;
/* extract the various bits */
- exidy440_bank_select(space->machine, data >> 4);
+ exidy440_bank_select(space->machine(), data >> 4);
state->firq_enable = (data >> 3) & 1;
state->firq_select = (data >> 2) & 1;
state->palettebank_io = (data >> 1) & 1;
state->palettebank_vis = data & 1;
/* update the FIRQ in case we enabled something */
- exidy440_update_firq(space->machine);
+ exidy440_update_firq(space->machine());
/* if we're swapping palettes, change all the colors */
if (oldvis != state->palettebank_vis)
@@ -211,7 +211,7 @@ WRITE8_HANDLER( exidy440_control_w )
{
/* extract a word and the 5-5-5 RGB components */
int word = (state->local_paletteram[offset] << 8) + state->local_paletteram[offset + 1];
- palette_set_color_rgb(space->machine, i, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
+ palette_set_color_rgb(space->machine(), i, pal5bit(word >> 10), pal5bit(word >> 5), pal5bit(word >> 0));
}
}
}
@@ -219,10 +219,10 @@ WRITE8_HANDLER( exidy440_control_w )
WRITE8_HANDLER( exidy440_interrupt_clear_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* clear the VBLANK FIRQ on a write here */
state->firq_vblank = 0;
- exidy440_update_firq(space->machine);
+ exidy440_update_firq(space->machine());
}
@@ -233,9 +233,9 @@ WRITE8_HANDLER( exidy440_interrupt_clear_w )
*
*************************************/
-static void exidy440_update_firq(running_machine *machine)
+static void exidy440_update_firq(running_machine &machine)
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
if (state->firq_vblank || (state->firq_enable && state->firq_beam))
cputag_set_input_line(machine, "maincpu", 1, ASSERT_LINE);
else
@@ -245,10 +245,10 @@ static void exidy440_update_firq(running_machine *machine)
INTERRUPT_GEN( exidy440_vblank_interrupt )
{
- exidy440_state *state = device->machine->driver_data<exidy440_state>();
+ exidy440_state *state = device->machine().driver_data<exidy440_state>();
/* set the FIRQ line on a VBLANK */
state->firq_vblank = 1;
- exidy440_update_firq(device->machine);
+ exidy440_update_firq(device->machine());
}
@@ -261,7 +261,7 @@ INTERRUPT_GEN( exidy440_vblank_interrupt )
static TIMER_CALLBACK( beam_firq_callback )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
/* generate the interrupt, if we're selected */
if (state->firq_select && state->firq_enable)
{
@@ -279,7 +279,7 @@ static TIMER_CALLBACK( beam_firq_callback )
static TIMER_CALLBACK( collide_firq_callback )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
/* generate the interrupt, if we're selected */
if (!state->firq_select && state->firq_enable)
{
@@ -305,7 +305,7 @@ static TIMER_CALLBACK( collide_firq_callback )
static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect,
int scroll_offset, int check_collision)
{
- exidy440_state *state = screen.machine->driver_data<exidy440_state>();
+ exidy440_state *state = screen.machine().driver_data<exidy440_state>();
int i;
/* get a pointer to the palette to look for collision flags */
@@ -371,7 +371,7 @@ static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangl
/* check the collisions bit */
if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128))
- screen.machine->scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx);
+ screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx);
}
currx++;
@@ -384,7 +384,7 @@ static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangl
/* check the collisions bit */
if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128))
- screen.machine->scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx);
+ screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx);
}
currx++;
}
@@ -406,7 +406,7 @@ static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangl
static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect,
int scroll_offset, int check_collision)
{
- exidy440_state *state = screen.machine->driver_data<exidy440_state>();
+ exidy440_state *state = screen.machine().driver_data<exidy440_state>();
int y, sy;
/* draw any dirty scanlines from the VRAM directly */
@@ -443,8 +443,8 @@ static SCREEN_UPDATE( exidy440 )
{
int i;
- int beamx = ((input_port_read(screen->machine, "AN0") & 0xff) * (HBSTART - HBEND)) >> 8;
- int beamy = ((input_port_read(screen->machine, "AN1") & 0xff) * (VBSTART - VBEND)) >> 8;
+ int beamx = ((input_port_read(screen->machine(), "AN0") & 0xff) * (HBSTART - HBEND)) >> 8;
+ int beamy = ((input_port_read(screen->machine(), "AN1") & 0xff) * (VBSTART - VBEND)) >> 8;
/* The timing of this FIRQ is very important. The games look for an FIRQ
and then wait about 650 cycles, clear the old FIRQ, and wait a
@@ -456,7 +456,7 @@ static SCREEN_UPDATE( exidy440 )
attotime time = screen->time_until_pos(beamy, beamx) - increment * 6;
for (i = 0; i <= 12; i++)
{
- screen->machine->scheduler().timer_set(time, FUNC(beam_firq_callback), beamx);
+ screen->machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx);
time += increment;
}
}
@@ -467,7 +467,7 @@ static SCREEN_UPDATE( exidy440 )
static SCREEN_UPDATE( topsecex )
{
- exidy440_state *state = screen->machine->driver_data<exidy440_state>();
+ exidy440_state *state = screen->machine().driver_data<exidy440_state>();
/* redraw the screen */
update_screen(*screen, bitmap, cliprect, *state->topsecex_yscroll, FALSE);
diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c
index b9ea4a90ea4..486d1f9103e 100644
--- a/src/mame/video/exprraid.c
+++ b/src/mame/video/exprraid.c
@@ -4,30 +4,30 @@
WRITE8_HANDLER( exprraid_videoram_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( exprraid_colorram_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( exprraid_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( exprraid_bgselect_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
if (state->bg_index[offset] != data)
{
state->bg_index[offset] = data;
@@ -37,20 +37,20 @@ WRITE8_HANDLER( exprraid_bgselect_w )
WRITE8_HANDLER( exprraid_scrollx_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
tilemap_set_scrollx(state->bg_tilemap, offset, data);
}
WRITE8_HANDLER( exprraid_scrolly_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
- UINT8 *tilerom = machine->region("gfx4")->base();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
+ UINT8 *tilerom = machine.region("gfx4")->base();
int data, attr, bank, code, color, flags;
int quadrant = 0, offs;
@@ -77,7 +77,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x07) << 8);
int color = (attr & 0x10) >> 4;
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( exprraid )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -96,9 +96,9 @@ VIDEO_START( exprraid )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -119,7 +119,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, 0, machine->gfx[1],
+ drawgfx_transpen(bitmap, 0, machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -128,7 +128,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (attr & 0x10)
{
- drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
code + 1, color,
flipx, flipy,
sx, sy + (flip_screen_get(machine) ? -16 : 16), 0);
@@ -138,9 +138,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( exprraid )
{
- exprraid_state *state = screen->machine->driver_data<exprraid_state>();
+ exprraid_state *state = screen->machine().driver_data<exprraid_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c
index dbf5488e19f..c0abe5fbdbd 100644
--- a/src/mame/video/exterm.c
+++ b/src/mame/video/exterm.c
@@ -34,28 +34,28 @@ PALETTE_INIT( exterm )
void exterm_to_shiftreg_master(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
memcpy(shiftreg, &state->master_videoram[TOWORD(address)], 256 * sizeof(UINT16));
}
void exterm_from_shiftreg_master(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
memcpy(&state->master_videoram[TOWORD(address)], shiftreg, 256 * sizeof(UINT16));
}
void exterm_to_shiftreg_slave(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
memcpy(shiftreg, &state->slave_videoram[TOWORD(address)], 256 * 2 * sizeof(UINT8));
}
void exterm_from_shiftreg_slave(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
memcpy(&state->slave_videoram[TOWORD(address)], shiftreg, 256 * 2 * sizeof(UINT8));
}
@@ -69,7 +69,7 @@ void exterm_from_shiftreg_slave(address_space *space, UINT32 address, UINT16 *sh
void exterm_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- exterm_state *state = screen.machine->driver_data<exterm_state>();
+ exterm_state *state = screen.machine().driver_data<exterm_state>();
UINT16 *bgsrc = &state->master_videoram[(params->rowaddr << 8) & 0xff00];
UINT16 *fgsrc = NULL;
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
@@ -79,7 +79,7 @@ void exterm_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanlin
int x;
/* get parameters for the slave CPU */
- tms34010_get_display_params(screen.machine->device("slave"), &fgparams);
+ tms34010_get_display_params(screen.machine().device("slave"), &fgparams);
/* compute info about the slave vram */
if (fgparams.enabled && scanline >= fgparams.veblnk && scanline < fgparams.vsblnk && fgparams.heblnk < fgparams.hsblnk)
diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c
index 74cf0baba6c..9934ef6d741 100644
--- a/src/mame/video/exzisus.c
+++ b/src/mame/video/exzisus.c
@@ -18,56 +18,56 @@ Functions to emulate the video hardware of the machine.
READ8_HANDLER ( exzisus_videoram_0_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->videoram0[offset];
}
READ8_HANDLER ( exzisus_videoram_1_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->videoram1[offset];
}
READ8_HANDLER ( exzisus_objectram_0_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->objectram0[offset];
}
READ8_HANDLER ( exzisus_objectram_1_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->objectram1[offset];
}
WRITE8_HANDLER( exzisus_videoram_0_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->videoram0[offset] = data;
}
WRITE8_HANDLER( exzisus_videoram_1_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->videoram1[offset] = data;
}
WRITE8_HANDLER( exzisus_objectram_0_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->objectram0[offset] = data;
}
WRITE8_HANDLER( exzisus_objectram_1_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->objectram1[offset] = data;
}
@@ -78,7 +78,7 @@ WRITE8_HANDLER( exzisus_objectram_1_w )
SCREEN_UPDATE( exzisus )
{
- exzisus_state *state = screen->machine->driver_data<exzisus_state>();
+ exzisus_state *state = screen->machine().driver_data<exzisus_state>();
int offs;
int sx, sy, xc, yc;
int gfx_num, gfx_attr, gfx_offs;
@@ -139,16 +139,16 @@ SCREEN_UPDATE( exzisus )
x = (sx + (xc << 3)) & 0xff;
y = (sy + (yc << 3)) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
x = 248 - x;
y = 248 - y;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
code & 0x3fff,
color,
- flip_screen_get(screen->machine), flip_screen_get(screen->machine),
+ flip_screen_get(screen->machine()), flip_screen_get(screen->machine()),
x, y, 15);
goffs += 2;
}
@@ -208,16 +208,16 @@ SCREEN_UPDATE( exzisus )
x = (sx + (xc << 3)) & 0xff;
y = (sy + (yc << 3)) & 0xff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
x = 248 - x;
y = 248 - y;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
code & 0x3fff,
color,
- flip_screen_get(screen->machine), flip_screen_get(screen->machine),
+ flip_screen_get(screen->machine()), flip_screen_get(screen->machine()),
x, y, 15);
goffs += 2;
}
diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c
index 896898eac97..7512b9910ff 100644
--- a/src/mame/video/f1gp.c
+++ b/src/mame/video/f1gp.c
@@ -14,7 +14,7 @@
static TILE_GET_INFO( f1gp_get_roz_tile_info )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
int code = state->rozvideoram[tile_index];
SET_TILE_INFO(3, code & 0x7ff, code >> 12, 0);
@@ -22,7 +22,7 @@ static TILE_GET_INFO( f1gp_get_roz_tile_info )
static TILE_GET_INFO( f1gp2_get_roz_tile_info )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
int code = state->rozvideoram[tile_index];
SET_TILE_INFO(2, (code & 0x7ff) + (state->roz_bank << 11), code >> 12, 0);
@@ -30,7 +30,7 @@ static TILE_GET_INFO( f1gp2_get_roz_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
int code = state->fgvideoram[tile_index];
SET_TILE_INFO(0, code & 0x7fff, 0, (code & 0x8000) ? TILE_FLIPY : 0);
@@ -45,38 +45,38 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( f1gp )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->roz_tilemap = tilemap_create(machine, f1gp_get_roz_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0xff);
- state->zoomdata = (UINT16 *)machine->region("gfx4")->base();
- gfx_element_set_source(machine->gfx[3], (UINT8 *)state->zoomdata);
+ state->zoomdata = (UINT16 *)machine.region("gfx4")->base();
+ gfx_element_set_source(machine.gfx[3], (UINT8 *)state->zoomdata);
-// state->save_pointer(NAME(state->zoomdata), machine->region("gfx4")->bytes());
+// state->save_pointer(NAME(state->zoomdata), machine.region("gfx4")->bytes());
}
VIDEO_START( f1gpb )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->roz_tilemap = tilemap_create(machine, f1gp_get_roz_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0xff);
- state->zoomdata = (UINT16 *)machine->region("gfx4")->base();
- gfx_element_set_source(machine->gfx[3], (UINT8 *)state->zoomdata);
+ state->zoomdata = (UINT16 *)machine.region("gfx4")->base();
+ gfx_element_set_source(machine.gfx[3], (UINT8 *)state->zoomdata);
-// state->save_pointer(NAME(state->zoomdata), machine->region("gfx4")->bytes());
+// state->save_pointer(NAME(state->zoomdata), machine.region("gfx4")->bytes());
}
VIDEO_START( f1gp2 )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->roz_tilemap = tilemap_create(machine, f1gp2_get_roz_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -97,40 +97,40 @@ VIDEO_START( f1gp2 )
READ16_HANDLER( f1gp_zoomdata_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return state->zoomdata[offset];
}
WRITE16_HANDLER( f1gp_zoomdata_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->zoomdata[offset]);
- gfx_element_mark_dirty(space->machine->gfx[3], offset / 64);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset / 64);
}
READ16_HANDLER( f1gp_rozvideoram_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return state->rozvideoram[offset];
}
WRITE16_HANDLER( f1gp_rozvideoram_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->rozvideoram[offset]);
tilemap_mark_tile_dirty(state->roz_tilemap, offset);
}
WRITE16_HANDLER( f1gp_fgvideoram_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->fgvideoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE16_HANDLER( f1gp_fgscroll_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->scroll[offset]);
tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[0]);
@@ -139,7 +139,7 @@ WRITE16_HANDLER( f1gp_fgscroll_w )
WRITE16_HANDLER( f1gp_gfxctrl_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
if (ACCESSING_BITS_0_7)
{
state->flipscreen = data & 0x20;
@@ -149,7 +149,7 @@ WRITE16_HANDLER( f1gp_gfxctrl_w )
WRITE16_HANDLER( f1gp2_gfxctrl_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
if (ACCESSING_BITS_0_7)
{
state->flipscreen = data & 0x20;
@@ -177,9 +177,9 @@ WRITE16_HANDLER( f1gp2_gfxctrl_w )
***************************************************************************/
-static void f1gp_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int primask )
+static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int primask )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
int attr_start, first;
UINT16 *spram = chip ? state->spr2vram : state->spr1vram;
@@ -229,13 +229,13 @@ static void f1gp_draw_sprites( running_machine *machine, bitmap_t *bitmap, const
else
code = state->spr2cgram[map_start % (state->spr2cgram_size / 2)];
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1 + chip],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1 + chip],
code,
color,
flipx,flipy,
sx,sy,
0x1000 * zoomx,0x1000 * zoomy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
// pri ? 0 : 0x2);
primask,15);
map_start++;
@@ -252,9 +252,9 @@ static void f1gp_draw_sprites( running_machine *machine, bitmap_t *bitmap, const
SCREEN_UPDATE( f1gp )
{
- f1gp_state *state = screen->machine->driver_data<f1gp_state>();
+ f1gp_state *state = screen->machine().driver_data<f1gp_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->roz_tilemap, 0, 0, 1);
@@ -263,21 +263,21 @@ SCREEN_UPDATE( f1gp )
/* quick kludge for "continue" screen priority */
if (state->gfxctrl == 0x00)
{
- f1gp_draw_sprites(screen->machine, bitmap, cliprect, 0, 0x02);
- f1gp_draw_sprites(screen->machine, bitmap, cliprect, 1, 0x02);
+ f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x02);
+ f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x02);
}
else
{
- f1gp_draw_sprites(screen->machine, bitmap, cliprect, 0, 0x00);
- f1gp_draw_sprites(screen->machine, bitmap, cliprect, 1, 0x02);
+ f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 0, 0x00);
+ f1gp_draw_sprites(screen->machine(), bitmap, cliprect, 1, 0x02);
}
return 0;
}
-static void f1gpb_draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
UINT16 *spriteram = state->spriteram;
int attr_start, start_offset = state->spriteram_size / 2 - 4;
@@ -307,7 +307,7 @@ static void f1gpb_draw_sprites( running_machine *machine, bitmap_t *bitmap,const
if((spriteram[attr_start + 1] & 0x00f0) && (spriteram[attr_start + 1] & 0x00f0) != 0xc0)
{
printf("attr %X\n",spriteram[attr_start + 1] & 0x00f0);
- code = machine->rand();
+ code = machine.rand();
}
/*
@@ -324,28 +324,28 @@ static void f1gpb_draw_sprites( running_machine *machine, bitmap_t *bitmap,const
gfx = 0;
}
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1 + gfx],
code,
color,
flipx,flipy,
x,y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri ? 0 : 0x2,15);
// wrap around x
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1 + gfx],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1 + gfx],
code,
color,
flipx,flipy,
x - 512,y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri ? 0 : 0x2,15);
}
}
SCREEN_UPDATE( f1gpb )
{
- f1gp_state *state = screen->machine->driver_data<f1gp_state>();
+ f1gp_state *state = screen->machine().driver_data<f1gp_state>();
UINT32 startx, starty;
int incxx, incxy, incyx, incyy;
@@ -357,7 +357,7 @@ SCREEN_UPDATE( f1gpb )
tilemap_set_scrolly(state->fg_tilemap, 0, state->fgregs[0] + 8);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw_roz(bitmap, cliprect, state->roz_tilemap,
startx << 13, starty << 13,
@@ -366,15 +366,15 @@ SCREEN_UPDATE( f1gpb )
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 1);
- f1gpb_draw_sprites(screen->machine, bitmap, cliprect);
+ f1gpb_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
-static void f1gp2_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
int offs;
offs = 0;
@@ -405,7 +405,7 @@ static void f1gp2_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
zoomy = 32 - zoomy;
if (state->spritelist[attr_start + 2] & 0x20ff)
- color = machine->rand();
+ color = machine.rand();
for (y = 0; y <= ysize; y++)
{
@@ -425,14 +425,14 @@ static void f1gp2_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
map_start++;
if (state->flipscreen)
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
!flipx,!flipy,
304-sx,208-sy,
zoomx << 11,zoomy << 11,15);
else
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -446,28 +446,28 @@ static void f1gp2_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( f1gp2 )
{
- f1gp_state *state = screen->machine->driver_data<f1gp_state>();
+ f1gp_state *state = screen->machine().driver_data<f1gp_state>();
if (state->gfxctrl & 4) /* blank screen */
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
else
{
switch (state->gfxctrl & 3)
{
case 0:
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
- f1gp2_draw_sprites(screen->machine, bitmap, cliprect);
+ f1gp2_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
break;
case 1:
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- f1gp2_draw_sprites(screen->machine, bitmap, cliprect);
+ f1gp2_draw_sprites(screen->machine(), bitmap, cliprect);
break;
case 2:
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->roz_tilemap, 0, 0, 1);
- f1gp2_draw_sprites(screen->machine, bitmap, cliprect);
+ f1gp2_draw_sprites(screen->machine(), bitmap, cliprect);
break;
#ifdef MAME_DEBUG
case 3:
diff --git a/src/mame/video/fantland.c b/src/mame/video/fantland.c
index c304101b503..3a7b3669da8 100644
--- a/src/mame/video/fantland.c
+++ b/src/mame/video/fantland.c
@@ -61,9 +61,9 @@
#include "emu.h"
#include "includes/fantland.h"
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
UINT8 *spriteram_2 = state->spriteram2;
UINT8 *indx_ram = state->spriteram + 0x2000, // this ram contains indexes into offs_ram
*offs_ram = state->spriteram + 0x2400, // this ram contains x,y offsets or indexes into spriteram_2
@@ -71,7 +71,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
*ram2 = indx_ram; // current sprite pointer in indx_ram
// wheelrun is the only game with a smaller visible area
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int special = (visarea.max_y - visarea.min_y + 1) < 0x100;
for ( ; ram < indx_ram; ram += 8,ram2++)
@@ -135,14 +135,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (x >= 0x180) x -= 0x200;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0], code,color, flipx,flipy, x,y,0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0], code,color, flipx,flipy, x,y,0);
}
}
SCREEN_UPDATE( fantland )
{
bitmap_fill(bitmap,cliprect,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/fastfred.c b/src/mame/video/fastfred.c
index ce10e8ce44f..01e20090f6e 100644
--- a/src/mame/video/fastfred.c
+++ b/src/mame/video/fastfred.c
@@ -50,7 +50,7 @@ PALETTE_INIT( fastfred )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -79,12 +79,12 @@ PALETTE_INIT( fastfred )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* characters and sprites use the same palette */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
}
/***************************************************************************
@@ -95,7 +95,7 @@ PALETTE_INIT( fastfred )
static TILE_GET_INFO( get_tile_info )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
UINT8 x = tile_index & 0x1f;
UINT16 code = state->charbank | state->videoram[tile_index];
@@ -114,7 +114,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( fastfred )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
@@ -130,7 +130,7 @@ VIDEO_START( fastfred )
WRITE8_HANDLER( fastfred_videoram_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -138,7 +138,7 @@ WRITE8_HANDLER( fastfred_videoram_w )
WRITE8_HANDLER( fastfred_attributes_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
if (state->attributesram[offset] != data)
{
if (offset & 0x01)
@@ -162,7 +162,7 @@ WRITE8_HANDLER( fastfred_attributes_w )
WRITE8_HANDLER( fastfred_charbank1_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
UINT16 new_data = (state->charbank & 0x0200) | ((data & 0x01) << 8);
if (new_data != state->charbank)
@@ -175,7 +175,7 @@ WRITE8_HANDLER( fastfred_charbank1_w )
WRITE8_HANDLER( fastfred_charbank2_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
UINT16 new_data = (state->charbank & 0x0100) | ((data & 0x01) << 9);
if (new_data != state->charbank)
@@ -189,7 +189,7 @@ WRITE8_HANDLER( fastfred_charbank2_w )
WRITE8_HANDLER( fastfred_colorbank1_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
UINT8 new_data = (state->colorbank & 0x10) | ((data & 0x01) << 3);
if (new_data != state->colorbank)
@@ -202,7 +202,7 @@ WRITE8_HANDLER( fastfred_colorbank1_w )
WRITE8_HANDLER( fastfred_colorbank2_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
UINT8 new_data = (state->colorbank & 0x08) | ((data & 0x01) << 4);
if (new_data != state->colorbank)
@@ -217,23 +217,23 @@ WRITE8_HANDLER( fastfred_colorbank2_w )
WRITE8_HANDLER( fastfred_flip_screen_x_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
- if (flip_screen_x_get(space->machine) != (data & 0x01))
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ if (flip_screen_x_get(space->machine()) != (data & 0x01))
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
- tilemap_set_flip(state->bg_tilemap, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip(state->bg_tilemap, (flip_screen_x_get(space->machine()) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine()) ? TILEMAP_FLIPY : 0));
}
}
WRITE8_HANDLER( fastfred_flip_screen_y_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
- if (flip_screen_y_get(space->machine) != (data & 0x01))
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ if (flip_screen_y_get(space->machine()) != (data & 0x01))
{
- flip_screen_y_set(space->machine, data & 0x01);
+ flip_screen_y_set(space->machine(), data & 0x01);
- tilemap_set_flip(state->bg_tilemap, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip(state->bg_tilemap, (flip_screen_x_get(space->machine()) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine()) ? TILEMAP_FLIPY : 0));
}
}
@@ -245,9 +245,9 @@ WRITE8_HANDLER( fastfred_flip_screen_y_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -299,7 +299,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine->gfx[1],
+ drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine.gfx[1],
code,
state->colorbank | (state->spriteram[offs + 2] & 0x07),
flipx,flipy,
@@ -310,10 +310,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( fastfred )
{
- fastfred_state *state = screen->machine->driver_data<fastfred_state>();
+ fastfred_state *state = screen->machine().driver_data<fastfred_state>();
bitmap_fill(bitmap, cliprect, *state->background_color);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -321,7 +321,7 @@ SCREEN_UPDATE( fastfred )
static TILE_GET_INFO( imago_get_tile_info_bg )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
UINT8 x = tile_index & 0x1f;
UINT16 code = state->charbank * 0x100 + state->videoram[tile_index];
@@ -332,7 +332,7 @@ static TILE_GET_INFO( imago_get_tile_info_bg )
static TILE_GET_INFO( imago_get_tile_info_fg )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
int code = state->imago_fg_videoram[tile_index];
SET_TILE_INFO(2, code, 2, 0);
}
@@ -344,14 +344,14 @@ static TILE_GET_INFO( imago_get_tile_info_web )
WRITE8_HANDLER( imago_fg_videoram_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->imago_fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( imago_charbank_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
if( state->charbank != data )
{
state->charbank = data;
@@ -361,7 +361,7 @@ WRITE8_HANDLER( imago_charbank_w )
VIDEO_START( imago )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->web_tilemap = tilemap_create(machine, imago_get_tile_info_web,tilemap_scan_rows, 8,8,32,32);
state->bg_tilemap = tilemap_create(machine, imago_get_tile_info_bg, tilemap_scan_rows,8,8,32,32);
state->fg_tilemap = tilemap_create(machine, imago_get_tile_info_fg, tilemap_scan_rows,8,8,32,32);
@@ -380,11 +380,11 @@ VIDEO_START( imago )
SCREEN_UPDATE( imago )
{
- fastfred_state *state = screen->machine->driver_data<fastfred_state>();
+ fastfred_state *state = screen->machine().driver_data<fastfred_state>();
tilemap_draw(bitmap,cliprect,state->web_tilemap,0,0);
- galaxold_draw_stars(screen->machine, bitmap, cliprect);
+ galaxold_draw_stars(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
diff --git a/src/mame/video/fastlane.c b/src/mame/video/fastlane.c
index c3805fea6aa..9cdbc0850b7 100644
--- a/src/mame/video/fastlane.c
+++ b/src/mame/video/fastlane.c
@@ -8,7 +8,7 @@ PALETTE_INIT( fastlane )
int pal;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x400);
+ machine.colortable = colortable_alloc(machine, 0x400);
for (pal = 0; pal < 0x10; pal++)
{
@@ -17,15 +17,15 @@ PALETTE_INIT( fastlane )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = (i & 0x3f0) | color_prom[(pal << 4) | (i & 0x0f)];
- colortable_entry_set_value(machine->colortable, (pal << 10) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (pal << 10) | i, ctabentry);
}
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
int i;
for (i = 0x00; i < 0x800; i += 2)
@@ -34,7 +34,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -48,7 +48,7 @@ static void set_pens( running_machine *machine )
static TILE_GET_INFO( get_tile_info0 )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121, 5);
@@ -77,7 +77,7 @@ static TILE_GET_INFO( get_tile_info0 )
static TILE_GET_INFO( get_tile_info1 )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121, 5);
@@ -112,17 +112,17 @@ static TILE_GET_INFO( get_tile_info1 )
VIDEO_START( fastlane )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
state->layer0 = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 8, 8, 32, 32);
state->layer1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->layer0, 32);
- state->clip0 = machine->primary_screen->visible_area();
+ state->clip0 = machine.primary_screen->visible_area();
state->clip0.min_x += 40;
- state->clip1 = machine->primary_screen->visible_area();
+ state->clip1 = machine.primary_screen->visible_area();
state->clip1.max_x = 39;
state->clip1.min_x = 0;
}
@@ -135,14 +135,14 @@ VIDEO_START( fastlane )
WRITE8_HANDLER( fastlane_vram1_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
state->videoram1[offset] = data;
tilemap_mark_tile_dirty(state->layer0, offset & 0x3ff);
}
WRITE8_HANDLER( fastlane_vram2_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->layer1, offset & 0x3ff);
}
@@ -157,14 +157,14 @@ WRITE8_HANDLER( fastlane_vram2_w )
SCREEN_UPDATE( fastlane )
{
- fastlane_state *state = screen->machine->driver_data<fastlane_state>();
+ fastlane_state *state = screen->machine().driver_data<fastlane_state>();
rectangle finalclip0 = state->clip0, finalclip1 = state->clip1;
int i, xoffs;
sect_rect(&finalclip0, cliprect);
sect_rect(&finalclip1, cliprect);
- set_pens(screen->machine);
+ set_pens(screen->machine());
/* set scroll registers */
xoffs = k007121_ctrlram_r(state->k007121, 0);
@@ -174,7 +174,7 @@ SCREEN_UPDATE( fastlane )
tilemap_set_scrolly(state->layer0, 0, k007121_ctrlram_r(state->k007121, 2));
tilemap_draw(bitmap, &finalclip0, state->layer0, 0, 0);
- k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine->gfx[0], screen->machine->colortable, state->spriteram, 0, 40, 0, (UINT32)-1);
+ k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->spriteram, 0, 40, 0, (UINT32)-1);
tilemap_draw(bitmap, &finalclip1, state->layer1, 0, 0);
return 0;
}
diff --git a/src/mame/video/fcombat.c b/src/mame/video/fcombat.c
index 64a285c2128..b90ef7cdd4d 100644
--- a/src/mame/video/fcombat.c
+++ b/src/mame/video/fcombat.c
@@ -14,8 +14,8 @@ static TILE_GET_INFO( get_bg_tile_info )
//palno = (tile_index - (tile_index / 32 * 16) * 32 * 16) / 32;
- tileno = machine->region("user1")->base()[tile_index];
- palno = 0x18; //machine->region("user2")->base()[tile_index] >> 3;
+ tileno = machine.region("user1")->base()[tile_index];
+ palno = 0x18; //machine.region("user2")->base()[tile_index] >> 3;
SET_TILE_INFO(2, tileno, palno, 0);
}
@@ -42,7 +42,7 @@ PALETTE_INIT( fcombat )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( fcombat )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,7 +78,7 @@ PALETTE_INIT( fcombat )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bg chars (this is not the full story... there are four layers mixed */
@@ -86,7 +86,7 @@ PALETTE_INIT( fcombat )
for (i = 0x200; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -100,7 +100,7 @@ PALETTE_INIT( fcombat )
VIDEO_START( fcombat )
{
- fcombat_state *state = machine->driver_data<fcombat_state>();
+ fcombat_state *state = machine.driver_data<fcombat_state>();
state->bgmap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32 * 8 * 2, 32);
}
@@ -114,7 +114,7 @@ VIDEO_START( fcombat )
WRITE8_HANDLER( fcombat_videoreg_w )
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
/* bit 0 = flip screen and joystick input multiplexor */
state->cocktail_flip = data & 1;
@@ -136,7 +136,7 @@ WRITE8_HANDLER( fcombat_videoreg_w )
SCREEN_UPDATE( fcombat )
{
- fcombat_state *state = screen->machine->driver_data<fcombat_state>();
+ fcombat_state *state = screen->machine().driver_data<fcombat_state>();
int sx, sy, offs, i;
/* draw background */
@@ -162,7 +162,7 @@ SCREEN_UPDATE( fcombat )
int code2 = code;
int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->sprite_palette * 16);
- const gfx_element *gfx = screen->machine->gfx[1];
+ const gfx_element *gfx = screen->machine().gfx[1];
if (state->cocktail_flip)
{
@@ -204,7 +204,7 @@ SCREEN_UPDATE( fcombat )
int y = state->cocktail_flip ? (31 * 8 - 8 * sy) : 8 * sy;
offs = sx + sy * 64;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->videoram[offs] + 256 * state->char_bank,
((state->videoram[offs] & 0xf0) >> 4) + state->char_palette * 16,
state->cocktail_flip, state->cocktail_flip, x, y, 0);
diff --git a/src/mame/video/fgoal.c b/src/mame/video/fgoal.c
index 212463023e8..ef8402702d6 100644
--- a/src/mame/video/fgoal.c
+++ b/src/mame/video/fgoal.c
@@ -10,30 +10,30 @@
WRITE8_HANDLER( fgoal_color_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->current_color = data & 3;
}
WRITE8_HANDLER( fgoal_ypos_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->ypos = data;
}
WRITE8_HANDLER( fgoal_xpos_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->xpos = data;
}
VIDEO_START( fgoal )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
- state->fgbitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->bgbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
+ state->fgbitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->bgbitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->fgbitmap));
state->save_item(NAME(*state->bgbitmap));
@@ -42,7 +42,7 @@ VIDEO_START( fgoal )
SCREEN_UPDATE( fgoal )
{
- fgoal_state *state = screen->machine->driver_data<fgoal_state>();
+ fgoal_state *state = screen->machine().driver_data<fgoal_state>();
const UINT8* VRAM = state->video_ram;
int x;
@@ -51,16 +51,16 @@ SCREEN_UPDATE( fgoal )
/* draw color overlay foreground and background */
- if (state->fgoal_player == 1 && (input_port_read(screen->machine, "IN1") & 0x40))
+ if (state->fgoal_player == 1 && (input_port_read(screen->machine(), "IN1") & 0x40))
{
- drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine->gfx[0],
+ drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine().gfx[0],
0, (state->fgoal_player << 2) | state->current_color,
1, 1,
0, 16,
0x40000,
0x40000);
- drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine->gfx[1],
+ drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine().gfx[1],
0, 0,
1, 1,
0, 16,
@@ -69,14 +69,14 @@ SCREEN_UPDATE( fgoal )
}
else
{
- drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine->gfx[0],
+ drawgfxzoom_opaque(state->fgbitmap, cliprect, screen->machine().gfx[0],
0, (state->fgoal_player << 2) | state->current_color,
0, 0,
0, 0,
0x40000,
0x40000);
- drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine->gfx[1],
+ drawgfxzoom_opaque(state->bgbitmap, cliprect, screen->machine().gfx[1],
0, 0,
0, 0,
0, 0,
diff --git a/src/mame/video/finalizr.c b/src/mame/video/finalizr.c
index a58e4d44e64..53e10a8f234 100644
--- a/src/mame/video/finalizr.c
+++ b/src/mame/video/finalizr.c
@@ -15,7 +15,7 @@ PALETTE_INIT( finalizr )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -24,7 +24,7 @@ PALETTE_INIT( finalizr )
int g = pal4bit(color_prom[i + 0x00] >> 4);
int b = pal4bit(color_prom[i + 0x20] >> 0);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -33,19 +33,19 @@ PALETTE_INIT( finalizr )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xc0) << 2) + (state->charbank << 10);
int color = attr & 0x0f;
@@ -56,7 +56,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
int attr = state->colorram2[tile_index];
int code = state->videoram2[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x0f;
@@ -67,7 +67,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( finalizr )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -77,7 +77,7 @@ VIDEO_START( finalizr )
WRITE8_HANDLER( finalizr_videoctrl_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
state->charbank = data & 3;
state->spriterambank = data & 8;
/* other bits unknown */
@@ -87,7 +87,7 @@ WRITE8_HANDLER( finalizr_videoctrl_w )
SCREEN_UPDATE( finalizr )
{
- finalizr_state *state = screen->machine->driver_data<finalizr_state>();
+ finalizr_state *state = screen->machine().driver_data<finalizr_state>();
int offs;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -98,8 +98,8 @@ SCREEN_UPDATE( finalizr )
/* Draw the sprites. */
{
- const gfx_element *gfx1 = screen->machine->gfx[1];
- const gfx_element *gfx2 = screen->machine->gfx[2];
+ const gfx_element *gfx1 = screen->machine().gfx[1];
+ const gfx_element *gfx2 = screen->machine().gfx[2];
UINT8 *sr = state->spriterambank ? state->spriteram_2 : state->spriteram;
@@ -122,7 +122,7 @@ SCREEN_UPDATE( finalizr )
if (size >= 0x10) /* 32x32 */
{
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 256 - sx;
sy = 224 - sy;
@@ -153,7 +153,7 @@ SCREEN_UPDATE( finalizr )
}
else
{
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = ((size & 0x08) ? 280:272) - sx;
sy = ((size & 0x04) ? 248:240) - sy;
diff --git a/src/mame/video/firetrap.c b/src/mame/video/firetrap.c
index 7886ac1ed06..d50c73bca0c 100644
--- a/src/mame/video/firetrap.c
+++ b/src/mame/video/firetrap.c
@@ -39,7 +39,7 @@ PALETTE_INIT( firetrap )
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -54,10 +54,10 @@ PALETTE_INIT( firetrap )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine, i, MAKE_RGB(r,g,b));
@@ -85,7 +85,7 @@ static TILEMAP_MAPPER( get_bg_memory_offset )
static TILE_GET_INFO( get_fg_tile_info )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
int code = state->fgvideoram[tile_index];
int color = state->fgvideoram[tile_index + 0x400];
SET_TILE_INFO(
@@ -95,7 +95,7 @@ static TILE_GET_INFO( get_fg_tile_info )
0);
}
-INLINE void get_bg_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region)
+INLINE void get_bg_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region)
{
int code = bgvideoram[tile_index];
int color = bgvideoram[tile_index + 0x100];
@@ -108,13 +108,13 @@ INLINE void get_bg_tile_info(running_machine *machine, tile_data *tileinfo, int
static TILE_GET_INFO( get_bg1_tile_info )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
get_bg_tile_info(machine, tileinfo, tile_index, state->bg1videoram, 1);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
get_bg_tile_info(machine, tileinfo, tile_index, state->bg2videoram, 2);
}
@@ -127,7 +127,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
VIDEO_START( firetrap )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, get_fg_memory_offset, 8, 8, 32, 32);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info, get_bg_memory_offset, 16, 16, 32, 32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, get_bg_memory_offset, 16, 16, 32, 32);
@@ -145,21 +145,21 @@ VIDEO_START( firetrap )
WRITE8_HANDLER( firetrap_fgvideoram_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( firetrap_bg1videoram_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->bg1videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap, offset & 0x6ff);
}
WRITE8_HANDLER( firetrap_bg2videoram_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->bg2videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset & 0x6ff);
}
@@ -167,28 +167,28 @@ WRITE8_HANDLER( firetrap_bg2videoram_w )
WRITE8_HANDLER( firetrap_bg1_scrollx_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->scroll1_x[offset] = data;
tilemap_set_scrollx(state->bg1_tilemap, 0, state->scroll1_x[0] | (state->scroll1_x[1] << 8));
}
WRITE8_HANDLER( firetrap_bg1_scrolly_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->scroll1_y[offset] = data;
tilemap_set_scrolly(state->bg1_tilemap, 0, -(state->scroll1_y[0] | (state->scroll1_y[1] << 8)));
}
WRITE8_HANDLER( firetrap_bg2_scrollx_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->scroll2_x[offset] = data;
tilemap_set_scrollx(state->bg2_tilemap, 0, state->scroll2_x[0] | (state->scroll2_x[1] << 8));
}
WRITE8_HANDLER( firetrap_bg2_scrolly_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->scroll2_y[offset] = data;
tilemap_set_scrolly(state->bg2_tilemap, 0, -(state->scroll2_y[0] | (state->scroll2_y[1] << 8)));
}
@@ -200,9 +200,9 @@ WRITE8_HANDLER( firetrap_bg2_scrolly_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -230,24 +230,24 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
if (flip_screen_get(machine)) sy -= 16;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & ~1,
color,
flipx,flipy,
sx,flipy ? sy : sy + 16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code | 1,
color,
flipx,flipy,
sx,flipy ? sy + 16 : sy,0);
/* redraw with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & ~1,
color,
flipx,flipy,
sx - 256,flipy ? sy : sy + 16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code | 1,
color,
flipx,flipy,
@@ -255,14 +255,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
flipx,flipy,
sx,sy,0);
/* redraw with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
flipx,flipy,
@@ -273,10 +273,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( firetrap )
{
- firetrap_state *state = screen->machine->driver_data<firetrap_state>();
+ firetrap_state *state = screen->machine().driver_data<firetrap_state>();
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/firetrk.c b/src/mame/video/firetrk.c
index fbf066a3bfa..606f0bc4fd0 100644
--- a/src/mame/video/firetrk.c
+++ b/src/mame/video/firetrk.c
@@ -20,7 +20,7 @@ static const rectangle playfield_window = { 0x02a, 0x115, 0x000, 0x0ff };
PALETTE_INIT( firetrk )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int i;
static const UINT8 colortable_source[] =
@@ -57,7 +57,7 @@ PALETTE_INIT( firetrk )
}
-static void prom_to_palette(running_machine *machine, int number, UINT8 val)
+static void prom_to_palette(running_machine &machine, int number, UINT8 val)
{
palette_set_color(machine, number, MAKE_RGB(pal1bit(val >> 2), pal1bit(val >> 1), pal1bit(val >> 0)));
}
@@ -65,7 +65,7 @@ static void prom_to_palette(running_machine *machine, int number, UINT8 val)
PALETTE_INIT( montecar )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int i;
static const UINT8 colortable_source[] =
@@ -122,7 +122,7 @@ PALETTE_INIT( montecar )
static TILE_GET_INFO( firetrk_get_tile_info1 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int code = state->playfield_ram[tile_index] & 0x3f;
int color = (state->playfield_ram[tile_index] >> 6) & 0x03;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( firetrk_get_tile_info1 )
static TILE_GET_INFO( superbug_get_tile_info1 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int code = state->playfield_ram[tile_index] & 0x3f;
int color = (state->playfield_ram[tile_index] >> 6) & 0x03;
@@ -154,7 +154,7 @@ static TILE_GET_INFO( superbug_get_tile_info1 )
static TILE_GET_INFO( montecar_get_tile_info1 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int code = state->playfield_ram[tile_index] & 0x3f;
int color = (state->playfield_ram[tile_index] >> 6) & 0x03;
@@ -167,7 +167,7 @@ static TILE_GET_INFO( montecar_get_tile_info1 )
static TILE_GET_INFO( firetrk_get_tile_info2 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
UINT8 code = state->playfield_ram[tile_index] & 0x3f;
int color = 0;
@@ -184,7 +184,7 @@ static TILE_GET_INFO( firetrk_get_tile_info2 )
static TILE_GET_INFO( superbug_get_tile_info2 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
UINT8 code = state->playfield_ram[tile_index] & 0x3f;
int color = 0;
@@ -201,7 +201,7 @@ static TILE_GET_INFO( superbug_get_tile_info2 )
static TILE_GET_INFO( montecar_get_tile_info2 )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
UINT8 code = state->playfield_ram[tile_index];
int color = 0;
@@ -224,9 +224,9 @@ static TILE_GET_INFO( montecar_get_tile_info2 )
VIDEO_START( firetrk )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
- state->helper1 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
+ state->helper1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
state->tilemap1 = tilemap_create(machine, firetrk_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
state->tilemap2 = tilemap_create(machine, firetrk_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
@@ -235,9 +235,9 @@ VIDEO_START( firetrk )
VIDEO_START( superbug )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
- state->helper1 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
+ state->helper1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
state->tilemap1 = tilemap_create(machine, superbug_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
state->tilemap2 = tilemap_create(machine, superbug_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
@@ -246,18 +246,18 @@ VIDEO_START( superbug )
VIDEO_START( montecar )
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
- state->helper1 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
+ state->helper1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
state->tilemap1 = tilemap_create(machine, montecar_get_tile_info1, tilemap_scan_rows, 16, 16, 16, 16);
state->tilemap2 = tilemap_create(machine, montecar_get_tile_info2, tilemap_scan_rows, 16, 16, 16, 16);
}
-static void firetrk_draw_car(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int flash)
+static void firetrk_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int flash)
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int gfx_bank, code, color, flip_x, flip_y, x, y;
if (which)
@@ -285,9 +285,9 @@ static void firetrk_draw_car(running_machine *machine, bitmap_t *bitmap, const r
}
-static void superbug_draw_car(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int flash)
+static void superbug_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int flash)
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int gfx_bank = (*state->car_rot & 0x10) ? 4 : 3;
int code = ~*state->car_rot & 0x03;
int color = flash ? 1 : 0;
@@ -298,9 +298,9 @@ static void superbug_draw_car(running_machine *machine, bitmap_t *bitmap, const
}
-static void montecar_draw_car(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int is_collision_detection)
+static void montecar_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int is_collision_detection)
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
int gfx_bank, code, color, flip_x, flip_y, x, y;
if (which)
@@ -359,8 +359,8 @@ static void check_collision(firetrk_state *state, int which)
SCREEN_UPDATE( firetrk )
{
- firetrk_state *state = screen->machine->driver_data<firetrk_state>();
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ firetrk_state *state = screen->machine().driver_data<firetrk_state>();
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
tilemap_set_scrollx(state->tilemap1, 0, *state->scroll_x - 37);
tilemap_set_scrollx(state->tilemap2, 0, *state->scroll_x - 37);
tilemap_set_scrolly(state->tilemap1, 0, *state->scroll_y);
@@ -368,21 +368,21 @@ SCREEN_UPDATE( firetrk )
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, &playfield_window, state->tilemap1, 0, 0);
- firetrk_draw_car(screen->machine, bitmap, &playfield_window, screen->machine->gfx, 0, state->flash);
- firetrk_draw_car(screen->machine, bitmap, &playfield_window, screen->machine->gfx, 1, state->flash);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x00, 296, 0x10, 0x10);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x10, 8, 0x10, 0x10);
+ firetrk_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 0, state->flash);
+ firetrk_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 1, state->flash);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x00, 296, 0x10, 0x10);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x10, 8, 0x10, 0x10);
if (cliprect->max_y == screen->visible_area().max_y)
{
tilemap_draw(state->helper1, &playfield_window, state->tilemap2, 0, 0);
bitmap_fill(state->helper2, &playfield_window, 0xff);
- firetrk_draw_car(screen->machine, state->helper2, &playfield_window, screen->machine->gfx, 0, FALSE);
+ firetrk_draw_car(screen->machine(), state->helper2, &playfield_window, screen->machine().gfx, 0, FALSE);
check_collision(state, 0);
bitmap_fill(state->helper2, &playfield_window, 0xff);
- firetrk_draw_car(screen->machine, state->helper2, &playfield_window, screen->machine->gfx, 1, FALSE);
+ firetrk_draw_car(screen->machine(), state->helper2, &playfield_window, screen->machine().gfx, 1, FALSE);
check_collision(state, 1);
*state->blink = FALSE;
@@ -394,8 +394,8 @@ SCREEN_UPDATE( firetrk )
SCREEN_UPDATE( superbug )
{
- firetrk_state *state = screen->machine->driver_data<firetrk_state>();
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ firetrk_state *state = screen->machine().driver_data<firetrk_state>();
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
tilemap_set_scrollx(state->tilemap1, 0, *state->scroll_x - 37);
tilemap_set_scrollx(state->tilemap2, 0, *state->scroll_x - 37);
tilemap_set_scrolly(state->tilemap1, 0, *state->scroll_y);
@@ -403,16 +403,16 @@ SCREEN_UPDATE( superbug )
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, &playfield_window, state->tilemap1, 0, 0);
- superbug_draw_car(screen->machine, bitmap, &playfield_window, screen->machine->gfx, state->flash);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x00, 296, 0x10, 0x10);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x10, 8, 0x10, 0x10);
+ superbug_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, state->flash);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x00, 296, 0x10, 0x10);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x10, 8, 0x10, 0x10);
if (cliprect->max_y == screen->visible_area().max_y)
{
tilemap_draw(state->helper1, &playfield_window, state->tilemap2, 0, 0);
bitmap_fill(state->helper2, &playfield_window, 0xff);
- superbug_draw_car(screen->machine, state->helper2, &playfield_window, screen->machine->gfx, FALSE);
+ superbug_draw_car(screen->machine(), state->helper2, &playfield_window, screen->machine().gfx, FALSE);
check_collision(state, 0);
*state->blink = FALSE;
@@ -424,8 +424,8 @@ SCREEN_UPDATE( superbug )
SCREEN_UPDATE( montecar )
{
- firetrk_state *state = screen->machine->driver_data<firetrk_state>();
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ firetrk_state *state = screen->machine().driver_data<firetrk_state>();
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
tilemap_set_scrollx(state->tilemap1, 0, *state->scroll_x - 37);
tilemap_set_scrollx(state->tilemap2, 0, *state->scroll_x - 37);
tilemap_set_scrolly(state->tilemap1, 0, *state->scroll_y);
@@ -433,21 +433,21 @@ SCREEN_UPDATE( montecar )
bitmap_fill(bitmap, cliprect, 0x2c);
tilemap_draw(bitmap, &playfield_window, state->tilemap1, 0, 0);
- montecar_draw_car(screen->machine, bitmap, &playfield_window, screen->machine->gfx, 0, FALSE);
- montecar_draw_car(screen->machine, bitmap, &playfield_window, screen->machine->gfx, 1, FALSE);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x00, 24, 0x20, 0x08);
- draw_text(bitmap, cliprect, screen->machine->gfx, state->alpha_num_ram + 0x20, 16, 0x20, 0x08);
+ montecar_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 0, FALSE);
+ montecar_draw_car(screen->machine(), bitmap, &playfield_window, screen->machine().gfx, 1, FALSE);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x00, 24, 0x20, 0x08);
+ draw_text(bitmap, cliprect, screen->machine().gfx, state->alpha_num_ram + 0x20, 16, 0x20, 0x08);
if (cliprect->max_y == screen->visible_area().max_y)
{
tilemap_draw(state->helper1, &playfield_window, state->tilemap2, 0, 0);
bitmap_fill(state->helper2, &playfield_window, 0xff);
- montecar_draw_car(screen->machine, state->helper2, &playfield_window, screen->machine->gfx, 0, TRUE);
+ montecar_draw_car(screen->machine(), state->helper2, &playfield_window, screen->machine().gfx, 0, TRUE);
check_collision(state, 0);
bitmap_fill(state->helper2, &playfield_window, 0xff);
- montecar_draw_car(screen->machine, state->helper2, &playfield_window, screen->machine->gfx, 1, TRUE);
+ montecar_draw_car(screen->machine(), state->helper2, &playfield_window, screen->machine().gfx, 1, TRUE);
check_collision(state, 1);
}
diff --git a/src/mame/video/fitfight.c b/src/mame/video/fitfight.c
index 3b11bb2dbad..0a0222a90ee 100644
--- a/src/mame/video/fitfight.c
+++ b/src/mame/video/fitfight.c
@@ -4,10 +4,10 @@
#include "includes/fitfight.h"
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
- const gfx_element *gfx = machine->gfx[3];
+ fitfight_state *state = machine.driver_data<fitfight_state>();
+ const gfx_element *gfx = machine.gfx[3];
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x800 / 2;
@@ -43,7 +43,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static TILE_GET_INFO( get_fof_bak_tile_info )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
int code = state->fof_bak_tileram[tile_index * 2 + 1];
int colr = state->fof_bak_tileram[tile_index * 2] & 0x1f;
int xflip = (state->fof_bak_tileram[tile_index * 2] & 0x0020) >> 5;
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_fof_bak_tile_info )
WRITE16_HANDLER( fof_bak_tileram_w )
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
COMBINE_DATA(&state->fof_bak_tileram[offset]);
tilemap_mark_tile_dirty(state->fof_bak_tilemap, offset / 2);
@@ -63,7 +63,7 @@ WRITE16_HANDLER( fof_bak_tileram_w )
static TILE_GET_INFO( get_fof_mid_tile_info )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
int code = state->fof_mid_tileram[tile_index * 2 + 1];
int colr = state->fof_mid_tileram[tile_index * 2] & 0x1f;
int xflip = (state->fof_mid_tileram[tile_index * 2] & 0x0020) >> 5;
@@ -74,7 +74,7 @@ static TILE_GET_INFO( get_fof_mid_tile_info )
WRITE16_HANDLER( fof_mid_tileram_w )
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
COMBINE_DATA(&state->fof_mid_tileram[offset]);
tilemap_mark_tile_dirty(state->fof_mid_tilemap, offset / 2);
@@ -82,7 +82,7 @@ WRITE16_HANDLER( fof_mid_tileram_w )
static TILE_GET_INFO( get_fof_txt_tile_info )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
int code = state->fof_txt_tileram[tile_index * 2 + 1];
int colr = state->fof_txt_tileram[tile_index * 2] & 0x1f;
int xflip = (state->fof_txt_tileram[tile_index * 2] & 0x0020) >> 5;
@@ -93,7 +93,7 @@ static TILE_GET_INFO( get_fof_txt_tile_info )
WRITE16_HANDLER( fof_txt_tileram_w )
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
COMBINE_DATA(&state->fof_txt_tileram[offset]);
tilemap_mark_tile_dirty(state->fof_txt_tilemap, offset / 2);
@@ -103,7 +103,7 @@ WRITE16_HANDLER( fof_txt_tileram_w )
VIDEO_START(fitfight)
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->fof_bak_tilemap = tilemap_create(machine, get_fof_bak_tile_info, tilemap_scan_cols, 8, 8, 128, 32);
/* opaque */
@@ -116,7 +116,7 @@ VIDEO_START(fitfight)
SCREEN_UPDATE(fitfight)
{
- fitfight_state *state = screen->machine->driver_data<fitfight_state>();
+ fitfight_state *state = screen->machine().driver_data<fitfight_state>();
/* scroll isn't right */
@@ -126,15 +126,15 @@ SCREEN_UPDATE(fitfight)
vblank = (state->fof_700000[0] & 0x8000);
if (vblank > 0)
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
else {
-// if (input_code_pressed(screen->machine, KEYCODE_Q))
+// if (input_code_pressed(screen->machine(), KEYCODE_Q))
// scrollbak = ((state->fof_a00000[0] & 0xff00) >> 5) - ((state->fof_700000[0] & 0x0038) >> 3);
-// else if (input_code_pressed(screen->machine, KEYCODE_W))
+// else if (input_code_pressed(screen->machine(), KEYCODE_W))
// scrollbak = ((state->fof_a00000[0] & 0xff00) >> 5) + ((state->fof_700000[0] & 0x01c0) >> 6);
-// else if (input_code_pressed(screen->machine, KEYCODE_E))
+// else if (input_code_pressed(screen->machine(), KEYCODE_E))
// scrollbak = ((state->fof_a00000[0] & 0xff00) >> 5) - ((state->fof_700000[0] & 0x01c0) >> 6);
-// else if (input_code_pressed(screen->machine, KEYCODE_R))
+// else if (input_code_pressed(screen->machine(), KEYCODE_R))
// scrollbak = ((state->fof_a00000[0] & 0xff00) >> 5) + ((state->fof_700000[0] & 0x0038) >> 3);
// else
scrollbak = ((state->fof_a00000[0] & 0xff00) >> 5);
@@ -142,24 +142,24 @@ SCREEN_UPDATE(fitfight)
tilemap_set_scrolly(state->fof_bak_tilemap,0, state->fof_a00000[0] & 0xff);
tilemap_draw(bitmap, cliprect, state->fof_bak_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
-// if (input_code_pressed(screen->machine, KEYCODE_A))
+// if (input_code_pressed(screen->machine(), KEYCODE_A))
// scrollmid = ((state->fof_900000[0] & 0xff00) >> 5) - ((state->fof_700000[0] & 0x01c0) >> 6);
-// else if (input_code_pressed(screen->machine, KEYCODE_S))
+// else if (input_code_pressed(screen->machine(), KEYCODE_S))
// scrollmid = ((state->fof_900000[0] & 0xff00) >> 5) + ((state->fof_700000[0] & 0x0038) >> 3);
-// else if (input_code_pressed(screen->machine, KEYCODE_D))
+// else if (input_code_pressed(screen->machine(), KEYCODE_D))
// scrollmid = ((state->fof_900000[0] & 0xff00) >> 5) - ((state->fof_700000[0] & 0x0038) >> 3);
-// else if (input_code_pressed(screen->machine, KEYCODE_F))
+// else if (input_code_pressed(screen->machine(), KEYCODE_F))
// scrollmid = ((state->fof_900000[0] & 0xff00) >> 5) + ((state->fof_700000[0] & 0x01c0) >> 6);
// else
scrollmid = ((state->fof_900000[0] & 0xff00) >> 5);
tilemap_set_scrollx(state->fof_mid_tilemap, 0, scrollmid );
tilemap_set_scrolly(state->fof_mid_tilemap, 0, state->fof_900000[0] & 0xff);
-// if (!input_code_pressed(screen->machine, KEYCODE_F))
+// if (!input_code_pressed(screen->machine(), KEYCODE_F))
tilemap_draw(bitmap, cliprect, state->fof_mid_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fof_txt_tilemap, 0, 0);
}
diff --git a/src/mame/video/flkatck.c b/src/mame/video/flkatck.c
index 813293a452b..9adb4e750f4 100644
--- a/src/mame/video/flkatck.c
+++ b/src/mame/video/flkatck.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_tile_info_A )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
UINT8 ctrl_0 = k007121_ctrlram_r(state->k007121, 0);
UINT8 ctrl_2 = k007121_ctrlram_r(state->k007121, 2);
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121, 3);
@@ -51,7 +51,7 @@ static TILE_GET_INFO( get_tile_info_A )
static TILE_GET_INFO( get_tile_info_B )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
int attr = state->k007121_ram[tile_index + 0x800];
int code = state->k007121_ram[tile_index + 0xc00];
@@ -71,7 +71,7 @@ static TILE_GET_INFO( get_tile_info_B )
VIDEO_START( flkatck )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
state->k007121_tilemap[0] = tilemap_create(machine, get_tile_info_A, tilemap_scan_rows, 8, 8, 32, 32);
state->k007121_tilemap[1] = tilemap_create(machine, get_tile_info_B, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -85,7 +85,7 @@ VIDEO_START( flkatck )
WRITE8_HANDLER( flkatck_k007121_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
state->k007121_ram[offset] = data;
if (offset < 0x1000) /* tiles */
@@ -99,18 +99,18 @@ WRITE8_HANDLER( flkatck_k007121_w )
WRITE8_HANDLER( flkatck_k007121_regs_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
switch (offset)
{
case 0x04: /* ROM bank select */
if (data != k007121_ctrlram_r(state->k007121, 4))
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
break;
case 0x07: /* flip screen + IRQ control */
state->flipscreen = data & 0x08;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
state->irq_enabled = data & 0x02;
break;
}
@@ -134,7 +134,7 @@ WRITE8_HANDLER( flkatck_k007121_regs_w )
SCREEN_UPDATE( flkatck )
{
- flkatck_state *state = screen->machine->driver_data<flkatck_state>();
+ flkatck_state *state = screen->machine().driver_data<flkatck_state>();
rectangle clip[2];
const rectangle &visarea = screen->visible_area();
@@ -170,7 +170,7 @@ SCREEN_UPDATE( flkatck )
/* draw the graphics */
tilemap_draw(bitmap, &clip[0], state->k007121_tilemap[0], 0, 0);
- k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine->gfx[0], NULL, &state->k007121_ram[0x1000], 0, 40, 0, (UINT32)-1);
+ k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine().gfx[0], NULL, &state->k007121_ram[0x1000], 0, 40, 0, (UINT32)-1);
tilemap_draw(bitmap, &clip[1], state->k007121_tilemap[1], 0, 0);
return 0;
}
diff --git a/src/mame/video/flower.c b/src/mame/video/flower.c
index aceaaedac41..563f2a7c10b 100644
--- a/src/mame/video/flower.c
+++ b/src/mame/video/flower.c
@@ -9,7 +9,7 @@ PALETTE_INIT( flower )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -18,17 +18,17 @@ PALETTE_INIT( flower )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- flower_state *state = machine->driver_data<flower_state>();
- const gfx_element *gfx = machine->gfx[1];
+ flower_state *state = machine.driver_data<flower_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *source = state->spriteram + 0x200;
UINT8 *finish = source - 0x200;
@@ -119,7 +119,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TILE_GET_INFO( get_bg0_tile_info )
{
- flower_state *state = machine->driver_data<flower_state>();
+ flower_state *state = machine.driver_data<flower_state>();
int code = state->bg0ram[tile_index];
int color = state->bg0ram[tile_index+0x100];
/* Todo - may be tile flip bits? */
@@ -129,7 +129,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- flower_state *state = machine->driver_data<flower_state>();
+ flower_state *state = machine.driver_data<flower_state>();
int code = state->bg1ram[tile_index];
int color = state->bg1ram[tile_index+0x100];
/* Todo - may be tile flip bits? */
@@ -139,7 +139,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- flower_state *state = machine->driver_data<flower_state>();
+ flower_state *state = machine.driver_data<flower_state>();
int code = state->textram[tile_index];
int color = state->textram[tile_index+0x400];
/* Todo - may be tile flip bits? */
@@ -149,7 +149,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START(flower)
{
- flower_state *state = machine->driver_data<flower_state>();
+ flower_state *state = machine.driver_data<flower_state>();
state->bg0_tilemap = tilemap_create(machine, get_bg0_tile_info, tilemap_scan_rows, 16,16,16,16);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info, tilemap_scan_rows,16,16,16,16);
state->text_tilemap = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows, 8, 8,32,32);
@@ -165,7 +165,7 @@ VIDEO_START(flower)
SCREEN_UPDATE( flower )
{
- flower_state *state = screen->machine->driver_data<flower_state>();
+ flower_state *state = screen->machine().driver_data<flower_state>();
rectangle myclip = *cliprect;
tilemap_set_scrolly(state->bg0_tilemap,0, state->bg0_scroll[0]+16);
@@ -174,9 +174,9 @@ SCREEN_UPDATE( flower )
tilemap_draw(bitmap,cliprect,state->bg0_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->bg1_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
- if(flip_screen_get(screen->machine))
+ if(flip_screen_get(screen->machine()))
{
myclip.min_x = cliprect->min_x;
myclip.max_x = cliprect->min_x + 15;
@@ -194,7 +194,7 @@ SCREEN_UPDATE( flower )
WRITE8_HANDLER( flower_textram_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty(state->text_tilemap, offset);
tilemap_mark_all_tiles_dirty(state->text_right_tilemap);
@@ -202,19 +202,19 @@ WRITE8_HANDLER( flower_textram_w )
WRITE8_HANDLER( flower_bg0ram_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
state->bg0ram[offset] = data;
tilemap_mark_tile_dirty(state->bg0_tilemap, offset & 0x1ff);
}
WRITE8_HANDLER( flower_bg1ram_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
state->bg1ram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap, offset & 0x1ff);
}
WRITE8_HANDLER( flower_flipscreen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c
index 3dec0178c88..bb789ee42ad 100644
--- a/src/mame/video/flstory.c
+++ b/src/mame/video/flstory.c
@@ -11,7 +11,7 @@
static TILE_GET_INFO( get_tile_info )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int code = state->videoram[tile_index * 2];
int attr = state->videoram[tile_index * 2 + 1];
int tile_number = code + ((attr & 0xc0) << 2) + 0x400 + 0x800 * state->char_bank;
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_tile_info )
static TILE_GET_INFO( victnine_get_tile_info )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int code = state->videoram[tile_index * 2];
int attr = state->videoram[tile_index * 2 + 1];
int tile_number = ((attr & 0x38) << 5) + code;
@@ -42,7 +42,7 @@ static TILE_GET_INFO( victnine_get_tile_info )
static TILE_GET_INFO( get_rumba_tile_info )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int code = state->videoram[tile_index * 2];
int attr = state->videoram[tile_index * 2 + 1];
int tile_number = code + ((attr & 0xc0) << 2) + 0x400 + 0x800 * state->char_bank;
@@ -59,56 +59,56 @@ static TILE_GET_INFO( get_rumba_tile_info )
VIDEO_START( flstory )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
// tilemap_set_transparent_pen(state->bg_tilemap, 15);
tilemap_set_transmask(state->bg_tilemap, 0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
tilemap_set_transmask(state->bg_tilemap, 1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
tilemap_set_scroll_cols(state->bg_tilemap, 32);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram2.u8, 0x200);
}
VIDEO_START( rumba )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
state->bg_tilemap = tilemap_create(machine, get_rumba_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
// tilemap_set_transparent_pen(state->bg_tilemap, 15);
tilemap_set_transmask(state->bg_tilemap, 0, 0x3fff, 0xc000); /* split type 0 has pens 0-13 transparent in front half */
tilemap_set_transmask(state->bg_tilemap, 1, 0x8000, 0x7fff); /* split type 1 has pen 15 transparent in front half */
tilemap_set_scroll_cols(state->bg_tilemap, 32);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram2.u8, 0x200);
}
VIDEO_START( victnine )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
state->bg_tilemap = tilemap_create(machine, victnine_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram2.u8, 0x200);
}
WRITE8_HANDLER( flstory_videoram_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( flstory_palette_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
if (offset & 0x100)
paletteram_xxxxBBBBGGGGRRRR_split2_w(space, (offset & 0xff) + (state->palette_bank << 8),data);
else
@@ -117,16 +117,16 @@ WRITE8_HANDLER( flstory_palette_w )
READ8_HANDLER( flstory_palette_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
if (offset & 0x100)
- return space->machine->generic.paletteram2.u8[ (offset & 0xff) + (state->palette_bank << 8) ];
+ return space->machine().generic.paletteram2.u8[ (offset & 0xff) + (state->palette_bank << 8) ];
else
- return space->machine->generic.paletteram.u8 [ (offset & 0xff) + (state->palette_bank << 8) ];
+ return space->machine().generic.paletteram.u8 [ (offset & 0xff) + (state->palette_bank << 8) ];
}
WRITE8_HANDLER( flstory_gfxctrl_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
if (state->gfxctrl == data)
return;
state->gfxctrl = data;
@@ -139,7 +139,7 @@ WRITE8_HANDLER( flstory_gfxctrl_w )
}
state->palette_bank = (data & 0x20) >> 5;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
//popmessage("%04x: gfxctrl = %02x\n", cpu_get_pc(space->cpu), data);
@@ -147,13 +147,13 @@ WRITE8_HANDLER( flstory_gfxctrl_w )
READ8_HANDLER( victnine_gfxctrl_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
return state->gfxctrl;
}
WRITE8_HANDLER( victnine_gfxctrl_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
if (state->gfxctrl == data)
return;
state->gfxctrl = data;
@@ -163,7 +163,7 @@ WRITE8_HANDLER( victnine_gfxctrl_w )
if (data & 0x04)
{
state->flipscreen = (data & 0x01);
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
}
//popmessage("%04x: gfxctrl = %02x\n", cpu_get_pc(space->cpu), data);
@@ -172,15 +172,15 @@ WRITE8_HANDLER( victnine_gfxctrl_w )
WRITE8_HANDLER( flstory_scrlram_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->scrlram[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, offset, data);
}
-static void flstory_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int i;
for (i = 0; i < 0x20; i++)
@@ -207,14 +207,14 @@ static void flstory_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
flipx = ((state->spriteram[offs + 1] & 0x40) >> 6) ^ state->flipscreen;
flipy = ((state->spriteram[offs + 1] & 0x80) >> 7) ^ state->flipscreen;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
state->spriteram[offs + 1] & 0x0f,
flipx,flipy,
sx,sy,15);
/* wrap around */
if (sx > 240)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
state->spriteram[offs + 1] & 0x0f,
flipx,flipy,
@@ -225,19 +225,19 @@ static void flstory_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( flstory )
{
- flstory_state *state = screen->machine->driver_data<flstory_state>();
+ flstory_state *state = screen->machine().driver_data<flstory_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0);
- flstory_draw_sprites(screen->machine, bitmap, cliprect, 0x00);
+ flstory_draw_sprites(screen->machine(), bitmap, cliprect, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0);
- flstory_draw_sprites(screen->machine, bitmap, cliprect, 0x80);
+ flstory_draw_sprites(screen->machine(), bitmap, cliprect, 0x80);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1 | TILEMAP_DRAW_LAYER0, 0);
return 0;
}
-static void victnine_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int i;
for (i = 0; i < 0x20; i++)
@@ -264,14 +264,14 @@ static void victnine_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
flipx = ((state->spriteram[offs + 1] & 0x40) >> 6) ^ state->flipscreen;
flipy = ((state->spriteram[offs + 1] & 0x80) >> 7) ^ state->flipscreen;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
state->spriteram[offs + 1] & 0x0f,
flipx,flipy,
sx,sy,15);
/* wrap around */
if (sx > 240)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
state->spriteram[offs + 1] & 0x0f,
flipx,flipy,
@@ -282,20 +282,20 @@ static void victnine_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( victnine )
{
- flstory_state *state = screen->machine->driver_data<flstory_state>();
+ flstory_state *state = screen->machine().driver_data<flstory_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- victnine_draw_sprites(screen->machine, bitmap, cliprect);
+ victnine_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( rumba )
{
- flstory_state *state = screen->machine->driver_data<flstory_state>();
+ flstory_state *state = screen->machine().driver_data<flstory_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0);
- victnine_draw_sprites(screen->machine, bitmap, cliprect);
+ victnine_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0 | TILEMAP_DRAW_LAYER0, 0);
- victnine_draw_sprites(screen->machine, bitmap, cliprect);
+ victnine_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1 | TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/foodf.c b/src/mame/video/foodf.c
index dbfd470f0c1..907b59d291e 100644
--- a/src/mame/video/foodf.c
+++ b/src/mame/video/foodf.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
UINT16 data = state->playfield[tile_index];
int code = (data & 0xff) | ((data >> 7) & 0x100);
int color = (data >> 8) & 0x3f;
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
VIDEO_START( foodf )
{
static const int resistances[3] = { 1000, 470, 220 };
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 32,32);
@@ -79,11 +79,11 @@ void foodf_set_flip(foodf_state *state, int flip)
WRITE16_HANDLER( foodf_paletteram_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
int newword, r, g, b, bit0, bit1, bit2;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
/* only the bottom 8 bits are used */
/* red component */
@@ -103,7 +103,7 @@ WRITE16_HANDLER( foodf_paletteram_w )
bit1 = (newword >> 7) & 0x01;
b = combine_2_weights(state->bweights, bit0, bit1);
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
@@ -116,10 +116,10 @@ WRITE16_HANDLER( foodf_paletteram_w )
SCREEN_UPDATE( foodf )
{
- foodf_state *state = screen->machine->driver_data<foodf_state>();
+ foodf_state *state = screen->machine().driver_data<foodf_state>();
int offs;
- const gfx_element *gfx = screen->machine->gfx[1];
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ const gfx_element *gfx = screen->machine().gfx[1];
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
UINT16 *spriteram16 = state->spriteram;
/* first draw the playfield opaquely */
diff --git a/src/mame/video/freekick.c b/src/mame/video/freekick.c
index d5a0ed28517..28d8a639223 100644
--- a/src/mame/video/freekick.c
+++ b/src/mame/video/freekick.c
@@ -6,7 +6,7 @@
static TILE_GET_INFO( get_freek_tile_info )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
int tileno, palno;
tileno = state->videoram[tile_index] + ((state->videoram[tile_index + 0x400] & 0xe0) << 3);
@@ -17,21 +17,21 @@ static TILE_GET_INFO( get_freek_tile_info )
VIDEO_START( freekick )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->freek_tilemap = tilemap_create(machine, get_freek_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
WRITE8_HANDLER( freek_videoram_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->freek_tilemap, offset & 0x3ff);
}
-static void gigas_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void gigas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -55,7 +55,7 @@ static void gigas_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -64,9 +64,9 @@ static void gigas_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
}
-static void pbillrd_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void pbillrd_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -90,7 +90,7 @@ static void pbillrd_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -100,9 +100,9 @@ static void pbillrd_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
-static void freekick_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -126,7 +126,7 @@ static void freekick_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -136,24 +136,24 @@ static void freekick_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( gigas )
{
- freekick_state *state = screen->machine->driver_data<freekick_state>();
+ freekick_state *state = screen->machine().driver_data<freekick_state>();
tilemap_draw(bitmap, cliprect, state->freek_tilemap, 0, 0);
- gigas_draw_sprites(screen->machine, bitmap, cliprect);
+ gigas_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( pbillrd )
{
- freekick_state *state = screen->machine->driver_data<freekick_state>();
+ freekick_state *state = screen->machine().driver_data<freekick_state>();
tilemap_draw(bitmap, cliprect, state->freek_tilemap, 0, 0);
- pbillrd_draw_sprites(screen->machine, bitmap, cliprect);
+ pbillrd_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( freekick )
{
- freekick_state *state = screen->machine->driver_data<freekick_state>();
+ freekick_state *state = screen->machine().driver_data<freekick_state>();
tilemap_draw(bitmap, cliprect, state->freek_tilemap, 0, 0);
- freekick_draw_sprites(screen->machine, bitmap, cliprect);
+ freekick_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/fromanc2.c b/src/mame/video/fromanc2.c
index 419bfd0e0af..e2794644714 100644
--- a/src/mame/video/fromanc2.c
+++ b/src/mame/video/fromanc2.c
@@ -15,9 +15,9 @@
******************************************************************************/
-INLINE void fromanc2_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int vram, int layer )
+INLINE void fromanc2_get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int vram, int layer )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
int tile, color;
tile = (state->videoram[vram][layer][tile_index] & 0x3fff) | (state->gfxbank[vram][layer] << 14);
@@ -36,9 +36,9 @@ static TILE_GET_INFO( fromanc2_get_v1_l2_tile_info ) { fromanc2_get_tile_info(ma
static TILE_GET_INFO( fromanc2_get_v1_l3_tile_info ) { fromanc2_get_tile_info(machine, tileinfo, tile_index, 1, 3); }
-INLINE void fromancr_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int vram, int layer )
+INLINE void fromancr_get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int vram, int layer )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
int tile, color;
tile = state->videoram[vram][layer][tile_index] | (state->gfxbank[vram][layer] << 16);
@@ -63,132 +63,132 @@ static TILE_GET_INFO( fromancr_get_v1_l2_tile_info ) { fromancr_get_tile_info(ma
READ16_HANDLER( fromanc2_paletteram_0_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[0][offset];
}
READ16_HANDLER( fromanc2_paletteram_1_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[1][offset];
}
WRITE16_HANDLER( fromanc2_paletteram_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[0][offset]);
// GGGG_GRRR_RRBB_BBBx
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x000 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
+ palette_set_color_rgb(space->machine(), 0x000 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
}
WRITE16_HANDLER( fromanc2_paletteram_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[1][offset]);
// GGGG_GRRR_RRBB_BBBx
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x100 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
+ palette_set_color_rgb(space->machine(), 0x100 + color, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
}
READ16_HANDLER( fromancr_paletteram_0_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[0][offset];
}
READ16_HANDLER( fromancr_paletteram_1_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[1][offset];
}
WRITE16_HANDLER( fromancr_paletteram_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[0][offset]);
// xGGG_GGRR_RRRB_BBBB
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x000 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), 0x000 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
}
WRITE16_HANDLER( fromancr_paletteram_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[1][offset]);
// xGGG_GGRR_RRRB_BBBB
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x100 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), 0x100 + color, pal5bit(data >> 5), pal5bit(data >> 10), pal5bit(data >> 0));
}
READ16_HANDLER( fromanc4_paletteram_0_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[0][offset];
}
READ16_HANDLER( fromanc4_paletteram_1_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->paletteram[1][offset];
}
WRITE16_HANDLER( fromanc4_paletteram_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[0][offset]);
// xRRR_RRGG_GGGB_BBBB
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x000 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), 0x000 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
WRITE16_HANDLER( fromanc4_paletteram_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 color;
COMBINE_DATA(&state->paletteram[1][offset]);
// xRRR_RRGG_GGGB_BBBB
color = ((offset & 0x0700) << 1) + (offset & 0x00ff);
- palette_set_color_rgb(space->machine, 0x100 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), 0x100 + color, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
-INLINE void fromanc2_dispvram_w( running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int vram, int layer )
+INLINE void fromanc2_dispvram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int vram, int layer )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
layer += (offset < 0x1000) ? 0 : 1;
COMBINE_DATA(&state->videoram[vram][layer][offset & 0x0fff]);
tilemap_mark_tile_dirty(state->tilemap[vram][layer], offset & 0x0fff);
}
-WRITE16_HANDLER( fromanc2_videoram_0_w ) { fromanc2_dispvram_w(space->machine, offset, data, mem_mask, 0, 0); }
-WRITE16_HANDLER( fromanc2_videoram_1_w ) { fromanc2_dispvram_w(space->machine, offset, data, mem_mask, 0, 2); }
-WRITE16_HANDLER( fromanc2_videoram_2_w ) { fromanc2_dispvram_w(space->machine, offset, data, mem_mask, 1, 0); }
-WRITE16_HANDLER( fromanc2_videoram_3_w ) { fromanc2_dispvram_w(space->machine, offset, data, mem_mask, 1, 2); }
+WRITE16_HANDLER( fromanc2_videoram_0_w ) { fromanc2_dispvram_w(space->machine(), offset, data, mem_mask, 0, 0); }
+WRITE16_HANDLER( fromanc2_videoram_1_w ) { fromanc2_dispvram_w(space->machine(), offset, data, mem_mask, 0, 2); }
+WRITE16_HANDLER( fromanc2_videoram_2_w ) { fromanc2_dispvram_w(space->machine(), offset, data, mem_mask, 1, 0); }
+WRITE16_HANDLER( fromanc2_videoram_3_w ) { fromanc2_dispvram_w(space->machine(), offset, data, mem_mask, 1, 2); }
WRITE16_HANDLER( fromanc2_gfxreg_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][0] = -(data - 0x000); break;
@@ -202,7 +202,7 @@ WRITE16_HANDLER( fromanc2_gfxreg_0_w )
WRITE16_HANDLER( fromanc2_gfxreg_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[1][0] = -(data - 0x1be); break;
@@ -216,7 +216,7 @@ WRITE16_HANDLER( fromanc2_gfxreg_1_w )
WRITE16_HANDLER( fromanc2_gfxreg_2_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][2] = -(data - 0x1c0); break;
@@ -230,7 +230,7 @@ WRITE16_HANDLER( fromanc2_gfxreg_2_w )
WRITE16_HANDLER( fromanc2_gfxreg_3_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[1][2] = -(data - 0x1bf); break;
@@ -244,7 +244,7 @@ WRITE16_HANDLER( fromanc2_gfxreg_3_w )
WRITE16_HANDLER( fromanc2_gfxbank_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->gfxbank[0][0] = (data & 0x000f) >> 0;
state->gfxbank[0][1] = (data & 0x00f0) >> 4;
state->gfxbank[0][2] = (data & 0x0f00) >> 8;
@@ -257,7 +257,7 @@ WRITE16_HANDLER( fromanc2_gfxbank_0_w )
WRITE16_HANDLER( fromanc2_gfxbank_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->gfxbank[1][0] = (data & 0x000f) >> 0;
state->gfxbank[1][1] = (data & 0x00f0) >> 4;
state->gfxbank[1][2] = (data & 0x0f00) >> 8;
@@ -269,22 +269,22 @@ WRITE16_HANDLER( fromanc2_gfxbank_1_w )
}
-INLINE void fromancr_vram_w(running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer )
+INLINE void fromancr_vram_w(running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
int vram = (offset < 0x1000) ? 0 : 1;
COMBINE_DATA(&state->videoram[vram][layer][offset & 0x0fff]);
tilemap_mark_tile_dirty(state->tilemap[vram][layer], offset & 0x0fff);
}
-WRITE16_HANDLER( fromancr_videoram_0_w ) { fromancr_vram_w(space->machine, offset, data, mem_mask, 1); }
-WRITE16_HANDLER( fromancr_videoram_1_w ) { fromancr_vram_w(space->machine, offset, data, mem_mask, 0); }
-WRITE16_HANDLER( fromancr_videoram_2_w ) { fromancr_vram_w(space->machine, offset, data, mem_mask, 2); }
+WRITE16_HANDLER( fromancr_videoram_0_w ) { fromancr_vram_w(space->machine(), offset, data, mem_mask, 1); }
+WRITE16_HANDLER( fromancr_videoram_1_w ) { fromancr_vram_w(space->machine(), offset, data, mem_mask, 0); }
+WRITE16_HANDLER( fromancr_videoram_2_w ) { fromancr_vram_w(space->machine(), offset, data, mem_mask, 2); }
WRITE16_HANDLER( fromancr_gfxreg_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][0] = -(data - 0x1bf); break;
@@ -298,7 +298,7 @@ WRITE16_HANDLER( fromancr_gfxreg_0_w )
WRITE16_HANDLER( fromancr_gfxreg_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][1] = -(data - 0x000); break;
@@ -310,9 +310,9 @@ WRITE16_HANDLER( fromancr_gfxreg_1_w )
}
}
-void fromancr_gfxbank_w( running_machine *machine, int data )
+void fromancr_gfxbank_w( running_machine &machine, int data )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->gfxbank[0][0] = (data & 0x0010) >> 4; // BG (1P)
state->gfxbank[0][1] = (data & 0xf000) >> 12; // FG (1P)
@@ -325,22 +325,22 @@ void fromancr_gfxbank_w( running_machine *machine, int data )
}
-INLINE void fromanc4_vram_w( running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer )
+INLINE void fromanc4_vram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
int vram = (offset < 0x4000) ? 0 : 1;
COMBINE_DATA(&state->videoram[vram][layer][offset & 0x3fff]);
tilemap_mark_tile_dirty(state->tilemap[vram][layer], offset & 0x3fff);
}
-WRITE16_HANDLER( fromanc4_videoram_0_w ) { fromanc4_vram_w(space->machine, offset, data, mem_mask, 2); }
-WRITE16_HANDLER( fromanc4_videoram_1_w ) { fromanc4_vram_w(space->machine, offset, data, mem_mask, 1); }
-WRITE16_HANDLER( fromanc4_videoram_2_w ) { fromanc4_vram_w(space->machine, offset, data, mem_mask, 0); }
+WRITE16_HANDLER( fromanc4_videoram_0_w ) { fromanc4_vram_w(space->machine(), offset, data, mem_mask, 2); }
+WRITE16_HANDLER( fromanc4_videoram_1_w ) { fromanc4_vram_w(space->machine(), offset, data, mem_mask, 1); }
+WRITE16_HANDLER( fromanc4_videoram_2_w ) { fromanc4_vram_w(space->machine(), offset, data, mem_mask, 0); }
WRITE16_HANDLER( fromanc4_gfxreg_0_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][2] = -(data - 0xfbb); break;
@@ -359,7 +359,7 @@ WRITE16_HANDLER( fromanc4_gfxreg_0_w )
WRITE16_HANDLER( fromanc4_gfxreg_1_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][1] = -(data - 0xfba); break;
@@ -378,7 +378,7 @@ WRITE16_HANDLER( fromanc4_gfxreg_1_w )
WRITE16_HANDLER( fromanc4_gfxreg_2_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
switch (offset)
{
case 0x00: state->scrollx[0][0] = -(data - 0xfbb); break;
@@ -404,7 +404,7 @@ WRITE16_HANDLER( fromanc4_gfxreg_2_w )
VIDEO_START( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->tilemap[0][0] = tilemap_create(machine, fromanc2_get_v0_l0_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->tilemap[0][1] = tilemap_create(machine, fromanc2_get_v0_l1_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -454,7 +454,7 @@ VIDEO_START( fromanc2 )
VIDEO_START( fromancr )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->tilemap[0][0] = tilemap_create(machine, fromancr_get_v0_l0_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->tilemap[0][1] = tilemap_create(machine, fromancr_get_v0_l1_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -499,7 +499,7 @@ VIDEO_START( fromancr )
VIDEO_START( fromanc4 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->tilemap[0][0] = tilemap_create(machine, fromancr_get_v0_l0_tile_info, tilemap_scan_rows, 8, 8, 256, 64);
state->tilemap[0][1] = tilemap_create(machine, fromancr_get_v0_l1_tile_info, tilemap_scan_rows, 8, 8, 256, 64);
@@ -549,7 +549,7 @@ VIDEO_START( fromanc4 )
SCREEN_UPDATE( fromanc2 )
{
- fromanc2_state *state = screen->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = screen->machine().driver_data<fromanc2_state>();
int i;
int *scrollx = NULL;
int *scrolly = NULL;
diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c
index c8bc118caa4..b03d5621716 100644
--- a/src/mame/video/fromance.c
+++ b/src/mame/video/fromance.c
@@ -19,9 +19,9 @@ static TIMER_CALLBACK( crtc_interrupt_gen );
*
*************************************/
-INLINE void get_fromance_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int layer )
+INLINE void get_fromance_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int layer )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
int tile = ((state->local_videoram[layer][0x0000 + tile_index] & 0x80) << 9) |
(state->local_videoram[layer][0x1000 + tile_index] << 8) |
state->local_videoram[layer][0x2000 + tile_index];
@@ -34,9 +34,9 @@ static TILE_GET_INFO( get_fromance_bg_tile_info ) { get_fromance_tile_info(machi
static TILE_GET_INFO( get_fromance_fg_tile_info ) { get_fromance_tile_info(machine, tileinfo, tile_index, 1); }
-INLINE void get_nekkyoku_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int layer )
+INLINE void get_nekkyoku_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int layer )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
int tile = (state->local_videoram[layer][0x0000 + tile_index] << 8) |
state->local_videoram[layer][0x1000 + tile_index];
int color = state->local_videoram[layer][tile_index + 0x2000] & 0x3f;
@@ -55,9 +55,9 @@ static TILE_GET_INFO( get_nekkyoku_fg_tile_info ) { get_nekkyoku_tile_info(machi
*
*************************************/
-static void init_common( running_machine *machine )
+static void init_common( running_machine &machine )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
/* allocate local videoram */
state->local_videoram[0] = auto_alloc_array(machine, UINT8, 0x1000 * 3);
@@ -70,7 +70,7 @@ static void init_common( running_machine *machine )
tilemap_set_transparent_pen(state->fg_tilemap, 15);
/* reset the timer */
- state->crtc_timer = machine->scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
+ state->crtc_timer = machine.scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
/* state save */
state->save_item(NAME(state->selected_videoram));
@@ -91,7 +91,7 @@ static void init_common( running_machine *machine )
VIDEO_START( fromance )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
/* allocate tilemaps */
state->bg_tilemap = tilemap_create(machine, get_fromance_bg_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
@@ -102,7 +102,7 @@ VIDEO_START( fromance )
VIDEO_START( nekkyoku )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
/* allocate tilemaps */
state->bg_tilemap = tilemap_create(machine, get_nekkyoku_bg_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
@@ -113,7 +113,7 @@ VIDEO_START( nekkyoku )
VIDEO_START( pipedrm )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
VIDEO_START_CALL(fromance);
state->scrolly_ofs = 0x00;
@@ -121,7 +121,7 @@ VIDEO_START( pipedrm )
VIDEO_START( hatris )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
VIDEO_START_CALL(fromance);
state->scrollx_ofs = 0xB9;
@@ -136,7 +136,7 @@ VIDEO_START( hatris )
WRITE8_HANDLER( fromance_gfxreg_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->gfxreg = data;
state->flipscreen = (data & 0x01);
@@ -146,7 +146,7 @@ WRITE8_HANDLER( fromance_gfxreg_w )
if (state->flipscreen != state->flipscreen_old)
{
state->flipscreen_old = state->flipscreen;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
}
@@ -160,7 +160,7 @@ WRITE8_HANDLER( fromance_gfxreg_w )
READ8_HANDLER( fromance_paletteram_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
/* adjust for banking and read */
offset |= state->selected_paletteram << 11;
@@ -170,7 +170,7 @@ READ8_HANDLER( fromance_paletteram_r )
WRITE8_HANDLER( fromance_paletteram_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
int palword;
/* adjust for banking and modify */
@@ -179,7 +179,7 @@ WRITE8_HANDLER( fromance_paletteram_w )
/* compute R,G,B */
palword = (state->local_paletteram[offset | 1] << 8) | state->local_paletteram[offset & ~1];
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(palword >> 10), pal5bit(palword >> 5), pal5bit(palword >> 0));
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(palword >> 10), pal5bit(palword >> 5), pal5bit(palword >> 0));
}
@@ -192,14 +192,14 @@ WRITE8_HANDLER( fromance_paletteram_w )
READ8_HANDLER( fromance_videoram_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
return state->local_videoram[state->selected_videoram][offset];
}
WRITE8_HANDLER( fromance_videoram_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->local_videoram[state->selected_videoram][offset] = data;
tilemap_mark_tile_dirty(state->selected_videoram ? state->fg_tilemap : state->bg_tilemap, offset & 0x0fff);
}
@@ -214,7 +214,7 @@ WRITE8_HANDLER( fromance_videoram_w )
WRITE8_HANDLER( fromance_scroll_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
if (state->flipscreen)
{
switch (offset)
@@ -263,23 +263,23 @@ WRITE8_HANDLER( fromance_scroll_w )
static TIMER_CALLBACK( crtc_interrupt_gen )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
device_set_input_line(state->subcpu, 0, HOLD_LINE);
if (param != 0)
- state->crtc_timer->adjust(machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param);
+ state->crtc_timer->adjust(machine.primary_screen->frame_period() / param, 0, machine.primary_screen->frame_period() / param);
}
WRITE8_HANDLER( fromance_crtc_data_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->crtc_data[state->crtc_register] = data;
switch (state->crtc_register)
{
/* only register we know about.... */
case 0x0b:
- state->crtc_timer->adjust(space->machine->primary_screen->time_until_vblank_start(), (data > 0x80) ? 2 : 1);
+ state->crtc_timer->adjust(space->machine().primary_screen->time_until_vblank_start(), (data > 0x80) ? 2 : 1);
break;
default:
@@ -291,7 +291,7 @@ WRITE8_HANDLER( fromance_crtc_data_w )
WRITE8_HANDLER( fromance_crtc_register_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->crtc_register = data;
}
@@ -305,7 +305,7 @@ WRITE8_HANDLER( fromance_crtc_register_w )
static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority )
{
- fromance_state *state = screen.machine->driver_data<fromance_state>();
+ fromance_state *state = screen.machine().driver_data<fromance_state>();
static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
const rectangle &visarea = screen.visible_area();
UINT8 *spriteram = state->spriteram;
@@ -361,10 +361,10 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
for (yt = 0; yt < ytiles; yt++)
for (xt = 0; xt < xtiles; xt++, code++)
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 0, 0,
+ drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 0, 0,
x + xt * 16, y + yt * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 0, 0,
+ drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 0, 0,
x + xt * xzoom, y + yt * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -375,10 +375,10 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
for (yt = 0; yt < ytiles; yt++)
for (xt = 0; xt < xtiles; xt++, code++)
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 1, 0,
+ drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 1, 0,
x + (xtiles - 1 - xt) * 16, y + yt * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 1, 0,
+ drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 1, 0,
x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -389,10 +389,10 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
for (yt = 0; yt < ytiles; yt++)
for (xt = 0; xt < xtiles; xt++, code++)
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 0, 1,
+ drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 0, 1,
x + xt * 16, y + (ytiles - 1 - yt) * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 0, 1,
+ drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 0, 1,
x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -403,10 +403,10 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
for (yt = 0; yt < ytiles; yt++)
for (xt = 0; xt < xtiles; xt++, code++)
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 1, 1,
+ drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 1, 1,
x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, screen.machine->gfx[2], code, color, 1, 1,
+ drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], code, color, 1, 1,
x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -424,7 +424,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
SCREEN_UPDATE( fromance )
{
- fromance_state *state = screen->machine->driver_data<fromance_state>();
+ fromance_state *state = screen->machine().driver_data<fromance_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0]);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[0]);
@@ -439,7 +439,7 @@ SCREEN_UPDATE( fromance )
SCREEN_UPDATE( pipedrm )
{
- fromance_state *state = screen->machine->driver_data<fromance_state>();
+ fromance_state *state = screen->machine().driver_data<fromance_state>();
/* there seems to be no logical mapping for the X scroll register -- maybe it's gone */
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[1]);
diff --git a/src/mame/video/funkybee.c b/src/mame/video/funkybee.c
index 9ab1fb1e4aa..43045a64bc1 100644
--- a/src/mame/video/funkybee.c
+++ b/src/mame/video/funkybee.c
@@ -41,42 +41,42 @@ PALETTE_INIT( funkybee )
WRITE8_HANDLER( funkybee_videoram_w )
{
- funkybee_state *state = space->machine->driver_data<funkybee_state>();
+ funkybee_state *state = space->machine().driver_data<funkybee_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( funkybee_colorram_w )
{
- funkybee_state *state = space->machine->driver_data<funkybee_state>();
+ funkybee_state *state = space->machine().driver_data<funkybee_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( funkybee_gfx_bank_w )
{
- funkybee_state *state = space->machine->driver_data<funkybee_state>();
+ funkybee_state *state = space->machine().driver_data<funkybee_state>();
if (state->gfx_bank != (data & 0x01))
{
state->gfx_bank = data & 0x01;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( funkybee_scroll_w )
{
- funkybee_state *state = space->machine->driver_data<funkybee_state>();
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? -data : data);
+ funkybee_state *state = space->machine().driver_data<funkybee_state>();
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine()) ? -data : data);
}
WRITE8_HANDLER( funkybee_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x80) << 1);
int color = state->colorram[tile_index] & 0x03;
@@ -91,13 +91,13 @@ static TILEMAP_MAPPER( funkybee_tilemap_scan )
VIDEO_START( funkybee )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, funkybee_tilemap_scan, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
int offs;
for (offs = 0x0f; offs >= 0; offs--)
@@ -117,16 +117,16 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx = !flipx;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[2 + state->gfx_bank],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[2 + state->gfx_bank],
code, color,
flipx, flipy,
sx, sy, 0);
}
}
-static void draw_columns( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
int offs;
for (offs = 0x1f; offs >= 0; offs--)
@@ -140,7 +140,7 @@ static void draw_columns( running_machine *machine, bitmap_t *bitmap, const rect
if (flip)
sy = 248 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->gfx_bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->gfx_bank],
code, color,
flip, flip,
sx, sy,0);
@@ -153,7 +153,7 @@ static void draw_columns( running_machine *machine, bitmap_t *bitmap, const rect
if (flip)
sy = 248 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->gfx_bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->gfx_bank],
code, color,
flip, flip,
sx, sy,0);
@@ -162,9 +162,9 @@ static void draw_columns( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( funkybee )
{
- funkybee_state *state = screen->machine->driver_data<funkybee_state>();
+ funkybee_state *state = screen->machine().driver_data<funkybee_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_columns(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_columns(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/funkyjet.c b/src/mame/video/funkyjet.c
index a4aaaa1d535..9c490b52397 100644
--- a/src/mame/video/funkyjet.c
+++ b/src/mame/video/funkyjet.c
@@ -13,15 +13,15 @@
SCREEN_UPDATE( funkyjet )
{
- funkyjet_state *state = screen->machine->driver_data<funkyjet_state>();
+ funkyjet_state *state = screen->machine().driver_data<funkyjet_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 768);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
return 0;
}
diff --git a/src/mame/video/funworld.c b/src/mame/video/funworld.c
index 759def0fd54..6bdef718b7d 100644
--- a/src/mame/video/funworld.c
+++ b/src/mame/video/funworld.c
@@ -117,7 +117,7 @@ PALETTE_INIT(funworld)
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -143,14 +143,14 @@ PALETTE_INIT(funworld)
WRITE8_HANDLER( funworld_videoram_w )
{
- funworld_state *state = space->machine->driver_data<funworld_state>();
+ funworld_state *state = space->machine().driver_data<funworld_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( funworld_colorram_w )
{
- funworld_state *state = space->machine->driver_data<funworld_state>();
+ funworld_state *state = space->machine().driver_data<funworld_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -166,7 +166,7 @@ WRITE8_HANDLER( funworld_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- funworld_state *state = machine->driver_data<funworld_state>();
+ funworld_state *state = machine.driver_data<funworld_state>();
/* - bits -
7654 3210
xxxx ---- tiles color.
@@ -183,20 +183,20 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START(funworld)
{
- funworld_state *state = machine->driver_data<funworld_state>();
+ funworld_state *state = machine.driver_data<funworld_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 4, 8, 96, 29);
}
VIDEO_START(magicrd2)
{
- funworld_state *state = machine->driver_data<funworld_state>();
+ funworld_state *state = machine.driver_data<funworld_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 4, 8, 112, 34);
}
SCREEN_UPDATE(funworld)
{
- funworld_state *state = screen->machine->driver_data<funworld_state>();
+ funworld_state *state = screen->machine().driver_data<funworld_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/funybubl.c b/src/mame/video/funybubl.c
index 08bd651481c..2ed7254d768 100644
--- a/src/mame/video/funybubl.c
+++ b/src/mame/video/funybubl.c
@@ -11,7 +11,7 @@ todo - convert to tilemap
WRITE8_HANDLER ( funybubl_paldatawrite )
{
- funybubl_state *state = space->machine->driver_data<funybubl_state>();
+ funybubl_state *state = space->machine().driver_data<funybubl_state>();
int colchanged ;
UINT32 coldat;
@@ -20,7 +20,7 @@ WRITE8_HANDLER ( funybubl_paldatawrite )
coldat = state->paletteram[colchanged * 4] | (state->paletteram[colchanged * 4 + 1] << 8) |
(state->paletteram[colchanged * 4 + 2] << 16) | (state->paletteram[colchanged * 4 + 3] << 24);
- palette_set_color_rgb(space->machine, colchanged, pal6bit(coldat >> 12), pal6bit(coldat >> 0), pal6bit(coldat >> 6));
+ palette_set_color_rgb(space->machine(), colchanged, pal6bit(coldat >> 12), pal6bit(coldat >> 0), pal6bit(coldat >> 6));
}
@@ -28,9 +28,9 @@ VIDEO_START(funybubl)
{
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- funybubl_state *state = machine->driver_data<funybubl_state>();
+ funybubl_state *state = machine.driver_data<funybubl_state>();
UINT8 *source = &state->banked_vram[0x2000 - 0x20];
UINT8 *finish = source - 0x1000;
@@ -67,7 +67,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
// bits 0x40 and 0x10 not used?...
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], tile, 0, 0, 0, xpos, ypos, 255);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], tile, 0, 0, 0, xpos, ypos, 255);
source -= 0x20;
}
}
@@ -75,11 +75,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE(funybubl)
{
- funybubl_state *state = screen->machine->driver_data<funybubl_state>();
+ funybubl_state *state = screen->machine().driver_data<funybubl_state>();
int x, y, offs;
offs = 0;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* tilemap .. convert it .. banking makes it slightly more annoying but still easy */
for (y = 0; y < 32; y++)
@@ -89,15 +89,15 @@ SCREEN_UPDATE(funybubl)
int data;
data = state->banked_vram[offs] | (state->banked_vram[offs + 1] << 8);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0);
offs += 2;
}
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
#if 0
- if ( input_code_pressed_once(screen->machine, KEYCODE_W) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_W) )
{
FILE *fp;
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index 5cf9ff136a1..9eda74ba26f 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -48,7 +48,7 @@
\
static TILE_GET_INFO( get_tile_info_##_N_ ) \
{ \
- fuuki16_state *state = machine->driver_data<fuuki16_state>(); \
+ fuuki16_state *state = machine.driver_data<fuuki16_state>(); \
UINT16 code = state->vram_##_N_[2 * tile_index + 0]; \
UINT16 attr = state->vram_##_N_[2 * tile_index + 1]; \
SET_TILE_INFO(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); \
@@ -56,7 +56,7 @@ static TILE_GET_INFO( get_tile_info_##_N_ ) \
\
WRITE16_HANDLER( fuuki16_vram_##_N_##_w ) \
{ \
- fuuki16_state *state = space->machine->driver_data<fuuki16_state>(); \
+ fuuki16_state *state = space->machine().driver_data<fuuki16_state>(); \
COMBINE_DATA(&state->vram_##_N_[offset]); \
tilemap_mark_tile_dirty(state->tilemap_##_N_, offset / 2); \
}
@@ -83,14 +83,14 @@ PALETTE_INIT( fuuki16 )
/* The game does not initialise the palette at startup. It should
be totally black */
- for (pen = 0; pen < machine->total_colors(); pen++)
+ for (pen = 0; pen < machine.total_colors(); pen++)
palette_set_color(machine,pen,MAKE_RGB(0,0,0));
}
#endif
VIDEO_START( fuuki16 )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 16, 16, 64, 32);
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 16, 16, 64, 32);
state->tilemap_2 = tilemap_create(machine, get_tile_info_2, tilemap_scan_rows, 8, 8, 64, 32);
@@ -101,7 +101,7 @@ VIDEO_START( fuuki16 )
tilemap_set_transparent_pen(state->tilemap_2, 0x0f); // 4 bits
tilemap_set_transparent_pen(state->tilemap_3, 0x0f); // 4 bits
- machine->gfx[2]->color_granularity = 16; /* 256 colour tiles with palette selectable on 16 colour boundaries */
+ machine.gfx[2]->color_granularity = 16; /* 256 colour tiles with palette selectable on 16 colour boundaries */
}
@@ -134,10 +134,10 @@ VIDEO_START( fuuki16 )
static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
{
- fuuki16_state *state = screen.machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = screen.machine().driver_data<fuuki16_state>();
int offs;
- const gfx_element *gfx = screen.machine->gfx[0];
- bitmap_t *priority_bitmap = screen.machine->priority_bitmap;
+ const gfx_element *gfx = screen.machine().gfx[0];
+ bitmap_t *priority_bitmap = screen.machine().priority_bitmap;
const rectangle &visarea = screen.visible_area();
UINT16 *spriteram16 = state->spriteram;
int max_x = visarea.max_x + 1;
@@ -179,7 +179,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
sx = (sx & 0x1ff) - (sx & 0x200);
sy = (sy & 0x1ff) - (sy & 0x200);
- if (flip_screen_get(screen.machine))
+ if (flip_screen_get(screen.machine()))
{
flipx = !flipx; sx = max_x - sx - xnum * 16;
flipy = !flipy; sy = max_y - sy - ynum * 16;
@@ -216,7 +216,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
#ifdef MAME_DEBUG
#if 0
-if (input_code_pressed(screen.machine, KEYCODE_X))
+if (input_code_pressed(screen.machine(), KEYCODE_X))
{ /* Display some info on each sprite */
char buf[40];
sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3);
@@ -262,9 +262,9 @@ if (input_code_pressed(screen.machine, KEYCODE_X))
***************************************************************************/
/* Wrapper to handle bg and bg2 ttogether */
-static void fuuki16_draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
+static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
int buffer = (state->vregs[0x1e / 2] & 0x40);
switch( i )
@@ -281,7 +281,7 @@ static void fuuki16_draw_layer( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( fuuki16 )
{
- fuuki16_state *state = screen->machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = screen->machine().driver_data<fuuki16_state>();
UINT16 layer0_scrollx, layer0_scrolly;
UINT16 layer1_scrollx, layer1_scrolly;
UINT16 layer2_scrollx, layer2_scrolly;
@@ -303,12 +303,12 @@ SCREEN_UPDATE( fuuki16 )
int tm_middle = pri_table[state->priority[0] & 0x0f][1];
int tm_back = pri_table[state->priority[0] & 0x0f][2];
- flip_screen_set(screen->machine, state->vregs[0x1e / 2] & 1);
+ flip_screen_set(screen->machine(), state->vregs[0x1e / 2] & 1);
/* Layers scrolling */
- scrolly_offs = state->vregs[0xc / 2] - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3);
- scrollx_offs = state->vregs[0xe / 2] - (flip_screen_get(screen->machine) ? 0x2a7 : 0x3f6);
+ scrolly_offs = state->vregs[0xc / 2] - (flip_screen_get(screen->machine()) ? 0x103 : 0x1f3);
+ scrollx_offs = state->vregs[0xe / 2] - (flip_screen_get(screen->machine()) ? 0x2a7 : 0x3f6);
layer0_scrolly = state->vregs[0x0 / 2] + scrolly_offs;
layer0_scrollx = state->vregs[0x2 / 2] + scrollx_offs;
@@ -331,15 +331,15 @@ SCREEN_UPDATE( fuuki16 )
/* The backmost tilemap decides the background color(s) but sprites can
go below the opaque pixels of that tilemap. We thus need to mark the
transparent pixels of this layer with a different priority value */
-// fuuki16_draw_layer(screen->machine, bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);
+// fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);
/* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */
bitmap_fill(bitmap, cliprect, (0x800 * 4) - 1);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
- fuuki16_draw_layer(screen->machine, bitmap, cliprect, tm_back, 0, 1);
- fuuki16_draw_layer(screen->machine, bitmap, cliprect, tm_middle, 0, 2);
- fuuki16_draw_layer(screen->machine, bitmap, cliprect, tm_front, 0, 4);
+ fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_back, 0, 1);
+ fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_middle, 0, 2);
+ fuuki16_draw_layer(screen->machine(), bitmap, cliprect, tm_front, 0, 4);
draw_sprites(*screen, bitmap, cliprect);
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index 7d9f7563ac2..8ae057d8c63 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -52,7 +52,7 @@
\
static TILE_GET_INFO( get_tile_info_##_N_ ) \
{ \
- fuuki32_state *state = machine->driver_data<fuuki32_state>(); \
+ fuuki32_state *state = machine.driver_data<fuuki32_state>(); \
UINT16 code = (state->vram_##_N_[tile_index] & 0xffff0000) >> 16; \
UINT16 attr = (state->vram_##_N_[tile_index] & 0x0000ffff); \
SET_TILE_INFO(1 + _N_, code, (attr & 0x3f) >> 4, TILE_FLIPYX((attr >> 6) & 3)); \
@@ -60,7 +60,7 @@ static TILE_GET_INFO( get_tile_info_##_N_ ) \
\
WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \
{ \
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>(); \
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>(); \
COMBINE_DATA(&state->vram_##_N_[offset]); \
tilemap_mark_tile_dirty(state->tilemap_##_N_,offset); \
}
@@ -69,7 +69,7 @@ WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \
\
static TILE_GET_INFO( get_tile_info_##_N_ ) \
{ \
- fuuki32_state *state = machine->driver_data<fuuki32_state>(); \
+ fuuki32_state *state = machine.driver_data<fuuki32_state>(); \
UINT16 code = (state->vram_##_N_[tile_index] & 0xffff0000) >> 16; \
UINT16 attr = (state->vram_##_N_[tile_index] & 0x0000ffff); \
SET_TILE_INFO(1 + _N_, code, attr & 0x3f, TILE_FLIPYX((attr >> 6) & 3)); \
@@ -77,7 +77,7 @@ static TILE_GET_INFO( get_tile_info_##_N_ ) \
\
WRITE32_HANDLER( fuuki32_vram_##_N_##_w ) \
{ \
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>(); \
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>(); \
COMBINE_DATA(&state->vram_##_N_[offset]); \
tilemap_mark_tile_dirty(state->tilemap_##_N_, offset); \
}
@@ -99,7 +99,7 @@ LAYER_4BPP( 3 )
VIDEO_START( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
state->buf_spriteram = auto_alloc_array(machine, UINT32, state->spriteram_size / 4);
state->buf_spriteram2 = auto_alloc_array(machine, UINT32, state->spriteram_size / 4);
@@ -116,8 +116,8 @@ VIDEO_START( fuuki32 )
tilemap_set_transparent_pen(state->tilemap_2, 0x0f); // 4 bits
tilemap_set_transparent_pen(state->tilemap_3, 0x0f); // 4 bits
- //machine->gfx[1]->color_granularity = 16; /* 256 colour tiles with palette selectable on 16 colour boundaries */
- //machine->gfx[2]->color_granularity = 16;
+ //machine.gfx[1]->color_granularity = 16; /* 256 colour tiles with palette selectable on 16 colour boundaries */
+ //machine.gfx[2]->color_granularity = 16;
}
@@ -151,10 +151,10 @@ VIDEO_START( fuuki32 )
static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
{
- fuuki32_state *state = screen.machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = screen.machine().driver_data<fuuki32_state>();
int offs;
- const gfx_element *gfx = screen.machine->gfx[0];
- bitmap_t *priority_bitmap = screen.machine->priority_bitmap;
+ const gfx_element *gfx = screen.machine().gfx[0];
+ bitmap_t *priority_bitmap = screen.machine().priority_bitmap;
const rectangle &visarea = screen.visible_area();
int max_x = visarea.max_x + 1;
int max_y = visarea.max_y + 1;
@@ -204,7 +204,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
sx = (sx & 0x1ff) - (sx & 0x200);
sy = (sy & 0x1ff) - (sy & 0x200);
- if (flip_screen_get(screen.machine))
+ if (flip_screen_get(screen.machine()))
{
flipx = !flipx; sx = max_x - sx - xnum * 16;
flipy = !flipy; sy = max_y - sy - ynum * 16;
@@ -217,10 +217,10 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
else { ystart = 0; yend = ynum; yinc = +1; }
#if 0
- if(!( (input_code_pressed(screen.machine, KEYCODE_V) && (((attr >> 6)&3) == 0))
- || (input_code_pressed(screen.machine, KEYCODE_B) && (((attr >> 6)&3) == 1))
- || (input_code_pressed(screen.machine, KEYCODE_N) && (((attr >> 6)&3) == 2))
- || (input_code_pressed(screen.machine, KEYCODE_M) && (((attr >> 6)&3) == 3))
+ if(!( (input_code_pressed(screen.machine(), KEYCODE_V) && (((attr >> 6)&3) == 0))
+ || (input_code_pressed(screen.machine(), KEYCODE_B) && (((attr >> 6)&3) == 1))
+ || (input_code_pressed(screen.machine(), KEYCODE_N) && (((attr >> 6)&3) == 2))
+ || (input_code_pressed(screen.machine(), KEYCODE_M) && (((attr >> 6)&3) == 3))
))
#endif
@@ -249,7 +249,7 @@ static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectang
#ifdef MAME_DEBUG
#if 0
-if (input_code_pressed(screen.machine, KEYCODE_X))
+if (input_code_pressed(screen.machine(), KEYCODE_X))
{ /* Display some info on each sprite */
char buf[40];
sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3);
@@ -295,9 +295,9 @@ if (input_code_pressed(screen.machine, KEYCODE_X))
***************************************************************************/
/* Wrapper to handle bg and bg2 ttogether */
-static void fuuki32_draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
+static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
int buffer = ((state->vregs[0x1e / 4] & 0x0000ffff) & 0x40);
switch( i )
@@ -314,7 +314,7 @@ static void fuuki32_draw_layer( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( fuuki32 )
{
- fuuki32_state *state = screen->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = screen->machine().driver_data<fuuki32_state>();
UINT16 layer0_scrollx, layer0_scrolly;
UINT16 layer1_scrollx, layer1_scrolly;
UINT16 layer2_scrollx, layer2_scrolly;
@@ -336,12 +336,12 @@ SCREEN_UPDATE( fuuki32 )
int tm_middle = pri_table[(state->priority[0] >> 16) & 0x0f][1];
int tm_back = pri_table[(state->priority[0] >> 16) & 0x0f][2];
- flip_screen_set(screen->machine, (state->vregs[0x1e / 4] & 0x0000ffff) & 1);
+ flip_screen_set(screen->machine(), (state->vregs[0x1e / 4] & 0x0000ffff) & 1);
/* Layers scrolling */
- scrolly_offs = ((state->vregs[0xc / 4] & 0xffff0000) >> 16) - (flip_screen_get(screen->machine) ? 0x103 : 0x1f3);
- scrollx_offs = (state->vregs[0xc / 4] & 0x0000ffff) - (flip_screen_get(screen->machine) ? 0x2c7 : 0x3f6);
+ scrolly_offs = ((state->vregs[0xc / 4] & 0xffff0000) >> 16) - (flip_screen_get(screen->machine()) ? 0x103 : 0x1f3);
+ scrollx_offs = (state->vregs[0xc / 4] & 0x0000ffff) - (flip_screen_get(screen->machine()) ? 0x2c7 : 0x3f6);
layer0_scrolly = ((state->vregs[0x0 / 4] & 0xffff0000) >> 16) + scrolly_offs;
layer0_scrollx = ((state->vregs[0x0 / 4] & 0x0000ffff)) + scrollx_offs;
@@ -363,11 +363,11 @@ SCREEN_UPDATE( fuuki32 )
/* The bg colour is the last pen i.e. 0x1fff */
bitmap_fill(bitmap, cliprect, (0x800 * 4) - 1);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
- fuuki32_draw_layer(screen->machine, bitmap, cliprect, tm_back, 0, 1);
- fuuki32_draw_layer(screen->machine, bitmap, cliprect, tm_middle, 0, 2);
- fuuki32_draw_layer(screen->machine, bitmap, cliprect, tm_front, 0, 4);
+ fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_back, 0, 1);
+ fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_middle, 0, 2);
+ fuuki32_draw_layer(screen->machine(), bitmap, cliprect, tm_front, 0, 4);
draw_sprites(*screen, bitmap, cliprect);
return 0;
@@ -375,7 +375,7 @@ SCREEN_UPDATE( fuuki32 )
SCREEN_EOF( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
/* Buffer sprites and tilebank by 2 frames */
state->spr_buffered_tilebank[1] = state->spr_buffered_tilebank[0];
diff --git a/src/mame/video/gaelco.c b/src/mame/video/gaelco.c
index 3e62b1229f5..898f6b30ee1 100644
--- a/src/mame/video/gaelco.c
+++ b/src/mame/video/gaelco.c
@@ -33,7 +33,7 @@
static TILE_GET_INFO( get_tile_info_gaelco_screen0 )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
int data = state->videoram[tile_index << 1];
int data2 = state->videoram[(tile_index << 1) + 1];
int code = ((data & 0xfffc) >> 2);
@@ -46,7 +46,7 @@ static TILE_GET_INFO( get_tile_info_gaelco_screen0 )
static TILE_GET_INFO( get_tile_info_gaelco_screen1 )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
int data = state->videoram[(0x1000 / 2) + (tile_index << 1)];
int data2 = state->videoram[(0x1000 / 2) + (tile_index << 1) + 1];
int code = ((data & 0xfffc) >> 2);
@@ -64,7 +64,7 @@ static TILE_GET_INFO( get_tile_info_gaelco_screen1 )
WRITE16_HANDLER( gaelco_vram_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap[offset >> 11], ((offset << 1) & 0x0fff) >> 2);
}
@@ -77,7 +77,7 @@ WRITE16_HANDLER( gaelco_vram_w )
VIDEO_START( bigkarnk )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
state->tilemap[0] = tilemap_create(machine, get_tile_info_gaelco_screen0, tilemap_scan_rows, 16, 16, 32, 32);
state->tilemap[1] = tilemap_create(machine, get_tile_info_gaelco_screen1, tilemap_scan_rows, 16, 16, 32, 32);
@@ -87,7 +87,7 @@ VIDEO_START( bigkarnk )
VIDEO_START( maniacsq )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
state->tilemap[0] = tilemap_create(machine, get_tile_info_gaelco_screen0, tilemap_scan_rows, 16, 16, 32, 32);
state->tilemap[1] = tilemap_create(machine, get_tile_info_gaelco_screen1, tilemap_scan_rows, 16, 16, 32, 32);
@@ -121,11 +121,11 @@ VIDEO_START( maniacsq )
3 | xxxxxxxx xxxxxx-- | sprite code
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
int i, x, y, ex, ey;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
static const int x_offset[2] = {0x0,0x2};
static const int y_offset[2] = {0x0,0x1};
@@ -175,7 +175,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
pdrawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey],
color,xflip,yflip,
sx-0x0f+x*8,sy+y*8,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
}
}
}
@@ -189,7 +189,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( maniacsq )
{
- gaelco_state *state = screen->machine->driver_data<gaelco_state>();
+ gaelco_state *state = screen->machine().driver_data<gaelco_state>();
/* set scroll registers */
tilemap_set_scrolly(state->tilemap[0], 0, state->vregs[0]);
@@ -197,7 +197,7 @@ SCREEN_UPDATE( maniacsq )
tilemap_set_scrolly(state->tilemap[1], 0, state->vregs[2]);
tilemap_set_scrollx(state->tilemap[1], 0, state->vregs[3]);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->tilemap[1], 3, 0);
@@ -212,13 +212,13 @@ SCREEN_UPDATE( maniacsq )
tilemap_draw(bitmap, cliprect, state->tilemap[1], 0, 4);
tilemap_draw(bitmap, cliprect, state->tilemap[0], 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( bigkarnk )
{
- gaelco_state *state = screen->machine->driver_data<gaelco_state>();
+ gaelco_state *state = screen->machine().driver_data<gaelco_state>();
/* set scroll registers */
tilemap_set_scrolly(state->tilemap[0], 0, state->vregs[0]);
@@ -226,7 +226,7 @@ SCREEN_UPDATE( bigkarnk )
tilemap_set_scrolly(state->tilemap[1], 0, state->vregs[2]);
tilemap_set_scrollx(state->tilemap[1], 0, state->vregs[3]);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->tilemap[1], TILEMAP_DRAW_LAYER1 | 3, 0);
@@ -253,6 +253,6 @@ SCREEN_UPDATE( bigkarnk )
tilemap_draw(bitmap, cliprect, state->tilemap[1], TILEMAP_DRAW_LAYER0 | 0, 8);
tilemap_draw(bitmap, cliprect, state->tilemap[0], TILEMAP_DRAW_LAYER0 | 0, 8);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c
index 1906051fba0..8c5e87e0c0e 100644
--- a/src/mame/video/gaelco2.c
+++ b/src/mame/video/gaelco2.c
@@ -103,7 +103,7 @@ Multi monitor notes:
static TILE_GET_INFO( get_tile_info_gaelco2_screen0 )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
int data = state->videoram[(((state->vregs[0] >> 9) & 0x07)*0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(((state->vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
int code = ((data & 0x07) << 16) | (data2 & 0xffff);
@@ -113,7 +113,7 @@ static TILE_GET_INFO( get_tile_info_gaelco2_screen0 )
static TILE_GET_INFO( get_tile_info_gaelco2_screen1 )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
int data = state->videoram[(((state->vregs[1] >> 9) & 0x07)*0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(((state->vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
int code = ((data & 0x07) << 16) | (data2 & 0xffff);
@@ -146,7 +146,7 @@ static TILE_GET_INFO( get_tile_info_gaelco2_screen1 )
static TILE_GET_INFO( get_tile_info_gaelco2_screen0_dual )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
int data = state->videoram[(((state->vregs[0] >> 9) & 0x07)*0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(((state->vregs[0] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
int code = ((data & 0x07) << 16) | (data2 & 0xffff);
@@ -156,7 +156,7 @@ static TILE_GET_INFO( get_tile_info_gaelco2_screen0_dual )
static TILE_GET_INFO( get_tile_info_gaelco2_screen1_dual )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
int data = state->videoram[(((state->vregs[1] >> 9) & 0x07)*0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(((state->vregs[1] >> 9) & 0x07)*0x2000/2) + ((tile_index << 1) + 1)];
int code = ((data & 0x07) << 16) | (data2 & 0xffff);
@@ -173,7 +173,7 @@ static TILE_GET_INFO( get_tile_info_gaelco2_screen1_dual )
WRITE16_HANDLER( gaelco2_vram_w )
{
- gaelco2_state *state = space->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = space->machine().driver_data<gaelco2_state>();
int pant0_start = ((state->vregs[0] >> 9) & 0x07)*0x1000;
int pant0_end = pant0_start + 0x1000;
int pant1_start = ((state->vregs[1] >> 9) & 0x07)*0x1000;
@@ -226,8 +226,8 @@ WRITE16_HANDLER( gaelco2_palette_w )
{
int i, color, r, g, b, auxr, auxg, auxb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- color = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ color = space->machine().generic.paletteram.u16[offset];
/* extract RGB components */
r = (color >> 10) & 0x1f;
@@ -239,7 +239,7 @@ WRITE16_HANDLER( gaelco2_palette_w )
b = pal5bit(b);
/* update game palette */
- palette_set_color(space->machine, 4096*0 + offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), 4096*0 + offset, MAKE_RGB(r, g, b));
/* update shadow/highligh palettes */
for (i = 1; i < 16; i++){
@@ -251,7 +251,7 @@ WRITE16_HANDLER( gaelco2_palette_w )
auxg = ADJUST_COLOR(g + pen_color_adjust[i]);
auxb = ADJUST_COLOR(b + pen_color_adjust[i]);
- palette_set_color(space->machine, 4096*i + offset, MAKE_RGB(auxr, auxg, auxb));
+ palette_set_color(space->machine(), 4096*i + offset, MAKE_RGB(auxr, auxg, auxb));
}
}
@@ -263,8 +263,8 @@ WRITE16_HANDLER( gaelco2_palette_w )
VIDEO_START( gaelco2 )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
- state->videoram = machine->generic.spriteram.u16;
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
+ state->videoram = machine.generic.spriteram.u16;
/* create tilemaps */
state->pant[0] = tilemap_create(machine, get_tile_info_gaelco2_screen0,tilemap_scan_rows,16,16,64,32);
@@ -284,8 +284,8 @@ VIDEO_START( gaelco2 )
VIDEO_START( gaelco2_dual )
{
- gaelco2_state *state = machine->driver_data<gaelco2_state>();
- state->videoram = machine->generic.spriteram.u16;
+ gaelco2_state *state = machine.driver_data<gaelco2_state>();
+ state->videoram = machine.generic.spriteram.u16;
/* create tilemaps */
state->pant[0] = tilemap_create(machine, get_tile_info_gaelco2_screen0_dual,tilemap_scan_rows,16,16,64,32);
@@ -341,10 +341,10 @@ VIDEO_START( gaelco2_dual )
static void draw_sprites(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs)
{
- gaelco2_state *state = screen->machine->driver_data<gaelco2_state>();
- UINT16 *buffered_spriteram16 = screen->machine->generic.buffered_spriteram.u16;
+ gaelco2_state *state = screen->machine().driver_data<gaelco2_state>();
+ UINT16 *buffered_spriteram16 = screen->machine().generic.buffered_spriteram.u16;
int j, x, y, ex, ey, px, py;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
/* get sprite ram start and end offsets */
int start_offset = (state->vregs[1] & 0x10)*0x100;
@@ -438,7 +438,7 @@ static void draw_sprites(screen_device *screen, bitmap_t *bitmap, const rectangl
SCREEN_UPDATE( gaelco2 )
{
- gaelco2_state *state = screen->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = screen->machine().driver_data<gaelco2_state>();
int i;
/* read scroll values */
@@ -468,11 +468,11 @@ SCREEN_UPDATE( gaelco2 )
SCREEN_UPDATE( gaelco2_dual )
{
- gaelco2_state *state = screen->machine->driver_data<gaelco2_state>();
+ gaelco2_state *state = screen->machine().driver_data<gaelco2_state>();
int i;
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
/* read scroll values */
int scroll0x = state->videoram[0x2802/2] + 0x14;
@@ -512,7 +512,7 @@ SCREEN_UPDATE( gaelco2_dual )
SCREEN_EOF( gaelco2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* sprites are one frame ahead */
buffer_spriteram16_w(space, 0, 0, 0xffff);
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index 3a75b26de97..c980e7d8bac 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -27,7 +27,9 @@
typedef struct _poly_extra_data poly_extra_data;
struct _poly_extra_data
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
UINT32 tex, color;
float ooz_dx, ooz_dy, ooz_base;
float uoz_dx, uoz_dy, uoz_base;
@@ -57,16 +59,16 @@ static void gaelco3d_exit(running_machine &machine)
VIDEO_START( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
int width, height;
state->poly = poly_alloc(machine, 2000, sizeof(poly_extra_data), 0);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, gaelco3d_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, gaelco3d_exit);
- state->screenbits = machine->primary_screen->alloc_compatible_bitmap();
+ state->screenbits = machine.primary_screen->alloc_compatible_bitmap();
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
state->palette = auto_alloc_array(machine, rgb_t, 32768);
@@ -116,7 +118,7 @@ VIDEO_START( gaelco3d )
static void render_poly(screen_device &screen, UINT32 *polydata)
{
- gaelco3d_state *state = screen.machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = screen.machine().driver_data<gaelco3d_state>();
float midx = screen.width() / 2;
float midy = screen.height() / 2;
float z0 = tms3203x_device::fp_to_float(polydata[0]);
@@ -160,7 +162,7 @@ static void render_poly(screen_device &screen, UINT32 *polydata)
}
/* fill in extra data */
- extra->machine = screen.machine;
+ extra->m_machine = &screen.machine();
extra->tex = polydata[11];
extra->color = color;
extra->ooz_dx = ooz_dx;
@@ -210,7 +212,7 @@ static void render_poly(screen_device &screen, UINT32 *polydata)
static void render_noz_noperspective(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const poly_extra_data *extra = (const poly_extra_data *)extradata;
- gaelco3d_state *state = extra->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = extra->machine().driver_data<gaelco3d_state>();
bitmap_t *bitmap = (bitmap_t *)destbase;
float zbase = recip_approx(extra->ooz_base);
float uoz_step = extra->uoz_dx * zbase;
@@ -252,7 +254,7 @@ static void render_noz_noperspective(void *destbase, INT32 scanline, const poly_
static void render_normal(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const poly_extra_data *extra = (const poly_extra_data *)extradata;
- gaelco3d_state *state = extra->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = extra->machine().driver_data<gaelco3d_state>();
bitmap_t *bitmap = (bitmap_t *)destbase;
float ooz_dx = extra->ooz_dx;
float uoz_dx = extra->uoz_dx;
@@ -305,7 +307,7 @@ static void render_normal(void *destbase, INT32 scanline, const poly_extent *ext
static void render_alphablend(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const poly_extra_data *extra = (const poly_extra_data *)extradata;
- gaelco3d_state *state = extra->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = extra->machine().driver_data<gaelco3d_state>();
bitmap_t *bitmap = (bitmap_t *)destbase;
float ooz_dx = extra->ooz_dx;
float uoz_dx = extra->uoz_dx;
@@ -363,7 +365,7 @@ static void render_alphablend(void *destbase, INT32 scanline, const poly_extent
void gaelco3d_render(screen_device &screen)
{
- gaelco3d_state *state = screen.machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = screen.machine().driver_data<gaelco3d_state>();
/* wait for any queued stuff to complete */
poly_wait(state->poly, "Time to render");
@@ -389,25 +391,25 @@ void gaelco3d_render(screen_device &screen)
WRITE32_HANDLER( gaelco3d_render_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
/* append the data to our buffer */
state->polydata_buffer[state->polydata_count++] = data;
if (state->polydata_count >= MAX_POLYDATA)
fatalerror("Out of polygon buffer space!");
/* if we've accumulated a completed poly set of data, queue it */
- if (!space->machine->video().skip_this_frame())
+ if (!space->machine().video().skip_this_frame())
{
if (state->polydata_count >= 18 && (state->polydata_count % 2) == 1 && IS_POLYEND(state->polydata_buffer[state->polydata_count - 2]))
{
- render_poly(*space->machine->primary_screen, &state->polydata_buffer[0]);
+ render_poly(*space->machine().primary_screen, &state->polydata_buffer[0]);
state->polydata_count = 0;
}
state->video_changed = TRUE;
}
#if DISPLAY_STATS
- state->lastscan = space->machine->primary_screen->vpos();
+ state->lastscan = space->machine().primary_screen->vpos();
#endif
}
@@ -421,20 +423,20 @@ WRITE32_HANDLER( gaelco3d_render_w )
WRITE16_HANDLER( gaelco3d_paletteram_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
poly_wait(state->poly, "Palette change");
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- state->palette[offset] = ((space->machine->generic.paletteram.u16[offset] & 0x7fe0) << 6) | (space->machine->generic.paletteram.u16[offset] & 0x1f);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ state->palette[offset] = ((space->machine().generic.paletteram.u16[offset] & 0x7fe0) << 6) | (space->machine().generic.paletteram.u16[offset] & 0x1f);
}
WRITE32_HANDLER( gaelco3d_paletteram_020_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
poly_wait(state->poly, "Palette change");
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- state->palette[offset*2+0] = ((space->machine->generic.paletteram.u32[offset] & 0x7fe00000) >> 10) | ((space->machine->generic.paletteram.u32[offset] & 0x1f0000) >> 16);
- state->palette[offset*2+1] = ((space->machine->generic.paletteram.u32[offset] & 0x7fe0) << 6) | (space->machine->generic.paletteram.u32[offset] & 0x1f);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ state->palette[offset*2+0] = ((space->machine().generic.paletteram.u32[offset] & 0x7fe00000) >> 10) | ((space->machine().generic.paletteram.u32[offset] & 0x1f0000) >> 16);
+ state->palette[offset*2+1] = ((space->machine().generic.paletteram.u32[offset] & 0x7fe0) << 6) | (space->machine().generic.paletteram.u32[offset] & 0x1f);
}
@@ -447,29 +449,29 @@ WRITE32_HANDLER( gaelco3d_paletteram_020_w )
SCREEN_UPDATE( gaelco3d )
{
- gaelco3d_state *state = screen->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = screen->machine().driver_data<gaelco3d_state>();
int x, y, ret;
- if (DISPLAY_TEXTURE && (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X)))
+ if (DISPLAY_TEXTURE && (input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X)))
{
static int xv = 0, yv = 0x1000;
UINT8 *base = state->texture;
int length = state->texture_size;
- if (input_code_pressed(screen->machine, KEYCODE_X))
+ if (input_code_pressed(screen->machine(), KEYCODE_X))
{
base = state->texmask;
length = state->texmask_size;
}
- if (input_code_pressed(screen->machine, KEYCODE_LEFT) && xv >= 4)
+ if (input_code_pressed(screen->machine(), KEYCODE_LEFT) && xv >= 4)
xv -= 4;
- if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && xv < 4096 - 4)
+ if (input_code_pressed(screen->machine(), KEYCODE_RIGHT) && xv < 4096 - 4)
xv += 4;
- if (input_code_pressed(screen->machine, KEYCODE_UP) && yv >= 4)
+ if (input_code_pressed(screen->machine(), KEYCODE_UP) && yv >= 4)
yv -= 4;
- if (input_code_pressed(screen->machine, KEYCODE_DOWN) && yv < 0x40000)
+ if (input_code_pressed(screen->machine(), KEYCODE_DOWN) && yv < 0x40000)
yv += 4;
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
diff --git a/src/mame/video/gaiden.c b/src/mame/video/gaiden.c
index 137733f9476..069e53b8ff7 100644
--- a/src/mame/video/gaiden.c
+++ b/src/mame/video/gaiden.c
@@ -15,7 +15,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
UINT16 *videoram1 = &state->videoram3[0x0800];
UINT16 *videoram2 = state->videoram3;
SET_TILE_INFO(
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
UINT16 *videoram1 = &state->videoram2[0x0800];
UINT16 *videoram2 = state->videoram2;
SET_TILE_INFO(
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_fg_tile_info_raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
UINT16 *videoram1 = &state->videoram2[0x0800];
UINT16 *videoram2 = state->videoram2;
@@ -55,7 +55,7 @@ static TILE_GET_INFO( get_fg_tile_info_raiga )
static TILE_GET_INFO( get_tx_tile_info )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
UINT16 *videoram1 = &state->videoram[0x0400];
UINT16 *videoram2 = state->videoram;
SET_TILE_INFO(
@@ -74,9 +74,9 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( gaiden )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -105,9 +105,9 @@ VIDEO_START( gaiden )
VIDEO_START( mastninj )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -130,9 +130,9 @@ VIDEO_START( mastninj )
VIDEO_START( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -152,7 +152,7 @@ VIDEO_START( raiga )
VIDEO_START( drgnbowl )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* set up tile layers */
state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
state->foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
@@ -176,54 +176,54 @@ VIDEO_START( drgnbowl )
WRITE16_HANDLER( gaiden_flip_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
WRITE16_HANDLER( gaiden_txscrollx_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->tx_scroll_x);
tilemap_set_scrollx(state->text_layer, 0, state->tx_scroll_x);
}
WRITE16_HANDLER( gaiden_txscrolly_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->tx_scroll_y);
tilemap_set_scrolly(state->text_layer, 0, (state->tx_scroll_y - state->tx_offset_y) & 0xffff);
}
WRITE16_HANDLER( gaiden_fgscrollx_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->fg_scroll_x);
tilemap_set_scrollx(state->foreground, 0, state->fg_scroll_x);
}
WRITE16_HANDLER( gaiden_fgscrolly_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->fg_scroll_y);
tilemap_set_scrolly(state->foreground, 0, (state->fg_scroll_y - state->fg_offset_y) & 0xffff);
}
WRITE16_HANDLER( gaiden_bgscrollx_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->bg_scroll_x);
tilemap_set_scrollx(state->background, 0, state->bg_scroll_x);
}
WRITE16_HANDLER( gaiden_bgscrolly_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->bg_scroll_y);
tilemap_set_scrolly(state->background, 0, (state->bg_scroll_y - state->bg_offset_y) & 0xffff);
}
WRITE16_HANDLER( gaiden_txoffsety_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7) {
state->tx_offset_y = data;
@@ -233,7 +233,7 @@ WRITE16_HANDLER( gaiden_txoffsety_w )
WRITE16_HANDLER( gaiden_fgoffsety_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7) {
state->fg_offset_y = data;
@@ -243,7 +243,7 @@ WRITE16_HANDLER( gaiden_fgoffsety_w )
WRITE16_HANDLER( gaiden_bgoffsety_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7) {
state->bg_offset_y = data;
@@ -253,7 +253,7 @@ WRITE16_HANDLER( gaiden_bgoffsety_w )
WRITE16_HANDLER( gaiden_sproffsety_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7) {
state->spr_offset_y = data;
@@ -264,33 +264,33 @@ WRITE16_HANDLER( gaiden_sproffsety_w )
WRITE16_HANDLER( gaiden_videoram3_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->videoram3[offset]);
tilemap_mark_tile_dirty(state->background, offset & 0x07ff);
}
READ16_HANDLER( gaiden_videoram3_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
return state->videoram3[offset];
}
WRITE16_HANDLER( gaiden_videoram2_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->foreground, offset & 0x07ff);
}
READ16_HANDLER( gaiden_videoram2_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
return state->videoram2[offset];
}
WRITE16_HANDLER( gaiden_videoram_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->text_layer, offset & 0x03ff);
}
@@ -309,12 +309,12 @@ WRITE16_HANDLER( gaiden_videoram_w )
to blend into the final 32-bit rgb bitmaps, this is currently broken (due to zsolt's core
changes?) it appears that the sprite drawing is no longer putting the correct raw data
in the bitmaps? */
-static void blendbitmaps(running_machine *machine,
+static void blendbitmaps(running_machine &machine,
bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3,
int sx,int sy,const rectangle *cliprect)
{
int y,x;
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
@@ -367,7 +367,7 @@ static void blendbitmaps(running_machine *machine,
#define NUM_SPRITES 256
-static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
+static void gaiden_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
{
static const UINT8 layout[8][8] =
{
@@ -381,8 +381,8 @@ static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg,
{42,43,46,47,58,59,62,63}
};
- gaiden_state *state = machine->driver_data<gaiden_state>();
- const gfx_element *gfx = machine->gfx[3];
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ const gfx_element *gfx = machine.gfx[3];
const UINT16 *source = (NUM_SPRITES - 1) * 8 + state->spriteram;
int count = NUM_SPRITES;
@@ -459,7 +459,7 @@ static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg,
gfx->color_base + color * gfx->color_granularity,
flipx, flipy,
sx, sy,
- machine->priority_bitmap, priority_mask, 0);
+ machine.priority_bitmap, priority_mask, 0);
}
}
}
@@ -479,7 +479,7 @@ static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg,
gfx->color_base + color * gfx->color_granularity,
flipx, flipy,
sx, sy,
- machine->priority_bitmap, priority_mask, 0);
+ machine.priority_bitmap, priority_mask, 0);
}
}
}
@@ -489,7 +489,7 @@ static void gaiden_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg,
}
-static void raiga_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
+static void raiga_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
{
static const UINT8 layout[8][8] =
{
@@ -503,8 +503,8 @@ static void raiga_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, b
{42,43,46,47,58,59,62,63}
};
- gaiden_state *state = machine->driver_data<gaiden_state>();
- const gfx_element *gfx = machine->gfx[3];
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ const gfx_element *gfx = machine.gfx[3];
const UINT16 *source = (NUM_SPRITES - 1) * 8 + state->spriteram;
int count = NUM_SPRITES;
@@ -580,7 +580,7 @@ static void raiga_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, b
gfx->color_base + color * gfx->color_granularity,
flipx, flipy,
sx, sy,
- machine->priority_bitmap, priority_mask, 0);
+ machine.priority_bitmap, priority_mask, 0);
}
}
}
@@ -600,7 +600,7 @@ static void raiga_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, b
gfx->color_base + color * gfx->color_granularity,
flipx, flipy,
sx, sy,
- machine->priority_bitmap, priority_mask, 0);
+ machine.priority_bitmap, priority_mask, 0);
}
}
}
@@ -629,9 +629,9 @@ static void raiga_draw_sprites( running_machine *machine, bitmap_t *bitmap_bg, b
* |---------x------- | x position (high bit)
*/
-static void drgnbowl_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
UINT16 *spriteram = state->spriteram;
int i, code, color, x, y, flipx, flipy, priority_mask;
@@ -654,26 +654,26 @@ static void drgnbowl_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
else
priority_mask = 0;
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[3],
code,
- machine->gfx[3]->color_base + color * machine->gfx[3]->color_granularity,
+ machine.gfx[3]->color_base + color * machine.gfx[3]->color_granularity,
flipx,flipy,x,y,
- machine->priority_bitmap, priority_mask,15);
+ machine.priority_bitmap, priority_mask,15);
/* wrap x*/
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[3],
code,
- machine->gfx[3]->color_base + color * machine->gfx[3]->color_granularity,
+ machine.gfx[3]->color_base + color * machine.gfx[3]->color_granularity,
flipx,flipy,x-512,y,
- machine->priority_bitmap, priority_mask,15);
+ machine.priority_bitmap, priority_mask,15);
}
}
SCREEN_UPDATE( gaiden )
{
- gaiden_state *state = screen->machine->driver_data<gaiden_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ gaiden_state *state = screen->machine().driver_data<gaiden_state>();
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(state->tile_bitmap_bg, cliprect, 0x200);
bitmap_fill(state->tile_bitmap_fg, cliprect, 0);
@@ -688,18 +688,18 @@ SCREEN_UPDATE( gaiden )
tilemap_draw(state->tile_bitmap_fg, cliprect, state->text_layer, 0, 4);
/* draw sprites into a 16-bit bitmap */
- gaiden_draw_sprites(screen->machine, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
+ gaiden_draw_sprites(screen->machine(), state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
/* mix & blend the tilemaps and sprites into a 32-bit bitmap */
- blendbitmaps(screen->machine, bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
+ blendbitmaps(screen->machine(), bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
return 0;
}
SCREEN_UPDATE( raiga )
{
- gaiden_state *state = screen->machine->driver_data<gaiden_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ gaiden_state *state = screen->machine().driver_data<gaiden_state>();
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(state->tile_bitmap_bg, cliprect, 0x200);
bitmap_fill(state->tile_bitmap_fg, cliprect, 0);
@@ -714,21 +714,21 @@ SCREEN_UPDATE( raiga )
tilemap_draw(state->tile_bitmap_fg, cliprect, state->text_layer, 0, 4);
/* draw sprites into a 16-bit bitmap */
- raiga_draw_sprites(screen->machine, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
+ raiga_draw_sprites(screen->machine(), state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
/* mix & blend the tilemaps and sprites into a 32-bit bitmap */
- blendbitmaps(screen->machine, bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
+ blendbitmaps(screen->machine(), bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
return 0;
}
SCREEN_UPDATE( drgnbowl )
{
- gaiden_state *state = screen->machine->driver_data<gaiden_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ gaiden_state *state = screen->machine().driver_data<gaiden_state>();
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->background, 0, 1);
tilemap_draw(bitmap, cliprect, state->foreground, 0, 2);
tilemap_draw(bitmap, cliprect, state->text_layer, 0, 4);
- drgnbowl_draw_sprites(screen->machine, bitmap, cliprect);
+ drgnbowl_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c
index bbe17f43012..3b953ff35e0 100644
--- a/src/mame/video/galaga.c
+++ b/src/mame/video/galaga.c
@@ -328,7 +328,7 @@ PALETTE_INIT( galaga )
{
int i;
- machine->colortable = colortable_alloc(machine, 32+64);
+ machine.colortable = colortable_alloc(machine, 32+64);
/* core palette */
for (i = 0;i < 32;i++)
@@ -348,7 +348,7 @@ PALETTE_INIT( galaga )
bit2 = ((*color_prom) >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -365,20 +365,20 @@ PALETTE_INIT( galaga )
bits = (i >> 4) & 0x03;
b = map[bits];
- colortable_palette_set_color(machine->colortable,32 + i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,32 + i,MAKE_RGB(r,g,b));
}
/* characters */
for (i = 0;i < 64*4;i++)
- colortable_entry_set_value(machine->colortable, i, (*(color_prom++) & 0x0f) + 0x10); /* chars */
+ colortable_entry_set_value(machine.colortable, i, (*(color_prom++) & 0x0f) + 0x10); /* chars */
/* sprites */
for (i = 0;i < 64*4;i++)
- colortable_entry_set_value(machine->colortable, 64*4+i, (*(color_prom++) & 0x0f));
+ colortable_entry_set_value(machine.colortable, 64*4+i, (*(color_prom++) & 0x0f));
/* now the stars */
for (i = 0;i < 64;i++)
- colortable_entry_set_value(machine->colortable, 64*4+64*4+i, 32 + i);
+ colortable_entry_set_value(machine.colortable, 64*4+64*4+i, 32 + i);
}
@@ -412,7 +412,7 @@ static TILE_GET_INFO( get_tile_info )
timing signals, while x flip is done by selecting the 2nd character set.
We reproduce this here, but since the tilemap system automatically flips
characters when screen is flipped, we have to flip them back. */
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
int color = state->videoram[tile_index + 0x400] & 0x3f;
SET_TILE_INFO(
0,
@@ -432,9 +432,9 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
state->fg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan,8,8,36,28);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0x1f);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 0x1f);
state->galaga_gfxbank = 0;
@@ -454,7 +454,7 @@ VIDEO_START( galaga )
WRITE8_HANDLER( galaga_videoram_w )
{
- galaga_state *state = space->machine->driver_data<galaga_state>();
+ galaga_state *state = space->machine().driver_data<galaga_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
@@ -462,7 +462,7 @@ WRITE8_HANDLER( galaga_videoram_w )
WRITE8_HANDLER ( gatsbee_bank_w )
{
- galaga_state *state = space->machine->driver_data<galaga_state>();
+ galaga_state *state = space->machine().driver_data<galaga_state>();
state->galaga_gfxbank = data & 0x1;
tilemap_mark_all_tiles_dirty(state->fg_tilemap);
@@ -476,9 +476,9 @@ WRITE8_HANDLER ( gatsbee_bank_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
UINT8 *spriteram = state->galaga_ram1 + 0x380;
UINT8 *spriteram_2 = state->galaga_ram2 + 0x380;
@@ -517,21 +517,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x, sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x0f));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x0f));
}
}
}
}
-static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* draw the stars */
/* $a005 controls the stars ON/OFF */
@@ -568,11 +568,11 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
SCREEN_UPDATE( galaga )
{
- galaga_state *state = screen->machine->driver_data<galaga_state>();
+ galaga_state *state = screen->machine().driver_data<galaga_state>();
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- draw_stars(screen->machine,bitmap,cliprect);
- draw_sprites(screen->machine,bitmap,cliprect);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ draw_stars(screen->machine(),bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
}
@@ -581,7 +581,7 @@ SCREEN_UPDATE( galaga )
SCREEN_EOF( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* this function is called by galaga_interrupt_1() */
int s0,s1,s2;
static const int speeds[8] = { -1, -2, -3, 0, 3, 2, 1, 0 };
diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c
index 10c3c741aa6..5b01661fa60 100644
--- a/src/mame/video/galastrm.c
+++ b/src/mame/video/galastrm.c
@@ -30,14 +30,14 @@ static void galastrm_exit(running_machine &machine)
VIDEO_START( galastrm )
{
- galastrm_state *state = machine->driver_data<galastrm_state>();
+ galastrm_state *state = machine.driver_data<galastrm_state>();
state->spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
- state->tmpbitmaps = machine->primary_screen->alloc_compatible_bitmap();
- state->polybitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmaps = machine.primary_screen->alloc_compatible_bitmap();
+ state->polybitmap = machine.primary_screen->alloc_compatible_bitmap();
state->poly = poly_alloc(machine, 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, galastrm_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, galastrm_exit);
}
/************************************************************
@@ -86,11 +86,11 @@ Heavy use is made of sprite zooming.
********************************************************/
-static void draw_sprites_pre(running_machine *machine, int x_offs, int y_offs)
+static void draw_sprites_pre(running_machine &machine, int x_offs, int y_offs)
{
- galastrm_state *state = machine->driver_data<galastrm_state>();
+ galastrm_state *state = machine.driver_data<galastrm_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -193,9 +193,9 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int priority)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int priority)
{
- galastrm_state *state = machine->driver_data<galastrm_state>();
+ galastrm_state *state = machine.driver_data<galastrm_state>();
struct tempsprite *sprite_ptr = state->sprite_ptr_pre;
while (sprite_ptr != state->spritelist)
@@ -205,13 +205,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if ((priority != 0 && sprite_ptr->primask != 0) ||
(priority == 0 && sprite_ptr->primask == 0))
{
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,primasks[sprite_ptr->primask],0);
+ machine.priority_bitmap,primasks[sprite_ptr->primask],0);
}
}
}
@@ -242,9 +242,9 @@ static void tc0610_draw_scanline(void *dest, INT32 scanline, const poly_extent *
}
}
-static void tc0610_rotate_draw(running_machine *machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle *clip)
+static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle *clip)
{
- galastrm_state *state = machine->driver_data<galastrm_state>();
+ galastrm_state *state = machine.driver_data<galastrm_state>();
poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->poly);
poly_draw_scanline_func callback;
poly_vertex vert[4];
@@ -437,15 +437,15 @@ static void tc0610_rotate_draw(running_machine *machine, bitmap_t *bitmap, bitma
SCREEN_UPDATE( galastrm )
{
- galastrm_state *state = screen->machine->driver_data<galastrm_state>();
- device_t *tc0100scn = screen->machine->device("tc0100scn");
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ galastrm_state *state = screen->machine().driver_data<galastrm_state>();
+ device_t *tc0100scn = screen->machine().device("tc0100scn");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT8 pivlayer[3];
UINT16 priority;
static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
rectangle clip;
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
clip.min_x = 0;
clip.min_y = 0;
@@ -476,17 +476,17 @@ SCREEN_UPDATE( galastrm )
#if 0
if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
{
- if (!input_code_pressed(screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[0], 0, 1);
- if (!input_code_pressed(screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[1], 0, 4);
- if (!input_code_pressed(screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[2], 0, 4);
- if (!input_code_pressed(screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[3], 0, 4);
+ if (!input_code_pressed(screen->machine(), KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[0], 0, 1);
+ if (!input_code_pressed(screen->machine(), KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[1], 0, 4);
+ if (!input_code_pressed(screen->machine(), KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[2], 0, 4);
+ if (!input_code_pressed(screen->machine(), KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[3], 0, 4);
}
else
{
- if (!input_code_pressed(screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[0], 0, 1);
- if (!input_code_pressed(screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[1], 0, 2);
- if (!input_code_pressed(screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[2], 0, 4);
- if (!input_code_pressed(screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[3], 0, 8);
+ if (!input_code_pressed(screen->machine(), KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[0], 0, 1);
+ if (!input_code_pressed(screen->machine(), KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[1], 0, 2);
+ if (!input_code_pressed(screen->machine(), KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[2], 0, 4);
+ if (!input_code_pressed(screen->machine(), KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->tmpbitmaps, &clip, layer[3], 0, 8);
}
if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
@@ -505,18 +505,18 @@ SCREEN_UPDATE( galastrm )
}
}
- draw_sprites_pre(screen->machine, 42-X_OFFSET, -571+Y_OFFSET);
- draw_sprites(screen->machine,state->tmpbitmaps,&clip,primasks,1);
+ draw_sprites_pre(screen->machine(), 42-X_OFFSET, -571+Y_OFFSET);
+ draw_sprites(screen->machine(),state->tmpbitmaps,&clip,primasks,1);
copybitmap_trans(bitmap,state->polybitmap,0,0, 0,0,cliprect,0);
bitmap_fill(state->polybitmap, &clip, 0);
- tc0610_rotate_draw(screen->machine,state->polybitmap,state->tmpbitmaps,cliprect);
+ tc0610_rotate_draw(screen->machine(),state->polybitmap,state->tmpbitmaps,cliprect);
bitmap_fill(priority_bitmap, cliprect, 0);
- draw_sprites(screen->machine,bitmap,cliprect,primasks,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,primasks,0);
- if (!input_code_pressed(screen->machine, KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_M)) tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
@@ -552,15 +552,15 @@ SCREEN_UPDATE( galastrm )
}
}
- draw_sprites_pre(screen->machine, 42-X_OFFSET, -571+Y_OFFSET);
- draw_sprites(screen->machine,state->tmpbitmaps,&clip,primasks,1);
+ draw_sprites_pre(screen->machine(), 42-X_OFFSET, -571+Y_OFFSET);
+ draw_sprites(screen->machine(),state->tmpbitmaps,&clip,primasks,1);
copybitmap_trans(bitmap,state->polybitmap,0,0, 0,0,cliprect,0);
bitmap_fill(state->polybitmap, &clip, 0);
- tc0610_rotate_draw(screen->machine,state->polybitmap,state->tmpbitmaps,cliprect);
+ tc0610_rotate_draw(screen->machine(),state->polybitmap,state->tmpbitmaps,cliprect);
bitmap_fill(priority_bitmap, cliprect, 0);
- draw_sprites(screen->machine,bitmap,cliprect,primasks,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,primasks,0);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
diff --git a/src/mame/video/galaxian.c b/src/mame/video/galaxian.c
index fd9c3fff1b0..d79cf1584ea 100644
--- a/src/mame/video/galaxian.c
+++ b/src/mame/video/galaxian.c
@@ -283,16 +283,16 @@ static UINT8 gfxbank[5];
*
*************************************/
-static void state_save_register(running_machine *machine);
+static void state_save_register(running_machine &machine);
static TILE_GET_INFO( bg_get_tile_info );
-static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase);
+static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase);
-static void stars_init(running_machine *machine);
-static void stars_update_origin(running_machine *machine);
+static void stars_init(running_machine &machine);
+static void stars_update_origin(running_machine &machine);
static void stars_draw_row(bitmap_t *bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask);
-static void bullets_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base);
+static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base);
@@ -341,7 +341,7 @@ PALETTE_INIT( galaxian )
2, &rgb_resistances[1], bweights, 470, 0);
/* decode the palette first */
- len = machine->region("proms")->bytes();
+ len = machine.region("proms")->bytes();
for (i = 0; i < len; i++)
{
UINT8 bit0, bit1, bit2, r, g, b;
@@ -472,7 +472,7 @@ VIDEO_START( galaxian )
}
-static void state_save_register(running_machine *machine)
+static void state_save_register(running_machine &machine)
{
state_save_register_global(machine, flipscreen_x);
state_save_register_global(machine, flipscreen_y);
@@ -500,17 +500,17 @@ static void state_save_register(running_machine *machine)
SCREEN_UPDATE( galaxian )
{
/* draw the background layer (including stars) */
- (*galaxian_draw_background_ptr)(screen->machine, bitmap, cliprect);
+ (*galaxian_draw_background_ptr)(screen->machine(), bitmap, cliprect);
/* draw the tilemap characters over top */
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
/* render the sprites next */
- sprites_draw(screen->machine, bitmap, cliprect, &screen->machine->generic.spriteram.u8[0x40]);
+ sprites_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x40]);
/* if we have bullets to draw, render them following */
if (galaxian_draw_bullet_ptr != NULL)
- bullets_draw(screen->machine, bitmap, cliprect, &screen->machine->generic.spriteram.u8[0x60]);
+ bullets_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x60]);
return 0;
}
@@ -521,7 +521,7 @@ SCREEN_UPDATE( zigzag )
SCREEN_UPDATE_CALL(galaxian);
/* zigzag has an extra sprite generator instead of bullets (note: ideally, this should be rendered in parallel) */
- sprites_draw(screen->machine, bitmap, cliprect, &screen->machine->generic.spriteram.u8[0x60]);
+ sprites_draw(screen->machine(), bitmap, cliprect, &screen->machine().generic.spriteram.u8[0x60]);
return 0;
}
@@ -536,12 +536,12 @@ SCREEN_UPDATE( zigzag )
static TILE_GET_INFO( bg_get_tile_info )
{
- galaxian_state *state = machine->driver_data<galaxian_state>();
+ galaxian_state *state = machine.driver_data<galaxian_state>();
UINT8 *videoram = state->videoram;
UINT8 x = tile_index & 0x1f;
UINT16 code = videoram[tile_index];
- UINT8 attrib = machine->generic.spriteram.u8[x*2+1];
+ UINT8 attrib = machine.generic.spriteram.u8[x*2+1];
UINT8 color = attrib & 7;
if (galaxian_extend_tile_info_ptr != NULL)
@@ -553,10 +553,10 @@ static TILE_GET_INFO( bg_get_tile_info )
WRITE8_HANDLER( galaxian_videoram_w )
{
- galaxian_state *state = space->machine->driver_data<galaxian_state>();
+ galaxian_state *state = space->machine().driver_data<galaxian_state>();
UINT8 *videoram = state->videoram;
/* update any video up to the current scanline */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* store the data and mark the corresponding tile dirty */
videoram[offset] = data;
@@ -567,10 +567,10 @@ WRITE8_HANDLER( galaxian_videoram_w )
WRITE8_HANDLER( galaxian_objram_w )
{
/* update any video up to the current scanline */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* store the data */
- space->machine->generic.spriteram.u8[offset] = data;
+ space->machine().generic.spriteram.u8[offset] = data;
/* the first $40 bytes affect the tilemap */
if (offset < 0x40)
@@ -604,7 +604,7 @@ WRITE8_HANDLER( galaxian_objram_w )
*
*************************************/
-static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase)
+static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase)
{
rectangle clip = *cliprect;
int sprnum;
@@ -651,7 +651,7 @@ static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const recta
/* draw */
drawgfx_transpen(bitmap, &clip,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
GALAXIAN_H0START + GALAXIAN_XSCALE * sx, sy, 0);
@@ -666,7 +666,7 @@ static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const recta
*
*************************************/
-static void bullets_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base)
+static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base)
{
int y;
@@ -714,12 +714,12 @@ WRITE8_HANDLER( galaxian_flip_screen_x_w )
{
if (flipscreen_x != (data & 0x01))
{
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* when the direction changes, we count a different number of clocks */
/* per frame, so we need to reset the origin of the stars to the current */
/* frame before we flip */
- stars_update_origin(space->machine);
+ stars_update_origin(space->machine());
flipscreen_x = data & 0x01;
tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
@@ -730,7 +730,7 @@ WRITE8_HANDLER( galaxian_flip_screen_y_w )
{
if (flipscreen_y != (data & 0x01))
{
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
flipscreen_y = data & 0x01;
tilemap_set_flip(bg_tilemap, (flipscreen_x ? TILEMAP_FLIPX : 0) | (flipscreen_y ? TILEMAP_FLIPY : 0));
}
@@ -753,15 +753,15 @@ WRITE8_HANDLER( galaxian_flip_screen_xy_w )
WRITE8_HANDLER( galaxian_stars_enable_w )
{
if ((stars_enabled ^ data) & 0x01)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
if (!stars_enabled && (data & 0x01))
{
/* on the rising edge of this, the CLR on the shift registers is released */
/* this resets the "origin" of this frame to 0 minus the number of clocks */
/* we have counted so far */
- star_rng_origin = STAR_RNG_PERIOD - (space->machine->primary_screen->vpos() * 512 + space->machine->primary_screen->hpos());
- star_rng_origin_frame = space->machine->primary_screen->frame_number();
+ star_rng_origin = STAR_RNG_PERIOD - (space->machine().primary_screen->vpos() * 512 + space->machine().primary_screen->hpos());
+ star_rng_origin_frame = space->machine().primary_screen->frame_number();
}
stars_enabled = data & 0x01;
}
@@ -770,7 +770,7 @@ WRITE8_HANDLER( galaxian_stars_enable_w )
WRITE8_HANDLER( scramble_background_enable_w )
{
if ((background_enable ^ data) & 0x01)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
background_enable = data & 0x01;
}
@@ -779,7 +779,7 @@ WRITE8_HANDLER( scramble_background_enable_w )
WRITE8_HANDLER( scramble_background_red_w )
{
if ((background_red ^ data) & 0x01)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
background_red = data & 0x01;
}
@@ -788,7 +788,7 @@ WRITE8_HANDLER( scramble_background_red_w )
WRITE8_HANDLER( scramble_background_green_w )
{
if ((background_green ^ data) & 0x01)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
background_green = data & 0x01;
}
@@ -797,7 +797,7 @@ WRITE8_HANDLER( scramble_background_green_w )
WRITE8_HANDLER( scramble_background_blue_w )
{
if ((background_blue ^ data) & 0x01)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
background_blue = data & 0x01;
}
@@ -814,7 +814,7 @@ WRITE8_HANDLER( galaxian_gfxbank_w )
{
if (gfxbank[offset] != data)
{
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
gfxbank[offset] = data;
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
@@ -828,7 +828,7 @@ WRITE8_HANDLER( galaxian_gfxbank_w )
*
*************************************/
-static void stars_init(running_machine *machine)
+static void stars_init(running_machine &machine)
{
UINT32 shiftreg;
int i;
@@ -864,9 +864,9 @@ static void stars_init(running_machine *machine)
*
*************************************/
-static void stars_update_origin(running_machine *machine)
+static void stars_update_origin(running_machine &machine)
{
- int curframe = machine->primary_screen->frame_number();
+ int curframe = machine.primary_screen->frame_number();
/* only update on a different frame */
if (curframe != star_rng_origin_frame)
@@ -969,7 +969,7 @@ static void stars_draw_row(bitmap_t *bitmap, int maxx, int y, UINT32 star_offs,
*
*************************************/
-void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* erase the background to black first */
bitmap_fill(bitmap, cliprect, RGB_BLACK);
@@ -992,7 +992,7 @@ void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap, const
}
-static void background_draw_colorsplit(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, rgb_t color, int split, int split_flipped)
+static void background_draw_colorsplit(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, rgb_t color, int split, int split_flipped)
{
/* horizontal bgcolor split */
if (flipscreen_x)
@@ -1022,7 +1022,7 @@ static void background_draw_colorsplit(running_machine *machine, bitmap_t *bitma
}
-static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int maxx)
+static void scramble_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int maxx)
{
/* update the star origin to the current frame */
stars_update_origin(machine);
@@ -1048,7 +1048,7 @@ static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, cons
}
-void scramble_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* blue background - 390 ohm resistor */
bitmap_fill(bitmap, cliprect, background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK);
@@ -1057,7 +1057,7 @@ void scramble_draw_background(running_machine *machine, bitmap_t *bitmap, const
}
-void anteater_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* blue background, horizontal split as seen on flyer and real cabinet */
background_draw_colorsplit(machine, bitmap, cliprect, background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, 56, 256-56);
@@ -1066,7 +1066,7 @@ void anteater_draw_background(running_machine *machine, bitmap_t *bitmap, const
}
-void jumpbug_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* blue background - 390 ohm resistor */
bitmap_fill(bitmap, cliprect, background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK);
@@ -1076,7 +1076,7 @@ void jumpbug_draw_background(running_machine *machine, bitmap_t *bitmap, const r
}
-void turtles_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
The background color generator is connected this way:
@@ -1089,7 +1089,7 @@ void turtles_draw_background(running_machine *machine, bitmap_t *bitmap, const r
}
-void frogger_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* color split point verified on real machine */
/* hmmm, according to schematics it is at 128+8; which is right? */
@@ -1115,9 +1115,9 @@ static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle
return (draw->min_x <= draw->max_x);
}
-void amidar_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- const UINT8 *prom = machine->region("user1")->base();
+ const UINT8 *prom = machine.region("user1")->base();
rectangle draw;
int x;
@@ -1174,7 +1174,7 @@ INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle *cliprect, int
}
-void galaxian_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
/*
Both "shells" and "missiles" begin displaying when the horizontal counter
@@ -1190,7 +1190,7 @@ void galaxian_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rect
}
-void mshuttle_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
/* verified by schematics:
* both "W" and "Y" bullets are 4 pixels long
@@ -1219,7 +1219,7 @@ void mshuttle_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rect
}
-void scramble_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
/*
Scramble only has "shells", which begin displaying when the counter
@@ -1231,7 +1231,7 @@ void scramble_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rect
}
-void theend_draw_bullet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
/* Same as galaxian except blue/green are swapped */
x -= 4;
diff --git a/src/mame/video/galaxold.c b/src/mame/video/galaxold.c
index a651e755a29..f514b7e3350 100644
--- a/src/mame/video/galaxold.c
+++ b/src/mame/video/galaxold.c
@@ -22,7 +22,7 @@ static const rectangle* spritevisiblearea;
static const rectangle* spritevisibleareaflipx;
-#define STARS_COLOR_BASE (machine->region("proms")->bytes())
+#define STARS_COLOR_BASE (machine.region("proms")->bytes())
#define BULLETS_COLOR_BASE (STARS_COLOR_BASE + 64)
#define BACKGROUND_COLOR_BASE (BULLETS_COLOR_BASE + 2)
@@ -50,12 +50,12 @@ static UINT8 flipscreen_y;
static UINT8 color_mask;
static tilemap_t *dambustr_tilemap2;
static UINT8 *dambustr_videoram2;
-static void (*modify_charcode)(running_machine *machine, UINT16 *code,UINT8 x); /* function to call to do character banking */
-static void mooncrst_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x);
-static void pisces_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x);
-static void mimonkey_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x);
-static void mariner_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x);
-static void dambustr_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x);
+static void (*modify_charcode)(running_machine &machine, UINT16 *code,UINT8 x); /* function to call to do character banking */
+static void mooncrst_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x);
+static void pisces_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x);
+static void mimonkey_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x);
+static void mariner_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x);
+static void dambustr_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x);
static void (*modify_spritecode)(UINT8 *spriteram,int*,int*,int*,int); /* function to call to do sprite banking */
static void mshuttle_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs);
@@ -89,36 +89,36 @@ static UINT8 stars_blink_state;
static emu_timer *stars_blink_timer;
static emu_timer *stars_scroll_timer;
static UINT8 timer_adjusted;
- void galaxold_init_stars(running_machine *machine, int colors_offset);
-static void (*draw_stars)(running_machine *machine, bitmap_t *, const rectangle *); /* function to call to draw the star layer */
-static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
- void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void scrambold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+ void galaxold_init_stars(running_machine &machine, int colors_offset);
+static void (*draw_stars)(running_machine &machine, bitmap_t *, const rectangle *); /* function to call to draw the star layer */
+static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+ void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
static void start_stars_blink_timer(double ra, double rb, double c);
-static void start_stars_scroll_timer(running_machine *machine);
+static void start_stars_scroll_timer(running_machine &machine);
/* bullets circuit */
static UINT8 darkplnt_bullet_color;
-static void (*draw_bullets)(running_machine *,bitmap_t *,const rectangle *,int,int,int); /* function to call to draw a bullet */
-static void galaxold_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-static void scrambold_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
-static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+static void (*draw_bullets)(running_machine &,bitmap_t *,const rectangle *,int,int,int); /* function to call to draw a bullet */
+static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
+static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
/* background circuit */
static UINT8 background_enable;
static UINT8 background_red, background_green, background_blue;
-static void (*draw_background)(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); /* function to call to draw the background */
-static void galaxold_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void scrambold_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void ad2083_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
-static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void (*draw_background)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); /* function to call to draw the background */
+static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
static UINT16 rockclim_v;
static UINT16 rockclim_h;
@@ -169,7 +169,7 @@ PALETTE_INIT( galaxold )
/* first, the character/sprite palette */
- len = machine->region("proms")->bytes();
+ len = machine.region("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -243,7 +243,7 @@ PALETTE_INIT( rockclim )
/* first, the character/sprite palette */
- len = machine->region("proms")->bytes();
+ len = machine.region("proms")->bytes();
for (i = 0;i < len;i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -410,7 +410,7 @@ PALETTE_INIT( dambustr )
int i, len;
/* first, the character/sprite palette */
- len = machine->region("proms")->bytes();
+ len = machine.region("proms")->bytes();
for (i = 0;i < len;i++)
{
@@ -494,7 +494,7 @@ PALETTE_INIT( turtles )
***************************************************************************/
-static void state_save_register(running_machine *machine)
+static void state_save_register(running_machine &machine)
{
state_save_register_global_array(machine, gfxbank);
state_save_register_global(machine, flipscreen_x);
@@ -512,7 +512,7 @@ static void state_save_register(running_machine *machine)
state_save_register_global(machine, background_blue);
}
-static void video_start_common(running_machine *machine, tilemap_mapper_func get_memory_offset)
+static void video_start_common(running_machine &machine, tilemap_mapper_func get_memory_offset)
{
bg_tilemap = tilemap_create(machine, get_tile_info,get_memory_offset,8,8,32,32);
@@ -544,7 +544,7 @@ static void video_start_common(running_machine *machine, tilemap_mapper_func get
spritevisiblearea = &_spritevisiblearea;
spritevisibleareaflipx = &_spritevisibleareaflipx;
- color_mask = (machine->gfx[0]->color_granularity == 4) ? 7 : 3;
+ color_mask = (machine.gfx[0]->color_granularity == 4) ? 7 : 3;
state_save_register(machine);
}
@@ -682,7 +682,7 @@ VIDEO_START( pisces )
}
#ifdef UNUSED_FUNCTION
-static void theend_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+static void theend_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
int i;
@@ -721,7 +721,7 @@ VIDEO_START( mooncrst )
modify_spritecode = mooncrst_modify_spritecode;
}
-static void batman2_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void batman2_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
if (*code & 0x80)
{
@@ -740,7 +740,7 @@ VIDEO_START( batman2 )
-static void rockclim_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void rockclim_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
tilemap_draw(bitmap,cliprect,rockclim_tilemap, 0,0);
}
@@ -954,7 +954,7 @@ VIDEO_START( dambustr )
draw_bullets = dambustr_draw_bullets;
/* allocate the temporary bitmap for the background priority */
- dambustr_tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ dambustr_tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
/* make a copy of the tilemap to emulate background priority */
dambustr_videoram2 = auto_alloc_array(machine, UINT8, 0x0400);
@@ -1137,7 +1137,7 @@ WRITE8_HANDLER( dambustr_bg_color_w )
/* character banking functions */
-static void mooncrst_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void mooncrst_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
if (gfxbank[2] && ((*code & 0xc0) == 0x80))
{
@@ -1145,29 +1145,29 @@ static void mooncrst_modify_charcode(running_machine *machine, UINT16 *code,UINT
}
}
-static void pisces_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void pisces_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
*code |= (gfxbank[0] << 8);
}
-static void mimonkey_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void mimonkey_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
*code |= (gfxbank[0] << 8) | (gfxbank[2] << 9);
}
-static void mariner_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void mariner_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
UINT8 *prom;
/* bit 0 of the PROM controls character banking */
- prom = machine->region("user2")->base();
+ prom = machine.region("user2")->base();
*code |= ((prom[x] & 0x01) << 8);
}
-static void dambustr_modify_charcode(running_machine *machine, UINT16 *code,UINT8 x)
+static void dambustr_modify_charcode(running_machine &machine, UINT16 *code,UINT8 x)
{
if (dambustr_char_bank == 0) { // text mode
*code |= 0x0300;
@@ -1233,7 +1233,7 @@ static void drivfrcg_modify_color(UINT8 *color)
/* bullet drawing functions */
-static void galaxold_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
int i;
@@ -1255,7 +1255,7 @@ static void galaxold_draw_bullets(running_machine *machine, bitmap_t *bitmap, co
}
}
-static void scrambold_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
if (flipscreen_x) x++;
@@ -1266,7 +1266,7 @@ static void scrambold_draw_bullets(running_machine *machine, bitmap_t *bitmap, c
*BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
}
-static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
if (flipscreen_x) x++;
@@ -1276,7 +1276,7 @@ static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, co
*BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color;
}
-static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
+static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
{
int i, color;
@@ -1306,13 +1306,13 @@ static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, co
/* background drawing functions */
-static void galaxold_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* plain black background */
bitmap_fill(bitmap,cliprect,0);
}
-static void scrambold_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
if (background_enable)
bitmap_fill(bitmap,cliprect,BACKGROUND_COLOR_BASE);
@@ -1320,14 +1320,14 @@ static void scrambold_draw_background(running_machine *machine, bitmap_t *bitmap
bitmap_fill(bitmap,cliprect,0);
}
-static void ad2083_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int color = (background_blue << 2) | (background_green << 1) | background_red;
bitmap_fill(bitmap,cliprect,BACKGROUND_COLOR_BASE + color);
}
-static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
UINT8 x;
UINT8 *prom;
@@ -1341,7 +1341,7 @@ static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap,
the green gun if BCG is asserted
bits 2-7 are unconnected */
- prom = machine->region("user1")->base();
+ prom = machine.region("user1")->base();
for (x = 0; x < 32; x++)
{
@@ -1363,7 +1363,7 @@ static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap,
}
}
-static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
if (background_enable)
{
@@ -1383,7 +1383,7 @@ static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap,
bitmap_fill(bitmap,cliprect,0);
}
-static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
if (background_enable)
{
@@ -1402,7 +1402,7 @@ static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap, c
bitmap_fill(bitmap,cliprect,0);
}
-static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int base = BACKGROUND_COLOR_BASE;
UINT8 x;
@@ -1413,7 +1413,7 @@ static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap,
line (column) of the screen. The first 0x20 bytes for unflipped,
and the 2nd 0x20 bytes for flipped screen. */
- prom = machine->region("user1")->base();
+ prom = machine.region("user1")->base();
if (flipscreen_x)
{
@@ -1445,7 +1445,7 @@ static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap,
}
}
-static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int base = BACKGROUND_COLOR_BASE;
int col1 = base + dambustr_bg_color_1;
@@ -1464,7 +1464,7 @@ static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap,
}
-static void dambustr_draw_upper_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void dambustr_draw_upper_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
static rectangle clip = { 0, 0, 0, 0 };
@@ -1490,7 +1490,7 @@ static void dambustr_draw_upper_background(running_machine *machine, bitmap_t *b
/* star drawing functions */
-void galaxold_init_stars(running_machine *machine, int colors_offset)
+void galaxold_init_stars(running_machine &machine, int colors_offset)
{
int i;
int total_stars;
@@ -1500,8 +1500,8 @@ void galaxold_init_stars(running_machine *machine, int colors_offset)
galaxold_stars_on = 0;
stars_blink_state = 0;
- stars_blink_timer = machine->scheduler().timer_alloc(FUNC(stars_blink_callback));
- stars_scroll_timer = machine->scheduler().timer_alloc(FUNC(stars_scroll_callback));
+ stars_blink_timer = machine.scheduler().timer_alloc(FUNC(stars_blink_callback));
+ stars_scroll_timer = machine.scheduler().timer_alloc(FUNC(stars_scroll_callback));
timer_adjusted = 0;
stars_colors_start = colors_offset;
@@ -1573,11 +1573,11 @@ static void plot_star(bitmap_t *bitmap, int x, int y, int color, const rectangle
*BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
}
-static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
}
-void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int offs;
@@ -1604,7 +1604,7 @@ void galaxold_draw_stars(running_machine *machine, bitmap_t *bitmap, const recta
}
}
-static void scrambold_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int offs;
@@ -1648,7 +1648,7 @@ static void scrambold_draw_stars(running_machine *machine, bitmap_t *bitmap, con
}
}
-static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int offs;
@@ -1694,7 +1694,7 @@ static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int offs;
UINT8 *prom;
@@ -1709,7 +1709,7 @@ static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const
/* bit 2 of the PROM controls star visibility */
- prom = machine->region("user2")->base();
+ prom = machine.region("user2")->base();
for (offs = 0;offs < STAR_COUNT;offs++)
{
@@ -1752,9 +1752,9 @@ static TIMER_CALLBACK( stars_scroll_callback )
}
}
-static void start_stars_scroll_timer(running_machine *machine)
+static void start_stars_scroll_timer(running_machine &machine)
{
- stars_scroll_timer->adjust(machine->primary_screen->frame_period(), 0, machine->primary_screen->frame_period());
+ stars_scroll_timer->adjust(machine.primary_screen->frame_period(), 0, machine.primary_screen->frame_period());
}
@@ -1785,7 +1785,7 @@ static TILE_GET_INFO( rockclim_get_tile_info )
SET_TILE_INFO(2, code, 0, 0);
}
-static void draw_bullets_common(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bullets_common(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int offs;
@@ -1804,7 +1804,7 @@ static void draw_bullets_common(running_machine *machine, bitmap_t *bitmap, cons
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spriteram, size_t spriteram_size)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, UINT8 *spriteram, size_t spriteram_size)
{
int offs;
@@ -1861,7 +1861,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spri
if (offs < 3*4) sy++;
- drawgfx_transpen(bitmap,flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,machine->gfx[1],
+ drawgfx_transpen(bitmap,flipscreen_x ? spritevisibleareaflipx : spritevisiblearea,machine.gfx[1],
code,color,
flipx,flipy,
sx,sy,0);
@@ -1871,12 +1871,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spri
SCREEN_UPDATE( galaxold )
{
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
if (galaxold_stars_on)
{
- draw_stars(screen->machine, bitmap, cliprect);
+ draw_stars(screen->machine(), bitmap, cliprect);
}
@@ -1885,15 +1885,15 @@ SCREEN_UPDATE( galaxold )
if (draw_bullets)
{
- draw_bullets_common(screen->machine, bitmap, cliprect);
+ draw_bullets_common(screen->machine(), bitmap, cliprect);
}
- draw_sprites(screen->machine, bitmap, galaxold_spriteram, galaxold_spriteram_size);
+ draw_sprites(screen->machine(), bitmap, galaxold_spriteram, galaxold_spriteram_size);
if (spriteram2_present)
{
- draw_sprites(screen->machine, bitmap, galaxold_spriteram2, galaxold_spriteram2_size);
+ draw_sprites(screen->machine(), bitmap, galaxold_spriteram2, galaxold_spriteram2_size);
}
return 0;
}
@@ -1904,11 +1904,11 @@ SCREEN_UPDATE( dambustr )
int i, j;
UINT8 color;
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
if (galaxold_stars_on)
{
- draw_stars(screen->machine, bitmap, cliprect);
+ draw_stars(screen->machine(), bitmap, cliprect);
}
/* save the background for drawing it again later, if background has priority over characters */
@@ -1918,15 +1918,15 @@ SCREEN_UPDATE( dambustr )
if (draw_bullets)
{
- draw_bullets_common(screen->machine, bitmap, cliprect);
+ draw_bullets_common(screen->machine(), bitmap, cliprect);
}
- draw_sprites(screen->machine, bitmap, galaxold_spriteram, galaxold_spriteram_size);
+ draw_sprites(screen->machine(), bitmap, galaxold_spriteram, galaxold_spriteram_size);
if (dambustr_bg_priority)
{
/* draw the upper part of the background, as it has priority */
- dambustr_draw_upper_background(screen->machine, bitmap, cliprect);
+ dambustr_draw_upper_background(screen->machine(), bitmap, cliprect);
/* only rows with color code > 3 are stronger than the background */
memset(dambustr_videoram2, 0x20, 0x0400);
diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c
index 73ff30d6a6f..d94fe4ecb38 100644
--- a/src/mame/video/galivan.c
+++ b/src/mame/video/galivan.c
@@ -57,7 +57,7 @@ PALETTE_INIT( galivan )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -66,7 +66,7 @@ PALETTE_INIT( galivan )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -74,7 +74,7 @@ PALETTE_INIT( galivan )
/* characters use colors 0-0x7f */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* I think that */
/* background tiles use colors 0xc0-0xff in four banks */
@@ -89,7 +89,7 @@ PALETTE_INIT( galivan )
else
ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0);
- colortable_entry_set_value(machine->colortable, 0x80 + i, ctabentry);
+ colortable_entry_set_value(machine.colortable, 0x80 + i, ctabentry);
}
/* sprites use colors 0x80-0xbf in four banks */
@@ -107,7 +107,7 @@ PALETTE_INIT( galivan )
else
ctabentry = 0x80 | ((i & 0x03) << 4) | (color_prom[i >> 4] & 0x0f);
- colortable_entry_set_value(machine->colortable, 0x180 + i_swapped, ctabentry);
+ colortable_entry_set_value(machine.colortable, 0x180 + i_swapped, ctabentry);
}
}
@@ -121,7 +121,7 @@ PALETTE_INIT( galivan )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *BGROM = machine->region("gfx4")->base();
+ UINT8 *BGROM = machine.region("gfx4")->base();
int attr = BGROM[tile_index + 0x4000];
int code = BGROM[tile_index] | ((attr & 0x03) << 8);
SET_TILE_INFO(
@@ -133,7 +133,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] | ((attr & 0x01) << 8);
SET_TILE_INFO(
@@ -146,7 +146,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( ninjemak_get_bg_tile_info )
{
- UINT8 *BGROM = machine->region("gfx4")->base();
+ UINT8 *BGROM = machine.region("gfx4")->base();
int attr = BGROM[tile_index + 0x4000];
int code = BGROM[tile_index] | ((attr & 0x03) << 8);
SET_TILE_INFO(
@@ -158,7 +158,7 @@ static TILE_GET_INFO( ninjemak_get_bg_tile_info )
static TILE_GET_INFO( ninjemak_get_tx_tile_info )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] | ((attr & 0x03) << 8);
SET_TILE_INFO(
@@ -178,7 +178,7 @@ static TILE_GET_INFO( ninjemak_get_tx_tile_info )
VIDEO_START( galivan )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 128, 128);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -188,7 +188,7 @@ VIDEO_START( galivan )
VIDEO_START( ninjemak )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
state->bg_tilemap = tilemap_create(machine, ninjemak_get_bg_tile_info, tilemap_scan_cols, 16, 16, 512, 32);
state->tx_tilemap = tilemap_create(machine, ninjemak_get_tx_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -206,14 +206,14 @@ VIDEO_START( ninjemak )
WRITE8_HANDLER( galivan_videoram_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
WRITE8_HANDLER( galivan_colorram_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
@@ -221,11 +221,11 @@ WRITE8_HANDLER( galivan_colorram_w )
/* Written through port 40 */
WRITE8_HANDLER( galivan_gfxbank_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
/* bits 0 and 1 coin counters */
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
/* bit 2 flip screen */
state->flipscreen = data & 0x04;
@@ -233,18 +233,18 @@ WRITE8_HANDLER( galivan_gfxbank_w )
tilemap_set_flip (state->tx_tilemap, state->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
/* bit 7 selects one of two ROM banks for c000-dfff */
- memory_set_bank(space->machine, "bank1", (data & 0x80) >> 7);
+ memory_set_bank(space->machine(), "bank1", (data & 0x80) >> 7);
/* logerror("Address: %04X - port 40 = %02x\n", cpu_get_pc(space->cpu), data); */
}
WRITE8_HANDLER( ninjemak_gfxbank_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
/* bits 0 and 1 coin counters */
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
/* bit 2 flip screen */
state->flipscreen = data & 0x04;
@@ -275,7 +275,7 @@ WRITE8_HANDLER( ninjemak_gfxbank_w )
/* bit 5 sprite flag ??? */
/* bit 6, 7 ROM bank select */
- memory_set_bank(space->machine, "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
#if 0
{
@@ -296,7 +296,7 @@ WRITE8_HANDLER( ninjemak_gfxbank_w )
/* Written through port 41-42 */
WRITE8_HANDLER( galivan_scrollx_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
if (offset == 1)
{
if (data & 0x80)
@@ -313,20 +313,20 @@ WRITE8_HANDLER( galivan_scrollx_w )
/* Written through port 43-44 */
WRITE8_HANDLER( galivan_scrolly_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
state->scrolly[offset] = data;
}
WRITE8_HANDLER( ninjemak_scrollx_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
state->scrollx[offset] = data;
}
WRITE8_HANDLER( ninjemak_scrolly_w )
{
- galivan_state *state = space->machine->driver_data<galivan_state>();
+ galivan_state *state = space->machine().driver_data<galivan_state>();
state->scrolly[offset] = data;
}
@@ -338,10 +338,10 @@ WRITE8_HANDLER( ninjemak_scrolly_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- galivan_state *state = machine->driver_data<galivan_state>();
- const UINT8 *spritepalettebank = machine->region("user1")->base();
+ galivan_state *state = machine.driver_data<galivan_state>();
+ const UINT8 *spritepalettebank = machine.region("user1")->base();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -368,7 +368,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
// code = spriteram[offs + 1] + ((attr & 0x02) << 7);
code = spriteram[offs + 1] + ((attr & 0x06) << 7); // for ninjemak, not sure ?
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color + 16 * (spritepalettebank[code >> 2] & 0x0f),
flipx,flipy,
@@ -379,7 +379,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( galivan )
{
- galivan_state *state = screen->machine->driver_data<galivan_state>();
+ galivan_state *state = screen->machine().driver_data<galivan_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0] + 256 * (state->scrollx[1] & 0x07));
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[0] + 256 * (state->scrolly[1] & 0x07));
@@ -392,11 +392,11 @@ SCREEN_UPDATE( galivan )
{
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
else
{
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 1, 0);
}
@@ -406,7 +406,7 @@ SCREEN_UPDATE( galivan )
SCREEN_UPDATE( ninjemak )
{
- galivan_state *state = screen->machine->driver_data<galivan_state>();
+ galivan_state *state = screen->machine().driver_data<galivan_state>();
/* (scrollx[1] & 0x40) does something */
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0] + 256 * (state->scrollx[1] & 0x1f));
@@ -417,7 +417,7 @@ SCREEN_UPDATE( ninjemak )
else
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c
index 3880b6b4c31..25be07e2df4 100644
--- a/src/mame/video/galpani2.c
+++ b/src/mame/video/galpani2.c
@@ -29,10 +29,10 @@
#define galpani2_BG8_REGS_R( _n_ ) \
READ16_HANDLER( galpani2_bg8_regs_##_n_##_r ) \
{ \
- galpani2_state *state = space->machine->driver_data<galpani2_state>(); \
+ galpani2_state *state = space->machine().driver_data<galpani2_state>(); \
switch (offset * 2) \
{ \
- case 0x16: return space->machine->rand() & 1; \
+ case 0x16: return space->machine().rand() & 1; \
default: \
logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",cpu_get_pc(space->cpu),_n_,offset*2); \
} \
@@ -49,7 +49,7 @@ READ16_HANDLER( galpani2_bg8_regs_##_n_##_r ) \
#define galpani2_BG8_REGS_W( _n_ ) \
WRITE16_HANDLER( galpani2_bg8_regs_##_n_##_w ) \
{ \
- galpani2_state *state = space->machine->driver_data<galpani2_state>(); \
+ galpani2_state *state = space->machine().driver_data<galpani2_state>(); \
COMBINE_DATA(&state->bg8_regs_##_n_[offset]); \
}
#endif
@@ -57,7 +57,7 @@ WRITE16_HANDLER( galpani2_bg8_regs_##_n_##_w ) \
#define galpani2_BG8_W( _n_ ) \
WRITE16_HANDLER( galpani2_bg8_##_n_##_w ) \
{ \
- galpani2_state *state = space->machine->driver_data<galpani2_state>(); \
+ galpani2_state *state = space->machine().driver_data<galpani2_state>(); \
int x,y,pen; \
UINT16 newword = COMBINE_DATA(&state->bg8_##_n_[offset]); \
pen = newword & 0xff; \
@@ -69,9 +69,9 @@ WRITE16_HANDLER( galpani2_bg8_##_n_##_w ) \
#define galpani2_BG8_PALETTE_W( _n_ ) \
WRITE16_HANDLER( galpani2_palette_##_n_##_w ) \
{ \
- galpani2_state *state = space->machine->driver_data<galpani2_state>(); \
+ galpani2_state *state = space->machine().driver_data<galpani2_state>(); \
UINT16 newword = COMBINE_DATA(&state->palette_##_n_[offset]); \
- palette_set_color_rgb( space->machine, offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) ); \
+ palette_set_color_rgb( space->machine(), offset + 0x4000 + _n_ * 0x100, pal5bit(newword >> 5), pal5bit(newword >> 10), pal5bit(newword >> 0) ); \
}
#ifdef UNUSED_FUNCTION
@@ -100,7 +100,7 @@ galpani2_BG8_PALETTE_W( 1 )
/* 8 horizontal pages of 256x256 pixels? */
WRITE16_HANDLER( galpani2_bg15_w )
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
UINT16 newword = COMBINE_DATA(&state->bg15[offset]);
int x = (offset % 256) + (offset / (256*256)) * 256 ;
@@ -130,7 +130,7 @@ PALETTE_INIT( galpani2 )
VIDEO_START( galpani2 )
{
- galpani2_state *state = machine->driver_data<galpani2_state>();
+ galpani2_state *state = machine.driver_data<galpani2_state>();
state->bg15_bitmap = auto_bitmap_alloc(machine, 256*8, 256, BITMAP_FORMAT_INDEXED16);
state->bg8_bitmap_0 = auto_bitmap_alloc(machine, 512, 256, BITMAP_FORMAT_INDEXED16);
state->bg8_bitmap_1 = auto_bitmap_alloc(machine, 512, 256, BITMAP_FORMAT_INDEXED16);
@@ -149,23 +149,23 @@ VIDEO_START( galpani2 )
SCREEN_UPDATE( galpani2 )
{
- galpani2_state *state = screen->machine->driver_data<galpani2_state>();
+ galpani2_state *state = screen->machine().driver_data<galpani2_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
bitmap_fill(bitmap,cliprect,0);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (layers_ctrl & 0x1)
{
@@ -200,6 +200,6 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
cliprect,0x4000 + 0);
}
- if (layers_ctrl & 0x8) kaneko16_draw_sprites(screen->machine, bitmap, cliprect);
+ if (layers_ctrl & 0x8) kaneko16_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c
index c4e9fa99bda..6a08ae8037a 100644
--- a/src/mame/video/galpanic.c
+++ b/src/mame/video/galpanic.c
@@ -5,9 +5,9 @@
VIDEO_START( galpanic )
{
- galpanic_state *state = machine->driver_data<galpanic_state>();
- machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
- state->sprites_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ galpanic_state *state = machine.driver_data<galpanic_state>();
+ machine.generic.tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
+ state->sprites_bitmap = machine.primary_screen->alloc_compatible_bitmap();
}
PALETTE_INIT( galpanic )
@@ -25,7 +25,7 @@ PALETTE_INIT( galpanic )
WRITE16_HANDLER( galpanic_bgvideoram_w )
{
- galpanic_state *state = space->machine->driver_data<galpanic_state>();
+ galpanic_state *state = space->machine().driver_data<galpanic_state>();
int sx,sy;
@@ -34,20 +34,20 @@ WRITE16_HANDLER( galpanic_bgvideoram_w )
sy = offset / 256;
sx = offset % 256;
- *BITMAP_ADDR16(space->machine->generic.tmpbitmap, sy, sx) = 1024 + (data >> 1);
+ *BITMAP_ADDR16(space->machine().generic.tmpbitmap, sy, sx) = 1024 + (data >> 1);
}
WRITE16_HANDLER( galpanic_paletteram_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
/* bit 0 seems to be a transparency flag for the front bitmap */
- palette_set_color_rgb(space->machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
+ palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
}
-static void comad_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void comad_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- galpanic_state *state = machine->driver_data<galpanic_state>();
+ galpanic_state *state = machine.driver_data<galpanic_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
int sx=0, sy=0;
@@ -75,7 +75,7 @@ static void comad_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
sx = (sx&0x1ff) - (sx&0x200);
sy = (sy&0x1ff) - (sy&0x200);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
@@ -83,9 +83,9 @@ static void comad_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void draw_fgbitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- galpanic_state *state = machine->driver_data<galpanic_state>();
+ galpanic_state *state = machine.driver_data<galpanic_state>();
int offs;
for (offs = 0;offs < state->fgvideoram_size/2;offs++)
@@ -102,12 +102,12 @@ static void draw_fgbitmap(running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( galpanic )
{
- device_t *pandora = screen->machine->device("pandora");
+ device_t *pandora = screen->machine().device("pandora");
/* copy the temporary bitmap to the screen */
- copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,0,0,cliprect);
+ copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,0,0,cliprect);
- draw_fgbitmap(screen->machine, bitmap, cliprect);
+ draw_fgbitmap(screen->machine(), bitmap, cliprect);
pandora_update(pandora, bitmap, cliprect);
@@ -116,22 +116,22 @@ SCREEN_UPDATE( galpanic )
SCREEN_UPDATE( comad )
{
- galpanic_state *state = screen->machine->driver_data<galpanic_state>();
+ galpanic_state *state = screen->machine().driver_data<galpanic_state>();
/* copy the temporary bitmap to the screen */
- copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,0,0,cliprect);
+ copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,0,0,cliprect);
- draw_fgbitmap(screen->machine, bitmap, cliprect);
+ draw_fgbitmap(screen->machine(), bitmap, cliprect);
// if(galpanic_clear_sprites)
{
bitmap_fill(state->sprites_bitmap,cliprect,0);
- comad_draw_sprites(screen->machine,bitmap,cliprect);
+ comad_draw_sprites(screen->machine(),bitmap,cliprect);
}
// else
// {
// /* keep sprites on the bitmap without clearing them */
-// comad_draw_sprites(screen->machine,state->sprites_bitmap,0);
+// comad_draw_sprites(screen->machine(),state->sprites_bitmap,0);
// copybitmap_trans(bitmap,state->sprites_bitmap,0,0,0,0,cliprect,0);
// }
return 0;
diff --git a/src/mame/video/galspnbl.c b/src/mame/video/galspnbl.c
index 29efda3b728..e15b22a9305 100644
--- a/src/mame/video/galspnbl.c
+++ b/src/mame/video/galspnbl.c
@@ -29,9 +29,9 @@ PALETTE_INIT( galspnbl )
* 4 | xxxxxxxxxxxxxxxx | x position
* 5,6,7| | unused
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- galspnbl_state *state = machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = machine.driver_data<galspnbl_state>();
UINT16 *spriteram = state->spriteram;
int offs;
static const UINT8 layout[8][8] =
@@ -52,7 +52,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int col, row;
attr = spriteram[offs];
- if ((attr & 0x0004) && ((attr & 0x0040) == 0 || (machine->primary_screen->frame_number() & 1))
+ if ((attr & 0x0004) && ((attr & 0x0040) == 0 || (machine.primary_screen->frame_number() & 1))
// && ((attr & 0x0030) >> 4) == priority)
&& ((attr & 0x0020) >> 5) == priority)
{
@@ -72,7 +72,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
int x = sx + 8 * (flipx ? (size - 1 - col) : col);
int y = sy + 8 * (flipy ? (size - 1 - row) : row);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + layout[row][col],
color,
flipx,flipy,
@@ -84,9 +84,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- galspnbl_state *state = machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = machine.driver_data<galspnbl_state>();
offs_t offs;
// int screenscroll = 4 - (state->scroll[0] & 0xff);
@@ -103,12 +103,12 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
SCREEN_UPDATE( galspnbl )
{
- galspnbl_state *state = screen->machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = screen->machine().driver_data<galspnbl_state>();
int offs;
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
for (offs = 0; offs < 0x1000 / 2; offs++)
{
@@ -123,7 +123,7 @@ SCREEN_UPDATE( galspnbl )
/* What is this? A priority/half transparency marker? */
if (!(attr & 0x0008))
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
color,
0,0,
@@ -132,6 +132,6 @@ SCREEN_UPDATE( galspnbl )
}
}
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
return 0;
}
diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c
index f8d80b5d69f..79adb803db7 100644
--- a/src/mame/video/gameplan.c
+++ b/src/mame/video/gameplan.c
@@ -71,7 +71,7 @@ static void leprechn_get_pens( pen_t *pens )
static SCREEN_UPDATE( gameplan )
{
- gameplan_state *state = screen->machine->driver_data<gameplan_state>();
+ gameplan_state *state = screen->machine().driver_data<gameplan_state>();
pen_t pens[GAMEPLAN_NUM_PENS];
offs_t offs;
@@ -91,7 +91,7 @@ static SCREEN_UPDATE( gameplan )
static SCREEN_UPDATE( leprechn )
{
- gameplan_state *state = screen->machine->driver_data<gameplan_state>();
+ gameplan_state *state = screen->machine().driver_data<gameplan_state>();
pen_t pens[LEPRECHN_NUM_PENS];
offs_t offs;
@@ -118,7 +118,7 @@ static SCREEN_UPDATE( leprechn )
static WRITE8_DEVICE_HANDLER( video_data_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
state->video_data = data;
}
@@ -126,7 +126,7 @@ static WRITE8_DEVICE_HANDLER( video_data_w )
static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
state->video_command = data & 0x07;
}
@@ -134,7 +134,7 @@ static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
static WRITE8_DEVICE_HANDLER( leprechn_video_command_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
state->video_command = (data >> 3) & 0x07;
}
@@ -142,7 +142,7 @@ static WRITE8_DEVICE_HANDLER( leprechn_video_command_w )
static TIMER_CALLBACK( clear_screen_done_callback )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
/* indicate that the we are done clearing the screen */
state->via_0->write_ca1(0);
@@ -151,7 +151,7 @@ static TIMER_CALLBACK( clear_screen_done_callback )
static WRITE_LINE_DEVICE_HANDLER( video_command_trigger_w )
{
- gameplan_state *driver_state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *driver_state = device->machine().driver_data<gameplan_state>();
if (state == 0)
{
@@ -203,7 +203,7 @@ static WRITE_LINE_DEVICE_HANDLER( video_command_trigger_w )
/* set a timer for an arbitrarily short period.
The real time it takes to clear to screen is not
important to the software */
- device->machine->scheduler().synchronize(FUNC(clear_screen_done_callback));
+ device->machine().scheduler().synchronize(FUNC(clear_screen_done_callback));
break;
}
@@ -213,7 +213,7 @@ static WRITE_LINE_DEVICE_HANDLER( video_command_trigger_w )
static TIMER_CALLBACK( via_irq_delayed )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
device_set_input_line(state->maincpu, 0, param);
}
@@ -223,7 +223,7 @@ static void via_irq(device_t *device, int state)
/* Kaos sits in a tight loop polling the VIA irq flags register, but that register is
cleared by the irq handler. Therefore, I wait a bit before triggering the irq to
leave time for the program to see the flag change. */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(via_irq_delayed), state);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(via_irq_delayed), state);
}
@@ -266,15 +266,15 @@ const via6522_interface trvquest_via_0_interface =
static TIMER_CALLBACK( via_0_ca1_timer_callback )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
/* !VBLANK is connected to CA1 */
state->via_0->write_ca1(param);
if (param)
- state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBSTART));
+ state->via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBSTART));
else
- state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBEND), 1);
+ state->via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBEND), 1);
}
@@ -286,12 +286,12 @@ static TIMER_CALLBACK( via_0_ca1_timer_callback )
static VIDEO_START( common )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
state->videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
state->videoram = auto_alloc_array(machine, UINT8, state->videoram_size);
- state->via_0_ca1_timer = machine->scheduler().timer_alloc(FUNC(via_0_ca1_timer_callback));
+ state->via_0_ca1_timer = machine.scheduler().timer_alloc(FUNC(via_0_ca1_timer_callback));
/* register for save states */
state->save_pointer(NAME(state->videoram), state->videoram_size);
@@ -325,8 +325,8 @@ static VIDEO_START( trvquest )
static VIDEO_RESET( gameplan )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
- state->via_0_ca1_timer->adjust(machine->primary_screen->time_until_pos(VBSTART));
+ gameplan_state *state = machine.driver_data<gameplan_state>();
+ state->via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBSTART));
}
diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c
index 9eed5d75e71..ce2556e5158 100644
--- a/src/mame/video/gaplus.c
+++ b/src/mame/video/gaplus.c
@@ -28,7 +28,7 @@ PALETTE_INIT( gaplus )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
for (i = 0;i < 256;i++)
{
@@ -53,20 +53,20 @@ PALETTE_INIT( gaplus )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
}
color_prom += 0x300;
/* color_prom now points to the beginning of the lookup table */
/* characters use colors 0xf0-0xff */
- for (i = 0;i < machine->gfx[0]->total_colors * machine->gfx[0]->color_granularity;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i, 0xf0 + (*color_prom++ & 0x0f));
+ for (i = 0;i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity;i++)
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, 0xf0 + (*color_prom++ & 0x0f));
/* sprites */
- for (i = 0;i < machine->gfx[1]->total_colors * machine->gfx[1]->color_granularity;i++)
+ for (i = 0;i < machine.gfx[1]->total_colors * machine.gfx[1]->color_granularity;i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + i, (color_prom[0] & 0x0f) + ((color_prom[0x200] & 0x0f) << 4));
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i, (color_prom[0] & 0x0f) + ((color_prom[0x200] & 0x0f) << 4));
color_prom++;
}
}
@@ -96,7 +96,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( get_tile_info )
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
UINT8 attr = state->videoram[tile_index + 0x400];
tileinfo->category = (attr & 0x40) >> 6;
tileinfo->group = attr & 0x3f;
@@ -125,16 +125,16 @@ static TILE_GET_INFO( get_tile_info )
#define SPEED_2 1.0
#define SPEED_3 2.0
-static void starfield_init(running_machine *machine)
+static void starfield_init(running_machine &machine)
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
struct star *stars = state->stars;
int generator = 0;
int x,y;
int set = 0;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->total_stars = 0;
@@ -181,10 +181,10 @@ static void starfield_init(running_machine *machine)
VIDEO_START( gaplus )
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan,8,8,36,28);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 0xff);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 0xff);
starfield_init(machine);
}
@@ -199,20 +199,20 @@ VIDEO_START( gaplus )
READ8_HANDLER( gaplus_videoram_r )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( gaplus_videoram_w )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( gaplus_starfield_control_w )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
offset &= 3;
state->starfield_control[offset] = data;
}
@@ -225,14 +225,14 @@ WRITE8_HANDLER( gaplus_starfield_control_w )
***************************************************************************/
-static void starfield_render(running_machine *machine, bitmap_t *bitmap)
+static void starfield_render(running_machine &machine, bitmap_t *bitmap)
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
struct star *stars = state->stars;
int i;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* check if we're running */
if ( ( state->starfield_control[0] & 1 ) == 0 )
@@ -253,9 +253,9 @@ static void starfield_render(running_machine *machine, bitmap_t *bitmap)
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
UINT8 *spriteram = state->spriteram + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
UINT8 *spriteram_3 = spriteram_2 + 0x800;
@@ -295,12 +295,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
sprite + (duplicate ? 0 : (gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)])),
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0xff));
}
}
}
@@ -309,18 +309,18 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( gaplus )
{
- gaplus_state *state = screen->machine->driver_data<gaplus_state>();
+ gaplus_state *state = screen->machine().driver_data<gaplus_state>();
/* flip screen control is embedded in RAM */
- flip_screen_set(screen->machine, state->spriteram[0x1f7f-0x800] & 1);
+ flip_screen_set(screen->machine(), state->spriteram[0x1f7f-0x800] & 1);
bitmap_fill(bitmap, cliprect, 0);
- starfield_render(screen->machine, bitmap);
+ starfield_render(screen->machine(), bitmap);
/* draw the low priority characters */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
/* draw the high priority characters */
/* (I don't know if this feature is used by Gaplus, but it's shown in the schematics) */
@@ -331,12 +331,12 @@ SCREEN_UPDATE( gaplus )
SCREEN_EOF( gaplus ) /* update starfields */
{
- gaplus_state *state = machine->driver_data<gaplus_state>();
+ gaplus_state *state = machine.driver_data<gaplus_state>();
struct star *stars = state->stars;
int i;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* check if we're running */
if ( ( state->starfield_control[0] & 1 ) == 0 )
diff --git a/src/mame/video/gatron.c b/src/mame/video/gatron.c
index a9472e5f4c2..68ebf99eaaa 100644
--- a/src/mame/video/gatron.c
+++ b/src/mame/video/gatron.c
@@ -23,7 +23,7 @@
WRITE8_HANDLER( gat_videoram_w )
{
- gatron_state *state = space->machine->driver_data<gatron_state>();
+ gatron_state *state = space->machine().driver_data<gatron_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -31,7 +31,7 @@ WRITE8_HANDLER( gat_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- gatron_state *state = machine->driver_data<gatron_state>();
+ gatron_state *state = machine.driver_data<gatron_state>();
UINT8 *videoram = state->videoram;
/* - bits -
7654 3210
@@ -47,13 +47,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( gat )
{
- gatron_state *state = machine->driver_data<gatron_state>();
+ gatron_state *state = machine.driver_data<gatron_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16);
}
SCREEN_UPDATE( gat )
{
- gatron_state *state = screen->machine->driver_data<gatron_state>();
+ gatron_state *state = screen->machine().driver_data<gatron_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/gauntlet.c b/src/mame/video/gauntlet.c
index cee8bf68a24..309b71616da 100644
--- a/src/mame/video/gauntlet.c
+++ b/src/mame/video/gauntlet.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
UINT16 data = state->playfield[tile_index];
int code = ((state->playfield_tile_bank * 0x1000) + (data & 0xfff)) ^ 0x800;
int color = 0x10 + (state->playfield_color_bank * 8) + ((data >> 12) & 7);
@@ -83,7 +83,7 @@ VIDEO_START( gauntlet )
0 /* callback routine for special entries */
};
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
UINT16 *codelookup;
int i, size;
@@ -120,14 +120,14 @@ VIDEO_START( gauntlet )
WRITE16_HANDLER( gauntlet_xscroll_w )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
UINT16 oldxscroll = *state->xscroll;
COMBINE_DATA(state->xscroll);
/* if something changed, force a partial update */
if (*state->xscroll != oldxscroll)
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* adjust the scrolls */
tilemap_set_scrollx(state->playfield_tilemap, 0, *state->xscroll);
@@ -145,14 +145,14 @@ WRITE16_HANDLER( gauntlet_xscroll_w )
WRITE16_HANDLER( gauntlet_yscroll_w )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
UINT16 oldyscroll = *state->yscroll;
COMBINE_DATA(state->yscroll);
/* if something changed, force a partial update */
if (*state->yscroll != oldyscroll)
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* if the bank changed, mark all tiles dirty */
if (state->playfield_tile_bank != (*state->yscroll & 3))
@@ -177,7 +177,7 @@ WRITE16_HANDLER( gauntlet_yscroll_w )
SCREEN_UPDATE( gauntlet )
{
- gauntlet_state *state = screen->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = screen->machine().driver_data<gauntlet_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/gberet.c b/src/mame/video/gberet.c
index d9b56643d6f..c41f9b65f45 100644
--- a/src/mame/video/gberet.c
+++ b/src/mame/video/gberet.c
@@ -26,7 +26,7 @@ PALETTE_INIT( gberet )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -52,7 +52,7 @@ PALETTE_INIT( gberet )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -61,7 +61,7 @@ PALETTE_INIT( gberet )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
@@ -73,27 +73,27 @@ PALETTE_INIT( gberet )
else
ctabentry = 0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( gberet_videoram_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( gberet_colorram_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( gberet_scroll_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
int scroll;
state->scrollram[offset] = data;
@@ -104,13 +104,13 @@ WRITE8_HANDLER( gberet_scroll_w )
WRITE8_HANDLER( gberet_sprite_bank_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->spritebank = data;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x40) << 2);
int color = attr & 0x0f;
@@ -124,16 +124,16 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( gberet )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 0x10);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 0x10);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void gberet_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
int offs;
UINT8 *sr;
@@ -162,18 +162,18 @@ static void gberet_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy,
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
}
SCREEN_UPDATE( gberet )
{
- gberet_state *state = screen->machine->driver_data<gberet_state>();
+ gberet_state *state = screen->machine().driver_data<gberet_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
- gberet_draw_sprites(screen->machine, bitmap, cliprect);
+ gberet_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -182,7 +182,7 @@ SCREEN_UPDATE( gberet )
WRITE8_HANDLER( gberetb_scroll_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
int scroll = data;
if (offset)
@@ -192,9 +192,9 @@ WRITE8_HANDLER( gberetb_scroll_w )
tilemap_set_scrollx(state->bg_tilemap, offset, scroll + 64 - 8);
}
-static void gberetb_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -218,17 +218,17 @@ static void gberetb_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy,
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
}
SCREEN_UPDATE( gberetb )
{
- gberet_state *state = screen->machine->driver_data<gberet_state>();
+ gberet_state *state = screen->machine().driver_data<gberet_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
- gberetb_draw_sprites(screen->machine, bitmap, cliprect);
+ gberetb_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/gbusters.c b/src/mame/video/gbusters.c
index afbeffacf84..c67a3769ad1 100644
--- a/src/mame/video/gbusters.c
+++ b/src/mame/video/gbusters.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void gbusters_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void gbusters_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x0d) << 8) | ((*color & 0x10) << 5) | (bank << 12);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
@@ -23,9 +23,9 @@ void gbusters_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void gbusters_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void gbusters_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
*priority = (*color & 0x30) >> 4;
*color = state->sprite_colorbase + (*color & 0x0f);
}
@@ -39,7 +39,7 @@ void gbusters_sprite_callback( running_machine *machine, int *code, int *color,
VIDEO_START( gbusters )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
state->layer_colorbase[0] = 48;
state->layer_colorbase[1] = 0;
state->layer_colorbase[2] = 16;
@@ -49,7 +49,7 @@ VIDEO_START( gbusters )
SCREEN_UPDATE( gbusters )
{
- gbusters_state *state = screen->machine->driver_data<gbusters_state>();
+ gbusters_state *state = screen->machine().driver_data<gbusters_state>();
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c
index edc75975525..9970c347d31 100644
--- a/src/mame/video/gcpinbal.c
+++ b/src/mame/video/gcpinbal.c
@@ -7,7 +7,7 @@
static TILE_GET_INFO( get_bg0_tile_info )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
UINT16 tilenum = state->tilemapram[0 + tile_index * 2];
UINT16 attr = state->tilemapram[1 + tile_index * 2];
@@ -20,7 +20,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
UINT16 tilenum = state->tilemapram[0x800 + tile_index * 2];
UINT16 attr = state->tilemapram[0x801 + tile_index * 2];
@@ -33,7 +33,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
UINT16 tilenum = state->tilemapram[0x1000 + tile_index];
SET_TILE_INFO(
@@ -43,9 +43,9 @@ static TILE_GET_INFO( get_fg_tile_info )
0);
}
-static void gcpinbal_core_vh_start( running_machine *machine )
+static void gcpinbal_core_vh_start( running_machine &machine )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
int xoffs = 0;
int yoffs = 0;
@@ -78,13 +78,13 @@ VIDEO_START( gcpinbal )
READ16_HANDLER( gcpinbal_tilemaps_word_r )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
return state->tilemapram[offset];
}
WRITE16_HANDLER( gcpinbal_tilemaps_word_w )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
COMBINE_DATA(&state->tilemapram[offset]);
if (offset < 0x800) /* BG0 */
@@ -169,9 +169,9 @@ WRITE16_HANDLER( gcpinbal_ctrl_word_w )
****************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
UINT16 *spriteram = state->spriteram;
int offs, chain_pos;
int x, y, curx, cury;
@@ -209,12 +209,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
for (chain_pos = chain; chain_pos >= 0; chain_pos--)
{
- pdrawgfx_transpen(bitmap, cliprect,machine->gfx[0],
+ pdrawgfx_transpen(bitmap, cliprect,machine.gfx[0],
code,
col,
flipx, flipy,
curx,cury,
- machine->priority_bitmap,
+ machine.priority_bitmap,
priority ? 0xfc : 0xf0,0);
code++;
@@ -250,25 +250,25 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( gcpinbal )
{
- gcpinbal_state *state = screen->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = screen->machine().driver_data<gcpinbal_state>();
int i;
UINT16 tile_sets = 0;
UINT8 layer[3];
#ifdef MAME_DEBUG
- if (input_code_pressed_once(screen->machine, KEYCODE_V))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_V))
{
state->dislayer[0] ^= 1;
popmessage("bg0: %01x", state->dislayer[0]);
}
- if (input_code_pressed_once(screen->machine, KEYCODE_B))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_B))
{
state->dislayer[1] ^= 1;
popmessage("bg1: %01x", state->dislayer[1]);
}
- if (input_code_pressed_once(screen->machine, KEYCODE_N))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_N))
{
state->dislayer[2] ^= 1;
popmessage("fg: %01x", state->dislayer[2]);
@@ -292,7 +292,7 @@ SCREEN_UPDATE( gcpinbal )
tilemap_set_scrolly(state->tilemap[i], 0, state->scrolly[i]);
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
layer[0] = 0;
@@ -316,7 +316,7 @@ SCREEN_UPDATE( gcpinbal )
tilemap_draw(bitmap, cliprect, state->tilemap[layer[2]], 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 16);
+ draw_sprites(screen->machine(), bitmap, cliprect, 16);
#if 0
{
diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c
index b2a24256b26..50890bd7455 100644
--- a/src/mame/video/genesis.c
+++ b/src/mame/video/genesis.c
@@ -40,11 +40,11 @@
Function Prototypes
******************************************************************************/
-static int vdp_data_r(running_machine *machine);
-static void vdp_data_w(running_machine *machine, int data);
-static int vdp_control_r(running_machine *machine);
+static int vdp_data_r(running_machine &machine);
+static void vdp_data_w(running_machine &machine, int data);
+static int vdp_control_r(running_machine &machine);
static void vdp_control_w(address_space *space, int data);
-static void vdp_register_w(running_machine *machine, int data, int vblank);
+static void vdp_register_w(running_machine &machine, int data, int vblank);
static void vdp_control_dma(address_space *space, int data);
static void vdp_dma_68k(address_space *space);
static void vdp_dma_fill(int);
@@ -132,9 +132,9 @@ static void start_genesis_vdp(screen_device *screen)
genesis_screen = screen;
/* allocate memory for the VDP, the lookup table, and the buffer bitmap */
- vdp_vram = auto_alloc_array(screen->machine, UINT8, VRAM_SIZE);
- vdp_vsram = auto_alloc_array(screen->machine, UINT8, VSRAM_SIZE);
- transparent_lookup = auto_alloc_array(screen->machine, UINT16, 0x1000);
+ vdp_vram = auto_alloc_array(screen->machine(), UINT8, VRAM_SIZE);
+ vdp_vsram = auto_alloc_array(screen->machine(), UINT8, VSRAM_SIZE);
+ transparent_lookup = auto_alloc_array(screen->machine(), UINT16, 0x1000);
/* clear the VDP memory, prevents corrupt tile in Puyo Puyo 2 */
memset(vdp_vram, 0, VRAM_SIZE);
@@ -163,41 +163,41 @@ static void start_genesis_vdp(screen_device *screen)
/* reset VDP */
for (i = 0; i < 24; i++)
- vdp_register_w(screen->machine, 0x8000 | (i << 8) | vdp_init[i], 1);
+ vdp_register_w(screen->machine(), 0x8000 | (i << 8) | vdp_init[i], 1);
vdp_cmdpart = 0;
vdp_code = 0;
vdp_address = 0;
/* Save State Stuff */
- state_save_register_global_array(screen->machine, genesis_vdp_regs);
- state_save_register_global_pointer(screen->machine, vdp_vram, 0x10000);
- state_save_register_global_pointer(screen->machine, vdp_vsram, 0x80);
- state_save_register_global_array(screen->machine, genesis_bg_pal_lookup);
- state_save_register_global_array(screen->machine, genesis_sp_pal_lookup);
- state_save_register_global(screen->machine, display_enable);
- state_save_register_global(screen->machine, vdp_scrollabase);
- state_save_register_global(screen->machine, vdp_scrollbbase);
- state_save_register_global(screen->machine, vdp_windowbase);
- state_save_register_global(screen->machine, vdp_spritebase);
- state_save_register_global(screen->machine, vdp_hscrollbase);
- state_save_register_global(screen->machine, vdp_hscrollmask);
- state_save_register_global(screen->machine, vdp_hscrollsize);
- state_save_register_global(screen->machine, vdp_vscrollmode);
- state_save_register_global(screen->machine, vdp_cmdpart);
- state_save_register_global(screen->machine, vdp_code);
- state_save_register_global(screen->machine, vdp_address);
- state_save_register_global(screen->machine, vdp_dmafill);
- state_save_register_global(screen->machine, scrollheight);
- state_save_register_global(screen->machine, scrollwidth);
- state_save_register_global(screen->machine, bgcol);
- state_save_register_global(screen->machine, window_down);
- state_save_register_global(screen->machine, window_vpos);
+ state_save_register_global_array(screen->machine(), genesis_vdp_regs);
+ state_save_register_global_pointer(screen->machine(), vdp_vram, 0x10000);
+ state_save_register_global_pointer(screen->machine(), vdp_vsram, 0x80);
+ state_save_register_global_array(screen->machine(), genesis_bg_pal_lookup);
+ state_save_register_global_array(screen->machine(), genesis_sp_pal_lookup);
+ state_save_register_global(screen->machine(), display_enable);
+ state_save_register_global(screen->machine(), vdp_scrollabase);
+ state_save_register_global(screen->machine(), vdp_scrollbbase);
+ state_save_register_global(screen->machine(), vdp_windowbase);
+ state_save_register_global(screen->machine(), vdp_spritebase);
+ state_save_register_global(screen->machine(), vdp_hscrollbase);
+ state_save_register_global(screen->machine(), vdp_hscrollmask);
+ state_save_register_global(screen->machine(), vdp_hscrollsize);
+ state_save_register_global(screen->machine(), vdp_vscrollmode);
+ state_save_register_global(screen->machine(), vdp_cmdpart);
+ state_save_register_global(screen->machine(), vdp_code);
+ state_save_register_global(screen->machine(), vdp_address);
+ state_save_register_global(screen->machine(), vdp_dmafill);
+ state_save_register_global(screen->machine(), scrollheight);
+ state_save_register_global(screen->machine(), scrollwidth);
+ state_save_register_global(screen->machine(), bgcol);
+ state_save_register_global(screen->machine(), window_down);
+ state_save_register_global(screen->machine(), window_vpos);
}
-void system18_vdp_start(running_machine *machine)
+void system18_vdp_start(running_machine &machine)
{
- start_genesis_vdp(machine->primary_screen);
+ start_genesis_vdp(machine.primary_screen);
genesis_palette_base = 0x1800;
genesis_bg_pal_lookup[0] = genesis_sp_pal_lookup[0] = 0x1800;
@@ -262,11 +262,11 @@ READ16_HANDLER( genesis_vdp_r )
{
case 0x00: /* Read Data */
case 0x01:
- return vdp_data_r(space->machine);
+ return vdp_data_r(space->machine());
case 0x02: /* Status Register */
case 0x03:
- return vdp_control_r(space->machine);
+ return vdp_control_r(space->machine());
case 0x04: /* HV counter */
case 0x05:
@@ -305,7 +305,7 @@ WRITE16_HANDLER( genesis_vdp_w )
else
data |= data << 8;
}
- vdp_data_w(space->machine, data);
+ vdp_data_w(space->machine(), data);
break;
case 0x02: /* Control Write */
@@ -325,7 +325,7 @@ WRITE16_HANDLER( genesis_vdp_w )
case 0x09:
case 0x0a:
case 0x0b:
- device = space->machine->device("snsnd");
+ device = space->machine().device("snsnd");
if (device != NULL && ACCESSING_BITS_0_7)
sn76496_w(device, 0, data & 0xff);
break;
@@ -347,7 +347,7 @@ WRITE16_HANDLER( genesis_vdp_w )
******************************************************************************/
/* Games needing Read to Work .. bloxeed (attract) .. puyo puyo .. probably more */
-static int vdp_data_r(running_machine *machine)
+static int vdp_data_r(running_machine &machine)
{
int read = 0;
@@ -366,7 +366,7 @@ static int vdp_data_r(running_machine *machine)
break;
default: /* Illegal read attempt */
- logerror("%s: VDP illegal read type %02x\n", machine->describe_context(), vdp_code);
+ logerror("%s: VDP illegal read type %02x\n", machine.describe_context(), vdp_code);
read = 0x00;
break;
}
@@ -377,7 +377,7 @@ static int vdp_data_r(running_machine *machine)
}
-static void vdp_data_w(running_machine *machine, int data)
+static void vdp_data_w(running_machine &machine, int data)
{
/* kill 2nd write pending flag */
vdp_cmdpart = 0;
@@ -398,7 +398,7 @@ static void vdp_data_w(running_machine *machine, int data)
/* if the hscroll RAM is changing, force an update */
if (vdp_address >= vdp_hscrollbase &&
vdp_address < vdp_hscrollbase + vdp_hscrollsize)
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* write to VRAM */
if (vdp_address & 1)
@@ -417,7 +417,7 @@ static void vdp_data_w(running_machine *machine, int data)
case 0x05: /* VSRAM write */
/* vscroll RAM is changing, force an update */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* write to VSRAM */
if (vdp_address & 1)
@@ -427,7 +427,7 @@ static void vdp_data_w(running_machine *machine, int data)
break;
default: /* Illegal write attempt */
- logerror("%s: VDP illegal write type %02x data %04x\n", machine->describe_context(), vdp_code, data);
+ logerror("%s: VDP illegal write type %02x data %04x\n", machine.describe_context(), vdp_code, data);
break;
}
@@ -471,7 +471,7 @@ static void vdp_data_w(running_machine *machine, int data)
******************************************************************************/
-static int vdp_control_r(running_machine *machine)
+static int vdp_control_r(running_machine &machine)
{
int status = 0x3600; // wwally needs fifo empty set
@@ -479,11 +479,11 @@ static int vdp_control_r(running_machine *machine)
vdp_cmdpart = 0;
/* set the VBLANK bit */
- if (machine->primary_screen->vblank())
+ if (machine.primary_screen->vblank())
status |= 0x0008;
/* set the HBLANK bit */
- if (machine->primary_screen->hblank())
+ if (machine.primary_screen->hblank())
status |= 0x0004;
return (status);
@@ -497,7 +497,7 @@ static void vdp_control_w(address_space *space, int data)
{
/* if 10xxxxxx xxxxxxxx this is a register setting command */
if ((data & 0xc000) == 0x8000)
- vdp_register_w(space->machine, data, space->machine->primary_screen->vblank());
+ vdp_register_w(space->machine(), data, space->machine().primary_screen->vblank());
/* otherwise this is the First part of a mode setting command */
else
@@ -519,7 +519,7 @@ static void vdp_control_w(address_space *space, int data)
}
-static void vdp_register_w(running_machine *machine, int data, int vblank)
+static void vdp_register_w(running_machine &machine, int data, int vblank)
{
int scrwidth = 0;
static const UINT8 is_important[32] = { 0,0,1,1,1,1,0,1,0,0,0,1,0,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0 };
@@ -531,7 +531,7 @@ static void vdp_register_w(running_machine *machine, int data, int vblank)
/* these are mostly important writes; force an update if they written */
if (is_important[regnum])
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* For quite a few of the registers its a good idea to set a couple of variable based
upon the writes here */
@@ -674,7 +674,7 @@ static void vdp_dma_68k(address_space *space)
/* handle the DMA */
for (count = 0; count < length; count++)
{
- vdp_data_w(space->machine, space->read_word(source));
+ vdp_data_w(space->machine(), space->read_word(source));
source += 2;
}
}
diff --git a/src/mame/video/gijoe.c b/src/mame/video/gijoe.c
index 19baa33b392..0236bb8ee35 100644
--- a/src/mame/video/gijoe.c
+++ b/src/mame/video/gijoe.c
@@ -2,9 +2,9 @@
#include "video/konicdev.h"
#include "includes/gijoe.h"
-void gijoe_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void gijoe_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
int pri = (*color & 0x03e0) >> 4;
if (pri <= state->layer_pri[3])
@@ -21,9 +21,9 @@ void gijoe_sprite_callback( running_machine *machine, int *code, int *color, int
*color = state->sprite_colorbase | (*color & 0x001f);
}
-void gijoe_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void gijoe_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
int tile = *code;
if (tile >= 0xf000 && tile <= 0xf4ff)
@@ -52,7 +52,7 @@ void gijoe_tile_callback( running_machine *machine, int layer, int *code, int *c
VIDEO_START( gijoe )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
int i;
k056832_linemap_enable(state->k056832, 1);
@@ -77,7 +77,7 @@ VIDEO_START( gijoe )
SCREEN_UPDATE( gijoe )
{
- gijoe_state *state = screen->machine->driver_data<gijoe_state>();
+ gijoe_state *state = screen->machine().driver_data<gijoe_state>();
static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 };
int layer[4];
int vrc_mode, vrc_new, colorbase_new, /*primode,*/ dirty, i;
@@ -158,8 +158,8 @@ SCREEN_UPDATE( gijoe )
konami_sortlayers4(layer, state->layer_pri);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k056832_tilemap_draw(state->k056832, bitmap, cliprect, layer[0], 0, 1);
k056832_tilemap_draw(state->k056832, bitmap, cliprect, layer[1], 0, 2);
diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c
index f6d9bbaf459..e909b065ecf 100644
--- a/src/mame/video/ginganin.c
+++ b/src/mame/video/ginganin.c
@@ -76,7 +76,7 @@ Note: if MAME_DEBUG is defined, pressing Z with:
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *gfx = machine->region("gfx5")->base();
+ UINT8 *gfx = machine.region("gfx5")->base();
int code = gfx[2 * tile_index + 0] * 256 + gfx[2 * tile_index + 1];
SET_TILE_INFO(
BG_GFX,
@@ -94,7 +94,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
UINT16 code = state->fgram[tile_index];
SET_TILE_INFO(
FG_GFX,
@@ -105,7 +105,7 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE16_HANDLER( ginganin_fgram16_w )
{
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
COMBINE_DATA(&state->fgram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -119,7 +119,7 @@ WRITE16_HANDLER( ginganin_fgram16_w )
static TILE_GET_INFO( get_txt_tile_info )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
UINT16 code = state->txtram[tile_index];
SET_TILE_INFO(
TXT_GFX,
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_txt_tile_info )
WRITE16_HANDLER( ginganin_txtram16_w )
{
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
COMBINE_DATA(&state->txtram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
@@ -138,7 +138,7 @@ WRITE16_HANDLER( ginganin_txtram16_w )
VIDEO_START( ginganin )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, BG_NX, BG_NY);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 16, 16, FG_NX, FG_NY);
state->tx_tilemap = tilemap_create(machine, get_txt_tile_info, tilemap_scan_rows, 8, 8, TXT_NX, TXT_NY);
@@ -150,7 +150,7 @@ VIDEO_START( ginganin )
WRITE16_HANDLER( ginganin_vregs16_w )
{
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
COMBINE_DATA(&state->vregs[offset]);
data = state->vregs[offset];
@@ -176,7 +176,7 @@ WRITE16_HANDLER( ginganin_vregs16_w )
*/
case 6:
state->flipscreen = !(data & 1);
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
break;
case 7:
soundlatch_w(space, 0, data);
@@ -209,9 +209,9 @@ Offset: Values: Format:
------------------------------------------------------------------------ */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -235,7 +235,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & 0x3fff,
attr >> 12,
flipx, flipy,
@@ -247,18 +247,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( ginganin )
{
- ginganin_state *state = screen->machine->driver_data<ginganin_state>();
+ ginganin_state *state = screen->machine().driver_data<ginganin_state>();
int layers_ctrl1 = state->layers_ctrl;
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0xfff1;}
- if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0xfff2;}
- if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0xfff4;}
- if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0xfff8;}
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) { msk |= 0xfff1;}
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) { msk |= 0xfff2;}
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) { msk |= 0xfff4;}
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) { msk |= 0xfff8;}
if (msk != 0) layers_ctrl1 &= msk;
#define SETSCROLL \
@@ -268,11 +268,11 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
tilemap_set_scrolly(state->fg_tilemap, 0, state->posy); \
popmessage("B>%04X:%04X F>%04X:%04X",state->posx%(BG_NX*16),state->posy%(BG_NY*16),state->posx%(FG_NX*16),state->posy%(FG_NY*16));
- if (input_code_pressed(screen->machine, KEYCODE_L)) { state->posx +=8; SETSCROLL }
- if (input_code_pressed(screen->machine, KEYCODE_J)) { state->posx -=8; SETSCROLL }
- if (input_code_pressed(screen->machine, KEYCODE_K)) { state->posy +=8; SETSCROLL }
- if (input_code_pressed(screen->machine, KEYCODE_I)) { state->posy -=8; SETSCROLL }
- if (input_code_pressed(screen->machine, KEYCODE_H)) { state->posx = state->posy = 0; SETSCROLL }
+ if (input_code_pressed(screen->machine(), KEYCODE_L)) { state->posx +=8; SETSCROLL }
+ if (input_code_pressed(screen->machine(), KEYCODE_J)) { state->posx -=8; SETSCROLL }
+ if (input_code_pressed(screen->machine(), KEYCODE_K)) { state->posy +=8; SETSCROLL }
+ if (input_code_pressed(screen->machine(), KEYCODE_I)) { state->posy -=8; SETSCROLL }
+ if (input_code_pressed(screen->machine(), KEYCODE_H)) { state->posx = state->posy = 0; SETSCROLL }
}
#endif
@@ -286,7 +286,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
if (layers_ctrl1 & 2)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
if (layers_ctrl1 & 8)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (layers_ctrl1 & 4)
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
diff --git a/src/mame/video/gladiatr.c b/src/mame/video/gladiatr.c
index 8e144e442d8..b6548e547f9 100644
--- a/src/mame/video/gladiatr.c
+++ b/src/mame/video/gladiatr.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( bg_get_tile_info )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
UINT8 attr = state->colorram[tile_index];
SET_TILE_INFO(
@@ -28,7 +28,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( fg_get_tile_info )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
SET_TILE_INFO(
0,
state->textram[tile_index] + (state->fg_tile_bank << 8),
@@ -46,7 +46,7 @@ static TILE_GET_INFO( fg_get_tile_info )
VIDEO_START( ppking )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,8,8,32,64);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,8,8,32,64);
@@ -59,7 +59,7 @@ VIDEO_START( ppking )
VIDEO_START( gladiatr )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,8,8,64,32);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -81,21 +81,21 @@ VIDEO_START( gladiatr )
WRITE8_HANDLER( gladiatr_videoram_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE8_HANDLER( gladiatr_colorram_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE8_HANDLER( gladiatr_textram_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
@@ -104,37 +104,37 @@ WRITE8_HANDLER( gladiatr_paletteram_w )
{
int r,g,b;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
offset &= 0x3ff;
- r = (space->machine->generic.paletteram.u8[offset] >> 0) & 0x0f;
- g = (space->machine->generic.paletteram.u8[offset] >> 4) & 0x0f;
- b = (space->machine->generic.paletteram.u8[offset + 0x400] >> 0) & 0x0f;
+ r = (space->machine().generic.paletteram.u8[offset] >> 0) & 0x0f;
+ g = (space->machine().generic.paletteram.u8[offset] >> 4) & 0x0f;
+ b = (space->machine().generic.paletteram.u8[offset + 0x400] >> 0) & 0x0f;
- r = (r << 1) + ((space->machine->generic.paletteram.u8[offset + 0x400] >> 4) & 0x01);
- g = (g << 1) + ((space->machine->generic.paletteram.u8[offset + 0x400] >> 5) & 0x01);
- b = (b << 1) + ((space->machine->generic.paletteram.u8[offset + 0x400] >> 6) & 0x01);
+ r = (r << 1) + ((space->machine().generic.paletteram.u8[offset + 0x400] >> 4) & 0x01);
+ g = (g << 1) + ((space->machine().generic.paletteram.u8[offset + 0x400] >> 5) & 0x01);
+ b = (b << 1) + ((space->machine().generic.paletteram.u8[offset + 0x400] >> 6) & 0x01);
- palette_set_color_rgb(space->machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offset,pal5bit(r),pal5bit(g),pal5bit(b));
}
WRITE8_HANDLER( gladiatr_spritebuffer_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
state->sprite_buffer = data & 1;
}
WRITE8_HANDLER( gladiatr_spritebank_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
state->sprite_bank = (data & 1) ? 4 : 2;
}
WRITE8_HANDLER( ppking_video_registers_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
switch (offset & 0x300)
{
case 0x000:
@@ -161,7 +161,7 @@ WRITE8_HANDLER( ppking_video_registers_w )
WRITE8_HANDLER( gladiatr_video_registers_w )
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
switch (offset)
{
case 0x000:
@@ -200,9 +200,9 @@ WRITE8_HANDLER( gladiatr_video_registers_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
int offs;
for (offs = 0;offs < 0x80;offs += 2)
@@ -239,7 +239,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int t = tile_offset[ey][ex] + tile_number;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
t,
color,
xflip, yflip,
@@ -253,9 +253,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( ppking )
{
- gladiatr_state *state = screen->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = screen->machine().driver_data<gladiatr_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
/* the fg layer just selects the upper palette bank on underlying pixels */
{
@@ -289,25 +289,25 @@ SCREEN_UPDATE( ppking )
SCREEN_UPDATE( gladiatr )
{
- gladiatr_state *state = screen->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = screen->machine().driver_data<gladiatr_state>();
if (state->video_attributes & 0x20)
{
int scroll;
scroll = state->bg_scrollx + ((state->video_attributes & 0x04) << 6);
- tilemap_set_scrollx(state->bg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0));
+ tilemap_set_scrollx(state->bg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine()) ? 0x0f : 0));
scroll = state->fg_scrollx + ((state->video_attributes & 0x08) << 5);
- tilemap_set_scrollx(state->fg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine) ? 0x0f : 0));
+ tilemap_set_scrollx(state->fg_tilemap, 0, scroll ^ (flip_screen_get(screen->machine()) ? 0x0f : 0));
// always 0 anyway
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
tilemap_set_scrolly(state->fg_tilemap, 0, state->fg_scrolly);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
}
else
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
return 0;
}
diff --git a/src/mame/video/glass.c b/src/mame/video/glass.c
index 082afe8a858..87007bbb21e 100644
--- a/src/mame/video/glass.c
+++ b/src/mame/video/glass.c
@@ -33,7 +33,7 @@
static TILE_GET_INFO( get_tile_info_glass_screen0 )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
int data = state->videoram[tile_index << 1];
int data2 = state->videoram[(tile_index << 1) + 1];
int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2);
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_tile_info_glass_screen0 )
static TILE_GET_INFO( get_tile_info_glass_screen1 )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
int data = state->videoram[(0x1000 / 2) + (tile_index << 1)];
int data2 = state->videoram[(0x1000 / 2) + (tile_index << 1) + 1];
int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2);
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_tile_info_glass_screen1 )
WRITE16_HANDLER( glass_blitter_w )
{
- glass_state *state = space->machine->driver_data<glass_state>();
+ glass_state *state = space->machine().driver_data<glass_state>();
state->blitter_serial_buffer[state->current_bit] = data & 0x01;
state->current_bit++;
@@ -85,7 +85,7 @@ WRITE16_HANDLER( glass_blitter_w )
/* fill the screen bitmap with the current picture */
{
int i, j;
- UINT8 *gfx = (UINT8 *)space->machine->region("gfx3")->base();
+ UINT8 *gfx = (UINT8 *)space->machine().region("gfx3")->base();
gfx = gfx + (state->current_command & 0x07) * 0x10000 + (state->current_command & 0x08) * 0x10000 + 0x140;
@@ -115,7 +115,7 @@ WRITE16_HANDLER( glass_blitter_w )
WRITE16_HANDLER( glass_vram_w )
{
- glass_state *state = space->machine->driver_data<glass_state>();
+ glass_state *state = space->machine().driver_data<glass_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->pant[offset >> 11], ((offset << 1) & 0x0fff) >> 2);
}
@@ -129,10 +129,10 @@ WRITE16_HANDLER( glass_vram_w )
VIDEO_START( glass )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
state->pant[0] = tilemap_create(machine, get_tile_info_glass_screen0, tilemap_scan_rows, 16, 16, 32, 32);
state->pant[1] = tilemap_create(machine, get_tile_info_glass_screen1, tilemap_scan_rows, 16, 16, 32, 32);
- state->screen_bitmap = auto_bitmap_alloc (machine, 320, 200, machine->primary_screen->format());
+ state->screen_bitmap = auto_bitmap_alloc (machine, 320, 200, machine.primary_screen->format());
state->save_item(NAME(*state->screen_bitmap));
@@ -164,11 +164,11 @@ VIDEO_START( glass )
3 | xxxxxxxx xxxxxxxx | sprite code
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
int i;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
for (i = 3; i < (0x1000 - 6) / 2; i += 4)
{
@@ -197,7 +197,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( glass )
{
- glass_state *state = screen->machine->driver_data<glass_state>();
+ glass_state *state = screen->machine().driver_data<glass_state>();
/* set scroll registers */
tilemap_set_scrolly(state->pant[0], 0, state->vregs[0]);
tilemap_set_scrollx(state->pant[0], 0, state->vregs[1] + 0x04);
@@ -205,10 +205,10 @@ SCREEN_UPDATE( glass )
tilemap_set_scrollx(state->pant[1], 0, state->vregs[3]);
/* draw layers + sprites */
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
copybitmap(bitmap, state->screen_bitmap, 0, 0, 0x18, 0x24, cliprect);
tilemap_draw(bitmap, cliprect, state->pant[1], 0, 0);
tilemap_draw(bitmap, cliprect, state->pant[0], 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/gng.c b/src/mame/video/gng.c
index 347470eb5a1..ea33017a151 100644
--- a/src/mame/video/gng.c
+++ b/src/mame/video/gng.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
UINT8 attr = state->fgvideoram[tile_index + 0x400];
SET_TILE_INFO(
0,
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
UINT8 attr = state->bgvideoram[tile_index + 0x400];
SET_TILE_INFO(
1,
@@ -49,7 +49,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( gng )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
@@ -67,14 +67,14 @@ VIDEO_START( gng )
WRITE8_HANDLER( gng_fgvideoram_w )
{
- gng_state *state = space->machine->driver_data<gng_state>();
+ gng_state *state = space->machine().driver_data<gng_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( gng_bgvideoram_w )
{
- gng_state *state = space->machine->driver_data<gng_state>();
+ gng_state *state = space->machine().driver_data<gng_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff);
}
@@ -82,14 +82,14 @@ WRITE8_HANDLER( gng_bgvideoram_w )
WRITE8_HANDLER( gng_bgscrollx_w )
{
- gng_state *state = space->machine->driver_data<gng_state>();
+ gng_state *state = space->machine().driver_data<gng_state>();
state->scrollx[offset] = data;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0] + 256 * state->scrollx[1]);
}
WRITE8_HANDLER( gng_bgscrolly_w )
{
- gng_state *state = space->machine->driver_data<gng_state>();
+ gng_state *state = space->machine().driver_data<gng_state>();
state->scrolly[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[0] + 256 * state->scrolly[1]);
}
@@ -97,7 +97,7 @@ WRITE8_HANDLER( gng_bgscrolly_w )
WRITE8_HANDLER( gng_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
@@ -108,14 +108,14 @@ WRITE8_HANDLER( gng_flipscreen_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
- const gfx_element *gfx = machine->gfx[2];
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
+ const gfx_element *gfx = machine.gfx[2];
int offs;
- for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4; offs >= 0; offs -= 4)
{
UINT8 attributes = buffered_spriteram[offs + 1];
int sx = buffered_spriteram[offs + 3] - 0x100 * (attributes & 0x01);
@@ -141,10 +141,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( gng )
{
- gng_state *state = screen->machine->driver_data<gng_state>();
+ gng_state *state = screen->machine().driver_data<gng_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -152,7 +152,7 @@ SCREEN_UPDATE( gng )
SCREEN_EOF( gng )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/goal92.c b/src/mame/video/goal92.c
index 8c00d35ba7f..6c5878325a3 100644
--- a/src/mame/video/goal92.c
+++ b/src/mame/video/goal92.c
@@ -9,13 +9,13 @@
READ16_HANDLER( goal92_fg_bank_r )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
return state->fg_bank;
}
WRITE16_HANDLER( goal92_fg_bank_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
COMBINE_DATA(&state->fg_bank);
if (ACCESSING_BITS_0_7)
@@ -26,28 +26,28 @@ WRITE16_HANDLER( goal92_fg_bank_w )
WRITE16_HANDLER( goal92_text_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
COMBINE_DATA(&state->tx_data[offset]);
tilemap_mark_tile_dirty(state->tx_layer, offset);
}
WRITE16_HANDLER( goal92_background_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
COMBINE_DATA(&state->bg_data[offset]);
tilemap_mark_tile_dirty(state->bg_layer, offset);
}
WRITE16_HANDLER( goal92_foreground_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
COMBINE_DATA(&state->fg_data[offset]);
tilemap_mark_tile_dirty(state->fg_layer, offset);
}
static TILE_GET_INFO( get_text_tile_info )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
int tile = state->tx_data[tile_index];
int color = (tile >> 12) & 0xf;
@@ -60,7 +60,7 @@ static TILE_GET_INFO( get_text_tile_info )
static TILE_GET_INFO( get_back_tile_info )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
int tile = state->bg_data[tile_index];
int color = (tile >> 12) & 0xf;
@@ -71,7 +71,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
int tile = state->fg_data[tile_index];
int color = (tile >> 12) & 0xf;
int region;
@@ -92,9 +92,9 @@ static TILE_GET_INFO( get_fore_tile_info )
SET_TILE_INFO(region, tile, color, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
UINT16 *buffered_spriteram16 = state->buffered_spriteram;
int offs, fx, fy, x, y, color, sprite;
@@ -130,7 +130,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = 256 - (y + 7);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite,
color,fx,fy,x,y,15);
}
@@ -139,7 +139,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
VIDEO_START( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
state->bg_layer = tilemap_create(machine, get_back_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_layer = tilemap_create(machine, get_fore_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->tx_layer = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -154,7 +154,7 @@ VIDEO_START( goal92 )
SCREEN_UPDATE( goal92 )
{
- goal92_state *state = screen->machine->driver_data<goal92_state>();
+ goal92_state *state = screen->machine().driver_data<goal92_state>();
tilemap_set_scrollx(state->bg_layer, 0, state->scrollram[0] + 60);
tilemap_set_scrolly(state->bg_layer, 0, state->scrollram[1] + 8);
@@ -169,27 +169,27 @@ SCREEN_UPDATE( goal92 )
tilemap_set_scrolly(state->fg_layer, 0, state->scrollram[3] + 8);
}
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_layer, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
if (!(state->fg_bank & 0xff))
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fg_layer, 0, 0);
if(state->fg_bank & 0xff)
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
tilemap_draw(bitmap, cliprect, state->tx_layer, 0, 0);
return 0;
}
SCREEN_EOF( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
memcpy(state->buffered_spriteram, state->spriteram, 0x400 * 2);
}
diff --git a/src/mame/video/goindol.c b/src/mame/video/goindol.c
index 7a8f82bab3b..aa6430e9151 100644
--- a/src/mame/video/goindol.c
+++ b/src/mame/video/goindol.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
int code = state->fg_videoram[2 * tile_index + 1];
int attr = state->fg_videoram[2 * tile_index];
SET_TILE_INFO(
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
int code = state->bg_videoram[2 * tile_index + 1];
int attr = state->bg_videoram[2 * tile_index];
SET_TILE_INFO(
@@ -49,7 +49,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( goindol )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -65,14 +65,14 @@ VIDEO_START( goindol )
WRITE8_HANDLER( goindol_fg_videoram_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
WRITE8_HANDLER( goindol_bg_videoram_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
@@ -85,9 +85,9 @@ WRITE8_HANDLER( goindol_bg_videoram_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int gfxbank, UINT8 *sprite_ram )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int gfxbank, UINT8 *sprite_ram )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
int offs, sx, sy, tile, palette;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -108,13 +108,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
palette = sprite_ram[offs + 2] >> 3;
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[gfxbank],
+ machine.gfx[gfxbank],
tile,
palette,
flip_screen_get(machine),flip_screen_get(machine),
sx,sy, 0);
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[gfxbank],
+ machine.gfx[gfxbank],
tile+1,
palette,
flip_screen_get(machine),flip_screen_get(machine),
@@ -125,13 +125,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( goindol )
{
- goindol_state *state = screen->machine->driver_data<goindol_state>();
+ goindol_state *state = screen->machine().driver_data<goindol_state>();
tilemap_set_scrollx(state->fg_tilemap, 0, *state->fg_scrollx);
tilemap_set_scrolly(state->fg_tilemap, 0, *state->fg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1, state->spriteram);
- draw_sprites(screen->machine, bitmap, cliprect, 0, state->spriteram2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, state->spriteram);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, state->spriteram2);
return 0;
}
diff --git a/src/mame/video/goldstar.c b/src/mame/video/goldstar.c
index 3d59e905729..e9110c6e37d 100644
--- a/src/mame/video/goldstar.c
+++ b/src/mame/video/goldstar.c
@@ -21,7 +21,7 @@
WRITE8_HANDLER( cm_girl_scroll_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->cm_girl_scroll = data;
/*
@@ -35,7 +35,7 @@ WRITE8_HANDLER( cm_girl_scroll_w )
WRITE8_HANDLER( cm_outport0_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->cm_enable_reg = data;
/*
@@ -52,7 +52,7 @@ WRITE8_HANDLER( cm_outport0_w )
WRITE8_HANDLER( goldstar_fg_vidram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->fg_vidram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -60,7 +60,7 @@ WRITE8_HANDLER( goldstar_fg_vidram_w )
WRITE8_HANDLER( goldstar_fg_atrram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->fg_atrram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -68,7 +68,7 @@ WRITE8_HANDLER( goldstar_fg_atrram_w )
static TILE_GET_INFO( get_goldstar_fg_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->fg_vidram[tile_index];
int attr = state->fg_atrram[tile_index];
@@ -81,7 +81,7 @@ static TILE_GET_INFO( get_goldstar_fg_tile_info )
static TILE_GET_INFO( get_magical_fg_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->fg_vidram[tile_index];
int attr = state->fg_atrram[tile_index];
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_magical_fg_tile_info )
// colour / high tile bits are swapped around
static TILE_GET_INFO( get_cherrym_fg_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->fg_vidram[tile_index];
int attr = state->fg_atrram[tile_index];
@@ -111,7 +111,7 @@ static TILE_GET_INFO( get_cherrym_fg_tile_info )
WRITE8_HANDLER( goldstar_reel1_ram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
@@ -119,7 +119,7 @@ WRITE8_HANDLER( goldstar_reel1_ram_w )
static TILE_GET_INFO( get_goldstar_reel1_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel1_ram[tile_index];
SET_TILE_INFO(
@@ -132,14 +132,14 @@ static TILE_GET_INFO( get_goldstar_reel1_tile_info )
WRITE8_HANDLER( goldstar_reel2_ram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static TILE_GET_INFO( get_goldstar_reel2_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel2_ram[tile_index];
SET_TILE_INFO(
@@ -151,7 +151,7 @@ static TILE_GET_INFO( get_goldstar_reel2_tile_info )
WRITE8_HANDLER( goldstar_reel3_ram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
@@ -159,7 +159,7 @@ WRITE8_HANDLER( goldstar_reel3_ram_w )
static TILE_GET_INFO( get_goldstar_reel3_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel3_ram[tile_index];
SET_TILE_INFO(
@@ -171,7 +171,7 @@ static TILE_GET_INFO( get_goldstar_reel3_tile_info )
WRITE8_HANDLER( unkch_reel1_attrram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel1_attrram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
@@ -179,7 +179,7 @@ WRITE8_HANDLER( unkch_reel1_attrram_w )
WRITE8_HANDLER( unkch_reel2_attrram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel2_attrram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
@@ -188,7 +188,7 @@ WRITE8_HANDLER( unkch_reel2_attrram_w )
WRITE8_HANDLER( unkch_reel3_attrram_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->reel3_attrram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
@@ -197,7 +197,7 @@ WRITE8_HANDLER( unkch_reel3_attrram_w )
static TILE_GET_INFO( get_unkch_reel1_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel1_ram[tile_index];
int attr = state->reel1_attrram[tile_index];
@@ -210,7 +210,7 @@ static TILE_GET_INFO( get_unkch_reel1_tile_info )
static TILE_GET_INFO( get_unkch_reel2_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel2_ram[tile_index];
int attr = state->reel2_attrram[tile_index];
@@ -223,7 +223,7 @@ static TILE_GET_INFO( get_unkch_reel2_tile_info )
static TILE_GET_INFO( get_unkch_reel3_tile_info )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
int code = state->reel3_ram[tile_index];
int attr = state->reel3_attrram[tile_index];
@@ -239,7 +239,7 @@ static TILE_GET_INFO( get_unkch_reel3_tile_info )
VIDEO_START( goldstar )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
state->reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -258,7 +258,7 @@ VIDEO_START( goldstar )
VIDEO_START( magical )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
state->reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -277,7 +277,7 @@ VIDEO_START( magical )
VIDEO_START( unkch )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
state->reel1_tilemap = tilemap_create(machine,get_unkch_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_unkch_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -299,7 +299,7 @@ VIDEO_START( unkch )
VIDEO_START( cherrym )
{
- goldstar_state *state = machine->driver_data<goldstar_state>();
+ goldstar_state *state = machine.driver_data<goldstar_state>();
state->reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -322,7 +322,7 @@ VIDEO_START( cherrym )
WRITE8_HANDLER( goldstar_fa00_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
/* bit 1 toggles continuously - might be irq enable or watchdog reset */
@@ -335,7 +335,7 @@ WRITE8_HANDLER( goldstar_fa00_w )
WRITE8_HANDLER( cm_background_col_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
//printf("cm_background_col_w %02x\n",data);
@@ -398,10 +398,10 @@ static const rectangle magical_visible2alt = { 0*8, (16+48)*8-1, 16*8, 28*8-1 }
SCREEN_UPDATE( goldstar )
{
- goldstar_state *state = screen->machine->driver_data<goldstar_state>();
+ goldstar_state *state = screen->machine().driver_data<goldstar_state>();
int i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!state->cm_enable_reg &0x01)
return 0;
@@ -423,9 +423,9 @@ SCREEN_UPDATE( goldstar )
if (state->cm_enable_reg &0x04)
{
- if (screen->machine->region("user1")->base())
+ if (screen->machine().region("user1")->base())
{
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
int girlyscroll = (INT8)((state->cm_girl_scroll & 0xf0));
int girlxscroll = (INT8)((state->cm_girl_scroll & 0x0f)<<4);
@@ -444,10 +444,10 @@ SCREEN_UPDATE( goldstar )
SCREEN_UPDATE( magical )
{
- goldstar_state *state = screen->machine->driver_data<goldstar_state>();
+ goldstar_state *state = screen->machine().driver_data<goldstar_state>();
int i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!state->cm_enable_reg &0x01)
return 0;
@@ -496,10 +496,10 @@ SCREEN_UPDATE( magical )
SCREEN_UPDATE( unkch )
{
- goldstar_state *state = screen->machine->driver_data<goldstar_state>();
+ goldstar_state *state = screen->machine().driver_data<goldstar_state>();
int i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!state->cm_enable_reg &0x01)
return 0;
@@ -546,10 +546,10 @@ SCREEN_UPDATE( unkch )
SCREEN_UPDATE( cmast91 )
{
- goldstar_state *state = screen->machine->driver_data<goldstar_state>();
+ goldstar_state *state = screen->machine().driver_data<goldstar_state>();
int i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!state->cm_enable_reg &0x01)
return 0;
@@ -578,10 +578,10 @@ SCREEN_UPDATE( cmast91 )
SCREEN_UPDATE( amcoe1a )
{
- goldstar_state *state = screen->machine->driver_data<goldstar_state>();
+ goldstar_state *state = screen->machine().driver_data<goldstar_state>();
int i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!state->cm_enable_reg &0x01)
return 0;
diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c
index 561a67672fc..39781918c7b 100644
--- a/src/mame/video/gomoku.c
+++ b/src/mame/video/gomoku.c
@@ -23,7 +23,7 @@ PALETTE_INIT( gomoku )
int i;
int bit0, bit1, bit2, r, g, b;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
/* red component */
bit0 = (*color_prom >> 0) & 0x01;
@@ -55,7 +55,7 @@ PALETTE_INIT( gomoku )
static TILE_GET_INFO( get_fg_tile_info )
{
- gomoku_state *state = machine->driver_data<gomoku_state>();
+ gomoku_state *state = machine.driver_data<gomoku_state>();
int code = (state->videoram[tile_index]);
int attr = (state->colorram[tile_index]);
int color = (attr& 0x0f);
@@ -70,33 +70,33 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE8_HANDLER( gomoku_videoram_w )
{
- gomoku_state *state = space->machine->driver_data<gomoku_state>();
+ gomoku_state *state = space->machine().driver_data<gomoku_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE8_HANDLER( gomoku_colorram_w )
{
- gomoku_state *state = space->machine->driver_data<gomoku_state>();
+ gomoku_state *state = space->machine().driver_data<gomoku_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE8_HANDLER( gomoku_bgram_w )
{
- gomoku_state *state = space->machine->driver_data<gomoku_state>();
+ gomoku_state *state = space->machine().driver_data<gomoku_state>();
state->bgram[offset] = data;
}
WRITE8_HANDLER( gomoku_flipscreen_w )
{
- gomoku_state *state = space->machine->driver_data<gomoku_state>();
+ gomoku_state *state = space->machine().driver_data<gomoku_state>();
state->flipscreen = (data & 0x02) ? 0 : 1;
}
WRITE8_HANDLER( gomoku_bg_dispsw_w )
{
- gomoku_state *state = space->machine->driver_data<gomoku_state>();
+ gomoku_state *state = space->machine().driver_data<gomoku_state>();
state->bg_dispsw = (data & 0x02) ? 0 : 1;
}
@@ -109,15 +109,15 @@ WRITE8_HANDLER( gomoku_bg_dispsw_w )
VIDEO_START( gomoku )
{
- gomoku_state *state = machine->driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = machine->region( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = machine->region( "user2" )->base();
- UINT8 *GOMOKU_BG_D = machine->region( "user3" )->base();
+ gomoku_state *state = machine.driver_data<gomoku_state>();
+ UINT8 *GOMOKU_BG_X = machine.region( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = machine.region( "user2" )->base();
+ UINT8 *GOMOKU_BG_D = machine.region( "user3" )->base();
int x, y;
int bgdata;
int color;
- state->bg_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->bg_bitmap = machine.primary_screen->alloc_compatible_bitmap();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
@@ -152,10 +152,10 @@ VIDEO_START( gomoku )
SCREEN_UPDATE( gomoku )
{
- gomoku_state *state = screen->machine->driver_data<gomoku_state>();
- UINT8 *GOMOKU_BG_X = screen->machine->region( "user1" )->base();
- UINT8 *GOMOKU_BG_Y = screen->machine->region( "user2" )->base();
- UINT8 *GOMOKU_BG_D = screen->machine->region( "user3" )->base();
+ gomoku_state *state = screen->machine().driver_data<gomoku_state>();
+ UINT8 *GOMOKU_BG_X = screen->machine().region( "user1" )->base();
+ UINT8 *GOMOKU_BG_Y = screen->machine().region( "user2" )->base();
+ UINT8 *GOMOKU_BG_D = screen->machine().region( "user3" )->base();
int x, y;
int bgram;
int bgoffs;
diff --git a/src/mame/video/gotcha.c b/src/mame/video/gotcha.c
index 91270af34c4..bc3731b52a4 100644
--- a/src/mame/video/gotcha.c
+++ b/src/mame/video/gotcha.c
@@ -12,9 +12,9 @@ static TILEMAP_MAPPER( gotcha_tilemap_scan )
return (col & 0x1f) | (row << 5) | ((col & 0x20) << 5);
}
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index ,UINT16 *vram, int color_offs)
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index ,UINT16 *vram, int color_offs)
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
UINT16 data = vram[tile_index];
int code = (data & 0x3ff) | (state->gfxbank[(data & 0x0c00) >> 10] << 10);
@@ -23,13 +23,13 @@ INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int ti
static TILE_GET_INFO( fg_get_tile_info )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
get_tile_info(machine, tileinfo, tile_index, state->fgvideoram, 0);
}
static TILE_GET_INFO( bg_get_tile_info )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
get_tile_info(machine, tileinfo, tile_index, state->bgvideoram, 16);
}
@@ -43,7 +43,7 @@ static TILE_GET_INFO( bg_get_tile_info )
VIDEO_START( gotcha )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info, gotcha_tilemap_scan, 16, 16, 64, 32);
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, gotcha_tilemap_scan, 16, 16, 64, 32);
@@ -56,41 +56,41 @@ VIDEO_START( gotcha )
WRITE16_HANDLER( gotcha_fgvideoram_w )
{
- gotcha_state *state = space->machine->driver_data<gotcha_state>();
+ gotcha_state *state = space->machine().driver_data<gotcha_state>();
COMBINE_DATA(&state->fgvideoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE16_HANDLER( gotcha_bgvideoram_w )
{
- gotcha_state *state = space->machine->driver_data<gotcha_state>();
+ gotcha_state *state = space->machine().driver_data<gotcha_state>();
COMBINE_DATA(&state->bgvideoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE16_HANDLER( gotcha_gfxbank_select_w )
{
- gotcha_state *state = space->machine->driver_data<gotcha_state>();
+ gotcha_state *state = space->machine().driver_data<gotcha_state>();
if (ACCESSING_BITS_8_15)
state->banksel = (data & 0x0300) >> 8;
}
WRITE16_HANDLER( gotcha_gfxbank_w )
{
- gotcha_state *state = space->machine->driver_data<gotcha_state>();
+ gotcha_state *state = space->machine().driver_data<gotcha_state>();
if (ACCESSING_BITS_8_15)
{
if (state->gfxbank[state->banksel] != ((data & 0x0f00) >> 8))
{
state->gfxbank[state->banksel] = (data & 0x0f00) >> 8;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
}
WRITE16_HANDLER( gotcha_scroll_w )
{
- gotcha_state *state = space->machine->driver_data<gotcha_state>();
+ gotcha_state *state = space->machine().driver_data<gotcha_state>();
COMBINE_DATA(&state->scroll[offset]);
switch (offset)
@@ -105,9 +105,9 @@ WRITE16_HANDLER( gotcha_scroll_w )
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -125,7 +125,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
for (y = 0; y < height; y++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + (flipy ? height-1 - y : y),
color,
flipx,flipy,
@@ -137,9 +137,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( gotcha )
{
- gotcha_state *state = screen->machine->driver_data<gotcha_state>();
+ gotcha_state *state = screen->machine().driver_data<gotcha_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c
index d0de8864504..5619e0255ac 100644
--- a/src/mame/video/gottlieb.c
+++ b/src/mame/video/gottlieb.c
@@ -18,23 +18,23 @@
WRITE8_HANDLER( gottlieb_paletteram_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
int r, g, b, a, val;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
/* blue & green are encoded in the even bytes */
- val = space->machine->generic.paletteram.u8[offset & ~1];
+ val = space->machine().generic.paletteram.u8[offset & ~1];
g = combine_4_weights(state->weights, (val >> 4) & 1, (val >> 5) & 1, (val >> 6) & 1, (val >> 7) & 1);
b = combine_4_weights(state->weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1);
/* red is encoded in the odd bytes */
- val = space->machine->generic.paletteram.u8[offset | 1];
+ val = space->machine().generic.paletteram.u8[offset | 1];
r = combine_4_weights(state->weights, (val >> 0) & 1, (val >> 1) & 1, (val >> 2) & 1, (val >> 3) & 1);
/* alpha is set to 0 if laserdisc video is enabled */
a = (state->transparent0 && offset / 2 == 0) ? 0 : 255;
- palette_set_color(space->machine, offset / 2, MAKE_ARGB(a, r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_ARGB(a, r, g, b));
}
@@ -47,24 +47,24 @@ WRITE8_HANDLER( gottlieb_paletteram_w )
WRITE8_HANDLER( gottlieb_video_control_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* bit 0 controls foreground/background priority */
if (state->background_priority != (data & 0x01))
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->background_priority = data & 0x01;
/* bit 1 controls horizonal flip screen */
- if (flip_screen_x_get(space->machine) != (data & 0x02))
+ if (flip_screen_x_get(space->machine()) != (data & 0x02))
{
- flip_screen_x_set(space->machine, data & 0x02);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_x_set(space->machine(), data & 0x02);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 2 controls horizonal flip screen */
- if (flip_screen_y_get(space->machine) != (data & 0x04))
+ if (flip_screen_y_get(space->machine()) != (data & 0x04))
{
- flip_screen_y_set(space->machine, data & 0x04);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_y_set(space->machine(), data & 0x04);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* in Q*Bert Qubes only, bit 4 controls the sprite bank */
@@ -74,8 +74,8 @@ WRITE8_HANDLER( gottlieb_video_control_w )
WRITE8_HANDLER( gottlieb_laserdisc_video_control_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
- device_t *laserdisc = space->machine->m_devicelist.first(LASERDISC);
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
+ device_t *laserdisc = space->machine().m_devicelist.first(LASERDISC);
/* bit 0 works like the other games */
gottlieb_video_control_w(space, offset, data & 0x01);
@@ -90,7 +90,7 @@ WRITE8_HANDLER( gottlieb_laserdisc_video_control_w )
/* configure the palette if the laserdisc is enabled */
state->transparent0 = (data >> 3) & 1;
- gottlieb_paletteram_w(space, 0, space->machine->generic.paletteram.u8[0]);
+ gottlieb_paletteram_w(space, 0, space->machine().generic.paletteram.u8[0]);
}
@@ -103,7 +103,7 @@ WRITE8_HANDLER( gottlieb_laserdisc_video_control_w )
WRITE8_HANDLER( gottlieb_videoram_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -112,11 +112,11 @@ WRITE8_HANDLER( gottlieb_videoram_w )
WRITE8_HANDLER( gottlieb_charram_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
if (state->charram[offset] != data)
{
state->charram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], offset / 32);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset / 32);
}
}
@@ -130,7 +130,7 @@ WRITE8_HANDLER( gottlieb_charram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
if ((code & 0x80) == 0)
@@ -141,7 +141,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_screwloo_bg_tile_info )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
if ((code & 0xc0) == 0)
@@ -153,7 +153,7 @@ static TILE_GET_INFO( get_screwloo_bg_tile_info )
VIDEO_START( gottlieb )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
static const int resistances[4] = { 2000, 1000, 470, 240 };
/* compute palette information */
@@ -170,7 +170,7 @@ VIDEO_START( gottlieb )
tilemap_set_transparent_pen(state->bg_tilemap, 0);
tilemap_set_scrolldx(state->bg_tilemap, 0, 318 - 256);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
/* save some state */
state_save_register_global(machine, state->background_priority);
@@ -180,7 +180,7 @@ VIDEO_START( gottlieb )
VIDEO_START( screwloo )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
static const int resistances[4] = { 2000, 1000, 470, 240 };
/* compute palette information */
@@ -197,7 +197,7 @@ VIDEO_START( screwloo )
tilemap_set_transparent_pen(state->bg_tilemap, 0);
tilemap_set_scrolldx(state->bg_tilemap, 0, 318 - 256);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
/* save some state */
state_save_register_global(machine, state->background_priority);
@@ -213,9 +213,9 @@ VIDEO_START( screwloo )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
UINT8 *spriteram = state->spriteram;
rectangle clip = *cliprect;
int offs;
@@ -236,7 +236,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (flip_screen_y_get(machine)) sy = 244 - sy;
drawgfx_transpen(bitmap, &clip,
- machine->gfx[2],
+ machine.gfx[2],
code, 0,
flip_screen_x_get(machine), flip_screen_y_get(machine),
sx,sy, 0);
@@ -253,7 +253,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( gottlieb )
{
- gottlieb_state *state = screen->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = screen->machine().driver_data<gottlieb_state>();
/* if the background has lower priority, render it first, else clear the screen */
if (!state->background_priority)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
@@ -261,7 +261,7 @@ SCREEN_UPDATE( gottlieb )
bitmap_fill(bitmap, cliprect, 0);
/* draw the sprites */
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
/* if the background has higher priority, render it now */
if (state->background_priority)
diff --git a/src/mame/video/gotya.c b/src/mame/video/gotya.c
index c526f5094cc..d1bbc6f556c 100644
--- a/src/mame/video/gotya.c
+++ b/src/mame/video/gotya.c
@@ -23,7 +23,7 @@ PALETTE_INIT( gotya )
2, &resistances_b[0], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -48,7 +48,7 @@ PALETTE_INIT( gotya )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -57,27 +57,27 @@ PALETTE_INIT( gotya )
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = color_prom[i] & 0x07;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( gotya_videoram_w )
{
- gotya_state *state = space->machine->driver_data<gotya_state>();
+ gotya_state *state = space->machine().driver_data<gotya_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( gotya_colorram_w )
{
- gotya_state *state = space->machine->driver_data<gotya_state>();
+ gotya_state *state = space->machine().driver_data<gotya_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( gotya_video_control_w )
{
- gotya_state *state = space->machine->driver_data<gotya_state>();
+ gotya_state *state = space->machine().driver_data<gotya_state>();
/* bit 0 - scroll bit 8
bit 1 - flip screen
@@ -85,16 +85,16 @@ WRITE8_HANDLER( gotya_video_control_w )
state->scroll_bit_8 = data & 0x01;
- if (flip_screen_get(space->machine) != (data & 0x02))
+ if (flip_screen_get(space->machine()) != (data & 0x02))
{
- flip_screen_set(space->machine, data & 0x02);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x02);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index] & 0x0f;
@@ -111,13 +111,13 @@ static TILEMAP_MAPPER( tilemap_scan_rows_thehand )
VIDEO_START( gotya )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_thehand, 8, 8, 64, 32);
}
-static void draw_status_row( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int col )
+static void draw_status_row( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int col )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
int row;
if (flip_screen_get(machine))
@@ -135,7 +135,7 @@ static void draw_status_row( running_machine *machine, bitmap_t *bitmap, const r
sy = 31 - row;
drawgfx_opaque(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
state->videoram2[row * 32 + col],
state->videoram2[row * 32 + col + 0x10] & 0x0f,
flip_screen_x_get(machine), flip_screen_y_get(machine),
@@ -143,9 +143,9 @@ static void draw_status_row( running_machine *machine, bitmap_t *bitmap, const r
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -160,14 +160,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sy = 240 - sy;
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flip_screen_x_get(machine), flip_screen_y_get(machine),
sx, sy, 0);
}
}
-static void draw_status( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
draw_status_row(machine, bitmap, cliprect, 0, 1);
draw_status_row(machine, bitmap, cliprect, 1, 0);
@@ -179,10 +179,10 @@ static void draw_status( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( gotya )
{
- gotya_state *state = screen->machine->driver_data<gotya_state>();
+ gotya_state *state = screen->machine().driver_data<gotya_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, -(*state->scroll + (state->scroll_bit_8 * 256)) - 2 * 8);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_status(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_status(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/gp9001.c b/src/mame/video/gp9001.c
index abd6dce5915..d7669a297a2 100644
--- a/src/mame/video/gp9001.c
+++ b/src/mame/video/gp9001.c
@@ -222,7 +222,7 @@ device_config *gp9001vdp_device_config::static_alloc_device_config(const machine
device_t *gp9001vdp_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, gp9001vdp_device(machine, *this));
+ return auto_alloc(machine, gp9001vdp_device(machine, *this));
}
void gp9001vdp_device_config::static_set_gfx_region(device_config *device, int gfxregion)
@@ -343,12 +343,12 @@ void gp9001vdp_device::create_tilemaps(int region)
void gp9001vdp_device::device_start()
{
- top.vram16 = auto_alloc_array_clear(machine, UINT16, GP9001_TOP_VRAM_SIZE/2);
- fg.vram16 = auto_alloc_array_clear(machine, UINT16, GP9001_FG_VRAM_SIZE/2);
- bg.vram16 = auto_alloc_array_clear(machine, UINT16, GP9001_BG_VRAM_SIZE/2);
+ top.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_TOP_VRAM_SIZE/2);
+ fg.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_FG_VRAM_SIZE/2);
+ bg.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_BG_VRAM_SIZE/2);
- sp.vram16 = auto_alloc_array_clear(machine, UINT16, GP9001_SPRITERAM_SIZE/2);
- sp.vram16_buffer = auto_alloc_array_clear(machine, UINT16, GP9001_SPRITERAM_SIZE/2);
+ sp.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_SPRITERAM_SIZE/2);
+ sp.vram16_buffer = auto_alloc_array_clear(m_machine, UINT16, GP9001_SPRITERAM_SIZE/2);
create_tilemaps(m_gfxregion);
@@ -462,7 +462,7 @@ static WRITE16_DEVICE_HANDLER( gp9001_devvideoram16_w )
static READ16_DEVICE_HANDLER( gp9001_vdpstatus_r )
{
- return ((device->machine->primary_screen->vpos() + 15) % 262) >= 245;
+ return ((device->machine().primary_screen->vpos() + 15) % 262) >= 245;
}
static WRITE16_DEVICE_HANDLER( gp9001_scroll_reg_select_w )
@@ -773,9 +773,9 @@ WRITE16_DEVICE_HANDLER( pipibibi_bootleg_spriteram16_w )
Sprite Handlers
***************************************************************************/
-void gp9001vdp_device::draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap )
+void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap )
{
- const gfx_element *gfx = machine->gfx[tile_region+1];
+ const gfx_element *gfx = machine.gfx[tile_region+1];
int offs, old_x, old_y;
@@ -888,7 +888,7 @@ void gp9001vdp_device::draw_sprites( running_machine *machine, bitmap_t *bitmap,
{
int yy, xx;
- const pen_t *paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
const UINT8* srcdata = gfx_element_get_data(gfx, sprite);
int count = 0;
int ystart, yend, yinc;
@@ -966,10 +966,10 @@ void gp9001vdp_device::draw_sprites( running_machine *machine, bitmap_t *bitmap,
Draw the game screen in the given bitmap_t.
***************************************************************************/
-void gp9001vdp_device::gp9001_draw_custom_tilemap(running_machine* machine, bitmap_t* bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable )
+void gp9001vdp_device::gp9001_draw_custom_tilemap(running_machine& machine, bitmap_t* bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable )
{
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
int y,x;
bitmap_t *tmb = tilemap_get_pixmap(tilemap);
UINT16* srcptr;
@@ -1019,7 +1019,7 @@ static const UINT8 gp9001_sprprimap1[16] = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14
static const UINT8 batsugun_prienable0[16]={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
-void gp9001vdp_device::gp9001_render_vdp(running_machine* machine, bitmap_t* bitmap, const rectangle* cliprect)
+void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect)
{
if (gp9001_gfxrom_is_banked && gp9001_gfxrom_bank_dirty)
{
diff --git a/src/mame/video/gp9001.h b/src/mame/video/gp9001.h
index a1744adb360..a546a255db8 100644
--- a/src/mame/video/gp9001.h
+++ b/src/mame/video/gp9001.h
@@ -68,9 +68,9 @@ public:
UINT16 gp9001_gfxrom_bank[8]; /* Batrider object bank */
- void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap );
- void gp9001_draw_custom_tilemap(running_machine* machine, bitmap_t* bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable );
- void gp9001_render_vdp(running_machine* machine, bitmap_t* bitmap, const rectangle* cliprect);
+ void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap );
+ void gp9001_draw_custom_tilemap(running_machine& machine, bitmap_t* bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable );
+ void gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect);
void gp9001_screen_eof(void);
void create_tilemaps(int region);
void init_scroll_regs(void);
diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c
index f4b33391c93..de0c0204838 100644
--- a/src/mame/video/gradius3.c
+++ b/src/mame/video/gradius3.c
@@ -12,9 +12,9 @@
***************************************************************************/
-void gradius3_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void gradius3_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7);
@@ -28,7 +28,7 @@ void gradius3_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void gradius3_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask, int *shadow )
+void gradius3_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask, int *shadow )
{
#define L0 0xaa
#define L1 0xcc
@@ -38,7 +38,7 @@ void gradius3_sprite_callback( running_machine *machine, int *code, int *color,
{ L0|L2, L0, L0|L2, L0|L1|L2 },
{ L1|L2, L2, 0, L0|L1|L2 }
};
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
int pri = ((*color & 0x60) >> 5);
if (state->priority == 0)
@@ -64,13 +64,13 @@ static STATE_POSTLOAD( gradius3_postload )
for (i = 0; i < 0x20000; i += 16)
{
- gfx_element_mark_dirty(machine->gfx[0], i / 16);
+ gfx_element_mark_dirty(machine.gfx[0], i / 16);
}
}
VIDEO_START( gradius3 )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
int i;
state->layer_colorbase[0] = 0;
@@ -84,11 +84,11 @@ VIDEO_START( gradius3 )
/* re-decode the sprites because the ROMs are connected to the custom IC differently
from how they are connected to the CPU. */
for (i = 0; i < TOTAL_SPRITES; i++)
- gfx_element_mark_dirty(machine->gfx[1], i);
+ gfx_element_mark_dirty(machine.gfx[1], i);
- gfx_element_set_source(machine->gfx[0], (UINT8 *)state->gfxram);
+ gfx_element_set_source(machine.gfx[0], (UINT8 *)state->gfxram);
- machine->state().register_postload(gradius3_postload, NULL);
+ machine.state().register_postload(gradius3_postload, NULL);
}
@@ -101,20 +101,20 @@ VIDEO_START( gradius3 )
READ16_HANDLER( gradius3_gfxrom_r )
{
- UINT8 *gfxdata = space->machine->region("gfx2")->base();
+ UINT8 *gfxdata = space->machine().region("gfx2")->base();
return (gfxdata[2 * offset + 1] << 8) | gfxdata[2 * offset];
}
WRITE16_HANDLER( gradius3_gfxram_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
int oldword = state->gfxram[offset];
COMBINE_DATA(&state->gfxram[offset]);
if (oldword != state->gfxram[offset])
- gfx_element_mark_dirty(space->machine->gfx[0], offset / 16);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset / 16);
}
/***************************************************************************
@@ -125,7 +125,7 @@ WRITE16_HANDLER( gradius3_gfxram_w )
SCREEN_UPDATE( gradius3 )
{
- gradius3_state *state = screen->machine->driver_data<gradius3_state>();
+ gradius3_state *state = screen->machine().driver_data<gradius3_state>();
/* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
k052109_w(state->k052109, 0x1d80, 0x10);
@@ -133,7 +133,7 @@ SCREEN_UPDATE( gradius3 )
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->priority == 0)
{
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2);
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index 58fcd0e8798..6f36f6d1166 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -16,7 +16,7 @@ PALETTE_INIT( grchamp )
{
static const int resistances[3] = { 100, 270, 470 };
double rweights[3], gweights[3], bweights[2];
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
int i;
/* compute the color output resistor weights */
@@ -54,46 +54,46 @@ PALETTE_INIT( grchamp )
WRITE8_HANDLER( grchamp_left_w )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
state->leftram[offset] = data;
tilemap_mark_tile_dirty(state->left_tilemap, offset);
}
WRITE8_HANDLER( grchamp_center_w )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
state->centerram[offset] = data;
tilemap_mark_tile_dirty(state->center_tilemap, offset);
}
WRITE8_HANDLER( grchamp_right_w )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
state->rightram[offset] = data;
tilemap_mark_tile_dirty(state->right_tilemap, offset);
}
static TILE_GET_INFO( get_text_tile_info )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
SET_TILE_INFO(0, state->videoram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_left_tile_info )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
SET_TILE_INFO(1, state->leftram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_right_tile_info )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
SET_TILE_INFO(2, state->rightram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_center_tile_info )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
SET_TILE_INFO(3, state->centerram[tile_index], 0, 0);
}
@@ -105,9 +105,9 @@ static TILEMAP_MAPPER( get_memory_offset )
VIDEO_START( grchamp )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
- state->work_bitmap = auto_bitmap_alloc(machine,32,32,machine->primary_screen->format());
+ state->work_bitmap = auto_bitmap_alloc(machine,32,32,machine.primary_screen->format());
/* allocate tilemaps for each of the three sections */
state->text_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -117,11 +117,11 @@ VIDEO_START( grchamp )
}
#if 0
-static int collision_check(running_machine *machine, grchamp_state *state, bitmap_t *bitmap, int which )
+static int collision_check(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, int which )
{
- int bgcolor = machine->pens[0];
- int sprite_transp = machine->pens[0x24];
- const rectangle *visarea = machine->primary_screen->visible_area();
+ int bgcolor = machine.pens[0];
+ int sprite_transp = machine.pens[0x24];
+ const rectangle *visarea = machine.primary_screen->visible_area();
int y0 = 240 - state->cpu0_out[3];
int x0 = 256 - state->cpu0_out[2];
int x,y,sx,sy;
@@ -133,7 +133,7 @@ static int collision_check(running_machine *machine, grchamp_state *state, bitma
/* draw the current player sprite into a work bitmap */
drawgfx_opaque( state->work_bitmap,
0,
- machine->gfx[4],
+ machine.gfx[4],
state->cpu0_out[4]&0xf,
1, /* color */
0,0,
@@ -185,9 +185,9 @@ static void draw_fog(grchamp_state *state, bitmap_t *bitmap, const rectangle *cl
}
}
-static void draw_sprites(running_machine *machine, grchamp_state *state, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, const rectangle *cliprect)
{
- const gfx_element *gfx = machine->gfx[5];
+ const gfx_element *gfx = machine.gfx[5];
int bank = (state->cpu0_out[0] & 0x20) ? 0x40 : 0x00;
const UINT8 *source = state->spriteram + 0x40;
const UINT8 *finish = source + 0x40;
@@ -211,7 +211,7 @@ static void draw_sprites(running_machine *machine, grchamp_state *state, bitmap_
#endif
-static void draw_objects(running_machine *machine, grchamp_state *state, int y, UINT8 *objdata)
+static void draw_objects(running_machine &machine, grchamp_state *state, int y, UINT8 *objdata)
{
/*
CPU 5/7:
@@ -248,7 +248,7 @@ static void draw_objects(running_machine *machine, grchamp_state *state, int y,
*/
- const UINT8 *prom = machine->region("proms")->base() + 0x20;
+ const UINT8 *prom = machine.region("proms")->base() + 0x20;
const gfx_element *gfx;
int change = (state->cpu0_out[0] & 0x20) << 3;
int num;
@@ -257,7 +257,7 @@ static void draw_objects(running_machine *machine, grchamp_state *state, int y,
memset(objdata, 0, 256);
/* now draw the sprites; this is done during HBLANK */
- gfx = machine->gfx[4];
+ gfx = machine.gfx[4];
for (num = 0; num < 16; num++)
{
/*
@@ -309,7 +309,7 @@ static void draw_objects(running_machine *machine, grchamp_state *state, int y,
}
/* finally draw the text characters; this is done as we read out the object buffers */
- gfx = machine->gfx[0];
+ gfx = machine.gfx[0];
for (num = 0; num < 32; num++)
{
/*
@@ -366,10 +366,10 @@ SCREEN_UPDATE( grchamp )
MAKE_RGB(RGB_MAX,RGB_MAX,RGB_MAX)
};
- grchamp_state *state = screen->machine->driver_data<grchamp_state>();
- const UINT8 *amedata = screen->machine->region("gfx5")->base();
- const UINT8 *headdata = screen->machine->region("gfx6")->base();
- const UINT8 *pldata = screen->machine->region("gfx7")->base();
+ grchamp_state *state = screen->machine().driver_data<grchamp_state>();
+ const UINT8 *amedata = screen->machine().region("gfx5")->base();
+ const UINT8 *headdata = screen->machine().region("gfx6")->base();
+ const UINT8 *pldata = screen->machine().region("gfx7")->base();
bitmap_t *lpixmap = tilemap_get_pixmap(state->left_tilemap);
bitmap_t *rpixmap = tilemap_get_pixmap(state->right_tilemap);
bitmap_t *cpixmap = tilemap_get_pixmap(state->center_tilemap);
@@ -409,7 +409,7 @@ SCREEN_UPDATE( grchamp )
UINT8 objdata[256];
/* draw the objects for this scanline */
- draw_objects(screen->machine, state, y, objdata);
+ draw_objects(screen->machine(), state, y, objdata);
/* iterate over columns */
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
diff --git a/src/mame/video/gridlee.c b/src/mame/video/gridlee.c
index 5833beb4b23..e167daa6cd1 100644
--- a/src/mame/video/gridlee.c
+++ b/src/mame/video/gridlee.c
@@ -22,7 +22,7 @@ PALETTE_INIT( gridlee )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
palette_set_color_rgb(machine,i,pal4bit(color_prom[0x0000]),pal4bit(color_prom[0x0800]),pal4bit(color_prom[0x1000]));
color_prom++;
@@ -39,7 +39,7 @@ PALETTE_INIT( gridlee )
static STATE_POSTLOAD( expand_pixels )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
UINT8 *videoram = state->videoram;
int offset = 0;
@@ -60,7 +60,7 @@ static STATE_POSTLOAD( expand_pixels )
VIDEO_START( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* allocate a local copy of video RAM */
state->local_videoram = auto_alloc_array_clear(machine, UINT8, 256 * 256);
@@ -69,7 +69,7 @@ VIDEO_START( gridlee )
state_save_register_global(machine, state->cocktail_flip);
state_save_register_global(machine, state->palettebank_vis);
- machine->state().register_postload(expand_pixels, NULL);
+ machine.state().register_postload(expand_pixels, NULL);
}
@@ -82,7 +82,7 @@ VIDEO_START( gridlee )
WRITE8_HANDLER( gridlee_cocktail_flip_w )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
state->cocktail_flip = data & 1;
}
@@ -96,7 +96,7 @@ WRITE8_HANDLER( gridlee_cocktail_flip_w )
WRITE8_HANDLER( gridlee_videoram_w )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -115,9 +115,9 @@ WRITE8_HANDLER( gridlee_videoram_w )
WRITE8_HANDLER( gridlee_palette_select_w )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
/* update the scanline palette */
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1 + GRIDLEE_VBEND);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1 + GRIDLEE_VBEND);
state->palettebank_vis = data & 0x3f;
}
@@ -134,8 +134,8 @@ WRITE8_HANDLER( gridlee_palette_select_w )
SCREEN_UPDATE( gridlee )
{
- gridlee_state *state = screen->machine->driver_data<gridlee_state>();
- const pen_t *pens = &screen->machine->pens[state->palettebank_vis * 32];
+ gridlee_state *state = screen->machine().driver_data<gridlee_state>();
+ const pen_t *pens = &screen->machine().pens[state->palettebank_vis * 32];
UINT8 *gfx;
int x, y, i;
@@ -160,7 +160,7 @@ SCREEN_UPDATE( gridlee )
}
/* draw the sprite images */
- gfx = screen->machine->region("gfx1")->base();
+ gfx = screen->machine().region("gfx1")->base();
for (i = 0; i < 32; i++)
{
UINT8 *sprite = state->spriteram + i * 4;
diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c
index 44c9d266ea7..96eaea68a68 100644
--- a/src/mame/video/groundfx.c
+++ b/src/mame/video/groundfx.c
@@ -6,7 +6,7 @@
VIDEO_START( groundfx )
{
- groundfx_state *state = machine->driver_data<groundfx_state>();
+ groundfx_state *state = machine.driver_data<groundfx_state>();
state->spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
/* Hack */
@@ -63,11 +63,11 @@ Heavy use is made of sprite zooming.
***************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int do_hack,int x_offs,int y_offs)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int do_hack,int x_offs,int y_offs)
{
- groundfx_state *state = machine->driver_data<groundfx_state>();
+ groundfx_state *state = machine.driver_data<groundfx_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -185,13 +185,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
else
clipper=cliprect;
- pdrawgfxzoom_transpen(bitmap,clipper,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,clipper,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,primasks[sprite_ptr->pri],0);
+ machine.priority_bitmap,primasks[sprite_ptr->pri],0);
}
}
@@ -201,9 +201,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( groundfx )
{
- groundfx_state *state = screen->machine->driver_data<groundfx_state>();
- device_t *tc0100scn = screen->machine->device("tc0100scn");
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ groundfx_state *state = screen->machine().driver_data<groundfx_state>();
+ device_t *tc0100scn = screen->machine().device("tc0100scn");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT8 pivlayer[3];
UINT16 priority;
@@ -223,7 +223,7 @@ SCREEN_UPDATE( groundfx )
pivlayer[1] = pivlayer[0]^1;
pivlayer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0);
@@ -256,7 +256,7 @@ SCREEN_UPDATE( groundfx )
if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
tc0480scp_tilemap_draw(tc0480scp, bitmap, &state->hack_cliprect, layer[0], 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1, 44, -574);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, 44, -574);
}
else
{
@@ -267,7 +267,7 @@ SCREEN_UPDATE( groundfx )
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[2], 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 44, -574);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 44, -574);
}
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); /* TC0480SCP text layer */
diff --git a/src/mame/video/gstriker.c b/src/mame/video/gstriker.c
index 65f88bc138e..e05a3e2d118 100644
--- a/src/mame/video/gstriker.c
+++ b/src/mame/video/gstriker.c
@@ -27,7 +27,7 @@ t=tile, p=palette
static TILE_GET_INFO( VS920A_get_tile_info )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int data;
int tileno, pal;
@@ -41,21 +41,21 @@ static TILE_GET_INFO( VS920A_get_tile_info )
WRITE16_HANDLER( VS920A_0_vram_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
COMBINE_DATA(&state->VS920A[0].vram[offset]);
tilemap_mark_tile_dirty(state->VS920A[0].tmap, offset);
}
WRITE16_HANDLER( VS920A_1_vram_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
COMBINE_DATA(&state->VS920A[1].vram[offset]);
tilemap_mark_tile_dirty(state->VS920A[1].tmap, offset);
}
-static void VS920A_init(running_machine *machine, int numchips)
+static void VS920A_init(running_machine &machine, int numchips)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int i;
if (numchips > MAX_VS920A)
@@ -143,7 +143,7 @@ index is in the MSB. gstriker uses 5 bits for banking, but the chips could be ab
static TILE_GET_INFO( MB60553_get_tile_info )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int data, bankno;
int tileno, pal;
@@ -211,9 +211,9 @@ static TILEMAP_MAPPER( twc94_scan )
return (row*64) + (col&63) + ((col&64)<<6);
}
-static void MB60553_init(running_machine *machine, int numchips)
+static void MB60553_init(running_machine &machine, int numchips)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int i;
if (numchips > MAX_MB60553)
@@ -238,15 +238,15 @@ static void MB60553_set_gfx_region(gstriker_state *state, int numchip, int gfx_r
}
/* THIS IS STILL WRONG! */
-static void MB60553_draw(running_machine *machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
+static void MB60553_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int line;
rectangle clip;
state->MB60553_cur_chip = &state->MB60553[numchip];
- clip.min_x = machine->primary_screen->visible_area().min_x;
- clip.max_x = machine->primary_screen->visible_area().max_x;
+ clip.min_x = machine.primary_screen->visible_area().min_x;
+ clip.max_x = machine.primary_screen->visible_area().max_x;
for (line = 0; line < 224;line++)
{
@@ -288,7 +288,7 @@ static tilemap_t* MB60553_get_tilemap(gstriker_state *state, int numchip)
WRITE16_HANDLER(MB60553_0_regs_w)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
UINT16 oldreg = state->MB60553[0].regs[offset];
COMBINE_DATA(&state->MB60553[0].regs[offset]);
@@ -299,7 +299,7 @@ WRITE16_HANDLER(MB60553_0_regs_w)
WRITE16_HANDLER(MB60553_1_regs_w)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
UINT16 oldreg = state->MB60553[1].regs[offset];
COMBINE_DATA(&state->MB60553[1].regs[offset]);
@@ -310,7 +310,7 @@ WRITE16_HANDLER(MB60553_1_regs_w)
WRITE16_HANDLER(MB60553_0_vram_w)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
COMBINE_DATA(&state->MB60553[0].vram[offset]);
tilemap_mark_tile_dirty(state->MB60553[0].tmap, offset);
@@ -318,7 +318,7 @@ WRITE16_HANDLER(MB60553_0_vram_w)
WRITE16_HANDLER(MB60553_1_vram_w)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
COMBINE_DATA(&state->MB60553[1].vram[offset]);
tilemap_mark_tile_dirty(state->MB60553[1].tmap, offset);
@@ -383,9 +383,9 @@ Abstracts the VS9210
*/
-static void CG10103_draw_sprite(running_machine *machine, bitmap_t* screen, const rectangle* cliprect, UINT16* spr, int drawpri)
+static void CG10103_draw_sprite(running_machine &machine, bitmap_t* screen, const rectangle* cliprect, UINT16* spr, int drawpri)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
int ypos = spr[0] & 0x1FF;
int xpos = (spr[1] & 0x1FF);
UINT32 tile = (spr[3] & 0xFFFF) | ((spr[2] & 1) << 16);
@@ -449,8 +449,8 @@ static void CG10103_draw_sprite(running_machine *machine, bitmap_t* screen, cons
for (x=0;x<xnum;x++)
{
// Hack to handle horizontal wrapping
- drawgfxzoom_transpen(screen, cliprect, machine->gfx[state->CG10103_cur_chip->gfx_region], tile, color+state->CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, xfact, yfact, state->CG10103_cur_chip->transpen);
- drawgfxzoom_transpen(screen, cliprect, machine->gfx[state->CG10103_cur_chip->gfx_region], tile, color+state->CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, xfact, yfact, state->CG10103_cur_chip->transpen);
+ drawgfxzoom_transpen(screen, cliprect, machine.gfx[state->CG10103_cur_chip->gfx_region], tile, color+state->CG10103_cur_chip->pal_base, flipx, flipy, xp>>16, ypos>>16, xfact, yfact, state->CG10103_cur_chip->transpen);
+ drawgfxzoom_transpen(screen, cliprect, machine.gfx[state->CG10103_cur_chip->gfx_region], tile, color+state->CG10103_cur_chip->pal_base, flipx, flipy, (xp>>16) - 0x200, ypos>>16, xfact, yfact, state->CG10103_cur_chip->transpen);
xp += xstep;
tile++;
}
@@ -460,9 +460,9 @@ static void CG10103_draw_sprite(running_machine *machine, bitmap_t* screen, cons
}
-static void CG10103_draw(running_machine *machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
+static void CG10103_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
UINT16* splist;
int i;
@@ -535,18 +535,18 @@ WRITE16_HANDLER( gsx_videoram3_w )
SCREEN_UPDATE(gstriker)
{
- gstriker_state *state = screen->machine->driver_data<gstriker_state>();
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ gstriker_state *state = screen->machine().driver_data<gstriker_state>();
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
// Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably
// needs sprite orthogonality
- MB60553_draw(screen->machine, 0, bitmap,cliprect, 0);
+ MB60553_draw(screen->machine(), 0, bitmap,cliprect, 0);
- CG10103_draw(screen->machine, 0, bitmap, cliprect, 0);
+ CG10103_draw(screen->machine(), 0, bitmap, cliprect, 0);
VS920A_draw(state, 0, bitmap, cliprect, 0);
- CG10103_draw(screen->machine, 0, bitmap, cliprect, 1);
+ CG10103_draw(screen->machine(), 0, bitmap, cliprect, 1);
#if 0
popmessage("%04x %04x %04x %04x %04x %04x %04x %04x",
@@ -566,7 +566,7 @@ SCREEN_UPDATE(gstriker)
VIDEO_START(gstriker)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
@@ -591,7 +591,7 @@ VIDEO_START(gstriker)
VIDEO_START(twrldc94)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
@@ -616,7 +616,7 @@ VIDEO_START(twrldc94)
VIDEO_START(vgoalsoc)
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
// Palette bases are hardcoded, but should be probably extracted from the mixer registers
diff --git a/src/mame/video/gsword.c b/src/mame/video/gsword.c
index e4ada13b348..59925deb086 100644
--- a/src/mame/video/gsword.c
+++ b/src/mame/video/gsword.c
@@ -15,13 +15,13 @@ static PALETTE_INIT( common )
/* characters */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (BITSWAP8(color_prom[i - 0x100],7,6,5,4,0,1,2,3) & 0x0f) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -31,7 +31,7 @@ PALETTE_INIT( josvolly )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -40,7 +40,7 @@ PALETTE_INIT( josvolly )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -55,7 +55,7 @@ PALETTE_INIT( gsword )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -81,7 +81,7 @@ PALETTE_INIT( gsword )
bit2 = (color_prom[i + 0x000] >> 3) & 1;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -92,7 +92,7 @@ PALETTE_INIT( gsword )
WRITE8_HANDLER( gsword_videoram_w )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -100,17 +100,17 @@ WRITE8_HANDLER( gsword_videoram_w )
WRITE8_HANDLER( gsword_charbank_w )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
if (state->charbank != data)
{
state->charbank = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( gsword_videoctrl_w )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
if (data & 0x8f)
{
popmessage("videoctrl %02x",data);
@@ -121,7 +121,7 @@ WRITE8_HANDLER( gsword_videoctrl_w )
if (state->charpalbank != ((data & 0x60) >> 5))
{
state->charpalbank = (data & 0x60) >> 5;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 4 is flip screen */
@@ -129,7 +129,7 @@ WRITE8_HANDLER( gsword_videoctrl_w )
if (state->flipscreen != (data & 0x10))
{
state->flipscreen = data & 0x10;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 0 could be used but unknown */
@@ -139,13 +139,13 @@ WRITE8_HANDLER( gsword_videoctrl_w )
WRITE8_HANDLER( gsword_scroll_w )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- gsword_state *state = machine->driver_data<gsword_state>();
+ gsword_state *state = machine.driver_data<gsword_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index] + ((state->charbank & 0x03) << 8);
int color = ((code & 0x3c0) >> 6) + 16 * state->charpalbank;
@@ -156,14 +156,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( gsword )
{
- gsword_state *state = machine->driver_data<gsword_state>();
+ gsword_state *state = machine.driver_data<gsword_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 64);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gsword_state *state = machine->driver_data<gsword_state>();
+ gsword_state *state = machine.driver_data<gsword_state>();
int offs;
for (offs = 0; offs < state->spritexy_size - 1; offs+=2)
@@ -195,20 +195,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = !flipx;
flipy = !flipy;
}
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1+spritebank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1+spritebank],
tile,
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1+spritebank], color, 0x8f));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1+spritebank], color, 0x8f));
}
}
}
SCREEN_UPDATE( gsword )
{
- gsword_state *state = screen->machine->driver_data<gsword_state>();
+ gsword_state *state = screen->machine().driver_data<gsword_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index 02781204dd3..a25586cbf46 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -28,7 +28,7 @@ gtia_struct gtia;
#define VERBOSE 0
static void gtia_reset(running_machine &machine);
-static void gtia_state(running_machine *machine);
+static void gtia_state(running_machine &machine);
static STATE_POSTLOAD( gtia_state_postload );
/**********************************************
@@ -63,12 +63,12 @@ static STATE_POSTLOAD( gtia_state_postload );
*
*************************************/
-void gtia_init(running_machine *machine, const gtia_interface *intf)
+void gtia_init(running_machine &machine, const gtia_interface *intf)
{
memset(&gtia, 0, sizeof(gtia));
gtia.intf = *intf;
- machine->add_notifier(MACHINE_NOTIFY_RESET, gtia_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, gtia_reset);
/* state saves */
gtia_state(machine);
@@ -76,7 +76,7 @@ void gtia_init(running_machine *machine, const gtia_interface *intf)
-static void gtia_state(running_machine *machine)
+static void gtia_state(running_machine &machine)
{
state_save_register_global(machine, gtia.r.m0pf);
state_save_register_global(machine, gtia.r.m1pf);
@@ -139,14 +139,14 @@ static void gtia_state(running_machine *machine)
state_save_register_global(machine, gtia.w.gractl);
state_save_register_global(machine, gtia.w.hitclr);
state_save_register_global(machine, gtia.w.cons);
- machine->state().register_postload(gtia_state_postload, NULL);
+ machine.state().register_postload(gtia_state_postload, NULL);
}
-static int is_ntsc(running_machine *machine)
+static int is_ntsc(running_machine &machine)
{
- return ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds) > 55;
+ return ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds) > 55;
}
@@ -160,7 +160,7 @@ static void gtia_reset(running_machine &machine)
for (i = 0; i < 32; i++)
atari_gtia_w(space,i,0);
memset(&gtia.r, 0, sizeof(gtia.r));
- if (is_ntsc(&machine))
+ if (is_ntsc(machine))
gtia.r.pal = 0xff;
else
gtia.r.pal = 0xf1;
diff --git a/src/mame/video/gtia.h b/src/mame/video/gtia.h
index 3fc7cd15f38..19bf865b068 100644
--- a/src/mame/video/gtia.h
+++ b/src/mame/video/gtia.h
@@ -138,7 +138,7 @@ struct _gtia_struct
extern gtia_struct gtia;
-void gtia_init(running_machine *machine, const gtia_interface *intf);
+void gtia_init(running_machine &machine, const gtia_interface *intf);
READ8_HANDLER( atari_gtia_r );
WRITE8_HANDLER( atari_gtia_w );
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index edc58b438c9..006187a6de4 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -38,7 +38,7 @@ static int K001006_device_sel[MAX_K001006_CHIPS] = { 0, 0 };
static UINT32 *K001006_palette[MAX_K001006_CHIPS];
-void K001006_init(running_machine *machine)
+void K001006_init(running_machine &machine)
{
int i;
for (i=0; i<MAX_K001006_CHIPS; i++)
@@ -52,7 +52,7 @@ void K001006_init(running_machine *machine)
}
}
-static UINT32 K001006_r(running_machine *machine, int chip, int offset, UINT32 mem_mask)
+static UINT32 K001006_r(running_machine &machine, int chip, int offset, UINT32 mem_mask)
{
if (offset == 1)
{
@@ -60,7 +60,7 @@ static UINT32 K001006_r(running_machine *machine, int chip, int offset, UINT32 m
{
case 0x0b: // CG Board ROM read
{
- UINT16 *rom = (UINT16*)machine->region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
return rom[K001006_addr[chip] / 2] << 16;
}
case 0x0d: // Palette RAM read
@@ -135,7 +135,7 @@ static void K001006_w(int chip, int offset, UINT32 data, UINT32 mem_mask)
READ32_HANDLER(K001006_0_r)
{
- return K001006_r(space->machine, 0, offset, mem_mask);
+ return K001006_r(space->machine(), 0, offset, mem_mask);
}
WRITE32_HANDLER(K001006_0_w)
@@ -145,7 +145,7 @@ WRITE32_HANDLER(K001006_0_w)
READ32_HANDLER(K001006_1_r)
{
- return K001006_r(space->machine, 1, offset, mem_mask);
+ return K001006_r(space->machine(), 1, offset, mem_mask);
}
WRITE32_HANDLER(K001006_1_w)
@@ -168,7 +168,7 @@ static bitmap_t *K001005_bitmap[2];
static bitmap_t *K001005_zbuffer;
static rectangle K001005_cliprect;
-static void render_polygons(running_machine *machine);
+static void render_polygons(running_machine &machine);
static UINT8 *K001005_texture;
@@ -197,18 +197,18 @@ static void K001005_exit(running_machine &machine)
poly_free(poly);
}
-void K001005_init(running_machine *machine)
+void K001005_init(running_machine &machine)
{
int i;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
K001005_zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED32);
- gfxrom = machine->region("gfx1")->base();
+ gfxrom = machine.region("gfx1")->base();
- K001005_bitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
- K001005_bitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
+ K001005_bitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
+ K001005_bitmap[1] = machine.primary_screen->alloc_compatible_bitmap();
K001005_texture = auto_alloc_array(machine, UINT8, 0x800000);
@@ -220,7 +220,7 @@ void K001005_init(running_machine *machine)
K001005_3d_fifo = auto_alloc_array(machine, UINT32, 0x10000);
poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, K001005_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, K001005_exit);
for (i=0; i < 128; i++)
{
@@ -313,19 +313,19 @@ READ32_HANDLER( K001005_r )
{
if (K001005_fifo_read_ptr < 0x3ff)
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
}
else
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
}
}
else
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
}
K001005_fifo_read_ptr++;
@@ -366,19 +366,19 @@ WRITE32_HANDLER( K001005_w )
{
if (K001005_fifo_write_ptr < 0x400)
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
}
else
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, CLEAR_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, CLEAR_LINE);
}
}
else
{
- //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(space->machine->device("dsp"), 1, ASSERT_LINE);
+ //cputag_set_input_line(space->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(space->machine().device("dsp"), 1, ASSERT_LINE);
}
// mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, cpu_get_pc(space->cpu));
@@ -417,8 +417,8 @@ WRITE32_HANDLER( K001005_w )
if (data == 2 && K001005_3d_fifo_ptr > 0)
{
- K001005_swap_buffers(space->machine);
- render_polygons(space->machine);
+ K001005_swap_buffers(space->machine());
+ render_polygons(space->machine());
poly_wait(poly, "render_polygons");
K001005_3d_fifo_ptr = 0;
}
@@ -538,10 +538,10 @@ static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *ext
}
}
-static void render_polygons(running_machine *machine)
+static void render_polygons(running_machine &machine)
{
int i, j;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
// mame_printf_debug("K001005_fifo_ptr = %08X\n", K001005_3d_fifo_ptr);
@@ -955,13 +955,13 @@ void K001005_draw(bitmap_t *bitmap, const rectangle *cliprect)
}
}
-void K001005_swap_buffers(running_machine *machine)
+void K001005_swap_buffers(running_machine &machine)
{
K001005_bitmap_page ^= 1;
//if (K001005_status == 2)
{
- bitmap_fill(K001005_bitmap[K001005_bitmap_page], &K001005_cliprect, machine->pens[0]&0x00ffffff);
+ bitmap_fill(K001005_bitmap[K001005_bitmap_page], &K001005_cliprect, machine.pens[0]&0x00ffffff);
bitmap_fill(K001005_zbuffer, &K001005_cliprect, 0xffffffff);
}
}
@@ -983,7 +983,7 @@ VIDEO_START( gticlub )
SCREEN_UPDATE( gticlub )
{
- device_t *k001604 = screen->machine->device("k001604_1");
+ device_t *k001604 = screen->machine().device("k001604_1");
k001604_draw_back_layer(k001604, bitmap, cliprect);
@@ -995,15 +995,15 @@ SCREEN_UPDATE( gticlub )
if( tick >= 5 ) {
tick = 0;
- if( input_code_pressed(screen->machine, KEYCODE_O) )
+ if( input_code_pressed(screen->machine(), KEYCODE_O) )
debug_tex_page++;
- if( input_code_pressed(screen->machine, KEYCODE_I) )
+ if( input_code_pressed(screen->machine(), KEYCODE_I) )
debug_tex_page--;
- if (input_code_pressed(screen->machine, KEYCODE_U))
+ if (input_code_pressed(screen->machine(), KEYCODE_U))
debug_tex_palette++;
- if (input_code_pressed(screen->machine, KEYCODE_Y))
+ if (input_code_pressed(screen->machine(), KEYCODE_Y))
debug_tex_palette--;
if (debug_tex_page < 0)
@@ -1025,7 +1025,7 @@ SCREEN_UPDATE( gticlub )
int index = (debug_tex_page - 1) * 0x40000;
int pal = debug_tex_palette & 7;
int tp = (debug_tex_palette >> 3) & 1;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
for (y=0; y < 384; y++)
{
@@ -1044,19 +1044,19 @@ SCREEN_UPDATE( gticlub )
draw_7segment_led(bitmap, 3, 3, gticlub_led_reg[0]);
draw_7segment_led(bitmap, 9, 3, gticlub_led_reg[1]);
- //cputag_set_input_line(screen->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
- sharc_set_flag_input(screen->machine->device("dsp"), 1, ASSERT_LINE);
+ //cputag_set_input_line(screen->machine(), "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
+ sharc_set_flag_input(screen->machine().device("dsp"), 1, ASSERT_LINE);
return 0;
}
SCREEN_UPDATE( hangplt )
{
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
if (strcmp(screen->tag(), "lscreen") == 0)
{
- device_t *k001604 = screen->machine->device("k001604_1");
- device_t *voodoo = screen->machine->device("voodoo0");
+ device_t *k001604 = screen->machine().device("k001604_1");
+ device_t *voodoo = screen->machine().device("voodoo0");
// k001604_draw_back_layer(k001604, bitmap, cliprect);
@@ -1066,8 +1066,8 @@ SCREEN_UPDATE( hangplt )
}
else if (strcmp(screen->tag(), "rscreen") == 0)
{
- device_t *k001604 = screen->machine->device("k001604_2");
- device_t *voodoo = screen->machine->device("voodoo1");
+ device_t *k001604 = screen->machine().device("k001604_2");
+ device_t *voodoo = screen->machine().device("voodoo1");
// k001604_draw_back_layer(k001604, bitmap, cliprect);
diff --git a/src/mame/video/gticlub.h b/src/mame/video/gticlub.h
index 3afc8289bce..3f911ab500a 100644
--- a/src/mame/video/gticlub.h
+++ b/src/mame/video/gticlub.h
@@ -1,14 +1,14 @@
void gticlub_led_setreg(int offset, UINT8 data);
void K001005_draw(bitmap_t *bitmap, const rectangle *cliprect);
-void K001005_swap_buffers(running_machine *machine);
-void K001005_init(running_machine *machine);
+void K001005_swap_buffers(running_machine &machine);
+void K001005_init(running_machine &machine);
void K001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub);
READ32_HANDLER(K001005_r);
WRITE32_HANDLER(K001005_w);
-void K001006_init(running_machine *machine);
+void K001006_init(running_machine &machine);
READ32_HANDLER(K001006_0_r);
WRITE32_HANDLER(K001006_0_w);
READ32_HANDLER(K001006_1_r);
diff --git a/src/mame/video/gumbo.c b/src/mame/video/gumbo.c
index b2223034754..69b285612f1 100644
--- a/src/mame/video/gumbo.c
+++ b/src/mame/video/gumbo.c
@@ -6,14 +6,14 @@
WRITE16_HANDLER( gumbo_bg_videoram_w )
{
- gumbo_state *state = space->machine->driver_data<gumbo_state>();
+ gumbo_state *state = space->machine().driver_data<gumbo_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_gumbo_bg_tile_info )
{
- gumbo_state *state = machine->driver_data<gumbo_state>();
+ gumbo_state *state = machine.driver_data<gumbo_state>();
int tileno = state->bg_videoram[tile_index];
SET_TILE_INFO(0, tileno, 0, 0);
}
@@ -21,14 +21,14 @@ static TILE_GET_INFO( get_gumbo_bg_tile_info )
WRITE16_HANDLER( gumbo_fg_videoram_w )
{
- gumbo_state *state = space->machine->driver_data<gumbo_state>();
+ gumbo_state *state = space->machine().driver_data<gumbo_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static TILE_GET_INFO( get_gumbo_fg_tile_info )
{
- gumbo_state *state = machine->driver_data<gumbo_state>();
+ gumbo_state *state = machine.driver_data<gumbo_state>();
int tileno = state->fg_videoram[tile_index];
SET_TILE_INFO(1, tileno, 1, 0);
}
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_gumbo_fg_tile_info )
VIDEO_START( gumbo )
{
- gumbo_state *state = machine->driver_data<gumbo_state>();
+ gumbo_state *state = machine.driver_data<gumbo_state>();
state->bg_tilemap = tilemap_create(machine, get_gumbo_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_gumbo_fg_tile_info, tilemap_scan_rows, 4, 4, 128, 64);
tilemap_set_transparent_pen(state->fg_tilemap, 0xff);
@@ -44,7 +44,7 @@ VIDEO_START( gumbo )
SCREEN_UPDATE( gumbo )
{
- gumbo_state *state = screen->machine->driver_data<gumbo_state>();
+ gumbo_state *state = screen->machine().driver_data<gumbo_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c
index 758561644ef..324236dad34 100644
--- a/src/mame/video/gunbustr.c
+++ b/src/mame/video/gunbustr.c
@@ -6,7 +6,7 @@
VIDEO_START( gunbustr )
{
- gunbustr_state *state = machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = machine.driver_data<gunbustr_state>();
state->spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
}
@@ -56,11 +56,11 @@ Heavy use is made of sprite zooming.
********************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
{
- gunbustr_state *state = machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = machine.driver_data<gunbustr_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -167,7 +167,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -186,13 +186,13 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
@@ -204,7 +204,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
SCREEN_UPDATE( gunbustr )
{
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT16 priority;
static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
@@ -218,25 +218,25 @@ SCREEN_UPDATE( gunbustr )
layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */
layer[4] = 4; /* text layer always over bg layers */
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
/* We have to assume 2nd to bottom layer is always underneath
sprites as pdrawgfx cannot yet cope with more than 4 layers */
#ifdef MAME_DEBUG
- if (!input_code_pressed (screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
- if (!input_code_pressed (screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
- if (!input_code_pressed (screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
- if (!input_code_pressed (screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
- if (!input_code_pressed (screen->machine, KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
- if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116);
+ if (!input_code_pressed (screen->machine(), KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0],TILEMAP_DRAW_OPAQUE, 0);
+ if (!input_code_pressed (screen->machine(), KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
+ if (!input_code_pressed (screen->machine(), KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
+ if (!input_code_pressed (screen->machine(), KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
+ if (!input_code_pressed (screen->machine(), KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
+ if (!input_code_pressed (screen->machine(), KEYCODE_N)) draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116);
#else
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116);
#endif
return 0;
}
diff --git a/src/mame/video/gundealr.c b/src/mame/video/gundealr.c
index bbb445a7a56..35b94e9d6a0 100644
--- a/src/mame/video/gundealr.c
+++ b/src/mame/video/gundealr.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
UINT8 attr = state->bg_videoram[2 * tile_index + 1];
SET_TILE_INFO(
0,
@@ -35,7 +35,7 @@ static TILEMAP_MAPPER( gundealr_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
UINT8 attr = state->fg_videoram[2 * tile_index + 1];
SET_TILE_INFO(
1,
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, gundealr_scan, 16, 16, 64, 32);
@@ -71,21 +71,21 @@ VIDEO_START( gundealr )
WRITE8_HANDLER( gundealr_bg_videoram_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( gundealr_fg_videoram_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
WRITE8_HANDLER( gundealr_paletteram_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
int r,g,b,val;
state->paletteram[offset] = data;
@@ -98,12 +98,12 @@ WRITE8_HANDLER( gundealr_paletteram_w )
b = (val >> 4) & 0x0f;
/* TODO: the bottom 4 bits are used as well, but I'm not sure about the meaning */
- palette_set_color_rgb(space->machine, offset / 2, pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), offset / 2, pal4bit(r), pal4bit(g), pal4bit(b));
}
WRITE8_HANDLER( gundealr_fg_scroll_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
state->scroll[offset] = data;
tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[1] | ((state->scroll[0] & 0x03) << 8));
tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll[3] | ((state->scroll[2] & 0x03) << 8));
@@ -111,7 +111,7 @@ WRITE8_HANDLER( gundealr_fg_scroll_w )
WRITE8_HANDLER( yamyam_fg_scroll_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
state->scroll[offset] = data;
tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[0] | ((state->scroll[1] & 0x03) << 8));
tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll[2] | ((state->scroll[3] & 0x03) << 8));
@@ -119,9 +119,9 @@ WRITE8_HANDLER( yamyam_fg_scroll_w )
WRITE8_HANDLER( gundealr_flipscreen_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
state->flipscreen = data;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
@@ -134,7 +134,7 @@ WRITE8_HANDLER( gundealr_flipscreen_w )
SCREEN_UPDATE( gundealr )
{
- gundealr_state *state = screen->machine->driver_data<gundealr_state>();
+ gundealr_state *state = screen->machine().driver_data<gundealr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c
index 9e52e437d0a..4cfa246f959 100644
--- a/src/mame/video/gunsmoke.c
+++ b/src/mame/video/gunsmoke.c
@@ -21,7 +21,7 @@ PALETTE_INIT( gunsmoke )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -30,7 +30,7 @@ PALETTE_INIT( gunsmoke )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -40,53 +40,53 @@ PALETTE_INIT( gunsmoke )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] | 0x40;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* background tiles use colors 0-0x3f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4);
- colortable_entry_set_value(machine->colortable, i - 0x80, ctabentry);
+ colortable_entry_set_value(machine.colortable, i - 0x80, ctabentry);
}
/* sprites use colors 0x80-0xff */
for (i = 0x300; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80;
- colortable_entry_set_value(machine->colortable, i - 0x180, ctabentry);
+ colortable_entry_set_value(machine.colortable, i - 0x180, ctabentry);
}
}
WRITE8_HANDLER( gunsmoke_videoram_w )
{
- gunsmoke_state *state = space->machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = space->machine().driver_data<gunsmoke_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( gunsmoke_colorram_w )
{
- gunsmoke_state *state = space->machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = space->machine().driver_data<gunsmoke_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( gunsmoke_c804_w )
{
- gunsmoke_state *state = space->machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = space->machine().driver_data<gunsmoke_state>();
/* bits 0 and 1 are for coin counters */
- coin_counter_w(space->machine, 1, data & 0x01);
- coin_counter_w(space->machine, 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x02);
/* bits 2 and 3 select the ROM bank */
- memory_set_bank(space->machine, "bank1", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0c) >> 2);
/* bit 5 resets the sound CPU? - we ignore it */
/* bit 6 flips screen */
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
/* bit 7 enables characters? */
state->chon = data & 0x80;
@@ -94,7 +94,7 @@ WRITE8_HANDLER( gunsmoke_c804_w )
WRITE8_HANDLER( gunsmoke_d806_w )
{
- gunsmoke_state *state = space->machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = space->machine().driver_data<gunsmoke_state>();
/* bits 0-2 select the sprite 3 bank */
state->sprite3bank = data & 0x07;
@@ -108,7 +108,7 @@ WRITE8_HANDLER( gunsmoke_d806_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *tilerom = machine->region("gfx4")->base();
+ UINT8 *tilerom = machine.region("gfx4")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1];
@@ -121,7 +121,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xe0) << 2);
int color = attr & 0x1f;
@@ -133,16 +133,16 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( gunsmoke )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 32, 32, 2048, 8);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0x4f);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 0x4f);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -170,23 +170,23 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2], code, color, flipx, flipy, sx, sy, 0);
}
}
SCREEN_UPDATE( gunsmoke )
{
- gunsmoke_state *state = screen->machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = screen->machine().driver_data<gunsmoke_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[0] + 256 * state->scrollx[1]);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly[0]);
if (state->bgon)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->objon)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (state->chon)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/gyruss.c b/src/mame/video/gyruss.c
index e0377d3bf99..e58177ec9de 100644
--- a/src/mame/video/gyruss.c
+++ b/src/mame/video/gyruss.c
@@ -43,7 +43,7 @@ PALETTE_INIT( gyruss )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( gyruss )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,14 +78,14 @@ PALETTE_INIT( gyruss )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* characters map to the upper 16 palette entries */
for (i = 0x100; i < 0x140; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
}
}
@@ -93,15 +93,15 @@ PALETTE_INIT( gyruss )
WRITE8_HANDLER( gyruss_spriteram_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
- space->machine->primary_screen->update_now();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
+ space->machine().primary_screen->update_now();
state->spriteram[offset] = data;
}
static TILE_GET_INFO( gyruss_get_tile_info )
{
- gyruss_state *state = machine->driver_data<gyruss_state>();
+ gyruss_state *state = machine.driver_data<gyruss_state>();
int code = ((state->colorram[tile_index] & 0x20) << 3) | state->videoram[tile_index];
int color = state->colorram[tile_index] & 0x0f;
int flags = TILE_FLIPYX(state->colorram[tile_index] >> 6);
@@ -114,7 +114,7 @@ static TILE_GET_INFO( gyruss_get_tile_info )
VIDEO_START( gyruss )
{
- gyruss_state *state = machine->driver_data<gyruss_state>();
+ gyruss_state *state = machine.driver_data<gyruss_state>();
state->tilemap = tilemap_create(machine, gyruss_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transmask(state->tilemap, 0, 0x00, 0); /* opaque */
tilemap_set_transmask(state->tilemap, 1, 0x0f, 0); /* transparent */
@@ -125,13 +125,13 @@ VIDEO_START( gyruss )
READ8_HANDLER( gyruss_scanline_r )
{
/* reads 1V - 128V */
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx )
{
- gyruss_state *state = machine->driver_data<gyruss_state>();
+ gyruss_state *state = machine.driver_data<gyruss_state>();
int offs;
for (offs = 0xbc; offs >= 0; offs -= 4)
@@ -152,16 +152,16 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( gyruss )
{
- gyruss_state *state = screen->machine->driver_data<gyruss_state>();
+ gyruss_state *state = screen->machine().driver_data<gyruss_state>();
if (cliprect->min_y == screen->visible_area().min_y)
{
- tilemap_mark_all_tiles_dirty_all(screen->machine);
- tilemap_set_flip_all(screen->machine, (*state->flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
+ tilemap_set_flip_all(screen->machine(), (*state->flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
tilemap_draw(bitmap, cliprect, state->tilemap, TILEMAP_DRAW_OPAQUE, 0);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->gfx);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().gfx);
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/hanaawas.c b/src/mame/video/hanaawas.c
index ebbb8b88dcb..52f2e258a17 100644
--- a/src/mame/video/hanaawas.c
+++ b/src/mame/video/hanaawas.c
@@ -20,7 +20,7 @@ PALETTE_INIT( hanaawas )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -46,7 +46,7 @@ PALETTE_INIT( hanaawas )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -58,40 +58,40 @@ PALETTE_INIT( hanaawas )
{
int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
UINT8 ctabentry = color_prom[swapped_i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( hanaawas_videoram_w )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( hanaawas_colorram_w )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
state->colorram[offset] = data;
/* dirty both current and next offsets */
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
- tilemap_mark_tile_dirty(state->bg_tilemap, (offset + (flip_screen_get(space->machine) ? -1 : 1)) & 0x03ff);
+ tilemap_mark_tile_dirty(state->bg_tilemap, (offset + (flip_screen_get(space->machine()) ? -1 : 1)) & 0x03ff);
}
WRITE8_DEVICE_HANDLER( hanaawas_portB_w )
{
/* bit 7 is flip screen */
- if (flip_screen_get(device->machine) != (~data & 0x80))
+ if (flip_screen_get(device->machine()) != (~data & 0x80))
{
- flip_screen_set(device->machine, ~data & 0x80);
- tilemap_mark_all_tiles_dirty_all(device->machine);
+ flip_screen_set(device->machine(), ~data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(device->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
/* the color is determined by the current color byte, but the bank is via the previous one!!! */
int offset = (tile_index + (flip_screen_get(machine) ? 1 : -1)) & 0x3ff;
int attr = state->colorram[offset];
@@ -104,13 +104,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( hanaawas )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
SCREEN_UPDATE( hanaawas )
{
- hanaawas_state *state = screen->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = screen->machine().driver_data<hanaawas_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c
index bb4a1869be8..3c1041bd2a9 100644
--- a/src/mame/video/harddriv.c
+++ b/src/mame/video/harddriv.c
@@ -30,7 +30,7 @@
VIDEO_START( harddriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
UINT32 *destmask, mask;
int i;
@@ -98,7 +98,7 @@ VIDEO_START( harddriv )
void hdgsp_write_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* access to the 1bpp/2bpp area */
if (address >= 0x02000000 && address <= 0x020fffff)
@@ -126,7 +126,7 @@ void hdgsp_write_to_shiftreg(address_space *space, UINT32 address, UINT16 *shift
void hdgsp_read_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (!state->shiftreg_enable)
return;
@@ -162,10 +162,10 @@ void hdgsp_read_from_shiftreg(address_space *space, UINT32 address, UINT16 *shif
*
*************************************/
-static void update_palette_bank(running_machine *machine, int newbank)
+static void update_palette_bank(running_machine &machine, int newbank)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
state->gfx_palettebank = newbank;
}
@@ -179,14 +179,14 @@ static void update_palette_bank(running_machine *machine, int newbank)
READ16_HANDLER( hdgsp_control_lo_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->gsp_control_lo[offset];
}
WRITE16_HANDLER( hdgsp_control_lo_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int oldword = state->gsp_control_lo[offset];
int newword;
@@ -207,14 +207,14 @@ WRITE16_HANDLER( hdgsp_control_lo_w )
READ16_HANDLER( hdgsp_control_hi_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->gsp_control_hi[offset];
}
WRITE16_HANDLER( hdgsp_control_hi_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
int val = (offset >> 3) & 1;
int oldword = state->gsp_control_hi[offset];
@@ -231,21 +231,21 @@ WRITE16_HANDLER( hdgsp_control_hi_w )
case 0x01:
data = data & (15 >> state->gsp_multisync);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
state->gfx_finescroll = data;
break;
case 0x02:
- update_palette_bank(space->machine, (state->gfx_palettebank & ~1) | val);
+ update_palette_bank(space->machine(), (state->gfx_palettebank & ~1) | val);
break;
case 0x03:
- update_palette_bank(space->machine, (state->gfx_palettebank & ~2) | (val << 1));
+ update_palette_bank(space->machine(), (state->gfx_palettebank & ~2) | (val << 1));
break;
case 0x04:
- if (space->machine->total_colors() >= 256 * 8)
- update_palette_bank(space->machine, (state->gfx_palettebank & ~4) | (val << 2));
+ if (space->machine().total_colors() >= 256 * 8)
+ update_palette_bank(space->machine(), (state->gfx_palettebank & ~4) | (val << 2));
break;
case 0x07:
@@ -275,7 +275,7 @@ READ16_HANDLER( hdgsp_vram_2bpp_r )
WRITE16_HANDLER( hdgsp_vram_1bpp_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 *dest = (UINT32 *)&state->gsp_vram[offset * 16];
UINT32 *mask = &state->mask_table[data * 4];
UINT32 color = state->gsp_control_lo[0] & 0xff;
@@ -304,7 +304,7 @@ WRITE16_HANDLER( hdgsp_vram_1bpp_w )
WRITE16_HANDLER( hdgsp_vram_2bpp_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT32 *dest = (UINT32 *)&state->gsp_vram[offset * 8];
UINT32 *mask = &state->mask_table[data * 2];
UINT32 color = state->gsp_control_lo[0];
@@ -329,9 +329,9 @@ WRITE16_HANDLER( hdgsp_vram_2bpp_w )
*
*************************************/
-INLINE void gsp_palette_change(running_machine *machine, int offset)
+INLINE void gsp_palette_change(running_machine &machine, int offset)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
int red = (state->gsp_paletteram_lo[offset] >> 8) & 0xff;
int green = state->gsp_paletteram_lo[offset] & 0xff;
int blue = state->gsp_paletteram_hi[offset] & 0xff;
@@ -341,7 +341,7 @@ INLINE void gsp_palette_change(running_machine *machine, int offset)
READ16_HANDLER( hdgsp_paletteram_lo_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
@@ -353,14 +353,14 @@ READ16_HANDLER( hdgsp_paletteram_lo_r )
WRITE16_HANDLER( hdgsp_paletteram_lo_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
offset = state->gfx_palettebank * 0x100 + (offset & 0xff);
COMBINE_DATA(&state->gsp_paletteram_lo[offset]);
- gsp_palette_change(space->machine, offset);
+ gsp_palette_change(space->machine(), offset);
}
@@ -373,7 +373,7 @@ WRITE16_HANDLER( hdgsp_paletteram_lo_w )
READ16_HANDLER( hdgsp_paletteram_hi_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
@@ -385,14 +385,14 @@ READ16_HANDLER( hdgsp_paletteram_hi_r )
WRITE16_HANDLER( hdgsp_paletteram_hi_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* note that the palette is only accessed via the first 256 entries */
/* others are selected via the palette bank */
offset = state->gfx_palettebank * 0x100 + (offset & 0xff);
COMBINE_DATA(&state->gsp_paletteram_hi[offset]);
- gsp_palette_change(space->machine, offset);
+ gsp_palette_change(space->machine(), offset);
}
@@ -425,7 +425,7 @@ static void display_speedups(void)
void harddriv_scanline_driver(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- harddriv_state *state = screen.machine->driver_data<harddriv_state>();
+ harddriv_state *state = screen.machine().driver_data<harddriv_state>();
UINT8 *vram_base = &state->gsp_vram[(params->rowaddr << 12) & state->vram_mask];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 4) - 15 + (state->gfx_finescroll & 0x0f);
@@ -441,7 +441,7 @@ void harddriv_scanline_driver(screen_device &screen, bitmap_t *bitmap, int scanl
void harddriv_scanline_multisync(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- harddriv_state *state = screen.machine->driver_data<harddriv_state>();
+ harddriv_state *state = screen.machine().driver_data<harddriv_state>();
UINT8 *vram_base = &state->gsp_vram[(params->rowaddr << 11) & state->vram_mask];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
int coladdr = (params->yoffset << 9) + ((params->coladdr & 0xff) << 3) - 7 + (state->gfx_finescroll & 0x07);
diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c
index 3045e04d414..cfbc600726e 100644
--- a/src/mame/video/hcastle.c
+++ b/src/mame/video/hcastle.c
@@ -14,7 +14,7 @@ PALETTE_INIT( hcastle )
int chip;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x80);
+ machine.colortable = colortable_alloc(machine, 0x80);
for (chip = 0; chip < 2; chip++)
{
@@ -34,16 +34,16 @@ PALETTE_INIT( hcastle )
else
ctabentry = (pal << 4) | (color_prom[(clut << 8) | i] & 0x0f);
- colortable_entry_set_value(machine->colortable, (chip << 11) | (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (chip << 11) | (pal << 8) | i, ctabentry);
}
}
}
}
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
int i;
for (i = 0x00; i < 0x100; i += 2)
@@ -52,7 +52,7 @@ static void set_pens(running_machine *machine)
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -72,7 +72,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121_1, 5);
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_1, 6);
int bit0 = (ctrl_5 >> 0) & 0x03;
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121_2, 5);
UINT8 ctrl_6 = k007121_ctrlram_r(state->k007121_2, 6);
int bit0 = (ctrl_5 >> 0) & 0x03;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( hcastle )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan, 8, 8, 64, 32);
@@ -148,40 +148,40 @@ VIDEO_START( hcastle )
WRITE8_HANDLER( hcastle_pf1_video_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
state->pf1_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0xbff);
}
WRITE8_HANDLER( hcastle_pf2_video_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
state->pf2_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0xbff);
}
WRITE8_HANDLER( hcastle_gfxbank_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
state->gfx_bank = data;
}
READ8_HANDLER( hcastle_gfxbank_r )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
return state->gfx_bank;
}
WRITE8_HANDLER( hcastle_pf1_control_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
if (offset == 3)
{
if ((data & 0x8) == 0)
- buffer_spriteram(space->machine, space->machine->generic.spriteram.u8 + 0x800, 0x800);
+ buffer_spriteram(space->machine(), space->machine().generic.spriteram.u8 + 0x800, 0x800);
else
- buffer_spriteram(space->machine, space->machine->generic.spriteram.u8, 0x800);
+ buffer_spriteram(space->machine(), space->machine().generic.spriteram.u8, 0x800);
}
else if (offset == 7)
{
@@ -192,14 +192,14 @@ WRITE8_HANDLER( hcastle_pf1_control_w )
WRITE8_HANDLER( hcastle_pf2_control_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
if (offset == 3)
{
if ((data & 0x8) == 0)
- buffer_spriteram_2(space->machine, space->machine->generic.spriteram2.u8 + 0x800, 0x800);
+ buffer_spriteram_2(space->machine(), space->machine().generic.spriteram2.u8 + 0x800, 0x800);
else
- buffer_spriteram_2(space->machine, space->machine->generic.spriteram2.u8, 0x800);
+ buffer_spriteram_2(space->machine(), space->machine().generic.spriteram2.u8, 0x800);
}
else if (offset == 7)
{
@@ -210,21 +210,21 @@ WRITE8_HANDLER( hcastle_pf2_control_w )
/*****************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
device_t *k007121 = bank ? state->k007121_2 : state->k007121_1;
int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2;
int bank_base = (bank == 0) ? 0x4000 * (state->gfx_bank & 1) : 0;
- k007121_sprites_draw(k007121, bitmap, cliprect, machine->gfx[bank], machine->colortable, sbank, base_color, 0, bank_base, (UINT32)-1);
+ k007121_sprites_draw(k007121, bitmap, cliprect, machine.gfx[bank], machine.colortable, sbank, base_color, 0, bank_base, (UINT32)-1);
}
/*****************************************************************************/
SCREEN_UPDATE( hcastle )
{
- hcastle_state *state = screen->machine->driver_data<hcastle_state>();
+ hcastle_state *state = screen->machine().driver_data<hcastle_state>();
UINT8 ctrl_1_0 = k007121_ctrlram_r(state->k007121_1, 0);
UINT8 ctrl_1_1 = k007121_ctrlram_r(state->k007121_1, 1);
@@ -235,7 +235,7 @@ SCREEN_UPDATE( hcastle )
UINT8 ctrl_2_2 = k007121_ctrlram_r(state->k007121_2, 2);
UINT8 ctrl_2_3 = k007121_ctrlram_r(state->k007121_2, 3);
- set_pens(screen->machine);
+ set_pens(screen->machine());
state->pf1_bankbase = 0x0000;
state->pf2_bankbase = 0x4000 * ((state->gfx_bank & 2) >> 1);
@@ -264,16 +264,16 @@ SCREEN_UPDATE( hcastle )
if ((state->gfx_bank & 0x04) == 0)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u8, 0);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u8, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u8, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u8, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
else
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u8, 0);
- draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u8, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u8, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u8, 1);
}
return 0;
}
diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c
index f401e70834d..22fb71b1a09 100644
--- a/src/mame/video/hexion.c
+++ b/src/mame/video/hexion.c
@@ -10,7 +10,7 @@
***************************************************************************/
-INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT8 *ram)
+INLINE void get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,UINT8 *ram)
{
tile_index *= 4;
SET_TILE_INFO(
@@ -22,13 +22,13 @@ INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_
static TILE_GET_INFO( get_tile_info0 )
{
- hexion_state *state = machine->driver_data<hexion_state>();
+ hexion_state *state = machine.driver_data<hexion_state>();
get_tile_info(machine,tileinfo,tile_index,state->vram[0]);
}
static TILE_GET_INFO( get_tile_info1 )
{
- hexion_state *state = machine->driver_data<hexion_state>();
+ hexion_state *state = machine.driver_data<hexion_state>();
get_tile_info(machine,tileinfo,tile_index,state->vram[1]);
}
@@ -42,7 +42,7 @@ static TILE_GET_INFO( get_tile_info1 )
VIDEO_START( hexion )
{
- hexion_state *state = machine->driver_data<hexion_state>();
+ hexion_state *state = machine.driver_data<hexion_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1,tilemap_scan_rows, 8,8,64,32);
@@ -50,7 +50,7 @@ VIDEO_START( hexion )
tilemap_set_scrollx(state->bg_tilemap[1],0,-4);
tilemap_set_scrolly(state->bg_tilemap[1],0,4);
- state->vram[0] = machine->region("maincpu")->base() + 0x30000;
+ state->vram[0] = machine.region("maincpu")->base() + 0x30000;
state->vram[1] = state->vram[0] + 0x2000;
state->unkram = state->vram[1] + 0x2000;
}
@@ -65,11 +65,11 @@ VIDEO_START( hexion )
WRITE8_HANDLER( hexion_bankswitch_w )
{
- hexion_state *state = space->machine->driver_data<hexion_state>();
- UINT8 *rom = space->machine->region("maincpu")->base() + 0x10000;
+ hexion_state *state = space->machine().driver_data<hexion_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base() + 0x10000;
/* bits 0-3 select ROM bank */
- memory_set_bankptr(space->machine, "bank1",rom + 0x2000 * (data & 0x0f));
+ memory_set_bankptr(space->machine(), "bank1",rom + 0x2000 * (data & 0x0f));
/* does bit 6 trigger the 052591? */
if (data & 0x40)
@@ -90,10 +90,10 @@ if (data & 0x30)
READ8_HANDLER( hexion_bankedram_r )
{
- hexion_state *state = space->machine->driver_data<hexion_state>();
+ hexion_state *state = space->machine().driver_data<hexion_state>();
if (state->gfxrom_select && offset < 0x1000)
{
- return space->machine->region("gfx1")->base()[((state->gfxrom_select & 0x7f) << 12) + offset];
+ return space->machine().region("gfx1")->base()[((state->gfxrom_select & 0x7f) << 12) + offset];
}
else if (state->bankctrl == 0)
{
@@ -112,7 +112,7 @@ READ8_HANDLER( hexion_bankedram_r )
WRITE8_HANDLER( hexion_bankedram_w )
{
- hexion_state *state = space->machine->driver_data<hexion_state>();
+ hexion_state *state = space->machine().driver_data<hexion_state>();
if (state->bankctrl == 3 && offset == 0 && (data & 0xfe) == 0)
{
//logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_pc(space->cpu),offset,data,state->bankctrl);
@@ -145,14 +145,14 @@ logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_p
WRITE8_HANDLER( hexion_bankctrl_w )
{
- hexion_state *state = space->machine->driver_data<hexion_state>();
+ hexion_state *state = space->machine().driver_data<hexion_state>();
//logerror("%04x: bankctrl_w %02x\n",cpu_get_pc(space->cpu),data);
state->bankctrl = data;
}
WRITE8_HANDLER( hexion_gfxrom_select_w )
{
- hexion_state *state = space->machine->driver_data<hexion_state>();
+ hexion_state *state = space->machine().driver_data<hexion_state>();
//logerror("%04x: gfxrom_select_w %02x\n",cpu_get_pc(space->cpu),data);
state->gfxrom_select = data;
}
@@ -167,7 +167,7 @@ WRITE8_HANDLER( hexion_gfxrom_select_w )
SCREEN_UPDATE( hexion )
{
- hexion_state *state = screen->machine->driver_data<hexion_state>();
+ hexion_state *state = screen->machine().driver_data<hexion_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap[1],0,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap[0],0,0);
return 0;
diff --git a/src/mame/video/higemaru.c b/src/mame/video/higemaru.c
index b7b3568a48a..dae1c8003e1 100644
--- a/src/mame/video/higemaru.c
+++ b/src/mame/video/higemaru.c
@@ -3,14 +3,14 @@
WRITE8_HANDLER( higemaru_videoram_w )
{
- higemaru_state *state = space->machine->driver_data<higemaru_state>();
+ higemaru_state *state = space->machine().driver_data<higemaru_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( higemaru_colorram_w )
{
- higemaru_state *state = space->machine->driver_data<higemaru_state>();
+ higemaru_state *state = space->machine().driver_data<higemaru_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -26,7 +26,7 @@ PALETTE_INIT( higemaru )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -52,7 +52,7 @@ PALETTE_INIT( higemaru )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -62,38 +62,38 @@ PALETTE_INIT( higemaru )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 16-31 */
for (i = 0x80; i < 0x180; i++)
{
UINT8 ctabentry = (color_prom[i + 0x80] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( higemaru_c800_w )
{
- higemaru_state *state = space->machine->driver_data<higemaru_state>();
+ higemaru_state *state = space->machine().driver_data<higemaru_state>();
if (data & 0x7c)
logerror("c800 = %02x\n",data);
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0,data & 2);
- coin_counter_w(space->machine, 1,data & 1);
+ coin_counter_w(space->machine(), 0,data & 2);
+ coin_counter_w(space->machine(), 1,data & 1);
/* bit 7 flips screen */
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- higemaru_state *state = machine->driver_data<higemaru_state>();
+ higemaru_state *state = machine.driver_data<higemaru_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x80) << 1);
int color = state->colorram[tile_index] & 0x1f;
@@ -102,13 +102,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( higemaru )
{
- higemaru_state *state = machine->driver_data<higemaru_state>();
+ higemaru_state *state = machine.driver_data<higemaru_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- higemaru_state *state = machine->driver_data<higemaru_state>();
+ higemaru_state *state = machine.driver_data<higemaru_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -130,14 +130,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
col,
flipx,flipy,
sx,sy,15);
/* draw again with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
col,
flipx,flipy,
@@ -147,8 +147,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( higemaru )
{
- higemaru_state *state = screen->machine->driver_data<higemaru_state>();
+ higemaru_state *state = screen->machine().driver_data<higemaru_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/himesiki.c b/src/mame/video/himesiki.c
index 6c59951717f..9857374c359 100644
--- a/src/mame/video/himesiki.c
+++ b/src/mame/video/himesiki.c
@@ -12,7 +12,7 @@ Video hardware
static TILE_GET_INFO( get_bg_tile_info )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
int code = state->bg_ram[tile_index * 2] + state->bg_ram[tile_index * 2 + 1] * 0x100 ;
int col = code >> 12;
@@ -23,36 +23,36 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( himesiki )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
state->bg_tilemap = tilemap_create( machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
WRITE8_HANDLER( himesiki_bg_ram_w )
{
- himesiki_state *state = space->machine->driver_data<himesiki_state>();
+ himesiki_state *state = space->machine().driver_data<himesiki_state>();
state->bg_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( himesiki_scrollx_w )
{
- himesiki_state *state = space->machine->driver_data<himesiki_state>();
+ himesiki_state *state = space->machine().driver_data<himesiki_state>();
state->scrollx[offset] = data;
}
WRITE8_HANDLER( himesiki_flip_w )
{
- himesiki_state *state = space->machine->driver_data<himesiki_state>();
+ himesiki_state *state = space->machine().driver_data<himesiki_state>();
state->flipscreen = data & 0xc0;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
if (data & 0x3f)
logerror("p08_w %02x\n",data);
}
-static void himesiki_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -84,7 +84,7 @@ static void himesiki_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
y -= 0x100;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, col, fx, fy, x, y, 15);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, col, fx, fy, x, y, 15);
}
for (offs = 0; offs < 0x100; offs += 4)
@@ -113,18 +113,18 @@ static void himesiki_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
if (y > 0xf0)
y -= 0x100;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, col, f, f, x, y, 15);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2], code, col, f, f, x, y, 15);
}
}
SCREEN_UPDATE( himesiki )
{
- himesiki_state *state = screen->machine->driver_data<himesiki_state>();
+ himesiki_state *state = screen->machine().driver_data<himesiki_state>();
int x = -(state->scrollx[0] << 8 | state->scrollx[1]) & 0x1ff;
tilemap_set_scrolldx(state->bg_tilemap, x, x);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- himesiki_draw_sprites(screen->machine, bitmap, cliprect);
+ himesiki_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/hnayayoi.c b/src/mame/video/hnayayoi.c
index a9df21676a6..ea3a4089237 100644
--- a/src/mame/video/hnayayoi.c
+++ b/src/mame/video/hnayayoi.c
@@ -12,9 +12,9 @@ The blitter reads compressed data from ROM and copies it to the bitmap RAM.
#include "emu.h"
#include "includes/hnayayoi.h"
-static void common_vh_start( running_machine *machine, int num_pixmaps )
+static void common_vh_start( running_machine &machine, int num_pixmaps )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
int i;
state->total_pixmaps = num_pixmaps;
@@ -32,7 +32,7 @@ static void common_vh_start( running_machine *machine, int num_pixmaps )
VIDEO_START( hnayayoi )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
common_vh_start(machine, 4); /* 4 bitmaps -> 2 layers */
state->save_pointer(NAME(state->pixmap[0]), 256 * 256);
@@ -43,7 +43,7 @@ VIDEO_START( hnayayoi )
VIDEO_START( untoucha )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
common_vh_start(machine, 8); /* 8 bitmaps -> 4 layers */
state->save_pointer(NAME(state->pixmap[0]), 256 * 256);
@@ -102,7 +102,7 @@ up blit_src for the second call.
WRITE8_HANDLER( dynax_blitter_rev1_param_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
switch (offset)
{
case 0: state->blit_dest = (state->blit_dest & 0xff00) | (data << 0); break;
@@ -114,9 +114,9 @@ WRITE8_HANDLER( dynax_blitter_rev1_param_w )
}
}
-static void copy_pixel( running_machine *machine, int x, int y, int pen )
+static void copy_pixel( running_machine &machine, int x, int y, int pen )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
if (x >= 0 && x <= 255 && y >= 0 && y <= 255)
{
int i;
@@ -131,9 +131,9 @@ static void copy_pixel( running_machine *machine, int x, int y, int pen )
WRITE8_HANDLER( dynax_blitter_rev1_start_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
- UINT8 *rom = space->machine->region("gfx1")->base();
- int romlen = space->machine->region("gfx1")->bytes();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
+ UINT8 *rom = space->machine().region("gfx1")->base();
+ int romlen = space->machine().region("gfx1")->bytes();
int sx = state->blit_dest & 0xff;
int sy = state->blit_dest >> 8;
int x, y;
@@ -194,7 +194,7 @@ WRITE8_HANDLER( dynax_blitter_rev1_start_w )
case 0x2:
case 0x1:
while (cmd--)
- copy_pixel(space->machine, x++, y, pen);
+ copy_pixel(space->machine(), x++, y, pen);
break;
case 0x0:
@@ -207,7 +207,7 @@ WRITE8_HANDLER( dynax_blitter_rev1_start_w )
WRITE8_HANDLER( dynax_blitter_rev1_clear_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
int pen = data >> 4;
int i;
@@ -221,15 +221,15 @@ WRITE8_HANDLER( dynax_blitter_rev1_clear_w )
WRITE8_HANDLER( hnayayoi_palbank_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
offset *= 8;
state->palbank = (state->palbank & (0xff00 >> offset)) | (data << offset);
}
-static void draw_layer_interleaved( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int left_pixmap, int right_pixmap, int palbase, int transp )
+static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int left_pixmap, int right_pixmap, int palbase, int transp )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
int county, countx, pen;
UINT8 *src1 = state->pixmap[left_pixmap];
UINT8 *src2 = state->pixmap[right_pixmap];
@@ -265,7 +265,7 @@ static void draw_layer_interleaved( running_machine *machine, bitmap_t *bitmap,
SCREEN_UPDATE( hnayayoi )
{
- hnayayoi_state *state = screen->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = screen->machine().driver_data<hnayayoi_state>();
int col0 = (state->palbank >> 0) & 0x0f;
int col1 = (state->palbank >> 4) & 0x0f;
int col2 = (state->palbank >> 8) & 0x0f;
@@ -273,15 +273,15 @@ SCREEN_UPDATE( hnayayoi )
if (state->total_pixmaps == 4)
{
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 3, 2, col1, 0);
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 1, 0, col0, 1);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 3, 2, col1, 0);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 1, 0, col0, 1);
}
else /* total_pixmaps == 8 */
{
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 7, 6, col3, 0);
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 5, 4, col2, 1);
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 3, 2, col1, 1);
- draw_layer_interleaved(screen->machine, bitmap, cliprect, 1, 0, col0, 1);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 7, 6, col3, 0);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 5, 4, col2, 1);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 3, 2, col1, 1);
+ draw_layer_interleaved(screen->machine(), bitmap, cliprect, 1, 0, col0, 1);
}
return 0;
}
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index 9e432f241e1..955a318b880 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -5,7 +5,7 @@
#define MAKE_MAME_REEEEAAALLLL_SLOW 0
-static void clear3d(running_machine *machine); // TODO: Inline
+static void clear3d(running_machine &machine); // TODO: Inline
static void hng64_mark_all_tiles_dirty( hng64_state *state, int tilemap )
@@ -105,7 +105,7 @@ static void pdrawgfx_transpen_additive(bitmap_t *dest, const rectangle *cliprect
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -147,7 +147,7 @@ static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle *clip
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -207,9 +207,9 @@ static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle *clip
* 0x0e0 in Samurai Shodown/Xrally games, 0x1c0 in all the others, zooming factor?
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
const gfx_element *gfx;
UINT32 *source = state->spriteram;
UINT32 *finish = state->spriteram + 0xc000/4;
@@ -301,11 +301,11 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (state->spriteregs[0] & 0x00800000) //bpp switch
{
- gfx= machine->gfx[4];
+ gfx= machine.gfx[4];
}
else
{
- gfx= machine->gfx[5];
+ gfx= machine.gfx[5];
tileno>>=1;
pal&=0xf;
}
@@ -355,8 +355,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (!chaini)
{
- if (!blend) pdrawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine->priority_bitmap, 0,0);
- else pdrawgfxzoom_transpen_additive(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine->priority_bitmap, 0,0);
+ if (!blend) pdrawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine.priority_bitmap, 0,0);
+ else pdrawgfxzoom_transpen_additive(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine.priority_bitmap, 0,0);
tileno++;
}
else // inline chain mode, used by ss64
@@ -367,17 +367,17 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (state->spriteregs[0] & 0x00800000) //bpp switch
{
- gfx= machine->gfx[4];
+ gfx= machine.gfx[4];
}
else
{
- gfx= machine->gfx[5];
+ gfx= machine.gfx[5];
tileno>>=1;
pal&=0xf;
}
- if (!blend) pdrawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine->priority_bitmap, 0,0);
- else pdrawgfxzoom_transpen_additive(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine->priority_bitmap, 0,0);
+ if (!blend) pdrawgfxzoom_transpen(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine.priority_bitmap, 0,0);
+ else pdrawgfxzoom_transpen_additive(bitmap,cliprect,gfx,tileno,pal,xflip,yflip,drawx,drawy,zoomx,zoomy/*0x10000*/,machine.priority_bitmap, 0,0);
source +=8;
}
@@ -431,9 +431,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
*/
/* this is broken for the 'How to Play' screen in Buriki after attract, disabled for now */
-static void transition_control(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void transition_control(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
UINT32 *hng64_tcram = state->tcram;
int i, j;
@@ -529,7 +529,7 @@ static void transition_control(running_machine *machine, bitmap_t *bitmap, const
// pppppppp ff--atttt tttttttt tttttttt
#define HNG64_GET_TILE_INFO \
{ \
- hng64_state *state = machine->driver_data<hng64_state>(); \
+ hng64_state *state = machine.driver_data<hng64_state>(); \
UINT16 tilemapinfo = (state->videoregs[reg]>>shift)&0xffff; \
int tileno,pal, flip; \
\
@@ -653,7 +653,7 @@ static TILE_GET_INFO( get_hng64_tile3_16x16_info )
WRITE32_HANDLER( hng64_videoram_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
int realoff;
COMBINE_DATA(&state->videoram[offset]);
@@ -790,11 +790,11 @@ do { \
*(UINT32 *)dest = alpha_blend_r32(*(UINT32 *)dest, clut[INPUT_VAL], alpha); \
} while (0)
-static void hng64_tilemap_draw_roz_core(running_machine* machine, tilemap_t *tmap, const blit_parameters *blit,
+static void hng64_tilemap_draw_roz_core(running_machine& machine, tilemap_t *tmap, const blit_parameters *blit,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound)
{
- const pen_t *clut = &machine->pens[blit->tilemap_priority_code >> 16];
- bitmap_t *priority_bitmap = machine->priority_bitmap;
+ const pen_t *clut = &machine.pens[blit->tilemap_priority_code >> 16];
+ bitmap_t *priority_bitmap = machine.priority_bitmap;
bitmap_t *destbitmap = blit->bitmap;
bitmap_t *srcbitmap = tilemap_get_pixmap(tmap);
bitmap_t *flagsmap = tilemap_get_flagsmap(tmap);
@@ -968,7 +968,7 @@ static void hng64_tilemap_draw_roz_core(running_machine* machine, tilemap_t *tma
-static void hng64_tilemap_draw_roz_primask(running_machine* machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
+static void hng64_tilemap_draw_roz_primask(running_machine& machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat)
{
@@ -996,7 +996,7 @@ g_profiler.stop();
}
-INLINE void hng64_tilemap_draw_roz(running_machine* machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
+INLINE void hng64_tilemap_draw_roz(running_machine& machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
int wraparound, UINT32 flags, UINT8 priority, hng64trans_t drawformat)
{
@@ -1005,9 +1005,9 @@ INLINE void hng64_tilemap_draw_roz(running_machine* machine, bitmap_t *dest, con
-static void hng64_drawtilemap(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect, int tm )
+static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int tm )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
UINT32 *hng64_videoregs = state->videoregs;
UINT32 *hng64_videoram = state->videoram;
tilemap_t* tilemap = 0;
@@ -1119,7 +1119,7 @@ static void hng64_drawtilemap(running_machine* machine, bitmap_t *bitmap, const
INT32 ytopleft,ymiddle;
int xinc,yinc;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
clip.min_x = visarea.min_x;
clip.max_x = visarea.max_x;
clip.min_y = visarea.min_y;
@@ -1243,7 +1243,7 @@ static void hng64_drawtilemap(running_machine* machine, bitmap_t *bitmap, const
bitmap_t *bm = tilemap_get_pixmap(tilemap);
int bmheight = bm->height;
int bmwidth = bm->width;
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
UINT32* dstptr;
UINT16* srcptr;
int xx,yy;
@@ -1341,7 +1341,7 @@ static void hng64_drawtilemap(running_machine* machine, bitmap_t *bitmap, const
bitmap_t *bm = tilemap_get_pixmap(tilemap);
int bmheight = bm->height;
int bmwidth = bm->width;
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
UINT32* dstptr;
UINT16* srcptr;
int xx,yy;
@@ -1448,7 +1448,7 @@ static void hng64_drawtilemap(running_machine* machine, bitmap_t *bitmap, const
SCREEN_UPDATE( hng64 )
{
- hng64_state *state = screen->machine->driver_data<hng64_state>();
+ hng64_state *state = screen->machine().driver_data<hng64_state>();
UINT32 *hng64_videoregs = state->videoregs;
UINT32 *hng64_videoram = state->videoram;
UINT32 *hng64_tcram = state->tcram;
@@ -1461,15 +1461,15 @@ SCREEN_UPDATE( hng64 )
// press in sams64_2 attract mode for a nice debug screen from the game
// not sure how functional it is, and it doesn't appear to test everything (rowscroll modes etc.)
// but it could be useful
- if ( input_code_pressed_once(screen->machine, KEYCODE_L) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_L) )
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
space->write_byte(0x2f27c8, 0x2);
}
#endif
- bitmap_fill(bitmap, 0, hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen->machine) : screen->machine->pens[0]); //FIXME: Is the register correct? check with HW tests
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0x00);
+ bitmap_fill(bitmap, 0, hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen->machine()) : screen->machine().pens[0]); //FIXME: Is the register correct? check with HW tests
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0x00);
if (state->screen_dis)
return 0;
@@ -1539,12 +1539,12 @@ SCREEN_UPDATE( hng64 )
//hng64_mark_all_tiles_dirty(state, 2);
//hng64_mark_all_tiles_dirty(state, 3);
- hng64_drawtilemap(screen->machine,bitmap,cliprect, 3);
- hng64_drawtilemap(screen->machine,bitmap,cliprect, 2);
- hng64_drawtilemap(screen->machine,bitmap,cliprect, 1);
- hng64_drawtilemap(screen->machine,bitmap,cliprect, 0);
+ hng64_drawtilemap(screen->machine(),bitmap,cliprect, 3);
+ hng64_drawtilemap(screen->machine(),bitmap,cliprect, 2);
+ hng64_drawtilemap(screen->machine(),bitmap,cliprect, 1);
+ hng64_drawtilemap(screen->machine(),bitmap,cliprect, 0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
// 3d really shouldn't be last, but you don't see some cool stuff right now if it's put before sprites.
{
@@ -1566,11 +1566,11 @@ SCREEN_UPDATE( hng64 )
}
}
//printf("NEW FRAME!\n"); /* Debug - ajg */
- clear3d(screen->machine);
+ clear3d(screen->machine());
}
if(0)
- transition_control(screen->machine, bitmap, cliprect);
+ transition_control(screen->machine(), bitmap, cliprect);
if (0)
popmessage("%08x %08x %08x %08x %08x", state->spriteregs[0], state->spriteregs[1], state->spriteregs[2], state->spriteregs[3], state->spriteregs[4]);
@@ -1630,22 +1630,22 @@ SCREEN_UPDATE( hng64 )
hng64_tcram[0x58/4],
hng64_tcram[0x5c/4]);
- if ( input_code_pressed_once(screen->machine, KEYCODE_T) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_T) )
{
state->additive_tilemap_debug ^= 1;
popmessage("blend changed %02x", state->additive_tilemap_debug);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_Y) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_Y) )
{
state->additive_tilemap_debug ^= 2;
popmessage("blend changed %02x", state->additive_tilemap_debug);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_U) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_U) )
{
state->additive_tilemap_debug ^= 4;
popmessage("blend changed %02x", state->additive_tilemap_debug);
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_I) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_I) )
{
state->additive_tilemap_debug ^= 8;
popmessage("blend changed %02x", state->additive_tilemap_debug);
@@ -1656,8 +1656,8 @@ SCREEN_UPDATE( hng64 )
VIDEO_START( hng64 )
{
- hng64_state *state = machine->driver_data<hng64_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ hng64_state *state = machine.driver_data<hng64_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
state->old_animmask = -1;
state->old_animbits = -1;
@@ -1750,10 +1750,10 @@ static float vecDotProduct(const float *a, const float *b);
static void normalize(float* x);
static void performFrustumClip(struct polygon *p);
-static void drawShaded(running_machine *machine, struct polygon *p);
-//static void plot(running_machine *machine, INT32 x, INT32 y, UINT32 color);
-//static void drawline2d(running_machine *machine, INT32 x0, INT32 y0, INT32 x1, INT32 y1, UINT32 color);
-//static void DrawWireframe(running_machine *machine, struct polygon *p);
+static void drawShaded(running_machine &machine, struct polygon *p);
+//static void plot(running_machine &machine, INT32 x, INT32 y, UINT32 color);
+//static void drawline2d(running_machine &machine, INT32 x0, INT32 y0, INT32 x1, INT32 y1, UINT32 color);
+//static void DrawWireframe(running_machine &machine, struct polygon *p);
static float uToF(UINT16 input);
@@ -1957,7 +1957,7 @@ static void setCameraProjectionMatrix(hng64_state *state, const UINT16* packet)
// Operation 0100
// Polygon rasterization.
-static void recoverPolygonBlock(running_machine* machine, const UINT16* packet, struct polygon* polys, int* numPolys)
+static void recoverPolygonBlock(running_machine& machine, const UINT16* packet, struct polygon* polys, int* numPolys)
{
/*//////////////
// PACKET FORMAT
@@ -1994,7 +1994,7 @@ static void recoverPolygonBlock(running_machine* machine, const UINT16* packet,
// [15] - xxxx ... Transformation matrix
////////////*/
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
UINT32 size[4];
UINT32 address[4];
UINT32 megaOffset;
@@ -2008,7 +2008,7 @@ static void recoverPolygonBlock(running_machine* machine, const UINT16* packet,
setIdentity(objectMatrix);
struct polygon lastPoly = { 0 };
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/////////////////
// HEADER INFO //
@@ -2064,11 +2064,11 @@ static void recoverPolygonBlock(running_machine* machine, const UINT16* packet,
//////////////////////////////////////////////*/
// 3d ROM Offset
- UINT16* threeDRoms = (UINT16*)(machine->region("verts")->base());
+ UINT16* threeDRoms = (UINT16*)(machine.region("verts")->base());
UINT32 threeDOffset = (((UINT32)packet[2]) << 16) | ((UINT32)packet[3]);
UINT16* threeDPointer = &threeDRoms[threeDOffset * 3];
- if (threeDOffset >= machine->region("verts")->bytes())
+ if (threeDOffset >= machine.region("verts")->bytes())
{
printf("Strange geometry packet: (ignoring)\n");
printPacket(packet, 1);
@@ -2195,7 +2195,7 @@ static void recoverPolygonBlock(running_machine* machine, const UINT16* packet,
So instead we're looking for a bit that is on for XRally & Buriki, but noone else. */
if (state->_3dregs[0x00/4] & 0x2000)
{
- if (strcmp(machine->basename(), "roadedge"))
+ if (strcmp(machine.basename(), "roadedge"))
polys[*numPolys].palOffset += 0x800;
}
@@ -2524,9 +2524,9 @@ static void recoverPolygonBlock(running_machine* machine, const UINT16* packet,
}
}
-void hng64_command3d(running_machine* machine, const UINT16* packet)
+void hng64_command3d(running_machine& machine, const UINT16* packet)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
/* A temporary place to put some polygons. This will optimize away if the compiler's any good. */
int numPolys = 0;
@@ -2619,12 +2619,12 @@ void hng64_command3d(running_machine* machine, const UINT16* packet)
auto_free(machine, polys);
}
-static void clear3d(running_machine *machine)
+static void clear3d(running_machine &machine)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
int i;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
// Clear each of the display list buffers after drawing - todo: kill!
for (i = 0; i < 0x81; i++)
@@ -2899,14 +2899,14 @@ static void performFrustumClip(struct polygon *p)
// wireframe rendering //
/////////////////////////
#ifdef UNUSED_FUNCTION
-static void plot(running_machine *machine, INT32 x, INT32 y, UINT32 color)
+static void plot(running_machine &machine, INT32 x, INT32 y, UINT32 color)
{
- UINT32* cb = &(colorBuffer3d[(y * machine->primary_screen->visible_area().max_x) + x]);
+ UINT32* cb = &(colorBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x]);
*cb = color;
}
// Stolen from http://en.wikipedia.org/wiki/Bresenham's_line_algorithm (no copyright denoted) - the non-optimized version
-static void drawline2d(running_machine *machine, INT32 x0, INT32 y0, INT32 x1, INT32 y1, UINT32 color)
+static void drawline2d(running_machine &machine, INT32 x0, INT32 y0, INT32 x1, INT32 y1, UINT32 color)
{
#define SWAP(a,b) tmpswap = a; a = b; b = tmpswap;
@@ -2962,7 +2962,7 @@ static void drawline2d(running_machine *machine, INT32 x0, INT32 y0, INT32 x1, I
#undef SWAP
}
-static void DrawWireframe(running_machine *machine, struct polygon *p)
+static void DrawWireframe(running_machine &machine, struct polygon *p)
{
int j;
for (j = 0; j < p->n; j++)
@@ -3010,20 +3010,20 @@ struct polygonRasterOptions
/** **/
/** Output: none **/
/*********************************************************************/
-INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine,
+INLINE void FillSmoothTexPCHorizontalLine(running_machine &machine,
const polygonRasterOptions& prOptions,
int x_start, int x_end, int y, float z_start, float z_delta,
float w_start, float w_delta, float r_start, float r_delta,
float g_start, float g_delta, float b_start, float b_delta,
float s_start, float s_delta, float t_start, float t_delta)
{
- hng64_state *state = machine->driver_data<hng64_state>();
- float* db = &(state->depthBuffer3d[(y * machine->primary_screen->visible_area().max_x) + x_start]);
- UINT32* cb = &(state->colorBuffer3d[(y * machine->primary_screen->visible_area().max_x) + x_start]);
+ hng64_state *state = machine.driver_data<hng64_state>();
+ float* db = &(state->depthBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x_start]);
+ UINT32* cb = &(state->colorBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x_start]);
UINT8 paletteEntry = 0;
float t_coord, s_coord;
- const UINT8 *gfx = machine->region("textures")->base();
+ const UINT8 *gfx = machine.region("textures")->base();
const UINT8 *textureOffset = &gfx[prOptions.texIndex * 1024 * 1024];
for (; x_start <= x_end; x_start++)
@@ -3085,7 +3085,7 @@ INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine,
{
// The color out of the texture
paletteEntry %= prOptions.palPageSize;
- UINT32 color = machine->pens[prOptions.palOffset + paletteEntry];
+ UINT32 color = machine.pens[prOptions.palOffset + paletteEntry];
// Apply the lighting
float rIntensity = (r_start/w_start) / 255.0f;
@@ -3153,7 +3153,7 @@ INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine,
// nearest and bilinear filtering: Filtering={0,1}
// replace and modulate application modes: Function={0,1}
//---------------------------------------------------------------------------
-static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine,
+static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine &machine,
float A[4], float B[4], float C[4],
float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS
float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS
@@ -3443,7 +3443,7 @@ static void RasterizeTriangle_SMOOTH_TEX_PC(running_machine *machine,
}
}
-static void drawShaded(running_machine *machine, struct polygon *p)
+static void drawShaded(running_machine &machine, struct polygon *p)
{
// The perspective-correct texture divide...
// !!! There is a very good chance the HNG64 hardware does not do perspective-correct texture-mapping !!!
diff --git a/src/mame/video/holeland.c b/src/mame/video/holeland.c
index 086a4369eec..bfebecf2fde 100644
--- a/src/mame/video/holeland.c
+++ b/src/mame/video/holeland.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( holeland_get_tile_info )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
int attr = state->colorram[tile_index];
int tile_number = state->videoram[tile_index] | ((attr & 0x03) << 8);
@@ -36,7 +36,7 @@ static TILE_GET_INFO( holeland_get_tile_info )
static TILE_GET_INFO( crzrally_get_tile_info )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
int attr = state->colorram[tile_index];
int tile_number = state->videoram[tile_index] | ((attr & 0x03) << 8);
@@ -56,7 +56,7 @@ static TILE_GET_INFO( crzrally_get_tile_info )
VIDEO_START( holeland )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
state->bg_tilemap = tilemap_create(machine, holeland_get_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xff, 0x00); /* split type 0 is totally transparent in front half */
@@ -65,53 +65,53 @@ VIDEO_START( holeland )
VIDEO_START( crzrally )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
state->bg_tilemap = tilemap_create(machine, crzrally_get_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
}
WRITE8_HANDLER( holeland_videoram_w )
{
- holeland_state *state = space->machine->driver_data<holeland_state>();
+ holeland_state *state = space->machine().driver_data<holeland_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( holeland_colorram_w )
{
- holeland_state *state = space->machine->driver_data<holeland_state>();
+ holeland_state *state = space->machine().driver_data<holeland_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( holeland_pal_offs_w )
{
- holeland_state *state = space->machine->driver_data<holeland_state>();
+ holeland_state *state = space->machine().driver_data<holeland_state>();
if ((data & 1) != state->po[offset])
{
state->po[offset] = data & 1;
state->palette_offset = (state->po[0] + (state->po[1] << 1)) << 4;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( holeland_scroll_w )
{
- holeland_state *state = space->machine->driver_data<holeland_state>();
+ holeland_state *state = space->machine().driver_data<holeland_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( holeland_flipscreen_w )
{
if (offset)
- flip_screen_y_set(space->machine, data);
+ flip_screen_y_set(space->machine(), data);
else
- flip_screen_x_set(space->machine, data);
+ flip_screen_x_set(space->machine(), data);
}
-static void holeland_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void holeland_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
UINT8 *spriteram = state->spriteram;
int offs, code, sx, sy, color, flipx, flipy;
@@ -141,7 +141,7 @@ static void holeland_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -149,9 +149,9 @@ static void holeland_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void crzrally_draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- holeland_state *state = machine->driver_data<holeland_state>();
+ holeland_state *state = machine.driver_data<holeland_state>();
UINT8 *spriteram = state->spriteram;
int offs, code, sx, sy, color, flipx, flipy;
@@ -180,7 +180,7 @@ static void crzrally_draw_sprites( running_machine *machine, bitmap_t *bitmap,co
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -190,18 +190,18 @@ static void crzrally_draw_sprites( running_machine *machine, bitmap_t *bitmap,co
SCREEN_UPDATE( holeland )
{
- holeland_state *state = screen->machine->driver_data<holeland_state>();
+ holeland_state *state = screen->machine().driver_data<holeland_state>();
/*tilemap_mark_all_tiles_dirty(state->bg_tilemap); */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- holeland_draw_sprites(screen->machine, bitmap, cliprect);
+ holeland_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
SCREEN_UPDATE( crzrally )
{
- holeland_state *state = screen->machine->driver_data<holeland_state>();
+ holeland_state *state = screen->machine().driver_data<holeland_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- crzrally_draw_sprites(screen->machine, bitmap, cliprect);
+ crzrally_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c
index 67372799a35..be582359a00 100644
--- a/src/mame/video/homedata.c
+++ b/src/mame/video/homedata.c
@@ -34,14 +34,14 @@
static void mrokumei_handleblit( address_space *space, int rom_base )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
int i;
int dest_param;
int source_addr;
int dest_addr;
int base_addr;
int opcode, data, num_tiles;
- UINT8 *pBlitData = space->machine->region("user1")->base() + rom_base;
+ UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
dest_param = state->blitter_param[(state->blitter_param_count - 4) & 3] * 256 +
state->blitter_param[(state->blitter_param_count - 3) & 3];
@@ -121,13 +121,13 @@ finish:
static void reikaids_handleblit( address_space *space, int rom_base )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
int i;
UINT16 dest_param;
int flipx;
int source_addr, base_addr;
int dest_addr;
- UINT8 *pBlitData = space->machine->region("user1")->base() + rom_base;
+ UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
int opcode, data, num_tiles;
@@ -219,13 +219,13 @@ finish:
static void pteacher_handleblit( address_space *space, int rom_base )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
int i;
int dest_param;
int source_addr;
int dest_addr, base_addr;
int opcode, data, num_tiles;
- UINT8 *pBlitData = space->machine->region("user1")->base() + rom_base;
+ UINT8 *pBlitData = space->machine().region("user1")->base() + rom_base;
dest_param = state->blitter_param[(state->blitter_param_count - 4) & 3] * 256 +
state->blitter_param[(state->blitter_param_count - 3) & 3];
@@ -400,9 +400,9 @@ PALETTE_INIT( mirderby )
***************************************************************************/
-INLINE void mrokumei_info0( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
+INLINE void mrokumei_info0( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x03) << 8) + (gfxbank << 10);
@@ -410,9 +410,9 @@ INLINE void mrokumei_info0( running_machine *machine, tile_data *tileinfo, int t
SET_TILE_INFO( 0, code, color, state->flipscreen );
}
-INLINE void mrokumei_info1( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
+INLINE void mrokumei_info1( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x1000 + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x07) << 8) + (gfxbank << 11);
@@ -423,32 +423,32 @@ INLINE void mrokumei_info1( running_machine *machine, tile_data *tileinfo, int t
static TILE_GET_INFO( mrokumei_get_info0_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
mrokumei_info0( machine, tileinfo, tile_index, 0, state->blitter_bank & 0x03 );
}
static TILE_GET_INFO( mrokumei_get_info1_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
mrokumei_info0( machine, tileinfo, tile_index, 1, state->blitter_bank & 0x03 );
}
static TILE_GET_INFO( mrokumei_get_info0_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
mrokumei_info1( machine, tileinfo, tile_index, 0, (state->blitter_bank & 0x38) >> 3 );
}
static TILE_GET_INFO( mrokumei_get_info1_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
mrokumei_info1( machine, tileinfo, tile_index, 1, (state->blitter_bank & 0x38) >> 3 );
}
-INLINE void reikaids_info( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxbank )
+INLINE void reikaids_info( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 4 + layer + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 0x1000] + ((attr & 0x03) << 8) + (gfxbank << 10);
@@ -470,56 +470,56 @@ INLINE void reikaids_info( running_machine *machine, tile_data *tileinfo, int ti
*/
static TILE_GET_INFO( reikaids_get_info0_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 0, 0, (state->gfx_bank[1] >> 3));
}
static TILE_GET_INFO( reikaids_get_info1_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 1, 0, (state->gfx_bank[1] >> 3));
}
static TILE_GET_INFO( reikaids_get_info0_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 0, 1, ((state->gfx_bank[0] & 0x78) >> 3));
}
static TILE_GET_INFO( reikaids_get_info1_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 1, 1, ((state->gfx_bank[0] & 0x78) >> 3));
}
static TILE_GET_INFO( reikaids_get_info0_2 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 0, 2, (state->gfx_bank[1] & 0x7));
}
static TILE_GET_INFO( reikaids_get_info1_2 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 1, 2, (state->gfx_bank[1] & 0x7));
}
static TILE_GET_INFO( reikaids_get_info0_3 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 0, 3, (state->gfx_bank[0] & 0x7));
}
static TILE_GET_INFO( reikaids_get_info1_3 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
reikaids_info(machine, tileinfo, tile_index, 1, 3, (state->gfx_bank[0] & 0x7));
}
-INLINE void pteacher_info( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxbank )
+INLINE void pteacher_info( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x1000 * layer + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x07) << 8) + (gfxbank << 11);
@@ -530,32 +530,32 @@ INLINE void pteacher_info( running_machine *machine, tile_data *tileinfo, int ti
static TILE_GET_INFO( pteacher_get_info0_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
pteacher_info(machine, tileinfo, tile_index, 0, 0, state->gfx_bank[0] & 0x0f);
}
static TILE_GET_INFO( pteacher_get_info1_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
pteacher_info(machine, tileinfo, tile_index, 1, 0, state->gfx_bank[0] & 0x0f);
}
static TILE_GET_INFO( pteacher_get_info0_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
pteacher_info(machine, tileinfo, tile_index, 0, 1, state->gfx_bank[0] >> 4);
}
static TILE_GET_INFO( pteacher_get_info1_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
pteacher_info(machine, tileinfo, tile_index, 1, 1, state->gfx_bank[0] >> 4);
}
-INLINE void lemnangl_info( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxset, int gfxbank )
+INLINE void lemnangl_info( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int layer, int gfxset, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x1000 * layer + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x07) << 8) + (gfxbank << 11);
@@ -566,33 +566,33 @@ INLINE void lemnangl_info( running_machine *machine, tile_data *tileinfo, int ti
static TILE_GET_INFO( lemnangl_get_info0_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
lemnangl_info( machine, tileinfo, tile_index, 0, 0, state->blitter_bank & 1, state->gfx_bank[0] & 0x0f );
}
static TILE_GET_INFO( lemnangl_get_info1_0 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
lemnangl_info( machine, tileinfo, tile_index, 1, 0, state->blitter_bank & 1, state->gfx_bank[0] & 0x0f );
}
static TILE_GET_INFO( lemnangl_get_info0_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
lemnangl_info( machine, tileinfo, tile_index, 0, 1, (state->blitter_bank & 2) >> 1, state->gfx_bank[0] >> 4 );
}
static TILE_GET_INFO( lemnangl_get_info1_1 )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
lemnangl_info( machine, tileinfo, tile_index, 1, 1, (state->blitter_bank & 2) >> 1, state->gfx_bank[0] >> 4 );
}
-INLINE void mirderby_info0( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
+INLINE void mirderby_info0( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x03) << 8) + 0x400;// + (gfxbank << 10);
@@ -600,9 +600,9 @@ INLINE void mirderby_info0( running_machine *machine, tile_data *tileinfo, int t
SET_TILE_INFO( 0, code, color, state->flipscreen );
}
-INLINE void mirderby_info1( running_machine *machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
+INLINE void mirderby_info1( running_machine &machine, tile_data *tileinfo, int tile_index, int page, int gfxbank )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
int addr = tile_index * 2 + 0x1000 + 0x2000 * page;
int attr = state->videoram[addr];
int code = state->videoram[addr + 1] + ((attr & 0x07) << 8) + 0x400;//(gfxbank << 11);
@@ -613,25 +613,25 @@ INLINE void mirderby_info1( running_machine *machine, tile_data *tileinfo, int t
static TILE_GET_INFO( mirderby_get_info0_0 )
{
-// homedata_state *state = machine->driver_data<homedata_state>();
+// homedata_state *state = machine.driver_data<homedata_state>();
mirderby_info0( machine, tileinfo, tile_index, 0, 0);// state->blitter_bank & 0x03 );
}
static TILE_GET_INFO( mirderby_get_info1_0 )
{
-// homedata_state *state = machine->driver_data<homedata_state>();
+// homedata_state *state = machine.driver_data<homedata_state>();
mirderby_info0( machine, tileinfo, tile_index, 1, 0);// state->blitter_bank & 0x03 );
}
static TILE_GET_INFO( mirderby_get_info0_1 )
{
-// homedata_state *state = machine->driver_data<homedata_state>();
+// homedata_state *state = machine.driver_data<homedata_state>();
mirderby_info1( machine, tileinfo, tile_index, 0, 0);//(state->blitter_bank & 0x38) >> 3 );
}
static TILE_GET_INFO( mirderby_get_info1_1 )
{
-// homedata_state *state = machine->driver_data<homedata_state>();
+// homedata_state *state = machine.driver_data<homedata_state>();
mirderby_info1( machine, tileinfo, tile_index, 1, 0);//(state->blitter_bank & 0x38) >> 3 );
}
@@ -645,7 +645,7 @@ static TILE_GET_INFO( mirderby_get_info1_1 )
VIDEO_START( mrokumei )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->bg_tilemap[0][0] = tilemap_create( machine, mrokumei_get_info0_0, tilemap_scan_rows, 8, 8, 64, 32 );
state->bg_tilemap[0][1] = tilemap_create( machine, mrokumei_get_info0_1, tilemap_scan_rows, 8, 8, 64, 32 );
state->bg_tilemap[1][0] = tilemap_create( machine, mrokumei_get_info1_0, tilemap_scan_rows, 8, 8, 64, 32 );
@@ -657,7 +657,7 @@ VIDEO_START( mrokumei )
VIDEO_START( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->bg_tilemap[0][0] = tilemap_create(machine, reikaids_get_info0_0, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap[0][1] = tilemap_create(machine, reikaids_get_info0_1, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap[0][2] = tilemap_create(machine, reikaids_get_info0_2, tilemap_scan_rows, 8, 8, 32, 32);
@@ -679,7 +679,7 @@ VIDEO_START( reikaids )
VIDEO_START( pteacher )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->bg_tilemap[0][0] = tilemap_create(machine, pteacher_get_info0_0, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap[0][1] = tilemap_create(machine, pteacher_get_info0_1, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap[1][0] = tilemap_create(machine, pteacher_get_info1_0, tilemap_scan_rows, 8, 8, 64, 32);
@@ -691,7 +691,7 @@ VIDEO_START( pteacher )
VIDEO_START( lemnangl )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->bg_tilemap[0][0] = tilemap_create(machine, lemnangl_get_info0_0, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap[0][1] = tilemap_create(machine, lemnangl_get_info0_1, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap[1][0] = tilemap_create(machine, lemnangl_get_info1_0, tilemap_scan_rows, 8, 8, 64, 32);
@@ -703,7 +703,7 @@ VIDEO_START( lemnangl )
VIDEO_START( mirderby )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->bg_tilemap[0][0] = tilemap_create( machine, mirderby_get_info0_0, tilemap_scan_rows, 8, 8, 64, 32 );
state->bg_tilemap[0][1] = tilemap_create( machine, mirderby_get_info0_1, tilemap_scan_rows, 8, 8, 64, 32 );
state->bg_tilemap[1][0] = tilemap_create( machine, mirderby_get_info1_0, tilemap_scan_rows, 8, 8, 64, 32 );
@@ -721,14 +721,14 @@ VIDEO_START( mirderby )
WRITE8_HANDLER( mrokumei_videoram_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap[(offset & 0x2000) >> 13][(offset & 0x1000) >> 12], (offset & 0xffe) >> 1);
}
WRITE8_HANDLER( reikaids_videoram_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap[(offset & 0x2000) >> 13][offset & 3], (offset & 0xffc) >> 2);
}
@@ -736,13 +736,13 @@ WRITE8_HANDLER( reikaids_videoram_w )
WRITE8_HANDLER( reikaids_gfx_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror( "%04x: [setbank %02x]\n",cpu_get_pc(space->cpu),data);
if (state->gfx_bank[state->reikaids_which] != data)
{
state->gfx_bank[state->reikaids_which] = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
state->reikaids_which ^= 1;
@@ -750,18 +750,18 @@ WRITE8_HANDLER( reikaids_gfx_bank_w )
WRITE8_HANDLER( pteacher_gfx_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
// logerror("%04x: gfxbank:=%02x\n", cpu_get_pc(space->cpu), data);
if (state->gfx_bank[0] != data)
{
state->gfx_bank[0] = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( homedata_blitter_param_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: blitter_param_w %02x\n", cpu_get_pc(space->cpu), data);
state->blitter_param[state->blitter_param_count] = data;
state->blitter_param_count++;
@@ -770,21 +770,21 @@ WRITE8_HANDLER( homedata_blitter_param_w )
WRITE8_HANDLER( mrokumei_blitter_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* --xxx--- layer 1 gfx bank
-----x-- blitter ROM bank
------xx layer 0 gfx bank
*/
if ((state->blitter_bank ^ data) & 0x3b)
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->blitter_bank = data;
}
WRITE8_HANDLER( reikaids_blitter_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* xxx----- priority control
----x--- target page? what's this for?
------xx blitter ROM bank
@@ -794,7 +794,7 @@ WRITE8_HANDLER( reikaids_blitter_bank_w )
WRITE8_HANDLER( pteacher_blitter_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* xxx----- blitter ROM bank
-----x-- pixel clock (normal/slow)
------x- layer #1 gfx charset (lemnangl only)
@@ -802,14 +802,14 @@ WRITE8_HANDLER( pteacher_blitter_bank_w )
*/
if ((state->blitter_bank ^ data) & 0x03)
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->blitter_bank = data;
}
WRITE8_HANDLER( mrokumei_blitter_start_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
if (data & 0x80)
mrokumei_handleblit(space, ((state->blitter_bank & 0x04) >> 2) * 0x10000);
@@ -819,14 +819,14 @@ WRITE8_HANDLER( mrokumei_blitter_start_w )
WRITE8_HANDLER( reikaids_blitter_start_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
reikaids_handleblit(space, (state->blitter_bank & 3) * 0x10000);
}
WRITE8_HANDLER( pteacher_blitter_start_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
- pteacher_handleblit(space, (state->blitter_bank >> 5) * 0x10000 & (space->machine->region("user1")->bytes() - 1));
+ homedata_state *state = space->machine().driver_data<homedata_state>();
+ pteacher_handleblit(space, (state->blitter_bank >> 5) * 0x10000 & (space->machine().region("user1")->bytes() - 1));
}
@@ -839,13 +839,13 @@ WRITE8_HANDLER( pteacher_blitter_start_w )
SCREEN_UPDATE( mrokumei )
{
- homedata_state *state = screen->machine->driver_data<homedata_state>();
+ homedata_state *state = screen->machine().driver_data<homedata_state>();
int flags,width;
/* blank screen */
if (state->vreg[0x3] == 0xc1 && state->vreg[0x4] == 0xc0 && state->vreg[0x5] == 0xff)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -853,7 +853,7 @@ SCREEN_UPDATE( mrokumei )
if (flags != state->flipscreen)
{
state->flipscreen = flags;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
}
switch (state->vreg[0x3])
@@ -884,7 +884,7 @@ SCREEN_UPDATE( mrokumei )
#ifdef UNUSED_FUNCTION
SCREEN_UPDATE( reikaids )
{
- homedata_state *state = screen->machine->driver_data<homedata_state>();
+ homedata_state *state = screen->machine().driver_data<homedata_state>();
int flags;
static const int pritable[8][4] =
{
@@ -904,11 +904,11 @@ SCREEN_UPDATE( reikaids )
if (flags != state->flipscreen)
{
state->flipscreen = flags;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
}
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
pri = (state->bank & 0x70) >> 4;
for (i = 0; i < 4; i++)
@@ -919,7 +919,7 @@ SCREEN_UPDATE( reikaids )
SCREEN_UPDATE( reikaids )
{
- homedata_state *state = screen->machine->driver_data<homedata_state>();
+ homedata_state *state = screen->machine().driver_data<homedata_state>();
int flags;
static const int pritable[2][8][4] = /* table of priorities derived from the PROM */
{
@@ -951,11 +951,11 @@ SCREEN_UPDATE( reikaids )
if (flags != state->flipscreen)
{
state->flipscreen = flags;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
}
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
pri = (state->blitter_bank & 0x70) >> 4;
for (i = 0; i < 4; i++)
@@ -966,14 +966,14 @@ SCREEN_UPDATE( reikaids )
SCREEN_UPDATE( pteacher )
{
- homedata_state *state = screen->machine->driver_data<homedata_state>();
+ homedata_state *state = screen->machine().driver_data<homedata_state>();
int flags, scroll_low, scroll_high;
/* blank screen */
if (state->vreg[0x3] == 0xc1 && state->vreg[0x4] == 0xc0 && state->vreg[0x5] == 0xff)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -981,7 +981,7 @@ SCREEN_UPDATE( pteacher )
if (flags != state->flipscreen)
{
state->flipscreen = flags;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
}
/* bit 2 of blitter_bank stretches characters horizontally by 3/2,
@@ -1051,6 +1051,6 @@ SCREEN_UPDATE( mirderby )
SCREEN_EOF( homedata )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->visible_page ^= 1;
}
diff --git a/src/mame/video/homerun.c b/src/mame/video/homerun.c
index 3d94b82eb20..f40ca7cea09 100644
--- a/src/mame/video/homerun.c
+++ b/src/mame/video/homerun.c
@@ -6,8 +6,8 @@
WRITE8_DEVICE_HANDLER(homerun_banking_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
- if (device->machine->primary_screen->vpos() > half_screen)
+ homerun_state *state = device->machine().driver_data<homerun_state>();
+ if (device->machine().primary_screen->vpos() > half_screen)
state->gc_down = data & 3;
else
state->gc_up = data & 3;
@@ -15,12 +15,12 @@ WRITE8_DEVICE_HANDLER(homerun_banking_w)
tilemap_mark_all_tiles_dirty(state->tilemap);
data >>= 5;
- memory_set_bank(device->machine, "bank1", data & 0x07);
+ memory_set_bank(device->machine(), "bank1", data & 0x07);
}
WRITE8_HANDLER( homerun_videoram_w )
{
- homerun_state *state = space->machine->driver_data<homerun_state>();
+ homerun_state *state = space->machine().driver_data<homerun_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset & 0xfff);
}
@@ -41,12 +41,12 @@ WRITE8_HANDLER(homerun_color_w)
bit1 = (data >> 6) & 0x01;
bit2 = (data >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- palette_set_color(space->machine, offset, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r,g,b));
}
static TILE_GET_INFO( get_homerun_tile_info )
{
- homerun_state *state = machine->driver_data<homerun_state>();
+ homerun_state *state = machine.driver_data<homerun_state>();
int tileno = (state->videoram[tile_index]) + ((state->videoram[tile_index + 0x1000] & 0x38) << 5) + ((state->gfx_ctrl & 1) << 11);
int palno = (state->videoram[tile_index + 0x1000] & 0x07);
@@ -55,13 +55,13 @@ static TILE_GET_INFO( get_homerun_tile_info )
VIDEO_START( homerun )
{
- homerun_state *state = machine->driver_data<homerun_state>();
+ homerun_state *state = machine.driver_data<homerun_state>();
state->tilemap = tilemap_create(machine, get_homerun_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- homerun_state *state = machine->driver_data<homerun_state>();
+ homerun_state *state = machine.driver_data<homerun_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -74,7 +74,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
color = (spriteram[offs + 2] & 0x7) + 8 ;
flipx=(spriteram[offs + 2] & 0x40) ;
flipy=(spriteram[offs + 2] & 0x80) ;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code,
color,
flipx,flipy,
@@ -84,7 +84,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE(homerun)
{
- homerun_state *state = screen->machine->driver_data<homerun_state>();
+ homerun_state *state = screen->machine().driver_data<homerun_state>();
rectangle myclip = *cliprect;
/* upper part */
@@ -94,14 +94,14 @@ SCREEN_UPDATE(homerun)
myclip.max_y /= 2;
state->gfx_ctrl = state->gc_up;
tilemap_draw(bitmap, &myclip, state->tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, &myclip);
+ draw_sprites(screen->machine(), bitmap, &myclip);
/* lower part */
myclip.min_y += myclip.max_y;
myclip.max_y *= 2;
state->gfx_ctrl = state->gc_down;
tilemap_draw(bitmap, &myclip, state->tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, &myclip);
+ draw_sprites(screen->machine(), bitmap, &myclip);
state->gc_down = state->gc_up;
return 0;
diff --git a/src/mame/video/hyhoo.c b/src/mame/video/hyhoo.c
index e519fc3736a..0ddd3b755fa 100644
--- a/src/mame/video/hyhoo.c
+++ b/src/mame/video/hyhoo.c
@@ -11,12 +11,12 @@
#include "includes/hyhoo.h"
-static void hyhoo_gfxdraw(running_machine *machine);
+static void hyhoo_gfxdraw(running_machine &machine);
WRITE8_HANDLER( hyhoo_blitter_w )
{
- hyhoo_state *state = space->machine->driver_data<hyhoo_state>();
+ hyhoo_state *state = space->machine().driver_data<hyhoo_state>();
switch (offset)
{
case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data;
@@ -28,7 +28,7 @@ WRITE8_HANDLER( hyhoo_blitter_w )
case 0x04: state->blitter_sizex = data; break;
case 0x05: state->blitter_sizey = data;
/* writing here also starts the blit */
- hyhoo_gfxdraw(space->machine);
+ hyhoo_gfxdraw(space->machine());
break;
case 0x06: state->blitter_direction_x = (data >> 0) & 0x01;
state->blitter_direction_y = (data >> 1) & 0x01;
@@ -42,8 +42,8 @@ WRITE8_HANDLER( hyhoo_blitter_w )
WRITE8_HANDLER( hyhoo_romsel_w )
{
- hyhoo_state *state = space->machine->driver_data<hyhoo_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ hyhoo_state *state = space->machine().driver_data<hyhoo_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->gfxrom = (((data & 0xc0) >> 4) + (data & 0x03));
state->highcolorflag = data;
nb1413m3_gfxrombank_w(space, 0, data);
@@ -63,10 +63,10 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void hyhoo_gfxdraw(running_machine *machine)
+static void hyhoo_gfxdraw(running_machine &machine)
{
- hyhoo_state *state = machine->driver_data<hyhoo_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
+ hyhoo_state *state = machine.driver_data<hyhoo_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
int x, y;
int dx1, dx2, dy;
@@ -108,7 +108,7 @@ static void hyhoo_gfxdraw(running_machine *machine)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = (state->gfxrom << 17) + (state->blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -220,20 +220,20 @@ static void hyhoo_gfxdraw(running_machine *machine)
}
nb1413m3_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
VIDEO_START( hyhoo )
{
- hyhoo_state *state = machine->driver_data<hyhoo_state>();
- state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ hyhoo_state *state = machine.driver_data<hyhoo_state>();
+ state->tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
}
SCREEN_UPDATE( hyhoo )
{
- hyhoo_state *state = screen->machine->driver_data<hyhoo_state>();
+ hyhoo_state *state = screen->machine().driver_data<hyhoo_state>();
if (state->dispflag)
copybitmap(bitmap, state->tmpbitmap, state->flipscreen, state->flipscreen, 0, 0, cliprect);
else
diff --git a/src/mame/video/hyperspt.c b/src/mame/video/hyperspt.c
index 47bd3dd7df0..58621d1f684 100644
--- a/src/mame/video/hyperspt.c
+++ b/src/mame/video/hyperspt.c
@@ -43,7 +43,7 @@ PALETTE_INIT( hyperspt )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( hyperspt )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,43 +78,43 @@ PALETTE_INIT( hyperspt )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( hyperspt_videoram_w )
{
- hyperspt_state *state = space->machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = space->machine().driver_data<hyperspt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( hyperspt_colorram_w )
{
- hyperspt_state *state = space->machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = space->machine().driver_data<hyperspt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( hyperspt_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- hyperspt_state *state = machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = machine.driver_data<hyperspt_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x80) << 1) + ((state->colorram[tile_index] & 0x40) << 3);
int color = state->colorram[tile_index] & 0x0f;
int flags = ((state->colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x20) ? TILE_FLIPY : 0);
@@ -124,15 +124,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( hyperspt )
{
- hyperspt_state *state = machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = machine.driver_data<hyperspt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- hyperspt_state *state = machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = machine.driver_data<hyperspt_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -157,44 +157,44 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sy += 1;
drawgfx_transmask(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code, color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
/* redraw with wraparound */
drawgfx_transmask(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code, color,
flipx, flipy,
sx - 256, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
}
}
SCREEN_UPDATE( hyperspt )
{
- hyperspt_state *state = screen->machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = screen->machine().driver_data<hyperspt_state>();
int row;
for (row = 0; row < 32; row++)
{
int scrollx = state->scroll[row * 2] + (state->scroll[(row * 2) + 1] & 0x01) * 256;
- if (flip_screen_get(screen->machine)) scrollx = -scrollx;
+ if (flip_screen_get(screen->machine())) scrollx = -scrollx;
tilemap_set_scrollx(state->bg_tilemap, row, scrollx);
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
/* Road Fighter */
static TILE_GET_INFO( roadf_get_bg_tile_info )
{
- hyperspt_state *state = machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = machine.driver_data<hyperspt_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x80) << 1) + ((state->colorram[tile_index] & 0x60) << 4);
int color = state->colorram[tile_index] & 0x0f;
int flags = (state->colorram[tile_index] & 0x10) ? TILE_FLIPX : 0;
@@ -204,7 +204,7 @@ static TILE_GET_INFO( roadf_get_bg_tile_info )
VIDEO_START( roadf )
{
- hyperspt_state *state = machine->driver_data<hyperspt_state>();
+ hyperspt_state *state = machine.driver_data<hyperspt_state>();
state->bg_tilemap = tilemap_create(machine, roadf_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
diff --git a/src/mame/video/hyprduel.c b/src/mame/video/hyprduel.c
index bcb65fbe9bf..d044a9b7a5f 100644
--- a/src/mame/video/hyprduel.c
+++ b/src/mame/video/hyprduel.c
@@ -63,9 +63,9 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE16_HANDLER( hyprduel_paletteram_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
data = COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 6), pal5bit(data >> 11), pal5bit(data >> 1));
}
@@ -104,9 +104,9 @@ WRITE16_HANDLER( hyprduel_paletteram_w )
/* 8x8x4 tiles only */
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram)
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram)
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT16 code;
int table_index;
UINT32 tile;
@@ -143,9 +143,9 @@ INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int ti
/* 8x8x4 or 8x8x8 tiles. It's the tile's color that decides: if its low 4
bits are high ($f,$1f,$2f etc) the tile is 8bpp, otherwise it's 4bpp */
-INLINE void get_tile_info_8bit( running_machine *machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram )
+INLINE void get_tile_info_8bit( running_machine &machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT16 code;
int table_index;
UINT32 tile;
@@ -191,9 +191,9 @@ INLINE void get_tile_info_8bit( running_machine *machine, tile_data *tileinfo, i
/* 16x16x4 or 16x16x8 tiles. It's the tile's color that decides: if its low 4
bits are high ($f,$1f,$2f etc) the tile is 8bpp, otherwise it's 4bpp */
-INLINE void get_tile_info_16x16_8bit( running_machine *machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram )
+INLINE void get_tile_info_16x16_8bit( running_machine &machine, tile_data *tileinfo, int tile_index, int layer, UINT16 *vram )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT16 code;
int table_index;
UINT32 tile;
@@ -238,9 +238,9 @@ INLINE void get_tile_info_16x16_8bit( running_machine *machine, tile_data *tilei
}
}
-INLINE void hyprduel_vram_w( running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram )
+INLINE void hyprduel_vram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
COMBINE_DATA(&vram[offset]);
{
/* Account for the window */
@@ -259,45 +259,45 @@ INLINE void hyprduel_vram_w( running_machine *machine, offs_t offset, UINT16 dat
static TILE_GET_INFO( get_tile_info_0_8bit )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
get_tile_info_8bit(machine, tileinfo, tile_index, 0, state->vram_0);
}
static TILE_GET_INFO( get_tile_info_1_8bit )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
get_tile_info_8bit(machine, tileinfo, tile_index, 1, state->vram_1);
}
static TILE_GET_INFO( get_tile_info_2_8bit )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
get_tile_info_8bit(machine, tileinfo, tile_index, 2, state->vram_2);
}
WRITE16_HANDLER( hyprduel_vram_0_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
- hyprduel_vram_w(space->machine, offset, data, mem_mask, 0, state->vram_0);
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
+ hyprduel_vram_w(space->machine(), offset, data, mem_mask, 0, state->vram_0);
}
WRITE16_HANDLER( hyprduel_vram_1_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
- hyprduel_vram_w(space->machine, offset, data, mem_mask, 1, state->vram_1);
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
+ hyprduel_vram_w(space->machine(), offset, data, mem_mask, 1, state->vram_1);
}
WRITE16_HANDLER( hyprduel_vram_2_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
- hyprduel_vram_w(space->machine, offset, data, mem_mask, 2, state->vram_2);
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
+ hyprduel_vram_w(space->machine(), offset, data, mem_mask, 2, state->vram_2);
}
/* Dirty the relevant tilemap when its window changes */
WRITE16_HANDLER( hyprduel_window_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
UINT16 olddata = state->window[offset];
UINT16 newdata = COMBINE_DATA(&state->window[offset]);
if (newdata != olddata)
@@ -319,9 +319,9 @@ WRITE16_HANDLER( hyprduel_window_w )
the tile's sizes to be known at startup - which we don't!
*/
-static void alloc_empty_tiles( running_machine *machine )
+static void alloc_empty_tiles( running_machine &machine )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
int code,i;
state->empty_tiles = auto_alloc_array(machine, UINT8, 16*16*16);
@@ -335,7 +335,7 @@ static void alloc_empty_tiles( running_machine *machine )
static STATE_POSTLOAD( hyprduel_postload )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
int i;
for (i = 0; i < 3; i++)
@@ -353,7 +353,7 @@ static STATE_POSTLOAD( hyprduel_postload )
static VIDEO_START( common_14220 )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
alloc_empty_tiles(machine);
state->tiletable_old = auto_alloc_array(machine, UINT16, state->tiletable_size / 2);
state->dirtyindex = auto_alloc_array(machine, UINT8, state->tiletable_size / 4);
@@ -381,12 +381,12 @@ static VIDEO_START( common_14220 )
/* Set up save state */
state->save_item(NAME(state->sprite_xoffs));
state->save_item(NAME(state->sprite_yoffs));
- machine->state().register_postload(hyprduel_postload, NULL);
+ machine.state().register_postload(hyprduel_postload, NULL);
}
VIDEO_START( hyprduel_14220 )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->sprite_yoffs_sub = 2;
@@ -395,7 +395,7 @@ VIDEO_START( hyprduel_14220 )
VIDEO_START( magerror_14220 )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->sprite_yoffs_sub = 0;
@@ -459,14 +459,14 @@ VIDEO_START( magerror_14220 )
/* Draw sprites */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
- UINT8 *base_gfx = machine->region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine->region("gfx1")->bytes();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
+ UINT8 *base_gfx = machine.region("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
int max_sprites = state->spriteram_size / 8;
int sprites = state->videoregs[0x00 / 2] % max_sprites;
@@ -568,7 +568,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx, flipy,
x, y,
zoom, zoom,
- machine->priority_bitmap,primask[pri], 255);
+ machine.priority_bitmap,primask[pri], 255);
}
else
{
@@ -584,7 +584,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx, flipy,
x, y,
zoom, zoom,
- machine->priority_bitmap,primask[pri], 15);
+ machine.priority_bitmap,primask[pri], 15);
}
#if 0
{ /* Display priority + zoom on each sprite */
@@ -604,7 +604,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
WRITE16_HANDLER( hyprduel_scrollreg_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
UINT16 window = state->window[offset];
COMBINE_DATA(&state->scroll[offset]);
@@ -617,7 +617,7 @@ WRITE16_HANDLER( hyprduel_scrollreg_w )
WRITE16_HANDLER( hyprduel_scrollreg_init_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
int i;
for (i = 0; i < 3; i++)
@@ -634,9 +634,9 @@ WRITE16_HANDLER( hyprduel_scrollreg_init_w )
}
-static void draw_layers( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
+static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
UINT16 layers_pri = state->videoregs[0x10/2];
int layer;
@@ -652,9 +652,9 @@ static void draw_layers( running_machine *machine, bitmap_t *bitmap, const recta
}
/* Dirty tilemaps when the tiles set changes */
-static void dirty_tiles( running_machine *machine, int layer, UINT16 *vram )
+static void dirty_tiles( running_machine &machine, int layer, UINT16 *vram )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
int col, row;
for (row = 0; row < WIN_NY; row++)
@@ -673,7 +673,7 @@ static void dirty_tiles( running_machine *machine, int layer, UINT16 *vram )
SCREEN_UPDATE( hyprduel )
{
- hyprduel_state *state = screen->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = screen->machine().driver_data<hyprduel_state>();
int i, pri, layers_ctrl = -1;
UINT16 screenctrl = *state->screenctrl;
@@ -696,9 +696,9 @@ SCREEN_UPDATE( hyprduel )
if (dirty)
{
- dirty_tiles(screen->machine, 0, state->vram_0);
- dirty_tiles(screen->machine, 1, state->vram_1);
- dirty_tiles(screen->machine, 2, state->vram_2);
+ dirty_tiles(screen->machine(), 0, state->vram_0);
+ dirty_tiles(screen->machine(), 1, state->vram_1);
+ dirty_tiles(screen->machine(), 2, state->vram_2);
}
}
@@ -706,7 +706,7 @@ SCREEN_UPDATE( hyprduel )
state->sprite_yoffs = state->videoregs[0x04 / 2] - screen->height() / 2 - state->sprite_yoffs_sub;
/* The background color is selected by a register */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, ((state->videoregs[0x12 / 2] & 0x0fff)) + 0x1000);
/* Screen Control Register:
@@ -722,15 +722,15 @@ SCREEN_UPDATE( hyprduel )
---- ---- ---- ---0 Flip Screen */
if (screenctrl & 2)
return 0;
- flip_screen_set(screen->machine, screenctrl & 1);
+ flip_screen_set(screen->machine(), screenctrl & 1);
#if 0
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{ int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 0x08;
if (msk != 0)
{
bitmap_fill(bitmap, cliprect,0);
@@ -745,10 +745,10 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
#endif
for (pri = 3; pri >= 0; pri--)
- draw_layers(screen->machine, bitmap, cliprect, pri, layers_ctrl);
+ draw_layers(screen->machine(), bitmap, cliprect, pri, layers_ctrl);
if (layers_ctrl & 0x08)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/ikki.c b/src/mame/video/ikki.c
index d37d90feefb..93a99ebe1df 100644
--- a/src/mame/video/ikki.c
+++ b/src/mame/video/ikki.c
@@ -13,11 +13,11 @@ Video hardware driver by Uki
PALETTE_INIT( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
int i;
/* allocate the colortable - extra pen for the punch through pen */
- machine->colortable = colortable_alloc(machine, 0x101);
+ machine.colortable = colortable_alloc(machine, 0x101);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -26,7 +26,7 @@ PALETTE_INIT( ikki )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -44,27 +44,27 @@ PALETTE_INIT( ikki )
ctabentry = 0x100;
}
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bg lookup table */
for (i = 0x200; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( ikki_scrn_ctrl_w )
{
- ikki_state *state = space->machine->driver_data<ikki_state>();
+ ikki_state *state = space->machine().driver_data<ikki_state>();
state->flipscreen = (data >> 2) & 1;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
UINT8 *spriteram = state->spriteram;
int y;
offs_t offs;
@@ -93,11 +93,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (y > 240)
y = y - 256;
- drawgfx_transmask(state->sprite_bitmap,cliprect, machine->gfx[1],
+ drawgfx_transmask(state->sprite_bitmap,cliprect, machine.gfx[1],
code, color,
state->flipscreen,state->flipscreen,
x,y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
/* copy the sprite bitmap into the main bitmap, skipping the transparent pixels */
@@ -109,7 +109,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
UINT16 pen = *BITMAP_ADDR16(state->sprite_bitmap, y, x);
- if (colortable_entry_get_value(machine->colortable, pen) != 0x100)
+ if (colortable_entry_get_value(machine.colortable, pen) != 0x100)
*BITMAP_ADDR16(bitmap, y, x) = pen;
}
}
@@ -118,17 +118,17 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
VIDEO_START( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
- state->sprite_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ ikki_state *state = machine.driver_data<ikki_state>();
+ state->sprite_bitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->sprite_bitmap));
}
SCREEN_UPDATE( ikki )
{
- ikki_state *state = screen->machine->driver_data<ikki_state>();
+ ikki_state *state = screen->machine().driver_data<ikki_state>();
offs_t offs;
- UINT8 *VIDEOATTR = screen->machine->region("user1")->base();
+ UINT8 *VIDEOATTR = screen->machine().region("user1")->base();
/* draw bg layer */
@@ -178,14 +178,14 @@ SCREEN_UPDATE( ikki )
bank = (color & 0xe0) << 3;
color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs * 2 + 1] + bank,
color,
state->flipscreen,state->flipscreen,
x,y);
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
/* mask sprites */
@@ -213,7 +213,7 @@ SCREEN_UPDATE( ikki )
bank = (color & 0xe0) << 3;
color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs * 2 + 1] + bank,
color,
state->flipscreen,state->flipscreen,
diff --git a/src/mame/video/inufuku.c b/src/mame/video/inufuku.c
index 9981c00bb14..fcd3df2d4be 100644
--- a/src/mame/video/inufuku.c
+++ b/src/mame/video/inufuku.c
@@ -23,7 +23,7 @@
WRITE16_HANDLER( inufuku_palettereg_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
switch (offset)
{
case 0x02: state->bg_palettebank = (data & 0xf000) >> 12;
@@ -37,7 +37,7 @@ WRITE16_HANDLER( inufuku_palettereg_w )
WRITE16_HANDLER( inufuku_scrollreg_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
switch (offset)
{
case 0x00: state->bg_scrollx = data + 1; break;
@@ -55,9 +55,9 @@ WRITE16_HANDLER( inufuku_scrollreg_w )
******************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
int offs;
for (offs = (state->spriteram1_size / 16) - 1; offs >= 0; offs--)
@@ -141,13 +141,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = ((state->spriteram2[map_start] & 0x0007) << 16) + state->spriteram2[map_start + 1];
- pdrawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2],
+ pdrawgfxzoom_transpen(bitmap, cliprect, machine.gfx[2],
code,
color,
flipx, flipy,
sx - 16, sy - 16,
zoomx << 11, zoomy << 11,
- machine->priority_bitmap,priority_mask, 15);
+ machine.priority_bitmap,priority_mask, 15);
map_start += 2;
}
@@ -165,7 +165,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static TILE_GET_INFO( get_inufuku_bg_tile_info )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
SET_TILE_INFO(
0,
state->bg_videoram[tile_index],
@@ -175,7 +175,7 @@ static TILE_GET_INFO( get_inufuku_bg_tile_info )
static TILE_GET_INFO( get_inufuku_tx_tile_info )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
SET_TILE_INFO(
1,
state->tx_videoram[tile_index],
@@ -185,26 +185,26 @@ static TILE_GET_INFO( get_inufuku_tx_tile_info )
READ16_HANDLER( inufuku_bg_videoram_r )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
return state->bg_videoram[offset];
}
WRITE16_HANDLER( inufuku_bg_videoram_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
READ16_HANDLER( inufuku_tx_videoram_r )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
return state->tx_videoram[offset];
}
WRITE16_HANDLER( inufuku_tx_videoram_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
COMBINE_DATA(&state->tx_videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
@@ -218,7 +218,7 @@ WRITE16_HANDLER( inufuku_tx_videoram_w )
VIDEO_START( inufuku )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
state->bg_tilemap = tilemap_create(machine, get_inufuku_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->tx_tilemap = tilemap_create(machine, get_inufuku_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -236,11 +236,11 @@ VIDEO_START( inufuku )
SCREEN_UPDATE( inufuku )
{
- inufuku_state *state = screen->machine->driver_data<inufuku_state>();
+ inufuku_state *state = screen->machine().driver_data<inufuku_state>();
int i;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
if (state->bg_raster)
{
@@ -260,6 +260,6 @@ SCREEN_UPDATE( inufuku )
tilemap_set_scrolly(state->tx_tilemap, 0, state->tx_scrolly);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/iqblock.c b/src/mame/video/iqblock.c
index d2338f31024..50b87b8ef71 100644
--- a/src/mame/video/iqblock.c
+++ b/src/mame/video/iqblock.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
int code = state->bgvideoram[tile_index] + (state->bgvideoram[tile_index + 0x800] << 8);
SET_TILE_INFO(
0,
@@ -21,7 +21,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
int code = state->fgvideoram[tile_index];
SET_TILE_INFO(
1,
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( iqblock )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8, 8,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,32,64, 8);
@@ -58,27 +58,27 @@ VIDEO_START( iqblock )
WRITE8_HANDLER( iqblock_fgvideoram_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE8_HANDLER( iqblock_bgvideoram_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
}
READ8_HANDLER( iqblock_bgvideoram_r )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
return state->bgvideoram[offset];
}
WRITE8_HANDLER( iqblock_fgscroll_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
tilemap_set_scrolly(state->fg_tilemap,offset,data);
}
@@ -92,7 +92,7 @@ WRITE8_HANDLER( iqblock_fgscroll_w )
SCREEN_UPDATE( iqblock )
{
- iqblock_state *state = screen->machine->driver_data<iqblock_state>();
+ iqblock_state *state = screen->machine().driver_data<iqblock_state>();
if (!state->videoenable) return 0;
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
diff --git a/src/mame/video/irobot.c b/src/mame/video/irobot.c
index f3a9398d6a3..98dfd2fdde5 100644
--- a/src/mame/video/irobot.c
+++ b/src/mame/video/irobot.c
@@ -71,18 +71,18 @@ WRITE8_HANDLER( irobot_paletteram_w )
g = 12 * bits * intensity;
bits = (color >> 7) & 0x03;
r = 12 * bits * intensity;
- palette_set_color(space->machine,(offset >> 1) & 0x3F,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),(offset >> 1) & 0x3F,MAKE_RGB(r,g,b));
}
-static void _irobot_poly_clear(running_machine *machine, UINT8 *bitmap_base)
+static void _irobot_poly_clear(running_machine &machine, UINT8 *bitmap_base)
{
- memset(bitmap_base, 0, BITMAP_WIDTH * machine->primary_screen->height());
+ memset(bitmap_base, 0, BITMAP_WIDTH * machine.primary_screen->height());
}
-void irobot_poly_clear(running_machine *machine)
+void irobot_poly_clear(running_machine &machine)
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
UINT8 *bitmap_base = state->bufsel ? state->polybitmap2 : state->polybitmap1;
_irobot_poly_clear(machine, bitmap_base);
}
@@ -95,9 +95,9 @@ void irobot_poly_clear(running_machine *machine)
***************************************************************************/
VIDEO_START( irobot )
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
/* Setup 2 bitmaps for the polygon generator */
- int height = machine->primary_screen->height();
+ int height = machine.primary_screen->height();
state->polybitmap1 = auto_alloc_array(machine, UINT8, BITMAP_WIDTH * height);
state->polybitmap2 = auto_alloc_array(machine, UINT8, BITMAP_WIDTH * height);
@@ -107,8 +107,8 @@ VIDEO_START( irobot )
/* Set clipping */
state->ir_xmin = state->ir_ymin = 0;
- state->ir_xmax = machine->primary_screen->width();
- state->ir_ymax = machine->primary_screen->height();
+ state->ir_xmax = machine.primary_screen->width();
+ state->ir_ymax = machine.primary_screen->height();
}
@@ -162,9 +162,9 @@ VIDEO_START( irobot )
modified from a routine written by Andrew Caldwell
*/
-static void draw_line(running_machine *machine, UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col)
+static void draw_line(running_machine &machine, UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col)
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
int dx,dy,sx,sy,cx,cy;
dx = abs(x1-x2);
@@ -211,9 +211,9 @@ static void draw_line(running_machine *machine, UINT8 *polybitmap, int x1, int y
#define ROUND_TO_PIXEL(x) ((x >> 7) - 128)
-void irobot_run_video(running_machine *machine)
+void irobot_run_video(running_machine &machine)
{
- irobot_state *state = machine->driver_data<irobot_state>();
+ irobot_state *state = machine.driver_data<irobot_state>();
UINT8 *polybitmap;
UINT16 *combase16 = (UINT16 *)state->combase;
int sx,sy,ex,ey,sx2,ey2;
@@ -348,7 +348,7 @@ void irobot_run_video(running_machine *machine)
SCREEN_UPDATE( irobot )
{
- irobot_state *state = screen->machine->driver_data<irobot_state>();
+ irobot_state *state = screen->machine().driver_data<irobot_state>();
UINT8 *videoram = state->videoram;
UINT8 *bitmap_base = state->bufsel ? state->polybitmap1 : state->polybitmap2;
int x, y, offs;
@@ -364,7 +364,7 @@ SCREEN_UPDATE( irobot )
int code = videoram[offs] & 0x3f;
int color = ((videoram[offs] & 0xc0) >> 6) | (state->alphamap >> 3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code, color,
0,0,
8*x,8*y,0);
diff --git a/src/mame/video/ironhors.c b/src/mame/video/ironhors.c
index 6d905f4602e..89f06d8c153 100644
--- a/src/mame/video/ironhors.c
+++ b/src/mame/video/ironhors.c
@@ -29,7 +29,7 @@ PALETTE_INIT( ironhors )
4, resistances, bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -58,7 +58,7 @@ PALETTE_INIT( ironhors )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -73,32 +73,32 @@ PALETTE_INIT( ironhors )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
WRITE8_HANDLER( ironhors_videoram_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( ironhors_colorram_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( ironhors_charbank_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
if (state->charbank != (data & 0x03))
{
state->charbank = data & 0x03;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
state->spriterambank = data & 0x08;
@@ -108,15 +108,15 @@ WRITE8_HANDLER( ironhors_charbank_w )
WRITE8_HANDLER( ironhors_palettebank_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
if (state->palettebank != (data & 0x07))
{
state->palettebank = data & 0x07;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
/* bit 6 unknown - set after game over */
@@ -126,10 +126,10 @@ WRITE8_HANDLER( ironhors_palettebank_w )
WRITE8_HANDLER( ironhors_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (~data & 0x08))
+ if (flip_screen_get(space->machine()) != (~data & 0x08))
{
- flip_screen_set(space->machine, ~data & 0x08);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), ~data & 0x08);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* other bits are used too, but unknown */
@@ -137,7 +137,7 @@ WRITE8_HANDLER( ironhors_flipscreen_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x40) << 2) +
((state->colorram[tile_index] & 0x20) << 4) + (state->charbank << 10);
int color = (state->colorram[tile_index] & 0x0f) + 16 * state->palettebank;
@@ -149,15 +149,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( ironhors )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
int offs;
UINT8 *sr;
@@ -187,7 +187,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
switch (sr[offs + 4] & 0x0c)
{
case 0x00: /* 16x16 */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code/4,
color,
flipx,flipy,
@@ -198,12 +198,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code & ~1,
color,
flipx,flipy,
flipx?sx+8:sx,sy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code | 1,
color,
flipx,flipy,
@@ -213,12 +213,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
case 0x08: /* 8x16 */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code & ~2,
color,
flipx,flipy,
sx,flipy?sy+8:sy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code | 2,
color,
flipx,flipy,
@@ -228,7 +228,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
case 0x0c: /* 8x8 */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -241,20 +241,20 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ironhors )
{
- ironhors_state *state = screen->machine->driver_data<ironhors_state>();
+ ironhors_state *state = screen->machine().driver_data<ironhors_state>();
int row;
for (row = 0; row < 32; row++)
tilemap_set_scrollx(state->bg_tilemap, row, state->scroll[row]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static TILE_GET_INFO( farwest_get_bg_tile_info )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x40) << 2) +
((state->colorram[tile_index] & 0x20) << 4) + (state->charbank << 10);
int color = (state->colorram[tile_index] & 0x0f) + 16 * state->palettebank;
@@ -265,15 +265,15 @@ static TILE_GET_INFO( farwest_get_bg_tile_info )
VIDEO_START( farwest )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
state->bg_tilemap = tilemap_create(machine, farwest_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
int offs;
UINT8 *sr = state->spriteram2;
UINT8 *sr2 = state->spriteram;
@@ -300,7 +300,7 @@ static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
switch (sr[offs + 3] & 0x0c)
{
case 0x00: /* 16x16 */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code/4,
color,
flipx,flipy,
@@ -311,12 +311,12 @@ static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
{
if (flip_screen_get(machine)) sy += 8; // this fixes the train wheels' position
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code & ~1,
color,
flipx,flipy,
flipx?sx+8:sx,sy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code | 1,
color,
flipx,flipy,
@@ -326,12 +326,12 @@ static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
case 0x08: /* 8x16 */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code & ~2,
color,
flipx,flipy,
sx,flipy?sy+8:sy,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code | 2,
color,
flipx,flipy,
@@ -341,7 +341,7 @@ static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
case 0x0c: /* 8x8 */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -354,14 +354,14 @@ static void farwest_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( farwest)
{
- ironhors_state *state = screen->machine->driver_data<ironhors_state>();
+ ironhors_state *state = screen->machine().driver_data<ironhors_state>();
int row;
for (row = 0; row < 32; row++)
tilemap_set_scrollx(state->bg_tilemap, row, state->scroll[row]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- farwest_draw_sprites(screen->machine, bitmap, cliprect);
+ farwest_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/itech32.c b/src/mame/video/itech32.c
index 004d120fb9b..b9e28ff9b40 100644
--- a/src/mame/video/itech32.c
+++ b/src/mame/video/itech32.c
@@ -168,7 +168,7 @@ INLINE void enable_clipping(itech32_state *state)
VIDEO_START( itech32 )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
int i;
/* allocate memory */
@@ -189,8 +189,8 @@ VIDEO_START( itech32 )
state->videoplane[0][i] = state->videoplane[1][i] = 0xff;
/* fetch the GROM base */
- state->grom_base = machine->region("gfx1")->base();
- state->grom_size = machine->region("gfx1")->bytes();
+ state->grom_base = machine.region("gfx1")->base();
+ state->grom_size = machine.region("gfx1")->bytes();
state->grom_bank = 0;
state->grom_bank_mask = state->grom_size >> 24;
if (state->grom_bank_mask == 2)
@@ -199,7 +199,7 @@ VIDEO_START( itech32 )
/* reset statics */
memset(state->video, 0, 0x80);
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_interrupt));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_interrupt));
state->enable_latch[0] = 1;
state->enable_latch[1] = (state->planes > 1) ? 1 : 0;
}
@@ -214,7 +214,7 @@ VIDEO_START( itech32 )
WRITE16_HANDLER( timekill_colora_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
{
state->enable_latch[0] = (~data >> 5) & 1;
@@ -226,7 +226,7 @@ WRITE16_HANDLER( timekill_colora_w )
WRITE16_HANDLER( timekill_colorbc_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
state->color_latch[1] = ((data & 0xf0) << 4) | 0x1000;
}
@@ -239,14 +239,14 @@ WRITE16_HANDLER( timekill_intensity_w )
double intensity = (double)(data & 0xff) / (double)0x60;
int i;
for (i = 0; i < 8192; i++)
- palette_set_pen_contrast(space->machine, i, intensity);
+ palette_set_pen_contrast(space->machine(), i, intensity);
}
}
WRITE16_HANDLER( bloodstm_color1_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
state->color_latch[0] = (data & 0x7f) << 8;
}
@@ -254,7 +254,7 @@ WRITE16_HANDLER( bloodstm_color1_w )
WRITE16_HANDLER( bloodstm_color2_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
state->color_latch[1] = (data & 0x7f) << 8;
}
@@ -262,7 +262,7 @@ WRITE16_HANDLER( bloodstm_color2_w )
WRITE16_HANDLER( bloodstm_plane_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
{
state->enable_latch[0] = (~data >> 1) & 1;
@@ -273,7 +273,7 @@ WRITE16_HANDLER( bloodstm_plane_w )
WRITE32_HANDLER( drivedge_color0_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_16_23)
state->color_latch[0] = ((data >> 16) & 0x7f) << 8;
}
@@ -281,7 +281,7 @@ WRITE32_HANDLER( drivedge_color0_w )
WRITE32_HANDLER( itech020_color1_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
state->color_latch[1] = (data & 0x7f) << 8;
}
@@ -289,7 +289,7 @@ WRITE32_HANDLER( itech020_color1_w )
WRITE32_HANDLER( itech020_color2_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_0_7)
state->color_latch[0] = (data & 0x7f) << 8;
}
@@ -297,7 +297,7 @@ WRITE32_HANDLER( itech020_color2_w )
WRITE32_HANDLER( itech020_plane_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_8_15)
{
state->enable_latch[0] = (~data >> 9) & 1;
@@ -318,13 +318,13 @@ WRITE16_HANDLER( timekill_paletteram_w )
{
int r, g, b;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- r = space->machine->generic.paletteram.u16[offset & ~1] & 0xff;
- g = space->machine->generic.paletteram.u16[offset & ~1] >> 8;
- b = space->machine->generic.paletteram.u16[offset | 1] >> 8;
+ r = space->machine().generic.paletteram.u16[offset & ~1] & 0xff;
+ g = space->machine().generic.paletteram.u16[offset & ~1] >> 8;
+ b = space->machine().generic.paletteram.u16[offset | 1] >> 8;
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r, g, b));
}
@@ -335,13 +335,13 @@ WRITE16_HANDLER( bloodstm_paletteram_w )
/* in test mode, the LSB is used; in game mode, the MSB is used */
if (!ACCESSING_BITS_0_7 && (offset & 1))
data >>= 8, mem_mask >>= 8;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- r = space->machine->generic.paletteram.u16[offset & ~1] & 0xff;
- g = space->machine->generic.paletteram.u16[offset & ~1] >> 8;
- b = space->machine->generic.paletteram.u16[offset | 1] & 0xff;
+ r = space->machine().generic.paletteram.u16[offset & ~1] & 0xff;
+ g = space->machine().generic.paletteram.u16[offset & ~1] >> 8;
+ b = space->machine().generic.paletteram.u16[offset | 1] & 0xff;
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r, g, b));
}
@@ -349,13 +349,13 @@ WRITE32_HANDLER( drivedge_paletteram_w )
{
int r, g, b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = space->machine->generic.paletteram.u32[offset] & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 16) & 0xff;
+ r = space->machine().generic.paletteram.u32[offset] & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 16) & 0xff;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
@@ -363,13 +363,13 @@ WRITE32_HANDLER( itech020_paletteram_w )
{
int r, g, b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = (space->machine->generic.paletteram.u32[offset] >> 16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = space->machine->generic.paletteram.u32[offset] & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >> 16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = space->machine().generic.paletteram.u32[offset] & 0xff;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
@@ -380,9 +380,9 @@ WRITE32_HANDLER( itech020_paletteram_w )
*
*************************************/
-static void logblit(running_machine *machine, const char *tag)
+static void logblit(running_machine &machine, const char *tag)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
if (!input_code_pressed(machine, KEYCODE_L))
return;
if (state->is_drivedge && VIDEO_TRANSFER_FLAGS == 0x5490)
@@ -438,9 +438,9 @@ static void logblit(running_machine *machine, const char *tag)
*
*************************************/
-static void update_interrupts(running_machine *machine, int fast)
+static void update_interrupts(running_machine &machine, int fast)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
int scanline_state = 0, blitter_state = 0;
if (VIDEO_INTSTATE & VIDEO_INTENABLE & VIDEOINT_SCANLINE)
@@ -454,12 +454,12 @@ static void update_interrupts(running_machine *machine, int fast)
static TIMER_CALLBACK( scanline_interrupt )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/* set timer for next frame */
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(VIDEO_INTSCANLINE));
/* set the interrupt bit in the status reg */
- logerror("-------------- (DISPLAY INT @ %d) ----------------\n", machine->primary_screen->vpos());
+ logerror("-------------- (DISPLAY INT @ %d) ----------------\n", machine.primary_screen->vpos());
VIDEO_INTSTATE |= VIDEOINT_SCANLINE;
/* update the interrupt state */
@@ -1173,9 +1173,9 @@ static void shiftreg_clear(itech32_state *state, UINT16 *base, UINT16 *zbase)
*
*************************************/
-static void handle_video_command(running_machine *machine)
+static void handle_video_command(running_machine &machine)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/* only 6 known commands */
switch (VIDEO_COMMAND)
{
@@ -1263,7 +1263,7 @@ static void handle_video_command(running_machine *machine)
WRITE16_HANDLER( itech32_video_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
rectangle visarea;
int old = state->video[offset];
@@ -1273,7 +1273,7 @@ WRITE16_HANDLER( itech32_video_w )
{
case 0x02/2: /* VIDEO_INTACK */
VIDEO_INTSTATE = old & ~data;
- update_interrupts(space->machine, 1);
+ update_interrupts(space->machine(), 1);
break;
case 0x04/2: /* VIDEO_TRANSFER */
@@ -1298,11 +1298,11 @@ WRITE16_HANDLER( itech32_video_w )
break;
case 0x08/2: /* VIDEO_COMMAND */
- handle_video_command(space->machine);
+ handle_video_command(space->machine());
break;
case 0x0a/2: /* VIDEO_INTENABLE */
- update_interrupts(space->machine, 1);
+ update_interrupts(space->machine(), 1);
break;
case 0x24/2: /* VIDEO_LEFTCLIP */
@@ -1326,7 +1326,7 @@ WRITE16_HANDLER( itech32_video_w )
break;
case 0x2c/2: /* VIDEO_INTSCANLINE */
- state->scanline_timer->adjust(space->machine->primary_screen->time_until_pos(VIDEO_INTSCANLINE));
+ state->scanline_timer->adjust(space->machine().primary_screen->time_until_pos(VIDEO_INTSCANLINE));
break;
case 0x32/2: /* VIDEO_VTOTAL */
@@ -1358,7 +1358,7 @@ WRITE16_HANDLER( itech32_video_w )
logerror("Configure Screen: HTOTAL: %x HBSTART: %x HBEND: %x VTOTAL: %x VBSTART: %x VBEND: %x\n",
VIDEO_HTOTAL, VIDEO_HBLANK_START, VIDEO_HBLANK_END, VIDEO_VTOTAL, VIDEO_VBLANK_START, VIDEO_VBLANK_END);
- space->machine->primary_screen->configure(VIDEO_HTOTAL, VIDEO_VTOTAL, visarea, HZ_TO_ATTOSECONDS(VIDEO_CLOCK) * VIDEO_HTOTAL * VIDEO_VTOTAL);
+ space->machine().primary_screen->configure(VIDEO_HTOTAL, VIDEO_VTOTAL, visarea, HZ_TO_ATTOSECONDS(VIDEO_CLOCK) * VIDEO_HTOTAL * VIDEO_VTOTAL);
}
break;
}
@@ -1367,14 +1367,14 @@ WRITE16_HANDLER( itech32_video_w )
READ16_HANDLER( itech32_video_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (offset == 0)
{
return (state->video[offset] & ~0x08) | 0x04 | 0x01;
}
else if (offset == 3)
{
- return 0xef;/*space->machine->primary_screen->vpos() - 1;*/
+ return 0xef;/*space->machine().primary_screen->vpos() - 1;*/
}
return state->video[offset];
@@ -1411,7 +1411,7 @@ WRITE32_HANDLER( itech020_video_w )
WRITE32_HANDLER( drivedge_zbuf_control_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->drivedge_zbuf_control[offset]);
}
@@ -1432,7 +1432,7 @@ READ32_HANDLER( itech020_video_r )
SCREEN_UPDATE( itech32 )
{
- itech32_state *state = screen->machine->driver_data<itech32_state>();
+ itech32_state *state = screen->machine().driver_data<itech32_state>();
int y;
/* loop over height */
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index fc68bad0106..5b501a155c4 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -138,11 +138,11 @@
*
*************************************/
-static void generate_interrupt(running_machine *machine, int state)
+static void generate_interrupt(running_machine &machine, int state)
{
itech8_update_interrupts(machine, -1, state, -1);
- if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", machine->primary_screen->vpos());
+ if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", machine.primary_screen->vpos());
}
@@ -164,7 +164,7 @@ static const struct tms34061_interface tms34061intf =
VIDEO_START( itech8 )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
/* initialize TMS34061 emulation */
tms34061_start(machine, &tms34061intf);
@@ -175,8 +175,8 @@ VIDEO_START( itech8 )
state->page_select = 0xc0;
/* fetch the GROM base */
- state->grom_base = machine->region("grom")->base();
- state->grom_size = machine->region("grom")->bytes();
+ state->grom_base = machine.region("grom")->base();
+ state->grom_size = machine.region("grom")->bytes();
}
@@ -189,7 +189,7 @@ VIDEO_START( itech8 )
WRITE8_HANDLER( itech8_palette_w )
{
- tlc34076_w(space->machine->device("tlc34076"), offset/2, data);
+ tlc34076_w(space->machine().device("tlc34076"), offset/2, data);
}
@@ -202,9 +202,9 @@ WRITE8_HANDLER( itech8_palette_w )
WRITE8_HANDLER( itech8_page_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
- logerror("%04x:display_page = %02X (%d)\n", cpu_get_pc(space->cpu), data, space->machine->primary_screen->vpos());
+ itech8_state *state = space->machine().driver_data<itech8_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
+ logerror("%04x:display_page = %02X (%d)\n", cpu_get_pc(space->cpu), data, space->machine().primary_screen->vpos());
state->page_select = data;
}
@@ -284,7 +284,7 @@ INLINE void consume_rle(itech8_state *state, int count)
static void perform_blit(address_space *space)
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
UINT8 *blitter_data = state->blitter_data;
offs_t addr = state->tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8);
@@ -305,7 +305,7 @@ static void perform_blit(address_space *space)
/* debugging */
if (FULL_LOGGING)
logerror("Blit: scan=%d src=%06x @ (%05x) for %dx%d ... flags=%02x\n",
- space->machine->primary_screen->vpos(),
+ space->machine().primary_screen->vpos(),
(*state->grom_bank << 16) | (BLITTER_ADDRHI << 8) | BLITTER_ADDRLO,
tms_state.regs[TMS34061_XYADDRESS] | ((tms_state.regs[TMS34061_XYOFFSET] & 0x300) << 8),
BLITTER_WIDTH, BLITTER_HEIGHT, BLITTER_FLAGS);
@@ -423,12 +423,12 @@ static void perform_blit(address_space *space)
static TIMER_CALLBACK( blitter_done )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
/* turn off blitting and generate an interrupt */
state->blit_in_progress = 0;
itech8_update_interrupts(machine, -1, -1, 1);
- if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", machine->primary_screen->vpos());
+ if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", machine.primary_screen->vpos());
}
@@ -441,7 +441,7 @@ static TIMER_CALLBACK( blitter_done )
READ8_HANDLER( itech8_blitter_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
int result = state->blitter_data[offset / 2];
static const char *const portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" };
@@ -454,7 +454,7 @@ READ8_HANDLER( itech8_blitter_r )
/* a read from offset 3 clears the interrupt and returns the status */
if (offset == 3)
{
- itech8_update_interrupts(space->machine, -1, -1, 0);
+ itech8_update_interrupts(space->machine(), -1, -1, 0);
if (state->blit_in_progress)
result |= 0x80;
else
@@ -463,7 +463,7 @@ READ8_HANDLER( itech8_blitter_r )
/* a read from offsets 12-15 return input port values */
if (offset >= 12 && offset <= 15)
- result = input_port_read_safe(space->machine, portnames[offset - 12], 0x00);
+ result = input_port_read_safe(space->machine(), portnames[offset - 12], 0x00);
return result;
}
@@ -471,7 +471,7 @@ READ8_HANDLER( itech8_blitter_r )
WRITE8_HANDLER( itech8_blitter_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
UINT8 *blitter_data = state->blitter_data;
struct tms34061_display &tms_state = state->tms_state;
@@ -506,7 +506,7 @@ WRITE8_HANDLER( itech8_blitter_w )
state->blit_in_progress = 1;
/* set a timer to go off when we're done */
- space->machine->scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), FUNC(blitter_done));
+ space->machine().scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), FUNC(blitter_done));
}
/* debugging */
@@ -560,7 +560,7 @@ READ8_HANDLER( itech8_tms34061_r )
WRITE8_HANDLER( grmatch_palette_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
/* set the palette control; examined in the scanline callback */
state->grmatch_palcontrol = data;
}
@@ -568,16 +568,16 @@ WRITE8_HANDLER( grmatch_palette_w )
WRITE8_HANDLER( grmatch_xscroll_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
/* update the X scroll value */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
state->grmatch_xscroll = data;
}
TIMER_DEVICE_CALLBACK( grmatch_palette_update )
{
- itech8_state *state = timer.machine->driver_data<itech8_state>();
+ itech8_state *state = timer.machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
/* if the high bit is set, we are supposed to latch the palette values */
if (state->grmatch_palcontrol & 0x80)
@@ -610,11 +610,11 @@ TIMER_DEVICE_CALLBACK( grmatch_palette_update )
SCREEN_UPDATE( itech8_2layer )
{
- itech8_state *state = screen->machine->driver_data<itech8_state>();
+ itech8_state *state = screen->machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
UINT32 page_offset;
int x, y;
- const rgb_t *pens = tlc34076_get_pens(screen->machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076"));
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@@ -622,7 +622,7 @@ SCREEN_UPDATE( itech8_2layer )
/* if we're blanked, just fill with black */
if (tms_state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -648,7 +648,7 @@ SCREEN_UPDATE( itech8_2layer )
SCREEN_UPDATE( itech8_grmatch )
{
- itech8_state *state = screen->machine->driver_data<itech8_state>();
+ itech8_state *state = screen->machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
UINT32 page_offset;
int x, y;
@@ -659,7 +659,7 @@ SCREEN_UPDATE( itech8_grmatch )
/* if we're blanked, just fill with black */
if (tms_state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -697,11 +697,11 @@ SCREEN_UPDATE( itech8_grmatch )
SCREEN_UPDATE( itech8_2page )
{
- itech8_state *state = screen->machine->driver_data<itech8_state>();
+ itech8_state *state = screen->machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
UINT32 page_offset;
int x, y;
- const rgb_t *pens = tlc34076_get_pens(screen->machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076"));
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@@ -709,7 +709,7 @@ SCREEN_UPDATE( itech8_2page )
/* if we're blanked, just fill with black */
if (tms_state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -730,11 +730,11 @@ SCREEN_UPDATE( itech8_2page )
SCREEN_UPDATE( itech8_2page_large )
{
- itech8_state *state = screen->machine->driver_data<itech8_state>();
+ itech8_state *state = screen->machine().driver_data<itech8_state>();
struct tms34061_display &tms_state = state->tms_state;
UINT32 page_offset;
int x, y;
- const rgb_t *pens = tlc34076_get_pens(screen->machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen->machine().device("tlc34076"));
/* first get the current display state */
tms34061_get_display_state(&tms_state);
@@ -742,7 +742,7 @@ SCREEN_UPDATE( itech8_2page_large )
/* if we're blanked, just fill with black */
if (tms_state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c
index aedb52399c8..c77385f1259 100644
--- a/src/mame/video/jack.c
+++ b/src/mame/video/jack.c
@@ -12,14 +12,14 @@
WRITE8_HANDLER( jack_videoram_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( jack_colorram_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -32,18 +32,18 @@ WRITE8_HANDLER( jack_paletteram_w )
READ8_HANDLER( jack_flipscreen_r )
{
- flip_screen_set(space->machine, offset);
+ flip_screen_set(space->machine(), offset);
return 0;
}
WRITE8_HANDLER( jack_flipscreen_w )
{
- flip_screen_set(space->machine, offset);
+ flip_screen_set(space->machine(), offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x18) << 5);
int color = state->colorram[tile_index] & 0x07;
@@ -60,13 +60,13 @@ static UINT32 tilemap_scan_cols_flipy( UINT32 col, UINT32 row, UINT32 num_cols,
VIDEO_START( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
}
-static void jack_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -89,7 +89,7 @@ static void jack_draw_sprites( running_machine *machine, bitmap_t *bitmap, const
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
num,
color,
flipx,flipy,
@@ -99,9 +99,9 @@ static void jack_draw_sprites( running_machine *machine, bitmap_t *bitmap, const
SCREEN_UPDATE( jack )
{
- jack_state *state = screen->machine->driver_data<jack_state>();
+ jack_state *state = screen->machine().driver_data<jack_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- jack_draw_sprites(screen->machine, bitmap, cliprect);
+ jack_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -114,7 +114,7 @@ PALETTE_INIT( joinem )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
bit0 = (color_prom[i] >> 0) & 0x01;
@@ -136,7 +136,7 @@ PALETTE_INIT( joinem )
static TILE_GET_INFO( joinem_get_bg_tile_info )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x03) << 8);
int color = (state->colorram[tile_index] & 0x38) >> 3;
@@ -145,13 +145,13 @@ static TILE_GET_INFO( joinem_get_bg_tile_info )
VIDEO_START( joinem )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->bg_tilemap = tilemap_create(machine, joinem_get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
}
-static void joinem_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -174,7 +174,7 @@ static void joinem_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
num,
color,
flipx,flipy,
@@ -184,8 +184,8 @@ static void joinem_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( joinem )
{
- jack_state *state = screen->machine->driver_data<jack_state>();
+ jack_state *state = screen->machine().driver_data<jack_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- joinem_draw_sprites(screen->machine, bitmap, cliprect);
+ joinem_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/jackal.c b/src/mame/video/jackal.c
index 3d418486140..5f62b187fd9 100644
--- a/src/mame/video/jackal.c
+++ b/src/mame/video/jackal.c
@@ -17,31 +17,31 @@ PALETTE_INIT( jackal )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x200);
+ machine.colortable = colortable_alloc(machine, 0x200);
for (i = 0; i < 0x100; i++)
{
UINT16 ctabentry = i | 0x100;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT16 ctabentry = color_prom[i - 0x100] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x200; i < 0x300; i++)
{
UINT16 ctabentry = (color_prom[i - 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- jackal_state *state = machine->driver_data<jackal_state>();
+ jackal_state *state = machine.driver_data<jackal_state>();
int i;
for (i = 0; i < 0x400; i += 2)
@@ -50,20 +50,20 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
-void jackal_mark_tile_dirty( running_machine *machine, int offset )
+void jackal_mark_tile_dirty( running_machine &machine, int offset )
{
- jackal_state *state = machine->driver_data<jackal_state>();
+ jackal_state *state = machine.driver_data<jackal_state>();
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *RAM = machine->region("master")->base();
+ UINT8 *RAM = machine.region("master")->base();
int attr = RAM[0x2000 + tile_index];
int code = RAM[0x2400 + tile_index] + ((attr & 0xc0) << 2) + ((attr & 0x30) << 6);
@@ -75,14 +75,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( jackal )
{
- jackal_state *state = machine->driver_data<jackal_state>();
+ jackal_state *state = machine.driver_data<jackal_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *RAM = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *RAM = machine.region("master")->base();
int i;
state->scrollram = &RAM[0x0020];
@@ -115,9 +115,9 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
-#define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
+#define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0);
-static void draw_sprites_region( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *sram, int length, int bank )
+static void draw_sprites_region( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *sram, int length, int bank )
{
int offs;
@@ -201,10 +201,10 @@ static void draw_sprites_region( running_machine *machine, bitmap_t *bitmap, con
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *RAM = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *RAM = machine.region("master")->base();
UINT8 *sr, *ss;
if (state->videoctrl[0x03] & 0x08)
@@ -224,8 +224,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( jackal )
{
- set_pens(screen->machine);
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ set_pens(screen->machine());
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/jagblit.c b/src/mame/video/jagblit.c
index f7bea23fe04..207b32ccdb8 100644
--- a/src/mame/video/jagblit.c
+++ b/src/mame/video/jagblit.c
@@ -130,7 +130,7 @@
} while (0)
#endif
-static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags)
+static void FUNCNAME(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags)
{
UINT32 a1_base = blitter_regs[A1_BASE];
INT32 a1_pitch = (A1FIXED & 3) ^ ((A1FIXED & 2) >> 1);
@@ -195,7 +195,7 @@ static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, U
{
if (LOG_BAD_BLITS)
{
- logerror("%s:Blit!\n", machine->describe_context());
+ logerror("%s:Blit!\n", machine.describe_context());
logerror(" a1_base = %08X\n", a1_base);
logerror(" a2_base = %08X\n", a2_base);
}
@@ -275,7 +275,7 @@ static void FUNCNAME(running_machine *machine, UINT32 command, UINT32 a1flags, U
if (LOG_BLITS)
{
- logerror("%s:Blit!\n", machine->describe_context());
+ logerror("%s:Blit!\n", machine.describe_context());
logerror(" a1_base = %08X\n", a1_base);
logerror(" a1_pitch = %d\n", a1_pitch);
logerror(" a1_psize = %d\n", 1 << ((A1FIXED >> 3) & 7));
diff --git a/src/mame/video/jagobj.c b/src/mame/video/jagobj.c
index 7854e8085bd..1f8195fcf46 100644
--- a/src/mame/video/jagobj.c
+++ b/src/mame/video/jagobj.c
@@ -24,7 +24,7 @@ static UINT8 *blend_y, *blend_cc;
*
*************************************/
-void jagobj_init(running_machine *machine)
+void jagobj_init(running_machine &machine)
{
int i;
@@ -567,7 +567,7 @@ INLINE UINT8 lookup_pixel(const UINT32 *src, int i, int pitch, int depth)
*
*************************************/
-static UINT32 *process_bitmap(running_machine *machine, UINT32 *objdata, int vc, int logit)
+static UINT32 *process_bitmap(running_machine &machine, UINT32 *objdata, int vc, int logit)
{
/* extract minimal data */
UINT32 upper = objdata[0];
@@ -747,7 +747,7 @@ static UINT32 *process_bitmap(running_machine *machine, UINT32 *objdata, int vc,
*
*************************************/
-static UINT32 *process_scaled_bitmap(running_machine *machine, UINT32 *objdata, int vc, int logit)
+static UINT32 *process_scaled_bitmap(running_machine &machine, UINT32 *objdata, int vc, int logit)
{
/* extract data */
UINT32 upper = objdata[0];
@@ -963,7 +963,7 @@ static UINT32 *process_scaled_bitmap(running_machine *machine, UINT32 *objdata,
*
*************************************/
-static UINT32 *process_branch(running_machine *machine, UINT32 *objdata, int vc, int logit)
+static UINT32 *process_branch(running_machine &machine, UINT32 *objdata, int vc, int logit)
{
UINT32 upper = objdata[0];
UINT32 lower = objdata[1];
@@ -1027,7 +1027,7 @@ static UINT32 *process_branch(running_machine *machine, UINT32 *objdata, int vc,
*
*************************************/
-static void process_object_list(running_machine *machine, int vc, UINT16 *_scanline)
+static void process_object_list(running_machine &machine, int vc, UINT16 *_scanline)
{
int done = 0, count = 0;
UINT32 *objdata;
diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c
index 14b5c060779..bd39e6d49d1 100644
--- a/src/mame/video/jaguar.c
+++ b/src/mame/video/jaguar.c
@@ -210,21 +210,21 @@ UINT8 blitter_status;
*************************************/
/* from jagobj.c */
-static void jagobj_init(running_machine *machine);
-static void process_object_list(running_machine *machine, int vc, UINT16 *_scanline);
+static void jagobj_init(running_machine &machine);
+static void process_object_list(running_machine &machine, int vc, UINT16 *_scanline);
/* from jagblit.c */
-static void generic_blitter(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_09800001_010020_010020(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_09800009_000020_000020(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800009_000028_000028(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800001_000018_000018(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01c00001_000018_000018(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void generic_blitter(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_09800001_010020_010020(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_09800009_000020_000020(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_01800009_000028_000028(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_01800001_000018_000018(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_01c00001_000018_000018(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
#ifdef MESS
-static void blitter_00010000_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_01800001_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
-static void blitter_x1800x01_xxxxxx_xxxxxx(running_machine *machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_00010000_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_01800001_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
+static void blitter_x1800x01_xxxxxx_xxxxxx(running_machine &machine, UINT32 command, UINT32 a1flags, UINT32 a2flags);
#endif
@@ -235,9 +235,9 @@ static void blitter_x1800x01_xxxxxx_xxxxxx(running_machine *machine, UINT32 comm
*
*************************************/
-INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
+INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *y)
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int width = visarea.max_x + 1 - visarea.min_x;
int height = visarea.max_y + 1 - visarea.min_y;
@@ -270,7 +270,7 @@ INLINE int effective_hvalue(int value)
*
*************************************/
-INLINE int adjust_object_timer(running_machine *machine, int vc)
+INLINE int adjust_object_timer(running_machine &machine, int vc)
{
int hdbpix[2];
int hdb = 0;
@@ -291,11 +291,11 @@ INLINE int adjust_object_timer(running_machine *machine, int vc)
hdb = hdbpix[vc % 2];
/* if setting the second one in a line, make sure we will ever actually hit it */
- if (vc % 2 == 1 && (hdbpix[1] == hdbpix[0] || hdbpix[1] >= machine->primary_screen->width()))
+ if (vc % 2 == 1 && (hdbpix[1] == hdbpix[0] || hdbpix[1] >= machine.primary_screen->width()))
return FALSE;
/* adjust the timer */
- object_timer->adjust(machine->primary_screen->time_until_pos(vc / 2, hdb), vc | (hdb << 16));
+ object_timer->adjust(machine.primary_screen->time_until_pos(vc / 2, hdb), vc | (hdb << 16));
return TRUE;
}
@@ -307,15 +307,15 @@ INLINE int adjust_object_timer(running_machine *machine, int vc)
*
*************************************/
-void jaguar_gpu_suspend(running_machine *machine)
+void jaguar_gpu_suspend(running_machine &machine)
{
- machine->device<cpu_device>("gpu")->suspend(SUSPEND_REASON_SPIN, 1);
+ machine.device<cpu_device>("gpu")->suspend(SUSPEND_REASON_SPIN, 1);
}
-void jaguar_gpu_resume(running_machine *machine)
+void jaguar_gpu_resume(running_machine &machine)
{
- machine->device<cpu_device>("gpu")->resume(SUSPEND_REASON_SPIN);
+ machine.device<cpu_device>("gpu")->resume(SUSPEND_REASON_SPIN);
}
@@ -326,7 +326,7 @@ void jaguar_gpu_resume(running_machine *machine)
*
*************************************/
-static void update_cpu_irq(running_machine *machine)
+static void update_cpu_irq(running_machine &machine)
{
if (cpu_irq_state & gpu_regs[INT1] & 0x1f)
cputag_set_input_line(machine, "maincpu", cojag_is_r3000 ? R3000_IRQ4 : M68K_IRQ_6, ASSERT_LINE);
@@ -338,14 +338,14 @@ static void update_cpu_irq(running_machine *machine)
void jaguar_gpu_cpu_int(device_t *device)
{
cpu_irq_state |= 2;
- update_cpu_irq(device->machine);
+ update_cpu_irq(device->machine());
}
void jaguar_dsp_cpu_int(device_t *device)
{
cpu_irq_state |= 16;
- update_cpu_irq(device->machine);
+ update_cpu_irq(device->machine());
}
@@ -491,9 +491,9 @@ static void jaguar_set_palette(UINT16 vmode)
*
*************************************/
-static UINT8 *get_jaguar_memory(running_machine *machine, UINT32 offset)
+static UINT8 *get_jaguar_memory(running_machine &machine, UINT32 offset)
{
- address_space *space = machine->device("gpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("gpu")->memory().space(AS_PROGRAM);
return (UINT8 *)space->get_read_ptr(offset);
}
@@ -505,7 +505,7 @@ static UINT8 *get_jaguar_memory(running_machine *machine, UINT32 offset)
*
*************************************/
-static void blitter_run(running_machine *machine)
+static void blitter_run(running_machine &machine)
{
UINT32 command = blitter_regs[B_CMD] & STATIC_COMMAND_MASK;
UINT32 a1flags = blitter_regs[A1_FLAGS] & STATIC_FLAGS_MASK;
@@ -628,8 +628,8 @@ WRITE32_HANDLER( jaguar_blitter_w )
if (offset == B_CMD)
{
blitter_status = 0;
- space->machine->scheduler().timer_set(attotime::from_usec(100), FUNC(blitter_done));
- blitter_run(space->machine);
+ space->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(blitter_done));
+ blitter_run(space->machine());
}
if (LOG_BLITTER_WRITE)
@@ -655,18 +655,18 @@ READ16_HANDLER( jaguar_tom_regs_r )
return cpu_irq_state;
case HC:
- return space->machine->primary_screen->hpos() % (space->machine->primary_screen->width() / 2);
+ return space->machine().primary_screen->hpos() % (space->machine().primary_screen->width() / 2);
case VC:
{
UINT8 half_line;
- if(space->machine->primary_screen->hpos() >= (space->machine->primary_screen->width() / 2))
+ if(space->machine().primary_screen->hpos() >= (space->machine().primary_screen->width() / 2))
half_line = 1;
else
half_line = 0;
- return space->machine->primary_screen->vpos() * 2 + half_line;
+ return space->machine().primary_screen->vpos() * 2 + half_line;
}
}
@@ -687,8 +687,8 @@ static TIMER_CALLBACK( jaguar_pit )
if (gpu_regs[PIT0])
{
- sample_period = attotime::from_nsec(((machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
- machine->scheduler().timer_set(sample_period, FUNC(jaguar_pit));
+ sample_period = attotime::from_nsec(((machine.device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
+ machine.scheduler().timer_set(sample_period, FUNC(jaguar_pit));
}
}
@@ -712,14 +712,14 @@ WRITE16_HANDLER( jaguar_tom_regs_w )
case PIT1:
if (gpu_regs[PIT0] && gpu_regs[PIT0] != 0xffff) //FIXME: avoid too much small timers for now
{
- sample_period = attotime::from_nsec(((space->machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
- space->machine->scheduler().timer_set(sample_period, FUNC(jaguar_pit));
+ sample_period = attotime::from_nsec(((space->machine().device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1]));
+ space->machine().scheduler().timer_set(sample_period, FUNC(jaguar_pit));
}
break;
case INT1:
cpu_irq_state &= ~(gpu_regs[INT1] >> 8);
- update_cpu_irq(space->machine);
+ update_cpu_irq(space->machine());
break;
case VMODE:
@@ -729,7 +729,7 @@ WRITE16_HANDLER( jaguar_tom_regs_w )
case OBF: /* clear GPU interrupt */
cpu_irq_state &= 0xfd;
- update_cpu_irq(space->machine);
+ update_cpu_irq(space->machine());
break;
case HP:
@@ -761,7 +761,7 @@ WRITE16_HANDLER( jaguar_tom_regs_w )
visarea.max_x = hbstart / 2 - 1;
visarea.min_y = vbend / 2;
visarea.max_y = vbstart / 2 - 1;
- space->machine->primary_screen->configure(hperiod / 2, vperiod / 2, visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod));
+ space->machine().primary_screen->configure(hperiod / 2, vperiod / 2, visarea, HZ_TO_ATTOSECONDS((double)COJAG_PIXEL_CLOCK * 2 / hperiod / vperiod));
}
}
break;
@@ -807,15 +807,15 @@ READ32_HANDLER( cojag_gun_input_r )
switch (offset)
{
case 0:
- get_crosshair_xy(space->machine, 1, &beamx, &beamy);
+ get_crosshair_xy(space->machine(), 1, &beamx, &beamy);
return (beamy << 16) | (beamx ^ 0x1ff);
case 1:
- get_crosshair_xy(space->machine, 0, &beamx, &beamy);
+ get_crosshair_xy(space->machine(), 0, &beamx, &beamy);
return (beamy << 16) | (beamx ^ 0x1ff);
case 2:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
return 0;
}
@@ -832,7 +832,7 @@ static TIMER_CALLBACK( cojag_scanline_update )
{
int vc = param & 0xffff;
int hdb = param >> 16;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/* only run if video is enabled and we are past the "display begin" */
if ((gpu_regs[VMODE] & 1) && vc >= (gpu_regs[VDB] & 0x7ff))
@@ -885,7 +885,7 @@ static TIMER_CALLBACK( cojag_scanline_update )
}
/* point to the next counter value */
- if (++vc / 2 >= machine->primary_screen->height())
+ if (++vc / 2 >= machine.primary_screen->height())
vc = 0;
} while (!adjust_object_timer(machine, vc));
@@ -902,7 +902,7 @@ VIDEO_START( cojag )
memset(&gpu_regs, 0, sizeof(gpu_regs));
cpu_irq_state = 0;
- object_timer = machine->scheduler().timer_alloc(FUNC(cojag_scanline_update));
+ object_timer = machine.scheduler().timer_alloc(FUNC(cojag_scanline_update));
adjust_object_timer(machine, 0);
screen_bitmap = auto_bitmap_alloc(machine, 760, 512, BITMAP_FORMAT_RGB32);
@@ -915,7 +915,7 @@ VIDEO_START( cojag )
state_save_register_global_array(machine, blitter_regs);
state_save_register_global_array(machine, gpu_regs);
state_save_register_global(machine, cpu_irq_state);
- machine->state().register_postload(cojag_postload, NULL);
+ machine.state().register_postload(cojag_postload, NULL);
}
diff --git a/src/mame/video/jailbrek.c b/src/mame/video/jailbrek.c
index cf7a4de7d73..e091a1ff164 100644
--- a/src/mame/video/jailbrek.c
+++ b/src/mame/video/jailbrek.c
@@ -6,7 +6,7 @@ PALETTE_INIT( jailbrek )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -15,7 +15,7 @@ PALETTE_INIT( jailbrek )
int g = pal4bit(color_prom[i + 0x00] >> 4);
int b = pal4bit(color_prom[i + 0x20] >> 0);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -24,33 +24,33 @@ PALETTE_INIT( jailbrek )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( jailbrek_videoram_w )
{
- jailbrek_state *state = space->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = space->machine().driver_data<jailbrek_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( jailbrek_colorram_w )
{
- jailbrek_state *state = space->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = space->machine().driver_data<jailbrek_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x0f;
@@ -60,14 +60,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( jailbrek )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scrolldx(state->bg_tilemap, 0, 396 - 256);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
UINT8 *spriteram = state->spriteram;
int i;
@@ -89,15 +89,15 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy,
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
SCREEN_UPDATE( jailbrek )
{
- jailbrek_state *state = screen->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = screen->machine().driver_data<jailbrek_state>();
int i;
// added support for vertical scrolling (credits). 23/1/2002 -BR
@@ -122,6 +122,6 @@ SCREEN_UPDATE( jailbrek )
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/jalblend.c b/src/mame/video/jalblend.c
index f0a4ca20c61..980631d6598 100644
--- a/src/mame/video/jalblend.c
+++ b/src/mame/video/jalblend.c
@@ -24,12 +24,12 @@ static void jal_blend_reset(running_machine &machine)
memset(jal_blend_table, 0, 0xc00);
}
-void jal_blend_init(running_machine *machine, int enable)
+void jal_blend_init(running_machine &machine, int enable)
{
if (enable)
{
jal_blend_table = auto_alloc_array_clear(machine, UINT8, 0xc00);
- machine->add_notifier(MACHINE_NOTIFY_RESET, jal_blend_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, jal_blend_reset);
}
else
{
@@ -97,7 +97,7 @@ void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle *clip,const gfx_elemen
/* Start drawing */
if (gfx)
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
int x_index_base, y_index, sx, sy, ex, ey;
diff --git a/src/mame/video/jalblend.h b/src/mame/video/jalblend.h
index 544de3a5dac..855841aed67 100644
--- a/src/mame/video/jalblend.h
+++ b/src/mame/video/jalblend.h
@@ -1,4 +1,4 @@
-void jal_blend_init(running_machine *machine, int enable);
+void jal_blend_init(running_machine &machine, int enable);
void jal_blend_set(int color, UINT8 val);
rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha);
diff --git a/src/mame/video/jedi.c b/src/mame/video/jedi.c
index 774a3852c6f..ef46a5ecdd9 100644
--- a/src/mame/video/jedi.c
+++ b/src/mame/video/jedi.c
@@ -30,7 +30,7 @@
static VIDEO_START( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* register for saving */
state->save_item(NAME(state->vscroll));
@@ -110,7 +110,7 @@ static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle *
WRITE8_HANDLER( jedi_vscroll_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->vscroll = data | (offset << 8);
}
@@ -118,7 +118,7 @@ WRITE8_HANDLER( jedi_vscroll_w )
WRITE8_HANDLER( jedi_hscroll_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->hscroll = data | (offset << 8);
}
@@ -132,15 +132,15 @@ WRITE8_HANDLER( jedi_hscroll_w )
*
*************************************/
-static void draw_background_and_text(running_machine *machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
{
int y;
int background_line_buffer[0x200]; /* RAM chip at 2A */
- UINT8 *tx_gfx = machine->region("gfx1")->base();
- UINT8 *bg_gfx = machine->region("gfx2")->base();
- UINT8 *prom1 = &machine->region("proms")->base()[0x0000 | ((*state->smoothing_table & 0x03) << 8)];
- UINT8 *prom2 = &machine->region("proms")->base()[0x0800 | ((*state->smoothing_table & 0x03) << 8)];
+ UINT8 *tx_gfx = machine.region("gfx1")->base();
+ UINT8 *bg_gfx = machine.region("gfx2")->base();
+ UINT8 *prom1 = &machine.region("proms")->base()[0x0000 | ((*state->smoothing_table & 0x03) << 8)];
+ UINT8 *prom2 = &machine.region("proms")->base()[0x0800 | ((*state->smoothing_table & 0x03) << 8)];
int vscroll = state->vscroll;
int hscroll = state->hscroll;
int tx_bank = *state->foreground_bank;
@@ -232,11 +232,11 @@ static void draw_background_and_text(running_machine *machine, jedi_state *state
*
*************************************/
-static void draw_sprites(running_machine *machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
{
offs_t offs;
UINT8 *spriteram = state->spriteram;
- UINT8 *gfx3 = machine->region("gfx3")->base();
+ UINT8 *gfx3 = machine.region("gfx3")->base();
for (offs = 0x00; offs < 0x30; offs++)
{
@@ -329,7 +329,7 @@ static void draw_sprites(running_machine *machine, jedi_state *state, bitmap_t *
static SCREEN_UPDATE( jedi )
{
- jedi_state *state = screen->machine->driver_data<jedi_state>();
+ jedi_state *state = screen->machine().driver_data<jedi_state>();
/* if no video, clear it all to black */
if (*state->video_off & 0x01)
@@ -338,8 +338,8 @@ static SCREEN_UPDATE( jedi )
{
/* draw the background/text layers, followed by the sprites
- it needs to be done in this order*/
- draw_background_and_text(screen->machine, state, bitmap, cliprect);
- draw_sprites(screen->machine, state, bitmap, cliprect);
+ draw_background_and_text(screen->machine(), state, bitmap, cliprect);
+ draw_sprites(screen->machine(), state, bitmap, cliprect);
do_pen_lookup(state, bitmap, cliprect);
}
diff --git a/src/mame/video/jpmimpct.c b/src/mame/video/jpmimpct.c
index 76dccb2f8fe..8c62d46c9b4 100644
--- a/src/mame/video/jpmimpct.c
+++ b/src/mame/video/jpmimpct.c
@@ -29,7 +29,7 @@
WRITE16_HANDLER( jpmimpct_bt477_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
UINT8 val = data & 0xff;
switch (offset)
@@ -49,7 +49,7 @@ WRITE16_HANDLER( jpmimpct_bt477_w )
if (++*addr_cnt == 3)
{
- palette_set_color(space->machine, state->bt477.address, MAKE_RGB(color[0], color[1], color[2]));
+ palette_set_color(space->machine(), state->bt477.address, MAKE_RGB(color[0], color[1], color[2]));
*addr_cnt = 0;
/* Address register increments */
@@ -89,13 +89,13 @@ READ16_HANDLER( jpmimpct_bt477_r )
void jpmimpct_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
memcpy(shiftreg, &state->vram[TOWORD(address)], 512 * sizeof(UINT16));
}
void jpmimpct_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
memcpy(&state->vram[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
}
@@ -108,7 +108,7 @@ void jpmimpct_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftr
void jpmimpct_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- jpmimpct_state *state = screen.machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = screen.machine().driver_data<jpmimpct_state>();
UINT16 *vram = &state->vram[(params->rowaddr << 8) & 0x3ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
int coladdr = params->coladdr;
@@ -117,8 +117,8 @@ void jpmimpct_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanl
for (x = params->heblnk; x < params->hsblnk; x += 2)
{
UINT16 pixels = vram[coladdr++ & 0xff];
- dest[x + 0] = screen.machine->pens[pixels & 0xff];
- dest[x + 1] = screen.machine->pens[pixels >> 8];
+ dest[x + 0] = screen.machine().pens[pixels & 0xff];
+ dest[x + 1] = screen.machine().pens[pixels >> 8];
}
}
@@ -131,7 +131,7 @@ void jpmimpct_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanl
VIDEO_START( jpmimpct )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
memset(&state->bt477, 0, sizeof(state->bt477));
state_save_register_global(machine, state->bt477.address);
diff --git a/src/mame/video/kan_panb.c b/src/mame/video/kan_panb.c
index 6a1bde97e63..50190ceb786 100644
--- a/src/mame/video/kan_panb.c
+++ b/src/mame/video/kan_panb.c
@@ -5,7 +5,7 @@
SCREEN_UPDATE( honeydol )
{
- UINT16 *spriteram16 = screen->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = screen->machine().generic.spriteram.u16;
int sx=0, sy=0, x=0, y=0, offs;
/* sprites clip on left / right edges when scrolling, but it seems correct,
no extra sprite attribute bits are set during this time, the sprite co-ordinates
@@ -31,7 +31,7 @@ SCREEN_UPDATE( honeydol )
x = dx;
y = dy;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 240 - x;
sy = 240 - y;
@@ -44,7 +44,7 @@ SCREEN_UPDATE( honeydol )
sy = y;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
tile,
tilecolour,
flipx, flipy,
@@ -62,7 +62,7 @@ SCREEN_UPDATE( honeydol )
x = dx;
y = dy;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 240 - x;
sy = 240 - y;
@@ -78,7 +78,7 @@ SCREEN_UPDATE( honeydol )
tilecolour = (tilecolour&0x03f0) >> 4;
tilecolour ^=0x3f; // unusual, but correct..
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
tilecolour,
flipx, flipy,
@@ -90,7 +90,7 @@ SCREEN_UPDATE( honeydol )
SCREEN_UPDATE( twinadv )
{
- UINT16 *spriteram16 = screen->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = screen->machine().generic.spriteram.u16;
int sx=0, sy=0, x=0, y=0, offs;
/* sprites clip on left / right edges when scrolling, but it seems correct,
no extra sprite attribute bits are set during this time, the sprite co-ordinates
@@ -117,7 +117,7 @@ SCREEN_UPDATE( twinadv )
x = dx;
y = dy;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 240 - x;
sy = 240 - y;
@@ -133,7 +133,7 @@ SCREEN_UPDATE( twinadv )
tilecolour = (tilecolour&0x00f0) >> 4;
tilecolour ^=0xf; // unusual, but correct..
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
tilecolour,
flipx, flipy,
@@ -145,12 +145,12 @@ SCREEN_UPDATE( twinadv )
SCREEN_UPDATE( wintbob )
{
- UINT16 *spriteram16 = screen->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = screen->machine().generic.spriteram.u16;
int offs;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
- for (offs = 0;offs < screen->machine->generic.spriteram_size/2;offs += 8)
+ for (offs = 0;offs < screen->machine().generic.spriteram_size/2;offs += 8)
{
int xpos = spriteram16[offs] & 0xff;
int ypos = spriteram16[offs+4] & 0xff;
@@ -165,7 +165,7 @@ SCREEN_UPDATE( wintbob )
if (wrapr == 8) xpos -= 256;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
xpos = 240 - xpos;
ypos = 240 - ypos;
@@ -175,7 +175,7 @@ SCREEN_UPDATE( wintbob )
if ((xpos > -16) && (ypos > 0) && (xpos < 256) && (ypos < 240) && (disbl !=2))
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tilen,
colr,
flipx, flipy,
@@ -188,7 +188,7 @@ SCREEN_UPDATE( wintbob )
SCREEN_UPDATE( snowbro3 )
{
- UINT16 *spriteram16 = screen->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = screen->machine().generic.spriteram.u16;
int sx=0, sy=0, x=0, y=0, offs;
/*
@@ -215,11 +215,11 @@ SCREEN_UPDATE( snowbro3 )
/* This clears & redraws the entire screen each pass */
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
- for (offs = 0;offs < screen->machine->generic.spriteram_size/2;offs += 8)
+ for (offs = 0;offs < screen->machine().generic.spriteram_size/2;offs += 8)
{
- gfx_element *gfx = screen->machine->gfx[0];
+ gfx_element *gfx = screen->machine().gfx[0];
int dx = spriteram16[offs+4] & 0xff;
int dy = spriteram16[offs+5] & 0xff;
int tilecolour = spriteram16[offs+3];
@@ -244,7 +244,7 @@ SCREEN_UPDATE( snowbro3 )
if (x > 511) x &= 0x1ff;
if (y > 511) y &= 0x1ff;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = 240 - x;
sy = 240 - y;
@@ -259,7 +259,7 @@ SCREEN_UPDATE( snowbro3 )
if (offs < 0x800) /* i guess this is the right way */
{
- gfx = screen->machine->gfx[1];
+ gfx = screen->machine().gfx[1];
tilecolour = 0x10;
}
diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c
index da568f8107f..7550a430775 100644
--- a/src/mame/video/kan_pand.c
+++ b/src/mame/video/kan_pand.c
@@ -162,7 +162,7 @@ static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle *c
y = dy;
}
- if (flip_screen_get(device->machine))
+ if (flip_screen_get(device->machine()))
{
sx = 240 - x;
sy = 240 - y;
@@ -187,7 +187,7 @@ static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle *c
if (sy & 0x100)
sy -= 0x200;
- drawgfx_transpen(bitmap,cliprect,device->machine->gfx[pandora->region],
+ drawgfx_transpen(bitmap,cliprect,device->machine().gfx[pandora->region],
tile,
(tilecolour & 0xf0) >> 4,
flipx, flipy,
@@ -301,13 +301,13 @@ static DEVICE_START( kaneko_pandora )
kaneko_pandora_state *pandora = get_safe_token(device);
const kaneko_pandora_interface *intf = get_interface(device);
- pandora->screen = device->machine->device<screen_device>(intf->screen);
+ pandora->screen = device->machine().device<screen_device>(intf->screen);
pandora->region = intf->gfx_region;
pandora->xoffset = intf->x;
pandora->yoffset = intf->y;
pandora->bg_pen = 0;
- pandora->spriteram = auto_alloc_array(device->machine, UINT8, 0x1000);
+ pandora->spriteram = auto_alloc_array(device->machine(), UINT8, 0x1000);
pandora->sprites_bitmap = pandora->screen->alloc_compatible_bitmap();
diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c
index a4a6314511a..a00bec4a12d 100644
--- a/src/mame/video/kaneko16.c
+++ b/src/mame/video/kaneko16.c
@@ -147,13 +147,13 @@ VIDEO_START( kaneko16_1xVIEW2_tilemaps )
kaneko16_tmap_3 = 0;
- sprites_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ sprites_bitmap = machine.primary_screen->alloc_compatible_bitmap();
{
int dx, dy;
- int xdim = machine->primary_screen->width();
- int ydim = machine->primary_screen->height();
+ int xdim = machine.primary_screen->width();
+ int ydim = machine.primary_screen->height();
switch (xdim)
{
@@ -161,7 +161,7 @@ VIDEO_START( kaneko16_1xVIEW2_tilemaps )
case 256: dx = 0x5b; break;
default: dx = 0;
}
- switch (machine->primary_screen->visible_area().max_y - machine->primary_screen->visible_area().min_y + 1)
+ switch (machine.primary_screen->visible_area().max_y - machine.primary_screen->visible_area().min_y + 1)
{
case 240- 8: dy = +0x08; break; /* blazeon */
case 240-16: dy = -0x08; break; /* berlwall, bakubrk */
@@ -203,8 +203,8 @@ VIDEO_START( kaneko16_2xVIEW2 )
{
int dx, dy;
- int xdim = machine->primary_screen->width();
- int ydim = machine->primary_screen->height();
+ int xdim = machine.primary_screen->width();
+ int ydim = machine.primary_screen->height();
switch (xdim)
{
@@ -212,7 +212,7 @@ VIDEO_START( kaneko16_2xVIEW2 )
case 256: dx = 0x5b; break;
default: dx = 0;
}
- switch (machine->primary_screen->visible_area().max_y - machine->primary_screen->visible_area().min_y + 1)
+ switch (machine.primary_screen->visible_area().max_y - machine.primary_screen->visible_area().min_y + 1)
{
case 240- 8: dy = +0x08; break;
case 240-16: dy = -0x08; break;
@@ -259,7 +259,7 @@ PALETTE_INIT( berlwall )
VIDEO_START( berlwall )
{
int sx, x,y;
- UINT8 *RAM = machine->region("gfx3")->base();
+ UINT8 *RAM = machine.region("gfx3")->base();
/* Render the hi-color static backgrounds held in the ROMs */
@@ -315,13 +315,13 @@ VIDEO_START( galsnew )
kaneko16_tmap_3 = 0;
- sprites_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ sprites_bitmap = machine.primary_screen->alloc_compatible_bitmap();
{
int dx = 0x5b, dy = 8;
- int xdim = machine->primary_screen->width();
- int ydim = machine->primary_screen->height();
+ int xdim = machine.primary_screen->width();
+ int ydim = machine.primary_screen->height();
tilemap_set_scrolldx( kaneko16_tmap_0, -dx, xdim + dx -1 );
tilemap_set_scrolldx( kaneko16_tmap_1, -(dx+2), xdim + (dx + 2) - 1 );
@@ -389,15 +389,15 @@ Offset: Format: Value:
#define USE_LATCHED_CODE 2
#define USE_LATCHED_COLOR 4
-static int kaneko16_parse_sprite_type012(running_machine *machine, int i, struct tempsprite *s)
+static int kaneko16_parse_sprite_type012(running_machine &machine, int i, struct tempsprite *s)
{
- UINT16 *spriteram16 = machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = machine.generic.spriteram.u16;
int attr, xoffs, offs;
if (kaneko16_sprite_type == 2) offs = i * 16/2 + 0x8/2;
else offs = i * 8/2;
- if (offs >= (machine->generic.spriteram_size/2)) return -1;
+ if (offs >= (machine.generic.spriteram_size/2)) return -1;
attr = spriteram16[offs + 0];
s->code = spriteram16[offs + 1];
@@ -426,12 +426,12 @@ static int kaneko16_parse_sprite_type012(running_machine *machine, int i, struct
if (kaneko16_sprite_flipy)
{
s->yoffs -= kaneko16_sprites_regs[0x2/2];
- s->yoffs -= machine->primary_screen->visible_area().min_y<<6;
+ s->yoffs -= machine.primary_screen->visible_area().min_y<<6;
}
else
{
s->yoffs -= kaneko16_sprites_regs[0x2/2];
- s->yoffs += machine->primary_screen->visible_area().min_y<<6;
+ s->yoffs += machine.primary_screen->visible_area().min_y<<6;
}
return ( (attr & 0x2000) ? USE_LATCHED_XY : 0 ) |
@@ -446,7 +446,7 @@ static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle *cli
{
pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16;
@@ -540,7 +540,7 @@ static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle *cli
/* Build a list of sprites to display & draw them */
-void kaneko16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Sprites *must* be parsed from the first in RAM to the last,
because of the multisprite feature. But they *must* be drawn
@@ -551,7 +551,7 @@ void kaneko16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rec
in a temp buffer, then draw the buffer's contents from last
to first. */
- int max = (machine->primary_screen->width() > 0x100) ? (0x200<<6) : (0x100<<6);
+ int max = (machine.primary_screen->width() > 0x100) ? (0x200<<6) : (0x100<<6);
int i = 0;
struct tempsprite *s = spritelist.first_sprite;
@@ -660,7 +660,7 @@ void kaneko16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rec
UINT32 primask = kaneko16_priority.sprite[curr_pri];
kaneko16_draw_sprites_custom(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
s->code,
s->color,
s->flipx, s->flipy,
@@ -866,7 +866,7 @@ WRITE16_HANDLER( kaneko16_bg15_reg_w )
***************************************************************************/
-static void kaneko16_prepare_first_tilemap_chip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kaneko16_prepare_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Set Up FIRST Tilemap chip */
int layers_flip_0;
@@ -906,7 +906,7 @@ static void kaneko16_prepare_first_tilemap_chip(running_machine *machine, bitmap
}
-static void kaneko16_prepare_second_tilemap_chip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kaneko16_prepare_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Set Up SECOND Tilemap chip */
int layers_flip_1 = 0;
@@ -945,13 +945,13 @@ static void kaneko16_prepare_second_tilemap_chip(running_machine *machine, bitma
}
}
-static void kaneko16_render_first_tilemap_chip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
+static void kaneko16_render_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
{
tilemap_draw_primask(bitmap,cliprect, kaneko16_tmap_0, pri, pri, 0);
tilemap_draw_primask(bitmap,cliprect, kaneko16_tmap_1, pri, pri, 0);
}
-static void kaneko16_render_second_tilemap_chip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
+static void kaneko16_render_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
{
if (kaneko16_tmap_2)
{
@@ -960,7 +960,7 @@ static void kaneko16_render_second_tilemap_chip(running_machine *machine, bitmap
}
}
-static void kaneko16_render_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kaneko16_render_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Sprites last (rendered with pdrawgfx, so they can slip
in between the layers) */
@@ -978,7 +978,7 @@ static void kaneko16_render_sprites(running_machine *machine, bitmap_t *bitmap,
}
}
-static void kaneko16_render_15bpp_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kaneko16_render_15bpp_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
if (kaneko16_bg15_bitmap)
{
@@ -998,7 +998,7 @@ static void kaneko16_render_15bpp_bitmap(running_machine *machine, bitmap_t *bit
}
}
-static void kaneko16_fill_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kaneko16_fill_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
if(kaneko16_sprite_type == 1)
bitmap_fill(bitmap,cliprect,0x7f00);
@@ -1013,15 +1013,15 @@ static SCREEN_UPDATE( common )
{
int i;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
- kaneko16_prepare_first_tilemap_chip(screen->machine, bitmap, cliprect);
- kaneko16_prepare_second_tilemap_chip(screen->machine, bitmap, cliprect);
+ kaneko16_prepare_first_tilemap_chip(screen->machine(), bitmap, cliprect);
+ kaneko16_prepare_second_tilemap_chip(screen->machine(), bitmap, cliprect);
for ( i = 0; i < 8; i++ )
{
- kaneko16_render_first_tilemap_chip(screen->machine,bitmap,cliprect,i);
- kaneko16_render_second_tilemap_chip(screen->machine,bitmap,cliprect,i);
+ kaneko16_render_first_tilemap_chip(screen->machine(),bitmap,cliprect,i);
+ kaneko16_render_second_tilemap_chip(screen->machine(),bitmap,cliprect,i);
}
return 0;
@@ -1030,13 +1030,13 @@ static SCREEN_UPDATE( common )
SCREEN_UPDATE(berlwall)
{
// berlwall uses a 15bpp bitmap as a bg, not a solid fill
- kaneko16_render_15bpp_bitmap(screen->machine,bitmap,cliprect);
+ kaneko16_render_15bpp_bitmap(screen->machine(),bitmap,cliprect);
// if the display is disabled, do nothing?
if (!kaneko16_disp_enable) return 0;
SCREEN_UPDATE_CALL(common);
- kaneko16_render_sprites(screen->machine,bitmap,cliprect);
+ kaneko16_render_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
@@ -1062,19 +1062,19 @@ SCREEN_UPDATE( jchan_view2 )
SCREEN_UPDATE( kaneko16 )
{
- kaneko16_fill_bitmap(screen->machine,bitmap,cliprect);
+ kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect);
// if the display is disabled, do nothing?
if (!kaneko16_disp_enable) return 0;
SCREEN_UPDATE_CALL(common);
- kaneko16_render_sprites(screen->machine,bitmap,cliprect);
+ kaneko16_render_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( galsnew )
{
-// kaneko16_fill_bitmap(screen->machine,bitmap,cliprect);
+// kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect);
int y,x;
int count;
@@ -1115,15 +1115,15 @@ SCREEN_UPDATE( galsnew )
SCREEN_UPDATE_CALL(common);
- kaneko16_render_sprites(screen->machine,bitmap,cliprect);
+ kaneko16_render_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( sandscrp )
{
- device_t *pandora = screen->machine->device("pandora");
- kaneko16_fill_bitmap(screen->machine,bitmap,cliprect);
+ device_t *pandora = screen->machine().device("pandora");
+ kaneko16_fill_bitmap(screen->machine(),bitmap,cliprect);
// if the display is disabled, do nothing?
if (!kaneko16_disp_enable) return 0;
diff --git a/src/mame/video/kangaroo.c b/src/mame/video/kangaroo.c
index 87140e67bbd..fa188320f8a 100644
--- a/src/mame/video/kangaroo.c
+++ b/src/mame/video/kangaroo.c
@@ -7,7 +7,7 @@
#include "emu.h"
#include "includes/kangaroo.h"
-static void blitter_execute(running_machine *machine);
+static void blitter_execute(running_machine &machine);
/*************************************
@@ -18,7 +18,7 @@ static void blitter_execute(running_machine *machine);
VIDEO_START( kangaroo )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
/* video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) */
state->videoram = auto_alloc_array(machine, UINT32, 256 * 64);
@@ -33,9 +33,9 @@ VIDEO_START( kangaroo )
*
*************************************/
-static void videoram_write( running_machine *machine, UINT16 offset, UINT8 data, UINT8 mask )
+static void videoram_write( running_machine &machine, UINT16 offset, UINT8 data, UINT8 mask )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
UINT32 expdata, layermask;
/* data contains 4 2-bit values packed as DCBADCBA; expand these into 4 8-bit values */
@@ -63,8 +63,8 @@ static void videoram_write( running_machine *machine, UINT16 offset, UINT8 data,
WRITE8_HANDLER( kangaroo_videoram_w )
{
- kangaroo_state *state = space->machine->driver_data<kangaroo_state>();
- videoram_write(space->machine, offset, data, state->video_control[8]);
+ kangaroo_state *state = space->machine().driver_data<kangaroo_state>();
+ videoram_write(space->machine(), offset, data, state->video_control[8]);
}
@@ -77,17 +77,17 @@ WRITE8_HANDLER( kangaroo_videoram_w )
WRITE8_HANDLER( kangaroo_video_control_w )
{
- kangaroo_state *state = space->machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = space->machine().driver_data<kangaroo_state>();
state->video_control[offset] = data;
switch (offset)
{
case 5: /* blitter start */
- blitter_execute(space->machine);
+ blitter_execute(space->machine());
break;
case 8: /* bank select */
- memory_set_bank(space->machine, "bank1", (data & 0x05) ? 0 : 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x05) ? 0 : 1);
break;
}
}
@@ -100,11 +100,11 @@ WRITE8_HANDLER( kangaroo_video_control_w )
*
*************************************/
-static void blitter_execute( running_machine *machine )
+static void blitter_execute( running_machine &machine )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
- UINT32 gfxhalfsize = machine->region("gfx1")->bytes() / 2;
- const UINT8 *gfxbase = machine->region("gfx1")->base();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
+ UINT32 gfxhalfsize = machine.region("gfx1")->bytes() / 2;
+ const UINT8 *gfxbase = machine.region("gfx1")->base();
UINT16 src = state->video_control[0] + 256 * state->video_control[1];
UINT16 dst = state->video_control[2] + 256 * state->video_control[3];
UINT8 height = state->video_control[5];
@@ -138,7 +138,7 @@ static void blitter_execute( running_machine *machine )
SCREEN_UPDATE( kangaroo )
{
- kangaroo_state *state = screen->machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = screen->machine().driver_data<kangaroo_state>();
UINT8 scrolly = state->video_control[6];
UINT8 scrollx = state->video_control[7];
UINT8 maska = (state->video_control[10] & 0x28) >> 3;
diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c
index d04fc3825bb..1e03df2d81f 100644
--- a/src/mame/video/karnov.c
+++ b/src/mame/video/karnov.c
@@ -39,7 +39,7 @@ PALETTE_INIT( karnov )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, bit3, r, g, b;
@@ -53,10 +53,10 @@ PALETTE_INIT( karnov )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine, i, MAKE_RGB(r, g, b));
@@ -64,16 +64,16 @@ PALETTE_INIT( karnov )
}
}
-void karnov_flipscreen_w( running_machine *machine, int data )
+void karnov_flipscreen_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->flipscreen = data;
tilemap_set_flip_all(machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
int my, mx, offs, color, tile, fx, fy;
int scrollx = state->scroll[0];
int scrolly = state->scroll[1];
@@ -99,10 +99,10 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
color = tile >> 12;
tile = tile & 0x7ff;
if (state->flipscreen)
- drawgfx_opaque(state->bitmap_f, 0, machine->gfx[1],tile,
+ drawgfx_opaque(state->bitmap_f, 0, machine.gfx[1],tile,
color, fx, fy, 496-16*mx,496-16*my);
else
- drawgfx_opaque(state->bitmap_f, 0, machine->gfx[1],tile,
+ drawgfx_opaque(state->bitmap_f, 0, machine.gfx[1],tile,
color, fx, fy, 16*mx,16*my);
}
@@ -120,10 +120,10 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
copyscrollbitmap(bitmap, state->bitmap_f, 1, &scrollx, 1, &scrolly, cliprect);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
int offs;
for (offs = 0; offs <0x800; offs += 4)
@@ -171,13 +171,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
else
sprite2 = sprite + 1;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
sprite,
colour,fx,fy,x,y,0);
/* 1 more sprite drawn underneath */
if (extra)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
sprite2,
colour,fx,fy,x,y+16,0);
}
@@ -187,9 +187,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( karnov )
{
- karnov_state *state = screen->machine->driver_data<karnov_state>();
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ karnov_state *state = screen->machine().driver_data<karnov_state>();
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
@@ -198,7 +198,7 @@ SCREEN_UPDATE( karnov )
static TILE_GET_INFO( get_fix_tile_info )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
int tile = state->videoram[tile_index];
SET_TILE_INFO(
0,
@@ -209,14 +209,14 @@ static TILE_GET_INFO( get_fix_tile_info )
WRITE16_HANDLER( karnov_videoram_w )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->fix_tilemap, offset);
}
WRITE16_HANDLER( karnov_playfield_swap_w )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
offset = ((offset & 0x1f) << 5) | ((offset & 0x3e0) >> 5);
COMBINE_DATA(&state->pf_data[offset]);
}
@@ -225,10 +225,10 @@ WRITE16_HANDLER( karnov_playfield_swap_w )
VIDEO_START( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Allocate bitmap & tilemap */
- state->bitmap_f = auto_bitmap_alloc(machine, 512, 512, machine->primary_screen->format());
+ state->bitmap_f = auto_bitmap_alloc(machine, 512, 512, machine.primary_screen->format());
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->save_item(NAME(*state->bitmap_f));
@@ -238,10 +238,10 @@ VIDEO_START( karnov )
VIDEO_START( wndrplnt )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Allocate bitmap & tilemap */
- state->bitmap_f = auto_bitmap_alloc(machine, 512, 512, machine->primary_screen->format());
+ state->bitmap_f = auto_bitmap_alloc(machine, 512, 512, machine.primary_screen->format());
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
state->save_item(NAME(*state->bitmap_f));
diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c
index df955dcf3cc..875ec30ce4a 100644
--- a/src/mame/video/kchamp.c
+++ b/src/mame/video/kchamp.c
@@ -14,11 +14,11 @@ PALETTE_INIT( kchamp )
{
int i, red, green, blue;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
red = color_prom[i];
- green = color_prom[machine->total_colors() + i];
- blue = color_prom[2 * machine->total_colors() + i];
+ green = color_prom[machine.total_colors() + i];
+ blue = color_prom[2 * machine.total_colors() + i];
palette_set_color_rgb(machine, i, pal4bit(red), pal4bit(green), pal4bit(blue));
}
@@ -26,26 +26,26 @@ PALETTE_INIT( kchamp )
WRITE8_HANDLER( kchamp_videoram_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( kchamp_colorram_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( kchamp_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 7) << 8);
int color = (state->colorram[tile_index] >> 3) & 0x1f;
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( kchamp )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -68,9 +68,9 @@ VIDEO_START( kchamp )
3 XXXXXXXX
*/
-static void kchamp_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void kchamp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -93,13 +93,13 @@ static void kchamp_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0);
}
}
-static void kchampvs_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -122,25 +122,25 @@ static void kchampvs_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[bank], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0);
}
}
SCREEN_UPDATE( kchamp )
{
- kchamp_state *state = screen->machine->driver_data<kchamp_state>();
+ kchamp_state *state = screen->machine().driver_data<kchamp_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- kchamp_draw_sprites(screen->machine, bitmap, cliprect);
+ kchamp_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( kchampvs )
{
- kchamp_state *state = screen->machine->driver_data<kchamp_state>();
+ kchamp_state *state = screen->machine().driver_data<kchamp_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- kchampvs_draw_sprites(screen->machine, bitmap, cliprect);
+ kchampvs_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/kickgoal.c b/src/mame/video/kickgoal.c
index fe2026a35ca..6e9d24ab7e3 100644
--- a/src/mame/video/kickgoal.c
+++ b/src/mame/video/kickgoal.c
@@ -6,21 +6,21 @@
WRITE16_HANDLER( kickgoal_fgram_w )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fgtm, offset / 2);
}
WRITE16_HANDLER( kickgoal_bgram_w )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bgtm, offset / 2);
}
WRITE16_HANDLER( kickgoal_bg2ram_w )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
state->bg2ram[offset] = data;
tilemap_mark_tile_dirty(state->bg2tm, offset / 2);
}
@@ -30,7 +30,7 @@ WRITE16_HANDLER( kickgoal_bg2ram_w )
/* FG */
static TILE_GET_INFO( get_kickgoal_fg_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->fgram[tile_index * 2] & 0x0fff;
int color = state->fgram[tile_index * 2 + 1] & 0x000f;
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_kickgoal_fg_tile_info )
/* BG */
static TILE_GET_INFO( get_kickgoal_bg_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->bgram[tile_index * 2] & 0x0fff;
int color = state->bgram[tile_index * 2 + 1] & 0x000f;
@@ -50,7 +50,7 @@ static TILE_GET_INFO( get_kickgoal_bg_tile_info )
/* BG 2 */
static TILE_GET_INFO( get_kickgoal_bg2_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->bg2ram[tile_index * 2] & 0x07ff;
int color = state->bg2ram[tile_index * 2 + 1] & 0x000f;
int flipx = state->bg2ram[tile_index * 2 + 1] & 0x0020;
@@ -80,7 +80,7 @@ static TILEMAP_MAPPER( tilemap_scan_kicksfg )
VIDEO_START( kickgoal )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->fgtm = tilemap_create(machine, get_kickgoal_fg_tile_info, tilemap_scan_kicksfg, 8, 16, 64, 64);
state->bgtm = tilemap_create(machine, get_kickgoal_bg_tile_info, tilemap_scan_kicksbg, 16, 32, 64, 64);
@@ -92,11 +92,11 @@ VIDEO_START( kickgoal )
-static void kickgoal_draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
UINT16 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
int offs;
for (offs = 0; offs < state->spriteram_size / 2; offs += 4)
@@ -124,7 +124,7 @@ static void kickgoal_draw_sprites( running_machine *machine, bitmap_t *bitmap,co
SCREEN_UPDATE( kickgoal )
{
- kickgoal_state *state = screen->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = screen->machine().driver_data<kickgoal_state>();
/* set scroll */
tilemap_set_scrollx(state->fgtm, 0, state->scrram[0]);
@@ -138,7 +138,7 @@ SCREEN_UPDATE( kickgoal )
tilemap_draw(bitmap, cliprect, state->bg2tm, 0, 0);
tilemap_draw(bitmap, cliprect, state->bgtm, 0, 0);
- kickgoal_draw_sprites(screen->machine, bitmap, cliprect);
+ kickgoal_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fgtm, 0, 0);
@@ -161,7 +161,7 @@ SCREEN_UPDATE( kickgoal )
/* FG */
static TILE_GET_INFO( get_actionhw_fg_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->fgram[tile_index * 2] & 0x0fff;
int color = state->fgram[tile_index * 2 + 1] & 0x000f;
@@ -171,7 +171,7 @@ static TILE_GET_INFO( get_actionhw_fg_tile_info )
/* BG */
static TILE_GET_INFO( get_actionhw_bg_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->bgram[tile_index * 2] & 0x1fff;
int color = state->bgram[tile_index * 2 + 1] & 0x000f;
int flipx = state->bgram[tile_index * 2 + 1] & 0x0020;
@@ -183,7 +183,7 @@ static TILE_GET_INFO( get_actionhw_bg_tile_info )
/* BG 2 */
static TILE_GET_INFO( get_actionhw_bg2_tile_info )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
int tileno = state->bg2ram[tile_index * 2] & 0x1fff;
int color = state->bg2ram[tile_index * 2 + 1] & 0x000f;
int flipx = state->bg2ram[tile_index * 2 + 1] & 0x0020;
@@ -214,7 +214,7 @@ static TILEMAP_MAPPER( tilemap_scan_actionhwfg )
VIDEO_START( actionhw )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->fgtm = tilemap_create(machine, get_actionhw_fg_tile_info, tilemap_scan_actionhwfg, 8, 8, 64, 64);
state->bgtm = tilemap_create(machine, get_actionhw_bg_tile_info, tilemap_scan_actionhwbg, 16, 16, 64, 64);
@@ -225,11 +225,11 @@ VIDEO_START( actionhw )
}
-static void actionhw_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
UINT16 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
int offs;
for (offs = 0; offs < state->spriteram_size / 2; offs += 4)
@@ -255,7 +255,7 @@ static void actionhw_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( actionhw )
{
- kickgoal_state *state = screen->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = screen->machine().driver_data<kickgoal_state>();
/* set scroll */
tilemap_set_scrollx(state->fgtm, 0, state->scrram[0]);
tilemap_set_scrolly(state->fgtm, 0, state->scrram[1]);
@@ -268,7 +268,7 @@ SCREEN_UPDATE( actionhw )
tilemap_draw(bitmap, cliprect, state->bg2tm, 0, 0);
tilemap_draw(bitmap, cliprect, state->bgtm, 0, 0);
- actionhw_draw_sprites(screen->machine, bitmap, cliprect);
+ actionhw_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fgtm, 0, 0);
return 0;
diff --git a/src/mame/video/kingobox.c b/src/mame/video/kingobox.c
index fe43b55987d..9ec8ad08af5 100644
--- a/src/mame/video/kingobox.c
+++ b/src/mame/video/kingobox.c
@@ -23,7 +23,7 @@
***************************************************************************/
-static void palette_init_common( running_machine *machine, const UINT8 *color_prom, void (*get_rgb_data)(const UINT8 *, int, int *, int *, int *) )
+static void palette_init_common( running_machine &machine, const UINT8 *color_prom, void (*get_rgb_data)(const UINT8 *, int, int *, int *, int *) )
{
static const int resistances[4] = { 1500, 750, 360, 180 };
static const int resistances_fg[1] = { 51 };
@@ -43,7 +43,7 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x108);
+ machine.colortable = colortable_alloc(machine, 0x108);
for (i = 0; i < 0x100; i++)
{
@@ -74,7 +74,7 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
bit3 = (b_data >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* the foreground chars directly map to primary colors */
@@ -91,16 +91,16 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
/* blue component */
b = (((i - 0x100) >> 0) & 0x01) * bweights_fg[0];
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
for (i = 0x101; i < 0x110; i += 2)
{
UINT16 ctabentry = ((i - 0x101) >> 1) | 0x100;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -133,35 +133,35 @@ PALETTE_INIT( ringking )
WRITE8_HANDLER( kingofb_videoram_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( kingofb_colorram_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( kingofb_videoram2_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( kingofb_colorram2_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( kingofb_f800_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
state->nmi_enable = data & 0x20;
if (state->palette_bank != ((data & 0x18) >> 3))
@@ -170,16 +170,16 @@ WRITE8_HANDLER( kingofb_f800_w )
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
int attr = state->colorram[tile_index];
int bank = ((attr & 0x04) >> 2) + 2;
int code = (tile_index / 16) ? state->videoram[tile_index] + ((attr & 0x03) << 8) : 0;
@@ -190,7 +190,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
int attr = state->colorram2[tile_index];
int bank = (attr & 0x02) >> 1;
int code = state->videoram2[tile_index] + ((attr & 0x01) << 8);
@@ -201,16 +201,16 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( kingofb )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_y, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols_flip_y, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void kingofb_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -239,7 +239,7 @@ static void kingofb_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2 + bank],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -248,11 +248,11 @@ static void kingofb_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( kingofb )
{
- kingofb_state *state = screen->machine->driver_data<kingofb_state>();
+ kingofb_state *state = screen->machine().driver_data<kingofb_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, -(*state->scroll_y));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- kingofb_draw_sprites(screen->machine, bitmap, cliprect);
+ kingofb_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -261,7 +261,7 @@ SCREEN_UPDATE( kingofb )
static TILE_GET_INFO( ringking_get_bg_tile_info )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
int code = (tile_index / 16) ? state->videoram[tile_index] : 0;
int color = ((state->colorram[tile_index] & 0x70) >> 4) + 8 * state->palette_bank;
@@ -270,16 +270,16 @@ static TILE_GET_INFO( ringking_get_bg_tile_info )
VIDEO_START( ringking )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
state->bg_tilemap = tilemap_create(machine, ringking_get_bg_tile_info, tilemap_scan_cols_flip_y, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols_flip_y, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void ringking_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -301,7 +301,7 @@ static void ringking_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2 + bank],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2 + bank],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -310,11 +310,11 @@ static void ringking_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( ringking )
{
- kingofb_state *state = screen->machine->driver_data<kingofb_state>();
+ kingofb_state *state = screen->machine().driver_data<kingofb_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, -(*state->scroll_y));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- ringking_draw_sprites(screen->machine, bitmap, cliprect);
+ ringking_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/klax.c b/src/mame/video/klax.c
index c192f5dae99..338f7f4d454 100644
--- a/src/mame/video/klax.c
+++ b/src/mame/video/klax.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x1fff;
@@ -71,7 +71,7 @@ VIDEO_START( klax )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,32);
@@ -102,7 +102,7 @@ WRITE16_HANDLER( klax_latch_w )
SCREEN_UPDATE( klax )
{
- klax_state *state = screen->machine->driver_data<klax_state>();
+ klax_state *state = screen->machine().driver_data<klax_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/kncljoe.c b/src/mame/video/kncljoe.c
index 9e66b0ba17f..5c3a6cd2b4b 100644
--- a/src/mame/video/kncljoe.c
+++ b/src/mame/video/kncljoe.c
@@ -19,7 +19,7 @@ PALETTE_INIT( kncljoe )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x90);
+ machine.colortable = colortable_alloc(machine, 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -28,7 +28,7 @@ PALETTE_INIT( kncljoe )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -54,7 +54,7 @@ PALETTE_INIT( kncljoe )
bit2 = (color_prom[(i - 0x80) + 0x300] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -62,13 +62,13 @@ PALETTE_INIT( kncljoe )
/* chars */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprite lookup table */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -82,7 +82,7 @@ PALETTE_INIT( kncljoe )
static TILE_GET_INFO( get_bg_tile_info )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
int attr = state->videoram[2 * tile_index + 1];
int code = state->videoram[2 * tile_index] + ((attr & 0xc0) << 2) + (state->tile_bank << 10);
@@ -103,7 +103,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( kncljoe )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 4);
@@ -119,14 +119,14 @@ VIDEO_START( kncljoe )
WRITE8_HANDLER( kncljoe_videoram_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( kncljoe_control_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
int i;
/*
0x01 screen flip
@@ -139,10 +139,10 @@ WRITE8_HANDLER( kncljoe_control_w )
set after IN0 - Coin 1 goes high AND the credit has been added
*/
state->flipscreen = data & 0x01;
- tilemap_set_flip_all(space->machine, state->flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? TILEMAP_FLIPX : TILEMAP_FLIPY);
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x20);
i = (data & 0x10) >> 4;
if (state->tile_bank != i)
@@ -155,13 +155,13 @@ WRITE8_HANDLER( kncljoe_control_w )
if (state->sprite_bank != i)
{
state->sprite_bank = i;
- memset(space->machine->region("maincpu")->base() + 0xf100, 0, 0x180);
+ memset(space->machine().region("maincpu")->base() + 0xf100, 0, 0x180);
}
}
WRITE8_HANDLER( kncljoe_scroll_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
int scrollx;
state->scrollregs[offset] = data;
@@ -180,15 +180,15 @@ WRITE8_HANDLER( kncljoe_scroll_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
UINT8 *spriteram = state->spriteram;
rectangle clip = *cliprect;
- const gfx_element *gfx = machine->gfx[1 + state->sprite_bank];
+ const gfx_element *gfx = machine.gfx[1 + state->sprite_bank];
int i, j;
static const int pribase[4]={0x0180, 0x0080, 0x0100, 0x0000};
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/* score covers sprites */
if (state->flipscreen)
@@ -240,9 +240,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( kncljoe )
{
- kncljoe_state *state = screen->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = screen->machine().driver_data<kncljoe_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c
index e126ee126fc..8c70b15d6c9 100644
--- a/src/mame/video/konamigx.c
+++ b/src/mame/video/konamigx.c
@@ -46,7 +46,7 @@ static tilemap_t* gx_psac_tilemap_alt;
static int konamigx_has_dual_screen;
int konamigx_current_frame;
-INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data);
+INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data);
static int konamigx_palformat;
static bitmap_t* dualscreen_left_tempbitmap;
static bitmap_t* dualscreen_right_tempbitmap;
@@ -72,7 +72,7 @@ static bitmap_t *gxtype1_roz_dstbitmap;
static bitmap_t *gxtype1_roz_dstbitmap2;
static rectangle gxtype1_roz_dstbitmapclip;
-static void (*game_tile_callback)(running_machine *machine, int layer, int *code, int *color, int *flags);
+static void (*game_tile_callback)(running_machine &machine, int layer, int *code, int *color, int *flags);
// Localized K053936/ROZ+
#define K053936_MAX_CHIPS 2
@@ -95,7 +95,7 @@ void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy)
cliprect->max_y = maxy;
}
-INLINE void K053936GP_copyroz32clip( running_machine *machine,
+INLINE void K053936GP_copyroz32clip( running_machine &machine,
bitmap_t *dst_bitmap, bitmap_t *src_bitmap,
const rectangle *dst_cliprect, const rectangle *src_cliprect,
UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy,
@@ -151,7 +151,7 @@ INLINE void K053936GP_copyroz32clip( running_machine *machine,
ecx = tx = -tx;
tilebpp = (tilebpp-1) & 7;
- pal_base = machine->pens;
+ pal_base = machine.pens;
cmask = colormask[tilebpp];
src_pitch = src_bitmap->rowpixels;
@@ -280,7 +280,7 @@ INLINE void K053936GP_copyroz32clip( running_machine *machine,
}
// adapted from generic K053936_zoom_draw()
-static void K053936GP_zoom_draw(running_machine *machine,
+static void K053936GP_zoom_draw(running_machine &machine,
int chip, UINT16 *ctrl, UINT16 *linectrl,
bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap,
int tilebpp, int blend, int alpha, int pixeldouble_output)
@@ -352,13 +352,13 @@ static void K053936GP_zoom_draw(running_machine *machine,
}
}
-static void K053936GP_0_zoom_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
{
K053936GP_zoom_draw(machine, 0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
}
-static void K053936GP_1_zoom_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
{
K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
@@ -449,8 +449,8 @@ INLINE void zdrawgfxzoom32GP(
src_fh = 16;
src_base = gfx_element_get_data(gfx, code % gfx->total_elements);
- pal_base = gfx->machine->pens + gfx->color_base + (color % gfx->total_colors) * granularity;
- shd_base = gfx->machine->shadow_table;
+ pal_base = gfx->machine().pens + gfx->color_base + (color % gfx->total_colors) * granularity;
+ shd_base = gfx->machine().shadow_table;
dst_ptr = (UINT32 *)bitmap->base;
dst_pitch = bitmap->rowpixels;
@@ -923,7 +923,7 @@ INLINE int K055555GX_decode_inpri(int c18) // (see p.59 7.2.2)
return(c18 | op);
}
-static void konamigx_type2_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void konamigx_type2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
int num = *code;
int c18 = *color;
@@ -934,7 +934,7 @@ static void konamigx_type2_sprite_callback(running_machine *machine, int *code,
*priority = K055555GX_decode_inpri(c18);
}
-static void konamigx_dragoonj_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void konamigx_dragoonj_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
int num, op, pri, c18;
@@ -952,7 +952,7 @@ static void konamigx_dragoonj_sprite_callback(running_machine *machine, int *cod
*color = K055555GX_decode_objcolor(c18);
}
-static void konamigx_salmndr2_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void konamigx_salmndr2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
int num, op, pri, c18;
@@ -970,7 +970,7 @@ static void konamigx_salmndr2_sprite_callback(running_machine *machine, int *cod
*color = K055555GX_decode_objcolor(c18);
}
-static void konamigx_le2_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void konamigx_le2_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
int num, op, pri;
@@ -1056,9 +1056,9 @@ int K055555GX_decode_osmixcolor(int layer, int *color) // (see p.63, p.49-50 and
}
#endif
-static void gx_wipezbuf(running_machine *machine, int noshadow)
+static void gx_wipezbuf(running_machine &machine, int noshadow)
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int w = visarea.max_x - visarea.min_x + 1;
int h = visarea.max_y - visarea.min_y + 1;
@@ -1116,7 +1116,7 @@ static int gx_objdma, gx_primode;
// mirrored K053247 and K054338 settings
UINT16 *K053247_ram;
static gfx_element *K053247_gfx;
-static void (*K053247_callback)(running_machine *machine, int *code,int *color,int *priority);
+static void (*K053247_callback)(running_machine &machine, int *code,int *color,int *priority);
static int K053247_dx, K053247_dy;
static int *K054338_shdRGB;
@@ -1128,12 +1128,12 @@ static void K053247GP_set_SpriteOffset(int offsx, int offsy)
K053247_dy = offsy;
}
-void konamigx_mixer_init(running_machine *machine, int objdma)
+void konamigx_mixer_init(running_machine &machine, int objdma)
{
gx_objdma = 0;
gx_primode = 0;
- gx_objzbuf = (UINT8 *)machine->priority_bitmap->base;
+ gx_objzbuf = (UINT8 *)machine.priority_bitmap->base;
gx_shdzbuf = auto_alloc_array(machine, UINT8, GX_ZBUFSIZE);
gx_objpool = auto_alloc_array(machine, struct GX_OBJ, GX_MAX_OBJECTS);
@@ -1162,7 +1162,7 @@ void konamigx_objdma(void)
if (gx_objdma && gx_spriteram && K053247_ram) memcpy(gx_spriteram, K053247_ram, 0x1000);
}
-void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
tilemap_t *sub1, int sub1flags,
tilemap_t *sub2, int sub2flags,
int mixerflags, bitmap_t *extra_bitmap, int rushingheroes_hack)
@@ -1497,7 +1497,7 @@ void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle
}
// traverse draw list
- screenwidth = machine->primary_screen->width();
+ screenwidth = machine.primary_screen->width();
for (count=0; count<nobj; count++)
{
@@ -1578,7 +1578,7 @@ void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle
if (offs == -2)
{
int pixeldouble_output = 0;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int width = visarea.max_x - visarea.min_x + 1;
if (width>512) // vsnetscr case
@@ -1621,9 +1621,9 @@ void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle
if (extra_bitmap) // soccer superstars roz layer
{
int xx,yy;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
- const pen_t *paldata = machine->pens;
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
+ const pen_t *paldata = machine.pens;
// the output size of the roz layer has to be doubled horizontally
// so that it aligns with the sprites and normal tilemaps. This appears
@@ -1868,7 +1868,7 @@ WRITE32_HANDLER( konamigx_type3_psac2_bank_w )
static TILE_GET_INFO( get_gx_psac3_tile_info )
{
int tileno, colour, flip;
- UINT8 *tmap = machine->region("gfx4")->base();
+ UINT8 *tmap = machine.region("gfx4")->base();
int base_index = tile_index;
@@ -1889,7 +1889,7 @@ WRITE32_HANDLER( konamigx_type3_psac2_bank_w )
static TILE_GET_INFO( get_gx_psac3_alt_tile_info )
{
int tileno, colour, flip;
- UINT8 *tmap = machine->region("gfx4")->base()+0x20000;
+ UINT8 *tmap = machine.region("gfx4")->base()+0x20000;
int base_index = tile_index;
@@ -1955,7 +1955,7 @@ static TILE_GET_INFO( get_gx_psac1b_tile_info )
SET_TILE_INFO(0, tileno, colour, flip);
}
-static void konamigx_type2_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void konamigx_type2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
int d = *code;
@@ -1963,7 +1963,7 @@ static void konamigx_type2_tile_callback(running_machine *machine, int layer, in
K055555GX_decode_vmixcolor(layer, color);
}
-static void konamigx_alpha_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void konamigx_alpha_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
int mixcode;
int d = *code;
@@ -2012,7 +2012,7 @@ static void konamigx_alpha_tile_callback(running_machine *machine, int layer, in
> so, well, the top bits of the code are suspicious
*/
-static void _gxcommoninitnosprites(running_machine *machine)
+static void _gxcommoninitnosprites(running_machine &machine)
{
int i;
@@ -2049,7 +2049,7 @@ static void _gxcommoninitnosprites(running_machine *machine)
konamigx_current_frame = 0;
}
-static void _gxcommoninit(running_machine *machine)
+static void _gxcommoninit(running_machine &machine)
{
// (+ve values move objects to the right and -ve values move objects to the left)
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX, -26, -23, konamigx_type2_sprite_callback);
@@ -2060,7 +2060,7 @@ static void _gxcommoninit(running_machine *machine)
VIDEO_START(konamigx_5bpp)
{
- if (!strcmp(machine->system().name,"sexyparo") || !strcmp(machine->system().name,"sexyparoa"))
+ if (!strcmp(machine.system().name,"sexyparo") || !strcmp(machine.system().name,"sexyparoa"))
game_tile_callback = konamigx_alpha_tile_callback;
else
game_tile_callback = konamigx_type2_tile_callback;
@@ -2072,29 +2072,29 @@ VIDEO_START(konamigx_5bpp)
/* here are some hand tuned per game scroll offsets to go with the per game visible areas,
i see no better way of doing this for now... */
- if (!strcmp(machine->system().name,"tbyahhoo"))
+ if (!strcmp(machine.system().name,"tbyahhoo"))
{
K056832_set_UpdateMode(1);
gx_tilemode = 1;
} else
- if (!strcmp(machine->system().name,"puzldama"))
+ if (!strcmp(machine.system().name,"puzldama"))
{
K053247GP_set_SpriteOffset(-46, -23);
konamigx_mixer_primode(5);
} else
- if (!strcmp(machine->system().name,"daiskiss"))
+ if (!strcmp(machine.system().name,"daiskiss"))
{
konamigx_mixer_primode(4);
} else
- if (!strcmp(machine->system().name,"gokuparo") || !strcmp(machine->system().name,"fantjour") || !strcmp(machine->system().name,"fantjoura"))
+ if (!strcmp(machine.system().name,"gokuparo") || !strcmp(machine.system().name,"fantjour") || !strcmp(machine.system().name,"fantjoura"))
{
K053247GP_set_SpriteOffset(-46, -23);
} else
- if (!strcmp(machine->system().name,"sexyparo") || !strcmp(machine->system().name,"sexyparoa"))
+ if (!strcmp(machine.system().name,"sexyparo") || !strcmp(machine.system().name,"sexyparoa"))
{
K053247GP_set_SpriteOffset(-42, -23);
}
@@ -2140,7 +2140,7 @@ VIDEO_START(konamigx_6bpp)
_gxcommoninit(machine);
- if (!strcmp(machine->system().name,"tokkae") || !strcmp(machine->system().name,"tkmmpzdm"))
+ if (!strcmp(machine.system().name,"tokkae") || !strcmp(machine.system().name,"tkmmpzdm"))
{
K053247GP_set_SpriteOffset(-46, -23);
konamigx_mixer_primode(5);
@@ -2149,8 +2149,8 @@ VIDEO_START(konamigx_6bpp)
VIDEO_START(konamigx_type3)
{
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
K056832_vh_start(machine, "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 1);
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
@@ -2188,8 +2188,8 @@ VIDEO_START(konamigx_type3)
VIDEO_START(konamigx_type4)
{
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro
@@ -2219,8 +2219,8 @@ VIDEO_START(konamigx_type4)
VIDEO_START(konamigx_type4_vsn)
{
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 2); // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback);
@@ -2249,8 +2249,8 @@ VIDEO_START(konamigx_type4_vsn)
VIDEO_START(konamigx_type4_sd2)
{
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
K056832_vh_start(machine, "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0);
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback);
@@ -2285,7 +2285,7 @@ VIDEO_START(konamigx_6bpp_2)
{
K056832_vh_start(machine, "gfx1", K056832_BPP_6, 1, NULL, konamigx_type2_tile_callback, 0);
- if (!strcmp(machine->system().name,"salmndr2") || !strcmp(machine->system().name,"salmndr2a"))
+ if (!strcmp(machine.system().name,"salmndr2") || !strcmp(machine.system().name,"salmndr2a"))
{
K055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback);
@@ -2334,7 +2334,7 @@ VIDEO_START(opengolf)
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
- machine->priority_bitmap = auto_bitmap_alloc(machine,2048,2048,BITMAP_FORMAT_INDEXED16);
+ machine.priority_bitmap = auto_bitmap_alloc(machine,2048,2048,BITMAP_FORMAT_INDEXED16);
}
@@ -2375,7 +2375,7 @@ VIDEO_START(racinfrc)
// urgh.. the priority bitmap is global, and because our temp bitmaps are bigger than the screen, this causes issues.. so just allocate something huge
// until there is a better solution, or priority bitmap can be specified manually.
- machine->priority_bitmap = auto_bitmap_alloc(machine,2048,2048,BITMAP_FORMAT_INDEXED16);
+ machine.priority_bitmap = auto_bitmap_alloc(machine,2048,2048,BITMAP_FORMAT_INDEXED16);
}
@@ -2387,8 +2387,8 @@ SCREEN_UPDATE(konamigx)
if (konamigx_has_dual_screen)
{
- device_t *left_screen = screen->machine->device("screen");
- device_t *right_screen = screen->machine->device("screen2");
+ device_t *left_screen = screen->machine().device("screen");
+ device_t *right_screen = screen->machine().device("screen2");
/* the video gets demuxed by a board which plugs into the jamma connector */
if (screen==left_screen)
@@ -2403,10 +2403,10 @@ SCREEN_UPDATE(konamigx)
{
for (offset=0;offset<0x4000/4;offset++)
{
- UINT32 coldat = screen->machine->generic.paletteram.u32[offset];
+ UINT32 coldat = screen->machine().generic.paletteram.u32[offset];
- set_color_555(screen->machine, offset*2, 0, 5, 10,coldat >> 16);
- set_color_555(screen->machine, offset*2+1, 0, 5, 10,coldat & 0xffff);
+ set_color_555(screen->machine(), offset*2, 0, 5, 10,coldat >> 16);
+ set_color_555(screen->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
}
}
else
@@ -2415,11 +2415,11 @@ SCREEN_UPDATE(konamigx)
{
int r,g,b;
- r = (screen->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (screen->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (screen->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (screen->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (screen->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (screen->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(screen->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(screen->machine(),offset,MAKE_RGB(r,g,b));
}
}
@@ -2452,8 +2452,8 @@ SCREEN_UPDATE(konamigx)
{
UINT32 coldat = gx_subpaletteram32[offset];
- set_color_555(screen->machine, offset*2, 0, 5, 10,coldat >> 16);
- set_color_555(screen->machine, offset*2+1, 0, 5, 10,coldat & 0xffff);
+ set_color_555(screen->machine(), offset*2, 0, 5, 10,coldat >> 16);
+ set_color_555(screen->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
}
}
else
@@ -2466,7 +2466,7 @@ SCREEN_UPDATE(konamigx)
g = (gx_subpaletteram32[offset] >> 8) & 0xff;
b = (gx_subpaletteram32[offset] >> 0) & 0xff;
- palette_set_color(screen->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(screen->machine(),offset,MAKE_RGB(r,g,b));
}
}
bitmap = dualscreen_right_tempbitmap;
@@ -2535,7 +2535,7 @@ SCREEN_UPDATE(konamigx)
if (gx_specialrozenable==3)
{
- konamigx_mixer(screen->machine, bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0, 0, 0, gx_rushingheroes_hack);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, gx_psac_tilemap, GXSUB_8BPP,0,0, 0, 0, gx_rushingheroes_hack);
}
// hack, draw the roz tilemap if W is held
// todo: fix so that it works with the mixer without crashing(!)
@@ -2552,11 +2552,11 @@ SCREEN_UPDATE(konamigx)
else K053936_0_zoom_draw(type3_roz_temp_bitmap, &temprect,gx_psac_tilemap, 0,0,0); // soccerss playfield
- konamigx_mixer(screen->machine, bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack);
}
else
{
- konamigx_mixer(screen->machine, bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, 0, 0, gx_rushingheroes_hack);
}
@@ -2564,9 +2564,9 @@ SCREEN_UPDATE(konamigx)
/* Hack! draw type-1 roz layer here for testing purposes only */
if (gx_specialrozenable == 1)
{
- const pen_t *paldata = screen->machine->pens;
+ const pen_t *paldata = screen->machine().pens;
- if ( input_code_pressed(screen->machine, KEYCODE_W) )
+ if ( input_code_pressed(screen->machine(), KEYCODE_W) )
{
int y,x;
@@ -2598,8 +2598,8 @@ SCREEN_UPDATE(konamigx)
if (konamigx_has_dual_screen)
{
- device_t *left_screen = screen->machine->device("screen");
- device_t *right_screen = screen->machine->device("screen2");
+ device_t *left_screen = screen->machine().device("screen");
+ device_t *right_screen = screen->machine().device("screen2");
if (screen==left_screen)
{
@@ -2619,13 +2619,13 @@ WRITE32_HANDLER( konamigx_palette_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
#ifdef UNUSED_FUNCTION
@@ -2641,11 +2641,11 @@ WRITE32_HANDLER( konamigx_palette2_w )
offset += (0x8000/4);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
#endif
-INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
@@ -2655,12 +2655,12 @@ INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int
WRITE32_HANDLER( konamigx_555_palette_w )
{
UINT32 coldat;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- coldat = space->machine->generic.paletteram.u32[offset];
+ coldat = space->machine().generic.paletteram.u32[offset];
- set_color_555(space->machine, offset*2, 0, 5, 10,coldat >> 16);
- set_color_555(space->machine, offset*2+1, 0, 5, 10,coldat & 0xffff);
+ set_color_555(space->machine(), offset*2, 0, 5, 10,coldat >> 16);
+ set_color_555(space->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
}
// sub monitor for type 3
@@ -2672,8 +2672,8 @@ WRITE32_HANDLER( konamigx_555_palette2_w )
offset += (0x4000/4);
- set_color_555(space->machine, offset*2, 0, 5, 10,coldat >> 16);
- set_color_555(space->machine, offset*2+1, 0, 5, 10,coldat & 0xffff);
+ set_color_555(space->machine(), offset*2, 0, 5, 10,coldat >> 16);
+ set_color_555(space->machine(), offset*2+1, 0, 5, 10,coldat & 0xffff);
}
#endif
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index d745485e582..a7ff76d8221 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -1187,22 +1187,22 @@ static void shuffle(UINT16 *buf,int len)
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
-void konami_rom_deinterleave_2(running_machine *machine, const char *mem_region)
+void konami_rom_deinterleave_2(running_machine &machine, const char *mem_region)
{
- shuffle((UINT16 *)machine->region(mem_region)->base(),machine->region(mem_region)->bytes()/2);
+ shuffle((UINT16 *)machine.region(mem_region)->base(),machine.region(mem_region)->bytes()/2);
}
/* hacked version of rom_deinterleave_2_half for Lethal Enforcers */
-void konami_rom_deinterleave_2_half(running_machine *machine, const char *mem_region)
+void konami_rom_deinterleave_2_half(running_machine &machine, const char *mem_region)
{
- UINT8 *rgn = machine->region(mem_region)->base();
+ UINT8 *rgn = machine.region(mem_region)->base();
- shuffle((UINT16 *)rgn,machine->region(mem_region)->bytes()/4);
- shuffle((UINT16 *)(rgn+machine->region(mem_region)->length()/2),machine->region(mem_region)->bytes()/4);
+ shuffle((UINT16 *)rgn,machine.region(mem_region)->bytes()/4);
+ shuffle((UINT16 *)(rgn+machine.region(mem_region)->length()/2),machine.region(mem_region)->bytes()/4);
}
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
-void konami_rom_deinterleave_4(running_machine *machine, const char *mem_region)
+void konami_rom_deinterleave_4(running_machine &machine, const char *mem_region)
{
konami_rom_deinterleave_2(machine, mem_region);
konami_rom_deinterleave_2(machine, mem_region);
@@ -1210,13 +1210,13 @@ void konami_rom_deinterleave_4(running_machine *machine, const char *mem_region)
#endif
-static void decode_gfx(running_machine *machine, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp)
+static void decode_gfx(running_machine &machine, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp)
{
gfx_layout gl;
memcpy(&gl, layout, sizeof(gl));
gl.total = total;
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &gl, data, machine->total_colors() >> bpp, 0);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &gl, data, machine.total_colors() >> bpp, 0);
}
@@ -1234,7 +1234,7 @@ UINT8 K007121_ctrlram[MAX_K007121][8];
static int K007121_flipscreen[MAX_K007121];
-void K007121_ctrl_w(running_machine *machine,int chip,int offset,int data)
+void K007121_ctrl_w(running_machine &machine,int chip,int offset,int data)
{
switch (offset)
{
@@ -1253,12 +1253,12 @@ if ((K007121_ctrlram[chip][offset] & 0x30) != (data & 0x30))
WRITE8_HANDLER( K007121_ctrl_0_w )
{
- K007121_ctrl_w(space->machine,0,offset,data);
+ K007121_ctrl_w(space->machine(),0,offset,data);
}
WRITE8_HANDLER( K007121_ctrl_1_w )
{
- K007121_ctrl_w(space->machine,1,offset,data);
+ K007121_ctrl_w(space->machine(),1,offset,data);
}
@@ -1302,7 +1302,7 @@ void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, g
int global_x_offset,int bank_base, UINT32 pri_mask)
{
const gfx_element *gfx = gfxs[chip];
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
int flipscreen = K007121_flipscreen[chip];
int i,num,inc,offs[5];
int is_flakatck = (ctable == NULL);
@@ -1312,7 +1312,7 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
K007121_ctrlram[0][0x00],K007121_ctrlram[0][0x01],K007121_ctrlram[0][0x02],K007121_ctrlram[0][0x03],K007121_ctrlram[0][0x04],K007121_ctrlram[0][0x05],K007121_ctrlram[0][0x06],K007121_ctrlram[0][0x07],
K007121_ctrlram[1][0x00],K007121_ctrlram[1][0x01],K007121_ctrlram[1][0x02],K007121_ctrlram[1][0x03],K007121_ctrlram[1][0x04],K007121_ctrlram[1][0x05],K007121_ctrlram[1][0x06],K007121_ctrlram[1][0x07]);
-if (input_code_pressed(gfx->machine, KEYCODE_D))
+if (input_code_pressed(gfx->machine(), KEYCODE_D))
{
FILE *fp;
fp=fopen(chip?"SPRITE1.DMP":"SPRITE0.DMP", "w+b");
@@ -1490,7 +1490,7 @@ static TILEMAP_MAPPER( K007342_scan )
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5);
}
-INLINE void K007342_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *cram,UINT8 *vram)
+INLINE void K007342_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *cram,UINT8 *vram)
{
int color, code, flags;
@@ -1514,7 +1514,7 @@ static TILE_GET_INFO( K007342_get_tile_info1 ) { K007342_get_tile_info(machine,t
-void K007342_vh_start(running_machine *machine, int gfx_index, void (*callback)(int tmap, int bank, int *code, int *color, int *flags))
+void K007342_vh_start(running_machine &machine, int gfx_index, void (*callback)(int tmap, int bank, int *code, int *color, int *flags))
{
K007342_gfxnum = gfx_index;
K007342_callback = callback;
@@ -1585,7 +1585,7 @@ WRITE8_HANDLER( K007342_vreg_w )
break;
case 0x01: /* used for banking in Rock'n'Rage */
if (data != K007342_regs[1])
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
case 0x02:
K007342_scrollx[0] = (K007342_scrollx[0] & 0xff) | ((data & 0x01) << 8);
K007342_scrollx[1] = (K007342_scrollx[1] & 0xff) | ((data & 0x02) << 7);
@@ -1695,9 +1695,9 @@ static void (*K007420_callback)(int *code,int *color);
static UINT8 *K007420_ram;
static int K007420_banklimit;
-void K007420_vh_start(running_machine *machine, int gfxnum, void (*callback)(int *code,int *color))
+void K007420_vh_start(running_machine &machine, int gfxnum, void (*callback)(int *code,int *color))
{
- K007420_gfx = machine->gfx[gfxnum];
+ K007420_gfx = machine.gfx[gfxnum];
K007420_callback = callback;
K007420_ram = auto_alloc_array_clear(machine, UINT8, 0x200);
@@ -1925,7 +1925,7 @@ tilemap_t *K052109_tilemap[3];
color RAM ------xx depends on external connections (usually banking, flip)
*/
-INLINE void K052109_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *cram,UINT8 *vram1,UINT8 *vram2)
+INLINE void K052109_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *cram,UINT8 *vram1,UINT8 *vram2)
{
int flipy = 0;
int code = vram1[tile_index] + 256 * vram2[tile_index];
@@ -1973,7 +1973,7 @@ static STATE_POSTLOAD( K052109_tileflip_reset )
#define XOR(a) WORD_XOR_BE(a)
-void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int plane_order,
+void K052109_vh_start(running_machine &machine,const char *gfx_memory_region,int plane_order,
void (*callback)(int tmap,int bank,int *code,int *color,int *flags,int *priority))
{
int gfx_index, i;
@@ -2002,7 +2002,7 @@ void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -2010,13 +2010,13 @@ void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int
switch (plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 32;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 32;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x1000;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
break;
default:
@@ -2069,7 +2069,7 @@ void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int
state_save_register_global_array(machine, K052109_dy);
state_save_register_global(machine, has_extra_video_ram);
- machine->state().register_postload(K052109_tileflip_reset, NULL);
+ machine.state().register_postload(K052109_tileflip_reset, NULL);
}
READ8_HANDLER( K052109_r )
@@ -2110,11 +2110,11 @@ else
(*K052109_callback)(0,bank,&code,&color,&flags,&priority);
addr = (code << 5) + (offset & 0x1f);
- addr &= space->machine->region(K052109_memory_region)->bytes()-1;
+ addr &= space->machine().region(K052109_memory_region)->bytes()-1;
// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n",cpu_get_pc(space->cpu),offset,K052109_romsubbank,bank,addr);
- return space->machine->region(K052109_memory_region)->base()[addr];
+ return space->machine().region(K052109_memory_region)->base()[addr];
}
}
@@ -2464,7 +2464,7 @@ static int K051960_dx, K051960_dy;
static int K051960_irq_enabled, K051960_nmi_enabled;
-void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int plane_order,
+void K051960_vh_start(running_machine &machine,const char *gfx_memory_region,int plane_order,
void (*callback)(int *code,int *color,int *priority,int *shadow))
{
int gfx_index;
@@ -2508,7 +2508,7 @@ void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -2517,31 +2517,31 @@ void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int
switch (plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case REVERSE_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x4000;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
break;
default:
fatalerror("Unknown plane_order");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
K051960_dx = K051960_dy = 0;
K051960_memory_region = gfx_memory_region;
- K051960_gfx = machine->gfx[gfx_index];
+ K051960_gfx = machine.gfx[gfx_index];
K051960_callback = callback;
K051960_ram = auto_alloc_array_clear(machine, UINT8, 0x400);
@@ -2555,7 +2555,7 @@ void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int
}
-static int K051960_fetchromdata(running_machine *machine, int byte)
+static int K051960_fetchromdata(running_machine &machine, int byte)
{
int code,color,pri,shadow,off1,addr;
@@ -2570,11 +2570,11 @@ static int K051960_fetchromdata(running_machine *machine, int byte)
(*K051960_callback)(&code,&color,&pri,&shadow);
addr = (code << 7) | (off1 << 2) | byte;
- addr &= machine->region(K051960_memory_region)->bytes()-1;
+ addr &= machine.region(K051960_memory_region)->bytes()-1;
-// popmessage("%s: addr %06x",machine->describe_context(),addr);
+// popmessage("%s: addr %06x",machine.describe_context(),addr);
- return machine->region(K051960_memory_region)->base()[addr];
+ return machine.region(K051960_memory_region)->base()[addr];
}
READ8_HANDLER( K051960_r )
@@ -2583,7 +2583,7 @@ READ8_HANDLER( K051960_r )
{
/* the 051960 remembers the last address read and uses it when reading the sprite ROMs */
K051960_romoffset = (offset & 0x3fc) >> 2;
- return K051960_fetchromdata(space->machine, offset & 3); /* only 88 Games reads the ROMs from here */
+ return K051960_fetchromdata(space->machine(), offset & 3); /* only 88 Games reads the ROMs from here */
}
else
return K051960_ram[offset];
@@ -2611,7 +2611,7 @@ READ8_HANDLER( K051937_r )
{
if (K051960_readroms && offset >= 4 && offset < 8)
{
- return K051960_fetchromdata(space->machine, offset & 3);
+ return K051960_fetchromdata(space->machine(), offset & 3);
}
else
{
@@ -2715,7 +2715,7 @@ WRITE16_HANDLER( K051937_word_w )
* Note that Aliens also uses the shadow bit to select the second sprite bank.
*/
-void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int min_priority,int max_priority)
+void K051960_sprites_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int min_priority,int max_priority)
{
#define NUM_SPRITES 128
int offs,pri_code;
@@ -2827,15 +2827,15 @@ void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectan
color,
flipx,flipy,
sx & 0x1ff,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
else
drawgfx_transtable(bitmap,cliprect,K051960_gfx,
c,
color,
flipx,flipy,
sx & 0x1ff,sy,
- drawmode_table,machine->shadow_table);
+ drawmode_table,machine.shadow_table);
}
}
}
@@ -2866,8 +2866,8 @@ void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectan
flipx,flipy,
sx & 0x1ff,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
else
drawgfxzoom_transtable(bitmap,cliprect,K051960_gfx,
c,
@@ -2875,7 +2875,7 @@ void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectan
flipx,flipy,
sx & 0x1ff,sy,
(zw << 16) / 16,(zh << 16) / 16,
- drawmode_table,machine->shadow_table);
+ drawmode_table,machine.shadow_table);
}
}
}
@@ -2993,7 +2993,7 @@ static UINT16 *K053245_ram[MAX_K053245_CHIPS], *K053245_buffer[MAX_K053245_CHIPS
static UINT8 K053244_regs[MAX_K053245_CHIPS][0x10];
static int K053245_dx[MAX_K053245_CHIPS], K053245_dy[MAX_K053245_CHIPS];
-void K053245_vh_start(running_machine *machine,int chip, const char *gfx_memory_region,int plane_order,
+void K053245_vh_start(running_machine &machine,int chip, const char *gfx_memory_region,int plane_order,
void (*callback)(int *code,int *color,int *priority))
{
int gfx_index;
@@ -3019,7 +3019,7 @@ void K053245_vh_start(running_machine *machine,int chip, const char *gfx_memory_
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -3027,21 +3027,21 @@ void K053245_vh_start(running_machine *machine,int chip, const char *gfx_memory_
switch (plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &spritelayout, 4);
break;
default:
fatalerror("Unsupported plane_order");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
K05324x_z_rejection = -1;
K053245_memory_region[chip] = gfx_memory_region;
- K053245_gfx[chip] = machine->gfx[gfx_index];
+ K053245_gfx[chip] = machine.gfx[gfx_index];
K053245_callback[chip] = callback;
K053244_rombank[chip] = 0;
K053245_ramsize[chip] = 0x800;
@@ -3113,7 +3113,7 @@ INLINE void K053245_update_buffer( int chip )
memcpy(K053245_buffer[chip], K053245_ram[chip], K053245_ramsize[chip]);
}
-static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset)
+static UINT8 K053244_chip_r (running_machine &machine, int chip, int offset)
{
if ((K053244_regs[chip][5] & 0x10) && offset >= 0x0c && offset < 0x10)
{
@@ -3122,11 +3122,11 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset)
addr = (K053244_rombank[chip] << 19) | ((K053244_regs[chip][11] & 0x7) << 18)
| (K053244_regs[chip][8] << 10) | (K053244_regs[chip][9] << 2)
| ((offset & 3) ^ 1);
- addr &= machine->region(K053245_memory_region[chip])->bytes()-1;
+ addr &= machine.region(K053245_memory_region[chip])->bytes()-1;
-// popmessage("%s: offset %02x addr %06x",machine->describe_context(),offset&3,addr);
+// popmessage("%s: offset %02x addr %06x",machine.describe_context(),offset&3,addr);
- return machine->region(K053245_memory_region[chip])->base()[addr];
+ return machine.region(K053245_memory_region[chip])->base()[addr];
}
else if (offset == 0x06)
{
@@ -3135,7 +3135,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset)
}
else
{
-//logerror("%s: read from unknown 053244 address %x\n",machine->describe_context(),offset);
+//logerror("%s: read from unknown 053244 address %x\n",machine.describe_context(),offset);
return 0;
}
@@ -3144,7 +3144,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset)
READ8_HANDLER( K053244_r )
{
- return K053244_chip_r(space->machine,0,offset);
+ return K053244_chip_r(space->machine(),0,offset);
}
static void K053244_chip_w(int chip, int offset, int data)
@@ -3157,7 +3157,7 @@ static void K053244_chip_w(int chip, int offset, int data)
// popmessage("053244 reg 05 = %02x",data);
/* bit 2 = unknown, Parodius uses it */
/* bit 5 = unknown, Rollergames uses it */
-// logerror("%s: write %02x to 053244 address 5\n",machine->describe_context(),data);
+// logerror("%s: write %02x to 053244 address 5\n",machine.describe_context(),data);
break;
}
case 0x06:
@@ -3235,7 +3235,7 @@ void K053244_bankselect(int chip, int bank)
* The rest of the sprite remains normal.
*/
-void K053245_sprites_draw(running_machine *machine, int chip, bitmap_t *bitmap,const rectangle *cliprect) //*
+void K053245_sprites_draw(running_machine &machine, int chip, bitmap_t *bitmap,const rectangle *cliprect) //*
{
#define NUM_SPRITES 128
int offs,pri_code,i;
@@ -3436,8 +3436,8 @@ void K053245_sprites_draw(running_machine *machine, int chip, bitmap_t *bitmap,c
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
else
{
@@ -3447,8 +3447,8 @@ void K053245_sprites_draw(running_machine *machine, int chip, bitmap_t *bitmap,c
fx,fy,
sx,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
}
@@ -3472,7 +3472,7 @@ if (input_code_pressed(machine, KEYCODE_D))
/* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. lets cheat a
bit and make emulating it a little less messy by using a custom function instead */
-void K053245_sprites_draw_lethal(running_machine *machine,int chip, bitmap_t *bitmap,const rectangle *cliprect) //*
+void K053245_sprites_draw_lethal(running_machine &machine,int chip, bitmap_t *bitmap,const rectangle *cliprect) //*
{
#define NUM_SPRITES 128
int offs,pri_code,i;
@@ -3604,7 +3604,7 @@ void K053245_sprites_draw_lethal(running_machine *machine,int chip, bitmap_t *bi
ox -= (zoomx * w) >> 13;
oy -= (zoomy * h) >> 13;
- drawmode_table[machine->gfx[0]->color_granularity-1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
+ drawmode_table[machine.gfx[0]->color_granularity-1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
for (y = 0;y < h;y++)
{
@@ -3668,24 +3668,24 @@ void K053245_sprites_draw_lethal(running_machine *machine,int chip, bitmap_t *bi
if (zoomx == 0x10000 && zoomy == 0x10000)
{
- pdrawgfx_transtable(bitmap,cliprect,machine->gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
+ pdrawgfx_transtable(bitmap,cliprect,machine.gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
c,
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
else
{
- pdrawgfxzoom_transtable(bitmap,cliprect,machine->gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
+ pdrawgfxzoom_transtable(bitmap,cliprect,machine.gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
c,
color,
fx,fy,
sx,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
}
@@ -3721,10 +3721,10 @@ static UINT8 K053246_regs[8];
static UINT16 K053247_regs[16];
static UINT16 *K053247_ram=0;
static gfx_element *K053247_gfx;
-static void (*K053247_callback)(running_machine *machine, int *code,int *color,int *priority);
+static void (*K053247_callback)(running_machine &machine, int *code,int *color,int *priority);
static UINT8 K053246_OBJCHA_line;
-void K053247_export_config(UINT16 **ram, gfx_element **gfx, void (**callback)(running_machine *, int *, int *, int *), int *dx, int *dy)
+void K053247_export_config(UINT16 **ram, gfx_element **gfx, void (**callback)(running_machine &, int *, int *, int *), int *dx, int *dy)
{
if(ram)
*ram = K053247_ram;
@@ -3753,7 +3753,7 @@ void K053247_wraparound_enable(int status)
K053247_wraparound = status;
}
-void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, int dx, int dy, int plane_order,
+void K053247_vh_start(running_machine &machine, const char *gfx_memory_region, int dx, int dy, int plane_order,
void (*callback)(int *code,int *color,int *priority))
{
int gfx_index;
@@ -3784,7 +3784,7 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -3792,13 +3792,13 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i
switch (plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case TASMAN_PLANE_ORDER:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
break;
default:
@@ -3807,14 +3807,14 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i
if (VERBOSE)
{
- if (machine->primary_screen->format() == BITMAP_FORMAT_RGB32)
+ if (machine.primary_screen->format() == BITMAP_FORMAT_RGB32)
{
- if ((machine->config().m_video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS)
+ if ((machine.config().m_video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS)
popmessage("driver missing SHADOWS or HIGHLIGHTS flag");
}
else
{
- if (!(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
}
}
@@ -3824,7 +3824,7 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i
K053247_wraparound = 1;
K05324x_z_rejection = -1;
K053247_memory_region = gfx_memory_region;
- K053247_gfx = machine->gfx[gfx_index];
+ K053247_gfx = machine.gfx[gfx_index];
K053247_callback = callback;
K053246_OBJCHA_line = CLEAR_LINE;
K053247_ram = auto_alloc_array(machine, UINT16, 0x1000/2);
@@ -3841,7 +3841,7 @@ void K053247_vh_start(running_machine *machine, const char *gfx_memory_region, i
#endif
/* K055673 used with the 54246 in PreGX/Run and Gun/System GX games */
-void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, int layout, int dx, int dy, void (*callback)(running_machine *machine, int *code,int *color,int *priority))
+void K055673_vh_start(running_machine &machine, const char *gfx_memory_region, int layout, int dx, int dy, void (*callback)(running_machine &machine, int *code,int *color,int *priority))
{
int gfx_index;
UINT32 total;
@@ -3896,23 +3896,23 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
- K055673_rom = (UINT16 *)machine->region(gfx_memory_region)->base();
+ K055673_rom = (UINT16 *)machine.region(gfx_memory_region)->base();
/* decode the graphics */
switch(layout)
{
case K055673_LAYOUT_GX:
- size4 = (machine->region(gfx_memory_region)->bytes()/(1024*1024))/5;
+ size4 = (machine.region(gfx_memory_region)->bytes()/(1024*1024))/5;
size4 *= 4*1024*1024;
/* set the # of tiles based on the 4bpp section */
K055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2);
d = (UINT8 *)K055673_rom;
// now combine the graphics together to form 5bpp
- s1 = machine->region(gfx_memory_region)->base(); // 4bpp area
+ s1 = machine.region(gfx_memory_region)->base(); // 4bpp area
s2 = s1 + (size4); // 1bpp area
for (i = 0; i < size4; i+= 4)
{
@@ -3928,17 +3928,17 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i
break;
case K055673_LAYOUT_RNG:
- total = machine->region(gfx_memory_region)->bytes() / (16*16/2);
+ total = machine.region(gfx_memory_region)->bytes() / (16*16/2);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout2, 4);
break;
case K055673_LAYOUT_LE2:
- total = machine->region(gfx_memory_region)->bytes() / (16*16);
+ total = machine.region(gfx_memory_region)->bytes() / (16*16);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout3, 4);
break;
case K055673_LAYOUT_GX6:
- total = machine->region(gfx_memory_region)->bytes() / (16*16*6/8);
+ total = machine.region(gfx_memory_region)->bytes() / (16*16*6/8);
decode_gfx(machine, gfx_index, (UINT8 *)K055673_rom, total, &spritelayout4, 4);
break;
@@ -3946,7 +3946,7 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i
fatalerror("Unsupported layout");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
K053247_dx = dx;
@@ -3954,7 +3954,7 @@ void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, i
K053247_wraparound = 1;
K05324x_z_rejection = -1;
K053247_memory_region = gfx_memory_region;
- K053247_gfx = machine->gfx[gfx_index];
+ K053247_gfx = machine.gfx[gfx_index];
K053247_callback = callback;
K053246_OBJCHA_line = CLEAR_LINE;
K053247_ram = auto_alloc_array(machine, UINT16, 0x1000/2);
@@ -4035,9 +4035,9 @@ WRITE8_HANDLER( K053247_w )
// in this window, +0 = 32 bits from one set of ROMs, and +8 = 32 bits from another set
READ16_HANDLER( K055673_rom_word_r ) // 5bpp
{
- UINT8 *ROM8 = (UINT8 *)space->machine->region(K053247_memory_region)->base();
- UINT16 *ROM = (UINT16 *)space->machine->region(K053247_memory_region)->base();
- int size4 = (space->machine->region(K053247_memory_region)->bytes()/(1024*1024))/5;
+ UINT8 *ROM8 = (UINT8 *)space->machine().region(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space->machine().region(K053247_memory_region)->base();
+ int size4 = (space->machine().region(K053247_memory_region)->bytes()/(1024*1024))/5;
int romofs;
size4 *= 4*1024*1024; // get offset to 5th bit
@@ -4073,7 +4073,7 @@ READ16_HANDLER( K055673_rom_word_r ) // 5bpp
READ16_HANDLER( K055673_GX6bpp_rom_word_r )
{
- UINT16 *ROM = (UINT16 *)space->machine->region(K053247_memory_region)->base();
+ UINT16 *ROM = (UINT16 *)space->machine().region(K053247_memory_region)->base();
int romofs;
romofs = K053246_regs[6]<<16 | K053246_regs[7]<<8 | K053246_regs[4];
@@ -4113,10 +4113,10 @@ READ8_HANDLER( K053246_r )
int addr;
addr = (K053246_regs[6] << 17) | (K053246_regs[7] << 9) | (K053246_regs[4] << 1) | ((offset & 1) ^ 1);
- addr &= space->machine->region(K053247_memory_region)->bytes()-1;
+ addr &= space->machine().region(K053247_memory_region)->bytes()-1;
if (VERBOSE)
popmessage("%04x: offset %02x addr %06x",cpu_get_pc(space->cpu),offset,addr);
- return space->machine->region(K053247_memory_region)->base()[addr];
+ return space->machine().region(K053247_memory_region)->base()[addr];
}
else
{
@@ -4203,7 +4203,7 @@ int K053246_is_IRQ_enabled(void)
*/
#ifdef UNUSED_FUNCTION
-void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) //*
+void K053247_sprites_draw(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect) //*
{
#define NUM_SPRITES 256
@@ -4230,7 +4230,7 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
int offx = (short)((K053246_regs[0] << 8) | K053246_regs[1]);
int offy = (short)((K053246_regs[2] << 8) | K053246_regs[3]);
- int screen_width = machine->primary_screen->width();
+ int screen_width = machine.primary_screen->width();
UINT8 drawmode_table[256];
UINT8 shadowmode_table[256];
UINT8 *whichtable;
@@ -4245,9 +4245,9 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS
*/
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
{
- if (bitmap->bpp == 32 && (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS))
+ if (bitmap->bpp == 32 && (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS))
shdmask = 3; // enable all shadows and highlights
else
shdmask = 0; // enable default shadows
@@ -4529,8 +4529,8 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
else
{
@@ -4540,8 +4540,8 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
fx,fy,
sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
if (mirrory && h == 1) /* Simpsons shadows */
@@ -4553,8 +4553,8 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
color,
fx,!fy,
sx,sy,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
else
{
@@ -4564,8 +4564,8 @@ void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const recta
fx,!fy,
sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
}
} // end of X loop
@@ -4603,7 +4603,7 @@ static tilemap_t *K051316_tilemap[MAX_K051316];
***************************************************************************/
-INLINE void K051316_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int chip)
+INLINE void K051316_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int chip)
{
int code = K051316_ram[chip][tile_index];
int color = K051316_ram[chip][tile_index + 0x400];
@@ -4623,7 +4623,7 @@ static TILE_GET_INFO( K051316_get_tile_info1 ) { K051316_get_tile_info(machine,t
static TILE_GET_INFO( K051316_get_tile_info2 ) { K051316_get_tile_info(machine,tileinfo,tile_index,2); }
-static void K051316_vh_start(running_machine *machine,int chip, const char *gfx_memory_region,int bpp,
+static void K051316_vh_start(running_machine &machine,int chip, const char *gfx_memory_region,int bpp,
int pen_is_mask,int transparent_pen,
void (*callback)(int *code,int *color,int *flags))
{
@@ -4681,7 +4681,7 @@ static void K051316_vh_start(running_machine *machine,int chip, const char *gfx_
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -4691,22 +4691,22 @@ static void K051316_vh_start(running_machine *machine,int chip, const char *gfx_
case -4:
total = 0x400;
bpp = 4;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
break;
case 4:
- total = machine->region(gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.region(gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case 7:
- total = machine->region(gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout7, 7);
+ total = machine.region(gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout7, 7);
break;
case 8:
- total = machine->region(gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout8, 8);
+ total = machine.region(gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8, 8);
break;
default:
@@ -4740,21 +4740,21 @@ static void K051316_vh_start(running_machine *machine,int chip, const char *gfx_
state_save_register_item(machine, "K051316", NULL, chip, K051316_offset[chip][1]);
}
-void K051316_vh_start_0(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_0(running_machine &machine,const char *gfx_memory_region,int bpp,
int pen_is_mask,int transparent_pen,
void (*callback)(int *code,int *color,int *flags))
{
K051316_vh_start(machine,0,gfx_memory_region,bpp,pen_is_mask,transparent_pen,callback);
}
-void K051316_vh_start_1(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_1(running_machine &machine,const char *gfx_memory_region,int bpp,
int pen_is_mask,int transparent_pen,
void (*callback)(int *code,int *color,int *flags))
{
K051316_vh_start(machine,1,gfx_memory_region,bpp,pen_is_mask,transparent_pen,callback);
}
-void K051316_vh_start_2(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_2(running_machine &machine,const char *gfx_memory_region,int bpp,
int pen_is_mask,int transparent_pen,
void (*callback)(int *code,int *color,int *flags))
{
@@ -4805,7 +4805,7 @@ WRITE8_HANDLER( K051316_2_w )
}
-static int K051316_rom_r(running_machine *machine, int chip, int offset)
+static int K051316_rom_r(running_machine &machine, int chip, int offset)
{
if ((K051316_ctrlram[chip][0x0e] & 0x01) == 0)
{
@@ -4813,32 +4813,32 @@ static int K051316_rom_r(running_machine *machine, int chip, int offset)
addr = offset + (K051316_ctrlram[chip][0x0c] << 11) + (K051316_ctrlram[chip][0x0d] << 19);
if (K051316_bpp[chip] <= 4) addr /= 2;
- addr &= machine->region(K051316_memory_region[chip])->bytes()-1;
+ addr &= machine.region(K051316_memory_region[chip])->bytes()-1;
-// popmessage("%s: offset %04x addr %04x",machine->describe_context(),offset,addr);
+// popmessage("%s: offset %04x addr %04x",machine.describe_context(),offset,addr);
- return machine->region(K051316_memory_region[chip])->base()[addr];
+ return machine.region(K051316_memory_region[chip])->base()[addr];
}
else
{
-//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",machine->describe_context(),offset);
+//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",machine.describe_context(),offset);
return 0;
}
}
READ8_HANDLER( K051316_rom_0_r )
{
- return K051316_rom_r(space->machine,0,offset);
+ return K051316_rom_r(space->machine(),0,offset);
}
READ8_HANDLER( K051316_rom_1_r )
{
- return K051316_rom_r(space->machine,1,offset);
+ return K051316_rom_r(space->machine(),1,offset);
}
READ8_HANDLER( K051316_rom_2_r )
{
- return K051316_rom_r(space->machine,2,offset);
+ return K051316_rom_r(space->machine(),2,offset);
}
@@ -4846,7 +4846,7 @@ READ8_HANDLER( K051316_rom_2_r )
static void K051316_ctrl_w(int chip,int offset,int data)
{
K051316_ctrlram[chip][offset] = data;
-//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n",machine->describe_context(),data,offset);
+//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n",machine.describe_context(),data,offset);
}
WRITE8_HANDLER( K051316_ctrl_0_w )
@@ -5123,12 +5123,12 @@ static STATE_POSTLOAD( K053251_reset_indexes )
K053251_palette_index[4] = 16 * ((K053251_ram[10] >> 3) & 0x07);
}
-void K053251_vh_start(running_machine *machine)
+void K053251_vh_start(running_machine &machine)
{
K053251_set_tilemaps(NULL,NULL,NULL,NULL,NULL);
state_save_register_global_array(machine, K053251_ram);
- machine->state().register_postload(K053251_reset_indexes, NULL);
+ machine.state().register_postload(K053251_reset_indexes, NULL);
}
void K053251_set_tilemaps(tilemap_t *ci0,tilemap_t *ci1,tilemap_t *ci2,tilemap_t *ci3,tilemap_t *ci4)
@@ -5167,7 +5167,7 @@ WRITE8_HANDLER( K053251_w )
}
if (!K053251_tilemaps_set)
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
else if (offset == 10)
{
@@ -5185,7 +5185,7 @@ WRITE8_HANDLER( K053251_w )
}
if (!K053251_tilemaps_set)
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
}
@@ -5542,9 +5542,9 @@ int K056832_get_lookup(int bits)
}
#endif
-static void (*K056832_callback)(running_machine *machine, int layer, int *code, int *color, int *flags);
+static void (*K056832_callback)(running_machine &machine, int layer, int *code, int *color, int *flags);
-INLINE void K056832_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int pageIndex )
+INLINE void K056832_get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int pageIndex )
{
static const struct K056832_SHIFTMASKS
{
@@ -5676,9 +5676,9 @@ static STATE_POSTLOAD( K056832_postload )
K056832_change_rombank();
}
-void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, int bpp, int big,
+void K056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big,
int (*scrolld)[4][2],
- void (*callback)(running_machine *machine, int layer, int *code, int *color, int *flags),
+ void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags),
int djmain_hack)
{
tilemap_t *tmap;
@@ -5762,7 +5762,7 @@ void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, i
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
{
- if (machine->gfx[gfx_index] == 0) break;
+ if (machine.gfx[gfx_index] == 0) break;
}
assert(gfx_index != MAX_GFX_ELEMENTS);
@@ -5773,52 +5773,52 @@ void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, i
switch (bpp)
{
case K056832_BPP_4:
- total = machine->region(gfx_memory_region)->bytes() / (i*4);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*4);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case K056832_BPP_5:
- total = machine->region(gfx_memory_region)->bytes() / (i*5);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout5, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*5);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout5, 4);
break;
case K056832_BPP_6:
- total = machine->region(gfx_memory_region)->bytes() / (i*6);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout6, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*6);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout6, 4);
break;
case K056832_BPP_8:
- total = machine->region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout8, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8, 4);
break;
case K056832_BPP_8LE:
- total = machine->region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout8le, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8le, 4);
break;
case K056832_BPP_8TASMAN:
- total = machine->region(gfx_memory_region)->bytes() / (i*8);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*8);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
break;
case K056832_BPP_4dj:
- total = machine->region(gfx_memory_region)->bytes() / (i*4);
- decode_gfx(machine, gfx_index, machine->region(gfx_memory_region)->base(), total, &charlayout4dj, 4);
+ total = machine.region(gfx_memory_region)->bytes() / (i*4);
+ decode_gfx(machine, gfx_index, machine.region(gfx_memory_region)->base(), total, &charlayout4dj, 4);
break;
default:
fatalerror("Unsupported bpp");
}
- machine->gfx[gfx_index]->color_granularity = 16; /* override */
+ machine.gfx[gfx_index]->color_granularity = 16; /* override */
K056832_memory_region = gfx_memory_region;
K056832_gfxnum = gfx_index;
K056832_callback = callback;
- K056832_rombase = machine->region(gfx_memory_region)->base();
- K056832_NumGfxBanks = machine->region(gfx_memory_region)->bytes() / 0x2000;
+ K056832_rombase = machine.region(gfx_memory_region)->base();
+ K056832_NumGfxBanks = machine.region(gfx_memory_region)->bytes() / 0x2000;
K056832_CurGfxBank = 0;
K056832_use_ext_linescroll = 0;
K056832_uses_tile_banks = 0;
@@ -5901,7 +5901,7 @@ void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, i
state_save_register_global_array(machine, K056832_dy);
state_save_register_global_array(machine, K056832_LayerTileMode);
- machine->state().register_postload(K056832_postload, NULL);
+ machine.state().register_postload(K056832_postload, NULL);
}
/* call if a game uses external linescroll */
@@ -5913,12 +5913,12 @@ void K056832_SetExtLinescroll(void)
#endif
/* generic helper routine for ROM checksumming */
-static int K056832_rom_read_b(running_machine *machine, int offset, int blksize, int blksize2, int zerosec)
+static int K056832_rom_read_b(running_machine &machine, int offset, int blksize, int blksize2, int zerosec)
{
UINT8 *rombase;
int base, ret;
- rombase = (UINT8 *)machine->region(K056832_memory_region)->base();
+ rombase = (UINT8 *)machine.region(K056832_memory_region)->base();
if ((K056832_rom_half) && (zerosec))
{
@@ -5952,11 +5952,11 @@ READ16_HANDLER( K056832_5bpp_rom_word_r )
{
if (mem_mask == 0xff00)
{
- return K056832_rom_read_b(space->machine, offset*2, 4, 5, 0)<<8;
+ return K056832_rom_read_b(space->machine(), offset*2, 4, 5, 0)<<8;
}
else if (mem_mask == 0x00ff)
{
- return K056832_rom_read_b(space->machine, offset*2+1, 4, 5, 0)<<16;
+ return K056832_rom_read_b(space->machine(), offset*2+1, 4, 5, 0)<<16;
}
else
{
@@ -5970,19 +5970,19 @@ READ32_HANDLER( K056832_5bpp_rom_long_r )
{
if (mem_mask == 0xff000000)
{
- return K056832_rom_read_b(space->machine, offset*4, 4, 5, 0)<<24;
+ return K056832_rom_read_b(space->machine(), offset*4, 4, 5, 0)<<24;
}
else if (mem_mask == 0x00ff0000)
{
- return K056832_rom_read_b(space->machine, offset*4+1, 4, 5, 0)<<16;
+ return K056832_rom_read_b(space->machine(), offset*4+1, 4, 5, 0)<<16;
}
else if (mem_mask == 0x0000ff00)
{
- return K056832_rom_read_b(space->machine, offset*4+2, 4, 5, 0)<<8;
+ return K056832_rom_read_b(space->machine(), offset*4+2, 4, 5, 0)<<8;
}
else if (mem_mask == 0x000000ff)
{
- return K056832_rom_read_b(space->machine, offset*4+3, 4, 5, 1);
+ return K056832_rom_read_b(space->machine(), offset*4+3, 4, 5, 1);
}
else
{
@@ -5995,19 +5995,19 @@ READ32_HANDLER( K056832_6bpp_rom_long_r )
{
if (mem_mask == 0xff000000)
{
- return K056832_rom_read_b(space->machine, offset*4, 4, 6, 0)<<24;
+ return K056832_rom_read_b(space->machine(), offset*4, 4, 6, 0)<<24;
}
else if (mem_mask == 0x00ff0000)
{
- return K056832_rom_read_b(space->machine, offset*4+1, 4, 6, 0)<<16;
+ return K056832_rom_read_b(space->machine(), offset*4+1, 4, 6, 0)<<16;
}
else if (mem_mask == 0x0000ff00)
{
- return K056832_rom_read_b(space->machine, offset*4+2, 4, 6, 0)<<8;
+ return K056832_rom_read_b(space->machine(), offset*4+2, 4, 6, 0)<<8;
}
else if (mem_mask == 0x000000ff)
{
- return K056832_rom_read_b(space->machine, offset*4+3, 4, 6, 0);
+ return K056832_rom_read_b(space->machine(), offset*4+3, 4, 6, 0);
}
else
{
@@ -6031,7 +6031,7 @@ READ16_HANDLER( K056832_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine->region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().region(K056832_memory_region)->base();
}
rombase = (UINT8 *)K056832_rombase;
@@ -6058,7 +6058,7 @@ READ16_HANDLER( K056832_mw_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine->region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().region(K056832_memory_region)->base();
}
if (K056832_regsb[2] & 0x8)
@@ -6123,7 +6123,7 @@ READ16_HANDLER( K056832_bishi_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine->region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().region(K056832_memory_region)->base();
}
return K056832_rombase[addr+2] | (K056832_rombase[addr] << 8);
@@ -6135,7 +6135,7 @@ READ16_HANDLER( K056832_rom_word_8000_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine->region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().region(K056832_memory_region)->base();
}
return K056832_rombase[addr+2] | (K056832_rombase[addr] << 8);
@@ -6147,7 +6147,7 @@ READ16_HANDLER( K056832_old_rom_word_r )
if (!K056832_rombase)
{
- K056832_rombase = space->machine->region(K056832_memory_region)->base();
+ K056832_rombase = space->machine().region(K056832_memory_region)->base();
}
return K056832_rombase[addr+1] | (K056832_rombase[addr] << 8);
@@ -6517,7 +6517,7 @@ WRITE32_HANDLER( K056832_b_long_w )
}
#endif
-static int K056832_update_linemap(running_machine *machine, bitmap_t *bitmap, int page, int flags)
+static int K056832_update_linemap(running_machine &machine, bitmap_t *bitmap, int page, int flags)
{
if (K056832_PageTileMode[page]) return(0);
@@ -6588,8 +6588,8 @@ static int K056832_update_linemap(running_machine *machine, bitmap_t *bitmap, in
{ xpr_ptr[count+N] = 0; }
pixmap = K056832_pixmap[page];
- pal_ptr = machine->pens;
- src_gfx = machine->gfx[K056832_gfxnum];
+ pal_ptr = machine.pens;
+ src_gfx = machine.gfx[K056832_gfxnum];
src_pitch = src_gfx->line_modulo;
src_modulo = src_gfx->char_modulo;
dst_pitch = pixmap->rowpixels;
@@ -6641,7 +6641,7 @@ static int K056832_update_linemap(running_machine *machine, bitmap_t *bitmap, in
return(0);
}
-void K056832_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority)
+void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority)
{
static int last_colorbase[K056832_PAGE_COUNT];
@@ -6931,7 +6931,7 @@ void K056832_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const rect
} // end of function
#ifdef UNUSED_FUNCTION
-void K056832_tilemap_draw_dj(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority) //*
+void K056832_tilemap_draw_dj(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority) //*
{
static int last_colorbase[K056832_PAGE_COUNT];
@@ -7256,7 +7256,7 @@ int K056832_read_register(int regnum)
static UINT8 k55555_regs[128];
-void K055555_vh_start(running_machine *machine)
+void K055555_vh_start(running_machine &machine)
{
state_save_register_global_array(machine, k55555_regs);
@@ -7347,7 +7347,7 @@ static int K054338_alphainverted;
// K054338 alpha blend / final mixer (normally used with the 55555)
// because the implementation is video dependant, this is just a
// register-handling shell.
-void K054338_vh_start(running_machine *machine)
+void K054338_vh_start(running_machine &machine)
{
memset(k54338_regs, 0, sizeof(UINT16)*32);
memset(K054338_shdRGB, 0, sizeof(int)*9);
@@ -7374,7 +7374,7 @@ int K054338_read_register(int reg)
return k54338_regs[reg];
}
-void K054338_update_all_shadows(running_machine *machine, int rushingheroes_hack)
+void K054338_update_all_shadows(running_machine &machine, int rushingheroes_hack)
{
int i, d;
int noclip = k54338_regs[K338_REG_CONTROL] & K338_CTL_CLIPSL;
@@ -7423,13 +7423,13 @@ void K054338_fill_solid_bg(bitmap_t *bitmap)
#endif
// Unified K054338/K055555 BG color fill
-void K054338_fill_backcolor(running_machine *machine, bitmap_t *bitmap, int mode) // (see p.67)
+void K054338_fill_backcolor(running_machine &machine, bitmap_t *bitmap, int mode) // (see p.67)
{
int clipx, clipy, clipw, cliph, i, dst_pitch;
int BGC_CBLK, BGC_SET;
UINT32 *dst_ptr, *pal_ptr;
int bgcolor;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
clipx = visarea.min_x & ~3;
clipy = visarea.min_y;
@@ -7441,7 +7441,7 @@ void K054338_fill_backcolor(running_machine *machine, bitmap_t *bitmap, int mode
dst_ptr += clipx;
BGC_SET = 0;
- pal_ptr = machine->generic.paletteram.u32;
+ pal_ptr = machine.generic.paletteram.u32;
if (!mode)
{
@@ -7592,14 +7592,14 @@ void K053250_set_LayerOffset(int chip, int offsx, int offsy)
// The DMA process should be instantaneous but since rendering in MAME is performed at SCREEN_UPDATE()
// the K053250 memory must be buffered to maintain visual integrity.
-static void K053250_dma(running_machine *machine, int chip, int limiter)
+static void K053250_dma(running_machine &machine, int chip, int limiter)
{
struct K053250_CHIPTAG *chip_ptr;
int last_frame, current_frame;
chip_ptr = &K053250_info.chip[chip];
- current_frame = machine->primary_screen->frame_number();
+ current_frame = machine.primary_screen->frame_number();
last_frame = chip_ptr->frame;
if (limiter && current_frame == last_frame) return; // make sure we only do DMA transfer once per frame
@@ -7610,13 +7610,13 @@ static void K053250_dma(running_machine *machine, int chip, int limiter)
}
// Pixel data of the K053250 is nibble packed. It's preferable to be unpacked into byte format.
-void K053250_unpack_pixels(running_machine *machine, const char *region)
+void K053250_unpack_pixels(running_machine &machine, const char *region)
{
UINT8 *src_ptr, *dst_ptr;
int hi_nibble, lo_nibble, offset;
- dst_ptr = src_ptr = machine->region(region)->base();
- offset = machine->region(region)->bytes() / 2 - 1;
+ dst_ptr = src_ptr = machine.region(region)->base();
+ offset = machine.region(region)->bytes() / 2 - 1;
do
{
@@ -7629,7 +7629,7 @@ void K053250_unpack_pixels(running_machine *machine, const char *region)
while ((--offset) >= 0);
}
-void K053250_vh_start(running_machine *machine, int chips, const char **region)
+void K053250_vh_start(running_machine &machine, int chips, const char **region)
{
UINT16 *ram;
int chip;
@@ -7638,14 +7638,14 @@ void K053250_vh_start(running_machine *machine, int chips, const char **region)
for(chip=0; chip<chips; chip++)
{
- K053250_info.chip[chip].base = machine->region(region[chip])->base();
+ K053250_info.chip[chip].base = machine.region(region[chip])->base();
ram = auto_alloc_array(machine, UINT16, 0x6000/2);
K053250_info.chip[chip].ram = ram;
K053250_info.chip[chip].rammax = ram + 0x800;
K053250_info.chip[chip].buffer[0] = ram + 0x2000;
K053250_info.chip[chip].buffer[1] = ram + 0x2800;
memset(ram+0x2000, 0, 0x2000);
- K053250_info.chip[chip].rommask = machine->region(region[chip])->bytes();
+ K053250_info.chip[chip].rommask = machine.region(region[chip])->bytes();
K053250_info.chip[chip].page[1] = K053250_info.chip[chip].page[0] = 0;
K053250_info.chip[chip].offsy = K053250_info.chip[chip].offsx = 0;
K053250_info.chip[chip].frame = -1;
@@ -7660,7 +7660,7 @@ WRITE16_HANDLER( K053250_0_w )
if (ACCESSING_BITS_0_7)
{
// start LVC DMA transfer at the falling edge of control register's bit1
- if (offset == 4 && !(data & 2) && (K053250_info.chip[0].regs[4] & 2)) K053250_dma(space->machine, 0, 1);
+ if (offset == 4 && !(data & 2) && (K053250_info.chip[0].regs[4] & 2)) K053250_dma(space->machine(), 0, 1);
K053250_info.chip[0].regs[offset] = data;
}
@@ -7694,7 +7694,7 @@ WRITE16_HANDLER( K053250_1_w )
if (ACCESSING_BITS_0_7)
{
// start LVC DMA transfer at the falling edge of control register's bit1
- if (offset == 4 && !(data & 2) && (K053250_info.chip[1].regs[4] & 2)) K053250_dma(space->machine, 1, 1);
+ if (offset == 4 && !(data & 2) && (K053250_info.chip[1].regs[4] & 2)) K053250_dma(space->machine(), 1, 1);
K053250_info.chip[1].regs[offset] = data;
}
@@ -7897,12 +7897,12 @@ static void K053250_pdraw_scanline8(
}
}
-void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int pri)
+void K053250_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int pri)
{
static int pmode[2] = {-1,-1};
static int kc=-1, kk=0, kxx=-105, kyy=0;
- const rectangle area = *machine->primary_screen->visible_area();
+ const rectangle area = *machine.primary_screen->visible_area();
UINT16 *line;
int delta, dim1, dim1_max, dim2_max;
UINT32 mask1, mask2;
@@ -8087,11 +8087,11 @@ void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *c
}
if(orientation & ORIENTATION_SWAP_XY)
K053250_pdraw_scanline8(bitmap, area.min_y, area.min_x+dim1, dim2_max, scanline,
- machine->pens + ((dim1 == kc ? 0x200 : colorbase) | ((color & 0x0f) << 4)),
+ machine.pens + ((dim1 == kc ? 0x200 : colorbase) | ((color & 0x0f) << 4)),
0, orientation, pri);
else
K053250_pdraw_scanline8(bitmap, area.min_x, area.min_y+dim1, dim2_max, scanline,
- machine->pens + ((dim1 == kc ? 0x200 : colorbase) | ((color & 0x0f) << 4)),
+ machine.pens + ((dim1 == kc ? 0x200 : colorbase) | ((color & 0x0f) << 4)),
0, orientation, pri);
}
}
@@ -8264,7 +8264,7 @@ INLINE void K053250_pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UIN
#undef FIXPOINT_PRECISION_HALF
}
-void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int flags, int priority)
+void K053250_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int flags, int priority)
{
struct K053250_CHIPTAG *chip_ptr;
UINT16 *line_ram;
@@ -8412,7 +8412,7 @@ void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *c
linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region
// load physical palette base
- pal_base = machine->pens + (colorbase << 4) % machine->total_colors();
+ pal_base = machine.pens + (colorbase << 4) % machine.total_colors();
// walk the target bitmap within the visible area vertically or horizontally, one line at a time
for (line_pos=line_start; line_pos<=line_end; linedata_offs+=linedata_adv, line_pos++)
@@ -8470,7 +8470,7 @@ void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *c
priority : value to be written to the priority bitmap, no effect when equals zero
*/
K053250_pdraw_scanline32(bitmap, pal_ptr, pix_ptr, cliprect,
- line_pos, scroll, zoom, src_clipmask, src_wrapmask, orientation, machine->priority_bitmap, (UINT8)priority);
+ line_pos, scroll, zoom, src_clipmask, src_wrapmask, orientation, machine.priority_bitmap, (UINT8)priority);
// shift scanline position one virtual screen upward to render the wrapped end if necessary
scroll -= dst_height;
diff --git a/src/mame/video/konamiic.h b/src/mame/video/konamiic.h
index b1970490f41..848019c1c52 100644
--- a/src/mame/video/konamiic.h
+++ b/src/mame/video/konamiic.h
@@ -1,15 +1,15 @@
#ifdef UNUSED_FUNCTION
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
-void konami_rom_deinterleave_2(running_machine *machine, const char *mem_region);
-void konami_rom_deinterleave_2_half(running_machine *machine, const char *mem_region);
+void konami_rom_deinterleave_2(running_machine &machine, const char *mem_region);
+void konami_rom_deinterleave_2_half(running_machine &machine, const char *mem_region);
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
-void konami_rom_deinterleave_4(running_machine *machine, const char *mem_region);
+void konami_rom_deinterleave_4(running_machine &machine, const char *mem_region);
#define MAX_K007121 2
extern UINT8 K007121_ctrlram[MAX_K007121][8];
-void K007121_ctrl_w(running_machine *machine, int chip,int offset,int data);
+void K007121_ctrl_w(running_machine &machine, int chip,int offset,int data);
WRITE8_HANDLER( K007121_ctrl_0_w );
WRITE8_HANDLER( K007121_ctrl_1_w );
void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, gfx_element **gfxs, colortable_t *ctable,
@@ -17,7 +17,7 @@ void K007121_sprites_draw(int chip,bitmap_t *bitmap,const rectangle *cliprect, g
int global_x_offset,int bank_base, UINT32 pri_mask);
-void K007342_vh_start(running_machine *machine, int gfx_index, void (*callback)(int layer,int bank,int *code,int *color,int *flags));
+void K007342_vh_start(running_machine &machine, int gfx_index, void (*callback)(int layer,int bank,int *code,int *color,int *flags));
READ8_HANDLER( K007342_r );
WRITE8_HANDLER( K007342_w );
READ8_HANDLER( K007342_scroll_r );
@@ -29,7 +29,7 @@ void K007342_tilemap_draw(bitmap_t *bitmap,const rectangle *cliprect,int num,int
int K007342_is_INT_enabled(void);
-void K007420_vh_start(running_machine *machine, int gfxnum, void (*callback)(int *code,int *color));
+void K007420_vh_start(running_machine &machine, int gfxnum, void (*callback)(int *code,int *color));
READ8_HANDLER( K007420_r );
WRITE8_HANDLER( K007420_w );
void K007420_sprites_draw(bitmap_t *bitmap,const rectangle *cliprect);
@@ -68,7 +68,7 @@ The callback must put:
*/
extern tilemap_t *K052109_tilemap[3];
-void K052109_vh_start(running_machine *machine,const char *gfx_memory_region,int plane_order,
+void K052109_vh_start(running_machine &machine,const char *gfx_memory_region,int plane_order,
void (*callback)(int layer,int bank,int *code,int *color,int *flags,int *priority));
/* plain 8-bit access */
READ8_HANDLER( K052109_r );
@@ -97,7 +97,7 @@ The callback must put:
shadow is preloaded with color & 0x80 so it doesn't need to be changed unless
the game has special treatment (Aliens)
*/
-void K051960_vh_start(running_machine *machine,const char *gfx_memory_region,int plane_order,
+void K051960_vh_start(running_machine &machine,const char *gfx_memory_region,int plane_order,
void (*callback)(int *code,int *color,int *priority,int *shadow));
READ8_HANDLER( K051960_r );
WRITE8_HANDLER( K051960_w );
@@ -107,7 +107,7 @@ READ8_HANDLER( K051937_r );
WRITE8_HANDLER( K051937_w );
READ16_HANDLER( K051937_word_r );
WRITE16_HANDLER( K051937_word_w );
-void K051960_sprites_draw(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect,int min_priority,int max_priority);
+void K051960_sprites_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int min_priority,int max_priority);
int K051960_is_IRQ_enabled(void);
int K051960_is_NMI_enabled(void);
void K051960_set_sprite_offsets(int dx, int dy);
@@ -117,7 +117,7 @@ READ8_HANDLER( K052109_051960_r );
WRITE8_HANDLER( K052109_051960_w );
-void K053245_vh_start(running_machine *machine,int chip, const char *gfx_memory_region,int plane_order,
+void K053245_vh_start(running_machine &machine,int chip, const char *gfx_memory_region,int plane_order,
void (*callback)(int *code,int *color,int *priority_mask));
READ16_HANDLER( K053245_word_r );
WRITE16_HANDLER( K053245_word_w );
@@ -132,8 +132,8 @@ WRITE16_HANDLER( K053244_lsb_w );
READ16_HANDLER( K053244_word_r );
WRITE16_HANDLER( K053244_word_w );
void K053244_bankselect(int chip, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */
-void K053245_sprites_draw(running_machine *machine, int chip, bitmap_t *bitmap,const rectangle *cliprect);
-void K053245_sprites_draw_lethal(running_machine *machine, int chip, bitmap_t *bitmap,const rectangle *cliprect); /* for lethal enforcers */
+void K053245_sprites_draw(running_machine &machine, int chip, bitmap_t *bitmap,const rectangle *cliprect);
+void K053245_sprites_draw_lethal(running_machine &machine, int chip, bitmap_t *bitmap,const rectangle *cliprect); /* for lethal enforcers */
void K053245_clear_buffer(int chip);
void K053245_set_SpriteOffset(int chip,int offsx, int offsy);
#endif
@@ -143,8 +143,8 @@ void K053245_set_SpriteOffset(int chip,int offsx, int offsy);
#define K055673_LAYOUT_LE2 2
#define K055673_LAYOUT_GX6 3
-void K055673_vh_start(running_machine *machine, const char *gfx_memory_region, int alt_layout, int dx, int dy,
- void (*callback)(running_machine *machine, int *code,int *color,int *priority));
+void K055673_vh_start(running_machine &machine, const char *gfx_memory_region, int alt_layout, int dx, int dy,
+ void (*callback)(running_machine &machine, int *code,int *color,int *priority));
READ16_HANDLER( K055673_rom_word_r );
READ16_HANDLER( K055673_GX6bpp_rom_word_r );
@@ -159,7 +159,7 @@ Callback procedures for non-standard shadows:
#define K053247_SHDSHIFT 20
#ifdef UNUSED_FUNCTION
-void K053247_vh_start(running_machine *machine, const char *gfx_memory_region,int dx,int dy,int plane_order,
+void K053247_vh_start(running_machine &machine, const char *gfx_memory_region,int dx,int dy,int plane_order,
void (*callback)(int *code,int *color,int *priority_mask));
READ8_HANDLER( K053247_r );
WRITE8_HANDLER( K053247_w );
@@ -171,7 +171,7 @@ WRITE32_HANDLER( K053247_long_w );
WRITE16_HANDLER( K053247_reg_word_w ); // "OBJSET2" registers
WRITE32_HANDLER( K053247_reg_long_w );
#ifdef UNUSED_FUNCTION
-void K053247_sprites_draw(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect);
+void K053247_sprites_draw(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect);
#endif
int K053247_read_register(int regnum);
void K053247_set_SpriteOffset(int offsx, int offsy);
@@ -179,7 +179,7 @@ void K053247_set_SpriteOffset(int offsx, int offsy);
void K053247_wraparound_enable(int status);
void K05324x_set_z_rejection(int zcode); // common to K053245/6/7
#endif
-void K053247_export_config(UINT16 **ram, gfx_element **gfx, void (**callback)(running_machine *, int *, int *, int *), int *dx, int *dy);
+void K053247_export_config(UINT16 **ram, gfx_element **gfx, void (**callback)(running_machine &, int *, int *, int *), int *dx, int *dy);
#ifdef UNUSED_FUNCTION
READ8_HANDLER( K053246_r );
@@ -208,13 +208,13 @@ The callback must put:
structure (e.g. TILE_FLIPX)
*/
#ifdef UNUSED_FUNCTION
-void K051316_vh_start_0(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_0(running_machine &machine,const char *gfx_memory_region,int bpp,
int tilemap_type,int transparent_pen,
void (*callback)(int *code,int *color,int *flags));
-void K051316_vh_start_1(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_1(running_machine &machine,const char *gfx_memory_region,int bpp,
int tilemap_type,int transparent_pen,
void (*callback)(int *code,int *color,int *flags));
-void K051316_vh_start_2(running_machine *machine,const char *gfx_memory_region,int bpp,
+void K051316_vh_start_2(running_machine &machine,const char *gfx_memory_region,int bpp,
int tilemap_type,int transparent_pen,
void (*callback)(int *code,int *color,int *flags));
READ8_HANDLER( K051316_0_r );
@@ -259,7 +259,7 @@ enum { K053251_CI0=0,K053251_CI1,K053251_CI2,K053251_CI3,K053251_CI4 };
int K053251_get_priority(int ci);
int K053251_get_palette_index(int ci);
void K053251_set_tilemaps(tilemap_t *ci0,tilemap_t *ci1,tilemap_t *ci2,tilemap_t *ci3,tilemap_t *ci4);
-void K053251_vh_start(running_machine *machine);
+void K053251_vh_start(running_machine &machine);
#ifdef UNUSED_FUNCTION
@@ -278,9 +278,9 @@ void K056832_SetExtLinescroll(void); /* Lethal Enforcers */
#define K056382_DRAW_FLAG_FORCE_XYSCROLL 0x00800000
-void K056832_vh_start(running_machine *machine, const char *gfx_memory_region, int bpp, int big,
+void K056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big,
int (*scrolld)[4][2],
- void (*callback)(running_machine *machine, int layer, int *code, int *color, int *flags),
+ void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags),
int djmain_hack);
READ16_HANDLER( K056832_ram_word_r );
WRITE16_HANDLER( K056832_ram_word_w );
@@ -316,9 +316,9 @@ WRITE8_HANDLER( K056832_b_w );
#endif
void K056832_mark_plane_dirty(int num);
void K056832_MarkAllTilemapsDirty(void);
-void K056832_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority);
+void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority);
#ifdef UNUSED_FUNCTION
-void K056832_tilemap_draw_dj(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority);
+void K056832_tilemap_draw_dj(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority);
void K056832_set_LayerAssociation(int status);
#endif
int K056832_get_LayerAssociation(void);
@@ -354,7 +354,7 @@ WRITE32_HANDLER( K056832_b_long_w );
#define K056832_BPP_8LE 5
#define K056832_BPP_8TASMAN 6
-void K055555_vh_start(running_machine *machine); // "PCU2"
+void K055555_vh_start(running_machine &machine); // "PCU2"
void K055555_write_reg(UINT8 regnum, UINT8 regdat);
WRITE16_HANDLER( K055555_word_w );
WRITE32_HANDLER( K055555_long_w );
@@ -427,13 +427,13 @@ int K055555_get_palette_index(int idx);
#define K55_INP_SUB3 0x80
/* K054338 mixer/alpha blender */
-void K054338_vh_start(running_machine *machine);
+void K054338_vh_start(running_machine &machine);
WRITE16_HANDLER( K054338_word_w ); // "CLCT" registers
WRITE32_HANDLER( K054338_long_w );
int K054338_read_register(int reg);
-void K054338_update_all_shadows(running_machine *machine, int rushingheroes_hack); // called at the beginning of SCREEN_UPDATE()
+void K054338_update_all_shadows(running_machine &machine, int rushingheroes_hack); // called at the beginning of SCREEN_UPDATE()
void K054338_fill_solid_bg(bitmap_t *bitmap); // solid backcolor fill
-void K054338_fill_backcolor(running_machine *machine, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient
+void K054338_fill_backcolor(running_machine &machine, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient
int K054338_set_alpha_level(int pblend); // blend style 0-2
void K054338_invert_alpha(int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod)
void K054338_export_config(int **shdRGB);
@@ -452,7 +452,7 @@ void K054338_export_config(int **shdRGB);
#define K338_CTL_WAILSL 0x10
#define K338_CTL_CLIPSL 0x20
-void K053250_vh_start(running_machine *machine, int chips, const char **region);
+void K053250_vh_start(running_machine &machine, int chips, const char **region);
WRITE16_HANDLER( K053250_0_w );
READ16_HANDLER( K053250_0_r );
WRITE16_HANDLER( K053250_0_ram_w );
@@ -470,11 +470,11 @@ READ16_HANDLER( K053250_1_rom_r );
#define K053250_WRAP500 0x01
#define K053250_OVERDRIVE 0x02
-void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int flags, int pri);
+void K053250_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int colorbase, int flags, int pri);
void K053250_set_LayerOffset(int chip, int offsx, int offsy);
-void K053250_unpack_pixels(running_machine *machine, const char *region);
+void K053250_unpack_pixels(running_machine &machine, const char *region);
#ifdef UNUSED_FUNCTION
-void K053250_dma(running_machine *machine, int chip, int limiter);
+void K053250_dma(running_machine &machine, int chip, int limiter);
#endif
diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c
index 982221cb0d2..1ec4ec70a9e 100644
--- a/src/mame/video/konicdev.c
+++ b/src/mame/video/konicdev.c
@@ -1211,39 +1211,39 @@ static void konami_shuffle_8(UINT8 *buf,int len)
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
-void konamid_rom_deinterleave_2(running_machine *machine, const char *mem_region)
+void konamid_rom_deinterleave_2(running_machine &machine, const char *mem_region)
{
- konami_shuffle_16((UINT16 *)machine->region(mem_region)->base(),machine->region(mem_region)->bytes()/2);
+ konami_shuffle_16((UINT16 *)machine.region(mem_region)->base(),machine.region(mem_region)->bytes()/2);
}
/* hacked version of rom_deinterleave_2_half for Lethal Enforcers */
-void konamid_rom_deinterleave_2_half(running_machine *machine, const char *mem_region)
+void konamid_rom_deinterleave_2_half(running_machine &machine, const char *mem_region)
{
- UINT8 *rgn = machine->region(mem_region)->base();
+ UINT8 *rgn = machine.region(mem_region)->base();
- konami_shuffle_16((UINT16 *)rgn,machine->region(mem_region)->bytes()/4);
- konami_shuffle_16((UINT16 *)(rgn+machine->region(mem_region)->bytes()/2),machine->region(mem_region)->bytes()/4);
+ konami_shuffle_16((UINT16 *)rgn,machine.region(mem_region)->bytes()/4);
+ konami_shuffle_16((UINT16 *)(rgn+machine.region(mem_region)->bytes()/2),machine.region(mem_region)->bytes()/4);
}
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
-void konamid_rom_deinterleave_4(running_machine *machine, const char *mem_region)
+void konamid_rom_deinterleave_4(running_machine &machine, const char *mem_region)
{
konamid_rom_deinterleave_2(machine, mem_region);
konamid_rom_deinterleave_2(machine, mem_region);
}
-static void decode_gfx(running_machine *machine, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp)
+static void decode_gfx(running_machine &machine, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp)
{
gfx_layout gl;
memcpy(&gl, layout, sizeof(gl));
gl.total = total;
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &gl, data, machine->total_colors() >> bpp, 0);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &gl, data, machine.total_colors() >> bpp, 0);
}
-static void deinterleave_gfx(running_machine *machine, const char *gfx_memory_region, int deinterleave)
+static void deinterleave_gfx(running_machine &machine, const char *gfx_memory_region, int deinterleave)
{
switch (deinterleave)
{
@@ -1259,7 +1259,7 @@ static void deinterleave_gfx(running_machine *machine, const char *gfx_memory_re
konamid_rom_deinterleave_4(machine, gfx_memory_region);
break;
case KONAMI_ROM_SHUFFLE8:
- konami_shuffle_8(machine->region(gfx_memory_region)->base(), machine->region(gfx_memory_region)->bytes());
+ konami_shuffle_8(machine.region(gfx_memory_region)->base(), machine.region(gfx_memory_region)->bytes());
break;
}
}
@@ -1377,7 +1377,7 @@ WRITE8_DEVICE_HANDLER( k007121_ctrl_w )
case 6:
/* palette bank change */
if ((k007121->ctrlram[offset] & 0x30) != (data & 0x30))
- tilemap_mark_all_tiles_dirty_all(device->machine);
+ tilemap_mark_all_tiles_dirty_all(device->machine());
break;
case 7:
k007121->flipscreen = data & 0x08;
@@ -1427,7 +1427,7 @@ void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
{
k007121_state *k007121 = k007121_get_safe_token(device);
// const gfx_element *gfx = gfxs[chip];
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
int flipscreen = k007121->flipscreen;
int i, num, inc, offs[5];
int is_flakatck = (ctable == NULL);
@@ -1668,7 +1668,7 @@ WRITE8_DEVICE_HANDLER( k007342_vreg_w )
break;
case 0x01: /* used for banking in Rock'n'Rage */
if (data != k007342->regs[1])
- tilemap_mark_all_tiles_dirty_all(device->machine);
+ tilemap_mark_all_tiles_dirty_all(device->machine());
case 0x02:
k007342->scrollx[0] = (k007342->scrollx[0] & 0xff) | ((data & 0x01) << 8);
k007342->scrollx[1] = (k007342->scrollx[1] & 0xff) | ((data & 0x02) << 7);
@@ -1794,7 +1794,7 @@ INLINE void k007342_get_tile_info( device_t *device, tile_data *tileinfo, int ti
tileinfo->category = (color & 0x80) >> 7;
- k007342->callback(device->machine, layer, k007342->regs[1], &code, &color, &flags);
+ k007342->callback(device->machine(), layer, k007342->regs[1], &code, &color, &flags);
SET_TILE_INFO_DEVICE(
k007342->gfxnum,
@@ -1831,8 +1831,8 @@ static DEVICE_START( k007342 )
k007342->tilemap[0] = tilemap_create_device(device, k007342_get_tile_info0, k007342_scan, 8, 8, 64, 32);
k007342->tilemap[1] = tilemap_create_device(device, k007342_get_tile_info1, k007342_scan, 8, 8, 64, 32);
- k007342->ram = auto_alloc_array(device->machine, UINT8, 0x2000);
- k007342->scroll_ram = auto_alloc_array(device->machine, UINT8, 0x0200);
+ k007342->ram = auto_alloc_array(device->machine(), UINT8, 0x2000);
+ k007342->scroll_ram = auto_alloc_array(device->machine(), UINT8, 0x0200);
k007342->colorram_0 = &k007342->ram[0x0000];
k007342->colorram_1 = &k007342->ram[0x1000];
@@ -1961,7 +1961,7 @@ void k007420_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
flipx = k007420->ram[offs + 4] & 0x04;
flipy = k007420->ram[offs + 4] & 0x08;
- k007420->callback(device->machine, &code, &color);
+ k007420->callback(device->machine(), &code, &color);
bank = code & bankmask;
code &= codemask;
@@ -2109,7 +2109,7 @@ static DEVICE_START( k007420 )
k007420->callback = intf->callback;
k007420->banklimit = intf->banklimit;
- k007420->ram = auto_alloc_array(device->machine, UINT8, 0x200);
+ k007420->ram = auto_alloc_array(device->machine(), UINT8, 0x200);
device->save_pointer(NAME(k007420->ram), 0x200);
device->save_item(NAME(k007420->flipscreen)); // current one uses 7342 one
@@ -2224,14 +2224,14 @@ READ8_DEVICE_HANDLER( k052109_r )
if (k052109->has_extra_video_ram)
code |= color << 8; /* kludge for X-Men */
else
- k052109->callback(device->machine, 0, bank, &code, &color, &flags, &priority);
+ k052109->callback(device->machine(), 0, bank, &code, &color, &flags, &priority);
addr = (code << 5) + (offset & 0x1f);
- addr &= device->machine->region(k052109->memory_region)->bytes() - 1;
+ addr &= device->machine().region(k052109->memory_region)->bytes() - 1;
// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", cpu_get_pc(space->cpu), offset, k052109->romsubbank, bank, addr);
- return device->machine->region(k052109->memory_region)->base()[addr];
+ return device->machine().region(k052109->memory_region)->base()[addr];
}
}
@@ -2616,7 +2616,7 @@ INLINE void k052109_get_tile_info( device_t *device, tile_data *tileinfo, int ti
flipy = color & 0x02;
- k052109->callback(device->machine, layer, bank, &code, &color, &flags, &priority);
+ k052109->callback(device->machine(), layer, bank, &code, &color, &flags, &priority);
/* if the callback set flip X but it is not enabled, turn it off */
if (!(k052109->tileflip_enable & 1))
@@ -2668,7 +2668,7 @@ static DEVICE_START( k052109 )
{
k052109_state *k052109 = k052109_get_safe_token(device);
const k052109_interface *intf = k052109_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT32 total;
static const gfx_layout charlayout =
{
@@ -2696,13 +2696,13 @@ static DEVICE_START( k052109 )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 32;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 32;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x1000;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout_gradius3, 4);
break;
default:
@@ -2746,7 +2746,7 @@ static DEVICE_START( k052109 )
device->save_item(NAME(k052109->dx));
device->save_item(NAME(k052109->dy));
device->save_item(NAME(k052109->has_extra_video_ram));
- device->machine->state().register_postload(k052109_tileflip_reset, k052109);
+ device->machine().state().register_postload(k052109_tileflip_reset, k052109);
}
static DEVICE_RESET( k052109 )
@@ -2832,14 +2832,14 @@ static int k051960_fetchromdata( device_t *device, int byte )
color = ((k051960->spriterombank[1] & 0xfc) >> 2) + ((k051960->spriterombank[2] & 0x03) << 6);
pri = 0;
shadow = color & 0x80;
- k051960->callback(device->machine, &code, &color, &pri, &shadow);
+ k051960->callback(device->machine(), &code, &color, &pri, &shadow);
addr = (code << 7) | (off1 << 2) | byte;
- addr &= device->machine->region(k051960->memory_region)->bytes() - 1;
+ addr &= device->machine().region(k051960->memory_region)->bytes() - 1;
-// popmessage("%s: addr %06x", device->machine->describe_context(), addr);
+// popmessage("%s: addr %06x", device->machine().describe_context(), addr);
- return device->machine->region(k051960->memory_region)->base()[addr];
+ return device->machine().region(k051960->memory_region)->base()[addr];
}
READ8_DEVICE_HANDLER( k051960_r )
@@ -2920,12 +2920,12 @@ WRITE8_DEVICE_HANDLER( k051937_w )
/* bit 5 = enable gfx ROM reading */
k051960->readroms = data & 0x20;
- //logerror("%04x: write %02x to 051937 address %x\n", cpu_get_pc(machine->cpu), data, offset);
+ //logerror("%04x: write %02x to 051937 address %x\n", cpu_get_pc(machine.cpu), data, offset);
}
else if (offset == 1)
{
-// popmessage("%04x: write %02x to 051937 address %x", cpu_get_pc(machine->cpu), data, offset);
-//logerror("%04x: write %02x to unknown 051937 address %x\n", cpu_get_pc(machine->cpu), data, offset);
+// popmessage("%04x: write %02x to 051937 address %x", cpu_get_pc(machine.cpu), data, offset);
+//logerror("%04x: write %02x to unknown 051937 address %x\n", cpu_get_pc(machine.cpu), data, offset);
}
else if (offset >= 2 && offset < 5)
{
@@ -2933,8 +2933,8 @@ WRITE8_DEVICE_HANDLER( k051937_w )
}
else
{
- // popmessage("%04x: write %02x to 051937 address %x", cpu_get_pc(machine->cpu), data, offset);
- //logerror("%04x: write %02x to unknown 051937 address %x\n", cpu_get_pc(machine->cpu), data, offset);
+ // popmessage("%04x: write %02x to 051937 address %x", cpu_get_pc(machine.cpu), data, offset);
+ //logerror("%04x: write %02x to unknown 051937 address %x\n", cpu_get_pc(machine.cpu), data, offset);
}
}
@@ -3007,7 +3007,7 @@ void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
{
#define NUM_SPRITES 128
k051960_state *k051960 = k051960_get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int offs, pri_code;
int sortedlist[NUM_SPRITES];
UINT8 drawmode_table[256];
@@ -3056,7 +3056,7 @@ void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color = k051960->ram[offs + 3] & 0xff;
pri = 0;
shadow = color & 0x80;
- k051960->callback(device->machine, &code, &color, &pri, &shadow);
+ k051960->callback(device->machine(), &code, &color, &pri, &shadow);
if (max_priority != -1)
if (pri < min_priority || pri > max_priority)
@@ -3123,15 +3123,15 @@ void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color,
flipx,flipy,
sx & 0x1ff,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
else
drawgfx_transtable(bitmap,cliprect,k051960->gfx,
c,
color,
flipx,flipy,
sx & 0x1ff,sy,
- drawmode_table,machine->shadow_table);
+ drawmode_table,machine.shadow_table);
}
}
}
@@ -3167,8 +3167,8 @@ void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
flipx,flipy,
sx & 0x1ff,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
else
drawgfxzoom_transtable(bitmap,cliprect,k051960->gfx,
c,
@@ -3176,7 +3176,7 @@ void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
flipx,flipy,
sx & 0x1ff,sy,
(zw << 16) / 16,(zh << 16) / 16,
- drawmode_table,machine->shadow_table);
+ drawmode_table,machine.shadow_table);
}
}
}
@@ -3205,7 +3205,7 @@ static DEVICE_START( k051960 )
{
k051960_state *k051960 = k051960_get_safe_token(device);
const k051960_interface *intf = k051960_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT32 total;
static const gfx_layout spritelayout =
{
@@ -3248,32 +3248,32 @@ static DEVICE_START( k051960 )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case REVERSE_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout_reverse, 4);
break;
case GRADIUS3_PLANE_ORDER:
total = 0x4000;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout_gradius3, 4);
break;
default:
fatalerror("Unknown plane_order");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
/* deinterleave the graphics, if needed */
deinterleave_gfx(machine, intf->gfx_memory_region, intf->deinterleave);
k051960->memory_region = intf->gfx_memory_region;
- k051960->gfx = machine->gfx[intf->gfx_num];
+ k051960->gfx = machine.gfx[intf->gfx_num];
k051960->callback = intf->callback;
k051960->ram = auto_alloc_array_clear(machine, UINT8, 0x400);
@@ -3421,7 +3421,7 @@ INLINE void k053245_update_buffer( device_t *device )
READ8_DEVICE_HANDLER( k053244_r )
{
k05324x_state *k053244 = k05324x_get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
if ((k053244->regs[5] & 0x10) && offset >= 0x0c && offset < 0x10)
{
@@ -3430,11 +3430,11 @@ READ8_DEVICE_HANDLER( k053244_r )
addr = (k053244->rombank << 19) | ((k053244->regs[11] & 0x7) << 18)
| (k053244->regs[8] << 10) | (k053244->regs[9] << 2)
| ((offset & 3) ^ 1);
- addr &= machine->region(k053244->memory_region)->bytes() - 1;
+ addr &= machine.region(k053244->memory_region)->bytes() - 1;
- // popmessage("%s: offset %02x addr %06x", machine->describe_context(), offset & 3, addr);
+ // popmessage("%s: offset %02x addr %06x", machine.describe_context(), offset & 3, addr);
- return machine->region(k053244->memory_region)->base()[addr];
+ return machine.region(k053244->memory_region)->base()[addr];
}
else if (offset == 0x06)
{
@@ -3443,7 +3443,7 @@ READ8_DEVICE_HANDLER( k053244_r )
}
else
{
- //logerror("%s: read from unknown 053244 address %x\n", machine->describe_context(), offset);
+ //logerror("%s: read from unknown 053244 address %x\n", machine.describe_context(), offset);
return 0;
}
}
@@ -3461,7 +3461,7 @@ WRITE8_DEVICE_HANDLER( k053244_w )
// popmessage("053244 reg 05 = %02x",data);
/* bit 2 = unknown, Parodius uses it */
/* bit 5 = unknown, Rollergames uses it */
-// logerror("%s: write %02x to 053244 address 5\n", device->machine->describe_context(), data);
+// logerror("%s: write %02x to 053244 address 5\n", device->machine().describe_context(), data);
break;
case 0x06:
@@ -3533,7 +3533,7 @@ void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
{
#define NUM_SPRITES 128
k05324x_state *k053245 = k05324x_get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int offs, pri_code, i;
int sortedlist[NUM_SPRITES];
int flipscreenX, flipscreenY, spriteoffsX, spriteoffsY;
@@ -3607,7 +3607,7 @@ void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color = k053245->buffer[offs + 6] & 0x00ff;
pri = 0;
- k053245->callback(device->machine, &code, &color, &pri);
+ k053245->callback(device->machine(), &code, &color, &pri);
size = (k053245->buffer[offs] & 0x0f00) >> 8;
@@ -3747,8 +3747,8 @@ void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
else
{
@@ -3758,8 +3758,8 @@ void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
fx,fy,
sx,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
}
@@ -3791,7 +3791,7 @@ void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rect
int sortedlist[NUM_SPRITES];
int flipscreenX, flipscreenY, spriteoffsX, spriteoffsY;
UINT8 drawmode_table[256];
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
memset(drawmode_table, DRAWMODE_SOURCE, sizeof(drawmode_table));
drawmode_table[0] = DRAWMODE_NONE;
@@ -3861,7 +3861,7 @@ void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rect
color = k053245->buffer[offs + 6] & 0x00ff;
pri = 0;
- k053245->callback(device->machine, &code, &color, &pri);
+ k053245->callback(device->machine(), &code, &color, &pri);
size = (k053245->buffer[offs] & 0x0f00) >> 8;
@@ -3928,7 +3928,7 @@ void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rect
ox -= (zoomx * w) >> 13;
oy -= (zoomy * h) >> 13;
- drawmode_table[machine->gfx[0]->color_granularity - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
+ drawmode_table[machine.gfx[0]->color_granularity - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
for (y = 0; y < h; y++)
{
@@ -3992,24 +3992,24 @@ void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rect
if (zoomx == 0x10000 && zoomy == 0x10000)
{
- pdrawgfx_transtable(bitmap,cliprect,machine->gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
+ pdrawgfx_transtable(bitmap,cliprect,machine.gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
c,
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
else
{
- pdrawgfxzoom_transtable(bitmap,cliprect,machine->gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
+ pdrawgfxzoom_transtable(bitmap,cliprect,machine.gfx[0], /* hardcoded to 0 (decoded 6bpp gfx) for le */
c,
color,
fx,fy,
sx,sy,
(zw << 16) / 16,(zh << 16) / 16,
- machine->priority_bitmap,pri,
- drawmode_table,machine->shadow_table);
+ machine.priority_bitmap,pri,
+ drawmode_table,machine.shadow_table);
}
}
@@ -4040,7 +4040,7 @@ static DEVICE_START( k05324x )
{
k05324x_state *k05324x = k05324x_get_safe_token(device);
const k05324x_interface *intf = k05324x_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT32 total;
static const gfx_layout spritelayout =
{
@@ -4059,15 +4059,15 @@ static DEVICE_START( k05324x )
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
default:
fatalerror("Unsupported plane_order");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
/* deinterleave the graphics, if needed */
@@ -4077,7 +4077,7 @@ static DEVICE_START( k05324x )
k05324x->z_rejection = -1;
k05324x->memory_region = intf->gfx_memory_region;
- k05324x->gfx = machine->gfx[intf->gfx_num];
+ k05324x->gfx = machine.gfx[intf->gfx_num];
k05324x->dx = intf->dx;
k05324x->dy = intf->dy;
k05324x->callback = intf->callback;
@@ -4284,9 +4284,9 @@ WRITE8_DEVICE_HANDLER( k053247_w )
READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
{
k053247_state *k053246 = k053247_get_safe_token(device);
- UINT8 *ROM8 = (UINT8 *)device->machine->region(k053246->memory_region)->base();
- UINT16 *ROM = (UINT16 *)device->machine->region(k053246->memory_region)->base();
- int size4 = (device->machine->region(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
+ UINT8 *ROM8 = (UINT8 *)device->machine().region(k053246->memory_region)->base();
+ UINT16 *ROM = (UINT16 *)device->machine().region(k053246->memory_region)->base();
+ int size4 = (device->machine().region(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
int romofs;
size4 *= 4 * 1024 * 1024; // get offset to 5th bit
@@ -4323,7 +4323,7 @@ READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r )
{
k053247_state *k053246 = k053247_get_safe_token(device);
- UINT16 *ROM = (UINT16 *)device->machine->region(k053246->memory_region)->base();
+ UINT16 *ROM = (UINT16 *)device->machine().region(k053246->memory_region)->base();
int romofs;
romofs = k053246->kx46_regs[6] << 16 | k053246->kx46_regs[7] << 8 | k053246->kx46_regs[4];
@@ -4363,10 +4363,10 @@ READ8_DEVICE_HANDLER( k053246_r )
int addr;
addr = (k053246->kx46_regs[6] << 17) | (k053246->kx46_regs[7] << 9) | (k053246->kx46_regs[4] << 1) | ((offset & 1) ^ 1);
- addr &= device->machine->region(k053246->memory_region)->bytes() - 1;
+ addr &= device->machine().region(k053246->memory_region)->bytes() - 1;
// if (VERBOSE)
// popmessage("%04x: offset %02x addr %06x", cpu_get_pc(space->cpu), offset, addr);
- return device->machine->region(k053246->memory_region)->base()[addr];
+ return device->machine().region(k053246->memory_region)->base()[addr];
}
else
{
@@ -4454,7 +4454,7 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
{
#define NUM_SPRITES 256
k053247_state *k053246 = k053247_get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
/* sprites can be grouped up to 8x8. The draw order is
0 1 4 5 16 17 20 21
@@ -4494,9 +4494,9 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS
*/
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
{
- if (bitmap->bpp == 32 && (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS))
+ if (bitmap->bpp == 32 && (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS))
shdmask = 3; // enable all shadows and highlights
else
shdmask = 0; // enable default shadows
@@ -4599,7 +4599,7 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
shadow = color = k053246->ram[offs + 6];
primask = 0;
- k053246->callback(device->machine, &code, &color, &primask);
+ k053246->callback(device->machine(), &code, &color, &primask);
temp = k053246->ram[offs];
@@ -4802,8 +4802,8 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color,
fx,fy,
sx,sy,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
else
{
@@ -4813,8 +4813,8 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
fx,fy,
sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
if (mirrory && h == 1) /* Simpsons shadows */
@@ -4826,8 +4826,8 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
color,
fx,!fy,
sx,sy,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
else
{
@@ -4837,8 +4837,8 @@ void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *
fx,!fy,
sx,sy,
(zw << 16) >> 4,(zh << 16) >> 4,
- machine->priority_bitmap,primask,
- whichtable,machine->shadow_table);
+ machine.priority_bitmap,primask,
+ whichtable,machine.shadow_table);
}
}
} // end of X loop
@@ -4857,7 +4857,7 @@ static DEVICE_START( k053247 )
{
k053247_state *k053247 = k053247_get_safe_token(device);
const k053247_interface *intf = k053247_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT32 total;
static const gfx_layout spritelayout =
{
@@ -4882,19 +4882,19 @@ static DEVICE_START( k053247 )
16*64
};
- k053247->screen = machine->device<screen_device>(intf->screen);
+ k053247->screen = machine.device<screen_device>(intf->screen);
/* decode the graphics */
switch (intf->plane_order)
{
case NORMAL_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &spritelayout, 4);
break;
case TASMAN_PLANE_ORDER:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &tasman_16x16_layout, 4);
break;
default:
@@ -4905,12 +4905,12 @@ static DEVICE_START( k053247 )
{
if (k053247->screen->format() == BITMAP_FORMAT_RGB32)
{
- if ((machine->config().m_video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS)
+ if ((machine.config().m_video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS)
popmessage("driver missing SHADOWS or HIGHLIGHTS flag");
}
else
{
- if (!(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
}
}
@@ -4921,7 +4921,7 @@ static DEVICE_START( k053247 )
k053247->dx = intf->dx;
k053247->dy = intf->dy;
k053247->memory_region = intf->gfx_memory_region;
- k053247->gfx = machine->gfx[intf->gfx_num];
+ k053247->gfx = machine.gfx[intf->gfx_num];
k053247->callback = intf->callback;
k053247->ram = auto_alloc_array_clear(machine, UINT16, 0x1000 / 2);
@@ -4939,7 +4939,7 @@ static DEVICE_START( k055673 )
{
k053247_state *k053247 = k053247_get_safe_token(device);
const k053247_interface *intf = k053247_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT32 total;
UINT8 *s1, *s2, *d;
long i;
@@ -4990,21 +4990,21 @@ static DEVICE_START( k055673 )
16*16*6
};
- k053247->screen = machine->device<screen_device>(intf->screen);
+ k053247->screen = machine.device<screen_device>(intf->screen);
- K055673_rom = (UINT16 *)machine->region(intf->gfx_memory_region)->base();
+ K055673_rom = (UINT16 *)machine.region(intf->gfx_memory_region)->base();
/* decode the graphics */
switch (intf->plane_order) /* layout would be more correct than plane_order, but we use k053247_interface */
{
case K055673_LAYOUT_GX:
- size4 = (machine->region(intf->gfx_memory_region)->bytes() / (1024 * 1024)) / 5;
+ size4 = (machine.region(intf->gfx_memory_region)->bytes() / (1024 * 1024)) / 5;
size4 *= 4 * 1024 * 1024;
/* set the # of tiles based on the 4bpp section */
K055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2);
d = (UINT8 *)K055673_rom;
// now combine the graphics together to form 5bpp
- s1 = machine->region(intf->gfx_memory_region)->base(); // 4bpp area
+ s1 = machine.region(intf->gfx_memory_region)->base(); // 4bpp area
s2 = s1 + (size4); // 1bpp area
for (i = 0; i < size4; i+= 4)
{
@@ -5020,17 +5020,17 @@ static DEVICE_START( k055673 )
break;
case K055673_LAYOUT_RNG:
- total = machine->region(intf->gfx_memory_region)->bytes() / (16 * 16 / 2);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16 / 2);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout2, 4);
break;
case K055673_LAYOUT_LE2:
- total = machine->region(intf->gfx_memory_region)->bytes() / (16 * 16);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout3, 4);
break;
case K055673_LAYOUT_GX6:
- total = machine->region(intf->gfx_memory_region)->bytes() / (16 * 16 * 6 / 8);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (16 * 16 * 6 / 8);
decode_gfx(machine, intf->gfx_num, (UINT8 *)K055673_rom, total, &spritelayout4, 4);
break;
@@ -5038,13 +5038,13 @@ static DEVICE_START( k055673 )
fatalerror("Unsupported layout");
}
- if (VERBOSE && !(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if (VERBOSE && !(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
popmessage("driver should use VIDEO_HAS_SHADOWS");
k053247->dx = intf->dx;
k053247->dy = intf->dy;
k053247->memory_region = intf->gfx_memory_region;
- k053247->gfx = machine->gfx[intf->gfx_num];
+ k053247->gfx = machine.gfx[intf->gfx_num];
k053247->callback = intf->callback;
k053247->ram = auto_alloc_array(machine, UINT16, 0x1000 / 2);
@@ -5168,15 +5168,15 @@ READ8_DEVICE_HANDLER( k051316_rom_r )
int addr = offset + (k051316->ctrlram[0x0c] << 11) + (k051316->ctrlram[0x0d] << 19);
if (k051316->bpp <= 4)
addr /= 2;
- addr &= device->machine->region(k051316->memory_region)->bytes() - 1;
+ addr &= device->machine().region(k051316->memory_region)->bytes() - 1;
- // popmessage("%s: offset %04x addr %04x", device->machine->describe_context(), offset, addr);
+ // popmessage("%s: offset %04x addr %04x", device->machine().describe_context(), offset, addr);
- return device->machine->region(k051316->memory_region)->base()[addr];
+ return device->machine().region(k051316->memory_region)->base()[addr];
}
else
{
- //logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", device->machine->describe_context(), offset);
+ //logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", device->machine().describe_context(), offset);
return 0;
}
}
@@ -5185,7 +5185,7 @@ WRITE8_DEVICE_HANDLER( k051316_ctrl_w )
{
k051316_state *k051316= k051316_get_safe_token(device);
k051316->ctrlram[offset] = data;
- //if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", device->machine->describe_context(), data, offset);
+ //if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", device->machine().describe_context(), data, offset);
}
// a few games (ajax, rollerg, ultraman, etc.) can enable and disable wraparound after start
@@ -5208,7 +5208,7 @@ INLINE void k051316_get_tile_info( device_t *device, tile_data *tileinfo, int ti
int color = k051316->ram[tile_index + 0x400];
int flags = 0;
- k051316->callback(device->machine, &code, &color, &flags);
+ k051316->callback(device->machine(), &code, &color, &flags);
SET_TILE_INFO_DEVICE(
k051316->gfxnum,
@@ -5275,7 +5275,7 @@ static DEVICE_START( k051316 )
{
k051316_state *k051316 = k051316_get_safe_token(device);
const k051316_interface *intf = k051316_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int is_tail2nos = 0;
UINT32 total;
@@ -5338,22 +5338,22 @@ static DEVICE_START( k051316 )
case -4:
total = 0x400;
is_tail2nos = 1;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout_tail2nos, 4);
break;
case 4:
- total = machine->region(intf->gfx_memory_region)->bytes() / 128;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 128;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case 7:
- total = machine->region(intf->gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout7, 7);
break;
case 8:
- total = machine->region(intf->gfx_memory_region)->bytes() / 256;
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
+ total = machine.region(intf->gfx_memory_region)->bytes() / 256;
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8, 8);
break;
default:
@@ -5600,8 +5600,8 @@ static DEVICE_START( k053936 )
k053936_state *k053936 = k053936_get_safe_token(device);
const k053936_interface *intf = k053936_get_interface(device);
- k053936->ctrl = auto_alloc_array(device->machine, UINT16, 0x20);
- k053936->linectrl = auto_alloc_array(device->machine, UINT16, 0x4000);
+ k053936->ctrl = auto_alloc_array(device->machine(), UINT16, 0x20);
+ k053936->linectrl = auto_alloc_array(device->machine(), UINT16, 0x4000);
k053936->wraparound = intf->wrap;
k053936->offset[0] = intf->xoff;
@@ -5674,7 +5674,7 @@ WRITE8_DEVICE_HANDLER( k053251_w )
}
if (!k053251->tilemaps_set)
- tilemap_mark_all_tiles_dirty_all(device->machine);
+ tilemap_mark_all_tiles_dirty_all(device->machine());
}
else if (offset == 10)
{
@@ -5690,7 +5690,7 @@ WRITE8_DEVICE_HANDLER( k053251_w )
}
if (!k053251->tilemaps_set)
- tilemap_mark_all_tiles_dirty_all(device->machine);
+ tilemap_mark_all_tiles_dirty_all(device->machine());
}
}
}
@@ -5757,7 +5757,7 @@ static DEVICE_START( k053251 )
device->save_item(NAME(k053251->tilemaps_set));
device->save_item(NAME(k053251->dirty_tmap));
- device->machine->state().register_postload(k053251_reset_indexes, k053251);
+ device->machine().state().register_postload(k053251_reset_indexes, k053251);
}
static DEVICE_RESET( k053251 )
@@ -6277,7 +6277,7 @@ INLINE void k056832_get_tile_info( device_t *device, tile_data *tileinfo, int ti
color = (attr & smptr->palm1) | (attr >> smptr->pals2 & smptr->palm2);
flags = TILE_FLIPYX(flip);
- k056832->callback(device->machine, layer, &code, &color, &flags);
+ k056832->callback(device->machine(), layer, &code, &color, &flags);
SET_TILE_INFO_DEVICE(
k056832->gfxnum,
@@ -6373,7 +6373,7 @@ static int k056832_rom_read_b( device_t *device, int offset, int blksize, int bl
UINT8 *rombase;
int base, ret;
- rombase = (UINT8 *)device->machine->region(k056832->memory_region)->base();
+ rombase = (UINT8 *)device->machine().region(k056832->memory_region)->base();
if ((k056832->rom_half) && (zerosec))
{
@@ -6464,7 +6464,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_r )
if (!k056832->rombase)
{
- k056832->rombase = device->machine->region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().region(k056832->memory_region)->base();
}
rombase = (UINT8 *)k056832->rombase;
@@ -6490,7 +6490,7 @@ READ16_DEVICE_HANDLER( k056832_mw_rom_word_r )
int addr;
if (!k056832->rombase)
- k056832->rombase = device->machine->region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().region(k056832->memory_region)->base();
if (k056832->regsb[2] & 0x8)
{
@@ -6553,7 +6553,7 @@ READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r )
int addr = 0x4000 * k056832->cur_gfx_banks + offset;
if (!k056832->rombase)
- k056832->rombase = device->machine->region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().region(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@@ -6564,7 +6564,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_8000_r )
int addr = 0x8000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
- k056832->rombase = device->machine->region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().region(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@@ -6575,7 +6575,7 @@ READ16_DEVICE_HANDLER( k056832_old_rom_word_r )
int addr = 0x2000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
- k056832->rombase = device->machine->region(k056832->memory_region)->base();
+ k056832->rombase = device->machine().region(k056832->memory_region)->base();
return k056832->rombase[addr + 1] | (k056832->rombase[addr] << 8);
}
@@ -7036,7 +7036,7 @@ static int k056832_update_linemap( device_t *device, bitmap_t *bitmap, int page,
{
bitmap_t *pixmap;
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
UINT8 code_transparent, code_opaque;
const pen_t *pal_ptr;
@@ -7059,8 +7059,8 @@ static int k056832_update_linemap( device_t *device, bitmap_t *bitmap, int page,
{ xpr_ptr[count+N] = 0; }
pixmap = k056832->pixmap[page];
- pal_ptr = machine->pens;
- src_gfx = machine->gfx[k056832->gfxnum];
+ pal_ptr = machine.pens;
+ src_gfx = machine.gfx[k056832->gfxnum];
src_pitch = src_gfx->line_modulo;
src_modulo = src_gfx->char_modulo;
dst_pitch = pixmap->rowpixels;
@@ -7762,7 +7762,7 @@ static DEVICE_START( k056832 )
{
k056832_state *k056832 = k056832_get_safe_token(device);
const k056832_interface *intf = k056832_get_interface(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
tilemap_t *tmap;
int i;
UINT32 total;
@@ -7847,45 +7847,45 @@ static DEVICE_START( k056832 )
switch (intf->bpp)
{
case K056832_BPP_4:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 4);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 4);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4, 4);
break;
case K056832_BPP_5:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 5);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 5);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout5, 4);
break;
case K056832_BPP_6:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 6);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 6);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout6, 4);
break;
case K056832_BPP_8:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8, 4);
break;
case K056832_BPP_8LE:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8le, 4);
break;
case K056832_BPP_8TASMAN:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 8);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 8);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout8_tasman, 4);
break;
case K056832_BPP_4dj:
- total = machine->region(intf->gfx_memory_region)->bytes() / (i * 4);
- decode_gfx(machine, intf->gfx_num, machine->region(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
+ total = machine.region(intf->gfx_memory_region)->bytes() / (i * 4);
+ decode_gfx(machine, intf->gfx_num, machine.region(intf->gfx_memory_region)->base(), total, &charlayout4dj, 4);
break;
default:
fatalerror("Unsupported bpp");
}
- machine->gfx[intf->gfx_num]->color_granularity = 16; /* override */
+ machine.gfx[intf->gfx_num]->color_granularity = 16; /* override */
/* deinterleave the graphics, if needed */
deinterleave_gfx(machine, intf->gfx_memory_region, intf->deinterleave);
@@ -7894,8 +7894,8 @@ static DEVICE_START( k056832 )
k056832->gfxnum = intf->gfx_num;
k056832->callback = intf->callback;
- k056832->rombase = machine->region(intf->gfx_memory_region)->base();
- k056832->num_gfx_banks = machine->region(intf->gfx_memory_region)->bytes() / 0x2000;
+ k056832->rombase = machine.region(intf->gfx_memory_region)->base();
+ k056832->num_gfx_banks = machine.region(intf->gfx_memory_region)->bytes() / 0x2000;
k056832->djmain_hack = intf->djmain_hack;
k056832->cur_gfx_banks = 0;
@@ -7921,7 +7921,7 @@ static DEVICE_START( k056832 )
k056832->active_layer = 0;
k056832->linemap_enabled = 0;
- k056832->k055555 = device->machine->device(intf->k055555);
+ k056832->k055555 = device->machine().device(intf->k055555);
memset(k056832->line_dirty, 0, sizeof(UINT32) * K056832_PAGE_COUNT * 8);
@@ -8003,7 +8003,7 @@ static DEVICE_START( k056832 )
device->save_item(NAME(k056832->last_colorbase[i]), i);
}
- device->machine->state().register_postload(k056832_postload, k056832);
+ device->machine().state().register_postload(k056832_postload, k056832);
}
/***************************************************************************/
@@ -8194,7 +8194,7 @@ int k054338_register_r( device_t *device, int reg )
void k054338_update_all_shadows( device_t *device, int rushingheroes_hack )
{
k054338_state *k054338 = k054338_get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, d;
int noclip = k054338->regs[K338_REG_CONTROL] & K338_CTL_CLIPSL;
@@ -8260,7 +8260,7 @@ void k054338_fill_backcolor( device_t *device, bitmap_t *bitmap, int mode ) // (
dst_ptr += clipx;
BGC_SET = 0;
- pal_ptr = device->machine->generic.paletteram.u32;
+ pal_ptr = device->machine().generic.paletteram.u32;
if (!mode || k054338->k055555 == NULL)
{
@@ -8413,8 +8413,8 @@ static DEVICE_START( k054338 )
k054338_state *k054338 = k054338_get_safe_token(device);
const k054338_interface *intf = k054338_get_interface(device);
- k054338->screen = device->machine->device<screen_device>(intf->screen);
- k054338->k055555 = device->machine->device(intf->k055555);
+ k054338->screen = device->machine().device<screen_device>(intf->screen);
+ k054338->k055555 = device->machine().device(intf->k055555);
k054338->alphainverted = intf->alpha_inv;
@@ -8536,13 +8536,13 @@ READ16_DEVICE_HANDLER( k053250_rom_r )
// Pixel data of the k053250 is nibble packed. It's preferable to be unpacked into byte format.
-static void k053250_unpack_pixels(running_machine *machine, const char *region)
+static void k053250_unpack_pixels(running_machine &machine, const char *region)
{
UINT8 *src_ptr, *dst_ptr;
int hi_nibble, lo_nibble, offset;
- dst_ptr = src_ptr = machine->region(region)->base();
- offset = machine->region(region)->bytes() / 2 - 1;
+ dst_ptr = src_ptr = machine.region(region)->base();
+ offset = machine.region(region)->bytes() / 2 - 1;
do
{
@@ -8869,7 +8869,7 @@ void k053250_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect
linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region
// load physical palette base
- pal_base = device->machine->pens + (colorbase << 4) % device->machine->total_colors();
+ pal_base = device->machine().pens + (colorbase << 4) % device->machine().total_colors();
// walk the target bitmap within the visible area vertically or horizontally, one line at a time
for (line_pos=line_start; line_pos <= line_end; linedata_offs += linedata_adv, line_pos++)
@@ -8927,7 +8927,7 @@ void k053250_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect
priority : value to be written to the priority bitmap, no effect when equals zero
*/
k053250_pdraw_scanline32(bitmap, pal_ptr, pix_ptr, cliprect,
- line_pos, scroll, zoom, src_clipmask, src_wrapmask, orientation, device->machine->priority_bitmap, (UINT8)priority);
+ line_pos, scroll, zoom, src_clipmask, src_wrapmask, orientation, device->machine().priority_bitmap, (UINT8)priority);
// shift scanline position one virtual screen upward to render the wrapped end if necessary
scroll -= dst_height;
@@ -8945,12 +8945,12 @@ static DEVICE_START( k053250 )
k053250_state *k053250 = k053250_get_safe_token(device);
const k053250_interface *intf = k053250_get_interface(device);
- k053250->base = device->machine->region(intf->gfx_memory_region)->base();
- k053250->rommask = device->machine->region(intf->gfx_memory_region)->bytes();
+ k053250->base = device->machine().region(intf->gfx_memory_region)->base();
+ k053250->rommask = device->machine().region(intf->gfx_memory_region)->bytes();
- k053250->screen = device->machine->device<screen_device>(intf->screen);
+ k053250->screen = device->machine().device<screen_device>(intf->screen);
- k053250->ram = auto_alloc_array(device->machine, UINT16, 0x6000 / 2);
+ k053250->ram = auto_alloc_array(device->machine(), UINT16, 0x6000 / 2);
k053250->rammax = k053250->ram + 0x800;
k053250->buffer[0] = k053250->ram + 0x2000;
@@ -8960,7 +8960,7 @@ static DEVICE_START( k053250 )
k053250->offsy = intf->yoff;
/* unpack graphics */
- k053250_unpack_pixels(device->machine, intf->gfx_memory_region);
+ k053250_unpack_pixels(device->machine(), intf->gfx_memory_region);
device->save_pointer(NAME(k053250->ram), 0x6000 / 2);
device->save_item(NAME(k053250->regs));
@@ -9113,7 +9113,7 @@ READ32_DEVICE_HANDLER( k001006_r )
{
case 0x0b: // CG Board ROM read
{
- UINT16 *rom = (UINT16*)device->machine->region(k001006->gfx_region)->base();
+ UINT16 *rom = (UINT16*)device->machine().region(k001006->gfx_region)->base();
return rom[k001006->addr / 2] << 16;
}
case 0x0d: // Palette RAM read
@@ -9203,9 +9203,9 @@ static DEVICE_START( k001006 )
k001006_state *k001006 = k001006_get_safe_token(device);
const k001006_interface *intf = k001006_get_interface(device);
- k001006->pal_ram = auto_alloc_array_clear(device->machine, UINT16, 0x800);
- k001006->unknown_ram = auto_alloc_array_clear(device->machine, UINT16, 0x1000);
- k001006->palette = auto_alloc_array(device->machine, UINT32, 0x800);
+ k001006->pal_ram = auto_alloc_array_clear(device->machine(), UINT16, 0x800);
+ k001006->unknown_ram = auto_alloc_array_clear(device->machine(), UINT16, 0x1000);
+ k001006->palette = auto_alloc_array(device->machine(), UINT32, 0x800);
k001006->gfx_region = intf->gfx_region;
@@ -9375,7 +9375,7 @@ void k001005_swap_buffers( device_t *device )
//if (k001005->status == 2)
{
- bitmap_fill(k001005->bitmap[k001005->bitmap_page], &k001005->cliprect, device->machine->pens[0] & 0x00ffffff);
+ bitmap_fill(k001005->bitmap[k001005->bitmap_page], &k001005->cliprect, device->machine().pens[0] & 0x00ffffff);
bitmap_fill(k001005->zbuffer, &k001005->cliprect, 0xffffffff);
}
}
@@ -10079,31 +10079,31 @@ static DEVICE_START( k001005 )
const k001005_interface *intf = k001005_get_interface(device);
int i, width, height;
- k001005->cpu = device->machine->device(intf->cpu);
- k001005->dsp = device->machine->device(intf->dsp);
- k001005->k001006_1 = device->machine->device(intf->k001006_1);
- k001005->k001006_2 = device->machine->device(intf->k001006_2);
+ k001005->cpu = device->machine().device(intf->cpu);
+ k001005->dsp = device->machine().device(intf->dsp);
+ k001005->k001006_1 = device->machine().device(intf->k001006_1);
+ k001005->k001006_2 = device->machine().device(intf->k001006_2);
- k001005->screen = device->machine->device<screen_device>(intf->screen);
+ k001005->screen = device->machine().device<screen_device>(intf->screen);
width = k001005->screen->width();
height = k001005->screen->height();
- k001005->zbuffer = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED32);
+ k001005->zbuffer = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED32);
- k001005->gfxrom = device->machine->region(intf->gfx_memory_region)->base();
+ k001005->gfxrom = device->machine().region(intf->gfx_memory_region)->base();
k001005->bitmap[0] = k001005->screen->alloc_compatible_bitmap();
k001005->bitmap[1] = k001005->screen->alloc_compatible_bitmap();
- k001005->texture = auto_alloc_array(device->machine, UINT8, 0x800000);
+ k001005->texture = auto_alloc_array(device->machine(), UINT8, 0x800000);
- k001005->ram[0] = auto_alloc_array(device->machine, UINT16, 0x140000);
- k001005->ram[1] = auto_alloc_array(device->machine, UINT16, 0x140000);
+ k001005->ram[0] = auto_alloc_array(device->machine(), UINT16, 0x140000);
+ k001005->ram[1] = auto_alloc_array(device->machine(), UINT16, 0x140000);
- k001005->fifo = auto_alloc_array(device->machine, UINT32, 0x800);
+ k001005->fifo = auto_alloc_array(device->machine(), UINT32, 0x800);
- k001005->_3d_fifo = auto_alloc_array(device->machine, UINT32, 0x10000);
+ k001005->_3d_fifo = auto_alloc_array(device->machine(), UINT32, 0x10000);
- k001005->poly = poly_alloc(device->machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ k001005->poly = poly_alloc(device->machine(), 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
for (i = 0; i < 128; i++)
{
@@ -10401,8 +10401,8 @@ READ32_DEVICE_HANDLER( k001604_reg_r )
switch (offset)
{
- case 0x54/4: return device->machine->rand() << 16; break;
- case 0x5c/4: return device->machine->rand() << 16 | device->machine->rand(); break;
+ case 0x54/4: return device->machine().rand() << 16; break;
+ case 0x5c/4: return device->machine().rand() << 16 | device->machine().rand(); break;
}
return k001604->reg[offset];
@@ -10478,8 +10478,8 @@ WRITE32_DEVICE_HANDLER( k001604_char_w )
COMBINE_DATA(k001604->char_ram + addr);
- gfx_element_mark_dirty(device->machine->gfx[k001604->gfx_index[0]], addr / 32);
- gfx_element_mark_dirty(device->machine->gfx[k001604->gfx_index[1]], addr / 128);
+ gfx_element_mark_dirty(device->machine().gfx[k001604->gfx_index[0]], addr / 32);
+ gfx_element_mark_dirty(device->machine().gfx[k001604->gfx_index[1]], addr / 128);
}
WRITE32_DEVICE_HANDLER( k001604_reg_w )
@@ -10520,9 +10520,9 @@ static DEVICE_START( k001604 )
k001604->gfx_index[0] = intf->gfx_index_1;
k001604->gfx_index[1] = intf->gfx_index_2;
- k001604->char_ram = auto_alloc_array(device->machine, UINT32, 0x200000 / 4);
- k001604->tile_ram = auto_alloc_array(device->machine, UINT32, 0x20000 / 4);
- k001604->reg = auto_alloc_array(device->machine, UINT32, 0x400 / 4);
+ k001604->char_ram = auto_alloc_array(device->machine(), UINT32, 0x200000 / 4);
+ k001604->tile_ram = auto_alloc_array(device->machine(), UINT32, 0x20000 / 4);
+ k001604->reg = auto_alloc_array(device->machine(), UINT32, 0x400 / 4);
/* create tilemaps */
roz_tile_size = k001604->roz_size ? 16 : 8;
@@ -10554,8 +10554,8 @@ static DEVICE_START( k001604 )
tilemap_set_transparent_pen(k001604->layer_8x8[0], 0);
tilemap_set_transparent_pen(k001604->layer_8x8[1], 0);
- device->machine->gfx[k001604->gfx_index[0]] = gfx_element_alloc(device->machine, &k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], device->machine->total_colors() / 16, 0);
- device->machine->gfx[k001604->gfx_index[1]] = gfx_element_alloc(device->machine, &k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], device->machine->total_colors() / 16, 0);
+ device->machine().gfx[k001604->gfx_index[0]] = gfx_element_alloc(device->machine(), &k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0);
+ device->machine().gfx[k001604->gfx_index[1]] = gfx_element_alloc(device->machine(), &k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0);
device->save_pointer(NAME(k001604->reg), 0x400 / 4);
device->save_pointer(NAME(k001604->char_ram), 0x200000 / 4);
@@ -10686,7 +10686,7 @@ static void update_palette_color( device_t *device, UINT32 palette_base, int col
k037122_state *k037122 = k037122_get_safe_token(device);
UINT32 data = k037122->tile_ram[(palette_base / 4) + color];
- palette_set_color_rgb(device->machine, color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11));
+ palette_set_color_rgb(device->machine(), color, pal5bit(data >> 6), pal6bit(data >> 0), pal5bit(data >> 11));
}
READ32_DEVICE_HANDLER( k037122_sram_r )
@@ -10750,7 +10750,7 @@ WRITE32_DEVICE_HANDLER( k037122_char_w )
UINT32 addr = offset + (bank * (0x40000/4));
COMBINE_DATA(k037122->char_ram + addr);
- gfx_element_mark_dirty(device->machine->gfx[k037122->gfx_index], addr / 32);
+ gfx_element_mark_dirty(device->machine().gfx[k037122->gfx_index], addr / 32);
}
READ32_DEVICE_HANDLER( k037122_reg_r )
@@ -10783,12 +10783,12 @@ static DEVICE_START( k037122 )
k037122_state *k037122 = k037122_get_safe_token(device);
const k037122_interface *intf = k037122_get_interface(device);
- k037122->screen = device->machine->device<screen_device>(intf->screen);
+ k037122->screen = device->machine().device<screen_device>(intf->screen);
k037122->gfx_index = intf->gfx_index;
- k037122->char_ram = auto_alloc_array(device->machine, UINT32, 0x200000 / 4);
- k037122->tile_ram = auto_alloc_array(device->machine, UINT32, 0x20000 / 4);
- k037122->reg = auto_alloc_array(device->machine, UINT32, 0x400 / 4);
+ k037122->char_ram = auto_alloc_array(device->machine(), UINT32, 0x200000 / 4);
+ k037122->tile_ram = auto_alloc_array(device->machine(), UINT32, 0x20000 / 4);
+ k037122->reg = auto_alloc_array(device->machine(), UINT32, 0x400 / 4);
k037122->layer[0] = tilemap_create_device(device, k037122_tile_info_layer0, tilemap_scan_rows, 8, 8, 256, 64);
k037122->layer[1] = tilemap_create_device(device, k037122_tile_info_layer1, tilemap_scan_rows, 8, 8, 128, 64);
@@ -10796,7 +10796,7 @@ static DEVICE_START( k037122 )
tilemap_set_transparent_pen(k037122->layer[0], 0);
tilemap_set_transparent_pen(k037122->layer[1], 0);
- device->machine->gfx[k037122->gfx_index] = gfx_element_alloc(device->machine, &k037122_char_layout, (UINT8*)k037122->char_ram, device->machine->total_colors() / 16, 0);
+ device->machine().gfx[k037122->gfx_index] = gfx_element_alloc(device->machine(), &k037122_char_layout, (UINT8*)k037122->char_ram, device->machine().total_colors() / 16, 0);
device->save_pointer(NAME(k037122->reg), 0x400 / 4);
device->save_pointer(NAME(k037122->char_ram), 0x200000 / 4);
diff --git a/src/mame/video/konicdev.h b/src/mame/video/konicdev.h
index 801eb933ad1..9795c4e5199 100644
--- a/src/mame/video/konicdev.h
+++ b/src/mame/video/konicdev.h
@@ -17,13 +17,13 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*k007342_callback)(running_machine *machine, int tmap, int bank, int *code, int *color, int *flags);
-typedef void (*k007420_callback)(running_machine *machine, int *code, int *color);
-typedef void (*k052109_callback)(running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority);
-typedef void (*k051960_callback)(running_machine *machine, int *code, int *color, int *priority, int *shadow);
-typedef void (*k05324x_callback)(running_machine *machine, int *code, int *color, int *priority);
-typedef void (*k051316_callback)(running_machine *machine, int *code, int *color, int *flags);
-typedef void (*k056832_callback)(running_machine *machine, int layer, int *code, int *color, int *flags);
+typedef void (*k007342_callback)(running_machine &machine, int tmap, int bank, int *code, int *color, int *flags);
+typedef void (*k007420_callback)(running_machine &machine, int *code, int *color);
+typedef void (*k052109_callback)(running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority);
+typedef void (*k051960_callback)(running_machine &machine, int *code, int *color, int *priority, int *shadow);
+typedef void (*k05324x_callback)(running_machine &machine, int *code, int *color, int *priority);
+typedef void (*k051316_callback)(running_machine &machine, int *code, int *color, int *flags);
+typedef void (*k056832_callback)(running_machine &machine, int layer, int *code, int *color, int *flags);
typedef struct _k007342_interface k007342_interface;
@@ -305,10 +305,10 @@ enum
};
/* helper function to join two 16-bit ROMs and form a 32-bit data stream */
-void konamid_rom_deinterleave_2(running_machine *machine, const char *mem_region);
-void konamid_rom_deinterleave_2_half(running_machine *machine, const char *mem_region);
+void konamid_rom_deinterleave_2(running_machine &machine, const char *mem_region);
+void konamid_rom_deinterleave_2_half(running_machine &machine, const char *mem_region);
/* helper function to join four 16-bit ROMs and form a 64-bit data stream */
-void konamid_rom_deinterleave_4(running_machine *machine, const char *mem_region);
+void konamid_rom_deinterleave_4(running_machine &machine, const char *mem_region);
/* helper function to sort three tile layers by priority order */
void konami_sortlayers3(int *layer, int *pri);
diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c
index 5d359214c44..34f27e9b635 100644
--- a/src/mame/video/kopunch.c
+++ b/src/mame/video/kopunch.c
@@ -7,7 +7,7 @@ PALETTE_INIT( kopunch )
int i;
color_prom += 24; /* first 24 colors are black */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -34,33 +34,33 @@ PALETTE_INIT( kopunch )
WRITE8_HANDLER( kopunch_videoram_w )
{
- kopunch_state *state = space->machine->driver_data<kopunch_state>();
+ kopunch_state *state = space->machine().driver_data<kopunch_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( kopunch_videoram2_w )
{
- kopunch_state *state = space->machine->driver_data<kopunch_state>();
+ kopunch_state *state = space->machine().driver_data<kopunch_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( kopunch_scroll_x_w )
{
- kopunch_state *state = space->machine->driver_data<kopunch_state>();
+ kopunch_state *state = space->machine().driver_data<kopunch_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( kopunch_scroll_y_w )
{
- kopunch_state *state = space->machine->driver_data<kopunch_state>();
+ kopunch_state *state = space->machine().driver_data<kopunch_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( kopunch_gfxbank_w )
{
- kopunch_state *state = space->machine->driver_data<kopunch_state>();
+ kopunch_state *state = space->machine().driver_data<kopunch_state>();
if (state->gfxbank != (data & 0x07))
{
state->gfxbank = data & 0x07;
@@ -72,7 +72,7 @@ WRITE8_HANDLER( kopunch_gfxbank_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(0, code, 0, 0);
@@ -80,7 +80,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
int code = (state->videoram2[tile_index] & 0x7f) + 128 * state->gfxbank;
SET_TILE_INFO(1, code, 0, 0);
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( kopunch )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
@@ -99,7 +99,7 @@ VIDEO_START( kopunch )
SCREEN_UPDATE( kopunch )
{
- kopunch_state *state = screen->machine->driver_data<kopunch_state>();
+ kopunch_state *state = screen->machine().driver_data<kopunch_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/ksayakyu.c b/src/mame/video/ksayakyu.c
index f12ef2b7768..f116ed0a040 100644
--- a/src/mame/video/ksayakyu.c
+++ b/src/mame/video/ksayakyu.c
@@ -4,7 +4,7 @@
WRITE8_HANDLER(ksayakyu_videoram_w)
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->videoram[offset]=data;
tilemap_mark_tile_dirty(state->textmap, offset >> 1);
}
@@ -20,11 +20,11 @@ WRITE8_HANDLER(ksayakyu_videoctrl_w)
xxx - scroll offset
*/
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->video_ctrl = data;
state->flipscreen = data & 4;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
tilemap_set_scrolly(state->tilemap, 0, (data & 0xe0) << 3);
if(state->flipscreen)
tilemap_set_flip(state->tilemap, (data & 2) ? TILEMAP_FLIPY : TILEMAP_FLIPX | TILEMAP_FLIPY);
@@ -34,7 +34,7 @@ WRITE8_HANDLER(ksayakyu_videoctrl_w)
PALETTE_INIT( ksayakyu )
{
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
int r, g, b, i;
for (i = 0; i < 0x100; i++)
@@ -49,8 +49,8 @@ PALETTE_INIT( ksayakyu )
static TILE_GET_INFO( get_ksayakyu_tile_info )
{
- int code = machine->region("user1")->base()[tile_index];
- int attr = machine->region("user1")->base()[tile_index + 0x2000];
+ int code = machine.region("user1")->base()[tile_index];
+ int attr = machine.region("user1")->base()[tile_index + 0x2000];
code += (attr & 3) << 8;
SET_TILE_INFO(1, code, ((attr >> 2) & 0x0f) * 2, (attr & 0x80) ? TILE_FLIPX : 0);
}
@@ -62,7 +62,7 @@ xy-- ---- flip bits
*/
static TILE_GET_INFO( get_text_tile_info )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
int code = state->videoram[tile_index * 2 + 1];
int attr = state->videoram[tile_index * 2];
int flags = ((attr & 0x80) ? TILE_FLIPX : 0) | ((attr & 0x40) ? TILE_FLIPY : 0);
@@ -81,9 +81,9 @@ static TILE_GET_INFO( get_text_tile_info )
[3]
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
const UINT8 *source = state->spriteram + state->spriteram_size - 4;
const UINT8 *finish = state->spriteram;
@@ -96,7 +96,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int flipx = (tile & 0x80) ? 1 : 0;
int flipy = 0;
- gfx_element *gfx = machine->gfx[2];
+ gfx_element *gfx = machine.gfx[2];
if (state->flipscreen)
{
@@ -118,7 +118,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
VIDEO_START(ksayakyu)
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
state->tilemap = tilemap_create(machine, get_ksayakyu_tile_info, tilemap_scan_rows, 8, 8, 32, 32 * 8);
state->textmap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->textmap, 0);
@@ -126,7 +126,7 @@ VIDEO_START(ksayakyu)
SCREEN_UPDATE(ksayakyu)
{
- ksayakyu_state *state = screen->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = screen->machine().driver_data<ksayakyu_state>();
bitmap_fill(bitmap, cliprect, 0);
@@ -134,6 +134,6 @@ SCREEN_UPDATE(ksayakyu)
tilemap_draw(bitmap, cliprect,state->tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->textmap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/kyugo.c b/src/mame/video/kyugo.c
index 676d7f5dd00..a07a07fca6f 100644
--- a/src/mame/video/kyugo.c
+++ b/src/mame/video/kyugo.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
int code = state->fgvideoram[tile_index];
SET_TILE_INFO(0,
code,
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
int code = state->bgvideoram[tile_index];
int attr = state->bgattribram[tile_index];
SET_TILE_INFO(1,
@@ -45,9 +45,9 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( kyugo )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
- state->color_codes = machine->region("proms")->base() + 0x300;
+ state->color_codes = machine.region("proms")->base() + 0x300;
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -67,7 +67,7 @@ VIDEO_START( kyugo )
WRITE8_HANDLER( kyugo_fgvideoram_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -76,7 +76,7 @@ WRITE8_HANDLER( kyugo_fgvideoram_w )
WRITE8_HANDLER( kyugo_bgvideoram_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -85,7 +85,7 @@ WRITE8_HANDLER( kyugo_bgvideoram_w )
WRITE8_HANDLER( kyugo_bgattribram_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
state->bgattribram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -94,7 +94,7 @@ WRITE8_HANDLER( kyugo_bgattribram_w )
READ8_HANDLER( kyugo_spriteram_2_r )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
// only the lower nibble is connected
return state->spriteram_2[offset] | 0xf0;
@@ -103,14 +103,14 @@ READ8_HANDLER( kyugo_spriteram_2_r )
WRITE8_HANDLER( kyugo_scroll_x_lo_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
state->scroll_x_lo = data;
}
WRITE8_HANDLER( kyugo_gfxctrl_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
/* bit 0 is scroll MSB */
state->scroll_x_hi = data & 0x01;
@@ -137,19 +137,19 @@ WRITE8_HANDLER( kyugo_gfxctrl_w )
WRITE8_HANDLER( kyugo_scroll_y_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
state->scroll_y = data;
}
WRITE8_HANDLER( kyugo_flipscreen_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
if (state->flipscreen != (data & 0x01))
{
state->flipscreen = (data & 0x01);
- tilemap_set_flip_all(space->machine, (state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY): 0));
+ tilemap_set_flip_all(space->machine(), (state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY): 0));
}
}
@@ -160,9 +160,9 @@ WRITE8_HANDLER( kyugo_flipscreen_w )
*
*************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
/* sprite information is scattered through memory */
/* and uses a portion of the text layer memory (outside the visible area) */
@@ -210,7 +210,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
- drawgfx_transpen( bitmap, cliprect,machine->gfx[2],
+ drawgfx_transpen( bitmap, cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -222,7 +222,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( kyugo )
{
- kyugo_state *state = screen->machine->driver_data<kyugo_state>();
+ kyugo_state *state = screen->machine().driver_data<kyugo_state>();
if (state->flipscreen)
tilemap_set_scrollx(state->bg_tilemap, 0, -(state->scroll_x_lo + (state->scroll_x_hi * 256)));
@@ -232,7 +232,7 @@ SCREEN_UPDATE( kyugo )
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/labyrunr.c b/src/mame/video/labyrunr.c
index 51f037b6fd4..bde25a05891 100644
--- a/src/mame/video/labyrunr.c
+++ b/src/mame/video/labyrunr.c
@@ -7,7 +7,7 @@ PALETTE_INIT( labyrunr )
int pal;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x80);
+ machine.colortable = colortable_alloc(machine, 0x80);
for (pal = 0; pal < 8; pal++)
{
@@ -17,7 +17,7 @@ PALETTE_INIT( labyrunr )
int i;
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
+ colortable_entry_set_value(machine.colortable, (pal << 8) | i, (pal << 4) | (i & 0x0f));
}
/* sprites */
else
@@ -33,16 +33,16 @@ PALETTE_INIT( labyrunr )
else
ctabentry = (pal << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, (pal << 8) | i, ctabentry);
+ colortable_entry_set_value(machine.colortable, (pal << 8) | i, ctabentry);
}
}
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
int i;
for (i = 0x00; i < 0x100; i += 2)
@@ -51,7 +51,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -65,7 +65,7 @@ static void set_pens( running_machine *machine )
static TILE_GET_INFO( get_tile_info0 )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121, 5);
@@ -95,7 +95,7 @@ static TILE_GET_INFO( get_tile_info0 )
static TILE_GET_INFO( get_tile_info1 )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
UINT8 ctrl_3 = k007121_ctrlram_r(state->k007121, 3);
UINT8 ctrl_4 = k007121_ctrlram_r(state->k007121, 4);
UINT8 ctrl_5 = k007121_ctrlram_r(state->k007121, 5);
@@ -132,7 +132,7 @@ static TILE_GET_INFO( get_tile_info1 )
VIDEO_START( labyrunr )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
state->layer0 = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 8, 8, 32, 32);
state->layer1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32);
@@ -140,10 +140,10 @@ VIDEO_START( labyrunr )
tilemap_set_transparent_pen(state->layer0, 0);
tilemap_set_transparent_pen(state->layer1, 0);
- state->clip0 = machine->primary_screen->visible_area();
+ state->clip0 = machine.primary_screen->visible_area();
state->clip0.min_x += 40;
- state->clip1 = machine->primary_screen->visible_area();
+ state->clip1 = machine.primary_screen->visible_area();
state->clip1.max_x = 39;
state->clip1.min_x = 0;
@@ -160,14 +160,14 @@ VIDEO_START( labyrunr )
WRITE8_HANDLER( labyrunr_vram1_w )
{
- labyrunr_state *state = space->machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = space->machine().driver_data<labyrunr_state>();
state->videoram1[offset] = data;
tilemap_mark_tile_dirty(state->layer0, offset & 0x3ff);
}
WRITE8_HANDLER( labyrunr_vram2_w )
{
- labyrunr_state *state = space->machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = space->machine().driver_data<labyrunr_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->layer1, offset & 0x3ff);
}
@@ -182,14 +182,14 @@ WRITE8_HANDLER( labyrunr_vram2_w )
SCREEN_UPDATE( labyrunr )
{
- labyrunr_state *state = screen->machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = screen->machine().driver_data<labyrunr_state>();
UINT8 ctrl_0 = k007121_ctrlram_r(state->k007121, 0);
rectangle finalclip0, finalclip1;
- set_pens(screen->machine);
+ set_pens(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap, cliprect,0);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect,0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (~k007121_ctrlram_r(state->k007121, 3) & 0x20)
{
@@ -214,7 +214,7 @@ SCREEN_UPDATE( labyrunr )
}
tilemap_draw(bitmap, &finalclip0, state->layer0, TILEMAP_DRAW_OPAQUE, 0);
- k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine->gfx[0], screen->machine->colortable, state->spriteram,(k007121_ctrlram_r(state->k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->k007121, 3) & 0x40) >> 5);
+ k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->spriteram,(k007121_ctrlram_r(state->k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->k007121, 3) & 0x40) >> 5);
/* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
tilemap_draw(bitmap, &finalclip1, state->layer1, TILEMAP_DRAW_OPAQUE, 0);
}
@@ -284,7 +284,7 @@ SCREEN_UPDATE( labyrunr )
if(use_clip3[1])
tilemap_draw(bitmap, &finalclip3, state->layer1, 0, 1);
- k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine->gfx[0], screen->machine->colortable, state->spriteram, (k007121_ctrlram_r(state->k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->k007121, 3) & 0x40) >> 5);
+ k007121_sprites_draw(state->k007121, bitmap, cliprect, screen->machine().gfx[0], screen->machine().colortable, state->spriteram, (k007121_ctrlram_r(state->k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->k007121, 3) & 0x40) >> 5);
}
return 0;
}
diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c
index 8e471581cf8..0cf82053d18 100644
--- a/src/mame/video/ladybug.c
+++ b/src/mame/video/ladybug.c
@@ -29,7 +29,7 @@
***************************************************************************/
-static void palette_init_common( running_machine *machine, const UINT8 *color_prom, int colortable_size,
+static void palette_init_common( running_machine &machine, const UINT8 *color_prom, int colortable_size,
int r_bit0, int r_bit1, int g_bit0, int g_bit1, int b_bit0, int b_bit1 )
{
static const int resistances[2] = { 470, 220 };
@@ -43,7 +43,7 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
2, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, colortable_size);
+ machine.colortable = colortable_alloc(machine, colortable_size);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -66,7 +66,7 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
bit1 = (~color_prom[i] >> b_bit1) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -76,7 +76,7 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
for (i = 0; i < 0x20; i++)
{
UINT8 ctabentry = ((i << 3) & 0x18) | ((i >> 2) & 0x07);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites */
@@ -85,10 +85,10 @@ static void palette_init_common( running_machine *machine, const UINT8 *color_pr
UINT8 ctabentry = color_prom[(i - 0x20) >> 1];
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 0) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine->colortable, i + 0x00, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x00, ctabentry);
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 4) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine->colortable, i + 0x20, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x20, ctabentry);
}
}
@@ -125,42 +125,42 @@ PALETTE_INIT( sraider )
bit0 = ((i - 0x20) >> 0) & 0x01;
r = 0x47 * bit0;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x60; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x60) + 0x20);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x60) + 0x20);
/* stationary part of grid */
- colortable_entry_set_value(machine->colortable, 0x81, 0x40);
+ colortable_entry_set_value(machine.colortable, 0x81, 0x40);
}
WRITE8_HANDLER( ladybug_videoram_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( ladybug_colorram_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( ladybug_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( sraider_io_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
// bit7 = flip
// bit6 = grid red
@@ -169,15 +169,15 @@ WRITE8_HANDLER( sraider_io_w )
// bit3 = enable stars
// bit210 = stars speed/dir
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
state->grid_color = data & 0x70;
- redclash_set_stars_enable(space->machine, (data & 0x08) >> 3);
+ redclash_set_stars_enable(space->machine(), (data & 0x08) >> 3);
/*
* There must be a subtle clocking difference between
@@ -185,12 +185,12 @@ WRITE8_HANDLER( sraider_io_w )
* hence the -1 here
*/
- redclash_set_stars_speed(space->machine, (data & 0x07) - 1);
+ redclash_set_stars_speed(space->machine(), (data & 0x07) - 1);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
int code = state->videoram[tile_index] + 32 * (state->colorram[tile_index] & 0x08);
int color = state->colorram[tile_index] & 0x07;
@@ -211,7 +211,7 @@ static TILE_GET_INFO( get_grid_tile_info )
VIDEO_START( ladybug )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
@@ -220,7 +220,7 @@ VIDEO_START( ladybug )
VIDEO_START( sraider )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
state->grid_tilemap = tilemap_create(machine, get_grid_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->grid_tilemap, 32);
@@ -231,9 +231,9 @@ VIDEO_START( sraider )
tilemap_set_transparent_pen(state->bg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -264,14 +264,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (spriteram[offs + i] & 0x80)
{
if (spriteram[offs + i] & 0x40) /* 16x16 */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram[offs + i + 1] >> 2) + 4 * (spriteram[offs + i + 2] & 0x10),
spriteram[offs + i + 2] & 0x0f,
spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10,
spriteram[offs + i + 3],
offs / 4 - 8 + (spriteram[offs + i] & 0x0f),0);
else /* 8x8 */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
spriteram[offs + i + 1] + 16 * (spriteram[offs + i + 2] & 0x10),
spriteram[offs + i + 2] & 0x0f,
spriteram[offs + i] & 0x20,spriteram[offs + i] & 0x10,
@@ -284,7 +284,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ladybug )
{
- ladybug_state *state = screen->machine->driver_data<ladybug_state>();
+ ladybug_state *state = screen->machine().driver_data<ladybug_state>();
int offs;
// clear the bg bitmap
@@ -295,14 +295,14 @@ SCREEN_UPDATE( ladybug )
int sx = offs % 4;
int sy = offs / 4;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
tilemap_set_scrollx(state->bg_tilemap, offs, -state->videoram[32 * sx + sy]);
else
tilemap_set_scrollx(state->bg_tilemap, offs, state->videoram[32 * sx + sy]);
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -313,7 +313,7 @@ SCREEN_EOF( sraider ) /* update starfield position */
SCREEN_UPDATE( sraider )
{
- ladybug_state *state = screen->machine->driver_data<ladybug_state>();
+ ladybug_state *state = screen->machine().driver_data<ladybug_state>();
// this part is boilerplate from ladybug, not sure if hardware does this,
// since it's not used
@@ -326,7 +326,7 @@ SCREEN_UPDATE( sraider )
int sx = offs % 4;
int sy = offs / 4;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
tilemap_set_scrollx(state->bg_tilemap, offs, -state->videoram[32 * sx + sy]);
else
tilemap_set_scrollx(state->bg_tilemap, offs, state->videoram[32 * sx + sy]);
@@ -336,16 +336,16 @@ SCREEN_UPDATE( sraider )
bitmap_fill(bitmap, cliprect, 0);
// draw the stars
- if (flip_screen_get(screen->machine))
- redclash_draw_stars(screen->machine, bitmap, cliprect, 0x60, 1, 0x27, 0xff);
+ if (flip_screen_get(screen->machine()))
+ redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 1, 0x27, 0xff);
else
- redclash_draw_stars(screen->machine, bitmap, cliprect, 0x60, 1, 0x00, 0xd8);
+ redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 1, 0x00, 0xd8);
// draw the gridlines
- colortable_palette_set_color(screen->machine->colortable, 0x40, MAKE_RGB(state->grid_color & 0x40 ? 0xff : 0,
+ colortable_palette_set_color(screen->machine().colortable, 0x40, MAKE_RGB(state->grid_color & 0x40 ? 0xff : 0,
state->grid_color & 0x20 ? 0xff : 0,
state->grid_color & 0x10 ? 0xff : 0));
- tilemap_draw(bitmap, cliprect, state->grid_tilemap, 0, flip_screen_get(screen->machine));
+ tilemap_draw(bitmap, cliprect, state->grid_tilemap, 0, flip_screen_get(screen->machine()));
for (i = 0; i < 0x100; i++)
{
@@ -354,7 +354,7 @@ SCREEN_UPDATE( sraider )
UINT8 x = i;
int height = cliprect->max_y - cliprect->min_y + 1;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
x = ~x;
plot_box(bitmap, x, cliprect->min_y, 1, height, 0x81);
@@ -362,10 +362,10 @@ SCREEN_UPDATE( sraider )
}
// now the chars
- tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, flip_screen_get(screen->machine));
+ tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, flip_screen_get(screen->machine()));
// now the sprites
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/ladyfrog.c b/src/mame/video/ladyfrog.c
index 691511b54d2..ed7a3616ca2 100644
--- a/src/mame/video/ladyfrog.c
+++ b/src/mame/video/ladyfrog.c
@@ -11,19 +11,19 @@
WRITE8_HANDLER(ladyfrog_spriteram_w)
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->spriteram[offset] = data;
}
READ8_HANDLER(ladyfrog_spriteram_r)
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
return state->spriteram[offset];
}
static TILE_GET_INFO( get_tile_info )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
int pal = state->videoram[tile_index * 2 + 1] & 0x0f;
int tile = state->videoram[tile_index * 2] + ((state->videoram[tile_index * 2 + 1] & 0xc0) << 2)+ ((state->videoram[tile_index * 2 + 1] & 0x30) << 6);
SET_TILE_INFO(
@@ -35,20 +35,20 @@ static TILE_GET_INFO( get_tile_info )
WRITE8_HANDLER( ladyfrog_videoram_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
}
READ8_HANDLER( ladyfrog_videoram_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( ladyfrog_palette_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
if (offset & 0x100)
paletteram_xxxxBBBBGGGGRRRR_split2_w(space, (offset & 0xff) + (state->palette_bank << 8), data);
@@ -58,23 +58,23 @@ WRITE8_HANDLER( ladyfrog_palette_w )
READ8_HANDLER( ladyfrog_palette_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
if (offset & 0x100)
- return space->machine->generic.paletteram2.u8[(offset & 0xff) + (state->palette_bank << 8)];
+ return space->machine().generic.paletteram2.u8[(offset & 0xff) + (state->palette_bank << 8)];
else
- return space->machine->generic.paletteram.u8[(offset & 0xff) + (state->palette_bank << 8)];
+ return space->machine().generic.paletteram.u8[(offset & 0xff) + (state->palette_bank << 8)];
}
WRITE8_HANDLER( ladyfrog_gfxctrl_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->palette_bank = (data & 0x20) >> 5;
}
WRITE8_HANDLER( ladyfrog_gfxctrl2_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->tilebank = ((data & 0x18) >> 3) ^ 3;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -91,21 +91,21 @@ READ8_HANDLER( ladyfrog_gfxctrl_r )
READ8_HANDLER( ladyfrog_scrlram_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
return state->scrlram[offset];
}
WRITE8_HANDLER( ladyfrog_scrlram_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->scrlram[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, offset, data);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
int i;
for (i = 0; i < 0x20; i++)
{
@@ -119,7 +119,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sy = 238 - state->spriteram[offs + 0];
flipx = ((state->spriteram[offs + 1] & 0x40)>>6);
flipy = ((state->spriteram[offs + 1] & 0x80)>>7);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
pal,
flipx,flipy,
@@ -128,7 +128,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (state->spriteram[offs + 3] > 240)
{
sx = (state->spriteram[offs + 3] - 256);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
pal,
flipx,flipy,
@@ -140,24 +140,24 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_START( ladyfrog_common )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
state->spriteram = auto_alloc_array(machine, UINT8, 160);
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
tilemap_set_scrolldy(state->bg_tilemap, 15, 15);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram2.u8, 0x200);
state->save_pointer(NAME(state->spriteram), 160);
}
VIDEO_START( ladyfrog )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
// weird, there are sprite tiles at 0x000 and 0x400, but they don't contain all the sprites!
state->spritetilebase = 0x800;
@@ -166,7 +166,7 @@ VIDEO_START( ladyfrog )
VIDEO_START( toucheme )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
state->spritetilebase = 0x000;
VIDEO_START_CALL(ladyfrog_common);
@@ -175,9 +175,9 @@ VIDEO_START( toucheme )
SCREEN_UPDATE( ladyfrog )
{
- ladyfrog_state *state = screen->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = screen->machine().driver_data<ladyfrog_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/lasso.c b/src/mame/video/lasso.c
index d149880e61f..776b4b57466 100644
--- a/src/mame/video/lasso.c
+++ b/src/mame/video/lasso.c
@@ -78,14 +78,14 @@ PALETTE_INIT( wwjgtin )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x40);
+ machine.colortable = colortable_alloc(machine, 0x40);
for (i = 0; i < 0x40; i++)
- colortable_palette_set_color(machine->colortable, i, get_color(color_prom[i]));
+ colortable_palette_set_color(machine.colortable, i, get_color(color_prom[i]));
/* characters/sprites */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* track */
for (i = 0x40; i < 0x140; i++)
@@ -97,14 +97,14 @@ PALETTE_INIT( wwjgtin )
else
ctabentry = 0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void wwjgtin_set_last_four_colors( running_machine *machine, colortable_t *colortable )
+static void wwjgtin_set_last_four_colors( running_machine &machine, colortable_t *colortable )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
int i;
/* the last palette entries can be changed */
@@ -122,7 +122,7 @@ static void wwjgtin_set_last_four_colors( running_machine *machine, colortable_t
static TILE_GET_INFO( lasso_get_bg_tile_info )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@@ -134,7 +134,7 @@ static TILE_GET_INFO( lasso_get_bg_tile_info )
static TILE_GET_INFO( wwjgtin_get_track_tile_info )
{
- UINT8 *ROM = machine->region("user1")->base();
+ UINT8 *ROM = machine.region("user1")->base();
int code = ROM[tile_index];
int color = ROM[tile_index + 0x2000];
@@ -146,7 +146,7 @@ static TILE_GET_INFO( wwjgtin_get_track_tile_info )
static TILE_GET_INFO( pinbo_get_bg_tile_info )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@@ -165,7 +165,7 @@ static TILE_GET_INFO( pinbo_get_bg_tile_info )
VIDEO_START( lasso )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemap */
state->bg_tilemap = tilemap_create(machine, lasso_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -175,7 +175,7 @@ VIDEO_START( lasso )
VIDEO_START( wwjgtin )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemaps */
state->bg_tilemap = tilemap_create(machine, lasso_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -186,7 +186,7 @@ VIDEO_START( wwjgtin )
VIDEO_START( pinbo )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
/* create tilemap */
state->bg_tilemap = tilemap_create(machine, pinbo_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -201,14 +201,14 @@ VIDEO_START( pinbo )
WRITE8_HANDLER( lasso_videoram_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( lasso_colorram_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -217,22 +217,22 @@ WRITE8_HANDLER( lasso_colorram_w )
static WRITE8_HANDLER( lasso_flip_screen_w )
{
/* don't know which is which, but they are always set together */
- flip_screen_x_set(space->machine, data & 0x01);
- flip_screen_y_set(space->machine, data & 0x02);
+ flip_screen_x_set(space->machine(), data & 0x01);
+ flip_screen_y_set(space->machine(), data & 0x02);
- tilemap_set_flip_all(space->machine, (flip_screen_x_get(space->machine) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine) ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip_all(space->machine(), (flip_screen_x_get(space->machine()) ? TILEMAP_FLIPX : 0) | (flip_screen_y_get(space->machine()) ? TILEMAP_FLIPY : 0));
}
WRITE8_HANDLER( lasso_video_control_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
int bank = (data & 0x04) >> 2;
if (state->gfxbank != bank)
{
state->gfxbank = bank;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
lasso_flip_screen_w(space, offset, data);
@@ -240,14 +240,14 @@ WRITE8_HANDLER( lasso_video_control_w )
WRITE8_HANDLER( wwjgtin_video_control_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
int bank = ((data & 0x04) ? 0 : 1) + ((data & 0x10) ? 2 : 0);
state->track_enable = data & 0x08;
if (state->gfxbank != bank)
{
state->gfxbank = bank;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
lasso_flip_screen_w(space, offset, data);
@@ -255,7 +255,7 @@ WRITE8_HANDLER( wwjgtin_video_control_w )
WRITE8_HANDLER( pinbo_video_control_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
/* no need to dirty the tilemap -- only the sprites use the global bank */
state->gfxbank = (data & 0x0c) >> 2;
@@ -270,9 +270,9 @@ WRITE8_HANDLER( pinbo_video_control_w )
*
*************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int reverse )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int reverse )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
const UINT8 *finish, *source;
int inc;
@@ -313,7 +313,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = source[1] & 0x3f;
color = source[2] & 0x0f;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code | ((UINT16)state->gfxbank << 6),
color,
flipx, flipy,
@@ -324,9 +324,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void draw_lasso( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
offs_t offs;
pen_t pen = 0x3f;
@@ -367,25 +367,25 @@ static void draw_lasso( running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( lasso )
{
- lasso_state *state = screen->machine->driver_data<lasso_state>();
- palette_set_color(screen->machine, 0, get_color(*state->back_color));
+ lasso_state *state = screen->machine().driver_data<lasso_state>();
+ palette_set_color(screen->machine(), 0, get_color(*state->back_color));
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_lasso(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_lasso(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
SCREEN_UPDATE( chameleo )
{
- lasso_state *state = screen->machine->driver_data<lasso_state>();
- palette_set_color(screen->machine, 0, get_color(*state->back_color));
+ lasso_state *state = screen->machine().driver_data<lasso_state>();
+ palette_set_color(screen->machine(), 0, get_color(*state->back_color));
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
@@ -393,9 +393,9 @@ SCREEN_UPDATE( chameleo )
SCREEN_UPDATE( wwjgtin )
{
- lasso_state *state = screen->machine->driver_data<lasso_state>();
- colortable_palette_set_color(screen->machine->colortable, 0, get_color(*state->back_color));
- wwjgtin_set_last_four_colors(screen->machine, screen->machine->colortable);
+ lasso_state *state = screen->machine().driver_data<lasso_state>();
+ colortable_palette_set_color(screen->machine().colortable, 0, get_color(*state->back_color));
+ wwjgtin_set_last_four_colors(screen->machine(), screen->machine().colortable);
tilemap_set_scrollx(state->track_tilemap, 0, state->track_scroll[0] + state->track_scroll[1] * 256);
tilemap_set_scrolly(state->track_tilemap, 0, state->track_scroll[2] + state->track_scroll[3] * 256);
@@ -403,9 +403,9 @@ SCREEN_UPDATE( wwjgtin )
if (state->track_enable)
tilemap_draw(bitmap, cliprect, state->track_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- draw_sprites(screen->machine, bitmap, cliprect, 1); // reverse order
+ draw_sprites(screen->machine(), bitmap, cliprect, 1); // reverse order
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -414,9 +414,9 @@ SCREEN_UPDATE( wwjgtin )
SCREEN_UPDATE( pinbo )
{
- lasso_state *state = screen->machine->driver_data<lasso_state>();
+ lasso_state *state = screen->machine().driver_data<lasso_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
diff --git a/src/mame/video/lastduel.c b/src/mame/video/lastduel.c
index 15b42b9441a..c113b4a47b1 100644
--- a/src/mame/video/lastduel.c
+++ b/src/mame/video/lastduel.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( ld_get_bg_tile_info )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int tile = state->scroll2[2 * tile_index] & 0x1fff;
int color = state->scroll2[2 * tile_index + 1];
SET_TILE_INFO(
@@ -29,7 +29,7 @@ static TILE_GET_INFO( ld_get_bg_tile_info )
static TILE_GET_INFO( ld_get_fg_tile_info )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int tile = state->scroll1[2 * tile_index] & 0x1fff;
int color = state->scroll1[2 * tile_index + 1];
SET_TILE_INFO(
@@ -42,7 +42,7 @@ static TILE_GET_INFO( ld_get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int tile = state->scroll2[tile_index] & 0x1fff;
int color = state->scroll2[tile_index + 0x0800];
SET_TILE_INFO(
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int tile = state->scroll1[tile_index] & 0x1fff;
int color = state->scroll1[tile_index + 0x0800];
SET_TILE_INFO(
@@ -67,7 +67,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_fix_info )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int tile = state->vram[tile_index];
SET_TILE_INFO(
1,
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_fix_info )
VIDEO_START( lastduel )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
state->bg_tilemap = tilemap_create(machine, ld_get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, ld_get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->tx_tilemap = tilemap_create(machine, get_fix_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -102,7 +102,7 @@ VIDEO_START( lastduel )
VIDEO_START( madgear )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,16,16,64,32);
state->tx_tilemap = tilemap_create(machine, get_fix_info,tilemap_scan_rows,8,8,64,32);
@@ -128,18 +128,18 @@ WRITE16_HANDLER( lastduel_flip_w )
{
if (ACCESSING_BITS_0_7)
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
- coin_lockout_w(space->machine, 0, ~data & 0x10);
- coin_lockout_w(space->machine, 1, ~data & 0x20);
- coin_counter_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_lockout_w(space->machine(), 0, ~data & 0x10);
+ coin_lockout_w(space->machine(), 1, ~data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
}
WRITE16_HANDLER( lastduel_scroll_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
data = COMBINE_DATA(&state->scroll[offset]);
switch (offset)
@@ -157,7 +157,7 @@ WRITE16_HANDLER( lastduel_scroll_w )
WRITE16_HANDLER( lastduel_scroll1_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
COMBINE_DATA(&state->scroll1[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
@@ -165,7 +165,7 @@ WRITE16_HANDLER( lastduel_scroll1_w )
WRITE16_HANDLER( lastduel_scroll2_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
COMBINE_DATA(&state->scroll2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -173,7 +173,7 @@ WRITE16_HANDLER( lastduel_scroll2_w )
WRITE16_HANDLER( lastduel_vram_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
COMBINE_DATA(&state->vram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -181,7 +181,7 @@ WRITE16_HANDLER( lastduel_vram_w )
WRITE16_HANDLER( madgear_scroll1_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
COMBINE_DATA(&state->scroll1[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x7ff);
@@ -189,7 +189,7 @@ WRITE16_HANDLER( madgear_scroll1_w )
WRITE16_HANDLER( madgear_scroll2_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
COMBINE_DATA(&state->scroll2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x7ff);
@@ -197,7 +197,7 @@ WRITE16_HANDLER( madgear_scroll2_w )
WRITE16_HANDLER( lastduel_palette_word_w )
{
- lastduel_state *state = space->machine->driver_data<lastduel_state>();
+ lastduel_state *state = space->machine().driver_data<lastduel_state>();
int red, green, blue, bright;
data = COMBINE_DATA(&state->paletteram[offset]);
@@ -209,7 +209,7 @@ WRITE16_HANDLER( lastduel_palette_word_w )
green = ((data >> 8) & 0x0f) * bright * 0x11 / 0x1f;
blue = ((data >> 4) & 0x0f) * bright * 0x11 / 0x1f;
- palette_set_color (space->machine, offset, MAKE_RGB(red, green, blue));
+ palette_set_color (space->machine(), offset, MAKE_RGB(red, green, blue));
}
/***************************************************************************
@@ -218,11 +218,11 @@ WRITE16_HANDLER( lastduel_palette_word_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
int offs;
if (!state->sprite_pri_mask)
@@ -261,7 +261,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code,
color,
flipx,flipy,
@@ -271,36 +271,36 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( lastduel )
{
- lastduel_state *state = screen->machine->driver_data<lastduel_state>();
+ lastduel_state *state = screen->machine().driver_data<lastduel_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( madgear )
{
- lastduel_state *state = screen->machine->driver_data<lastduel_state>();
+ lastduel_state *state = screen->machine().driver_data<lastduel_state>();
if (state->tilemap_priority)
{
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER1 | TILEMAP_DRAW_OPAQUE, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
}
else
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
}
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
@@ -308,7 +308,7 @@ SCREEN_UPDATE( madgear )
SCREEN_EOF( lastduel )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Spriteram is always 1 frame ahead, suggesting buffering. I can't find
a register to control this so I assume it happens automatically
diff --git a/src/mame/video/lazercmd.c b/src/mame/video/lazercmd.c
index 611d96e8cbb..75204cdab31 100644
--- a/src/mame/video/lazercmd.c
+++ b/src/mame/video/lazercmd.c
@@ -24,7 +24,7 @@ static int vert_scale(int data)
/* plot a bitmap marker */
/* hardware has 2 marker sizes 2x2 and 4x2 selected by jumper */
/* meadows lanes normaly use 2x2 pixels and lazer command uses either */
-static void plot_pattern( running_machine *machine, bitmap_t *bitmap, int x, int y )
+static void plot_pattern( running_machine &machine, bitmap_t *bitmap, int x, int y )
{
int xbit, ybit, size;
@@ -52,10 +52,10 @@ static void plot_pattern( running_machine *machine, bitmap_t *bitmap, int x, int
SCREEN_UPDATE( lazercmd )
{
- lazercmd_state *state = screen->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = screen->machine().driver_data<lazercmd_state>();
int i, x, y;
- int video_inverted = input_port_read(screen->machine, "DSW") & 0x20;
+ int video_inverted = input_port_read(screen->machine(), "DSW") & 0x20;
/* The first row of characters are invisible */
for (i = 0; i < (VERT_RES - 1) * HORZ_RES; i++)
@@ -68,7 +68,7 @@ SCREEN_UPDATE( lazercmd )
sx *= HORZ_CHR;
sy *= VERT_CHR;
- drawgfx_opaque(bitmap, cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap, cliprect,screen->machine().gfx[0],
state->videoram[i], video_inverted ? 1 : 0,
0,0,
sx,sy);
@@ -76,7 +76,7 @@ SCREEN_UPDATE( lazercmd )
x = state->marker_x - 1; /* normal video lags marker by 1 pixel */
y = vert_scale(state->marker_y) - VERT_CHR; /* first line used as scratch pad */
- plot_pattern(screen->machine, bitmap, x, y);
+ plot_pattern(screen->machine(), bitmap, x, y);
return 0;
}
diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c
index affd60e0894..d22cb9dc36b 100644
--- a/src/mame/video/legionna.c
+++ b/src/mame/video/legionna.c
@@ -10,16 +10,16 @@
/******************************************************************************/
-void heatbrl_setgfxbank(running_machine *machine, UINT16 data)
+void heatbrl_setgfxbank(running_machine &machine, UINT16 data)
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
state->back_gfx_bank = (data &0x4000) >> 2;
}
/*xxx- --- ---- ---- banking*/
-void denjinmk_setgfxbank(running_machine *machine, UINT16 data)
+void denjinmk_setgfxbank(running_machine &machine, UINT16 data)
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
state->fore_gfx_bank = (data &0x2000) >> 1;//???
state->back_gfx_bank = (data &0x4000) >> 2;
state->mid_gfx_bank = (data &0x8000) >> 3;//???
@@ -32,35 +32,35 @@ void denjinmk_setgfxbank(running_machine *machine, UINT16 data)
WRITE16_HANDLER( legionna_background_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&state->back_data[offset]);
tilemap_mark_tile_dirty(state->background_layer,offset);
}
WRITE16_HANDLER( legionna_midground_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&state->mid_data[offset]);
tilemap_mark_tile_dirty(state->midground_layer,offset);
}
WRITE16_HANDLER( legionna_foreground_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&state->fore_data[offset]);
tilemap_mark_tile_dirty(state->foreground_layer,offset);
}
WRITE16_HANDLER( legionna_text_w )
{
- legionna_state *state = space->machine->driver_data<legionna_state>();
+ legionna_state *state = space->machine().driver_data<legionna_state>();
COMBINE_DATA(&state->textram[offset]);
tilemap_mark_tile_dirty(state->text_layer,offset);
}
static TILE_GET_INFO( get_back_tile_info )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->back_data[tile_index];
int color=(tile>>12)&0xf;
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_mid_tile_info )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->mid_data[tile_index];
int color=(tile>>12)&0xf;
@@ -83,7 +83,7 @@ static TILE_GET_INFO( get_mid_tile_info )
static TILE_GET_INFO( get_mid_tile_info_denji )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->mid_data[tile_index];
int color=(tile>>12)&0xf;
@@ -95,7 +95,7 @@ static TILE_GET_INFO( get_mid_tile_info_denji )
static TILE_GET_INFO( get_mid_tile_info_cupsoc )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->mid_data[tile_index];
int color=(tile>>12)&0xf;
@@ -109,7 +109,7 @@ static TILE_GET_INFO( get_mid_tile_info_cupsoc )
static TILE_GET_INFO( get_fore_tile_info ) /* this is giving bad tiles... */
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->fore_data[tile_index];
int color=(tile>>12)&0xf;
@@ -121,7 +121,7 @@ static TILE_GET_INFO( get_fore_tile_info ) /* this is giving bad tiles... */
static TILE_GET_INFO( get_fore_tile_info_denji )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile=state->fore_data[tile_index];
int color=(tile>>12)&0xf;
@@ -133,7 +133,7 @@ static TILE_GET_INFO( get_fore_tile_info_denji )
static TILE_GET_INFO( get_text_tile_info )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
int tile = state->textram[tile_index];
int color=(tile>>12)&0xf;
@@ -144,7 +144,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( legionna )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows,16,16,32,32);
state->foreground_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
state->midground_layer = tilemap_create(machine, get_mid_tile_info, tilemap_scan_rows,16,16,32,32);
@@ -165,7 +165,7 @@ VIDEO_START( legionna )
VIDEO_START( denjinmk )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows,16,16,32,32);
state->foreground_layer = tilemap_create(machine, get_fore_tile_info_denji,tilemap_scan_rows,16,16,32,32);
state->midground_layer = tilemap_create(machine, get_mid_tile_info_denji, tilemap_scan_rows,16,16,32,32);
@@ -186,7 +186,7 @@ VIDEO_START( denjinmk )
VIDEO_START( cupsoc )
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows,16,16,32,32);
state->foreground_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
state->midground_layer = tilemap_create(machine, get_mid_tile_info_cupsoc, tilemap_scan_rows,16,16,32,32);
@@ -207,7 +207,7 @@ VIDEO_START( cupsoc )
VIDEO_START(grainbow)
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
VIDEO_START_CALL(legionna);
state->sprite_xoffs = state->sprite_yoffs = 16;
@@ -217,7 +217,7 @@ VIDEO_START(grainbow)
VIDEO_START(godzilla)
{
- legionna_state *state = machine->driver_data<legionna_state>();
+ legionna_state *state = machine.driver_data<legionna_state>();
VIDEO_START_CALL(legionna);
state->has_extended_banking = 1;
@@ -251,10 +251,10 @@ VIDEO_START(godzilla)
*************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- legionna_state *state = machine->driver_data<legionna_state>();
- UINT16 *spriteram16 = machine->generic.spriteram.u16;
+ legionna_state *state = machine.driver_data<legionna_state>();
+ UINT16 *spriteram16 = machine.generic.spriteram.u16;
int offs,fx,fy,x,y,color,sprite,cur_pri;
int dx,dy,ax,ay;
int pri_mask;
@@ -367,10 +367,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite++,
color,fx,fy,(x+ax*16)+state->sprite_xoffs,y+ay*16+state->sprite_yoffs,
- machine->priority_bitmap,pri_mask, 15);
+ machine.priority_bitmap,pri_mask, 15);
}
}
else
@@ -378,10 +378,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite++,
color,fx,fy,(x+ax*16)+state->sprite_xoffs,y+(dy-ay-1)*16+state->sprite_yoffs,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
}
}
@@ -392,10 +392,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite++,
color,fx,fy,(x+(dx-ax-1)*16)+state->sprite_xoffs,y+ay*16+state->sprite_yoffs,
- machine->priority_bitmap,pri_mask,15);
+ machine.priority_bitmap,pri_mask,15);
}
}
else
@@ -403,10 +403,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite++,
color,fx,fy,(x+(dx-ax-1)*16)+state->sprite_xoffs,y+(dy-ay-1)*16+state->sprite_yoffs,
- machine->priority_bitmap,pri_mask, 15);
+ machine.priority_bitmap,pri_mask, 15);
}
}
}
@@ -417,7 +417,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( legionna )
{
- legionna_state *state = screen->machine->driver_data<legionna_state>();
+ legionna_state *state = screen->machine().driver_data<legionna_state>();
/* Setup the tilemaps */
tilemap_set_scrollx( state->background_layer, 0, state->scrollram16[0] );
tilemap_set_scrolly( state->background_layer, 0, state->scrollram16[1] );
@@ -428,8 +428,8 @@ SCREEN_UPDATE( legionna )
tilemap_set_scrollx( state->text_layer, 0, 0/*state->scrollram16[6]*/ );
tilemap_set_scrolly( state->text_layer, 0, 0/*state->scrollram16[7]*/ );
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); /* wrong color? */
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine())); /* wrong color? */
/* state->layer_disable is a guess based on 'stage 1' screen in heatbrl */
@@ -438,7 +438,7 @@ SCREEN_UPDATE( legionna )
if (!(state->layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->background_layer,0, 1);
if (!(state->layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->text_layer,0, 2);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
@@ -447,7 +447,7 @@ SCREEN_UPDATE( legionna )
SCREEN_UPDATE( godzilla )
{
- legionna_state *state = screen->machine->driver_data<legionna_state>();
+ legionna_state *state = screen->machine().driver_data<legionna_state>();
// tilemap_set_scrollx( state->text_layer, 0, 0 );
// tilemap_set_scrolly( state->text_layer, 0, 112 );
/* Setup the tilemaps */
@@ -462,21 +462,21 @@ SCREEN_UPDATE( godzilla )
bitmap_fill(bitmap,cliprect,0x0200);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (!(state->layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->background_layer,0,0);
if (!(state->layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->midground_layer,0,0);
if (!(state->layer_disable&0x0004)) tilemap_draw(bitmap,cliprect,state->foreground_layer,0,1);
if (!(state->layer_disable&0x0008)) tilemap_draw(bitmap,cliprect,state->text_layer,0,2);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( grainbow )
{
- legionna_state *state = screen->machine->driver_data<legionna_state>();
+ legionna_state *state = screen->machine().driver_data<legionna_state>();
/* Setup the tilemaps */
tilemap_set_scrollx( state->background_layer, 0, state->scrollram16[0] );
tilemap_set_scrolly( state->background_layer, 0, state->scrollram16[1] );
@@ -487,8 +487,8 @@ SCREEN_UPDATE( grainbow )
tilemap_set_scrollx( state->text_layer, 0, 0/*state->scrollram16[6]*/ );
tilemap_set_scrolly( state->text_layer, 0, 0/*state->scrollram16[7]*/ );
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if(!(state->layer_disable & 1))
tilemap_draw(bitmap,cliprect,state->background_layer,0,1);
@@ -502,7 +502,7 @@ SCREEN_UPDATE( grainbow )
if(!(state->layer_disable & 8))
tilemap_draw(bitmap,cliprect,state->text_layer,0,8);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c
index b654a5355dd..b66695e478c 100644
--- a/src/mame/video/leland.c
+++ b/src/mame/video/leland.c
@@ -29,8 +29,8 @@
static TIMER_CALLBACK( scanline_callback )
{
- leland_state *state = machine->driver_data<leland_state>();
- device_t *audio = machine->device("custom");
+ leland_state *state = machine.driver_data<leland_state>();
+ device_t *audio = machine.device("custom");
int scanline = param;
/* update the DACs */
@@ -45,7 +45,7 @@ static TIMER_CALLBACK( scanline_callback )
scanline = (scanline+1) % 256;
/* come back at the next appropriate scanline */
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
@@ -57,20 +57,20 @@ static TIMER_CALLBACK( scanline_callback )
static VIDEO_START( leland )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* allocate memory */
state->video_ram = auto_alloc_array_clear(machine, UINT8, VRAM_SIZE);
/* scanline timer */
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
static VIDEO_START( ataxx )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* first do the standard stuff */
VIDEO_START_CALL(leland);
@@ -88,10 +88,10 @@ static VIDEO_START( ataxx )
WRITE8_HANDLER( leland_scroll_w )
{
- leland_state *state = space->machine->driver_data<leland_state>();
- int scanline = space->machine->primary_screen->vpos();
+ leland_state *state = space->machine().driver_data<leland_state>();
+ int scanline = space->machine().primary_screen->vpos();
if (scanline > 0)
- space->machine->primary_screen->update_partial(scanline - 1);
+ space->machine().primary_screen->update_partial(scanline - 1);
/* adjust the proper scroll value */
switch (offset)
@@ -121,8 +121,8 @@ WRITE8_HANDLER( leland_scroll_w )
WRITE8_DEVICE_HANDLER( leland_gfx_port_w )
{
- leland_state *state = device->machine->driver_data<leland_state>();
- device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
+ leland_state *state = device->machine().driver_data<leland_state>();
+ device->machine().primary_screen->update_partial(device->machine().primary_screen->vpos());
state->gfxbank = data;
}
@@ -136,7 +136,7 @@ WRITE8_DEVICE_HANDLER( leland_gfx_port_w )
static void leland_video_addr_w(address_space *space, int offset, int data, int num)
{
- leland_state *drvstate = space->machine->driver_data<leland_state>();
+ leland_state *drvstate = space->machine().driver_data<leland_state>();
struct vram_state_data *state = drvstate->vram_state + num;
if (!offset)
@@ -155,7 +155,7 @@ static void leland_video_addr_w(address_space *space, int offset, int data, int
static int leland_vram_port_r(address_space *space, int offset, int num)
{
- leland_state *drvstate = space->machine->driver_data<leland_state>();
+ leland_state *drvstate = space->machine().driver_data<leland_state>();
struct vram_state_data *state = drvstate->vram_state + num;
int addr = state->addr;
int inc = (offset >> 2) & 2;
@@ -181,14 +181,14 @@ static int leland_vram_port_r(address_space *space, int offset, int num)
default:
logerror("%s: Warning: Unknown video port %02x read (address=%04x)\n",
- space->machine->describe_context(), offset, addr);
+ space->machine().describe_context(), offset, addr);
ret = 0;
break;
}
state->addr = addr;
if (LOG_COMM && addr >= 0xf000)
- logerror("%s:%s comm read %04X = %02X\n", space->machine->describe_context(), num ? "slave" : "master", addr, ret);
+ logerror("%s:%s comm read %04X = %02X\n", space->machine().describe_context(), num ? "slave" : "master", addr, ret);
return ret;
}
@@ -203,7 +203,7 @@ static int leland_vram_port_r(address_space *space, int offset, int num)
static void leland_vram_port_w(address_space *space, int offset, int data, int num)
{
- leland_state *drvstate = space->machine->driver_data<leland_state>();
+ leland_state *drvstate = space->machine().driver_data<leland_state>();
UINT8 *video_ram = drvstate->video_ram;
struct vram_state_data *state = drvstate->vram_state + num;
int addr = state->addr;
@@ -212,12 +212,12 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n
/* don't fully understand why this is needed. Isn't the
video RAM just one big RAM? */
- int scanline = space->machine->primary_screen->vpos();
+ int scanline = space->machine().primary_screen->vpos();
if (scanline > 0)
- space->machine->primary_screen->update_partial(scanline - 1);
+ space->machine().primary_screen->update_partial(scanline - 1);
if (LOG_COMM && addr >= 0xf000)
- logerror("%s:%s comm write %04X = %02X\n", space->machine->describe_context(), num ? "slave" : "master", addr, data);
+ logerror("%s:%s comm write %04X = %02X\n", space->machine().describe_context(), num ? "slave" : "master", addr, data);
/* based on the low 3 bits of the offset, update the destination */
switch (offset & 7)
@@ -269,7 +269,7 @@ static void leland_vram_port_w(address_space *space, int offset, int data, int n
default:
logerror("%s:Warning: Unknown video port write (address=%04x value=%02x)\n",
- space->machine->describe_context(), offset, addr);
+ space->machine().describe_context(), offset, addr);
break;
}
@@ -293,7 +293,7 @@ WRITE8_HANDLER( leland_master_video_addr_w )
static TIMER_CALLBACK( leland_delayed_mvram_w )
{
- address_space *space = machine->device("master")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("master")->memory().space(AS_PROGRAM);
int num = (param >> 16) & 1;
int offset = (param >> 8) & 0xff;
@@ -304,7 +304,7 @@ static TIMER_CALLBACK( leland_delayed_mvram_w )
WRITE8_HANDLER( leland_mvram_port_w )
{
- space->machine->scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data);
+ space->machine().scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data);
}
@@ -349,7 +349,7 @@ READ8_HANDLER( leland_svram_port_r )
WRITE8_HANDLER( ataxx_mvram_port_w )
{
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
- space->machine->scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data);
+ space->machine().scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data);
}
@@ -390,12 +390,12 @@ READ8_HANDLER( ataxx_svram_port_r )
static SCREEN_UPDATE( leland )
{
- leland_state *state = screen->machine->driver_data<leland_state>();
+ leland_state *state = screen->machine().driver_data<leland_state>();
int y;
- const UINT8 *bg_prom = screen->machine->region("user1")->base();
- const UINT8 *bg_gfx = screen->machine->region("gfx1")->base();
- offs_t bg_gfx_bank_page_size = screen->machine->region("gfx1")->bytes() / 3;
+ const UINT8 *bg_prom = screen->machine().region("user1")->base();
+ const UINT8 *bg_gfx = screen->machine().region("gfx1")->base();
+ offs_t bg_gfx_bank_page_size = screen->machine().region("gfx1")->bytes() / 3;
offs_t char_bank = (((state->gfxbank >> 4) & 0x03) * 0x2000) & (bg_gfx_bank_page_size - 1);
offs_t prom_bank = ((state->gfxbank >> 3) & 0x01) * 0x2000;
@@ -459,11 +459,11 @@ static SCREEN_UPDATE( leland )
static SCREEN_UPDATE( ataxx )
{
- leland_state *state = screen->machine->driver_data<leland_state>();
+ leland_state *state = screen->machine().driver_data<leland_state>();
int y;
- const UINT8 *bg_gfx = screen->machine->region("gfx1")->base();
- offs_t bg_gfx_bank_page_size = screen->machine->region("gfx1")->bytes() / 6;
+ const UINT8 *bg_gfx = screen->machine().region("gfx1")->base();
+ offs_t bg_gfx_bank_page_size = screen->machine().region("gfx1")->bytes() / 6;
offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1;
/* for each scanline in the visible region */
diff --git a/src/mame/video/lemmings.c b/src/mame/video/lemmings.c
index 3cdb0b6650b..b3791f1e380 100644
--- a/src/mame/video/lemmings.c
+++ b/src/mame/video/lemmings.c
@@ -15,7 +15,7 @@
#include "emu.h"
#include "includes/lemmings.h"
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri )
{
int offs;
@@ -30,7 +30,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = spritedata[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = spritedata[offs + 2];
@@ -59,7 +59,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
while (multi >= 0)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfxbank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfxbank],
sprite - multi * inc,
colour,
fx,fy,
@@ -74,7 +74,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static TILE_GET_INFO( get_tile_info )
{
- lemmings_state *state = machine->driver_data<lemmings_state>();
+ lemmings_state *state = machine.driver_data<lemmings_state>();
UINT16 tile = state->vram_data[tile_index];
SET_TILE_INFO(
@@ -86,8 +86,8 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( lemmings )
{
- lemmings_state *state = machine->driver_data<lemmings_state>();
- state->bitmap0 = auto_bitmap_alloc(machine, 2048, 256, machine->primary_screen->format());
+ lemmings_state *state = machine.driver_data<lemmings_state>();
+ state->bitmap0 = auto_bitmap_alloc(machine, 2048, 256, machine.primary_screen->format());
state->vram_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
state->vram_buffer = auto_alloc_array(machine, UINT8, 2048 * 64); /* 64 bytes per VRAM character */
@@ -97,7 +97,7 @@ VIDEO_START( lemmings )
tilemap_set_transparent_pen(state->vram_tilemap, 0);
bitmap_fill(state->bitmap0, 0, 0x100);
- gfx_element_set_source(machine->gfx[2], state->vram_buffer);
+ gfx_element_set_source(machine.gfx[2], state->vram_buffer);
state->save_item(NAME(*state->bitmap0));
state->save_pointer(NAME(state->vram_buffer), 2048 * 64);
@@ -107,17 +107,17 @@ VIDEO_START( lemmings )
SCREEN_EOF( lemmings )
{
- lemmings_state *state = machine->driver_data<lemmings_state>();
+ lemmings_state *state = machine.driver_data<lemmings_state>();
- memcpy(state->sprite_triple_buffer_0, machine->generic.buffered_spriteram.u16, 0x800);
- memcpy(state->sprite_triple_buffer_1, machine->generic.buffered_spriteram2.u16, 0x800);
+ memcpy(state->sprite_triple_buffer_0, machine.generic.buffered_spriteram.u16, 0x800);
+ memcpy(state->sprite_triple_buffer_1, machine.generic.buffered_spriteram2.u16, 0x800);
}
/******************************************************************************/
WRITE16_HANDLER( lemmings_pixel_0_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
int sx, sy, src, old;
old = state->pixel_0_data[offset];
@@ -138,7 +138,7 @@ WRITE16_HANDLER( lemmings_pixel_0_w )
WRITE16_HANDLER( lemmings_pixel_1_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
int sx, sy, src, /*old,*/ tile;
// old = state->pixel_1_data[offset];
@@ -152,7 +152,7 @@ WRITE16_HANDLER( lemmings_pixel_1_w )
/* Copy pixel to buffer for easier decoding later */
tile = ((sx / 8) * 32) + (sy / 8);
- gfx_element_mark_dirty(space->machine->gfx[2], tile);
+ gfx_element_mark_dirty(space->machine().gfx[2], tile);
state->vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 8) & 0xf;
sx += 1; /* Update both pixels in the word */
@@ -161,14 +161,14 @@ WRITE16_HANDLER( lemmings_pixel_1_w )
WRITE16_HANDLER( lemmings_vram_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
COMBINE_DATA(&state->vram_data[offset]);
tilemap_mark_tile_dirty(state->vram_tilemap, offset);
}
SCREEN_UPDATE( lemmings )
{
- lemmings_state *state = screen->machine->driver_data<lemmings_state>();
+ lemmings_state *state = screen->machine().driver_data<lemmings_state>();
int x1 = -state->control_data[0];
int x0 = -state->control_data[2];
int y = 0;
@@ -176,8 +176,8 @@ SCREEN_UPDATE( lemmings )
rect.max_y = cliprect->max_y;
rect.min_y = cliprect->min_y;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- draw_sprites(screen->machine, bitmap, cliprect, state->sprite_triple_buffer_1, 1, 0x0000);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ draw_sprites(screen->machine(), bitmap, cliprect, state->sprite_triple_buffer_1, 1, 0x0000);
/* Pixel layer can be windowed in hardware (two player mode) */
if ((state->control_data[6] & 2) == 0)
@@ -191,9 +191,9 @@ SCREEN_UPDATE( lemmings )
rect.min_x = 160;
copyscrollbitmap_trans(bitmap, state->bitmap0, 1, &x1, 1, &y, &rect, 0x100);
}
- draw_sprites(screen->machine, bitmap, cliprect, state->sprite_triple_buffer_0, 0, 0x0000);
- draw_sprites(screen->machine, bitmap, cliprect, state->sprite_triple_buffer_1, 1, 0x2000);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->sprite_triple_buffer_0, 0, 0x0000);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->sprite_triple_buffer_1, 1, 0x2000);
tilemap_draw(bitmap, cliprect, state->vram_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, state->sprite_triple_buffer_0, 0, 0x2000);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->sprite_triple_buffer_0, 0, 0x2000);
return 0;
}
diff --git a/src/mame/video/lethal.c b/src/mame/video/lethal.c
index 6ea183701b5..3487c3e63ca 100644
--- a/src/mame/video/lethal.c
+++ b/src/mame/video/lethal.c
@@ -11,7 +11,7 @@
#include "video/konicdev.h"
#include "includes/lethal.h"
-void lethalen_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void lethalen_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
int pri = (*color & 0xfff0);
*color = *color & 0x000f;
@@ -41,21 +41,21 @@ void lethalen_sprite_callback( running_machine *machine, int *code, int *color,
*code = (*code & 0x3fff); // | spritebanks[(*code >> 12) & 3];
}
-void lethalen_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void lethalen_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- lethal_state *state = machine->driver_data<lethal_state>();
+ lethal_state *state = machine.driver_data<lethal_state>();
*color = state->layer_colorbase[layer] + ((*color & 0x3c) << 2);
}
VIDEO_START(lethalen)
{
- lethal_state *state = machine->driver_data<lethal_state>();
+ lethal_state *state = machine.driver_data<lethal_state>();
// this game uses external linescroll RAM
k056832_SetExtLinescroll(state->k056832);
// the US and Japanese cabinets apparently use different mirror setups
- if (!strcmp(machine->system().name, "lethalenj"))
+ if (!strcmp(machine.system().name, "lethalenj"))
{
k056832_set_layer_offs(state->k056832, 0, -196, 0);
k056832_set_layer_offs(state->k056832, 1, -194, 0);
@@ -78,7 +78,7 @@ VIDEO_START(lethalen)
WRITE8_HANDLER(lethalen_palette_control)
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
switch (offset)
{
@@ -104,10 +104,10 @@ WRITE8_HANDLER(lethalen_palette_control)
SCREEN_UPDATE(lethalen)
{
- lethal_state *state = screen->machine->driver_data<lethal_state>();
+ lethal_state *state = screen->machine().driver_data<lethal_state>();
bitmap_fill(bitmap, cliprect, 7168);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k056832_tilemap_draw(state->k056832, bitmap, cliprect, 3, 0, 1);
k056832_tilemap_draw(state->k056832, bitmap, cliprect, 2, 0, 2);
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index bc678087ca9..d2d68f5bc14 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -20,10 +20,10 @@
*
*************************************/
-INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
+INLINE void get_crosshair_xy(running_machine &machine, int player, int *x, int *y)
{
static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int width = visarea.max_x + 1 - visarea.min_x;
int height = visarea.max_y + 1 - visarea.min_y;
@@ -41,7 +41,7 @@ INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *
READ16_HANDLER( lethalj_gun_r )
{
- lethalj_state *state = space->machine->driver_data<lethalj_state>();
+ lethalj_state *state = space->machine().driver_data<lethalj_state>();
UINT16 result = 0;
int beamx, beamy;
@@ -50,7 +50,7 @@ READ16_HANDLER( lethalj_gun_r )
case 4:
case 5:
/* latch the crosshair position */
- get_crosshair_xy(space->machine, offset - 4, &beamx, &beamy);
+ get_crosshair_xy(space->machine(), offset - 4, &beamx, &beamy);
state->gunx = beamx;
state->guny = beamy;
state->blank_palette = 1;
@@ -78,13 +78,13 @@ READ16_HANDLER( lethalj_gun_r )
VIDEO_START( lethalj )
{
- lethalj_state *state = machine->driver_data<lethalj_state>();
+ lethalj_state *state = machine.driver_data<lethalj_state>();
/* allocate video RAM for screen */
state->screenram = auto_alloc_array(machine, UINT16, BLITTER_DEST_WIDTH * BLITTER_DEST_HEIGHT);
/* predetermine blitter info */
- state->blitter_base = (UINT16 *)machine->region("gfx1")->base();
- state->blitter_rows = machine->region("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
+ state->blitter_base = (UINT16 *)machine.region("gfx1")->base();
+ state->blitter_rows = machine.region("gfx1")->bytes() / (2*BLITTER_SOURCE_WIDTH);
}
@@ -143,7 +143,7 @@ static void do_blit(lethalj_state *state)
WRITE16_HANDLER( lethalj_blitter_w )
{
- lethalj_state *state = space->machine->driver_data<lethalj_state>();
+ lethalj_state *state = space->machine().driver_data<lethalj_state>();
/* combine the data */
COMBINE_DATA(&state->blitter_data[offset]);
@@ -155,12 +155,12 @@ WRITE16_HANDLER( lethalj_blitter_w )
else
do_blit(state);
- space->machine->scheduler().timer_set(attotime::from_hz(XTAL_32MHz) * ((state->blitter_data[5] + 1) * (state->blitter_data[7] + 1)), FUNC(gen_ext1_int));
+ space->machine().scheduler().timer_set(attotime::from_hz(XTAL_32MHz) * ((state->blitter_data[5] + 1) * (state->blitter_data[7] + 1)), FUNC(gen_ext1_int));
}
/* clear the IRQ on offset 0 */
else if (offset == 0)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -173,7 +173,7 @@ WRITE16_HANDLER( lethalj_blitter_w )
void lethalj_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- lethalj_state *state = screen.machine->driver_data<lethalj_state>();
+ lethalj_state *state = screen.machine().driver_data<lethalj_state>();
UINT16 *src = &state->screenram[(state->vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
int coladdr = params->coladdr << 1;
diff --git a/src/mame/video/liberate.c b/src/mame/video/liberate.c
index 8e54e027fd7..0fa6bf94f88 100644
--- a/src/mame/video/liberate.c
+++ b/src/mame/video/liberate.c
@@ -39,8 +39,8 @@ static TILEMAP_MAPPER( fix_scan )
static TILE_GET_INFO( get_back_tile_info )
{
- liberate_state *state = machine->driver_data<liberate_state>();
- const UINT8 *RAM = machine->region("user1")->base();
+ liberate_state *state = machine.driver_data<liberate_state>();
+ const UINT8 *RAM = machine.region("user1")->base();
int tile, bank;
/* Convert tile index of 512x512 to paged format */
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_fix_tile_info )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
UINT8 *videoram = state->videoram;
UINT8 *colorram = state->colorram;
int tile, color;
@@ -82,7 +82,7 @@ static TILE_GET_INFO( get_fix_tile_info )
static TILE_GET_INFO( prosport_get_back_tile_info )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
int tile;
/*
@@ -104,7 +104,7 @@ static TILE_GET_INFO( prosport_get_back_tile_info )
WRITE8_HANDLER( deco16_io_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->io_ram[offset] = data;
if (offset > 1 && offset < 6)
tilemap_mark_all_tiles_dirty(state->back_tilemap);
@@ -118,7 +118,7 @@ WRITE8_HANDLER( deco16_io_w )
tilemap_mark_all_tiles_dirty(state->back_tilemap);
}
state->background_disable = data & 0x4;
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
break;
case 7: /* Background palette resistors? */
/* Todo */
@@ -135,7 +135,7 @@ WRITE8_HANDLER( deco16_io_w )
WRITE8_HANDLER( prosoccr_io_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->io_ram[offset] = data;
if (offset > 1 && offset < 6)
tilemap_mark_all_tiles_dirty(state->back_tilemap);
@@ -165,14 +165,14 @@ WRITE8_HANDLER( prosoccr_io_w )
/* completely different i/o...*/
WRITE8_HANDLER( prosport_io_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->io_ram[offset] = data;
switch (offset)
{
case 0:
//background_disable = ~data & 0x80;
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
tilemap_mark_all_tiles_dirty(state->back_tilemap);
break;
case 2: /* Sound */
@@ -187,21 +187,21 @@ WRITE8_HANDLER( prosport_io_w )
WRITE8_HANDLER( liberate_videoram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fix_tilemap, offset);
}
WRITE8_HANDLER( liberate_colorram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fix_tilemap, offset);
}
WRITE8_HANDLER( prosport_bg_vram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->bg_vram[offset] = data;
tilemap_mark_tile_dirty(state->back_tilemap, offset);
}
@@ -210,7 +210,7 @@ WRITE8_HANDLER( prosport_bg_vram_w )
VIDEO_START( prosoccr )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32);
@@ -221,7 +221,7 @@ VIDEO_START( prosoccr )
VIDEO_START( boomrang )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32);
@@ -231,7 +231,7 @@ VIDEO_START( boomrang )
VIDEO_START( liberate )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
state->back_tilemap = tilemap_create(machine, get_back_tile_info, back_scan, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32);
@@ -240,7 +240,7 @@ VIDEO_START( liberate )
VIDEO_START( prosport )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
state->back_tilemap = tilemap_create(machine, prosport_get_back_tile_info, back_scan, 16, 16, 32, 32);
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info, fix_scan, 8, 8, 32, 32);
@@ -251,11 +251,11 @@ VIDEO_START( prosport )
WRITE8_HANDLER( prosport_paletteram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->paletteram[offset] = data;
/* RGB output is inverted */
- palette_set_color_rgb(space->machine, offset, pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6));
+ palette_set_color_rgb(space->machine(), offset, pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6));
}
PALETTE_INIT( liberate )
@@ -290,9 +290,9 @@ PALETTE_INIT( liberate )
/***************************************************************************/
-static void liberate_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void liberate_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -345,13 +345,13 @@ static void liberate_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sy2 = sy + 16;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
fx,fy,
sx,sy,0);
if (multi)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code+1,
color,
fx,fy,
@@ -359,9 +359,9 @@ static void liberate_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void prosport_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void prosport_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
int offs, multi, fx, fy, sx, sy, sy2, code, code2, color, gfx_region;
UINT8 *spriteram = state->spriteram;
@@ -410,13 +410,13 @@ static void prosport_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sy2 = sy + 16;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx_region],
code,
color,
fx,fy,
sx,sy,0);
if (multi)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx_region],
code2,
color,
fx,fy,
@@ -424,9 +424,9 @@ static void prosport_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void boomrang_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void boomrang_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
UINT8 *spriteram = state->spriteram;
int offs, multi, fx, fy, sx, sy, sy2, code, code2, color;
@@ -471,13 +471,13 @@ static void boomrang_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
sy2 = sy + 16;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
fx,fy,
sx,sy,0);
if (multi)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code2,
color,
fx,fy,
@@ -485,9 +485,9 @@ static void boomrang_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void prosoccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
UINT8 *spriteram = state->spriteram;
int offs, code, fx, fy, sx, sy;
@@ -502,7 +502,7 @@ static void prosoccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
fx = spriteram[offs + 0] & 4;
fy = spriteram[offs + 0] & 2;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
0,
fx,fy,
@@ -514,7 +514,7 @@ static void prosoccr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
SCREEN_UPDATE( prosoccr )
{
- liberate_state *state = screen->machine->driver_data<liberate_state>();
+ liberate_state *state = screen->machine().driver_data<liberate_state>();
tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]);
tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]);
@@ -524,14 +524,14 @@ SCREEN_UPDATE( prosoccr )
tilemap_draw(bitmap, cliprect, state->back_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
- prosoccr_draw_sprites(screen->machine, bitmap, cliprect);
+ prosoccr_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( prosport )
{
- liberate_state *state = screen->machine->driver_data<liberate_state>();
+ liberate_state *state = screen->machine().driver_data<liberate_state>();
UINT8 *videoram = state->videoram;
UINT8 *colorram = state->colorram;
int mx, my, tile, offs, gfx_region;
@@ -564,18 +564,18 @@ SCREEN_UPDATE( prosport )
my = (offs) % 32;
mx = (offs) / 32;
- drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[gfx_region],
+ drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[gfx_region],
tile, 1, 0, 0, 248 - 8 * mx, 8 * my, 0);
}
- prosport_draw_sprites(screen->machine, bitmap, cliprect);
+ prosport_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( boomrang )
{
- liberate_state *state = screen->machine->driver_data<liberate_state>();
+ liberate_state *state = screen->machine().driver_data<liberate_state>();
tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]);
tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]);
@@ -584,18 +584,18 @@ SCREEN_UPDATE( boomrang )
else
tilemap_draw(bitmap, cliprect, state->back_tilemap, TILEMAP_DRAW_LAYER1, 0);
- boomrang_draw_sprites(screen->machine,bitmap,cliprect,8);
+ boomrang_draw_sprites(screen->machine(),bitmap,cliprect,8);
if (!state->background_disable)
tilemap_draw(bitmap, cliprect, state->back_tilemap, TILEMAP_DRAW_LAYER0, 0);
- boomrang_draw_sprites(screen->machine, bitmap, cliprect, 0);
+ boomrang_draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( liberate )
{
- liberate_state *state = screen->machine->driver_data<liberate_state>();
+ liberate_state *state = screen->machine().driver_data<liberate_state>();
tilemap_set_scrolly(state->back_tilemap, 0, state->io_ram[1]);
tilemap_set_scrollx(state->back_tilemap, 0, -state->io_ram[0]);
@@ -604,7 +604,7 @@ SCREEN_UPDATE( liberate )
else
tilemap_draw(bitmap, cliprect, state->back_tilemap, 0, 0);
- liberate_draw_sprites(screen->machine, bitmap, cliprect);
+ liberate_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fix_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/liberatr.c b/src/mame/video/liberatr.c
index 11075694626..0128e6452d9 100644
--- a/src/mame/video/liberatr.c
+++ b/src/mame/video/liberatr.c
@@ -68,8 +68,8 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
{
UINT16 longitude;
- const UINT8 *latitude_scale = machine->region("user1")->base();
- const UINT8 *longitude_scale = machine->region("user2")->base();
+ const UINT8 *latitude_scale = m_machine.region("user1")->base();
+ const UINT8 *longitude_scale = m_machine.region("user2")->base();
/* for each starting longitude */
for (longitude = 0; longitude < 0x100; longitude++)
@@ -171,7 +171,7 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
many segments it will take to store the description, allocate the
space for it and copy the data to it.
*/
- buffer = auto_alloc_array(machine, UINT8, 2*(128 + total_segment_count));
+ buffer = auto_alloc_array(m_machine, UINT8, 2*(128 + total_segment_count));
liberatr_planet.frames[longitude] = buffer;
@@ -187,7 +187,7 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
/* calculate the bitmap's x coordinate for the western horizon
center of bitmap - (the number of planet pixels) / 4 */
- *buffer++ = (machine->primary_screen->width() / 2) - ((line->max_x + 2) / 4);
+ *buffer++ = (m_machine.primary_screen->width() / 2) - ((line->max_x + 2) / 4);
for (i = 0; i < segment_count; i++)
{
@@ -212,8 +212,8 @@ void liberatr_state::init_planet(planet &liberatr_planet, UINT8 *planet_rom)
void liberatr_state::video_start()
{
// for each planet in the planet ROMs
- init_planet(m_planets[0], &machine->region("gfx1")->base()[0x2000]);
- init_planet(m_planets[1], &machine->region("gfx1")->base()[0x0000]);
+ init_planet(m_planets[0], &m_machine.region("gfx1")->base()[0x2000]);
+ init_planet(m_planets[1], &m_machine.region("gfx1")->base()[0x0000]);
}
diff --git a/src/mame/video/lkage.c b/src/mame/video/lkage.c
index 091fa4d6513..4294ae2b892 100644
--- a/src/mame/video/lkage.c
+++ b/src/mame/video/lkage.c
@@ -43,7 +43,7 @@
WRITE8_HANDLER( lkage_videoram_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->videoram[offset] = data;
@@ -68,28 +68,28 @@ WRITE8_HANDLER( lkage_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
int code = state->videoram[tile_index + 0x800] + 256 * (state->bg_tile_bank ? 5 : 1);
SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/ );
}
static TILE_GET_INFO( get_fg_tile_info )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
int code = state->videoram[tile_index + 0x400] + 256 * (state->fg_tile_bank ? 1 : 0);
SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/);
}
static TILE_GET_INFO( get_tx_tile_info )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
int code = state->videoram[tile_index] + 256 * (state->tx_tile_bank ? 4 : 0);
SET_TILE_INFO( 0/*gfx*/, code, 0/*color*/, 0/*flags*/);
}
VIDEO_START( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -104,9 +104,9 @@ VIDEO_START( lkage )
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
const UINT8 *source = state->spriteram;
const UINT8 *finish = source + 0x60;
@@ -159,13 +159,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
pdrawgfx_transpen(
bitmap,
cliprect,
- machine->gfx[1],
+ machine.gfx[1],
sprite_number ^ y,
color,
flipx,flipy,
sx&0xff,
sy + 16*y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
priority_mask,0 );
}
source += 4;
@@ -174,11 +174,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( lkage )
{
- lkage_state *state = screen->machine->driver_data<lkage_state>();
+ lkage_state *state = screen->machine().driver_data<lkage_state>();
int bank;
- flip_screen_x_set(screen->machine, ~state->vreg[2] & 0x01);
- flip_screen_y_set(screen->machine, ~state->vreg[2] & 0x02);
+ flip_screen_x_set(screen->machine(), ~state->vreg[2] & 0x01);
+ flip_screen_y_set(screen->machine(), ~state->vreg[2] & 0x02);
bank = state->vreg[1] & 0x08;
@@ -215,13 +215,13 @@ SCREEN_UPDATE( lkage )
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll[4]);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll[5]);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if ((state->vreg[2] & 0xf0) == 0xf0)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, (state->vreg[1] & 2) ? 2 : 4);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
else
{
diff --git a/src/mame/video/lockon.c b/src/mame/video/lockon.c
index 5747645e489..d07592f536f 100644
--- a/src/mame/video/lockon.c
+++ b/src/mame/video/lockon.c
@@ -64,12 +64,12 @@ WRITE16_HANDLER( lockon_crtc_w )
static TIMER_CALLBACK( cursor_callback )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
if (state->main_inten)
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0xff);
- state->cursor_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->cursor_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
/*************************************
@@ -134,14 +134,14 @@ PALETTE_INIT( lockon )
WRITE16_HANDLER( lockon_char_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->char_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
}
static TILE_GET_INFO( get_lockon_tile_info )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
UINT32 tileno = state->char_ram[tile_index] & 0x03ff;
UINT32 col = (state->char_ram[tile_index] >> 10) & 0x3f;
@@ -158,23 +158,23 @@ static TILE_GET_INFO( get_lockon_tile_info )
WRITE16_HANDLER( lockon_scene_h_scr_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->scroll_h = data & 0x1ff;
}
WRITE16_HANDLER( lockon_scene_v_scr_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->scroll_v = data & 0x81ff;
}
-static void scene_draw( running_machine *machine )
+static void scene_draw( running_machine &machine )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
UINT32 y;
/* 3bpp characters */
- const UINT8 *const gfx1 = machine->region("gfx2")->base();
+ const UINT8 *const gfx1 = machine.region("gfx2")->base();
const UINT8 *const gfx2 = gfx1 + 0x10000;
const UINT8 *const gfx3 = gfx1 + 0x20000;
const UINT8 *const clut = gfx1 + 0x30000;
@@ -281,13 +281,13 @@ static void scene_draw( running_machine *machine )
WRITE16_HANDLER( lockon_ground_ctrl_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->ground_ctrl = data & 0xff;
}
static TIMER_CALLBACK( bufend_callback )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
device_set_input_line_and_vector(state->ground, 0, HOLD_LINE, 0xff);
device_set_input_line(state->object, NEC_INPUT_LINE_POLL, ASSERT_LINE);
}
@@ -306,12 +306,12 @@ static TIMER_CALLBACK( bufend_callback )
rom_data3 = gfx_rom[gfx_addr + 0x20000]; \
}
-static void ground_draw( running_machine *machine )
+static void ground_draw( running_machine &machine )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
/* ROM pointers */
- const UINT8 *const gfx_rom = machine->region("gfx4")->base();
+ const UINT8 *const gfx_rom = machine.region("gfx4")->base();
const UINT8 *const lut_rom = gfx_rom + 0x30000 + ((state->ground_ctrl >> 2) & 0x3 ? 0x10000 : 0);
const UINT8 *const clut_rom = gfx_rom + 0x50000;
@@ -433,15 +433,15 @@ do { \
px = (px + 1) & 0x7ff; \
} while(0)
-static void objects_draw( running_machine *machine )
+static void objects_draw( running_machine &machine )
{
UINT32 offs;
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
- const UINT8 *const romlut = machine->region("user1")->base();
- const UINT16 *const chklut = (UINT16*)machine->region("user2")->base();
- const UINT8 *const gfxrom = machine->region("gfx5")->base();
- const UINT8 *const sproms = machine->region("proms")->base() + 0x800;
+ const UINT8 *const romlut = machine.region("user1")->base();
+ const UINT16 *const chklut = (UINT16*)machine.region("user2")->base();
+ const UINT8 *const gfxrom = machine.region("gfx5")->base();
+ const UINT8 *const sproms = machine.region("proms")->base() + 0x800;
for (offs = 0; offs < state->objectram_size; offs += 4)
{
@@ -610,19 +610,19 @@ static void objects_draw( running_machine *machine )
/* The mechanism used by the object CPU to update the object ASICs palette RAM */
WRITE16_HANDLER( lockon_tza112_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
if (state->iden)
{
state->obj_pal_latch = data & 0xff;
state->obj_pal_addr = offset & 0xf;
- objects_draw(space->machine);
+ objects_draw(space->machine());
}
}
READ16_HANDLER( lockon_obj_4000_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
device_set_input_line(state->object, NEC_INPUT_LINE_POLL, CLEAR_LINE);
return 0xffff;
@@ -630,7 +630,7 @@ READ16_HANDLER( lockon_obj_4000_r )
WRITE16_HANDLER( lockon_obj_4000_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->iden = data & 1;
}
@@ -661,14 +661,14 @@ WRITE16_HANDLER( lockon_fb_clut_w )
{
rgb_t color;
- color = palette_get_color(space->machine, 0x300 + (data & 0xff));
- palette_set_color(space->machine, 0x400 + offset, color);
+ color = palette_get_color(space->machine(), 0x300 + (data & 0xff));
+ palette_set_color(space->machine(), 0x400 + offset, color);
}
/* Rotation control register */
WRITE16_HANDLER( lockon_rotate_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
switch (offset & 7)
{
@@ -698,9 +698,9 @@ do { \
if (carry) --CNT; \
} while(0)
-static void rotate_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void rotate_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
UINT32 y;
/* Counters */
@@ -803,10 +803,10 @@ static void rotate_draw( running_machine *machine, bitmap_t *bitmap, const recta
*******************************************************************************************/
-static void hud_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void hud_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lockon_state *state = machine->driver_data<lockon_state>();
- UINT8 *tile_rom = machine->region("gfx3")->base();
+ lockon_state *state = machine.driver_data<lockon_state>();
+ UINT8 *tile_rom = machine.region("gfx3")->base();
UINT32 offs;
for (offs = 0x0; offs <= state->hudram_size; offs += 2)
@@ -905,7 +905,7 @@ static void hud_draw( running_machine *machine, bitmap_t *bitmap, const rectangl
VIDEO_START( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
state->tilemap = tilemap_create(machine, get_lockon_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->tilemap, 0);
@@ -918,11 +918,11 @@ VIDEO_START( lockon )
state->obj_pal_ram = auto_alloc_array(machine, UINT8, 2048);
/* Timer for ground display list callback */
- state->bufend_timer = machine->scheduler().timer_alloc(FUNC(bufend_callback));
+ state->bufend_timer = machine.scheduler().timer_alloc(FUNC(bufend_callback));
/* Timer for the CRTC cursor pulse */
- state->cursor_timer = machine->scheduler().timer_alloc(FUNC(cursor_callback));
- state->cursor_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->cursor_timer = machine.scheduler().timer_alloc(FUNC(cursor_callback));
+ state->cursor_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
state->save_item(NAME(*state->back_buffer));
state->save_item(NAME(*state->front_buffer));
@@ -931,30 +931,30 @@ VIDEO_START( lockon )
SCREEN_UPDATE( lockon )
{
- lockon_state *state = screen->machine->driver_data<lockon_state>();
+ lockon_state *state = screen->machine().driver_data<lockon_state>();
/* If screen output is disabled, fill with black */
if (!BIT(state->ctrl_reg, 7))
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* Scan out the frame buffer in rotated order */
- rotate_draw(screen->machine, bitmap, cliprect);
+ rotate_draw(screen->machine(), bitmap, cliprect);
/* Draw the character tilemap */
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
/* Draw the HUD */
- hud_draw(screen->machine, bitmap, cliprect);
+ hud_draw(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_EOF( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
/* Swap the frame buffers */
bitmap_t *tmp = state->front_buffer;
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index 5ab8886e3b4..c905372a416 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -48,9 +48,9 @@ Note: if MAME_DEBUG is defined, pressing Z with:
// xxxxBBBBGGGGRRRR, but repeat ecah color for each priority code (since we stuff it in the high bits of the pen)
WRITE16_HANDLER( lordgun_paletteram_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
for (int pri = 0; pri < 8; pri++)
- palette_set_color_rgb(space->machine, offset+0x800*pri, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
+ palette_set_color_rgb(space->machine(), offset+0x800*pri, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
}
@@ -63,7 +63,7 @@ WRITE16_HANDLER( lordgun_paletteram_w )
static TILE_GET_INFO( get_tile_info_0 )
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
UINT16 attr = state->vram_0[ tile_index * 2 + 0 ];
UINT16 code = state->vram_0[ tile_index * 2 + 1 ];
UINT16 pri = (attr & 0x0e00) >> 9;
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
UINT16 attr = state->vram_1[ tile_index * 2 + 0 ];
UINT16 code = state->vram_1[ tile_index * 2 + 1 ];
UINT16 pri = (attr & 0x0e00) >> 9;
@@ -81,7 +81,7 @@ static TILE_GET_INFO( get_tile_info_1 )
static TILE_GET_INFO( get_tile_info_2 )
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
UINT16 attr = state->vram_2[ tile_index * 2 + 0 ];
UINT16 code = state->vram_2[ tile_index * 2 + 1 ];
UINT16 pri = (attr & 0x0e00) >> 9;
@@ -90,7 +90,7 @@ static TILE_GET_INFO( get_tile_info_2 )
static TILE_GET_INFO( get_tile_info_3 )
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
UINT16 attr = state->vram_3[ tile_index * 2 + 0 ];
UINT16 code = state->vram_3[ tile_index * 2 + 1 ];
UINT16 pri = (attr & 0x0e00) >> 9;
@@ -99,28 +99,28 @@ static TILE_GET_INFO( get_tile_info_3 )
WRITE16_HANDLER( lordgun_vram_0_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0, offset/2);
}
WRITE16_HANDLER( lordgun_vram_1_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset/2);
}
WRITE16_HANDLER( lordgun_vram_2_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->vram_2[offset]);
tilemap_mark_tile_dirty(state->tilemap_2, offset/2);
}
WRITE16_HANDLER( lordgun_vram_3_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->vram_3[offset]);
tilemap_mark_tile_dirty(state->tilemap_3, offset/2);
}
@@ -134,10 +134,10 @@ WRITE16_HANDLER( lordgun_vram_3_w )
VIDEO_START( lordgun )
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
int i;
- int w = machine->primary_screen->width();
- int h = machine->primary_screen->height();
+ int w = machine.primary_screen->width();
+ int h = machine.primary_screen->height();
// 0x800 x 200
state->tilemap_0 = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows,
@@ -225,9 +225,9 @@ float lordgun_crosshair_mapper(const input_field_config *field, float linear_val
return lordgun_gun_x_table[x] * 1.0f / 0x1BF;
}
-static void lorddgun_calc_gun_scr(running_machine *machine, int i)
+static void lorddgun_calc_gun_scr(running_machine &machine, int i)
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
// popmessage("%03x, %02x", input_port_read(machine, "LIGHT0_X"), input_port_read(machine, "LIGHT0_Y"));
int x = input_port_read(machine, gunnames[i]) - 0x3c;
@@ -239,10 +239,10 @@ static void lorddgun_calc_gun_scr(running_machine *machine, int i)
state->gun[i].scr_y = input_port_read(machine, gunnames[i+2]);
}
-void lordgun_update_gun(running_machine *machine, int i)
+void lordgun_update_gun(running_machine &machine, int i)
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
state->gun[i].hw_x = input_port_read(machine, gunnames[i]);
state->gun[i].hw_y = input_port_read(machine, gunnames[i+2]);
@@ -281,9 +281,9 @@ void lordgun_update_gun(running_machine *machine, int i)
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- lordgun_state *state = machine->driver_data<lordgun_state>();
+ lordgun_state *state = machine.driver_data<lordgun_state>();
UINT16 *s = state->spriteram;
UINT16 *end = state->spriteram + state->spriteram_size/2;
@@ -324,7 +324,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (x = x0; x != x1; x += dx)
{
- drawgfx_transpen( bitmap, cliprect, machine->gfx[4],
+ drawgfx_transpen( bitmap, cliprect, machine.gfx[4],
code, color + pri * 0x800/0x40,
flipx, flipy,
sx + x * 0x10, sy + y * 0x10,
@@ -365,26 +365,26 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( lordgun )
{
- lordgun_state *state = screen->machine->driver_data<lordgun_state>();
+ lordgun_state *state = screen->machine().driver_data<lordgun_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= 8;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 16;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (state->whitescreen)
{
- bitmap_fill(bitmap, cliprect, get_white_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_white_pen(screen->machine()));
return 0;
}
@@ -420,7 +420,7 @@ SCREEN_UPDATE( lordgun )
if (layers_ctrl & 2) tilemap_draw(state->bitmaps[1], cliprect, state->tilemap_1, 0, 0);
if (layers_ctrl & 4) tilemap_draw(state->bitmaps[2], cliprect, state->tilemap_2, 0, 0);
if (layers_ctrl & 8) tilemap_draw(state->bitmaps[3], cliprect, state->tilemap_3, 0, 0);
- if (layers_ctrl & 16) draw_sprites(screen->machine, state->bitmaps[4], cliprect);
+ if (layers_ctrl & 16) draw_sprites(screen->machine(), state->bitmaps[4], cliprect);
// copy to screen bitmap
diff --git a/src/mame/video/lsasquad.c b/src/mame/video/lsasquad.c
index 3e000f90e26..b72629b77a3 100644
--- a/src/mame/video/lsasquad.c
+++ b/src/mame/video/lsasquad.c
@@ -1,9 +1,9 @@
#include "emu.h"
#include "includes/lsasquad.h"
-static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *scrollram )
+static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *scrollram )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
int offs, scrollx, scrolly;
scrollx = scrollram[3];
@@ -33,13 +33,13 @@ static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectan
code = state->videoram[base + 2 * y] + ((attr & 0x0f) << 8);
color = attr >> 4;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flip_screen_get(machine),flip_screen_get(machine),
sx,sy,15);
if (sx > 248) /* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flip_screen_get(machine),flip_screen_get(machine),
@@ -48,9 +48,9 @@ static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectan
}
}
-static int draw_layer_daikaiju( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int * previd, int type )
+static int draw_layer_daikaiju( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int * previd, int type )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
int id, scrollx, scrolly, initoffs, globalscrollx;
int stepx = 0;
@@ -121,13 +121,13 @@ static int draw_layer_daikaiju( running_machine *machine, bitmap_t *bitmap, cons
if ((type == 0 && color != 0x0d) || (type != 0 && color == 0x0d))
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flip_screen_get(machine),flip_screen_get(machine),
sx,sy,15);
if (sx > 248) /* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flip_screen_get(machine),flip_screen_get(machine),
@@ -138,9 +138,9 @@ static int draw_layer_daikaiju( running_machine *machine, bitmap_t *bitmap, cons
return offs;
}
-static void drawbg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int type )
+static void drawbg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int type )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
int i = 0;
int id = -1;
@@ -158,9 +158,9 @@ static void drawbg( running_machine *machine, bitmap_t *bitmap, const rectangle
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -184,13 +184,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
sx,sy,15);
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -200,13 +200,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( lsasquad )
{
- lsasquad_state *state = screen->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = screen->machine().driver_data<lsasquad_state>();
bitmap_fill(bitmap, cliprect, 511);
- draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x000);
- draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x080);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_layer(screen->machine, bitmap, cliprect, state->scrollram + 0x100);
+ draw_layer(screen->machine(), bitmap, cliprect, state->scrollram + 0x000);
+ draw_layer(screen->machine(), bitmap, cliprect, state->scrollram + 0x080);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_layer(screen->machine(), bitmap, cliprect, state->scrollram + 0x100);
return 0;
}
@@ -214,8 +214,8 @@ SCREEN_UPDATE( lsasquad )
SCREEN_UPDATE( daikaiju )
{
bitmap_fill(bitmap, cliprect, 511);
- drawbg(screen->machine, bitmap, cliprect, 0); // bottom
- draw_sprites(screen->machine, bitmap, cliprect);
- drawbg(screen->machine, bitmap, cliprect, 1); // top = pallete $d ?
+ drawbg(screen->machine(), bitmap, cliprect, 0); // bottom
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ drawbg(screen->machine(), bitmap, cliprect, 1); // top = pallete $d ?
return 0;
}
diff --git a/src/mame/video/lucky74.c b/src/mame/video/lucky74.c
index 1f10f7878ec..86024804b15 100644
--- a/src/mame/video/lucky74.c
+++ b/src/mame/video/lucky74.c
@@ -100,28 +100,28 @@
WRITE8_HANDLER( lucky74_fg_videoram_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( lucky74_fg_colorram_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->fg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( lucky74_bg_videoram_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( lucky74_bg_colorram_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->bg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -201,7 +201,7 @@ PALETTE_INIT( lucky74 )
static TILE_GET_INFO( get_fg_tile_info )
{
- lucky74_state *state = machine->driver_data<lucky74_state>();
+ lucky74_state *state = machine.driver_data<lucky74_state>();
/* - bits -
7654 3210
---- xxxx tiles color.
@@ -217,7 +217,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- lucky74_state *state = machine->driver_data<lucky74_state>();
+ lucky74_state *state = machine.driver_data<lucky74_state>();
/* - bits -
7654 3210
---- xxxx tiles color.
@@ -234,7 +234,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( lucky74 )
{
- lucky74_state *state = machine->driver_data<lucky74_state>();
+ lucky74_state *state = machine.driver_data<lucky74_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -243,7 +243,7 @@ VIDEO_START( lucky74 )
SCREEN_UPDATE( lucky74 )
{
- lucky74_state *state = screen->machine->driver_data<lucky74_state>();
+ lucky74_state *state = screen->machine().driver_data<lucky74_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/lvcards.c b/src/mame/video/lvcards.c
index 42d215efa17..d12856bc3d4 100644
--- a/src/mame/video/lvcards.c
+++ b/src/mame/video/lvcards.c
@@ -14,7 +14,7 @@ PALETTE_INIT( ponttehk )
{
int i;
- for ( i = 0; i < machine->total_colors(); i++ )
+ for ( i = 0; i < machine.total_colors(); i++ )
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -26,17 +26,17 @@ PALETTE_INIT( ponttehk )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -49,7 +49,7 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
{
int i;
- for ( i = 0; i < machine->total_colors(); i++ )
+ for ( i = 0; i < machine.total_colors(); i++ )
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -61,17 +61,17 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x11;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x11;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x11;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x11;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x11;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x11;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x11;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x11;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x11;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x11;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x11;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x11;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x11;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x11;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x11;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x11;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -82,21 +82,21 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough.
WRITE8_HANDLER( lvcards_videoram_w )
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( lvcards_colorram_w )
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x30) << 4) + ((attr & 0x80) << 3);
int color = attr & 0x0f;
@@ -107,14 +107,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( lvcards )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
}
SCREEN_UPDATE( lvcards )
{
- lvcards_state *state = screen->machine->driver_data<lvcards_state>();
+ lvcards_state *state = screen->machine().driver_data<lvcards_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/lwings.c b/src/mame/video/lwings.c
index 4f812a95a0d..776bd5f8ebc 100644
--- a/src/mame/video/lwings.c
+++ b/src/mame/video/lwings.c
@@ -22,7 +22,7 @@ static TILEMAP_MAPPER( get_bg2_memory_offset )
static TILE_GET_INFO( get_fg_tile_info )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
int code = state->fgvideoram[tile_index];
int color = state->fgvideoram[tile_index + 0x400];
SET_TILE_INFO(
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( lwings_get_bg1_tile_info )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
int code = state->bg1videoram[tile_index];
int color = state->bg1videoram[tile_index + 0x400];
SET_TILE_INFO(
@@ -46,7 +46,7 @@ static TILE_GET_INFO( lwings_get_bg1_tile_info )
static TILE_GET_INFO( trojan_get_bg1_tile_info )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
int code = state->bg1videoram[tile_index];
int color = state->bg1videoram[tile_index + 0x400];
code += (color & 0xe0)<<3;
@@ -61,10 +61,10 @@ static TILE_GET_INFO( trojan_get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
int code, color;
- UINT8 *rom = machine->region("gfx5")->base();
- int mask = machine->region("gfx5")->bytes() - 1;
+ UINT8 *rom = machine.region("gfx5")->base();
+ int mask = machine.region("gfx5")->bytes() - 1;
tile_index = (tile_index + state->bg2_image * 0x20) & mask;
code = rom[tile_index];
@@ -84,7 +84,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
VIDEO_START( lwings )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg1_tilemap = tilemap_create(machine, lwings_get_bg1_tile_info, tilemap_scan_cols, 16, 16, 32, 32);
@@ -94,7 +94,7 @@ VIDEO_START( lwings )
VIDEO_START( trojan )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg1_tilemap = tilemap_create(machine, trojan_get_bg1_tile_info,tilemap_scan_cols, 16, 16, 32, 32);
@@ -109,7 +109,7 @@ VIDEO_START( trojan )
VIDEO_START( avengers )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
VIDEO_START_CALL(trojan);
state->bg2_avenger_hw = 1;
@@ -123,14 +123,14 @@ VIDEO_START( avengers )
WRITE8_HANDLER( lwings_fgvideoram_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( lwings_bg1videoram_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->bg1videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap, offset & 0x3ff);
}
@@ -138,27 +138,27 @@ WRITE8_HANDLER( lwings_bg1videoram_w )
WRITE8_HANDLER( lwings_bg1_scrollx_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->scroll_x[offset] = data;
tilemap_set_scrollx(state->bg1_tilemap, 0, state->scroll_x[0] | (state->scroll_x[1] << 8));
}
WRITE8_HANDLER( lwings_bg1_scrolly_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->scroll_y[offset] = data;
tilemap_set_scrolly(state->bg1_tilemap, 0, state->scroll_y[0] | (state->scroll_y[1] << 8));
}
WRITE8_HANDLER( trojan_bg2_scrollx_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
tilemap_set_scrollx(state->bg2_tilemap, 0, data);
}
WRITE8_HANDLER( trojan_bg2_image_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
if (state->bg2_image != data)
{
@@ -184,12 +184,12 @@ INLINE int is_sprite_on( UINT8 *buffered_spriteram, int offs )
return sx || sy;
}
-static void lwings_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void lwings_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
- for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4; offs >= 0; offs -= 4)
{
if (is_sprite_on(buffered_spriteram, offs))
{
@@ -212,7 +212,7 @@ static void lwings_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,color,
flipx,flipy,
sx,sy,15);
@@ -220,13 +220,13 @@ static void lwings_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
}
}
-static void trojan_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- lwings_state *state = machine->driver_data<lwings_state>();
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ lwings_state *state = machine.driver_data<lwings_state>();
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
- for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4; offs >= 0; offs -= 4)
{
if (is_sprite_on(buffered_spriteram, offs))
{
@@ -261,7 +261,7 @@ static void trojan_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,color,
flipx,flipy,
sx,sy,15);
@@ -271,21 +271,21 @@ static void trojan_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( lwings )
{
- lwings_state *state = screen->machine->driver_data<lwings_state>();
+ lwings_state *state = screen->machine().driver_data<lwings_state>();
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- lwings_draw_sprites(screen->machine, bitmap, cliprect);
+ lwings_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( trojan )
{
- lwings_state *state = screen->machine->driver_data<lwings_state>();
+ lwings_state *state = screen->machine().driver_data<lwings_state>();
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, TILEMAP_DRAW_LAYER1, 0);
- trojan_draw_sprites(screen->machine, bitmap, cliprect);
+ trojan_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -293,7 +293,7 @@ SCREEN_UPDATE( trojan )
SCREEN_EOF( lwings )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/m10.c b/src/mame/video/m10.c
index d1101b2783a..04a001431f6 100644
--- a/src/mame/video/m10.c
+++ b/src/mame/video/m10.c
@@ -48,9 +48,9 @@ static UINT32 tilemap_scan( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_
}
-static void get_tile_info( running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param )
+static void get_tile_info( running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
SET_TILE_INFO(0, state->videoram[tile_index], state->colorram[tile_index] & 0x07, 0);
}
@@ -58,7 +58,7 @@ static void get_tile_info( running_machine *machine, tile_data *tileinfo, tilema
WRITE8_HANDLER( m10_colorram_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
if (state->colorram[offset] != data)
{
@@ -70,7 +70,7 @@ WRITE8_HANDLER( m10_colorram_w )
WRITE8_HANDLER( m10_chargen_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
if (state->chargen[offset] != data)
{
@@ -82,19 +82,19 @@ WRITE8_HANDLER( m10_chargen_w )
WRITE8_HANDLER( m15_chargen_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
if (state->chargen[offset] != data)
{
state->chargen[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 3);
}
}
-INLINE void plot_pixel_m10( running_machine *machine, bitmap_t *bm, int x, int y, int col )
+INLINE void plot_pixel_m10( running_machine &machine, bitmap_t *bm, int x, int y, int col )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
if (!state->flip)
*BITMAP_ADDR16(bm, y, x) = col;
@@ -105,7 +105,7 @@ INLINE void plot_pixel_m10( running_machine *machine, bitmap_t *bm, int x, int y
VIDEO_START( m10 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
state->tx_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->tx_tilemap, 0);
@@ -114,15 +114,15 @@ VIDEO_START( m10 )
state->back_gfx = gfx_element_alloc(machine, &backlayout, state->chargen, 8, 0);
- machine->gfx[1] = state->back_gfx;
+ machine.gfx[1] = state->back_gfx;
return ;
}
VIDEO_START( m15 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
- machine->gfx[0] = gfx_element_alloc(machine, &charlayout, state->chargen, 8, 0);
+ machine.gfx[0] = gfx_element_alloc(machine, &charlayout, state->chargen, 8, 0);
state->tx_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan, 8, 8, 32, 32);
tilemap_set_scrolldx(state->tx_tilemap, 0, 116);
@@ -139,7 +139,7 @@ VIDEO_START( m15 )
SCREEN_UPDATE( m10 )
{
- m10_state *state = screen->machine->driver_data<m10_state>();
+ m10_state *state = screen->machine().driver_data<m10_state>();
int offs;
static const int color[4]= { 3, 3, 5, 5 };
static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
@@ -158,7 +158,7 @@ SCREEN_UPDATE( m10 )
int y;
for (y = IREMM10_VBEND; y < IREMM10_VBSTART; y++)
- plot_pixel_m10(screen->machine, bitmap, 16, y, 1);
+ plot_pixel_m10(screen->machine(), bitmap, 16, y, 1);
}
for (offs = state->videoram_size - 1; offs >= 0; offs--)
@@ -179,7 +179,7 @@ SCREEN_UPDATE( m10 )
SCREEN_UPDATE( m15 )
{
- m10_state *state = screen->machine->driver_data<m10_state>();
+ m10_state *state = screen->machine().driver_data<m10_state>();
int offs;
for (offs = state->videoram_size - 1; offs >= 0; offs--)
diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c
index 8782f8904e6..d8ff9a8d64f 100644
--- a/src/mame/video/m107.c
+++ b/src/mame/video/m107.c
@@ -44,7 +44,7 @@
static TILE_GET_INFO( get_pf_tile_info )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
pf_layer_info *layer = (pf_layer_info *)param;
int tile, attrib;
tile_index = 2 * tile_index + layer->vram_base;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_pf_tile_info )
WRITE16_HANDLER( m107_vram_w )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
int laynum;
COMBINE_DATA(&state->vram_data[offset]);
@@ -79,7 +79,7 @@ WRITE16_HANDLER( m107_vram_w )
WRITE16_HANDLER( m107_control_w )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
UINT16 old = state->control[offset];
pf_layer_info *layer;
@@ -123,7 +123,7 @@ WRITE16_HANDLER( m107_control_w )
VIDEO_START( m107 )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
int laynum;
for (laynum = 0; laynum < 4; laynum++)
@@ -150,12 +150,12 @@ VIDEO_START( m107 )
/*****************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
UINT16 *spriteram = state->buffered_spriteram;
int offs;
- UINT8 *rom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("user1")->base();
for (offs = 0;offs < 0x800;offs += 4)
{
@@ -189,20 +189,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (i=0; i<y_multi; i++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
fx,fy,
x,y-i*16,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
/* wrap-around y */
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
fx,fy,
x,(y-i*16) - 0x200,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
if (fy) s_ptr++; else s_ptr--;
}
@@ -246,20 +246,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (!ffy) sprite+=y_multi-1;
for (i=0; i<y_multi; i++)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite+(ffy?i:-i),
colour,
ffx,ffy,
(x+xdisp)&0x1ff,(y-ydisp-16*i)&0x1ff,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
/* wrap-around y */
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite+(ffy?i:-i),
colour,
ffx,ffy,
(x+xdisp)&0x1ff,((y-ydisp-16*i)&0x1ff)-0x200,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
}
if (rom[rom_offs+1]&0x80) break; /* end of block */
@@ -273,9 +273,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/*****************************************************************************/
-static void m107_update_scroll_positions(running_machine *machine)
+static void m107_update_scroll_positions(running_machine &machine)
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
int laynum;
int i;
@@ -313,12 +313,12 @@ static void m107_update_scroll_positions(running_machine *machine)
/*****************************************************************************/
-static void m107_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int laynum, int category,int opaque)
+static void m107_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int laynum, int category,int opaque)
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
int line;
rectangle clip;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
clip.min_x = visarea.min_x;
clip.max_x = visarea.max_x;
clip.min_y = visarea.min_y;
@@ -342,10 +342,10 @@ static void m107_tilemap_draw(running_machine *machine, bitmap_t *bitmap, const
}
-static void m107_screenrefresh(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void m107_screenrefresh(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- m107_state *state = machine->driver_data<m107_state>();
- bitmap_fill(machine->priority_bitmap, cliprect, 0);
+ m107_state *state = machine.driver_data<m107_state>();
+ bitmap_fill(machine.priority_bitmap, cliprect, 0);
if ((~state->control[0x0b] >> 7) & 1)
{
@@ -374,7 +374,7 @@ static void m107_screenrefresh(running_machine *machine, bitmap_t *bitmap, const
WRITE16_HANDLER( m107_spritebuffer_w )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
if (ACCESSING_BITS_0_7) {
/*
TODO: this register looks a lot more complex than how the game uses it. All of them seems to test various bit combinations during POST.
@@ -390,8 +390,8 @@ WRITE16_HANDLER( m107_spritebuffer_w )
SCREEN_UPDATE( m107 )
{
- m107_update_scroll_positions(screen->machine);
- m107_screenrefresh(screen->machine, bitmap, cliprect);
+ m107_update_scroll_positions(screen->machine());
+ m107_screenrefresh(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/m52.c b/src/mame/video/m52.c
index 69c91c155b7..6766b8976fd 100644
--- a/src/mame/video/m52.c
+++ b/src/mame/video/m52.c
@@ -28,7 +28,7 @@ PALETTE_INIT( m52 )
double weights_r[3], weights_g[3], weights_b[3], scale;
int i;
- machine->colortable = colortable_alloc(machine, 512 + 32 + 32);
+ machine.colortable = colortable_alloc(machine, 512 + 32 + 32);
/* compute palette information for characters/backgrounds */
scale = compute_resistor_weights(0, 255, -1.0,
@@ -44,7 +44,7 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
}
/* background palette */
@@ -55,7 +55,7 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_2_weights(weights_b, BIT(promval,6), BIT(promval,7));
- colortable_palette_set_color(machine->colortable, 512+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, 512+i, MAKE_RGB(r,g,b));
}
/* compute palette information for sprites */
@@ -72,18 +72,18 @@ PALETTE_INIT( m52 )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine->colortable, 512 + 32 + i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, 512 + 32 + i, MAKE_RGB(r,g,b));
}
/* character lookup table */
for (i = 0; i < 512; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprite lookup table */
for (i = 0; i < 16 * 4; i++)
{
UINT8 promval = sprite_table[(i & 3) | ((i & ~3) << 1)];
- colortable_entry_set_value(machine->colortable, 512 + i, 512 + 32 + promval);
+ colortable_entry_set_value(machine.colortable, 512 + i, 512 + 32 + promval);
}
/* background */
@@ -92,18 +92,18 @@ PALETTE_INIT( m52 )
/* xbb00: mountains */
/* 0xxbb: hills */
/* 1xxbb: city */
- colortable_entry_set_value(machine->colortable, 512+16*4+0*4+0, 512);
- colortable_entry_set_value(machine->colortable, 512+16*4+0*4+1, 512+4);
- colortable_entry_set_value(machine->colortable, 512+16*4+0*4+2, 512+8);
- colortable_entry_set_value(machine->colortable, 512+16*4+0*4+3, 512+12);
- colortable_entry_set_value(machine->colortable, 512+16*4+1*4+0, 512);
- colortable_entry_set_value(machine->colortable, 512+16*4+1*4+1, 512+1);
- colortable_entry_set_value(machine->colortable, 512+16*4+1*4+2, 512+2);
- colortable_entry_set_value(machine->colortable, 512+16*4+1*4+3, 512+3);
- colortable_entry_set_value(machine->colortable, 512+16*4+2*4+0, 512);
- colortable_entry_set_value(machine->colortable, 512+16*4+2*4+1, 512+16+1);
- colortable_entry_set_value(machine->colortable, 512+16*4+2*4+2, 512+16+2);
- colortable_entry_set_value(machine->colortable, 512+16*4+2*4+3, 512+16+3);
+ colortable_entry_set_value(machine.colortable, 512+16*4+0*4+0, 512);
+ colortable_entry_set_value(machine.colortable, 512+16*4+0*4+1, 512+4);
+ colortable_entry_set_value(machine.colortable, 512+16*4+0*4+2, 512+8);
+ colortable_entry_set_value(machine.colortable, 512+16*4+0*4+3, 512+12);
+ colortable_entry_set_value(machine.colortable, 512+16*4+1*4+0, 512);
+ colortable_entry_set_value(machine.colortable, 512+16*4+1*4+1, 512+1);
+ colortable_entry_set_value(machine.colortable, 512+16*4+1*4+2, 512+2);
+ colortable_entry_set_value(machine.colortable, 512+16*4+1*4+3, 512+3);
+ colortable_entry_set_value(machine.colortable, 512+16*4+2*4+0, 512);
+ colortable_entry_set_value(machine.colortable, 512+16*4+2*4+1, 512+16+1);
+ colortable_entry_set_value(machine.colortable, 512+16*4+2*4+2, 512+16+2);
+ colortable_entry_set_value(machine.colortable, 512+16*4+2*4+3, 512+16+3);
}
@@ -116,7 +116,7 @@ PALETTE_INIT( m52 )
static TILE_GET_INFO( get_tile_info )
{
- m52_state *state = machine->driver_data<m52_state>();
+ m52_state *state = machine.driver_data<m52_state>();
UINT8 video = state->videoram[tile_index];
UINT8 color = state->colorram[tile_index];
@@ -148,7 +148,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( m52 )
{
- m52_state *state = machine->driver_data<m52_state>();
+ m52_state *state = machine.driver_data<m52_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -174,7 +174,7 @@ VIDEO_START( m52 )
WRITE8_HANDLER( m52_scroll_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
/*
According to the schematics there is only one video register that holds the X scroll value
with a NAND gate on the V64 and V128 lines to control when it's read, and when
@@ -198,7 +198,7 @@ WRITE8_HANDLER( m52_scroll_w )
WRITE8_HANDLER( m52_videoram_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -207,7 +207,7 @@ WRITE8_HANDLER( m52_videoram_w )
WRITE8_HANDLER( m52_colorram_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -226,7 +226,7 @@ WRITE8_HANDLER( m52_colorram_w )
follows: result = popcount(value & 0x7f) ^ (value >> 7) */
READ8_HANDLER( m52_protection_r )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
int popcount = 0;
int temp;
@@ -245,31 +245,31 @@ READ8_HANDLER( m52_protection_r )
WRITE8_HANDLER( m52_bg1ypos_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->bg1ypos = data;
}
WRITE8_HANDLER( m52_bg1xpos_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->bg1xpos = data;
}
WRITE8_HANDLER( m52_bg2xpos_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->bg2xpos = data;
}
WRITE8_HANDLER( m52_bg2ypos_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->bg2ypos = data;
}
WRITE8_HANDLER( m52_bgcontrol_w )
{
- m52_state *state = space->machine->driver_data<m52_state>();
+ m52_state *state = space->machine().driver_data<m52_state>();
state->bgcontrol = data;
}
@@ -284,15 +284,15 @@ WRITE8_HANDLER( m52_bgcontrol_w )
WRITE8_HANDLER( m52_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set(space->machine, (data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01));
+ flip_screen_set(space->machine(), (data & 0x01) ^ (~input_port_read(space->machine(), "DSW2") & 0x01));
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x20);
}
WRITE8_HANDLER( alpha1v_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
@@ -303,10 +303,10 @@ WRITE8_HANDLER( alpha1v_flipscreen_w )
*
*************************************/
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xpos, int ypos, int image)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int xpos, int ypos, int image)
{
rectangle rect;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
if (flip_screen_get(machine))
{
@@ -320,7 +320,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
ypos = ypos + (22 - 8);
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[image],
+ machine.gfx[image],
0, 0,
flip_screen_get(machine),
flip_screen_get(machine),
@@ -328,7 +328,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
ypos, 0);
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[image],
+ machine.gfx[image],
0, 0,
flip_screen_get(machine),
flip_screen_get(machine),
@@ -349,7 +349,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
rect.max_y = ypos + 2 * BGHEIGHT - 1;
}
- bitmap_fill(bitmap, &rect, machine->gfx[image]->color_base + 3);
+ bitmap_fill(bitmap, &rect, machine.gfx[image]->color_base + 3);
}
@@ -362,7 +362,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( m52 )
{
- m52_state *state = screen->machine->driver_data<m52_state>();
+ m52_state *state = screen->machine().driver_data<m52_state>();
int offs;
bitmap_fill(bitmap, cliprect, 0);
@@ -370,16 +370,16 @@ SCREEN_UPDATE( m52 )
if (!(state->bgcontrol & 0x20))
{
if (!(state->bgcontrol & 0x10))
- draw_background(screen->machine, bitmap, cliprect, state->bg2xpos, state->bg2ypos, 2); /* distant mountains */
+ draw_background(screen->machine(), bitmap, cliprect, state->bg2xpos, state->bg2ypos, 2); /* distant mountains */
if (!(state->bgcontrol & 0x02))
- draw_background(screen->machine, bitmap, cliprect, state->bg1xpos, state->bg1ypos, 3); /* hills */
+ draw_background(screen->machine(), bitmap, cliprect, state->bg1xpos, state->bg1ypos, 3); /* hills */
if (!(state->bgcontrol & 0x04))
- draw_background(screen->machine, bitmap, cliprect, state->bg1xpos, state->bg1ypos, 4); /* cityscape */
+ draw_background(screen->machine(), bitmap, cliprect, state->bg1xpos, state->bg1ypos, 4); /* cityscape */
}
- tilemap_set_flip(state->bg_tilemap, flip_screen_get(screen->machine) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ tilemap_set_flip(state->bg_tilemap, flip_screen_get(screen->machine()) ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -403,7 +403,7 @@ SCREEN_UPDATE( m52 )
clip.min_y = 128, clip.max_y = 255;
/* adjust for flipping */
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
int temp = clip.min_y;
clip.min_y = 255 - clip.max_y;
@@ -423,9 +423,9 @@ SCREEN_UPDATE( m52 )
clip = *cliprect;
#endif
- drawgfx_transmask(bitmap, &clip, screen->machine->gfx[1],
+ drawgfx_transmask(bitmap, &clip, screen->machine().gfx[1],
code, color, flipx, flipy, sx, sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 512 + 32));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 512 + 32));
}
return 0;
}
diff --git a/src/mame/video/m57.c b/src/mame/video/m57.c
index 8425f31e301..7bdc3fd7ebb 100644
--- a/src/mame/video/m57.c
+++ b/src/mame/video/m57.c
@@ -34,7 +34,7 @@ PALETTE_INIT( m57 )
{
int i;
- machine->colortable = colortable_alloc(machine, 32 * 8 + 16);
+ machine.colortable = colortable_alloc(machine, 32 * 8 + 16);
/* character palette */
for (i = 0; i < 256; i++)
@@ -57,8 +57,8 @@ PALETTE_INIT( m57 )
bit2 = (color_prom[0] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
+ colortable_entry_set_value(machine.colortable, i, i);
color_prom++;
}
@@ -86,7 +86,7 @@ PALETTE_INIT( m57 )
bit2 = (*color_prom >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i + 256, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, i + 256, MAKE_RGB(r,g,b));
color_prom++;
}
@@ -97,7 +97,7 @@ PALETTE_INIT( m57 )
/* sprite lookup table */
for (i = 0; i < 32 * 8; i++)
{
- colortable_entry_set_value(machine->colortable, i + 32 * 8, 256 + (~*color_prom & 0x0f));
+ colortable_entry_set_value(machine.colortable, i + 32 * 8, 256 + (~*color_prom & 0x0f));
color_prom++;
}
}
@@ -111,7 +111,7 @@ PALETTE_INIT( m57 )
static TILE_GET_INFO( get_tile_info )
{
- m57_state *state = machine->driver_data<m57_state>();
+ m57_state *state = machine.driver_data<m57_state>();
UINT8 attr = state->videoram[tile_index * 2 + 0];
UINT16 code = state->videoram[tile_index * 2 + 1] | ((attr & 0xc0) << 2);
@@ -128,7 +128,7 @@ static TILE_GET_INFO( get_tile_info )
WRITE8_HANDLER( m57_videoram_w )
{
- m57_state *state = space->machine->driver_data<m57_state>();
+ m57_state *state = space->machine().driver_data<m57_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -143,7 +143,7 @@ WRITE8_HANDLER( m57_videoram_w )
VIDEO_START( m57 )
{
- m57_state *state = machine->driver_data<m57_state>();
+ m57_state *state = machine.driver_data<m57_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 256);
@@ -160,14 +160,14 @@ VIDEO_START( m57 )
WRITE8_HANDLER( m57_flipscreen_w )
{
- m57_state *state = space->machine->driver_data<m57_state>();
+ m57_state *state = space->machine().driver_data<m57_state>();
/* screen flip is handled both by software and hardware */
- state->flipscreen = (data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01);
+ state->flipscreen = (data & 0x01) ^ (~input_port_read(space->machine(), "DSW2") & 0x01);
tilemap_set_flip(state->bg_tilemap, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- coin_counter_w(space->machine, 0,data & 0x02);
- coin_counter_w(space->machine, 1,data & 0x20);
+ coin_counter_w(space->machine(), 0,data & 0x02);
+ coin_counter_w(space->machine(), 1,data & 0x20);
}
@@ -177,9 +177,9 @@ WRITE8_HANDLER( m57_flipscreen_w )
*
*************************************/
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- m57_state *state = machine->driver_data<m57_state>();
+ m57_state *state = machine.driver_data<m57_state>();
int y,x;
INT16 scrolly;
@@ -221,9 +221,9 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- m57_state *state = machine->driver_data<m57_state>();
+ m57_state *state = machine.driver_data<m57_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -250,12 +250,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1 + bank],
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1 + bank],
tile_number,
color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 256 + 15));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 256 + 15));
}
}
@@ -269,7 +269,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( m57 )
{
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/m58.c b/src/mame/video/m58.c
index 15bc4d68cd7..bb6ed89de15 100644
--- a/src/mame/video/m58.c
+++ b/src/mame/video/m58.c
@@ -32,7 +32,7 @@ PALETTE_INIT( yard )
double weights_r[3], weights_g[3], weights_b[3], scale;
int i;
- machine->colortable = colortable_alloc(machine, 256+256+16);
+ machine.colortable = colortable_alloc(machine, 256+256+16);
/* compute palette information for characters/radar */
scale = compute_resistor_weights(0, 255, -1.0,
@@ -48,7 +48,7 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
}
/* radar palette */
@@ -59,7 +59,7 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine->colortable, 256+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, 256+i, MAKE_RGB(r,g,b));
}
/* compute palette information for sprites */
@@ -76,22 +76,22 @@ PALETTE_INIT( yard )
int g = combine_3_weights(weights_g, BIT(promval,3), BIT(promval,4), BIT(promval,5));
int b = combine_3_weights(weights_b, BIT(promval,0), BIT(promval,1), BIT(promval,2));
- colortable_palette_set_color(machine->colortable, 256+256+i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, 256+256+i, MAKE_RGB(r,g,b));
}
/* character lookup table */
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* radar lookup table */
for (i = 0; i < 256; i++)
- colortable_entry_set_value(machine->colortable, 256+i, 256+i);
+ colortable_entry_set_value(machine.colortable, 256+i, 256+i);
/* sprite lookup table */
for (i = 0; i < 256; i++)
{
UINT8 promval = sprite_table[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, 256+256+i, 256+256+promval);
+ colortable_entry_set_value(machine.colortable, 256+256+i, 256+256+promval);
}
}
@@ -105,7 +105,7 @@ PALETTE_INIT( yard )
WRITE8_HANDLER( yard_videoram_w )
{
- m58_state *state = space->machine->driver_data<m58_state>();
+ m58_state *state = space->machine().driver_data<m58_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -114,7 +114,7 @@ WRITE8_HANDLER( yard_videoram_w )
WRITE8_HANDLER( yard_scroll_panel_w )
{
- m58_state *state = space->machine->driver_data<m58_state>();
+ m58_state *state = space->machine().driver_data<m58_state>();
int sx,sy,i;
@@ -147,7 +147,7 @@ WRITE8_HANDLER( yard_scroll_panel_w )
static TILE_GET_INFO( yard_get_bg_tile_info )
{
- m58_state *state = machine->driver_data<m58_state>();
+ m58_state *state = machine.driver_data<m58_state>();
int offs = tile_index * 2;
int attr = state->videoram[offs + 1];
@@ -178,12 +178,12 @@ static UINT32 yard_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, U
VIDEO_START( yard )
{
- m58_state *state = machine->driver_data<m58_state>();
+ m58_state *state = machine.driver_data<m58_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
- bitmap_format format = machine->primary_screen->format();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
+ bitmap_format format = machine.primary_screen->format();
+ const rectangle &visarea = machine.primary_screen->visible_area();
state->bg_tilemap = tilemap_create(machine, yard_get_bg_tile_info, yard_tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scrolldx(state->bg_tilemap, visarea.min_x, width - (visarea.max_x + 1));
@@ -203,10 +203,10 @@ VIDEO_START( yard )
WRITE8_HANDLER( yard_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- flip_screen_set(space->machine, (data & 0x01) ^ (~input_port_read(space->machine, "DSW2") & 0x01));
+ flip_screen_set(space->machine(), (data & 0x01) ^ (~input_port_read(space->machine(), "DSW2") & 0x01));
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x20);
}
@@ -217,13 +217,13 @@ WRITE8_HANDLER( yard_flipscreen_w )
*
*************************************/
-#define DRAW_SPRITE(code, sy) drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 512));
+#define DRAW_SPRITE(code, sy) drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 512));
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- m58_state *state = machine->driver_data<m58_state>();
+ m58_state *state = machine.driver_data<m58_state>();
int offs;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
{
@@ -274,9 +274,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
*
*************************************/
-static void draw_panel( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- m58_state *state = machine->driver_data<m58_state>();
+ m58_state *state = machine.driver_data<m58_state>();
if (!*state->yard_score_panel_disabled)
{
@@ -291,7 +291,7 @@ static void draw_panel( running_machine *machine, bitmap_t *bitmap, const rectan
1*8, 31*8-1
};
rectangle clip = flip_screen_get(machine) ? clippanelflip : clippanel;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int sx = flip_screen_get(machine) ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
int yoffs = flip_screen_get(machine) ? -40 : -16;
@@ -314,13 +314,13 @@ static void draw_panel( running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( yard )
{
- m58_state *state = screen->machine->driver_data<m58_state>();
+ m58_state *state = screen->machine().driver_data<m58_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, (*state->yard_scroll_x_high * 0x100) + *state->yard_scroll_x_low);
tilemap_set_scrolly(state->bg_tilemap, 0, *state->yard_scroll_y_low);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_panel(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_panel(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index 3b0ec6a15c9..c1dea33e9b2 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -182,7 +182,7 @@ static const res_net_decode_info spelunk2_sprite_decode_info =
PALETTE_INIT( m62 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &m62_tile_decode_info, &m62_tile_net_info);
@@ -193,7 +193,7 @@ PALETTE_INIT( m62 )
palette_set_colors(machine, 0x100, rgb, 0x100);
auto_free(machine, rgb);
- palette_normalize_range(machine->palette, 0x000, 0x1ff, 0x00, 0xff);
+ palette_normalize_range(machine.palette, 0x000, 0x1ff, 0x00, 0xff);
/* we'll need this at run time */
state->sprite_height_prom = color_prom + 0x600;
@@ -202,7 +202,7 @@ PALETTE_INIT( m62 )
PALETTE_INIT( lotlot )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &lotlot_tile_decode_info, &m62_tile_net_info);
@@ -213,7 +213,7 @@ PALETTE_INIT( lotlot )
palette_set_colors(machine, 0x180, rgb, 0x180);
auto_free(machine, rgb);
- palette_normalize_range(machine->palette, 0x000, 0x2ff, 0x00, 0xff);
+ palette_normalize_range(machine.palette, 0x000, 0x2ff, 0x00, 0xff);
/* we'll need this at run time */
state->sprite_height_prom = color_prom + 0x900;
@@ -222,7 +222,7 @@ PALETTE_INIT( lotlot )
PALETTE_INIT( battroad )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &m62_tile_decode_info, &m62_tile_net_info);
@@ -237,7 +237,7 @@ PALETTE_INIT( battroad )
palette_set_colors(machine, 0x200, rgb, 0x020);
auto_free(machine, rgb);
- palette_normalize_range(machine->palette, 0x000, 0x21f, 0x00, 0xff);
+ palette_normalize_range(machine.palette, 0x000, 0x21f, 0x00, 0xff);
state->sprite_height_prom = color_prom + 0x620; /* we'll need this at run time */
}
@@ -245,7 +245,7 @@ PALETTE_INIT( battroad )
PALETTE_INIT( spelunk2 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
rgb_t *rgb;
rgb = compute_res_net_all(machine, color_prom, &spelunk2_tile_decode_info, &m62_tile_net_info);
@@ -256,16 +256,16 @@ PALETTE_INIT( spelunk2 )
palette_set_colors(machine, 0x200, rgb, 0x100);
auto_free(machine, rgb);
- palette_normalize_range(machine->palette, 0x000, 0x2ff, 0x00, 0xff);
+ palette_normalize_range(machine.palette, 0x000, 0x2ff, 0x00, 0xff);
/* we'll need this at run time */
state->sprite_height_prom = color_prom + 0x700;
}
-static void register_savestate( running_machine *machine )
+static void register_savestate( running_machine &machine )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->m62_background_hscroll));
@@ -280,62 +280,62 @@ static void register_savestate( running_machine *machine )
WRITE8_HANDLER( m62_flipscreen_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
/* screen flip is handled both by software and hardware */
- data ^= ~input_port_read(space->machine, "DSW2") & 1;
+ data ^= ~input_port_read(space->machine(), "DSW2") & 1;
state->flipscreen = data & 0x01;
if (state->flipscreen)
- tilemap_set_flip_all(space->machine, TILEMAP_FLIPX | TILEMAP_FLIPY);
+ tilemap_set_flip_all(space->machine(), TILEMAP_FLIPX | TILEMAP_FLIPY);
else
- tilemap_set_flip_all(space->machine, 0);
+ tilemap_set_flip_all(space->machine(), 0);
- coin_counter_w(space->machine, 0, data & 2);
- coin_counter_w(space->machine, 1, data & 4);
+ coin_counter_w(space->machine(), 0, data & 2);
+ coin_counter_w(space->machine(), 1, data & 4);
}
WRITE8_HANDLER( m62_hscroll_low_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_background_hscroll = (state->m62_background_hscroll & 0xff00) | data;
}
WRITE8_HANDLER( m62_hscroll_high_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_background_hscroll = (state->m62_background_hscroll & 0xff) | (data << 8);
}
WRITE8_HANDLER( m62_vscroll_low_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_background_vscroll = (state->m62_background_vscroll & 0xff00) | data;
}
WRITE8_HANDLER( m62_vscroll_high_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_background_vscroll = (state->m62_background_vscroll & 0xff) | (data << 8);
}
WRITE8_HANDLER( m62_tileram_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_tileram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
}
WRITE8_HANDLER( m62_textram_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_textram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset >> 1);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int colormask, int prioritymask, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int colormask, int prioritymask, int priority )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 8)
@@ -381,7 +381,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + i * incr,col,
flipx,flipy,
sx,sy + 16 * i,0);
@@ -392,9 +392,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void m62_start( running_machine *machine, tile_get_info_func tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
+static void m62_start( running_machine &machine, tile_get_info_func tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->bg_tilemap = tilemap_create(machine, tile_get_info, tilemap_scan_rows, x1, y1, x2, y2);
register_savestate(machine);
@@ -406,9 +406,9 @@ static void m62_start( running_machine *machine, tile_get_info_func tile_get_inf
tilemap_set_scroll_cols(state->bg_tilemap, cols);
}
-static void m62_textlayer( running_machine *machine, tile_get_info_func tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
+static void m62_textlayer( running_machine &machine, tile_get_info_func tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->fg_tilemap = tilemap_create(machine, tile_get_info, tilemap_scan_rows, x1, y1, x2, y2);
if (rows != 0)
@@ -420,14 +420,14 @@ static void m62_textlayer( running_machine *machine, tile_get_info_func tile_get
WRITE8_HANDLER( kungfum_tileram_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->m62_tileram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x7ff);
}
static TILE_GET_INFO( get_kungfum_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
int flags;
@@ -454,7 +454,7 @@ VIDEO_START( kungfum )
SCREEN_UPDATE( kungfum )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
int i;
for (i = 0; i < 6; i++)
{
@@ -465,7 +465,7 @@ SCREEN_UPDATE( kungfum )
tilemap_set_scrollx(state->bg_tilemap, i, state->m62_background_hscroll);
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
return 0;
}
@@ -473,7 +473,7 @@ SCREEN_UPDATE( kungfum )
static TILE_GET_INFO( get_ldrun_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
@@ -494,7 +494,7 @@ static TILE_GET_INFO( get_ldrun_bg_tile_info )
VIDEO_START( ldrun )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
m62_start(machine, get_ldrun_bg_tile_info, 1, 1, 8, 8, 64, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
@@ -503,20 +503,20 @@ VIDEO_START( ldrun )
SCREEN_UPDATE( ldrun )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll);
tilemap_set_scrolly(state->bg_tilemap, 0, state->m62_background_vscroll);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x10);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
return 0;
}
static TILE_GET_INFO( get_ldrun2_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
int flags;
@@ -536,7 +536,7 @@ static TILE_GET_INFO( get_ldrun2_bg_tile_info )
VIDEO_START( ldrun2 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
m62_start(machine, get_ldrun2_bg_tile_info, 1, 1, 8, 8, 64, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
tilemap_set_transmask(state->bg_tilemap, 1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
@@ -545,13 +545,13 @@ VIDEO_START( ldrun2 )
WRITE8_HANDLER( ldrun3_topbottom_mask_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->ldrun3_topbottom_mask = data & 1;
}
SCREEN_UPDATE( ldrun3 )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
SCREEN_UPDATE_CALL(ldrun);
if (state->ldrun3_topbottom_mask)
@@ -560,11 +560,11 @@ SCREEN_UPDATE( ldrun3 )
my_cliprect.min_y = 0 * 8;
my_cliprect.max_y = 1 * 8 - 1;
- bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine()));
my_cliprect.min_y = 31 * 8;
my_cliprect.max_y = 32 * 8 - 1;
- bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, &my_cliprect, get_black_pen(screen->machine()));
}
return 0;
@@ -573,7 +573,7 @@ SCREEN_UPDATE( ldrun3 )
static TILE_GET_INFO( get_battroad_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
int flags;
@@ -593,7 +593,7 @@ static TILE_GET_INFO( get_battroad_bg_tile_info )
static TILE_GET_INFO( get_battroad_fg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_textram[tile_index << 1];
@@ -603,7 +603,7 @@ static TILE_GET_INFO( get_battroad_fg_tile_info )
VIDEO_START( battroad )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
m62_start(machine, get_battroad_bg_tile_info, 1, 1, 8, 8, 64, 32);
m62_textlayer(machine, get_battroad_fg_tile_info, 1, 1, 8, 8, 32, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
@@ -612,7 +612,7 @@ VIDEO_START( battroad )
SCREEN_UPDATE( battroad )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll);
tilemap_set_scrolly(state->bg_tilemap, 0, state->m62_background_vscroll);
tilemap_set_scrollx(state->fg_tilemap, 0, 128);
@@ -620,9 +620,9 @@ SCREEN_UPDATE( battroad )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0f, 0x10, 0x10);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0f, 0x10, 0x10);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -632,7 +632,7 @@ SCREEN_UPDATE( battroad )
/* no char x flip, and more sprites */
static TILE_GET_INFO( get_ldrun4_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -647,18 +647,18 @@ VIDEO_START( ldrun4 )
SCREEN_UPDATE( ldrun4 )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll - 2);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
return 0;
}
static TILE_GET_INFO( get_lotlot_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
int flags;
@@ -674,7 +674,7 @@ static TILE_GET_INFO( get_lotlot_bg_tile_info )
static TILE_GET_INFO( get_lotlot_fg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_textram[tile_index << 1];
@@ -690,7 +690,7 @@ VIDEO_START( lotlot )
SCREEN_UPDATE( lotlot )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll - 64);
tilemap_set_scrolly(state->bg_tilemap, 0, state->m62_background_vscroll + 32);
tilemap_set_scrollx(state->fg_tilemap, 0, -64);
@@ -699,26 +699,26 @@ SCREEN_UPDATE( lotlot )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
return 0;
}
WRITE8_HANDLER( kidniki_text_vscroll_low_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->kidniki_text_vscroll = (state->kidniki_text_vscroll & 0xff00) | data;
}
WRITE8_HANDLER( kidniki_text_vscroll_high_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->kidniki_text_vscroll = (state->kidniki_text_vscroll & 0xff) | (data << 8);
}
WRITE8_HANDLER( kidniki_background_bank_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
if (state->kidniki_background_bank != (data & 1))
{
state->kidniki_background_bank = data & 1;
@@ -728,7 +728,7 @@ WRITE8_HANDLER( kidniki_background_bank_w )
static TILE_GET_INFO( get_kidniki_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -739,7 +739,7 @@ static TILE_GET_INFO( get_kidniki_bg_tile_info )
static TILE_GET_INFO( get_kidniki_fg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_textram[tile_index << 1];
@@ -749,7 +749,7 @@ static TILE_GET_INFO( get_kidniki_fg_tile_info )
VIDEO_START( kidniki )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->bg_tilemap = tilemap_create(machine, get_kidniki_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
@@ -762,14 +762,14 @@ VIDEO_START( kidniki )
SCREEN_UPDATE( kidniki )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll);
tilemap_set_scrollx(state->fg_tilemap, 0, -64);
tilemap_set_scrolly(state->fg_tilemap, 0, state->kidniki_text_vscroll + 128);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -778,7 +778,7 @@ SCREEN_UPDATE( kidniki )
WRITE8_HANDLER( spelunkr_palbank_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
if (state->spelunkr_palbank != (data & 0x01))
{
state->spelunkr_palbank = data & 0x01;
@@ -789,7 +789,7 @@ WRITE8_HANDLER( spelunkr_palbank_w )
static TILE_GET_INFO( get_spelunkr_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -799,7 +799,7 @@ static TILE_GET_INFO( get_spelunkr_bg_tile_info )
static TILE_GET_INFO( get_spelunkr_fg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_textram[tile_index << 1];
@@ -816,7 +816,7 @@ VIDEO_START( spelunkr )
SCREEN_UPDATE( spelunkr )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll);
tilemap_set_scrolly(state->bg_tilemap, 0, state->m62_background_vscroll + 128);
tilemap_set_scrollx(state->fg_tilemap, 0, -64);
@@ -824,7 +824,7 @@ SCREEN_UPDATE( spelunkr )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -832,7 +832,7 @@ SCREEN_UPDATE( spelunkr )
WRITE8_HANDLER( spelunk2_gfxport_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
m62_hscroll_high_w(space, 0, (data & 2) >> 1);
m62_vscroll_high_w(space, 0, (data & 1));
if (state->spelunkr_palbank != ((data & 0x0c) >> 2))
@@ -845,7 +845,7 @@ WRITE8_HANDLER( spelunk2_gfxport_w )
static TILE_GET_INFO( get_spelunk2_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -861,7 +861,7 @@ VIDEO_START( spelunk2 )
SCREEN_UPDATE( spelunk2 )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll - 1);
tilemap_set_scrolly(state->bg_tilemap, 0, state->m62_background_vscroll + 128);
tilemap_set_scrollx(state->fg_tilemap, 0, -65);
@@ -869,7 +869,7 @@ SCREEN_UPDATE( spelunk2 )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -877,7 +877,7 @@ SCREEN_UPDATE( spelunk2 )
static TILE_GET_INFO( get_youjyudn_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -891,7 +891,7 @@ static TILE_GET_INFO( get_youjyudn_bg_tile_info )
static TILE_GET_INFO( get_youjyudn_fg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_textram[tile_index << 1];
@@ -901,7 +901,7 @@ static TILE_GET_INFO( get_youjyudn_fg_tile_info )
VIDEO_START( youjyudn )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
m62_start(machine, get_youjyudn_bg_tile_info, 1, 0, 8, 16, 64, 16);
m62_textlayer(machine, get_youjyudn_fg_tile_info, 1, 1, 12, 8, 32, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
@@ -910,14 +910,14 @@ VIDEO_START( youjyudn )
SCREEN_UPDATE( youjyudn )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->m62_background_hscroll);
tilemap_set_scrollx(state->fg_tilemap, 0, -64);
tilemap_set_scrolly(state->fg_tilemap, 0, 0);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -926,13 +926,13 @@ SCREEN_UPDATE( youjyudn )
WRITE8_HANDLER( horizon_scrollram_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
state->scrollram[offset] = data;
}
static TILE_GET_INFO( get_horizon_bg_tile_info )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
int code;
int color;
code = state->m62_tileram[tile_index << 1];
@@ -947,7 +947,7 @@ static TILE_GET_INFO( get_horizon_bg_tile_info )
VIDEO_START( horizon )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
m62_start(machine, get_horizon_bg_tile_info, 32, 0, 8, 8, 64, 32);
tilemap_set_transmask(state->bg_tilemap, 0, 0xffff, 0x0000); /* split type 0 is totally transparent in front half */
tilemap_set_transmask(state->bg_tilemap, 1, 0x0001, 0xfffe); /* split type 1 has pen 0 transparent in front half */
@@ -955,14 +955,14 @@ VIDEO_START( horizon )
SCREEN_UPDATE( horizon )
{
- m62_state *state = screen->machine->driver_data<m62_state>();
+ m62_state *state = screen->machine().driver_data<m62_state>();
int i;
for (i = 0; i < 32; i++)
{
tilemap_set_scrollx(state->bg_tilemap, i, state->scrollram[i << 1] | (state->scrollram[(i << 1) | 1] << 8));
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0x1f, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x1f, 0x00, 0x00);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/m72.c b/src/mame/video/m72.c
index 796851c383c..0b304bc434a 100644
--- a/src/mame/video/m72.c
+++ b/src/mame/video/m72.c
@@ -13,7 +13,7 @@
***************************************************************************/
-INLINE void m72_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
+INLINE void m72_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
{
int code,attr,color,pri;
@@ -36,7 +36,7 @@ INLINE void m72_get_tile_info(running_machine *machine,tile_data *tileinfo,int t
tileinfo->group = pri;
}
-INLINE void rtype2_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
+INLINE void rtype2_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,const UINT16 *vram,int gfxnum)
{
int code,attr,color,pri;
@@ -64,31 +64,31 @@ INLINE void rtype2_get_tile_info(running_machine *machine,tile_data *tileinfo,in
static TILE_GET_INFO( m72_get_bg_tile_info )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
m72_get_tile_info(machine,tileinfo,tile_index,state->videoram2,2);
}
static TILE_GET_INFO( m72_get_fg_tile_info )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
m72_get_tile_info(machine,tileinfo,tile_index,state->videoram1,1);
}
static TILE_GET_INFO( hharry_get_bg_tile_info )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
m72_get_tile_info(machine,tileinfo,tile_index,state->videoram2,1);
}
static TILE_GET_INFO( rtype2_get_bg_tile_info )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
rtype2_get_tile_info(machine,tileinfo,tile_index,state->videoram2,1);
}
static TILE_GET_INFO( rtype2_get_fg_tile_info )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
rtype2_get_tile_info(machine,tileinfo,tile_index,state->videoram1,1);
}
@@ -106,9 +106,9 @@ static TILEMAP_MAPPER( majtitle_scan_rows )
***************************************************************************/
-static void register_savestate(running_machine *machine)
+static void register_savestate(running_machine &machine)
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->save_item(NAME(state->raster_irq_position));
state->save_item(NAME(state->video_off));
state->save_item(NAME(state->scrollx1));
@@ -121,7 +121,7 @@ static void register_savestate(running_machine *machine)
VIDEO_START( m72 )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->bg_tilemap = tilemap_create(machine, m72_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
state->fg_tilemap = tilemap_create(machine, m72_get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -149,7 +149,7 @@ VIDEO_START( m72 )
VIDEO_START( rtype2 )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->bg_tilemap = tilemap_create(machine, rtype2_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
state->fg_tilemap = tilemap_create(machine, rtype2_get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -176,7 +176,7 @@ VIDEO_START( rtype2 )
VIDEO_START( poundfor )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
VIDEO_START_CALL(rtype2);
tilemap_set_scrolldx(state->fg_tilemap,6,0);
@@ -187,7 +187,7 @@ VIDEO_START( poundfor )
/* Major Title has a larger background RAM, and rowscroll */
VIDEO_START( majtitle )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
// The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound).
// The layout ramains 256x64, the right half is just not displayed.
// state->bg_tilemap = tilemap_create(machine, rtype2_get_bg_tile_info,tilemap_scan_rows,8,8,256,64);
@@ -217,7 +217,7 @@ VIDEO_START( majtitle )
VIDEO_START( hharry )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->bg_tilemap = tilemap_create(machine, hharry_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
state->fg_tilemap = tilemap_create(machine, m72_get_fg_tile_info, tilemap_scan_rows,8,8,64,64);
@@ -254,7 +254,7 @@ READ16_HANDLER( m72_palette1_r )
/* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
offset &= ~0x100;
- return space->machine->generic.paletteram.u16[offset] | 0xffe0; /* only D0-D4 are connected */
+ return space->machine().generic.paletteram.u16[offset] | 0xffe0; /* only D0-D4 are connected */
}
READ16_HANDLER( m72_palette2_r )
@@ -262,10 +262,10 @@ READ16_HANDLER( m72_palette2_r )
/* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
offset &= ~0x100;
- return space->machine->generic.paletteram2.u16[offset] | 0xffe0; /* only D0-D4 are connected */
+ return space->machine().generic.paletteram2.u16[offset] | 0xffe0; /* only D0-D4 are connected */
}
-INLINE void changecolor(running_machine *machine,int color,int r,int g,int b)
+INLINE void changecolor(running_machine &machine,int color,int r,int g,int b)
{
palette_set_color_rgb(machine,color,pal5bit(r),pal5bit(g),pal5bit(b));
}
@@ -275,13 +275,13 @@ WRITE16_HANDLER( m72_palette1_w )
/* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
offset &= ~0x100;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
offset &= 0x0ff;
- changecolor(space->machine,
+ changecolor(space->machine(),
offset,
- space->machine->generic.paletteram.u16[offset + 0x000],
- space->machine->generic.paletteram.u16[offset + 0x200],
- space->machine->generic.paletteram.u16[offset + 0x400]);
+ space->machine().generic.paletteram.u16[offset + 0x000],
+ space->machine().generic.paletteram.u16[offset + 0x200],
+ space->machine().generic.paletteram.u16[offset + 0x400]);
}
WRITE16_HANDLER( m72_palette2_w )
@@ -289,62 +289,62 @@ WRITE16_HANDLER( m72_palette2_w )
/* A9 isn't connected, so 0x200-0x3ff mirrors 0x000-0x1ff etc. */
offset &= ~0x100;
- COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
offset &= 0x0ff;
- changecolor(space->machine,
+ changecolor(space->machine(),
offset + 256,
- space->machine->generic.paletteram2.u16[offset + 0x000],
- space->machine->generic.paletteram2.u16[offset + 0x200],
- space->machine->generic.paletteram2.u16[offset + 0x400]);
+ space->machine().generic.paletteram2.u16[offset + 0x000],
+ space->machine().generic.paletteram2.u16[offset + 0x200],
+ space->machine().generic.paletteram2.u16[offset + 0x400]);
}
WRITE16_HANDLER( m72_videoram1_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset/2);
}
WRITE16_HANDLER( m72_videoram2_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
}
WRITE16_HANDLER( m72_irq_line_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->raster_irq_position);
}
WRITE16_HANDLER( m72_scrollx1_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->scrollx1);
}
WRITE16_HANDLER( m72_scrollx2_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->scrollx2);
}
WRITE16_HANDLER( m72_scrolly1_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->scrolly1);
}
WRITE16_HANDLER( m72_scrolly2_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
COMBINE_DATA(&state->scrolly2);
}
WRITE16_HANDLER( m72_dmaon_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_0_7)
memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size);
}
@@ -352,26 +352,26 @@ WRITE16_HANDLER( m72_dmaon_w )
WRITE16_HANDLER( m72_port02_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_0_7)
{
if (data & 0xe0) logerror("write %02x to port 02\n",data);
/* bits 0/1 are coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(space->machine, ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1));
+ flip_screen_set(space->machine(), ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine(), "DSW") >> 8) & 1));
/* bit 3 is display disable */
state->video_off = data & 0x08;
/* bit 4 resets sound CPU (active low) */
if (data & 0x10)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
/* bit 5 = "bank"? */
}
@@ -379,17 +379,17 @@ WRITE16_HANDLER( m72_port02_w )
WRITE16_HANDLER( rtype2_port02_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_0_7)
{
if (data & 0xe0) logerror("write %02x to port 02\n",data);
/* bits 0/1 are coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bit 2 is flip screen (handled both by software and hardware) */
- flip_screen_set(space->machine, ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine, "DSW") >> 8) & 1));
+ flip_screen_set(space->machine(), ((data & 0x04) >> 2) ^ ((~input_port_read(space->machine(), "DSW") >> 8) & 1));
/* bit 3 is display disable */
state->video_off = data & 0x08;
@@ -403,7 +403,7 @@ WRITE16_HANDLER( rtype2_port02_w )
/* the following is mostly a kludge. This register seems to be used for something else */
WRITE16_HANDLER( majtitle_gfx_ctrl_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_8_15)
{
if (data & 0xff00) state->majtitle_rowscroll = 1;
@@ -418,9 +418,9 @@ WRITE16_HANDLER( majtitle_gfx_ctrl_w )
***************************************************************************/
-static void m72_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void m72_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
UINT16 *spriteram = state->buffered_spriteram;
int offs;
@@ -460,7 +460,7 @@ static void m72_draw_sprites(running_machine *machine, bitmap_t *bitmap,const re
if (flipy) c += h-1-y;
else c += y;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
c,
color,
flipx,flipy,
@@ -472,9 +472,9 @@ static void m72_draw_sprites(running_machine *machine, bitmap_t *bitmap,const re
}
}
-static void majtitle_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
UINT16 *spriteram16_2 = state->spriteram2;
int offs;
@@ -513,7 +513,7 @@ static void majtitle_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
if (flipy) c += h-1-y;
else c += y;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
c,
color,
flipx,flipy,
@@ -525,10 +525,10 @@ static void majtitle_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( m72 )
{
- m72_state *state = screen->machine->driver_data<m72_state>();
+ m72_state *state = screen->machine().driver_data<m72_state>();
if (state->video_off)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
@@ -540,7 +540,7 @@ SCREEN_UPDATE( m72 )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER1,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,TILEMAP_DRAW_LAYER1,0);
- m72_draw_sprites(screen->machine, bitmap,cliprect);
+ m72_draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,TILEMAP_DRAW_LAYER0,0);
return 0;
@@ -548,13 +548,13 @@ SCREEN_UPDATE( m72 )
SCREEN_UPDATE( majtitle )
{
- m72_state *state = screen->machine->driver_data<m72_state>();
+ m72_state *state = screen->machine().driver_data<m72_state>();
int i;
if (state->video_off)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
@@ -577,8 +577,8 @@ SCREEN_UPDATE( majtitle )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER1,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,TILEMAP_DRAW_LAYER1,0);
- majtitle_draw_sprites(screen->machine, bitmap,cliprect);
- m72_draw_sprites(screen->machine, bitmap,cliprect);
+ majtitle_draw_sprites(screen->machine(), bitmap,cliprect);
+ m72_draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,TILEMAP_DRAW_LAYER0,0);
return 0;
diff --git a/src/mame/video/m90.c b/src/mame/video/m90.c
index c0366384c8c..4fada3efd83 100644
--- a/src/mame/video/m90.c
+++ b/src/mame/video/m90.c
@@ -30,9 +30,9 @@
#include "includes/m90.h"
-INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,int page_mask)
+INLINE void get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer,int page_mask)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
int tile,color;
tile_index = 2*tile_index + ((state->video_control_data[5+layer] & page_mask) * 0x2000);
@@ -46,9 +46,9 @@ INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_
tileinfo->category = (color & 0x30) ? 1 : 0;
}
-INLINE void bomblord_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer)
+INLINE void bomblord_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
int tile,color;
tile_index = 2*tile_index + (layer * 0x2000);
@@ -62,9 +62,9 @@ INLINE void bomblord_get_tile_info(running_machine *machine,tile_data *tileinfo,
tileinfo->category = (color & 0x30) ? 1 : 0;
}
-INLINE void dynablsb_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer)
+INLINE void dynablsb_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
int tile,color;
tile_index = 2*tile_index + (layer * 0x2000);
@@ -95,7 +95,7 @@ static TILE_GET_INFO( dynablsb_get_pf2w_tile_info ) { dynablsb_get_tile_info(mac
VIDEO_START( m90 )
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
state->pf1_layer = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows,8,8,64,64);
state->pf1_wide_layer = tilemap_create(machine, get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64);
state->pf2_layer = tilemap_create(machine, get_pf2_tile_info, tilemap_scan_rows,8,8,64,64);
@@ -109,7 +109,7 @@ VIDEO_START( m90 )
VIDEO_START( bomblord )
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
state->pf1_layer = tilemap_create(machine, bomblord_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64);
state->pf1_wide_layer = tilemap_create(machine, bomblord_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64);
state->pf2_layer = tilemap_create(machine, bomblord_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64);
@@ -125,7 +125,7 @@ VIDEO_START( bomblord )
VIDEO_START( dynablsb )
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
state->pf1_layer = tilemap_create(machine, dynablsb_get_pf1_tile_info, tilemap_scan_rows,8,8,64,64);
state->pf1_wide_layer = tilemap_create(machine, dynablsb_get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64);
state->pf2_layer = tilemap_create(machine, dynablsb_get_pf2_tile_info, tilemap_scan_rows,8,8,64,64);
@@ -137,9 +137,9 @@ VIDEO_START( dynablsb )
state_save_register_global_array(machine, state->video_control_data);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
UINT16 *spriteram = state->video_data + 0xee00/2;;
int offs;
@@ -165,35 +165,35 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (i = 0;i < y_multi;i++)
if (state->video_control_data[7] & 0x01)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + (fy ? y_multi-1 - i : i),
colour,
fx,fy,
x,y+i*16,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(colour & 0x08) ? 0x00 : 0x02,0);
else if (state->video_control_data[7] & 0x02)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + (fy ? y_multi-1 - i : i),
colour,
fx,fy,
x,y+i*16,
- machine->priority_bitmap,
+ machine.priority_bitmap,
((colour & 0x0c)==0x0c) ? 0x00 : 0x02,0);
else
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + (fy ? y_multi-1 - i : i),
colour,
fx,fy,
x,y+i*16,
- machine->priority_bitmap,
+ machine.priority_bitmap,
0x02,0);
}
}
-static void bomblord_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void bomblord_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
UINT16 *spriteram16 = state->spriteram;
int offs = 0, last_sprite = 0;
int x,y,sprite,colour,fx,fy;
@@ -221,19 +221,19 @@ static void bomblord_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
fx = (spriteram16[offs+3] >> 8) & 0x02;
fy = (spriteram16[offs+2] >> 8) & 0x80;
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
colour,
fx,fy,
x,y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(colour & 0x08) ? 0x00 : 0x02,0);
}
}
-static void dynablsb_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void dynablsb_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
UINT16 *spriteram16 = state->spriteram;
int offs = 0, last_sprite = 0;
int x,y,sprite,colour,fx,fy;
@@ -260,19 +260,19 @@ static void dynablsb_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
fx = (spriteram16[offs+3] >> 8) & 0x02;
fy = (spriteram16[offs+2] >> 8) & 0x80;
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
colour,
fx,fy,
x,y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(colour & 0x08) ? 0x00 : 0x02,0);
}
}
WRITE16_HANDLER( m90_video_control_w )
{
- m90_state *state = space->machine->driver_data<m90_state>();
+ m90_state *state = space->machine().driver_data<m90_state>();
COMBINE_DATA(&state->video_control_data[offset]);
}
@@ -286,7 +286,7 @@ static void markdirty(tilemap_t *tmap,int page,offs_t offset)
WRITE16_HANDLER( m90_video_w )
{
- m90_state *state = space->machine->driver_data<m90_state>();
+ m90_state *state = space->machine().driver_data<m90_state>();
COMBINE_DATA(&state->video_data[offset]);
markdirty(state->pf1_layer, state->video_control_data[5] & 0x3,offset);
@@ -297,7 +297,7 @@ WRITE16_HANDLER( m90_video_w )
SCREEN_UPDATE( m90 )
{
- m90_state *state = screen->machine->driver_data<m90_state>();
+ m90_state *state = screen->machine().driver_data<m90_state>();
int pf1_base = state->video_control_data[5] & 0x3;
int pf2_base = state->video_control_data[6] & 0x3;
int i,pf1_enable,pf2_enable, video_enable;
@@ -361,7 +361,7 @@ SCREEN_UPDATE( m90 )
tilemap_set_scrollx( state->pf2_wide_layer,0, state->video_control_data[3]+256-2 );
}
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (video_enable)
{
@@ -452,10 +452,10 @@ SCREEN_UPDATE( m90 )
}
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
} else {
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
}
return 0;
@@ -463,10 +463,10 @@ SCREEN_UPDATE( m90 )
SCREEN_UPDATE( bomblord )
{
- m90_state *state = screen->machine->driver_data<m90_state>();
+ m90_state *state = screen->machine().driver_data<m90_state>();
int i;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
/* Setup scrolling */
if (state->video_control_data[6]&0x20) {
@@ -509,16 +509,16 @@ SCREEN_UPDATE( bomblord )
tilemap_draw(bitmap,cliprect,state->pf1_layer,1,1);
}
- bomblord_draw_sprites(screen->machine,bitmap,cliprect);
+ bomblord_draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( dynablsb )
{
- m90_state *state = screen->machine->driver_data<m90_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ m90_state *state = screen->machine().driver_data<m90_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
if (!(state->video_data[0xf008/2] & 0x4000)) {
tilemap_mark_all_tiles_dirty(state->pf1_wide_layer);
@@ -552,7 +552,7 @@ SCREEN_UPDATE( dynablsb )
tilemap_draw(bitmap,cliprect,state->pf2_layer,1,1);
}
- dynablsb_draw_sprites(screen->machine,bitmap,cliprect);
+ dynablsb_draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index 352fe5ded0b..1c3c834b290 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -46,7 +46,7 @@
static TIMER_CALLBACK( spritebuffer_callback )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
state->sprite_buffer_busy = 1;
if (state->game_kludge!=2) /* Major Title 2 doesn't like this interrupt!? */
m92_sprite_interrupt(machine);
@@ -54,7 +54,7 @@ static TIMER_CALLBACK( spritebuffer_callback )
WRITE16_HANDLER( m92_spritecontrol_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->spritecontrol[offset]);
/* Sprite list size register - used in spriteroutine */
@@ -79,14 +79,14 @@ WRITE16_HANDLER( m92_spritecontrol_w )
/* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words
to copy from spriteram to the buffer. It seems safe to assume 1
word can be copied per clock.*/
- space->machine->scheduler().timer_set(attotime::from_hz(26666000) * 0x400, FUNC(spritebuffer_callback));
+ space->machine().scheduler().timer_set(attotime::from_hz(26666000) * 0x400, FUNC(spritebuffer_callback));
}
// logerror("%04x: m92_spritecontrol_w %08x %08x\n",cpu_get_pc(space->cpu),offset,data);
}
WRITE16_HANDLER( m92_videocontrol_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
/*
Many games write:
0x2000
@@ -110,13 +110,13 @@ WRITE16_HANDLER( m92_videocontrol_w )
READ16_HANDLER( m92_paletteram_r )
{
- m92_state *state = space->machine->driver_data<m92_state>();
- return space->machine->generic.paletteram.u16[offset + 0x400 * state->palette_bank];
+ m92_state *state = space->machine().driver_data<m92_state>();
+ return space->machine().generic.paletteram.u16[offset + 0x400 * state->palette_bank];
}
WRITE16_HANDLER( m92_paletteram_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset + 0x400 * state->palette_bank, data, mem_mask);
}
@@ -124,7 +124,7 @@ WRITE16_HANDLER( m92_paletteram_w )
static TILE_GET_INFO( get_pf_tile_info )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
pf_layer_info *layer = (pf_layer_info *)param;
int tile, attrib;
tile_index = 2 * tile_index + layer->vram_base;
@@ -146,7 +146,7 @@ static TILE_GET_INFO( get_pf_tile_info )
WRITE16_HANDLER( m92_vram_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
int laynum;
COMBINE_DATA(&state->vram_data[offset]);
@@ -167,25 +167,25 @@ WRITE16_HANDLER( m92_vram_w )
WRITE16_HANDLER( m92_pf1_control_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->pf_layer[0].control[offset]);
}
WRITE16_HANDLER( m92_pf2_control_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->pf_layer[1].control[offset]);
}
WRITE16_HANDLER( m92_pf3_control_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->pf_layer[2].control[offset]);
}
WRITE16_HANDLER( m92_master_control_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
UINT16 old = state->pf_master_control[offset];
pf_layer_info *layer;
@@ -231,7 +231,7 @@ WRITE16_HANDLER( m92_master_control_w )
VIDEO_START( m92 )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
int laynum;
memset(&state->pf_layer, 0, sizeof(state->pf_layer));
@@ -269,10 +269,10 @@ VIDEO_START( m92 )
state_save_register_item_array(machine, "layer", NULL, laynum, layer->control);
}
- machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2);
+ machine.generic.paletteram.u16 = auto_alloc_array(machine, UINT16, 0x1000/2);
- memset(machine->generic.spriteram.u16,0,0x800);
- memset(machine->generic.buffered_spriteram.u16,0,0x800);
+ memset(machine.generic.spriteram.u16,0,0x800);
+ memset(machine.generic.buffered_spriteram.u16,0,0x800);
state->save_item(NAME(state->pf_master_control));
@@ -281,15 +281,15 @@ VIDEO_START( m92 )
state->save_item(NAME(state->sprite_buffer_busy));
state->save_item(NAME(state->palette_bank));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u16, 0x1000);
}
/*****************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- m92_state *state = machine->driver_data<m92_state>();
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ m92_state *state = machine.driver_data<m92_state>();
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
int offs,k;
for (k=0; k<8; k++)
@@ -332,35 +332,35 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (i=0; i<y_multi; i++)
{
if (flip_screen_get(machine)) {
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
!fx,!fy,
464-x,240-(y-i*16),
- machine->priority_bitmap,pri_back,0);
+ machine.priority_bitmap,pri_back,0);
// wrap around x
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
!fx,!fy,
464-x+512,240-(y-i*16),
- machine->priority_bitmap,pri_back,0);
+ machine.priority_bitmap,pri_back,0);
} else {
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
fx,fy,
x,y-i*16,
- machine->priority_bitmap,pri_back,0);
+ machine.priority_bitmap,pri_back,0);
// wrap around x
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite + s_ptr,
colour,
fx,fy,
x-512,y-i*16,
- machine->priority_bitmap,pri_back,0);
+ machine.priority_bitmap,pri_back,0);
}
if (fy) s_ptr++; else s_ptr--;
}
@@ -373,9 +373,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/*****************************************************************************/
-static void m92_update_scroll_positions(running_machine *machine)
+static void m92_update_scroll_positions(running_machine &machine)
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
int laynum;
int i;
@@ -421,10 +421,10 @@ static void m92_update_scroll_positions(running_machine *machine)
/*****************************************************************************/
-static void m92_screenrefresh(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void m92_screenrefresh(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- m92_state *state = machine->driver_data<m92_state>();
- bitmap_fill(machine->priority_bitmap, cliprect, 0);
+ m92_state *state = machine.driver_data<m92_state>();
+ bitmap_fill(machine.priority_bitmap, cliprect, 0);
if ((~state->pf_master_control[2] >> 4) & 1)
{
@@ -452,13 +452,13 @@ static void m92_screenrefresh(running_machine *machine, bitmap_t *bitmap,const r
SCREEN_UPDATE( m92 )
{
- m92_update_scroll_positions(screen->machine);
- m92_screenrefresh(screen->machine, bitmap, cliprect);
+ m92_update_scroll_positions(screen->machine());
+ m92_screenrefresh(screen->machine(), bitmap, cliprect);
/* Flipscreen appears hardwired to the dipswitch - strange */
- if (input_port_read(screen->machine, "DSW") & 0x100)
- flip_screen_set(screen->machine, 0);
+ if (input_port_read(screen->machine(), "DSW") & 0x100)
+ flip_screen_set(screen->machine(), 0);
else
- flip_screen_set(screen->machine, 1);
+ flip_screen_set(screen->machine(), 1);
return 0;
}
diff --git a/src/mame/video/macrossp.c b/src/mame/video/macrossp.c
index f5cedb10c21..afbfad583bb 100644
--- a/src/mame/video/macrossp.c
+++ b/src/mame/video/macrossp.c
@@ -8,7 +8,7 @@
WRITE32_HANDLER( macrossp_scra_videoram_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->scra_videoram[offset]);
@@ -18,7 +18,7 @@ WRITE32_HANDLER( macrossp_scra_videoram_w )
static TILE_GET_INFO( get_macrossp_scra_tile_info )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
UINT32 attr, tileno, color;
attr = state->scra_videoram[tile_index];
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_macrossp_scra_tile_info )
break;
default:
- color = machine->rand() & 7;
+ color = machine.rand() & 7;
break;
}
@@ -46,7 +46,7 @@ static TILE_GET_INFO( get_macrossp_scra_tile_info )
WRITE32_HANDLER( macrossp_scrb_videoram_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->scrb_videoram[offset]);
@@ -56,7 +56,7 @@ WRITE32_HANDLER( macrossp_scrb_videoram_w )
static TILE_GET_INFO( get_macrossp_scrb_tile_info )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
UINT32 attr, tileno, color;
attr = state->scrb_videoram[tile_index];
@@ -73,7 +73,7 @@ static TILE_GET_INFO( get_macrossp_scrb_tile_info )
break;
default:
- color = machine->rand() & 7;
+ color = machine.rand() & 7;
break;
}
@@ -84,7 +84,7 @@ static TILE_GET_INFO( get_macrossp_scrb_tile_info )
WRITE32_HANDLER( macrossp_scrc_videoram_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->scrc_videoram[offset]);
@@ -94,7 +94,7 @@ WRITE32_HANDLER( macrossp_scrc_videoram_w )
static TILE_GET_INFO( get_macrossp_scrc_tile_info )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
UINT32 attr, tileno, color;
attr = state->scrc_videoram[tile_index];
@@ -111,7 +111,7 @@ static TILE_GET_INFO( get_macrossp_scrc_tile_info )
break;
default:
- color = machine->rand() & 7;
+ color = machine.rand() & 7;
break;
}
@@ -122,7 +122,7 @@ static TILE_GET_INFO( get_macrossp_scrc_tile_info )
WRITE32_HANDLER( macrossp_text_videoram_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->text_videoram[offset]);
@@ -132,7 +132,7 @@ WRITE32_HANDLER( macrossp_text_videoram_w )
static TILE_GET_INFO( get_macrossp_text_tile_info )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
UINT32 tileno, colour;
tileno = state->text_videoram[tile_index] & 0x0000ffff;
@@ -147,7 +147,7 @@ static TILE_GET_INFO( get_macrossp_text_tile_info )
VIDEO_START( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
state->spriteram_old = auto_alloc_array_clear(machine, UINT32, state->spriteram_size / 4);
state->spriteram_old2 = auto_alloc_array_clear(machine, UINT32, state->spriteram_size / 4);
@@ -162,10 +162,10 @@ VIDEO_START( macrossp )
tilemap_set_transparent_pen(state->scrb_tilemap, 0);
tilemap_set_transparent_pen(state->scrc_tilemap, 0);
- machine->gfx[0]->color_granularity = 64;
- machine->gfx[1]->color_granularity = 64;
- machine->gfx[2]->color_granularity = 64;
- machine->gfx[3]->color_granularity = 64;
+ machine.gfx[0]->color_granularity = 64;
+ machine.gfx[1]->color_granularity = 64;
+ machine.gfx[2]->color_granularity = 64;
+ machine.gfx[3]->color_granularity = 64;
state->save_pointer(NAME(state->spriteram_old), state->spriteram_size / 4);
state->save_pointer(NAME(state->spriteram_old2), state->spriteram_size / 4);
@@ -173,10 +173,10 @@ VIDEO_START( macrossp )
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
- const gfx_element *gfx = machine->gfx[0];
+ macrossp_state *state = machine.driver_data<macrossp_state>();
+ const gfx_element *gfx = machine.gfx[0];
// UINT32 *source = state->spriteram;
UINT32 *source = state->spriteram_old2; /* buffers by two frames */
UINT32 *finish = source + state->spriteram_size / 4;
@@ -232,7 +232,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
break;
default:
- col = machine->rand();
+ col = machine.rand();
break;
}
@@ -320,9 +320,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
tilemap_t *tm;
UINT32 *vr;
@@ -389,10 +389,10 @@ static void sortlayers(int *layer,int *pri)
SCREEN_UPDATE( macrossp )
{
- macrossp_state *state = screen->machine->driver_data<macrossp_state>();
+ macrossp_state *state = screen->machine().driver_data<macrossp_state>();
int layers[3],layerpri[3];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
layers[0] = 0;
layerpri[0] = (state->scra_videoregs[0] & 0x0000c000) >> 14;
@@ -403,13 +403,13 @@ SCREEN_UPDATE( macrossp )
sortlayers(layers, layerpri);
- draw_layer(screen->machine, bitmap, cliprect, layers[0]);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- draw_layer(screen->machine, bitmap, cliprect, layers[1]);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
- draw_layer(screen->machine, bitmap, cliprect, layers[2]);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_layer(screen->machine(), bitmap, cliprect, layers[0]);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ draw_layer(screen->machine(), bitmap, cliprect, layers[1]);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
+ draw_layer(screen->machine(), bitmap, cliprect, layers[2]);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
#if 0
@@ -431,7 +431,7 @@ state->scrc_videoregs[2]);// 08 - 0b
SCREEN_EOF( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
/* looks like sprites are *two* frames ahead, like nmk16 */
memcpy(state->spriteram_old2, state->spriteram_old, state->spriteram_size);
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c
index 292d4272c92..a4dcd19e293 100644
--- a/src/mame/video/madalien.c
+++ b/src/mame/video/madalien.c
@@ -19,7 +19,7 @@ static PALETTE_INIT( madalien )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
for (i = 0; i < 0x20; i++)
{
@@ -40,11 +40,11 @@ static PALETTE_INIT( madalien )
if (BIT(color_prom[i], 5))
b += 0xc0;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
for (i = 0x10; i < 0x20; i++)
{
@@ -56,11 +56,11 @@ static PALETTE_INIT( madalien )
if (BIT((i - 0x10), 2))
ctabentry = ctabentry ^ 0x06;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
for (i = 0x20; i < 0x30; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x20) | 0x10);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x20) | 0x10);
}
@@ -90,8 +90,8 @@ static TILEMAP_MAPPER( scan_mode3 )
static TILE_GET_INFO( get_tile_info_BG_1 )
{
- madalien_state *state = machine->driver_data<madalien_state>();
- UINT8 *map = machine->region("user1")->base() + ((*state->video_flags & 0x08) << 6);
+ madalien_state *state = machine.driver_data<madalien_state>();
+ UINT8 *map = machine.region("user1")->base() + ((*state->video_flags & 0x08) << 6);
SET_TILE_INFO(1, map[tile_index], BIT(*state->video_flags, 2) ? 2 : 0, 0);
}
@@ -99,8 +99,8 @@ static TILE_GET_INFO( get_tile_info_BG_1 )
static TILE_GET_INFO( get_tile_info_BG_2 )
{
- madalien_state *state = machine->driver_data<madalien_state>();
- UINT8 *map = machine->region("user1")->base() + ((*state->video_flags & 0x08) << 6) + 0x80;
+ madalien_state *state = machine.driver_data<madalien_state>();
+ UINT8 *map = machine.region("user1")->base() + ((*state->video_flags & 0x08) << 6) + 0x80;
SET_TILE_INFO(1, map[tile_index], BIT(*state->video_flags, 2) ? 2 : 0, 0);
}
@@ -108,13 +108,13 @@ static TILE_GET_INFO( get_tile_info_BG_2 )
static TILE_GET_INFO( get_tile_info_FG )
{
- madalien_state *state = machine->driver_data<madalien_state>();
+ madalien_state *state = machine.driver_data<madalien_state>();
SET_TILE_INFO(0, state->videoram[tile_index], 0, 0);
}
WRITE8_HANDLER( madalien_videoram_w )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
+ madalien_state *state = space->machine().driver_data<madalien_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_fg, offset);
}
@@ -122,7 +122,7 @@ WRITE8_HANDLER( madalien_videoram_w )
static VIDEO_START( madalien )
{
- madalien_state *state = machine->driver_data<madalien_state>();
+ madalien_state *state = machine.driver_data<madalien_state>();
int i;
static const tilemap_mapper_func scan_functions[4] =
@@ -148,21 +148,21 @@ static VIDEO_START( madalien )
state->tilemap_edge2[i] = tilemap_create(machine, get_tile_info_BG_2, scan_functions[i], 16, 16, tilemap_cols[i], 8);
tilemap_set_scrolldx(state->tilemap_edge2[i], 0, 0x50);
- tilemap_set_scrolldy(state->tilemap_edge2[i], 0, machine->primary_screen->height() - 256);
+ tilemap_set_scrolldy(state->tilemap_edge2[i], 0, machine.primary_screen->height() - 256);
}
state->headlight_bitmap = auto_bitmap_alloc(machine, 128, 128, BITMAP_FORMAT_INDEXED16);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
- drawgfx_opaque(state->headlight_bitmap, NULL, machine->gfx[2], 0, 0, 0, 0, 0x00, 0x00);
- drawgfx_opaque(state->headlight_bitmap, NULL, machine->gfx[2], 0, 0, 0, 1, 0x00, 0x40);
+ drawgfx_opaque(state->headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00);
+ drawgfx_opaque(state->headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40);
}
-static void draw_edges(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
+static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
{
- madalien_state *state = machine->driver_data<madalien_state>();
+ madalien_state *state = machine.driver_data<madalien_state>();
rectangle clip_edge1;
rectangle clip_edge2;
@@ -199,9 +199,9 @@ static void draw_edges(running_machine *machine, bitmap_t *bitmap, const rectang
}
-static void draw_headlight(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- madalien_state *state = machine->driver_data<madalien_state>();
+ madalien_state *state = machine.driver_data<madalien_state>();
if (BIT(*state->video_flags, 0))
{
UINT8 y;
@@ -235,9 +235,9 @@ static void draw_headlight(running_machine *machine, bitmap_t *bitmap, const rec
}
-static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- madalien_state *state = machine->driver_data<madalien_state>();
+ madalien_state *state = machine.driver_data<madalien_state>();
tilemap_set_flip(state->tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_draw(bitmap, cliprect, state->tilemap_fg, 0, 0);
}
@@ -245,16 +245,16 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
WRITE8_HANDLER( madalien_charram_w )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
+ madalien_state *state = space->machine().driver_data<madalien_state>();
state->charram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], (offset/8) & 0xff);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset/8) & 0xff);
}
static SCREEN_UPDATE( madalien )
{
- madalien_state *state = screen->machine->driver_data<madalien_state>();
- int flip = BIT(input_port_read(screen->machine, "DSW"), 6) && BIT(*state->video_control, 0);
+ madalien_state *state = screen->machine().driver_data<madalien_state>();
+ int flip = BIT(input_port_read(screen->machine(), "DSW"), 6) && BIT(*state->video_control, 0);
// bits #0 and #1 define scrolling mode
//
@@ -266,8 +266,8 @@ static SCREEN_UPDATE( madalien )
int scroll_mode = *state->scroll & 3;
bitmap_fill(bitmap, cliprect, 0);
- draw_edges(screen->machine, bitmap, cliprect, flip, scroll_mode);
- draw_foreground(screen->machine, bitmap, cliprect, flip);
+ draw_edges(screen->machine(), bitmap, cliprect, flip, scroll_mode);
+ draw_foreground(screen->machine(), bitmap, cliprect, flip);
/* highlight section A (outside of tunnels).
* also, bit 1 of the video_flags register (6A) is
@@ -301,7 +301,7 @@ static SCREEN_UPDATE( madalien )
*BITMAP_ADDR16(bitmap, y, x) |= 8;
}
- draw_headlight(screen->machine, bitmap, cliprect, flip);
+ draw_headlight(screen->machine(), bitmap, cliprect, flip);
return 0;
}
diff --git a/src/mame/video/madmotor.c b/src/mame/video/madmotor.c
index be7cd2c4cac..c1b9889d2bb 100644
--- a/src/mame/video/madmotor.c
+++ b/src/mame/video/madmotor.c
@@ -24,14 +24,14 @@ VIDEO_START( madmotor )
SCREEN_UPDATE( madmotor )
{
- madmotor_state *state = screen->machine->driver_data<madmotor_state>();
- flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
+ madmotor_state *state = screen->machine().driver_data<madmotor_state>();
+ flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
-// tilemap_set_flip_all(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+// tilemap_set_flip_all(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- screen->machine->device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x00, 0x00, 0x0f);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
return 0;
}
diff --git a/src/mame/video/magmax.c b/src/mame/video/magmax.c
index 14cb3f15f4d..50bcbee71fc 100644
--- a/src/mame/video/magmax.c
+++ b/src/mame/video/magmax.c
@@ -29,7 +29,7 @@ PALETTE_INIT( magmax )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -38,7 +38,7 @@ PALETTE_INIT( magmax )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -46,26 +46,26 @@ PALETTE_INIT( magmax )
/* characters use colors 0-0x0f */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/*sprites use colors 0x10-0x1f, color 0x1f being transparent*/
for (i = 0x10; i < 0x110; i++)
{
UINT8 ctabentry = (color_prom[i - 0x10] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* background uses all colors (no lookup table) */
for (i = 0x110; i < 0x210; i++)
- colortable_entry_set_value(machine->colortable, i, i - 0x110);
+ colortable_entry_set_value(machine.colortable, i, i - 0x110);
}
VIDEO_START( magmax )
{
- magmax_state *state = machine->driver_data<magmax_state>();
+ magmax_state *state = machine.driver_data<magmax_state>();
int i,v;
- UINT8 * prom14D = machine->region("user2")->base();
+ UINT8 * prom14D = machine.region("user2")->base();
/* Set up save state */
state_save_register_global(machine, state->flipscreen);
@@ -73,7 +73,7 @@ VIDEO_START( magmax )
state->prom_tab = auto_alloc_array(machine, UINT32, 256);
/* Allocate temporary bitmap */
- machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ machine.generic.tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
for (i=0; i<256; i++)
{
@@ -86,7 +86,7 @@ VIDEO_START( magmax )
SCREEN_UPDATE( magmax )
{
- magmax_state *state = screen->machine->driver_data<magmax_state>();
+ magmax_state *state = screen->machine().driver_data<magmax_state>();
UINT16 *videoram = state->videoram;
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -100,12 +100,12 @@ SCREEN_UPDATE( magmax )
else
{
int v;
- UINT8 * rom18B = screen->machine->region("user1")->base();
+ UINT8 * rom18B = screen->machine().region("user1")->base();
UINT32 scroll_h = (*state->scroll_x) & 0x3fff;
UINT32 scroll_v = (*state->scroll_y) & 0xff;
/*clear background-over-sprites bitmap*/
- bitmap_fill(screen->machine->generic.tmpbitmap, NULL, 0);
+ bitmap_fill(screen->machine().generic.tmpbitmap, NULL, 0);
for (v = 2*8; v < 30*8; v++) /*only for visible area*/
{
@@ -156,7 +156,7 @@ SCREEN_UPDATE( magmax )
/*priority: background over sprites*/
if (map_v_scr_100 && ((graph_data & 0x0c)==0x0c))
- *BITMAP_ADDR16(screen->machine->generic.tmpbitmap, v, h) = line_data[h];
+ *BITMAP_ADDR16(screen->machine().generic.tmpbitmap, v, h) = line_data[h];
}
if (state->flipscreen)
@@ -201,17 +201,17 @@ SCREEN_UPDATE( magmax )
if (code & 0x80) /* sprite bankswitch */
code += (*state->vreg & 0x30) * 0x8;
- drawgfx_transmask(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transmask(bitmap, cliprect, screen->machine().gfx[1],
code,
color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 0x1f));
}
}
if (!(*state->vreg & 0x40)) /* background disable */
- copybitmap_trans(bitmap, screen->machine->generic.tmpbitmap, state->flipscreen,state->flipscreen,0,0, cliprect, 0);
+ copybitmap_trans(bitmap, screen->machine().generic.tmpbitmap, state->flipscreen,state->flipscreen,0,0, cliprect, 0);
/* draw the foreground characters */
for (offs = 32*32-1; offs >= 0; offs -= 1)
@@ -231,7 +231,7 @@ SCREEN_UPDATE( magmax )
sy = 31 - sy;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
code,
0,
state->flipscreen, state->flipscreen,
diff --git a/src/mame/video/mainevt.c b/src/mame/video/mainevt.c
index 5cb53dc8b7a..a9789956f9e 100644
--- a/src/mame/video/mainevt.c
+++ b/src/mame/video/mainevt.c
@@ -17,9 +17,9 @@
***************************************************************************/
-void mainevt_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void mainevt_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
*flags = (*color & 0x02) ? TILE_FLIPX : 0;
@@ -29,9 +29,9 @@ void mainevt_tile_callback( running_machine *machine, int layer, int bank, int *
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
-void dv_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void dv_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x01) << 8) | ((*color & 0x3c) << 7);
@@ -45,9 +45,9 @@ void dv_tile_callback( running_machine *machine, int layer, int bank, int *code,
***************************************************************************/
-void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int *priority_mask,int *shadow)
+void mainevt_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask,int *shadow)
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
/* bit 5 = priority over layer B (has precedence) */
/* bit 6 = HALF priority over layer B (used for crowd when you get out of the ring) */
@@ -62,9 +62,9 @@ void mainevt_sprite_callback(running_machine *machine, int *code,int *color,int
*color = state->sprite_colorbase + (*color & 0x03);
}
-void dv_sprite_callback(running_machine *machine, int *code,int *color,int *priority,int *shadow)
+void dv_sprite_callback(running_machine &machine, int *code,int *color,int *priority,int *shadow)
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
/* TODO: the priority/shadow handling (bits 5-7) seems to be quite complex (see PROM) */
*color = state->sprite_colorbase + (*color & 0x07);
@@ -75,7 +75,7 @@ void dv_sprite_callback(running_machine *machine, int *code,int *color,int *prio
VIDEO_START( mainevt )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 8;
state->layer_colorbase[2] = 4;
@@ -84,7 +84,7 @@ VIDEO_START( mainevt )
VIDEO_START( dv )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 0;
state->layer_colorbase[2] = 4;
@@ -95,11 +95,11 @@ VIDEO_START( dv )
SCREEN_UPDATE( mainevt )
{
- mainevt_state *state = screen->machine->driver_data<mainevt_state>();
+ mainevt_state *state = screen->machine().driver_data<mainevt_state>();
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 2, 1, 2); /* low priority part of layer */
k052109_tilemap_draw(state->k052109, bitmap, cliprect, 2, 0, 4); /* high priority part of layer */
@@ -111,7 +111,7 @@ SCREEN_UPDATE( mainevt )
SCREEN_UPDATE( dv )
{
- mainevt_state *state = screen->machine->driver_data<mainevt_state>();
+ mainevt_state *state = screen->machine().driver_data<mainevt_state>();
k052109_tilemap_update(state->k052109);
diff --git a/src/mame/video/mainsnk.c b/src/mame/video/mainsnk.c
index c140be2efcf..527443e8470 100644
--- a/src/mame/video/mainsnk.c
+++ b/src/mame/video/mainsnk.c
@@ -46,7 +46,7 @@ static TILEMAP_MAPPER( marvins_tx_scan_cols )
static TILE_GET_INFO( get_tx_tile_info )
{
- mainsnk_state *state = machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = machine.driver_data<mainsnk_state>();
int code = state->fgram[tile_index];
SET_TILE_INFO(0,
@@ -57,7 +57,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- mainsnk_state *state = machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = machine.driver_data<mainsnk_state>();
int code = (state->bgram[tile_index]);
SET_TILE_INFO(
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START(mainsnk)
{
- mainsnk_state *state = machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = machine.driver_data<mainsnk_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -85,11 +85,11 @@ VIDEO_START(mainsnk)
WRITE8_HANDLER(mainsnk_c600_w)
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
int bank;
- int total_elements = space->machine->gfx[0]->total_elements;
+ int total_elements = space->machine().gfx[0]->total_elements;
- flip_screen_set(space->machine, ~data & 0x80);
+ flip_screen_set(space->machine(), ~data & 0x80);
tilemap_set_palette_offset(state->bg_tilemap, (data & 0x07) << 4);
tilemap_set_palette_offset(state->tx_tilemap, (data & 0x07) << 4);
@@ -109,7 +109,7 @@ WRITE8_HANDLER(mainsnk_c600_w)
WRITE8_HANDLER( mainsnk_fgram_w )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -117,7 +117,7 @@ WRITE8_HANDLER( mainsnk_fgram_w )
WRITE8_HANDLER( mainsnk_bgram_w )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -125,10 +125,10 @@ WRITE8_HANDLER( mainsnk_bgram_w )
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
{
- mainsnk_state *state = machine->driver_data<mainsnk_state>();
- const gfx_element *gfx = machine->gfx[1];
+ mainsnk_state *state = machine.driver_data<mainsnk_state>();
+ const gfx_element *gfx = machine.gfx[1];
const UINT8 *source, *finish;
source = state->spriteram;
finish = source + 25*4;
@@ -170,10 +170,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE(mainsnk)
{
- mainsnk_state *state = screen->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = screen->machine().driver_data<mainsnk_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, 0);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/malzak.c b/src/mame/video/malzak.c
index 2dbb6c7b5cf..6d459eb59be 100644
--- a/src/mame/video/malzak.c
+++ b/src/mame/video/malzak.c
@@ -20,7 +20,7 @@
SCREEN_UPDATE( malzak )
{
- malzak_state *state = screen->machine->driver_data<malzak_state>();
+ malzak_state *state = screen->machine().driver_data<malzak_state>();
int sx, sy;
int x,y;
bitmap_t *s2636_0_bitmap;
@@ -43,7 +43,7 @@ SCREEN_UPDATE( malzak )
if (sx < -15*2)
sx += 256*2;
- drawgfxzoom_transpen(bitmap,cliprect, screen->machine->gfx[0], state->playfield_code[x * 16 + y], 7*2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
+ drawgfxzoom_transpen(bitmap,cliprect, screen->machine().gfx[0], state->playfield_code[x * 16 + y], 7*2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
}
/* update the S2636 chips */
@@ -85,7 +85,7 @@ SCREEN_UPDATE( malzak )
WRITE8_HANDLER( malzak_playfield_w )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
int tile = ((state->malzak_x / 16) * 16) + (offset / 16);
// state->playfield_x[tile] = state->malzak_x / 16;
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c
index 2e8369d0a21..ecc988dde30 100644
--- a/src/mame/video/mappy.c
+++ b/src/mame/video/mappy.c
@@ -43,7 +43,7 @@ PALETTE_INIT( superpac )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( superpac )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,14 +78,14 @@ PALETTE_INIT( superpac )
for (i = 0; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, (ctabentry ^ 15) + 0x10);
+ colortable_entry_set_value(machine.colortable, i, (ctabentry ^ 15) + 0x10);
}
/* sprites map to the lower 16 palette entries */
for (i = 64*4; i < 128*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -102,7 +102,7 @@ PALETTE_INIT( mappy )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -127,7 +127,7 @@ PALETTE_INIT( mappy )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -137,14 +137,14 @@ PALETTE_INIT( mappy )
for (i = 0*4; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
}
/* sprites map to the lower 16 palette entries */
- for (i = 64*4; i < machine->total_colors(); i++)
+ for (i = 64*4; i < machine.total_colors(); i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -173,7 +173,7 @@ PALETTE_INIT( phozon )
4, &resistances[0], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -202,7 +202,7 @@ PALETTE_INIT( phozon )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -212,14 +212,14 @@ PALETTE_INIT( phozon )
for (i = 0; i < 64*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites map to the upper 16 palette entries */
for (i = 64*4; i < 128*4; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry + 0x10);
+ colortable_entry_set_value(machine.colortable, i, ctabentry + 0x10);
}
}
@@ -270,7 +270,7 @@ static TILEMAP_MAPPER( mappy_tilemap_scan )
static TILE_GET_INFO( superpac_get_tile_info )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
UINT8 attr = state->videoram[tile_index + 0x400];
tileinfo->category = (attr & 0x40) >> 6;
@@ -284,7 +284,7 @@ static TILE_GET_INFO( superpac_get_tile_info )
static TILE_GET_INFO( phozon_get_tile_info )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
UINT8 attr = state->videoram[tile_index + 0x400];
tileinfo->category = (attr & 0x40) >> 6;
@@ -298,7 +298,7 @@ static TILE_GET_INFO( phozon_get_tile_info )
static TILE_GET_INFO( mappy_get_tile_info )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
UINT8 attr = state->videoram[tile_index + 0x800];
tileinfo->category = (attr & 0x40) >> 6;
@@ -320,32 +320,32 @@ static TILE_GET_INFO( mappy_get_tile_info )
VIDEO_START( superpac )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
state->bg_tilemap = tilemap_create(machine, superpac_get_tile_info,superpac_tilemap_scan,8,8,36,28);
- state->sprite_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->sprite_bitmap = machine.primary_screen->alloc_compatible_bitmap();
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 31);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 31);
}
VIDEO_START( phozon )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
state->bg_tilemap = tilemap_create(machine, phozon_get_tile_info,superpac_tilemap_scan,8,8,36,28);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 15);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 15);
state->save_item(NAME(state->scroll));
}
VIDEO_START( mappy )
{
- mappy_state *state = machine->driver_data<mappy_state>();
+ mappy_state *state = machine.driver_data<mappy_state>();
state->bg_tilemap = tilemap_create(machine, mappy_get_tile_info,mappy_tilemap_scan,8,8,36,60);
- colortable_configure_tilemap_groups(machine->colortable, state->bg_tilemap, machine->gfx[0], 31);
+ colortable_configure_tilemap_groups(machine.colortable, state->bg_tilemap, machine.gfx[0], 31);
tilemap_set_scroll_cols(state->bg_tilemap, 36);
}
@@ -359,7 +359,7 @@ VIDEO_START( mappy )
WRITE8_HANDLER( superpac_videoram_w )
{
- mappy_state *state = space->machine->driver_data<mappy_state>();
+ mappy_state *state = space->machine().driver_data<mappy_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
@@ -367,7 +367,7 @@ WRITE8_HANDLER( superpac_videoram_w )
WRITE8_HANDLER( mappy_videoram_w )
{
- mappy_state *state = space->machine->driver_data<mappy_state>();
+ mappy_state *state = space->machine().driver_data<mappy_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
@@ -375,18 +375,18 @@ WRITE8_HANDLER( mappy_videoram_w )
WRITE8_HANDLER( superpac_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
READ8_HANDLER( superpac_flipscreen_r )
{
- flip_screen_set(space->machine, 1);
+ flip_screen_set(space->machine(), 1);
return 0xff;
}
WRITE8_HANDLER( mappy_scroll_w )
{
- mappy_state *state = space->machine->driver_data<mappy_state>();
+ mappy_state *state = space->machine().driver_data<mappy_state>();
state->scroll = offset >> 3;
}
@@ -399,7 +399,7 @@ WRITE8_HANDLER( mappy_scroll_w )
***************************************************************************/
-static void mappy_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
+static void mappy_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
{
UINT8 *spriteram = spriteram_base + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
@@ -444,12 +444,12 @@ static void mappy_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 15));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 15));
}
}
}
@@ -478,7 +478,7 @@ spriteram_3
1 -------x X position MSB
*/
-static void phozon_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
+static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
{
UINT8 *spriteram = spriteram_base + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
@@ -522,12 +522,12 @@ static void phozon_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 8*x,sy + 8*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 31));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 31));
}
}
}
@@ -537,7 +537,7 @@ static void phozon_draw_sprites(running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( superpac )
{
- mappy_state *state = screen->machine->driver_data<mappy_state>();
+ mappy_state *state = screen->machine().driver_data<mappy_state>();
bitmap_t *sprite_bitmap = state->sprite_bitmap;
int x,y;
@@ -547,7 +547,7 @@ SCREEN_UPDATE( superpac )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
bitmap_fill(sprite_bitmap,cliprect,15);
- mappy_draw_sprites(screen->machine,sprite_bitmap,cliprect,state->spriteram);
+ mappy_draw_sprites(screen->machine(),sprite_bitmap,cliprect,state->spriteram);
copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15);
/* Redraw the high priority characters */
@@ -559,7 +559,7 @@ SCREEN_UPDATE( superpac )
for (x = 0;x < sprite_bitmap->width;x++)
{
int spr_entry = *BITMAP_ADDR16(sprite_bitmap, y, x);
- int spr_pen = colortable_entry_get_value(screen->machine->colortable, spr_entry);
+ int spr_pen = colortable_entry_get_value(screen->machine().colortable, spr_entry);
if (spr_pen == 0 || spr_pen == 1)
*BITMAP_ADDR16(bitmap, y, x) = spr_entry;
}
@@ -569,17 +569,17 @@ SCREEN_UPDATE( superpac )
SCREEN_UPDATE( phozon )
{
- mappy_state *state = screen->machine->driver_data<mappy_state>();
+ mappy_state *state = screen->machine().driver_data<mappy_state>();
/* flip screen control is embedded in RAM */
- flip_screen_set(screen->machine, state->spriteram[0x1f7f-0x800] & 1);
+ flip_screen_set(screen->machine(), state->spriteram[0x1f7f-0x800] & 1);
tilemap_set_scrolldx(state->bg_tilemap, 0, 96);
tilemap_set_scrolldy(state->bg_tilemap, 0, 0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
- phozon_draw_sprites(screen->machine,bitmap,cliprect,state->spriteram);
+ phozon_draw_sprites(screen->machine(),bitmap,cliprect,state->spriteram);
/* Redraw the high priority characters */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,1,0);
@@ -588,7 +588,7 @@ SCREEN_UPDATE( phozon )
SCREEN_UPDATE( mappy )
{
- mappy_state *state = screen->machine->driver_data<mappy_state>();
+ mappy_state *state = screen->machine().driver_data<mappy_state>();
int offs;
tilemap_set_scrolldx(state->bg_tilemap, 0, 96);
@@ -599,7 +599,7 @@ SCREEN_UPDATE( mappy )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
- mappy_draw_sprites(screen->machine,bitmap,cliprect,state->spriteram);
+ mappy_draw_sprites(screen->machine(),bitmap,cliprect,state->spriteram);
/* Redraw the high priority characters */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,1,0);
diff --git a/src/mame/video/marineb.c b/src/mame/video/marineb.c
index df04877ddb9..3829ad3f83a 100644
--- a/src/mame/video/marineb.c
+++ b/src/mame/video/marineb.c
@@ -14,7 +14,7 @@ PALETTE_INIT( marineb )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -25,13 +25,13 @@ PALETTE_INIT( marineb )
r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* green component */
bit0 = (color_prom[i] >> 3) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
/* blue component */
bit0 = 0;
- bit1 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
palette_set_color(machine, i, MAKE_RGB(r,g,b));
@@ -46,7 +46,7 @@ PALETTE_INIT( marineb )
static TILE_GET_INFO( get_tile_info )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
UINT8 code = state->videoram[tile_index];
UINT8 col = state->colorram[tile_index];
@@ -67,7 +67,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( marineb )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
@@ -88,7 +88,7 @@ VIDEO_START( marineb )
WRITE8_HANDLER( marineb_videoram_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -97,7 +97,7 @@ WRITE8_HANDLER( marineb_videoram_w )
WRITE8_HANDLER( marineb_colorram_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -106,14 +106,14 @@ WRITE8_HANDLER( marineb_colorram_w )
WRITE8_HANDLER( marineb_column_scroll_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
state->column_scroll = data;
}
WRITE8_HANDLER( marineb_palette_bank_0_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
UINT8 old = state->palette_bank;
state->palette_bank = (state->palette_bank & 0x02) | (data & 0x01);
@@ -127,7 +127,7 @@ WRITE8_HANDLER( marineb_palette_bank_0_w )
WRITE8_HANDLER( marineb_palette_bank_1_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
UINT8 old = state->palette_bank;
state->palette_bank = (state->palette_bank & 0x01) | ((data & 0x01) << 1);
@@ -141,7 +141,7 @@ WRITE8_HANDLER( marineb_palette_bank_1_w )
WRITE8_HANDLER( marineb_flipscreen_x_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
state->flipscreen_x = data ^ state->marineb_active_low_flipscreen;
tilemap_set_flip(state->bg_tilemap, (state->flipscreen_x ? TILEMAP_FLIPX : 0) | (state->flipscreen_y ? TILEMAP_FLIPY : 0));
@@ -150,7 +150,7 @@ WRITE8_HANDLER( marineb_flipscreen_x_w )
WRITE8_HANDLER( marineb_flipscreen_y_w )
{
- marineb_state *state = space->machine->driver_data<marineb_state>();
+ marineb_state *state = space->machine().driver_data<marineb_state>();
state->flipscreen_y = data ^ state->marineb_active_low_flipscreen;
tilemap_set_flip(state->bg_tilemap, (state->flipscreen_x ? TILEMAP_FLIPX : 0) | (state->flipscreen_y ? TILEMAP_FLIPY : 0));
@@ -164,9 +164,9 @@ WRITE8_HANDLER( marineb_flipscreen_y_w )
*
*************************************/
-static void set_tilemap_scrolly( running_machine *machine, int cols )
+static void set_tilemap_scrolly( running_machine &machine, int cols )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
int col;
for (col = 0; col < cols; col++)
@@ -179,10 +179,10 @@ static void set_tilemap_scrolly( running_machine *machine, int cols )
SCREEN_UPDATE( marineb )
{
- marineb_state *state = screen->machine->driver_data<marineb_state>();
+ marineb_state *state = screen->machine().driver_data<marineb_state>();
int offs;
- set_tilemap_scrolly(screen->machine, 24);
+ set_tilemap_scrolly(screen->machine(), 24);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
@@ -220,7 +220,7 @@ SCREEN_UPDATE( marineb )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[gfx]->width - sy;
+ sy = 256 - screen->machine().gfx[gfx]->width - sy;
flipy = !flipy;
}
@@ -229,7 +229,7 @@ SCREEN_UPDATE( marineb )
sx++;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx],
code,
col,
flipx,flipy,
@@ -241,10 +241,10 @@ SCREEN_UPDATE( marineb )
SCREEN_UPDATE( changes )
{
- marineb_state *state = screen->machine->driver_data<marineb_state>();
+ marineb_state *state = screen->machine().driver_data<marineb_state>();
int offs, sx, sy, code, col, flipx, flipy;
- set_tilemap_scrolly(screen->machine, 26);
+ set_tilemap_scrolly(screen->machine(), 26);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the small sprites */
@@ -263,7 +263,7 @@ SCREEN_UPDATE( changes )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[1]->width - sy;
+ sy = 256 - screen->machine().gfx[1]->width - sy;
flipy = !flipy;
}
@@ -272,7 +272,7 @@ SCREEN_UPDATE( changes )
sx++;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
code >> 2,
col,
flipx,flipy,
@@ -290,7 +290,7 @@ SCREEN_UPDATE( changes )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[2]->width - sy;
+ sy = 256 - screen->machine().gfx[2]->width - sy;
flipy = !flipy;
}
@@ -301,7 +301,7 @@ SCREEN_UPDATE( changes )
code >>= 4;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
code,
col,
flipx,flipy,
@@ -309,7 +309,7 @@ SCREEN_UPDATE( changes )
/* draw again for wrap around */
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
code,
col,
flipx,flipy,
@@ -320,10 +320,10 @@ SCREEN_UPDATE( changes )
SCREEN_UPDATE( springer )
{
- marineb_state *state = screen->machine->driver_data<marineb_state>();
+ marineb_state *state = screen->machine().driver_data<marineb_state>();
int offs;
- set_tilemap_scrolly(screen->machine, 0);
+ set_tilemap_scrolly(screen->machine(), 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
@@ -359,7 +359,7 @@ SCREEN_UPDATE( springer )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[gfx]->width - sy;
+ sy = 256 - screen->machine().gfx[gfx]->width - sy;
flipy = !flipy;
}
@@ -368,7 +368,7 @@ SCREEN_UPDATE( springer )
sx--;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx],
code,
col,
flipx,flipy,
@@ -380,10 +380,10 @@ SCREEN_UPDATE( springer )
SCREEN_UPDATE( hoccer )
{
- marineb_state *state = screen->machine->driver_data<marineb_state>();
+ marineb_state *state = screen->machine().driver_data<marineb_state>();
int offs;
- set_tilemap_scrolly(screen->machine, 0);
+ set_tilemap_scrolly(screen->machine(), 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
@@ -402,17 +402,17 @@ SCREEN_UPDATE( hoccer )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[1]->width - sy;
+ sy = 256 - screen->machine().gfx[1]->width - sy;
flipy = !flipy;
}
if (state->flipscreen_x)
{
- sx = 256 - screen->machine->gfx[1]->width - sx;
+ sx = 256 - screen->machine().gfx[1]->width - sx;
flipx = !flipx;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
code >> 2,
col,
flipx,flipy,
@@ -424,10 +424,10 @@ SCREEN_UPDATE( hoccer )
SCREEN_UPDATE( hopprobo )
{
- marineb_state *state = screen->machine->driver_data<marineb_state>();
+ marineb_state *state = screen->machine().driver_data<marineb_state>();
int offs;
- set_tilemap_scrolly(screen->machine, 0);
+ set_tilemap_scrolly(screen->machine(), 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
@@ -462,7 +462,7 @@ SCREEN_UPDATE( hopprobo )
if (!state->flipscreen_y)
{
- sy = 256 - screen->machine->gfx[gfx]->width - sy;
+ sy = 256 - screen->machine().gfx[gfx]->width - sy;
flipy = !flipy;
}
@@ -471,7 +471,7 @@ SCREEN_UPDATE( hopprobo )
sx--;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[gfx],
code,
col,
flipx,flipy,
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index 003d9e0fdb4..d1345b77416 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -73,13 +73,13 @@ PALETTE_INIT( mario )
palette_set_colors(machine, 256, rgb, 256);
auto_free(machine, rgb);
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
- palette_normalize_range(machine->palette, 256, 511, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 256, 511, 0, 255);
}
WRITE8_HANDLER( mario_videoram_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -87,51 +87,51 @@ WRITE8_HANDLER( mario_videoram_w )
WRITE8_HANDLER( mario_gfxbank_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
if (state->gfx_bank != (data & 0x01))
{
state->gfx_bank = data & 0x01;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( mario_palettebank_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
if (state->palette_bank != (data & 0x01))
{
state->palette_bank = data & 0x01;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( mario_scroll_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
state->gfx_scroll = data + 17;
}
WRITE8_HANDLER( mario_flip_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
if (state->flip != (data & 0x01))
{
state->flip = data & 0x01;
if (state->flip)
- tilemap_set_flip_all(space->machine, TILEMAP_FLIPX | TILEMAP_FLIPY);
+ tilemap_set_flip_all(space->machine(), TILEMAP_FLIPX | TILEMAP_FLIPY);
else
- tilemap_set_flip_all(space->machine, 0);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_set_flip_all(space->machine(), 0);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- mario_state *state = machine->driver_data<mario_state>();
+ mario_state *state = machine.driver_data<mario_state>();
int code = state->videoram[tile_index] + 256 * state->gfx_bank;
int color;
@@ -142,7 +142,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mario )
{
- mario_state *state = machine->driver_data<mario_state>();
+ mario_state *state = machine.driver_data<mario_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -161,12 +161,12 @@ VIDEO_START( mario )
* confirmed on mametests.org as being present on real PCB as well.
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* TODO: draw_sprites should adopt the scanline logic from dkong.c
* The schematics have the same logic for sprite buffering.
*/
- mario_state *state = machine->driver_data<mario_state>();
+ mario_state *state = machine.driver_data<mario_state>();
int offs;
for (offs = 0;offs < state->spriteram_size;offs += 4)
@@ -188,7 +188,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
y -= 14;
x -= 7;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
state->spriteram[offs + 2],
(state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor,
!(state->spriteram[offs + 1] & 0x80),!(state->spriteram[offs + 1] & 0x40),
@@ -198,7 +198,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
y += 1;
x -= 8;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
state->spriteram[offs + 2],
(state->spriteram[offs + 1] & 0x0f) + 16 * state->palette_bank + 32 * state->monitor,
(state->spriteram[offs + 1] & 0x80),(state->spriteram[offs + 1] & 0x40),
@@ -210,21 +210,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( mario )
{
- mario_state *state = screen->machine->driver_data<mario_state>();
+ mario_state *state = screen->machine().driver_data<mario_state>();
int t;
- t = input_port_read(screen->machine, "MONITOR");
+ t = input_port_read(screen->machine(), "MONITOR");
if (t != state->monitor)
{
state->monitor = t;
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
}
tilemap_set_scrollx(state->bg_tilemap, 0, state->flip ? (HTOTAL-HBSTART) : 0);
tilemap_set_scrolly(state->bg_tilemap, 0, state->gfx_scroll - (state->flip ? 8 : 0));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/markham.c b/src/mame/video/markham.c
index 29a74062014..e41ef91e126 100644
--- a/src/mame/video/markham.c
+++ b/src/mame/video/markham.c
@@ -16,7 +16,7 @@ PALETTE_INIT( markham )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -25,7 +25,7 @@ PALETTE_INIT( markham )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -35,29 +35,29 @@ PALETTE_INIT( markham )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( markham_videoram_w )
{
- markham_state *state = space->machine->driver_data<markham_state>();
+ markham_state *state = space->machine().driver_data<markham_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( markham_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- markham_state *state = machine->driver_data<markham_state>();
+ markham_state *state = machine.driver_data<markham_state>();
int attr = state->videoram[tile_index * 2];
int code = state->videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
int color = (attr & 0x1f) | ((attr & 0x80) >> 2);
@@ -67,15 +67,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( markham )
{
- markham_state *state = machine->driver_data<markham_state>();
+ markham_state *state = machine.driver_data<markham_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- markham_state *state = machine->driver_data<markham_state>();
+ markham_state *state = machine.driver_data<markham_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -108,18 +108,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (px > 248)
px = px - 256;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
chr,
col,
fx,fy,
px,py,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], col, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], col, 0));
}
}
SCREEN_UPDATE( markham )
{
- markham_state *state = screen->machine->driver_data<markham_state>();
+ markham_state *state = screen->machine().driver_data<markham_state>();
int i;
for (i = 0; i < 32; i++)
@@ -131,6 +131,6 @@ SCREEN_UPDATE( markham )
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/matmania.c b/src/mame/video/matmania.c
index dcaf21ce900..dc3c11ec8ff 100644
--- a/src/mame/video/matmania.c
+++ b/src/mame/video/matmania.c
@@ -74,7 +74,7 @@ PALETTE_INIT( matmania )
WRITE8_HANDLER( matmania_paletteram_w )
{
- matmania_state *state = space->machine->driver_data<matmania_state>();
+ matmania_state *state = space->machine().driver_data<matmania_state>();
int bit0, bit1, bit2, bit3, val;
int r, g, b;
int offs2;
@@ -103,7 +103,7 @@ WRITE8_HANDLER( matmania_paletteram_w )
bit3 = BIT(val, 3);
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(space->machine,offs2 + 64,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offs2 + 64,MAKE_RGB(r,g,b));
}
@@ -115,10 +115,10 @@ WRITE8_HANDLER( matmania_paletteram_w )
VIDEO_START( matmania )
{
- matmania_state *state = machine->driver_data<matmania_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
- bitmap_format format = machine->primary_screen->format();
+ matmania_state *state = machine.driver_data<matmania_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
+ bitmap_format format = machine.primary_screen->format();
/* Mat Mania has a virtual screen twice as large as the visible screen */
state->tmpbitmap = auto_bitmap_alloc(machine, width, 2 * height, format);
@@ -129,7 +129,7 @@ VIDEO_START( matmania )
SCREEN_UPDATE( matmania )
{
- matmania_state *state = screen->machine->driver_data<matmania_state>();
+ matmania_state *state = screen->machine().driver_data<matmania_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -140,7 +140,7 @@ SCREEN_UPDATE( matmania )
int sx = 15 - offs / 32;
int sy = offs % 32;
- drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1],
+ drawgfx_opaque(state->tmpbitmap, 0, screen->machine().gfx[1],
state->videoram[offs] + ((state->colorram[offs] & 0x08) << 5),
(state->colorram[offs] & 0x30) >> 4,
0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */
@@ -153,7 +153,7 @@ SCREEN_UPDATE( matmania )
int sx = 15 - offs / 32;
int sy = offs % 32;
- drawgfx_opaque(state->tmpbitmap2, 0, screen->machine->gfx[1],
+ drawgfx_opaque(state->tmpbitmap2, 0, screen->machine().gfx[1],
state->videoram3[offs] + ((state->colorram3[offs] & 0x08) << 5),
(state->colorram3[offs] & 0x30) >> 4,
0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */
@@ -175,7 +175,7 @@ SCREEN_UPDATE( matmania )
{
if (spriteram[offs] & 0x01)
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2],
spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4),
(spriteram[offs] & 0x08) >> 3,
spriteram[offs] & 0x04, spriteram[offs] & 0x02,
@@ -190,7 +190,7 @@ SCREEN_UPDATE( matmania )
int sx = 31 - offs / 32;
int sy = offs % 32;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
state->videoram2[offs] + 256 * (state->colorram2[offs] & 0x07),
(state->colorram2[offs] & 0x30) >> 4,
0,0,
@@ -201,7 +201,7 @@ SCREEN_UPDATE( matmania )
SCREEN_UPDATE( maniach )
{
- matmania_state *state = screen->machine->driver_data<matmania_state>();
+ matmania_state *state = screen->machine().driver_data<matmania_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -212,7 +212,7 @@ SCREEN_UPDATE( maniach )
int sx = 15 - offs / 32;
int sy = offs % 32;
- drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1],
+ drawgfx_opaque(state->tmpbitmap, 0, screen->machine().gfx[1],
state->videoram[offs] + ((state->colorram[offs] & 0x03) << 8),
(state->colorram[offs] & 0x30) >> 4,
0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */
@@ -225,7 +225,7 @@ SCREEN_UPDATE( maniach )
int sx = 15 - offs / 32;
int sy = offs % 32;
- drawgfx_opaque(state->tmpbitmap2, 0, screen->machine->gfx[1],
+ drawgfx_opaque(state->tmpbitmap2, 0, screen->machine().gfx[1],
state->videoram3[offs] + ((state->colorram3[offs] & 0x03) << 8),
(state->colorram3[offs] & 0x30) >> 4,
0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */
@@ -249,7 +249,7 @@ SCREEN_UPDATE( maniach )
{
if (spriteram[offs] & 0x01)
{
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
spriteram[offs+1] + ((spriteram[offs] & 0xf0) << 4),
(spriteram[offs] & 0x08) >> 3,
spriteram[offs] & 0x04,spriteram[offs] & 0x02,
@@ -264,7 +264,7 @@ SCREEN_UPDATE( maniach )
int sx = 31 - offs / 32;
int sy = offs % 32;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
state->videoram2[offs] + 256 * (state->colorram2[offs] & 0x07),
(state->colorram2[offs] & 0x30) >> 4,
0,0,
diff --git a/src/mame/video/mcatadv.c b/src/mame/video/mcatadv.c
index 8e01c9334aa..bd542c38ffc 100644
--- a/src/mame/video/mcatadv.c
+++ b/src/mame/video/mcatadv.c
@@ -16,7 +16,7 @@ ToDo: Fix Sprites & Rowscroll/Select for Cocktail
static TILE_GET_INFO( get_mcatadv_tile_info1 )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
int tileno = state->videoram1[tile_index * 2 + 1];
int colour = (state->videoram1[tile_index * 2] & 0x3f00) >> 8;
int pri = (state->videoram1[tile_index * 2] & 0xc000) >> 14;
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_mcatadv_tile_info1 )
WRITE16_HANDLER( mcatadv_videoram1_w )
{
- mcatadv_state *state = space->machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = space->machine().driver_data<mcatadv_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->tilemap1, offset / 2);
@@ -35,7 +35,7 @@ WRITE16_HANDLER( mcatadv_videoram1_w )
static TILE_GET_INFO( get_mcatadv_tile_info2 )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
int tileno = state->videoram2[tile_index * 2 + 1];
int colour = (state->videoram2[tile_index * 2] & 0x3f00) >> 8;
int pri = (state->videoram2[tile_index * 2] & 0xc000) >> 14;
@@ -46,16 +46,16 @@ static TILE_GET_INFO( get_mcatadv_tile_info2 )
WRITE16_HANDLER( mcatadv_videoram2_w )
{
- mcatadv_state *state = space->machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = space->machine().driver_data<mcatadv_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->tilemap2, offset / 2);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
UINT16 *source = state->spriteram_old;
UINT16 *finish = source + (state->spriteram_size / 2) / 2;
int global_x = state->vidregs[0] - 0x184;
@@ -63,7 +63,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
UINT16 *destline;
UINT8 *priline;
- UINT8 *sprdata = machine->region("gfx1")->base();
+ UINT8 *sprdata = machine.region("gfx1")->base();
int xstart, xend, xinc;
int ystart, yend, yinc;
@@ -124,7 +124,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ((drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y))
{
destline = BITMAP_ADDR16(bitmap, drawypos, 0);
- priline = BITMAP_ADDR8(machine->priority_bitmap, drawypos, 0);
+ priline = BITMAP_ADDR8(machine.priority_bitmap, drawypos, 0);
for (xcnt = xstart; xcnt != xend; xcnt += xinc)
{
@@ -202,11 +202,11 @@ static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_v
SCREEN_UPDATE( mcatadv )
{
- mcatadv_state *state = screen->machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = screen->machine().driver_data<mcatadv_state>();
int i;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->scroll1[2] != state->palette_bank1)
{
@@ -231,28 +231,28 @@ SCREEN_UPDATE( mcatadv )
for (i = 0; i <= 3; i++)
{
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_Q))
+ if (!input_code_pressed(screen->machine(), KEYCODE_Q))
#endif
mcatadv_draw_tilemap_part(state->scroll1, state->videoram1, i, state->tilemap1, bitmap, cliprect);
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_W))
+ if (!input_code_pressed(screen->machine(), KEYCODE_W))
#endif
mcatadv_draw_tilemap_part(state->scroll2, state->videoram2, i, state->tilemap2, bitmap, cliprect);
}
g_profiler.start(PROFILER_USER1);
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_E))
+ if (!input_code_pressed(screen->machine(), KEYCODE_E))
#endif
- draw_sprites (screen->machine, bitmap, cliprect);
+ draw_sprites (screen->machine(), bitmap, cliprect);
g_profiler.stop();
return 0;
}
VIDEO_START( mcatadv )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
state->tilemap1 = tilemap_create(machine, get_mcatadv_tile_info1, tilemap_scan_rows, 16, 16, 32, 32);
tilemap_set_transparent_pen(state->tilemap1, 0);
@@ -271,7 +271,7 @@ VIDEO_START( mcatadv )
SCREEN_EOF( mcatadv )
{
- mcatadv_state *state = machine->driver_data<mcatadv_state>();
+ mcatadv_state *state = machine.driver_data<mcatadv_state>();
memcpy(state->spriteram_old, state->spriteram, state->spriteram_size);
memcpy(state->vidregs_old, state->vidregs, 0xf);
}
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 56fb13bc43d..dbb02a6ed75 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -25,7 +25,7 @@ TODO:
#include "includes/cdi.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -34,23 +34,23 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
#define verboselog(x,y,z,...)
#endif
-static void cdi220_draw_lcd(running_machine *machine, int y);
+static void cdi220_draw_lcd(running_machine &machine, int y);
static void mcd212_update_region_arrays(mcd212_regs_t *mcd212);
static void mcd212_set_display_parameters(mcd212_regs_t *mcd212, int channel, UINT8 value);
-static void mcd212_update_visible_area(running_machine *machine);
+static void mcd212_update_visible_area(running_machine &machine);
static void mcd212_set_vsr(mcd212_regs_t *mcd212, int channel, UINT32 value);
static void mcd212_set_dcp(mcd212_regs_t *mcd212, int channel, UINT32 value);
static UINT32 mcd212_get_vsr(mcd212_regs_t *mcd212, int channel);
static UINT32 mcd212_get_dcp(mcd212_regs_t *mcd212, int channel);
static UINT32 mcd212_get_screen_width(mcd212_regs_t *mcd212);
-static void mcd212_set_register(running_machine *machine, int channel, UINT8 reg, UINT32 value);
+static void mcd212_set_register(running_machine &machine, int channel, UINT8 reg, UINT32 value);
static void mcd212_process_ica(mcd212_regs_t *mcd212, int channel);
static void mcd212_process_dca(mcd212_regs_t *mcd212, int channel);
static void mcd212_process_vsr(mcd212_regs_t *mcd212, int channel, UINT8 *pixels_r, UINT8 *pixels_g, UINT8 *pixels_b);
@@ -84,9 +84,9 @@ static const UINT16 cdi220_lcd_char[20*22] =
0x1000, 0x1000, 0x1000, 0x1000, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0400, 0x0400, 0x0400, 0x0400
};
-static void cdi220_draw_lcd(running_machine *machine, int y)
+static void cdi220_draw_lcd(running_machine &machine, int y)
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
bitmap_t *bitmap = state->lcdbitmap;
UINT32 *scanline = BITMAP_ADDR32(bitmap, y, 0);
int x = 0;
@@ -94,7 +94,7 @@ static void cdi220_draw_lcd(running_machine *machine, int y)
for(lcd = 0; lcd < 8; lcd++)
{
- cdislave_device *slave = downcast<cdislave_device *>(machine->device("slave"));
+ cdislave_device *slave = downcast<cdislave_device *>(machine.device("slave"));
UINT16 data = (slave->get_lcd_state()[lcd*2] << 8) |
slave->get_lcd_state()[lcd*2 + 1];
for(x = 0; x < 20; x++)
@@ -349,9 +349,9 @@ static void mcd212_set_vsr(mcd212_regs_t *mcd212, int channel, UINT32 value)
mcd212->channel[channel].dcr |= (value >> 16) & 0x003f;
}
-static void mcd212_set_register(running_machine *machine, int channel, UINT8 reg, UINT32 value)
+static void mcd212_set_register(running_machine &machine, int channel, UINT8 reg, UINT32 value)
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->mcd212_regs;
switch(reg)
@@ -534,13 +534,13 @@ static void mcd212_set_display_parameters(mcd212_regs_t *mcd212, int channel, UI
mcd212->channel[channel].dcr |= (value & 0x10) << 7;
}
-static void mcd212_update_visible_area(running_machine *machine)
+static void mcd212_update_visible_area(running_machine &machine)
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->mcd212_regs;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
rectangle visarea1;
- attoseconds_t period = machine->primary_screen->frame_period().attoseconds;
+ attoseconds_t period = machine.primary_screen->frame_period().attoseconds;
int width = 0;
if((mcd212->channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (mcd212->channel[0].csrw & MCD212_CSR1W_ST))
@@ -557,7 +557,7 @@ static void mcd212_update_visible_area(running_machine *machine)
visarea1.min_y = visarea.min_y;
visarea1.max_y = visarea.max_y;
- machine->primary_screen->configure(width, 302, visarea1, period);
+ machine.primary_screen->configure(width, 302, visarea1, period);
}
static UINT32 mcd212_get_screen_width(mcd212_regs_t *mcd212)
@@ -571,8 +571,8 @@ static UINT32 mcd212_get_screen_width(mcd212_regs_t *mcd212)
static void mcd212_process_ica(mcd212_regs_t *mcd212, int channel)
{
- running_machine *machine = mcd212->machine;
- cdi_state *state = machine->driver_data<cdi_state>();
+ running_machine &machine = mcd212->machine();
+ cdi_state *state = machine.driver_data<cdi_state>();
UINT16 *ica = channel ? state->planeb : state->planea;
UINT32 addr = 0x000400/2;
UINT32 cmd = 0;
@@ -623,7 +623,7 @@ static void mcd212_process_ica(mcd212_regs_t *mcd212, int channel)
UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
}
@@ -633,7 +633,7 @@ static void mcd212_process_ica(mcd212_regs_t *mcd212, int channel)
UINT8 interrupt = state->scc68070_regs.lir & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
}
@@ -656,8 +656,8 @@ static void mcd212_process_ica(mcd212_regs_t *mcd212, int channel)
static void mcd212_process_dca(mcd212_regs_t *mcd212, int channel)
{
- running_machine *machine = mcd212->machine;
- cdi_state *state = machine->driver_data<cdi_state>();
+ running_machine &machine = mcd212->machine();
+ cdi_state *state = machine.driver_data<cdi_state>();
UINT16 *dca = channel ? state->planeb : state->planea;
UINT32 addr = (mcd212->channel[channel].dca & 0x0007ffff) / 2; //(mcd212_get_dcp(mcd212, channel) & 0x0007ffff) / 2; // mcd212->channel[channel].dca / 2;
UINT32 cmd = 0;
@@ -714,7 +714,7 @@ static void mcd212_process_dca(mcd212_regs_t *mcd212, int channel)
UINT8 interrupt = (state->scc68070_regs.lir >> 4) & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 56 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
}
@@ -724,7 +724,7 @@ static void mcd212_process_dca(mcd212_regs_t *mcd212, int channel)
UINT8 interrupt = state->scc68070_regs.lir & 7;
if(interrupt)
{
- device_set_input_line_vector(machine->device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
+ device_set_input_line_vector(machine.device("maincpu"), M68K_IRQ_1 + (interrupt - 1), 24 + interrupt);
cputag_set_input_line(machine, "maincpu", M68K_IRQ_1 + (interrupt - 1), ASSERT_LINE);
}
}
@@ -804,8 +804,8 @@ INLINE UINT8 BYTE_TO_CLUT(int channel, int icm, UINT8 byte)
static void mcd212_process_vsr(mcd212_regs_t *mcd212, int channel, UINT8 *pixels_r, UINT8 *pixels_g, UINT8 *pixels_b)
{
- running_machine *machine = mcd212->machine;
- cdi_state *state = machine->driver_data<cdi_state>();
+ running_machine &machine = mcd212->machine();
+ cdi_state *state = machine.driver_data<cdi_state>();
UINT8 *data = channel ? (UINT8*)state->planeb : (UINT8*)state->planea;
UINT32 vsr = mcd212_get_vsr(mcd212, channel) & 0x0007ffff;
UINT8 done = 0;
@@ -1113,7 +1113,7 @@ static const UINT32 mcd212_4bpp_color[16] =
static void mcd212_mix_lines(mcd212_regs_t *mcd212, UINT8 *plane_a_r, UINT8 *plane_a_g, UINT8 *plane_a_b, UINT8 *plane_b_r, UINT8 *plane_b_g, UINT8 *plane_b_b, UINT32 *out)
{
- running_machine *machine = mcd212->machine;
+ running_machine &machine = mcd212->machine();
int x = 0;
UINT8 debug_mode = input_port_read(machine, "DEBUG");
UINT8 global_plane_a_disable = debug_mode & 1;
@@ -1331,8 +1331,8 @@ static void mcd212_draw_cursor(mcd212_regs_t *mcd212, UINT32 *scanline, int y)
static void mcd212_draw_scanline(mcd212_regs_t *mcd212, int y)
{
- running_machine *machine = mcd212->machine;
- bitmap_t *bitmap = machine->generic.tmpbitmap;
+ running_machine &machine = mcd212->machine();
+ bitmap_t *bitmap = machine.generic.tmpbitmap;
UINT8 plane_a_r[768], plane_a_g[768], plane_a_b[768];
UINT8 plane_b_r[768], plane_b_g[768], plane_b_b[768];
UINT32 out[768];
@@ -1354,7 +1354,7 @@ static void mcd212_draw_scanline(mcd212_regs_t *mcd212, int y)
READ16_HANDLER( mcd212_r )
{
- cdi_state *state = space->machine->driver_data<cdi_state>();
+ cdi_state *state = space->machine().driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->mcd212_regs;
UINT8 channel = 1 - (offset / 8);
@@ -1364,7 +1364,7 @@ READ16_HANDLER( mcd212_r )
case 0x10/2:
if(ACCESSING_BITS_0_7)
{
- verboselog(space->machine, 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212->channel[1 - (offset / 8)].csrr, mem_mask);
+ verboselog(space->machine(), 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212->channel[1 - (offset / 8)].csrr, mem_mask);
if(channel == 0)
{
return mcd212->channel[0].csrr;
@@ -1377,38 +1377,38 @@ READ16_HANDLER( mcd212_r )
mcd212->channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
if(interrupt1)
{
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (interrupt1 - 1), CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + (interrupt1 - 1), CLEAR_LINE);
}
//if(interrupt2)
//{
- // cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (interrupt2 - 1), CLEAR_LINE);
+ // cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_1 + (interrupt2 - 1), CLEAR_LINE);
//}
return old_csr;
}
}
else
{
- verboselog(space->machine, 2, "mcd212_r: Unknown Register %d: %04x\n", channel + 1, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: Unknown Register %d: %04x\n", channel + 1, mem_mask);
}
break;
case 0x02/2:
case 0x12/2:
- verboselog(space->machine, 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcr, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcr, mem_mask);
return mcd212->channel[1 - (offset / 8)].dcr;
case 0x04/2:
case 0x14/2:
- verboselog(space->machine, 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].vsr, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].vsr, mem_mask);
return mcd212->channel[1 - (offset / 8)].vsr;
case 0x08/2:
case 0x18/2:
- verboselog(space->machine, 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].ddr, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].ddr, mem_mask);
return mcd212->channel[1 - (offset / 8)].ddr;
case 0x0a/2:
case 0x1a/2:
- verboselog(space->machine, 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcp, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212->channel[1 - (offset / 8)].dcp, mem_mask);
return mcd212->channel[1 - (offset / 8)].dcp;
default:
- verboselog(space->machine, 2, "mcd212_r: Unknown Register %d & %04x\n", (1 - (offset / 8)) + 1, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_r: Unknown Register %d & %04x\n", (1 - (offset / 8)) + 1, mem_mask);
break;
}
@@ -1417,49 +1417,49 @@ READ16_HANDLER( mcd212_r )
WRITE16_HANDLER( mcd212_w )
{
- cdi_state *state = space->machine->driver_data<cdi_state>();
+ cdi_state *state = space->machine().driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->mcd212_regs;
switch(offset)
{
case 0x00/2:
case 0x10/2:
- verboselog(space->machine, 2, "mcd212_w: Status Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: Status Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].csrw);
- mcd212_update_visible_area(space->machine);
+ mcd212_update_visible_area(space->machine());
break;
case 0x02/2:
case 0x12/2:
- verboselog(space->machine, 2, "mcd212_w: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].dcr);
- mcd212_update_visible_area(space->machine);
+ mcd212_update_visible_area(space->machine());
break;
case 0x04/2:
case 0x14/2:
- verboselog(space->machine, 2, "mcd212_w: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].vsr);
break;
case 0x08/2:
case 0x18/2:
- verboselog(space->machine, 2, "mcd212_w: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].ddr);
break;
case 0x0a/2:
case 0x1a/2:
- verboselog(space->machine, 2, "mcd212_w: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
COMBINE_DATA(&mcd212->channel[1 - (offset / 8)].dcp);
break;
default:
- verboselog(space->machine, 2, "mcd212_w: Unknown Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
+ verboselog(space->machine(), 2, "mcd212_w: Unknown Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
break;
}
}
TIMER_CALLBACK( mcd212_perform_scan )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
mcd212_regs_t *mcd212 = &state->mcd212_regs;
- int scanline = machine->primary_screen->vpos();
+ int scanline = machine.primary_screen->vpos();
if(/*mcd212->channel[0].dcr & MCD212_DCR_DE*/1)
{
@@ -1506,12 +1506,12 @@ TIMER_CALLBACK( mcd212_perform_scan )
}
}
}
- mcd212->scan_timer->adjust(machine->primary_screen->time_until_pos(( scanline + 1 ) % 302, 0));
+ mcd212->scan_timer->adjust(machine.primary_screen->time_until_pos(( scanline + 1 ) % 302, 0));
}
-void mcd212_init(running_machine *machine, mcd212_regs_t *mcd212)
+void mcd212_init(running_machine &machine, mcd212_regs_t *mcd212)
{
- mcd212->machine = machine;
+ mcd212->m_machine = &machine;
int index = 0;
for(index = 0; index < 2; index++)
@@ -1650,26 +1650,26 @@ void mcd212_ab_init(mcd212_ab_t *mcd212_ab)
VIDEO_START( cdimono1 )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
VIDEO_START_CALL(generic_bitmapped);
mcd212_ab_init(&state->mcd212_ab);
mcd212_init(machine, &state->mcd212_regs);
- state->mcd212_regs.scan_timer = machine->scheduler().timer_alloc(FUNC(mcd212_perform_scan));
- state->mcd212_regs.scan_timer->adjust(machine->primary_screen->time_until_pos(0, 0));
+ state->mcd212_regs.scan_timer = machine.scheduler().timer_alloc(FUNC(mcd212_perform_scan));
+ state->mcd212_regs.scan_timer->adjust(machine.primary_screen->time_until_pos(0, 0));
- state->lcdbitmap = downcast<screen_device *>(machine->device("lcd"))->alloc_compatible_bitmap();
+ state->lcdbitmap = downcast<screen_device *>(machine.device("lcd"))->alloc_compatible_bitmap();
}
SCREEN_UPDATE( cdimono1 )
{
- copybitmap(bitmap, screen->machine->generic.tmpbitmap, 0, 0, 0, 0, cliprect);
+ copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
return 0;
}
SCREEN_UPDATE( cdimono1_lcd )
{
- cdi_state *state = screen->machine->driver_data<cdi_state>();
+ cdi_state *state = screen->machine().driver_data<cdi_state>();
copybitmap(bitmap, state->lcdbitmap, 0, 0, 0, 0, cliprect);
return 0;
}
diff --git a/src/mame/video/mcd212.h b/src/mame/video/mcd212.h
index 16e19db43d4..2d3d86a5130 100644
--- a/src/mame/video/mcd212.h
+++ b/src/mame/video/mcd212.h
@@ -62,12 +62,14 @@ typedef struct
typedef struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
mcd212_channel_t channel[2];
emu_timer *scan_timer;
UINT8 region_flag_0[768];
UINT8 region_flag_1[768];
- running_machine *machine;
+ running_machine *m_machine;
} mcd212_regs_t;
#define MCD212_CURCNT_COLOR 0x00000f // Cursor color
diff --git a/src/mame/video/mcr.c b/src/mame/video/mcr.c
index 1929856e656..c53e1143e23 100644
--- a/src/mame/video/mcr.c
+++ b/src/mame/video/mcr.c
@@ -28,7 +28,7 @@ static tilemap_t *bg_tilemap;
*/
static TILE_GET_INFO( mcr_90009_get_tile_info )
{
- mcr_state *state = machine->driver_data<mcr_state>();
+ mcr_state *state = machine.driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
SET_TILE_INFO(0, videoram[tile_index], 0, 0);
@@ -52,7 +52,7 @@ static TILE_GET_INFO( mcr_90009_get_tile_info )
*/
static TILE_GET_INFO( mcr_90010_get_tile_info )
{
- mcr_state *state = machine->driver_data<mcr_state>();
+ mcr_state *state = machine.driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index * 2] | (videoram[tile_index * 2 + 1] << 8);
int code = data & 0x1ff;
@@ -79,7 +79,7 @@ static TILE_GET_INFO( mcr_90010_get_tile_info )
*/
static TILE_GET_INFO( mcr_91490_get_tile_info )
{
- mcr_state *state = machine->driver_data<mcr_state>();
+ mcr_state *state = machine.driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index * 2] | (videoram[tile_index * 2 + 1] << 8);
int code = data & 0x3ff;
@@ -133,13 +133,13 @@ VIDEO_START( mcr )
*
*************************************/
-static void mcr_set_color(running_machine *machine, int index, int data)
+static void mcr_set_color(running_machine &machine, int index, int data)
{
palette_set_color_rgb(machine, index, pal3bit(data >> 6), pal3bit(data >> 0), pal3bit(data >> 3));
}
-static void journey_set_color(running_machine *machine, int index, int data)
+static void journey_set_color(running_machine &machine, int index, int data)
{
/* 3 bits each, RGB */
int r = (data >> 6) & 7;
@@ -170,9 +170,9 @@ static void journey_set_color(running_machine *machine, int index, int data)
WRITE8_HANDLER( mcr_91490_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
offset &= 0x7f;
- mcr_set_color(space->machine, (offset / 2) & 0x3f, data | ((offset & 1) << 8));
+ mcr_set_color(space->machine(), (offset / 2) & 0x3f, data | ((offset & 1) << 8));
}
@@ -185,7 +185,7 @@ WRITE8_HANDLER( mcr_91490_paletteram_w )
WRITE8_HANDLER( mcr_90009_videoram_w )
{
- mcr_state *state = space->machine->driver_data<mcr_state>();
+ mcr_state *state = space->machine().driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset);
@@ -194,7 +194,7 @@ WRITE8_HANDLER( mcr_90009_videoram_w )
WRITE8_HANDLER( mcr_90010_videoram_w )
{
- mcr_state *state = space->machine->driver_data<mcr_state>();
+ mcr_state *state = space->machine().driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
@@ -203,16 +203,16 @@ WRITE8_HANDLER( mcr_90010_videoram_w )
if ((offset & 0x780) == 0x780)
{
if (mcr_cpu_board != 91475)
- mcr_set_color(space->machine, (offset / 2) & 0x3f, data | ((offset & 1) << 8));
+ mcr_set_color(space->machine(), (offset / 2) & 0x3f, data | ((offset & 1) << 8));
else
- journey_set_color(space->machine, (offset / 2) & 0x3f, data | ((offset & 1) << 8));
+ journey_set_color(space->machine(), (offset / 2) & 0x3f, data | ((offset & 1) << 8));
}
}
READ8_HANDLER( twotiger_videoram_r )
{
- mcr_state *state = space->machine->driver_data<mcr_state>();
+ mcr_state *state = space->machine().driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
/* Two Tigers swizzles the address bits on videoram */
int effoffs = ((offset << 1) & 0x7fe) | ((offset >> 10) & 1);
@@ -221,7 +221,7 @@ READ8_HANDLER( twotiger_videoram_r )
WRITE8_HANDLER( twotiger_videoram_w )
{
- mcr_state *state = space->machine->driver_data<mcr_state>();
+ mcr_state *state = space->machine().driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
/* Two Tigers swizzles the address bits on videoram */
int effoffs = ((offset << 1) & 0x7fe) | ((offset >> 10) & 1);
@@ -231,13 +231,13 @@ WRITE8_HANDLER( twotiger_videoram_w )
/* palette RAM is mapped into the upper 0x80 bytes here */
if ((effoffs & 0x780) == 0x780)
- mcr_set_color(space->machine, ((offset & 0x400) >> 5) | ((offset >> 1) & 0x1f), data | ((offset & 1) << 8));
+ mcr_set_color(space->machine(), ((offset & 0x400) >> 5) | ((offset >> 1) & 0x1f), data | ((offset & 1) << 8));
}
WRITE8_HANDLER( mcr_91490_videoram_w )
{
- mcr_state *state = space->machine->driver_data<mcr_state>();
+ mcr_state *state = space->machine().driver_data<mcr_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
@@ -255,14 +255,14 @@ WRITE8_HANDLER( mcr_91490_videoram_w )
*
*************************************/
-static void render_sprites_91399(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void render_sprites_91399(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 *spriteram = machine->generic.spriteram.u8;
- const gfx_element *gfx = machine->gfx[1];
+ UINT8 *spriteram = machine.generic.spriteram.u8;
+ const gfx_element *gfx = machine.gfx[1];
int offs;
/* render the sprites into the bitmap, ORing together */
- for (offs = 0; offs < machine->generic.spriteram_size; offs += 4)
+ for (offs = 0; offs < machine.generic.spriteram_size; offs += 4)
{
int code, x, y, sx, sy, hflip, vflip;
@@ -294,7 +294,7 @@ static void render_sprites_91399(running_machine *machine, bitmap_t *bitmap, con
{
const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip);
UINT16 *dst = BITMAP_ADDR16(bitmap, sy, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, sy, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, sy, 0);
/* loop over columns */
for (x = 0; x < 32; x++)
@@ -327,14 +327,14 @@ static void render_sprites_91399(running_machine *machine, bitmap_t *bitmap, con
*
*************************************/
-static void render_sprites_91464(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int sprmask, int colormask)
+static void render_sprites_91464(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int sprmask, int colormask)
{
- UINT8 *spriteram = machine->generic.spriteram.u8;
- const gfx_element *gfx = machine->gfx[1];
+ UINT8 *spriteram = machine.generic.spriteram.u8;
+ const gfx_element *gfx = machine.gfx[1];
int offs;
/* render the sprites into the bitmap, working from topmost to bottommost */
- for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4)
+ for (offs = machine.generic.spriteram_size - 4; offs >= 0; offs -= 4)
{
int code, color, x, y, sx, sy, hflip, vflip;
@@ -365,7 +365,7 @@ static void render_sprites_91464(running_machine *machine, bitmap_t *bitmap, con
{
const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip);
UINT16 *dst = BITMAP_ADDR16(bitmap, sy, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, sy, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, sy, 0);
/* loop over columns */
for (x = 0; x < 32; x++)
@@ -407,7 +407,7 @@ SCREEN_UPDATE( mcr )
tilemap_set_flip(bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
/* draw the background */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0x00);
tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0x10);
tilemap_draw(bitmap, cliprect, bg_tilemap, 2, 0x20);
@@ -417,18 +417,18 @@ SCREEN_UPDATE( mcr )
switch (mcr_sprite_board)
{
case 91399:
- render_sprites_91399(screen->machine, bitmap, cliprect);
+ render_sprites_91399(screen->machine(), bitmap, cliprect);
break;
case 91464:
if (mcr_cpu_board == 91442)
- render_sprites_91464(screen->machine, bitmap, cliprect, 0x00, 0x30, 0x00);
+ render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
else if (mcr_cpu_board == 91475)
- render_sprites_91464(screen->machine, bitmap, cliprect, 0x00, 0x30, 0x40);
+ render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x40);
else if (mcr_cpu_board == 91490)
- render_sprites_91464(screen->machine, bitmap, cliprect, 0x00, 0x30, 0x00);
+ render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
else if (mcr_cpu_board == 91721)
- render_sprites_91464(screen->machine, bitmap, cliprect, 0x00, 0x30, 0x00);
+ render_sprites_91464(screen->machine(), bitmap, cliprect, 0x00, 0x30, 0x00);
break;
}
return 0;
diff --git a/src/mame/video/mcr3.c b/src/mame/video/mcr3.c
index d1735ea6f15..464cdf35fce 100644
--- a/src/mame/video/mcr3.c
+++ b/src/mame/video/mcr3.c
@@ -19,7 +19,7 @@
#ifdef UNUSED_FUNCTION
static TILE_GET_INFO( get_bg_tile_info )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index * 2] | (videoram[tile_index * 2 + 1] << 8);
int code = (data & 0x3ff) | ((data >> 4) & 0x400);
@@ -31,7 +31,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( mcrmono_get_bg_tile_info )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index * 2] | (videoram[tile_index * 2 + 1] << 8);
int code = (data & 0x3ff) | ((data >> 4) & 0x400);
@@ -49,7 +49,7 @@ static TILEMAP_MAPPER( spyhunt_bg_scan )
static TILE_GET_INFO( spyhunt_get_bg_tile_info )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
UINT8 *videoram = state->videoram;
int data = videoram[tile_index];
int code = (data & 0x3f) | ((data >> 1) & 0x40);
@@ -59,7 +59,7 @@ static TILE_GET_INFO( spyhunt_get_bg_tile_info )
static TILE_GET_INFO( spyhunt_get_alpha_tile_info )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
SET_TILE_INFO(2, state->spyhunt_alpharam[tile_index], 0, 0);
}
@@ -91,7 +91,7 @@ PALETTE_INIT( spyhunt )
#ifdef UNUSED_FUNCTION
VIDEO_START( mcr3 )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16,16, 32,30);
}
@@ -100,7 +100,7 @@ VIDEO_START( mcr3 )
VIDEO_START( mcrmono )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
state->bg_tilemap = tilemap_create(machine, mcrmono_get_bg_tile_info, tilemap_scan_rows, 16,16, 32,30);
}
@@ -108,7 +108,7 @@ VIDEO_START( mcrmono )
VIDEO_START( spyhunt )
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
/* initialize the background tilemap */
state->bg_tilemap = tilemap_create(machine, spyhunt_get_bg_tile_info, spyhunt_bg_scan, 64,32, 64,32);
@@ -133,11 +133,11 @@ VIDEO_START( spyhunt )
WRITE8_HANDLER( mcr3_paletteram_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
offset &= 0x7f;
/* high bit of red comes from low bit of address */
- palette_set_color_rgb(space->machine, offset / 2, pal3bit(((offset & 1) << 2) + (data >> 6)), pal3bit(data >> 0), pal3bit(data >> 3));
+ palette_set_color_rgb(space->machine(), offset / 2, pal3bit(((offset & 1) << 2) + (data >> 6)), pal3bit(data >> 0), pal3bit(data >> 3));
}
@@ -150,7 +150,7 @@ WRITE8_HANDLER( mcr3_paletteram_w )
WRITE8_HANDLER( mcr3_videoram_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -159,7 +159,7 @@ WRITE8_HANDLER( mcr3_videoram_w )
WRITE8_HANDLER( spyhunt_videoram_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -168,7 +168,7 @@ WRITE8_HANDLER( spyhunt_videoram_w )
WRITE8_HANDLER( spyhunt_alpharam_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
state->spyhunt_alpharam[offset] = data;
tilemap_mark_tile_dirty(state->alpha_tilemap, offset);
}
@@ -176,7 +176,7 @@ WRITE8_HANDLER( spyhunt_alpharam_w )
WRITE8_HANDLER( spyhunt_scroll_value_w )
{
- mcr3_state *state = space->machine->driver_data<mcr3_state>();
+ mcr3_state *state = space->machine().driver_data<mcr3_state>();
switch (offset)
{
case 0:
@@ -205,13 +205,13 @@ WRITE8_HANDLER( spyhunt_scroll_value_w )
*
*************************************/
-static void mcr3_update_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int code_xor, int dx, int dy)
+static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int code_xor, int dx, int dy)
{
- mcr3_state *state = machine->driver_data<mcr3_state>();
+ mcr3_state *state = machine.driver_data<mcr3_state>();
UINT8 *spriteram = state->spriteram;
int offs;
- bitmap_fill(machine->priority_bitmap, cliprect, 1);
+ bitmap_fill(machine.priority_bitmap, cliprect, 1);
/* loop over sprite RAM */
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -252,22 +252,22 @@ static void mcr3_update_sprites(running_machine *machine, bitmap_t *bitmap, cons
if (!mcr_cocktail_flip)
{
/* first draw the sprite, visible */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
- machine->priority_bitmap, 0x00, 0x0101);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy,
+ machine.priority_bitmap, 0x00, 0x0101);
/* then draw the mask, behind the background but obscuring following sprites */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy,
- machine->priority_bitmap, 0x02, 0xfeff);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy,
+ machine.priority_bitmap, 0x02, 0xfeff);
}
else
{
/* first draw the sprite, visible */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
- machine->priority_bitmap, 0x00, 0x0101);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
+ machine.priority_bitmap, 0x00, 0x0101);
/* then draw the mask, behind the background but obscuring following sprites */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
- machine->priority_bitmap, 0x02, 0xfeff);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, !flipx, !flipy, 480 - sx, 452 - sy,
+ machine.priority_bitmap, 0x02, 0xfeff);
}
}
}
@@ -282,7 +282,7 @@ static void mcr3_update_sprites(running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( mcr3 )
{
- mcr3_state *state = screen->machine->driver_data<mcr3_state>();
+ mcr3_state *state = screen->machine().driver_data<mcr3_state>();
/* update the flip state */
tilemap_set_flip(state->bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
@@ -290,14 +290,14 @@ SCREEN_UPDATE( mcr3 )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
- mcr3_update_sprites(screen->machine, bitmap, cliprect, 0x03, 0, 0, 0);
+ mcr3_update_sprites(screen->machine(), bitmap, cliprect, 0x03, 0, 0, 0);
return 0;
}
SCREEN_UPDATE( spyhunt )
{
- mcr3_state *state = screen->machine->driver_data<mcr3_state>();
+ mcr3_state *state = screen->machine().driver_data<mcr3_state>();
/* for every character in the Video RAM, check if it has been modified */
/* since last time and update it accordingly. */
tilemap_set_scrollx(state->bg_tilemap, 0, state->spyhunt_scrollx * 2 + state->spyhunt_scroll_offset);
@@ -305,7 +305,7 @@ SCREEN_UPDATE( spyhunt )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
- mcr3_update_sprites(screen->machine, bitmap, cliprect, state->spyhunt_sprite_color_mask, 0, -12, 0);
+ mcr3_update_sprites(screen->machine(), bitmap, cliprect, state->spyhunt_sprite_color_mask, 0, -12, 0);
/* render any characters on top */
tilemap_draw(bitmap, cliprect, state->alpha_tilemap, 0, 0);
diff --git a/src/mame/video/mcr68.c b/src/mame/video/mcr68.c
index 7cae605c004..891c1679c7b 100644
--- a/src/mame/video/mcr68.c
+++ b/src/mame/video/mcr68.c
@@ -19,20 +19,20 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
UINT16 *videoram = state->videoram;
int data = LOW_BYTE(videoram[tile_index * 2]) | (LOW_BYTE(videoram[tile_index * 2 + 1]) << 8);
int code = (data & 0x3ff) | ((data >> 4) & 0xc00);
int color = (~data >> 12) & 3;
SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3));
- if (machine->gfx[0]->total_elements < 0x1000)
+ if (machine.gfx[0]->total_elements < 0x1000)
tileinfo->category = (data >> 15) & 1;
}
static TILE_GET_INFO( zwackery_get_bg_tile_info )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
int color = (data >> 13) & 7;
@@ -42,7 +42,7 @@ static TILE_GET_INFO( zwackery_get_bg_tile_info )
static TILE_GET_INFO( zwackery_get_fg_tile_info )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
int color = (data >> 13) & 7;
@@ -60,7 +60,7 @@ static TILE_GET_INFO( zwackery_get_fg_tile_info )
VIDEO_START( mcr68 )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
/* initialize the background tilemap */
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16,16, 32,32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
@@ -69,10 +69,10 @@ VIDEO_START( mcr68 )
VIDEO_START( zwackery )
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
- const UINT8 *colordatabase = (const UINT8 *)machine->region("gfx3")->base();
- gfx_element *gfx0 = machine->gfx[0];
- gfx_element *gfx2 = machine->gfx[2];
+ mcr68_state *state = machine.driver_data<mcr68_state>();
+ const UINT8 *colordatabase = (const UINT8 *)machine.region("gfx3")->base();
+ gfx_element *gfx0 = machine.gfx[0];
+ gfx_element *gfx2 = machine.gfx[2];
UINT8 *srcdata0, *dest0;
UINT8 *srcdata2, *dest2;
int code, y, x;
@@ -153,9 +153,9 @@ WRITE16_HANDLER( mcr68_paletteram_w )
{
int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal3bit(newword >> 6), pal3bit(newword >> 0), pal3bit(newword >> 3));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal3bit(newword >> 6), pal3bit(newword >> 0), pal3bit(newword >> 3));
}
@@ -163,9 +163,9 @@ WRITE16_HANDLER( zwackery_paletteram_w )
{
int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(~newword >> 10), pal5bit(~newword >> 0), pal5bit(~newword >> 5));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(~newword >> 10), pal5bit(~newword >> 0), pal5bit(~newword >> 5));
}
@@ -178,7 +178,7 @@ WRITE16_HANDLER( zwackery_paletteram_w )
WRITE16_HANDLER( mcr68_videoram_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -187,7 +187,7 @@ WRITE16_HANDLER( mcr68_videoram_w )
WRITE16_HANDLER( zwackery_videoram_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -197,7 +197,7 @@ WRITE16_HANDLER( zwackery_videoram_w )
WRITE16_HANDLER( zwackery_spriteram_w )
{
- mcr68_state *state = space->machine->driver_data<mcr68_state>();
+ mcr68_state *state = space->machine().driver_data<mcr68_state>();
/* yech -- Zwackery relies on the upper 8 bits of a spriteram read being $ff! */
/* to make this happen we always write $ff in the upper 8 bits */
COMBINE_DATA(&state->spriteram[offset]);
@@ -212,10 +212,10 @@ WRITE16_HANDLER( zwackery_spriteram_w )
*
*************************************/
-static void mcr68_update_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void mcr68_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
- rectangle sprite_clip = machine->primary_screen->visible_area();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
+ rectangle sprite_clip = machine.primary_screen->visible_area();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -224,7 +224,7 @@ static void mcr68_update_sprites(running_machine *machine, bitmap_t *bitmap, con
sprite_clip.max_x -= state->sprite_clip;
sect_rect(&sprite_clip, cliprect);
- bitmap_fill(machine->priority_bitmap,&sprite_clip,1);
+ bitmap_fill(machine.priority_bitmap,&sprite_clip,1);
/* loop over sprite RAM */
for (offs = state->spriteram_size / 2 - 4;offs >= 0;offs -= 4)
@@ -256,23 +256,23 @@ static void mcr68_update_sprites(running_machine *machine, bitmap_t *bitmap, con
The color 8 is used to cover over other sprites. */
/* first draw the sprite, visible */
- pdrawgfx_transmask(bitmap, &sprite_clip, machine->gfx[1], code, color, flipx, flipy, x, y,
- machine->priority_bitmap, 0x00, 0x0101);
+ pdrawgfx_transmask(bitmap, &sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
+ machine.priority_bitmap, 0x00, 0x0101);
/* then draw the mask, behind the background but obscuring following sprites */
- pdrawgfx_transmask(bitmap, &sprite_clip, machine->gfx[1], code, color, flipx, flipy, x, y,
- machine->priority_bitmap, 0x02, 0xfeff);
+ pdrawgfx_transmask(bitmap, &sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
+ machine.priority_bitmap, 0x02, 0xfeff);
}
}
-static void zwackery_update_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- mcr68_state *state = machine->driver_data<mcr68_state>();
+ mcr68_state *state = machine.driver_data<mcr68_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
- bitmap_fill(machine->priority_bitmap,cliprect,1);
+ bitmap_fill(machine.priority_bitmap,cliprect,1);
/* loop over sprite RAM */
for (offs = state->spriteram_size / 2 - 4;offs >= 0;offs -= 4)
@@ -314,12 +314,12 @@ static void zwackery_update_sprites(running_machine *machine, bitmap_t *bitmap,
The color 8 is used to cover over other sprites. */
/* first draw the sprite, visible */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, x, y,
- machine->priority_bitmap, 0x00, 0x0101);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, x, y,
+ machine.priority_bitmap, 0x00, 0x0101);
/* then draw the mask, behind the background but obscuring following sprites */
- pdrawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, x, y,
- machine->priority_bitmap, 0x02, 0xfeff);
+ pdrawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, x, y,
+ machine.priority_bitmap, 0x02, 0xfeff);
}
}
@@ -333,35 +333,35 @@ static void zwackery_update_sprites(running_machine *machine, bitmap_t *bitmap,
SCREEN_UPDATE( mcr68 )
{
- mcr68_state *state = screen->machine->driver_data<mcr68_state>();
+ mcr68_state *state = screen->machine().driver_data<mcr68_state>();
/* draw the background */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
/* draw the low-priority sprites */
- mcr68_update_sprites(screen->machine, bitmap, cliprect, 0);
+ mcr68_update_sprites(screen->machine(), bitmap, cliprect, 0);
/* redraw tiles with priority over sprites */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
/* draw the high-priority sprites */
- mcr68_update_sprites(screen->machine, bitmap, cliprect, 1);
+ mcr68_update_sprites(screen->machine(), bitmap, cliprect, 1);
return 0;
}
SCREEN_UPDATE( zwackery )
{
- mcr68_state *state = screen->machine->driver_data<mcr68_state>();
+ mcr68_state *state = screen->machine().driver_data<mcr68_state>();
/* draw the background */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the low-priority sprites */
- zwackery_update_sprites(screen->machine, bitmap, cliprect, 0);
+ zwackery_update_sprites(screen->machine(), bitmap, cliprect, 0);
/* redraw tiles with priority over sprites */
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 1, 0);
/* draw the high-priority sprites */
- zwackery_update_sprites(screen->machine, bitmap, cliprect, 1);
+ zwackery_update_sprites(screen->machine(), bitmap, cliprect, 1);
return 0;
}
diff --git a/src/mame/video/meadows.c b/src/mame/video/meadows.c
index 7a2cb85e2af..36c49d1aa37 100644
--- a/src/mame/video/meadows.c
+++ b/src/mame/video/meadows.c
@@ -20,7 +20,7 @@
static TILE_GET_INFO( get_tile_info )
{
- meadows_state *state = machine->driver_data<meadows_state>();
+ meadows_state *state = machine.driver_data<meadows_state>();
UINT8 *videoram = state->videoram;
SET_TILE_INFO(0, videoram[tile_index] & 0x7f, 0, 0);
}
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( meadows )
{
- meadows_state *state = machine->driver_data<meadows_state>();
+ meadows_state *state = machine.driver_data<meadows_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,30);
}
@@ -49,7 +49,7 @@ VIDEO_START( meadows )
WRITE8_HANDLER( meadows_videoram_w )
{
- meadows_state *state = space->machine->driver_data<meadows_state>();
+ meadows_state *state = space->machine().driver_data<meadows_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -65,8 +65,8 @@ WRITE8_HANDLER( meadows_videoram_w )
WRITE8_HANDLER( meadows_spriteram_w )
{
- meadows_state *state = space->machine->driver_data<meadows_state>();
- space->machine->primary_screen->update_now();
+ meadows_state *state = space->machine().driver_data<meadows_state>();
+ space->machine().primary_screen->update_now();
state->spriteram[offset] = data;
}
@@ -78,9 +78,9 @@ WRITE8_HANDLER( meadows_spriteram_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *clip)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *clip)
{
- meadows_state *state = machine->driver_data<meadows_state>();
+ meadows_state *state = machine.driver_data<meadows_state>();
UINT8 *spriteram = state->spriteram;
int i;
@@ -93,7 +93,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int bank = i; /* that fixes it for now :-/ */
int flip = spriteram[i+8] >> 5; /* bit #5 flip vertical flag */
- drawgfx_transpen(bitmap, clip, machine->gfx[bank + 1], code, 0, flip, 0, x, y, 0);
+ drawgfx_transpen(bitmap, clip, machine.gfx[bank + 1], code, 0, flip, 0, x, y, 0);
}
}
@@ -107,12 +107,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( meadows )
{
- meadows_state *state = screen->machine->driver_data<meadows_state>();
+ meadows_state *state = screen->machine().driver_data<meadows_state>();
/* draw the background */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw the sprites */
- if (screen->machine->gfx[1])
- draw_sprites(screen->machine, bitmap, cliprect);
+ if (screen->machine().gfx[1])
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c
index 2daefad27ac..43e699915f9 100644
--- a/src/mame/video/megasys1.c
+++ b/src/mame/video/megasys1.c
@@ -194,7 +194,7 @@ actual code sent to the hardware.
#include "emu.h"
#include "includes/megasys1.h"
-static void create_tilemaps(running_machine *machine);
+static void create_tilemaps(running_machine &machine);
#ifdef MAME_DEBUG
@@ -222,7 +222,7 @@ static void create_tilemaps(running_machine *machine);
VIDEO_START( megasys1 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int i;
state->spriteram = &state->ram[0x8000/2];
@@ -267,14 +267,14 @@ VIDEO_START( megasys1 )
state->_8x8_scroll_factor[1] = 1; state->_16x16_scroll_factor[1] = 4;
state->_8x8_scroll_factor[2] = 1; state->_16x16_scroll_factor[2] = 4;
- if (strcmp(machine->system().name, "soldamj") == 0)
+ if (strcmp(machine.system().name, "soldamj") == 0)
{
state->_8x8_scroll_factor[1] = 4; state->_16x16_scroll_factor[1] = 4;
}
state->hardware_type_z = 0;
- if (strcmp(machine->system().name, "lomakai") == 0 ||
- strcmp(machine->system().name, "makaiden") == 0)
+ if (strcmp(machine.system().name, "lomakai") == 0 ||
+ strcmp(machine.system().name, "makaiden") == 0)
state->hardware_type_z = 1;
}
@@ -293,7 +293,7 @@ VIDEO_START( megasys1 )
INLINE void scrollram_w(address_space *space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
COMBINE_DATA(&state->scrollram[which][offset]);
if (offset < 0x40000/2 && state->tmap[which])
{
@@ -351,7 +351,7 @@ static TILEMAP_MAPPER( megasys1_scan_16x16 )
static TILE_GET_INFO( megasys1_get_scroll_tile_info_8x8 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int tmap = (FPTR)param;
UINT16 code = state->scrollram[tmap][tile_index];
SET_TILE_INFO(tmap, (code & 0xfff) * state->_8x8_scroll_factor[tmap], code >> (16 - state->bits_per_color_code), 0);
@@ -359,15 +359,15 @@ static TILE_GET_INFO( megasys1_get_scroll_tile_info_8x8 )
static TILE_GET_INFO( megasys1_get_scroll_tile_info_16x16 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int tmap = (FPTR)param;
UINT16 code = state->scrollram[tmap][tile_index/4];
SET_TILE_INFO(tmap, (code & 0xfff) * state->_16x16_scroll_factor[tmap] + (tile_index & 3), code >> (16 - state->bits_per_color_code), 0);
}
-static void create_tilemaps(running_machine *machine)
+static void create_tilemaps(running_machine &machine)
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int layer, i;
for (layer = 0; layer < 3; layer++)
@@ -416,7 +416,7 @@ static void megasys1_set_vreg_flag(megasys1_state *state, int which, int data)
/* Used by MS1-A/Z, B */
WRITE16_HANDLER( megasys1_vregs_A_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
switch (offset)
@@ -438,17 +438,17 @@ WRITE16_HANDLER( megasys1_vregs_A_w )
case 0x100/2 : state->sprite_flag = new_data; break;
case 0x300/2 : state->screen_flag = new_data;
- if (space->machine->device("soundcpu"))
+ if (space->machine().device("soundcpu"))
{
if (new_data & 0x10)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
}
break;
case 0x308/2 : soundlatch_word_w(space,0,new_data,0xffff);
- cputag_set_input_line(space->machine, "soundcpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 4, HOLD_LINE);
break;
default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
@@ -462,7 +462,7 @@ WRITE16_HANDLER( megasys1_vregs_A_w )
/* Used by MS1-C only */
READ16_HANDLER( megasys1_vregs_C_r )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
switch (offset)
{
case 0x8000/2: return soundlatch2_word_r(space,0,0xffff);
@@ -472,7 +472,7 @@ READ16_HANDLER( megasys1_vregs_C_r )
WRITE16_HANDLER( megasys1_vregs_C_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
switch (offset)
@@ -495,14 +495,14 @@ WRITE16_HANDLER( megasys1_vregs_C_w )
case 0x2308/2 : state->screen_flag = new_data;
if (new_data & 0x10)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, CLEAR_LINE);
break;
case 0x8000/2 : /* Cybattler reads sound latch on irq 2 */
soundlatch_word_w(space, 0, new_data, 0xffff);
- cputag_set_input_line(space->machine, "soundcpu", 2, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 2, HOLD_LINE);
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X", offset * 2, data);
@@ -514,7 +514,7 @@ WRITE16_HANDLER( megasys1_vregs_C_w )
/* Used by MS1-D only */
WRITE16_HANDLER( megasys1_vregs_D_w )
{
- megasys1_state *state = space->machine->driver_data<megasys1_state>();
+ megasys1_state *state = space->machine().driver_data<megasys1_state>();
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
switch (offset)
@@ -567,9 +567,9 @@ WRITE16_HANDLER( megasys1_vregs_D_w )
0C Y position
0E Code */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int color,code,sx,sy,flipx,flipy,attr,sprite,offs,color_mask;
/* objram: 0x100*4 entries spritedata: 0x80 entries */
@@ -611,12 +611,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
color = (attr & color_mask);
pdrawgfx_transpen(bitmap,cliprect,
- machine->gfx[3],
+ machine.gfx[3],
(code & 0xfff ) + ((state->sprite_bank & 1) << 12),
color,
flipx, flipy,
sx, sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(attr & 0x08) ? 0x0c : 0x0a,15);
} /* sprite */
} /* offs */
@@ -652,12 +652,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
pdrawgfx_transpen(bitmap,cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code,
color,
flipx, flipy,
sx, sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(attr & 0x08) ? 0x0c : 0x0a,15);
} /* sprite */
} /* Z hw */
@@ -757,7 +757,7 @@ static const struct priority priorities[] =
PALETTE_INIT( megasys1 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
int pri_code, offset, i, order;
/* First check if we have an hand-crafted priority scheme
@@ -766,8 +766,8 @@ PALETTE_INIT( megasys1 )
i = 0;
while ( priorities[i].driver &&
- strcmp(priorities[i].driver, machine->system().name) != 0 &&
- strcmp(priorities[i].driver, machine->system().parent) != 0)
+ strcmp(priorities[i].driver, machine.system().name) != 0 &&
+ strcmp(priorities[i].driver, machine.system().parent) != 0)
i++;
if (priorities[i].driver)
@@ -926,7 +926,7 @@ PALETTE_INIT( megasys1 )
SCREEN_UPDATE( megasys1 )
{
- megasys1_state *state = screen->machine->driver_data<megasys1_state>();
+ megasys1_state *state = screen->machine().driver_data<megasys1_state>();
int i,flag,pri,primask;
int active_layers;
@@ -960,7 +960,7 @@ SCREEN_UPDATE( megasys1 )
active_layers |= 1 << ((pri & 0xf0000) >> 16); // bottom layer can't be disabled
}
- tilemap_set_flip_all( screen->machine, (state->screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 );
+ tilemap_set_flip_all( screen->machine(), (state->screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0 );
for (i = 0;i < 3;i++)
{
@@ -973,7 +973,7 @@ SCREEN_UPDATE( megasys1 )
}
}
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
flag = TILEMAP_DRAW_OPAQUE;
primask = 0;
@@ -1016,13 +1016,13 @@ SCREEN_UPDATE( megasys1 )
}
if (active_layers & 0x08)
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_EOF( megasys1 )
{
- megasys1_state *state = machine->driver_data<megasys1_state>();
+ megasys1_state *state = machine.driver_data<megasys1_state>();
/* Sprite are TWO frames ahead, like NMK16 HW. */
//state->objectram
memcpy(state->buffer2_objectram,state->buffer_objectram, 0x2000);
diff --git a/src/mame/video/megazone.c b/src/mame/video/megazone.c
index 81470e91d5a..876d79d6c2d 100644
--- a/src/mame/video/megazone.c
+++ b/src/mame/video/megazone.c
@@ -50,7 +50,7 @@ PALETTE_INIT( megazone )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -75,7 +75,7 @@ PALETTE_INIT( megazone )
bit1 = BIT(color_prom[i], 7);
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -85,27 +85,27 @@ PALETTE_INIT( megazone )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( megazone_flipscreen_w )
{
- megazone_state *state = space->machine->driver_data<megazone_state>();
+ megazone_state *state = space->machine().driver_data<megazone_state>();
state->flipscreen = data & 1;
}
VIDEO_START( megazone )
{
- megazone_state *state = machine->driver_data<megazone_state>();
- state->tmpbitmap = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
+ megazone_state *state = machine.driver_data<megazone_state>();
+ state->tmpbitmap = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
state->save_item(NAME(*state->tmpbitmap));
}
@@ -113,7 +113,7 @@ VIDEO_START( megazone )
SCREEN_UPDATE( megazone )
{
- megazone_state *state = screen->machine->driver_data<megazone_state>();
+ megazone_state *state = screen->machine().driver_data<megazone_state>();
int offs;
int x, y;
@@ -135,7 +135,7 @@ SCREEN_UPDATE( megazone )
flipy = !flipy;
}
- drawgfx_opaque(state->tmpbitmap, 0, screen->machine->gfx[1],
+ drawgfx_opaque(state->tmpbitmap, 0, screen->machine().gfx[1],
((int)state->videoram[offs]) + ((state->colorram[offs] & (1 << 7) ? 256 : 0) ),
(state->colorram[offs] & 0x0f) + 0x10,
flipx,flipy,
@@ -182,12 +182,12 @@ SCREEN_UPDATE( megazone )
else
sx = sx + 32;
- drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[0],
spriteram[offs + 2],
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[0], color, 0));
}
}
@@ -215,7 +215,7 @@ SCREEN_UPDATE( megazone )
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1],
((int)state->videoram2[offs]) + ((state->colorram2[offs] & (1 << 7) ? 256 : 0) ),
(state->colorram2[offs] & 0x0f) + 0x10,
flipx,flipy,
diff --git a/src/mame/video/mermaid.c b/src/mame/video/mermaid.c
index 8fc8573e29c..527decfc19b 100644
--- a/src/mame/video/mermaid.c
+++ b/src/mame/video/mermaid.c
@@ -19,7 +19,7 @@ PALETTE_INIT( mermaid )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x41);
+ machine.colortable = colortable_alloc(machine, 0x41);
for (i = 0; i < 0x40; i++)
{
@@ -27,21 +27,21 @@ PALETTE_INIT( mermaid )
int g = 0x21 * BIT(color_prom[i], 3) + 0x47 * BIT(color_prom[i], 4) + 0x97 * BIT(color_prom[i], 5);
int b = 0x47 * BIT(color_prom[i], 6) + 0x97 * BIT(color_prom[i], 7);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* blue background */
- colortable_palette_set_color(machine->colortable, 0x40, MAKE_RGB(0, 0, 0xff));
+ colortable_palette_set_color(machine.colortable, 0x40, MAKE_RGB(0, 0, 0xff));
/* char/sprite palette */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* background palette */
- colortable_entry_set_value(machine->colortable, 0x40, 0x20);
- colortable_entry_set_value(machine->colortable, 0x41, 0x21);
- colortable_entry_set_value(machine->colortable, 0x42, 0x40);
- colortable_entry_set_value(machine->colortable, 0x43, 0x21);
+ colortable_entry_set_value(machine.colortable, 0x40, 0x20);
+ colortable_entry_set_value(machine.colortable, 0x41, 0x21);
+ colortable_entry_set_value(machine.colortable, 0x42, 0x40);
+ colortable_entry_set_value(machine.colortable, 0x43, 0x21);
}
PALETTE_INIT( rougien )
@@ -49,7 +49,7 @@ PALETTE_INIT( rougien )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x41);
+ machine.colortable = colortable_alloc(machine, 0x41);
for (i = 0; i < 0x40; i++)
{
@@ -57,78 +57,78 @@ PALETTE_INIT( rougien )
int g = 0x21 * BIT(color_prom[i], 3) + 0x47 * BIT(color_prom[i], 4) + 0x97 * BIT(color_prom[i], 5);
int b = 0x47 * BIT(color_prom[i], 6) + 0x97 * BIT(color_prom[i], 7);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* blue background */
- colortable_palette_set_color(machine->colortable, 0x40, MAKE_RGB(0, 0, 0));
+ colortable_palette_set_color(machine.colortable, 0x40, MAKE_RGB(0, 0, 0));
/* char/sprite palette */
for (i = 0; i < 0x40; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* background palette */
- colortable_entry_set_value(machine->colortable, 0x40, 0x40);
- colortable_entry_set_value(machine->colortable, 0x41, 0x00);
- colortable_entry_set_value(machine->colortable, 0x42, 0x00);
- colortable_entry_set_value(machine->colortable, 0x43, 0x02);
+ colortable_entry_set_value(machine.colortable, 0x40, 0x40);
+ colortable_entry_set_value(machine.colortable, 0x41, 0x00);
+ colortable_entry_set_value(machine.colortable, 0x42, 0x00);
+ colortable_entry_set_value(machine.colortable, 0x43, 0x02);
}
WRITE8_HANDLER( mermaid_videoram2_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( mermaid_videoram_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( mermaid_colorram_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( mermaid_flip_screen_x_w )
{
- flip_screen_x_set(space->machine, data & 0x01);
+ flip_screen_x_set(space->machine(), data & 0x01);
}
WRITE8_HANDLER( mermaid_flip_screen_y_w )
{
- flip_screen_y_set(space->machine, data & 0x01);
+ flip_screen_y_set(space->machine(), data & 0x01);
}
WRITE8_HANDLER( mermaid_bg_scroll_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->bg_scrollram[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, offset, data);
}
WRITE8_HANDLER( mermaid_fg_scroll_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->fg_scrollram[offset] = data;
tilemap_set_scrolly(state->fg_tilemap, offset, data);
}
WRITE8_HANDLER( rougien_gfxbankswitch1_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->rougien_gfxbank1 = data & 0x01;
}
WRITE8_HANDLER( rougien_gfxbankswitch2_w )
{
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
state->rougien_gfxbank2 = data & 0x01;
}
@@ -149,7 +149,7 @@ READ8_HANDLER( mermaid_collision_r )
Bit 7
*/
- mermaid_state *state = space->machine->driver_data<mermaid_state>();
+ mermaid_state *state = space->machine().driver_data<mermaid_state>();
int collision = 0xff;
if (state->coll_bit0) collision ^= 0x01;
@@ -163,7 +163,7 @@ READ8_HANDLER( mermaid_collision_r )
static TILE_GET_INFO( get_bg_tile_info )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
int code = state->videoram2[tile_index];
int sx = tile_index % 32;
int color = (sx >= 26) ? 0 : 1;
@@ -173,7 +173,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x30) << 4);
int color = attr & 0x0f;
@@ -187,7 +187,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( mermaid )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
@@ -196,13 +196,13 @@ VIDEO_START( mermaid )
tilemap_set_scroll_cols(state->fg_tilemap, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -235,23 +235,23 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea),
- machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
}
}
SCREEN_UPDATE( mermaid )
{
- mermaid_state *state = screen->machine->driver_data<mermaid_state>();
+ mermaid_state *state = screen->machine().driver_data<mermaid_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
-static UINT8 collision_check( running_machine *machine, rectangle* rect )
+static UINT8 collision_check( running_machine &machine, rectangle* rect )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
UINT8 data = 0;
int x;
@@ -260,8 +260,8 @@ static UINT8 collision_check( running_machine *machine, rectangle* rect )
for (y = rect->min_y; y <= rect->max_y; y++)
for (x = rect->min_x; x <= rect->max_x; x++)
{
- UINT16 a = colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper, y, x)) & 0x3f;
- UINT16 b = colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper2, y, x)) & 0x3f;
+ UINT16 a = colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->helper, y, x)) & 0x3f;
+ UINT16 b = colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->helper2, y, x)) & 0x3f;
if (b)
if (a)
@@ -273,8 +273,8 @@ static UINT8 collision_check( running_machine *machine, rectangle* rect )
SCREEN_EOF( mermaid )
{
- mermaid_state *state = machine->driver_data<mermaid_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ mermaid_state *state = machine.driver_data<mermaid_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
UINT8 *spriteram = state->spriteram;
int offs, offs2;
@@ -319,8 +319,8 @@ SCREEN_EOF( mermaid )
rect.min_x = sx;
rect.min_y = sy;
- rect.max_x = sx + machine->gfx[1]->width - 1;
- rect.max_y = sy + machine->gfx[1]->height - 1;
+ rect.max_x = sx + machine.gfx[1]->width - 1;
+ rect.max_y = sy + machine.gfx[1]->height - 1;
if (rect.min_x < visarea.min_x)
rect.min_x = visarea.min_x;
@@ -338,7 +338,7 @@ SCREEN_EOF( mermaid )
tilemap_draw(state->helper, &rect, state->bg_tilemap, 0, 0);
- drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(state->helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
state->coll_bit2 |= collision_check(machine, &rect);
@@ -349,7 +349,7 @@ SCREEN_EOF( mermaid )
tilemap_draw(state->helper, &rect, state->fg_tilemap, 0, 0);
- drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(state->helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
state->coll_bit1 |= collision_check(machine, &rect);
@@ -387,10 +387,10 @@ SCREEN_EOF( mermaid )
sy2 = 240 - sy2;
}
- drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
}
- drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(state->helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
state->coll_bit0 |= collision_check(machine, &rect);
}
@@ -429,8 +429,8 @@ SCREEN_EOF( mermaid )
rect.min_x = sx;
rect.min_y = sy;
- rect.max_x = sx + machine->gfx[1]->width - 1;
- rect.max_y = sy + machine->gfx[1]->height - 1;
+ rect.max_x = sx + machine.gfx[1]->width - 1;
+ rect.max_y = sy + machine.gfx[1]->height - 1;
if (rect.min_x < visarea.min_x)
rect.min_x = visarea.min_x;
@@ -475,10 +475,10 @@ SCREEN_EOF( mermaid )
sy2 = 240 - sy2;
}
- drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
}
- drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(state->helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
state->coll_bit3 |= collision_check(machine, &rect);
}
@@ -517,8 +517,8 @@ SCREEN_EOF( mermaid )
rect.min_x = sx;
rect.min_y = sy;
- rect.max_x = sx + machine->gfx[1]->width - 1;
- rect.max_y = sy + machine->gfx[1]->height - 1;
+ rect.max_x = sx + machine.gfx[1]->width - 1;
+ rect.max_y = sy + machine.gfx[1]->height - 1;
if (rect.min_x < visarea.min_x)
rect.min_x = visarea.min_x;
@@ -563,10 +563,10 @@ SCREEN_EOF( mermaid )
sy2 = 240 - sy2;
}
- drawgfx_transpen(state->helper, &rect, machine->gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
}
- drawgfx_transpen(state->helper2, &rect, machine->gfx[1], code, 0, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(state->helper2, &rect, machine.gfx[1], code, 0, flipx, flipy, sx, sy, 0);
state->coll_bit6 |= collision_check(machine, &rect);
}
diff --git a/src/mame/video/metlclsh.c b/src/mame/video/metlclsh.c
index 45fa31ae3ba..43645301759 100644
--- a/src/mame/video/metlclsh.c
+++ b/src/mame/video/metlclsh.c
@@ -24,23 +24,23 @@
WRITE8_HANDLER( metlclsh_rambank_w )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
if (data & 1)
{
state->write_mask = 0;
- memory_set_bankptr(space->machine, "bank1", state->bgram);
+ memory_set_bankptr(space->machine(), "bank1", state->bgram);
}
else
{
state->write_mask = 1 << (data >> 1);
- memory_set_bankptr(space->machine, "bank1", state->otherram);
+ memory_set_bankptr(space->machine(), "bank1", state->otherram);
}
}
WRITE8_HANDLER( metlclsh_gfxbank_w )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
if (!(data & 4) && (state->gfxbank != data))
{
@@ -73,13 +73,13 @@ static TILEMAP_MAPPER( metlclsh_bgtilemap_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
SET_TILE_INFO(1, state->bgram[tile_index] + (state->gfxbank << 7), 0, 0);
}
WRITE8_HANDLER( metlclsh_bgram_w )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
/* This ram is banked: it's either the tilemap (e401 = 1)
or bit n of another area (e401 = n << 1)? (that I don't understand) */
@@ -117,7 +117,7 @@ WRITE8_HANDLER( metlclsh_bgram_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
UINT8 code = state->fgram[tile_index + 0x000];
UINT8 attr = state->fgram[tile_index + 0x400];
SET_TILE_INFO(2, code + ((attr & 0x03) << 8), (attr >> 5) & 3, 0);
@@ -126,7 +126,7 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE8_HANDLER( metlclsh_fgram_w )
{
- metlclsh_state *state = space->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = space->machine().driver_data<metlclsh_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
@@ -140,7 +140,7 @@ WRITE8_HANDLER( metlclsh_fgram_w )
VIDEO_START( metlclsh )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
state->otherram = auto_alloc_array(machine, UINT8, 0x800); // banked ram
@@ -174,11 +174,11 @@ VIDEO_START( metlclsh )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- metlclsh_state *state = machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = machine.driver_data<metlclsh_state>();
UINT8 *spriteram = state->spriteram;
- gfx_element *gfx = machine->gfx[0];
+ gfx_element *gfx = machine.gfx[0];
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -244,7 +244,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( metlclsh )
{
- metlclsh_state *state = screen->machine->driver_data<metlclsh_state>();
+ metlclsh_state *state = screen->machine().driver_data<metlclsh_state>();
bitmap_fill(bitmap, cliprect, 0x10);
@@ -253,11 +253,11 @@ SCREEN_UPDATE( metlclsh )
if (state->scrollx[0] & 0x08) // background (if enabled)
{
/* The background seems to be always flipped along x */
- tilemap_set_flip(state->bg_tilemap, (flip_screen_get(screen->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
+ tilemap_set_flip(state->bg_tilemap, (flip_screen_get(screen->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0) ^ TILEMAP_FLIPX);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx[1] + ((state->scrollx[0] & 0x02) << 7) );
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
- draw_sprites(screen->machine, bitmap, cliprect); // sprites
+ draw_sprites(screen->machine(), bitmap, cliprect); // sprites
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 2, 0); // high priority tiles of foreground
// popmessage("%02X", state->scrollx[0]);
diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c
index 3dd6e0094a1..865fb28ef8e 100644
--- a/src/mame/video/metro.c
+++ b/src/mame/video/metro.c
@@ -57,7 +57,7 @@ Note: if MAME_DEBUG is defined, pressing Z with:
static TILE_GET_INFO( metro_k053936_get_tile_info )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
int code = state->k053936_ram[tile_index];
SET_TILE_INFO(
@@ -69,7 +69,7 @@ static TILE_GET_INFO( metro_k053936_get_tile_info )
static TILE_GET_INFO( metro_k053936_gstrik2_get_tile_info )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
int code = state->k053936_ram[tile_index];
SET_TILE_INFO(
@@ -81,7 +81,7 @@ static TILE_GET_INFO( metro_k053936_gstrik2_get_tile_info )
WRITE16_HANDLER( metro_k053936_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
COMBINE_DATA(&state->k053936_ram[offset]);
tilemap_mark_tile_dirty(state->k053936_tilemap, offset);
}
@@ -142,9 +142,9 @@ static TILEMAP_MAPPER( tilemap_scan_gstrik2 )
// this looks up a single pixel in a tile, given the code
// the metro hardware has an indirection table, which is used here
// returns if to draw the pixel or not, pixel colour is placed in pix
-INLINE UINT8 get_tile_pix( running_machine *machine, UINT16 code, UINT8 x, UINT8 y, int big, UINT16* pix )
+INLINE UINT8 get_tile_pix( running_machine &machine, UINT16 code, UINT8 x, UINT8 y, int big, UINT16* pix )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
int table_index;
UINT32 tile;
@@ -164,7 +164,7 @@ INLINE UINT8 get_tile_pix( running_machine *machine, UINT16 code, UINT8 x, UINT8
}
else if (((tile & 0x00f00000) == 0x00f00000) && (state->support_8bpp)) /* draw tile as 8bpp */
{
- const gfx_element *gfx1 = machine->gfx[big?3:1];
+ const gfx_element *gfx1 = machine.gfx[big?3:1];
UINT32 tile2 = big ? ((tile & 0xfffff) + 8*(code & 0xf)) :
((tile & 0xfffff) + 2*(code & 0xf));
const UINT8* data;
@@ -197,7 +197,7 @@ INLINE UINT8 get_tile_pix( running_machine *machine, UINT16 code, UINT8 x, UINT8
}
else
{
- const gfx_element *gfx1 = machine->gfx[big?2:0];
+ const gfx_element *gfx1 = machine.gfx[big?2:0];
UINT32 tile2 = big ? ((tile & 0xfffff) + 4*(code & 0xf)) :
((tile & 0xfffff) + (code & 0xf));
const UINT8* data;
@@ -245,21 +245,21 @@ INLINE UINT8 get_tile_pix( running_machine *machine, UINT16 code, UINT8 x, UINT8
}
-INLINE void metro_vram_w( running_machine *machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram )
+INLINE void metro_vram_w( running_machine &machine, offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram )
{
COMBINE_DATA(&vram[offset]);
}
-WRITE16_HANDLER( metro_vram_0_w ) { metro_state *state = space->machine->driver_data<metro_state>(); metro_vram_w(space->machine, offset, data, mem_mask, 0, state->vram_0); }
-WRITE16_HANDLER( metro_vram_1_w ) { metro_state *state = space->machine->driver_data<metro_state>(); metro_vram_w(space->machine, offset, data, mem_mask, 1, state->vram_1); }
-WRITE16_HANDLER( metro_vram_2_w ) { metro_state *state = space->machine->driver_data<metro_state>(); metro_vram_w(space->machine, offset, data, mem_mask, 2, state->vram_2); }
+WRITE16_HANDLER( metro_vram_0_w ) { metro_state *state = space->machine().driver_data<metro_state>(); metro_vram_w(space->machine(), offset, data, mem_mask, 0, state->vram_0); }
+WRITE16_HANDLER( metro_vram_1_w ) { metro_state *state = space->machine().driver_data<metro_state>(); metro_vram_w(space->machine(), offset, data, mem_mask, 1, state->vram_1); }
+WRITE16_HANDLER( metro_vram_2_w ) { metro_state *state = space->machine().driver_data<metro_state>(); metro_vram_w(space->machine(), offset, data, mem_mask, 2, state->vram_2); }
/* Dirty the relevant tilemap when its window changes */
WRITE16_HANDLER( metro_window_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
+ metro_state *state = space->machine().driver_data<metro_state>();
COMBINE_DATA(&state->window[offset]);
}
@@ -286,7 +286,7 @@ WRITE16_HANDLER( metro_window_w )
VIDEO_START( metro_14100 )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->support_8bpp = 0;
state->support_16x16 = 0;
@@ -307,7 +307,7 @@ VIDEO_START( metro_14100 )
VIDEO_START( metro_14220 )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->support_8bpp = 1;
state->support_16x16 = 0;
@@ -328,7 +328,7 @@ VIDEO_START( metro_14220 )
VIDEO_START( metro_14300 )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
state->support_8bpp = 1;
state->support_16x16 = 1;
@@ -349,7 +349,7 @@ VIDEO_START( metro_14300 )
VIDEO_START( blzntrnd )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
VIDEO_START_CALL(metro_14220);
@@ -364,7 +364,7 @@ VIDEO_START( blzntrnd )
VIDEO_START( gstrik2 )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
VIDEO_START_CALL(metro_14220);
@@ -439,14 +439,14 @@ VIDEO_START( gstrik2 )
/* Draw sprites */
-void metro_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+void metro_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- metro_state *state = machine->driver_data<metro_state>();
- UINT8 *base_gfx = machine->region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine->region("gfx1")->bytes();
+ metro_state *state = machine.driver_data<metro_state>();
+ UINT8 *base_gfx = machine.region("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
int max_sprites = state->spriteram_size / 8;
int sprites = state->videoregs[0x00/2] % max_sprites;
@@ -546,7 +546,7 @@ void metro_draw_sprites( running_machine *machine, bitmap_t *bitmap, const recta
flipx, flipy,
x, y,
zoom, zoom,
- machine->priority_bitmap,primask[pri], 255);
+ machine.priority_bitmap,primask[pri], 255);
}
else
{
@@ -562,7 +562,7 @@ void metro_draw_sprites( running_machine *machine, bitmap_t *bitmap, const recta
flipx, flipy,
x, y,
zoom, zoom,
- machine->priority_bitmap,primask[pri], 15);
+ machine.priority_bitmap,primask[pri], 15);
}
#if 0
{ /* Display priority + zoom on each sprite */
@@ -589,13 +589,13 @@ void metro_draw_sprites( running_machine *machine, bitmap_t *bitmap, const recta
/* copy a 'window' from the large 2048x2048 (or 4096x4096 for 16x16 tiles) tilemap */
-static void draw_tilemap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 pcode,
+static void draw_tilemap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 pcode,
int sx, int sy, int wx, int wy, int big, UINT16* tilemapram, int layer )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
int y;
- bitmap_t *priority_bitmap = machine->priority_bitmap;
+ bitmap_t *priority_bitmap = machine.priority_bitmap;
int width = big ? 4096 : 2048;//pixdata->width;
int height = big ? 4096 : 2048;//pixdata->height;
@@ -686,9 +686,9 @@ static void draw_tilemap( running_machine *machine, bitmap_t *bitmap, const rect
}
/* Draw all the layers that match the given priority */
-static void draw_layers( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
+static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
{
- metro_state *state = machine->driver_data<metro_state>();
+ metro_state *state = machine.driver_data<metro_state>();
UINT16 layers_pri = state->videoregs[0x10 / 2];
int layer;
@@ -722,7 +722,7 @@ static void draw_layers( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( metro )
{
- metro_state *state = screen->machine->driver_data<metro_state>();
+ metro_state *state = screen->machine().driver_data<metro_state>();
int pri, layers_ctrl = -1;
UINT16 screenctrl = *state->screenctrl;
@@ -730,7 +730,7 @@ SCREEN_UPDATE( metro )
state->sprite_yoffs = state->videoregs[0x04 / 2] - screen->height() / 2;
/* The background color is selected by a register */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, ((state->videoregs[0x12/2] & 0x0fff)) + 0x1000);
/* Screen Control Register:
@@ -747,7 +747,7 @@ SCREEN_UPDATE( metro )
if (screenctrl & 2)
return 0;
- //flip_screen_set(screen->machine, screenctrl & 1);
+ //flip_screen_set(screen->machine(), screenctrl & 1);
state->flip_screen = screenctrl & 1;
/* If the game supports 16x16 tiles, make sure that the
@@ -768,13 +768,13 @@ SCREEN_UPDATE( metro )
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0)
{
bitmap_fill(bitmap, cliprect, 0);
@@ -792,9 +792,9 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->k053936_tilemap, 0, 0, 1);
for (pri = 3; pri >= 0; pri--)
- draw_layers(screen->machine, bitmap, cliprect, pri, layers_ctrl);
+ draw_layers(screen->machine(), bitmap, cliprect, pri, layers_ctrl);
if (layers_ctrl & 0x08)
- metro_draw_sprites(screen->machine, bitmap, cliprect);
+ metro_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mexico86.c b/src/mame/video/mexico86.c
index 96165d7d408..93cd889dfa6 100644
--- a/src/mame/video/mexico86.c
+++ b/src/mame/video/mexico86.c
@@ -4,12 +4,12 @@
WRITE8_HANDLER( mexico86_bankswitch_w )
{
- mexico86_state *state = space->machine->driver_data<mexico86_state>();
+ mexico86_state *state = space->machine().driver_data<mexico86_state>();
if ((data & 7) > 5)
popmessage("Switching to invalid bank!");
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
state->charbank = BIT(data, 5);
}
@@ -18,7 +18,7 @@ WRITE8_HANDLER( mexico86_bankswitch_w )
SCREEN_UPDATE( mexico86 )
{
- mexico86_state *state = screen->machine->driver_data<mexico86_state>();
+ mexico86_state *state = screen->machine().driver_data<mexico86_state>();
int offs;
int sx, sy, xc, yc;
int gfx_num, gfx_attr, gfx_offs;
@@ -88,7 +88,7 @@ SCREEN_UPDATE( mexico86 )
x = (sx + xc * 8) & 0xff;
y = (sy + yc * 8) & 0xff;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
color,
flipx,flipy,
@@ -101,7 +101,7 @@ SCREEN_UPDATE( mexico86 )
SCREEN_UPDATE( kikikai )
{
- mexico86_state *state = screen->machine->driver_data<mexico86_state>();
+ mexico86_state *state = screen->machine().driver_data<mexico86_state>();
int offs;
int sx, sy, yc;
int gfx_num, /*gfx_attr,*/ gfx_offs;
@@ -109,7 +109,7 @@ SCREEN_UPDATE( kikikai )
int goffs, code, color, y;
int tx, ty;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
sx = 0;
for (offs = 0; offs < state->objectram_size; offs += 4)
{
@@ -147,7 +147,7 @@ SCREEN_UPDATE( kikikai )
color = (state->videoram[goffs + 1] & 0xe0) >> 5;
goffs += 0x40;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
color,
0,0,
@@ -156,7 +156,7 @@ SCREEN_UPDATE( kikikai )
code = state->videoram[goffs] + ((state->videoram[goffs + 1] & 0x1f) << 8);
color = (state->videoram[goffs + 1] & 0xe0) >> 5;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
color,
0,0,
diff --git a/src/mame/video/micro3d.c b/src/mame/video/micro3d.c
index fafa347003e..af47bdceef9 100644
--- a/src/mame/video/micro3d.c
+++ b/src/mame/video/micro3d.c
@@ -37,7 +37,7 @@ enum
VIDEO_START( micro3d )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
/* Allocate 512x12 x 2 3D frame buffers */
state->frame_buffers[0] = auto_alloc_array(machine, UINT16, 1024 * 512);
@@ -48,7 +48,7 @@ VIDEO_START( micro3d )
VIDEO_RESET( micro3d )
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
state->pipeline_state = 0;
state->creg = 0;
@@ -66,7 +66,7 @@ VIDEO_RESET( micro3d )
void micro3d_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- micro3d_state *state = screen.machine->driver_data<micro3d_state>();
+ micro3d_state *state = screen.machine().driver_data<micro3d_state>();
UINT16 *src = &state->micro3d_sprite_vram[(params->rowaddr << 8) & 0x7fe00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
@@ -111,31 +111,31 @@ WRITE16_HANDLER( micro3d_clut_w )
{
UINT16 word;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- word = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(word >> 6), pal5bit(word >> 1), pal5bit(word >> 11));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ word = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(word >> 6), pal5bit(word >> 1), pal5bit(word >> 11));
}
WRITE16_HANDLER( micro3d_creg_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
if (~data & 0x80)
- cputag_set_input_line(space->machine, "vgb", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "vgb", 0, CLEAR_LINE);
state->creg = data;
}
WRITE16_HANDLER( micro3d_xfer3dk_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->xfer3dk = data;
}
void micro3d_tms_interrupt(device_t *device, int state)
{
-// mc68901_int_gen(device->machine, GPIP4);
+// mc68901_int_gen(device->machine(), GPIP4);
}
@@ -648,7 +648,7 @@ bc000000-1fc DPRAM address for read access
WRITE32_HANDLER( micro3d_fifo_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
UINT32 opcode = data >> 24;
switch (state->draw_state)
@@ -674,7 +674,7 @@ WRITE32_HANDLER( micro3d_fifo_w )
{
UINT32 dpram_r_addr = (((data & 0x01ff) << 1) | state->dpram_bank);
state->pipe_data = state->draw_dpram[dpram_r_addr];
- cputag_set_input_line(space->machine, "drmath", AM29000_INTR1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "drmath", AM29000_INTR1, ASSERT_LINE);
break;
}
case 0x80:
@@ -702,7 +702,7 @@ WRITE32_HANDLER( micro3d_fifo_w )
/* TODO: We shouldn't need this extra buffer - is there some sort of sync missing? */
memcpy(state->frame_buffers[state->drawing_buffer], state->tmp_buffer, 512*1024*2);
state->drawing_buffer ^= 1;
- cputag_set_input_line(space->machine, "vgb", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "vgb", 0, ASSERT_LINE);
break;
}
default:
@@ -749,23 +749,23 @@ WRITE32_HANDLER( micro3d_fifo_w )
WRITE32_HANDLER( micro3d_alt_fifo_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->vtx_fifo[state->fifo_idx++] = VTX_SEX(data);
}
READ32_HANDLER( micro3d_pipe_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
- cputag_set_input_line(space->machine, "drmath", AM29000_INTR1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "drmath", AM29000_INTR1, CLEAR_LINE);
return state->pipe_data;
}
INTERRUPT_GEN( micro3d_vblank )
{
-// mc68901_int_gen(device->machine, GPIP7);
- micro3d_state *state = device->machine->driver_data<micro3d_state>();
+// mc68901_int_gen(device->machine(), GPIP7);
+ micro3d_state *state = device->machine().driver_data<micro3d_state>();
state->display_buffer = state->drawing_buffer ^ 1;
}
diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c
index 31350fb4542..704d2d031c0 100644
--- a/src/mame/video/midtunit.c
+++ b/src/mame/video/midtunit.c
@@ -297,9 +297,9 @@ WRITE16_HANDLER( midtunit_paletteram_w )
{
//int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- //newword = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ //newword = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
@@ -312,7 +312,7 @@ WRITE16_HANDLER( midxunit_paletteram_w )
READ16_HANDLER( midxunit_paletteram_r )
{
- return space->machine->generic.paletteram.u16[offset / 2];
+ return space->machine().generic.paletteram.u16[offset / 2];
}
@@ -679,7 +679,7 @@ WRITE16_HANDLER( midtunit_dma_w )
/* high bit triggers action */
command = dma_register[DMA_COMMAND];
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
if (!(command & 0x8000))
return;
@@ -715,7 +715,7 @@ WRITE16_HANDLER( midtunit_dma_w )
if (LOG_DMA)
{
- if (input_code_pressed(space->machine, KEYCODE_L))
+ if (input_code_pressed(space->machine(), KEYCODE_L))
{
logerror("DMA command %04X: (bpp=%d skip=%d xflip=%d yflip=%d preskip=%d postskip=%d)\n",
command, (command >> 12) & 7, (command >> 7) & 1, (command >> 4) & 1, (command >> 5) & 1, (command >> 8) & 3, (command >> 10) & 3);
@@ -789,7 +789,7 @@ if (LOG_DMA)
/* signal we're done */
skipdma:
- space->machine->scheduler().timer_set(attotime::from_nsec(41 * pixels), FUNC(dma_callback));
+ space->machine().scheduler().timer_set(attotime::from_nsec(41 * pixels), FUNC(dma_callback));
g_profiler.stop();
}
diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c
index 4a4308763cd..6c9d6296d99 100644
--- a/src/mame/video/midvunit.c
+++ b/src/mame/video/midvunit.c
@@ -42,14 +42,14 @@ struct _poly_extra_data
static TIMER_CALLBACK( scanline_timer_cb )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
int scanline = param;
if (scanline != -1)
{
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline + 1), scanline);
- machine->scheduler().timer_set(attotime::from_hz(25000000), FUNC(scanline_timer_cb), -1);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline + 1), scanline);
+ machine.scheduler().timer_set(attotime::from_hz(25000000), FUNC(scanline_timer_cb), -1);
}
else
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
@@ -65,10 +65,10 @@ static void midvunit_exit(running_machine &machine)
VIDEO_START( midvunit )
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_timer_cb));
+ midvunit_state *state = machine.driver_data<midvunit_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_timer_cb));
state->poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, midvunit_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, midvunit_exit);
state_save_register_global_array(machine, state->video_regs);
state_save_register_global_array(machine, state->dma_data);
@@ -290,9 +290,9 @@ static void make_vertices_inclusive(poly_vertex *vert)
}
-static void process_dma_queue(running_machine *machine)
+static void process_dma_queue(running_machine &machine)
{
- midvunit_state *state = machine->driver_data<midvunit_state>();
+ midvunit_state *state = machine.driver_data<midvunit_state>();
poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->poly);
UINT16 *dest = &state->videoram[(state->page_control & 4) ? 0x40000 : 0x00000];
int textured = ((state->dma_data[0] & 0x300) == 0x100);
@@ -356,7 +356,7 @@ static void process_dma_queue(running_machine *machine)
extra->dither = ((state->dma_data[0] & 0x2000) != 0);
/* render as a quad */
- poly_render_quad(state->poly, dest, &machine->primary_screen->visible_area(), callback, textured ? 2 : 0, &vert[0], &vert[1], &vert[2], &vert[3]);
+ poly_render_quad(state->poly, dest, &machine.primary_screen->visible_area(), callback, textured ? 2 : 0, &vert[0], &vert[1], &vert[2], &vert[3]);
}
@@ -369,8 +369,8 @@ static void process_dma_queue(running_machine *machine)
WRITE32_HANDLER( midvunit_dma_queue_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
- if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L))
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
+ if (LOG_DMA && input_code_pressed(space->machine(), KEYCODE_L))
logerror("%06X:queue(%X) = %08X\n", cpu_get_pc(space->cpu), state->dma_data_index, data);
if (state->dma_data_index < 16)
state->dma_data[state->dma_data_index++] = data;
@@ -386,12 +386,12 @@ READ32_HANDLER( midvunit_dma_queue_entries_r )
READ32_HANDLER( midvunit_dma_trigger_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
if (offset)
{
- if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L))
+ if (LOG_DMA && input_code_pressed(space->machine(), KEYCODE_L))
logerror("%06X:trigger\n", cpu_get_pc(space->cpu));
- process_dma_queue(space->machine);
+ process_dma_queue(space->machine());
state->dma_data_index = 0;
}
return 0;
@@ -407,14 +407,14 @@ READ32_HANDLER( midvunit_dma_trigger_r )
WRITE32_HANDLER( midvunit_page_control_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
/* watch for the display page to change */
if ((state->page_control ^ data) & 1)
{
state->video_changed = TRUE;
- if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L))
+ if (LOG_DMA && input_code_pressed(space->machine(), KEYCODE_L))
logerror("##########################################################\n");
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
}
state->page_control = data;
}
@@ -422,7 +422,7 @@ WRITE32_HANDLER( midvunit_page_control_w )
READ32_HANDLER( midvunit_page_control_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
return state->page_control;
}
@@ -436,7 +436,7 @@ READ32_HANDLER( midvunit_page_control_r )
WRITE32_HANDLER( midvunit_video_control_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT16 old = state->video_regs[offset];
/* update the data */
@@ -444,7 +444,7 @@ WRITE32_HANDLER( midvunit_video_control_w )
/* update the scanline timer */
if (offset == 0)
- state->scanline_timer->adjust(space->machine->primary_screen->time_until_pos((data & 0x1ff) + 1, 0), data & 0x1ff);
+ state->scanline_timer->adjust(space->machine().primary_screen->time_until_pos((data & 0x1ff) + 1, 0), data & 0x1ff);
/* if something changed, update our parameters */
if (old != state->video_regs[offset] && state->video_regs[6] != 0 && state->video_regs[11] != 0)
@@ -456,14 +456,14 @@ WRITE32_HANDLER( midvunit_video_control_w )
visarea.max_x = (state->video_regs[6] + state->video_regs[2] - state->video_regs[5]) % state->video_regs[6];
visarea.min_y = 0;
visarea.max_y = (state->video_regs[11] + state->video_regs[7] - state->video_regs[10]) % state->video_regs[11];
- space->machine->primary_screen->configure(state->video_regs[6], state->video_regs[11], visarea, HZ_TO_ATTOSECONDS(MIDVUNIT_VIDEO_CLOCK / 2) * state->video_regs[6] * state->video_regs[11]);
+ space->machine().primary_screen->configure(state->video_regs[6], state->video_regs[11], visarea, HZ_TO_ATTOSECONDS(MIDVUNIT_VIDEO_CLOCK / 2) * state->video_regs[6] * state->video_regs[11]);
}
}
READ32_HANDLER( midvunit_scanline_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -476,7 +476,7 @@ READ32_HANDLER( midvunit_scanline_r )
WRITE32_HANDLER( midvunit_videoram_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
poly_wait(state->poly, "Video RAM write");
if (!state->video_changed)
{
@@ -490,7 +490,7 @@ WRITE32_HANDLER( midvunit_videoram_w )
READ32_HANDLER( midvunit_videoram_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
poly_wait(state->poly, "Video RAM read");
return state->videoram[offset];
}
@@ -507,9 +507,9 @@ WRITE32_HANDLER( midvunit_paletteram_w )
{
int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- newword = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ newword = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
}
@@ -522,7 +522,7 @@ WRITE32_HANDLER( midvunit_paletteram_w )
WRITE32_HANDLER( midvunit_textureram_w )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT8 *base = (UINT8 *)state->textureram;
poly_wait(state->poly, "Texture RAM write");
base[offset * 2] = data;
@@ -532,7 +532,7 @@ WRITE32_HANDLER( midvunit_textureram_w )
READ32_HANDLER( midvunit_textureram_r )
{
- midvunit_state *state = space->machine->driver_data<midvunit_state>();
+ midvunit_state *state = space->machine().driver_data<midvunit_state>();
UINT8 *base = (UINT8 *)state->textureram;
return (base[offset * 2 + 1] << 8) | base[offset * 2];
}
@@ -548,7 +548,7 @@ READ32_HANDLER( midvunit_textureram_r )
SCREEN_UPDATE( midvunit )
{
- midvunit_state *state = screen->machine->driver_data<midvunit_state>();
+ midvunit_state *state = screen->machine().driver_data<midvunit_state>();
int x, y, width, xoffs;
UINT32 offset;
diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c
index 6b9089a4edf..562999069ca 100644
--- a/src/mame/video/midyunit.c
+++ b/src/mame/video/midyunit.c
@@ -39,13 +39,13 @@ enum
static VIDEO_START( common )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
/* allocate memory */
state->cmos_ram = auto_alloc_array(machine, UINT16, (0x2000 * 4)/2);
state->local_videoram = auto_alloc_array_clear(machine, UINT16, 0x80000/2);
state->pen_map = auto_alloc_array(machine, pen_t, 65536);
- machine->device<nvram_device>("nvram")->set_base(state->cmos_ram, 0x2000 * 4);
+ machine.device<nvram_device>("nvram")->set_base(state->cmos_ram, 0x2000 * 4);
/* reset all the globals */
state->cmos_page = 0;
@@ -67,7 +67,7 @@ static VIDEO_START( common )
VIDEO_START( midyunit_4bit )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
VIDEO_START_CALL(common);
@@ -81,7 +81,7 @@ VIDEO_START( midyunit_4bit )
VIDEO_START( midyunit_6bit )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
VIDEO_START_CALL(common);
@@ -95,7 +95,7 @@ VIDEO_START( midyunit_6bit )
VIDEO_START( mkyawdim )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
VIDEO_START_CALL(midyunit_6bit);
state->yawdim_dma = 1;
}
@@ -103,7 +103,7 @@ VIDEO_START( mkyawdim )
VIDEO_START( midzunit )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
int i;
VIDEO_START_CALL(common);
@@ -124,7 +124,7 @@ VIDEO_START( midzunit )
READ16_HANDLER( midyunit_gfxrom_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
offset *= 2;
if (state->palette_mask == 0x00ff)
return state->gfx_rom[offset] | (state->gfx_rom[offset] << 4) |
@@ -143,7 +143,7 @@ READ16_HANDLER( midyunit_gfxrom_r )
WRITE16_HANDLER( midyunit_vram_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
offset *= 2;
if (state->videobank_select)
{
@@ -164,7 +164,7 @@ WRITE16_HANDLER( midyunit_vram_w )
READ16_HANDLER( midyunit_vram_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
offset *= 2;
if (state->videobank_select)
return (state->local_videoram[offset] & 0x00ff) | (state->local_videoram[offset + 1] << 8);
@@ -182,14 +182,14 @@ READ16_HANDLER( midyunit_vram_r )
void midyunit_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
memcpy(shiftreg, &state->local_videoram[address >> 3], 2 * 512 * sizeof(UINT16));
}
void midyunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
memcpy(&state->local_videoram[address >> 3], shiftreg, 2 * 512 * sizeof(UINT16));
}
@@ -203,7 +203,7 @@ void midyunit_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftr
WRITE16_HANDLER( midyunit_control_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
/*
* Narc system register
* ------------------
@@ -241,12 +241,12 @@ WRITE16_HANDLER( midyunit_control_w )
WRITE16_HANDLER( midyunit_paletteram_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset & state->palette_mask, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset & state->palette_mask, pal5bit(newword >> 10), pal5bit(newword >> 5), pal5bit(newword >> 0));
}
@@ -257,9 +257,9 @@ WRITE16_HANDLER( midyunit_paletteram_w )
*
*************************************/
-static void dma_draw(running_machine *machine, UINT16 command)
+static void dma_draw(running_machine &machine, UINT16 command)
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
struct dma_state_t &dma_state = state->dma_state;
int dx = (command & 0x10) ? -1 : 1;
int height = dma_state.height;
@@ -371,7 +371,7 @@ static void dma_draw(running_machine *machine, UINT16 command)
static TIMER_CALLBACK( dma_callback )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
state->dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
@@ -386,7 +386,7 @@ static TIMER_CALLBACK( dma_callback )
READ16_HANDLER( midyunit_dma_r )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
return state->dma_register[offset];
}
@@ -425,7 +425,7 @@ READ16_HANDLER( midyunit_dma_r )
WRITE16_HANDLER( midyunit_dma_w )
{
- midyunit_state *state = space->machine->driver_data<midyunit_state>();
+ midyunit_state *state = space->machine().driver_data<midyunit_state>();
struct dma_state_t &dma_state = state->dma_state;
UINT32 gfxoffset;
int command;
@@ -439,13 +439,13 @@ WRITE16_HANDLER( midyunit_dma_w )
/* high bit triggers action */
command = state->dma_register[DMA_COMMAND];
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
if (!(command & 0x8000))
return;
if (LOG_DMA)
{
- if (input_code_pressed(space->machine, KEYCODE_L))
+ if (input_code_pressed(space->machine(), KEYCODE_L))
{
logerror("----\n");
logerror("DMA command %04X: (xflip=%d yflip=%d)\n",
@@ -525,11 +525,11 @@ if (LOG_DMA)
gfxoffset += 0x02000000;
{
dma_state.offset = gfxoffset - 0x02000000;
- dma_draw(space->machine, command);
+ dma_draw(space->machine(), command);
}
/* signal we're done */
- space->machine->scheduler().timer_set(attotime::from_nsec(41 * dma_state.width * dma_state.height), FUNC(dma_callback));
+ space->machine().scheduler().timer_set(attotime::from_nsec(41 * dma_state.width * dma_state.height), FUNC(dma_callback));
g_profiler.stop();
}
@@ -544,7 +544,7 @@ if (LOG_DMA)
static TIMER_CALLBACK( autoerase_line )
{
- midyunit_state *state = machine->driver_data<midyunit_state>();
+ midyunit_state *state = machine.driver_data<midyunit_state>();
int scanline = param;
if (state->autoerase_enable && scanline >= 0 && scanline < 510)
@@ -554,7 +554,7 @@ static TIMER_CALLBACK( autoerase_line )
void midyunit_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- midyunit_state *state = screen.machine->driver_data<midyunit_state>();
+ midyunit_state *state = screen.machine().driver_data<midyunit_state>();
UINT16 *src = &state->local_videoram[(params->rowaddr << 9) & 0x3fe00];
UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0);
int coladdr = params->coladdr << 1;
@@ -565,10 +565,10 @@ void midyunit_scanline_update(screen_device &screen, bitmap_t *bitmap, int scanl
dest[x] = state->pen_map[src[coladdr++ & 0x1ff]];
/* handle autoerase on the previous line */
- autoerase_line(screen.machine, NULL, params->rowaddr - 1);
+ autoerase_line(screen.machine(), NULL, params->rowaddr - 1);
/* if this is the last update of the screen, set a timer to clear out the final line */
/* (since we update one behind) */
if (scanline == screen.visible_area().max_y)
- screen.machine->scheduler().timer_set(screen.time_until_pos(scanline + 1), FUNC(autoerase_line), params->rowaddr);
+ screen.machine().scheduler().timer_set(screen.time_until_pos(scanline + 1), FUNC(autoerase_line), params->rowaddr);
}
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index df75f1a8f74..bf220d0654f 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -85,12 +85,12 @@ static int texel_width;
static void exit_handler(running_machine &machine);
static void zeus_pointer_w(UINT32 which, UINT32 data, int logit);
-static void zeus_register16_w(running_machine *machine, offs_t offset, UINT16 data, int logit);
-static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 data, int logit);
-static void zeus_register_update(running_machine *machine, offs_t offset);
-static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords);
-static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit);
-static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit);
+static void zeus_register16_w(running_machine &machine, offs_t offset, UINT16 data, int logit);
+static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit);
+static void zeus_register_update(running_machine &machine, offs_t offset);
+static int zeus_fifo_process(running_machine &machine, const UINT32 *data, int numwords);
+static void zeus_draw_model(running_machine &machine, UINT32 texdata, int logit);
+static void zeus_draw_quad(running_machine &machine, const UINT32 *databuffer, UINT32 texdata, int logit);
static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
@@ -259,7 +259,7 @@ VIDEO_START( midzeus )
poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
/* we need to cleanup on exit */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, exit_handler);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, exit_handler);
yoffs = 0;
texel_width = 256;
@@ -317,7 +317,7 @@ SCREEN_UPDATE( midzeus )
poly_wait(poly, "VIDEO_UPDATE");
/* normal update case */
- if (!input_code_pressed(screen->machine, KEYCODE_W))
+ if (!input_code_pressed(screen->machine(), KEYCODE_W))
{
const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]);
int xoffs = screen->visible_area().min_x;
@@ -334,10 +334,10 @@ SCREEN_UPDATE( midzeus )
{
const void *base;
- if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1;
- if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1;
- if (input_code_pressed(screen->machine, KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; }
- if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; }
+ if (input_code_pressed(screen->machine(), KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine(), KEYCODE_LSHIFT) ? 0x40 : 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine(), KEYCODE_LSHIFT) ? 0x40 : 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (input_code_pressed(screen->machine(), KEYCODE_LEFT)) ; }
+ if (input_code_pressed(screen->machine(), KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (input_code_pressed(screen->machine(), KEYCODE_RIGHT)) ; }
if (yoffs < 0) yoffs = 0;
base = waveram0_ptr_from_block_addr(yoffs << 12);
@@ -373,18 +373,18 @@ READ32_HANDLER( zeus_r )
switch (offset & ~1)
{
case 0xf0:
- result = space->machine->primary_screen->hpos();
+ result = space->machine().primary_screen->hpos();
logit = 0;
break;
case 0xf2:
- result = space->machine->primary_screen->vpos();
+ result = space->machine().primary_screen->vpos();
logit = 0;
break;
case 0xf4:
result = 6;
- if (space->machine->primary_screen->vblank())
+ if (space->machine().primary_screen->vblank())
result |= 0x800;
logit = 0;
break;
@@ -444,11 +444,11 @@ WRITE32_HANDLER( zeus_w )
/* 32-bit mode */
if (zeusbase[0x80] & 0x00020000)
- zeus_register32_w(space->machine, offset, data, logit);
+ zeus_register32_w(space->machine(), offset, data, logit);
/* 16-bit mode */
else
- zeus_register16_w(space->machine, offset, data, logit);
+ zeus_register16_w(space->machine(), offset, data, logit);
}
@@ -522,11 +522,11 @@ static void zeus_pointer_w(UINT32 which, UINT32 data, int logit)
*
*************************************/
-static void zeus_register16_w(running_machine *machine, offs_t offset, UINT16 data, int logit)
+static void zeus_register16_w(running_machine &machine, offs_t offset, UINT16 data, int logit)
{
/* writes to register $CC need to force a partial update */
if ((offset & ~1) == 0xcc)
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* write to high part on odd addresses */
if (offset & 1)
@@ -546,11 +546,11 @@ static void zeus_register16_w(running_machine *machine, offs_t offset, UINT16 da
}
-static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 data, int logit)
+static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit)
{
/* writes to register $CC need to force a partial update */
if ((offset & ~1) == 0xcc)
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* always write to low word? */
zeusbase[offset & ~1] = data;
@@ -579,7 +579,7 @@ static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 da
*
*************************************/
-static void zeus_register_update(running_machine *machine, offs_t offset)
+static void zeus_register_update(running_machine &machine, offs_t offset)
{
/* handle the writes; only trigger on low accesses */
switch (offset)
@@ -717,7 +717,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
case 0xc6:
case 0xc8:
case 0xca:
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
{
int vtotal = zeusbase[0xca] >> 16;
int htotal = zeusbase[0xc6] >> 16;
@@ -729,7 +729,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
visarea.max_y = zeusbase[0xc8] & 0xffff;
if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
{
- machine->primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 8.0 / (htotal * vtotal)));
+ machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 8.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
@@ -738,7 +738,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
break;
case 0xcc:
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
log_fifo = input_code_pressed(machine, KEYCODE_L);
break;
@@ -758,7 +758,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
*
*************************************/
-static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords)
+static int zeus_fifo_process(running_machine &machine, const UINT32 *data, int numwords)
{
/* handle logging */
switch (data[0] >> 24)
@@ -959,7 +959,7 @@ static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int n
*
*************************************/
-static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit)
+static void zeus_draw_model(running_machine &machine, UINT32 texdata, int logit)
{
UINT32 databuffer[32];
int databufcount = 0;
@@ -1057,7 +1057,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit)
*
*************************************/
-static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit)
+static void zeus_draw_quad(running_machine &machine, const UINT32 *databuffer, UINT32 texdata, int logit)
{
poly_draw_scanline_func callback;
poly_extra_data *extra;
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index b0fadc57944..ed0745104b6 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -104,12 +104,12 @@ static int subregwrite_count[0x100];
static void exit_handler(running_machine &machine);
-static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 data, int logit);
-static void zeus_register_update(running_machine *machine, offs_t offset, UINT32 oldval, int logit);
+static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit);
+static void zeus_register_update(running_machine &machine, offs_t offset, UINT32 oldval, int logit);
static void zeus_pointer_write(UINT8 which, UINT32 value);
-static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords);
-static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 count, int logit);
-static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit);
+static int zeus_fifo_process(running_machine &machine, const UINT32 *data, int numwords);
+static void zeus_draw_model(running_machine &machine, UINT32 baseaddr, UINT16 count, int logit);
+static void zeus_draw_quad(running_machine &machine, const UINT32 *databuffer, UINT32 texoffs, int logit);
static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
static void log_fifo_command(const UINT32 *data, int numwords, const char *suffix);
@@ -273,14 +273,14 @@ VIDEO_START( midzeus2 )
poly = poly_alloc(machine, 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
/* we need to cleanup on exit */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, exit_handler);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, exit_handler);
zbase = 2.0f;
yoffs = 0;
texel_width = 256;
zeus_renderbase = waveram[1];
- int_timer = machine->scheduler().timer_alloc(FUNC(int_timer_callback));
+ int_timer = machine.scheduler().timer_alloc(FUNC(int_timer_callback));
/* save states */
state_save_register_global_pointer(machine, waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0]));
@@ -364,11 +364,11 @@ SCREEN_UPDATE( midzeus2 )
poly_wait(poly, "VIDEO_UPDATE");
-if (input_code_pressed(screen->machine, KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); }
-if (input_code_pressed(screen->machine, KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); }
+if (input_code_pressed(screen->machine(), KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); }
+if (input_code_pressed(screen->machine(), KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); }
/* normal update case */
- if (!input_code_pressed(screen->machine, KEYCODE_W))
+ if (!input_code_pressed(screen->machine(), KEYCODE_W))
{
const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]);
int xoffs = screen->visible_area().min_x;
@@ -385,10 +385,10 @@ if (input_code_pressed(screen->machine, KEYCODE_DOWN)) { zbase -= 1.0f; popmessa
{
const UINT64 *base;
- if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1;
- if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1;
- if (input_code_pressed(screen->machine, KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; }
- if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; }
+ if (input_code_pressed(screen->machine(), KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine(), KEYCODE_LSHIFT) ? 0x40 : 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine(), KEYCODE_LSHIFT) ? 0x40 : 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_LEFT) && texel_width > 4) { texel_width >>= 1; while (input_code_pressed(screen->machine(), KEYCODE_LEFT)) ; }
+ if (input_code_pressed(screen->machine(), KEYCODE_RIGHT) && texel_width < 512) { texel_width <<= 1; while (input_code_pressed(screen->machine(), KEYCODE_RIGHT)) ; }
if (yoffs < 0) yoffs = 0;
base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16);
@@ -439,7 +439,7 @@ READ32_HANDLER( zeus2_r )
/* bits $00080000 is tested in a loop until 0 */
/* bit $00000004 is tested for toggling; probably VBLANK */
result = 0x00;
- if (space->machine->primary_screen->vblank())
+ if (space->machine().primary_screen->vblank())
result |= 0x04;
break;
@@ -450,7 +450,7 @@ READ32_HANDLER( zeus2_r )
case 0x54:
/* both upper 16 bits and lower 16 bits seem to be used as vertical counters */
- result = (space->machine->primary_screen->vpos() << 16) | space->machine->primary_screen->vpos();
+ result = (space->machine().primary_screen->vpos() << 16) | space->machine().primary_screen->vpos();
break;
}
@@ -473,7 +473,7 @@ WRITE32_HANDLER( zeus2_w )
offset != 0x50 && offset != 0x51 && offset != 0x57 && offset != 0x58 && offset != 0x59 && offset != 0x5a && offset != 0x5e);
if (logit)
logerror("%06X:zeus2_w", cpu_get_pc(space->cpu));
- zeus_register32_w(space->machine, offset, data, logit);
+ zeus_register32_w(space->machine(), offset, data, logit);
}
@@ -484,7 +484,7 @@ WRITE32_HANDLER( zeus2_w )
*
*************************************/
-static void zeus_register32_w(running_machine *machine, offs_t offset, UINT32 data, int logit)
+static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 data, int logit)
{
UINT32 oldval = zeusbase[offset];
@@ -509,7 +509,7 @@ if (regdata_count[offset] < 256)
/* writes to register $CC need to force a partial update */
// if ((offset & ~1) == 0xcc)
-// machine->primary_screen->update_partial(machine->primary_screen->vpos());
+// machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* always write to low word? */
zeusbase[offset] = data;
@@ -530,7 +530,7 @@ if (regdata_count[offset] < 256)
*
*************************************/
-static void zeus_register_update(running_machine *machine, offs_t offset, UINT32 oldval, int logit)
+static void zeus_register_update(running_machine &machine, offs_t offset, UINT32 oldval, int logit)
{
/* handle the writes; only trigger on low accesses */
switch (offset)
@@ -560,7 +560,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32
case 0x35:
case 0x36:
case 0x37:
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
{
int vtotal = zeusbase[0x37] & 0xffff;
int htotal = zeusbase[0x34] >> 16;
@@ -572,7 +572,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32
visarea.max_y = zeusbase[0x35] & 0xffff;
if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
{
- machine->primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
+ machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
@@ -584,7 +584,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset, UINT32
{
UINT32 temp = zeusbase[0x38];
zeusbase[0x38] = oldval;
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
log_fifo = input_code_pressed(machine, KEYCODE_L);
zeusbase[0x38] = temp;
}
@@ -776,7 +776,7 @@ if (subregdata_count[which] < 256)
*
*************************************/
-static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords)
+static int zeus_fifo_process(running_machine &machine, const UINT32 *data, int numwords)
{
int dataoffs = 0;
@@ -935,7 +935,7 @@ static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int n
*
*************************************/
-static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 count, int logit)
+static void zeus_draw_model(running_machine &machine, UINT32 baseaddr, UINT16 count, int logit)
{
UINT32 databuffer[32];
int databufcount = 0;
@@ -1040,7 +1040,7 @@ static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 co
*
*************************************/
-static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit)
+static void zeus_draw_quad(running_machine &machine, const UINT32 *databuffer, UINT32 texoffs, int logit)
{
poly_draw_scanline_func callback;
poly_extra_data *extra;
diff --git a/src/mame/video/mikie.c b/src/mame/video/mikie.c
index 56527202333..800eb7875dc 100644
--- a/src/mame/video/mikie.c
+++ b/src/mame/video/mikie.c
@@ -39,7 +39,7 @@ PALETTE_INIT( mikie )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( mikie )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -82,14 +82,14 @@ PALETTE_INIT( mikie )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
WRITE8_HANDLER( mikie_videoram_w )
{
- mikie_state *state = space->machine->driver_data<mikie_state>();
+ mikie_state *state = space->machine().driver_data<mikie_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -97,7 +97,7 @@ WRITE8_HANDLER( mikie_videoram_w )
WRITE8_HANDLER( mikie_colorram_w )
{
- mikie_state *state = space->machine->driver_data<mikie_state>();
+ mikie_state *state = space->machine().driver_data<mikie_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -105,27 +105,27 @@ WRITE8_HANDLER( mikie_colorram_w )
WRITE8_HANDLER( mikie_palettebank_w )
{
- mikie_state *state = space->machine->driver_data<mikie_state>();
+ mikie_state *state = space->machine().driver_data<mikie_state>();
if (state->palettebank != (data & 0x07))
{
state->palettebank = data & 0x07;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( mikie_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- mikie_state *state = machine->driver_data<mikie_state>();
+ mikie_state *state = machine.driver_data<mikie_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x20) << 3);
int color = (state->colorram[tile_index] & 0x0f) + 16 * state->palettebank;
int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
@@ -141,13 +141,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mikie )
{
- mikie_state *state = machine->driver_data<mikie_state>();
+ mikie_state *state = machine.driver_data<mikie_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- mikie_state *state = machine->driver_data<mikie_state>();
+ mikie_state *state = machine.driver_data<mikie_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -168,7 +168,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[gfxbank],
+ machine.gfx[gfxbank],
code, color,
flipx,flipy,
sx,sy, 0);
@@ -177,9 +177,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( mikie )
{
- mikie_state *state = screen->machine->driver_data<mikie_state>();
+ mikie_state *state = screen->machine().driver_data<mikie_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_CATEGORY(0), 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_CATEGORY(1), 0);
return 0;
}
diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c
index 267951d0ecf..357dd302f25 100644
--- a/src/mame/video/mitchell.c
+++ b/src/mame/video/mitchell.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_tile_info )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
UINT8 attr = state->colorram[tile_index];
int code = state->videoram[2 * tile_index] + (state->videoram[2 * tile_index + 1] << 8);
SET_TILE_INFO(
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( pang )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 15);
@@ -45,10 +45,10 @@ VIDEO_START( pang )
state->objram = auto_alloc_array_clear(machine, UINT8, state->videoram_size);
/* Palette RAM */
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 2 * machine->total_colors());
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 2 * machine.total_colors());
state->save_pointer(NAME(state->objram), state->videoram_size);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 2 * machine->total_colors());
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 2 * machine.total_colors());
}
@@ -65,7 +65,7 @@ VIDEO_START( pang )
WRITE8_HANDLER( pang_video_bank_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
/* Bank handler (sets base pointers for video write) (doesn't apply to mgakuen) */
state->video_bank = data;
@@ -73,7 +73,7 @@ WRITE8_HANDLER( pang_video_bank_w )
WRITE8_HANDLER( mstworld_video_bank_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
/* Monsters World seems to freak out if more bits are used.. */
state->video_bank = data & 1;
@@ -82,7 +82,7 @@ WRITE8_HANDLER( mstworld_video_bank_w )
WRITE8_HANDLER( mgakuen_videoram_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -90,25 +90,25 @@ WRITE8_HANDLER( mgakuen_videoram_w )
READ8_HANDLER( mgakuen_videoram_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( mgakuen_objram_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
state->objram[offset] = data;
}
READ8_HANDLER( mgakuen_objram_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
return state->objram[offset];
}
WRITE8_HANDLER( pang_videoram_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
if (state->video_bank)
mgakuen_objram_w(space, offset, data);
@@ -118,7 +118,7 @@ WRITE8_HANDLER( pang_videoram_w )
READ8_HANDLER( pang_videoram_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
if (state->video_bank)
return mgakuen_objram_r(space, offset);
@@ -132,7 +132,7 @@ READ8_HANDLER( pang_videoram_r )
WRITE8_HANDLER( pang_colorram_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -140,7 +140,7 @@ WRITE8_HANDLER( pang_colorram_w )
READ8_HANDLER( pang_colorram_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
return state->colorram[offset];
}
@@ -150,7 +150,7 @@ READ8_HANDLER( pang_colorram_r )
WRITE8_HANDLER( pang_gfxctrl_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
{
@@ -164,13 +164,13 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0 is unknown (used, maybe back color enable?) */
/* bit 1 is coin counter */
- coin_counter_w(space->machine, 0, data & 2);
+ coin_counter_w(space->machine(), 0, data & 2);
/* bit 2 is flip screen */
if (state->flipscreen != (data & 0x04))
{
state->flipscreen = data & 0x04;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
/* bit 3 is unknown (used, e.g. marukin pulses it on the title screen) */
@@ -190,7 +190,7 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
WRITE8_HANDLER( pangbl_gfxctrl_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
{
@@ -204,13 +204,13 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0 is unknown (used, maybe back color enable?) */
/* bit 1 is coin counter */
- coin_counter_w(space->machine, 0, data & 2);
+ coin_counter_w(space->machine(), 0, data & 2);
/* bit 2 is flip screen */
if (state->flipscreen != (data & 0x04))
{
state->flipscreen = data & 0x04;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
/* bit 3 is unknown (used, e.g. marukin pulses it on the title screen) */
@@ -228,7 +228,7 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
WRITE8_HANDLER( mstworld_gfxctrl_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
{
@@ -240,13 +240,13 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
/* bit 0 is unknown (used, maybe back color enable?) */
/* bit 1 is coin counter */
- coin_counter_w(space->machine, 0, data & 2);
+ coin_counter_w(space->machine(), 0, data & 2);
/* bit 2 is flip screen */
if (state->flipscreen != (data & 0x04))
{
state->flipscreen = data & 0x04;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
/* bit 3 is unknown (used, e.g. marukin pulses it on the title screen) */
@@ -264,7 +264,7 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data);
WRITE8_HANDLER( pang_paletteram_w )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
if (state->paletteram_bank)
paletteram_xxxxRRRRGGGGBBBB_le_w(space, offset + 0x800, data);
@@ -274,12 +274,12 @@ WRITE8_HANDLER( pang_paletteram_w )
READ8_HANDLER( pang_paletteram_r )
{
- mitchell_state *state = space->machine->driver_data<mitchell_state>();
+ mitchell_state *state = space->machine().driver_data<mitchell_state>();
if (state->paletteram_bank)
- return space->machine->generic.paletteram.u8[offset + 0x800];
+ return space->machine().generic.paletteram.u8[offset + 0x800];
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
WRITE8_HANDLER( mgakuen_paletteram_w )
@@ -289,7 +289,7 @@ WRITE8_HANDLER( mgakuen_paletteram_w )
READ8_HANDLER( mgakuen_paletteram_r )
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
@@ -300,9 +300,9 @@ READ8_HANDLER( mgakuen_paletteram_r )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mitchell_state *state = machine->driver_data<mitchell_state>();
+ mitchell_state *state = machine.driver_data<mitchell_state>();
int offs, sx, sy;
/* the last entry is not a sprite, we skip it otherwise spang shows a bubble */
@@ -320,7 +320,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sx = 496 - sx;
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
state->flipscreen, state->flipscreen,
@@ -330,10 +330,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( pang )
{
- mitchell_state *state = screen->machine->driver_data<mitchell_state>();
+ mitchell_state *state = screen->machine().driver_data<mitchell_state>();
bitmap_fill(bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c
index d3b1299bee4..fe3a517622d 100644
--- a/src/mame/video/mjkjidai.c
+++ b/src/mame/video/mjkjidai.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_tile_info )
{
- mjkjidai_state *state = machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
int attr = state->videoram[tile_index + 0x800];
int code = state->videoram[tile_index] + ((attr & 0x1f) << 8);
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( mjkjidai )
{
- mjkjidai_state *state = machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,64,32);
}
@@ -42,7 +42,7 @@ VIDEO_START( mjkjidai )
WRITE8_HANDLER( mjkjidai_videoram_w )
{
- mjkjidai_state *state = space->machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = space->machine().driver_data<mjkjidai_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
@@ -50,8 +50,8 @@ WRITE8_HANDLER( mjkjidai_videoram_w )
WRITE8_HANDLER( mjkjidai_ctrl_w )
{
- mjkjidai_state *state = space->machine->driver_data<mjkjidai_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ mjkjidai_state *state = space->machine().driver_data<mjkjidai_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
// logerror("%04x: port c0 = %02x\n",cpu_get_pc(space->cpu),data);
@@ -59,23 +59,23 @@ WRITE8_HANDLER( mjkjidai_ctrl_w )
interrupt_enable_w(space,0,data & 1);
/* bit 1 = flip screen */
- flip_screen_set(space->machine, data & 0x02);
+ flip_screen_set(space->machine(), data & 0x02);
/* bit 2 =display enable */
state->display_enable = data & 0x04;
/* bit 5 = coin counter */
- coin_counter_w(space->machine, 0,data & 0x20);
+ coin_counter_w(space->machine(), 0,data & 0x20);
/* bits 6-7 select ROM bank */
if (data & 0xc0)
{
- memory_set_bankptr(space->machine, "bank1",rom + 0x10000-0x4000 + ((data & 0xc0) << 8));
+ memory_set_bankptr(space->machine(), "bank1",rom + 0x10000-0x4000 + ((data & 0xc0) << 8));
}
else
{
/* there is code flowing from 7fff to this bank so they have to be contiguous in memory */
- memory_set_bankptr(space->machine, "bank1",rom + 0x08000);
+ memory_set_bankptr(space->machine(), "bank1",rom + 0x08000);
}
}
@@ -87,9 +87,9 @@ WRITE8_HANDLER( mjkjidai_ctrl_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- mjkjidai_state *state = machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
UINT8 *spriteram = state->spriteram1;
UINT8 *spriteram_2 = state->spriteram2;
UINT8 *spriteram_3 = state->spriteram3;
@@ -119,7 +119,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx += 16;
sy += 1;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -131,13 +131,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( mjkjidai )
{
- mjkjidai_state *state = screen->machine->driver_data<mjkjidai_state>();
+ mjkjidai_state *state = screen->machine().driver_data<mjkjidai_state>();
if (!state->display_enable)
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
else
{
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
}
return 0;
}
diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c
index 5eb5ca56f75..5d528f78e1f 100644
--- a/src/mame/video/model1.c
+++ b/src/mame/video/model1.c
@@ -454,10 +454,10 @@ static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle *c
fill_quad(bitmap, view, q);
#if 0
- draw_line(bitmap, get_black_pen(screen->machine), q->p[0]->s.x, q->p[0]->s.y, q->p[1]->s.x, q->p[1]->s.y);
- draw_line(bitmap, get_black_pen(screen->machine), q->p[1]->s.x, q->p[1]->s.y, q->p[2]->s.x, q->p[2]->s.y);
- draw_line(bitmap, get_black_pen(screen->machine), q->p[2]->s.x, q->p[2]->s.y, q->p[3]->s.x, q->p[3]->s.y);
- draw_line(bitmap, get_black_pen(screen->machine), q->p[3]->s.x, q->p[3]->s.y, q->p[0]->s.x, q->p[0]->s.y);
+ draw_line(bitmap, get_black_pen(screen->machine()), q->p[0]->s.x, q->p[0]->s.y, q->p[1]->s.x, q->p[1]->s.y);
+ draw_line(bitmap, get_black_pen(screen->machine()), q->p[1]->s.x, q->p[1]->s.y, q->p[2]->s.x, q->p[2]->s.y);
+ draw_line(bitmap, get_black_pen(screen->machine()), q->p[2]->s.x, q->p[2]->s.y, q->p[3]->s.x, q->p[3]->s.y);
+ draw_line(bitmap, get_black_pen(screen->machine()), q->p[3]->s.x, q->p[3]->s.y, q->p[0]->s.x, q->p[0]->s.y);
#endif
}
@@ -724,9 +724,9 @@ static float compute_specular(struct vector *normal, struct vector *light,float
return 0;
}
-static void push_object(running_machine *machine, UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
+static void push_object(running_machine &machine, UINT32 tex_adr, UINT32 poly_adr, UINT32 size)
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
struct view *view = state->view;
int i;
UINT32 flags;
@@ -896,8 +896,8 @@ static void push_object(running_machine *machine, UINT32 tex_adr, UINT32 poly_ad
#if 0
float dif=mult_vector(&vn, &view->light);
float ln=view->lightparams[lightmode].a + view->lightparams[lightmode].d*MAX(0.0,dif);
- cquad.col = scale_color(machine->pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
- cquad.col = scale_color(machine->pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
+ cquad.col = scale_color(machine.pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
+ cquad.col = scale_color(machine.pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)], MIN(1.0,ln));
#endif
float dif=mult_vector(&vn, &view->light);
float spec=compute_specular(&vn,&view->light,dif,lightmode);
@@ -1073,7 +1073,7 @@ static UINT16 *push_direct(model1_state *state, UINT16 *list)
b=(state->color_xlat[(b<<8)|lumval|0x4000]>>3)&0x1f;
cquad.col=(r<<10)|(g<<5)|(b<<0);
}
- //cquad.col = scale_color(machine->pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)],((float) (lum>>24)) / 128.0);
+ //cquad.col = scale_color(machine.pens[0x1000|(state->tgp_ram[tex_adr-0x40000] & 0x3ff)],((float) (lum>>24)) / 128.0);
if(flags & 0x00002000)
cquad.col |= MOIRE;
@@ -1161,16 +1161,16 @@ static int get_list_number(model1_state *state)
return state->listctl[0] & 0x40 ? 0 : 1;
}
-static void end_frame(running_machine *machine)
+static void end_frame(running_machine &machine)
{
- model1_state *state = machine->driver_data<model1_state>();
- if((state->listctl[0] & 4) && (machine->primary_screen->frame_number() & 1))
+ model1_state *state = machine.driver_data<model1_state>();
+ if((state->listctl[0] & 4) && (machine.primary_screen->frame_number() & 1))
state->listctl[0] ^= 0x40;
}
READ16_HANDLER( model1_listctl_r )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
if(!offset)
return state->listctl[0] | 0x30;
else
@@ -1179,14 +1179,14 @@ READ16_HANDLER( model1_listctl_r )
WRITE16_HANDLER( model1_listctl_w )
{
- model1_state *state = space->machine->driver_data<model1_state>();
+ model1_state *state = space->machine().driver_data<model1_state>();
COMBINE_DATA(state->listctl+offset);
LOG_TGP(("VIDEO: control=%08x\n", (state->listctl[1]<<16)|state->listctl[0]));
}
-static void tgp_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void tgp_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
struct view *view = state->view;
state->render_done = 1;
if((state->listctl[1] & 0x1f) == 0x1f) {
@@ -1338,9 +1338,9 @@ static void tgp_render(running_machine *machine, bitmap_t *bitmap, const rectang
}
}
-static void tgp_scan(running_machine *machine)
+static void tgp_scan(running_machine &machine)
{
- model1_state *state = machine->driver_data<model1_state>();
+ model1_state *state = machine.driver_data<model1_state>();
struct view *view = state->view;
#if 0
if (input_code_pressed_once(machine, KEYCODE_F))
@@ -1447,14 +1447,14 @@ static void tgp_scan(running_machine *machine)
VIDEO_START(model1)
{
- model1_state *state = machine->driver_data<model1_state>();
- state->paletteram16 = machine->generic.paletteram.u16;
+ model1_state *state = machine.driver_data<model1_state>();
+ state->paletteram16 = machine.generic.paletteram.u16;
state->view = auto_alloc_clear(machine, struct view);
sys24_tile_vh_start(machine, 0x3fff);
- state->poly_rom = (UINT32 *)machine->region("user1")->base();
+ state->poly_rom = (UINT32 *)machine.region("user1")->base();
state->poly_ram = auto_alloc_array_clear(machine, UINT32, 0x400000);
state->tgp_ram = auto_alloc_array_clear(machine, UINT16, 0x100000-0x40000);
state->pointdb = auto_alloc_array_clear(machine, struct point, 1000000*2);
@@ -1472,7 +1472,7 @@ VIDEO_START(model1)
SCREEN_UPDATE(model1)
{
- model1_state *state = screen->machine->driver_data<model1_state>();
+ model1_state *state = screen->machine().driver_data<model1_state>();
struct view *view = state->view;
#if 0
{
@@ -1480,35 +1480,35 @@ SCREEN_UPDATE(model1)
double delta;
delta = 1;
- if(input_code_pressed(screen->machine, KEYCODE_F)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_F)) {
mod = 1;
view->vxx -= delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_G)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_G)) {
mod = 1;
view->vxx += delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_H)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_H)) {
mod = 1;
view->vyy -= delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_J)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_J)) {
mod = 1;
view->vyy += delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_K)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_K)) {
mod = 1;
view->vzz -= delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_L)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_L)) {
mod = 1;
view->vzz += delta;
}
- if(input_code_pressed(screen->machine, KEYCODE_U)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_U)) {
mod = 1;
view->ayy -= 0.05;
}
- if(input_code_pressed(screen->machine, KEYCODE_I)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_I)) {
mod = 1;
view->ayy += 0.05;
}
@@ -1520,20 +1520,20 @@ SCREEN_UPDATE(model1)
view->ayyc = cos(view->ayy);
view->ayys = sin(view->ayy);
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 6, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 4, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 2, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 0, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 6, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 4, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 2, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 0, 0, 0);
- tgp_render(screen->machine, bitmap, cliprect);
+ tgp_render(screen->machine(), bitmap, cliprect);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 7, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 5, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 3, 0, 0);
- sys24_tile_draw(screen->machine, bitmap, cliprect, 1, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 7, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 5, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 3, 0, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, 1, 0, 0);
return 0;
}
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index 500ac52c12f..c7c3085e328 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -328,9 +328,9 @@ struct _raster_state
*
*******************************************/
-static void model2_3d_init( running_machine *machine, UINT16 *texture_rom )
+static void model2_3d_init( running_machine &machine, UINT16 *texture_rom )
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
state->raster = auto_alloc_clear( machine, raster_state );
@@ -343,9 +343,9 @@ static void model2_3d_init( running_machine *machine, UINT16 *texture_rom )
*
*******************************************/
-void model2_3d_set_zclip( running_machine *machine, UINT8 clip )
+void model2_3d_set_zclip( running_machine &machine, UINT8 clip )
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
state->raster->master_z_clip = clip;
}
@@ -1313,9 +1313,9 @@ struct _geo_state
*
*******************************************/
-static void geo_init( running_machine *machine, UINT32 *polygon_rom )
+static void geo_init( running_machine &machine, UINT32 *polygon_rom )
{
- model2_state *state = machine->driver_data<model2_state>();
+ model2_state *state = machine.driver_data<model2_state>();
state->geo = auto_alloc_clear(machine, geo_state);
state->geo->raster = state->raster;
@@ -2707,8 +2707,8 @@ static void model2_exit(running_machine &machine)
VIDEO_START(model2)
{
- model2_state *state = machine->driver_data<model2_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ model2_state *state = machine.driver_data<model2_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int width = visarea.max_x - visarea.min_x;
int height = visarea.max_y - visarea.min_y;
@@ -2716,16 +2716,16 @@ VIDEO_START(model2)
state->sys24_bitmap = auto_alloc(machine, bitmap_t(width, height+4, BITMAP_FORMAT_INDEXED16));
state->poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, model2_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, model2_exit);
/* initialize the hardware rasterizer */
- model2_3d_init( machine, (UINT16*)machine->region("user3")->base() );
+ model2_3d_init( machine, (UINT16*)machine.region("user3")->base() );
/* initialize the geometry engine */
- geo_init( machine, (UINT32*)machine->region("user2")->base() );
+ geo_init( machine, (UINT32*)machine.region("user2")->base() );
}
-static void convert_bitmap( running_machine *machine, bitmap_t *dst, bitmap_t *src, const rectangle *rect )
+static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *src, const rectangle *rect )
{
int x, y;
@@ -2737,25 +2737,25 @@ static void convert_bitmap( running_machine *machine, bitmap_t *dst, bitmap_t *s
for( x = rect->min_x; x < rect->max_x; x++ )
{
if ( s[x] )
- d[x] = machine->pens[s[x]];
+ d[x] = machine.pens[s[x]];
}
}
}
SCREEN_UPDATE(model2)
{
- model2_state *state = screen->machine->driver_data<model2_state>();
+ model2_state *state = screen->machine().driver_data<model2_state>();
logerror("--- frame ---\n");
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
bitmap_fill(state->sys24_bitmap, cliprect, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 7, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 6, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 5, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 4, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 7, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 6, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 5, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 4, 0, 0);
- convert_bitmap(screen->machine, bitmap, state->sys24_bitmap, cliprect);
+ convert_bitmap(screen->machine(), bitmap, state->sys24_bitmap, cliprect);
/* tell the rasterizer we're starting a frame */
model2_3d_frame_start(state);
@@ -2767,12 +2767,12 @@ SCREEN_UPDATE(model2)
model2_3d_frame_end( state, bitmap, cliprect );
bitmap_fill(state->sys24_bitmap, cliprect, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 3, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 2, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 1, 0, 0);
- sys24_tile_draw(screen->machine, state->sys24_bitmap, cliprect, 0, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 3, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 2, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 1, 0, 0);
+ sys24_tile_draw(screen->machine(), state->sys24_bitmap, cliprect, 0, 0, 0);
- convert_bitmap(screen->machine, bitmap, state->sys24_bitmap, cliprect);
+ convert_bitmap(screen->machine(), bitmap, state->sys24_bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index f043153b750..9d521a515e8 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -54,18 +54,18 @@ struct _poly_extra_data
/* forward declarations */
-static void real3d_traverse_display_list(running_machine *machine);
-static void draw_model(running_machine *machine, UINT32 addr);
-static void init_matrix_stack(running_machine *machine);
+static void real3d_traverse_display_list(running_machine &machine);
+static void draw_model(running_machine &machine, UINT32 addr);
+static void init_matrix_stack(running_machine &machine);
static void get_top_matrix(model3_state *state, MATRIX *out);
static void push_matrix_stack(model3_state *state);
static void pop_matrix_stack(model3_state *state);
static void multiply_matrix_stack(model3_state *state, MATRIX matrix);
static void translate_matrix_stack(model3_state *state, float x, float y, float z);
-static void traverse_list(running_machine *machine, UINT32 address);
-static void draw_block(running_machine *machine, UINT32 address);
-static void draw_viewport(running_machine *machine, int pri, UINT32 address);
-static void invalidate_texture(running_machine *machine, int page, int texx, int texy, int texwidth, int texheight);
+static void traverse_list(running_machine &machine, UINT32 address);
+static void draw_block(running_machine &machine, UINT32 address);
+static void draw_viewport(running_machine &machine, int pri, UINT32 address);
+static void invalidate_texture(running_machine &machine, int page, int texx, int texy, int texwidth, int texheight);
/*****************************************************************************/
@@ -109,22 +109,22 @@ static const int num_bits[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4
static void model3_exit(running_machine &machine)
{
model3_state *state = machine.driver_data<model3_state>();
- invalidate_texture(&machine, 0, 0, 0, 6, 5);
- invalidate_texture(&machine, 1, 0, 0, 6, 5);
+ invalidate_texture(machine, 0, 0, 0, 6, 5);
+ invalidate_texture(machine, 1, 0, 0, 6, 5);
poly_free(state->poly);
}
VIDEO_START( model3 )
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int width, height;
state->poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, model3_exit);
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
- state->bitmap3d = machine->primary_screen->alloc_compatible_bitmap();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
+ state->bitmap3d = machine.primary_screen->alloc_compatible_bitmap();
state->zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED32);
state->m3_char_ram = auto_alloc_array_clear(machine, UINT64, 0x100000/8);
@@ -158,9 +158,9 @@ VIDEO_START( model3 )
init_matrix_stack(machine);
}
-static void draw_tile_4bit(running_machine *machine, bitmap_t *bitmap, int tx, int ty, int tilenum)
+static void draw_tile_4bit(running_machine &machine, bitmap_t *bitmap, int tx, int ty, int tilenum)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int x, y;
UINT8 *tile_base = (UINT8*)state->m3_char_ram;
UINT8 *tile;
@@ -194,9 +194,9 @@ static void draw_tile_4bit(running_machine *machine, bitmap_t *bitmap, int tx, i
}
}
-static void draw_tile_8bit(running_machine *machine, bitmap_t *bitmap, int tx, int ty, int tilenum)
+static void draw_tile_8bit(running_machine &machine, bitmap_t *bitmap, int tx, int ty, int tilenum)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int x, y;
UINT8 *tile_base = (UINT8*)state->m3_char_ram;
UINT8 *tile;
@@ -226,9 +226,9 @@ static void draw_tile_8bit(running_machine *machine, bitmap_t *bitmap, int tx, i
}
}
#ifdef UNUSED_FUNCTION
-static void draw_texture_sheet(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_texture_sheet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int x,y;
for(y = cliprect->min_y; y <= cliprect->max_y; y++)
{
@@ -245,9 +245,9 @@ static void draw_texture_sheet(running_machine *machine, bitmap_t *bitmap, const
}
#endif
-static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int bitdepth)
+static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int bitdepth)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int x, y;
int tile_index = 0;
UINT16 *tiles = (UINT16*)&state->m3_tile_ram[layer * 0x400];
@@ -321,9 +321,9 @@ static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectang
}
#ifdef UNUSED_FUNCTION
-static void copy_screen(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int x,y;
for(y=cliprect->min_y; y <= cliprect->max_y; y++) {
UINT16 *d = BITMAP_ADDR16(bitmap, y, 0);
@@ -340,7 +340,7 @@ static void copy_screen(running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( model3 )
{
- model3_state *state = screen->machine->driver_data<model3_state>();
+ model3_state *state = screen->machine().driver_data<model3_state>();
#if 0
int layer_scroll_x[4], layer_scroll_y[4];
UINT32 layer_data[4];
@@ -370,25 +370,25 @@ SCREEN_UPDATE( model3 )
if( state->tick >= 5 ) {
state->tick = 0;
- if( input_code_pressed(screen->machine, KEYCODE_Y) )
+ if( input_code_pressed(screen->machine(), KEYCODE_Y) )
state->debug_layer_disable ^= 0x1;
- if( input_code_pressed(screen->machine, KEYCODE_U) )
+ if( input_code_pressed(screen->machine(), KEYCODE_U) )
state->debug_layer_disable ^= 0x2;
- if( input_code_pressed(screen->machine, KEYCODE_I) )
+ if( input_code_pressed(screen->machine(), KEYCODE_I) )
state->debug_layer_disable ^= 0x4;
- if( input_code_pressed(screen->machine, KEYCODE_O) )
+ if( input_code_pressed(screen->machine(), KEYCODE_O) )
state->debug_layer_disable ^= 0x8;
- if( input_code_pressed(screen->machine, KEYCODE_T) )
+ if( input_code_pressed(screen->machine(), KEYCODE_T) )
state->debug_layer_disable ^= 0x10;
}
bitmap_fill(bitmap, cliprect, 0);
if (!(state->debug_layer_disable & 0x8))
- draw_layer(screen->machine, bitmap, cliprect, 3, (state->layer_enable >> 3) & 0x1);
+ draw_layer(screen->machine(), bitmap, cliprect, 3, (state->layer_enable >> 3) & 0x1);
if (!(state->debug_layer_disable & 0x4))
- draw_layer(screen->machine, bitmap, cliprect, 2, (state->layer_enable >> 2) & 0x1);
+ draw_layer(screen->machine(), bitmap, cliprect, 2, (state->layer_enable >> 2) & 0x1);
if( !(state->debug_layer_disable & 0x10) )
{
@@ -396,17 +396,17 @@ SCREEN_UPDATE( model3 )
if(state->real3d_display_list) {
bitmap_fill(state->zbuffer, cliprect, 0);
bitmap_fill(state->bitmap3d, cliprect, 0x8000);
- real3d_traverse_display_list(screen->machine);
+ real3d_traverse_display_list(screen->machine());
}
#endif
copybitmap_trans(bitmap, state->bitmap3d, 0, 0, 0, 0, cliprect, 0x8000);
}
if (!(state->debug_layer_disable & 0x2))
- draw_layer(screen->machine, bitmap, cliprect, 1, (state->layer_enable >> 1) & 0x1);
+ draw_layer(screen->machine(), bitmap, cliprect, 1, (state->layer_enable >> 1) & 0x1);
if (!(state->debug_layer_disable & 0x1))
- draw_layer(screen->machine, bitmap, cliprect, 0, (state->layer_enable >> 0) & 0x1);
+ draw_layer(screen->machine(), bitmap, cliprect, 0, (state->layer_enable >> 0) & 0x1);
//copy_screen(bitmap, cliprect);
@@ -420,31 +420,31 @@ SCREEN_UPDATE( model3 )
READ64_HANDLER(model3_char_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
return state->m3_char_ram[offset];
}
WRITE64_HANDLER(model3_char_w)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
COMBINE_DATA(&state->m3_char_ram[offset]);
}
READ64_HANDLER(model3_tile_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
return state->m3_tile_ram[offset];
}
WRITE64_HANDLER(model3_tile_w)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
COMBINE_DATA(&state->m3_tile_ram[offset]);
}
READ64_HANDLER(model3_vid_reg_r)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 0x00/8: return state->vid_reg0;
@@ -458,12 +458,12 @@ READ64_HANDLER(model3_vid_reg_r)
WRITE64_HANDLER(model3_vid_reg_w)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
switch(offset)
{
case 0x00/8: logerror("vid_reg0: %08X%08X\n", (UINT32)(data>>32),(UINT32)(data)); state->vid_reg0 = data; break;
case 0x08/8: break; /* ??? */
- case 0x10/8: model3_set_irq_line(space->machine, (data >> 56) & 0x0f, CLEAR_LINE); break; /* VBL IRQ Ack */
+ case 0x10/8: model3_set_irq_line(space->machine(), (data >> 56) & 0x0f, CLEAR_LINE); break; /* VBL IRQ Ack */
case 0x20/8: state->layer_enable = (data >> 52); break;
@@ -478,7 +478,7 @@ WRITE64_HANDLER(model3_vid_reg_w)
WRITE64_HANDLER( model3_palette_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
int r1,g1,b1,r2,g2,b2;
UINT32 data1,data2;
@@ -499,7 +499,7 @@ WRITE64_HANDLER( model3_palette_w )
READ64_HANDLER( model3_palette_r )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
return state->paletteram64[offset];
}
@@ -514,9 +514,9 @@ READ64_HANDLER( model3_palette_r )
1024 pixels / 32 pixel resolution vertically
2048 pixels / 32 pixel resolution horizontally
*/
-static void invalidate_texture(running_machine *machine, int page, int texx, int texy, int texwidth, int texheight)
+static void invalidate_texture(running_machine &machine, int page, int texx, int texy, int texwidth, int texheight)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int wtiles = 1 << texwidth;
int htiles = 1 << texheight;
int x, y;
@@ -531,9 +531,9 @@ static void invalidate_texture(running_machine *machine, int page, int texx, int
}
}
-static cached_texture *get_texture(running_machine *machine, int page, int texx, int texy, int texwidth, int texheight, int format)
+static cached_texture *get_texture(running_machine &machine, int page, int texx, int texy, int texwidth, int texheight, int format)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
cached_texture *tex = state->texcache[page][texy][texx];
int pixheight = 32 << texheight;
int pixwidth = 32 << texwidth;
@@ -649,7 +649,7 @@ static cached_texture *get_texture(running_machine *machine, int page, int texx,
WRITE64_HANDLER( real3d_display_list_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(ACCESSING_BITS_32_63) {
state->display_list_ram[offset*2] = BYTE_REVERSE32((UINT32)(data >> 32));
}
@@ -660,7 +660,7 @@ WRITE64_HANDLER( real3d_display_list_w )
WRITE64_HANDLER( real3d_polygon_ram_w )
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if(ACCESSING_BITS_32_63) {
state->polygon_ram[offset*2] = BYTE_REVERSE32((UINT32)(data >> 32));
}
@@ -726,9 +726,9 @@ INLINE void write_texture8(model3_state *state, int xpos, int ypos, int width, i
}
#endif
-static void real3d_upload_texture(running_machine *machine, UINT32 header, UINT32 *data)
+static void real3d_upload_texture(running_machine &machine, UINT32 header, UINT32 *data)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int width = 32 << ((header >> 14) & 0x7);
int height = 32 << ((header >> 17) & 0x7);
int xpos = (header & 0x3f) * 32;
@@ -768,9 +768,9 @@ static void real3d_upload_texture(running_machine *machine, UINT32 header, UINT3
}
}
-void real3d_display_list_end(running_machine *machine)
+void real3d_display_list_end(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
/* upload textures if there are any in the FIFO */
if (state->texture_fifo_pos > 0)
{
@@ -792,7 +792,7 @@ void real3d_display_list_end(running_machine *machine)
void real3d_display_list1_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
@@ -809,7 +809,7 @@ void real3d_display_list1_dma(address_space *space, UINT32 src, UINT32 dst, int
void real3d_display_list2_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
@@ -826,7 +826,7 @@ void real3d_display_list2_dma(address_space *space, UINT32 src, UINT32 dst, int
void real3d_vrom_texture_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
if((dst & 0xff) == 0) {
UINT32 address, header;
@@ -838,13 +838,13 @@ void real3d_vrom_texture_dma(address_space *space, UINT32 src, UINT32 dst, int l
address = space->read_dword((src+0));
header = space->read_dword((src+4));
}
- real3d_upload_texture(space->machine, header, (UINT32*)&state->vrom[address]);
+ real3d_upload_texture(space->machine(), header, (UINT32*)&state->vrom[address]);
}
}
void real3d_texture_fifo_dma(address_space *space, UINT32 src, int length, int byteswap)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
int i;
for(i=0; i < length; i+=4) {
UINT32 w;
@@ -861,7 +861,7 @@ void real3d_texture_fifo_dma(address_space *space, UINT32 src, int length, int b
void real3d_polygon_ram_dma(address_space *space, UINT32 src, UINT32 dst, int length, int byteswap)
{
- model3_state *state = space->machine->driver_data<model3_state>();
+ model3_state *state = space->machine().driver_data<model3_state>();
int i;
int d = (dst & 0xffffff) / 4;
for(i=0; i < length; i+=4) {
@@ -878,7 +878,7 @@ void real3d_polygon_ram_dma(address_space *space, UINT32 src, UINT32 dst, int le
WRITE64_HANDLER( real3d_cmd_w )
{
- real3d_display_list_end(space->machine);
+ real3d_display_list_end(space->machine());
}
@@ -920,9 +920,9 @@ static void matrix_multiply(MATRIX a, MATRIX b, MATRIX *out)
memcpy(out, &tmp, sizeof(MATRIX));
}
-static void init_matrix_stack(running_machine *machine)
+static void init_matrix_stack(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
MATRIX *matrix_stack;
matrix_stack = state->matrix_stack = auto_alloc_array_clear(machine, MATRIX, MATRIX_STACK_SIZE);
@@ -1060,9 +1060,9 @@ static int clip_polygon(const poly_vertex *v, int num_vertices, PLANE cp, poly_v
return clip_verts;
}
-static void render_one(running_machine *machine, TRIANGLE *tri)
+static void render_one(running_machine &machine, TRIANGLE *tri)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->poly);
poly_draw_scanline_func callback = NULL;
@@ -1103,9 +1103,9 @@ static void render_one(running_machine *machine, TRIANGLE *tri)
}
}
-static void draw_model(running_machine *machine, UINT32 addr)
+static void draw_model(running_machine &machine, UINT32 addr)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
UINT32 *model = (addr >= 0x100000) ? &state->vrom[addr] : &state->polygon_ram[addr];
UINT32 header[7];
int index = 0;
@@ -1377,9 +1377,9 @@ static void load_matrix(model3_state *state, int matrix_num, MATRIX *out)
(*out)[3][0] = matrix[0]; (*out)[3][1] = matrix[1]; (*out)[3][2] = matrix[2]; (*out)[3][3] = 1.0f;
}
-static void traverse_list4(running_machine *machine, int lod_num, UINT32 address)
+static void traverse_list4(running_machine &machine, int lod_num, UINT32 address)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
/* does something with the LOD selection */
UINT32 *list = get_memory_pointer(state, address);
@@ -1388,9 +1388,9 @@ static void traverse_list4(running_machine *machine, int lod_num, UINT32 address
draw_model(machine, link & 0xffffff);
}
-static void traverse_list(running_machine *machine, UINT32 address)
+static void traverse_list(running_machine &machine, UINT32 address)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
UINT32 *list = get_memory_pointer(state, address);
int list_ptr = 0;
@@ -1424,7 +1424,7 @@ static void traverse_list(running_machine *machine, UINT32 address)
state->list_depth--;
}
-INLINE void process_link(running_machine *machine, UINT32 address, UINT32 link)
+INLINE void process_link(running_machine &machine, UINT32 address, UINT32 link)
{
if (link != 0 && link != 0x0fffffff && link != 0x00800800 && link != 0x01000000)
{
@@ -1450,9 +1450,9 @@ INLINE void process_link(running_machine *machine, UINT32 address, UINT32 link)
}
}
-static void draw_block(running_machine *machine, UINT32 address)
+static void draw_block(running_machine &machine, UINT32 address)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
const UINT32 *node = get_memory_pointer(state, address);
UINT32 link;
int node_matrix;
@@ -1492,9 +1492,9 @@ static void draw_block(running_machine *machine, UINT32 address)
process_link(machine, address, link);
}
-static void draw_viewport(running_machine *machine, int pri, UINT32 address)
+static void draw_viewport(running_machine &machine, int pri, UINT32 address)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
const UINT32 *node = get_memory_pointer(state, address);
UINT32 link_address;
float /*viewport_left, viewport_right, */viewport_top, viewport_bottom;
@@ -1555,9 +1555,9 @@ static void draw_viewport(running_machine *machine, int pri, UINT32 address)
}
-static void real3d_traverse_display_list(running_machine *machine)
+static void real3d_traverse_display_list(running_machine &machine)
{
- model3_state *state = machine->driver_data<model3_state>();
+ model3_state *state = machine.driver_data<model3_state>();
int pri;
init_matrix_stack(machine);
diff --git a/src/mame/video/momoko.c b/src/mame/video/momoko.c
index 0d0975d84d0..0ef217af925 100644
--- a/src/mame/video/momoko.c
+++ b/src/mame/video/momoko.c
@@ -14,74 +14,74 @@
WRITE8_HANDLER ( momoko_fg_scrollx_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->fg_scrollx = data;
}
WRITE8_HANDLER ( momoko_fg_scrolly_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->fg_scrolly = data;
}
WRITE8_HANDLER ( momoko_fg_select_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->fg_select = data & 0x0f;
state->fg_mask = data & 0x10;
}
WRITE8_HANDLER ( momoko_text_scrolly_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->text_scrolly = data;
}
WRITE8_HANDLER ( momoko_text_mode_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->text_mode = data;
}
WRITE8_HANDLER ( momoko_bg_scrollx_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->bg_scrollx[offset] = data;
}
WRITE8_HANDLER ( momoko_bg_scrolly_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->bg_scrolly[offset] = data;
}
WRITE8_HANDLER( momoko_bg_select_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->bg_select = data & 0x0f;
state->bg_mask = data & 0x10;
}
WRITE8_HANDLER( momoko_bg_priority_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->bg_priority = data & 0x01;
}
WRITE8_HANDLER( momoko_flipscreen_w )
{
- momoko_state *state = space->machine->driver_data<momoko_state>();
+ momoko_state *state = space->machine().driver_data<momoko_state>();
state->flipscreen = data & 0x01;
}
/****************************************************************************/
-static void momoko_draw_bg_pri( running_machine *machine, bitmap_t *bitmap, int chr, int col, int flipx, int flipy, int x, int y, int pri )
+static void momoko_draw_bg_pri( running_machine &machine, bitmap_t *bitmap, int chr, int col, int flipx, int flipy, int x, int y, int pri )
{
int xx, sx, sy, px, py, dot;
UINT32 gfxadr;
UINT8 d0, d1;
- UINT8 *BG_GFX = machine->region("gfx2")->base();
+ UINT8 *BG_GFX = machine.region("gfx2")->base();
for (sy = 0; sy < 8; sy++)
{
@@ -113,17 +113,17 @@ static void momoko_draw_bg_pri( running_machine *machine, bitmap_t *bitmap, int
SCREEN_UPDATE( momoko )
{
- momoko_state *state = screen->machine->driver_data<momoko_state>();
+ momoko_state *state = screen->machine().driver_data<momoko_state>();
int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ;
UINT8 *spriteram = state->spriteram;
- UINT8 *BG_MAP = screen->machine->region("user1")->base();
- UINT8 *BG_COL_MAP = screen->machine->region("user2")->base();
- UINT8 *FG_MAP = screen->machine->region("user3")->base();
- UINT8 *TEXT_COLOR = screen->machine->region("proms")->base();
+ UINT8 *BG_MAP = screen->machine().region("user1")->base();
+ UINT8 *BG_COL_MAP = screen->machine().region("user2")->base();
+ UINT8 *FG_MAP = screen->machine().region("user3")->base();
+ UINT8 *TEXT_COLOR = screen->machine().region("proms")->base();
- flip = state->flipscreen ^ (input_port_read(screen->machine, "FAKE") & 0x01);
+ flip = state->flipscreen ^ (input_port_read(screen->machine(), "FAKE") & 0x01);
/* draw BG layer */
dx = (7 - state->bg_scrollx[0]) & 7;
@@ -153,7 +153,7 @@ SCREEN_UPDATE( momoko )
py = 248 - (8 * y + dy + 9);
}
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[1],
chr,
col,
flip,flip,
@@ -187,7 +187,7 @@ SCREEN_UPDATE( momoko )
py = y + 1;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3],
chr,
col,
!fx,fy,
@@ -221,7 +221,7 @@ SCREEN_UPDATE( momoko )
{
col = col & 0x0f;
chr = chr + state->bg_select * 512;
- momoko_draw_bg_pri(screen->machine, bitmap, chr, col, flip, flip, px, py, pri);
+ momoko_draw_bg_pri(screen->machine(), bitmap, chr, col, flip, flip, px, py, pri);
}
}
}
@@ -249,7 +249,7 @@ SCREEN_UPDATE( momoko )
px = 248 - x;
py = y + 1;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[3],
chr,
col,
!fx,fy,
@@ -282,7 +282,7 @@ SCREEN_UPDATE( momoko )
px = 248 - x * 8;
py = 255 - y;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[(sy >> 3) * 32 + x] * 8 + dy,
col,
flip,0,
@@ -315,7 +315,7 @@ SCREEN_UPDATE( momoko )
px = 248 - (8 * x + dx - 8);
py = 248 - (8 * y + dy + 9);
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
chr,
0, /* color */
flip,flip, /* flip */
diff --git a/src/mame/video/moo.c b/src/mame/video/moo.c
index 3de9be73d82..c38683382cd 100644
--- a/src/mame/video/moo.c
+++ b/src/mame/video/moo.c
@@ -12,9 +12,9 @@
#include "video/konicdev.h"
#include "includes/moo.h"
-void moo_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void moo_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
int pri = (*color & 0x03e0) >> 4;
if (pri <= state->layerpri[2])
@@ -29,21 +29,21 @@ void moo_sprite_callback( running_machine *machine, int *code, int *color, int *
*color = state->sprite_colorbase | (*color & 0x001f);
}
-void moo_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+void moo_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
*color = state->layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
VIDEO_START(moo)
{
- moo_state *state = machine->driver_data<moo_state>();
+ moo_state *state = machine.driver_data<moo_state>();
- assert(machine->primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
state->alpha_enabled = 0;
- if (!strcmp(machine->system().name, "bucky") || !strcmp(machine->system().name, "buckyua") || !strcmp(machine->system().name, "buckyaa"))
+ if (!strcmp(machine.system().name, "bucky") || !strcmp(machine.system().name, "buckyua") || !strcmp(machine.system().name, "buckyaa"))
{
// Bucky doesn't chain tilemaps
k056832_set_layer_association(state->k056832, 0);
@@ -65,7 +65,7 @@ VIDEO_START(moo)
SCREEN_UPDATE(moo)
{
- moo_state *state = screen->machine->driver_data<moo_state>();
+ moo_state *state = screen->machine().driver_data<moo_state>();
static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 };
int layers[3];
int new_colorbase, plane, dirty, alpha;
@@ -112,7 +112,7 @@ SCREEN_UPDATE(moo)
k054338_update_all_shadows(state->k054338, 0);
k054338_fill_backcolor(state->k054338, bitmap, 0);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (state->layerpri[0] < k053251_get_priority(state->k053251, K053251_CI1)) /* bucky hides back layer behind background */
k056832_tilemap_draw(state->k056832, bitmap, cliprect, layers[0], 0, 1);
diff --git a/src/mame/video/mosaic.c b/src/mame/video/mosaic.c
index 5d462e05a36..316a2dae74b 100644
--- a/src/mame/video/mosaic.c
+++ b/src/mame/video/mosaic.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- mosaic_state *state = machine->driver_data<mosaic_state>();
+ mosaic_state *state = machine.driver_data<mosaic_state>();
tile_index *= 2;
SET_TILE_INFO(
0,
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- mosaic_state *state = machine->driver_data<mosaic_state>();
+ mosaic_state *state = machine.driver_data<mosaic_state>();
tile_index *= 2;
SET_TILE_INFO(
1,
@@ -47,7 +47,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mosaic )
{
- mosaic_state *state = machine->driver_data<mosaic_state>();
+ mosaic_state *state = machine.driver_data<mosaic_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -64,7 +64,7 @@ VIDEO_START( mosaic )
WRITE8_HANDLER( mosaic_fgvideoram_w )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
@@ -72,7 +72,7 @@ WRITE8_HANDLER( mosaic_fgvideoram_w )
WRITE8_HANDLER( mosaic_bgvideoram_w )
{
- mosaic_state *state = space->machine->driver_data<mosaic_state>();
+ mosaic_state *state = space->machine().driver_data<mosaic_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -82,7 +82,7 @@ WRITE8_HANDLER( mosaic_bgvideoram_w )
SCREEN_UPDATE( mosaic )
{
- mosaic_state *state = screen->machine->driver_data<mosaic_state>();
+ mosaic_state *state = screen->machine().driver_data<mosaic_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c
index c4c27e34227..4529320e52c 100644
--- a/src/mame/video/mouser.c
+++ b/src/mame/video/mouser.c
@@ -20,7 +20,7 @@ PALETTE_INIT( mouser )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -46,17 +46,17 @@ PALETTE_INIT( mouser )
WRITE8_HANDLER( mouser_flip_screen_x_w )
{
- flip_screen_x_set(space->machine, ~data & 1);
+ flip_screen_x_set(space->machine(), ~data & 1);
}
WRITE8_HANDLER( mouser_flip_screen_y_w )
{
- flip_screen_y_set(space->machine, ~data & 1);
+ flip_screen_y_set(space->machine(), ~data & 1);
}
SCREEN_UPDATE( mouser )
{
- mouser_state *state = screen->machine->driver_data<mouser_state>();
+ mouser_state *state = screen->machine().driver_data<mouser_state>();
UINT8 *spriteram = state->spriteram;
int offs;
int sx, sy;
@@ -71,12 +71,12 @@ SCREEN_UPDATE( mouser )
sx = offs % 32;
sy = offs / 32;
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
{
sx = 31 - sx;
}
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
{
sy = 31 - sy;
}
@@ -90,10 +90,10 @@ SCREEN_UPDATE( mouser )
/* Note: this is _not_ dependant on flipping */
color_offs = offs % 32 + ((256 + 8 * (offs / 32) - spriteram[offs % 32] )% 256) / 8 * 32;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs] | (state->colorram[color_offs] >> 5) * 256 | ((state->colorram[color_offs] >> 4) & 1) * 512,
state->colorram[color_offs]%16,
- flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),
+ flip_screen_x_get(screen->machine()),flip_screen_y_get(screen->machine()),
8*sx,scrolled_y_position);
}
@@ -108,20 +108,20 @@ SCREEN_UPDATE( mouser )
flipx = BIT(spriteram[offs], 6);
flipy = BIT(spriteram[offs], 7);
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
{
flipy = !flipy;
sy = 238 - sy;
}
if (BIT(spriteram[offs + 1], 4))
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
spriteram[offs]&0x3f,
spriteram[offs+1]%16,
flipx,flipy,
@@ -137,20 +137,20 @@ SCREEN_UPDATE( mouser )
flipx = BIT(spriteram[offs], 6);
flipy = BIT(spriteram[offs], 7);
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
{
flipx = !flipx;
sx = 240 - sx;
}
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
{
flipy = !flipy;
sy = 238 - sy;
}
if (BIT(spriteram[offs + 1], 4))
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1+((spriteram[offs+1]&0x20)>>5)],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1+((spriteram[offs+1]&0x20)>>5)],
spriteram[offs]&0x3f,
spriteram[offs+1]%16,
flipx,flipy,
diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c
index 986162acd7d..c4e22d951e3 100644
--- a/src/mame/video/mrdo.c
+++ b/src/mame/video/mrdo.c
@@ -74,7 +74,7 @@ PALETTE_INIT( mrdo )
}
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
for (i = 0; i < 0x100; i++)
{
@@ -100,7 +100,7 @@ PALETTE_INIT( mrdo )
bits2 = (color_prom[a2] >> 4) & 0x03;
b = weight[bits0 + (bits2 << 2)];
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -108,7 +108,7 @@ PALETTE_INIT( mrdo )
/* characters */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites */
for (i = 0x100; i < 0x140; i++)
@@ -120,7 +120,7 @@ PALETTE_INIT( mrdo )
else
ctabentry &= 0x0f; /* low 4 bits are for sprite color n */
- colortable_entry_set_value(machine->colortable, i, ctabentry + ((ctabentry & 0x0c) << 3));
+ colortable_entry_set_value(machine.colortable, i, ctabentry + ((ctabentry & 0x0c) << 3));
}
}
@@ -134,7 +134,7 @@ PALETTE_INIT( mrdo )
static TILE_GET_INFO( get_bg_tile_info )
{
- mrdo_state *state = machine->driver_data<mrdo_state>();
+ mrdo_state *state = machine.driver_data<mrdo_state>();
UINT8 attr = state->bgvideoram[tile_index];
SET_TILE_INFO(
1,
@@ -145,7 +145,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- mrdo_state *state = machine->driver_data<mrdo_state>();
+ mrdo_state *state = machine.driver_data<mrdo_state>();
UINT8 attr = state->fgvideoram[tile_index];
SET_TILE_INFO(
0,
@@ -164,7 +164,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( mrdo )
{
- mrdo_state *state = machine->driver_data<mrdo_state>();
+ mrdo_state *state = machine.driver_data<mrdo_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -192,14 +192,14 @@ VIDEO_START( mrdo )
WRITE8_HANDLER( mrdo_bgvideoram_w )
{
- mrdo_state *state = space->machine->driver_data<mrdo_state>();
+ mrdo_state *state = space->machine().driver_data<mrdo_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( mrdo_fgvideoram_w )
{
- mrdo_state *state = space->machine->driver_data<mrdo_state>();
+ mrdo_state *state = space->machine().driver_data<mrdo_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
@@ -207,13 +207,13 @@ WRITE8_HANDLER( mrdo_fgvideoram_w )
WRITE8_HANDLER( mrdo_scrollx_w )
{
- mrdo_state *state = space->machine->driver_data<mrdo_state>();
+ mrdo_state *state = space->machine().driver_data<mrdo_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( mrdo_scrolly_w )
{
- mrdo_state *state = space->machine->driver_data<mrdo_state>();
+ mrdo_state *state = space->machine().driver_data<mrdo_state>();
/* This is NOT affected by flipscreen (so stop it happening) */
if (state->flipscreen)
@@ -225,13 +225,13 @@ WRITE8_HANDLER( mrdo_scrolly_w )
WRITE8_HANDLER( mrdo_flipscreen_w )
{
- mrdo_state *state = space->machine->driver_data<mrdo_state>();
+ mrdo_state *state = space->machine().driver_data<mrdo_state>();
/* bits 1-3 control the playfield priority, but they are not used by */
/* Mr. Do! so we don't emulate them */
state->flipscreen = data & 0x01;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
@@ -242,9 +242,9 @@ WRITE8_HANDLER( mrdo_flipscreen_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- mrdo_state *state = machine->driver_data<mrdo_state>();
+ mrdo_state *state = machine.driver_data<mrdo_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -252,7 +252,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
{
if (spriteram[offs + 1] != 0)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
spriteram[offs], spriteram[offs + 2] & 0x0f,
spriteram[offs + 2] & 0x10, spriteram[offs + 2] & 0x20,
spriteram[offs + 3], 256 - spriteram[offs + 1], 0);
@@ -262,11 +262,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( mrdo )
{
- mrdo_state *state = screen->machine->driver_data<mrdo_state>();
+ mrdo_state *state = screen->machine().driver_data<mrdo_state>();
bitmap_fill(bitmap, cliprect,0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mrflea.c b/src/mame/video/mrflea.c
index c58628fead2..aaee47d7c69 100644
--- a/src/mame/video/mrflea.c
+++ b/src/mame/video/mrflea.c
@@ -10,7 +10,7 @@ Mr. F. Lea
WRITE8_HANDLER( mrflea_gfx_bank_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
state->gfx_bank = data;
if (data & ~0x14)
@@ -19,7 +19,7 @@ WRITE8_HANDLER( mrflea_gfx_bank_w )
WRITE8_HANDLER( mrflea_videoram_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
int bank = offset / 0x400;
offset &= 0x3ff;
@@ -31,7 +31,7 @@ WRITE8_HANDLER( mrflea_videoram_w )
WRITE8_HANDLER( mrflea_spriteram_w )
{
- mrflea_state *state = space->machine->driver_data<mrflea_state>();
+ mrflea_state *state = space->machine().driver_data<mrflea_state>();
if (offset & 2)
{
@@ -43,13 +43,13 @@ WRITE8_HANDLER( mrflea_spriteram_w )
state->spriteram[offset] = data;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mrflea_state *state = machine->driver_data<mrflea_state>();
- const gfx_element *gfx = machine->gfx[0];
+ mrflea_state *state = machine.driver_data<mrflea_state>();
+ const gfx_element *gfx = machine.gfx[0];
const UINT8 *source = state->spriteram;
const UINT8 *finish = source + 0x100;
- rectangle clip = machine->primary_screen->visible_area();
+ rectangle clip = machine.primary_screen->visible_area();
clip.max_x -= 24;
clip.min_x += 16;
@@ -74,11 +74,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mrflea_state *state = machine->driver_data<mrflea_state>();
+ mrflea_state *state = machine.driver_data<mrflea_state>();
const UINT8 *source = state->videoram;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
int sx, sy;
int base = 0;
@@ -106,7 +106,7 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
SCREEN_UPDATE( mrflea )
{
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mrjong.c b/src/mame/video/mrjong.c
index fe8f50aedaf..040cdb6d020 100644
--- a/src/mame/video/mrjong.c
+++ b/src/mame/video/mrjong.c
@@ -21,7 +21,7 @@ PALETTE_INIT( mrjong )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -47,7 +47,7 @@ PALETTE_INIT( mrjong )
bit2 = BIT(color_prom[i], 7);
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -57,7 +57,7 @@ PALETTE_INIT( mrjong )
for (i = 0; i < 0x80; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -70,30 +70,30 @@ PALETTE_INIT( mrjong )
WRITE8_HANDLER( mrjong_videoram_w )
{
- mrjong_state *state = space->machine->driver_data<mrjong_state>();
+ mrjong_state *state = space->machine().driver_data<mrjong_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( mrjong_colorram_w )
{
- mrjong_state *state = space->machine->driver_data<mrjong_state>();
+ mrjong_state *state = space->machine().driver_data<mrjong_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( mrjong_flipscreen_w )
{
- if (flip_screen_get(space->machine) != BIT(data, 2))
+ if (flip_screen_get(space->machine()) != BIT(data, 2))
{
- flip_screen_set(space->machine, BIT(data, 2));
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), BIT(data, 2));
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- mrjong_state *state = machine->driver_data<mrjong_state>();
+ mrjong_state *state = machine.driver_data<mrjong_state>();
int code = state->videoram[tile_index] | ((state->colorram[tile_index] & 0x20) << 3);
int color = state->colorram[tile_index] & 0x1f;
int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
@@ -103,16 +103,16 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mrjong )
{
- mrjong_state *state = machine->driver_data<mrjong_state>();
+ mrjong_state *state = machine.driver_data<mrjong_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32);
}
/*
Note: First 0x40 entries in the videoram are actually spriteram
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mrjong_state *state = machine->driver_data<mrjong_state>();
+ mrjong_state *state = machine.driver_data<mrjong_state>();
int offs;
for (offs = (0x40 - 4); offs >= 0; offs -= 4)
@@ -137,7 +137,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
sprt,
color,
flipx, flipy,
@@ -147,8 +147,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( mrjong )
{
- mrjong_state *state = screen->machine->driver_data<mrjong_state>();
+ mrjong_state *state = screen->machine().driver_data<mrjong_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c
index 5408f8b4a19..1c88c101049 100644
--- a/src/mame/video/ms32.c
+++ b/src/mame/video/ms32.c
@@ -22,7 +22,7 @@ priority should be given to
static TILE_GET_INFO( get_ms32_tx_tile_info )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
int tileno, colour;
tileno = state->txram_16[tile_index *2] & 0xffff;
@@ -33,7 +33,7 @@ static TILE_GET_INFO( get_ms32_tx_tile_info )
static TILE_GET_INFO( get_ms32_roz_tile_info )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
int tileno,colour;
tileno = state->rozram_16[tile_index *2] & 0xffff;
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_ms32_roz_tile_info )
static TILE_GET_INFO( get_ms32_bg_tile_info )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
int tileno,colour;
tileno = state->bgram_16[tile_index *2] & 0xffff;
@@ -55,7 +55,7 @@ static TILE_GET_INFO( get_ms32_bg_tile_info )
static TILE_GET_INFO( get_ms32_extra_tile_info )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
int tileno,colour;
tileno = state->f1superb_extraram_16[tile_index *2] & 0xffff;
@@ -68,9 +68,9 @@ static TILE_GET_INFO( get_ms32_extra_tile_info )
VIDEO_START( ms32 )
{
- ms32_state *state = machine->driver_data<ms32_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ ms32_state *state = machine.driver_data<ms32_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->priram_8 = auto_alloc_array_clear(machine, UINT8, 0x2000);
state->palram_16 = auto_alloc_array_clear(machine, UINT16, 0x20000);
@@ -103,13 +103,13 @@ VIDEO_START( ms32 )
state->reverse_sprite_order = 1;
/* i hate per game patches...how should priority really work? tetrisp2.c ? i can't follow it */
- if (!strcmp(machine->system().name,"kirarast")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"tp2m32")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"47pie2")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"47pie2o")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"hayaosi3")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"bnstars")) state->reverse_sprite_order = 0;
- if (!strcmp(machine->system().name,"wpksocv2")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"kirarast")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"tp2m32")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"47pie2")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"47pie2o")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"hayaosi3")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"bnstars")) state->reverse_sprite_order = 0;
+ if (!strcmp(machine.system().name,"wpksocv2")) state->reverse_sprite_order = 0;
// tp2m32 doesn't set the brightness registers so we need sensible defaults
state->brt[0] = state->brt[1] = 0xffff;
@@ -117,7 +117,7 @@ VIDEO_START( ms32 )
VIDEO_START( f1superb )
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
VIDEO_START_CALL( ms32 );
state->f1superb_extraram_16 = auto_alloc_array_clear(machine, UINT16, 0x10000);
@@ -128,9 +128,9 @@ VIDEO_START( f1superb )
/********** PALETTE WRITES **********/
-static void update_color(running_machine *machine, int color)
+static void update_color(running_machine &machine, int color)
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
int r,g,b;
/* I'm not sure how the brightness should be applied, currently I'm only
@@ -155,7 +155,7 @@ static void update_color(running_machine *machine, int color)
WRITE32_HANDLER( ms32_brightness_w )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
int oldword = state->brt[offset];
COMBINE_DATA(&state->brt[offset]);
@@ -171,7 +171,7 @@ WRITE32_HANDLER( ms32_brightness_w )
state->brt_b = 0x100 - ((state->brt[1] & 0x00ff) >> 0);
// for (i = 0;i < 0x3000;i++) // colors 0x3000-0x3fff are not used
- // update_color(space->machine, i);
+ // update_color(space->machine(), i);
}
}
@@ -185,7 +185,7 @@ WRITE32_HANDLER( ms32_brightness_w )
WRITE32_HANDLER( ms32_gfxctrl_w )
{
- ms32_state *state = space->machine->driver_data<ms32_state>();
+ ms32_state *state = space->machine().driver_data<ms32_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 1 = flip screen */
@@ -205,14 +205,14 @@ WRITE32_HANDLER( ms32_gfxctrl_w )
/* SPRITES based on tetrisp2 for now, readd priority bits later */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder)
{
int tx, ty, sx, sy, flipx, flipy;
int xsize, ysize;
int code, attr, color, size;
int pri;
int xzoom, yzoom;
- gfx_element *gfx = machine->gfx[gfxnum];
+ gfx_element *gfx = machine.gfx[gfxnum];
UINT16 *source = sprram_top;
UINT16 *finish = sprram_top + (sprram_size - 0x10) / 2;
@@ -275,9 +275,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *b
}
-static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,int priority)
+static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,int priority)
{
- ms32_state *state = machine->driver_data<ms32_state>();
+ ms32_state *state = machine.driver_data<ms32_state>();
/* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */
if (state->roz_ctrl[0x5c/4] & 1) /* "super" mode */
@@ -360,7 +360,7 @@ static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle
SCREEN_UPDATE( ms32 )
{
- ms32_state *state = screen->machine->driver_data<ms32_state>();
+ ms32_state *state = screen->machine().driver_data<ms32_state>();
int scrollx,scrolly;
int asc_pri;
int scr_pri;
@@ -377,7 +377,7 @@ SCREEN_UPDATE( ms32 )
int i;
for (i = 0;i < 0x10000;i++) // colors 0x3000-0x3fff are not used
- update_color(screen->machine, i);
+ update_color(screen->machine(), i);
scrollx = state->tx_scroll[0x00/4] + state->tx_scroll[0x08/4] + 0x18;
scrolly = state->tx_scroll[0x0c/4] + state->tx_scroll[0x14/4];
@@ -392,7 +392,7 @@ SCREEN_UPDATE( ms32 )
tilemap_set_scrolly(state->bg_tilemap_alt, 0, scrolly);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
@@ -404,7 +404,7 @@ SCREEN_UPDATE( ms32 )
bitmap_fill(state->temp_bitmap_sprites,cliprect,0);
bitmap_fill(state->temp_bitmap_sprites_pri,cliprect,0);
- draw_sprites(screen->machine, state->temp_bitmap_sprites, state->temp_bitmap_sprites_pri, cliprect, state->sprram_16, 0x20000, 0, state->reverse_sprite_order);
+ draw_sprites(screen->machine(), state->temp_bitmap_sprites, state->temp_bitmap_sprites_pri, cliprect, state->sprram_16, 0x20000, 0, state->reverse_sprite_order);
@@ -427,7 +427,7 @@ SCREEN_UPDATE( ms32 )
rot_pri++;
if (rot_pri == 0)
- draw_roz(screen->machine, state->temp_bitmap_tilemaps, cliprect, 1 << 1);
+ draw_roz(screen->machine(), state->temp_bitmap_tilemaps, cliprect, 1 << 1);
else if (scr_pri == 0)
if (state->tilemaplayoutcontrol&1)
{
@@ -441,7 +441,7 @@ SCREEN_UPDATE( ms32 )
tilemap_draw(state->temp_bitmap_tilemaps,cliprect, state->tx_tilemap, 0, 1 << 2);
if (rot_pri == 1)
- draw_roz(screen->machine, state->temp_bitmap_tilemaps, cliprect, 1 << 1);
+ draw_roz(screen->machine(), state->temp_bitmap_tilemaps, cliprect, 1 << 1);
else if (scr_pri == 1)
if (state->tilemaplayoutcontrol&1)
{
@@ -455,7 +455,7 @@ SCREEN_UPDATE( ms32 )
tilemap_draw(state->temp_bitmap_tilemaps,cliprect, state->tx_tilemap, 0, 1 << 2);
if (rot_pri == 2)
- draw_roz(screen->machine, state->temp_bitmap_tilemaps, cliprect, 1 << 1);
+ draw_roz(screen->machine(), state->temp_bitmap_tilemaps, cliprect, 1 << 1);
else if (scr_pri == 2)
if (state->tilemaplayoutcontrol&1)
{
@@ -476,7 +476,7 @@ SCREEN_UPDATE( ms32 )
int xx, yy;
int width = screen->width();
int height = screen->height();
- const pen_t *paldata = screen->machine->pens;
+ const pen_t *paldata = screen->machine().pens;
UINT16* srcptr_tile;
UINT8* srcptr_tilepri;
@@ -490,7 +490,7 @@ SCREEN_UPDATE( ms32 )
for (yy=0;yy<height;yy++)
{
srcptr_tile = BITMAP_ADDR16(state->temp_bitmap_tilemaps, yy, 0);
- srcptr_tilepri = BITMAP_ADDR8(screen->machine->priority_bitmap, yy, 0);
+ srcptr_tilepri = BITMAP_ADDR8(screen->machine().priority_bitmap, yy, 0);
srcptr_spri = BITMAP_ADDR16(state->temp_bitmap_sprites, yy, 0);
//srcptr_spripri = BITMAP_ADDR8(state->temp_bitmap_sprites_pri, yy, 0);
dstptr_bitmap = BITMAP_ADDR32(bitmap, yy, 0);
@@ -579,7 +579,7 @@ SCREEN_UPDATE( ms32 )
}
else if (primask == 0xc0)
{
- dstptr_bitmap[xx] = paldata[screen->machine->rand()&0xfff];
+ dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff];
}
else if (primask == 0xf0)
{
@@ -663,12 +663,12 @@ SCREEN_UPDATE( ms32 )
}
else if (src_tilepri==0x06)
{
- //dstptr_bitmap[xx] = paldata[screen->machine->rand()&0xfff];
+ //dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff];
dstptr_bitmap[xx] = paldata[src_tile]; // assumed
}
else if (src_tilepri==0x07)
{
- //dstptr_bitmap[xx] = paldata[screen->machine->rand()&0xfff];
+ //dstptr_bitmap[xx] = paldata[screen->machine().rand()&0xfff];
dstptr_bitmap[xx] = paldata[src_tile]; // assumed
}
}
diff --git a/src/mame/video/msisaac.c b/src/mame/video/msisaac.c
index 80a9c8419d7..de74734c055 100644
--- a/src/mame/video/msisaac.c
+++ b/src/mame/video/msisaac.c
@@ -14,7 +14,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
int tile_number = state->videoram[tile_index];
SET_TILE_INFO( 0,
tile_number,
@@ -24,7 +24,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
int tile_number = state->videoram2[tile_index];
SET_TILE_INFO( 1,
0x100 + tile_number,
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
int tile_number = state->videoram3[tile_index];
/* graphics 0 or 1 */
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
VIDEO_START( msisaac )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -72,37 +72,37 @@ VIDEO_START( msisaac )
WRITE8_HANDLER( msisaac_fg_scrolly_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrolly(state->fg_tilemap, 0, data);
}
WRITE8_HANDLER( msisaac_fg_scrollx_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrollx(state->fg_tilemap, 0, 9 + data);
}
WRITE8_HANDLER( msisaac_bg2_scrolly_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrolly(state->bg2_tilemap, 0, data);
}
WRITE8_HANDLER( msisaac_bg2_scrollx_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrollx(state->bg2_tilemap, 0, 9 + 2 + data);
}
WRITE8_HANDLER( msisaac_bg_scrolly_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( msisaac_bg_scrollx_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, 9 + 4 + data);
}
@@ -120,7 +120,7 @@ WRITE8_HANDLER( msisaac_textbank1_w )
WRITE8_HANDLER( msisaac_bg2_textbank_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
if (state->bg2_textbank != data )
{
state->bg2_textbank = data;
@@ -136,21 +136,21 @@ WRITE8_HANDLER( msisaac_bg2_textbank_w )
WRITE8_HANDLER( msisaac_bg_videoram_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( msisaac_bg2_videoram_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->videoram3[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
}
WRITE8_HANDLER( msisaac_fg_videoram_w )
{
- msisaac_state *state = space->machine->driver_data<msisaac_state>();
+ msisaac_state *state = space->machine().driver_data<msisaac_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -161,9 +161,9 @@ WRITE8_HANDLER( msisaac_fg_videoram_w )
Display refresh
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- msisaac_state *state = machine->driver_data<msisaac_state>();
+ msisaac_state *state = machine.driver_data<msisaac_state>();
const UINT8 *source = state->spriteram + 32 * 4 - 4;
const UINT8 *finish = state->spriteram; /* ? */
@@ -178,12 +178,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int flipx = (attributes & 0x1);
int flipy = (attributes & 0x2);
- gfx_element *gfx = machine->gfx[2];
+ gfx_element *gfx = machine.gfx[2];
if (attributes & 4)
{
//color = rand() & 15;
- gfx = machine->gfx[3];
+ gfx = machine.gfx[3];
}
if (attributes & 8) /* double size sprite */
@@ -246,10 +246,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( msisaac )
{
- msisaac_state *state = screen->machine->driver_data<msisaac_state>();
+ msisaac_state *state = screen->machine().driver_data<msisaac_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/mugsmash.c b/src/mame/video/mugsmash.c
index d713bed5726..51d03d5ba27 100644
--- a/src/mame/video/mugsmash.c
+++ b/src/mame/video/mugsmash.c
@@ -3,7 +3,7 @@
#include "emu.h"
#include "includes/mugsmash.h"
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* Each Sprite takes 16 bytes, 5 used? */
@@ -25,10 +25,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
*/
- mugsmash_state *state = machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = machine.driver_data<mugsmash_state>();
const UINT16 *source = state->spriteram;
const UINT16 *finish = source + 0x2000;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
while (source < finish)
{
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_mugsmash_tile_info1 )
f = flip-Y
*/
- mugsmash_state *state = machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = machine.driver_data<mugsmash_state>();
int tileno, colour, fx;
tileno = state->videoram1[tile_index * 2 + 1];
@@ -82,7 +82,7 @@ static TILE_GET_INFO( get_mugsmash_tile_info1 )
WRITE16_HANDLER( mugsmash_videoram1_w )
{
- mugsmash_state *state = space->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = space->machine().driver_data<mugsmash_state>();
state->videoram1[offset] = data;
tilemap_mark_tile_dirty(state->tilemap1, offset / 2);
@@ -99,7 +99,7 @@ static TILE_GET_INFO( get_mugsmash_tile_info2 )
f = flip-Y
*/
- mugsmash_state *state = machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = machine.driver_data<mugsmash_state>();
int tileno, colour, fx;
tileno = state->videoram2[tile_index * 2 + 1];
@@ -111,7 +111,7 @@ static TILE_GET_INFO( get_mugsmash_tile_info2 )
WRITE16_HANDLER( mugsmash_videoram2_w )
{
- mugsmash_state *state = space->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = space->machine().driver_data<mugsmash_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->tilemap2, offset / 2);
@@ -119,7 +119,7 @@ WRITE16_HANDLER( mugsmash_videoram2_w )
WRITE16_HANDLER (mugsmash_reg_w)
{
- mugsmash_state *state = space->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = space->machine().driver_data<mugsmash_state>();
state->regs1[offset] = data;
// popmessage ("Regs %04x, %04x, %04x, %04x", mugsmash_regs1[0], mugsmash_regs1[1],mugsmash_regs1[2], mugsmash_regs1[3]);
@@ -143,7 +143,7 @@ WRITE16_HANDLER (mugsmash_reg_w)
VIDEO_START( mugsmash )
{
- mugsmash_state *state = machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = machine.driver_data<mugsmash_state>();
state->tilemap1 = tilemap_create(machine, get_mugsmash_tile_info1, tilemap_scan_rows, 16, 16, 32, 32);
tilemap_set_transparent_pen(state->tilemap1, 0);
@@ -153,10 +153,10 @@ VIDEO_START( mugsmash )
SCREEN_UPDATE( mugsmash )
{
- mugsmash_state *state = screen->machine->driver_data<mugsmash_state>();
+ mugsmash_state *state = screen->machine().driver_data<mugsmash_state>();
tilemap_draw(bitmap, cliprect, state->tilemap2, 0, 0);
tilemap_draw(bitmap, cliprect, state->tilemap1, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c
index eeaf2541aba..aaa320ab922 100644
--- a/src/mame/video/munchmo.c
+++ b/src/mame/video/munchmo.c
@@ -6,7 +6,7 @@ PALETTE_INIT( mnchmobl )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -31,27 +31,27 @@ PALETTE_INIT( mnchmobl )
WRITE8_HANDLER( mnchmobl_palette_bank_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
state->palette_bank = data & 0x3;
}
WRITE8_HANDLER( mnchmobl_flipscreen_w )
{
- munchmo_state *state = space->machine->driver_data<munchmo_state>();
+ munchmo_state *state = space->machine().driver_data<munchmo_state>();
state->flipscreen = data;
}
VIDEO_START( mnchmobl )
{
- munchmo_state *state = machine->driver_data<munchmo_state>();
- state->tmpbitmap = auto_bitmap_alloc(machine, 512, 512, machine->primary_screen->format());
+ munchmo_state *state = machine.driver_data<munchmo_state>();
+ state->tmpbitmap = auto_bitmap_alloc(machine, 512, 512, machine.primary_screen->format());
}
-static void draw_status( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- munchmo_state *state = machine->driver_data<munchmo_state>();
- const gfx_element *gfx = machine->gfx[0];
+ munchmo_state *state = machine.driver_data<munchmo_state>();
+ const gfx_element *gfx = machine.gfx[0];
int row;
for (row = 0; row < 4; row++)
@@ -76,15 +76,15 @@ static void draw_status( running_machine *machine, bitmap_t *bitmap, const recta
}
}
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/*
ROM B1.2C contains 256 tilemaps defining 4x4 configurations of
the tiles in ROM B2.2B
*/
- munchmo_state *state = machine->driver_data<munchmo_state>();
- UINT8 *rom = machine->region("gfx2")->base();
- const gfx_element *gfx = machine->gfx[1];
+ munchmo_state *state = machine.driver_data<munchmo_state>();
+ UINT8 *rom = machine.region("gfx2")->base();
+ const gfx_element *gfx = machine.gfx[1];
int offs;
for (offs = 0; offs < 0x100; offs++)
@@ -115,14 +115,14 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- munchmo_state *state = machine->driver_data<munchmo_state>();
+ munchmo_state *state = machine.driver_data<munchmo_state>();
int scroll = state->vreg[6];
int flags = state->vreg[7]; /* XB?????? */
int xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0);
int bank = (flags & 0x40) ? 1 : 0;
- const gfx_element *gfx = machine->gfx[2 + bank];
+ const gfx_element *gfx = machine.gfx[2 + bank];
int color_base = state->palette_bank * 4 + 3;
int i, j;
int firstsprite = state->vreg[4] & 0x3f;
@@ -152,8 +152,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( mnchmobl )
{
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_status(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_status(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mustache.c b/src/mame/video/mustache.c
index 62b677a6275..09583f9cda4 100644
--- a/src/mame/video/mustache.c
+++ b/src/mame/video/mustache.c
@@ -45,7 +45,7 @@ PALETTE_INIT(mustache)
WRITE8_HANDLER( mustache_videoram_w )
{
- mustache_state *state = space->machine->driver_data<mustache_state>();
+ mustache_state *state = space->machine().driver_data<mustache_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -53,11 +53,11 @@ WRITE8_HANDLER( mustache_videoram_w )
WRITE8_HANDLER (mustache_video_control_w)
{
- mustache_state *state = space->machine->driver_data<mustache_state>();
- if (flip_screen_get(space->machine) != (data & 0x01))
+ mustache_state *state = space->machine().driver_data<mustache_state>();
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* tile bank */
@@ -65,13 +65,13 @@ WRITE8_HANDLER (mustache_video_control_w)
if ((state->control_byte ^ data) & 0x08)
{
state->control_byte = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( mustache_scroll_w )
{
- mustache_state *state = space->machine->driver_data<mustache_state>();
+ mustache_state *state = space->machine().driver_data<mustache_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, 0x100 - data);
tilemap_set_scrollx(state->bg_tilemap, 1, 0x100 - data);
tilemap_set_scrollx(state->bg_tilemap, 2, 0x100 - data);
@@ -80,7 +80,7 @@ WRITE8_HANDLER( mustache_scroll_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- mustache_state *state = machine->driver_data<mustache_state>();
+ mustache_state *state = machine.driver_data<mustache_state>();
UINT8 *videoram = state->videoram;
int attr = videoram[2 * tile_index + 1];
int code = videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((state->control_byte & 0x08) << 7);
@@ -93,19 +93,19 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mustache )
{
- mustache_state *state = machine->driver_data<mustache_state>();
+ mustache_state *state = machine.driver_data<mustache_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_x,
8, 8, 64, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 4);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- mustache_state *state = machine->driver_data<mustache_state>();
+ mustache_state *state = machine.driver_data<mustache_state>();
rectangle clip = *cliprect;
- const gfx_element *gfx = machine->gfx[1];
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const gfx_element *gfx = machine.gfx[1];
+ const rectangle &visarea = machine.primary_screen->visible_area();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -145,8 +145,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( mustache )
{
- mustache_state *state = screen->machine->driver_data<mustache_state>();
+ mustache_state *state = screen->machine().driver_data<mustache_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/mw8080bw.c b/src/mame/video/mw8080bw.c
index 2523b127cb1..872456da465 100644
--- a/src/mame/video/mw8080bw.c
+++ b/src/mame/video/mw8080bw.c
@@ -10,7 +10,7 @@
SCREEN_UPDATE( mw8080bw )
{
- mw8080bw_state *state = screen->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = screen->machine().driver_data<mw8080bw_state>();
UINT8 x = 0;
UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK;
UINT8 video_data = 0;
@@ -77,7 +77,7 @@ SCREEN_UPDATE( mw8080bw )
SCREEN_UPDATE( spcenctr )
{
- mw8080bw_state *state = screen->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = screen->machine().driver_data<mw8080bw_state>();
UINT8 line_buf[256]; /* 256x1 bit RAM */
UINT8 x = 0;
@@ -221,7 +221,7 @@ SCREEN_UPDATE( spcenctr )
SCREEN_UPDATE( phantom2 )
{
- mw8080bw_state *state = screen->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = screen->machine().driver_data<mw8080bw_state>();
UINT8 x = 0;
UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK;
UINT8 video_data = 0;
@@ -229,7 +229,7 @@ SCREEN_UPDATE( phantom2 )
UINT16 cloud_counter = state->phantom2_cloud_counter;
- UINT8 *cloud_region = screen->machine->region("proms")->base();
+ UINT8 *cloud_region = screen->machine().region("proms")->base();
while (1)
{
@@ -313,7 +313,7 @@ SCREEN_UPDATE( phantom2 )
SCREEN_EOF( phantom2 )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
state->phantom2_cloud_counter += MW8080BW_VTOTAL;
@@ -333,7 +333,7 @@ SCREEN_EOF( phantom2 )
SCREEN_UPDATE( invaders )
{
- mw8080bw_state *state = screen->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = screen->machine().driver_data<mw8080bw_state>();
UINT8 x = 0;
UINT8 y = MW8080BW_VCOUNTER_START_NO_VBLANK;
UINT8 video_data = 0;
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index fbd3f415d6d..5cc55c488b0 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -47,7 +47,7 @@
static TIMER_CALLBACK( interrupt_callback )
{
- mystston_state *state = machine->driver_data<mystston_state>();
+ mystston_state *state = machine.driver_data<mystston_state>();
int scanline = param;
mystston_on_scanline_interrupt(machine);
@@ -57,7 +57,7 @@ static TIMER_CALLBACK( interrupt_callback )
scanline = FIRST_INT_VPOS;
/* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline);
}
@@ -68,14 +68,14 @@ static TIMER_CALLBACK( interrupt_callback )
*
*************************************/
-static void set_palette(running_machine *machine, mystston_state *state)
+static void set_palette(running_machine &machine, mystston_state *state)
{
int i;
static const int resistances_rg[3] = { 4700, 3300, 1500 };
static const int resistances_b [2] = { 3300, 1500 };
double weights_rg[3], weights_b[2];
- UINT8 *color_prom = machine->region("proms")->base();
+ UINT8 *color_prom = machine.region("proms")->base();
compute_resistor_weights(0, 255, -1.0,
3, resistances_rg, weights_rg, 0, 1000,
@@ -125,7 +125,7 @@ static void set_palette(running_machine *machine, mystston_state *state)
WRITE8_HANDLER( mystston_video_control_w )
{
- mystston_state *state = space->machine->driver_data<mystston_state>();
+ mystston_state *state = space->machine().driver_data<mystston_state>();
*state->video_control = data;
@@ -134,8 +134,8 @@ WRITE8_HANDLER( mystston_video_control_w )
/* D3 - unused */
/* D4-D5 - coin counters in flipped order */
- coin_counter_w(space->machine, 0, data & 0x20);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x20);
+ coin_counter_w(space->machine(), 1, data & 0x10);
/* D6 - unused */
/* D7 - screen flip */
@@ -151,7 +151,7 @@ WRITE8_HANDLER( mystston_video_control_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- mystston_state *state = machine->driver_data<mystston_state>();
+ mystston_state *state = machine.driver_data<mystston_state>();
int page = (*state->video_control & 0x04) << 8;
int code = ((state->bg_videoram[page | 0x200 | tile_index] & 0x01) << 8) | state->bg_videoram[page | tile_index];
@@ -163,7 +163,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- mystston_state *state = machine->driver_data<mystston_state>();
+ mystston_state *state = machine.driver_data<mystston_state>();
int code = ((state->fg_videoram[0x400 | tile_index] & 0x07) << 8) | state->fg_videoram[tile_index];
int color = ((*state->video_control & 0x01) << 1) | ((*state->video_control & 0x02) >> 1);
@@ -181,7 +181,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip)
{
- mystston_state *state = gfx->machine->driver_data<mystston_state>();
+ mystston_state *state = gfx->machine().driver_data<mystston_state>();
int offs;
for (offs = 0; offs < 0x60; offs += 4)
@@ -220,7 +220,7 @@ static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_
static VIDEO_START( mystston )
{
- mystston_state *state = machine->driver_data<mystston_state>();
+ mystston_state *state = machine.driver_data<mystston_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x, 16, 16, 16, 32);
@@ -228,7 +228,7 @@ static VIDEO_START( mystston )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
/* create the interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
}
@@ -241,9 +241,9 @@ static VIDEO_START( mystston )
static VIDEO_RESET( mystston )
{
- mystston_state *state = machine->driver_data<mystston_state>();
+ mystston_state *state = machine.driver_data<mystston_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS);
}
@@ -256,18 +256,18 @@ static VIDEO_RESET( mystston )
static SCREEN_UPDATE( mystston )
{
- mystston_state *state = screen->machine->driver_data<mystston_state>();
+ mystston_state *state = screen->machine().driver_data<mystston_state>();
- int flip = (*state->video_control & 0x80) ^ ((input_port_read(screen->machine, "DSW1") & 0x20) << 2);
+ int flip = (*state->video_control & 0x80) ^ ((input_port_read(screen->machine(), "DSW1") & 0x20) << 2);
- set_palette(screen->machine, state);
+ set_palette(screen->machine(), state);
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
tilemap_set_scrolly(state->bg_tilemap, 0, *state->scroll);
- tilemap_set_flip_all(screen->machine, flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(bitmap, cliprect, screen->machine->gfx[2], flip);
+ draw_sprites(bitmap, cliprect, screen->machine().gfx[2], flip);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c
index c5b5b69296d..3f372b7a4db 100644
--- a/src/mame/video/mystwarr.c
+++ b/src/mame/video/mystwarr.c
@@ -13,18 +13,18 @@
// create a decoding buffer to hold decodable tiles so that the ROM test will pass by
// reading the original raw data
-static void mystwarr_decode_tiles(running_machine *machine)
+static void mystwarr_decode_tiles(running_machine &machine)
{
- UINT8 *s = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *s = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
UINT8 *pFinish = s+len-3;
UINT8 *d, *decoded;
int gfxnum;
- for (gfxnum = 0; gfxnum < ARRAY_LENGTH(machine->gfx); gfxnum++)
- if (machine->gfx[gfxnum] != NULL && machine->gfx[gfxnum]->srcdata == s)
+ for (gfxnum = 0; gfxnum < ARRAY_LENGTH(machine.gfx); gfxnum++)
+ if (machine.gfx[gfxnum] != NULL && machine.gfx[gfxnum]->srcdata == s)
break;
- assert(gfxnum != ARRAY_LENGTH(machine->gfx));
+ assert(gfxnum != ARRAY_LENGTH(machine.gfx));
decoded = auto_alloc_array(machine, UINT8, len);
d = decoded;
@@ -55,45 +55,45 @@ static void mystwarr_decode_tiles(running_machine *machine)
d += 5;
}
- gfx_element_set_source(machine->gfx[gfxnum], decoded);
+ gfx_element_set_source(machine.gfx[gfxnum], decoded);
}
// Mystic Warriors requires tile based blending.
-static void mystwarr_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void mystwarr_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
if (layer==1) {if ((*code&0xff00)+(*color)==0x4101) state->cbparam++; else state->cbparam--;} //* water hack (TEMPORARY)
*color = state->layer_colorbase[layer] | (*color>>1 & 0x1f);
}
// for games with 5bpp tile data
-static void game5bpp_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void game5bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
*color = state->layer_colorbase[layer] | (*color>>1 & 0x1f);
}
// for games with 4bpp tile data
-static void game4bpp_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+static void game4bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
*color = state->layer_colorbase[layer] | (*color>>2 & 0x0f);
}
-static void mystwarr_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void mystwarr_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int c = *color;
*color = state->sprite_colorbase | (c & 0x001f);
*priority = c & 0x00f0;
}
-static void metamrph_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void metamrph_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int c = *color;
int attr = c;
@@ -112,18 +112,18 @@ static void metamrph_sprite_callback(running_machine *machine, int *code, int *c
}
}
-static void gaiapols_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void gaiapols_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int c = *color;
*color = state->sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f);
*priority = c & 0x00e0;
}
-static void martchmp_sprite_callback(running_machine *machine, int *code, int *color, int *priority)
+static void martchmp_sprite_callback(running_machine &machine, int *code, int *color, int *priority)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int c = *color;
// Bit8 & 9 are effect attributes. It is not known whether the effects are generated by external logic.
@@ -142,9 +142,9 @@ static void martchmp_sprite_callback(running_machine *machine, int *code, int *c
static TILE_GET_INFO( get_gai_936_tile_info )
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int tileno, colour;
- UINT8 *ROM = machine->region("gfx4")->base();
+ UINT8 *ROM = machine.region("gfx4")->base();
UINT8 *dat1 = ROM, *dat2 = ROM + 0x20000, *dat3 = ROM + 0x60000;
tileno = dat3[tile_index] | ((dat2[tile_index]&0x3f)<<8);
@@ -163,7 +163,7 @@ static TILE_GET_INFO( get_gai_936_tile_info )
VIDEO_START(gaiapols)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
K055555_vh_start(machine);
K054338_vh_start(machine);
@@ -191,9 +191,9 @@ VIDEO_START(gaiapols)
static TILE_GET_INFO( get_ult_936_tile_info )
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
int tileno, colour;
- UINT8 *ROM = machine->region("gfx4")->base();
+ UINT8 *ROM = machine.region("gfx4")->base();
UINT8 *dat1 = ROM, *dat2 = ROM + 0x40000;
tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8);
@@ -205,7 +205,7 @@ static TILE_GET_INFO( get_ult_936_tile_info )
VIDEO_START(dadandrn)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
K055555_vh_start(machine);
K054338_vh_start(machine);
@@ -235,7 +235,7 @@ VIDEO_START(dadandrn)
VIDEO_START(mystwarr)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
K055555_vh_start(machine);
K054338_vh_start(machine);
@@ -259,7 +259,7 @@ VIDEO_START(mystwarr)
VIDEO_START(metamrph)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
const char * rgn_250 = "gfx3";
state->gametype = 0;
@@ -287,7 +287,7 @@ VIDEO_START(metamrph)
VIDEO_START(viostorm)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
state->gametype = 0;
K055555_vh_start(machine);
@@ -309,7 +309,7 @@ VIDEO_START(viostorm)
VIDEO_START(martchmp)
{
- mystwarr_state *state = machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = machine.driver_data<mystwarr_state>();
state->gametype = 0;
K055555_vh_start(machine);
@@ -335,7 +335,7 @@ VIDEO_START(martchmp)
SCREEN_UPDATE(mystwarr)
{
- mystwarr_state *state = screen->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = screen->machine().driver_data<mystwarr_state>();
int i, old, blendmode=0;
if (state->cbparam<0) state->cbparam=0; else if (state->cbparam>=32) blendmode=(1<<16|GXMIX_BLEND_FORCE)<<2; //* water hack (TEMPORARY)
@@ -349,13 +349,13 @@ SCREEN_UPDATE(mystwarr)
state->sprite_colorbase = K055555_get_palette_index(4)<<5;
- konamigx_mixer(screen->machine, bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
return 0;
}
SCREEN_UPDATE(metamrph)
{
- mystwarr_state *state = screen->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = screen->machine().driver_data<mystwarr_state>();
int i, old;
for (i = 0; i < 4; i++)
@@ -367,13 +367,13 @@ SCREEN_UPDATE(metamrph)
state->sprite_colorbase = K055555_get_palette_index(4)<<4;
- konamigx_mixer(screen->machine, bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, 0, GXSUB_K053250 | GXSUB_4BPP, 0, 0, 0, 0, 0);
return 0;
}
SCREEN_UPDATE(martchmp)
{
- mystwarr_state *state = screen->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = screen->machine().driver_data<mystwarr_state>();
int i, old, blendmode;
for (i = 0; i < 4; i++)
@@ -391,7 +391,7 @@ SCREEN_UPDATE(martchmp)
// not quite right
blendmode = (state->oinprion==0xef && K054338_read_register(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0;
- konamigx_mixer(screen->machine, bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, 0, 0, 0, 0, blendmode, 0, 0);
return 0;
}
@@ -399,7 +399,7 @@ SCREEN_UPDATE(martchmp)
WRITE16_HANDLER(ddd_053936_enable_w)
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
if (ACCESSING_BITS_8_15)
{
state->roz_enable = data & 0x0100;
@@ -409,7 +409,7 @@ WRITE16_HANDLER(ddd_053936_enable_w)
WRITE16_HANDLER(ddd_053936_clip_w)
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
int old, clip_x, clip_y, size_x, size_y;
int minx, maxx, miny, maxy;
@@ -455,8 +455,8 @@ WRITE16_HANDLER(ddd_053936_clip_w)
// reference: 223e5c in gaiapolis (ROMs 34j and 36m)
READ16_HANDLER(gai_053936_tilerom_0_r)
{
- UINT8 *ROM1 = (UINT8 *)space->machine->region("gfx4")->base();
- UINT8 *ROM2 = (UINT8 *)space->machine->region("gfx4")->base();
+ UINT8 *ROM1 = (UINT8 *)space->machine().region("gfx4")->base();
+ UINT8 *ROM2 = (UINT8 *)space->machine().region("gfx4")->base();
ROM1 += 0x20000;
ROM2 += 0x20000+0x40000;
@@ -466,8 +466,8 @@ READ16_HANDLER(gai_053936_tilerom_0_r)
READ16_HANDLER(ddd_053936_tilerom_0_r)
{
- UINT8 *ROM1 = (UINT8 *)space->machine->region("gfx4")->base();
- UINT8 *ROM2 = (UINT8 *)space->machine->region("gfx4")->base();
+ UINT8 *ROM1 = (UINT8 *)space->machine().region("gfx4")->base();
+ UINT8 *ROM2 = (UINT8 *)space->machine().region("gfx4")->base();
ROM2 += 0x40000;
@@ -477,7 +477,7 @@ READ16_HANDLER(ddd_053936_tilerom_0_r)
// reference: 223e1a in gaiapolis (ROM 36j)
READ16_HANDLER(ddd_053936_tilerom_1_r)
{
- UINT8 *ROM = (UINT8 *)space->machine->region("gfx4")->base();
+ UINT8 *ROM = (UINT8 *)space->machine().region("gfx4")->base();
return ROM[offset/2];
}
@@ -485,8 +485,8 @@ READ16_HANDLER(ddd_053936_tilerom_1_r)
// reference: 223db0 in gaiapolis (ROMs 32n, 29n, 26n)
READ16_HANDLER(gai_053936_tilerom_2_r)
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
- UINT8 *ROM = (UINT8 *)space->machine->region("gfx3")->base();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
+ UINT8 *ROM = (UINT8 *)space->machine().region("gfx3")->base();
offset += (state->roz_rombank * 0x100000);
@@ -495,8 +495,8 @@ READ16_HANDLER(gai_053936_tilerom_2_r)
READ16_HANDLER(ddd_053936_tilerom_2_r)
{
- mystwarr_state *state = space->machine->driver_data<mystwarr_state>();
- UINT8 *ROM = (UINT8 *)space->machine->region("gfx3")->base();
+ mystwarr_state *state = space->machine().driver_data<mystwarr_state>();
+ UINT8 *ROM = (UINT8 *)space->machine().region("gfx3")->base();
offset += (state->roz_rombank * 0x100000);
@@ -505,7 +505,7 @@ READ16_HANDLER(ddd_053936_tilerom_2_r)
SCREEN_UPDATE(dadandrn) /* and gaiapols */
{
- mystwarr_state *state = screen->machine->driver_data<mystwarr_state>();
+ mystwarr_state *state = screen->machine().driver_data<mystwarr_state>();
int i, newbase, dirty, rozmode;
if (state->gametype == 0)
@@ -557,6 +557,6 @@ SCREEN_UPDATE(dadandrn) /* and gaiapols */
popmessage("K053936: PSAC colorbase changed");
}
- konamigx_mixer(screen->machine, bitmap, cliprect, (state->roz_enable) ? state->ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0);
+ konamigx_mixer(screen->machine(), bitmap, cliprect, (state->roz_enable) ? state->ult_936_tilemap : 0, rozmode, 0, 0, 0, 0, 0);
return 0;
}
diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c
index 9dba8c1eb8d..6592a711b8b 100644
--- a/src/mame/video/n64.c
+++ b/src/mame/video/n64.c
@@ -182,7 +182,7 @@ void Processor::VideoUpdate16(bitmap_t *bitmap)
/*
if (gamma_dither)
{
- dith = screen->machine->rand() & 0x3f;
+ dith = screen->machine().rand() & 0x3f;
}
if (gamma)
{
@@ -1733,15 +1733,15 @@ void N64::RDP::Processor::Dasm(char *buffer)
/*****************************************************************************/
-N64::RDP::Triangle::Triangle(running_machine *machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip)
+N64::RDP::Triangle::Triangle(running_machine &machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip)
{
InitFromData(machine, shade, texture, zbuffer, rect, flip);
}
-void N64::RDP::Triangle::InitFromData(running_machine *machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip)
+void N64::RDP::Triangle::InitFromData(running_machine &machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip)
{
- m_machine = machine;
- m_rdp = &(machine->driver_data<_n64_state>())->m_rdp;
+ m_machine = &machine;
+ m_rdp = &(machine.driver_data<_n64_state>())->m_rdp;
m_cmd_data = rect ? m_rdp->GetTempRectData() : m_rdp->GetCommandData();
m_misc_state = m_rdp->GetMiscState();
m_shade = shade;
@@ -2261,7 +2261,7 @@ void N64::RDP::Triangle::Draw()
void N64::RDP::Processor::Triangle(bool shade, bool texture, bool zbuffer)
{
- N64::RDP::Triangle tri(m_machine, shade, texture, zbuffer, false, false);
+ N64::RDP::Triangle tri(*m_machine, shade, texture, zbuffer, false, false);
tri.Draw();
}
@@ -2361,7 +2361,7 @@ void N64::RDP::Processor::CmdTexRect(UINT32 w1, UINT32 w2)
ewdata[39] = 0;//dwdy frac
memset(&ewdata[40], 0, 4 * sizeof(UINT32));//depth
- N64::RDP::Triangle tri(m_machine, true, true, false, true, false);
+ N64::RDP::Triangle tri(*m_machine, true, true, false, true, false);
tri.Draw();
}
@@ -2421,7 +2421,7 @@ void N64::RDP::Processor::CmdTexRectFlip(UINT32 w1, UINT32 w2)
ewdata[39] = 0;//dwdy frac
memset(&ewdata[40], 0, 4 * sizeof(UINT32));//depth
- N64::RDP::Triangle tri(m_machine, true, true, false, true, false);
+ N64::RDP::Triangle tri(*m_machine, true, true, false, true, false);
tri.Draw();
}
@@ -2442,7 +2442,7 @@ void N64::RDP::Processor::CmdSyncTile(UINT32 w1, UINT32 w2)
void N64::RDP::Processor::CmdSyncFull(UINT32 w1, UINT32 w2)
{
- dp_full_sync(m_machine);
+ dp_full_sync(*m_machine);
}
void N64::RDP::Processor::CmdSetKeyGB(UINT32 w1, UINT32 w2)
@@ -2931,7 +2931,7 @@ void N64::RDP::Processor::CmdFillRect(UINT32 w1, UINT32 w2)
ewdata[7] = 0;//dxmdy, dxmdy frac
memset(&ewdata[8], 0, 36 * sizeof(UINT32));//shade, texture, depth
- N64::RDP::Triangle tri(m_machine, false, false, false, true, false);
+ N64::RDP::Triangle tri(*m_machine, false, false, false, true, false);
tri.Draw();
}
@@ -3245,7 +3245,7 @@ void N64::RDP::Processor::ProcessList()
VIDEO_START(n64)
{
- _n64_state *state = machine->driver_data<_n64_state>();
+ _n64_state *state = machine.driver_data<_n64_state>();
state->m_rdp.SetMachine(machine);
state->m_rdp.InitInternalState();
@@ -3269,7 +3269,7 @@ VIDEO_START(n64)
SCREEN_UPDATE(n64)
{
- _n64_state *state = screen->machine->driver_data<_n64_state>();
+ _n64_state *state = screen->machine().driver_data<_n64_state>();
int height = state->m_rdp.GetMiscState()->m_fb_height;
//UINT16 *frame_buffer = (UINT16*)&rdram[(n64_vi_origin & 0xffffff) >> 2];
diff --git a/src/mame/video/n64.h b/src/mame/video/n64.h
index 262c1ebd068..f4c71a080cc 100644
--- a/src/mame/video/n64.h
+++ b/src/mame/video/n64.h
@@ -424,7 +424,7 @@ class Processor
{
if(m_machine)
{
- m_tmem = auto_alloc_array(m_machine, UINT8, 0x1000);
+ m_tmem = auto_alloc_array(*m_machine, UINT8, 0x1000);
memset(m_tmem, 0, 0x1000);
UINT8 *normpoint = m_machine->region("normpoint")->base();
@@ -438,7 +438,7 @@ class Processor
}
}
- void SetMachine(running_machine* machine) { m_machine = machine; }
+ void SetMachine(running_machine& machine) { m_machine = &machine; }
// CPU-visible registers
void SetStartReg(UINT32 val) { m_start = val; }
diff --git a/src/mame/video/n8080.c b/src/mame/video/n8080.c
index d4adeaced32..658032c784f 100644
--- a/src/mame/video/n8080.c
+++ b/src/mame/video/n8080.c
@@ -10,11 +10,11 @@
WRITE8_HANDLER( n8080_video_control_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
state->sheriff_color_mode = (data >> 3) & 3;
state->sheriff_color_data = (data >> 0) & 7;
- flip_screen_set_no_update(space->machine, data & 0x20);
+ flip_screen_set_no_update(space->machine(), data & 0x20);
}
@@ -46,9 +46,9 @@ PALETTE_INIT( helifire )
}
-void spacefev_start_red_cannon( running_machine *machine )
+void spacefev_start_red_cannon( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->spacefev_red_cannon = 1;
state->cannon_timer->adjust(attotime::from_usec(550 * 68 * 10));
@@ -57,16 +57,16 @@ void spacefev_start_red_cannon( running_machine *machine )
static TIMER_CALLBACK( spacefev_stop_red_cannon )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->spacefev_red_cannon = 0;
state->cannon_timer->adjust(attotime::never);
}
-static void helifire_next_line( running_machine *machine )
+static void helifire_next_line( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->helifire_mv++;
@@ -91,9 +91,9 @@ static void helifire_next_line( running_machine *machine )
VIDEO_START( spacefev )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->cannon_timer = machine->scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon));
+ state->cannon_timer = machine.scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon));
flip_screen_set_no_update(machine, 0);
@@ -104,7 +104,7 @@ VIDEO_START( spacefev )
VIDEO_START( sheriff )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
flip_screen_set_no_update(machine, 0);
@@ -115,7 +115,7 @@ VIDEO_START( sheriff )
VIDEO_START( helifire )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT8 data = 0;
int i;
@@ -141,14 +141,14 @@ VIDEO_START( helifire )
SCREEN_UPDATE( spacefev )
{
- n8080_state *state = screen->machine->driver_data<n8080_state>();
- UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00;
+ n8080_state *state = screen->machine().driver_data<n8080_state>();
+ UINT8 mask = flip_screen_get(screen->machine()) ? 0xff : 0x00;
int x;
int y;
const UINT8* pRAM = state->videoram;
- const UINT8* pPROM = screen->machine->region("proms")->base();
+ const UINT8* pPROM = screen->machine().region("proms")->base();
for (y = 0; y < 256; y++)
{
@@ -211,10 +211,10 @@ SCREEN_UPDATE( spacefev )
SCREEN_UPDATE( sheriff )
{
- n8080_state *state = screen->machine->driver_data<n8080_state>();
- UINT8 mask = flip_screen_get(screen->machine) ? 0xff : 0x00;
+ n8080_state *state = screen->machine().driver_data<n8080_state>();
+ UINT8 mask = flip_screen_get(screen->machine()) ? 0xff : 0x00;
- const UINT8* pPROM = screen->machine->region("proms")->base();
+ const UINT8* pPROM = screen->machine().region("proms")->base();
int x;
int y;
@@ -254,9 +254,9 @@ SCREEN_UPDATE( sheriff )
SCREEN_UPDATE( helifire )
{
- n8080_state *state = screen->machine->driver_data<n8080_state>();
- int SUN_BRIGHTNESS = input_port_read(screen->machine, "POT0");
- int SEA_BRIGHTNESS = input_port_read(screen->machine, "POT1");
+ n8080_state *state = screen->machine().driver_data<n8080_state>();
+ int SUN_BRIGHTNESS = input_port_read(screen->machine(), "POT0");
+ int SEA_BRIGHTNESS = input_port_read(screen->machine(), "POT1");
static const int wave[8] = { 0, 1, 2, 2, 2, 1, 0, 0 };
@@ -324,7 +324,7 @@ SCREEN_UPDATE( helifire )
for (n = 0; n < 8; n++)
{
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
if ((state->videoram[offset ^ 0x1fff] << n) & 0x80)
{
@@ -343,7 +343,7 @@ SCREEN_UPDATE( helifire )
/* next line */
- helifire_next_line(screen->machine);
+ helifire_next_line(screen->machine());
}
state->helifire_mv = saved_mv;
@@ -354,8 +354,8 @@ SCREEN_UPDATE( helifire )
SCREEN_EOF( helifire )
{
- n8080_state *state = machine->driver_data<n8080_state>();
- int n = (machine->primary_screen->frame_number() >> 1) % sizeof state->helifire_LSFR;
+ n8080_state *state = machine.driver_data<n8080_state>();
+ int n = (machine.primary_screen->frame_number() >> 1) % sizeof state->helifire_LSFR;
int i;
@@ -372,7 +372,7 @@ SCREEN_EOF( helifire )
G |= B;
}
- if (machine->primary_screen->frame_number() & 0x04)
+ if (machine.primary_screen->frame_number() & 0x04)
{
R |= G;
}
diff --git a/src/mame/video/namcofl.c b/src/mame/video/namcofl.c
index 497bc72e433..59ff334c719 100644
--- a/src/mame/video/namcofl.c
+++ b/src/mame/video/namcofl.c
@@ -46,7 +46,7 @@ nth_byte32( const UINT32 *pSource, int which )
} /* nth_byte32 */
#endif
-static void namcofl_install_palette(running_machine *machine)
+static void namcofl_install_palette(running_machine &machine)
{
int pen, page, dword_offset, byte_offset;
UINT32 r,g,b;
@@ -58,7 +58,7 @@ static void namcofl_install_palette(running_machine *machine)
pen = 0;
for( page=0; page<4; page++ )
{
- pSource = &machine->generic.paletteram.u32[page*0x2000/4];
+ pSource = &machine.generic.paletteram.u32[page*0x2000/4];
for( dword_offset=0; dword_offset<0x800/4; dword_offset++ )
{
r = pSource[dword_offset+0x0000/4];
@@ -73,7 +73,7 @@ static void namcofl_install_palette(running_machine *machine)
}
}
}
-static void TilemapCB(running_machine *machine, UINT16 code, int *tile, int *mask )
+static void TilemapCB(running_machine &machine, UINT16 code, int *tile, int *mask )
{
*tile = code;
*mask = code;
@@ -84,16 +84,16 @@ SCREEN_UPDATE( namcofl )
{
int pri;
- namcofl_install_palette(screen->machine);
+ namcofl_install_palette(screen->machine());
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
for( pri=0; pri<16; pri++ )
{
namco_roz_draw( bitmap,cliprect,pri );
if((pri&1)==0)
namco_tilemap_draw( bitmap, cliprect, pri>>1 );
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}
return 0;
@@ -105,13 +105,13 @@ SCREEN_UPDATE( namcofl )
WRITE32_HANDLER(namcofl_spritebank_w)
{
- namcofl_state *state = space->machine->driver_data<namcofl_state>();
+ namcofl_state *state = space->machine().driver_data<namcofl_state>();
COMBINE_DATA(&state->sprbank);
}
-static int FLobjcode2tile( running_machine *machine, int code )
+static int FLobjcode2tile( running_machine &machine, int code )
{
- namcofl_state *state = machine->driver_data<namcofl_state>();
+ namcofl_state *state = machine.driver_data<namcofl_state>();
if ((code & 0x2000) && (state->sprbank & 2)) { code += 0x4000; }
return code;
@@ -119,7 +119,7 @@ static int FLobjcode2tile( running_machine *machine, int code )
VIDEO_START( namcofl )
{
- namco_tilemap_init( machine, NAMCOFL_TILEGFX, machine->region(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
+ namco_tilemap_init( machine, NAMCOFL_TILEGFX, machine.region(NAMCOFL_TILEMASKREGION)->base(), TilemapCB );
namco_obj_init(machine,NAMCOFL_SPRITEGFX,0x0,FLobjcode2tile);
namco_roz_init(machine,NAMCOFL_ROTGFX,NAMCOFL_ROTMASKREGION);
}
diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c
index 9f0996ad5aa..75418257eb7 100644
--- a/src/mame/video/namcona1.c
+++ b/src/mame/video/namcona1.c
@@ -11,14 +11,14 @@ TODO:
static void tilemap_get_info(
- running_machine *machine,
+ running_machine &machine,
tile_data *tileinfo,
int tile_index,
const UINT16 *tilemap_videoram,
int tilemap_color,
int use_4bpp_gfx )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *source;
int data = tilemap_videoram[tile_index];
@@ -64,35 +64,35 @@ static void tilemap_get_info(
static TILE_GET_INFO( tilemap_get_info0 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
tilemap_get_info(machine,tileinfo,tile_index,0*0x1000+videoram,state->tilemap_palette_bank[0],state->vreg[0xbc/2]&1);
}
static TILE_GET_INFO( tilemap_get_info1 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
tilemap_get_info(machine,tileinfo,tile_index,1*0x1000+videoram,state->tilemap_palette_bank[1],state->vreg[0xbc/2]&2);
}
static TILE_GET_INFO( tilemap_get_info2 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
tilemap_get_info(machine,tileinfo,tile_index,2*0x1000+videoram,state->tilemap_palette_bank[2],state->vreg[0xbc/2]&4);
}
static TILE_GET_INFO( tilemap_get_info3 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
tilemap_get_info(machine,tileinfo,tile_index,3*0x1000+videoram,state->tilemap_palette_bank[3],state->vreg[0xbc/2]&8);
}
static TILE_GET_INFO( roz_get_info )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
/* each logical tile is constructed from 4*4 normal tiles */
int tilemap_color = state->roz_palette;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( roz_get_info )
WRITE16_HANDLER( namcona1_videoram_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA( &videoram[offset] );
if( offset<0x8000/2 )
@@ -153,7 +153,7 @@ WRITE16_HANDLER( namcona1_videoram_w )
READ16_HANDLER( namcona1_videoram_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
return videoram[offset];
} /* namcona1_videoram_r */
@@ -161,9 +161,9 @@ READ16_HANDLER( namcona1_videoram_r )
/*************************************************************************/
static void
-UpdatePalette(running_machine *machine, int offset )
+UpdatePalette(running_machine &machine, int offset )
{
- UINT16 data = machine->generic.paletteram.u16[offset]; /* -RRRRRGG GGGBBBBB */
+ UINT16 data = machine.generic.paletteram.u16[offset]; /* -RRRRRGG GGGBBBBB */
/**
* sprites can be configured to use an alternate interpretation of palette ram
* (used in-game in Emeraldia)
@@ -180,16 +180,16 @@ UpdatePalette(running_machine *machine, int offset )
READ16_HANDLER( namcona1_paletteram_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
} /* namcona1_paletteram_r */
WRITE16_HANDLER( namcona1_paletteram_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
- COMBINE_DATA( &space->machine->generic.paletteram.u16[offset] );
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
+ COMBINE_DATA( &space->machine().generic.paletteram.u16[offset] );
if( state->vreg[0x8e/2] )
{ /* graphics enabled; update palette immediately */
- UpdatePalette(space->machine, offset );
+ UpdatePalette(space->machine(), offset );
}
else
{
@@ -236,7 +236,7 @@ static const gfx_layout cg_layout_4bpp =
READ16_HANDLER( namcona1_gfxram_r )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
UINT16 type = state->vreg[0x0c/2];
if( type == 0x03 )
{
@@ -254,7 +254,7 @@ READ16_HANDLER( namcona1_gfxram_r )
WRITE16_HANDLER( namcona1_gfxram_w )
{
- namcona1_state *state = space->machine->driver_data<namcona1_state>();
+ namcona1_state *state = space->machine().driver_data<namcona1_state>();
UINT16 type = state->vreg[0x0c/2];
UINT16 old_word;
@@ -265,7 +265,7 @@ WRITE16_HANDLER( namcona1_gfxram_w )
old_word = state->shaperam[offset];
COMBINE_DATA( &state->shaperam[offset] );
if( state->shaperam[offset]!=old_word )
- gfx_element_mark_dirty(space->machine->gfx[2], offset/4);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/4);
}
}
else if( type == 0x02 )
@@ -274,19 +274,19 @@ WRITE16_HANDLER( namcona1_gfxram_w )
COMBINE_DATA( &state->cgram[offset] );
if( state->cgram[offset]!=old_word )
{
- gfx_element_mark_dirty(space->machine->gfx[0], offset/0x20);
- gfx_element_mark_dirty(space->machine->gfx[1], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/0x20);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/0x20);
}
}
} /* namcona1_gfxram_w */
-static void UpdateGfx(running_machine *machine)
+static void UpdateGfx(running_machine &machine)
{
} /* UpdateGfx */
VIDEO_START( namcona1 )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
static const tile_get_info_func get_info[4] = { tilemap_get_info0, tilemap_get_info1, tilemap_get_info2, tilemap_get_info3 };
int i;
@@ -302,15 +302,15 @@ VIDEO_START( namcona1 )
state->shaperam = auto_alloc_array(machine, UINT16, 0x2000*4/2 );
state->cgram = auto_alloc_array(machine, UINT16, 0x1000*0x40/2 );
- machine->gfx[0] = gfx_element_alloc( machine, &cg_layout_8bpp, (UINT8 *)state->cgram, machine->total_colors()/256, 0 );
- machine->gfx[1] = gfx_element_alloc( machine, &cg_layout_4bpp, (UINT8 *)state->cgram, machine->total_colors()/16, 0 );
- machine->gfx[2] = gfx_element_alloc( machine, &shape_layout, (UINT8 *)state->shaperam, machine->total_colors()/2, 0 );
+ machine.gfx[0] = gfx_element_alloc( machine, &cg_layout_8bpp, (UINT8 *)state->cgram, machine.total_colors()/256, 0 );
+ machine.gfx[1] = gfx_element_alloc( machine, &cg_layout_4bpp, (UINT8 *)state->cgram, machine.total_colors()/16, 0 );
+ machine.gfx[2] = gfx_element_alloc( machine, &shape_layout, (UINT8 *)state->shaperam, machine.total_colors()/2, 0 );
} /* namcona1_vh_start */
/*************************************************************************/
-static void pdraw_tile(running_machine *machine,
+static void pdraw_tile(running_machine &machine,
bitmap_t *dest_bmp,
const rectangle *clip,
UINT32 code,
@@ -322,8 +322,8 @@ static void pdraw_tile(running_machine *machine,
int bOpaque,
int gfx_region )
{
- const gfx_element *gfx = machine->gfx[gfx_region];
- const gfx_element *mask = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[gfx_region];
+ const gfx_element *mask = machine.gfx[2];
int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, (code % gfx->total_elements));
@@ -400,7 +400,7 @@ static void pdraw_tile(running_machine *machine,
const UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
const UINT8 *mask_addr = mask_base + (y_index>>16) * mask->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
@@ -430,7 +430,7 @@ static void pdraw_tile(running_machine *machine,
if( (gfx_region == 0 && color == 0x0f) ||
(gfx_region == 1 && color == 0xff) )
{
- pen_t *palette_shadow_table = machine->shadow_table;
+ pen_t *palette_shadow_table = machine.shadow_table;
dest[x] = palette_shadow_table[dest[x]];
}
else
@@ -456,9 +456,9 @@ static void pdraw_tile(running_machine *machine,
}
} /* pdraw_tile */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
int which;
const UINT16 *source = state->spriteram;
UINT16 sprite_control;
@@ -553,9 +553,9 @@ static void draw_pixel_line( UINT16 *pDest, UINT8 *pPri, UINT16 *pSource, const
} /* next x */
} /* draw_pixel_line */
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int which, int primask )
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int which, int primask )
{
- namcona1_state *state = machine->driver_data<namcona1_state>();
+ namcona1_state *state = machine.driver_data<namcona1_state>();
UINT16 *videoram = state->videoram;
/* scrollx lineselect
* tmap0 ffe000 ffe200
@@ -572,8 +572,8 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
const pen_t *paldata;
gfx_element *pGfx;
- pGfx = machine->gfx[0];
- paldata = &machine->pens[pGfx->color_base + pGfx->color_granularity * state->tilemap_palette_bank[which]];
+ pGfx = machine.gfx[0];
+ paldata = &machine.pens[pGfx->color_base + pGfx->color_granularity * state->tilemap_palette_bank[which]];
/* draw one scanline at a time */
clip.min_x = cliprect->min_x;
@@ -606,7 +606,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
*/
draw_pixel_line(
BITMAP_ADDR16(bitmap, line, 0),
- BITMAP_ADDR8(machine->priority_bitmap, line, 0),
+ BITMAP_ADDR8(machine.priority_bitmap, line, 0),
videoram + ydata + 25,
paldata );
}
@@ -640,7 +640,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( namcona1 )
{
- namcona1_state *state = screen->machine->driver_data<namcona1_state>();
+ namcona1_state *state = screen->machine().driver_data<namcona1_state>();
int which;
int priority;
@@ -653,11 +653,11 @@ SCREEN_UPDATE( namcona1 )
/* palette updates are delayed when graphics are disabled */
for( which=0; which<0x1000; which++ )
{
- UpdatePalette(screen->machine, which );
+ UpdatePalette(screen->machine(), which );
}
state->palette_is_dirty = 0;
}
- UpdateGfx(screen->machine);
+ UpdateGfx(screen->machine());
for( which=0; which<NAMCONA1_NUM_TILEMAPS; which++ )
{
int tilemap_color = state->vreg[0xb0/2+(which&3)]&0xf;
@@ -677,7 +677,7 @@ SCREEN_UPDATE( namcona1 )
}
}
- bitmap_fill( screen->machine->priority_bitmap,cliprect ,0);
+ bitmap_fill( screen->machine().priority_bitmap,cliprect ,0);
bitmap_fill( bitmap, cliprect , 0xff); /* background color? */
@@ -696,12 +696,12 @@ SCREEN_UPDATE( namcona1 )
}
if( pri == priority )
{
- draw_background(screen->machine,bitmap,cliprect,which,priority);
+ draw_background(screen->machine(),bitmap,cliprect,which,priority);
}
} /* next tilemap */
} /* next priority level */
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
} /* gfx enabled */
return 0;
}
diff --git a/src/mame/video/namconb1.c b/src/mame/video/namconb1.c
index c0bf5ce582e..beb3d8d2d80 100644
--- a/src/mame/video/namconb1.c
+++ b/src/mame/video/namconb1.c
@@ -41,16 +41,16 @@ nth_byte32( const UINT32 *pSource, int which )
} /* nth_byte32 */
static void
-NB1TilemapCB(running_machine *machine, UINT16 code, int *tile, int *mask )
+NB1TilemapCB(running_machine &machine, UINT16 code, int *tile, int *mask )
{
*tile = code;
*mask = code;
} /* NB1TilemapCB */
static void
-NB2TilemapCB(running_machine *machine, UINT16 code, int *tile, int *mask )
+NB2TilemapCB(running_machine &machine, UINT16 code, int *tile, int *mask )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
int mangle;
if( namcos2_gametype == NAMCONB2_MACH_BREAKERS )
@@ -73,7 +73,7 @@ NB2TilemapCB(running_machine *machine, UINT16 code, int *tile, int *mask )
}
} /* NB2TilemapCB */
-static void namconb1_install_palette(running_machine *machine)
+static void namconb1_install_palette(running_machine &machine)
{
int pen, page, dword_offset, byte_offset;
UINT32 r,g,b;
@@ -86,7 +86,7 @@ static void namconb1_install_palette(running_machine *machine)
pen = 0;
for( page=0; page<4; page++ )
{
- pSource = &machine->generic.paletteram.u32[page*0x2000/4];
+ pSource = &machine.generic.paletteram.u32[page*0x2000/4];
for( dword_offset=0; dword_offset<0x800/4; dword_offset++ )
{
r = pSource[dword_offset+0x0000/4];
@@ -103,7 +103,7 @@ static void namconb1_install_palette(running_machine *machine)
} /* namconb1_install_palette */
static void
-video_update_common(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bROZ )
+video_update_common(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bROZ )
{
int pri;
namconb1_install_palette(machine);
@@ -137,8 +137,8 @@ SCREEN_UPDATE( namconb1 )
/* compute window for custom screen blanking */
rectangle clip;
//004a 016a 0021 0101 0144 0020 (nebulas ray)
- UINT32 xclip = screen->machine->generic.paletteram.u32[0x1800/4];
- UINT32 yclip = screen->machine->generic.paletteram.u32[0x1804/4];
+ UINT32 xclip = screen->machine().generic.paletteram.u32[0x1800/4];
+ UINT32 yclip = screen->machine().generic.paletteram.u32[0x1804/4];
clip.min_x = (xclip>>16) - 0x4a;
clip.max_x = (xclip&0xffff) - 0x4a - 1;
clip.min_y = (yclip>>16) - 0x21;
@@ -149,24 +149,24 @@ SCREEN_UPDATE( namconb1 )
if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
- video_update_common( screen->machine, bitmap, &clip, 0 );
+ video_update_common( screen->machine(), bitmap, &clip, 0 );
return 0;
}
static int
-NB1objcode2tile( running_machine *machine, int code )
+NB1objcode2tile( running_machine &machine, int code )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
int bank = nth_word32( state->spritebank32, code>>11 );
return (code&0x7ff) + bank*0x800;
}
VIDEO_START( namconb1 )
{
- namco_tilemap_init( machine, NAMCONB1_TILEGFX, machine->region(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
+ namco_tilemap_init( machine, NAMCONB1_TILEGFX, machine.region(NAMCONB1_TILEMASKREGION)->base(), NB1TilemapCB );
namco_obj_init(machine,NAMCONB1_SPRITEGFX,0x0,NB1objcode2tile);
} /* namconb1 */
@@ -174,12 +174,12 @@ VIDEO_START( namconb1 )
SCREEN_UPDATE( namconb2 )
{
- namconb1_state *state = screen->machine->driver_data<namconb1_state>();
+ namconb1_state *state = screen->machine().driver_data<namconb1_state>();
/* compute window for custom screen blanking */
rectangle clip;
//004a016a 00210101 01440020
- UINT32 xclip = screen->machine->generic.paletteram.u32[0x1800/4];
- UINT32 yclip = screen->machine->generic.paletteram.u32[0x1804/4];
+ UINT32 xclip = screen->machine().generic.paletteram.u32[0x1800/4];
+ UINT32 yclip = screen->machine().generic.paletteram.u32[0x1804/4];
clip.min_x = (xclip>>16) - 0x4b;
clip.max_x = (xclip&0xffff) - 0x4b - 1;
clip.min_y = (yclip>>16) - 0x21;
@@ -190,21 +190,21 @@ SCREEN_UPDATE( namconb2 )
if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
if( memcmp(state->tilemap_tile_bank,state->tilebank32,sizeof(state->tilemap_tile_bank))!=0 )
{
namco_tilemap_invalidate();
memcpy(state->tilemap_tile_bank,state->tilebank32,sizeof(state->tilemap_tile_bank));
}
- video_update_common( screen->machine, bitmap, &clip, 1 );
+ video_update_common( screen->machine(), bitmap, &clip, 1 );
return 0;
}
static int
-NB2objcode2tile( running_machine *machine, int code )
+NB2objcode2tile( running_machine &machine, int code )
{
- namconb1_state *state = machine->driver_data<namconb1_state>();
+ namconb1_state *state = machine.driver_data<namconb1_state>();
int bank = nth_byte32( state->spritebank32, (code>>11)&0xf );
code &= 0x7ff;
if( namcos2_gametype == NAMCONB2_MACH_BREAKERS )
@@ -230,7 +230,7 @@ NB2objcode2tile( running_machine *machine, int code )
VIDEO_START( namconb2 )
{
- namco_tilemap_init(machine, NAMCONB1_TILEGFX, machine->region(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
+ namco_tilemap_init(machine, NAMCONB1_TILEGFX, machine.region(NAMCONB1_TILEMASKREGION)->base(), NB2TilemapCB );
namco_obj_init(machine,NAMCONB1_SPRITEGFX,0x0,NB2objcode2tile);
namco_roz_init(machine, NAMCONB1_ROTGFX,NAMCONB1_ROTMASKREGION);
} /* namconb2_vh_start */
diff --git a/src/mame/video/namcos1.c b/src/mame/video/namcos1.c
index 59f4cfc3faf..615d21f3253 100644
--- a/src/mame/video/namcos1.c
+++ b/src/mame/video/namcos1.c
@@ -50,9 +50,9 @@ Namco System 1 Video Hardware
***************************************************************************/
-INLINE void bg_get_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT8 *info_vram)
+INLINE void bg_get_info(running_machine &machine,tile_data *tileinfo,int tile_index,UINT8 *info_vram)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
int code;
tile_index <<= 1;
@@ -61,9 +61,9 @@ INLINE void bg_get_info(running_machine *machine,tile_data *tileinfo,int tile_in
tileinfo->mask_data = &state->tilemap_maskdata[code << 3];
}
-INLINE void fg_get_info(running_machine *machine,tile_data *tileinfo,int tile_index,UINT8 *info_vram)
+INLINE void fg_get_info(running_machine &machine,tile_data *tileinfo,int tile_index,UINT8 *info_vram)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
int code;
tile_index <<= 1;
@@ -74,37 +74,37 @@ INLINE void fg_get_info(running_machine *machine,tile_data *tileinfo,int tile_in
static TILE_GET_INFO( bg_get_info0 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
bg_get_info(machine,tileinfo,tile_index,&state->videoram[0x0000]);
}
static TILE_GET_INFO( bg_get_info1 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
bg_get_info(machine,tileinfo,tile_index,&state->videoram[0x2000]);
}
static TILE_GET_INFO( bg_get_info2 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
bg_get_info(machine,tileinfo,tile_index,&state->videoram[0x4000]);
}
static TILE_GET_INFO( bg_get_info3 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
bg_get_info(machine,tileinfo,tile_index,&state->videoram[0x6000]);
}
static TILE_GET_INFO( fg_get_info4 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
fg_get_info(machine,tileinfo,tile_index,&state->videoram[0x7010]);
}
static TILE_GET_INFO( fg_get_info5 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
fg_get_info(machine,tileinfo,tile_index,&state->videoram[0x7810]);
}
@@ -118,10 +118,10 @@ static TILE_GET_INFO( fg_get_info5 )
VIDEO_START( namcos1 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
int i;
- state->tilemap_maskdata = (UINT8 *)machine->region("gfx1")->base();
+ state->tilemap_maskdata = (UINT8 *)machine.region("gfx1")->base();
/* allocate videoram */
state->videoram = auto_alloc_array(machine, UINT8, 0x8000);
@@ -159,10 +159,10 @@ VIDEO_START( namcos1 )
/* all palette entries are not affected by shadow sprites... */
for (i = 0;i < 0x2000;i++)
- machine->shadow_table[i] = i;
+ machine.shadow_table[i] = i;
/* ... except for tilemap colors */
for (i = 0x0800;i < 0x1000;i++)
- machine->shadow_table[i] = i + 0x0800;
+ machine.shadow_table[i] = i + 0x0800;
memset(state->playfield_control, 0, sizeof(state->playfield_control));
state->copy_sprites = 0;
@@ -178,13 +178,13 @@ VIDEO_START( namcos1 )
READ8_HANDLER( namcos1_videoram_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( namcos1_videoram_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
state->videoram[offset] = data;
if (offset < 0x7000)
{ /* background 0-3 */
@@ -204,7 +204,7 @@ WRITE8_HANDLER( namcos1_videoram_w )
WRITE8_HANDLER( namcos1_paletteram_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
if (state->paletteram[offset] == data)
return;
@@ -219,7 +219,7 @@ WRITE8_HANDLER( namcos1_paletteram_w )
r = state->paletteram[offset];
g = state->paletteram[offset + 0x0800];
b = state->paletteram[offset + 0x1000];
- palette_set_color(space->machine,color,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),color,MAKE_RGB(r,g,b));
}
else
{
@@ -242,7 +242,7 @@ WRITE8_HANDLER( namcos1_paletteram_w )
READ8_HANDLER( namcos1_spriteram_r )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
/* 0000-07ff work ram */
/* 0800-0fff sprite ram */
if (offset < 0x1000)
@@ -254,7 +254,7 @@ READ8_HANDLER( namcos1_spriteram_r )
WRITE8_HANDLER( namcos1_spriteram_w )
{
- namcos1_state *state = space->machine->driver_data<namcos1_state>();
+ namcos1_state *state = space->machine().driver_data<namcos1_state>();
/* 0000-07ff work ram */
/* 0800-0fff sprite ram */
if (offset < 0x1000)
@@ -298,13 +298,13 @@ sprite format:
15 xxxxxxxx Y position
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
UINT8 *spriteram = state->spriteram + 0x800;
const UINT8 *source = &spriteram[0x800-0x20]; /* the last is NOT a sprite */
const UINT8 *finish = &spriteram[0];
- gfx_element *gfx = machine->gfx[1];
+ gfx_element *gfx = machine.gfx[1];
int sprite_xoffs = spriteram[0x07f5] + ((spriteram[0x07f4] & 1) << 8);
int sprite_yoffs = spriteram[0x07f7];
@@ -352,7 +352,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx,flipy,
sx & 0x1ff,
((sy + 16) & 0xff) - 16,
- machine->priority_bitmap, pri_mask,
+ machine.priority_bitmap, pri_mask,
0xf);
else
pdrawgfx_transtable( bitmap, cliprect, gfx,
@@ -361,8 +361,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx,flipy,
sx & 0x1ff,
((sy + 16) & 0xff) - 16,
- machine->priority_bitmap, pri_mask,
- state->drawmode_table, machine->shadow_table);
+ machine.priority_bitmap, pri_mask,
+ state->drawmode_table, machine.shadow_table);
source -= 0x10;
}
@@ -372,18 +372,18 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( namcos1 )
{
- namcos1_state *state = screen->machine->driver_data<namcos1_state>();
+ namcos1_state *state = screen->machine().driver_data<namcos1_state>();
int i, j, scrollx, scrolly, priority;
rectangle new_clip = *cliprect;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */
- flip_screen_set_no_update(screen->machine, state->spriteram[0x0ff6] & 1);
- tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */
+ flip_screen_set_no_update(screen->machine(), state->spriteram[0x0ff6] & 1);
+ tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* background color */
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* berabohm uses asymmetrical visibility windows to iris on the character */
i = ((state->cus116[0] << 8) | state->cus116[1]) - 1; // min x
@@ -411,7 +411,7 @@ SCREEN_UPDATE( namcos1 )
scrollx = ( state->playfield_control[j+1] + (state->playfield_control[j+0]<<8) ) - disp_x[i];
scrolly = ( state->playfield_control[j+3] + (state->playfield_control[j+2]<<8) ) + 8;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
scrollx = -scrollx;
scrolly = -scrolly;
@@ -422,7 +422,7 @@ SCREEN_UPDATE( namcos1 )
}
- bitmap_fill(screen->machine->priority_bitmap, &new_clip, 0);
+ bitmap_fill(screen->machine().priority_bitmap, &new_clip, 0);
/* bit 0-2 priority */
/* bit 3 disable */
@@ -435,14 +435,14 @@ SCREEN_UPDATE( namcos1 )
}
}
- draw_sprites(screen->machine, bitmap, &new_clip);
+ draw_sprites(screen->machine(), bitmap, &new_clip);
return 0;
}
SCREEN_EOF( namcos1 )
{
- namcos1_state *state = machine->driver_data<namcos1_state>();
+ namcos1_state *state = machine.driver_data<namcos1_state>();
if (state->copy_sprites)
{
UINT8 *spriteram = state->spriteram + 0x800;
diff --git a/src/mame/video/namcos2.c b/src/mame/video/namcos2.c
index 1ae9e205b36..36070a2c965 100644
--- a/src/mame/video/namcos2.c
+++ b/src/mame/video/namcos2.c
@@ -15,7 +15,7 @@ static UINT16 namcos2_68k_roz_ctrl[0x8];
static tilemap_t *tilemap_roz;
static void
-TilemapCB( running_machine *machine, UINT16 code, int *tile, int *mask )
+TilemapCB( running_machine &machine, UINT16 code, int *tile, int *mask )
{
*mask = code;
@@ -314,9 +314,9 @@ WRITE16_HANDLER( namcos2_68k_roz_ram_w )
{
COMBINE_DATA(&namcos2_68k_roz_ram[offset]);
tilemap_mark_tile_dirty(tilemap_roz,offset);
-// if( input_code_pressed(space->machine, KEYCODE_Q) )
+// if( input_code_pressed(space->machine(), KEYCODE_Q) )
// {
-// debugger_break(space->machine);
+// debugger_break(space->machine());
// }
}
@@ -373,7 +373,7 @@ WRITE16_HANDLER( namcos2_68k_video_palette_w )
/*case 0x180a:*/ case 0x180b:
if (data^namcos2_68k_palette_ram[offset]) {
namcos2_68k_palette_ram[offset] = data;
- namcos2_adjust_posirq_timer(space->machine,namcos2_GetPosIrqScanline(space->machine));
+ namcos2_adjust_posirq_timer(space->machine(),namcos2_GetPosIrqScanline(space->machine()));
}
break;
@@ -391,13 +391,13 @@ WRITE16_HANDLER( namcos2_68k_video_palette_w )
int
-namcos2_GetPosIrqScanline( running_machine *machine )
+namcos2_GetPosIrqScanline( running_machine &machine )
{
return (GetPaletteRegister(5) - 32) & 0xff;
} /* namcos2_GetPosIrqScanline */
static void
-UpdatePalette( running_machine *machine )
+UpdatePalette( running_machine &machine )
{
int bank;
for( bank=0; bank<0x20; bank++ )
@@ -419,13 +419,13 @@ UpdatePalette( running_machine *machine )
/**************************************************************************/
static void
-DrawSpriteInit( running_machine *machine )
+DrawSpriteInit( running_machine &machine )
{
int i;
/* set table for sprite color == 0x0f */
for( i = 0; i<16*256; i++ )
{
- machine->shadow_table[i] = i+0x2000;
+ machine.shadow_table[i] = i+0x2000;
}
}
@@ -443,7 +443,7 @@ READ16_HANDLER( namcos2_sprite_ram_r )
VIDEO_START( namcos2 )
{
- namco_tilemap_init(machine,2,machine->region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
tilemap_roz = tilemap_create(machine, get_tile_info_roz,tilemap_scan_rows,8,8,256,256);
tilemap_set_transparent_pen(tilemap_roz,0xff);
DrawSpriteInit(machine);
@@ -465,8 +465,8 @@ SCREEN_UPDATE( namcos2_default )
rectangle clip;
int pri;
- UpdatePalette(screen->machine);
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ UpdatePalette(screen->machine());
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
ApplyClip( &clip, cliprect );
/* HACK: enable ROZ layer only if it has priority > 0 */
@@ -482,7 +482,7 @@ SCREEN_UPDATE( namcos2_default )
{
DrawROZ(bitmap,&clip);
}
- namcos2_draw_sprites(screen->machine, bitmap, &clip, pri/2, namcos2_gfx_ctrl );
+ namcos2_draw_sprites(screen->machine(), bitmap, &clip, pri/2, namcos2_gfx_ctrl );
}
}
return 0;
@@ -492,7 +492,7 @@ SCREEN_UPDATE( namcos2_default )
VIDEO_START( finallap )
{
- namco_tilemap_init(machine,2,machine->region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
DrawSpriteInit(machine);
namco_road_init(machine, 3);
}
@@ -502,8 +502,8 @@ SCREEN_UPDATE( finallap )
rectangle clip;
int pri;
- UpdatePalette(screen->machine);
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ UpdatePalette(screen->machine());
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
ApplyClip( &clip, cliprect );
for( pri=0; pri<16; pri++ )
@@ -512,8 +512,8 @@ SCREEN_UPDATE( finallap )
{
namco_tilemap_draw( bitmap, &clip, pri/2 );
}
- namco_road_draw(screen->machine, bitmap,&clip,pri );
- namcos2_draw_sprites(screen->machine, bitmap,&clip,pri,namcos2_gfx_ctrl );
+ namco_road_draw(screen->machine(), bitmap,&clip,pri );
+ namcos2_draw_sprites(screen->machine(), bitmap,&clip,pri,namcos2_gfx_ctrl );
}
return 0;
}
@@ -522,7 +522,7 @@ SCREEN_UPDATE( finallap )
VIDEO_START( luckywld )
{
- namco_tilemap_init(machine,2,machine->region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
namco_obj_init( machine, 0, 0x0, NULL );
if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD )
{
@@ -539,8 +539,8 @@ SCREEN_UPDATE( luckywld )
rectangle clip;
int pri;
- UpdatePalette(screen->machine);
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ UpdatePalette(screen->machine());
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
ApplyClip( &clip, cliprect );
for( pri=0; pri<16; pri++ )
@@ -549,12 +549,12 @@ SCREEN_UPDATE( luckywld )
{
namco_tilemap_draw( bitmap, &clip, pri/2 );
}
- namco_road_draw(screen->machine, bitmap,&clip,pri );
+ namco_road_draw(screen->machine(), bitmap,&clip,pri );
if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD )
{
namco_roz_draw( bitmap, &clip, pri );
}
- namco_obj_draw(screen->machine, bitmap, &clip, pri );
+ namco_obj_draw(screen->machine(), bitmap, &clip, pri );
}
return 0;
}
@@ -563,7 +563,7 @@ SCREEN_UPDATE( luckywld )
VIDEO_START( sgunner )
{
- namco_tilemap_init(machine,2,machine->region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
namco_obj_init( machine, 0, 0x0, NULL );
}
@@ -572,14 +572,14 @@ SCREEN_UPDATE( sgunner )
rectangle clip;
int pri;
- UpdatePalette(screen->machine);
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ UpdatePalette(screen->machine());
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
ApplyClip( &clip, cliprect );
for( pri=0; pri<8; pri++ )
{
namco_tilemap_draw( bitmap, &clip, pri );
- namco_obj_draw(screen->machine, bitmap, &clip, pri );
+ namco_obj_draw(screen->machine(), bitmap, &clip, pri );
}
return 0;
}
@@ -589,7 +589,7 @@ SCREEN_UPDATE( sgunner )
VIDEO_START( metlhawk )
{
- namco_tilemap_init(machine,2,machine->region("gfx4")->base(),TilemapCB);
+ namco_tilemap_init(machine,2,machine.region("gfx4")->base(),TilemapCB);
namco_roz_init( machine, 1, "gfx5" );
}
@@ -598,8 +598,8 @@ SCREEN_UPDATE( metlhawk )
rectangle clip;
int pri;
- UpdatePalette(screen->machine);
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
+ UpdatePalette(screen->machine());
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
ApplyClip( &clip, cliprect );
for( pri=0; pri<16; pri++ )
@@ -609,7 +609,7 @@ SCREEN_UPDATE( metlhawk )
namco_tilemap_draw( bitmap, &clip, pri/2 );
}
namco_roz_draw( bitmap, &clip, pri );
- namcos2_draw_sprites_metalhawk(screen->machine, bitmap,&clip,pri );
+ namcos2_draw_sprites_metalhawk(screen->machine(), bitmap,&clip,pri );
}
return 0;
}
diff --git a/src/mame/video/namcos21.c b/src/mame/video/namcos21.c
index 18e810375b9..a6349545265 100644
--- a/src/mame/video/namcos21.c
+++ b/src/mame/video/namcos21.c
@@ -46,7 +46,7 @@ WRITE16_HANDLER(winrun_gpu_register_w)
WRITE16_HANDLER( winrun_gpu_videoram_w)
{
- namcos21_state *state = space->machine->driver_data<namcos21_state>();
+ namcos21_state *state = space->machine().driver_data<namcos21_state>();
UINT8 *videoram = state->videoram;
int color = data>>8;
int mask = data&0xff;
@@ -62,13 +62,13 @@ WRITE16_HANDLER( winrun_gpu_videoram_w)
READ16_HANDLER( winrun_gpu_videoram_r )
{
- namcos21_state *state = space->machine->driver_data<namcos21_state>();
+ namcos21_state *state = space->machine().driver_data<namcos21_state>();
UINT8 *videoram = state->videoram;
return videoram[offset]<<8;
} /* winrun_gpu_videoram_r */
static void
-AllocatePolyFrameBuffer( running_machine *machine )
+AllocatePolyFrameBuffer( running_machine &machine )
{
mpPolyFrameBufferZ = auto_alloc_array(machine, UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
mpPolyFrameBufferPens = auto_alloc_array(machine, UINT16, FRAMEBUFFER_SIZE_IN_BYTES/2 );
@@ -126,7 +126,7 @@ CopyVisiblePolyFrameBuffer( bitmap_t *bitmap, const rectangle *clip, int zlo, in
VIDEO_START( namcos21 )
{
- namcos21_state *state = machine->driver_data<namcos21_state>();
+ namcos21_state *state = machine.driver_data<namcos21_state>();
if( namcos2_gametype == NAMCOS21_WINRUN91 )
{
state->videoram = auto_alloc_array(machine, UINT8, 0x80000);
@@ -139,7 +139,7 @@ VIDEO_START( namcos21 )
} /* VIDEO_START( namcos21 ) */
static void
-update_palette( running_machine *machine )
+update_palette( running_machine &machine )
{
int i;
INT16 data1,data2;
@@ -164,8 +164,8 @@ update_palette( running_machine *machine )
*/
for( i=0; i<NAMCOS21_NUM_COLORS; i++ )
{
- data1 = machine->generic.paletteram.u16[0x00000/2+i];
- data2 = machine->generic.paletteram.u16[0x10000/2+i];
+ data1 = machine.generic.paletteram.u16[0x00000/2+i];
+ data2 = machine.generic.paletteram.u16[0x10000/2+i];
r = data1>>8;
g = data1&0xff;
@@ -178,25 +178,25 @@ update_palette( running_machine *machine )
SCREEN_UPDATE( namcos21 )
{
- namcos21_state *state = screen->machine->driver_data<namcos21_state>();
+ namcos21_state *state = screen->machine().driver_data<namcos21_state>();
UINT8 *videoram = state->videoram;
int pivot = 3;
int pri;
- update_palette(screen->machine);
+ update_palette(screen->machine());
bitmap_fill( bitmap, cliprect , 0xff);
if( namcos2_gametype != NAMCOS21_WINRUN91 )
{ /* draw low priority 2d sprites */
- namco_obj_draw(screen->machine, bitmap, cliprect, 2 );
- namco_obj_draw(screen->machine, bitmap, cliprect, 14 ); //driver's eyes
+ namco_obj_draw(screen->machine(), bitmap, cliprect, 2 );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, 14 ); //driver's eyes
}
CopyVisiblePolyFrameBuffer( bitmap, cliprect,0x7fc0,0x7ffe );
if( namcos2_gametype != NAMCOS21_WINRUN91 )
{ /* draw low priority 2d sprites */
- namco_obj_draw(screen->machine, bitmap, cliprect, 0 );
- namco_obj_draw(screen->machine, bitmap, cliprect, 1 );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, 0 );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, 1 );
}
CopyVisiblePolyFrameBuffer( bitmap, cliprect,0,0x7fbf );
@@ -206,9 +206,9 @@ SCREEN_UPDATE( namcos21 )
{ /* draw high priority 2d sprites */
for( pri=pivot; pri<8; pri++ )
{
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}
- namco_obj_draw(screen->machine, bitmap, cliprect, 15 ); //driver's eyes
+ namco_obj_draw(screen->machine(), bitmap, cliprect, 15 ); //driver's eyes
}
else
{ /* winrun bitmap layer */
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 9521bbc21c7..24ae58620da 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -383,7 +383,7 @@ static void renderscanline_uvi_full(void *dest, INT32 scanline, const poly_exten
}
} /* renderscanline_uvi_full */
-static void poly3d_DrawQuad(running_machine *machine, bitmap_t *bitmap, int textureBank, int color, Poly3dVertex pv[4], UINT16 flags, int direct, int cmode )
+static void poly3d_DrawQuad(running_machine &machine, bitmap_t *bitmap, int textureBank, int color, Poly3dVertex pv[4], UINT16 flags, int direct, int cmode )
{
poly_extra_data *extra;
poly_vertex v[4], clipv[6];
@@ -436,8 +436,8 @@ static void poly3d_DrawQuad(running_machine *machine, bitmap_t *bitmap, int text
extra = (poly_extra_data *)poly_get_extra_data(poly);
- extra->pens = &machine->pens[(color&0x7f)<<8];
- extra->priority_bitmap = machine->priority_bitmap;
+ extra->pens = &machine.pens[(color&0x7f)<<8];
+ extra->priority_bitmap = machine.priority_bitmap;
extra->bn = textureBank;
extra->flags = flags;
extra->cmode = cmode;
@@ -596,8 +596,8 @@ mydrawgfxzoom(
extra->alpha = alpha;
extra->prioverchar = prioverchar;
extra->line_modulo = gfx->line_modulo;
- extra->pens = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
- extra->priority_bitmap = gfx->machine->priority_bitmap;
+ extra->pens = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ extra->priority_bitmap = gfx->machine().priority_bitmap;
extra->source = gfx_element_get_data(gfx, code % gfx->total_elements);
#ifdef RENDER_AS_QUADS
poly_render_quad_fan(poly, dest_bmp, clip, renderscanline_sprite, 2, 4, &vert[0]);
@@ -608,7 +608,7 @@ mydrawgfxzoom(
} /* mydrawgfxzoom */
static void
-ApplyGamma( running_machine *machine, bitmap_t *bitmap )
+ApplyGamma( running_machine &machine, bitmap_t *bitmap )
{
int x,y;
if( mbSuperSystem22 )
@@ -632,7 +632,7 @@ ApplyGamma( running_machine *machine, bitmap_t *bitmap )
}
else
{ /* system 22 */
- const UINT8 *rlut = 0x000+(const UINT8 *)machine->region("user1")->base();
+ const UINT8 *rlut = 0x000+(const UINT8 *)machine.region("user1")->base();
const UINT8 *glut = 0x100+rlut;
const UINT8 *blut = 0x200+rlut;
for( y=0; y<bitmap->height; y++ )
@@ -827,7 +827,7 @@ FreeSceneNode( struct SceneNode *node )
} /* FreeSceneNode */
static struct SceneNode *
-MallocSceneNode( running_machine *machine )
+MallocSceneNode( running_machine &machine )
{
struct SceneNode *node = mpFreeSceneNode;
if( node )
@@ -843,7 +843,7 @@ MallocSceneNode( running_machine *machine )
} /* MallocSceneNode */
static struct SceneNode *
-NewSceneNode( running_machine *machine, UINT32 zsortvalue24, SceneNodeType type )
+NewSceneNode( running_machine &machine, UINT32 zsortvalue24, SceneNodeType type )
{
struct SceneNode *node = &mSceneRoot;
int i;
@@ -887,9 +887,9 @@ NewSceneNode( running_machine *machine, UINT32 zsortvalue24, SceneNodeType type
} /* NewSceneNode */
-static void RenderSprite(running_machine *machine, bitmap_t *bitmap, struct SceneNode *node )
+static void RenderSprite(running_machine &machine, bitmap_t *bitmap, struct SceneNode *node )
{
- namcos22_state *state = machine->driver_data<namcos22_state>();
+ namcos22_state *state = machine.driver_data<namcos22_state>();
int tile = node->data.sprite.tile;
int col,row;
int i = 0;
@@ -908,7 +908,7 @@ static void RenderSprite(running_machine *machine, bitmap_t *bitmap, struct Scen
}
poly3d_Draw3dSprite(
bitmap,
- machine->gfx[GFX_SPRITE],
+ machine.gfx[GFX_SPRITE],
code,
node->data.sprite.color,
node->data.sprite.xpos+col*node->data.sprite.sizex,
@@ -923,7 +923,7 @@ static void RenderSprite(running_machine *machine, bitmap_t *bitmap, struct Scen
} /* next row */
} /* RenderSprite */
-static void RenderSceneHelper(running_machine *machine, bitmap_t *bitmap, struct SceneNode *node )
+static void RenderSceneHelper(running_machine &machine, bitmap_t *bitmap, struct SceneNode *node )
{
if( node )
{
@@ -976,7 +976,7 @@ static void RenderSceneHelper(running_machine *machine, bitmap_t *bitmap, struct
}
} /* RenderSceneHelper */
-static void RenderScene(running_machine *machine, bitmap_t *bitmap )
+static void RenderScene(running_machine &machine, bitmap_t *bitmap )
{
struct SceneNode *node = &mSceneRoot;
int i;
@@ -1118,7 +1118,7 @@ PatchTexture( void )
} /* PatchTexture */
void
-namcos22_draw_direct_poly( running_machine *machine, const UINT16 *pSource )
+namcos22_draw_direct_poly( running_machine &machine, const UINT16 *pSource )
{
/**
* word#0:
@@ -1209,7 +1209,7 @@ namcos22_draw_direct_poly( running_machine *machine, const UINT16 *pSource )
} /* namcos22_draw_direct_poly */
static void
-Prepare3dTexture( running_machine *machine, void *pTilemapROM, void *pTextureROM )
+Prepare3dTexture( running_machine &machine, void *pTilemapROM, void *pTextureROM )
{
int i;
assert( pTilemapROM && pTextureROM );
@@ -1234,7 +1234,7 @@ Prepare3dTexture( running_machine *machine, void *pTilemapROM, void *pTextureROM
static void
DrawSpritesHelper(
- running_machine *machine,
+ running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
const UINT32 *pSource,
@@ -1336,9 +1336,9 @@ DrawSpritesHelper(
} /* DrawSpritesHelper */
static void
-DrawSprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- namcos22_state *state = machine->driver_data<namcos22_state>();
+ namcos22_state *state = machine.driver_data<namcos22_state>();
/*
// time crisis:
00980000: 00060000 000b0053 03000200 03000000
@@ -1466,7 +1466,7 @@ DrawSprites( running_machine *machine, bitmap_t *bitmap, const rectangle *clipre
}
} /* DrawSprites */
-static void UpdatePaletteS(running_machine *machine) /* for Super System22 - apply gamma correction and preliminary fader support */
+static void UpdatePaletteS(running_machine &machine) /* for Super System22 - apply gamma correction and preliminary fader support */
{
int i;
for( i=0; i<NAMCOS22_PALETTE_SIZE/4; i++ )
@@ -1477,9 +1477,9 @@ static void UpdatePaletteS(running_machine *machine) /* for Super System22 - app
for( j=0; j<4; j++ )
{
int which = i*4+j;
- int r = nthbyte(machine->generic.paletteram.u32,which+0x00000);
- int g = nthbyte(machine->generic.paletteram.u32,which+0x08000);
- int b = nthbyte(machine->generic.paletteram.u32,which+0x10000);
+ int r = nthbyte(machine.generic.paletteram.u32,which+0x00000);
+ int g = nthbyte(machine.generic.paletteram.u32,which+0x08000);
+ int b = nthbyte(machine.generic.paletteram.u32,which+0x10000);
palette_set_color( machine,which,MAKE_RGB(r,g,b) );
}
dirtypal[i] = 0;
@@ -1487,7 +1487,7 @@ static void UpdatePaletteS(running_machine *machine) /* for Super System22 - app
}
} /* UpdatePaletteS */
-static void UpdatePalette(running_machine *machine) /* for System22 - ignore gamma/fader effects for now */
+static void UpdatePalette(running_machine &machine) /* for System22 - ignore gamma/fader effects for now */
{
int i,j;
for( i=0; i<NAMCOS22_PALETTE_SIZE/4; i++ )
@@ -1497,9 +1497,9 @@ static void UpdatePalette(running_machine *machine) /* for System22 - ignore gam
for( j=0; j<4; j++ )
{
int which = i*4+j;
- int r = nthbyte(machine->generic.paletteram.u32,which+0x00000);
- int g = nthbyte(machine->generic.paletteram.u32,which+0x08000);
- int b = nthbyte(machine->generic.paletteram.u32,which+0x10000);
+ int r = nthbyte(machine.generic.paletteram.u32,which+0x00000);
+ int g = nthbyte(machine.generic.paletteram.u32,which+0x08000);
+ int b = nthbyte(machine.generic.paletteram.u32,which+0x10000);
palette_set_color( machine,which,MAKE_RGB(r,g,b) );
}
dirtypal[i] = 0;
@@ -1544,7 +1544,7 @@ DrawTranslucentCharacters( bitmap_t *bitmap, const rectangle *cliprect )
tilemap_draw( bitmap, cliprect, bgtilemap, TILEMAP_DRAW_ALPHA(alpha)|1, 0 );
}
-static void DrawCharacterLayer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void DrawCharacterLayer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
INT32 dx = namcos22_tilemapattr[0]>>16;
INT32 dy = namcos22_tilemapattr[0]&0xffff;
@@ -1553,7 +1553,7 @@ static void DrawCharacterLayer(running_machine *machine, bitmap_t *bitmap, const
* namcos22_tilemapattr[0x8/4] == 0x01ff0000
* namcos22_tilemapattr[0xe/4] == ?
*/
- bitmap_fill(machine->priority_bitmap,cliprect,0);
+ bitmap_fill(machine.priority_bitmap,cliprect,0);
tilemap_set_scrollx( bgtilemap,0, (dx-0x35c)&0x3ff );
tilemap_set_scrolly( bgtilemap,0, dy&0x3ff );
tilemap_set_palette_offset( bgtilemap, mixer.palBase*256 );
@@ -1622,7 +1622,7 @@ Signed18( UINT32 value )
*/
static void
BlitQuadHelper(
- running_machine *machine,
+ running_machine &machine,
bitmap_t *bitmap,
unsigned color,
unsigned addr,
@@ -1789,7 +1789,7 @@ RegisterNormals( INT32 addr, float m[4][4] )
} /* RegisterNormals */
static void
-BlitQuads( running_machine *machine, bitmap_t *bitmap, INT32 addr, float m[4][4], INT32 base )
+BlitQuads( running_machine &machine, bitmap_t *bitmap, INT32 addr, float m[4][4], INT32 base )
{
int numAdditionalNormals = 0;
int chunkLength = GetPolyData(addr++);
@@ -1894,7 +1894,7 @@ BlitQuads( running_machine *machine, bitmap_t *bitmap, INT32 addr, float m[4][4]
} /* BlitQuads */
static void
-BlitPolyObject( running_machine *machine, bitmap_t *bitmap, int code, float M[4][4] )
+BlitPolyObject( running_machine &machine, bitmap_t *bitmap, int code, float M[4][4] )
{
unsigned addr1 = GetPolyData(code);
mLitSurfaceCount = 0;
@@ -2012,7 +2012,7 @@ HandleBB0003( const INT32 *pSource )
} /* HandleBB0003 */
static void
-Handle200002( running_machine *machine, bitmap_t *bitmap, const INT32 *pSource )
+Handle200002( running_machine &machine, bitmap_t *bitmap, const INT32 *pSource )
{
if( mPrimitiveID>=0x45 )
{
@@ -2078,7 +2078,7 @@ Handle233002( const INT32 *pSource )
} /* Handle233002 */
static void
-SimulateSlaveDSP( running_machine *machine, bitmap_t *bitmap )
+SimulateSlaveDSP( running_machine &machine, bitmap_t *bitmap )
{
const INT32 *pSource = 0x300 + (INT32 *)namcos22_polygonram;
INT16 len;
@@ -2143,7 +2143,7 @@ SimulateSlaveDSP( running_machine *machine, bitmap_t *bitmap )
} /* SimulateSlaveDSP */
static void
-DrawPolygons( running_machine *machine, bitmap_t *bitmap )
+DrawPolygons( running_machine &machine, bitmap_t *bitmap )
{
if( mbDSPisActive )
{
@@ -2168,7 +2168,7 @@ READ32_HANDLER( namcos22_cgram_r )
WRITE32_HANDLER( namcos22_cgram_w )
{
COMBINE_DATA( &namcos22_cgram[offset] );
- gfx_element_mark_dirty(space->machine->gfx[GFX_CHAR],offset/32);
+ gfx_element_mark_dirty(space->machine().gfx[GFX_CHAR],offset/32);
}
READ32_HANDLER( namcos22_gamma_r )
@@ -2183,12 +2183,12 @@ WRITE32_HANDLER( namcos22_gamma_w )
READ32_HANDLER( namcos22_paletteram_r )
{
- return space->machine->generic.paletteram.u32[offset];
+ return space->machine().generic.paletteram.u32[offset];
}
WRITE32_HANDLER( namcos22_paletteram_w )
{
- COMBINE_DATA( &space->machine->generic.paletteram.u32[offset] );
+ COMBINE_DATA( &space->machine().generic.paletteram.u32[offset] );
dirtypal[offset&(0x7fff/4)] = 1;
}
@@ -2213,12 +2213,12 @@ static VIDEO_START( common )
mbDSPisActive = 0;
memset( namcos22_polygonram, 0xcc, 0x20000 );
- for (code = 0; code < machine->gfx[GFX_TEXTURE_TILE]->total_elements; code++)
- gfx_element_decode(machine->gfx[GFX_TEXTURE_TILE], code);
- Prepare3dTexture(machine, machine->region("textilemap")->base(), machine->gfx[GFX_TEXTURE_TILE]->gfxdata );
+ for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->total_elements; code++)
+ gfx_element_decode(machine.gfx[GFX_TEXTURE_TILE], code);
+ Prepare3dTexture(machine, machine.region("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->gfxdata );
dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4);
- mPtRomSize = machine->region("pointrom")->bytes()/3;
- mpPolyL = machine->region("pointrom")->base();
+ mPtRomSize = machine.region("pointrom")->bytes()/3;
+ mpPolyL = machine.region("pointrom")->base();
mpPolyM = mpPolyL + mPtRomSize;
mpPolyH = mpPolyM + mPtRomSize;
@@ -2227,10 +2227,10 @@ static VIDEO_START( common )
#else
poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), 0);
#endif
- machine->add_notifier(MACHINE_NOTIFY_RESET, namcos22_reset);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, namcos22_exit);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, namcos22_reset);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, namcos22_exit);
- gfx_element_set_source(machine->gfx[GFX_CHAR], (UINT8 *)namcos22_cgram);
+ gfx_element_set_source(machine.gfx[GFX_CHAR], (UINT8 *)namcos22_cgram);
}
VIDEO_START( namcos22 )
@@ -2261,21 +2261,21 @@ SCREEN_UPDATE( namcos22s )
UpdateVideoMixer();
bgColor = (mixer.rBackColor<<16)|(mixer.gBackColor<<8)|mixer.bBackColor;
bitmap_fill( bitmap, cliprect , bgColor);
- UpdatePaletteS(screen->machine);
- DrawCharacterLayer(screen->machine, bitmap, cliprect );
- DrawPolygons( screen->machine, bitmap );
- DrawSprites( screen->machine, bitmap, cliprect );
- RenderScene(screen->machine, bitmap );
+ UpdatePaletteS(screen->machine());
+ DrawCharacterLayer(screen->machine(), bitmap, cliprect );
+ DrawPolygons( screen->machine(), bitmap );
+ DrawSprites( screen->machine(), bitmap, cliprect );
+ RenderScene(screen->machine(), bitmap );
DrawTranslucentCharacters( bitmap, cliprect );
- ApplyGamma( screen->machine, bitmap );
+ ApplyGamma( screen->machine(), bitmap );
#ifdef MAME_DEBUG
- if( input_code_pressed(screen->machine, KEYCODE_D) )
+ if( input_code_pressed(screen->machine(), KEYCODE_D) )
{
FILE *f = fopen( "dump.txt", "wb" );
if( f )
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
{
int i,bank;
@@ -2302,7 +2302,7 @@ SCREEN_UPDATE( namcos22s )
Dump(space, f,0xc00000, 0xc1ffff, "polygonram");
fclose( f );
}
- while( input_code_pressed(screen->machine, KEYCODE_D) ){}
+ while( input_code_pressed(screen->machine(), KEYCODE_D) ){}
}
#endif
return 0;
@@ -2311,21 +2311,21 @@ SCREEN_UPDATE( namcos22s )
SCREEN_UPDATE( namcos22 )
{
UpdateVideoMixer();
- bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine));
- UpdatePalette(screen->machine);
- DrawCharacterLayer(screen->machine, bitmap, cliprect );
- DrawPolygons( screen->machine, bitmap );
- RenderScene(screen->machine, bitmap);
+ bitmap_fill( bitmap, cliprect , get_black_pen(screen->machine()));
+ UpdatePalette(screen->machine());
+ DrawCharacterLayer(screen->machine(), bitmap, cliprect );
+ DrawPolygons( screen->machine(), bitmap );
+ RenderScene(screen->machine(), bitmap);
DrawTranslucentCharacters( bitmap, cliprect );
- ApplyGamma( screen->machine, bitmap );
+ ApplyGamma( screen->machine(), bitmap );
#ifdef MAME_DEBUG
- if( input_code_pressed(screen->machine, KEYCODE_D) )
+ if( input_code_pressed(screen->machine(), KEYCODE_D) )
{
FILE *f = fopen( "dump.txt", "wb" );
if( f )
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
// Dump(space, f,0x90000000, 0x90000003, "led?" );
// Dump(space, f,0x90010000, 0x90017fff, "cz_ram");
@@ -2334,7 +2334,7 @@ SCREEN_UPDATE( namcos22 )
// Dump(space, f,0x70000000, 0x7001ffff, "polygonram");
fclose( f );
}
- while( input_code_pressed(screen->machine, KEYCODE_D) ){}
+ while( input_code_pressed(screen->machine(), KEYCODE_D) ){}
}
#endif
return 0;
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index 5c567f9ec91..63d8f24b4d1 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -34,7 +34,7 @@ Namco System 86 Video Hardware
PALETTE_INIT( namcos86 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
int i;
rgb_t palette[512];
@@ -87,9 +87,9 @@ PALETTE_INIT( namcos86 )
***************************************************************************/
-INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *vram)
+INLINE void get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int layer,UINT8 *vram)
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
int attr = vram[2*tile_index + 1];
int tile_offs;
if (layer & 2)
@@ -106,25 +106,25 @@ INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_
static TILE_GET_INFO( get_tile_info0 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
get_tile_info(machine,tileinfo,tile_index,0,&state->rthunder_videoram1[0x0000]);
}
static TILE_GET_INFO( get_tile_info1 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
get_tile_info(machine,tileinfo,tile_index,1,&state->rthunder_videoram1[0x1000]);
}
static TILE_GET_INFO( get_tile_info2 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
get_tile_info(machine,tileinfo,tile_index,2,&state->rthunder_videoram2[0x0000]);
}
static TILE_GET_INFO( get_tile_info3 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
get_tile_info(machine,tileinfo,tile_index,3,&state->rthunder_videoram2[0x1000]);
}
@@ -137,7 +137,7 @@ static TILE_GET_INFO( get_tile_info3 )
VIDEO_START( namcos86 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap[2] = tilemap_create(machine, get_tile_info2,tilemap_scan_rows,8,8,64,32);
@@ -161,33 +161,33 @@ VIDEO_START( namcos86 )
READ8_HANDLER( rthunder_videoram1_r )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
return state->rthunder_videoram1[offset];
}
WRITE8_HANDLER( rthunder_videoram1_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->rthunder_videoram1[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap[offset/0x1000],(offset & 0xfff)/2);
}
READ8_HANDLER( rthunder_videoram2_r )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
return state->rthunder_videoram2[offset];
}
WRITE8_HANDLER( rthunder_videoram2_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->rthunder_videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap[2+offset/0x1000],(offset & 0xfff)/2);
}
WRITE8_HANDLER( rthunder_tilebank_select_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
int bit = BIT(offset,10);
if (state->tilebank != bit)
{
@@ -199,7 +199,7 @@ WRITE8_HANDLER( rthunder_tilebank_select_w )
static void scroll_w(address_space *space, int offset, int data, int layer)
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
switch (offset)
{
case 0:
@@ -233,7 +233,7 @@ WRITE8_HANDLER( rthunder_scroll3_w )
WRITE8_HANDLER( rthunder_backcolor_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->backcolor = data;
}
@@ -241,13 +241,13 @@ WRITE8_HANDLER( rthunder_backcolor_w )
READ8_HANDLER( rthunder_spriteram_r )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
return state->rthunder_spriteram[offset];
}
WRITE8_HANDLER( rthunder_spriteram_w )
{
- namcos86_state *state = space->machine->driver_data<namcos86_state>();
+ namcos86_state *state = space->machine().driver_data<namcos86_state>();
state->rthunder_spriteram[offset] = data;
/* a write to this offset tells the sprite chip to buffer the sprite list */
@@ -282,17 +282,17 @@ sprite format:
15 xxxxxxxx Y position
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
const UINT8 *source = &state->spriteram[0x0800-0x20]; /* the last is NOT a sprite */
const UINT8 *finish = &state->spriteram[0];
- gfx_element *gfx = machine->gfx[2];
+ gfx_element *gfx = machine.gfx[2];
int sprite_xoffs = state->spriteram[0x07f5] + ((state->spriteram[0x07f4] & 1) << 8);
int sprite_yoffs = state->spriteram[0x07f7];
- int bank_sprites = machine->gfx[2]->total_elements / 8;
+ int bank_sprites = machine.gfx[2]->total_elements / 8;
while (source >= finish)
{
@@ -337,16 +337,16 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx,flipy,
sx & 0x1ff,
((sy + 16) & 0xff) - 16,
- machine->priority_bitmap, pri_mask,0xf);
+ machine.priority_bitmap, pri_mask,0xf);
source -= 0x10;
}
}
-static void set_scroll(running_machine *machine, int layer)
+static void set_scroll(running_machine &machine, int layer)
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
static const int xdisp[4] = { 47, 49, 46, 48 };
int scrollx,scrolly;
@@ -364,21 +364,21 @@ static void set_scroll(running_machine *machine, int layer)
SCREEN_UPDATE( namcos86 )
{
- namcos86_state *state = screen->machine->driver_data<namcos86_state>();
+ namcos86_state *state = screen->machine().driver_data<namcos86_state>();
int layer;
/* flip screen is embedded in the sprite control registers */
- /* can't use flip_screen_set(screen->machine, ) because the visible area is asymmetrical */
- flip_screen_set_no_update(screen->machine, state->spriteram[0x07f6] & 1);
- tilemap_set_flip_all(screen->machine,flip_screen_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- set_scroll(screen->machine, 0);
- set_scroll(screen->machine, 1);
- set_scroll(screen->machine, 2);
- set_scroll(screen->machine, 3);
+ /* can't use flip_screen_set(screen->machine(), ) because the visible area is asymmetrical */
+ flip_screen_set_no_update(screen->machine(), state->spriteram[0x07f6] & 1);
+ tilemap_set_flip_all(screen->machine(),flip_screen_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ set_scroll(screen->machine(), 0);
+ set_scroll(screen->machine(), 1);
+ set_scroll(screen->machine(), 2);
+ set_scroll(screen->machine(), 3);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
- bitmap_fill(bitmap,cliprect,screen->machine->gfx[0]->color_base + 8*state->backcolor+7);
+ bitmap_fill(bitmap,cliprect,screen->machine().gfx[0]->color_base + 8*state->backcolor+7);
for (layer = 0;layer < 8;layer++)
{
@@ -391,14 +391,14 @@ SCREEN_UPDATE( namcos86 )
}
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_EOF( namcos86 )
{
- namcos86_state *state = machine->driver_data<namcos86_state>();
+ namcos86_state *state = machine.driver_data<namcos86_state>();
if (state->copy_sprites)
{
UINT8 *spriteram = state->spriteram;
diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c
index 83dcb28514e..04445141e91 100644
--- a/src/mame/video/naughtyb.c
+++ b/src/mame/video/naughtyb.c
@@ -86,7 +86,7 @@ PALETTE_INIT( naughtyb )
2, resistances, weights, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1;
int r, g, b;
@@ -118,11 +118,11 @@ PALETTE_INIT( naughtyb )
***************************************************************************/
VIDEO_START( naughtyb )
{
- naughtyb_state *state = machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = machine.driver_data<naughtyb_state>();
state->palreg = state->bankreg = 0;
/* Naughty Boy has a virtual screen twice as large as the visible screen */
- machine->generic.tmpbitmap = auto_bitmap_alloc(machine,68*8,28*8,machine->primary_screen->format());
+ machine.generic.tmpbitmap = auto_bitmap_alloc(machine,68*8,28*8,machine.primary_screen->format());
}
@@ -130,12 +130,12 @@ VIDEO_START( naughtyb )
WRITE8_HANDLER( naughtyb_videoreg_w )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
// bits 4+5 control the sound circuit
- pleiads_sound_control_c_w(space->machine->device("cust"),offset,data);
+ pleiads_sound_control_c_w(space->machine().device("cust"),offset,data);
state->cocktail =
- ( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == cocktail
+ ( ( input_port_read(space->machine(), "DSW0") & 0x80 ) && // cabinet == cocktail
( data & 0x01 ) ); // handling player 2
state->palreg = (data >> 1) & 0x03; // pallette sel is bit 1 & 2
state->bankreg = (data >> 2) & 0x01; // banksel is just bit 2
@@ -143,12 +143,12 @@ WRITE8_HANDLER( naughtyb_videoreg_w )
WRITE8_HANDLER( popflame_videoreg_w )
{
- naughtyb_state *state = space->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = space->machine().driver_data<naughtyb_state>();
// bits 4+5 control the sound circuit
- pleiads_sound_control_c_w(space->machine->device("cust"),offset,data);
+ pleiads_sound_control_c_w(space->machine().device("cust"),offset,data);
state->cocktail =
- ( ( input_port_read(space->machine, "DSW0") & 0x80 ) && // cabinet == cocktail
+ ( ( input_port_read(space->machine(), "DSW0") & 0x80 ) && // cabinet == cocktail
( data & 0x01 ) ); // handling player 2
state->palreg = (data >> 1) & 0x03; // pallette sel is bit 1 & 2
state->bankreg = (data >> 3) & 0x01; // banksel is just bit 3
@@ -202,7 +202,7 @@ WRITE8_HANDLER( popflame_videoreg_w )
***************************************************************************/
SCREEN_UPDATE( naughtyb )
{
- naughtyb_state *state = screen->machine->driver_data<naughtyb_state>();
+ naughtyb_state *state = screen->machine().driver_data<naughtyb_state>();
UINT8 *videoram = state->videoram;
int offs;
@@ -239,13 +239,13 @@ SCREEN_UPDATE( naughtyb )
}
}
- drawgfx_opaque(screen->machine->generic.tmpbitmap,0,screen->machine->gfx[0],
+ drawgfx_opaque(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[0],
state->videoram2[offs] + 256 * state->bankreg,
(state->videoram2[offs] >> 5) + 8 * state->palreg,
state->cocktail,state->cocktail,
8*sx,8*sy);
- drawgfx_transpen(screen->machine->generic.tmpbitmap,0,screen->machine->gfx[1],
+ drawgfx_transpen(screen->machine().generic.tmpbitmap,0,screen->machine().gfx[1],
videoram[offs] + 256*state->bankreg,
(videoram[offs] >> 5) + 8 * state->palreg,
state->cocktail,state->cocktail,
@@ -256,11 +256,11 @@ SCREEN_UPDATE( naughtyb )
{
int scrollx;
- copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
- copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
+ copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
+ copybitmap(bitmap,screen->machine().generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
scrollx = ( state->cocktail ) ? *state->scrollreg - 239 : -*state->scrollreg + 16;
- copyscrollbitmap(bitmap,screen->machine->generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
+ copyscrollbitmap(bitmap,screen->machine().generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
}
return 0;
}
diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c
index 3bce61057b1..c9cb80e638c 100644
--- a/src/mame/video/nbmj8688.c
+++ b/src/mame/video/nbmj8688.c
@@ -12,7 +12,7 @@
static void mjsikaku_vramflip(nbmj8688_state *state);
-static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype);
+static void mbmj8688_gfxdraw(running_machine &machine, int gfxtype);
/* the blitter can copy data both in "direct" mode, where every byte of the source
@@ -105,7 +105,7 @@ PALETTE_INIT( mbmj8688_16bit )
WRITE8_HANDLER( nbmj8688_clut_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
state->clut[offset] = (data ^ 0xff);
}
@@ -116,7 +116,7 @@ WRITE8_HANDLER( nbmj8688_clut_w )
WRITE8_HANDLER( nbmj8688_blitter_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
switch (offset)
{
case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break;
@@ -126,7 +126,7 @@ WRITE8_HANDLER( nbmj8688_blitter_w )
case 0x04: state->blitter_sizex = data; break;
case 0x05: state->blitter_sizey = data;
/* writing here also starts the blit */
- mbmj8688_gfxdraw(space->machine, state->mjsikaku_gfxmode);
+ mbmj8688_gfxdraw(space->machine(), state->mjsikaku_gfxmode);
break;
case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0;
state->blitter_direction_y = (data & 0x02) ? 1 : 0;
@@ -140,7 +140,7 @@ WRITE8_HANDLER( nbmj8688_blitter_w )
WRITE8_HANDLER( mjsikaku_gfxflag2_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
state->mjsikaku_gfxflag2 = data;
if (nb1413m3_type == NB1413M3_SEIHAM
@@ -156,20 +156,20 @@ WRITE8_HANDLER( mjsikaku_gfxflag2_w )
static WRITE8_HANDLER( mjsikaku_gfxflag3_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
state->mjsikaku_gfxflag3 = (data & 0xe0);
}
WRITE8_HANDLER( mjsikaku_scrolly_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
state->mjsikaku_scrolly = data;
}
WRITE8_HANDLER( mjsikaku_romsel_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->mjsikaku_gfxrom = (data & 0x0f);
if ((state->mjsikaku_gfxrom << 17) > (gfxlen - 1))
@@ -183,8 +183,8 @@ WRITE8_HANDLER( mjsikaku_romsel_w )
WRITE8_HANDLER( secolove_romsel_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->mjsikaku_gfxrom = ((data & 0xc0) >> 4) + (data & 0x03);
mjsikaku_gfxflag2_w(space, 0, data);
@@ -199,8 +199,8 @@ WRITE8_HANDLER( secolove_romsel_w )
WRITE8_HANDLER( crystalg_romsel_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->mjsikaku_gfxrom = (data & 0x03);
mjsikaku_gfxflag2_w(space, 0, data);
@@ -215,8 +215,8 @@ WRITE8_HANDLER( crystalg_romsel_w )
WRITE8_HANDLER( seiha_romsel_w )
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->mjsikaku_gfxrom = (data & 0x1f);
mjsikaku_gfxflag3_w(space, 0, data);
@@ -281,10 +281,10 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype)
+static void mbmj8688_gfxdraw(running_machine &machine, int gfxtype)
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
int x, y;
int dx1, dx2, dy;
@@ -327,7 +327,7 @@ static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = (state->mjsikaku_gfxrom << 17) + (state->blitter_src_addr << 1);
//popmessage("ADDR:%08X DX:%03d DY:%03d SX:%03d SY:%03d", gfxaddr, startx, starty, sizex, sizey);
//if (state->blitter_direction_x|state->blitter_direction_y) popmessage("ADDR:%08X FX:%01d FY:%01d", gfxaddr, state->blitter_direction_x, state->blitter_direction_y);
@@ -535,9 +535,9 @@ static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype)
nb1413m3_busyflag = 0;
if (gfxtype == GFXTYPE_8BIT)
- machine->scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
else
- machine->scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
@@ -546,10 +546,10 @@ static void mbmj8688_gfxdraw(running_machine *machine, int gfxtype)
******************************************************************************/
-static void common_video_start(running_machine *machine)
+static void common_video_start(running_machine &machine)
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
- state->mjsikaku_tmpbitmap = auto_bitmap_alloc(machine, 512, 256, machine->primary_screen->format());
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
+ state->mjsikaku_tmpbitmap = auto_bitmap_alloc(machine, 512, 256, machine.primary_screen->format());
state->mjsikaku_videoram = auto_alloc_array_clear(machine, UINT16, 512 * 256);
state->clut = auto_alloc_array(machine, UINT8, 0x20);
@@ -558,42 +558,42 @@ static void common_video_start(running_machine *machine)
VIDEO_START( mbmj8688_8bit )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_8BIT;
common_video_start(machine);
}
VIDEO_START( mbmj8688_hybrid_12bit )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_HYBRID_12BIT;
common_video_start(machine);
}
VIDEO_START( mbmj8688_pure_12bit )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_PURE_12BIT;
common_video_start(machine);
}
VIDEO_START( mbmj8688_hybrid_16bit )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_HYBRID_16BIT;
common_video_start(machine);
}
VIDEO_START( mbmj8688_pure_16bit )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
common_video_start(machine);
}
VIDEO_START( mbmj8688_pure_16bit_LCD )
{
- nbmj8688_state *state = machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = machine.driver_data<nbmj8688_state>();
state->mjsikaku_gfxmode = GFXTYPE_PURE_16BIT;
state->HD61830B_ram[0] = auto_alloc_array(machine, UINT8, 0x10000);
@@ -612,13 +612,13 @@ Hitachi HD61830B LCD controller.
static void nbmj8688_HD61830B_instr_w(address_space *space,int offset,int data,int chip)
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
state->HD61830B_instr[chip] = data;
}
static void nbmj8688_HD61830B_data_w(address_space *space,int offset,int data,int chip)
{
- nbmj8688_state *state = space->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = space->machine().driver_data<nbmj8688_state>();
switch (state->HD61830B_instr[chip])
{
case 0x0a: // set cursor address (low order)
@@ -678,7 +678,7 @@ WRITE8_HANDLER( nbmj8688_HD61830B_both_data_w )
SCREEN_UPDATE( mbmj8688 )
{
- nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = screen->machine().driver_data<nbmj8688_state>();
int x, y;
if (state->mjsikaku_screen_refresh)
@@ -712,7 +712,7 @@ SCREEN_UPDATE( mbmj8688 )
SCREEN_UPDATE( mbmj8688_lcd0 )
{
- nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = screen->machine().driver_data<nbmj8688_state>();
int x, y, b;
for (y = 0;y < 64;y++)
@@ -728,7 +728,7 @@ SCREEN_UPDATE( mbmj8688_lcd0 )
SCREEN_UPDATE( mbmj8688_lcd1 )
{
- nbmj8688_state *state = screen->machine->driver_data<nbmj8688_state>();
+ nbmj8688_state *state = screen->machine().driver_data<nbmj8688_state>();
int x, y, b;
for (y = 0;y < 64;y++)
diff --git a/src/mame/video/nbmj8891.c b/src/mame/video/nbmj8891.c
index 9ffbbaa347a..ca4bc5d557c 100644
--- a/src/mame/video/nbmj8891.c
+++ b/src/mame/video/nbmj8891.c
@@ -11,8 +11,8 @@
#include "includes/nbmj8891.h"
-static void nbmj8891_vramflip(running_machine *machine, int vram);
-static void nbmj8891_gfxdraw(running_machine *machine);
+static void nbmj8891_vramflip(running_machine &machine, int vram);
+static void nbmj8891_gfxdraw(running_machine &machine);
/******************************************************************************
@@ -21,13 +21,13 @@ static void nbmj8891_gfxdraw(running_machine *machine);
******************************************************************************/
READ8_HANDLER( nbmj8891_palette_type1_r )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8891_palette_type1_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
int r, g, b;
state->palette[offset] = data;
@@ -40,18 +40,18 @@ WRITE8_HANDLER( nbmj8891_palette_type1_w )
g = ((state->palette[offset + 1] & 0xf0) >> 4);
b = ((state->palette[offset + 1] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
READ8_HANDLER( nbmj8891_palette_type2_r )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8891_palette_type2_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
int r, g, b;
state->palette[offset] = data;
@@ -64,18 +64,18 @@ WRITE8_HANDLER( nbmj8891_palette_type2_w )
g = ((state->palette[offset + 0x000] & 0xf0) >> 4);
b = ((state->palette[offset + 0x100] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
}
READ8_HANDLER( nbmj8891_palette_type3_r )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8891_palette_type3_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
int r, g, b;
state->palette[offset] = data;
@@ -88,24 +88,24 @@ WRITE8_HANDLER( nbmj8891_palette_type3_w )
g = ((state->palette[offset + 0] & 0xf0) >> 4);
b = ((state->palette[offset + 0] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
WRITE8_HANDLER( nbmj8891_clutsel_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
state->clutsel = data;
}
READ8_HANDLER( nbmj8891_clut_r )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
return state->clut[offset];
}
WRITE8_HANDLER( nbmj8891_clut_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data;
}
@@ -115,7 +115,7 @@ WRITE8_HANDLER( nbmj8891_clut_w )
******************************************************************************/
WRITE8_HANDLER( nbmj8891_blitter_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
switch (offset)
{
case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break;
@@ -125,14 +125,14 @@ WRITE8_HANDLER( nbmj8891_blitter_w )
case 0x04: state->blitter_sizex = data; break;
case 0x05: state->blitter_sizey = data;
/* writing here also starts the blit */
- nbmj8891_gfxdraw(space->machine);
+ nbmj8891_gfxdraw(space->machine());
break;
case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0;
state->blitter_direction_y = (data & 0x02) ? 1 : 0;
state->flipscreen = (data & 0x04) ? 1 : 0;
state->dispflag = (data & 0x08) ? 0 : 1;
- if (state->gfxdraw_mode) nbmj8891_vramflip(space->machine, 1);
- nbmj8891_vramflip(space->machine, 0);
+ if (state->gfxdraw_mode) nbmj8891_vramflip(space->machine(), 1);
+ nbmj8891_vramflip(space->machine(), 0);
break;
case 0x07: break;
}
@@ -140,7 +140,7 @@ WRITE8_HANDLER( nbmj8891_blitter_w )
WRITE8_HANDLER( nbmj8891_taiwanmb_blitter_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
switch (offset)
{
case 0: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break;
@@ -154,20 +154,20 @@ WRITE8_HANDLER( nbmj8891_taiwanmb_blitter_w )
WRITE8_HANDLER( nbmj8891_taiwanmb_gfxdraw_w )
{
-// nbmj8891_gfxdraw(space->machine);
+// nbmj8891_gfxdraw(space->machine());
}
WRITE8_HANDLER( nbmj8891_taiwanmb_gfxflag_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
state->flipscreen = (data & 0x04) ? 1 : 0;
- nbmj8891_vramflip(space->machine, 0);
+ nbmj8891_vramflip(space->machine(), 0);
}
WRITE8_HANDLER( nbmj8891_taiwanmb_mcu_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
state->param_old[state->param_cnt & 0x0f] = data;
@@ -240,7 +240,7 @@ WRITE8_HANDLER( nbmj8891_taiwanmb_mcu_w )
state->blitter_sizey ^= 0x00;
}
- nbmj8891_gfxdraw(space->machine);
+ nbmj8891_gfxdraw(space->machine());
}
// state->blitter_direction_x = 0; // for debug
@@ -252,13 +252,13 @@ WRITE8_HANDLER( nbmj8891_taiwanmb_mcu_w )
WRITE8_HANDLER( nbmj8891_scrolly_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
state->scrolly = data;
}
WRITE8_HANDLER( nbmj8891_vramsel_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
/* protection - not sure about this */
nb1413m3_sndromrgntag = (data & 0x20) ? "protection" : "voice";
@@ -267,8 +267,8 @@ WRITE8_HANDLER( nbmj8891_vramsel_w )
WRITE8_HANDLER( nbmj8891_romsel_w )
{
- nbmj8891_state *state = space->machine->driver_data<nbmj8891_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8891_state *state = space->machine().driver_data<nbmj8891_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->gfxrom = (data & 0x0f);
if ((0x20000 * state->gfxrom) > (gfxlen - 1))
@@ -284,15 +284,15 @@ WRITE8_HANDLER( nbmj8891_romsel_w )
******************************************************************************/
-void nbmj8891_vramflip(running_machine *machine, int vram)
+void nbmj8891_vramflip(running_machine &machine, int vram)
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
int x, y;
UINT8 color1, color2;
UINT8 *vidram;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen == state->flipscreen_old) return;
@@ -314,17 +314,17 @@ void nbmj8891_vramflip(running_machine *machine, int vram)
}
-static void update_pixel0(running_machine *machine, int x, int y)
+static void update_pixel0(running_machine &machine, int x, int y)
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
- UINT8 color = state->videoram0[(y * machine->primary_screen->width()) + x];
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
+ UINT8 color = state->videoram0[(y * machine.primary_screen->width()) + x];
*BITMAP_ADDR16(state->tmpbitmap0, y, x) = color;
}
-static void update_pixel1(running_machine *machine, int x, int y)
+static void update_pixel1(running_machine &machine, int x, int y)
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
- UINT8 color = state->videoram1[(y * machine->primary_screen->width()) + x];
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
+ UINT8 color = state->videoram1[(y * machine.primary_screen->width()) + x];
*BITMAP_ADDR16(state->tmpbitmap1, y, x) = (color == 0x7f) ? 0xff : color;
}
@@ -333,11 +333,11 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void nbmj8891_gfxdraw(running_machine *machine)
+static void nbmj8891_gfxdraw(running_machine &machine)
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
- int width = machine->primary_screen->width();
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
+ int width = machine.primary_screen->width();
int x, y;
int dx1, dx2, dy1, dy2;
@@ -375,7 +375,7 @@ static void nbmj8891_gfxdraw(running_machine *machine)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = (state->gfxrom << 17) + (state->blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -484,7 +484,7 @@ static void nbmj8891_gfxdraw(running_machine *machine)
}
nb1413m3_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
/******************************************************************************
@@ -493,13 +493,13 @@ static void nbmj8891_gfxdraw(running_machine *machine)
******************************************************************************/
VIDEO_START( nbmj8891_1layer )
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
- UINT8 *CLUT = machine->region("protection")->base();
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
+ UINT8 *CLUT = machine.region("protection")->base();
int i;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap0 = machine.primary_screen->alloc_compatible_bitmap();
state->videoram0 = auto_alloc_array(machine, UINT8, width * height);
state->palette = auto_alloc_array(machine, UINT8, 0x200);
state->clut = auto_alloc_array(machine, UINT8, 0x800);
@@ -512,12 +512,12 @@ VIDEO_START( nbmj8891_1layer )
VIDEO_START( nbmj8891_2layer )
{
- nbmj8891_state *state = machine->driver_data<nbmj8891_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ nbmj8891_state *state = machine.driver_data<nbmj8891_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap0 = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap1 = machine.primary_screen->alloc_compatible_bitmap();
state->videoram0 = auto_alloc_array(machine, UINT8, width * height);
state->videoram1 = auto_alloc_array(machine, UINT8, width * height);
state->palette = auto_alloc_array(machine, UINT8, 0x200);
@@ -533,7 +533,7 @@ VIDEO_START( nbmj8891_2layer )
******************************************************************************/
SCREEN_UPDATE( nbmj8891 )
{
- nbmj8891_state *state = screen->machine->driver_data<nbmj8891_state>();
+ nbmj8891_state *state = screen->machine().driver_data<nbmj8891_state>();
int x, y;
if (state->screen_refresh)
@@ -544,12 +544,12 @@ SCREEN_UPDATE( nbmj8891 )
state->screen_refresh = 0;
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
- update_pixel0(screen->machine, x, y);
+ update_pixel0(screen->machine(), x, y);
if (state->gfxdraw_mode)
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
- update_pixel1(screen->machine, x, y);
+ update_pixel1(screen->machine(), x, y);
}
if (state->dispflag)
diff --git a/src/mame/video/nbmj8900.c b/src/mame/video/nbmj8900.c
index 06b5a5ab8eb..2c836961d8c 100644
--- a/src/mame/video/nbmj8900.c
+++ b/src/mame/video/nbmj8900.c
@@ -11,8 +11,8 @@
#include "includes/nbmj8900.h"
-static void nbmj8900_vramflip(running_machine *machine, int vram);
-static void nbmj8900_gfxdraw(running_machine *machine);
+static void nbmj8900_vramflip(running_machine &machine, int vram);
+static void nbmj8900_gfxdraw(running_machine &machine);
/******************************************************************************
@@ -21,13 +21,13 @@ static void nbmj8900_gfxdraw(running_machine *machine);
******************************************************************************/
READ8_HANDLER( nbmj8900_palette_type1_r )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8900_palette_type1_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
int r, g, b;
state->palette[offset] = data;
@@ -40,19 +40,19 @@ WRITE8_HANDLER( nbmj8900_palette_type1_w )
g = ((state->palette[offset + 1] & 0xf0) >> 4);
b = ((state->palette[offset + 1] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
#ifdef UNUSED_FUNCTION
READ8_HANDLER( nbmj8900_palette_type2_r )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8900_palette_type2_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
int r, g, b;
state->palette[offset] = data;
@@ -65,18 +65,18 @@ WRITE8_HANDLER( nbmj8900_palette_type2_w )
g = ((state->palette[offset + 0x000] & 0xf0) >> 4);
b = ((state->palette[offset + 0x100] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset & 0x0ff), pal4bit(r), pal4bit(g), pal4bit(b));
}
READ8_HANDLER( nbmj8900_palette_type3_r )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj8900_palette_type3_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
int r, g, b;
state->palette[offset] = data;
@@ -89,25 +89,25 @@ WRITE8_HANDLER( nbmj8900_palette_type3_w )
g = ((state->palette[offset + 0] & 0xf0) >> 4);
b = ((state->palette[offset + 0] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
#endif
WRITE8_HANDLER( nbmj8900_clutsel_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
state->clutsel = data;
}
READ8_HANDLER( nbmj8900_clut_r )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
return state->clut[offset];
}
WRITE8_HANDLER( nbmj8900_clut_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data;
}
@@ -117,7 +117,7 @@ WRITE8_HANDLER( nbmj8900_clut_w )
******************************************************************************/
WRITE8_HANDLER( nbmj8900_blitter_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
switch (offset)
{
case 0x00: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break;
@@ -127,14 +127,14 @@ WRITE8_HANDLER( nbmj8900_blitter_w )
case 0x04: state->blitter_sizex = data; break;
case 0x05: state->blitter_sizey = data;
/* writing here also starts the blit */
- nbmj8900_gfxdraw(space->machine);
+ nbmj8900_gfxdraw(space->machine());
break;
case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0;
state->blitter_direction_y = (data & 0x02) ? 1 : 0;
state->flipscreen = (data & 0x04) ? 1 : 0;
state->dispflag = (data & 0x08) ? 0 : 1;
- if (state->gfxdraw_mode) nbmj8900_vramflip(space->machine, 1);
- nbmj8900_vramflip(space->machine, 0);
+ if (state->gfxdraw_mode) nbmj8900_vramflip(space->machine(), 1);
+ nbmj8900_vramflip(space->machine(), 0);
break;
case 0x07: break;
}
@@ -142,13 +142,13 @@ WRITE8_HANDLER( nbmj8900_blitter_w )
WRITE8_HANDLER( nbmj8900_scrolly_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
state->scrolly = data;
}
WRITE8_HANDLER( nbmj8900_vramsel_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
/* protection - not sure about this */
nb1413m3_sndromrgntag = (data & 0x20) ? "protdata" : "voice";
@@ -157,15 +157,15 @@ WRITE8_HANDLER( nbmj8900_vramsel_w )
WRITE8_HANDLER( nbmj8900_romsel_w )
{
- nbmj8900_state *state = space->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = space->machine().driver_data<nbmj8900_state>();
state->gfxrom = (data & 0x0f);
- if ((0x20000 * state->gfxrom) > (space->machine->region("gfx")->bytes() - 1))
+ if ((0x20000 * state->gfxrom) > (space->machine().region("gfx")->bytes() - 1))
{
#ifdef MAME_DEBUG
popmessage("GFXROM BANK OVER!!");
#endif
- state->gfxrom &= (space->machine->region("gfx")->bytes() / 0x20000 - 1);
+ state->gfxrom &= (space->machine().region("gfx")->bytes() / 0x20000 - 1);
}
}
@@ -173,14 +173,14 @@ WRITE8_HANDLER( nbmj8900_romsel_w )
******************************************************************************/
-void nbmj8900_vramflip(running_machine *machine, int vram)
+void nbmj8900_vramflip(running_machine &machine, int vram)
{
- nbmj8900_state *state = machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
int x, y;
unsigned char color1, color2;
unsigned char *vidram;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen == state->flipscreen_old) return;
@@ -202,18 +202,18 @@ void nbmj8900_vramflip(running_machine *machine, int vram)
}
-static void update_pixel0(running_machine *machine, int x, int y)
+static void update_pixel0(running_machine &machine, int x, int y)
{
- nbmj8900_state *state = machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
UINT8 color = state->videoram0[(y * state->screen_width) + x];
- *BITMAP_ADDR16(state->tmpbitmap0, y, x) = machine->pens[color];
+ *BITMAP_ADDR16(state->tmpbitmap0, y, x) = machine.pens[color];
}
-static void update_pixel1(running_machine *machine, int x, int y)
+static void update_pixel1(running_machine &machine, int x, int y)
{
- nbmj8900_state *state = machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
UINT8 color = state->videoram1[(y * state->screen_width) + x];
- *BITMAP_ADDR16(state->tmpbitmap1, y, x) = machine->pens[color];
+ *BITMAP_ADDR16(state->tmpbitmap1, y, x) = machine.pens[color];
}
static TIMER_CALLBACK( blitter_timer_callback )
@@ -221,10 +221,10 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void nbmj8900_gfxdraw(running_machine *machine)
+static void nbmj8900_gfxdraw(running_machine &machine)
{
- nbmj8900_state *state = machine->driver_data<nbmj8900_state>();
- unsigned char *GFX = machine->region("gfx")->base();
+ nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
+ unsigned char *GFX = machine.region("gfx")->base();
int x, y;
int dx1, dx2, dy1, dy2;
@@ -268,12 +268,12 @@ static void nbmj8900_gfxdraw(running_machine *machine)
{
for (x = startx, ctrx = sizex; ctrx >= 0; x += skipx, ctrx--)
{
- if ((gfxaddr > (machine->region("gfx")->bytes() - 1)))
+ if ((gfxaddr > (machine.region("gfx")->bytes() - 1)))
{
#ifdef MAME_DEBUG
popmessage("GFXROM ADDRESS OVER!!");
#endif
- gfxaddr &= (machine->region("gfx")->bytes() - 1);
+ gfxaddr &= (machine.region("gfx")->bytes() - 1);
}
color = GFX[gfxaddr++];
@@ -370,7 +370,7 @@ static void nbmj8900_gfxdraw(running_machine *machine)
}
nb1413m3_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_nsec(2500) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_nsec(2500) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
/******************************************************************************
@@ -379,19 +379,19 @@ static void nbmj8900_gfxdraw(running_machine *machine)
******************************************************************************/
VIDEO_START( nbmj8900_2layer )
{
- nbmj8900_state *state = machine->driver_data<nbmj8900_state>();
- state->screen_width = machine->primary_screen->width();
- state->screen_height = machine->primary_screen->height();
+ nbmj8900_state *state = machine.driver_data<nbmj8900_state>();
+ state->screen_width = machine.primary_screen->width();
+ state->screen_height = machine.primary_screen->height();
- state->tmpbitmap0 = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap1 = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap0 = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap1 = machine.primary_screen->alloc_compatible_bitmap();
state->videoram0 = auto_alloc_array(machine, UINT8, state->screen_width * state->screen_height);
state->videoram1 = auto_alloc_array(machine, UINT8, state->screen_width * state->screen_height);
state->palette = auto_alloc_array(machine, UINT8, 0x200);
state->clut = auto_alloc_array(machine, UINT8, 0x800);
memset(state->videoram0, 0xff, (state->screen_width * state->screen_height * sizeof(UINT8)));
memset(state->videoram1, 0xff, (state->screen_width * state->screen_height * sizeof(UINT8)));
-// machine->pens[0x07f] = 0xff; /* palette_transparent_pen */
+// machine.pens[0x07f] = 0xff; /* palette_transparent_pen */
state->gfxdraw_mode = 1;
}
@@ -401,7 +401,7 @@ VIDEO_START( nbmj8900_2layer )
******************************************************************************/
SCREEN_UPDATE( nbmj8900 )
{
- nbmj8900_state *state = screen->machine->driver_data<nbmj8900_state>();
+ nbmj8900_state *state = screen->machine().driver_data<nbmj8900_state>();
int x, y;
if (state->screen_refresh)
@@ -411,7 +411,7 @@ SCREEN_UPDATE( nbmj8900 )
{
for (x = 0; x < state->screen_width; x++)
{
- update_pixel0(screen->machine, x, y);
+ update_pixel0(screen->machine(), x, y);
}
}
if (state->gfxdraw_mode)
@@ -420,7 +420,7 @@ SCREEN_UPDATE( nbmj8900 )
{
for (x = 0; x < state->screen_width; x++)
{
- update_pixel1(screen->machine, x, y);
+ update_pixel1(screen->machine(), x, y);
}
}
}
diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c
index 2521703ef3f..85d58ea81ad 100644
--- a/src/mame/video/nbmj8991.c
+++ b/src/mame/video/nbmj8991.c
@@ -11,9 +11,9 @@
#include "includes/nbmj8991.h"
-static void nbmj8991_vramflip(running_machine *machine);
-static void nbmj8991_gfxdraw(running_machine *machine);
-static void update_pixel(running_machine *machine, int x, int y);
+static void nbmj8991_vramflip(running_machine &machine);
+static void nbmj8991_gfxdraw(running_machine &machine);
+static void update_pixel(running_machine &machine, int x, int y);
/******************************************************************************
@@ -25,51 +25,51 @@ WRITE8_HANDLER( nbmj8991_palette_type1_w )
{
int r, g, b;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
if (!(offset & 1)) return;
offset &= 0x1fe;
- r = ((space->machine->generic.paletteram.u8[offset + 0] & 0x0f) >> 0);
- g = ((space->machine->generic.paletteram.u8[offset + 1] & 0xf0) >> 4);
- b = ((space->machine->generic.paletteram.u8[offset + 1] & 0x0f) >> 0);
+ r = ((space->machine().generic.paletteram.u8[offset + 0] & 0x0f) >> 0);
+ g = ((space->machine().generic.paletteram.u8[offset + 1] & 0xf0) >> 4);
+ b = ((space->machine().generic.paletteram.u8[offset + 1] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
WRITE8_HANDLER( nbmj8991_palette_type2_w )
{
int r, g, b;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
if (!(offset & 1)) return;
offset &= 0x1fe;
- r = ((space->machine->generic.paletteram.u8[offset + 0] & 0x7c) >> 2);
- g = (((space->machine->generic.paletteram.u8[offset + 0] & 0x03) << 3) | ((space->machine->generic.paletteram.u8[offset + 1] & 0xe0) >> 5));
- b = ((space->machine->generic.paletteram.u8[offset + 1] & 0x1f) >> 0);
+ r = ((space->machine().generic.paletteram.u8[offset + 0] & 0x7c) >> 2);
+ g = (((space->machine().generic.paletteram.u8[offset + 0] & 0x03) << 3) | ((space->machine().generic.paletteram.u8[offset + 1] & 0xe0) >> 5));
+ b = ((space->machine().generic.paletteram.u8[offset + 1] & 0x1f) >> 0);
- palette_set_color_rgb(space->machine, (offset / 2), pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), (offset / 2), pal5bit(r), pal5bit(g), pal5bit(b));
}
WRITE8_HANDLER( nbmj8991_palette_type3_w )
{
int r, g, b;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
if (!(offset & 1)) return;
offset &= 0x1fe;
- r = ((space->machine->generic.paletteram.u8[offset + 1] & 0x0f) >> 0);
- g = ((space->machine->generic.paletteram.u8[offset + 0] & 0xf0) >> 4);
- b = ((space->machine->generic.paletteram.u8[offset + 0] & 0x0f) >> 0);
+ r = ((space->machine().generic.paletteram.u8[offset + 1] & 0x0f) >> 0);
+ g = ((space->machine().generic.paletteram.u8[offset + 0] & 0xf0) >> 4);
+ b = ((space->machine().generic.paletteram.u8[offset + 0] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
/******************************************************************************
@@ -78,8 +78,8 @@ WRITE8_HANDLER( nbmj8991_palette_type3_w )
******************************************************************************/
WRITE8_HANDLER( nbmj8991_blitter_w )
{
- nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ nbmj8991_state *state = space->machine().driver_data<nbmj8991_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
switch (offset)
{
@@ -90,13 +90,13 @@ WRITE8_HANDLER( nbmj8991_blitter_w )
case 0x04: state->blitter_sizex = data; break;
case 0x05: state->blitter_sizey = data;
/* writing here also starts the blit */
- nbmj8991_gfxdraw(space->machine);
+ nbmj8991_gfxdraw(space->machine());
break;
case 0x06: state->blitter_direction_x = (data & 0x01) ? 1 : 0;
state->blitter_direction_y = (data & 0x02) ? 1 : 0;
state->flipscreen = (data & 0x04) ? 0 : 1;
state->dispflag = (data & 0x10) ? 0 : 1;
- nbmj8991_vramflip(space->machine);
+ nbmj8991_vramflip(space->machine());
break;
case 0x07: break;
case 0x10: state->blitter_destx = (state->blitter_destx & 0xff00) | data; break;
@@ -123,13 +123,13 @@ WRITE8_HANDLER( nbmj8991_blitter_w )
READ8_HANDLER( nbmj8991_clut_r )
{
- nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>();
+ nbmj8991_state *state = space->machine().driver_data<nbmj8991_state>();
return state->clut[offset];
}
WRITE8_HANDLER( nbmj8991_clut_w )
{
- nbmj8991_state *state = space->machine->driver_data<nbmj8991_state>();
+ nbmj8991_state *state = space->machine().driver_data<nbmj8991_state>();
state->clut[((state->clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data;
}
@@ -137,13 +137,13 @@ WRITE8_HANDLER( nbmj8991_clut_w )
******************************************************************************/
-static void nbmj8991_vramflip(running_machine *machine)
+static void nbmj8991_vramflip(running_machine &machine)
{
- nbmj8991_state *state = machine->driver_data<nbmj8991_state>();
+ nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
int x, y;
UINT8 color1, color2;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen == state->flipscreen_old) return;
@@ -168,10 +168,10 @@ static void nbmj8991_vramflip(running_machine *machine)
state->screen_refresh = 1;
}
-static void update_pixel(running_machine *machine, int x, int y)
+static void update_pixel(running_machine &machine, int x, int y)
{
- nbmj8991_state *state = machine->driver_data<nbmj8991_state>();
- UINT8 color = state->videoram[(y * machine->primary_screen->width()) + x];
+ nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
+ UINT8 color = state->videoram[(y * machine.primary_screen->width()) + x];
*BITMAP_ADDR16(state->tmpbitmap, y, x) = color;
}
@@ -180,11 +180,11 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void nbmj8991_gfxdraw(running_machine *machine)
+static void nbmj8991_gfxdraw(running_machine &machine)
{
- nbmj8991_state *state = machine->driver_data<nbmj8991_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
- int width = machine->primary_screen->width();
+ nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
+ int width = machine.primary_screen->width();
int x, y;
int dx1, dx2, dy;
@@ -223,7 +223,7 @@ static void nbmj8991_gfxdraw(running_machine *machine)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = (state->gfxrom << 17) + (state->blitter_src_addr << 1);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -283,7 +283,7 @@ static void nbmj8991_gfxdraw(running_machine *machine)
}
nb1413m3_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_nsec(1650) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_nsec(1650) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
/******************************************************************************
@@ -292,11 +292,11 @@ static void nbmj8991_gfxdraw(running_machine *machine)
******************************************************************************/
VIDEO_START( nbmj8991 )
{
- nbmj8991_state *state = machine->driver_data<nbmj8991_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ nbmj8991_state *state = machine.driver_data<nbmj8991_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
state->videoram = auto_alloc_array(machine, UINT8, width * height);
state->clut = auto_alloc_array(machine, UINT8, 0x800);
memset(state->videoram, 0x00, (width * height * sizeof(UINT8)));
@@ -304,19 +304,19 @@ VIDEO_START( nbmj8991 )
SCREEN_UPDATE( nbmj8991_type1 )
{
- nbmj8991_state *state = screen->machine->driver_data<nbmj8991_state>();
+ nbmj8991_state *state = screen->machine().driver_data<nbmj8991_state>();
int x, y;
if (state->screen_refresh)
{
- int width = screen->machine->primary_screen->width();
- int height = screen->machine->primary_screen->height();
+ int width = screen->machine().primary_screen->width();
+ int height = screen->machine().primary_screen->height();
state->screen_refresh = 0;
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
- update_pixel(screen->machine, x, y);
+ update_pixel(screen->machine(), x, y);
}
if (state->dispflag)
@@ -344,7 +344,7 @@ SCREEN_UPDATE( nbmj8991_type1 )
SCREEN_UPDATE( nbmj8991_type2 )
{
- nbmj8991_state *state = screen->machine->driver_data<nbmj8991_state>();
+ nbmj8991_state *state = screen->machine().driver_data<nbmj8991_state>();
int x, y;
if (state->screen_refresh)
@@ -356,7 +356,7 @@ SCREEN_UPDATE( nbmj8991_type2 )
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
- update_pixel(screen->machine, x, y);
+ update_pixel(screen->machine(), x, y);
}
if (nb1413m3_inputport & 0x20)
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index 0591c3aeefa..9e2ac4af9bf 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -11,8 +11,8 @@
#include "includes/nbmj9195.h"
-static void nbmj9195_vramflip(running_machine *machine, int vram);
-static void nbmj9195_gfxdraw(running_machine *machine, int vram);
+static void nbmj9195_vramflip(running_machine &machine, int vram);
+static void nbmj9195_gfxdraw(running_machine &machine, int vram);
/******************************************************************************
@@ -21,13 +21,13 @@ static void nbmj9195_gfxdraw(running_machine *machine, int vram);
******************************************************************************/
READ8_HANDLER( nbmj9195_palette_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
return state->palette[offset];
}
WRITE8_HANDLER( nbmj9195_palette_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int r, g, b;
state->palette[offset] = data;
@@ -40,19 +40,19 @@ WRITE8_HANDLER( nbmj9195_palette_w )
g = ((state->palette[offset + 0] & 0xf0) >> 4);
b = ((state->palette[offset + 1] & 0x0f) >> 0);
- palette_set_color_rgb(space->machine, (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
+ palette_set_color_rgb(space->machine(), (offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
}
READ8_HANDLER( nbmj9195_nb22090_palette_r )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
return state->nb22090_palette[offset];
}
WRITE8_HANDLER( nbmj9195_nb22090_palette_w )
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int r, g, b;
int offs_h, offs_l;
@@ -65,7 +65,7 @@ WRITE8_HANDLER( nbmj9195_nb22090_palette_w )
g = state->nb22090_palette[(0x100 + (offs_h * 0x300) + offs_l)];
b = state->nb22090_palette[(0x200 + (offs_h * 0x300) + offs_l)];
- palette_set_color(space->machine, ((offs_h * 0x100) + offs_l), MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), ((offs_h * 0x100) + offs_l), MAKE_RGB(r, g, b));
}
/******************************************************************************
@@ -74,9 +74,9 @@ WRITE8_HANDLER( nbmj9195_nb22090_palette_w )
******************************************************************************/
static int nbmj9195_blitter_r(address_space *space, int offset, int vram)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int ret;
- UINT8 *GFXROM = space->machine->region("gfx1")->base();
+ UINT8 *GFXROM = space->machine().region("gfx1")->base();
switch (offset)
{
@@ -90,7 +90,7 @@ static int nbmj9195_blitter_r(address_space *space, int offset, int vram)
static void nbmj9195_blitter_w(address_space *space, int offset, int data, int vram)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
int new_line;
switch (offset)
@@ -103,11 +103,11 @@ static void nbmj9195_blitter_w(address_space *space, int offset, int data, int v
// if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)");
state->flipscreen[vram] = (data & 0x40) ? 0 : 1;
state->dispflag[vram] = (data & 0x80) ? 1 : 0;
- nbmj9195_vramflip(space->machine, vram);
+ nbmj9195_vramflip(space->machine(), vram);
break;
case 0x01: state->scrollx[vram] = (state->scrollx[vram] & 0x0100) | data; break;
case 0x02: state->scrollx[vram] = (state->scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100);
- new_line = space->machine->primary_screen->vpos();
+ new_line = space->machine().primary_screen->vpos();
if (state->flipscreen[vram])
{
for ( ; state->scanline[vram] < new_line; state->scanline[vram]++)
@@ -130,7 +130,7 @@ static void nbmj9195_blitter_w(address_space *space, int offset, int data, int v
case 0x0b: state->blitter_destx[vram] = (state->blitter_destx[vram] & 0x00ff) | (data << 8); break;
case 0x0c: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0xff00) | data; break;
case 0x0d: state->blitter_desty[vram] = (state->blitter_desty[vram] & 0x00ff) | (data << 8);
- nbmj9195_gfxdraw(space->machine, vram);
+ nbmj9195_gfxdraw(space->machine(), vram);
break;
default: break;
}
@@ -138,19 +138,19 @@ static void nbmj9195_blitter_w(address_space *space, int offset, int data, int v
void nbmj9195_clutsel_w(address_space *space, int data)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->clutsel = data;
}
static void nbmj9195_clut_w(address_space *space, int offset, int data, int vram)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->clut[vram][((state->clutsel & 0xff) * 0x10) + (offset & 0x0f)] = data;
}
void nbmj9195_gfxflag2_w(address_space *space, int data)
{
- nbmj9195_state *state = space->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = space->machine().driver_data<nbmj9195_state>();
state->gfxflag2 = data;
}
@@ -158,13 +158,13 @@ void nbmj9195_gfxflag2_w(address_space *space, int data)
******************************************************************************/
-static void nbmj9195_vramflip(running_machine *machine, int vram)
+static void nbmj9195_vramflip(running_machine &machine, int vram)
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
int x, y;
UINT16 color1, color2;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen[vram] == state->flipscreen_old[vram]) return;
@@ -197,24 +197,24 @@ static void nbmj9195_vramflip(running_machine *machine, int vram)
state->screen_refresh = 1;
}
-static void update_pixel(running_machine *machine, int vram, int x, int y)
+static void update_pixel(running_machine &machine, int vram, int x, int y)
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- UINT16 color = state->videoram[vram][(y * machine->primary_screen->width()) + x];
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ UINT16 color = state->videoram[vram][(y * machine.primary_screen->width()) + x];
*BITMAP_ADDR16(state->tmpbitmap[vram], y, x) = color;
}
static TIMER_CALLBACK( blitter_timer_callback )
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
state->nb19010_busyflag = 1;
}
-static void nbmj9195_gfxdraw(running_machine *machine, int vram)
+static void nbmj9195_gfxdraw(running_machine &machine, int vram)
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
- int width = machine->primary_screen->width();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
+ int width = machine.primary_screen->width();
int x, y;
int dx1, dx2, dy;
@@ -260,7 +260,7 @@ static void nbmj9195_gfxdraw(running_machine *machine, int vram)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = ((state->blitter_src_addr[vram] + 2) & 0x00ffffff);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -368,7 +368,7 @@ static void nbmj9195_gfxdraw(running_machine *machine, int vram)
state->nb19010_busyflag = 0;
/* 1650ns per count */
- machine->scheduler().timer_set(attotime::from_nsec(state->nb19010_busyctr * 1650), FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_nsec(state->nb19010_busyctr * 1650), FUNC(blitter_timer_callback));
}
/******************************************************************************
@@ -390,11 +390,11 @@ WRITE8_HANDLER( nbmj9195_clut_1_w ) { nbmj9195_clut_w(space, offset, data, 1);
******************************************************************************/
VIDEO_START( nbmj9195_1layer )
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
state->palette = auto_alloc_array(machine, UINT8, 0x200);
state->clut[0] = auto_alloc_array(machine, UINT8, 0x1000);
@@ -405,12 +405,12 @@ VIDEO_START( nbmj9195_1layer )
VIDEO_START( nbmj9195_2layer )
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[1] = machine.primary_screen->alloc_compatible_bitmap();
state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
state->palette = auto_alloc_array(machine, UINT8, 0x200);
@@ -423,12 +423,12 @@ VIDEO_START( nbmj9195_2layer )
VIDEO_START( nbmj9195_nb22090 )
{
- nbmj9195_state *state = machine->driver_data<nbmj9195_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[1] = machine.primary_screen->alloc_compatible_bitmap();
state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
state->videoworkram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
@@ -447,7 +447,7 @@ VIDEO_START( nbmj9195_nb22090 )
******************************************************************************/
SCREEN_UPDATE( nbmj9195 )
{
- nbmj9195_state *state = screen->machine->driver_data<nbmj9195_state>();
+ nbmj9195_state *state = screen->machine().driver_data<nbmj9195_state>();
int i;
int x, y;
int scrolly[2];
@@ -462,10 +462,10 @@ SCREEN_UPDATE( nbmj9195 )
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
{
- update_pixel(screen->machine, 0, x, y);
+ update_pixel(screen->machine(), 0, x, y);
if (state->gfxdraw_mode)
- update_pixel(screen->machine, 1, x, y);
+ update_pixel(screen->machine(), 1, x, y);
}
}
diff --git a/src/mame/video/nemesis.c b/src/mame/video/nemesis.c
index 15fcfb4cfac..40d756ec19e 100644
--- a/src/mame/video/nemesis.c
+++ b/src/mame/video/nemesis.c
@@ -23,7 +23,7 @@ sprite_data[8] =
static TILE_GET_INFO( get_bg_tile_info )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
int code, color, flags, mask, layer;
code = state->videoram2[tile_index];
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
int code, color, flags, mask, layer;
code = state->videoram1[tile_index];
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE16_HANDLER( nemesis_gfx_flipx_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
{
@@ -107,7 +107,7 @@ WRITE16_HANDLER( nemesis_gfx_flipx_word_w )
else
state->tilemap_flip &= ~TILEMAP_FLIPX;
- tilemap_set_flip_all(space->machine, state->tilemap_flip);
+ tilemap_set_flip_all(space->machine(), state->tilemap_flip);
}
if (ACCESSING_BITS_8_15)
@@ -119,7 +119,7 @@ WRITE16_HANDLER( nemesis_gfx_flipx_word_w )
WRITE16_HANDLER( nemesis_gfx_flipy_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
{
@@ -128,14 +128,14 @@ WRITE16_HANDLER( nemesis_gfx_flipy_word_w )
else
state->tilemap_flip &= ~TILEMAP_FLIPY;
- tilemap_set_flip_all(space->machine, state->tilemap_flip);
+ tilemap_set_flip_all(space->machine(), state->tilemap_flip);
}
}
WRITE16_HANDLER( salamand_control_port_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
if (ACCESSING_BITS_0_7)
{
@@ -156,15 +156,15 @@ WRITE16_HANDLER( salamand_control_port_word_w )
state->tilemap_flip &= ~TILEMAP_FLIPY;
if (accessing_bits & 0x0c)
- tilemap_set_flip_all(space->machine, state->tilemap_flip);
+ tilemap_set_flip_all(space->machine(), state->tilemap_flip);
state->irq_port_last = data;
}
if (ACCESSING_BITS_8_15)
{
- coin_lockout_w(space->machine, 0, data & 0x0200);
- coin_lockout_w(space->machine, 1, data & 0x0400);
+ coin_lockout_w(space->machine(), 0, data & 0x0200);
+ coin_lockout_w(space->machine(), 1, data & 0x0400);
if (data & 0x0800)
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
@@ -176,7 +176,7 @@ WRITE16_HANDLER( salamand_control_port_word_w )
WRITE16_HANDLER( nemesis_palette_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
int r, g, b, bit1, bit2, bit3, bit4, bit5;
COMBINE_DATA(state->paletteram + offset);
@@ -213,24 +213,24 @@ WRITE16_HANDLER( nemesis_palette_word_w )
bit5 = BIT(data, 14);
b = MULTIPLIER;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
WRITE16_HANDLER( salamander_palette_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
COMBINE_DATA(state->paletteram + offset);
offset &= ~1;
data = ((state->paletteram[offset] << 8) & 0xff00) | (state->paletteram[offset + 1] & 0xff);
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
}
WRITE16_HANDLER( nemesis_videoram1_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
COMBINE_DATA(state->videoram1 + offset);
tilemap_mark_tile_dirty(state->foreground, offset);
@@ -238,7 +238,7 @@ WRITE16_HANDLER( nemesis_videoram1_word_w )
WRITE16_HANDLER( nemesis_videoram2_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
COMBINE_DATA(state->videoram2 + offset);
tilemap_mark_tile_dirty(state->background, offset);
@@ -246,7 +246,7 @@ WRITE16_HANDLER( nemesis_videoram2_word_w )
WRITE16_HANDLER( nemesis_colorram1_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
COMBINE_DATA(state->colorram1 + offset);
tilemap_mark_tile_dirty(state->foreground, offset);
@@ -254,7 +254,7 @@ WRITE16_HANDLER( nemesis_colorram1_word_w )
WRITE16_HANDLER( nemesis_colorram2_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
COMBINE_DATA(state->colorram2 + offset);
tilemap_mark_tile_dirty(state->background, offset);
@@ -264,7 +264,7 @@ WRITE16_HANDLER( nemesis_colorram2_word_w )
/* we have to straighten out the 16-bit word into bytes for gfxdecode() to work */
WRITE16_HANDLER( nemesis_charram_word_w )
{
- nemesis_state *state = space->machine->driver_data<nemesis_state>();
+ nemesis_state *state = space->machine().driver_data<nemesis_state>();
UINT16 oldword = state->charram[offset];
COMBINE_DATA(state->charram + offset);
@@ -277,7 +277,7 @@ WRITE16_HANDLER( nemesis_charram_word_w )
{
int w = sprite_data[i].width;
int h = sprite_data[i].height;
- gfx_element_mark_dirty(space->machine->gfx[sprite_data[i].char_type], offset * 4 / (w * h));
+ gfx_element_mark_dirty(space->machine().gfx[sprite_data[i].char_type], offset * 4 / (w * h));
}
}
}
@@ -285,7 +285,7 @@ WRITE16_HANDLER( nemesis_charram_word_w )
static STATE_POSTLOAD( nemesis_postload )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
int i, offs;
for (offs = 0; offs < state->charram_size; offs++)
@@ -294,7 +294,7 @@ static STATE_POSTLOAD( nemesis_postload )
{
int w = sprite_data[i].width;
int h = sprite_data[i].height;
- gfx_element_mark_dirty(machine->gfx[sprite_data[i].char_type], offs * 4 / (w * h));
+ gfx_element_mark_dirty(machine.gfx[sprite_data[i].char_type], offs * 4 / (w * h));
}
}
tilemap_mark_all_tiles_dirty(state->background);
@@ -305,7 +305,7 @@ static STATE_POSTLOAD( nemesis_postload )
/* claim a palette dirty array */
VIDEO_START( nemesis )
{
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
state->spriteram_words = state->spriteram_size / 2;
@@ -320,21 +320,21 @@ VIDEO_START( nemesis )
memset(state->charram, 0, state->charram_size);
memset(state->blank_tile, 0, ARRAY_LENGTH(state->blank_tile));
- gfx_element_set_source(machine->gfx[0], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[1], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[2], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[3], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[4], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[5], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[6], (UINT8 *)state->charram);
- gfx_element_set_source(machine->gfx[7], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[0], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[1], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[2], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[3], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[4], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[5], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[6], (UINT8 *)state->charram);
+ gfx_element_set_source(machine.gfx[7], (UINT8 *)state->charram);
/* Set up save state */
- machine->state().register_postload(nemesis_postload, NULL);
+ machine.state().register_postload(nemesis_postload, NULL);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/*
* 16 bytes per sprite, in memory from 56000-56fff
@@ -351,7 +351,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
* byte E : not used.
*/
- nemesis_state *state = machine->driver_data<nemesis_state>();
+ nemesis_state *state = machine.driver_data<nemesis_state>();
UINT16 *spriteram = state->spriteram;
int adress; /* start of sprite in spriteram */
int sx; /* sprite X-pos */
@@ -410,13 +410,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[char_type],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[char_type],
code,
color,
flipx,flipy,
sx,sy,
zoom,zoom,
- machine->priority_bitmap,0xffcc,0 );
+ machine.priority_bitmap,0xffcc,0 );
}
}
}
@@ -427,11 +427,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( nemesis )
{
- nemesis_state *state = screen->machine->driver_data<nemesis_state>();
+ nemesis_state *state = screen->machine().driver_data<nemesis_state>();
int offs;
rectangle clip;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
clip.min_x = 0;
@@ -476,7 +476,7 @@ SCREEN_UPDATE( nemesis )
}
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index 50ed96259f3..85efa177e47 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -18,9 +18,9 @@
*
*************************************/
-static void set_videoram_offset( running_machine *machine, UINT16 data )
+static void set_videoram_offset( running_machine &machine, UINT16 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->videoram_offset = data;
/* the read happens right away */
@@ -28,16 +28,16 @@ static void set_videoram_offset( running_machine *machine, UINT16 data )
}
-static UINT16 get_videoram_data( running_machine *machine )
+static UINT16 get_videoram_data( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
return state->videoram_read_buffer;
}
-static void set_videoram_data( running_machine *machine, UINT16 data)
+static void set_videoram_data( running_machine &machine, UINT16 data)
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->videoram[state->videoram_offset] = data;
/* auto increment/decrement the current offset - A15 is NOT effected */
@@ -48,16 +48,16 @@ static void set_videoram_data( running_machine *machine, UINT16 data)
}
-static void set_videoram_modulo( running_machine *machine, UINT16 data)
+static void set_videoram_modulo( running_machine &machine, UINT16 data)
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->videoram_modulo = data;
}
-static UINT16 get_videoram_modulo( running_machine *machine )
+static UINT16 get_videoram_modulo( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
return state->videoram_modulo;
}
@@ -69,9 +69,9 @@ static UINT16 get_videoram_modulo( running_machine *machine )
*
*************************************/
-static void compute_rgb_weights( running_machine *machine )
+static void compute_rgb_weights( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
static const int resistances[] = { 220, 470, 1000, 2200, 3900 };
/* compute four sets of weights - with or without the pulldowns -
@@ -99,9 +99,9 @@ static void compute_rgb_weights( running_machine *machine )
}
-static pen_t get_pen( running_machine *machine, UINT16 data )
+static pen_t get_pen( running_machine &machine, UINT16 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
double *weights;
UINT8 r, g, b;
@@ -147,7 +147,7 @@ static pen_t get_pen( running_machine *machine, UINT16 data )
static STATE_POSTLOAD( regenerate_pens )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int i;
for (i = 0; i < NUM_PENS; i++)
@@ -155,9 +155,9 @@ static STATE_POSTLOAD( regenerate_pens )
}
-void neogeo_set_palette_bank( running_machine *machine, UINT8 data )
+void neogeo_set_palette_bank( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if (data != state->palette_bank)
{
state->palette_bank = data;
@@ -167,9 +167,9 @@ void neogeo_set_palette_bank( running_machine *machine, UINT8 data )
}
-void neogeo_set_screen_dark( running_machine *machine, UINT8 data )
+void neogeo_set_screen_dark( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if (data != state->screen_dark)
{
state->screen_dark = data;
@@ -181,19 +181,19 @@ void neogeo_set_screen_dark( running_machine *machine, UINT8 data )
READ16_HANDLER( neogeo_paletteram_r )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
return state->palettes[state->palette_bank][offset];
}
WRITE16_HANDLER( neogeo_paletteram_w )
{
- neogeo_state *state = space->machine->driver_data<neogeo_state>();
+ neogeo_state *state = space->machine().driver_data<neogeo_state>();
UINT16 *addr = &state->palettes[state->palette_bank][offset];
COMBINE_DATA(addr);
- state->pens[offset] = get_pen(space->machine, *addr);
+ state->pens[offset] = get_pen(space->machine(), *addr);
}
@@ -204,30 +204,30 @@ WRITE16_HANDLER( neogeo_paletteram_w )
*
*************************************/
-static void set_auto_animation_speed( running_machine *machine, UINT8 data)
+static void set_auto_animation_speed( running_machine &machine, UINT8 data)
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->auto_animation_speed = data;
}
-static void set_auto_animation_disabled( running_machine *machine, UINT8 data)
+static void set_auto_animation_disabled( running_machine &machine, UINT8 data)
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->auto_animation_disabled = data;
}
-UINT8 neogeo_get_auto_animation_counter( running_machine *machine )
+UINT8 neogeo_get_auto_animation_counter( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
return state->auto_animation_counter;
}
static TIMER_CALLBACK( auto_animation_timer_callback )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
if (state->auto_animation_frame_counter == 0)
{
state->auto_animation_frame_counter = state->auto_animation_speed;
@@ -236,21 +236,21 @@ static TIMER_CALLBACK( auto_animation_timer_callback )
else
state->auto_animation_frame_counter = state->auto_animation_frame_counter - 1;
- state->auto_animation_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VSSTART));
+ state->auto_animation_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VSSTART));
}
-static void create_auto_animation_timer( running_machine *machine )
+static void create_auto_animation_timer( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->auto_animation_timer = machine->scheduler().timer_alloc(FUNC(auto_animation_timer_callback));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->auto_animation_timer = machine.scheduler().timer_alloc(FUNC(auto_animation_timer_callback));
}
-static void start_auto_animation_timer( running_machine *machine )
+static void start_auto_animation_timer( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->auto_animation_timer->adjust(machine->primary_screen->time_until_pos(NEOGEO_VSSTART));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->auto_animation_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VSSTART));
}
@@ -261,20 +261,20 @@ static void start_auto_animation_timer( running_machine *machine )
*
*************************************/
-void neogeo_set_fixed_layer_source( running_machine *machine, UINT8 data )
+void neogeo_set_fixed_layer_source( running_machine &machine, UINT8 data )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
state->fixed_layer_source = data;
}
-static void draw_fixed_layer( running_machine *machine, bitmap_t *bitmap, int scanline )
+static void draw_fixed_layer( running_machine &machine, bitmap_t *bitmap, int scanline )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int x;
- UINT8* gfx_base = machine->region(state->fixed_layer_source ? "fixed" : "fixedbios")->base();
- UINT32 addr_mask = machine->region(state->fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
+ UINT8* gfx_base = machine.region(state->fixed_layer_source ? "fixed" : "fixedbios")->base();
+ UINT32 addr_mask = machine.region(state->fixed_layer_source ? "fixed" : "fixedbios")->bytes() - 1;
UINT16 *video_data = &state->videoram[0x7000 | (scanline >> 3)];
UINT32 *pixel_addr = BITMAP_ADDR32(bitmap, scanline, NEOGEO_HBEND);
@@ -401,9 +401,9 @@ INLINE int sprite_on_scanline(int scanline, int y, int rows)
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, int scanline )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, int scanline )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int sprite_index;
int max_sprite_index;
@@ -590,9 +590,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, int scanli
}
-static void parse_sprites( running_machine *machine, int scanline )
+static void parse_sprites( running_machine &machine, int scanline )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
UINT16 sprite_number;
int y = 0;
int rows = 0;
@@ -644,40 +644,40 @@ static void parse_sprites( running_machine *machine, int scanline )
static TIMER_CALLBACK( sprite_line_timer_callback )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
int scanline = param;
/* we are at the beginning of a scanline -
we need to draw the previous scanline and parse the sprites on the current one */
if (scanline != 0)
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
parse_sprites(machine, scanline);
/* let's come back at the beginning of the next line */
scanline = (scanline + 1) % NEOGEO_VTOTAL;
- state->sprite_line_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->sprite_line_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
-static void create_sprite_line_timer( running_machine *machine )
+static void create_sprite_line_timer( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->sprite_line_timer = machine->scheduler().timer_alloc(FUNC(sprite_line_timer_callback));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->sprite_line_timer = machine.scheduler().timer_alloc(FUNC(sprite_line_timer_callback));
}
-static void start_sprite_line_timer( running_machine *machine )
+static void start_sprite_line_timer( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
- state->sprite_line_timer->adjust(machine->primary_screen->time_until_pos(0));
+ neogeo_state *state = machine.driver_data<neogeo_state>();
+ state->sprite_line_timer->adjust(machine.primary_screen->time_until_pos(0));
}
-static void optimize_sprite_data( running_machine *machine )
+static void optimize_sprite_data( running_machine &machine )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
/* convert the sprite graphics data into a format that
allows faster blitting */
@@ -691,7 +691,7 @@ static void optimize_sprite_data( running_machine *machine )
power of 2 */
state->sprite_gfx_address_mask = 0xffffffff;
- len = machine->region("sprites")->bytes();
+ len = machine.region("sprites")->bytes();
for (bit = 0x80000000; bit != 0; bit >>= 1)
{
@@ -703,7 +703,7 @@ static void optimize_sprite_data( running_machine *machine )
state->sprite_gfx = auto_alloc_array_clear(machine, UINT8, state->sprite_gfx_address_mask + 1);
- src = machine->region("sprites")->base();
+ src = machine.region("sprites")->base();
dest = state->sprite_gfx;
for (i = 0; i < len; i += 0x80, src += 0x80)
@@ -741,7 +741,7 @@ static void optimize_sprite_data( running_machine *machine )
*
*************************************/
-static UINT16 get_video_control( running_machine *machine )
+static UINT16 get_video_control( running_machine &machine )
{
UINT16 ret;
UINT16 v_counter;
@@ -768,23 +768,23 @@ static UINT16 get_video_control( running_machine *machine )
*/
/* the vertical counter chain goes from 0xf8 - 0x1ff */
- v_counter = machine->primary_screen->vpos() + 0x100;
+ v_counter = machine.primary_screen->vpos() + 0x100;
if (v_counter >= 0x200)
v_counter = v_counter - NEOGEO_VTOTAL;
ret = (v_counter << 7) | (neogeo_get_auto_animation_counter(machine) & 0x0007);
- if (VERBOSE) logerror("%s: video_control read (%04x)\n", machine->describe_context(), ret);
+ if (VERBOSE) logerror("%s: video_control read (%04x)\n", machine.describe_context(), ret);
return ret;
}
-static void set_video_control( running_machine *machine, UINT16 data )
+static void set_video_control( running_machine &machine, UINT16 data )
{
/* this does much more than this, but I'm not sure exactly what */
- if (VERBOSE) logerror("%s: video control write %04x\n", machine->describe_context(), data);
+ if (VERBOSE) logerror("%s: video control write %04x\n", machine.describe_context(), data);
set_auto_animation_speed(machine, data >> 8);
set_auto_animation_disabled(machine, data & 0x0008);
@@ -806,9 +806,9 @@ READ16_HANDLER( neogeo_video_register_r )
{
default:
case 0x00:
- case 0x01: ret = get_videoram_data(space->machine); break;
- case 0x02: ret = get_videoram_modulo(space->machine); break;
- case 0x03: ret = get_video_control(space->machine); break;
+ case 0x01: ret = get_videoram_data(space->machine()); break;
+ case 0x02: ret = get_videoram_modulo(space->machine()); break;
+ case 0x03: ret = get_video_control(space->machine()); break;
}
}
@@ -827,13 +827,13 @@ WRITE16_HANDLER( neogeo_video_register_w )
switch (offset)
{
- case 0x00: set_videoram_offset(space->machine, data); break;
- case 0x01: set_videoram_data(space->machine, data); break;
- case 0x02: set_videoram_modulo(space->machine, data); break;
- case 0x03: set_video_control(space->machine, data); break;
+ case 0x00: set_videoram_offset(space->machine(), data); break;
+ case 0x01: set_videoram_data(space->machine(), data); break;
+ case 0x02: set_videoram_modulo(space->machine(), data); break;
+ case 0x03: set_video_control(space->machine(), data); break;
case 0x04: neogeo_set_display_counter_msb(space, data); break;
case 0x05: neogeo_set_display_counter_lsb(space, data); break;
- case 0x06: neogeo_acknowledge_interrupt(space->machine, data); break;
+ case 0x06: neogeo_acknowledge_interrupt(space->machine(), data); break;
case 0x07: break; /* unknown, see get_video_control */
}
}
@@ -849,7 +849,7 @@ WRITE16_HANDLER( neogeo_video_register_w )
VIDEO_START( neogeo )
{
- neogeo_state *state = machine->driver_data<neogeo_state>();
+ neogeo_state *state = machine.driver_data<neogeo_state>();
/* allocate memory not directly mapped */
state->palettes[0] = auto_alloc_array(machine, UINT16, NUM_PENS);
@@ -892,9 +892,9 @@ VIDEO_START( neogeo )
state->save_item(NAME(state->auto_animation_counter));
state->save_item(NAME(state->auto_animation_frame_counter));
- machine->state().register_postload(regenerate_pens, NULL);
+ machine.state().register_postload(regenerate_pens, NULL);
- state->region_zoomy = machine->region("zoomy")->base();
+ state->region_zoomy = machine.region("zoomy")->base();
}
@@ -922,14 +922,14 @@ VIDEO_RESET( neogeo )
SCREEN_UPDATE( neogeo )
{
- neogeo_state *state = screen->machine->driver_data<neogeo_state>();
+ neogeo_state *state = screen->machine().driver_data<neogeo_state>();
/* fill with background color first */
bitmap_fill(bitmap, cliprect, state->pens[0x0fff]);
- draw_sprites(screen->machine, bitmap, cliprect->min_y);
+ draw_sprites(screen->machine(), bitmap, cliprect->min_y);
- draw_fixed_layer(screen->machine, bitmap, cliprect->min_y);
+ draw_fixed_layer(screen->machine(), bitmap, cliprect->min_y);
return 0;
}
diff --git a/src/mame/video/news.c b/src/mame/video/news.c
index 489fede993d..939b0f7df89 100644
--- a/src/mame/video/news.c
+++ b/src/mame/video/news.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- news_state *state = machine->driver_data<news_state>();
+ news_state *state = machine.driver_data<news_state>();
int code = (state->fgram[tile_index * 2] << 8) | state->fgram[tile_index * 2 + 1];
SET_TILE_INFO(
0,
@@ -21,7 +21,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- news_state *state = machine->driver_data<news_state>();
+ news_state *state = machine.driver_data<news_state>();
int code = (state->bgram[tile_index * 2] << 8) | state->bgram[tile_index * 2 + 1];
int color = (code & 0xf000) >> 12;
@@ -46,7 +46,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( news )
{
- news_state *state = machine->driver_data<news_state>();
+ news_state *state = machine.driver_data<news_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -64,7 +64,7 @@ VIDEO_START( news )
WRITE8_HANDLER( news_fgram_w )
{
- news_state *state = space->machine->driver_data<news_state>();
+ news_state *state = space->machine().driver_data<news_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
@@ -72,7 +72,7 @@ WRITE8_HANDLER( news_fgram_w )
WRITE8_HANDLER( news_bgram_w )
{
- news_state *state = space->machine->driver_data<news_state>();
+ news_state *state = space->machine().driver_data<news_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -80,7 +80,7 @@ WRITE8_HANDLER( news_bgram_w )
WRITE8_HANDLER( news_bgpic_w )
{
- news_state *state = space->machine->driver_data<news_state>();
+ news_state *state = space->machine().driver_data<news_state>();
if (state->bgpic != data)
{
@@ -99,7 +99,7 @@ WRITE8_HANDLER( news_bgpic_w )
SCREEN_UPDATE( news )
{
- news_state *state = screen->machine->driver_data<news_state>();
+ news_state *state = screen->machine().driver_data<news_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c
index f2746de52fe..83a5590ce5d 100644
--- a/src/mame/video/ninjakd2.c
+++ b/src/mame/video/ninjakd2.c
@@ -12,7 +12,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
int const lo = state->fg_videoram[(tile_index << 1)];
int const hi = state->fg_videoram[(tile_index << 1) | 1];
int const tile = ((hi & 0xc0) << 2) | lo;
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( ninjakd2_get_bg_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
int const lo = state->bg_videoram[(tile_index << 1)];
int const hi = state->bg_videoram[(tile_index << 1) | 1];
int const tile = ((hi & 0xc0) << 2) | lo;
@@ -44,7 +44,7 @@ static TILE_GET_INFO( ninjakd2_get_bg_tile_info )
static TILE_GET_INFO( mnight_get_bg_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
int const lo = state->bg_videoram[(tile_index << 1)];
int const hi = state->bg_videoram[(tile_index << 1) | 1];
int const tile = ((hi & 0x10) << 6) | ((hi & 0xc0) << 2) | lo;
@@ -70,7 +70,7 @@ static TILEMAP_MAPPER( omegaf_bg_scan )
return (col & 0x0f) | ((row & 0x1f) << 4) | ((col & 0x70) << 5);
}
-static void robokid_get_bg_tile_info(running_machine* machine, tile_data* const tileinfo, tilemap_memory_index const tile_index, int const gfxnum, const UINT8* const videoram)
+static void robokid_get_bg_tile_info(running_machine& machine, tile_data* const tileinfo, tilemap_memory_index const tile_index, int const gfxnum, const UINT8* const videoram)
{
int const lo = videoram[(tile_index << 1)];
int const hi = videoram[(tile_index << 1) | 1];
@@ -86,19 +86,19 @@ static void robokid_get_bg_tile_info(running_machine* machine, tile_data* const
static TILE_GET_INFO( robokid_get_bg0_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
robokid_get_bg_tile_info(machine, tileinfo, tile_index, 2, state->robokid_bg0_videoram);
}
static TILE_GET_INFO( robokid_get_bg1_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
robokid_get_bg_tile_info(machine, tileinfo, tile_index, 3, state->robokid_bg1_videoram);
}
static TILE_GET_INFO( robokid_get_bg2_tile_info )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
robokid_get_bg_tile_info(machine, tileinfo, tile_index, 4, state->robokid_bg2_videoram);
}
@@ -110,9 +110,9 @@ static TILE_GET_INFO( robokid_get_bg2_tile_info )
*
*************************************/
-static void videoram_alloc(running_machine* machine, int const size)
+static void videoram_alloc(running_machine& machine, int const size)
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
if (size)
{
/* create video ram */
@@ -121,7 +121,7 @@ static void videoram_alloc(running_machine* machine, int const size)
state->robokid_bg2_videoram = auto_alloc_array_clear(machine, UINT8, size);
}
- state->sp_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->sp_bitmap = machine.primary_screen->alloc_compatible_bitmap();
}
static int stencil_ninjakd2( UINT16 pal );
@@ -132,7 +132,7 @@ static int stencil_omegaf( UINT16 pal );
VIDEO_START( ninjakd2 )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
videoram_alloc(machine, 0);
state->fg_tilemap = tilemap_create( machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -146,7 +146,7 @@ VIDEO_START( ninjakd2 )
VIDEO_START( mnight )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
videoram_alloc(machine, 0);
state->fg_tilemap = tilemap_create( machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -160,7 +160,7 @@ VIDEO_START( mnight )
VIDEO_START( arkarea )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
videoram_alloc(machine, 0);
state->fg_tilemap = tilemap_create( machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -174,7 +174,7 @@ VIDEO_START( arkarea )
VIDEO_START( robokid )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
state->bank_mask = 1;
videoram_alloc(machine, 0x0800);
@@ -194,7 +194,7 @@ VIDEO_START( robokid )
VIDEO_START( omegaf )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
state->bank_mask = 7;
videoram_alloc(machine, 0x2000);
@@ -223,14 +223,14 @@ VIDEO_START( omegaf )
WRITE8_HANDLER( ninjakd2_bgvideoram_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
}
WRITE8_HANDLER( ninjakd2_fgvideoram_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset >> 1);
}
@@ -239,43 +239,43 @@ WRITE8_HANDLER( ninjakd2_fgvideoram_w )
WRITE8_HANDLER( robokid_bg0_bank_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->robokid_bg0_bank = data & state->bank_mask;
}
WRITE8_HANDLER( robokid_bg1_bank_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->robokid_bg1_bank = data & state->bank_mask;
}
WRITE8_HANDLER( robokid_bg2_bank_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->robokid_bg2_bank = data & state->bank_mask;
}
READ8_HANDLER( robokid_bg0_videoram_r )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
return state->robokid_bg0_videoram[(state->robokid_bg0_bank << 10) | offset];
}
READ8_HANDLER( robokid_bg1_videoram_r )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
return state->robokid_bg1_videoram[(state->robokid_bg1_bank << 10) | offset];
}
READ8_HANDLER( robokid_bg2_videoram_r )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
return state->robokid_bg2_videoram[(state->robokid_bg2_bank << 10) | offset];
}
WRITE8_HANDLER( robokid_bg0_videoram_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
int const address = (state->robokid_bg0_bank << 10 ) | offset;
state->robokid_bg0_videoram[address] = data;
@@ -284,7 +284,7 @@ WRITE8_HANDLER( robokid_bg0_videoram_w )
WRITE8_HANDLER( robokid_bg1_videoram_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
int const address = (state->robokid_bg1_bank << 10 ) | offset;
state->robokid_bg1_videoram[address] = data;
@@ -293,7 +293,7 @@ WRITE8_HANDLER( robokid_bg1_videoram_w )
WRITE8_HANDLER( robokid_bg2_videoram_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
int const address = (state->robokid_bg2_bank << 10 ) | offset;
state->robokid_bg2_videoram[address] = data;
@@ -322,25 +322,25 @@ static void bg_ctrl(int offset, int data, tilemap_t* tilemap)
WRITE8_HANDLER( ninjakd2_bg_ctrl_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
bg_ctrl(offset, data, state->bg_tilemap);
}
WRITE8_HANDLER( robokid_bg0_ctrl_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
bg_ctrl(offset, data, state->bg0_tilemap);
}
WRITE8_HANDLER( robokid_bg1_ctrl_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
bg_ctrl(offset, data, state->bg1_tilemap);
}
WRITE8_HANDLER( robokid_bg2_ctrl_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
bg_ctrl(offset, data, state->bg2_tilemap);
}
@@ -348,7 +348,7 @@ WRITE8_HANDLER( robokid_bg2_ctrl_w )
WRITE8_HANDLER( ninjakd2_sprite_overdraw_w )
{
- ninjakd2_state *state = space->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = space->machine().driver_data<ninjakd2_state>();
state->next_sprite_overdraw_enabled = data & 1;
}
@@ -360,10 +360,10 @@ WRITE8_HANDLER( ninjakd2_sprite_overdraw_w )
*
*************************************/
-static void draw_sprites(running_machine* machine, bitmap_t* bitmap)
+static void draw_sprites(running_machine& machine, bitmap_t* bitmap)
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
- const gfx_element* const gfx = machine->gfx[1];
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
+ const gfx_element* const gfx = machine.gfx[1];
int const big_xshift = state->robokid_sprites ? 1 : 0;
int const big_yshift = state->robokid_sprites ? 0 : 1;
@@ -456,9 +456,9 @@ static int stencil_omegaf( UINT16 pal ) { return( TRUE ); }
// This is very hackish.
// (Is there a possibility that software can't select it but hardware can?)
-static void erase_sprites(running_machine* machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void erase_sprites(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
// if sprite overdraw is disabled, clear the sprite framebuffer
if (!state->next_sprite_overdraw_enabled)
bitmap_fill(state->sp_bitmap, cliprect, TRANSPARENTCODE);
@@ -479,9 +479,9 @@ static void erase_sprites(running_machine* machine, bitmap_t* bitmap, const rect
}
-static void update_sprites(running_machine* machine)
+static void update_sprites(running_machine& machine)
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
erase_sprites(machine, state->sp_bitmap, 0);
draw_sprites(machine, state->sp_bitmap);
}
@@ -494,10 +494,10 @@ static void update_sprites(running_machine* machine)
SCREEN_UPDATE( ninjakd2 )
{
- ninjakd2_state *state = screen->machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = screen->machine().driver_data<ninjakd2_state>();
// updating sprites here instead than in screen_eof avoids a palette glitch
// at the end of the "rainbow sky" screens.
- update_sprites(screen->machine);
+ update_sprites(screen->machine());
state->sprites_updated = 1;
bitmap_fill(bitmap, cliprect, 0);
@@ -513,8 +513,8 @@ SCREEN_UPDATE( ninjakd2 )
SCREEN_UPDATE( robokid )
{
- ninjakd2_state *state = screen->machine->driver_data<ninjakd2_state>();
- update_sprites(screen->machine);
+ ninjakd2_state *state = screen->machine().driver_data<ninjakd2_state>();
+ update_sprites(screen->machine());
state->sprites_updated = 1;
bitmap_fill(bitmap, cliprect, 0);
@@ -534,8 +534,8 @@ SCREEN_UPDATE( robokid )
SCREEN_UPDATE( omegaf )
{
- ninjakd2_state *state = screen->machine->driver_data<ninjakd2_state>();
- update_sprites(screen->machine);
+ ninjakd2_state *state = screen->machine().driver_data<ninjakd2_state>();
+ update_sprites(screen->machine());
state->sprites_updated = 1;
bitmap_fill(bitmap, cliprect, 0);
@@ -556,7 +556,7 @@ SCREEN_UPDATE( omegaf )
SCREEN_EOF( ninjakd2 )
{
- ninjakd2_state *state = machine->driver_data<ninjakd2_state>();
+ ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
if (!state->sprites_updated)
update_sprites(machine);
diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c
index a04578fa66d..5be61d7c243 100644
--- a/src/mame/video/ninjaw.c
+++ b/src/mame/video/ninjaw.c
@@ -6,7 +6,7 @@
VIDEO_START( ninjaw )
{
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
/* Ensure palette from correct TC0110PCR used for each screen */
tc0100scn_set_colbanks(state->tc0100scn_1, 0x0, 0x100, 0x200);
@@ -16,9 +16,9 @@ VIDEO_START( ninjaw )
SPRITE DRAW ROUTINE
************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
{
- ninjaw_state *state = machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = machine.driver_data<ninjaw_state>();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -80,7 +80,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
cury = y;
code = tilenum;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code, color,
flipx, flipy,
curx, cury, 0);
@@ -99,7 +99,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ninjaw )
{
- ninjaw_state *state = screen->machine->driver_data<ninjaw_state>();
+ ninjaw_state *state = screen->machine().driver_data<ninjaw_state>();
int xoffs = 0;
UINT8 layer[3], nodraw;
device_t *tc0100scn = NULL;
@@ -132,15 +132,15 @@ SCREEN_UPDATE( ninjaw )
/* Ensure screen blanked even when bottom layers not drawn due to disable bit */
if (nodraw)
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* Sprites can be under/over the layer below text layer */
- draw_sprites(screen->machine, bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer
+ draw_sprites(screen->machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer
// draw middle layer
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 0);
- draw_sprites(screen->machine,bitmap,cliprect,0,xoffs,8); // draw sprites with priority 0 which are over the mid layer
+ draw_sprites(screen->machine(),bitmap,cliprect,0,xoffs,8); // draw sprites with priority 0 which are over the mid layer
// draw top(text) layer
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0);
diff --git a/src/mame/video/nitedrvr.c b/src/mame/video/nitedrvr.c
index 3d904d527e2..09330e836bb 100644
--- a/src/mame/video/nitedrvr.c
+++ b/src/mame/video/nitedrvr.c
@@ -9,7 +9,7 @@
WRITE8_HANDLER( nitedrvr_videoram_w )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -17,7 +17,7 @@ WRITE8_HANDLER( nitedrvr_videoram_w )
WRITE8_HANDLER( nitedrvr_hvc_w )
{
- nitedrvr_state *state = space->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = space->machine().driver_data<nitedrvr_state>();
state->hvc[offset & 0x3f] = data;
@@ -27,7 +27,7 @@ WRITE8_HANDLER( nitedrvr_hvc_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
int code = state->videoram[tile_index] & 0x3f;
SET_TILE_INFO(0, code, 0, 0);
@@ -37,7 +37,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( nitedrvr )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -55,9 +55,9 @@ static void draw_box( bitmap_t *bitmap, int bx, int by, int ex, int ey )
return;
}
-static void draw_roadway( running_machine *machine, bitmap_t *bitmap )
+static void draw_roadway( running_machine &machine, bitmap_t *bitmap )
{
- nitedrvr_state *state = machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = machine.driver_data<nitedrvr_state>();
int roadway;
for (roadway = 0; roadway < 16; roadway++)
@@ -75,9 +75,9 @@ static void draw_roadway( running_machine *machine, bitmap_t *bitmap )
SCREEN_UPDATE( nitedrvr )
{
- nitedrvr_state *state = screen->machine->driver_data<nitedrvr_state>();
+ nitedrvr_state *state = screen->machine().driver_data<nitedrvr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_roadway(screen->machine, bitmap);
+ draw_roadway(screen->machine(), bitmap);
return 0;
}
diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c
index 8514e1364a9..73a3bb3b438 100644
--- a/src/mame/video/niyanpai.c
+++ b/src/mame/video/niyanpai.c
@@ -10,8 +10,8 @@
#include "includes/niyanpai.h"
-static void niyanpai_vramflip(running_machine *machine, int vram);
-static void niyanpai_gfxdraw(running_machine *machine, int vram);
+static void niyanpai_vramflip(running_machine &machine, int vram);
+static void niyanpai_gfxdraw(running_machine &machine, int vram);
/******************************************************************************
@@ -20,13 +20,13 @@ static void niyanpai_gfxdraw(running_machine *machine, int vram);
******************************************************************************/
READ16_HANDLER( niyanpai_palette_r )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
return state->palette[offset];
}
WRITE16_HANDLER( niyanpai_palette_w )
{
- niyanpai_state *state = space->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = space->machine().driver_data<niyanpai_state>();
int r, g, b;
int offs_h, offs_l;
UINT16 oldword = state->palette[offset];
@@ -46,7 +46,7 @@ WRITE16_HANDLER( niyanpai_palette_w )
g = ((state->palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
b = ((state->palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0xff00) >> 8);
- palette_set_color(space->machine, ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), ((offs_h << 8) + (offs_l << 1) + 0), MAKE_RGB(r, g, b));
}
if (ACCESSING_BITS_0_7)
@@ -55,7 +55,7 @@ WRITE16_HANDLER( niyanpai_palette_w )
g = ((state->palette[(0x080 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
b = ((state->palette[(0x100 + (offs_h * 0x180) + offs_l)] & 0x00ff) >> 0);
- palette_set_color(space->machine, ((offs_h << 8) + (offs_l << 1) + 1), MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), ((offs_h << 8) + (offs_l << 1) + 1), MAKE_RGB(r, g, b));
}
}
}
@@ -64,11 +64,11 @@ WRITE16_HANDLER( niyanpai_palette_w )
******************************************************************************/
-static int niyanpai_blitter_r(running_machine *machine, int vram, int offset)
+static int niyanpai_blitter_r(running_machine &machine, int vram, int offset)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
int ret;
- UINT8 *GFXROM = machine->region("gfx1")->base();
+ UINT8 *GFXROM = machine.region("gfx1")->base();
switch (offset)
{
@@ -80,9 +80,9 @@ static int niyanpai_blitter_r(running_machine *machine, int vram, int offset)
return ret;
}
-static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, int data)
+static void niyanpai_blitter_w(running_machine &machine, int vram, int offset, int data)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
switch (offset)
{
case 0x00: state->blitter_direction_x[vram] = (data & 0x01) ? 1 : 0;
@@ -114,15 +114,15 @@ static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, i
}
}
-static void niyanpai_clutsel_w(running_machine *machine, int vram, int data)
+static void niyanpai_clutsel_w(running_machine &machine, int vram, int data)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
state->clutsel[vram] = data;
}
-static void niyanpai_clut_w(running_machine *machine, int vram, int offset, int data)
+static void niyanpai_clut_w(running_machine &machine, int vram, int offset, int data)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
state->clut[vram][((state->clutsel[vram] & 0xff) * 0x10) + (offset & 0x0f)] = data;
}
@@ -130,13 +130,13 @@ static void niyanpai_clut_w(running_machine *machine, int vram, int offset, int
******************************************************************************/
-static void niyanpai_vramflip(running_machine *machine, int vram)
+static void niyanpai_vramflip(running_machine &machine, int vram)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
int x, y;
UINT16 color1, color2;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen[vram] == state->flipscreen_old[vram]) return;
@@ -166,24 +166,24 @@ static void niyanpai_vramflip(running_machine *machine, int vram)
state->screen_refresh = 1;
}
-static void update_pixel(running_machine *machine, int vram, int x, int y)
+static void update_pixel(running_machine &machine, int vram, int x, int y)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
- UINT16 color = state->videoram[vram][(y * machine->primary_screen->width()) + x];
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
+ UINT16 color = state->videoram[vram][(y * machine.primary_screen->width()) + x];
*BITMAP_ADDR16(state->tmpbitmap[vram], y, x) = color;
}
static TIMER_CALLBACK( blitter_timer_callback )
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
state->nb19010_busyflag = 1;
}
-static void niyanpai_gfxdraw(running_machine *machine, int vram)
+static void niyanpai_gfxdraw(running_machine &machine, int vram)
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
- int width = machine->primary_screen->width();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
+ int width = machine.primary_screen->width();
int x, y;
int dx1, dx2, dy;
@@ -229,7 +229,7 @@ static void niyanpai_gfxdraw(running_machine *machine, int vram)
skipy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = ((state->blitter_src_addr[vram] + 2) & 0x00ffffff);
for (y = starty, ctry = sizey; ctry >= 0; y += skipy, ctry--)
@@ -332,28 +332,28 @@ static void niyanpai_gfxdraw(running_machine *machine, int vram)
}
state->nb19010_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_nsec(1650 * state->nb19010_busyctr), FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_nsec(1650 * state->nb19010_busyctr), FUNC(blitter_timer_callback));
}
/******************************************************************************
******************************************************************************/
-WRITE16_HANDLER( niyanpai_blitter_0_w ) { niyanpai_blitter_w(space->machine, 0, offset, data); }
-WRITE16_HANDLER( niyanpai_blitter_1_w ) { niyanpai_blitter_w(space->machine, 1, offset, data); }
-WRITE16_HANDLER( niyanpai_blitter_2_w ) { niyanpai_blitter_w(space->machine, 2, offset, data); }
+WRITE16_HANDLER( niyanpai_blitter_0_w ) { niyanpai_blitter_w(space->machine(), 0, offset, data); }
+WRITE16_HANDLER( niyanpai_blitter_1_w ) { niyanpai_blitter_w(space->machine(), 1, offset, data); }
+WRITE16_HANDLER( niyanpai_blitter_2_w ) { niyanpai_blitter_w(space->machine(), 2, offset, data); }
-READ16_HANDLER( niyanpai_blitter_0_r ) { return niyanpai_blitter_r(space->machine, 0, offset); }
-READ16_HANDLER( niyanpai_blitter_1_r ) { return niyanpai_blitter_r(space->machine, 1, offset); }
-READ16_HANDLER( niyanpai_blitter_2_r ) { return niyanpai_blitter_r(space->machine, 2, offset); }
+READ16_HANDLER( niyanpai_blitter_0_r ) { return niyanpai_blitter_r(space->machine(), 0, offset); }
+READ16_HANDLER( niyanpai_blitter_1_r ) { return niyanpai_blitter_r(space->machine(), 1, offset); }
+READ16_HANDLER( niyanpai_blitter_2_r ) { return niyanpai_blitter_r(space->machine(), 2, offset); }
-WRITE16_HANDLER( niyanpai_clut_0_w ) { niyanpai_clut_w(space->machine, 0, offset, data); }
-WRITE16_HANDLER( niyanpai_clut_1_w ) { niyanpai_clut_w(space->machine, 1, offset, data); }
-WRITE16_HANDLER( niyanpai_clut_2_w ) { niyanpai_clut_w(space->machine, 2, offset, data); }
+WRITE16_HANDLER( niyanpai_clut_0_w ) { niyanpai_clut_w(space->machine(), 0, offset, data); }
+WRITE16_HANDLER( niyanpai_clut_1_w ) { niyanpai_clut_w(space->machine(), 1, offset, data); }
+WRITE16_HANDLER( niyanpai_clut_2_w ) { niyanpai_clut_w(space->machine(), 2, offset, data); }
-WRITE16_HANDLER( niyanpai_clutsel_0_w ) { niyanpai_clutsel_w(space->machine, 0, data); }
-WRITE16_HANDLER( niyanpai_clutsel_1_w ) { niyanpai_clutsel_w(space->machine, 1, data); }
-WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(space->machine, 2, data); }
+WRITE16_HANDLER( niyanpai_clutsel_0_w ) { niyanpai_clutsel_w(space->machine(), 0, data); }
+WRITE16_HANDLER( niyanpai_clutsel_1_w ) { niyanpai_clutsel_w(space->machine(), 1, data); }
+WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(space->machine(), 2, data); }
/******************************************************************************
@@ -361,13 +361,13 @@ WRITE16_HANDLER( niyanpai_clutsel_2_w ) { niyanpai_clutsel_w(space->machine, 2,
******************************************************************************/
VIDEO_START( niyanpai )
{
- niyanpai_state *state = machine->driver_data<niyanpai_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ niyanpai_state *state = machine.driver_data<niyanpai_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- state->tmpbitmap[0] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap[1] = machine->primary_screen->alloc_compatible_bitmap();
- state->tmpbitmap[2] = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[0] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[1] = machine.primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap[2] = machine.primary_screen->alloc_compatible_bitmap();
state->videoram[0] = auto_alloc_array_clear(machine, UINT16, width * height);
state->videoram[1] = auto_alloc_array_clear(machine, UINT16, width * height);
state->videoram[2] = auto_alloc_array_clear(machine, UINT16, width * height);
@@ -387,7 +387,7 @@ VIDEO_START( niyanpai )
******************************************************************************/
SCREEN_UPDATE( niyanpai )
{
- niyanpai_state *state = screen->machine->driver_data<niyanpai_state>();
+ niyanpai_state *state = screen->machine().driver_data<niyanpai_state>();
int i;
int x, y;
int scrollx[3], scrolly[3];
@@ -402,9 +402,9 @@ SCREEN_UPDATE( niyanpai )
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
{
- update_pixel(screen->machine, 0, x, y);
- update_pixel(screen->machine, 1, x, y);
- update_pixel(screen->machine, 2, x, y);
+ update_pixel(screen->machine(), 0, x, y);
+ update_pixel(screen->machine(), 1, x, y);
+ update_pixel(screen->machine(), 2, x, y);
}
}
diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c
index 1e3773244c4..7ef6d8f9cfb 100644
--- a/src/mame/video/nmk16.c
+++ b/src/mame/video/nmk16.c
@@ -37,28 +37,28 @@ static TILEMAP_MAPPER( afega_tilemap_scan_pages )
static TILE_GET_INFO( macross_get_bg0_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_bgvideoram0[tile_index];
SET_TILE_INFO(1,(code & 0xfff) + (state->bgbank << 12),code >> 12,0);
}
static TILE_GET_INFO( macross_get_bg1_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_bgvideoram1[tile_index];
SET_TILE_INFO(1,(code & 0xfff) + (state->bgbank << 12),code >> 12,0);
}
static TILE_GET_INFO( macross_get_bg2_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_bgvideoram2[tile_index];
SET_TILE_INFO(1,(code & 0xfff) + (state->bgbank << 12),code >> 12,0);
}
static TILE_GET_INFO( macross_get_bg3_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_bgvideoram3[tile_index];
SET_TILE_INFO(1,(code & 0xfff) + (state->bgbank << 12),code >> 12,0);
}
@@ -66,7 +66,7 @@ static TILE_GET_INFO( macross_get_bg3_tile_info )
static TILE_GET_INFO( strahl_get_fg_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_fgvideoram[tile_index];
SET_TILE_INFO(
3,
@@ -77,7 +77,7 @@ static TILE_GET_INFO( strahl_get_fg_tile_info )
static TILE_GET_INFO( macross_get_tx_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_txvideoram[tile_index];
SET_TILE_INFO(
0,
@@ -88,7 +88,7 @@ static TILE_GET_INFO( macross_get_tx_tile_info )
static TILE_GET_INFO( bjtwin_get_bg_tile_info )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int code = state->nmk_bgvideoram0[tile_index];
int bank = (code & 0x800) ? 1 : 0;
SET_TILE_INFO(
@@ -100,7 +100,7 @@ static TILE_GET_INFO( bjtwin_get_bg_tile_info )
static TILE_GET_INFO( get_tile_info_0_8bit )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
UINT16 code = state->nmk_bgvideoram0[tile_index];
SET_TILE_INFO(
1,
@@ -116,9 +116,9 @@ static TILE_GET_INFO( get_tile_info_0_8bit )
***************************************************************************/
-static void nmk16_video_init(running_machine *machine)
+static void nmk16_video_init(running_machine &machine)
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
state->spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
@@ -130,7 +130,7 @@ static void nmk16_video_init(running_machine *machine)
VIDEO_START( bioship )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, macross_get_bg0_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->tx_tilemap = tilemap_create(machine, macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
@@ -138,7 +138,7 @@ VIDEO_START( bioship )
tilemap_set_transparent_pen(state->tx_tilemap,15);
nmk16_video_init(machine);
- state->background_bitmap = auto_bitmap_alloc(machine,8192,512,machine->primary_screen->format());
+ state->background_bitmap = auto_bitmap_alloc(machine,8192,512,machine.primary_screen->format());
state->bioship_background_bank=0;
state->redraw_bitmap = 1;
@@ -146,7 +146,7 @@ VIDEO_START( bioship )
VIDEO_START( strahl )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, macross_get_bg0_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->fg_tilemap = tilemap_create(machine, strahl_get_fg_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->tx_tilemap = tilemap_create(machine, macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
@@ -159,7 +159,7 @@ VIDEO_START( strahl )
VIDEO_START( macross )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, macross_get_bg0_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->tx_tilemap = tilemap_create(machine, macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
@@ -170,7 +170,7 @@ VIDEO_START( macross )
VIDEO_START( gunnail )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, macross_get_bg0_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->tx_tilemap = tilemap_create(machine, macross_get_tx_tile_info,tilemap_scan_cols,8,8,64,32);
@@ -185,7 +185,7 @@ VIDEO_START( gunnail )
VIDEO_START( macross2 )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, macross_get_bg0_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->bg_tilemap1 = tilemap_create(machine, macross_get_bg1_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
state->bg_tilemap2 = tilemap_create(machine, macross_get_bg2_tile_info, afega_tilemap_scan_pages,16,16,TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
@@ -202,14 +202,14 @@ VIDEO_START( macross2 )
VIDEO_START( raphero )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
VIDEO_START_CALL( macross2 );
state->simple_scroll = 0;
}
VIDEO_START( bjtwin )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->bg_tilemap0 = tilemap_create(machine, bjtwin_get_bg_tile_info,tilemap_scan_cols,8,8,64,32);
nmk16_video_init(machine);
@@ -227,42 +227,42 @@ VIDEO_START( bjtwin )
WRITE16_HANDLER( nmk_bgvideoram0_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_bgvideoram0[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap0,offset);
}
WRITE16_HANDLER( nmk_bgvideoram1_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_bgvideoram1[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap1,offset);
}
WRITE16_HANDLER( nmk_bgvideoram2_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_bgvideoram2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap2,offset);
}
WRITE16_HANDLER( nmk_bgvideoram3_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_bgvideoram3[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap3,offset);
}
WRITE16_HANDLER( nmk_fgvideoram_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_fgvideoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE16_HANDLER( nmk_txvideoram_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->nmk_txvideoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
@@ -270,7 +270,7 @@ WRITE16_HANDLER( nmk_txvideoram_w )
WRITE16_HANDLER( mustang_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
// mame_printf_debug("mustang %04x %04x %04x\n",offset,data,mem_mask);
switch (data & 0xff00)
@@ -298,7 +298,7 @@ WRITE16_HANDLER( mustang_scroll_w )
WRITE16_HANDLER( bioshipbg_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_8_15)
{
@@ -313,7 +313,7 @@ WRITE16_HANDLER( bioshipbg_scroll_w )
WRITE16_HANDLER( nmk_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_0_7)
{
@@ -328,7 +328,7 @@ WRITE16_HANDLER( nmk_scroll_w )
WRITE16_HANDLER( nmk_scroll_2_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_0_7)
{
@@ -343,7 +343,7 @@ WRITE16_HANDLER( nmk_scroll_2_w )
WRITE16_HANDLER( vandyke_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
state->vscroll[offset] = data;
@@ -353,7 +353,7 @@ WRITE16_HANDLER( vandyke_scroll_w )
WRITE16_HANDLER( vandykeb_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
switch (offset)
{
@@ -369,7 +369,7 @@ WRITE16_HANDLER( vandykeb_scroll_w )
WRITE16_HANDLER( manybloc_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
COMBINE_DATA(&state->gunnail_scrollram[offset]);
tilemap_set_scrollx(state->bg_tilemap0,0,state->gunnail_scrollram[0x82/2]-state->videoshift);
@@ -379,12 +379,12 @@ WRITE16_HANDLER( manybloc_scroll_w )
WRITE16_HANDLER( nmk_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
WRITE16_HANDLER( nmk_tilebank_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_0_7)
{
if (state->bgbank != (data & 0xff))
@@ -397,14 +397,14 @@ WRITE16_HANDLER( nmk_tilebank_w )
WRITE16_HANDLER( bioship_scroll_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_8_15)
state->bioship_scroll[offset]=data>>8;
}
WRITE16_HANDLER( bioship_bank_w )
{
- nmk16_state *state = space->machine->driver_data<nmk16_state>();
+ nmk16_state *state = space->machine().driver_data<nmk16_state>();
if (ACCESSING_BITS_0_7)
{
if (state->bioship_background_bank != data)
@@ -425,9 +425,9 @@ WRITE16_HANDLER( bioship_bank_w )
// manybloc uses extra flip bits on the sprites, but these break other games
-static void nmk16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int offs;
for (offs = 0;offs < 0x1000/2;offs += 8)
@@ -461,7 +461,7 @@ static void nmk16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
xx = w;
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flip_screen_get(machine), flip_screen_get(machine),
@@ -476,9 +476,9 @@ static void nmk16_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void nmk16_draw_sprites_flipsupported(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
int offs;
for (offs = 0;offs < 0x1000/2;offs += 8)
@@ -521,7 +521,7 @@ static void nmk16_draw_sprites_flipsupported(running_machine *machine, bitmap_t
xx = w;
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, flipy,
@@ -542,15 +542,15 @@ static void nmk16_draw_sprites_flipsupported(running_machine *machine, bitmap_t
SCREEN_UPDATE( macross )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -558,17 +558,17 @@ SCREEN_UPDATE( macross )
SCREEN_UPDATE( tdragon )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
-// mcu_run(screen->machine, 1);
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
+// mcu_run(screen->machine(), 1);
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -576,17 +576,17 @@ SCREEN_UPDATE( tdragon )
SCREEN_UPDATE( hachamf )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
-// mcu_run(screen->machine, 0);
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
+// mcu_run(screen->machine(), 0);
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -594,15 +594,15 @@ SCREEN_UPDATE( hachamf )
SCREEN_UPDATE( manybloc )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -610,7 +610,7 @@ SCREEN_UPDATE( manybloc )
SCREEN_UPDATE( tharrier )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
/* I think the protection device probably copies this to the regs... */
UINT16 tharrier_scroll = state->mainram[0x9f00/2];
@@ -618,10 +618,10 @@ SCREEN_UPDATE( tharrier )
tilemap_set_scrollx(state->bg_tilemap0,0,tharrier_scroll);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -629,7 +629,7 @@ SCREEN_UPDATE( tharrier )
SCREEN_UPDATE( gunnail )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
int y1;
int i=16;
rectangle bgclip = *cliprect;
@@ -696,10 +696,10 @@ SCREEN_UPDATE( gunnail )
tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
}
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
@@ -708,8 +708,8 @@ SCREEN_UPDATE( gunnail )
SCREEN_UPDATE( bioship )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
- UINT16 *tilerom = (UINT16 *)screen->machine->region("gfx5")->base();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
+ UINT16 *tilerom = (UINT16 *)screen->machine().region("gfx5")->base();
int scrollx=-(state->bioship_scroll[1] + state->bioship_scroll[0]*256);
int scrolly=-(state->bioship_scroll[3] + state->bioship_scroll[2]*256);
@@ -727,7 +727,7 @@ SCREEN_UPDATE( bioship )
int numtile = data&0xfff;
int color = (data&0xf000)>>12;
- drawgfx_opaque(state->background_bitmap,0,screen->machine->gfx[3],
+ drawgfx_opaque(state->background_bitmap,0,screen->machine().gfx[3],
numtile,
color,
0,0, /* no flip */
@@ -736,7 +736,7 @@ SCREEN_UPDATE( bioship )
data = tilerom[offs+0x1000+bank];
numtile = data&0xfff;
color = (data&0xf000)>>12;
- drawgfx_opaque(state->background_bitmap,0,screen->machine->gfx[3],
+ drawgfx_opaque(state->background_bitmap,0,screen->machine().gfx[3],
numtile,
color,
0,0, /* no flip */
@@ -750,10 +750,10 @@ SCREEN_UPDATE( bioship )
copyscrollbitmap(bitmap,state->background_bitmap,1,&scrollx,1,&scrolly,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -761,16 +761,16 @@ SCREEN_UPDATE( bioship )
SCREEN_UPDATE( strahl )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
tilemap_set_scrollx(state->tx_tilemap,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
@@ -778,22 +778,22 @@ SCREEN_UPDATE( strahl )
SCREEN_UPDATE( bjtwin )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
tilemap_set_scrollx(state->bg_tilemap0,0,-state->videoshift);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites(screen->machine(), bitmap,cliprect,0);
return 0;
}
SCREEN_EOF( nmk )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
/* sprites are DMA'd from Main RAM to a private buffer automatically
(or at least this is how I interpret the datasheet) */
@@ -806,7 +806,7 @@ SCREEN_EOF( nmk )
SCREEN_EOF( strahl )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
/* sprites are DMA'd from Main RAM to a private buffer automatically
(or at least this is how I interpret the datasheet) */
@@ -830,7 +830,7 @@ SCREEN_EOF( strahl )
VIDEO_START( afega )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
state->spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
@@ -850,7 +850,7 @@ VIDEO_START( afega )
VIDEO_START( grdnstrm )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
state->spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
@@ -871,7 +871,7 @@ VIDEO_START( grdnstrm )
VIDEO_START( firehawk )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
state->spriteram_old = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
state->spriteram_old2 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
@@ -898,13 +898,13 @@ VIDEO_START( firehawk )
***************************************************************************/
-static void video_update(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void video_update(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
int dsw_flipscreen, // 1 = Horizontal and vertical screen flip are hardwired to 2 dip switches
int xoffset, int yoffset, // bg_tilemap0 offsets
int attr_mask // "sprite active" mask
)
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
@@ -933,9 +933,9 @@ static void video_update(running_machine *machine, bitmap_t *bitmap, const recta
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
}
-static void redhawki_video_update(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- nmk16_state *state = machine->driver_data<nmk16_state>();
+ nmk16_state *state = machine.driver_data<nmk16_state>();
tilemap_set_scrollx(state->bg_tilemap0, 0, state->afega_scroll_1[0]&0xff);
@@ -949,23 +949,23 @@ static void redhawki_video_update(running_machine *machine, bitmap_t *bitmap, co
nmk16_draw_sprites_flipsupported(machine, bitmap,cliprect,0);
}
-SCREEN_UPDATE( afega ) { video_update(screen->machine,bitmap,cliprect, 1, -0x100,+0x000, 0x0001); return 0; }
-SCREEN_UPDATE( bubl2000 ) { video_update(screen->machine,bitmap,cliprect, 0, -0x100,+0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics
-SCREEN_UPDATE( redhawkb ) { video_update(screen->machine,bitmap,cliprect, 0, +0x000,+0x100, 0x0001); return 0; }
-SCREEN_UPDATE( redhawki ) { redhawki_video_update(screen->machine,bitmap,cliprect); return 0;} // strange scroll regs
+SCREEN_UPDATE( afega ) { video_update(screen->machine(),bitmap,cliprect, 1, -0x100,+0x000, 0x0001); return 0; }
+SCREEN_UPDATE( bubl2000 ) { video_update(screen->machine(),bitmap,cliprect, 0, -0x100,+0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics
+SCREEN_UPDATE( redhawkb ) { video_update(screen->machine(),bitmap,cliprect, 0, +0x000,+0x100, 0x0001); return 0; }
+SCREEN_UPDATE( redhawki ) { redhawki_video_update(screen->machine(),bitmap,cliprect); return 0;} // strange scroll regs
SCREEN_UPDATE( firehawk )
{
- nmk16_state *state = screen->machine->driver_data<nmk16_state>();
+ nmk16_state *state = screen->machine().driver_data<nmk16_state>();
tilemap_set_scrolly(state->bg_tilemap0, 0, state->afega_scroll_1[1] + 0x100);
tilemap_set_scrollx(state->bg_tilemap0, 0, state->afega_scroll_1[0]);
tilemap_draw(bitmap,cliprect,state->bg_tilemap0,0,0);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,3);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,2);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,1);
- nmk16_draw_sprites_flipsupported(screen->machine, bitmap,cliprect,0);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,3);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,2);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,1);
+ nmk16_draw_sprites_flipsupported(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
diff --git a/src/mame/video/nova2001.c b/src/mame/video/nova2001.c
index d21ce582797..1787cf43aa7 100644
--- a/src/mame/video/nova2001.c
+++ b/src/mame/video/nova2001.c
@@ -78,7 +78,7 @@ WRITE8_HANDLER( ninjakun_paletteram_w )
static TILE_GET_INFO( nova2001_get_bg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int code = state->bg_videoram[tile_index];
int color = state->bg_videoram[tile_index + 0x400] & 0x0f;
@@ -87,7 +87,7 @@ static TILE_GET_INFO( nova2001_get_bg_tile_info )
static TILE_GET_INFO( nova2001_get_fg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int attr = state->fg_videoram[tile_index + 0x400];
int code = state->fg_videoram[tile_index];
int color = attr & 0x0f;
@@ -99,7 +99,7 @@ static TILE_GET_INFO( nova2001_get_fg_tile_info )
static TILE_GET_INFO( ninjakun_get_bg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int attr = state->bg_videoram[tile_index+0x400];
int code = state->bg_videoram[tile_index] + ((attr & 0xc0) << 2);
int color = attr & 0x0f;
@@ -109,7 +109,7 @@ static TILE_GET_INFO( ninjakun_get_bg_tile_info )
static TILE_GET_INFO( ninjakun_get_fg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int attr = state->fg_videoram[tile_index+0x400];
int code = state->fg_videoram[tile_index] + ((attr & 0x20) << 3);
int color = attr & 0x0f;
@@ -121,7 +121,7 @@ static TILE_GET_INFO( ninjakun_get_fg_tile_info )
static TILE_GET_INFO( pkunwar_get_bg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int attr = state->bg_videoram[tile_index + 0x400];
int code = state->bg_videoram[tile_index] + ((attr & 0x07) << 8);
int color = (attr & 0xf0) >> 4;
@@ -133,7 +133,7 @@ static TILE_GET_INFO( pkunwar_get_bg_tile_info )
static TILE_GET_INFO( raiders5_get_bg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int attr = state->bg_videoram[tile_index+0x400];
int code = state->bg_videoram[tile_index] + ((attr & 0x01) << 8);
int color = (attr & 0xf0) >> 4;
@@ -143,7 +143,7 @@ static TILE_GET_INFO( raiders5_get_bg_tile_info )
static TILE_GET_INFO( raiders5_get_fg_tile_info )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
int code = state->fg_videoram[tile_index];
int color = (state->fg_videoram[tile_index + 0x400] & 0xf0) >> 4;
@@ -160,7 +160,7 @@ static TILE_GET_INFO( raiders5_get_fg_tile_info )
VIDEO_START( nova2001 )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
state->bg_tilemap = tilemap_create(machine, nova2001_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, nova2001_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -169,14 +169,14 @@ VIDEO_START( nova2001 )
VIDEO_START( pkunwar )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
state->bg_tilemap = tilemap_create(machine, pkunwar_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
}
VIDEO_START( ninjakun )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
state->bg_tilemap = tilemap_create(machine, ninjakun_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, ninjakun_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -185,7 +185,7 @@ VIDEO_START( ninjakun )
VIDEO_START( raiders5 )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
state->bg_tilemap = tilemap_create(machine, raiders5_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, raiders5_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -202,21 +202,21 @@ VIDEO_START( raiders5 )
WRITE8_HANDLER( nova2001_fg_videoram_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( nova2001_bg_videoram_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( ninjakun_bg_videoram_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
int x = tilemap_get_scrollx(state->bg_tilemap, 0) >> 3;
int y = tilemap_get_scrolly(state->bg_tilemap, 0) >> 3;
@@ -229,7 +229,7 @@ WRITE8_HANDLER( ninjakun_bg_videoram_w )
READ8_HANDLER( ninjakun_bg_videoram_r )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
int x = tilemap_get_scrollx(state->bg_tilemap, 0) >> 3;
int y = tilemap_get_scrolly(state->bg_tilemap, 0) >> 3;
@@ -241,25 +241,25 @@ READ8_HANDLER( ninjakun_bg_videoram_r )
WRITE8_HANDLER( nova2001_scroll_x_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( nova2001_scroll_y_w )
{
- nova2001_state *state = space->machine->driver_data<nova2001_state>();
+ nova2001_state *state = space->machine().driver_data<nova2001_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( nova2001_flipscreen_w )
{
// inverted
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
WRITE8_HANDLER( pkunwar_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -270,11 +270,11 @@ WRITE8_HANDLER( pkunwar_flipscreen_w )
*
*************************************/
-static void nova2001_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void nova2001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
int offs;
for (offs = 0; offs < 0x800; offs += 32)
@@ -308,11 +308,11 @@ static void nova2001_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
}
}
-static void pkunwar_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- nova2001_state *state = machine->driver_data<nova2001_state>();
+ nova2001_state *state = machine.driver_data<nova2001_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
int offs;
for (offs = 0; offs < 0x800; offs += 32)
@@ -357,10 +357,10 @@ static void pkunwar_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( nova2001 )
{
- nova2001_state *state = screen->machine->driver_data<nova2001_state>();
+ nova2001_state *state = screen->machine().driver_data<nova2001_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- nova2001_draw_sprites(screen->machine, bitmap, cliprect);
+ nova2001_draw_sprites(screen->machine(), bitmap, cliprect);
// according to the schematics, fg category 0 should be drawn behind sprites,
// but it doesn't look right that way
@@ -372,10 +372,10 @@ SCREEN_UPDATE( nova2001 )
SCREEN_UPDATE( pkunwar )
{
- nova2001_state *state = screen->machine->driver_data<nova2001_state>();
+ nova2001_state *state = screen->machine().driver_data<nova2001_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
- pkunwar_draw_sprites(screen->machine, bitmap, cliprect);
+ pkunwar_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
@@ -384,12 +384,12 @@ SCREEN_UPDATE( pkunwar )
SCREEN_UPDATE( ninjakun )
{
- nova2001_state *state = screen->machine->driver_data<nova2001_state>();
+ nova2001_state *state = screen->machine().driver_data<nova2001_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 1, 0);
- nova2001_draw_sprites(screen->machine, bitmap, cliprect);
+ nova2001_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -398,10 +398,10 @@ SCREEN_UPDATE( ninjakun )
SCREEN_UPDATE( raiders5 )
{
- nova2001_state *state = screen->machine->driver_data<nova2001_state>();
+ nova2001_state *state = screen->machine().driver_data<nova2001_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- pkunwar_draw_sprites(screen->machine, bitmap, cliprect);
+ pkunwar_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/nycaptor.c b/src/mame/video/nycaptor.c
index 4327651170a..cb8290cd360 100644
--- a/src/mame/video/nycaptor.c
+++ b/src/mame/video/nycaptor.c
@@ -15,9 +15,9 @@
spot number isn't set to 0 in main menu ; lives - yes
sprites in main menu req priority 'type' 0
*/
-static int nycaptor_spot( running_machine *machine )
+static int nycaptor_spot( running_machine &machine )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
if (state->gametype == 0 || state->gametype == 2)
return state->sharedram[0x299] ? state->sharedram[0x298] : 0;
@@ -27,19 +27,19 @@ static int nycaptor_spot( running_machine *machine )
WRITE8_HANDLER(nycaptor_spriteram_w)
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->spriteram[offset] = data;
}
READ8_HANDLER(nycaptor_spriteram_r)
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->spriteram[offset];
}
static TILE_GET_INFO( get_tile_info )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
int pal = state->videoram[tile_index * 2 + 1] & 0x0f;
tileinfo->category = (state->videoram[tile_index * 2 + 1] & 0x30) >> 4;
@@ -74,7 +74,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( nycaptor )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
state->spriteram = auto_alloc_array(machine, UINT8, 160);
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32 );
@@ -84,31 +84,31 @@ VIDEO_START( nycaptor )
tilemap_set_transmask(state->bg_tilemap, 2, 0xfffc, 0x0003);//split 2
tilemap_set_transmask(state->bg_tilemap, 3, 0xfff0, 0x000f);//split 3
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
- machine->generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200);
+ machine.generic.paletteram2.u8 = auto_alloc_array(machine, UINT8, 0x200);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
state->save_pointer(NAME(state->spriteram), 160);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x200);
- state_save_register_global_pointer(machine, machine->generic.paletteram2.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x200);
+ state_save_register_global_pointer(machine, machine.generic.paletteram2.u8, 0x200);
}
WRITE8_HANDLER( nycaptor_videoram_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
}
READ8_HANDLER( nycaptor_videoram_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( nycaptor_palette_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
if (state->gametype == 2) //colt
return;
@@ -121,17 +121,17 @@ WRITE8_HANDLER( nycaptor_palette_w )
READ8_HANDLER( nycaptor_palette_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
if (offset & 0x100)
- return space->machine->generic.paletteram2.u8[(offset & 0xff) + (state->palette_bank << 8)];
+ return space->machine().generic.paletteram2.u8[(offset & 0xff) + (state->palette_bank << 8)];
else
- return space->machine->generic.paletteram.u8 [(offset & 0xff) + (state->palette_bank << 8)];
+ return space->machine().generic.paletteram.u8 [(offset & 0xff) + (state->palette_bank << 8)];
}
WRITE8_HANDLER( nycaptor_gfxctrl_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
if (state->gfxctrl == data)
return;
@@ -150,26 +150,26 @@ WRITE8_HANDLER( nycaptor_gfxctrl_w )
READ8_HANDLER( nycaptor_gfxctrl_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->gfxctrl;
}
READ8_HANDLER( nycaptor_scrlram_r )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
return state->scrlram[offset];
}
WRITE8_HANDLER( nycaptor_scrlram_w )
{
- nycaptor_state *state = space->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
state->scrlram[offset] = data;
tilemap_set_scrolly(state->bg_tilemap, offset, data);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
int i;
for (i = 0; i < 0x20; i++)
@@ -192,7 +192,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipx = BIT(state->spriteram[offs + 1], 6);
flipy = BIT(state->spriteram[offs + 1], 7);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code,
pal,
flipx,flipy,
@@ -201,7 +201,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (state->spriteram[offs + 3] > 240)
{
sx = (state->spriteram[offs + 3] - 256);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code,
pal,
flipx,flipy,
@@ -226,9 +226,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
#define mKEY_MASK(x,y) if (input_code_pressed_once(machine, x)) { state->mask |= y; tilemap_mark_all_tiles_dirty(state->bg_tilemap); }
-static void nycaptor_setmask( running_machine *machine )
+static void nycaptor_setmask( running_machine &machine )
{
- nycaptor_state *state = machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = machine.driver_data<nycaptor_state>();
mKEY_MASK(KEYCODE_Q, 1); /* bg */
mKEY_MASK(KEYCODE_W, 2);
@@ -251,10 +251,10 @@ static void nycaptor_setmask( running_machine *machine )
SCREEN_UPDATE( nycaptor )
{
- nycaptor_state *state = screen->machine->driver_data<nycaptor_state>();
+ nycaptor_state *state = screen->machine().driver_data<nycaptor_state>();
#if NYCAPTOR_DEBUG
- nycaptor_setmask(screen->machine);
+ nycaptor_setmask(screen->machine());
if (state->mask & 0x1000)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0);
@@ -265,46 +265,46 @@ SCREEN_UPDATE( nycaptor )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
- draw_sprites(screen->machine, bitmap, cliprect, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 5);
- draw_sprites(screen->machine, bitmap, cliprect, 6);
- draw_sprites(screen->machine, bitmap, cliprect, 7);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, 5);
+ draw_sprites(screen->machine(), bitmap, cliprect, 6);
+ draw_sprites(screen->machine(), bitmap, cliprect, 7);
}
else
#endif
- switch (nycaptor_spot(screen->machine) & 3)
+ switch (nycaptor_spot(screen->machine()) & 3)
{
case 0:
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 6);
+ draw_sprites(screen->machine(), bitmap, cliprect, 6);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
break;
case 1:
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
break;
@@ -313,20 +313,20 @@ SCREEN_UPDATE( nycaptor )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 3, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 3, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 2, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 2, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
break;
case 3:
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1 | 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0 | 0, 0);
break;
diff --git a/src/mame/video/offtwall.c b/src/mame/video/offtwall.c
index a02fb9f7f14..cdc5037c3f9 100644
--- a/src/mame/video/offtwall.c
+++ b/src/mame/video/offtwall.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -71,7 +71,7 @@ VIDEO_START( offtwall )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- offtwall_state *state = machine->driver_data<offtwall_state>();
+ offtwall_state *state = machine.driver_data<offtwall_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -90,7 +90,7 @@ VIDEO_START( offtwall )
SCREEN_UPDATE( offtwall )
{
- offtwall_state *state = screen->machine->driver_data<offtwall_state>();
+ offtwall_state *state = screen->machine().driver_data<offtwall_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/ohmygod.c b/src/mame/video/ohmygod.c
index 095b6b402d0..9fa0e7b6b85 100644
--- a/src/mame/video/ohmygod.c
+++ b/src/mame/video/ohmygod.c
@@ -9,7 +9,7 @@
static TILE_GET_INFO( get_tile_info )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
UINT16 code = state->videoram[2 * tile_index + 1];
UINT16 attr = state->videoram[2 * tile_index];
SET_TILE_INFO(
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( ohmygod )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
}
@@ -43,28 +43,28 @@ VIDEO_START( ohmygod )
WRITE16_HANDLER( ohmygod_videoram_w )
{
- ohmygod_state *state = space->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = space->machine().driver_data<ohmygod_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE16_HANDLER( ohmygod_spritebank_w )
{
- ohmygod_state *state = space->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = space->machine().driver_data<ohmygod_state>();
if (ACCESSING_BITS_8_15)
state->spritebank = data & 0x8000;
}
WRITE16_HANDLER( ohmygod_scrollx_w )
{
- ohmygod_state *state = space->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = space->machine().driver_data<ohmygod_state>();
COMBINE_DATA(&state->scrollx);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx - 0x81ec);
}
WRITE16_HANDLER( ohmygod_scrolly_w )
{
- ohmygod_state *state = space->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = space->machine().driver_data<ohmygod_state>();
COMBINE_DATA(&state->scrolly);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly - 0x81ef);
}
@@ -76,9 +76,9 @@ WRITE16_HANDLER( ohmygod_scrolly_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ohmygod_state *state = machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = machine.driver_data<ohmygod_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -97,7 +97,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sy -= 65536;
flipx = sr[offs + 3] & 0x8000;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,0,
@@ -107,9 +107,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( ohmygod )
{
- ohmygod_state *state = screen->machine->driver_data<ohmygod_state>();
+ ohmygod_state *state = screen->machine().driver_data<ohmygod_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c
index 5d90dae1beb..b56a23e5847 100644
--- a/src/mame/video/ojankohs.c
+++ b/src/mame/video/ojankohs.c
@@ -22,7 +22,7 @@ PALETTE_INIT( ojankoy )
int i;
int bit0, bit1, bit2, bit3, bit4, r, g, b;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
bit0 = BIT(color_prom[0], 2);
bit1 = BIT(color_prom[0], 3);
@@ -30,17 +30,17 @@ PALETTE_INIT( ojankoy )
bit3 = BIT(color_prom[0], 5);
bit4 = BIT(color_prom[0], 6);
r = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
- bit0 = BIT(color_prom[machine->total_colors()], 5);
- bit1 = BIT(color_prom[machine->total_colors()], 6);
- bit2 = BIT(color_prom[machine->total_colors()], 7);
+ bit0 = BIT(color_prom[machine.total_colors()], 5);
+ bit1 = BIT(color_prom[machine.total_colors()], 6);
+ bit2 = BIT(color_prom[machine.total_colors()], 7);
bit3 = BIT(color_prom[0], 0);
bit4 = BIT(color_prom[0], 1);
g = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
- bit0 = BIT(color_prom[machine->total_colors()], 0);
- bit1 = BIT(color_prom[machine->total_colors()], 1);
- bit2 = BIT(color_prom[machine->total_colors()], 2);
- bit3 = BIT(color_prom[machine->total_colors()], 3);
- bit4 = BIT(color_prom[machine->total_colors()], 4);
+ bit0 = BIT(color_prom[machine.total_colors()], 0);
+ bit1 = BIT(color_prom[machine.total_colors()], 1);
+ bit2 = BIT(color_prom[machine.total_colors()], 2);
+ bit3 = BIT(color_prom[machine.total_colors()], 3);
+ bit4 = BIT(color_prom[machine.total_colors()], 4);
b = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4;
palette_set_color(machine, i, MAKE_RGB(r, g, b));
@@ -50,7 +50,7 @@ PALETTE_INIT( ojankoy )
WRITE8_HANDLER( ojankohs_palette_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int r, g, b;
state->paletteram[offset] = data;
@@ -61,12 +61,12 @@ WRITE8_HANDLER( ojankohs_palette_w )
g = ((state->paletteram[offset + 0] & 0x03) << 3) | ((state->paletteram[offset + 1] & 0xe0) >> 5);
b = (state->paletteram[offset + 1] & 0x1f) >> 0;
- palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
}
WRITE8_HANDLER( ccasino_palette_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int r, g, b;
/* get top 8 bits of the I/O port address */
@@ -80,12 +80,12 @@ WRITE8_HANDLER( ccasino_palette_w )
g = ((state->paletteram[offset + 0] & 0x03) << 3) | ((state->paletteram[offset + 1] & 0xe0) >> 5);
b = (state->paletteram[offset + 1] & 0x1f) >> 0;
- palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
}
WRITE8_HANDLER( ojankoc_palette_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int r, g, b, color;
if (state->paletteram[offset] == data)
@@ -100,7 +100,7 @@ WRITE8_HANDLER( ojankoc_palette_w )
g = (color >> 5) & 0x1f;
b = (color >> 0) & 0x1f;
- palette_set_color_rgb(space->machine, offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset >> 1, pal5bit(r), pal5bit(g), pal5bit(b));
}
@@ -112,21 +112,21 @@ WRITE8_HANDLER( ojankoc_palette_w )
WRITE8_HANDLER( ojankohs_videoram_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
}
WRITE8_HANDLER( ojankohs_colorram_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
}
WRITE8_HANDLER( ojankohs_gfxreg_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
if (state->gfxreg != data)
{
@@ -137,14 +137,14 @@ WRITE8_HANDLER( ojankohs_gfxreg_w )
WRITE8_HANDLER( ojankohs_flipscreen_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
if (state->flipscreen != BIT(data, 0))
{
state->flipscreen = BIT(data, 0);
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
if (state->flipscreen)
{
@@ -161,7 +161,7 @@ WRITE8_HANDLER( ojankohs_flipscreen_w )
static TILE_GET_INFO( ojankohs_get_tile_info )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
int tile = state->videoram[tile_index] | ((state->colorram[tile_index] & 0x0f) << 8);
int color = (state->colorram[tile_index] & 0xe0) >> 5;
@@ -176,7 +176,7 @@ static TILE_GET_INFO( ojankohs_get_tile_info )
static TILE_GET_INFO( ojankoy_get_tile_info )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
int tile = state->videoram[tile_index] | (state->videoram[tile_index + 0x1000] << 8);
int color = state->colorram[tile_index] & 0x3f;
int flipx = ((state->colorram[tile_index] & 0x40) >> 6) ? TILEMAP_FLIPX : 0;
@@ -194,7 +194,7 @@ static TILE_GET_INFO( ojankoy_get_tile_info )
void ojankoc_flipscreen( address_space *space, int data )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int x, y;
UINT8 color1, color2;
@@ -224,7 +224,7 @@ void ojankoc_flipscreen( address_space *space, int data )
WRITE8_HANDLER( ojankoc_videoram_w )
{
- ojankohs_state *state = space->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = space->machine().driver_data<ojankohs_state>();
int i;
UINT8 x, y, xx, px, py ;
UINT8 color, color1, color2;
@@ -268,7 +268,7 @@ WRITE8_HANDLER( ojankoc_videoram_w )
VIDEO_START( ojankohs )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
state->tilemap = tilemap_create(machine, ojankohs_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
state->videoram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -282,7 +282,7 @@ VIDEO_START( ojankohs )
VIDEO_START( ojankoy )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
state->tilemap = tilemap_create(machine, ojankoy_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
state->videoram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -296,9 +296,9 @@ VIDEO_START( ojankoy )
VIDEO_START( ojankoc )
{
- ojankohs_state *state = machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = machine.driver_data<ojankohs_state>();
- state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
state->videoram = auto_alloc_array(machine, UINT8, 0x8000);
state->paletteram = auto_alloc_array(machine, UINT8, 0x20);
@@ -316,7 +316,7 @@ VIDEO_START( ojankoc )
SCREEN_UPDATE( ojankohs )
{
- ojankohs_state *state = screen->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = screen->machine().driver_data<ojankohs_state>();
tilemap_set_scrollx(state->tilemap, 0, state->scrollx);
tilemap_set_scrolly(state->tilemap, 0, state->scrolly);
@@ -327,12 +327,12 @@ SCREEN_UPDATE( ojankohs )
SCREEN_UPDATE( ojankoc )
{
- ojankohs_state *state = screen->machine->driver_data<ojankohs_state>();
+ ojankohs_state *state = screen->machine().driver_data<ojankohs_state>();
int offs;
if (state->screen_refresh)
{
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* redraw bitmap */
for (offs = 0; offs < 0x8000; offs++)
diff --git a/src/mame/video/oneshot.c b/src/mame/video/oneshot.c
index b1983dc730e..14bf85acb16 100644
--- a/src/mame/video/oneshot.c
+++ b/src/mame/video/oneshot.c
@@ -7,7 +7,7 @@
/* bg tilemap */
static TILE_GET_INFO( get_oneshot_bg_tile_info )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
int tileno = state->bg_videoram[tile_index * 2 + 1];
SET_TILE_INFO(0, tileno, 0, 0);
@@ -15,7 +15,7 @@ static TILE_GET_INFO( get_oneshot_bg_tile_info )
WRITE16_HANDLER( oneshot_bg_videoram_w )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
@@ -23,7 +23,7 @@ WRITE16_HANDLER( oneshot_bg_videoram_w )
/* mid tilemap */
static TILE_GET_INFO( get_oneshot_mid_tile_info )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
int tileno = state->mid_videoram[tile_index * 2 + 1];
SET_TILE_INFO(0, tileno, 2, 0);
@@ -31,7 +31,7 @@ static TILE_GET_INFO( get_oneshot_mid_tile_info )
WRITE16_HANDLER( oneshot_mid_videoram_w )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
COMBINE_DATA(&state->mid_videoram[offset]);
tilemap_mark_tile_dirty(state->mid_tilemap, offset / 2);
}
@@ -40,7 +40,7 @@ WRITE16_HANDLER( oneshot_mid_videoram_w )
/* fg tilemap */
static TILE_GET_INFO( get_oneshot_fg_tile_info )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
int tileno = state->fg_videoram[tile_index * 2 + 1];
SET_TILE_INFO(0, tileno, 3, 0);
@@ -48,14 +48,14 @@ static TILE_GET_INFO( get_oneshot_fg_tile_info )
WRITE16_HANDLER( oneshot_fg_videoram_w )
{
- oneshot_state *state = space->machine->driver_data<oneshot_state>();
+ oneshot_state *state = space->machine().driver_data<oneshot_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
VIDEO_START( oneshot )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
state->bg_tilemap = tilemap_create(machine, get_oneshot_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->mid_tilemap = tilemap_create(machine, get_oneshot_mid_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -66,9 +66,9 @@ VIDEO_START( oneshot )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_crosshairs( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_crosshairs( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
//int xpos,ypos;
/* get gun raw coordinates (player 1) */
@@ -99,12 +99,12 @@ static void draw_crosshairs( running_machine *machine, bitmap_t *bitmap, const r
state->gun_x_p2 = 0;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- oneshot_state *state = machine->driver_data<oneshot_state>();
+ oneshot_state *state = machine.driver_data<oneshot_state>();
const UINT16 *source = state->sprites;
const UINT16 *finish = source + (0x1000 / 2);
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
int xpos, ypos;
@@ -158,33 +158,33 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( oneshot )
{
- oneshot_state *state = screen->machine->driver_data<oneshot_state>();
+ oneshot_state *state = screen->machine().driver_data<oneshot_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_set_scrollx(state->mid_tilemap, 0, state->scroll[0] - 0x1f5);
tilemap_set_scrolly(state->mid_tilemap, 0, state->scroll[1]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_crosshairs(screen->machine, bitmap, cliprect);
+ draw_crosshairs(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( maddonna )
{
- oneshot_state *state = screen->machine->driver_data<oneshot_state>();
+ oneshot_state *state = screen->machine().driver_data<oneshot_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_set_scrolly(state->mid_tilemap, 0, state->scroll[1]); // other registers aren't used so we don't know which layers they relate to
tilemap_draw(bitmap, cliprect, state->mid_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
// popmessage ("%04x %04x %04x %04x %04x %04x %04x %04x", state->scroll[0], state->scroll[1], state->scroll[2], state->scroll[3], state->scroll[4], state->scroll[5], state->scroll[6], state->scroll[7]);
return 0;
diff --git a/src/mame/video/opwolf.c b/src/mame/video/opwolf.c
index c7241177150..ea68e62da55 100644
--- a/src/mame/video/opwolf.c
+++ b/src/mame/video/opwolf.c
@@ -12,7 +12,7 @@
WRITE16_HANDLER( opwolf_spritectrl_w )
{
- opwolf_state *state = space->machine->driver_data<opwolf_state>();
+ opwolf_state *state = space->machine().driver_data<opwolf_state>();
if (offset == 0)
{
@@ -38,7 +38,7 @@ WRITE16_HANDLER( opwolf_spritectrl_w )
SCREEN_UPDATE( opwolf )
{
- opwolf_state *state = screen->machine->driver_data<opwolf_state>();
+ opwolf_state *state = screen->machine().driver_data<opwolf_state>();
int layer[2];
pc080sn_tilemap_update(state->pc080sn);
@@ -46,7 +46,7 @@ SCREEN_UPDATE( opwolf )
layer[0] = 0;
layer[1] = 1;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[1], 0, 2);
diff --git a/src/mame/video/orbit.c b/src/mame/video/orbit.c
index f5fcf6efd93..5b6429ff4cb 100644
--- a/src/mame/video/orbit.c
+++ b/src/mame/video/orbit.c
@@ -9,7 +9,7 @@ Atari Orbit video emulation
WRITE8_HANDLER( orbit_playfield_w )
{
- orbit_state *state = space->machine->driver_data<orbit_state>();
+ orbit_state *state = space->machine().driver_data<orbit_state>();
state->playfield_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -17,7 +17,7 @@ WRITE8_HANDLER( orbit_playfield_w )
static TILE_GET_INFO( get_tile_info )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
UINT8 code = state->playfield_ram[tile_index];
int flags = 0;
@@ -32,14 +32,14 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( orbit )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 32, 30);
}
-static void draw_sprites( running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect )
{
- orbit_state *state = machine->driver_data<orbit_state>();
+ orbit_state *state = machine.driver_data<orbit_state>();
const UINT8* p = state->sprite_ram;
int i;
@@ -73,7 +73,7 @@ static void draw_sprites( running_machine *machine, bitmap_t* bitmap, const rect
hpos <<= 1;
vpos <<= 1;
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[layout], code, 0, flip_x, flip_y,
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[layout], code, 0, flip_x, flip_y,
hpos, vpos, zoom_x, zoom_y, 0);
}
}
@@ -81,12 +81,12 @@ static void draw_sprites( running_machine *machine, bitmap_t* bitmap, const rect
SCREEN_UPDATE( orbit )
{
- orbit_state *state = screen->machine->driver_data<orbit_state>();
+ orbit_state *state = screen->machine().driver_data<orbit_state>();
- state->flip_screen = input_port_read(screen->machine, "DSW2") & 8;
+ state->flip_screen = input_port_read(screen->machine(), "DSW2") & 8;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/othldrby.c b/src/mame/video/othldrby.c
index dc9949cbc22..c03cf9e074b 100644
--- a/src/mame/video/othldrby.c
+++ b/src/mame/video/othldrby.c
@@ -13,9 +13,9 @@
***************************************************************************/
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int plane )
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int plane )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
UINT16 attr;
tile_index = 2 * tile_index + 0x800 * plane;
@@ -53,7 +53,7 @@ static TILE_GET_INFO( get_tile_info2 )
VIDEO_START( othldrby )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 16, 16, 32, 32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 16, 16, 32, 32);
@@ -81,13 +81,13 @@ VIDEO_START( othldrby )
WRITE16_HANDLER( othldrby_videoram_addr_w )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
state->vram_addr = data;
}
READ16_HANDLER( othldrby_videoram_r )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
if (state->vram_addr < VIDEORAM_SIZE)
return state->vram[state->vram_addr++];
@@ -100,7 +100,7 @@ READ16_HANDLER( othldrby_videoram_r )
WRITE16_HANDLER( othldrby_videoram_w )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
if (state->vram_addr < VIDEORAM_SIZE)
{
@@ -114,13 +114,13 @@ WRITE16_HANDLER( othldrby_videoram_w )
WRITE16_HANDLER( othldrby_vreg_addr_w )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
state->vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */
}
WRITE16_HANDLER( othldrby_vreg_w )
{
- othldrby_state *state = space->machine->driver_data<othldrby_state>();
+ othldrby_state *state = space->machine().driver_data<othldrby_state>();
if (state->vreg_addr < OTHLDRBY_VREG_SIZE)
state->vreg[state->vreg_addr++] = data;
@@ -136,9 +136,9 @@ WRITE16_HANDLER( othldrby_vreg_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
int offs;
for (offs = 0; offs < SPRITERAM_SIZE; offs += 4)
@@ -170,7 +170,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
for (x = 0; x < sizex; x++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code + x + sizex * y,
color,
flipx,flipy,
@@ -182,14 +182,14 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( othldrby )
{
- othldrby_state *state = screen->machine->driver_data<othldrby_state>();
+ othldrby_state *state = screen->machine().driver_data<othldrby_state>();
int layer;
- flip_screen_set(screen->machine, state->vreg[0x0f] & 0x80);
+ flip_screen_set(screen->machine(), state->vreg[0x0f] & 0x80);
for (layer = 0; layer < 3; layer++)
{
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
tilemap_set_scrollx(state->bg_tilemap[layer], 0, state->vreg[2 * layer] + 59);
tilemap_set_scrolly(state->bg_tilemap[layer], 0, state->vreg[2 * layer + 1] + 248);
@@ -201,32 +201,32 @@ SCREEN_UPDATE( othldrby )
}
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
for (layer = 0; layer < 3; layer++)
tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
for (layer = 0; layer < 3; layer++)
tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
for (layer = 0; layer < 3; layer++)
tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 2, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
for (layer = 0; layer < 3; layer++)
tilemap_draw(bitmap, cliprect, state->bg_tilemap[layer], 3, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
return 0;
}
SCREEN_EOF( othldrby )
{
- othldrby_state *state = machine->driver_data<othldrby_state>();
+ othldrby_state *state = machine.driver_data<othldrby_state>();
/* sprites need to be delayed two frames */
memcpy(state->buf_spriteram, state->buf_spriteram2, SPRITERAM_SIZE * sizeof(state->buf_spriteram[0]));
diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c
index b482adbc241..56220567043 100644
--- a/src/mame/video/othunder.c
+++ b/src/mame/video/othunder.c
@@ -8,7 +8,7 @@ VIDEO_START( othunder )
/* Up to $800/8 big sprites, requires 0x100 * sizeof(*spritelist)
Multiply this by 32 to give room for the number of small sprites,
which are what actually get put in the structure. */
- othunder_state *state = machine->driver_data<othunder_state>();
+ othunder_state *state = machine.driver_data<othunder_state>();
state->spritelist = auto_alloc_array(machine, struct othunder_tempsprite, 0x2000);
}
@@ -63,11 +63,11 @@ spriteram is being tested, take no notice of that.]
********************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int y_offs )
{
- othunder_state *state = machine->driver_data<othunder_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
- UINT16 tile_mask = (machine->gfx[0]->total_elements) - 1;
+ othunder_state *state = machine.driver_data<othunder_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT16 tile_mask = (machine.gfx[0]->total_elements) - 1;
UINT16 *spriteram16 = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -167,7 +167,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -185,13 +185,13 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
@@ -202,7 +202,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
SCREEN_UPDATE( othunder )
{
- othunder_state *state = screen->machine->driver_data<othunder_state>();
+ othunder_state *state = screen->machine().driver_data<othunder_state>();
int layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -211,7 +211,7 @@ SCREEN_UPDATE( othunder )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -223,7 +223,7 @@ SCREEN_UPDATE( othunder )
/* Sprites can be under/over the layer below text layer */
{
static const int primasks[2] = {0xf0, 0xfc};
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 3);
}
return 0;
diff --git a/src/mame/video/overdriv.c b/src/mame/video/overdriv.c
index 0ad7a6dbb78..2d1c7ea47a9 100644
--- a/src/mame/video/overdriv.c
+++ b/src/mame/video/overdriv.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void overdriv_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void overdriv_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- overdriv_state *state = machine->driver_data<overdriv_state>();
+ overdriv_state *state = machine.driver_data<overdriv_state>();
int pri = (*color & 0xffe0) >> 5; /* ??????? */
if (pri)
*priority_mask = 0x02;
@@ -27,17 +27,17 @@ void overdriv_sprite_callback( running_machine *machine, int *code, int *color,
***************************************************************************/
-void overdriv_zoom_callback_0( running_machine *machine, int *code, int *color, int *flags )
+void overdriv_zoom_callback_0( running_machine &machine, int *code, int *color, int *flags )
{
- overdriv_state *state = machine->driver_data<overdriv_state>();
+ overdriv_state *state = machine.driver_data<overdriv_state>();
*flags = (*color & 0x40) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8);
*color = state->zoom_colorbase[0] + ((*color & 0x3c) >> 2);
}
-void overdriv_zoom_callback_1( running_machine *machine, int *code, int *color, int *flags )
+void overdriv_zoom_callback_1( running_machine &machine, int *code, int *color, int *flags )
{
- overdriv_state *state = machine->driver_data<overdriv_state>();
+ overdriv_state *state = machine.driver_data<overdriv_state>();
*flags = (*color & 0x40) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8);
*color = state->zoom_colorbase[1] + ((*color & 0x3c) >> 2);
@@ -52,7 +52,7 @@ void overdriv_zoom_callback_1( running_machine *machine, int *code, int *color,
SCREEN_UPDATE( overdriv )
{
- overdriv_state *state = screen->machine->driver_data<overdriv_state>();
+ overdriv_state *state = screen->machine().driver_data<overdriv_state>();
state->sprite_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
state->road_colorbase[1] = k053251_get_palette_index(state->k053251, K053251_CI1);
@@ -60,7 +60,7 @@ SCREEN_UPDATE( overdriv )
state->zoom_colorbase[1] = k053251_get_palette_index(state->k053251, K053251_CI3);
state->zoom_colorbase[0] = k053251_get_palette_index(state->k053251, K053251_CI4);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k051316_zoom_draw(state->k051316_1, bitmap, cliprect, 0, 0);
k051316_zoom_draw(state->k051316_2, bitmap, cliprect, 0, 1);
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index fbf843d0160..d936f5b2ac2 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -55,9 +55,9 @@ sprite color 0x7f will erase the tilemap and force it to be transparent.
***************************************************************************/
-static void switch_palette(running_machine *machine)
+static void switch_palette(running_machine &machine)
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int i;
const UINT8 *color_prom = state->color_prom + 256 * state->palette_bank;
@@ -84,17 +84,17 @@ static void switch_palette(running_machine *machine)
color_prom++;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
}
}
PALETTE_INIT( pacland )
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
state->color_prom = color_prom; /* we'll need this later */
/* skip the palette data, it will be initialized later */
@@ -102,15 +102,15 @@ PALETTE_INIT( pacland )
/* color_prom now points to the beginning of the lookup table */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i, *color_prom++);
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, *color_prom++);
/* Background */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + i, *color_prom++);
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i, *color_prom++);
/* Sprites */
for (i = 0;i < 0x400;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[2]->color_base + i, *color_prom++);
+ colortable_entry_set_value(machine.colortable, machine.gfx[2]->color_base + i, *color_prom++);
state->palette_bank = 0;
switch_palette(machine);
@@ -129,7 +129,7 @@ PALETTE_INIT( pacland )
/* iterate over all palette entries except the last one */
for (palentry = 0; palentry < 0x100; palentry++)
{
- UINT32 mask = colortable_get_transpen_mask(machine->colortable, machine->gfx[2], i, palentry);
+ UINT32 mask = colortable_get_transpen_mask(machine.colortable, machine.gfx[2], i, palentry);
/* transmask[0] is a mask that is used to draw only high priority sprite pixels; thus, pens
$00-$7F are opaque, and others are transparent */
@@ -158,7 +158,7 @@ PALETTE_INIT( pacland )
static TILE_GET_INFO( get_bg_tile_info )
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int offs = tile_index * 2;
int attr = state->videoram2[offs + 1];
int code = state->videoram2[offs] + ((attr & 0x01) << 8);
@@ -170,7 +170,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int offs = tile_index * 2;
int attr = state->videoram[offs + 1];
int code = state->videoram[offs] + ((attr & 0x01) << 8);
@@ -193,10 +193,10 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( pacland )
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int color;
- state->fg_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->fg_bitmap = machine.primary_screen->alloc_compatible_bitmap();
bitmap_fill(state->fg_bitmap, NULL, 0xffff);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -206,11 +206,11 @@ VIDEO_START( pacland )
/* create one group per color code; for each group, set the transparency mask
to correspond to the pens that are 0x7f or 0xff */
- assert(machine->gfx[0]->total_colors <= TILEMAP_NUM_GROUPS);
- for (color = 0; color < machine->gfx[0]->total_colors; color++)
+ assert(machine.gfx[0]->total_colors <= TILEMAP_NUM_GROUPS);
+ for (color = 0; color < machine.gfx[0]->total_colors; color++)
{
- UINT32 mask = colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0x7f);
- mask |= colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0xff);
+ UINT32 mask = colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0x7f);
+ mask |= colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0xff);
tilemap_set_transmask(state->fg_tilemap, color, mask, 0);
}
@@ -229,45 +229,45 @@ VIDEO_START( pacland )
WRITE8_HANDLER( pacland_videoram_w )
{
- pacland_state *state = space->machine->driver_data<pacland_state>();
+ pacland_state *state = space->machine().driver_data<pacland_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
WRITE8_HANDLER( pacland_videoram2_w )
{
- pacland_state *state = space->machine->driver_data<pacland_state>();
+ pacland_state *state = space->machine().driver_data<pacland_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( pacland_scroll0_w )
{
- pacland_state *state = space->machine->driver_data<pacland_state>();
+ pacland_state *state = space->machine().driver_data<pacland_state>();
state->scroll0 = data + 256 * offset;
}
WRITE8_HANDLER( pacland_scroll1_w )
{
- pacland_state *state = space->machine->driver_data<pacland_state>();
+ pacland_state *state = space->machine().driver_data<pacland_state>();
state->scroll1 = data + 256 * offset;
}
WRITE8_HANDLER( pacland_bankswitch_w )
{
- pacland_state *state = space->machine->driver_data<pacland_state>();
+ pacland_state *state = space->machine().driver_data<pacland_state>();
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
bankaddress = 0x10000 + ((data & 0x07) << 13);
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
// pbc = data & 0x20;
if (state->palette_bank != ((data & 0x18) >> 3))
{
state->palette_bank = (data & 0x18) >> 3;
- switch_palette(space->machine);
+ switch_palette(space->machine());
}
}
@@ -280,9 +280,9 @@ WRITE8_HANDLER( pacland_bankswitch_w )
***************************************************************************/
/* the sprite generator IC is the same as Mappy */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int whichmask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int whichmask)
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
UINT8 *spriteram = state->spriteram + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
UINT8 *spriteram_3 = spriteram_2 + 0x800;
@@ -322,27 +322,27 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (x = 0;x <= sizex;x++)
{
if (whichmask != 0)
- drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,state->transmask[whichmask][color]);
else
- pdrawgfx_transmask(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transmask(bitmap,cliprect,machine.gfx[2],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- machine->priority_bitmap,0,state->transmask[whichmask][color]);
+ machine.priority_bitmap,0,state->transmask[whichmask][color]);
}
}
}
}
-static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- pacland_state *state = machine->driver_data<pacland_state>();
+ pacland_state *state = machine.driver_data<pacland_state>();
int y, x;
/* draw tilemap transparently over it; this will leave invalid pens (0xffff)
@@ -353,7 +353,7 @@ static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle
/* now copy the fg_bitmap to the destination wherever the sprite pixel allows */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
- const UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ const UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
UINT16 *src = BITMAP_ADDR16(state->fg_bitmap, y, 0);
UINT16 *dst = BITMAP_ADDR16(bitmap, y, 0);
@@ -375,32 +375,32 @@ static void draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle
SCREEN_UPDATE( pacland )
{
- pacland_state *state = screen->machine->driver_data<pacland_state>();
+ pacland_state *state = screen->machine().driver_data<pacland_state>();
int row;
for (row = 5; row < 29; row++)
- tilemap_set_scrollx(state->fg_tilemap, row, flip_screen_get(screen->machine) ? state->scroll0-7 : state->scroll0);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(screen->machine) ? state->scroll1-4 : state->scroll1-3);
+ tilemap_set_scrollx(state->fg_tilemap, row, flip_screen_get(screen->machine()) ? state->scroll0-7 : state->scroll0);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(screen->machine()) ? state->scroll1-4 : state->scroll1-3);
/* draw high priority sprite pixels, setting priority bitmap to non-zero
wherever there is a high-priority pixel; note that we draw to the bitmap
which is safe because the bg_tilemap draw will overwrite everything */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0x00);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
/* draw background */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw low priority fg tiles */
- draw_fg(screen->machine, bitmap, cliprect, 0);
+ draw_fg(screen->machine(), bitmap, cliprect, 0);
/* draw sprites with regular transparency */
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
/* draw high priority fg tiles */
- draw_fg(screen->machine, bitmap, cliprect, 1);
+ draw_fg(screen->machine(), bitmap, cliprect, 1);
/* draw sprite pixels with colortable values >= 0xf0, which have priority over everything */
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
return 0;
}
diff --git a/src/mame/video/pacman.c b/src/mame/video/pacman.c
index 0d367b21805..c46932d9ff0 100644
--- a/src/mame/video/pacman.c
+++ b/src/mame/video/pacman.c
@@ -81,7 +81,7 @@ PALETTE_INIT( pacman )
2, &resistances[1], bweights, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* create a lookup table for the palette */
for (i = 0; i < 32; i++)
@@ -106,7 +106,7 @@ PALETTE_INIT( pacman )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -118,10 +118,10 @@ PALETTE_INIT( pacman )
UINT8 ctabentry = color_prom[i] & 0x0f;
/* first palette bank */
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
/* second palette bank */
- colortable_entry_set_value(machine->colortable, i + 64*4, 0x10 + ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 64*4, 0x10 + ctabentry);
}
}
@@ -141,7 +141,7 @@ static TILEMAP_MAPPER( pacman_scan_rows )
static TILE_GET_INFO( pacman_get_tile_info )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
int code = state->videoram[tile_index] | (state->charbank << 8);
int attr = (state->colorram[tile_index] & 0x1f) | (state->colortablebank << 5) | (state->palettebank << 6 );
@@ -154,9 +154,9 @@ static TILE_GET_INFO( pacman_get_tile_info )
***************************************************************************/
-static void init_save_state(running_machine *machine)
+static void init_save_state(running_machine &machine)
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
state_save_register_global(machine, state->charbank);
state_save_register_global(machine, state->spritebank);
state_save_register_global(machine, state->palettebank);
@@ -168,7 +168,7 @@ static void init_save_state(running_machine *machine)
VIDEO_START( pacman )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
init_save_state(machine);
state->charbank = 0;
@@ -190,21 +190,21 @@ VIDEO_START( pacman )
WRITE8_HANDLER( pacman_videoram_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty( state->bg_tilemap, offset );
}
WRITE8_HANDLER( pacman_colorram_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty( state->bg_tilemap, offset );
}
WRITE8_HANDLER( pacman_flipscreen_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->flipscreen = data & 1;
tilemap_set_flip( state->bg_tilemap, state->flipscreen * ( TILEMAP_FLIPX + TILEMAP_FLIPY ) );
}
@@ -212,16 +212,16 @@ WRITE8_HANDLER( pacman_flipscreen_w )
SCREEN_UPDATE( pacman )
{
- pacman_state *state = screen->machine->driver_data<pacman_state>();
+ pacman_state *state = screen->machine().driver_data<pacman_state>();
if (state->bgpriority != 0)
bitmap_fill(bitmap,cliprect,0);
else
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
- if( screen->machine->generic.spriteram_size )
+ if( screen->machine().generic.spriteram_size )
{
- UINT8 *spriteram = screen->machine->generic.spriteram.u8;
- UINT8 *spriteram_2 = screen->machine->generic.spriteram2.u8;
+ UINT8 *spriteram = screen->machine().generic.spriteram.u8;
+ UINT8 *spriteram_2 = screen->machine().generic.spriteram2.u8;
int offs;
rectangle spriteclip = spritevisiblearea;
@@ -229,7 +229,7 @@ SCREEN_UPDATE( pacman )
/* Draw the sprites. Note that it is important to draw them exactly in this */
/* order, to have the correct priorities. */
- for (offs = screen->machine->generic.spriteram_size - 2;offs > 2*2;offs -= 2)
+ for (offs = screen->machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2)
{
int color;
int sx,sy;
@@ -238,20 +238,20 @@ SCREEN_UPDATE( pacman )
sy = spriteram_2[offs] - 31;
color = ( spriteram[offs + 1] & 0x1f ) | (state->colortablebank << 5) | (state->palettebank << 6 );
- drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1],
( spriteram[offs] >> 2 ) | (state->spritebank << 6),
color,
spriteram[offs] & 1,spriteram[offs] & 2,
sx,sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
/* also plot the sprite with wraparound (tunnel in Crush Roller) */
- drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1],
( spriteram[offs] >> 2 ) | (state->spritebank << 6),
color,
spriteram[offs] & 1,spriteram[offs] & 2,
sx - 256,sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
}
/* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
/* one pixel to the left to get a more correct placement */
@@ -264,20 +264,20 @@ SCREEN_UPDATE( pacman )
sy = spriteram_2[offs] - 31;
color = ( spriteram[offs + 1] & 0x1f ) | (state->colortablebank << 5) | (state->palettebank << 6 );
- drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1],
( spriteram[offs] >> 2 ) | (state->spritebank << 6),
color,
spriteram[offs] & 1,spriteram[offs] & 2,
sx,sy + state->xoffsethack,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
/* also plot the sprite with wraparound (tunnel in Crush Roller) */
- drawgfx_transmask(bitmap,&spriteclip,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,&spriteclip,screen->machine().gfx[1],
( spriteram[offs] >> 2 ) | (state->spritebank << 6),
color,
spriteram[offs] & 2,spriteram[offs] & 1,
sx - 256,sy + state->xoffsethack,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
}
}
@@ -295,7 +295,7 @@ SCREEN_UPDATE( pacman )
VIDEO_START( pengo )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
init_save_state(machine);
state->charbank = 0;
@@ -315,7 +315,7 @@ VIDEO_START( pengo )
WRITE8_HANDLER( pengo_palettebank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (state->palettebank != data)
{
state->palettebank = data;
@@ -325,7 +325,7 @@ WRITE8_HANDLER( pengo_palettebank_w )
WRITE8_HANDLER( pengo_colortablebank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (state->colortablebank != data)
{
state->colortablebank = data;
@@ -335,7 +335,7 @@ WRITE8_HANDLER( pengo_colortablebank_w )
WRITE8_HANDLER( pengo_gfxbank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (state->charbank != (data & 1))
{
state->spritebank = data & 1;
@@ -353,7 +353,7 @@ S2650 Games
static TILE_GET_INFO( s2650_get_tile_info )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
int colbank, code, attr;
colbank = state->s2650games_tileram[tile_index & 0x1f] & 0x3;
@@ -366,7 +366,7 @@ static TILE_GET_INFO( s2650_get_tile_info )
VIDEO_START( s2650games )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
init_save_state(machine);
state->charbank = 0;
@@ -385,14 +385,14 @@ VIDEO_START( s2650games )
SCREEN_UPDATE( s2650games )
{
- pacman_state *state = screen->machine->driver_data<pacman_state>();
- UINT8 *spriteram = screen->machine->generic.spriteram.u8;
- UINT8 *spriteram_2 = screen->machine->generic.spriteram2.u8;
+ pacman_state *state = screen->machine().driver_data<pacman_state>();
+ UINT8 *spriteram = screen->machine().generic.spriteram.u8;
+ UINT8 *spriteram_2 = screen->machine().generic.spriteram2.u8;
int offs;
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- for (offs = screen->machine->generic.spriteram_size - 2;offs > 2*2;offs -= 2)
+ for (offs = screen->machine().generic.spriteram_size - 2;offs > 2*2;offs -= 2)
{
int color;
int sx,sy;
@@ -403,12 +403,12 @@ SCREEN_UPDATE( s2650games )
color = spriteram[offs + 1] & 0x1f;
/* TODO: ?? */
- drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1],
(spriteram[offs] >> 2) | ((state->s2650games_spriteram[offs] & 3) << 6),
color,
spriteram[offs] & 1,spriteram[offs] & 2,
sx,sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
}
/* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
/* one pixel to the left to get a more correct placement */
@@ -423,26 +423,26 @@ SCREEN_UPDATE( s2650games )
color = spriteram[offs + 1] & 0x1f;
/* TODO: ?? */
- drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1],
(spriteram[offs] >> 2) | ((state->s2650games_spriteram[offs] & 3)<<6),
color,
spriteram[offs] & 1,spriteram[offs] & 2,
sx,sy + state->xoffsethack,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color & 0x3f, 0));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color & 0x3f, 0));
}
return 0;
}
WRITE8_HANDLER( s2650games_videoram_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE8_HANDLER( s2650games_colorram_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
int i;
state->colorram[offset & 0x1f] = data;
for (i = offset; i < 0x0400; i += 32)
@@ -451,13 +451,13 @@ WRITE8_HANDLER( s2650games_colorram_w )
WRITE8_HANDLER( s2650games_scroll_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
tilemap_set_scrolly(state->bg_tilemap, offset, data);
}
WRITE8_HANDLER( s2650games_tilesbank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->s2650games_tileram[offset] = data;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -499,7 +499,7 @@ static TILEMAP_MAPPER( jrpacman_scan_rows )
static TILE_GET_INFO( jrpacman_get_tile_info )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
int color_index, code, attr;
if( tile_index < 1792 )
{
@@ -516,9 +516,9 @@ static TILE_GET_INFO( jrpacman_get_tile_info )
SET_TILE_INFO(0,code,attr,0);
}
-static void jrpacman_mark_tile_dirty( running_machine *machine, int offset )
+static void jrpacman_mark_tile_dirty( running_machine &machine, int offset )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
if( offset < 0x20 )
{
/* line color - mark whole line as dirty */
@@ -547,7 +547,7 @@ static void jrpacman_mark_tile_dirty( running_machine *machine, int offset )
***************************************************************************/
VIDEO_START( jrpacman )
{
- pacman_state *state = machine->driver_data<pacman_state>();
+ pacman_state *state = machine.driver_data<pacman_state>();
init_save_state(machine);
state->charbank = 0;
@@ -567,14 +567,14 @@ VIDEO_START( jrpacman )
WRITE8_HANDLER( jrpacman_videoram_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->videoram[offset] = data;
- jrpacman_mark_tile_dirty(space->machine, offset);
+ jrpacman_mark_tile_dirty(space->machine(), offset);
}
WRITE8_HANDLER( jrpacman_charbank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
if (state->charbank != (data & 1))
{
state->charbank = data & 1;
@@ -584,13 +584,13 @@ WRITE8_HANDLER( jrpacman_charbank_w )
WRITE8_HANDLER( jrpacman_spritebank_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->spritebank = (data & 1);
}
WRITE8_HANDLER( jrpacman_scroll_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
int i;
for( i = 2; i < 34; i++ )
{
@@ -600,6 +600,6 @@ WRITE8_HANDLER( jrpacman_scroll_w )
WRITE8_HANDLER( jrpacman_bgpriority_w )
{
- pacman_state *state = space->machine->driver_data<pacman_state>();
+ pacman_state *state = space->machine().driver_data<pacman_state>();
state->bgpriority = (data & 1);
}
diff --git a/src/mame/video/pandoras.c b/src/mame/video/pandoras.c
index 3c2cebf5ee2..c31009fdcab 100644
--- a/src/mame/video/pandoras.c
+++ b/src/mame/video/pandoras.c
@@ -35,7 +35,7 @@ PALETTE_INIT( pandoras )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -60,7 +60,7 @@ PALETTE_INIT( pandoras )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -70,14 +70,14 @@ PALETTE_INIT( pandoras )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -89,7 +89,7 @@ PALETTE_INIT( pandoras )
static TILE_GET_INFO( get_tile_info0 )
{
- pandoras_state *state = machine->driver_data<pandoras_state>();
+ pandoras_state *state = machine.driver_data<pandoras_state>();
UINT8 attr = state->colorram[tile_index];
SET_TILE_INFO(
1,
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_tile_info0 )
VIDEO_START( pandoras )
{
- pandoras_state *state = machine->driver_data<pandoras_state>();
+ pandoras_state *state = machine.driver_data<pandoras_state>();
state->layer0 = tilemap_create(machine, get_tile_info0, tilemap_scan_rows, 8, 8, 32, 32);
state->save_item(NAME(state->flipscreen));
@@ -121,7 +121,7 @@ VIDEO_START( pandoras )
WRITE8_HANDLER( pandoras_vram_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
tilemap_mark_tile_dirty(state->layer0, offset);
state->videoram[offset] = data;
@@ -129,7 +129,7 @@ WRITE8_HANDLER( pandoras_vram_w )
WRITE8_HANDLER( pandoras_cram_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
tilemap_mark_tile_dirty(state->layer0, offset);
state->colorram[offset] = data;
@@ -137,17 +137,17 @@ WRITE8_HANDLER( pandoras_cram_w )
WRITE8_HANDLER( pandoras_scrolly_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
tilemap_set_scrolly(state->layer0, 0, data);
}
WRITE8_HANDLER( pandoras_flipscreen_w )
{
- pandoras_state *state = space->machine->driver_data<pandoras_state>();
+ pandoras_state *state = space->machine().driver_data<pandoras_state>();
state->flipscreen = data;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
/***************************************************************************
@@ -156,7 +156,7 @@ WRITE8_HANDLER( pandoras_flipscreen_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* sr )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* sr )
{
int offs;
@@ -168,20 +168,20 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int nflipx = sr[offs + 3] & 0x40;
int nflipy = sr[offs + 3] & 0x80;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[0],
sr[offs + 2],
color,
!nflipx,!nflipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
}
}
SCREEN_UPDATE( pandoras )
{
- pandoras_state *state = screen->machine->driver_data<pandoras_state>();
+ pandoras_state *state = screen->machine().driver_data<pandoras_state>();
tilemap_draw(bitmap,cliprect, state->layer0, 1 ,0);
- draw_sprites(screen->machine, bitmap, cliprect, &state->spriteram[0x800] );
+ draw_sprites(screen->machine(), bitmap, cliprect, &state->spriteram[0x800] );
tilemap_draw(bitmap,cliprect, state->layer0, 0 ,0);
return 0;
}
diff --git a/src/mame/video/paradise.c b/src/mame/video/paradise.c
index 8c866cd2052..4dd00ec22f5 100644
--- a/src/mame/video/paradise.c
+++ b/src/mame/video/paradise.c
@@ -30,22 +30,22 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE8_HANDLER( paradise_flipscreen_w )
{
- flip_screen_set(space->machine, data ? 0 : 1);
+ flip_screen_set(space->machine(), data ? 0 : 1);
}
WRITE8_HANDLER( tgtball_flipscreen_w )
{
- flip_screen_set(space->machine, data ? 1 : 0);
+ flip_screen_set(space->machine(), data ? 1 : 0);
}
/* 800 bytes for red, followed by 800 bytes for green & 800 bytes for blue */
WRITE8_HANDLER( paradise_palette_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
state->paletteram[offset] = data;
offset %= 0x800;
- palette_set_color_rgb(space->machine, offset, state->paletteram[offset + 0x800 * 0], state->paletteram[offset + 0x800 * 1],
+ palette_set_color_rgb(space->machine(), offset, state->paletteram[offset + 0x800 * 0], state->paletteram[offset + 0x800 * 1],
state->paletteram[offset + 0x800 * 2]);
}
@@ -63,7 +63,7 @@ WRITE8_HANDLER( paradise_palette_w )
/* Background */
WRITE8_HANDLER( paradise_vram_0_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
state->vram_0[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_0, offset % 0x400);
}
@@ -71,13 +71,13 @@ WRITE8_HANDLER( paradise_vram_0_w )
/* 16 color tiles with paradise_palbank as color code */
WRITE8_HANDLER( paradise_palbank_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
int i;
int bank1 = (data & 0x0e) | 1;
int bank2 = (data & 0xf0);
for (i = 0; i < 15; i++)
- palette_set_color_rgb(space->machine, 0x800 + i, state->paletteram[0x200 + bank2 + i + 0x800 * 0], state->paletteram[0x200 + bank2 + i + 0x800 * 1],
+ palette_set_color_rgb(space->machine(), 0x800 + i, state->paletteram[0x200 + bank2 + i + 0x800 * 0], state->paletteram[0x200 + bank2 + i + 0x800 * 1],
state->paletteram[0x200 + bank2 + i + 0x800 * 2]);
if (state->palbank != bank1)
@@ -89,7 +89,7 @@ WRITE8_HANDLER( paradise_palbank_w )
static TILE_GET_INFO( get_tile_info_0 )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
int code = state->vram_0[tile_index] + (state->vram_0[tile_index + 0x400] << 8);
SET_TILE_INFO(1, code, state->palbank, 0);
}
@@ -98,14 +98,14 @@ static TILE_GET_INFO( get_tile_info_0 )
/* Midground */
WRITE8_HANDLER( paradise_vram_1_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
state->vram_1[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_1, offset % 0x400);
}
static TILE_GET_INFO( get_tile_info_1 )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
int code = state->vram_1[tile_index] + (state->vram_1[tile_index + 0x400] << 8);
SET_TILE_INFO(2, code, 0, 0);
}
@@ -114,14 +114,14 @@ static TILE_GET_INFO( get_tile_info_1 )
/* Foreground */
WRITE8_HANDLER( paradise_vram_2_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
state->vram_2[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_2, offset % 0x400);
}
static TILE_GET_INFO( get_tile_info_2 )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
int code = state->vram_2[tile_index] + (state->vram_2[tile_index + 0x400] << 8);
SET_TILE_INFO(3, code, 0, 0);
}
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_tile_info_2 )
WRITE8_HANDLER( paradise_pixmap_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
int x, y;
state->videoram[offset] = data;
@@ -151,14 +151,14 @@ WRITE8_HANDLER( paradise_pixmap_w )
VIDEO_START( paradise )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 8, 8, 0x20, 0x20);
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 8, 8, 0x20, 0x20);
state->tilemap_2 = tilemap_create(machine, get_tile_info_2, tilemap_scan_rows, 8, 8, 0x20, 0x20);
/* pixmap */
- state->tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
tilemap_set_transparent_pen(state->tilemap_0, 0x0f);
tilemap_set_transparent_pen(state->tilemap_1, 0xff);
@@ -177,13 +177,13 @@ VIDEO_START( paradise )
/* Sprites / Layers priority */
WRITE8_HANDLER( paradise_priority_w )
{
- paradise_state *state = space->machine->driver_data<paradise_state>();
+ paradise_state *state = space->machine().driver_data<paradise_state>();
state->priority = data;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- paradise_state *state = machine->driver_data<paradise_state>();
+ paradise_state *state = machine.driver_data<paradise_state>();
UINT8 *spriteram = state->spriteram;
int i;
for (i = 0; i < state->spriteram_size ; i += state->sprite_inc)
@@ -202,20 +202,20 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
y = 0xf0 - y; flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code + (attr << 8),
0,
flipx, flipy,
x,y, 0xff );
/* wrap around x */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code + (attr << 8),
0,
flipx, flipy,
x - 256,y, 0xff );
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code + (attr << 8),
0,
flipx, flipy,
@@ -232,40 +232,40 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( paradise )
{
- paradise_state *state = screen->machine->driver_data<paradise_state>();
+ paradise_state *state = screen->machine().driver_data<paradise_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) mask |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 16;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (!(state->priority & 4)) /* Screen blanking */
return 0;
if (state->priority & 1)
if (layers_ctrl & 16)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 0);
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 0);
- if (layers_ctrl & 4) copybitmap_trans(bitmap, state->tmpbitmap, flip_screen_get(screen->machine), flip_screen_get(screen->machine), 0, 0, cliprect, 0x80f);
+ if (layers_ctrl & 4) copybitmap_trans(bitmap, state->tmpbitmap, flip_screen_get(screen->machine()), flip_screen_get(screen->machine()), 0, 0, cliprect, 0x80f);
if (state->priority & 2)
{
if (!(state->priority & 1))
if (layers_ctrl & 16)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (layers_ctrl & 8)
tilemap_draw(bitmap,cliprect, state->tilemap_2, 0, 0);
}
@@ -275,7 +275,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
if (!(state->priority & 1))
if (layers_ctrl & 16)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
}
return 0;
}
@@ -283,22 +283,22 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
/* no pix layer, no tilemap_0, different priority bits */
SCREEN_UPDATE( torus )
{
- paradise_state *state = screen->machine->driver_data<paradise_state>();
+ paradise_state *state = screen->machine().driver_data<paradise_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (!(state->priority & 2)) /* Screen blanking */
return 0;
if (state->priority & 1)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tilemap_1, 0,0);
if (state->priority & 4)
{
if (!(state->priority & 1))
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
}
@@ -307,7 +307,7 @@ SCREEN_UPDATE( torus )
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
if (!(state->priority & 1))
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
}
return 0;
}
@@ -315,12 +315,12 @@ SCREEN_UPDATE( torus )
/* I don't know how the priority bits work on this one */
SCREEN_UPDATE( madball )
{
- paradise_state *state = screen->machine->driver_data<paradise_state>();
+ paradise_state *state = screen->machine().driver_data<paradise_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 0);
tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 0);
tilemap_draw(bitmap, cliprect, state->tilemap_2, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/parodius.c b/src/mame/video/parodius.c
index e30045a902e..c6875197933 100644
--- a/src/mame/video/parodius.c
+++ b/src/mame/video/parodius.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void parodius_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void parodius_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- parodius_state *state = machine->driver_data<parodius_state>();
+ parodius_state *state = machine.driver_data<parodius_state>();
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
@@ -22,9 +22,9 @@ void parodius_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void parodius_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void parodius_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- parodius_state *state = machine->driver_data<parodius_state>();
+ parodius_state *state = machine.driver_data<parodius_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -47,7 +47,7 @@ void parodius_sprite_callback( running_machine *machine, int *code, int *color,
SCREEN_UPDATE( parodius )
{
- parodius_state *state = screen->machine->driver_data<parodius_state>();
+ parodius_state *state = screen->machine().driver_data<parodius_state>();
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -67,7 +67,7 @@ SCREEN_UPDATE( parodius )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[0], 0,1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[1], 0,2);
diff --git a/src/mame/video/pass.c b/src/mame/video/pass.c
index aa3e69746b4..8c88cab8208 100644
--- a/src/mame/video/pass.c
+++ b/src/mame/video/pass.c
@@ -7,7 +7,7 @@
static TILE_GET_INFO( get_pass_bg_tile_info )
{
- pass_state *state = machine->driver_data<pass_state>();
+ pass_state *state = machine.driver_data<pass_state>();
int tileno, fx;
tileno = state->bg_videoram[tile_index] & 0x1fff;
@@ -18,7 +18,7 @@ static TILE_GET_INFO( get_pass_bg_tile_info )
WRITE16_HANDLER( pass_bg_videoram_w )
{
- pass_state *state = space->machine->driver_data<pass_state>();
+ pass_state *state = space->machine().driver_data<pass_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -28,7 +28,7 @@ WRITE16_HANDLER( pass_bg_videoram_w )
static TILE_GET_INFO( get_pass_fg_tile_info )
{
- pass_state *state = machine->driver_data<pass_state>();
+ pass_state *state = machine.driver_data<pass_state>();
int tileno, flip;
tileno = state->fg_videoram[tile_index] & 0x3fff;
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_pass_fg_tile_info )
WRITE16_HANDLER( pass_fg_videoram_w )
{
- pass_state *state = space->machine->driver_data<pass_state>();
+ pass_state *state = space->machine().driver_data<pass_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -49,7 +49,7 @@ WRITE16_HANDLER( pass_fg_videoram_w )
VIDEO_START( pass )
{
- pass_state *state = machine->driver_data<pass_state>();
+ pass_state *state = machine.driver_data<pass_state>();
state->bg_tilemap = tilemap_create(machine, get_pass_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_pass_fg_tile_info, tilemap_scan_rows, 4, 4, 128, 64);
@@ -59,7 +59,7 @@ VIDEO_START( pass )
SCREEN_UPDATE( pass )
{
- pass_state *state = screen->machine->driver_data<pass_state>();
+ pass_state *state = screen->machine().driver_data<pass_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap, 0, 0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap, 0, 0);
diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c
index c665fcdc6ba..f6737900dd7 100644
--- a/src/mame/video/pastelg.c
+++ b/src/mame/video/pastelg.c
@@ -11,8 +11,8 @@
#include "includes/pastelg.h"
-static void pastelg_vramflip(running_machine *machine);
-static void pastelg_gfxdraw(running_machine *machine);
+static void pastelg_vramflip(running_machine &machine);
+static void pastelg_gfxdraw(running_machine &machine);
/******************************************************************************
@@ -24,7 +24,7 @@ PALETTE_INIT( pastelg )
int i;
int bit0, bit1, bit2, bit3, r, g, b;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
bit0 = (color_prom[0] >> 0) & 0x01;
bit1 = (color_prom[0] >> 1) & 0x01;
@@ -36,10 +36,10 @@ PALETTE_INIT( pastelg )
bit2 = (color_prom[0] >> 6) & 0x01;
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -49,7 +49,7 @@ PALETTE_INIT( pastelg )
WRITE8_HANDLER( pastelg_clut_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
state->clut[offset] = data;
}
@@ -59,13 +59,13 @@ WRITE8_HANDLER( pastelg_clut_w )
******************************************************************************/
int pastelg_blitter_src_addr_r(address_space *space)
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
return state->blitter_src_addr;
}
WRITE8_HANDLER( pastelg_blitter_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
switch (offset)
{
case 0: state->blitter_src_addr = (state->blitter_src_addr & 0xff00) | data; break;
@@ -75,13 +75,13 @@ WRITE8_HANDLER( pastelg_blitter_w )
case 4: state->blitter_sizex = data; break;
case 5: state->blitter_sizey = data;
/* writing here also starts the blit */
- pastelg_gfxdraw(space->machine);
+ pastelg_gfxdraw(space->machine());
break;
case 6: state->blitter_direction_x = (data & 0x01) ? 1 : 0;
state->blitter_direction_y = (data & 0x02) ? 1 : 0;
state->flipscreen = (data & 0x04) ? 0 : 1;
state->dispflag = (data & 0x08) ? 0 : 1;
- pastelg_vramflip(space->machine);
+ pastelg_vramflip(space->machine());
break;
}
}
@@ -89,22 +89,22 @@ WRITE8_HANDLER( pastelg_blitter_w )
WRITE8_HANDLER( threeds_romsel_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
if (data&0xfc) printf("%02x\n",data);
state->gfxrom = (data & 0x3);
}
WRITE8_HANDLER( threeds_output_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
state->palbank = ((data & 0x10) >> 4);
}
READ8_HANDLER( threeds_rom_readback_r )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
- UINT8 *GFX = space->machine->region("gfx1")->base();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
+ UINT8 *GFX = space->machine().region("gfx1")->base();
return GFX[(state->blitter_src_addr | (state->gfxrom << 16)) & 0x3ffff];
}
@@ -112,8 +112,8 @@ READ8_HANDLER( threeds_rom_readback_r )
WRITE8_HANDLER( pastelg_romsel_w )
{
- pastelg_state *state = space->machine->driver_data<pastelg_state>();
- int gfxlen = space->machine->region("gfx1")->bytes();
+ pastelg_state *state = space->machine().driver_data<pastelg_state>();
+ int gfxlen = space->machine().region("gfx1")->bytes();
state->gfxrom = ((data & 0xc0) >> 6);
state->palbank = ((data & 0x10) >> 4);
nb1413m3_sndrombank1_w(space, 0, data);
@@ -131,13 +131,13 @@ WRITE8_HANDLER( pastelg_romsel_w )
******************************************************************************/
-static void pastelg_vramflip(running_machine *machine)
+static void pastelg_vramflip(running_machine &machine)
{
- pastelg_state *state = machine->driver_data<pastelg_state>();
+ pastelg_state *state = machine.driver_data<pastelg_state>();
int x, y;
UINT8 color1, color2;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->flipscreen == state->flipscreen_old) return;
@@ -160,11 +160,11 @@ static TIMER_CALLBACK( blitter_timer_callback )
nb1413m3_busyflag = 1;
}
-static void pastelg_gfxdraw(running_machine *machine)
+static void pastelg_gfxdraw(running_machine &machine)
{
- pastelg_state *state = machine->driver_data<pastelg_state>();
- UINT8 *GFX = machine->region("gfx1")->base();
- int width = machine->primary_screen->width();
+ pastelg_state *state = machine.driver_data<pastelg_state>();
+ UINT8 *GFX = machine.region("gfx1")->base();
+ int width = machine.primary_screen->width();
int x, y;
int dx, dy;
@@ -207,7 +207,7 @@ static void pastelg_gfxdraw(running_machine *machine)
incy = -1;
}
- gfxlen = machine->region("gfx1")->bytes();
+ gfxlen = machine.region("gfx1")->bytes();
gfxaddr = (state->gfxrom << 16) + state->blitter_src_addr;
readflag = 0;
@@ -281,7 +281,7 @@ static void pastelg_gfxdraw(running_machine *machine)
}
nb1413m3_busyflag = 0;
- machine->scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
+ machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback));
}
/******************************************************************************
@@ -290,9 +290,9 @@ static void pastelg_gfxdraw(running_machine *machine)
******************************************************************************/
VIDEO_START( pastelg )
{
- pastelg_state *state = machine->driver_data<pastelg_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ pastelg_state *state = machine.driver_data<pastelg_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->videoram = auto_alloc_array_clear(machine, UINT8, width * height);
state->clut = auto_alloc_array(machine, UINT8, 0x10);
@@ -304,7 +304,7 @@ VIDEO_START( pastelg )
******************************************************************************/
SCREEN_UPDATE( pastelg )
{
- pastelg_state *state = screen->machine->driver_data<pastelg_state>();
+ pastelg_state *state = screen->machine().driver_data<pastelg_state>();
if (state->dispflag)
{
int x, y;
diff --git a/src/mame/video/pbaction.c b/src/mame/video/pbaction.c
index dd958bb7e87..cd99dad785f 100644
--- a/src/mame/video/pbaction.c
+++ b/src/mame/video/pbaction.c
@@ -11,37 +11,37 @@
WRITE8_HANDLER( pbaction_videoram_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( pbaction_colorram_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( pbaction_videoram2_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( pbaction_colorram2_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( pbaction_scroll_w )
{
- pbaction_state *state = space->machine->driver_data<pbaction_state>();
+ pbaction_state *state = space->machine().driver_data<pbaction_state>();
state->scroll = data - 3;
- if (flip_screen_get(space->machine))
+ if (flip_screen_get(space->machine()))
state->scroll = -state->scroll;
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll);
@@ -50,12 +50,12 @@ WRITE8_HANDLER( pbaction_scroll_w )
WRITE8_HANDLER( pbaction_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 0x10 * (attr & 0x70);
int color = attr & 0x07;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
int attr = state->colorram2[tile_index];
int code = state->videoram2[tile_index] + 0x10 * (attr & 0x30);
int color = attr & 0x0f;
@@ -77,16 +77,16 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( pbaction )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- pbaction_state *state = machine->driver_data<pbaction_state>();
+ pbaction_state *state = machine.driver_data<pbaction_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -124,7 +124,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[(spriteram[offs] & 0x80) ? 3 : 2], /* normal or double size */
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[(spriteram[offs] & 0x80) ? 3 : 2], /* normal or double size */
spriteram[offs],
spriteram[offs + 1] & 0x0f,
flipx,flipy,
@@ -134,10 +134,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( pbaction )
{
- pbaction_state *state = screen->machine->driver_data<pbaction_state>();
+ pbaction_state *state = screen->machine().driver_data<pbaction_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c
index c7b3f1f19a6..6353d58ab63 100644
--- a/src/mame/video/pcktgal.c
+++ b/src/mame/video/pcktgal.c
@@ -6,7 +6,7 @@ PALETTE_INIT( pcktgal )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -20,19 +20,19 @@ PALETTE_INIT( pcktgal )
bit2 = (color_prom[i] >> 6) & 0x01;
bit3 = (color_prom[i] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- pcktgal_state *state = machine->driver_data<pcktgal_state>();
+ pcktgal_state *state = machine.driver_data<pcktgal_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -55,7 +55,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (flipy) flipy=0; else flipy=1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
(spriteram[offs+1] & 0x70) >> 4,
flipx,flipy,
@@ -66,15 +66,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( pcktgal )
{
-// flip_screen_set(screen->machine, screen->machine->device<deco_bac06_device>("tilegen1")->get_flip_state());
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- draw_sprites(screen->machine, bitmap, cliprect);
+// flip_screen_set(screen->machine(), screen->machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( pcktgalb )
{
// the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps.
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw_bootleg(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
- draw_sprites(screen->machine, bitmap, cliprect);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw_bootleg(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;}
diff --git a/src/mame/video/pgm.c b/src/mame/video/pgm.c
index 85986a7cbf0..42e8c5935fd 100644
--- a/src/mame/video/pgm.c
+++ b/src/mame/video/pgm.c
@@ -7,11 +7,11 @@
/* Sprites - These are a pain! */
/* this decodes one of the funky sprites to a bitmap so we can draw it more easily -- slow but easier to use*/
-static void pgm_prepare_sprite( running_machine *machine, int wide, int high, int palt, int boffset )
+static void pgm_prepare_sprite( running_machine &machine, int wide, int high, int palt, int boffset )
{
- pgm_state *state = machine->driver_data<pgm_state>();
- UINT8 *bdata = machine->region("sprmask")->base();
- size_t bdatasize = machine->region("sprmask")->bytes() - 1;
+ pgm_state *state = machine.driver_data<pgm_state>();
+ UINT8 *bdata = machine.region("sprmask")->base();
+ size_t bdatasize = machine.region("sprmask")->bytes() - 1;
UINT8 *adata = state->sprite_a_region;
size_t adatasize = state->sprite_a_region_size - 1;
int xcnt, ycnt;
@@ -54,9 +54,9 @@ static void pgm_prepare_sprite( running_machine *machine, int wide, int high, in
// in the dest bitmap 0x10000 is used to mark 'used pixel' and 0x8000 is used to mark 'high priority'
-static void draw_sprite_line( running_machine *machine, int wide, UINT32* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos, int pri )
+static void draw_sprite_line( running_machine &machine, int wide, UINT32* dest, int xzoom, int xgrow, int yoffset, int flip, int xpos, int pri )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
int xcnt,xcntdraw;
int xzoombit;
int xoffset;
@@ -130,7 +130,7 @@ static void draw_sprite_line( running_machine *machine, int wide, UINT32* dest,
}
}
/* this just loops over our decoded bitmap and puts it on the screen */
-static void draw_sprite_new_zoomed( running_machine *machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow, int pri )
+static void draw_sprite_new_zoomed( running_machine &machine, int wide, int high, int xpos, int ypos, int palt, int boffset, int flip, bitmap_t* bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow, int pri )
{
int ycnt;
int ydrawpos;
@@ -210,7 +210,7 @@ static void draw_sprite_new_zoomed( running_machine *machine, int wide, int high
}
-static void draw_sprites( running_machine *machine, bitmap_t* spritebitmap, UINT16 *sprite_source )
+static void draw_sprites( running_machine &machine, bitmap_t* spritebitmap, UINT16 *sprite_source )
{
/* ZZZZ Zxxx xxxx xxxx
zzzz z-yy yyyy yyyy
@@ -220,7 +220,7 @@ static void draw_sprites( running_machine *machine, bitmap_t* spritebitmap, UINT
*/
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
const UINT16 *finish = state->spritebufferram + (0xa00 / 2);
while (sprite_source < finish)
@@ -274,7 +274,7 @@ static void draw_sprites( running_machine *machine, bitmap_t* spritebitmap, UINT
/* TX Layer */
WRITE16_HANDLER( pgm_tx_videoram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
state->tx_videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset / 2);
}
@@ -296,7 +296,7 @@ static TILE_GET_INFO( get_pgm_tx_tilemap_tile_info )
p = palette
f = flip
*/
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
int tileno, colour, flipyx; //,game;
tileno = state->tx_videoram[tile_index * 2] & 0xffff;
@@ -310,7 +310,7 @@ static TILE_GET_INFO( get_pgm_tx_tilemap_tile_info )
WRITE16_HANDLER( pgm_bg_videoram_w )
{
- pgm_state *state = space->machine->driver_data<pgm_state>();
+ pgm_state *state = space->machine().driver_data<pgm_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
@@ -319,7 +319,7 @@ static TILE_GET_INFO( get_pgm_bg_tilemap_tile_info )
{
/* pretty much the same as tx layer */
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
int tileno, colour, flipyx;
tileno = state->bg_videoram[tile_index *2] & 0xffff;
@@ -336,7 +336,7 @@ static TILE_GET_INFO( get_pgm_bg_tilemap_tile_info )
VIDEO_START( pgm )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
int i;
state->tx_tilemap = tilemap_create(machine, get_pgm_tx_tilemap_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -364,13 +364,13 @@ VIDEO_START( pgm )
SCREEN_UPDATE( pgm )
{
- pgm_state *state = screen->machine->driver_data<pgm_state>();
+ pgm_state *state = screen->machine().driver_data<pgm_state>();
int y;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
bitmap_fill(state->tmppgmbitmap, cliprect, 0x00000000);
- draw_sprites(screen->machine, state->tmppgmbitmap, state->spritebufferram);
+ draw_sprites(screen->machine(), state->tmppgmbitmap, state->spritebufferram);
tilemap_set_scrolly(state->bg_tilemap,0, state->videoregs[0x2000/2]);
@@ -420,7 +420,7 @@ SCREEN_UPDATE( pgm )
SCREEN_EOF( pgm )
{
- pgm_state *state = machine->driver_data<pgm_state>();
+ pgm_state *state = machine.driver_data<pgm_state>();
/* first 0xa00 of main ram = sprites, seems to be buffered, DMA? */
memcpy(state->spritebufferram, pgm_mainram, 0xa00);
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index b4f674e30cb..9139ab217d0 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -89,7 +89,7 @@ PALETTE_INIT( phoenix )
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
palette_set_color(machine,i,rgb[col]);
}
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
auto_free(machine, rgb);
}
@@ -106,7 +106,7 @@ PALETTE_INIT( survival )
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0x60);
palette_set_color(machine,i,rgb[col]);
}
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
auto_free(machine, rgb);
}
@@ -123,7 +123,7 @@ PALETTE_INIT( pleiads )
col = ((i << 3 ) & 0x18) | ((i>>2) & 0x07) | (i & 0xE0);
palette_set_color(machine,i,rgb[col]);
}
- palette_normalize_range(machine->palette, 0, 255, 0, 255);
+ palette_normalize_range(machine.palette, 0, 255, 0, 255);
auto_free(machine, rgb);
}
@@ -135,7 +135,7 @@ PALETTE_INIT( pleiads )
static TILE_GET_INFO( get_fg_tile_info )
{
- phoenix_state *state = machine->driver_data<phoenix_state>();
+ phoenix_state *state = machine.driver_data<phoenix_state>();
int code, col;
code = state->videoram_pg[state->videoram_pg_index][tile_index];
@@ -150,7 +150,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- phoenix_state *state = machine->driver_data<phoenix_state>();
+ phoenix_state *state = machine.driver_data<phoenix_state>();
int code, col;
code = state->videoram_pg[state->videoram_pg_index][tile_index + 0x800];
@@ -171,7 +171,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( phoenix )
{
- phoenix_state *state = machine->driver_data<phoenix_state>();
+ phoenix_state *state = machine.driver_data<phoenix_state>();
state->videoram_pg[0] = auto_alloc_array(machine, UINT8, 0x1000);
state->videoram_pg[1] = auto_alloc_array(machine, UINT8, 0x1000);
@@ -223,8 +223,8 @@ VIDEO_START( phoenix )
WRITE8_HANDLER( phoenix_videoram_w )
{
- phoenix_state *state = space->machine->driver_data<phoenix_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ phoenix_state *state = space->machine().driver_data<phoenix_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
state->videoram_pg[state->videoram_pg_index][offset] = data;
@@ -243,17 +243,17 @@ WRITE8_HANDLER( phoenix_videoram_w )
WRITE8_HANDLER( phoenix_videoreg_w )
{
- phoenix_state *state = space->machine->driver_data<phoenix_state>();
+ phoenix_state *state = space->machine().driver_data<phoenix_state>();
if (state->videoram_pg_index != (data & 1))
{
/* set memory bank */
state->videoram_pg_index = data & 1;
- memory_set_bank(space->machine, "bank1", state->videoram_pg_index);
+ memory_set_bank(space->machine(), "bank1", state->videoram_pg_index);
- state->cocktail_mode = state->videoram_pg_index && (input_port_read(space->machine, "CAB") & 0x01);
+ state->cocktail_mode = state->videoram_pg_index && (input_port_read(space->machine(), "CAB") & 0x01);
- tilemap_set_flip_all(space->machine, state->cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_set_flip_all(space->machine(), state->cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* Phoenix has only one palette select effecting both layers */
@@ -261,23 +261,23 @@ WRITE8_HANDLER( phoenix_videoreg_w )
{
state->palette_bank = (data >> 1) & 1;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( pleiads_videoreg_w )
{
- phoenix_state *state = space->machine->driver_data<phoenix_state>();
+ phoenix_state *state = space->machine().driver_data<phoenix_state>();
if (state->videoram_pg_index != (data & 1))
{
/* set memory bank */
state->videoram_pg_index = data & 1;
- memory_set_bank(space->machine, "bank1", state->videoram_pg_index);
+ memory_set_bank(space->machine(), "bank1", state->videoram_pg_index);
- state->cocktail_mode = state->videoram_pg_index && (input_port_read(space->machine, "CAB") & 0x01);
+ state->cocktail_mode = state->videoram_pg_index && (input_port_read(space->machine(), "CAB") & 0x01);
- tilemap_set_flip_all(space->machine, state->cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_set_flip_all(space->machine(), state->cocktail_mode ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
@@ -289,7 +289,7 @@ WRITE8_HANDLER( pleiads_videoreg_w )
{
state->palette_bank = ((data >> 1) & 3);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
logerror("Palette: %02X\n", (data & 0x06) >> 1);
}
@@ -297,29 +297,29 @@ WRITE8_HANDLER( pleiads_videoreg_w )
state->pleiads_protection_question = data & 0xfc;
/* send two bits to sound control C (not sure if they are there) */
- pleiads_sound_control_c_w(space->machine->device("cust"), offset, data);
+ pleiads_sound_control_c_w(space->machine().device("cust"), offset, data);
}
WRITE8_HANDLER( phoenix_scroll_w )
{
- phoenix_state *state = space->machine->driver_data<phoenix_state>();
+ phoenix_state *state = space->machine().driver_data<phoenix_state>();
tilemap_set_scrollx(state->bg_tilemap,0,data);
}
CUSTOM_INPUT( player_input_r )
{
- phoenix_state *state = field->port->machine->driver_data<phoenix_state>();
+ phoenix_state *state = field->port->machine().driver_data<phoenix_state>();
if (state->cocktail_mode)
- return (input_port_read(field->port->machine, "CTRL") & 0xf0) >> 4;
+ return (input_port_read(field->port->machine(), "CTRL") & 0xf0) >> 4;
else
- return (input_port_read(field->port->machine, "CTRL") & 0x0f) >> 0;
+ return (input_port_read(field->port->machine(), "CTRL") & 0x0f) >> 0;
}
CUSTOM_INPUT( pleiads_protection_r )
{
- phoenix_state *state = field->port->machine->driver_data<phoenix_state>();
+ phoenix_state *state = field->port->machine().driver_data<phoenix_state>();
/* handle Pleiads protection */
switch (state->pleiads_protection_question)
{
@@ -332,7 +332,7 @@ CUSTOM_INPUT( pleiads_protection_r )
/* Bit 3 is 1 */
return 1;
default:
- logerror("%s:Unknown protection question %02X\n", field->port->machine->describe_context(), state->pleiads_protection_question);
+ logerror("%s:Unknown protection question %02X\n", field->port->machine().describe_context(), state->pleiads_protection_question);
return 0;
}
}
@@ -368,8 +368,8 @@ CUSTOM_INPUT( pleiads_protection_r )
#define REMAP_JS(js) ((ret & 0xf) | ( (js & 0xf) << 4))
READ8_HANDLER( survival_input_port_0_r )
{
- phoenix_state *state = space->machine->driver_data<phoenix_state>();
- UINT8 ret = ~input_port_read(space->machine, "IN0");
+ phoenix_state *state = space->machine().driver_data<phoenix_state>();
+ UINT8 ret = ~input_port_read(space->machine(), "IN0");
if( state->survival_input_readc++ == 2 )
{
@@ -433,13 +433,13 @@ READ8_HANDLER( survival_input_port_0_r )
READ8_DEVICE_HANDLER( survival_protection_r )
{
- phoenix_state *state = device->machine->driver_data<phoenix_state>();
+ phoenix_state *state = device->machine().driver_data<phoenix_state>();
return state->survival_protection_value;
}
READ_LINE_DEVICE_HANDLER( survival_sid_callback )
{
- phoenix_state *state = device->machine->driver_data<phoenix_state>();
+ phoenix_state *state = device->machine().driver_data<phoenix_state>();
return state->survival_sid_value;
}
@@ -452,7 +452,7 @@ READ_LINE_DEVICE_HANDLER( survival_sid_callback )
SCREEN_UPDATE( phoenix )
{
- phoenix_state *state = screen->machine->driver_data<phoenix_state>();
+ phoenix_state *state = screen->machine().driver_data<phoenix_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
diff --git a/src/mame/video/pingpong.c b/src/mame/video/pingpong.c
index 34aade759d2..4bf701b4791 100644
--- a/src/mame/video/pingpong.c
+++ b/src/mame/video/pingpong.c
@@ -46,7 +46,7 @@ PALETTE_INIT( pingpong )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -72,7 +72,7 @@ PALETTE_INIT( pingpong )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -82,34 +82,34 @@ PALETTE_INIT( pingpong )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = BITSWAP8(color_prom[i],7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( pingpong_videoram_w )
{
- pingpong_state *state = space->machine->driver_data<pingpong_state>();
+ pingpong_state *state = space->machine().driver_data<pingpong_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( pingpong_colorram_w )
{
- pingpong_state *state = space->machine->driver_data<pingpong_state>();
+ pingpong_state *state = space->machine().driver_data<pingpong_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- pingpong_state *state = machine->driver_data<pingpong_state>();
+ pingpong_state *state = machine.driver_data<pingpong_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x20) << 3);
int color = attr & 0x1f;
@@ -120,13 +120,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( pingpong )
{
- pingpong_state *state = machine->driver_data<pingpong_state>();
+ pingpong_state *state = machine.driver_data<pingpong_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- pingpong_state *state = machine->driver_data<pingpong_state>();
+ pingpong_state *state = machine.driver_data<pingpong_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -143,19 +143,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color = spriteram[offs] & 0x1f;
schar = spriteram[offs + 2] & 0x7f;
- drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
+ drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
schar,
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
SCREEN_UPDATE( pingpong )
{
- pingpong_state *state = screen->machine->driver_data<pingpong_state>();
+ pingpong_state *state = screen->machine().driver_data<pingpong_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/pirates.c b/src/mame/video/pirates.c
index 15d28a2976d..cc1901d8b64 100644
--- a/src/mame/video/pirates.c
+++ b/src/mame/video/pirates.c
@@ -8,7 +8,7 @@
static TILE_GET_INFO( get_tx_tile_info )
{
- pirates_state *state = machine->driver_data<pirates_state>();
+ pirates_state *state = machine.driver_data<pirates_state>();
int code = state->tx_tileram[tile_index*2];
int colr = state->tx_tileram[tile_index*2+1];
@@ -17,7 +17,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- pirates_state *state = machine->driver_data<pirates_state>();
+ pirates_state *state = machine.driver_data<pirates_state>();
int code = state->fg_tileram[tile_index*2];
int colr = state->fg_tileram[tile_index*2+1]+0x80;
@@ -26,7 +26,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- pirates_state *state = machine->driver_data<pirates_state>();
+ pirates_state *state = machine.driver_data<pirates_state>();
int code = state->bg_tileram[tile_index*2];
int colr = state->bg_tileram[tile_index*2+1]+ 0x100;
@@ -38,7 +38,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START(pirates)
{
- pirates_state *state = machine->driver_data<pirates_state>();
+ pirates_state *state = machine.driver_data<pirates_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_cols,8,8,36,32);
/* Not sure how big they can be, Pirates uses only 32 columns, Genix 44 */
@@ -53,31 +53,31 @@ VIDEO_START(pirates)
WRITE16_HANDLER( pirates_tx_tileram_w )
{
- pirates_state *state = space->machine->driver_data<pirates_state>();
+ pirates_state *state = space->machine().driver_data<pirates_state>();
COMBINE_DATA(state->tx_tileram+offset);
tilemap_mark_tile_dirty(state->tx_tilemap,offset/2);
}
WRITE16_HANDLER( pirates_fg_tileram_w )
{
- pirates_state *state = space->machine->driver_data<pirates_state>();
+ pirates_state *state = space->machine().driver_data<pirates_state>();
COMBINE_DATA(state->fg_tileram+offset);
tilemap_mark_tile_dirty(state->fg_tilemap,offset/2);
}
WRITE16_HANDLER( pirates_bg_tileram_w )
{
- pirates_state *state = space->machine->driver_data<pirates_state>();
+ pirates_state *state = space->machine().driver_data<pirates_state>();
COMBINE_DATA(state->bg_tileram+offset);
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- pirates_state *state = machine->driver_data<pirates_state>();
- const gfx_element *gfx = machine->gfx[1];
+ pirates_state *state = machine.driver_data<pirates_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT16 *source = state->spriteram + 4;
UINT16 *finish = source + 0x800/2-4;
@@ -109,12 +109,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE(pirates)
{
- pirates_state *state = screen->machine->driver_data<pirates_state>();
+ pirates_state *state = screen->machine().driver_data<pirates_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll[0]);
tilemap_set_scrollx(state->fg_tilemap,0,state->scroll[0]);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/pitnrun.c b/src/mame/video/pitnrun.c
index a1727d09f1d..26cfb81baba 100644
--- a/src/mame/video/pitnrun.c
+++ b/src/mame/video/pitnrun.c
@@ -23,7 +23,7 @@ In debug build press 'w' for spotlight and 'e' for lightning
static TILE_GET_INFO( get_tile_info1 )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
UINT8 *videoram = state->videoram;
int code;
code = videoram[tile_index];
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_tile_info1 )
static TILE_GET_INFO( get_tile_info2 )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
int code;
code = state->videoram2[tile_index];
SET_TILE_INFO(
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_tile_info2 )
WRITE8_HANDLER( pitnrun_videoram_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_all_tiles_dirty( state->fg );
@@ -56,14 +56,14 @@ WRITE8_HANDLER( pitnrun_videoram_w )
WRITE8_HANDLER( pitnrun_videoram2_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->videoram2[offset] = data;
tilemap_mark_all_tiles_dirty( state->bg );
}
WRITE8_HANDLER( pitnrun_char_bank_select )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
if(state->char_bank!=data)
{
tilemap_mark_all_tiles_dirty( state->bg );
@@ -74,41 +74,41 @@ WRITE8_HANDLER( pitnrun_char_bank_select )
WRITE8_HANDLER( pitnrun_scroll_w )
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->scroll = (state->scroll & (0xff<<((offset)?0:8))) |( data<<((offset)?8:0));
tilemap_set_scrollx( state->bg, 0, state->scroll);
}
WRITE8_HANDLER(pitnrun_ha_w)
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->ha=data;
}
WRITE8_HANDLER(pitnrun_h_heed_w)
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->h_heed=data;
}
WRITE8_HANDLER(pitnrun_v_heed_w)
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->v_heed=data;
}
WRITE8_HANDLER(pitnrun_color_select_w)
{
- pitnrun_state *state = space->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = space->machine().driver_data<pitnrun_state>();
state->color_select=data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
-static void pitnrun_spotlights(running_machine *machine)
+static void pitnrun_spotlights(running_machine &machine)
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
int x,y,i,b,datapix;
- UINT8 *ROM = machine->region("user1")->base();
+ UINT8 *ROM = machine.region("user1")->base();
for(i=0;i<4;i++)
for(y=0;y<128;y++)
for(x=0;x<16;x++)
@@ -171,20 +171,20 @@ PALETTE_INIT (pitnrun)
VIDEO_START(pitnrun)
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
state->fg = tilemap_create( machine, get_tile_info1,tilemap_scan_rows,8,8,32,32 );
state->bg = tilemap_create( machine, get_tile_info2,tilemap_scan_rows,8,8,32*4,32 );
tilemap_set_transparent_pen( state->fg, 0 );
- state->tmp_bitmap[0] = auto_bitmap_alloc(machine,128,128,machine->primary_screen->format());
- state->tmp_bitmap[1] = auto_bitmap_alloc(machine,128,128,machine->primary_screen->format());
- state->tmp_bitmap[2] = auto_bitmap_alloc(machine,128,128,machine->primary_screen->format());
- state->tmp_bitmap[3] = auto_bitmap_alloc(machine,128,128,machine->primary_screen->format());
+ state->tmp_bitmap[0] = auto_bitmap_alloc(machine,128,128,machine.primary_screen->format());
+ state->tmp_bitmap[1] = auto_bitmap_alloc(machine,128,128,machine.primary_screen->format());
+ state->tmp_bitmap[2] = auto_bitmap_alloc(machine,128,128,machine.primary_screen->format());
+ state->tmp_bitmap[3] = auto_bitmap_alloc(machine,128,128,machine.primary_screen->format());
pitnrun_spotlights(machine);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- pitnrun_state *state = machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = machine.driver_data<pitnrun_state>();
UINT8 *spriteram = state->spriteram;
int sx, sy, flipx, flipy, offs,pal;
@@ -209,7 +209,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
(spriteram[offs+1]&0x3f)+((spriteram[offs+2]&0x80)>>1)+((spriteram[offs+2]&0x40)<<1),
pal,
flipx,flipy,
@@ -219,26 +219,26 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( pitnrun )
{
- pitnrun_state *state = screen->machine->driver_data<pitnrun_state>();
+ pitnrun_state *state = screen->machine().driver_data<pitnrun_state>();
int dx=0,dy=0;
rectangle myclip=*cliprect;
#ifdef MAME_DEBUG
- if (input_code_pressed_once(screen->machine, KEYCODE_Q))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_Q))
{
- UINT8 *ROM = screen->machine->region("maincpu")->base();
+ UINT8 *ROM = screen->machine().region("maincpu")->base();
ROM[0x84f6]=0; /* lap 0 - normal */
}
- if (input_code_pressed_once(screen->machine, KEYCODE_W))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_W))
{
- UINT8 *ROM = screen->machine->region("maincpu")->base();
+ UINT8 *ROM = screen->machine().region("maincpu")->base();
ROM[0x84f6]=6; /* lap 6 = spotlight */
}
- if (input_code_pressed_once(screen->machine, KEYCODE_E))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_E))
{
- UINT8 *ROM = screen->machine->region("maincpu")->base();
+ UINT8 *ROM = screen->machine().region("maincpu")->base();
ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */
ROM[0x8102]=1;
}
@@ -253,10 +253,10 @@ SCREEN_UPDATE( pitnrun )
dx=128-state->h_heed+((state->ha&8)<<5)+3;
dy=128-state->v_heed+((state->ha&0x10)<<4);
- if (flip_screen_x_get(screen->machine))
+ if (flip_screen_x_get(screen->machine()))
dx=128-dx+16;
- if (flip_screen_y_get(screen->machine))
+ if (flip_screen_y_get(screen->machine()))
dy=128-dy;
myclip.min_x=dx;
@@ -274,10 +274,10 @@ SCREEN_UPDATE( pitnrun )
tilemap_draw(bitmap,&myclip,state->bg, 0,0);
}
- draw_sprites(screen->machine,bitmap,&myclip);
+ draw_sprites(screen->machine(),bitmap,&myclip);
if(state->ha&4)
- copybitmap_trans(bitmap,state->tmp_bitmap[state->ha&3],flip_screen_x_get(screen->machine),flip_screen_y_get(screen->machine),dx,dy,&myclip, 1);
+ copybitmap_trans(bitmap,state->tmp_bitmap[state->ha&3],flip_screen_x_get(screen->machine()),flip_screen_y_get(screen->machine()),dx,dy,&myclip, 1);
tilemap_draw(bitmap,cliprect,state->fg, 0,0);
return 0;
}
diff --git a/src/mame/video/pktgaldx.c b/src/mame/video/pktgaldx.c
index e20f8187eee..071e7b0ab5e 100644
--- a/src/mame/video/pktgaldx.c
+++ b/src/mame/video/pktgaldx.c
@@ -7,17 +7,17 @@
SCREEN_UPDATE( pktgaldx )
{
- pktgaldx_state *state = screen->machine->driver_data<pktgaldx_state>();
+ pktgaldx_state *state = screen->machine().driver_data<pktgaldx_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400, true);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400, true);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
@@ -26,13 +26,13 @@ SCREEN_UPDATE( pktgaldx )
SCREEN_UPDATE( pktgaldb )
{
- pktgaldx_state *state = screen->machine->driver_data<pktgaldx_state>();
+ pktgaldx_state *state = screen->machine().driver_data<pktgaldx_state>();
int x, y;
int offset = 0;
int tileno;
int colour;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* the bootleg seems to treat the tilemaps as sprites */
for (offset = 0; offset < 0x1600 / 2; offset += 8)
@@ -46,7 +46,7 @@ SCREEN_UPDATE( pktgaldb )
y &= 0x1ff;
y -= 8;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x1000, colour, 0, 0, x, y, 0);
}
for (offset = 0x1600/2; offset < 0x2000 / 2; offset += 8)
@@ -60,7 +60,7 @@ SCREEN_UPDATE( pktgaldb )
y &= 0x1ff;
y -= 8;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x4000, colour, 0, 0, x, y, 0);
}
for (offset = 0x2000/2; offset < 0x4000 / 2; offset += 8)
@@ -74,7 +74,7 @@ SCREEN_UPDATE( pktgaldb )
y &= 0x1ff;
y -= 8;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tileno ^ 0x3000, colour, 0, 0, x, y, 0);
}
return 0;
diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c
index ba4cb854451..60d33e8eb69 100644
--- a/src/mame/video/playch10.c
+++ b/src/mame/video/playch10.c
@@ -6,7 +6,7 @@
WRITE8_HANDLER( playch10_videoram_w )
{
- playch10_state *state = space->machine->driver_data<playch10_state>();
+ playch10_state *state = space->machine().driver_data<playch10_state>();
UINT8 *videoram = state->videoram;
if (state->pc10_sdcs)
{
@@ -59,8 +59,8 @@ PALETTE_INIT( playch10 )
static void ppu_irq( device_t *device, int *ppu_regs )
{
- playch10_state *state = device->machine->driver_data<playch10_state>();
- cputag_set_input_line(device->machine, "cart", INPUT_LINE_NMI, PULSE_LINE );
+ playch10_state *state = device->machine().driver_data<playch10_state>();
+ cputag_set_input_line(device->machine(), "cart", INPUT_LINE_NMI, PULSE_LINE );
state->pc10_int_detect = 1;
}
@@ -86,7 +86,7 @@ const ppu2c0x_interface playch10_ppu_interface_hboard =
static TILE_GET_INFO( get_bg_tile_info )
{
- playch10_state *state = machine->driver_data<playch10_state>();
+ playch10_state *state = machine.driver_data<playch10_state>();
UINT8 *videoram = state->videoram;
int offs = tile_index * 2;
int code = videoram[offs] + ((videoram[offs + 1] & 0x07) << 8);
@@ -97,8 +97,8 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( playch10 )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- const UINT8 *bios = machine->region("maincpu")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ const UINT8 *bios = machine.region("maincpu")->base();
state->pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
@@ -107,8 +107,8 @@ VIDEO_START( playch10 )
VIDEO_START( playch10_hboard )
{
- playch10_state *state = machine->driver_data<playch10_state>();
- const UINT8 *bios = machine->region("maincpu")->base();
+ playch10_state *state = machine.driver_data<playch10_state>();
+ const UINT8 *bios = machine.region("maincpu")->base();
state->pc10_bios = (bios[3] == 0x2a) ? 1 : 2;
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
@@ -123,13 +123,13 @@ VIDEO_START( playch10_hboard )
SCREEN_UPDATE( playch10 )
{
- playch10_state *state = screen->machine->driver_data<playch10_state>();
- device_t *ppu = screen->machine->device("ppu");
+ playch10_state *state = screen->machine().driver_data<playch10_state>();
+ device_t *ppu = screen->machine().device("ppu");
/* Dual monitor version */
if (state->pc10_bios == 1)
{
- device_t *top_screen = screen->machine->device("top");
+ device_t *top_screen = screen->machine().device("top");
/* On Playchoice 10 single monitor, this bit toggles */
/* between PPU and BIOS display. */
diff --git a/src/mame/video/playmark.c b/src/mame/video/playmark.c
index 9e81c6febfe..bc60cae36ee 100644
--- a/src/mame/video/playmark.c
+++ b/src/mame/video/playmark.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( bigtwin_get_tx_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 code = state->videoram1[2 * tile_index];
UINT16 color = state->videoram1[2 * tile_index + 1];
SET_TILE_INFO(
@@ -22,7 +22,7 @@ static TILE_GET_INFO( bigtwin_get_tx_tile_info )
static TILE_GET_INFO( bigtwin_get_fg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 code = state->videoram2[2 * tile_index];
UINT16 color = state->videoram2[2 * tile_index + 1];
SET_TILE_INFO(
@@ -34,7 +34,7 @@ static TILE_GET_INFO( bigtwin_get_fg_tile_info )
static TILE_GET_INFO( wbeachvl_get_tx_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 code = state->videoram1[2 * tile_index];
UINT16 color = state->videoram1[2 * tile_index + 1];
@@ -47,7 +47,7 @@ static TILE_GET_INFO( wbeachvl_get_tx_tile_info )
static TILE_GET_INFO( wbeachvl_get_fg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 code = state->videoram2[2 * tile_index];
UINT16 color = state->videoram2[2 * tile_index + 1];
@@ -60,7 +60,7 @@ static TILE_GET_INFO( wbeachvl_get_fg_tile_info )
static TILE_GET_INFO( wbeachvl_get_bg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
UINT16 code = state->videoram3[2 * tile_index];
UINT16 color = state->videoram3[2 * tile_index + 1];
@@ -73,7 +73,7 @@ static TILE_GET_INFO( wbeachvl_get_bg_tile_info )
static TILE_GET_INFO( hrdtimes_get_tx_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int code = state->videoram1[tile_index] & 0x03ff;
int colr = state->videoram1[tile_index] & 0xe000;
@@ -82,7 +82,7 @@ static TILE_GET_INFO( hrdtimes_get_tx_tile_info )
static TILE_GET_INFO( bigtwinb_get_tx_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int code = state->videoram1[tile_index] & 0x0fff;
int colr = state->videoram1[tile_index] & 0xf000;
@@ -91,7 +91,7 @@ static TILE_GET_INFO( bigtwinb_get_tx_tile_info )
static TILE_GET_INFO( hrdtimes_get_fg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int code = state->videoram2[tile_index] & 0x1fff;
int colr = state->videoram2[tile_index] & 0xe000;
@@ -100,7 +100,7 @@ static TILE_GET_INFO( hrdtimes_get_fg_tile_info )
static TILE_GET_INFO( hrdtimes_get_bg_tile_info )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int code = state->videoram3[tile_index] & 0x1fff;
int colr = state->videoram3[tile_index] & 0xe000;
@@ -115,7 +115,7 @@ static TILE_GET_INFO( hrdtimes_get_bg_tile_info )
VIDEO_START( bigtwin )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -134,7 +134,7 @@ VIDEO_START( bigtwin )
VIDEO_START( bigtwinb )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, bigtwinb_get_tx_tile_info,tilemap_scan_rows, 8, 8, 64, 64);
state->fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info,tilemap_scan_rows, 16, 16, 32, 32);
@@ -157,7 +157,7 @@ VIDEO_START( bigtwinb )
VIDEO_START( wbeachvl )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, wbeachvl_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->fg_tilemap = tilemap_create(machine, wbeachvl_get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32);
@@ -177,7 +177,7 @@ VIDEO_START( wbeachvl )
VIDEO_START( excelsr )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, bigtwin_get_tx_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, bigtwin_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -195,7 +195,7 @@ VIDEO_START( excelsr )
VIDEO_START( hotmind )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -219,7 +219,7 @@ VIDEO_START( hotmind )
VIDEO_START( hrdtimes )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
state->tx_tilemap = tilemap_create(machine, hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8, 64, 64);
state->fg_tilemap = tilemap_create(machine, hrdtimes_get_fg_tile_info,tilemap_scan_rows, 16, 16, 32, 32);
@@ -249,7 +249,7 @@ VIDEO_START( hrdtimes )
WRITE16_HANDLER( wbeachvl_txvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset / 2);
@@ -257,7 +257,7 @@ WRITE16_HANDLER( wbeachvl_txvideoram_w )
WRITE16_HANDLER( wbeachvl_fgvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
@@ -265,7 +265,7 @@ WRITE16_HANDLER( wbeachvl_fgvideoram_w )
WRITE16_HANDLER( wbeachvl_bgvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram3[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -273,7 +273,7 @@ WRITE16_HANDLER( wbeachvl_bgvideoram_w )
WRITE16_HANDLER( hrdtimes_txvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram1[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -281,7 +281,7 @@ WRITE16_HANDLER( hrdtimes_txvideoram_w )
WRITE16_HANDLER( hrdtimes_fgvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -289,7 +289,7 @@ WRITE16_HANDLER( hrdtimes_fgvideoram_w )
WRITE16_HANDLER( hrdtimes_bgvideoram_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
COMBINE_DATA(&state->videoram3[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -300,9 +300,9 @@ WRITE16_HANDLER( bigtwin_paletteram_w )
{
int r, g, b, val;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- val = space->machine->generic.paletteram.u16[offset];
+ val = space->machine().generic.paletteram.u16[offset];
r = (val >> 11) & 0x1e;
g = (val >> 7) & 0x1e;
b = (val >> 3) & 0x1e;
@@ -311,12 +311,12 @@ WRITE16_HANDLER( bigtwin_paletteram_w )
g |= ((val & 0x04) >> 2);
b |= ((val & 0x02) >> 1);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
WRITE16_HANDLER( bigtwin_scroll_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
data = COMBINE_DATA(&state->scroll[offset]);
@@ -336,7 +336,7 @@ WRITE16_HANDLER( bigtwin_scroll_w )
WRITE16_HANDLER( wbeachvl_scroll_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
data = COMBINE_DATA(&state->scroll[offset]);
@@ -355,7 +355,7 @@ WRITE16_HANDLER( wbeachvl_scroll_w )
WRITE16_HANDLER( excelsr_scroll_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
data = COMBINE_DATA(&state->scroll[offset]);
@@ -375,7 +375,7 @@ WRITE16_HANDLER( excelsr_scroll_w )
WRITE16_HANDLER( hrdtimes_scroll_w )
{
- playmark_state *state = space->machine->driver_data<playmark_state>();
+ playmark_state *state = space->machine().driver_data<playmark_state>();
data = COMBINE_DATA(&state->scroll[offset]);
@@ -396,12 +396,12 @@ WRITE16_HANDLER( hrdtimes_scroll_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int offs, start_offset = state->spriteram_size / 2 - 4;
- int height = machine->gfx[0]->height;
- int colordiv = machine->gfx[0]->color_granularity / 16;
+ int height = machine.gfx[0]->height;
+ int colordiv = machine.gfx[0]->color_granularity / 16;
UINT16 *spriteram = state->spriteram;
// find the "end of list" to draw the sprites in reverse order
@@ -430,21 +430,21 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if(!pri && (color & 0x0c) == 0x0c)
pri = 2;
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,0,
sx + state->xoffset,sy + state->yoffset,
- machine->priority_bitmap,state->pri_masks[pri],0);
+ machine.priority_bitmap,state->pri_masks[pri],0);
}
}
-static void bigtwinb_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
+static void bigtwinb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int offs, start_offset = state->spriteram_size / 2 - 4;
- int height = machine->gfx[0]->height;
+ int height = machine.gfx[0]->height;
UINT16 *spriteram = state->spriteram;
// find the "end of list" to draw the sprites in reverse order
@@ -469,7 +469,7 @@ static void bigtwinb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
code = spriteram[offs + 2] >> codeshift;
color = ((spriteram[offs + 1] & 0xf000) >> 12);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,0,
@@ -477,9 +477,9 @@ static void bigtwinb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- playmark_state *state = machine->driver_data<playmark_state>();
+ playmark_state *state = machine.driver_data<playmark_state>();
int x, y, count;
int color;
UINT8 *pri;
@@ -497,7 +497,7 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const recta
{
*BITMAP_ADDR16(bitmap, (y + state->bgscrolly) & 0x1ff, (x + state->bgscrollx) & 0x1ff) = 0x100 + color;
- pri = BITMAP_ADDR8(machine->priority_bitmap, (y + state->bgscrolly) & 0x1ff, 0);
+ pri = BITMAP_ADDR8(machine.priority_bitmap, (y + state->bgscrolly) & 0x1ff, 0);
pri[(x + state->bgscrollx) & 0x1ff] |= 2;
}
else
@@ -507,7 +507,7 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const recta
{
*BITMAP_ADDR16(bitmap, (y / 2 + state->bgscrolly) & 0x1ff, (x / 2 + state->bgscrollx) & 0x1ff) = 0x100 + color;
- pri = BITMAP_ADDR8(machine->priority_bitmap, (y / 2 + state->bgscrolly) & 0x1ff, 0);
+ pri = BITMAP_ADDR8(machine.priority_bitmap, (y / 2 + state->bgscrolly) & 0x1ff, 0);
pri[(x / 2 + state->bgscrollx) & 0x1ff] |= 2;
}
}
@@ -520,14 +520,14 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( bigtwin )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
if (state->bg_enable)
- draw_bitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 4);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 4);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
@@ -535,38 +535,38 @@ SCREEN_UPDATE( bigtwin )
SCREEN_UPDATE( bigtwinb )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
// video enabled
if (state->scroll[6] & 1)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- bigtwinb_draw_sprites(screen->machine, bitmap, cliprect, 4);
+ bigtwinb_draw_sprites(screen->machine(), bitmap, cliprect, 4);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
}
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
SCREEN_UPDATE( excelsr )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 1);
if (state->bg_enable)
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
return 0;
}
SCREEN_UPDATE( wbeachvl )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
if (state->fg_rowscroll_enable)
{
@@ -582,30 +582,30 @@ SCREEN_UPDATE( wbeachvl )
tilemap_set_scrollx(state->fg_tilemap, 0, state->fgscrollx);
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( hrdtimes )
{
- playmark_state *state = screen->machine->driver_data<playmark_state>();
+ playmark_state *state = screen->machine().driver_data<playmark_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
// video enabled
if (state->scroll[6] & 1)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
}
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c
index 09db958e6bb..1d5e6884b95 100644
--- a/src/mame/video/plygonet.c
+++ b/src/mame/video/plygonet.c
@@ -15,7 +15,7 @@
static TILE_GET_INFO( ttl_get_tile_info )
{
- polygonet_state *state = machine->driver_data<polygonet_state>();
+ polygonet_state *state = machine.driver_data<polygonet_state>();
int attr, code;
code = state->ttl_vram[tile_index]&0xfff;
@@ -27,7 +27,7 @@ static TILE_GET_INFO( ttl_get_tile_info )
static TILE_GET_INFO( roz_get_tile_info )
{
- polygonet_state *state = machine->driver_data<polygonet_state>();
+ polygonet_state *state = machine.driver_data<polygonet_state>();
int attr, code;
attr = (state->roz_vram[tile_index] >> 12) + 16; /* roz base palette is palette 16 */
@@ -38,7 +38,7 @@ static TILE_GET_INFO( roz_get_tile_info )
READ32_HANDLER( polygonet_ttl_ram_r )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT32 *vram = (UINT32 *)state->ttl_vram;
return vram[offset];
@@ -46,7 +46,7 @@ READ32_HANDLER( polygonet_ttl_ram_r )
WRITE32_HANDLER( polygonet_ttl_ram_w )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT32 *vram = (UINT32 *)state->ttl_vram;
COMBINE_DATA(&vram[offset]);
@@ -57,7 +57,7 @@ WRITE32_HANDLER( polygonet_ttl_ram_w )
READ32_HANDLER( polygonet_roz_ram_r )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT32 *vram = (UINT32 *)state->roz_vram;
return vram[offset];
@@ -65,7 +65,7 @@ READ32_HANDLER( polygonet_roz_ram_r )
WRITE32_HANDLER( polygonet_roz_ram_w )
{
- polygonet_state *state = space->machine->driver_data<polygonet_state>();
+ polygonet_state *state = space->machine().driver_data<polygonet_state>();
UINT32 *vram = (UINT32 *)state->roz_vram;
COMBINE_DATA(&vram[offset]);
@@ -86,7 +86,7 @@ static TILEMAP_MAPPER( plygonet_scan_cols )
VIDEO_START( polygonet )
{
- polygonet_state *state = machine->driver_data<polygonet_state>();
+ polygonet_state *state = machine.driver_data<polygonet_state>();
static const gfx_layout charlayout =
{
8, 8, /* 8x8 */
@@ -100,13 +100,13 @@ VIDEO_START( polygonet )
/* find first empty slot to decode gfx */
for (state->ttl_gfx_index = 0; state->ttl_gfx_index < MAX_GFX_ELEMENTS; state->ttl_gfx_index++)
- if (machine->gfx[state->ttl_gfx_index] == 0)
+ if (machine.gfx[state->ttl_gfx_index] == 0)
break;
assert(state->ttl_gfx_index != MAX_GFX_ELEMENTS);
/* decode the ttl layer's gfx */
- machine->gfx[state->ttl_gfx_index] = gfx_element_alloc(machine, &charlayout, machine->region("gfx1")->base(), machine->total_colors() / 16, 0);
+ machine.gfx[state->ttl_gfx_index] = gfx_element_alloc(machine, &charlayout, machine.region("gfx1")->base(), machine.total_colors() / 16, 0);
/* create the tilemap */
state->ttl_tilemap = tilemap_create(machine, ttl_get_tile_info, plygonet_scan, 8, 8, 64, 32);
@@ -125,10 +125,10 @@ VIDEO_START( polygonet )
SCREEN_UPDATE( polygonet )
{
- polygonet_state *state = screen->machine->driver_data<polygonet_state>();
- device_t *k053936 = screen->machine->device("k053936");
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ polygonet_state *state = screen->machine().driver_data<polygonet_state>();
+ device_t *k053936 = screen->machine().device("k053936");
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
k053936_zoom_draw(k053936, bitmap, cliprect, state->roz_tilemap, 0, 0, 0);
diff --git a/src/mame/video/pokechmp.c b/src/mame/video/pokechmp.c
index d3875282e3c..653e2ec5e38 100644
--- a/src/mame/video/pokechmp.c
+++ b/src/mame/video/pokechmp.c
@@ -6,7 +6,7 @@
WRITE8_HANDLER( pokechmp_videoram_w )
{
- pokechmp_state *state = space->machine->driver_data<pokechmp_state>();
+ pokechmp_state *state = space->machine().driver_data<pokechmp_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -14,16 +14,16 @@ WRITE8_HANDLER( pokechmp_videoram_w )
WRITE8_HANDLER( pokechmp_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- pokechmp_state *state = machine->driver_data<pokechmp_state>();
+ pokechmp_state *state = machine.driver_data<pokechmp_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x3f) << 8);
int color = videoram[tile_index*2] >> 6;
@@ -33,14 +33,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( pokechmp )
{
- pokechmp_state *state = machine->driver_data<pokechmp_state>();
+ pokechmp_state *state = machine.driver_data<pokechmp_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- pokechmp_state *state = machine->driver_data<pokechmp_state>();
+ pokechmp_state *state = machine.driver_data<pokechmp_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -63,7 +63,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (flipy) flipy=0; else flipy=1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
(spriteram[offs+1] & 0xf0) >> 4,
flipx,flipy,
@@ -74,8 +74,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( pokechmp )
{
- pokechmp_state *state = screen->machine->driver_data<pokechmp_state>();
+ pokechmp_state *state = screen->machine().driver_data<pokechmp_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/polepos.c b/src/mame/video/polepos.c
index e3fd7d2ad45..480acab81c9 100644
--- a/src/mame/video/polepos.c
+++ b/src/mame/video/polepos.c
@@ -27,11 +27,11 @@
PALETTE_INIT( polepos )
{
- polepos_state *state = machine->driver_data<polepos_state>();
+ polepos_state *state = machine.driver_data<polepos_state>();
int i, j;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 128);
+ machine.colortable = colortable_alloc(machine, 128);
/*******************************************************
* Color PROMs
@@ -77,7 +77,7 @@ PALETTE_INIT( polepos )
bit3 = (color_prom[0x200 + i] >> 3) & 1;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
}
/*******************************************************
@@ -88,8 +88,8 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*4; i++)
{
int color = color_prom[0x300 + i];
- colortable_entry_set_value(machine->colortable, 0x0000 + i, (color != 15) ? (0x020 + color) : 0x2f);
- colortable_entry_set_value(machine->colortable, 0x0100 + i, (color != 15) ? (0x060 + color) : 0x2f);
+ colortable_entry_set_value(machine.colortable, 0x0000 + i, (color != 15) ? (0x020 + color) : 0x2f);
+ colortable_entry_set_value(machine.colortable, 0x0100 + i, (color != 15) ? (0x060 + color) : 0x2f);
}
/*******************************************************
@@ -101,7 +101,7 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*4; i++)
{
int color = color_prom[0x400 + i];
- colortable_entry_set_value(machine->colortable, 0x0200 + i, 0x000 + color);
+ colortable_entry_set_value(machine.colortable, 0x0200 + i, 0x000 + color);
}
/*******************************************************
@@ -112,8 +112,8 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*16; i++)
{
int color = color_prom[0xc00 + i];
- colortable_entry_set_value(machine->colortable, 0x0300 + i, (color != 15) ? (0x010 + color) : 0x1f);
- colortable_entry_set_value(machine->colortable, 0x0700 + i, (color != 15) ? (0x050 + color) : 0x1f);
+ colortable_entry_set_value(machine.colortable, 0x0300 + i, (color != 15) ? (0x010 + color) : 0x1f);
+ colortable_entry_set_value(machine.colortable, 0x0700 + i, (color != 15) ? (0x050 + color) : 0x1f);
}
/*******************************************************
@@ -125,7 +125,7 @@ PALETTE_INIT( polepos )
for (i = 0; i < 64*16; i++)
{
int color = color_prom[0x800 + i];
- colortable_entry_set_value(machine->colortable, 0x0b00 + i, 0x040 + color);
+ colortable_entry_set_value(machine.colortable, 0x0b00 + i, 0x040 + color);
}
/* 136014-142, 136014-143, 136014-144 Vertical position modifiers */
@@ -146,7 +146,7 @@ PALETTE_INIT( polepos )
static TILE_GET_INFO( bg_get_tile_info )
{
- polepos_state *state = machine->driver_data<polepos_state>();
+ polepos_state *state = machine.driver_data<polepos_state>();
UINT16 word = state->view16_memory[tile_index];
int code = (word & 0xff) | ((word & 0x4000) >> 6);
int color = (word & 0x3f00) >> 8;
@@ -159,7 +159,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( tx_get_tile_info )
{
- polepos_state *state = machine->driver_data<polepos_state>();
+ polepos_state *state = machine.driver_data<polepos_state>();
UINT16 word = state->alpha16_memory[tile_index];
int code = (word & 0xff) | ((word & 0x4000) >> 6);
int color = (word & 0x3f00) >> 8;
@@ -194,11 +194,11 @@ static TILE_GET_INFO( tx_get_tile_info )
VIDEO_START( polepos )
{
- polepos_state *state = machine->driver_data<polepos_state>();
+ polepos_state *state = machine.driver_data<polepos_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_cols,8,8,64,16);
state->tx_tilemap = tilemap_create(machine, tx_get_tile_info,tilemap_scan_rows,8,8,32,32);
- colortable_configure_tilemap_groups(machine->colortable, state->tx_tilemap, machine->gfx[0], 0x2f);
+ colortable_configure_tilemap_groups(machine.colortable, state->tx_tilemap, machine.gfx[0], 0x2f);
}
@@ -210,25 +210,25 @@ VIDEO_START( polepos )
READ16_HANDLER( polepos_sprite16_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->sprite16_memory[offset];
}
WRITE16_HANDLER( polepos_sprite16_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->sprite16_memory[offset]);
}
READ8_HANDLER( polepos_sprite_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->sprite16_memory[offset] & 0xff;
}
WRITE8_HANDLER( polepos_sprite_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
state->sprite16_memory[offset] = (state->sprite16_memory[offset] & 0xff00) | data;
}
@@ -241,31 +241,31 @@ WRITE8_HANDLER( polepos_sprite_w )
READ16_HANDLER( polepos_road16_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->road16_memory[offset];
}
WRITE16_HANDLER( polepos_road16_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->road16_memory[offset]);
}
READ8_HANDLER( polepos_road_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->road16_memory[offset] & 0xff;
}
WRITE8_HANDLER( polepos_road_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
state->road16_memory[offset] = (state->road16_memory[offset] & 0xff00) | data;
}
WRITE16_HANDLER( polepos_road16_vscroll_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->road16_vscroll);
}
@@ -278,13 +278,13 @@ WRITE16_HANDLER( polepos_road16_vscroll_w )
READ16_HANDLER( polepos_view16_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->view16_memory[offset];
}
WRITE16_HANDLER( polepos_view16_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->view16_memory[offset]);
if (offset < 0x400)
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -292,13 +292,13 @@ WRITE16_HANDLER( polepos_view16_w )
READ8_HANDLER( polepos_view_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->view16_memory[offset] & 0xff;
}
WRITE8_HANDLER( polepos_view_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
state->view16_memory[offset] = (state->view16_memory[offset] & 0xff00) | data;
if (offset < 0x400)
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -306,7 +306,7 @@ WRITE8_HANDLER( polepos_view_w )
WRITE16_HANDLER( polepos_view16_hscroll_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->scroll);
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll);
@@ -314,7 +314,7 @@ WRITE16_HANDLER( polepos_view16_hscroll_w )
WRITE8_HANDLER( polepos_chacl_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
if (state->chacl != (data & 1))
{
state->chacl = data & 1;
@@ -331,26 +331,26 @@ WRITE8_HANDLER( polepos_chacl_w )
READ16_HANDLER( polepos_alpha16_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->alpha16_memory[offset];
}
WRITE16_HANDLER( polepos_alpha16_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
COMBINE_DATA(&state->alpha16_memory[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
READ8_HANDLER( polepos_alpha_r )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
return state->alpha16_memory[offset] & 0xff;
}
WRITE8_HANDLER( polepos_alpha_w )
{
- polepos_state *state = space->machine->driver_data<polepos_state>();
+ polepos_state *state = space->machine().driver_data<polepos_state>();
state->alpha16_memory[offset] = (state->alpha16_memory[offset] & 0xff00) | data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
@@ -363,10 +363,10 @@ WRITE8_HANDLER( polepos_alpha_w )
***************************************************************************/
-static void draw_road(running_machine *machine, bitmap_t *bitmap)
+static void draw_road(running_machine &machine, bitmap_t *bitmap)
{
- polepos_state *state = machine->driver_data<polepos_state>();
- const UINT8 *road_control = machine->region("gfx5")->base();
+ polepos_state *state = machine.driver_data<polepos_state>();
+ const UINT8 *road_control = machine.region("gfx5")->base();
const UINT8 *road_bits1 = road_control + 0x2000;
const UINT8 *road_bits2 = road_control + 0x4000;
int x, y, i;
@@ -439,14 +439,14 @@ static void draw_road(running_machine *machine, bitmap_t *bitmap)
}
}
-static void zoom_sprite(running_machine *machine, bitmap_t *bitmap,int big,
+static void zoom_sprite(running_machine &machine, bitmap_t *bitmap,int big,
UINT32 code,UINT32 color,int flipx,int sx,int sy,
int sizex,int sizey)
{
- const gfx_element *gfx = machine->gfx[big ? 3 : 2];
+ const gfx_element *gfx = machine.gfx[big ? 3 : 2];
const UINT8 *gfxdata = gfx_element_get_data(gfx, code % gfx->total_elements);
- UINT8 *scaling_rom = machine->region("gfx6")->base();
- UINT32 transmask = colortable_get_transpen_mask(machine->colortable, gfx, color, 0x1f);
+ UINT8 *scaling_rom = machine.region("gfx6")->base();
+ UINT32 transmask = colortable_get_transpen_mask(machine.colortable, gfx, color, 0x1f);
int coloroffs = gfx->color_base + color * gfx->color_granularity;
int x,y;
@@ -490,9 +490,9 @@ static void zoom_sprite(running_machine *machine, bitmap_t *bitmap,int big,
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- polepos_state *state = machine->driver_data<polepos_state>();
+ polepos_state *state = machine.driver_data<polepos_state>();
UINT16 *posmem = &state->sprite16_memory[0x380];
UINT16 *sizmem = &state->sprite16_memory[0x780];
int i;
@@ -522,12 +522,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( polepos )
{
- polepos_state *state = screen->machine->driver_data<polepos_state>();
+ polepos_state *state = screen->machine().driver_data<polepos_state>();
rectangle clip = *cliprect;
clip.max_y = 127;
tilemap_draw(bitmap,&clip,state->bg_tilemap,0,0);
- draw_road(screen->machine, bitmap);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_road(screen->machine(), bitmap);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c
index 16545a9b70e..07d4d85f8c4 100644
--- a/src/mame/video/policetr.c
+++ b/src/mame/video/policetr.c
@@ -24,12 +24,12 @@
VIDEO_START( policetr )
{
- policetr_state *state = machine->driver_data<policetr_state>();
+ policetr_state *state = machine.driver_data<policetr_state>();
/* the source bitmap is in ROM */
- state->srcbitmap = machine->region("gfx1")->base();
+ state->srcbitmap = machine.region("gfx1")->base();
/* compute the height */
- state->srcbitmap_height_mask = (machine->region("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
+ state->srcbitmap_height_mask = (machine.region("gfx1")->bytes() / SRCBITMAP_WIDTH) - 1;
/* the destination bitmap is not directly accessible to the CPU */
state->dstbitmap = auto_alloc_array(machine, UINT8, DSTBITMAP_WIDTH * DSTBITMAP_HEIGHT);
@@ -43,9 +43,9 @@ VIDEO_START( policetr )
*
*************************************/
-static void render_display_list(running_machine *machine, offs_t offset)
+static void render_display_list(running_machine &machine, offs_t offset)
{
- policetr_state *state = machine->driver_data<policetr_state>();
+ policetr_state *state = machine.driver_data<policetr_state>();
/* mask against the R3000 address space */
offset &= 0x1fffffff;
@@ -141,7 +141,7 @@ static void render_display_list(running_machine *machine, offs_t offset)
WRITE32_HANDLER( policetr_video_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
/* we assume 4-byte accesses */
if (mem_mask)
logerror("%08X: policetr_video_w access with mask %08X\n", cpu_get_previouspc(space->cpu), mem_mask);
@@ -151,7 +151,7 @@ WRITE32_HANDLER( policetr_video_w )
{
/* offset 0 specifies the start address of a display list */
case 0:
- render_display_list(space->machine, data);
+ render_display_list(space->machine(), data);
break;
/* offset 1 specifies a latch value in the upper 8 bits */
@@ -231,12 +231,12 @@ WRITE32_HANDLER( policetr_video_w )
/* latch 0x50 clears IRQ4 */
case 0x50:
- cputag_set_input_line(space->machine, "maincpu", R3000_IRQ4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", R3000_IRQ4, CLEAR_LINE);
break;
/* latch 0x60 clears IRQ5 */
case 0x60:
- cputag_set_input_line(space->machine, "maincpu", R3000_IRQ5, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", R3000_IRQ5, CLEAR_LINE);
break;
/* log anything else */
@@ -259,35 +259,35 @@ WRITE32_HANDLER( policetr_video_w )
READ32_HANDLER( policetr_video_r )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
int inputval;
- int width = space->machine->primary_screen->width();
- int height = space->machine->primary_screen->height();
+ int width = space->machine().primary_screen->width();
+ int height = space->machine().primary_screen->height();
/* the value read is based on the latch */
switch (state->video_latch)
{
/* latch 0x00 is player 1's gun X coordinate */
case 0x00:
- inputval = ((input_port_read(space->machine, "GUNX1") & 0xff) * width) >> 8;
+ inputval = ((input_port_read(space->machine(), "GUNX1") & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x01 is player 1's gun Y coordinate */
case 0x01:
- inputval = ((input_port_read(space->machine, "GUNY1") & 0xff) * height) >> 8;
+ inputval = ((input_port_read(space->machine(), "GUNY1") & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
/* latch 0x02 is player 2's gun X coordinate */
case 0x02:
- inputval = ((input_port_read(space->machine, "GUNX2") & 0xff) * width) >> 8;
+ inputval = ((input_port_read(space->machine(), "GUNX2") & 0xff) * width) >> 8;
inputval += 0x50;
return (inputval << 20) | 0x20000000;
/* latch 0x03 is player 2's gun Y coordinate */
case 0x03:
- inputval = ((input_port_read(space->machine, "GUNY2") & 0xff) * height) >> 8;
+ inputval = ((input_port_read(space->machine(), "GUNY2") & 0xff) * height) >> 8;
inputval += 0x17;
return (inputval << 20);
@@ -317,7 +317,7 @@ READ32_HANDLER( policetr_video_r )
WRITE32_HANDLER( policetr_palette_offset_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
if (ACCESSING_BITS_16_23)
{
state->palette_offset = (data >> 16) & 0xff;
@@ -328,13 +328,13 @@ WRITE32_HANDLER( policetr_palette_offset_w )
WRITE32_HANDLER( policetr_palette_data_w )
{
- policetr_state *state = space->machine->driver_data<policetr_state>();
+ policetr_state *state = space->machine().driver_data<policetr_state>();
if (ACCESSING_BITS_16_23)
{
state->palette_data[state->palette_index] = (data >> 16) & 0xff;
if (++state->palette_index == 3)
{
- palette_set_color(space->machine, state->palette_offset, MAKE_RGB(state->palette_data[0], state->palette_data[1], state->palette_data[2]));
+ palette_set_color(space->machine(), state->palette_offset, MAKE_RGB(state->palette_data[0], state->palette_data[1], state->palette_data[2]));
state->palette_index = 0;
}
}
@@ -350,7 +350,7 @@ WRITE32_HANDLER( policetr_palette_data_w )
SCREEN_UPDATE( policetr )
{
- policetr_state *state = screen->machine->driver_data<policetr_state>();
+ policetr_state *state = screen->machine().driver_data<policetr_state>();
int width = cliprect->max_x - cliprect->min_x + 1;
int y;
diff --git a/src/mame/video/polyplay.c b/src/mame/video/polyplay.c
index d3c8330f0f6..031a634f1c7 100644
--- a/src/mame/video/polyplay.c
+++ b/src/mame/video/polyplay.c
@@ -31,10 +31,10 @@ PALETTE_INIT( polyplay )
WRITE8_HANDLER( polyplay_characterram_w )
{
- polyplay_state *state = space->machine->driver_data<polyplay_state>();
+ polyplay_state *state = space->machine().driver_data<polyplay_state>();
if (state->characterram[offset] != data)
{
- gfx_element_mark_dirty(space->machine->gfx[1], (offset >> 3) & 0x7f);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset >> 3) & 0x7f);
state->characterram[offset] = data;
}
@@ -42,14 +42,14 @@ WRITE8_HANDLER( polyplay_characterram_w )
VIDEO_START( polyplay )
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
- gfx_element_set_source(machine->gfx[1], state->characterram);
+ polyplay_state *state = machine.driver_data<polyplay_state>();
+ gfx_element_set_source(machine.gfx[1], state->characterram);
}
SCREEN_UPDATE( polyplay )
{
- polyplay_state *state = screen->machine->driver_data<polyplay_state>();
+ polyplay_state *state = screen->machine().driver_data<polyplay_state>();
UINT8 *videoram = state->videoram;
offs_t offs;
@@ -60,7 +60,7 @@ SCREEN_UPDATE( polyplay )
int sy = offs >> 6 << 3;
UINT8 code = videoram[offs];
- drawgfx_opaque(bitmap,cliprect, screen->machine->gfx[(code >> 7) & 0x01],
+ drawgfx_opaque(bitmap,cliprect, screen->machine().gfx[(code >> 7) & 0x01],
code, 0, 0, 0, sx, sy);
}
diff --git a/src/mame/video/poolshrk.c b/src/mame/video/poolshrk.c
index 6a476311e2c..3b34e87783a 100644
--- a/src/mame/video/poolshrk.c
+++ b/src/mame/video/poolshrk.c
@@ -12,14 +12,14 @@ Atari Poolshark video emulation
static TILE_GET_INFO( get_tile_info )
{
- poolshrk_state *state = machine->driver_data<poolshrk_state>();
+ poolshrk_state *state = machine.driver_data<poolshrk_state>();
SET_TILE_INFO(1, state->playfield_ram[tile_index] & 0x3f, 0, 0);
}
VIDEO_START( poolshrk )
{
- poolshrk_state *state = machine->driver_data<poolshrk_state>();
+ poolshrk_state *state = machine.driver_data<poolshrk_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -29,7 +29,7 @@ VIDEO_START( poolshrk )
SCREEN_UPDATE( poolshrk )
{
- poolshrk_state *state = screen->machine->driver_data<poolshrk_state>();
+ poolshrk_state *state = screen->machine().driver_data<poolshrk_state>();
int i;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -43,7 +43,7 @@ SCREEN_UPDATE( poolshrk )
int hpos = state->hpos_ram[i];
int vpos = state->vpos_ram[i];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], i, (i == 0) ? 0 : 1, 0, 0,
248 - hpos, vpos - 15, 0);
}
diff --git a/src/mame/video/pooyan.c b/src/mame/video/pooyan.c
index 4596337a6e0..63df7d5014a 100644
--- a/src/mame/video/pooyan.c
+++ b/src/mame/video/pooyan.c
@@ -41,7 +41,7 @@ PALETTE_INIT( pooyan )
2, resistances_b, bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -66,7 +66,7 @@ PALETTE_INIT( pooyan )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -76,14 +76,14 @@ PALETTE_INIT( pooyan )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -97,7 +97,7 @@ PALETTE_INIT( pooyan )
static TILE_GET_INFO( get_bg_tile_info )
{
- pooyan_state *state = machine->driver_data<pooyan_state>();
+ pooyan_state *state = machine.driver_data<pooyan_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index];
int color = attr & 0x0f;
@@ -116,7 +116,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( pooyan )
{
- pooyan_state *state = machine->driver_data<pooyan_state>();
+ pooyan_state *state = machine.driver_data<pooyan_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -130,7 +130,7 @@ VIDEO_START( pooyan )
WRITE8_HANDLER( pooyan_videoram_w )
{
- pooyan_state *state = space->machine->driver_data<pooyan_state>();
+ pooyan_state *state = space->machine().driver_data<pooyan_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -138,7 +138,7 @@ WRITE8_HANDLER( pooyan_videoram_w )
WRITE8_HANDLER( pooyan_colorram_w )
{
- pooyan_state *state = space->machine->driver_data<pooyan_state>();
+ pooyan_state *state = space->machine().driver_data<pooyan_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -146,7 +146,7 @@ WRITE8_HANDLER( pooyan_colorram_w )
WRITE8_HANDLER( pooyan_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
}
@@ -157,9 +157,9 @@ WRITE8_HANDLER( pooyan_flipscreen_w )
*
*************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- pooyan_state *state = machine->driver_data<pooyan_state>();
+ pooyan_state *state = machine.driver_data<pooyan_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -175,12 +175,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int flipy = spriteram_2[offs] & 0x80;
drawgfx_transmask(bitmap,cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code,
color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
@@ -194,9 +194,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( pooyan )
{
- pooyan_state *state = screen->machine->driver_data<pooyan_state>();
+ pooyan_state *state = screen->machine().driver_data<pooyan_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index 775312ea50d..5b60af3831d 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -49,9 +49,9 @@ enum { TYPE_SKYSKIPR, TYPE_POPEYE };
The bootleg is the same, but the outputs are not inverted.
***************************************************************************/
-static void convert_color_prom(running_machine *machine,const UINT8 *color_prom)
+static void convert_color_prom(running_machine &machine,const UINT8 *color_prom)
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
int i;
@@ -115,7 +115,7 @@ static void convert_color_prom(running_machine *machine,const UINT8 *color_prom)
PALETTE_INIT( popeye )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
state->invertmask = 0xff;
convert_color_prom(machine,color_prom);
@@ -123,17 +123,17 @@ PALETTE_INIT( popeye )
PALETTE_INIT( popeyebl )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
state->invertmask = 0x00;
convert_color_prom(machine,color_prom);
}
-static void set_background_palette(running_machine *machine,int bank)
+static void set_background_palette(running_machine &machine,int bank)
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
int i;
- UINT8 *color_prom = machine->region("proms")->base() + 16 * bank;
+ UINT8 *color_prom = machine.region("proms")->base() + 16 * bank;
for (i = 0;i < 16;i++)
{
@@ -170,21 +170,21 @@ static void set_background_palette(running_machine *machine,int bank)
WRITE8_HANDLER( popeye_videoram_w )
{
- popeye_state *state = space->machine->driver_data<popeye_state>();
+ popeye_state *state = space->machine().driver_data<popeye_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( popeye_colorram_w )
{
- popeye_state *state = space->machine->driver_data<popeye_state>();
+ popeye_state *state = space->machine().driver_data<popeye_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( popeye_bitmap_w )
{
- popeye_state *state = space->machine->driver_data<popeye_state>();
+ popeye_state *state = space->machine().driver_data<popeye_state>();
int sx,sy,x,y,colour;
state->bitmapram[offset] = data;
@@ -194,7 +194,7 @@ WRITE8_HANDLER( popeye_bitmap_w )
sx = 8 * (offset % 128);
sy = 8 * (offset / 128);
- if (flip_screen_get(space->machine))
+ if (flip_screen_get(space->machine()))
sy = 512-8 - sy;
colour = data & 0x0f;
@@ -211,7 +211,7 @@ WRITE8_HANDLER( popeye_bitmap_w )
sx = 8 * (offset % 64);
sy = 4 * (offset / 64);
- if (flip_screen_get(space->machine))
+ if (flip_screen_get(space->machine()))
sy = 512-4 - sy;
colour = data & 0x0f;
@@ -236,7 +236,7 @@ WRITE8_HANDLER( skyskipr_bitmap_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index] & 0x0f;
@@ -245,9 +245,9 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( skyskipr )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
state->bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size);
- state->tmpbitmap2 = auto_bitmap_alloc(machine,1024,1024,machine->primary_screen->format()); /* actually 1024x512 but not rolling over vertically? */
+ state->tmpbitmap2 = auto_bitmap_alloc(machine,1024,1024,machine.primary_screen->format()); /* actually 1024x512 but not rolling over vertically? */
state->bitmap_type = TYPE_SKYSKIPR;
@@ -263,9 +263,9 @@ VIDEO_START( skyskipr )
VIDEO_START( popeye )
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
state->bitmapram = auto_alloc_array(machine, UINT8, popeye_bitmapram_size);
- state->tmpbitmap2 = auto_bitmap_alloc(machine,512,512,machine->primary_screen->format());
+ state->tmpbitmap2 = auto_bitmap_alloc(machine,512,512,machine.primary_screen->format());
state->bitmap_type = TYPE_POPEYE;
@@ -279,11 +279,11 @@ VIDEO_START( popeye )
state_save_register_global_pointer(machine, state->bitmapram, popeye_bitmapram_size);
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
int offs;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->lastflip != flip_screen_get(machine))
{
@@ -317,9 +317,9 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- popeye_state *state = machine->driver_data<popeye_state>();
+ popeye_state *state = machine.driver_data<popeye_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -363,7 +363,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
if (spriteram[offs] != 0)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code ^ 0x1ff,
color,
flipx,flipy,
@@ -373,9 +373,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( popeye )
{
- popeye_state *state = screen->machine->driver_data<popeye_state>();
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ popeye_state *state = screen->machine().driver_data<popeye_state>();
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/popper.c b/src/mame/video/popper.c
index b12c17b9263..38579823caf 100644
--- a/src/mame/video/popper.c
+++ b/src/mame/video/popper.c
@@ -50,13 +50,13 @@ PALETTE_INIT( popper )
rgb = compute_res_net_all(machine, color_prom, &popper_decode_info, &popper_net_info);
palette_set_colors(machine, 0, rgb, 64);
- palette_normalize_range(machine->palette, 0, 63, 0, 255);
+ palette_normalize_range(machine.palette, 0, 63, 0, 255);
auto_free(machine, rgb);
}
WRITE8_HANDLER( popper_ol_videoram_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->ol_videoram[offset] = data;
tilemap_mark_tile_dirty(state->ol_p123_tilemap, offset);
@@ -65,7 +65,7 @@ WRITE8_HANDLER( popper_ol_videoram_w )
WRITE8_HANDLER( popper_videoram_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->p123_tilemap, offset);
@@ -74,7 +74,7 @@ WRITE8_HANDLER( popper_videoram_w )
WRITE8_HANDLER( popper_ol_attribram_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->ol_attribram[offset] = data;
tilemap_mark_tile_dirty(state->ol_p123_tilemap, offset);
@@ -83,7 +83,7 @@ WRITE8_HANDLER( popper_ol_attribram_w )
WRITE8_HANDLER( popper_attribram_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->attribram[offset] = data;
tilemap_mark_tile_dirty(state->p123_tilemap, offset);
@@ -92,10 +92,10 @@ WRITE8_HANDLER( popper_attribram_w )
WRITE8_HANDLER( popper_flipscreen_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->flipscreen = data;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
if (state->flipscreen)
state->tilemap_clip.min_x = state->tilemap_clip.max_x - 15;
@@ -105,24 +105,24 @@ WRITE8_HANDLER( popper_flipscreen_w )
WRITE8_HANDLER( popper_e002_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
state->e002 = data;
}
WRITE8_HANDLER( popper_gfx_bank_w )
{
- popper_state *state = space->machine->driver_data<popper_state>();
+ popper_state *state = space->machine().driver_data<popper_state>();
if (state->gfx_bank != data)
{
state->gfx_bank = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_popper_p123_tile_info )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
UINT32 tile_number = state->videoram[tile_index];
UINT8 attr = state->attribram[tile_index];
tile_number += state->gfx_bank << 8;
@@ -137,7 +137,7 @@ static TILE_GET_INFO( get_popper_p123_tile_info )
static TILE_GET_INFO( get_popper_p0_tile_info )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
UINT32 tile_number = state->videoram[tile_index];
UINT8 attr = state->attribram[tile_index];
tile_number += state->gfx_bank << 8;
@@ -154,7 +154,7 @@ static TILE_GET_INFO( get_popper_p0_tile_info )
static TILE_GET_INFO( get_popper_ol_p123_tile_info )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
UINT32 tile_number = state->ol_videoram[tile_index];
UINT8 attr = state->ol_attribram[tile_index];
tile_number += state->gfx_bank << 8;
@@ -169,7 +169,7 @@ static TILE_GET_INFO( get_popper_ol_p123_tile_info )
static TILE_GET_INFO( get_popper_ol_p0_tile_info )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
UINT32 tile_number = state->ol_videoram[tile_index];
UINT8 attr = state->ol_attribram[tile_index];
tile_number += state->gfx_bank << 8;
@@ -186,7 +186,7 @@ static TILE_GET_INFO( get_popper_ol_p0_tile_info )
VIDEO_START( popper )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
state->p123_tilemap = tilemap_create(machine, get_popper_p123_tile_info, tilemap_scan_cols, 8, 8, 33, 32 );
state->p0_tilemap = tilemap_create(machine, get_popper_p0_tile_info, tilemap_scan_cols, 8, 8, 33, 32);
state->ol_p123_tilemap = tilemap_create(machine, get_popper_ol_p123_tile_info, tilemap_scan_cols, 8, 8, 2, 32);
@@ -201,12 +201,12 @@ VIDEO_START( popper )
tilemap_set_transmask(state->ol_p0_tilemap, 0, 0x0f, 0x0e);
tilemap_set_transmask(state->ol_p0_tilemap, 1, 0x0e, 0x0f);
- state->tilemap_clip = machine->primary_screen->visible_area();
+ state->tilemap_clip = machine.primary_screen->visible_area();
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- popper_state *state = machine->driver_data<popper_state>();
+ popper_state *state = machine.driver_data<popper_state>();
int offs, sx, sy, flipx, flipy;
for (offs = 0; offs < state->spriteram_size - 4; offs += 4)
@@ -237,7 +237,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
state->spriteram[offs + 1],
(state->spriteram[offs + 2] & 0x0f),
flipx,flipy,
@@ -248,7 +248,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( popper )
{
- popper_state *state = screen->machine->driver_data<popper_state>();
+ popper_state *state = screen->machine().driver_data<popper_state>();
rectangle finalclip = state->tilemap_clip;
sect_rect(&finalclip, cliprect);
@@ -263,7 +263,7 @@ SCREEN_UPDATE( popper )
tilemap_draw(bitmap, &finalclip, state->ol_p123_tilemap, TILEMAP_DRAW_LAYER1, 0);
tilemap_draw(bitmap, &finalclip, state->ol_p0_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->p123_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->p0_tilemap, TILEMAP_DRAW_LAYER0, 0);
diff --git a/src/mame/video/portrait.c b/src/mame/video/portrait.c
index b5d2a682a15..1ff40a51738 100644
--- a/src/mame/video/portrait.c
+++ b/src/mame/video/portrait.c
@@ -11,19 +11,19 @@
WRITE8_HANDLER( portrait_bgvideo_write )
{
- portrait_state *state = space->machine->driver_data<portrait_state>();
+ portrait_state *state = space->machine().driver_data<portrait_state>();
tilemap_mark_tile_dirty(state->background,offset/2);
state->bgvideoram[offset] = data;
}
WRITE8_HANDLER( portrait_fgvideo_write )
{
- portrait_state *state = space->machine->driver_data<portrait_state>();
+ portrait_state *state = space->machine().driver_data<portrait_state>();
tilemap_mark_tile_dirty(state->foreground,offset/2);
state->fgvideoram[offset] = data;
}
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, const UINT8 *source )
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, const UINT8 *source )
{
int attr = source[tile_index*2+0];
int tilenum = source[tile_index*2+1];
@@ -56,19 +56,19 @@ INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int ti
static TILE_GET_INFO( get_bg_tile_info )
{
- portrait_state *state = machine->driver_data<portrait_state>();
+ portrait_state *state = machine.driver_data<portrait_state>();
get_tile_info( machine, tileinfo, tile_index, state->bgvideoram );
}
static TILE_GET_INFO( get_fg_tile_info )
{
- portrait_state *state = machine->driver_data<portrait_state>();
+ portrait_state *state = machine.driver_data<portrait_state>();
get_tile_info( machine, tileinfo, tile_index, state->fgvideoram );
}
VIDEO_START( portrait )
{
- portrait_state *state = machine->driver_data<portrait_state>();
+ portrait_state *state = machine.driver_data<portrait_state>();
state->background = tilemap_create( machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32 );
state->foreground = tilemap_create( machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32 );
@@ -80,10 +80,10 @@ VIDEO_START( portrait )
PALETTE_INIT( portrait )
{
int i;
- UINT8* lookup = machine->region("tileattr")->base();
+ UINT8* lookup = machine.region("tileattr")->base();
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x40);
+ machine.colortable = colortable_alloc(machine, 0x40);
/*
for (i = 0;i < 0x40;i++)
@@ -96,7 +96,7 @@ PALETTE_INIT( portrait )
g = (data >> 3) & 0x3;
b = (data >> 5) & 0x7;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal3bit(r), pal2bit(g), pal3bit(b)));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal3bit(r), pal2bit(g), pal3bit(b)));
color_prom++;
}
@@ -111,10 +111,10 @@ PALETTE_INIT( portrait )
g = (data >> 5) & 0x1f;
b = (data >> 10) & 0x1f;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)));
// ?? the lookup seems to reference 0x3f colours, unless 1 bit is priority or similar?
- colortable_palette_set_color(machine->colortable, i+0x20, MAKE_RGB(pal5bit(r>>1), pal5bit(g>>1), pal5bit(b>>1)));
+ colortable_palette_set_color(machine.colortable, i+0x20, MAKE_RGB(pal5bit(r>>1), pal5bit(g>>1), pal5bit(b>>1)));
color_prom++;
}
@@ -124,14 +124,14 @@ PALETTE_INIT( portrait )
for (i = 0;i < 0x800;i++)
{
UINT8 ctabentry = lookup[i]&0x3f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- portrait_state *state = machine->driver_data<portrait_state>();
+ portrait_state *state = machine.driver_data<portrait_state>();
UINT8 *source = state->spriteram;
UINT8 *finish = source + 0x200;
@@ -179,7 +179,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
tilenum,color,
0,fy,
sx,sy,7);
@@ -190,7 +190,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( portrait )
{
- portrait_state *state = screen->machine->driver_data<portrait_state>();
+ portrait_state *state = screen->machine().driver_data<portrait_state>();
rectangle cliprect_scroll, cliprect_no_scroll;
cliprect_scroll = cliprect_no_scroll = *cliprect;
@@ -208,6 +208,6 @@ SCREEN_UPDATE( portrait )
tilemap_draw(bitmap, &cliprect_scroll, state->background, 0, 0);
tilemap_draw(bitmap, &cliprect_scroll, state->foreground, 0, 0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/powerins.c b/src/mame/video/powerins.c
index a1564fe8e92..7cf448afafa 100644
--- a/src/mame/video/powerins.c
+++ b/src/mame/video/powerins.c
@@ -50,12 +50,12 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE16_HANDLER( powerins_flipscreen_w )
{
- if (ACCESSING_BITS_0_7) flip_screen_set(space->machine, data & 1 );
+ if (ACCESSING_BITS_0_7) flip_screen_set(space->machine(), data & 1 );
}
WRITE16_HANDLER( powerins_tilebank_w )
{
- powerins_state *state = space->machine->driver_data<powerins_state>();
+ powerins_state *state = space->machine().driver_data<powerins_state>();
if (ACCESSING_BITS_0_7)
{
if (data != state->tile_bank)
@@ -81,13 +81,13 @@ WRITE16_HANDLER( powerins_paletteram16_w )
/* RRRR GGGG BBBB RGBx */
/* 4321 4321 4321 000x */
- UINT16 newword = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 newword = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = ((newword >> 11) & 0x1E ) | ((newword >> 3) & 0x01);
int g = ((newword >> 7) & 0x1E ) | ((newword >> 2) & 0x01);
int b = ((newword >> 3) & 0x1E ) | ((newword >> 1) & 0x01);
- palette_set_color_rgb( space->machine,offset, pal5bit(r),pal5bit(g),pal5bit(b) );
+ palette_set_color_rgb( space->machine(),offset, pal5bit(r),pal5bit(g),pal5bit(b) );
}
@@ -121,7 +121,7 @@ Offset:
static TILE_GET_INFO( get_tile_info_0 )
{
- powerins_state *state = machine->driver_data<powerins_state>();
+ powerins_state *state = machine.driver_data<powerins_state>();
UINT16 code = state->vram_0[tile_index];
SET_TILE_INFO(
0,
@@ -132,7 +132,7 @@ static TILE_GET_INFO( get_tile_info_0 )
WRITE16_HANDLER( powerins_vram_0_w )
{
- powerins_state *state = space->machine->driver_data<powerins_state>();
+ powerins_state *state = space->machine().driver_data<powerins_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0, offset);
}
@@ -163,7 +163,7 @@ Offset:
static TILE_GET_INFO( get_tile_info_1 )
{
- powerins_state *state = machine->driver_data<powerins_state>();
+ powerins_state *state = machine.driver_data<powerins_state>();
UINT16 code = state->vram_1[tile_index];
SET_TILE_INFO(
1,
@@ -174,7 +174,7 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE16_HANDLER( powerins_vram_1_w )
{
- powerins_state *state = space->machine->driver_data<powerins_state>();
+ powerins_state *state = space->machine().driver_data<powerins_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset);
}
@@ -193,7 +193,7 @@ WRITE16_HANDLER( powerins_vram_1_w )
VIDEO_START( powerins )
{
- powerins_state *state = machine->driver_data<powerins_state>();
+ powerins_state *state = machine.driver_data<powerins_state>();
state->tilemap_0 = tilemap_create( machine, get_tile_info_0,
powerins_get_memory_offset_0,
@@ -263,14 +263,14 @@ Offset: Format: Value:
#define SIGN_EXTEND_POS(_var_) {_var_ &= 0x3ff; if (_var_ > 0x1ff) _var_ -= 0x400;}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- powerins_state *state = machine->driver_data<powerins_state>();
+ powerins_state *state = machine.driver_data<powerins_state>();
UINT16 *source = state->spriteram + 0x8000/2;
UINT16 *finish = state->spriteram + 0x9000/2;
- int screen_w = machine->primary_screen->width();
- int screen_h = machine->primary_screen->height();
+ int screen_w = machine.primary_screen->width();
+ int screen_h = machine.primary_screen->height();
for ( ; source < finish; source += 16/2 )
{
@@ -313,7 +313,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
for (y = 0 ; y < dimy ; y++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, flipy,
@@ -342,7 +342,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( powerins )
{
- powerins_state *state = screen->machine->driver_data<powerins_state>();
+ powerins_state *state = screen->machine().driver_data<powerins_state>();
int layers_ctrl = -1;
int scrollx = (state->vctrl_0[2/2]&0xff) + (state->vctrl_0[0/2]&0xff)*256;
@@ -355,21 +355,21 @@ SCREEN_UPDATE( powerins )
tilemap_set_scrolly( state->tilemap_1, 0, 0x00);
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
-// if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+// if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, state->tilemap_0, 0, 0);
else bitmap_fill(bitmap,cliprect,0);
- if (layers_ctrl&8) draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl&8) draw_sprites(screen->machine(),bitmap,cliprect);
if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, state->tilemap_1, 0, 0);
return 0;
}
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index 5f9d6d1257a..bd37995edbf 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -170,7 +170,7 @@ static ADDRESS_MAP_START( ppu2c0x, AS_0, 8 )
AM_RANGE(0x3f00, 0x3fff) AM_READWRITE(ppu2c0x_palette_read, ppu2c0x_palette_write)
ADDRESS_MAP_END
-void ppu2c0x_init_palette( running_machine *machine, int first_entry )
+void ppu2c0x_init_palette( running_machine &machine, int first_entry )
{
/* This routine builds a palette using a transformation from */
@@ -285,13 +285,13 @@ void ppu2c0x_init_palette( running_machine *machine, int first_entry )
/* color tables are modified at run-time, and are initialized on 'ppu2c0x_reset' */
}
-void ppu2c0x_init_palette_rgb( running_machine *machine, int first_entry )
+void ppu2c0x_init_palette_rgb( running_machine &machine, int first_entry )
{
int color_emphasis, color_num;
int R, G, B;
- UINT8 *palette_data = machine->region("palette")->base();
+ UINT8 *palette_data = machine.region("palette")->base();
/* Loop through the emphasis modes (8 total) */
for (color_emphasis = 0; color_emphasis < 8; color_emphasis++)
@@ -857,7 +857,7 @@ static TIMER_CALLBACK( scanline_callback )
/* increment our scanline count */
ppu2c0x->scanline++;
-// logerror("starting scanline %d (MAME %d, beam %d)\n", ppu2c0x->scanline, device->machine->primary_screen->vpos(), device->machine->primary_screen->hpos());
+// logerror("starting scanline %d (MAME %d, beam %d)\n", ppu2c0x->scanline, device->machine().primary_screen->vpos(), device->machine().primary_screen->hpos());
/* Note: this is called at the _end_ of each scanline */
if (ppu2c0x->scanline == PPU_VBLANK_FIRST_SCANLINE)
@@ -873,7 +873,7 @@ static TIMER_CALLBACK( scanline_callback )
// a game can read the high bit of $2002 before the NMI is called (potentially resetting the bit
// via a read from $2002 in the NMI handler).
// B-Wings is an example game that needs this.
- ppu2c0x->nmi_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(4));
+ ppu2c0x->nmi_timer->adjust(device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4));
}
}
@@ -901,10 +901,10 @@ static TIMER_CALLBACK( scanline_callback )
next_scanline = 0;
// Call us back when the hblank starts for this scanline
- ppu2c0x->hblank_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
+ ppu2c0x->hblank_timer->adjust(device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
// trigger again at the start of the next scanline
- ppu2c0x->scanline_timer->adjust(device->machine->primary_screen->time_until_pos(next_scanline * ppu2c0x->scan_scale));
+ ppu2c0x->scanline_timer->adjust(device->machine().primary_screen->time_until_pos(next_scanline * ppu2c0x->scan_scale));
}
/*************************************
@@ -1045,7 +1045,7 @@ WRITE8_DEVICE_HANDLER( ppu2c0x_w )
#ifdef MAME_DEBUG
if (ppu2c0x->scanline <= PPU_BOTTOM_VISIBLE_SCANLINE)
{
- screen_device *screen = device->machine->primary_screen;
+ screen_device *screen = device->machine().primary_screen;
logerror("PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, ppu2c0x->scanline, screen->vpos(), screen->hpos());
}
#endif
@@ -1307,23 +1307,23 @@ static DEVICE_START( ppu2c0x )
ppu2c0x->security_value = 0x1b;
/* initialize the scanline handling portion */
- ppu2c0x->scanline_timer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), (void *) device);
- ppu2c0x->scanline_timer->adjust(device->machine->primary_screen->time_until_pos(1));
+ ppu2c0x->scanline_timer = device->machine().scheduler().timer_alloc(FUNC(scanline_callback), (void *) device);
+ ppu2c0x->scanline_timer->adjust(device->machine().primary_screen->time_until_pos(1));
- ppu2c0x->hblank_timer = device->machine->scheduler().timer_alloc(FUNC(hblank_callback), (void *) device);
- ppu2c0x->hblank_timer->adjust(device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
+ ppu2c0x->hblank_timer = device->machine().scheduler().timer_alloc(FUNC(hblank_callback), (void *) device);
+ ppu2c0x->hblank_timer->adjust(device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(86.67)); // ??? FIXME - hardcoding NTSC, need better calculation
- ppu2c0x->nmi_timer = device->machine->scheduler().timer_alloc(FUNC(nmi_callback), (void *) device);
+ ppu2c0x->nmi_timer = device->machine().scheduler().timer_alloc(FUNC(nmi_callback), (void *) device);
ppu2c0x->nmi_timer->adjust(attotime::never);
ppu2c0x->nmi_callback_proc = intf->nmi_handler;
ppu2c0x->color_base = intf->color_base;
/* allocate a screen bitmap, videomem and spriteram, a dirtychar array and the monochromatic colortable */
- ppu2c0x->bitmap = auto_bitmap_alloc(device->machine, VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, device->machine->primary_screen->format());
- ppu2c0x->spriteram = auto_alloc_array_clear(device->machine, UINT8, SPRITERAM_SIZE);
- ppu2c0x->colortable = auto_alloc_array(device->machine, pen_t, ARRAY_LENGTH(default_colortable));
- ppu2c0x->colortable_mono = auto_alloc_array(device->machine, pen_t, ARRAY_LENGTH(default_colortable_mono));
+ ppu2c0x->bitmap = auto_bitmap_alloc(device->machine(), VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, device->machine().primary_screen->format());
+ ppu2c0x->spriteram = auto_alloc_array_clear(device->machine(), UINT8, SPRITERAM_SIZE);
+ ppu2c0x->colortable = auto_alloc_array(device->machine(), pen_t, ARRAY_LENGTH(default_colortable));
+ ppu2c0x->colortable_mono = auto_alloc_array(device->machine(), pen_t, ARRAY_LENGTH(default_colortable_mono));
device->save_item(NAME(ppu2c0x->scanline));
device->save_item(NAME(ppu2c0x->refresh_data));
diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h
index 667a972be70..3fcc46feb80 100644
--- a/src/mame/video/ppu2c0x.h
+++ b/src/mame/video/ppu2c0x.h
@@ -105,8 +105,8 @@ DECLARE_LEGACY_MEMORY_DEVICE(PPU_2C05_04, ppu2c05_04); // Vs. Unisystem (Top Gun
DECLARE_LEGACY_MEMORY_DEVICE(PPU_2C07, ppu2c07); // PAL NES
/* routines */
-void ppu2c0x_init_palette(running_machine *machine, int first_entry ) ATTR_NONNULL(1);
-void ppu2c0x_init_palette_rgb(running_machine *machine, int first_entry ) ATTR_NONNULL(1);
+void ppu2c0x_init_palette(running_machine &machine, int first_entry );
+void ppu2c0x_init_palette_rgb(running_machine &machine, int first_entry );
void ppu2c0x_spriteram_dma(address_space *space, device_t *device, const UINT8 page ) ATTR_NONNULL(1);
void ppu2c0x_render( device_t *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) ATTR_NONNULL(1);
diff --git a/src/mame/video/prehisle.c b/src/mame/video/prehisle.c
index 3115c9125cf..19f7cbf5328 100644
--- a/src/mame/video/prehisle.c
+++ b/src/mame/video/prehisle.c
@@ -12,7 +12,7 @@
WRITE16_HANDLER( prehisle_bg_videoram16_w )
{
- prehisle_state *state = space->machine->driver_data<prehisle_state>();
+ prehisle_state *state = space->machine().driver_data<prehisle_state>();
COMBINE_DATA(&state->bg_videoram16[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -20,7 +20,7 @@ WRITE16_HANDLER( prehisle_bg_videoram16_w )
WRITE16_HANDLER( prehisle_fg_videoram16_w )
{
- prehisle_state *state = space->machine->driver_data<prehisle_state>();
+ prehisle_state *state = space->machine().driver_data<prehisle_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -28,22 +28,22 @@ WRITE16_HANDLER( prehisle_fg_videoram16_w )
READ16_HANDLER( prehisle_control16_r )
{
- prehisle_state *state = space->machine->driver_data<prehisle_state>();
+ prehisle_state *state = space->machine().driver_data<prehisle_state>();
switch (offset)
{
- case 0x08: return input_port_read(space->machine, "P2"); // Player 2
- case 0x10: return input_port_read(space->machine, "COIN"); // Coins, Tilt, Service
- case 0x20: return input_port_read(space->machine, "P1") ^ state->invert_controls; // Player 1
- case 0x21: return input_port_read(space->machine, "DSW0"); // DIPs
- case 0x22: return input_port_read(space->machine, "DSW1"); // DIPs + VBLANK
+ case 0x08: return input_port_read(space->machine(), "P2"); // Player 2
+ case 0x10: return input_port_read(space->machine(), "COIN"); // Coins, Tilt, Service
+ case 0x20: return input_port_read(space->machine(), "P1") ^ state->invert_controls; // Player 1
+ case 0x21: return input_port_read(space->machine(), "DSW0"); // DIPs
+ case 0x22: return input_port_read(space->machine(), "DSW1"); // DIPs + VBLANK
default: return 0;
}
}
WRITE16_HANDLER( prehisle_control16_w )
{
- prehisle_state *state = space->machine->driver_data<prehisle_state>();
+ prehisle_state *state = space->machine().driver_data<prehisle_state>();
int scroll = 0;
COMBINE_DATA(&scroll);
@@ -55,15 +55,15 @@ WRITE16_HANDLER( prehisle_control16_w )
case 0x10: tilemap_set_scrolly(state->bg2_tilemap, 0, scroll); break;
case 0x18: tilemap_set_scrollx(state->bg2_tilemap, 0, scroll); break;
case 0x23: state->invert_controls = data ? 0x00ff : 0x0000; break;
- case 0x28: coin_counter_w(space->machine, 0, data & 1); break;
- case 0x29: coin_counter_w(space->machine, 1, data & 1); break;
- case 0x30: flip_screen_set(space->machine, data & 0x01); break;
+ case 0x28: coin_counter_w(space->machine(), 0, data & 1); break;
+ case 0x29: coin_counter_w(space->machine(), 1, data & 1); break;
+ case 0x30: flip_screen_set(space->machine(), data & 0x01); break;
}
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- UINT8 *tilerom = machine->region("gfx5")->base();
+ UINT8 *tilerom = machine.region("gfx5")->base();
int offs = tile_index * 2;
int attr = tilerom[offs + 1] + (tilerom[offs] << 8);
@@ -76,7 +76,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- prehisle_state *state = machine->driver_data<prehisle_state>();
+ prehisle_state *state = machine.driver_data<prehisle_state>();
int attr = state->bg_videoram16[tile_index];
int code = attr & 0x7ff;
int color = attr >> 12;
@@ -87,7 +87,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- prehisle_state *state = machine->driver_data<prehisle_state>();
+ prehisle_state *state = machine.driver_data<prehisle_state>();
int attr = state->videoram[tile_index];
int code = attr & 0xfff;
int color = attr >> 12;
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( prehisle )
{
- prehisle_state *state = machine->driver_data<prehisle_state>();
+ prehisle_state *state = machine.driver_data<prehisle_state>();
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_cols,
16, 16, 1024, 32);
@@ -128,9 +128,9 @@ o fedcba9876543210
3 xxxx............ color+priority, other bits unknown
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int foreground )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int foreground )
{
- prehisle_state *state = machine->driver_data<prehisle_state>();
+ prehisle_state *state = machine.driver_data<prehisle_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -159,19 +159,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if ((foreground && priority) || (!foreground && !priority))
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[3], code, color, flipx, flipy, sx, sy, 15);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flipx, flipy, sx, sy, 15);
}
}
}
SCREEN_UPDATE( prehisle )
{
- prehisle_state *state = screen->machine->driver_data<prehisle_state>();
+ prehisle_state *state = screen->machine().driver_data<prehisle_state>();
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/psikyo.c b/src/mame/video/psikyo.c
index 1786d3179f2..bf91bac694a 100644
--- a/src/mame/video/psikyo.c
+++ b/src/mame/video/psikyo.c
@@ -73,7 +73,7 @@ Offset:
static TILE_GET_INFO( get_tile_info_0 )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
UINT16 code = ((UINT16 *)state->vram_0)[BYTE_XOR_BE(tile_index)];
SET_TILE_INFO(
1,
@@ -84,7 +84,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
UINT16 code = ((UINT16 *)state->vram_1)[BYTE_XOR_BE(tile_index)];
SET_TILE_INFO(
1,
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE32_HANDLER( psikyo_vram_0_w )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
COMBINE_DATA(&state->vram_0[offset]);
if (ACCESSING_BITS_16_31)
@@ -118,7 +118,7 @@ WRITE32_HANDLER( psikyo_vram_0_w )
WRITE32_HANDLER( psikyo_vram_1_w )
{
- psikyo_state *state = space->machine->driver_data<psikyo_state>();
+ psikyo_state *state = space->machine().driver_data<psikyo_state>();
COMBINE_DATA(&state->vram_1[offset]);
if (ACCESSING_BITS_16_31)
@@ -138,9 +138,9 @@ WRITE32_HANDLER( psikyo_vram_1_w )
}
}
-void psikyo_switch_banks( running_machine *machine, int tmap, int bank )
+void psikyo_switch_banks( running_machine &machine, int tmap, int bank )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
if ((tmap == 0) && (bank != state->tilemap_0_bank))
{
@@ -163,7 +163,7 @@ void psikyo_switch_banks( running_machine *machine, int tmap, int bank )
VIDEO_START( psikyo )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* The Hardware is Capable of Changing the Dimensions of the Tilemaps, its safer to create
the various sized tilemaps now as opposed to later */
@@ -263,19 +263,19 @@ Note: Not all sprites are displayed: in the top part of spriteram
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* tile layers 0 & 1 have priorities 1 & 2 */
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
int offs;
UINT16 *spritelist = (UINT16 *)(state->spritebuf2 + 0x1800 / 4);
- UINT8 *TILES = machine->region("spritelut")->base(); // Sprites LUT
- int TILES_LEN = machine->region("spritelut")->bytes();
+ UINT8 *TILES = machine.region("spritelut")->base(); // Sprites LUT
+ int TILES_LEN = machine.region("spritelut")->bytes();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* Exit if sprites are disabled */
if (spritelist[BYTE_XOR_BE((0x800 - 2) / 2)] & 1) return;
@@ -355,21 +355,21 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int addr = (code * 2) & (TILES_LEN - 1);
if (zoomx == 32 && zoomy == 32)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[0],
TILES[addr+1] * 256 + TILES[addr],
attr >> 8,
flipx, flipy,
x + dx * 16, y + dy * 16,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri[(attr & 0xc0) >> 6],trans_pen);
else
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
TILES[addr+1] * 256 + TILES[addr],
attr >> 8,
flipx, flipy,
x + (dx * zoomx) / 2, y + (dy * zoomy) / 2,
zoomx << 11,zoomy << 11,
- machine->priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen);
+ machine.priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen);
code++;
}
@@ -382,9 +382,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
// until I work out why it makes a partial copy of the sprite list, and how best to apply it
// sprite placement of the explosion graphic seems incorrect compared to the original sets? (no / different zoom support?)
// it might be a problem with the actual bootleg
-static void draw_sprites_bootleg( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
+static void draw_sprites_bootleg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
/* tile layers 0 & 1 have priorities 1 & 2 */
static const int pri[] = { 0, 0xfc, 0xff, 0xff };
@@ -393,11 +393,11 @@ static void draw_sprites_bootleg( running_machine *machine, bitmap_t *bitmap, co
// UINT16 *spritelist = (UINT16 *)(state->spriteram + 0x1800/4);
UINT16 *spritelist = (UINT16 *)(state->spritebuf2 + 0x1800 / 4);
- UINT8 *TILES = machine->region("spritelut")->base(); // Sprites LUT
- int TILES_LEN = machine->region("spritelut")->bytes();
+ UINT8 *TILES = machine.region("spritelut")->base(); // Sprites LUT
+ int TILES_LEN = machine.region("spritelut")->bytes();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* Exit if sprites are disabled */
if (spritelist[BYTE_XOR_BE((0x800 - 2) / 2)] & 1)
@@ -480,21 +480,21 @@ static void draw_sprites_bootleg( running_machine *machine, bitmap_t *bitmap, co
int addr = (code * 2) & (TILES_LEN-1);
if (zoomx == 32 && zoomy == 32)
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[0],
TILES[addr+1] * 256 + TILES[addr],
attr >> 8,
flipx, flipy,
x + dx * 16, y + dy * 16,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri[(attr & 0xc0) >> 6],trans_pen);
else
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
TILES[addr+1] * 256 + TILES[addr],
attr >> 8,
flipx, flipy,
x + (dx * zoomx) / 2, y + (dy * zoomy) / 2,
zoomx << 11,zoomy << 11,
- machine->priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen);
+ machine.priority_bitmap,pri[(attr & 0xc0) >> 6],trans_pen);
code++;
}
@@ -526,7 +526,7 @@ static int tilemap_width( int size )
SCREEN_UPDATE( psikyo )
{
- psikyo_state *state = screen->machine->driver_data<psikyo_state>();
+ psikyo_state *state = screen->machine().driver_data<psikyo_state>();
int i, layers_ctrl = -1;
UINT32 tm0size, tm1size;
@@ -539,7 +539,7 @@ SCREEN_UPDATE( psikyo )
tilemap_t *tmptilemap0, *tmptilemap1;
- flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW") & 0x00010000); // hardwired to a DSW bit
+ flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW") & 0x00010000); // hardwired to a DSW bit
/* Layers enable (not quite right) */
@@ -574,8 +574,8 @@ SCREEN_UPDATE( psikyo )
/* For gfx banking for s1945jn/gunbird/btlkroad */
if (state->ka302c_banking)
{
- psikyo_switch_banks(screen->machine, 0, (layer0_ctrl & 0x400) >> 10);
- psikyo_switch_banks(screen->machine, 1, (layer1_ctrl & 0x400) >> 10);
+ psikyo_switch_banks(screen->machine(), 0, (layer0_ctrl & 0x400) >> 10);
+ psikyo_switch_banks(screen->machine(), 1, (layer1_ctrl & 0x400) >> 10);
}
switch ((layer0_ctrl & 0x00c0) >> 6)
@@ -674,9 +674,9 @@ SCREEN_UPDATE( psikyo )
tilemap_set_transparent_pen(state->tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15));
tilemap_set_transparent_pen(state->tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15));
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (layers_ctrl & 1)
tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
@@ -685,7 +685,7 @@ SCREEN_UPDATE( psikyo )
tilemap_draw(bitmap, cliprect, tmptilemap1, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2);
if (layers_ctrl & 4)
- draw_sprites(screen->machine, bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
+ draw_sprites(screen->machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
return 0;
}
@@ -700,7 +700,7 @@ SCREEN_UPDATE( psikyo )
SCREEN_UPDATE( psikyo_bootleg )
{
- psikyo_state *state = screen->machine->driver_data<psikyo_state>();
+ psikyo_state *state = screen->machine().driver_data<psikyo_state>();
int i, layers_ctrl = -1;
UINT32 tm0size, tm1size;
@@ -713,7 +713,7 @@ SCREEN_UPDATE( psikyo_bootleg )
tilemap_t *tmptilemap0, *tmptilemap1;
- flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW") & 0x00010000); // hardwired to a DSW bit
+ flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW") & 0x00010000); // hardwired to a DSW bit
/* Layers enable (not quite right) */
@@ -748,8 +748,8 @@ SCREEN_UPDATE( psikyo_bootleg )
/* For gfx banking for s1945jn/gunbird/btlkroad */
if (state->ka302c_banking)
{
- psikyo_switch_banks(screen->machine, 0, (layer0_ctrl & 0x400) >> 10);
- psikyo_switch_banks(screen->machine, 1, (layer1_ctrl & 0x400) >> 10);
+ psikyo_switch_banks(screen->machine(), 0, (layer0_ctrl & 0x400) >> 10);
+ psikyo_switch_banks(screen->machine(), 1, (layer1_ctrl & 0x400) >> 10);
}
switch ((layer0_ctrl & 0x00c0) >> 6)
@@ -848,9 +848,9 @@ SCREEN_UPDATE( psikyo_bootleg )
tilemap_set_transparent_pen(state->tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15));
tilemap_set_transparent_pen(state->tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15));
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (layers_ctrl & 1)
tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
@@ -859,7 +859,7 @@ SCREEN_UPDATE( psikyo_bootleg )
tilemap_draw(bitmap, cliprect, tmptilemap1, layer1_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 2);
if (layers_ctrl & 4)
- draw_sprites_bootleg(screen->machine, bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
+ draw_sprites_bootleg(screen->machine(), bitmap, cliprect, (spr_ctrl & 4 ? 0 : 15));
return 0;
}
@@ -867,7 +867,7 @@ SCREEN_UPDATE( psikyo_bootleg )
SCREEN_EOF( psikyo )
{
- psikyo_state *state = machine->driver_data<psikyo_state>();
+ psikyo_state *state = machine.driver_data<psikyo_state>();
memcpy(state->spritebuf2, state->spritebuf1, 0x2000);
memcpy(state->spritebuf1, state->spriteram, 0x2000);
}
diff --git a/src/mame/video/psikyo4.c b/src/mame/video/psikyo4.c
index e5d8a320742..4d0d305867e 100644
--- a/src/mame/video/psikyo4.c
+++ b/src/mame/video/psikyo4.c
@@ -31,7 +31,7 @@ HgKairak: 86010000 1f201918 a0000000 Large Screen
/* --- SPRITES --- */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 scr )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 scr )
{
/*- Sprite Format 0x0000 - 0x2bff -**
@@ -52,8 +52,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
**- End Sprite Format -*/
- psikyo4_state *state = machine->driver_data<psikyo4_state>();
- const gfx_element *gfx = machine->gfx[0];
+ psikyo4_state *state = machine.driver_data<psikyo4_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT32 *source = state->spriteram;
UINT16 *list = (UINT16 *)state->spriteram + 0x2c00/2 + 0x04/2; /* 0x2c00/0x2c02 what are these for, pointers? one for each screen */
UINT16 listlen = (0xc00/2 - 0x04/2), listcntr = 0;
@@ -99,7 +99,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ((!scr && flipscreen1) || (scr && flipscreen2))
{
- ypos = machine->primary_screen->visible_area().max_y + 1 - ypos - high * 16; /* Screen Height depends on game */
+ ypos = machine.primary_screen->visible_area().max_y + 1 - ypos - high * 16; /* Screen Height depends on game */
xpos = 40 * 8 - xpos - wide * 16;
flipx = !flipx;
flipy = !flipy;
@@ -129,23 +129,23 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( psikyo4 )
{
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
if (screen == left_screen)
{
bitmap_fill(bitmap, cliprect, 0x1000);
- draw_sprites(screen->machine, bitmap, cliprect, 0x0000);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x0000);
}
if (screen == right_screen)
{
bitmap_fill(bitmap, cliprect, 0x1001);
- draw_sprites(screen->machine, bitmap, cliprect, 0x2000);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x2000);
}
return 0;
}
VIDEO_START( psikyo4 )
{
- machine->gfx[0]->color_granularity = 32; /* 256 colour sprites with palette selectable on 32 colour boundaries */
+ machine.gfx[0]->color_granularity = 32; /* 256 colour sprites with palette selectable on 32 colour boundaries */
}
diff --git a/src/mame/video/psikyosh.c b/src/mame/video/psikyosh.c
index e8fa58ab72c..5af98a8ac74 100644
--- a/src/mame/video/psikyosh.c
+++ b/src/mame/video/psikyosh.c
@@ -71,7 +71,7 @@ The only viable way to do this is to have one tilemap per bank (0x0a-0x20), and
//#define DEBUG_KEYS
//#define DEBUG_MESSAGE
-static UINT8 alphatable[256]; // this might be moved to psikyosh_state, if we ever add a *machine parameter to drawgfxm.h macros
+static UINT8 alphatable[256]; // this might be moved to psikyosh_state, if we ever add a machine parameter to drawgfxm.h macros
/*-------------------------------------------------
@@ -220,7 +220,7 @@ static void drawgfx_alphastore(bitmap_t *dest, const rectangle *cliprect, const
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && (gfx->pen_usage[code] & ~(1 << 0)) == 0)
@@ -265,7 +265,7 @@ static void drawgfx_alphatable(bitmap_t *dest, const rectangle *cliprect, const
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && (gfx->pen_usage[code] & ~(1 << 0)) == 0)
@@ -279,16 +279,16 @@ static void drawgfx_alphatable(bitmap_t *dest, const rectangle *cliprect, const
/* 'Normal' layers, no line/columnscroll. No per-line effects.
Zooming isn't supported just because it's not used and it would be slow */
-static void draw_bglayer( running_machine *machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
+static void draw_bglayer( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
gfx_element *gfx;
int offs = 0, sx, sy;
int scrollx, scrolly, regbank, tilebank, alpha, alphamap, zoom, pri, size, width;
assert(!BG_LINE(layer));
- gfx = BG_DEPTH_8BPP(layer) ? machine->gfx[1] : machine->gfx[0];
+ gfx = BG_DEPTH_8BPP(layer) ? machine.gfx[1] : machine.gfx[0];
size = BG_LARGE(layer) ? 32 : 16;
width = 16 * size;
@@ -387,12 +387,12 @@ static void cache_bitmap(int scanline, psikyosh_state *state, gfx_element *gfx,
Bitmap is first rendered to an ARGB image, taking into account the per-pen alpha (if used).
From there we extract data as we compose the image, one scanline at a time, blending the ARGB pixels
into the RGB32 bitmap (with either the alpha information from the ARGB, or per-line alpha */
-static void draw_bglayerscroll( running_machine *machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
+static void draw_bglayerscroll( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
assert(BG_LINE(layer));
- gfx_element *gfx = BG_DEPTH_8BPP(layer) ? machine->gfx[1] : machine->gfx[0];
+ gfx_element *gfx = BG_DEPTH_8BPP(layer) ? machine.gfx[1] : machine.gfx[0];
int size = BG_LARGE(layer) ? 32 : 16;
int width = size * 16;
@@ -482,9 +482,9 @@ static void draw_bglayerscroll( running_machine *machine, int layer, bitmap_t *b
}
/* 3 BG layers, with priority */
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
int i;
#ifdef DEBUG_KEYS
@@ -529,12 +529,12 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
/* sx and sy is top-left of entire sprite regardless of flip */
/* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */
/* pixel is only plotted if z is >= priority_buffer[y][x] */
-static void psikyosh_drawgfxzoom( running_machine *machine,
+static void psikyosh_drawgfxzoom( running_machine &machine,
bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z)
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
rectangle myclip; /* Clip to screen boundaries */
int code_offset = 0;
int xtile, ytile, xpixel, ypixel;
@@ -580,7 +580,7 @@ static void psikyosh_drawgfxzoom( running_machine *machine,
{
for (xtile = xstart; xtile != xend; xtile += xinc)
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements);
int x_index_base, y_index, sx, sy, ex, ey;
@@ -846,7 +846,7 @@ static void psikyosh_drawgfxzoom( running_machine *machine,
/* Start drawing */
if (gfx)
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
int sprite_screen_height = ((high * gfx->height * (0x400 * 0x400)) / zoomy + 0x200) >> 10; /* Round up to nearest pixel */
int sprite_screen_width = ((wide * gfx->width * (0x400 * 0x400)) / zoomx + 0x200) >> 10;
@@ -1069,7 +1069,7 @@ static void psikyosh_drawgfxzoom( running_machine *machine,
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri)
{
/*- Sprite Format 0x0000 - 0x37ff -**
@@ -1115,9 +1115,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
#endif
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
const gfx_element *gfx;
- UINT32 *src = machine->generic.buffered_spriteram.u32; /* Use buffered spriteram */
+ UINT32 *src = machine.generic.buffered_spriteram.u32; /* Use buffered spriteram */
UINT16 *list = (UINT16 *)src + 0x3800 / 2;
UINT16 listlen = 0x800/2;
UINT16 *zoom_table = (UINT16 *)state->zoomram;
@@ -1164,7 +1164,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
alphamap = (alpha_table[BYTE4_XOR_BE(alpha)] & 0x80)? 1:0;
alpha = alpha_table[BYTE4_XOR_BE(alpha)] & 0x3f;
- gfx = dpth ? machine->gfx[1] : machine->gfx[0];
+ gfx = dpth ? machine.gfx[1] : machine.gfx[0];
if (alphamap) /* alpha values are per-pen */
alpha = -1;
@@ -1189,13 +1189,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void psikyosh_prelineblend( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void psikyosh_prelineblend( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* There are 224 values for pre-lineblending. Using one for every row currently */
/* I suspect that it should be blended against black by the amount specified as
gnbarich sets the 0x000000ff to 0x7f in test mode whilst the others use 0x80.
tgm2 sets it to 0x00 on warning screen. Likely has no effect. */
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
UINT32 *dstline;
int bank = (state->vidregs[7] & 0xff000000) >> 24; /* bank is always 8 (0x4000) except for daraku/soldivid */
UINT32 *linefill = &state->bgram[(bank * 0x800) / 4 - 0x4000 / 4]; /* Per row */
@@ -1216,10 +1216,10 @@ static void psikyosh_prelineblend( running_machine *machine, bitmap_t *bitmap, c
}
-static void psikyosh_postlineblend( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
+static void psikyosh_postlineblend( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
{
/* There are 224 values for post-lineblending. Using one for every row currently */
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
UINT32 *dstline;
int bank = (state->vidregs[7] & 0xff000000) >> 24; /* bank is always 8 (i.e. 0x4000) except for daraku/soldivid */
UINT32 *lineblend = &state->bgram[(bank * 0x800) / 4 - 0x4000 / 4 + 0x400 / 4]; /* Per row */
@@ -1253,16 +1253,16 @@ static void psikyosh_postlineblend( running_machine *machine, bitmap_t *bitmap,
VIDEO_START( psikyosh )
{
- psikyosh_state *state = machine->driver_data<psikyosh_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ psikyosh_state *state = machine.driver_data<psikyosh_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->z_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16); /* z-buffer */
state->zoom_bitmap = auto_bitmap_alloc(machine, 16*16, 16*16, BITMAP_FORMAT_INDEXED8); /* temp buffer for assembling sprites */
state->bg_bitmap = auto_bitmap_alloc(machine, 32*16, 32*16, BITMAP_FORMAT_RGB32); /* temp buffer for assembling tilemaps */
state->bg_zoom = auto_alloc_array(machine, UINT16, 256);
- machine->gfx[1]->color_granularity = 16; /* 256 colour sprites with palette selectable on 16 colour boundaries */
+ machine.gfx[1]->color_granularity = 16; /* 256 colour sprites with palette selectable on 16 colour boundaries */
/* Pens 0xc0-0xff have a gradient of alpha values associated with them */
int i;
@@ -1291,7 +1291,7 @@ VIDEO_START( psikyosh )
SCREEN_UPDATE( psikyosh ) /* Note the z-buffer on each sprite to get correct priority */
{
int i;
- psikyosh_state *state = screen->machine->driver_data<psikyosh_state>();
+ psikyosh_state *state = screen->machine().driver_data<psikyosh_state>();
// show only the priority associated with a given keypress(s) and/or hide sprites/tilemaps
int pri_debug = false;
@@ -1301,14 +1301,14 @@ SCREEN_UPDATE( psikyosh ) /* Note the z-buffer on each sprite to get correct pri
#ifdef DEBUG_KEYS
for (i = 0; i <= 7; i++)
{
- if(input_code_pressed(screen->machine, pri_keys[i])) {
+ if(input_code_pressed(screen->machine(), pri_keys[i])) {
pri_debug = true;
}
}
- if(input_code_pressed(screen->machine, KEYCODE_G)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_G)) {
sprites = false;
}
- if(input_code_pressed(screen->machine, KEYCODE_H)) {
+ if(input_code_pressed(screen->machine(), KEYCODE_H)) {
backgrounds = false;
}
#endif
@@ -1323,18 +1323,18 @@ popmessage ("%08x %08x %08x %08x\n%08x %08x %08x %08x",
bitmap_fill(state->z_bitmap, cliprect, 0); /* z-buffer */
- psikyosh_prelineblend(screen->machine, bitmap, cliprect); // fills screen
+ psikyosh_prelineblend(screen->machine(), bitmap, cliprect); // fills screen
for (i = 0; i <= 7; i++)
{
- if(!pri_debug || input_code_pressed(screen->machine, pri_keys[i]))
+ if(!pri_debug || input_code_pressed(screen->machine(), pri_keys[i]))
{
if(sprites) {
- draw_sprites(screen->machine, bitmap, cliprect, i); // When same priority bg's have higher pri
+ draw_sprites(screen->machine(), bitmap, cliprect, i); // When same priority bg's have higher pri
}
if(backgrounds) {
- draw_background(screen->machine, bitmap, cliprect, i);
+ draw_background(screen->machine(), bitmap, cliprect, i);
}
- psikyosh_postlineblend(screen->machine, bitmap, cliprect, i); // assume this has highest priority at same priority level
+ psikyosh_postlineblend(screen->machine(), bitmap, cliprect, i); // assume this has highest priority at same priority level
}
}
return 0;
@@ -1342,7 +1342,7 @@ popmessage ("%08x %08x %08x %08x\n%08x %08x %08x %08x",
SCREEN_EOF( psikyosh )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram32_w(space, 0, 0, 0xffffffff);
}
diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c
index fc6adb08313..7743773fa9d 100644
--- a/src/mame/video/psx.c
+++ b/src/mame/video/psx.c
@@ -164,7 +164,9 @@ struct _psx_gpu_debug
struct _psx_gpu
{
- running_machine *machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine;
INT32 n_tx;
INT32 n_ty;
INT32 n_abr;
@@ -270,7 +272,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( psx_gpu *p_psxgpu, int n_level, const c
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", p_psxgpu->machine->describe_context(), buf );
+ logerror( "%s: %s", p_psxgpu->machine().describe_context(), buf );
}
}
@@ -288,7 +290,7 @@ PALETTE_INIT( psx )
static void DebugMeshInit( psx_gpu *p_psxgpu )
{
- screen_device *screen = p_psxgpu->machine->primary_screen;
+ screen_device *screen = p_psxgpu->machine().primary_screen;
int width = screen->width();
int height = screen->height();
@@ -298,14 +300,14 @@ static void DebugMeshInit( psx_gpu *p_psxgpu )
p_psxgpu->m_debug.b_clear = 1;
p_psxgpu->m_debug.n_coord = 0;
p_psxgpu->m_debug.n_skip = 0;
- p_psxgpu->m_debug.mesh = auto_bitmap_alloc( p_psxgpu->machine, width, height, BITMAP_FORMAT_INDEXED16 );
+ p_psxgpu->m_debug.mesh = auto_bitmap_alloc( p_psxgpu->machine(), width, height, BITMAP_FORMAT_INDEXED16 );
}
static void DebugMesh( psx_gpu *p_psxgpu, int n_coordx, int n_coordy )
{
int n_coord;
int n_colour;
- screen_device *screen = p_psxgpu->machine->primary_screen;
+ screen_device *screen = p_psxgpu->machine().primary_screen;
int width = screen->width();
int height = screen->height();
@@ -424,23 +426,23 @@ static void DebugMeshEnd( psx_gpu *p_psxgpu )
static void DebugCheckKeys( psx_gpu *p_psxgpu )
{
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_M ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_M ) )
p_psxgpu->m_debug.b_mesh = !p_psxgpu->m_debug.b_mesh;
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_V ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_V ) )
p_psxgpu->m_debug.b_texture = !p_psxgpu->m_debug.b_texture;
if( p_psxgpu->m_debug.b_mesh || p_psxgpu->m_debug.b_texture )
{
- screen_device *screen = p_psxgpu->machine->primary_screen;
+ screen_device *screen = p_psxgpu->machine().primary_screen;
int width = screen->width();
int height = screen->height();
- p_psxgpu->machine->primary_screen->set_visible_area( 0, width - 1, 0, height - 1 );
+ p_psxgpu->machine().primary_screen->set_visible_area( 0, width - 1, 0, height - 1 );
}
else
- p_psxgpu->machine->primary_screen->set_visible_area( 0, p_psxgpu->n_screenwidth - 1, 0, p_psxgpu->n_screenheight - 1 );
+ p_psxgpu->machine().primary_screen->set_visible_area( 0, p_psxgpu->n_screenwidth - 1, 0, p_psxgpu->n_screenheight - 1 );
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_I ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_I ) )
{
if( p_psxgpu->m_debug.b_texture )
{
@@ -468,7 +470,7 @@ static void DebugCheckKeys( psx_gpu *p_psxgpu )
}
#if 0
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_D ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_D ) )
{
FILE *f;
int n_x;
@@ -478,7 +480,7 @@ static void DebugCheckKeys( psx_gpu *p_psxgpu )
fprintf( f, "%04u,%04u = %04x\n", n_y, n_x, p_psxgpu->p_p_vram[ n_y ][ n_x ] );
fclose( f );
}
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_S ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_S ) )
{
FILE *f;
popmessage( "saving..." );
@@ -487,7 +489,7 @@ static void DebugCheckKeys( psx_gpu *p_psxgpu )
fwrite( p_psxgpu->p_p_vram[ n_y ], 1024 * 2, 1, f );
fclose( f );
}
- if( input_code_pressed_once( p_psxgpu->machine, KEYCODE_L ) )
+ if( input_code_pressed_once( p_psxgpu->machine(), KEYCODE_L ) )
{
FILE *f;
popmessage( "loading..." );
@@ -515,7 +517,7 @@ static int DebugTextureDisplay( psx_gpu *p_psxgpu, bitmap_t *bitmap )
if( p_psxgpu->m_debug.b_texture )
{
- screen_device *screen = p_psxgpu->machine->primary_screen;
+ screen_device *screen = p_psxgpu->machine().primary_screen;
int width = screen->width();
int height = screen->height();
@@ -545,7 +547,7 @@ static int DebugTextureDisplay( psx_gpu *p_psxgpu, bitmap_t *bitmap )
}
p_n_interleave[ n_x ] = p_psxgpu->p_p_vram[ n_yi ][ n_xi ];
}
- draw_scanline16( bitmap, 0, n_y, width, p_n_interleave, p_psxgpu->machine->pens );
+ draw_scanline16( bitmap, 0, n_y, width, p_n_interleave, p_psxgpu->machine().pens );
}
}
return p_psxgpu->m_debug.b_texture;
@@ -555,7 +557,7 @@ static int DebugTextureDisplay( psx_gpu *p_psxgpu, bitmap_t *bitmap )
static STATE_POSTLOAD( updatevisiblearea )
{
- psx_gpu *p_psxgpu = machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = machine.driver_data<psx_state>()->p_psxgpu;
rectangle visarea;
float refresh;
@@ -621,10 +623,10 @@ static STATE_POSTLOAD( updatevisiblearea )
visarea.min_x = visarea.min_y = 0;
visarea.max_x = p_psxgpu->n_screenwidth - 1;
visarea.max_y = p_psxgpu->n_screenheight - 1;
- machine->primary_screen->configure(p_psxgpu->n_screenwidth, p_psxgpu->n_screenheight, visarea, HZ_TO_ATTOSECONDS(refresh));
+ machine.primary_screen->configure(p_psxgpu->n_screenwidth, p_psxgpu->n_screenheight, visarea, HZ_TO_ATTOSECONDS(refresh));
}
-static void psx_gpu_init( running_machine *machine, int n_gputype )
+static void psx_gpu_init( running_machine &machine, int n_gputype )
{
psx_gpu *p_psxgpu = auto_alloc_clear(machine, psx_gpu);
int n_line;
@@ -632,12 +634,12 @@ static void psx_gpu_init( running_machine *machine, int n_gputype )
int n_level2;
int n_shade;
int n_shaded;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
- p_psxgpu->machine = machine;
+ p_psxgpu->m_machine = &machine;
p_psxgpu->n_gputype = n_gputype;
- p_psxgpu->b_need_sianniv_vblank_hack = !strcmp(machine->system().name, "sianniv");
+ p_psxgpu->b_need_sianniv_vblank_hack = !strcmp(machine.system().name, "sianniv");
#if defined( MAME_DEBUG )
DebugMeshInit(p_psxgpu);
@@ -749,7 +751,7 @@ static void psx_gpu_init( running_machine *machine, int n_gputype )
}
// icky!!!
- machine->state().save_memory( "globals", NULL, 0, "m_packet", (UINT8 *)&p_psxgpu->m_packet, 1, sizeof( p_psxgpu->m_packet ) );
+ machine.state().save_memory( "globals", NULL, 0, "m_packet", (UINT8 *)&p_psxgpu->m_packet, 1, sizeof( p_psxgpu->m_packet ) );
state_save_register_global_pointer( machine, p_psxgpu->p_vram, p_psxgpu->n_vram_size );
state_save_register_global( machine, p_psxgpu->n_gpu_buffer_offset );
@@ -783,8 +785,8 @@ static void psx_gpu_init( running_machine *machine, int n_gputype )
state_save_register_global( machine, p_psxgpu->n_iy );
state_save_register_global( machine, p_psxgpu->n_ti );
- machine->state().register_postload( updatevisiblearea, NULL );
- machine->driver_data<psx_state>()->p_psxgpu = p_psxgpu;
+ machine.state().register_postload( updatevisiblearea, NULL );
+ machine.driver_data<psx_state>()->p_psxgpu = p_psxgpu;
}
VIDEO_START( psx_type1 )
@@ -799,7 +801,7 @@ VIDEO_START( psx_type2 )
SCREEN_UPDATE( psx )
{
- psx_gpu *p_psxgpu = screen->machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = screen->machine().driver_data<psx_state>()->p_psxgpu;
UINT32 n_x;
UINT32 n_y;
int n_top;
@@ -3193,9 +3195,9 @@ static void MoveImage( psx_gpu *p_psxgpu )
}
}
-void psx_gpu_write( running_machine *machine, UINT32 *p_ram, INT32 n_size )
+void psx_gpu_write( running_machine &machine, UINT32 *p_ram, INT32 n_size )
{
- psx_gpu *p_psxgpu = machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = machine.driver_data<psx_state>()->p_psxgpu;
while( n_size > 0 )
{
@@ -3681,12 +3683,12 @@ void psx_gpu_write( running_machine *machine, UINT32 *p_ram, INT32 n_size )
WRITE32_HANDLER( psx_gpu_w )
{
- psx_gpu *p_psxgpu = space->machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = space->machine().driver_data<psx_state>()->p_psxgpu;
switch( offset )
{
case 0x00:
- psx_gpu_write( space->machine, &data, 1 );
+ psx_gpu_write( space->machine(), &data, 1 );
break;
case 0x01:
switch( data >> 24 )
@@ -3713,7 +3715,7 @@ WRITE32_HANDLER( psx_gpu_w )
p_psxgpu->n_twy = 0;
p_psxgpu->n_twh = 255;
p_psxgpu->n_tww = 255;
- updatevisiblearea(space->machine, NULL);
+ updatevisiblearea(space->machine(), NULL);
break;
case 0x01:
verboselog( p_psxgpu, 1, "not handled: reset command buffer\n" );
@@ -3767,7 +3769,7 @@ WRITE32_HANDLER( psx_gpu_w )
{
p_psxgpu->b_reverseflag = ( data >> 7 ) & 1;
}
- updatevisiblearea(space->machine, NULL);
+ updatevisiblearea(space->machine(), NULL);
break;
case 0x09:
verboselog( p_psxgpu, 1, "not handled: GPU Control 0x09: %08x\n", data );
@@ -3845,9 +3847,9 @@ WRITE32_HANDLER( psx_gpu_w )
}
-void psx_gpu_read( running_machine *machine, UINT32 *p_ram, INT32 n_size )
+void psx_gpu_read( running_machine &machine, UINT32 *p_ram, INT32 n_size )
{
- psx_gpu *p_psxgpu = machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = machine.driver_data<psx_state>()->p_psxgpu;
while( n_size > 0 )
{
@@ -3897,13 +3899,13 @@ void psx_gpu_read( running_machine *machine, UINT32 *p_ram, INT32 n_size )
READ32_HANDLER( psx_gpu_r )
{
- psx_gpu *p_psxgpu = space->machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = space->machine().driver_data<psx_state>()->p_psxgpu;
UINT32 data;
switch( offset )
{
case 0x00:
- psx_gpu_read( space->machine, &data, 1 );
+ psx_gpu_read( space->machine(), &data, 1 );
break;
case 0x01:
data = p_psxgpu->n_gpustatus;
@@ -3919,7 +3921,7 @@ READ32_HANDLER( psx_gpu_r )
INTERRUPT_GEN( psx_vblank )
{
- psx_gpu *p_psxgpu = device->machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = device->machine().driver_data<psx_state>()->p_psxgpu;
#if defined( MAME_DEBUG )
DebugCheckKeys(p_psxgpu);
@@ -3934,19 +3936,19 @@ INTERRUPT_GEN( psx_vblank )
return;
}
- psx_irq_set( device->machine, 0x0001 );
+ psx_irq_set( device->machine(), 0x0001 );
}
-void psx_gpu_reset( running_machine *machine )
+void psx_gpu_reset( running_machine &machine )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
psx_gpu_w(space, 1, 0, 0xffffffff );
}
-void psx_lightgun_set( running_machine *machine, int n_x, int n_y )
+void psx_lightgun_set( running_machine &machine, int n_x, int n_y )
{
- psx_gpu *p_psxgpu = machine->driver_data<psx_state>()->p_psxgpu;
+ psx_gpu *p_psxgpu = machine.driver_data<psx_state>()->p_psxgpu;
p_psxgpu->n_lightgun_x = n_x;
p_psxgpu->n_lightgun_y = n_y;
diff --git a/src/mame/video/psychic5.c b/src/mame/video/psychic5.c
index aad6191c377..b5125e4b753 100644
--- a/src/mame/video/psychic5.c
+++ b/src/mame/video/psychic5.c
@@ -23,18 +23,18 @@
Palette color
***************************************************************************/
-static void psychic5_change_palette(running_machine *machine, int color, int offset)
+static void psychic5_change_palette(running_machine &machine, int color, int offset)
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
UINT8 lo = state->ps5_palette_ram[offset & ~1];
UINT8 hi = state->ps5_palette_ram[offset | 1];
jal_blend_set(color, hi & 0x0f);
palette_set_color_rgb(machine, color, pal4bit(lo >> 4), pal4bit(lo), pal4bit(hi >> 4));
}
-static void psychic5_change_bg_palette(running_machine *machine, int color, int lo_offs, int hi_offs)
+static void psychic5_change_bg_palette(running_machine &machine, int color, int lo_offs, int hi_offs)
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
UINT8 r,g,b,lo,hi,ir,ig,ib,ix;
rgb_t irgb;
@@ -72,9 +72,9 @@ static void psychic5_change_bg_palette(running_machine *machine, int color, int
}
}
-static void set_background_palette_intensity(running_machine *machine)
+static void set_background_palette_intensity(running_machine &machine)
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
int i;
state->palette_intensity = state->ps5_palette_ram[BG_PAL_INTENSITY_BU] |
(state->ps5_palette_ram[BG_PAL_INTENSITY_RG]<<8);
@@ -91,34 +91,34 @@ static void set_background_palette_intensity(running_machine *machine)
READ8_HANDLER( psychic5_vram_page_select_r )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
return state->ps5_vram_page;
}
WRITE8_HANDLER( psychic5_vram_page_select_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
state->ps5_vram_page = data & 1;
}
WRITE8_HANDLER( psychic5_title_screen_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
state->title_screen = data;
}
READ8_HANDLER( psychic5_paged_ram_r )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
if (state->ps5_vram_page == 1)
{
switch (offset)
{
- case 0x00: return input_port_read(space->machine, "SYSTEM");
- case 0x01: return input_port_read(space->machine, "P1");
- case 0x02: return input_port_read(space->machine, "P2");
- case 0x03: return input_port_read(space->machine, "DSW1");
- case 0x04: return input_port_read(space->machine, "DSW2");
+ case 0x00: return input_port_read(space->machine(), "SYSTEM");
+ case 0x01: return input_port_read(space->machine(), "P1");
+ case 0x02: return input_port_read(space->machine(), "P2");
+ case 0x03: return input_port_read(space->machine(), "DSW1");
+ case 0x04: return input_port_read(space->machine(), "DSW2");
}
}
@@ -127,7 +127,7 @@ READ8_HANDLER( psychic5_paged_ram_r )
WRITE8_HANDLER( psychic5_paged_ram_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
state->ps5_pagedram[state->ps5_vram_page][offset] = data;
if (state->ps5_vram_page == 0)
@@ -152,11 +152,11 @@ WRITE8_HANDLER( psychic5_paged_ram_w )
state->bg_status = state->ps5_io_ram[BG_SCREEN_MODE];
}
else if (offset >= 0x400 && offset <= 0x5ff) /* Sprite color */
- psychic5_change_palette(space->machine,((offset >> 1) & 0xff)+0x000,offset-0x400);
+ psychic5_change_palette(space->machine(),((offset >> 1) & 0xff)+0x000,offset-0x400);
else if (offset >= 0x800 && offset <= 0x9ff) /* BG color */
- psychic5_change_palette(space->machine,((offset >> 1) & 0xff)+0x100,offset-0x400);
+ psychic5_change_palette(space->machine(),((offset >> 1) & 0xff)+0x100,offset-0x400);
else if (offset >= 0xa00 && offset <= 0xbff) /* Text color */
- psychic5_change_palette(space->machine,((offset >> 1) & 0xff)+0x200,offset-0x400);
+ psychic5_change_palette(space->machine(),((offset >> 1) & 0xff)+0x200,offset-0x400);
else if (offset >= 0x1000)
tilemap_mark_tile_dirty(state->fg_tilemap, (offset-0x1000) >> 1);
}
@@ -164,7 +164,7 @@ WRITE8_HANDLER( psychic5_paged_ram_w )
WRITE8_HANDLER( bombsa_paged_ram_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
state->ps5_pagedram[state->ps5_vram_page][offset] = data;
if (state->ps5_vram_page == 0)
@@ -190,13 +190,13 @@ WRITE8_HANDLER( bombsa_paged_ram_w )
else if (offset >= 0x0800 && offset <= 0x0fff)
tilemap_mark_tile_dirty(state->fg_tilemap, (offset & 0x7ff) >> 1);
else if (offset >= 0x1000 && offset <= 0x15ff)
- psychic5_change_palette(space->machine, (offset >> 1) & 0x3ff, offset-0x1000);
+ psychic5_change_palette(space->machine(), (offset >> 1) & 0x3ff, offset-0x1000);
}
}
WRITE8_HANDLER( bombsa_unknown_w )
{
- psychic5_state *state = space->machine->driver_data<psychic5_state>();
+ psychic5_state *state = space->machine().driver_data<psychic5_state>();
state->bombsa_unknown = data;
}
@@ -207,7 +207,7 @@ WRITE8_HANDLER( bombsa_unknown_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
int offs = tile_index << 1;
int attr = state->bg_videoram[offs + 1];
int code = state->bg_videoram[offs] | ((attr & 0xc0) << 2);
@@ -219,7 +219,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
int offs = tile_index << 1;
int attr = state->fg_videoram[offs + 1];
int code = state->fg_videoram[offs] | ((attr & 0xc0) << 2);
@@ -236,7 +236,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( psychic5 )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
/* info offset w h col row */
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -260,7 +260,7 @@ VIDEO_START( psychic5 )
VIDEO_START( bombsa )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
/* info offset w h col row */
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 128, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -284,7 +284,7 @@ VIDEO_START( bombsa )
VIDEO_RESET( psychic5 )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
state->bg_clip_mode = 0;
state->ps5_vram_page = 0;
state->bg_status = 0;
@@ -295,7 +295,7 @@ VIDEO_RESET( psychic5 )
VIDEO_RESET( bombsa )
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
state->ps5_vram_page = 0;
state->bg_status = 0;
state->title_screen = 0;
@@ -309,11 +309,11 @@ VIDEO_RESET( bombsa )
Screen refresh
***************************************************************************/
-#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, cliprect, machine->gfx[0], code, color, flipx, flipy, sx, sy, 15);
+#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy, sx, sy, 15);
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -365,9 +365,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- psychic5_state *state = machine->driver_data<psychic5_state>();
+ psychic5_state *state = machine.driver_data<psychic5_state>();
UINT8 *spriteram = state->spriteram;
rectangle clip = *cliprect;
@@ -434,24 +434,24 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( psychic5 )
{
- psychic5_state *state = screen->machine->driver_data<psychic5_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ psychic5_state *state = screen->machine().driver_data<psychic5_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->bg_status & 1) /* Backgound enable */
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
if (!(state->title_screen & 1))
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
SCREEN_UPDATE( bombsa )
{
- psychic5_state *state = screen->machine->driver_data<psychic5_state>();
+ psychic5_state *state = screen->machine().driver_data<psychic5_state>();
if (state->bg_status & 1) /* Backgound enable */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x0ff]);
- draw_sprites(screen->machine, bitmap, cliprect);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0ff]);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c
index d290a1c308a..ae126e1836f 100644
--- a/src/mame/video/punchout.c
+++ b/src/mame/video/punchout.c
@@ -12,28 +12,28 @@
DRIVER_INIT( punchout )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->palette_reverse_top = 0x00;
state->palette_reverse_bot = 0xff;
}
DRIVER_INIT( spnchout )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->palette_reverse_top = 0x00;
state->palette_reverse_bot = 0xff;
}
DRIVER_INIT( spnchotj )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->palette_reverse_top = 0xff;
state->palette_reverse_bot = 0xff;
}
DRIVER_INIT( armwrest )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->palette_reverse_top = 0x00;
state->palette_reverse_bot = 0x00;
}
@@ -49,7 +49,7 @@ DRIVER_INIT( armwrest )
static TILE_GET_INFO( top_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->bg_top_videoram[tile_index*2 + 1];
int code = state->bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8);
int color = ((attr & 0x7c) >> 2);
@@ -59,7 +59,7 @@ static TILE_GET_INFO( top_get_info )
static TILE_GET_INFO( armwrest_top_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->bg_top_videoram[tile_index*2 + 1];
int code = state->bg_top_videoram[tile_index*2] + ((attr & 0x03) << 8) + ((attr & 0x80) << 3);
int color = ((attr & 0x7c) >> 2);
@@ -68,7 +68,7 @@ static TILE_GET_INFO( armwrest_top_get_info )
static TILE_GET_INFO( bot_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->bg_bot_videoram[tile_index*2 + 1];
int code = state->bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8);
int color = ((attr & 0x7c) >> 2);
@@ -78,7 +78,7 @@ static TILE_GET_INFO( bot_get_info )
static TILE_GET_INFO( armwrest_bot_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->bg_bot_videoram[tile_index*2 + 1];
int code = state->bg_bot_videoram[tile_index*2] + ((attr & 0x03) << 8);
int color = ((attr & 0x7c) >> 2) + 0x40;
@@ -88,7 +88,7 @@ static TILE_GET_INFO( armwrest_bot_get_info )
static TILE_GET_INFO( bs1_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->spr1_videoram[tile_index*4 + 3];
int code = state->spr1_videoram[tile_index*4] + ((state->spr1_videoram[tile_index*4 + 1] & 0x1f) << 8);
int color = attr & 0x1f;
@@ -98,7 +98,7 @@ static TILE_GET_INFO( bs1_get_info )
static TILE_GET_INFO( bs2_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->spr2_videoram[tile_index*4 + 3];
int code = state->spr2_videoram[tile_index*4] + ((state->spr2_videoram[tile_index*4 + 1] & 0x0f) << 8);
int color = attr & 0x3f;
@@ -108,7 +108,7 @@ static TILE_GET_INFO( bs2_get_info )
static TILE_GET_INFO( armwrest_fg_get_info )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int attr = state->armwrest_fg_videoram[tile_index*2 + 1];
int code = state->armwrest_fg_videoram[tile_index*2] + 256 * (attr & 0x07);
int color = ((attr & 0xf8) >> 3);
@@ -132,7 +132,7 @@ static TILEMAP_MAPPER( armwrest_bs1_scan_flipx )
VIDEO_START( punchout )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->bg_top_tilemap = tilemap_create(machine, top_get_info, tilemap_scan_rows, 8,8, 32,32);
state->bg_bot_tilemap = tilemap_create(machine, bot_get_info, tilemap_scan_rows, 8,8, 64,32);
tilemap_set_scroll_rows(state->bg_bot_tilemap, 32);
@@ -149,7 +149,7 @@ VIDEO_START( punchout )
VIDEO_START( armwrest )
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
state->bg_top_tilemap = tilemap_create(machine, armwrest_top_get_info, tilemap_scan_rows, 8,8, 32,32);
state->bg_bot_tilemap = tilemap_create(machine, armwrest_bot_get_info, tilemap_scan_rows, 8,8, 32,32);
@@ -168,28 +168,28 @@ VIDEO_START( armwrest )
WRITE8_HANDLER( punchout_bg_top_videoram_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
state->bg_top_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_top_tilemap, offset/2);
}
WRITE8_HANDLER( punchout_bg_bot_videoram_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
state->bg_bot_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_bot_tilemap, offset/2);
}
WRITE8_HANDLER( armwrest_fg_videoram_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
state->armwrest_fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset/2);
}
WRITE8_HANDLER( punchout_spr1_videoram_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
state->spr1_videoram[offset] = data;
tilemap_mark_tile_dirty(state->spr1_tilemap, offset/4);
if (state->spr1_tilemap_flipx)
@@ -198,16 +198,16 @@ WRITE8_HANDLER( punchout_spr1_videoram_w )
WRITE8_HANDLER( punchout_spr2_videoram_w )
{
- punchout_state *state = space->machine->driver_data<punchout_state>();
+ punchout_state *state = space->machine().driver_data<punchout_state>();
state->spr2_videoram[offset] = data;
tilemap_mark_tile_dirty(state->spr2_tilemap, offset/4);
}
-static void draw_big_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
+static void draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int zoom;
zoom = state->spr1_ctrlram[0] + 256 * (state->spr1_ctrlram[1] & 0x0f);
@@ -249,9 +249,9 @@ static void draw_big_sprite(running_machine *machine, bitmap_t *bitmap, const re
}
-static void armwrest_draw_big_sprite(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
+static void armwrest_draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int zoom;
zoom = state->spr1_ctrlram[0] + 256 * (state->spr1_ctrlram[1] & 0x0f);
@@ -296,9 +296,9 @@ static void armwrest_draw_big_sprite(running_machine *machine, bitmap_t *bitmap,
}
}
-static void drawbs2(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void drawbs2(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int sx,sy;
int incxx;
@@ -328,11 +328,11 @@ static void drawbs2(running_machine *machine, bitmap_t *bitmap, const rectangle
-static void punchout_copy_top_palette(running_machine *machine, int bank)
+static void punchout_copy_top_palette(running_machine &machine, int bank)
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int i;
- const UINT8 *color_prom = machine->region("proms")->base();
+ const UINT8 *color_prom = machine.region("proms")->base();
// top monitor palette
for (i = 0; i < 0x100; i++)
@@ -348,11 +348,11 @@ static void punchout_copy_top_palette(running_machine *machine, int bank)
}
}
-static void punchout_copy_bot_palette(running_machine *machine, int bank)
+static void punchout_copy_bot_palette(running_machine &machine, int bank)
{
- punchout_state *state = machine->driver_data<punchout_state>();
+ punchout_state *state = machine.driver_data<punchout_state>();
int i;
- const UINT8 *color_prom = machine->region("proms")->base() + 0x600;
+ const UINT8 *color_prom = machine.region("proms")->base() + 0x600;
// bottom monitor palette
for (i = 0; i < 0x100; i++)
@@ -371,24 +371,24 @@ static void punchout_copy_bot_palette(running_machine *machine, int bank)
SCREEN_UPDATE( punchout )
{
- punchout_state *state = screen->machine->driver_data<punchout_state>();
- device_t *top_screen = screen->machine->device("top");
- device_t *bottom_screen = screen->machine->device("bottom");
+ punchout_state *state = screen->machine().driver_data<punchout_state>();
+ device_t *top_screen = screen->machine().device("top");
+ device_t *bottom_screen = screen->machine().device("bottom");
if (screen == top_screen)
{
- punchout_copy_top_palette(screen->machine, BIT(*state->palettebank,1));
+ punchout_copy_top_palette(screen->machine(), BIT(*state->palettebank,1));
tilemap_draw(bitmap, cliprect, state->bg_top_tilemap, 0, 0);
if (state->spr1_ctrlram[7] & 1) /* display in top monitor */
- draw_big_sprite(screen->machine, bitmap, cliprect, 0);
+ draw_big_sprite(screen->machine(), bitmap, cliprect, 0);
}
else if (screen == bottom_screen)
{
int offs;
- punchout_copy_bot_palette(screen->machine, BIT(*state->palettebank,0));
+ punchout_copy_bot_palette(screen->machine(), BIT(*state->palettebank,0));
/* copy the character mapped graphics */
for (offs = 0;offs < 32;offs++)
@@ -397,8 +397,8 @@ SCREEN_UPDATE( punchout )
tilemap_draw(bitmap, cliprect, state->bg_bot_tilemap, 0, 0);
if (state->spr1_ctrlram[7] & 2) /* display in bottom monitor */
- draw_big_sprite(screen->machine, bitmap, cliprect, 1);
- drawbs2(screen->machine, bitmap, cliprect);
+ draw_big_sprite(screen->machine(), bitmap, cliprect, 1);
+ drawbs2(screen->machine(), bitmap, cliprect);
}
return 0;
}
@@ -406,28 +406,28 @@ SCREEN_UPDATE( punchout )
SCREEN_UPDATE( armwrest )
{
- punchout_state *state = screen->machine->driver_data<punchout_state>();
- device_t *top_screen = screen->machine->device("top");
- device_t *bottom_screen = screen->machine->device("bottom");
+ punchout_state *state = screen->machine().driver_data<punchout_state>();
+ device_t *top_screen = screen->machine().device("top");
+ device_t *bottom_screen = screen->machine().device("bottom");
if (screen == top_screen)
{
- punchout_copy_top_palette(screen->machine, BIT(*state->palettebank,1));
+ punchout_copy_top_palette(screen->machine(), BIT(*state->palettebank,1));
tilemap_draw(bitmap, cliprect, state->bg_top_tilemap, 0, 0);
if (state->spr1_ctrlram[7] & 1) /* display in top monitor */
- armwrest_draw_big_sprite(screen->machine, bitmap, cliprect, 0);
+ armwrest_draw_big_sprite(screen->machine(), bitmap, cliprect, 0);
}
else if (screen == bottom_screen)
{
- punchout_copy_bot_palette(screen->machine, BIT(*state->palettebank,0));
+ punchout_copy_bot_palette(screen->machine(), BIT(*state->palettebank,0));
tilemap_draw(bitmap, cliprect, state->bg_bot_tilemap, 0, 0);
if (state->spr1_ctrlram[7] & 2) /* display in bottom monitor */
- armwrest_draw_big_sprite(screen->machine, bitmap, cliprect, 1);
- drawbs2(screen->machine, bitmap, cliprect);
+ armwrest_draw_big_sprite(screen->machine(), bitmap, cliprect, 1);
+ drawbs2(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
diff --git a/src/mame/video/pushman.c b/src/mame/video/pushman.c
index 4235dafbbe4..7866992b9ee 100644
--- a/src/mame/video/pushman.c
+++ b/src/mame/video/pushman.c
@@ -15,7 +15,7 @@ static TILEMAP_MAPPER( background_scan_rows )
static TILE_GET_INFO( get_back_tile_info )
{
- UINT8 *bg_map = machine->region("gfx4")->base();
+ UINT8 *bg_map = machine.region("gfx4")->base();
int tile;
tile = bg_map[tile_index << 1] + (bg_map[(tile_index << 1) + 1] << 8);
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
int tile = state->videoram[tile_index];
SET_TILE_INFO(
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( pushman )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
state->bg_tilemap = tilemap_create(machine, get_back_tile_info, background_scan_rows, 32, 32, 128, 64);
state->tx_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -66,13 +66,13 @@ VIDEO_START( pushman )
WRITE16_HANDLER( pushman_scroll_w )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
COMBINE_DATA(&state->control[offset]);
}
WRITE16_HANDLER( pushman_videoram_w )
{
- pushman_state *state = space->machine->driver_data<pushman_state>();
+ pushman_state *state = space->machine().driver_data<pushman_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
@@ -85,9 +85,9 @@ WRITE16_HANDLER( pushman_videoram_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- pushman_state *state = machine->driver_data<pushman_state>();
+ pushman_state *state = machine.driver_data<pushman_state>();
UINT16 *spriteram = state->spriteram;
int offs, x, y, color, sprite, flipx, flipy;
@@ -115,21 +115,21 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1], sprite,
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1], sprite,
color, flipx, flipy, x, y, 15);
}
}
SCREEN_UPDATE( pushman )
{
- pushman_state *state = screen->machine->driver_data<pushman_state>();
+ pushman_state *state = screen->machine().driver_data<pushman_state>();
/* Setup the tilemaps */
tilemap_set_scrollx(state->bg_tilemap, 0, state->control[0]);
tilemap_set_scrolly(state->bg_tilemap, 0, 0xf00 - state->control[1]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/qdrmfgp.c b/src/mame/video/qdrmfgp.c
index bed8e74f9ea..727a5654b11 100644
--- a/src/mame/video/qdrmfgp.c
+++ b/src/mame/video/qdrmfgp.c
@@ -10,13 +10,13 @@
-void qdrmfgp_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+void qdrmfgp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
- qdrmfgp_state *state = machine->driver_data<qdrmfgp_state>();
+ qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
*color = ((*color>>2) & 0x0f) | state->pal;
}
-void qdrmfgp2_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+void qdrmfgp2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
*color = (*color>>1) & 0x7f;
}
@@ -29,7 +29,7 @@ void qdrmfgp2_tile_callback(running_machine *machine, int layer, int *code, int
VIDEO_START( qdrmfgp )
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_association(k056832, 0);
@@ -41,7 +41,7 @@ VIDEO_START( qdrmfgp )
VIDEO_START( qdrmfgp2 )
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_association(k056832, 0);
@@ -59,8 +59,8 @@ VIDEO_START( qdrmfgp2 )
SCREEN_UPDATE( qdrmfgp )
{
- device_t *k056832 = screen->machine->device("k056832");
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ device_t *k056832 = screen->machine().device("k056832");
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1);
k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 2);
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index daab72c6ea5..29ee8774c4c 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -43,7 +43,7 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed );
static VIDEO_START( qix )
{
- qix_state *state = machine->driver_data<qix_state>();
+ qix_state *state = machine.driver_data<qix_state>();
/* allocate memory for the full video RAM */
state->videoram = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -65,7 +65,7 @@ static VIDEO_START( qix )
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
{
- qix_state *driver_state = device->machine->driver_data<qix_state>();
+ qix_state *driver_state = device->machine().driver_data<qix_state>();
/* on the rising edge, latch the scanline */
if (state)
@@ -88,7 +88,7 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
state->flip = data;
}
@@ -112,7 +112,7 @@ WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
static READ8_HANDLER( qix_videoram_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -122,11 +122,11 @@ static READ8_HANDLER( qix_videoram_r )
static WRITE8_HANDLER( qix_videoram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -138,11 +138,11 @@ static WRITE8_HANDLER( qix_videoram_w )
static WRITE8_HANDLER( slither_videoram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( slither_videoram_w )
static READ8_HANDLER( qix_addresslatch_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -180,10 +180,10 @@ static READ8_HANDLER( qix_addresslatch_r )
static WRITE8_HANDLER( qix_addresslatch_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -195,10 +195,10 @@ static WRITE8_HANDLER( qix_addresslatch_w )
static WRITE8_HANDLER( slither_addresslatch_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -218,7 +218,7 @@ static WRITE8_HANDLER( slither_addresslatch_w )
static WRITE8_HANDLER( qix_paletteram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
UINT8 old_data = state->paletteram[offset];
@@ -228,18 +228,18 @@ static WRITE8_HANDLER( qix_paletteram_w )
/* trigger an update if a currently visible pen has changed */
if (((offset >> 8) == state->palette_bank) &&
(old_data != data))
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
}
WRITE8_HANDLER( qix_palettebank_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* set the bank value */
if (state->palette_bank != (data & 3))
{
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
state->palette_bank = data & 3;
}
@@ -306,7 +306,7 @@ static void get_pens(qix_state *state, pen_t *pens)
static MC6845_BEGIN_UPDATE( begin_update )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
#if 0
// note the confusing bit order!
@@ -322,7 +322,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT16 x;
@@ -346,7 +346,7 @@ static MC6845_UPDATE_ROW( update_row )
static SCREEN_UPDATE( qix )
{
- device_t *mc6845 = screen->machine->device(MC6845_TAG);
+ device_t *mc6845 = screen->machine().device(MC6845_TAG);
mc6845_update(mc6845, bitmap, cliprect);
return 0;
diff --git a/src/mame/video/quasar.c b/src/mame/video/quasar.c
index 6f750253431..4516b056de8 100644
--- a/src/mame/video/quasar.c
+++ b/src/mame/video/quasar.c
@@ -24,13 +24,13 @@ PALETTE_INIT( quasar )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x500);
+ machine.colortable = colortable_alloc(machine, 0x500);
/* standard 1 bit per color palette (background and sprites) */
for (i = 0; i < 8; i++)
{
rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
- colortable_palette_set_color(machine->colortable, i, color);
+ colortable_palette_set_color(machine.colortable, i, color);
}
/* effects color map */
@@ -58,45 +58,45 @@ PALETTE_INIT( quasar )
b = 0x4f * bit0 + 0xa8 * bit1;
/* intensity 0 */
- colortable_palette_set_color(machine->colortable, 0x100 + i, RGB_BLACK);
+ colortable_palette_set_color(machine.colortable, 0x100 + i, RGB_BLACK);
/* intensity 1 */
color = MAKE_RGB(r >> 2, g >> 2, b >> 2);
- colortable_palette_set_color(machine->colortable, 0x200 + i, color);
+ colortable_palette_set_color(machine.colortable, 0x200 + i, color);
/* intensity 2 */
color = MAKE_RGB((r >> 2) + (r >> 3), (g >> 2) + (g >> 3), (b >> 2) + (b >> 2));
- colortable_palette_set_color(machine->colortable, 0x300 + i, color);
+ colortable_palette_set_color(machine.colortable, 0x300 + i, color);
/* intensity 3 */
color = MAKE_RGB(r >> 1, g >> 1, b >> 1);
- colortable_palette_set_color(machine->colortable, 0x400 + i, color);
+ colortable_palette_set_color(machine.colortable, 0x400 + i, color);
}
// Address 0-2 from graphic rom
// 3-5 from color ram
// 6-8 from sprite chips (Used for priority)
for (i = 0; i < 0x200; i++)
- colortable_entry_set_value(machine->colortable, i, color_prom[i] & 0x07);
+ colortable_entry_set_value(machine.colortable, i, color_prom[i] & 0x07);
/* background for collision */
for (i = 1; i < 8; i++)
- colortable_entry_set_value(machine->colortable, 0x200 + i, 7);
- colortable_entry_set_value(machine->colortable, 0x200, 0);
+ colortable_entry_set_value(machine.colortable, 0x200 + i, 7);
+ colortable_entry_set_value(machine.colortable, 0x200, 0);
/* effects */
for (i = 0; i < 0x400; i++)
- colortable_entry_set_value(machine->colortable, 0x208 + i, 0x100 + i);
+ colortable_entry_set_value(machine.colortable, 0x208 + i, 0x100 + i);
}
VIDEO_START( quasar )
{
- quasar_state *state = machine->driver_data<quasar_state>();
+ quasar_state *state = machine.driver_data<quasar_state>();
state->effectram = auto_alloc_array(machine, UINT8, 0x400);
/* create helper bitmap */
- state->collision_background = machine->primary_screen->alloc_compatible_bitmap();
+ state->collision_background = machine.primary_screen->alloc_compatible_bitmap();
/* register save */
state->save_item(NAME(*state->collision_background));
@@ -105,7 +105,7 @@ VIDEO_START( quasar )
SCREEN_UPDATE( quasar )
{
- quasar_state *state = screen->machine->driver_data<quasar_state>();
+ quasar_state *state = screen->machine().driver_data<quasar_state>();
int offs;
bitmap_t *s2636_0_bitmap, *s2636_1_bitmap, *s2636_2_bitmap;
@@ -127,7 +127,7 @@ SCREEN_UPDATE( quasar )
*BITMAP_ADDR16(bitmap, y + oy, x + ox) = forecolor;
/* Main Screen */
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code,
state->color_ram[offs] & 0x3f,
0,0,
@@ -137,7 +137,7 @@ SCREEN_UPDATE( quasar )
/* background for Collision Detection (it can only hit certain items) */
if((state->color_ram[offs] & 7) == 0)
{
- drawgfx_opaque(state->collision_background,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(state->collision_background,cliprect,screen->machine().gfx[0],
code,
64,
0,0,
@@ -191,7 +191,7 @@ SCREEN_UPDATE( quasar )
*BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel);
/* S2636 vs. background collision detection */
- if (colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(state->collision_background, y, x)))
+ if (colortable_entry_get_value(screen->machine().colortable, *BITMAP_ADDR16(state->collision_background, y, x)))
{
if (S2636_IS_PIXEL_DRAWN(pixel0)) state->collision_register |= 0x01;
if (S2636_IS_PIXEL_DRAWN(pixel2)) state->collision_register |= 0x02;
diff --git a/src/mame/video/quizdna.c b/src/mame/video/quizdna.c
index 42f46f4bd44..ec688268cce 100644
--- a/src/mame/video/quizdna.c
+++ b/src/mame/video/quizdna.c
@@ -15,7 +15,7 @@ Video hardware
static TILE_GET_INFO( get_bg_tile_info )
{
- quizdna_state *state = machine->driver_data<quizdna_state>();
+ quizdna_state *state = machine.driver_data<quizdna_state>();
int code = state->bg_ram[tile_index*2] + state->bg_ram[tile_index*2+1]*0x100 ;
int col = state->bg_ram[tile_index*2+0x1000] & 0x7f;
@@ -27,9 +27,9 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- quizdna_state *state = machine->driver_data<quizdna_state>();
+ quizdna_state *state = machine.driver_data<quizdna_state>();
int code,col,x,y;
- UINT8 *FG = machine->region("user1")->base();
+ UINT8 *FG = machine.region("user1")->base();
x = tile_index & 0x1f;
y = FG[(tile_index >> 5) & 0x1f] & 0x3f;
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( quizdna )
{
- quizdna_state *state = machine->driver_data<quizdna_state>();
+ quizdna_state *state = machine.driver_data<quizdna_state>();
state->flipscreen = -1;
state->video_enable = 0;
state->bg_xscroll[0] = 0;
@@ -65,8 +65,8 @@ VIDEO_START( quizdna )
WRITE8_HANDLER( quizdna_bg_ram_w )
{
- quizdna_state *state = space->machine->driver_data<quizdna_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ quizdna_state *state = space->machine().driver_data<quizdna_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
state->bg_ram[offset] = data;
RAM[0x12000+offset] = data;
@@ -75,10 +75,10 @@ WRITE8_HANDLER( quizdna_bg_ram_w )
WRITE8_HANDLER( quizdna_fg_ram_w )
{
- quizdna_state *state = space->machine->driver_data<quizdna_state>();
+ quizdna_state *state = space->machine().driver_data<quizdna_state>();
int i;
int offs = offset & 0xfff;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
RAM[0x10000+offs] = data;
RAM[0x11000+offs] = data; /* mirror */
@@ -90,13 +90,13 @@ WRITE8_HANDLER( quizdna_fg_ram_w )
WRITE8_HANDLER( quizdna_bg_yscroll_w )
{
- quizdna_state *state = space->machine->driver_data<quizdna_state>();
+ quizdna_state *state = space->machine().driver_data<quizdna_state>();
tilemap_set_scrolldy( state->bg_tilemap, 255-data, 255-data+1 );
}
WRITE8_HANDLER( quizdna_bg_xscroll_w )
{
- quizdna_state *state = space->machine->driver_data<quizdna_state>();
+ quizdna_state *state = space->machine().driver_data<quizdna_state>();
int x;
state->bg_xscroll[offset] = data;
x = ~(state->bg_xscroll[0] + state->bg_xscroll[1]*0x100) & 0x1ff;
@@ -106,18 +106,18 @@ WRITE8_HANDLER( quizdna_bg_xscroll_w )
WRITE8_HANDLER( quizdna_screen_ctrl_w )
{
- quizdna_state *state = space->machine->driver_data<quizdna_state>();
+ quizdna_state *state = space->machine().driver_data<quizdna_state>();
int tmp = (data & 0x10) >> 4;
state->video_enable = data & 0x20;
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (state->flipscreen == tmp)
return;
state->flipscreen = tmp;
- flip_screen_set(space->machine, tmp);
+ flip_screen_set(space->machine(), tmp);
tilemap_set_scrolldx( state->fg_tilemap, 64, -64 +16);
}
@@ -126,21 +126,21 @@ WRITE8_HANDLER( paletteram_xBGR_RRRR_GGGG_BBBB_w )
int r,g,b,d0,d1;
int offs = offset & ~1;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
- d0 = space->machine->generic.paletteram.u8[offs];
- d1 = space->machine->generic.paletteram.u8[offs+1];
+ d0 = space->machine().generic.paletteram.u8[offs];
+ d1 = space->machine().generic.paletteram.u8[offs+1];
r = ((d1 << 1) & 0x1e) | ((d1 >> 4) & 1);
g = ((d0 >> 3) & 0x1e) | ((d1 >> 5) & 1);
b = ((d0 << 1) & 0x1e) | ((d1 >> 6) & 1);
- palette_set_color_rgb(space->machine,offs/2,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offs/2,pal5bit(r),pal5bit(g),pal5bit(b));
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- quizdna_state *state = machine->driver_data<quizdna_state>();
+ quizdna_state *state = machine.driver_data<quizdna_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -181,7 +181,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
y &= 0x1ff;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code ^ i,
col,
fx,fy,
@@ -194,14 +194,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( quizdna )
{
- quizdna_state *state = screen->machine->driver_data<quizdna_state>();
+ quizdna_state *state = screen->machine().driver_data<quizdna_state>();
if (state->video_enable)
{
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
}
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
diff --git a/src/mame/video/quizpani.c b/src/mame/video/quizpani.c
index 057c77eb15c..cd633526f0d 100644
--- a/src/mame/video/quizpani.c
+++ b/src/mame/video/quizpani.c
@@ -16,7 +16,7 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( bg_tile_info )
{
- quizpani_state *state = machine->driver_data<quizpani_state>();
+ quizpani_state *state = machine.driver_data<quizpani_state>();
int code = state->bg_videoram[tile_index];
SET_TILE_INFO(
@@ -28,7 +28,7 @@ static TILE_GET_INFO( bg_tile_info )
static TILE_GET_INFO( txt_tile_info )
{
- quizpani_state *state = machine->driver_data<quizpani_state>();
+ quizpani_state *state = machine.driver_data<quizpani_state>();
int code = state->txt_videoram[tile_index];
SET_TILE_INFO(
@@ -40,21 +40,21 @@ static TILE_GET_INFO( txt_tile_info )
WRITE16_HANDLER( quizpani_bg_videoram_w )
{
- quizpani_state *state = space->machine->driver_data<quizpani_state>();
+ quizpani_state *state = space->machine().driver_data<quizpani_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE16_HANDLER( quizpani_txt_videoram_w )
{
- quizpani_state *state = space->machine->driver_data<quizpani_state>();
+ quizpani_state *state = space->machine().driver_data<quizpani_state>();
state->txt_videoram[offset] = data;
tilemap_mark_tile_dirty(state->txt_tilemap, offset);
}
WRITE16_HANDLER( quizpani_tilesbank_w )
{
- quizpani_state *state = space->machine->driver_data<quizpani_state>();
+ quizpani_state *state = space->machine().driver_data<quizpani_state>();
if (ACCESSING_BITS_0_7)
{
if(state->txtbank != (data & 0x30)>>4)
@@ -73,7 +73,7 @@ WRITE16_HANDLER( quizpani_tilesbank_w )
VIDEO_START( quizpani )
{
- quizpani_state *state = machine->driver_data<quizpani_state>();
+ quizpani_state *state = machine.driver_data<quizpani_state>();
state->bg_tilemap = tilemap_create(machine, bg_tile_info, bg_scan,16,16,256,32);
state->txt_tilemap = tilemap_create(machine, txt_tile_info,bg_scan,16,16,256,32);
tilemap_set_transparent_pen(state->txt_tilemap,15);
@@ -81,7 +81,7 @@ VIDEO_START( quizpani )
SCREEN_UPDATE( quizpani )
{
- quizpani_state *state = screen->machine->driver_data<quizpani_state>();
+ quizpani_state *state = screen->machine().driver_data<quizpani_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollreg[0] - 64);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrollreg[1] + 16);
tilemap_set_scrollx(state->txt_tilemap, 0, state->scrollreg[2] - 64);
diff --git a/src/mame/video/raiden.c b/src/mame/video/raiden.c
index d301f6abb57..11b8a720b67 100644
--- a/src/mame/video/raiden.c
+++ b/src/mame/video/raiden.c
@@ -6,21 +6,21 @@
WRITE16_HANDLER( raiden_background_w )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
COMBINE_DATA(&state->back_data[offset]);
tilemap_mark_tile_dirty(state->bg_layer, offset);
}
WRITE16_HANDLER( raiden_foreground_w )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
COMBINE_DATA(&state->fore_data[offset]);
tilemap_mark_tile_dirty(state->fg_layer, offset);
}
WRITE16_HANDLER( raiden_text_w )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->tx_layer, offset);
@@ -28,7 +28,7 @@ WRITE16_HANDLER( raiden_text_w )
static TILE_GET_INFO( get_back_tile_info )
{
- raiden_state *state = machine->driver_data<raiden_state>();
+ raiden_state *state = machine.driver_data<raiden_state>();
int tile=state->back_data[tile_index];
int color=tile >> 12;
@@ -43,7 +43,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- raiden_state *state = machine->driver_data<raiden_state>();
+ raiden_state *state = machine.driver_data<raiden_state>();
int tile=state->fore_data[tile_index];
int color=tile >> 12;
@@ -58,7 +58,7 @@ static TILE_GET_INFO( get_fore_tile_info )
static TILE_GET_INFO( get_text_tile_info )
{
- raiden_state *state = machine->driver_data<raiden_state>();
+ raiden_state *state = machine.driver_data<raiden_state>();
UINT16 *videoram = state->videoram;
int tiledata = videoram[tile_index];
int tile = (tiledata & 0xff) | ((tiledata >> 6) & 0x300);
@@ -73,7 +73,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( raiden )
{
- raiden_state *state = machine->driver_data<raiden_state>();
+ raiden_state *state = machine.driver_data<raiden_state>();
state->bg_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_cols, 16,16,32,32);
state->fg_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_cols,16,16,32,32);
state->tx_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_cols,8,8,32,32);
@@ -85,7 +85,7 @@ VIDEO_START( raiden )
VIDEO_START( raidena )
{
- raiden_state *state = machine->driver_data<raiden_state>();
+ raiden_state *state = machine.driver_data<raiden_state>();
state->bg_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_cols, 16,16,32,32);
state->fg_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_cols,16,16,32,32);
state->tx_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -97,32 +97,32 @@ VIDEO_START( raidena )
WRITE16_HANDLER( raiden_control_w )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
/* All other bits unknown - could be playfield enables */
/* Flipscreen */
if (offset==3 && ACCESSING_BITS_0_7) {
state->flipscreen=data&0x2;
- tilemap_set_flip_all(space->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
}
WRITE16_HANDLER( raidena_control_w )
{
- raiden_state *state = space->machine->driver_data<raiden_state>();
+ raiden_state *state = space->machine().driver_data<raiden_state>();
/* raidena uses 0x40 instead of 0x02 */
/* Flipscreen */
if (offset==3 && ACCESSING_BITS_0_7) {
state->flipscreen=data&0x40;
- tilemap_set_flip_all(space->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri_mask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri_mask)
{
- raiden_state *state = machine->driver_data<raiden_state>();
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ raiden_state *state = machine.driver_data<raiden_state>();
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
int offs,fx,fy,x,y,color,sprite;
for (offs = 0x1000/2-4;offs >= 0;offs -= 4)
@@ -147,7 +147,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (fy) fy=0; else fy=1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite,
color,fx,fy,x,y,15);
}
@@ -155,7 +155,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( raiden )
{
- raiden_state *state = screen->machine->driver_data<raiden_state>();
+ raiden_state *state = screen->machine().driver_data<raiden_state>();
/* Setup the tilemaps, alternate version has different scroll positions */
if (!state->alternate) {
tilemap_set_scrollx( state->bg_layer,0, state->scroll_ram[0]);
@@ -173,11 +173,11 @@ SCREEN_UPDATE( raiden )
tilemap_draw(bitmap,cliprect,state->bg_layer,0,0);
/* Draw sprites underneath foreground */
- draw_sprites(screen->machine,bitmap,cliprect,0x40);
+ draw_sprites(screen->machine(),bitmap,cliprect,0x40);
tilemap_draw(bitmap,cliprect,state->fg_layer,0,0);
/* Rest of sprites */
- draw_sprites(screen->machine,bitmap,cliprect,0x80);
+ draw_sprites(screen->machine(),bitmap,cliprect,0x80);
/* Text layer */
tilemap_draw(bitmap,cliprect,state->tx_layer,0,0);
diff --git a/src/mame/video/rainbow.c b/src/mame/video/rainbow.c
index b29c7b85701..30d966b49fe 100644
--- a/src/mame/video/rainbow.c
+++ b/src/mame/video/rainbow.c
@@ -14,7 +14,7 @@
WRITE16_HANDLER( rainbow_spritectrl_w )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
if (offset == 0)
{
@@ -28,7 +28,7 @@ WRITE16_HANDLER( rainbow_spritectrl_w )
WRITE16_HANDLER( jumping_spritectrl_w )
{
- rainbow_state *state = space->machine->driver_data<rainbow_state>();
+ rainbow_state *state = space->machine().driver_data<rainbow_state>();
if (offset == 0)
{
@@ -44,7 +44,7 @@ WRITE16_HANDLER( jumping_spritectrl_w )
SCREEN_UPDATE( rainbow )
{
- rainbow_state *state = screen->machine->driver_data<rainbow_state>();
+ rainbow_state *state = screen->machine().driver_data<rainbow_state>();
int layer[2];
pc080sn_tilemap_update(state->pc080sn);
@@ -52,7 +52,7 @@ SCREEN_UPDATE( rainbow )
layer[0] = 0;
layer[1] = 1;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[1], 0, 2);
@@ -74,7 +74,7 @@ the Y settings are active low.
VIDEO_START( jumping )
{
- rainbow_state *state = machine->driver_data<rainbow_state>();
+ rainbow_state *state = machine.driver_data<rainbow_state>();
pc080sn_set_trans_pen(state->pc080sn, 1, 15);
@@ -89,7 +89,7 @@ VIDEO_START( jumping )
SCREEN_UPDATE( jumping )
{
- rainbow_state *state = screen->machine->driver_data<rainbow_state>();
+ rainbow_state *state = screen->machine().driver_data<rainbow_state>();
UINT16 *spriteram = state->spriteram;
int offs, layer[2];
int sprite_colbank = (state->sprite_ctrl & 0xe0) >> 1;
@@ -102,7 +102,7 @@ SCREEN_UPDATE( jumping )
layer[0] = 0;
layer[1] = 1;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
@@ -110,7 +110,7 @@ SCREEN_UPDATE( jumping )
for (offs = state->spriteram_size / 2 - 8; offs >= 0; offs -= 8)
{
int tile = spriteram[offs];
- if (tile < screen->machine->gfx[1]->total_elements)
+ if (tile < screen->machine().gfx[1]->total_elements)
{
int sx,sy,color,data1;
@@ -122,7 +122,7 @@ SCREEN_UPDATE( jumping )
data1 = spriteram[offs + 3];
color = (spriteram[offs + 4] & 0x0f) | sprite_colbank;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
color,
data1 & 0x40, data1 & 0x80,
diff --git a/src/mame/video/rallyx.c b/src/mame/video/rallyx.c
index 274e95a5b73..ad2f663d0d2 100644
--- a/src/mame/video/rallyx.c
+++ b/src/mame/video/rallyx.c
@@ -69,7 +69,7 @@ PALETTE_INIT( rallyx )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -94,7 +94,7 @@ PALETTE_INIT( rallyx )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -104,12 +104,12 @@ PALETTE_INIT( rallyx )
for (i = 0x000; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bullets use colors 0x10-0x13 */
for (i = 0x100; i < 0x104; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x100) | 0x10);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x100) | 0x10);
}
@@ -134,7 +134,7 @@ PALETTE_INIT( jungler )
2, resistances_b, bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x60);
+ machine.colortable = colortable_alloc(machine, 0x60);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -159,7 +159,7 @@ PALETTE_INIT( jungler )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* star pens */
@@ -183,7 +183,7 @@ PALETTE_INIT( jungler )
bit1 = ((i - 0x20) >> 5) & 0x01;
b = combine_2_weights(bweights_star, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -193,16 +193,16 @@ PALETTE_INIT( jungler )
for (i = 0x000; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bullets use colors 0x10-0x13 */
for (i = 0x100; i < 0x104; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x100) | 0x10);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x100) | 0x10);
/* stars */
for (i = 0x104; i < 0x144; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x104) + 0x20);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x104) + 0x20);
}
@@ -220,9 +220,9 @@ static TILEMAP_MAPPER( fg_tilemap_scan )
}
-INLINE void rallyx_get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int ram_offs)
+INLINE void rallyx_get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int ram_offs)
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
UINT8 attr = state->videoram[ram_offs + tile_index + 0x800];
tileinfo->category = (attr & 0x20) >> 5;
SET_TILE_INFO(
@@ -243,9 +243,9 @@ static TILE_GET_INFO( rallyx_fg_get_tile_info )
}
-INLINE void locomotn_get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs)
+INLINE void locomotn_get_tile_info(running_machine &machine,tile_data *tileinfo,int tile_index,int ram_offs)
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
UINT8 attr = state->videoram[ram_offs + tile_index + 0x800];
int code = state->videoram[ram_offs + tile_index];
code = (code & 0x7f) + 2 * (attr & 0x40) + 2 * (code & 0x80);
@@ -275,9 +275,9 @@ static TILE_GET_INFO( locomotn_fg_get_tile_info )
***************************************************************************/
-static void calculate_star_field( running_machine *machine )
+static void calculate_star_field( running_machine &machine )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int generator;
int x, y;
@@ -315,9 +315,9 @@ static void calculate_star_field( running_machine *machine )
}
}
-static void rallyx_video_start_common( running_machine *machine )
+static void rallyx_video_start_common( running_machine &machine )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int i;
state->spriteram = state->videoram + 0x00;
@@ -326,10 +326,10 @@ static void rallyx_video_start_common( running_machine *machine )
state->radary = state->radarx + 0x800;
for (i = 0; i < 16; i++)
- machine->shadow_table[i] = i + 16;
+ machine.shadow_table[i] = i + 16;
for (i = 16; i < 32; i++)
- machine->shadow_table[i] = i;
+ machine.shadow_table[i] = i;
for (i = 0; i < 3; i++)
state->drawmode_table[i] = DRAWMODE_SHADOW;
@@ -339,7 +339,7 @@ static void rallyx_video_start_common( running_machine *machine )
VIDEO_START( rallyx )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
state->bg_tilemap = tilemap_create(machine, rallyx_bg_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, rallyx_fg_get_tile_info, fg_tilemap_scan, 8, 8, 8, 32);
@@ -355,7 +355,7 @@ VIDEO_START( rallyx )
VIDEO_START( jungler )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
state->bg_tilemap = tilemap_create(machine, rallyx_bg_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, rallyx_fg_get_tile_info, fg_tilemap_scan, 8, 8, 8, 32);
@@ -369,13 +369,13 @@ VIDEO_START( jungler )
VIDEO_START( locomotn )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
state->bg_tilemap = tilemap_create(machine, locomotn_bg_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, locomotn_fg_get_tile_info, fg_tilemap_scan, 8, 8, 8, 32);
/* handle reduced visible area in some games */
- if (machine->primary_screen->visible_area().max_x == 32 * 8 - 1)
+ if (machine.primary_screen->visible_area().max_x == 32 * 8 - 1)
{
tilemap_set_scrolldx(state->bg_tilemap, 0, 32);
tilemap_set_scrolldx(state->fg_tilemap, 0, 32);
@@ -390,13 +390,13 @@ VIDEO_START( locomotn )
VIDEO_START( commsega )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
state->bg_tilemap = tilemap_create(machine, locomotn_bg_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, locomotn_fg_get_tile_info, fg_tilemap_scan, 8, 8, 8, 32);
/* handle reduced visible area in some games */
- if (machine->primary_screen->visible_area().max_x == 32 * 8 - 1)
+ if (machine.primary_screen->visible_area().max_x == 32 * 8 - 1)
{
tilemap_set_scrolldx(state->bg_tilemap, 0, 32);
tilemap_set_scrolldx(state->fg_tilemap, 0, 32);
@@ -418,7 +418,7 @@ VIDEO_START( commsega )
WRITE8_HANDLER( rallyx_videoram_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
state->videoram[offset] = data;
if (offset & 0x400)
@@ -429,24 +429,24 @@ WRITE8_HANDLER( rallyx_videoram_w )
WRITE8_HANDLER( rallyx_scrollx_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( rallyx_scrolly_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( tactcian_starson_w )
{
- rallyx_state *state = space->machine->driver_data<rallyx_state>();
+ rallyx_state *state = space->machine().driver_data<rallyx_state>();
state->stars_enable = data & 1;
}
-static void plot_star( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int x, int y, int color )
+static void plot_star( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x, int y, int color )
{
if (y < cliprect->min_y || y > cliprect->max_y ||
x < cliprect->min_x || x > cliprect->max_x)
@@ -458,13 +458,13 @@ static void plot_star( running_machine *machine, bitmap_t *bitmap, const rectang
if (flip_screen_y_get(machine))
y = 255 - y;
- if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0)
+ if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0)
*BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + color;
}
-static void draw_stars( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int offs;
for (offs = 0; offs < state->total_stars; offs++)
@@ -478,9 +478,9 @@ static void draw_stars( running_machine *machine, bitmap_t *bitmap, const rectan
}
-static void rallyx_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
+static void rallyx_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -495,19 +495,19 @@ static void rallyx_draw_sprites( running_machine *machine, bitmap_t *bitmap, con
if (flip_screen_get(machine))
sx -= 2 * displacement;
- pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transmask(bitmap,cliprect,machine.gfx[1],
(spriteram[offs] & 0xfc) >> 2,
color,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,0x02,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ machine.priority_bitmap,0x02,
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
-static void locomotn_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
+static void locomotn_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -519,19 +519,19 @@ static void locomotn_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
int color = spriteram_2[offs + 1] & 0x3f;
int flip = spriteram[offs] & 2;
- pdrawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transmask(bitmap,cliprect,machine.gfx[1],
((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1),
color,
flip,flip,
sx,sy,
- machine->priority_bitmap,0x02,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ machine.priority_bitmap,0x02,
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
-static void rallyx_draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
+static void rallyx_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int offs;
for (offs = state->spriteram_base; offs < 0x20; offs++)
@@ -544,25 +544,25 @@ static void rallyx_draw_bullets( running_machine *machine, bitmap_t *bitmap, con
x -= 3;
if (transpen)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
((state->radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07,
0,
0,0,
x,y,
3);
else
- drawgfx_transtable(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transtable(bitmap,cliprect,machine.gfx[2],
((state->radarattr[offs & 0x0f] & 0x0e) >> 1) ^ 0x07,
0,
0,0,
x,y,
- state->drawmode_table,machine->shadow_table);
+ state->drawmode_table,machine.shadow_table);
}
}
-static void jungler_draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
+static void jungler_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int offs;
for (offs = state->spriteram_base; offs < 0x20; offs++)
@@ -573,25 +573,25 @@ static void jungler_draw_bullets( running_machine *machine, bitmap_t *bitmap, co
y = 253 - state->radary[offs];
if (transpen)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
(state->radarattr[offs & 0x0f] & 0x07) ^ 0x07,
0,
0,0,
x,y,
3);
else
- drawgfx_transtable(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transtable(bitmap,cliprect,machine.gfx[2],
(state->radarattr[offs & 0x0f] & 0x07) ^ 0x07,
0,
0,0,
x,y,
- state->drawmode_table,machine->shadow_table);
+ state->drawmode_table,machine.shadow_table);
}
}
-static void locomotn_draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
+static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
{
- rallyx_state *state = machine->driver_data<rallyx_state>();
+ rallyx_state *state = machine.driver_data<rallyx_state>();
int offs;
for (offs = state->spriteram_base; offs < 0x20; offs++)
@@ -610,32 +610,32 @@ static void locomotn_draw_bullets( running_machine *machine, bitmap_t *bitmap, c
y = 252 - state->radary[offs];
if (transpen)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
(state->radarattr[offs & 0x0f] & 0x07) ^ 0x07,
0,
0,0,
x,y,
3);
else
- drawgfx_transtable(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transtable(bitmap,cliprect,machine.gfx[2],
(state->radarattr[offs & 0x0f] & 0x07) ^ 0x07,
0,
0,0,
x,y,
- state->drawmode_table,machine->shadow_table);
+ state->drawmode_table,machine.shadow_table);
}
}
SCREEN_UPDATE( rallyx )
{
- rallyx_state *state = screen->machine->driver_data<rallyx_state>();
+ rallyx_state *state = screen->machine().driver_data<rallyx_state>();
/* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
the screen, and clip it to only the position where it is supposed to be shown */
rectangle fg_clip = *cliprect;
rectangle bg_clip = *cliprect;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
bg_clip.min_x = 8 * 8;
fg_clip.max_x = 8 * 8 - 1;
@@ -646,16 +646,16 @@ SCREEN_UPDATE( rallyx )
fg_clip.min_x = 28 * 8;
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, &bg_clip, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, &fg_clip, state->fg_tilemap, 0, 0);
tilemap_draw(bitmap, &bg_clip, state->bg_tilemap, 1, 1);
tilemap_draw(bitmap, &fg_clip, state->fg_tilemap, 1, 1);
- rallyx_draw_bullets(screen->machine, bitmap, cliprect, TRUE);
- rallyx_draw_sprites(screen->machine, bitmap, cliprect, 1);
- rallyx_draw_bullets(screen->machine, bitmap, cliprect, FALSE);
+ rallyx_draw_bullets(screen->machine(), bitmap, cliprect, TRUE);
+ rallyx_draw_sprites(screen->machine(), bitmap, cliprect, 1);
+ rallyx_draw_bullets(screen->machine(), bitmap, cliprect, FALSE);
return 0;
}
@@ -663,13 +663,13 @@ SCREEN_UPDATE( rallyx )
SCREEN_UPDATE( jungler )
{
- rallyx_state *state = screen->machine->driver_data<rallyx_state>();
+ rallyx_state *state = screen->machine().driver_data<rallyx_state>();
/* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
the screen, and clip it to only the position where it is supposed to be shown */
rectangle fg_clip = *cliprect;
rectangle bg_clip = *cliprect;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
bg_clip.min_x = 8 * 8;
fg_clip.max_x = 8 * 8 - 1;
@@ -680,7 +680,7 @@ SCREEN_UPDATE( jungler )
fg_clip.min_x = 28 * 8;
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* tile priority doesn't seem to be supported in Jungler */
tilemap_draw(bitmap,&bg_clip, state->bg_tilemap, 0, 0);
@@ -688,12 +688,12 @@ SCREEN_UPDATE( jungler )
tilemap_draw(bitmap,&bg_clip, state->bg_tilemap, 1, 0);
tilemap_draw(bitmap,&fg_clip, state->fg_tilemap, 1, 0);
- jungler_draw_bullets(screen->machine, bitmap, cliprect, TRUE);
- rallyx_draw_sprites(screen->machine, bitmap, cliprect, 0);
- jungler_draw_bullets(screen->machine, bitmap, cliprect, FALSE);
+ jungler_draw_bullets(screen->machine(), bitmap, cliprect, TRUE);
+ rallyx_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ jungler_draw_bullets(screen->machine(), bitmap, cliprect, FALSE);
if (state->stars_enable)
- draw_stars(screen->machine, bitmap, cliprect);
+ draw_stars(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -701,13 +701,13 @@ SCREEN_UPDATE( jungler )
SCREEN_UPDATE( locomotn )
{
- rallyx_state *state = screen->machine->driver_data<rallyx_state>();
+ rallyx_state *state = screen->machine().driver_data<rallyx_state>();
/* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
the screen, and clip it to only the position where it is supposed to be shown */
rectangle fg_clip = *cliprect;
rectangle bg_clip = *cliprect;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
/* handle reduced visible area in some games */
if (screen->visible_area().max_x == 32 * 8 - 1)
@@ -727,19 +727,19 @@ SCREEN_UPDATE( locomotn )
fg_clip.min_x = 28 * 8;
}
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, &bg_clip, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, &fg_clip, state->fg_tilemap, 0, 0);
tilemap_draw(bitmap, &bg_clip, state->bg_tilemap, 1, 1);
tilemap_draw(bitmap, &fg_clip, state->fg_tilemap, 1, 1);
- locomotn_draw_bullets(screen->machine, bitmap, cliprect, TRUE);
- locomotn_draw_sprites(screen->machine, bitmap, cliprect, 0);
- locomotn_draw_bullets(screen->machine, bitmap, cliprect, FALSE);
+ locomotn_draw_bullets(screen->machine(), bitmap, cliprect, TRUE);
+ locomotn_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ locomotn_draw_bullets(screen->machine(), bitmap, cliprect, FALSE);
if (state->stars_enable)
- draw_stars(screen->machine, bitmap, cliprect);
+ draw_stars(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/rampart.c b/src/mame/video/rampart.c
index fa08ff13909..8e556d843d4 100644
--- a/src/mame/video/rampart.c
+++ b/src/mame/video/rampart.c
@@ -9,7 +9,7 @@
#include "includes/rampart.h"
-static void rampart_bitmap_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
/*************************************
*
@@ -78,7 +78,7 @@ SCREEN_UPDATE( rampart )
int x, y, r;
/* draw the playfield */
- rampart_bitmap_render(screen->machine, bitmap, cliprect);
+ rampart_bitmap_render(screen->machine(), bitmap, cliprect);
/* draw and merge the MO */
mobitmap = atarimo_render(0, cliprect, &rectlist);
@@ -108,9 +108,9 @@ SCREEN_UPDATE( rampart )
*
*************************************/
-static void rampart_bitmap_render(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- rampart_state *state = machine->driver_data<rampart_state>();
+ rampart_state *state = machine.driver_data<rampart_state>();
int x, y;
/* update any dirty scanlines */
diff --git a/src/mame/video/rastan.c b/src/mame/video/rastan.c
index 402f6a9340d..f76cb9ac279 100644
--- a/src/mame/video/rastan.c
+++ b/src/mame/video/rastan.c
@@ -13,7 +13,7 @@
WRITE16_HANDLER( rastan_spritectrl_w )
{
- rastan_state *state = space->machine->driver_data<rastan_state>();
+ rastan_state *state = space->machine().driver_data<rastan_state>();
/* bits 5-7 are the sprite palette bank */
pc090oj_set_sprite_ctrl(state->pc090oj, (data & 0xe0) >> 5);
@@ -21,19 +21,19 @@ WRITE16_HANDLER( rastan_spritectrl_w )
/* bit 4 unused */
/* bits 0 and 1 are coin lockout */
- coin_lockout_w(space->machine, 1, ~data & 0x01);
- coin_lockout_w(space->machine, 0, ~data & 0x02);
+ coin_lockout_w(space->machine(), 1, ~data & 0x01);
+ coin_lockout_w(space->machine(), 0, ~data & 0x02);
/* bits 2 and 3 are the coin counters */
- coin_counter_w(space->machine, 1, data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
}
/***************************************************************************/
SCREEN_UPDATE( rastan )
{
- rastan_state *state = screen->machine->driver_data<rastan_state>();
+ rastan_state *state = screen->machine().driver_data<rastan_state>();
int layer[2];
pc080sn_tilemap_update(state->pc080sn);
@@ -41,7 +41,7 @@ SCREEN_UPDATE( rastan )
layer[0] = 0;
layer[1] = 1;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
pc080sn_tilemap_draw(state->pc080sn, bitmap, cliprect, layer[1], 0, 2);
diff --git a/src/mame/video/rdpblend.h b/src/mame/video/rdpblend.h
index dcae0855660..ad3dcb5bead 100644
--- a/src/mame/video/rdpblend.h
+++ b/src/mame/video/rdpblend.h
@@ -27,7 +27,7 @@ class Blender
void SetOtherModes(OtherModes* other_modes) { m_other_modes = other_modes; }
void SetMiscState(MiscState* misc_state) { m_misc_state = misc_state; }
- void SetMachine(running_machine* machine) { m_machine = machine; }
+ void SetMachine(running_machine& machine) { m_machine = &machine; }
void SetProcessor(Processor* rdp) { m_rdp = rdp; }
void SetBlendEnable(bool enable) { m_blend_enable = enable; }
diff --git a/src/mame/video/rdpspn16.c b/src/mame/video/rdpspn16.c
index 155f9042b30..b5ab87826d6 100644
--- a/src/mame/video/rdpspn16.c
+++ b/src/mame/video/rdpspn16.c
@@ -34,7 +34,7 @@ void Processor::RenderSpans(int start, int end, int tilenum, bool flip)
for(int i = start; i <= end; i++)
{
- m_span[i].SetMachine(m_machine);
+ m_span[i].SetMachine(*m_machine);
switch(m_other_modes.cycle_type)
{
case CYCLE_TYPE_1: m_span[i].Draw1Cycle(i, tilenum, flip); break;
@@ -67,11 +67,11 @@ void Span::Dump()
printf("\n");
}
-void Span::SetMachine(running_machine *machine)
+void Span::SetMachine(running_machine &machine)
{
- _n64_state *state = machine->driver_data<_n64_state>();
+ _n64_state *state = machine.driver_data<_n64_state>();
- m_machine = machine;
+ m_machine = &machine;
m_rdp = &state->m_rdp;
m_other_modes = m_rdp->GetOtherModes();
m_misc_state = m_rdp->GetMiscState();
diff --git a/src/mame/video/rdpspn16.h b/src/mame/video/rdpspn16.h
index 0b0c19f5f42..8a3f0c7db22 100644
--- a/src/mame/video/rdpspn16.h
+++ b/src/mame/video/rdpspn16.h
@@ -35,7 +35,7 @@ class Span
Span() { }
void Dump();
- void SetMachine(running_machine* machine);
+ void SetMachine(running_machine& machine);
void Draw1Cycle(int index, int tilenum, bool flip);
void Draw2Cycle(int index, int tilenum, bool flip);
diff --git a/src/mame/video/rdptpipe.c b/src/mame/video/rdptpipe.c
index 1d3fd16e5c9..2a2ac82044f 100644
--- a/src/mame/video/rdptpipe.c
+++ b/src/mame/video/rdptpipe.c
@@ -10,11 +10,11 @@ namespace RDP
#define RELATIVE(x, y) ((((x) >> 3) - (y)) << 3) | (x & 7);
-void TexturePipe::SetMachine(running_machine *machine)
+void TexturePipe::SetMachine(running_machine &machine)
{
- _n64_state *state = machine->driver_data<_n64_state>();
+ _n64_state *state = machine.driver_data<_n64_state>();
- m_machine = machine;
+ m_machine = &machine;
m_rdp = &state->m_rdp;
m_other_modes = m_rdp->GetOtherModes();
m_misc_state = m_rdp->GetMiscState();
diff --git a/src/mame/video/rdptpipe.h b/src/mame/video/rdptpipe.h
index dbdbae0a5d6..35c081aa73b 100644
--- a/src/mame/video/rdptpipe.h
+++ b/src/mame/video/rdptpipe.h
@@ -37,7 +37,7 @@ class TexturePipe
void LOD2Cycle(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1, INT32* t2);
void LOD2CycleLimited(INT32* sss, INT32* sst, INT32 s, INT32 t, INT32 w, INT32 dsinc, INT32 dtinc, INT32 dwinc, INT32 prim_tile, INT32* t1);
- void SetMachine(running_machine* machine);
+ void SetMachine(running_machine& machine);
bool m_start_span;
INT32 m_precomp_s;
diff --git a/src/mame/video/rdptri.h b/src/mame/video/rdptri.h
index 65fddb82ddc..0415549058c 100644
--- a/src/mame/video/rdptri.h
+++ b/src/mame/video/rdptri.h
@@ -16,9 +16,9 @@ class Triangle
{
public:
Triangle() { fatalerror("Please don't use the default constructor for N64::RDP::Triangle\n"); }
- Triangle(running_machine *machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip);
+ Triangle(running_machine &machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip);
- void InitFromData(running_machine* machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip);
+ void InitFromData(running_machine& machine, bool shade, bool texture, bool zbuffer, bool rect, bool flip);
void Draw();
private:
diff --git a/src/mame/video/realbrk.c b/src/mame/video/realbrk.c
index 0001d4d0ef9..2fdf61985e3 100644
--- a/src/mame/video/realbrk.c
+++ b/src/mame/video/realbrk.c
@@ -25,13 +25,13 @@
WRITE16_HANDLER( realbrk_flipscreen_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0001);
- coin_counter_w(space->machine, 1, data & 0x0004);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
+ coin_counter_w(space->machine(), 1, data & 0x0004);
- flip_screen_set(space->machine, data & 0x0080);
+ flip_screen_set(space->machine(), data & 0x0080);
}
if (ACCESSING_BITS_8_15)
@@ -42,7 +42,7 @@ WRITE16_HANDLER( realbrk_flipscreen_w )
WRITE16_HANDLER( dai2kaku_flipscreen_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
state->disable_video = 0;
}
@@ -72,7 +72,7 @@ WRITE16_HANDLER( dai2kaku_flipscreen_w )
static TILE_GET_INFO( get_tile_info_0 )
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
UINT16 attr = state->vram_0[tile_index * 2 + 0];
UINT16 code = state->vram_0[tile_index * 2 + 1];
SET_TILE_INFO(
@@ -84,7 +84,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
UINT16 attr = state->vram_1[tile_index * 2 + 0];
UINT16 code = state->vram_1[tile_index * 2 + 1];
SET_TILE_INFO(
@@ -96,14 +96,14 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE16_HANDLER( realbrk_vram_0_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0,offset/2);
}
WRITE16_HANDLER( realbrk_vram_1_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1,offset/2);
}
@@ -124,7 +124,7 @@ WRITE16_HANDLER( realbrk_vram_1_w )
static TILE_GET_INFO( get_tile_info_2 )
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
UINT16 code = state->vram_2[tile_index];
SET_TILE_INFO(
1,
@@ -135,7 +135,7 @@ static TILE_GET_INFO( get_tile_info_2 )
WRITE16_HANDLER( realbrk_vram_2_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
COMBINE_DATA(&state->vram_2[offset]);
tilemap_mark_tile_dirty(state->tilemap_2,offset);
}
@@ -152,7 +152,7 @@ WRITE16_HANDLER( realbrk_vram_2_w )
VIDEO_START(realbrk)
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
/* Backgrounds */
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 16, 16, 0x40, 0x20);
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 16, 16, 0x40, 0x20);
@@ -164,8 +164,8 @@ VIDEO_START(realbrk)
tilemap_set_transparent_pen(state->tilemap_1,0);
tilemap_set_transparent_pen(state->tilemap_2,0);
- state->tmpbitmap0 = auto_bitmap_alloc(machine,32,32, machine->primary_screen->format());
- state->tmpbitmap1 = auto_bitmap_alloc(machine,32,32, machine->primary_screen->format());
+ state->tmpbitmap0 = auto_bitmap_alloc(machine,32,32, machine.primary_screen->format());
+ state->tmpbitmap1 = auto_bitmap_alloc(machine,32,32, machine.primary_screen->format());
}
/***************************************************************************
@@ -213,14 +213,14 @@ VIDEO_START(realbrk)
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
rectangle spritetile_clip;
spritetile_clip.min_x = 0;
@@ -302,7 +302,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
bitmap_fill( state->tmpbitmap0, &spritetile_clip , 0);
bitmap_fill( state->tmpbitmap1, &spritetile_clip , 0);
- drawgfxzoom_transpen( state->tmpbitmap0,&spritetile_clip,machine->gfx[gfx],
+ drawgfxzoom_transpen( state->tmpbitmap0,&spritetile_clip,machine.gfx[gfx],
code++,
color,
flipx, flipy,
@@ -364,7 +364,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
break;
default:
- drawgfxzoom_transpen( bitmap,cliprect,machine->gfx[gfx],
+ drawgfxzoom_transpen( bitmap,cliprect,machine.gfx[gfx],
code++,
color,
flipx, flipy,
@@ -380,14 +380,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
/* DaiDaiKakumei */
/* layer : 0== bghigh<spr 1== bglow<spr<bghigh 2==spr<bglow 3==boarder */
-static void dai2kaku_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int layer)
+static void dai2kaku_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int layer)
{
- realbrk_state *state = machine->driver_data<realbrk_state>();
+ realbrk_state *state = machine.driver_data<realbrk_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
- int max_x = machine->primary_screen->width();
- int max_y = machine->primary_screen->height();
+ int max_x = machine.primary_screen->width();
+ int max_y = machine.primary_screen->height();
for ( offs = 0x3000/2; offs < 0x3600/2; offs += 2/2 )
{
@@ -446,7 +446,7 @@ static void dai2kaku_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
int scalex = (sx + (x + 1) * xdim) / 0x10000 - currx;
int scaley = (sy + (y + 1) * ydim) / 0x10000 - curry;
- drawgfxzoom_transpen( bitmap,cliprect,machine->gfx[gfx],
+ drawgfxzoom_transpen( bitmap,cliprect,machine.gfx[gfx],
code++,
color,
flipx, flipy,
@@ -487,7 +487,7 @@ static void dai2kaku_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
WRITE16_HANDLER( realbrk_vregs_w )
{
- realbrk_state *state = space->machine->driver_data<realbrk_state>();
+ realbrk_state *state = space->machine().driver_data<realbrk_state>();
UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
if (new_data != old_data)
@@ -499,7 +499,7 @@ WRITE16_HANDLER( realbrk_vregs_w )
SCREEN_UPDATE(realbrk)
{
- realbrk_state *state = screen->machine->driver_data<realbrk_state>();
+ realbrk_state *state = screen->machine().driver_data<realbrk_state>();
int layers_ctrl = -1;
tilemap_set_scrolly(state->tilemap_0, 0, state->vregs[0x0/2]);
@@ -509,20 +509,20 @@ SCREEN_UPDATE(realbrk)
tilemap_set_scrollx(state->tilemap_1, 0, state->vregs[0x6/2]);
#ifdef MAME_DEBUG
-if ( input_code_pressed(screen->machine, KEYCODE_Z) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (state->disable_video)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
else
@@ -531,7 +531,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->tilemap_1,0,0);
if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->tilemap_0,0,0);
- if (layers_ctrl & 8) draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 8) draw_sprites(screen->machine(),bitmap,cliprect);
if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->tilemap_2,0,0);
@@ -542,7 +542,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
/* DaiDaiKakumei */
SCREEN_UPDATE(dai2kaku)
{
- realbrk_state *state = screen->machine->driver_data<realbrk_state>();
+ realbrk_state *state = screen->machine().driver_data<realbrk_state>();
int layers_ctrl = -1;
int offs, bgx0, bgy0, bgx1, bgy1;
@@ -580,20 +580,20 @@ SCREEN_UPDATE(dai2kaku)
tilemap_set_scrolly( state->tilemap_1, 0, bgy1 );
#ifdef MAME_DEBUG
-if ( input_code_pressed(screen->machine, KEYCODE_Z) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (state->disable_video)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
else
@@ -602,7 +602,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
// spr 0
- if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine,bitmap,cliprect,2);
+ if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,2);
// bglow
if( state->vregs[8/2] & (0x8000)){
@@ -612,7 +612,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
}
// spr 1
- if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine,bitmap,cliprect,1);
+ if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,1);
// bghigh
if( state->vregs[8/2] & (0x8000)){
@@ -622,7 +622,7 @@ if ( input_code_pressed(screen->machine, KEYCODE_Z) )
}
// spr 2
- if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine,bitmap,cliprect,0);
+ if (layers_ctrl & 8) dai2kaku_draw_sprites(screen->machine(),bitmap,cliprect,0);
// fix
if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->tilemap_2,0,0);
diff --git a/src/mame/video/redalert.c b/src/mame/video/redalert.c
index b2d314c5b0b..800a047c0a6 100644
--- a/src/mame/video/redalert.c
+++ b/src/mame/video/redalert.c
@@ -24,7 +24,7 @@
WRITE8_HANDLER( redalert_bitmap_videoram_w )
{
- redalert_state *state = space->machine->driver_data<redalert_state>();
+ redalert_state *state = space->machine().driver_data<redalert_state>();
state->bitmap_videoram[offset ] = data;
state->bitmap_colorram[offset >> 3] = *state->bitmap_color & 0x07;
}
@@ -37,7 +37,7 @@ WRITE8_HANDLER( redalert_bitmap_videoram_w )
*
*************************************/
-static void get_pens(running_machine *machine, pen_t *pens)
+static void get_pens(running_machine &machine, pen_t *pens)
{
static const int resistances_bitmap[] = { 100 };
static const int resistances_charmap_rg[] = { 390, 220, 180 };
@@ -52,7 +52,7 @@ static void get_pens(running_machine *machine, pen_t *pens)
double charmap_b_weights[2];
double back_r_weight[1];
double back_gb_weight[1];
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
scaler = compute_resistor_weights(0, 0xff, -1,
1, resistances_bitmap, bitmap_weight, 470, 0,
@@ -102,7 +102,7 @@ static void get_pens(running_machine *machine, pen_t *pens)
/* this uses the same color hook-up between bitmap and chars. */
/* TODO: clean me up */
-static void get_panther_pens(running_machine *machine, pen_t *pens)
+static void get_panther_pens(running_machine &machine, pen_t *pens)
{
static const int resistances_bitmap[] = { 100 };
static const int resistances_charmap_rg[] = { 390, 220, 180 };
@@ -117,7 +117,7 @@ static void get_panther_pens(running_machine *machine, pen_t *pens)
double charmap_b_weights[2];
double back_r_weight[1];
double back_gb_weight[1];
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
scaler = compute_resistor_weights(0, 0xff, -1,
1, resistances_bitmap, bitmap_weight, 470, 0,
@@ -163,7 +163,7 @@ static void get_panther_pens(running_machine *machine, pen_t *pens)
static VIDEO_START( redalert )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
state->bitmap_colorram = auto_alloc_array(machine, UINT8, 0x0400);
state->save_pointer(NAME(state->bitmap_colorram), 0x0400);
@@ -173,7 +173,7 @@ static VIDEO_START( redalert )
static VIDEO_START( ww3 )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
VIDEO_START_CALL( redalert );
state->control_xor = 0x04;
@@ -188,11 +188,11 @@ static VIDEO_START( ww3 )
static SCREEN_UPDATE( redalert )
{
- redalert_state *state = screen->machine->driver_data<redalert_state>();
+ redalert_state *state = screen->machine().driver_data<redalert_state>();
pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
offs_t offs;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (offs = 0; offs < 0x2000; offs++)
{
@@ -261,11 +261,11 @@ static SCREEN_UPDATE( redalert )
static SCREEN_UPDATE( demoneye )
{
- redalert_state *state = screen->machine->driver_data<redalert_state>();
+ redalert_state *state = screen->machine().driver_data<redalert_state>();
pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
offs_t offs;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (offs = 0; offs < 0x2000; offs++)
{
@@ -336,11 +336,11 @@ static SCREEN_UPDATE( demoneye )
static SCREEN_UPDATE( panther )
{
- redalert_state *state = screen->machine->driver_data<redalert_state>();
+ redalert_state *state = screen->machine().driver_data<redalert_state>();
pen_t pens[NUM_CHARMAP_PENS + NUM_BITMAP_PENS + 1];
offs_t offs;
- get_panther_pens(screen->machine, pens);
+ get_panther_pens(screen->machine(), pens);
for (offs = 0; offs < 0x2000; offs++)
{
diff --git a/src/mame/video/redclash.c b/src/mame/video/redclash.c
index 31e6e588fe9..964e954768f 100644
--- a/src/mame/video/redclash.c
+++ b/src/mame/video/redclash.c
@@ -23,7 +23,7 @@ PALETTE_INIT( redclash )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x40);
+ machine.colortable = colortable_alloc(machine, 0x40);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -46,7 +46,7 @@ PALETTE_INIT( redclash )
bit1 = (color_prom[i] >> 7) & 0x01;
b = 0x47 * bit0 + 0x97 * bit1;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* star colors */
@@ -69,7 +69,7 @@ PALETTE_INIT( redclash )
bit0 = ((i - 0x20) >> 0) & 0x01;
r = 0x47 * bit0;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -79,7 +79,7 @@ PALETTE_INIT( redclash )
for (i = 0; i < 0x20; i++)
{
UINT8 ctabentry = ((i << 3) & 0x18) | ((i >> 2) & 0x07);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites */
@@ -88,20 +88,20 @@ PALETTE_INIT( redclash )
UINT8 ctabentry = color_prom[(i - 0x20) >> 1];
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 0) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine->colortable, i + 0x00, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x00, ctabentry);
ctabentry = BITSWAP8((color_prom[i - 0x20] >> 4) & 0x0f, 7,6,5,4,0,1,2,3);
- colortable_entry_set_value(machine->colortable, i + 0x20, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x20, ctabentry);
}
/* stars */
for (i = 0x60; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, (i - 0x60) + 0x20);
+ colortable_entry_set_value(machine.colortable, i, (i - 0x60) + 0x20);
}
WRITE8_HANDLER( redclash_videoram_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -109,22 +109,22 @@ WRITE8_HANDLER( redclash_videoram_w )
WRITE8_HANDLER( redclash_gfxbank_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
if (state->gfxbank != (data & 0x01))
{
state->gfxbank = data & 0x01;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( redclash_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
}
-void redclash_set_stars_enable( running_machine *machine, UINT8 on ); //temp
-void redclash_set_stars_speed( running_machine *machine, UINT8 speed ); //temp
+void redclash_set_stars_enable( running_machine &machine, UINT8 on ); //temp
+void redclash_set_stars_speed( running_machine &machine, UINT8 speed ); //temp
/*
star_speed:
@@ -139,36 +139,36 @@ star_speed:
*/
WRITE8_HANDLER( redclash_star0_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->star_speed = (state->star_speed & ~1) | ((data & 1) << 0);
- redclash_set_stars_speed(space->machine, state->star_speed);
+ redclash_set_stars_speed(space->machine(), state->star_speed);
}
WRITE8_HANDLER( redclash_star1_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->star_speed = (state->star_speed & ~2) | ((data & 1) << 1);
- redclash_set_stars_speed(space->machine, state->star_speed);
+ redclash_set_stars_speed(space->machine(), state->star_speed);
}
WRITE8_HANDLER( redclash_star2_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->star_speed = (state->star_speed & ~4) | ((data & 1) << 2);
- redclash_set_stars_speed(space->machine, state->star_speed);
+ redclash_set_stars_speed(space->machine(), state->star_speed);
}
WRITE8_HANDLER( redclash_star_reset_w )
{
- redclash_set_stars_enable(space->machine, 1);
+ redclash_set_stars_enable(space->machine(), 1);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
int code = state->videoram[tile_index];
int color = (state->videoram[tile_index] & 0x70) >> 4; // ??
@@ -177,15 +177,15 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( redclash )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
UINT8 *spriteram = state->spriteram;
int i, offs;
@@ -212,13 +212,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((state->gfxbank & 1) << 4);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
0,0,
sx,sy - 16,0);
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code,
color,
0,0,
@@ -232,7 +232,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int code = ((spriteram[offs + i + 1] & 0xf8) >> 3) + ((state->gfxbank & 1) << 5);
int bank = (spriteram[offs + i + 1] & 0x02) >> 1;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[4+bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[4+bank],
code,
color,
0,0,
@@ -242,7 +242,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
int code = ((spriteram[offs + i + 1] & 0xf0) >> 4) + ((state->gfxbank & 1) << 4);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
0,0,
@@ -251,7 +251,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
break;
case 1: /* 8x8 */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
spriteram[offs + i + 1],// + 4 * (spriteram[offs + i + 2] & 0x10),
color,
0,0,
@@ -267,9 +267,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
int offs;
for (offs = 0; offs < 0x20; offs++)
@@ -303,8 +303,8 @@ static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rect
*/
/* This line can reset the LFSR to zero and disables the star generator */
-void redclash_set_stars_enable( running_machine *machine, UINT8 on )
-{ ladybug_state *state = machine->driver_data<ladybug_state>();
+void redclash_set_stars_enable( running_machine &machine, UINT8 on )
+{ ladybug_state *state = machine.driver_data<ladybug_state>();
if ((state->stars_enable == 0) && (on == 1))
{
@@ -317,9 +317,9 @@ void redclash_set_stars_enable( running_machine *machine, UINT8 on )
/* This sets up which starfield to draw and the offset, */
/* To be called from SCREEN_EOF() */
-void redclash_update_stars_state( running_machine *machine )
+void redclash_update_stars_state( running_machine &machine )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
if (state->stars_enable == 0)
return;
@@ -349,9 +349,9 @@ void redclash_update_stars_state( running_machine *machine )
* 7 right/up fast (+5/2 pix per frame)
*/
-void redclash_set_stars_speed( running_machine *machine, UINT8 speed )
+void redclash_set_stars_speed( running_machine &machine, UINT8 speed )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
state->stars_speed = speed;
}
@@ -360,9 +360,9 @@ void redclash_set_stars_speed( running_machine *machine, UINT8 speed )
/* Space Raider doesn't use the Va bit, and it is also set up to */
/* window the stars to a certain x range */
-void redclash_draw_stars( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
+void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
{
- ladybug_state *redclash = machine->driver_data<ladybug_state>();
+ ladybug_state *redclash = machine.driver_data<ladybug_state>();
int i;
UINT8 tempbit, feedback, star_color, xloc, yloc;
UINT32 state;
@@ -425,12 +425,12 @@ SCREEN_EOF( redclash )
SCREEN_UPDATE( redclash )
{
- ladybug_state *state = screen->machine->driver_data<ladybug_state>();
+ ladybug_state *state = screen->machine().driver_data<ladybug_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- redclash_draw_stars(screen->machine, bitmap, cliprect, 0x60, 0, 0x00, 0xff);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bullets(screen->machine, bitmap, cliprect);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ redclash_draw_stars(screen->machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bullets(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/relief.c b/src/mame/video/relief.c
index 1982ae51916..a793da17ba9 100644
--- a/src/mame/video/relief.c
+++ b/src/mame/video/relief.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- relief_state *state = machine->driver_data<relief_state>();
+ relief_state *state = machine.driver_data<relief_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] & 0xff;
int code = data1 & 0x7fff;
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
static TILE_GET_INFO( get_playfield2_tile_info )
{
- relief_state *state = machine->driver_data<relief_state>();
+ relief_state *state = machine.driver_data<relief_state>();
UINT16 data1 = state->playfield2[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -83,10 +83,10 @@ VIDEO_START( relief )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- relief_state *state = machine->driver_data<relief_state>();
+ relief_state *state = machine.driver_data<relief_state>();
/* MOs are 5bpp but with a 4-bit color granularity */
- machine->gfx[1]->color_granularity = 16;
+ machine.gfx[1]->color_granularity = 16;
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -109,8 +109,8 @@ VIDEO_START( relief )
SCREEN_UPDATE( relief )
{
- relief_state *state = screen->machine->driver_data<relief_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ relief_state *state = screen->machine().driver_data<relief_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/renegade.c b/src/mame/video/renegade.c
index 580b152f190..f1327734567 100644
--- a/src/mame/video/renegade.c
+++ b/src/mame/video/renegade.c
@@ -10,7 +10,7 @@
WRITE8_HANDLER( renegade_videoram_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
offset = offset % (64 * 16);
@@ -19,7 +19,7 @@ WRITE8_HANDLER( renegade_videoram_w )
WRITE8_HANDLER( renegade_videoram2_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->videoram2[offset] = data;
offset = offset % (32 * 32);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -27,24 +27,24 @@ WRITE8_HANDLER( renegade_videoram2_w )
WRITE8_HANDLER( renegade_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
}
WRITE8_HANDLER( renegade_scroll0_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->scrollx = (state->scrollx & 0xff00) | data;
}
WRITE8_HANDLER( renegade_scroll1_w )
{
- renegade_state *state = space->machine->driver_data<renegade_state>();
+ renegade_state *state = space->machine().driver_data<renegade_state>();
state->scrollx = (state->scrollx & 0xff) | (data << 8);
}
static TILE_GET_INFO( get_bg_tilemap_info )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
UINT8 *videoram = state->videoram;
const UINT8 *source = &videoram[tile_index];
UINT8 attributes = source[0x400]; /* CCC??BBB */
@@ -57,7 +57,7 @@ static TILE_GET_INFO( get_bg_tilemap_info )
static TILE_GET_INFO( get_fg_tilemap_info )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
const UINT8 *source = &state->videoram2[tile_index];
UINT8 attributes = source[0x400];
SET_TILE_INFO(
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_fg_tilemap_info )
VIDEO_START( renegade )
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tilemap_info, tilemap_scan_rows, 16, 16, 64, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tilemap_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -79,9 +79,9 @@ VIDEO_START( renegade )
state_save_register_global(machine, state->scrollx);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- renegade_state *state = machine->driver_data<renegade_state>();
+ renegade_state *state = machine.driver_data<renegade_state>();
UINT8 *source = state->spriteram;
UINT8 *finish = source + 96 * 4;
@@ -111,7 +111,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (attributes & 0x80) /* big sprite */
{
sprite_number &= ~1;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank],
sprite_number + 1,
color,
xflip, flip_screen_get(machine),
@@ -121,7 +121,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
sy += (flip_screen_get(machine) ? -16 : 16);
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[sprite_bank],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank],
sprite_number,
color,
xflip, flip_screen_get(machine),
@@ -133,10 +133,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( renegade )
{
- renegade_state *state = screen->machine->driver_data<renegade_state>();
+ renegade_state *state = screen->machine().driver_data<renegade_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0 , 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0 , 0);
return 0;
}
diff --git a/src/mame/video/retofinv.c b/src/mame/video/retofinv.c
index 4a9078df7a8..42b8bca399c 100644
--- a/src/mame/video/retofinv.c
+++ b/src/mame/video/retofinv.c
@@ -15,7 +15,7 @@ PALETTE_INIT( retofinv )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -24,7 +24,7 @@ PALETTE_INIT( retofinv )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -41,14 +41,14 @@ PALETTE_INIT( retofinv )
else
ctabentry = 0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites and bg tiles */
for (i = 0; i < 0x800; i++)
{
UINT8 ctabentry = BITSWAP8(color_prom[i],4,5,6,7,3,2,1,0);
- colortable_entry_set_value(machine->colortable, i + 0x200, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x200, ctabentry);
}
}
@@ -73,7 +73,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( bg_get_tile_info )
{
- retofinv_state *state = machine->driver_data<retofinv_state>();
+ retofinv_state *state = machine.driver_data<retofinv_state>();
SET_TILE_INFO(
2,
state->bg_videoram[tile_index] + 256 * state->bg_bank,
@@ -83,7 +83,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( fg_get_tile_info )
{
- retofinv_state *state = machine->driver_data<retofinv_state>();
+ retofinv_state *state = machine.driver_data<retofinv_state>();
int color = state->fg_videoram[0x400 + tile_index];
tileinfo->group = color;
@@ -105,11 +105,11 @@ static TILE_GET_INFO( fg_get_tile_info )
VIDEO_START( retofinv )
{
- retofinv_state *state = machine->driver_data<retofinv_state>();
+ retofinv_state *state = machine.driver_data<retofinv_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan,8,8,36,28);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info,tilemap_scan,8,8,36,28);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 0);
}
@@ -122,25 +122,25 @@ VIDEO_START( retofinv )
WRITE8_HANDLER( retofinv_bg_videoram_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( retofinv_fg_videoram_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( retofinv_gfx_ctrl_w )
{
- retofinv_state *state = space->machine->driver_data<retofinv_state>();
+ retofinv_state *state = space->machine().driver_data<retofinv_state>();
switch (offset)
{
case 0:
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
break;
case 1:
@@ -169,9 +169,9 @@ WRITE8_HANDLER( retofinv_gfx_ctrl_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap)
{
- retofinv_state *state = machine->driver_data<retofinv_state>();
+ retofinv_state *state = machine.driver_data<retofinv_state>();
UINT8 *spriteram = state->sharedram + 0x0780;
UINT8 *spriteram_2 = state->sharedram + 0x0f80;
UINT8 *spriteram_3 = state->sharedram + 0x1780;
@@ -216,12 +216,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,&spritevisiblearea,machine->gfx[1],
+ drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0xff));
}
}
}
@@ -231,9 +231,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
SCREEN_UPDATE( retofinv )
{
- retofinv_state *state = screen->machine->driver_data<retofinv_state>();
+ retofinv_state *state = screen->machine().driver_data<retofinv_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap);
+ draw_sprites(screen->machine(), bitmap);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/rockrage.c b/src/mame/video/rockrage.c
index c2e2bff8a7c..8a7194ec5dd 100644
--- a/src/mame/video/rockrage.c
+++ b/src/mame/video/rockrage.c
@@ -7,11 +7,11 @@ PALETTE_INIT( rockrage )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x40);
+ machine.colortable = colortable_alloc(machine, 0x40);
/* sprites */
for (i = 0x20; i < 0x40; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* characters */
for (i = 0x40; i < 0x140; i++)
@@ -19,17 +19,17 @@ PALETTE_INIT( rockrage )
UINT8 ctabentry;
ctabentry = (color_prom[(i - 0x40) + 0x000] & 0x0f) | 0x00;
- colortable_entry_set_value(machine->colortable, i + 0x000, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x000, ctabentry);
ctabentry = (color_prom[(i - 0x40) + 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i + 0x100, ctabentry);
+ colortable_entry_set_value(machine.colortable, i + 0x100, ctabentry);
}
}
-static void set_pens( running_machine *machine )
+static void set_pens( running_machine &machine )
{
- rockrage_state *state = machine->driver_data<rockrage_state>();
+ rockrage_state *state = machine.driver_data<rockrage_state>();
int i;
for (i = 0x00; i < 0x80; i += 2)
@@ -38,7 +38,7 @@ static void set_pens( running_machine *machine )
rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
- colortable_palette_set_color(machine->colortable, i >> 1, color);
+ colortable_palette_set_color(machine.colortable, i >> 1, color);
}
}
@@ -49,9 +49,9 @@ static void set_pens( running_machine *machine )
***************************************************************************/
-void rockrage_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags )
+void rockrage_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags )
{
- rockrage_state *state = machine->driver_data<rockrage_state>();
+ rockrage_state *state = machine.driver_data<rockrage_state>();
if (layer == 1)
*code |= ((*color & 0x40) << 2) | ((bank & 0x01) << 9);
@@ -66,9 +66,9 @@ void rockrage_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void rockrage_sprite_callback( running_machine *machine, int *code, int *color )
+void rockrage_sprite_callback( running_machine &machine, int *code, int *color )
{
- rockrage_state *state = machine->driver_data<rockrage_state>();
+ rockrage_state *state = machine.driver_data<rockrage_state>();
*code |= ((*color & 0x40) << 2) | ((*color & 0x80) << 1) * ((state->vreg & 0x03) << 1);
*code = (*code << 2) | ((*color & 0x30) >> 4);
@@ -82,10 +82,10 @@ WRITE8_HANDLER( rockrage_vreg_w )
/* bit 3: bit 4 of bank # (layer 0) */
/* bit 2: bit 1 of bank # (layer 0) */
/* bits 0-1: sprite bank select */
- rockrage_state *state = space->machine->driver_data<rockrage_state>();
+ rockrage_state *state = space->machine().driver_data<rockrage_state>();
if ((data & 0x0c) != (state->vreg & 0x0c))
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->vreg = data;
}
@@ -98,14 +98,14 @@ WRITE8_HANDLER( rockrage_vreg_w )
SCREEN_UPDATE( rockrage )
{
- rockrage_state *state = screen->machine->driver_data<rockrage_state>();
+ rockrage_state *state = screen->machine().driver_data<rockrage_state>();
- set_pens(screen->machine);
+ set_pens(screen->machine());
k007342_tilemap_update(state->k007342);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine->gfx[1]);
+ k007420_sprites_draw(state->k007420, bitmap, cliprect, screen->machine().gfx[1]);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 0, 1 | TILEMAP_DRAW_OPAQUE, 0);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 1, 0, 0);
k007342_tilemap_draw(state->k007342, bitmap, cliprect, 1, 1, 0);
diff --git a/src/mame/video/rocnrope.c b/src/mame/video/rocnrope.c
index d83621a24b1..88dbce8bf3a 100644
--- a/src/mame/video/rocnrope.c
+++ b/src/mame/video/rocnrope.c
@@ -43,7 +43,7 @@ PALETTE_INIT( rocnrope )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( rocnrope )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,36 +78,36 @@ PALETTE_INIT( rocnrope )
for (i = 0; i < 0x200; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( rocnrope_videoram_w )
{
- rocnrope_state *state = space->machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = space->machine().driver_data<rocnrope_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( rocnrope_colorram_w )
{
- rocnrope_state *state = space->machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = space->machine().driver_data<rocnrope_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( rocnrope_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (~data & 0x01))
+ if (flip_screen_get(space->machine()) != (~data & 0x01))
{
- flip_screen_set(space->machine, ~data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), ~data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- rocnrope_state *state = machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = machine.driver_data<rocnrope_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 2 * (attr & 0x80);
int color = attr & 0x0f;
@@ -118,13 +118,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( rocnrope )
{
- rocnrope_state *state = machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = machine.driver_data<rocnrope_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- rocnrope_state *state = machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = machine.driver_data<rocnrope_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -133,19 +133,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
int color = spriteram_2[offs] & 0x0f;
- drawgfx_transmask(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[0],
spriteram[offs + 1],
color,
spriteram_2[offs] & 0x40,~spriteram_2[offs] & 0x80,
240 - spriteram[offs], spriteram_2[offs + 1],
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
}
}
SCREEN_UPDATE( rocnrope )
{
- rocnrope_state *state = screen->machine->driver_data<rocnrope_state>();
+ rocnrope_state *state = screen->machine().driver_data<rocnrope_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c
index d7751b6564d..687e5f285ce 100644
--- a/src/mame/video/rohga.c
+++ b/src/mame/video/rohga.c
@@ -13,21 +13,21 @@ WRITE16_HANDLER( rohga_buffer_spriteram16_w )
{
// Spriteram seems to be triple buffered (no sprite lag on real pcb, but there
// is on driver with only double buffering)
- rohga_state *state = space->machine->driver_data<rohga_state>();
- memcpy(state->spriteram, space->machine->generic.buffered_spriteram.u16, 0x800);
- memcpy(space->machine->generic.buffered_spriteram.u16, space->machine->generic.spriteram.u16, 0x800);
+ rohga_state *state = space->machine().driver_data<rohga_state>();
+ memcpy(state->spriteram, space->machine().generic.buffered_spriteram.u16, 0x800);
+ memcpy(space->machine().generic.buffered_spriteram.u16, space->machine().generic.spriteram.u16, 0x800);
}
VIDEO_START( rohga )
{
- rohga_state *state = machine->driver_data<rohga_state>();
+ rohga_state *state = machine.driver_data<rohga_state>();
state->spriteram = auto_alloc_array(machine, UINT16, 0x800/2);
state->save_pointer(NAME(state->spriteram), 0x800/2);
}
/******************************************************************************/
-static void rohga_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int is_schmeisr )
+static void rohga_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int is_schmeisr )
{
int offs;
@@ -51,7 +51,7 @@ static void rohga_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
y = spriteptr[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
// Sprite colour is different between Rohga (6bpp) and Schmeisr (4bpp plus wire mods on pcb)
@@ -97,19 +97,19 @@ static void rohga_draw_sprites( running_machine *machine, bitmap_t *bitmap, cons
while (multi >= 0)
{
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite - multi * inc,
colour,
fx,fy,
x,y + mult * multi,
- machine->priority_bitmap,pri,0);
+ machine.priority_bitmap,pri,0);
multi--;
}
}
}
-static void wizdfire_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spriteptr, int mode, int bank )
+static void wizdfire_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spriteptr, int mode, int bank )
{
int offs;
@@ -155,7 +155,7 @@ static void wizdfire_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
y = spriteptr[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
colour = (x >> 9) & 0x1f;
@@ -199,7 +199,7 @@ static void wizdfire_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (multi >= 0)
{
- drawgfx_alpha(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[bank],
sprite - multi * inc,
colour,
fx,fy,
@@ -211,9 +211,9 @@ static void wizdfire_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void nitrobal_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank )
+static void nitrobal_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank )
{
- rohga_state *state = machine->driver_data<rohga_state>();
+ rohga_state *state = machine.driver_data<rohga_state>();
int offs, end, inc;
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
@@ -268,7 +268,7 @@ Sprites 2:
w = (spriteptr[offs + 2] & 0x0f00) >> 8;
sy = spriteptr[offs];
- if ((sy & 0x2000) && (machine->primary_screen->frame_number() & 1))
+ if ((sy & 0x2000) && (machine.primary_screen->frame_number() & 1))
{
offs += inc;
continue;
@@ -404,7 +404,7 @@ sprite 2:
{
decocomn_pdrawgfx(
state->decocomn,
- bitmap,cliprect,machine->gfx[gfxbank],
+ bitmap,cliprect,machine.gfx[gfxbank],
sprite + y + h * x,
colour,
fx,fy,
@@ -421,18 +421,18 @@ sprite 2:
static void update_rohga( device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr )
{
- rohga_state *state = screen->machine->driver_data<rohga_state>();
+ rohga_state *state = screen->machine().driver_data<rohga_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
/* Update playfields */
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[768]);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[768]);
switch (priority & 3)
{
@@ -462,7 +462,7 @@ static void update_rohga( device_t *screen, bitmap_t *bitmap, const rectangle *c
break;
}
- rohga_draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, is_schmeisr);
+ rohga_draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, is_schmeisr);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
}
@@ -482,22 +482,22 @@ SCREEN_UPDATE( schmeisr )
SCREEN_UPDATE( wizdfire )
{
- rohga_state *state = screen->machine->driver_data<rohga_state>();
+ rohga_state *state = screen->machine().driver_data<rohga_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
UINT16 priority = decocomn_priority_r(state->decocomn, 0, 0xffff);
/* Update playfields */
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, 0, 0);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
- bitmap_fill(bitmap, cliprect, screen->machine->pens[512]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[512]);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 4, 3);
+ wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 4, 3);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3, 3);
+ wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3, 3);
if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0);
@@ -505,9 +505,9 @@ SCREEN_UPDATE( wizdfire )
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
/* See notes in wizdfire_draw_sprites about this */
- wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, 3);
- wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 2, 4);
- wizdfire_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 1, 4);
+ wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, 3);
+ wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 2, 4);
+ wizdfire_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 1, 4);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
@@ -515,25 +515,25 @@ SCREEN_UPDATE( wizdfire )
SCREEN_UPDATE( nitrobal )
{
- rohga_state *state = screen->machine->driver_data<rohga_state>();
+ rohga_state *state = screen->machine().driver_data<rohga_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
/* Update playfields */
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_pf_update(state->deco_tilegen2, state->pf3_rowscroll, state->pf4_rowscroll);
/* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
- bitmap_fill(bitmap, cliprect, screen->machine->pens[512]);
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[512]);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
decocomn_clear_sprite_priority_bitmap(state->decocomn);
/* pf3 and pf4 are combined into a single 8bpp bitmap */
deco16ic_tilemap_12_combine_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 16);
- nitrobal_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 3);
- nitrobal_draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram2.u16, 4);
+ nitrobal_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 3);
+ nitrobal_draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram2.u16, 4);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c
index 5e7225a5204..54b36217325 100644
--- a/src/mame/video/rollerg.c
+++ b/src/mame/video/rollerg.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void rollerg_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void rollerg_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
#if 0
if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x80)) *color = rand();
if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand();
@@ -28,9 +28,9 @@ void rollerg_sprite_callback( running_machine *machine, int *code, int *color, i
***************************************************************************/
-void rollerg_zoom_callback( running_machine *machine, int *code, int *color, int *flags )
+void rollerg_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
*code |= ((*color & 0x0f) << 8);
*color = state->zoom_colorbase + ((*color & 0x30) >> 4);
@@ -46,7 +46,7 @@ void rollerg_zoom_callback( running_machine *machine, int *code, int *color, int
VIDEO_START( rollerg )
{
- rollerg_state *state = machine->driver_data<rollerg_state>();
+ rollerg_state *state = machine.driver_data<rollerg_state>();
state->sprite_colorbase = 16;
state->zoom_colorbase = 0;
}
@@ -61,10 +61,10 @@ VIDEO_START( rollerg )
SCREEN_UPDATE( rollerg )
{
- rollerg_state *state = screen->machine->driver_data<rollerg_state>();
+ rollerg_state *state = screen->machine().driver_data<rollerg_state>();
int bg_colorbase = 16;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k051316_zoom_draw(state->k051316, bitmap, cliprect, 0, 1);
k053245_sprites_draw(state->k053244, bitmap, cliprect);
diff --git a/src/mame/video/rollrace.c b/src/mame/video/rollrace.c
index 82b269d7919..57a43edb744 100644
--- a/src/mame/video/rollrace.c
+++ b/src/mame/video/rollrace.c
@@ -25,7 +25,7 @@ PALETTE_INIT( rollrace )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -35,15 +35,15 @@ PALETTE_INIT( rollrace )
bit2 = (color_prom[0] >> 2) & 0x01;
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -54,7 +54,7 @@ PALETTE_INIT( rollrace )
WRITE8_HANDLER( rollrace_charbank_w)
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_charbank[offset&1] = data;
state->ra_chrbank = state->ra_charbank[0] | (state->ra_charbank[1] << 1) ;
@@ -63,19 +63,19 @@ WRITE8_HANDLER( rollrace_charbank_w)
WRITE8_HANDLER( rollrace_bkgpen_w)
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_bkgpen = data;
}
WRITE8_HANDLER(rollrace_spritebank_w)
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_spritebank = data;
}
WRITE8_HANDLER(rollrace_backgroundpage_w)
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_bkgpage = data & 0x1f;
state->ra_bkgflip = ( data & 0x80 ) >> 7;
@@ -85,31 +85,31 @@ WRITE8_HANDLER(rollrace_backgroundpage_w)
WRITE8_HANDLER( rollrace_backgroundcolor_w )
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_bkgcol = data;
}
WRITE8_HANDLER( rollrace_flipy_w )
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_flipy = data & 0x01;
}
WRITE8_HANDLER( rollrace_flipx_w )
{
- rollrace_state *state = space->machine->driver_data<rollrace_state>();
+ rollrace_state *state = space->machine().driver_data<rollrace_state>();
state->ra_flipx = data & 0x01;
}
SCREEN_UPDATE( rollrace )
{
- rollrace_state *state = screen->machine->driver_data<rollrace_state>();
+ rollrace_state *state = screen->machine().driver_data<rollrace_state>();
UINT8 *spriteram = state->spriteram;
int offs;
int sx, sy;
int scroll;
int col;
- const UINT8 *mem = screen->machine->region("user1")->base();
+ const UINT8 *mem = screen->machine().region("user1")->base();
/* fill in background colour*/
bitmap_fill(bitmap,cliprect,state->ra_bkgpen);
@@ -133,7 +133,7 @@ SCREEN_UPDATE( rollrace )
sy = 31-sy ;
drawgfx_transpen(bitmap,
- cliprect,screen->machine->gfx[RA_BGCHAR_BASE],
+ cliprect,screen->machine().gfx[RA_BGCHAR_BASE],
mem[offs + ( state->ra_bkgpage * 1024 )]
+ ((( mem[offs + 0x4000 + ( state->ra_bkgpage * 1024 )] & 0xc0 ) >> 6 ) * 256 ) ,
state->ra_bkgcol,
@@ -171,7 +171,7 @@ SCREEN_UPDATE( rollrace )
if(bank)
bank += state->ra_spritebank;
- drawgfx_transpen(bitmap, cliprect,screen->machine->gfx[ RA_SP_BASE + bank ],
+ drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[ RA_SP_BASE + bank ],
spriteram[offs+1] & 0x3f ,
spriteram[offs+2] & 0x1f,
state->ra_flipx,!(s_flipy^state->ra_flipy),
@@ -199,7 +199,7 @@ SCREEN_UPDATE( rollrace )
if (state->ra_flipx) sx = 31 - sx;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[RA_FGCHAR_BASE + state->ra_chrbank] ,
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[RA_FGCHAR_BASE + state->ra_chrbank] ,
state->videoram[ offs ] ,
col,
state->ra_flipx,state->ra_flipy,
diff --git a/src/mame/video/route16.c b/src/mame/video/route16.c
index 1bde0da9f5d..77c3f985ca0 100644
--- a/src/mame/video/route16.c
+++ b/src/mame/video/route16.c
@@ -19,16 +19,16 @@
WRITE8_HANDLER( route16_out0_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->palette_1 = data & 0x1f;
- coin_counter_w(space->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
}
WRITE8_HANDLER( route16_out1_w )
{
- route16_state *state = space->machine->driver_data<route16_state>();
+ route16_state *state = space->machine().driver_data<route16_state>();
state->palette_2 = data & 0x1f;
state->flipscreen = (data >> 5) & 0x01;
@@ -72,11 +72,11 @@ static pen_t ttmajng_make_pen(UINT8 color)
SCREEN_UPDATE( route16 )
{
- route16_state *state = screen->machine->driver_data<route16_state>();
+ route16_state *state = screen->machine().driver_data<route16_state>();
offs_t offs;
- UINT8 *color_prom1 = &screen->machine->region("proms")->base()[0x000];
- UINT8 *color_prom2 = &screen->machine->region("proms")->base()[0x100];
+ UINT8 *color_prom1 = &screen->machine().region("proms")->base()[0x000];
+ UINT8 *color_prom2 = &screen->machine().region("proms")->base()[0x100];
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -125,15 +125,15 @@ SCREEN_UPDATE( route16 )
* The Stratovox video connections have been verified from the schematics
*/
-static int video_update_stratvox_ttmahjng(running_machine *machine, bitmap_t *bitmap,
+static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_t *bitmap,
const rectangle *cliprect,
pen_t (*make_pen)(UINT8))
{
- route16_state *state = machine->driver_data<route16_state>();
+ route16_state *state = machine.driver_data<route16_state>();
offs_t offs;
- UINT8 *color_prom1 = &machine->region("proms")->base()[0x000];
- UINT8 *color_prom2 = &machine->region("proms")->base()[0x100];
+ UINT8 *color_prom1 = &machine.region("proms")->base()[0x000];
+ UINT8 *color_prom2 = &machine.region("proms")->base()[0x100];
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -179,11 +179,11 @@ static int video_update_stratvox_ttmahjng(running_machine *machine, bitmap_t *bi
SCREEN_UPDATE( stratvox )
{
- return video_update_stratvox_ttmahjng(screen->machine, bitmap, cliprect, route16_make_pen);
+ return video_update_stratvox_ttmahjng(screen->machine(), bitmap, cliprect, route16_make_pen);
}
SCREEN_UPDATE( ttmahjng )
{
- return video_update_stratvox_ttmahjng(screen->machine, bitmap, cliprect, ttmajng_make_pen);
+ return video_update_stratvox_ttmahjng(screen->machine(), bitmap, cliprect, ttmajng_make_pen);
}
diff --git a/src/mame/video/rpunch.c b/src/mame/video/rpunch.c
index fa0330b76c3..aa4acc7610e 100644
--- a/src/mame/video/rpunch.c
+++ b/src/mame/video/rpunch.c
@@ -23,7 +23,7 @@
static TILE_GET_INFO( get_bg0_tile_info )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
int code;
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
UINT16 *videoram = state->videoram;
int data = videoram[0x2000 / 2 + tile_index];
int code;
@@ -62,16 +62,16 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TIMER_CALLBACK( crtc_interrupt_gen )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
cputag_set_input_line(machine, "maincpu", 1, HOLD_LINE);
if (param != 0)
- state->crtc_timer->adjust(machine->primary_screen->frame_period() / param, 0, machine->primary_screen->frame_period() / param);
+ state->crtc_timer->adjust(machine.primary_screen->frame_period() / param, 0, machine.primary_screen->frame_period() / param);
}
VIDEO_START( rpunch )
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
/* allocate tilemaps for the backgrounds */
state->background[0] = tilemap_create(machine, get_bg0_tile_info,tilemap_scan_cols,8,8,64,64);
state->background[1] = tilemap_create(machine, get_bg1_tile_info,tilemap_scan_cols,8,8,64,64);
@@ -83,7 +83,7 @@ VIDEO_START( rpunch )
memset(state->bitmapram, 0xff, state->bitmapram_size);
/* reset the timer */
- state->crtc_timer = machine->scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
+ state->crtc_timer = machine.scheduler().timer_alloc(FUNC(crtc_interrupt_gen));
}
@@ -96,7 +96,7 @@ VIDEO_START( rpunch )
WRITE16_HANDLER( rpunch_videoram_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
UINT16 *videoram = state->videoram;
int tmap = offset >> 12;
int tile_index = offset & 0xfff;
@@ -107,7 +107,7 @@ WRITE16_HANDLER( rpunch_videoram_w )
WRITE16_HANDLER( rpunch_videoreg_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
int oldword = state->videoflags;
COMBINE_DATA(&state->videoflags);
@@ -124,7 +124,7 @@ WRITE16_HANDLER( rpunch_videoreg_w )
WRITE16_HANDLER( rpunch_scrollreg_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
if (ACCESSING_BITS_0_7 && ACCESSING_BITS_8_15)
switch (offset)
{
@@ -149,7 +149,7 @@ WRITE16_HANDLER( rpunch_scrollreg_w )
WRITE16_HANDLER( rpunch_crtc_data_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
@@ -157,7 +157,7 @@ WRITE16_HANDLER( rpunch_crtc_data_w )
{
/* only register we know about.... */
case 0x0b:
- state->crtc_timer->adjust(space->machine->primary_screen->time_until_vblank_start(), (data == 0xc0) ? 2 : 1);
+ state->crtc_timer->adjust(space->machine().primary_screen->time_until_vblank_start(), (data == 0xc0) ? 2 : 1);
break;
default:
@@ -170,7 +170,7 @@ WRITE16_HANDLER( rpunch_crtc_data_w )
WRITE16_HANDLER( rpunch_crtc_register_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
if (ACCESSING_BITS_0_7)
state->crtc_register = data & 0xff;
}
@@ -178,7 +178,7 @@ WRITE16_HANDLER( rpunch_crtc_register_w )
WRITE16_HANDLER( rpunch_ins_w )
{
- rpunch_state *state = space->machine->driver_data<rpunch_state>();
+ rpunch_state *state = space->machine().driver_data<rpunch_state>();
if (ACCESSING_BITS_0_7)
{
if (offset == 0)
@@ -201,9 +201,9 @@ WRITE16_HANDLER( rpunch_ins_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int stop)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int stop)
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -227,7 +227,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (x >= BITMAP_WIDTH) x -= 512;
if (y >= BITMAP_HEIGHT) y -= 512;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code, color + (state->sprite_palette / 16), xflip, yflip, x, y, 15);
}
}
@@ -239,9 +239,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
*
*************************************/
-static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- rpunch_state *state = machine->driver_data<rpunch_state>();
+ rpunch_state *state = machine.driver_data<rpunch_state>();
int colourbase;
int xxx=512/4;
int yyy=256;
@@ -274,17 +274,17 @@ static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( rpunch )
{
- rpunch_state *state = screen->machine->driver_data<rpunch_state>();
+ rpunch_state *state = screen->machine().driver_data<rpunch_state>();
int effbins;
/* this seems like the most plausible explanation */
effbins = (state->bins > state->gins) ? state->gins : state->bins;
tilemap_draw(bitmap, cliprect, state->background[0], 0,0);
- draw_sprites(screen->machine, bitmap, cliprect, 0, effbins);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0, effbins);
tilemap_draw(bitmap, cliprect, state->background[1], 0,0);
- draw_sprites(screen->machine, bitmap, cliprect, effbins, state->gins);
+ draw_sprites(screen->machine(), bitmap, cliprect, effbins, state->gins);
if (state->bitmapram)
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/runaway.c b/src/mame/video/runaway.c
index 591dcc8a7c6..a1e09494aa9 100644
--- a/src/mame/video/runaway.c
+++ b/src/mame/video/runaway.c
@@ -25,14 +25,14 @@ WRITE8_HANDLER( runaway_paletteram_w )
0x47 * ((~data >> 0) & 1) +
0x97 * ((~data >> 1) & 1);
- palette_set_color(space->machine, offset, MAKE_RGB(R, G, B));
+ palette_set_color(space->machine(), offset, MAKE_RGB(R, G, B));
}
WRITE8_HANDLER( runaway_video_ram_w )
{
- runaway_state *state = space->machine->driver_data<runaway_state>();
+ runaway_state *state = space->machine().driver_data<runaway_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -41,7 +41,7 @@ WRITE8_HANDLER( runaway_video_ram_w )
WRITE8_HANDLER( runaway_tile_bank_w )
{
- runaway_state *state = space->machine->driver_data<runaway_state>();
+ runaway_state *state = space->machine().driver_data<runaway_state>();
if ((data & 1) != state->tile_bank)
{
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -53,7 +53,7 @@ WRITE8_HANDLER( runaway_tile_bank_w )
static TILE_GET_INFO( runaway_get_tile_info )
{
- runaway_state *state = machine->driver_data<runaway_state>();
+ runaway_state *state = machine.driver_data<runaway_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, ((code & 0x3f) << 1) | ((code & 0x40) >> 6) | (state->tile_bank << 7), 0, (code & 0x80) ? TILE_FLIPY : 0);
@@ -62,7 +62,7 @@ static TILE_GET_INFO( runaway_get_tile_info )
static TILE_GET_INFO( qwak_get_tile_info )
{
- runaway_state *state = machine->driver_data<runaway_state>();
+ runaway_state *state = machine.driver_data<runaway_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, ((code & 0x7f) << 1) | ((code & 0x80) >> 7), 0, 0);
@@ -72,7 +72,7 @@ static TILE_GET_INFO( qwak_get_tile_info )
VIDEO_START( runaway )
{
- runaway_state *state = machine->driver_data<runaway_state>();
+ runaway_state *state = machine.driver_data<runaway_state>();
state->bg_tilemap = tilemap_create(machine, runaway_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
state->save_item(NAME(state->tile_bank));
@@ -81,7 +81,7 @@ VIDEO_START( runaway )
VIDEO_START( qwak )
{
- runaway_state *state = machine->driver_data<runaway_state>();
+ runaway_state *state = machine.driver_data<runaway_state>();
state->bg_tilemap = tilemap_create(machine, qwak_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
state->save_item(NAME(state->tile_bank));
@@ -91,7 +91,7 @@ VIDEO_START( qwak )
SCREEN_UPDATE( runaway )
{
- runaway_state *state = screen->machine->driver_data<runaway_state>();
+ runaway_state *state = screen->machine().driver_data<runaway_state>();
int i;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -108,13 +108,13 @@ SCREEN_UPDATE( runaway )
code |= (state->sprite_ram[i + 0x30] << 2) & 0x1c0;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
code,
0,
flipx, flipy,
x, 240 - y, 0);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
code,
0,
flipx, flipy,
@@ -126,7 +126,7 @@ SCREEN_UPDATE( runaway )
SCREEN_UPDATE( qwak )
{
- runaway_state *state = screen->machine->driver_data<runaway_state>();
+ runaway_state *state = screen->machine().driver_data<runaway_state>();
int i;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -143,13 +143,13 @@ SCREEN_UPDATE( qwak )
code |= (state->sprite_ram[i + 0x30] << 2) & 0x1c0;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
code,
0,
flipx, flipy,
x, 240 - y, 0);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
code,
0,
flipx, flipy,
diff --git a/src/mame/video/rungun.c b/src/mame/video/rungun.c
index e15a1f981f6..a69f8536395 100644
--- a/src/mame/video/rungun.c
+++ b/src/mame/video/rungun.c
@@ -16,7 +16,7 @@
/* TTL text plane stuff */
static TILE_GET_INFO( ttl_get_tile_info )
{
- rungun_state *state = machine->driver_data<rungun_state>();
+ rungun_state *state = machine.driver_data<rungun_state>();
UINT8 *lvram = (UINT8 *)state->ttl_vram;
int attr, code;
@@ -26,35 +26,35 @@ static TILE_GET_INFO( ttl_get_tile_info )
SET_TILE_INFO(state->ttl_gfx_index, code, attr, 0);
}
-void rng_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void rng_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- rungun_state *state = machine->driver_data<rungun_state>();
+ rungun_state *state = machine.driver_data<rungun_state>();
*color = state->sprite_colorbase | (*color & 0x001f);
}
READ16_HANDLER( rng_ttl_ram_r )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
return state->ttl_vram[offset];
}
WRITE16_HANDLER( rng_ttl_ram_w )
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
COMBINE_DATA(&state->ttl_vram[offset]);
}
/* 53936 (PSAC2) rotation/zoom plane */
WRITE16_HANDLER(rng_936_videoram_w)
{
- rungun_state *state = space->machine->driver_data<rungun_state>();
+ rungun_state *state = space->machine().driver_data<rungun_state>();
COMBINE_DATA(&state->_936_videoram[offset]);
tilemap_mark_tile_dirty(state->_936_tilemap, offset / 2);
}
static TILE_GET_INFO( get_rng_936_tile_info )
{
- rungun_state *state = machine->driver_data<rungun_state>();
+ rungun_state *state = machine.driver_data<rungun_state>();
int tileno, colour, flipx;
tileno = state->_936_videoram[tile_index * 2 + 1] & 0x3fff;
@@ -78,7 +78,7 @@ VIDEO_START( rng )
8*8*4
};
- rungun_state *state = machine->driver_data<rungun_state>();
+ rungun_state *state = machine.driver_data<rungun_state>();
int gfx_index;
state->_936_tilemap = tilemap_create(machine, get_rng_936_tile_info, tilemap_scan_rows, 16, 16, 128, 128);
@@ -86,13 +86,13 @@ VIDEO_START( rng )
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
// decode the ttl layer's gfx
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, machine->region("gfx3")->base(), machine->total_colors() / 16, 0);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, machine.region("gfx3")->base(), machine.total_colors() / 16, 0);
state->ttl_gfx_index = gfx_index;
// create the tilemap
@@ -105,10 +105,10 @@ VIDEO_START( rng )
SCREEN_UPDATE(rng)
{
- rungun_state *state = screen->machine->driver_data<rungun_state>();
+ rungun_state *state = screen->machine().driver_data<rungun_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->_936_tilemap, 0, 0, 1);
diff --git a/src/mame/video/sauro.c b/src/mame/video/sauro.c
index dcd08210b0f..1036ed0c135 100644
--- a/src/mame/video/sauro.c
+++ b/src/mame/video/sauro.c
@@ -13,7 +13,7 @@
WRITE8_HANDLER( tecfri_videoram_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -21,7 +21,7 @@ WRITE8_HANDLER( tecfri_videoram_w )
WRITE8_HANDLER( tecfri_colorram_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -29,7 +29,7 @@ WRITE8_HANDLER( tecfri_colorram_w )
WRITE8_HANDLER( tecfri_videoram2_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -37,7 +37,7 @@ WRITE8_HANDLER( tecfri_videoram2_w )
WRITE8_HANDLER( tecfri_colorram2_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -45,14 +45,14 @@ WRITE8_HANDLER( tecfri_colorram2_w )
WRITE8_HANDLER( tecfri_scroll_bg_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
static TILE_GET_INFO( get_tile_info_bg )
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x07) << 8);
int color = ((state->colorram[tile_index] >> 4) & 0x0f) | state->palette_bank;
int flags = state->colorram[tile_index] & 0x08 ? TILE_FLIPX : 0;
@@ -62,7 +62,7 @@ static TILE_GET_INFO( get_tile_info_bg )
static TILE_GET_INFO( get_tile_info_fg )
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
int code = state->videoram2[tile_index] + ((state->colorram2[tile_index] & 0x07) << 8);
int color = ((state->colorram2[tile_index] >> 4) & 0x0f) | state->palette_bank;
int flags = state->colorram2[tile_index] & 0x08 ? TILE_FLIPX : 0;
@@ -77,16 +77,16 @@ static const int scroll2_map_flip[8] = {0, 7, 2, 1, 4, 3, 6, 5};
WRITE8_HANDLER( sauro_palette_bank_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
+ sauro_state *state = space->machine().driver_data<sauro_state>();
state->palette_bank = (data & 0x03) << 4;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
WRITE8_HANDLER( sauro_scroll_fg_w )
{
- sauro_state *state = space->machine->driver_data<sauro_state>();
- const int *map = (flip_screen_get(space->machine) ? scroll2_map_flip : scroll2_map);
+ sauro_state *state = space->machine().driver_data<sauro_state>();
+ const int *map = (flip_screen_get(space->machine()) ? scroll2_map_flip : scroll2_map);
int scroll = (data & 0xf8) | map[data & 7];
tilemap_set_scrollx(state->fg_tilemap, 0, scroll);
@@ -94,7 +94,7 @@ WRITE8_HANDLER( sauro_scroll_fg_w )
VIDEO_START( sauro )
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, tilemap_scan_cols,
8, 8, 32, 32);
@@ -106,9 +106,9 @@ VIDEO_START( sauro )
state->palette_bank = 0;
}
-static void sauro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
UINT8 *spriteram = state->spriteram;
int offs,code,sx,sy,color,flipx;
int flipy = flip_screen_get(machine);
@@ -146,7 +146,7 @@ static void sauro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
sy = 240 - sy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code,
color,
flipx, flipy,
@@ -156,11 +156,11 @@ static void sauro_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
SCREEN_UPDATE( sauro )
{
- sauro_state *state = screen->machine->driver_data<sauro_state>();
+ sauro_state *state = screen->machine().driver_data<sauro_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- sauro_draw_sprites(screen->machine, bitmap, cliprect);
+ sauro_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -168,15 +168,15 @@ SCREEN_UPDATE( sauro )
VIDEO_START( trckydoc )
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, tilemap_scan_cols,
8, 8, 32, 32);
}
-static void trckydoc_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- sauro_state *state = machine->driver_data<sauro_state>();
+ sauro_state *state = machine.driver_data<sauro_state>();
UINT8 *spriteram = state->spriteram;
int offs,code,sy,color,flipx,sx;
int flipy = flip_screen_get(machine);
@@ -222,7 +222,7 @@ static void trckydoc_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
sy = 240 - sy;
}
- drawgfx_transpen(bitmap, cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect,machine.gfx[1],
code,
color,
flipx, flipy,
@@ -232,8 +232,8 @@ static void trckydoc_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( trckydoc )
{
- sauro_state *state = screen->machine->driver_data<sauro_state>();
+ sauro_state *state = screen->machine().driver_data<sauro_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- trckydoc_draw_sprites(screen->machine, bitmap, cliprect);
+ trckydoc_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c
index 125aa9001c5..bd17fc634be 100644
--- a/src/mame/video/sbasketb.c
+++ b/src/mame/video/sbasketb.c
@@ -39,7 +39,7 @@ PALETTE_INIT( sbasketb )
4, resistances, bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( sbasketb )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -78,7 +78,7 @@ PALETTE_INIT( sbasketb )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0xf0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 0-256 (?) in 16 banks */
@@ -89,37 +89,37 @@ PALETTE_INIT( sbasketb )
for (j = 0; j < 0x10; j++)
{
UINT8 ctabentry = (j << 4) | (color_prom[i + 0x100] & 0x0f);
- colortable_entry_set_value(machine->colortable, 0x100 + ((j << 8) | i), ctabentry);
+ colortable_entry_set_value(machine.colortable, 0x100 + ((j << 8) | i), ctabentry);
}
}
}
WRITE8_HANDLER( sbasketb_videoram_w )
{
- sbasketb_state *state = space->machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = space->machine().driver_data<sbasketb_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( sbasketb_colorram_w )
{
- sbasketb_state *state = space->machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = space->machine().driver_data<sbasketb_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( sbasketb_flipscreen_w )
{
- if (flip_screen_get(space->machine) != data)
+ if (flip_screen_get(space->machine()) != data)
{
- flip_screen_set(space->machine, data);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- sbasketb_state *state = machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = machine.driver_data<sbasketb_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x20) << 3);
int color = state->colorram[tile_index] & 0x0f;
int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
@@ -129,15 +129,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( sbasketb )
{
- sbasketb_state *state = machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = machine.driver_data<sbasketb_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- sbasketb_state *state = machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = machine.driver_data<sbasketb_state>();
UINT8 *spriteram = state->spriteram;
int offs = (*state->spriteram_select & 0x01) * 0x100;
int i;
@@ -163,7 +163,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap,cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -173,13 +173,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( sbasketb )
{
- sbasketb_state *state = screen->machine->driver_data<sbasketb_state>();
+ sbasketb_state *state = screen->machine().driver_data<sbasketb_state>();
int col;
for (col = 6; col < 32; col++)
tilemap_set_scrolly(state->bg_tilemap, col, *state->scroll);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sbugger.c b/src/mame/video/sbugger.c
index 23e1ffd0127..0363ee05896 100644
--- a/src/mame/video/sbugger.c
+++ b/src/mame/video/sbugger.c
@@ -5,7 +5,7 @@
static TILE_GET_INFO( get_sbugger_tile_info )
{
- sbugger_state *state = machine->driver_data<sbugger_state>();
+ sbugger_state *state = machine.driver_data<sbugger_state>();
int tileno, color;
tileno = state->videoram[tile_index];
@@ -16,7 +16,7 @@ static TILE_GET_INFO( get_sbugger_tile_info )
WRITE8_HANDLER( sbugger_videoram_w )
{
- sbugger_state *state = space->machine->driver_data<sbugger_state>();
+ sbugger_state *state = space->machine().driver_data<sbugger_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
@@ -24,7 +24,7 @@ WRITE8_HANDLER( sbugger_videoram_w )
WRITE8_HANDLER( sbugger_videoram_attr_w )
{
- sbugger_state *state = space->machine->driver_data<sbugger_state>();
+ sbugger_state *state = space->machine().driver_data<sbugger_state>();
state->videoram_attr[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
@@ -32,13 +32,13 @@ WRITE8_HANDLER( sbugger_videoram_attr_w )
VIDEO_START(sbugger)
{
- sbugger_state *state = machine->driver_data<sbugger_state>();
+ sbugger_state *state = machine.driver_data<sbugger_state>();
state->tilemap = tilemap_create(machine, get_sbugger_tile_info, tilemap_scan_rows, 8, 16, 64, 16);
}
SCREEN_UPDATE(sbugger)
{
- sbugger_state *state = screen->machine->driver_data<sbugger_state>();
+ sbugger_state *state = screen->machine().driver_data<sbugger_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
return 0;
}
@@ -51,9 +51,9 @@ PALETTE_INIT(sbugger)
for (i = 0;i < 256;i++)
{
- int r = machine->rand()|0x80;
- int g = machine->rand()|0x80;
- int b = machine->rand()|0x80;
+ int r = machine.rand()|0x80;
+ int g = machine.rand()|0x80;
+ int b = machine.rand()|0x80;
if (i == 0) r = g = b = 0;
palette_set_color(machine,i*2+1,MAKE_RGB(r,g,b));
diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c
index ad6b49ccbb4..01a58f5a398 100644
--- a/src/mame/video/scotrsht.c
+++ b/src/mame/video/scotrsht.c
@@ -8,7 +8,7 @@ PALETTE_INIT( scotrsht )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -17,7 +17,7 @@ PALETTE_INIT( scotrsht )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -31,14 +31,14 @@ PALETTE_INIT( scotrsht )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
WRITE8_HANDLER( scotrsht_videoram_w )
{
- scotrsht_state *state = space->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = space->machine().driver_data<scotrsht_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -46,7 +46,7 @@ WRITE8_HANDLER( scotrsht_videoram_w )
WRITE8_HANDLER( scotrsht_colorram_w )
{
- scotrsht_state *state = space->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = space->machine().driver_data<scotrsht_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -54,7 +54,7 @@ WRITE8_HANDLER( scotrsht_colorram_w )
WRITE8_HANDLER( scotrsht_charbank_w )
{
- scotrsht_state *state = space->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = space->machine().driver_data<scotrsht_state>();
if (state->charbank != (data & 0x01))
{
@@ -67,7 +67,7 @@ WRITE8_HANDLER( scotrsht_charbank_w )
WRITE8_HANDLER( scotrsht_palettebank_w )
{
- scotrsht_state *state = space->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = space->machine().driver_data<scotrsht_state>();
if (state->palette_bank != ((data & 0x70) >> 4))
{
@@ -75,8 +75,8 @@ WRITE8_HANDLER( scotrsht_palettebank_w )
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
// data & 4 unknown
}
@@ -84,7 +84,7 @@ WRITE8_HANDLER( scotrsht_palettebank_w )
static TILE_GET_INFO( scotrsht_get_bg_tile_info )
{
- scotrsht_state *state = machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = machine.driver_data<scotrsht_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + (state->charbank << 9) + ((attr & 0x40) << 2);
int color = (attr & 0x0f) + state->palette_bank * 16;
@@ -99,9 +99,9 @@ static TILE_GET_INFO( scotrsht_get_bg_tile_info )
}
/* Same as Jailbreak + palette bank */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- scotrsht_state *state = machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = machine.driver_data<scotrsht_state>();
UINT8 *spriteram = state->spriteram;
int i;
@@ -123,15 +123,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy,
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, state->palette_bank * 16));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, state->palette_bank * 16));
}
}
VIDEO_START( scotrsht )
{
- scotrsht_state *state = machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = machine.driver_data<scotrsht_state>();
state->bg_tilemap = tilemap_create(machine, scotrsht_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -140,13 +140,13 @@ VIDEO_START( scotrsht )
SCREEN_UPDATE( scotrsht )
{
- scotrsht_state *state = screen->machine->driver_data<scotrsht_state>();
+ scotrsht_state *state = screen->machine().driver_data<scotrsht_state>();
int col;
for (col = 0; col < 32; col++)
tilemap_set_scrolly(state->bg_tilemap, col, state->scroll[col]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sderby.c b/src/mame/video/sderby.c
index 47504609a99..30f9df8e913 100644
--- a/src/mame/video/sderby.c
+++ b/src/mame/video/sderby.c
@@ -5,7 +5,7 @@
static TILE_GET_INFO( get_sderby_tile_info )
{
- sderby_state *state = machine->driver_data<sderby_state>();
+ sderby_state *state = machine.driver_data<sderby_state>();
int tileno,colour;
tileno = state->videoram[tile_index*2];
@@ -16,7 +16,7 @@ static TILE_GET_INFO( get_sderby_tile_info )
WRITE16_HANDLER( sderby_videoram_w )
{
- sderby_state *state = space->machine->driver_data<sderby_state>();
+ sderby_state *state = space->machine().driver_data<sderby_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap,offset/2);
@@ -26,7 +26,7 @@ WRITE16_HANDLER( sderby_videoram_w )
static TILE_GET_INFO( get_sderby_md_tile_info )
{
- sderby_state *state = machine->driver_data<sderby_state>();
+ sderby_state *state = machine.driver_data<sderby_state>();
int tileno,colour;
tileno = state->md_videoram[tile_index*2];
@@ -37,7 +37,7 @@ static TILE_GET_INFO( get_sderby_md_tile_info )
WRITE16_HANDLER( sderby_md_videoram_w )
{
- sderby_state *state = space->machine->driver_data<sderby_state>();
+ sderby_state *state = space->machine().driver_data<sderby_state>();
COMBINE_DATA(&state->md_videoram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap,offset/2);
@@ -47,7 +47,7 @@ WRITE16_HANDLER( sderby_md_videoram_w )
static TILE_GET_INFO( get_sderby_fg_tile_info )
{
- sderby_state *state = machine->driver_data<sderby_state>();
+ sderby_state *state = machine.driver_data<sderby_state>();
int tileno,colour;
tileno = state->fg_videoram[tile_index*2];
@@ -58,20 +58,20 @@ static TILE_GET_INFO( get_sderby_fg_tile_info )
WRITE16_HANDLER( sderby_fg_videoram_w )
{
- sderby_state *state = space->machine->driver_data<sderby_state>();
+ sderby_state *state = space->machine().driver_data<sderby_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset/2);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int codeshift)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int codeshift)
{
- sderby_state *state = machine->driver_data<sderby_state>();
+ sderby_state *state = machine.driver_data<sderby_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
- int height = machine->gfx[0]->height;
- int colordiv = machine->gfx[0]->color_granularity / 16;
+ int height = machine.gfx[0]->height;
+ int colordiv = machine.gfx[0]->color_granularity / 16;
for (offs = 4;offs < state->spriteram_size/2;offs += 4)
{
@@ -86,7 +86,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
code = spriteram16[offs+2] >> codeshift;
color = (spriteram16[offs+1] & 0x3e00) >> 9;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color/colordiv+48,
flipx,0,
@@ -97,7 +97,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_START( sderby )
{
- sderby_state *state = machine->driver_data<sderby_state>();
+ sderby_state *state = machine.driver_data<sderby_state>();
state->tilemap = tilemap_create(machine, get_sderby_tile_info,tilemap_scan_rows, 16, 16,32,32);
state->md_tilemap = tilemap_create(machine, get_sderby_md_tile_info,tilemap_scan_rows, 16, 16,32,32);
@@ -110,10 +110,10 @@ VIDEO_START( sderby )
SCREEN_UPDATE( sderby )
{
- sderby_state *state = screen->machine->driver_data<sderby_state>();
+ sderby_state *state = screen->machine().driver_data<sderby_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->md_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
@@ -121,11 +121,11 @@ SCREEN_UPDATE( sderby )
SCREEN_UPDATE( pmroulet )
{
- sderby_state *state = screen->machine->driver_data<sderby_state>();
+ sderby_state *state = screen->machine().driver_data<sderby_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->md_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
}
@@ -133,7 +133,7 @@ SCREEN_UPDATE( pmroulet )
WRITE16_HANDLER( sderby_scroll_w )
{
- sderby_state *state = space->machine->driver_data<sderby_state>();
+ sderby_state *state = space->machine().driver_data<sderby_state>();
data = COMBINE_DATA(&state->scroll[offset]);
diff --git a/src/mame/video/sega16sp.c b/src/mame/video/sega16sp.c
index 20987191c9d..3a150b6905c 100644
--- a/src/mame/video/sega16sp.c
+++ b/src/mame/video/sega16sp.c
@@ -76,11 +76,11 @@ INLINE const sega16sp_interface *get_interface( device_t *device )
pri[x] = 0xff; \
} \
-void segaic16_sprites_hangon_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
- const UINT8 *zoom = (const UINT8 *)machine->region("proms")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
+ const UINT8 *zoom = (const UINT8 *)machine.region("proms")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -135,7 +135,7 @@ void segaic16_sprites_hangon_draw(running_machine *machine, device_t *device, bi
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int xacc = 0x00;
/* note that the System 16A sprites have a design flaw that allows the address */
@@ -241,11 +241,11 @@ void segaic16_sprites_hangon_draw(running_machine *machine, device_t *device, bi
pri[x] = 0xff; \
} \
-void segaic16_sprites_sharrier_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x20000;
- const UINT32 *spritebase = (const UINT32 *)machine->region("gfx2")->base();
- const UINT8 *zoom = (const UINT8 *)machine->region("proms")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
+ const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
+ const UINT8 *zoom = (const UINT8 *)machine.region("proms")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -301,7 +301,7 @@ void segaic16_sprites_sharrier_draw(running_machine *machine, device_t *device,
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int xacc = 0x00;
/* note that the System 16A sprites have a design flaw that allows the address */
@@ -412,10 +412,10 @@ void segaic16_sprites_sharrier_draw(running_machine *machine, device_t *device,
pri[x] = 0xff; \
} \
-void segaic16_sprites_16a_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -470,7 +470,7 @@ void segaic16_sprites_16a_draw(running_machine *machine, device_t *device, bitma
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
/* note that the System 16A sprites have a design flaw that allows the address */
/* to carry into the flip flag, which is the topmost bit -- it is very important */
@@ -573,18 +573,18 @@ void segaic16_sprites_16a_draw(running_machine *machine, device_t *device, bitma
pri[x] = 0xff; \
} \
-void segaic16_sprites_16b_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
UINT8 numbanks;
const UINT16 *spritebase;
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
- spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ spritebase = (const UINT16 *)machine.region("gfx2")->base();
if (!spritebase)
return;
- numbanks = machine->region("gfx2")->bytes() / 0x20000;
+ numbanks = machine.region("gfx2")->bytes() / 0x20000;
/* first scan forward to find the end of the list */
for (data = sega16sp->spriteram; data < sega16sp->spriteram + sega16sp->ramsize/2; data += 8)
@@ -659,7 +659,7 @@ void segaic16_sprites_16b_draw(running_machine *machine, device_t *device, bitma
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int xacc;
/* compute the initial X zoom accumulator; this is verified on the real PCB */
@@ -739,10 +739,10 @@ void segaic16_sprites_16b_draw(running_machine *machine, device_t *device, bitma
pri[x] = 0; \
} \
-void segaic16_sprites_yboard_16b_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x20000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -812,7 +812,7 @@ void segaic16_sprites_yboard_16b_draw(running_machine *machine, device_t *device
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int xacc;
/* compute the initial X zoom accumulator; this is verified on the real PCB */
@@ -917,10 +917,10 @@ void segaic16_sprites_yboard_16b_draw(running_machine *machine, device_t *device
pri[x] = 0xff; \
} \
-static void segaic16_sprites_xboard_outrun_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int type)
+static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int type)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x40000;
- const UINT32 *spritebase = (const UINT32 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x40000;
+ const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -981,7 +981,7 @@ static void segaic16_sprites_xboard_outrun_draw(running_machine *machine, device
if (y >= cliprect->min_y && y <= cliprect->max_y)
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
int xacc = 0;
/* non-flipped case */
@@ -1043,12 +1043,12 @@ static void segaic16_sprites_xboard_outrun_draw(running_machine *machine, device
}
}
-void segaic16_sprites_outrun_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_OUTRUN);
}
-void segaic16_sprites_xboard_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_XBOARD);
}
@@ -1088,10 +1088,10 @@ void segaic16_sprites_xboard_draw(running_machine *machine, device_t *device, bi
if (x >= minx && x <= maxx && ind < 0x1fe) \
dest[x] = ind | colorpri; \
-void segaic16_sprites_yboard_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx1")->bytes() / 0x80000;
- const UINT64 *spritebase = (const UINT64 *)machine->region("gfx1")->base();
+ UINT8 numbanks = machine.region("gfx1")->bytes() / 0x80000;
+ const UINT64 *spritebase = (const UINT64 *)machine.region("gfx1")->base();
const UINT16 *rotatebase = segaic16_rotate[0].buffer ? segaic16_rotate[0].buffer : segaic16_rotate[0].rotateram;
UINT8 visited[0x1000];
sega16sp_state *sega16sp = get_safe_token(device);
@@ -1326,7 +1326,7 @@ void segaic16_sprites_yboard_draw(running_machine *machine, device_t *device, bi
if (y >= cliprect->min_y && y <= cliprect->max_y) \
{ \
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0); \
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0); \
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0); \
\
/* note that the System 16A sprites have a design flaw that allows the address */ \
/* to carry into the flip flag, which is the topmost bit -- it is very important */ \
@@ -1382,10 +1382,10 @@ void segaic16_sprites_yboard_draw(running_machine *machine, device_t *device, bi
-void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1405,10 +1405,10 @@ void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine *machine, device_t
}
/* 4 player passing shot is different to this.. */
-void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1427,10 +1427,10 @@ void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine *machine, device_
}
}
-void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
+void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x10000;
- const UINT16 *spritebase = (const UINT16 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
+ const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
sega16sp_state *sega16sp = get_safe_token(device);
UINT16* data = sega16sp->spriteram;
@@ -1461,9 +1461,9 @@ void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *
sega16sp_state *sega16sp;
if (!which)
- device = screen->machine->device("segaspr1");
+ device = screen->machine().device("segaspr1");
else
- device = screen->machine->device("segaspr2");
+ device = screen->machine().device("segaspr2");
if (!device)
fatalerror("segaic16_sprites_draw device not found\n");
@@ -1475,7 +1475,7 @@ void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *
else
sega16sp->spriteram = segaic16_spriteram_1;
- (*sega16sp->draw)(screen->machine, device, bitmap, cliprect);
+ (*sega16sp->draw)(screen->machine(), device, bitmap, cliprect);
}
@@ -1486,14 +1486,14 @@ void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *
*
*************************************/
-void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, int offset)
+void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset)
{
device_t* device = 0;
if (!which)
- device = machine->device("segaspr1");
+ device = machine.device("segaspr1");
else
- device = machine->device("segaspr2");
+ device = machine.device("segaspr2");
if (!device)
fatalerror("segaic16_sprites_set_bank device not found\n");
@@ -1502,7 +1502,7 @@ void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum,
if (sega16sp->bank[banknum] != offset)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
sega16sp->bank[banknum] = offset;
}
@@ -1516,14 +1516,14 @@ void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum,
*
*************************************/
-void segaic16_sprites_set_flip(running_machine *machine, int which, int flip)
+void segaic16_sprites_set_flip(running_machine &machine, int which, int flip)
{
device_t* device = 0;
if (!which)
- device = machine->device("segaspr1");
+ device = machine.device("segaspr1");
else
- device = machine->device("segaspr2");
+ device = machine.device("segaspr2");
if (!device)
fatalerror("segaic16_sprites_set_flip device not found\n");
@@ -1533,7 +1533,7 @@ void segaic16_sprites_set_flip(running_machine *machine, int which, int flip)
flip = (flip != 0);
if (sega16sp->flip != flip)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
sega16sp->flip = flip;
}
@@ -1547,14 +1547,14 @@ void segaic16_sprites_set_flip(running_machine *machine, int which, int flip)
*
*************************************/
-void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow)
+void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow)
{
device_t* device = 0;
if (!which)
- device = machine->device("segaspr1");
+ device = machine.device("segaspr1");
else
- device = machine->device("segaspr2");
+ device = machine.device("segaspr2");
if (!device)
fatalerror("segaic16_sprites_set_shadow device not found\n");
@@ -1564,7 +1564,7 @@ void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow
shadow = (shadow != 0);
if (sega16sp->shadow != shadow)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
sega16sp->shadow = shadow;
}
@@ -1614,7 +1614,7 @@ WRITE16_HANDLER( segaic16_sprites_draw_0_w )
{
device_t* device = 0;
- device = space->machine->device("segaspr1");
+ device = space->machine().device("segaspr1");
if (!device)
fatalerror("segaic16_sprites_draw_0_w device not found\n");
@@ -1627,7 +1627,7 @@ WRITE16_HANDLER( segaic16_sprites_draw_1_w )
{
device_t* device = 0;
- device = space->machine->device("segaspr2");
+ device = space->machine().device("segaspr2");
if (!device)
fatalerror("segaic16_sprites_draw_1_w device not found\n");
@@ -1660,7 +1660,7 @@ static DEVICE_START( sega16sp )
sega16sp->draw = intf->draw;
if (intf->buffer)
- sega16sp->buffer = auto_alloc_array(device->machine, UINT16, sega16sp->ramsize/2);
+ sega16sp->buffer = auto_alloc_array(device->machine(), UINT16, sega16sp->ramsize/2);
device->save_item(NAME(sega16sp->flip));
diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c
index 220267f842c..cce86d699c2 100644
--- a/src/mame/video/segag80r.c
+++ b/src/mame/video/segag80r.c
@@ -21,18 +21,18 @@ enum { spaceod_bg_detect_tile_color = 1 };
static TIMER_CALLBACK( vblank_latch_clear )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state->vblank_latch = 0;
}
-static void vblank_latch_set(running_machine *machine)
+static void vblank_latch_set(running_machine &machine)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* set a timer to mimic the 555 timer that drives the EDGINT signal */
/* the 555 is run in monostable mode with R=56000 and C=1000pF */
state->vblank_latch = 1;
- machine->scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), FUNC(vblank_latch_clear));
+ machine.scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), FUNC(vblank_latch_clear));
/* latch the current flip state at the same time */
state->video_flip = state->video_control & 1;
@@ -41,8 +41,8 @@ static void vblank_latch_set(running_machine *machine)
INTERRUPT_GEN( segag80r_vblank_start )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- vblank_latch_set(device->machine);
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ vblank_latch_set(device->machine());
/* if interrupts are enabled, clock one */
if (state->video_control & 0x04)
@@ -52,7 +52,7 @@ INTERRUPT_GEN( segag80r_vblank_start )
INTERRUPT_GEN( sindbadm_vblank_start )
{
- vblank_latch_set(device->machine);
+ vblank_latch_set(device->machine());
/* interrupts appear to always be enabled, but they have a manual */
/* acknowledge rather than an automatic ack; they are also not masked */
@@ -68,9 +68,9 @@ INTERRUPT_GEN( sindbadm_vblank_start )
*
*************************************/
-static void g80_set_palette_entry(running_machine *machine, int entry, UINT8 data)
+static void g80_set_palette_entry(running_machine &machine, int entry, UINT8 data)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
int bit0, bit1, bit2;
int r, g, b;
@@ -100,7 +100,7 @@ static void g80_set_palette_entry(running_machine *machine, int entry, UINT8 dat
}
-static void spaceod_bg_init_palette(running_machine *machine)
+static void spaceod_bg_init_palette(running_machine &machine)
{
static const int resistances[2] = { 1800, 1200 };
double trweights[2], tgweights[2], tbweights[2];
@@ -152,8 +152,8 @@ static void spaceod_bg_init_palette(running_machine *machine)
static TILE_GET_INFO( spaceod_get_tile_info )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
- int code = machine->region("gfx2")->base()[tile_index + 0x1000 * (state->spaceod_bg_control >> 6)];
+ segag80r_state *state = machine.driver_data<segag80r_state>();
+ int code = machine.region("gfx2")->base()[tile_index + 0x1000 * (state->spaceod_bg_control >> 6)];
SET_TILE_INFO(1, code + 0x100 * ((state->spaceod_bg_control >> 2) & 1), 0, 0);
}
@@ -168,8 +168,8 @@ static TILEMAP_MAPPER( spaceod_scan_rows )
static TILE_GET_INFO( bg_get_tile_info )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
- int code = machine->region("gfx2")->base()[tile_index];
+ segag80r_state *state = machine.driver_data<segag80r_state>();
+ int code = machine.region("gfx2")->base()[tile_index];
SET_TILE_INFO(1, code + 0x100 * state->bg_char_bank, code >> 4, 0);
}
@@ -183,7 +183,7 @@ static TILE_GET_INFO( bg_get_tile_info )
VIDEO_START( segag80r )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
UINT8 *videoram = state->videoram;
static const int rg_resistances[3] = { 4700, 2400, 1200 };
static const int b_resistances[2] = { 2000, 1000 };
@@ -194,10 +194,10 @@ VIDEO_START( segag80r )
3, rg_resistances, state->gweights, 220, 0,
2, b_resistances, state->bweights, 220, 0);
- gfx_element_set_source(machine->gfx[0], &videoram[0x800]);
+ gfx_element_set_source(machine.gfx[0], &videoram[0x800]);
/* allocate paletteram */
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x80);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x80);
/* initialize the particulars for each type of background PCB */
switch (state->background_pcb)
@@ -216,18 +216,18 @@ VIDEO_START( segag80r )
/* background tilemap is effectively 1 screen x n screens */
case G80_BACKGROUND_MONSTERB:
- state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 32,machine->region("gfx2")->bytes() / 32);
+ state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 32,machine.region("gfx2")->bytes() / 32);
break;
/* background tilemap is effectively 4 screens x n screens */
case G80_BACKGROUND_PIGNEWT:
case G80_BACKGROUND_SINDBADM:
- state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 128,machine->region("gfx2")->bytes() / 128);
+ state->bg_tilemap = tilemap_create(machine, bg_get_tile_info, tilemap_scan_rows, 8,8, 128,machine.region("gfx2")->bytes() / 128);
break;
}
/* register for save states */
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x80);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x80);
state_save_register_global(machine, state->video_control);
state_save_register_global(machine, state->video_flip);
@@ -257,14 +257,14 @@ VIDEO_START( segag80r )
WRITE8_HANDLER( segag80r_videoram_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
UINT8 *videoram = state->videoram;
/* accesses to the upper half of VRAM go to paletteram if selected */
if ((offset & 0x1000) && (state->video_control & 0x02))
{
offset &= 0x3f;
- space->machine->generic.paletteram.u8[offset] = data;
- g80_set_palette_entry(space->machine, offset, data);
+ space->machine().generic.paletteram.u8[offset] = data;
+ g80_set_palette_entry(space->machine(), offset, data);
return;
}
@@ -273,7 +273,7 @@ WRITE8_HANDLER( segag80r_videoram_w )
/* track which characters are dirty */
if (offset & 0x800)
- gfx_element_mark_dirty(space->machine->gfx[0], (offset & 0x7ff) / 8);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset & 0x7ff) / 8);
}
@@ -286,7 +286,7 @@ WRITE8_HANDLER( segag80r_videoram_w )
READ8_HANDLER( segag80r_video_port_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
if (offset == 0)
{
logerror("%04X:segag80r_video_port_r(%d)\n", cpu_get_pc(space->cpu), offset);
@@ -307,7 +307,7 @@ READ8_HANDLER( segag80r_video_port_r )
WRITE8_HANDLER( segag80r_video_port_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
if (offset == 0)
{
logerror("%04X:segag80r_video_port_w(%d) = %02X\n", cpu_get_pc(space->cpu), offset, data);
@@ -336,16 +336,16 @@ WRITE8_HANDLER( segag80r_video_port_w )
READ8_HANDLER( spaceod_back_port_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* force an update to get the current detection value */
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
return 0xfe | state->spaceod_bg_detect;
}
WRITE8_HANDLER( spaceod_back_port_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
switch (offset & 7)
{
/* port 0: latches D0-D7 into LS377 at U39 (SH4)
@@ -392,7 +392,7 @@ WRITE8_HANDLER( spaceod_back_port_w )
/* port 3: clears the background detection flag */
case 3:
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->spaceod_bg_detect = 0;
break;
@@ -426,14 +426,14 @@ WRITE8_HANDLER( spaceod_back_port_w )
WRITE8_HANDLER( monsterb_videoram_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* accesses to the the area $f040-$f07f go to background palette if */
/* the palette access enable bit is set */
if ((offset & 0x1fc0) == 0x1040 && (state->video_control & 0x40))
{
offs_t paloffs = offset & 0x3f;
- space->machine->generic.paletteram.u8[paloffs | 0x40] = data;
- g80_set_palette_entry(space->machine, paloffs | 0x40, data);
+ space->machine().generic.paletteram.u8[paloffs | 0x40] = data;
+ g80_set_palette_entry(space->machine(), paloffs | 0x40, data);
/* note that since the background board is not integrated with the main board */
/* writes here also write through to regular videoram */
}
@@ -445,7 +445,7 @@ WRITE8_HANDLER( monsterb_videoram_w )
WRITE8_HANDLER( monsterb_back_port_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
switch (offset & 7)
{
/* port 0: not used (looks like latches for C7-C10 = background color) */
@@ -498,14 +498,14 @@ WRITE8_HANDLER( monsterb_back_port_w )
WRITE8_HANDLER( pignewt_videoram_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* accesses to the the area $f040-$f07f go to background palette if */
/* the palette access enable bit is set */
if ((offset & 0x1fc0) == 0x1040 && (state->video_control & 0x02))
{
offs_t paloffs = offset & 0x3f;
- space->machine->generic.paletteram.u8[paloffs | 0x40] = data;
- g80_set_palette_entry(space->machine, paloffs | 0x40, data);
+ space->machine().generic.paletteram.u8[paloffs | 0x40] = data;
+ g80_set_palette_entry(space->machine(), paloffs | 0x40, data);
return;
}
@@ -516,7 +516,7 @@ WRITE8_HANDLER( pignewt_videoram_w )
WRITE8_HANDLER( pignewt_back_color_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* it is not really known what this does */
if (offset == 0)
state->pignewt_bg_color_offset = data;
@@ -527,7 +527,7 @@ WRITE8_HANDLER( pignewt_back_color_w )
WRITE8_HANDLER( pignewt_back_port_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
switch (offset & 7)
{
/* port 0: scroll offset low */
@@ -584,14 +584,14 @@ WRITE8_HANDLER( pignewt_back_port_w )
WRITE8_HANDLER( sindbadm_videoram_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* accesses to the the area $f000-$f03f go to background palette if */
/* the palette access enable bit is set */
if ((offset & 0x1fc0) == 0x1000 && (state->video_control & 0x02))
{
offs_t paloffs = offset & 0x3f;
- space->machine->generic.paletteram.u8[paloffs | 0x40] = data;
- g80_set_palette_entry(space->machine, paloffs | 0x40, data);
+ space->machine().generic.paletteram.u8[paloffs | 0x40] = data;
+ g80_set_palette_entry(space->machine(), paloffs | 0x40, data);
return;
}
@@ -602,12 +602,12 @@ WRITE8_HANDLER( sindbadm_videoram_w )
WRITE8_HANDLER( sindbadm_back_port_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
switch (offset & 3)
{
/* port 0: irq ack */
case 0:
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
/* port 1: background control
@@ -640,9 +640,9 @@ WRITE8_HANDLER( sindbadm_back_port_w )
*
*************************************/
-static void draw_videoram(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *transparent_pens)
+static void draw_videoram(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *transparent_pens)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
UINT8 *videoram = state->videoram;
int flipmask = state->video_flip ? 0x1f : 0x00;
int x, y;
@@ -657,7 +657,7 @@ static void draw_videoram(running_machine *machine, bitmap_t *bitmap, const rect
UINT8 tile = videoram[offs];
/* draw the tile */
- drawgfx_transmask(bitmap, cliprect, machine->gfx[0], tile, tile >> 4, state->video_flip, state->video_flip, x*8, y*8, transparent_pens[tile >> 4]);
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[0], tile, tile >> 4, state->video_flip, state->video_flip, x*8, y*8, transparent_pens[tile >> 4]);
}
}
}
@@ -670,9 +670,9 @@ static void draw_videoram(running_machine *machine, bitmap_t *bitmap, const rect
*
*************************************/
-static void draw_background_spaceod(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background_spaceod(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
bitmap_t *pixmap = tilemap_get_pixmap(!(state->spaceod_bg_control & 0x02) ? state->spaceod_bg_htilemap : state->spaceod_bg_vtilemap);
int flipmask = (state->spaceod_bg_control & 0x01) ? 0xff : 0x00;
int xoffset = (state->spaceod_bg_control & 0x02) ? 0x10 : 0x00;
@@ -697,7 +697,7 @@ static void draw_background_spaceod(running_machine *machine, bitmap_t *bitmap,
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
{
int effx = ((x + state->spaceod_hcounter) ^ flipmask) + xoffset;
- UINT8 fgpix = machine->generic.paletteram.u8[dst[x]];
+ UINT8 fgpix = machine.generic.paletteram.u8[dst[x]];
UINT8 bgpix = src[effx & xmask] & 0x3f;
/* the background detect flag is set if:
@@ -728,9 +728,9 @@ static void draw_background_spaceod(running_machine *machine, bitmap_t *bitmap,
*
*************************************/
-static void draw_background_page_scroll(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background_page_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
bitmap_t *pixmap = tilemap_get_pixmap(state->bg_tilemap);
int flipmask = (state->video_control & 0x08) ? 0xff : 0x00;
int xmask = pixmap->width - 1;
@@ -769,9 +769,9 @@ static void draw_background_page_scroll(running_machine *machine, bitmap_t *bitm
*
*************************************/
-static void draw_background_full_scroll(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
bitmap_t *pixmap = tilemap_get_pixmap(state->bg_tilemap);
int flipmask = (state->video_control & 0x08) ? 0x3ff : 0x000;
int xmask = pixmap->width - 1;
@@ -811,7 +811,7 @@ static void draw_background_full_scroll(running_machine *machine, bitmap_t *bitm
SCREEN_UPDATE( segag80r )
{
- segag80r_state *state = screen->machine->driver_data<segag80r_state>();
+ segag80r_state *state = screen->machine().driver_data<segag80r_state>();
UINT8 transparent_pens[16];
switch (state->background_pcb)
@@ -820,7 +820,7 @@ SCREEN_UPDATE( segag80r )
/* background: none */
case G80_BACKGROUND_NONE:
memset(transparent_pens, 0, 16);
- draw_videoram(screen->machine, bitmap, cliprect, transparent_pens);
+ draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except where black */
@@ -828,32 +828,32 @@ SCREEN_UPDATE( segag80r )
/* we draw the foreground first, then the background to do collision detection */
case G80_BACKGROUND_SPACEOD:
memset(transparent_pens, 0, 16);
- draw_videoram(screen->machine, bitmap, cliprect, transparent_pens);
- draw_background_spaceod(screen->machine, bitmap, cliprect);
+ draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens);
+ draw_background_spaceod(screen->machine(), bitmap, cliprect);
break;
/* foreground: visible except for pen 0 (this disagrees with schematics) */
/* background: page-granular scrolling */
case G80_BACKGROUND_MONSTERB:
memset(transparent_pens, 1, 16);
- draw_background_page_scroll(screen->machine, bitmap, cliprect);
- draw_videoram(screen->machine, bitmap, cliprect, transparent_pens);
+ draw_background_page_scroll(screen->machine(), bitmap, cliprect);
+ draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except for pen 0 */
/* background: full scrolling */
case G80_BACKGROUND_PIGNEWT:
memset(transparent_pens, 1, 16);
- draw_background_full_scroll(screen->machine, bitmap, cliprect);
- draw_videoram(screen->machine, bitmap, cliprect, transparent_pens);
+ draw_background_full_scroll(screen->machine(), bitmap, cliprect);
+ draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except for pen 0 */
/* background: page-granular scrolling */
case G80_BACKGROUND_SINDBADM:
memset(transparent_pens, 1, 16);
- draw_background_page_scroll(screen->machine, bitmap, cliprect);
- draw_videoram(screen->machine, bitmap, cliprect, transparent_pens);
+ draw_background_page_scroll(screen->machine(), bitmap, cliprect);
+ draw_videoram(screen->machine(), bitmap, cliprect, transparent_pens);
break;
}
return 0;
diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c
index 7531a51efa7..3eb960f9a6f 100644
--- a/src/mame/video/segag80v.c
+++ b/src/mame/video/segag80v.c
@@ -107,10 +107,10 @@ INLINE int adjust_xy(segag80v_state *state, int rawx, int rawy, int *outx, int *
}
-static void sega_generate_vector_list(running_machine *machine)
+static void sega_generate_vector_list(running_machine &machine)
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
- UINT8 *sintable = machine->region("proms")->base();
+ segag80v_state *state = machine.driver_data<segag80v_state>();
+ UINT8 *sintable = machine.region("proms")->base();
double total_time = 1.0 / (double)IRQ_CLOCK;
UINT16 symaddr = 0;
UINT8 *vectorram = state->vectorram;
@@ -325,11 +325,11 @@ static void sega_generate_vector_list(running_machine *machine)
VIDEO_START( segag80v )
{
- segag80v_state *state = machine->driver_data<segag80v_state>();
+ segag80v_state *state = machine.driver_data<segag80v_state>();
assert_always(state->vectorram_size != 0, "vectorram==0");
- state->min_x =machine->primary_screen->visible_area().min_x;
- state->min_y =machine->primary_screen->visible_area().min_y;
+ state->min_x =machine.primary_screen->visible_area().min_x;
+ state->min_y =machine.primary_screen->visible_area().min_y;
VIDEO_START_CALL(vector);
}
@@ -337,7 +337,7 @@ VIDEO_START( segag80v )
SCREEN_UPDATE( segag80v )
{
- sega_generate_vector_list(screen->machine);
+ sega_generate_vector_list(screen->machine());
SCREEN_UPDATE_CALL(vector);
return 0;
}
diff --git a/src/mame/video/segahang.c b/src/mame/video/segahang.c
index 344e2314840..ccad73ad8ec 100644
--- a/src/mame/video/segahang.c
+++ b/src/mame/video/segahang.c
@@ -54,12 +54,12 @@ SCREEN_UPDATE( hangon )
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw the low priority road layer */
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c
index 240e61452cc..493aff16db1 100644
--- a/src/mame/video/segaic16.c
+++ b/src/mame/video/segaic16.c
@@ -404,12 +404,12 @@ static struct tilemap_info bg_tilemap[SEGAIC16_MAX_TILEMAPS];
*
*************************************/
-void segaic16_set_display_enable(running_machine *machine, int enable)
+void segaic16_set_display_enable(running_machine &machine, int enable)
{
enable = (enable != 0);
if (segaic16_display_enable != enable)
{
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
segaic16_display_enable = enable;
}
}
@@ -504,9 +504,9 @@ WRITE16_HANDLER( segaic16_paletteram_w )
b = ((newval >> 14) & 0x01) | ((newval >> 7) & 0x1e);
/* normal colors */
- palette_set_color_rgb(space->machine, offset + 0 * info->entries, info->normal[r], info->normal[g], info->normal[b]);
- palette_set_color_rgb(space->machine, offset + 1 * info->entries, info->shadow[r], info->shadow[g], info->shadow[b]);
- palette_set_color_rgb(space->machine, offset + 2 * info->entries, info->hilight[r], info->hilight[g], info->hilight[b]);
+ palette_set_color_rgb(space->machine(), offset + 0 * info->entries, info->normal[r], info->normal[g], info->normal[b]);
+ palette_set_color_rgb(space->machine(), offset + 1 * info->entries, info->shadow[r], info->shadow[g], info->shadow[b]);
+ palette_set_color_rgb(space->machine(), offset + 2 * info->entries, info->hilight[r], info->hilight[g], info->hilight[b]);
}
@@ -518,15 +518,15 @@ WRITE16_HANDLER( segaic16_paletteram_w )
*
*************************************/
-static void segaic16_draw_virtual_tilemap(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
+static void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
{
int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1;
int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1;
rectangle pageclip;
int page;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* which half/halves of the virtual tilemap do we intersect in the X direction? */
if (xscroll < 64*8 - width)
@@ -744,7 +744,7 @@ static TILE_GET_INFO( segaic16_tilemap_16a_text_info )
}
-static void segaic16_tilemap_16a_draw_layer(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
+static void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
{
UINT16 *textram = info->textram;
@@ -986,7 +986,7 @@ static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info )
}
-static void segaic16_tilemap_16b_draw_layer(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
+static void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
{
UINT16 *textram = info->textram;
UINT16 xscroll, yscroll, pages;
@@ -1095,14 +1095,14 @@ static TIMER_CALLBACK( segaic16_tilemap_16b_latch_values )
}
/* set a timer to do this again next frame */
- info->latch_timer->adjust(machine->primary_screen->time_until_pos(261), param);
+ info->latch_timer->adjust(machine.primary_screen->time_until_pos(261), param);
}
-static void segaic16_tilemap_16b_reset(running_machine *machine, struct tilemap_info *info)
+static void segaic16_tilemap_16b_reset(running_machine &machine, struct tilemap_info *info)
{
/* set a timer to latch values on scanline 261 */
- info->latch_timer->adjust(machine->primary_screen->time_until_pos(261), info->index);
+ info->latch_timer->adjust(machine.primary_screen->time_until_pos(261), info->index);
}
@@ -1113,7 +1113,7 @@ static void segaic16_tilemap_16b_reset(running_machine *machine, struct tilemap_
*
*************************************/
-void segaic16_tilemap_init(running_machine *machine, int which, int type, int colorbase, int xoffs, int numbanks)
+void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks)
{
struct tilemap_info *info = &bg_tilemap[which];
tile_get_info_func get_text_info;
@@ -1169,7 +1169,7 @@ void segaic16_tilemap_init(running_machine *machine, int which, int type, int co
info->numpages = 16;
info->draw_layer = segaic16_tilemap_16b_draw_layer;
info->reset = segaic16_tilemap_16b_reset;
- info->latch_timer = machine->scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
+ info->latch_timer = machine.scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
break;
case SEGAIC16_TILEMAP_16B_ALT:
@@ -1178,7 +1178,7 @@ void segaic16_tilemap_init(running_machine *machine, int which, int type, int co
info->numpages = 16;
info->draw_layer = segaic16_tilemap_16b_draw_layer;
info->reset = segaic16_tilemap_16b_reset;
- info->latch_timer = machine->scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
+ info->latch_timer = machine.scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values));
break;
default:
@@ -1226,7 +1226,7 @@ void segaic16_tilemap_init(running_machine *machine, int which, int type, int co
void segaic16_tilemap_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark)
{
- running_machine *machine = screen->machine;
+ running_machine &machine = screen->machine();
struct tilemap_info *info = &bg_tilemap[which];
/* text layer is a special common case */
@@ -1246,7 +1246,7 @@ void segaic16_tilemap_draw(device_t *screen, bitmap_t *bitmap, const rectangle *
*
*************************************/
-void segaic16_tilemap_reset(running_machine *machine, int which)
+void segaic16_tilemap_reset(running_machine &machine, int which)
{
struct tilemap_info *info = &bg_tilemap[which];
@@ -1262,13 +1262,13 @@ void segaic16_tilemap_reset(running_machine *machine, int which)
*
*************************************/
-void segaic16_tilemap_set_bank(running_machine *machine, int which, int banknum, int offset)
+void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset)
{
struct tilemap_info *info = &bg_tilemap[which];
if (info->bank[banknum] != offset)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
info->bank[banknum] = offset;
tilemap_mark_all_tiles_dirty_all(machine);
@@ -1283,7 +1283,7 @@ void segaic16_tilemap_set_bank(running_machine *machine, int which, int banknum,
*
*************************************/
-void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip)
+void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip)
{
struct tilemap_info *info = &bg_tilemap[which];
int pagenum;
@@ -1291,7 +1291,7 @@ void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip)
flip = (flip != 0);
if (info->flip != flip)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
info->flip = flip;
tilemap_set_flip(info->textmap, flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
@@ -1308,14 +1308,14 @@ void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip)
*
*************************************/
-void segaic16_tilemap_set_rowscroll(running_machine *machine, int which, int enable)
+void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable)
{
struct tilemap_info *info = &bg_tilemap[which];
enable = (enable != 0);
if (info->rowscroll != enable)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
info->rowscroll = enable;
}
@@ -1329,14 +1329,14 @@ void segaic16_tilemap_set_rowscroll(running_machine *machine, int which, int ena
*
*************************************/
-void segaic16_tilemap_set_colscroll(running_machine *machine, int which, int enable)
+void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable)
{
struct tilemap_info *info = &bg_tilemap[which];
enable = (enable != 0);
if (info->colscroll != enable)
{
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
screen->update_partial(screen->vpos());
info->colscroll = enable;
}
@@ -1361,7 +1361,7 @@ WRITE16_HANDLER( segaic16_textram_0_w )
{
/* certain ranges need immediate updates */
if (offset >= 0xe80/2)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
COMBINE_DATA(&segaic16_textram_0[offset]);
tilemap_mark_tile_dirty(bg_tilemap[0].textmap, offset);
@@ -1409,11 +1409,11 @@ WRITE16_HANDLER( segaic16_textram_0_w )
*
*******************************************************************************************/
-static void segaic16_road_hangon_decode(running_machine *machine, struct road_info *info)
+static void segaic16_road_hangon_decode(running_machine &machine, struct road_info *info)
{
int x, y;
- const UINT8 *gfx = machine->region("gfx3")->base();
- int len = machine->region("gfx3")->bytes();
+ const UINT8 *gfx = machine.region("gfx3")->base();
+ int len = machine.region("gfx3")->bytes();
/* allocate memory for the unpacked road data */
info->gfx = auto_alloc_array(machine, UINT8, 256 * 512);
@@ -1670,11 +1670,11 @@ static void segaic16_road_hangon_draw(struct road_info *info, bitmap_t *bitmap,
*
*******************************************************************************************/
-static void segaic16_road_outrun_decode(running_machine *machine, struct road_info *info)
+static void segaic16_road_outrun_decode(running_machine &machine, struct road_info *info)
{
int x, y;
- const UINT8 *gfx = machine->region("gfx3")->base();
- int len = machine->region("gfx3")->bytes();
+ const UINT8 *gfx = machine.region("gfx3")->base();
+ int len = machine.region("gfx3")->bytes();
/* allocate memory for the unpacked road data */
info->gfx = auto_alloc_array(machine, UINT8, (256 * 2 + 1) * 512);
@@ -1874,7 +1874,7 @@ static void segaic16_road_outrun_draw(struct road_info *info, bitmap_t *bitmap,
*
*************************************/
-void segaic16_road_init(running_machine *machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs)
+void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs)
{
struct road_info *info = &segaic16_road[which];
@@ -1982,7 +1982,7 @@ WRITE16_HANDLER( segaic16_road_control_0_w )
*
*************************************/
-void segaic16_rotate_init(running_machine *machine, int which, int type, int colorbase)
+void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase)
{
struct rotate_info *info = &segaic16_rotate[which];
@@ -2029,7 +2029,7 @@ void segaic16_rotate_init(running_machine *machine, int which, int type, int col
*
*************************************/
-void segaic16_rotate_draw(running_machine *machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap)
+void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap)
{
struct rotate_info *info = &segaic16_rotate[which];
INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1];
@@ -2049,7 +2049,7 @@ void segaic16_rotate_draw(running_machine *machine, int which, bitmap_t *bitmap,
{
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
UINT16 *src = (UINT16 *)srcbitmap->base;
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
INT32 tx = currx;
INT32 ty = curry;
diff --git a/src/mame/video/segaic16.h b/src/mame/video/segaic16.h
index bb39cfd8ccd..2200d9edef0 100644
--- a/src/mame/video/segaic16.h
+++ b/src/mame/video/segaic16.h
@@ -17,7 +17,7 @@ extern UINT16 *segaic16_rotateram_0;
extern UINT16 *segaic16_paletteram;
/* misc functions */
-void segaic16_set_display_enable(running_machine *machine, int enable);
+void segaic16_set_display_enable(running_machine &machine, int enable);
/* palette handling */
void segaic16_palette_init(int entries);
@@ -35,13 +35,13 @@ WRITE16_HANDLER( segaic16_paletteram_w );
#define SEGAIC16_TILEMAP_BACKGROUND 1
#define SEGAIC16_TILEMAP_TEXT 2
-void segaic16_tilemap_init(running_machine *machine, int which, int type, int colorbase, int xoffs, int numbanks);
-void segaic16_tilemap_reset(running_machine *machine, int which);
+void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks);
+void segaic16_tilemap_reset(running_machine &machine, int which);
void segaic16_tilemap_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark);
-void segaic16_tilemap_set_bank(running_machine *machine, int which, int banknum, int offset);
-void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip);
-void segaic16_tilemap_set_rowscroll(running_machine *machine, int which, int enable);
-void segaic16_tilemap_set_colscroll(running_machine *machine, int which, int enable);
+void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset);
+void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip);
+void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable);
+void segaic16_tilemap_set_colscroll(running_machine &machine, int which, int enable);
WRITE16_HANDLER( segaic16_tileram_0_w );
WRITE16_HANDLER( segaic16_textram_0_w );
@@ -53,9 +53,9 @@ WRITE16_HANDLER( segaic16_textram_0_w );
#define SEGAIC16_SPRITES_XBOARD 5
void segaic16_sprites_draw(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int which);
-void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, int offset);
-void segaic16_sprites_set_flip(running_machine *machine, int which, int flip);
-void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow);
+void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset);
+void segaic16_sprites_set_flip(running_machine &machine, int which, int flip);
+void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow);
WRITE16_HANDLER( segaic16_sprites_draw_0_w );
WRITE16_HANDLER( segaic16_sprites_draw_1_w );
@@ -70,7 +70,7 @@ WRITE16_HANDLER( segaic16_sprites_draw_1_w );
#define SEGAIC16_ROAD_BACKGROUND 0
#define SEGAIC16_ROAD_FOREGROUND 1
-void segaic16_road_init(running_machine *machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs);
+void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs);
void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle *cliprect, int priority);
READ16_HANDLER( segaic16_road_control_0_r );
WRITE16_HANDLER( segaic16_road_control_0_w );
@@ -80,8 +80,8 @@ WRITE16_HANDLER( segaic16_road_control_0_w );
#define SEGAIC16_ROTATE_YBOARD 0
-void segaic16_rotate_init(running_machine *machine, int which, int type, int colorbase);
-void segaic16_rotate_draw(running_machine *machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap);
+void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
+void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap);
READ16_HANDLER( segaic16_rotate_control_0_r );
/*************************************
@@ -117,8 +117,8 @@ struct tilemap_info
tilemap_t * textmap; /* a single text tilemap */
struct tilemap_callback_info tmap_info[16]; /* callback info for 16 tilemap pages */
struct tilemap_callback_info textmap_info; /* callback info for a single textmap page */
- void (*reset)(running_machine *machine, struct tilemap_info *info);/* reset callback */
- void (*draw_layer)(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority);
+ void (*reset)(running_machine &machine, struct tilemap_info *info);/* reset callback */
+ void (*draw_layer)(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority);
UINT16 * textram; /* pointer to textram pointer */
UINT16 * tileram; /* pointer to tileram pointer */
emu_timer * latch_timer; /* timer for latching 16b tilemap scroll values */
@@ -165,7 +165,7 @@ struct _sega16sp_interface
UINT16 colorbase; /* base color index */
INT32 ramsize; /* size of sprite RAM */
INT32 xoffs; /* X scroll offset */
- void (*draw)(running_machine *machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
+ void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
int buffer; /* should ram be buffered? */
};
@@ -183,7 +183,7 @@ struct _sega16sp_state
UINT16 colorbase; /* base color index */
INT32 ramsize; /* size of sprite RAM */
INT32 xoffs; /* X scroll offset */
- void (*draw)(running_machine *machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
+ void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
UINT16 * spriteram; /* pointer to spriteram pointer */
UINT16 * buffer; /* buffered spriteram for those that use it */
@@ -195,17 +195,17 @@ struct _sega16sp_state
DECLARE_LEGACY_DEVICE(SEGA16SP, sega16sp);
-void segaic16_sprites_hangon_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_sharrier_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_16a_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_16b_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_yboard_16b_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_yboard_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_outrun_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_xboard_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
-void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine *machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
+void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
/* the various sprite configs */
static const sega16sp_interface hangon_sega16sp_intf =
diff --git a/src/mame/video/segaic24.c b/src/mame/video/segaic24.c
index 7b7b5a14f38..68d50dc8b73 100644
--- a/src/mame/video/segaic24.c
+++ b/src/mame/video/segaic24.c
@@ -26,7 +26,7 @@ System 24 68000x2 315-5292 315-5293 315-5294 315-5242 ym2151 da
#include "segaic24.h"
-static void set_color(running_machine *machine, int color, UINT8 r, UINT8 g, UINT8 b, int highlight)
+static void set_color(running_machine &machine, int color, UINT8 r, UINT8 g, UINT8 b, int highlight)
{
palette_set_color (machine, color, MAKE_RGB(r, g, b));
@@ -39,7 +39,7 @@ static void set_color(running_machine *machine, int color, UINT8 r, UINT8 g, UIN
g = 0.6*g;
b = 0.6*b;
}
- palette_set_color(machine,color+machine->total_colors()/2, MAKE_RGB(r, g, b));
+ palette_set_color(machine,color+machine.total_colors()/2, MAKE_RGB(r, g, b));
}
// 315-5242
@@ -47,15 +47,15 @@ static void set_color(running_machine *machine, int color, UINT8 r, UINT8 g, UIN
// qgh expects to be able to read the palette shared between CPUs
READ16_HANDLER( system24temp_sys16_paletteram1_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
WRITE16_HANDLER (system24temp_sys16_paletteram1_w)
{
int r, g, b;
- COMBINE_DATA (space->machine->generic.paletteram.u16 + offset);
- data = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA (space->machine().generic.paletteram.u16 + offset);
+ data = space->machine().generic.paletteram.u16[offset];
r = (data & 0x00f) << 4;
if(data & 0x1000)
@@ -72,7 +72,7 @@ WRITE16_HANDLER (system24temp_sys16_paletteram1_w)
r |= r >> 5;
g |= g >> 5;
b |= b >> 5;
- set_color(space->machine, offset, r, g, b, data & 0x8000);
+ set_color(space->machine(), offset, r, g, b, data & 0x8000);
}
// - System 24
@@ -124,12 +124,12 @@ static TILE_GET_INFO( sys24_tile_info_1w )
SET_TILE_INFO(sys24_char_gfx_index, val & sys24_tile_mask, (val >> 7) & 0xff, 0);
}
-void sys24_tile_vh_start(running_machine *machine, UINT16 tile_mask)
+void sys24_tile_vh_start(running_machine &machine, UINT16 tile_mask)
{
sys24_tile_mask = tile_mask;
for(sys24_char_gfx_index = 0; sys24_char_gfx_index < MAX_GFX_ELEMENTS; sys24_char_gfx_index++)
- if (machine->gfx[sys24_char_gfx_index] == 0)
+ if (machine.gfx[sys24_char_gfx_index] == 0)
break;
assert(sys24_char_gfx_index != MAX_GFX_ELEMENTS);
@@ -150,25 +150,25 @@ void sys24_tile_vh_start(running_machine *machine, UINT16 tile_mask)
memset(sys24_char_ram, 0, 0x80000);
memset(sys24_tile_ram, 0, 0x10000);
- machine->gfx[sys24_char_gfx_index] = gfx_element_alloc(machine, &sys24_char_layout, (UINT8 *)sys24_char_ram, machine->total_colors() / 16, 0);
+ machine.gfx[sys24_char_gfx_index] = gfx_element_alloc(machine, &sys24_char_layout, (UINT8 *)sys24_char_ram, machine.total_colors() / 16, 0);
state_save_register_global_pointer(machine, sys24_tile_ram, 0x10000/2);
state_save_register_global_pointer(machine, sys24_char_ram, 0x80000/2);
}
-static void sys24_tile_draw_rect(running_machine *machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask,
+static void sys24_tile_draw_rect(running_machine &machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask,
UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2)
{
int y;
const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels;
const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels;
- UINT8 *prib = (UINT8 *)machine->priority_bitmap->base;
+ UINT8 *prib = (UINT8 *)machine.priority_bitmap->base;
UINT16 *dest = (UINT16 *)dm->base;
tpri |= TILEMAP_PIXEL_LAYER0;
dest += yy1*dm->rowpixels + xx1;
- prib += yy1*machine->priority_bitmap->rowpixels + xx1;
+ prib += yy1*machine.priority_bitmap->rowpixels + xx1;
mask += yy1*4;
yy2 -= yy1;
@@ -280,7 +280,7 @@ static void sys24_tile_draw_rect(running_machine *machine, bitmap_t *bm, bitmap_
source += bm->rowpixels;
trans += tm->rowpixels;
dest += dm->rowpixels;
- prib += machine->priority_bitmap->rowpixels;
+ prib += machine.priority_bitmap->rowpixels;
mask += 4;
}
}
@@ -288,16 +288,16 @@ static void sys24_tile_draw_rect(running_machine *machine, bitmap_t *bm, bitmap_
// The rgb version is used by model 1 & 2 which do not need to care
// about sprite priority hence the lack of support for the
-// machine->priority_bitmap
+// machine.priority_bitmap
-static void sys24_tile_draw_rect_rgb(running_machine *machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask,
+static void sys24_tile_draw_rect_rgb(running_machine &machine, bitmap_t *bm, bitmap_t *tm, bitmap_t *dm, const UINT16 *mask,
UINT16 tpri, UINT8 lpri, int win, int sx, int sy, int xx1, int yy1, int xx2, int yy2)
{
int y;
const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels;
const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels;
UINT16 *dest = (UINT16 *)dm->base;
- const pen_t *pens = machine->pens;
+ const pen_t *pens = machine.pens;
tpri |= TILEMAP_PIXEL_LAYER0;
@@ -402,7 +402,7 @@ static void sys24_tile_draw_rect_rgb(running_machine *machine, bitmap_t *bm, bit
}
}
-void sys24_tile_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int lpri, int flags)
+void sys24_tile_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int lpri, int flags)
{
UINT16 hscr = sys24_tile_ram[0x5000+(layer >> 1)];
UINT16 vscr = sys24_tile_ram[0x5004+(layer >> 1)];
@@ -523,7 +523,7 @@ void sys24_tile_draw(running_machine *machine, bitmap_t *bitmap, const rectangle
} else {
bitmap_t *bm, *tm;
- void (*draw)(running_machine *machine, bitmap_t *, bitmap_t *, bitmap_t *, const UINT16 *,
+ void (*draw)(running_machine &machine, bitmap_t *, bitmap_t *, bitmap_t *, const UINT16 *,
UINT16, UINT8, int, int, int, int, int, int, int);
int win = layer & 1;
@@ -607,7 +607,7 @@ WRITE16_HANDLER(sys24_char_w)
UINT16 old = sys24_char_ram[offset];
COMBINE_DATA(sys24_char_ram + offset);
if(old != sys24_char_ram[offset]) {
- gfx_element_mark_dirty(space->machine->gfx[sys24_char_gfx_index], offset / 16);
+ gfx_element_mark_dirty(space->machine().gfx[sys24_char_gfx_index], offset / 16);
}
}
@@ -637,7 +637,7 @@ WRITE32_HANDLER(sys24_char32_w)
static UINT16 *sys24_sprite_ram;
-void sys24_sprite_vh_start(running_machine *machine)
+void sys24_sprite_vh_start(running_machine &machine)
{
sys24_sprite_ram = auto_alloc_array(machine, UINT16, 0x40000/2);
@@ -669,7 +669,7 @@ void sys24_sprite_vh_start(running_machine *machine)
0 11------ --------
*/
-void sys24_sprite_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int *spri)
+void sys24_sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *spri)
{
UINT16 curspr = 0;
int countspr = 0;
@@ -831,7 +831,7 @@ void sys24_sprite_draw(running_machine *machine, bitmap_t *bitmap, const rectang
int zx1 = flipx ? 7-zx : zx;
UINT32 neweroffset = (newoffset+(zx1>>2))&0x1ffff; // crackdown sometimes attempts to use data past the end of spriteram
int c = (sys24_sprite_ram[neweroffset] >> (((~zx1) & 3) << 2)) & 0xf;
- UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, ypos1, xpos2);
+ UINT8 *pri = BITMAP_ADDR8(machine.priority_bitmap, ypos1, xpos2);
if(!(*pri & pm[c])) {
c = colors[c];
if(c) {
@@ -883,7 +883,7 @@ READ16_HANDLER(sys24_sprite_r)
static UINT16 sys24_mixer_reg[0x10];
-void sys24_mixer_vh_start(running_machine *machine)
+void sys24_mixer_vh_start(running_machine &machine)
{
memset(sys24_mixer_reg, 0, sizeof(sys24_mixer_reg));
state_save_register_global_array(machine, sys24_mixer_reg);
diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h
index 6a199171388..76d556cc68c 100644
--- a/src/mame/video/segaic24.h
+++ b/src/mame/video/segaic24.h
@@ -11,8 +11,8 @@ WRITE16_HANDLER (system24temp_sys16_paletteram1_w);
// Tilemaps
// System24
-void sys24_tile_vh_start(running_machine *machine, UINT16 tile_mask);
-void sys24_tile_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int pri, int flags);
+void sys24_tile_vh_start(running_machine &machine, UINT16 tile_mask);
+void sys24_tile_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int pri, int flags);
READ16_HANDLER(sys24_tile_r);
READ16_HANDLER(sys24_char_r);
@@ -26,15 +26,15 @@ WRITE32_HANDLER(sys24_char32_w);
// Sprites
// System24
-void sys24_sprite_vh_start(running_machine *machine);
-void sys24_sprite_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int *spri);
+void sys24_sprite_vh_start(running_machine &machine);
+void sys24_sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *spri);
WRITE16_HANDLER (sys24_sprite_w);
READ16_HANDLER (sys24_sprite_r);
// Programmable mixers
// System24
-void sys24_mixer_vh_start(running_machine *machine);
+void sys24_mixer_vh_start(running_machine &machine);
int sys24_mixer_get_reg(int reg);
WRITE16_HANDLER (sys24_mixer_w);
diff --git a/src/mame/video/segaorun.c b/src/mame/video/segaorun.c
index 6182004d772..31212d9b510 100644
--- a/src/mame/video/segaorun.c
+++ b/src/mame/video/segaorun.c
@@ -52,7 +52,7 @@ VIDEO_START( outrun )
SCREEN_UPDATE( shangon )
{
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw the low priority road layer */
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
@@ -85,12 +85,12 @@ SCREEN_UPDATE( outrun )
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw the low priority road layer */
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
diff --git a/src/mame/video/segas16a.c b/src/mame/video/segas16a.c
index 205db3024d6..ad86b37eb8c 100644
--- a/src/mame/video/segas16a.c
+++ b/src/mame/video/segas16a.c
@@ -38,12 +38,12 @@ SCREEN_UPDATE( system16a )
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw background opaquely first, not setting any priorities */
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
diff --git a/src/mame/video/segas16b.c b/src/mame/video/segas16b.c
index 1349fb6912e..404f5c9a83f 100644
--- a/src/mame/video/segas16b.c
+++ b/src/mame/video/segas16b.c
@@ -16,7 +16,7 @@
*
*************************************/
-static void video_start_common(running_machine *machine, int type)
+static void video_start_common(running_machine &machine, int type)
{
/* compute palette info */
segaic16_palette_init(0x800);
@@ -50,12 +50,12 @@ SCREEN_UPDATE( system16b )
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw background opaquely first, not setting any priorities */
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
diff --git a/src/mame/video/segas18.c b/src/mame/video/segas18.c
index 6861f9e8c42..241881afa7f 100644
--- a/src/mame/video/segas18.c
+++ b/src/mame/video/segas18.c
@@ -28,7 +28,7 @@
VIDEO_START( system18 )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
int width, height;
state->grayscale_enable = 0;
@@ -45,8 +45,8 @@ VIDEO_START( system18 )
system18_vdp_start(machine);
/* create a temp bitmap to draw the VDP data into */
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->tmp_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -64,28 +64,28 @@ VIDEO_START( system18 )
*
*************************************/
-void system18_set_grayscale(running_machine *machine, int enable)
+void system18_set_grayscale(running_machine &machine, int enable)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
enable = (enable != 0);
if (enable != state->grayscale_enable)
{
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
state->grayscale_enable = enable;
// mame_printf_debug("Grayscale = %02X\n", enable);
}
}
-void system18_set_vdp_enable(running_machine *machine, int enable)
+void system18_set_vdp_enable(running_machine &machine, int enable)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
enable = (enable != 0);
if (enable != state->vdp_enable)
{
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
state->vdp_enable = enable;
#if DEBUG_VDP
mame_printf_debug("VDP enable = %02X\n", enable);
@@ -94,13 +94,13 @@ void system18_set_vdp_enable(running_machine *machine, int enable)
}
-void system18_set_vdp_mixing(running_machine *machine, int mixing)
+void system18_set_vdp_mixing(running_machine &machine, int mixing)
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
if (mixing != state->vdp_mixing)
{
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
state->vdp_mixing = mixing;
#if DEBUG_VDP
mame_printf_debug("VDP mixing = %02X\n", mixing);
@@ -118,9 +118,9 @@ void system18_set_vdp_mixing(running_machine *machine, int mixing)
static void draw_vdp(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- segas1x_state *state = screen->machine->driver_data<segas1x_state>();
+ segas1x_state *state = screen->machine().driver_data<segas1x_state>();
int x, y;
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
@@ -150,7 +150,7 @@ static void draw_vdp(device_t *screen, bitmap_t *bitmap, const rectangle *clipre
SCREEN_UPDATE( system18 )
{
- segas1x_state *state = screen->machine->driver_data<segas1x_state>();
+ segas1x_state *state = screen->machine().driver_data<segas1x_state>();
int vdppri, vdplayer;
/*
@@ -188,21 +188,21 @@ SCREEN_UPDATE( system18 )
vdppri = (state->vdp_mixing & 1) ? (1 << vdplayer) : 0;
#if DEBUG_VDP
- if (input_code_pressed(screen->machine, KEYCODE_Q)) vdplayer = 0;
- if (input_code_pressed(screen->machine, KEYCODE_W)) vdplayer = 1;
- if (input_code_pressed(screen->machine, KEYCODE_E)) vdplayer = 2;
- if (input_code_pressed(screen->machine, KEYCODE_R)) vdplayer = 3;
- if (input_code_pressed(screen->machine, KEYCODE_A)) vdppri = 0x00;
- if (input_code_pressed(screen->machine, KEYCODE_S)) vdppri = 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_D)) vdppri = 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_F)) vdppri = 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_G)) vdppri = 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) vdplayer = 0;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) vdplayer = 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) vdplayer = 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) vdplayer = 3;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) vdppri = 0x00;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) vdppri = 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) vdppri = 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) vdppri = 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_G)) vdppri = 0x08;
#endif
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -211,7 +211,7 @@ SCREEN_UPDATE( system18 )
system18_vdp_update(state->tmp_bitmap, cliprect);
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw background opaquely first, not setting any priorities */
segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
@@ -237,12 +237,12 @@ SCREEN_UPDATE( system18 )
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
#if DEBUG_VDP
- if (state->vdp_enable && input_code_pressed(screen->machine, KEYCODE_V))
+ if (state->vdp_enable && input_code_pressed(screen->machine(), KEYCODE_V))
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
update_system18_vdp(bitmap, cliprect);
}
- if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_B))
+ if (vdp_enable && input_code_pressed(screen->machine(), KEYCODE_B))
{
FILE *f = fopen("vdp.bin", "w");
fwrite(state->tmp_bitmap->base, 1, state->tmp_bitmap->rowpixels * (state->tmp_bitmap->bpp / 8) * state->tmp_bitmap->height, f);
diff --git a/src/mame/video/segas24.c b/src/mame/video/segas24.c
index e2272e162d5..939e5d5f86e 100644
--- a/src/mame/video/segas24.c
+++ b/src/mame/video/segas24.c
@@ -27,11 +27,11 @@ SCREEN_UPDATE(system24)
int order[12], spri[4];
if(sys24_mixer_get_reg(13) & 1) {
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
return 0;
}
- bitmap_fill(screen->machine->priority_bitmap, 0, 0);
+ bitmap_fill(screen->machine().priority_bitmap, 0, 0);
bitmap_fill(bitmap, cliprect, 0);
for(i=0; i<12; i++)
@@ -41,12 +41,12 @@ SCREEN_UPDATE(system24)
level = 0;
for(i=0; i<12; i++)
if(order[i] < 8)
- sys24_tile_draw(screen->machine, bitmap, cliprect, order[i], level, 0);
+ sys24_tile_draw(screen->machine(), bitmap, cliprect, order[i], level, 0);
else {
spri[order[i]-8] = level;
level++;
}
- sys24_sprite_draw(screen->machine, bitmap, cliprect, spri);
+ sys24_sprite_draw(screen->machine(), bitmap, cliprect, spri);
return 0;
}
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index eb4b61965c8..c11fedef12a 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -225,7 +225,7 @@ struct cache_entry
static TILE_GET_INFO( get_tile_info );
static void sprite_erase_buffer(segas32_state *state);
static void sprite_swap_buffers(segas32_state *state);
-static void sprite_render_list(running_machine *machine);
+static void sprite_render_list(running_machine &machine);
@@ -236,9 +236,9 @@ static void sprite_render_list(running_machine *machine);
*
*************************************/
-static void common_start(running_machine *machine, int multi32)
+static void common_start(running_machine &machine, int multi32)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
int tmap;
/* remember whether or not we are multi32 */
@@ -301,7 +301,7 @@ VIDEO_START( multi32 )
static TIMER_CALLBACK( update_sprites )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
/* if automatic mode is selected, do it every frame (0) or every other frame (1) */
if (!(state->sprite_control[3] & 2))
{
@@ -325,11 +325,11 @@ static TIMER_CALLBACK( update_sprites )
}
-void system32_set_vblank(running_machine *machine, int state)
+void system32_set_vblank(running_machine &machine, int state)
{
/* at the end of VBLANK is when automatic sprite rendering happens */
if (!state)
- machine->scheduler().timer_set(attotime::from_usec(50), FUNC(update_sprites), 1);
+ machine.scheduler().timer_set(attotime::from_usec(50), FUNC(update_sprites), 1);
}
@@ -360,7 +360,7 @@ INLINE UINT16 xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value)
}
-INLINE void update_color(running_machine *machine, int offset, UINT16 data)
+INLINE void update_color(running_machine &machine, int offset, UINT16 data)
{
/* note that since we use this RAM directly, we don't technically need */
/* to call palette_set_color() at all; however, it does give us that */
@@ -373,7 +373,7 @@ INLINE void update_color(running_machine *machine, int offset, UINT16 data)
INLINE UINT16 common_paletteram_r(address_space *space, int which, offs_t offset)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
int convert;
/* the lower half of palette RAM is formatted xBBBBBGGGGGRRRRR */
@@ -392,7 +392,7 @@ INLINE UINT16 common_paletteram_r(address_space *space, int which, offs_t offset
static void common_paletteram_w(address_space *space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
UINT16 value;
int convert;
@@ -409,7 +409,7 @@ static void common_paletteram_w(address_space *space, int which, offs_t offset,
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
state->system32_paletteram[which][offset] = value;
- update_color(space->machine, 0x4000*which + offset, value);
+ update_color(space->machine(), 0x4000*which + offset, value);
/* if blending is enabled, writes go to both halves of palette RAM */
if (state->mixer_control[which][0x4e/2] & 0x0880)
@@ -422,7 +422,7 @@ static void common_paletteram_w(address_space *space, int which, offs_t offset,
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
state->system32_paletteram[which][offset] = value;
- update_color(space->machine, 0x4000*which + offset, value);
+ update_color(space->machine(), 0x4000*which + offset, value);
}
}
@@ -487,14 +487,14 @@ WRITE32_HANDLER( multi32_paletteram_1_w )
READ16_HANDLER( system32_videoram_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->system32_videoram[offset];
}
WRITE16_HANDLER( system32_videoram_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA(&state->system32_videoram[offset]);
/* if we are not in the control area, just update any affected tilemaps */
@@ -514,7 +514,7 @@ WRITE16_HANDLER( system32_videoram_w )
READ32_HANDLER( multi32_videoram_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->system32_videoram[offset*2+0] |
(state->system32_videoram[offset*2+1] << 16);
}
@@ -538,7 +538,7 @@ WRITE32_HANDLER( multi32_videoram_w )
READ16_HANDLER( system32_sprite_control_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
switch (offset)
{
case 0:
@@ -597,7 +597,7 @@ READ16_HANDLER( system32_sprite_control_r )
WRITE16_HANDLER( system32_sprite_control_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
if (ACCESSING_BITS_0_7)
state->sprite_control[offset & 7] = data;
}
@@ -628,14 +628,14 @@ WRITE32_HANDLER( multi32_sprite_control_w )
READ16_HANDLER( system32_spriteram_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->system32_spriteram[offset];
}
WRITE16_HANDLER( system32_spriteram_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA(&state->system32_spriteram[offset]);
state->spriteram_32bit[offset/2] =
((state->system32_spriteram[offset | 1] >> 8 ) & 0x000000ff) |
@@ -647,7 +647,7 @@ WRITE16_HANDLER( system32_spriteram_w )
READ32_HANDLER( multi32_spriteram_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->system32_spriteram[offset*2+0] |
(state->system32_spriteram[offset*2+1] << 16);
}
@@ -655,7 +655,7 @@ READ32_HANDLER( multi32_spriteram_r )
WRITE32_HANDLER( multi32_spriteram_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
data = SWAP_HALVES(data);
mem_mask = SWAP_HALVES(mem_mask);
COMBINE_DATA((UINT32 *)&state->system32_spriteram[offset*2]);
@@ -676,20 +676,20 @@ WRITE32_HANDLER( multi32_spriteram_w )
READ16_HANDLER( system32_mixer_r )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
return state->mixer_control[0][offset];
}
WRITE16_HANDLER( system32_mixer_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
COMBINE_DATA(&state->mixer_control[0][offset]);
}
WRITE32_HANDLER( multi32_mixer_0_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
data = SWAP_HALVES(data);
mem_mask = SWAP_HALVES(mem_mask);
COMBINE_DATA((UINT32 *)&state->mixer_control[0][offset*2]);
@@ -698,7 +698,7 @@ WRITE32_HANDLER( multi32_mixer_0_w )
WRITE32_HANDLER( multi32_mixer_1_w )
{
- segas32_state *state = space->machine->driver_data<segas32_state>();
+ segas32_state *state = space->machine().driver_data<segas32_state>();
data = SWAP_HALVES(data);
mem_mask = SWAP_HALVES(mem_mask);
COMBINE_DATA((UINT32 *)&state->mixer_control[1][offset*2]);
@@ -763,7 +763,7 @@ static tilemap_t *find_cache_entry(segas32_state *state, int page, int bank)
static TILE_GET_INFO( get_tile_info )
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
struct cache_entry *entry = (struct cache_entry *)param;
UINT16 data = state->system32_videoram[(entry->page & 0x7f) * 0x200 + tile_index];
SET_TILE_INFO(0, (entry->bank << 13) + (data & 0x1fff), (data >> 4) & 0x1ff, (data >> 14) & 3);
@@ -779,7 +779,7 @@ static TILE_GET_INFO( get_tile_info )
static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle *cliprect, struct extents_list *list)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
int flip = (state->system32_videoram[0x1ff00/2] >> 9) & 1;
rectangle tempclip;
rectangle clips[5];
@@ -911,7 +911,7 @@ INLINE void get_tilemaps(segas32_state *state, int bgnum, tilemap_t **tilemaps)
static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle *cliprect, int bgnum)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_t *bitmap = layer->bitmap;
struct extents_list clip_extents;
@@ -928,8 +928,8 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
/* configure the layer */
opaque = 0;
//opaque = (state->system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1;
-//if (input_code_pressed(screen.machine, KEYCODE_Z) && bgnum == 0) opaque = 1;
-//if (input_code_pressed(screen.machine, KEYCODE_X) && bgnum == 1) opaque = 1;
+//if (input_code_pressed(screen.machine(), KEYCODE_Z) && bgnum == 0) opaque = 1;
+//if (input_code_pressed(screen.machine(), KEYCODE_X) && bgnum == 1) opaque = 1;
/* determine if we're flipped */
flip = ((state->system32_videoram[0x1ff00/2] >> 9) ^ (state->system32_videoram[0x1ff00/2] >> bgnum)) & 1;
@@ -1065,7 +1065,7 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle *cliprect, int bgnum)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_t *bitmap = layer->bitmap;
struct extents_list clip_extents;
@@ -1083,8 +1083,8 @@ static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *l
/* configure the layer */
opaque = 0;
//opaque = (state->system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1;
-//if (input_code_pressed(screen.machine, KEYCODE_C) && bgnum == 2) opaque = 1;
-//if (input_code_pressed(screen.machine, KEYCODE_V) && bgnum == 3) opaque = 1;
+//if (input_code_pressed(screen.machine(), KEYCODE_C) && bgnum == 2) opaque = 1;
+//if (input_code_pressed(screen.machine(), KEYCODE_V) && bgnum == 3) opaque = 1;
/* determine if we're flipped */
flip = ((state->system32_videoram[0x1ff00/2] >> 9) ^ (state->system32_videoram[0x1ff00/2] >> bgnum)) & 1;
@@ -1218,7 +1218,7 @@ static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *l
static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle *cliprect)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
bitmap_t *bitmap = layer->bitmap;
UINT16 *tilebase;
UINT16 *gfxbase;
@@ -1378,7 +1378,7 @@ static void update_tilemap_text(screen_device &screen, struct layer_info *layer,
static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle *cliprect)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_t *bitmap = layer->bitmap;
struct extents_list clip_extents;
@@ -1506,7 +1506,7 @@ static void update_background(segas32_state *state, struct layer_info *layer, co
static UINT8 update_tilemaps(screen_device &screen, const rectangle *cliprect)
{
- segas32_state *state = screen.machine->driver_data<segas32_state>();
+ segas32_state *state = screen.machine().driver_data<segas32_state>();
int enable0 = !(state->system32_videoram[0x1ff02/2] & 0x0001) && !(state->system32_videoram[0x1ff8e/2] & 0x0002);
int enable1 = !(state->system32_videoram[0x1ff02/2] & 0x0002) && !(state->system32_videoram[0x1ff8e/2] & 0x0004);
int enable2 = !(state->system32_videoram[0x1ff02/2] & 0x0004) && !(state->system32_videoram[0x1ff8e/2] & 0x0008) && !(state->system32_videoram[0x1ff00/2] & 0x1000);
@@ -1669,9 +1669,9 @@ static void sprite_swap_buffers(segas32_state *state)
} \
}
-static int draw_one_sprite(running_machine *machine, UINT16 *data, int xoffs, int yoffs, const rectangle *clipin, const rectangle *clipout)
+static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, int yoffs, const rectangle *clipin, const rectangle *clipout)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
static const int transparency_masks[4][4] =
{
{ 0x7fff, 0x3fff, 0x1fff, 0x0fff },
@@ -1681,8 +1681,8 @@ static int draw_one_sprite(running_machine *machine, UINT16 *data, int xoffs, in
};
bitmap_t *bitmap = state->layer_data[(!state->is_multi32 || !(data[3] & 0x0800)) ? MIXER_LAYER_SPRITES_2 : MIXER_LAYER_MULTISPR_2].bitmap;
- UINT8 numbanks = machine->region("gfx2")->bytes() / 0x400000;
- const UINT32 *spritebase = (const UINT32 *)machine->region("gfx2")->base();
+ UINT8 numbanks = machine.region("gfx2")->bytes() / 0x400000;
+ const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
int indirect = data[0] & 0x2000;
int indlocal = data[0] & 0x1000;
@@ -1871,9 +1871,9 @@ bail:
-static void sprite_render_list(running_machine *machine)
+static void sprite_render_list(running_machine &machine)
{
- segas32_state *state = machine->driver_data<segas32_state>();
+ segas32_state *state = machine.driver_data<segas32_state>();
rectangle outerclip, clipin, clipout;
int xoffs = 0, yoffs = 0;
int numentries = 0;
@@ -2423,7 +2423,7 @@ static void print_mixer_data(segas32_state *state, int which)
SCREEN_UPDATE( system32 )
{
- segas32_state *state = screen->machine->driver_data<segas32_state>();
+ segas32_state *state = screen->machine().driver_data<segas32_state>();
UINT8 enablemask;
/* update the visible area */
@@ -2435,7 +2435,7 @@ SCREEN_UPDATE( system32 )
/* if the display is off, punt */
if (!state->system32_displayenable[0])
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -2446,12 +2446,12 @@ SCREEN_UPDATE( system32 )
/* debugging */
#if QWERTY_LAYER_ENABLE
- if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08;
- if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) enablemask = 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) enablemask = 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) enablemask = 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) enablemask = 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) enablemask = 0x10;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) enablemask = 0x20;
#endif
/* do the mixing */
@@ -2459,7 +2459,7 @@ SCREEN_UPDATE( system32 )
mix_all_layers(state, 0, 0, bitmap, cliprect, enablemask);
g_profiler.stop();
- if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L))
+ if (LOG_SPRITES && input_code_pressed(screen->machine(), KEYCODE_L))
{
const rectangle &visarea = screen->visible_area();
FILE *f = fopen("sprite.txt", "w");
@@ -2537,13 +2537,13 @@ SCREEN_UPDATE( system32 )
{
int showclip = -1;
-// if (input_code_pressed(screen->machine, KEYCODE_V))
+// if (input_code_pressed(screen->machine(), KEYCODE_V))
// showclip = 0;
-// if (input_code_pressed(screen->machine, KEYCODE_B))
+// if (input_code_pressed(screen->machine(), KEYCODE_B))
// showclip = 1;
-// if (input_code_pressed(screen->machine, KEYCODE_N))
+// if (input_code_pressed(screen->machine(), KEYCODE_N))
// showclip = 2;
-// if (input_code_pressed(screen->machine, KEYCODE_M))
+// if (input_code_pressed(screen->machine(), KEYCODE_M))
// showclip = 3;
// if (showclip != -1)
for (showclip = 0; showclip < 4; showclip++)
@@ -2559,7 +2559,7 @@ for (showclip = 0; showclip < 4; showclip++)
const rectangle &visarea = screen->visible_area();
rectangle rect;
- pen_t white = get_white_pen(screen->machine);
+ pen_t white = get_white_pen(screen->machine());
if (!flip)
{
rect.min_x = state->system32_videoram[0x1ff60/2 + i * 4] & 0x1ff;
@@ -2602,10 +2602,10 @@ for (showclip = 0; showclip < 4; showclip++)
SCREEN_UPDATE( multi32 )
{
- segas32_state *state = screen->machine->driver_data<segas32_state>();
+ segas32_state *state = screen->machine().driver_data<segas32_state>();
UINT8 enablemask;
- device_t *left_screen = screen->machine->device("lscreen");
+ device_t *left_screen = screen->machine().device("lscreen");
/* update the visible area */
if (state->system32_videoram[0x1ff00/2] & 0x8000)
@@ -2616,7 +2616,7 @@ SCREEN_UPDATE( multi32 )
/* if the display is off, punt */
if (!state->system32_displayenable[(screen == left_screen) ? 0 : 1])
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -2627,12 +2627,12 @@ SCREEN_UPDATE( multi32 )
/* debugging */
#if QWERTY_LAYER_ENABLE
- if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08;
- if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) enablemask = 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) enablemask = 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) enablemask = 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) enablemask = 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) enablemask = 0x10;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) enablemask = 0x20;
#endif
/* do the mixing */
@@ -2642,10 +2642,10 @@ SCREEN_UPDATE( multi32 )
if (PRINTF_MIXER_DATA)
{
- if (!input_code_pressed(screen->machine, KEYCODE_M)) print_mixer_data(state, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_M)) print_mixer_data(state, 0);
else print_mixer_data(state, 1);
}
- if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L))
+ if (LOG_SPRITES && input_code_pressed(screen->machine(), KEYCODE_L))
{
const rectangle &visarea = screen->visible_area();
FILE *f = fopen("sprite.txt", "w");
diff --git a/src/mame/video/segaxbd.c b/src/mame/video/segaxbd.c
index 837837ac983..40399f7562a 100644
--- a/src/mame/video/segaxbd.c
+++ b/src/mame/video/segaxbd.c
@@ -36,17 +36,17 @@ VIDEO_START( xboard )
SCREEN_UPDATE( xboard )
{
- segas1x_state *state = screen->machine->driver_data<segas1x_state>();
+ segas1x_state *state = screen->machine().driver_data<segas1x_state>();
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
/* reset priorities */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* draw the low priority road layer */
segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
diff --git a/src/mame/video/segaybd.c b/src/mame/video/segaybd.c
index 409cdc5b61a..61e14d180e7 100644
--- a/src/mame/video/segaybd.c
+++ b/src/mame/video/segaybd.c
@@ -17,7 +17,7 @@
VIDEO_START( yboard )
{
- segas1x_state *state = machine->driver_data<segas1x_state>();
+ segas1x_state *state = machine.driver_data<segas1x_state>();
/* compute palette info */
segaic16_palette_init(0x2000);
@@ -41,13 +41,13 @@ VIDEO_START( yboard )
SCREEN_UPDATE( yboard )
{
- segas1x_state *state = screen->machine->driver_data<segas1x_state>();
+ segas1x_state *state = screen->machine().driver_data<segas1x_state>();
rectangle yboard_clip;
/* if no drawing is happening, fill with black and get out */
if (!segaic16_display_enable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -57,7 +57,7 @@ SCREEN_UPDATE( yboard )
segaic16_sprites_draw(screen, state->tmp_bitmap, &yboard_clip, 1);
/* apply rotation */
- segaic16_rotate_draw(screen->machine, 0, bitmap, cliprect, state->tmp_bitmap);
+ segaic16_rotate_draw(screen->machine(), 0, bitmap, cliprect, state->tmp_bitmap);
/* draw the 16B sprites */
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
diff --git a/src/mame/video/sei_crtc.c b/src/mame/video/sei_crtc.c
index a7d7a720351..f6018a82ed1 100644
--- a/src/mame/video/sei_crtc.c
+++ b/src/mame/video/sei_crtc.c
@@ -206,9 +206,9 @@ static TILE_GET_INFO( seibucrtc_sc3_tile_info )
SET_TILE_INFO(4, tile, color, 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
{
- UINT16 *spriteram16 = machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = machine.generic.spriteram.u16;
int offs,fx,fy,x,y,color,sprite;
int dx,dy,ax,ay;
@@ -236,11 +236,11 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (ax=0; ax<dx; ax++)
for (ay=0; ay<dy; ay++) {
if (!fx)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+ax*16,y+ay*16,15);
else
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
sprite++,
color,fx,fy,x+(dx-1-ax)*16,y+ay*16,15);
}
@@ -271,7 +271,7 @@ VIDEO_START( seibu_crtc )
SCREEN_UPDATE( seibu_crtc )
{
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x7ff]); //black pen
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x7ff]); //black pen
tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff );
tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff );
@@ -283,13 +283,13 @@ SCREEN_UPDATE( seibu_crtc )
tilemap_set_scrolly( SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0, (SEIBU_CRTC_FIX_SY+1) & 0x1ff );
if(SEIBU_CRTC_ENABLE_SC0) { tilemap_draw(bitmap,cliprect,sc0_tilemap,0,0); }
- if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 2); }
+ if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 2); }
if(SEIBU_CRTC_ENABLE_SC2) { tilemap_draw(bitmap,cliprect,sc2_tilemap,0,0); }
- if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 1); }
+ if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 1); }
if(SEIBU_CRTC_ENABLE_SC1) { tilemap_draw(bitmap,cliprect,sc1_tilemap,0,0); }
- if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 0); }
+ if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 0); }
if(SEIBU_CRTC_ENABLE_SC3) { tilemap_draw(bitmap,cliprect,SEIBU_CRTC_SC3_PAGE_SEL ? sc3_tilemap_0 : sc3_tilemap_1,0,0); }
- if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine, bitmap,cliprect, 3); }
+ if(SEIBU_CRTC_ENABLE_SPR) { draw_sprites(screen->machine(), bitmap,cliprect, 3); }
return 0;
}
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index f7ba2953d75..dd9f72d193f 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -4,13 +4,13 @@
READ32_HANDLER( spi_layer_bank_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
return state->layer_bank;
}
WRITE32_HANDLER( spi_layer_bank_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
COMBINE_DATA( &state->layer_bank );
if (state->layer_bank & 0x80000000) {
@@ -25,9 +25,9 @@ WRITE32_HANDLER( spi_layer_bank_w )
}
}
-void rf2_set_layer_banks(running_machine *machine, int banks)
+void rf2_set_layer_banks(running_machine &machine, int banks)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
if (state->rf2_layer_bank[0] != BIT(banks,0))
{
state->rf2_layer_bank[0] = BIT(banks,0);
@@ -50,14 +50,14 @@ void rf2_set_layer_banks(running_machine *machine, int banks)
#ifdef UNUSED_FUNCTION
READ32_HANDLER( spi_layer_enable_r )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
return state->layer_enable;
}
#endif
WRITE32_HANDLER( spi_layer_enable_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
COMBINE_DATA( &state->layer_enable );
tilemap_set_enable(state->back_layer, (state->layer_enable & 0x1) ^ 0x1);
tilemap_set_enable(state->mid_layer, ((state->layer_enable >> 1) & 0x1) ^ 0x1);
@@ -66,7 +66,7 @@ WRITE32_HANDLER( spi_layer_enable_w )
WRITE32_HANDLER( tilemap_dma_start_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (state->video_dma_address != 0)
{
int i;
@@ -181,7 +181,7 @@ WRITE32_HANDLER( tilemap_dma_start_w )
WRITE32_HANDLER( palette_dma_start_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (state->video_dma_address != 0)
{
int i;
@@ -190,8 +190,8 @@ WRITE32_HANDLER( palette_dma_start_w )
UINT32 color = state->spimainram[(state->video_dma_address / 4) + i - 0x200];
if (state->palette_ram[i] != color) {
state->palette_ram[i] = color;
- palette_set_color_rgb( space->machine, (i * 2), pal5bit(state->palette_ram[i] >> 0), pal5bit(state->palette_ram[i] >> 5), pal5bit(state->palette_ram[i] >> 10) );
- palette_set_color_rgb( space->machine, (i * 2) + 1, pal5bit(state->palette_ram[i] >> 16), pal5bit(state->palette_ram[i] >> 21), pal5bit(state->palette_ram[i] >> 26) );
+ palette_set_color_rgb( space->machine(), (i * 2), pal5bit(state->palette_ram[i] >> 0), pal5bit(state->palette_ram[i] >> 5), pal5bit(state->palette_ram[i] >> 10) );
+ palette_set_color_rgb( space->machine(), (i * 2) + 1, pal5bit(state->palette_ram[i] >> 16), pal5bit(state->palette_ram[i] >> 21), pal5bit(state->palette_ram[i] >> 26) );
}
}
}
@@ -199,7 +199,7 @@ WRITE32_HANDLER( palette_dma_start_w )
WRITE32_HANDLER( sprite_dma_start_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
if (state->video_dma_address != 0)
{
memcpy( state->sprite_ram, &state->spimainram[(state->video_dma_address / 4) - 0x200], state->sprite_dma_length);
@@ -208,20 +208,20 @@ WRITE32_HANDLER( sprite_dma_start_w )
WRITE32_HANDLER( video_dma_length_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
COMBINE_DATA( &state->video_dma_length );
}
WRITE32_HANDLER( video_dma_address_w )
{
- seibuspi_state *state = space->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = space->machine().driver_data<seibuspi_state>();
COMBINE_DATA( &state->video_dma_address );
}
static void drawgfx_blend(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
{
- seibuspi_state *state = gfx->machine->driver_data<seibuspi_state>();
- const pen_t *pens = &gfx->machine->pens[gfx->color_base];
+ seibuspi_state *state = gfx->machine().driver_data<seibuspi_state>();
+ const pen_t *pens = &gfx->machine().pens[gfx->color_base];
const UINT8 *dp;
int i, j;
int x1, x2;
@@ -343,9 +343,9 @@ static const int sprite_ytable[2][8] =
{ 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 }
};
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
INT16 xpos, ypos;
int tile_num, color;
int width, height;
@@ -353,7 +353,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int a;
int priority;
int x,y, x1, y1;
- const gfx_element *gfx = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[2];
if( state->layer_enable & 0x10 )
return;
@@ -411,7 +411,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TILE_GET_INFO( get_text_tile_info )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int offs = tile_index / 2;
int tile = (state->tilemap_ram[offs + state->text_layer_offset] >> ((tile_index & 0x1) ? 16 : 0)) & 0xffff;
int color = (tile >> 12) & 0xf;
@@ -423,7 +423,7 @@ static TILE_GET_INFO( get_text_tile_info )
static TILE_GET_INFO( get_back_tile_info )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int offs = tile_index / 2;
int tile = (state->tilemap_ram[offs] >> ((tile_index & 0x1) ? 16 : 0)) & 0xffff;
int color = (tile >> 13) & 0x7;
@@ -438,7 +438,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_mid_tile_info )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int offs = tile_index / 2;
int tile = (state->tilemap_ram[offs + state->mid_layer_offset] >> ((tile_index & 0x1) ? 16 : 0)) & 0xffff;
int color = (tile >> 13) & 0x7;
@@ -454,7 +454,7 @@ static TILE_GET_INFO( get_mid_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int offs = tile_index / 2;
int tile = (state->tilemap_ram[offs + state->fore_layer_offset] >> ((tile_index & 0x1) ? 16 : 0)) & 0xffff;
int color = (tile >> 13) & 0x7;
@@ -472,7 +472,7 @@ static TILE_GET_INFO( get_fore_tile_info )
VIDEO_START( spi )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
int region_length;
@@ -517,7 +517,7 @@ VIDEO_START( spi )
for (i = 6000; i < 6016; i++) { state->alpha_table[i] = 1; }
for (i = 6128; i < 6144; i++) { state->alpha_table[i] = 1; }
- region_length = machine->region("gfx2")->bytes();
+ region_length = machine.region("gfx2")->bytes();
if (region_length <= 0x300000)
{
@@ -536,7 +536,7 @@ VIDEO_START( spi )
#ifdef UNUSED_FUNCTION
static void set_rowscroll(tilemap_t *layer, int scroll, INT16* rows)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
int x = state->spi_scrollram[scroll] & 0xffff;
int y = (state->spi_scrollram[scroll] >> 16) & 0xffff;
@@ -549,7 +549,7 @@ static void set_rowscroll(tilemap_t *layer, int scroll, INT16* rows)
static void set_scroll(tilemap_t *layer, int scroll)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int x = state->spi_scrollram[scroll] & 0xffff;
int y = (state->spi_scrollram[scroll] >> 16) & 0xffff;
tilemap_set_scrollx(layer, 0, x);
@@ -558,9 +558,9 @@ static void set_scroll(tilemap_t *layer, int scroll)
#endif
-static void combine_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
+static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i,j;
UINT16 *s;
UINT32 *d;
@@ -593,11 +593,11 @@ static void combine_tilemap(running_machine *machine, bitmap_t *bitmap, const re
UINT8 alpha = state->alpha_table[pen];
if (alpha)
{
- *d = alpha_blend_r32(*d, machine->pens[pen], 0x7f);
+ *d = alpha_blend_r32(*d, machine.pens[pen], 0x7f);
}
else
{
- *d = machine->pens[pen];
+ *d = machine.pens[pen];
}
}
++d;
@@ -609,7 +609,7 @@ static void combine_tilemap(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( spi )
{
- seibuspi_state *state = screen->machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = screen->machine().driver_data<seibuspi_state>();
INT16 *back_rowscroll, *mid_rowscroll, *fore_rowscroll;
if( state->layer_bank & 0x80000000 ) {
back_rowscroll = (INT16*)&state->tilemap_ram[0x200];
@@ -625,35 +625,35 @@ SCREEN_UPDATE( spi )
bitmap_fill(bitmap, cliprect, 0);
if (!(state->layer_enable & 0x1))
- combine_tilemap(screen->machine, bitmap, cliprect, state->back_layer, state->spi_scrollram[0] & 0xffff, (state->spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
+ combine_tilemap(screen->machine(), bitmap, cliprect, state->back_layer, state->spi_scrollram[0] & 0xffff, (state->spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
// if fore layer is enabled, draw priority 1 sprites behind mid layer
if (!(state->layer_enable & 0x4))
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
if (!(state->layer_enable & 0x2))
- combine_tilemap(screen->machine, bitmap, cliprect, state->mid_layer, state->spi_scrollram[1] & 0xffff, (state->spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
+ combine_tilemap(screen->machine(), bitmap, cliprect, state->mid_layer, state->spi_scrollram[1] & 0xffff, (state->spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
// if fore layer is disabled, draw priority 1 sprites above mid layer
if ((state->layer_enable & 0x4))
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
if (!(state->layer_enable & 0x4))
- combine_tilemap(screen->machine, bitmap, cliprect, state->fore_layer, state->spi_scrollram[2] & 0xffff, (state->spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
+ combine_tilemap(screen->machine(), bitmap, cliprect, state->fore_layer, state->spi_scrollram[2] & 0xffff, (state->spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
- combine_tilemap(screen->machine, bitmap, cliprect, state->text_layer, 0, 0, 0, NULL);
+ combine_tilemap(screen->machine(), bitmap, cliprect, state->text_layer, 0, 0, 0, NULL);
return 0;
}
VIDEO_START( sys386f2 )
{
- seibuspi_state *state = machine->driver_data<seibuspi_state>();
+ seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
state->palette_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
@@ -673,9 +673,9 @@ VIDEO_START( sys386f2 )
SCREEN_UPDATE( sys386f2 )
{
bitmap_fill(bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
return 0;
}
diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c
index ec6ed0df2c8..9bca7706513 100644
--- a/src/mame/video/seicross.c
+++ b/src/mame/video/seicross.c
@@ -30,7 +30,7 @@ PALETTE_INIT( seicross )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -55,7 +55,7 @@ PALETTE_INIT( seicross )
WRITE8_HANDLER( seicross_videoram_w )
{
- seicross_state *state = space->machine->driver_data<seicross_state>();
+ seicross_state *state = space->machine().driver_data<seicross_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -66,7 +66,7 @@ WRITE8_HANDLER( seicross_colorram_w )
/* bit 5 of the address is not used for color memory. There is just */
/* 512k of memory; every two consecutive rows share the same memory */
/* region. */
- seicross_state *state = space->machine->driver_data<seicross_state>();
+ seicross_state *state = space->machine().driver_data<seicross_state>();
offset &= 0xffdf;
@@ -79,7 +79,7 @@ WRITE8_HANDLER( seicross_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- seicross_state *state = machine->driver_data<seicross_state>();
+ seicross_state *state = machine.driver_data<seicross_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x10) << 4);
int color = state->colorram[tile_index] & 0x0f;
int flags = ((state->colorram[tile_index] & 0x40) ? TILE_FLIPX : 0) | ((state->colorram[tile_index] & 0x80) ? TILE_FLIPY : 0);
@@ -89,7 +89,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( seicross )
{
- seicross_state *state = machine->driver_data<seicross_state>();
+ seicross_state *state = machine.driver_data<seicross_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -97,9 +97,9 @@ VIDEO_START( seicross )
tilemap_set_scroll_cols(state->bg_tilemap, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- seicross_state *state = machine->driver_data<seicross_state>();
+ seicross_state *state = machine.driver_data<seicross_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -107,13 +107,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
{
int x = spriteram[offs + 3];
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
spriteram[offs + 1] & 0x0f,
spriteram[offs] & 0x40,spriteram[offs] & 0x80,
x,240-spriteram[offs + 2],0);
if(x>0xf0)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
spriteram[offs + 1] & 0x0f,
spriteram[offs] & 0x40,spriteram[offs] & 0x80,
@@ -123,13 +123,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (offs = state->spriteram2_size - 4; offs >= 0; offs -= 4)
{
int x = spriteram_2[offs + 3];
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
spriteram_2[offs + 1] & 0x0f,
spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
x,240-spriteram_2[offs + 2],0);
if(x>0xf0)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
spriteram_2[offs + 1] & 0x0f,
spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
@@ -139,13 +139,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( seicross )
{
- seicross_state *state = screen->machine->driver_data<seicross_state>();
+ seicross_state *state = screen->machine().driver_data<seicross_state>();
int col;
for (col = 0; col < 32; col++)
tilemap_set_scrolly(state->bg_tilemap, col, state->row_scroll[col]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/senjyo.c b/src/mame/video/senjyo.c
index 429c306bed9..908914ffff0 100644
--- a/src/mame/video/senjyo.c
+++ b/src/mame/video/senjyo.c
@@ -19,7 +19,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 attr = state->fgcolorram[tile_index];
int flags = (attr & 0x80) ? TILE_FLIPY : 0;
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( senjyo_bg1_tile_info )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 code = state->bg1videoram[tile_index];
SET_TILE_INFO(
@@ -50,7 +50,7 @@ static TILE_GET_INFO( starforc_bg1_tile_info )
/* Star Force has more tiles in bg1, so to get a uniform color code spread */
/* they wired bit 7 of the tile code in place of bit 4 to get the color code */
static const UINT8 colormap[8] = { 0, 2, 4, 6, 1, 3, 5, 7 };
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 code = state->bg1videoram[tile_index];
SET_TILE_INFO(
@@ -62,7 +62,7 @@ static TILE_GET_INFO( starforc_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 code = state->bg2videoram[tile_index];
SET_TILE_INFO(
@@ -74,7 +74,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
static TILE_GET_INFO( get_bg3_tile_info )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 code = state->bg3videoram[tile_index];
SET_TILE_INFO(
@@ -94,7 +94,7 @@ static TILE_GET_INFO( get_bg3_tile_info )
VIDEO_START( senjyo )
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -128,35 +128,35 @@ VIDEO_START( senjyo )
WRITE8_HANDLER( senjyo_fgvideoram_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( senjyo_fgcolorram_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->fgcolorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( senjyo_bg1videoram_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->bg1videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap, offset);
}
WRITE8_HANDLER( senjyo_bg2videoram_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->bg2videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
}
WRITE8_HANDLER( senjyo_bg3videoram_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
state->bg3videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg3_tilemap, offset);
@@ -164,7 +164,7 @@ WRITE8_HANDLER( senjyo_bg3videoram_w )
WRITE8_HANDLER( senjyo_bgstripes_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
*state->bgstripesram = data;
}
@@ -175,9 +175,9 @@ WRITE8_HANDLER( senjyo_bgstripes_w )
***************************************************************************/
-static void draw_bgbitmap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_bgbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
int x,y,pen,strwid,count;
@@ -212,9 +212,9 @@ static void draw_bgbitmap(running_machine *machine, bitmap_t *bitmap,const recta
}
}
-static void draw_radar(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_radar(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect)
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
int offs,x;
for (offs = 0;offs < 0x400;offs++)
@@ -238,9 +238,9 @@ static void draw_radar(running_machine *machine,bitmap_t *bitmap,const rectangle
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int priority)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int priority)
{
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -280,7 +280,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[big ? 5 : 4],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[big ? 5 : 4],
spriteram[offs],
spriteram[offs + 1] & 0x07,
flipx,flipy,
@@ -291,16 +291,16 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( senjyo )
{
- senjyo_state *state = screen->machine->driver_data<senjyo_state>();
+ senjyo_state *state = screen->machine().driver_data<senjyo_state>();
int i;
/* two colors for the radar dots (verified on the real board) */
- palette_set_color(screen->machine,512,MAKE_RGB(0xff,0x00,0x00)); /* red for enemies */
- palette_set_color(screen->machine,513,MAKE_RGB(0xff,0xff,0x00)); /* yellow for player */
+ palette_set_color(screen->machine(),512,MAKE_RGB(0xff,0x00,0x00)); /* red for enemies */
+ palette_set_color(screen->machine(),513,MAKE_RGB(0xff,0xff,0x00)); /* yellow for player */
{
- int flip = flip_screen_get(screen->machine);
+ int flip = flip_screen_get(screen->machine());
int scrollx,scrolly;
for (i = 0;i < 32;i++)
@@ -333,16 +333,16 @@ SCREEN_UPDATE( senjyo )
tilemap_set_scrolly(state->bg3_tilemap, 0, scrolly);
}
- draw_bgbitmap(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_bgbitmap(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg3_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->bg1_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_radar(screen->machine, bitmap, cliprect);
+ draw_radar(screen->machine(), bitmap, cliprect);
#if 0
{
diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c
index 37dbf7d53d8..5c11e8708eb 100644
--- a/src/mame/video/seta.c
+++ b/src/mame/video/seta.c
@@ -212,9 +212,9 @@ static const game_offset game_offsets[] =
---- --1- Coin #1 Counter
---- ---0 Coin #0 Counter */
-void seta_coin_lockout_w(running_machine *machine, int data)
+void seta_coin_lockout_w(running_machine &machine, int data)
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
static const char *const seta_nolockout[8] = { "blandia", "gundhara", "kamenrid", "zingzip", "eightfrc", "extdwnhl", "sokonuke", "zombraid"};
/* Only compute seta_coin_lockout when confronted with a new gamedrv */
@@ -226,8 +226,8 @@ void seta_coin_lockout_w(running_machine *machine, int data)
state->coin_lockout = 1;
for (i=0; i<ARRAY_LENGTH(seta_nolockout); i++)
{
- if (strcmp(machine->system().name, seta_nolockout[i]) == 0 ||
- strcmp(machine->system().parent, seta_nolockout[i]) == 0)
+ if (strcmp(machine.system().name, seta_nolockout[i]) == 0 ||
+ strcmp(machine.system().parent, seta_nolockout[i]) == 0)
{
state->coin_lockout = 0;
break;
@@ -248,7 +248,7 @@ void seta_coin_lockout_w(running_machine *machine, int data)
WRITE16_HANDLER( seta_vregs_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
COMBINE_DATA(&state->vregs[offset]);
switch (offset)
{
@@ -264,12 +264,12 @@ WRITE16_HANDLER( seta_vregs_w )
---- ---- ---- ---0 Coin #0 Counter */
if (ACCESSING_BITS_0_7)
{
- device_t *x1_010 = space->machine->device("x1snd");
- seta_coin_lockout_w (space->machine, data & 0x0f);
+ device_t *x1_010 = space->machine().device("x1snd");
+ seta_coin_lockout_w (space->machine(), data & 0x0f);
if (x1_010 != NULL)
seta_sound_enable_w (x1_010, data & 0x20);
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
}
break;
@@ -291,8 +291,8 @@ WRITE16_HANDLER( seta_vregs_w )
if (new_bank != state->samples_bank)
{
- UINT8 *rom = space->machine->region("x1snd")->base();
- int samples_len = space->machine->region("x1snd")->bytes();
+ UINT8 *rom = space->machine().region("x1snd")->base();
+ int samples_len = space->machine().region("x1snd")->bytes();
int addr;
state->samples_bank = new_bank;
@@ -360,9 +360,9 @@ Offset + 0x4:
***************************************************************************/
-INLINE void twineagl_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int offset )
+INLINE void twineagl_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int offset )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
UINT16 *vram = state->vram_0 + offset;
UINT16 code = vram[ tile_index ];
UINT16 attr = vram[ tile_index + 0x800 ];
@@ -375,16 +375,16 @@ static TILE_GET_INFO( twineagl_get_tile_info_0 ) { twineagl_tile_info( machine,
static TILE_GET_INFO( twineagl_get_tile_info_1 ) { twineagl_tile_info( machine, tileinfo, tile_index, 0x1000 ); }
-INLINE void get_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int layer, int offset )
+INLINE void get_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int layer, int offset )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
int gfx = 1 + layer;
UINT16 *vram = (layer == 0) ? state->vram_0 + offset : state->vram_2 + offset;
UINT16 *vctrl = (layer == 0) ? state->vctrl_0 : state->vctrl_2;
UINT16 code = vram[ tile_index ];
UINT16 attr = vram[ tile_index + 0x800 ];
- if(machine->gfx[gfx + ((vctrl[ 4/2 ] & 0x10) >> state->color_mode_shift)] != NULL)
+ if(machine.gfx[gfx + ((vctrl[ 4/2 ] & 0x10) >> state->color_mode_shift)] != NULL)
{
gfx += (vctrl[ 4/2 ] & 0x10) >> state->color_mode_shift;
}
@@ -404,7 +404,7 @@ static TILE_GET_INFO( get_tile_info_3 ) { get_tile_info( machine, tileinfo, tile
WRITE16_HANDLER( seta_vram_0_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
COMBINE_DATA(&state->vram_0[offset]);
if (offset & 0x1000)
@@ -415,7 +415,7 @@ WRITE16_HANDLER( seta_vram_0_w )
WRITE16_HANDLER( seta_vram_2_w )
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
COMBINE_DATA(&state->vram_2[offset]);
if (offset & 0x1000)
@@ -428,12 +428,12 @@ WRITE16_HANDLER( twineagl_tilebank_w )
{
if (ACCESSING_BITS_0_7)
{
- seta_state *state = space->machine->driver_data<seta_state>();
+ seta_state *state = space->machine().driver_data<seta_state>();
data &= 0xff;
if (state->twineagl_tilebank[offset] != data)
{
state->twineagl_tilebank[offset] = data;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
}
@@ -443,7 +443,7 @@ WRITE16_HANDLER( twineagl_tilebank_w )
/* 2 layers */
VIDEO_START( seta_2_layers )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
VIDEO_START_CALL( seta_no_layers );
@@ -478,7 +478,7 @@ VIDEO_START( seta_2_layers )
/* 1 layer */
VIDEO_START( seta_1_layer )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
VIDEO_START_CALL( seta_no_layers );
@@ -500,7 +500,7 @@ VIDEO_START( seta_1_layer )
VIDEO_START( twineagl_1_layer )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
VIDEO_START_CALL( seta_no_layers );
@@ -522,7 +522,7 @@ VIDEO_START( twineagl_1_layer )
/* NO layers, only sprites */
VIDEO_START( seta_no_layers )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
state->tilemap_0 = 0;
state->tilemap_1 = 0;
@@ -532,14 +532,14 @@ VIDEO_START( seta_no_layers )
state->tilemaps_flip = 0;
state->global_offsets = game_offsets;
- while (state->global_offsets->gamename && strcmp(machine->system().name, state->global_offsets->gamename))
+ while (state->global_offsets->gamename && strcmp(machine.system().name, state->global_offsets->gamename))
state->global_offsets++;
state->samples_bank = -1; // set the samples bank to an out of range value at start-up
}
VIDEO_START( oisipuzl_2_layers )
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
VIDEO_START_CALL(seta_2_layers);
state->tilemaps_flip = 1;
@@ -565,19 +565,19 @@ PALETTE_INIT( blandia )
int color, pen;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x600*2);
+ machine.colortable = colortable_alloc(machine, 0x600*2);
for (color = 0; color < 0x20; color++)
{
for (pen = 0; pen < 0x40; pen++)
{
// layer 2-3
- colortable_entry_set_value(machine->colortable, 0x0200 + ((color << 6) | pen), 0x200 + ((color << 4) | (pen & 0x0f)));
- colortable_entry_set_value(machine->colortable, 0x1200 + ((color << 6) | pen), 0x200 + pen);
+ colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x200 + ((color << 4) | (pen & 0x0f)));
+ colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x200 + pen);
// layer 0-1
- colortable_entry_set_value(machine->colortable, 0x0a00 + ((color << 6) | pen), 0x400 + ((color << 4) | (pen & 0x0f)));
- colortable_entry_set_value(machine->colortable, 0x1a00 + ((color << 6) | pen), 0x400 + pen);
+ colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x400 + ((color << 4) | (pen & 0x0f)));
+ colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x400 + pen);
}
}
@@ -585,7 +585,7 @@ PALETTE_INIT( blandia )
// what are used for palette from 0x800 to 0xBFF?
for(int i = 0; i < 0x2200; i++)
{
- colortable_entry_set_value(machine->colortable, 0x2200 + i, 0x600 + (i & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x2200 + i, 0x600 + (i & 0x1ff));
}
}
@@ -598,16 +598,16 @@ PALETTE_INIT( gundhara )
int color, pen;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x600);
+ machine.colortable = colortable_alloc(machine, 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine->colortable, 0x0200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine->colortable, 0x1200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
- colortable_entry_set_value(machine->colortable, 0x0a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine->colortable, 0x1a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
@@ -619,16 +619,16 @@ PALETTE_INIT( jjsquawk )
int color, pen;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x600);
+ machine.colortable = colortable_alloc(machine, 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine->colortable, 0x0200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff)); // used by madshark
- colortable_entry_set_value(machine->colortable, 0x1200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x0200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff)); // used by madshark
+ colortable_entry_set_value(machine.colortable, 0x1200 + ((color << 6) | pen), 0x400 + (((color << 4) + pen) & 0x1ff));
- colortable_entry_set_value(machine->colortable, 0x0a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff)); // used by madshark
- colortable_entry_set_value(machine->colortable, 0x1a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x0a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff)); // used by madshark
+ colortable_entry_set_value(machine.colortable, 0x1a00 + ((color << 6) | pen), 0x200 + (((color << 4) + pen) & 0x1ff));
}
}
@@ -639,13 +639,13 @@ PALETTE_INIT( zingzip )
int color, pen;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x600);
+ machine.colortable = colortable_alloc(machine, 0x600);
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine->colortable, 0x400 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine->colortable, 0xc00 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x400 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine.colortable, 0xc00 + ((color << 6) | pen), 0x400 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
@@ -662,8 +662,8 @@ PALETTE_INIT( inttoote )
PALETTE_INIT( setaroul )
{
- machine->gfx[0]->color_granularity=16;
- machine->gfx[1]->color_granularity=16;
+ machine.gfx[0]->color_granularity=16;
+ machine.gfx[1]->color_granularity=16;
PALETTE_INIT_CALL(inttoote);
}
@@ -674,7 +674,7 @@ PALETTE_INIT( usclssic )
int x;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x400);
+ machine.colortable = colortable_alloc(machine, 0x400);
/* DECODE PROM */
for (x = 0; x < 0x200 ; x++)
@@ -684,23 +684,23 @@ PALETTE_INIT( usclssic )
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
if (x >= 0x100)
- colortable_palette_set_color(machine->colortable, x + 0x000, color);
+ colortable_palette_set_color(machine.colortable, x + 0x000, color);
else
- colortable_palette_set_color(machine->colortable, x + 0x300, color);
+ colortable_palette_set_color(machine.colortable, x + 0x300, color);
}
for (color = 0; color < 0x20; color++)
for (pen = 0; pen < 0x40; pen++)
{
- colortable_entry_set_value(machine->colortable, 0x200 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
- colortable_entry_set_value(machine->colortable, 0xa00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
+ colortable_entry_set_value(machine.colortable, 0x200 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff)); // used?
+ colortable_entry_set_value(machine.colortable, 0xa00 + ((color << 6) | pen), 0x200 + ((((color & ~3) << 4) + pen) & 0x1ff));
}
}
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
offs_t i;
for (i = 0; i < state->paletteram_size / 2; i++)
@@ -709,8 +709,8 @@ static void set_pens(running_machine *machine)
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
- if (machine->colortable != NULL)
- colortable_palette_set_color(machine->colortable, i, color);
+ if (machine.colortable != NULL)
+ colortable_palette_set_color(machine.colortable, i, color);
else
palette_set_color(machine, i, color);
}
@@ -723,8 +723,8 @@ static void set_pens(running_machine *machine)
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
- if (machine->colortable != NULL)
- colortable_palette_set_color(machine->colortable, i + state->paletteram_size / 2, color);
+ if (machine.colortable != NULL)
+ colortable_palette_set_color(machine.colortable, i + state->paletteram_size / 2, color);
else
palette_set_color(machine, i + state->paletteram_size / 2, color);
}
@@ -732,9 +732,9 @@ static void set_pens(running_machine *machine)
}
-static void usclssic_set_pens(running_machine *machine)
+static void usclssic_set_pens(running_machine &machine)
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
offs_t i;
for (i = 0; i < 0x200; i++)
@@ -744,9 +744,9 @@ static void usclssic_set_pens(running_machine *machine)
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
if (i >= 0x100)
- colortable_palette_set_color(machine->colortable, i - 0x100, color);
+ colortable_palette_set_color(machine.colortable, i - 0x100, color);
else
- colortable_palette_set_color(machine->colortable, i + 0x200, color);
+ colortable_palette_set_color(machine.colortable, i + 0x200, color);
}
}
@@ -761,14 +761,14 @@ static void usclssic_set_pens(running_machine *machine)
***************************************************************************/
-static void draw_sprites_map(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites_map(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
UINT16 *spriteram16 = state->spriteram;
int offs, col;
int xoffs, yoffs;
- int total_color_codes = machine->config().m_gfxdecodeinfo[0].total_color_codes;
+ int total_color_codes = machine.config().m_gfxdecodeinfo[0].total_color_codes;
int ctrl = spriteram16[ 0x600/2 ];
int ctrl2 = spriteram16[ 0x602/2 ];
@@ -853,7 +853,7 @@ twineagl: 000 027 00 0f (test mode)
color = ( color >> (16-5) ) % total_color_codes;
code = (code & 0x3fff) + (bank * 0x4000);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx, flipy,
@@ -866,14 +866,14 @@ twineagl: 000 027 00 0f (test mode)
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- seta_state *state = machine->driver_data<seta_state>();
+ seta_state *state = machine.driver_data<seta_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
int xoffs, yoffs;
- int total_color_codes = machine->config().m_gfxdecodeinfo[0].total_color_codes;
+ int total_color_codes = machine.config().m_gfxdecodeinfo[0].total_color_codes;
int ctrl = spriteram16[ 0x600/2 ];
int ctrl2 = spriteram16[ 0x602/2 ];
@@ -907,7 +907,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (flip)
{
- y = (0x100 - machine->primary_screen->height()) + max_y - y;
+ y = (0x100 - machine.primary_screen->height()) + max_y - y;
flipx = !flipx;
flipy = !flipy;
}
@@ -916,7 +916,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
y = max_y - y;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx, flipy,
@@ -925,10 +925,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_tilemap_palette_effect(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
+static void draw_tilemap_palette_effect(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
{
int y;
- const gfx_element *gfx_tilemap = machine->gfx[gfxnum];
+ const gfx_element *gfx_tilemap = machine.gfx[gfxnum];
const bitmap_t *src_bitmap = tilemap_get_pixmap(tilemap);
int width_mask, height_mask;
int opaque_mask = gfx_tilemap->color_granularity - 1;
@@ -960,11 +960,11 @@ static void draw_tilemap_palette_effect(running_machine *machine, bitmap_t *bitm
// pixels with the last color are not drawn and the 2nd palette is added to the current bitmap color
if((p & pixel_effect_mask) == pixel_effect_mask)
{
- dest[x] = machine->total_colors() / 2 + dest[x];
+ dest[x] = machine.total_colors() / 2 + dest[x];
}
else
{
- dest[x] = machine->pens[p];
+ dest[x] = machine.pens[p];
}
}
}
@@ -984,9 +984,9 @@ static void draw_tilemap_palette_effect(running_machine *machine, bitmap_t *bitm
/* For games without tilemaps */
SCREEN_UPDATE( seta_no_layers )
{
- set_pens(screen->machine);
+ set_pens(screen->machine());
bitmap_fill(bitmap,cliprect,0x1f0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
@@ -994,7 +994,7 @@ SCREEN_UPDATE( seta_no_layers )
/* For games with 1 or 2 tilemaps */
static SCREEN_UPDATE( seta_layers )
{
- seta_state *state = screen->machine->driver_data<seta_state>();
+ seta_state *state = screen->machine().driver_data<seta_state>();
int layers_ctrl = -1;
int enab_0, enab_1, x_0, x_1=0, y_0, y_1=0;
@@ -1025,7 +1025,7 @@ static SCREEN_UPDATE( seta_layers )
flip ^= state->tilemaps_flip;
- tilemap_set_flip_all(screen->machine, flip ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0 );
+ tilemap_set_flip_all(screen->machine(), flip ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0 );
x_0 = state->vctrl_0[ 0/2 ];
y_0 = state->vctrl_0[ 2/2 ];
@@ -1083,11 +1083,11 @@ static SCREEN_UPDATE( seta_layers )
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{ int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
if (state->tilemap_2)
@@ -1109,7 +1109,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
if (order & 2) // layer-sprite priority?
{
- if (layers_ctrl & 8) draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 8) draw_sprites(screen->machine(),bitmap,cliprect);
if(order & 4)
{
@@ -1129,7 +1129,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 0);
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->tilemap_1, 0, 0);
- if (layers_ctrl & 8) draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 8) draw_sprites(screen->machine(), bitmap,cliprect);
}
}
else
@@ -1139,17 +1139,17 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
if (order & 2) // layer-sprite priority?
{
- if (layers_ctrl & 8) draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 8) draw_sprites(screen->machine(), bitmap,cliprect);
if((order & 4) && state->paletteram2 != NULL)
{
if(tilemap_get_enable(state->tilemap_2))
{
- draw_tilemap_palette_effect(screen->machine, bitmap, cliprect, state->tilemap_2, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
+ draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->tilemap_2, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
}
else
{
- draw_tilemap_palette_effect(screen->machine, bitmap, cliprect, state->tilemap_3, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
+ draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->tilemap_3, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
}
}
else
@@ -1172,11 +1172,11 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
{
if(tilemap_get_enable(state->tilemap_2))
{
- draw_tilemap_palette_effect(screen->machine, bitmap, cliprect, state->tilemap_2, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
+ draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->tilemap_2, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
}
else
{
- draw_tilemap_palette_effect(screen->machine, bitmap, cliprect, state->tilemap_3, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
+ draw_tilemap_palette_effect(screen->machine(), bitmap, cliprect, state->tilemap_3, x_1, y_1, 2 + ((state->vctrl_2[ 4/2 ] & 0x10) >> state->color_mode_shift), flip);
}
}
else
@@ -1193,7 +1193,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
}
}
- if (layers_ctrl & 8) draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 8) draw_sprites(screen->machine(), bitmap,cliprect);
}
}
return 0;
@@ -1202,14 +1202,14 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
SCREEN_UPDATE( seta )
{
- set_pens(screen->machine);
+ set_pens(screen->machine());
return SCREEN_UPDATE_CALL(seta_layers);
}
SCREEN_UPDATE( usclssic )
{
- usclssic_set_pens(screen->machine);
+ usclssic_set_pens(screen->machine());
return SCREEN_UPDATE_CALL(seta_layers);
}
diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c
index 903047a9858..3df7bb64237 100644
--- a/src/mame/video/seta2.c
+++ b/src/mame/video/seta2.c
@@ -124,7 +124,7 @@ WRITE16_HANDLER( seta2_vregs_w )
grdians = 019a
*/
- seta2_state *state = space->machine->driver_data<seta2_state>();
+ seta2_state *state = space->machine().driver_data<seta2_state>();
UINT16 olddata = state->vregs[offset];
COMBINE_DATA(&state->vregs[offset]);
@@ -134,15 +134,15 @@ WRITE16_HANDLER( seta2_vregs_w )
switch( offset*2 )
{
case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom
- flip_screen_set(space->machine, data & 1 );
+ flip_screen_set(space->machine(), data & 1 );
if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n",cpu_get_pc(space->cpu),data);
break;
case 0x2a: // FLIP X (pzlbowl)
- flip_screen_x_set(space->machine, data & 1 );
+ flip_screen_x_set(space->machine(), data & 1 );
if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n",cpu_get_pc(space->cpu),data);
break;
case 0x2c: // FLIP Y (pzlbowl)
- flip_screen_y_set(space->machine, data & 1 );
+ flip_screen_y_set(space->machine(), data & 1 );
if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n",cpu_get_pc(space->cpu),data);
break;
@@ -212,11 +212,11 @@ static void seta_drawgfx( bitmap_t *bitmap, const rectangle *cliprect, const gfx
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
// Sprites list
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
// When debugging, use state->spriteram here, and run mame -update_in_pause
UINT16 *buffered_spriteram16 = state->buffered_spriteram;
UINT16 *s1 = buffered_spriteram16 + 0x3000/2;
@@ -250,37 +250,37 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
default:
popmessage("unknown gfxset %x",(num & 0x0700)>>8);
shadow_depth = 0;
- gfx = machine->gfx[machine->rand()&3];
+ gfx = machine.gfx[machine.rand()&3];
break;
case 0x0700: // 8bpp tiles (76543210)
shadow_depth = 8; // ?
- gfx = machine->gfx[3];
+ gfx = machine.gfx[3];
break;
case 0x0600: // 6bpp tiles (--543210) (myangel sliding blocks test)
shadow_depth = 6; // ?
- gfx = machine->gfx[2];
+ gfx = machine.gfx[2];
break;
case 0x0500: // 4bpp tiles (3210----)
shadow_depth = 4; // ?
- gfx = machine->gfx[1];
+ gfx = machine.gfx[1];
break;
case 0x0400: // 4bpp tiles (----3210)
shadow_depth = 3; // reelquak
- gfx = machine->gfx[0];
+ gfx = machine.gfx[0];
break;
// case 0x0300:
// unknown
case 0x0200: // 3bpp tiles? (-----210) (myangel "Graduate Tests")
shadow_depth = 3; // ?
- gfx = machine->gfx[4];
+ gfx = machine.gfx[4];
break;
case 0x0100: // 2bpp tiles??? (--10----) (myangel2 question bubble, myangel endgame)
shadow_depth = 2; // myangel2
- gfx = machine->gfx[5];
+ gfx = machine.gfx[5];
break;
case 0x0000: // no idea!
shadow_depth = 4; // ?
- gfx = machine->gfx[0];
+ gfx = machine.gfx[0];
break;
}
if (!use_shadow)
@@ -444,12 +444,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_START( seta2 )
{
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
- machine->gfx[2]->color_granularity = 16;
- machine->gfx[3]->color_granularity = 16;
- machine->gfx[4]->color_granularity = 16;
- machine->gfx[5]->color_granularity = 16;
+ machine.gfx[2]->color_granularity = 16;
+ machine.gfx[3]->color_granularity = 16;
+ machine.gfx[4]->color_granularity = 16;
+ machine.gfx[5]->color_granularity = 16;
state->buffered_spriteram = auto_alloc_array(machine, UINT16, state->spriteram_size/2);
@@ -461,7 +461,7 @@ VIDEO_START( seta2 )
VIDEO_START( seta2_xoffset )
{
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
VIDEO_START_CALL(seta2);
@@ -470,7 +470,7 @@ VIDEO_START( seta2_xoffset )
VIDEO_START( seta2_yoffset )
{
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
VIDEO_START_CALL(seta2);
@@ -479,20 +479,20 @@ VIDEO_START( seta2_yoffset )
SCREEN_UPDATE( seta2 )
{
- seta2_state *state = screen->machine->driver_data<seta2_state>();
+ seta2_state *state = screen->machine().driver_data<seta2_state>();
// Black or pen 0?
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
if ( (state->vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_EOF( seta2 )
{
- seta2_state *state = machine->driver_data<seta2_state>();
+ seta2_state *state = machine.driver_data<seta2_state>();
// Buffer sprites by 1 frame
memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size);
diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c
index 426774031fa..0ef89ac5f46 100644
--- a/src/mame/video/sf.c
+++ b/src/mame/video/sf.c
@@ -9,7 +9,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *base = machine->region("gfx5")->base() + 2 * tile_index;
+ UINT8 *base = machine.region("gfx5")->base() + 2 * tile_index;
int attr = base[0x10000];
int color = base[0];
int code = (base[0x10000 + 1] << 8) | base[1];
@@ -22,7 +22,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- UINT8 *base = machine->region("gfx5")->base() + 0x20000 + 2 * tile_index;
+ UINT8 *base = machine.region("gfx5")->base() + 0x20000 + 2 * tile_index;
int attr = base[0x10000];
int color = base[0];
int code = (base[0x10000 + 1] << 8) | base[1];
@@ -35,7 +35,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- sf_state *state = machine->driver_data<sf_state>();
+ sf_state *state = machine.driver_data<sf_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(
3,
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( sf )
{
- sf_state *state = machine->driver_data<sf_state>();
+ sf_state *state = machine.driver_data<sf_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 2048, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 16, 16, 2048, 16);
@@ -74,21 +74,21 @@ VIDEO_START( sf )
WRITE16_HANDLER( sf_videoram_w )
{
- sf_state *state = space->machine->driver_data<sf_state>();
+ sf_state *state = space->machine().driver_data<sf_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
}
WRITE16_HANDLER( sf_bg_scroll_w )
{
- sf_state *state = space->machine->driver_data<sf_state>();
+ sf_state *state = space->machine().driver_data<sf_state>();
COMBINE_DATA(&state->bgscroll);
tilemap_set_scrollx(state->bg_tilemap, 0, state->bgscroll);
}
WRITE16_HANDLER( sf_fg_scroll_w )
{
- sf_state *state = space->machine->driver_data<sf_state>();
+ sf_state *state = space->machine().driver_data<sf_state>();
COMBINE_DATA(&state->fgscroll);
tilemap_set_scrollx(state->fg_tilemap, 0, state->fgscroll);
}
@@ -104,11 +104,11 @@ WRITE16_HANDLER( sf_gfxctrl_w )
/* b6 = active middle plane */
/* b7 = active sprites */
- sf_state *state = space->machine->driver_data<sf_state>();
+ sf_state *state = space->machine().driver_data<sf_state>();
if (ACCESSING_BITS_0_7)
{
state->sf_active = data & 0xff;
- flip_screen_set(space->machine, data & 0x04);
+ flip_screen_set(space->machine(), data & 0x04);
tilemap_set_enable(state->tx_tilemap, data & 0x08);
tilemap_set_enable(state->bg_tilemap, data & 0x20);
tilemap_set_enable(state->fg_tilemap, data & 0x40);
@@ -129,9 +129,9 @@ INLINE int sf_invert( int nb )
return nb ^ delta[(nb >> 3) & 3];
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- sf_state *state = machine->driver_data<sf_state>();
+ sf_state *state = machine.driver_data<sf_state>();
int offs;
for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20)
@@ -173,25 +173,25 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
}
drawgfx_transpen(bitmap,
- cliprect, machine->gfx[2],
+ cliprect, machine.gfx[2],
sf_invert(c1),
color,
flipx,flipy,
sx,sy, 15);
drawgfx_transpen(bitmap,
- cliprect, machine->gfx[2],
+ cliprect, machine.gfx[2],
sf_invert(c2),
color,
flipx,flipy,
sx+16,sy, 15);
drawgfx_transpen(bitmap,
- cliprect, machine->gfx[2],
+ cliprect, machine.gfx[2],
sf_invert(c3),
color,
flipx,flipy,
sx,sy+16, 15);
drawgfx_transpen(bitmap,
- cliprect, machine->gfx[2],
+ cliprect, machine.gfx[2],
sf_invert(c4),
color,
flipx,flipy,
@@ -208,7 +208,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
}
drawgfx_transpen(bitmap,
- cliprect, machine->gfx[2],
+ cliprect, machine.gfx[2],
sf_invert(c),
color,
flipx,flipy,
@@ -220,7 +220,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
SCREEN_UPDATE( sf )
{
- sf_state *state = screen->machine->driver_data<sf_state>();
+ sf_state *state = screen->machine().driver_data<sf_state>();
if (state->sf_active & 0x20)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -230,7 +230,7 @@ SCREEN_UPDATE( sf )
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
if (state->sf_active & 0x80)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/shadfrce.c b/src/mame/video/shadfrce.c
index 0556bdce699..ce0b26681f4 100644
--- a/src/mame/video/shadfrce.c
+++ b/src/mame/video/shadfrce.c
@@ -5,7 +5,7 @@ static TILE_GET_INFO( get_shadfrce_fgtile_info )
{
/* ---- ---- tttt tttt ---- ---- pppp TTTT */
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
int tileno, colour;
tileno = (state->fgvideoram[tile_index *2] & 0x00ff) | ((state->fgvideoram[tile_index *2+1] & 0x000f) << 8);
@@ -16,7 +16,7 @@ static TILE_GET_INFO( get_shadfrce_fgtile_info )
WRITE16_HANDLER( shadfrce_fgvideoram_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fgtilemap,offset/2);
@@ -26,7 +26,7 @@ static TILE_GET_INFO( get_shadfrce_bg0tile_info )
{
/* ---- ---- ---- cccc --TT TTTT TTTT TTTT */
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
int tileno, colour,fyx;
tileno = (state->bg0videoram[tile_index *2+1] & 0x3fff);
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_shadfrce_bg0tile_info )
WRITE16_HANDLER( shadfrce_bg0videoram_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
state->bg0videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg0tilemap,offset/2);
@@ -47,7 +47,7 @@ WRITE16_HANDLER( shadfrce_bg0videoram_w )
static TILE_GET_INFO( get_shadfrce_bg1tile_info )
{
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
int tileno, colour;
tileno = (state->bg1videoram[tile_index] & 0x0fff);
@@ -58,7 +58,7 @@ static TILE_GET_INFO( get_shadfrce_bg1tile_info )
WRITE16_HANDLER( shadfrce_bg1videoram_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
state->bg1videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg1tilemap,offset);
@@ -69,7 +69,7 @@ WRITE16_HANDLER( shadfrce_bg1videoram_w )
VIDEO_START( shadfrce )
{
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
state->fgtilemap = tilemap_create(machine, get_shadfrce_fgtile_info,tilemap_scan_rows, 8, 8,64,32);
tilemap_set_transparent_pen(state->fgtilemap,0);
@@ -84,28 +84,28 @@ VIDEO_START( shadfrce )
WRITE16_HANDLER ( shadfrce_bg0scrollx_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
tilemap_set_scrollx( state->bg0tilemap, 0, data & 0x1ff );
}
WRITE16_HANDLER ( shadfrce_bg0scrolly_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
tilemap_set_scrolly( state->bg0tilemap, 0, data & 0x1ff );
}
WRITE16_HANDLER ( shadfrce_bg1scrollx_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
tilemap_set_scrollx( state->bg1tilemap, 0, data & 0x1ff );
}
WRITE16_HANDLER ( shadfrce_bg1scrolly_w )
{
- shadfrce_state *state = space->machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = space->machine().driver_data<shadfrce_state>();
tilemap_set_scrolly( state->bg1tilemap, 0, data & 0x1ff );
}
@@ -113,7 +113,7 @@ WRITE16_HANDLER ( shadfrce_bg1scrolly_w )
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt |
@@ -130,8 +130,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
P = priority
*/
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
- const gfx_element *gfx = machine->gfx[1];
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT16 *finish = state->spvideoram_old;
UINT16 *source = finish + 0x2000/2 - 8;
int hcount;
@@ -152,10 +152,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
height++;
if (enable) {
for (hcount=0;hcount<height;hcount++) {
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,machine->priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,machine->priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,machine->priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,machine->priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,machine.priority_bitmap,pri_mask,0);
}
}
source-=8;
@@ -164,19 +164,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( shadfrce )
{
- shadfrce_state *state = screen->machine->driver_data<shadfrce_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ shadfrce_state *state = screen->machine().driver_data<shadfrce_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (state->video_enable)
{
tilemap_draw(bitmap,cliprect,state->bg1tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->bg0tilemap,0,1);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fgtilemap, 0,0);
}
else
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
}
return 0;
@@ -184,7 +184,7 @@ SCREEN_UPDATE( shadfrce )
SCREEN_EOF( shadfrce )
{
- shadfrce_state *state = machine->driver_data<shadfrce_state>();
+ shadfrce_state *state = machine.driver_data<shadfrce_state>();
/* looks like sprites are *two* frames ahead */
memcpy(state->spvideoram_old, state->spvideoram, state->spvideoram_size);
diff --git a/src/mame/video/shangha3.c b/src/mame/video/shangha3.c
index 3922db07b3c..37f26eccd90 100644
--- a/src/mame/video/shangha3.c
+++ b/src/mame/video/shangha3.c
@@ -66,10 +66,10 @@ Word | Bit(s) | Use
VIDEO_START( shangha3 )
{
- shangha3_state *state = machine->driver_data<shangha3_state>();
+ shangha3_state *state = machine.driver_data<shangha3_state>();
int i;
- state->rawbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->rawbitmap = machine.primary_screen->alloc_compatible_bitmap();
for (i = 0;i < 14;i++)
state->drawmode_table[i] = DRAWMODE_SOURCE;
@@ -80,7 +80,7 @@ VIDEO_START( shangha3 )
{
/* Prepare the shadow table */
for (i = 0;i < 128;i++)
- machine->shadow_table[i] = i+128;
+ machine.shadow_table[i] = i+128;
}
}
@@ -91,7 +91,7 @@ WRITE16_HANDLER( shangha3_flipscreen_w )
if (ACCESSING_BITS_0_7)
{
/* bit 7 flips screen, the rest seems to always be set to 0x7e */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
if ((data & 0x7f) != 0x7e) popmessage("flipscreen_w %02x",data);
}
@@ -99,7 +99,7 @@ WRITE16_HANDLER( shangha3_flipscreen_w )
WRITE16_HANDLER( shangha3_gfxlist_addr_w )
{
- shangha3_state *state = space->machine->driver_data<shangha3_state>();
+ shangha3_state *state = space->machine().driver_data<shangha3_state>();
COMBINE_DATA(&state->gfxlist_addr);
}
@@ -107,7 +107,7 @@ WRITE16_HANDLER( shangha3_gfxlist_addr_w )
WRITE16_HANDLER( shangha3_blitter_go_w )
{
- shangha3_state *state = space->machine->driver_data<shangha3_state>();
+ shangha3_state *state = space->machine().driver_data<shangha3_state>();
UINT16 *shangha3_ram = state->ram;
bitmap_t *rawbitmap = state->rawbitmap;
UINT8 *drawmode_table = state->drawmode_table;
@@ -134,7 +134,7 @@ WRITE16_HANDLER( shangha3_blitter_go_w )
zoomx = shangha3_ram[offs+10];
zoomy = shangha3_ram[offs+13];
- if (flip_screen_get(space->machine))
+ if (flip_screen_get(space->machine()))
{
sx = 383 - sx - sizex;
sy = 255 - sy - sizey;
@@ -213,7 +213,7 @@ WRITE16_HANDLER( shangha3_blitter_go_w )
if (flipy) dy = sy + sizey-15 - dy;
else dy = sy + dy;
- drawgfx_transpen(rawbitmap,&myclip,space->machine->gfx[0],
+ drawgfx_transpen(rawbitmap,&myclip,space->machine().gfx[0],
(tile & 0x0fff) | (code & 0xf000),
(tile >> 12) | (color & 0x70),
flipx,flipy,
@@ -226,26 +226,26 @@ WRITE16_HANDLER( shangha3_blitter_go_w )
int w;
if (zoomx <= 1 && zoomy <= 1)
- drawgfxzoom_transtable(rawbitmap,&myclip,space->machine->gfx[0],
+ drawgfxzoom_transtable(rawbitmap,&myclip,space->machine().gfx[0],
code,
color,
flipx,flipy,
sx,sy,
0x1000000,0x1000000,
- drawmode_table,space->machine->shadow_table);
+ drawmode_table,space->machine().shadow_table);
else
{
w = (sizex+15)/16;
for (x = 0;x < w;x++)
{
- drawgfxzoom_transtable(rawbitmap,&myclip,space->machine->gfx[0],
+ drawgfxzoom_transtable(rawbitmap,&myclip,space->machine().gfx[0],
code,
color,
flipx,flipy,
sx + 16*x,sy,
(0x200-zoomx)*0x100,(0x200-zoomy)*0x100,
- drawmode_table,space->machine->shadow_table);
+ drawmode_table,space->machine().shadow_table);
if ((code & 0x000f) == 0x0f)
code = (code + 0x100) & 0xfff0;
@@ -263,7 +263,7 @@ else
SCREEN_UPDATE( shangha3 )
{
- shangha3_state *state = screen->machine->driver_data<shangha3_state>();
+ shangha3_state *state = screen->machine().driver_data<shangha3_state>();
copybitmap(bitmap, state->rawbitmap, 0, 0, 0, 0, cliprect);
return 0;
diff --git a/src/mame/video/shangkid.c b/src/mame/video/shangkid.c
index e654f49d9d6..503a45bc5d8 100644
--- a/src/mame/video/shangkid.c
+++ b/src/mame/video/shangkid.c
@@ -6,7 +6,7 @@
static TILE_GET_INFO( get_bg_tile_info ){
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
UINT8 *videoram = state->videoram;
int attributes = videoram[tile_index+0x800];
int tile_number = videoram[tile_index]+0x100*(attributes&0x3);
@@ -43,26 +43,26 @@ static TILE_GET_INFO( get_bg_tile_info ){
}
tileinfo->category =
- (machine->region( "proms" )->base()[0x800+color*4]==2)?1:0;
+ (machine.region( "proms" )->base()[0x800+color*4]==2)?1:0;
}
VIDEO_START( shangkid )
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
state->background = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
}
WRITE8_HANDLER( shangkid_videoram_w )
{
- shangkid_state *state = space->machine->driver_data<shangkid_state>();
+ shangkid_state *state = space->machine().driver_data<shangkid_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty( state->background, offset&0x7ff );
}
-static void draw_sprite(running_machine *machine, const UINT8 *source, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_t *bitmap, const rectangle *cliprect)
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
const gfx_element *gfx;
int transparent_pen;
int bank_index;
@@ -133,7 +133,7 @@ static void draw_sprite(running_machine *machine, const UINT8 *source, bitmap_t
transparent_pen = 7;
}
- gfx = machine->gfx[1+bank_index];
+ gfx = machine.gfx[1+bank_index];
width = (xscale+1)*2;
height = (yscale+1)*2;
@@ -172,9 +172,9 @@ static void draw_sprite(running_machine *machine, const UINT8 *source, bitmap_t
}
}
-static void shangkid_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
const UINT8 *source, *finish;
finish = state->spriteram;
@@ -187,14 +187,14 @@ static void shangkid_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( shangkid )
{
- shangkid_state *state = screen->machine->driver_data<shangkid_state>();
+ shangkid_state *state = screen->machine().driver_data<shangkid_state>();
int flipscreen = state->videoreg[1]&0x80;
tilemap_set_flip( state->background, flipscreen?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
tilemap_set_scrollx( state->background,0,state->videoreg[0]-40 );
tilemap_set_scrolly( state->background,0,state->videoreg[2]+0x10 );
tilemap_draw( bitmap,cliprect,state->background,0,0 );
- shangkid_draw_sprites(screen->machine, bitmap,cliprect );
+ shangkid_draw_sprites(screen->machine(), bitmap,cliprect );
tilemap_draw( bitmap,cliprect,state->background,1,0 ); /* high priority tiles */
return 0;
}
@@ -205,7 +205,7 @@ PALETTE_INIT( dynamski )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -213,7 +213,7 @@ PALETTE_INIT( dynamski )
UINT16 data = (color_prom[i | 0x20] << 8) | color_prom[i];
rgb_t color = MAKE_RGB(pal5bit(data >> 1), pal5bit(data >> 6), pal5bit(data >> 11));
- colortable_palette_set_color(machine->colortable, i, color);
+ colortable_palette_set_color(machine.colortable, i, color);
}
/* color_prom now points to the beginning of the lookup table */
@@ -223,21 +223,21 @@ PALETTE_INIT( dynamski )
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites */
for (i = 0x40; i < 0x80; i++)
{
UINT8 ctabentry = (color_prom[(i - 0x40) + 0x100] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void dynamski_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
+static void dynamski_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
UINT8 *videoram = state->videoram;
int i;
int sx,sy;
@@ -279,7 +279,7 @@ static void dynamski_draw_background(running_machine *machine, bitmap_t *bitmap,
drawgfx_transpen(
bitmap,
cliprect,
- machine->gfx[0],
+ machine.gfx[0],
tile,
attr & 0x0f,
0,0,//xflip,yflip,
@@ -289,9 +289,9 @@ static void dynamski_draw_background(running_machine *machine, bitmap_t *bitmap,
}
}
-static void dynamski_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- shangkid_state *state = machine->driver_data<shangkid_state>();
+ shangkid_state *state = machine.driver_data<shangkid_state>();
UINT8 *videoram = state->videoram;
int i;
int sx,sy;
@@ -313,7 +313,7 @@ static void dynamski_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
drawgfx_transpen(
bitmap,
cliprect,
- machine->gfx[1],
+ machine.gfx[1],
bank*0x40 + (tile&0x3f),
color,
tile&0x80,tile&0x40, /* flipx,flipy */
@@ -323,8 +323,8 @@ static void dynamski_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( dynamski )
{
- dynamski_draw_background(screen->machine, bitmap,cliprect, 0 );
- dynamski_draw_sprites(screen->machine, bitmap,cliprect );
- dynamski_draw_background(screen->machine, bitmap,cliprect, 1 );
+ dynamski_draw_background(screen->machine(), bitmap,cliprect, 0 );
+ dynamski_draw_sprites(screen->machine(), bitmap,cliprect );
+ dynamski_draw_background(screen->machine(), bitmap,cliprect, 1 );
return 0;
}
diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c
index 8903124e87f..9bbcb3ee273 100644
--- a/src/mame/video/shaolins.c
+++ b/src/mame/video/shaolins.c
@@ -39,7 +39,7 @@ PALETTE_INIT( shaolins )
4, resistances, bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( shaolins )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table,*/
@@ -83,14 +83,14 @@ PALETTE_INIT( shaolins )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
WRITE8_HANDLER( shaolins_videoram_w )
{
- shaolins_state *state = space->machine->driver_data<shaolins_state>();
+ shaolins_state *state = space->machine().driver_data<shaolins_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -98,7 +98,7 @@ WRITE8_HANDLER( shaolins_videoram_w )
WRITE8_HANDLER( shaolins_colorram_w )
{
- shaolins_state *state = space->machine->driver_data<shaolins_state>();
+ shaolins_state *state = space->machine().driver_data<shaolins_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -106,18 +106,18 @@ WRITE8_HANDLER( shaolins_colorram_w )
WRITE8_HANDLER( shaolins_palettebank_w )
{
- shaolins_state *state = space->machine->driver_data<shaolins_state>();
+ shaolins_state *state = space->machine().driver_data<shaolins_state>();
if (state->palettebank != (data & 0x07))
{
state->palettebank = data & 0x07;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( shaolins_scroll_w )
{
- shaolins_state *state = space->machine->driver_data<shaolins_state>();
+ shaolins_state *state = space->machine().driver_data<shaolins_state>();
int col;
for (col = 4; col < 32; col++)
@@ -126,20 +126,20 @@ WRITE8_HANDLER( shaolins_scroll_w )
WRITE8_HANDLER( shaolins_nmi_w )
{
- shaolins_state *state = space->machine->driver_data<shaolins_state>();
+ shaolins_state *state = space->machine().driver_data<shaolins_state>();
state->nmi_enable = data;
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- shaolins_state *state = machine->driver_data<shaolins_state>();
+ shaolins_state *state = machine.driver_data<shaolins_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x40) << 2);
int color = (attr & 0x0f) + 16 * state->palettebank;
@@ -150,7 +150,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( shaolins )
{
- shaolins_state *state = machine->driver_data<shaolins_state>();
+ shaolins_state *state = machine.driver_data<shaolins_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -158,9 +158,9 @@ VIDEO_START( shaolins )
tilemap_set_scroll_cols(state->bg_tilemap, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- shaolins_state *state = machine->driver_data<shaolins_state>();
+ shaolins_state *state = machine.driver_data<shaolins_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -183,20 +183,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap, cliprect,machine.gfx[1],
code, color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, state->palettebank << 5));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, state->palettebank << 5));
}
}
}
SCREEN_UPDATE( shaolins )
{
- shaolins_state *state = screen->machine->driver_data<shaolins_state>();
+ shaolins_state *state = screen->machine().driver_data<shaolins_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index 57f647dbc68..f8c139a701e 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -3,7 +3,7 @@
WRITE8_HANDLER( sichuan2_videoram_w )
{
- shisen_state *state = space->machine->driver_data<shisen_state>();
+ shisen_state *state = space->machine().driver_data<shisen_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -11,16 +11,16 @@ WRITE8_HANDLER( sichuan2_videoram_w )
WRITE8_HANDLER( sichuan2_bankswitch_w )
{
- shisen_state *state = space->machine->driver_data<shisen_state>();
+ shisen_state *state = space->machine().driver_data<shisen_state>();
int bankaddress;
int bank;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
if (data & 0xc0) logerror("bank switch %02x\n",data);
/* bits 0-2 select ROM bank */
bankaddress = 0x10000 + (data & 0x07) * 0x4000;
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]);
/* bits 3-5 select gfx bank */
bank = (data & 0x38) >> 3;
@@ -28,7 +28,7 @@ WRITE8_HANDLER( sichuan2_bankswitch_w )
if (state->gfxbank != bank)
{
state->gfxbank = bank;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bits 6-7 unknown */
@@ -36,17 +36,17 @@ WRITE8_HANDLER( sichuan2_bankswitch_w )
WRITE8_HANDLER( sichuan2_paletteram_w )
{
- shisen_state *state = space->machine->driver_data<shisen_state>();
+ shisen_state *state = space->machine().driver_data<shisen_state>();
state->paletteram[offset] = data;
offset &= 0xff;
- palette_set_color_rgb(space->machine, offset, pal5bit(state->paletteram[offset + 0x000]), pal5bit(state->paletteram[offset + 0x100]), pal5bit(state->paletteram[offset + 0x200]));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(state->paletteram[offset + 0x000]), pal5bit(state->paletteram[offset + 0x100]), pal5bit(state->paletteram[offset + 0x200]));
}
static TILE_GET_INFO( get_bg_tile_info )
{
- shisen_state *state = machine->driver_data<shisen_state>();
+ shisen_state *state = machine.driver_data<shisen_state>();
int offs = tile_index * 2;
int code = state->videoram[offs] + ((state->videoram[offs + 1] & 0x0f) << 8) + (state->gfxbank << 12);
int color = (state->videoram[offs + 1] & 0xf0) >> 4;
@@ -56,7 +56,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( sichuan2 )
{
- shisen_state *state = machine->driver_data<shisen_state>();
+ shisen_state *state = machine.driver_data<shisen_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 64, 32);
@@ -64,12 +64,12 @@ VIDEO_START( sichuan2 )
SCREEN_UPDATE( sichuan2 )
{
- shisen_state *state = screen->machine->driver_data<shisen_state>();
+ shisen_state *state = screen->machine().driver_data<shisen_state>();
// on Irem boards, screen flip is handled in both hardware and software.
// this game doesn't have cocktail mode so if there's software control we don't
// know where it is mapped.
- flip_screen_set(screen->machine, ~input_port_read(screen->machine, "DSW2") & 1);
+ flip_screen_set(screen->machine(), ~input_port_read(screen->machine(), "DSW2") & 1);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c
index adc9842c108..6610fa74448 100644
--- a/src/mame/video/shootout.c
+++ b/src/mame/video/shootout.c
@@ -12,7 +12,7 @@ PALETTE_INIT( shootout )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -40,7 +40,7 @@ PALETTE_INIT( shootout )
static TILE_GET_INFO( get_bg_tile_info )
{
- shootout_state *state = machine->driver_data<shootout_state>();
+ shootout_state *state = machine.driver_data<shootout_state>();
int attributes = state->videoram[tile_index+0x400]; /* CCCC -TTT */
int tile_number = state->videoram[tile_index] + 256*(attributes&7);
int color = attributes>>4;
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- shootout_state *state = machine->driver_data<shootout_state>();
+ shootout_state *state = machine.driver_data<shootout_state>();
int attributes = state->textram[tile_index+0x400]; /* CCCC --TT */
int tile_number = state->textram[tile_index] + 256*(attributes&0x3);
int color = attributes>>4;
@@ -68,7 +68,7 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE8_HANDLER( shootout_videoram_w )
{
- shootout_state *state = space->machine->driver_data<shootout_state>();
+ shootout_state *state = space->machine().driver_data<shootout_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty( state->background, offset&0x3ff );
@@ -76,7 +76,7 @@ WRITE8_HANDLER( shootout_videoram_w )
WRITE8_HANDLER( shootout_textram_w )
{
- shootout_state *state = space->machine->driver_data<shootout_state>();
+ shootout_state *state = space->machine().driver_data<shootout_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty( state->foreground, offset&0x3ff );
@@ -84,18 +84,18 @@ WRITE8_HANDLER( shootout_textram_w )
VIDEO_START( shootout )
{
- shootout_state *state = machine->driver_data<shootout_state>();
+ shootout_state *state = machine.driver_data<shootout_state>();
state->background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen( state->foreground, 0 );
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_bits )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_bits )
{
- shootout_state *state = machine->driver_data<shootout_state>();
+ shootout_state *state = machine.driver_data<shootout_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
const UINT8 *source = spriteram+127*4;
int count;
@@ -144,7 +144,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
0 /*color*/,
flipx,flipy,
vx,vy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
priority_mask,0);
number++;
@@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
0 /*color*/,
flipx,flipy,
vx,vy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
priority_mask,0);
}
}
@@ -173,24 +173,24 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( shootout )
{
- shootout_state *state = screen->machine->driver_data<shootout_state>();
+ shootout_state *state = screen->machine().driver_data<shootout_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->background,0,0);
tilemap_draw(bitmap,cliprect,state->foreground,0,1);
- draw_sprites(screen->machine, bitmap,cliprect,3/*bank bits */);
+ draw_sprites(screen->machine(), bitmap,cliprect,3/*bank bits */);
return 0;
}
SCREEN_UPDATE( shootouj )
{
- shootout_state *state = screen->machine->driver_data<shootout_state>();
+ shootout_state *state = screen->machine().driver_data<shootout_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->background,0,0);
tilemap_draw(bitmap,cliprect,state->foreground,0,1);
- draw_sprites(screen->machine, bitmap,cliprect,2/*bank bits*/);
+ draw_sprites(screen->machine(), bitmap,cliprect,2/*bank bits*/);
return 0;
}
diff --git a/src/mame/video/shuuz.c b/src/mame/video/shuuz.c
index eebe0989f4f..e36a6bc9b51 100644
--- a/src/mame/video/shuuz.c
+++ b/src/mame/video/shuuz.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_playfield_tile_info )
{
- shuuz_state *state = machine->driver_data<shuuz_state>();
+ shuuz_state *state = machine.driver_data<shuuz_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x3fff;
@@ -71,7 +71,7 @@ VIDEO_START( shuuz )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- shuuz_state *state = machine->driver_data<shuuz_state>();
+ shuuz_state *state = machine.driver_data<shuuz_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -90,7 +90,7 @@ VIDEO_START( shuuz )
SCREEN_UPDATE( shuuz )
{
- shuuz_state *state = screen->machine->driver_data<shuuz_state>();
+ shuuz_state *state = screen->machine().driver_data<shuuz_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c
index 28e7ac14f04..7acca35e056 100644
--- a/src/mame/video/sidearms.c
+++ b/src/mame/video/sidearms.c
@@ -11,7 +11,7 @@
WRITE8_HANDLER( sidearms_videoram_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -19,7 +19,7 @@ WRITE8_HANDLER( sidearms_videoram_w )
WRITE8_HANDLER( sidearms_colorram_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -27,28 +27,28 @@ WRITE8_HANDLER( sidearms_colorram_w )
WRITE8_HANDLER( sidearms_c804_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 and 3 lock the coin chutes */
if (!state->gameid || state->gameid==3)
{
- coin_lockout_w(space->machine, 0, !(data & 0x04));
- coin_lockout_w(space->machine, 1, !(data & 0x08));
+ coin_lockout_w(space->machine(), 0, !(data & 0x04));
+ coin_lockout_w(space->machine(), 1, !(data & 0x08));
}
else
{
- coin_lockout_w(space->machine, 0, data & 0x04);
- coin_lockout_w(space->machine, 1, data & 0x08);
+ coin_lockout_w(space->machine(), 0, data & 0x04);
+ coin_lockout_w(space->machine(), 1, data & 0x08);
}
/* bit 4 resets the sound CPU */
if (data & 0x10)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
}
/* bit 5 enables starfield */
@@ -66,21 +66,21 @@ WRITE8_HANDLER( sidearms_c804_w )
if (state->flipon != (data & 0x80))
{
state->flipon = data & 0x80;
- flip_screen_set(space->machine, state->flipon);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), state->flipon);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( sidearms_gfxctrl_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
state->objon = data & 0x01;
state->bgon = data & 0x02;
}
WRITE8_HANDLER( sidearms_star_scrollx_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
UINT32 last_state = state->hcount_191;
state->hcount_191++;
@@ -93,7 +93,7 @@ WRITE8_HANDLER( sidearms_star_scrollx_w )
WRITE8_HANDLER( sidearms_star_scrolly_w )
{
- sidearms_state *state = space->machine->driver_data<sidearms_state>();
+ sidearms_state *state = space->machine().driver_data<sidearms_state>();
state->vcount_191++;
state->vcount_191 &= 0xff;
}
@@ -101,7 +101,7 @@ WRITE8_HANDLER( sidearms_star_scrolly_w )
static TILE_GET_INFO( get_sidearms_bg_tile_info )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
int code, attr, color, flags;
code = state->tilerom[tile_index];
@@ -115,7 +115,7 @@ static TILE_GET_INFO( get_sidearms_bg_tile_info )
static TILE_GET_INFO( get_philko_bg_tile_info )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
int code, attr, color, flags;
code = state->tilerom[tile_index];
@@ -129,7 +129,7 @@ static TILE_GET_INFO( get_philko_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + (attr<<2 & 0x300);
int color = attr & 0x3f;
@@ -148,8 +148,8 @@ static TILEMAP_MAPPER( sidearms_tilemap_scan )
VIDEO_START( sidearms )
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
- state->tilerom = machine->region("gfx4")->base();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
+ state->tilerom = machine.region("gfx4")->base();
if (!state->gameid)
{
@@ -174,12 +174,12 @@ VIDEO_START( sidearms )
state->flipon = state->charon = state->staron = state->objon = state->bgon = 0;
}
-static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int start_offset, int end_offset )
+static void draw_sprites_region(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start_offset, int end_offset )
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
- const gfx_element *gfx = machine->gfx[2];
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
+ const gfx_element *gfx = machine.gfx[2];
int offs, attr, color, code, x, y, flipx, flipy;
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
flipy = flipx = state->flipon;
@@ -207,14 +207,14 @@ static void draw_sprites_region(running_machine *machine, bitmap_t *bitmap, cons
}
}
-static void sidearms_draw_starfield( running_machine *machine, bitmap_t *bitmap )
+static void sidearms_draw_starfield( running_machine &machine, bitmap_t *bitmap )
{
int x, y, i;
UINT32 hadd_283, vadd_283, _hflop_74a_n, _hcount_191, _vcount_191;
UINT8 *sf_rom;
UINT16 *lineptr;
int pixadv, lineadv;
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
// clear starfield background
lineptr = BITMAP_ADDR16(bitmap, 16, 64);
@@ -232,7 +232,7 @@ static void sidearms_draw_starfield( running_machine *machine, bitmap_t *bitmap
_vcount_191 = state->vcount_191;
_hcount_191 = state->hcount_191 & 0xff;
- sf_rom = machine->region("user1")->base();
+ sf_rom = machine.region("user1")->base();
#if 0 // old loop (for reference; easier to read)
if (!flipon)
@@ -331,9 +331,9 @@ static void sidearms_draw_starfield( running_machine *machine, bitmap_t *bitmap
#endif
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- sidearms_state *state = machine->driver_data<sidearms_state>();
+ sidearms_state *state = machine.driver_data<sidearms_state>();
if (state->gameid == 2 || state->gameid == 3) // Dyger and Whizz have simple front-to-back sprite priority
draw_sprites_region(machine, bitmap, cliprect, 0x0000, 0x1000);
@@ -348,9 +348,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( sidearms )
{
- sidearms_state *state = screen->machine->driver_data<sidearms_state>();
+ sidearms_state *state = screen->machine().driver_data<sidearms_state>();
- sidearms_draw_starfield(screen->machine, bitmap);
+ sidearms_draw_starfield(screen->machine(), bitmap);
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx[0] + (state->bg_scrollx[1] << 8 & 0xf00));
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly[0] + (state->bg_scrolly[1] << 8 & 0xf00));
@@ -359,7 +359,7 @@ SCREEN_UPDATE( sidearms )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if (state->objon)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (state->charon)
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -368,7 +368,7 @@ SCREEN_UPDATE( sidearms )
SCREEN_EOF( sidearms )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c
index dda94ce2bbf..65eba87f408 100644
--- a/src/mame/video/sidepckt.c
+++ b/src/mame/video/sidepckt.c
@@ -6,7 +6,7 @@ PALETTE_INIT( sidepckt )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -23,10 +23,10 @@ PALETTE_INIT( sidepckt )
bit3 = (color_prom[i] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -43,7 +43,7 @@ PALETTE_INIT( sidepckt )
static TILE_GET_INFO( get_tile_info )
{
- sidepckt_state *state = machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = machine.driver_data<sidepckt_state>();
UINT8 attr = state->colorram[tile_index];
SET_TILE_INFO(
0,
@@ -63,7 +63,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( sidepckt )
{
- sidepckt_state *state = machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = machine.driver_data<sidepckt_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
tilemap_set_transmask(state->bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
@@ -82,14 +82,14 @@ VIDEO_START( sidepckt )
WRITE8_HANDLER( sidepckt_videoram_w )
{
- sidepckt_state *state = space->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = space->machine().driver_data<sidepckt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE8_HANDLER( sidepckt_colorram_w )
{
- sidepckt_state *state = space->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = space->machine().driver_data<sidepckt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
@@ -97,7 +97,7 @@ WRITE8_HANDLER( sidepckt_colorram_w )
WRITE8_HANDLER( sidepckt_flipscreen_w )
{
int flipscreen = data;
- tilemap_set_flip_all(space->machine,flipscreen ? TILEMAP_FLIPY : TILEMAP_FLIPX);
+ tilemap_set_flip_all(space->machine(),flipscreen ? TILEMAP_FLIPY : TILEMAP_FLIPX);
}
@@ -107,9 +107,9 @@ WRITE8_HANDLER( sidepckt_flipscreen_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- sidepckt_state *state = machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = machine.driver_data<sidepckt_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -126,13 +126,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipx = spriteram[offs+1] & 0x08;
flipy = spriteram[offs+1] & 0x04;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
sx,sy,0);
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -143,9 +143,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( sidepckt )
{
- sidepckt_state *state = screen->machine->driver_data<sidepckt_state>();
+ sidepckt_state *state = screen->machine().driver_data<sidepckt_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER1,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER0,0);
return 0;
}
diff --git a/src/mame/video/silkroad.c b/src/mame/video/silkroad.c
index d7e146103e1..a3c91567705 100644
--- a/src/mame/video/silkroad.c
+++ b/src/mame/video/silkroad.c
@@ -7,10 +7,10 @@
/* Clean Up */
/* is theres a bg colour register? */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- silkroad_state *state = machine->driver_data<silkroad_state>();
- const gfx_element *gfx = machine->gfx[0];
+ silkroad_state *state = machine.driver_data<silkroad_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT32 *source = state->sprram;
UINT32 *finish = source + 0x1000/4;
@@ -38,7 +38,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (wcount=0;wcount<width;wcount++)
{
- pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,machine->priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,machine.priority_bitmap,pri_mask,0);
}
}
else
@@ -46,7 +46,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (wcount=width;wcount>0;wcount--)
{
- pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,machine->priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,machine.priority_bitmap,pri_mask,0);
}
}
@@ -57,7 +57,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TILE_GET_INFO( get_fg_tile_info )
{
- silkroad_state *state = machine->driver_data<silkroad_state>();
+ silkroad_state *state = machine.driver_data<silkroad_state>();
int code = ((state->vidram[tile_index] & 0xffff0000) >> 16 );
int color = ((state->vidram[tile_index] & 0x000001f));
int flipx = ((state->vidram[tile_index] & 0x0000080) >> 7);
@@ -75,7 +75,7 @@ static TILE_GET_INFO( get_fg_tile_info )
WRITE32_HANDLER( silkroad_fgram_w )
{
- silkroad_state *state = space->machine->driver_data<silkroad_state>();
+ silkroad_state *state = space->machine().driver_data<silkroad_state>();
COMBINE_DATA(&state->vidram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -83,7 +83,7 @@ WRITE32_HANDLER( silkroad_fgram_w )
static TILE_GET_INFO( get_fg2_tile_info )
{
- silkroad_state *state = machine->driver_data<silkroad_state>();
+ silkroad_state *state = machine.driver_data<silkroad_state>();
int code = ((state->vidram2[tile_index] & 0xffff0000) >> 16 );
int color = ((state->vidram2[tile_index] & 0x000001f));
int flipx = ((state->vidram2[tile_index] & 0x0000080) >> 7);
@@ -99,7 +99,7 @@ static TILE_GET_INFO( get_fg2_tile_info )
WRITE32_HANDLER( silkroad_fgram2_w )
{
- silkroad_state *state = space->machine->driver_data<silkroad_state>();
+ silkroad_state *state = space->machine().driver_data<silkroad_state>();
COMBINE_DATA(&state->vidram2[offset]);
tilemap_mark_tile_dirty(state->fg2_tilemap,offset);
@@ -107,7 +107,7 @@ WRITE32_HANDLER( silkroad_fgram2_w )
static TILE_GET_INFO( get_fg3_tile_info )
{
- silkroad_state *state = machine->driver_data<silkroad_state>();
+ silkroad_state *state = machine.driver_data<silkroad_state>();
int code = ((state->vidram3[tile_index] & 0xffff0000) >> 16 );
int color = ((state->vidram3[tile_index] & 0x000001f));
int flipx = ((state->vidram3[tile_index] & 0x0000080) >> 7);
@@ -123,7 +123,7 @@ static TILE_GET_INFO( get_fg3_tile_info )
WRITE32_HANDLER( silkroad_fgram3_w )
{
- silkroad_state *state = space->machine->driver_data<silkroad_state>();
+ silkroad_state *state = space->machine().driver_data<silkroad_state>();
COMBINE_DATA(&state->vidram3[offset]);
tilemap_mark_tile_dirty(state->fg3_tilemap,offset);
@@ -131,7 +131,7 @@ WRITE32_HANDLER( silkroad_fgram3_w )
VIDEO_START(silkroad)
{
- silkroad_state *state = machine->driver_data<silkroad_state>();
+ silkroad_state *state = machine.driver_data<silkroad_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg2_tilemap = tilemap_create(machine, get_fg2_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg3_tilemap = tilemap_create(machine, get_fg3_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
@@ -143,8 +143,8 @@ VIDEO_START(silkroad)
SCREEN_UPDATE(silkroad)
{
- silkroad_state *state = screen->machine->driver_data<silkroad_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ silkroad_state *state = screen->machine().driver_data<silkroad_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,0x7c0);
tilemap_set_scrollx( state->fg_tilemap, 0, ((state->regs[0] & 0xffff0000) >> 16) );
@@ -159,7 +159,7 @@ SCREEN_UPDATE(silkroad)
tilemap_draw(bitmap,cliprect,state->fg_tilemap, 0,0);
tilemap_draw(bitmap,cliprect,state->fg2_tilemap,0,1);
tilemap_draw(bitmap,cliprect,state->fg3_tilemap,0,2);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
if (0)
{
diff --git a/src/mame/video/simpl156.c b/src/mame/video/simpl156.c
index fe4a9563be0..2dcdfc3eeb6 100644
--- a/src/mame/video/simpl156.c
+++ b/src/mame/video/simpl156.c
@@ -10,26 +10,26 @@
VIDEO_START( simpl156 )
{
- simpl156_state *state = machine->driver_data<simpl156_state>();
+ simpl156_state *state = machine.driver_data<simpl156_state>();
/* allocate the ram as 16-bit (we do it here because the CPU is 32-bit) */
state->pf1_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2);
state->pf2_rowscroll = auto_alloc_array_clear(machine, UINT16, 0x800/2);
state->spriteram = auto_alloc_array_clear(machine, UINT16, 0x2000/2);
- machine->generic.paletteram.u16 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
+ machine.generic.paletteram.u16 = auto_alloc_array_clear(machine, UINT16, 0x1000/2);
/* and register the allocated ram so that save states still work */
state->save_pointer(NAME(state->pf1_rowscroll), 0x800/2);
state->save_pointer(NAME(state->pf2_rowscroll), 0x800/2);
state->save_pointer(NAME(state->spriteram), 0x2000/2);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u16, 0x1000/2);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u16, 0x1000/2);
}
SCREEN_UPDATE( simpl156 )
{
- simpl156_state *state = screen->machine->driver_data<simpl156_state>();
+ simpl156_state *state = screen->machine().driver_data<simpl156_state>();
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
@@ -39,8 +39,8 @@ SCREEN_UPDATE( simpl156 )
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(screen->machine, 1);
+ flip_screen_set_no_update(screen->machine(), 1);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x800); // 0x800 needed to charlien title
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x800); // 0x800 needed to charlien title
return 0;
}
diff --git a/src/mame/video/simpsons.c b/src/mame/video/simpsons.c
index 98fb10f4711..f0a350434b8 100644
--- a/src/mame/video/simpsons.c
+++ b/src/mame/video/simpsons.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void simpsons_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void simpsons_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
*code |= ((*color & 0x3f) << 8) | (bank << 14);
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
@@ -22,9 +22,9 @@ void simpsons_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void simpsons_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void simpsons_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
+ simpsons_state *state = machine.driver_data<simpsons_state>();
int pri = (*color & 0x0f80) >> 6; /* ??????? */
if (pri <= state->layerpri[2])
@@ -48,19 +48,19 @@ void simpsons_sprite_callback( running_machine *machine, int *code, int *color,
static READ8_HANDLER( simpsons_k052109_r )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
return k052109_r(state->k052109, offset + 0x2000);
}
static WRITE8_HANDLER( simpsons_k052109_w )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
k052109_w(state->k052109, offset + 0x2000, data);
}
static READ8_HANDLER( simpsons_k053247_r )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
int offs;
if (offset < 0x1000)
@@ -78,7 +78,7 @@ static READ8_HANDLER( simpsons_k053247_r )
static WRITE8_HANDLER( simpsons_k053247_w )
{
- simpsons_state *state = space->machine->driver_data<simpsons_state>();
+ simpsons_state *state = space->machine().driver_data<simpsons_state>();
int offs;
if (offset < 0x1000)
@@ -94,16 +94,16 @@ static WRITE8_HANDLER( simpsons_k053247_w )
else state->xtraram[offset - 0x1000] = data;
}
-void simpsons_video_banking( running_machine *machine, int bank )
+void simpsons_video_banking( running_machine &machine, int bank )
{
- simpsons_state *state = machine->driver_data<simpsons_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ simpsons_state *state = machine.driver_data<simpsons_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (bank & 1)
{
space->install_read_bank(0x0000, 0x0fff, "bank5");
space->install_legacy_write_handler(0x0000, 0x0fff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w));
- memory_set_bankptr(machine, "bank5", machine->generic.paletteram.v);
+ memory_set_bankptr(machine, "bank5", machine.generic.paletteram.v);
}
else
space->install_legacy_readwrite_handler(*state->k052109, 0x0000, 0x0fff, FUNC(k052109_r), FUNC(k052109_w));
@@ -124,7 +124,7 @@ void simpsons_video_banking( running_machine *machine, int bank )
SCREEN_UPDATE( simpsons )
{
- simpsons_state *state = screen->machine->driver_data<simpsons_state>();
+ simpsons_state *state = screen->machine().driver_data<simpsons_state>();
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -144,7 +144,7 @@ SCREEN_UPDATE( simpsons )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[0], 0, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[1], 0, 2);
diff --git a/src/mame/video/sknsspr.c b/src/mame/video/sknsspr.c
index ebed901c0d6..84a051f0c4a 100644
--- a/src/mame/video/sknsspr.c
+++ b/src/mame/video/sknsspr.c
@@ -28,7 +28,7 @@ device_config *sknsspr_device_config::static_alloc_device_config(const machine_c
device_t *sknsspr_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, sknsspr_device(machine, *this));
+ return auto_alloc(machine, sknsspr_device(machine, *this));
}
sknsspr_device::sknsspr_device(running_machine &_machine, const sknsspr_device_config &config)
@@ -47,7 +47,7 @@ void sknsspr_device::device_reset()
//printf("sknsspr_device::device_reset()\n");
}
-int sknsspr_device::skns_rle_decode ( running_machine *machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length )
+int sknsspr_device::skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length )
{
UINT8 *src = gfx_source;
size_t srcsize = gfx_length;
@@ -242,7 +242,7 @@ static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle *cliprect, cons
blit_fxy_z,
};
-void sknsspr_device::skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs)
+void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs)
{
/*- SPR RAM Format -**
@@ -409,12 +409,12 @@ void sknsspr_device::skns_draw_sprites(running_machine *machine, bitmap_t *bitma
if (sprite_flip&2)
{
xflip ^= 1;
- sx = machine->primary_screen->visible_area().max_x+1 - sx;
+ sx = machine.primary_screen->visible_area().max_x+1 - sx;
}
if (sprite_flip&1)
{
yflip ^= 1;
- sy = machine->primary_screen->visible_area().max_y+1 - sy;
+ sy = machine.primary_screen->visible_area().max_y+1 - sy;
}
/* Palette linking */
diff --git a/src/mame/video/sknsspr.h b/src/mame/video/sknsspr.h
index 966805ad81e..6785b002e5c 100644
--- a/src/mame/video/sknsspr.h
+++ b/src/mame/video/sknsspr.h
@@ -14,7 +14,7 @@ class sknsspr_device : public device_t
friend class sknsspr_device_config;
sknsspr_device(running_machine &_machine, const sknsspr_device_config &config);
public:
- void skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
+ void skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
void skns_sprite_kludge(int x, int y);
protected:
@@ -25,7 +25,7 @@ private:
int sprite_kludge_x, sprite_kludge_y;
#define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000
UINT8 decodebuffer[SUPRNOVA_DECODE_BUFFER_SIZE];
- int skns_rle_decode ( running_machine *machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length );
+ int skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length );
};
const device_type sknsspr_ = sknsspr_device_config::static_alloc_device_config;
diff --git a/src/mame/video/skullxbo.c b/src/mame/video/skullxbo.c
index f42dcf52eeb..563a81fb520 100644
--- a/src/mame/video/skullxbo.c
+++ b/src/mame/video/skullxbo.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
UINT16 data = state->alpha[tile_index];
int code = (data ^ 0x400) & 0x7ff;
int color = (data >> 11) & 0x0f;
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] & 0xff;
int code = data1 & 0x7fff;
@@ -82,7 +82,7 @@ VIDEO_START( skullxbo )
0, /* resulting value to indicate "special" */
0, /* callback routine for special entries */
};
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 16,8, 64,64);
@@ -105,7 +105,7 @@ VIDEO_START( skullxbo )
WRITE16_HANDLER( skullxbo_xscroll_w )
{
- skullxbo_state *state = space->machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
/* combine data */
UINT16 oldscroll = *state->xscroll;
@@ -114,7 +114,7 @@ WRITE16_HANDLER( skullxbo_xscroll_w )
/* if something changed, force an update */
if (oldscroll != newscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* adjust the actual scrolls */
tilemap_set_scrollx(state->playfield_tilemap, 0, 2 * (newscroll >> 7));
@@ -127,10 +127,10 @@ WRITE16_HANDLER( skullxbo_xscroll_w )
WRITE16_HANDLER( skullxbo_yscroll_w )
{
- skullxbo_state *state = space->machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
/* combine data */
- int scanline = space->machine->primary_screen->vpos();
+ int scanline = space->machine().primary_screen->vpos();
UINT16 oldscroll = *state->yscroll;
UINT16 newscroll = oldscroll;
UINT16 effscroll;
@@ -138,10 +138,10 @@ WRITE16_HANDLER( skullxbo_yscroll_w )
/* if something changed, force an update */
if (oldscroll != newscroll)
- space->machine->primary_screen->update_partial(scanline);
+ space->machine().primary_screen->update_partial(scanline);
/* adjust the effective scroll for the current scanline */
- if (scanline > space->machine->primary_screen->visible_area().max_y)
+ if (scanline > space->machine().primary_screen->visible_area().max_y)
scanline = 0;
effscroll = (newscroll >> 7) - scanline;
@@ -163,7 +163,7 @@ WRITE16_HANDLER( skullxbo_yscroll_w )
WRITE16_HANDLER( skullxbo_mobmsb_w )
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
atarimo_set_bank(0, (offset >> 9) & 1);
}
@@ -177,7 +177,7 @@ WRITE16_HANDLER( skullxbo_mobmsb_w )
WRITE16_HANDLER( skullxbo_playfieldlatch_w )
{
- skullxbo_state *state = space->machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = space->machine().driver_data<skullxbo_state>();
atarigen_set_playfield_latch(state, data);
}
@@ -189,9 +189,9 @@ WRITE16_HANDLER( skullxbo_playfieldlatch_w )
*
*************************************/
-void skullxbo_scanline_update(running_machine *machine, int scanline)
+void skullxbo_scanline_update(running_machine &machine, int scanline)
{
- skullxbo_state *state = machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = machine.driver_data<skullxbo_state>();
UINT16 *base = &state->alpha[(scanline / 8) * 64 + 42];
int x;
@@ -221,7 +221,7 @@ void skullxbo_scanline_update(running_machine *machine, int scanline)
/* force a partial update with the previous scroll */
if (scanline > 0)
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
/* update the new scroll */
tilemap_set_scrolly(state->playfield_tilemap, 0, newscroll);
@@ -244,7 +244,7 @@ void skullxbo_scanline_update(running_machine *machine, int scanline)
SCREEN_UPDATE( skullxbo )
{
- skullxbo_state *state = screen->machine->driver_data<skullxbo_state>();
+ skullxbo_state *state = screen->machine().driver_data<skullxbo_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c
index d429c614900..aa12e1bdad3 100644
--- a/src/mame/video/skydiver.c
+++ b/src/mame/video/skydiver.c
@@ -11,7 +11,7 @@
MACHINE_RESET( skydiver )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* reset all latches */
skydiver_start_lamp_1_w(space, 0, 0);
@@ -37,7 +37,7 @@ MACHINE_RESET( skydiver )
static TILE_GET_INFO( get_tile_info )
{
- skydiver_state *state = machine->driver_data<skydiver_state>();
+ skydiver_state *state = machine.driver_data<skydiver_state>();
UINT8 code = state->videoram[tile_index];
SET_TILE_INFO(0, code & 0x3f, code >> 6, 0);
}
@@ -52,7 +52,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( skydiver )
{
- skydiver_state *state = machine->driver_data<skydiver_state>();
+ skydiver_state *state = machine.driver_data<skydiver_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
}
@@ -65,7 +65,7 @@ VIDEO_START( skydiver )
WRITE8_HANDLER( skydiver_videoram_w )
{
- skydiver_state *state = space->machine->driver_data<skydiver_state>();
+ skydiver_state *state = space->machine().driver_data<skydiver_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -73,38 +73,38 @@ WRITE8_HANDLER( skydiver_videoram_w )
READ8_HANDLER( skydiver_wram_r )
{
- skydiver_state *state = space->machine->driver_data<skydiver_state>();
+ skydiver_state *state = space->machine().driver_data<skydiver_state>();
return state->videoram[offset | 0x380];
}
WRITE8_HANDLER( skydiver_wram_w )
{
- skydiver_state *state = space->machine->driver_data<skydiver_state>();
+ skydiver_state *state = space->machine().driver_data<skydiver_state>();
state->videoram[offset | 0x0380] = data;
}
WRITE8_HANDLER( skydiver_width_w )
{
- skydiver_state *state = space->machine->driver_data<skydiver_state>();
+ skydiver_state *state = space->machine().driver_data<skydiver_state>();
state->width = offset;
}
WRITE8_HANDLER( skydiver_coin_lockout_w )
{
- coin_lockout_global_w(space->machine, !offset);
+ coin_lockout_global_w(space->machine(), !offset);
}
WRITE8_HANDLER( skydiver_start_lamp_1_w )
{
- set_led_status(space->machine, 0, offset);
+ set_led_status(space->machine(), 0, offset);
}
WRITE8_HANDLER( skydiver_start_lamp_2_w )
{
- set_led_status(space->machine, 1, offset);
+ set_led_status(space->machine(), 1, offset);
}
@@ -130,7 +130,7 @@ WRITE8_HANDLER( skydiver_lamp_d_w )
WRITE8_HANDLER( skydiver_2000_201F_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
int bit = offset & 0x01;
watchdog_reset_w(space,0,0);
@@ -168,9 +168,9 @@ WRITE8_HANDLER( skydiver_2000_201F_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- skydiver_state *state = machine->driver_data<skydiver_state>();
+ skydiver_state *state = machine.driver_data<skydiver_state>();
int pic;
@@ -198,7 +198,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx -= 8;
}
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1],
charcode, color,
xflip,yflip,sx,sy,
wide ? 0x20000 : 0x10000, 0x10000,0);
@@ -208,9 +208,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( skydiver )
{
- skydiver_state *state = screen->machine->driver_data<skydiver_state>();
+ skydiver_state *state = screen->machine().driver_data<skydiver_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c
index b09a5fe9533..5948c927e1f 100644
--- a/src/mame/video/skyfox.c
+++ b/src/mame/video/skyfox.c
@@ -48,14 +48,14 @@
#ifdef UNUSED_FUNCTION
READ8_HANDLER( skyfox_vregs_r ) // for debug
{
- skyfox_state *state = space->machine->driver_data<skyfox_state>();
+ skyfox_state *state = space->machine().driver_data<skyfox_state>();
return state->vreg[offset];
}
#endif
WRITE8_HANDLER( skyfox_vregs_w )
{
- skyfox_state *state = space->machine->driver_data<skyfox_state>();
+ skyfox_state *state = space->machine().driver_data<skyfox_state>();
state->vreg[offset] = data;
@@ -159,13 +159,13 @@ Offset: Value:
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- skyfox_state *state = machine->driver_data<skyfox_state>();
+ skyfox_state *state = machine.driver_data<skyfox_state>();
int offs;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* The 32x32 tiles in the 80-ff range are bankswitched */
int shift =(state->bg_ctrl & 0x80) ? (4 - 1) : 4;
@@ -195,7 +195,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
#define DRAW_SPRITE(DX,DY,CODE) \
drawgfx_transpen(bitmap,\
- cliprect,machine->gfx[0], \
+ cliprect,machine.gfx[0], \
(CODE), \
0, \
flipx,flipy, \
@@ -238,10 +238,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
***************************************************************************/
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- skyfox_state *state = machine->driver_data<skyfox_state>();
- UINT8 *RAM = machine->region("gfx2")->base();
+ skyfox_state *state = machine.driver_data<skyfox_state>();
+ UINT8 *RAM = machine.region("gfx2")->base();
int x, y, i;
/* The foreground stars (sprites) move at twice this speed when
@@ -284,7 +284,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( skyfox )
{
bitmap_fill(bitmap, cliprect, 255); // the bg is black
- draw_background(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c
index 6695f601c8b..61dbffd700b 100644
--- a/src/mame/video/skykid.c
+++ b/src/mame/video/skykid.c
@@ -20,7 +20,7 @@ PALETTE_INIT( skykid )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -29,7 +29,7 @@ PALETTE_INIT( skykid )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -37,13 +37,13 @@ PALETTE_INIT( skykid )
/* text palette */
for (i = 0; i < 0x100; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* tiles/sprites */
for (i = 0x100; i < 0x500; i++)
{
UINT8 ctabentry = color_prom[i - 0x100];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -72,7 +72,7 @@ static TILEMAP_MAPPER( tx_tilemap_scan )
static TILE_GET_INFO( tx_get_tile_info )
{
- skykid_state *state = machine->driver_data<skykid_state>();
+ skykid_state *state = machine.driver_data<skykid_state>();
int code = state->textram[tile_index];
int attr = state->textram[tile_index + 0x400];
tileinfo->category = code >> 4 & 0xf;
@@ -91,7 +91,7 @@ static TILE_GET_INFO( tx_get_tile_info )
static TILE_GET_INFO( bg_get_tile_info )
{
- skykid_state *state = machine->driver_data<skykid_state>();
+ skykid_state *state = machine.driver_data<skykid_state>();
int code = state->videoram[tile_index];
int attr = state->videoram[tile_index+0x800];
@@ -112,7 +112,7 @@ static TILE_GET_INFO( bg_get_tile_info )
VIDEO_START( skykid )
{
- skykid_state *state = machine->driver_data<skykid_state>();
+ skykid_state *state = machine.driver_data<skykid_state>();
state->tx_tilemap = tilemap_create(machine, tx_get_tile_info,tx_tilemap_scan, 8,8,36,28);
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows, 8,8,64,32);
@@ -133,47 +133,47 @@ VIDEO_START( skykid )
READ8_HANDLER( skykid_videoram_r )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( skykid_videoram_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
}
READ8_HANDLER( skykid_textram_r )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
return state->textram[offset];
}
WRITE8_HANDLER( skykid_textram_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
state->textram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( skykid_scroll_x_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
state->scroll_x = offset;
}
WRITE8_HANDLER( skykid_scroll_y_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
state->scroll_y = offset;
}
WRITE8_HANDLER( skykid_flipscreen_priority_w )
{
- skykid_state *state = space->machine->driver_data<skykid_state>();
+ skykid_state *state = space->machine().driver_data<skykid_state>();
state->priority = data;
- flip_screen_set(space->machine, offset & 1);
+ flip_screen_set(space->machine(), offset & 1);
}
@@ -185,9 +185,9 @@ WRITE8_HANDLER( skykid_flipscreen_priority_w )
***************************************************************************/
/* the sprite generator IC is the same as Mappy */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- skykid_state *state = machine->driver_data<skykid_state>();
+ skykid_state *state = machine.driver_data<skykid_state>();
UINT8 *spriteram = state->spriteram + 0x780;
UINT8 *spriteram_2 = spriteram + 0x0800;
UINT8 *spriteram_3 = spriteram_2 + 0x0800;
@@ -226,12 +226,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0xff));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0xff));
}
}
}
@@ -240,8 +240,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( skykid )
{
- skykid_state *state = screen->machine->driver_data<skykid_state>();
- if (flip_screen_get(screen->machine))
+ skykid_state *state = screen->machine().driver_data<skykid_state>();
+ if (flip_screen_get(screen->machine()))
{
tilemap_set_scrollx(state->bg_tilemap, 0, 189 - (state->scroll_x ^ 1));
tilemap_set_scrolly(state->bg_tilemap, 0, 7 - state->scroll_y);
@@ -262,7 +262,7 @@ SCREEN_UPDATE( skykid )
// draw low priority tiles
tilemap_draw(bitmap, cliprect, state->tx_tilemap, pri, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
// draw the other tiles
for (cat = 0; cat < 0xf; cat++)
@@ -270,7 +270,7 @@ SCREEN_UPDATE( skykid )
}
else
{
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, TILEMAP_DRAW_ALL_CATEGORIES, 0);
}
diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c
index 2ac7ec22ee9..cfadc5e2190 100644
--- a/src/mame/video/skyraid.c
+++ b/src/mame/video/skyraid.c
@@ -10,15 +10,15 @@ Atari Sky Raider video emulation
VIDEO_START( skyraid )
{
- skyraid_state *state = machine->driver_data<skyraid_state>();
+ skyraid_state *state = machine.driver_data<skyraid_state>();
- state->helper = auto_bitmap_alloc(machine, 128, 240, machine->primary_screen->format());
+ state->helper = auto_bitmap_alloc(machine, 128, 240, machine.primary_screen->format());
}
-static void draw_text(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_text(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- skyraid_state *state = machine->driver_data<skyraid_state>();
+ skyraid_state *state = machine.driver_data<skyraid_state>();
const UINT8* p = state->alpha_num_ram;
int i;
@@ -31,15 +31,15 @@ static void draw_text(running_machine *machine, bitmap_t* bitmap, const rectangl
y = 136 + 16 * (i ^ 1);
for (x = 0; x < bitmap->width; x += 16)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], *p++, 0, 0, 0, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], *p++, 0, 0, 0, x, y, 0);
}
}
-static void draw_terrain(running_machine *machine, bitmap_t* bitmap, const rectangle *cliprect)
+static void draw_terrain(running_machine &machine, bitmap_t* bitmap, const rectangle *cliprect)
{
- skyraid_state *state = machine->driver_data<skyraid_state>();
- const UINT8* p = machine->region("user1")->base();
+ skyraid_state *state = machine.driver_data<skyraid_state>();
+ const UINT8* p = machine.region("user1")->base();
int x;
int y;
@@ -72,9 +72,9 @@ static void draw_terrain(running_machine *machine, bitmap_t* bitmap, const recta
}
-static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- skyraid_state *state = machine->driver_data<skyraid_state>();
+ skyraid_state *state = machine.driver_data<skyraid_state>();
int i;
for (i = 0; i < 4; i++)
@@ -87,16 +87,16 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
vert -= 31;
if (flag & 1)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code ^ 15, code >> 3, 0, 0,
horz / 2, vert, 2);
}
}
-static void draw_missiles(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_missiles(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- skyraid_state *state = machine->driver_data<skyraid_state>();
+ skyraid_state *state = machine.driver_data<skyraid_state>();
int i;
/* hardware is restricted to one sprite per scanline */
@@ -110,16 +110,16 @@ static void draw_missiles(running_machine *machine, bitmap_t* bitmap, const rect
vert -= 15;
horz -= 31;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code ^ 15, 0, 0, 0,
horz / 2, vert, 0);
}
}
-static void draw_trapezoid(running_machine *machine, bitmap_t* dst, bitmap_t* src)
+static void draw_trapezoid(running_machine &machine, bitmap_t* dst, bitmap_t* src)
{
- const UINT8* p = machine->region("user2")->base();
+ const UINT8* p = machine.region("user2")->base();
int x;
int y;
@@ -140,14 +140,14 @@ static void draw_trapezoid(running_machine *machine, bitmap_t* dst, bitmap_t* sr
SCREEN_UPDATE( skyraid )
{
- skyraid_state *state = screen->machine->driver_data<skyraid_state>();
+ skyraid_state *state = screen->machine().driver_data<skyraid_state>();
bitmap_fill(bitmap, cliprect, 0);
- draw_terrain(screen->machine, state->helper, NULL);
- draw_sprites(screen->machine, state->helper, NULL);
- draw_missiles(screen->machine, state->helper, NULL);
- draw_trapezoid(screen->machine, bitmap, state->helper);
- draw_text(screen->machine, bitmap, cliprect);
+ draw_terrain(screen->machine(), state->helper, NULL);
+ draw_sprites(screen->machine(), state->helper, NULL);
+ draw_missiles(screen->machine(), state->helper, NULL);
+ draw_trapezoid(screen->machine(), bitmap, state->helper);
+ draw_text(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/slapfght.c b/src/mame/video/slapfght.c
index 03a44df4110..ec9522f206b 100644
--- a/src/mame/video/slapfght.c
+++ b/src/mame/video/slapfght.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_pf_tile_info ) /* For Performan only */
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
int tile,color;
tile=state->slapfight_videoram[tile_index] + ((state->slapfight_colorram[tile_index] & 0x03) << 8);
@@ -32,7 +32,7 @@ static TILE_GET_INFO( get_pf_tile_info ) /* For Performan only */
static TILE_GET_INFO( get_pf1_tile_info )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
int tile,color;
tile=state->slapfight_videoram[tile_index] + ((state->slapfight_colorram[tile_index] & 0x0f) << 8);
@@ -47,7 +47,7 @@ static TILE_GET_INFO( get_pf1_tile_info )
static TILE_GET_INFO( get_fix_tile_info )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
int tile,color;
tile=state->slapfight_fixvideoram[tile_index] + ((state->slapfight_fixcolorram[tile_index] & 0x03) << 8);
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_fix_tile_info )
VIDEO_START( perfrman )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
state->pf1_tilemap = tilemap_create(machine, get_pf_tile_info,tilemap_scan_rows,8,8,64,32);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
@@ -77,7 +77,7 @@ VIDEO_START( perfrman )
VIDEO_START( slapfight )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info,tilemap_scan_rows,8,8,64,32);
state->fix_tilemap = tilemap_create(machine, get_fix_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -93,35 +93,35 @@ VIDEO_START( slapfight )
WRITE8_HANDLER( slapfight_videoram_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->slapfight_videoram[offset]=data;
tilemap_mark_tile_dirty(state->pf1_tilemap,offset);
}
WRITE8_HANDLER( slapfight_colorram_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->slapfight_colorram[offset]=data;
tilemap_mark_tile_dirty(state->pf1_tilemap,offset);
}
WRITE8_HANDLER( slapfight_fixram_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->slapfight_fixvideoram[offset]=data;
tilemap_mark_tile_dirty(state->fix_tilemap,offset);
}
WRITE8_HANDLER( slapfight_fixcol_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->slapfight_fixcolorram[offset]=data;
tilemap_mark_tile_dirty(state->fix_tilemap,offset);
}
WRITE8_HANDLER( slapfight_flipscreen_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
logerror("Writing %02x to flipscreen\n",offset);
if (offset==0) state->flipscreen=1; /* Port 0x2 is flipscreen */
else state->flipscreen=0; /* Port 0x3 is normal */
@@ -129,20 +129,20 @@ WRITE8_HANDLER( slapfight_flipscreen_w )
WRITE8_HANDLER( slapfight_palette_bank_w )
{
- slapfght_state *state = space->machine->driver_data<slapfght_state>();
+ slapfght_state *state = space->machine().driver_data<slapfght_state>();
state->slapfight_palette_bank = offset;
}
-static void slapfght_log_vram(running_machine *machine)
+static void slapfght_log_vram(running_machine &machine)
{
#ifdef MAME_DEBUG
- slapfght_state *state = machine->driver_data<slapfght_state>();
+ slapfght_state *state = machine.driver_data<slapfght_state>();
if ( input_code_pressed_once(machine, KEYCODE_B) )
{
int i;
for (i=0; i<0x800; i++)
{
- logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, state->slapfight_videoram[i],state->slapfight_colorram[i],machine->generic.spriteram.u8[i]);
+ logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, state->slapfight_videoram[i],state->slapfight_colorram[i],machine.generic.spriteram.u8[i]);
}
}
#endif
@@ -153,13 +153,13 @@ static void slapfght_log_vram(running_machine *machine)
Render the Sprites
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority_to_display )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority_to_display )
{
- slapfght_state *state = machine->driver_data<slapfght_state>();
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ slapfght_state *state = machine.driver_data<slapfght_state>();
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
- for (offs = 0;offs < machine->generic.spriteram_size;offs += 4)
+ for (offs = 0;offs < machine.generic.spriteram_size;offs += 4)
{
int sx, sy;
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = buffered_spriteram[offs+1] + 3;
sy = buffered_spriteram[offs+3] - 1;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
buffered_spriteram[offs],
((buffered_spriteram[offs+2] >> 1) & 3) |
((buffered_spriteram[offs+2] << 2) & 4) | (state->slapfight_palette_bank << 3),
@@ -189,7 +189,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( perfrman )
{
- slapfght_state *state = screen->machine->driver_data<slapfght_state>();
+ slapfght_state *state = screen->machine().driver_data<slapfght_state>();
tilemap_set_flip( state->pf1_tilemap, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
tilemap_set_scrolly( state->pf1_tilemap ,0 , 0 );
if (state->flipscreen) {
@@ -200,22 +200,22 @@ SCREEN_UPDATE( perfrman )
}
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0x80);
+ draw_sprites(screen->machine(), bitmap,cliprect,0x80);
- slapfght_log_vram(screen->machine);
+ slapfght_log_vram(screen->machine());
return 0;
}
SCREEN_UPDATE( slapfight )
{
- slapfght_state *state = screen->machine->driver_data<slapfght_state>();
- UINT8 *buffered_spriteram = screen->machine->generic.buffered_spriteram.u8;
+ slapfght_state *state = screen->machine().driver_data<slapfght_state>();
+ UINT8 *buffered_spriteram = screen->machine().generic.buffered_spriteram.u8;
int offs;
- tilemap_set_flip_all(screen->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen) {
tilemap_set_scrollx( state->fix_tilemap,0,296);
tilemap_set_scrollx( state->pf1_tilemap,0,(*state->slapfight_scrollx_lo + 256 * *state->slapfight_scrollx_hi)+296 );
@@ -232,16 +232,16 @@ SCREEN_UPDATE( slapfight )
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0);
/* Draw the sprites */
- for (offs = 0;offs < screen->machine->generic.spriteram_size;offs += 4)
+ for (offs = 0;offs < screen->machine().generic.spriteram_size;offs += 4)
{
if (state->flipscreen)
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
(buffered_spriteram[offs+2] & 0x1e) >> 1,
1,1,
288-(buffered_spriteram[offs+1] + ((buffered_spriteram[offs+2] & 0x01) << 8)) +18,240-buffered_spriteram[offs+3],0);
else
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
buffered_spriteram[offs] + ((buffered_spriteram[offs+2] & 0xc0) << 2),
(buffered_spriteram[offs+2] & 0x1e) >> 1,
0,0,
@@ -250,6 +250,6 @@ SCREEN_UPDATE( slapfight )
tilemap_draw(bitmap,cliprect,state->fix_tilemap,0,0);
- slapfght_log_vram(screen->machine);
+ slapfght_log_vram(screen->machine());
return 0;
}
diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c
index d1022638a08..ad48bfaf10a 100644
--- a/src/mame/video/slapshot.c
+++ b/src/mame/video/slapshot.c
@@ -6,7 +6,7 @@
VIDEO_START( slapshot )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
int i;
state->spriteram_delayed = auto_alloc_array(machine, UINT16, state->spriteram_size / 2);
@@ -34,7 +34,7 @@ VIDEO_START( slapshot )
SPRITE DRAW ROUTINES
************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int y_offset )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int y_offset )
{
/*
Sprite format:
@@ -89,7 +89,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
000b - 000f : unused
*/
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
int x, y, off, extoffs;
int code, color, spritedata, spritecont, flipx, flipy;
int xcurrent, ycurrent, big_sprite = 0;
@@ -333,7 +333,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
sprite_ptr->code = code;
sprite_ptr->color = color;
- if (machine->gfx[0]->color_granularity == 64) /* Final Blow, Slapshot are 6bpp */
+ if (machine.gfx[0]->color_granularity == 64) /* Final Blow, Slapshot are 6bpp */
sprite_ptr->color /= 4;
sprite_ptr->flipx = flipx;
sprite_ptr->flipy = flipy;
@@ -350,7 +350,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -366,20 +366,20 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
-static void taito_handle_sprite_buffering( running_machine *machine )
+static void taito_handle_sprite_buffering( running_machine &machine )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
if (state->prepare_sprites) /* no buffering */
{
@@ -388,9 +388,9 @@ static void taito_handle_sprite_buffering( running_machine *machine )
}
}
-static void taito_update_sprites_active_area( running_machine *machine )
+static void taito_update_sprites_active_area( running_machine &machine )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
int off;
/* if the frame was skipped, we'll have to do the buffering now */
@@ -430,7 +430,7 @@ static void taito_update_sprites_active_area( running_machine *machine )
SCREEN_EOF( taito_no_buffer )
{
- slapshot_state *state = machine->driver_data<slapshot_state>();
+ slapshot_state *state = machine.driver_data<slapshot_state>();
taito_update_sprites_active_area(machine);
@@ -456,45 +456,45 @@ a bg layer given priority over some sprites.
SCREEN_UPDATE( slapshot )
{
- slapshot_state *state = screen->machine->driver_data<slapshot_state>();
+ slapshot_state *state = screen->machine().driver_data<slapshot_state>();
UINT8 layer[5];
UINT8 tilepri[5];
UINT8 spritepri[4];
UINT16 priority;
#ifdef MAME_DEBUG
- if (input_code_pressed_once (screen->machine, KEYCODE_Z))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_Z))
{
state->dislayer[0] ^= 1;
popmessage("bg0: %01x",state->dislayer[0]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_X))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_X))
{
state->dislayer[1] ^= 1;
popmessage("bg1: %01x",state->dislayer[1]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_C))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_C))
{
state->dislayer[2] ^= 1;
popmessage("bg2: %01x",state->dislayer[2]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_V))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_V))
{
state->dislayer[3] ^= 1;
popmessage("bg3: %01x",state->dislayer[3]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_B))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_B))
{
state->dislayer[4] ^= 1;
popmessage("text: %01x",state->dislayer[4]);
}
#endif
- taito_handle_sprite_buffering(screen->machine);
+ taito_handle_sprite_buffering(screen->machine());
tc0480scp_tilemap_update(state->tc0480scp);
@@ -519,7 +519,7 @@ SCREEN_UPDATE( slapshot )
spritepri[2] = tc0360pri_r(state->tc0360pri, 7) & 0x0f;
spritepri[3] = tc0360pri_r(state->tc0360pri, 7) >> 4;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
#ifdef MAME_DEBUG
@@ -554,7 +554,7 @@ SCREEN_UPDATE( slapshot )
if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
}
- draw_sprites(screen->machine,bitmap,cliprect,primasks,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,primasks,0);
}
/*
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index a4a4cee305c..10bce015d9d 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -96,7 +96,7 @@ struct DEBUGOPTS
static struct DEBUGOPTS debug_options;
/* red green blue purple yellow cyan grey white */
static const UINT16 dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff };
-static UINT8 snes_dbg_video(running_machine *machine, UINT16 curline);
+static UINT8 snes_dbg_video(running_machine &machine, UINT16 curline);
#endif /* SNES_LAYER_DEBUG */
static const UINT16 table_obj_offset[8][8] =
@@ -1498,7 +1498,7 @@ INLINE void snes_draw_blend( UINT16 offset, UINT16 *colour, UINT8 prevent_color_
* the optimized averaging algorithm.
*********************************************/
-static void snes_refresh_scanline( running_machine *machine, bitmap_t *bitmap, UINT16 curline )
+static void snes_refresh_scanline( running_machine &machine, bitmap_t *bitmap, UINT16 curline )
{
UINT16 ii;
int x;
@@ -1796,7 +1796,7 @@ SCREEN_UPDATE( snes )
/*NTSC SNES draw range is 1-225. */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
- snes_refresh_scanline(screen->machine, bitmap, y + 1);
+ snes_refresh_scanline(screen->machine(), bitmap, y + 1);
}
return 0;
}
@@ -1810,12 +1810,12 @@ static const UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 };
static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 };
// utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc.
-void snes_latch_counters( running_machine *machine )
+void snes_latch_counters( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
- snes_ppu.beam.current_horz = machine->primary_screen->hpos() / state->htmult;
- snes_ppu.beam.latch_vert = machine->primary_screen->vpos();
+ snes_ppu.beam.current_horz = machine.primary_screen->hpos() / state->htmult;
+ snes_ppu.beam.latch_vert = machine.primary_screen->vpos();
snes_ppu.beam.latch_horz = snes_ppu.beam.current_horz;
snes_ram[STAT78] |= 0x40; // indicate we latched
// state->read_ophct = state->read_opvct = 0; // clear read flags - 2009-08: I think we must clear these when STAT78 is read...
@@ -1823,10 +1823,10 @@ void snes_latch_counters( running_machine *machine )
// printf("latched @ H %d V %d\n", snes_ppu.beam.latch_horz, snes_ppu.beam.latch_vert);
}
-static void snes_dynamic_res_change( running_machine *machine )
+static void snes_dynamic_res_change( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
- rectangle visarea = machine->primary_screen->visible_area();
+ snes_state *state = machine.driver_data<snes_state>();
+ rectangle visarea = machine.primary_screen->visible_area();
attoseconds_t refresh;
visarea.min_x = visarea.min_y = 0;
@@ -1846,9 +1846,9 @@ static void snes_dynamic_res_change( running_machine *machine )
refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL;
if ((snes_ram[STAT78] & 0x10) == SNES_NTSC)
- machine->primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * snes_ppu.interlace, visarea, refresh);
+ machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * snes_ppu.interlace, visarea, refresh);
else
- machine->primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * snes_ppu.interlace, visarea, refresh);
+ machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * snes_ppu.interlace, visarea, refresh);
}
/*************************************************
@@ -1867,9 +1867,9 @@ static void snes_dynamic_res_change( running_machine *machine )
when interlace is active.
*************************************************/
-INLINE UINT32 snes_get_vram_address( running_machine *machine )
+INLINE UINT32 snes_get_vram_address( running_machine &machine )
{
- snes_state *state = machine->driver_data<snes_state>();
+ snes_state *state = machine.driver_data<snes_state>();
UINT32 addr = state->vmadd;
if (state->vram_fgr_count)
@@ -1891,8 +1891,8 @@ static READ8_HANDLER( snes_vram_read )
res = snes_vram[offset];
else
{
- UINT16 v = space->machine->primary_screen->vpos();
- UINT16 h = space->machine->primary_screen->hpos();
+ UINT16 v = space->machine().primary_screen->vpos();
+ UINT16 h = space->machine().primary_screen->hpos();
UINT16 ls = (((snes_ram[STAT78] & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1;
if (snes_ppu.interlace == 2)
@@ -1923,8 +1923,8 @@ static WRITE8_HANDLER( snes_vram_write )
snes_vram[offset] = data;
else
{
- UINT16 v = space->machine->primary_screen->vpos();
- UINT16 h = space->machine->primary_screen->hpos();
+ UINT16 v = space->machine().primary_screen->vpos();
+ UINT16 h = space->machine().primary_screen->hpos();
if (v == 0)
{
if (h <= 4)
@@ -1986,7 +1986,7 @@ static READ8_HANDLER( snes_oam_read )
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine->primary_screen->vpos();
+ UINT16 v = space->machine().primary_screen->vpos();
if (v < snes_ppu.beam.last_visible_line)
offset = 0x010c;
@@ -2004,7 +2004,7 @@ static WRITE8_HANDLER( snes_oam_write )
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine->primary_screen->vpos();
+ UINT16 v = space->machine().primary_screen->vpos();
if (v < snes_ppu.beam.last_visible_line)
offset = 0x010c;
@@ -2045,8 +2045,8 @@ static READ8_HANDLER( snes_cgram_read )
#if 0
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine->primary_screen->vpos();
- UINT16 h = space->machine->primary_screen->hpos();
+ UINT16 v = space->machine().primary_screen->vpos();
+ UINT16 h = space->machine().primary_screen->hpos();
if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2073,8 +2073,8 @@ static WRITE8_HANDLER( snes_cgram_write )
// writes to the cgram address
if (!snes_ppu.screen_disabled)
{
- UINT16 v = space->machine->primary_screen->vpos();
- UINT16 h = space->machine->primary_screen->hpos();
+ UINT16 v = space->machine().primary_screen->vpos();
+ UINT16 h = space->machine().primary_screen->hpos();
if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096)
offset = 0x1ff;
@@ -2091,7 +2091,7 @@ static WRITE8_HANDLER( snes_cgram_write )
READ8_HANDLER( snes_ppu_read )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
UINT8 value;
switch (offset)
@@ -2138,7 +2138,7 @@ READ8_HANDLER( snes_ppu_read )
return snes_ppu.ppu1_open_bus;
}
case SLHV: /* Software latch for H/V counter */
- snes_latch_counters(space->machine);
+ snes_latch_counters(space->machine());
return snes_open_bus_r(space, 0); /* Return value is meaningless */
case ROAMDATA: /* Read data from OAM (DR) */
snes_ppu.ppu1_open_bus = snes_oam_read(space, snes_ppu.oam.address);
@@ -2152,7 +2152,7 @@ READ8_HANDLER( snes_ppu_read )
return snes_ppu.ppu1_open_bus;
case RVMDATAL: /* Read data from VRAM (low) */
{
- UINT32 addr = snes_get_vram_address(space->machine) << 1;
+ UINT32 addr = snes_get_vram_address(space->machine()) << 1;
snes_ppu.ppu1_open_bus = state->vram_read_buffer & 0xff;
if (!state->vram_fgr_high)
@@ -2167,7 +2167,7 @@ READ8_HANDLER( snes_ppu_read )
}
case RVMDATAH: /* Read data from VRAM (high) */
{
- UINT32 addr = snes_get_vram_address(space->machine) << 1;
+ UINT32 addr = snes_get_vram_address(space->machine()) << 1;
snes_ppu.ppu1_open_bus = (state->vram_read_buffer >> 8) & 0xff;
if (state->vram_fgr_high)
@@ -2240,7 +2240,7 @@ READ8_HANDLER( snes_ppu_read )
WRITE8_HANDLER( snes_ppu_write )
{
- snes_state *state = space->machine->driver_data<snes_state>();
+ snes_state *state = space->machine().driver_data<snes_state>();
switch (offset)
{
@@ -2300,7 +2300,7 @@ WRITE8_HANDLER( snes_ppu_write )
return;
case BGMODE: /* BG mode and character size settings */
snes_ppu.mode = data & 0x07;
- snes_dynamic_res_change(space->machine);
+ snes_dynamic_res_change(space->machine());
snes_ppu.bg3_priority_bit = BIT(data, 3);
snes_ppu.layer[SNES_BG1].tile_size = BIT(data, 4);
snes_ppu.layer[SNES_BG2].tile_size = BIT(data, 5);
@@ -2402,7 +2402,7 @@ WRITE8_HANDLER( snes_ppu_write )
{
UINT32 addr;
state->vmadd = (state->vmadd & 0xff00) | (data << 0);
- addr = snes_get_vram_address(space->machine) << 1;
+ addr = snes_get_vram_address(space->machine()) << 1;
state->vram_read_buffer = snes_vram_read(space, addr);
state->vram_read_buffer |= (snes_vram_read(space, addr + 1) << 8);
}
@@ -2411,14 +2411,14 @@ WRITE8_HANDLER( snes_ppu_write )
{
UINT32 addr;
state->vmadd = (state->vmadd & 0x00ff) | (data << 8);
- addr = snes_get_vram_address(space->machine) << 1;
+ addr = snes_get_vram_address(space->machine()) << 1;
state->vram_read_buffer = snes_vram_read(space, addr);
state->vram_read_buffer |= (snes_vram_read(space, addr + 1) << 8);
}
break;
case VMDATAL: /* 2118: Data for VRAM write (low) */
{
- UINT32 addr = snes_get_vram_address(space->machine) << 1;
+ UINT32 addr = snes_get_vram_address(space->machine()) << 1;
snes_vram_write(space, addr, data);
if (!state->vram_fgr_high)
@@ -2427,7 +2427,7 @@ WRITE8_HANDLER( snes_ppu_write )
return;
case VMDATAH: /* 2119: Data for VRAM write (high) */
{
- UINT32 addr = snes_get_vram_address(space->machine) << 1;
+ UINT32 addr = snes_get_vram_address(space->machine()) << 1;
snes_vram_write(space, addr + 1, data);
if (state->vram_fgr_high)
@@ -2631,7 +2631,7 @@ WRITE8_HANDLER( snes_ppu_write )
snes_ppu.beam.last_visible_line = (data & 0x04) ? 240 : 225;
snes_ppu.pseudo_hires = BIT(data, 3);
snes_ppu.mode7.extbg = BIT(data, 6);
- snes_dynamic_res_change(space->machine);
+ snes_dynamic_res_change(space->machine());
#ifdef SNES_DBG_REG_W
if ((data & 0x8) != (snes_ram[SETINI] & 0x8))
mame_printf_debug( "Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off" );
@@ -2659,7 +2659,7 @@ WRITE8_HANDLER( snes_ppu_write )
} \
-static UINT8 snes_dbg_video( running_machine *machine, UINT16 curline )
+static UINT8 snes_dbg_video( running_machine &machine, UINT16 curline )
{
int i;
UINT8 toggles = input_port_read_safe(machine, "DEBUG1", 0);
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index 428e02466e0..1e3b110a4df 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -71,7 +71,7 @@ static TILEMAP_MAPPER( marvins_tx_scan_cols )
static TILE_GET_INFO( marvins_get_tx_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->tx_videoram[tile_index];
int color = code >> 5;
@@ -83,7 +83,7 @@ static TILE_GET_INFO( marvins_get_tx_tile_info )
static TILE_GET_INFO( ikari_get_tx_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->tx_videoram[tile_index];
SET_TILE_INFO(0,
@@ -94,7 +94,7 @@ static TILE_GET_INFO( ikari_get_tx_tile_info )
static TILE_GET_INFO( gwar_get_tx_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->tx_videoram[tile_index];
SET_TILE_INFO(0,
@@ -106,7 +106,7 @@ static TILE_GET_INFO( gwar_get_tx_tile_info )
static TILE_GET_INFO( marvins_get_fg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->fg_videoram[tile_index];
SET_TILE_INFO(1,
@@ -117,7 +117,7 @@ static TILE_GET_INFO( marvins_get_fg_tile_info )
static TILE_GET_INFO( marvins_get_bg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->bg_videoram[tile_index];
SET_TILE_INFO(2,
@@ -129,7 +129,7 @@ static TILE_GET_INFO( marvins_get_bg_tile_info )
static TILE_GET_INFO( aso_get_bg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int code = state->bg_videoram[tile_index];
SET_TILE_INFO(1,
@@ -140,7 +140,7 @@ static TILE_GET_INFO( aso_get_bg_tile_info )
static TILE_GET_INFO( tnk3_get_bg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int attr = state->bg_videoram[2*tile_index+1];
int code = state->bg_videoram[2*tile_index] | ((attr & 0x30) << 4);
int color = (attr & 0xf) ^ 8;
@@ -153,7 +153,7 @@ static TILE_GET_INFO( tnk3_get_bg_tile_info )
static TILE_GET_INFO( ikari_get_bg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int attr = state->bg_videoram[2*tile_index+1];
int code = state->bg_videoram[2*tile_index] | ((attr & 0x03) << 8);
int color = (attr & 0x70) >> 4;
@@ -166,7 +166,7 @@ static TILE_GET_INFO( ikari_get_bg_tile_info )
static TILE_GET_INFO( gwar_get_bg_tile_info )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int attr = state->bg_videoram[2*tile_index+1];
int code = state->bg_videoram[2*tile_index] | ((attr & 0x0f) << 8);
int color = (attr & 0xf0) >> 4;
@@ -182,7 +182,7 @@ static TILE_GET_INFO( gwar_get_bg_tile_info )
// bermudat, tdfever use FFFF to blank the background.
// (still call SET_TILE_INFO, otherwise problems might occur on boot when
// the tile data hasn't been initialised)
- if (code >= machine->gfx[1]->total_elements)
+ if (code >= machine.gfx[1]->total_elements)
tileinfo->pen_data = state->empty_tile;
}
@@ -191,27 +191,27 @@ static TILE_GET_INFO( gwar_get_bg_tile_info )
static VIDEO_START( snk_3bpp_shadow )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int i;
- if(!(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if(!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
fatalerror("driver should use VIDEO_HAS_SHADOWS");
/* prepare shadow draw table */
for(i = 0; i <= 5; i++) state->drawmode_table[i] = DRAWMODE_SOURCE;
- state->drawmode_table[6] = (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
+ state->drawmode_table[6] = (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE;
state->drawmode_table[7] = DRAWMODE_NONE;
for (i = 0x000;i < 0x400;i++)
- machine->shadow_table[i] = i | 0x200;
+ machine.shadow_table[i] = i | 0x200;
}
static VIDEO_START( snk_4bpp_shadow )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int i;
- if(!(machine->config().m_video_attributes & VIDEO_HAS_SHADOWS))
+ if(!(machine.config().m_video_attributes & VIDEO_HAS_SHADOWS))
fatalerror("driver should use VIDEO_HAS_SHADOWS");
/* prepare shadow draw table */
@@ -221,16 +221,16 @@ static VIDEO_START( snk_4bpp_shadow )
/* all palette entries are not affected by shadow sprites... */
for (i = 0x000;i < 0x400;i++)
- machine->shadow_table[i] = i;
+ machine.shadow_table[i] = i;
/* ... except for tilemap colors */
for (i = 0x200;i < 0x300;i++)
- machine->shadow_table[i] = i + 0x100;
+ machine.shadow_table[i] = i + 0x100;
}
VIDEO_START( marvins )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(snk_3bpp_shadow);
@@ -253,7 +253,7 @@ VIDEO_START( marvins )
VIDEO_START( jcross )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(snk_3bpp_shadow);
@@ -274,7 +274,7 @@ VIDEO_START( jcross )
VIDEO_START( sgladiat )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(snk_3bpp_shadow);
@@ -295,7 +295,7 @@ VIDEO_START( sgladiat )
VIDEO_START( hal21 )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(jcross);
@@ -307,7 +307,7 @@ VIDEO_START( hal21 )
VIDEO_START( aso )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(jcross);
@@ -320,7 +320,7 @@ VIDEO_START( aso )
VIDEO_START( tnk3 )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(snk_3bpp_shadow);
@@ -340,7 +340,7 @@ VIDEO_START( tnk3 )
VIDEO_START( ikari )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(snk_3bpp_shadow);
@@ -358,7 +358,7 @@ VIDEO_START( ikari )
VIDEO_START( gwar )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
int i;
/* prepare drawmode table */
@@ -382,7 +382,7 @@ VIDEO_START( gwar )
VIDEO_START( psychos )
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
VIDEO_START_CALL(gwar);
state->is_psychos = 1;
@@ -398,7 +398,7 @@ VIDEO_START( tdfever )
WRITE8_HANDLER( snk_tx_videoram_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->tx_videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -406,7 +406,7 @@ WRITE8_HANDLER( snk_tx_videoram_w )
WRITE8_HANDLER( marvins_fg_videoram_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -414,7 +414,7 @@ WRITE8_HANDLER( marvins_fg_videoram_w )
WRITE8_HANDLER( marvins_bg_videoram_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -422,7 +422,7 @@ WRITE8_HANDLER( marvins_bg_videoram_w )
WRITE8_HANDLER( snk_bg_videoram_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset >> 1);
@@ -431,63 +431,63 @@ WRITE8_HANDLER( snk_bg_videoram_w )
WRITE8_HANDLER( snk_fg_scrollx_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->fg_scrollx = (state->fg_scrollx & ~0xff) | data;
}
WRITE8_HANDLER( snk_fg_scrolly_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->fg_scrolly = (state->fg_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_bg_scrollx_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrollx = (state->bg_scrollx & ~0xff) | data;
}
WRITE8_HANDLER( snk_bg_scrolly_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrolly = (state->bg_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_sp16_scrollx_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp16_scrollx = (state->sp16_scrollx & ~0xff) | data;
}
WRITE8_HANDLER( snk_sp16_scrolly_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp16_scrolly = (state->sp16_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_sp32_scrollx_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp32_scrollx = (state->sp32_scrollx & ~0xff) | data;
}
WRITE8_HANDLER( snk_sp32_scrolly_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp32_scrolly = (state->sp32_scrolly & ~0xff) | data;
}
WRITE8_HANDLER( snk_sprite_split_point_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sprite_split_point = data;
}
@@ -495,7 +495,7 @@ WRITE8_HANDLER( snk_sprite_split_point_w )
WRITE8_HANDLER( marvins_palette_bank_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
tilemap_set_palette_offset(state->bg_tilemap, data & 0x70);
tilemap_set_palette_offset(state->fg_tilemap, (data & 0x07) << 4);
@@ -503,16 +503,16 @@ WRITE8_HANDLER( marvins_palette_bank_w )
WRITE8_HANDLER( marvins_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
// other bits unknown
}
WRITE8_HANDLER( sgladiat_flipscreen_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
tilemap_set_palette_offset(state->bg_tilemap, ((data & 0xf) ^ 8) << 4);
@@ -521,9 +521,9 @@ WRITE8_HANDLER( sgladiat_flipscreen_w )
WRITE8_HANDLER( hal21_flipscreen_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
tilemap_set_palette_offset(state->bg_tilemap, ((data & 0xf) ^ 8) << 4);
if (state->bg_tile_offset != ((data & 0x20) << 3))
@@ -537,7 +537,7 @@ WRITE8_HANDLER( hal21_flipscreen_w )
WRITE8_HANDLER( marvins_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrollx = (state->bg_scrollx & 0xff) | ((data & 0x04) << 6);
state->fg_scrollx = (state->fg_scrollx & 0xff) | ((data & 0x02) << 7);
@@ -546,7 +546,7 @@ WRITE8_HANDLER( marvins_scroll_msb_w )
WRITE8_HANDLER( jcross_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrolly = (state->bg_scrolly & 0xff) | ((data & 0x10) << 4);
state->sp16_scrolly = (state->sp16_scrolly & 0xff) | ((data & 0x08) << 5);
@@ -556,7 +556,7 @@ WRITE8_HANDLER( jcross_scroll_msb_w )
WRITE8_HANDLER( sgladiat_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrollx = (state->bg_scrollx & 0xff) | ((data & 0x02) << 7);
state->sp16_scrollx = (state->sp16_scrollx & 0xff) | ((data & 0x01) << 8);
@@ -576,9 +576,9 @@ WRITE8_HANDLER( aso_videoattrs_w )
-------X scrollx MSB (sprites)
*/
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
state->bg_scrolly = (state->bg_scrolly & 0xff) | ((data & 0x10) << 4);
state->sp16_scrolly = (state->sp16_scrolly & 0xff) | ((data & 0x08) << 5);
@@ -600,9 +600,9 @@ WRITE8_HANDLER( tnk3_videoattrs_w )
-------X scrollx MSB (sprites)
*/
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
if (state->tx_tile_offset != ((data & 0x40) << 2))
{
@@ -618,7 +618,7 @@ WRITE8_HANDLER( tnk3_videoattrs_w )
WRITE8_HANDLER( aso_bg_bank_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
tilemap_set_palette_offset(state->bg_tilemap, ((data & 0xf) ^ 8) << 4);
if (state->bg_tile_offset != ((data & 0x30) << 4))
@@ -630,7 +630,7 @@ WRITE8_HANDLER( aso_bg_bank_w )
WRITE8_HANDLER( ikari_bg_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->bg_scrollx = (state->bg_scrollx & 0xff) | ((data & 0x02) << 7);
state->bg_scrolly = (state->bg_scrolly & 0xff) | ((data & 0x01) << 8);
@@ -638,7 +638,7 @@ WRITE8_HANDLER( ikari_bg_scroll_msb_w )
WRITE8_HANDLER( ikari_sp_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp32_scrollx = (state->sp32_scrollx & 0xff) | ((data & 0x20) << 3);
state->sp16_scrollx = (state->sp16_scrollx & 0xff) | ((data & 0x10) << 4);
@@ -654,7 +654,7 @@ WRITE8_HANDLER( ikari_unknown_video_w )
hard flags test and the test grid.
Changing palette bank is necessary to fix colors in test mode. */
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
if (data != 0x20 && // normal
data != 0x31 && // ikari test
@@ -671,7 +671,7 @@ if (data != 0x20 && // normal
WRITE8_HANDLER( gwar_tx_bank_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
tilemap_set_palette_offset(state->tx_tilemap, (data & 0xf) << 4);
if (state->tx_tile_offset != ((data & 0x30) << 4))
@@ -686,9 +686,9 @@ WRITE8_HANDLER( gwar_tx_bank_w )
WRITE8_HANDLER( gwar_videoattrs_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x04);
+ flip_screen_set(space->machine(), data & 0x04);
state->sp32_scrollx = (state->sp32_scrollx & 0xff) | ((data & 0x80) << 1);
state->sp16_scrollx = (state->sp16_scrollx & 0xff) | ((data & 0x40) << 2);
@@ -700,9 +700,9 @@ WRITE8_HANDLER( gwar_videoattrs_w )
WRITE8_HANDLER( gwara_videoattrs_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
state->bg_scrollx = (state->bg_scrollx & 0xff) | ((data & 0x02) << 7);
state->bg_scrolly = (state->bg_scrolly & 0xff) | ((data & 0x01) << 8);
@@ -710,7 +710,7 @@ WRITE8_HANDLER( gwara_videoattrs_w )
WRITE8_HANDLER( gwara_sp_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp32_scrollx = (state->sp32_scrollx & 0xff) | ((data & 0x20) << 3);
state->sp16_scrollx = (state->sp16_scrollx & 0xff) | ((data & 0x10) << 4);
@@ -720,7 +720,7 @@ WRITE8_HANDLER( gwara_sp_scroll_msb_w )
WRITE8_HANDLER( tdfever_sp_scroll_msb_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
state->sp32_scrolly = (state->sp32_scrolly & 0xff) | ((data & 0x80) << 1);
state->sp32_scrollx = (state->sp32_scrollx & 0xff) | ((data & 0x40) << 2);
@@ -728,15 +728,15 @@ WRITE8_HANDLER( tdfever_sp_scroll_msb_w )
WRITE8_HANDLER( tdfever_spriteram_w )
{
- snk_state *state = space->machine->driver_data<snk_state>();
+ snk_state *state = space->machine().driver_data<snk_state>();
/* partial updates avoid flickers in the fsoccer radar. */
if (offset < 0x80 && state->spriteram[offset] != data)
{
- int vpos = space->machine->primary_screen->vpos();
+ int vpos = space->machine().primary_screen->vpos();
if (vpos > 0)
- space->machine->primary_screen->update_partial(vpos - 1);
+ space->machine().primary_screen->update_partial(vpos - 1);
}
state->spriteram[offset] = data;
@@ -744,11 +744,11 @@ WRITE8_HANDLER( tdfever_spriteram_w )
/**************************************************************************************/
-static void marvins_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void marvins_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
const int scrollx, const int scrolly, const int from, const int to)
{
- snk_state *state = machine->driver_data<snk_state>();
- const gfx_element *gfx = machine->gfx[3];
+ snk_state *state = machine.driver_data<snk_state>();
+ const gfx_element *gfx = machine.gfx[3];
const UINT8 *source, *finish;
source = state->spriteram + from*4;
@@ -782,18 +782,18 @@ static void marvins_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
color,
flipx, flipy,
sx, sy,
- state->drawmode_table, machine->shadow_table);
+ state->drawmode_table, machine.shadow_table);
source+=4;
}
}
-static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const int xscroll, const int yscroll)
+static void tnk3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int xscroll, const int yscroll)
{
- snk_state *state = machine->driver_data<snk_state>();
+ snk_state *state = machine.driver_data<snk_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[2];
const int size = gfx->width;
int tile_number, attributes, color, sx, sy;
int xflip,yflip;
@@ -849,16 +849,16 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
color,
xflip,yflip,
sx,sy,
- state->drawmode_table, machine->shadow_table);
+ state->drawmode_table, machine.shadow_table);
}
}
-static void ikari_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void ikari_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum )
{
- snk_state *state = machine->driver_data<snk_state>();
- const gfx_element *gfx = machine->gfx[gfxnum];
+ snk_state *state = machine.driver_data<snk_state>();
+ const gfx_element *gfx = machine.gfx[gfxnum];
const int size = gfx->width;
int tile_number, attributes, color, sx, sy;
int which, finish;
@@ -896,7 +896,7 @@ static void ikari_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
color,
0,0,
sx,sy,
- state->drawmode_table, machine->shadow_table);
+ state->drawmode_table, machine.shadow_table);
}
}
@@ -926,11 +926,11 @@ byte3: attributes
-xx-x--- (bank number)
x------- (x offset bit8)
*/
-static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to )
{
- snk_state *state = machine->driver_data<snk_state>();
- const gfx_element *gfx = machine->gfx[gfxnum];
+ snk_state *state = machine.driver_data<snk_state>();
+ const gfx_element *gfx = machine.gfx[gfxnum];
const int size = gfx->width;
int tile_number, attributes, sx, sy, color;
int which;
@@ -984,7 +984,7 @@ static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
color,
flipx,flipy,
sx,sy,
- state->drawmode_table, machine->shadow_table);
+ state->drawmode_table, machine.shadow_table);
}
}
@@ -992,7 +992,7 @@ static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( marvins )
{
- snk_state *state = screen->machine->driver_data<snk_state>();
+ snk_state *state = screen->machine().driver_data<snk_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
@@ -1000,9 +1000,9 @@ SCREEN_UPDATE( marvins )
tilemap_set_scrolly(state->fg_tilemap, 0, state->fg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- marvins_draw_sprites(screen->machine, bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, 0, state->sprite_split_point>>2);
+ marvins_draw_sprites(screen->machine(), bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, 0, state->sprite_split_point>>2);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- marvins_draw_sprites(screen->machine, bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->sprite_split_point>>2, 25);
+ marvins_draw_sprites(screen->machine(), bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->sprite_split_point>>2, 25);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
@@ -1011,13 +1011,13 @@ SCREEN_UPDATE( marvins )
SCREEN_UPDATE( tnk3 )
{
- snk_state *state = screen->machine->driver_data<snk_state>();
+ snk_state *state = screen->machine().driver_data<snk_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- tnk3_draw_sprites(screen->machine, bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly);
+ tnk3_draw_sprites(screen->machine(), bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
@@ -1026,16 +1026,16 @@ SCREEN_UPDATE( tnk3 )
SCREEN_UPDATE( ikari )
{
- snk_state *state = screen->machine->driver_data<snk_state>();
+ snk_state *state = screen->machine().driver_data<snk_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- ikari_draw_sprites(screen->machine, bitmap, cliprect, 0, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2 );
- ikari_draw_sprites(screen->machine, bitmap, cliprect, 0, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 3 );
- ikari_draw_sprites(screen->machine, bitmap, cliprect, 25, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2 );
+ ikari_draw_sprites(screen->machine(), bitmap, cliprect, 0, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2 );
+ ikari_draw_sprites(screen->machine(), bitmap, cliprect, 0, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 3 );
+ ikari_draw_sprites(screen->machine(), bitmap, cliprect, 25, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2 );
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
return 0;
@@ -1044,16 +1044,16 @@ SCREEN_UPDATE( ikari )
SCREEN_UPDATE( gwar )
{
- snk_state *state = screen->machine->driver_data<snk_state>();
+ snk_state *state = screen->machine().driver_data<snk_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- tdfever_draw_sprites(screen->machine, bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2, 0, 0, state->sprite_split_point );
- tdfever_draw_sprites(screen->machine, bitmap, cliprect, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 3, 0, 0, 32 );
- tdfever_draw_sprites(screen->machine, bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2, 0, state->sprite_split_point, 64 );
+ tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2, 0, 0, state->sprite_split_point );
+ tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 3, 0, 0, 32 );
+ tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->sp16_scrollx, state->sp16_scrolly, state->spriteram + 0x800, 2, 0, state->sprite_split_point, 64 );
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -1063,14 +1063,14 @@ SCREEN_UPDATE( gwar )
SCREEN_UPDATE( tdfever )
{
- snk_state *state = screen->machine->driver_data<snk_state>();
+ snk_state *state = screen->machine().driver_data<snk_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->bg_scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- tdfever_draw_sprites(screen->machine, bitmap, cliprect, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 2, 1, 0, 32 );
+ tdfever_draw_sprites(screen->machine(), bitmap, cliprect, state->sp32_scrollx, state->sp32_scrolly, state->spriteram, 2, 1, 0, 32 );
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
diff --git a/src/mame/video/snk6502.c b/src/mame/video/snk6502.c
index 5cac14acc13..427b63333ab 100644
--- a/src/mame/video/snk6502.c
+++ b/src/mame/video/snk6502.c
@@ -10,8 +10,8 @@
#include "includes/snk6502.h"
-#define TOTAL_COLORS(m,gfxn) ((m)->gfx[gfxn]->total_colors * (m)->gfx[gfxn]->color_granularity)
-#define COLOR(m,gfxn,offs) ((m)->config().m_gfxdecodeinfo[gfxn].color_codes_start + offs)
+#define TOTAL_COLORS(m,gfxn) ((m).gfx[gfxn]->total_colors * (m).gfx[gfxn]->color_granularity)
+#define COLOR(m,gfxn,offs) ((m).config().m_gfxdecodeinfo[gfxn].color_codes_start + offs)
@@ -24,10 +24,10 @@
***************************************************************************/
PALETTE_INIT( snk6502 )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -76,7 +76,7 @@ PALETTE_INIT( snk6502 )
WRITE8_HANDLER( snk6502_videoram_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -84,7 +84,7 @@ WRITE8_HANDLER( snk6502_videoram_w )
WRITE8_HANDLER( snk6502_videoram2_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -92,7 +92,7 @@ WRITE8_HANDLER( snk6502_videoram2_w )
WRITE8_HANDLER( snk6502_colorram_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -101,19 +101,19 @@ WRITE8_HANDLER( snk6502_colorram_w )
WRITE8_HANDLER( snk6502_charram_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
if (state->charram[offset] != data)
{
state->charram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], (offset/8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset/8) % 256);
}
}
WRITE8_HANDLER( snk6502_flipscreen_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
int bank;
/* bits 0-2 select background color */
@@ -125,7 +125,7 @@ WRITE8_HANDLER( snk6502_flipscreen_w )
state->backcolor = data & 7;
for (i = 0;i < 32;i += 4)
- palette_set_color(space->machine, COLOR(space->machine, 1, i), state->palette[4 * state->backcolor + 0x20]);
+ palette_set_color(space->machine(), COLOR(space->machine(), 1, i), state->palette[4 * state->backcolor + 0x20]);
}
/* bit 3 selects char bank */
@@ -135,28 +135,28 @@ WRITE8_HANDLER( snk6502_flipscreen_w )
if (state->charbank != bank)
{
state->charbank = bank;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 7 flips screen */
- if (flip_screen_get(space->machine) != (data & 0x80))
+ if (flip_screen_get(space->machine()) != (data & 0x80))
{
- flip_screen_set(space->machine, data & 0x80);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x80);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( snk6502_scrollx_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( snk6502_scrolly_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
@@ -164,7 +164,7 @@ WRITE8_HANDLER( snk6502_scrolly_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int code = state->videoram[tile_index] + 256 * state->charbank;
int color = (state->colorram[tile_index] & 0x38) >> 3;
@@ -173,7 +173,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int code = state->videoram2[tile_index];
int color = state->colorram[tile_index] & 0x07;
@@ -182,19 +182,19 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( snk6502 )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
}
VIDEO_START( pballoon )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
VIDEO_START_CALL( snk6502 );
@@ -205,7 +205,7 @@ VIDEO_START( pballoon )
SCREEN_UPDATE( snk6502 )
{
- snk6502_state *state = screen->machine->driver_data<snk6502_state>();
+ snk6502_state *state = screen->machine().driver_data<snk6502_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -216,10 +216,10 @@ SCREEN_UPDATE( snk6502 )
PALETTE_INIT( satansat )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -270,10 +270,10 @@ WRITE8_HANDLER( satansat_b002_w )
{
/* bit 0 flips screen */
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 1 enables interrups */
@@ -287,7 +287,7 @@ WRITE8_HANDLER( satansat_b002_w )
WRITE8_HANDLER( satansat_backcolor_w )
{
- snk6502_state *state = space->machine->driver_data<snk6502_state>();
+ snk6502_state *state = space->machine().driver_data<snk6502_state>();
/* bits 0-1 select background color. Other bits unused. */
@@ -298,13 +298,13 @@ WRITE8_HANDLER( satansat_backcolor_w )
state->backcolor = data & 0x03;
for (i = 0; i < 16; i += 4)
- palette_set_color(space->machine, COLOR(space->machine, 1, i), state->palette[state->backcolor + 0x10]);
+ palette_set_color(space->machine(), COLOR(space->machine(), 1, i), state->palette[state->backcolor + 0x10]);
}
}
static TILE_GET_INFO( satansat_get_bg_tile_info )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int code = state->videoram[tile_index];
int color = (state->colorram[tile_index] & 0x0c) >> 2;
@@ -313,7 +313,7 @@ static TILE_GET_INFO( satansat_get_bg_tile_info )
static TILE_GET_INFO( satansat_get_fg_tile_info )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
int code = state->videoram2[tile_index];
int color = state->colorram[tile_index] & 0x03;
@@ -322,12 +322,12 @@ static TILE_GET_INFO( satansat_get_fg_tile_info )
VIDEO_START( satansat )
{
- snk6502_state *state = machine->driver_data<snk6502_state>();
+ snk6502_state *state = machine.driver_data<snk6502_state>();
state->bg_tilemap = tilemap_create(machine, satansat_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, satansat_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
}
diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c
index f931c923c10..140021deaa7 100644
--- a/src/mame/video/snk68.c
+++ b/src/mame/video/snk68.c
@@ -24,7 +24,7 @@ Notes:
static TILE_GET_INFO( get_pow_tile_info )
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
int tile = state->fg_tile_offset + (state->pow_fg_videoram[2*tile_index] & 0xff);
int color = state->pow_fg_videoram[2*tile_index+1] & 0x07;
@@ -33,7 +33,7 @@ static TILE_GET_INFO( get_pow_tile_info )
static TILE_GET_INFO( get_searchar_tile_info )
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
int data = state->pow_fg_videoram[2*tile_index];
int tile = data & 0x7ff;
int color = (data & 0x7000) >> 12;
@@ -50,19 +50,19 @@ static TILE_GET_INFO( get_searchar_tile_info )
***************************************************************************/
-static void common_video_start(running_machine *machine)
+static void common_video_start(running_machine &machine)
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- tilemap_set_scrolldx(state->fg_tilemap, 0, machine->primary_screen->width() - 256);
- tilemap_set_scrolldy(state->fg_tilemap, 0, machine->primary_screen->height() - 256);
+ tilemap_set_scrolldx(state->fg_tilemap, 0, machine.primary_screen->width() - 256);
+ tilemap_set_scrolldy(state->fg_tilemap, 0, machine.primary_screen->height() - 256);
}
VIDEO_START( pow )
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
state->fg_tilemap = tilemap_create(machine, get_pow_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
state->fg_tile_offset = 0;
@@ -72,7 +72,7 @@ VIDEO_START( pow )
VIDEO_START( searchar )
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
state->fg_tilemap = tilemap_create(machine, get_searchar_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -87,7 +87,7 @@ VIDEO_START( searchar )
READ16_HANDLER( pow_spriteram_r )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
// streetsj expects the MSB of every 32-bit word to be FF. Presumably RAM
// exists only for 3 bytes out of 4 and the fourth is unmapped.
@@ -99,7 +99,7 @@ READ16_HANDLER( pow_spriteram_r )
WRITE16_HANDLER( pow_spriteram_w )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
UINT16 *spriteram16 = state->spriteram;
UINT16 newword = spriteram16[offset];
@@ -110,10 +110,10 @@ WRITE16_HANDLER( pow_spriteram_w )
if (spriteram16[offset] != newword)
{
- int vpos = space->machine->primary_screen->vpos();
+ int vpos = space->machine().primary_screen->vpos();
if (vpos > 0)
- space->machine->primary_screen->update_partial(vpos - 1);
+ space->machine().primary_screen->update_partial(vpos - 1);
spriteram16[offset] = newword;
}
@@ -121,7 +121,7 @@ WRITE16_HANDLER( pow_spriteram_w )
READ16_HANDLER( pow_fg_videoram_r )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
// RAM is only 8-bit
return state->pow_fg_videoram[offset] | 0xff00;
@@ -129,7 +129,7 @@ READ16_HANDLER( pow_fg_videoram_r )
WRITE16_HANDLER( pow_fg_videoram_w )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
data |= 0xff00;
COMBINE_DATA(&state->pow_fg_videoram[offset]);
@@ -138,7 +138,7 @@ WRITE16_HANDLER( pow_fg_videoram_w )
WRITE16_HANDLER( searchar_fg_videoram_w )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
// RAM is full 16-bit, though only half of it is used by the hardware
COMBINE_DATA(&state->pow_fg_videoram[offset]);
@@ -149,9 +149,9 @@ WRITE16_HANDLER( pow_flipscreen16_w )
{
if (ACCESSING_BITS_0_7)
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
state->flipscreen = data & 0x08;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
state->sprite_flip_axis = data & 0x04; // for streetsm? though might not be present on this board
@@ -167,10 +167,10 @@ WRITE16_HANDLER( searchar_flipscreen16_w )
{
if (ACCESSING_BITS_0_7)
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
state->flipscreen = data & 0x08;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
state->sprite_flip_axis = data & 0x04;
}
@@ -178,7 +178,7 @@ WRITE16_HANDLER( searchar_flipscreen16_w )
WRITE16_HANDLER( pow_paletteram16_word_w )
{
- snk68_state *state = space->machine->driver_data<snk68_state>();
+ snk68_state *state = space->machine().driver_data<snk68_state>();
UINT16 newword;
int r,g,b;
@@ -189,7 +189,7 @@ WRITE16_HANDLER( pow_paletteram16_word_w )
g = ((newword >> 3) & 0x1e) | ((newword >> 13) & 0x01) ;
b = ((newword << 1) & 0x1e) | ((newword >> 12) & 0x01) ;
- palette_set_color_rgb(space->machine,offset,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offset,pal5bit(r),pal5bit(g),pal5bit(b));
}
@@ -199,9 +199,9 @@ WRITE16_HANDLER( pow_paletteram16_word_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int group)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int group)
{
- snk68_state *state = machine->driver_data<snk68_state>();
+ snk68_state *state = machine.driver_data<snk68_state>();
UINT16 *spriteram16 = state->spriteram;
int flipscreen = state->flipscreen;
int sprite_flip_axis = state->sprite_flip_axis;
@@ -210,7 +210,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
// pow has 0x4000 tiles and independent x/y flipping
// the other games have > 0x4000 tiles and flipping in only one direction
// (globally selected)
- int const is_pow = (machine->gfx[1]->total_elements <= 0x4000);
+ int const is_pow = (machine.gfx[1]->total_elements <= 0x4000);
int offs;
for (offs = 0; offs < 0x800; offs += 0x40)
@@ -268,7 +268,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
fy = !fy;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
tile,
color,
fx, fy,
@@ -290,14 +290,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( pow )
{
- snk68_state *state = screen->machine->driver_data<snk68_state>();
+ snk68_state *state = screen->machine().driver_data<snk68_state>();
bitmap_fill(bitmap, cliprect, 0x7ff);
/* This appears to be the correct priority order */
- draw_sprites(screen->machine, bitmap, cliprect, 2);
- draw_sprites(screen->machine, bitmap, cliprect, 3);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 3);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/snookr10.c b/src/mame/video/snookr10.c
index 1d193612324..025c193eee4 100644
--- a/src/mame/video/snookr10.c
+++ b/src/mame/video/snookr10.c
@@ -44,14 +44,14 @@
WRITE8_HANDLER( snookr10_videoram_w )
{
- snookr10_state *state = space->machine->driver_data<snookr10_state>();
+ snookr10_state *state = space->machine().driver_data<snookr10_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( snookr10_colorram_w )
{
- snookr10_state *state = space->machine->driver_data<snookr10_state>();
+ snookr10_state *state = space->machine().driver_data<snookr10_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -72,7 +72,7 @@ PALETTE_INIT( snookr10 )
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -97,7 +97,7 @@ PALETTE_INIT( snookr10 )
static TILE_GET_INFO( get_bg_tile_info )
{
- snookr10_state *state = machine->driver_data<snookr10_state>();
+ snookr10_state *state = machine.driver_data<snookr10_state>();
/* - bits -
7654 3210
xxxx ---- tiles color.
@@ -132,7 +132,7 @@ PALETTE_INIT( apple10 )
2, resistances_g, weights_g, 100, 0);
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -160,7 +160,7 @@ PALETTE_INIT( apple10 )
static TILE_GET_INFO( apple10_get_bg_tile_info )
{
- snookr10_state *state = machine->driver_data<snookr10_state>();
+ snookr10_state *state = machine.driver_data<snookr10_state>();
/* - bits -
7654 3210
xxxx ---- tiles color.
@@ -177,19 +177,19 @@ static TILE_GET_INFO( apple10_get_bg_tile_info )
VIDEO_START( snookr10 )
{
- snookr10_state *state = machine->driver_data<snookr10_state>();
+ snookr10_state *state = machine.driver_data<snookr10_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 30);
}
VIDEO_START( apple10 )
{
- snookr10_state *state = machine->driver_data<snookr10_state>();
+ snookr10_state *state = machine.driver_data<snookr10_state>();
state->bg_tilemap = tilemap_create(machine, apple10_get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 30);
}
SCREEN_UPDATE( snookr10 )
{
- snookr10_state *state = screen->machine->driver_data<snookr10_state>();
+ snookr10_state *state = screen->machine().driver_data<snookr10_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/solomon.c b/src/mame/video/solomon.c
index ce72c0036f9..f27aa90e6f1 100644
--- a/src/mame/video/solomon.c
+++ b/src/mame/video/solomon.c
@@ -3,7 +3,7 @@
WRITE8_HANDLER( solomon_videoram_w )
{
- solomon_state *state = space->machine->driver_data<solomon_state>();
+ solomon_state *state = space->machine().driver_data<solomon_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -11,7 +11,7 @@ WRITE8_HANDLER( solomon_videoram_w )
WRITE8_HANDLER( solomon_colorram_w )
{
- solomon_state *state = space->machine->driver_data<solomon_state>();
+ solomon_state *state = space->machine().driver_data<solomon_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -19,7 +19,7 @@ WRITE8_HANDLER( solomon_colorram_w )
WRITE8_HANDLER( solomon_videoram2_w )
{
- solomon_state *state = space->machine->driver_data<solomon_state>();
+ solomon_state *state = space->machine().driver_data<solomon_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -27,7 +27,7 @@ WRITE8_HANDLER( solomon_videoram2_w )
WRITE8_HANDLER( solomon_colorram2_w )
{
- solomon_state *state = space->machine->driver_data<solomon_state>();
+ solomon_state *state = space->machine().driver_data<solomon_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -35,16 +35,16 @@ WRITE8_HANDLER( solomon_colorram2_w )
WRITE8_HANDLER( solomon_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- solomon_state *state = machine->driver_data<solomon_state>();
+ solomon_state *state = machine.driver_data<solomon_state>();
int attr = state->colorram2[tile_index];
int code = state->videoram2[tile_index] + 256 * (attr & 0x07);
int color = ((attr & 0x70) >> 4);
@@ -55,7 +55,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- solomon_state *state = machine->driver_data<solomon_state>();
+ solomon_state *state = machine.driver_data<solomon_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 256 * (attr & 0x07);
int color = (attr & 0x70) >> 4;
@@ -65,7 +65,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( solomon )
{
- solomon_state *state = machine->driver_data<solomon_state>();
+ solomon_state *state = machine.driver_data<solomon_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -76,9 +76,9 @@ VIDEO_START( solomon )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- solomon_state *state = machine->driver_data<solomon_state>();
+ solomon_state *state = machine.driver_data<solomon_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -100,7 +100,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -109,9 +109,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( solomon )
{
- solomon_state *state = screen->machine->driver_data<solomon_state>();
+ solomon_state *state = screen->machine().driver_data<solomon_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c
index 82ef42679f5..69fa7c71ebe 100644
--- a/src/mame/video/sonson.c
+++ b/src/mame/video/sonson.c
@@ -44,7 +44,7 @@ PALETTE_INIT( sonson )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -73,7 +73,7 @@ PALETTE_INIT( sonson )
bit3 = (color_prom[i + 0x00] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -83,34 +83,34 @@ PALETTE_INIT( sonson )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 0x10-0x1f */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( sonson_videoram_w )
{
- sonson_state *state = space->machine->driver_data<sonson_state>();
+ sonson_state *state = space->machine().driver_data<sonson_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( sonson_colorram_w )
{
- sonson_state *state = space->machine->driver_data<sonson_state>();
+ sonson_state *state = space->machine().driver_data<sonson_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( sonson_scrollx_w )
{
- sonson_state *state = space->machine->driver_data<sonson_state>();
+ sonson_state *state = space->machine().driver_data<sonson_state>();
int row;
for (row = 5; row < 32; row++)
@@ -119,12 +119,12 @@ WRITE8_HANDLER( sonson_scrollx_w )
WRITE8_HANDLER( sonson_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- sonson_state *state = machine->driver_data<sonson_state>();
+ sonson_state *state = machine.driver_data<sonson_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 256 * (attr & 0x03);
int color = attr >> 2;
@@ -134,15 +134,15 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( sonson )
{
- sonson_state *state = machine->driver_data<sonson_state>();
+ sonson_state *state = machine.driver_data<sonson_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- sonson_state *state = machine->driver_data<sonson_state>();
+ sonson_state *state = machine.driver_data<sonson_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -164,21 +164,21 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
/* wrap-around */
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx - 256, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy - 256, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx - 256, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy - 256, 0);
}
}
SCREEN_UPDATE( sonson )
{
- sonson_state *state = screen->machine->driver_data<sonson_state>();
+ sonson_state *state = screen->machine().driver_data<sonson_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c
index 7ed4739e5d8..7832b8ef13e 100644
--- a/src/mame/video/spacefb.c
+++ b/src/mame/video/spacefb.c
@@ -17,16 +17,16 @@
WRITE8_HANDLER( spacefb_port_0_w )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
- space->machine->primary_screen->update_now();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
+ space->machine().primary_screen->update_now();
state->port_0 = data;
}
WRITE8_HANDLER( spacefb_port_2_w )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
- space->machine->primary_screen->update_now();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
+ space->machine().primary_screen->update_now();
state->port_2 = data;
}
@@ -69,7 +69,7 @@ WRITE8_HANDLER( spacefb_port_2_w )
VIDEO_START( spacefb )
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
int width, height;
/* compute the color gun weights */
@@ -81,8 +81,8 @@ VIDEO_START( spacefb )
2, resistances_b, state->color_weights_b, 470, 0,
0, 0, 0, 0, 0);
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->object_present_map = auto_alloc_array(machine, UINT8, width * height);
/* this start value positions the stars to match the flyer screen shot,
@@ -140,7 +140,7 @@ static void get_starfield_pens(spacefb_state *state, pen_t *pens)
static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
{
- spacefb_state *state = screen.machine->driver_data<spacefb_state>();
+ spacefb_state *state = screen.machine().driver_data<spacefb_state>();
int y;
pen_t pens[NUM_STARFIELD_PENS];
@@ -207,11 +207,11 @@ static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectan
#define NUM_SPRITE_PENS (0x40)
-static void get_sprite_pens(running_machine *machine, pen_t *pens)
+static void get_sprite_pens(running_machine &machine, pen_t *pens)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
static const double fade_weights[] = { 1.0, 1.5, 2.5, 4.0 };
- const UINT8 *prom = machine->region("proms")->base();
+ const UINT8 *prom = machine.region("proms")->base();
int i;
for (i = 0; i < NUM_SPRITE_PENS; i++)
@@ -248,12 +248,12 @@ static void get_sprite_pens(running_machine *machine, pen_t *pens)
}
-static void draw_bullet(running_machine *machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = machine->region("gfx2")->base();
+ UINT8 *gfx = machine.region("gfx2")->base();
UINT8 code = state->videoram[offs + 0x0200] & 0x3f;
UINT8 y = ~state->videoram[offs + 0x0100] - 2;
@@ -300,12 +300,12 @@ static void draw_bullet(running_machine *machine, offs_t offs, pen_t pen, bitmap
}
-static void draw_sprite(running_machine *machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle *cliprect, int flip)
+static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
UINT8 code = ~state->videoram[offs + 0x0200];
UINT8 color_base = (~state->videoram[offs + 0x0300] & 0x0f) << 2;
@@ -358,9 +358,9 @@ static void draw_sprite(running_machine *machine, offs_t offs, pen_t *pens, bitm
}
-static void draw_objects(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- spacefb_state *state = machine->driver_data<spacefb_state>();
+ spacefb_state *state = machine.driver_data<spacefb_state>();
pen_t sprite_pens[NUM_SPRITE_PENS];
offs_t offs = (state->port_0 & 0x20) ? 0x80 : 0x00;
@@ -399,7 +399,7 @@ static void draw_objects(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( spacefb )
{
- draw_objects(screen->machine, bitmap, cliprect);
+ draw_objects(screen->machine(), bitmap, cliprect);
draw_starfield(*screen, bitmap, cliprect);
return 0;
diff --git a/src/mame/video/spbactn.c b/src/mame/video/spbactn.c
index a6a72dc6a6e..71847317eef 100644
--- a/src/mame/video/spbactn.c
+++ b/src/mame/video/spbactn.c
@@ -5,12 +5,12 @@
#include "includes/spbactn.h"
-static void blendbitmaps(running_machine *machine,
+static void blendbitmaps(running_machine &machine,
bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,
const rectangle *cliprect)
{
int y,x;
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
@@ -35,7 +35,7 @@ static void blendbitmaps(running_machine *machine,
/* from gals pinball (which was in turn from ninja gaiden) */
-static int draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static int draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
static const UINT8 layout[8][8] =
{
@@ -49,7 +49,7 @@ static int draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectan
{42,43,46,47,58,59,62,63}
};
- spbactn_state *state = machine->driver_data<spbactn_state>();
+ spbactn_state *state = machine.driver_data<spbactn_state>();
int count = 0;
int offs;
@@ -89,9 +89,9 @@ static int draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectan
int x = sx + 8 * (flipx ? (size - 1 - col) : col);
int y = sy + 8 * (flipy ? (size - 1 - row) : row);
- drawgfx_transpen_raw(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen_raw(bitmap, cliprect, machine.gfx[2],
code + layout[row][col],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx, flipy,
x, y,
0);
@@ -108,11 +108,11 @@ static int draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectan
VIDEO_START( spbactn )
{
- spbactn_state *state = machine->driver_data<spbactn_state>();
+ spbactn_state *state = machine.driver_data<spbactn_state>();
/* allocate bitmaps */
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
state->tile_bitmap_fg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -120,7 +120,7 @@ VIDEO_START( spbactn )
SCREEN_UPDATE( spbactn )
{
- spbactn_state *state = screen->machine->driver_data<spbactn_state>();
+ spbactn_state *state = screen->machine().driver_data<spbactn_state>();
int offs, sx, sy;
bitmap_fill(state->tile_bitmap_fg, cliprect, 0);
@@ -135,9 +135,9 @@ SCREEN_UPDATE( spbactn )
color = ((attr & 0x00f0) >> 4) | 0x80;
- drawgfx_transpen_raw(state->tile_bitmap_bg, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen_raw(state->tile_bitmap_bg, cliprect, screen->machine().gfx[1],
code,
- screen->machine->gfx[1]->color_base + color * screen->machine->gfx[1]->color_granularity,
+ screen->machine().gfx[1]->color_base + color * screen->machine().gfx[1]->color_granularity,
0, 0,
16 * sx, 8 * sy,
(UINT32)-1);
@@ -150,7 +150,7 @@ SCREEN_UPDATE( spbactn )
}
}
- if (draw_sprites(screen->machine, state->tile_bitmap_bg, cliprect, 0))
+ if (draw_sprites(screen->machine(), state->tile_bitmap_bg, cliprect, 0))
{
/* kludge: draw table bg gfx again if priority 0 sprites are enabled */
for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
@@ -162,9 +162,9 @@ SCREEN_UPDATE( spbactn )
color = ((attr & 0x00f0) >> 4) | 0x80;
- drawgfx_transpen_raw(state->tile_bitmap_bg, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen_raw(state->tile_bitmap_bg, cliprect, screen->machine().gfx[1],
code,
- screen->machine->gfx[1]->color_base + color * screen->machine->gfx[1]->color_granularity,
+ screen->machine().gfx[1]->color_base + color * screen->machine().gfx[1]->color_granularity,
0, 0,
16 * sx, 8 * sy,
0);
@@ -178,7 +178,7 @@ SCREEN_UPDATE( spbactn )
}
}
- draw_sprites(screen->machine, state->tile_bitmap_bg, cliprect, 1);
+ draw_sprites(screen->machine(), state->tile_bitmap_bg, cliprect, 1);
/* draw table fg gfx */
for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
@@ -196,9 +196,9 @@ SCREEN_UPDATE( spbactn )
else
color |= 0x0080;
- drawgfx_transpen_raw(state->tile_bitmap_fg, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen_raw(state->tile_bitmap_fg, cliprect, screen->machine().gfx[0],
code,
- screen->machine->gfx[0]->color_base + color * screen->machine->gfx[0]->color_granularity,
+ screen->machine().gfx[0]->color_base + color * screen->machine().gfx[0]->color_granularity,
0, 0,
16 * sx, 8 * sy,
0);
@@ -211,10 +211,10 @@ SCREEN_UPDATE( spbactn )
}
}
- draw_sprites(screen->machine, state->tile_bitmap_fg, cliprect, 2);
- draw_sprites(screen->machine, state->tile_bitmap_fg, cliprect, 3);
+ draw_sprites(screen->machine(), state->tile_bitmap_fg, cliprect, 2);
+ draw_sprites(screen->machine(), state->tile_bitmap_fg, cliprect, 3);
/* mix & blend the tilemaps and sprites into a 32-bit bitmap */
- blendbitmaps(screen->machine, bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, cliprect);
+ blendbitmaps(screen->machine(), bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, cliprect);
return 0;
}
diff --git a/src/mame/video/spcforce.c b/src/mame/video/spcforce.c
index 54d219db47c..e0a3f88b29c 100644
--- a/src/mame/video/spcforce.c
+++ b/src/mame/video/spcforce.c
@@ -12,15 +12,15 @@
WRITE8_HANDLER( spcforce_flip_screen_w )
{
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
}
SCREEN_UPDATE( spcforce )
{
- spcforce_state *state = screen->machine->driver_data<spcforce_state>();
+ spcforce_state *state = screen->machine().driver_data<spcforce_state>();
int offs;
- int flip = flip_screen_get(screen->machine);
+ int flip = flip_screen_get(screen->machine());
/* draw the characters as sprites because they could be overlapping */
bitmap_fill(bitmap,cliprect,0);
@@ -40,7 +40,7 @@ SCREEN_UPDATE( spcforce )
sy = 248 - sy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code, col,
flip, flip,
sx, sy,0);
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 44955f986fe..3ca0dce7b46 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -9,7 +9,7 @@ PALETTE_INIT( spdodgeb )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -27,10 +27,10 @@ PALETTE_INIT( spdodgeb )
bit3 = (color_prom[0] >> 7) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -53,7 +53,7 @@ static TILEMAP_MAPPER( background_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
UINT8 code = state->videoram[tile_index];
UINT8 attr = state->videoram[tile_index + 0x800];
SET_TILE_INFO(
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( spdodgeb )
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,background_scan,8,8,64,32);
}
@@ -92,31 +92,31 @@ INTERRUPT_GEN( spdodgeb_interrupt )
if (iloop > 1 && iloop < 32)
{
device_set_input_line(device, M6502_IRQ_LINE, HOLD_LINE);
- device->machine->primary_screen->update_partial(scanline+7);
+ device->machine().primary_screen->update_partial(scanline+7);
}
else if (!iloop)
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
- device->machine->primary_screen->update_partial(256);
+ device->machine().primary_screen->update_partial(256);
}
}
WRITE8_HANDLER( spdodgeb_scrollx_lo_w )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
state->lastscroll = (state->lastscroll & 0x100) | data;
}
WRITE8_HANDLER( spdodgeb_ctrl_w )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
/* bit 0 = flip screen */
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
/* bit 1 = ROM bank switch */
- memory_set_bankptr(space->machine, "bank1",rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1));
+ memory_set_bankptr(space->machine(), "bank1",rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1));
/* bit 2 = scroll high bit */
state->lastscroll = (state->lastscroll & 0x0ff) | ((data & 0x04) << 6);
@@ -134,7 +134,7 @@ WRITE8_HANDLER( spdodgeb_ctrl_w )
WRITE8_HANDLER( spdodgeb_videoram_w )
{
- spdodgeb_state *state = space->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = space->machine().driver_data<spdodgeb_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
}
@@ -151,11 +151,11 @@ WRITE8_HANDLER( spdodgeb_videoram_w )
cliprect,gfx, \
(which+order),color+ 8 * state->sprite_palbank,flipx,flipy,sx,sy,0);
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- spdodgeb_state *state = machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *src;
int i;
@@ -211,9 +211,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( spdodgeb )
{
- spdodgeb_state *state = screen->machine->driver_data<spdodgeb_state>();
+ spdodgeb_state *state = screen->machine().driver_data<spdodgeb_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->lastscroll+5);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/speedatk.c b/src/mame/video/speedatk.c
index 793a824058c..3c941998bf2 100644
--- a/src/mame/video/speedatk.c
+++ b/src/mame/video/speedatk.c
@@ -13,7 +13,7 @@ PALETTE_INIT( speedatk )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -39,7 +39,7 @@ PALETTE_INIT( speedatk )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -48,20 +48,20 @@ PALETTE_INIT( speedatk )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( speedatk_videoram_w )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
state->videoram[offset] = data;
}
WRITE8_HANDLER( speedatk_colorram_w )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
state->colorram[offset] = data;
}
@@ -73,23 +73,23 @@ VIDEO_START( speedatk )
WRITE8_HANDLER( speedatk_6845_w )
{
- speedatk_state *state = space->machine->driver_data<speedatk_state>();
+ speedatk_state *state = space->machine().driver_data<speedatk_state>();
if(offset == 0)
{
state->crtc_index = data;
- mc6845_address_w(space->machine->device("crtc"),0,data);
+ mc6845_address_w(space->machine().device("crtc"),0,data);
}
else
{
state->crtc_vreg[state->crtc_index] = data;
- mc6845_register_w(space->machine->device("crtc"),0,data);
+ mc6845_register_w(space->machine().device("crtc"),0,data);
}
}
SCREEN_UPDATE( speedatk )
{
- speedatk_state *state = screen->machine->driver_data<speedatk_state>();
+ speedatk_state *state = screen->machine().driver_data<speedatk_state>();
int x,y;
int count;
UINT16 tile;
@@ -109,7 +109,7 @@ SCREEN_UPDATE( speedatk )
color = state->colorram[count] & 0x1f;
region = (state->colorram[count] & 0x10) >> 4;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[region],tile,color,state->flip_scr,state->flip_scr,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[region],tile,color,state->flip_scr,state->flip_scr,x*8,y*8);
count = (state->flip_scr) ? count-1 : count+1;
count&=0x3ff;
diff --git a/src/mame/video/speedbal.c b/src/mame/video/speedbal.c
index f3d212a501b..e4b91967d12 100644
--- a/src/mame/video/speedbal.c
+++ b/src/mame/video/speedbal.c
@@ -12,7 +12,7 @@
static TILE_GET_INFO( get_tile_info_bg )
{
- speedbal_state *state = machine->driver_data<speedbal_state>();
+ speedbal_state *state = machine.driver_data<speedbal_state>();
int code = state->background_videoram[tile_index*2] + ((state->background_videoram[tile_index*2+1] & 0x30) << 4);
int color = state->background_videoram[tile_index*2+1] & 0x0f;
@@ -22,7 +22,7 @@ static TILE_GET_INFO( get_tile_info_bg )
static TILE_GET_INFO( get_tile_info_fg )
{
- speedbal_state *state = machine->driver_data<speedbal_state>();
+ speedbal_state *state = machine.driver_data<speedbal_state>();
int code = state->foreground_videoram[tile_index*2] + ((state->foreground_videoram[tile_index*2+1] & 0x30) << 4);
int color = state->foreground_videoram[tile_index*2+1] & 0x0f;
@@ -38,7 +38,7 @@ static TILE_GET_INFO( get_tile_info_fg )
VIDEO_START( speedbal )
{
- speedbal_state *state = machine->driver_data<speedbal_state>();
+ speedbal_state *state = machine.driver_data<speedbal_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, tilemap_scan_cols_flip_x, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_tile_info_fg, tilemap_scan_cols_flip_x, 8, 8, 32, 32);
@@ -59,7 +59,7 @@ VIDEO_START( speedbal )
WRITE8_HANDLER( speedbal_foreground_videoram_w )
{
- speedbal_state *state = space->machine->driver_data<speedbal_state>();
+ speedbal_state *state = space->machine().driver_data<speedbal_state>();
state->foreground_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset>>1);
}
@@ -72,7 +72,7 @@ WRITE8_HANDLER( speedbal_foreground_videoram_w )
WRITE8_HANDLER( speedbal_background_videoram_w )
{
- speedbal_state *state = space->machine->driver_data<speedbal_state>();
+ speedbal_state *state = space->machine().driver_data<speedbal_state>();
state->background_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset>>1);
}
@@ -84,9 +84,9 @@ WRITE8_HANDLER( speedbal_background_videoram_w )
* *
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- speedbal_state *state = machine->driver_data<speedbal_state>();
+ speedbal_state *state = machine.driver_data<speedbal_state>();
UINT8 *spriteram = state->spriteram;
int x,y,code,color,offset,flipx,flipy;
@@ -113,7 +113,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = flipy = 1;
}
- drawgfx_transpen (bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen (bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
@@ -129,10 +129,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( speedbal )
{
- speedbal_state *state = screen->machine->driver_data<speedbal_state>();
+ speedbal_state *state = screen->machine().driver_data<speedbal_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
diff --git a/src/mame/video/speedspn.c b/src/mame/video/speedspn.c
index ad644645fbd..15d61f45921 100644
--- a/src/mame/video/speedspn.c
+++ b/src/mame/video/speedspn.c
@@ -6,7 +6,7 @@
static TILE_GET_INFO( get_speedspn_tile_info )
{
- speedspn_state *state = machine->driver_data<speedspn_state>();
+ speedspn_state *state = machine.driver_data<speedspn_state>();
int code = state->vidram[tile_index*2+1] | (state->vidram[tile_index*2] << 8);
int attr = state->attram[tile_index^0x400];
@@ -15,14 +15,14 @@ static TILE_GET_INFO( get_speedspn_tile_info )
VIDEO_START(speedspn)
{
- speedspn_state *state = machine->driver_data<speedspn_state>();
+ speedspn_state *state = machine.driver_data<speedspn_state>();
state->vidram = auto_alloc_array(machine, UINT8, 0x1000 * 2);
state->tilemap = tilemap_create(machine, get_speedspn_tile_info,tilemap_scan_cols, 8, 8,64,32);
}
WRITE8_HANDLER( speedspn_vidram_w )
{
- speedspn_state *state = space->machine->driver_data<speedspn_state>();
+ speedspn_state *state = space->machine().driver_data<speedspn_state>();
state->vidram[offset + state->bank_vidram] = data;
if (state->bank_vidram == 0)
@@ -31,7 +31,7 @@ WRITE8_HANDLER( speedspn_vidram_w )
WRITE8_HANDLER( speedspn_attram_w )
{
- speedspn_state *state = space->machine->driver_data<speedspn_state>();
+ speedspn_state *state = space->machine().driver_data<speedspn_state>();
state->attram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset^0x400);
@@ -39,13 +39,13 @@ WRITE8_HANDLER( speedspn_attram_w )
READ8_HANDLER( speedspn_vidram_r )
{
- speedspn_state *state = space->machine->driver_data<speedspn_state>();
+ speedspn_state *state = space->machine().driver_data<speedspn_state>();
return state->vidram[offset + state->bank_vidram];
}
WRITE8_HANDLER(speedspn_banked_vidram_change)
{
- speedspn_state *state = space->machine->driver_data<speedspn_state>();
+ speedspn_state *state = space->machine().driver_data<speedspn_state>();
// logerror("VidRam Bank: %04x\n", data);
state->bank_vidram = data & 1;
state->bank_vidram *= 0x1000;
@@ -53,16 +53,16 @@ WRITE8_HANDLER(speedspn_banked_vidram_change)
WRITE8_HANDLER(speedspn_global_display_w)
{
- speedspn_state *state = space->machine->driver_data<speedspn_state>();
+ speedspn_state *state = space->machine().driver_data<speedspn_state>();
// logerror("Global display: %u\n", data);
state->display_disable = data & 1;
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- speedspn_state *state = machine->driver_data<speedspn_state>();
- const gfx_element *gfx = machine->gfx[1];
+ speedspn_state *state = machine.driver_data<speedspn_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *source = state->vidram+ 0x1000;
UINT8 *finish = source + 0x1000;
@@ -93,10 +93,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE(speedspn)
{
- speedspn_state *state = screen->machine->driver_data<speedspn_state>();
+ speedspn_state *state = screen->machine().driver_data<speedspn_state>();
if (state->display_disable)
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
@@ -110,6 +110,6 @@ SCREEN_UPDATE(speedspn)
#endif
tilemap_set_scrollx(state->tilemap,0, 0x100); // verify
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/splash.c b/src/mame/video/splash.c
index bbc7126fad1..c506e849393 100644
--- a/src/mame/video/splash.c
+++ b/src/mame/video/splash.c
@@ -40,7 +40,7 @@
static TILE_GET_INFO( get_tile_info_splash_tilemap0 )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
int data = state->videoram[tile_index];
int attr = data >> 8;
int code = data & 0xff;
@@ -54,7 +54,7 @@ static TILE_GET_INFO( get_tile_info_splash_tilemap0 )
static TILE_GET_INFO( get_tile_info_splash_tilemap1 )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
int data = state->videoram[(0x1000/2) + tile_index];
int attr = data >> 8;
int code = data & 0xff;
@@ -74,15 +74,15 @@ static TILE_GET_INFO( get_tile_info_splash_tilemap1 )
WRITE16_HANDLER( splash_vram_w )
{
- splash_state *state = space->machine->driver_data<splash_state>();
+ splash_state *state = space->machine().driver_data<splash_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 1);
}
-static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
int sx,sy,color,count,colxor,bitswap;
colxor = 0; /* splash and some bitmap modes in roldfrog */
bitswap = 0;
@@ -170,7 +170,7 @@ static void draw_bitmap(running_machine *machine, bitmap_t *bitmap, const rectan
VIDEO_START( splash )
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
state->bg_tilemap[0] = tilemap_create(machine, get_tile_info_splash_tilemap0, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap[1] = tilemap_create(machine, get_tile_info_splash_tilemap1, tilemap_scan_rows, 16, 16, 32, 32);
@@ -210,11 +210,11 @@ VIDEO_START( splash )
400| xxxxxxxx -------- | unused
*/
-static void splash_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
int i;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
for (i = 0; i < 0x400; i += 4){
int sx = state->spriteram[i+2] & 0xff;
@@ -231,11 +231,11 @@ static void splash_draw_sprites(running_machine *machine, bitmap_t *bitmap,const
}
}
-static void funystrp_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- splash_state *state = machine->driver_data<splash_state>();
+ splash_state *state = machine.driver_data<splash_state>();
int i;
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
for (i = 0; i < 0x400; i += 4){
int sx = state->spriteram[i+2] & 0xff;
@@ -260,33 +260,33 @@ static void funystrp_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( splash )
{
- splash_state *state = screen->machine->driver_data<splash_state>();
+ splash_state *state = screen->machine().driver_data<splash_state>();
/* set scroll registers */
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->vregs[0]);
tilemap_set_scrolly(state->bg_tilemap[1], 0, state->vregs[1]);
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[1], 0, 0);
- splash_draw_sprites(screen->machine, bitmap, cliprect);
+ splash_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[0], 0, 0);
return 0;
}
SCREEN_UPDATE( funystrp )
{
- splash_state *state = screen->machine->driver_data<splash_state>();
+ splash_state *state = screen->machine().driver_data<splash_state>();
/* set scroll registers */
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->vregs[0]);
tilemap_set_scrolly(state->bg_tilemap[1], 0, state->vregs[1]);
- draw_bitmap(screen->machine, bitmap, cliprect);
+ draw_bitmap(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[1], 0, 0);
/*Sprite chip is similar but not the same*/
- funystrp_draw_sprites(screen->machine, bitmap, cliprect);
+ funystrp_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap[0], 0, 0);
return 0;
}
diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c
index 70390b547b3..eba1038e907 100644
--- a/src/mame/video/sprcros2.c
+++ b/src/mame/video/sprcros2.c
@@ -12,7 +12,7 @@ PALETTE_INIT( sprcros2 )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -38,7 +38,7 @@ PALETTE_INIT( sprcros2 )
b = 0x47 * bit0 + 0xb8 * bit1;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -48,20 +48,20 @@ PALETTE_INIT( sprcros2 )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | ((color_prom[i + 0x100] & 0x0f) << 4);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites & fg */
for (i = 0x100; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i + 0x100];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( sprcros2_fgvideoram_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fgtilemap, offset&0x3ff);
@@ -69,7 +69,7 @@ WRITE8_HANDLER( sprcros2_fgvideoram_w )
WRITE8_HANDLER( sprcros2_bgvideoram_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bgtilemap, offset&0x3ff);
@@ -77,7 +77,7 @@ WRITE8_HANDLER( sprcros2_bgvideoram_w )
WRITE8_HANDLER( sprcros2_bgscrollx_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
if(state->m_port7&0x02)
tilemap_set_scrollx(state->bgtilemap, 0, 0x100-data);
@@ -87,14 +87,14 @@ WRITE8_HANDLER( sprcros2_bgscrollx_w )
WRITE8_HANDLER( sprcros2_bgscrolly_w )
{
- sprcros2_state *state = space->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = space->machine().driver_data<sprcros2_state>();
tilemap_set_scrolly(state->bgtilemap, 0, data);
}
static TILE_GET_INFO( get_sprcros2_bgtile_info )
{
- sprcros2_state *state = machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = machine.driver_data<sprcros2_state>();
UINT32 tile_number = state->bgvideoram[tile_index];
UINT8 attr = state->bgvideoram[tile_index + 0x400];
@@ -115,7 +115,7 @@ static TILE_GET_INFO( get_sprcros2_bgtile_info )
static TILE_GET_INFO( get_sprcros2_fgtile_info )
{
- sprcros2_state *state = machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = machine.driver_data<sprcros2_state>();
UINT32 tile_number = state->fgvideoram[tile_index];
UINT8 attr = state->fgvideoram[tile_index + 0x400];
int color = (attr&0xfc)>>2;
@@ -138,17 +138,17 @@ static TILE_GET_INFO( get_sprcros2_fgtile_info )
VIDEO_START( sprcros2 )
{
- sprcros2_state *state = machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = machine.driver_data<sprcros2_state>();
state->bgtilemap = tilemap_create(machine, get_sprcros2_bgtile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fgtilemap = tilemap_create(machine, get_sprcros2_fgtile_info, tilemap_scan_rows, 8, 8, 32, 32);
- colortable_configure_tilemap_groups(machine->colortable, state->fgtilemap, machine->gfx[2], 0);
+ colortable_configure_tilemap_groups(machine.colortable, state->fgtilemap, machine.gfx[2], 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- sprcros2_state *state = machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = machine.driver_data<sprcros2_state>();
int offs,sx,sy,color,flipx,flipy;
for (offs = state->spriteram_size-4; offs >= 0; offs -= 4)
@@ -184,22 +184,22 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipy = !flipy;
}
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
state->spriteram[offs],
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
}
SCREEN_UPDATE( sprcros2 )
{
- sprcros2_state *state = screen->machine->driver_data<sprcros2_state>();
+ sprcros2_state *state = screen->machine().driver_data<sprcros2_state>();
tilemap_draw(bitmap, cliprect, state->bgtilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fgtilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/sprint2.c b/src/mame/video/sprint2.c
index fedbc05527d..a6538330a1f 100644
--- a/src/mame/video/sprint2.c
+++ b/src/mame/video/sprint2.c
@@ -11,32 +11,32 @@
PALETTE_INIT( sprint2 )
{
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 4);
-
- colortable_palette_set_color(machine->colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine->colortable, 1, MAKE_RGB(0x5b, 0x5b, 0x5b));
- colortable_palette_set_color(machine->colortable, 2, MAKE_RGB(0xa4, 0xa4, 0xa4));
- colortable_palette_set_color(machine->colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
-
- colortable_entry_set_value(machine->colortable, 0x0, 1); /* black playfield */
- colortable_entry_set_value(machine->colortable, 0x1, 0);
- colortable_entry_set_value(machine->colortable, 0x2, 1); /* white playfield */
- colortable_entry_set_value(machine->colortable, 0x3, 3);
-
- colortable_entry_set_value(machine->colortable, 0x4, 1); /* car #1 */
- colortable_entry_set_value(machine->colortable, 0x5, 3);
- colortable_entry_set_value(machine->colortable, 0x6, 1); /* car #2 */
- colortable_entry_set_value(machine->colortable, 0x7, 0);
- colortable_entry_set_value(machine->colortable, 0x8, 1); /* car #3 */
- colortable_entry_set_value(machine->colortable, 0x9, 2);
- colortable_entry_set_value(machine->colortable, 0xa, 1); /* car #4 */
- colortable_entry_set_value(machine->colortable, 0xb, 2);
+ machine.colortable = colortable_alloc(machine, 4);
+
+ colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0x5b, 0x5b, 0x5b));
+ colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0xa4, 0xa4, 0xa4));
+ colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
+
+ colortable_entry_set_value(machine.colortable, 0x0, 1); /* black playfield */
+ colortable_entry_set_value(machine.colortable, 0x1, 0);
+ colortable_entry_set_value(machine.colortable, 0x2, 1); /* white playfield */
+ colortable_entry_set_value(machine.colortable, 0x3, 3);
+
+ colortable_entry_set_value(machine.colortable, 0x4, 1); /* car #1 */
+ colortable_entry_set_value(machine.colortable, 0x5, 3);
+ colortable_entry_set_value(machine.colortable, 0x6, 1); /* car #2 */
+ colortable_entry_set_value(machine.colortable, 0x7, 0);
+ colortable_entry_set_value(machine.colortable, 0x8, 1); /* car #3 */
+ colortable_entry_set_value(machine.colortable, 0x9, 2);
+ colortable_entry_set_value(machine.colortable, 0xa, 1); /* car #4 */
+ colortable_entry_set_value(machine.colortable, 0xb, 2);
}
static TILE_GET_INFO( get_tile_info )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, code & 0x3f, code >> 7, 0);
@@ -45,8 +45,8 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( sprint2 )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
}
@@ -54,31 +54,31 @@ VIDEO_START( sprint2 )
READ8_HANDLER( sprint2_collision1_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
return state->collision[0];
}
READ8_HANDLER( sprint2_collision2_r )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
return state->collision[1];
}
WRITE8_HANDLER( sprint2_collision_reset1_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->collision[0] = 0;
}
WRITE8_HANDLER( sprint2_collision_reset2_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->collision[1] = 0;
}
WRITE8_HANDLER( sprint2_video_ram_w )
{
- sprint2_state *state = space->machine->driver_data<sprint2_state>();
+ sprint2_state *state = space->machine().driver_data<sprint2_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -123,7 +123,7 @@ INLINE int get_sprite_y(UINT8 *video_ram, int n)
SCREEN_UPDATE( sprint2 )
{
- sprint2_state *state = screen->machine->driver_data<sprint2_state>();
+ sprint2_state *state = screen->machine().driver_data<sprint2_state>();
UINT8 *video_ram = state->video_ram;
int i;
@@ -133,7 +133,7 @@ SCREEN_UPDATE( sprint2 )
for (i = 0; i < 4; i++)
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
get_sprite_code(video_ram, i),
i,
0, 0,
@@ -146,11 +146,11 @@ SCREEN_UPDATE( sprint2 )
SCREEN_EOF( sprint2 )
{
- sprint2_state *state = machine->driver_data<sprint2_state>();
+ sprint2_state *state = machine.driver_data<sprint2_state>();
UINT8 *video_ram = state->video_ram;
int i;
int j;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/*
* Collisions are detected for both player cars:
@@ -166,8 +166,8 @@ SCREEN_EOF( sprint2 )
rect.min_x = get_sprite_x(video_ram, i);
rect.min_y = get_sprite_y(video_ram, i);
- rect.max_x = get_sprite_x(video_ram, i) + machine->gfx[1]->width - 1;
- rect.max_y = get_sprite_y(video_ram, i) + machine->gfx[1]->height - 1;
+ rect.max_x = get_sprite_x(video_ram, i) + machine.gfx[1]->width - 1;
+ rect.max_y = get_sprite_y(video_ram, i) + machine.gfx[1]->height - 1;
if (rect.min_x < visarea.min_x)
rect.min_x = visarea.min_x;
@@ -182,21 +182,21 @@ SCREEN_EOF( sprint2 )
tilemap_draw(state->helper, &rect, state->bg_tilemap, 0, 0);
- drawgfx_transpen(state->helper, &rect, machine->gfx[1],
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1],
get_sprite_code(video_ram, i),
0,
0, 0,
get_sprite_x(video_ram, i),
get_sprite_y(video_ram, i), 1);
- state->collision[i] |= collision_check(state, machine->colortable, &rect);
+ state->collision[i] |= collision_check(state, machine.colortable, &rect);
/* check for sprite-sprite collisions */
for (j = 0; j < 4; j++)
if (j != i)
{
- drawgfx_transpen(state->helper, &rect, machine->gfx[1],
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1],
get_sprite_code(video_ram, j),
1,
0, 0,
@@ -204,13 +204,13 @@ SCREEN_EOF( sprint2 )
get_sprite_y(video_ram, j), 0);
}
- drawgfx_transpen(state->helper, &rect, machine->gfx[1],
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1],
get_sprite_code(video_ram, i),
0,
0, 0,
get_sprite_x(video_ram, i),
get_sprite_y(video_ram, i), 1);
- state->collision[i] |= collision_check(state, machine->colortable, &rect);
+ state->collision[i] |= collision_check(state, machine.colortable, &rect);
}
}
diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c
index a0c9898c0e9..1d69a95f55a 100644
--- a/src/mame/video/sprint4.c
+++ b/src/mame/video/sprint4.c
@@ -12,32 +12,32 @@ Atari Sprint 4 video emulation
PALETTE_INIT( sprint4 )
{
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 6);
-
- colortable_palette_set_color(machine->colortable, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
- colortable_palette_set_color(machine->colortable, 1, MAKE_RGB(0xfc, 0xdf, 0x80)); /* peach */
- colortable_palette_set_color(machine->colortable, 2, MAKE_RGB(0xf0, 0x00, 0xf0)); /* violet */
- colortable_palette_set_color(machine->colortable, 3, MAKE_RGB(0x00, 0xf0, 0x0f)); /* green */
- colortable_palette_set_color(machine->colortable, 4, MAKE_RGB(0x30, 0x4f, 0xff)); /* blue */
- colortable_palette_set_color(machine->colortable, 5, MAKE_RGB(0xff, 0xff, 0xff)); /* white */
-
- colortable_entry_set_value(machine->colortable, 0, 0);
- colortable_entry_set_value(machine->colortable, 2, 0);
- colortable_entry_set_value(machine->colortable, 4, 0);
- colortable_entry_set_value(machine->colortable, 6, 0);
- colortable_entry_set_value(machine->colortable, 8, 0);
-
- colortable_entry_set_value(machine->colortable, 1, 1);
- colortable_entry_set_value(machine->colortable, 3, 2);
- colortable_entry_set_value(machine->colortable, 5, 3);
- colortable_entry_set_value(machine->colortable, 7, 4);
- colortable_entry_set_value(machine->colortable, 9, 5);
+ machine.colortable = colortable_alloc(machine, 6);
+
+ colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00)); /* black */
+ colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xfc, 0xdf, 0x80)); /* peach */
+ colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0xf0, 0x00, 0xf0)); /* violet */
+ colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0x00, 0xf0, 0x0f)); /* green */
+ colortable_palette_set_color(machine.colortable, 4, MAKE_RGB(0x30, 0x4f, 0xff)); /* blue */
+ colortable_palette_set_color(machine.colortable, 5, MAKE_RGB(0xff, 0xff, 0xff)); /* white */
+
+ colortable_entry_set_value(machine.colortable, 0, 0);
+ colortable_entry_set_value(machine.colortable, 2, 0);
+ colortable_entry_set_value(machine.colortable, 4, 0);
+ colortable_entry_set_value(machine.colortable, 6, 0);
+ colortable_entry_set_value(machine.colortable, 8, 0);
+
+ colortable_entry_set_value(machine.colortable, 1, 1);
+ colortable_entry_set_value(machine.colortable, 3, 2);
+ colortable_entry_set_value(machine.colortable, 5, 3);
+ colortable_entry_set_value(machine.colortable, 7, 4);
+ colortable_entry_set_value(machine.colortable, 9, 5);
}
static TILE_GET_INFO( sprint4_tile_info )
{
- sprint4_state *state = machine->driver_data<sprint4_state>();
+ sprint4_state *state = machine.driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
UINT8 code = videoram[tile_index];
@@ -50,8 +50,8 @@ static TILE_GET_INFO( sprint4_tile_info )
VIDEO_START( sprint4 )
{
- sprint4_state *state = machine->driver_data<sprint4_state>();
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ sprint4_state *state = machine.driver_data<sprint4_state>();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
state->playfield = tilemap_create(machine, sprint4_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -59,7 +59,7 @@ VIDEO_START( sprint4 )
SCREEN_UPDATE( sprint4 )
{
- sprint4_state *state = screen->machine->driver_data<sprint4_state>();
+ sprint4_state *state = screen->machine().driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
int i;
@@ -77,7 +77,7 @@ SCREEN_UPDATE( sprint4 )
if (i & 1)
bank = 32;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
(code >> 3) | bank,
(attr & 0x80) ? 4 : i,
0, 0,
@@ -90,13 +90,13 @@ SCREEN_UPDATE( sprint4 )
SCREEN_EOF( sprint4 )
{
- sprint4_state *state = machine->driver_data<sprint4_state>();
+ sprint4_state *state = machine.driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
int i;
/* check for sprite-playfield collisions */
- device_t *discrete = machine->device("discrete");
+ device_t *discrete = machine.device("discrete");
for (i = 0; i < 4; i++)
{
@@ -113,17 +113,17 @@ SCREEN_EOF( sprint4 )
rect.min_x = horz - 15;
rect.min_y = vert - 15;
- rect.max_x = horz - 15 + machine->gfx[1]->width - 1;
- rect.max_y = vert - 15 + machine->gfx[1]->height - 1;
+ rect.max_x = horz - 15 + machine.gfx[1]->width - 1;
+ rect.max_y = vert - 15 + machine.gfx[1]->height - 1;
- sect_rect(&rect, &machine->primary_screen->visible_area());
+ sect_rect(&rect, &machine.primary_screen->visible_area());
tilemap_draw(state->helper, &rect, state->playfield, 0, 0);
if (i & 1)
bank = 32;
- drawgfx_transpen(state->helper, &rect, machine->gfx[1],
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1],
(code >> 3) | bank,
4,
0, 0,
@@ -132,7 +132,7 @@ SCREEN_EOF( sprint4 )
for (y = rect.min_y; y <= rect.max_y; y++)
for (x = rect.min_x; x <= rect.max_x; x++)
- if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper, y, x)) != 0)
+ if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->helper, y, x)) != 0)
state->collision[i] = 1;
}
@@ -147,7 +147,7 @@ SCREEN_EOF( sprint4 )
WRITE8_HANDLER( sprint4_video_ram_w )
{
- sprint4_state *state = space->machine->driver_data<sprint4_state>();
+ sprint4_state *state = space->machine().driver_data<sprint4_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->playfield, offset);
diff --git a/src/mame/video/sprint8.c b/src/mame/video/sprint8.c
index 2886f94e8ed..fd8ba526822 100644
--- a/src/mame/video/sprint8.c
+++ b/src/mame/video/sprint8.c
@@ -13,18 +13,18 @@ PALETTE_INIT( sprint8 )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x12);
+ machine.colortable = colortable_alloc(machine, 0x12);
for (i = 0; i < 0x10; i++)
{
- colortable_entry_set_value(machine->colortable, 2 * i + 0, 0x10);
- colortable_entry_set_value(machine->colortable, 2 * i + 1, i);
+ colortable_entry_set_value(machine.colortable, 2 * i + 0, 0x10);
+ colortable_entry_set_value(machine.colortable, 2 * i + 1, i);
}
- colortable_entry_set_value(machine->colortable, 0x20, 0x10);
- colortable_entry_set_value(machine->colortable, 0x21, 0x10);
- colortable_entry_set_value(machine->colortable, 0x22, 0x10);
- colortable_entry_set_value(machine->colortable, 0x23, 0x11);
+ colortable_entry_set_value(machine.colortable, 0x20, 0x10);
+ colortable_entry_set_value(machine.colortable, 0x21, 0x10);
+ colortable_entry_set_value(machine.colortable, 0x22, 0x10);
+ colortable_entry_set_value(machine.colortable, 0x23, 0x11);
}
@@ -65,7 +65,7 @@ static void set_pens(sprint8_state *state, colortable_t *colortable)
static TILE_GET_INFO( get_tile_info1 )
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
UINT8 code = state->video_ram[tile_index];
int color = 0;
@@ -91,7 +91,7 @@ static TILE_GET_INFO( get_tile_info1 )
static TILE_GET_INFO( get_tile_info2 )
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
UINT8 code = state->video_ram[tile_index];
int color = 0;
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_tile_info2 )
WRITE8_HANDLER( sprint8_video_ram_w )
{
- sprint8_state *state = space->machine->driver_data<sprint8_state>();
+ sprint8_state *state = space->machine().driver_data<sprint8_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap1, offset);
tilemap_mark_tile_dirty(state->tilemap2, offset);
@@ -116,9 +116,9 @@ WRITE8_HANDLER( sprint8_video_ram_w )
VIDEO_START( sprint8 )
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
- state->helper1 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
+ state->helper1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
state->tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 16, 8, 32, 32);
state->tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 16, 8, 32, 32);
@@ -128,9 +128,9 @@ VIDEO_START( sprint8 )
}
-static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle *cliprect)
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
int i;
for (i = 0; i < 16; i++)
@@ -143,7 +143,7 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
if (code & 0x80)
x |= 0x100;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code ^ 7,
i,
!(code & 0x10), !(code & 0x08),
@@ -160,20 +160,20 @@ static TIMER_CALLBACK( sprint8_collision_callback )
SCREEN_UPDATE( sprint8 )
{
- sprint8_state *state = screen->machine->driver_data<sprint8_state>();
- set_pens(state, screen->machine->colortable);
+ sprint8_state *state = screen->machine().driver_data<sprint8_state>();
+ set_pens(state, screen->machine().colortable);
tilemap_draw(bitmap, cliprect, state->tilemap1, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_EOF( sprint8 )
{
- sprint8_state *state = machine->driver_data<sprint8_state>();
+ sprint8_state *state = machine.driver_data<sprint8_state>();
int x;
int y;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
tilemap_draw(state->helper2, &visarea, state->tilemap2, 0, 0);
@@ -188,8 +188,8 @@ SCREEN_EOF( sprint8 )
for (x = visarea.min_x; x <= visarea.max_x; x++)
if (p1[x] != 0x20 && p2[x] == 0x23)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(y + 24, x),
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(y + 24, x),
FUNC(sprint8_collision_callback),
- colortable_entry_get_value(machine->colortable, p1[x]));
+ colortable_entry_get_value(machine.colortable, p1[x]));
}
}
diff --git a/src/mame/video/spy.c b/src/mame/video/spy.c
index fae44b625d7..235cdddaf19 100644
--- a/src/mame/video/spy.c
+++ b/src/mame/video/spy.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void spy_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void spy_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- spy_state *state = machine->driver_data<spy_state>();
+ spy_state *state = machine.driver_data<spy_state>();
*flags = (*color & 0x20) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
@@ -24,9 +24,9 @@ void spy_tile_callback( running_machine *machine, int layer, int bank, int *code
***************************************************************************/
-void spy_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask, int *shadow )
+void spy_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask, int *shadow )
{
- spy_state *state = machine->driver_data<spy_state>();
+ spy_state *state = machine.driver_data<spy_state>();
/* bit 4 = priority over layer A (0 = have priority) */
/* bit 5 = priority over layer B (1 = have priority) */
@@ -46,7 +46,7 @@ void spy_sprite_callback( running_machine *machine, int *code, int *color, int *
VIDEO_START( spy )
{
- spy_state *state = machine->driver_data<spy_state>();
+ spy_state *state = machine.driver_data<spy_state>();
state->layer_colorbase[0] = 48;
state->layer_colorbase[1] = 0;
@@ -64,11 +64,11 @@ VIDEO_START( spy )
SCREEN_UPDATE( spy )
{
- spy_state *state = screen->machine->driver_data<spy_state>();
+ spy_state *state = screen->machine().driver_data<spy_state>();
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if (!state->video_enable)
bitmap_fill(bitmap, cliprect, 16 * state->layer_colorbase[0]);
diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c
index c65702d02cf..128ec5abc27 100644
--- a/src/mame/video/srmp2.c
+++ b/src/mame/video/srmp2.c
@@ -14,11 +14,11 @@ PALETTE_INIT( srmp2 )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int col;
- col = (color_prom[i] << 8) + color_prom[i + machine->total_colors()];
+ col = (color_prom[i] << 8) + color_prom[i + machine.total_colors()];
palette_set_color_rgb(machine,i ^ 0x0f,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
}
}
@@ -28,17 +28,17 @@ PALETTE_INIT( srmp3 )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int col;
- col = (color_prom[i] << 8) + color_prom[i + machine->total_colors()];
+ col = (color_prom[i] << 8) + color_prom[i + machine.total_colors()];
palette_set_color_rgb(machine,i,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0));
}
}
-static void srmp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void srmp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Sprite RAM A: spriteram16_2
@@ -61,7 +61,7 @@ static void srmp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
---- ---- -x-- ---- : Flip screen
*/
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
UINT16 *spriteram16 = state->spriteram1.u16;
UINT16 *spriteram16_2 = state->spriteram2.u16;
int offs;
@@ -75,7 +75,7 @@ static void srmp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
/* Sprites Banking and/or Sprites Buffering */
UINT16 *src = spriteram16_2 + ( ((ctrl2 ^ (~ctrl2<<1)) & 0x40) ? 0x2000/2 : 0 );
- int max_y = machine->primary_screen->height();
+ int max_y = machine.primary_screen->height();
xoffs = flip ? 0x10 : 0x10;
yoffs = flip ? 0x05 : 0x07;
@@ -103,7 +103,7 @@ static void srmp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
if (state->color_bank) color |= 0x20;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
code,
color,
flipx, flipy,
@@ -113,9 +113,9 @@ static void srmp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
}
-static void srmp3_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void srmp3_draw_sprites_map(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
UINT8 *spriteram = state->spriteram1.u8;
UINT8 *spriteram_2 = state->spriteram2.u8;
UINT8 *spriteram_3 = state->spriteram3.u8;
@@ -158,7 +158,7 @@ static void srmp3_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, c
int sx = x + xoffs + (offs & 1) * 16;
int sy = -(y + yoffs) + (offs / 2) * 16 -
- (machine->primary_screen->height() - (machine->primary_screen->visible_area().max_y + 1));
+ (machine.primary_screen->height() - (machine.primary_screen->visible_area().max_y + 1));
if (upper & (1 << col)) sx += 256;
@@ -173,7 +173,7 @@ static void srmp3_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, c
#define DRAWTILE(_x_, _y_) \
drawgfx_transpen(bitmap, \
- cliprect, machine->gfx[0], \
+ cliprect, machine.gfx[0], \
code, \
color, \
flipx, flipy, \
@@ -190,7 +190,7 @@ static void srmp3_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, c
}
-static void srmp3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void srmp3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Sprite RAM A: spriteram_2
@@ -225,14 +225,14 @@ static void srmp3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
-x-- ---- : Flip screen
*/
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
UINT8 *spriteram = state->spriteram1.u8;
UINT8 *spriteram_2 = state->spriteram2.u8;
UINT8 *spriteram_3 = state->spriteram3.u8;
int offs;
int xoffs, yoffs;
- int max_y = machine->primary_screen->height();
+ int max_y = machine.primary_screen->height();
int ctrl = spriteram[ 0x600/2 ];
//int ctrl2 = spriteram[ 0x602/2 ];
@@ -267,7 +267,7 @@ static void srmp3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[0],
code,
color,
flipx, flipy,
@@ -277,15 +277,15 @@ static void srmp3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
}
-static void mjyuugi_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void mjyuugi_draw_sprites_map(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
UINT16 *spriteram16 = state->spriteram1.u16;
UINT16 *spriteram16_2 = state->spriteram2.u16;
int offs, col;
int xoffs, yoffs;
- int total_color_codes = machine->config().m_gfxdecodeinfo[0].total_color_codes;
+ int total_color_codes = machine.config().m_gfxdecodeinfo[0].total_color_codes;
int ctrl = spriteram16[ 0x600/2 ];
int ctrl2 = spriteram16[ 0x602/2 ];
@@ -327,7 +327,7 @@ static void mjyuugi_draw_sprites_map(running_machine *machine, bitmap_t *bitmap,
int sx = x + xoffs + (offs & 1) * 16;
int sy = -(y + yoffs) + (offs / 2) * 16 -
- (machine->primary_screen->height() - (machine->primary_screen->visible_area().max_y + 1));
+ (machine.primary_screen->height() - (machine.primary_screen->visible_area().max_y + 1));
if (upper & (1 << col)) sx += 256;
@@ -343,7 +343,7 @@ static void mjyuugi_draw_sprites_map(running_machine *machine, bitmap_t *bitmap,
#define DRAWTILE(_x_, _y_) \
drawgfx_transpen(bitmap, \
- cliprect, machine->gfx[0], \
+ cliprect, machine.gfx[0], \
code, \
color, \
flipx, flipy, \
@@ -360,7 +360,7 @@ static void mjyuugi_draw_sprites_map(running_machine *machine, bitmap_t *bitmap,
}
-static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void mjyuugi_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Sprite RAM A: spriteram16_2
@@ -384,7 +384,7 @@ static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
---- ---- -x-- ---- : Flip screen
*/
- srmp2_state *state = machine->driver_data<srmp2_state>();
+ srmp2_state *state = machine.driver_data<srmp2_state>();
UINT16 *spriteram16 = state->spriteram1.u16;
UINT16 *spriteram16_2 = state->spriteram2.u16;
int offs;
@@ -398,7 +398,7 @@ static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
/* Sprites Banking and/or Sprites Buffering */
UINT16 *src = spriteram16_2 + ( ((ctrl2 ^ (~ctrl2<<1)) & 0x40) ? 0x2000/2 : 0 );
- int max_y = machine->primary_screen->height();
+ int max_y = machine.primary_screen->height();
mjyuugi_draw_sprites_map(machine, bitmap, cliprect);
@@ -424,12 +424,12 @@ static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
if (flip)
{
y = max_y - y
- +(machine->primary_screen->height() - (machine->primary_screen->visible_area().max_y + 1));
+ +(machine.primary_screen->height() - (machine.primary_screen->visible_area().max_y + 1));
flipx = !flipx;
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[0],
code,
color,
flipx, flipy,
@@ -442,7 +442,7 @@ static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
SCREEN_UPDATE( srmp2 )
{
bitmap_fill(bitmap, cliprect, 0x1ff);
- srmp2_draw_sprites(screen->machine, bitmap, cliprect);
+ srmp2_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -450,7 +450,7 @@ SCREEN_UPDATE( srmp2 )
SCREEN_UPDATE( srmp3 )
{
bitmap_fill(bitmap, cliprect, 0x1f0);
- srmp3_draw_sprites(screen->machine, bitmap, cliprect);
+ srmp3_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -458,6 +458,6 @@ SCREEN_UPDATE( srmp3 )
SCREEN_UPDATE( mjyuugi )
{
bitmap_fill(bitmap, cliprect, 0x1f0);
- mjyuugi_draw_sprites(screen->machine, bitmap, cliprect);
+ mjyuugi_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c
index 5a2a542bc41..9a84c468756 100644
--- a/src/mame/video/srumbler.c
+++ b/src/mame/video/srumbler.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- srumbler_state *state = machine->driver_data<srumbler_state>();
+ srumbler_state *state = machine.driver_data<srumbler_state>();
UINT8 attr = state->foregroundram[2*tile_index];
SET_TILE_INFO(
0,
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- srumbler_state *state = machine->driver_data<srumbler_state>();
+ srumbler_state *state = machine.driver_data<srumbler_state>();
UINT8 attr = state->backgroundram[2*tile_index];
SET_TILE_INFO(
1,
@@ -49,7 +49,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( srumbler )
{
- srumbler_state *state = machine->driver_data<srumbler_state>();
+ srumbler_state *state = machine.driver_data<srumbler_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols, 16,16,64,64);
@@ -69,14 +69,14 @@ VIDEO_START( srumbler )
WRITE8_HANDLER( srumbler_foreground_w )
{
- srumbler_state *state = space->machine->driver_data<srumbler_state>();
+ srumbler_state *state = space->machine().driver_data<srumbler_state>();
state->foregroundram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset/2);
}
WRITE8_HANDLER( srumbler_background_w )
{
- srumbler_state *state = space->machine->driver_data<srumbler_state>();
+ srumbler_state *state = space->machine().driver_data<srumbler_state>();
state->backgroundram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
}
@@ -85,19 +85,19 @@ WRITE8_HANDLER( srumbler_background_w )
WRITE8_HANDLER( srumbler_4009_w )
{
/* bit 0 flips screen */
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
/* bits 4-5 used during attract mode, unknown */
/* bits 6-7 coin counters */
- coin_counter_w(space->machine, 0,data & 0x40);
- coin_counter_w(space->machine, 1,data & 0x80);
+ coin_counter_w(space->machine(), 0,data & 0x40);
+ coin_counter_w(space->machine(), 1,data & 0x80);
}
WRITE8_HANDLER( srumbler_scroll_w )
{
- srumbler_state *state = space->machine->driver_data<srumbler_state>();
+ srumbler_state *state = space->machine().driver_data<srumbler_state>();
state->scroll[offset] = data;
@@ -113,13 +113,13 @@ WRITE8_HANDLER( srumbler_scroll_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8;
+ UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
int offs;
/* Draw the sprites. */
- for (offs = machine->generic.spriteram_size-4; offs>=0;offs -= 4)
+ for (offs = machine.generic.spriteram_size-4; offs>=0;offs -= 4)
{
/* SPRITES
=====
@@ -151,7 +151,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
colour,
flip_screen_get(machine),flipy,
@@ -162,9 +162,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( srumbler )
{
- srumbler_state *state = screen->machine->driver_data<srumbler_state>();
+ srumbler_state *state = screen->machine().driver_data<srumbler_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER1,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_LAYER0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
@@ -172,7 +172,7 @@ SCREEN_UPDATE( srumbler )
SCREEN_EOF( srumbler )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space,0,0);
}
diff --git a/src/mame/video/sshangha.c b/src/mame/video/sshangha.c
index 2c66d539caa..01ed262fd1c 100644
--- a/src/mame/video/sshangha.c
+++ b/src/mame/video/sshangha.c
@@ -13,7 +13,7 @@
WRITE16_HANDLER (sshangha_video_w)
{
- sshangha_state *state = space->machine->driver_data<sshangha_state>();
+ sshangha_state *state = space->machine().driver_data<sshangha_state>();
/* 0x4: Special video mode, other bits unknown */
state->video_control=data;
// popmessage("%04x",data);
@@ -23,43 +23,43 @@ WRITE16_HANDLER (sshangha_video_w)
VIDEO_START( sshangha )
{
- machine->device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
- machine->device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen1")->alloc_sprite_bitmap(machine);
+ machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap(machine);
}
/******************************************************************************/
SCREEN_UPDATE( sshangha )
{
- sshangha_state *state = screen->machine->driver_data<sshangha_state>();
+ sshangha_state *state = screen->machine().driver_data<sshangha_state>();
- screen->machine->device<decospr_device>("spritegen1")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.spriteram.u16, 0x800, true);
+ screen->machine().device<decospr_device>("spritegen1")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.spriteram.u16, 0x800, true);
// I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode
- if (screen->machine->generic.spriteram2.u16)
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.spriteram2.u16, 0x800, true);
+ if (screen->machine().generic.spriteram2.u16)
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.spriteram2.u16, 0x800, true);
- tilemap_set_flip_all(screen->machine,flip_screen_x_get(screen->machine) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(),flip_screen_x_get(screen->machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
/* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */
if ((state->video_control&4)==0) {
deco16ic_tilemap_12_combine_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0, 1);
- screen->machine->device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
}
else {
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0200, 0x0200, 0x100, 0x1ff);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
}
- if (screen->machine->generic.spriteram2.u16)
- screen->machine->device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff);
+ if (screen->machine().generic.spriteram2.u16)
+ screen->machine().device<decospr_device>("spritegen2")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0000, 0, 0x1ff);
- screen->machine->device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine, bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff);
+ screen->machine().device<decospr_device>("spritegen1")->inefficient_copy_sprite_bitmap(screen->machine(), bitmap, cliprect, 0x0000, 0x0200, 0, 0x1ff);
return 0;
}
diff --git a/src/mame/video/sslam.c b/src/mame/video/sslam.c
index 2f95a2f22bf..a8a18ebfd39 100644
--- a/src/mame/video/sslam.c
+++ b/src/mame/video/sslam.c
@@ -8,9 +8,9 @@ WRITE16_HANDLER( sslam_paletteram_w )
{
int r, g, b, val;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- val = space->machine->generic.paletteram.u16[offset];
+ val = space->machine().generic.paletteram.u16[offset];
r = (val >> 11) & 0x1e;
g = (val >> 7) & 0x1e;
b = (val >> 3) & 0x1e;
@@ -19,13 +19,13 @@ WRITE16_HANDLER( sslam_paletteram_w )
g |= ((val & 0x04) >> 2);
b |= ((val & 0x02) >> 1);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- sslam_state *state = machine->driver_data<sslam_state>();
- const gfx_element *gfx = machine->gfx[0];
+ sslam_state *state = machine.driver_data<sslam_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x1000/2;
@@ -93,7 +93,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TILE_GET_INFO( get_sslam_tx_tile_info )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
int code = state->tx_tileram[tile_index] & 0x0fff;
int colr = state->tx_tileram[tile_index] & 0xf000;
@@ -102,7 +102,7 @@ static TILE_GET_INFO( get_sslam_tx_tile_info )
WRITE16_HANDLER( sslam_tx_tileram_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
COMBINE_DATA(&state->tx_tileram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
@@ -112,7 +112,7 @@ WRITE16_HANDLER( sslam_tx_tileram_w )
static TILE_GET_INFO( get_sslam_md_tile_info )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
int code = state->md_tileram[tile_index] & 0x0fff;
int colr = state->md_tileram[tile_index] & 0xf000;
@@ -121,7 +121,7 @@ static TILE_GET_INFO( get_sslam_md_tile_info )
WRITE16_HANDLER( sslam_md_tileram_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
COMBINE_DATA(&state->md_tileram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap,offset);
@@ -131,7 +131,7 @@ WRITE16_HANDLER( sslam_md_tileram_w )
static TILE_GET_INFO( get_sslam_bg_tile_info )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
int code = state->bg_tileram[tile_index] & 0x1fff;
int colr = state->bg_tileram[tile_index] & 0xe000;
@@ -140,7 +140,7 @@ static TILE_GET_INFO( get_sslam_bg_tile_info )
WRITE16_HANDLER( sslam_bg_tileram_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
COMBINE_DATA(&state->bg_tileram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -148,7 +148,7 @@ WRITE16_HANDLER( sslam_bg_tileram_w )
static TILE_GET_INFO( get_powerbls_bg_tile_info )
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
int code = state->bg_tileram[tile_index*2+1] & 0x0fff;
int colr = (state->bg_tileram[tile_index*2+1] & 0xf000) >> 12;
code |= (state->bg_tileram[tile_index*2] & 0x0f00) << 4;
@@ -160,7 +160,7 @@ static TILE_GET_INFO( get_powerbls_bg_tile_info )
WRITE16_HANDLER( powerbls_bg_tileram_w )
{
- sslam_state *state = space->machine->driver_data<sslam_state>();
+ sslam_state *state = space->machine().driver_data<sslam_state>();
COMBINE_DATA(&state->bg_tileram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset>>1);
@@ -168,7 +168,7 @@ WRITE16_HANDLER( powerbls_bg_tileram_w )
VIDEO_START(sslam)
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
state->bg_tilemap = tilemap_create(machine, get_sslam_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->md_tilemap = tilemap_create(machine, get_sslam_md_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -183,7 +183,7 @@ VIDEO_START(sslam)
VIDEO_START(powerbls)
{
- sslam_state *state = machine->driver_data<sslam_state>();
+ sslam_state *state = machine.driver_data<sslam_state>();
state->bg_tilemap = tilemap_create(machine, get_powerbls_bg_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -193,11 +193,11 @@ VIDEO_START(powerbls)
SCREEN_UPDATE(sslam)
{
- sslam_state *state = screen->machine->driver_data<sslam_state>();
+ sslam_state *state = screen->machine().driver_data<sslam_state>();
if (!(state->regs[6] & 1))
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
@@ -226,18 +226,18 @@ SCREEN_UPDATE(sslam)
tilemap_draw(bitmap,cliprect,state->md_tilemap,0,0);
}
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
SCREEN_UPDATE(powerbls)
{
- sslam_state *state = screen->machine->driver_data<sslam_state>();
+ sslam_state *state = screen->machine().driver_data<sslam_state>();
if (!(state->regs[6] & 1))
{
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
return 0;
}
@@ -245,6 +245,6 @@ SCREEN_UPDATE(powerbls)
tilemap_set_scrolly(state->bg_tilemap,0, state->regs[1]-240);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c
index b74468e73bd..8468067e149 100644
--- a/src/mame/video/ssozumo.c
+++ b/src/mame/video/ssozumo.c
@@ -42,7 +42,7 @@ PALETTE_INIT( ssozumo )
WRITE8_HANDLER( ssozumo_videoram_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -50,7 +50,7 @@ WRITE8_HANDLER( ssozumo_videoram_w )
WRITE8_HANDLER( ssozumo_colorram_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -58,7 +58,7 @@ WRITE8_HANDLER( ssozumo_colorram_w )
WRITE8_HANDLER( ssozumo_videoram2_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -66,7 +66,7 @@ WRITE8_HANDLER( ssozumo_videoram2_w )
WRITE8_HANDLER( ssozumo_colorram2_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -74,7 +74,7 @@ WRITE8_HANDLER( ssozumo_colorram2_w )
WRITE8_HANDLER( ssozumo_paletteram_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
int bit0, bit1, bit2, bit3, val;
int r, g, b;
int offs2;
@@ -103,24 +103,24 @@ WRITE8_HANDLER( ssozumo_paletteram_w )
bit3 = (val >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- palette_set_color(space->machine, offs2 + 64, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offs2 + 64, MAKE_RGB(r, g, b));
}
WRITE8_HANDLER( ssozumo_scroll_w )
{
- ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( ssozumo_flipscreen_w )
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- ssozumo_state *state = machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = machine.driver_data<ssozumo_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x08) << 5);
int color = (state->colorram[tile_index] & 0x30) >> 4;
int flags = ((tile_index % 32) >= 16) ? TILE_FLIPY : 0;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- ssozumo_state *state = machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = machine.driver_data<ssozumo_state>();
int code = state->videoram2[tile_index] + 256 * (state->colorram2[tile_index] & 0x07);
int color = (state->colorram2[tile_index] & 0x30) >> 4;
@@ -139,7 +139,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( ssozumo )
{
- ssozumo_state *state = machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = machine.driver_data<ssozumo_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x,
16, 16, 16, 32);
@@ -150,9 +150,9 @@ VIDEO_START( ssozumo )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- ssozumo_state *state = machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = machine.driver_data<ssozumo_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -186,10 +186,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( ssozumo )
{
- ssozumo_state *state = screen->machine->driver_data<ssozumo_state>();
+ ssozumo_state *state = screen->machine().driver_data<ssozumo_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sspeedr.c b/src/mame/video/sspeedr.c
index b2279b254a0..39325799ece 100644
--- a/src/mame/video/sspeedr.c
+++ b/src/mame/video/sspeedr.c
@@ -10,92 +10,92 @@ Taito Super Speed Race video emulation
WRITE8_HANDLER( sspeedr_driver_horz_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->driver_horz = (state->driver_horz & 0x100) | data;
}
WRITE8_HANDLER( sspeedr_driver_horz_2_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->driver_horz = (state->driver_horz & 0xff) | ((data & 1) << 8);
}
WRITE8_HANDLER( sspeedr_driver_vert_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->driver_vert = data;
}
WRITE8_HANDLER( sspeedr_driver_pic_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->driver_pic = data & 0x1f;
}
WRITE8_HANDLER( sspeedr_drones_horz_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->drones_horz = (state->drones_horz & 0x100) | data;
}
WRITE8_HANDLER( sspeedr_drones_horz_2_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->drones_horz = (state->drones_horz & 0xff) | ((data & 1) << 8);
}
WRITE8_HANDLER( sspeedr_drones_mask_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->drones_mask = data & 0x3f;
}
WRITE8_HANDLER( sspeedr_drones_vert_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->drones_vert[offset] = data;
}
WRITE8_HANDLER( sspeedr_track_horz_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->track_horz = (state->track_horz & 0x100) | data;
}
WRITE8_HANDLER( sspeedr_track_horz_2_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->track_horz = (state->track_horz & 0xff) | ((data & 1) << 8);
}
WRITE8_HANDLER( sspeedr_track_vert_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->track_vert[offset] = data & 0x7f;
}
WRITE8_HANDLER( sspeedr_track_ice_w )
{
- sspeedr_state *state = space->machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = space->machine().driver_data<sspeedr_state>();
state->track_ice = data & 0x07;
}
-static void draw_track(running_machine *machine, bitmap_t* bitmap)
+static void draw_track(running_machine &machine, bitmap_t* bitmap)
{
- sspeedr_state *state = machine->driver_data<sspeedr_state>();
- const UINT8* p = machine->region("gfx3")->base();
+ sspeedr_state *state = machine.driver_data<sspeedr_state>();
+ const UINT8* p = machine.region("gfx3")->base();
int x;
int y;
@@ -181,9 +181,9 @@ static void draw_track(running_machine *machine, bitmap_t* bitmap)
}
-static void draw_drones(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_drones(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- sspeedr_state *state = machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = machine.driver_data<sspeedr_state>();
static const UINT8 code[6] =
{
0xf, 0x4, 0x3, 0x9, 0x7, 0xc
@@ -211,7 +211,7 @@ static void draw_drones(running_machine *machine, bitmap_t* bitmap, const rectan
y = 0xf0 - state->drones_vert[i >> 1];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code[i] ^ state->toggle,
0,
0, 0,
@@ -221,9 +221,9 @@ static void draw_drones(running_machine *machine, bitmap_t* bitmap, const rectan
}
-static void draw_driver(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_driver(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- sspeedr_state *state = machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = machine.driver_data<sspeedr_state>();
int x;
int y;
@@ -242,7 +242,7 @@ static void draw_driver(running_machine *machine, bitmap_t* bitmap, const rectan
y = 0xf0 - state->driver_vert;
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[0],
+ machine.gfx[0],
state->driver_pic,
0,
0, 0,
@@ -253,22 +253,22 @@ static void draw_driver(running_machine *machine, bitmap_t* bitmap, const rectan
VIDEO_START( sspeedr )
{
- sspeedr_state *state = machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = machine.driver_data<sspeedr_state>();
state->toggle = 0;
}
SCREEN_UPDATE( sspeedr )
{
- draw_track(screen->machine, bitmap);
- draw_drones(screen->machine, bitmap, cliprect);
- draw_driver(screen->machine, bitmap, cliprect);
+ draw_track(screen->machine(), bitmap);
+ draw_drones(screen->machine(), bitmap, cliprect);
+ draw_driver(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_EOF( sspeedr )
{
- sspeedr_state *state = machine->driver_data<sspeedr_state>();
+ sspeedr_state *state = machine.driver_data<sspeedr_state>();
state->toggle ^= 1;
}
diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c
index dba538dbd53..8b2e327b35e 100644
--- a/src/mame/video/ssrj.c
+++ b/src/mame/video/ssrj.c
@@ -5,7 +5,7 @@
WRITE8_HANDLER(ssrj_vram1_w)
{
- ssrj_state *state = space->machine->driver_data<ssrj_state>();
+ ssrj_state *state = space->machine().driver_data<ssrj_state>();
state->vram1[offset] = data;
tilemap_mark_tile_dirty(state->tilemap1, offset>>1);
@@ -13,7 +13,7 @@ WRITE8_HANDLER(ssrj_vram1_w)
static TILE_GET_INFO( get_tile_info1 )
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
int code;
code = state->vram1[tile_index<<1] + (state->vram1[(tile_index<<1)+1]<<8);
SET_TILE_INFO(
@@ -27,7 +27,7 @@ static TILE_GET_INFO( get_tile_info1 )
WRITE8_HANDLER(ssrj_vram2_w)
{
- ssrj_state *state = space->machine->driver_data<ssrj_state>();
+ ssrj_state *state = space->machine().driver_data<ssrj_state>();
state->vram2[offset] = data;
tilemap_mark_tile_dirty(state->tilemap2, offset>>1);
@@ -35,7 +35,7 @@ WRITE8_HANDLER(ssrj_vram2_w)
static TILE_GET_INFO( get_tile_info2 )
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
int code;
code = state->vram2[tile_index<<1] + (state->vram2[(tile_index<<1)+1]<<8);
SET_TILE_INFO(
@@ -49,7 +49,7 @@ static TILE_GET_INFO( get_tile_info2 )
WRITE8_HANDLER(ssrj_vram4_w)
{
- ssrj_state *state = space->machine->driver_data<ssrj_state>();
+ ssrj_state *state = space->machine().driver_data<ssrj_state>();
state->vram4[offset] = data;
tilemap_mark_tile_dirty(state->tilemap4, offset>>1);
@@ -57,7 +57,7 @@ WRITE8_HANDLER(ssrj_vram4_w)
static TILE_GET_INFO( get_tile_info4 )
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
int code;
code = state->vram4[tile_index<<1] + (state->vram4[(tile_index<<1)+1]<<8);
SET_TILE_INFO(
@@ -224,7 +224,7 @@ static const UINT8 fakecols[4*4][8][3]=
VIDEO_START( ssrj )
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
state->tilemap1 = tilemap_create(machine, get_tile_info1, tilemap_scan_rows, 8, 8, 32, 32);
state->tilemap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8, 8, 32, 32);
@@ -234,9 +234,9 @@ VIDEO_START( ssrj )
}
-static void draw_objects(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- ssrj_state *state = machine->driver_data<ssrj_state>();
+ ssrj_state *state = machine.driver_data<ssrj_state>();
int i,j,k,x,y;
for(i=0;i<6;i++)
@@ -252,7 +252,7 @@ static void draw_objects(running_machine *machine, bitmap_t *bitmap, const recta
code = state->vram3[offs] + 256 * state->vram3[offs + 1];
drawgfx_transpen(bitmap,
- cliprect,machine->gfx[0],
+ cliprect,machine.gfx[0],
code&1023,
((code>>12)&0x3)+8,
code&0x8000,
@@ -275,12 +275,12 @@ PALETTE_INIT( ssrj )
SCREEN_UPDATE( ssrj )
{
- ssrj_state *state = screen->machine->driver_data<ssrj_state>();
+ ssrj_state *state = screen->machine().driver_data<ssrj_state>();
tilemap_set_scrolly(state->tilemap1, 0, 0xff-state->scrollram[2] );
tilemap_set_scrollx(state->tilemap1, 0, state->scrollram[0] );
tilemap_draw(bitmap, cliprect, state->tilemap1, 0, 0);
- draw_objects(screen->machine, bitmap, cliprect);
+ draw_objects(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->tilemap2, 0, 0);
if (state->scrollram[0x101] == 0xb) tilemap_draw(bitmap, cliprect, state->tilemap4, 0, 0);/* hack to display 4th tilemap */
diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c
index 75373440e90..43c30e51c4e 100644
--- a/src/mame/video/ssv.c
+++ b/src/mame/video/ssv.c
@@ -145,7 +145,7 @@ static void ssv_drawgfx( bitmap_t *bitmap, const rectangle *cliprect, const gfx_
UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,
int shadow )
{
- ssv_state *state = gfx->machine->driver_data<ssv_state>();
+ ssv_state *state = gfx->machine().driver_data<ssv_state>();
const UINT8 *addr, *source;
UINT8 pen;
UINT16 *dest;
@@ -194,23 +194,23 @@ static void ssv_drawgfx( bitmap_t *bitmap, const rectangle *cliprect, const gfx_
VIDEO_START( ssv )
{
- machine->gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
+ machine.gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
}
VIDEO_START( eaglshot )
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
VIDEO_START_CALL(ssv);
state->eaglshot_gfxram = auto_alloc_array(machine, UINT16, 16 * 0x40000 / 2);
- gfx_element_set_source(machine->gfx[0], (UINT8 *)state->eaglshot_gfxram);
- gfx_element_set_source(machine->gfx[1], (UINT8 *)state->eaglshot_gfxram);
+ gfx_element_set_source(machine.gfx[0], (UINT8 *)state->eaglshot_gfxram);
+ gfx_element_set_source(machine.gfx[1], (UINT8 *)state->eaglshot_gfxram);
}
static TILE_GET_INFO( get_tile_info_0 )
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
UINT16 tile = state->gdfs_tmapram[tile_index];
SET_TILE_INFO(3, tile, 0, TILE_FLIPXY( tile >> 14 ));
@@ -218,7 +218,7 @@ static TILE_GET_INFO( get_tile_info_0 )
WRITE16_HANDLER( gdfs_tmapram_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
COMBINE_DATA(&state->gdfs_tmapram[offset]);
tilemap_mark_tile_dirty(state->gdfs_tmap, offset);
@@ -226,14 +226,14 @@ WRITE16_HANDLER( gdfs_tmapram_w )
VIDEO_START( gdfs )
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
VIDEO_START_CALL(ssv);
state->eaglshot_gfxram = auto_alloc_array(machine, UINT16, 4 * 0x100000 / 2);
- machine->gfx[2]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
- gfx_element_set_source(machine->gfx[2], (UINT8 *)state->eaglshot_gfxram);
+ machine.gfx[2]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
+ gfx_element_set_source(machine.gfx[2], (UINT8 *)state->eaglshot_gfxram);
state->gdfs_tmap = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows,
16,16, 0x100,0x100 );
@@ -382,7 +382,7 @@ VIDEO_START( gdfs )
READ16_HANDLER( ssv_vblank_r )
{
- if (space->machine->primary_screen->vblank())
+ if (space->machine().primary_screen->vblank())
return 0x2000 | 0x1000;
else
return 0x0000;
@@ -390,7 +390,7 @@ READ16_HANDLER( ssv_vblank_r )
WRITE16_HANDLER( ssv_scroll_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
COMBINE_DATA(state->scroll + offset);
@@ -400,7 +400,7 @@ WRITE16_HANDLER( ssv_scroll_w )
WRITE16_HANDLER( paletteram16_xrgb_swap_word_w )
{
- ssv_state *state = space->machine->driver_data<ssv_state>();
+ ssv_state *state = space->machine().driver_data<ssv_state>();
int r, g, b;
UINT16 data0, data1;
@@ -415,7 +415,7 @@ WRITE16_HANDLER( paletteram16_xrgb_swap_word_w )
g = data1 >> 8;
b = data1 & 0xff;
- palette_set_color(space->machine, offset>>1, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset>>1, MAKE_RGB(r, g, b));
}
/***************************************************************************
@@ -606,9 +606,9 @@ From the above some noteworthy cases are:
/* Draw a tilemap sprite */
-static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int sy, int scroll)
+static void draw_row(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int sy, int scroll)
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
UINT16 *spriteram16 = state->spriteram;
UINT16 *ssv_scroll = state->scroll;
rectangle clip;
@@ -725,7 +725,7 @@ static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle
{
for (ty = ystart; ty != yend; ty += yinc)
{
- ssv_drawgfx( bitmap, &clip, machine->gfx[gfx],
+ ssv_drawgfx( bitmap, &clip, machine.gfx[gfx],
code++,
color,
flipx, flipy,
@@ -741,19 +741,19 @@ static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle
/* Draw the "background layer" using multiple tilemap sprites */
-static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int nr)
+static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int nr)
{
int sy;
- for ( sy = 0; sy <= machine->primary_screen->visible_area().max_y; sy += 0x40 )
+ for ( sy = 0; sy <= machine.primary_screen->visible_area().max_y; sy += 0x40 )
draw_row(machine, bitmap, cliprect, 0, sy, nr);
}
/* Draw sprites in the sprites list */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* Sprites list */
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
UINT16 *ssv_scroll = state->scroll;
UINT16 *spriteram16 = state->spriteram;
@@ -951,7 +951,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for (y = ystart; y != yend; y += yinc)
{
- ssv_drawgfx( bitmap, cliprect, machine->gfx[gfx],
+ ssv_drawgfx( bitmap, cliprect, machine.gfx[gfx],
code++,
color,
flipx, flipy,
@@ -964,7 +964,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */
{ char buf[30];
sprintf(buf, "%02X",/*(s2[2] & ~0x3ff)>>8*/mode>>8);
- ui_draw_text(&machine->render().ui_container(), buf, sx, sy);
+ ui_draw_text(&machine.render().ui_container(), buf, sx, sy);
}
#endif
@@ -1042,11 +1042,11 @@ SCREEN_UPDATE( eaglshot )
E.h Unused
*/
-static void gdfs_draw_zooming_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
/* Sprites list */
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
UINT16 *spriteram16_2 = state->spriteram2;
UINT16 *s1 = spriteram16_2;
UINT16 *end1 = spriteram16_2 + 0x02000/2;
@@ -1142,7 +1142,7 @@ static void gdfs_draw_zooming_sprites(running_machine *machine, bitmap_t *bitmap
{
for (y = ystart; y != yend; y += yinc)
{
- drawgfxzoom_transpen( bitmap, cliprect, machine->gfx[2],
+ drawgfxzoom_transpen( bitmap, cliprect, machine.gfx[2],
code++,
color,
flipx, flipy,
@@ -1157,7 +1157,7 @@ static void gdfs_draw_zooming_sprites(running_machine *machine, bitmap_t *bitmap
{
char buf[10];
sprintf(buf, "%X",size);
- ui_draw_text(&machine->render().ui_container(), buf, sx / 0x10000, sy / 0x10000);
+ ui_draw_text(&machine.render().ui_container(), buf, sx / 0x10000, sy / 0x10000);
}
#endif
} /* single-sprites */
@@ -1167,13 +1167,13 @@ static void gdfs_draw_zooming_sprites(running_machine *machine, bitmap_t *bitmap
SCREEN_UPDATE( gdfs )
{
- ssv_state *state = screen->machine->driver_data<ssv_state>();
+ ssv_state *state = screen->machine().driver_data<ssv_state>();
int pri;
SCREEN_UPDATE_CALL(ssv);
for (pri = 0; pri <= 0xf; pri++)
- gdfs_draw_zooming_sprites(screen->machine, bitmap, cliprect, pri);
+ gdfs_draw_zooming_sprites(screen->machine(), bitmap, cliprect, pri);
tilemap_set_scrollx(state->gdfs_tmap, 0, state->gdfs_tmapscroll[0x0c/2]);
tilemap_set_scrolly(state->gdfs_tmap, 0, state->gdfs_tmapscroll[0x10/2]);
@@ -1182,9 +1182,9 @@ SCREEN_UPDATE( gdfs )
return 0;
}
-void ssv_enable_video(running_machine *machine, int enable)
+void ssv_enable_video(running_machine &machine, int enable)
{
- ssv_state *state = machine->driver_data<ssv_state>();
+ ssv_state *state = machine.driver_data<ssv_state>();
state->enable_video = enable;
}
@@ -1193,7 +1193,7 @@ SCREEN_UPDATE( ssv )
{
rectangle clip = { 0, 0, 0, 0 };
- ssv_state *state = screen->machine->driver_data<ssv_state>();
+ ssv_state *state = screen->machine().driver_data<ssv_state>();
// Shadow
if (state->scroll[0x76/2] & 0x0080)
@@ -1232,9 +1232,9 @@ SCREEN_UPDATE( ssv )
if (!state->enable_video)
return 0;
- draw_layer(screen->machine, bitmap, &clip, 0); // "background layer"
+ draw_layer(screen->machine(), bitmap, &clip, 0); // "background layer"
- draw_sprites(screen->machine, bitmap, &clip); // sprites list
+ draw_sprites(screen->machine(), bitmap, &clip); // sprites list
return 0;
diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c
index a5a66d3ac80..2957001cc1f 100644
--- a/src/mame/video/st0016.c
+++ b/src/mame/video/st0016.c
@@ -100,8 +100,8 @@ WRITE8_HANDLER (st0016_palette_ram_w)
st0016_paletteram[ST0016_PAL_BANK_SIZE*st0016_pal_bank+offset]=data;
val=st0016_paletteram[color*2]+(st0016_paletteram[color*2+1]<<8);
if(!color)
- palette_set_color_rgb(space->machine,UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */
- palette_set_color_rgb(space->machine,color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10));
+ palette_set_color_rgb(space->machine(),UNUSED_PEN,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10)); /* same as color 0 - bg ? */
+ palette_set_color_rgb(space->machine(),color,pal5bit(val >> 0),pal5bit(val >> 5),pal5bit(val >> 10));
}
READ8_HANDLER(st0016_character_ram_r)
@@ -112,7 +112,7 @@ READ8_HANDLER(st0016_character_ram_r)
WRITE8_HANDLER(st0016_character_ram_w)
{
st0016_charram[ST0016_CHAR_BANK_SIZE*st0016_char_bank+offset]=data;
- gfx_element_mark_dirty(space->machine->gfx[st0016_ramgfx], st0016_char_bank);
+ gfx_element_mark_dirty(space->machine().gfx[st0016_ramgfx], st0016_char_bank);
}
READ8_HANDLER(st0016_vregs_r)
@@ -139,7 +139,7 @@ READ8_HANDLER(st0016_vregs_r)
{
case 0:
case 1:
- return space->machine->rand();
+ return space->machine().rand();
}
return st0016_vregs[offset];
@@ -186,8 +186,8 @@ WRITE8_HANDLER(st0016_vregs_w)
UINT32 srcadr=(st0016_vregs[0xa0]|(st0016_vregs[0xa1]<<8)|(st0016_vregs[0xa2]<<16))<<1;
UINT32 dstadr=(st0016_vregs[0xa3]|(st0016_vregs[0xa4]<<8)|(st0016_vregs[0xa5]<<16))<<1;
UINT32 length=((st0016_vregs[0xa6]|(st0016_vregs[0xa7]<<8)|((st0016_vregs[0xa8]&0x1f)<<16))+1)<<1;
- UINT32 srclen = (space->machine->region("maincpu")->bytes()-0x10000);
- UINT8 *mem = space->machine->region("maincpu")->base();
+ UINT32 srclen = (space->machine().region("maincpu")->bytes()-0x10000);
+ UINT8 *mem = space->machine().region("maincpu")->base();
srcadr += macs_cart_slot*0x400000;
@@ -212,7 +212,7 @@ WRITE8_HANDLER(st0016_vregs_w)
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
object ram :
@@ -257,7 +257,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
*/
- gfx_element *gfx = machine->gfx[st0016_ramgfx];
+ gfx_element *gfx = machine.gfx[st0016_ramgfx];
int i,j,lx,ly,x,y,code,offset,length,sx,sy,color,flipx,flipy,scrollx,scrolly/*,plx,ply*/;
@@ -419,7 +419,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void st0016_save_init(running_machine *machine)
+static void st0016_save_init(running_machine &machine)
{
state_save_register_global(machine, st0016_spr_bank);
state_save_register_global(machine, st0016_spr2_bank);
@@ -444,13 +444,13 @@ VIDEO_START( st0016 )
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, (UINT8 *) st0016_charram, 0x40, 0);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &charlayout, (UINT8 *) st0016_charram, 0x40, 0);
st0016_ramgfx = gfx_index;
spr_dx=0;
@@ -459,27 +459,27 @@ VIDEO_START( st0016 )
switch(st0016_game&0x3f)
{
case 0: //renju kizoku
- machine->primary_screen->set_visible_area(0, 40*8-1, 0, 30*8-1);
+ machine.primary_screen->set_visible_area(0, 40*8-1, 0, 30*8-1);
spr_dx=0;
spr_dy=0;
break;
case 1: //neratte chu!
- machine->primary_screen->set_visible_area(8,41*8-1,0,30*8-1);
+ machine.primary_screen->set_visible_area(8,41*8-1,0,30*8-1);
spr_dx=0;
spr_dy=8;
break;
case 4: //mayjinsen 1&2
- machine->primary_screen->set_visible_area(0,32*8-1,0,28*8-1);
+ machine.primary_screen->set_visible_area(0,32*8-1,0,28*8-1);
break;
case 10:
- machine->primary_screen->set_visible_area(0,383,0,255);
+ machine.primary_screen->set_visible_area(0,383,0,255);
break;
case 11:
- machine->primary_screen->set_visible_area(0,383,0,383);
+ machine.primary_screen->set_visible_area(0,383,0,383);
break;
}
@@ -488,9 +488,9 @@ VIDEO_START( st0016 )
}
-static void draw_bgmap(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int priority)
+static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int priority)
{
- gfx_element *gfx = machine->gfx[st0016_ramgfx];
+ gfx_element *gfx = machine.gfx[st0016_ramgfx];
int j;
//for(j=0x40-8;j>=0;j-=8)
for(j=0;j<0x40;j+=8)
@@ -586,16 +586,16 @@ static void draw_bgmap(running_machine *machine, bitmap_t *bitmap,const rectangl
void st0016_draw_screen(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect)
{
- draw_bgmap(screen->machine, bitmap,cliprect,0);
- draw_sprites(screen->machine, bitmap,cliprect);
- draw_bgmap(screen->machine, bitmap,cliprect,1);
+ draw_bgmap(screen->machine(), bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect);
+ draw_bgmap(screen->machine(), bitmap,cliprect,1);
}
SCREEN_UPDATE( st0016 )
{
#ifdef MAME_DEBUG
- if(input_code_pressed_once(screen->machine, KEYCODE_Z))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Z))
{
int h,j;
FILE *p=fopen("vram.bin","wb");
diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c
index dc281816e36..6f3fe6ea624 100644
--- a/src/mame/video/stactics.c
+++ b/src/mame/video/stactics.c
@@ -91,7 +91,7 @@ static PALETTE_INIT( stactics )
WRITE8_HANDLER( stactics_scroll_ram_w )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
if (data & 0x01)
{
@@ -114,7 +114,7 @@ WRITE8_HANDLER( stactics_scroll_ram_w )
CUSTOM_INPUT( stactics_get_frame_count_d3 )
{
- stactics_state *state = field->port->machine->driver_data<stactics_state>();
+ stactics_state *state = field->port->machine().driver_data<stactics_state>();
return (state->frame_count >> 3) & 0x01;
}
@@ -129,7 +129,7 @@ CUSTOM_INPUT( stactics_get_frame_count_d3 )
WRITE8_HANDLER( stactics_speed_latch_w )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
/* This writes to a shift register which is clocked by */
/* a 555 oscillator. This value determines the speed of */
@@ -156,7 +156,7 @@ WRITE8_HANDLER( stactics_speed_latch_w )
WRITE8_HANDLER( stactics_shot_trigger_w )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
state->shot_standby = 0;
}
@@ -164,7 +164,7 @@ WRITE8_HANDLER( stactics_shot_trigger_w )
WRITE8_HANDLER( stactics_shot_flag_clear_w )
{
- stactics_state *state = space->machine->driver_data<stactics_state>();
+ stactics_state *state = space->machine().driver_data<stactics_state>();
state->shot_arrive = 0;
}
@@ -172,7 +172,7 @@ WRITE8_HANDLER( stactics_shot_flag_clear_w )
CUSTOM_INPUT( stactics_get_shot_standby )
{
- stactics_state *state = field->port->machine->driver_data<stactics_state>();
+ stactics_state *state = field->port->machine().driver_data<stactics_state>();
return state->shot_standby;
}
@@ -180,7 +180,7 @@ CUSTOM_INPUT( stactics_get_shot_standby )
CUSTOM_INPUT( stactics_get_not_shot_arrive )
{
- stactics_state *state = field->port->machine->driver_data<stactics_state>();
+ stactics_state *state = field->port->machine().driver_data<stactics_state>();
return !state->shot_arrive;
}
@@ -309,10 +309,10 @@ static void set_indicator_leds(int data, const char *output_name, int base_index
}
-static void update_artwork(running_machine *machine, stactics_state *state)
+static void update_artwork(running_machine &machine, stactics_state *state)
{
int i;
- UINT8 *beam_region = machine->region("user1")->base();
+ UINT8 *beam_region = machine.region("user1")->base();
/* set the lamps first */
output_set_indexed_value("base_lamp", 4, state->lamps[0] & 0x01);
@@ -367,7 +367,7 @@ static void update_artwork(running_machine *machine, stactics_state *state)
static VIDEO_START( stactics )
{
- stactics_state *state = machine->driver_data<stactics_state>();
+ stactics_state *state = machine.driver_data<stactics_state>();
state->y_scroll_d = 0;
state->y_scroll_e = 0;
@@ -390,11 +390,11 @@ static VIDEO_START( stactics )
static SCREEN_UPDATE( stactics )
{
- stactics_state *state = screen->machine->driver_data<stactics_state>();
+ stactics_state *state = screen->machine().driver_data<stactics_state>();
update_beam(state);
draw_background(state, bitmap, cliprect);
- update_artwork(screen->machine, state);
+ update_artwork(screen->machine(), state);
state->frame_count = (state->frame_count + 1) & 0x0f;
diff --git a/src/mame/video/stadhero.c b/src/mame/video/stadhero.c
index 2f7ff201827..9a03b453ece 100644
--- a/src/mame/video/stadhero.c
+++ b/src/mame/video/stadhero.c
@@ -21,12 +21,12 @@
SCREEN_UPDATE( stadhero )
{
- stadhero_state *state = screen->machine->driver_data<stadhero_state>();
-// tilemap_set_flip_all(screen->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ stadhero_state *state = screen->machine().driver_data<stadhero_state>();
+// tilemap_set_flip_all(screen->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
- screen->machine->device<deco_bac06_device>("tilegen1")->set_bppmultmask(0x8, 0x7);
- screen->machine->device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine,bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x00, 0x00, 0x0f);
+ screen->machine().device<deco_bac06_device>("tilegen1")->set_bppmultmask(0x8, 0x7);
+ screen->machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen->machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x00, 0x00, 0x0f);
tilemap_draw(bitmap,cliprect,state->pf1_tilemap,0,0);
return 0;
}
@@ -35,7 +35,7 @@ SCREEN_UPDATE( stadhero )
WRITE16_HANDLER( stadhero_pf1_data_w )
{
- stadhero_state *state = space->machine->driver_data<stadhero_state>();
+ stadhero_state *state = space->machine().driver_data<stadhero_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap,offset);
}
@@ -45,7 +45,7 @@ WRITE16_HANDLER( stadhero_pf1_data_w )
static TILE_GET_INFO( get_pf1_tile_info )
{
- stadhero_state *state = machine->driver_data<stadhero_state>();
+ stadhero_state *state = machine.driver_data<stadhero_state>();
int tile=state->pf1_data[tile_index];
int color=tile >> 12;
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_pf1_tile_info )
VIDEO_START( stadhero )
{
- stadhero_state *state = machine->driver_data<stadhero_state>();
+ stadhero_state *state = machine.driver_data<stadhero_state>();
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info,tilemap_scan_rows, 8, 8,32,32);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
}
diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c
index e05022c9217..b23d4e17f00 100644
--- a/src/mame/video/starcrus.c
+++ b/src/mame/video/starcrus.c
@@ -8,29 +8,29 @@
/* The collision detection techniques use in this driver
are well explained in the comments in the sprint2 driver */
-WRITE8_HANDLER( starcrus_s1_x_w ) { space->machine->driver_data<starcrus_state>()->s1_x = data^0xff; }
-WRITE8_HANDLER( starcrus_s1_y_w ) { space->machine->driver_data<starcrus_state>()->s1_y = data^0xff; }
-WRITE8_HANDLER( starcrus_s2_x_w ) { space->machine->driver_data<starcrus_state>()->s2_x = data^0xff; }
-WRITE8_HANDLER( starcrus_s2_y_w ) { space->machine->driver_data<starcrus_state>()->s2_y = data^0xff; }
-WRITE8_HANDLER( starcrus_p1_x_w ) { space->machine->driver_data<starcrus_state>()->p1_x = data^0xff; }
-WRITE8_HANDLER( starcrus_p1_y_w ) { space->machine->driver_data<starcrus_state>()->p1_y = data^0xff; }
-WRITE8_HANDLER( starcrus_p2_x_w ) { space->machine->driver_data<starcrus_state>()->p2_x = data^0xff; }
-WRITE8_HANDLER( starcrus_p2_y_w ) { space->machine->driver_data<starcrus_state>()->p2_y = data^0xff; }
+WRITE8_HANDLER( starcrus_s1_x_w ) { space->machine().driver_data<starcrus_state>()->s1_x = data^0xff; }
+WRITE8_HANDLER( starcrus_s1_y_w ) { space->machine().driver_data<starcrus_state>()->s1_y = data^0xff; }
+WRITE8_HANDLER( starcrus_s2_x_w ) { space->machine().driver_data<starcrus_state>()->s2_x = data^0xff; }
+WRITE8_HANDLER( starcrus_s2_y_w ) { space->machine().driver_data<starcrus_state>()->s2_y = data^0xff; }
+WRITE8_HANDLER( starcrus_p1_x_w ) { space->machine().driver_data<starcrus_state>()->p1_x = data^0xff; }
+WRITE8_HANDLER( starcrus_p1_y_w ) { space->machine().driver_data<starcrus_state>()->p1_y = data^0xff; }
+WRITE8_HANDLER( starcrus_p2_x_w ) { space->machine().driver_data<starcrus_state>()->p2_x = data^0xff; }
+WRITE8_HANDLER( starcrus_p2_y_w ) { space->machine().driver_data<starcrus_state>()->p2_y = data^0xff; }
VIDEO_START( starcrus )
{
- starcrus_state *state = machine->driver_data<starcrus_state>();
- state->ship1_vid = auto_bitmap_alloc(machine, 16, 16, machine->primary_screen->format());
- state->ship2_vid = auto_bitmap_alloc(machine, 16, 16, machine->primary_screen->format());
+ starcrus_state *state = machine.driver_data<starcrus_state>();
+ state->ship1_vid = auto_bitmap_alloc(machine, 16, 16, machine.primary_screen->format());
+ state->ship2_vid = auto_bitmap_alloc(machine, 16, 16, machine.primary_screen->format());
- state->proj1_vid = auto_bitmap_alloc(machine, 16, 16, machine->primary_screen->format());
- state->proj2_vid = auto_bitmap_alloc(machine, 16, 16, machine->primary_screen->format());
+ state->proj1_vid = auto_bitmap_alloc(machine, 16, 16, machine.primary_screen->format());
+ state->proj2_vid = auto_bitmap_alloc(machine, 16, 16, machine.primary_screen->format());
}
WRITE8_HANDLER( starcrus_ship_parm_1_w )
{
- starcrus_state *state = space->machine->driver_data<starcrus_state>();
- device_t *samples = space->machine->device("samples");
+ starcrus_state *state = space->machine().driver_data<starcrus_state>();
+ device_t *samples = space->machine().device("samples");
state->s1_sprite = data&0x1f;
state->engine1_on = ((data&0x20)>>5)^0x01;
@@ -55,12 +55,12 @@ WRITE8_HANDLER( starcrus_ship_parm_1_w )
WRITE8_HANDLER( starcrus_ship_parm_2_w )
{
- starcrus_state *state = space->machine->driver_data<starcrus_state>();
- device_t *samples = space->machine->device("samples");
+ starcrus_state *state = space->machine().driver_data<starcrus_state>();
+ device_t *samples = space->machine().device("samples");
state->s2_sprite = data&0x1f;
- set_led_status(space->machine, 2,~data & 0x80); /* game over lamp */
- coin_counter_w(space->machine, 0, ((data&0x40)>>6)^0x01); /* coin counter */
+ set_led_status(space->machine(), 2,~data & 0x80); /* game over lamp */
+ coin_counter_w(space->machine(), 0, ((data&0x40)>>6)^0x01); /* coin counter */
state->engine2_on = ((data&0x20)>>5)^0x01;
if (state->engine1_on || state->engine2_on)
@@ -84,8 +84,8 @@ WRITE8_HANDLER( starcrus_ship_parm_2_w )
WRITE8_HANDLER( starcrus_proj_parm_1_w )
{
- starcrus_state *state = space->machine->driver_data<starcrus_state>();
- device_t *samples = space->machine->device("samples");
+ starcrus_state *state = space->machine().driver_data<starcrus_state>();
+ device_t *samples = space->machine().device("samples");
state->p1_sprite = data&0x0f;
state->launch1_on = ((data&0x20)>>5)^0x01;
@@ -124,8 +124,8 @@ WRITE8_HANDLER( starcrus_proj_parm_1_w )
WRITE8_HANDLER( starcrus_proj_parm_2_w )
{
- starcrus_state *state = space->machine->driver_data<starcrus_state>();
- device_t *samples = space->machine->device("samples");
+ starcrus_state *state = space->machine().driver_data<starcrus_state>();
+ device_t *samples = space->machine().device("samples");
state->p2_sprite = data&0x0f;
state->launch2_on = ((data&0x20)>>5)^0x01;
@@ -162,9 +162,9 @@ WRITE8_HANDLER( starcrus_proj_parm_2_w )
}
}
-static int collision_check_s1s2(running_machine *machine)
+static int collision_check_s1s2(running_machine &machine)
{
- starcrus_state *state = machine->driver_data<starcrus_state>();
+ starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip;
@@ -185,7 +185,7 @@ static int collision_check_s1s2(running_machine *machine)
/* Draw ship 1 */
drawgfx_opaque(state->ship1_vid,
&clip,
- machine->gfx[8+((state->s1_sprite&0x04)>>2)],
+ machine.gfx[8+((state->s1_sprite&0x04)>>2)],
(state->s1_sprite&0x03)^0x03,
0,
(state->s1_sprite&0x08)>>3, (state->s1_sprite&0x10)>>4,
@@ -194,7 +194,7 @@ static int collision_check_s1s2(running_machine *machine)
/* Draw ship 2 */
drawgfx_opaque(state->ship2_vid,
&clip,
- machine->gfx[10+((state->s2_sprite&0x04)>>2)],
+ machine.gfx[10+((state->s2_sprite&0x04)>>2)],
(state->s2_sprite&0x03)^0x03,
0,
(state->s2_sprite&0x08)>>3, (state->s2_sprite&0x10)>>4,
@@ -210,9 +210,9 @@ static int collision_check_s1s2(running_machine *machine)
return 0;
}
-static int collision_check_p1p2(running_machine *machine)
+static int collision_check_p1p2(running_machine &machine)
{
- starcrus_state *state = machine->driver_data<starcrus_state>();
+ starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip;
@@ -242,7 +242,7 @@ static int collision_check_p1p2(running_machine *machine)
/* Draw score/projectile 1 */
drawgfx_opaque(state->proj1_vid,
&clip,
- machine->gfx[(state->p1_sprite&0x0c)>>2],
+ machine.gfx[(state->p1_sprite&0x0c)>>2],
(state->p1_sprite&0x03)^0x03,
0,
0,0,
@@ -254,7 +254,7 @@ static int collision_check_p1p2(running_machine *machine)
/* Draw score/projectile 2 */
drawgfx_opaque(state->proj2_vid,
&clip,
- machine->gfx[4+((state->p2_sprite&0x0c)>>2)],
+ machine.gfx[4+((state->p2_sprite&0x0c)>>2)],
(state->p2_sprite&0x03)^0x03,
0,
0,0,
@@ -271,9 +271,9 @@ static int collision_check_p1p2(running_machine *machine)
return 0;
}
-static int collision_check_s1p1p2(running_machine *machine)
+static int collision_check_s1p1p2(running_machine &machine)
{
- starcrus_state *state = machine->driver_data<starcrus_state>();
+ starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip;
@@ -302,7 +302,7 @@ static int collision_check_s1p1p2(running_machine *machine)
/* Draw ship 1 */
drawgfx_opaque(state->ship1_vid,
&clip,
- machine->gfx[8+((state->s1_sprite&0x04)>>2)],
+ machine.gfx[8+((state->s1_sprite&0x04)>>2)],
(state->s1_sprite&0x03)^0x03,
0,
(state->s1_sprite&0x08)>>3, (state->s1_sprite&0x10)>>4,
@@ -313,7 +313,7 @@ static int collision_check_s1p1p2(running_machine *machine)
/* Draw projectile 1 */
drawgfx_opaque(state->proj1_vid,
&clip,
- machine->gfx[(state->p1_sprite&0x0c)>>2],
+ machine.gfx[(state->p1_sprite&0x0c)>>2],
(state->p1_sprite&0x03)^0x03,
0,
0,0,
@@ -325,7 +325,7 @@ static int collision_check_s1p1p2(running_machine *machine)
/* Draw projectile 2 */
drawgfx_opaque(state->proj2_vid,
&clip,
- machine->gfx[4+((state->p2_sprite&0x0c)>>2)],
+ machine.gfx[4+((state->p2_sprite&0x0c)>>2)],
(state->p2_sprite&0x03)^0x03,
0,
0,0,
@@ -348,9 +348,9 @@ static int collision_check_s1p1p2(running_machine *machine)
return 0;
}
-static int collision_check_s2p1p2(running_machine *machine)
+static int collision_check_s2p1p2(running_machine &machine)
{
- starcrus_state *state = machine->driver_data<starcrus_state>();
+ starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip;
@@ -379,7 +379,7 @@ static int collision_check_s2p1p2(running_machine *machine)
/* Draw ship 2 */
drawgfx_opaque(state->ship2_vid,
&clip,
- machine->gfx[10+((state->s2_sprite&0x04)>>2)],
+ machine.gfx[10+((state->s2_sprite&0x04)>>2)],
(state->s2_sprite&0x03)^0x03,
0,
(state->s2_sprite&0x08)>>3, (state->s2_sprite&0x10)>>4,
@@ -390,7 +390,7 @@ static int collision_check_s2p1p2(running_machine *machine)
/* Draw projectile 1 */
drawgfx_opaque(state->proj1_vid,
&clip,
- machine->gfx[(state->p1_sprite&0x0c)>>2],
+ machine.gfx[(state->p1_sprite&0x0c)>>2],
(state->p1_sprite&0x03)^0x03,
0,
0,0,
@@ -402,7 +402,7 @@ static int collision_check_s2p1p2(running_machine *machine)
/* Draw projectile 2 */
drawgfx_opaque(state->proj2_vid,
&clip,
- machine->gfx[4+((state->p2_sprite&0x0c)>>2)],
+ machine.gfx[4+((state->p2_sprite&0x0c)>>2)],
(state->p2_sprite&0x03)^0x03,
0,
0,0,
@@ -427,14 +427,14 @@ static int collision_check_s2p1p2(running_machine *machine)
SCREEN_UPDATE( starcrus )
{
- starcrus_state *state = screen->machine->driver_data<starcrus_state>();
+ starcrus_state *state = screen->machine().driver_data<starcrus_state>();
bitmap_fill(bitmap,cliprect,0);
/* Draw ship 1 */
drawgfx_transpen(bitmap,
cliprect,
- screen->machine->gfx[8+((state->s1_sprite&0x04)>>2)],
+ screen->machine().gfx[8+((state->s1_sprite&0x04)>>2)],
(state->s1_sprite&0x03)^0x03,
0,
(state->s1_sprite&0x08)>>3, (state->s1_sprite&0x10)>>4,
@@ -444,7 +444,7 @@ SCREEN_UPDATE( starcrus )
/* Draw ship 2 */
drawgfx_transpen(bitmap,
cliprect,
- screen->machine->gfx[10+((state->s2_sprite&0x04)>>2)],
+ screen->machine().gfx[10+((state->s2_sprite&0x04)>>2)],
(state->s2_sprite&0x03)^0x03,
0,
(state->s2_sprite&0x08)>>3, (state->s2_sprite&0x10)>>4,
@@ -454,7 +454,7 @@ SCREEN_UPDATE( starcrus )
/* Draw score/projectile 1 */
drawgfx_transpen(bitmap,
cliprect,
- screen->machine->gfx[(state->p1_sprite&0x0c)>>2],
+ screen->machine().gfx[(state->p1_sprite&0x0c)>>2],
(state->p1_sprite&0x03)^0x03,
0,
0,0,
@@ -464,7 +464,7 @@ SCREEN_UPDATE( starcrus )
/* Draw score/projectile 2 */
drawgfx_transpen(bitmap,
cliprect,
- screen->machine->gfx[4+((state->p2_sprite&0x0c)>>2)],
+ screen->machine().gfx[4+((state->p2_sprite&0x0c)>>2)],
(state->p2_sprite&0x03)^0x03,
0,
0,0,
@@ -477,23 +477,23 @@ SCREEN_UPDATE( starcrus )
state->collision_reg = 0x00;
/* Check for collisions between ship1 and ship2 */
- if (collision_check_s1s2(screen->machine))
+ if (collision_check_s1s2(screen->machine()))
{
state->collision_reg |= 0x08;
}
/* Check for collisions between ship1 and projectiles */
- if (collision_check_s1p1p2(screen->machine))
+ if (collision_check_s1p1p2(screen->machine()))
{
state->collision_reg |= 0x02;
}
/* Check for collisions between ship1 and projectiles */
- if (collision_check_s2p1p2(screen->machine))
+ if (collision_check_s2p1p2(screen->machine()))
{
state->collision_reg |= 0x01;
}
/* Check for collisions between ship1 and projectiles */
/* Note: I don't think this is used by the game */
- if (collision_check_p1p2(screen->machine))
+ if (collision_check_p1p2(screen->machine()))
{
state->collision_reg |= 0x04;
}
@@ -504,7 +504,7 @@ SCREEN_UPDATE( starcrus )
READ8_HANDLER( starcrus_coll_det_r )
{
- starcrus_state *state = space->machine->driver_data<starcrus_state>();
+ starcrus_state *state = space->machine().driver_data<starcrus_state>();
return state->collision_reg ^ 0xff;
}
diff --git a/src/mame/video/starfire.c b/src/mame/video/starfire.c
index 0f322269092..8919e1439d6 100644
--- a/src/mame/video/starfire.c
+++ b/src/mame/video/starfire.c
@@ -17,11 +17,11 @@ static TIMER_CALLBACK( starfire_scanline_callback );
VIDEO_START( starfire )
{
- starfire_state *state = machine->driver_data<starfire_state>();
+ starfire_state *state = machine.driver_data<starfire_state>();
- state->starfire_screen = machine->primary_screen->alloc_compatible_bitmap();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(starfire_scanline_callback));
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
+ state->starfire_screen = machine.primary_screen->alloc_compatible_bitmap();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(starfire_scanline_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
/* register for state saving */
state->save_item(NAME(state->starfire_vidctrl));
@@ -39,7 +39,7 @@ VIDEO_START( starfire )
WRITE8_HANDLER( starfire_colorram_w )
{
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* handle writes to the pseudo-color RAM */
if ((offset & 0xe0) == 0)
@@ -74,7 +74,7 @@ WRITE8_HANDLER( starfire_colorram_w )
READ8_HANDLER( starfire_colorram_r )
{
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* handle writes to the pseudo-color RAM, which also happen on reads */
if ((offset & 0xe0) == 0)
@@ -106,7 +106,7 @@ WRITE8_HANDLER( starfire_videoram_w )
int sh, lr, dm, ds, mask, d0, dalu;
int offset1 = offset & 0x1fff;
int offset2 = (offset + 0x100) & 0x1fff;
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* PROT */
if (!(offset & 0xe0) && !(state->starfire_vidctrl1 & 0x20))
@@ -187,7 +187,7 @@ READ8_HANDLER( starfire_videoram_r )
int sh, mask, d0;
int offset1 = offset & 0x1fff;
int offset2 = (offset + 0x100) & 0x1fff;
- starfire_state *state = space->machine->driver_data<starfire_state>();
+ starfire_state *state = space->machine().driver_data<starfire_state>();
/* selector 6A */
if (offset & 0x2000)
@@ -221,10 +221,10 @@ READ8_HANDLER( starfire_videoram_r )
*
*************************************/
-static void get_pens(running_machine *machine, pen_t *pens)
+static void get_pens(running_machine &machine, pen_t *pens)
{
offs_t offs;
- starfire_state *state = machine->driver_data<starfire_state>();
+ starfire_state *state = machine.driver_data<starfire_state>();
for (offs = 0; offs < STARFIRE_NUM_PENS; offs++)
{
@@ -236,7 +236,7 @@ static void get_pens(running_machine *machine, pen_t *pens)
static TIMER_CALLBACK( starfire_scanline_callback )
{
- starfire_state *state = machine->driver_data<starfire_state>();
+ starfire_state *state = machine.driver_data<starfire_state>();
pen_t pens[STARFIRE_NUM_PENS];
int y = param;
@@ -265,12 +265,12 @@ static TIMER_CALLBACK( starfire_scanline_callback )
y++;
if (y >= STARFIRE_VBSTART) y = STARFIRE_VBEND;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(y), y);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(y), y);
}
SCREEN_UPDATE( starfire )
{
- starfire_state *state = screen->machine->driver_data<starfire_state>();
+ starfire_state *state = screen->machine().driver_data<starfire_state>();
copybitmap(bitmap, state->starfire_screen, 0, 0, 0, 0, cliprect);
return 0;
diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c
index 3a31054cf20..8755a8bec07 100644
--- a/src/mame/video/starshp1.c
+++ b/src/mame/video/starshp1.c
@@ -38,16 +38,16 @@ PALETTE_INIT( starshp1 )
};
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 8);
+ machine.colortable = colortable_alloc(machine, 8);
for (i = 0; i < sizeof(colortable_source) / sizeof(colortable_source[0]); i++)
- colortable_entry_set_value(machine->colortable, i, colortable_source[i]);
+ colortable_entry_set_value(machine.colortable, i, colortable_source[i]);
}
static TILE_GET_INFO( get_tile_info )
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
UINT8 code = state->playfield_ram[tile_index];
SET_TILE_INFO(0, code & 0x3f, 0, 0);
@@ -56,7 +56,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( starshp1 )
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
UINT16 val = 0;
int i;
@@ -81,17 +81,17 @@ VIDEO_START( starshp1 )
val = (val << 1) | (bit & 1);
}
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
}
READ8_HANDLER( starshp1_rng_r )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
- int width = space->machine->primary_screen->width();
- int height = space->machine->primary_screen->height();
- int x = space->machine->primary_screen->hpos();
- int y = space->machine->primary_screen->vpos();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
+ int width = space->machine().primary_screen->width();
+ int height = space->machine().primary_screen->height();
+ int x = space->machine().primary_screen->hpos();
+ int y = space->machine().primary_screen->vpos();
/* the LFSR is only running in the non-blank region
of the screen, so this is not quite right */
@@ -106,7 +106,7 @@ READ8_HANDLER( starshp1_rng_r )
WRITE8_HANDLER( starshp1_ssadd_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
/*
* The range of sprite position values doesn't suffice to
* move the zoomed spaceship sprite over the top and left
@@ -123,7 +123,7 @@ WRITE8_HANDLER( starshp1_ssadd_w )
WRITE8_HANDLER( starshp1_sspic_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
/*
* Some mysterious game code at address $2CCE is causing
* erratic images in the target explosion sequence. The
@@ -137,7 +137,7 @@ WRITE8_HANDLER( starshp1_sspic_w )
WRITE8_HANDLER( starshp1_playfield_w )
{
- starshp1_state *state = space->machine->driver_data<starshp1_state>();
+ starshp1_state *state = space->machine().driver_data<starshp1_state>();
if (state->mux != 0)
{
offset ^= 0x1f;
@@ -181,16 +181,16 @@ static int get_sprite_vpos(starshp1_state *state, int i)
}
-static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
int i;
for (i = 0; i < 14; i++)
{
int code = (state->obj_ram[i] & 0xf) ^ 0xf;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code % 8,
code / 8,
0, 0,
@@ -200,9 +200,9 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
}
-static void draw_spaceship(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_spaceship(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
double scaler = -5 * log(1 - state->ship_size / 256.0); /* ? */
unsigned xzoom = 2 * 0x10000 * scaler;
@@ -217,7 +217,7 @@ static void draw_spaceship(running_machine *machine, bitmap_t* bitmap, const rec
if (y <= 0)
y -= (yzoom * state->ship_voffset) >> 16;
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[2],
state->ship_picture & 0x03,
state->ship_explode,
state->ship_picture & 0x80, 0,
@@ -255,9 +255,9 @@ static int get_circle_vpos(starshp1_state *state)
}
-static void draw_circle_line(running_machine *machine, bitmap_t *bitmap, int x, int y, int l)
+static void draw_circle_line(running_machine &machine, bitmap_t *bitmap, int x, int y, int l)
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
if (y >= 0 && y <= bitmap->height - 1)
{
const UINT16* p = state->LSFR + (UINT16) (512 * y);
@@ -284,9 +284,9 @@ static void draw_circle_line(running_machine *machine, bitmap_t *bitmap, int x,
}
-static void draw_circle(running_machine *machine, bitmap_t* bitmap)
+static void draw_circle(running_machine &machine, bitmap_t* bitmap)
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
int cx = get_circle_hpos(state);
int cy = get_circle_vpos(state);
@@ -314,9 +314,9 @@ static void draw_circle(running_machine *machine, bitmap_t* bitmap)
}
-static int spaceship_collision(running_machine *machine, bitmap_t *bitmap, const rectangle *rect)
+static int spaceship_collision(running_machine &machine, bitmap_t *bitmap, const rectangle *rect)
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
int x;
int y;
@@ -358,24 +358,24 @@ static int circle_collision(starshp1_state *state, const rectangle *rect)
SCREEN_UPDATE( starshp1 )
{
- starshp1_state *state = screen->machine->driver_data<starshp1_state>();
- set_pens(state, screen->machine->colortable);
+ starshp1_state *state = screen->machine().driver_data<starshp1_state>();
+ set_pens(state, screen->machine().colortable);
bitmap_fill(bitmap, cliprect, 0);
if (state->starfield_kill == 0)
draw_starfield(state, bitmap);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
if (state->circle_kill == 0 && state->circle_mod != 0)
- draw_circle(screen->machine, bitmap);
+ draw_circle(screen->machine(), bitmap);
if (state->attract == 0)
- draw_spaceship(screen->machine, bitmap, cliprect);
+ draw_spaceship(screen->machine(), bitmap, cliprect);
if (state->circle_kill == 0 && state->circle_mod == 0)
- draw_circle(screen->machine, bitmap);
+ draw_circle(screen->machine(), bitmap);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -388,14 +388,14 @@ SCREEN_UPDATE( starshp1 )
SCREEN_EOF( starshp1 )
{
- starshp1_state *state = machine->driver_data<starshp1_state>();
+ starshp1_state *state = machine.driver_data<starshp1_state>();
rectangle rect;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
rect.min_x = get_sprite_hpos(state, 13);
rect.min_y = get_sprite_vpos(state, 13);
- rect.max_x = rect.min_x + machine->gfx[1]->width - 1;
- rect.max_y = rect.min_y + machine->gfx[1]->height - 1;
+ rect.max_x = rect.min_x + machine.gfx[1]->width - 1;
+ rect.max_y = rect.min_y + machine.gfx[1]->height - 1;
if (rect.min_x < 0)
rect.min_x = 0;
diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c
index 285afe4df1a..4c3fb622232 100644
--- a/src/mame/video/stfight.c
+++ b/src/mame/video/stfight.c
@@ -35,48 +35,48 @@ PALETTE_INIT( stfight )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* text uses colors 0xc0-0xcf */
for (i = 0; i < 0x40; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0xc0;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* fg uses colors 0x40-0x7f */
for (i = 0x40; i < 0x140; i++)
{
UINT8 ctabentry = (color_prom[i + 0x1c0] & 0x0f) | ((color_prom[i + 0x0c0] & 0x03) << 4) | 0x40;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bg uses colors 0-0x3f */
for (i = 0x140; i < 0x240; i++)
{
UINT8 ctabentry = (color_prom[i + 0x2c0] & 0x0f) | ((color_prom[i + 0x1c0] & 0x03) << 4);
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* bg uses colors 0x80-0xbf */
for (i = 0x240; i < 0x340; i++)
{
UINT8 ctabentry = (color_prom[i + 0x3c0] & 0x0f) | ((color_prom[i + 0x2c0] & 0x03) << 4) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
int i;
for (i = 0; i < 0x100; i++)
{
- UINT16 data = machine->generic.paletteram.u8[i] | (machine->generic.paletteram2.u8[i] << 8);
+ UINT16 data = machine.generic.paletteram.u8[i] | (machine.generic.paletteram2.u8[i] << 8);
rgb_t color = MAKE_RGB(pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
- colortable_palette_set_color(machine->colortable, i, color);
+ colortable_palette_set_color(machine.colortable, i, color);
}
}
@@ -95,7 +95,7 @@ static TILEMAP_MAPPER( fg_scan )
static TILE_GET_INFO( get_fg_tile_info )
{
- UINT8 *fgMap = machine->region("gfx5")->base();
+ UINT8 *fgMap = machine.region("gfx5")->base();
int attr,tile_base;
attr = fgMap[0x8000+tile_index];
@@ -118,7 +118,7 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- UINT8 *bgMap = machine->region("gfx6")->base();
+ UINT8 *bgMap = machine.region("gfx6")->base();
int attr,tile_bank,tile_base;
attr = bgMap[0x8000+tile_index];
@@ -134,7 +134,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- stfight_state *state = machine->driver_data<stfight_state>();
+ stfight_state *state = machine.driver_data<stfight_state>();
UINT8 attr = state->text_attr_ram[tile_index];
int color = attr & 0x0f;
@@ -156,13 +156,13 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( stfight )
{
- stfight_state *state = machine->driver_data<stfight_state>();
+ stfight_state *state = machine.driver_data<stfight_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,bg_scan, 16,16,128,256);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,fg_scan,16,16,128,256);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8,8,32,32);
tilemap_set_transparent_pen(state->fg_tilemap,0x0f);
- colortable_configure_tilemap_groups(machine->colortable, state->tx_tilemap, machine->gfx[0], 0xcf);
+ colortable_configure_tilemap_groups(machine.colortable, state->tx_tilemap, machine.gfx[0], 0xcf);
}
@@ -175,28 +175,28 @@ VIDEO_START( stfight )
WRITE8_HANDLER( stfight_text_char_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
state->text_char_ram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
WRITE8_HANDLER( stfight_text_attr_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
state->text_attr_ram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
WRITE8_HANDLER( stfight_sprite_bank_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
state->sprite_base = ( ( data & 0x04 ) << 7 ) |
( ( data & 0x01 ) << 8 );
}
WRITE8_HANDLER( stfight_vh_latch_w )
{
- stfight_state *state = space->machine->driver_data<stfight_state>();
+ stfight_state *state = space->machine().driver_data<stfight_state>();
int scroll;
@@ -233,7 +233,7 @@ WRITE8_HANDLER( stfight_vh_latch_w )
/* 0x40 = sprites */
tilemap_set_enable(state->bg_tilemap,data & 0x20);
tilemap_set_enable(state->fg_tilemap,data & 0x10);
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
break;
}
}
@@ -244,9 +244,9 @@ WRITE8_HANDLER( stfight_vh_latch_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- stfight_state *state = machine->driver_data<stfight_state>();
+ stfight_state *state = machine.driver_data<stfight_state>();
int offs,sx,sy;
for (offs = 0;offs < 4096;offs += 32)
@@ -280,12 +280,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code = state->sprite_base + state->sprite_ram[offs];
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
code,
color,
flipx,flip_screen_get(machine),
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri ? 0x02 : 0,0x0f);
}
}
@@ -294,10 +294,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( stfight )
{
- stfight_state *state = screen->machine->driver_data<stfight_state>();
- set_pens(screen->machine);
+ stfight_state *state = screen->machine().driver_data<stfight_state>();
+ set_pens(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,0); /* in case state->bg_tilemap is disabled */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
@@ -305,7 +305,7 @@ SCREEN_UPDATE( stfight )
/* Draw sprites (may be obscured by foreground layer) */
if (state->vh_latch_ram[0x07] & 0x40)
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
diff --git a/src/mame/video/stlforce.c b/src/mame/video/stlforce.c
index e8810f86176..81fd906df26 100644
--- a/src/mame/video/stlforce.c
+++ b/src/mame/video/stlforce.c
@@ -7,7 +7,7 @@
static TILE_GET_INFO( get_stlforce_bg_tile_info )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
int tileno,colour;
tileno = state->bg_videoram[tile_index] & 0x0fff;
@@ -18,7 +18,7 @@ static TILE_GET_INFO( get_stlforce_bg_tile_info )
WRITE16_HANDLER( stlforce_bg_videoram_w )
{
- stlforce_state *state = space->machine->driver_data<stlforce_state>();
+ stlforce_state *state = space->machine().driver_data<stlforce_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -28,7 +28,7 @@ WRITE16_HANDLER( stlforce_bg_videoram_w )
static TILE_GET_INFO( get_stlforce_mlow_tile_info )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
int tileno,colour;
tileno = state->mlow_videoram[tile_index] & 0x0fff;
@@ -42,7 +42,7 @@ static TILE_GET_INFO( get_stlforce_mlow_tile_info )
WRITE16_HANDLER( stlforce_mlow_videoram_w )
{
- stlforce_state *state = space->machine->driver_data<stlforce_state>();
+ stlforce_state *state = space->machine().driver_data<stlforce_state>();
state->mlow_videoram[offset] = data;
tilemap_mark_tile_dirty(state->mlow_tilemap,offset);
@@ -52,7 +52,7 @@ WRITE16_HANDLER( stlforce_mlow_videoram_w )
static TILE_GET_INFO( get_stlforce_mhigh_tile_info )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
int tileno,colour;
tileno = state->mhigh_videoram[tile_index] & 0x0fff;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_stlforce_mhigh_tile_info )
WRITE16_HANDLER( stlforce_mhigh_videoram_w )
{
- stlforce_state *state = space->machine->driver_data<stlforce_state>();
+ stlforce_state *state = space->machine().driver_data<stlforce_state>();
state->mhigh_videoram[offset] = data;
tilemap_mark_tile_dirty(state->mhigh_tilemap,offset);
@@ -76,7 +76,7 @@ WRITE16_HANDLER( stlforce_mhigh_videoram_w )
static TILE_GET_INFO( get_stlforce_tx_tile_info )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
int tileno,colour;
tileno = state->tx_videoram[tile_index] & 0x0fff;
@@ -91,7 +91,7 @@ static TILE_GET_INFO( get_stlforce_tx_tile_info )
WRITE16_HANDLER( stlforce_tx_videoram_w )
{
- stlforce_state *state = space->machine->driver_data<stlforce_state>();
+ stlforce_state *state = space->machine().driver_data<stlforce_state>();
state->tx_videoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
@@ -99,12 +99,12 @@ WRITE16_HANDLER( stlforce_tx_videoram_w )
/* sprites - quite a bit still needs doing .. */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
const UINT16 *source = state->spriteram+0x0;
const UINT16 *finish = state->spriteram+0x800;
- const gfx_element *gfx = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[2];
int ypos, xpos, attr, num;
while (source<finish)
@@ -133,7 +133,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( stlforce )
{
- stlforce_state *state = screen->machine->driver_data<stlforce_state>();
+ stlforce_state *state = screen->machine().driver_data<stlforce_state>();
int i;
if (state->vidattrram[6] & 1)
@@ -179,14 +179,14 @@ SCREEN_UPDATE( stlforce )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->mlow_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->mhigh_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
VIDEO_START( stlforce )
{
- stlforce_state *state = machine->driver_data<stlforce_state>();
+ stlforce_state *state = machine.driver_data<stlforce_state>();
state->bg_tilemap = tilemap_create(machine, get_stlforce_bg_tile_info, tilemap_scan_cols, 16,16,64,16);
state->mlow_tilemap = tilemap_create(machine, get_stlforce_mlow_tile_info, tilemap_scan_cols, 16,16,64,16);
diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c
index 26ebea0bfee..75c4b9d42a1 100644
--- a/src/mame/video/strnskil.c
+++ b/src/mame/video/strnskil.c
@@ -17,7 +17,7 @@ PALETTE_INIT( strnskil )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -26,7 +26,7 @@ PALETTE_INIT( strnskil )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -36,14 +36,14 @@ PALETTE_INIT( strnskil )
for (i = 0; i < 0x400; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( strnskil_videoram_w )
{
- strnskil_state *state = space->machine->driver_data<strnskil_state>();
+ strnskil_state *state = space->machine().driver_data<strnskil_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
@@ -51,19 +51,19 @@ WRITE8_HANDLER( strnskil_videoram_w )
WRITE8_HANDLER( strnskil_scrl_ctrl_w )
{
- strnskil_state *state = space->machine->driver_data<strnskil_state>();
+ strnskil_state *state = space->machine().driver_data<strnskil_state>();
state->scrl_ctrl = data >> 5;
- if (flip_screen_get(space->machine) != (data & 0x08))
+ if (flip_screen_get(space->machine()) != (data & 0x08))
{
- flip_screen_set(space->machine, data & 0x08);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x08);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- strnskil_state *state = machine->driver_data<strnskil_state>();
+ strnskil_state *state = machine.driver_data<strnskil_state>();
UINT8 *videoram = state->videoram;
int attr = videoram[tile_index * 2];
int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
@@ -74,16 +74,16 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( strnskil )
{
- strnskil_state *state = machine->driver_data<strnskil_state>();
+ strnskil_state *state = machine.driver_data<strnskil_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols,
8, 8, 32, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- strnskil_state *state = machine->driver_data<strnskil_state>();
+ strnskil_state *state = machine.driver_data<strnskil_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -115,19 +115,19 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = sx - 256;
drawgfx_transmask(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
px, py,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
}
}
SCREEN_UPDATE( strnskil )
{
- strnskil_state *state = screen->machine->driver_data<strnskil_state>();
+ strnskil_state *state = screen->machine().driver_data<strnskil_state>();
int row;
- const UINT8 *usr1 = screen->machine->region("user1")->base();
+ const UINT8 *usr1 = screen->machine().region("user1")->base();
for (row = 0; row < 32; row++)
{
@@ -146,6 +146,6 @@ SCREEN_UPDATE( strnskil )
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c
index 6ac28dc1c79..efe0a835440 100644
--- a/src/mame/video/stvvdp1.c
+++ b/src/mame/video/stvvdp1.c
@@ -184,7 +184,7 @@ struct shaded_point
-static void stv_vdp1_process_list(running_machine *machine);
+static void stv_vdp1_process_list(running_machine &machine);
READ32_HANDLER( stv_vdp1_regs_r )
{
@@ -293,13 +293,13 @@ WRITE32_HANDLER( stv_vdp1_regs_w )
else
{
if ( vdp1_sprite_log ) logerror( "VDP1: Access to register TVMR = %1X\n", STV_VDP1_TVMR );
- if ( STV_VDP1_VBE && stv_get_vblank(space->machine) )
+ if ( STV_VDP1_VBE && stv_get_vblank(space->machine()) )
{
stv_vdp1_clear_framebuffer_on_next_frame = 1;
}
/* needed by pblbeach, it doesn't clear local coordinates in its sprite list...*/
- //if ( !strcmp(space->machine->system().name, "pblbeach") )
+ //if ( !strcmp(space->machine().system().name, "pblbeach") )
//{
// stvvdp1_local_x = stvvdp1_local_y = 0;
//}
@@ -312,7 +312,7 @@ WRITE32_HANDLER( stv_vdp1_regs_w )
if ( STV_VDP1_PTMR == 1 )
{
if ( vdp1_sprite_log ) logerror( "VDP1: Access to register PTMR = %1X\n", STV_VDP1_PTMR );
- stv_vdp1_process_list( space->machine );
+ stv_vdp1_process_list( space->machine() );
}
}
else if ( ACCESSING_BITS_0_15 )
@@ -854,14 +854,14 @@ static UINT8* gfxdata;
static UINT16 sprite_colorbank;
-static void (*drawpixel)(running_machine *machine, int x, int y, int patterndata, int offsetcnt);
+static void (*drawpixel)(running_machine &machine, int x, int y, int patterndata, int offsetcnt);
-static void drawpixel_poly(running_machine *machine, int x, int y, int patterndata, int offsetcnt)
+static void drawpixel_poly(running_machine &machine, int x, int y, int patterndata, int offsetcnt)
{
stv_framebuffer_draw_lines[y][x] = stv2_current_sprite.CMDCOLR;
}
-static void drawpixel_8bpp_trans(running_machine *machine, int x, int y, int patterndata, int offsetcnt)
+static void drawpixel_8bpp_trans(running_machine &machine, int x, int y, int patterndata, int offsetcnt)
{
UINT16 pix;
@@ -872,7 +872,7 @@ static void drawpixel_8bpp_trans(running_machine *machine, int x, int y, int pat
}
}
-static void drawpixel_4bpp_notrans(running_machine *machine, int x, int y, int patterndata, int offsetcnt)
+static void drawpixel_4bpp_notrans(running_machine &machine, int x, int y, int patterndata, int offsetcnt)
{
UINT16 pix;
@@ -881,7 +881,7 @@ static void drawpixel_4bpp_notrans(running_machine *machine, int x, int y, int p
stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank;
}
-static void drawpixel_4bpp_trans(running_machine *machine, int x, int y, int patterndata, int offsetcnt)
+static void drawpixel_4bpp_trans(running_machine &machine, int x, int y, int patterndata, int offsetcnt)
{
UINT16 pix;
@@ -891,7 +891,7 @@ static void drawpixel_4bpp_trans(running_machine *machine, int x, int y, int pat
stv_framebuffer_draw_lines[y][x] = pix | sprite_colorbank;
}
-static void drawpixel_generic(running_machine *machine, int x, int y, int patterndata, int offsetcnt)
+static void drawpixel_generic(running_machine &machine, int x, int y, int patterndata, int offsetcnt)
{
int pix,mode,transmask, spd = stv2_current_sprite.CMDPMOD & 0x40;
int mesh = stv2_current_sprite.CMDPMOD & 0x100;
@@ -962,7 +962,7 @@ static void drawpixel_generic(running_machine *machine, int x, int y, int patter
pix = pix+(stv2_current_sprite.CMDCOLR&0xff80);
transmask = 0x7f;
mode = 3;
- // pix = machine->rand();
+ // pix = machine.rand();
break;
case 0x0020: // mode 4 256 colour bank mode (8bits) (hanagumi title)
pix = gfxdata[patterndata+offsetcnt];
@@ -976,7 +976,7 @@ static void drawpixel_generic(running_machine *machine, int x, int y, int patter
transmask = 0xffff;
break;
default: // other settings illegal
- pix = machine->rand();
+ pix = machine.rand();
mode = 0;
transmask = 0xff;
}
@@ -1081,7 +1081,7 @@ static void stv_vdp1_set_drawpixel(void)
}
-static void vdp1_fill_slope(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize,
+static void vdp1_fill_slope(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize,
INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2,
INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2,
INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2,
@@ -1197,7 +1197,7 @@ static void vdp1_fill_slope(running_machine *machine, const rectangle *cliprect,
*nv2 = v2;
}
-static void vdp1_fill_line(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize, INT32 y,
+static void vdp1_fill_line(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize, INT32 y,
INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2)
{
int xx1 = x1>>FRAC_SHIFT;
@@ -1235,7 +1235,7 @@ static void vdp1_fill_line(running_machine *machine, const rectangle *cliprect,
}
}
-static void vdp1_fill_quad(running_machine *machine, const rectangle *cliprect, int patterndata, int xsize, const struct spoint *q)
+static void vdp1_fill_quad(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize, const struct spoint *q)
{
INT32 sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta;
int pmin, pmax, i, ps1, ps2;
@@ -1382,7 +1382,7 @@ static int y2s(int v)
return (INT32)(INT16)v + stvvdp1_local_y;
}
-static void stv_vdp1_draw_line(running_machine *machine, const rectangle *cliprect)
+static void stv_vdp1_draw_line(running_machine &machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1401,7 +1401,7 @@ static void stv_vdp1_draw_line(running_machine *machine, const rectangle *clipre
vdp1_fill_quad(machine, cliprect, 0, 1, q);
}
-static void stv_vdp1_draw_poly_line(running_machine *machine, const rectangle *cliprect)
+static void stv_vdp1_draw_poly_line(running_machine &machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1464,7 +1464,7 @@ static void stv_vdp1_draw_poly_line(running_machine *machine, const rectangle *c
}
-static void stv_vpd1_draw_distorted_sprite(running_machine *machine, const rectangle *cliprect)
+static void stv_vpd1_draw_distorted_sprite(running_machine &machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1522,7 +1522,7 @@ static void stv_vpd1_draw_distorted_sprite(running_machine *machine, const recta
vdp1_fill_quad(machine, cliprect, patterndata, xsize, q);
}
-static void stv_vpd1_draw_scaled_sprite(running_machine *machine, const rectangle *cliprect)
+static void stv_vpd1_draw_scaled_sprite(running_machine &machine, const rectangle *cliprect)
{
struct spoint q[4];
@@ -1670,7 +1670,7 @@ static void stv_vpd1_draw_scaled_sprite(running_machine *machine, const rectangl
}
-static void stv_vpd1_draw_normal_sprite(running_machine *machine, const rectangle *cliprect, int sprite_type)
+static void stv_vpd1_draw_normal_sprite(running_machine &machine, const rectangle *cliprect, int sprite_type)
{
//UINT16 *destline;
@@ -1756,7 +1756,7 @@ static void stv_vpd1_draw_normal_sprite(running_machine *machine, const rectangl
}
}
-static void stv_vdp1_process_list(running_machine *machine)
+static void stv_vdp1_process_list(running_machine &machine)
{
int position;
int spritecount;
@@ -1992,7 +1992,7 @@ static void stv_vdp1_process_list(running_machine *machine)
if (vdp1_sprite_log) logerror ("End of list processing!\n");
}
-void video_update_vdp1(running_machine *machine)
+void video_update_vdp1(running_machine &machine)
{
int framebufer_changed = 0;
@@ -2093,7 +2093,7 @@ static STATE_POSTLOAD( stv_vdp1_state_save_postload )
}
}
-int stv_vdp1_start ( running_machine *machine )
+int stv_vdp1_start ( running_machine &machine )
{
stv_vdp1_regs = auto_alloc_array_clear(machine, UINT32, 0x040000/4 );
stv_vdp1_vram = auto_alloc_array_clear(machine, UINT32, 0x100000/4 );
@@ -2130,6 +2130,6 @@ int stv_vdp1_start ( running_machine *machine )
state_save_register_global(machine, stv_vdp1_clear_framebuffer_on_next_frame);
state_save_register_global(machine, stvvdp1_local_x);
state_save_register_global(machine, stvvdp1_local_y);
- machine->state().register_postload(stv_vdp1_state_save_postload, NULL);
+ machine.state().register_postload(stv_vdp1_state_save_postload, NULL);
return 0;
}
diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c
index 95079bfa826..63b77437724 100644
--- a/src/mame/video/stvvdp2.c
+++ b/src/mame/video/stvvdp2.c
@@ -117,17 +117,17 @@ static int horz_res,vert_res;
UINT32* stv_vdp2_cram;
-static void stv_vdp2_dynamic_res_change(running_machine *machine);
-static UINT8 get_hblank(running_machine *machine);
-static int get_vblank_duration(running_machine *machine);
-static int get_hblank_duration(running_machine *machine);
-static UINT8 get_odd_bit(running_machine *machine);
+static void stv_vdp2_dynamic_res_change(running_machine &machine);
+static UINT8 get_hblank(running_machine &machine);
+static int get_vblank_duration(running_machine &machine);
+static int get_hblank_duration(running_machine &machine);
+static UINT8 get_odd_bit(running_machine &machine);
-static void refresh_palette_data(running_machine *machine);
+static void refresh_palette_data(running_machine &machine);
static int stv_vdp2_window_process(int x,int y);
static int stv_vdp2_apply_window_on_layer(rectangle *cliprect);
static void stv_vdp2_get_window0_coordinates(UINT16 *s_x, UINT16 *e_x, UINT16 *s_y, UINT16 *e_y);
-static void stv_vdp2_check_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
+static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
static bitmap_t *stv_vdp2_roz_bitmap[2];
enum
@@ -2162,7 +2162,7 @@ static struct _stv_rbg_cache_data
#define mul_fixed32( a, b ) mul_32x32_shift( a, b, 16 )
-static void stv_vdp2_fill_rotation_parameter_table( running_machine *machine, UINT8 rot_parameter )
+static void stv_vdp2_fill_rotation_parameter_table( running_machine &machine, UINT8 rot_parameter )
{
UINT32 address = 0;
@@ -2443,7 +2443,7 @@ static void stv_vdp2_drawgfxzoom(
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
//int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
@@ -2845,7 +2845,7 @@ static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle *clip,
}
-static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
// if(LOG_VDP2) logerror ("bitmap enable %02x size %08x depth %08x\n", stv2_current_tilemap.layer_name, stv2_current_tilemap.bitmap_size, stv2_current_tilemap.colour_depth);
// popmessage ("bitmap enable %02x size %08x depth %08x number %02x", stv2_current_tilemap.layer_name, stv2_current_tilemap.bitmap_size, stv2_current_tilemap.colour_depth,stv2_current_tilemap.bitmap_palette_number);
@@ -2913,8 +2913,8 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
stv2_current_tilemap.bitmap_palette_number+=stv2_current_tilemap.colour_ram_address_offset;
stv2_current_tilemap.bitmap_palette_number&=7;//safety check
- screen_x = machine->primary_screen->visible_area().max_x;
- screen_y = machine->primary_screen->visible_area().max_y;
+ screen_x = machine.primary_screen->visible_area().max_x;
+ screen_y = machine.primary_screen->visible_area().max_y;
switch(stv2_current_tilemap.colour_depth)
{
@@ -2934,9 +2934,9 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
if (((xcnt + 1) < screen_x) && (ycnt < screen_y))
{
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- *BITMAP_ADDR16(bitmap, ycnt, xcnt+1) = machine->pens[((gfxdata[0] & 0x0f) >> 0) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt+1) = machine.pens[((gfxdata[0] & 0x0f) >> 0) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
else
- *BITMAP_ADDR16(bitmap, ycnt, xcnt+1) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt+1), machine->pens[((gfxdata[0] & 0x0f) >> 0) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt+1) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt+1), machine.pens[((gfxdata[0] & 0x0f) >> 0) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
}
}
}
@@ -2950,9 +2950,9 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
if (((xcnt + 0) < screen_x) && (ycnt < screen_y))
{
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine->pens[((gfxdata[0] & 0xf0) >> 4) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine.pens[((gfxdata[0] & 0xf0) >> 4) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
else
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine->pens[((gfxdata[0] & 0xf0) >> 4) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine.pens[((gfxdata[0] & 0xf0) >> 4) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
}
}
}
@@ -2985,9 +2985,9 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
if (((xcnt + 0) < screen_x) && (ycnt < screen_y))
{
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine->pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine.pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
else
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine->pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine.pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
}
}
}
@@ -3031,9 +3031,9 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
if (((xcnt + 0) < screen_x) && (ycnt < screen_y))
{
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine->pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine.pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset];
else
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine->pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine.pens[(gfxdata[xs] & 0xff) | (stv2_current_tilemap.bitmap_palette_number * 0x100) | pal_color_offset], stv2_current_tilemap.alpha);
}
}
}
@@ -3059,9 +3059,9 @@ static void stv_vdp2_draw_basic_bitmap(running_machine *machine, bitmap_t *bitma
if (((xcnt + 0) < screen_x) && (ycnt < screen_y))
{
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine->pens[((gfxdata[0] & 0x07) * 0x100) | (gfxdata[1] & 0xff) | pal_color_offset];
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = machine.pens[((gfxdata[0] & 0x07) * 0x100) | (gfxdata[1] & 0xff) | pal_color_offset];
else
- *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine->pens[((gfxdata[0] & 0x07) * 0x100) | (gfxdata[1] & 0xff) | pal_color_offset], stv2_current_tilemap.alpha);
+ *BITMAP_ADDR16(bitmap, ycnt, xcnt) = alpha_blend_r16(*BITMAP_ADDR16(bitmap, ycnt, xcnt), machine.pens[((gfxdata[0] & 0x07) * 0x100) | (gfxdata[1] & 0xff) | pal_color_offset], stv2_current_tilemap.alpha);
}
}
}
@@ -3375,7 +3375,7 @@ static void stv_vdp2_get_map_page( int x, int y, int *_map, int *_page )
*_map = map;
}
-static void stv_vdp2_draw_basic_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_basic_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* hopefully this is easier to follow than it is efficient .. */
@@ -3732,15 +3732,15 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, bitmap_t *bitm
if (stv2_current_tilemap.tile_size==1)
{
/* normal */
- stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
- stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex) >> 16,drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
- stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
- stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex)>> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
+ stv_vdp2_drawgfxzoom(bitmap,cliprect,machine.gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
+ stv_vdp2_drawgfxzoom(bitmap,cliprect,machine.gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex) >> 16,drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
+ stv_vdp2_drawgfxzoom(bitmap,cliprect,machine.gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos >> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X, SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
+ stv_vdp2_drawgfxzoom(bitmap,cliprect,machine.gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,(drawxpos+tilesizex)>> 16,(drawypos+tilesizey) >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X1(tilesizex), SCR_TILESIZE_Y1(tilesizey),stv2_current_tilemap.alpha);
}
else
{
- stv_vdp2_drawgfxzoom(bitmap,cliprect,machine->gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X,SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
+ stv_vdp2_drawgfxzoom(bitmap,cliprect,machine.gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos >> 16, drawypos >> 16,stv2_current_tilemap.transparency,0,scalex,scaley,SCR_TILESIZE_X,SCR_TILESIZE_Y,stv2_current_tilemap.alpha);
}
}
else
@@ -3762,19 +3762,19 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, bitmap_t *bitm
else if (stv2_current_tilemap.transparency == STV_TRANSPARENCY_ALPHA)
{
/* alpha */
- drawgfx_alpha(bitmap,cliprect,machine->gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos, drawypos,0,stv2_current_tilemap.alpha);
- drawgfx_alpha(bitmap,cliprect,machine->gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos,0,stv2_current_tilemap.alpha);
- drawgfx_alpha(bitmap,cliprect,machine->gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos,drawypos+8,0,stv2_current_tilemap.alpha);
- drawgfx_alpha(bitmap,cliprect,machine->gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,0,stv2_current_tilemap.alpha);
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos, drawypos,0,stv2_current_tilemap.alpha);
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos,0,stv2_current_tilemap.alpha);
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos,drawypos+8,0,stv2_current_tilemap.alpha);
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,0,stv2_current_tilemap.alpha);
}
else
{
/* normal */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos, drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos,drawypos+8,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx],tilecode+(0+(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos, drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx],tilecode+(1-(flipyx&1)+(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx],tilecode+(2+(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos,drawypos+8,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx],tilecode+(3-(flipyx&1)-(flipyx&2))*tilecodespacing,pal,flipyx&1,flipyx&2,drawxpos+8,drawypos+8,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
}
}
@@ -3787,9 +3787,9 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, bitmap_t *bitm
else
{
if (stv2_current_tilemap.transparency == STV_TRANSPARENCY_ALPHA)
- drawgfx_alpha(bitmap,cliprect,machine->gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos, drawypos,0,stv2_current_tilemap.alpha);
+ drawgfx_alpha(bitmap,cliprect,machine.gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos, drawypos,0,stv2_current_tilemap.alpha);
else
- drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos, drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[gfx],tilecode,pal,flipyx&1,flipyx&2, drawxpos, drawypos,(stv2_current_tilemap.transparency==STV_TRANSPARENCY_PEN)?0:-1);
}
}
drawxpos = olddrawxpos;
@@ -3850,7 +3850,7 @@ static void stv_vdp2_draw_basic_tilemap(running_machine *machine, bitmap_t *bitm
}
-static void stv_vdp2_check_tilemap_with_linescroll(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
rectangle mycliprect;
int cur_line = cliprect->min_y;
@@ -3981,7 +3981,7 @@ static void stv_vdp2_check_tilemap_with_linescroll(running_machine *machine, bit
}
}
-static void stv_vdp2_check_tilemap(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* the idea is here we check the tilemap capabilities / whats enabled and call an appropriate tilemap drawing routine, or
at the very list throw up a few errors if the tilemaps want to do something we don't support yet */
@@ -4396,7 +4396,7 @@ static void stv_vdp2_copy_roz_bitmap(bitmap_t *bitmap,
}
}
-static void stv_vdp2_draw_NBG0(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Colours : 16, 256, 2048, 32768, 16770000
@@ -4486,7 +4486,7 @@ static void stv_vdp2_draw_NBG0(running_machine *machine, bitmap_t *bitmap, const
stv_vdp2_check_tilemap(machine, bitmap, cliprect);
}
-static void stv_vdp2_draw_NBG1(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Colours : 16, 256, 2048, 32768
@@ -4576,7 +4576,7 @@ static void stv_vdp2_draw_NBG1(running_machine *machine, bitmap_t *bitmap, const
stv_vdp2_check_tilemap(machine, bitmap, cliprect);
}
-static void stv_vdp2_draw_NBG2(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_NBG2(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
NBG2 is the first of the 2 more basic tilemaps, it has exactly the same capabilities as NBG3
@@ -4676,7 +4676,7 @@ static void stv_vdp2_draw_NBG2(running_machine *machine, bitmap_t *bitmap, const
stv_vdp2_check_tilemap(machine, bitmap, cliprect);
}
-static void stv_vdp2_draw_NBG3(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_NBG3(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
NBG3 is the second of the 2 more basic tilemaps, it has exactly the same capabilities as NBG2
@@ -4777,7 +4777,7 @@ static void stv_vdp2_draw_NBG3(running_machine *machine, bitmap_t *bitmap, const
}
-static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int iRP)
+static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int iRP)
{
rectangle roz_clip_rect, mycliprect;
int planesizex = 0, planesizey = 0;
@@ -4882,7 +4882,7 @@ static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bi
else
{
if ( stv_vdp2_roz_bitmap[iRP-1] == NULL )
- stv_vdp2_roz_bitmap[iRP-1] = auto_alloc(machine, bitmap_t(4096, 4096, machine->primary_screen->format()));
+ stv_vdp2_roz_bitmap[iRP-1] = auto_alloc(machine, bitmap_t(4096, 4096, machine.primary_screen->format()));
roz_clip_rect.min_x = roz_clip_rect.min_y = 0;
if ( (iRP == 1 && STV_VDP2_RAOVR == 3) ||
@@ -4961,7 +4961,7 @@ static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bi
}
-static void stv_vdp2_draw_RBG0(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_RBG0(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
Colours : 16, 256, 2048, 32768, 16770000
@@ -5061,7 +5061,7 @@ static void stv_vdp2_draw_RBG0(running_machine *machine, bitmap_t *bitmap, const
}
-static void stv_vdp2_draw_back(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
int xcnt,ycnt;
UINT8* gfxdata = stv_vdp2_gfx_decode;
@@ -5117,16 +5117,16 @@ WRITE32_HANDLER ( stv_vdp2_vram_w )
stv_vdp2_vram_decode[offset*4+2] = (data & 0x0000ff00) >> 8;
stv_vdp2_vram_decode[offset*4+3] = (data & 0x000000ff) >> 0;
- gfx_element_mark_dirty(space->machine->gfx[0], offset/8);
- gfx_element_mark_dirty(space->machine->gfx[1], offset/8);
- gfx_element_mark_dirty(space->machine->gfx[2], offset/8);
- gfx_element_mark_dirty(space->machine->gfx[3], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset/8);
/* 8-bit tiles overlap, so this affects the previous one as well */
if (offset/8 != 0)
{
- gfx_element_mark_dirty(space->machine->gfx[2], offset/8 - 1);
- gfx_element_mark_dirty(space->machine->gfx[3], offset/8 - 1);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/8 - 1);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset/8 - 1);
}
if ( stv_rbg_cache_data.watch_vdp2_vram_writes )
@@ -5181,7 +5181,7 @@ WRITE32_HANDLER ( stv_vdp2_cram_w )
b = ((stv_vdp2_cram[offset] & 0x00ff0000) >> 16);
g = ((stv_vdp2_cram[offset] & 0x0000ff00) >> 8);
r = ((stv_vdp2_cram[offset] & 0x000000ff) >> 0);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
break;
/*Mode 0*/
@@ -5192,11 +5192,11 @@ WRITE32_HANDLER ( stv_vdp2_cram_w )
b = ((stv_vdp2_cram[offset] & 0x00007c00) >> 10);
g = ((stv_vdp2_cram[offset] & 0x000003e0) >> 5);
r = ((stv_vdp2_cram[offset] & 0x0000001f) >> 0);
- palette_set_color_rgb(space->machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
b = ((stv_vdp2_cram[offset] & 0x7c000000) >> 26);
g = ((stv_vdp2_cram[offset] & 0x03e00000) >> 21);
r = ((stv_vdp2_cram[offset] & 0x001f0000) >> 16);
- palette_set_color_rgb(space->machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
}
break;
/*Mode 1*/
@@ -5207,17 +5207,17 @@ WRITE32_HANDLER ( stv_vdp2_cram_w )
b = ((stv_vdp2_cram[offset] & 0x00007c00) >> 10);
g = ((stv_vdp2_cram[offset] & 0x000003e0) >> 5);
r = ((stv_vdp2_cram[offset] & 0x0000001f) >> 0);
- palette_set_color_rgb(space->machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
b = ((stv_vdp2_cram[offset] & 0x7c000000) >> 26);
g = ((stv_vdp2_cram[offset] & 0x03e00000) >> 21);
r = ((stv_vdp2_cram[offset] & 0x001f0000) >> 16);
- palette_set_color_rgb(space->machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
}
break;
}
}
-static void refresh_palette_data(running_machine *machine)
+static void refresh_palette_data(running_machine &machine)
{
int r,g,b;
int c_i;
@@ -5284,21 +5284,21 @@ WRITE32_HANDLER ( stv_vdp2_regs_w )
if(old_crmd != STV_VDP2_CRMD)
{
old_crmd = STV_VDP2_CRMD;
- refresh_palette_data(space->machine);
+ refresh_palette_data(space->machine());
}
if(old_tvmd != STV_VDP2_TVMD)
{
old_tvmd = STV_VDP2_TVMD;
- stv_vdp2_dynamic_res_change(space->machine);
+ stv_vdp2_dynamic_res_change(space->machine());
}
}
-static UINT8 get_hblank(running_machine *machine)
+static UINT8 get_hblank(running_machine &machine)
{
static int cur_h;
- const rectangle &visarea = machine->primary_screen->visible_area();
- cur_h = machine->primary_screen->hpos();
+ const rectangle &visarea = machine.primary_screen->visible_area();
+ cur_h = machine.primary_screen->hpos();
if (cur_h > visarea.max_x)
return 1;
@@ -5307,7 +5307,7 @@ static UINT8 get_hblank(running_machine *machine)
}
/* the following is a complete guess-work */
-static int get_hblank_duration(running_machine *machine)
+static int get_hblank_duration(running_machine &machine)
{
switch( STV_VDP2_HRES & 3 )
{
@@ -5320,11 +5320,11 @@ static int get_hblank_duration(running_machine *machine)
return 0;
}
-UINT8 stv_get_vblank(running_machine *machine)
+UINT8 stv_get_vblank(running_machine &machine)
{
static int cur_v;
- const rectangle &visarea = machine->primary_screen->visible_area();
- cur_v = machine->primary_screen->vpos();
+ const rectangle &visarea = machine.primary_screen->visible_area();
+ cur_v = machine.primary_screen->vpos();
if (cur_v > visarea.max_y)
return 1;
@@ -5333,7 +5333,7 @@ UINT8 stv_get_vblank(running_machine *machine)
}
/*some vblank lines measurements (according to Charles MacDonald)*/
-static int get_vblank_duration(running_machine *machine)
+static int get_vblank_duration(running_machine &machine)
{
if(STV_VDP2_HRES & 4)
{
@@ -5355,10 +5355,10 @@ static int get_vblank_duration(running_machine *machine)
return 0;
}
-static UINT8 get_odd_bit(running_machine *machine)
+static UINT8 get_odd_bit(running_machine &machine)
{
static int cur_v;
- cur_v = machine->primary_screen->vpos();
+ cur_v = machine.primary_screen->vpos();
if(STV_VDP2_HRES & 4) //exclusive monitor mode makes this bit to be always 1
return 1;
@@ -5378,9 +5378,9 @@ READ32_HANDLER ( stv_vdp2_regs_r )
case 0x4/4:
{
/*Screen Status Register*/
- stv_vblank = stv_get_vblank(space->machine);
- stv_hblank = get_hblank(space->machine);
- stv_odd = get_odd_bit(space->machine);
+ stv_vblank = stv_get_vblank(space->machine());
+ stv_hblank = get_hblank(space->machine());
+ stv_odd = get_odd_bit(space->machine());
/*VBLANK HBLANK ODD PAL */
stv_vdp2_regs[offset] = (stv_vblank<<19) | (stv_hblank<<18) | (stv_odd << 17) | (0 << 16);
@@ -5391,8 +5391,8 @@ READ32_HANDLER ( stv_vdp2_regs_r )
{
static UINT16 h_count,v_count;
/* TODO: handle various h/v settings. */
- h_count = space->machine->primary_screen->hpos() & 0x3ff;
- v_count = space->machine->primary_screen->vpos() & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
+ h_count = space->machine().primary_screen->hpos() & 0x3ff;
+ v_count = space->machine().primary_screen->vpos() & (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]);
break;
@@ -5416,16 +5416,16 @@ static STATE_POSTLOAD( stv_vdp2_state_save_postload )
stv_vdp2_vram_decode[offset*4+2] = (data & 0x0000ff00) >> 8;
stv_vdp2_vram_decode[offset*4+3] = (data & 0x000000ff) >> 0;
- gfx_element_mark_dirty(machine->gfx[0], offset/8);
- gfx_element_mark_dirty(machine->gfx[1], offset/8);
- gfx_element_mark_dirty(machine->gfx[2], offset/8);
- gfx_element_mark_dirty(machine->gfx[3], offset/8);
+ gfx_element_mark_dirty(machine.gfx[0], offset/8);
+ gfx_element_mark_dirty(machine.gfx[1], offset/8);
+ gfx_element_mark_dirty(machine.gfx[2], offset/8);
+ gfx_element_mark_dirty(machine.gfx[3], offset/8);
/* 8-bit tiles overlap, so this affects the previous one as well */
if (offset/8 != 0)
{
- gfx_element_mark_dirty(machine->gfx[2], offset/8 - 1);
- gfx_element_mark_dirty(machine->gfx[3], offset/8 - 1);
+ gfx_element_mark_dirty(machine.gfx[2], offset/8 - 1);
+ gfx_element_mark_dirty(machine.gfx[3], offset/8 - 1);
}
}
@@ -5442,9 +5442,9 @@ static void stv_vdp2_exit (running_machine &machine)
stv_vdp2_roz_bitmap[0] = stv_vdp2_roz_bitmap[1] = NULL;
}
-static int stv_vdp2_start (running_machine *machine)
+static int stv_vdp2_start (running_machine &machine)
{
- machine->add_notifier(MACHINE_NOTIFY_EXIT, stv_vdp2_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, stv_vdp2_exit);
stv_vdp2_regs = auto_alloc_array_clear(machine, UINT32, 0x040000/4 );
stv_vdp2_vram = auto_alloc_array_clear(machine, UINT32, 0x100000/4 ); // actually we only need half of it since we don't emulate extra 4mbit ram cart.
@@ -5452,8 +5452,8 @@ static int stv_vdp2_start (running_machine *machine)
stv_vdp2_gfx_decode = auto_alloc_array(machine, UINT8, 0x100000 );
stv_vdp2_render_rbg0 = 1;
-// machine->gfx[0]->color_granularity=4;
-// machine->gfx[1]->color_granularity=4;
+// machine.gfx[0]->color_granularity=4;
+// machine.gfx[1]->color_granularity=4;
memset( &stv_rbg_cache_data, 0, sizeof(stv_rbg_cache_data));
stv_rbg_cache_data.is_cache_dirty = 3;
@@ -5462,7 +5462,7 @@ static int stv_vdp2_start (running_machine *machine)
state_save_register_global_pointer(machine, stv_vdp2_regs, 0x040000/4);
state_save_register_global_pointer(machine, stv_vdp2_vram, 0x100000/4);
state_save_register_global_pointer(machine, stv_vdp2_cram, 0x080000/4);
- machine->state().register_postload(stv_vdp2_state_save_postload, NULL);
+ machine.state().register_postload(stv_vdp2_state_save_postload, NULL);
return 0;
}
@@ -5476,17 +5476,17 @@ VIDEO_START( stv_vdp2 )
debug.l_en = 0xff;
debug.error = 0xffffffff;
debug.roz = 0;
- gfx_element_set_source(machine->gfx[0], stv_vdp2_gfx_decode);
- gfx_element_set_source(machine->gfx[1], stv_vdp2_gfx_decode);
- gfx_element_set_source(machine->gfx[2], stv_vdp2_gfx_decode);
- gfx_element_set_source(machine->gfx[3], stv_vdp2_gfx_decode);
- gfx_element_set_source(machine->gfx[4], stv_vdp1_gfx_decode);
- gfx_element_set_source(machine->gfx[5], stv_vdp1_gfx_decode);
- gfx_element_set_source(machine->gfx[6], stv_vdp1_gfx_decode);
- gfx_element_set_source(machine->gfx[7], stv_vdp1_gfx_decode);
+ gfx_element_set_source(machine.gfx[0], stv_vdp2_gfx_decode);
+ gfx_element_set_source(machine.gfx[1], stv_vdp2_gfx_decode);
+ gfx_element_set_source(machine.gfx[2], stv_vdp2_gfx_decode);
+ gfx_element_set_source(machine.gfx[3], stv_vdp2_gfx_decode);
+ gfx_element_set_source(machine.gfx[4], stv_vdp1_gfx_decode);
+ gfx_element_set_source(machine.gfx[5], stv_vdp1_gfx_decode);
+ gfx_element_set_source(machine.gfx[6], stv_vdp1_gfx_decode);
+ gfx_element_set_source(machine.gfx[7], stv_vdp1_gfx_decode);
}
-static void stv_vdp2_dynamic_res_change(running_machine *machine)
+static void stv_vdp2_dynamic_res_change(running_machine &machine)
{
static UINT8 old_vres = 0,old_hres = 0;
@@ -5522,7 +5522,7 @@ static void stv_vdp2_dynamic_res_change(running_machine *machine)
if(old_vres != vert_res || old_hres != horz_res)
{
int vblank_period,hblank_period;
- rectangle visarea = machine->primary_screen->visible_area();
+ rectangle visarea = machine.primary_screen->visible_area();
visarea.min_x = 0;
visarea.max_x = horz_res-1;
visarea.min_y = 0;
@@ -5531,19 +5531,19 @@ static void stv_vdp2_dynamic_res_change(running_machine *machine)
vblank_period = get_vblank_duration(machine);
hblank_period = get_hblank_duration(machine);
// popmessage("%d",vblank_period);
-// hblank_period = get_hblank_duration(machine->primary_screen);
- machine->primary_screen->configure((horz_res+hblank_period), (vert_res+vblank_period), visarea, machine->primary_screen->frame_period().attoseconds );
+// hblank_period = get_hblank_duration(machine.primary_screen);
+ machine.primary_screen->configure((horz_res+hblank_period), (vert_res+vblank_period), visarea, machine.primary_screen->frame_period().attoseconds );
old_vres = vert_res;
old_hres = horz_res;
}
-// machine->primary_screen->set_visible_area(0*8, horz_res-1,0*8, vert_res-1);
+// machine.primary_screen->set_visible_area(0*8, horz_res-1,0*8, vert_res-1);
//if(LOG_VDP2) popmessage("%04d %04d",horz_res-1,vert-1);
}
/*This is for calculating the rgb brightness*/
/*TODO: Optimize this...*/
-static void stv_vdp2_fade_effects(running_machine *machine)
+static void stv_vdp2_fade_effects(running_machine &machine)
{
/*
Note:We have to use temporary storages because palette_get_color must use
@@ -5825,7 +5825,7 @@ static int stv_sprite_priorities_usage_valid;
static UINT8 stv_sprite_priorities_in_fb_line[512][8];
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 pri)
{
int x,y,r,g,b;
int i;
@@ -6010,7 +6010,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
pix += (STV_VDP2_SPCAOS << 8);
pix &= 0x7ff;
pix += color_offset_pal;
- bitmap_line[x] = machine->pens[ pix ];
+ bitmap_line[x] = machine.pens[ pix ];
}
}
}
@@ -6103,15 +6103,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if ( STV_VDP2_CCMD )
{
- bitmap_line[x] = stv_add_blend( bitmap_line[x], machine->pens[pix] );
+ bitmap_line[x] = stv_add_blend( bitmap_line[x], machine.pens[pix] );
}
else
{
- bitmap_line[x] = alpha_blend_r16( bitmap_line[x], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ bitmap_line[x] = alpha_blend_r16( bitmap_line[x], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
}
}
else
- bitmap_line[x] = machine->pens[pix];
+ bitmap_line[x] = machine.pens[pix];
}
}
}
@@ -6255,15 +6255,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if(double_x)
{
- bitmap_line[x*2] = machine->pens[ pix ];
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = machine->pens[ pix ];
- bitmap_line[x*2+1] = machine->pens[ pix ];
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = machine->pens[ pix ];
+ bitmap_line[x*2] = machine.pens[ pix ];
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = machine.pens[ pix ];
+ bitmap_line[x*2+1] = machine.pens[ pix ];
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = machine.pens[ pix ];
}
else
{
- bitmap_line[x] = machine->pens[ pix ];
- if ( interlace_framebuffer == 1 ) bitmap_line2[x] = machine->pens[ pix ];
+ bitmap_line[x] = machine.pens[ pix ];
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x] = machine.pens[ pix ];
}
}
else // alpha_blend == 1
@@ -6272,30 +6272,30 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
if(double_x)
{
- bitmap_line[x*2] = stv_add_blend( bitmap_line[x*2], machine->pens[pix] );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = stv_add_blend( bitmap_line2[x], machine->pens[pix] );
- bitmap_line[x*2+1] = stv_add_blend( bitmap_line[x*2+1], machine->pens[pix] );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = stv_add_blend( bitmap_line2[x], machine->pens[pix] );
+ bitmap_line[x*2] = stv_add_blend( bitmap_line[x*2], machine.pens[pix] );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = stv_add_blend( bitmap_line2[x], machine.pens[pix] );
+ bitmap_line[x*2+1] = stv_add_blend( bitmap_line[x*2+1], machine.pens[pix] );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = stv_add_blend( bitmap_line2[x], machine.pens[pix] );
}
else
{
- bitmap_line[x] = stv_add_blend( bitmap_line[x], machine->pens[pix] );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x] = stv_add_blend( bitmap_line2[x], machine->pens[pix] );
+ bitmap_line[x] = stv_add_blend( bitmap_line[x], machine.pens[pix] );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x] = stv_add_blend( bitmap_line2[x], machine.pens[pix] );
}
}
else
{
if(double_x)
{
- bitmap_line[x*2] = alpha_blend_r16( bitmap_line[x*2], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r16( bitmap_line2[x], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
- bitmap_line[x*2+1] = alpha_blend_r16( bitmap_line[x*2+1], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r16( bitmap_line2[x], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ bitmap_line[x*2] = alpha_blend_r16( bitmap_line[x*2], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r16( bitmap_line2[x], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ bitmap_line[x*2+1] = alpha_blend_r16( bitmap_line[x*2+1], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r16( bitmap_line2[x], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
}
else
{
- bitmap_line[x] = alpha_blend_r16( bitmap_line[x], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
- if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r16( bitmap_line2[x], machine->pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ bitmap_line[x] = alpha_blend_r16( bitmap_line[x], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
+ if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r16( bitmap_line2[x], machine.pens[pix], ((UINT16)(0x1f-ccr)*0xff)/0x1f );
}
}
}
@@ -6312,39 +6312,39 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( stv_vdp2 )
{
static UINT8 pri;
- video_update_vdp1(screen->machine);
+ video_update_vdp1(screen->machine());
- stv_vdp2_fade_effects(screen->machine);
+ stv_vdp2_fade_effects(screen->machine());
- stv_vdp2_draw_back(screen->machine, bitmap,cliprect);
+ stv_vdp2_draw_back(screen->machine(), bitmap,cliprect);
#if DEBUG_MODE
- if(input_code_pressed_once(screen->machine, KEYCODE_T))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_T))
{
debug.l_en^=1;
popmessage("NBG3 %sabled",debug.l_en & 1 ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_Y))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Y))
{
debug.l_en^=2;
popmessage("NBG2 %sabled",debug.l_en & 2 ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_U))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_U))
{
debug.l_en^=4;
popmessage("NBG1 %sabled",debug.l_en & 4 ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_I))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_I))
{
debug.l_en^=8;
popmessage("NBG0 %sabled",debug.l_en & 8 ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_K))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_K))
{
debug.l_en^=0x10;
popmessage("RBG0 %sabled",debug.l_en & 0x10 ? "en" : "dis");
}
- if(input_code_pressed_once(screen->machine, KEYCODE_O))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_O))
{
debug.l_en^=0x20;
popmessage("SPRITE %sabled",debug.l_en & 0x20 ? "en" : "dis");
@@ -6360,12 +6360,12 @@ SCREEN_UPDATE( stv_vdp2 )
/*If a plane has a priority value of zero it isn't shown at all.*/
for(pri=1;pri<8;pri++)
{
- if (debug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen->machine, bitmap,cliprect); }
- if (debug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen->machine, bitmap,cliprect); }
- if (debug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen->machine, bitmap,cliprect); }
- if (debug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen->machine, bitmap,cliprect); }
- if (debug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen->machine, bitmap,cliprect); }
- if (debug.l_en & 0x20) { draw_sprites(screen->machine,bitmap,cliprect,pri); }
+ if (debug.l_en & 1) { if(pri==STV_VDP2_N3PRIN) stv_vdp2_draw_NBG3(screen->machine(), bitmap,cliprect); }
+ if (debug.l_en & 2) { if(pri==STV_VDP2_N2PRIN) stv_vdp2_draw_NBG2(screen->machine(), bitmap,cliprect); }
+ if (debug.l_en & 4) { if(pri==STV_VDP2_N1PRIN) stv_vdp2_draw_NBG1(screen->machine(), bitmap,cliprect); }
+ if (debug.l_en & 8) { if(pri==STV_VDP2_N0PRIN) stv_vdp2_draw_NBG0(screen->machine(), bitmap,cliprect); }
+ if (debug.l_en & 0x10) { if(pri==STV_VDP2_R0PRIN) stv_vdp2_draw_RBG0(screen->machine(), bitmap,cliprect); }
+ if (debug.l_en & 0x20) { draw_sprites(screen->machine(),bitmap,cliprect,pri); }
}
}
@@ -6387,51 +6387,51 @@ SCREEN_UPDATE( stv_vdp2 )
,STV_VDP2_N1ZMXI,STV_VDP2_N1ZMXD
,STV_VDP2_N1ZMYI,STV_VDP2_N1ZMYD);*/
- if ( input_code_pressed_once(screen->machine, KEYCODE_W) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_W) )
{
int tilecode;
for (tilecode = 0;tilecode<0x8000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[0], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[0], tilecode);
}
for (tilecode = 0;tilecode<0x2000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[1], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[1], tilecode);
}
for (tilecode = 0;tilecode<0x4000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[2], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[2], tilecode);
}
for (tilecode = 0;tilecode<0x1000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[3], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[3], tilecode);
}
/* vdp 1 ... doesn't have to be tile based */
for (tilecode = 0;tilecode<0x8000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[4], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[4], tilecode);
}
for (tilecode = 0;tilecode<0x2000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[5], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[5], tilecode);
}
for (tilecode = 0;tilecode<0x4000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[6], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[6], tilecode);
}
for (tilecode = 0;tilecode<0x1000;tilecode++)
{
- gfx_element_mark_dirty(screen->machine->gfx[7], tilecode);
+ gfx_element_mark_dirty(screen->machine().gfx[7], tilecode);
}
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_N) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_N) )
{
FILE *fp;
@@ -6443,7 +6443,7 @@ SCREEN_UPDATE( stv_vdp2 )
}
}
- if ( input_code_pressed_once(screen->machine, KEYCODE_M) )
+ if ( input_code_pressed_once(screen->machine(), KEYCODE_M) )
{
FILE *fp;
@@ -6521,7 +6521,7 @@ static void stv_dump_ram()
fp=fopen("68k.dmp", "w+b");
if (fp)
{
- fwrite(machine->region(REGION_CPU3)->base(), 0x100000, 1, fp);
+ fwrite(machine.region(REGION_CPU3)->base(), 0x100000, 1, fp);
fclose(fp);
}
}
diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c
index 3cee3321d6c..81c46e2d782 100644
--- a/src/mame/video/subs.c
+++ b/src/mame/video/subs.c
@@ -12,13 +12,13 @@ WRITE8_HANDLER( subs_invert1_w )
{
if ((offset & 0x01) == 1)
{
- palette_set_color(space->machine, 0, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(space->machine, 1, MAKE_RGB(0xFF, 0xFF, 0xFF));
+ palette_set_color(space->machine(), 0, MAKE_RGB(0x00, 0x00, 0x00));
+ palette_set_color(space->machine(), 1, MAKE_RGB(0xFF, 0xFF, 0xFF));
}
else
{
- palette_set_color(space->machine, 1, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(space->machine, 0, MAKE_RGB(0xFF, 0xFF, 0xFF));
+ palette_set_color(space->machine(), 1, MAKE_RGB(0x00, 0x00, 0x00));
+ palette_set_color(space->machine(), 0, MAKE_RGB(0xFF, 0xFF, 0xFF));
}
}
@@ -26,27 +26,27 @@ WRITE8_HANDLER( subs_invert2_w )
{
if ((offset & 0x01) == 1)
{
- palette_set_color(space->machine, 2, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(space->machine, 3, MAKE_RGB(0xFF, 0xFF, 0xFF));
+ palette_set_color(space->machine(), 2, MAKE_RGB(0x00, 0x00, 0x00));
+ palette_set_color(space->machine(), 3, MAKE_RGB(0xFF, 0xFF, 0xFF));
}
else
{
- palette_set_color(space->machine, 3, MAKE_RGB(0x00, 0x00, 0x00));
- palette_set_color(space->machine, 2, MAKE_RGB(0xFF, 0xFF, 0xFF));
+ palette_set_color(space->machine(), 3, MAKE_RGB(0x00, 0x00, 0x00));
+ palette_set_color(space->machine(), 2, MAKE_RGB(0xFF, 0xFF, 0xFF));
}
}
SCREEN_UPDATE( subs )
{
- subs_state *state = screen->machine->driver_data<subs_state>();
+ subs_state *state = screen->machine().driver_data<subs_state>();
UINT8 *videoram = state->videoram;
UINT8 *spriteram = state->spriteram;
int offs;
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
- device_t *discrete = screen->machine->device("discrete");
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
+ device_t *discrete = screen->machine().device("discrete");
/* for every character in the Video RAM, check if it has been modified */
/* since last time and update it accordingly. */
@@ -81,11 +81,11 @@ SCREEN_UPDATE( subs )
if (screen == left_screen)
{
if ((left_enable || left_sonar_window) && (!right_sonar_window))
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
charcode, 1,
0,0,sx,sy);
else
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
0, 1,
0,0,sx,sy);
}
@@ -94,11 +94,11 @@ SCREEN_UPDATE( subs )
if (screen == right_screen)
{
if ((right_enable || right_sonar_window) && (!left_sonar_window))
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
charcode, 0,
0,0,sx,sy);
else
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
0, 0,
0,0,sx,sy);
}
@@ -127,7 +127,7 @@ SCREEN_UPDATE( subs )
if (screen == left_screen)
{
if ((offs!=0) || (sub_enable))
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
charcode + 32 * prom_set,
0,
0,0,sx,sy,0);
@@ -138,7 +138,7 @@ SCREEN_UPDATE( subs )
if (screen == right_screen)
{
if ((offs!=1) || (sub_enable))
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
charcode + 32 * prom_set,
0,
0,0,sx,sy,0);
diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c
index 9b021b91991..78e3e5c2c5d 100644
--- a/src/mame/video/suna16.c
+++ b/src/mame/video/suna16.c
@@ -64,8 +64,8 @@ WRITE16_HANDLER( suna16_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
{
- suna16_state *state = space->machine->driver_data<suna16_state>();
- flip_screen_set(space->machine, data & 1 );
+ suna16_state *state = space->machine().driver_data<suna16_state>();
+ flip_screen_set(space->machine(), data & 1 );
state->color_bank = ( data & 4 ) >> 2;
}
if (data & ~(1|4)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
@@ -75,7 +75,7 @@ WRITE16_HANDLER( bestbest_flipscreen_w )
{
if (ACCESSING_BITS_0_7)
{
- flip_screen_set(space->machine, data & 0x10 );
+ flip_screen_set(space->machine(), data & 0x10 );
//state->color_bank = ( data & 0x07 );
}
if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(space->cpu), data);
@@ -92,25 +92,25 @@ WRITE16_HANDLER( bestbest_flipscreen_w )
VIDEO_START( suna16 )
{
- suna16_state *state = machine->driver_data<suna16_state>();
+ suna16_state *state = machine.driver_data<suna16_state>();
- state->paletteram = auto_alloc_array(machine, UINT16, machine->total_colors());
+ state->paletteram = auto_alloc_array(machine, UINT16, machine.total_colors());
}
READ16_HANDLER( suna16_paletteram16_r )
{
- suna16_state *state = space->machine->driver_data<suna16_state>();
+ suna16_state *state = space->machine().driver_data<suna16_state>();
return state->paletteram[offset + state->color_bank * 256];
}
WRITE16_HANDLER( suna16_paletteram16_w )
{
- suna16_state *state = space->machine->driver_data<suna16_state>();
+ suna16_state *state = space->machine().driver_data<suna16_state>();
offset += state->color_bank * 256;
data = COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb( space->machine, offset, pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
+ palette_set_color_rgb( space->machine(), offset, pal5bit(data >> 0),pal5bit(data >> 5),pal5bit(data >> 10));
}
@@ -122,12 +122,12 @@ WRITE16_HANDLER( suna16_paletteram16_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *sprites, int gfx)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *sprites, int gfx)
{
- suna16_state *state = machine->driver_data<suna16_state>();
+ suna16_state *state = machine.driver_data<suna16_state>();
int offs;
- int max_x = machine->primary_screen->width() - 8;
- int max_y = machine->primary_screen->height() - 8;
+ int max_x = machine.primary_screen->width() - 8;
+ int max_y = machine.primary_screen->height() - 8;
for ( offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 )
{
@@ -196,7 +196,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap, cliprect,machine->gfx[gfx],
+ drawgfx_transpen( bitmap, cliprect,machine.gfx[gfx],
(tile & 0x3fff) + bank*0x4000,
attr + (state->color_bank << 4),
tile_flipx, tile_flipy,
@@ -223,31 +223,31 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( suna16 )
{
- suna16_state *state = screen->machine->driver_data<suna16_state>();
+ suna16_state *state = screen->machine().driver_data<suna16_state>();
/* Suna Quiz indicates the background is the last pen */
bitmap_fill(bitmap,cliprect,0xff);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0);
return 0;
}
SCREEN_UPDATE( bestbest )
{
- suna16_state *state = screen->machine->driver_data<suna16_state>();
+ suna16_state *state = screen->machine().driver_data<suna16_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{ int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
/* Suna Quiz indicates the background is the last pen */
bitmap_fill(bitmap,cliprect,0xff);
- if (layers_ctrl & 1) draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0);
- if (layers_ctrl & 2) draw_sprites(screen->machine, bitmap, cliprect, state->spriteram2, 1);
+ if (layers_ctrl & 1) draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0);
+ if (layers_ctrl & 2) draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram2, 1);
return 0;
}
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index c35cc165029..87a6b272957 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -78,12 +78,12 @@
#if TILEMAPS
static TILE_GET_INFO( get_tile_info )
{
- suna8_state *state = machine->driver_data<suna8_state>();
+ suna8_state *state = machine.driver_data<suna8_state>();
UINT8 code, attr;
if (input_code_pressed(machine, KEYCODE_X))
{
- UINT8 *rom = machine->region("maincpu")->base() + 0x10000 + 0x4000 * state->trombank;
+ UINT8 *rom = machine.region("maincpu")->base() + 0x10000 + 0x4000 * state->trombank;
code = rom[ 2 * tile_index + 0 ];
attr = rom[ 2 * tile_index + 1 ];
}
@@ -103,15 +103,15 @@ static TILE_GET_INFO( get_tile_info )
READ8_HANDLER( suna8_banked_paletteram_r )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
offset += state->palettebank * 0x200;
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
READ8_HANDLER( suna8_banked_spriteram_r )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
offset += state->spritebank * 0x2000;
return state->spriteram[offset];
@@ -119,7 +119,7 @@ READ8_HANDLER( suna8_banked_spriteram_r )
WRITE8_HANDLER( suna8_spriteram_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
state->spriteram[offset] = data;
#if TILEMAPS
@@ -129,7 +129,7 @@ WRITE8_HANDLER( suna8_spriteram_w )
WRITE8_HANDLER( suna8_banked_spriteram_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
offset += state->spritebank * 0x2000;
state->spriteram[offset] = data;
@@ -143,13 +143,13 @@ WRITE8_HANDLER( suna8_banked_spriteram_w )
*/
WRITE8_HANDLER( brickzn_banked_paletteram_w )
{
- suna8_state *state = space->machine->driver_data<suna8_state>();
+ suna8_state *state = space->machine().driver_data<suna8_state>();
int r,g,b;
UINT16 rgb;
offset += state->palettebank * 0x200;
- space->machine->generic.paletteram.u8[offset] = data;
- rgb = (space->machine->generic.paletteram.u8[offset&~1] << 8) + space->machine->generic.paletteram.u8[offset|1];
+ space->machine().generic.paletteram.u8[offset] = data;
+ rgb = (space->machine().generic.paletteram.u8[offset&~1] << 8) + space->machine().generic.paletteram.u8[offset|1];
r = (((rgb & (1<<0xc))?1:0)<<0) |
(((rgb & (1<<0xb))?1:0)<<1) |
(((rgb & (1<<0xe))?1:0)<<2) |
@@ -163,19 +163,19 @@ WRITE8_HANDLER( brickzn_banked_paletteram_w )
(((rgb & (1<<0x6))?1:0)<<2) |
(((rgb & (1<<0x7))?1:0)<<3);
- palette_set_color_rgb(space->machine,offset/2,pal4bit(r),pal4bit(g),pal4bit(b));
+ palette_set_color_rgb(space->machine(),offset/2,pal4bit(r),pal4bit(g),pal4bit(b));
}
-static void suna8_vh_start_common(running_machine *machine, int dim)
+static void suna8_vh_start_common(running_machine &machine, int dim)
{
- suna8_state *state = machine->driver_data<suna8_state>();
+ suna8_state *state = machine.driver_data<suna8_state>();
state->text_dim = dim;
if (!(state->text_dim > 0))
{
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200 * 2);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x200 * 2);
state->spriteram = auto_alloc_array(machine, UINT8, 0x2000 * 2);
state->spritebank = 0;
state->palettebank = 0;
@@ -202,15 +202,15 @@ VIDEO_START( suna8_textdim12 ) { suna8_vh_start_common(machine, 12); }
***************************************************************************/
-static void draw_normal_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_normal_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- suna8_state *state = machine->driver_data<suna8_state>();
+ suna8_state *state = machine.driver_data<suna8_state>();
UINT8 *spriteram = state->spriteram;
int i;
int mx = 0; // multisprite x counter
- int max_x = machine->primary_screen->width() - 8;
- int max_y = machine->primary_screen->height() - 8;
+ int max_x = machine.primary_screen->width() - 8;
+ int max_y = machine.primary_screen->height() - 8;
for (i = 0x1d00; i < 0x2000; i += 4)
{
@@ -325,7 +325,7 @@ static void draw_normal_sprites(running_machine *machine, bitmap_t *bitmap,const
sy = max_y - sy; tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen( bitmap,cliprect,machine.gfx[0],
tile + (attr & 0x3)*0x100 + gfxbank,
((attr >> 2) & 0xf) | colorbank, // hardhea2 player2
tile_flipx, tile_flipy,
@@ -336,14 +336,14 @@ static void draw_normal_sprites(running_machine *machine, bitmap_t *bitmap,const
}
}
-static void draw_text_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_text_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- suna8_state *state = machine->driver_data<suna8_state>();
+ suna8_state *state = machine.driver_data<suna8_state>();
UINT8 *spriteram = state->spriteram;
int i;
- int max_x = machine->primary_screen->width() - 8;
- int max_y = machine->primary_screen->height() - 8;
+ int max_x = machine.primary_screen->width() - 8;
+ int max_y = machine.primary_screen->height() - 8;
/* Earlier games only */
if (!(state->text_dim > 0)) return;
@@ -393,7 +393,7 @@ static void draw_text_sprites(running_machine *machine, bitmap_t *bitmap,const r
sy = max_y - sy; flipy = !flipy;
}
- drawgfx_transpen( bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen( bitmap,cliprect,machine.gfx[0],
tile + (attr & 0x3)*0x100 + bank,
(attr >> 2) & 0xf,
flipx, flipy,
@@ -419,17 +419,17 @@ SCREEN_UPDATE( suna8 )
#ifdef MAME_DEBUG
#if TILEMAPS
- if (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X))
{
- suna8_state *state = screen->machine->driver_data<suna8_state>();
- int max_tiles = screen->machine->region("gfx1")->bytes() / (0x400 * 0x20);
+ suna8_state *state = screen->machine().driver_data<suna8_state>();
+ int max_tiles = screen->machine().region("gfx1")->bytes() / (0x400 * 0x20);
- if (input_code_pressed_once(screen->machine, KEYCODE_Q)) { state->page--; tilemap_mark_all_tiles_dirty_all(screen->machine); }
- if (input_code_pressed_once(screen->machine, KEYCODE_W)) { state->page++; tilemap_mark_all_tiles_dirty_all(screen->machine); }
- if (input_code_pressed_once(screen->machine, KEYCODE_E)) { state->tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine); }
- if (input_code_pressed_once(screen->machine, KEYCODE_R)) { state->tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine); }
- if (input_code_pressed_once(screen->machine, KEYCODE_A)) { state->trombank--; tilemap_mark_all_tiles_dirty_all(screen->machine); }
- if (input_code_pressed_once(screen->machine, KEYCODE_S)) { state->trombank++; tilemap_mark_all_tiles_dirty_all(screen->machine); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_Q)) { state->page--; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_W)) { state->page++; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_E)) { state->tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_R)) { state->tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_A)) { state->trombank--; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_S)) { state->trombank++; tilemap_mark_all_tiles_dirty_all(screen->machine()); }
state->rombank &= 0xf;
state->page &= (state->text_dim > 0)?3:7;
@@ -449,8 +449,8 @@ SCREEN_UPDATE( suna8 )
#endif
#endif
{
- draw_normal_sprites(screen->machine ,bitmap,cliprect);
- draw_text_sprites(screen->machine, bitmap,cliprect);
+ draw_normal_sprites(screen->machine() ,bitmap,cliprect);
+ draw_text_sprites(screen->machine(), bitmap,cliprect);
}
return 0;
}
diff --git a/src/mame/video/supbtime.c b/src/mame/video/supbtime.c
index 6ecf4acb452..3f1d57085e9 100644
--- a/src/mame/video/supbtime.c
+++ b/src/mame/video/supbtime.c
@@ -23,16 +23,16 @@ End sequence uses rowscroll '98 c0' on pf1 (jmp to 1d61a on supbtimj)
SCREEN_UPDATE(supbtime)
{
- supbtime_state *state = screen->machine->driver_data<supbtime_state>();
+ supbtime_state *state = screen->machine().driver_data<supbtime_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 768);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c
index 03f6122a6c7..8ffed613b02 100644
--- a/src/mame/video/superchs.c
+++ b/src/mame/video/superchs.c
@@ -4,7 +4,7 @@
VIDEO_START( superchs )
{
- superchs_state *state = machine->driver_data<superchs_state>();
+ superchs_state *state = machine.driver_data<superchs_state>();
state->spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
}
@@ -54,11 +54,11 @@ Heavy use is made of sprite zooming.
********************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
{
- superchs_state *state = machine->driver_data<superchs_state>();
+ superchs_state *state = machine.driver_data<superchs_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -165,7 +165,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -184,13 +184,13 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
@@ -201,7 +201,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
SCREEN_UPDATE( superchs )
{
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT16 priority;
static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
@@ -215,25 +215,25 @@ SCREEN_UPDATE( superchs )
layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */
layer[4] = 4; /* text layer always over bg layers */
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
/* We have to assume 2nd to bottom layer is always underneath
sprites as pdrawgfx cannot yet cope with more than 4 layers */
#ifdef MAME_DEBUG
- if (!input_code_pressed (screen->machine, KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
- if (!input_code_pressed (screen->machine, KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
- if (!input_code_pressed (screen->machine, KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
- if (!input_code_pressed (screen->machine, KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
- if (!input_code_pressed (screen->machine, KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
- if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116);
+ if (!input_code_pressed (screen->machine(), KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
+ if (!input_code_pressed (screen->machine(), KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
+ if (!input_code_pressed (screen->machine(), KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
+ if (!input_code_pressed (screen->machine(), KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
+ if (!input_code_pressed (screen->machine(), KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
+ if (!input_code_pressed (screen->machine(), KEYCODE_N)) draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116);
#else
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 48, -116);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 48, -116);
#endif
return 0;
}
diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c
index 890711bbc9a..c0e7172942d 100644
--- a/src/mame/video/superqix.c
+++ b/src/mame/video/superqix.c
@@ -20,7 +20,7 @@
static TILE_GET_INFO( pb_get_bg_tile_info )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
int attr = state->videoram[tile_index + 0x400];
int code = state->videoram[tile_index] + 256 * (attr & 0x7);
int color = (attr & 0xf0) >> 4;
@@ -29,7 +29,7 @@ static TILE_GET_INFO( pb_get_bg_tile_info )
static TILE_GET_INFO( sqix_get_bg_tile_info )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
int attr = state->videoram[tile_index + 0x400];
int bank = (attr & 0x04) ? 0 : 1;
int code = state->videoram[tile_index] + 256 * (attr & 0x03);
@@ -51,7 +51,7 @@ static TILE_GET_INFO( sqix_get_bg_tile_info )
VIDEO_START( pbillian )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
state->bg_tilemap = tilemap_create(machine, pb_get_bg_tile_info, tilemap_scan_rows, 8, 8,32,32);
/* Need to do save state here */
@@ -62,9 +62,9 @@ VIDEO_START( pbillian )
VIDEO_START( superqix )
{
- superqix_state *state = machine->driver_data<superqix_state>();
- state->fg_bitmap[0] = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
- state->fg_bitmap[1] = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
+ superqix_state *state = machine.driver_data<superqix_state>();
+ state->fg_bitmap[0] = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
+ state->fg_bitmap[1] = auto_bitmap_alloc(machine, 256, 256, machine.primary_screen->format());
state->bg_tilemap = tilemap_create(machine, sqix_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transmask(state->bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
@@ -86,14 +86,14 @@ VIDEO_START( superqix )
WRITE8_HANDLER( superqix_videoram_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset & 0x3ff);
}
WRITE8_HANDLER( superqix_bitmapram_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
if (state->bitmapram[offset] != data)
{
int x = 2 * (offset % 128);
@@ -108,7 +108,7 @@ WRITE8_HANDLER( superqix_bitmapram_w )
WRITE8_HANDLER( superqix_bitmapram2_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
if (data != state->bitmapram2[offset])
{
int x = 2 * (offset % 128);
@@ -132,18 +132,18 @@ WRITE8_HANDLER( pbillian_0410_w )
--5----- flip screen
*/
- coin_counter_w(space->machine, 0,data & 0x02);
- coin_counter_w(space->machine, 1,data & 0x04);
+ coin_counter_w(space->machine(), 0,data & 0x02);
+ coin_counter_w(space->machine(), 1,data & 0x04);
- memory_set_bank(space->machine, "bank1", (data & 0x08) >> 3);
+ memory_set_bank(space->machine(), "bank1", (data & 0x08) >> 3);
interrupt_enable_w(space,0,data & 0x10);
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
}
WRITE8_HANDLER( superqix_0410_w )
{
- superqix_state *state = space->machine->driver_data<superqix_state>();
+ superqix_state *state = space->machine().driver_data<superqix_state>();
/* bits 0-1 select the tile bank */
if (state->gfxbank != (data & 0x03))
{
@@ -158,7 +158,7 @@ WRITE8_HANDLER( superqix_0410_w )
interrupt_enable_w(space,offset,data & 0x08);
/* bits 4-5 control ROM bank */
- memory_set_bank(space->machine, "bank1", (data & 0x30) >> 4);
+ memory_set_bank(space->machine(), "bank1", (data & 0x30) >> 4);
}
@@ -169,9 +169,9 @@ WRITE8_HANDLER( superqix_0410_w )
***************************************************************************/
-static void pbillian_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void pbillian_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -189,7 +189,7 @@ static void pbillian_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
code,
color,
flip_screen_get(machine), flip_screen_get(machine),
@@ -197,9 +197,9 @@ static void pbillian_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
}
}
-static void superqix_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- superqix_state *state = machine->driver_data<superqix_state>();
+ superqix_state *state = machine.driver_data<superqix_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -221,7 +221,7 @@ static void superqix_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[2],
code,
color,
flipx, flipy,
@@ -231,22 +231,22 @@ static void superqix_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( pbillian )
{
- superqix_state *state = screen->machine->driver_data<superqix_state>();
+ superqix_state *state = screen->machine().driver_data<superqix_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- pbillian_draw_sprites(screen->machine, bitmap,cliprect);
+ pbillian_draw_sprites(screen->machine(), bitmap,cliprect);
if (state->pbillian_show_power)
{
int curr_power;
- curr_power = ((input_port_read(screen->machine, "PADDLE1") & 0x3f) * 100) / 0x3f;
+ curr_power = ((input_port_read(screen->machine(), "PADDLE1") & 0x3f) * 100) / 0x3f;
if (state->last_power[0] != curr_power)
{
popmessage ("Power %d%%", curr_power);
state->last_power[0] = curr_power;
}
- curr_power = ((input_port_read(screen->machine, "PADDLE2") & 0x3f) * 100) / 0x3f;
+ curr_power = ((input_port_read(screen->machine(), "PADDLE2") & 0x3f) * 100) / 0x3f;
if (state->last_power[1] != curr_power)
{
popmessage ("Power %d%%", curr_power);
@@ -258,10 +258,10 @@ SCREEN_UPDATE( pbillian )
SCREEN_UPDATE( superqix )
{
- superqix_state *state = screen->machine->driver_data<superqix_state>();
+ superqix_state *state = screen->machine().driver_data<superqix_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- copybitmap_trans(bitmap,state->fg_bitmap[state->show_bitmap],flip_screen_get(screen->machine),flip_screen_get(screen->machine),0,0,cliprect,0);
- superqix_draw_sprites(screen->machine, bitmap,cliprect);
+ copybitmap_trans(bitmap,state->fg_bitmap[state->show_bitmap],flip_screen_get(screen->machine()),flip_screen_get(screen->machine()),0,0,cliprect,0);
+ superqix_draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c
index 47491dfb1a5..6d5b33b99db 100644
--- a/src/mame/video/suprloco.c
+++ b/src/mame/video/suprloco.c
@@ -76,7 +76,7 @@ PALETTE_INIT( suprloco )
static TILE_GET_INFO( get_tile_info )
{
- suprloco_state *state = machine->driver_data<suprloco_state>();
+ suprloco_state *state = machine.driver_data<suprloco_state>();
UINT8 attr = state->videoram[2*tile_index+1];
SET_TILE_INFO(
0,
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( suprloco )
{
- suprloco_state *state = machine->driver_data<suprloco_state>();
+ suprloco_state *state = machine.driver_data<suprloco_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
tilemap_set_scroll_rows(state->bg_tilemap,32);
@@ -112,15 +112,15 @@ VIDEO_START( suprloco )
WRITE8_HANDLER( suprloco_videoram_w )
{
- suprloco_state *state = space->machine->driver_data<suprloco_state>();
+ suprloco_state *state = space->machine().driver_data<suprloco_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset/2);
}
WRITE8_HANDLER( suprloco_scrollram_w )
{
- suprloco_state *state = space->machine->driver_data<suprloco_state>();
- int adj = flip_screen_get(space->machine) ? -8 : 8;
+ suprloco_state *state = space->machine().driver_data<suprloco_state>();
+ int adj = flip_screen_get(space->machine()) ? -8 : 8;
state->scrollram[offset] = data;
tilemap_set_scrollx(state->bg_tilemap,offset, data - adj);
@@ -128,7 +128,7 @@ WRITE8_HANDLER( suprloco_scrollram_w )
WRITE8_HANDLER( suprloco_control_w )
{
- suprloco_state *state = space->machine->driver_data<suprloco_state>();
+ suprloco_state *state = space->machine().driver_data<suprloco_state>();
/* There is probably a palette select in here */
/* Bit 0 - coin counter A */
@@ -144,10 +144,10 @@ WRITE8_HANDLER( suprloco_control_w )
/*logerror("Bit 4 = %d\n", (data >> 4) & 1); */
}
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
state->control = data;
}
@@ -155,7 +155,7 @@ WRITE8_HANDLER( suprloco_control_w )
READ8_HANDLER( suprloco_control_r )
{
- suprloco_state *state = space->machine->driver_data<suprloco_state>();
+ suprloco_state *state = space->machine().driver_data<suprloco_state>();
return state->control;
}
@@ -179,9 +179,9 @@ INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,in
}
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int spr_number)
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int spr_number)
{
- suprloco_state *state = machine->driver_data<suprloco_state>();
+ suprloco_state *state = machine.driver_data<suprloco_state>();
int flip = flip_screen_get(machine);
int sx,sy,col,row,height,src,adjy,dy;
UINT8 *spr_reg;
@@ -211,7 +211,7 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
dy = -1;
}
- gfx2 = machine->region("gfx2")->base();
+ gfx2 = machine.region("gfx2")->base();
for (row = 0;row < height;row++,adjy+=dy)
{
int color1,color2,flipx;
@@ -254,9 +254,9 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- suprloco_state *state = machine->driver_data<suprloco_state>();
+ suprloco_state *state = machine.driver_data<suprloco_state>();
int spr_number;
UINT8 *spr_reg;
@@ -271,9 +271,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( suprloco )
{
- suprloco_state *state = screen->machine->driver_data<suprloco_state>();
+ suprloco_state *state = screen->machine().driver_data<suprloco_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,1,0);
return 0;
}
diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c
index 48fe4243b41..85a4bbff5ab 100644
--- a/src/mame/video/suprnova.c
+++ b/src/mame/video/suprnova.c
@@ -240,11 +240,11 @@ WRITE32_HANDLER ( skns_palette_ram_w )
r <<= 3;
}
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
-static void palette_set_rgb_brightness (running_machine *machine, int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b)
+static void palette_set_rgb_brightness (running_machine &machine, int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b)
{
int use_bright, r, g, b/*, alpha*/;
@@ -277,7 +277,7 @@ static void palette_set_rgb_brightness (running_machine *machine, int offset, UI
}
-static void palette_update(running_machine *machine)
+static void palette_update(running_machine &machine)
{
int i;
@@ -374,9 +374,9 @@ WRITE32_HANDLER ( skns_v3_regs_w )
VIDEO_START(skns)
{
- skns_state *state = machine->driver_data<skns_state>();
+ skns_state *state = machine.driver_data<skns_state>();
- state->spritegen = machine->device<sknsspr_device>("spritegen");
+ state->spritegen = machine.device<sknsspr_device>("spritegen");
skns_tilemap_A = tilemap_create(machine, get_tilemap_A_tile_info,tilemap_scan_rows,16,16,64, 64);
tilemap_set_transparent_pen(skns_tilemap_A,0);
@@ -392,8 +392,8 @@ VIDEO_START(skns)
tilemap_bitmap_higher = auto_bitmap_alloc(machine,320,240,BITMAP_FORMAT_INDEXED16);
tilemap_bitmapflags_higher = auto_bitmap_alloc(machine,320,240,BITMAP_FORMAT_INDEXED8);
- machine->gfx[2]->color_granularity=256;
- machine->gfx[3]->color_granularity=256;
+ machine.gfx[2]->color_granularity=256;
+ machine.gfx[3]->color_granularity=256;
}
VIDEO_RESET( skns )
@@ -471,11 +471,11 @@ static void supernova_draw_b( bitmap_t *bitmap, bitmap_t* bitmap_flags, const re
SCREEN_UPDATE(skns)
{
- skns_state *state = screen->machine->driver_data<skns_state>();
+ skns_state *state = screen->machine().driver_data<skns_state>();
- palette_update(screen->machine);
+ palette_update(screen->machine());
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
bitmap_fill(tilemap_bitmap_lower, NULL, 0);
bitmap_fill(tilemap_bitmapflags_lower, NULL, 0);
bitmap_fill(tilemap_bitmap_higher, NULL, 0);
@@ -502,7 +502,7 @@ SCREEN_UPDATE(skns)
UINT32* dst;
UINT16 pri, pri2, pri3;
UINT16 bgpri;
- const pen_t *clut = &screen->machine->pens[0];
+ const pen_t *clut = &screen->machine().pens[0];
// int drawpri;
@@ -647,7 +647,7 @@ SCREEN_UPDATE(skns)
bitmap_fill(sprite_bitmap, cliprect, 0x0000);
if (suprnova_alt_enable_sprites)
- state->spritegen->skns_draw_sprites(screen->machine, sprite_bitmap, cliprect, screen->machine->generic.spriteram.u32, screen->machine->generic.spriteram_size, screen->machine->region("gfx1")->base(), screen->machine->region ("gfx1")->bytes(), skns_spc_regs );
+ state->spritegen->skns_draw_sprites(screen->machine(), sprite_bitmap, cliprect, screen->machine().generic.spriteram.u32, screen->machine().generic.spriteram_size, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), skns_spc_regs );
return 0;
diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c
index b4bbd3d8836..ba02e0cfb1a 100644
--- a/src/mame/video/suprridr.c
+++ b/src/mame/video/suprridr.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( get_tile_info )
{
- suprridr_state *state = machine->driver_data<suprridr_state>();
+ suprridr_state *state = machine.driver_data<suprridr_state>();
UINT8 code = state->bgram[tile_index];
SET_TILE_INFO(0, code, 0, 0);
}
@@ -24,7 +24,7 @@ static TILE_GET_INFO( get_tile_info )
static TILE_GET_INFO( get_tile_info2 )
{
- suprridr_state *state = machine->driver_data<suprridr_state>();
+ suprridr_state *state = machine.driver_data<suprridr_state>();
UINT8 code = state->fgram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_tile_info2 )
VIDEO_START( suprridr )
{
- suprridr_state *state = machine->driver_data<suprridr_state>();
+ suprridr_state *state = machine.driver_data<suprridr_state>();
state->fg_tilemap = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8,8, 32,32);
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,32);
state->bg_tilemap_noscroll = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -93,44 +93,44 @@ PALETTE_INIT( suprridr )
WRITE8_HANDLER( suprridr_flipx_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
state->flipx = data & 1;
- tilemap_set_flip_all(space->machine, (state->flipx ? TILEMAP_FLIPX : 0) | (state->flipy ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip_all(space->machine(), (state->flipx ? TILEMAP_FLIPX : 0) | (state->flipy ? TILEMAP_FLIPY : 0));
}
WRITE8_HANDLER( suprridr_flipy_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
state->flipy = data & 1;
- tilemap_set_flip_all(space->machine, (state->flipx ? TILEMAP_FLIPX : 0) | (state->flipy ? TILEMAP_FLIPY : 0));
+ tilemap_set_flip_all(space->machine(), (state->flipx ? TILEMAP_FLIPX : 0) | (state->flipy ? TILEMAP_FLIPY : 0));
}
WRITE8_HANDLER( suprridr_fgdisable_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
tilemap_set_enable(state->fg_tilemap, ~data & 1);
}
WRITE8_HANDLER( suprridr_fgscrolly_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
tilemap_set_scrolly(state->fg_tilemap, 0, data);
}
WRITE8_HANDLER( suprridr_bgscrolly_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
-int suprridr_is_screen_flipped(running_machine *machine)
+int suprridr_is_screen_flipped(running_machine &machine)
{
- suprridr_state *state = machine->driver_data<suprridr_state>();
+ suprridr_state *state = machine.driver_data<suprridr_state>();
return state->flipx; /* or is it flipy? */
}
@@ -144,7 +144,7 @@ int suprridr_is_screen_flipped(running_machine *machine)
WRITE8_HANDLER( suprridr_bgram_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
tilemap_mark_tile_dirty(state->bg_tilemap_noscroll, offset);
@@ -153,7 +153,7 @@ WRITE8_HANDLER( suprridr_bgram_w )
WRITE8_HANDLER( suprridr_fgram_w )
{
- suprridr_state *state = space->machine->driver_data<suprridr_state>();
+ suprridr_state *state = space->machine().driver_data<suprridr_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
@@ -168,7 +168,7 @@ WRITE8_HANDLER( suprridr_fgram_w )
SCREEN_UPDATE( suprridr )
{
- suprridr_state *state = screen->machine->driver_data<suprridr_state>();
+ suprridr_state *state = screen->machine().driver_data<suprridr_state>();
UINT8 *spriteram = state->spriteram;
rectangle subclip;
int i;
@@ -216,7 +216,7 @@ SCREEN_UPDATE( suprridr )
fy = !fy;
y = 240 - y;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], code, color, fx, fy, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], code, color, fx, fy, x, y, 0);
}
return 0;
}
diff --git a/src/mame/video/suprslam.c b/src/mame/video/suprslam.c
index c45b71127e4..b49e5da0c7d 100644
--- a/src/mame/video/suprslam.c
+++ b/src/mame/video/suprslam.c
@@ -6,7 +6,7 @@
/* todo, fix zooming correctly, it's _not_ like aerofgt */
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* SPRITE INFO
@@ -30,8 +30,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
*/
- suprslam_state *state = machine->driver_data<suprslam_state>();
- const gfx_element *gfx = machine->gfx[1];
+ suprslam_state *state = machine.driver_data<suprslam_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT16 *source = state->spriteram;
UINT16 *source2 = state->spriteram;
UINT16 *finish = source + 0x2000/2;
@@ -99,7 +99,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
WRITE16_HANDLER( suprslam_screen_videoram_w )
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
state->screen_videoram[offset] = data;
tilemap_mark_tile_dirty(state->screen_tilemap, offset);
@@ -108,7 +108,7 @@ WRITE16_HANDLER( suprslam_screen_videoram_w )
static TILE_GET_INFO( get_suprslam_tile_info )
{
- suprslam_state *state = machine->driver_data<suprslam_state>();
+ suprslam_state *state = machine.driver_data<suprslam_state>();
int tileno = state->screen_videoram[tile_index] & 0x0fff;
int colour = state->screen_videoram[tile_index] & 0xf000;
@@ -122,7 +122,7 @@ static TILE_GET_INFO( get_suprslam_tile_info )
/* BG LAYER */
WRITE16_HANDLER( suprslam_bg_videoram_w )
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -131,7 +131,7 @@ WRITE16_HANDLER( suprslam_bg_videoram_w )
static TILE_GET_INFO( get_suprslam_bg_tile_info )
{
- suprslam_state *state = machine->driver_data<suprslam_state>();
+ suprslam_state *state = machine.driver_data<suprslam_state>();
int tileno = state->bg_videoram[tile_index] & 0x0fff;
int colour = state->bg_videoram[tile_index] & 0xf000;
@@ -144,7 +144,7 @@ static TILE_GET_INFO( get_suprslam_bg_tile_info )
VIDEO_START( suprslam )
{
- suprslam_state *state = machine->driver_data<suprslam_state>();
+ suprslam_state *state = machine.driver_data<suprslam_state>();
state->bg_tilemap = tilemap_create(machine, get_suprslam_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->screen_tilemap = tilemap_create(machine, get_suprslam_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -154,22 +154,22 @@ VIDEO_START( suprslam )
SCREEN_UPDATE( suprslam )
{
- suprslam_state *state = screen->machine->driver_data<suprslam_state>();
+ suprslam_state *state = screen->machine().driver_data<suprslam_state>();
tilemap_set_scrollx( state->screen_tilemap,0, state->screen_vregs[0x04/2] );
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
k053936_zoom_draw(state->k053936, bitmap, cliprect, state->bg_tilemap, 0, 0, 1);
if(!(state->spr_ctrl[0] & 8))
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->screen_tilemap, 0, 0);
if(state->spr_ctrl[0] & 8)
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
WRITE16_HANDLER (suprslam_bank_w)
{
- suprslam_state *state = space->machine->driver_data<suprslam_state>();
+ suprslam_state *state = space->machine().driver_data<suprslam_state>();
UINT16 old_screen_bank, old_bg_bank;
old_screen_bank = state->screen_bank;
old_bg_bank = state->bg_bank;
diff --git a/src/mame/video/surpratk.c b/src/mame/video/surpratk.c
index 2695d4d0483..1483a1f5388 100644
--- a/src/mame/video/surpratk.c
+++ b/src/mame/video/surpratk.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void surpratk_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void surpratk_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- surpratk_state *state = machine->driver_data<surpratk_state>();
+ surpratk_state *state = machine.driver_data<surpratk_state>();
*flags = (*color & 0x80) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0x60) >> 5);
@@ -23,9 +23,9 @@ void surpratk_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void surpratk_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void surpratk_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- surpratk_state *state = machine->driver_data<surpratk_state>();
+ surpratk_state *state = machine.driver_data<surpratk_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -48,7 +48,7 @@ void surpratk_sprite_callback( running_machine *machine, int *code, int *color,
SCREEN_UPDATE( surpratk )
{
- surpratk_state *state = screen->machine->driver_data<surpratk_state>();
+ surpratk_state *state = screen->machine().driver_data<surpratk_state>();
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -68,7 +68,7 @@ SCREEN_UPDATE( surpratk )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[0], 0, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[1], 0, 2);
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 7cc6ca2f96c..a91b2112370 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -106,9 +106,9 @@ static TILE_GET_INFO( tile_get_info )
*
*************************************/
-static void video_start_common(running_machine *machine, int pagecount)
+static void video_start_common(running_machine &machine, int pagecount)
{
- system1_state *state = machine->driver_data<system1_state>();
+ system1_state *state = machine.driver_data<system1_state>();
int pagenum;
/* allocate memory for the collision arrays */
@@ -161,14 +161,14 @@ VIDEO_START( system2 )
WRITE8_HANDLER( system1_videomode_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
if (data & 0x6e) logerror("videomode = %02x\n",data);
/* bit 4 is screen blank */
state->video_mode = data;
/* bit 7 is flip screen */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
@@ -181,22 +181,22 @@ if (data & 0x6e) logerror("videomode = %02x\n",data);
READ8_HANDLER( system1_mixer_collision_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
return state->mix_collide[offset & 0x3f] | 0x7e | (state->mix_collide_summary << 7);
}
WRITE8_HANDLER( system1_mixer_collision_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
state->mix_collide[offset & 0x3f] = 0;
}
WRITE8_HANDLER( system1_mixer_collision_reset_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
state->mix_collide_summary = 0;
}
@@ -210,22 +210,22 @@ WRITE8_HANDLER( system1_mixer_collision_reset_w )
READ8_HANDLER( system1_sprite_collision_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
return state->sprite_collide[offset & 0x3ff] | 0x7e | (state->sprite_collide_summary << 7);
}
WRITE8_HANDLER( system1_sprite_collision_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
state->sprite_collide[offset & 0x3ff] = 0;
}
WRITE8_HANDLER( system1_sprite_collision_reset_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
- space->machine->primary_screen->update_now();
+ system1_state *state = space->machine().driver_data<system1_state>();
+ space->machine().primary_screen->update_now();
state->sprite_collide_summary = 0;
}
@@ -254,18 +254,18 @@ INLINE void videoram_wait_states(cpu_device *cpu)
READ8_HANDLER( system1_videoram_r )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
UINT8 *videoram = state->videoram;
- videoram_wait_states(space->machine->firstcpu);
+ videoram_wait_states(space->machine().firstcpu);
offset |= 0x1000 * ((state->videoram_bank >> 1) % (state->tilemap_pages / 2));
return videoram[offset];
}
WRITE8_HANDLER( system1_videoram_w )
{
- system1_state *state = space->machine->driver_data<system1_state>();
+ system1_state *state = space->machine().driver_data<system1_state>();
UINT8 *videoram = state->videoram;
- videoram_wait_states(space->machine->firstcpu);
+ videoram_wait_states(space->machine().firstcpu);
offset |= 0x1000 * ((state->videoram_bank >> 1) % (state->tilemap_pages / 2));
videoram[offset] = data;
@@ -273,12 +273,12 @@ WRITE8_HANDLER( system1_videoram_w )
/* force a partial update if the page is changing */
if (state->tilemap_pages > 2 && offset >= 0x740 && offset < 0x748 && offset % 2 == 0)
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
}
WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
{
- system1_state *state = device->machine->driver_data<system1_state>();
+ system1_state *state = device->machine().driver_data<system1_state>();
state->videoram_bank = data;
}
@@ -292,7 +292,7 @@ WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
WRITE8_HANDLER( system1_paletteram_w )
{
- const UINT8 *color_prom = space->machine->region("palette")->base();
+ const UINT8 *color_prom = space->machine().region("palette")->base();
int val,r,g,b;
/*
@@ -316,7 +316,7 @@ WRITE8_HANDLER( system1_paletteram_w )
accurate to +/- .003K ohms.
*/
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
if (color_prom != NULL)
{
@@ -350,7 +350,7 @@ WRITE8_HANDLER( system1_paletteram_w )
b = pal2bit(data >> 6);
}
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
@@ -361,11 +361,11 @@ WRITE8_HANDLER( system1_paletteram_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xoffset)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int xoffset)
{
- system1_state *state = machine->driver_data<system1_state>();
- UINT32 gfxbanks = machine->region("sprites")->bytes() / 0x8000;
- const UINT8 *gfxbase = machine->region("sprites")->base();
+ system1_state *state = machine.driver_data<system1_state>();
+ UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000;
+ const UINT8 *gfxbase = machine.region("sprites")->base();
UINT8 *spriteram = state->spriteram;
int flipscreen = flip_screen_get(machine);
int spritenum;
@@ -487,13 +487,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static void video_update_common(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
{
- system1_state *state = screen->machine->driver_data<system1_state>();
- const UINT8 *lookup = screen->machine->region("proms")->base();
+ system1_state *state = screen->machine().driver_data<system1_state>();
+ const UINT8 *lookup = screen->machine().region("proms")->base();
int x, y;
/* first clear the sprite bitmap and draw sprites within this area */
bitmap_fill(state->sprite_bitmap, cliprect, 0);
- draw_sprites(screen->machine, state->sprite_bitmap, cliprect, spritexoffs);
+ draw_sprites(screen->machine(), state->sprite_bitmap, cliprect, spritexoffs);
/* iterate over rows */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -555,7 +555,7 @@ static void video_update_common(device_t *screen, bitmap_t *bitmap, const rectan
SCREEN_UPDATE( system1 )
{
- system1_state *state = screen->machine->driver_data<system1_state>();
+ system1_state *state = screen->machine().driver_data<system1_state>();
UINT8 *videoram = state->videoram;
bitmap_t *bgpixmaps[4], *fgpixmap;
int bgrowscroll[32];
@@ -573,7 +573,7 @@ SCREEN_UPDATE( system1 )
yscroll = videoram[0xfbd];
/* adjust for flipping */
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
xscroll = 279 - xscroll;
yscroll = 256 - yscroll;
@@ -591,7 +591,7 @@ SCREEN_UPDATE( system1 )
SCREEN_UPDATE( system2 )
{
- system1_state *state = screen->machine->driver_data<system1_state>();
+ system1_state *state = screen->machine().driver_data<system1_state>();
UINT8 *videoram = state->videoram;
bitmap_t *bgpixmaps[4], *fgpixmap;
int rowscroll[32];
@@ -609,7 +609,7 @@ SCREEN_UPDATE( system2 )
fgpixmap = tilemap_get_pixmap(state->tilemap_page[0]);
/* get scroll offsets */
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
{
xscroll = (((videoram[0x7c0] | (videoram[0x7c1] << 8)) / 2) & 0xff) - 256 + 5;
yscroll = videoram[0x7ba];
@@ -634,7 +634,7 @@ SCREEN_UPDATE( system2 )
SCREEN_UPDATE( system2_rowscroll )
{
- system1_state *state = screen->machine->driver_data<system1_state>();
+ system1_state *state = screen->machine().driver_data<system1_state>();
UINT8 *videoram = state->videoram;
bitmap_t *bgpixmaps[4], *fgpixmap;
int rowscroll[32];
@@ -651,7 +651,7 @@ SCREEN_UPDATE( system2_rowscroll )
fgpixmap = tilemap_get_pixmap(state->tilemap_page[0]);
/* get scroll offsets */
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
{
for (y = 0; y < 32; y++)
rowscroll[y] = (((videoram[0x7c0 + y * 2] | (videoram[0x7c1 + y * 2] << 8)) / 2) & 0xff) - 256 + 5;
diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c
index 9a33dba1def..40156d29b8b 100644
--- a/src/mame/video/system16.c
+++ b/src/mame/video/system16.c
@@ -30,9 +30,9 @@
#include "video/segaic16.h"
-static void setup_system16_bootleg_spritebanking( running_machine* machine )
+static void setup_system16_bootleg_spritebanking( running_machine& machine )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
if (state->spritebank_type == 1)
{
@@ -112,11 +112,11 @@ static const int resistances_sh[6] = {3900, 2000, 1000, 1000/2, 1000/4, 470};
#ifdef UNUSED_CODE
WRITE16_HANDLER( sys16_paletteram_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
UINT16 newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
/* sBGR BBBB GGGG RRRR */
/* x000 4321 4321 4321 */
@@ -153,16 +153,16 @@ WRITE16_HANDLER( sys16_paletteram_w )
//gh = combine_6_weights(state->weights[1][1], g0, g1, g2, g3, g4, 1);
//bh = combine_6_weights(state->weights[1][2], b0, b1, b2, b3, b4, 1);
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b) );
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b) );
- palette_set_color(space->machine, offset + space->machine->total_colors()/2, MAKE_RGB(rs,gs,bs));
+ palette_set_color(space->machine(), offset + space->machine().total_colors()/2, MAKE_RGB(rs,gs,bs));
}
}
#endif
-static void update_page( running_machine *machine )
+static void update_page( running_machine &machine )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int all_dirty = 0;
int i, offset;
@@ -238,7 +238,7 @@ static void update_page( running_machine *machine )
static TILE_GET_INFO( get_bg_tile_info )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
const UINT16 *source = 64 * 32 * state->bg_page[tile_index / (64 * 32)] + state->tileram;
int data = source[tile_index%(64*32)];
int tile_number = (data & 0xfff) + 0x1000 * ((data & state->tilebank_switch) ? state->tile_bank1 : state->tile_bank0);
@@ -252,7 +252,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
const UINT16 *source = 64 * 32 * state->fg_page[tile_index / (64 * 32)] + state->tileram;
int data = source[tile_index % (64 * 32)];
int tile_number = (data & 0xfff) + 0x1000 * ((data & state->tilebank_switch) ? state->tile_bank1 : state->tile_bank0);
@@ -266,7 +266,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
const UINT16 *source = 64 * 32 * state->bg2_page[tile_index / (64 * 32)] + state->tileram;
int data = source[tile_index % (64 * 32)];
int tile_number = (data & 0xfff) + 0x1000 * ((data & 0x1000) ? state->tile_bank1 : state->tile_bank0);
@@ -280,7 +280,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
static TILE_GET_INFO( get_fg2_tile_info )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
const UINT16 *source = 64 * 32 * state->fg2_page[tile_index / (64 * 32)] + state->tileram;
int data = source[tile_index % (64 * 32)];
int tile_number = (data & 0xfff) + 0x1000 * ((data & 0x1000) ? state->tile_bank1 : state->tile_bank0);
@@ -294,7 +294,7 @@ static TILE_GET_INFO( get_fg2_tile_info )
WRITE16_HANDLER( sys16_tileram_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
UINT16 oldword = state->tileram[offset];
COMBINE_DATA(&state->tileram[offset]);
@@ -333,7 +333,7 @@ WRITE16_HANDLER( sys16_tileram_w )
static TILE_GET_INFO( get_text_tile_info )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
const UINT16 *source = state->textram;
int tile_number = source[tile_index];
int pri = tile_number >> 8;
@@ -363,7 +363,7 @@ static TILE_GET_INFO( get_text_tile_info )
WRITE16_HANDLER( sys16_textram_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->textram[offset]);
tilemap_mark_tile_dirty(state->text_layer, offset);
@@ -373,7 +373,7 @@ WRITE16_HANDLER( sys16_textram_w )
VIDEO_START( system16 )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
/* Normal colors */
compute_resistor_weights(0, 255, -1.0,
@@ -442,7 +442,7 @@ VIDEO_START( system16 )
VIDEO_START( system18old )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
VIDEO_START_CALL(system16);
@@ -499,7 +499,7 @@ VIDEO_START( system18old )
static TILE_GET_INFO( get_s16a_bootleg_tile_infotxt )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int data, tile_number;
data = state->textram[tile_index];
@@ -514,7 +514,7 @@ static TILE_GET_INFO( get_s16a_bootleg_tile_infotxt )
static TILE_GET_INFO( get_s16a_bootleg_tile_info0 )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int data, tile_number;
data = state->bg0_tileram[tile_index];
@@ -530,7 +530,7 @@ static TILE_GET_INFO( get_s16a_bootleg_tile_info0 )
static TILE_GET_INFO( get_s16a_bootleg_tile_info1 )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int data, tile_number;
data = state->bg1_tileram[tile_index];
@@ -545,31 +545,31 @@ static TILE_GET_INFO( get_s16a_bootleg_tile_info1 )
WRITE16_HANDLER( s16a_bootleg_bgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->bg_scrolly = data;
}
WRITE16_HANDLER( s16a_bootleg_bgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->bg_scrollx = data;
}
WRITE16_HANDLER( s16a_bootleg_fgscrolly_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->fg_scrolly = data;
}
WRITE16_HANDLER( s16a_bootleg_fgscrollx_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
state->fg_scrollx = data;
}
WRITE16_HANDLER( s16a_bootleg_tilemapselect_w )
{
- segas1x_bootleg_state *state = space->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = space->machine().driver_data<segas1x_bootleg_state>();
COMBINE_DATA(&state->tilemapselect);
//printf("system16 bootleg tilemapselect %04x\n", state->tilemapselect);
@@ -578,7 +578,7 @@ WRITE16_HANDLER( s16a_bootleg_tilemapselect_w )
VIDEO_START( s16a_bootleg )
{
- segas1x_bootleg_state *state = machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
/* Normal colors */
compute_resistor_weights(0, 255, -1.0,
@@ -631,7 +631,7 @@ VIDEO_START( s16a_bootleg_passsht )
// Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3
SCREEN_UPDATE( s16a_bootleg )
{
- segas1x_bootleg_state *state = screen->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = screen->machine().driver_data<segas1x_bootleg_state>();
// passing shot
int offset_txtx = 192;
@@ -641,7 +641,7 @@ SCREEN_UPDATE( s16a_bootleg )
int offset_bg0x = 187;
int offset_bg0y = 0;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
tilemap_mark_all_tiles_dirty(state->bg_tilemaps[0]);
@@ -689,7 +689,7 @@ SCREEN_UPDATE( s16a_bootleg )
/* The Passing Shot 4 Player bootleg has weird scroll registers (different offsets, ^0x7 xor) */
SCREEN_UPDATE( s16a_bootleg_passht4b )
{
- segas1x_bootleg_state *state = screen->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = screen->machine().driver_data<segas1x_bootleg_state>();
// passing shot
int offset_txtx = 192;
@@ -699,7 +699,7 @@ SCREEN_UPDATE( s16a_bootleg_passht4b )
int offset_bg0x = 5;
int offset_bg0y = 32;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
tilemap_mark_all_tiles_dirty(state->bg_tilemaps[0]);
@@ -732,7 +732,7 @@ SCREEN_UPDATE( s16a_bootleg_passht4b )
SCREEN_UPDATE( system16 )
{
- segas1x_bootleg_state *state = screen->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = screen->machine().driver_data<segas1x_bootleg_state>();
if (!state->refreshenable)
{
@@ -740,9 +740,9 @@ SCREEN_UPDATE( system16 )
return 0;
}
- update_page(screen->machine);
+ update_page(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_set_scrollx(state->background, 0, -320 - state->bg_scrollx);
tilemap_set_scrolly(state->background, 0, -256 + state->bg_scrolly + state->back_yscroll);
@@ -768,7 +768,7 @@ SCREEN_UPDATE( system16 )
tilemap_draw(bitmap, cliprect, state->text_layer, 0, 0xf);
- //draw_sprites(screen->machine, bitmap, cliprect,0);
+ //draw_sprites(screen->machine(), bitmap, cliprect,0);
/* draw the sprites */
segaic16_sprites_draw(screen, bitmap, cliprect, 0);
@@ -778,17 +778,17 @@ SCREEN_UPDATE( system16 )
SCREEN_UPDATE( system18old )
{
- segas1x_bootleg_state *state = screen->machine->driver_data<segas1x_bootleg_state>();
+ segas1x_bootleg_state *state = screen->machine().driver_data<segas1x_bootleg_state>();
if (!state->refreshenable)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
- update_page(screen->machine);
+ update_page(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap,cliprect,0);
diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c
index 863ae9495c7..4bb5617bf4f 100644
--- a/src/mame/video/tagteam.c
+++ b/src/mame/video/tagteam.c
@@ -14,7 +14,7 @@ PALETTE_INIT( tagteam )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -42,21 +42,21 @@ PALETTE_INIT( tagteam )
WRITE8_HANDLER( tagteam_videoram_w )
{
- tagteam_state *state = space->machine->driver_data<tagteam_state>();
+ tagteam_state *state = space->machine().driver_data<tagteam_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( tagteam_colorram_w )
{
- tagteam_state *state = space->machine->driver_data<tagteam_state>();
+ tagteam_state *state = space->machine().driver_data<tagteam_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
READ8_HANDLER( tagteam_mirrorvideoram_r )
{
- tagteam_state *state = space->machine->driver_data<tagteam_state>();
+ tagteam_state *state = space->machine().driver_data<tagteam_state>();
int x,y;
/* swap x and y coordinates */
@@ -69,7 +69,7 @@ READ8_HANDLER( tagteam_mirrorvideoram_r )
READ8_HANDLER( tagteam_mirrorcolorram_r )
{
- tagteam_state *state = space->machine->driver_data<tagteam_state>();
+ tagteam_state *state = space->machine().driver_data<tagteam_state>();
int x,y;
/* swap x and y coordinates */
@@ -106,7 +106,7 @@ WRITE8_HANDLER( tagteam_mirrorcolorram_w )
WRITE8_HANDLER( tagteam_control_w )
{
- tagteam_state *state = space->machine->driver_data<tagteam_state>();
+ tagteam_state *state = space->machine().driver_data<tagteam_state>();
logerror("%04x: control = %02x\n",cpu_get_pc(space->cpu),data);
/* bit 7 is the palette bank */
@@ -115,16 +115,16 @@ logerror("%04x: control = %02x\n",cpu_get_pc(space->cpu),data);
WRITE8_HANDLER( tagteam_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (data &0x01))
+ if (flip_screen_get(space->machine()) != (data &0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static TILE_GET_INFO( get_bg_tile_info )
{
- tagteam_state *state = machine->driver_data<tagteam_state>();
+ tagteam_state *state = machine.driver_data<tagteam_state>();
int code = state->videoram[tile_index] + 256 * state->colorram[tile_index];
int color = state->palettebank * 2; // GUESS
@@ -133,14 +133,14 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( tagteam )
{
- tagteam_state *state = machine->driver_data<tagteam_state>();
+ tagteam_state *state = machine.driver_data<tagteam_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_flip_x,
8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tagteam_state *state = machine->driver_data<tagteam_state>();
+ tagteam_state *state = machine.driver_data<tagteam_state>();
int offs;
for (offs = 0; offs < 0x20; offs += 4)
@@ -164,7 +164,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -176,7 +176,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy += (flip_screen_get(machine) ? -256 : 256);
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -185,8 +185,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tagteam )
{
- tagteam_state *state = screen->machine->driver_data<tagteam_state>();
+ tagteam_state *state = screen->machine().driver_data<tagteam_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/tail2nos.c b/src/mame/video/tail2nos.c
index 4c9e6436af0..75c783f37f6 100644
--- a/src/mame/video/tail2nos.c
+++ b/src/mame/video/tail2nos.c
@@ -13,7 +13,7 @@
static TILE_GET_INFO( get_tile_info )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
UINT16 code = state->bgvideoram[tile_index];
SET_TILE_INFO(
0,
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_tile_info )
***************************************************************************/
-void tail2nos_zoom_callback( running_machine *machine, int *code, int *color, int *flags )
+void tail2nos_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
*code |= ((*color & 0x03) << 8);
*color = 32 + ((*color & 0x38) >> 3);
@@ -43,29 +43,29 @@ void tail2nos_zoom_callback( running_machine *machine, int *code, int *color, in
static STATE_POSTLOAD( tail2nos_postload )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
int i;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
for (i = 0; i < 0x20000; i += 64)
{
- gfx_element_mark_dirty(machine->gfx[2], i / 64);
+ gfx_element_mark_dirty(machine.gfx[2], i / 64);
}
}
VIDEO_START( tail2nos )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 15);
- state->zoomdata = (UINT16 *)machine->region("gfx3")->base();
+ state->zoomdata = (UINT16 *)machine.region("gfx3")->base();
state->save_pointer(NAME(state->zoomdata), 0x20000 / 2);
- machine->state().register_postload(tail2nos_postload, NULL);
+ machine.state().register_postload(tail2nos_postload, NULL);
}
@@ -78,7 +78,7 @@ VIDEO_START( tail2nos )
WRITE16_HANDLER( tail2nos_bgvideoram_w )
{
- tail2nos_state *state = space->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = space->machine().driver_data<tail2nos_state>();
COMBINE_DATA(&state->bgvideoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -86,23 +86,23 @@ WRITE16_HANDLER( tail2nos_bgvideoram_w )
READ16_HANDLER( tail2nos_zoomdata_r )
{
- tail2nos_state *state = space->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = space->machine().driver_data<tail2nos_state>();
return state->zoomdata[offset];
}
WRITE16_HANDLER( tail2nos_zoomdata_w )
{
- tail2nos_state *state = space->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = space->machine().driver_data<tail2nos_state>();
int oldword = state->zoomdata[offset];
COMBINE_DATA(&state->zoomdata[offset]);
if (oldword != state->zoomdata[offset])
- gfx_element_mark_dirty(space->machine->gfx[2], offset / 64);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset / 64);
}
WRITE16_HANDLER( tail2nos_gfxbank_w )
{
- tail2nos_state *state = space->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = space->machine().driver_data<tail2nos_state>();
if (ACCESSING_BITS_0_7)
{
@@ -146,9 +146,9 @@ WRITE16_HANDLER( tail2nos_gfxbank_w )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- tail2nos_state *state = machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = machine.driver_data<tail2nos_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -169,7 +169,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = spriteram[offs + 2] & 0x0800;
drawgfx_transpen(bitmap,/* placement relative to zoom layer verified on the real thing */
- cliprect,machine->gfx[1],
+ cliprect,machine.gfx[1],
code,
40 + color,
flipx,flipy,
@@ -179,12 +179,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( tail2nos )
{
- tail2nos_state *state = screen->machine->driver_data<tail2nos_state>();
+ tail2nos_state *state = screen->machine().driver_data<tail2nos_state>();
if (state->video_enable)
{
k051316_zoom_draw(state->k051316, bitmap, cliprect, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
else
diff --git a/src/mame/video/taito_b.c b/src/mame/video/taito_b.c
index a5c1c27923b..0fd38a837fe 100644
--- a/src/mame/video/taito_b.c
+++ b/src/mame/video/taito_b.c
@@ -5,7 +5,7 @@
WRITE16_HANDLER( hitice_pixelram_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
int sy = offset >> 9;
int sx = offset & 0x1ff;
@@ -21,14 +21,14 @@ WRITE16_HANDLER( hitice_pixelram_w )
WRITE16_HANDLER( hitice_pixel_scroll_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
COMBINE_DATA(&state->pixel_scroll[offset]);
}
-static void hitice_clear_pixel_bitmap( running_machine *machine )
+static void hitice_clear_pixel_bitmap( running_machine &machine )
{
int i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < 0x40000; i++)
hitice_pixelram_w(space, i, 0, 0xffff);
@@ -37,10 +37,10 @@ static void hitice_clear_pixel_bitmap( running_machine *machine )
static VIDEO_START( taitob_core )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
- state->framebuffer[0] = auto_bitmap_alloc(machine, 512, 256, machine->primary_screen->format());
- state->framebuffer[1] = auto_bitmap_alloc(machine, 512, 256, machine->primary_screen->format());
+ state->framebuffer[0] = auto_bitmap_alloc(machine, 512, 256, machine.primary_screen->format());
+ state->framebuffer[1] = auto_bitmap_alloc(machine, 512, 256, machine.primary_screen->format());
state->pixel_bitmap = NULL; /* only hitice needs this */
state->save_item(NAME(state->pixel_scroll));
@@ -56,7 +56,7 @@ VIDEO_START( taitob_color_order0 )
/*Note that in both this and color order 1 pixel_color_base/color_granularity is equal to sprites color base. Pure coincidence? */
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
state->b_sp_color_base = 0x40 * 16; /*sprites */
/* bg, fg, tx color_base are set in the tc0180vcu interface */
@@ -67,7 +67,7 @@ VIDEO_START( taitob_color_order0 )
VIDEO_START( taitob_color_order1 )
{
/* this is the reversed layout used in: Crime City, Puzzle Bobble */
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
state->b_sp_color_base = 0x80 * 16;
VIDEO_START_CALL(taitob_core);
@@ -76,7 +76,7 @@ VIDEO_START( taitob_color_order1 )
VIDEO_START( taitob_color_order2 )
{
/*this is used in: rambo3a, masterw, silentd, selfeena, ryujin */
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
state->b_sp_color_base = 0x10 * 16;
VIDEO_START_CALL(taitob_core);
@@ -85,13 +85,13 @@ VIDEO_START( taitob_color_order2 )
VIDEO_START( hitice )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
VIDEO_START_CALL(taitob_color_order0);
state->b_fg_color_base = 0x80; /* hitice also uses this for the pixel_bitmap */
- state->pixel_bitmap = auto_bitmap_alloc(machine, 1024, 512, machine->primary_screen->format());
+ state->pixel_bitmap = auto_bitmap_alloc(machine, 1024, 512, machine.primary_screen->format());
state->save_item(NAME(*state->pixel_bitmap));
}
@@ -105,7 +105,7 @@ VIDEO_RESET( hitice )
READ16_HANDLER( tc0180vcu_framebuffer_word_r )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
int sy = offset >> 8;
int sx = 2 * (offset & 0xff);
@@ -114,7 +114,7 @@ READ16_HANDLER( tc0180vcu_framebuffer_word_r )
WRITE16_HANDLER( tc0180vcu_framebuffer_word_w )
{
- taitob_state *state = space->machine->driver_data<taitob_state>();
+ taitob_state *state = space->machine().driver_data<taitob_state>();
int sy = offset >> 8;
int sx = 2 * (offset & 0xff);
@@ -125,7 +125,7 @@ WRITE16_HANDLER( tc0180vcu_framebuffer_word_w )
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/* Sprite format: (16 bytes per sprite)
offs: bits:
@@ -156,7 +156,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
000c - 000f: unused
*/
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
int x, y, xlatch = 0, ylatch = 0, x_no = 0, y_no = 0, x_num = 0, y_num = 0, big_sprite = 0;
int offs, code, color, flipx, flipy;
UINT32 data, zoomx, zoomy, zx, zy, zoomxlatch = 0, zoomylatch = 0;
@@ -234,7 +234,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if ( zoomx || zoomy )
{
- drawgfxzoom_transpen_raw(bitmap, cliprect, machine->gfx[1],
+ drawgfxzoom_transpen_raw(bitmap, cliprect, machine.gfx[1],
code,
color,
flipx,flipy,
@@ -243,7 +243,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfx_transpen_raw (bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen_raw (bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -254,9 +254,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void draw_framebuffer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_framebuffer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
rectangle myclip = *cliprect;
int x, y;
UINT8 video_control = tc0180vcu_get_videoctrl(state->tc0180vcu, 0);
@@ -361,7 +361,7 @@ g_profiler.stop();
SCREEN_UPDATE( taitob )
{
- taitob_state *state = screen->machine->driver_data<taitob_state>();
+ taitob_state *state = screen->machine().driver_data<taitob_state>();
UINT8 video_control = tc0180vcu_get_videoctrl(state->tc0180vcu, 0);
if ((video_control & 0x20) == 0)
@@ -373,7 +373,7 @@ SCREEN_UPDATE( taitob )
/* Draw playfields */
tc0180vcu_tilemap_draw(state->tc0180vcu, bitmap, cliprect, 0, 1);
- draw_framebuffer(screen->machine, bitmap, cliprect, 1);
+ draw_framebuffer(screen->machine(), bitmap, cliprect, 1);
tc0180vcu_tilemap_draw(state->tc0180vcu, bitmap, cliprect, 1, 0);
@@ -386,7 +386,7 @@ SCREEN_UPDATE( taitob )
copyscrollbitmap_trans(bitmap, state->pixel_bitmap, 1, &scrollx, 1, &scrolly, cliprect, state->b_fg_color_base * 16);
}
- draw_framebuffer(screen->machine, bitmap, cliprect, 0);
+ draw_framebuffer(screen->machine(), bitmap, cliprect, 0);
tc0180vcu_tilemap_draw(state->tc0180vcu, bitmap, cliprect, 2, 0);
@@ -397,12 +397,12 @@ SCREEN_UPDATE( taitob )
SCREEN_EOF( taitob )
{
- taitob_state *state = machine->driver_data<taitob_state>();
+ taitob_state *state = machine.driver_data<taitob_state>();
UINT8 video_control = tc0180vcu_get_videoctrl(state->tc0180vcu, 0);
UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->tc0180vcu, 0);
if (~video_control & 0x01)
- bitmap_fill(state->framebuffer[framebuffer_page], &machine->primary_screen->visible_area(), 0);
+ bitmap_fill(state->framebuffer[framebuffer_page], &machine.primary_screen->visible_area(), 0);
if (~video_control & 0x80)
{
@@ -410,5 +410,5 @@ SCREEN_EOF( taitob )
tc0180vcu_set_fb_page(state->tc0180vcu, 0, framebuffer_page);
}
- draw_sprites(machine, state->framebuffer[framebuffer_page], &machine->primary_screen->visible_area());
+ draw_sprites(machine, state->framebuffer[framebuffer_page], &machine.primary_screen->visible_area());
}
diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c
index b9f26121a48..f83ab7acb5c 100644
--- a/src/mame/video/taito_f2.c
+++ b/src/mame/video/taito_f2.c
@@ -26,10 +26,10 @@ enum
/***********************************************************************************/
-static void taitof2_core_vh_start (running_machine *machine, int sprite_type, int hide, int flip_hide )
+static void taitof2_core_vh_start (running_machine &machine, int sprite_type, int hide, int flip_hide )
{
int i;
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->sprite_type = sprite_type;
state->hide_pixels = hide;
state->flip_hide_pixels = flip_hide;
@@ -137,7 +137,7 @@ VIDEO_START( taitof2_thundfox )
VIDEO_START( taitof2_mjnquest )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
taitof2_core_vh_start(machine, 0, 0, 0);
@@ -146,7 +146,7 @@ VIDEO_START( taitof2_mjnquest )
VIDEO_START( taitof2_footchmp )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
taitof2_core_vh_start(machine, 0, 3, 3);
@@ -155,7 +155,7 @@ VIDEO_START( taitof2_footchmp )
VIDEO_START( taitof2_hthero )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
taitof2_core_vh_start(machine, 0, 3, 3);
@@ -194,7 +194,7 @@ VIDEO_START( taitof2_dinorex )
VIDEO_START( taitof2_dondokod ) /* dondokod, cameltry */
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->pivot_xdisp = -16;
state->pivot_ydisp = 0;
@@ -203,7 +203,7 @@ VIDEO_START( taitof2_dondokod ) /* dondokod, cameltry */
VIDEO_START( taitof2_pulirula )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->pivot_xdisp = -10; /* alignment seems correct (see level 2, falling */
state->pivot_ydisp = 16; /* block of ice after armour man) */
@@ -212,7 +212,7 @@ VIDEO_START( taitof2_pulirula )
VIDEO_START( taitof2_driftout )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
state->pivot_xdisp = -16;
state->pivot_ydisp = 16;
@@ -233,7 +233,7 @@ altering spritebanks of sprites while they're on screen.
WRITE16_HANDLER( taitof2_sprite_extension_w )
{
/* areas above 0x1000 cleared in some games, but not used */
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
if (offset < 0x800)
{
@@ -244,7 +244,7 @@ WRITE16_HANDLER( taitof2_sprite_extension_w )
WRITE16_HANDLER( taitof2_spritebank_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
int i = 0;
int j = 0;
@@ -274,7 +274,7 @@ WRITE16_HANDLER( taitof2_spritebank_w )
WRITE16_HANDLER( koshien_spritebank_w )
{
- taitof2_state *state = space->machine->driver_data<taitof2_state>();
+ taitof2_state *state = space->machine().driver_data<taitof2_state>();
state->spritebank_buffered[0] = 0x0000; /* never changes */
state->spritebank_buffered[1] = 0x0400;
@@ -286,13 +286,13 @@ WRITE16_HANDLER( koshien_spritebank_w )
state->spritebank_buffered[7] = state->spritebank_buffered[6] + 0x400;
}
-static void taito_f2_tc360_spritemixdraw( running_machine *machine, bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx,
+static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx,
UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
int sprite_screen_height = (scaley * gfx->height + 0x8000) >> 16;
int sprite_screen_width = (scalex * gfx->width + 0x8000) >> 16;
@@ -435,7 +435,7 @@ static void taito_f2_tc360_spritemixdraw( running_machine *machine, bitmap_t *de
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int uses_tc360_mixer )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int uses_tc360_mixer )
{
/*
Sprite format:
@@ -494,7 +494,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
non zoom parts.
*/
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
int i, x, y, off, extoffs;
int code, color, spritedata, spritecont, flipx, flipy;
int xcurrent, ycurrent, big_sprite = 0;
@@ -765,7 +765,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
sprite_ptr->code = code;
sprite_ptr->color = color;
- if (machine->gfx[0]->color_granularity == 64) /* Final Blow is 6-bit deep */
+ if (machine.gfx[0]->color_granularity == 64) /* Final Blow is 6-bit deep */
sprite_ptr->color /= 4;
sprite_ptr->flipx = flipx;
sprite_ptr->flipy = flipy;
@@ -783,7 +783,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -800,15 +800,15 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
sprite_ptr--;
if (!uses_tc360_mixer)
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
else
- taito_f2_tc360_spritemixdraw(machine, bitmap,cliprect,machine->gfx[0],
+ taito_f2_tc360_spritemixdraw(machine, bitmap,cliprect,machine.gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -818,9 +818,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
-static void update_spritebanks( running_machine *machine )
+static void update_spritebanks( running_machine &machine )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
int i;
#if 1
for (i = 0; i < 8; i ++)
@@ -837,9 +837,9 @@ static void update_spritebanks( running_machine *machine )
#endif
}
-static void taitof2_handle_sprite_buffering( running_machine *machine )
+static void taitof2_handle_sprite_buffering( running_machine &machine )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
if (state->prepare_sprites) /* no buffering */
{
@@ -848,9 +848,9 @@ static void taitof2_handle_sprite_buffering( running_machine *machine )
}
}
-static void taitof2_update_sprites_active_area( running_machine *machine )
+static void taitof2_update_sprites_active_area( running_machine &machine )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
int off;
update_spritebanks(machine);
@@ -896,7 +896,7 @@ static void taitof2_update_sprites_active_area( running_machine *machine )
SCREEN_EOF( taitof2_no_buffer )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
taitof2_update_sprites_active_area(machine);
@@ -905,7 +905,7 @@ SCREEN_EOF( taitof2_no_buffer )
SCREEN_EOF( taitof2_full_buffer_delayed )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
UINT16 *spriteram = state->spriteram;
int i;
@@ -920,7 +920,7 @@ SCREEN_EOF( taitof2_full_buffer_delayed )
SCREEN_EOF( taitof2_partial_buffer_delayed )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
UINT16 *spriteram = state->spriteram;
int i;
@@ -935,7 +935,7 @@ SCREEN_EOF( taitof2_partial_buffer_delayed )
SCREEN_EOF( taitof2_partial_buffer_delayed_thundfox )
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
UINT16 *spriteram = state->spriteram;
int i;
@@ -957,7 +957,7 @@ SCREEN_EOF( taitof2_partial_buffer_delayed_qzchikyu )
/* spriteram[2] and [3] are 1 frame behind...
probably thundfox_eof_callback would work fine */
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
UINT16 *spriteram = state->spriteram;
int i;
@@ -981,28 +981,28 @@ SCREEN_EOF( taitof2_partial_buffer_delayed_qzchikyu )
/* SSI */
SCREEN_UPDATE( taitof2_ssi )
{
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
/* SSI only uses sprites, the tilemap registers are not even initialized.
(they are in Majestic 12, but the tilemaps are not used anyway) */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0);
return 0;
}
SCREEN_UPDATE( taitof2_yesnoj )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0100scn_tilemap_update(state->tc0100scn);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->tc0100scn), 0, 0);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->tc0100scn) ^ 1, 0, 0);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, 2, 0, 0);
@@ -1012,17 +1012,17 @@ SCREEN_UPDATE( taitof2_yesnoj )
SCREEN_UPDATE( taitof2 )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0100scn_tilemap_update(state->tc0100scn);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->tc0100scn), 0, 0);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->tc0100scn) ^ 1, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 0);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, 2, 0, 0);
return 0;
}
@@ -1030,10 +1030,10 @@ SCREEN_UPDATE( taitof2 )
SCREEN_UPDATE( taitof2_pri )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
int layer[3];
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0100scn_tilemap_update(state->tc0100scn);
@@ -1051,22 +1051,22 @@ SCREEN_UPDATE( taitof2_pri )
state->spriteblendmode = tc0360pri_r(state->tc0360pri, 0) & 0xc0;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[0], 0, 1);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[1], 0, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1);
return 0;
}
-static void draw_roz_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 priority)
+static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 priority)
{
- taitof2_state *state = machine->driver_data<taitof2_state>();
+ taitof2_state *state = machine.driver_data<taitof2_state>();
if (state->tc0280grd != NULL)
tc0280grd_zoom_draw(state->tc0280grd, bitmap, cliprect, state->pivot_xdisp, state->pivot_ydisp, priority);
@@ -1077,7 +1077,7 @@ static void draw_roz_layer( running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( taitof2_pri_roz )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
int tilepri[3];
int rozpri;
int layer[3];
@@ -1085,7 +1085,7 @@ SCREEN_UPDATE( taitof2_pri_roz )
int i,j;
int roz_base_color = (tc0360pri_r(state->tc0360pri, 1) & 0x3f) << 2;
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
if (state->tc0280grd != NULL)
tc0280grd_tilemap_update(state->tc0280grd, roz_base_color);
@@ -1113,7 +1113,7 @@ SCREEN_UPDATE( taitof2_pri_roz )
state->spriteblendmode = tc0360pri_r(state->tc0360pri, 0) & 0xc0;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
drawn = 0;
@@ -1121,7 +1121,7 @@ SCREEN_UPDATE( taitof2_pri_roz )
{
if (rozpri == i)
{
- draw_roz_layer(screen->machine, bitmap, cliprect, 1 << drawn);
+ draw_roz_layer(screen->machine(), bitmap, cliprect, 1 << drawn);
state->tilepri[drawn] = i;
drawn++;
}
@@ -1137,7 +1137,7 @@ SCREEN_UPDATE( taitof2_pri_roz )
}
}
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1);
return 0;
}
@@ -1146,13 +1146,13 @@ SCREEN_UPDATE( taitof2_pri_roz )
/* Thunderfox */
SCREEN_UPDATE( taitof2_thundfox )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
int tilepri[2][3];
int spritepri[4];
int layer[2][3];
int drawn[2];
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0100scn_tilemap_update(state->tc0100scn_1);
tc0100scn_tilemap_update(state->tc0100scn_2);
@@ -1176,7 +1176,7 @@ SCREEN_UPDATE( taitof2_thundfox )
spritepri[2] = tc0360pri_r(state->tc0360pri, 7) & 0x0f;
spritepri[3] = tc0360pri_r(state->tc0360pri, 7) >> 4;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
/*
@@ -1228,7 +1228,7 @@ SCREEN_UPDATE( taitof2_thundfox )
if (spritepri[i] < tilepri[1][1]) primasks[i] |= 0xff00;
}
- draw_sprites(screen->machine, bitmap,cliprect,primasks,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,primasks,0);
}
@@ -1283,11 +1283,11 @@ and it changes these (and the sprite pri settings) a lot.
SCREEN_UPDATE( taitof2_metalb )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
UINT8 layer[5], invlayer[4];
UINT16 priority;
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0480scp_tilemap_update(state->tc0480scp);
@@ -1317,7 +1317,7 @@ SCREEN_UPDATE( taitof2_metalb )
state->spriteblendmode = tc0360pri_r(state->tc0360pri, 0) & 0xc0;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
@@ -1326,7 +1326,7 @@ SCREEN_UPDATE( taitof2_metalb )
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[3], 0, 8);
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[4], 0, 16);
- draw_sprites(screen->machine, bitmap, cliprect, NULL, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, NULL, 1);
return 0;
}
@@ -1334,13 +1334,13 @@ SCREEN_UPDATE( taitof2_metalb )
/* Deadconx, Footchmp */
SCREEN_UPDATE( taitof2_deadconx )
{
- taitof2_state *state = screen->machine->driver_data<taitof2_state>();
+ taitof2_state *state = screen->machine().driver_data<taitof2_state>();
UINT8 layer[5];
UINT8 tilepri[5];
UINT8 spritepri[4];
UINT16 priority;
- taitof2_handle_sprite_buffering(screen->machine);
+ taitof2_handle_sprite_buffering(screen->machine());
tc0480scp_tilemap_update(state->tc0480scp);
@@ -1365,7 +1365,7 @@ SCREEN_UPDATE( taitof2_deadconx )
spritepri[2] = tc0360pri_r(state->tc0360pri, 7) & 0x0f;
spritepri[3] = tc0360pri_r(state->tc0360pri, 7) >> 4;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
@@ -1385,7 +1385,7 @@ SCREEN_UPDATE( taitof2_deadconx )
if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
}
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 0);
}
/*
diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c
index be18297db36..247609d9be7 100644
--- a/src/mame/video/taito_f3.c
+++ b/src/mame/video/taito_f3.c
@@ -270,7 +270,7 @@ struct tempsprite
int pri;
};
-static void get_sprite_info(running_machine *machine, const UINT32 *spriteram32_ptr);
+static void get_sprite_info(running_machine &machine, const UINT32 *spriteram32_ptr);
struct f3_playfield_line_inf
{
@@ -321,13 +321,13 @@ pri_alp_bitmap
1111 1111 opaque pixel
*/
-static void init_alpha_blend_func(running_machine *machine);
+static void init_alpha_blend_func(running_machine &machine);
/******************************************************************************/
-static void print_debug_info(running_machine *machine, bitmap_t *bitmap)
+static void print_debug_info(running_machine &machine, bitmap_t *bitmap)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
UINT32 *f3_line_ram = state->f3_line_ram;
int l[16];
char buf[64*16];
@@ -396,12 +396,12 @@ static void print_debug_info(running_machine *machine, bitmap_t *bitmap)
l[3]=f3_line_ram[0x15e0]&0xffff;
bufptr += sprintf(bufptr,"5000: %04x %04x %04x %04x\n",l[0],l[1],l[2],l[3]);
- ui_draw_text(&machine->render().ui_container(), buf, 60, 40);
+ ui_draw_text(&machine.render().ui_container(), buf, 60, 40);
}
/******************************************************************************/
-INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT32 *gfx_base)
+INLINE void get_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index, UINT32 *gfx_base)
{
UINT32 tile=gfx_base[tile_index];
UINT8 abtype=(tile>>(16+9)) & 1;
@@ -421,31 +421,31 @@ INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int til
static TILE_GET_INFO( get_tile_info1 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
get_tile_info(machine,tileinfo,tile_index,state->f3_pf_data_1);
}
static TILE_GET_INFO( get_tile_info2 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
get_tile_info(machine,tileinfo,tile_index,state->f3_pf_data_2);
}
static TILE_GET_INFO( get_tile_info3 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
get_tile_info(machine,tileinfo,tile_index,state->f3_pf_data_3);
}
static TILE_GET_INFO( get_tile_info4 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
get_tile_info(machine,tileinfo,tile_index,state->f3_pf_data_4);
}
static TILE_GET_INFO( get_tile_info_vram )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
UINT32 *videoram = state->videoram;
int vram_tile;
int flags=0;
@@ -467,7 +467,7 @@ static TILE_GET_INFO( get_tile_info_vram )
static TILE_GET_INFO( get_tile_info_pixel )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
UINT32 *videoram = state->videoram;
int vram_tile,col_off;
int flags=0;
@@ -499,10 +499,10 @@ static TILE_GET_INFO( get_tile_info_pixel )
SCREEN_EOF( f3 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
if (state->sprite_lag==2)
{
- if (machine->video().skip_this_frame() == 0)
+ if (machine.video().skip_this_frame() == 0)
{
get_sprite_info(machine, state->spriteram32_buffered);
}
@@ -510,7 +510,7 @@ SCREEN_EOF( f3 )
}
else if (state->sprite_lag==1)
{
- if (machine->video().skip_this_frame() == 0)
+ if (machine.video().skip_this_frame() == 0)
{
get_sprite_info(machine, state->spriteram);
}
@@ -519,7 +519,7 @@ SCREEN_EOF( f3 )
VIDEO_START( f3 )
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
const struct F3config *pCFG=&f3_config_table[0];
int width, height, i;
@@ -597,12 +597,12 @@ VIDEO_START( f3 )
state->pixel_layer = tilemap_create(machine, get_tile_info_pixel,tilemap_scan_cols,8,8,64,32);
state->pf_line_inf = auto_alloc_array(machine, struct f3_playfield_line_inf, 5);
state->sa_line_inf = auto_alloc_array(machine, struct f3_spritealpha_line_inf, 1);
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->pri_alp_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED8 );
- state->tile_opaque_sp = auto_alloc_array(machine, UINT8, machine->gfx[2]->total_elements);
+ state->tile_opaque_sp = auto_alloc_array(machine, UINT8, machine.gfx[2]->total_elements);
for (i=0; i<4; i++)
- state->tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine->gfx[1]->total_elements);
+ state->tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine.gfx[1]->total_elements);
tilemap_set_transparent_pen(state->pf1_tilemap,0);
tilemap_set_transparent_pen(state->pf2_tilemap,0);
@@ -613,8 +613,8 @@ VIDEO_START( f3 )
/* Palettes have 4 bpp indexes despite up to 6 bpp data. The unused */
/* top bits in the gfx data are cleared later. */
- machine->gfx[1]->color_granularity=16;
- machine->gfx[2]->color_granularity=16;
+ machine.gfx[1]->color_granularity=16;
+ machine.gfx[2]->color_granularity=16;
state->flipscreen = 0;
memset(state->spriteram32_buffered,0,state->spriteram_size);
@@ -623,8 +623,8 @@ VIDEO_START( f3 )
state_save_register_global_array(machine, state->f3_control_0);
state_save_register_global_array(machine, state->f3_control_1);
- gfx_element_set_source(machine->gfx[0], (UINT8 *)state->f3_vram);
- gfx_element_set_source(machine->gfx[3], (UINT8 *)state->f3_pivot_ram);
+ gfx_element_set_source(machine.gfx[0], (UINT8 *)state->f3_vram);
+ gfx_element_set_source(machine.gfx[3], (UINT8 *)state->f3_pivot_ram);
state->f3_skip_this_frame=0;
@@ -633,7 +633,7 @@ VIDEO_START( f3 )
init_alpha_blend_func(machine);
{
- const gfx_element *sprite_gfx = machine->gfx[2];
+ const gfx_element *sprite_gfx = machine.gfx[2];
int c;
for (c = 0;c < sprite_gfx->total_elements;c++)
@@ -657,7 +657,7 @@ VIDEO_START( f3 )
{
- const gfx_element *pf_gfx = machine->gfx[1];
+ const gfx_element *pf_gfx = machine.gfx[1];
int c;
for (c = 0;c < pf_gfx->total_elements;c++)
@@ -692,7 +692,7 @@ VIDEO_START( f3 )
WRITE32_HANDLER( f3_pf_data_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
COMBINE_DATA(&state->f3_pf_data[offset]);
if (state->f3_game_config->extend) {
@@ -710,19 +710,19 @@ WRITE32_HANDLER( f3_pf_data_w )
WRITE32_HANDLER( f3_control_0_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
COMBINE_DATA(&state->f3_control_0[offset]);
}
WRITE32_HANDLER( f3_control_1_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
COMBINE_DATA(&state->f3_control_1[offset]);
}
WRITE32_HANDLER( f3_videoram_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
UINT32 *videoram = state->videoram;
int tile,col_off;
COMBINE_DATA(&videoram[offset]);
@@ -741,21 +741,21 @@ WRITE32_HANDLER( f3_videoram_w )
WRITE32_HANDLER( f3_vram_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
COMBINE_DATA(&state->f3_vram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[0], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/8);
}
WRITE32_HANDLER( f3_pivot_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
COMBINE_DATA(&state->f3_pivot_ram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[3], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[3], offset/8);
}
WRITE32_HANDLER( f3_lineram_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
/* DariusGX has an interesting bug at the start of Round D - the clearing of lineram
(0xa000->0x0xa7ff) overflows into priority RAM (0xb000) and creates garbage priority
values. I'm not sure what the real machine would do with these values, and this
@@ -776,52 +776,52 @@ WRITE32_HANDLER( f3_lineram_w )
WRITE32_HANDLER( f3_palette_24bit_w )
{
- taito_f3_state *state = space->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = space->machine().driver_data<taito_f3_state>();
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
/* 12 bit palette games - there has to be a palette select bit somewhere */
if (state->f3_game==SPCINVDX || state->f3_game==RIDINGF || state->f3_game==ARABIANM || state->f3_game==RINGRAGE) {
- b = 15 * ((space->machine->generic.paletteram.u32[offset] >> 4) & 0xf);
- g = 15 * ((space->machine->generic.paletteram.u32[offset] >> 8) & 0xf);
- r = 15 * ((space->machine->generic.paletteram.u32[offset] >> 12) & 0xf);
+ b = 15 * ((space->machine().generic.paletteram.u32[offset] >> 4) & 0xf);
+ g = 15 * ((space->machine().generic.paletteram.u32[offset] >> 8) & 0xf);
+ r = 15 * ((space->machine().generic.paletteram.u32[offset] >> 12) & 0xf);
}
/* This is weird - why are only the sprites and VRAM palettes 21 bit? */
else if (state->f3_game==CLEOPATR) {
if (offset<0x100 || offset>0x1000) {
- r = ((space->machine->generic.paletteram.u32[offset] >>16) & 0x7f)<<1;
- g = ((space->machine->generic.paletteram.u32[offset] >> 8) & 0x7f)<<1;
- b = ((space->machine->generic.paletteram.u32[offset] >> 0) & 0x7f)<<1;
+ r = ((space->machine().generic.paletteram.u32[offset] >>16) & 0x7f)<<1;
+ g = ((space->machine().generic.paletteram.u32[offset] >> 8) & 0x7f)<<1;
+ b = ((space->machine().generic.paletteram.u32[offset] >> 0) & 0x7f)<<1;
} else {
- r = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
}
}
/* Another weird couple - perhaps this is alpha blending related? */
else if (state->f3_game==TWINQIX || state->f3_game==RECALH) {
if (offset>0x1c00) {
- r = ((space->machine->generic.paletteram.u32[offset] >>16) & 0x7f)<<1;
- g = ((space->machine->generic.paletteram.u32[offset] >> 8) & 0x7f)<<1;
- b = ((space->machine->generic.paletteram.u32[offset] >> 0) & 0x7f)<<1;
+ r = ((space->machine().generic.paletteram.u32[offset] >>16) & 0x7f)<<1;
+ g = ((space->machine().generic.paletteram.u32[offset] >> 8) & 0x7f)<<1;
+ b = ((space->machine().generic.paletteram.u32[offset] >> 0) & 0x7f)<<1;
} else {
- r = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
}
}
/* All other games - standard 24 bit palette */
else {
- r = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- b = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
}
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
/******************************************************************************/
@@ -1141,9 +1141,9 @@ INLINE void dpix_bg(taito_f3_state *state, UINT32 bgcolor)
/******************************************************************************/
-static void init_alpha_blend_func(running_machine *machine)
+static void init_alpha_blend_func(running_machine &machine)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
int i,j;
state->dpix_n[0][0x0]=dpix_1_noalpha;
@@ -1344,15 +1344,15 @@ static void init_alpha_blend_func(running_machine *machine)
/*============================================================================*/
-INLINE void draw_scanlines(running_machine *machine,
+INLINE void draw_scanlines(running_machine &machine,
bitmap_t *bitmap,int xsize,INT16 *draw_line_num,
const struct f3_playfield_line_inf **line_t,
const int *sprite,
UINT32 orient,
int skip_layer_num)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
- const pen_t *clut = &machine->pens[0];
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
+ const pen_t *clut = &machine.pens[0];
UINT32 bgcolor=clut[0];
int length;
@@ -1472,13 +1472,13 @@ INLINE void draw_scanlines(running_machine *machine,
/******************************************************************************/
-static void visible_tile_check(running_machine *machine,
+static void visible_tile_check(running_machine &machine,
struct f3_playfield_line_inf *line_t,
int line,
UINT32 x_index_fx,UINT32 y_index,
UINT32 *f3_pf_data_n)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
UINT32 *pf_base;
int i,trans_all,tile_index,tile_num;
int alpha_type,alpha_mode;
@@ -1488,7 +1488,7 @@ static void visible_tile_check(running_machine *machine,
alpha_mode=line_t->alpha_mode[line];
if(!alpha_mode) return;
- total_elements=machine->gfx[1]->total_elements;
+ total_elements=machine.gfx[1]->total_elements;
tile_index=x_index_fx>>16;
tile_num=(((line_t->x_zoom[line]*320+(x_index_fx & 0xffff)+0xffff)>>16)+(tile_index%16)+15)/16;
@@ -1768,9 +1768,9 @@ static void get_spritealphaclip_info(taito_f3_state *state)
}
/* sx and sy are 16.16 fixed point numbers */
-static void get_line_ram_info(running_machine *machine, tilemap_t *tmap, int sx, int sy, int pos, UINT32 *f3_pf_data_n)
+static void get_line_ram_info(running_machine &machine, tilemap_t *tmap, int sx, int sy, int pos, UINT32 *f3_pf_data_n)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
struct f3_playfield_line_inf *line_t=&state->pf_line_inf[pos];
const bitmap_t *srcbitmap;
const bitmap_t *flagsbitmap;
@@ -1989,9 +1989,9 @@ static void get_line_ram_info(running_machine *machine, tilemap_t *tmap, int sx,
}
}
-static void get_vram_info(running_machine *machine, tilemap_t *vram_tilemap, tilemap_t *pixel_tilemap, int sx, int sy)
+static void get_vram_info(running_machine &machine, tilemap_t *vram_tilemap, tilemap_t *pixel_tilemap, int sx, int sy)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
const struct f3_spritealpha_line_inf *sprite_alpha_line_t=&state->sa_line_inf[0];
struct f3_playfield_line_inf *line_t=&state->pf_line_inf[4];
const bitmap_t *srcbitmap_pixel, *srcbitmap_vram;
@@ -2118,9 +2118,9 @@ static void get_vram_info(running_machine *machine, tilemap_t *vram_tilemap, til
/******************************************************************************/
-static void scanline_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void scanline_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
int i,j,y,ys,ye;
int y_start,y_end,y_start_next,y_end_next;
UINT8 draw_line[256];
@@ -2554,7 +2554,7 @@ INLINE void f3_drawgfx(
int sx,int sy,
UINT8 pri_dst)
{
- taito_f3_state *state = gfx->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = gfx->machine().driver_data<taito_f3_state>();
rectangle myclip;
pri_dst=1<<pri_dst;
@@ -2578,7 +2578,7 @@ INLINE void f3_drawgfx(
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
{
@@ -2719,7 +2719,7 @@ INLINE void f3_drawgfxzoom(
int scalex, int scaley,
UINT8 pri_dst)
{
- taito_f3_state *state = gfx->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = gfx->machine().driver_data<taito_f3_state>();
rectangle myclip;
pri_dst=1<<pri_dst;
@@ -2743,7 +2743,7 @@ INLINE void f3_drawgfxzoom(
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
{
@@ -2846,10 +2846,10 @@ INLINE void f3_drawgfxzoom(
/*zoom##p = p##_addition << 12;*/ \
}
-static void get_sprite_info(running_machine *machine, const UINT32 *spriteram32_ptr)
+static void get_sprite_info(running_machine &machine, const UINT32 *spriteram32_ptr)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
const int min_x=visarea.min_x,max_x=visarea.max_x;
const int min_y=visarea.min_y,max_y=visarea.max_y;
int offs,spritecont,flipx,flipy,/*old_x,*/color,x,y;
@@ -3114,11 +3114,11 @@ static void get_sprite_info(running_machine *machine, const UINT32 *spriteram32_
#undef CALC_ZOOM
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- taito_f3_state *state = machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = machine.driver_data<taito_f3_state>();
const struct tempsprite *sprite_ptr;
- const gfx_element *sprite_gfx = machine->gfx[2];
+ const gfx_element *sprite_gfx = machine.gfx[2];
sprite_ptr = state->sprite_end;
state->sprite_pri_usage=0;
@@ -3158,11 +3158,11 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( f3 )
{
- taito_f3_state *state = screen->machine->driver_data<taito_f3_state>();
+ taito_f3_state *state = screen->machine().driver_data<taito_f3_state>();
UINT32 sy_fix[5],sx_fix[5];
state->f3_skip_this_frame=0;
- tilemap_set_flip_all(screen->machine,state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(),state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* Setup scroll */
sy_fix[0]=((state->f3_control_0[2]&0xffff0000)>> 7) + (1<<16);
@@ -3199,25 +3199,25 @@ SCREEN_UPDATE( f3 )
/* sprites */
if (state->sprite_lag==0)
- get_sprite_info(screen->machine, state->spriteram);
+ get_sprite_info(screen->machine(), state->spriteram);
/* Update sprite buffer */
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
/* Parse sprite, alpha & clipping parts of lineram */
get_spritealphaclip_info(state);
/* Parse playfield effects */
- get_line_ram_info(screen->machine, state->pf1_tilemap,sx_fix[0],sy_fix[0],0,state->f3_pf_data_1);
- get_line_ram_info(screen->machine, state->pf2_tilemap,sx_fix[1],sy_fix[1],1,state->f3_pf_data_2);
- get_line_ram_info(screen->machine, state->pf3_tilemap,sx_fix[2],sy_fix[2],2,state->f3_pf_data_3);
- get_line_ram_info(screen->machine, state->pf4_tilemap,sx_fix[3],sy_fix[3],3,state->f3_pf_data_4);
- get_vram_info(screen->machine, state->vram_layer,state->pixel_layer,sx_fix[4],sy_fix[4]);
+ get_line_ram_info(screen->machine(), state->pf1_tilemap,sx_fix[0],sy_fix[0],0,state->f3_pf_data_1);
+ get_line_ram_info(screen->machine(), state->pf2_tilemap,sx_fix[1],sy_fix[1],1,state->f3_pf_data_2);
+ get_line_ram_info(screen->machine(), state->pf3_tilemap,sx_fix[2],sy_fix[2],2,state->f3_pf_data_3);
+ get_line_ram_info(screen->machine(), state->pf4_tilemap,sx_fix[3],sy_fix[3],3,state->f3_pf_data_4);
+ get_vram_info(screen->machine(), state->vram_layer,state->pixel_layer,sx_fix[4],sy_fix[4]);
/* Draw final framebuffer */
- scanline_draw(screen->machine, bitmap,cliprect);
+ scanline_draw(screen->machine(), bitmap,cliprect);
if (VERBOSE)
- print_debug_info(screen->machine, bitmap);
+ print_debug_info(screen->machine(), bitmap);
return 0;
}
diff --git a/src/mame/video/taito_h.c b/src/mame/video/taito_h.c
index 1e23ccf2fdf..0367b3cb03b 100644
--- a/src/mame/video/taito_h.c
+++ b/src/mame/video/taito_h.c
@@ -70,12 +70,12 @@ static const int zoomy_conv_table[] =
Screen refresh
***************************************************************************/
-static void syvalion_draw_sprites( running_machine *machine,bitmap_t *bitmap, const rectangle *cliprect )
+static void syvalion_draw_sprites( running_machine &machine,bitmap_t *bitmap, const rectangle *cliprect )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
- taitoh_state *state = machine->driver_data<taitoh_state>();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, ex, zx;
int ysize;
@@ -146,7 +146,7 @@ static void syvalion_draw_sprites( running_machine *machine,bitmap_t *bitmap, co
}
drawgfxzoom_transpen( bitmap, cliprect,
- machine -> gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -163,12 +163,12 @@ static void syvalion_draw_sprites( running_machine *machine,bitmap_t *bitmap, co
}
}
-static void recordbr_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void recordbr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
- taitoh_state *state = machine->driver_data<taitoh_state>();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
int ysize;
@@ -258,7 +258,7 @@ static void recordbr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
drawgfxzoom_transpen( bitmap, cliprect,
- machine -> gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -275,12 +275,12 @@ static void recordbr_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void dleague_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void dleague_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
- taitoh_state *state = machine->driver_data<taitoh_state>();
+ taitoh_state *state = machine.driver_data<taitoh_state>();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, ex, zx;
int ysize;
@@ -360,7 +360,7 @@ static void dleague_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
}
drawgfxzoom_transpen( bitmap, cliprect,
- machine -> gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -380,7 +380,7 @@ static void dleague_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
-static void taitoh_log_vram(running_machine *machine)
+static void taitoh_log_vram(running_machine &machine)
{
#ifdef MAME_DEBUG
// null function: the necessary pointers are now internal to taitoic.c
@@ -393,17 +393,17 @@ static void taitoh_log_vram(running_machine *machine)
SCREEN_UPDATE( syvalion )
{
- taitoh_state *state = screen->machine->driver_data<taitoh_state>();
+ taitoh_state *state = screen->machine().driver_data<taitoh_state>();
tc0080vco_tilemap_update(state->tc0080vco);
- taitoh_log_vram(screen->machine);
+ taitoh_log_vram(screen->machine());
bitmap_fill(bitmap, cliprect, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- syvalion_draw_sprites(screen->machine, bitmap,cliprect);
+ syvalion_draw_sprites(screen->machine(), bitmap,cliprect);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 2, 0, 0);
return 0;
@@ -412,28 +412,28 @@ SCREEN_UPDATE( syvalion )
SCREEN_UPDATE( recordbr )
{
- taitoh_state *state = screen->machine->driver_data<taitoh_state>();
+ taitoh_state *state = screen->machine().driver_data<taitoh_state>();
tc0080vco_tilemap_update(state->tc0080vco);
- taitoh_log_vram(screen->machine);
+ taitoh_log_vram(screen->machine());
bitmap_fill(bitmap, cliprect, 0);
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_A))
+ if (!input_code_pressed(screen->machine(), KEYCODE_A))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_S))
- recordbr_draw_sprites(screen->machine, bitmap, cliprect, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_D))
+ if (!input_code_pressed(screen->machine(), KEYCODE_S))
+ recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_D))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_F))
- recordbr_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ if (!input_code_pressed(screen->machine(), KEYCODE_F))
+ recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 1);
#else
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- recordbr_draw_sprites(screen->machine, bitmap, cliprect, 0);
+ recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- recordbr_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ recordbr_draw_sprites(screen->machine(), bitmap, cliprect, 1);
#endif
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 2, 0, 0);
@@ -443,28 +443,28 @@ SCREEN_UPDATE( recordbr )
SCREEN_UPDATE( dleague )
{
- taitoh_state *state = screen->machine->driver_data<taitoh_state>();
+ taitoh_state *state = screen->machine().driver_data<taitoh_state>();
tc0080vco_tilemap_update(state->tc0080vco);
- taitoh_log_vram(screen->machine);
+ taitoh_log_vram(screen->machine());
bitmap_fill(bitmap, cliprect, 0);
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_A))
+ if (!input_code_pressed(screen->machine(), KEYCODE_A))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_S))
- dleague_draw_sprites(screen->machine, bitmap, cliprect, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_D))
+ if (!input_code_pressed(screen->machine(), KEYCODE_S))
+ dleague_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_D))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_F))
- dleague_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ if (!input_code_pressed(screen->machine(), KEYCODE_F))
+ dleague_draw_sprites(screen->machine(), bitmap, cliprect, 1);
#else
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- dleague_draw_sprites (screen->machine, bitmap, cliprect, 0);
+ dleague_draw_sprites (screen->machine(), bitmap, cliprect, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- dleague_draw_sprites (screen->machine, bitmap, cliprect, 1);
+ dleague_draw_sprites (screen->machine(), bitmap, cliprect, 1);
#endif
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 2, 0, 0);
diff --git a/src/mame/video/taito_l.c b/src/mame/video/taito_l.c
index 1e4173a9e37..c9efd54079c 100644
--- a/src/mame/video/taito_l.c
+++ b/src/mame/video/taito_l.c
@@ -9,7 +9,7 @@
static TILE_GET_INFO( get_bg18_tile_info )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int attr = state->rambanks[2 * tile_index + 0x8000 + 1];
int code = state->rambanks[2 * tile_index + 0x8000]
| ((attr & 0x03) << 8)
@@ -25,7 +25,7 @@ static TILE_GET_INFO( get_bg18_tile_info )
static TILE_GET_INFO( get_bg19_tile_info )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int attr = state->rambanks[2 * tile_index + 0x9000 + 1];
int code = state->rambanks[2 * tile_index + 0x9000]
| ((attr & 0x03) << 8)
@@ -41,7 +41,7 @@ static TILE_GET_INFO( get_bg19_tile_info )
static TILE_GET_INFO( get_ch1a_tile_info )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int attr = state->rambanks[2 * tile_index + 0xa000 + 1];
int code = state->rambanks[2 * tile_index + 0xa000] | ((attr & 0x01) << 8) | ((attr & 0x04) << 7);
@@ -62,7 +62,7 @@ static TILE_GET_INFO( get_ch1a_tile_info )
VIDEO_START( taitol )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int i;
state->bg18_tilemap = tilemap_create(machine, get_bg18_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -90,7 +90,7 @@ VIDEO_START( taitol )
WRITE8_HANDLER( horshoes_bankg_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
if (state->horshoes_gfxbank != data)
{
@@ -103,7 +103,7 @@ WRITE8_HANDLER( horshoes_bankg_w )
WRITE8_HANDLER( taitol_bankc_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
if (state->bankc[offset] != data)
{
@@ -117,14 +117,14 @@ WRITE8_HANDLER( taitol_bankc_w )
READ8_HANDLER( taitol_bankc_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
return state->bankc[offset];
}
WRITE8_HANDLER( taitol_control_w )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
// logerror("Control Write %02x (%04x)\n", data, cpu_get_pc(space->cpu));
@@ -139,78 +139,78 @@ WRITE8_HANDLER( taitol_control_w )
/* bit 4 flip screen */
state->flipscreen = data & 0x10;
- tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(space->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* bit 5 display enable - handled in vh_screenrefresh() */
}
READ8_HANDLER( taitol_control_r )
{
- taitol_state *state = space->machine->driver_data<taitol_state>();
+ taitol_state *state = space->machine().driver_data<taitol_state>();
// logerror("Control Read %02x (%04x)\n", cur_ctrl, cpu_get_pc(space->cpu));
return state->cur_ctrl;
}
-void taitol_chardef14_m( running_machine *machine, int offset )
+void taitol_chardef14_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 0);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 0);
}
-void taitol_chardef15_m( running_machine *machine, int offset )
+void taitol_chardef15_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 128);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 128);
}
-void taitol_chardef16_m( running_machine *machine, int offset )
+void taitol_chardef16_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 256);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 256);
}
-void taitol_chardef17_m( running_machine *machine, int offset )
+void taitol_chardef17_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 384);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 384);
}
-void taitol_chardef1c_m( running_machine *machine, int offset )
+void taitol_chardef1c_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 512);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 512);
}
-void taitol_chardef1d_m( running_machine *machine, int offset )
+void taitol_chardef1d_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 640);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 640);
}
-void taitol_chardef1e_m( running_machine *machine, int offset )
+void taitol_chardef1e_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 768);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 768);
}
-void taitol_chardef1f_m( running_machine *machine, int offset )
+void taitol_chardef1f_m( running_machine &machine, int offset )
{
- gfx_element_mark_dirty(machine->gfx[2], offset / 32 + 896);
+ gfx_element_mark_dirty(machine.gfx[2], offset / 32 + 896);
}
-void taitol_bg18_m( running_machine *machine, int offset )
+void taitol_bg18_m( running_machine &machine, int offset )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
tilemap_mark_tile_dirty(state->bg18_tilemap, offset / 2);
}
-void taitol_bg19_m( running_machine *machine, int offset )
+void taitol_bg19_m( running_machine &machine, int offset )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
tilemap_mark_tile_dirty(state->bg19_tilemap, offset / 2);
}
-void taitol_char1a_m( running_machine *machine, int offset )
+void taitol_char1a_m( running_machine &machine, int offset )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
tilemap_mark_tile_dirty(state->ch1a_tilemap, offset / 2);
}
-void taitol_obj1b_m( running_machine *machine, int offset )
+void taitol_obj1b_m( running_machine &machine, int offset )
{
#if 0
if (offset >= 0x3f0 && offset <= 0x3ff)
@@ -243,9 +243,9 @@ void taitol_obj1b_m( running_machine *machine, int offset )
plgirs2 bullets and raimais big bosses.
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
int offs;
/* at spriteram + 0x3f0 and 03f8 are the tilemap control registers; spriteram + 0x3e8 seems to be unused */
@@ -273,12 +273,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
(color & 0x08) ? 0xaa : 0x00,0);
}
}
@@ -286,7 +286,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( taitol )
{
- taitol_state *state = screen->machine->driver_data<taitol_state>();
+ taitol_state *state = screen->machine().driver_data<taitol_state>();
int dx, dy;
dx = state->rambanks[0xb3f4] | (state->rambanks[0xb3f5] << 8);
@@ -307,7 +307,7 @@ SCREEN_UPDATE( taitol )
if (state->cur_ctrl & 0x20) /* display enable */
{
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg19_tilemap, 0, 0);
@@ -316,12 +316,12 @@ SCREEN_UPDATE( taitol )
else /* split priority */
tilemap_draw(bitmap, cliprect, state->bg18_tilemap,0,1);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->ch1a_tilemap, 0, 0);
}
else
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]);
return 0;
}
@@ -329,7 +329,7 @@ SCREEN_UPDATE( taitol )
SCREEN_EOF( taitol )
{
- taitol_state *state = machine->driver_data<taitol_state>();
+ taitol_state *state = machine.driver_data<taitol_state>();
UINT8 *spriteram = state->rambanks + 0xb000;
memcpy(state->buff_spriteram, spriteram, TAITOL_SPRITERAM_SIZE);
diff --git a/src/mame/video/taito_o.c b/src/mame/video/taito_o.c
index f8882c4b029..7a3303bafe3 100644
--- a/src/mame/video/taito_o.c
+++ b/src/mame/video/taito_o.c
@@ -25,12 +25,12 @@ static const int zoomy_conv_table[] =
};
-static void parentj_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
- taitoo_state *state = machine->driver_data<taitoo_state>();
+ taitoo_state *state = machine.driver_data<taitoo_state>();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
int ysize;
@@ -120,7 +120,7 @@ static void parentj_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
}
drawgfxzoom_transpen( bitmap, cliprect,
- machine -> gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -140,7 +140,7 @@ static void parentj_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( parentj )
{
- taitoo_state *state = screen->machine->driver_data<taitoo_state>();
+ taitoo_state *state = screen->machine().driver_data<taitoo_state>();
tc0080vco_tilemap_update(state->tc0080vco);
@@ -148,8 +148,8 @@ SCREEN_UPDATE( parentj )
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
- parentj_draw_sprites(screen->machine, bitmap, cliprect, 0);
- parentj_draw_sprites(screen->machine, bitmap, cliprect, 1);
+ parentj_draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ parentj_draw_sprites(screen->machine(), bitmap, cliprect, 1);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 2, 0, 0);
diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c
index 8dd237e9a75..55355ed8db5 100644
--- a/src/mame/video/taito_z.c
+++ b/src/mame/video/taito_z.c
@@ -6,7 +6,7 @@
VIDEO_START( taitoz )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
state->road_palbank = 3;
state->sci_spriteframe = 0;
@@ -21,13 +21,13 @@ VIDEO_START( taitoz )
READ16_HANDLER( sci_spriteframe_r )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
return (state->sci_spriteframe << 8);
}
WRITE16_HANDLER( sci_spriteframe_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
state->sci_spriteframe = (data >> 8) & 0xff;
}
@@ -146,10 +146,10 @@ confirmed
********************************************************/
-static void contcirc_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -226,12 +226,12 @@ static void contcirc_draw_sprites_16x8( running_machine *machine, bitmap_t *bitm
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
- zx<<12,zy<<13,machine->priority_bitmap,primasks[priority],0);
+ zx<<12,zy<<13,machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -241,10 +241,10 @@ static void contcirc_draw_sprites_16x8( running_machine *machine, bitmap_t *bitm
-static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -324,13 +324,13 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<12,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
}
else if ((zoomx - 1) & 0x20) /* 64x128 sprites, $40000-$5ffff in spritemap rom, OBJB */
@@ -367,13 +367,13 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<12,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
}
else if (!((zoomx - 1) & 0x60)) /* 32x128 sprites, $60000-$7ffff in spritemap rom, OBJB */
@@ -410,13 +410,13 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[2],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<12,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
}
@@ -427,10 +427,10 @@ static void chasehq_draw_sprites_16x16( running_machine *machine, bitmap_t *bitm
-static void bshark_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -507,13 +507,13 @@ static void bshark_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<13,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -523,10 +523,10 @@ static void bshark_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap
-static void sci_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void sci_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, start_offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -612,13 +612,13 @@ static void sci_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, c
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<13,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -628,10 +628,10 @@ static void sci_draw_sprites_16x8( running_machine *machine, bitmap_t *bitmap, c
-static void aquajack_draw_sprites_16x8(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
+static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -707,13 +707,13 @@ static void aquajack_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<13,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -723,10 +723,10 @@ static void aquajack_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
-static void spacegun_draw_sprites_16x8(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
+static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
{
- taitoz_state *state = machine->driver_data<taitoz_state>();
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ taitoz_state *state = machine.driver_data<taitoz_state>();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
UINT16 *spriteram = state->spriteram;
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, curx, cury;
@@ -802,13 +802,13 @@ static void spacegun_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
flipy = !flipy;
}
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<13,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -823,7 +823,7 @@ static void spacegun_draw_sprites_16x8(running_machine *machine, bitmap_t *bitma
WRITE16_HANDLER( contcirc_out_w )
{
- taitoz_state *state = space->machine->driver_data<taitoz_state>();
+ taitoz_state *state = space->machine().driver_data<taitoz_state>();
if (ACCESSING_BITS_0_7)
{
@@ -844,7 +844,7 @@ WRITE16_HANDLER( contcirc_out_w )
SCREEN_UPDATE( contcirc )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -853,7 +853,7 @@ SCREEN_UPDATE( contcirc )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(bitmap, cliprect, 0);
@@ -862,7 +862,7 @@ SCREEN_UPDATE( contcirc )
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -3, state->road_palbank << 6, 1, 0, 1, 2); // -6
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- contcirc_draw_sprites_16x8(screen->machine, bitmap, cliprect, 5); // 7
+ contcirc_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 5); // 7
return 0;
}
@@ -871,7 +871,7 @@ SCREEN_UPDATE( contcirc )
SCREEN_UPDATE( chasehq )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -880,7 +880,7 @@ SCREEN_UPDATE( chasehq )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -890,14 +890,14 @@ SCREEN_UPDATE( chasehq )
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- chasehq_draw_sprites_16x16(screen->machine, bitmap, cliprect, 7);
+ chasehq_draw_sprites_16x16(screen->machine(), bitmap, cliprect, 7);
return 0;
}
SCREEN_UPDATE( bshark )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -906,7 +906,7 @@ SCREEN_UPDATE( bshark )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -916,14 +916,14 @@ SCREEN_UPDATE( bshark )
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 1, 1, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- bshark_draw_sprites_16x8(screen->machine, bitmap, cliprect, 8);
+ bshark_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 8);
return 0;
}
SCREEN_UPDATE( sci )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -932,7 +932,7 @@ SCREEN_UPDATE( sci )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -942,14 +942,14 @@ SCREEN_UPDATE( sci )
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- sci_draw_sprites_16x8(screen->machine, bitmap, cliprect, 6);
+ sci_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 6);
return 0;
}
SCREEN_UPDATE( aquajack )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -958,7 +958,7 @@ SCREEN_UPDATE( aquajack )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -968,14 +968,14 @@ SCREEN_UPDATE( aquajack )
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -1, 0, 2, 1, 1, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- aquajack_draw_sprites_16x8(screen->machine, bitmap, cliprect, 3);
+ aquajack_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 3);
return 0;
}
SCREEN_UPDATE( spacegun )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[3];
tc0100scn_tilemap_update(state->tc0100scn);
@@ -984,7 +984,7 @@ SCREEN_UPDATE( spacegun )
layer[1] = layer[0] ^ 1;
layer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked even when bottom layer not drawn due to disable bit */
bitmap_fill(bitmap, cliprect, 0);
@@ -993,7 +993,7 @@ SCREEN_UPDATE( spacegun )
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[1], 0, 2);
tc0100scn_tilemap_draw(state->tc0100scn, bitmap, cliprect, layer[2], 0, 4);
- spacegun_draw_sprites_16x8(screen->machine, bitmap, cliprect, 4);
+ spacegun_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 4);
return 0;
}
@@ -1001,7 +1001,7 @@ SCREEN_UPDATE( spacegun )
SCREEN_UPDATE( dblaxle )
{
- taitoz_state *state = screen->machine->driver_data<taitoz_state>();
+ taitoz_state *state = screen->machine().driver_data<taitoz_state>();
UINT8 layer[5];
UINT16 priority;
@@ -1015,7 +1015,7 @@ SCREEN_UPDATE( dblaxle )
layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */
layer[4] = 4; /* text layer always over bg layers */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* Ensure screen blanked - this shouldn't be necessary! */
bitmap_fill(bitmap, cliprect, 0);
@@ -1025,7 +1025,7 @@ SCREEN_UPDATE( dblaxle )
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[2], 0, 1);
tc0150rod_draw(state->tc0150rod, bitmap, cliprect, -1, 0xc0, 0, 0, 1, 2);
- bshark_draw_sprites_16x8(screen->machine, bitmap, cliprect, 7);
+ bshark_draw_sprites_16x8(screen->machine(), bitmap, cliprect, 7);
/* This layer used for the big numeric displays */
tc0480scp_tilemap_draw(state->tc0480scp, bitmap, cliprect, layer[3], 0, 4);
diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c
index 2f83eeb638c..75259fe2b1f 100644
--- a/src/mame/video/taitoair.c
+++ b/src/mame/video/taitoair.c
@@ -69,12 +69,12 @@ static const int zoomy_conv_table[] =
Screen refresh
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
- taitoair_state *state = machine->driver_data<taitoair_state>();
+ taitoair_state *state = machine.driver_data<taitoair_state>();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
int ysize;
@@ -164,7 +164,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfxzoom_transpen( bitmap, cliprect,
- machine -> gfx[0],
+ machine.gfx[0],
tile,
color,
flipx, flipy,
@@ -343,26 +343,26 @@ static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct
SCREEN_UPDATE( taitoair )
{
- taitoair_state *state = screen->machine->driver_data<taitoair_state>();
+ taitoair_state *state = screen->machine().driver_data<taitoair_state>();
tc0080vco_tilemap_update(state->tc0080vco);
bitmap_fill(bitmap, cliprect, 0x41);
#ifdef MAME_DEBUG
- if (!input_code_pressed(screen->machine, KEYCODE_A))
+ if (!input_code_pressed(screen->machine(), KEYCODE_A))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, 0, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_S))
- draw_sprites(screen->machine, bitmap, cliprect, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_D))
+ if (!input_code_pressed(screen->machine(), KEYCODE_S))
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
+ if (!input_code_pressed(screen->machine(), KEYCODE_D))
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- if (!input_code_pressed(screen->machine, KEYCODE_F))
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ if (!input_code_pressed(screen->machine(), KEYCODE_F))
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
#else
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 0, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 1, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
#endif
tc0080vco_tilemap_draw(state->tc0080vco, bitmap, cliprect, 2, 0, 0);
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index 1d06d7e6014..75453d84fb6 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -917,7 +917,7 @@ static void topspeed_custom_draw( device_t *device, bitmap_t *bitmap, const rect
}
}
- taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine->priority_bitmap, priority);
+ taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine().priority_bitmap, priority);
y_index++;
if (!machine_flip)
@@ -1012,7 +1012,7 @@ static DEVICE_START( pc080sn )
tilemap_set_scroll_rows(pc080sn->tilemap[1], 512);
}
- pc080sn->ram = auto_alloc_array_clear(device->machine, UINT16, PC080SN_RAM_SIZE / 2);
+ pc080sn->ram = auto_alloc_array_clear(device->machine(), UINT16, PC080SN_RAM_SIZE / 2);
pc080sn->bg_ram[0] = pc080sn->ram + 0x0000 /2;
pc080sn->bg_ram[1] = pc080sn->ram + 0x8000 /2;
@@ -1021,7 +1021,7 @@ static DEVICE_START( pc080sn )
device->save_pointer(NAME(pc080sn->ram), PC080SN_RAM_SIZE / 2);
device->save_item(NAME(pc080sn->ctrl));
- device->machine->state().register_postload(pc080sn_restore_scroll, pc080sn);
+ device->machine().state().register_postload(pc080sn_restore_scroll, pc080sn);
}
@@ -1173,12 +1173,12 @@ void pc090oj_draw_sprites( device_t *device, bitmap_t *bitmap, const rectangle *
x += pc090oj->xoffs;
y += pc090oj->yoffs;
- pdrawgfx_transpen(bitmap,cliprect,device->machine->gfx[pc090oj->gfxnum],
+ pdrawgfx_transpen(bitmap,cliprect,device->machine().gfx[pc090oj->gfxnum],
code,
color,
flipx,flipy,
x,y,
- device->machine->priority_bitmap,
+ device->machine().priority_bitmap,
priority ? 0xfc : 0xf0,0);
}
}
@@ -1202,8 +1202,8 @@ static DEVICE_START( pc090oj )
pc090oj->buffer = intf->use_buffer;
- pc090oj->ram = auto_alloc_array_clear(device->machine, UINT16, PC090OJ_RAM_SIZE / 2);
- pc090oj->ram_buffered = auto_alloc_array_clear(device->machine, UINT16, PC090OJ_RAM_SIZE / 2);
+ pc090oj->ram = auto_alloc_array_clear(device->machine(), UINT16, PC090OJ_RAM_SIZE / 2);
+ pc090oj->ram_buffered = auto_alloc_array_clear(device->machine(), UINT16, PC090OJ_RAM_SIZE / 2);
device->save_pointer(NAME(pc090oj->ram), PC090OJ_RAM_SIZE / 2);
device->save_pointer(NAME(pc090oj->ram_buffered), PC090OJ_RAM_SIZE / 2);
@@ -1440,7 +1440,7 @@ WRITE16_DEVICE_HANDLER( tc0080vco_word_w )
if (offset < 0x1000 / 2)
{
- gfx_element_mark_dirty(device->machine->gfx[tc0080vco->tx_gfx], offset / 8);
+ gfx_element_mark_dirty(device->machine().gfx[tc0080vco->tx_gfx], offset / 8);
#if 0
if (!tc0080vco->has_tx)
{
@@ -1471,7 +1471,7 @@ WRITE16_DEVICE_HANDLER( tc0080vco_word_w )
else if (offset < 0x11000 / 2)
{
- gfx_element_mark_dirty(device->machine->gfx[tc0080vco->tx_gfx], (offset - 0x10000 / 2) / 8);
+ gfx_element_mark_dirty(device->machine().gfx[tc0080vco->tx_gfx], (offset - 0x10000 / 2) / 8);
#if 0
if (!tc0080vco->has_tx)
{
@@ -1656,7 +1656,7 @@ static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_t *bitmap, cons
}
}
- taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, device->machine->priority_bitmap, priority);
+ taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, device->machine().priority_bitmap, priority);
y_index += zoomy;
@@ -1757,7 +1757,7 @@ static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_t *bitmap, cons
INT32 incyy = zy;
int wraparound = 0;
UINT32 privalue = priority;
- bitmap_t *priority = device->machine->priority_bitmap;
+ bitmap_t *priority = device->machine().priority_bitmap;
if (dest->bpp == 16)
COPYROZBITMAP_CORE(UINT16, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, UINT8);
@@ -1885,7 +1885,7 @@ static DEVICE_START( tc0080vco )
tilemap_set_transparent_pen(tc0080vco->tilemap[2], 0);
- tc0080vco->ram = auto_alloc_array_clear(device->machine, UINT16, TC0080VCO_RAM_SIZE / 2);
+ tc0080vco->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0080VCO_RAM_SIZE / 2);
tc0080vco->char_ram = tc0080vco->ram + 0x00000 / 2; /* continues at +0x10000 */
tc0080vco->tx_ram_0 = tc0080vco->ram + 0x01000 / 2;
@@ -1904,10 +1904,10 @@ static DEVICE_START( tc0080vco )
tc0080vco->scroll_ram = tc0080vco->ram + 0x20800 / 2;
/* create the char set (gfx will then be updated dynamically from RAM) */
- device->machine->gfx[tc0080vco->tx_gfx] = gfx_element_alloc(device->machine, &tc0080vco_charlayout, (UINT8 *)tc0080vco->char_ram, 64, 0);
+ device->machine().gfx[tc0080vco->tx_gfx] = gfx_element_alloc(device->machine(), &tc0080vco_charlayout, (UINT8 *)tc0080vco->char_ram, 64, 0);
device->save_pointer(NAME(tc0080vco->ram), TC0080VCO_RAM_SIZE / 2);
- device->machine->state().register_postload(tc0080vco_postload, tc0080vco);
+ device->machine().state().register_postload(tc0080vco_postload, tc0080vco);
}
/***************************************************************************/
@@ -2177,7 +2177,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_word_w )
else if (offset < 0x3000)
tilemap_mark_tile_dirty(tc0100scn->tilemap[2][0], (offset & 0x0fff));
else if (offset < 0x3800)
- gfx_element_mark_dirty(device->machine->gfx[tc0100scn->tx_gfx], (offset - 0x3000) / 8);
+ gfx_element_mark_dirty(device->machine().gfx[tc0100scn->tx_gfx], (offset - 0x3000) / 8);
else if (offset >= 0x4000 && offset < 0x6000)
tilemap_mark_tile_dirty(tc0100scn->tilemap[1][0], (offset & 0x1fff) / 2);
}
@@ -2188,7 +2188,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_word_w )
else if (offset >= 0x4000 && offset < 0x8000)
tilemap_mark_tile_dirty(tc0100scn->tilemap[1][1], (offset & 0x3fff) / 2);
else if (offset >= 0x8800 && offset < 0x9000)
- gfx_element_mark_dirty(device->machine->gfx[tc0100scn->tx_gfx], (offset - 0x8800) / 8);
+ gfx_element_mark_dirty(device->machine().gfx[tc0100scn->tx_gfx], (offset - 0x8800) / 8);
else if (offset >= 0x9000)
tilemap_mark_tile_dirty(tc0100scn->tilemap[2][1], (offset & 0x0fff));
}
@@ -2250,7 +2250,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_ctrl_word_w )
tc0100scn_dirty_tilemaps(device);
/* reset the pointer to the text characters (and dirty them all) */
- gfx_element_set_source(device->machine->gfx[tc0100scn->tx_gfx], (UINT8 *)tc0100scn->char_ram);
+ gfx_element_set_source(device->machine().gfx[tc0100scn->tx_gfx], (UINT8 *)tc0100scn->char_ram);
}
break;
@@ -2364,9 +2364,9 @@ static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_t *bitmap, const
if ((p & 0xf)!= 0 || (flags & TILEMAP_DRAW_OPAQUE))
{
*BITMAP_ADDR16(bitmap, y, x + cliprect->min_x) = p;
- if (device->machine->priority_bitmap)
+ if (device->machine().priority_bitmap)
{
- UINT8 *pri = BITMAP_ADDR8(device->machine->priority_bitmap, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(device->machine().priority_bitmap, y, 0);
pri[x + cliprect->min_x] |= priority;
}
}
@@ -2425,7 +2425,7 @@ static DEVICE_START( tc0100scn )
const tc0100scn_interface *intf = tc0100scn_get_interface(device);
int xd, yd;
- tc0100scn->screen = device->machine->device<screen_device>(intf->screen);
+ tc0100scn->screen = device->machine().device<screen_device>(intf->screen);
/* Set up clipping for multi-TC0100SCN games. We assume
this code won't ever affect single screen games:
@@ -2495,15 +2495,15 @@ static DEVICE_START( tc0100scn )
tc0100scn->bg_col_mult = 1; /* multiplier for when bg gfx != 4bpp */
tc0100scn->tx_col_mult = 1; /* multiplier needed when bg gfx is 6bpp */
- if (device->machine->gfx[intf->gfxnum]->color_granularity == 2) /* Yuyugogo, Yesnoj */
+ if (device->machine().gfx[intf->gfxnum]->color_granularity == 2) /* Yuyugogo, Yesnoj */
tc0100scn->bg_col_mult = 8;
- if (device->machine->gfx[intf->gfxnum]->color_granularity == 0x40) /* Undrfire */
+ if (device->machine().gfx[intf->gfxnum]->color_granularity == 0x40) /* Undrfire */
tc0100scn->tx_col_mult = 4;
-//logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", device->machine->gfx[intf->gfxnum]->color_granularity, tc0100scn->tx_col_mult);
+//logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", device->machine().gfx[intf->gfxnum]->color_granularity, tc0100scn->tx_col_mult);
- tc0100scn->ram = auto_alloc_array_clear(device->machine, UINT16, TC0100SCN_RAM_SIZE / 2);
+ tc0100scn->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0100SCN_RAM_SIZE / 2);
tc0100scn_set_layer_ptrs(tc0100scn);
@@ -2511,13 +2511,13 @@ static DEVICE_START( tc0100scn )
/* we call this here, so that they can be modified at VIDEO_START*/
/* create the char set (gfx will then be updated dynamically from RAM) */
- device->machine->gfx[tc0100scn->tx_gfx] = gfx_element_alloc(device->machine, &tc0100scn_charlayout, (UINT8 *)tc0100scn->char_ram, 64, 0);
+ device->machine().gfx[tc0100scn->tx_gfx] = gfx_element_alloc(device->machine(), &tc0100scn_charlayout, (UINT8 *)tc0100scn->char_ram, 64, 0);
device->save_pointer(NAME(tc0100scn->ram), TC0100SCN_RAM_SIZE / 2);
device->save_item(NAME(tc0100scn->ctrl));
device->save_item(NAME(tc0100scn->dblwidth));
device->save_item(NAME(tc0100scn->gfxbank));
- device->machine->state().register_postload(tc0100scn_postload, tc0100scn);
+ device->machine().state().register_postload(tc0100scn_postload, tc0100scn);
}
@@ -2696,7 +2696,7 @@ static DEVICE_START( tc0280grd )
tc0280grd->tilemap = tilemap_create_device(device, tc0280grd_get_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
tilemap_set_transparent_pen(tc0280grd->tilemap, 0);
- tc0280grd->ram = auto_alloc_array(device->machine, UINT16, TC0280GRD_RAM_SIZE / 2);
+ tc0280grd->ram = auto_alloc_array(device->machine(), UINT16, TC0280GRD_RAM_SIZE / 2);
device->save_pointer(NAME(tc0280grd->ram), TC0280GRD_RAM_SIZE / 2);
device->save_item(NAME(tc0280grd->ctrl));
@@ -2980,7 +2980,7 @@ WRITE16_DEVICE_HANDLER( tc0480scp_word_w )
}
else if (offset <= 0x7fff)
{
- gfx_element_mark_dirty(device->machine->gfx[tc0480scp->tx_gfx], (offset - 0x7000) / 16);
+ gfx_element_mark_dirty(device->machine().gfx[tc0480scp->tx_gfx], (offset - 0x7000) / 16);
}
}
else
@@ -2998,7 +2998,7 @@ WRITE16_DEVICE_HANDLER( tc0480scp_word_w )
}
else if (offset <= 0x7fff)
{
- gfx_element_mark_dirty(device->machine->gfx[tc0480scp->tx_gfx], (offset - 0x7000) / 16);
+ gfx_element_mark_dirty(device->machine().gfx[tc0480scp->tx_gfx], (offset - 0x7000) / 16);
}
}
}
@@ -3335,7 +3335,7 @@ static void tc0480scp_bg01_draw( device_t *device, bitmap_t *bitmap, const recta
}
}
- taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine->priority_bitmap, priority);
+ taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine().priority_bitmap, priority);
y_index += zoomy;
if (!machine_flip)
@@ -3499,7 +3499,7 @@ static void tc0480scp_bg23_draw( device_t *device, bitmap_t *bitmap, const recta
}
}
- taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine->priority_bitmap, priority);
+ taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, device->machine().priority_bitmap, priority);
y_index += zoomy;
if (!machine_flip)
@@ -3717,17 +3717,17 @@ static DEVICE_START( tc0480scp )
tilemap_set_scroll_rows(tc0480scp->tilemap[3][i], 512);
}
- tc0480scp->ram = auto_alloc_array_clear(device->machine, UINT16, TC0480SCP_RAM_SIZE / 2);
+ tc0480scp->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0480SCP_RAM_SIZE / 2);
tc0480scp_set_layer_ptrs(tc0480scp);
/* create the char set (gfx will then be updated dynamically from RAM) */
- device->machine->gfx[tc0480scp->tx_gfx] = gfx_element_alloc(device->machine, &tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0);
+ device->machine().gfx[tc0480scp->tx_gfx] = gfx_element_alloc(device->machine(), &tc0480scp_charlayout, (UINT8 *)tc0480scp->char_ram, 64, 0);
device->save_pointer(NAME(tc0480scp->ram), TC0480SCP_RAM_SIZE / 2);
device->save_item(NAME(tc0480scp->ctrl));
device->save_item(NAME(tc0480scp->dblwidth));
- device->machine->state().register_postload(tc0480scp_postload, tc0480scp);
+ device->machine().state().register_postload(tc0480scp_postload, tc0480scp);
}
static DEVICE_RESET( tc0480scp )
@@ -3969,7 +3969,7 @@ void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle *clipre
UINT16 roada_line[512], roadb_line[512];
UINT16 *dst16;
UINT16 *roada, *roadb;
- UINT16 *roadgfx = (UINT16 *)device->machine->region(tc0150rod->gfx_region)->base();
+ UINT16 *roadgfx = (UINT16 *)device->machine().region(tc0150rod->gfx_region)->base();
UINT16 pixel, color, gfx_word;
UINT16 roada_clipl, roada_clipr, roada_bodyctrl;
@@ -4000,36 +4000,36 @@ void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle *clipre
int priority_switch_line = (road_ctrl & 0x00ff) - y_offs;
#ifdef MAME_DEBUG
- if (input_code_pressed_once (device->machine, KEYCODE_X))
+ if (input_code_pressed_once (device->machine(), KEYCODE_X))
{
dislayer[0] ^= 1;
popmessage("RoadA body: %01x",dislayer[0]);
}
- if (input_code_pressed_once (device->machine, KEYCODE_C))
+ if (input_code_pressed_once (device->machine(), KEYCODE_C))
{
dislayer[1] ^= 1;
popmessage("RoadA l-edge: %01x",dislayer[1]);
}
- if (input_code_pressed_once (device->machine, KEYCODE_V))
+ if (input_code_pressed_once (device->machine(), KEYCODE_V))
{
dislayer[2] ^= 1;
popmessage("RoadA r-edge: %01x",dislayer[2]);
}
- if (input_code_pressed_once (device->machine, KEYCODE_B))
+ if (input_code_pressed_once (device->machine(), KEYCODE_B))
{
dislayer[3] ^= 1;
popmessage("RoadB body: %01x",dislayer[3]);
}
- if (input_code_pressed_once (device->machine, KEYCODE_N))
+ if (input_code_pressed_once (device->machine(), KEYCODE_N))
{
dislayer[4] ^= 1;
popmessage("RoadB l-edge: %01x",dislayer[4]);
}
- if (input_code_pressed_once (device->machine, KEYCODE_M))
+ if (input_code_pressed_once (device->machine(), KEYCODE_M))
{
dislayer[5] ^= 1;
popmessage("RoadB r-edge: %01x",dislayer[5]);
@@ -4516,7 +4516,7 @@ void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle *clipre
}
}
- taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, 1, ROT0, device->machine->priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority);
+ taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, 1, ROT0, device->machine().priority_bitmap, (y > priority_switch_line) ? high_priority : low_priority);
}
y++;
@@ -4544,7 +4544,7 @@ static DEVICE_START( tc0150rod )
tc0150rod->gfx_region = intf->gfx_region;
- tc0150rod->ram = auto_alloc_array(device->machine, UINT16, TC0150ROD_RAM_SIZE / 2);
+ tc0150rod->ram = auto_alloc_array(device->machine(), UINT16, TC0150ROD_RAM_SIZE / 2);
device->save_pointer(NAME(tc0150rod->ram), TC0150ROD_RAM_SIZE / 2);
@@ -4663,7 +4663,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
- palette_set_color_rgb(device->machine, tc0110pcr->addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
break;
default:
@@ -4686,7 +4686,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
- palette_set_color_rgb(device->machine, tc0110pcr->addr + (tc0110pcr->pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ palette_set_color_rgb(device->machine(), tc0110pcr->addr + (tc0110pcr->pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
break;
default:
@@ -4711,7 +4711,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
- palette_set_color_rgb(device->machine, tc0110pcr->addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
break;
default:
@@ -4736,7 +4736,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
- palette_set_color_rgb(device->machine, tc0110pcr->addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
+ palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
break;
default:
@@ -4756,11 +4756,11 @@ static DEVICE_START( tc0110pcr )
tc0110pcr->pal_offs = intf->pal_offs;
- tc0110pcr->ram = auto_alloc_array(device->machine, UINT16, TC0110PCR_RAM_SIZE);
+ tc0110pcr->ram = auto_alloc_array(device->machine(), UINT16, TC0110PCR_RAM_SIZE);
device->save_pointer(NAME(tc0110pcr->ram), TC0110PCR_RAM_SIZE);
device->save_item(NAME(tc0110pcr->type));
- device->machine->state().register_postload(tc0110pcr_restore_colors, tc0110pcr);
+ device->machine().state().register_postload(tc0110pcr_restore_colors, tc0110pcr);
}
static DEVICE_RESET( tc0110pcr )
@@ -4895,7 +4895,7 @@ static void tc0180vcu_video_control( device_t *device, UINT8 data )
if (tc0180vcu->video_control & 0x80)
tc0180vcu->framebuffer_page = (~tc0180vcu->video_control & 0x40) >> 6;
- tilemap_set_flip_all(device->machine, (tc0180vcu->video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 );
+ tilemap_set_flip_all(device->machine(), (tc0180vcu->video_control & 0x10) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0 );
}
READ16_DEVICE_HANDLER( tc0180vcu_ctrl_r )
@@ -5090,8 +5090,8 @@ static DEVICE_START( tc0180vcu )
tilemap_set_scrolldx(tc0180vcu->tilemap[1], 0, 24 * 8);
tilemap_set_scrolldx(tc0180vcu->tilemap[2], 0, 24 * 8);
- tc0180vcu->ram = auto_alloc_array_clear(device->machine, UINT16, TC0180VCU_RAM_SIZE / 2);
- tc0180vcu->scrollram = auto_alloc_array_clear(device->machine, UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
+ tc0180vcu->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0180VCU_RAM_SIZE / 2);
+ tc0180vcu->scrollram = auto_alloc_array_clear(device->machine(), UINT16, TC0180VCU_SCROLLRAM_SIZE / 2);
device->save_pointer(NAME(tc0180vcu->ram), TC0180VCU_RAM_SIZE / 2);
device->save_pointer(NAME(tc0180vcu->scrollram), TC0180VCU_SCROLLRAM_SIZE / 2);
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index d68fb843c06..0fc8cd7bb93 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -31,7 +31,7 @@ static const gfx_layout taitojc_char_layout =
static TILE_GET_INFO( taitojc_tile_info )
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
UINT32 val = state->tile_ram[tile_index];
int color = (val >> 22) & 0xff;
@@ -41,21 +41,21 @@ static TILE_GET_INFO( taitojc_tile_info )
READ32_HANDLER(taitojc_tile_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->tile_ram[offset];
}
READ32_HANDLER(taitojc_char_r)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
return state->char_ram[offset];
}
WRITE32_HANDLER(taitojc_tile_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
COMBINE_DATA(state->tile_ram + offset);
tilemap_mark_tile_dirty(state->tilemap, offset);
@@ -63,10 +63,10 @@ WRITE32_HANDLER(taitojc_tile_w)
WRITE32_HANDLER(taitojc_char_w)
{
- taitojc_state *state = space->machine->driver_data<taitojc_state>();
+ taitojc_state *state = space->machine().driver_data<taitojc_state>();
COMBINE_DATA(state->char_ram + offset);
- gfx_element_mark_dirty(space->machine->gfx[state->gfx_index], offset/32);
+ gfx_element_mark_dirty(space->machine().gfx[state->gfx_index], offset/32);
}
// Object data format:
@@ -79,9 +79,9 @@ WRITE32_HANDLER(taitojc_char_w)
// 0x01: -------- --x----- -------- -------- Priority (0 = below 3D, 1 = above 3D)
// 0x01: -------- -------- -xxxxxxx xxxxxxxx VRAM data address
-static void draw_object(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 w1, UINT32 w2)
+static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 w1, UINT32 w2)
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
int x, y, width, height, palette;
int i, j;
int x1, x2, y1, y2;
@@ -173,15 +173,15 @@ static void taitojc_exit(running_machine &machine)
VIDEO_START( taitojc )
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
int width, height;
state->poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, taitojc_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, taitojc_exit);
/* find first empty slot to decode gfx */
for (state->gfx_index = 0; state->gfx_index < MAX_GFX_ELEMENTS; state->gfx_index++)
- if (machine->gfx[state->gfx_index] == 0)
+ if (machine.gfx[state->gfx_index] == 0)
break;
assert(state->gfx_index != MAX_GFX_ELEMENTS);
@@ -194,21 +194,21 @@ VIDEO_START( taitojc )
state->tile_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[state->gfx_index] = gfx_element_alloc(machine, &taitojc_char_layout, (UINT8 *)state->char_ram, machine->total_colors() / 16, 0);
+ machine.gfx[state->gfx_index] = gfx_element_alloc(machine, &taitojc_char_layout, (UINT8 *)state->char_ram, machine.total_colors() / 16, 0);
state->texture = auto_alloc_array(machine, UINT8, 0x400000);
- state->framebuffer = machine->primary_screen->alloc_compatible_bitmap();
+ state->framebuffer = machine.primary_screen->alloc_compatible_bitmap();
- width = machine->primary_screen->width();
- height = machine->primary_screen->height();
+ width = machine.primary_screen->width();
+ height = machine.primary_screen->height();
state->zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
}
//static int tick = 0;
SCREEN_UPDATE( taitojc )
{
- taitojc_state *state = screen->machine->driver_data<taitojc_state>();
+ taitojc_state *state = screen->machine().driver_data<taitojc_state>();
int i;
#if 0
@@ -216,10 +216,10 @@ SCREEN_UPDATE( taitojc )
if( tick >= 5 ) {
tick = 0;
- if( input_code_pressed(screen->machine, KEYCODE_O) )
+ if( input_code_pressed(screen->machine(), KEYCODE_O) )
debug_tex_pal++;
- if( input_code_pressed(screen->machine, KEYCODE_I) )
+ if( input_code_pressed(screen->machine(), KEYCODE_I) )
debug_tex_pal--;
debug_tex_pal &= 0x7f;
@@ -235,7 +235,7 @@ SCREEN_UPDATE( taitojc )
if ((w2 & 0x200000) == 0)
{
- draw_object(screen->machine, bitmap, cliprect, w1, w2);
+ draw_object(screen->machine(), bitmap, cliprect, w1, w2);
}
}
@@ -248,7 +248,7 @@ SCREEN_UPDATE( taitojc )
if ((w2 & 0x200000) != 0)
{
- draw_object(screen->machine, bitmap, cliprect, w1, w2);
+ draw_object(screen->machine(), bitmap, cliprect, w1, w2);
}
}
@@ -410,9 +410,9 @@ static void render_texture_scan(void *dest, INT32 scanline, const poly_extent *e
}
}
-void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int length)
+void taitojc_render_polygons(running_machine &machine, UINT16 *polygon_fifo, int length)
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
poly_vertex vert[4];
int i;
int ptr;
@@ -481,7 +481,7 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000)
{
- poly_render_triangle(state->poly, state->framebuffer, &machine->primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2]);
+ poly_render_triangle(state->poly, state->framebuffer, &machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2]);
}
break;
}
@@ -529,11 +529,11 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
vert[2].p[1] == vert[3].p[1])
{
// optimization: all colours the same -> render solid
- poly_render_quad(state->poly, state->framebuffer, &machine->primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
+ poly_render_quad(state->poly, state->framebuffer, &machine.primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
}
else
{
- poly_render_quad(state->poly, state->framebuffer, &machine->primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
+ poly_render_quad(state->poly, state->framebuffer, &machine.primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
}
}
break;
@@ -601,7 +601,7 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000 && vert[3].p[0] < 0x8000)
{
- poly_render_quad(state->poly, state->framebuffer, &machine->primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2], &vert[3]);
+ poly_render_quad(state->poly, state->framebuffer, &machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2], &vert[3]);
}
break;
}
@@ -620,15 +620,15 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
poly_wait(state->poly, "Finished render");
}
-void taitojc_clear_frame(running_machine *machine)
+void taitojc_clear_frame(running_machine &machine)
{
- taitojc_state *state = machine->driver_data<taitojc_state>();
+ taitojc_state *state = machine.driver_data<taitojc_state>();
rectangle cliprect;
cliprect.min_x = 0;
cliprect.min_y = 0;
- cliprect.max_x = machine->primary_screen->width() - 1;
- cliprect.max_y = machine->primary_screen->height() - 1;
+ cliprect.max_x = machine.primary_screen->width() - 1;
+ cliprect.max_y = machine.primary_screen->height() - 1;
bitmap_fill(state->framebuffer, &cliprect, 0);
bitmap_fill(state->zbuffer, &cliprect, 0xffff);
diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c
index fb38d07a6dc..760a6bf8f3e 100644
--- a/src/mame/video/taitosj.c
+++ b/src/mame/video/taitosj.c
@@ -21,7 +21,7 @@
static const int layer_enable_mask[3] = { 0x10, 0x20, 0x40 };
-typedef void (*copy_layer_func_t)(running_machine *, bitmap_t *,
+typedef void (*copy_layer_func_t)(running_machine &, bitmap_t *,
const rectangle *, int, int *, rectangle *);
@@ -90,9 +90,9 @@ typedef void (*copy_layer_func_t)(running_machine *, bitmap_t *,
***************************************************************************/
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
static const int resistances[3] = { 1000, 470, 270 };
double rweights[3], gweights[3], bweights[3];
int i;
@@ -140,11 +140,11 @@ static void set_pens(running_machine *machine)
***************************************************************************/
-static void compute_draw_order(running_machine *machine)
+static void compute_draw_order(running_machine &machine)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int i;
- UINT8 *color_prom = machine->region("proms")->base();
+ UINT8 *color_prom = machine.region("proms")->base();
/* do a simple conversion of the PROM into layer priority order. Note that */
/* this is a simplification, which assumes the PROM encodes a sensible priority */
@@ -173,24 +173,24 @@ static void compute_draw_order(running_machine *machine)
VIDEO_START( taitosj )
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int i;
- state->sprite_layer_collbitmap1 = auto_bitmap_alloc(machine,16,16,machine->primary_screen->format());
+ state->sprite_layer_collbitmap1 = auto_bitmap_alloc(machine,16,16,machine.primary_screen->format());
for (i = 0; i < 3; i++)
{
- state->layer_bitmap[i] = machine->primary_screen->alloc_compatible_bitmap();
- state->sprite_layer_collbitmap2[i] = machine->primary_screen->alloc_compatible_bitmap();
+ state->layer_bitmap[i] = machine.primary_screen->alloc_compatible_bitmap();
+ state->sprite_layer_collbitmap2[i] = machine.primary_screen->alloc_compatible_bitmap();
}
- state->sprite_sprite_collbitmap1 = auto_bitmap_alloc(machine,32,32,machine->primary_screen->format());
- state->sprite_sprite_collbitmap2 = auto_bitmap_alloc(machine,32,32,machine->primary_screen->format());
+ state->sprite_sprite_collbitmap1 = auto_bitmap_alloc(machine,32,32,machine.primary_screen->format());
+ state->sprite_sprite_collbitmap2 = auto_bitmap_alloc(machine,32,32,machine.primary_screen->format());
- gfx_element_set_source(machine->gfx[0], state->characterram);
- gfx_element_set_source(machine->gfx[1], state->characterram);
- gfx_element_set_source(machine->gfx[2], state->characterram + 0x1800);
- gfx_element_set_source(machine->gfx[3], state->characterram + 0x1800);
+ gfx_element_set_source(machine.gfx[0], state->characterram);
+ gfx_element_set_source(machine.gfx[1], state->characterram);
+ gfx_element_set_source(machine.gfx[2], state->characterram + 0x1800);
+ gfx_element_set_source(machine.gfx[3], state->characterram + 0x1800);
compute_draw_order(machine);
}
@@ -199,13 +199,13 @@ VIDEO_START( taitosj )
READ8_HANDLER( taitosj_gfxrom_r )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
UINT8 ret;
offs_t offs = state->gfxpointer[0] | (state->gfxpointer[1] << 8);
if (offs < 0x8000)
- ret = space->machine->region("gfx1")->base()[offs];
+ ret = space->machine().region("gfx1")->base()[offs];
else
ret = 0;
@@ -221,18 +221,18 @@ READ8_HANDLER( taitosj_gfxrom_r )
WRITE8_HANDLER( taitosj_characterram_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
if (state->characterram[offset] != data)
{
if (offset < 0x1800)
{
- gfx_element_mark_dirty(space->machine->gfx[0], (offset / 8) & 0xff);
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 32) & 0x3f);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset / 8) & 0xff);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 32) & 0x3f);
}
else
{
- gfx_element_mark_dirty(space->machine->gfx[2], (offset / 8) & 0xff);
- gfx_element_mark_dirty(space->machine->gfx[3], (offset / 32) & 0x3f);
+ gfx_element_mark_dirty(space->machine().gfx[2], (offset / 8) & 0xff);
+ gfx_element_mark_dirty(space->machine().gfx[3], (offset / 32) & 0x3f);
}
state->characterram[offset] = data;
@@ -247,7 +247,7 @@ WRITE8_HANDLER( junglhbr_characterram_w )
WRITE8_HANDLER( taitosj_collision_reg_clear_w )
{
- taitosj_state *state = space->machine->driver_data<taitosj_state>();
+ taitosj_state *state = space->machine().driver_data<taitosj_state>();
state->collision_reg[0] = 0;
state->collision_reg[1] = 0;
state->collision_reg[2] = 0;
@@ -266,20 +266,20 @@ INLINE int get_sprite_xy(taitosj_state *state, UINT8 which, UINT8* sx, UINT8* sy
}
-INLINE const gfx_element *get_sprite_gfx_element(running_machine *machine, UINT8 which)
+INLINE const gfx_element *get_sprite_gfx_element(running_machine &machine, UINT8 which)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
offs_t offs = which * 4;
- return machine->gfx[(state->spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x40) ? 3 : 1];
+ return machine.gfx[(state->spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x40) ? 3 : 1];
}
-static int check_sprite_sprite_bitpattern(running_machine *machine,
+static int check_sprite_sprite_bitpattern(running_machine &machine,
int sx1, int sy1, int which1,
int sx2, int sy2, int which2)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int x, y, minx, miny, maxx = 16, maxy = 16;
offs_t offs1 = which1 * 4;
@@ -339,9 +339,9 @@ static int check_sprite_sprite_bitpattern(running_machine *machine,
}
-static void check_sprite_sprite_collision(running_machine *machine)
+static void check_sprite_sprite_collision(running_machine &machine)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
if (SPRITES_ON)
{
int which1;
@@ -399,12 +399,12 @@ static void check_sprite_sprite_collision(running_machine *machine)
}
-static void calculate_sprite_areas(running_machine *machine, int *sprites_on, rectangle *sprite_areas)
+static void calculate_sprite_areas(running_machine &machine, int *sprites_on, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int which;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
for (which = 0; which < 0x20; which++)
{
@@ -450,9 +450,9 @@ static void calculate_sprite_areas(running_machine *machine, int *sprites_on, re
}
-static int check_sprite_layer_bitpattern(running_machine *machine, int which, rectangle *sprite_areas)
+static int check_sprite_layer_bitpattern(running_machine &machine, int which, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int y, x;
offs_t offs = which * 4;
int result = 0; /* no collisions */
@@ -495,9 +495,9 @@ static int check_sprite_layer_bitpattern(running_machine *machine, int which, re
}
-static void check_sprite_layer_collision(running_machine *machine, int *sprites_on, rectangle *sprite_areas)
+static void check_sprite_layer_collision(running_machine &machine, int *sprites_on, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
if (SPRITES_ON)
{
int which;
@@ -514,9 +514,9 @@ static void check_sprite_layer_collision(running_machine *machine, int *sprites_
}
-static void draw_layers(running_machine *machine)
+static void draw_layers(running_machine &machine)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
offs_t offs;
bitmap_fill(state->layer_bitmap[0], NULL, TRANSPARENT_PEN);
@@ -531,19 +531,19 @@ static void draw_layers(running_machine *machine)
if (GLOBAL_FLIP_X) sx = 31 - sx;
if (GLOBAL_FLIP_Y) sy = 31 - sy;
- drawgfx_transpen(state->layer_bitmap[0],0,machine->gfx[state->colorbank[0] & 0x08 ? 2 : 0],
+ drawgfx_transpen(state->layer_bitmap[0],0,machine.gfx[state->colorbank[0] & 0x08 ? 2 : 0],
state->videoram_1[offs],
state->colorbank[0] & 0x07,
GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
8*sx,8*sy,0);
- drawgfx_transpen(state->layer_bitmap[1],0,machine->gfx[state->colorbank[0] & 0x80 ? 2 : 0],
+ drawgfx_transpen(state->layer_bitmap[1],0,machine.gfx[state->colorbank[0] & 0x80 ? 2 : 0],
state->videoram_2[offs],
(state->colorbank[0] >> 4) & 0x07,
GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
8*sx,8*sy,0);
- drawgfx_transpen(state->layer_bitmap[2],0,machine->gfx[state->colorbank[1] & 0x08 ? 2 : 0],
+ drawgfx_transpen(state->layer_bitmap[2],0,machine.gfx[state->colorbank[1] & 0x08 ? 2 : 0],
state->videoram_3[offs],
state->colorbank[1] & 0x07,
GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
@@ -552,9 +552,9 @@ static void draw_layers(running_machine *machine)
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
/*
sprite visibility area is missing 4 pixels from the sides, surely to reduce
wraparound side effects. This was verified on a real Elevator Action.
@@ -617,10 +617,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
}
-static void taitosj_copy_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void taitosj_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
int which, int *sprites_on, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
static const int fudge1[3] = { 3, 1, -1 };
static const int fudge2[3] = { 8, 10, 12 };
@@ -656,10 +656,10 @@ static void taitosj_copy_layer(running_machine *machine, bitmap_t *bitmap, const
}
-static void kikstart_copy_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void kikstart_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
int which, int *sprites_on, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
if (*state->video_mode & layer_enable_mask[which])
{
int i, scrolly, scrollx[32 * 8];
@@ -695,7 +695,7 @@ static void kikstart_copy_layer(running_machine *machine, bitmap_t *bitmap, cons
}
-static void copy_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
copy_layer_func_t copy_layer_func, int which, int *sprites_on, rectangle *sprite_areas)
{
if (which == 0)
@@ -705,10 +705,10 @@ static void copy_layer(running_machine *machine, bitmap_t *bitmap, const rectang
}
-static void copy_layers(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void copy_layers(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
copy_layer_func_t copy_layer_func, int *sprites_on, rectangle *sprite_areas)
{
- taitosj_state *state = machine->driver_data<taitosj_state>();
+ taitosj_state *state = machine.driver_data<taitosj_state>();
int i = 0;
/* fill the screen with the background color */
@@ -723,7 +723,7 @@ static void copy_layers(running_machine *machine, bitmap_t *bitmap, const rectan
}
-static void check_collision(running_machine *machine, int *sprites_on, rectangle *sprite_areas)
+static void check_collision(running_machine &machine, int *sprites_on, rectangle *sprite_areas)
{
check_sprite_sprite_collision(machine);
@@ -733,7 +733,7 @@ static void check_collision(running_machine *machine, int *sprites_on, rectangle
}
-static int video_update_common(running_machine *machine, bitmap_t *bitmap,
+static int video_update_common(running_machine &machine, bitmap_t *bitmap,
const rectangle *cliprect, copy_layer_func_t copy_layer_func)
{
int sprites_on[0x20]; /* 1 if sprite is active */
@@ -756,11 +756,11 @@ static int video_update_common(running_machine *machine, bitmap_t *bitmap,
SCREEN_UPDATE( taitosj )
{
- return video_update_common(screen->machine, bitmap, cliprect, taitosj_copy_layer);
+ return video_update_common(screen->machine(), bitmap, cliprect, taitosj_copy_layer);
}
SCREEN_UPDATE( kikstart )
{
- return video_update_common(screen->machine, bitmap, cliprect, kikstart_copy_layer);
+ return video_update_common(screen->machine(), bitmap, cliprect, kikstart_copy_layer);
}
diff --git a/src/mame/video/tank8.c b/src/mame/video/tank8.c
index 321b372cb33..79fff184b47 100644
--- a/src/mame/video/tank8.c
+++ b/src/mame/video/tank8.c
@@ -13,24 +13,24 @@ PALETTE_INIT( tank8 )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x0a);
+ machine.colortable = colortable_alloc(machine, 0x0a);
- colortable_palette_set_color(machine->colortable, 8, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine->colortable, 9, MAKE_RGB(0xff, 0xff, 0xff));
+ colortable_palette_set_color(machine.colortable, 8, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine.colortable, 9, MAKE_RGB(0xff, 0xff, 0xff));
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine->colortable, 2 * i + 0, 8);
- colortable_entry_set_value(machine->colortable, 2 * i + 1, i);
+ colortable_entry_set_value(machine.colortable, 2 * i + 0, 8);
+ colortable_entry_set_value(machine.colortable, 2 * i + 1, i);
}
/* walls */
- colortable_entry_set_value(machine->colortable, 0x10, 8);
- colortable_entry_set_value(machine->colortable, 0x11, 9);
+ colortable_entry_set_value(machine.colortable, 0x10, 8);
+ colortable_entry_set_value(machine.colortable, 0x11, 9);
/* mines */
- colortable_entry_set_value(machine->colortable, 0x12, 8);
- colortable_entry_set_value(machine->colortable, 0x13, 9);
+ colortable_entry_set_value(machine.colortable, 0x12, 8);
+ colortable_entry_set_value(machine.colortable, 0x13, 9);
}
@@ -63,7 +63,7 @@ static void set_pens(tank8_state *state, colortable_t *colortable)
WRITE8_HANDLER( tank8_video_ram_w )
{
- tank8_state *state = space->machine->driver_data<tank8_state>();
+ tank8_state *state = space->machine().driver_data<tank8_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
}
@@ -72,7 +72,7 @@ WRITE8_HANDLER( tank8_video_ram_w )
static TILE_GET_INFO( tank8_get_tile_info )
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
UINT8 code = state->video_ram[tile_index];
int color = 0;
@@ -103,10 +103,10 @@ static TILE_GET_INFO( tank8_get_tile_info )
VIDEO_START( tank8 )
{
- tank8_state *state = machine->driver_data<tank8_state>();
- state->helper1 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper2 = machine->primary_screen->alloc_compatible_bitmap();
- state->helper3 = machine->primary_screen->alloc_compatible_bitmap();
+ tank8_state *state = machine.driver_data<tank8_state>();
+ state->helper1 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper2 = machine.primary_screen->alloc_compatible_bitmap();
+ state->helper3 = machine.primary_screen->alloc_compatible_bitmap();
state->tilemap = tilemap_create(machine, tank8_get_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
@@ -128,9 +128,9 @@ static int get_y_pos(tank8_state *state, int n)
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
int i;
for (i = 0; i < 8; i++)
@@ -140,7 +140,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int x = get_x_pos(state, i);
int y = get_y_pos(state, i);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[(code & 0x04) ? 2 : 3],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[(code & 0x04) ? 2 : 3],
code & 0x03,
i,
code & 0x10,
@@ -151,9 +151,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
int i;
for (i = 0; i < 8; i++)
@@ -192,22 +192,22 @@ static TIMER_CALLBACK( tank8_collision_callback )
SCREEN_UPDATE( tank8 )
{
- tank8_state *state = screen->machine->driver_data<tank8_state>();
- set_pens(state, screen->machine->colortable);
+ tank8_state *state = screen->machine().driver_data<tank8_state>();
+ set_pens(state, screen->machine().colortable);
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
- draw_bullets(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
+ draw_bullets(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_EOF( tank8 )
{
- tank8_state *state = machine->driver_data<tank8_state>();
+ tank8_state *state = machine.driver_data<tank8_state>();
int x;
int y;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
tilemap_draw(state->helper1, &visarea, state->tilemap, 0, 0);
@@ -225,7 +225,7 @@ SCREEN_EOF( tank8 )
const UINT16* p2 = BITMAP_ADDR16(state->helper2, y, 0);
const UINT16* p3 = BITMAP_ADDR16(state->helper3, y, 0);
- if (y % 2 != machine->primary_screen->frame_number() % 2)
+ if (y % 2 != machine.primary_screen->frame_number() % 2)
continue; /* video display is interlaced */
for (x = visarea.min_x; x <= visarea.max_x; x++)
@@ -284,7 +284,7 @@ SCREEN_EOF( tank8 )
index |= 0x80; /* collision on right side */
}
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(y, x), FUNC(tank8_collision_callback), index);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(y, x), FUNC(tank8_collision_callback), index);
_state = 1;
}
diff --git a/src/mame/video/tankbatt.c b/src/mame/video/tankbatt.c
index 8977a7e2265..0f6ef3d306e 100644
--- a/src/mame/video/tankbatt.c
+++ b/src/mame/video/tankbatt.c
@@ -23,7 +23,7 @@ PALETTE_INIT( tankbatt )
#define RES_2 0x3f /* this is a guess */
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -48,19 +48,19 @@ PALETTE_INIT( tankbatt )
b = RES_1 * bit3;
if (bit3) b += RES_2 * bit0;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x200; i += 2)
{
- colortable_entry_set_value(machine->colortable, i + 0, 0);
- colortable_entry_set_value(machine->colortable, i + 1, i >> 1);
+ colortable_entry_set_value(machine.colortable, i + 0, 0);
+ colortable_entry_set_value(machine.colortable, i + 1, i >> 1);
}
}
WRITE8_HANDLER( tankbatt_videoram_w )
{
- tankbatt_state *state = space->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = space->machine().driver_data<tankbatt_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -68,7 +68,7 @@ WRITE8_HANDLER( tankbatt_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- tankbatt_state *state = machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = machine.driver_data<tankbatt_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
int color = videoram[tile_index] | 0x01;
@@ -78,13 +78,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( tankbatt )
{
- tankbatt_state *state = machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = machine.driver_data<tankbatt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tankbatt_state *state = machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = machine.driver_data<tankbatt_state>();
int offs;
for (offs = 0;offs < state->bulletsram_size;offs += 2)
@@ -93,7 +93,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
int x = state->bulletsram[offs + 1];
int y = 255 - state->bulletsram[offs] - 2;
- drawgfx_opaque(bitmap,cliprect,machine->gfx[1],
+ drawgfx_opaque(bitmap,cliprect,machine.gfx[1],
0, /* this is just a square, generated by the hardware */
color,
0,0,
@@ -103,8 +103,8 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tankbatt )
{
- tankbatt_state *state = screen->machine->driver_data<tankbatt_state>();
+ tankbatt_state *state = screen->machine().driver_data<tankbatt_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_bullets(screen->machine, bitmap, cliprect);
+ draw_bullets(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/tankbust.c b/src/mame/video/tankbust.c
index f1a6db3902b..3a66e2568b1 100644
--- a/src/mame/video/tankbust.c
+++ b/src/mame/video/tankbust.c
@@ -28,7 +28,7 @@ note:
static TILE_GET_INFO( get_bg_tile_info )
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
int code = state->videoram[tile_index];
int attr = state->colorram[tile_index];
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_txt_tile_info )
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
int code = state->txtram[tile_index];
int color = ((code>>6) & 0x03);
@@ -78,7 +78,7 @@ static TILE_GET_INFO( get_txt_tile_info )
VIDEO_START( tankbust )
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
/* not scrollable */
state->txt_tilemap = tilemap_create(machine, get_txt_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -98,37 +98,37 @@ VIDEO_START( tankbust )
WRITE8_HANDLER( tankbust_background_videoram_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
READ8_HANDLER( tankbust_background_videoram_r )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
return state->videoram[offset];
}
WRITE8_HANDLER( tankbust_background_colorram_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
READ8_HANDLER( tankbust_background_colorram_r )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
return state->colorram[offset];
}
WRITE8_HANDLER( tankbust_txtram_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
state->txtram[offset] = data;
tilemap_mark_tile_dirty(state->txt_tilemap, offset);
}
READ8_HANDLER( tankbust_txtram_r )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
return state->txtram[offset];
}
@@ -136,7 +136,7 @@ READ8_HANDLER( tankbust_txtram_r )
WRITE8_HANDLER( tankbust_xscroll_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
if( state->xscroll[offset] != data )
{
int x;
@@ -153,7 +153,7 @@ WRITE8_HANDLER( tankbust_xscroll_w )
WRITE8_HANDLER( tankbust_yscroll_w )
{
- tankbust_state *state = space->machine->driver_data<tankbust_state>();
+ tankbust_state *state = space->machine().driver_data<tankbust_state>();
if( state->yscroll[offset] != data )
{
int y;
@@ -187,9 +187,9 @@ spriteram format (4 bytes per sprite):
offset 3 xxxxxxxx x position (8 LSB bits)
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tankbust_state *state = machine->driver_data<tankbust_state>();
+ tankbust_state *state = machine.driver_data<tankbust_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -223,7 +223,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if ((spriteram[offs+1]!=4)) //otherwise - ghost sprites
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code, color,
flipx,flipy,
sx,sy,0);
@@ -234,7 +234,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tankbust )
{
- tankbust_state *state = screen->machine->driver_data<tankbust_state>();
+ tankbust_state *state = screen->machine().driver_data<tankbust_state>();
#if 0
int i;
@@ -250,7 +250,7 @@ SCREEN_UPDATE( tankbust )
#endif
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
tilemap_draw(bitmap, cliprect, state->txt_tilemap, 0,0);
diff --git a/src/mame/video/taotaido.c b/src/mame/video/taotaido.c
index 3610862a038..f144cf8cd4c 100644
--- a/src/mame/video/taotaido.c
+++ b/src/mame/video/taotaido.c
@@ -15,7 +15,7 @@ zooming might be wrong (only used on title logo?)
/* sprite tile codes 0x4000 - 0x7fff get remapped according to the content of these registers */
WRITE16_HANDLER( taotaido_sprite_character_bank_select_w )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
if(ACCESSING_BITS_8_15)
state->sprite_character_bank_select[offset*2] = data >> 8;
if(ACCESSING_BITS_0_7)
@@ -25,9 +25,9 @@ WRITE16_HANDLER( taotaido_sprite_character_bank_select_w )
/* sprites are like the other video system / psikyo games, we can merge this with aerofgt and plenty of other
things eventually */
-static void draw_sprite(running_machine *machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle *cliprect )
{
- taotaido_state *state = machine->driver_data<taotaido_state>();
+ taotaido_state *state = machine.driver_data<taotaido_state>();
/*- SPR RAM Format -**
4 words per sprite
@@ -42,7 +42,7 @@ static void draw_sprite(running_machine *machine, UINT16 spriteno, bitmap_t *bit
int x,y;
UINT16 *source = &state->spriteram_older[spriteno*4];
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
int yzoom = (source[0] & 0xf000) >> 12;
@@ -109,9 +109,9 @@ static void draw_sprite(running_machine *machine, UINT16 spriteno, bitmap_t *bit
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- taotaido_state *state = machine->driver_data<taotaido_state>();
+ taotaido_state *state = machine.driver_data<taotaido_state>();
/* first part of sprite ram is the list of sprites to draw, terminated with 0x4000 */
UINT16 *source = state->spriteram_older;
UINT16 *finish = state->spriteram_older + 0x2000/2;
@@ -131,7 +131,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
WRITE16_HANDLER( taotaido_tileregs_w )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
switch (offset)
{
case 0: // would normally be x scroll?
@@ -157,14 +157,14 @@ WRITE16_HANDLER( taotaido_tileregs_w )
WRITE16_HANDLER( taotaido_bgvideoram_w )
{
- taotaido_state *state = space->machine->driver_data<taotaido_state>();
+ taotaido_state *state = space->machine().driver_data<taotaido_state>();
COMBINE_DATA(&state->bgram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static TILE_GET_INFO( taotaido_bg_tile_info )
{
- taotaido_state *state = machine->driver_data<taotaido_state>();
+ taotaido_state *state = machine.driver_data<taotaido_state>();
int code = state->bgram[tile_index]&0x01ff;
int bank = (state->bgram[tile_index]&0x0e00)>>9;
int col = (state->bgram[tile_index]&0xf000)>>12;
@@ -186,7 +186,7 @@ static TILEMAP_MAPPER( taotaido_tilemap_scan_rows )
VIDEO_START(taotaido)
{
- taotaido_state *state = machine->driver_data<taotaido_state>();
+ taotaido_state *state = machine.driver_data<taotaido_state>();
state->bg_tilemap = tilemap_create(machine, taotaido_bg_tile_info,taotaido_tilemap_scan_rows, 16,16,128,64);
state->spriteram_old = auto_alloc_array(machine, UINT16, 0x2000/2);
@@ -199,7 +199,7 @@ VIDEO_START(taotaido)
SCREEN_UPDATE(taotaido)
{
- taotaido_state *state = screen->machine->driver_data<taotaido_state>();
+ taotaido_state *state = screen->machine().driver_data<taotaido_state>();
// tilemap_set_scrollx(state->bg_tilemap,0,(state->scrollram[0x380/2]>>4)); // the values put here end up being wrong every other frame
// tilemap_set_scrolly(state->bg_tilemap,0,(state->scrollram[0x382/2]>>4)); // the values put here end up being wrong every other frame
@@ -223,13 +223,13 @@ SCREEN_UPDATE(taotaido)
tilemap_draw(bitmap,&clip,state->bg_tilemap,0,0);
}
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
SCREEN_EOF( taotaido )
{
- taotaido_state *state = machine->driver_data<taotaido_state>();
+ taotaido_state *state = machine.driver_data<taotaido_state>();
/* sprites need to be delayed by 2 frames? */
memcpy(state->spriteram2_older,state->spriteram2_old,0x10000);
diff --git a/src/mame/video/targeth.c b/src/mame/video/targeth.c
index 2328c8f360e..6ebcab718cc 100644
--- a/src/mame/video/targeth.c
+++ b/src/mame/video/targeth.c
@@ -34,7 +34,7 @@
static TILE_GET_INFO( get_tile_info_targeth_screen0 )
{
- targeth_state *state = machine->driver_data<targeth_state>();
+ targeth_state *state = machine.driver_data<targeth_state>();
int data = state->videoram[tile_index << 1];
int data2 = state->videoram[(tile_index << 1) + 1];
int code = data & 0x3fff;
@@ -44,7 +44,7 @@ static TILE_GET_INFO( get_tile_info_targeth_screen0 )
static TILE_GET_INFO( get_tile_info_targeth_screen1 )
{
- targeth_state *state = machine->driver_data<targeth_state>();
+ targeth_state *state = machine.driver_data<targeth_state>();
int data = state->videoram[(0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(0x2000/2) + (tile_index << 1) + 1];
int code = data & 0x3fff;
@@ -60,7 +60,7 @@ static TILE_GET_INFO( get_tile_info_targeth_screen1 )
WRITE16_HANDLER( targeth_vram_w )
{
- targeth_state *state = space->machine->driver_data<targeth_state>();
+ targeth_state *state = space->machine().driver_data<targeth_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->pant[(offset & 0x1fff) >> 12], ((offset << 1) & 0x1fff) >> 2);
}
@@ -74,7 +74,7 @@ WRITE16_HANDLER( targeth_vram_w )
VIDEO_START( targeth )
{
- targeth_state *state = machine->driver_data<targeth_state>();
+ targeth_state *state = machine.driver_data<targeth_state>();
state->pant[0] = tilemap_create(machine, get_tile_info_targeth_screen0,tilemap_scan_rows,16,16,64,32);
state->pant[1] = tilemap_create(machine, get_tile_info_targeth_screen1,tilemap_scan_rows,16,16,64,32);
@@ -105,11 +105,11 @@ VIDEO_START( targeth )
3 | xx------ -------- | not used?
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- targeth_state *state = machine->driver_data<targeth_state>();
+ targeth_state *state = machine.driver_data<targeth_state>();
int i;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
for (i = 3; i < (0x1000 - 6)/2; i += 4){
int sx = state->spriteram[i+2] & 0x03ff;
@@ -135,7 +135,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( targeth )
{
- targeth_state *state = screen->machine->driver_data<targeth_state>();
+ targeth_state *state = screen->machine().driver_data<targeth_state>();
/* set scroll registers */
tilemap_set_scrolly(state->pant[0], 0, state->vregs[0]);
tilemap_set_scrollx(state->pant[0], 0, state->vregs[1] + 0x04);
@@ -144,7 +144,7 @@ SCREEN_UPDATE( targeth )
tilemap_draw(bitmap,cliprect,state->pant[1],0,0);
tilemap_draw(bitmap,cliprect,state->pant[0],0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c
index 1fb736aa4e9..ba7d010f4a0 100644
--- a/src/mame/video/tatsumi.c
+++ b/src/mame/video/tatsumi.c
@@ -6,7 +6,7 @@
WRITE16_HANDLER(tatsumi_sprite_control_w)
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->sprite_control_ram[offset]);
/* 0xe0 is bank switch, others unknown */
@@ -18,27 +18,27 @@ WRITE16_HANDLER(tatsumi_sprite_control_w)
WRITE16_HANDLER( apache3_road_z_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
state->apache3_road_z = data & 0xff;
}
WRITE8_HANDLER( apache3_road_x_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
// Note: Double buffered. Yes, this is correct :)
state->apache3_road_x_ram[data] = offset;
}
READ16_HANDLER( roundup5_vram_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
offset+=((state->control_word&0x0c00)>>10) * 0xc000;
return state->roundup5_vram[offset];
}
WRITE16_HANDLER( roundup5_vram_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
offset+=((state->control_word&0x0c00)>>10) * 0xc000;
// if (offset>=0x30000)
@@ -48,7 +48,7 @@ WRITE16_HANDLER( roundup5_vram_w )
offset=offset%0xc000;
- gfx_element_mark_dirty(space->machine->gfx[1],offset/0x10);
+ gfx_element_mark_dirty(space->machine().gfx[1],offset/0x10);
}
@@ -57,7 +57,7 @@ WRITE16_HANDLER( roundup5_palette_w )
// static int hack=0;
int word;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
// if (offset==0xbfe)
// hack++;
@@ -79,8 +79,8 @@ bit 0: 3.9kOhm resistor
// logerror("PAL: %04x %02x\n",offset,data);
offset&=~1;
- word = ((space->machine->generic.paletteram.u16[offset] & 0xff)<<8) | (space->machine->generic.paletteram.u16[offset+1] & 0xff);
- palette_set_color_rgb(space->machine,offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
+ word = ((space->machine().generic.paletteram.u16[offset] & 0xff)<<8) | (space->machine().generic.paletteram.u16[offset+1] & 0xff);
+ palette_set_color_rgb(space->machine(),offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
}
@@ -88,7 +88,7 @@ WRITE16_HANDLER( apache3_palette_w )
{
// static int hack=0;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
// if (offset==0xbfe)
// hack++;
@@ -109,14 +109,14 @@ bit 0: 3.9kOhm resistor
// logerror("PAL: %04x %02x\n",offset,data);
- data = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine,offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
+ data = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
}
WRITE16_HANDLER( roundup5_text_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty( state->tx_layer,offset);
@@ -124,19 +124,19 @@ WRITE16_HANDLER( roundup5_text_w )
READ16_HANDLER( cyclwarr_videoram0_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
return state->cyclwarr_videoram0[offset];
}
READ16_HANDLER( cyclwarr_videoram1_r )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
return state->cyclwarr_videoram1[offset];
}
WRITE16_HANDLER( cyclwarr_videoram0_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->cyclwarr_videoram0[offset]);
if (offset>=0x400)
{
@@ -147,7 +147,7 @@ WRITE16_HANDLER( cyclwarr_videoram0_w )
WRITE16_HANDLER( cyclwarr_videoram1_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
COMBINE_DATA(&state->cyclwarr_videoram1[offset]);
if (offset>=0x400)
{
@@ -158,7 +158,7 @@ WRITE16_HANDLER( cyclwarr_videoram1_w )
WRITE16_HANDLER( roundup5_crt_w )
{
- tatsumi_state *state = space->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
if (offset==0 && ACCESSING_BITS_0_7)
state->roundupt_crt_selected_reg=data&0x3f;
if (offset==1 && ACCESSING_BITS_0_7) {
@@ -172,7 +172,7 @@ WRITE16_HANDLER( roundup5_crt_w )
static TILE_GET_INFO( get_text_tile_info )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
UINT16 *videoram = state->videoram;
int tile = videoram[tile_index];
SET_TILE_INFO(
@@ -184,7 +184,7 @@ static TILE_GET_INFO( get_text_tile_info )
static TILE_GET_INFO( get_tile_info_bigfight_0 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
int tile=state->cyclwarr_videoram0[(tile_index+0x400)%0x8000];
int bank = (state->bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf;
SET_TILE_INFO(1,(tile&0x3ff)+(bank<<10),(tile>>12)&0xf,0);
@@ -192,7 +192,7 @@ static TILE_GET_INFO( get_tile_info_bigfight_0 )
static TILE_GET_INFO( get_tile_info_bigfight_1 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
int tile=state->cyclwarr_videoram1[(tile_index+0x400)%0x8000];
int bank = (state->bigfight_a40000[0] >> (((tile&0xc00)>>10)*4))&0xf;
SET_TILE_INFO(1,(tile&0x3ff)+(bank<<10),(tile>>12)&0xf,0);
@@ -202,7 +202,7 @@ static TILE_GET_INFO( get_tile_info_bigfight_1 )
VIDEO_START( apache3 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
state->tx_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows,8,8,64,64);
state->shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
state->temp_bitmap = auto_bitmap_alloc(machine, 512, 512, BITMAP_FORMAT_RGB32);
@@ -213,19 +213,19 @@ VIDEO_START( apache3 )
VIDEO_START( roundup5 )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
state->tx_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows,8,8,128,64);
state->shadow_pen_array = auto_alloc_array_clear(machine, UINT8, 8192);
state->roundup5_vram = auto_alloc_array(machine, UINT16, (0x48000 * 4)/2);
tilemap_set_transparent_pen(state->tx_layer,0);
- gfx_element_set_source(machine->gfx[1], (UINT8 *)state->roundup5_vram);
+ gfx_element_set_source(machine.gfx[1], (UINT8 *)state->roundup5_vram);
}
VIDEO_START( cyclwarr )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
state->layer0 = tilemap_create(machine, get_tile_info_bigfight_0,tilemap_scan_rows,8,8,64,512);
//state->layer1 = tilemap_create(machine, get_tile_info_bigfight_0,tilemap_scan_rows,8,8,64,512);
state->layer1 = tilemap_create(machine, get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
@@ -237,7 +237,7 @@ VIDEO_START( cyclwarr )
VIDEO_START( bigfight )
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
state->layer0 = tilemap_create(machine, get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
state->layer1 = tilemap_create(machine, get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
state->layer2 = tilemap_create(machine, get_tile_info_bigfight_1,tilemap_scan_rows,8,8,128,256);
@@ -253,7 +253,7 @@ INLINE void roundupt_drawgfxzoomrotate(
UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy,
int scalex, int scaley, int rotate, int write_priority_only )
{
- tatsumi_state *state = gfx->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = gfx->machine().driver_data<tatsumi_state>();
rectangle myclip;
if (!scalex || !scaley) return;
@@ -284,7 +284,7 @@ INLINE void roundupt_drawgfxzoomrotate(
{
if( gfx )
{
- const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
const UINT8 *shadow_pens = state->shadow_pen_array + (gfx->color_granularity * (color % gfx->total_colors));
const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
@@ -525,9 +525,9 @@ static void mycopyrozbitmap_core(bitmap_t *bitmap,bitmap_t *srcbitmap,
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int write_priority_only, int rambank)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int write_priority_only, int rambank)
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
UINT16 *spriteram16 = state->spriteram;
int offs, flip_x, flip_y, x, y, color;
int w, h, index, lines, scale, rotate;
@@ -652,13 +652,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (w = 0; w < x_width; w++) {
if (rotate)
roundupt_drawgfxzoomrotate(
- state->temp_bitmap,cliprect,machine->gfx[0],
+ state->temp_bitmap,cliprect,machine.gfx[0],
base,
color,flip_x,flip_y,x_pos,render_y,
scale,scale,0,write_priority_only);
else
roundupt_drawgfxzoomrotate(
- bitmap,cliprect,machine->gfx[0],
+ bitmap,cliprect,machine.gfx[0],
base,
color,flip_x,flip_y,x_pos,render_y,
scale,scale,0,write_priority_only);
@@ -712,7 +712,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
}
-static void draw_sky(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int palette_base, int start_offset)
+static void draw_sky(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int palette_base, int start_offset)
{
// all todo
int x,y;
@@ -729,14 +729,14 @@ start_offset-=48;
if (col<palette_base) col=palette_base;
if (col>palette_base+127) col=palette_base+127;
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[col];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[col];
}
}
}
-static void draw_road(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,bitmap_t *shadow_bitmap)
+static void draw_road(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,bitmap_t *shadow_bitmap)
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
/*
0xf980 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess)
0xfa80 0x0008 0x8c80 0x4a00 - road right to below, width unknown (32 pixels guess)
@@ -862,9 +862,9 @@ offset is from last pixel of first road segment?
int col = linedata[0]&0xf;
UINT8 shadow=*BITMAP_ADDR8(shadow_bitmap, y, x);
if (shadow)
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[768 + pal*16 + col];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[768 + pal*16 + col];
else
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[256 + pal*16 + col];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[256 + pal*16 + col];
}
/* If startpos is negative, clip it and adjust the sampling position accordingly */
@@ -886,9 +886,9 @@ offset is from last pixel of first road segment?
// col=linedata[0x7f]&0xf;
if (shadow)
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[768 + pal*16 + col];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[768 + pal*16 + col];
else
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[256 + pal*16 + col];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[256 + pal*16 + col];
samplePos+=step;
}
@@ -917,9 +917,9 @@ offset is from last pixel of first road segment?
// col=linedata[0x7f]&0xf;
if (shadow)
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[768 + pal*16 + col + 32];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[768 + pal*16 + col + 32];
else
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[256 + pal*16 + col + 32];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[256 + pal*16 + col + 32];
}
if (endPos<0) {
@@ -941,9 +941,9 @@ offset is from last pixel of first road segment?
col=linedata[0x7f + 0x200]&0xf;
if (shadow)
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[768 + pal*16 + col + 32];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[768 + pal*16 + col + 32];
else
- *BITMAP_ADDR32(bitmap, y, x) = machine->pens[256 + pal*16 + col + 32];
+ *BITMAP_ADDR32(bitmap, y, x) = machine.pens[256 + pal*16 + col + 32];
samplePos+=step;
}
@@ -951,9 +951,9 @@ offset is from last pixel of first road segment?
}
}
-static void update_cluts(running_machine *machine, int fake_palette_offset, int object_base, int length)
+static void update_cluts(running_machine &machine, int fake_palette_offset, int object_base, int length)
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
/* Object palettes are build from a series of cluts stored in the object roms.
We update 'Mame palettes' from the clut here in order to simplify the
@@ -988,13 +988,13 @@ static void update_cluts(running_machine *machine, int fake_palette_offset, int
/**********************************************************************/
-static void draw_bg(running_machine *machine, bitmap_t *dst, tilemap_t *src, const UINT16* scrollx, const UINT16* scrolly, const UINT16* tilemap_ram, int tile_bank, int xscroll_offset, int yscroll_offset, int xsize, int ysize)
+static void draw_bg(running_machine &machine, bitmap_t *dst, tilemap_t *src, const UINT16* scrollx, const UINT16* scrolly, const UINT16* tilemap_ram, int tile_bank, int xscroll_offset, int yscroll_offset, int xsize, int ysize)
{
/*
Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette
from sets of 8 bit palettes!
*/
- const UINT8* tile_cluts = machine->region("gfx4")->base();
+ const UINT8* tile_cluts = machine.region("gfx4")->base();
const bitmap_t *src_bitmap = tilemap_get_pixmap(src);
int src_y_mask=ysize-1;
int src_x_mask=xsize-1;
@@ -1018,18 +1018,18 @@ static void draw_bg(running_machine *machine, bitmap_t *dst, tilemap_t *src, con
ppp=pp + ((p&0x78)<<5);
if ((p&0x7)!=0 || ((p&0x7)==0 && (pp&0x7)!=0)) // Transparent pixels are set by both the tile pixel data==0 AND colour palette==0
- *BITMAP_ADDR32(dst, y, x) = machine->pens[ppp];
+ *BITMAP_ADDR32(dst, y, x) = machine.pens[ppp];
}
}
}
/* Draw the sky and ground, applying rotation (eventually). Experimental! */
#if 0
-static void draw_ground(running_machine *machine, bitmap_t *dst, const rectangle *cliprect)
+static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle *cliprect)
{
- tatsumi_state *state = machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = machine.driver_data<tatsumi_state>();
int x, y;
- const UINT8 *lut = machine->region("proms")->base();
+ const UINT8 *lut = machine.region("proms")->base();
UINT16 gva = 0x180; // TODO
UINT8 sky_val = state->apache3_rotate_ctrl[1] & 0xff;
@@ -1045,7 +1045,7 @@ static void draw_ground(running_machine *machine, bitmap_t *dst, const rectangle
/* Sky */
for (x = cliprect->min_x; x <= cliprect->max_x; ++x)
{
- *BITMAP_ADDR32(dst, y, x) = machine->pens[0x100 + (sky_val & 0x7f)];
+ *BITMAP_ADDR32(dst, y, x) = machine.pens[0x100 + (sky_val & 0x7f)];
/* Update horizontal counter? */
gha = (gha + 1) & 0xfff;
@@ -1075,7 +1075,7 @@ static void draw_ground(running_machine *machine, bitmap_t *dst, const rectangle
colour = (BIT(hval, 11) << 4) | (colour << 2) | ln;
/* Draw the pixel */
- *BITMAP_ADDR32(dst, y, x) = machine->pens[0x200 + colour];
+ *BITMAP_ADDR32(dst, y, x) = machine.pens[0x200 + colour];
/* Update horizontal counter */
gha = (gha + 1) & 0xfff;
@@ -1092,43 +1092,43 @@ static void draw_ground(running_machine *machine, bitmap_t *dst, const rectangle
SCREEN_UPDATE( apache3 )
{
- tatsumi_state *state = screen->machine->driver_data<tatsumi_state>();
- update_cluts(screen->machine, 1024, 0, 2048);
+ tatsumi_state *state = screen->machine().driver_data<tatsumi_state>();
+ update_cluts(screen->machine(), 1024, 0, 2048);
tilemap_set_scrollx(state->tx_layer,0,24);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0]);
- draw_sky(screen->machine, bitmap, cliprect, 256, state->apache3_rotate_ctrl[1]);
-// draw_ground(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap,cliprect,0, (state->sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0]);
+ draw_sky(screen->machine(), bitmap, cliprect, 256, state->apache3_rotate_ctrl[1]);
+// draw_ground(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect,0, (state->sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
tilemap_draw(bitmap,cliprect,state->tx_layer,0,0);
return 0;
}
SCREEN_UPDATE( roundup5 )
{
- tatsumi_state *state = screen->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = screen->machine().driver_data<tatsumi_state>();
// UINT16 bg_x_scroll=state->roundup5_unknown1[0];
// UINT16 bg_y_scroll=state->roundup5_unknown2[0];
- update_cluts(screen->machine, 1024, 512, 4096);
+ update_cluts(screen->machine(), 1024, 512, 4096);
tilemap_set_scrollx(state->tx_layer,0,24);
tilemap_set_scrolly(state->tx_layer,0,0); //(((state->roundupt_crt_reg[0xe]<<8)|state->roundupt_crt_reg[0xf])>>5) + 96);
- bitmap_fill(bitmap,cliprect,screen->machine->pens[384]); // todo
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[384]); // todo
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
- draw_sprites(screen->machine, screen->machine->priority_bitmap,cliprect,1,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
- draw_road(screen->machine, bitmap,cliprect,screen->machine->priority_bitmap);
- draw_sprites(screen->machine, bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass
+ draw_sprites(screen->machine(), screen->machine().priority_bitmap,cliprect,1,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
+ draw_road(screen->machine(), bitmap,cliprect,screen->machine().priority_bitmap);
+ draw_sprites(screen->machine(), bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Full pass
tilemap_draw(bitmap,cliprect,state->tx_layer,0,0);
return 0;
}
SCREEN_UPDATE( cyclwarr )
{
- tatsumi_state *state = screen->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = screen->machine().driver_data<tatsumi_state>();
state->bigfight_bank=state->bigfight_a40000[0];
if (state->bigfight_bank!=state->bigfight_last_bank)
{
@@ -1139,21 +1139,21 @@ SCREEN_UPDATE( cyclwarr )
state->bigfight_last_bank=state->bigfight_bank;
}
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0]);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0]);
- draw_bg(screen->machine, bitmap, state->layer3, &state->cyclwarr_videoram1[0x000], &state->cyclwarr_videoram1[0x100], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x80, 512, 4096);
- draw_bg(screen->machine, bitmap, state->layer2, &state->cyclwarr_videoram1[0x200], &state->cyclwarr_videoram1[0x300], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x80, 512, 4096);
- draw_bg(screen->machine, bitmap, state->layer1, &state->cyclwarr_videoram0[0x000], &state->cyclwarr_videoram0[0x100], state->cyclwarr_videoram0, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
- update_cluts(screen->machine, 8192, 4096, 8192);
- draw_sprites(screen->machine, bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
- draw_bg(screen->machine, bitmap, state->layer0, &state->cyclwarr_videoram0[0x200], &state->cyclwarr_videoram0[0x300], state->cyclwarr_videoram0, state->bigfight_a40000[0], 0x10, -0x80, 512, 4096);
+ draw_bg(screen->machine(), bitmap, state->layer3, &state->cyclwarr_videoram1[0x000], &state->cyclwarr_videoram1[0x100], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x80, 512, 4096);
+ draw_bg(screen->machine(), bitmap, state->layer2, &state->cyclwarr_videoram1[0x200], &state->cyclwarr_videoram1[0x300], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x80, 512, 4096);
+ draw_bg(screen->machine(), bitmap, state->layer1, &state->cyclwarr_videoram0[0x000], &state->cyclwarr_videoram0[0x100], state->cyclwarr_videoram0, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
+ update_cluts(screen->machine(), 8192, 4096, 8192);
+ draw_sprites(screen->machine(), bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
+ draw_bg(screen->machine(), bitmap, state->layer0, &state->cyclwarr_videoram0[0x200], &state->cyclwarr_videoram0[0x300], state->cyclwarr_videoram0, state->bigfight_a40000[0], 0x10, -0x80, 512, 4096);
return 0;
}
SCREEN_UPDATE( bigfight )
{
- tatsumi_state *state = screen->machine->driver_data<tatsumi_state>();
+ tatsumi_state *state = screen->machine().driver_data<tatsumi_state>();
state->bigfight_bank=state->bigfight_a40000[0];
if (state->bigfight_bank!=state->bigfight_last_bank)
{
@@ -1164,13 +1164,13 @@ SCREEN_UPDATE( bigfight )
state->bigfight_last_bank=state->bigfight_bank;
}
- bitmap_fill(bitmap,cliprect,screen->machine->pens[0]);
- draw_bg(screen->machine, bitmap, state->layer3, &state->cyclwarr_videoram1[0x000], &state->cyclwarr_videoram1[0x100], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
- draw_bg(screen->machine, bitmap, state->layer2, &state->cyclwarr_videoram1[0x200], &state->cyclwarr_videoram1[0x300], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
- draw_bg(screen->machine, bitmap, state->layer1, &state->cyclwarr_videoram0[0x000], &state->cyclwarr_videoram0[0x100], state->cyclwarr_videoram0, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
- update_cluts(screen->machine, 8192, 4096, 8192);
- draw_sprites(screen->machine, bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
- draw_bg(screen->machine, bitmap, state->layer0, &state->cyclwarr_videoram0[0x200], &state->cyclwarr_videoram0[0x300], state->cyclwarr_videoram0, state->bigfight_a40000[0], 0x10, -0x40, 1024, 2048);
+ bitmap_fill(bitmap,cliprect,screen->machine().pens[0]);
+ draw_bg(screen->machine(), bitmap, state->layer3, &state->cyclwarr_videoram1[0x000], &state->cyclwarr_videoram1[0x100], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
+ draw_bg(screen->machine(), bitmap, state->layer2, &state->cyclwarr_videoram1[0x200], &state->cyclwarr_videoram1[0x300], state->cyclwarr_videoram1, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
+ draw_bg(screen->machine(), bitmap, state->layer1, &state->cyclwarr_videoram0[0x000], &state->cyclwarr_videoram0[0x100], state->cyclwarr_videoram0, state->bigfight_a40000[0], 8, -0x40, 1024, 2048);
+ update_cluts(screen->machine(), 8192, 4096, 8192);
+ draw_sprites(screen->machine(), bitmap,cliprect,0,(state->sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0);
+ draw_bg(screen->machine(), bitmap, state->layer0, &state->cyclwarr_videoram0[0x200], &state->cyclwarr_videoram0[0x300], state->cyclwarr_videoram0, state->bigfight_a40000[0], 0x10, -0x40, 1024, 2048);
return 0;
}
diff --git a/src/mame/video/taxidrvr.c b/src/mame/video/taxidrvr.c
index 902f172f710..8cc8593f28f 100644
--- a/src/mame/video/taxidrvr.c
+++ b/src/mame/video/taxidrvr.c
@@ -4,7 +4,7 @@
WRITE8_DEVICE_HANDLER( taxidrvr_spritectrl_w )
{
- taxidrvr_state *state = device->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = device->machine().driver_data<taxidrvr_state>();
state->spritectrl[offset] = data;
}
@@ -12,7 +12,7 @@ WRITE8_DEVICE_HANDLER( taxidrvr_spritectrl_w )
SCREEN_UPDATE( taxidrvr )
{
- taxidrvr_state *state = screen->machine->driver_data<taxidrvr_state>();
+ taxidrvr_state *state = screen->machine().driver_data<taxidrvr_state>();
int offs;
int sx,sy;
@@ -33,7 +33,7 @@ SCREEN_UPDATE( taxidrvr )
sx = offs % 32;
sy = offs / 32;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[3],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[3],
state->vram3[offs],
0,
0,0,
@@ -45,7 +45,7 @@ SCREEN_UPDATE( taxidrvr )
sx = offs % 32;
sy = offs / 32;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[2],
state->vram2[offs]+256*state->vram2[offs+0x400],
0,
0,0,
@@ -111,7 +111,7 @@ SCREEN_UPDATE( taxidrvr )
sx = offs % 32;
sy = offs / 32;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->vram1[offs],
0,
0,0,
@@ -138,7 +138,7 @@ SCREEN_UPDATE( taxidrvr )
sx = offs % 32;
sy = offs / 32;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
state->vram0[offs],
0,
0,0,
diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c
index 99d23f3f5bf..b31f8fac763 100644
--- a/src/mame/video/tbowl.c
+++ b/src/mame/video/tbowl.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_tx_tile_info )
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
int tileno;
int col;
@@ -22,7 +22,7 @@ static TILE_GET_INFO( get_tx_tile_info )
WRITE8_HANDLER( tbowl_txvideoram_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x7ff);
}
@@ -31,7 +31,7 @@ WRITE8_HANDLER( tbowl_txvideoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
int tileno;
int col;
@@ -43,32 +43,32 @@ static TILE_GET_INFO( get_bg_tile_info )
WRITE8_HANDLER( tbowl_bg2videoram_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bg2videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap,offset & 0xfff);
}
WRITE8_HANDLER (tbowl_bgxscroll_lo)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->xscroll = (state->xscroll & 0xff00) | data;
}
WRITE8_HANDLER (tbowl_bgxscroll_hi)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->xscroll = (state->xscroll & 0x00ff) | (data << 8);
}
WRITE8_HANDLER (tbowl_bgyscroll_lo)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->yscroll = (state->yscroll & 0xff00) | data;
}
WRITE8_HANDLER (tbowl_bgyscroll_hi)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->yscroll = (state->yscroll & 0x00ff) | (data << 8);
}
@@ -76,7 +76,7 @@ WRITE8_HANDLER (tbowl_bgyscroll_hi)
static TILE_GET_INFO( get_bg2_tile_info )
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
int tileno;
int col;
@@ -89,38 +89,38 @@ static TILE_GET_INFO( get_bg2_tile_info )
WRITE8_HANDLER( tbowl_bgvideoram_w )
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0xfff);
}
WRITE8_HANDLER (tbowl_bg2xscroll_lo)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bg2xscroll = (state->bg2xscroll & 0xff00) | data;
}
WRITE8_HANDLER (tbowl_bg2xscroll_hi)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bg2xscroll = (state->bg2xscroll & 0x00ff) | (data << 8);
}
WRITE8_HANDLER (tbowl_bg2yscroll_lo)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bg2yscroll = (state->bg2yscroll & 0xff00) | data;
}
WRITE8_HANDLER (tbowl_bg2yscroll_hi)
{
- tbowl_state *state = space->machine->driver_data<tbowl_state>();
+ tbowl_state *state = space->machine().driver_data<tbowl_state>();
state->bg2yscroll = (state->bg2yscroll & 0x00ff) | (data << 8);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int xscroll)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int xscroll)
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
int offs;
static const UINT8 layout[8][8] =
{
@@ -162,28 +162,28 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sx -= xscroll;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code + layout[y][x],
color,
flipx,flipy,
sx,sy,0 );
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code + layout[y][x],
color,
flipx,flipy,
sx,sy-0x200,0 );
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code + layout[y][x],
color,
flipx,flipy,
sx-0x400,sy,0 );
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code + layout[y][x],
color,
flipx,flipy,
@@ -203,7 +203,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_START( tbowl )
{
- tbowl_state *state = machine->driver_data<tbowl_state>();
+ tbowl_state *state = machine.driver_data<tbowl_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 16, 16,128,32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info,tilemap_scan_rows, 16, 16,128,32);
@@ -216,9 +216,9 @@ VIDEO_START( tbowl )
SCREEN_UPDATE( tbowl )
{
- tbowl_state *state = screen->machine->driver_data<tbowl_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ tbowl_state *state = screen->machine().driver_data<tbowl_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
if (screen == left_screen)
{
@@ -231,7 +231,7 @@ SCREEN_UPDATE( tbowl )
bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 0);
+ draw_sprites(screen->machine(), bitmap,cliprect, 0);
tilemap_draw(bitmap,cliprect,state->bg2_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
}
@@ -246,7 +246,7 @@ SCREEN_UPDATE( tbowl )
bitmap_fill(bitmap,cliprect,0x100); /* is there a register controling the colour? looks odd when screen is blank */
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 32*8);
+ draw_sprites(screen->machine(), bitmap,cliprect, 32*8);
tilemap_draw(bitmap,cliprect,state->bg2_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
}
diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c
index 1c31da6b886..f59aef84293 100644
--- a/src/mame/video/tceptor.c
+++ b/src/mame/video/tceptor.c
@@ -20,11 +20,11 @@
PALETTE_INIT( tceptor )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x400);
+ machine.colortable = colortable_alloc(machine, 0x400);
/* create a lookup table for the palette */
for (i = 0; i < 0x400; i++)
@@ -33,7 +33,7 @@ PALETTE_INIT( tceptor )
int g = pal4bit(color_prom[i + 0x400]);
int b = pal4bit(color_prom[i + 0x800]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -52,35 +52,35 @@ PALETTE_INIT( tceptor )
for (i = 0; i < 0x0400; i++)
{
int ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites lookup table (1024 colors) */
for (i = 0x0400; i < 0x0800; i++)
{
int ctabentry = color_prom[i] | 0x300;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* background: no lookup PROM, use directly (512 colors) */
for (i = 0x0a00; i < 0x0c00; i++)
{
int ctabentry = i & 0x1ff;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* road lookup table (256 colors) */
for (i = 0x0f00; i < 0x1000; i++)
{
int ctabentry = color_prom[i - 0x700] | 0x200;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* setup sprite mask color map */
/* tceptor2: only 0x23 */
memset(state->is_mask_spr, 0, sizeof state->is_mask_spr);
for (i = 0; i < 0x400; i++)
- if (colortable_entry_get_value(machine->colortable, i | 0x400) == SPR_MASK_COLOR)
+ if (colortable_entry_get_value(machine.colortable, i | 0x400) == SPR_MASK_COLOR)
state->is_mask_spr[i >> 4] = 1;
}
@@ -105,7 +105,7 @@ INLINE int get_tile_addr(int tile_index)
static TILE_GET_INFO( get_tx_tile_info )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
int offset = get_tile_addr(tile_index);
int code = state->tile_ram[offset];
int color = state->tile_attr[offset];
@@ -144,7 +144,7 @@ static void tile_mark_dirty(tceptor_state *state, int offset)
WRITE8_HANDLER( tceptor_tile_ram_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
if (state->tile_ram[offset] != data)
{
state->tile_ram[offset] = data;
@@ -154,7 +154,7 @@ WRITE8_HANDLER( tceptor_tile_ram_w )
WRITE8_HANDLER( tceptor_tile_attr_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
if (state->tile_attr[offset] != data)
{
state->tile_attr[offset] = data;
@@ -167,7 +167,7 @@ WRITE8_HANDLER( tceptor_tile_attr_w )
static TILE_GET_INFO( get_bg1_tile_info )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
UINT16 data = state->bg_ram[tile_index * 2] | (state->bg_ram[tile_index * 2 + 1] << 8);
int code = (data & 0x3ff) | 0x000;
int color = (data & 0xfc00) >> 10;
@@ -177,7 +177,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
UINT16 data = state->bg_ram[tile_index * 2 + 0x1000] | (state->bg_ram[tile_index * 2 + 1 + 0x1000] << 8);
int code = (data & 0x3ff) | 0x400;
int color = (data & 0xfc00) >> 10;
@@ -187,7 +187,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
WRITE8_HANDLER( tceptor_bg_ram_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
state->bg_ram[offset] = data;
offset /= 2;
@@ -199,7 +199,7 @@ WRITE8_HANDLER( tceptor_bg_ram_w )
WRITE8_HANDLER( tceptor_bg_scroll_w )
{
- tceptor_state *state = space->machine->driver_data<tceptor_state>();
+ tceptor_state *state = space->machine().driver_data<tceptor_state>();
switch (offset)
{
case 0:
@@ -231,9 +231,9 @@ WRITE8_HANDLER( tceptor_bg_scroll_w )
/*******************************************************************/
-static void decode_bg(running_machine *machine, const char * region)
+static void decode_bg(running_machine &machine, const char * region)
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
static const gfx_layout bg_layout =
{
8, 8,
@@ -246,7 +246,7 @@ static void decode_bg(running_machine *machine, const char * region)
};
int gfx_index = state->bg;
- UINT8 *src = machine->region(region)->base() + 0x8000;
+ UINT8 *src = machine.region(region)->base() + 0x8000;
UINT8 *buffer;
int len = 0x8000;
int i;
@@ -264,19 +264,19 @@ static void decode_bg(running_machine *machine, const char * region)
auto_free(machine, buffer);
/* decode the graphics */
- machine->gfx[gfx_index] = gfx_element_alloc(machine, &bg_layout, machine->region(region)->base(), 64, 2048);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, &bg_layout, machine.region(region)->base(), 64, 2048);
}
-static void decode_sprite(running_machine *machine, int gfx_index, const gfx_layout *layout, const void *data)
+static void decode_sprite(running_machine &machine, int gfx_index, const gfx_layout *layout, const void *data)
{
/* decode the graphics */
- machine->gfx[gfx_index] = gfx_element_alloc(machine, layout, (const UINT8 *)data, 64, 1024);
+ machine.gfx[gfx_index] = gfx_element_alloc(machine, layout, (const UINT8 *)data, 64, 1024);
}
// fix sprite order
-static void decode_sprite16(running_machine *machine, const char * region)
+static void decode_sprite16(running_machine &machine, const char * region)
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
static const gfx_layout spr16_layout =
{
16, 16,
@@ -294,8 +294,8 @@ static void decode_sprite16(running_machine *machine, const char * region)
2*16*16
};
- UINT8 *src = machine->region(region)->base();
- int len = machine->region(region)->bytes();
+ UINT8 *src = machine.region(region)->base();
+ int len = machine.region(region)->bytes();
UINT8 *dst;
int i, y;
@@ -322,9 +322,9 @@ static void decode_sprite16(running_machine *machine, const char * region)
}
// fix sprite order
-static void decode_sprite32(running_machine *machine, const char * region)
+static void decode_sprite32(running_machine &machine, const char * region)
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
static const gfx_layout spr32_layout =
{
32, 32,
@@ -346,8 +346,8 @@ static void decode_sprite32(running_machine *machine, const char * region)
2*32*32
};
- UINT8 *src = machine->region(region)->base();
- int len = machine->region(region)->bytes();
+ UINT8 *src = machine.region(region)->base();
+ int len = machine.region(region)->bytes();
int total = spr32_layout.total;
int size = spr32_layout.charincrement / 8;
UINT8 *dst;
@@ -373,14 +373,14 @@ static void decode_sprite32(running_machine *machine, const char * region)
VIDEO_START( tceptor )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
int gfx_index;
state->sprite_ram_buffered = auto_alloc_array_clear(machine, UINT16, 0x200/2);
/* find first empty slot to decode gfx */
for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
- if (machine->gfx[gfx_index] == 0)
+ if (machine.gfx[gfx_index] == 0)
break;
assert(gfx_index + 4 <= MAX_GFX_ELEMENTS);
@@ -394,17 +394,17 @@ VIDEO_START( tceptor )
decode_sprite32(machine, "gfx4");
/* allocate temp bitmaps */
- state->temp_bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->temp_bitmap = machine.primary_screen->alloc_compatible_bitmap();
namco_road_init(machine, gfx_index);
- namco_road_set_transparent_color(colortable_entry_get_value(machine->colortable, 0xfff));
+ namco_road_set_transparent_color(colortable_entry_get_value(machine.colortable, 0xfff));
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_cols, 8, 8, 34, 28);
tilemap_set_scrollx(state->tx_tilemap, 0, -2*8);
tilemap_set_scrolly(state->tx_tilemap, 0, 0);
- colortable_configure_tilemap_groups(machine->colortable, state->tx_tilemap, machine->gfx[0], 7);
+ colortable_configure_tilemap_groups(machine.colortable, state->tx_tilemap, machine.gfx[0], 7);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -440,9 +440,9 @@ VIDEO_START( tceptor )
z: zoom y
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
UINT16 *mem1 = &state->sprite_ram_buffered[0x000/2];
UINT16 *mem2 = &state->sprite_ram_buffered[0x100/2];
int need_mask = 0;
@@ -495,14 +495,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
drawgfxzoom_transmask(bitmap,
cliprect,
- machine->gfx[gfx],
+ machine.gfx[gfx],
code,
color,
flipx, flipy,
x, y,
scalex,
scaley,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[gfx], color, SPR_TRANS_COLOR));
}
}
@@ -513,7 +513,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (x = cliprect->min_x; x <= cliprect->max_x; x++)
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
- if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == SPR_MASK_COLOR)
+ if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(bitmap, y, x)) == SPR_MASK_COLOR)
// restore pixel
*BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(state->temp_bitmap, y, x);
}
@@ -522,14 +522,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tceptor )
{
- tceptor_state *state = screen->machine->driver_data<tceptor_state>();
+ tceptor_state *state = screen->machine().driver_data<tceptor_state>();
rectangle rect;
int pri;
int bg_center = 144 - ((((state->bg1_scroll_x + state->bg2_scroll_x ) & 0x1ff) - 288) / 2);
- device_t *_2d_screen = screen->machine->device("2dscreen");
- device_t *_3d_left_screen = screen->machine->device("3dleft");
- device_t *_3d_right_screen = screen->machine->device("3dright");
+ device_t *_2d_screen = screen->machine().device("2dscreen");
+ device_t *_3d_left_screen = screen->machine().device("3dleft");
+ device_t *_3d_right_screen = screen->machine().device("3dright");
if (screen != _2d_screen)
{
@@ -557,9 +557,9 @@ SCREEN_UPDATE( tceptor )
for (pri = 0; pri < 8; pri++)
{
- namco_road_draw(screen->machine, bitmap, cliprect, pri * 2);
- namco_road_draw(screen->machine, bitmap, cliprect, pri * 2 + 1);
- draw_sprites(screen->machine, bitmap, cliprect, pri);
+ namco_road_draw(screen->machine(), bitmap, cliprect, pri * 2);
+ namco_road_draw(screen->machine(), bitmap, cliprect, pri * 2 + 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, pri);
}
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -569,6 +569,6 @@ SCREEN_UPDATE( tceptor )
SCREEN_EOF( tceptor )
{
- tceptor_state *state = machine->driver_data<tceptor_state>();
+ tceptor_state *state = machine.driver_data<tceptor_state>();
memcpy(state->sprite_ram_buffered, state->sprite_ram, 0x200);
}
diff --git a/src/mame/video/tecmo.c b/src/mame/video/tecmo.c
index b512da68193..a46a21d13ee 100644
--- a/src/mame/video/tecmo.c
+++ b/src/mame/video/tecmo.c
@@ -23,7 +23,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 attr = state->bgvideoram[tile_index+0x200];
SET_TILE_INFO(
3,
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 attr = state->fgvideoram[tile_index+0x200];
SET_TILE_INFO(
2,
@@ -45,7 +45,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( gemini_get_bg_tile_info )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 attr = state->bgvideoram[tile_index+0x200];
SET_TILE_INFO(
3,
@@ -56,7 +56,7 @@ static TILE_GET_INFO( gemini_get_bg_tile_info )
static TILE_GET_INFO( gemini_get_fg_tile_info )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 attr = state->fgvideoram[tile_index+0x200];
SET_TILE_INFO(
2,
@@ -67,7 +67,7 @@ static TILE_GET_INFO( gemini_get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 attr = state->txvideoram[tile_index+0x400];
SET_TILE_INFO(
0,
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( tecmo )
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
if (state->video_type == 2) /* gemini */
{
state->bg_tilemap = tilemap_create(machine, gemini_get_bg_tile_info,tilemap_scan_rows,16,16,32,16);
@@ -117,28 +117,28 @@ VIDEO_START( tecmo )
WRITE8_HANDLER( tecmo_txvideoram_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( tecmo_fgvideoram_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x1ff);
}
WRITE8_HANDLER( tecmo_bgvideoram_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x1ff);
}
WRITE8_HANDLER( tecmo_fgscroll_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->fgscroll[offset] = data;
@@ -148,7 +148,7 @@ WRITE8_HANDLER( tecmo_fgscroll_w )
WRITE8_HANDLER( tecmo_bgscroll_w )
{
- tecmo_state *state = space->machine->driver_data<tecmo_state>();
+ tecmo_state *state = space->machine().driver_data<tecmo_state>();
state->bgscroll[offset] = data;
@@ -158,7 +158,7 @@ WRITE8_HANDLER( tecmo_bgscroll_w )
WRITE8_HANDLER( tecmo_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -169,9 +169,9 @@ WRITE8_HANDLER( tecmo_flipscreen_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- tecmo_state *state = machine->driver_data<tecmo_state>();
+ tecmo_state *state = machine.driver_data<tecmo_state>();
UINT8 *spriteram = state->spriteram;
int offs;
static const UINT8 layout[8][8] =
@@ -234,12 +234,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
int sx = xpos + 8*(flipx?(size-1-x):x);
int sy = ypos + 8*(flipy?(size-1-y):y);
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code + layout[y][x],
flags & 0xf,
flipx,flipy,
sx,sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
priority_mask,0);
}
}
@@ -250,13 +250,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( tecmo )
{
- tecmo_state *state = screen->machine->driver_data<tecmo_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ tecmo_state *state = screen->machine().driver_data<tecmo_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,0x100);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,1);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,2);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,4);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/tecmo16.c b/src/mame/video/tecmo16.c
index 91ed2d83aa4..4308282778f 100644
--- a/src/mame/video/tecmo16.c
+++ b/src/mame/video/tecmo16.c
@@ -16,7 +16,7 @@
static TILE_GET_INFO( fg_get_tile_info )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
int tile = state->videoram[tile_index] & 0x1fff;
int color = state->colorram[tile_index] & 0x0f;
@@ -32,7 +32,7 @@ static TILE_GET_INFO( fg_get_tile_info )
static TILE_GET_INFO( bg_get_tile_info )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
int tile = state->videoram2[tile_index] & 0x1fff;
int color = (state->colorram2[tile_index] & 0x0f)+0x10;
@@ -45,7 +45,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( tx_get_tile_info )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
int tile = state->charram[tile_index];
SET_TILE_INFO(
0,
@@ -58,9 +58,9 @@ static TILE_GET_INFO( tx_get_tile_info )
VIDEO_START( fstarfrc )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -84,9 +84,9 @@ VIDEO_START( fstarfrc )
VIDEO_START( ginkun )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -108,9 +108,9 @@ VIDEO_START( ginkun )
VIDEO_START( riot )
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* set up tile layers */
state->tile_bitmap_bg = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
@@ -135,28 +135,28 @@ VIDEO_START( riot )
WRITE16_HANDLER( tecmo16_videoram_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE16_HANDLER( tecmo16_colorram_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->colorram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
WRITE16_HANDLER( tecmo16_videoram2_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->videoram2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
WRITE16_HANDLER( tecmo16_colorram2_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->colorram2[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
@@ -164,58 +164,58 @@ WRITE16_HANDLER( tecmo16_colorram2_w )
WRITE16_HANDLER( tecmo16_charram_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->charram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
WRITE16_HANDLER( tecmo16_flipscreen_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
state->flipscreen = data & 0x01;
- flip_screen_set(space->machine, state->flipscreen);
+ flip_screen_set(space->machine(), state->flipscreen);
}
/******************************************************************************/
WRITE16_HANDLER( tecmo16_scroll_x_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll_x_w);
tilemap_set_scrollx(state->fg_tilemap,0,state->scroll_x_w);
}
WRITE16_HANDLER( tecmo16_scroll_y_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll_y_w);
tilemap_set_scrolly(state->fg_tilemap,0,state->scroll_y_w);
}
WRITE16_HANDLER( tecmo16_scroll2_x_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll2_x_w);
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll2_x_w);
}
WRITE16_HANDLER( tecmo16_scroll2_y_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll2_y_w);
tilemap_set_scrolly(state->bg_tilemap,0,state->scroll2_y_w);
}
WRITE16_HANDLER( tecmo16_scroll_char_x_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll_char_x_w);
tilemap_set_scrollx(state->tx_tilemap,0,state->scroll_char_x_w);
}
WRITE16_HANDLER( tecmo16_scroll_char_y_w )
{
- tecmo16_state *state = space->machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = space->machine().driver_data<tecmo16_state>();
COMBINE_DATA(&state->scroll_char_y_w);
tilemap_set_scrolly(state->tx_tilemap,0,state->scroll_char_y_w-16);
}
@@ -223,7 +223,7 @@ WRITE16_HANDLER( tecmo16_scroll_char_y_w )
/******************************************************************************/
/* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */
-static void blendbitmaps(running_machine *machine,
+static void blendbitmaps(running_machine &machine,
bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3,
int sx,int sy,const rectangle *clip)
{
@@ -251,7 +251,7 @@ static void blendbitmaps(running_machine *machine,
if (sy > ey) return;
{
- const pen_t *paldata = machine->pens;
+ const pen_t *paldata = machine.pens;
UINT32 *end;
UINT16 *sd1 = (UINT16 *)src1->base; /* source data */
@@ -332,9 +332,9 @@ static void blendbitmaps(running_machine *machine,
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect)
{
- tecmo16_state *state = machine->driver_data<tecmo16_state>();
+ tecmo16_state *state = machine.driver_data<tecmo16_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
static const UINT8 layout[8][8] =
@@ -416,28 +416,28 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap_bg, bitmap_t
sx = 256 - (xpos + 8*(!flipx?(sizex-1-x):x) + 8);
sy = 256 - (ypos + 8*(!flipy?(sizey-1-y):y) + 8);
}
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
/* wrap around x */
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx-512,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
/* wrap around x */
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx+512,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
}
}
}
@@ -459,28 +459,28 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap_bg, bitmap_t
sx = 256 - (xpos + 8*(!flipx?(sizex-1-x):x) + 8);
sy = 256 - (ypos + 8*(!flipy?(sizey-1-y):y) + 8);
}
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
/* wrap around x */
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx-512,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
/* wrap around x */
- pdrawgfx_transpen_raw(bitmap,cliprect,machine->gfx[2],
+ pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2],
code + layout[y][x],
- machine->gfx[2]->color_base + color * machine->gfx[2]->color_granularity,
+ machine.gfx[2]->color_base + color * machine.gfx[2]->color_granularity,
flipx,flipy,
sx+512,sy,
- machine->priority_bitmap, priority_mask,0);
+ machine.priority_bitmap, priority_mask,0);
}
}
}
@@ -492,8 +492,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap_bg, bitmap_t
SCREEN_UPDATE( tecmo16 )
{
- tecmo16_state *state = screen->machine->driver_data<tecmo16_state>();
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ tecmo16_state *state = screen->machine().driver_data<tecmo16_state>();
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(state->tile_bitmap_bg, cliprect, 0x300);
bitmap_fill(state->tile_bitmap_fg, cliprect, 0);
@@ -508,9 +508,9 @@ SCREEN_UPDATE( tecmo16 )
tilemap_draw(state->tile_bitmap_fg, cliprect,state->tx_tilemap, 0, 4);
/* draw sprites into a 16-bit bitmap */
- draw_sprites(screen->machine, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
+ draw_sprites(screen->machine(), state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, cliprect);
/* mix & blend the tilemaps and sprites into a 32-bit bitmap */
- blendbitmaps(screen->machine, bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
+ blendbitmaps(screen->machine(), bitmap, state->tile_bitmap_bg, state->tile_bitmap_fg, state->sprite_bitmap, 0, 0, cliprect);
return 0;
}
diff --git a/src/mame/video/tehkanwc.c b/src/mame/video/tehkanwc.c
index bf783ee2f97..cc8274bf785 100644
--- a/src/mame/video/tehkanwc.c
+++ b/src/mame/video/tehkanwc.c
@@ -17,61 +17,61 @@ robbiex@rocketmail.com
WRITE8_HANDLER( tehkanwc_videoram_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( tehkanwc_colorram_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
WRITE8_HANDLER( tehkanwc_videoram2_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( tehkanwc_scroll_x_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->scroll_x[offset] = data;
}
WRITE8_HANDLER( tehkanwc_scroll_y_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
WRITE8_HANDLER( tehkanwc_flipscreen_x_w )
{
- flip_screen_x_set(space->machine, data & 0x40);
+ flip_screen_x_set(space->machine(), data & 0x40);
}
WRITE8_HANDLER( tehkanwc_flipscreen_y_w )
{
- flip_screen_y_set(space->machine, data & 0x40);
+ flip_screen_y_set(space->machine(), data & 0x40);
}
WRITE8_HANDLER( gridiron_led0_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->led0 = data;
}
WRITE8_HANDLER( gridiron_led1_w )
{
- tehkanwc_state *state = space->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = space->machine().driver_data<tehkanwc_state>();
state->led1 = data;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- tehkanwc_state *state = machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
int offs = tile_index * 2;
int attr = state->videoram2[offs + 1];
int code = state->videoram2[offs] + ((attr & 0x30) << 4);
@@ -83,7 +83,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- tehkanwc_state *state = machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x10) << 4);
int color = attr & 0x0f;
@@ -96,7 +96,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( tehkanwc )
{
- tehkanwc_state *state = machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
16, 8, 32, 32);
@@ -123,7 +123,7 @@ VIDEO_START( tehkanwc )
bit 7 = enable (0 = display off)
*/
-static void gridiron_draw_led(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 led,int player)
+static void gridiron_draw_led(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 led,int player)
{
if (led&0x80)
output_set_digit_value(player, led&0x7f);
@@ -131,9 +131,9 @@ static void gridiron_draw_led(running_machine *machine, bitmap_t *bitmap, const
output_set_digit_value(player, 0x00);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tehkanwc_state *state = machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -159,20 +159,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
code, color, flipx, flipy, sx, sy, 0);
}
}
SCREEN_UPDATE( tehkanwc )
{
- tehkanwc_state *state = screen->machine->driver_data<tehkanwc_state>();
+ tehkanwc_state *state = screen->machine().driver_data<tehkanwc_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x[0] + 256 * state->scroll_x[1]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 1, 0);
- gridiron_draw_led(screen->machine, bitmap, cliprect, state->led0, 0);
- gridiron_draw_led(screen->machine, bitmap, cliprect, state->led1, 1);
+ gridiron_draw_led(screen->machine(), bitmap, cliprect, state->led0, 0);
+ gridiron_draw_led(screen->machine(), bitmap, cliprect, state->led1, 1);
return 0;
}
diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c
index 8e5287cf7a8..5c64d99101b 100644
--- a/src/mame/video/terracre.c
+++ b/src/mame/video/terracre.c
@@ -13,7 +13,7 @@
static
TILE_GET_INFO( get_bg_tile_info )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
/* xxxx.----.----.----
* ----.xx--.----.----
* ----.--xx.xxxx.xxxx */
@@ -25,17 +25,17 @@ TILE_GET_INFO( get_bg_tile_info )
static
TILE_GET_INFO( get_fg_tile_info )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
SET_TILE_INFO( 0,data&0xff,0,0 );
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- terracre_state *state = machine->driver_data<terracre_state>();
- const UINT8 *spritepalettebank = machine->region("user1")->base();
- const gfx_element *pGfx = machine->gfx[2];
+ terracre_state *state = machine.driver_data<terracre_state>();
+ const UINT8 *spritepalettebank = machine.region("user1")->base();
+ const gfx_element *pGfx = machine.gfx[2];
const UINT16 *pSource = state->spriteram;
int i;
int transparent_pen;
@@ -98,7 +98,7 @@ PALETTE_INIT( amazon )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -107,7 +107,7 @@ PALETTE_INIT( amazon )
int g = pal4bit(color_prom[i + 0x100]);
int b = pal4bit(color_prom[i + 0x200]);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -115,7 +115,7 @@ PALETTE_INIT( amazon )
/* characters use colors 0-0x0f */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* background tiles use colors 0xc0-0xff in four banks */
/* the bottom two bits of the color code select the palette bank for */
@@ -129,7 +129,7 @@ PALETTE_INIT( amazon )
else
ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0);
- colortable_entry_set_value(machine->colortable, 0x10 + i, ctabentry);
+ colortable_entry_set_value(machine.colortable, 0x10 + i, ctabentry);
}
/* sprites use colors 128-191 in four banks */
@@ -147,20 +147,20 @@ PALETTE_INIT( amazon )
else
ctabentry = 0x80 | ((i & 0x03) << 4) | (color_prom[i >> 4] & 0x0f);
- colortable_entry_set_value(machine->colortable, 0x110 + i_swapped, ctabentry);
+ colortable_entry_set_value(machine.colortable, 0x110 + i_swapped, ctabentry);
}
}
WRITE16_HANDLER( amazon_background_w )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
COMBINE_DATA( &state->amazon_videoram[offset] );
tilemap_mark_tile_dirty( state->background, offset );
}
WRITE16_HANDLER( amazon_foreground_w )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA( &videoram[offset] );
tilemap_mark_tile_dirty( state->foreground, offset );
@@ -170,29 +170,29 @@ WRITE16_HANDLER( amazon_flipscreen_w )
{
if( ACCESSING_BITS_0_7 )
{
- coin_counter_w( space->machine, 0, data&0x01 );
- coin_counter_w( space->machine, 1, (data&0x02)>>1 );
- flip_screen_set(space->machine, data&0x04);
+ coin_counter_w( space->machine(), 0, data&0x01 );
+ coin_counter_w( space->machine(), 1, (data&0x02)>>1 );
+ flip_screen_set(space->machine(), data&0x04);
}
}
WRITE16_HANDLER( amazon_scrolly_w )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
COMBINE_DATA(&state->yscroll);
tilemap_set_scrolly(state->background,0,state->yscroll);
}
WRITE16_HANDLER( amazon_scrollx_w )
{
- terracre_state *state = space->machine->driver_data<terracre_state>();
+ terracre_state *state = space->machine().driver_data<terracre_state>();
COMBINE_DATA(&state->xscroll);
tilemap_set_scrollx(state->background,0,state->xscroll);
}
VIDEO_START( amazon )
{
- terracre_state *state = machine->driver_data<terracre_state>();
+ terracre_state *state = machine.driver_data<terracre_state>();
state->background = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
state->foreground = tilemap_create(machine, get_fg_tile_info,tilemap_scan_cols,8,8,64,32);
tilemap_set_transparent_pen(state->foreground,0xf);
@@ -204,13 +204,13 @@ VIDEO_START( amazon )
SCREEN_UPDATE( amazon )
{
- terracre_state *state = screen->machine->driver_data<terracre_state>();
+ terracre_state *state = screen->machine().driver_data<terracre_state>();
if( state->xscroll&0x2000 )
- bitmap_fill( bitmap,cliprect ,get_black_pen(screen->machine));
+ bitmap_fill( bitmap,cliprect ,get_black_pen(screen->machine()));
else
tilemap_draw( bitmap,cliprect, state->background, 0, 0 );
- draw_sprites(screen->machine, bitmap,cliprect );
+ draw_sprites(screen->machine(), bitmap,cliprect );
tilemap_draw( bitmap,cliprect, state->foreground, 0, 0 );
return 0;
}
diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c
index 9ade64309b7..c3e1476ee1e 100644
--- a/src/mame/video/tetrisp2.c
+++ b/src/mame/video/tetrisp2.c
@@ -46,16 +46,16 @@ To Do:
/* BBBBBGGGGGRRRRRx xxxxxxxxxxxxxxxx */
WRITE16_HANDLER( tetrisp2_palette_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
if ((offset & 1) == 0)
- palette_set_color_rgb(space->machine,offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
+ palette_set_color_rgb(space->machine(),offset/2,pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
}
WRITE16_HANDLER( rocknms_sub_palette_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
+ data = COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
if ((offset & 1) == 0)
- palette_set_color_rgb(space->machine,(0x8000 + (offset/2)),pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
+ palette_set_color_rgb(space->machine(),(0x8000 + (offset/2)),pal5bit(data >> 1),pal5bit(data >> 6),pal5bit(data >> 11));
}
@@ -70,7 +70,7 @@ WRITE16_HANDLER( rocknms_sub_palette_w )
WRITE8_HANDLER( tetrisp2_priority_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
//if (ACCESSING_BITS_8_15)
{
data |= ((data & 0xff00) >> 8);
@@ -81,7 +81,7 @@ WRITE8_HANDLER( tetrisp2_priority_w )
WRITE8_HANDLER( rockn_priority_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
//if (ACCESSING_BITS_8_15)
{
state->priority[offset] = data;
@@ -90,7 +90,7 @@ WRITE8_HANDLER( rockn_priority_w )
WRITE16_HANDLER( rocknms_sub_priority_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
if (ACCESSING_BITS_8_15)
{
state->rocknms_sub_priority[offset] = data;
@@ -99,13 +99,13 @@ WRITE16_HANDLER( rocknms_sub_priority_w )
READ16_HANDLER( nndmseal_priority_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return state->priority[offset] | 0xff00;
}
READ8_HANDLER( tetrisp2_priority_r )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
return state->priority[offset];
}
@@ -130,7 +130,7 @@ READ8_HANDLER( tetrisp2_priority_r )
static TILE_GET_INFO( get_tile_info_bg )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->vram_bg[ 2 * tile_index + 0];
UINT16 code_lo = state->vram_bg[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -142,7 +142,7 @@ static TILE_GET_INFO( get_tile_info_bg )
WRITE16_HANDLER( tetrisp2_vram_bg_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->vram_bg[offset]);
tilemap_mark_tile_dirty(state->tilemap_bg,offset/2);
}
@@ -154,7 +154,7 @@ WRITE16_HANDLER( tetrisp2_vram_bg_w )
static TILE_GET_INFO( get_tile_info_fg )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->vram_fg[ 2 * tile_index + 0];
UINT16 code_lo = state->vram_fg[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -166,7 +166,7 @@ static TILE_GET_INFO( get_tile_info_fg )
WRITE16_HANDLER( tetrisp2_vram_fg_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->vram_fg[offset]);
tilemap_mark_tile_dirty(state->tilemap_fg,offset/2);
}
@@ -174,7 +174,7 @@ WRITE16_HANDLER( tetrisp2_vram_fg_w )
static TILE_GET_INFO( get_tile_info_rot )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->vram_rot[ 2 * tile_index + 0];
UINT16 code_lo = state->vram_rot[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -186,14 +186,14 @@ static TILE_GET_INFO( get_tile_info_rot )
WRITE16_HANDLER( tetrisp2_vram_rot_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->vram_rot[offset]);
tilemap_mark_tile_dirty(state->tilemap_rot,offset/2);
}
static TILE_GET_INFO( get_tile_info_rocknms_sub_bg )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->rocknms_sub_vram_bg[ 2 * tile_index + 0];
UINT16 code_lo = state->rocknms_sub_vram_bg[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -205,7 +205,7 @@ static TILE_GET_INFO( get_tile_info_rocknms_sub_bg )
WRITE16_HANDLER( rocknms_sub_vram_bg_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->rocknms_sub_vram_bg[offset]);
tilemap_mark_tile_dirty(state->tilemap_sub_bg,offset/2);
}
@@ -213,7 +213,7 @@ WRITE16_HANDLER( rocknms_sub_vram_bg_w )
static TILE_GET_INFO( get_tile_info_rocknms_sub_fg )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->rocknms_sub_vram_fg[ 2 * tile_index + 0];
UINT16 code_lo = state->rocknms_sub_vram_fg[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -225,7 +225,7 @@ static TILE_GET_INFO( get_tile_info_rocknms_sub_fg )
WRITE16_HANDLER( rocknms_sub_vram_fg_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->rocknms_sub_vram_fg[offset]);
tilemap_mark_tile_dirty(state->tilemap_sub_fg,offset/2);
}
@@ -233,7 +233,7 @@ WRITE16_HANDLER( rocknms_sub_vram_fg_w )
static TILE_GET_INFO( get_tile_info_rocknms_sub_rot )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
UINT16 code_hi = state->rocknms_sub_vram_rot[ 2 * tile_index + 0];
UINT16 code_lo = state->rocknms_sub_vram_rot[ 2 * tile_index + 1];
SET_TILE_INFO(
@@ -245,7 +245,7 @@ static TILE_GET_INFO( get_tile_info_rocknms_sub_rot )
WRITE16_HANDLER( rocknms_sub_vram_rot_w )
{
- tetrisp2_state *state = space->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = space->machine().driver_data<tetrisp2_state>();
COMBINE_DATA(&state->rocknms_sub_vram_rot[offset]);
tilemap_mark_tile_dirty(state->tilemap_sub_rot,offset/2);
}
@@ -254,7 +254,7 @@ WRITE16_HANDLER( rocknms_sub_vram_rot_w )
VIDEO_START( tetrisp2 )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
state->flipscreen_old = -1;
state->tilemap_bg = tilemap_create( machine, get_tile_info_bg,tilemap_scan_rows,
@@ -280,14 +280,14 @@ VIDEO_START( tetrisp2 )
VIDEO_START( nndmseal )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
VIDEO_START_CALL( tetrisp2 );
tilemap_set_scrolldx(state->tilemap_bg, -4,-4);
}
VIDEO_START( rockntread )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
state->flipscreen_old = -1;
state->tilemap_bg = tilemap_create( machine, get_tile_info_bg,tilemap_scan_rows,
@@ -314,7 +314,7 @@ VIDEO_START( rockntread )
VIDEO_START( rocknms )
{
- tetrisp2_state *state = machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = machine.driver_data<tetrisp2_state>();
VIDEO_START_CALL( rockntread );
state->tilemap_sub_bg = tilemap_create(machine, get_tile_info_rocknms_sub_bg,tilemap_scan_rows,
@@ -380,7 +380,7 @@ VIDEO_START( rocknms )
/* sprites should be able to create shadows too, how?
-- it appears that sprites which should be shadows are often rendered *UNDER* the tilemaps, maybe related?
*/
-static void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priority_ram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int flip)
+static void tetrisp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priority_ram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int flip)
{
int tx, ty, sx, sy, flipx, flipy;
int xsize, ysize;
@@ -388,7 +388,7 @@ static void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bi
int pri;
int xzoom, yzoom;
UINT32 primask;
- gfx_element *gfx = machine->gfx[gfxnum];
+ gfx_element *gfx = machine.gfx[gfxnum];
UINT16 *source = sprram_top;
UINT16 *finish = sprram_top + (sprram_size - 0x10) / 2;
@@ -461,7 +461,7 @@ static void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bi
SCREEN_UPDATE( tetrisp2 )
{
- tetrisp2_state *state = screen->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = screen->machine().driver_data<tetrisp2_state>();
int flipscreen;
int asc_pri;
int scr_pri;
@@ -472,13 +472,13 @@ SCREEN_UPDATE( tetrisp2 )
/* Black background color */
bitmap_fill(bitmap, cliprect, 0);
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
/* Flip Screen */
if (flipscreen != state->flipscreen_old)
{
state->flipscreen_old = flipscreen;
- tilemap_set_flip_all(screen->machine, flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(screen->machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
/* Flip Screen */
@@ -540,13 +540,13 @@ SCREEN_UPDATE( tetrisp2 )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, state->tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap, cliprect, state->priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
+ tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap, cliprect, state->priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
return 0;
}
SCREEN_UPDATE( rockntread )
{
- tetrisp2_state *state = screen->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = screen->machine().driver_data<tetrisp2_state>();
int flipscreen;
int asc_pri;
int scr_pri;
@@ -557,13 +557,13 @@ SCREEN_UPDATE( rockntread )
/* Black background color */
bitmap_fill(bitmap, cliprect, 0);
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
/* Flip Screen */
if (flipscreen != state->flipscreen_old)
{
state->flipscreen_old = flipscreen;
- tilemap_set_flip_all(screen->machine, flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(screen->machine(), flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
/* Flip Screen */
@@ -625,7 +625,7 @@ SCREEN_UPDATE( rockntread )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, state->tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, state->priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
+ tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
return 0;
}
@@ -634,13 +634,13 @@ SCREEN_UPDATE( rockntread )
SCREEN_UPDATE( rocknms )
{
- tetrisp2_state *state = screen->machine->driver_data<tetrisp2_state>();
+ tetrisp2_state *state = screen->machine().driver_data<tetrisp2_state>();
int asc_pri;
int scr_pri;
int rot_pri;
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
/* Black background color */
if (screen == left_screen)
@@ -652,8 +652,8 @@ SCREEN_UPDATE( rocknms )
tilemap_set_scrollx(state->tilemap_sub_rot, 0, state->rocknms_sub_rotregs[ 0 ] + 0x400);
tilemap_set_scrolly(state->tilemap_sub_rot, 0, state->rocknms_sub_rotregs[ 2 ] + 0x400);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x0000]);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0000]);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
asc_pri = scr_pri = rot_pri = 0;
@@ -693,7 +693,7 @@ SCREEN_UPDATE( rocknms )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, state->tilemap_sub_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, state->priority, screen->machine->generic.spriteram2.u16, screen->machine->generic.spriteram2_size, 4, (state->systemregs[0x00] & 0x02));
+ tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->priority, screen->machine().generic.spriteram2.u16, screen->machine().generic.spriteram2_size, 4, (state->systemregs[0x00] & 0x02));
}
else if (screen == right_screen) /* game screen */
{
@@ -705,8 +705,8 @@ SCREEN_UPDATE( rocknms )
tilemap_set_scrolly(state->tilemap_rot, 0, state->rotregs[ 2 ] + 0x400);
/* Black background color */
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x0000]);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x0000]);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
asc_pri = scr_pri = rot_pri = 0;
@@ -746,7 +746,7 @@ SCREEN_UPDATE( rocknms )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, state->tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, state->priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
+ tetrisp2_draw_sprites(screen->machine(), bitmap, screen->machine().priority_bitmap,cliprect, state->priority, screen->machine().generic.spriteram.u16, screen->machine().generic.spriteram_size, 0, (state->systemregs[0x00] & 0x02));
}
return 0;
diff --git a/src/mame/video/thedeep.c b/src/mame/video/thedeep.c
index e93a6895417..ca896a0ee95 100644
--- a/src/mame/video/thedeep.c
+++ b/src/mame/video/thedeep.c
@@ -45,7 +45,7 @@ static TILEMAP_MAPPER( tilemap_scan_rows_back )
static TILE_GET_INFO( get_tile_info_0 )
{
- thedeep_state *state = machine->driver_data<thedeep_state>();
+ thedeep_state *state = machine.driver_data<thedeep_state>();
UINT8 code = state->vram_0[ tile_index * 2 + 0 ];
UINT8 color = state->vram_0[ tile_index * 2 + 1 ];
SET_TILE_INFO(
@@ -57,7 +57,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- thedeep_state *state = machine->driver_data<thedeep_state>();
+ thedeep_state *state = machine.driver_data<thedeep_state>();
UINT8 code = state->vram_1[ tile_index * 2 + 0 ];
UINT8 color = state->vram_1[ tile_index * 2 + 1 ];
SET_TILE_INFO(
@@ -69,14 +69,14 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE8_HANDLER( thedeep_vram_0_w )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
state->vram_0[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_0, offset / 2);
}
WRITE8_HANDLER( thedeep_vram_1_w )
{
- thedeep_state *state = space->machine->driver_data<thedeep_state>();
+ thedeep_state *state = space->machine().driver_data<thedeep_state>();
state->vram_1[offset] = data;
tilemap_mark_tile_dirty(state->tilemap_1, offset / 2);
}
@@ -103,7 +103,7 @@ PALETTE_INIT( thedeep )
VIDEO_START( thedeep )
{
- thedeep_state *state = machine->driver_data<thedeep_state>();
+ thedeep_state *state = machine.driver_data<thedeep_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0,tilemap_scan_rows_back,16,16,0x20,0x20);
state->tilemap_1 = tilemap_create(machine, get_tile_info_1,tilemap_scan_rows,8,8,0x20,0x20);
@@ -147,9 +147,9 @@ Offset: Bits: Value:
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- thedeep_state *state = machine->driver_data<thedeep_state>();
+ thedeep_state *state = machine.driver_data<thedeep_state>();
UINT8 *s = state->spriteram, *end = s + state->spriteram_size;
while (s < end)
@@ -192,7 +192,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
for (y = 0; y < ny; y++)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code + (flipy ? (ny - y - 1) : y),
color,
flipx,flipy,
@@ -211,7 +211,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( thedeep )
{
- thedeep_state *state = screen->machine->driver_data<thedeep_state>();
+ thedeep_state *state = screen->machine().driver_data<thedeep_state>();
int scrollx = state->scroll[0] + (state->scroll[1]<<8);
int scrolly = state->scroll[2] + (state->scroll[3]<<8);
int x;
@@ -224,10 +224,10 @@ SCREEN_UPDATE( thedeep )
tilemap_set_scrolly(state->tilemap_0, x, y + scrolly);
}
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_draw(bitmap,cliprect,state->tilemap_0,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tilemap_1,0,0);
return 0;
}
diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c
index 0ee25d62421..3d1c44272a2 100644
--- a/src/mame/video/thepit.c
+++ b/src/mame/video/thepit.c
@@ -109,7 +109,7 @@ PALETTE_INIT( suprmous )
static TILE_GET_INFO( solid_get_tile_info )
{
- thepit_state *state = machine->driver_data<thepit_state>();
+ thepit_state *state = machine.driver_data<thepit_state>();
UINT8 back_color = (state->colorram[tile_index] & 0x70) >> 4;
int priority = (back_color != 0) && ((state->colorram[tile_index] & 0x80) == 0);
tileinfo->pen_data = state->dummy_tile;
@@ -120,8 +120,8 @@ static TILE_GET_INFO( solid_get_tile_info )
static TILE_GET_INFO( get_tile_info )
{
- thepit_state *state = machine->driver_data<thepit_state>();
- UINT8 fore_color = state->colorram[tile_index] % machine->gfx[0]->total_colors;
+ thepit_state *state = machine.driver_data<thepit_state>();
+ UINT8 fore_color = state->colorram[tile_index] % machine.gfx[0]->total_colors;
UINT8 code = state->videoram[tile_index];
SET_TILE_INFO(2 * state->graphics_bank, code, fore_color, 0);
}
@@ -136,7 +136,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( thepit )
{
- thepit_state *state = machine->driver_data<thepit_state>();
+ thepit_state *state = machine.driver_data<thepit_state>();
state->solid_tilemap = tilemap_create(machine, solid_get_tile_info,tilemap_scan_rows,8,8,32,32);
state->tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -160,7 +160,7 @@ VIDEO_START( thepit )
WRITE8_HANDLER( thepit_videoram_w )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
}
@@ -168,7 +168,7 @@ WRITE8_HANDLER( thepit_videoram_w )
WRITE8_HANDLER( thepit_colorram_w )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap, offset);
tilemap_mark_tile_dirty(state->solid_tilemap, offset);
@@ -177,7 +177,7 @@ WRITE8_HANDLER( thepit_colorram_w )
WRITE8_HANDLER( thepit_flip_screen_x_w )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
int flip;
state->flip_screen_x = data & 0x01;
@@ -194,7 +194,7 @@ WRITE8_HANDLER( thepit_flip_screen_x_w )
WRITE8_HANDLER( thepit_flip_screen_y_w )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
int flip;
state->flip_screen_y = data & 0x01;
@@ -211,7 +211,7 @@ WRITE8_HANDLER( thepit_flip_screen_y_w )
WRITE8_HANDLER( intrepid_graphics_bank_w )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
if (state->graphics_bank != (data & 0x01))
{
state->graphics_bank = data & 0x01;
@@ -223,16 +223,16 @@ WRITE8_HANDLER( intrepid_graphics_bank_w )
READ8_HANDLER( thepit_input_port_0_r )
{
- thepit_state *state = space->machine->driver_data<thepit_state>();
+ thepit_state *state = space->machine().driver_data<thepit_state>();
/* Read either the real or the fake input ports depending on the
horizontal flip switch. (This is how the real PCB does it) */
if (state->flip_screen_x)
{
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
else
{
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
}
@@ -244,12 +244,12 @@ READ8_HANDLER( thepit_input_port_0_r )
*
*************************************/
-static void draw_sprites(running_machine *machine,
+static void draw_sprites(running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
int priority_to_draw)
{
- thepit_state *state = machine->driver_data<thepit_state>();
+ thepit_state *state = machine.driver_data<thepit_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -285,7 +285,7 @@ static void draw_sprites(running_machine *machine,
if (offs < 16) y++;
drawgfx_transpen(bitmap, state->flip_screen_x ? &spritevisibleareaflipx : &spritevisiblearea,
- machine->gfx[2 * state->graphics_bank + 1],
+ machine.gfx[2 * state->graphics_bank + 1],
state->spriteram[offs + 1] & 0x3f,
state->spriteram[offs + 2],
flipx, flipy, x, y, 0);
@@ -296,7 +296,7 @@ static void draw_sprites(running_machine *machine,
SCREEN_UPDATE( thepit )
{
- thepit_state *state = screen->machine->driver_data<thepit_state>();
+ thepit_state *state = screen->machine().driver_data<thepit_state>();
offs_t offs;
for (offs = 0; offs < 32; offs++)
@@ -316,13 +316,13 @@ SCREEN_UPDATE( thepit )
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
/* low priority sprites */
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
/* high priority tiles */
tilemap_draw(bitmap, cliprect, state->solid_tilemap, 1, 1);
/* high priority sprites */
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
return 0;
}
diff --git a/src/mame/video/thief.c b/src/mame/video/thief.c
index 20ac68a290a..4b2d8d2a4d5 100644
--- a/src/mame/video/thief.c
+++ b/src/mame/video/thief.c
@@ -22,24 +22,24 @@ enum {
/***************************************************************************/
READ8_HANDLER( thief_context_ram_r ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
return state->coprocessor.context_ram[0x40*state->coprocessor.bank+offset];
}
WRITE8_HANDLER( thief_context_ram_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
state->coprocessor.context_ram[0x40*state->coprocessor.bank+offset] = data;
}
WRITE8_HANDLER( thief_context_bank_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
state->coprocessor.bank = data&0xf;
}
/***************************************************************************/
WRITE8_HANDLER( thief_video_control_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
state->video_control = data;
/*
bit 0: screen flip
@@ -60,13 +60,13 @@ WRITE8_HANDLER( thief_color_map_w ){
int r = intensity[(data & 0x03) >> 0];
int g = intensity[(data & 0x0C) >> 2];
int b = intensity[(data & 0x30) >> 4];
- palette_set_color( space->machine,offset,MAKE_RGB(r,g,b) );
+ palette_set_color( space->machine(),offset,MAKE_RGB(r,g,b) );
}
/***************************************************************************/
WRITE8_HANDLER( thief_color_plane_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
/*
--xx---- selects bitplane to read from (0..3)
----xxxx selects bitplane(s) to write to (0x0 = none, 0xf = all)
@@ -76,7 +76,7 @@ WRITE8_HANDLER( thief_color_plane_w ){
}
READ8_HANDLER( thief_videoram_r ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
UINT8 *videoram = state->videoram;
UINT8 *source = &videoram[offset];
if( state->video_control&0x02 ) source+=0x2000*4; /* foreground/background */
@@ -84,7 +84,7 @@ READ8_HANDLER( thief_videoram_r ){
}
WRITE8_HANDLER( thief_videoram_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
UINT8 *videoram = state->videoram;
UINT8 *dest = &videoram[offset];
if( state->video_control&0x02 )
@@ -98,7 +98,7 @@ WRITE8_HANDLER( thief_videoram_w ){
/***************************************************************************/
VIDEO_START( thief ){
- thief_state *state = machine->driver_data<thief_state>();
+ thief_state *state = machine.driver_data<thief_state>();
memset( &state->coprocessor, 0x00, sizeof(state->coprocessor) );
state->videoram = auto_alloc_array_clear(machine, UINT8, 0x2000*4*2 );
@@ -108,15 +108,15 @@ VIDEO_START( thief ){
}
SCREEN_UPDATE( thief ){
- thief_state *state = screen->machine->driver_data<thief_state>();
+ thief_state *state = screen->machine().driver_data<thief_state>();
UINT8 *videoram = state->videoram;
UINT32 offs;
int flipscreen = state->video_control&1;
const UINT8 *source = videoram;
- if (tms9927_screen_reset(screen->machine->device("tms")))
+ if (tms9927_screen_reset(screen->machine().device("tms")))
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -166,10 +166,10 @@ static UINT16 fetch_image_addr( coprocessor_t &thief_coprocessor ){
}
WRITE8_HANDLER( thief_blit_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
coprocessor_t &thief_coprocessor = state->coprocessor;
int i, offs, xoffset, dy;
- UINT8 *gfx_rom = space->machine->region( "gfx1" )->base();
+ UINT8 *gfx_rom = space->machine().region( "gfx1" )->base();
UINT8 x = thief_coprocessor.param[SCREEN_XPOS];
UINT8 y = thief_coprocessor.param[SCREEN_YPOS];
UINT8 width = thief_coprocessor.param[BLIT_WIDTH];
@@ -228,7 +228,7 @@ WRITE8_HANDLER( thief_blit_w ){
}
READ8_HANDLER( thief_coprocessor_r ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
coprocessor_t &thief_coprocessor = state->coprocessor;
switch( offset ){
case SCREEN_XPOS: /* xpos */
@@ -248,7 +248,7 @@ READ8_HANDLER( thief_coprocessor_r ){
return thief_coprocessor.image_ram[addr];
}
else {
- UINT8 *gfx_rom = space->machine->region( "gfx1" )->base();
+ UINT8 *gfx_rom = space->machine().region( "gfx1" )->base();
addr -= 0x2000;
if( addr<0x6000 ) return gfx_rom[addr];
}
@@ -273,7 +273,7 @@ READ8_HANDLER( thief_coprocessor_r ){
}
WRITE8_HANDLER( thief_coprocessor_w ){
- thief_state *state = space->machine->driver_data<thief_state>();
+ thief_state *state = space->machine().driver_data<thief_state>();
coprocessor_t &thief_coprocessor = state->coprocessor;
switch( offset ){
case GFX_PORT:
diff --git a/src/mame/video/thoop2.c b/src/mame/video/thoop2.c
index 5eedbdfb750..92fc4ff4673 100644
--- a/src/mame/video/thoop2.c
+++ b/src/mame/video/thoop2.c
@@ -38,7 +38,7 @@
static TILE_GET_INFO( get_tile_info_thoop2_screen0 )
{
- thoop2_state *state = machine->driver_data<thoop2_state>();
+ thoop2_state *state = machine.driver_data<thoop2_state>();
int data = state->videoram[tile_index << 1];
int data2 = state->videoram[(tile_index << 1) + 1];
int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14);
@@ -51,7 +51,7 @@ static TILE_GET_INFO( get_tile_info_thoop2_screen0 )
static TILE_GET_INFO( get_tile_info_thoop2_screen1 )
{
- thoop2_state *state = machine->driver_data<thoop2_state>();
+ thoop2_state *state = machine.driver_data<thoop2_state>();
int data = state->videoram[(0x1000/2) + (tile_index << 1)];
int data2 = state->videoram[(0x1000/2) + (tile_index << 1) + 1];
int code = ((data & 0xfffc) >> 2) | ((data & 0x0003) << 14);
@@ -69,7 +69,7 @@ static TILE_GET_INFO( get_tile_info_thoop2_screen1 )
WRITE16_HANDLER( thoop2_vram_w )
{
- thoop2_state *state = space->machine->driver_data<thoop2_state>();
+ thoop2_state *state = space->machine().driver_data<thoop2_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->pant[offset >> 11],((offset << 1) & 0x0fff) >> 2);
}
@@ -82,7 +82,7 @@ WRITE16_HANDLER( thoop2_vram_w )
VIDEO_START( thoop2 )
{
- thoop2_state *state = machine->driver_data<thoop2_state>();
+ thoop2_state *state = machine.driver_data<thoop2_state>();
int i;
state->pant[0] = tilemap_create(machine, get_tile_info_thoop2_screen0,tilemap_scan_rows,16,16,32,32);
@@ -102,9 +102,9 @@ VIDEO_START( thoop2 )
***************************************************************************/
-static void thoop2_sort_sprites(running_machine *machine)
+static void thoop2_sort_sprites(running_machine &machine)
{
- thoop2_state *state = machine->driver_data<thoop2_state>();
+ thoop2_state *state = machine.driver_data<thoop2_state>();
int i;
state->sprite_count[0] = 0;
@@ -148,11 +148,11 @@ static void thoop2_sort_sprites(running_machine *machine)
3 | xxxxxxxx xxxxxx-- | sprite code (low bits)
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
{
- thoop2_state *state = machine->driver_data<thoop2_state>();
+ thoop2_state *state = machine.driver_data<thoop2_state>();
int j, x, y, ex, ey;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
static const int x_offset[2] = {0x0,0x2};
static const int y_offset[2] = {0x0,0x1};
@@ -201,41 +201,41 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( thoop2 )
{
- thoop2_state *state = screen->machine->driver_data<thoop2_state>();
+ thoop2_state *state = screen->machine().driver_data<thoop2_state>();
/* set scroll registers */
tilemap_set_scrolly(state->pant[0], 0, state->vregs[0]);
tilemap_set_scrollx(state->pant[0], 0, state->vregs[1]+4);
tilemap_set_scrolly(state->pant[1], 0, state->vregs[2]);
tilemap_set_scrollx(state->pant[1], 0, state->vregs[3]);
- thoop2_sort_sprites(screen->machine);
+ thoop2_sort_sprites(screen->machine());
bitmap_fill( bitmap, cliprect , 0);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
- draw_sprites(screen->machine, bitmap,cliprect,3);
+ draw_sprites(screen->machine(), bitmap,cliprect,3);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER0 | 3,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER0 | 3,0);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER1 | 2,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER1 | 2,0);
- draw_sprites(screen->machine, bitmap,cliprect,2);
+ draw_sprites(screen->machine(), bitmap,cliprect,2);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER0 | 2,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER0 | 2,0);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER1 | 1,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER1 | 1,0);
- draw_sprites(screen->machine, bitmap,cliprect,1);
+ draw_sprites(screen->machine(), bitmap,cliprect,1);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER0 | 1,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER0 | 1,0);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER1 | 0,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER1 | 0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0);
+ draw_sprites(screen->machine(), bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_LAYER0 | 0,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_LAYER0 | 0,0);
- draw_sprites(screen->machine, bitmap,cliprect,4);
+ draw_sprites(screen->machine(), bitmap,cliprect,4);
return 0;
}
diff --git a/src/mame/video/thunderj.c b/src/mame/video/thunderj.c
index c22c9a57326..cf764f6b7fc 100644
--- a/src/mame/video/thunderj.c
+++ b/src/mame/video/thunderj.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
UINT16 data = state->alpha[tile_index];
int code = ((data & 0x200) ? (state->alpha_tile_bank * 0x200) : 0) + (data & 0x1ff);
int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
UINT16 data1 = state->playfield[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] & 0xff;
int code = data1 & 0x7fff;
@@ -41,7 +41,7 @@ static TILE_GET_INFO( get_playfield_tile_info )
static TILE_GET_INFO( get_playfield2_tile_info )
{
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
UINT16 data1 = state->playfield2[tile_index];
UINT16 data2 = state->playfield_upper[tile_index] >> 8;
int code = data1 & 0x7fff;
@@ -96,7 +96,7 @@ VIDEO_START( thunderj )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- thunderj_state *state = machine->driver_data<thunderj_state>();
+ thunderj_state *state = machine.driver_data<thunderj_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -123,8 +123,8 @@ VIDEO_START( thunderj )
SCREEN_UPDATE( thunderj )
{
- thunderj_state *state = screen->machine->driver_data<thunderj_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
+ thunderj_state *state = screen->machine().driver_data<thunderj_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/thunderx.c b/src/mame/video/thunderx.c
index 1ac39274377..492fc505b11 100644
--- a/src/mame/video/thunderx.c
+++ b/src/mame/video/thunderx.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void thunderx_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void thunderx_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
*code |= ((*color & 0x1f) << 8) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
@@ -22,9 +22,9 @@ void thunderx_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void thunderx_sprite_callback( running_machine *machine, int *code,int *color, int *priority_mask, int *shadow )
+void thunderx_sprite_callback( running_machine &machine, int *code,int *color, int *priority_mask, int *shadow )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
/* Sprite priority 1 means appear behind background, used only to mask sprites */
/* in the foreground */
@@ -50,7 +50,7 @@ void thunderx_sprite_callback( running_machine *machine, int *code,int *color, i
VIDEO_START( scontra )
{
- thunderx_state *state = machine->driver_data<thunderx_state>();
+ thunderx_state *state = machine.driver_data<thunderx_state>();
state->layer_colorbase[0] = 48;
state->layer_colorbase[1] = 0;
state->layer_colorbase[2] = 16;
@@ -68,11 +68,11 @@ VIDEO_START( scontra )
SCREEN_UPDATE( scontra )
{
- thunderx_state *state = screen->machine->driver_data<thunderx_state>();
+ thunderx_state *state = screen->machine().driver_data<thunderx_state>();
k052109_tilemap_update(state->k052109);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* The background color is always from layer 1 - but it's always black anyway */
// bitmap_fill(bitmap,cliprect,16 * state->layer_colorbase[1]);
diff --git a/src/mame/video/tia.c b/src/mame/video/tia.c
index 323f68ef767..93c9946e912 100644
--- a/src/mame/video/tia.c
+++ b/src/mame/video/tia.c
@@ -126,7 +126,7 @@ static read16_space_func tia_read_input_port;
static read8_space_func tia_get_databus;
static write16_space_func tia_vsync_callback;
-static void extend_palette(running_machine *machine) {
+static void extend_palette(running_machine &machine) {
int i,j;
for( i = 0; i < 128; i ++ )
@@ -271,12 +271,12 @@ PALETTE_INIT( tia_PAL )
VIDEO_START( tia )
{
- int cx = machine->primary_screen->width();
+ int cx = machine.primary_screen->width();
- screen_height = machine->primary_screen->height();
- helper[0] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine->primary_screen->format());
- helper[1] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine->primary_screen->format());
- helper[2] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine->primary_screen->format());
+ screen_height = machine.primary_screen->height();
+ helper[0] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine.primary_screen->format());
+ helper[1] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine.primary_screen->format());
+ helper[2] = auto_bitmap_alloc(machine, cx, TIA_MAX_SCREEN_HEIGHT, machine.primary_screen->format());
}
@@ -508,13 +508,13 @@ static int collision_check(UINT8* p1, UINT8* p2, int x1, int x2)
INLINE int current_x(address_space *space)
{
- return 3 * ((space->machine->firstcpu->total_cycles() - frame_cycles) % 76) - 68;
+ return 3 * ((space->machine().firstcpu->total_cycles() - frame_cycles) % 76) - 68;
}
INLINE int current_y(address_space *space)
{
- return (space->machine->firstcpu->total_cycles() - frame_cycles) / 76;
+ return (space->machine().firstcpu->total_cycles() - frame_cycles) / 76;
}
@@ -853,7 +853,7 @@ static void update_bitmap(int next_x, int next_y)
static WRITE8_HANDLER( WSYNC_w )
{
- int cycles = space->machine->firstcpu->total_cycles() - frame_cycles;
+ int cycles = space->machine().firstcpu->total_cycles() - frame_cycles;
if (cycles % 76)
{
@@ -872,8 +872,8 @@ static WRITE8_HANDLER( VSYNC_w )
if ( curr_y > 5 )
update_bitmap(
- space->machine->primary_screen->width(),
- space->machine->primary_screen->height());
+ space->machine().primary_screen->width(),
+ space->machine().primary_screen->height());
if ( tia_vsync_callback ) {
tia_vsync_callback( space, 0, curr_y, 0xFFFF );
@@ -894,7 +894,7 @@ static WRITE8_HANDLER( VBLANK_w )
{
if (data & 0x80)
{
- paddle_cycles = space->machine->firstcpu->total_cycles();
+ paddle_cycles = space->machine().firstcpu->total_cycles();
}
if ( ! ( VBLANK & 0x40 ) ) {
INPT4 = 0x80;
@@ -1647,7 +1647,7 @@ static WRITE8_HANDLER( GRP1_w )
static READ8_HANDLER( INPT_r )
{
- UINT64 elapsed = space->machine->firstcpu->total_cycles() - paddle_cycles;
+ UINT64 elapsed = space->machine().firstcpu->total_cycles() - paddle_cycles;
int input = TIA_INPUT_PORT_ALWAYS_ON;
if ( tia_read_input_port )
{
@@ -1863,7 +1863,7 @@ WRITE8_HANDLER( tia_w )
case 0x18: /* AUDF1 */
case 0x19: /* AUDV0 */
case 0x1A: /* AUDV1 */
- tia_sound_w(space->machine->device("tia"), offset, data);
+ tia_sound_w(space->machine().device("tia"), offset, data);
break;
case 0x1B:
@@ -1979,9 +1979,9 @@ static void tia_reset(running_machine &machine)
-void tia_init(running_machine *machine, const struct tia_interface* ti)
+void tia_init(running_machine &machine, const struct tia_interface* ti)
{
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call tia_init at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call tia_init at init time!");
if ( ti ) {
tia_read_input_port = ti->read_input_port;
@@ -1993,8 +1993,8 @@ void tia_init(running_machine *machine, const struct tia_interface* ti)
tia_vsync_callback = NULL;
}
- tia_reset( *machine );
+ tia_reset( machine );
- machine->add_notifier(MACHINE_NOTIFY_RESET, tia_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, tia_reset);
}
diff --git a/src/mame/video/tia.h b/src/mame/video/tia.h
index 0b274060e01..e4ec734280d 100644
--- a/src/mame/video/tia.h
+++ b/src/mame/video/tia.h
@@ -21,6 +21,6 @@ SCREEN_UPDATE( tia );
READ8_HANDLER( tia_r );
WRITE8_HANDLER( tia_w );
-void tia_init(running_machine *machine, const struct tia_interface* ti);
+void tia_init(running_machine &machine, const struct tia_interface* ti);
#endif /* _VIDEO_TIA_H_ */
diff --git a/src/mame/video/tiamc1.c b/src/mame/video/tiamc1.c
index 364b518c608..0b59c7a6fc5 100644
--- a/src/mame/video/tiamc1.c
+++ b/src/mame/video/tiamc1.c
@@ -13,7 +13,7 @@
WRITE8_HANDLER( tiamc1_videoram_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
if(!(state->layers_ctrl & 2))
state->charram[offset + 0x0000] = data;
if(!(state->layers_ctrl & 4))
@@ -24,7 +24,7 @@ WRITE8_HANDLER( tiamc1_videoram_w )
state->charram[offset + 0x1800] = data;
if ((state->layers_ctrl & (16|8|4|2)) != (16|8|4|2))
- gfx_element_mark_dirty(space->machine->gfx[0], (offset / 8) & 0xff);
+ gfx_element_mark_dirty(space->machine().gfx[0], (offset / 8) & 0xff);
if(!(state->layers_ctrl & 1)) {
state->tileram[offset] = data;
@@ -37,58 +37,58 @@ WRITE8_HANDLER( tiamc1_videoram_w )
WRITE8_HANDLER( tiamc1_bankswitch_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
if ((data & 128) != (state->layers_ctrl & 128))
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->layers_ctrl = data;
}
WRITE8_HANDLER( tiamc1_sprite_x_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->spriteram_x[offset] = data;
}
WRITE8_HANDLER( tiamc1_sprite_y_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->spriteram_y[offset] = data;
}
WRITE8_HANDLER( tiamc1_sprite_a_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->spriteram_a[offset] = data;
}
WRITE8_HANDLER( tiamc1_sprite_n_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->spriteram_n[offset] = data;
}
WRITE8_HANDLER( tiamc1_bg_vshift_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->bg_vshift = data;
}
WRITE8_HANDLER( tiamc1_bg_hshift_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
state->bg_hshift = data;
}
WRITE8_HANDLER( tiamc1_palette_w )
{
- tiamc1_state *state = space->machine->driver_data<tiamc1_state>();
- palette_set_color(space->machine, offset, state->palette[data]);
+ tiamc1_state *state = space->machine().driver_data<tiamc1_state>();
+ palette_set_color(space->machine(), offset, state->palette[data]);
}
PALETTE_INIT( tiamc1 )
{
- tiamc1_state *state = machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = machine.driver_data<tiamc1_state>();
// Voltage computed by Proteus
//static const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
//static const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
@@ -122,19 +122,19 @@ PALETTE_INIT( tiamc1 )
static TILE_GET_INFO( get_bg1_tile_info )
{
- tiamc1_state *state = machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = machine.driver_data<tiamc1_state>();
SET_TILE_INFO(0, state->tileram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- tiamc1_state *state = machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = machine.driver_data<tiamc1_state>();
SET_TILE_INFO(0, state->tileram[tile_index + 1024], 0, 0);
}
VIDEO_START( tiamc1 )
{
- tiamc1_state *state = machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = machine.driver_data<tiamc1_state>();
UINT8 *video_ram;
video_ram = auto_alloc_array_clear(machine, UINT8, 0x3040);
@@ -162,12 +162,12 @@ VIDEO_START( tiamc1 )
state_save_register_global(machine, state->bg_vshift);
state_save_register_global(machine, state->bg_hshift);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tiamc1_state *state = machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = machine.driver_data<tiamc1_state>();
int offs;
for (offs = 0; offs < 16; offs++)
@@ -181,7 +181,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
spritecode = state->spriteram_n[offs] ^ 0xff;
if (!(state->spriteram_a[offs] & 0x01))
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
spritecode,
0,
flipx, flipy,
@@ -191,7 +191,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tiamc1 )
{
- tiamc1_state *state = screen->machine->driver_data<tiamc1_state>();
+ tiamc1_state *state = screen->machine().driver_data<tiamc1_state>();
#if 0
int i;
@@ -214,7 +214,7 @@ SCREEN_UPDATE( tiamc1 )
tilemap_draw(bitmap, cliprect, state->bg_tilemap1, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/tigeroad.c b/src/mame/video/tigeroad.c
index 3dfdf739077..53143f16e38 100644
--- a/src/mame/video/tigeroad.c
+++ b/src/mame/video/tigeroad.c
@@ -4,7 +4,7 @@
WRITE16_HANDLER( tigeroad_videoram_w )
{
- tigeroad_state *state = space->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -12,7 +12,7 @@ WRITE16_HANDLER( tigeroad_videoram_w )
WRITE16_HANDLER( tigeroad_videoctrl_w )
{
- tigeroad_state *state = space->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
int bank;
if (ACCESSING_BITS_8_15)
@@ -21,10 +21,10 @@ WRITE16_HANDLER( tigeroad_videoctrl_w )
/* bit 1 flips screen */
- if (flip_screen_get(space->machine) != (data & 0x02))
+ if (flip_screen_get(space->machine()) != (data & 0x02))
{
- flip_screen_set(space->machine, data & 0x02);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x02);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 2 selects bg char bank */
@@ -39,19 +39,19 @@ WRITE16_HANDLER( tigeroad_videoctrl_w )
/* bits 4-5 are coin lockouts */
- coin_lockout_w(space->machine, 0, !(data & 0x10));
- coin_lockout_w(space->machine, 1, !(data & 0x20));
+ coin_lockout_w(space->machine(), 0, !(data & 0x10));
+ coin_lockout_w(space->machine(), 1, !(data & 0x20));
/* bits 6-7 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
}
WRITE16_HANDLER( tigeroad_scroll_w )
{
- tigeroad_state *state = space->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = space->machine().driver_data<tigeroad_state>();
int scroll = 0;
COMBINE_DATA(&scroll);
@@ -67,10 +67,10 @@ WRITE16_HANDLER( tigeroad_scroll_w )
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- UINT16 *source = &machine->generic.buffered_spriteram.u16[machine->generic.spriteram_size/2] - 4;
- UINT16 *finish = machine->generic.buffered_spriteram.u16;
+ UINT16 *source = &machine.generic.buffered_spriteram.u16[machine.generic.spriteram_size/2] - 4;
+ UINT16 *finish = machine.generic.buffered_spriteram.u16;
// TODO: The Track Map should probably be drawn on top of the background tilemap...
// Also convert the below into a for loop!
@@ -100,7 +100,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
tile_number,
color,
flipx, flipy,
@@ -113,8 +113,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static TILE_GET_INFO( get_bg_tile_info )
{
- tigeroad_state *state = machine->driver_data<tigeroad_state>();
- UINT8 *tilerom = machine->region("gfx4")->base();
+ tigeroad_state *state = machine.driver_data<tigeroad_state>();
+ UINT8 *tilerom = machine.region("gfx4")->base();
int data = tilerom[tile_index];
int attr = tilerom[tile_index + 1];
@@ -128,7 +128,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- tigeroad_state *state = machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = machine.driver_data<tigeroad_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
int attr = data >> 8;
@@ -147,7 +147,7 @@ static TILEMAP_MAPPER( tigeroad_tilemap_scan )
VIDEO_START( tigeroad )
{
- tigeroad_state *state = machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = machine.driver_data<tigeroad_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tigeroad_tilemap_scan,
32, 32, 128, 128);
@@ -162,18 +162,18 @@ VIDEO_START( tigeroad )
SCREEN_UPDATE( tigeroad )
{
- tigeroad_state *state = screen->machine->driver_data<tigeroad_state>();
+ tigeroad_state *state = screen->machine().driver_data<tigeroad_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 1);
- //draw_sprites(screen->machine, bitmap, cliprect, 1); draw priority sprites?
+ //draw_sprites(screen->machine(), bitmap, cliprect, 1); draw priority sprites?
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 2);
return 0;
}
SCREEN_EOF( tigeroad )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c
index f06fdc15bc8..3abd28d781c 100644
--- a/src/mame/video/timelimt.c
+++ b/src/mame/video/timelimt.c
@@ -23,7 +23,7 @@
PALETTE_INIT( timelimt ) {
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -55,20 +55,20 @@ PALETTE_INIT( timelimt ) {
static TILE_GET_INFO( get_bg_tile_info )
{
- timelimt_state *state = machine->driver_data<timelimt_state>();
+ timelimt_state *state = machine.driver_data<timelimt_state>();
SET_TILE_INFO(1, state->bg_videoram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- timelimt_state *state = machine->driver_data<timelimt_state>();
+ timelimt_state *state = machine.driver_data<timelimt_state>();
UINT8 *videoram = state->videoram;
SET_TILE_INFO(0, videoram[tile_index], 0, 0);
}
VIDEO_START( timelimt )
{
- timelimt_state *state = machine->driver_data<timelimt_state>();
+ timelimt_state *state = machine.driver_data<timelimt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 64, 32);
@@ -82,7 +82,7 @@ VIDEO_START( timelimt )
WRITE8_HANDLER( timelimt_videoram_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -90,35 +90,35 @@ WRITE8_HANDLER( timelimt_videoram_w )
WRITE8_HANDLER( timelimt_bg_videoram_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( timelimt_scroll_x_lsb_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
state->scrollx &= 0x100;
state->scrollx |= data & 0xff;
}
WRITE8_HANDLER( timelimt_scroll_x_msb_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
state->scrollx &= 0xff;
state->scrollx |= ( data & 1 ) << 8;
}
WRITE8_HANDLER( timelimt_scroll_y_w )
{
- timelimt_state *state = space->machine->driver_data<timelimt_state>();
+ timelimt_state *state = space->machine().driver_data<timelimt_state>();
state->scrolly = data;
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- timelimt_state *state = machine->driver_data<timelimt_state>();
+ timelimt_state *state = machine.driver_data<timelimt_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -134,7 +134,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
code += ( attr & 0x80 ) ? 0x40 : 0x00;
code += ( attr & 0x40 ) ? 0x80 : 0x00;
- drawgfx_transpen( bitmap, cliprect,machine->gfx[2],
+ drawgfx_transpen( bitmap, cliprect,machine.gfx[2],
code,
attr & 7,
flipx,flipy,
@@ -145,12 +145,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( timelimt )
{
- timelimt_state *state = screen->machine->driver_data<timelimt_state>();
+ timelimt_state *state = screen->machine().driver_data<timelimt_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scrollx);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scrolly);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/timeplt.c b/src/mame/video/timeplt.c
index 89cf5280114..18e4b366272 100644
--- a/src/mame/video/timeplt.c
+++ b/src/mame/video/timeplt.c
@@ -91,7 +91,7 @@ PALETTE_INIT( timeplt )
static TILE_GET_INFO( get_tile_info )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 8 * (attr & 0x20);
int color = attr & 0x1f;
@@ -103,7 +103,7 @@ static TILE_GET_INFO( get_tile_info )
static TILE_GET_INFO( get_chkun_tile_info )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x60) << 3);
int color = attr & 0x1f;
@@ -123,13 +123,13 @@ static TILE_GET_INFO( get_chkun_tile_info )
VIDEO_START( timeplt )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
VIDEO_START( chkun )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
state->bg_tilemap = tilemap_create(machine, get_chkun_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -143,7 +143,7 @@ VIDEO_START( chkun )
WRITE8_HANDLER( timeplt_videoram_w )
{
- timeplt_state *state = space->machine->driver_data<timeplt_state>();
+ timeplt_state *state = space->machine().driver_data<timeplt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -151,7 +151,7 @@ WRITE8_HANDLER( timeplt_videoram_w )
WRITE8_HANDLER( timeplt_colorram_w )
{
- timeplt_state *state = space->machine->driver_data<timeplt_state>();
+ timeplt_state *state = space->machine().driver_data<timeplt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -159,13 +159,13 @@ WRITE8_HANDLER( timeplt_colorram_w )
WRITE8_HANDLER( timeplt_flipscreen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
READ8_HANDLER( timeplt_scanline_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -176,9 +176,9 @@ READ8_HANDLER( timeplt_scanline_r )
*
*************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- timeplt_state *state = machine->driver_data<timeplt_state>();
+ timeplt_state *state = machine.driver_data<timeplt_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -193,7 +193,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
int flipx = ~spriteram_2[offs] & 0x40;
int flipy = spriteram_2[offs] & 0x80;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -211,10 +211,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( timeplt )
{
- timeplt_state *state = screen->machine->driver_data<timeplt_state>();
+ timeplt_state *state = screen->machine().driver_data<timeplt_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0);
return 0;
}
diff --git a/src/mame/video/tmnt.c b/src/mame/video/tmnt.c
index 733fc3e53f9..f5860cfa1a7 100644
--- a/src/mame/video/tmnt.c
+++ b/src/mame/video/tmnt.c
@@ -4,8 +4,8 @@
static TILE_GET_INFO( glfgreat_get_roz_tile_info )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
- UINT8 *rom = machine->region("user1")->base();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
+ UINT8 *rom = machine.region("user1")->base();
int code;
tile_index += 0x40000 * state->glfgreat_roz_rom_bank;
@@ -17,7 +17,7 @@ static TILE_GET_INFO( glfgreat_get_roz_tile_info )
static TILE_GET_INFO( prmrsocr_get_roz_tile_info )
{
- UINT8 *rom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("user1")->base();
int code = rom[tile_index + 0x20000] + 256 * rom[tile_index];
SET_TILE_INFO(0, code & 0x1fff, code >> 13, 0);
@@ -33,9 +33,9 @@ static TILE_GET_INFO( prmrsocr_get_roz_tile_info )
/* Missing in Action */
-void mia_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void mia_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
*flags = (*color & 0x04) ? TILE_FLIPX : 0;
if (layer == 0)
{
@@ -49,9 +49,9 @@ void mia_tile_callback( running_machine *machine, int layer, int bank, int *code
}
}
-void cuebrick_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void cuebrick_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
if ((k052109_get_rmrd_line(state->k052109) == CLEAR_LINE) && (layer == 0))
{
@@ -65,16 +65,16 @@ void cuebrick_tile_callback( running_machine *machine, int layer, int bank, int
}
}
-void tmnt_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void tmnt_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
-void ssbl_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void ssbl_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
if (layer == 0)
{
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
@@ -88,9 +88,9 @@ void ssbl_tile_callback( running_machine *machine, int layer, int bank, int *cod
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
-void blswhstl_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void blswhstl_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x01) << 8) | ((*color & 0x10) << 5) | ((*color & 0x0c) << 8) | (bank << 12) | state->blswhstl_rombank << 14;
@@ -105,22 +105,22 @@ void blswhstl_tile_callback( running_machine *machine, int layer, int bank, int
***************************************************************************/
-void mia_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void mia_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
*color = state->sprite_colorbase + (*color & 0x0f);
}
-void tmnt_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void tmnt_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
*code |= (*color & 0x10) << 9;
*color = state->sprite_colorbase + (*color & 0x0f);
}
-void punkshot_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask, int *shadow )
+void punkshot_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask, int *shadow )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -135,9 +135,9 @@ void punkshot_sprite_callback( running_machine *machine, int *code, int *color,
*color = state->sprite_colorbase + (*color & 0x0f);
}
-void thndrx2_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask, int *shadow )
+void thndrx2_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask, int *shadow )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -158,9 +158,9 @@ void thndrx2_sprite_callback( running_machine *machine, int *code, int *color, i
***************************************************************************/
-void lgtnfght_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void lgtnfght_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -174,9 +174,9 @@ void lgtnfght_sprite_callback( running_machine *machine, int *code, int *color,
*color = state->sprite_colorbase + (*color & 0x1f);
}
-void blswhstl_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void blswhstl_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
#if 0
if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x20)) *color = rand();
if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand();
@@ -195,9 +195,9 @@ if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x80)) *color = rand();
*color = state->sprite_colorbase + (*color & 0x1f);
}
-void prmrsocr_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void prmrsocr_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
int pri = 0x20 | ((*color & 0x60) >> 2);
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -223,7 +223,7 @@ void prmrsocr_sprite_callback( running_machine *machine, int *code, int *color,
VIDEO_START( cuebrick )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 32;
state->layer_colorbase[2] = 40;
@@ -232,7 +232,7 @@ VIDEO_START( cuebrick )
VIDEO_START( mia )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 32;
state->layer_colorbase[2] = 40;
@@ -244,7 +244,7 @@ VIDEO_START( mia )
VIDEO_START( tmnt )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 32;
state->layer_colorbase[2] = 40;
@@ -258,7 +258,7 @@ VIDEO_START( tmnt )
VIDEO_START( lgtnfght ) /* also tmnt2, ssriders */
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
k05324x_set_z_rejection(state->k053245, 0);
@@ -272,7 +272,7 @@ VIDEO_START( lgtnfght ) /* also tmnt2, ssriders */
VIDEO_START( glfgreat )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->roz_tilemap = tilemap_create(machine, glfgreat_get_roz_tile_info, tilemap_scan_rows, 16, 16, 512, 512);
tilemap_set_transparent_pen(state->roz_tilemap,0);
@@ -287,7 +287,7 @@ VIDEO_START( glfgreat )
VIDEO_START( prmrsocr )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->roz_tilemap = tilemap_create(machine, prmrsocr_get_roz_tile_info, tilemap_scan_rows, 16, 16, 512, 256);
tilemap_set_transparent_pen(state->roz_tilemap,0);
@@ -300,7 +300,7 @@ VIDEO_START( prmrsocr )
VIDEO_START( blswhstl )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
state->blswhstl_rombank = -1;
state->save_item(NAME(state->blswhstl_rombank));
@@ -315,24 +315,24 @@ VIDEO_START( blswhstl )
WRITE16_HANDLER( tmnt_paletteram_word_w )
{
- COMBINE_DATA(space->machine->generic.paletteram.u16 + offset);
+ COMBINE_DATA(space->machine().generic.paletteram.u16 + offset);
offset &= ~1;
- data = (space->machine->generic.paletteram.u16[offset] << 8) | space->machine->generic.paletteram.u16[offset + 1];
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ data = (space->machine().generic.paletteram.u16[offset] << 8) | space->machine().generic.paletteram.u16[offset + 1];
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
}
WRITE16_HANDLER( tmnt_0a0000_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02); /* 2 players version */
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02); /* 2 players version */
/* bit 3 high then low triggers irq on sound CPU */
if (state->last == 0x08 && (data & 0x08) == 0)
@@ -352,12 +352,12 @@ WRITE16_HANDLER( tmnt_0a0000_w )
WRITE16_HANDLER( punkshot_0a0020_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
/* bit 2 = trigger irq on sound CPU */
if (state->last == 0x04 && (data & 0x04) == 0)
@@ -372,13 +372,13 @@ WRITE16_HANDLER( punkshot_0a0020_w )
WRITE16_HANDLER( lgtnfght_0a0018_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0,1 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 = trigger irq on sound CPU */
if (state->last == 0x00 && (data & 0x04) == 0x04)
@@ -393,13 +393,13 @@ WRITE16_HANDLER( lgtnfght_0a0018_w )
WRITE16_HANDLER( blswhstl_700300_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0,1 = coin counter */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
@@ -408,7 +408,7 @@ WRITE16_HANDLER( blswhstl_700300_w )
if (state->blswhstl_rombank != ((data & 0x80) >> 7))
{
state->blswhstl_rombank = (data & 0x80) >> 7;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* other bits unknown */
@@ -418,28 +418,28 @@ WRITE16_HANDLER( blswhstl_700300_w )
READ16_HANDLER( glfgreat_rom_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (state->glfgreat_roz_rom_mode)
- return space->machine->region("gfx3")->base()[state->glfgreat_roz_char_bank * 0x80000 + offset];
+ return space->machine().region("gfx3")->base()[state->glfgreat_roz_char_bank * 0x80000 + offset];
else if (offset < 0x40000)
{
- UINT8 *usr = space->machine->region("user1")->base();
+ UINT8 *usr = space->machine().region("user1")->base();
return usr[offset + 0x80000 + state->glfgreat_roz_rom_bank * 0x40000] + 256 * usr[offset + state->glfgreat_roz_rom_bank * 0x40000];
}
else
- return space->machine->region("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + state->glfgreat_roz_rom_bank * 0x10000];
+ return space->machine().region("user1")->base()[((offset & 0x3ffff) >> 2) + 0x100000 + state->glfgreat_roz_rom_bank * 0x10000];
}
WRITE16_HANDLER( glfgreat_122000_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0,1 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 4 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
@@ -466,14 +466,14 @@ WRITE16_HANDLER( glfgreat_122000_w )
WRITE16_HANDLER( ssriders_eeprom_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
/* bits 3-4 control palette dimming */
/* 4 = DIMPOL = when set, negate SHAD */
@@ -487,13 +487,13 @@ WRITE16_HANDLER( ssriders_eeprom_w )
WRITE16_HANDLER( ssriders_1c0300_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0,1 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
@@ -505,13 +505,13 @@ WRITE16_HANDLER( ssriders_1c0300_w )
WRITE16_HANDLER( prmrsocr_122000_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
/* bit 0,1 = coin counter */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 4 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x10) ? ASSERT_LINE : CLEAR_LINE);
@@ -529,20 +529,20 @@ WRITE16_HANDLER( prmrsocr_122000_w )
READ16_HANDLER( prmrsocr_rom_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if(state->glfgreat_roz_char_bank)
- return space->machine->region("gfx3")->base()[offset];
+ return space->machine().region("gfx3")->base()[offset];
else
{
- UINT8 *usr = space->machine->region("user1")->base();
+ UINT8 *usr = space->machine().region("user1")->base();
return 256 * usr[offset] + usr[offset + 0x020000];
}
}
WRITE16_HANDLER( tmnt_priority_w )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
if (ACCESSING_BITS_0_7)
{
@@ -578,7 +578,7 @@ WRITE16_HANDLER( tmnt_priority_w )
SCREEN_UPDATE( mia )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
k052109_tilemap_update(state->k052109);
@@ -593,7 +593,7 @@ SCREEN_UPDATE( mia )
SCREEN_UPDATE( tmnt )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
k052109_tilemap_update(state->k052109);
@@ -609,7 +609,7 @@ SCREEN_UPDATE( tmnt )
SCREEN_UPDATE( punkshot )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
state->sprite_colorbase = k053251_get_palette_index(state->k053251, K053251_CI1);
state->layer_colorbase[0] = k053251_get_palette_index(state->k053251, K053251_CI2);
@@ -627,7 +627,7 @@ SCREEN_UPDATE( punkshot )
konami_sortlayers3(state->sorted_layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[0], TILEMAP_DRAW_OPAQUE, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[1], 0, 2);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[2], 0, 4);
@@ -639,7 +639,7 @@ SCREEN_UPDATE( punkshot )
SCREEN_UPDATE( lgtnfght )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -659,7 +659,7 @@ SCREEN_UPDATE( lgtnfght )
konami_sortlayers3(state->sorted_layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[0], 0, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[1], 0, 2);
@@ -672,7 +672,7 @@ SCREEN_UPDATE( lgtnfght )
READ16_HANDLER( glfgreat_ball_r )
{
- tmnt_state *state = space->machine->driver_data<tmnt_state>();
+ tmnt_state *state = space->machine().driver_data<tmnt_state>();
#ifdef MAME_DEBUG
popmessage("%04x", state->glfgreat_pixel);
@@ -686,7 +686,7 @@ popmessage("%04x", state->glfgreat_pixel);
SCREEN_UPDATE( glfgreat )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -708,7 +708,7 @@ SCREEN_UPDATE( glfgreat )
/* not sure about the 053936 priority, but it seems to work */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect,16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[0], 0, 1);
@@ -740,7 +740,7 @@ SCREEN_UPDATE( glfgreat )
SCREEN_UPDATE( tmnt2 )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
double brt;
int i, newdim, newen, cb, ce;
@@ -769,21 +769,21 @@ SCREEN_UPDATE( tmnt2 )
// dim all colors before it
for (i = 0; i < cb; i++)
- palette_set_pen_contrast(screen->machine, i, brt);
+ palette_set_pen_contrast(screen->machine(), i, brt);
// reset all colors in range
for (i = cb; i < ce; i++)
- palette_set_pen_contrast(screen->machine, i, 1.0);
+ palette_set_pen_contrast(screen->machine(), i, 1.0);
// dim all colors after it
for (i = ce; i < 2048; i++)
- palette_set_pen_contrast(screen->machine, i, brt);
+ palette_set_pen_contrast(screen->machine(), i, brt);
// toggle shadow/highlight
if (~state->dim_c & 0x10)
- palette_set_shadow_mode(screen->machine, 1);
+ palette_set_shadow_mode(screen->machine(), 1);
else
- palette_set_shadow_mode(screen->machine, 0);
+ palette_set_shadow_mode(screen->machine(), 0);
}
SCREEN_UPDATE_CALL(lgtnfght);
@@ -793,7 +793,7 @@ SCREEN_UPDATE( tmnt2 )
SCREEN_UPDATE( thndrx2 )
{
- tmnt_state *state = screen->machine->driver_data<tmnt_state>();
+ tmnt_state *state = screen->machine().driver_data<tmnt_state>();
int bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI0);
@@ -813,7 +813,7 @@ SCREEN_UPDATE( thndrx2 )
konami_sortlayers3(state->sorted_layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[0], 0, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, state->sorted_layer[1], 0, 2);
@@ -833,6 +833,6 @@ SCREEN_UPDATE( thndrx2 )
SCREEN_EOF( blswhstl )
{
- tmnt_state *state = machine->driver_data<tmnt_state>();
+ tmnt_state *state = machine.driver_data<tmnt_state>();
k053245_clear_buffer(state->k053245);
}
diff --git a/src/mame/video/tnzs.c b/src/mame/video/tnzs.c
index 2c08d024b4e..eddbfe11322 100644
--- a/src/mame/video/tnzs.c
+++ b/src/mame/video/tnzs.c
@@ -34,7 +34,7 @@ PALETTE_INIT( arknoid2 )
{
int i, col;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
col = (color_prom[i] << 8) + color_prom[i + 512];
palette_set_color_rgb(machine, i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
@@ -43,9 +43,9 @@ PALETTE_INIT( arknoid2 )
-static void draw_background( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *m )
+static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *m )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
int x, y, column, tot, transpen;
int scrollx, scrolly;
UINT32 upperbits;
@@ -104,7 +104,7 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
@@ -112,7 +112,7 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
transpen);
/* wrap around x */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
@@ -126,10 +126,10 @@ static void draw_background( running_machine *machine, bitmap_t *bitmap, const r
}
-static void draw_foreground( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,
+static void draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
UINT8 *char_pointer, UINT8 *x_pointer, UINT8 *y_pointer, UINT8 *ctrl_pointer, UINT8 *color_pointer)
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
int i;
int ctrl2 = state->objctrl[1];
@@ -163,14 +163,14 @@ static void draw_foreground( running_machine *machine, bitmap_t *bitmap, const r
if ((sy == 0) && (code == 0)) sy += 240;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
sx,sy+2,0);
/* wrap around x */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
@@ -180,7 +180,7 @@ static void draw_foreground( running_machine *machine, bitmap_t *bitmap, const r
SCREEN_UPDATE( tnzs )
{
- tnzs_state *state = screen->machine->driver_data<tnzs_state>();
+ tnzs_state *state = screen->machine().driver_data<tnzs_state>();
/* If the byte at f300 has bit 6 set, flip the screen
(I'm not 100% sure about this) */
state->screenflip = (state->objctrl[0] & 0x40) >> 6;
@@ -190,10 +190,10 @@ SCREEN_UPDATE( tnzs )
bitmap_fill(bitmap, cliprect, 0x1f0);
/* Redraw the background tiles (c400-c5ff) */
- draw_background(screen->machine, bitmap, cliprect, state->objram + 0x400);
+ draw_background(screen->machine(), bitmap, cliprect, state->objram + 0x400);
/* Draw the sprites on top */
- draw_foreground(screen->machine, bitmap, cliprect,
+ draw_foreground(screen->machine(), bitmap, cliprect,
state->objram + 0x0000, /* chars : c000 */
state->objram + 0x0200, /* x : c200 */
state->vdcram + 0x0000, /* y : f000 */
@@ -204,7 +204,7 @@ SCREEN_UPDATE( tnzs )
SCREEN_EOF( tnzs )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ tnzs_state *state = machine.driver_data<tnzs_state>();
int ctrl2 = state->objctrl[1];
if (~ctrl2 & 0x20)
{
diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c
index 6110b15a355..f4895fb7b12 100644
--- a/src/mame/video/toaplan1.c
+++ b/src/mame/video/toaplan1.c
@@ -138,7 +138,7 @@ Abnormalities:
static TILE_GET_INFO( get_pf1_tile_info )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
int color, tile_number, attrib;
tile_number = state->pf1_tilevram16[2*tile_index+1] & 0x7fff;
@@ -155,7 +155,7 @@ static TILE_GET_INFO( get_pf1_tile_info )
static TILE_GET_INFO( get_pf2_tile_info )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
int color, tile_number, attrib;
tile_number = state->pf2_tilevram16[2*tile_index+1] & 0x7fff;
@@ -172,7 +172,7 @@ static TILE_GET_INFO( get_pf2_tile_info )
static TILE_GET_INFO( get_pf3_tile_info )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
int color, tile_number, attrib;
tile_number = state->pf3_tilevram16[2*tile_index+1] & 0x7fff;
@@ -189,7 +189,7 @@ static TILE_GET_INFO( get_pf3_tile_info )
static TILE_GET_INFO( get_pf4_tile_info )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
int color, tile_number, attrib;
tile_number = state->pf4_tilevram16[2*tile_index+1] & 0x7fff;
@@ -210,9 +210,9 @@ static TILE_GET_INFO( get_pf4_tile_info )
***************************************************************************/
-static void toaplan1_create_tilemaps(running_machine *machine)
+static void toaplan1_create_tilemaps(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->pf1_tilemap = tilemap_create(machine, get_pf1_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
state->pf2_tilemap = tilemap_create(machine, get_pf2_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -228,18 +228,18 @@ static void toaplan1_create_tilemaps(running_machine *machine)
}
-static void toaplan1_paletteram_alloc(running_machine *machine)
+static void toaplan1_paletteram_alloc(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
- machine->generic.paletteram.u16 = auto_alloc_array(machine, UINT16, (state->colorram1_size + state->colorram2_size)/2);
+ machine.generic.paletteram.u16 = auto_alloc_array(machine, UINT16, (state->colorram1_size + state->colorram2_size)/2);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u16, (state->colorram1_size + state->colorram2_size)/2);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u16, (state->colorram1_size + state->colorram2_size)/2);
}
-static void toaplan1_vram_alloc(running_machine *machine)
+static void toaplan1_vram_alloc(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->pf1_tilevram16 = auto_alloc_array_clear(machine, UINT16, TOAPLAN1_TILEVRAM_SIZE/2);
state->pf2_tilevram16 = auto_alloc_array_clear(machine, UINT16, TOAPLAN1_TILEVRAM_SIZE/2);
@@ -260,9 +260,9 @@ static void toaplan1_vram_alloc(running_machine *machine)
#endif
}
-static void toaplan1_spritevram_alloc(running_machine *machine)
+static void toaplan1_spritevram_alloc(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->spriteram = auto_alloc_array_clear(machine, UINT16, TOAPLAN1_SPRITERAM_SIZE/2);
state->buffered_spriteram = auto_alloc_array_clear(machine, UINT16, TOAPLAN1_SPRITERAM_SIZE/2);
@@ -277,9 +277,9 @@ static void toaplan1_spritevram_alloc(running_machine *machine)
state->spriteram_size = TOAPLAN1_SPRITERAM_SIZE;
}
-static void toaplan1_set_scrolls(running_machine *machine)
+static void toaplan1_set_scrolls(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
tilemap_set_scrollx(state->pf1_tilemap, 0, (state->pf1_scrollx >> 7) - (state->tiles_offsetx - state->scrollx_offs1));
tilemap_set_scrollx(state->pf2_tilemap, 0, (state->pf2_scrollx >> 7) - (state->tiles_offsetx - state->scrollx_offs2));
@@ -293,23 +293,23 @@ static void toaplan1_set_scrolls(running_machine *machine)
static STATE_POSTLOAD( rallybik_flipscreen )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
rallybik_bcu_flipscreen_w(space, 0, state->bcu_flipscreen, 0xffff);
}
static STATE_POSTLOAD( toaplan1_flipscreen )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
toaplan1_bcu_flipscreen_w(space, 0, state->bcu_flipscreen, 0xffff);
}
-static void register_common(running_machine *machine)
+static void register_common(running_machine &machine)
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
state->save_item(NAME(state->scrollx_offs1));
state->save_item(NAME(state->scrollx_offs2));
@@ -339,7 +339,7 @@ static void register_common(running_machine *machine)
VIDEO_START( rallybik )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
toaplan1_create_tilemaps(machine);
toaplan1_paletteram_alloc(machine);
@@ -360,12 +360,12 @@ VIDEO_START( rallybik )
register_common(machine);
- machine->state().register_postload(rallybik_flipscreen, NULL);
+ machine.state().register_postload(rallybik_flipscreen, NULL);
}
VIDEO_START( toaplan1 )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
toaplan1_create_tilemaps(machine);
toaplan1_paletteram_alloc(machine);
@@ -384,7 +384,7 @@ VIDEO_START( toaplan1 )
register_common(machine);
- machine->state().register_postload(toaplan1_flipscreen, NULL);
+ machine.state().register_postload(toaplan1_flipscreen, NULL);
}
@@ -396,12 +396,12 @@ VIDEO_START( toaplan1 )
READ16_HANDLER( toaplan1_frame_done_r )
{
- return space->machine->primary_screen->vblank();
+ return space->machine().primary_screen->vblank();
}
WRITE16_HANDLER( toaplan1_tile_offsets_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
if ( offset == 0 )
{
@@ -414,18 +414,18 @@ WRITE16_HANDLER( toaplan1_tile_offsets_w )
logerror("Tiles_offsety now = %08x\n", state->tiles_offsety);
}
state->reset = 1;
- toaplan1_set_scrolls(space->machine);
+ toaplan1_set_scrolls(space->machine());
}
WRITE16_HANDLER( rallybik_bcu_flipscreen_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
if (ACCESSING_BITS_0_7 && (data != state->bcu_flipscreen))
{
logerror("Setting BCU controller flipscreen port to %04x\n",data);
state->bcu_flipscreen = data & 0x01; /* 0x0001 = flip, 0x0000 = no flip */
- tilemap_set_flip_all(space->machine, (data ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
+ tilemap_set_flip_all(space->machine(), (data ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
if (state->bcu_flipscreen)
{
state->scrollx_offs1 = 0x1c0 - 6;
@@ -442,22 +442,22 @@ WRITE16_HANDLER( rallybik_bcu_flipscreen_w )
state->scrollx_offs4 = 0x00d + 0;
state->scrolly_offs = 0x111;
}
- toaplan1_set_scrolls(space->machine);
+ toaplan1_set_scrolls(space->machine());
}
}
WRITE16_HANDLER( toaplan1_bcu_flipscreen_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
if (ACCESSING_BITS_0_7 && (data != state->bcu_flipscreen))
{
logerror("Setting BCU controller flipscreen port to %04x\n",data);
state->bcu_flipscreen = data & 0x01; /* 0x0001 = flip, 0x0000 = no flip */
- tilemap_set_flip_all(space->machine, (data ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
+ tilemap_set_flip_all(space->machine(), (data ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
if (state->bcu_flipscreen)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
state->scrollx_offs1 = 0x151 - 6;
state->scrollx_offs2 = 0x151 - 4;
@@ -474,7 +474,7 @@ WRITE16_HANDLER( toaplan1_bcu_flipscreen_w )
state->scrollx_offs4 = 0x1ef + 0;
state->scrolly_offs = 0x101;
}
- toaplan1_set_scrolls(space->machine);
+ toaplan1_set_scrolls(space->machine());
}
}
@@ -482,7 +482,7 @@ WRITE16_HANDLER( toaplan1_fcu_flipscreen_w )
{
if (ACCESSING_BITS_8_15)
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
logerror("Setting FCU controller flipscreen port to %04x\n",data);
state->fcu_flipscreen = data & 0x8000; /* 0x8000 = flip, 0x0000 = no flip */
@@ -491,14 +491,14 @@ WRITE16_HANDLER( toaplan1_fcu_flipscreen_w )
READ16_HANDLER( toaplan1_spriteram_offs_r ) /// this aint really needed ?
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->spriteram_offs;
}
WRITE16_HANDLER( toaplan1_spriteram_offs_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
COMBINE_DATA(&state->spriteram_offs);
}
@@ -507,14 +507,14 @@ WRITE16_HANDLER( toaplan1_spriteram_offs_w )
/* tile palette */
READ16_HANDLER( toaplan1_colorram1_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->colorram1[offset];
}
WRITE16_HANDLER( toaplan1_colorram1_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
COMBINE_DATA(&state->colorram1[offset]);
paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset, data, mem_mask);
@@ -523,14 +523,14 @@ WRITE16_HANDLER( toaplan1_colorram1_w )
/* sprite palette */
READ16_HANDLER( toaplan1_colorram2_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->colorram2[offset];
}
WRITE16_HANDLER( toaplan1_colorram2_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
COMBINE_DATA(&state->colorram2[offset]);
paletteram16_xBBBBBGGGGGRRRRR_word_w(space, offset+(state->colorram1_size/2), data, mem_mask);
@@ -538,14 +538,14 @@ WRITE16_HANDLER( toaplan1_colorram2_w )
READ16_HANDLER( toaplan1_spriteram16_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->spriteram[state->spriteram_offs & ((TOAPLAN1_SPRITERAM_SIZE/2)-1)];
}
WRITE16_HANDLER( toaplan1_spriteram16_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
COMBINE_DATA(&state->spriteram[state->spriteram_offs & ((TOAPLAN1_SPRITERAM_SIZE/2)-1)]);
@@ -562,14 +562,14 @@ WRITE16_HANDLER( toaplan1_spriteram16_w )
READ16_HANDLER( toaplan1_spritesizeram16_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->spritesizeram16[state->spriteram_offs & ((TOAPLAN1_SPRITESIZERAM_SIZE/2)-1)];
}
WRITE16_HANDLER( toaplan1_spritesizeram16_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
COMBINE_DATA(&state->spritesizeram16[state->spriteram_offs & ((TOAPLAN1_SPRITESIZERAM_SIZE/2)-1)]);
@@ -588,7 +588,7 @@ WRITE16_HANDLER( toaplan1_spritesizeram16_w )
WRITE16_HANDLER( toaplan1_bcu_control_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
logerror("BCU tile controller register:%02x now = %04x\n",offset,data);
@@ -605,14 +605,14 @@ WRITE16_HANDLER( toaplan1_bcu_control_w )
READ16_HANDLER( toaplan1_tileram_offs_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
return state->pf_voffs;
}
WRITE16_HANDLER( toaplan1_tileram_offs_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
if (data >= 0x4000)
logerror("Hmmm, unknown video layer being selected (%08x)\n",data);
@@ -622,7 +622,7 @@ WRITE16_HANDLER( toaplan1_tileram_offs_w )
READ16_HANDLER( toaplan1_tileram16_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
offs_t vram_offset;
UINT16 video_data = 0;
@@ -666,7 +666,7 @@ READ16_HANDLER( rallybik_tileram16_r )
WRITE16_HANDLER( toaplan1_tileram16_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
offs_t vram_offset;
switch (state->pf_voffs & 0xf000) /* Locate Layer (PlayField) */
@@ -701,7 +701,7 @@ WRITE16_HANDLER( toaplan1_tileram16_w )
READ16_HANDLER( toaplan1_scroll_regs_r )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
UINT16 scroll = 0;
switch(offset)
@@ -723,7 +723,7 @@ READ16_HANDLER( toaplan1_scroll_regs_r )
WRITE16_HANDLER( toaplan1_scroll_regs_w )
{
- toaplan1_state *state = space->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = space->machine().driver_data<toaplan1_state>();
switch(offset)
{
@@ -759,10 +759,10 @@ WRITE16_HANDLER( toaplan1_scroll_regs_w )
-static void toaplan1_log_vram(running_machine *machine)
+static void toaplan1_log_vram(running_machine &machine)
{
#ifdef MAME_DEBUG
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
if ( input_code_pressed(machine, KEYCODE_M) )
{
@@ -965,7 +965,7 @@ static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle *clip
{
int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
- bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = gfx->machine().priority_bitmap;
int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16;
@@ -1058,9 +1058,9 @@ static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle *clip
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
UINT16 *source = (UINT16 *)state->buffered_spriteram;
UINT16 *size = (UINT16 *)state->buffered_spritesizeram16;
int fcu_flipscreen = state->fcu_flipscreen;
@@ -1095,7 +1095,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/****** flip the sprite layer ******/
if (fcu_flipscreen)
{
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
sx_base = ((visarea.max_x + 1) - visarea.min_x) - (sx_base + 8); /* visarea.x = 320 */
sy_base = ((visarea.max_y + 1) - visarea.min_y) - (sy_base + 8); /* visarea.y = 240 */
@@ -1112,7 +1112,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if (fcu_flipscreen) sx = sx_base - dim_x;
else sx = sx_base + dim_x;
- toaplan1_draw_sprite_custom(bitmap,cliprect,machine->gfx[1],
+ toaplan1_draw_sprite_custom(bitmap,cliprect,machine.gfx[1],
sprite,color,
fcu_flipscreen,fcu_flipscreen,
sx,sy,
@@ -1126,9 +1126,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
}
-static void rallybik_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
UINT16 *buffered_spriteram16 = state->buffered_spriteram;
int offs;
@@ -1149,7 +1149,7 @@ static void rallybik_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
flipx = attrib & 0x100;
if (flipx) sx -= 15;
flipy = attrib & 0x200;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
color,
flipx,flipy,
@@ -1166,10 +1166,10 @@ static void rallybik_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
SCREEN_UPDATE( rallybik )
{
- toaplan1_state *state = screen->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = screen->machine().driver_data<toaplan1_state>();
int priority;
- toaplan1_log_vram(screen->machine);
+ toaplan1_log_vram(screen->machine());
bitmap_fill(bitmap,cliprect,0x120);
@@ -1182,7 +1182,7 @@ SCREEN_UPDATE( rallybik )
tilemap_draw(bitmap, cliprect, state->pf3_tilemap, priority, 0);
tilemap_draw(bitmap, cliprect, state->pf2_tilemap, priority, 0);
tilemap_draw(bitmap, cliprect, state->pf1_tilemap, priority, 0);
- rallybik_draw_sprites(screen->machine, bitmap,cliprect,priority << 8);
+ rallybik_draw_sprites(screen->machine(), bitmap,cliprect,priority << 8);
}
return 0;
@@ -1190,12 +1190,12 @@ SCREEN_UPDATE( rallybik )
SCREEN_UPDATE( toaplan1 )
{
- toaplan1_state *state = screen->machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = screen->machine().driver_data<toaplan1_state>();
int priority;
- toaplan1_log_vram(screen->machine);
+ toaplan1_log_vram(screen->machine());
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
bitmap_fill(bitmap,cliprect,0x120);
// it's really correct?
@@ -1210,7 +1210,7 @@ SCREEN_UPDATE( toaplan1 )
tilemap_draw_primask(bitmap, cliprect, state->pf1_tilemap, priority, priority, 0);
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -1222,14 +1222,14 @@ SCREEN_UPDATE( toaplan1 )
SCREEN_EOF( rallybik )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size);
}
SCREEN_EOF( toaplan1 )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size);
memcpy(state->buffered_spritesizeram16, state->spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE);
@@ -1237,7 +1237,7 @@ SCREEN_EOF( toaplan1 )
SCREEN_EOF( samesame )
{
- toaplan1_state *state = machine->driver_data<toaplan1_state>();
+ toaplan1_state *state = machine.driver_data<toaplan1_state>();
memcpy(state->buffered_spriteram, state->spriteram, state->spriteram_size);
memcpy(state->buffered_spritesizeram16, state->spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE);
diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c
index 9f444d28c99..ff05a184490 100644
--- a/src/mame/video/toaplan2.c
+++ b/src/mame/video/toaplan2.c
@@ -36,7 +36,7 @@
static TILE_GET_INFO( get_text_tile_info )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
int color, tile_number, attrib;
attrib = state->txvideoram16[tile_index];
@@ -56,9 +56,9 @@ static TILE_GET_INFO( get_text_tile_info )
***************************************************************************/
-static void truxton2_create_tx_tilemap(running_machine *machine)
+static void truxton2_create_tx_tilemap(running_machine &machine)
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->tx_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scroll_rows(state->tx_tilemap, 8*32); /* line scrolling */
@@ -66,9 +66,9 @@ static void truxton2_create_tx_tilemap(running_machine *machine)
tilemap_set_transparent_pen(state->tx_tilemap, 0);
}
-static void register_state_save(running_machine *machine)
+static void register_state_save(running_machine &machine)
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
state->save_item(NAME(state->tx_flip));
}
@@ -76,18 +76,18 @@ static void register_state_save(running_machine *machine)
static STATE_POSTLOAD( truxton2_postload )
{
for (int i = 0; i < 1024; i++)
- gfx_element_mark_dirty(machine->gfx[2], i);
+ gfx_element_mark_dirty(machine.gfx[2], i);
}
VIDEO_START( toaplan2 )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
/* cache the VDP device */
- state->vdp0 = machine->device<gp9001vdp_device>("gp9001vdp0");
- state->vdp1 = machine->device<gp9001vdp_device>("gp9001vdp1");
+ state->vdp0 = machine.device<gp9001vdp_device>("gp9001vdp0");
+ state->vdp1 = machine.device<gp9001vdp_device>("gp9001vdp1");
/* our current VDP implementation needs this bitmap to work with */
state->custom_priority_bitmap = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED8);
@@ -109,13 +109,13 @@ VIDEO_START( toaplan2 )
VIDEO_START( truxton2 )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
VIDEO_START_CALL( toaplan2 );
/* Create the Text tilemap for this game */
- gfx_element_set_source(machine->gfx[2], (UINT8 *)state->tx_gfxram16);
- machine->state().register_postload(truxton2_postload, NULL);
+ gfx_element_set_source(machine.gfx[2], (UINT8 *)state->tx_gfxram16);
+ machine.state().register_postload(truxton2_postload, NULL);
truxton2_create_tx_tilemap(machine);
tilemap_set_scrolldx(state->tx_tilemap, 0x1d4 +1, 0x2a);
@@ -123,7 +123,7 @@ VIDEO_START( truxton2 )
VIDEO_START( fixeightbl )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
VIDEO_START_CALL( toaplan2 );
@@ -150,7 +150,7 @@ VIDEO_START( fixeightbl )
VIDEO_START( bgaregga )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
VIDEO_START_CALL( toaplan2 );
@@ -161,7 +161,7 @@ VIDEO_START( bgaregga )
VIDEO_START( batrider )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
VIDEO_START_CALL( toaplan2 );
state->vdp0->sp.use_sprite_buffer = 0; // disable buffering on this game
@@ -169,8 +169,8 @@ VIDEO_START( batrider )
/* Create the Text tilemap for this game */
state->tx_gfxram16 = auto_alloc_array_clear(machine, UINT16, RAIZING_TX_GFXRAM_SIZE/2);
state->save_pointer(NAME(state->tx_gfxram16), RAIZING_TX_GFXRAM_SIZE/2);
- gfx_element_set_source(machine->gfx[2], (UINT8 *)state->tx_gfxram16);
- machine->state().register_postload(truxton2_postload, NULL);
+ gfx_element_set_source(machine.gfx[2], (UINT8 *)state->tx_gfxram16);
+ machine.state().register_postload(truxton2_postload, NULL);
truxton2_create_tx_tilemap(machine);
tilemap_set_scrolldx(state->tx_tilemap, 0x1d4, 0x2a);
@@ -181,7 +181,7 @@ VIDEO_START( batrider )
WRITE16_HANDLER( toaplan2_txvideoram16_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
COMBINE_DATA(&state->txvideoram16[offset]);
if (offset < (state->tx_vram_size/4))
@@ -193,7 +193,7 @@ WRITE16_HANDLER( toaplan2_txvideoram16_offs_w )
// FIXME: implement line select and per-line flipping for all games
// see SCREEN_UPDATE( batrider )
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
UINT16 oldword = state->txvideoram16_offs[offset];
if (oldword != data)
@@ -222,7 +222,7 @@ WRITE16_HANDLER( toaplan2_txscrollram16_w )
{
/*** Line-Scroll RAM for Text Layer ***/
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
int data_tx = data;
tilemap_set_scrollx(state->tx_tilemap, offset, data_tx);
@@ -235,14 +235,14 @@ WRITE16_HANDLER( toaplan2_tx_gfxram16_w )
{
/*** Dynamic GFX decoding for Truxton 2 / FixEight ***/
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
UINT16 oldword = state->tx_gfxram16[offset];
if (oldword != data)
{
int code = offset/32;
COMBINE_DATA(&state->tx_gfxram16[offset]);
- gfx_element_mark_dirty(space->machine->gfx[2], code);
+ gfx_element_mark_dirty(space->machine().gfx[2], code);
}
}
@@ -251,12 +251,12 @@ WRITE16_HANDLER( batrider_textdata_dma_w )
/*** Dynamic Text GFX decoding for Batrider ***/
/*** Only done once during start-up ***/
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
UINT16 *dest = state->tx_gfxram16;
memcpy(dest, state->txvideoram16, state->tx_vram_size);
dest += (state->tx_vram_size/2);
- memcpy(dest, space->machine->generic.paletteram.u16, state->paletteram_size);
+ memcpy(dest, space->machine().generic.paletteram.u16, state->paletteram_size);
dest += (state->paletteram_size/2);
memcpy(dest, state->txvideoram16_offs, state->tx_offs_vram_size);
dest += (state->tx_offs_vram_size/2);
@@ -265,7 +265,7 @@ WRITE16_HANDLER( batrider_textdata_dma_w )
memcpy(dest, state->mainram16, state->mainram_overlap_size);
for (int i = 0; i < 1024; i++)
- gfx_element_mark_dirty(space->machine->gfx[2], i);
+ gfx_element_mark_dirty(space->machine().gfx[2], i);
}
WRITE16_HANDLER( batrider_unknown_dma_w )
@@ -277,7 +277,7 @@ WRITE16_HANDLER( batrider_unknown_dma_w )
WRITE16_HANDLER( batrider_objectbank_w )
{
- toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = space->machine().driver_data<toaplan2_state>();
if (ACCESSING_BITS_0_7)
{
@@ -293,19 +293,19 @@ WRITE16_HANDLER( batrider_objectbank_w )
// Dogyuun doesn't appear to require fancy mixing?
SCREEN_UPDATE( toaplan2_dual )
{
- toaplan2_state *state = screen->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = screen->machine().driver_data<toaplan2_state>();
if (state->vdp1)
{
bitmap_fill(bitmap,cliprect,0);
bitmap_fill(state->custom_priority_bitmap, cliprect, 0);
- state->vdp1->gp9001_render_vdp(screen->machine, bitmap, cliprect);
+ state->vdp1->gp9001_render_vdp(screen->machine(), bitmap, cliprect);
}
if (state->vdp0)
{
// bitmap_fill(bitmap,cliprect,0);
bitmap_fill(state->custom_priority_bitmap, cliprect, 0);
- state->vdp0->gp9001_render_vdp(screen->machine, bitmap, cliprect);
+ state->vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect);
}
@@ -316,7 +316,7 @@ SCREEN_UPDATE( toaplan2_dual )
// renders to 2 bitmaps, and mixes output
SCREEN_UPDATE( toaplan2_mixed )
{
- toaplan2_state *state = screen->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = screen->machine().driver_data<toaplan2_state>();
// bitmap_fill(bitmap,cliprect,0);
// bitmap_fill(gp9001_custom_priority_bitmap, cliprect, 0);
@@ -325,13 +325,13 @@ SCREEN_UPDATE( toaplan2_mixed )
{
bitmap_fill(bitmap,cliprect,0);
bitmap_fill(state->custom_priority_bitmap, cliprect, 0);
- state->vdp0->gp9001_render_vdp(screen->machine, bitmap, cliprect);
+ state->vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect);
}
if (state->vdp1)
{
bitmap_fill(state->secondary_render_bitmap,cliprect,0);
bitmap_fill(state->custom_priority_bitmap, cliprect, 0);
- state->vdp1->gp9001_render_vdp(screen->machine, state->secondary_render_bitmap, cliprect);
+ state->vdp1->gp9001_render_vdp(screen->machine(), state->secondary_render_bitmap, cliprect);
}
@@ -416,17 +416,17 @@ SCREEN_UPDATE( toaplan2_mixed )
SCREEN_UPDATE( toaplan2 )
{
- toaplan2_state *state = screen->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = screen->machine().driver_data<toaplan2_state>();
if (state->vdp0)
{
- device_t *screen1 = screen->machine->device("screen");
+ device_t *screen1 = screen->machine().device("screen");
if (screen == screen1)
{
bitmap_fill(bitmap,cliprect,0);
bitmap_fill(state->custom_priority_bitmap, cliprect, 0);
- state->vdp0->gp9001_render_vdp(screen->machine, bitmap, cliprect);
+ state->vdp0->gp9001_render_vdp(screen->machine(), bitmap, cliprect);
}
}
@@ -435,7 +435,7 @@ SCREEN_UPDATE( toaplan2 )
SCREEN_UPDATE( truxton2 )
{
- toaplan2_state *state = screen->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = screen->machine().driver_data<toaplan2_state>();
SCREEN_UPDATE_CALL(toaplan2);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
@@ -445,7 +445,7 @@ SCREEN_UPDATE( truxton2 )
SCREEN_UPDATE( batrider )
{
- toaplan2_state *state = screen->machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = screen->machine().driver_data<toaplan2_state>();
SCREEN_UPDATE_CALL( toaplan2 );
@@ -492,7 +492,7 @@ SCREEN_UPDATE( batsugun )
SCREEN_EOF( toaplan2 )
{
- toaplan2_state *state = machine->driver_data<toaplan2_state>();
+ toaplan2_state *state = machine.driver_data<toaplan2_state>();
if (state->vdp0) state->vdp0->gp9001_screen_eof();
if (state->vdp1) state->vdp1->gp9001_screen_eof();
}
diff --git a/src/mame/video/toki.c b/src/mame/video/toki.c
index d75e38cc7ff..1096ec740a5 100644
--- a/src/mame/video/toki.c
+++ b/src/mame/video/toki.c
@@ -28,24 +28,24 @@ remove all the code writing the $a0000 area.)
WRITE16_HANDLER( toki_control_w )
{
- toki_state *state = space->machine->driver_data<toki_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos() - 1);
+ toki_state *state = space->machine().driver_data<toki_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos() - 1);
COMBINE_DATA(&state->scrollram16[offset]);
}
SCREEN_EOF( toki )
{
- buffer_spriteram16_w(machine->device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
+ buffer_spriteram16_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
}
SCREEN_EOF( tokib )
{
- buffer_spriteram16_w(machine->device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
+ buffer_spriteram16_w(machine.device("maincpu")->memory().space(AS_PROGRAM), 0, 0, 0xffff);
}
static TILE_GET_INFO( get_text_tile_info )
{
- toki_state *state = machine->driver_data<toki_state>();
+ toki_state *state = machine.driver_data<toki_state>();
UINT16 *videoram = state->videoram;
int tile = videoram[tile_index];
int color = (tile >> 12) & 0xf;
@@ -61,7 +61,7 @@ static TILE_GET_INFO( get_text_tile_info )
static TILE_GET_INFO( get_back_tile_info )
{
- toki_state *state = machine->driver_data<toki_state>();
+ toki_state *state = machine.driver_data<toki_state>();
int tile = state->background1_videoram16[tile_index];
int color = (tile >> 12) & 0xf;
@@ -76,7 +76,7 @@ static TILE_GET_INFO( get_back_tile_info )
static TILE_GET_INFO( get_fore_tile_info )
{
- toki_state *state = machine->driver_data<toki_state>();
+ toki_state *state = machine.driver_data<toki_state>();
int tile = state->background2_videoram16[tile_index];
int color = (tile >> 12) & 0xf;
@@ -98,7 +98,7 @@ static TILE_GET_INFO( get_fore_tile_info )
VIDEO_START( toki )
{
- toki_state *state = machine->driver_data<toki_state>();
+ toki_state *state = machine.driver_data<toki_state>();
state->text_layer = tilemap_create(machine, get_text_tile_info,tilemap_scan_rows, 8,8,32,32);
state->background_layer = tilemap_create(machine, get_back_tile_info,tilemap_scan_rows,16,16,32,32);
state->foreground_layer = tilemap_create(machine, get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
@@ -112,7 +112,7 @@ VIDEO_START( toki )
WRITE16_HANDLER( toki_foreground_videoram16_w )
{
- toki_state *state = space->machine->driver_data<toki_state>();
+ toki_state *state = space->machine().driver_data<toki_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->text_layer,offset);
@@ -120,14 +120,14 @@ WRITE16_HANDLER( toki_foreground_videoram16_w )
WRITE16_HANDLER( toki_background1_videoram16_w )
{
- toki_state *state = space->machine->driver_data<toki_state>();
+ toki_state *state = space->machine().driver_data<toki_state>();
COMBINE_DATA(&state->background1_videoram16[offset]);
tilemap_mark_tile_dirty(state->background_layer,offset);
}
WRITE16_HANDLER( toki_background2_videoram16_w )
{
- toki_state *state = space->machine->driver_data<toki_state>();
+ toki_state *state = space->machine().driver_data<toki_state>();
COMBINE_DATA(&state->background2_videoram16[offset]);
tilemap_mark_tile_dirty(state->foreground_layer,offset);
}
@@ -181,14 +181,14 @@ WRITE16_HANDLER( toki_background2_videoram16_w )
***************************************************************************/
-static void toki_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void toki_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs;
UINT16 *sprite_word;
- for (offs = (machine->generic.spriteram_size/2)-4;offs >= 0;offs -= 4)
+ for (offs = (machine.generic.spriteram_size/2)-4;offs >= 0;offs -= 4)
{
- sprite_word = &machine->generic.buffered_spriteram.u16[offs];
+ sprite_word = &machine.generic.buffered_spriteram.u16[offs];
if ((sprite_word[2] != 0xf000) && (sprite_word[0] != 0xffff))
{
@@ -214,7 +214,7 @@ static void toki_draw_sprites(running_machine *machine, bitmap_t *bitmap,const r
flipy=1;
}
- drawgfx_transpen (bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen (bitmap,cliprect,machine.gfx[1],
tile,
color,
flipx,flipy,
@@ -224,14 +224,14 @@ static void toki_draw_sprites(running_machine *machine, bitmap_t *bitmap,const r
}
-static void tokib_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
int x,y,tile,flipx,color,offs;
UINT16 *sprite_word;
- for (offs = 0;offs < machine->generic.spriteram_size / 2;offs += 4)
+ for (offs = 0;offs < machine.generic.spriteram_size / 2;offs += 4)
{
- sprite_word = &machine->generic.buffered_spriteram.u16[offs];
+ sprite_word = &machine.generic.buffered_spriteram.u16[offs];
if (sprite_word[0] == 0xf100)
break;
@@ -252,7 +252,7 @@ static void tokib_draw_sprites(running_machine *machine, bitmap_t *bitmap,const
tile = sprite_word[1] & 0x1fff;
color = sprite_word[2] >> 12;
- drawgfx_transpen (bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen (bitmap,cliprect,machine.gfx[1],
tile,
color,
flipx,0,
@@ -269,7 +269,7 @@ static void tokib_draw_sprites(running_machine *machine, bitmap_t *bitmap,const
SCREEN_UPDATE( toki )
{
- toki_state *state = screen->machine->driver_data<toki_state>();
+ toki_state *state = screen->machine().driver_data<toki_state>();
int background_y_scroll,foreground_y_scroll,background_x_scroll,foreground_x_scroll;
background_x_scroll=((state->scrollram16[0x06] &0x7f) << 1)
@@ -288,7 +288,7 @@ SCREEN_UPDATE( toki )
tilemap_set_scrollx( state->foreground_layer, 0, foreground_x_scroll );
tilemap_set_scrolly( state->foreground_layer, 0, foreground_y_scroll );
- flip_screen_set(screen->machine, (state->scrollram16[0x28]&0x8000)==0);
+ flip_screen_set(screen->machine(), (state->scrollram16[0x28]&0x8000)==0);
if (state->scrollram16[0x28]&0x100) {
tilemap_draw(bitmap,cliprect,state->background_layer,TILEMAP_DRAW_OPAQUE,0);
@@ -297,14 +297,14 @@ SCREEN_UPDATE( toki )
tilemap_draw(bitmap,cliprect,state->foreground_layer,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->background_layer,0,0);
}
- toki_draw_sprites(screen->machine, bitmap,cliprect);
+ toki_draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->text_layer,0,0);
return 0;
}
SCREEN_UPDATE( tokib )
{
- toki_state *state = screen->machine->driver_data<toki_state>();
+ toki_state *state = screen->machine().driver_data<toki_state>();
tilemap_set_scroll_rows(state->foreground_layer,1);
tilemap_set_scroll_rows(state->background_layer,1);
tilemap_set_scrolly( state->background_layer, 0, state->scrollram16[0]+1 );
@@ -320,7 +320,7 @@ SCREEN_UPDATE( tokib )
tilemap_draw(bitmap,cliprect,state->background_layer,0,0);
}
- tokib_draw_sprites(screen->machine, bitmap,cliprect);
+ tokib_draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->text_layer,0,0);
return 0;
}
diff --git a/src/mame/video/toobin.c b/src/mame/video/toobin.c
index 048a36c477b..633daaeeed3 100644
--- a/src/mame/video/toobin.c
+++ b/src/mame/video/toobin.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- toobin_state *state = machine->driver_data<toobin_state>();
+ toobin_state *state = machine.driver_data<toobin_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = (data >> 12) & 0x0f;
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- toobin_state *state = machine->driver_data<toobin_state>();
+ toobin_state *state = machine.driver_data<toobin_state>();
UINT16 data1 = state->playfield[tile_index * 2];
UINT16 data2 = state->playfield[tile_index * 2 + 1];
int code = data2 & 0x3fff;
@@ -83,7 +83,7 @@ VIDEO_START( toobin )
0, /* resulting value to indicate "special" */
0 /* callback routine for special entries */
};
- toobin_state *state = machine->driver_data<toobin_state>();
+ toobin_state *state = machine.driver_data<toobin_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_rows, 8,8, 128,64);
@@ -96,7 +96,7 @@ VIDEO_START( toobin )
tilemap_set_transparent_pen(state->alpha_tilemap, 0);
/* allocate a playfield bitmap for rendering */
- state->pfbitmap = auto_bitmap_alloc(machine, machine->primary_screen->width(), machine->primary_screen->height(), BITMAP_FORMAT_INDEXED16);
+ state->pfbitmap = auto_bitmap_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height(), BITMAP_FORMAT_INDEXED16);
state->save_item(NAME(state->brightness));
}
@@ -111,11 +111,11 @@ VIDEO_START( toobin )
WRITE16_HANDLER( toobin_paletteram_w )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
+ toobin_state *state = space->machine().driver_data<toobin_state>();
int newword;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- newword = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ newword = space->machine().generic.paletteram.u16[offset];
{
int red = (((newword >> 10) & 31) * 224) >> 5;
@@ -126,18 +126,18 @@ WRITE16_HANDLER( toobin_paletteram_w )
if (green) green += 38;
if (blue) blue += 38;
- palette_set_color(space->machine, offset & 0x3ff, MAKE_RGB(red, green, blue));
+ palette_set_color(space->machine(), offset & 0x3ff, MAKE_RGB(red, green, blue));
if (!(newword & 0x8000))
- palette_set_pen_contrast(space->machine, offset & 0x3ff, state->brightness);
+ palette_set_pen_contrast(space->machine(), offset & 0x3ff, state->brightness);
else
- palette_set_pen_contrast(space->machine, offset & 0x3ff, 1.0);
+ palette_set_pen_contrast(space->machine(), offset & 0x3ff, 1.0);
}
}
WRITE16_HANDLER( toobin_intensity_w )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
+ toobin_state *state = space->machine().driver_data<toobin_state>();
int i;
if (ACCESSING_BITS_0_7)
@@ -145,8 +145,8 @@ WRITE16_HANDLER( toobin_intensity_w )
state->brightness = (double)(~data & 0x1f) / 31.0;
for (i = 0; i < 0x400; i++)
- if (!(space->machine->generic.paletteram.u16[i] & 0x8000))
- palette_set_pen_contrast(space->machine, i, state->brightness);
+ if (!(space->machine().generic.paletteram.u16[i] & 0x8000))
+ palette_set_pen_contrast(space->machine(), i, state->brightness);
}
}
@@ -160,14 +160,14 @@ WRITE16_HANDLER( toobin_intensity_w )
WRITE16_HANDLER( toobin_xscroll_w )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
+ toobin_state *state = space->machine().driver_data<toobin_state>();
UINT16 oldscroll = *state->xscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* update the playfield scrolling - hscroll is clocked on the following scanline */
tilemap_set_scrollx(state->playfield_tilemap, 0, newscroll >> 6);
@@ -180,14 +180,14 @@ WRITE16_HANDLER( toobin_xscroll_w )
WRITE16_HANDLER( toobin_yscroll_w )
{
- toobin_state *state = space->machine->driver_data<toobin_state>();
+ toobin_state *state = space->machine().driver_data<toobin_state>();
UINT16 oldscroll = *state->yscroll;
UINT16 newscroll = oldscroll;
COMBINE_DATA(&newscroll);
/* if anything has changed, force a partial update */
if (newscroll != oldscroll)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* if bit 4 is zero, the scroll value is clocked in right away */
tilemap_set_scrolly(state->playfield_tilemap, 0, newscroll >> 6);
@@ -213,7 +213,7 @@ WRITE16_HANDLER( toobin_slip_w )
/* if the SLIP is changing, force a partial update first */
if (oldslip != newslip)
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
/* update the data */
atarimo_0_slipram_w(space, offset, data, mem_mask);
@@ -229,9 +229,9 @@ WRITE16_HANDLER( toobin_slip_w )
SCREEN_UPDATE( toobin )
{
- toobin_state *state = screen->machine->driver_data<toobin_state>();
- bitmap_t *priority_bitmap = screen->machine->priority_bitmap;
- const rgb_t *palette = palette_entry_list_adjusted(screen->machine->palette);
+ toobin_state *state = screen->machine().driver_data<toobin_state>();
+ bitmap_t *priority_bitmap = screen->machine().priority_bitmap;
+ const rgb_t *palette = palette_entry_list_adjusted(screen->machine().palette);
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y;
diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c
index 502695bb809..fd54a5362ca 100644
--- a/src/mame/video/topspeed.c
+++ b/src/mame/video/topspeed.c
@@ -26,9 +26,9 @@
********************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- topspeed_state *state = machine->driver_data<topspeed_state>();
+ topspeed_state *state = machine.driver_data<topspeed_state>();
UINT16 *spriteram = state->spriteram;
int offs, map_offset, x, y, curx, cury, sprite_chunk;
UINT16 *spritemap = state->spritemap;
@@ -92,13 +92,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
zx = x + (((k + 1) * zoomx) / 8) - curx;
zy = y + (((j + 1) * zoomy) / 16) - cury;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipx,flipy,
curx,cury,
zx<<12,zy<<13,
- machine->priority_bitmap,primasks[priority],0);
+ machine.priority_bitmap,primasks[priority],0);
}
if (bad_chunks)
@@ -111,35 +111,35 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( topspeed )
{
- topspeed_state *state = screen->machine->driver_data<topspeed_state>();
+ topspeed_state *state = screen->machine().driver_data<topspeed_state>();
UINT8 layer[4];
#ifdef MAME_DEBUG
- if (input_code_pressed_once (screen->machine, KEYCODE_V))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_V))
{
state->dislayer[0] ^= 1;
popmessage("bg: %01x", state->dislayer[0]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_B))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_B))
{
state->dislayer[1] ^= 1;
popmessage("fg: %01x", state->dislayer[1]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_N))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_N))
{
state->dislayer[2] ^= 1;
popmessage("bg2: %01x", state->dislayer[2]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_M))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_M))
{
state->dislayer[3] ^= 1;
popmessage("fg2: %01x", state->dislayer[3]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_C))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_C))
{
state->dislayer[4] ^= 1;
popmessage("sprites: %01x", state->dislayer[4]);
@@ -155,7 +155,7 @@ SCREEN_UPDATE( topspeed )
layer[2] = 1;
layer[3] = 0;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0);
#ifdef MAME_DEBUG
@@ -182,6 +182,6 @@ SCREEN_UPDATE( topspeed )
if (state->dislayer[4] == 0)
#endif
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/toypop.c b/src/mame/video/toypop.c
index a02f6e95ddd..be127a82f05 100644
--- a/src/mame/video/toypop.c
+++ b/src/mame/video/toypop.c
@@ -23,7 +23,7 @@ PALETTE_INIT( toypop )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
for (i = 0;i < 256;i++)
{
@@ -48,7 +48,7 @@ PALETTE_INIT( toypop )
bit3 = (color_prom[i+0x200] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r,g,b));
}
for (i = 0;i < 256;i++)
@@ -56,17 +56,17 @@ PALETTE_INIT( toypop )
UINT8 entry;
// characters
- colortable_entry_set_value(machine->colortable, i + 0*256, (color_prom[i + 0x300] & 0x0f) | 0x70);
- colortable_entry_set_value(machine->colortable, i + 1*256, (color_prom[i + 0x300] & 0x0f) | 0xf0);
+ colortable_entry_set_value(machine.colortable, i + 0*256, (color_prom[i + 0x300] & 0x0f) | 0x70);
+ colortable_entry_set_value(machine.colortable, i + 1*256, (color_prom[i + 0x300] & 0x0f) | 0xf0);
// sprites
entry = color_prom[i + 0x500];
- colortable_entry_set_value(machine->colortable, i + 2*256, entry);
+ colortable_entry_set_value(machine.colortable, i + 2*256, entry);
}
for (i = 0;i < 16;i++)
{
// background
- colortable_entry_set_value(machine->colortable, i + 3*256 + 0*16, 0x60 + i);
- colortable_entry_set_value(machine->colortable, i + 3*256 + 1*16, 0xe0 + i);
+ colortable_entry_set_value(machine.colortable, i + 3*256 + 0*16, 0x60 + i);
+ colortable_entry_set_value(machine.colortable, i + 3*256 + 1*16, 0xe0 + i);
}
}
@@ -95,7 +95,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( get_tile_info )
{
- toypop_state *state = machine->driver_data<toypop_state>();
+ toypop_state *state = machine.driver_data<toypop_state>();
UINT8 attr = state->videoram[tile_index + 0x400];
SET_TILE_INFO(
0,
@@ -114,7 +114,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( toypop )
{
- toypop_state *state = machine->driver_data<toypop_state>();
+ toypop_state *state = machine.driver_data<toypop_state>();
state->bg_tilemap = tilemap_create(machine,get_tile_info,tilemap_scan,8,8,36,28);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
@@ -130,30 +130,30 @@ VIDEO_START( toypop )
WRITE8_HANDLER( toypop_videoram_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( toypop_palettebank_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
if (state->palettebank != (offset & 1))
{
state->palettebank = offset & 1;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE16_HANDLER( toypop_flipscreen_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
state->bitmapflip = offset & 1;
}
READ16_HANDLER( toypop_merged_background_r )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
int data1, data2;
// 0x0a0b0c0d is read as 0xabcd
@@ -164,7 +164,7 @@ READ16_HANDLER( toypop_merged_background_r )
WRITE16_HANDLER( toypop_merged_background_w )
{
- toypop_state *state = space->machine->driver_data<toypop_state>();
+ toypop_state *state = space->machine().driver_data<toypop_state>();
// 0xabcd is written as 0x0a0b0c0d in the background image
if (ACCESSING_BITS_8_15)
@@ -174,9 +174,9 @@ WRITE16_HANDLER( toypop_merged_background_w )
state->bg_image[2*offset+1] = (data & 0xf) | ((data & 0xf0) << 4);
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap)
+static void draw_background(running_machine &machine, bitmap_t *bitmap)
{
- toypop_state *state = machine->driver_data<toypop_state>();
+ toypop_state *state = machine.driver_data<toypop_state>();
int offs, x, y;
pen_t pen_base = 0x300 + 0x10*state->palettebank;
@@ -222,7 +222,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap)
***************************************************************************/
-void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
+void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
{
UINT8 *spriteram = spriteram_base + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
@@ -267,12 +267,12 @@ void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *c
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0xff));
}
}
}
@@ -282,9 +282,9 @@ void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *c
SCREEN_UPDATE( toypop )
{
- toypop_state *state = screen->machine->driver_data<toypop_state>();
- draw_background(screen->machine, bitmap);
+ toypop_state *state = screen->machine().driver_data<toypop_state>();
+ draw_background(screen->machine(), bitmap);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram);
return 0;
}
diff --git a/src/mame/video/tp84.c b/src/mame/video/tp84.c
index c1e48186b46..c45c0129e15 100644
--- a/src/mame/video/tp84.c
+++ b/src/mame/video/tp84.c
@@ -54,7 +54,7 @@ PALETTE_INIT( tp84 )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x100);
+ machine.colortable = colortable_alloc(machine, 0x100);
/* create a lookup table for the palette */
for (i = 0; i < 0x100; i++)
@@ -83,7 +83,7 @@ PALETTE_INIT( tp84 )
bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
b = combine_4_weights(weights, bit0, bit1, bit2, bit3);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -97,7 +97,7 @@ PALETTE_INIT( tp84 )
for (j = 0; j < 8; j++)
{
UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
- colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
+ colortable_entry_set_value(machine.colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
}
}
}
@@ -105,9 +105,9 @@ PALETTE_INIT( tp84 )
WRITE8_HANDLER( tp84_spriteram_w )
{
- tp84_state *state = space->machine->driver_data<tp84_state>();
+ tp84_state *state = space->machine().driver_data<tp84_state>();
/* the game multiplexes the sprites, so update now */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
state->spriteram[offset] = data;
}
@@ -115,13 +115,13 @@ WRITE8_HANDLER( tp84_spriteram_w )
READ8_HANDLER( tp84_scanline_r )
{
/* reads 1V - 128V */
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
static TILE_GET_INFO( get_bg_tile_info )
{
- tp84_state *state = machine->driver_data<tp84_state>();
+ tp84_state *state = machine.driver_data<tp84_state>();
int code = ((state->bg_colorram[tile_index] & 0x30) << 4) | state->bg_videoram[tile_index];
int color = ((*state->palette_bank & 0x07) << 6) |
((*state->palette_bank & 0x18) << 1) |
@@ -133,7 +133,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- tp84_state *state = machine->driver_data<tp84_state>();
+ tp84_state *state = machine.driver_data<tp84_state>();
int code = ((state->fg_colorram[tile_index] & 0x30) << 4) | state->fg_videoram[tile_index];
int color = ((*state->palette_bank & 0x07) << 6) |
((*state->palette_bank & 0x18) << 1) |
@@ -146,15 +146,15 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( tp84 )
{
- tp84_state *state = machine->driver_data<tp84_state>();
+ tp84_state *state = machine.driver_data<tp84_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- tp84_state *state = machine->driver_data<tp84_state>();
+ tp84_state *state = machine.driver_data<tp84_state>();
int offs;
int palette_base = ((*state->palette_bank & 0x07) << 4);
@@ -168,8 +168,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int flip_x = ~state->spriteram[offs + 2] & 0x40;
int flip_y = state->spriteram[offs + 2] & 0x80;
- drawgfx_transmask(bitmap, cliprect, machine->gfx[1], code, color, flip_x, flip_y, x, y,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palette_base));
+ drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flip_x, flip_y, x, y,
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, palette_base));
}
}
@@ -177,23 +177,23 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tp84 )
{
- tp84_state *state = screen->machine->driver_data<tp84_state>();
+ tp84_state *state = screen->machine().driver_data<tp84_state>();
rectangle clip = *cliprect;
const rectangle &visarea = screen->visible_area();
if (cliprect->min_y == screen->visible_area().min_y)
{
- tilemap_mark_all_tiles_dirty_all(screen->machine);
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
tilemap_set_scrollx(state->bg_tilemap, 0, *state->scroll_x);
tilemap_set_scrolly(state->bg_tilemap, 0, *state->scroll_y);
- tilemap_set_flip_all(screen->machine, ((*state->flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) |
+ tilemap_set_flip_all(screen->machine(), ((*state->flipscreen_x & 0x01) ? TILEMAP_FLIPX : 0) |
((*state->flipscreen_y & 0x01) ? TILEMAP_FLIPY : 0));
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
/* draw top status region */
clip.min_x = visarea.min_x;
diff --git a/src/mame/video/trackfld.c b/src/mame/video/trackfld.c
index b2f030690f6..9bea4b6e371 100644
--- a/src/mame/video/trackfld.c
+++ b/src/mame/video/trackfld.c
@@ -43,7 +43,7 @@ PALETTE_INIT( trackfld )
2, &resistances_b[0], bweights, 1000, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( trackfld )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -78,43 +78,43 @@ PALETTE_INIT( trackfld )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* characters */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
WRITE8_HANDLER( trackfld_videoram_w )
{
- trackfld_state *state = space->machine->driver_data<trackfld_state>();
+ trackfld_state *state = space->machine().driver_data<trackfld_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( trackfld_colorram_w )
{
- trackfld_state *state = space->machine->driver_data<trackfld_state>();
+ trackfld_state *state = space->machine().driver_data<trackfld_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( trackfld_flipscreen_w )
{
- if (flip_screen_get(space->machine) != data)
+ if (flip_screen_get(space->machine()) != data)
{
- flip_screen_set(space->machine, data);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
WRITE8_HANDLER( atlantol_gfxbank_w )
{
- trackfld_state *state = space->machine->driver_data<trackfld_state>();
+ trackfld_state *state = space->machine().driver_data<trackfld_state>();
if (data & 1)
{
/* male / female sprites switch */
@@ -162,7 +162,7 @@ WRITE8_HANDLER( atlantol_gfxbank_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + 4 * (attr & 0xc0);
int color = attr & 0x0f;
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( trackfld )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_scroll_rows(state->bg_tilemap, 32);
state->sprites_gfx_banked = 0;
@@ -185,16 +185,16 @@ VIDEO_START( trackfld )
VIDEO_START( atlantol )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
VIDEO_START_CALL( trackfld );
state->sprites_gfx_banked = 1;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- trackfld_state *state = machine->driver_data<trackfld_state>();
+ trackfld_state *state = machine.driver_data<trackfld_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -230,19 +230,19 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
drawgfx_transmask(bitmap, cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code + state->sprite_bank1 + state->sprite_bank2, color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
/* redraw with wraparound */
drawgfx_transmask(bitmap,cliprect,
- machine->gfx[0],
+ machine.gfx[0],
code + state->sprite_bank1 + state->sprite_bank2, color,
flipx, flipy,
sx - 256, sy,
- colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
+ colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0));
}
}
@@ -250,18 +250,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( trackfld )
{
- trackfld_state *state = screen->machine->driver_data<trackfld_state>();
+ trackfld_state *state = screen->machine().driver_data<trackfld_state>();
int row, scrollx;
for (row = 0; row < 32; row++)
{
scrollx = state->scroll[row] + 256 * (state->scroll2[row] & 0x01);
- if (flip_screen_get(screen->machine)) scrollx = -scrollx;
+ if (flip_screen_get(screen->machine())) scrollx = -scrollx;
tilemap_set_scrollx(state->bg_tilemap, row, scrollx);
}
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c
index 168b134afc8..948a19c61a5 100644
--- a/src/mame/video/travrusa.c
+++ b/src/mame/video/travrusa.c
@@ -42,7 +42,7 @@ PALETTE_INIT( travrusa )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x90);
+ machine.colortable = colortable_alloc(machine, 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -68,7 +68,7 @@ PALETTE_INIT( travrusa )
bit2 = (color_prom[i] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -94,7 +94,7 @@ PALETTE_INIT( travrusa )
bit2 = (color_prom[(i - 0x80) + 0x200] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -102,13 +102,13 @@ PALETTE_INIT( travrusa )
/* characters */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -117,7 +117,7 @@ PALETTE_INIT( shtrider )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x90);
+ machine.colortable = colortable_alloc(machine, 0x90);
/* create a lookup table for the palette */
for (i = 0; i < 0x80; i++)
@@ -143,7 +143,7 @@ PALETTE_INIT( shtrider )
bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0x80; i < 0x90; i++)
@@ -169,7 +169,7 @@ PALETTE_INIT( shtrider )
bit2 = (color_prom[(i - 0x80) + 0x200] >> 2) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -177,13 +177,13 @@ PALETTE_INIT( shtrider )
/* characters */
for (i = 0; i < 0x80; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* sprites */
for (i = 0x80; i < 0x100; i++)
{
UINT8 ctabentry = (color_prom[i - 0x80] & 0x0f) | 0x80;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -197,7 +197,7 @@ PALETTE_INIT( shtrider )
static TILE_GET_INFO( get_tile_info )
{
- travrusa_state *state = machine->driver_data<travrusa_state>();
+ travrusa_state *state = machine.driver_data<travrusa_state>();
UINT8 attr = state->videoram[2 * tile_index + 1];
int flags = TILE_FLIPXY((attr & 0x30) >> 4);
@@ -220,7 +220,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( travrusa )
{
- travrusa_state *state = machine->driver_data<travrusa_state>();
+ travrusa_state *state = machine.driver_data<travrusa_state>();
state->save_item(NAME(state->scrollx));
@@ -242,15 +242,15 @@ VIDEO_START( travrusa )
WRITE8_HANDLER( travrusa_videoram_w )
{
- travrusa_state *state = space->machine->driver_data<travrusa_state>();
+ travrusa_state *state = space->machine().driver_data<travrusa_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
-static void set_scroll( running_machine *machine )
+static void set_scroll( running_machine &machine )
{
- travrusa_state *state = machine->driver_data<travrusa_state>();
+ travrusa_state *state = machine.driver_data<travrusa_state>();
int i;
for (i = 0; i <= 2; i++)
@@ -261,28 +261,28 @@ static void set_scroll( running_machine *machine )
WRITE8_HANDLER( travrusa_scroll_x_low_w )
{
- travrusa_state *state = space->machine->driver_data<travrusa_state>();
+ travrusa_state *state = space->machine().driver_data<travrusa_state>();
state->scrollx[0] = data;
- set_scroll(space->machine);
+ set_scroll(space->machine());
}
WRITE8_HANDLER( travrusa_scroll_x_high_w )
{
- travrusa_state *state = space->machine->driver_data<travrusa_state>();
+ travrusa_state *state = space->machine().driver_data<travrusa_state>();
state->scrollx[1] = data;
- set_scroll(space->machine);
+ set_scroll(space->machine());
}
WRITE8_HANDLER( travrusa_flipscreen_w )
{
/* screen flip is handled both by software and hardware */
- data ^= ~input_port_read(space->machine, "DSW2") & 1;
+ data ^= ~input_port_read(space->machine(), "DSW2") & 1;
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x20);
}
@@ -293,9 +293,9 @@ WRITE8_HANDLER( travrusa_flipscreen_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- travrusa_state *state = machine->driver_data<travrusa_state>();
+ travrusa_state *state = machine.driver_data<travrusa_state>();
int offs;
static const rectangle spritevisiblearea =
{
@@ -331,7 +331,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipy = !flipy;
}
- drawgfx_transpen(bitmap, &clip, machine->gfx[1],
+ drawgfx_transpen(bitmap, &clip, machine.gfx[1],
code,
attr & 0x0f,
flipx, flipy,
@@ -342,9 +342,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( travrusa )
{
- travrusa_state *state = screen->machine->driver_data<travrusa_state>();
+ travrusa_state *state = screen->machine().driver_data<travrusa_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c
index 14b4c46f6b9..1be115ce5f0 100644
--- a/src/mame/video/triplhnt.c
+++ b/src/mame/video/triplhnt.c
@@ -10,7 +10,7 @@ Atari Triple Hunt video emulation
static TILE_GET_INFO( get_tile_info )
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
int code = state->playfield_ram[tile_index] & 0x3f;
SET_TILE_INFO(2, code, code == 0x3f ? 1 : 0, 0);
@@ -19,8 +19,8 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( triplhnt )
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
}
@@ -32,9 +32,9 @@ static TIMER_CALLBACK( triplhnt_hit_callback )
}
-static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- triplhnt_state *state = machine->driver_data<triplhnt_state>();
+ triplhnt_state *state = machine.driver_data<triplhnt_state>();
int i;
int hit_line = 999;
@@ -74,7 +74,7 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
/* render sprite to auxiliary bitmap */
- drawgfx_opaque(state->helper, cliprect, machine->gfx[state->sprite_zoom],
+ drawgfx_opaque(state->helper, cliprect, machine.gfx[state->sprite_zoom],
2 * code + state->sprite_bank, 0, code & 8, 0,
rect.min_x, rect.min_y);
@@ -114,20 +114,20 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta
}
if (hit_line != 999 && hit_code != 999)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(hit_line), FUNC(triplhnt_hit_callback), hit_code);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(hit_line), FUNC(triplhnt_hit_callback), hit_code);
}
SCREEN_UPDATE( triplhnt )
{
- triplhnt_state *state = screen->machine->driver_data<triplhnt_state>();
- device_t *discrete = screen->machine->device("discrete");
+ triplhnt_state *state = screen->machine().driver_data<triplhnt_state>();
+ device_t *discrete = screen->machine().device("discrete");
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
discrete_sound_w(discrete, TRIPLHNT_BEAR_ROAR_DATA, state->playfield_ram[0xfa] & 15);
discrete_sound_w(discrete, TRIPLHNT_SHOT_DATA, state->playfield_ram[0xfc] & 15);
diff --git a/src/mame/video/truco.c b/src/mame/video/truco.c
index 89aabd3e063..7162287673f 100644
--- a/src/mame/video/truco.c
+++ b/src/mame/video/truco.c
@@ -13,7 +13,7 @@ PALETTE_INIT( truco )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int r = ( i & 0x8 ) ? 0xff : 0x00;
int g = ( i & 0x4 ) ? 0xff : 0x00;
@@ -33,7 +33,7 @@ PALETTE_INIT( truco )
SCREEN_UPDATE( truco )
{
- truco_state *state = screen->machine->driver_data<truco_state>();
+ truco_state *state = screen->machine().driver_data<truco_state>();
UINT8 *videoram = state->videoram;
UINT8 *vid = videoram;
int x, y;
diff --git a/src/mame/video/trucocl.c b/src/mame/video/trucocl.c
index faf84d2a538..ebaf95d2ced 100644
--- a/src/mame/video/trucocl.c
+++ b/src/mame/video/trucocl.c
@@ -46,21 +46,21 @@ PALETTE_INIT( trucocl )
WRITE8_HANDLER( trucocl_videoram_w )
{
- trucocl_state *state = space->machine->driver_data<trucocl_state>();
+ trucocl_state *state = space->machine().driver_data<trucocl_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
WRITE8_HANDLER( trucocl_colorram_w )
{
- trucocl_state *state = space->machine->driver_data<trucocl_state>();
+ trucocl_state *state = space->machine().driver_data<trucocl_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- trucocl_state *state = machine->driver_data<trucocl_state>();
+ trucocl_state *state = machine.driver_data<trucocl_state>();
int gfxsel = state->colorram[tile_index] & 1;
int bank = ( ( state->colorram[tile_index] >> 2 ) & 0x07 );
int code = state->videoram[tile_index];
@@ -75,13 +75,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( trucocl )
{
- trucocl_state *state = machine->driver_data<trucocl_state>();
+ trucocl_state *state = machine.driver_data<trucocl_state>();
state->bg_tilemap = tilemap_create( machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32 );
}
SCREEN_UPDATE( trucocl )
{
- trucocl_state *state = screen->machine->driver_data<trucocl_state>();
+ trucocl_state *state = screen->machine().driver_data<trucocl_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c
index 582947e0440..7893cfb039f 100644
--- a/src/mame/video/tryout.c
+++ b/src/mame/video/tryout.c
@@ -13,7 +13,7 @@ PALETTE_INIT( tryout )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -39,7 +39,7 @@ PALETTE_INIT( tryout )
static TILE_GET_INFO( get_fg_tile_info )
{
- tryout_state *state = machine->driver_data<tryout_state>();
+ tryout_state *state = machine.driver_data<tryout_state>();
UINT8 *videoram = state->videoram;
int code, attr, color;
@@ -53,19 +53,19 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- tryout_state *state = machine->driver_data<tryout_state>();
+ tryout_state *state = machine.driver_data<tryout_state>();
SET_TILE_INFO(2, state->vram[tile_index] & 0x7f, 2, 0);
}
READ8_HANDLER( tryout_vram_r )
{
- tryout_state *state = space->machine->driver_data<tryout_state>();
+ tryout_state *state = space->machine().driver_data<tryout_state>();
return state->vram[offset]; // debug only
}
WRITE8_HANDLER( tryout_videoram_w )
{
- tryout_state *state = space->machine->driver_data<tryout_state>();
+ tryout_state *state = space->machine().driver_data<tryout_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
@@ -73,7 +73,7 @@ WRITE8_HANDLER( tryout_videoram_w )
WRITE8_HANDLER( tryout_vram_w )
{
- tryout_state *state = space->machine->driver_data<tryout_state>();
+ tryout_state *state = space->machine().driver_data<tryout_state>();
/* There are eight banks of vram - in bank 0 the first 0x400 bytes
is reserved for the tilemap. In banks 2, 4 and 6 the game never
writes to the first 0x400 bytes - I suspect it's either
@@ -137,18 +137,18 @@ WRITE8_HANDLER( tryout_vram_w )
break;
}
- gfx_element_mark_dirty(space->machine->gfx[2], (offset-0x400/64)&0x7f);
+ gfx_element_mark_dirty(space->machine().gfx[2], (offset-0x400/64)&0x7f);
}
WRITE8_HANDLER( tryout_vram_bankswitch_w )
{
- tryout_state *state = space->machine->driver_data<tryout_state>();
+ tryout_state *state = space->machine().driver_data<tryout_state>();
state->vram_bank = data;
}
WRITE8_HANDLER( tryout_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static TILEMAP_MAPPER( get_fg_memory_offset )
@@ -170,21 +170,21 @@ static TILEMAP_MAPPER( get_bg_memory_offset )
VIDEO_START( tryout )
{
- tryout_state *state = machine->driver_data<tryout_state>();
+ tryout_state *state = machine.driver_data<tryout_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,get_fg_memory_offset,8,8,32,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,get_bg_memory_offset,16,16,64,16);
state->vram=auto_alloc_array(machine, UINT8, 8 * 0x800);
state->vram_gfx=auto_alloc_array(machine, UINT8, 0x6000);
- gfx_element_set_source(machine->gfx[2], state->vram_gfx);
+ gfx_element_set_source(machine.gfx[2], state->vram_gfx);
tilemap_set_transparent_pen(state->fg_tilemap,0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- tryout_state *state = machine->driver_data<tryout_state>();
+ tryout_state *state = machine.driver_data<tryout_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs,fx,fy,x,y,color,sprite,inc;
@@ -216,17 +216,17 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
/* Double Height */
if(spriteram[offs] & 0x10)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
color,fx,fy,x,y + inc,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite+1,
color,fx,fy,x,y,0);
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
sprite,
color,fx,fy,x,y,0);
}
@@ -235,10 +235,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( tryout )
{
- tryout_state *state = screen->machine->driver_data<tryout_state>();
+ tryout_state *state = screen->machine().driver_data<tryout_state>();
int scrollx = 0;
- if (!flip_screen_get(screen->machine))
+ if (!flip_screen_get(screen->machine()))
tilemap_set_scrollx(state->fg_tilemap, 0, 16); /* Assumed hard-wired */
else
tilemap_set_scrollx(state->fg_tilemap, 0, -8); /* Assumed hard-wired */
@@ -254,13 +254,13 @@ SCREEN_UPDATE( tryout )
if(!(state->gfx_control[0] & 0x8)) // screen disable
{
/* TODO: Color might be different, needs a video from an original pcb. */
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x10]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x10]);
}
else
{
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
}
// popmessage("%02x %02x %02x %02x",state->gfx_control[0],state->gfx_control[1],state->gfx_control[2],scrollx);
diff --git a/src/mame/video/tsamurai.c b/src/mame/video/tsamurai.c
index 675e60e310a..2ad4ae71c22 100644
--- a/src/mame/video/tsamurai.c
+++ b/src/mame/video/tsamurai.c
@@ -14,7 +14,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
UINT8 attributes = state->bg_videoram[2*tile_index+1];
int tile_number = state->bg_videoram[2*tile_index];
tile_number += (( attributes & 0xc0 ) >> 6 ) * 256; /* legacy */
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
int tile_number = state->videoram[tile_index];
if (state->textbank1 & 0x01) tile_number += 256; /* legacy */
if (state->textbank2 & 0x01) tile_number += 512; /* Mission 660 add-on */
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( tsamurai )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
state->background = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
state->foreground = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -65,25 +65,25 @@ VIDEO_START( tsamurai )
WRITE8_HANDLER( tsamurai_scrolly_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
tilemap_set_scrolly( state->background, 0, data );
}
WRITE8_HANDLER( tsamurai_scrollx_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
tilemap_set_scrollx( state->background, 0, data );
}
WRITE8_HANDLER( tsamurai_bgcolor_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->bgcolor = data;
}
WRITE8_HANDLER( tsamurai_textbank1_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
if( state->textbank1!=data )
{
state->textbank1 = data;
@@ -93,7 +93,7 @@ WRITE8_HANDLER( tsamurai_textbank1_w )
WRITE8_HANDLER( tsamurai_textbank2_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
if( state->textbank2!=data )
{
state->textbank2 = data;
@@ -103,20 +103,20 @@ WRITE8_HANDLER( tsamurai_textbank2_w )
WRITE8_HANDLER( tsamurai_bg_videoram_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->bg_videoram[offset]=data;
offset = offset/2;
tilemap_mark_tile_dirty(state->background,offset);
}
WRITE8_HANDLER( tsamurai_fg_videoram_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
state->videoram[offset]=data;
tilemap_mark_tile_dirty(state->foreground,offset);
}
WRITE8_HANDLER( tsamurai_fg_colorram_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
if( state->colorram[offset]!=data )
{
state->colorram[offset]=data;
@@ -137,11 +137,11 @@ WRITE8_HANDLER( tsamurai_fg_colorram_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
UINT8 *spriteram = state->spriteram;
- gfx_element *gfx = machine->gfx[2];
+ gfx_element *gfx = machine.gfx[2];
const UINT8 *source = spriteram+32*4-4;
const UINT8 *finish = spriteram; /* ? */
state->flicker = 1-state->flicker;
@@ -199,7 +199,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( tsamurai )
{
- tsamurai_state *state = screen->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = screen->machine().driver_data<tsamurai_state>();
int i;
/* Do the column scroll used for the "660" logo on the title screen */
@@ -220,7 +220,7 @@ SCREEN_UPDATE( tsamurai )
*/
bitmap_fill(bitmap,cliprect,state->bgcolor);
tilemap_draw(bitmap,cliprect,state->background,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->foreground,0,0);
return 0;
}
@@ -234,7 +234,7 @@ VS Gong Fight runs on older hardware
WRITE8_HANDLER( vsgongf_color_w )
{
- tsamurai_state *state = space->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = space->machine().driver_data<tsamurai_state>();
if( state->vsgongf_color != data )
{
state->vsgongf_color = data;
@@ -245,7 +245,7 @@ WRITE8_HANDLER( vsgongf_color_w )
static TILE_GET_INFO( get_vsgongf_tile_info )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
int tile_number = state->videoram[tile_index];
int color = state->vsgongf_color&0x1f;
if( state->textbank1 ) tile_number += 0x100;
@@ -258,16 +258,16 @@ static TILE_GET_INFO( get_vsgongf_tile_info )
VIDEO_START( vsgongf )
{
- tsamurai_state *state = machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = machine.driver_data<tsamurai_state>();
state->foreground = tilemap_create(machine, get_vsgongf_tile_info,tilemap_scan_rows,8,8,32,32);
}
SCREEN_UPDATE( vsgongf )
{
- tsamurai_state *state = screen->machine->driver_data<tsamurai_state>();
+ tsamurai_state *state = screen->machine().driver_data<tsamurai_state>();
#ifdef MAME_DEBUG
- if( input_code_pressed( screen->machine, KEYCODE_Q ) ){
- while( input_code_pressed( screen->machine, KEYCODE_Q ) ){
+ if( input_code_pressed( screen->machine(), KEYCODE_Q ) ){
+ while( input_code_pressed( screen->machine(), KEYCODE_Q ) ){
state->key_count++;
state->vsgongf_color = state->key_count;
tilemap_mark_all_tiles_dirty( state->foreground );
@@ -276,6 +276,6 @@ SCREEN_UPDATE( vsgongf )
#endif
tilemap_draw(bitmap,cliprect,state->foreground,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c
index 67e94930121..47a88053eb4 100644
--- a/src/mame/video/tubep.c
+++ b/src/mame/video/tubep.c
@@ -133,7 +133,7 @@
PALETTE_INIT( tubep )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
int i,r,g,b;
/* background/sprites palette variables */
@@ -338,7 +338,7 @@ PALETTE_INIT( tubep )
VIDEO_START( tubep )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
state->spritemap = auto_alloc_array(machine, UINT8, 256*256*2);
/* Set up save state */
@@ -368,7 +368,7 @@ VIDEO_START( tubep )
VIDEO_RESET( tubep )
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
memset(state->spritemap,0,256*256*2);
state->romD_addr = 0;
@@ -397,35 +397,35 @@ VIDEO_RESET( tubep )
WRITE8_HANDLER( tubep_textram_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->textram[offset] = data;
}
WRITE8_HANDLER( tubep_background_romselect_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->background_romsel = data & 1;
}
WRITE8_HANDLER( tubep_colorproms_A4_line_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->color_A4 = (data & 1)<<4;
}
WRITE8_HANDLER( tubep_background_a000_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->ls175_b7 = ((data & 0x0f) ^ 0x0f) | 0xf0;
}
WRITE8_HANDLER( tubep_background_c000_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->ls175_e8 = ((data & 0x0f) ^ 0x0f);
}
@@ -436,12 +436,12 @@ static TIMER_CALLBACK( sprite_timer_callback )
}
-static void draw_sprite(running_machine *machine)
+static void draw_sprite(running_machine &machine)
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
UINT32 XDOT;
UINT32 YDOT;
- UINT8 * romCxx = machine->region("user2")->base()+0x00000;
+ UINT8 * romCxx = machine.region("user2")->base()+0x00000;
UINT8 * romD10 = romCxx+0x10000;
UINT8 * romEF13 = romCxx+0x12000;
UINT8 * romHI2 = romCxx+0x14000;
@@ -508,7 +508,7 @@ static void draw_sprite(running_machine *machine)
WRITE8_HANDLER( tubep_sprite_control_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
if (offset < 10)
{
/*graph_ctrl[offset] = data;*/
@@ -563,21 +563,21 @@ WRITE8_HANDLER( tubep_sprite_control_w )
/SINT line will be reasserted in state->XSize * state->YSize cycles (RH0 signal cycles)
*/
/* 1.clear the /SINT interrupt line */
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
/* 2.assert /SINT again after this time */
- space->machine->scheduler().timer_set( attotime::from_hz(19968000/8) * ((state->XSize+1)*(state->YSize+1)), FUNC(sprite_timer_callback));
+ space->machine().scheduler().timer_set( attotime::from_hz(19968000/8) * ((state->XSize+1)*(state->YSize+1)), FUNC(sprite_timer_callback));
/* 3.clear of /SINT starts sprite drawing circuit */
- draw_sprite(space->machine);
+ draw_sprite(space->machine());
break;
}
}
}
-void tubep_vblank_end(running_machine *machine)
+void tubep_vblank_end(running_machine &machine)
{
- tubep_state *state = machine->driver_data<tubep_state>();
+ tubep_state *state = machine.driver_data<tubep_state>();
state->DISP = state->DISP ^ 1;
/* logerror("EOF: DISP after this is=%i, and clearing it now.\n", state->DISP); */
/* clear the new frame (the one that was (just) displayed)*/
@@ -587,14 +587,14 @@ void tubep_vblank_end(running_machine *machine)
SCREEN_UPDATE( tubep )
{
- tubep_state *state = screen->machine->driver_data<tubep_state>();
+ tubep_state *state = screen->machine().driver_data<tubep_state>();
int DISP_ = state->DISP^1;
pen_t pen_base = 32; //change it later
UINT32 v;
- UINT8 *text_gfx_base = screen->machine->region("gfx1")->base();
- UINT8 *romBxx = screen->machine->region("user1")->base() + 0x2000*state->background_romsel;
+ UINT8 *text_gfx_base = screen->machine().region("gfx1")->base();
+ UINT8 *romBxx = screen->machine().region("user1")->base() + 0x2000*state->background_romsel;
/* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect->min_y, cliprect->max_y+1); */
@@ -703,7 +703,7 @@ PALETTE_INIT( rjammer )
2, resistors_b, weights_b, 470, 0,
0, 0, 0, 0, 0 );
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -731,26 +731,26 @@ PALETTE_INIT( rjammer )
WRITE8_HANDLER( rjammer_background_LS377_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->ls377_data = data & 0xff;
}
WRITE8_HANDLER( rjammer_background_page_w )
{
- tubep_state *state = space->machine->driver_data<tubep_state>();
+ tubep_state *state = space->machine().driver_data<tubep_state>();
state->page = (data & 1) * 0x200;
}
SCREEN_UPDATE( rjammer )
{
- tubep_state *state = screen->machine->driver_data<tubep_state>();
+ tubep_state *state = screen->machine().driver_data<tubep_state>();
int DISP_ = state->DISP^1;
UINT32 v;
- UINT8 *text_gfx_base = screen->machine->region("gfx1")->base();
- UINT8 *rom13D = screen->machine->region("user1")->base();
+ UINT8 *text_gfx_base = screen->machine().region("gfx1")->base();
+ UINT8 *rom13D = screen->machine().region("user1")->base();
UINT8 *rom11BD = rom13D+0x1000;
UINT8 *rom19C = rom13D+0x5000;
diff --git a/src/mame/video/tumbleb.c b/src/mame/video/tumbleb.c
index cb34126d024..167f9bee3d0 100644
--- a/src/mame/video/tumbleb.c
+++ b/src/mame/video/tumbleb.c
@@ -19,9 +19,9 @@ to switch between 8*8 tiles and 16*16 tiles.
/******************************************************************************/
-static void tumblepb_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void tumblepb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -35,7 +35,7 @@ static void tumblepb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
y = spriteram[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = spriteram[offs + 2];
@@ -74,7 +74,7 @@ static void tumblepb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (multi >= 0)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite - multi * inc,
colour,
fx,fy,
@@ -85,9 +85,9 @@ static void tumblepb_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void jumpkids_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void jumpkids_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -101,7 +101,7 @@ static void jumpkids_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
y = spriteram[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = spriteram[offs+2];
@@ -141,7 +141,7 @@ static void jumpkids_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
while (multi >= 0)
{
drawgfx_transpen(bitmap,// x-1 for bcstory .. realign other layers?
- cliprect,machine->gfx[3],
+ cliprect,machine.gfx[3],
sprite - multi * inc,
colour,
fx,fy,
@@ -152,9 +152,9 @@ static void jumpkids_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
}
}
-static void fncywld_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void fncywld_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
UINT16 *spriteram = state->spriteram;
int offs;
@@ -168,7 +168,7 @@ static void fncywld_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
y = spriteram[offs];
flash = y & 0x1000;
- if (flash && (machine->primary_screen->frame_number() & 1))
+ if (flash && (machine.primary_screen->frame_number() & 1))
continue;
x = spriteram[offs + 2];
@@ -206,7 +206,7 @@ static void fncywld_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
while (multi >= 0)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite - multi * inc,
colour,
fx,fy,
@@ -221,7 +221,7 @@ static void fncywld_draw_sprites( running_machine *machine, bitmap_t *bitmap, co
WRITE16_HANDLER( bcstory_tilebank_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
state->tilebank = data;
tilemap_mark_all_tiles_dirty(state->pf1_tilemap);
@@ -231,7 +231,7 @@ WRITE16_HANDLER( bcstory_tilebank_w )
WRITE16_HANDLER( chokchok_tilebank_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
state->tilebank = data << 1;
tilemap_mark_all_tiles_dirty(state->pf1_tilemap);
@@ -241,7 +241,7 @@ WRITE16_HANDLER( chokchok_tilebank_w )
WRITE16_HANDLER( wlstar_tilebank_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
/* it just writes 0000 or ffff */
state->tilebank = data & 0x4000;
@@ -253,7 +253,7 @@ WRITE16_HANDLER( wlstar_tilebank_w )
WRITE16_HANDLER( suprtrio_tilebank_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
state->tilebank = data << 14; // shift it here, makes using bcstory_tilebank easier
tilemap_mark_all_tiles_dirty(state->pf1_tilemap);
@@ -264,7 +264,7 @@ WRITE16_HANDLER( suprtrio_tilebank_w )
WRITE16_HANDLER( tumblepb_pf1_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap, offset);
@@ -273,7 +273,7 @@ WRITE16_HANDLER( tumblepb_pf1_data_w )
WRITE16_HANDLER( tumblepb_pf2_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf2_data[offset]);
tilemap_mark_tile_dirty(state->pf2_tilemap, offset);
@@ -284,7 +284,7 @@ WRITE16_HANDLER( tumblepb_pf2_data_w )
WRITE16_HANDLER( fncywld_pf1_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap, offset / 2);
@@ -293,7 +293,7 @@ WRITE16_HANDLER( fncywld_pf1_data_w )
WRITE16_HANDLER( fncywld_pf2_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf2_data[offset]);
tilemap_mark_tile_dirty(state->pf2_tilemap, offset / 2);
@@ -301,14 +301,14 @@ WRITE16_HANDLER( fncywld_pf2_data_w )
WRITE16_HANDLER( tumblepb_control_0_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->control_0[offset]);
}
WRITE16_HANDLER( pangpang_pf1_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf1_data[offset]);
tilemap_mark_tile_dirty(state->pf1_tilemap, offset / 2);
@@ -317,7 +317,7 @@ WRITE16_HANDLER( pangpang_pf1_data_w )
WRITE16_HANDLER( pangpang_pf2_data_w )
{
- tumbleb_state *state = space->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = space->machine().driver_data<tumbleb_state>();
COMBINE_DATA(&state->pf2_data[offset]);
tilemap_mark_tile_dirty(state->pf2_tilemap, offset / 2);
@@ -334,9 +334,9 @@ static TILEMAP_MAPPER( tumblep_scan )
return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x60) << 5);
}
-INLINE void get_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base)
+INLINE void get_bg_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base)
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = gfx_base[tile_index];
SET_TILE_INFO(
@@ -346,12 +346,12 @@ INLINE void get_bg_tile_info( running_machine *machine, tile_data *tileinfo, int
0);
}
-static TILE_GET_INFO( get_bg1_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
-static TILE_GET_INFO( get_bg2_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); get_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
+static TILE_GET_INFO( get_bg1_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
+static TILE_GET_INFO( get_bg2_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); get_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
static TILE_GET_INFO( get_fg_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf1_data[tile_index];
SET_TILE_INFO(
@@ -361,7 +361,7 @@ static TILE_GET_INFO( get_fg_tile_info )
0);
}
-INLINE void get_fncywld_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base)
+INLINE void get_fncywld_bg_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base)
{
int data = gfx_base[tile_index * 2];
int attr = gfx_base[tile_index * 2 + 1];
@@ -373,12 +373,12 @@ INLINE void get_fncywld_bg_tile_info( running_machine *machine, tile_data *tilei
0);
}
-static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
-static TILE_GET_INFO( get_fncywld_bg2_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
+static TILE_GET_INFO( get_fncywld_bg1_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
+static TILE_GET_INFO( get_fncywld_bg2_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); get_fncywld_bg_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
static TILE_GET_INFO( get_fncywld_fg_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf1_data[tile_index * 2];
int attr = state->pf1_data[tile_index * 2 + 1];
@@ -393,7 +393,7 @@ static TILE_GET_INFO( get_fncywld_fg_tile_info )
/* jump pop */
static TILE_GET_INFO( get_jumppop_bg1_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf1_data[tile_index];
SET_TILE_INFO(
@@ -405,7 +405,7 @@ static TILE_GET_INFO( get_jumppop_bg1_tile_info )
static TILE_GET_INFO( get_jumppop_bg2_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf2_data[tile_index];
SET_TILE_INFO(
@@ -417,7 +417,7 @@ static TILE_GET_INFO( get_jumppop_bg2_tile_info )
static TILE_GET_INFO( get_jumppop_bg2_alt_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf2_data[tile_index];
SET_TILE_INFO(
@@ -430,7 +430,7 @@ static TILE_GET_INFO( get_jumppop_bg2_alt_tile_info )
static TILE_GET_INFO( get_jumppop_fg_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf1_data[tile_index];
SET_TILE_INFO(
@@ -440,7 +440,7 @@ static TILE_GET_INFO( get_jumppop_fg_tile_info )
0);
}
-INLINE void pangpang_get_bg_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base )
+INLINE void pangpang_get_bg_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base )
{
int data = gfx_base[tile_index * 2 + 1];
int attr = gfx_base[tile_index * 2];
@@ -452,7 +452,7 @@ INLINE void pangpang_get_bg_tile_info( running_machine *machine, tile_data *tile
0);
}
-INLINE void pangpang_get_bg2x_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base )
+INLINE void pangpang_get_bg2x_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base )
{
int data = gfx_base[tile_index * 2 + 1];
int attr = gfx_base[tile_index * 2];
@@ -465,12 +465,12 @@ INLINE void pangpang_get_bg2x_tile_info( running_machine *machine, tile_data *ti
}
-static TILE_GET_INFO( pangpang_get_bg1_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); pangpang_get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
-static TILE_GET_INFO( pangpang_get_bg2_tile_info ) { tumbleb_state *state = machine->driver_data<tumbleb_state>(); pangpang_get_bg2x_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
+static TILE_GET_INFO( pangpang_get_bg1_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); pangpang_get_bg_tile_info(machine, tileinfo, tile_index, 2, state->pf1_data); }
+static TILE_GET_INFO( pangpang_get_bg2_tile_info ) { tumbleb_state *state = machine.driver_data<tumbleb_state>(); pangpang_get_bg2x_tile_info(machine, tileinfo, tile_index, 1, state->pf2_data); }
static TILE_GET_INFO( pangpang_get_fg_tile_info )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
int data = state->pf1_data[tile_index * 2 + 1];
int attr = state->pf1_data[tile_index * 2];
@@ -484,7 +484,7 @@ static TILE_GET_INFO( pangpang_get_fg_tile_info )
static STATE_POSTLOAD( tumbleb_tilemap_redraw )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
tilemap_mark_all_tiles_dirty(state->pf1_tilemap);
tilemap_mark_all_tiles_dirty(state->pf1_alt_tilemap);
@@ -495,7 +495,7 @@ static STATE_POSTLOAD( tumbleb_tilemap_redraw )
VIDEO_START( pangpang )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, pangpang_get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->pf1_alt_tilemap = tilemap_create(machine, pangpang_get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32);
@@ -507,13 +507,13 @@ VIDEO_START( pangpang )
state->sprite_xoffset = -1;
state->sprite_yoffset = 0;
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
VIDEO_START( tumblepb )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32);
@@ -525,12 +525,12 @@ VIDEO_START( tumblepb )
state->sprite_xoffset = -1;
state->sprite_yoffset = 0;
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
VIDEO_START( sdfight )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32);
@@ -543,12 +543,12 @@ VIDEO_START( sdfight )
state->sprite_xoffset = 0;
state->sprite_yoffset = 1;
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
VIDEO_START( fncywld )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, get_fncywld_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->pf1_alt_tilemap = tilemap_create(machine, get_fncywld_bg1_tile_info, tumblep_scan, 16, 16, 64, 32);
@@ -560,12 +560,12 @@ VIDEO_START( fncywld )
state->sprite_xoffset = -1;
state->sprite_yoffset = 0;
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
VIDEO_START( jumppop )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, get_jumppop_fg_tile_info, tilemap_scan_rows, 8, 8, 128, 64);
state->pf1_alt_tilemap = tilemap_create(machine, get_jumppop_bg1_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
@@ -583,13 +583,13 @@ VIDEO_START( jumppop )
state->sprite_xoffset = -1;
state->sprite_yoffset = 0;
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
VIDEO_START( suprtrio )
{
- tumbleb_state *state = machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = machine.driver_data<tumbleb_state>();
state->pf1_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->pf1_alt_tilemap = tilemap_create(machine, get_bg1_tile_info, tumblep_scan, 16, 16, 64, 32);
@@ -597,7 +597,7 @@ VIDEO_START( suprtrio )
tilemap_set_transparent_pen(state->pf1_alt_tilemap, 0);
- machine->state().register_postload(tumbleb_tilemap_redraw, NULL);
+ machine.state().register_postload(tumbleb_tilemap_redraw, NULL);
}
/******************************************************************************/
@@ -605,11 +605,11 @@ VIDEO_START( suprtrio )
SCREEN_UPDATE( tumblepb )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen)
offs = 1;
@@ -635,17 +635,17 @@ SCREEN_UPDATE( tumblepb )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- tumblepb_draw_sprites(screen->machine, bitmap, cliprect);
+ tumblepb_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( jumpkids )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen)
offs = 1;
@@ -671,17 +671,17 @@ SCREEN_UPDATE( jumpkids )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( semicom )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen)
offs = 1;
@@ -707,13 +707,13 @@ SCREEN_UPDATE( semicom )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( semicom_altoffsets )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offsx, offsy, offsx2;
state->flipscreen = state->control_0[0] & 0x80;
@@ -736,17 +736,17 @@ SCREEN_UPDATE( semicom_altoffsets )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( bcstory )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
/* not sure of this */
if (state->flipscreen)
@@ -774,17 +774,17 @@ SCREEN_UPDATE( bcstory )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( semibase )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
offs = -1;
offs2 = -2;
@@ -803,17 +803,17 @@ SCREEN_UPDATE( semibase )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( sdfight )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
offs = -1;
offs2 = -5; // foreground scroll..
@@ -831,7 +831,7 @@ SCREEN_UPDATE( sdfight )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -839,11 +839,11 @@ SCREEN_UPDATE( sdfight )
SCREEN_UPDATE( fncywld )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen)
offs = 1;
@@ -869,16 +869,16 @@ SCREEN_UPDATE( fncywld )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- fncywld_draw_sprites(screen->machine, bitmap, cliprect);
+ fncywld_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( jumppop )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
- // bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ // bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_set_scrollx(state->pf1_tilemap, 0, state->control[2] - 0x3a0);
tilemap_set_scrolly(state->pf1_tilemap, 0, state->control[3]);
@@ -901,14 +901,14 @@ SCREEN_UPDATE( jumppop )
//popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", state->control[0],state->control[1],state->control[2],state->control[3],state->control[4],state->control[5],state->control[6],state->control[7]);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
SCREEN_UPDATE( suprtrio )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
tilemap_set_scrollx(state->pf1_alt_tilemap, 0, -state->control[1] - 6);
tilemap_set_scrolly(state->pf1_alt_tilemap, 0, -state->control[2]);
@@ -918,7 +918,7 @@ SCREEN_UPDATE( suprtrio )
tilemap_draw(bitmap, cliprect, state->pf2_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
#if 0
popmessage("%04x %04x %04x %04x %04x %04x %04x %04x",
state->control[0],
@@ -936,11 +936,11 @@ popmessage("%04x %04x %04x %04x %04x %04x %04x %04x",
SCREEN_UPDATE( pangpang )
{
- tumbleb_state *state = screen->machine->driver_data<tumbleb_state>();
+ tumbleb_state *state = screen->machine().driver_data<tumbleb_state>();
int offs, offs2;
state->flipscreen = state->control_0[0] & 0x80;
- tilemap_set_flip_all(screen->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
if (state->flipscreen)
offs = 1;
@@ -966,6 +966,6 @@ SCREEN_UPDATE( pangpang )
else
tilemap_draw(bitmap, cliprect, state->pf1_alt_tilemap, 0, 0);
- jumpkids_draw_sprites(screen->machine, bitmap, cliprect);
+ jumpkids_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/tumblep.c b/src/mame/video/tumblep.c
index a9017693c6e..120683dae6c 100644
--- a/src/mame/video/tumblep.c
+++ b/src/mame/video/tumblep.c
@@ -21,10 +21,10 @@ to switch between 8*8 tiles and 16*16 tiles.
SCREEN_UPDATE( tumblep )
{
- tumblep_state *state = screen->machine->driver_data<tumblep_state>();
+ tumblep_state *state = screen->machine().driver_data<tumblep_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 256); /* not verified */
@@ -32,6 +32,6 @@ SCREEN_UPDATE( tumblep )
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
return 0;
}
diff --git a/src/mame/video/tunhunt.c b/src/mame/video/tunhunt.c
index 5915bc36bdf..7f83eb2011e 100644
--- a/src/mame/video/tunhunt.c
+++ b/src/mame/video/tunhunt.c
@@ -50,7 +50,7 @@
WRITE8_HANDLER( tunhunt_videoram_w )
{
- tunhunt_state *state = space->machine->driver_data<tunhunt_state>();
+ tunhunt_state *state = space->machine().driver_data<tunhunt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -58,7 +58,7 @@ WRITE8_HANDLER( tunhunt_videoram_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- tunhunt_state *state = machine->driver_data<tunhunt_state>();
+ tunhunt_state *state = machine.driver_data<tunhunt_state>();
int attr = state->videoram[tile_index];
int code = attr & 0x3f;
int color = attr >> 6;
@@ -74,9 +74,9 @@ VIDEO_START( tunhunt )
We keep track of dirty lines and cache the expanded bitmap.
With max RLE expansion, bitmap size is 256x64.
*/
- tunhunt_state *state = machine->driver_data<tunhunt_state>();
+ tunhunt_state *state = machine.driver_data<tunhunt_state>();
- machine->generic.tmpbitmap = auto_bitmap_alloc(machine, 256, 64, machine->primary_screen->format());
+ machine.generic.tmpbitmap = auto_bitmap_alloc(machine, 256, 64, machine.primary_screen->format());
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
@@ -94,11 +94,11 @@ PALETTE_INIT( tunhunt )
*/
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* motion objects/box */
for (i = 0; i < 0x10; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* AlphaNumerics (1bpp)
* 2 bits of hilite select from 4 different background colors
@@ -107,26 +107,26 @@ PALETTE_INIT( tunhunt )
*/
/* alpha hilite#0 */
- colortable_entry_set_value(machine->colortable, 0x10, 0x0); /* background color#0 (transparent) */
- colortable_entry_set_value(machine->colortable, 0x11, 0x4); /* foreground color */
+ colortable_entry_set_value(machine.colortable, 0x10, 0x0); /* background color#0 (transparent) */
+ colortable_entry_set_value(machine.colortable, 0x11, 0x4); /* foreground color */
/* alpha hilite#1 */
- colortable_entry_set_value(machine->colortable, 0x12, 0x5); /* background color#1 */
- colortable_entry_set_value(machine->colortable, 0x13, 0x4); /* foreground color */
+ colortable_entry_set_value(machine.colortable, 0x12, 0x5); /* background color#1 */
+ colortable_entry_set_value(machine.colortable, 0x13, 0x4); /* foreground color */
/* alpha hilite#2 */
- colortable_entry_set_value(machine->colortable, 0x14, 0x6); /* background color#2 */
- colortable_entry_set_value(machine->colortable, 0x15, 0x4); /* foreground color */
+ colortable_entry_set_value(machine.colortable, 0x14, 0x6); /* background color#2 */
+ colortable_entry_set_value(machine.colortable, 0x15, 0x4); /* foreground color */
/* alpha hilite#3 */
- colortable_entry_set_value(machine->colortable, 0x16, 0xf); /* background color#3 */
- colortable_entry_set_value(machine->colortable, 0x17, 0x4); /* foreground color */
+ colortable_entry_set_value(machine.colortable, 0x16, 0xf); /* background color#3 */
+ colortable_entry_set_value(machine.colortable, 0x17, 0x4); /* foreground color */
/* shell graphics; these are either 1bpp (2 banks) or 2bpp. It isn't clear which.
* In any event, the following pens are associated with the shell graphics:
*/
- colortable_entry_set_value(machine->colortable, 0x18, 0);
- colortable_entry_set_value(machine->colortable, 0x19, 4);//1;
+ colortable_entry_set_value(machine.colortable, 0x18, 0);
+ colortable_entry_set_value(machine.colortable, 0x19, 4);//1;
}
/*
@@ -142,7 +142,7 @@ Color Array Ram Assignments:
8-E Lines (as normal) background
F Hilight 3
*/
-static void set_pens(running_machine *machine)
+static void set_pens(running_machine &machine)
{
/*
The actual contents of the color proms (unused by this driver)
@@ -156,7 +156,7 @@ static void set_pens(running_machine *machine)
0020: 00 f0 f0 f0 b0 b0 00 f0
00 f0 f0 00 b0 00 f0 f0
*/
- //const UINT8 *color_prom = machine->region( "proms" )->base();
+ //const UINT8 *color_prom = machine.region( "proms" )->base();
int color;
int shade;
int i;
@@ -164,7 +164,7 @@ static void set_pens(running_machine *machine)
for( i=0; i<16; i++ )
{
- color = machine->generic.paletteram.u8[i];
+ color = machine.generic.paletteram.u8[i];
shade = 0xf^(color>>4);
color &= 0xf; /* hue select */
@@ -196,11 +196,11 @@ static void set_pens(running_machine *machine)
green = APPLY_SHADE(green,shade);
blue = APPLY_SHADE(blue,shade);
- colortable_palette_set_color( machine->colortable,i,MAKE_RGB(red,green,blue) );
+ colortable_palette_set_color( machine.colortable,i,MAKE_RGB(red,green,blue) );
}
}
-static void draw_motion_object(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_motion_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
* VSTRLO 0x1202
@@ -213,8 +213,8 @@ static void draw_motion_object(running_machine *machine, bitmap_t *bitmap, const
* always 0x00?
*/
- tunhunt_state *state = machine->driver_data<tunhunt_state>();
- bitmap_t *tmpbitmap = machine->generic.tmpbitmap;
+ tunhunt_state *state = machine.driver_data<tunhunt_state>();
+ bitmap_t *tmpbitmap = machine.generic.tmpbitmap;
UINT8 *spriteram = state->spriteram;
UINT8 *tunhunt_ram = state->workram;
//int skip = tunhunt_ram[MOBST];
@@ -272,7 +272,7 @@ static void draw_motion_object(running_machine *machine, bitmap_t *bitmap, const
);
}
-static void draw_box(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_box(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/*
This is unnecessarily slow, but the box priorities aren't completely understood,
@@ -292,7 +292,7 @@ static void draw_box(running_machine *machine, bitmap_t *bitmap, const rectangle
1280: 07 03 00 01 07 06 04 05 02 07 03 00 09 0a 0b 0c palette select
->hue 06 02 ff 60 06 05 03 04 01 06 02 ff d2 00 c2 ff
*/
- tunhunt_state *state = machine->driver_data<tunhunt_state>();
+ tunhunt_state *state = machine.driver_data<tunhunt_state>();
UINT8 *tunhunt_ram = state->workram;
int span,x,y;
int color;
@@ -326,7 +326,7 @@ static void draw_box(running_machine *machine, bitmap_t *bitmap, const rectangle
}
/* "shell" graphics are 16x16 pixel tiles used for player shots and targeting cursor */
-static void draw_shell(running_machine *machine,
+static void draw_shell(running_machine &machine,
bitmap_t *bitmap,
const rectangle *cliprect,
int picture_code,
@@ -344,7 +344,7 @@ static void draw_shell(running_machine *machine,
for( sy=0; sy<256; sy+=16 )
{
drawgfx_transpen( bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
picture_code,
0, /* color */
0,0, /* flip */
@@ -369,7 +369,7 @@ static void draw_shell(running_machine *machine,
*/
drawgfx_transpen( bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
picture_code,
0, /* color */
0,0, /* flip */
@@ -378,14 +378,14 @@ static void draw_shell(running_machine *machine,
SCREEN_UPDATE( tunhunt )
{
- tunhunt_state *state = screen->machine->driver_data<tunhunt_state>();
- set_pens(screen->machine);
+ tunhunt_state *state = screen->machine().driver_data<tunhunt_state>();
+ set_pens(screen->machine());
- draw_box(screen->machine, bitmap, cliprect);
+ draw_box(screen->machine(), bitmap, cliprect);
- draw_motion_object(screen->machine, bitmap, cliprect);
+ draw_motion_object(screen->machine(), bitmap, cliprect);
- draw_shell(screen->machine, bitmap, cliprect,
+ draw_shell(screen->machine(), bitmap, cliprect,
state->workram[SHL0PC], /* picture code */
state->workram[SHEL0H], /* hposition */
state->workram[SHL0V], /* vstart */
@@ -393,7 +393,7 @@ SCREEN_UPDATE( tunhunt )
state->workram[SHL0ST], /* vstretch */
state->control&0x08 ); /* hstretch */
- draw_shell(screen->machine, bitmap, cliprect,
+ draw_shell(screen->machine(), bitmap, cliprect,
state->workram[SHL1PC], /* picture code */
state->workram[SHEL1H], /* hposition */
state->workram[SHL1V], /* vstart */
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index 2dd8de4e9e2..933b670cd43 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -167,7 +167,7 @@ PALETTE_INIT( buckrog )
static TILE_GET_INFO( get_fg_tile_info )
{
- turbo_state *state = machine->driver_data<turbo_state>();
+ turbo_state *state = machine.driver_data<turbo_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(0, code, code >> 2, 0);
}
@@ -175,7 +175,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( turbo )
{
- turbo_state *state = machine->driver_data<turbo_state>();
+ turbo_state *state = machine.driver_data<turbo_state>();
/* initialize the foreground tilemap */
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -184,7 +184,7 @@ VIDEO_START( turbo )
VIDEO_START( buckrog )
{
- turbo_state *state = machine->driver_data<turbo_state>();
+ turbo_state *state = machine.driver_data<turbo_state>();
/* initialize the foreground tilemap */
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -204,11 +204,11 @@ VIDEO_START( buckrog )
WRITE8_HANDLER( turbo_videoram_w )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
+ turbo_state *state = space->machine().driver_data<turbo_state>();
state->videoram[offset] = data;
if (offset < 0x400)
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
}
@@ -216,7 +216,7 @@ WRITE8_HANDLER( turbo_videoram_w )
WRITE8_HANDLER( buckrog_bitmap_w )
{
- turbo_state *state = space->machine->driver_data<turbo_state>();
+ turbo_state *state = space->machine().driver_data<turbo_state>();
state->buckrog_bitmap_ram[offset] = data & 1;
}
@@ -283,9 +283,9 @@ INLINE UINT32 sprite_xscale(UINT8 dacinput, double vr1, double vr2, double cext)
*
*************************************/
-static void turbo_prepare_sprites(running_machine *machine, turbo_state *state, UINT8 y, sprite_info *info)
+static void turbo_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr1119 = machine->region("proms")->base() + 0x200;
+ const UINT8 *pr1119 = machine.region("proms")->base() + 0x200;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -349,9 +349,9 @@ static void turbo_prepare_sprites(running_machine *machine, turbo_state *state,
}
-static UINT32 turbo_get_sprite_bits(running_machine *machine, UINT8 road, sprite_info *sprinfo)
+static UINT32 turbo_get_sprite_bits(running_machine &machine, UINT8 road, sprite_info *sprinfo)
{
- const UINT8 *sprite_gfxdata = machine->region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
UINT8 sprlive = sprinfo->lst;
UINT32 sprdata = 0;
int level;
@@ -406,10 +406,10 @@ static UINT32 turbo_get_sprite_bits(running_machine *machine, UINT8 road, sprite
SCREEN_UPDATE( turbo )
{
- turbo_state *state = screen->machine->driver_data<turbo_state>();
+ turbo_state *state = screen->machine().driver_data<turbo_state>();
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
- const UINT8 *road_gfxdata = screen->machine->region("gfx3")->base();
- const UINT8 *prom_base = screen->machine->region("proms")->base();
+ const UINT8 *road_gfxdata = screen->machine().region("gfx3")->base();
+ const UINT8 *prom_base = screen->machine().region("proms")->base();
const UINT8 *pr1114 = prom_base + 0x000;
const UINT8 *pr1115 = prom_base + 0x020;
const UINT8 *pr1116 = prom_base + 0x040;
@@ -437,7 +437,7 @@ SCREEN_UPDATE( turbo )
/* compute the sprite information; we use y-1 since this info was computed during HBLANK */
/* on the previous scanline */
- turbo_prepare_sprites(screen->machine, state, y, &sprinfo);
+ turbo_prepare_sprites(screen->machine(), state, y, &sprinfo);
/* loop over columns */
for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
@@ -533,7 +533,7 @@ SCREEN_UPDATE( turbo )
/* CDG0-7 = D8 -D15 */
/* CDR0-7 = D16-D23 */
/* PLB0-7 = D24-D31 */
- sprbits = turbo_get_sprite_bits(screen->machine, road, &sprinfo);
+ sprbits = turbo_get_sprite_bits(screen->machine(), road, &sprinfo);
/* perform collision detection here via lookup in IC20/PR1116 (p. 144) */
state->turbo_collision |= pr1116[((sprbits >> 24) & 7) | (slipar_acciar >> 1)];
@@ -642,9 +642,9 @@ SCREEN_UPDATE( turbo )
*/
-static void subroc3d_prepare_sprites(running_machine *machine, turbo_state *state, UINT8 y, sprite_info *info)
+static void subroc3d_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr1449 = machine->region("proms")->base() + 0x300;
+ const UINT8 *pr1449 = machine.region("proms")->base() + 0x300;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -702,7 +702,7 @@ static void subroc3d_prepare_sprites(running_machine *machine, turbo_state *stat
}
-static UINT32 subroc3d_get_sprite_bits(running_machine *machine, sprite_info *sprinfo, UINT8 *plb)
+static UINT32 subroc3d_get_sprite_bits(running_machine &machine, sprite_info *sprinfo, UINT8 *plb)
{
/* see logic on each sprite:
END = (CDA == 1 && (CDA ^ CDB) == 0 && (CDC ^ CDD) == 0)
@@ -710,7 +710,7 @@ static UINT32 subroc3d_get_sprite_bits(running_machine *machine, sprite_info *sp
end is in bit 1, plb in bit 0
*/
static const UINT8 plb_end[16] = { 0,1,1,2, 1,1,1,1, 1,1,1,1, 0,1,1,2 };
- const UINT8 *sprite_gfxdata = machine->region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
UINT32 sprdata = 0;
int level;
@@ -761,9 +761,9 @@ static UINT32 subroc3d_get_sprite_bits(running_machine *machine, sprite_info *sp
SCREEN_UPDATE( subroc3d )
{
- turbo_state *state = screen->machine->driver_data<turbo_state>();
+ turbo_state *state = screen->machine().driver_data<turbo_state>();
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
- const UINT8 *prom_base = screen->machine->region("proms")->base();
+ const UINT8 *prom_base = screen->machine().region("proms")->base();
const UINT8 *pr1419 = prom_base + 0x000;
const UINT8 *pr1620 = prom_base + 0x200;
const UINT8 *pr1450 = prom_base + 0x500;
@@ -779,7 +779,7 @@ SCREEN_UPDATE( subroc3d )
/* compute the sprite information; we use y-1 since this info was computed during HBLANK */
/* on the previous scanline */
- subroc3d_prepare_sprites(screen->machine, state, y, &sprinfo);
+ subroc3d_prepare_sprites(screen->machine(), state, y, &sprinfo);
/* loop over columns */
for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
@@ -819,7 +819,7 @@ SCREEN_UPDATE( subroc3d )
/* CDB0-7 = D8 -D15 */
/* CDC0-7 = D16-D23 */
/* CDD0-7 = D24-D31 */
- sprbits = subroc3d_get_sprite_bits(screen->machine, &sprinfo, &plb);
+ sprbits = subroc3d_get_sprite_bits(screen->machine(), &sprinfo, &plb);
/* MUX0-3 is selected by PLY0-3 and the sprite enable bits, and is the output */
/* of IC21/PR1450 (p. 141), unless MPLB = 0, in which case the values are grounded (p. 141) */
@@ -861,9 +861,9 @@ SCREEN_UPDATE( subroc3d )
*
*************************************/
-static void buckrog_prepare_sprites(running_machine *machine, turbo_state *state, UINT8 y, sprite_info *info)
+static void buckrog_prepare_sprites(running_machine &machine, turbo_state *state, UINT8 y, sprite_info *info)
{
- const UINT8 *pr5196 = machine->region("proms")->base() + 0x100;
+ const UINT8 *pr5196 = machine.region("proms")->base() + 0x100;
int sprnum;
/* initialize the line enable signals to 0 */
@@ -922,7 +922,7 @@ static void buckrog_prepare_sprites(running_machine *machine, turbo_state *state
}
-static UINT32 buckrog_get_sprite_bits(running_machine *machine, sprite_info *sprinfo, UINT8 *plb)
+static UINT32 buckrog_get_sprite_bits(running_machine &machine, sprite_info *sprinfo, UINT8 *plb)
{
/* see logic on each sprite:
END = (CDA == 1 && (CDA ^ CDB) == 0 && (CDC ^ CDD) == 0)
@@ -930,7 +930,7 @@ static UINT32 buckrog_get_sprite_bits(running_machine *machine, sprite_info *spr
end is in bit 1, plb in bit 0
*/
static const UINT8 plb_end[16] = { 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,2 };
- const UINT8 *sprite_gfxdata = machine->region("gfx1")->base();
+ const UINT8 *sprite_gfxdata = machine.region("gfx1")->base();
UINT32 sprdata = 0;
int level;
@@ -981,10 +981,10 @@ static UINT32 buckrog_get_sprite_bits(running_machine *machine, sprite_info *spr
SCREEN_UPDATE( buckrog )
{
- turbo_state *state = screen->machine->driver_data<turbo_state>();
+ turbo_state *state = screen->machine().driver_data<turbo_state>();
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
- const UINT8 *bgcolor = screen->machine->region("gfx3")->base();
- const UINT8 *prom_base = screen->machine->region("proms")->base();
+ const UINT8 *bgcolor = screen->machine().region("gfx3")->base();
+ const UINT8 *prom_base = screen->machine().region("proms")->base();
const UINT8 *pr5194 = prom_base + 0x000;
const UINT8 *pr5198 = prom_base + 0x500;
const UINT8 *pr5199 = prom_base + 0x700;
@@ -999,7 +999,7 @@ SCREEN_UPDATE( buckrog )
/* compute the sprite information; we use y-1 since this info was computed during HBLANK */
/* on the previous scanline */
- buckrog_prepare_sprites(screen->machine, state, y, &sprinfo);
+ buckrog_prepare_sprites(screen->machine(), state, y, &sprinfo);
/* loop over columns */
for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
@@ -1036,7 +1036,7 @@ SCREEN_UPDATE( buckrog )
/* CDB0-7 = D8 -D15 */
/* CDC0-7 = D16-D23 */
/* CDD0-7 = D24-D31 */
- sprbits = buckrog_get_sprite_bits(screen->machine, &sprinfo, &plb);
+ sprbits = buckrog_get_sprite_bits(screen->machine(), &sprinfo, &plb);
/* the PLB bits go into an LS148 8-to-1 decoder and become MUX0-3 (PROM board SH 2/10) */
if (plb == 0)
diff --git a/src/mame/video/tutankhm.c b/src/mame/video/tutankhm.c
index f92fc322288..decb9d12ce1 100644
--- a/src/mame/video/tutankhm.c
+++ b/src/mame/video/tutankhm.c
@@ -21,14 +21,14 @@
WRITE8_HANDLER( tutankhm_flip_screen_x_w )
{
- tutankhm_state *state = space->machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = space->machine().driver_data<tutankhm_state>();
state->flip_x = data & 0x01;
}
WRITE8_HANDLER( tutankhm_flip_screen_y_w )
{
- tutankhm_state *state = space->machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = space->machine().driver_data<tutankhm_state>();
state->flip_y = data & 0x01;
}
@@ -39,9 +39,9 @@ WRITE8_HANDLER( tutankhm_flip_screen_y_w )
*
*************************************/
-static void get_pens( running_machine *machine, pen_t *pens )
+static void get_pens( running_machine &machine, pen_t *pens )
{
- tutankhm_state *state = machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = machine.driver_data<tutankhm_state>();
offs_t i;
for (i = 0; i < NUM_PENS; i++)
@@ -61,13 +61,13 @@ static void get_pens( running_machine *machine, pen_t *pens )
SCREEN_UPDATE( tutankhm )
{
- tutankhm_state *state = screen->machine->driver_data<tutankhm_state>();
+ tutankhm_state *state = screen->machine().driver_data<tutankhm_state>();
int xorx = state->flip_x ? 255 : 0;
int xory = state->flip_y ? 255 : 0;
pen_t pens[NUM_PENS];
int x, y;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c
index bf56b0ab499..80533460f2d 100644
--- a/src/mame/video/twin16.c
+++ b/src/mame/video/twin16.c
@@ -42,36 +42,36 @@ enum
WRITE16_HANDLER( twin16_text_ram_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
COMBINE_DATA(&state->text_ram[offset]);
tilemap_mark_tile_dirty(state->text_tilemap, offset);
}
WRITE16_HANDLER( twin16_paletteram_word_w )
{ // identical to tmnt_paletteram_w
- COMBINE_DATA(space->machine->generic.paletteram.u16 + offset);
+ COMBINE_DATA(space->machine().generic.paletteram.u16 + offset);
offset &= ~1;
- data = ((space->machine->generic.paletteram.u16[offset] & 0xff) << 8) | (space->machine->generic.paletteram.u16[offset + 1] & 0xff);
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ data = ((space->machine().generic.paletteram.u16[offset] & 0xff) << 8) | (space->machine().generic.paletteram.u16[offset + 1] & 0xff);
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
}
WRITE16_HANDLER( fround_gfx_bank_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
COMBINE_DATA(&state->gfx_bank);
}
WRITE16_HANDLER( twin16_video_register_w )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
switch (offset)
{
case 0:
COMBINE_DATA( &state->video_register );
- flip_screen_x_set(space->machine, state->video_register & TWIN16_SCREEN_FLIPX);
- flip_screen_y_set(space->machine, state->video_register & TWIN16_SCREEN_FLIPY);
+ flip_screen_x_set(space->machine(), state->video_register & TWIN16_SCREEN_FLIPX);
+ flip_screen_y_set(space->machine(), state->video_register & TWIN16_SCREEN_FLIPY);
break;
@@ -136,33 +136,33 @@ WRITE16_HANDLER( twin16_video_register_w )
READ16_HANDLER( twin16_sprite_status_r )
{
- twin16_state *state = space->machine->driver_data<twin16_state>();
+ twin16_state *state = space->machine().driver_data<twin16_state>();
// bit 0: busy, other bits: dunno
return state->sprite_busy;
}
static TIMER_CALLBACK( twin16_sprite_tick )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
state->sprite_busy = 0;
}
-static int twin16_set_sprite_timer( running_machine *machine )
+static int twin16_set_sprite_timer( running_machine &machine )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
if (state->sprite_busy) return 1;
// sprite system busy, maybe a dma? time is guessed, assume 4 scanlines
state->sprite_busy = 1;
- state->sprite_timer->adjust(machine->primary_screen->frame_period() / machine->primary_screen->height() * 4);
+ state->sprite_timer->adjust(machine.primary_screen->frame_period() / machine.primary_screen->height() * 4);
return 0;
}
-void twin16_spriteram_process( running_machine *machine )
+void twin16_spriteram_process( running_machine &machine )
{
- twin16_state *state = machine->driver_data<twin16_state>();
- UINT16 *spriteram16 = machine->generic.spriteram.u16;
+ twin16_state *state = machine.driver_data<twin16_state>();
+ UINT16 *spriteram16 = machine.generic.spriteram.u16;
UINT16 dx = state->scrollx[0];
UINT16 dy = state->scrolly[0];
@@ -221,11 +221,11 @@ void twin16_spriteram_process( running_machine *machine )
state->need_process_spriteram = 0;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap )
{
- twin16_state *state = machine->driver_data<twin16_state>();
- const UINT16 *source = 0x1800+machine->generic.buffered_spriteram.u16 + 0x800 - 4;
- const UINT16 *finish = 0x1800+machine->generic.buffered_spriteram.u16;
+ twin16_state *state = machine.driver_data<twin16_state>();
+ const UINT16 *source = 0x1800+machine.generic.buffered_spriteram.u16 + 0x800 - 4;
+ const UINT16 *finish = 0x1800+machine.generic.buffered_spriteram.u16;
for (; source >= finish; source -= 4)
{
@@ -304,7 +304,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap )
if( sy>=16 && sy<256-16 )
{
UINT16 *dest = BITMAP_ADDR16(bitmap, sy, 0);
- UINT8 *pdest = BITMAP_ADDR8(machine->priority_bitmap, sy, 0);
+ UINT8 *pdest = BITMAP_ADDR8(machine.priority_bitmap, sy, 0);
for( x=0; x<width; x++ )
{
@@ -319,7 +319,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap )
if (pdest[sx]<priority) {
if (shadow) {
- dest[sx] = machine->shadow_table[dest[sx]];
+ dest[sx] = machine.shadow_table[dest[sx]];
pdest[sx]|=TWIN16_SPRITE_CAST_SHADOW;
}
else {
@@ -328,7 +328,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap )
}
else if (!shadow && pdest[sx]&TWIN16_SPRITE_CAST_SHADOW && (pdest[sx]&0xf)<priority) {
// shadow cast onto sprite below, evident in devilw lava level
- dest[sx] = machine->shadow_table[pal_base + pen];
+ dest[sx] = machine.shadow_table[pal_base + pen];
pdest[sx]^=TWIN16_SPRITE_CAST_SHADOW;
}
@@ -344,9 +344,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap )
-static void draw_layer( running_machine *machine, bitmap_t *bitmap, int opaque )
+static void draw_layer( running_machine &machine, bitmap_t *bitmap, int opaque )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
UINT16 *videoram = state->videoram;
const UINT16 *gfx_base;
const UINT16 *source = videoram;
@@ -439,7 +439,7 @@ static void draw_layer( running_machine *machine, bitmap_t *bitmap, int opaque )
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pdest = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pdest = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
for (x = x1; x <= x2; x++)
{
@@ -456,7 +456,7 @@ static void draw_layer( running_machine *machine, bitmap_t *bitmap, int opaque )
{
const UINT16 *gfxptr = gfx_data + ((y - ypos) ^ yxor) * 2;
UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
- UINT8 *pdest = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
+ UINT8 *pdest = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
for (x = x1; x <= x2; x++)
{
@@ -477,7 +477,7 @@ static void draw_layer( running_machine *machine, bitmap_t *bitmap, int opaque )
static TILE_GET_INFO( get_text_tile_info )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
const UINT16 *source = state->text_ram;
int attr = source[tile_index];
/* fedcba9876543210
@@ -498,7 +498,7 @@ static TILE_GET_INFO( get_text_tile_info )
VIDEO_START( twin16 )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
state->text_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->text_tilemap, 0);
@@ -506,7 +506,7 @@ VIDEO_START( twin16 )
memset(state->sprite_buffer,0xff,0x800*sizeof(UINT16));
state->sprite_busy = 0;
- state->sprite_timer = machine->scheduler().timer_alloc(FUNC(twin16_sprite_tick));
+ state->sprite_timer = machine.scheduler().timer_alloc(FUNC(twin16_sprite_tick));
state->sprite_timer->adjust(attotime::never);
/* register for savestates */
@@ -522,15 +522,15 @@ VIDEO_START( twin16 )
SCREEN_UPDATE( twin16 )
{
- twin16_state *state = screen->machine->driver_data<twin16_state>();
+ twin16_state *state = screen->machine().driver_data<twin16_state>();
int text_flip=0;
if (state->video_register&TWIN16_SCREEN_FLIPX) text_flip|=TILEMAP_FLIPX;
if (state->video_register&TWIN16_SCREEN_FLIPY) text_flip|=TILEMAP_FLIPY;
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
- draw_layer( screen->machine, bitmap, 1 );
- draw_layer( screen->machine, bitmap, 0 );
- draw_sprites( screen->machine, bitmap );
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
+ draw_layer( screen->machine(), bitmap, 1 );
+ draw_layer( screen->machine(), bitmap, 0 );
+ draw_sprites( screen->machine(), bitmap );
if (text_flip) tilemap_set_flip(state->text_tilemap, text_flip);
tilemap_draw(bitmap, cliprect, state->text_tilemap, 0, 0);
@@ -539,7 +539,7 @@ SCREEN_UPDATE( twin16 )
SCREEN_EOF( twin16 )
{
- twin16_state *state = machine->driver_data<twin16_state>();
+ twin16_state *state = machine.driver_data<twin16_state>();
twin16_set_sprite_timer(machine);
if (twin16_spriteram_process_enable(machine)) {
@@ -549,11 +549,11 @@ SCREEN_EOF( twin16 )
/* if the sprite preprocessor is used, sprite ram is copied to an external buffer first,
as evidenced by 1-frame sprite lag in gradius2 and devilw otherwise, though there's probably
more to it than that */
- memcpy(&machine->generic.buffered_spriteram.u16[0x1800],state->sprite_buffer,0x800*sizeof(UINT16));
- memcpy(state->sprite_buffer,&machine->generic.spriteram.u16[0x1800],0x800*sizeof(UINT16));
+ memcpy(&machine.generic.buffered_spriteram.u16[0x1800],state->sprite_buffer,0x800*sizeof(UINT16));
+ memcpy(state->sprite_buffer,&machine.generic.spriteram.u16[0x1800],0x800*sizeof(UINT16));
}
else {
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
}
}
diff --git a/src/mame/video/twincobr.c b/src/mame/video/twincobr.c
index f82a8090bd8..4a08db8730d 100644
--- a/src/mame/video/twincobr.c
+++ b/src/mame/video/twincobr.c
@@ -42,7 +42,7 @@ const mc6845_interface twincobr_mc6845_intf =
static TILE_GET_INFO( get_bg_tile_info )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
int code, tile_number, color;
code = state->bgvideoram16[tile_index+state->bg_ram_bank];
@@ -57,7 +57,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
int code, tile_number, color;
code = state->fgvideoram16[tile_index];
@@ -72,7 +72,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
int code, tile_number, color;
code = state->txvideoram16[tile_index];
@@ -89,9 +89,9 @@ static TILE_GET_INFO( get_tx_tile_info )
Start the video hardware emulation.
***************************************************************************/
-static void twincobr_create_tilemaps(running_machine *machine)
+static void twincobr_create_tilemaps(running_machine &machine)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
@@ -103,7 +103,7 @@ static void twincobr_create_tilemaps(running_machine *machine)
VIDEO_START( toaplan0 )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
/* the video RAM is accessed via ports, it's not memory mapped */
state->txvideoram_size = 0x0800;
@@ -138,12 +138,12 @@ VIDEO_START( toaplan0 )
state_save_register_global(machine, state->bg_ram_bank);
state_save_register_global(machine, state->flip_screen);
state_save_register_global(machine, state->wardner_sprite_hack);
- machine->state().register_postload(twincobr_restore_screen, NULL);
+ machine.state().register_postload(twincobr_restore_screen, NULL);
}
static STATE_POSTLOAD( twincobr_restore_screen )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
twincobr_display(machine, state->display_on);
twincobr_flipscreen(machine, state->flip_screen);
@@ -154,9 +154,9 @@ static STATE_POSTLOAD( twincobr_restore_screen )
Video I/O interface
***************************************************************************/
-void twincobr_display(running_machine *machine, int enable)
+void twincobr_display(running_machine &machine, int enable)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
state->display_on = enable;
tilemap_set_enable(state->bg_tilemap, enable);
@@ -164,9 +164,9 @@ void twincobr_display(running_machine *machine, int enable)
tilemap_set_enable(state->tx_tilemap, enable);
}
-void twincobr_flipscreen(running_machine *machine, int flip)
+void twincobr_flipscreen(running_machine &machine, int flip)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
tilemap_set_flip_all(machine, (flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0));
state->flip_screen = flip;
@@ -183,20 +183,20 @@ void twincobr_flipscreen(running_machine *machine, int flip)
WRITE16_HANDLER( twincobr_txoffs_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->txoffs);
state->txoffs %= state->txvideoram_size;
}
READ16_HANDLER( twincobr_txram_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
return state->txvideoram16[state->txoffs];
}
WRITE16_HANDLER( twincobr_txram_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->txvideoram16[state->txoffs]);
tilemap_mark_tile_dirty(state->tx_tilemap,state->txoffs);
@@ -204,20 +204,20 @@ WRITE16_HANDLER( twincobr_txram_w )
WRITE16_HANDLER( twincobr_bgoffs_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->bgoffs);
state->bgoffs %= (state->bgvideoram_size >> 1);
}
READ16_HANDLER( twincobr_bgram_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
return state->bgvideoram16[state->bgoffs+state->bg_ram_bank];
}
WRITE16_HANDLER( twincobr_bgram_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->bgvideoram16[state->bgoffs+state->bg_ram_bank]);
tilemap_mark_tile_dirty(state->bg_tilemap,(state->bgoffs+state->bg_ram_bank));
@@ -225,20 +225,20 @@ WRITE16_HANDLER( twincobr_bgram_w )
WRITE16_HANDLER( twincobr_fgoffs_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->fgoffs);
state->fgoffs %= state->fgvideoram_size;
}
READ16_HANDLER( twincobr_fgram_r )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
return state->fgvideoram16[state->fgoffs];
}
WRITE16_HANDLER( twincobr_fgram_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
COMBINE_DATA(&state->fgvideoram16[state->fgoffs]);
tilemap_mark_tile_dirty(state->fg_tilemap,state->fgoffs);
@@ -247,7 +247,7 @@ WRITE16_HANDLER( twincobr_fgram_w )
WRITE16_HANDLER( twincobr_txscroll_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
if (offset == 0) {
COMBINE_DATA(&state->txscrollx);
@@ -261,7 +261,7 @@ WRITE16_HANDLER( twincobr_txscroll_w )
WRITE16_HANDLER( twincobr_bgscroll_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
if (offset == 0) {
COMBINE_DATA(&state->bgscrollx);
@@ -275,7 +275,7 @@ WRITE16_HANDLER( twincobr_bgscroll_w )
WRITE16_HANDLER( twincobr_fgscroll_w )
{
- twincobr_state *state = space->machine->driver_data<twincobr_state>();
+ twincobr_state *state = space->machine().driver_data<twincobr_state>();
if (offset == 0) {
COMBINE_DATA(&state->fgscrollx);
@@ -365,12 +365,12 @@ WRITE8_HANDLER( wardner_videoram_w )
READ8_HANDLER( wardner_sprite_r )
{
int shift = (offset & 1) * 8;
- return space->machine->generic.spriteram.u16[offset/2] >> shift;
+ return space->machine().generic.spriteram.u16[offset/2] >> shift;
}
WRITE8_HANDLER( wardner_sprite_w )
{
- UINT16 *spriteram16 = space->machine->generic.spriteram.u16;
+ UINT16 *spriteram16 = space->machine().generic.spriteram.u16;
if (offset & 1)
spriteram16[offset/2] = (spriteram16[offset/2] & 0x00ff) | (data << 8);
else
@@ -383,12 +383,12 @@ WRITE8_HANDLER( wardner_sprite_w )
Ugly sprite hack for Wardner when hero is in shop
***************************************************************************/
-static void wardner_sprite_priority_hack(running_machine *machine)
+static void wardner_sprite_priority_hack(running_machine &machine)
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
if (state->fgscrollx != state->bgscrollx) {
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
if ((state->fgscrollx==0x1c9) || (state->flip_screen && (state->fgscrollx==0x17a))) { /* in the shop ? */
int wardner_hack = buffered_spriteram16[0x0b04/2];
/* sprite position 0x6300 to 0x8700 -- hero on shop keeper (normal) */
@@ -413,10 +413,10 @@ static void wardner_sprite_priority_hack(running_machine *machine)
-static void twincobr_log_vram(running_machine *machine)
+static void twincobr_log_vram(running_machine &machine)
{
#ifdef MAME_DEBUG
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
if ( input_code_pressed(machine, KEYCODE_M) )
{
@@ -458,15 +458,15 @@ static void twincobr_log_vram(running_machine *machine)
Sprite Handlers
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- twincobr_state *state = machine->driver_data<twincobr_state>();
+ twincobr_state *state = machine.driver_data<twincobr_state>();
int offs;
if (state->display_on)
{
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
- for (offs = 0;offs < machine->generic.spriteram_size/2;offs += 4)
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
+ for (offs = 0;offs < machine.generic.spriteram_size/2;offs += 4)
{
int attribute,sx,sy,flipx,flipy;
int sprite, color;
@@ -481,7 +481,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipx = attribute & 0x100;
if (flipx) sx -= 14; /* should really be 15 */
flipy = attribute & 0x200;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
sprite,
color,
flipx,flipy,
@@ -499,26 +499,26 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( toaplan0 )
{
- twincobr_state *state = screen->machine->driver_data<twincobr_state>();
- twincobr_log_vram(screen->machine);
+ twincobr_state *state = screen->machine().driver_data<twincobr_state>();
+ twincobr_log_vram(screen->machine());
- if (state->wardner_sprite_hack) wardner_sprite_priority_hack(screen->machine);
+ if (state->wardner_sprite_hack) wardner_sprite_priority_hack(screen->machine());
bitmap_fill(bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect,0x0400);
+ draw_sprites(screen->machine(), bitmap,cliprect,0x0400);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0x0800);
+ draw_sprites(screen->machine(), bitmap,cliprect,0x0800);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect,0x0c00);
+ draw_sprites(screen->machine(), bitmap,cliprect,0x0c00);
return 0;
}
SCREEN_EOF( toaplan0 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Spriteram is always 1 frame ahead, suggesting spriteram buffering.
There are no CPU output registers that control this so we
diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c
index 6cc0a1cae34..bd05b72f627 100644
--- a/src/mame/video/tx1.c
+++ b/src/mame/video/tx1.c
@@ -33,9 +33,9 @@
*/
static TIMER_CALLBACK( interrupt_callback )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
cputag_set_input_line_and_vector(machine, "main_cpu", 0, HOLD_LINE, 0xff);
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
@@ -145,7 +145,7 @@ PALETTE_INIT( tx1 )
WRITE16_HANDLER( tx1_bankcs_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
vregs_t &tx1_vregs = state->vregs;
// AAB2 = /BASET0
@@ -199,7 +199,7 @@ WRITE16_HANDLER( tx1_bankcs_w )
WRITE16_HANDLER( tx1_slincs_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
if (offset == 1)
state->vregs.slin_inc = data;
else
@@ -208,19 +208,19 @@ WRITE16_HANDLER( tx1_slincs_w )
WRITE16_HANDLER( tx1_slock_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
state->vregs.slock = data & 1;
}
WRITE16_HANDLER( tx1_scolst_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
state->vregs.scol = data & 0x0707;
}
WRITE16_HANDLER( tx1_flgcs_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
state->vregs.flags = data & 0xff;
}
@@ -231,16 +231,16 @@ WRITE16_HANDLER( tx1_flgcs_w )
*
*************************************/
-static void tx1_draw_char(running_machine *machine, UINT8 *bitmap)
+static void tx1_draw_char(running_machine &machine, UINT8 *bitmap)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *tx1_vram = state->vram;
INT32 x, y;
UINT32 scroll_x;
UINT8 *chars, *gfx2;
/* 2bpp characters */
- chars = machine->region("char_tiles")->base();
+ chars = machine.region("char_tiles")->base();
gfx2 = chars + 0x4000;
/* X scroll value is the last word in char RAM */
@@ -319,12 +319,12 @@ static void tx1_draw_char(running_machine *machine, UINT8 *bitmap)
pix[NUM][3][0] = prom_a[0]; pix[NUM][3][1] = prom_b[0]; pix[NUM][3][2] = prom_c[0]; \
}
-INLINE void tx1_draw_road_pixel(running_machine *machine, int screen, UINT8 *bmpaddr,
+INLINE void tx1_draw_road_pixel(running_machine &machine, int screen, UINT8 *bmpaddr,
UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb,
UINT8 stl, UINT8 sld, UINT8 selb,
UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
vregs_t &tx1_vregs = state->vregs;
UINT8 a0 = BIT(apix[0], pixnuma);
UINT8 a1 = BIT(apix[1], pixnuma);
@@ -399,9 +399,9 @@ INLINE void tx1_draw_road_pixel(running_machine *machine, int screen, UINT8 *bmp
}
/* This could do with a tidy up and more comments... */
-static void tx1_draw_road(running_machine *machine, UINT8 *bitmap)
+static void tx1_draw_road(running_machine &machine, UINT8 *bitmap)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *tx1_rcram = state->rcram;
vregs_t &tx1_vregs = state->vregs;
INT32 y;
@@ -420,13 +420,13 @@ static void tx1_draw_road(running_machine *machine, UINT8 *bitmap)
UINT8 pix[2][4][3];
/* Road slice map ROMs */
- const UINT8 *const gfx3 = machine->region("gfx3")->base();
+ const UINT8 *const gfx3 = machine.region("gfx3")->base();
const UINT8 *const rom_a = gfx3;
const UINT8 *const rom_b = gfx3 + 0x2000;
const UINT8 *const rom_c = gfx3 + 0x4000;
/* Pixel data */
- const UINT8 *const proms = machine->region("proms")->base();
+ const UINT8 *const proms = machine.region("proms")->base();
const UINT8 *const prom_a = proms + 0x1100;
const UINT8 *const prom_b = proms + 0x1300;
const UINT8 *const prom_c = proms + 0x1500;
@@ -854,27 +854,27 @@ static void tx1_draw_road(running_machine *machine, UINT8 *bitmap)
*
*************************************/
-static void tx1_draw_objects(running_machine *machine, UINT8 *bitmap)
+static void tx1_draw_objects(running_machine &machine, UINT8 *bitmap)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *tx1_objram = state->objram;
#define FRAC 16
UINT32 offs;
/* The many lookup table ROMs */
- const UINT8 *const ic48 = machine->region("user3")->base();
+ const UINT8 *const ic48 = machine.region("user3")->base();
const UINT8 *const ic281 = ic48 + 0x2000;
- const UINT8 *const proms = machine->region("proms")->base();
+ const UINT8 *const proms = machine.region("proms")->base();
const UINT8 *const ic190 = proms + 0xc00;
const UINT8 *const ic162 = proms + 0xe00;
const UINT8 *const ic25 = proms + 0x1000;
- const UINT8 *const ic106 = machine->region("obj_map")->base();
+ const UINT8 *const ic106 = machine.region("obj_map")->base();
const UINT8 *const ic73 = ic106 + 0x4000;
- const UINT8 *const pixdata_rgn = machine->region("obj_tiles")->base();
+ const UINT8 *const pixdata_rgn = machine.region("obj_tiles")->base();
for (offs = 0x0; offs <= 0x300; offs += 8)
{
@@ -1108,7 +1108,7 @@ static void tx1_draw_objects(running_machine *machine, UINT8 *bitmap)
VIDEO_START( tx1 )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate a large bitmap that covers the three screens */
state->bitmap = auto_bitmap_alloc(machine, 768, 256, BITMAP_FORMAT_INDEXED16);
@@ -1118,24 +1118,24 @@ VIDEO_START( tx1 )
state->rod_bmp = auto_alloc_array(machine, UINT8, 256 * 3 * 240);
/* Set a timer to run the interrupts */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
SCREEN_EOF( tx1 )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
/* /VSYNC: Update TZ113 */
state->vregs.slin_val += state->vregs.slin_inc;
}
-static void tx1_combine_layers(running_machine *machine, bitmap_t *bitmap, int screen)
+static void tx1_combine_layers(running_machine &machine, bitmap_t *bitmap, int screen)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
int x, y;
- UINT8 *chr_pal = machine->region("proms")->base() + 0x900;
+ UINT8 *chr_pal = machine.region("proms")->base() + 0x900;
int x_offset = screen * 256;
@@ -1184,28 +1184,28 @@ static void tx1_combine_layers(running_machine *machine, bitmap_t *bitmap, int s
SCREEN_UPDATE( tx1 )
{
- tx1_state *state = screen->machine->driver_data<tx1_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *centre_screen = screen->machine->device("cscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ tx1_state *state = screen->machine().driver_data<tx1_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *centre_screen = screen->machine().device("cscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
if (screen == left_screen)
{
memset(state->obj_bmp, 0, 768*240);
- tx1_draw_char(screen->machine, state->chr_bmp);
- tx1_draw_road(screen->machine, state->rod_bmp);
- tx1_draw_objects(screen->machine, state->obj_bmp);
+ tx1_draw_char(screen->machine(), state->chr_bmp);
+ tx1_draw_road(screen->machine(), state->rod_bmp);
+ tx1_draw_objects(screen->machine(), state->obj_bmp);
- tx1_combine_layers(screen->machine, bitmap, 0);
+ tx1_combine_layers(screen->machine(), bitmap, 0);
}
else if (screen == centre_screen)
{
- tx1_combine_layers(screen->machine, bitmap, 1);
+ tx1_combine_layers(screen->machine(), bitmap, 1);
}
else if (screen == right_screen)
{
- tx1_combine_layers(screen->machine, bitmap, 2);
+ tx1_combine_layers(screen->machine(), bitmap, 2);
}
return 0;
@@ -1290,9 +1290,9 @@ PALETTE_INIT( buggyboy )
*
*************************************/
-static void buggyboy_draw_char(running_machine *machine, UINT8 *bitmap, int wide)
+static void buggyboy_draw_char(running_machine &machine, UINT8 *bitmap, int wide)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *buggyboy_vram = state->vram;
INT32 x, y;
UINT32 scroll_x, scroll_y;
@@ -1301,8 +1301,8 @@ static void buggyboy_draw_char(running_machine *machine, UINT8 *bitmap, int wide
UINT32 x_mask;
/* 2bpp characters */
- chars = machine->region("char_tiles")->base();
- gfx2 = machine->region("char_tiles")->base() + 0x4000;
+ chars = machine.region("char_tiles")->base();
+ gfx2 = machine.region("char_tiles")->base() + 0x4000;
/* X/Y scroll values are the last word in char RAM */
if (wide)
@@ -1517,9 +1517,9 @@ static void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld,
hp##NUM = hp##NUM + 1; \
} \
-static void buggyboy_draw_road(running_machine *machine, UINT8 *bitmap)
+static void buggyboy_draw_road(running_machine &machine, UINT8 *bitmap)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *buggyboy_rcram = state->rcram;
vregs_t &vregs = state->vregs;
INT32 x;
@@ -1536,8 +1536,8 @@ static void buggyboy_draw_road(running_machine *machine, UINT8 *bitmap)
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine->region("proms")->base() + 0x1500);
- const UINT8 *rom = machine->region("road")->base();
+ const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
+ const UINT8 *rom = machine.region("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
const UINT8 *prom2 = rom + 0x4400;
@@ -2149,9 +2149,9 @@ static void buggyboy_draw_road(running_machine *machine, UINT8 *bitmap)
}
}
-static void buggybjr_draw_road(running_machine *machine, UINT8 *bitmap, int wide)
+static void buggybjr_draw_road(running_machine &machine, UINT8 *bitmap, int wide)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *buggyboy_rcram = state->rcram;
vregs_t &vregs = state->vregs;
INT32 x;
@@ -2168,8 +2168,8 @@ static void buggybjr_draw_road(running_machine *machine, UINT8 *bitmap, int wide
UINT32 rva20_6;
/* ROM/PROM lookup tables */
- const UINT8 *rcols = (UINT8*)(machine->region("proms")->base() + 0x1500);
- const UINT8 *rom = machine->region("road")->base();
+ const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
+ const UINT8 *rom = machine.region("road")->base();
const UINT8 *prom0 = rom + 0x4000;
const UINT8 *prom1 = rom + 0x4200;
const UINT8 *prom2 = rom + 0x4400;
@@ -2569,9 +2569,9 @@ static void buggybjr_draw_road(running_machine *machine, UINT8 *bitmap, int wide
**************************************************************************/
-static void buggyboy_draw_objs(running_machine *machine, UINT8 *bitmap, int wide)
+static void buggyboy_draw_objs(running_machine &machine, UINT8 *bitmap, int wide)
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
UINT16 *buggyboy_objram = state->objram;
#define FRAC 16
@@ -2581,17 +2581,17 @@ static void buggyboy_draw_objs(running_machine *machine, UINT8 *bitmap, int wide
UINT32 x_stride;
/* The many lookup table ROMs */
- const UINT8 *const bug13 = (UINT8*)machine->region("obj_luts")->base();
+ const UINT8 *const bug13 = (UINT8*)machine.region("obj_luts")->base();
const UINT8 *const bug18s = bug13 + 0x2000;
- const UINT8 *const bb8 = (UINT8*)machine->region("proms")->base() + 0x1600;
+ const UINT8 *const bb8 = (UINT8*)machine.region("proms")->base() + 0x1600;
- const UINT8 *const bug16s = (UINT8*)machine->region("obj_map")->base();
+ const UINT8 *const bug16s = (UINT8*)machine.region("obj_map")->base();
const UINT8 *const bug17s = bug16s + 0x8000;
- const UINT8 *const bb9o = (UINT8*)machine->region("proms")->base() + 0x500;
+ const UINT8 *const bb9o = (UINT8*)machine.region("proms")->base() + 0x500;
const UINT8 *const bb9e = bb9o + 0x800;
- const UINT8 *const pixdata_rgn = (UINT8*)machine->region("obj_tiles")->base();
+ const UINT8 *const pixdata_rgn = (UINT8*)machine.region("obj_tiles")->base();
if (wide)
{
@@ -2841,7 +2841,7 @@ static void buggyboy_draw_objs(running_machine *machine, UINT8 *bitmap, int wide
*/
WRITE16_HANDLER( buggyboy_gas_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
vregs_t &vregs = state->vregs;
offset <<= 1;
@@ -2903,7 +2903,7 @@ WRITE16_HANDLER( buggyboy_gas_w )
}
case 0xe0:
{
- cputag_set_input_line(space->machine, "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
vregs.flags = data;
break;
}
@@ -2916,7 +2916,7 @@ WRITE16_HANDLER( buggyboy_gas_w )
WRITE16_HANDLER( buggyboy_sky_w )
{
- tx1_state *state = space->machine->driver_data<tx1_state>();
+ tx1_state *state = space->machine().driver_data<tx1_state>();
state->vregs.sky = data;
}
@@ -2927,10 +2927,10 @@ WRITE16_HANDLER( buggyboy_sky_w )
*
*************************************/
-static void bb_combine_layers(running_machine *machine, bitmap_t *bitmap, int screen)
+static void bb_combine_layers(running_machine &machine, bitmap_t *bitmap, int screen)
{
- tx1_state *state = machine->driver_data<tx1_state>();
- UINT8 *chr_pal = machine->region("proms")->base() + 0x400;
+ tx1_state *state = machine.driver_data<tx1_state>();
+ UINT8 *chr_pal = machine.region("proms")->base() + 0x400;
UINT32 bmp_stride;
UINT32 x_offset;
UINT32 y;
@@ -2997,37 +2997,37 @@ static void bb_combine_layers(running_machine *machine, bitmap_t *bitmap, int sc
VIDEO_START( buggyboy )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate some bitmaps */
state->chr_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
state->obj_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
state->rod_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240);
/* Set a timer to run the interrupts */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
VIDEO_START( buggybjr )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
/* Allocate some bitmaps */
state->chr_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
state->obj_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
state->rod_bmp = auto_alloc_array(machine, UINT8, 256 * 240);
/* Set a timer to run the interrupts */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
/* /CUDISP CRTC interrupt */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
}
SCREEN_EOF( buggyboy )
{
- tx1_state *state = machine->driver_data<tx1_state>();
+ tx1_state *state = machine.driver_data<tx1_state>();
/* /VSYNC: Update TZ113 @ 219 */
state->vregs.slin_val += state->vregs.slin_inc;
@@ -3039,29 +3039,29 @@ SCREEN_EOF( buggyboy )
SCREEN_UPDATE( buggyboy )
{
- tx1_state *state = screen->machine->driver_data<tx1_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *center_screen = screen->machine->device("cscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ tx1_state *state = screen->machine().driver_data<tx1_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *center_screen = screen->machine().device("cscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
if (screen == left_screen)
{
memset(state->obj_bmp, 0, 768*240);
memset(state->rod_bmp, 0, 768*240);
- buggyboy_draw_char(screen->machine, state->chr_bmp, 1);
- buggyboy_draw_road(screen->machine, state->rod_bmp);
- buggyboy_draw_objs(screen->machine, state->obj_bmp, 1);
+ buggyboy_draw_char(screen->machine(), state->chr_bmp, 1);
+ buggyboy_draw_road(screen->machine(), state->rod_bmp);
+ buggyboy_draw_objs(screen->machine(), state->obj_bmp, 1);
- bb_combine_layers(screen->machine, bitmap, 0);
+ bb_combine_layers(screen->machine(), bitmap, 0);
}
else if (screen == center_screen)
{
- bb_combine_layers(screen->machine, bitmap, 1);
+ bb_combine_layers(screen->machine(), bitmap, 1);
}
else if (screen == right_screen)
{
- bb_combine_layers(screen->machine, bitmap, 2);
+ bb_combine_layers(screen->machine(), bitmap, 2);
}
return 0;
@@ -3070,13 +3070,13 @@ SCREEN_UPDATE( buggyboy )
SCREEN_UPDATE( buggybjr )
{
- tx1_state *state = screen->machine->driver_data<tx1_state>();
+ tx1_state *state = screen->machine().driver_data<tx1_state>();
memset(state->obj_bmp, 0, 256*240);
- buggyboy_draw_char(screen->machine, state->chr_bmp, 0);
- buggybjr_draw_road(screen->machine, state->rod_bmp, 0);
- buggyboy_draw_objs(screen->machine, state->obj_bmp, 0);
+ buggyboy_draw_char(screen->machine(), state->chr_bmp, 0);
+ buggybjr_draw_road(screen->machine(), state->rod_bmp, 0);
+ buggyboy_draw_objs(screen->machine(), state->obj_bmp, 0);
- bb_combine_layers(screen->machine, bitmap, -1);
+ bb_combine_layers(screen->machine(), bitmap, -1);
return 0;
}
diff --git a/src/mame/video/ultraman.c b/src/mame/video/ultraman.c
index 05524758512..15424fa72e9 100644
--- a/src/mame/video/ultraman.c
+++ b/src/mame/video/ultraman.c
@@ -8,9 +8,9 @@
***************************************************************************/
-void ultraman_sprite_callback( running_machine *machine, int *code, int *color, int *priority, int *shadow )
+void ultraman_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
*priority = (*color & 0x80) >> 7;
*color = state->sprite_colorbase + ((*color & 0x7e) >> 1);
@@ -24,23 +24,23 @@ void ultraman_sprite_callback( running_machine *machine, int *code, int *color,
***************************************************************************/
-void ultraman_zoom_callback_0(running_machine *machine, int *code, int *color, int *flags )
+void ultraman_zoom_callback_0(running_machine &machine, int *code, int *color, int *flags )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
*code |= ((*color & 0x07) << 8) | (state->bank0 << 11);
*color = state->zoom_colorbase[0] + ((*color & 0xf8) >> 3);
}
-void ultraman_zoom_callback_1(running_machine *machine, int *code, int *color, int *flags )
+void ultraman_zoom_callback_1(running_machine &machine, int *code, int *color, int *flags )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
*code |= ((*color & 0x07) << 8) | (state->bank1 << 11);
*color = state->zoom_colorbase[1] + ((*color & 0xf8) >> 3);
}
-void ultraman_zoom_callback_2(running_machine *machine, int *code, int *color, int *flags )
+void ultraman_zoom_callback_2(running_machine &machine, int *code, int *color, int *flags )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
*code |= ((*color & 0x07) << 8) | (state->bank2 << 11);
*color = state->zoom_colorbase[2] + ((*color & 0xf8) >> 3);
}
@@ -55,7 +55,7 @@ void ultraman_zoom_callback_2(running_machine *machine, int *code, int *color, i
VIDEO_START( ultraman )
{
- ultraman_state *state = machine->driver_data<ultraman_state>();
+ ultraman_state *state = machine.driver_data<ultraman_state>();
state->sprite_colorbase = 192;
state->zoom_colorbase[0] = 0;
state->zoom_colorbase[1] = 64;
@@ -72,7 +72,7 @@ VIDEO_START( ultraman )
WRITE16_HANDLER( ultraman_gfxctrl_w )
{
- ultraman_state *state = space->machine->driver_data<ultraman_state>();
+ ultraman_state *state = space->machine().driver_data<ultraman_state>();
if (ACCESSING_BITS_0_7)
{
@@ -90,7 +90,7 @@ WRITE16_HANDLER( ultraman_gfxctrl_w )
if (state->bank0 != ((data & 0x02) >> 1))
{
state->bank0 = (data & 0x02) >> 1;
- tilemap_mark_all_tiles_dirty_all(space->machine); /* should mark only zoom0 */
+ tilemap_mark_all_tiles_dirty_all(space->machine()); /* should mark only zoom0 */
}
k051316_wraparound_enable(state->k051316_2, data & 0x04);
@@ -98,7 +98,7 @@ WRITE16_HANDLER( ultraman_gfxctrl_w )
if (state->bank1 != ((data & 0x08) >> 3))
{
state->bank1 = (data & 0x08) >> 3;
- tilemap_mark_all_tiles_dirty_all(space->machine); /* should mark only zoom1 */
+ tilemap_mark_all_tiles_dirty_all(space->machine()); /* should mark only zoom1 */
}
k051316_wraparound_enable(state->k051316_3, data & 0x10);
@@ -106,11 +106,11 @@ WRITE16_HANDLER( ultraman_gfxctrl_w )
if (state->bank2 != ((data & 0x20) >> 5))
{
state->bank2 = (data & 0x20) >> 5;
- tilemap_mark_all_tiles_dirty_all(space->machine); /* should mark only zoom2 */
+ tilemap_mark_all_tiles_dirty_all(space->machine()); /* should mark only zoom2 */
}
- coin_counter_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
}
@@ -124,7 +124,7 @@ WRITE16_HANDLER( ultraman_gfxctrl_w )
SCREEN_UPDATE( ultraman )
{
- ultraman_state *state = screen->machine->driver_data<ultraman_state>();
+ ultraman_state *state = screen->machine().driver_data<ultraman_state>();
k051316_zoom_draw(state->k051316_3, bitmap, cliprect, 0, 0);
k051316_zoom_draw(state->k051316_2, bitmap, cliprect, 0, 0);
diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c
index e117acb3d39..20d74d74217 100644
--- a/src/mame/video/ultratnk.c
+++ b/src/mame/video/ultratnk.c
@@ -12,30 +12,30 @@ Atari Ultra Tank video emulation
PALETTE_INIT( ultratnk )
{
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 4);
-
- colortable_palette_set_color(machine->colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine->colortable, 1, MAKE_RGB(0xa4, 0xa4, 0xa4));
- colortable_palette_set_color(machine->colortable, 2, MAKE_RGB(0x5b, 0x5b, 0x5b));
- colortable_palette_set_color(machine->colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
-
- colortable_entry_set_value(machine->colortable, 0, color_prom[0x00] & 3);
- colortable_entry_set_value(machine->colortable, 2, color_prom[0x00] & 3);
- colortable_entry_set_value(machine->colortable, 4, color_prom[0x00] & 3);
- colortable_entry_set_value(machine->colortable, 6, color_prom[0x00] & 3);
- colortable_entry_set_value(machine->colortable, 8, color_prom[0x00] & 3);
-
- colortable_entry_set_value(machine->colortable, 1, color_prom[0x01] & 3);
- colortable_entry_set_value(machine->colortable, 3, color_prom[0x02] & 3);
- colortable_entry_set_value(machine->colortable, 5, color_prom[0x04] & 3);
- colortable_entry_set_value(machine->colortable, 7, color_prom[0x08] & 3);
- colortable_entry_set_value(machine->colortable, 9, color_prom[0x10] & 3);
+ machine.colortable = colortable_alloc(machine, 4);
+
+ colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xa4, 0xa4, 0xa4));
+ colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0x5b, 0x5b, 0x5b));
+ colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0xff, 0xff, 0xff));
+
+ colortable_entry_set_value(machine.colortable, 0, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine.colortable, 2, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine.colortable, 4, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine.colortable, 6, color_prom[0x00] & 3);
+ colortable_entry_set_value(machine.colortable, 8, color_prom[0x00] & 3);
+
+ colortable_entry_set_value(machine.colortable, 1, color_prom[0x01] & 3);
+ colortable_entry_set_value(machine.colortable, 3, color_prom[0x02] & 3);
+ colortable_entry_set_value(machine.colortable, 5, color_prom[0x04] & 3);
+ colortable_entry_set_value(machine.colortable, 7, color_prom[0x08] & 3);
+ colortable_entry_set_value(machine.colortable, 9, color_prom[0x10] & 3);
}
static TILE_GET_INFO( ultratnk_tile_info )
{
- ultratnk_state *state = machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = machine.driver_data<ultratnk_state>();
UINT8 *videoram = state->videoram;
UINT8 code = videoram[tile_index];
@@ -48,8 +48,8 @@ static TILE_GET_INFO( ultratnk_tile_info )
VIDEO_START( ultratnk )
{
- ultratnk_state *state = machine->driver_data<ultratnk_state>();
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ ultratnk_state *state = machine.driver_data<ultratnk_state>();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
state->playfield = tilemap_create(machine, ultratnk_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
@@ -57,7 +57,7 @@ VIDEO_START( ultratnk )
SCREEN_UPDATE( ultratnk )
{
- ultratnk_state *state = screen->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = screen->machine().driver_data<ultratnk_state>();
UINT8 *videoram = state->videoram;
int i;
@@ -77,7 +77,7 @@ SCREEN_UPDATE( ultratnk )
if (!(attr & 0x80))
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
(code >> 3) | bank,
i,
0, 0,
@@ -92,10 +92,10 @@ SCREEN_UPDATE( ultratnk )
SCREEN_EOF( ultratnk )
{
- ultratnk_state *state = machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = machine.driver_data<ultratnk_state>();
int i;
- UINT16 BG = colortable_entry_get_value(machine->colortable, 0);
- device_t *discrete = machine->device("discrete");
+ UINT16 BG = colortable_entry_get_value(machine.colortable, 0);
+ device_t *discrete = machine.device("discrete");
UINT8 *videoram = state->videoram;
/* check for sprite-playfield collisions */
@@ -115,17 +115,17 @@ SCREEN_EOF( ultratnk )
rect.min_x = horz - 15;
rect.min_y = vert - 15;
- rect.max_x = horz - 15 + machine->gfx[1]->width - 1;
- rect.max_y = vert - 15 + machine->gfx[1]->height - 1;
+ rect.max_x = horz - 15 + machine.gfx[1]->width - 1;
+ rect.max_y = vert - 15 + machine.gfx[1]->height - 1;
- sect_rect(&rect, &machine->primary_screen->visible_area());
+ sect_rect(&rect, &machine.primary_screen->visible_area());
tilemap_draw(state->helper, &rect, state->playfield, 0, 0);
if (code & 4)
bank = 32;
- drawgfx_transpen(state->helper, &rect, machine->gfx[1],
+ drawgfx_transpen(state->helper, &rect, machine.gfx[1],
(code >> 3) | bank,
4,
0, 0,
@@ -134,7 +134,7 @@ SCREEN_EOF( ultratnk )
for (y = rect.min_y; y <= rect.max_y; y++)
for (x = rect.min_x; x <= rect.max_x; x++)
- if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(state->helper, y, x)) != BG)
+ if (colortable_entry_get_value(machine.colortable, *BITMAP_ADDR16(state->helper, y, x)) != BG)
state->collision[i] = 1;
}
@@ -147,7 +147,7 @@ SCREEN_EOF( ultratnk )
WRITE8_HANDLER( ultratnk_video_ram_w )
{
- ultratnk_state *state = space->machine->driver_data<ultratnk_state>();
+ ultratnk_state *state = space->machine().driver_data<ultratnk_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->playfield, offset);
diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c
index 0c0766c4176..8ca31deceb7 100644
--- a/src/mame/video/undrfire.c
+++ b/src/mame/video/undrfire.c
@@ -8,7 +8,7 @@
VIDEO_START( undrfire )
{
- undrfire_state *state = machine->driver_data<undrfire_state>();
+ undrfire_state *state = machine.driver_data<undrfire_state>();
int i;
state->spritelist = auto_alloc_array(machine, struct tempsprite, 0x4000);
@@ -64,11 +64,11 @@ Heavy use is made of sprite zooming.
***************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
{
- undrfire_state *state = machine->driver_data<undrfire_state>();
+ undrfire_state *state = machine.driver_data<undrfire_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -178,7 +178,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -197,23 +197,23 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
-static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
+static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
{
- undrfire_state *state = machine->driver_data<undrfire_state>();
+ undrfire_state *state = machine.driver_data<undrfire_state>();
UINT32 *spriteram32 = state->spriteram;
- UINT16 *spritemap = (UINT16 *)machine->region("user1")->base();
- UINT8 *spritemapHibit = (UINT8 *)machine->region("user2")->base();
+ UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
+ UINT8 *spritemapHibit = (UINT8 *)machine.region("user2")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
@@ -317,7 +317,7 @@ static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,con
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -332,13 +332,13 @@ static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,con
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine->gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine->priority_bitmap,sprite_ptr->primask,0);
+ machine.priority_bitmap,sprite_ptr->primask,0);
}
}
@@ -349,44 +349,44 @@ static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( undrfire )
{
- device_t *tc0100scn = screen->machine->device("tc0100scn");
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ device_t *tc0100scn = screen->machine().device("tc0100scn");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT8 pivlayer[3];
UINT16 priority;
#ifdef MAME_DEBUG
- undrfire_state *state = screen->machine->driver_data<undrfire_state>();
- if (input_code_pressed_once (screen->machine, KEYCODE_X))
+ undrfire_state *state = screen->machine().driver_data<undrfire_state>();
+ if (input_code_pressed_once (screen->machine(), KEYCODE_X))
{
state->dislayer[5] ^= 1;
popmessage("piv text: %01x",state->dislayer[5]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_C))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_C))
{
state->dislayer[0] ^= 1;
popmessage("bg0: %01x",state->dislayer[0]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_V))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_V))
{
state->dislayer[1] ^= 1;
popmessage("bg1: %01x",state->dislayer[1]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_B))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_B))
{
state->dislayer[2] ^= 1;
popmessage("bg2: %01x",state->dislayer[2]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_N))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_N))
{
state->dislayer[3] ^= 1;
popmessage("bg3: %01x",state->dislayer[3]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_M))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_M))
{
state->dislayer[4] ^= 1;
popmessage("sprites: %01x",state->dislayer[4]);
@@ -408,7 +408,7 @@ SCREEN_UPDATE( undrfire )
pivlayer[1] = pivlayer[0] ^ 1;
pivlayer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
@@ -449,12 +449,12 @@ SCREEN_UPDATE( undrfire )
if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3) /* on road levels kludge sprites up 1 priority */
{
static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 44, -574);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 44, -574);
}
else
{
static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
- draw_sprites(screen->machine, bitmap, cliprect, primasks, 44, -574);
+ draw_sprites(screen->machine(), bitmap, cliprect, primasks, 44, -574);
}
}
@@ -468,7 +468,7 @@ SCREEN_UPDATE( undrfire )
/* See if we should draw artificial gun targets */
/* (not yet implemented...) */
- if (input_port_read(screen->machine, "FAKE") & 0x1) /* Fake DSW */
+ if (input_port_read(screen->machine(), "FAKE") & 0x1) /* Fake DSW */
{
popmessage("Gunsights on");
}
@@ -492,44 +492,44 @@ SCREEN_UPDATE( undrfire )
SCREEN_UPDATE( cbombers )
{
- device_t *tc0100scn = screen->machine->device("tc0100scn");
- device_t *tc0480scp = screen->machine->device("tc0480scp");
+ device_t *tc0100scn = screen->machine().device("tc0100scn");
+ device_t *tc0480scp = screen->machine().device("tc0480scp");
UINT8 layer[5];
UINT8 pivlayer[3];
UINT16 priority;
#ifdef MAME_DEBUG
- undrfire_state *state = screen->machine->driver_data<undrfire_state>();
- if (input_code_pressed_once (screen->machine, KEYCODE_X))
+ undrfire_state *state = screen->machine().driver_data<undrfire_state>();
+ if (input_code_pressed_once (screen->machine(), KEYCODE_X))
{
state->dislayer[5] ^= 1;
popmessage("piv text: %01x",state->dislayer[5]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_C))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_C))
{
state->dislayer[0] ^= 1;
popmessage("bg0: %01x",state->dislayer[0]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_V))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_V))
{
state->dislayer[1] ^= 1;
popmessage("bg1: %01x",state->dislayer[1]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_B))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_B))
{
state->dislayer[2] ^= 1;
popmessage("bg2: %01x",state->dislayer[2]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_N))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_N))
{
state->dislayer[3] ^= 1;
popmessage("bg3: %01x",state->dislayer[3]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_M))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_M))
{
state->dislayer[4] ^= 1;
popmessage("sprites: %01x",state->dislayer[4]);
@@ -551,7 +551,7 @@ SCREEN_UPDATE( cbombers )
pivlayer[1] = pivlayer[0] ^ 1;
pivlayer[2] = 2;
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
bitmap_fill(bitmap, cliprect, 0); /* wrong color? */
@@ -592,12 +592,12 @@ SCREEN_UPDATE( cbombers )
if ((tc0480scp_pri_reg_r(tc0480scp, 0) & 0x3) == 3) /* on road levels kludge sprites up 1 priority */
{
static const int primasks[4] = {0xfff0, 0xff00, 0x0, 0x0};
- draw_sprites_cbombers(screen->machine, bitmap, cliprect, primasks, 80, -208);
+ draw_sprites_cbombers(screen->machine(), bitmap, cliprect, primasks, 80, -208);
}
else
{
static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0};
- draw_sprites_cbombers(screen->machine, bitmap, cliprect, primasks, 80, -208);
+ draw_sprites_cbombers(screen->machine(), bitmap, cliprect, primasks, 80, -208);
}
}
diff --git a/src/mame/video/unico.c b/src/mame/video/unico.c
index 449362fc3e9..a5affd8f43d 100644
--- a/src/mame/video/unico.c
+++ b/src/mame/video/unico.c
@@ -54,10 +54,10 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE16_HANDLER( unico_palette_w )
{
UINT16 data1, data2;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- data1 = space->machine->generic.paletteram.u16[offset & ~1];
- data2 = space->machine->generic.paletteram.u16[offset | 1];
- palette_set_color_rgb( space->machine,offset/2,
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ data1 = space->machine().generic.paletteram.u16[offset & ~1];
+ data2 = space->machine().generic.paletteram.u16[offset | 1];
+ palette_set_color_rgb( space->machine(),offset/2,
(data1 >> 8) & 0xFC,
(data1 >> 0) & 0xFC,
(data2 >> 8) & 0xFC );
@@ -65,8 +65,8 @@ WRITE16_HANDLER( unico_palette_w )
WRITE32_HANDLER( unico_palette32_w )
{
- UINT32 rgb0 = COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb( space->machine,offset,
+ UINT32 rgb0 = COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb( space->machine(),offset,
(rgb0 >> 24) & 0xFC,
(rgb0 >> 16) & 0xFC,
(rgb0 >> 8) & 0xFC );
@@ -106,7 +106,7 @@ static TILE_GET_INFO( get_tile_info32 )
WRITE16_HANDLER( unico_vram_w )
{
- unico_state *state = space->machine->driver_data<unico_state>();
+ unico_state *state = space->machine().driver_data<unico_state>();
UINT16 *vram = state->vram;
int tile = ((offset / 0x2000) + 1) % 3;
COMBINE_DATA(&vram[offset]);
@@ -115,7 +115,7 @@ WRITE16_HANDLER( unico_vram_w )
WRITE32_HANDLER( unico_vram32_w )
{
- unico_state *state = space->machine->driver_data<unico_state>();
+ unico_state *state = space->machine().driver_data<unico_state>();
UINT32 *vram = state->vram32;
int tile = ((offset / 0x1000) + 1) % 3;
COMBINE_DATA(&vram[offset]);
@@ -135,7 +135,7 @@ WRITE32_HANDLER( unico_vram32_w )
VIDEO_START( unico )
{
- unico_state *state = machine->driver_data<unico_state>();
+ unico_state *state = machine.driver_data<unico_state>();
state->tilemap[0] = tilemap_create( machine, get_tile_info,tilemap_scan_rows,
16,16, 0x40, 0x40);
@@ -167,7 +167,7 @@ VIDEO_START( unico )
VIDEO_START( zeropnt2 )
{
- unico_state *state = machine->driver_data<unico_state>();
+ unico_state *state = machine.driver_data<unico_state>();
state->tilemap[0] = tilemap_create( machine, get_tile_info32,tilemap_scan_rows,
16,16, 0x40, 0x40);
@@ -221,9 +221,9 @@ VIDEO_START( zeropnt2 )
***************************************************************************/
-static void unico_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void unico_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- unico_state *state = machine->driver_data<unico_state>();
+ unico_state *state = machine.driver_data<unico_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -265,20 +265,20 @@ static void unico_draw_sprites(running_machine *machine, bitmap_t *bitmap,const
for (x = startx ; x != endx ; x += incx)
{
- pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen( bitmap, cliprect, machine.gfx[0],
code++,
attr & 0x1f,
flipx, flipy,
x, sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,0x00 );
}
}
}
-static void zeropnt2_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- unico_state *state = machine->driver_data<unico_state>();
+ unico_state *state = machine.driver_data<unico_state>();
UINT32 *spriteram32 = (UINT32 *)state->spriteram;
int offs;
@@ -320,12 +320,12 @@ static void zeropnt2_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
for (x = startx ; x != endx ; x += incx)
{
- pdrawgfx_transpen( bitmap, cliprect, machine->gfx[0],
+ pdrawgfx_transpen( bitmap, cliprect, machine.gfx[0],
code++,
attr & 0x1f,
flipx, flipy,
x, sy,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,0x00 );
}
}
@@ -343,7 +343,7 @@ static void zeropnt2_draw_sprites(running_machine *machine, bitmap_t *bitmap,con
SCREEN_UPDATE( unico )
{
- unico_state *state = screen->machine->driver_data<unico_state>();
+ unico_state *state = screen->machine().driver_data<unico_state>();
int layers_ctrl = -1;
tilemap_set_scrollx(state->tilemap[0], 0, state->scroll[0x00]);
@@ -356,34 +356,34 @@ SCREEN_UPDATE( unico )
tilemap_set_scrolly(state->tilemap[2], 0, state->scroll[0x02]);
#ifdef MAME_DEBUG
-if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
/* The background color is the first of the last palette */
bitmap_fill(bitmap,cliprect,0x1f00);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->tilemap[0],0,1);
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->tilemap[1],0,2);
if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->tilemap[2],0,4);
/* Sprites are drawn last, using pdrawgfx */
- if (layers_ctrl & 8) unico_draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 8) unico_draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( zeropnt2 )
{
- unico_state *state = screen->machine->driver_data<unico_state>();
+ unico_state *state = screen->machine().driver_data<unico_state>();
int layers_ctrl = -1;
tilemap_set_scrollx(state->tilemap[0], 0, state->scroll32[0] >> 16);
@@ -396,27 +396,27 @@ SCREEN_UPDATE( zeropnt2 )
tilemap_set_scrolly(state->tilemap[2], 0, state->scroll32[1] >> 16);
#ifdef MAME_DEBUG
-if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) )
+if ( input_code_pressed(screen->machine(), KEYCODE_Z) || input_code_pressed(screen->machine(), KEYCODE_X) )
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
/* The background color is the first of the last palette */
bitmap_fill(bitmap,cliprect,0x1f00);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->tilemap[0],0,1);
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->tilemap[1],0,2);
if (layers_ctrl & 4) tilemap_draw(bitmap,cliprect,state->tilemap[2],0,4);
/* Sprites are drawn last, using pdrawgfx */
- if (layers_ctrl & 8) zeropnt2_draw_sprites(screen->machine, bitmap,cliprect);
+ if (layers_ctrl & 8) zeropnt2_draw_sprites(screen->machine(), bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/usgames.c b/src/mame/video/usgames.c
index d053611bcc9..6c7af969bfa 100644
--- a/src/mame/video/usgames.c
+++ b/src/mame/video/usgames.c
@@ -33,7 +33,7 @@ PALETTE_INIT(usgames)
static TILE_GET_INFO( get_usgames_tile_info )
{
- usgames_state *state = machine->driver_data<usgames_state>();
+ usgames_state *state = machine.driver_data<usgames_state>();
int tileno, colour;
tileno = state->videoram[tile_index*2];
@@ -44,30 +44,30 @@ static TILE_GET_INFO( get_usgames_tile_info )
VIDEO_START(usgames)
{
- usgames_state *state = machine->driver_data<usgames_state>();
+ usgames_state *state = machine.driver_data<usgames_state>();
state->tilemap = tilemap_create(machine, get_usgames_tile_info,tilemap_scan_rows, 8, 8,64,32);
- gfx_element_set_source(machine->gfx[0], state->charram);
+ gfx_element_set_source(machine.gfx[0], state->charram);
}
WRITE8_HANDLER( usgames_videoram_w )
{
- usgames_state *state = space->machine->driver_data<usgames_state>();
+ usgames_state *state = space->machine().driver_data<usgames_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset/2);
}
WRITE8_HANDLER( usgames_charram_w )
{
- usgames_state *state = space->machine->driver_data<usgames_state>();
+ usgames_state *state = space->machine().driver_data<usgames_state>();
state->charram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[0], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/8);
}
SCREEN_UPDATE(usgames)
{
- usgames_state *state = screen->machine->driver_data<usgames_state>();
+ usgames_state *state = screen->machine().driver_data<usgames_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/vaportra.c b/src/mame/video/vaportra.c
index 4f1bdcf682c..1159c36905c 100644
--- a/src/mame/video/vaportra.c
+++ b/src/mame/video/vaportra.c
@@ -18,33 +18,33 @@
WRITE16_HANDLER( vaportra_priority_w )
{
- vaportra_state *state = space->machine->driver_data<vaportra_state>();
+ vaportra_state *state = space->machine().driver_data<vaportra_state>();
COMBINE_DATA(&state->priority[offset]);
}
/******************************************************************************/
-static void update_24bitcol( running_machine *machine, int offset )
+static void update_24bitcol( running_machine &machine, int offset )
{
UINT8 r, g, b;
- r = (machine->generic.paletteram.u16[offset] >> 0) & 0xff;
- g = (machine->generic.paletteram.u16[offset] >> 8) & 0xff;
- b = (machine->generic.paletteram2.u16[offset] >> 0) & 0xff;
+ r = (machine.generic.paletteram.u16[offset] >> 0) & 0xff;
+ g = (machine.generic.paletteram.u16[offset] >> 8) & 0xff;
+ b = (machine.generic.paletteram2.u16[offset] >> 0) & 0xff;
palette_set_color(machine, offset, MAKE_RGB(r,g,b));
}
WRITE16_HANDLER( vaportra_palette_24bit_rg_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
WRITE16_HANDLER( vaportra_palette_24bit_b_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram2.u16[offset]);
- update_24bitcol(space->machine, offset);
+ COMBINE_DATA(&space->machine().generic.paletteram2.u16[offset]);
+ update_24bitcol(space->machine(), offset);
}
/******************************************************************************/
@@ -52,47 +52,47 @@ WRITE16_HANDLER( vaportra_palette_24bit_b_w )
SCREEN_UPDATE( vaportra )
{
- vaportra_state *state = screen->machine->driver_data<vaportra_state>();
+ vaportra_state *state = screen->machine().driver_data<vaportra_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
int pri = state->priority[0] & 0x03;
- flip_screen_set(screen->machine, !BIT(flip, 7));
+ flip_screen_set(screen->machine(), !BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, 0, 0);
deco16ic_pf_update(state->deco_tilegen2, 0, 0);
- screen->machine->device<deco_mxc06_device>("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now
+ screen->machine().device<deco_mxc06_device>("spritegen")->set_pri_type(1); // force priorities to be handled in a different way for this driver for now
/* Draw playfields */
if (pri == 0)
{
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
}
else if (pri == 1)
{
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
}
else if (pri == 2)
{
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
}
else
{
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 0, state->priority[1], 0x0f);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 0);
}
- screen->machine->device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, screen->machine->generic.buffered_spriteram.u16, 1, state->priority[1], 0x0f);
+ screen->machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, screen->machine().generic.buffered_spriteram.u16, 1, state->priority[1], 0x0f);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/vastar.c b/src/mame/video/vastar.c
index 4d32139b3bf..13c49456295 100644
--- a/src/mame/video/vastar.c
+++ b/src/mame/video/vastar.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_fg_tile_info )
{
- vastar_state *state = machine->driver_data<vastar_state>();
+ vastar_state *state = machine.driver_data<vastar_state>();
UINT8 *videoram = state->fgvideoram;
int code, color;
@@ -33,7 +33,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- vastar_state *state = machine->driver_data<vastar_state>();
+ vastar_state *state = machine.driver_data<vastar_state>();
UINT8 *videoram = state->bg1videoram;
int code, color;
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_bg1_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- vastar_state *state = machine->driver_data<vastar_state>();
+ vastar_state *state = machine.driver_data<vastar_state>();
UINT8 *videoram = state->bg2videoram;
int code, color;
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bg2_tile_info )
VIDEO_START( vastar )
{
- vastar_state *state = machine->driver_data<vastar_state>();
+ vastar_state *state = machine.driver_data<vastar_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows,8,8,32,32);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -93,7 +93,7 @@ VIDEO_START( vastar )
WRITE8_HANDLER( vastar_fgvideoram_w )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
@@ -101,7 +101,7 @@ WRITE8_HANDLER( vastar_fgvideoram_w )
WRITE8_HANDLER( vastar_bg1videoram_w )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
state->bg1videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg1_tilemap,offset & 0x3ff);
@@ -109,7 +109,7 @@ WRITE8_HANDLER( vastar_bg1videoram_w )
WRITE8_HANDLER( vastar_bg2videoram_w )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
state->bg2videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap,offset & 0x3ff);
@@ -118,14 +118,14 @@ WRITE8_HANDLER( vastar_bg2videoram_w )
READ8_HANDLER( vastar_bg1videoram_r )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
return state->bg1videoram[offset];
}
READ8_HANDLER( vastar_bg2videoram_r )
{
- vastar_state *state = space->machine->driver_data<vastar_state>();
+ vastar_state *state = space->machine().driver_data<vastar_state>();
return state->bg2videoram[offset];
}
@@ -137,9 +137,9 @@ READ8_HANDLER( vastar_bg2videoram_r )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- vastar_state *state = machine->driver_data<vastar_state>();
+ vastar_state *state = machine.driver_data<vastar_state>();
UINT8 *spriteram = state->spriteram1;
UINT8 *spriteram_2 = state->spriteram2;
UINT8 *spriteram_3 = state->spriteram3;
@@ -170,13 +170,13 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (!flip_screen_get(machine))
sy = 224 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code/2,
color,
flipx,flipy,
sx,sy,0);
/* redraw with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code/2,
color,
flipx,flipy,
@@ -187,7 +187,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (!flip_screen_get(machine))
sy = 240 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipx,flipy,
@@ -198,7 +198,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( vastar )
{
- vastar_state *state = screen->machine->driver_data<vastar_state>();
+ vastar_state *state = screen->machine().driver_data<vastar_state>();
int i;
@@ -212,14 +212,14 @@ SCREEN_UPDATE( vastar )
{
case 0:
tilemap_draw(bitmap,cliprect, state->bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect, state->bg2_tilemap, 0,0);
tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0,0);
break;
case 2:
tilemap_draw(bitmap,cliprect, state->bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect, state->bg1_tilemap, 0,0);
tilemap_draw(bitmap,cliprect, state->bg2_tilemap, 0,0);
tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0,0);
@@ -229,7 +229,7 @@ SCREEN_UPDATE( vastar )
tilemap_draw(bitmap,cliprect, state->bg1_tilemap, TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect, state->bg2_tilemap, 0,0);
tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
break;
default:
diff --git a/src/mame/video/vball.c b/src/mame/video/vball.c
index 1448be46a0f..96c9ec4845a 100644
--- a/src/mame/video/vball.c
+++ b/src/mame/video/vball.c
@@ -27,7 +27,7 @@ static TILEMAP_MAPPER( background_scan )
static TILE_GET_INFO( get_bg_tile_info )
{
- vball_state *state = machine->driver_data<vball_state>();
+ vball_state *state = machine.driver_data<vball_state>();
UINT8 code = state->vb_videoram[tile_index];
UINT8 attr = state->vb_attribram[tile_index];
SET_TILE_INFO(
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( vb )
{
- vball_state *state = machine->driver_data<vball_state>();
+ vball_state *state = machine.driver_data<vball_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,background_scan, 8, 8,64,64);
tilemap_set_scroll_rows(state->bg_tilemap,32);
@@ -51,7 +51,7 @@ VIDEO_START( vb )
WRITE8_HANDLER( vb_videoram_w )
{
- vball_state *state = space->machine->driver_data<vball_state>();
+ vball_state *state = space->machine().driver_data<vball_state>();
state->vb_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
@@ -59,27 +59,27 @@ WRITE8_HANDLER( vb_videoram_w )
#ifdef UNUSED_FUNCTION
READ8_HANDLER( vb_attrib_r )
{
- vball_state *state = space->machine->driver_data<vball_state>();
+ vball_state *state = space->machine().driver_data<vball_state>();
return state->vb_attribram[offset];
}
#endif
WRITE8_HANDLER( vb_attrib_w )
{
- vball_state *state = space->machine->driver_data<vball_state>();
+ vball_state *state = space->machine().driver_data<vball_state>();
state->vb_attribram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
-void vb_bgprombank_w( running_machine *machine, int bank )
+void vb_bgprombank_w( running_machine &machine, int bank )
{
- vball_state *state = machine->driver_data<vball_state>();
+ vball_state *state = machine.driver_data<vball_state>();
int i;
UINT8* color_prom;
if (bank==state->vb_bgprombank) return;
- color_prom = machine->region("proms")->base() + bank*0x80;
+ color_prom = machine.region("proms")->base() + bank*0x80;
for (i=0;i<128;i++, color_prom++) {
palette_set_color_rgb(machine,i,pal4bit(color_prom[0] >> 0),pal4bit(color_prom[0] >> 4),
pal4bit(color_prom[0x800] >> 0));
@@ -87,16 +87,16 @@ void vb_bgprombank_w( running_machine *machine, int bank )
state->vb_bgprombank=bank;
}
-void vb_spprombank_w( running_machine *machine, int bank )
+void vb_spprombank_w( running_machine &machine, int bank )
{
- vball_state *state = machine->driver_data<vball_state>();
+ vball_state *state = machine.driver_data<vball_state>();
int i;
UINT8* color_prom;
if (bank==state->vb_spprombank) return;
- color_prom = machine->region("proms")->base()+0x400 + bank*0x80;
+ color_prom = machine.region("proms")->base()+0x400 + bank*0x80;
for (i=128;i<256;i++,color_prom++) {
palette_set_color_rgb(machine,i,pal4bit(color_prom[0] >> 0),pal4bit(color_prom[0] >> 4),
pal4bit(color_prom[0x800] >> 0));
@@ -104,9 +104,9 @@ void vb_spprombank_w( running_machine *machine, int bank )
state->vb_spprombank=bank;
}
-void vb_mark_all_dirty( running_machine *machine )
+void vb_mark_all_dirty( running_machine &machine )
{
- vball_state *state = machine->driver_data<vball_state>();
+ vball_state *state = machine.driver_data<vball_state>();
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
@@ -114,10 +114,10 @@ void vb_mark_all_dirty( running_machine *machine )
cliprect,gfx, \
(which+order),color,flipx,flipy,sx,sy,0);
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- vball_state *state = machine->driver_data<vball_state>();
- const gfx_element *gfx = machine->gfx[1];
+ vball_state *state = machine.driver_data<vball_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT8 *src = state->spriteram;
int i;
@@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( vb )
{
- vball_state *state = screen->machine->driver_data<vball_state>();
+ vball_state *state = screen->machine().driver_data<vball_state>();
int i;
tilemap_set_scrolly(state->bg_tilemap,0,state->vb_scrolly_hi + *state->vb_scrolly_lo);
@@ -174,6 +174,6 @@ SCREEN_UPDATE( vb )
//logerror("scrollx[%d] = %d\n",i,state->vb_scrollx[i]);
}
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/vdc.c b/src/mame/video/vdc.c
index d3a82e7772b..8235c17c74a 100644
--- a/src/mame/video/vdc.c
+++ b/src/mame/video/vdc.c
@@ -70,14 +70,14 @@ static VPC vpc;
/* Function prototypes */
-static void vdc_advance_line(running_machine *machine, int which);
-static void draw_black_line(running_machine *machine, int line);
+static void vdc_advance_line(running_machine &machine, int which);
+static void draw_black_line(running_machine &machine, int line);
static void draw_overscan_line(int line);
static void draw_sgx_overscan_line(int line);
static void pce_refresh_line(int which, int line, int external_input, UINT8 *drawn, UINT16 *line_buffer);
-static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer);
-static void vdc_do_dma(running_machine *machine, int which);
-static void vpc_init( running_machine *machine );
+static void pce_refresh_sprites(running_machine &machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer);
+static void vdc_do_dma(running_machine &machine, int which);
+static void vpc_init( running_machine &machine );
INTERRUPT_GEN( pce_interrupt )
{
@@ -109,19 +109,19 @@ INTERRUPT_GEN( pce_interrupt )
/* Draw VDC #0 sprite layer */
if(vdc[0].vdc_data[CR].w & CR_SB)
{
- pce_refresh_sprites(device->machine, 0, vdc[0].current_segment_line, drawn, line_buffer);
+ pce_refresh_sprites(device->machine(), 0, vdc[0].current_segment_line, drawn, line_buffer);
}
}
}
else
{
/* We are in one of the blanking areas */
- draw_black_line(device->machine, vce.current_bitmap_line );
+ draw_black_line(device->machine(), vce.current_bitmap_line );
}
/* bump current scanline */
vce.current_bitmap_line = ( vce.current_bitmap_line + 1 ) % VDC_LPF;
- vdc_advance_line(device->machine, 0 );
+ vdc_advance_line(device->machine(), 0 );
}
INTERRUPT_GEN( sgx_interrupt )
@@ -156,7 +156,7 @@ INTERRUPT_GEN( sgx_interrupt )
/* Draw VDC #0 sprite layer */
if(vdc[0].vdc_data[CR].w & CR_SB)
{
- pce_refresh_sprites(device->machine, 0, vdc[0].current_segment_line, drawn[0], temp_buffer[0]);
+ pce_refresh_sprites(device->machine(), 0, vdc[0].current_segment_line, drawn[0], temp_buffer[0]);
}
/* Draw VDC #1 background layer */
@@ -165,7 +165,7 @@ INTERRUPT_GEN( sgx_interrupt )
/* Draw VDC #1 sprite layer */
if ( vdc[1].vdc_data[CR].w & CR_SB )
{
- pce_refresh_sprites(device->machine, 1, vdc[1].current_segment_line, drawn[1], temp_buffer[1]);
+ pce_refresh_sprites(device->machine(), 1, vdc[1].current_segment_line, drawn[1], temp_buffer[1]);
}
line_buffer = BITMAP_ADDR16( vce.bmp, vce.current_bitmap_line, 86 );
@@ -269,16 +269,16 @@ INTERRUPT_GEN( sgx_interrupt )
else
{
/* We are in one of the blanking areas */
- draw_black_line(device->machine, vce.current_bitmap_line );
+ draw_black_line(device->machine(), vce.current_bitmap_line );
}
/* bump current scanline */
vce.current_bitmap_line = ( vce.current_bitmap_line + 1 ) % VDC_LPF;
- vdc_advance_line(device->machine, 0 );
- vdc_advance_line(device->machine, 1 );
+ vdc_advance_line(device->machine(), 0 );
+ vdc_advance_line(device->machine(), 1 );
}
-static void vdc_advance_line(running_machine *machine, int which)
+static void vdc_advance_line(running_machine &machine, int which)
{
int ret = 0;
@@ -423,7 +423,7 @@ VIDEO_START( pce )
memset(vdc[1].vram, 0, 0x10000);
/* create display bitmap */
- vce.bmp = machine->primary_screen->alloc_compatible_bitmap();
+ vce.bmp = machine.primary_screen->alloc_compatible_bitmap();
vdc[0].inc = 1;
vdc[1].inc = 1;
@@ -439,7 +439,7 @@ SCREEN_UPDATE( pce )
return 0;
}
-static void draw_black_line(running_machine *machine, int line)
+static void draw_black_line(running_machine &machine, int line)
{
int i;
@@ -508,7 +508,7 @@ static UINT8 vram_read(int which, offs_t offset)
}
-static void vdc_w( running_machine *machine, int which, offs_t offset, UINT8 data )
+static void vdc_w( running_machine &machine, int which, offs_t offset, UINT8 data )
{
switch(offset&3)
{
@@ -596,7 +596,7 @@ static void vdc_w( running_machine *machine, int which, offs_t offset, UINT8 dat
}
}
-static UINT8 vdc_r( running_machine *machine, int which, offs_t offset )
+static UINT8 vdc_r( running_machine &machine, int which, offs_t offset )
{
int temp = 0;
switch(offset & 3)
@@ -622,10 +622,10 @@ static UINT8 vdc_r( running_machine *machine, int which, offs_t offset )
return (temp);
}
-WRITE8_HANDLER( vdc_0_w ) { vdc_w( space->machine, 0, offset, data ); }
-WRITE8_HANDLER( vdc_1_w ) { vdc_w( space->machine, 1, offset, data ); }
-READ8_HANDLER( vdc_0_r ) { return vdc_r( space->machine, 0, offset ); }
-READ8_HANDLER( vdc_1_r ) { return vdc_r( space->machine, 1, offset ); }
+WRITE8_HANDLER( vdc_0_w ) { vdc_w( space->machine(), 0, offset, data ); }
+WRITE8_HANDLER( vdc_1_w ) { vdc_w( space->machine(), 1, offset, data ); }
+READ8_HANDLER( vdc_0_r ) { return vdc_r( space->machine(), 0, offset ); }
+READ8_HANDLER( vdc_1_r ) { return vdc_r( space->machine(), 1, offset ); }
PALETTE_INIT( vce )
{
@@ -824,7 +824,7 @@ static void conv_obj(int which, int i, int l, int hf, int vf, char *buf)
}
}
-static void pce_refresh_sprites(running_machine *machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer)
+static void pce_refresh_sprites(running_machine &machine, int which, int line, UINT8 *drawn, UINT16 *line_buffer)
{
int i;
UINT8 sprites_drawn = 0;
@@ -1052,7 +1052,7 @@ static void pce_refresh_sprites(running_machine *machine, int which, int line, U
}
}
-static void vdc_do_dma(running_machine *machine, int which)
+static void vdc_do_dma(running_machine &machine, int which)
{
int src = vdc[which].vdc_data[SOUR].w;
int dst = vdc[which].vdc_data[DESR].w;
@@ -1183,9 +1183,9 @@ READ8_HANDLER( vpc_r )
return data;
}
-static void vpc_init( running_machine *machine )
+static void vpc_init( running_machine &machine )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
vpc_w( space, 0, 0x11 );
vpc_w( space, 1, 0x11 );
vpc.window1.w = 0;
diff --git a/src/mame/video/vendetta.c b/src/mame/video/vendetta.c
index d49bdba3542..3047351dbad 100644
--- a/src/mame/video/vendetta.c
+++ b/src/mame/video/vendetta.c
@@ -8,16 +8,16 @@
***************************************************************************/
-void vendetta_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void vendetta_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
*code |= ((*color & 0x03) << 8) | ((*color & 0x30) << 6) | ((*color & 0x0c) << 10) | (bank << 14);
*color = state->layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
-void esckids_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void esckids_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = state->layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
@@ -29,9 +29,9 @@ void esckids_tile_callback( running_machine *machine, int layer, int bank, int *
***************************************************************************/
-void vendetta_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void vendetta_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- vendetta_state *state = machine->driver_data<vendetta_state>();
+ vendetta_state *state = machine.driver_data<vendetta_state>();
int pri = (*color & 0x03e0) >> 4; /* ??????? */
if (pri <= state->layerpri[2])
*priority_mask = 0;
@@ -54,7 +54,7 @@ void vendetta_sprite_callback( running_machine *machine, int *code, int *color,
SCREEN_UPDATE( vendetta )
{
- vendetta_state *state = screen->machine->driver_data<vendetta_state>();
+ vendetta_state *state = screen->machine().driver_data<vendetta_state>();
int layer[3];
state->sprite_colorbase = k053251_get_palette_index(state->k053251, K053251_CI1);
@@ -73,7 +73,7 @@ SCREEN_UPDATE( vendetta )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[1], 0, 2);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[2], 0, 4);
diff --git a/src/mame/video/vertigo.c b/src/mame/video/vertigo.c
index 9bc7b86f669..a0b06b68773 100644
--- a/src/mame/video/vertigo.c
+++ b/src/mame/video/vertigo.c
@@ -118,9 +118,9 @@ enum {
*
*************************************/
-void vertigo_vproc_init(running_machine *machine)
+void vertigo_vproc_init(running_machine &machine)
{
- vertigo_state *state = machine->driver_data<vertigo_state>();
+ vertigo_state *state = machine.driver_data<vertigo_state>();
state_save_register_item_array(machine, "vector_proc", NULL, 0, state->vs.sram);
state_save_register_item(machine, "vector_proc", NULL, 0, state->vs.ramlatch);
state_save_register_item(machine, "vector_proc", NULL, 0, state->vs.rom_adr);
@@ -154,14 +154,14 @@ void vertigo_vproc_init(running_machine *machine)
}
-void vertigo_vproc_reset(running_machine *machine)
+void vertigo_vproc_reset(running_machine &machine)
{
- vertigo_state *state = machine->driver_data<vertigo_state>();
+ vertigo_state *state = machine.driver_data<vertigo_state>();
int i;
UINT64 *mcode;
- state->vectorrom = (UINT16 *)machine->region("user1")->base();
- mcode = (UINT64 *)machine->region("proms")->base();
+ state->vectorrom = (UINT16 *)machine.region("user1")->base();
+ mcode = (UINT64 *)machine.region("proms")->base();
/* Decode microcode */
for (i = 0; i < MC_LENGTH; i++)
@@ -187,7 +187,7 @@ void vertigo_vproc_reset(running_machine *machine)
memset(&state->vs, 0, sizeof(state->vs));
memset(&state->bsp, 0, sizeof(state->bsp));
memset(&state->vgen, 0, sizeof(state->vgen));
- state->vgen.machine = machine;
+ state->vgen.m_machine = &machine;
}
@@ -371,9 +371,9 @@ static void vertigo_vgen (vector_generator *vg)
if (vg->brez ^ vg->ven)
{
if (vg->brez)
- V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, 0, 0);
+ V_ADDPOINT (vg->machine(), vg->c_h, vg->c_v, 0, 0);
else
- V_ADDPOINT (vg->machine, vg->c_h, vg->c_v, vg->color, vg->intensity);
+ V_ADDPOINT (vg->machine(), vg->c_h, vg->c_v, vg->color, vg->intensity);
vg->ven = vg->brez;
}
}
@@ -384,9 +384,9 @@ static void vertigo_vgen (vector_generator *vg)
*
*************************************/
-void vertigo_vproc(running_machine *machine, int cycles, int irq4)
+void vertigo_vproc(running_machine &machine, int cycles, int irq4)
{
- vertigo_state *state = machine->driver_data<vertigo_state>();
+ vertigo_state *state = machine.driver_data<vertigo_state>();
int jcond;
microcode *cmc;
diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c
index 9ec9b51e914..482039af767 100644
--- a/src/mame/video/vicdual.c
+++ b/src/mame/video/vicdual.c
@@ -23,15 +23,15 @@ static const pen_t pens_from_color_prom[] =
WRITE8_HANDLER( vicdual_palette_bank_w )
{
- vicdual_state *state = space->machine->driver_data<vicdual_state>();
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ vicdual_state *state = space->machine().driver_data<vicdual_state>();
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
state->palette_bank = data & 3;
}
SCREEN_UPDATE( vicdual_bw )
{
- vicdual_state *state = screen->machine->driver_data<vicdual_state>();
+ vicdual_state *state = screen->machine().driver_data<vicdual_state>();
UINT8 x = 0;
UINT8 y = cliprect->min_y;
UINT8 video_data = 0;
@@ -82,8 +82,8 @@ SCREEN_UPDATE( vicdual_bw )
SCREEN_UPDATE( vicdual_color )
{
- vicdual_state *state = screen->machine->driver_data<vicdual_state>();
- UINT8 *color_prom = (UINT8 *)screen->machine->region("proms")->base();
+ vicdual_state *state = screen->machine().driver_data<vicdual_state>();
+ UINT8 *color_prom = (UINT8 *)screen->machine().region("proms")->base();
UINT8 x = 0;
UINT8 y = cliprect->min_y;
UINT8 video_data = 0;
@@ -141,7 +141,7 @@ SCREEN_UPDATE( vicdual_color )
SCREEN_UPDATE( vicdual_bw_or_color )
{
- if (vicdual_is_cabinet_color(screen->machine))
+ if (vicdual_is_cabinet_color(screen->machine()))
SCREEN_UPDATE_CALL(vicdual_color);
else
SCREEN_UPDATE_CALL(vicdual_bw);
diff --git a/src/mame/video/victory.c b/src/mame/video/victory.c
index ef59a2ec278..02c49e0e6a6 100644
--- a/src/mame/video/victory.c
+++ b/src/mame/video/victory.c
@@ -23,12 +23,12 @@
/* function prototypes */
-static int command2(running_machine *machine);
-static int command3(running_machine *machine);
-static int command4(running_machine *machine);
-static int command5(running_machine *machine);
-static int command6(running_machine *machine);
-static int command7(running_machine *machine);
+static int command2(running_machine &machine);
+static int command3(running_machine &machine);
+static int command4(running_machine &machine);
+static int command5(running_machine &machine);
+static int command6(running_machine &machine);
+static int command7(running_machine &machine);
@@ -40,7 +40,7 @@ static int command7(running_machine *machine);
VIDEO_START( victory )
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
/* allocate bitmapram */
state->rram = auto_alloc_array(machine, UINT8, 0x4000);
state->gram = auto_alloc_array(machine, UINT8, 0x4000);
@@ -57,7 +57,7 @@ VIDEO_START( victory )
state->scrollx = state->scrolly = 0;
state->video_control = 0;
memset(&state->micro, 0, sizeof(state->micro));
- state->micro.timer = machine->scheduler().timer_alloc(FUNC(NULL));
+ state->micro.timer = machine.scheduler().timer_alloc(FUNC(NULL));
/* register for state saving */
state_save_register_global_array(machine, state->paletteram);
@@ -71,9 +71,9 @@ VIDEO_START( victory )
*
*************************************/
-static void victory_update_irq(running_machine *machine)
+static void victory_update_irq(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
if (state->vblank_irq || state->fgcoll || (state->bgcoll && (state->video_control & 0x20)))
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
else
@@ -83,10 +83,10 @@ static void victory_update_irq(running_machine *machine)
INTERRUPT_GEN( victory_vblank_interrupt )
{
- victory_state *state = device->machine->driver_data<victory_state>();
+ victory_state *state = device->machine().driver_data<victory_state>();
state->vblank_irq = 1;
- victory_update_irq(device->machine);
+ victory_update_irq(device->machine());
}
@@ -99,14 +99,14 @@ INTERRUPT_GEN( victory_vblank_interrupt )
WRITE8_HANDLER( victory_paletteram_w )
{
- victory_state *state = space->machine->driver_data<victory_state>();
+ victory_state *state = space->machine().driver_data<victory_state>();
state->paletteram[offset & 0x3f] = ((offset & 0x80) << 1) | data;
}
-static void set_palette(running_machine *machine)
+static void set_palette(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
offs_t offs;
for (offs = 0; offs < 0x40; offs++)
@@ -127,7 +127,7 @@ static void set_palette(running_machine *machine)
READ8_HANDLER( victory_video_control_r )
{
- victory_state *state = space->machine->driver_data<victory_state>();
+ victory_state *state = space->machine().driver_data<victory_state>();
int result = 0;
switch (offset)
@@ -142,7 +142,7 @@ READ8_HANDLER( victory_video_control_r )
if (state->fgcoll)
{
state->fgcoll = 0;
- victory_update_irq(space->machine);
+ victory_update_irq(space->machine());
}
if (LOG_COLLISION) logerror("%04X:5CLFIQ read = %02X\n", cpu_get_previouspc(space->cpu), result);
return result;
@@ -157,7 +157,7 @@ READ8_HANDLER( victory_video_control_r )
if (state->bgcoll)
{
state->bgcoll = 0;
- victory_update_irq(space->machine);
+ victory_update_irq(space->machine());
}
if (LOG_COLLISION) logerror("%04X:5BACKY read = %02X\n", cpu_get_previouspc(space->cpu), result);
return result;
@@ -173,7 +173,7 @@ READ8_HANDLER( victory_video_control_r )
result |= (~state->fgcoll & 1) << 6;
result |= (~state->vblank_irq & 1) << 5;
result |= (~state->bgcoll & 1) << 4;
- result |= (space->machine->primary_screen->vpos() & 0x100) >> 5;
+ result |= (space->machine().primary_screen->vpos() & 0x100) >> 5;
if (LOG_COLLISION) logerror("%04X:5STAT read = %02X\n", cpu_get_previouspc(space->cpu), result);
return result;
@@ -194,7 +194,7 @@ READ8_HANDLER( victory_video_control_r )
WRITE8_HANDLER( victory_video_control_w )
{
- victory_state *state = space->machine->driver_data<victory_state>();
+ victory_state *state = space->machine().driver_data<victory_state>();
struct micro_t &micro = state->micro;
switch (offset)
{
@@ -209,7 +209,7 @@ WRITE8_HANDLER( victory_video_control_w )
if (micro.cmdlo == 5)
{
if (LOG_MICROCODE) logerror(" Command 5 triggered by write to IH\n");
- command5(space->machine);
+ command5(space->machine());
}
break;
@@ -224,7 +224,7 @@ WRITE8_HANDLER( victory_video_control_w )
else if (micro.cmdlo == 6)
{
if (LOG_MICROCODE) logerror(" Command 6 triggered\n");
- command6(space->machine);
+ command6(space->machine());
}
break;
@@ -239,7 +239,7 @@ WRITE8_HANDLER( victory_video_control_w )
if (micro.cmdlo == 3)
{
if (LOG_MICROCODE) logerror(" Command 3 triggered by write to X\n");
- command3(space->machine);
+ command3(space->machine());
}
break;
@@ -249,7 +249,7 @@ WRITE8_HANDLER( victory_video_control_w )
if (micro.cmdlo == 4)
{
if (LOG_MICROCODE) logerror(" Command 4 triggered by write to Y\n");
- command4(space->machine);
+ command4(space->machine());
}
break;
@@ -264,12 +264,12 @@ WRITE8_HANDLER( victory_video_control_w )
if (micro.cmdlo == 2)
{
if (LOG_MICROCODE) logerror(" Command 2 triggered by write to B\n");
- command2(space->machine);
+ command2(space->machine());
}
else if (micro.cmdlo == 7)
{
if (LOG_MICROCODE) logerror(" Command 7 triggered by write to B\n");
- command7(space->machine);
+ command7(space->machine());
}
break;
@@ -298,7 +298,7 @@ WRITE8_HANDLER( victory_video_control_w )
case 0x0b: /* CLRVIRQ */
if (LOG_MICROCODE) logerror("%04X:CLRVIRQ write = %02X\n", cpu_get_previouspc(space->cpu), data);
state->vblank_irq = 0;
- victory_update_irq(space->machine);
+ victory_update_irq(space->machine());
break;
default:
@@ -530,9 +530,9 @@ INLINE void count_states(struct micro_t &micro, int states)
*
*************************************/
-static int command2(running_machine *machine)
+static int command2(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -564,9 +564,9 @@ static int command2(running_machine *machine)
*
*************************************/
-static int command3(running_machine *machine)
+static int command3(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -673,9 +673,9 @@ static int command3(running_machine *machine)
*
*************************************/
-static int command4(running_machine *machine)
+static int command4(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -738,9 +738,9 @@ static int command4(running_machine *machine)
*
*************************************/
-static int command5(running_machine *machine)
+static int command5(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -877,9 +877,9 @@ static int command5(running_machine *machine)
*
*************************************/
-static int command6(running_machine *machine)
+static int command6(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -928,9 +928,9 @@ static int command6(running_machine *machine)
*
*************************************/
-static int command7(running_machine *machine)
+static int command7(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
struct micro_t &micro = state->micro;
/*
Actual microcode:
@@ -1008,9 +1008,9 @@ static int command7(running_machine *machine)
*
*************************************/
-static void update_background(running_machine *machine)
+static void update_background(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
int x, y, row, offs;
for (y = offs = 0; y < 32; y++)
@@ -1044,9 +1044,9 @@ static void update_background(running_machine *machine)
*
*************************************/
-static void update_foreground(running_machine *machine)
+static void update_foreground(running_machine &machine)
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
int x, y;
for (y = 0; y < 256; y++)
@@ -1075,7 +1075,7 @@ static void update_foreground(running_machine *machine)
static TIMER_CALLBACK( bgcoll_irq_callback )
{
- victory_state *state = machine->driver_data<victory_state>();
+ victory_state *state = machine.driver_data<victory_state>();
state->bgcollx = param & 0xff;
state->bgcolly = param >> 8;
state->bgcoll = 1;
@@ -1092,17 +1092,17 @@ static TIMER_CALLBACK( bgcoll_irq_callback )
SCREEN_UPDATE( victory )
{
- victory_state *state = screen->machine->driver_data<victory_state>();
+ victory_state *state = screen->machine().driver_data<victory_state>();
int bgcollmask = (state->video_control & 4) ? 4 : 7;
int count = 0;
int x, y;
/* copy the palette from palette RAM */
- set_palette(screen->machine);
+ set_palette(screen->machine());
/* update the foreground & background */
- update_foreground(screen->machine);
- update_background(screen->machine);
+ update_foreground(screen->machine());
+ update_background(screen->machine());
/* blend the bitmaps and do collision detection */
for (y = 0; y < 256; y++)
@@ -1119,7 +1119,7 @@ SCREEN_UPDATE( victory )
int bpix = bg[(x + state->scrollx) & 255];
scanline[x] = bpix | (fpix << 3);
if (fpix && (bpix & bgcollmask) && count++ < 128)
- screen->machine->scheduler().timer_set(screen->time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8));
+ screen->machine().scheduler().timer_set(screen->time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8));
}
}
diff --git a/src/mame/video/videopin.c b/src/mame/video/videopin.c
index 618d5008a81..1897a125929 100644
--- a/src/mame/video/videopin.c
+++ b/src/mame/video/videopin.c
@@ -19,7 +19,7 @@ static TILEMAP_MAPPER( get_memory_offset )
static TILE_GET_INFO( get_tile_info )
{
- videopin_state *state = machine->driver_data<videopin_state>();
+ videopin_state *state = machine.driver_data<videopin_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, code, 0, (code & 0x40) ? TILE_FLIPY : 0);
@@ -28,14 +28,14 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( videopin )
{
- videopin_state *state = machine->driver_data<videopin_state>();
+ videopin_state *state = machine.driver_data<videopin_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, get_memory_offset, 8, 8, 48, 32);
}
SCREEN_UPDATE( videopin )
{
- videopin_state *state = screen->machine->driver_data<videopin_state>();
+ videopin_state *state = screen->machine().driver_data<videopin_state>();
int col;
int row;
@@ -84,7 +84,7 @@ SCREEN_UPDATE( videopin )
{
for (j = 0; j < 2; j++)
{
- drawgfx_transpen(bitmap, &rect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, &rect, screen->machine().gfx[1],
0, 0,
0, 0,
x + 16 * i,
@@ -102,7 +102,7 @@ SCREEN_UPDATE( videopin )
WRITE8_HANDLER( videopin_ball_w )
{
- videopin_state *state = space->machine->driver_data<videopin_state>();
+ videopin_state *state = space->machine().driver_data<videopin_state>();
state->ball_x = data & 15;
state->ball_y = data >> 4;
}
@@ -110,7 +110,7 @@ WRITE8_HANDLER( videopin_ball_w )
WRITE8_HANDLER( videopin_video_ram_w )
{
- videopin_state *state = space->machine->driver_data<videopin_state>();
+ videopin_state *state = space->machine().driver_data<videopin_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
diff --git a/src/mame/video/vigilant.c b/src/mame/video/vigilant.c
index 3f97ddb8e4b..dff4e460e37 100644
--- a/src/mame/video/vigilant.c
+++ b/src/mame/video/vigilant.c
@@ -27,14 +27,14 @@ static const rectangle bottomvisiblearea =
VIDEO_START( vigilant )
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
- state->bg_bitmap = auto_bitmap_alloc(machine,512*4,256,machine->primary_screen->format());
+ vigilant_state *state = machine.driver_data<vigilant_state>();
+ state->bg_bitmap = auto_bitmap_alloc(machine,512*4,256,machine.primary_screen->format());
}
VIDEO_RESET( vigilant )
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
+ vigilant_state *state = machine.driver_data<vigilant_state>();
state->horiz_scroll_low = 0;
state->horiz_scroll_high = 0;
state->rear_horiz_scroll_low = 0;
@@ -51,9 +51,9 @@ VIDEO_RESET( vigilant )
There are three background ROMs, each one contains a 512x256 picture.
Redraw them if the palette changes.
**************************************************************************/
-static void update_background(running_machine *machine)
+static void update_background(running_machine &machine)
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
+ vigilant_state *state = machine.driver_data<vigilant_state>();
int row,col,page;
int charcode;
@@ -68,7 +68,7 @@ static void update_background(running_machine *machine)
for( col=0; col<512; col+=32 )
{
drawgfx_opaque(state->bg_bitmap,
- 0,machine->gfx[2],
+ 0,machine.gfx[2],
charcode,
row < 128 ? 0 : 1,
0,0,
@@ -100,16 +100,16 @@ WRITE8_HANDLER( vigilant_paletteram_w )
int bank,r,g,b;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
bank = offset & 0x400;
offset &= 0xff;
- r = (space->machine->generic.paletteram.u8[bank + offset + 0x000] << 3) & 0xFF;
- g = (space->machine->generic.paletteram.u8[bank + offset + 0x100] << 3) & 0xFF;
- b = (space->machine->generic.paletteram.u8[bank + offset + 0x200] << 3) & 0xFF;
+ r = (space->machine().generic.paletteram.u8[bank + offset + 0x000] << 3) & 0xFF;
+ g = (space->machine().generic.paletteram.u8[bank + offset + 0x100] << 3) & 0xFF;
+ b = (space->machine().generic.paletteram.u8[bank + offset + 0x200] << 3) & 0xFF;
- palette_set_color(space->machine, (bank >> 2) + offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), (bank >> 2) + offset,MAKE_RGB(r,g,b));
}
@@ -122,7 +122,7 @@ WRITE8_HANDLER( vigilant_paletteram_w )
**************************************************************************/
WRITE8_HANDLER( vigilant_horiz_scroll_w )
{
- vigilant_state *state = space->machine->driver_data<vigilant_state>();
+ vigilant_state *state = space->machine().driver_data<vigilant_state>();
if (offset==0)
state->horiz_scroll_low = data;
else
@@ -137,7 +137,7 @@ WRITE8_HANDLER( vigilant_horiz_scroll_w )
***************************************************************************/
WRITE8_HANDLER( vigilant_rear_horiz_scroll_w )
{
- vigilant_state *state = space->machine->driver_data<vigilant_state>();
+ vigilant_state *state = space->machine().driver_data<vigilant_state>();
if (offset==0)
state->rear_horiz_scroll_low = data;
else
@@ -161,7 +161,7 @@ WRITE8_HANDLER( vigilant_rear_horiz_scroll_w )
**************************************************************************/
WRITE8_HANDLER( vigilant_rear_color_w )
{
- vigilant_state *state = space->machine->driver_data<vigilant_state>();
+ vigilant_state *state = space->machine().driver_data<vigilant_state>();
state->rear_disable = data & 0x40;
state->rear_color = (data & 0x0d);
}
@@ -172,9 +172,9 @@ WRITE8_HANDLER( vigilant_rear_color_w )
???
**************************************************************************/
-static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int opaque )
+static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int opaque )
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
+ vigilant_state *state = machine.driver_data<vigilant_state>();
UINT8 *videoram = state->videoram;
int offs;
int scroll = -(state->horiz_scroll_low + state->horiz_scroll_high);
@@ -196,7 +196,7 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
{
sx = (sx + scroll) & 0x1ff;
- drawgfx_transmask(bitmap,&bottomvisiblearea,machine->gfx[0],
+ drawgfx_transmask(bitmap,&bottomvisiblearea,machine.gfx[0],
tile_number,
color,
0,0,
@@ -209,7 +209,7 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
if (sy >= 48)
sx = (sx + scroll) & 0x1ff;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
tile_number,
color,
0,0,
@@ -221,9 +221,9 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
+ vigilant_state *state = machine.driver_data<vigilant_state>();
int scrollx = 0x17a + 16*8 - (state->rear_horiz_scroll_low + state->rear_horiz_scroll_high);
@@ -237,9 +237,9 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- vigilant_state *state = machine->driver_data<vigilant_state>();
+ vigilant_state *state = machine.driver_data<vigilant_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -265,7 +265,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (flipy) c += h-1-y;
else c += y;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
c,
color,
flipx,flipy,
@@ -276,7 +276,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( kikcubic )
{
- vigilant_state *state = screen->machine->driver_data<vigilant_state>();
+ vigilant_state *state = screen->machine().driver_data<vigilant_state>();
UINT8 *videoram = state->videoram;
int offs;
@@ -288,20 +288,20 @@ SCREEN_UPDATE( kikcubic )
int color = (attributes & 0xF0) >> 4;
int tile_number = videoram[offs] | ((attributes & 0x0F) << 8);
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
tile_number,
color,
0,0,
sx,sy);
}
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
return 0;
}
SCREEN_UPDATE( vigilant )
{
- vigilant_state *state = screen->machine->driver_data<vigilant_state>();
+ vigilant_state *state = screen->machine().driver_data<vigilant_state>();
int i;
/* copy the background palette */
@@ -310,31 +310,31 @@ SCREEN_UPDATE( vigilant )
int r,g,b;
- r = (screen->machine->generic.paletteram.u8[0x400 + 16 * state->rear_color + i] << 3) & 0xFF;
- g = (screen->machine->generic.paletteram.u8[0x500 + 16 * state->rear_color + i] << 3) & 0xFF;
- b = (screen->machine->generic.paletteram.u8[0x600 + 16 * state->rear_color + i] << 3) & 0xFF;
+ r = (screen->machine().generic.paletteram.u8[0x400 + 16 * state->rear_color + i] << 3) & 0xFF;
+ g = (screen->machine().generic.paletteram.u8[0x500 + 16 * state->rear_color + i] << 3) & 0xFF;
+ b = (screen->machine().generic.paletteram.u8[0x600 + 16 * state->rear_color + i] << 3) & 0xFF;
- palette_set_color(screen->machine,512 + i,MAKE_RGB(r,g,b));
+ palette_set_color(screen->machine(),512 + i,MAKE_RGB(r,g,b));
- r = (screen->machine->generic.paletteram.u8[0x400 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
- g = (screen->machine->generic.paletteram.u8[0x500 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
- b = (screen->machine->generic.paletteram.u8[0x600 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
+ r = (screen->machine().generic.paletteram.u8[0x400 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
+ g = (screen->machine().generic.paletteram.u8[0x500 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
+ b = (screen->machine().generic.paletteram.u8[0x600 + 16 * state->rear_color + 32 + i] << 3) & 0xFF;
- palette_set_color(screen->machine,512 + 16 + i,MAKE_RGB(r,g,b));
+ palette_set_color(screen->machine(),512 + 16 + i,MAKE_RGB(r,g,b));
}
if (state->rear_disable) /* opaque foreground */
{
- draw_foreground(screen->machine,bitmap,cliprect,0,1);
- draw_sprites(screen->machine,bitmap,&bottomvisiblearea);
- draw_foreground(screen->machine,bitmap,cliprect,1,0);
+ draw_foreground(screen->machine(),bitmap,cliprect,0,1);
+ draw_sprites(screen->machine(),bitmap,&bottomvisiblearea);
+ draw_foreground(screen->machine(),bitmap,cliprect,1,0);
}
else
{
- draw_background(screen->machine,bitmap,cliprect);
- draw_foreground(screen->machine,bitmap,cliprect,0,0);
- draw_sprites(screen->machine,bitmap,&bottomvisiblearea);
- draw_foreground(screen->machine,bitmap,cliprect,1,0); // priority tiles
+ draw_background(screen->machine(),bitmap,cliprect);
+ draw_foreground(screen->machine(),bitmap,cliprect,0,0);
+ draw_sprites(screen->machine(),bitmap,&bottomvisiblearea);
+ draw_foreground(screen->machine(),bitmap,cliprect,1,0); // priority tiles
}
return 0;
}
diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c
index 7c00343279f..7629cc96ad5 100644
--- a/src/mame/video/vindictr.c
+++ b/src/mame/video/vindictr.c
@@ -17,7 +17,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- vindictr_state *state = machine->driver_data<vindictr_state>();
+ vindictr_state *state = machine.driver_data<vindictr_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = ((data >> 10) & 0x0f) | ((data >> 9) & 0x20);
@@ -28,7 +28,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- vindictr_state *state = machine->driver_data<vindictr_state>();
+ vindictr_state *state = machine.driver_data<vindictr_state>();
UINT16 data = state->playfield[tile_index];
int code = (state->playfield_tile_bank * 0x1000) + (data & 0xfff);
int color = 0x10 + 2 * ((data >> 12) & 7);
@@ -81,7 +81,7 @@ VIDEO_START( vindictr )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- vindictr_state *state = machine->driver_data<vindictr_state>();
+ vindictr_state *state = machine.driver_data<vindictr_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
@@ -114,8 +114,8 @@ WRITE16_HANDLER( vindictr_paletteram_w )
int c;
/* first blend the data */
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- data = space->machine->generic.paletteram.u16[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ data = space->machine().generic.paletteram.u16[offset];
/* now generate colors at all 16 intensities */
for (c = 0; c < 8; c++)
@@ -125,7 +125,7 @@ WRITE16_HANDLER( vindictr_paletteram_w )
int g = ((data >> 4) & 15) * i;
int b = ((data >> 0) & 15) * i;
- palette_set_color(space->machine,offset + c*2048,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset + c*2048,MAKE_RGB(r,g,b));
}
}
@@ -139,7 +139,7 @@ WRITE16_HANDLER( vindictr_paletteram_w )
void vindictr_scanline_update(screen_device &screen, int scanline)
{
- vindictr_state *state = screen.machine->driver_data<vindictr_state>();
+ vindictr_state *state = screen.machine().driver_data<vindictr_state>();
UINT16 *base = &state->alpha[((scanline - 8) / 8) * 64 + 42];
int x;
@@ -186,7 +186,7 @@ void vindictr_scanline_update(screen_device &screen, int scanline)
break;
case 6: /* /VIRQ */
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
break;
case 7: /* /PFVS */
@@ -219,7 +219,7 @@ void vindictr_scanline_update(screen_device &screen, int scanline)
SCREEN_UPDATE( vindictr )
{
- vindictr_state *state = screen->machine->driver_data<vindictr_state>();
+ vindictr_state *state = screen->machine().driver_data<vindictr_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/volfied.c b/src/mame/video/volfied.c
index d7339a9daa7..2ecec9c316a 100644
--- a/src/mame/video/volfied.c
+++ b/src/mame/video/volfied.c
@@ -8,7 +8,7 @@
VIDEO_START( volfied )
{
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
state->video_ram = auto_alloc_array(machine, UINT16, 0x40000);
state->video_ctrl = 0;
@@ -26,13 +26,13 @@ VIDEO_START( volfied )
READ16_HANDLER( volfied_video_ram_r )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
return state->video_ram[offset];
}
WRITE16_HANDLER( volfied_video_ram_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
mem_mask &= state->video_mask;
@@ -41,7 +41,7 @@ WRITE16_HANDLER( volfied_video_ram_w )
WRITE16_HANDLER( volfied_video_ctrl_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
COMBINE_DATA(&state->video_ctrl);
}
@@ -58,13 +58,13 @@ READ16_HANDLER( volfied_video_ctrl_r )
WRITE16_HANDLER( volfied_video_mask_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
COMBINE_DATA(&state->video_mask);
}
WRITE16_HANDLER( volfied_sprite_ctrl_w )
{
- volfied_state *state = space->machine->driver_data<volfied_state>();
+ volfied_state *state = space->machine().driver_data<volfied_state>();
pc090oj_set_sprite_ctrl(state->pc090oj, (data & 0x3c) >> 2);
}
@@ -73,7 +73,7 @@ WRITE16_HANDLER( volfied_sprite_ctrl_w )
SCREEN REFRESH
*******************************************************/
-static void refresh_pixel_layer( running_machine *machine, bitmap_t *bitmap )
+static void refresh_pixel_layer( running_machine &machine, bitmap_t *bitmap )
{
int x, y;
@@ -97,10 +97,10 @@ static void refresh_pixel_layer( running_machine *machine, bitmap_t *bitmap )
*********************************************************/
- volfied_state *state = machine->driver_data<volfied_state>();
+ volfied_state *state = machine.driver_data<volfied_state>();
UINT16* p = state->video_ram;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
if (state->video_ctrl & 1)
p += 0x20000;
@@ -130,10 +130,10 @@ static void refresh_pixel_layer( running_machine *machine, bitmap_t *bitmap )
SCREEN_UPDATE( volfied )
{
- volfied_state *state = screen->machine->driver_data<volfied_state>();
+ volfied_state *state = screen->machine().driver_data<volfied_state>();
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
- refresh_pixel_layer(screen->machine, bitmap);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
+ refresh_pixel_layer(screen->machine(), bitmap);
pc090oj_draw_sprites(state->pc090oj, bitmap, cliprect, 0);
return 0;
}
diff --git a/src/mame/video/vrender0.c b/src/mame/video/vrender0.c
index 4222be70ff6..63461bde6ab 100644
--- a/src/mame/video/vrender0.c
+++ b/src/mame/video/vrender0.c
@@ -566,7 +566,7 @@ static DEVICE_START( vr0video )
vr0video_state *vr0 = get_safe_token(device);
const vr0video_interface *intf = get_interface(device);
- vr0->cpu = device->machine->device(intf->cpu);
+ vr0->cpu = device->machine().device(intf->cpu);
device->save_item(NAME(vr0->InternalPalette));
device->save_item(NAME(vr0->LastPalUpdate));
diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c
index 7fd1b0ba924..6bfbd86a64c 100644
--- a/src/mame/video/vsnes.c
+++ b/src/mame/video/vsnes.c
@@ -16,12 +16,12 @@ PALETTE_INIT( vsdual )
static void ppu_irq_1( device_t *device, int *ppu_regs )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE );
}
static void ppu_irq_2( device_t *device, int *ppu_regs )
{
- cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(device->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE );
}
/* our ppu interface */
@@ -58,13 +58,13 @@ VIDEO_START( vsdual )
SCREEN_UPDATE( vsnes )
{
/* render the ppu */
- ppu2c0x_render( screen->machine->device("ppu1"), bitmap, 0, 0, 0, 0 );
+ ppu2c0x_render( screen->machine().device("ppu1"), bitmap, 0, 0, 0, 0 );
return 0;
}
SCREEN_UPDATE( vsnes_bottom )
{
- ppu2c0x_render(screen->machine->device("ppu2"), bitmap, 0, 0, 0, 0);
+ ppu2c0x_render(screen->machine().device("ppu2"), bitmap, 0, 0, 0, 0);
return 0;
}
diff --git a/src/mame/video/vulgus.c b/src/mame/video/vulgus.c
index 200e881446a..335f9355857 100644
--- a/src/mame/video/vulgus.c
+++ b/src/mame/video/vulgus.c
@@ -20,7 +20,7 @@ PALETTE_INIT( vulgus )
{
int i;
- machine->colortable = colortable_alloc(machine, 256);
+ machine.colortable = colortable_alloc(machine, 256);
for (i = 0;i < 256;i++)
{
@@ -42,7 +42,7 @@ PALETTE_INIT( vulgus )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
@@ -51,20 +51,20 @@ PALETTE_INIT( vulgus )
/* characters use colors 32-47 (?) */
- for (i = 0;i < machine->gfx[0]->total_colors * machine->gfx[0]->color_granularity;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i, 32 + *color_prom++);
+ for (i = 0;i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity;i++)
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, 32 + *color_prom++);
/* sprites use colors 16-31 */
- for (i = 0;i < machine->gfx[2]->total_colors * machine->gfx[2]->color_granularity;i++)
- colortable_entry_set_value(machine->colortable, machine->gfx[2]->color_base + i, 16 + *color_prom++);
+ for (i = 0;i < machine.gfx[2]->total_colors * machine.gfx[2]->color_granularity;i++)
+ colortable_entry_set_value(machine.colortable, machine.gfx[2]->color_base + i, 16 + *color_prom++);
/* background tiles use colors 0-15, 64-79, 128-143, 192-207 in four banks */
- for (i = 0;i < machine->gfx[1]->total_colors * machine->gfx[1]->color_granularity / 4;i++)
+ for (i = 0;i < machine.gfx[1]->total_colors * machine.gfx[1]->color_granularity / 4;i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + 0*32*8 + i, *color_prom);
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + 1*32*8 + i, *color_prom + 64);
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + 2*32*8 + i, *color_prom + 128);
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + 3*32*8 + i, *color_prom + 192);
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 0*32*8 + i, *color_prom);
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 1*32*8 + i, *color_prom + 64);
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 2*32*8 + i, *color_prom + 128);
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 3*32*8 + i, *color_prom + 192);
color_prom++;
}
}
@@ -78,7 +78,7 @@ PALETTE_INIT( vulgus )
static TILE_GET_INFO( get_fg_tile_info )
{
- vulgus_state *state = machine->driver_data<vulgus_state>();
+ vulgus_state *state = machine.driver_data<vulgus_state>();
int code, color;
code = state->fgvideoram[tile_index];
@@ -93,7 +93,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- vulgus_state *state = machine->driver_data<vulgus_state>();
+ vulgus_state *state = machine.driver_data<vulgus_state>();
int code, color;
code = state->bgvideoram[tile_index];
@@ -114,11 +114,11 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( vulgus )
{
- vulgus_state *state = machine->driver_data<vulgus_state>();
+ vulgus_state *state = machine.driver_data<vulgus_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows, 8, 8,32,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_cols,16,16,32,32);
- colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 47);
+ colortable_configure_tilemap_groups(machine.colortable, state->fg_tilemap, machine.gfx[0], 47);
}
@@ -130,14 +130,14 @@ VIDEO_START( vulgus )
WRITE8_HANDLER( vulgus_fgvideoram_w )
{
- vulgus_state *state = space->machine->driver_data<vulgus_state>();
+ vulgus_state *state = space->machine().driver_data<vulgus_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( vulgus_bgvideoram_w )
{
- vulgus_state *state = space->machine->driver_data<vulgus_state>();
+ vulgus_state *state = space->machine().driver_data<vulgus_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
@@ -146,17 +146,17 @@ WRITE8_HANDLER( vulgus_bgvideoram_w )
WRITE8_HANDLER( vulgus_c804_w )
{
/* bits 0 and 1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 7 flips screen */
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
WRITE8_HANDLER( vulgus_palette_bank_w )
{
- vulgus_state *state = space->machine->driver_data<vulgus_state>();
+ vulgus_state *state = space->machine().driver_data<vulgus_state>();
if (state->palette_bank != (data & 3))
{
state->palette_bank = data & 3;
@@ -171,9 +171,9 @@ WRITE8_HANDLER( vulgus_palette_bank_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- vulgus_state *state = machine->driver_data<vulgus_state>();
+ vulgus_state *state = machine.driver_data<vulgus_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -200,14 +200,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code + i,
col,
flip_screen_get(machine),flip_screen_get(machine),
sx, sy + 16 * i * dir,15);
/* draw again with wraparound */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code + i,
col,
flip_screen_get(machine),flip_screen_get(machine),
@@ -219,12 +219,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( vulgus )
{
- vulgus_state *state = screen->machine->driver_data<vulgus_state>();
+ vulgus_state *state = screen->machine().driver_data<vulgus_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_low[1] + 256 * state->scroll_high[1]);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_low[0] + 256 * state->scroll_high[0]);
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c
index 3be791d895c..f420dc86f1e 100644
--- a/src/mame/video/warpwarp.c
+++ b/src/mame/video/warpwarp.c
@@ -127,7 +127,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( geebee_get_tile_info )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
int code = state->geebee_videoram[tile_index];
int color = (state->geebee_bgw & 1) | ((code & 0x80) >> 6);
SET_TILE_INFO(
@@ -139,7 +139,7 @@ static TILE_GET_INFO( geebee_get_tile_info )
static TILE_GET_INFO( navarone_get_tile_info )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
int code = state->geebee_videoram[tile_index];
int color = state->geebee_bgw & 1;
SET_TILE_INFO(
@@ -151,7 +151,7 @@ static TILE_GET_INFO( navarone_get_tile_info )
static TILE_GET_INFO( warpwarp_get_tile_info )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
SET_TILE_INFO(
0,
state->videoram[tile_index],
@@ -169,19 +169,19 @@ static TILE_GET_INFO( warpwarp_get_tile_info )
VIDEO_START( geebee )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->bg_tilemap = tilemap_create(machine, geebee_get_tile_info,tilemap_scan,8,8,34,28);
}
VIDEO_START( navarone )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->bg_tilemap = tilemap_create(machine, navarone_get_tile_info,tilemap_scan,8,8,34,28);
}
VIDEO_START( warpwarp )
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
state->bg_tilemap = tilemap_create(machine, warpwarp_get_tile_info,tilemap_scan,8,8,34,28);
}
@@ -195,14 +195,14 @@ VIDEO_START( warpwarp )
WRITE8_HANDLER( geebee_videoram_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
state->geebee_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( warpwarp_videoram_w )
{
- warpwarp_state *state = space->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = space->machine().driver_data<warpwarp_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
@@ -221,9 +221,9 @@ INLINE void geebee_plot(bitmap_t *bitmap, const rectangle *cliprect, int x, int
*BITMAP_ADDR16(bitmap, y, x) = pen;
}
-static void draw_ball(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,pen_t pen)
+static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,pen_t pen)
{
- warpwarp_state *state = machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = machine.driver_data<warpwarp_state>();
if (state->ball_on)
{
int x = 256+8 - state->ball_h;
@@ -238,9 +238,9 @@ static void draw_ball(running_machine *machine, bitmap_t *bitmap, const rectangl
SCREEN_UPDATE( geebee )
{
- warpwarp_state *state = screen->machine->driver_data<warpwarp_state>();
+ warpwarp_state *state = screen->machine().driver_data<warpwarp_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_ball(screen->machine, bitmap, cliprect, state->ball_pen);
+ draw_ball(screen->machine(), bitmap, cliprect, state->ball_pen);
return 0;
}
diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c
index 6dc615e93c9..905ac7c89b7 100644
--- a/src/mame/video/warriorb.c
+++ b/src/mame/video/warriorb.c
@@ -6,7 +6,7 @@
VIDEO_START( warriorb )
{
- warriorb_state *state = machine->driver_data<warriorb_state>();
+ warriorb_state *state = machine.driver_data<warriorb_state>();
/* Ensure palette from correct TC0110PCR used for each screen */
tc0100scn_set_colbanks(state->tc0100scn_1, 0x0, 0x100, 0x0);
@@ -17,9 +17,9 @@ VIDEO_START( warriorb )
SPRITE DRAW ROUTINE
************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int x_offs, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x_offs, int y_offs )
{
- warriorb_state *state = machine->driver_data<warriorb_state>();
+ warriorb_state *state = machine.driver_data<warriorb_state>();
UINT16 *spriteram = state->spriteram;
int offs, data, data2, tilenum, color, flipx, flipy;
int x, y, priority, pri_mask;
@@ -65,12 +65,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (x > 0x3c0) x -= 0x400;
if (y > 0x180) y -= 0x200;
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[0],
tilenum,
color,
flipx,flipy,
x,y,
- machine->priority_bitmap,pri_mask,0);
+ machine.priority_bitmap,pri_mask,0);
}
#ifdef MAME_DEBUG
@@ -86,7 +86,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( warriorb )
{
- warriorb_state *state = screen->machine->driver_data<warriorb_state>();
+ warriorb_state *state = screen->machine().driver_data<warriorb_state>();
int xoffs = 0;
UINT8 layer[3], nodraw;
device_t *tc0100scn = NULL;
@@ -109,7 +109,7 @@ SCREEN_UPDATE( warriorb )
layer[2] = 2;
/* Clear priority bitmap */
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* chip 0 does tilemaps on the left, chip 1 does the ones on the right */
// draw bottom layer
@@ -117,13 +117,13 @@ SCREEN_UPDATE( warriorb )
/* Ensure screen blanked even when bottom layers not drawn due to disable bit */
if (nodraw)
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// draw middle layer
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1);
/* Sprites can be under/over the layer below text layer */
- draw_sprites(screen->machine, bitmap, cliprect, xoffs, 8); // draw sprites
+ draw_sprites(screen->machine(), bitmap, cliprect, xoffs, 8); // draw sprites
// draw top(text) layer
tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0);
diff --git a/src/mame/video/wc90.c b/src/mame/video/wc90.c
index 15b5136ddb2..e9016a38ce2 100644
--- a/src/mame/video/wc90.c
+++ b/src/mame/video/wc90.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
int attr = state->bgvideoram[tile_index];
int tile = state->bgvideoram[tile_index + 0x800] +
256 * ((attr & 3) + ((attr >> 1) & 4));
@@ -23,7 +23,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
int attr = state->fgvideoram[tile_index];
int tile = state->fgvideoram[tile_index + 0x800] +
256 * ((attr & 3) + ((attr >> 1) & 4));
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
SET_TILE_INFO(
0,
state->txvideoram[tile_index + 0x800] + ((state->txvideoram[tile_index] & 0x07) << 8),
@@ -46,7 +46,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( track_get_bg_tile_info )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
int attr = state->bgvideoram[tile_index];
int tile = state->bgvideoram[tile_index + 0x800] +
256 * (attr & 7);
@@ -59,7 +59,7 @@ static TILE_GET_INFO( track_get_bg_tile_info )
static TILE_GET_INFO( track_get_fg_tile_info )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
int attr = state->fgvideoram[tile_index];
int tile = state->fgvideoram[tile_index + 0x800] +
256 * (attr & 7);
@@ -79,7 +79,7 @@ static TILE_GET_INFO( track_get_fg_tile_info )
VIDEO_START( wc90 )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 16,16,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
@@ -90,7 +90,7 @@ VIDEO_START( wc90 )
VIDEO_START( wc90t )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
state->bg_tilemap = tilemap_create(machine, track_get_bg_tile_info,tilemap_scan_rows, 16,16,64,32);
state->fg_tilemap = tilemap_create(machine, track_get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
@@ -108,21 +108,21 @@ VIDEO_START( wc90t )
WRITE8_HANDLER( wc90_bgvideoram_w )
{
- wc90_state *state = space->machine->driver_data<wc90_state>();
+ wc90_state *state = space->machine().driver_data<wc90_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
}
WRITE8_HANDLER( wc90_fgvideoram_w )
{
- wc90_state *state = space->machine->driver_data<wc90_state>();
+ wc90_state *state = space->machine().driver_data<wc90_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x7ff);
}
WRITE8_HANDLER( wc90_txvideoram_w )
{
- wc90_state *state = space->machine->driver_data<wc90_state>();
+ wc90_state *state = space->machine().driver_data<wc90_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x7ff);
}
@@ -136,7 +136,7 @@ WRITE8_HANDLER( wc90_txvideoram_w )
***************************************************************************/
#define WC90_DRAW_SPRITE( code, sx, sy ) \
- drawgfx_transpen( bitmap, cliprect, machine->gfx[3], code, flags >> 4, \
+ drawgfx_transpen( bitmap, cliprect, machine.gfx[3], code, flags >> 4, \
bank&1, bank&2, sx, sy, 0 )
static const char p32x32[4][4] = {
@@ -167,12 +167,12 @@ static const char p64x64[4][16] = {
{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
};
-static void draw_sprite_16x16(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_16x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
WC90_DRAW_SPRITE( code, sx, sy );
}
-static void draw_sprite_16x32(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_16x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
if ( bank & 2 ) {
WC90_DRAW_SPRITE( code+1, sx, sy+16 );
@@ -183,7 +183,7 @@ static void draw_sprite_16x32(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void draw_sprite_16x64(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_16x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
if ( bank & 2 ) {
WC90_DRAW_SPRITE( code+3, sx, sy+48 );
@@ -198,7 +198,7 @@ static void draw_sprite_16x64(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void draw_sprite_32x16(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_32x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
if ( bank & 1 ) {
WC90_DRAW_SPRITE( code+1, sx+16, sy );
@@ -209,7 +209,7 @@ static void draw_sprite_32x16(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void draw_sprite_32x32(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_32x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
const char *p = p32x32[ bank&3 ];
@@ -220,7 +220,7 @@ static void draw_sprite_32x32(running_machine *machine, bitmap_t *bitmap, const
WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
}
-static void draw_sprite_32x64(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_32x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
const char *p = p32x64[ bank&3 ];
@@ -235,7 +235,7 @@ static void draw_sprite_32x64(running_machine *machine, bitmap_t *bitmap, const
WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 );
}
-static void draw_sprite_64x16(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_64x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
if ( bank & 1 ) {
WC90_DRAW_SPRITE( code+3, sx+48, sy );
@@ -250,7 +250,7 @@ static void draw_sprite_64x16(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void draw_sprite_64x32(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_64x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
const char *p = p64x32[ bank&3 ];
@@ -265,7 +265,7 @@ static void draw_sprite_64x32(running_machine *machine, bitmap_t *bitmap, const
WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
}
-static void draw_sprite_64x64(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_64x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
const char *p = p64x64[ bank&3 ];
@@ -289,12 +289,12 @@ static void draw_sprite_64x64(running_machine *machine, bitmap_t *bitmap, const
WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 );
}
-static void draw_sprite_invalid(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
+static void draw_sprite_invalid(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
int sx, int sy, int bank, int flags ) {
logerror("8 pixel sprite size not supported\n" );
}
-typedef void (*draw_sprites_func)(running_machine *, bitmap_t *, const rectangle *, int, int, int, int, int );
+typedef void (*draw_sprites_func)(running_machine &, bitmap_t *, const rectangle *, int, int, int, int, int );
static const draw_sprites_func draw_sprites_proc[16] = {
draw_sprite_invalid, /* 0000 = 08x08 */
@@ -315,9 +315,9 @@ static const draw_sprites_func draw_sprites_proc[16] = {
draw_sprite_64x64 /* 1111 = 64x64 */
};
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- wc90_state *state = machine->driver_data<wc90_state>();
+ wc90_state *state = machine.driver_data<wc90_state>();
UINT8 *spriteram = state->spriteram;
int offs, sx,sy, flags, which;
@@ -347,7 +347,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( wc90 )
{
- wc90_state *state = screen->machine->driver_data<wc90_state>();
+ wc90_state *state = screen->machine().driver_data<wc90_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->scroll2xlo[0] + 256 * state->scroll2xhi[0]);
tilemap_set_scrolly(state->bg_tilemap,0,state->scroll2ylo[0] + 256 * state->scroll2yhi[0]);
tilemap_set_scrollx(state->fg_tilemap,0,state->scroll1xlo[0] + 256 * state->scroll1xhi[0]);
@@ -355,12 +355,12 @@ SCREEN_UPDATE( wc90 )
tilemap_set_scrollx(state->tx_tilemap,0,state->scroll0xlo[0] + 256 * state->scroll0xhi[0]);
tilemap_set_scrolly(state->tx_tilemap,0,state->scroll0ylo[0] + 256 * state->scroll0yhi[0]);
-// draw_sprites(screen->machine, bitmap,cliprect, 3 );
+// draw_sprites(screen->machine(), bitmap,cliprect, 3 );
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 2 );
+ draw_sprites(screen->machine(), bitmap,cliprect, 2 );
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 1 );
+ draw_sprites(screen->machine(), bitmap,cliprect, 1 );
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 0 );
+ draw_sprites(screen->machine(), bitmap,cliprect, 0 );
return 0;
}
diff --git a/src/mame/video/wc90b.c b/src/mame/video/wc90b.c
index df6e42f3f3b..69a93e35029 100644
--- a/src/mame/video/wc90b.c
+++ b/src/mame/video/wc90b.c
@@ -10,7 +10,7 @@
static TILE_GET_INFO( get_bg_tile_info )
{
- wc90b_state *state = machine->driver_data<wc90b_state>();
+ wc90b_state *state = machine.driver_data<wc90b_state>();
int attr = state->bgvideoram[tile_index];
int tile = state->bgvideoram[tile_index + 0x800];
SET_TILE_INFO(
@@ -22,7 +22,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- wc90b_state *state = machine->driver_data<wc90b_state>();
+ wc90b_state *state = machine.driver_data<wc90b_state>();
int attr = state->fgvideoram[tile_index];
int tile = state->fgvideoram[tile_index + 0x800];
SET_TILE_INFO(
@@ -34,7 +34,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- wc90b_state *state = machine->driver_data<wc90b_state>();
+ wc90b_state *state = machine.driver_data<wc90b_state>();
SET_TILE_INFO(
0,
state->txvideoram[tile_index + 0x800] + ((state->txvideoram[tile_index] & 0x07) << 8),
@@ -52,7 +52,7 @@ static TILE_GET_INFO( get_tx_tile_info )
VIDEO_START( wc90b )
{
- wc90b_state *state = machine->driver_data<wc90b_state>();
+ wc90b_state *state = machine.driver_data<wc90b_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 16,16,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
@@ -71,21 +71,21 @@ VIDEO_START( wc90b )
WRITE8_HANDLER( wc90b_bgvideoram_w )
{
- wc90b_state *state = space->machine->driver_data<wc90b_state>();
+ wc90b_state *state = space->machine().driver_data<wc90b_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x7ff);
}
WRITE8_HANDLER( wc90b_fgvideoram_w )
{
- wc90b_state *state = space->machine->driver_data<wc90b_state>();
+ wc90b_state *state = space->machine().driver_data<wc90b_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x7ff);
}
WRITE8_HANDLER( wc90b_txvideoram_w )
{
- wc90b_state *state = space->machine->driver_data<wc90b_state>();
+ wc90b_state *state = space->machine().driver_data<wc90b_state>();
state->txvideoram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset & 0x7ff);
}
@@ -98,9 +98,9 @@ WRITE8_HANDLER( wc90b_txvideoram_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- wc90b_state *state = machine->driver_data<wc90b_state>();
+ wc90b_state *state = machine.driver_data<wc90b_state>();
UINT8 *spriteram = state->spriteram;
int offs, sx, sy;
@@ -122,7 +122,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = 240 - spriteram[offs + 1];
- drawgfx_transpen( bitmap, cliprect,machine->gfx[17], code,
+ drawgfx_transpen( bitmap, cliprect,machine.gfx[17], code,
flags >> 4, /* color */
bank & 1, /* flipx */
bank & 2, /* flipy */
@@ -134,7 +134,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( wc90b )
{
- wc90b_state *state = screen->machine->driver_data<wc90b_state>();
+ wc90b_state *state = screen->machine().driver_data<wc90b_state>();
tilemap_set_scrollx(state->bg_tilemap,0,8 * (state->scroll2x[0] & 0x7f) + 256 - 4 + (state->scroll_x_lo[0] & 0x07));
tilemap_set_scrolly(state->bg_tilemap,0,state->scroll2y[0] + 1 + ((state->scroll2x[0] & 0x80) ? 256 : 0));
tilemap_set_scrollx(state->fg_tilemap,0,8 * (state->scroll1x[0] & 0x7f) + 256 - 6 + ((state->scroll_x_lo[0] & 0x38) >> 3));
@@ -142,8 +142,8 @@ SCREEN_UPDATE( wc90b )
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 1 );
+ draw_sprites(screen->machine(), bitmap,cliprect, 1 );
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect, 0 );
+ draw_sprites(screen->machine(), bitmap,cliprect, 0 );
return 0;
}
diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c
index bcb0ddde3fa..0cc5bb4572e 100644
--- a/src/mame/video/wecleman.c
+++ b/src/mame/video/wecleman.c
@@ -73,12 +73,12 @@ struct sprite
***************************************************************************/
-static void get_sprite_info(running_machine *machine)
+static void get_sprite_info(running_machine &machine)
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
- const pen_t *base_pal = machine->pens;
- UINT8 *base_gfx = machine->region("gfx1")->base();
- int gfx_max = machine->region("gfx1")->bytes();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
+ const pen_t *base_pal = machine.pens;
+ UINT8 *base_gfx = machine.region("gfx1")->base();
+ int gfx_max = machine.region("gfx1")->bytes();
UINT16 *source = state->spriteram;
@@ -330,9 +330,9 @@ static void do_blit_zoom32(wecleman_state *state, bitmap_t *bitmap, const rectan
}
}
-static void sprite_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
int i;
if (state->gameid == 0) // Wec Le Mans
@@ -419,14 +419,14 @@ static void sprite_draw(running_machine *machine, bitmap_t *bitmap, const rectan
static TILE_GET_INFO( wecleman_get_txt_tile_info )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
int code = state->txtram[tile_index];
SET_TILE_INFO(PAGE_GFX, code&0xfff, (code>>5&0x78)+(code>>12), 0);
}
WRITE16_HANDLER( wecleman_txtram_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
UINT16 old_data = state->txtram[offset];
UINT16 new_data = COMBINE_DATA(&state->txtram[offset]);
@@ -467,7 +467,7 @@ WRITE16_HANDLER( wecleman_txtram_w )
static TILE_GET_INFO( wecleman_get_bg_tile_info )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
int page = state->bgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)];
int code = state->pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
@@ -480,7 +480,7 @@ static TILE_GET_INFO( wecleman_get_bg_tile_info )
static TILE_GET_INFO( wecleman_get_fg_tile_info )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
int page = state->fgpage[((tile_index&0x7f)>>6) + ((tile_index>>12)<<1)];
int code = state->pageram[(tile_index&0x3f) + ((tile_index>>7&0x1f)<<6) + (page<<11)];
@@ -495,7 +495,7 @@ static TILE_GET_INFO( wecleman_get_fg_tile_info )
/* Pages that compose both the background and the foreground */
WRITE16_HANDLER( wecleman_pageram_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
COMBINE_DATA(&state->pageram[offset]);
{
@@ -539,9 +539,9 @@ WRITE16_HANDLER( wecleman_pageram_w )
------------------------------------------------------------------------*/
-static void wecleman_draw_road(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void wecleman_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
// must be powers of 2
#define XSIZE 512
#define YSIZE 256
@@ -571,7 +571,7 @@ static void wecleman_draw_road(running_machine *machine, bitmap_t *bitmap, const
int scrollx, sy, sx;
int mdy, tdy, i;
- rgb_ptr = machine->pens;
+ rgb_ptr = machine.pens;
if (priority == 0x02)
{
@@ -612,14 +612,14 @@ static void wecleman_draw_road(running_machine *machine, bitmap_t *bitmap, const
if ((road>>8) != 0x04) continue;
road &= YMASK;
- src_ptr = gfx_element_get_data(machine->gfx[1], (road << 3));
- gfx_element_get_data(machine->gfx[1], (road << 3) + 1);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 2);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 3);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 4);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 5);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 6);
- gfx_element_get_data(machine->gfx[1], (road << 3) + 7);
+ src_ptr = gfx_element_get_data(machine.gfx[1], (road << 3));
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 1);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 2);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 3);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 4);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 5);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 6);
+ gfx_element_get_data(machine.gfx[1], (road << 3) + 7);
mdy = ((road * MIDCURB_DY) >> 8) * bitmap->rowpixels;
tdy = ((road * TOPCURB_DY) >> 8) * bitmap->rowpixels;
@@ -666,7 +666,7 @@ static void draw_cloud(bitmap_t *bitmap,
int tmw_l2, int tmh_l2, // tilemap width and height in log(2)
int alpha, int pal_offset ) // alpha(0-3f), # of color codes to shift
{
- wecleman_state *state = gfx->machine->driver_data<wecleman_state>();
+ wecleman_state *state = gfx->machine().driver_data<wecleman_state>();
const UINT8 *src_ptr;
UINT16 *tmap_ptr;
UINT32 *dst_base, *dst_ptr;
@@ -695,7 +695,7 @@ static void draw_cloud(bitmap_t *bitmap,
dst_base = BITMAP_ADDR32(bitmap, y0+dy, x0+dx);
- pal_base = gfx->machine->pens + pal_offset * gfx->color_granularity;
+ pal_base = gfx->machine().pens + pal_offset * gfx->color_granularity;
alpha <<= 6;
@@ -792,15 +792,15 @@ static void draw_cloud(bitmap_t *bitmap,
------------------------------------------------------------------------*/
-static void hotchase_draw_road(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void hotchase_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
/* Referred to what's in the ROMs */
#define XSIZE 512
#define YSIZE 512
int sx, sy;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/* Let's draw from the top to the bottom of the visible screen */
for (sy = visarea.min_y;sy <= visarea.max_y;sy++)
@@ -816,7 +816,7 @@ static void hotchase_draw_road(running_machine *machine, bitmap_t *bitmap, const
for (sx=0; sx<2*XSIZE; sx+=64)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code++,
color,
0,0,
@@ -836,7 +836,7 @@ static void hotchase_draw_road(running_machine *machine, bitmap_t *bitmap, const
// new video and palette code
WRITE16_HANDLER( wecleman_videostatus_w )
{
- wecleman_state *state = space->machine->driver_data<wecleman_state>();
+ wecleman_state *state = space->machine().driver_data<wecleman_state>();
COMBINE_DATA(state->videostatus);
// bit0-6: background transition, 0=off, 1=on
@@ -859,24 +859,24 @@ WRITE16_HANDLER( hotchase_paletteram16_SBGRBBBBGGGGRRRR_word_w )
{
int newword, r, g, b;
- newword = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ newword = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
r = ((newword << 1) & 0x1E ) | ((newword >> 12) & 0x01);
g = ((newword >> 3) & 0x1E ) | ((newword >> 13) & 0x01);
b = ((newword >> 7) & 0x1E ) | ((newword >> 14) & 0x01);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
r>>=1; g>>=1; b>>=1;
- palette_set_color_rgb(space->machine, offset+0x800, pal5bit(r)/2, pal5bit(g)/2, pal5bit(b)/2);
+ palette_set_color_rgb(space->machine(), offset+0x800, pal5bit(r)/2, pal5bit(g)/2, pal5bit(b)/2);
}
WRITE16_HANDLER( wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w )
{
- int newword = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ int newword = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
// the highest nibble has some unknown functions
// if (newword & 0xf000) logerror("MSN set on color %03x: %1x\n", offset, newword>>12);
- palette_set_color_rgb(space->machine, offset, pal4bit(newword >> 0), pal4bit(newword >> 4), pal4bit(newword >> 8));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(newword >> 0), pal4bit(newword >> 4), pal4bit(newword >> 8));
}
@@ -886,7 +886,7 @@ WRITE16_HANDLER( wecleman_paletteram16_SSSSBBBBGGGGRRRR_word_w )
VIDEO_START( wecleman )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
/*
Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
This game has ROMs for 16 banks
@@ -902,7 +902,7 @@ VIDEO_START( wecleman )
UINT8 *buffer;
int i, j;
- assert(machine->primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
buffer = auto_alloc_array(machine, UINT8, 0x12c00); // working buffer for sprite operations
state->gameid = 0;
@@ -970,18 +970,18 @@ VIDEO_START( wecleman )
tilemap_set_scrolly(state->txt_tilemap, 0, -BMP_PAD );
// patches out a mysterious pixel floating in the sky (tile decoding bug?)
- *(machine->gfx[0]->gfxdata + (machine->gfx[0]->char_modulo*0xaca+7)) = 0;
+ *(machine.gfx[0]->gfxdata + (machine.gfx[0]->char_modulo*0xaca+7)) = 0;
}
// Callbacks for the K051316
-void hotchase_zoom_callback_0(running_machine *machine, int *code,int *color,int *flags)
+void hotchase_zoom_callback_0(running_machine &machine, int *code,int *color,int *flags)
{
*code |= (*color & 0x03) << 8;
*color = (*color & 0xfc) >> 2;
}
-void hotchase_zoom_callback_1(running_machine *machine, int *code,int *color,int *flags)
+void hotchase_zoom_callback_1(running_machine &machine, int *code,int *color,int *flags)
{
*code |= (*color & 0x01) << 8;
*color = ((*color & 0x3f) << 1) | ((*code & 0x80) >> 7);
@@ -989,7 +989,7 @@ void hotchase_zoom_callback_1(running_machine *machine, int *code,int *color,int
VIDEO_START( hotchase )
{
- wecleman_state *state = machine->driver_data<wecleman_state>();
+ wecleman_state *state = machine.driver_data<wecleman_state>();
/*
Sprite banking - each bank is 0x20000 bytes (we support 0x40 bank codes)
This game has ROMs for 0x30 banks
@@ -1024,18 +1024,18 @@ VIDEO_START( hotchase )
SCREEN_UPDATE( wecleman )
{
- wecleman_state *state = screen->machine->driver_data<wecleman_state>();
+ wecleman_state *state = screen->machine().driver_data<wecleman_state>();
const pen_t *mrct;
int video_on;
int fg_x, bg_x, fg_y, bg_y;
int cloud_sx, cloud_sy;
int i, j, k;
- mrct = screen->machine->pens;
+ mrct = screen->machine().pens;
video_on = state->irqctrl & 0x40;
- set_led_status(screen->machine, 0, state->selected_ip & 0x04); // Start lamp
+ set_led_status(screen->machine(), 0, state->selected_ip & 0x04); // Start lamp
fg_y = (state->txtram[0x0f24>>1] & (TILEMAP_DIMY - 1));
bg_y = (state->txtram[0x0f26>>1] & (TILEMAP_DIMY - 1));
@@ -1063,12 +1063,12 @@ SCREEN_UPDATE( wecleman )
/* palette hacks! */
((pen_t *)mrct)[0x27] = mrct[0x24];
- get_sprite_info(screen->machine);
+ get_sprite_info(screen->machine());
bitmap_fill(bitmap, cliprect, state->black_pen);
/* Draw the road (lines which have priority 0x02) */
- if (video_on) wecleman_draw_road(screen->machine, bitmap, cliprect, 0x02);
+ if (video_on) wecleman_draw_road(screen->machine(), bitmap, cliprect, 0x02);
/* Draw the background */
if (video_on) tilemap_draw(bitmap,cliprect, state->bg_tilemap, 0, 0);
@@ -1082,7 +1082,7 @@ SCREEN_UPDATE( wecleman )
if (video_on)
draw_cloud(
bitmap,
- screen->machine->gfx[0],
+ screen->machine().gfx[0],
state->pageram+0x1800,
BMP_PAD, BMP_PAD,
41, 20,
@@ -1102,10 +1102,10 @@ SCREEN_UPDATE( wecleman )
if (video_on) tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0, 0);
/* Draw the road (lines which have priority 0x04) */
- if (video_on) wecleman_draw_road(screen->machine, bitmap,cliprect, 0x04);
+ if (video_on) wecleman_draw_road(screen->machine(), bitmap,cliprect, 0x04);
/* Draw the sprites */
- if (video_on) sprite_draw(screen->machine, bitmap,cliprect);
+ if (video_on) sprite_draw(screen->machine(), bitmap,cliprect);
/* Draw the text layer */
if (video_on) tilemap_draw(bitmap,cliprect, state->txt_tilemap, 0, 0);
@@ -1118,16 +1118,16 @@ SCREEN_UPDATE( wecleman )
SCREEN_UPDATE( hotchase )
{
- wecleman_state *state = screen->machine->driver_data<wecleman_state>();
- device_t *k051316_1 = screen->machine->device("k051316_1");
- device_t *k051316_2 = screen->machine->device("k051316_2");
+ wecleman_state *state = screen->machine().driver_data<wecleman_state>();
+ device_t *k051316_1 = screen->machine().device("k051316_1");
+ device_t *k051316_2 = screen->machine().device("k051316_2");
int video_on;
video_on = state->irqctrl & 0x40;
- set_led_status(screen->machine, 0, state->selected_ip & 0x04); // Start lamp
+ set_led_status(screen->machine(), 0, state->selected_ip & 0x04); // Start lamp
- get_sprite_info(screen->machine);
+ get_sprite_info(screen->machine());
bitmap_fill(bitmap, cliprect, state->black_pen);
@@ -1137,11 +1137,11 @@ SCREEN_UPDATE( hotchase )
/* Draw the road */
if (video_on)
- hotchase_draw_road(screen->machine, bitmap, cliprect);
+ hotchase_draw_road(screen->machine(), bitmap, cliprect);
/* Draw the sprites */
if (video_on)
- sprite_draw(screen->machine, bitmap,cliprect);
+ sprite_draw(screen->machine(), bitmap,cliprect);
/* Draw the foreground (text) */
if (video_on)
diff --git a/src/mame/video/welltris.c b/src/mame/video/welltris.c
index 1f408fc6abf..da2c300ed4a 100644
--- a/src/mame/video/welltris.c
+++ b/src/mame/video/welltris.c
@@ -13,7 +13,7 @@ READ16_HANDLER( welltris_spriteram_r )
WRITE16_HANDLER( welltris_spriteram_w )
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
int offs;
COMBINE_DATA(&state->spriteram[offset]);
@@ -29,12 +29,12 @@ WRITE16_HANDLER( welltris_spriteram_w )
/* Sprite Drawing is pretty much the same as fromance.c */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
- welltris_state *state = machine->driver_data<welltris_state>();
+ welltris_state *state = machine.driver_data<welltris_state>();
int offs;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/* draw the sprites */
for (offs = 0; offs < 0x200 - 4; offs += 4) {
@@ -70,10 +70,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (yt = 0; yt < ytiles; yt++) {
for (xt = 0; xt < xtiles; xt++, code++) {
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, 0, 0,
x + xt * 16, y + yt * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0,
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], code, color, 0, 0,
x + xt * xzoom, y + yt * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -89,10 +89,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (yt = 0; yt < ytiles; yt++) {
for (xt = 0; xt < xtiles; xt++, code++) {
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 0,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, 1, 0,
x + (xtiles - 1 - xt) * 16, y + yt * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 0,
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], code, color, 1, 0,
x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -108,10 +108,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (yt = 0; yt < ytiles; yt++) {
for (xt = 0; xt < xtiles; xt++, code++) {
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 1,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, 0, 1,
x + xt * 16, y + (ytiles - 1 - yt) * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 1,
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], code, color, 0, 1,
x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -127,10 +127,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
for (yt = 0; yt < ytiles; yt++) {
for (xt = 0; xt < xtiles; xt++, code++) {
if (!zoomed)
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 1,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, 1, 1,
x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, 15);
else
- drawgfxzoom_transpen(bitmap, cliprect, machine->gfx[1], code, color, 1, 1,
+ drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], code, color, 1, 1,
x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom,
0x1000 * xzoom, 0x1000 * yzoom, 15);
}
@@ -159,7 +159,7 @@ WRITE16_HANDLER( welltris_palette_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
if (state->charpalettebank != (data & 0x03))
{
@@ -167,7 +167,7 @@ WRITE16_HANDLER( welltris_palette_bank_w )
tilemap_mark_all_tiles_dirty(state->char_tilemap);
}
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
state->spritepalettebank = (data & 0x20) >> 5;
state->pixelpalettebank = (data & 0x08) >> 3;
@@ -178,7 +178,7 @@ WRITE16_HANDLER( welltris_gfxbank_w )
{
if (ACCESSING_BITS_0_7)
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
setbank(state, 0, (data & 0xf0) >> 4);
setbank(state, 1, data & 0x0f);
@@ -187,7 +187,7 @@ WRITE16_HANDLER( welltris_gfxbank_w )
WRITE16_HANDLER( welltris_scrollreg_w )
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
switch (offset) {
case 0: state->scrollx = data - 14; break;
@@ -197,7 +197,7 @@ WRITE16_HANDLER( welltris_scrollreg_w )
static TILE_GET_INFO( get_welltris_tile_info )
{
- welltris_state *state = machine->driver_data<welltris_state>();
+ welltris_state *state = machine.driver_data<welltris_state>();
UINT16 code = state->charvideoram[tile_index];
int bank = (code & 0x1000) >> 12;
@@ -210,7 +210,7 @@ static TILE_GET_INFO( get_welltris_tile_info )
WRITE16_HANDLER( welltris_charvideoram_w )
{
- welltris_state *state = space->machine->driver_data<welltris_state>();
+ welltris_state *state = space->machine().driver_data<welltris_state>();
COMBINE_DATA(&state->charvideoram[offset]);
tilemap_mark_tile_dirty(state->char_tilemap, offset);
@@ -218,15 +218,15 @@ WRITE16_HANDLER( welltris_charvideoram_w )
VIDEO_START( welltris )
{
- welltris_state *state = machine->driver_data<welltris_state>();
+ welltris_state *state = machine.driver_data<welltris_state>();
state->char_tilemap = tilemap_create(machine, get_welltris_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->char_tilemap, 15);
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- welltris_state *state = machine->driver_data<welltris_state>();
+ welltris_state *state = machine.driver_data<welltris_state>();
int x, y;
int pixdata;
@@ -242,12 +242,12 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
SCREEN_UPDATE( welltris )
{
- welltris_state *state = screen->machine->driver_data<welltris_state>();
+ welltris_state *state = screen->machine().driver_data<welltris_state>();
tilemap_set_scrollx(state->char_tilemap, 0, state->scrollx);
tilemap_set_scrolly(state->char_tilemap, 0, state->scrolly);
- draw_background(screen->machine, bitmap, cliprect);
+ draw_background(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->char_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c
index c2e1a3a640e..105a7ae0997 100644
--- a/src/mame/video/wgp.c
+++ b/src/mame/video/wgp.c
@@ -5,9 +5,9 @@
/*******************************************************************/
-INLINE void common_get_piv_tile_info( running_machine *machine, tile_data *tileinfo, int tile_index, int num )
+INLINE void common_get_piv_tile_info( running_machine &machine, tile_data *tileinfo, int tile_index, int num )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
UINT16 tilenum = state->pivram[tile_index + num * 0x1000]; /* 3 blocks of $2000 */
UINT16 attr = state->pivram[tile_index + num * 0x1000 + 0x8000]; /* 3 blocks of $2000 */
@@ -34,9 +34,9 @@ static TILE_GET_INFO( get_piv2_tile_info )
}
-static void wgp_core_vh_start( running_machine *machine, int piv_xoffs, int piv_yoffs )
+static void wgp_core_vh_start( running_machine &machine, int piv_xoffs, int piv_yoffs )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
state->piv_tilemap[0] = tilemap_create(machine, get_piv0_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->piv_tilemap[1] = tilemap_create(machine, get_piv1_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
@@ -124,13 +124,13 @@ custom chip capable of four rather than three tilemaps.)
READ16_HANDLER( wgp_pivram_word_r )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
return state->pivram[offset];
}
WRITE16_HANDLER( wgp_pivram_word_w )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
COMBINE_DATA(&state->pivram[offset]);
@@ -150,13 +150,13 @@ WRITE16_HANDLER( wgp_pivram_word_w )
READ16_HANDLER( wgp_piv_ctrl_word_r )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
return state->piv_ctrlram[offset];
}
WRITE16_HANDLER( wgp_piv_ctrl_word_w )
{
- wgp_state *state = space->machine->driver_data<wgp_state>();
+ wgp_state *state = space->machine().driver_data<wgp_state>();
UINT16 a, b;
COMBINE_DATA(&state->piv_ctrlram[offset]);
@@ -346,9 +346,9 @@ static const UINT8 ylookup[16] =
2, 2, 3, 3,
2, 2, 3, 3 };
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
UINT16 *spriteram = state->spriteram;
int offs, i, j, k;
int x, y, curx, cury;
@@ -356,7 +356,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
UINT8 small_sprite, col, flipx, flipy;
UINT16 code, bigsprite, map_index;
UINT16 rotate = 0;
- UINT16 tile_mask = (machine->gfx[0]->total_elements) - 1;
+ UINT16 tile_mask = (machine.gfx[0]->total_elements) - 1;
static const int primasks[2] = {0x0, 0xfffc}; /* fff0 => under rhs of road only */
for (offs = 0x1ff; offs >= 0; offs--)
@@ -428,13 +428,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
zx = x + (((k + 1) * zoomx) / 2) - curx;
zy = y + (((j + 1) * zoomy) / 2) - cury;
- pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap, cliprect,machine.gfx[0],
code,
col,
flipx, flipy,
curx,cury,
zx << 12, zy << 12,
- machine->priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */
+ machine.priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */
}
}
else
@@ -459,13 +459,13 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
zx = x + (((k + 1) * zoomx) / 4) - curx;
zy = y + (((j + 1) * zoomy) / 4) - cury;
- pdrawgfxzoom_transpen(bitmap, cliprect,machine->gfx[0],
+ pdrawgfxzoom_transpen(bitmap, cliprect,machine.gfx[0],
code,
col,
flipx, flipy,
curx,cury,
zx << 12, zy << 12,
- machine->priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */
+ machine.priority_bitmap,primasks[((priority >> 1) &1)],0); /* maybe >> 2 or 0...? */
}
}
}
@@ -518,9 +518,9 @@ INLINE void bryan2_drawscanline( bitmap_t *bitmap, int x, int y, int length,
-static void wgp_piv_layer_draw( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
+static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
{
- wgp_state *state = machine->driver_data<wgp_state>();
+ wgp_state *state = machine.driver_data<wgp_state>();
bitmap_t *srcbitmap = tilemap_get_pixmap(state->piv_tilemap[layer]);
bitmap_t *flagsbitmap = tilemap_get_flagsmap(state->piv_tilemap[layer]);
@@ -628,7 +628,7 @@ static void wgp_piv_layer_draw( running_machine *machine, bitmap_t *bitmap, cons
}
}
- bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine->priority_bitmap, priority);
+ bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, machine.priority_bitmap, priority);
y_index += zoomy;
if (!machine_flip) y++; else y--;
@@ -645,30 +645,30 @@ static void wgp_piv_layer_draw( running_machine *machine, bitmap_t *bitmap, cons
SCREEN_UPDATE( wgp )
{
- wgp_state *state = screen->machine->driver_data<wgp_state>();
+ wgp_state *state = screen->machine().driver_data<wgp_state>();
int i;
UINT8 layer[3];
#ifdef MAME_DEBUG
- if (input_code_pressed_once (screen->machine, KEYCODE_V))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_V))
{
state->dislayer[0] ^= 1;
popmessage("piv0: %01x",state->dislayer[0]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_B))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_B))
{
state->dislayer[1] ^= 1;
popmessage("piv1: %01x",state->dislayer[1]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_N))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_N))
{
state->dislayer[2] ^= 1;
popmessage("piv2: %01x",state->dislayer[2]);
}
- if (input_code_pressed_once (screen->machine, KEYCODE_M))
+ if (input_code_pressed_once (screen->machine(), KEYCODE_M))
{
state->dislayer[3] ^= 1;
popmessage("TC0100SCN top bg layer: %01x",state->dislayer[3]);
@@ -700,19 +700,19 @@ SCREEN_UPDATE( wgp )
#ifdef MAME_DEBUG
if (state->dislayer[layer[0]] == 0)
#endif
- wgp_piv_layer_draw(screen->machine, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
+ wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
#ifdef MAME_DEBUG
if (state->dislayer[layer[1]] == 0)
#endif
- wgp_piv_layer_draw(screen->machine, bitmap, cliprect, layer[1], 0, 2);
+ wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[1], 0, 2);
#ifdef MAME_DEBUG
if (state->dislayer[layer[2]] == 0)
#endif
- wgp_piv_layer_draw(screen->machine, bitmap, cliprect, layer[2], 0, 4);
+ wgp_piv_layer_draw(screen->machine(), bitmap, cliprect, layer[2], 0, 4);
- draw_sprites(screen->machine, bitmap, cliprect, 16);
+ draw_sprites(screen->machine(), bitmap, cliprect, 16);
/* ... then here we should apply rotation from wgp_sate_ctrl[] to the bitmap before we draw the TC0100SCN layers on it */
layer[0] = tc0100scn_bottomlayer(state->tc0100scn);
diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c
index 0f5e48d5515..a6a466c1b52 100644
--- a/src/mame/video/williams.c
+++ b/src/mame/video/williams.c
@@ -103,8 +103,8 @@
*
*************************************/
-static void blitter_init(running_machine *machine, int blitter_config, const UINT8 *remap_prom);
-static void create_palette_lookup(running_machine *machine);
+static void blitter_init(running_machine &machine, int blitter_config, const UINT8 *remap_prom);
+static void create_palette_lookup(running_machine &machine);
static TILE_GET_INFO( get_tile_info );
static int blitter_core(address_space *space, int sstart, int dstart, int w, int h, int data);
@@ -116,9 +116,9 @@ static int blitter_core(address_space *space, int sstart, int dstart, int w, int
*
*************************************/
-static void state_save_register(running_machine *machine)
+static void state_save_register(running_machine &machine)
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
state_save_register_global(machine, state->blitter_window_enable);
state_save_register_global(machine, state->cocktail);
state_save_register_global_array(machine, state->blitterram);
@@ -132,7 +132,7 @@ static void state_save_register(running_machine *machine)
VIDEO_START( williams )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
blitter_init(machine, state->blitter_config, NULL);
create_palette_lookup(machine);
state_save_register(machine);
@@ -141,8 +141,8 @@ VIDEO_START( williams )
VIDEO_START( blaster )
{
- williams_state *state = machine->driver_data<williams_state>();
- blitter_init(machine, state->blitter_config, machine->region("proms")->base());
+ williams_state *state = machine.driver_data<williams_state>();
+ blitter_init(machine, state->blitter_config, machine.region("proms")->base());
create_palette_lookup(machine);
state_save_register(machine);
}
@@ -150,12 +150,12 @@ VIDEO_START( blaster )
VIDEO_START( williams2 )
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
blitter_init(machine, state->blitter_config, NULL);
/* allocate paletteram */
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400 * 2);
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x400 * 2);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x400 * 2);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x400 * 2);
/* create the tilemap */
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_cols, 24,16, 128,16);
@@ -174,13 +174,13 @@ VIDEO_START( williams2 )
SCREEN_UPDATE( williams )
{
- williams_state *state = screen->machine->driver_data<williams_state>();
+ williams_state *state = screen->machine().driver_data<williams_state>();
rgb_t pens[16];
int x, y;
/* precompute the palette */
for (x = 0; x < 16; x++)
- pens[x] = state->palette_lookup[screen->machine->generic.paletteram.u8[x]];
+ pens[x] = state->palette_lookup[screen->machine().generic.paletteram.u8[x]];
/* loop over rows */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -202,13 +202,13 @@ SCREEN_UPDATE( williams )
SCREEN_UPDATE( blaster )
{
- williams_state *state = screen->machine->driver_data<williams_state>();
+ williams_state *state = screen->machine().driver_data<williams_state>();
rgb_t pens[16];
int x, y;
/* precompute the palette */
for (x = 0; x < 16; x++)
- pens[x] = state->palette_lookup[screen->machine->generic.paletteram.u8[x]];
+ pens[x] = state->palette_lookup[screen->machine().generic.paletteram.u8[x]];
/* if we're blitting from the top, start with a 0 for color 0 */
if (cliprect->min_y == screen->visible_area().min_y || !(state->blaster_video_control & 1))
@@ -245,7 +245,7 @@ SCREEN_UPDATE( blaster )
SCREEN_UPDATE( williams2 )
{
- williams_state *state = screen->machine->driver_data<williams_state>();
+ williams_state *state = screen->machine().driver_data<williams_state>();
rgb_t pens[16];
int x, y;
@@ -254,7 +254,7 @@ SCREEN_UPDATE( williams2 )
/* fetch the relevant pens */
for (x = 1; x < 16; x++)
- pens[x] = palette_get_color(screen->machine, state->williams2_fg_color * 16 + x);
+ pens[x] = palette_get_color(screen->machine(), state->williams2_fg_color * 16 + x);
/* loop over rows */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -284,9 +284,9 @@ SCREEN_UPDATE( williams2 )
*
*************************************/
-static void create_palette_lookup(running_machine *machine)
+static void create_palette_lookup(running_machine &machine)
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
static const int resistances_rg[3] = { 1200, 560, 330 };
static const int resistances_b[2] = { 560, 330 };
double weights_r[3], weights_g[3], weights_b[2];
@@ -323,24 +323,24 @@ WRITE8_HANDLER( williams2_paletteram_w )
UINT8 entry_lo, entry_hi, i, r, g, b;
/* set the new value */
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
/* pull the associated low/high bytes */
- entry_lo = space->machine->generic.paletteram.u8[offset & ~1];
- entry_hi = space->machine->generic.paletteram.u8[offset | 1];
+ entry_lo = space->machine().generic.paletteram.u8[offset & ~1];
+ entry_hi = space->machine().generic.paletteram.u8[offset | 1];
/* update the palette entry */
i = ztable[(entry_hi >> 4) & 15];
b = ((entry_hi >> 0) & 15) * i;
g = ((entry_lo >> 4) & 15) * i;
r = ((entry_lo >> 0) & 15) * i;
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r, g, b));
}
WRITE8_HANDLER( williams2_fg_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->williams2_fg_color = data & 0x3f;
}
@@ -354,13 +354,13 @@ WRITE8_HANDLER( williams2_fg_select_w )
READ8_HANDLER( williams_video_counter_r )
{
- return space->machine->primary_screen->vpos() & 0xfc;
+ return space->machine().primary_screen->vpos() & 0xfc;
}
READ8_HANDLER( williams2_video_counter_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -373,8 +373,8 @@ READ8_HANDLER( williams2_video_counter_r )
static TILE_GET_INFO( get_tile_info )
{
- williams_state *state = machine->driver_data<williams_state>();
- int mask = machine->gfx[0]->total_elements - 1;
+ williams_state *state = machine.driver_data<williams_state>();
+ int mask = machine.gfx[0]->total_elements - 1;
int data = state->williams2_tileram[tile_index];
int y = (tile_index >> 1) & 7;
int color = 0;
@@ -408,7 +408,7 @@ static TILE_GET_INFO( get_tile_info )
WRITE8_HANDLER( williams2_bg_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* based on the tilemap config, only certain bits are used */
/* the rest are determined by other factors */
switch (state->williams2_tilemap_config)
@@ -434,7 +434,7 @@ WRITE8_HANDLER( williams2_bg_select_w )
WRITE8_HANDLER( williams2_tileram_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->williams2_tileram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -442,7 +442,7 @@ WRITE8_HANDLER( williams2_tileram_w )
WRITE8_HANDLER( williams2_xscroll_low_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->tilemap_xscroll = (state->tilemap_xscroll & ~0x00f) | ((data & 0x80) >> 4) | (data & 0x07);
tilemap_set_scrollx(state->bg_tilemap, 0, (state->tilemap_xscroll & 7) + ((state->tilemap_xscroll >> 3) * 6));
}
@@ -450,7 +450,7 @@ WRITE8_HANDLER( williams2_xscroll_low_w )
WRITE8_HANDLER( williams2_xscroll_high_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->tilemap_xscroll = (state->tilemap_xscroll & 0x00f) | (data << 4);
tilemap_set_scrollx(state->bg_tilemap, 0, (state->tilemap_xscroll & 7) + ((state->tilemap_xscroll >> 3) * 6));
}
@@ -465,7 +465,7 @@ WRITE8_HANDLER( williams2_xscroll_high_w )
WRITE8_HANDLER( blaster_remap_select_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->blitter_remap_index = data;
state->blitter_remap = state->blitter_remap_lookup + data * 256;
}
@@ -473,7 +473,7 @@ WRITE8_HANDLER( blaster_remap_select_w )
WRITE8_HANDLER( blaster_video_control_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->blaster_video_control = data;
}
@@ -485,9 +485,9 @@ WRITE8_HANDLER( blaster_video_control_w )
*
*************************************/
-static void blitter_init(running_machine *machine, int blitter_config, const UINT8 *remap_prom)
+static void blitter_init(running_machine &machine, int blitter_config, const UINT8 *remap_prom)
{
- williams_state *state = machine->driver_data<williams_state>();
+ williams_state *state = machine.driver_data<williams_state>();
static const UINT8 dummy_table[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
int i,j;
@@ -512,7 +512,7 @@ static void blitter_init(running_machine *machine, int blitter_config, const UIN
WRITE8_HANDLER( williams_blitter_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
int sstart, dstart, w, h, accesses;
int estimated_clocks_at_4MHz;
@@ -547,7 +547,7 @@ WRITE8_HANDLER( williams_blitter_w )
/* Log blits */
logerror("%04X:Blit @ %3d : %02X%02X -> %02X%02X, %3dx%3d, mask=%02X, flags=%02X, icount=%d, win=%d\n",
- cpu_get_pc(space->cpu), space->machine->primary_screen->vpos(),
+ cpu_get_pc(space->cpu), space->machine().primary_screen->vpos(),
state->blitterram[2], state->blitterram[3],
state->blitterram[4], state->blitterram[5],
state->blitterram[6], state->blitterram[7],
@@ -558,7 +558,7 @@ WRITE8_HANDLER( williams_blitter_w )
WRITE8_HANDLER( williams2_blit_window_enable_w )
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
state->blitter_window_enable = data & 0x01;
}
@@ -572,7 +572,7 @@ WRITE8_HANDLER( williams2_blit_window_enable_w )
INLINE void blit_pixel(address_space *space, int offset, int srcdata, int data, int mask, int solid)
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
/* always read from video RAM regardless of the bank setting */
int pix = (offset < 0xc000) ? state->videoram[offset] : space->read_byte(offset);
@@ -600,7 +600,7 @@ INLINE void blit_pixel(address_space *space, int offset, int srcdata, int data,
static int blitter_core(address_space *space, int sstart, int dstart, int w, int h, int data)
{
- williams_state *state = space->machine->driver_data<williams_state>();
+ williams_state *state = space->machine().driver_data<williams_state>();
int source, sxadv, syadv;
int dest, dxadv, dyadv;
int i, j, solid;
diff --git a/src/mame/video/wiping.c b/src/mame/video/wiping.c
index f22287868d0..ecd482c27d8 100644
--- a/src/mame/video/wiping.c
+++ b/src/mame/video/wiping.c
@@ -31,7 +31,7 @@ PALETTE_INIT( wiping )
2, &resistances_b[0], bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -56,7 +56,7 @@ PALETTE_INIT( wiping )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -66,14 +66,14 @@ PALETTE_INIT( wiping )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i ^ 0x03] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
/* sprites use colors 16-31 */
for (i = 0x100; i < 0x200; i++)
{
UINT8 ctabentry = (color_prom[i ^ 0x03] & 0x0f) | 0x10;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
@@ -81,14 +81,14 @@ PALETTE_INIT( wiping )
WRITE8_HANDLER( wiping_flipscreen_w )
{
- wiping_state *state = space->machine->driver_data<wiping_state>();
+ wiping_state *state = space->machine().driver_data<wiping_state>();
state->flipscreen = (data & 1);
}
SCREEN_UPDATE( wiping )
{
- wiping_state *state = screen->machine->driver_data<wiping_state>();
+ wiping_state *state = screen->machine().driver_data<wiping_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -121,7 +121,7 @@ SCREEN_UPDATE( wiping )
sy = 27 - sy;
}
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs],
state->colorram[offs] & 0x3f,
state->flipscreen,state->flipscreen,
@@ -149,12 +149,12 @@ SCREEN_UPDATE( wiping )
flipy = !flipy;
}
- drawgfx_transmask(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transmask(bitmap,cliprect,screen->machine().gfx[1],
(spriteram[offs] & 0x3f) + 64 * otherbank,
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(screen->machine->colortable, screen->machine->gfx[1], color, 0x1f));
+ colortable_get_transpen_mask(screen->machine().colortable, screen->machine().gfx[1], color, 0x1f));
}
/* redraw high priority chars */
@@ -189,7 +189,7 @@ SCREEN_UPDATE( wiping )
sy = 27 - sy;
}
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],
state->videoram[offs],
state->colorram[offs] & 0x3f,
state->flipscreen,state->flipscreen,
diff --git a/src/mame/video/wiz.c b/src/mame/video/wiz.c
index 6f99a6f218c..2586c477a60 100644
--- a/src/mame/video/wiz.c
+++ b/src/mame/video/wiz.c
@@ -25,7 +25,7 @@ static const rectangle spritevisibleareaflipx =
VIDEO_START( wiz )
{
- wiz_state *state = machine->driver_data<wiz_state>();
+ wiz_state *state = machine.driver_data<wiz_state>();
state_save_register_global_array(machine, state->char_bank);
state_save_register_global_array(machine, state->palbank);
state_save_register_global(machine, state->flipx);
@@ -51,7 +51,7 @@ PALETTE_INIT( wiz )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -61,15 +61,15 @@ PALETTE_INIT( wiz )
bit2 = (color_prom[0] >> 2) & 0x01;
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -80,39 +80,39 @@ PALETTE_INIT( wiz )
WRITE8_HANDLER( wiz_palettebank_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
state->palbank[offset] = data & 1;
state->palette_bank = state->palbank[0] + 2 * state->palbank[1];
}
WRITE8_HANDLER( wiz_bgcolor_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
state->bgpen = data;
}
WRITE8_HANDLER( wiz_char_bank_select_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
state->char_bank[offset] = data & 1;
}
WRITE8_HANDLER( wiz_flipx_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
state->flipx = data;
}
WRITE8_HANDLER( wiz_flipy_w )
{
- wiz_state *state = space->machine->driver_data<wiz_state>();
+ wiz_state *state = space->machine().driver_data<wiz_state>();
state->flipy = data;
}
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, int colortype)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, int colortype)
{
- wiz_state *state = machine->driver_data<wiz_state>();
+ wiz_state *state = machine.driver_data<wiz_state>();
UINT8 *videoram = state->videoram;
int offs;
@@ -143,7 +143,7 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
if (state->flipx) sx = 31 - sx;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[bank],
videoram[offs],
col + 8 * state->palette_bank,
state->flipx,state->flipy,
@@ -151,9 +151,9 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
}
}
-static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int colortype)
+static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int colortype)
{
- wiz_state *state = machine->driver_data<wiz_state>();
+ wiz_state *state = machine.driver_data<wiz_state>();
int offs;
/* draw the frontmost playfield. They are characters, but draw them as sprites. */
@@ -182,7 +182,7 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
if (state->flipx) sx = 31 - sx;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[state->char_bank[1]],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[state->char_bank[1]],
state->videoram2[offs],
col + 8 * state->palette_bank,
state->flipx,state->flipy,
@@ -190,11 +190,11 @@ static void draw_foreground(running_machine *machine, bitmap_t *bitmap, const re
}
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,
const rectangle *cliprect, UINT8* sprite_ram,
int bank)
{
- wiz_state *state = machine->driver_data<wiz_state>();
+ wiz_state *state = machine.driver_data<wiz_state>();
int offs;
for (offs = state->spriteram_size - 4;offs >= 0;offs -= 4)
@@ -210,7 +210,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,
if ( state->flipx) sx = 240 - sx;
if (!state->flipy) sy = 240 - sy;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[bank],
sprite_ram[offs + 1],
(sprite_ram[offs + 2] & 0x07) + 8 * state->palette_bank,
state->flipx,state->flipy,
@@ -221,42 +221,42 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,
SCREEN_UPDATE( kungfut )
{
- wiz_state *state = screen->machine->driver_data<wiz_state>();
+ wiz_state *state = screen->machine().driver_data<wiz_state>();
bitmap_fill(bitmap,cliprect,state->bgpen);
- draw_background(screen->machine, bitmap, cliprect, 2 + state->char_bank[0] , 0);
- draw_foreground(screen->machine, bitmap, cliprect, 0);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram2, 4);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram , 5);
+ draw_background(screen->machine(), bitmap, cliprect, 2 + state->char_bank[0] , 0);
+ draw_foreground(screen->machine(), bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram2, 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram , 5);
return 0;
}
SCREEN_UPDATE( wiz )
{
- wiz_state *state = screen->machine->driver_data<wiz_state>();
+ wiz_state *state = screen->machine().driver_data<wiz_state>();
int bank;
const rectangle* visible_area;
bitmap_fill(bitmap,cliprect,state->bgpen);
- draw_background(screen->machine, bitmap, cliprect, 2 + ((state->char_bank[0] << 1) | state->char_bank[1]), 0);
- draw_foreground(screen->machine, bitmap, cliprect, 0);
+ draw_background(screen->machine(), bitmap, cliprect, 2 + ((state->char_bank[0] << 1) | state->char_bank[1]), 0);
+ draw_foreground(screen->machine(), bitmap, cliprect, 0);
visible_area = state->flipx ? &spritevisibleareaflipx : &spritevisiblearea;
bank = 7 + *state->sprite_bank;
- draw_sprites(screen->machine, bitmap, visible_area, state->spriteram2, 6);
- draw_sprites(screen->machine, bitmap, visible_area, state->spriteram , bank);
+ draw_sprites(screen->machine(), bitmap, visible_area, state->spriteram2, 6);
+ draw_sprites(screen->machine(), bitmap, visible_area, state->spriteram , bank);
return 0;
}
SCREEN_UPDATE( stinger )
{
- wiz_state *state = screen->machine->driver_data<wiz_state>();
+ wiz_state *state = screen->machine().driver_data<wiz_state>();
bitmap_fill(bitmap,cliprect,state->bgpen);
- draw_background(screen->machine, bitmap, cliprect, 2 + state->char_bank[0], 1);
- draw_foreground(screen->machine, bitmap, cliprect, 1);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram2, 4);
- draw_sprites(screen->machine, bitmap, cliprect, state->spriteram , 5);
+ draw_background(screen->machine(), bitmap, cliprect, 2 + state->char_bank[0], 1);
+ draw_foreground(screen->machine(), bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram2, 4);
+ draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram , 5);
return 0;
}
diff --git a/src/mame/video/wolfpack.c b/src/mame/video/wolfpack.c
index 91f60af48d5..81c3dbaa336 100644
--- a/src/mame/video/wolfpack.c
+++ b/src/mame/video/wolfpack.c
@@ -13,110 +13,110 @@ PALETTE_INIT( wolfpack )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 8);
+ machine.colortable = colortable_alloc(machine, 8);
- colortable_palette_set_color(machine->colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(machine->colortable, 1, MAKE_RGB(0xc1, 0xc1, 0xc1));
- colortable_palette_set_color(machine->colortable, 2, MAKE_RGB(0x81, 0x81, 0x81));
- colortable_palette_set_color(machine->colortable, 3, MAKE_RGB(0x48, 0x48, 0x48));
+ colortable_palette_set_color(machine.colortable, 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(machine.colortable, 1, MAKE_RGB(0xc1, 0xc1, 0xc1));
+ colortable_palette_set_color(machine.colortable, 2, MAKE_RGB(0x81, 0x81, 0x81));
+ colortable_palette_set_color(machine.colortable, 3, MAKE_RGB(0x48, 0x48, 0x48));
for (i = 0; i < 4; i++)
{
- rgb_t color = colortable_palette_get_color(machine->colortable, i);
+ rgb_t color = colortable_palette_get_color(machine.colortable, i);
- colortable_palette_set_color(machine->colortable, 4 + i,
+ colortable_palette_set_color(machine.colortable, 4 + i,
MAKE_RGB(RGB_RED(color) < 0xb8 ? RGB_RED(color) + 0x48 : 0xff,
RGB_GREEN(color) < 0xb8 ? RGB_GREEN(color) + 0x48 : 0xff,
RGB_BLUE(color) < 0xb8 ? RGB_BLUE(color) + 0x48 : 0xff));
}
- colortable_entry_set_value(machine->colortable, 0x00, 0);
- colortable_entry_set_value(machine->colortable, 0x01, 1);
- colortable_entry_set_value(machine->colortable, 0x02, 1);
- colortable_entry_set_value(machine->colortable, 0x03, 0);
- colortable_entry_set_value(machine->colortable, 0x04, 0);
- colortable_entry_set_value(machine->colortable, 0x05, 2);
- colortable_entry_set_value(machine->colortable, 0x06, 0);
- colortable_entry_set_value(machine->colortable, 0x07, 3);
- colortable_entry_set_value(machine->colortable, 0x08, 4);
- colortable_entry_set_value(machine->colortable, 0x09, 5);
- colortable_entry_set_value(machine->colortable, 0x0a, 6);
- colortable_entry_set_value(machine->colortable, 0x0b, 7);
+ colortable_entry_set_value(machine.colortable, 0x00, 0);
+ colortable_entry_set_value(machine.colortable, 0x01, 1);
+ colortable_entry_set_value(machine.colortable, 0x02, 1);
+ colortable_entry_set_value(machine.colortable, 0x03, 0);
+ colortable_entry_set_value(machine.colortable, 0x04, 0);
+ colortable_entry_set_value(machine.colortable, 0x05, 2);
+ colortable_entry_set_value(machine.colortable, 0x06, 0);
+ colortable_entry_set_value(machine.colortable, 0x07, 3);
+ colortable_entry_set_value(machine.colortable, 0x08, 4);
+ colortable_entry_set_value(machine.colortable, 0x09, 5);
+ colortable_entry_set_value(machine.colortable, 0x0a, 6);
+ colortable_entry_set_value(machine.colortable, 0x0b, 7);
}
WRITE8_HANDLER( wolfpack_ship_size_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->ship_size = data;
}
WRITE8_HANDLER( wolfpack_video_invert_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->video_invert = data & 1;
}
WRITE8_HANDLER( wolfpack_ship_reflect_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->ship_reflect = data & 1;
}
WRITE8_HANDLER( wolfpack_pt_pos_select_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->pt_pos_select = data & 1;
}
WRITE8_HANDLER( wolfpack_pt_horz_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->pt_horz = data;
}
WRITE8_HANDLER( wolfpack_pt_pic_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->pt_pic = data & 0x3f;
}
WRITE8_HANDLER( wolfpack_ship_h_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->ship_h = data;
}
WRITE8_HANDLER( wolfpack_torpedo_pic_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->torpedo_pic = data;
}
WRITE8_HANDLER( wolfpack_ship_h_precess_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->ship_h_precess = data & 0x3f;
}
WRITE8_HANDLER( wolfpack_ship_pic_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->ship_pic = data & 0x0f;
}
WRITE8_HANDLER( wolfpack_torpedo_h_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->torpedo_h = data;
}
WRITE8_HANDLER( wolfpack_torpedo_v_w )
{
- wolfpack_state *state = space->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = space->machine().driver_data<wolfpack_state>();
state->torpedo_v = data;
}
VIDEO_START( wolfpack )
{
- wolfpack_state *state = machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = machine.driver_data<wolfpack_state>();
UINT16 val = 0;
int i;
state->LFSR = auto_alloc_array(machine, UINT8, 0x8000);
- state->helper = machine->primary_screen->alloc_compatible_bitmap();
+ state->helper = machine.primary_screen->alloc_compatible_bitmap();
for (i = 0; i < 0x8000; i++)
{
@@ -131,9 +131,9 @@ VIDEO_START( wolfpack )
}
-static void draw_ship(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_ship(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- wolfpack_state *state = machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = machine.driver_data<wolfpack_state>();
static const UINT32 scaler[] =
{
0x00000, 0x00500, 0x00a00, 0x01000,
@@ -157,7 +157,7 @@ static void draw_ship(running_machine *machine, bitmap_t* bitmap, const rectangl
int chop = (scaler[state->ship_size >> 2] * state->ship_h_precess) >> 16;
drawgfxzoom_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
state->ship_pic,
0,
state->ship_reflect, 0,
@@ -167,16 +167,16 @@ static void draw_ship(running_machine *machine, bitmap_t* bitmap, const rectangl
}
-static void draw_torpedo(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_torpedo(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- wolfpack_state *state = machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = machine.driver_data<wolfpack_state>();
int count = 0;
int x;
int y;
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[3],
+ machine.gfx[3],
state->torpedo_pic,
0,
0, 0,
@@ -201,9 +201,9 @@ static void draw_torpedo(running_machine *machine, bitmap_t* bitmap, const recta
}
-static void draw_pt(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
+static void draw_pt(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
{
- wolfpack_state *state = machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = machine.driver_data<wolfpack_state>();
rectangle rect = *cliprect;
if (!(state->pt_pic & 0x20))
@@ -213,7 +213,7 @@ static void draw_pt(running_machine *machine, bitmap_t* bitmap, const rectangle*
rect.max_x = 255;
drawgfx_transpen(bitmap, &rect,
- machine->gfx[2],
+ machine.gfx[2],
state->pt_pic,
0,
0, 0,
@@ -221,7 +221,7 @@ static void draw_pt(running_machine *machine, bitmap_t* bitmap, const rectangle*
state->pt_pos_select ? 0x70 : 0xA0, 0);
drawgfx_transpen(bitmap, &rect,
- machine->gfx[2],
+ machine.gfx[2],
state->pt_pic,
0,
0, 0,
@@ -252,7 +252,7 @@ static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectang
SCREEN_UPDATE( wolfpack )
{
- wolfpack_state *state = screen->machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = screen->machine().driver_data<wolfpack_state>();
int i;
int j;
@@ -262,8 +262,8 @@ SCREEN_UPDATE( wolfpack )
if (state->ship_size & 0x40) color += 0x3a;
if (state->ship_size & 0x80) color += 0x48;
- colortable_palette_set_color(screen->machine->colortable, 3, MAKE_RGB(color,color,color));
- colortable_palette_set_color(screen->machine->colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff,
+ colortable_palette_set_color(screen->machine().colortable, 3, MAKE_RGB(color,color,color));
+ colortable_palette_set_color(screen->machine().colortable, 7, MAKE_RGB(color < 0xb8 ? color + 0x48 : 0xff,
color < 0xb8 ? color + 0x48 : 0xff,
color < 0xb8 ? color + 0x48 : 0xff));
@@ -275,7 +275,7 @@ SCREEN_UPDATE( wolfpack )
int code = state->alpha_num_ram[32 * i + j];
drawgfx_opaque(bitmap, cliprect,
- screen->machine->gfx[0],
+ screen->machine().gfx[0],
code,
state->video_invert,
0, 0,
@@ -283,17 +283,17 @@ SCREEN_UPDATE( wolfpack )
192 + 8 * i);
}
- draw_pt(screen->machine, bitmap, cliprect);
- draw_ship(screen->machine, bitmap, cliprect);
- draw_torpedo(screen->machine, bitmap, cliprect);
- draw_water(screen->machine->colortable, bitmap, cliprect);
+ draw_pt(screen->machine(), bitmap, cliprect);
+ draw_ship(screen->machine(), bitmap, cliprect);
+ draw_torpedo(screen->machine(), bitmap, cliprect);
+ draw_water(screen->machine().colortable, bitmap, cliprect);
return 0;
}
SCREEN_EOF( wolfpack )
{
- wolfpack_state *state = machine->driver_data<wolfpack_state>();
+ wolfpack_state *state = machine.driver_data<wolfpack_state>();
rectangle rect;
int x;
diff --git a/src/mame/video/wrally.c b/src/mame/video/wrally.c
index 17a5515ecab..d5db164bdaf 100644
--- a/src/mame/video/wrally.c
+++ b/src/mame/video/wrally.c
@@ -36,7 +36,7 @@
static TILE_GET_INFO( get_tile_info_wrally_screen0 )
{
- wrally_state *state = machine->driver_data<wrally_state>();
+ wrally_state *state = machine.driver_data<wrally_state>();
int data = state->videoram[tile_index << 1];
int data2 = state->videoram[(tile_index << 1) + 1];
int code = data & 0x3fff;
@@ -48,7 +48,7 @@ static TILE_GET_INFO( get_tile_info_wrally_screen0 )
static TILE_GET_INFO( get_tile_info_wrally_screen1 )
{
- wrally_state *state = machine->driver_data<wrally_state>();
+ wrally_state *state = machine.driver_data<wrally_state>();
int data = state->videoram[(0x2000/2) + (tile_index << 1)];
int data2 = state->videoram[(0x2000/2) + (tile_index << 1) + 1];
int code = data & 0x3fff;
@@ -66,7 +66,7 @@ static TILE_GET_INFO( get_tile_info_wrally_screen1 )
VIDEO_START( wrally )
{
- wrally_state *state = machine->driver_data<wrally_state>();
+ wrally_state *state = machine.driver_data<wrally_state>();
state->pant[0] = tilemap_create(machine, get_tile_info_wrally_screen0,tilemap_scan_rows,16,16,64,32);
state->pant[1] = tilemap_create(machine, get_tile_info_wrally_screen1,tilemap_scan_rows,16,16,64,32);
@@ -104,11 +104,11 @@ VIDEO_START( wrally )
in the range 0x8-0xf are used.
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
{
- wrally_state *state = machine->driver_data<wrally_state>();
+ wrally_state *state = machine.driver_data<wrally_state>();
int i, px, py;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
for (i = 6/2; i < (0x1000 - 6)/2; i += 4) {
int sx = state->spriteram[i+2] & 0x03ff;
@@ -178,9 +178,9 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( wrally )
{
- wrally_state *state = screen->machine->driver_data<wrally_state>();
+ wrally_state *state = screen->machine().driver_data<wrally_state>();
/* set scroll registers */
- if (!flip_screen_get(screen->machine)) {
+ if (!flip_screen_get(screen->machine())) {
tilemap_set_scrolly(state->pant[0], 0, state->vregs[0]);
tilemap_set_scrollx(state->pant[0], 0, state->vregs[1]+4);
tilemap_set_scrolly(state->pant[1], 0, state->vregs[2]);
@@ -200,11 +200,11 @@ SCREEN_UPDATE( wrally )
tilemap_draw(bitmap,cliprect,state->pant[1],TILEMAP_DRAW_CATEGORY(1),0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER0,0);
- draw_sprites(screen->machine,bitmap,cliprect,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,0);
tilemap_draw(bitmap,cliprect,state->pant[0],TILEMAP_DRAW_CATEGORY(1) | TILEMAP_DRAW_LAYER1,0);
- draw_sprites(screen->machine,bitmap,cliprect,1);
+ draw_sprites(screen->machine(),bitmap,cliprect,1);
return 0;
}
diff --git a/src/mame/video/wwfsstar.c b/src/mame/video/wwfsstar.c
index 58536074f2e..fadaf64be14 100644
--- a/src/mame/video/wwfsstar.c
+++ b/src/mame/video/wwfsstar.c
@@ -17,7 +17,7 @@
WRITE16_HANDLER( wwfsstar_fg0_videoram_w )
{
- wwfsstar_state *state = space->machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = space->machine().driver_data<wwfsstar_state>();
COMBINE_DATA(&state->fg0_videoram[offset]);
tilemap_mark_tile_dirty(state->fg0_tilemap,offset/2);
@@ -25,7 +25,7 @@ WRITE16_HANDLER( wwfsstar_fg0_videoram_w )
WRITE16_HANDLER( wwfsstar_bg0_videoram_w )
{
- wwfsstar_state *state = space->machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = space->machine().driver_data<wwfsstar_state>();
COMBINE_DATA(&state->bg0_videoram[offset]);
tilemap_mark_tile_dirty(state->bg0_tilemap,offset/2);
@@ -52,7 +52,7 @@ static TILE_GET_INFO( get_fg0_tile_info )
**- End of Comments -*/
- wwfsstar_state *state = machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = machine.driver_data<wwfsstar_state>();
UINT16 *tilebase;
int tileno;
int colbank;
@@ -90,7 +90,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
**- End of Comments -*/
- wwfsstar_state *state = machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = machine.driver_data<wwfsstar_state>();
UINT16 *tilebase;
int tileno, colbank, flipx;
@@ -111,7 +111,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
sprite colour marking could probably be improved..
*******************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
/*- SPR RAM Format -**
@@ -134,8 +134,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
**- End of Comments -*/
- wwfsstar_state *state = machine->driver_data<wwfsstar_state>();
- const gfx_element *gfx = machine->gfx[1];
+ wwfsstar_state *state = machine.driver_data<wwfsstar_state>();
+ const gfx_element *gfx = machine.gfx[1];
UINT16 *source = state->spriteram;
UINT16 *finish = source + 0x3ff/2;
@@ -211,7 +211,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_START( wwfsstar )
{
- wwfsstar_state *state = machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = machine.driver_data<wwfsstar_state>();
state->fg0_tilemap = tilemap_create(machine, get_fg0_tile_info,tilemap_scan_rows, 8, 8,32,32);
tilemap_set_transparent_pen(state->fg0_tilemap,0);
@@ -222,13 +222,13 @@ VIDEO_START( wwfsstar )
SCREEN_UPDATE( wwfsstar )
{
- wwfsstar_state *state = screen->machine->driver_data<wwfsstar_state>();
+ wwfsstar_state *state = screen->machine().driver_data<wwfsstar_state>();
tilemap_set_scrolly( state->bg0_tilemap, 0, state->scrolly );
tilemap_set_scrollx( state->bg0_tilemap, 0, state->scrollx );
tilemap_draw(bitmap,cliprect,state->bg0_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect );
+ draw_sprites(screen->machine(), bitmap,cliprect );
tilemap_draw(bitmap,cliprect,state->fg0_tilemap,0,0);
return 0;
diff --git a/src/mame/video/wwfwfest.c b/src/mame/video/wwfwfest.c
index c5fa1455b2c..af9d35aac28 100644
--- a/src/mame/video/wwfwfest.c
+++ b/src/mame/video/wwfwfest.c
@@ -18,7 +18,7 @@
WRITE16_HANDLER( wwfwfest_fg0_videoram_w )
{
- wwfwfest_state *state = space->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
/* Videoram is 8 bit, upper & lower byte writes end up in the same place */
if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7) {
COMBINE_DATA(&state->fg0_videoram[offset]);
@@ -33,14 +33,14 @@ WRITE16_HANDLER( wwfwfest_fg0_videoram_w )
WRITE16_HANDLER( wwfwfest_bg0_videoram_w )
{
- wwfwfest_state *state = space->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
COMBINE_DATA(&state->bg0_videoram[offset]);
tilemap_mark_tile_dirty(state->bg0_tilemap,offset/2);
}
WRITE16_HANDLER( wwfwfest_bg1_videoram_w )
{
- wwfwfest_state *state = space->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = space->machine().driver_data<wwfwfest_state>();
COMBINE_DATA(&state->bg1_videoram[offset]);
tilemap_mark_tile_dirty(state->bg1_tilemap,offset);
}
@@ -50,7 +50,7 @@ WRITE16_HANDLER( wwfwfest_bg1_videoram_w )
*******************************************************************************/
static TILE_GET_INFO( get_fg0_tile_info )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
/*- FG0 RAM Format -**
4 bytes per tile
@@ -82,7 +82,7 @@ static TILE_GET_INFO( get_fg0_tile_info )
static TILE_GET_INFO( get_bg0_tile_info )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
/*- BG0 RAM Format -**
4 bytes per tile
@@ -113,7 +113,7 @@ static TILE_GET_INFO( get_bg0_tile_info )
static TILE_GET_INFO( get_bg1_tile_info )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
/*- BG1 RAM Format -**
2 bytes per tile
@@ -144,9 +144,9 @@ static TILE_GET_INFO( get_bg1_tile_info )
sprite drawing could probably be improved a bit
*******************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
/*- SPR RAM Format -**
16 bytes per sprite
@@ -167,8 +167,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
**- End of Comments -*/
- UINT16 *buffered_spriteram16 = machine->generic.buffered_spriteram.u16;
- const gfx_element *gfx = machine->gfx[1];
+ UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
+ const gfx_element *gfx = machine.gfx[1];
UINT16 *source = buffered_spriteram16;
UINT16 *finish = source + 0x2000/2;
@@ -227,7 +227,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_START( wwfwfest )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
state_save_register_global(machine, state->pri);
state_save_register_global(machine, state->bg0_scrollx);
state_save_register_global(machine, state->bg0_scrolly);
@@ -247,7 +247,7 @@ VIDEO_START( wwfwfest )
VIDEO_START( wwfwfstb )
{
- wwfwfest_state *state = machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
VIDEO_START_CALL(wwfwfest);
state->sprite_xoff = 2;
@@ -257,7 +257,7 @@ VIDEO_START( wwfwfstb )
SCREEN_UPDATE( wwfwfest )
{
- wwfwfest_state *state = screen->machine->driver_data<wwfwfest_state>();
+ wwfwfest_state *state = screen->machine().driver_data<wwfwfest_state>();
if (state->pri == 0x0078) {
tilemap_set_scrolly( state->bg0_tilemap, 0, state->bg0_scrolly );
tilemap_set_scrollx( state->bg0_tilemap, 0, state->bg0_scrollx + state->bg0_dx);
@@ -275,13 +275,13 @@ SCREEN_UPDATE( wwfwfest )
if (state->pri == 0x007b) {
tilemap_draw(bitmap,cliprect,state->bg0_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bg1_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg0_tilemap,0,0);
}
if (state->pri == 0x007c) {
tilemap_draw(bitmap,cliprect,state->bg0_tilemap,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bg1_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg0_tilemap,0,0);
}
@@ -289,7 +289,7 @@ SCREEN_UPDATE( wwfwfest )
if (state->pri == 0x0078) {
tilemap_draw(bitmap,cliprect,state->bg1_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bg0_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg0_tilemap,0,0);
}
return 0;
diff --git a/src/mame/video/xain.c b/src/mame/video/xain.c
index 2ea784e7e69..b7a0007b01b 100644
--- a/src/mame/video/xain.c
+++ b/src/mame/video/xain.c
@@ -48,7 +48,7 @@ static TILEMAP_MAPPER( back_scan )
static TILE_GET_INFO( get_bgram0_tile_info )
{
- xain_state *state = machine->driver_data<xain_state>();
+ xain_state *state = machine.driver_data<xain_state>();
int attr = state->bgram0[tile_index | 0x400];
SET_TILE_INFO(
2,
@@ -59,7 +59,7 @@ static TILE_GET_INFO( get_bgram0_tile_info )
static TILE_GET_INFO( get_bgram1_tile_info )
{
- xain_state *state = machine->driver_data<xain_state>();
+ xain_state *state = machine.driver_data<xain_state>();
int attr = state->bgram1[tile_index | 0x400];
SET_TILE_INFO(
1,
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bgram1_tile_info )
static TILE_GET_INFO( get_char_tile_info )
{
- xain_state *state = machine->driver_data<xain_state>();
+ xain_state *state = machine.driver_data<xain_state>();
int attr = state->charram[tile_index | 0x400];
SET_TILE_INFO(
0,
@@ -88,7 +88,7 @@ static TILE_GET_INFO( get_char_tile_info )
VIDEO_START( xain )
{
- xain_state *state = machine->driver_data<xain_state>();
+ xain_state *state = machine.driver_data<xain_state>();
state->bgram0_tilemap = tilemap_create(machine, get_bgram0_tile_info,back_scan, 16,16,32,32);
state->bgram1_tilemap = tilemap_create(machine, get_bgram1_tile_info,back_scan, 16,16,32,32);
state->char_tilemap = tilemap_create(machine, get_char_tile_info,tilemap_scan_rows, 8, 8,32,32);
@@ -108,28 +108,28 @@ VIDEO_START( xain )
WRITE8_HANDLER( xain_bgram0_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->bgram0[offset] = data;
tilemap_mark_tile_dirty(state->bgram0_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( xain_bgram1_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->bgram1[offset] = data;
tilemap_mark_tile_dirty(state->bgram1_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( xain_charram_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->charram[offset] = data;
tilemap_mark_tile_dirty(state->char_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( xain_scrollxP0_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->scrollxP0[offset] = data;
tilemap_set_scrollx(state->bgram0_tilemap, 0, state->scrollxP0[0]|(state->scrollxP0[1]<<8));
@@ -137,7 +137,7 @@ WRITE8_HANDLER( xain_scrollxP0_w )
WRITE8_HANDLER( xain_scrollyP0_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->scrollyP0[offset] = data;
tilemap_set_scrolly(state->bgram0_tilemap, 0, state->scrollyP0[0]|(state->scrollyP0[1]<<8));
@@ -145,7 +145,7 @@ WRITE8_HANDLER( xain_scrollyP0_w )
WRITE8_HANDLER( xain_scrollxP1_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->scrollxP1[offset] = data;
tilemap_set_scrollx(state->bgram1_tilemap, 0, state->scrollxP1[0]|(state->scrollxP1[1]<<8));
@@ -153,7 +153,7 @@ WRITE8_HANDLER( xain_scrollxP1_w )
WRITE8_HANDLER( xain_scrollyP1_w )
{
- xain_state *state = space->machine->driver_data<xain_state>();
+ xain_state *state = space->machine().driver_data<xain_state>();
state->scrollyP1[offset] = data;
tilemap_set_scrolly(state->bgram1_tilemap, 0, state->scrollyP1[0]|(state->scrollyP1[1]<<8));
@@ -162,7 +162,7 @@ WRITE8_HANDLER( xain_scrollyP1_w )
WRITE8_HANDLER( xain_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -172,9 +172,9 @@ WRITE8_HANDLER( xain_flipscreen_w )
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- xain_state *state = machine->driver_data<xain_state>();
+ xain_state *state = machine.driver_data<xain_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -201,12 +201,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
if (attr & 0x80) /* double height */
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
numtile,
color,
flipx,flipy,
sx,flipy ? sy+16:sy-16,0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
numtile+1,
color,
flipx,flipy,
@@ -214,7 +214,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
else
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
numtile,
color,
flipx,flipy,
@@ -225,54 +225,54 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( xain )
{
- xain_state *state = screen->machine->driver_data<xain_state>();
+ xain_state *state = screen->machine().driver_data<xain_state>();
switch (state->pri&0x7)
{
case 0:
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
break;
case 1:
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
break;
case 2:
tilemap_draw(bitmap,cliprect,state->char_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,0,0);
break;
case 3:
tilemap_draw(bitmap,cliprect,state->char_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,0,0);
break;
case 4:
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,0,0);
break;
case 5:
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,0,0);
break;
case 6:
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
break;
case 7:
tilemap_draw(bitmap,cliprect,state->bgram1_tilemap,TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->bgram0_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->char_tilemap,0,0);
break;
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 7324bf2fc45..f5e5dcc0571 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -27,9 +27,9 @@
PALETTE_INIT( xevious )
{
int i;
- #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
+ #define TOTAL_COLORS(gfxn) (machine.gfx[gfxn]->total_colors * machine.gfx[gfxn]->color_granularity)
- machine->colortable = colortable_alloc(machine, 128+1);
+ machine.colortable = colortable_alloc(machine, 128+1);
for (i = 0;i < 128;i++)
{
@@ -54,12 +54,12 @@ PALETTE_INIT( xevious )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* color 0x80 is used by sprites to mark transparency */
- colortable_palette_set_color(machine->colortable,0x80,MAKE_RGB(0,0,0));
+ colortable_palette_set_color(machine.colortable,0x80,MAKE_RGB(0,0,0));
color_prom += 128; /* the bottom part of the PROM is unused */
color_prom += 2*256;
@@ -68,7 +68,7 @@ PALETTE_INIT( xevious )
/* background tiles */
for (i = 0;i < TOTAL_COLORS(1);i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i,
(color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(1)] & 0x0f) << 4));
color_prom++;
@@ -80,7 +80,7 @@ PALETTE_INIT( xevious )
{
int c = (color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(2)] & 0x0f) << 4);
- colortable_entry_set_value(machine->colortable, machine->gfx[2]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[2]->color_base + i,
(c & 0x80) ? (c & 0x7f) : 0x80);
color_prom++;
@@ -90,7 +90,7 @@ PALETTE_INIT( xevious )
/* foreground characters */
for (i = 0;i < TOTAL_COLORS(0);i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i,
(i % 2 != 0) ? (i / 2) : 0x80);
}
}
@@ -101,7 +101,7 @@ PALETTE_INIT( battles )
{
int i;
- machine->colortable = colortable_alloc(machine, 128+1);
+ machine.colortable = colortable_alloc(machine, 128+1);
for (i = 0;i < 128;i++)
{
@@ -126,12 +126,12 @@ PALETTE_INIT( battles )
bit3 = (color_prom[2*256] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
- colortable_palette_set_color(machine->colortable,i,MAKE_RGB(r,g,b));
+ colortable_palette_set_color(machine.colortable,i,MAKE_RGB(r,g,b));
color_prom++;
}
/* color 0x80 is used by sprites to mark transparency */
- colortable_palette_set_color(machine->colortable,0x80,MAKE_RGB(0,0,0));
+ colortable_palette_set_color(machine.colortable,0x80,MAKE_RGB(0,0,0));
color_prom += 128; /* the bottom part of the PROM is unused */
color_prom += 2*256;
@@ -140,7 +140,7 @@ PALETTE_INIT( battles )
/* background tiles */
for (i = 0;i < TOTAL_COLORS(1);i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[1]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i,
(color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4));
color_prom++;
@@ -152,7 +152,7 @@ PALETTE_INIT( battles )
{
int c = (color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4);
- colortable_entry_set_value(machine->colortable, machine->gfx[2]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[2]->color_base + i,
(c & 0x80) ? (c & 0x7f) : 0x80);
color_prom++;
@@ -161,7 +161,7 @@ PALETTE_INIT( battles )
/* foreground characters */
for (i = 0;i < TOTAL_COLORS(0);i++)
{
- colortable_entry_set_value(machine->colortable, machine->gfx[0]->color_base + i,
+ colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i,
(i % 2 != 0) ? (i / 2) : 0x80);
}
}
@@ -176,7 +176,7 @@ PALETTE_INIT( battles )
static TILE_GET_INFO( get_fg_tile_info )
{
- xevious_state *state = machine->driver_data<xevious_state>();
+ xevious_state *state = machine.driver_data<xevious_state>();
UINT8 attr = state->xevious_fg_colorram[tile_index];
@@ -195,7 +195,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- xevious_state *state = machine->driver_data<xevious_state>();
+ xevious_state *state = machine.driver_data<xevious_state>();
UINT8 code = state->xevious_bg_videoram[tile_index];
UINT8 attr = state->xevious_bg_colorram[tile_index];
@@ -217,7 +217,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( xevious )
{
- xevious_state *state = machine->driver_data<xevious_state>();
+ xevious_state *state = machine.driver_data<xevious_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8,8,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -243,7 +243,7 @@ VIDEO_START( xevious )
WRITE8_HANDLER( xevious_fg_videoram_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
state->xevious_fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -251,7 +251,7 @@ WRITE8_HANDLER( xevious_fg_videoram_w )
WRITE8_HANDLER( xevious_fg_colorram_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
state->xevious_fg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -259,7 +259,7 @@ WRITE8_HANDLER( xevious_fg_colorram_w )
WRITE8_HANDLER( xevious_bg_videoram_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
state->xevious_bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -267,7 +267,7 @@ WRITE8_HANDLER( xevious_bg_videoram_w )
WRITE8_HANDLER( xevious_bg_colorram_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
state->xevious_bg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -275,7 +275,7 @@ WRITE8_HANDLER( xevious_bg_colorram_w )
WRITE8_HANDLER( xevious_vh_latch_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
int reg;
int scroll = data + ((offset&0x01)<<8); /* A0 -> D8 */
@@ -297,7 +297,7 @@ WRITE8_HANDLER( xevious_vh_latch_w )
tilemap_set_scrolly(state->fg_tilemap,0,scroll);
break;
case 7:
- flip_screen_set(space->machine, scroll & 1);
+ flip_screen_set(space->machine(), scroll & 1);
break;
default:
logerror("CRTC WRITE REG: %x Data: %03x\n",reg, scroll);
@@ -309,16 +309,16 @@ WRITE8_HANDLER( xevious_vh_latch_w )
/* emulation for schematic 9B */
WRITE8_HANDLER( xevious_bs_w )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
state->xevious_bs[offset & 1] = data;
}
READ8_HANDLER( xevious_bb_r )
{
- xevious_state *state = space->machine->driver_data<xevious_state>();
+ xevious_state *state = space->machine().driver_data<xevious_state>();
- UINT8 *rom2a = space->machine->region("gfx4")->base();
+ UINT8 *rom2a = space->machine().region("gfx4")->base();
UINT8 *rom2b = rom2a+0x1000;
UINT8 *rom2c = rom2a+0x3000;
int adr_2b,adr_2c;
@@ -414,9 +414,9 @@ ROM 3M,3L color replace table for sprite
***************************************************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- xevious_state *state = machine->driver_data<xevious_state>();
+ xevious_state *state = machine.driver_data<xevious_state>();
UINT8 *spriteram = state->xevious_sr3 + 0x780;
UINT8 *spriteram_2 = state->xevious_sr1 + 0x780;
@@ -455,41 +455,41 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
sy += 48;
}
- transmask = colortable_get_transpen_mask(machine->colortable, machine->gfx[bank], color, 0x80);
+ transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[bank], color, 0x80);
if (spriteram_3[offs] & 2) /* double height (?) */
{
if (spriteram_3[offs] & 1) /* double width, double height */
{
code &= ~3;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code+3,color,flipx,flipy,
flipx ? sx : sx+16,flipy ? sy-16 : sy,transmask);
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code+1,color,flipx,flipy,
flipx ? sx : sx+16,flipy ? sy : sy-16,transmask);
}
code &= ~2;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code+2,color,flipx,flipy,
flipx ? sx+16 : sx,flipy ? sy-16 : sy,transmask);
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code,color,flipx,flipy,
flipx ? sx+16 : sx,flipy ? sy : sy-16,transmask);
}
else if (spriteram_3[offs] & 1) /* double width */
{
code &= ~1;
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code,color,flipx,flipy,
flipx ? sx+16 : sx,flipy ? sy-16 : sy,transmask);
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code+1,color,flipx,flipy,
flipx ? sx : sx+16,flipy ? sy-16 : sy,transmask);
}
else /* normal */
{
- drawgfx_transmask(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transmask(bitmap,cliprect,machine.gfx[bank],
code,color,flipx,flipy,sx,sy,transmask);
}
}
@@ -499,10 +499,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( xevious )
{
- xevious_state *state = screen->machine->driver_data<xevious_state>();
+ xevious_state *state = screen->machine().driver_data<xevious_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine, bitmap,cliprect);
+ draw_sprites(screen->machine(), bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
}
diff --git a/src/mame/video/xexex.c b/src/mame/video/xexex.c
index 3849d3901e6..f28306aad9b 100644
--- a/src/mame/video/xexex.c
+++ b/src/mame/video/xexex.c
@@ -2,9 +2,9 @@
#include "video/konicdev.h"
#include "includes/xexex.h"
-void xexex_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void xexex_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
int pri;
// Xexex doesn't seem to use bit8 and 9 as effect selectors so this should be safe.
@@ -25,17 +25,17 @@ void xexex_sprite_callback( running_machine *machine, int *code, int *color, int
*color = state->sprite_colorbase | (*color & 0x001f);
}
-void xexex_tile_callback(running_machine *machine, int layer, int *code, int *color, int *flags)
+void xexex_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags)
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
*color = state->layer_colorbase[layer] | (*color >> 2 & 0x0f);
}
VIDEO_START( xexex )
{
- xexex_state *state = machine->driver_data<xexex_state>();
+ xexex_state *state = machine.driver_data<xexex_state>();
- assert(machine->primary_screen->format() == BITMAP_FORMAT_RGB32);
+ assert(machine.primary_screen->format() == BITMAP_FORMAT_RGB32);
state->cur_alpha = 0;
@@ -49,7 +49,7 @@ VIDEO_START( xexex )
SCREEN_UPDATE( xexex )
{
static const int K053251_CI[4] = { K053251_CI1, K053251_CI2, K053251_CI3, K053251_CI4 };
- xexex_state *state = screen->machine->driver_data<xexex_state>();
+ xexex_state *state = screen->machine().driver_data<xexex_state>();
int layer[4];
int bg_colorbase, new_colorbase, plane, alpha;
@@ -81,7 +81,7 @@ SCREEN_UPDATE( xexex )
k054338_update_all_shadows(state->k054338, 0);
k054338_fill_backcolor(state->k054338, bitmap, 0);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
for (plane = 0; plane < 4; plane++)
{
diff --git a/src/mame/video/xmen.c b/src/mame/video/xmen.c
index 7d3afb20e89..3e29253aa8f 100644
--- a/src/mame/video/xmen.c
+++ b/src/mame/video/xmen.c
@@ -9,9 +9,9 @@
***************************************************************************/
-void xmen_tile_callback( running_machine *machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
+void xmen_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
/* (color & 0x02) is flip y handled internally by the 052109 */
if (layer == 0)
@@ -26,9 +26,9 @@ void xmen_tile_callback( running_machine *machine, int layer, int bank, int *cod
***************************************************************************/
-void xmen_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+void xmen_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
int pri = (*color & 0x00e0) >> 4; /* ??????? */
if (pri <= state->layerpri[2])
@@ -53,7 +53,7 @@ void xmen_sprite_callback( running_machine *machine, int *code, int *color, int
VIDEO_START( xmen6p )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
k053247_get_ram(state->k053246, &state->k053247_ram);
@@ -73,7 +73,7 @@ VIDEO_START( xmen6p )
SCREEN_UPDATE( xmen )
{
- xmen_state *state = screen->machine->driver_data<xmen_state>();
+ xmen_state *state = screen->machine().driver_data<xmen_state>();
int layer[3], bg_colorbase;
bg_colorbase = k053251_get_palette_index(state->k053251, K053251_CI4);
@@ -93,7 +93,7 @@ SCREEN_UPDATE( xmen )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
/* note the '+1' in the background color!!! */
bitmap_fill(bitmap, cliprect, 16 * bg_colorbase + 1);
k052109_tilemap_draw(state->k052109, bitmap, cliprect, layer[0], 0, 1);
@@ -109,7 +109,7 @@ SCREEN_UPDATE( xmen )
SCREEN_UPDATE( xmen6p )
{
- xmen_state *state = screen->machine->driver_data<xmen_state>();
+ xmen_state *state = screen->machine().driver_data<xmen_state>();
int x, y;
if (screen == state->lscreen)
@@ -137,7 +137,7 @@ SCREEN_UPDATE( xmen6p )
/* my lefts and rights are mixed up in several places.. */
SCREEN_EOF( xmen6p )
{
- xmen_state *state = machine->driver_data<xmen_state>();
+ xmen_state *state = machine.driver_data<xmen_state>();
int layer[3], bg_colorbase;
bitmap_t * renderbitmap;
rectangle cliprect;
@@ -145,7 +145,7 @@ SCREEN_EOF( xmen6p )
state->current_frame ^= 0x01;
-// const rectangle *visarea = machine->primary_screen->visible_area();
+// const rectangle *visarea = machine.primary_screen->visible_area();
// cliprect.min_x = visarea->min_x;
// cliprect.max_x = visarea->max_x;
// cliprect.min_y = visarea->min_y;
@@ -214,7 +214,7 @@ SCREEN_EOF( xmen6p )
konami_sortlayers3(layer, state->layerpri);
- bitmap_fill(machine->priority_bitmap, &cliprect, 0);
+ bitmap_fill(machine.priority_bitmap, &cliprect, 0);
/* note the '+1' in the background color!!! */
bitmap_fill(renderbitmap, &cliprect, 16 * bg_colorbase + 1);
k052109_tilemap_draw(state->k052109, renderbitmap, &cliprect, layer[0], 0, 1);
diff --git a/src/mame/video/xorworld.c b/src/mame/video/xorworld.c
index 7a776032244..5c9d81dabc2 100644
--- a/src/mame/video/xorworld.c
+++ b/src/mame/video/xorworld.c
@@ -20,7 +20,7 @@ PALETTE_INIT( xorworld )
{
int i;
- for (i = 0;i < machine->total_colors();i++){
+ for (i = 0;i < machine.total_colors();i++){
int bit0,bit1,bit2,bit3;
int r,g,b;
@@ -31,16 +31,16 @@ PALETTE_INIT( xorworld )
bit3 = (color_prom[0] >> 3) & 0x01;
r = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3;
/* green component */
- bit0 = (color_prom[machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[machine.total_colors()] >> 3) & 0x01;
g = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3;
/* blue component */
- bit0 = (color_prom[2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e*bit0 + 0x1e * bit1 + 0x44*bit2 + 0x8f*bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -50,7 +50,7 @@ PALETTE_INIT( xorworld )
WRITE16_HANDLER( xorworld_videoram16_w )
{
- xorworld_state *state = space->machine->driver_data<xorworld_state>();
+ xorworld_state *state = space->machine().driver_data<xorworld_state>();
UINT16 *videoram = state->videoram;
COMBINE_DATA(&videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -68,7 +68,7 @@ WRITE16_HANDLER( xorworld_videoram16_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- xorworld_state *state = machine->driver_data<xorworld_state>();
+ xorworld_state *state = machine.driver_data<xorworld_state>();
UINT16 *videoram = state->videoram;
int data = videoram[tile_index];
int code = data & 0x0fff;
@@ -78,7 +78,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( xorworld )
{
- xorworld_state *state = machine->driver_data<xorworld_state>();
+ xorworld_state *state = machine.driver_data<xorworld_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
}
@@ -96,9 +96,9 @@ VIDEO_START( xorworld )
1 | xxxx---- -------- | sprite color
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- xorworld_state *state = machine->driver_data<xorworld_state>();
+ xorworld_state *state = machine.driver_data<xorworld_state>();
UINT16 *spriteram16 = state->spriteram;
int i;
@@ -109,14 +109,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int code = (spriteram16[i+1] & 0x0ffc) >> 2;
int color = (spriteram16[i+1] & 0xf000) >> 12;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, 0, 0, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, 0, 0, sx, sy, 0);
}
}
SCREEN_UPDATE( xorworld )
{
- xorworld_state *state = screen->machine->driver_data<xorworld_state>();
+ xorworld_state *state = screen->machine().driver_data<xorworld_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/xxmissio.c b/src/mame/video/xxmissio.c
index 3dcd0eef3eb..295e29deda2 100644
--- a/src/mame/video/xxmissio.c
+++ b/src/mame/video/xxmissio.c
@@ -14,24 +14,24 @@ Video hardware driver by Uki
WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w )
{
- xxmissio_state *state = device->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
state->xscroll = data;
}
WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w )
{
- xxmissio_state *state = device->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
state->yscroll = data;
}
WRITE8_HANDLER( xxmissio_flipscreen_w )
{
- xxmissio_state *state = space->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = space->machine().driver_data<xxmissio_state>();
state->flipscreen = data & 0x01;
}
WRITE8_HANDLER( xxmissio_bgram_w )
{
- xxmissio_state *state = space->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = space->machine().driver_data<xxmissio_state>();
int x = (offset + (state->xscroll >> 3)) & 0x1f;
offset = (offset & 0x7e0) | x;
@@ -39,7 +39,7 @@ WRITE8_HANDLER( xxmissio_bgram_w )
}
READ8_HANDLER( xxmissio_bgram_r )
{
- xxmissio_state *state = space->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = space->machine().driver_data<xxmissio_state>();
int x = (offset + (state->xscroll >> 3)) & 0x1f;
offset = (offset & 0x7e0) | x;
@@ -55,7 +55,7 @@ WRITE8_HANDLER( xxmissio_paletteram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- xxmissio_state *state = machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = machine.driver_data<xxmissio_state>();
int code = ((state->bgram[0x400 | tile_index] & 0xc0) << 2) | state->bgram[0x000 | tile_index];
int color = state->bgram[0x400 | tile_index] & 0x0f;
@@ -64,7 +64,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- xxmissio_state *state = machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = machine.driver_data<xxmissio_state>();
int code = state->fgram[0x000 | tile_index];
int color = state->fgram[0x400 | tile_index] & 0x07;
@@ -73,7 +73,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( xxmissio )
{
- xxmissio_state *state = machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = machine.driver_data<xxmissio_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
@@ -87,7 +87,7 @@ VIDEO_START( xxmissio )
static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
{
- xxmissio_state *state = gfx->machine->driver_data<xxmissio_state>();
+ xxmissio_state *state = gfx->machine().driver_data<xxmissio_state>();
int offs;
int chr,col;
int x,y,px,py,fx,fy;
@@ -138,15 +138,15 @@ static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_
SCREEN_UPDATE( xxmissio )
{
- xxmissio_state *state = screen->machine->driver_data<xxmissio_state>();
- tilemap_mark_all_tiles_dirty_all(screen->machine);
- tilemap_set_flip_all(screen->machine, state->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
+ xxmissio_state *state = screen->machine().driver_data<xxmissio_state>();
+ tilemap_mark_all_tiles_dirty_all(screen->machine());
+ tilemap_set_flip_all(screen->machine(), state->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_set_scrollx(state->bg_tilemap, 0, state->xscroll * 2);
tilemap_set_scrolly(state->bg_tilemap, 0, state->yscroll);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(bitmap, cliprect, screen->machine->gfx[1]);
+ draw_sprites(bitmap, cliprect, screen->machine().gfx[1]);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/xybots.c b/src/mame/video/xybots.c
index fc9c4946fe9..150a7e2e1bb 100644
--- a/src/mame/video/xybots.c
+++ b/src/mame/video/xybots.c
@@ -18,7 +18,7 @@
static TILE_GET_INFO( get_alpha_tile_info )
{
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
UINT16 data = state->alpha[tile_index];
int code = data & 0x3ff;
int color = (data >> 12) & 7;
@@ -29,7 +29,7 @@ static TILE_GET_INFO( get_alpha_tile_info )
static TILE_GET_INFO( get_playfield_tile_info )
{
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
UINT16 data = state->playfield[tile_index];
int code = data & 0x1fff;
int color = (data >> 11) & 0x0f;
@@ -82,7 +82,7 @@ VIDEO_START( xybots )
0, /* resulting value to indicate "special" */
NULL /* callback routine for special entries */
};
- xybots_state *state = machine->driver_data<xybots_state>();
+ xybots_state *state = machine.driver_data<xybots_state>();
/* initialize the playfield */
state->playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,32);
@@ -105,7 +105,7 @@ VIDEO_START( xybots )
SCREEN_UPDATE( xybots )
{
- xybots_state *state = screen->machine->driver_data<xybots_state>();
+ xybots_state *state = screen->machine().driver_data<xybots_state>();
atarimo_rect_list rectlist;
bitmap_t *mobitmap;
int x, y, r;
diff --git a/src/mame/video/xyonix.c b/src/mame/video/xyonix.c
index 316860a48b1..5033645649e 100644
--- a/src/mame/video/xyonix.c
+++ b/src/mame/video/xyonix.c
@@ -6,7 +6,7 @@ PALETTE_INIT( xyonix )
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -32,7 +32,7 @@ PALETTE_INIT( xyonix )
static TILE_GET_INFO( get_xyonix_tile_info )
{
- xyonix_state *state = machine->driver_data<xyonix_state>();
+ xyonix_state *state = machine.driver_data<xyonix_state>();
int tileno;
int attr = state->vidram[tile_index+0x1000+1];
@@ -43,7 +43,7 @@ static TILE_GET_INFO( get_xyonix_tile_info )
WRITE8_HANDLER( xyonix_vidram_w )
{
- xyonix_state *state = space->machine->driver_data<xyonix_state>();
+ xyonix_state *state = space->machine().driver_data<xyonix_state>();
state->vidram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,(offset-1)&0x0fff);
@@ -51,14 +51,14 @@ WRITE8_HANDLER( xyonix_vidram_w )
VIDEO_START(xyonix)
{
- xyonix_state *state = machine->driver_data<xyonix_state>();
+ xyonix_state *state = machine.driver_data<xyonix_state>();
state->tilemap = tilemap_create(machine, get_xyonix_tile_info, tilemap_scan_rows, 4, 8, 80, 32);
}
SCREEN_UPDATE(xyonix)
{
- xyonix_state *state = screen->machine->driver_data<xyonix_state>();
+ xyonix_state *state = screen->machine().driver_data<xyonix_state>();
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c
index d65b709ca2c..1df8ceea144 100644
--- a/src/mame/video/ygv608.c
+++ b/src/mame/video/ygv608.c
@@ -57,10 +57,10 @@ static tilemap_t *tilemap_A = NULL;
static tilemap_t *tilemap_B = NULL;
static bitmap_t *work_bitmap = NULL;
-static void HandleYGV608Reset( running_machine *machine );
-static void HandleRomTransfers( running_machine *machine );
+static void HandleYGV608Reset( running_machine &machine );
+static void HandleRomTransfers( running_machine &machine );
static void SetPreShortcuts( int reg, int data );
-static void SetPostShortcuts( running_machine *machine, int reg );
+static void SetPostShortcuts( running_machine &machine, int reg );
#ifdef MAME_DEBUG
static void ShowYGV608Registers( void );
@@ -113,7 +113,7 @@ static TILEMAP_MAPPER( get_tile_offset )
}
#define layout_total(x) \
-(machine->config().m_gfxdecodeinfo[x].gfxlayout->total)
+(machine.config().m_gfxdecodeinfo[x].gfxlayout->total)
static TILE_GET_INFO( get_tile_info_A_8 )
{
@@ -495,7 +495,7 @@ static STATE_POSTLOAD( ygv608_postload )
SetPostShortcuts(machine, i);
}
-static void ygv608_register_state_save(running_machine *machine)
+static void ygv608_register_state_save(running_machine &machine)
{
state_save_register_item_array(machine, "ygv608", NULL, 0, ygv608.ports.b);
state_save_register_item_array(machine, "ygv608", NULL, 0, ygv608.regs.b);
@@ -504,7 +504,7 @@ static void ygv608_register_state_save(running_machine *machine)
state_save_register_item_2d_array(machine, "ygv608", NULL, 0, ygv608.scroll_data_table);
state_save_register_item_2d_array(machine, "ygv608", NULL, 0, ygv608.colour_palette);
- machine->state().register_postload(ygv608_postload, NULL);
+ machine.state().register_postload(ygv608_postload, NULL);
}
static void ygv608_exit(running_machine &machine)
@@ -544,10 +544,10 @@ VIDEO_START( ygv608 )
tilemap_B = NULL;
ygv608_register_state_save(machine);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ygv608_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ygv608_exit);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
#ifdef _ENABLE_SPRITES
@@ -600,20 +600,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
logerror( "SZ_8X8: sprite=%d\n", code );
code = 0;
}
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
code+namcond1_gfxbank*0x10000,
color,
flipx,flipy,
sx,sy,0x00);
// redraw with wrap-around
if( sx > 512-8 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
code+namcond1_gfxbank*0x10000,
color,
flipx,flipy,
sx-512,sy,0x00);
if( sy > 512-8 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_8X8_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
code+namcond1_gfxbank*0x10000,
color,
flipx,flipy,
@@ -630,20 +630,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
logerror( "SZ_8X8: sprite=%d\n", code );
code = 0;
}
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
code+namcond1_gfxbank*0x4000,
color,
flipx,flipy,
sx,sy,0x00);
// redraw with wrap-around
if( sx > 512-16 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
code+namcond1_gfxbank*0x4000,
color,
flipx,flipy,
sx-512,sy,0x00);
if( sy > 512-16 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_16X16_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
code+namcond1_gfxbank*0x4000,
color,
flipx,flipy,
@@ -660,20 +660,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
logerror( "SZ_32X32: sprite=%d\n", code );
code = 0;
}
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
code+namcond1_gfxbank*0x1000,
color,
flipx,flipy,
sx,sy,0x00);
// redraw with wrap-around
if( sx > 512-32 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
code+namcond1_gfxbank*0x1000,
color,
flipx,flipy,
sx-512,sy,0x00);
if( sy > 512-32 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_32X32_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
code+namcond1_gfxbank*0x1000,
color,
flipx,flipy,
@@ -690,20 +690,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
logerror( "SZ_64X64: sprite=%d\n", code );
code = 0;
}
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
code+namcond1_gfxbank*0x400,
color,
flipx,flipy,
sx,sy,0x00);
// redraw with wrap-around
if( sx > 512-64 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
code+namcond1_gfxbank*0x400,
color,
flipx,flipy,
sx-512,sy,0x00);
if( sy > 512-64 )
- drawgfx_transpen( bitmap, &spriteClip,machine->gfx[GFX_64X64_4BIT],
+ drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
code+namcond1_gfxbank*0x400,
color,
flipx,flipy,
@@ -770,7 +770,7 @@ SCREEN_UPDATE( ygv608 )
0, ((int)(ygv608.regs.s.vdw)<<3)-1 );
#endif
- auto_free( screen->machine, work_bitmap );
+ auto_free( screen->machine(), work_bitmap );
work_bitmap = screen->alloc_compatible_bitmap();
// reset resize flag
@@ -902,7 +902,7 @@ SCREEN_UPDATE( ygv608 )
if ((ygv608.regs.s.r11 & r11_prm) == PRM_ASBDEX ||
(ygv608.regs.s.r11 & r11_prm) == PRM_ASEBDX )
- draw_sprites(screen->machine, bitmap,cliprect );
+ draw_sprites(screen->machine(), bitmap,cliprect );
tilemap_draw( work_bitmap,cliprect, tilemap_A, 0, 0 );
@@ -919,7 +919,7 @@ SCREEN_UPDATE( ygv608 )
if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX ||
(ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX)
- draw_sprites(screen->machine, bitmap,cliprect );
+ draw_sprites(screen->machine(), bitmap,cliprect );
#ifdef _SHOW_VIDEO_DEBUG
@@ -1215,7 +1215,7 @@ WRITE16_HANDLER( ygv608_w )
if (++p3_state == 3)
{
p3_state = 0;
- palette_set_color_rgb(space->machine,ygv608.regs.s.cc,
+ palette_set_color_rgb(space->machine(),ygv608.regs.s.cc,
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][0]),
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][1]),
pal6bit(ygv608.colour_palette[ygv608.regs.s.cc][2]) );
@@ -1232,7 +1232,7 @@ WRITE16_HANDLER( ygv608_w )
#endif
SetPreShortcuts (regNum, data);
ygv608.regs.b[regNum] = data;
- SetPostShortcuts (space->machine, regNum);
+ SetPostShortcuts (space->machine(), regNum);
if (ygv608.ports.s.p5 & p5_rwai)
{
regNum ++;
@@ -1259,9 +1259,9 @@ WRITE16_HANDLER( ygv608_w )
case 0x07: /* P#7 - system control port */
ygv608.ports.b[7] = data;
if (ygv608.ports.b[7] & 0x3e)
- HandleRomTransfers(space->machine);
+ HandleRomTransfers(space->machine());
if (ygv608.ports.b[7] & 0x01)
- HandleYGV608Reset(space->machine);
+ HandleYGV608Reset(space->machine());
break;
default:
@@ -1270,7 +1270,7 @@ WRITE16_HANDLER( ygv608_w )
}
}
-static void HandleYGV608Reset( running_machine *machine )
+static void HandleYGV608Reset( running_machine &machine )
{
int i;
@@ -1302,14 +1302,14 @@ static void HandleYGV608Reset( running_machine *machine )
- So leave it in!
*/
-static void HandleRomTransfers(running_machine *machine)
+static void HandleRomTransfers(running_machine &machine)
{
#if 0
static UINT8 *sdt = (UINT8 *)ygv608.scroll_data_table;
static UINT8 *sat = (UINT8 *)ygv608.sprite_attribute_table.b;
/* fudge copy from sprite data for now... */
- UINT8 *RAM = machine->memory_region[0];
+ UINT8 *RAM = machine.memory_region[0];
int i;
int src = ( ( (int)ygv608.regs.s.tb13 << 8 ) +
@@ -1414,7 +1414,7 @@ static void SetPreShortcuts( int reg, int data )
// Set any "short-cut" variables after we have updated the YGV608 registers
// - these are used only in optimisation of the emulation
-static void SetPostShortcuts( running_machine *machine, int reg )
+static void SetPostShortcuts( running_machine &machine, int reg )
{
int plane, addr;
@@ -1425,7 +1425,7 @@ static void SetPostShortcuts( running_machine *machine, int reg )
UINT8 yTile = ygv608.regs.s.r0 & r0_pny;
if (yTile >= ygv608.page_y)
- logerror ("%s:setting pny(%d) >= page_y(%d)\n", machine->describe_context(),
+ logerror ("%s:setting pny(%d) >= page_y(%d)\n", machine.describe_context(),
yTile, ygv608.page_y );
yTile &= (ygv608.page_y - 1);
ygv608.regs.s.r0 &= ~r0_pny;
@@ -1438,7 +1438,7 @@ static void SetPostShortcuts( running_machine *machine, int reg )
UINT8 xTile = ygv608.regs.s.r1 & r1_pnx;
if (xTile >= ygv608.page_x)
- logerror ("%s:setting pnx(%d) >= page_x(%d)\n", machine->describe_context(),
+ logerror ("%s:setting pnx(%d) >= page_x(%d)\n", machine.describe_context(),
xTile, ygv608.page_x );
xTile &= (ygv608.page_x - 1);
ygv608.regs.s.r1 &= ~r1_pnx;
diff --git a/src/mame/video/yiear.c b/src/mame/video/yiear.c
index ec23f35d560..94423d1facb 100644
--- a/src/mame/video/yiear.c
+++ b/src/mame/video/yiear.c
@@ -32,7 +32,7 @@ PALETTE_INIT( yiear )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -61,19 +61,19 @@ PALETTE_INIT( yiear )
WRITE8_HANDLER( yiear_videoram_w )
{
- yiear_state *state = space->machine->driver_data<yiear_state>();
+ yiear_state *state = space->machine().driver_data<yiear_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
WRITE8_HANDLER( yiear_control_w )
{
- yiear_state *state = space->machine->driver_data<yiear_state>();
+ yiear_state *state = space->machine().driver_data<yiear_state>();
/* bit 0 flips screen */
- if (flip_screen_get(space->machine) != (data & 0x01))
+ if (flip_screen_get(space->machine()) != (data & 0x01))
{
- flip_screen_set(space->machine, data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
/* bit 1 is NMI enable */
@@ -83,13 +83,13 @@ WRITE8_HANDLER( yiear_control_w )
interrupt_enable_w(space, 0, data & 0x04);
/* bits 3 and 4 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- yiear_state *state = machine->driver_data<yiear_state>();
+ yiear_state *state = machine.driver_data<yiear_state>();
int offs = tile_index * 2;
int attr = state->videoram[offs];
int code = state->videoram[offs + 1] | ((attr & 0x10) << 4);
@@ -101,13 +101,13 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( yiear )
{
- yiear_state *state = machine->driver_data<yiear_state>();
+ yiear_state *state = machine.driver_data<yiear_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- yiear_state *state = machine->driver_data<yiear_state>();
+ yiear_state *state = machine.driver_data<yiear_state>();
UINT8 *spriteram = state->spriteram;
UINT8 *spriteram_2 = state->spriteram2;
int offs;
@@ -134,7 +134,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[1],
+ machine.gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -143,9 +143,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( yiear )
{
- yiear_state *state = screen->machine->driver_data<yiear_state>();
+ yiear_state *state = screen->machine().driver_data<yiear_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/yunsun16.c b/src/mame/video/yunsun16.c
index a9f4a46f308..deba5e66f22 100644
--- a/src/mame/video/yunsun16.c
+++ b/src/mame/video/yunsun16.c
@@ -49,7 +49,7 @@ static TILEMAP_MAPPER( yunsun16_tilemap_scan_pages )
static TILE_GET_INFO( get_tile_info_0 )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
UINT16 code = state->vram_0[2 * tile_index + 0];
UINT16 attr = state->vram_0[2 * tile_index + 1];
SET_TILE_INFO(
@@ -61,7 +61,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
UINT16 code = state->vram_1[2 * tile_index + 0];
UINT16 attr = state->vram_1[2 * tile_index + 1];
SET_TILE_INFO(
@@ -73,7 +73,7 @@ static TILE_GET_INFO( get_tile_info_1 )
WRITE16_HANDLER( yunsun16_vram_0_w )
{
- yunsun16_state *state = space->machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = space->machine().driver_data<yunsun16_state>();
COMBINE_DATA(&state->vram_0[offset]);
tilemap_mark_tile_dirty(state->tilemap_0, offset / 2);
@@ -81,7 +81,7 @@ WRITE16_HANDLER( yunsun16_vram_0_w )
WRITE16_HANDLER( yunsun16_vram_1_w )
{
- yunsun16_state *state = space->machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = space->machine().driver_data<yunsun16_state>();
COMBINE_DATA(&state->vram_1[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset / 2);
@@ -98,7 +98,7 @@ WRITE16_HANDLER( yunsun16_vram_1_w )
VIDEO_START( yunsun16 )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0,yunsun16_tilemap_scan_pages,
16,16, TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
@@ -136,11 +136,11 @@ VIDEO_START( yunsun16 )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- yunsun16_state *state = machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = machine.driver_data<yunsun16_state>();
int offs;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
int max_x = visarea.max_x + 1;
int max_y = visarea.max_y + 1;
@@ -180,12 +180,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy; y = max_y - y - 16;
}
- pdrawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ pdrawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
attr & 0x1f,
flipx, flipy,
x,y,
- machine->priority_bitmap,
+ machine.priority_bitmap,
pri_mask,15);
}
}
@@ -202,7 +202,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( yunsun16 )
{
- yunsun16_state *state = screen->machine->driver_data<yunsun16_state>();
+ yunsun16_state *state = screen->machine().driver_data<yunsun16_state>();
tilemap_set_scrollx(state->tilemap_0, 0, state->scrollram_0[0]);
tilemap_set_scrolly(state->tilemap_0, 0, state->scrollram_0[1]);
@@ -212,7 +212,7 @@ SCREEN_UPDATE( yunsun16 )
//popmessage("%04X", *state->priorityram);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
if ((*state->priorityram & 0x0c) == 4)
{
@@ -229,6 +229,6 @@ SCREEN_UPDATE( yunsun16 )
tilemap_draw(bitmap, cliprect, state->tilemap_0, 0, 2);
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/yunsung8.c b/src/mame/video/yunsung8.c
index 2502a7c8102..82f7e452d6f 100644
--- a/src/mame/video/yunsung8.c
+++ b/src/mame/video/yunsung8.c
@@ -39,14 +39,14 @@ Note: if MAME_DEBUG is defined, pressing Z with:
WRITE8_HANDLER( yunsung8_videobank_w )
{
- yunsung8_state *state = space->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = space->machine().driver_data<yunsung8_state>();
state->videobank = data;
}
READ8_HANDLER( yunsung8_videoram_r )
{
- yunsung8_state *state = space->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = space->machine().driver_data<yunsung8_state>();
int bank;
/* Bit 1 of the bankswitching register contols the c000-c7ff
@@ -66,7 +66,7 @@ READ8_HANDLER( yunsung8_videoram_r )
WRITE8_HANDLER( yunsung8_videoram_w )
{
- yunsung8_state *state = space->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = space->machine().driver_data<yunsung8_state>();
if (offset < 0x0800) // c000-c7ff Banked Palette RAM
{
@@ -83,7 +83,7 @@ WRITE8_HANDLER( yunsung8_videoram_w )
color = RAM[offset & ~1] | (RAM[offset | 1] << 8);
/* BBBBBGGGGGRRRRRx */
- palette_set_color_rgb(space->machine, offset / 2 + (bank ? 0x400 : 0), pal5bit(color >> 0), pal5bit(color >> 5), pal5bit(color >> 10));
+ palette_set_color_rgb(space->machine(), offset / 2 + (bank ? 0x400 : 0), pal5bit(color >> 0), pal5bit(color >> 5), pal5bit(color >> 10));
}
else
{
@@ -111,7 +111,7 @@ WRITE8_HANDLER( yunsung8_videoram_w )
WRITE8_HANDLER( yunsung8_flipscreen_w )
{
- tilemap_set_flip_all(space->machine, (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ tilemap_set_flip_all(space->machine(), (data & 1) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
@@ -136,7 +136,7 @@ WRITE8_HANDLER( yunsung8_flipscreen_w )
static TILE_GET_INFO( get_tile_info_0 )
{
- yunsung8_state *state = machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = machine.driver_data<yunsung8_state>();
int code = state->videoram_0[0x1000 + tile_index * 2 + 0] + state->videoram_0[0x1000 + tile_index * 2 + 1] * 256;
int color = state->videoram_0[0x0800 + tile_index] & 0x07;
SET_TILE_INFO(
@@ -153,7 +153,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- yunsung8_state *state = machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = machine.driver_data<yunsung8_state>();
int code = state->videoram_1[0x1000 + tile_index * 2 + 0] + state->videoram_1[0x1000 + tile_index * 2 + 1] * 256;
int color = state->videoram_1[0x0800 + tile_index] & 0x3f;
SET_TILE_INFO(
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_tile_info_1 )
VIDEO_START( yunsung8 )
{
- yunsung8_state *state = machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = machine.driver_data<yunsung8_state>();
state->tilemap_0 = tilemap_create(machine, get_tile_info_0, tilemap_scan_rows, 8, 8, DIM_NX_0, DIM_NY_0 );
state->tilemap_1 = tilemap_create(machine, get_tile_info_1, tilemap_scan_rows, 8, 8, DIM_NX_1, DIM_NY_1 );
@@ -196,15 +196,15 @@ VIDEO_START( yunsung8 )
SCREEN_UPDATE( yunsung8 )
{
- yunsung8_state *state = screen->machine->driver_data<yunsung8_state>();
+ yunsung8_state *state = screen->machine().driver_data<yunsung8_state>();
int layers_ctrl = (~state->layers_ctrl) >> 4;
#ifdef MAME_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
diff --git a/src/mame/video/zac2650.c b/src/mame/video/zac2650.c
index 5f9d7467d70..f13842a1bd7 100644
--- a/src/mame/video/zac2650.c
+++ b/src/mame/video/zac2650.c
@@ -17,7 +17,7 @@
WRITE8_HANDLER( tinvader_videoram_w )
{
- zac2650_state *state = space->machine->driver_data<zac2650_state>();
+ zac2650_state *state = space->machine().driver_data<zac2650_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -25,39 +25,39 @@ WRITE8_HANDLER( tinvader_videoram_w )
READ8_HANDLER( zac_s2636_r )
{
- zac2650_state *state = space->machine->driver_data<zac2650_state>();
+ zac2650_state *state = space->machine().driver_data<zac2650_state>();
if(offset!=0xCB) return state->s2636_0_ram[offset];
else return state->CollisionSprite;
}
WRITE8_HANDLER( zac_s2636_w )
{
- zac2650_state *state = space->machine->driver_data<zac2650_state>();
+ zac2650_state *state = space->machine().driver_data<zac2650_state>();
state->s2636_0_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], offset/8);
- gfx_element_mark_dirty(space->machine->gfx[2], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/8);
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/8);
if (offset == 0xc7)
{
- s2636_soundport_w(space->machine->device("s2636snd"), 0, data);
+ s2636_soundport_w(space->machine().device("s2636snd"), 0, data);
}
}
READ8_HANDLER( tinvader_port_0_r )
{
- zac2650_state *state = space->machine->driver_data<zac2650_state>();
- return input_port_read(space->machine, "1E80") - state->CollisionBackground;
+ zac2650_state *state = space->machine().driver_data<zac2650_state>();
+ return input_port_read(space->machine(), "1E80") - state->CollisionBackground;
}
/*****************************************/
/* Check for Collision between 2 sprites */
/*****************************************/
-static int SpriteCollision(running_machine *machine, int first,int second)
+static int SpriteCollision(running_machine &machine, int first,int second)
{
- zac2650_state *state = machine->driver_data<zac2650_state>();
+ zac2650_state *state = machine.driver_data<zac2650_state>();
int Checksum=0;
int x,y;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
if((state->s2636_0_ram[first * 0x10 + 10] < 0xf0) && (state->s2636_0_ram[second * 0x10 + 10] < 0xf0))
{
@@ -67,7 +67,7 @@ static int SpriteCollision(running_machine *machine, int first,int second)
/* Draw first sprite */
- drawgfx_opaque(state->spritebitmap,0, machine->gfx[expand],
+ drawgfx_opaque(state->spritebitmap,0, machine.gfx[expand],
first * 2,
0,
0,0,
@@ -75,9 +75,9 @@ static int SpriteCollision(running_machine *machine, int first,int second)
/* Get fingerprint */
- for (x = fx; x < fx + machine->gfx[expand]->width; x++)
+ for (x = fx; x < fx + machine.gfx[expand]->width; x++)
{
- for (y = fy; y < fy + machine->gfx[expand]->height; y++)
+ for (y = fy; y < fy + machine.gfx[expand]->height; y++)
{
if ((x < visarea.min_x) ||
(x > visarea.max_x) ||
@@ -93,7 +93,7 @@ static int SpriteCollision(running_machine *machine, int first,int second)
/* Blackout second sprite */
- drawgfx_transpen(state->spritebitmap,0, machine->gfx[1],
+ drawgfx_transpen(state->spritebitmap,0, machine.gfx[1],
second * 2,
1,
0,0,
@@ -101,9 +101,9 @@ static int SpriteCollision(running_machine *machine, int first,int second)
/* Remove fingerprint */
- for (x = fx; x < fx + machine->gfx[expand]->width; x++)
+ for (x = fx; x < fx + machine.gfx[expand]->width; x++)
{
- for (y = fy; y < fy + machine->gfx[expand]->height; y++)
+ for (y = fy; y < fy + machine.gfx[expand]->height; y++)
{
if ((x < visarea.min_x) ||
(x > visarea.max_x) ||
@@ -119,7 +119,7 @@ static int SpriteCollision(running_machine *machine, int first,int second)
/* Zero bitmap */
- drawgfx_opaque(state->spritebitmap,0, machine->gfx[expand],
+ drawgfx_opaque(state->spritebitmap,0, machine.gfx[expand],
first * 2,
1,
0,0,
@@ -131,7 +131,7 @@ static int SpriteCollision(running_machine *machine, int first,int second)
static TILE_GET_INFO( get_bg_tile_info )
{
- zac2650_state *state = machine->driver_data<zac2650_state>();
+ zac2650_state *state = machine.driver_data<zac2650_state>();
UINT8 *videoram = state->videoram;
int code = videoram[tile_index];
@@ -140,22 +140,22 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( tinvader )
{
- zac2650_state *state = machine->driver_data<zac2650_state>();
+ zac2650_state *state = machine.driver_data<zac2650_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
24, 24, 32, 32);
- state->spritebitmap = machine->primary_screen->alloc_compatible_bitmap();
- machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->spritebitmap = machine.primary_screen->alloc_compatible_bitmap();
+ machine.generic.tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
- gfx_element_set_source(machine->gfx[1], state->s2636_0_ram);
- gfx_element_set_source(machine->gfx[2], state->s2636_0_ram);
+ gfx_element_set_source(machine.gfx[1], state->s2636_0_ram);
+ gfx_element_set_source(machine.gfx[2], state->s2636_0_ram);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap)
{
- zac2650_state *state = machine->driver_data<zac2650_state>();
+ zac2650_state *state = machine.driver_data<zac2650_state>();
int offs;
- const rectangle &visarea = machine->primary_screen->visible_area();
+ const rectangle &visarea = machine.primary_screen->visible_area();
/* -------------------------------------------------------------- */
/* There seems to be a strange setup with this board, in that it */
@@ -171,7 +171,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
state->CollisionBackground = 0; /* Read from 0x1e80 bit 7 */
// for collision detection checking
- copybitmap(machine->generic.tmpbitmap,bitmap,0,0,0,0,&visarea);
+ copybitmap(machine.generic.tmpbitmap,bitmap,0,0,0,0,&visarea);
for(offs=0;offs<0x50;offs+=0x10)
{
@@ -184,15 +184,15 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
int x,y;
/* Sprite->Background collision detection */
- drawgfx_transpen(bitmap,0, machine->gfx[expand],
+ drawgfx_transpen(bitmap,0, machine.gfx[expand],
spriteno,
1,
0,0,
bx,by, 0);
- for (x = bx; x < bx + machine->gfx[expand]->width; x++)
+ for (x = bx; x < bx + machine.gfx[expand]->width; x++)
{
- for (y = by; y < by + machine->gfx[expand]->height; y++)
+ for (y = by; y < by + machine.gfx[expand]->height; y++)
{
if ((x < visarea.min_x) ||
(x > visarea.max_x) ||
@@ -202,7 +202,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
continue;
}
- if (*BITMAP_ADDR16(bitmap, y, x) != *BITMAP_ADDR16(machine->generic.tmpbitmap, y, x))
+ if (*BITMAP_ADDR16(bitmap, y, x) != *BITMAP_ADDR16(machine.generic.tmpbitmap, y, x))
{
state->CollisionBackground = 0x80;
break;
@@ -210,7 +210,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
}
}
- drawgfx_transpen(bitmap,0, machine->gfx[expand],
+ drawgfx_transpen(bitmap,0, machine.gfx[expand],
spriteno,
0,
0,0,
@@ -230,8 +230,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
SCREEN_UPDATE( tinvader )
{
- zac2650_state *state = screen->machine->driver_data<zac2650_state>();
+ zac2650_state *state = screen->machine().driver_data<zac2650_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap);
+ draw_sprites(screen->machine(), bitmap);
return 0;
}
diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c
index eb62adf08a3..cc98e565605 100644
--- a/src/mame/video/zaccaria.c
+++ b/src/mame/video/zaccaria.c
@@ -47,7 +47,7 @@ PALETTE_INIT( zaccaria )
0, 0, 0, 0, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x200);
+ machine.colortable = colortable_alloc(machine, 0x200);
for (i = 0; i < 0x200; i++)
{
@@ -60,7 +60,7 @@ PALETTE_INIT( zaccaria )
black anyway.
*/
if (((i % 64) / 8) == 0)
- colortable_palette_set_color(machine->colortable, i, RGB_BLACK);
+ colortable_palette_set_color(machine.colortable, i, RGB_BLACK);
else
{
int bit0, bit1, bit2;
@@ -83,7 +83,7 @@ PALETTE_INIT( zaccaria )
bit1 = (color_prom[i + 0x200] >> 0) & 0x01;
b = combine_2_weights(weights_b, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
}
@@ -95,13 +95,13 @@ PALETTE_INIT( zaccaria )
for (j = 0;j < 4;j++)
for (k = 0;k < 8;k++)
/* swap j and k to make the colors sequential */
- colortable_entry_set_value(machine->colortable, 0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j);
+ colortable_entry_set_value(machine.colortable, 0 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j);
for (i = 0;i < 8;i++)
for (j = 0;j < 4;j++)
for (k = 0;k < 8;k++)
/* swap j and k to make the colors sequential */
- colortable_entry_set_value(machine->colortable, 256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j+1);
+ colortable_entry_set_value(machine.colortable, 256 + 32 * i + 8 * j + k, 64 * i + 8 * k + 2*j+1);
}
@@ -114,7 +114,7 @@ PALETTE_INIT( zaccaria )
static TILE_GET_INFO( get_tile_info )
{
- zaccaria_state *state = machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = machine.driver_data<zaccaria_state>();
UINT8 attr = state->videoram[tile_index + 0x400];
SET_TILE_INFO(
0,
@@ -133,7 +133,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( zaccaria )
{
- zaccaria_state *state = machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = machine.driver_data<zaccaria_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan_rows,8,8,32,32);
tilemap_set_scroll_cols(state->bg_tilemap,32);
@@ -149,14 +149,14 @@ VIDEO_START( zaccaria )
WRITE8_HANDLER( zaccaria_videoram_w )
{
- zaccaria_state *state = space->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = space->machine().driver_data<zaccaria_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset & 0x3ff);
}
WRITE8_HANDLER( zaccaria_attributes_w )
{
- zaccaria_state *state = space->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = space->machine().driver_data<zaccaria_state>();
if (offset & 1)
{
if (state->attributesram[offset] != data)
@@ -175,12 +175,12 @@ WRITE8_HANDLER( zaccaria_attributes_w )
WRITE8_HANDLER( zaccaria_flip_screen_x_w )
{
- flip_screen_x_set(space->machine, data & 1);
+ flip_screen_x_set(space->machine(), data & 1);
}
WRITE8_HANDLER( zaccaria_flip_screen_y_w )
{
- flip_screen_y_set(space->machine, data & 1);
+ flip_screen_y_set(space->machine(), data & 1);
}
@@ -206,7 +206,7 @@ WRITE8_HANDLER( zaccaria_flip_screen_y_w )
offsets 1 and 2 are swapped if accessed from spriteram2
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,UINT8 *spriteram,int color,int section)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT8 *spriteram,int color,int section)
{
int offs,o1 = 1,o2 = 2;
@@ -236,7 +236,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
(spriteram[offs + o1] & 0x3f) + (spriteram[offs + o2] & 0xc0),
((spriteram[offs + o2] & 0x07) << 2) | color,
flipx,flipy,sx,sy,0);
@@ -245,14 +245,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( zaccaria )
{
- zaccaria_state *state = screen->machine->driver_data<zaccaria_state>();
+ zaccaria_state *state = screen->machine().driver_data<zaccaria_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
// 3 layers of sprites, each with their own palette and priorities
// Not perfect yet, does spriteram(1) layer have a priority bit somewhere?
- draw_sprites(screen->machine,bitmap,cliprect,state->spriteram2,2,1);
- draw_sprites(screen->machine,bitmap,cliprect,state->spriteram,1,0);
- draw_sprites(screen->machine,bitmap,cliprect,state->spriteram2+0x20,0,1);
+ draw_sprites(screen->machine(),bitmap,cliprect,state->spriteram2,2,1);
+ draw_sprites(screen->machine(),bitmap,cliprect,state->spriteram,1,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,state->spriteram2+0x20,0,1);
return 0;
}
diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c
index 4722830de7b..a7c10e6e15d 100644
--- a/src/mame/video/zaxxon.c
+++ b/src/mame/video/zaxxon.c
@@ -17,7 +17,7 @@
PALETTE_INIT( zaxxon )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
static const int resistances[3] = { 1000, 470, 220 };
double rweights[3], gweights[3], bweights[2];
int i;
@@ -29,7 +29,7 @@ PALETTE_INIT( zaxxon )
2, &resistances[1], bweights, 470, 0);
/* initialize the palette with these colors */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -68,8 +68,8 @@ PALETTE_INIT( zaxxon )
static TILE_GET_INFO( get_bg_tile_info )
{
- const UINT8 *source = machine->region("tilemap_dat")->base();
- int size = machine->region("tilemap_dat")->bytes() / 2;
+ const UINT8 *source = machine.region("tilemap_dat")->base();
+ int size = machine.region("tilemap_dat")->bytes() / 2;
int eff_index = tile_index & (size - 1);
int code = source[eff_index] + 256 * (source[eff_index + size] & 3);
int color = source[eff_index + size] >> 4;
@@ -80,7 +80,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( zaxxon_get_fg_tile_info )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
int sx = tile_index % 32;
int sy = tile_index / 32;
int code = state->videoram[tile_index];
@@ -92,7 +92,7 @@ static TILE_GET_INFO( zaxxon_get_fg_tile_info )
static TILE_GET_INFO( razmataz_get_fg_tile_info )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
int code = state->videoram[tile_index];
int color = state->color_codes[code] & 0x0f;
@@ -102,7 +102,7 @@ static TILE_GET_INFO( razmataz_get_fg_tile_info )
static TILE_GET_INFO( congo_get_fg_tile_info )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
int code = state->videoram[tile_index] + (state->congo_fg_bank << 8);
int color = state->colorram[tile_index] & 0x1f;
@@ -117,9 +117,9 @@ static TILE_GET_INFO( congo_get_fg_tile_info )
*
*************************************/
-static void video_start_common(running_machine *machine, tile_get_info_func fg_tile_info)
+static void video_start_common(running_machine &machine, tile_get_info_func fg_tile_info)
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
/* reset globals */
state->bg_enable = 0;
@@ -136,8 +136,8 @@ static void video_start_common(running_machine *machine, tile_get_info_func fg_t
/* configure the foreground tilemap */
tilemap_set_transparent_pen(state->fg_tilemap, 0);
- tilemap_set_scrolldx(state->fg_tilemap, 0, machine->primary_screen->width() - 256);
- tilemap_set_scrolldy(state->fg_tilemap, 0, machine->primary_screen->height() - 256);
+ tilemap_set_scrolldx(state->fg_tilemap, 0, machine.primary_screen->width() - 256);
+ tilemap_set_scrolldy(state->fg_tilemap, 0, machine.primary_screen->height() - 256);
/* register for save states */
state->save_item(NAME(state->bg_enable));
@@ -161,7 +161,7 @@ VIDEO_START( razmataz )
VIDEO_START( congo )
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
/* allocate our own spriteram since it is not accessible by the main CPU */
state->spriteram = auto_alloc_array(machine, UINT8, 0x100);
@@ -185,17 +185,17 @@ VIDEO_START( congo )
WRITE8_HANDLER( zaxxon_flipscreen_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit controls flip; background and sprite flip are handled at render time */
- flip_screen_set_no_update(space->machine, ~data & 1);
- tilemap_set_flip(state->fg_tilemap, flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ flip_screen_set_no_update(space->machine(), ~data & 1);
+ tilemap_set_flip(state->fg_tilemap, flip_screen_get(space->machine()) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
}
WRITE8_HANDLER( zaxxon_fg_color_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit selects high color palette index */
state->fg_color = (data & 1) * 0x80;
@@ -205,7 +205,7 @@ WRITE8_HANDLER( zaxxon_fg_color_w )
WRITE8_HANDLER( zaxxon_bg_position_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* 11 bits of scroll position are stored */
if (offset == 0)
@@ -217,7 +217,7 @@ WRITE8_HANDLER( zaxxon_bg_position_w )
WRITE8_HANDLER( zaxxon_bg_color_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit selects high color palette index */
state->bg_color = (data & 1) * 0x80;
@@ -226,7 +226,7 @@ WRITE8_HANDLER( zaxxon_bg_color_w )
WRITE8_HANDLER( zaxxon_bg_enable_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit enables/disables the background layer */
state->bg_enable = data & 1;
@@ -235,7 +235,7 @@ WRITE8_HANDLER( zaxxon_bg_enable_w )
WRITE8_HANDLER( congo_fg_bank_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit controls the topmost character bit */
state->congo_fg_bank = data & 1;
@@ -245,7 +245,7 @@ WRITE8_HANDLER( congo_fg_bank_w )
WRITE8_HANDLER( congo_color_bank_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
/* low bit controls the topmost bit into the color PROM */
state->congo_color_bank = data & 1;
@@ -262,7 +262,7 @@ WRITE8_HANDLER( congo_color_bank_w )
WRITE8_HANDLER( zaxxon_videoram_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -271,7 +271,7 @@ WRITE8_HANDLER( zaxxon_videoram_w )
WRITE8_HANDLER( congo_colorram_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -287,7 +287,7 @@ WRITE8_HANDLER( congo_colorram_w )
WRITE8_HANDLER( congo_sprite_custom_w )
{
- zaxxon_state *state = space->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = space->machine().driver_data<zaxxon_state>();
UINT8 *spriteram = state->spriteram;
state->congo_custom[offset] = data;
@@ -322,9 +322,9 @@ WRITE8_HANDLER( congo_sprite_custom_w )
*
*************************************/
-static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int skew)
+static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int skew)
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
/* only draw if enabled */
if (state->bg_enable)
@@ -440,11 +440,11 @@ INLINE int find_minimum_x(UINT8 value, int flip)
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask)
{
- zaxxon_state *state = machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = machine.driver_data<zaxxon_state>();
UINT8 *spriteram = state->spriteram;
- const gfx_element *gfx = machine->gfx[2];
+ const gfx_element *gfx = machine.gfx[2];
int flip = flip_screen_get(machine);
int flipmask = flip ? 0xff : 0x00;
int offs;
@@ -477,10 +477,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( zaxxon )
{
- zaxxon_state *state = screen->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = screen->machine().driver_data<zaxxon_state>();
- draw_background(screen->machine, bitmap, cliprect, TRUE);
- draw_sprites(screen->machine, bitmap, cliprect, 0x140, 0x180);
+ draw_background(screen->machine(), bitmap, cliprect, TRUE);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x140, 0x180);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -488,10 +488,10 @@ SCREEN_UPDATE( zaxxon )
SCREEN_UPDATE( futspy )
{
- zaxxon_state *state = screen->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = screen->machine().driver_data<zaxxon_state>();
- draw_background(screen->machine, bitmap, cliprect, TRUE);
- draw_sprites(screen->machine, bitmap, cliprect, 0x180, 0x180);
+ draw_background(screen->machine(), bitmap, cliprect, TRUE);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x180, 0x180);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -499,10 +499,10 @@ SCREEN_UPDATE( futspy )
SCREEN_UPDATE( razmataz )
{
- zaxxon_state *state = screen->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = screen->machine().driver_data<zaxxon_state>();
- draw_background(screen->machine, bitmap, cliprect, FALSE);
- draw_sprites(screen->machine, bitmap, cliprect, 0x140, 0x180);
+ draw_background(screen->machine(), bitmap, cliprect, FALSE);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x140, 0x180);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -510,10 +510,10 @@ SCREEN_UPDATE( razmataz )
SCREEN_UPDATE( congo )
{
- zaxxon_state *state = screen->machine->driver_data<zaxxon_state>();
+ zaxxon_state *state = screen->machine().driver_data<zaxxon_state>();
- draw_background(screen->machine, bitmap, cliprect, TRUE);
- draw_sprites(screen->machine, bitmap, cliprect, 0x280, 0x180);
+ draw_background(screen->machine(), bitmap, cliprect, TRUE);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0x280, 0x180);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
diff --git a/src/mame/video/zerozone.c b/src/mame/video/zerozone.c
index bfc008b8886..85aa1b3aad4 100644
--- a/src/mame/video/zerozone.c
+++ b/src/mame/video/zerozone.c
@@ -9,7 +9,7 @@
WRITE16_HANDLER( zerozone_tilemap_w )
{
- zerozone_state *state = space->machine->driver_data<zerozone_state>();
+ zerozone_state *state = space->machine().driver_data<zerozone_state>();
COMBINE_DATA(&state->videoram[offset]);
tilemap_mark_tile_dirty(state->zz_tilemap,offset);
@@ -18,7 +18,7 @@ WRITE16_HANDLER( zerozone_tilemap_w )
WRITE16_HANDLER(zerozone_tilebank_w)
{
- zerozone_state *state = space->machine->driver_data<zerozone_state>();
+ zerozone_state *state = space->machine().driver_data<zerozone_state>();
// popmessage ("Data %04x",data);
state->tilebank = data & 0x07;
@@ -27,7 +27,7 @@ WRITE16_HANDLER(zerozone_tilebank_w)
static TILE_GET_INFO( get_zerozone_tile_info )
{
- zerozone_state *state = machine->driver_data<zerozone_state>();
+ zerozone_state *state = machine.driver_data<zerozone_state>();
int tileno = state->videoram[tile_index] & 0x07ff;
int colour = state->videoram[tile_index] & 0xf000;
@@ -39,7 +39,7 @@ static TILE_GET_INFO( get_zerozone_tile_info )
VIDEO_START( zerozone )
{
- zerozone_state *state = machine->driver_data<zerozone_state>();
+ zerozone_state *state = machine.driver_data<zerozone_state>();
// i'm not 100% sure it should be opaque, pink title screen looks strange in las vegas girls
// but if its transparent other things look incorrect
@@ -48,7 +48,7 @@ VIDEO_START( zerozone )
SCREEN_UPDATE( zerozone )
{
- zerozone_state *state = screen->machine->driver_data<zerozone_state>();
+ zerozone_state *state = screen->machine().driver_data<zerozone_state>();
tilemap_draw(bitmap, cliprect, state->zz_tilemap, 0, 0);
return 0;
diff --git a/src/mame/video/zodiack.c b/src/mame/video/zodiack.c
index bdd2dbd3de0..ae4f9ba8922 100644
--- a/src/mame/video/zodiack.c
+++ b/src/mame/video/zodiack.c
@@ -11,7 +11,7 @@
WRITE8_HANDLER( zodiack_videoram_w )
{
- zodiack_state *state = space->machine->driver_data<zodiack_state>();
+ zodiack_state *state = space->machine().driver_data<zodiack_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -19,7 +19,7 @@ WRITE8_HANDLER( zodiack_videoram_w )
WRITE8_HANDLER( zodiack_videoram2_w )
{
- zodiack_state *state = space->machine->driver_data<zodiack_state>();
+ zodiack_state *state = space->machine().driver_data<zodiack_state>();
state->videoram_2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -27,7 +27,7 @@ WRITE8_HANDLER( zodiack_videoram2_w )
WRITE8_HANDLER( zodiack_attributes_w )
{
- zodiack_state *state = space->machine->driver_data<zodiack_state>();
+ zodiack_state *state = space->machine().driver_data<zodiack_state>();
if ((offset & 1) && state->attributeram[offset] != data)
{
@@ -45,10 +45,10 @@ WRITE8_HANDLER( zodiack_attributes_w )
WRITE8_HANDLER( zodiack_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (~data & 0x01))
+ if (flip_screen_get(space->machine()) != (~data & 0x01))
{
- flip_screen_set(space->machine, ~data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), ~data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
@@ -57,7 +57,7 @@ PALETTE_INIT( zodiack )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x31);
+ machine.colortable = colortable_alloc(machine, 0x31);
/* create a lookup table for the palette */
for (i = 0; i < 0x30; i++)
@@ -83,30 +83,30 @@ PALETTE_INIT( zodiack )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* white for bullets */
- colortable_palette_set_color(machine->colortable, 0x30, RGB_WHITE);
+ colortable_palette_set_color(machine.colortable, 0x30, RGB_WHITE);
for (i = 0; i < 0x20; i++)
if ((i & 3) == 0)
- colortable_entry_set_value(machine->colortable, i, 0);
+ colortable_entry_set_value(machine.colortable, i, 0);
for (i = 0; i < 0x10; i += 2)
{
- colortable_entry_set_value(machine->colortable, 0x20 + i, 32 + (i / 2));
- colortable_entry_set_value(machine->colortable, 0x21 + i, 40 + (i / 2));
+ colortable_entry_set_value(machine.colortable, 0x20 + i, 32 + (i / 2));
+ colortable_entry_set_value(machine.colortable, 0x21 + i, 40 + (i / 2));
}
/* bullet */
- colortable_entry_set_value(machine->colortable, 0x30, 0);
- colortable_entry_set_value(machine->colortable, 0x31, 0x30);
+ colortable_entry_set_value(machine.colortable, 0x30, 0);
+ colortable_entry_set_value(machine.colortable, 0x31, 0x30);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
int code = state->videoram_2[tile_index];
int color = (state->attributeram[2 * (tile_index % 32) + 1] >> 4) & 0x07;
@@ -116,7 +116,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
int code = state->videoram[tile_index];
int color = state->attributeram[2 * (tile_index % 32) + 1] & 0x07;
@@ -126,7 +126,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( zodiack )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -138,9 +138,9 @@ VIDEO_START( zodiack )
flip_screen_set_no_update(machine, 0);
}
-static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
int offs;
for (offs = 0; offs < state->bulletsram_size; offs += 4)
@@ -157,7 +157,7 @@ static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rect
drawgfx_transpen(
bitmap,
- cliprect,machine->gfx[2],
+ cliprect,machine.gfx[2],
0, /* this is just a dot, generated by the hardware */
0,
0,0,
@@ -165,9 +165,9 @@ static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rect
}
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- zodiack_state *state = machine->driver_data<zodiack_state>();
+ zodiack_state *state = machine.driver_data<zodiack_state>();
int offs;
for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4)
@@ -186,7 +186,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
spritecode,
state->spriteram[offs + 2] & 0x07,
flipx, flipy,
@@ -197,7 +197,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
SCREEN_UPDATE( zodiack )
{
- zodiack_state *state = screen->machine->driver_data<zodiack_state>();
+ zodiack_state *state = screen->machine().driver_data<zodiack_state>();
int i;
for (i = 0; i < 32; i++)
@@ -205,7 +205,7 @@ SCREEN_UPDATE( zodiack )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_bullets(screen->machine, bitmap, cliprect);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_bullets(screen->machine(), bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/osd/sdl/debugosx.h b/src/osd/sdl/debugosx.h
index 23d8accb807..58e0941349b 100644
--- a/src/osd/sdl/debugosx.h
+++ b/src/osd/sdl/debugosx.h
@@ -117,7 +117,7 @@ typedef float CGFloat;
+ (NSFont *)defaultFont;
-- (id)initWithFrame:(NSRect)f type:(debug_view_type)t machine:(running_machine *)m;
+- (id)initWithFrame:(NSRect)f type:(debug_view_type)t machine:(running_machine &)m;
- (void)update;
@@ -136,7 +136,7 @@ typedef float CGFloat;
{
}
-- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
- (NSSize)maximumFrameSize;
@@ -164,7 +164,7 @@ typedef float CGFloat;
BOOL useConsole;
}
-- (id)initWithFrame:(NSRect)f machine:(running_machine *)m useConsole:(BOOL)uc;
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m useConsole:(BOOL)uc;
- (NSSize)maximumFrameSize;
@@ -192,7 +192,7 @@ typedef float CGFloat;
{
}
-- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
- (NSSize)maximumFrameSize;
@@ -208,7 +208,7 @@ typedef float CGFloat;
{
}
-- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
@end
@@ -217,7 +217,7 @@ typedef float CGFloat;
{
}
-- (id)initWithFrame:(NSRect)f machine:(running_machine *)m;
+- (id)initWithFrame:(NSRect)f machine:(running_machine &)m;
@end
@@ -231,7 +231,7 @@ typedef float CGFloat;
+ (void)addCommonActionItems:(NSMenu *)menu;
+ (NSPopUpButton *)newActionButtonWithFrame:(NSRect)frame;
-- (id)initWithMachine:(running_machine *)m title:(NSString *)t;
+- (id)initWithMachine:(running_machine &)m title:(NSString *)t;
- (void)activate;
@@ -267,7 +267,7 @@ typedef float CGFloat;
NSTextField *commandField;
}
-- (id)initWithMachine:(running_machine *)m;
+- (id)initWithMachine:(running_machine &)m;
- (void)setCPU:(device_t *)device;
@@ -299,7 +299,7 @@ typedef float CGFloat;
+ (void)cascadeWindow:(NSWindow *)window;
-- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c;
+- (id)initWithMachine:(running_machine &)m title:(NSString *)t console:(MAMEDebugConsole *)c;
- (IBAction)debugNewMemoryWindow:(id)sender;
- (IBAction)debugNewDisassemblyWindow:(id)sender;
@@ -318,7 +318,7 @@ typedef float CGFloat;
NSTextField *expressionField;
}
-- (id)initWithMachine:(running_machine *)m title:(NSString *)t console:(MAMEDebugConsole *)c;
+- (id)initWithMachine:(running_machine &)m title:(NSString *)t console:(MAMEDebugConsole *)c;
- (id <MAMEDebugViewExpressionSupport>)documentView;
@@ -334,7 +334,7 @@ typedef float CGFloat;
MAMEMemoryView *memoryView;
}
-- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
+- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c;
- (IBAction)changeSubview:(id)sender;
@@ -346,7 +346,7 @@ typedef float CGFloat;
MAMEDisassemblyView *dasmView;
}
-- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
+- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c;
- (IBAction)changeSubview:(id)sender;
@@ -358,7 +358,7 @@ typedef float CGFloat;
MAMEErrorLogView *logView;
}
-- (id)initWithMachine:(running_machine *)m console:(MAMEDebugConsole *)c;
+- (id)initWithMachine:(running_machine &)m console:(MAMEDebugConsole *)c;
@end
@@ -370,7 +370,7 @@ typedef float CGFloat;
// PROTOTYPES
//============================================================
-void debugwin_update_during_game(running_machine *machine);
+void debugwin_update_during_game(running_machine &machine);
#endif // __SDL_DEBUGOSX__
diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c
index fc21b71de2d..0efc0843d9c 100644
--- a/src/osd/sdl/debugwin.c
+++ b/src/osd/sdl/debugwin.c
@@ -116,10 +116,10 @@ static win_i *win_list;
// PROTOTYPES
//============================================================
-static void debugmain_init(running_machine *machine);
-static void memorywin_new(running_machine *machine);
-static void disasmwin_new(running_machine *machine);
-static void logwin_new(running_machine *machine);
+static void debugmain_init(running_machine &machine);
+static void memorywin_new(running_machine &machine);
+static void disasmwin_new(running_machine &machine);
+static void logwin_new(running_machine &machine);
//============================================================
@@ -208,12 +208,12 @@ static win_i *get_first_win_i(int win_type_mask)
// add_win_i
//============================================================
-static win_i *add_win_i(running_machine *machine, int win_type)
+static win_i *add_win_i(running_machine &machine, int win_type)
{
win_i *win = (win_i *) osd_malloc(sizeof(*win));
memset(win, 0, sizeof(*win));
win->cpu = NULL;
- win->machine = machine;
+ win->machine() = machine;
win->type = win_type;
win->next = win_list;
@@ -471,7 +471,7 @@ static void debugmain_set_cpu(device_t *device)
dv->view->set_source(*dv->view->source_list().match_device(device));
// then update the caption
- title.printf("Debug: %s - %s '%s'", device->machine->system().name, device->name(), device->tag());
+ title.printf("Debug: %s - %s '%s'", device->machine().system().name, device->name(), device->tag());
gtk_window_set_title(GTK_WINDOW(dmain->win), title);
disasmview_update_checks(dmain);
}
@@ -482,7 +482,7 @@ static void debugmain_set_cpu(device_t *device)
// configuration_load
//============================================================
-static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *wnode;
@@ -508,7 +508,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
// configuration_save
//============================================================
-static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* we only care about game files */
if (config_type != CONFIG_TYPE_GAME)
@@ -608,7 +608,7 @@ void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
// debugwin_update_during_game
//============================================================
-void debugwin_update_during_game(running_machine *machine)
+void debugwin_update_during_game(running_machine &machine)
{
win_i *dmain = get_first_win_i(WIN_TYPE_MAIN);
if(dmain)
@@ -625,9 +625,9 @@ void debugwin_update_during_game(running_machine *machine)
static void debugmain_process_string(win_i *win, const char *str)
{
if(!str[0])
- debug_cpu_get_visible_cpu(win->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(win->machine())->debug()->single_step();
else
- debug_console_execute_command(win->machine, str, 1);
+ debug_console_execute_command(win->machine(), str, 1);
}
@@ -640,7 +640,7 @@ static void debugmain_destroy(GtkObject *obj, gpointer user_data)
{
win_i *dmain = get_first_win_i(WIN_TYPE_MAIN);
- dmain->machine->schedule_exit();
+ dmain->machine().schedule_exit();
}
@@ -649,7 +649,7 @@ static void debugmain_destroy(GtkObject *obj, gpointer user_data)
// debugmain_init
//============================================================
-static void debugmain_init(running_machine *machine)
+static void debugmain_init(running_machine &machine)
{
win_i *dmain;
@@ -761,7 +761,7 @@ static void memorywin_destroy(GtkObject *obj, gpointer user_data)
// memorywin_new
//============================================================
-static void memorywin_new(running_machine *machine)
+static void memorywin_new(running_machine &machine)
{
win_i *mem;
int item, cursel;
@@ -855,7 +855,7 @@ static void disasmwin_destroy(GtkObject *obj, gpointer user_data)
// disasmwin_new
//============================================================
-static void disasmwin_new(running_machine *machine)
+static void disasmwin_new(running_machine &machine)
{
win_i *dis;
int item, cursel;
@@ -917,7 +917,7 @@ static void logwin_destroy(GtkObject *obj, gpointer user_data)
// logwin_new
//============================================================
-static void logwin_new(running_machine *machine)
+static void logwin_new(running_machine &machine)
{
win_i *log;
@@ -1123,11 +1123,11 @@ void on_run_to_cursor_activate(GtkWidget *win)
if (disasm->view->cursor_visible())
{
- if (debug_cpu_get_visible_cpu(info->machine) == disasm->view->source()->device())
+ if (debug_cpu_get_visible_cpu(info->machine()) == disasm->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(disasm->view)->selected_address();
command.printf("go 0x%X", address);
- debug_console_execute_command(info->machine, command, 1);
+ debug_console_execute_command(info->machine(), command, 1);
}
}
}
@@ -1141,7 +1141,7 @@ on_set_breakpoint_at_cursor_activate(GtkWidget *win)
if (disasm->view->cursor_visible())
{
- if (debug_cpu_get_visible_cpu(info->machine) == disasm->view->source()->device())
+ if (debug_cpu_get_visible_cpu(info->machine()) == disasm->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(disasm->view)->selected_address();
device_debug *cpuinfo = disasm->view->source()->device()->debug();
@@ -1161,7 +1161,7 @@ on_set_breakpoint_at_cursor_activate(GtkWidget *win)
command.printf("bpset 0x%X", address);
else
command.printf("bpclear 0x%X", bpindex);
- debug_console_execute_command(info->machine, command, 1);
+ debug_console_execute_command(info->machine(), command, 1);
}
}
}
@@ -1205,7 +1205,7 @@ on_memoryview_key_press_event(GtkWidget *widget,
//printf("%s\n", event->string);
//printf("The name of this keysym is `%s'\n",
// gdk_keyval_name(event->keyval));
- //if (/*waiting_for_debugger ||*/ !debugwin_seq_pressed(info->view-> owner->machine))
+ //if (/*waiting_for_debugger ||*/ !debugwin_seq_pressed(info->view-> owner->machine()))
switch (event->keyval)
{
case GDK_Up:
@@ -1291,7 +1291,7 @@ void sdl_osd_interface::wait_for_debugger(device_t &device, bool firststop)
}
// win32 stubs for linking
-void debugwin_update_during_game(running_machine *machine)
+void debugwin_update_during_game(running_machine &machine)
{
}
diff --git a/src/osd/sdl/debugwin.h b/src/osd/sdl/debugwin.h
index 24ad4723ccd..689f5eed98e 100644
--- a/src/osd/sdl/debugwin.h
+++ b/src/osd/sdl/debugwin.h
@@ -17,7 +17,7 @@
// PROTOTYPES
//============================================================
-void debugwin_update_during_game(running_machine *machine);
+void debugwin_update_during_game(running_machine &machine);
#endif
diff --git a/src/osd/sdl/drawogl.c b/src/osd/sdl/drawogl.c
index c2a697e2893..2070b1f62ea 100644
--- a/src/osd/sdl/drawogl.c
+++ b/src/osd/sdl/drawogl.c
@@ -553,7 +553,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
//Moved into init
- //load_gl_lib(*window->machine);
+ //load_gl_lib(window->machine());
// create the SDL window
@@ -602,7 +602,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
#endif
- load_gl_lib(*window->machine);
+ load_gl_lib(window->machine());
// create the SDL surface (which creates the window in windowed mode)
sdl->sdlsurf = SDL_SetVideoMode(width, height,
@@ -1206,7 +1206,7 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
// figure out if we're vector
scrnum = is_vector = 0;
- for (screen = window->machine->config().first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen = window->machine().config().first_screen(); screen != NULL; screen = screen->next_screen())
{
if (scrnum == window->index)
{
@@ -1240,7 +1240,7 @@ static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update)
// we're doing nothing 3d, so the Z-buffer is currently not interesting
glDisable(GL_DEPTH_TEST);
- if (window->machine->options().antialias())
+ if (window->machine().options().antialias())
{
// enable antialiasing for lines
glEnable(GL_LINE_SMOOTH);
@@ -2956,7 +2956,7 @@ static void texture_shader_update(sdl_window_info *window, texture_info *texture
scrnum = 0;
container = (render_container *)NULL;
- for (screen_device *screen = window->machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = window->machine().first_screen(); screen != NULL; screen = screen->next_screen())
{
if (scrnum == window->start_viewscreen)
{
@@ -2972,9 +2972,9 @@ static void texture_shader_update(sdl_window_info *window, texture_info *texture
container->get_user_settings(settings);
//FIXME: Intended behaviour
#if 1
- vid_attributes[0] = window->machine->options().gamma();
- vid_attributes[1] = window->machine->options().contrast();
- vid_attributes[2] = window->machine->options().brightness();
+ vid_attributes[0] = window->machine().options().gamma();
+ vid_attributes[1] = window->machine().options().contrast();
+ vid_attributes[2] = window->machine().options().brightness();
#else
vid_attributes[0] = settings.gamma;
vid_attributes[1] = settings.contrast;
diff --git a/src/osd/sdl/dview.c b/src/osd/sdl/dview.c
index a1dbe008ccc..38c7d061347 100644
--- a/src/osd/sdl/dview.c
+++ b/src/osd/sdl/dview.c
@@ -421,8 +421,8 @@ GtkWidget *dview_new(const gchar *widget_name, const gchar *string1, const gchar
return wdv;
}
-void dview_set_debug_view(DView *dv, running_machine *machine, debug_view_type type)
+void dview_set_debug_view(DView *dv, running_machine &machine, debug_view_type type)
{
- dv->view = machine->debug_view().alloc_view(type, dview_update, dv);
+ dv->view = machine.debug_view().alloc_view(type, dview_update, dv);
dv->dv_type = type;
}
diff --git a/src/osd/sdl/dview.h b/src/osd/sdl/dview.h
index a39fd56cb86..b785c6590cd 100644
--- a/src/osd/sdl/dview.h
+++ b/src/osd/sdl/dview.h
@@ -48,6 +48,6 @@ struct _DView
GtkWidget *dview_new(const gchar *widget_name, const gchar *string1, const gchar *string2, gint int1, gint int2);
-void dview_set_debug_view(DView *dv, running_machine *machine, debug_view_type type);
+void dview_set_debug_view(DView *dv, running_machine &machine, debug_view_type type);
#endif
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 194961b61ad..ad01375dae1 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -557,7 +557,7 @@ static int devmap_leastfree(device_map_t *devmap)
return -1;
}
-static char *remove_spaces(running_machine *machine, const char *s)
+static char *remove_spaces(running_machine &machine, const char *s)
{
char *r, *p;
static const char *def_name[] = { "Unknown" };
@@ -618,7 +618,7 @@ static void devmap_register(device_map_t *devmap, int physical_idx, char *name)
// init_joymap
//============================================================
-static void devmap_init(running_machine *machine, device_map_t *devmap, const char *opt, int max_devices, const char *label)
+static void devmap_init(running_machine &machine, device_map_t *devmap, const char *opt, int max_devices, const char *label)
{
int dev;
char defname[20];
@@ -638,7 +638,7 @@ static void devmap_init(running_machine *machine, device_map_t *devmap, const ch
const char *dev_name;
sprintf(defname, "%s%d", opt, dev + 1);
- dev_name = machine->options().value(defname);
+ dev_name = machine.options().value(defname);
if (dev_name && *dev_name && strcmp(dev_name,SDLOPTVAL_AUTO))
{
devmap->map[dev].name = remove_spaces(machine, dev_name);
@@ -648,7 +648,7 @@ static void devmap_init(running_machine *machine, device_map_t *devmap, const ch
}
}
-static device_info *devmap_class_register(running_machine *machine, device_map_t *devmap,
+static device_info *devmap_class_register(running_machine &machine, device_map_t *devmap,
int index, device_info **devlist, input_device_class devclass)
{
device_info *devinfo = NULL;
@@ -678,7 +678,7 @@ static device_info *devmap_class_register(running_machine *machine, device_map_t
// sdlinput_register_joysticks
//============================================================
-static void sdlinput_register_joysticks(running_machine *machine)
+static void sdlinput_register_joysticks(running_machine &machine)
{
device_info *devinfo;
int physical_stick, axis, button, hat, stick;
@@ -772,7 +772,7 @@ static void sdlinput_register_joysticks(running_machine *machine)
// sdlinput_deregister_joysticks
//============================================================
-static void sdlinput_deregister_joysticks(running_machine *machine)
+static void sdlinput_deregister_joysticks(running_machine &machine)
{
device_info *curdev;
@@ -791,11 +791,11 @@ static void sdlinput_deregister_joysticks(running_machine *machine)
//============================================================
#if (!SDL13_POST_HG4464 && SDL_VERSION_ATLEAST(1,3,0))
-static void sdlinput_register_mice(running_machine *machine)
+static void sdlinput_register_mice(running_machine &machine)
{
int index, physical_mouse;
- mouse_enabled = machine->options().mouse();
+ mouse_enabled = machine.options().mouse();
devmap_init(machine, &mouse_map, SDLOPTION_MOUSEINDEX, 8, "Mouse mapping");
@@ -841,7 +841,7 @@ static void sdlinput_register_mice(running_machine *machine)
mame_printf_verbose("Mouse: End initialization\n");
}
#else
-static void sdlinput_register_mice(running_machine *machine)
+static void sdlinput_register_mice(running_machine &machine)
{
device_info *devinfo;
char defname[20];
@@ -855,7 +855,7 @@ static void sdlinput_register_mice(running_machine *machine)
devinfo = generic_device_alloc(&mouse_list, "System mouse");
devinfo->device = input_device_add(machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
- mouse_enabled = machine->options().mouse();
+ mouse_enabled = machine.options().mouse();
// add the axes
input_device_item_add(devinfo->device, "X", &devinfo->mouse.lX, ITEM_ID_XAXIS, generic_axis_get_state);
@@ -930,7 +930,7 @@ static int lookup_mame_code(const char *scode)
// sdlinput_read_keymap
//============================================================
-static kt_table * sdlinput_read_keymap(running_machine *machine)
+static kt_table * sdlinput_read_keymap(running_machine &machine)
{
char *keymap_filename;
kt_table *key_trans_table;
@@ -942,10 +942,10 @@ static kt_table * sdlinput_read_keymap(running_machine *machine)
char sks[21];
char kns[21];
- if (!machine->options().bool_value(SDLOPTION_KEYMAP))
+ if (!machine.options().bool_value(SDLOPTION_KEYMAP))
return sdl_key_trans_table;
- keymap_filename = (char *)downcast<sdl_options &>(machine->options()).keymap_file();
+ keymap_filename = (char *)downcast<sdl_options &>(machine.options()).keymap_file();
mame_printf_verbose("Keymap: Start reading keymap_file %s\n", keymap_filename);
keymap_file = fopen(keymap_filename, "r");
@@ -1003,7 +1003,7 @@ static kt_table * sdlinput_read_keymap(running_machine *machine)
//============================================================
#if ((1 ||!SDL13_POST_HG4464) && SDL_VERSION_ATLEAST(1,3,0))
-static void sdlinput_register_keyboards(running_machine *machine)
+static void sdlinput_register_keyboards(running_machine &machine)
{
int physical_keyboard;
int index;
@@ -1053,7 +1053,7 @@ static void sdlinput_register_keyboards(running_machine *machine)
mame_printf_verbose("Keyboard: End initialization\n");
}
#else
-static void sdlinput_register_keyboards(running_machine *machine)
+static void sdlinput_register_keyboards(running_machine &machine)
{
device_info *devinfo;
char defname[20];
@@ -1095,7 +1095,7 @@ static void sdlinput_register_keyboards(running_machine *machine)
// sdlinput_init
//============================================================
-void sdlinput_init(running_machine *machine)
+void sdlinput_init(running_machine &machine)
{
keyboard_list = NULL;
joystick_list = NULL;
@@ -1105,9 +1105,9 @@ void sdlinput_init(running_machine *machine)
app_has_mouse_focus = 1;
// we need pause and exit callbacks
- machine->add_notifier(MACHINE_NOTIFY_PAUSE, sdlinput_pause);
- machine->add_notifier(MACHINE_NOTIFY_RESUME, sdlinput_resume);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, sdlinput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_PAUSE, sdlinput_pause);
+ machine.add_notifier(MACHINE_NOTIFY_RESUME, sdlinput_resume);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, sdlinput_exit);
// allocate a lock for input synchronizations
input_lock = osd_lock_alloc();
@@ -1119,14 +1119,14 @@ void sdlinput_init(running_machine *machine)
// register the mice
sdlinput_register_mice(machine);
- if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
{
mame_printf_warning("Debug Build: Disabling input grab for -debug\n");
mouse_enabled = 0;
}
// get Sixaxis special mode info
- sixaxis_mode = downcast<sdl_options &>(machine->options()).sixaxis();
+ sixaxis_mode = downcast<sdl_options &>(machine.options()).sixaxis();
// register the joysticks
sdlinput_register_joysticks(machine);
@@ -1167,7 +1167,7 @@ static void sdlinput_exit(running_machine &machine)
// deregister
- sdlinput_deregister_joysticks(&machine);
+ sdlinput_deregister_joysticks(machine);
// free all devices
device_list_free_devices(&keyboard_list);
@@ -1180,7 +1180,7 @@ static void sdlinput_exit(running_machine &machine)
// sdlinput_get_focus_window
//============================================================
-sdl_window_info *sdlinput_get_focus_window(running_machine *machine)
+sdl_window_info *sdlinput_get_focus_window(running_machine &machine)
{
if (focus_window) // only be set on SDL >= 1.3
return focus_window;
@@ -1231,7 +1231,7 @@ INLINE void resize_all_windows(void)
#endif
-void sdlinput_process_events_buf(running_machine *machine)
+void sdlinput_process_events_buf(running_machine &machine)
{
SDL_Event event;
@@ -1254,7 +1254,7 @@ void sdlinput_process_events_buf(running_machine *machine)
}
-void sdlinput_poll(running_machine *machine)
+void sdlinput_poll(running_machine &machine)
{
device_info *devinfo;
SDL_Event event;
@@ -1466,7 +1466,7 @@ void sdlinput_poll(running_machine *machine)
}
break;
case SDL_QUIT:
- machine->schedule_exit();
+ machine.schedule_exit();
break;
case SDL_VIDEORESIZE:
sdlwindow_resize(sdl_window_list, event.resize.w, event.resize.h);
@@ -1494,7 +1494,7 @@ void sdlinput_poll(running_machine *machine)
switch (event.window.event)
{
case SDL_WINDOWEVENT_CLOSE:
- machine->schedule_exit();
+ machine.schedule_exit();
break;
case SDL_WINDOWEVENT_LEAVE:
ui_input_push_mouse_leave_event(machine, window->target);
@@ -1544,7 +1544,7 @@ void sdlinput_poll(running_machine *machine)
//============================================================
-void sdlinput_release_keys(running_machine *machine)
+void sdlinput_release_keys(running_machine &machine)
{
// FIXME: SDL >= 1.3 will nuke the window event buffer when
// a window is closed. This will leave keys in a pressed
@@ -1568,7 +1568,7 @@ void sdlinput_release_keys(running_machine *machine)
// sdlinput_should_hide_mouse
//============================================================
-int sdlinput_should_hide_mouse(running_machine *machine)
+int sdlinput_should_hide_mouse(running_machine &machine)
{
// if we are paused, no
if (input_paused)
diff --git a/src/osd/sdl/input.h b/src/osd/sdl/input.h
index f48e0c2acb8..c3806c8b06e 100644
--- a/src/osd/sdl/input.h
+++ b/src/osd/sdl/input.h
@@ -18,13 +18,13 @@
// PROTOTYPES
//============================================================
-void sdlinput_init(running_machine *machine);
-void sdlinput_poll(running_machine *machine);
-int sdlinput_should_hide_mouse(running_machine *machine);
+void sdlinput_init(running_machine &machine);
+void sdlinput_poll(running_machine &machine);
+int sdlinput_should_hide_mouse(running_machine &machine);
-sdl_window_info *sdlinput_get_focus_window(running_machine *machine);
+sdl_window_info *sdlinput_get_focus_window(running_machine &machine);
-void sdlinput_process_events_buf(running_machine *machine);
-void sdlinput_release_keys(running_machine *machine);
+void sdlinput_process_events_buf(running_machine &machine);
+void sdlinput_release_keys(running_machine &machine);
#endif /* __SDLINPUT_H__ */
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index 5b70b9f2e1d..fd459603d04 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -272,7 +272,7 @@ private:
// sound.c
//============================================================
-void sdlaudio_init(running_machine *machine);
+void sdlaudio_init(running_machine &machine);
//============================================================
// sdlwork.c
diff --git a/src/osd/sdl/output.c b/src/osd/sdl/output.c
index 7f2f7c585aa..0381ef16e0b 100644
--- a/src/osd/sdl/output.c
+++ b/src/osd/sdl/output.c
@@ -71,11 +71,11 @@ PID_CAST osd_getpid(void)
// sdloutput_init
//============================================================
-void sdloutput_init(running_machine *machine)
+void sdloutput_init(running_machine &machine)
{
int fildes;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, sdloutput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, sdloutput_exit);
fildes = open(SDLMAME_OUTPUT, O_RDWR | O_NONBLOCK);
@@ -89,7 +89,7 @@ void sdloutput_init(running_machine *machine)
output = fdopen(fildes, "w");
mame_printf_verbose("ouput: opened output notifier file %s\n", SDLMAME_OUTPUT);
- fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine->system().name);
+ fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine.system().name);
fflush(output);
}
@@ -134,7 +134,7 @@ static void notifier_callback(const char *outname, INT32 value, void *param)
// Stub for win32
//============================================================
-void sdloutput_init(running_machine *machine)
+void sdloutput_init(running_machine &machine)
{
}
diff --git a/src/osd/sdl/output.h b/src/osd/sdl/output.h
index 196c29e02a6..507189fd8fe 100644
--- a/src/osd/sdl/output.h
+++ b/src/osd/sdl/output.h
@@ -14,7 +14,7 @@
// FUNCTION PROTOTYPES
//============================================================
-void sdloutput_init(running_machine *machine);
+void sdloutput_init(running_machine &machine);
#endif /* __SDLMAME_OUTPUT_H__ */
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index afddf9b71af..747b881d060 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -633,7 +633,7 @@ void sdl_osd_interface::init(running_machine &machine)
exit(-1);
}
- if (sdlvideo_init(&machine))
+ if (sdlvideo_init(machine))
{
osd_exit(machine);
mame_printf_error("sdlvideo_init: Initialization failed!\n\n\n");
@@ -642,11 +642,11 @@ void sdl_osd_interface::init(running_machine &machine)
exit(-1);
}
- sdlinput_init(&machine);
+ sdlinput_init(machine);
- sdlaudio_init(&machine);
+ sdlaudio_init(machine);
- sdloutput_init(&machine);
+ sdloutput_init(machine);
if (options.oslog())
machine.add_logerror_callback(output_oslog);
@@ -659,7 +659,7 @@ void sdl_osd_interface::init(running_machine &machine)
/* only enable watchdog if seconds_to_run is enabled *and* relatively short (time taken from ui.c) */
if ((watchdog_timeout != 0) && (str > 0) && (str < 60*5 ))
{
- m_watchdog = auto_alloc(&machine, watchdog);
+ m_watchdog = auto_alloc(machine, watchdog);
m_watchdog->setTimeout(watchdog_timeout);
}
@@ -802,7 +802,7 @@ bitmap_t *sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum,
color_space = CGColorSpaceCreateDeviceRGB();
bits_per_component = 8;
- bitmap = auto_alloc(&machine(), bitmap_t(bitmap_width, bitmap_height, BITMAP_FORMAT_ARGB32));
+ bitmap = auto_alloc(machine(), bitmap_t(bitmap_width, bitmap_height, BITMAP_FORMAT_ARGB32));
context_ref = CGBitmapContextCreate( bitmap->base, bitmap_width, bitmap_height, bits_per_component, bitmap->rowpixels*4, color_space, bitmap_info );
@@ -1063,7 +1063,7 @@ bitmap_t *sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum,
if (drawsurf)
{
// allocate a MAME destination bitmap
- bitmap = auto_alloc(&machine(), bitmap_t(drawsurf->w, drawsurf->h, BITMAP_FORMAT_ARGB32));
+ bitmap = auto_alloc(machine(), bitmap_t(drawsurf->w, drawsurf->h, BITMAP_FORMAT_ARGB32));
// copy the rendered character image into it
for (int y = 0; y < bitmap->height; y++)
diff --git a/src/osd/sdl/sound.c b/src/osd/sdl/sound.c
index cb0da6968c7..b3eed800f98 100644
--- a/src/osd/sdl/sound.c
+++ b/src/osd/sdl/sound.c
@@ -69,8 +69,8 @@ static int snd_enabled;
// PROTOTYPES
//============================================================
-static int sdl_init(running_machine *machine);
-static void sdl_kill(running_machine *machine);
+static int sdl_init(running_machine &machine);
+static void sdl_kill(running_machine &machine);
static int sdl_create_buffers(void);
static void sdl_destroy_buffers(void);
static void sdl_cleanup_audio(running_machine &machine);
@@ -81,21 +81,21 @@ static void sdl_callback(void *userdata, Uint8 *stream, int len);
//============================================================
// osd_start_audio_stream
//============================================================
-void sdlaudio_init(running_machine *machine)
+void sdlaudio_init(running_machine &machine)
{
if (LOG_SOUND)
sound_log = fopen(SDLMAME_SOUND_LOG, "w");
// skip if sound disabled
- if (machine->sample_rate() != 0)
+ if (machine.sample_rate() != 0)
{
// attempt to initialize SDL
if (sdl_init(machine))
return;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, sdl_cleanup_audio);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, sdl_cleanup_audio);
// set the startup volume
- machine->osd().set_mastervolume(attenuation);
+ machine.osd().set_mastervolume(attenuation);
}
return;
}
@@ -113,7 +113,7 @@ static void sdl_cleanup_audio(running_machine &machine)
return;
// kill the buffers and dsound
- sdl_kill(&machine);
+ sdl_kill(machine);
sdl_destroy_buffers();
// print out over/underflow stats
@@ -419,7 +419,7 @@ static void sdl_callback(void *userdata, Uint8 *stream, int len)
//============================================================
// sdl_init
//============================================================
-static int sdl_init(running_machine *machine)
+static int sdl_init(running_machine &machine)
{
int n_channels = 2;
int audio_latency;
@@ -428,7 +428,7 @@ static int sdl_init(running_machine *machine)
if (initialized_audio)
{
- sdl_cleanup_audio(*machine);
+ sdl_cleanup_audio(machine);
}
mame_printf_verbose("Audio: Start initialization\n");
@@ -446,7 +446,7 @@ static int sdl_init(running_machine *machine)
stream_loop = 0;
// set up the audio specs
- aspec.freq = machine->sample_rate();
+ aspec.freq = machine.sample_rate();
aspec.format = AUDIO_S16SYS; // keep endian independent
aspec.channels = n_channels;
aspec.samples = sdl_xfer_samples;
@@ -464,7 +464,7 @@ static int sdl_init(running_machine *machine)
sdl_xfer_samples = obtained.samples;
- audio_latency = downcast<sdl_options &>(machine->options()).audio_latency();
+ audio_latency = downcast<sdl_options &>(machine.options()).audio_latency();
// pin audio latency
if (audio_latency > MAX_AUDIO_LATENCY)
@@ -477,7 +477,7 @@ static int sdl_init(running_machine *machine)
}
// compute the buffer sizes
- stream_buffer_size = machine->sample_rate() * 2 * sizeof(INT16) * audio_latency / MAX_AUDIO_LATENCY;
+ stream_buffer_size = machine.sample_rate() * 2 * sizeof(INT16) * audio_latency / MAX_AUDIO_LATENCY;
stream_buffer_size = (stream_buffer_size / 1024) * 1024;
if (stream_buffer_size < 1024)
stream_buffer_size = 1024;
@@ -503,7 +503,7 @@ cant_start_audio:
// sdl_kill
//============================================================
-static void sdl_kill(running_machine *machine)
+static void sdl_kill(running_machine &machine)
{
if (initialized_audio)
{
diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
index c3f2877857b..b8dea72fd17 100644
--- a/src/osd/sdl/video.c
+++ b/src/osd/sdl/video.c
@@ -90,10 +90,10 @@ static void video_exit(running_machine &machine);
static void init_monitors(void);
static sdl_monitor_info *pick_monitor(sdl_options &options, int index);
-static void check_osd_inputs(running_machine *machine);
+static void check_osd_inputs(running_machine &machine);
-static void extract_video_config(running_machine *machine);
-static void extract_window_config(running_machine *machine, int index, sdl_window_config *conf);
+static void extract_video_config(running_machine &machine);
+static void extract_window_config(running_machine &machine, int index, sdl_window_config *conf);
static float get_aspect(const char *defdata, const char *data, int report_error);
static void get_resolution(const char *defdata, const char *data, sdl_window_config *config, int report_error);
@@ -102,7 +102,7 @@ static void get_resolution(const char *defdata, const char *data, sdl_window_con
// sdlvideo_init
//============================================================
-int sdlvideo_init(running_machine *machine)
+int sdlvideo_init(running_machine &machine)
{
int index, tc;
@@ -110,22 +110,22 @@ int sdlvideo_init(running_machine *machine)
extract_video_config(machine);
// ensure we get called on the way out
- machine->add_notifier(MACHINE_NOTIFY_EXIT, video_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, video_exit);
// set up monitors first
init_monitors();
// we need the beam width in a float, contrary to what the core does.
- video_config.beamwidth = machine->options().beam();
+ video_config.beamwidth = machine.options().beam();
// initialize the window system so we can make windows
if (sdlwindow_init(machine))
return 1;
- tc = machine->total_colors();
+ tc = machine.total_colors();
// create the windows
- sdl_options &options = downcast<sdl_options &>(machine->options());
+ sdl_options &options = downcast<sdl_options &>(machine.options());
for (index = 0; index < video_config.numscreens; index++)
{
sdl_window_config conf;
@@ -337,16 +337,16 @@ void sdl_osd_interface::update(bool skip_redraw)
{
// profiler_mark(PROFILER_BLIT);
for (window = sdl_window_list; window != NULL; window = window->next)
- sdlwindow_video_window_update(&machine(), window);
+ sdlwindow_video_window_update(machine(), window);
// profiler_mark(PROFILER_END);
}
// poll the joystick values here
- sdlinput_poll(&machine());
- check_osd_inputs(&machine());
+ sdlinput_poll(machine());
+ check_osd_inputs(machine());
if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
- debugwin_update_during_game(&machine());
+ debugwin_update_during_game(machine());
}
@@ -557,7 +557,7 @@ static sdl_monitor_info *pick_monitor(sdl_options &options, int index)
// check_osd_inputs
//============================================================
-static void check_osd_inputs(running_machine *machine)
+static void check_osd_inputs(running_machine &machine)
{
sdl_window_info *window = sdlinput_get_focus_window(machine);
@@ -600,9 +600,9 @@ static void check_osd_inputs(running_machine *machine)
// extract_window_config
//============================================================
-static void extract_window_config(running_machine *machine, int index, sdl_window_config *conf)
+static void extract_window_config(running_machine &machine, int index, sdl_window_config *conf)
{
- sdl_options &options = downcast<sdl_options &>(machine->options());
+ sdl_options &options = downcast<sdl_options &>(machine.options());
// per-window options: extract the data
get_resolution(options.resolution(), options.resolution(index), conf, TRUE);
}
@@ -611,10 +611,10 @@ static void extract_window_config(running_machine *machine, int index, sdl_windo
// extract_video_config
//============================================================
-static void extract_video_config(running_machine *machine)
+static void extract_video_config(running_machine &machine)
{
const char *stemp;
- sdl_options &options = downcast<sdl_options &>(machine->options());
+ sdl_options &options = downcast<sdl_options &>(machine.options());
video_config.perftest = options.video_fps();
@@ -628,7 +628,7 @@ static void extract_video_config(running_machine *machine)
#endif
- if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
video_config.windowed = TRUE;
// default to working video please
diff --git a/src/osd/sdl/video.h b/src/osd/sdl/video.h
index 65f98a21e1e..e143abd7324 100644
--- a/src/osd/sdl/video.h
+++ b/src/osd/sdl/video.h
@@ -148,7 +148,7 @@ extern sdl_video_config video_config;
// PROTOTYPES
//============================================================
-int sdlvideo_init(running_machine *machine);
+int sdlvideo_init(running_machine &machine);
void sdlvideo_monitor_refresh(sdl_monitor_info *monitor);
float sdlvideo_monitor_get_aspect(sdl_monitor_info *monitor);
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 51797564833..ae9d6f44f97 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -98,9 +98,10 @@ static sdl_draw_info draw;
typedef struct _worker_param worker_param;
struct _worker_param {
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
sdl_window_info *window;
render_primitive_list *list;
- running_machine *machine;
+ running_machine *m_machine;
int resize_new_width;
int resize_new_height;
};
@@ -111,19 +112,19 @@ struct _worker_param {
//============================================================
static void sdlwindow_exit(running_machine &machine);
-static void sdlwindow_video_window_destroy(running_machine *machine, sdl_window_info *window);
+static void sdlwindow_video_window_destroy(running_machine &machine, sdl_window_info *window);
static OSDWORK_CALLBACK( draw_video_contents_wt );
static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt );
static OSDWORK_CALLBACK( sdlwindow_resize_wt );
static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt );
-static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_info *window);
+static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window);
static void sdlwindow_sync(void);
static void get_min_bounds(sdl_window_info *window, int *window_width, int *window_height, int constrain);
static void get_max_bounds(sdl_window_info *window, int *window_width, int *window_height, int constrain);
static void *complete_create_wt(void *param, int threadid);
-static void set_starting_view(running_machine *machine, int index, sdl_window_info *window, const char *defview, const char *view);
+static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view);
//============================================================
// clear the worker_param structure, inline - faster than memset
@@ -133,7 +134,7 @@ INLINE void clear_worker_param(worker_param *wp)
{
wp->window=NULL;
wp->list=NULL;
- wp->machine=NULL;
+ wp->m_machine=NULL;
wp->resize_new_width=0;
wp->resize_new_height=0;
}
@@ -202,17 +203,17 @@ static OSDWORK_CALLBACK(sdlwindow_thread_id)
// (main thread)
//============================================================
-int sdlwindow_init(running_machine *machine)
+int sdlwindow_init(running_machine &machine)
{
mame_printf_verbose("Enter sdlwindow_init\n");
// determine if we are using multithreading or not
- multithreading_enabled = downcast<sdl_options &>(machine->options()).multithreading();
+ multithreading_enabled = downcast<sdl_options &>(machine.options()).multithreading();
// get the main thread ID before anything else
main_threadid = SDL_ThreadID();
// ensure we get called on the way out
- machine->add_notifier(MACHINE_NOTIFY_EXIT, sdlwindow_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, sdlwindow_exit);
// if multithreading, create a thread to run the windows
if (multithreading_enabled)
@@ -234,14 +235,14 @@ int sdlwindow_init(running_machine *machine)
#if USE_OPENGL
if (video_config.mode == VIDEO_MODE_OPENGL)
{
- if (drawogl_init(*machine, &draw))
+ if (drawogl_init(machine, &draw))
video_config.mode = VIDEO_MODE_SOFT;
}
#endif
#if SDL_VERSION_ATLEAST(1,3,0)
if (video_config.mode == VIDEO_MODE_SDL13)
{
- if (draw13_init(*machine, &draw))
+ if (draw13_init(machine, &draw))
video_config.mode = VIDEO_MODE_SOFT;
}
#endif
@@ -303,7 +304,7 @@ static void sdlwindow_exit(running_machine &machine)
{
sdl_window_info *temp = sdl_window_list;
sdl_window_list = temp->next;
- sdlwindow_video_window_destroy(&machine, temp);
+ sdlwindow_video_window_destroy(machine, temp);
}
// if we're multithreaded, clean up the window thread
@@ -506,7 +507,7 @@ static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
ASSERT_WINDOW_THREAD();
// if we are in debug mode, never go full screen
- if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ if (window->machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
return NULL;
// If we are going fullscreen (leaving windowed) remember our windowed size
@@ -517,7 +518,7 @@ static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
}
window->destroy(window);
- sdlinput_release_keys(wp->machine);
+ sdlinput_release_keys(wp->machine());
// toggle the window mode
window->fullscreen = !window->fullscreen;
@@ -527,7 +528,7 @@ static OSDWORK_CALLBACK( sdlwindow_toggle_full_screen_wt )
return NULL;
}
-void sdlwindow_toggle_full_screen(running_machine *machine, sdl_window_info *window)
+void sdlwindow_toggle_full_screen(running_machine &machine, sdl_window_info *window)
{
worker_param wp;
@@ -535,7 +536,7 @@ void sdlwindow_toggle_full_screen(running_machine *machine, sdl_window_info *win
clear_worker_param(&wp);
wp.window = window;
- wp.machine = machine;
+ wp.m_machine = &machine;
execute_async_wait(&sdlwindow_toggle_full_screen_wt, &wp);
}
@@ -552,7 +553,7 @@ static OSDWORK_CALLBACK( destroy_all_textures_wt )
return NULL;
}
-void sdlwindow_modify_prescale(running_machine *machine, sdl_window_info *window, int dir)
+void sdlwindow_modify_prescale(running_machine &machine, sdl_window_info *window, int dir)
{
worker_param wp;
int new_prescale = window->prescale;
@@ -560,7 +561,7 @@ void sdlwindow_modify_prescale(running_machine *machine, sdl_window_info *window
clear_worker_param(&wp);
wp.window = window;
- wp.machine = machine;
+ wp.m_machine = &machine;
if (dir > 0 && window->prescale < 3)
new_prescale = window->prescale + 1;
@@ -592,12 +593,12 @@ void sdlwindow_modify_prescale(running_machine *machine, sdl_window_info *window
// (main or window thread)
//============================================================
-static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_info *window)
+static void sdlwindow_update_cursor_state(running_machine &machine, sdl_window_info *window)
{
#if (SDL_VERSION_ATLEAST(1,3,0))
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
- if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
+ if (!(machine.debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
//FIXME: SDL1.3: really broken: the whole SDL code
// will only work correct with relative mouse movements ...
@@ -620,7 +621,7 @@ static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_i
#else
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
- if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED))
+ if (!(machine.debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
if ( window->fullscreen || sdlinput_should_hide_mouse(machine) )
{
@@ -648,7 +649,7 @@ static void sdlwindow_update_cursor_state(running_machine *machine, sdl_window_i
// (main thread)
//============================================================
-int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monitor_info *monitor, const sdl_window_config *config)
+int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monitor_info *monitor, const sdl_window_config *config)
{
sdl_window_info *window;
worker_param *wp = (worker_param *) osd_malloc(sizeof(worker_param));
@@ -665,7 +666,7 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
window->depth = config->depth;
window->refresh = config->refresh;
window->monitor = monitor;
- window->machine = machine;
+ window->m_machine = &machine;
window->index = index;
//FIXME: these should be per_window in config-> or even better a bit set
@@ -675,7 +676,7 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
// set the initial maximized state
// FIXME: Does not belong here
- sdl_options &options = downcast<sdl_options &>(machine->options());
+ sdl_options &options = downcast<sdl_options &>(machine.options());
window->startmaximized = options.maximize();
if (!window->fullscreen)
@@ -695,16 +696,16 @@ int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monit
window->rendered_event = osd_event_alloc(FALSE, TRUE);
// load the layout
- window->target = machine->render().target_alloc();
+ window->target = machine.render().target_alloc();
// set the specific view
set_starting_view(machine, index, window, options.view(), options.view(index));
// make the window title
if (video_config.numscreens == 1)
- sprintf(window->title, APPNAME ": %s [%s]", machine->system().description, machine->system().name);
+ sprintf(window->title, APPNAME ": %s [%s]", machine.system().description, machine.system().name);
else
- sprintf(window->title, APPNAME ": %s [%s] - Screen %d", machine->system().description, machine->system().name, index);
+ sprintf(window->title, APPNAME ": %s [%s] - Screen %d", machine.system().description, machine.system().name, index);
wp->window = window;
@@ -748,14 +749,14 @@ static OSDWORK_CALLBACK( sdlwindow_video_window_destroy_wt )
window->destroy(window);
// release all keys ...
- sdlinput_release_keys(wp->machine);
+ sdlinput_release_keys(wp->machine());
osd_free(wp);
return NULL;
}
-static void sdlwindow_video_window_destroy(running_machine *machine, sdl_window_info *window)
+static void sdlwindow_video_window_destroy(running_machine &machine, sdl_window_info *window)
{
sdl_window_info **prevptr;
worker_param wp;
@@ -779,11 +780,11 @@ static void sdlwindow_video_window_destroy(running_machine *machine, sdl_window_
// free the textures etc
clear_worker_param(&wp);
wp.window = window;
- wp.machine = machine;
+ wp.m_machine = &machine;
execute_async_wait(&sdlwindow_video_window_destroy_wt, &wp);
// free the render target, after the textures!
- window->machine->render().target_free(window->target);
+ window->machine().render().target_free(window->target);
// free the event
osd_event_free(window->rendered_event);
@@ -945,7 +946,7 @@ static void pick_best_mode(sdl_window_info *window, int *fswidth, int *fsheight)
// (main thread)
//============================================================
-void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *window)
+void sdlwindow_video_window_update(running_machine &machine, sdl_window_info *window)
{
osd_ticks_t event_wait_ticks;
@@ -996,7 +997,7 @@ void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *wi
wp.list = primlist;
wp.window = window;
- wp.machine = machine;
+ wp.m_machine = &machine;
execute_async(&draw_video_contents_wt, &wp);
}
@@ -1009,7 +1010,7 @@ void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *wi
// (main thread)
//============================================================
-static void set_starting_view(running_machine *machine, int index, sdl_window_info *window, const char *defview, const char *view)
+static void set_starting_view(running_machine &machine, int index, sdl_window_info *window, const char *defview, const char *view)
{
int viewindex;
@@ -1149,7 +1150,7 @@ static OSDWORK_CALLBACK( draw_video_contents_wt )
ASSERT_REDRAW_THREAD();
// Some configurations require events to be polled in the worker thread
- sdlinput_process_events_buf(wp->machine);
+ sdlinput_process_events_buf(wp->machine());
window->primlist = wp->list;
diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h
index f1c8b41a5c0..1a0a6b0a310 100644
--- a/src/osd/sdl/window.h
+++ b/src/osd/sdl/window.h
@@ -39,7 +39,8 @@ struct _sdl_window_info
sdl_window_info * next;
// Pointer to machine
- running_machine * machine;
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+ running_machine * m_machine;
// Draw Callbacks
int (*create)(sdl_window_info *window, int width, int height);
@@ -123,14 +124,14 @@ extern sdl_window_info *sdl_window_list;
//============================================================
// core initialization
-int sdlwindow_init(running_machine *machine);
+int sdlwindow_init(running_machine &machine);
// creation/deletion of windows
-int sdlwindow_video_window_create(running_machine *machine, int index, sdl_monitor_info *monitor, const sdl_window_config *config);
-void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *window);
+int sdlwindow_video_window_create(running_machine &machine, int index, sdl_monitor_info *monitor, const sdl_window_config *config);
+void sdlwindow_video_window_update(running_machine &machine, sdl_window_info *window);
void sdlwindow_blit_surface_size(sdl_window_info *window, int window_width, int window_height);
-void sdlwindow_toggle_full_screen(running_machine *machine, sdl_window_info *window);
-void sdlwindow_modify_prescale(running_machine *machine, sdl_window_info *window, int dir);
+void sdlwindow_toggle_full_screen(running_machine &machine, sdl_window_info *window);
+void sdlwindow_modify_prescale(running_machine &machine, sdl_window_info *window, int dir);
void sdlwindow_resize(sdl_window_info *window, INT32 width, INT32 height);
void sdlwindow_clear(sdl_window_info *window);
diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c
index 4fcb3a367d3..6b6a6d2b3de 100644
--- a/src/osd/windows/debugwin.c
+++ b/src/osd/windows/debugwin.c
@@ -163,6 +163,8 @@ struct _debugview_info
struct _debugwin_info
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
debugwin_info * next;
HWND wnd;
HWND focuswnd;
@@ -189,7 +191,7 @@ struct _debugwin_info
HWND otherwnd[MAX_OTHER_WND];
- running_machine * machine;
+ running_machine * m_machine;
};
@@ -217,7 +219,7 @@ static UINT32 vscroll_width;
// PROTOTYPES
//============================================================
-static debugwin_info *debugwin_window_create(running_machine *machine, LPCSTR title, WNDPROC handler);
+static debugwin_info *debugwin_window_create(running_machine &machine, LPCSTR title, WNDPROC handler);
static void debugwin_window_free(debugwin_info *info);
static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
@@ -231,23 +233,23 @@ static LRESULT CALLBACK debugwin_edit_proc(HWND wnd, UINT message, WPARAM wparam
//static void generic_create_window(int type);
static void generic_recompute_children(debugwin_info *info);
-static void memory_create_window(running_machine *machine);
+static void memory_create_window(running_machine &machine);
static void memory_recompute_children(debugwin_info *info);
static void memory_process_string(debugwin_info *info, const char *string);
static void memory_update_menu(debugwin_info *info);
static int memory_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam);
static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam);
-static void memory_update_caption(running_machine *machine, HWND wnd);
+static void memory_update_caption(running_machine &machine, HWND wnd);
-static void disasm_create_window(running_machine *machine);
+static void disasm_create_window(running_machine &machine);
static void disasm_recompute_children(debugwin_info *info);
static void disasm_process_string(debugwin_info *info, const char *string);
static void disasm_update_menu(debugwin_info *info);
static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam);
static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam);
-static void disasm_update_caption(running_machine *machine, HWND wnd);
+static void disasm_update_caption(running_machine &machine, HWND wnd);
-static void console_create_window(running_machine *machine);
+static void console_create_window(running_machine &machine);
static void console_recompute_children(debugwin_info *info);
static void console_process_string(debugwin_info *info, const char *string);
static void console_set_cpu(device_t *device);
@@ -271,7 +273,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
// create a console window
if (main_console == NULL)
- console_create_window(&machine());
+ console_create_window(machine());
// update the views in the console to reflect the current CPU
if (main_console != NULL)
@@ -290,7 +292,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
smart_show_all(TRUE);
// run input polling to ensure that our status is in sync
- wininput_poll(&machine());
+ wininput_poll(machine());
// get and process messages
GetMessage(&message, NULL, 0, 0);
@@ -308,7 +310,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
// process everything else
default:
- winwindow_dispatch_message(&machine(), &message);
+ winwindow_dispatch_message(machine(), &message);
break;
}
@@ -322,7 +324,7 @@ void windows_osd_interface::wait_for_debugger(device_t &device, bool firststop)
// debugwin_seq_pressed
//============================================================
-static int debugwin_seq_pressed(running_machine *machine)
+static int debugwin_seq_pressed(running_machine &machine)
{
const input_seq *seq = input_type_seq(machine, IPT_UI_DEBUG_BREAK, 0, SEQ_TYPE_STANDARD);
int result = FALSE;
@@ -504,10 +506,10 @@ void debugwin_show(int type)
// debugwin_update_during_game
//============================================================
-void debugwin_update_during_game(running_machine *machine)
+void debugwin_update_during_game(running_machine &machine)
{
// if we're running live, do some checks
- if (!winwindow_has_focus() && !debug_cpu_is_stopped(machine) && machine->phase() == MACHINE_PHASE_RUNNING)
+ if (!winwindow_has_focus() && !debug_cpu_is_stopped(machine) && machine.phase() == MACHINE_PHASE_RUNNING)
{
// see if the interrupt key is pressed and break if it is
if (debugwin_seq_pressed(machine))
@@ -534,7 +536,7 @@ void debugwin_update_during_game(running_machine *machine)
// debugwin_window_create
//============================================================
-static debugwin_info *debugwin_window_create(running_machine *machine, LPCSTR title, WNDPROC handler)
+static debugwin_info *debugwin_window_create(running_machine &machine, LPCSTR title, WNDPROC handler)
{
debugwin_info *info = NULL;
RECT work_bounds;
@@ -561,7 +563,7 @@ static debugwin_info *debugwin_window_create(running_machine *machine, LPCSTR ti
info->handle_key = global_handle_key;
strcpy(info->edit_defstr, "");
- info->machine = machine;
+ info->m_machine = &machine;
// hook us in
info->next = window_list;
@@ -599,7 +601,7 @@ static void debugwin_window_free(debugwin_info *info)
for (viewnum = 0; viewnum < ARRAY_LENGTH(info->view); viewnum++)
if (info->view[viewnum].view != NULL)
{
- info->machine->debug_view().free_view(*info->view[viewnum].view);
+ info->machine().debug_view().free_view(*info->view[viewnum].view);
info->view[viewnum].view = NULL;
}
@@ -708,7 +710,7 @@ static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wpar
case WM_CHAR:
if (info->ignore_char_lparam == (lparam >> 16))
info->ignore_char_lparam = 0;
- else if (waiting_for_debugger || !debugwin_seq_pressed(info->machine))
+ else if (waiting_for_debugger || !debugwin_seq_pressed(info->machine()))
return DefWindowProc(wnd, message, wparam, lparam);
break;
@@ -806,7 +808,7 @@ static LRESULT CALLBACK debugwin_window_proc(HWND wnd, UINT message, WPARAM wpar
if (main_console && main_console->wnd == wnd)
{
smart_show_all(FALSE);
- debug_cpu_get_visible_cpu(info->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go();
}
else
DestroyWindow(wnd);
@@ -853,7 +855,7 @@ static int debugwin_view_create(debugwin_info *info, int which, debug_view_type
goto cleanup;
// create the debug view
- view->view = info->machine->debug_view().alloc_view(type, debugwin_view_update, view);
+ view->view = info->machine().debug_view().alloc_view(type, debugwin_view_update, view);
if (view->view == NULL)
goto cleanup;
@@ -861,7 +863,7 @@ static int debugwin_view_create(debugwin_info *info, int which, debug_view_type
cleanup:
if (view->view)
- info->machine->debug_view().free_view(*view->view);
+ info->machine().debug_view().free_view(*view->view);
if (view->hscroll)
DestroyWindow(view->hscroll);
if (view->vscroll)
@@ -1427,7 +1429,7 @@ static LRESULT CALLBACK debugwin_view_proc(HWND wnd, UINT message, WPARAM wparam
{
if (info->owner->ignore_char_lparam == (lparam >> 16))
info->owner->ignore_char_lparam = 0;
- else if (waiting_for_debugger || !debugwin_seq_pressed(info->owner->machine))
+ else if (waiting_for_debugger || !debugwin_seq_pressed(info->owner->machine()))
{
if (wparam >= 32 && wparam < 127 && info->view->cursor_supported())
info->view->process_char(wparam);
@@ -1474,7 +1476,7 @@ static LRESULT CALLBACK debugwin_view_proc(HWND wnd, UINT message, WPARAM wparam
debug_view_xy topleft = info->view->visible_position();
topleft.x = debugwin_view_process_scroll(info, LOWORD(wparam), (HWND)lparam);
info->view->set_visible_position(topleft);
- info->owner->machine->debug_view().flush_osd_updates();
+ info->owner->machine().debug_view().flush_osd_updates();
break;
}
@@ -1484,7 +1486,7 @@ static LRESULT CALLBACK debugwin_view_proc(HWND wnd, UINT message, WPARAM wparam
debug_view_xy topleft = info->view->visible_position();
topleft.y = debugwin_view_process_scroll(info, LOWORD(wparam), (HWND)lparam);
info->view->set_visible_position(topleft);
- info->owner->machine->debug_view().flush_osd_updates();
+ info->owner->machine().debug_view().flush_osd_updates();
break;
}
@@ -1571,7 +1573,7 @@ static LRESULT CALLBACK debugwin_edit_proc(HWND wnd, UINT message, WPARAM wparam
// ignore chars associated with keys we've handled
if (info->ignore_char_lparam == (lparam >> 16))
info->ignore_char_lparam = 0;
- else if (waiting_for_debugger || !debugwin_seq_pressed(info->machine))
+ else if (waiting_for_debugger || !debugwin_seq_pressed(info->machine()))
{
switch (wparam)
{
@@ -1638,13 +1640,13 @@ static LRESULT CALLBACK debugwin_edit_proc(HWND wnd, UINT message, WPARAM wparam
//============================================================
#ifdef UNUSED_FUNCTION
-static void generic_create_window(running_machine *machine, debug_view_type type)
+static void generic_create_window(running_machine &machine, debug_view_type type)
{
debugwin_info *info;
char title[256];
// create the window
- _snprintf(title, ARRAY_LENGTH(title), "Debug: %s [%s]", machine->system().description, machine->system().name);
+ _snprintf(title, ARRAY_LENGTH(title), "Debug: %s [%s]", machine.system().description, machine.system().name);
info = debugwin_window_create(machine, title, NULL);
if (info == NULL || !debugwin_view_create(info, 0, type))
return;
@@ -1696,7 +1698,7 @@ static void generic_recompute_children(debugwin_info *info)
// log_create_window
//============================================================
-static void log_create_window(running_machine *machine)
+static void log_create_window(running_machine &machine)
{
debug_view_xy totalsize;
debugwin_info *info;
@@ -1704,7 +1706,7 @@ static void log_create_window(running_machine *machine)
RECT bounds;
// create the window
- _snprintf(title, ARRAY_LENGTH(title), "Errorlog: %s [%s]", machine->system().description, machine->system().name);
+ _snprintf(title, ARRAY_LENGTH(title), "Errorlog: %s [%s]", machine.system().description, machine.system().name);
info = debugwin_window_create(machine, title, NULL);
if (info == NULL || !debugwin_view_create(info, 0, DVT_LOG))
return;
@@ -1740,7 +1742,7 @@ static void log_create_window(running_machine *machine)
// memory_create_window
//============================================================
-static void memory_create_window(running_machine *machine)
+static void memory_create_window(running_machine &machine)
{
device_t *curcpu = debug_cpu_get_visible_cpu(machine);
debugwin_info *info;
@@ -1930,7 +1932,7 @@ static int memory_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
if (sel != CB_ERR)
{
memview->set_source(*memview->source_list().by_index(sel));
- memory_update_caption(info->machine, info->wnd);
+ memory_update_caption(info->machine(), info->wnd);
// reset the focus
SetFocus(info->focuswnd);
@@ -2042,7 +2044,7 @@ static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam)
// memory_update_caption
//============================================================
-static void memory_update_caption(running_machine *machine, HWND wnd)
+static void memory_update_caption(running_machine &machine, HWND wnd)
{
debugwin_info *info = (debugwin_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA);
astring title;
@@ -2057,7 +2059,7 @@ static void memory_update_caption(running_machine *machine, HWND wnd)
// disasm_create_window
//============================================================
-static void disasm_create_window(running_machine *machine)
+static void disasm_create_window(running_machine &machine)
{
device_t *curcpu = debug_cpu_get_visible_cpu(machine);
debugwin_info *info;
@@ -2239,7 +2241,7 @@ static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
if (sel != CB_ERR)
{
dasmview->set_source(*dasmview->source_list().by_index(sel));
- disasm_update_caption(info->machine, info->wnd);
+ disasm_update_caption(info->machine(), info->wnd);
// reset the focus
SetFocus(info->focuswnd);
@@ -2268,16 +2270,16 @@ static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
return 1;
case ID_RUN_TO_CURSOR:
- if (dasmview->cursor_visible() && debug_cpu_get_visible_cpu(info->machine) == dasmview->source()->device())
+ if (dasmview->cursor_visible() && debug_cpu_get_visible_cpu(info->machine()) == dasmview->source()->device())
{
offs_t address = dasmview->selected_address();
sprintf(command, "go 0x%X", address);
- debug_console_execute_command(info->machine, command, 1);
+ debug_console_execute_command(info->machine(), command, 1);
}
return 1;
case ID_TOGGLE_BREAKPOINT:
- if (dasmview->cursor_visible() && debug_cpu_get_visible_cpu(info->machine) == dasmview->source()->device())
+ if (dasmview->cursor_visible() && debug_cpu_get_visible_cpu(info->machine()) == dasmview->source()->device())
{
offs_t address = dasmview->selected_address();
device_debug *debug = dasmview->source()->device()->debug();
@@ -2296,7 +2298,7 @@ static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
sprintf(command, "bpset 0x%X", address);
else
sprintf(command, "bpclear 0x%X", bpindex);
- debug_console_execute_command(info->machine, command, 1);
+ debug_console_execute_command(info->machine(), command, 1);
}
return 1;
}
@@ -2360,7 +2362,7 @@ static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam)
// disasm_update_caption
//============================================================
-static void disasm_update_caption(running_machine *machine, HWND wnd)
+static void disasm_update_caption(running_machine &machine, HWND wnd)
{
debugwin_info *info = (debugwin_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA);
astring title;
@@ -2375,7 +2377,7 @@ static void disasm_update_caption(running_machine *machine, HWND wnd)
// console_create_window
//============================================================
-void console_create_window(running_machine *machine)
+void console_create_window(running_machine &machine)
{
debugwin_info *info;
int bestwidth, bestheight;
@@ -2494,11 +2496,11 @@ void console_create_window(running_machine *machine)
cleanup:
if (info->view[2].view)
- machine->debug_view().free_view(*info->view[2].view);
+ machine.debug_view().free_view(*info->view[2].view);
if (info->view[1].view)
- machine->debug_view().free_view(*info->view[1].view);
+ machine.debug_view().free_view(*info->view[1].view);
if (info->view[0].view)
- machine->debug_view().free_view(*info->view[0].view);
+ machine.debug_view().free_view(*info->view[0].view);
}
@@ -2562,11 +2564,11 @@ static void console_process_string(debugwin_info *info, const char *string)
// an empty string is a single step
if (string[0] == 0)
- debug_cpu_get_visible_cpu(info->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->single_step();
// otherwise, just process the command
else
- debug_console_execute_command(info->machine, string, 1);
+ debug_console_execute_command(info->machine(), string, 1);
// clear the edit text box
SendMessage(info->editwnd, WM_SETTEXT, 0, (LPARAM)&buffer);
@@ -2588,7 +2590,7 @@ static void console_set_cpu(device_t *device)
char curtitle[256];
astring title;
- title.printf("Debug: %s - %s '%s'", device->machine->system().name, device->name(), device->tag());
+ title.printf("Debug: %s - %s '%s'", device->machine().system().name, device->name(), device->tag());
win_get_window_text_utf8(main_console->wnd, curtitle, ARRAY_LENGTH(curtitle));
if (title.cmp(curtitle) != 0)
win_set_window_text_utf8(main_console->wnd, title);
@@ -2653,60 +2655,60 @@ static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
switch (LOWORD(wparam))
{
case ID_NEW_MEMORY_WND:
- memory_create_window(info->machine);
+ memory_create_window(info->machine());
return 1;
case ID_NEW_DISASM_WND:
- disasm_create_window(info->machine);
+ disasm_create_window(info->machine());
return 1;
case ID_NEW_LOG_WND:
- log_create_window(info->machine);
+ log_create_window(info->machine());
return 1;
case ID_RUN_AND_HIDE:
smart_show_all(FALSE);
case ID_RUN:
- debug_cpu_get_visible_cpu(info->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go();
return 1;
case ID_NEXT_CPU:
- debug_cpu_get_visible_cpu(info->machine)->debug()->go_next_device();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go_next_device();
return 1;
case ID_RUN_VBLANK:
- debug_cpu_get_visible_cpu(info->machine)->debug()->go_vblank();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go_vblank();
return 1;
case ID_RUN_IRQ:
- debug_cpu_get_visible_cpu(info->machine)->debug()->go_interrupt();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go_interrupt();
return 1;
case ID_STEP:
- debug_cpu_get_visible_cpu(info->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->single_step();
return 1;
case ID_STEP_OVER:
- debug_cpu_get_visible_cpu(info->machine)->debug()->single_step_over();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->single_step_over();
return 1;
case ID_STEP_OUT:
- debug_cpu_get_visible_cpu(info->machine)->debug()->single_step_out();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->single_step_out();
return 1;
case ID_HARD_RESET:
- info->machine->schedule_hard_reset();
+ info->machine().schedule_hard_reset();
return 1;
case ID_SOFT_RESET:
- info->machine->schedule_soft_reset();
- debug_cpu_get_visible_cpu(info->machine)->debug()->go();
+ info->machine().schedule_soft_reset();
+ debug_cpu_get_visible_cpu(info->machine())->debug()->go();
return 1;
case ID_EXIT:
if (info->focuswnd != NULL)
SetFocus(info->focuswnd);
- info->machine->schedule_exit();
+ info->machine().schedule_exit();
return 1;
}
@@ -2722,7 +2724,7 @@ static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar
static int global_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam)
{
/* ignore any keys that are received while the debug key is down */
- if (!waiting_for_debugger && debugwin_seq_pressed(info->machine))
+ if (!waiting_for_debugger && debugwin_seq_pressed(info->machine()))
return 1;
switch (wparam)
diff --git a/src/osd/windows/debugwin.h b/src/osd/windows/debugwin.h
index a522d56c693..e55604df7de 100644
--- a/src/osd/windows/debugwin.h
+++ b/src/osd/windows/debugwin.h
@@ -58,6 +58,6 @@
void debugwin_init_windows(running_machine &machine);
void debugwin_destroy_windows(void);
void debugwin_show(int type);
-void debugwin_update_during_game(running_machine *machine);
+void debugwin_update_during_game(running_machine &machine);
#endif
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index e9f4beb548c..02aa6faa72d 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -537,7 +537,7 @@ static int drawd3d_window_init(win_window_info *window)
// experimental: load a PNG to use for vector rendering; it is treated
// as a brightness map
- emu_file file(window->machine->options().art_path(), OPEN_FLAG_READ);
+ emu_file file(window->machine().options().art_path(), OPEN_FLAG_READ);
d3d->vector_bitmap = render_load_png(file, NULL, "vector.png", NULL, NULL);
if (d3d->vector_bitmap != NULL)
{
@@ -807,7 +807,7 @@ try_again:
if (window->fullscreen)
{
// only set the gamma if it's not 1.0f
- windows_options &options = downcast<windows_options &>(window->machine->options());
+ windows_options &options = downcast<windows_options &>(window->machine().options());
float brightness = options.full_screen_brightness();
float contrast = options.full_screen_contrast();
float gamma = options.full_screen_gamma();
@@ -1285,7 +1285,7 @@ static void pick_best_mode(win_window_info *window)
int modenum;
// determine the refresh rate of the primary screen
- const screen_device_config *primary_screen = window->machine->config().first_screen();
+ const screen_device_config *primary_screen = window->machine().config().first_screen();
if (primary_screen != NULL)
target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh());
diff --git a/src/osd/windows/drawdd.c b/src/osd/windows/drawdd.c
index d44f6846034..e1957094f32 100644
--- a/src/osd/windows/drawdd.c
+++ b/src/osd/windows/drawdd.c
@@ -457,7 +457,7 @@ static int drawdd_window_draw(win_window_info *window, HDC dc, int update)
if (result != DD_OK) mame_printf_verbose("DirectDraw: Error %08X unlocking blit surface\n", (int)result);
// sync to VBLANK
- if ((video_config.waitvsync || video_config.syncrefresh) && window->machine->video().throttled() && (!window->fullscreen || dd->back == NULL))
+ if ((video_config.waitvsync || video_config.syncrefresh) && window->machine().video().throttled() && (!window->fullscreen || dd->back == NULL))
{
result = IDirectDraw7_WaitForVerticalBlank(dd->ddraw, DDWAITVB_BLOCKBEGIN, NULL);
if (result != DD_OK) mame_printf_verbose("DirectDraw: Error %08X waiting for VBLANK\n", (int)result);
@@ -613,7 +613,7 @@ static int ddraw_create_surfaces(win_window_info *window)
if (window->fullscreen)
{
// only set the gamma if it's not 1.0f
- windows_options &options = downcast<windows_options &>(window->machine->options());
+ windows_options &options = downcast<windows_options &>(window->machine().options());
float brightness = options.full_screen_brightness();
float contrast = options.full_screen_contrast();
float gamma = options.full_screen_gamma();
@@ -1328,7 +1328,7 @@ static void pick_best_mode(win_window_info *window)
// determine the refresh rate of the primary screen
einfo.target_refresh = 60.0;
- const screen_device_config *primary_screen = window->machine->config().first_screen();
+ const screen_device_config *primary_screen = window->machine().config().first_screen();
if (primary_screen != NULL)
einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh());
printf("Target refresh = %f\n", einfo.target_refresh);
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index 08dbec1baa0..35fe03f5cdb 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -163,6 +163,8 @@ struct _rawinput_device_info
typedef struct _device_info device_info;
struct _device_info
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
// device information
device_info ** head;
device_info * next;
@@ -170,7 +172,7 @@ struct _device_info
void (*poll)(device_info *info);
// MAME information
- running_machine * machine;
+ running_machine * m_machine;
input_device * device;
// device state
@@ -253,7 +255,7 @@ static void device_list_poll_devices(device_info *devlist_head);
static void device_list_reset_devices(device_info *devlist_head);
// generic device management
-static device_info *generic_device_alloc(running_machine *machine, device_info **devlist_head_ptr, const TCHAR *name);
+static device_info *generic_device_alloc(running_machine &machine, device_info **devlist_head_ptr, const TCHAR *name);
static void generic_device_free(device_info *devinfo);
static int generic_device_index(device_info *devlist_head, device_info *devinfo);
static void generic_device_reset(device_info *devinfo);
@@ -261,16 +263,16 @@ static INT32 generic_button_get_state(void *device_internal, void *item_internal
static INT32 generic_axis_get_state(void *device_internal, void *item_internal);
// Win32-specific input code
-static void win32_init(running_machine *machine);
+static void win32_init(running_machine &machine);
static void win32_exit(running_machine &machine);
static void win32_keyboard_poll(device_info *devinfo);
static void win32_lightgun_poll(device_info *devinfo);
// DirectInput-specific code
-static void dinput_init(running_machine *machine);
+static void dinput_init(running_machine &machine);
static void dinput_exit(running_machine &machine);
static HRESULT dinput_set_dword_property(LPDIRECTINPUTDEVICE device, REFGUID property_guid, DWORD object, DWORD how, DWORD value);
-static device_info *dinput_device_create(running_machine *machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level);
+static device_info *dinput_device_create(running_machine &machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level);
static void dinput_device_release(device_info *devinfo);
static char *dinput_device_item_name(device_info *devinfo, int offset, const TCHAR *defstring, const TCHAR *suffix);
static HRESULT dinput_device_poll(device_info *devinfo);
@@ -283,14 +285,14 @@ static void dinput_joystick_poll(device_info *devinfo);
static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_internal);
// RawInput-specific code
-static void rawinput_init(running_machine *machine);
+static void rawinput_init(running_machine &machine);
static void rawinput_exit(running_machine &machine);
-static device_info *rawinput_device_create(running_machine *machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device);
+static device_info *rawinput_device_create(running_machine &machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device);
static void rawinput_device_release(device_info *info);
static TCHAR *rawinput_device_improve_name(TCHAR *name);
-static void rawinput_keyboard_enum(running_machine *machine, PRAWINPUTDEVICELIST device);
+static void rawinput_keyboard_enum(running_machine &machine, PRAWINPUTDEVICELIST device);
static void rawinput_keyboard_update(HANDLE device, RAWKEYBOARD *data);
-static void rawinput_mouse_enum(running_machine *machine, PRAWINPUTDEVICELIST device);
+static void rawinput_mouse_enum(running_machine &machine, PRAWINPUTDEVICELIST device);
static void rawinput_mouse_update(HANDLE device, RAWMOUSE *data);
static void rawinput_mouse_poll(device_info *devinfo);
@@ -446,7 +448,7 @@ static const int win_key_trans_table[][4] =
// INLINE FUNCTIONS
//============================================================
-INLINE void poll_if_necessary(running_machine *machine)
+INLINE void poll_if_necessary(running_machine &machine)
{
// make sure we poll at least once every 1/4 second
if (GetTickCount() > last_poll + 1000 / 4)
@@ -497,19 +499,19 @@ INLINE INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax)
// wininput_init
//============================================================
-void wininput_init(running_machine *machine)
+void wininput_init(running_machine &machine)
{
// we need pause and exit callbacks
- machine->add_notifier(MACHINE_NOTIFY_PAUSE, wininput_pause);
- machine->add_notifier(MACHINE_NOTIFY_RESUME, wininput_resume);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, wininput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_PAUSE, wininput_pause);
+ machine.add_notifier(MACHINE_NOTIFY_RESUME, wininput_resume);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, wininput_exit);
// allocate a lock for input synchronizations, since messages sometimes come from another thread
input_lock = osd_lock_alloc();
assert_always(input_lock != NULL, "Failed to allocate input_lock");
// decode the options
- lightgun_shared_axis_mode = downcast<windows_options &>(machine->options()).dual_lightgun();
+ lightgun_shared_axis_mode = downcast<windows_options &>(machine.options()).dual_lightgun();
// initialize RawInput and DirectInput (RawInput first so we can fall back)
rawinput_init(machine);
@@ -559,7 +561,7 @@ static void wininput_exit(running_machine &machine)
// wininput_poll
//============================================================
-void wininput_poll(running_machine *machine)
+void wininput_poll(running_machine &machine)
{
int hasfocus = winwindow_has_focus() && input_enabled;
@@ -809,7 +811,7 @@ static void device_list_reset_devices(device_info *devlist_head)
// generic_device_alloc
//============================================================
-static device_info *generic_device_alloc(running_machine *machine, device_info **devlist_head_ptr, const TCHAR *name)
+static device_info *generic_device_alloc(running_machine &machine, device_info **devlist_head_ptr, const TCHAR *name)
{
device_info **curdev_ptr;
device_info *devinfo;
@@ -817,7 +819,7 @@ static device_info *generic_device_alloc(running_machine *machine, device_info *
// allocate memory for the device object
devinfo = global_alloc_clear(device_info);
devinfo->head = devlist_head_ptr;
- devinfo->machine = machine;
+ devinfo->m_machine = &machine;
// allocate a UTF8 copy of the name
devinfo->name = utf8_from_tstring(name);
@@ -913,7 +915,7 @@ static INT32 generic_button_get_state(void *device_internal, void *item_internal
BYTE *itemdata = (BYTE *)item_internal;
// return the current state
- poll_if_necessary(devinfo->machine);
+ poll_if_necessary(devinfo->machine());
return *itemdata >> 7;
}
@@ -928,7 +930,7 @@ static INT32 generic_axis_get_state(void *device_internal, void *item_internal)
LONG *axisdata = (LONG *)item_internal;
// return the current state
- poll_if_necessary(devinfo->machine);
+ poll_if_necessary(devinfo->machine());
return *axisdata;
}
@@ -937,7 +939,7 @@ static INT32 generic_axis_get_state(void *device_internal, void *item_internal)
// win32_init
//============================================================
-static void win32_init(running_machine *machine)
+static void win32_init(running_machine &machine)
{
int gunnum;
@@ -946,7 +948,7 @@ static void win32_init(running_machine *machine)
return;
// we need an exit callback
- machine->add_notifier(MACHINE_NOTIFY_EXIT, win32_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, win32_exit);
// allocate two lightgun devices
for (gunnum = 0; gunnum < 2; gunnum++)
@@ -1069,7 +1071,7 @@ static void win32_lightgun_poll(device_info *devinfo)
// dinput_init
//============================================================
-static void dinput_init(running_machine *machine)
+static void dinput_init(running_machine &machine)
{
HRESULT result;
#if DIRECTINPUT_VERSION >= 0x800
@@ -1114,13 +1116,13 @@ static void dinput_init(running_machine *machine)
mame_printf_verbose("DirectInput: Using DirectInput %d\n", dinput_version >> 8);
// we need an exit callback
- machine->add_notifier(MACHINE_NOTIFY_EXIT, dinput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, dinput_exit);
// initialize keyboard devices, but only if we don't have any yet
if (keyboard_list == NULL)
{
// enumerate the ones we have
- result = IDirectInput_EnumDevices(dinput, didevtype_keyboard, dinput_keyboard_enum, machine, DIEDFL_ATTACHEDONLY);
+ result = IDirectInput_EnumDevices(dinput, didevtype_keyboard, dinput_keyboard_enum, &machine, DIEDFL_ATTACHEDONLY);
if (result != DI_OK)
fatalerror("DirectInput: Unable to enumerate keyboards (result=%08X)\n", (UINT32)result);
}
@@ -1129,13 +1131,13 @@ static void dinput_init(running_machine *machine)
if (mouse_list == NULL)
{
// enumerate the ones we have
- result = IDirectInput_EnumDevices(dinput, didevtype_mouse, dinput_mouse_enum, machine, DIEDFL_ATTACHEDONLY);
+ result = IDirectInput_EnumDevices(dinput, didevtype_mouse, dinput_mouse_enum, &machine, DIEDFL_ATTACHEDONLY);
if (result != DI_OK)
fatalerror("DirectInput: Unable to enumerate mice (result=%08X)\n", (UINT32)result);
}
// initialize joystick devices
- result = IDirectInput_EnumDevices(dinput, didevtype_joystick, dinput_joystick_enum, machine, DIEDFL_ATTACHEDONLY);
+ result = IDirectInput_EnumDevices(dinput, didevtype_joystick, dinput_joystick_enum, &machine, DIEDFL_ATTACHEDONLY);
if (result != DI_OK)
fatalerror("DirectInput: Unable to enumerate joysticks (result=%08X)\n", (UINT32)result);
}
@@ -1186,7 +1188,7 @@ static HRESULT dinput_set_dword_property(LPDIRECTINPUTDEVICE device, REFGUID pro
// dinput_device_create
//============================================================
-static device_info *dinput_device_create(running_machine *machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level)
+static device_info *dinput_device_create(running_machine &machine, device_info **devlist_head_ptr, LPCDIDEVICEINSTANCE instance, LPCDIDATAFORMAT format1, LPCDIDATAFORMAT format2, DWORD cooperative_level)
{
device_info *devinfo;
HRESULT result;
@@ -1330,7 +1332,7 @@ static HRESULT dinput_device_poll(device_info *devinfo)
static BOOL CALLBACK dinput_keyboard_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
{
- running_machine *machine = (running_machine *)ref;
+ running_machine &machine = *(running_machine *)ref;
device_info *devinfo;
int keynum;
@@ -1386,7 +1388,7 @@ static void dinput_keyboard_poll(device_info *devinfo)
static BOOL CALLBACK dinput_mouse_enum(LPCDIDEVICEINSTANCE instance, LPVOID ref)
{
device_info *devinfo, *guninfo = NULL;
- running_machine *machine = (running_machine *)ref;
+ running_machine &machine = *(running_machine *)ref;
int axisnum, butnum;
HRESULT result;
@@ -1489,7 +1491,7 @@ static BOOL CALLBACK dinput_joystick_enum(LPCDIDEVICEINSTANCE instance, LPVOID r
{
DWORD cooperative_level = DISCL_FOREGROUND | DISCL_EXCLUSIVE;
int axisnum, axiscount, povnum, butnum;
- running_machine *machine = (running_machine *)ref;
+ running_machine &machine = *(running_machine *)ref;
device_info *devinfo;
HRESULT result;
@@ -1623,7 +1625,7 @@ static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_int
DWORD pov;
// get the current state
- poll_if_necessary(devinfo->machine);
+ poll_if_necessary(devinfo->machine());
pov = devinfo->joystick.state.rgdwPOV[povnum];
// if invalid, return 0
@@ -1646,7 +1648,7 @@ static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_int
// rawinput_init
//============================================================
-static void rawinput_init(running_machine *machine)
+static void rawinput_init(running_machine &machine)
{
RAWINPUTDEVICELIST *devlist = NULL;
int device_count, devnum, regcount;
@@ -1654,7 +1656,7 @@ static void rawinput_init(running_machine *machine)
HMODULE user32;
// we need pause and exit callbacks
- machine->add_notifier(MACHINE_NOTIFY_EXIT, rawinput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, rawinput_exit);
// look in user32 for the raw input APIs
user32 = LoadLibrary(TEXT("user32.dll"));
@@ -1746,7 +1748,7 @@ static void rawinput_exit(running_machine &machine)
// rawinput_device_create
//============================================================
-static device_info *rawinput_device_create(running_machine *machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device)
+static device_info *rawinput_device_create(running_machine &machine, device_info **devlist_head_ptr, PRAWINPUTDEVICELIST device)
{
device_info *devinfo = NULL;
TCHAR *tname = NULL;
@@ -1950,7 +1952,7 @@ exit:
// rawinput_keyboard_enum
//============================================================
-static void rawinput_keyboard_enum(running_machine *machine, PRAWINPUTDEVICELIST device)
+static void rawinput_keyboard_enum(running_machine &machine, PRAWINPUTDEVICELIST device)
{
device_info *devinfo;
int keynum;
@@ -2015,7 +2017,7 @@ static void rawinput_keyboard_update(HANDLE device, RAWKEYBOARD *data)
// rawinput_mouse_enum
//============================================================
-static void rawinput_mouse_enum(running_machine *machine, PRAWINPUTDEVICELIST device)
+static void rawinput_mouse_enum(running_machine &machine, PRAWINPUTDEVICELIST device)
{
device_info *devinfo, *guninfo = NULL;
int axisnum, butnum;
@@ -2122,7 +2124,7 @@ static void rawinput_mouse_update(HANDLE device, RAWMOUSE *data)
static void rawinput_mouse_poll(device_info *devinfo)
{
- poll_if_necessary(devinfo->machine);
+ poll_if_necessary(devinfo->machine());
// copy the accumulated raw state to the actual state
osd_lock_acquire(input_lock);
diff --git a/src/osd/windows/input.h b/src/osd/windows/input.h
index 98a94768e9e..e161f4fe92a 100644
--- a/src/osd/windows/input.h
+++ b/src/osd/windows/input.h
@@ -47,8 +47,8 @@
// PROTOTYPES
//============================================================
-void wininput_init(running_machine *machine);
-void wininput_poll(running_machine *machine);
+void wininput_init(running_machine &machine);
+void wininput_poll(running_machine &machine);
BOOL wininput_handle_mouse_button(int button, int down, int x, int y);
BOOL wininput_handle_raw(HANDLE device);
diff --git a/src/osd/windows/output.c b/src/osd/windows/output.c
index d81643e610e..bd5278583d7 100644
--- a/src/osd/windows/output.c
+++ b/src/osd/windows/output.c
@@ -105,7 +105,7 @@ static int create_window_class(void);
static LRESULT CALLBACK output_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
static LRESULT register_client(HWND hwnd, LPARAM id);
static LRESULT unregister_client(HWND hwnd, LPARAM id);
-static LRESULT send_id_string(running_machine *machine, HWND hwnd, LPARAM id);
+static LRESULT send_id_string(running_machine &machine, HWND hwnd, LPARAM id);
static void notifier_callback(const char *outname, INT32 value, void *param);
@@ -114,12 +114,12 @@ static void notifier_callback(const char *outname, INT32 value, void *param);
// winoutput_init
//============================================================
-void winoutput_init(running_machine *machine)
+void winoutput_init(running_machine &machine)
{
int result;
// ensure we get cleaned up
- machine->add_notifier(MACHINE_NOTIFY_EXIT, winoutput_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, winoutput_exit);
// reset globals
clientlist = NULL;
@@ -143,7 +143,7 @@ void winoutput_init(running_machine *machine)
assert(output_hwnd != NULL);
// set a pointer to the running machine
- SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)machine);
+ SetWindowLongPtr(output_hwnd, GWLP_USERDATA, (LONG_PTR)&machine);
// allocate message ids
om_mame_start = RegisterWindowMessage(OM_MAME_START);
@@ -222,7 +222,7 @@ static int create_window_class(void)
static LRESULT CALLBACK output_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam)
{
LONG_PTR ptr = GetWindowLongPtr(wnd, GWLP_USERDATA);
- running_machine *machine = (running_machine *)ptr;
+ running_machine &machine = *(running_machine *)ptr;
// register a new client
if (message == om_mame_register_client)
@@ -300,7 +300,7 @@ static LRESULT unregister_client(HWND hwnd, LPARAM id)
// send_id_string
//============================================================
-static LRESULT send_id_string(running_machine *machine, HWND hwnd, LPARAM id)
+static LRESULT send_id_string(running_machine &machine, HWND hwnd, LPARAM id)
{
copydata_id_string *temp;
COPYDATASTRUCT copydata;
@@ -309,7 +309,7 @@ static LRESULT send_id_string(running_machine *machine, HWND hwnd, LPARAM id)
// id 0 is the name of the game
if (id == 0)
- name = machine->system().name;
+ name = machine.system().name;
else
name = output_id_to_name(id);
diff --git a/src/osd/windows/output.h b/src/osd/windows/output.h
index 91e3685a34f..35da4039ac0 100644
--- a/src/osd/windows/output.h
+++ b/src/osd/windows/output.h
@@ -123,7 +123,7 @@ struct _copydata_id_string
// FUNCTION PROTOTYPES
//============================================================
-void winoutput_init(running_machine *machine);
+void winoutput_init(running_machine &machine);
#endif /* __WINDOWS_OUTPUT_H__ */
diff --git a/src/osd/windows/sound.c b/src/osd/windows/sound.c
index 12f5f873bbc..1e7dc3e0d6d 100644
--- a/src/osd/windows/sound.c
+++ b/src/osd/windows/sound.c
@@ -101,7 +101,7 @@ static int buffer_overflows;
//============================================================
static void sound_exit(running_machine &machine);
-static HRESULT dsound_init(running_machine *machine);
+static HRESULT dsound_init(running_machine &machine);
static void dsound_kill(void);
static HRESULT dsound_create_buffers(void);
static void dsound_destroy_buffers(void);
@@ -112,14 +112,14 @@ static void dsound_destroy_buffers(void);
// winsound_init
//============================================================
-void winsound_init(running_machine *machine)
+void winsound_init(running_machine &machine)
{
// if no sound, don't create anything
- if (!machine->options().sound())
+ if (!machine.options().sound())
return;
// ensure we get called on the way out
- machine->add_notifier(MACHINE_NOTIFY_EXIT, sound_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, sound_exit);
// attempt to initialize directsound
// don't make it fatal if we can't -- we'll just run without sound
@@ -267,7 +267,7 @@ void windows_osd_interface::set_mastervolume(int attenuation)
// dsound_init
//============================================================
-static HRESULT dsound_init(running_machine *machine)
+static HRESULT dsound_init(running_machine &machine)
{
HRESULT result;
@@ -300,12 +300,12 @@ static HRESULT dsound_init(running_machine *machine)
stream_format.wBitsPerSample = 16;
stream_format.wFormatTag = WAVE_FORMAT_PCM;
stream_format.nChannels = 2;
- stream_format.nSamplesPerSec = machine->sample_rate();
+ stream_format.nSamplesPerSec = machine.sample_rate();
stream_format.nBlockAlign = stream_format.wBitsPerSample * stream_format.nChannels / 8;
stream_format.nAvgBytesPerSec = stream_format.nSamplesPerSec * stream_format.nBlockAlign;
// compute the buffer size based on the output sample rate
- stream_buffer_size = stream_format.nSamplesPerSec * stream_format.nBlockAlign * downcast<windows_options &>(machine->options()).audio_latency() / 10;
+ stream_buffer_size = stream_format.nSamplesPerSec * stream_format.nBlockAlign * downcast<windows_options &>(machine.options()).audio_latency() / 10;
stream_buffer_size = (stream_buffer_size / 1024) * 1024;
if (stream_buffer_size < 1024)
stream_buffer_size = 1024;
diff --git a/src/osd/windows/sound.h b/src/osd/windows/sound.h
index d7aaa4743cd..11625c74c65 100644
--- a/src/osd/windows/sound.h
+++ b/src/osd/windows/sound.h
@@ -47,6 +47,6 @@
// PROTOTYPES
//============================================================
-void winsound_init(running_machine *machine);
+void winsound_init(running_machine &machine);
#endif
diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c
index 2a7f56a807f..d4fde80ed6c 100644
--- a/src/osd/windows/video.c
+++ b/src/osd/windows/video.c
@@ -94,9 +94,9 @@ static void init_monitors(void);
static BOOL CALLBACK monitor_enum_callback(HMONITOR handle, HDC dc, LPRECT rect, LPARAM data);
static win_monitor_info *pick_monitor(windows_options &options, int index);
-static void check_osd_inputs(running_machine *machine);
+static void check_osd_inputs(running_machine &machine);
-static void extract_video_config(running_machine *machine);
+static void extract_video_config(running_machine &machine);
static float get_aspect(const char *defdata, const char *data, int report_error);
static void get_resolution(const char *defdata, const char *data, win_window_config *config, int report_error);
@@ -106,12 +106,12 @@ static void get_resolution(const char *defdata, const char *data, win_window_con
// winvideo_init
//============================================================
-void winvideo_init(running_machine *machine)
+void winvideo_init(running_machine &machine)
{
int index;
// ensure we get called on the way out
- machine->add_notifier(MACHINE_NOTIFY_EXIT, winvideo_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, winvideo_exit);
// extract data from the options
extract_video_config(machine);
@@ -123,15 +123,15 @@ void winvideo_init(running_machine *machine)
winwindow_init(machine);
// create the windows
- windows_options &options = downcast<windows_options &>(machine->options());
+ windows_options &options = downcast<windows_options &>(machine.options());
for (index = 0; index < video_config.numscreens; index++)
winwindow_video_window_create(machine, index, pick_monitor(options, index), &video_config.window[index]);
if (video_config.mode != VIDEO_MODE_NONE)
SetForegroundWindow(win_window_list->hwnd);
// possibly create the debug window, but don't show it yet
- if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
- debugwin_init_windows(*machine);
+ if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ debugwin_init_windows(machine);
}
@@ -220,9 +220,9 @@ void windows_osd_interface::update(bool skip_redraw)
winwindow_video_window_update(window);
// poll the joystick values here
- winwindow_process_events(&machine(), TRUE);
- wininput_poll(&machine());
- check_osd_inputs(&machine());
+ winwindow_process_events(machine(), TRUE);
+ wininput_poll(machine());
+ check_osd_inputs(machine());
}
@@ -359,7 +359,7 @@ finishit:
// check_osd_inputs
//============================================================
-static void check_osd_inputs(running_machine *machine)
+static void check_osd_inputs(running_machine &machine)
{
// check for toggling fullscreen mode
if (ui_input_pressed(machine, IPT_OSD_1))
@@ -372,9 +372,9 @@ static void check_osd_inputs(running_machine *machine)
// extract_video_config
//============================================================
-static void extract_video_config(running_machine *machine)
+static void extract_video_config(running_machine &machine)
{
- windows_options &options = downcast<windows_options &>(machine->options());
+ windows_options &options = downcast<windows_options &>(machine.options());
const char *stemp;
// global options: extract the data
@@ -384,7 +384,7 @@ static void extract_video_config(running_machine *machine)
video_config.numscreens = options.numscreens();
// if we are in debug mode, never go full screen
- if (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED)
video_config.windowed = TRUE;
// per-window options: extract the data
diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h
index afb8ac65049..fb931845b1c 100644
--- a/src/osd/windows/video.h
+++ b/src/osd/windows/video.h
@@ -125,7 +125,7 @@ extern win_video_config video_config;
// PROTOTYPES
//============================================================
-void winvideo_init(running_machine *machine);
+void winvideo_init(running_machine &machine);
void winvideo_monitor_refresh(win_monitor_info *monitor);
float winvideo_monitor_get_aspect(win_monitor_info *monitor);
diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c
index 10130476245..0aeb039e5d7 100644
--- a/src/osd/windows/window.c
+++ b/src/osd/windows/window.c
@@ -219,18 +219,18 @@ static void mtlog_dump(void) { }
// (main thread)
//============================================================
-void winwindow_init(running_machine *machine)
+void winwindow_init(running_machine &machine)
{
size_t temp;
// determine if we are using multithreading or not
- multithreading_enabled = downcast<windows_options &>(machine->options()).multithreading();
+ multithreading_enabled = downcast<windows_options &>(machine.options()).multithreading();
// get the main thread ID before anything else
main_threadid = GetCurrentThreadId();
// ensure we get called on the way out
- machine->add_notifier(MACHINE_NOTIFY_EXIT, winwindow_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, winwindow_exit);
// set up window class and register it
create_window_class();
@@ -268,18 +268,18 @@ void winwindow_init(running_machine *machine)
// initialize the drawers
if (video_config.mode == VIDEO_MODE_D3D)
{
- if (drawd3d_init(*machine, &draw))
+ if (drawd3d_init(machine, &draw))
video_config.mode = VIDEO_MODE_GDI;
}
if (video_config.mode == VIDEO_MODE_DDRAW)
{
- if (drawdd_init(*machine, &draw))
+ if (drawdd_init(machine, &draw))
video_config.mode = VIDEO_MODE_GDI;
}
if (video_config.mode == VIDEO_MODE_GDI)
- drawgdi_init(*machine, &draw);
+ drawgdi_init(machine, &draw);
if (video_config.mode == VIDEO_MODE_NONE)
- drawnone_init(*machine, &draw);
+ drawnone_init(machine, &draw);
// set up the window list
last_window_ptr = &win_window_list;
@@ -339,7 +339,7 @@ static void winwindow_exit(running_machine &machine)
// (main thread)
//============================================================
-void winwindow_process_events_periodic(running_machine *machine)
+void winwindow_process_events_periodic(running_machine &machine)
{
DWORD currticks = GetTickCount();
@@ -375,14 +375,14 @@ static BOOL is_mame_window(HWND hwnd)
// (main thread)
//============================================================
-void winwindow_process_events(running_machine *machine, int ingame)
+void winwindow_process_events(running_machine &machine, int ingame)
{
MSG message;
assert(GetCurrentThreadId() == main_threadid);
// if we're running, disable some parts of the debugger
- if (ingame && (machine->debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
+ if (ingame && (machine.debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
debugwin_update_during_game(machine);
// remember the last time we did this
@@ -462,7 +462,7 @@ void winwindow_process_events(running_machine *machine, int ingame)
// (main thread)
//============================================================
-void winwindow_dispatch_message(running_machine *machine, MSG *message)
+void winwindow_dispatch_message(running_machine &machine, MSG *message)
{
assert(GetCurrentThreadId() == main_threadid);
@@ -471,7 +471,7 @@ void winwindow_dispatch_message(running_machine *machine, MSG *message)
{
// special case for quit
case WM_QUIT:
- machine->schedule_exit();
+ machine.schedule_exit();
break;
// temporary pause from the window thread
@@ -511,7 +511,7 @@ void winwindow_toggle_full_screen(void)
// if we are in debug mode, never go full screen
for (window = win_window_list; window != NULL; window = window->next)
- if (window->machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)
+ if (window->machine().debug_flags & DEBUG_FLAG_OSD_ENABLED)
return;
// toggle the window mode
@@ -549,7 +549,7 @@ BOOL winwindow_has_focus(void)
// (main thread)
//============================================================
-void winwindow_update_cursor_state(running_machine *machine)
+void winwindow_update_cursor_state(running_machine &machine)
{
static POINT saved_cursor_pos = { -1, -1 };
@@ -561,7 +561,7 @@ void winwindow_update_cursor_state(running_machine *machine)
// 2. we also hide the cursor in full screen mode and when the window doesn't have a menu
// 3. we also hide the cursor in windowed mode if we're not paused and
// the input system requests it
- if (winwindow_has_focus() && ((!video_config.windowed && !win_has_menu(win_window_list)) || (!machine->paused() && wininput_should_hide_mouse())))
+ if (winwindow_has_focus() && ((!video_config.windowed && !win_has_menu(win_window_list)) || (!machine.paused() && wininput_should_hide_mouse())))
{
win_window_info *window = win_window_list;
RECT bounds;
@@ -602,7 +602,7 @@ void winwindow_update_cursor_state(running_machine *machine)
// (main thread)
//============================================================
-void winwindow_video_window_create(running_machine *machine, int index, win_monitor_info *monitor, const win_window_config *config)
+void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const win_window_config *config)
{
win_window_info *window, *win;
@@ -615,7 +615,7 @@ void winwindow_video_window_create(running_machine *machine, int index, win_moni
window->refresh = config->refresh;
window->monitor = monitor;
window->fullscreen = !video_config.windowed;
- window->machine = machine;
+ window->m_machine = &machine;
// see if we are safe for fullscreen
window->fullscreen_safe = TRUE;
@@ -631,10 +631,10 @@ void winwindow_video_window_create(running_machine *machine, int index, win_moni
window->render_lock = osd_lock_alloc();
// load the layout
- window->target = machine->render().target_alloc();
+ window->target = machine.render().target_alloc();
// set the specific view
- windows_options &options = downcast<windows_options &>(machine->options());
+ windows_options &options = downcast<windows_options &>(machine.options());
set_starting_view(index, window, options.view(index));
// remember the current values in case they change
@@ -644,9 +644,9 @@ void winwindow_video_window_create(running_machine *machine, int index, win_moni
// make the window title
if (video_config.numscreens == 1)
- sprintf(window->title, APPNAME ": %s [%s]", machine->system().description, machine->system().name);
+ sprintf(window->title, APPNAME ": %s [%s]", machine.system().description, machine.system().name);
else
- sprintf(window->title, APPNAME ": %s [%s] - Screen %d", machine->system().description, machine->system().name, index);
+ sprintf(window->title, APPNAME ": %s [%s] - Screen %d", machine.system().description, machine.system().name, index);
// set the initial maximized state
window->startmaximized = options.maximize();
@@ -695,7 +695,7 @@ static void winwindow_video_window_destroy(win_window_info *window)
SendMessage(window->hwnd, WM_USER_SELF_TERMINATE, 0, 0);
// free the render target
- window->machine->render().target_free(window->target);
+ window->machine().render().target_free(window->target);
// free the lock
osd_lock_free(window->render_lock);
@@ -748,7 +748,7 @@ void winwindow_video_window_update(win_window_info *window)
mtlog_add("winwindow_video_window_update: try lock");
// only block if we're throttled
- if (window->machine->video().throttled() || timeGetTime() - last_update_time > 250)
+ if (window->machine().video().throttled() || timeGetTime() - last_update_time > 250)
osd_lock_acquire(window->render_lock);
else
got_lock = osd_lock_try(window->render_lock);
@@ -849,7 +849,7 @@ static void create_window_class(void)
static void set_starting_view(int index, win_window_info *window, const char *view)
{
- const char *defview = downcast<windows_options &>(window->machine->options()).view();
+ const char *defview = downcast<windows_options &>(window->machine().options()).view();
int viewindex;
assert(GetCurrentThreadId() == main_threadid);
@@ -872,7 +872,7 @@ static void set_starting_view(int index, win_window_info *window, const char *vi
// (main thread)
//============================================================
-void winwindow_ui_pause_from_main_thread(running_machine *machine, int pause)
+void winwindow_ui_pause_from_main_thread(running_machine &machine, int pause)
{
int old_temp_pause = ui_temp_pause;
@@ -885,9 +885,9 @@ void winwindow_ui_pause_from_main_thread(running_machine *machine, int pause)
if (ui_temp_pause++ == 0)
{
// only call mame_pause if we weren't already paused due to some external reason
- ui_temp_was_paused = machine->paused();
+ ui_temp_was_paused = machine.paused();
if (!ui_temp_was_paused)
- machine->pause();
+ machine.pause();
SetEvent(ui_pause_event);
}
@@ -901,7 +901,7 @@ void winwindow_ui_pause_from_main_thread(running_machine *machine, int pause)
{
// but only do it if we were the ones who initiated it
if (!ui_temp_was_paused)
- machine->resume();
+ machine.resume();
ResetEvent(ui_pause_event);
}
@@ -918,7 +918,7 @@ void winwindow_ui_pause_from_main_thread(running_machine *machine, int pause)
// (window thread)
//============================================================
-void winwindow_ui_pause_from_window_thread(running_machine *machine, int pause)
+void winwindow_ui_pause_from_window_thread(running_machine &machine, int pause)
{
assert(GetCurrentThreadId() == window_threadid);
@@ -967,9 +967,9 @@ void winwindow_ui_exec_on_main_thread(void (*func)(void *), void *param)
// winwindow_ui_is_paused
//============================================================
-int winwindow_ui_is_paused(running_machine *machine)
+int winwindow_ui_is_paused(running_machine &machine)
{
- return machine->paused() && ui_temp_was_paused;
+ return machine.paused() && ui_temp_was_paused;
}
@@ -1120,9 +1120,9 @@ static int complete_create(win_window_info *window)
monitorbounds = window->monitor->info.rcMonitor;
// create the window menu if needed
- if (downcast<windows_options &>(window->machine->options()).menu())
+ if (downcast<windows_options &>(window->machine().options()).menu())
{
- if (win_create_menu(window->machine, &menu))
+ if (win_create_menu(window->machine(), &menu))
return 1;
}
@@ -1232,17 +1232,17 @@ LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wpar
// input events
case WM_MOUSEMOVE:
- ui_input_push_mouse_move_event(window->machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
+ ui_input_push_mouse_move_event(window->machine(), window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
break;
case WM_MOUSELEAVE:
- ui_input_push_mouse_leave_event(window->machine, window->target);
+ ui_input_push_mouse_leave_event(window->machine(), window->target);
break;
case WM_LBUTTONDOWN:
{
DWORD ticks = GetTickCount();
- ui_input_push_mouse_down_event(window->machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
+ ui_input_push_mouse_down_event(window->machine(), window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
// check for a double-click
if (ticks - window->lastclicktime < GetDoubleClickTime() &&
@@ -1250,7 +1250,7 @@ LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wpar
GET_Y_LPARAM(lparam) >= window->lastclicky - 4 && GET_Y_LPARAM(lparam) <= window->lastclicky + 4)
{
window->lastclicktime = 0;
- ui_input_push_mouse_double_click_event(window->machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
+ ui_input_push_mouse_double_click_event(window->machine(), window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
}
else
{
@@ -1262,25 +1262,25 @@ LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wpar
}
case WM_LBUTTONUP:
- ui_input_push_mouse_up_event(window->machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
+ ui_input_push_mouse_up_event(window->machine(), window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
break;
case WM_CHAR:
- ui_input_push_char_event(window->machine, window->target, (unicode_char) wparam);
+ ui_input_push_char_event(window->machine(), window->target, (unicode_char) wparam);
break;
// pause the system when we start a menu or resize
case WM_ENTERSIZEMOVE:
window->resize_state = RESIZE_STATE_RESIZING;
case WM_ENTERMENULOOP:
- winwindow_ui_pause_from_window_thread(window->machine, TRUE);
+ winwindow_ui_pause_from_window_thread(window->machine(), TRUE);
break;
// unpause the system when we stop a menu or resize and force a redraw
case WM_EXITSIZEMOVE:
window->resize_state = RESIZE_STATE_PENDING;
case WM_EXITMENULOOP:
- winwindow_ui_pause_from_window_thread(window->machine, FALSE);
+ winwindow_ui_pause_from_window_thread(window->machine(), FALSE);
InvalidateRect(wnd, NULL, FALSE);
break;
@@ -1336,7 +1336,7 @@ LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wpar
if (multithreading_enabled)
PostThreadMessage(main_threadid, WM_QUIT, 0, 0);
else
- window->machine->schedule_exit();
+ window->machine().schedule_exit();
break;
// destroy: clean up all attached rendering bits and NULL out our hwnd
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index 1db97dd1e80..689708ba960 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -68,6 +68,8 @@
typedef struct _win_window_info win_window_info;
struct _win_window_info
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
win_window_info * next;
volatile int init_state;
@@ -104,7 +106,7 @@ struct _win_window_info
// drawing data
void * drawdata;
- running_machine * machine;
+ running_machine * m_machine;
};
@@ -135,13 +137,13 @@ extern win_window_info *win_window_list;
//============================================================
// core initialization
-void winwindow_init(running_machine *machine);
+void winwindow_init(running_machine &machine);
// creation/deletion of windows
-void winwindow_video_window_create(running_machine *machine, int index, win_monitor_info *monitor, const win_window_config *config);
+void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const win_window_config *config);
BOOL winwindow_has_focus(void);
-void winwindow_update_cursor_state(running_machine *machine);
+void winwindow_update_cursor_state(running_machine &machine);
void winwindow_video_window_update(win_window_info *window);
win_monitor_info *winwindow_video_window_monitor(win_window_info *window, const RECT *proposed);
@@ -150,17 +152,17 @@ extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, W
void winwindow_toggle_full_screen(void);
-void winwindow_process_events_periodic(running_machine *machine);
-void winwindow_process_events(running_machine *machine, int ingame);
+void winwindow_process_events_periodic(running_machine &machine);
+void winwindow_process_events(running_machine &machine, int ingame);
-void winwindow_ui_pause_from_window_thread(running_machine *machine, int pause);
-void winwindow_ui_pause_from_main_thread(running_machine *machine, int pause);
-int winwindow_ui_is_paused(running_machine *machine);
+void winwindow_ui_pause_from_window_thread(running_machine &machine, int pause);
+void winwindow_ui_pause_from_main_thread(running_machine &machine, int pause);
+int winwindow_ui_is_paused(running_machine &machine);
void winwindow_ui_exec_on_main_thread(void (*func)(void *), void *param);
-void winwindow_dispatch_message(running_machine *machine, MSG *message);
+void winwindow_dispatch_message(running_machine &machine, MSG *message);
-extern int win_create_menu(running_machine *machine, HMENU *menus);
+extern int win_create_menu(running_machine &machine, HMENU *menus);
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 8ecd7e71852..8afb524c6c6 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -574,10 +574,10 @@ void windows_osd_interface::init(running_machine &machine)
}
// initialize the subsystems
- winvideo_init(&machine);
- winsound_init(&machine);
- wininput_init(&machine);
- winoutput_init(&machine);
+ winvideo_init(machine);
+ winsound_init(machine);
+ wininput_init(machine);
+ winoutput_init(machine);
// notify listeners of screen configuration
astring tempstring;
@@ -664,7 +664,7 @@ void windows_osd_interface::osd_exit(running_machine &machine)
timeEndPeriod(caps.wPeriodMin);
// one last pass at events
- winwindow_process_events(&machine, 0);
+ winwindow_process_events(machine, 0);
}
@@ -860,7 +860,7 @@ bitmap_t *windows_osd_interface::font_get_bitmap(osd_font font, unicode_char chn
bitmap_t *bitmap = NULL;
if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y)
{
- bitmap = auto_alloc(&machine(), bitmap_t(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y, BITMAP_FORMAT_ARGB32));
+ bitmap = auto_alloc(machine(), bitmap_t(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y, BITMAP_FORMAT_ARGB32));
// copy the bits into it
for (int y = 0; y < bitmap->height; y++)
diff --git a/src/osd/windows/winmenu.c b/src/osd/windows/winmenu.c
index 1b13a13e644..9e6b58f509b 100644
--- a/src/osd/windows/winmenu.c
+++ b/src/osd/windows/winmenu.c
@@ -61,7 +61,7 @@ LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM w
// win_create_menu
//============================================================
-int win_create_menu(running_machine *machine, HMENU *menus)
+int win_create_menu(running_machine &machine, HMENU *menus)
{
return 0;
}